aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-10-17 14:10:25 -0700
committerGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-10-17 14:10:25 -0700
commit7458b969c5d9971e89d187b687e1924e78da427e (patch)
treeee3dbf95c728cf407bf49a27826b541e9264a8bd
parentd4a2c29131ec154f5e4db897d4deedab2002cbc4 (diff)
parente91436e5248d947b50f90b4a7402690be8a41f39 (diff)
downloadbun-7458b969c5d9971e89d187b687e1924e78da427e.tar.gz
bun-7458b969c5d9971e89d187b687e1924e78da427e.tar.zst
bun-7458b969c5d9971e89d187b687e1924e78da427e.zip
Merge branch 'main' into postinstall_3
-rw-r--r--.github/ISSUE_TEMPLATE/2-bug-report.yml4
-rw-r--r--.github/ISSUE_TEMPLATE/3-feature-request.yml2
-rw-r--r--.github/workflows/bun-ecosystem-test.yml50
-rw-r--r--.github/workflows/bun-framework-next.yml41
-rw-r--r--.github/workflows/bun-linux-aarch64.yml3
-rw-r--r--.github/workflows/bun-linux-build.yml57
-rw-r--r--.github/workflows/bun-mac-aarch64.yml96
-rw-r--r--.github/workflows/bun-mac-x64-baseline.yml101
-rw-r--r--.github/workflows/bun-mac-x64.yml98
-rw-r--r--.github/workflows/bun-release-canary.yml179
-rw-r--r--.github/workflows/bun-release-types-canary.yml54
-rw-r--r--.github/workflows/bun-release.yml246
-rw-r--r--.github/workflows/prettier-fmt.yml2
-rw-r--r--.github/workflows/zig-fmt.yml4
-rw-r--r--.gitignore4
-rwxr-xr-x.scripts/postinstall.sh6
-rw-r--r--.vscode/c_cpp_properties.json85
-rw-r--r--.vscode/launch.json7
-rw-r--r--.vscode/settings.json11
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--Dockerfile39
-rw-r--r--Makefile75
-rw-r--r--README.md7
-rw-r--r--SECURITY.md12
-rw-r--r--bench/snippets/private.mjs20
-rw-r--r--bench/snippets/rmdir.mjs22
-rw-r--r--bench/snippets/write.node.mjs5
-rw-r--r--build.zig38
-rwxr-xr-xbun.lockbbin73707 -> 74396 bytes
-rw-r--r--bunfig.toml6
-rw-r--r--completions/bun.bash6
-rw-r--r--completions/bun.zsh1245
-rw-r--r--completions/spec.yaml9
-rw-r--r--dockerhub/Dockerfile-alpine29
-rw-r--r--dockerhub/Dockerfile-debian77
-rw-r--r--dockerhub/alpine/Dockerfile113
-rwxr-xr-xdockerhub/alpine/docker-entrypoint.sh (renamed from dockerhub/docker-entrypoint.sh)0
-rw-r--r--dockerhub/debian-slim/Dockerfile26
-rw-r--r--dockerhub/debian/Dockerfile30
-rw-r--r--dockerhub/distroless/Dockerfile (renamed from dockerhub/Dockerfile-distroless)24
-rw-r--r--docs/api/binary-data.md10
-rw-r--r--docs/api/file-io.md2
-rw-r--r--docs/api/file-system-router.md1
-rw-r--r--docs/api/http.md6
-rw-r--r--docs/api/import-meta.md2
-rw-r--r--docs/api/spawn.md54
-rw-r--r--docs/api/sqlite.md14
-rw-r--r--docs/api/transpiler.md2
-rw-r--r--docs/api/utils.md4
-rw-r--r--docs/api/websockets.md17
-rw-r--r--docs/api/workers.md21
-rw-r--r--docs/bundler/index.md20
-rw-r--r--docs/bundler/intro.md2
-rw-r--r--docs/bundler/loaders.md2
-rw-r--r--docs/bundler/macros.md2
-rw-r--r--docs/bundler/vs-esbuild.md6
-rw-r--r--docs/cli/add.md155
-rw-r--r--docs/cli/bun-create.md (renamed from docs/templates.md)36
-rw-r--r--docs/cli/bun-install.md13
-rw-r--r--docs/cli/bundler.md2
-rw-r--r--docs/cli/create.md256
-rw-r--r--docs/cli/init.md (renamed from docs/cli/bun-init.md)28
-rw-r--r--docs/cli/install.md273
-rw-r--r--docs/cli/link.md46
-rw-r--r--docs/cli/pm.md (renamed from docs/install/utilities.md)0
-rw-r--r--docs/cli/remove.md5
-rw-r--r--docs/cli/run.md69
-rw-r--r--docs/cli/test.md41
-rw-r--r--docs/cli/update.md7
-rw-r--r--docs/dev/css.md2
-rw-r--r--docs/dev/frameworks.md151
-rw-r--r--docs/dev/nextjs.md33
-rw-r--r--docs/guides/binary/blob-to-stream.md2
-rw-r--r--docs/guides/binary/blob-to-string.md2
-rw-r--r--docs/guides/ecosystem/astro.md18
-rw-r--r--docs/guides/ecosystem/discordjs.md2
-rw-r--r--docs/guides/ecosystem/docker.md140
-rw-r--r--docs/guides/ecosystem/elysia.md2
-rw-r--r--docs/guides/ecosystem/hono.md2
-rw-r--r--docs/guides/ecosystem/nextjs.md17
-rw-r--r--docs/guides/ecosystem/nuxt.md2
-rw-r--r--docs/guides/ecosystem/pm2.md54
-rw-r--r--docs/guides/ecosystem/prisma.md47
-rw-r--r--docs/guides/ecosystem/qwik.md107
-rw-r--r--docs/guides/ecosystem/react.md47
-rw-r--r--docs/guides/ecosystem/remix.md24
-rw-r--r--docs/guides/ecosystem/solidstart.md2
-rw-r--r--docs/guides/ecosystem/sveltekit.md4
-rw-r--r--docs/guides/ecosystem/systemd.md113
-rw-r--r--docs/guides/ecosystem/vite.md5
-rw-r--r--docs/guides/http/file-uploads.md2
-rw-r--r--docs/guides/install/azure-artifacts.md73
-rw-r--r--docs/guides/install/custom-registry.md2
-rw-r--r--docs/guides/install/jfrog-artifactory.md28
-rw-r--r--docs/guides/install/registry-scope.md8
-rw-r--r--docs/guides/install/trusted.md50
-rw-r--r--docs/guides/install/workspaces.md8
-rw-r--r--docs/guides/process/ipc.md66
-rw-r--r--docs/guides/read-file/exists.md2
-rw-r--r--docs/guides/read-file/stream.md2
-rw-r--r--docs/guides/runtime/read-env.md2
-rw-r--r--docs/guides/runtime/set-env.md2
-rw-r--r--docs/guides/runtime/tsconfig-paths.md4
-rw-r--r--docs/guides/runtime/typescript.md69
-rw-r--r--docs/guides/runtime/vscode-debugger.md6
-rw-r--r--docs/guides/test/happy-dom.md2
-rw-r--r--docs/guides/test/migrate-from-jest.md112
-rw-r--r--docs/guides/test/mock-functions.md2
-rw-r--r--docs/guides/test/spy-on.md2
-rw-r--r--docs/guides/util/entrypoint.md4
-rw-r--r--docs/guides/websocket/context.md2
-rw-r--r--docs/guides/websocket/simple.md2
-rw-r--r--docs/index.md9
-rw-r--r--docs/install/index.md4
-rw-r--r--docs/install/lifecycle.md44
-rw-r--r--docs/install/lockfile.md30
-rw-r--r--docs/install/overrides.md73
-rw-r--r--docs/install/workspaces.md51
-rw-r--r--docs/installation.md134
-rw-r--r--docs/nav.ts51
-rw-r--r--docs/project/contributing.md (renamed from docs/project/development.md)100
-rw-r--r--docs/quickstart.md18
-rw-r--r--docs/runtime/bunfig.md429
-rw-r--r--docs/runtime/configuration.md210
-rw-r--r--docs/runtime/env.md147
-rw-r--r--docs/runtime/hot.md21
-rw-r--r--docs/runtime/jsx.md4
-rw-r--r--docs/runtime/modules.md189
-rw-r--r--docs/runtime/nodejs-apis.md725
-rw-r--r--docs/runtime/plugins.md104
-rw-r--r--docs/runtime/typescript.md109
-rw-r--r--docs/test/lifecycle.md8
-rw-r--r--docs/test/mocks.md40
-rw-r--r--docs/test/writing.md106
-rw-r--r--docs/typescript.md73
-rw-r--r--misctools/cold-jsc-start.cpp10
-rw-r--r--misctools/mime.js6
-rw-r--r--misctools/nodejs-compat.ts210
-rw-r--r--package.json3
-rw-r--r--packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts2
-rw-r--r--packages/bun-debug-adapter-protocol/src/protocol/index.d.ts22
-rw-r--r--packages/bun-debug-adapter-protocol/src/protocol/protocol.json20
-rw-r--r--packages/bun-ecosystem/.gitignore3
-rw-r--r--packages/bun-ecosystem/README.md7
-rwxr-xr-xpackages/bun-ecosystem/bun.lockbbin8536 -> 0 bytes
-rw-r--r--packages/bun-ecosystem/package.json15
-rw-r--r--packages/bun-ecosystem/src/packages.ts69
-rw-r--r--packages/bun-ecosystem/src/runner.ts92
-rw-r--r--packages/bun-ecosystem/tsconfig.json16
-rw-r--r--packages/bun-framework-next/.npmignore5
-rw-r--r--packages/bun-framework-next/README.md25
-rw-r--r--packages/bun-framework-next/appInjector.js15
-rwxr-xr-xpackages/bun-framework-next/bun.lockbbin13004 -> 0 bytes
-rw-r--r--packages/bun-framework-next/client.development.tsx463
-rw-r--r--packages/bun-framework-next/empty.js1
-rw-r--r--packages/bun-framework-next/fallback.development.tsx102
-rw-r--r--packages/bun-framework-next/next-image-polyfill.tsx36
-rw-r--r--packages/bun-framework-next/package.json101
-rw-r--r--packages/bun-framework-next/packageVersion.ts44
-rw-r--r--packages/bun-framework-next/page-loader.ts138
-rw-r--r--packages/bun-framework-next/renderDocument.tsx835
-rw-r--r--packages/bun-framework-next/server.development.tsx91
-rw-r--r--packages/bun-framework-next/tsconfig.json28
-rw-r--r--packages/bun-inspector-protocol/scripts/generate-protocol.ts2
-rw-r--r--packages/bun-inspector-protocol/src/protocol/v8/index.d.ts245
-rw-r--r--packages/bun-inspector-protocol/src/protocol/v8/protocol.json209
-rw-r--r--packages/bun-inspector-protocol/src/util/preview.ts5
-rwxr-xr-xpackages/bun-internal-test/bun.lockbbin3218 -> 3658 bytes
-rw-r--r--packages/bun-lambda/README.md2
-rw-r--r--packages/bun-lambda/package.json1
-rw-r--r--packages/bun-types/README.md10
-rw-r--r--packages/bun-types/buffer.d.ts46
-rw-r--r--packages/bun-types/bun-test.d.ts49
-rw-r--r--packages/bun-types/bun.d.ts100
-rw-r--r--packages/bun-types/dns.d.ts14
-rw-r--r--packages/bun-types/globals.d.ts63
-rw-r--r--packages/bun-types/package.json3
-rw-r--r--packages/bun-types/scripts/bundle.ts2
-rw-r--r--packages/bun-types/tests/array-buffer.test-d.ts3
-rw-r--r--packages/bun-types/tests/bun.test-d.ts3
-rw-r--r--packages/bun-types/tests/dns.test-d.ts5
-rw-r--r--packages/bun-types/tests/test.test-d.ts72
-rw-r--r--packages/bun-types/tsconfig.json4
-rw-r--r--packages/bun-types/ws.d.ts4
-rw-r--r--packages/bun-usockets/src/bsd.c51
-rw-r--r--packages/bun-usockets/src/context.c3
-rw-r--r--packages/bun-usockets/src/crypto/openssl.c2
-rw-r--r--packages/bun-usockets/src/eventing/epoll_kqueue.c37
-rw-r--r--packages/bun-usockets/src/libusockets.h5
-rw-r--r--packages/bun-usockets/src/loop.c2
-rw-r--r--packages/bun-usockets/src/socket.c85
-rw-r--r--packages/bun-uws/capi/examples/Broadcast.c4
-rw-r--r--packages/bun-uws/capi/examples/HelloWorldAsync.c4
-rw-r--r--packages/bun-uws/capi/examples/UpgradeAsync.c4
-rw-r--r--packages/bun-uws/capi/libuwebsockets.h1
-rw-r--r--packages/bun-uws/examples/UpgradeAsync.cpp2
-rw-r--r--packages/bun-uws/src/AsyncSocket.h11
-rw-r--r--packages/bun-uws/src/HttpResponse.h30
-rw-r--r--packages/bun-uws/src/Loop.h8
-rw-r--r--packages/bun-uws/src/LoopData.h1
-rw-r--r--packages/bun-vscode/README.md14
-rw-r--r--packages/bun-vscode/assets/vscode.css69
-rw-r--r--[-rwxr-xr-x]packages/bun-vscode/bun.lockbbin53586 -> 53586 bytes
-rw-r--r--packages/bun-vscode/example/package.json6
-rw-r--r--packages/bun-vscode/package.json38
-rw-r--r--packages/bun-vscode/scripts/build.mjs3
-rw-r--r--packages/bun-vscode/src/extension.ts12
-rw-r--r--packages/bun-vscode/src/features/debug.ts88
-rw-r--r--packages/bun-vscode/src/features/lockfile.ts79
-rw-r--r--packages/bun-vscode/src/features/lockfile/index.ts109
-rw-r--r--packages/bun-vscode/src/features/lockfile/lockfile.style.ts35
-rw-r--r--packages/bun-vscode/src/features/tasks/package.json.ts201
-rw-r--r--packages/bun-vscode/src/features/tasks/tasks.ts59
-rw-r--r--src/baby_list.zig8
-rw-r--r--src/build-id2
m---------src/bun.js/WebKit0
-rw-r--r--src/bun.js/api/JSTranspiler.zig6
-rw-r--r--src/bun.js/api/bun.zig18
-rw-r--r--src/bun.js/api/bun/dns_resolver.zig335
-rw-r--r--src/bun.js/api/bun/socket.zig37
-rw-r--r--src/bun.js/api/bun/subprocess.zig62
-rw-r--r--src/bun.js/api/bun/x509.zig6
-rw-r--r--src/bun.js/api/ffi.zig6
-rw-r--r--src/bun.js/api/html_rewriter.zig28
-rw-r--r--src/bun.js/api/server.classes.ts8
-rw-r--r--src/bun.js/api/server.zig272
-rw-r--r--src/bun.js/base.zig34
-rw-r--r--src/bun.js/bindings/AsyncContextFrame.cpp4
-rw-r--r--src/bun.js/bindings/BunDebugger.cpp5
-rw-r--r--src/bun.js/bindings/BunObject.cpp47
-rw-r--r--src/bun.js/bindings/BunObject.h2
-rw-r--r--src/bun.js/bindings/BunObject.lut.h2
-rw-r--r--src/bun.js/bindings/BunPlugin.cpp255
-rw-r--r--src/bun.js/bindings/BunPlugin.h22
-rw-r--r--src/bun.js/bindings/BunString.cpp40
-rw-r--r--src/bun.js/bindings/CallSite.cpp2
-rw-r--r--src/bun.js/bindings/CallSitePrototype.h1
-rw-r--r--src/bun.js/bindings/CommonJSModuleRecord.cpp297
-rw-r--r--src/bun.js/bindings/CommonJSModuleRecord.h44
-rw-r--r--src/bun.js/bindings/DOMURL.cpp33
-rw-r--r--src/bun.js/bindings/DOMURL.h1
-rw-r--r--src/bun.js/bindings/ErrorStackTrace.cpp92
-rw-r--r--src/bun.js/bindings/ErrorStackTrace.h12
-rw-r--r--src/bun.js/bindings/FFI.zig3
-rw-r--r--src/bun.js/bindings/ImportMetaObject.cpp47
-rw-r--r--src/bun.js/bindings/InternalModuleRegistry.cpp21
-rw-r--r--src/bun.js/bindings/InternalModuleRegistry.h17
-rw-r--r--src/bun.js/bindings/JSBuffer.cpp111
-rw-r--r--src/bun.js/bindings/JSBuffer.lut.h52
-rw-r--r--src/bun.js/bindings/JSBufferList.cpp28
-rw-r--r--src/bun.js/bindings/JSBufferList.h3
-rw-r--r--src/bun.js/bindings/JSBundlerPlugin.cpp2
-rw-r--r--src/bun.js/bindings/JSCUSocketsLoopIntegration.cpp30
-rw-r--r--src/bun.js/bindings/JSDOMFile.cpp11
-rw-r--r--src/bun.js/bindings/JSDOMWrapperCache.h4
-rw-r--r--src/bun.js/bindings/JSMockFunction.cpp4
-rw-r--r--src/bun.js/bindings/JSNextTickQueue.cpp6
-rw-r--r--src/bun.js/bindings/JSNextTickQueue.h1
-rw-r--r--src/bun.js/bindings/JSReadableState.cpp12
-rw-r--r--src/bun.js/bindings/JSReadableState.h1
-rw-r--r--src/bun.js/bindings/JSSink.cpp64
-rw-r--r--src/bun.js/bindings/JSSocketAddress.cpp63
-rw-r--r--src/bun.js/bindings/JSSocketAddress.h16
-rw-r--r--src/bun.js/bindings/JSStringDecoder.h1
-rw-r--r--src/bun.js/bindings/KeyObject.cpp2389
-rw-r--r--src/bun.js/bindings/KeyObject.h18
-rw-r--r--src/bun.js/bindings/ModuleLoader.cpp20
-rw-r--r--src/bun.js/bindings/ModuleLoader.h3
-rw-r--r--src/bun.js/bindings/NodeVMScript.cpp8
-rw-r--r--src/bun.js/bindings/Path.cpp2
-rw-r--r--src/bun.js/bindings/Process.cpp162
-rw-r--r--src/bun.js/bindings/Process.h17
-rw-r--r--src/bun.js/bindings/Process.lut.h118
-rw-r--r--src/bun.js/bindings/ProcessBindingConstants.cpp25
-rw-r--r--src/bun.js/bindings/ProcessBindingConstants.h4
-rw-r--r--src/bun.js/bindings/ProcessBindingConstants.lut.h31
-rw-r--r--src/bun.js/bindings/ProcessBindingNatives.cpp131
-rw-r--r--src/bun.js/bindings/ProcessBindingNatives.h36
-rw-r--r--src/bun.js/bindings/ProcessBindingNatives.lut.h339
-rw-r--r--src/bun.js/bindings/ProcessBindingUV.cpp158
-rw-r--r--src/bun.js/bindings/ProcessBindingUV.h13
-rw-r--r--src/bun.js/bindings/RegularExpression.cpp4
-rw-r--r--src/bun.js/bindings/ScriptExecutionContext.cpp4
-rw-r--r--src/bun.js/bindings/Serialization.cpp32
-rw-r--r--src/bun.js/bindings/URLDecomposition.cpp9
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses+DOMClientIsoSubspaces.h1
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses+DOMIsoSubspaces.h1
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h306
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h109
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses.cpp563
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses.h60
-rw-r--r--src/bun.js/bindings/ZigGeneratedCode.cpp39
-rw-r--r--src/bun.js/bindings/ZigGlobalObject.cpp1631
-rw-r--r--src/bun.js/bindings/ZigGlobalObject.h164
-rw-r--r--src/bun.js/bindings/ZigGlobalObject.lut.h341
-rw-r--r--src/bun.js/bindings/ZigGlobalObject.lut.txt82
-rw-r--r--src/bun.js/bindings/ZigLazyStaticFunctions-inlines.h2
-rw-r--r--src/bun.js/bindings/ZigSourceProvider.cpp1
-rw-r--r--src/bun.js/bindings/ZigSourceProvider.h3
-rw-r--r--src/bun.js/bindings/bindings.cpp200
-rw-r--r--src/bun.js/bindings/bindings.zig54
-rw-r--r--src/bun.js/bindings/c-bindings.cpp29
-rw-r--r--src/bun.js/bindings/exports.zig58
-rw-r--r--src/bun.js/bindings/generated_classes.zig205
-rw-r--r--src/bun.js/bindings/generated_classes_list.zig1
-rw-r--r--src/bun.js/bindings/headers-handwritten.h24
-rw-r--r--src/bun.js/bindings/isBuiltinModule.cpp98
-rw-r--r--src/bun.js/bindings/isBuiltinModule.h5
-rw-r--r--src/bun.js/bindings/napi.cpp124
-rw-r--r--src/bun.js/bindings/process.d.ts8
-rw-r--r--src/bun.js/bindings/sqlite/JSSQLStatement.cpp38
-rw-r--r--src/bun.js/bindings/sqlite/JSSQLStatement.h17
-rw-r--r--src/bun.js/bindings/sqlite/lazy_sqlite3.h4
-rw-r--r--src/bun.js/bindings/webcore/AbortSignal.h7
-rw-r--r--src/bun.js/bindings/webcore/JSDOMURL.cpp29
-rw-r--r--src/bun.js/bindings/webcore/JSEventEmitter.cpp7
-rw-r--r--src/bun.js/bindings/webcore/JSFetchHeaders.cpp30
-rw-r--r--src/bun.js/bindings/webcore/JSFetchHeaders.h2
-rw-r--r--src/bun.js/bindings/webcore/JSMessageEvent.cpp2
-rw-r--r--src/bun.js/bindings/webcore/JSReadableStream.cpp2
-rw-r--r--src/bun.js/bindings/webcore/JSReadableStreamDefaultController.cpp2
-rw-r--r--src/bun.js/bindings/webcore/JSReadableStreamDefaultReader.cpp2
-rw-r--r--src/bun.js/bindings/webcore/JSURLSearchParams.cpp1
-rw-r--r--src/bun.js/bindings/webcore/MessagePort.cpp12
-rw-r--r--src/bun.js/bindings/webcore/MessagePortChannel.cpp12
-rw-r--r--src/bun.js/bindings/webcore/MessagePortChannelProvider.cpp3
-rw-r--r--src/bun.js/bindings/webcore/MessagePortChannelRegistry.cpp41
-rw-r--r--src/bun.js/bindings/webcore/WebCoreTypedArrayController.cpp12
-rw-r--r--src/bun.js/bindings/webcore/WebSocket.cpp21
-rw-r--r--src/bun.js/bindings/webcrypto/CryptoKeyAES.cpp4
-rw-r--r--src/bun.js/bindings/webcrypto/CryptoKeyEC.h4
-rw-r--r--src/bun.js/bindings/webcrypto/CryptoKeyECOpenSSL.cpp7
-rw-r--r--src/bun.js/bindings/webcrypto/CryptoKeyHMAC.cpp14
-rw-r--r--src/bun.js/bindings/webcrypto/CryptoKeyHMAC.h2
-rw-r--r--src/bun.js/bindings/webcrypto/CryptoKeyOKP.cpp29
-rw-r--r--src/bun.js/bindings/webcrypto/CryptoKeyOKP.h2
-rw-r--r--src/bun.js/bindings/webcrypto/CryptoKeyOKPOpenSSL.cpp12
-rw-r--r--src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp23
-rw-r--r--src/bun.js/bindings/webcrypto/JSCryptoKey.cpp2
-rw-r--r--src/bun.js/bindings/webcrypto/JSJsonWebKey.cpp6
-rw-r--r--src/bun.js/bindings/webcrypto/JSJsonWebKey.h2
-rw-r--r--src/bun.js/bindings/wtf-bindings.cpp22
-rw-r--r--src/bun.js/bindings/wtf-bindings.h4
-rw-r--r--src/bun.js/event_loop.zig303
-rw-r--r--src/bun.js/ipc.zig144
-rw-r--r--src/bun.js/javascript.zig189
-rw-r--r--src/bun.js/module_loader.zig112
-rw-r--r--src/bun.js/modules/BunJSCModule.h4
-rw-r--r--src/bun.js/modules/NodeConstantsModule.h759
-rw-r--r--src/bun.js/modules/NodeModuleModule.h72
-rw-r--r--src/bun.js/modules/NodeUtilTypesModule.h5
-rw-r--r--src/bun.js/modules/_NativeModule.h9
-rw-r--r--src/bun.js/node/node_fs.zig2190
-rw-r--r--src/bun.js/node/node_fs_binding.zig62
-rw-r--r--src/bun.js/node/node_fs_constant.zig71
-rw-r--r--src/bun.js/node/node_fs_stat_watcher.zig4
-rw-r--r--src/bun.js/node/node_os.zig3
-rw-r--r--src/bun.js/node/path_watcher.zig13
-rw-r--r--src/bun.js/node/types.zig132
-rw-r--r--src/bun.js/rare_data.zig26
-rwxr-xr-xsrc/bun.js/scripts/create_hash_table461
-rw-r--r--src/bun.js/scripts/generate-classes.ts52
-rw-r--r--src/bun.js/scripts/generate-jssink.js18
-rw-r--r--src/bun.js/test/expect.zig131
-rw-r--r--src/bun.js/test/jest.classes.ts16
-rw-r--r--src/bun.js/test/jest.zig43
-rw-r--r--src/bun.js/webcore.zig9
-rw-r--r--src/bun.js/webcore/blob.zig58
-rw-r--r--src/bun.js/webcore/body.zig171
-rw-r--r--src/bun.js/webcore/encoding.classes.ts3
-rw-r--r--src/bun.js/webcore/encoding.zig38
-rw-r--r--src/bun.js/webcore/request.zig49
-rw-r--r--src/bun.js/webcore/response.zig292
-rw-r--r--src/bun.js/webcore/streams.zig61
-rw-r--r--src/bun.zig99
-rw-r--r--src/bun_js.zig6
-rw-r--r--src/bundler.zig22
-rw-r--r--src/bundler/bundle_v2.zig47
-rw-r--r--src/bundler/entry_points.zig32
-rw-r--r--src/bunfig.zig90
-rw-r--r--src/cli.zig50
-rw-r--r--src/cli/bunx_command.zig193
-rw-r--r--src/cli/create_command.zig659
-rw-r--r--src/cli/gitignore-for-init4
-rw-r--r--src/cli/package_manager_command.zig29
-rw-r--r--src/cli/run_command.zig42
-rw-r--r--src/cli/test_command.zig11
-rw-r--r--src/cli/tsconfig-for-init.json2
-rw-r--r--src/cli/upgrade_command.zig7
-rw-r--r--src/darwin_c.zig23
-rw-r--r--src/deps/_libusockets.h5
-rw-r--r--src/deps/c_ares.zig134
-rw-r--r--src/deps/libuwsockets.cpp64
-rw-r--r--src/deps/lol-html.zig2
-rw-r--r--src/deps/uws.zig151
-rw-r--r--src/env_loader.zig40
-rw-r--r--src/fs.zig9
-rw-r--r--src/http/mime_type.zig2
-rw-r--r--src/http_client_async.zig335
-rw-r--r--src/identity_context.zig10
-rw-r--r--src/import_record.zig17
-rw-r--r--src/install/bin.zig65
-rw-r--r--src/install/dependency.zig213
-rw-r--r--src/install/extract_tarball.zig4
-rw-r--r--src/install/install.zig820
-rw-r--r--src/install/integrity.zig47
-rw-r--r--src/install/lockfile.zig1187
-rw-r--r--src/install/migration.zig947
-rw-r--r--src/install/npm.zig124
-rw-r--r--src/install/padding_checker.zig17
-rw-r--r--src/install/repository.zig28
-rw-r--r--src/install/resolution.zig97
-rw-r--r--src/install/semver.zig19
-rw-r--r--src/js/README.md2
-rw-r--r--src/js/_codegen/build-functions.ts90
-rw-r--r--src/js/_codegen/build-modules.ts34
-rw-r--r--src/js/_codegen/builtin-parser.ts6
-rw-r--r--src/js/_codegen/client-js.ts17
-rw-r--r--src/js/_codegen/helpers.ts9
-rw-r--r--src/js/_codegen/replacements.ts55
-rw-r--r--src/js/_codegen/static-hash-tables.ts43
-rw-r--r--src/js/builtins.d.ts18
-rw-r--r--src/js/builtins/BunBuiltinNames.h19
-rw-r--r--src/js/builtins/BundlerPlugin.ts3
-rw-r--r--src/js/builtins/ConsoleObject.ts840
-rw-r--r--src/js/builtins/ImportMetaObject.ts20
-rw-r--r--src/js/builtins/JSBufferConstructor.ts3
-rw-r--r--src/js/builtins/Module.ts19
-rw-r--r--src/js/builtins/ProcessObjectInternals.ts43
-rw-r--r--src/js/builtins/ReadableStream.ts9
-rw-r--r--src/js/builtins/ReadableStreamInternals.ts13
-rw-r--r--src/js/builtins/tsconfig.json4
-rw-r--r--src/js/bun/ffi.ts2
-rw-r--r--src/js/bun/sqlite.ts14
-rw-r--r--src/js/internal/debugger.ts4
-rw-r--r--src/js/internal/primordials.js219
-rw-r--r--src/js/internal/util/README.md77
-rw-r--r--src/js/internal/util/inspect.d.ts347
-rw-r--r--src/js/internal/util/inspect.js2770
-rw-r--r--src/js/node/assert.js36
-rw-r--r--src/js/node/async_hooks.ts127
-rw-r--r--src/js/node/child_process.js109
-rw-r--r--src/js/node/crypto.js573
-rw-r--r--src/js/node/diagnostics_channel.js2
-rw-r--r--src/js/node/dns.js23
-rw-r--r--src/js/node/domain.ts8
-rw-r--r--src/js/node/events.js66
-rw-r--r--src/js/node/fs.js109
-rw-r--r--src/js/node/fs.promises.ts107
-rw-r--r--src/js/node/http.ts95
-rw-r--r--src/js/node/net.js164
-rw-r--r--src/js/node/os.ts3
-rw-r--r--src/js/node/querystring.js6
-rw-r--r--src/js/node/readline.js191
-rw-r--r--src/js/node/stream.js86
-rw-r--r--src/js/node/tls.js83
-rw-r--r--src/js/node/tty.js39
-rw-r--r--src/js/node/url.js5
-rw-r--r--src/js/node/util.js356
-rw-r--r--src/js/node/worker_threads.ts6
-rw-r--r--src/js/node/zlib.js22
-rw-r--r--src/js/out/InternalModuleRegistry+createInternalModuleById.h6
-rw-r--r--src/js/out/InternalModuleRegistry+enum.h112
-rw-r--r--src/js/out/InternalModuleRegistry+numberOfModules.h2
-rw-r--r--src/js/out/InternalModuleRegistryConstants.h384
-rw-r--r--src/js/out/ResolvedSourceTag.zig113
-rw-r--r--src/js/out/SyntheticModuleType.h112
-rw-r--r--src/js/out/WebCoreJSBuiltins.cpp4928
-rw-r--r--src/js/out/WebCoreJSBuiltins.d.ts336
-rw-r--r--src/js/out/WebCoreJSBuiltins.h7965
-rw-r--r--src/js/private.d.ts30
-rw-r--r--src/js/thirdparty/ws.js4
-rw-r--r--src/js_ast.zig10
-rw-r--r--src/js_lexer.zig2
-rw-r--r--src/js_parser.zig1247
-rw-r--r--src/js_printer.zig44
-rw-r--r--src/jsc.zig1
-rw-r--r--src/libarchive/libarchive.zig4
-rw-r--r--src/logger.zig47
-rw-r--r--src/main.zig17
-rw-r--r--src/multi_array_list.zig380
-rw-r--r--src/napi/napi.zig21
-rw-r--r--src/node-fallbacks/tsconfig.json4
-rw-r--r--src/options.zig4
-rw-r--r--src/report.zig31
-rw-r--r--src/resolver/data_url.zig20
-rw-r--r--src/resolver/resolve_path.zig20
-rw-r--r--src/resolver/resolver.zig45
-rw-r--r--src/resolver/tsconfig_json.zig9
-rw-r--r--src/runtime.footer.bun.js5
-rw-r--r--src/runtime.footer.js5
-rw-r--r--src/runtime.footer.node.js5
-rw-r--r--src/runtime.footer.with-refresh.js5
-rw-r--r--src/runtime.js22
-rw-r--r--src/runtime.zig19
-rw-r--r--src/sourcemap/sourcemap.zig4
-rw-r--r--src/string.zig23
-rw-r--r--src/string_immutable.zig36
-rw-r--r--src/string_mutable.zig2
-rw-r--r--src/symbols.dyn2
-rw-r--r--src/symbols.txt2
-rw-r--r--src/sys.zig13
-rw-r--r--src/tagged_pointer.zig6
-rw-r--r--src/url.zig9
-rw-r--r--src/watcher.zig1
-rw-r--r--src/zlib.zig2
-rw-r--r--test/.gitignore1
-rw-r--r--test/README.md83
-rwxr-xr-xtest/bun.lockbbin153669 -> 177991 bytes
-rw-r--r--test/bundler/__snapshots__/bun-build-api.test.ts.snap6
-rw-r--r--test/bundler/bun-build-api.test.ts23
-rw-r--r--test/bundler/bundler_decorator_metadata.test.ts1265
-rw-r--r--test/bundler/bundler_minify.test.ts21
-rw-r--r--test/cli/install/__snapshots__/bun-pm.test.ts.snap3
-rw-r--r--test/cli/install/boba-0.0.2.tgzbin0 -> 221 bytes
-rw-r--r--test/cli/install/bun-add.test.ts152
-rw-r--r--test/cli/install/bun-create.test.ts31
-rw-r--r--test/cli/install/bun-install.test.ts1598
-rw-r--r--test/cli/install/bun-link.test.ts8
-rw-r--r--test/cli/install/bun-pm.test.ts130
-rw-r--r--test/cli/install/bun-remove.test.ts2
-rw-r--r--test/cli/install/bun-run.test.ts90
-rw-r--r--test/cli/install/bun-update.test.ts78
-rw-r--r--test/cli/install/bunx.test.ts97
-rw-r--r--test/cli/install/dummy.registry.ts11
-rw-r--r--test/cli/install/loader-runner-4.3.0.tgzbin0 -> 200 bytes
-rw-r--r--test/cli/install/migration/add-while-migrate-fixture.json210
-rw-r--r--test/cli/install/migration/add-while-migrate-workspace/package.json6
-rw-r--r--test/cli/install/migration/add-while-migrate-workspace/packages/a/package.json7
-rw-r--r--test/cli/install/migration/add-while-migrate-workspace/packages/b/package.json7
-rw-r--r--test/cli/install/migration/complex-workspace.test.ts121
-rw-r--r--test/cli/install/migration/complex-workspace/.gitignore2
-rw-r--r--test/cli/install/migration/complex-workspace/bun-types/isfake.txt1
-rw-r--r--test/cli/install/migration/complex-workspace/bun-types/package.json7
-rw-r--r--test/cli/install/migration/complex-workspace/hello-0.3.2.tgzbin0 -> 196 bytes
-rw-r--r--test/cli/install/migration/complex-workspace/package-lock.json2164
-rw-r--r--test/cli/install/migration/complex-workspace/package.json16
-rw-r--r--test/cli/install/migration/complex-workspace/packages/body-parser/isfake.txt1
-rw-r--r--test/cli/install/migration/complex-workspace/packages/body-parser/package.json7
-rw-r--r--test/cli/install/migration/complex-workspace/packages/lol-package/package.json6
-rw-r--r--test/cli/install/migration/complex-workspace/packages/second/package.json12
-rw-r--r--test/cli/install/migration/complex-workspace/packages/with-postinstall/.gitignore1
-rw-r--r--test/cli/install/migration/complex-workspace/packages/with-postinstall/package.json11
-rw-r--r--test/cli/install/migration/complex-workspace/packages/with-postinstall/postinstall.js6
-rw-r--r--test/cli/install/migration/complex-workspace/readme.md1
-rw-r--r--test/cli/install/migration/complex-workspace/reset.ts9
-rw-r--r--test/cli/install/migration/contoso-test/.gitignore2
-rw-r--r--test/cli/install/migration/contoso-test/LICENSE21
-rw-r--r--test/cli/install/migration/contoso-test/api/package.json42
-rw-r--r--test/cli/install/migration/contoso-test/blog-cms/package.json34
-rw-r--r--test/cli/install/migration/contoso-test/blog/package.json38
-rw-r--r--test/cli/install/migration/contoso-test/package-lock.json36716
-rw-r--r--test/cli/install/migration/contoso-test/package.json17
-rw-r--r--test/cli/install/migration/contoso-test/packages/api/package.json42
-rw-r--r--test/cli/install/migration/contoso-test/packages/blog-cms/package.json34
-rw-r--r--test/cli/install/migration/contoso-test/packages/blog/package.json38
-rw-r--r--test/cli/install/migration/contoso-test/packages/portal/package.json52
-rw-r--r--test/cli/install/migration/contoso-test/packages/stripe/package.json40
-rw-r--r--test/cli/install/migration/contoso-test/packages/testing/package.json17
-rw-r--r--test/cli/install/migration/contoso-test/portal/package.json52
-rw-r--r--test/cli/install/migration/contoso-test/stripe/package.json40
-rw-r--r--test/cli/install/migration/contoso-test/testing/package.json17
-rw-r--r--test/cli/install/migration/migrate.test.ts54
-rw-r--r--test/cli/install/moo-0.2.0.tgzbin0 -> 223 bytes
-rw-r--r--test/cli/install/overrides.test.ts189
-rw-r--r--test/cli/install/peer-0.0.1.tgzbin0 -> 194 bytes
-rw-r--r--test/cli/install/peer-0.0.2.tgzbin0 -> 194 bytes
-rw-r--r--test/cli/install/qux-0.0.2.tgzbin0 -> 283 bytes
-rw-r--r--test/cli/run/empty-file.js (renamed from packages/bun-framework-next/next_document.tsx)0
-rw-r--r--test/cli/run/empty-file.test.ts15
-rw-r--r--test/cli/run/env.test.ts10
-rw-r--r--test/cli/run/if-present.test.ts119
-rw-r--r--test/cli/run/log-test.test.ts2
-rw-r--r--test/cli/run/require-cache-bug-5188.js22
-rw-r--r--test/cli/run/require-cache-fixture-b.cjs7
-rw-r--r--test/cli/run/require-cache-fixture.cjs10
-rw-r--r--test/cli/run/require-cache.test.js15
-rw-r--r--test/cli/run/require-cache.test.ts27
-rw-r--r--test/cli/run/run-cjs.test.ts2
-rw-r--r--test/cli/run/run-extensionless.test.ts31
-rw-r--r--test/cli/run/run-unicode.test.ts21
-rw-r--r--test/cli/test/bun-test.test.ts23
-rw-r--r--test/harness.ts3
-rw-r--r--test/integration/next/default-pages-dir/.eslintrc.json3
-rw-r--r--test/integration/next/default-pages-dir/.gitignore38
-rw-r--r--test/integration/next/default-pages-dir/README.md40
-rwxr-xr-xtest/integration/next/default-pages-dir/bun.lockbbin0 -> 167519 bytes
-rw-r--r--test/integration/next/default-pages-dir/next.config.js10
-rw-r--r--test/integration/next/default-pages-dir/package.json28
-rw-r--r--test/integration/next/default-pages-dir/postcss.config.js6
-rw-r--r--test/integration/next/default-pages-dir/public/favicon.icobin0 -> 25931 bytes
-rw-r--r--test/integration/next/default-pages-dir/public/next.svg1
-rw-r--r--test/integration/next/default-pages-dir/public/vercel.svg1
-rw-r--r--test/integration/next/default-pages-dir/src/Counter1.txt27
-rw-r--r--test/integration/next/default-pages-dir/src/Counter2.txt27
-rw-r--r--test/integration/next/default-pages-dir/src/pages/_app.tsx6
-rw-r--r--test/integration/next/default-pages-dir/src/pages/_document.tsx13
-rw-r--r--test/integration/next/default-pages-dir/src/pages/api/hello.ts10
-rw-r--r--test/integration/next/default-pages-dir/src/pages/index.tsx128
-rw-r--r--test/integration/next/default-pages-dir/src/styles/globals.css27
-rw-r--r--test/integration/next/default-pages-dir/tailwind.config.ts19
-rw-r--r--test/integration/next/default-pages-dir/test/dev-server-puppeteer.ts101
-rw-r--r--test/integration/next/default-pages-dir/test/dev-server.test.ts79
-rw-r--r--test/integration/next/default-pages-dir/test/next-build.test.ts141
-rw-r--r--test/integration/next/default-pages-dir/tsconfig.json22
-rw-r--r--test/integration/next/default-pages-dir/tsconfig_for_build.json23
-rw-r--r--test/js/bun/console/console-iterator-run-2.ts16
-rw-r--r--test/js/bun/console/console-iterator-run.ts (renamed from test/js/bun/console/console-iterator-run.js)0
-rw-r--r--test/js/bun/console/console-iterator.test.ts (renamed from test/js/bun/console/console-iterator.test.js)23
-rw-r--r--test/js/bun/deletable-globals-fixture.js10
-rw-r--r--test/js/bun/dns/resolve-dns.test.ts126
-rw-r--r--test/js/bun/ffi/ffi.test.js286
-rw-r--r--test/js/bun/globals.test.js22
-rw-r--r--test/js/bun/http/big-form-data.fixture.js20
-rw-r--r--test/js/bun/http/bun-server.test.ts22
-rw-r--r--test/js/bun/http/js-sink-sourmap-fixture/chunks/stream.mjs22
-rw-r--r--test/js/bun/http/js-sink-sourmap-fixture/index.mjs5620
-rw-r--r--test/js/bun/http/proxy.test.js29
-rw-r--r--test/js/bun/http/serve.test.ts139
-rw-r--r--test/js/bun/io/bun-write.test.js35
-rw-r--r--test/js/bun/net/socket.test.ts9
-rw-r--r--test/js/bun/plugin/module-plugins.ts38
-rw-r--r--test/js/bun/plugin/plugins.test.ts78
-rw-r--r--test/js/bun/resolve/import-meta.test.js2
-rw-r--r--test/js/bun/resolve/png/test-png-import.test.js4
-rw-r--r--test/js/bun/resolve/resolve.test.ts143
-rw-r--r--test/js/bun/spawn/bun-ipc-child-respond.js3
-rw-r--r--test/js/bun/spawn/bun-ipc-child.js1
-rw-r--r--test/js/bun/spawn/spawn.test.ts35
-rw-r--r--test/js/bun/sqlite/sqlite.test.js18
-rw-r--r--test/js/bun/test/expect.test.js49
-rw-r--r--test/js/bun/test/jest-extended.test.js21
-rw-r--r--test/js/bun/util/inspect.test.js8
-rw-r--r--test/js/bun/util/reportError.test.ts2
-rw-r--r--test/js/first_party/ws/ws.test.ts26
-rw-r--r--test/js/node/async_hooks/async_hooks.node.test.ts28
-rw-r--r--test/js/node/buffer.test.js11
-rw-r--r--test/js/node/child_process/child_process.test.ts22
-rw-r--r--test/js/node/child_process/fixtures/child-process-exit-event.js13
-rw-r--r--test/js/node/console/console.test.ts90
-rw-r--r--test/js/node/crypto/crypto.hmac.test.ts426
-rw-r--r--test/js/node/crypto/crypto.key-objects.test.ts1643
-rw-r--r--test/js/node/crypto/fixtures/ec_p256_private.pem5
-rw-r--r--test/js/node/crypto/fixtures/ec_p256_public.pem4
-rw-r--r--test/js/node/crypto/fixtures/ec_p384_private.pem6
-rw-r--r--test/js/node/crypto/fixtures/ec_p384_public.pem5
-rw-r--r--test/js/node/crypto/fixtures/ec_p521_private.pem8
-rw-r--r--test/js/node/crypto/fixtures/ec_p521_public.pem6
-rw-r--r--test/js/node/crypto/fixtures/ec_secp256k1_private.pem5
-rw-r--r--test/js/node/crypto/fixtures/ec_secp256k1_public.pem4
-rw-r--r--test/js/node/crypto/fixtures/ed25519_private.pem3
-rw-r--r--test/js/node/crypto/fixtures/ed25519_public.pem3
-rw-r--r--test/js/node/crypto/fixtures/ed448_private.pem4
-rw-r--r--test/js/node/crypto/fixtures/ed448_public.pem4
-rw-r--r--test/js/node/crypto/fixtures/rsa_private.pem27
-rw-r--r--test/js/node/crypto/fixtures/rsa_private_2048.pem27
-rw-r--r--test/js/node/crypto/fixtures/rsa_private_4096.pem51
-rw-r--r--test/js/node/crypto/fixtures/rsa_private_encrypted.pem30
-rw-r--r--test/js/node/crypto/fixtures/rsa_pss_private_2048.pem28
-rw-r--r--test/js/node/crypto/fixtures/rsa_pss_public_2048.pem9
-rw-r--r--test/js/node/crypto/fixtures/rsa_public.pem9
-rw-r--r--test/js/node/crypto/fixtures/rsa_public_2048.pem9
-rw-r--r--test/js/node/crypto/fixtures/rsa_public_4096.pem14
-rw-r--r--test/js/node/crypto/fixtures/x25519_private.pem3
-rw-r--r--test/js/node/crypto/fixtures/x25519_public.pem3
-rw-r--r--test/js/node/crypto/fixtures/x448_private.pem4
-rw-r--r--test/js/node/crypto/fixtures/x448_public.pem4
-rw-r--r--test/js/node/dns/node-dns.test.js141
-rw-r--r--test/js/node/events/event-emitter.test.ts83
-rw-r--r--test/js/node/fs/fs.test.ts121
-rw-r--r--test/js/node/http/fixtures/cert.key28
-rw-r--r--test/js/node/http/fixtures/cert.pem23
-rw-r--r--test/js/node/http/node-http.test.ts197
-rw-r--r--test/js/node/module/modulePrototypeOverwrite-fixture.cjs1
-rw-r--r--test/js/node/module/modulePrototypeOverwrite.cjs17
-rw-r--r--test/js/node/module/node-module-module.test.js48
-rw-r--r--test/js/node/module/resolveFilenameOverwrite-fixture.cjs1
-rw-r--r--test/js/node/module/resolveFilenameOverwrite.cjs14
-rw-r--r--test/js/node/net/node-net.test.ts37
-rw-r--r--test/js/node/os/os.test.js10
-rw-r--r--test/js/node/path/path.test.js13
-rw-r--r--test/js/node/process-binding.test.ts26
-rw-r--r--test/js/node/process/print-process-args.js4
-rw-r--r--test/js/node/process/process-stdio.test.ts2
-rw-r--r--test/js/node/process/process.test.js27
-rw-r--r--test/js/node/stream/node-stream.test.js12
-rw-r--r--test/js/node/tty.test.ts25
-rw-r--r--test/js/node/util/node-inspect-tests/import.test.mjs9
-rw-r--r--test/js/node/util/node-inspect-tests/internal-inspect.test.js57
-rw-r--r--test/js/node/util/node-inspect-tests/parallel/util-format.test.js489
-rw-r--r--test/js/node/util/node-inspect-tests/parallel/util-inspect-getters-accessing-this.test.js60
-rw-r--r--test/js/node/util/node-inspect-tests/parallel/util-inspect-long-running.test.mjs27
-rw-r--r--test/js/node/util/node-inspect-tests/parallel/util-inspect-proxy.test.js177
-rw-r--r--test/js/node/util/node-inspect-tests/parallel/util-inspect.test.js3294
-rw-r--r--test/js/node/v8/capture-stack-trace.test.js81
-rw-r--r--test/js/node/v8/v8-date-parser.test.js462
-rw-r--r--test/js/node/vm/vm.test.ts5
-rw-r--r--test/js/node/watch/fs.watch.test.ts30
-rw-r--r--test/js/node/worker_threads/worker_threads.test.ts63
-rwxr-xr-xtest/js/third_party/got/bun.lockbbin0 -> 9072 bytes
-rw-r--r--test/js/third_party/jsonwebtoken/async_sign.test.js159
-rw-r--r--test/js/third_party/jsonwebtoken/buffer.test.js10
-rw-r--r--test/js/third_party/jsonwebtoken/claim-aud.test.js423
-rw-r--r--test/js/third_party/jsonwebtoken/claim-exp.test.js316
-rw-r--r--test/js/third_party/jsonwebtoken/claim-iat.test.js254
-rw-r--r--test/js/third_party/jsonwebtoken/claim-iss.test.js185
-rw-r--r--test/js/third_party/jsonwebtoken/claim-jti.test.js135
-rw-r--r--test/js/third_party/jsonwebtoken/claim-nbf.test.js312
-rw-r--r--test/js/third_party/jsonwebtoken/claim-private.test.js55
-rw-r--r--test/js/third_party/jsonwebtoken/claim-sub.test.js133
-rw-r--r--test/js/third_party/jsonwebtoken/decoding.test.js9
-rw-r--r--test/js/third_party/jsonwebtoken/dsa-private.pem36
-rw-r--r--test/js/third_party/jsonwebtoken/dsa-public.pem36
-rw-r--r--test/js/third_party/jsonwebtoken/ecdsa-private.pem18
-rw-r--r--test/js/third_party/jsonwebtoken/ecdsa-public-invalid.pem9
-rw-r--r--test/js/third_party/jsonwebtoken/ecdsa-public-x509.pem19
-rw-r--r--test/js/third_party/jsonwebtoken/ecdsa-public.pem9
-rw-r--r--test/js/third_party/jsonwebtoken/encoding.test.js37
-rw-r--r--test/js/third_party/jsonwebtoken/expires_format.test.js10
-rw-r--r--test/js/third_party/jsonwebtoken/header-kid.test.js83
-rw-r--r--test/js/third_party/jsonwebtoken/invalid_exp.test.js54
-rw-r--r--test/js/third_party/jsonwebtoken/invalid_pub.pem19
-rw-r--r--test/js/third_party/jsonwebtoken/issue_147.test.js10
-rw-r--r--test/js/third_party/jsonwebtoken/issue_304.test.js43
-rw-r--r--test/js/third_party/jsonwebtoken/issue_70.test.js14
-rw-r--r--test/js/third_party/jsonwebtoken/jwt.asymmetric_signing.test.js208
-rw-r--r--test/js/third_party/jsonwebtoken/jwt.hs.test.js140
-rw-r--r--test/js/third_party/jsonwebtoken/jwt.malicious.test.js44
-rw-r--r--test/js/third_party/jsonwebtoken/noTimestamp.test.js10
-rw-r--r--test/js/third_party/jsonwebtoken/non_object_values.test.js16
-rw-r--r--test/js/third_party/jsonwebtoken/option-complete.test.js53
-rw-r--r--test/js/third_party/jsonwebtoken/option-maxAge.test.js62
-rw-r--r--test/js/third_party/jsonwebtoken/option-nonce.test.js41
-rw-r--r--test/js/third_party/jsonwebtoken/package.json8
-rw-r--r--test/js/third_party/jsonwebtoken/prime256v1-private.pem5
-rw-r--r--test/js/third_party/jsonwebtoken/priv.pem27
-rw-r--r--test/js/third_party/jsonwebtoken/pub.pem22
-rw-r--r--test/js/third_party/jsonwebtoken/rsa-private.pem27
-rw-r--r--test/js/third_party/jsonwebtoken/rsa-pss-invalid-salt-length-private.pem29
-rw-r--r--test/js/third_party/jsonwebtoken/rsa-pss-private.pem29
-rw-r--r--test/js/third_party/jsonwebtoken/rsa-public-key.pem8
-rw-r--r--test/js/third_party/jsonwebtoken/rsa-public-key.test.js44
-rw-r--r--test/js/third_party/jsonwebtoken/rsa-public.pem9
-rw-r--r--test/js/third_party/jsonwebtoken/schema.test.js72
-rw-r--r--test/js/third_party/jsonwebtoken/secp384r1-private.pem6
-rw-r--r--test/js/third_party/jsonwebtoken/secp521r1-private.pem7
-rw-r--r--test/js/third_party/jsonwebtoken/set_headers.test.js16
-rw-r--r--test/js/third_party/jsonwebtoken/test-utils.js116
-rw-r--r--test/js/third_party/jsonwebtoken/undefined_secretOrPublickey.test.js18
-rw-r--r--test/js/third_party/jsonwebtoken/validateAsymmetricKey.test.js209
-rw-r--r--test/js/third_party/jsonwebtoken/verify.test.js318
-rw-r--r--test/js/third_party/jsonwebtoken/wrong_alg.test.js49
-rw-r--r--test/js/third_party/mongodb/mongodb.test.ts29
-rw-r--r--test/js/third_party/mongodb/package.json6
-rw-r--r--test/js/third_party/postgres/postgres.test.ts14
-rwxr-xr-xtest/js/third_party/prisma/bun.lockbbin0 -> 2951 bytes
-rw-r--r--test/js/third_party/prompts/prompts.js25
-rw-r--r--test/js/third_party/prompts/prompts.test.ts27
-rwxr-xr-xtest/js/third_party/yargs/bun.lockbbin0 -> 6747 bytes
-rw-r--r--test/js/third_party/yargs/package.json7
-rw-r--r--test/js/third_party/yargs/yargs-cjs.test.js4
-rw-r--r--test/js/web/abort/abort.signal.ts24
-rw-r--r--test/js/web/abort/abort.test.ts21
-rw-r--r--test/js/web/confirm-fixture.js3
-rw-r--r--test/js/web/console/console-log.expected.txt27
-rw-r--r--test/js/web/console/console-log.js18
-rw-r--r--test/js/web/encoding/text-decoder.test.js29
-rw-r--r--test/js/web/encoding/text-encoder.test.js2
-rw-r--r--test/js/web/fetch/blob.test.ts29
-rw-r--r--test/js/web/fetch/body-stream.test.ts29
-rw-r--r--test/js/web/fetch/fetch.stream.test.ts143
-rw-r--r--test/js/web/fetch/fetch.test.ts425
-rw-r--r--test/js/web/fetch/response.test.ts32
-rw-r--r--test/js/web/html/URLSearchParams.test.ts2
-rw-r--r--test/js/web/request/request.test.ts37
-rw-r--r--test/js/web/timers/performance.test.js25
-rw-r--r--test/js/web/url/url.test.ts66
-rw-r--r--test/js/web/web-globals.test.js41
-rw-r--r--test/js/web/worker.test.ts2
-rw-r--r--test/js/workerd/html-rewriter.test.js856
-rw-r--r--test/package.json12
-rw-r--r--test/regression/fixtures/cert.key28
-rw-r--r--test/regression/fixtures/cert.pem23
-rw-r--r--test/regression/issue/04011.test.ts (renamed from test/regression/issue/4011.test.ts)0
-rw-r--r--test/regression/issue/04893.test.ts23
-rw-r--r--test/regression/issue/06443.test.ts39
-rw-r--r--test/regression/issue/06467.test.ts7
-rw-r--r--test/transpiler/decorator-metadata.test.ts546
-rw-r--r--test/transpiler/decorators.test.ts14
-rw-r--r--test/transpiler/runtime-transpiler.test.ts9
-rw-r--r--test/transpiler/transpiler.test.js24
-rw-r--r--test/tsconfig.json1
-rw-r--r--tsconfig.base.json2
-rw-r--r--tsconfig.json1
794 files changed, 101315 insertions, 21208 deletions
diff --git a/.github/ISSUE_TEMPLATE/2-bug-report.yml b/.github/ISSUE_TEMPLATE/2-bug-report.yml
index 6e13fc37d..423a35668 100644
--- a/.github/ISSUE_TEMPLATE/2-bug-report.yml
+++ b/.github/ISSUE_TEMPLATE/2-bug-report.yml
@@ -10,7 +10,11 @@ body:
If you need help or support using Bun, and are not reporting a bug, please
join our [Discord](https://discord.gg/CXdq2DP29u) server, where you can ask questions in the [`#help`](https://discord.gg/32EtH6p7HN) forum.
+ Make sure you are running the [latest](https://bun.sh/docs/installation#upgrading) version of Bun.
+ The bug you are experiencing may already have been fixed.
+
Please try to include as much information as possible.
+
- type: input
attributes:
label: What version of Bun is running?
diff --git a/.github/ISSUE_TEMPLATE/3-feature-request.yml b/.github/ISSUE_TEMPLATE/3-feature-request.yml
index 0fcf6e83b..bd735267b 100644
--- a/.github/ISSUE_TEMPLATE/3-feature-request.yml
+++ b/.github/ISSUE_TEMPLATE/3-feature-request.yml
@@ -8,7 +8,7 @@ body:
Thank you for submitting an idea. It helps make Bun better.
If you want to discuss Bun, or learn how others are using Bun, please
- join our [Discord](https://discord.gg/CXdq2DP29u) server, where you can share in the [`#feedback-ideas`](https://discord.gg/unwUnHBNqy) channel.
+ join our [Discord](https://discord.gg/CXdq2DP29u) server, where you can share in the [`#feedback`](https://discord.gg/unwUnHBNqy) channel.
- type: textarea
attributes:
label: What is the problem this feature would solve?
diff --git a/.github/workflows/bun-ecosystem-test.yml b/.github/workflows/bun-ecosystem-test.yml
deleted file mode 100644
index 611ee5e1c..000000000
--- a/.github/workflows/bun-ecosystem-test.yml
+++ /dev/null
@@ -1,50 +0,0 @@
-name: bun-ecosystem-test
-
-on:
- schedule:
- - cron: "0 15 * * *" # every day at 7am PST
- workflow_dispatch:
- inputs:
- version:
- description: "The version of Bun to run"
- required: true
- default: "canary"
- type: string
-jobs:
- test:
- name: ${{ matrix.tag }}
- runs-on: ${{ matrix.os }}
- if: github.repository_owner == 'oven-sh'
- timeout-minutes: 10
- strategy:
- fail-fast: false
- matrix:
- include:
- - os: ubuntu-latest
- tag: linux-x64
- url: linux/x64?avx2=true
- - os: ubuntu-latest
- tag: linux-x64-baseline
- url: linux/x64?baseline=true
- # FIXME: runner fails with "No tests found"?
- #- os: macos-latest
- # tag: darwin-x64
- # url: darwin/x64?avx2=true
- - os: macos-latest
- tag: darwin-x64-baseline
- url: darwin/x64?baseline=true
- steps:
- - id: checkout
- name: Checkout
- uses: Bhacaz/checkout-files@v2
- with:
- files: packages/bun-internal-test
- - id: setup
- name: Setup
- uses: oven-sh/setup-bun@v1
- with:
- bun-download-url: https://bun.sh/download/${{ github.event.inputs.version }}/${{ matrix.url }}
- - id: test
- name: Test
- working-directory: packages/bun-internal-test
- run: bun run test:ecosystem
diff --git a/.github/workflows/bun-framework-next.yml b/.github/workflows/bun-framework-next.yml
deleted file mode 100644
index e871c2c31..000000000
--- a/.github/workflows/bun-framework-next.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-name: bun-framework-next
-on:
- push:
- paths:
- - packages/bun-framework-next/**/*
- branches: [main, bun-framework-next-actions]
- pull_request:
- paths:
- - packages/bun-framework-next/**/*
- branches: [main]
-
-jobs:
- build:
- name: lint, test and build on Node ${{ matrix.node }} and ${{ matrix.os }}
-
- runs-on: ${{ matrix.os }}
-
- strategy:
- matrix:
- node: ["14.x"]
- os: [macOS-latest]
-
- steps:
- - name: Checkout repo
- uses: actions/checkout@v2
-
- - name: Use Node ${{ matrix.node }}
- uses: actions/setup-node@v2
- with:
- node-version: ${{ matrix.node }}
-
- - name: Install PNPM
- uses: pnpm/action-setup@v2.0.1
- with:
- version: 6.21.0
-
- - name: Install dependencies
- run: cd packages/bun-framework-next && pnpm install
-
- - name: Type check bun-framework-next
- run: cd packages/bun-framework-next && pnpm check
diff --git a/.github/workflows/bun-linux-aarch64.yml b/.github/workflows/bun-linux-aarch64.yml
index 816da7879..98a8943cb 100644
--- a/.github/workflows/bun-linux-aarch64.yml
+++ b/.github/workflows/bun-linux-aarch64.yml
@@ -28,6 +28,7 @@ jobs:
runs-on: ${{matrix.runner}}
if: github.repository_owner == 'oven-sh'
timeout-minutes: 90
+ permissions: write-all
strategy:
matrix:
include:
@@ -36,7 +37,7 @@ jobs:
arch: aarch64
build_arch: arm64
runner: linux-arm64
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-linux-arm64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-linux-arm64-lto.tar.gz"
webkit_basename: "bun-webkit-linux-arm64-lto"
build_machine_arch: aarch64
diff --git a/.github/workflows/bun-linux-build.yml b/.github/workflows/bun-linux-build.yml
index 4e1ba20de..b7d53943f 100644
--- a/.github/workflows/bun-linux-build.yml
+++ b/.github/workflows/bun-linux-build.yml
@@ -37,6 +37,7 @@ jobs:
runs-on: ${{matrix.runner}}
if: github.repository_owner == 'oven-sh'
timeout-minutes: 90
+ permissions: write-all
strategy:
fail-fast: false
matrix:
@@ -46,7 +47,7 @@ jobs:
arch: x86_64
build_arch: amd64
runner: big-ubuntu
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-linux-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-linux-amd64-lto.tar.gz"
webkit_basename: "bun-webkit-linux-amd64-lto"
build_machine_arch: x86_64
- cpu: nehalem
@@ -54,7 +55,7 @@ jobs:
arch: x86_64
build_arch: amd64
runner: big-ubuntu
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-linux-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-linux-amd64-lto.tar.gz"
webkit_basename: "bun-webkit-linux-amd64-lto"
build_machine_arch: x86_64
@@ -152,13 +153,33 @@ jobs:
name: "Canary (${{github.sha}})"
tag: "canary"
artifacts: "${{runner.temp}}/release/bun-${{matrix.tag}}.zip,${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip"
+ - uses: sarisia/actions-status-discord@v1
+ if: failure() && github.repository_owner == 'oven-sh' && github.event_name == 'pull_request'
+ with:
+ title: ""
+ webhook: ${{ secrets.DISCORD_WEBHOOK }}
+ status: ${{ job.status }}
+ noprefix: true
+ nocontext: true
+ description: |
+ Pull Request
+ ### [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}})
+
+ @${{ github.actor }}
+
+ Build failed on ${{ matrix.tag }}:
+
+ **[View build output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})**
+ [Commit ${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})
linux-test:
name: Tests ${{matrix.tag}}
runs-on: ubuntu-latest
needs: [linux]
if: github.event_name == 'pull_request'
timeout-minutes: 20
+ permissions:
+ pull-requests: write
outputs:
failing_tests: ${{ steps.test.outputs.failing_tests }}
failing_tests_count: ${{ steps.test.outputs.failing_tests_count }}
@@ -180,8 +201,8 @@ jobs:
with:
name: bun-${{matrix.tag}}
path: ${{runner.temp}}/release
- - id: install
- name: Install
+ - id: install-bun
+ name: Install Bun
run: |
cd ${{runner.temp}}/release
unzip bun-${{matrix.tag}}.zip
@@ -189,6 +210,13 @@ jobs:
chmod +x bun
pwd >> $GITHUB_PATH
./bun --version
+ - id: install-dependnecies
+ name: Install dependencies
+ run: |
+ sudo apt-get update && sudo apt-get install -y openssl
+ bun install --verbose
+ bun install --cwd=test --verbose
+ bun install --cwd=packages/bun-internal-test --verbose
- id: test
name: Test (node runner)
env:
@@ -197,11 +225,24 @@ jobs:
TLS_POSTGRES_DATABASE_URL: ${{ secrets.TLS_POSTGRES_DATABASE_URL }}
# if: ${{github.event.inputs.use_bun == 'false'}}
run: |
- sudo apt-get update && sudo apt-get install -y openssl
- bun install
- bun install --cwd test
- bun install --cwd packages/bun-internal-test
node packages/bun-internal-test/src/runner.node.mjs || true
+ - uses: sarisia/actions-status-discord@v1
+ if: always() && steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request'
+ with:
+ title: ""
+ webhook: ${{ secrets.DISCORD_WEBHOOK }}
+ status: "failure"
+ noprefix: true
+ nocontext: true
+ description: |
+ Pull Request
+ ### ❌ [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}})
+
+ @${{ github.actor }}, there are ${{ steps.test.outputs.failing_tests_count }} files with test failures on ${{ matrix.tag }}:
+
+ ${{ steps.test.outputs.failing_tests }}
+
+ **[View test output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})**
- name: Comment on PR
if: steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
diff --git a/.github/workflows/bun-mac-aarch64.yml b/.github/workflows/bun-mac-aarch64.yml
index 9cada9606..c15f77f69 100644
--- a/.github/workflows/bun-mac-aarch64.yml
+++ b/.github/workflows/bun-mac-aarch64.yml
@@ -115,36 +115,36 @@ jobs:
# arch: x86_64
# tag: bun-darwin-x64-baseline
# obj: bun-obj-darwin-x64-baseline
- # runner: macos-11
+ # runner: macos-12
# artifact: bun-obj-darwin-x64-baseline
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: true
# compile_obj: false
# - cpu: haswell
# arch: x86_64
# tag: bun-darwin-x64
# obj: bun-obj-darwin-x64
- # runner: macos-11
+ # runner: macos-12
# artifact: bun-obj-darwin-x64
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: true
# compile_obj: false
# - cpu: nehalem
# arch: x86_64
# tag: bun-darwin-x64-baseline
# obj: bun-obj-darwin-x64-baseline
- # runner: macos-11
+ # runner: macos-12
# artifact: bun-obj-darwin-x64-baseline
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: false
# compile_obj: true
# - cpu: haswell
# arch: x86_64
# tag: bun-darwin-x64
# obj: bun-obj-darwin-x64
- # runner: macos-11
+ # runner: macos-12
# artifact: bun-obj-darwin-x64
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: false
# compile_obj: true
- cpu: native
@@ -152,14 +152,14 @@ jobs:
tag: bun-darwin-aarch64
obj: bun-obj-darwin-aarch64
artifact: bun-obj-darwin-aarch64
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-arm64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-arm64-lto.tar.gz"
runner: macos-arm64
dependencies: true
compile_obj: true
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
- run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu)
+ run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) --force
- name: Install dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
@@ -172,11 +172,11 @@ jobs:
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
- brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
+ brew install ccache rust llvm@16 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "$(brew --prefix ccache)/bin" >> $GITHUB_PATH
echo "$(brew --prefix coreutils)/libexec/gnubin" >> $GITHUB_PATH
- echo "$(brew --prefix llvm@15)/bin" >> $GITHUB_PATH
- brew link --overwrite llvm@15
+ echo "$(brew --prefix llvm@16)/bin" >> $GITHUB_PATH
+ brew link --overwrite llvm@16
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
@@ -247,6 +247,7 @@ jobs:
if: github.repository_owner == 'oven-sh'
needs: [macOS-cpp, macos-object-files]
timeout-minutes: 90
+ permissions: write-all
strategy:
matrix:
include:
@@ -255,29 +256,29 @@ jobs:
# tag: bun-darwin-x64-baseline
# obj: bun-obj-darwin-x64-baseline
# package: bun-darwin-x64
- # runner: macos-11
+ # runner: macos-12
# artifact: bun-obj-darwin-x64-baseline
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
# - cpu: haswell
# arch: x86_64
# tag: bun-darwin-x64
# obj: bun-obj-darwin-x64
# package: bun-darwin-x64
- # runner: macos-11
+ # runner: macos-12
# artifact: bun-obj-darwin-x64
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
- cpu: native
arch: aarch64
tag: bun-darwin-aarch64
obj: bun-obj-darwin-aarch64
package: bun-darwin-aarch64
artifact: bun-obj-darwin-aarch64
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-arm64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-arm64-lto.tar.gz"
runner: macos-arm64
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
- run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu)
+ run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) --force
- name: Install dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
@@ -290,10 +291,10 @@ jobs:
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
- brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
+ brew install rust ccache llvm@16 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "$(brew --prefix coreutils)/libexec/gnubin" >> $GITHUB_PATH
- echo "$(brew --prefix llvm@15)/bin" >> $GITHUB_PATH
- brew link --overwrite llvm@15
+ echo "$(brew --prefix llvm@16)/bin" >> $GITHUB_PATH
+ brew link --overwrite llvm@16
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
@@ -392,11 +393,32 @@ jobs:
name: "Canary (${{github.sha}})"
tag: "canary"
artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip"
+ - uses: sarisia/actions-status-discord@v1
+ if: failure() && github.repository_owner == 'oven-sh' && github.event_name == 'pull_request'
+ with:
+ title: ""
+ webhook: ${{ secrets.DISCORD_WEBHOOK }}
+ status: ${{ job.status }}
+ noprefix: true
+ nocontext: true
+ description: |
+ Pull Request
+ ### [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}})
+
+ @${{ github.actor }}
+
+ Build failed on ${{ matrix.tag }}:
+
+ **[View build output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})**
+
+ [Commit ${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})
macOS-test:
name: Tests ${{matrix.tag}}
runs-on: ${{ matrix.runner }}
needs: [macOS]
if: github.event_name == 'pull_request' && github.repository_owner == 'oven-sh'
+ permissions:
+ pull-requests: write
timeout-minutes: 30
outputs:
failing_tests: ${{ steps.test.outputs.failing_tests }}
@@ -419,8 +441,8 @@ jobs:
with:
name: ${{matrix.tag}}
path: ${{runner.temp}}/release
- - id: install
- name: Install
+ - id: install-bun
+ name: Install Bun
run: |
cd ${{runner.temp}}/release
unzip ${{matrix.tag}}.zip
@@ -428,6 +450,12 @@ jobs:
chmod +x bun
pwd >> $GITHUB_PATH
./bun --version
+ - id: install
+ name: Install dependencies
+ run: |
+ bun install --verbose
+ bun install --cwd=test --verbose
+ bun install --cwd=packages/bun-internal-test --verbose
- id: test
name: Test (node runner)
env:
@@ -436,10 +464,24 @@ jobs:
TLS_POSTGRES_DATABASE_URL: ${{ secrets.TLS_POSTGRES_DATABASE_URL }}
# if: ${{github.event.inputs.use_bun == 'false'}}
run: |
- bun install
- bun install --cwd test
- bun install --cwd packages/bun-internal-test
node packages/bun-internal-test/src/runner.node.mjs || true
+ - uses: sarisia/actions-status-discord@v1
+ if: always() && steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request'
+ with:
+ title: ""
+ webhook: ${{ secrets.DISCORD_WEBHOOK }}
+ status: "failure"
+ noprefix: true
+ nocontext: true
+ description: |
+ Pull Request
+ ### ❌ [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}})
+
+ @${{ github.actor }}, there are ${{ steps.test.outputs.failing_tests_count }} files with test failures on ${{ matrix.tag }}:
+
+ ${{ steps.test.outputs.failing_tests }}
+
+ **[View test output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})**
- name: Comment on PR
if: steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
diff --git a/.github/workflows/bun-mac-x64-baseline.yml b/.github/workflows/bun-mac-x64-baseline.yml
index 441c2b8bc..a1c3d0c50 100644
--- a/.github/workflows/bun-mac-x64-baseline.yml
+++ b/.github/workflows/bun-mac-x64-baseline.yml
@@ -115,36 +115,36 @@ jobs:
arch: x86_64
tag: bun-darwin-x64-baseline
obj: bun-obj-darwin-x64-baseline
- runner: macos-11
+ runner: macos-12
artifact: bun-obj-darwin-x64-baseline
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
dependencies: true
compile_obj: false
# - cpu: haswell
# arch: x86_64
# tag: bun-darwin-x64
# obj: bun-obj-darwin-x64
- # runner: macos-11
+ # runner: macos-12
# artifact: bun-obj-darwin-x64
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: true
# compile_obj: false
- cpu: nehalem
arch: x86_64
tag: bun-darwin-x64-baseline
obj: bun-obj-darwin-x64-baseline
- runner: macos-11
+ runner: macos-12
artifact: bun-obj-darwin-x64-baseline
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
dependencies: false
compile_obj: true
# - cpu: haswell
# arch: x86_64
# tag: bun-darwin-x64
# obj: bun-obj-darwin-x64
- # runner: macos-11
+ # runner: macos-12
# artifact: bun-obj-darwin-x64
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: false
# compile_obj: true
# - cpu: native
@@ -152,14 +152,14 @@ jobs:
# tag: bun-darwin-aarch64
# obj: bun-obj-darwin-aarch64
# artifact: bun-obj-darwin-aarch64
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
# runner: macos-arm64
# dependencies: true
# compile_obj: true
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
- run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu)
+ run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) --force
- name: Install dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
@@ -172,11 +172,11 @@ jobs:
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
- brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
+ brew install ccache rust llvm@16 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "$(brew --prefix ccache)/bin" >> $GITHUB_PATH
echo "$(brew --prefix coreutils)/libexec/gnubin" >> $GITHUB_PATH
- echo "$(brew --prefix llvm@15)/bin" >> $GITHUB_PATH
- brew link --overwrite llvm@15
+ echo "$(brew --prefix llvm@16)/bin" >> $GITHUB_PATH
+ brew link --overwrite llvm@16
- name: ccache (dependencies)
uses: hendrikmuhs/ccache-action@v1.2
if: matrix.dependencies
@@ -248,6 +248,7 @@ jobs:
if: github.repository_owner == 'oven-sh'
needs: [macOS-cpp, macos-object-files]
timeout-minutes: 90
+ permissions: write-all
strategy:
matrix:
include:
@@ -256,29 +257,29 @@ jobs:
tag: bun-darwin-x64-baseline
obj: bun-obj-darwin-x64-baseline
package: bun-darwin-x64
- runner: macos-11
+ runner: macos-12
artifact: bun-obj-darwin-x64-baseline
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
# - cpu: haswell
# arch: x86_64
# tag: bun-darwin-x64
# obj: bun-obj-darwin-x64
# package: bun-darwin-x64
- # runner: macos-11
+ # runner: macos-12
# artifact: bun-obj-darwin-x64
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
# - cpu: native
# arch: aarch64
# tag: bun-darwin-aarch64
# obj: bun-obj-darwin-aarch64
# package: bun-darwin-aarch64
# artifact: bun-obj-darwin-aarch64
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
# runner: macos-arm64
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
- run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu)
+ run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) --force
- name: Install dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
@@ -291,10 +292,10 @@ jobs:
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
- brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
+ brew install ccache rust llvm@16 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "$(brew --prefix coreutils)/libexec/gnubin" >> $GITHUB_PATH
- echo "$(brew --prefix llvm@15)/bin" >> $GITHUB_PATH
- brew link --overwrite llvm@15
+ echo "$(brew --prefix llvm@16)/bin" >> $GITHUB_PATH
+ brew link --overwrite llvm@16
- name: ccache (link)
uses: hendrikmuhs/ccache-action@v1.2
with:
@@ -396,11 +397,32 @@ jobs:
name: "Canary (${{github.sha}})"
tag: "canary"
artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip"
+ - uses: sarisia/actions-status-discord@v1
+ if: failure() && github.repository_owner == 'oven-sh' && github.event_name == 'pull_request'
+ with:
+ title: ""
+ webhook: ${{ secrets.DISCORD_WEBHOOK }}
+ status: ${{ job.status }}
+ noprefix: true
+ nocontext: true
+ description: |
+ Pull Request
+ ### [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}})
+
+ @${{ github.actor }}
+
+ Build failed on ${{ matrix.tag }}:
+
+ **[View build output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})**
+
+ [Commit ${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})
macOS-test:
name: Tests ${{matrix.tag}}
runs-on: ${{ matrix.runner }}
needs: [macOS]
if: github.event_name == 'pull_request' && github.repository_owner == 'oven-sh'
+ permissions:
+ pull-requests: write
timeout-minutes: 30
outputs:
failing_tests: ${{ steps.test.outputs.failing_tests }}
@@ -410,7 +432,7 @@ jobs:
matrix:
include:
- tag: bun-darwin-x64-baseline
- runner: macos-11
+ runner: macos-12
steps:
- id: checkout
name: Checkout
@@ -423,8 +445,8 @@ jobs:
with:
name: ${{matrix.tag}}
path: ${{runner.temp}}/release
- - id: install
- name: Install
+ - id: install-bun
+ name: Install Bun
run: |
cd ${{runner.temp}}/release
unzip ${{matrix.tag}}.zip
@@ -432,6 +454,12 @@ jobs:
chmod +x bun
pwd >> $GITHUB_PATH
./bun --version
+ - id: install
+ name: Install dependencies
+ run: |
+ bun install --verbose
+ bun install --cwd=test --verbose
+ bun install --cwd=packages/bun-internal-test --verbose
- id: test
name: Test (node runner)
env:
@@ -440,10 +468,27 @@ jobs:
TLS_POSTGRES_DATABASE_URL: ${{ secrets.TLS_POSTGRES_DATABASE_URL }}
# if: ${{github.event.inputs.use_bun == 'false'}}
run: |
- bun install
- bun install --cwd test
- bun install --cwd packages/bun-internal-test
node packages/bun-internal-test/src/runner.node.mjs || true
+ - uses: sarisia/actions-status-discord@v1
+ if: always() && steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request'
+ with:
+ title: ""
+ webhook: ${{ secrets.DISCORD_WEBHOOK }}
+ status: "failure"
+ noprefix: true
+ nocontext: true
+ description: |
+ Pull Request
+ ### ❌ [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}})
+
+ Hey @${{ github.actor }},
+
+ ${{ steps.test.outputs.failing_tests_count }} files with test failures on ${{ matrix.tag }}:
+
+ ${{ steps.test.outputs.failing_tests }}
+
+ **[View test output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})**
+
- name: Comment on PR
if: steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
diff --git a/.github/workflows/bun-mac-x64.yml b/.github/workflows/bun-mac-x64.yml
index 5c494a935..5cd515c95 100644
--- a/.github/workflows/bun-mac-x64.yml
+++ b/.github/workflows/bun-mac-x64.yml
@@ -115,36 +115,36 @@ jobs:
# arch: x86_64
# tag: bun-darwin-x64-baseline
# obj: bun-obj-darwin-x64-baseline
- # runner: macos-11
+ # runner: macos-12
# artifact: bun-obj-darwin-x64-baseline
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: true
# compile_obj: false
- cpu: haswell
arch: x86_64
tag: bun-darwin-x64
obj: bun-obj-darwin-x64
- runner: macos-11
+ runner: macos-12
artifact: bun-obj-darwin-x64
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
dependencies: true
compile_obj: false
# - cpu: nehalem
# arch: x86_64
# tag: bun-darwin-x64-baseline
# obj: bun-obj-darwin-x64-baseline
- # runner: macos-11
+ # runner: macos-12
# artifact: bun-obj-darwin-x64-baseline
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: false
# compile_obj: true
- cpu: haswell
arch: x86_64
tag: bun-darwin-x64
obj: bun-obj-darwin-x64
- runner: macos-11
+ runner: macos-12
artifact: bun-obj-darwin-x64
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
dependencies: false
compile_obj: true
# - cpu: native
@@ -152,14 +152,14 @@ jobs:
# tag: bun-darwin-aarch64
# obj: bun-obj-darwin-aarch64
# artifact: bun-obj-darwin-aarch64
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-arm64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-arm64-lto.tar.gz"
# runner: macos-arm64
# dependencies: true
# compile_obj: true
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
- run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu)
+ run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) --force
- name: Install dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
@@ -172,10 +172,10 @@ jobs:
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
- brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
+ brew install rust ccache llvm@16 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "$(brew --prefix coreutils)/libexec/gnubin" >> $GITHUB_PATH
- echo "$(brew --prefix llvm@15)/bin" >> $GITHUB_PATH
- brew link --overwrite llvm@15
+ echo "$(brew --prefix llvm@16)/bin" >> $GITHUB_PATH
+ brew link --overwrite llvm@16
- name: Download WebKit
if: matrix.compile_obj
env:
@@ -250,6 +250,7 @@ jobs:
if: github.repository_owner == 'oven-sh'
needs: [macOS-cpp, macos-object-files]
timeout-minutes: 90
+ permissions: write-all
strategy:
matrix:
include:
@@ -258,29 +259,29 @@ jobs:
# tag: bun-darwin-x64-baseline
# obj: bun-obj-darwin-x64-baseline
# package: bun-darwin-x64
- # runner: macos-11
+ # runner: macos-12
# artifact: bun-obj-darwin-x64-baseline
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
- cpu: haswell
arch: x86_64
tag: bun-darwin-x64
obj: bun-obj-darwin-x64
package: bun-darwin-x64
- runner: macos-11
+ runner: macos-12
artifact: bun-obj-darwin-x64
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-amd64-lto.tar.gz"
# - cpu: native
# arch: aarch64
# tag: bun-darwin-aarch64
# obj: bun-obj-darwin-aarch64
# package: bun-darwin-aarch64
# artifact: bun-obj-darwin-aarch64
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-aug3-5/bun-webkit-macos-arm64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-oct3-2/bun-webkit-macos-arm64-lto.tar.gz"
# runner: macos-arm64
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
- run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu)
+ run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) --force
- name: Install dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
@@ -293,10 +294,10 @@ jobs:
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
- brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
+ brew install rust ccache llvm@16 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "$(brew --prefix coreutils)/libexec/gnubin" >> $GITHUB_PATH
- echo "$(brew --prefix llvm@15)/bin" >> $GITHUB_PATH
- brew link --overwrite llvm@15
+ echo "$(brew --prefix llvm@16)/bin" >> $GITHUB_PATH
+ brew link --overwrite llvm@16
- name: Download WebKit
env:
CPU_TARGET: ${{ matrix.cpu }}
@@ -398,11 +399,32 @@ jobs:
name: "Canary (${{github.sha}})"
tag: "canary"
artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip"
+ - uses: sarisia/actions-status-discord@v1
+ if: failure() && github.repository_owner == 'oven-sh' && github.event_name == 'pull_request'
+ with:
+ title: ""
+ webhook: ${{ secrets.DISCORD_WEBHOOK }}
+ status: ${{ job.status }}
+ noprefix: true
+ nocontext: true
+ description: |
+ Pull Request
+ ### [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}})
+
+ @${{ github.actor }}
+
+ Build failed on ${{ matrix.tag }}:
+
+ **[View build output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})**
+
+ [Commit ${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})
macOS-test:
name: Tests ${{matrix.tag}}
runs-on: ${{ matrix.runner }}
needs: [macOS]
if: github.event_name == 'pull_request' && github.repository_owner == 'oven-sh'
+ permissions:
+ pull-requests: write
timeout-minutes: 30
outputs:
failing_tests: ${{ steps.test.outputs.failing_tests }}
@@ -412,7 +434,7 @@ jobs:
matrix:
include:
- tag: bun-darwin-x64
- runner: macos-11
+ runner: macos-12
steps:
- id: checkout
name: Checkout
@@ -425,8 +447,8 @@ jobs:
with:
name: ${{matrix.tag}}
path: ${{runner.temp}}/release
- - id: install
- name: Install
+ - id: install-bun
+ name: Install Bun
run: |
cd ${{runner.temp}}/release
unzip ${{matrix.tag}}.zip
@@ -434,6 +456,12 @@ jobs:
chmod +x bun
pwd >> $GITHUB_PATH
./bun --version
+ - id: install
+ name: Install dependencies
+ run: |
+ bun install --verbose
+ bun install --cwd=test --verbose
+ bun install --cwd=packages/bun-internal-test --verbose
- id: test
name: Test (node runner)
env:
@@ -442,10 +470,24 @@ jobs:
TLS_POSTGRES_DATABASE_URL: ${{ secrets.TLS_POSTGRES_DATABASE_URL }}
# if: ${{github.event.inputs.use_bun == 'false'}}
run: |
- bun install
- bun install --cwd test
- bun install --cwd packages/bun-internal-test
node packages/bun-internal-test/src/runner.node.mjs || true
+ - uses: sarisia/actions-status-discord@v1
+ if: always() && steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request'
+ with:
+ title: ""
+ webhook: ${{ secrets.DISCORD_WEBHOOK }}
+ status: "failure"
+ noprefix: true
+ nocontext: true
+ description: |
+ Pull Request
+ ### ❌ [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}})
+
+ @${{ github.actor }}, there are ${{ steps.test.outputs.failing_tests_count }} files with test failures on ${{ matrix.tag }}:
+
+ ${{ steps.test.outputs.failing_tests }}
+
+ **[View test output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})**
- name: Comment on PR
if: steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
diff --git a/.github/workflows/bun-release-canary.yml b/.github/workflows/bun-release-canary.yml
deleted file mode 100644
index fe0078902..000000000
--- a/.github/workflows/bun-release-canary.yml
+++ /dev/null
@@ -1,179 +0,0 @@
-name: bun-release-canary
-concurrency: release-canary
-on:
- schedule:
- - cron: "0 14 * * *" # every day at 6am PST
- workflow_dispatch:
-jobs:
- sign:
- name: Sign Release
- runs-on: ubuntu-latest
- if: github.repository_owner == 'oven-sh'
- defaults:
- run:
- working-directory: packages/bun-release
- steps:
- - id: checkout
- name: Checkout
- uses: actions/checkout@v3
- - id: setup-gpg
- name: Setup GPG
- uses: crazy-max/ghaction-import-gpg@v5
- with:
- gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
- passphrase: ${{ secrets.GPG_PASSPHRASE }}
- - id: setup-bun
- name: Setup Bun
- uses: oven-sh/setup-bun@v1
- with:
- bun-version: canary
- - id: bun-install
- name: Install Dependencies
- run: bun install
- - id: bun-run
- name: Sign Release
- run: |
- echo "$GPG_PASSPHRASE" | bun upload-assets -- "canary"
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- npm:
- name: Release to NPM
- runs-on: ubuntu-latest
- needs: sign
- if: github.repository_owner == 'oven-sh'
- defaults:
- run:
- working-directory: packages/bun-release
- steps:
- - id: checkout
- name: Checkout
- uses: actions/checkout@v3
- - id: setup-bun
- name: Setup Bun
- uses: oven-sh/setup-bun@v1
- with:
- bun-version: canary
- - id: bun-install
- name: Install Dependencies
- run: bun install
- - id: bun-run
- name: Release
- run: bun upload-npm -- canary publish
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- # npm-types:
- # name: Release types to NPM
- # runs-on: ubuntu-latest
- # defaults:
- # run:
- # working-directory: packages/bun-types
- # steps:
- # - id: checkout
- # name: Checkout
- # uses: actions/checkout@v3
- # - id: setup-node
- # name: Setup Node.js
- # uses: actions/setup-node@v3
- # with:
- # node-version: latest
- # - id: setup-bun
- # name: Setup Bun
- # uses: oven-sh/setup-bun@v1
- # with:
- # bun-version: canary
- # - id: bun-install
- # name: Install Dependencies
- # run: bun install
- # - id: setup-env
- # name: Setup Environment
- # run: |
- # SHA=$(git rev-parse --short "$GITHUB_SHA")
- # VERSION=$(bun --version)
- # TAG="${VERSION}-canary.$(date '+%Y%m%d').1+${SHA}"
- # echo "Setup tag: ${TAG}"
- # echo "TAG=${TAG}" >> ${GITHUB_ENV}
- # - id: bun-run
- # name: Build
- # run: bun run build
- # env:
- # BUN_VERSION: ${{ env.TAG }}
- # - id: npm-publish
- # name: Release
- # uses: JS-DevTools/npm-publish@v1
- # with:
- # package: packages/bun-types/dist/package.json
- # token: ${{ secrets.NPM_TOKEN }}
- # tag: canary
- docker:
- name: Release to Dockerhub
- runs-on: ubuntu-latest
- needs: sign
- if: github.repository_owner == 'oven-sh'
- steps:
- - id: checkout
- name: Checkout
- uses: actions/checkout@v3
- - id: qemu
- name: Setup Docker QEMU
- uses: docker/setup-qemu-action@v2
- - id: buildx
- name: Setup Docker buildx
- uses: docker/setup-buildx-action@v2
- with:
- platforms: linux/amd64,linux/arm64
- - id: metadata
- name: Setup Docker metadata
- uses: docker/metadata-action@v4
- with:
- images: oven/bun
- tags: canary
- - id: login
- name: Login to Docker
- uses: docker/login-action@v2
- with:
- username: ${{ secrets.DOCKER_USERNAME }}
- password: ${{ secrets.DOCKER_PASSWORD }}
- - id: push
- name: Push to Docker
- uses: docker/build-push-action@v3
- with:
- context: ./dockerhub
- file: ./dockerhub/Dockerfile-debian
- platforms: linux/amd64,linux/arm64
- builder: ${{ steps.buildx.outputs.name }}
- push: true
- tags: ${{ steps.metadata.outputs.tags }}
- labels: ${{ steps.metadata.outputs.labels }}
- build-args: |
- BUN_VERSION=canary
- s3:
- name: Upload to S3
- runs-on: ubuntu-latest
- needs: sign
- if: github.repository_owner == 'oven-sh'
- defaults:
- run:
- working-directory: packages/bun-release
- steps:
- - id: checkout
- name: Checkout
- uses: actions/checkout@v3
- - id: setup-bun
- name: Setup Bun
- uses: oven-sh/setup-bun@v1
- with:
- bun-version: canary
- - id: bun-install
- name: Install Dependencies
- run: bun install
- - id: bun-run
- name: Release
- run: bun upload-s3 -- canary
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
- AWS_ENDPOINT: ${{ secrets.AWS_ENDPOINT }}
- AWS_BUCKET: bun
diff --git a/.github/workflows/bun-release-types-canary.yml b/.github/workflows/bun-release-types-canary.yml
deleted file mode 100644
index d4bfca08c..000000000
--- a/.github/workflows/bun-release-types-canary.yml
+++ /dev/null
@@ -1,54 +0,0 @@
-name: bun-release-types-canary
-concurrency: release-canary
-on:
- push:
- branches:
- - main
- paths:
- - "packages/bun-types/**"
- workflow_dispatch:
-jobs:
- npm-types:
- name: Release types to NPM
- runs-on: ubuntu-latest
- if: github.repository_owner == 'oven-sh'
- defaults:
- run:
- working-directory: packages/bun-types
- steps:
- - id: checkout
- name: Checkout
- uses: actions/checkout@v3
- - id: setup-node
- name: Setup Node.js
- uses: actions/setup-node@v3
- with:
- node-version: latest
- - id: setup-bun
- name: Setup Bun
- uses: oven-sh/setup-bun@v1
- with:
- bun-version: canary
- - id: bun-install
- name: Install Dependencies
- run: bun install
- - id: setup-env
- name: Setup Environment
- run: |
- SHA=$(git rev-parse --short "$GITHUB_SHA")
- VERSION=$(bun --version)
- TAG="${VERSION}-canary.$(date +'%Y%m%dT%H%M%S')"
- echo "Setup tag: ${TAG}"
- echo "TAG=${TAG}" >> ${GITHUB_ENV}
- - id: bun-run
- name: Build
- run: bun run build
- env:
- BUN_VERSION: ${{ env.TAG }}
- - id: npm-publish
- name: Release
- uses: JS-DevTools/npm-publish@v1
- with:
- package: packages/bun-types/dist/package.json
- token: ${{ secrets.NPM_TOKEN }}
- tag: canary
diff --git a/.github/workflows/bun-release.yml b/.github/workflows/bun-release.yml
index 1b2c49e81..5962e658f 100644
--- a/.github/workflows/bun-release.yml
+++ b/.github/workflows/bun-release.yml
@@ -1,52 +1,71 @@
name: bun-release
concurrency: release
+env:
+ BUN_VERSION: ${{ github.event.inputs.tag || github.event.release.tag_name || 'canary' }}
+ BUN_LATEST: ${{ (github.event.inputs.is-latest || github.event.release.tag_name) && 'true' || 'false' }}
on:
release:
types:
- published
+ schedule:
+ - cron: "0 14 * * *" # every day at 6am PST
workflow_dispatch:
inputs:
+ is-latest:
+ description: Is this the latest release?
+ type: boolean
+ default: false
tag:
type: string
- description: The tag to publish
+ description: What is the release tag? (e.g. "1.0.2", "canary")
required: true
+ use-docker:
+ description: Should Docker images be released?
+ type: boolean
+ default: false
+ use-npm:
+ description: Should npm packages be published?
+ type: boolean
+ default: false
+ use-homebrew:
+ description: Should binaries be released to Homebrew?
+ type: boolean
+ default: false
+ use-s3:
+ description: Should binaries be uploaded to S3?
+ type: boolean
+ default: false
+ use-types:
+ description: Should types be released to npm?
+ type: boolean
+ default: false
jobs:
sign:
name: Sign Release
runs-on: ubuntu-latest
- if: github.repository_owner == 'oven-sh'
+ if: ${{ github.repository_owner == 'oven-sh' }}
+ permissions:
+ contents: write
defaults:
run:
working-directory: packages/bun-release
steps:
- - id: checkout
- name: Checkout
+ - name: Checkout
uses: actions/checkout@v3
- - id: setup-env
- name: Setup Environment
- run: |
- TAG="${{ github.event.inputs.tag }}"
- TAG="${TAG:-"${{ github.event.release.tag_name }}"}"
- echo "Setup tag: ${TAG}"
- echo "TAG=${TAG}" >> ${GITHUB_ENV}
- - id: setup-gpg
- name: Setup GPG
+ - name: Setup GPG
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- - id: setup-bun
- name: Setup Bun
+ - name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
- bun-version: canary
- - id: bun-install
- name: Install Dependencies
+ bun-version: latest
+ - name: Install Dependencies
run: bun install
- - id: bun-run
- name: Sign Release
+ - name: Sign Release
run: |
- echo "$GPG_PASSPHRASE" | bun upload-assets -- "${{ env.TAG }}"
+ echo "$GPG_PASSPHRASE" | bun upload-assets -- "${{ env.BUN_VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
@@ -54,32 +73,23 @@ jobs:
name: Release to NPM
runs-on: ubuntu-latest
needs: sign
- if: github.repository_owner == 'oven-sh'
+ if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.use-npm == 'true' }}
+ permissions:
+ contents: read
defaults:
run:
working-directory: packages/bun-release
steps:
- - id: checkout
- name: Checkout
+ - name: Checkout
uses: actions/checkout@v3
- - id: setup-env
- name: Setup Environment
- run: |
- TAG="${{ github.event.inputs.tag }}"
- TAG="${TAG:-"${{ github.event.release.tag_name }}"}"
- echo "Setup tag: ${TAG}"
- echo "TAG=${TAG}" >> ${GITHUB_ENV}
- - id: setup-bun
- name: Setup Bun
+ - name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
- bun-version: canary
- - id: bun-install
- name: Install Dependencies
+ bun-version: latest
+ - name: Install Dependencies
run: bun install
- - id: bun-run
- name: Release
- run: bun upload-npm -- "${{ env.TAG }}" publish
+ - name: Release
+ run: bun upload-npm -- "${{ env.BUN_VERSION }}" publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -87,41 +97,45 @@ jobs:
name: Release types to NPM
runs-on: ubuntu-latest
needs: sign
- if: github.repository_owner == 'oven-sh'
+ if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.use-types == 'true' }}
+ permissions:
+ contents: read
defaults:
run:
working-directory: packages/bun-types
steps:
- - id: checkout
- name: Checkout
+ - name: Checkout
uses: actions/checkout@v3
- - id: setup-env
- name: Setup Environment
- run: |
- TAG="${{ github.event.inputs.tag }}"
- TAG="${TAG:-"${{ github.event.release.tag_name }}"}"
- echo "Setup tag: ${TAG}"
- echo "TAG=${TAG}" >> ${GITHUB_ENV}
- - id: setup-node
- name: Setup Node.js
+ - name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: latest
- - id: setup-bun
- name: Setup Bun
+ - name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
- bun-version: canary
- - id: bun-install
- name: Install Dependencies
+ bun-version: latest
+ - name: Install Dependencies
run: bun install
- - id: bun-run
- name: Build
+ - name: Setup Tag
+ if: ${{ env.BUN_VERSION == 'canary' }}
+ run: |
+ VERSION=$(bun --version)
+ TAG="${VERSION}-canary.$(date +'%Y%m%dT%H%M%S')"
+ echo "Setup tag: ${TAG}"
+ echo "TAG=${TAG}" >> ${GITHUB_ENV}
+ - name: Build
run: bun run build
env:
- BUN_VERSION: ${{ env.TAG }}
- - id: npm-publish
- name: Release
+ BUN_VERSION: ${{ env.TAG || env.BUN_VERSION }}
+ - name: Release (canary)
+ if: ${{ env.BUN_VERSION == 'canary' }}
+ uses: JS-DevTools/npm-publish@v1
+ with:
+ package: packages/bun-types/dist/package.json
+ token: ${{ secrets.NPM_TOKEN }}
+ tag: canary
+ - name: Release (latest)
+ if: ${{ env.BUN_LATEST == 'true' }}
uses: JS-DevTools/npm-publish@v1
with:
package: packages/bun-types/dist/package.json
@@ -130,20 +144,28 @@ jobs:
name: Release to Dockerhub
runs-on: ubuntu-latest
needs: sign
- if: github.repository_owner == 'oven-sh'
+ if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.use-docker == 'true' }}
+ permissions:
+ contents: read
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - variant: debian
+ suffix: ''
+ - variant: debian
+ suffix: -debian
+ - variant: slim
+ suffix: -slim
+ dir: debian-slim
+ - variant: alpine
+ suffix: -alpine
+ - variant: distroless
+ suffix: -distroless
steps:
- - id: checkout
- name: Checkout
+ - name: Checkout
uses: actions/checkout@v3
- - id: environment
- name: Setup Environment
- run: |
- TAG="${{ github.event.inputs.tag }}"
- TAG="${TAG:-"${{ github.event.release.tag_name }}"}"
- echo "Setup tag: ${TAG}"
- echo "TAG=${TAG}" >> ${GITHUB_ENV}
- - id: qemu
- name: Setup Docker QEMU
+ - name: Setup Docker emulator
uses: docker/setup-qemu-action@v2
- id: buildx
name: Setup Docker buildx
@@ -155,67 +177,60 @@ jobs:
uses: docker/metadata-action@v4
with:
images: oven/bun
+ flavor: |
+ latest=false
tags: |
- type=match,pattern=(bun-v)?(\d+.\d+.\d+),group=2,value=${{ env.TAG }}
- type=match,pattern=(bun-v)?(\d+.\d+),group=2,value=${{ env.TAG }}
- - id: login
- name: Login to Docker
+ type=raw,value=latest,enable=${{ env.BUN_LATEST == 'true' && matrix.suffix == '' }}
+ type=raw,value=${{ matrix.variant }},enable=${{ env.BUN_LATEST == 'true' }}
+ type=match,pattern=(bun-v)?(canary|\d+.\d+.\d+),group=2,value=${{ env.BUN_VERSION }},suffix=${{ matrix.suffix }}
+ type=match,pattern=(bun-v)?(canary|\d+.\d+),group=2,value=${{ env.BUN_VERSION }},suffix=${{ matrix.suffix }}
+ type=match,pattern=(bun-v)?(canary|\d+),group=2,value=${{ env.BUN_VERSION }},suffix=${{ matrix.suffix }}
+ - name: Login to Docker
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- - id: push
- name: Push to Docker
+ - name: Push to Docker
uses: docker/build-push-action@v3
with:
- context: ./dockerhub
- file: ./dockerhub/Dockerfile-debian
+ context: ./dockerhub/${{ matrix.dir || matrix.variant }}
platforms: linux/amd64,linux/arm64
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
build-args: |
- BUN_VERSION=${{ env.TAG }}
+ BUN_VERSION=${{ env.BUN_VERSION }}
homebrew:
name: Release to Homebrew
runs-on: ubuntu-latest
needs: sign
- if: github.repository_owner == 'oven-sh'
+ permissions:
+ contents: read
+ if: ${{ github.event_name == 'release' || github.event.inputs.use-homebrew == 'true' }}
steps:
- - id: checkout
- name: Checkout
+ - name: Checkout
uses: actions/checkout@v3
with:
repository: oven-sh/homebrew-bun
token: ${{ secrets.ROBOBUN_TOKEN }}
- - id: setup-gpg
+ - id: gpg
name: Setup GPG
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- - id: setup-env
- name: Setup Environment
- run: |
- TAG="${{ github.event.inputs.tag }}"
- TAG="${TAG:-"${{ github.event.release.tag_name }}"}"
- echo "Setup tag: ${TAG}"
- echo "TAG=${TAG}" >> ${GITHUB_ENV}
- - id: setup-ruby
- name: Setup Ruby
+ - name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.6"
- - id: update-tap
- name: Update Tap
- run: ruby scripts/release.rb "${{ env.TAG }}"
- - id: commit-tap
- name: Commit Tap
+ - name: Update Tap
+ run: ruby scripts/release.rb "${{ env.BUN_VERSION }}"
+ - name: Commit Tap
uses: stefanzweifel/git-auto-commit-action@v4
with:
- commit_options: --gpg-sign=${{ steps.setup-gpg.outputs.keyid }}
- commit_message: Release ${{ env.TAG }}
+ commit_options: --gpg-sign=${{ steps.gpg.outputs.keyid }}
+ commit_message: Release ${{ env.BUN_VERSION }}
commit_user_name: robobun
commit_user_email: robobun@oven.sh
commit_author: robobun <robobun@oven.sh>
@@ -223,32 +238,23 @@ jobs:
name: Upload to S3
runs-on: ubuntu-latest
needs: sign
- if: github.repository_owner == 'oven-sh'
+ if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.use-s3 == 'true' }}
+ permissions:
+ contents: read
defaults:
run:
working-directory: packages/bun-release
steps:
- - id: checkout
- name: Checkout
+ - name: Checkout
uses: actions/checkout@v3
- - id: setup-env
- name: Setup Environment
- run: |
- TAG="${{ github.event.inputs.tag }}"
- TAG="${TAG:-"${{ github.event.release.tag_name }}"}"
- echo "Setup tag: ${TAG}"
- echo "TAG=${TAG}" >> ${GITHUB_ENV}
- - id: setup-bun
- name: Setup Bun
+ - name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
- bun-version: canary
- - id: bun-install
- name: Install Dependencies
+ bun-version: latest
+ - name: Install Dependencies
run: bun install
- - id: bun-run
- name: Release
- run: bun upload-s3 -- "${{ env.TAG }}"
+ - name: Release
+ run: bun upload-s3 -- "${{ env.BUN_VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
diff --git a/.github/workflows/prettier-fmt.yml b/.github/workflows/prettier-fmt.yml
index 877b34a6f..c3d26157b 100644
--- a/.github/workflows/prettier-fmt.yml
+++ b/.github/workflows/prettier-fmt.yml
@@ -12,6 +12,8 @@ jobs:
prettier-fmt:
name: prettier
runs-on: ubuntu-latest
+ permissions:
+ pull-requests: write
outputs:
prettier_fmt_errs: ${{ steps.fmt.outputs.prettier_fmt_errs }}
steps:
diff --git a/.github/workflows/zig-fmt.yml b/.github/workflows/zig-fmt.yml
index 04c4e1ec6..ca0cc93ba 100644
--- a/.github/workflows/zig-fmt.yml
+++ b/.github/workflows/zig-fmt.yml
@@ -1,7 +1,7 @@
name: zig-fmt
env:
- ZIG_VERSION: 0.12.0-dev.163+6780a6bbf
+ ZIG_VERSION: 0.12.0-dev.888+130227491
on:
pull_request:
@@ -18,6 +18,8 @@ jobs:
zig-fmt:
name: zig fmt
runs-on: ubuntu-latest
+ permissions:
+ pull-requests: write
outputs:
zig_fmt_errs: ${{ steps.fmt.outputs.zig_fmt_errs }}
steps:
diff --git a/.gitignore b/.gitignore
index cc74a1bc7..6f2ef8ed2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@ packages/*/*.wasm
profile.json
node_modules
+.envrc
.swcrc
yarn.lock
dist
@@ -123,6 +124,7 @@ cold-jsc-start
cold-jsc-start.d
/test.ts
+/test.js
src/js/out/modules*
src/js/out/functions*
@@ -132,4 +134,4 @@ src/js/out/DebugPath.h
make-dev-stats.csv
.uuid
-tsconfig.tsbuildinfo \ No newline at end of file
+tsconfig.tsbuildinfo
diff --git a/.scripts/postinstall.sh b/.scripts/postinstall.sh
index 05ecb3203..89c733203 100755
--- a/.scripts/postinstall.sh
+++ b/.scripts/postinstall.sh
@@ -2,12 +2,12 @@
set -euxo pipefail
# if bun-webkit node_modules directory exists
-if [ -d ./node_modules/bun-webkit ]; then
+if [ -d ./node_modules/bun-webkit ] || [ -d ./node_modules/bun-webkit-debug ]; then
rm -f bun-webkit
# get the first matching bun-webkit-* directory name
- ln -s ./node_modules/$(ls ./node_modules | grep bun-webkit- | head -n 1) ./bun-webkit
+ ln -s ./node_modules/$(ls ./node_modules | grep bun-webkit- | grep -v bun-webkit-debug | head -n 1) ./bun-webkit
fi
# sets up vscode C++ intellisense
rm -f .vscode/clang++
-ln -s $(which clang++-15 || which clang++) .vscode/clang++ 2>/dev/null
+ln -s $(which clang++-16 || which clang++) .vscode/clang++ 2>/dev/null
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
index 3295d6012..2327e93a2 100644
--- a/.vscode/c_cpp_properties.json
+++ b/.vscode/c_cpp_properties.json
@@ -6,11 +6,11 @@
"includePath": [
"${workspaceFolder}/../webkit-build/include/",
"${workspaceFolder}/bun-webkit/include/",
- "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/",
- "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/ICU/Headers/",
- "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/",
- "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/WTF/Headers",
- "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/bmalloc/Headers/",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/ICU/Headers/",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/JavaScriptCore/PrivateHeaders/",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/WTF/Headers",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/bmalloc/Headers/",
"${workspaceFolder}/src/bun.js/bindings/",
"${workspaceFolder}/src/bun.js/bindings/webcore/",
"${workspaceFolder}/src/bun.js/bindings/sqlite/",
@@ -28,11 +28,11 @@
"path": [
"${workspaceFolder}/../webkit-build/include/",
"${workspaceFolder}/bun-webkit/include/",
- "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/",
- "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/ICU/Headers/",
- "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/**",
- "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/WTF/Headers/**",
- "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/bmalloc/Headers/**",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/ICU/Headers/",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/JavaScriptCore/PrivateHeaders/**",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/WTF/Headers/**",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/bmalloc/Headers/**",
"${workspaceFolder}/src/bun.js/bindings/*",
"${workspaceFolder}/src/bun.js/bindings/*",
"${workspaceFolder}/src/napi/*",
@@ -59,7 +59,70 @@
"ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS=0",
"BUILDING_JSCONLY__",
"USE_FOUNDATION=1",
- "ASSERT_ENABLED=0",
+ "ASSERT_ENABLED=1",
+ "DU_DISABLE_RENAMING=1"
+ ],
+ "macFrameworkPath": [],
+ "compilerPath": "${workspaceFolder}/.vscode/clang++",
+ "cStandard": "c17",
+ "cppStandard": "c++20"
+ },
+ {
+ "name": "BunWithJSCDebug",
+ "forcedInclude": ["${workspaceFolder}/src/bun.js/bindings/root.h"],
+ "includePath": [
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/ICU/Headers/",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/JavaScriptCore/PrivateHeaders/",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/WTF/Headers",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/bmalloc/Headers/",
+ "${workspaceFolder}/src/bun.js/bindings/",
+ "${workspaceFolder}/src/bun.js/bindings/webcore/",
+ "${workspaceFolder}/src/bun.js/bindings/sqlite/",
+ "${workspaceFolder}/src/bun.js/bindings/webcrypto/",
+ "${workspaceFolder}/src/bun.js/modules/",
+ "${workspaceFolder}/src/js/builtins/",
+ "${workspaceFolder}/src/js/out",
+ "${workspaceFolder}/src/deps/boringssl/include/",
+ "${workspaceFolder}/src/deps",
+ "${workspaceFolder}/src/napi/*",
+ "${workspaceFolder}/packages/bun-usockets/src",
+ "${workspaceFolder}/packages/"
+ ],
+ "browse": {
+ "path": [
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/ICU/Headers/",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/JavaScriptCore/PrivateHeaders/**",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/WTF/Headers/**",
+ "${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/bmalloc/Headers/**",
+ "${workspaceFolder}/src/bun.js/bindings/*",
+ "${workspaceFolder}/src/bun.js/bindings/*",
+ "${workspaceFolder}/src/napi/*",
+ "${workspaceFolder}/src/bun.js/bindings/sqlite/",
+ "${workspaceFolder}/src/bun.js/bindings/webcrypto/",
+ "${workspaceFolder}/src/bun.js/bindings/webcore/",
+ "${workspaceFolder}/src/js/builtins/*",
+ "${workspaceFolder}/src/js/out/*",
+ "${workspaceFolder}/src/bun.js/modules/*",
+ "${workspaceFolder}/src/deps",
+ "${workspaceFolder}/src/deps/boringssl/include/",
+ "${workspaceFolder}/packages/bun-usockets/",
+ "${workspaceFolder}/packages/bun-uws/",
+ "${workspaceFolder}/src/napi"
+ ],
+ "limitSymbolsToIncludedHeaders": true,
+ "databaseFilename": ".vscode/cppdb_debug"
+ },
+ "defines": [
+ "STATICALLY_LINKED_WITH_JavaScriptCore=1",
+ "STATICALLY_LINKED_WITH_WTF=1",
+ "BUILDING_WITH_CMAKE=1",
+ "NOMINMAX",
+ "ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS=0",
+ "BUILDING_JSCONLY__",
+ "USE_FOUNDATION=1",
+ "ASSERT_ENABLED=1",
"DU_DISABLE_RENAMING=1"
],
"macFrameworkPath": [],
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 403ca8d7b..e3caccbd2 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -96,7 +96,7 @@
"request": "launch",
"name": "bun test [*]",
"program": "bun-debug",
- "args": ["test"],
+ "args": ["test", "js/node"],
"cwd": "${workspaceFolder}/test",
"env": {
"FORCE_COLOR": "1",
@@ -110,7 +110,7 @@
"request": "launch",
"name": "bun test [*] (fast)",
"program": "bun-debug",
- "args": ["test"],
+ "args": ["test", "js"],
// The cwd here must be the same as in CI. Or you will cause test failures that only happen in CI.
"cwd": "${workspaceFolder}/test",
"env": {
@@ -324,10 +324,9 @@
"cwd": "${fileDirname}",
"console": "internalConsole",
"env": {
- "BUN_DEBUG_QUIET_LOGS": "1"
+ "BUN_DEBUG_ALL": "1"
}
},
-
{
"type": "lldb",
"request": "launch",
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 674480576..4155db7ac 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -7,8 +7,7 @@
"search.followSymlinks": false,
"search.useIgnoreFiles": true,
"zig.buildOnSave": false,
- // We do this until we upgrade to latest Zig so that zls doesn't break our code.
- "zig.formattingProvider": "extension",
+ "zig.formattingProvider": "zls",
"zig.buildArgs": ["obj", "-Dfor-editor"],
"zig.buildOption": "build",
"zig.buildFilePath": "${workspaceFolder}/build.zig",
@@ -27,7 +26,8 @@
"editor.formatOnSave": true
},
"zig.zls.enableInlayHints": false,
-
+ "zig.zls.enabled": true,
+ "git.ignoreSubmodules": true,
"[jsx]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
@@ -80,7 +80,9 @@
"src/deps/zstd": true,
"test/snippets/package-json-exports/_node_modules_copy": true,
"src/js/out": true,
- "src/packages/bun-uws/fuzzing/seed-corpus/": true
+ "packages/bun-uws/fuzzing/seed-corpus/": true,
+ "**/*.dep": true,
+ "**/CMakeFiles": true
},
"C_Cpp.files.exclude": {
"**/.vscode": true,
@@ -220,7 +222,6 @@
"valarray": "cpp",
"codecvt": "cpp"
},
- "cmake.configureOnOpen": false,
"C_Cpp.errorSquiggles": "enabled",
"eslint.workingDirectories": ["packages/bun-types"],
"typescript.tsdk": "node_modules/typescript/lib"
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 84394f654..86a7ccb72 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -10,7 +10,7 @@ Today (February 2023), Bun's codebase has five distinct parts:
- JavaScript, JSX, & TypeScript transpiler, module resolver, and related code
- JavaScript runtime ([`src/bun.js/`](src/bun.js/))
-- JavaScript runtime bindings ([`src/bun.zig/bindings/**/*.cpp`](src/bun.zig/bindings/))
+- JavaScript runtime bindings ([`src/bun.js/bindings/**/*.cpp`](src/bun.js/bindings/))
- Package manager ([`src/install/`](src/install/))
- Shared utilities ([`src/string_immutable.zig`](src/string_immutable.zig))
diff --git a/Dockerfile b/Dockerfile
index 9f2c43e19..863f2e680 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -10,9 +10,9 @@ ARG ARCH=x86_64
ARG BUILD_MACHINE_ARCH=x86_64
ARG TRIPLET=${ARCH}-linux-gnu
ARG BUILDARCH=amd64
-ARG WEBKIT_TAG=2023-aug3-5
+ARG WEBKIT_TAG=2023-oct3-2
ARG ZIG_TAG=jul1
-ARG ZIG_VERSION="0.12.0-dev.163+6780a6bbf"
+ARG ZIG_VERSION="0.12.0-dev.888+130227491"
ARG WEBKIT_BASENAME="bun-webkit-linux-$BUILDARCH"
ARG ZIG_FOLDERNAME=zig-linux-${BUILD_MACHINE_ARCH}-${ZIG_VERSION}
@@ -24,15 +24,13 @@ ARG BUN_BASE_VERSION=1.0
FROM bitnami/minideb:bullseye as bun-base
-RUN install_packages ca-certificates curl wget lsb-release software-properties-common gnupg gnupg1 gnupg2
-
-RUN wget https://apt.llvm.org/llvm.sh && \
- chmod +x llvm.sh && \
- ./llvm.sh 15
-
-RUN install_packages \
+RUN install_packages ca-certificates curl wget lsb-release software-properties-common gnupg gnupg1 gnupg2 && \
+ echo "deb https://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-16 main" > /etc/apt/sources.list.d/llvm.list && \
+ echo "deb-src https://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-16 main" >> /etc/apt/sources.list.d/llvm.list && \
+ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
+ curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
+ install_packages \
cmake \
- curl \
file \
git \
gnupg \
@@ -46,16 +44,16 @@ RUN install_packages \
rsync \
ruby \
unzip \
+ clang-16 \
+ lld-16 \
+ lldb-16 \
+ clangd-16 \
xz-utils \
- bash tar gzip ccache
-
-ENV CXX=clang++-15
-ENV CC=clang-15
-
-RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
- install_packages nodejs && \
+ bash tar gzip ccache nodejs && \
npm install -g esbuild
+ENV CXX=clang++-16
+ENV CC=clang-16
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
@@ -72,10 +70,10 @@ ARG ZIG_FILENAME
ENV WEBKIT_OUT_DIR=${WEBKIT_DIR}
ENV BUILDARCH=${BUILDARCH}
-ENV AR=/usr/bin/llvm-ar-15
+ENV AR=/usr/bin/llvm-ar-16
ENV ZIG "${ZIG_PATH}/zig"
ENV PATH="$ZIG/bin:$PATH"
-ENV LD=lld-15
+ENV LD=lld-16
RUN mkdir -p $BUN_DIR $BUN_DEPS_OUT_DIR
@@ -157,7 +155,7 @@ COPY src/deps/lol-html ${BUN_DIR}/src/deps/lol-html
ENV CCACHE_DIR=/ccache
-RUN --mount=type=cache,target=/ccache export PATH=$PATH:$HOME/.cargo/bin && export CC=$(which clang-15) && cd ${BUN_DIR} && \
+RUN --mount=type=cache,target=/ccache export PATH=$PATH:$HOME/.cargo/bin && export CC=$(which clang-16) && cd ${BUN_DIR} && \
make lolhtml && rm -rf src/deps/lol-html Makefile
FROM bun-base as mimalloc
@@ -288,6 +286,7 @@ COPY packages/bun-uws ${BUN_DIR}/packages/bun-uws
COPY packages/bun-usockets ${BUN_DIR}/packages/bun-usockets
COPY src/deps/zlib ${BUN_DIR}/src/deps/zlib
COPY src/deps/boringssl/include ${BUN_DIR}/src/deps/boringssl/include
+COPY src/deps/c-ares/include ${BUN_DIR}/src/deps/c-ares/include
COPY src/deps/libuwsockets.cpp ${BUN_DIR}/src/deps/libuwsockets.cpp
COPY src/deps/_libusockets.h ${BUN_DIR}/src/deps/_libusockets.h
diff --git a/Makefile b/Makefile
index b3fe2d6bf..16fbbfb4f 100644
--- a/Makefile
+++ b/Makefile
@@ -82,9 +82,9 @@ ZIG ?= $(shell which zig 2>/dev/null || echo -e "error: Missing zig. Please make
# This is easier to happen than you'd expect.
# Using realpath here causes issues because clang uses clang++ as a symlink
# so if that's resolved, it won't build for C++
-REAL_CC = $(shell which clang-15 2>/dev/null || which clang 2>/dev/null)
-REAL_CXX = $(shell which clang++-15 2>/dev/null || which clang++ 2>/dev/null)
-CLANG_FORMAT = $(shell which clang-format-15 2>/dev/null || which clang-format 2>/dev/null)
+REAL_CC = $(shell which clang-16 2>/dev/null || which clang 2>/dev/null)
+REAL_CXX = $(shell which clang++-16 2>/dev/null || which clang++ 2>/dev/null)
+CLANG_FORMAT = $(shell which clang-format-16 2>/dev/null || which clang-format 2>/dev/null)
CC = $(REAL_CC)
CXX = $(REAL_CXX)
@@ -108,14 +108,14 @@ CC_WITH_CCACHE = $(CCACHE_PATH) $(CC)
ifeq ($(OS_NAME),darwin)
# Find LLVM
ifeq ($(wildcard $(LLVM_PREFIX)),)
- LLVM_PREFIX = $(shell brew --prefix llvm@15)
+ LLVM_PREFIX = $(shell brew --prefix llvm@16)
endif
ifeq ($(wildcard $(LLVM_PREFIX)),)
LLVM_PREFIX = $(shell brew --prefix llvm)
endif
ifeq ($(wildcard $(LLVM_PREFIX)),)
# This is kinda ugly, but I can't find a better way to error :(
- LLVM_PREFIX = $(shell echo -e "error: Unable to find llvm. Please run 'brew install llvm@15' or set LLVM_PREFIX=/path/to/llvm")
+ LLVM_PREFIX = $(shell echo -e "error: Unable to find llvm. Please run 'brew install llvm@16' or set LLVM_PREFIX=/path/to/llvm")
endif
LDFLAGS += -L$(LLVM_PREFIX)/lib
@@ -155,7 +155,7 @@ CMAKE_FLAGS_WITHOUT_RELEASE = -DCMAKE_C_COMPILER=$(CC) \
-DCMAKE_OSX_DEPLOYMENT_TARGET=$(MIN_MACOS_VERSION) \
$(CMAKE_CXX_COMPILER_LAUNCHER_FLAG) \
-DCMAKE_AR=$(AR) \
- -DCMAKE_RANLIB=$(which llvm-15-ranlib 2>/dev/null || which llvm-ranlib 2>/dev/null)
+ -DCMAKE_RANLIB=$(which llvm-16-ranlib 2>/dev/null || which llvm-ranlib 2>/dev/null)
@@ -177,7 +177,7 @@ endif
ifeq ($(OS_NAME),linux)
LIBICONV_PATH =
-AR = $(shell which llvm-ar-15 2>/dev/null || which llvm-ar 2>/dev/null || which ar 2>/dev/null)
+AR = $(shell which llvm-ar-16 2>/dev/null || which llvm-ar 2>/dev/null || which ar 2>/dev/null)
endif
OPTIMIZATION_LEVEL=-O3 $(MARCH_NATIVE)
@@ -274,7 +274,7 @@ STRIP=/usr/bin/strip
endif
ifeq ($(OS_NAME),linux)
-STRIP=$(shell which llvm-strip 2>/dev/null || which llvm-strip-15 2>/dev/null || which strip 2>/dev/null || echo "Missing strip")
+STRIP=$(shell which llvm-strip 2>/dev/null || which llvm-strip-16 2>/dev/null || which strip 2>/dev/null || echo "Missing strip")
endif
@@ -550,7 +550,7 @@ tinycc:
cd $(TINYCC_DIR) && \
make clean && \
AR=$(AR) $(CCACHE_CC_FLAG) CFLAGS='$(CFLAGS_WITHOUT_MARCH) $(NATIVE_OR_OLD_MARCH) -mtune=native $(TINYCC_CFLAGS)' ./configure --enable-static --cc=$(CCACHE_CC_OR_CC) --ar=$(AR) --config-predefs=yes && \
- make -j10 && \
+ make libtcc.a -j10 && \
cp $(TINYCC_DIR)/*.a $(BUN_DEPS_OUT_DIR)
PYTHON=$(shell which python 2>/dev/null || which python3 2>/dev/null || which python2 2>/dev/null)
@@ -664,7 +664,7 @@ endif
.PHONY: assert-deps
assert-deps:
@echo "Checking if the required utilities are available..."
- @if [ $(CLANG_VERSION) -lt "15" ]; then echo -e "ERROR: clang version >=15 required, found: $(CLANG_VERSION). Install with:\n\n $(POSIX_PKG_MANAGER) install llvm@15"; exit 1; fi
+ @if [ $(CLANG_VERSION) -lt "15" ]; then echo -e "ERROR: clang version >=15 required, found: $(CLANG_VERSION). Install with:\n\n $(POSIX_PKG_MANAGER) install llvm@16"; exit 1; fi
@cmake --version >/dev/null 2>&1 || (echo -e "ERROR: cmake is required."; exit 1)
@$(PYTHON) --version >/dev/null 2>&1 || (echo -e "ERROR: python is required."; exit 1)
@$(ESBUILD) --version >/dev/null 2>&1 || (echo -e "ERROR: esbuild is required."; exit 1)
@@ -811,7 +811,7 @@ fmt-cpp:
.PHONY: fmt-zig
fmt-zig:
- cd src && zig fmt **/*.zig
+ cd src && $(ZIG) fmt **/*.zig
.PHONY: fmt
fmt: fmt-cpp fmt-zig
@@ -945,7 +945,7 @@ headers:
$(ZIG) translate-c src/bun.js/bindings/headers.h > src/bun.js/bindings/headers.zig
$(BUN_OR_NODE) misctools/headers-cleaner.js
$(ZIG) fmt src/bun.js/bindings/headers.zig
- $(CLANG_FORMAT) -i src/bun.js/bindings/ZigGeneratedCode.cpp
+ $(CLANG_FORMAT) -i src/bun.js/bindings/ZigGeneratedCode.cpp
.PHONY: jsc-bindings-headers
jsc-bindings-headers: headers
@@ -1291,7 +1291,7 @@ jsc-build-linux-compile-config:
jsc-build-linux-compile-build:
mkdir -p $(WEBKIT_RELEASE_DIR) && \
cd $(WEBKIT_RELEASE_DIR) && \
- CFLAGS="$(CFLAGS) -Wl,--whole-archive -ffat-lto-objects" CXXFLAGS="$(CXXFLAGS) -Wl,--whole-archive -ffat-lto-objects" -DUSE_BUN_JSC_ADDITIONS=ON \
+ CFLAGS="$(CFLAGS) -Wl,--whole-archive -ffat-lto-objects" CXXFLAGS="$(CXXFLAGS) -Wl,--whole-archive -ffat-lto-objects -DUSE_BUN_JSC_ADDITIONS=ON" \
cmake --build $(WEBKIT_RELEASE_DIR) --config relwithdebuginfo --target jsc
@@ -1482,7 +1482,7 @@ bun-relink: bun-relink-copy bun-link-lld-release bun-link-lld-release-dsym
bun-relink-fast: bun-relink-copy bun-link-lld-release-no-lto
wasm-return1:
- zig build-lib -OReleaseSmall test/bun.js/wasm-return-1-test.zig -femit-bin=test/bun.js/wasm-return-1-test.wasm -target wasm32-freestanding
+ $(ZIG) build-lib -OReleaseSmall test/bun.js/wasm-return-1-test.zig -femit-bin=test/bun.js/wasm-return-1-test.wasm -target wasm32-freestanding
generate-classes:
bun src/bun.js/scripts/generate-classes.ts
@@ -1518,7 +1518,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(EMIT_LLVM) \
-c -o $@ $<
@@ -1529,7 +1529,7 @@ $(OBJ_DIR)/%.o: src/bun.js/modules/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(EMIT_LLVM) \
-c -o $@ $<
@@ -1540,7 +1540,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/webcore/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(EMIT_LLVM) \
-c -o $@ $<
@@ -1551,7 +1551,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/sqlite/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(EMIT_LLVM) \
-c -o $@ $<
@@ -1562,7 +1562,7 @@ $(OBJ_DIR)/%.o: src/io/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(EMIT_LLVM) \
-c -o $@ $<
@@ -1573,7 +1573,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/node_os/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(EMIT_LLVM) \
-c -o $@ $<
@@ -1584,7 +1584,7 @@ $(OBJ_DIR)/%.o: src/js/out/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(EMIT_LLVM) \
-c -o $@ $<
@@ -1596,7 +1596,7 @@ $(OBJ_DIR)/%.o: src/bun.js/bindings/webcrypto/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(EMIT_LLVM) \
-c -o $@ $<
@@ -1610,7 +1610,7 @@ $(DEBUG_OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
-DBUN_DEBUG \
$(EMIT_LLVM_FOR_DEBUG) \
-g3 -c -o $@ $<
@@ -1625,7 +1625,7 @@ $(DEBUG_OBJ_DIR)/%.o: $(SRC_DIR)/webcore/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(EMIT_LLVM_FOR_DEBUG) \
-DBUN_DEBUG \
-g3 -c -o $@ $<
@@ -1638,7 +1638,7 @@ $(DEBUG_OBJ_DIR)/%.o: src/io/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
-DBUN_DEBUG \
$(EMIT_LLVM_FOR_DEBUG) \
-g3 -c -o $@ $<
@@ -1654,7 +1654,7 @@ $(DEBUG_OBJ_DIR)/%.o: $(SRC_DIR)/sqlite/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(EMIT_LLVM_FOR_DEBUG) \
-DBUN_DEBUG \
-g3 -c -o $@ $<
@@ -1669,7 +1669,7 @@ $(DEBUG_OBJ_DIR)/%.o: $(SRC_DIR)/node_os/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(EMIT_LLVM_FOR_DEBUG) \
-DBUN_DEBUG \
-g3 -c -o $@ $<
@@ -1684,7 +1684,7 @@ $(DEBUG_OBJ_DIR)/%.o: src/js/out/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(EMIT_LLVM_FOR_DEBUG) \
-DBUN_DEBUG \
-g3 -c -o $@ $<
@@ -1697,7 +1697,7 @@ $(DEBUG_OBJ_DIR)/%.o: src/bun.js/modules/%.cpp
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(EMIT_LLVM_FOR_DEBUG) \
-DBUN_DEBUG \
-g3 -c -o $@ $<
@@ -1712,7 +1712,7 @@ $(DEBUG_OBJ_DIR)/%.o: src/bun.js/bindings/webcrypto/%.cpp
-fno-exceptions \
-I$(SRC_DIR) \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(EMIT_LLVM_FOR_DEBUG) \
-DBUN_DEBUG \
-g3 -c -o $@ $<
@@ -1825,7 +1825,7 @@ endif
build-unit: # to build your unit tests
@rm -rf zig-out/bin/$(testname)
@mkdir -p zig-out/bin
- zig test $(realpath $(testpath)) \
+ $(ZIG) test $(realpath $(testpath)) \
$(testfilterflag) \
$(PACKAGE_MAP) \
--main-pkg-path $(BUN_DIR) \
@@ -1843,7 +1843,7 @@ build-unit: # to build your unit tests
run-all-unit-tests: # to run your unit tests
@rm -rf zig-out/bin/__main_test
@mkdir -p zig-out/bin
- zig test src/main.zig \
+ $(ZIG) test src/main.zig \
$(PACKAGE_MAP) \
--main-pkg-path $(BUN_DIR) \
--test-no-exec \
@@ -1891,7 +1891,7 @@ cold-jsc-start:
${MMD_IF_LOCAL} \
-fno-exceptions \
-fno-rtti \
- -ferror-limit=1000 \
+ -ferror-limit=10 \
$(LIBICONV_PATH) \
$(DEFAULT_LINKER_FLAGS) \
$(PLATFORM_LINKER_FLAGS) \
@@ -1915,9 +1915,14 @@ vendor-dev: assert-deps submodule npm-install-dev vendor-without-npm
.PHONY: bun
bun: vendor identifier-cache build-obj bun-link-lld-release bun-codesign-release-local
+.PHONY: static-hash-table
+static-hash-table:
+ bun src/js/_codegen/static-hash-tables.ts
+
.PHONY: cpp
cpp: ## compile src/js/builtins + all c++ code then link
@make clean-bindings js
+ @make static-hash-table
@make bindings -j$(CPU_COUNT)
@make link
@@ -1949,5 +1954,5 @@ setup: vendor-dev identifier-cache clean-bindings
.PHONY: help
help: ## to print this help
- @echo "For detailed build instructions, see https://bun.sh/docs/project/development"
- @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf "\033[36m%-20s\033[0m \t\t%s\n", $$1, $$2}' $(MAKEFILE_LIST)
+ @echo "For detailed build instructions, see https://bun.sh/docs/project/contributing"
+ @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf "\033[36m%-20s\033[0m \t\t%s\n", $$1, $$2}' $(MAKEFILE_LIST) \ No newline at end of file
diff --git a/README.md b/README.md
index 0d85c5247..b30fed509 100644
--- a/README.md
+++ b/README.md
@@ -24,14 +24,14 @@
## What is Bun?
-> **​​Bun is still under development.** Use it to speed up your development workflows or run simpler production code in resource-constrained environments like serverless functions. We're working on more complete Node.js compatibility and integration with existing frameworks. Join the [Discord](https://bun.sh/discord) and watch the [GitHub repository](https://github.com/oven-sh/bun) to keep tabs on future releases.
+> **​​Bun is under active development.** Use it to speed up your development workflows or run simpler production code in resource-constrained environments like serverless functions. We're working on more complete Node.js compatibility and integration with existing frameworks. Join the [Discord](https://bun.sh/discord) and watch the [GitHub repository](https://github.com/oven-sh/bun) to keep tabs on future releases.
Bun is an all-in-one toolkit for JavaScript and TypeScript apps. It ships as a single executable called `bun​`.
At its core is the _Bun runtime_, a fast JavaScript runtime designed as a drop-in replacement for Node.js. It's written in Zig and powered by JavaScriptCore under the hood, dramatically reducing startup times and memory usage.
```bash
-bun run index.tsx # TS and JSX supported out of the box
+bun run index.tsx # TS and JSX supported out-of-the-box
```
​​The `bun​` command-line tool also implements a test runner, script runner, and Node.js-compatible package manager. Instead of 1,000 node_modules for development, you only need `bun`. Bun's built-in tools are significantly faster than existing options and usable in existing Node.js projects with little to no changes.
@@ -93,7 +93,8 @@ bun upgrade --canary
- [`bun run`](https://bun.sh/docs/cli/run)
- [`bun install`](https://bun.sh/docs/cli/install)
- [`bun test`](https://bun.sh/docs/cli/test)
- - [`bun create`](https://bun.sh/docs/cli/create)
+ - [`bun init`](https://bun.sh/docs/cli/init)
+ - [`bun create`](https://bun.sh/docs/cli/bun-create)
- [`bunx`](https://bun.sh/docs/cli/bunx)
- Runtime
- [Runtime](https://bun.sh/docs/runtime/index)
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 000000000..5179a1ec7
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,12 @@
+# Security Policy
+
+## Supported Versions
+
+| Version | Supported |
+| ------- | ------------------ |
+| 1.x.x | :white_check_mark: |
+
+## Reporting a Vulnerability
+
+Report any discovered vulnerabilities to the Bun team by emailing `security@bun.sh`. Your report will acknowledged within 5 days, and a team member will be assigned as the primary handler. To the greatest extent possible, the security team will endeavor to keep you informed of the progress being made towards a fix and full announcement, and may ask for additional information or guidance surrounding the reported issue.
+
diff --git a/bench/snippets/private.mjs b/bench/snippets/private.mjs
index ca75c6e07..452dab06b 100644
--- a/bench/snippets/private.mjs
+++ b/bench/snippets/private.mjs
@@ -77,4 +77,24 @@ bench("ConventionalPrivates", () => {
new Foo().run();
});
+const _state = Symbol("state");
+const _inc = Symbol("inc");
+
+bench("SymbolPrivates", () => {
+ class Foo {
+ [_state] = 1;
+ [_inc] = 13;
+
+ run() {
+ let n = 1000000;
+ while (n-- > 0) {
+ this[_state] += this[_inc];
+ }
+ return n;
+ }
+ }
+
+ new Foo().run();
+});
+
await run();
diff --git a/bench/snippets/rmdir.mjs b/bench/snippets/rmdir.mjs
new file mode 100644
index 000000000..258d69097
--- /dev/null
+++ b/bench/snippets/rmdir.mjs
@@ -0,0 +1,22 @@
+import { tmpdir } from "node:os";
+import { promises, existsSync, mkdirSync } from "node:fs";
+const count = 1024 * 12;
+
+var queue = new Array(count);
+var paths = new Array(count);
+for (let i = 0; i < count; i++) {
+ const path = `${tmpdir()}/${Date.now()}.rm.dir${i}`;
+ try {
+ mkdirSync(path);
+ } catch (e) {}
+ paths[i] = path;
+ queue[i] = promises.rmdir(path);
+}
+
+await Promise.all(queue);
+
+for (let i = 0; i < count; i++) {
+ if (existsSync(paths[i])) {
+ throw new Error(`Path ${paths[i]} was not removed`);
+ }
+}
diff --git a/bench/snippets/write.node.mjs b/bench/snippets/write.node.mjs
index 14bceb23f..f59c98aef 100644
--- a/bench/snippets/write.node.mjs
+++ b/bench/snippets/write.node.mjs
@@ -9,9 +9,8 @@ bench("writeFile(/tmp/foo.txt, short string)", async () => {
await writeFile("/tmp/foo.txt", "short string", "utf8");
});
-const buffer = Buffer.from("short string");
bench("writeFile(/tmp/foo.txt, Buffer.from(short string))", async () => {
- await writeFile("/tmp/foo.txt", buffer);
+ await writeFile("/tmp/foo.txt", Buffer.from("short string"));
});
const fd = openSync("/tmp/foo.txt", "w");
@@ -22,7 +21,7 @@ bench("write(fd, short string)", () => {
});
bench("write(fd, Uint8Array(short string))", () => {
- const bytesWritten = write(fd, buffer);
+ const bytesWritten = write(fd, Buffer.from("short string"));
if (bytesWritten !== 12) throw new Error("wrote !== 12");
});
diff --git a/build.zig b/build.zig
index 6a860221a..85e4e94d4 100644
--- a/build.zig
+++ b/build.zig
@@ -1,3 +1,5 @@
+const required_zig_version = "0.12.0-dev.888+130227491";
+
const std = @import("std");
const pathRel = std.fs.path.relative;
const Wyhash = @import("./src/wyhash.zig").Wyhash;
@@ -146,6 +148,20 @@ pub fn build(b: *Build) !void {
}
pub fn build_(b: *Build) !void {
+ if (!std.mem.eql(u8, @import("builtin").zig_version_string, required_zig_version)) {
+ const colors = std.io.getStdErr().supportsAnsiEscapeCodes();
+ std.debug.print(
+ "{s}WARNING:\nBun requires zig version '{s}', but found '{s}', build may fail...\nMake sure you installed the right version as per https://bun.sh/docs/project/development#install-zig\n{s}You can update to the right version using 'zigup {s}'\n\n",
+ .{
+ if (colors) "\x1b[1;33m" else "",
+ required_zig_version,
+ @import("builtin").zig_version_string,
+ if (colors) "\x1b[0m" else "",
+ required_zig_version,
+ },
+ );
+ }
+
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
@@ -217,7 +233,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative(root_src),
.target = target,
.optimize = optimize,
- .main_pkg_path = .{ .cwd_relative = b.pathFromRoot(".") },
+ .main_mod_path = .{ .cwd_relative = b.pathFromRoot(".") },
});
b.reference_trace = 16;
@@ -331,7 +347,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("src/bindgen.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -348,7 +364,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("root_wasm.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer wasm_step.dependOn(&wasm.step);
wasm.strip = false;
@@ -367,7 +383,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("misctools/http_bench.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -381,7 +397,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("misctools/machbench.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -395,7 +411,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("misctools/fetch.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -409,7 +425,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("src/bench/string-handling.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -423,7 +439,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("src/sha.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -437,7 +453,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("src/sourcemap/vlq_bench.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -451,7 +467,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("misctools/tgz.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -468,7 +484,7 @@ pub fn build_(b: *Build) !void {
var headers_obj: *CompileStep = b.addTest(.{
.root_source_file = FileSource.relative(test_file orelse "src/main.zig"),
.target = target,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
headers_obj.filter = test_filter;
if (test_bin_) |test_bin| {
diff --git a/bun.lockb b/bun.lockb
index 416340aed..93f35f282 100755
--- a/bun.lockb
+++ b/bun.lockb
Binary files differ
diff --git a/bunfig.toml b/bunfig.toml
index 4e205af4f..99838d3ce 100644
--- a/bunfig.toml
+++ b/bunfig.toml
@@ -1,8 +1,8 @@
[test]
# Large monorepos (like Bun) may want to specify the test directory more specifically
-# By default, `bun test` scans every single folder recurisvely which, if you
-# have a gigantic submodule (like WebKit), it has to do lots of directory
+# By default, `bun test` scans every single folder recursively which, if you
+# have a gigantic submodule (like WebKit), requires lots of directory
# traversals
#
-# Instead, we can just make it scan only the test directory for Bun's runtime tests
+# Instead, we can only scan the test directory for Bun's runtime tests
root = "test"
diff --git a/completions/bun.bash b/completions/bun.bash
index 499adc470..e77f80db5 100644
--- a/completions/bun.bash
+++ b/completions/bun.bash
@@ -92,12 +92,12 @@ _bun_completions() {
PACKAGE_OPTIONS[REMOVE_OPTIONS_LONG]="";
PACKAGE_OPTIONS[REMOVE_OPTIONS_SHORT]="";
- PACKAGE_OPTIONS[SHARED_OPTIONS_LONG]="--config --yarn --production --frozen-lockfile --no-save --dry-run --lockfile --force --cache-dir --no-cache --silent --verbose --global --cwd --backend --link-native-bins --help";
+ PACKAGE_OPTIONS[SHARED_OPTIONS_LONG]="--config --yarn --production --frozen-lockfile --no-save --dry-run --force --cache-dir --no-cache --silent --verbose --global --cwd --backend --link-native-bins --help";
PACKAGE_OPTIONS[SHARED_OPTIONS_SHORT]="-c -y -p -f -g";
- PM_OPTIONS[LONG_OPTIONS]="--config --yarn --production --frozen-lockfile --no-save --dry-run --lockfile --force --cache-dir --no-cache --silent --verbose --no-progress --no-summary --no-verify --ignore-scripts --global --cwd --backend --link-native-bins --help"
+ PM_OPTIONS[LONG_OPTIONS]="--config --yarn --production --frozen-lockfile --no-save --dry-run --force --cache-dir --no-cache --silent --verbose --no-progress --no-summary --no-verify --ignore-scripts --global --cwd --backend --link-native-bins --help"
PM_OPTIONS[SHORT_OPTIONS]="-c -y -p -f -g"
-
+
local cur_word="${COMP_WORDS[${COMP_CWORD}]}";
local prev="${COMP_WORDS[$(( COMP_CWORD - 1 ))]}";
diff --git a/completions/bun.zsh b/completions/bun.zsh
index 59df1db47..2381b857c 100644
--- a/completions/bun.zsh
+++ b/completions/bun.zsh
@@ -1,350 +1,748 @@
#compdef bun
-_bun() {
- zstyle ':completion:*:*:bun:*' group-name ''
- zstyle ':completion:*:*:bun-grouped:*' group-name ''
- zstyle ':completion:*:*:bun::descriptions' format '%F{green}-- %d --%f'
- zstyle ':completion:*:*:bun-grouped:*' format '%F{green}-- %d --%f'
+_bun_add_completion() {
+ _arguments -s -C \
+ '1: :->cmd1' \
+ '*: :->package' \
+ '--config[Load config(bunfig.toml)]: :->config' \
+ '-c[Load config(bunfig.toml)]: :->config' \
+ '--yarn[Write a yarn.lock file (yarn v1)]' \
+ '-y[Write a yarn.lock file (yarn v1)]' \
+ '--production[Don'"'"'t install devDependencies]' \
+ '-p[Don'"'"'t install devDependencies]' \
+ '--no-save[Don'"'"'t save a lockfile]' \
+ '--save[Save to package.json]' \
+ '--dry-run[Don'"'"'t install anything]' \
+ '--frozen-lockfile[Disallow changes to lockfile]' \
+ '--force[Always request the latest versions from the registry & reinstall all dependencies]' \
+ '-f[Always request the latest versions from the registry & reinstall all dependencies]' \
+ '--cache-dir[Store & load cached data from a specific directory path]:cache-dir' \
+ '--no-cache[Ignore manifest cache entirely]' \
+ '--silent[Don'"'"'t log anything]' \
+ '--verbose[Excessively verbose logging]' \
+ '--no-progress[Disable the progress bar]' \
+ '--no-summary[Don'"'"'t print a summary]' \
+ '--no-verify[Skip verifying integrity of newly downloaded packages]' \
+ '--ignore-scripts[Skip lifecycle scripts in the package.json (dependency scripts are never run)]' \
+ '--global[Add a package globally]' \
+ '-g[Add a package globally]' \
+ '--cwd[Set a specific cwd]:cwd' \
+ '--backend[Platform-specific optimizations for installing dependencies]:backend:("copyfile" "hardlink" "symlink")' \
+ '--link-native-bins[Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo]:link-native-bins' \
+ '--help[Print this help menu]' \
+ '--dev[Add dependence to "devDependencies]' \
+ '-d[Add dependence to "devDependencies]' \
+ '-D[]' \
+ '--development[]' \
+ '--optional[Add dependency to "optionalDependencies]' \
+ '--exact[Add the exact version instead of the ^range]' &&
+ ret=0
- local program=bun
- typeset -A opt_args
- local curcontext="$curcontext" state line context
+ case $state in
+ config)
+ _bun_list_bunfig_toml
- # ---- Command:
- _arguments -s \
+ ;;
+ package)
+ _bun_add_param_package_completion
+
+ ;;
+ esac
+}
+
+_bun_unlink_completion() {
+ _arguments -s -C \
+ '1: :->cmd1' \
+ '*: :->package' \
+ '--config[Load config(bunfig.toml)]: :->config' \
+ '-c[Load config(bunfig.toml)]: :->config' \
+ '--yarn[Write a yarn.lock file (yarn v1)]' \
+ '-y[Write a yarn.lock file (yarn v1)]' \
+ '--production[Don'"'"'t install devDependencies]' \
+ '-p[Don'"'"'t install devDependencies]' \
+ '--no-save[Don'"'"'t save a lockfile]' \
+ '--save[Save to package.json]' \
+ '--dry-run[Don'"'"'t install anything]' \
+ '--frozen-lockfile[Disallow changes to lockfile]' \
+ '--force[Always request the latest versions from the registry & reinstall all dependencies]' \
+ '-f[Always request the latest versions from the registry & reinstall all dependencies]' \
+ '--cache-dir[Store & load cached data from a specific directory path]:cache-dir' \
+ '--no-cache[Ignore manifest cache entirely]' \
+ '--silent[Don'"'"'t log anything]' \
+ '--verbose[Excessively verbose logging]' \
+ '--no-progress[Disable the progress bar]' \
+ '--no-summary[Don'"'"'t print a summary]' \
+ '--no-verify[Skip verifying integrity of newly downloaded packages]' \
+ '--ignore-scripts[Skip lifecycle scripts in the package.json (dependency scripts are never run)]' \
+ '--global[Add a package globally]' \
+ '-g[Add a package globally]' \
+ '--cwd[Set a specific cwd]:cwd' \
+ '--backend[Platform-specific optimizations for installing dependencies]:backend:("copyfile" "hardlink" "symlink")' \
+ '--link-native-bins[Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo]:link-native-bins' \
+ '--help[Print this help menu]' &&
+ ret=0
+
+ case $state in
+ config)
+ _bun_list_bunfig_toml
+
+ ;;
+ package)
+ # TODO: error: bun unlink {packageName} not implemented yet
+
+ ;;
+ esac
+}
+
+_bun_link_completion() {
+ _arguments -s -C \
+ '1: :->cmd1' \
+ '*: :->package' \
+ '--config[Load config(bunfig.toml)]: :->config' \
+ '-c[Load config(bunfig.toml)]: :->config' \
+ '--yarn[Write a yarn.lock file (yarn v1)]' \
+ '-y[Write a yarn.lock file (yarn v1)]' \
+ '--production[Don'"'"'t install devDependencies]' \
+ '-p[Don'"'"'t install devDependencies]' \
+ '--no-save[Don'"'"'t save a lockfile]' \
+ '--save[Save to package.json]' \
+ '--dry-run[Don'"'"'t install anything]' \
+ '--frozen-lockfile[Disallow changes to lockfile]' \
+ '--force[Always request the latest versions from the registry & reinstall all dependencies]' \
+ '-f[Always request the latest versions from the registry & reinstall all dependencies]' \
+ '--cache-dir[Store & load cached data from a specific directory path]:cache-dir' \
+ '--no-cache[Ignore manifest cache entirely]' \
+ '--silent[Don'"'"'t log anything]' \
+ '--verbose[Excessively verbose logging]' \
+ '--no-progress[Disable the progress bar]' \
+ '--no-summary[Don'"'"'t print a summary]' \
+ '--no-verify[Skip verifying integrity of newly downloaded packages]' \
+ '--ignore-scripts[Skip lifecycle scripts in the package.json (dependency scripts are never run)]' \
+ '--global[Add a package globally]' \
+ '-g[Add a package globally]' \
+ '--cwd[Set a specific cwd]:cwd' \
+ '--backend[Platform-specific optimizations for installing dependencies]:backend:("copyfile" "hardlink" "symlink")' \
+ '--link-native-bins[Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo]:link-native-bins' \
+ '--help[Print this help menu]' &&
+ ret=0
+
+ case $state in
+ config)
+ _bun_list_bunfig_toml
+
+ ;;
+ package)
+ _bun_link_param_package_completion
+
+ ;;
+ esac
+}
+
+_bun_bun_completion() {
+ _arguments -s -C \
+ '1: :->cmd' \
+ '*: :->file' \
+ '--version[Show version and exit]' \
+ '-V[Show version and exit]' \
+ '--cwd[Change directory]:cwd' \
+ '--help[Show command help]' \
+ '-h[Show command help]' \
+ '--use[Use a framework, e.g. "next"]:use' &&
+ ret=0
+
+ case $state in
+ file)
+ _files
+
+ ;;
+ esac
+}
+
+_bun_init_completion() {
+ _arguments -s -C \
'1: :->cmd' \
+ '-y[Answer yes to all prompts]:' \
+ '--yes[Answer yes to all prompts]:' &&
+ ret=0
+
+}
+
+_bun_create_completion() {
+ _arguments -s -C \
+ '1: :->cmd' \
+ '2: :->cmd2' \
'*: :->args' &&
ret=0
case $state in
- cmd)
- local -a scripts_list
- IFS=$'\n' scripts_list=($(SHELL=zsh bun getcompletes i))
- scripts="scripts:scripts:(($scripts_list))"
- IFS=$'\n' files_list=($(SHELL=zsh bun getcompletes j))
+ cmd2)
+ _alternative 'args:create:((next-app\:"Next.js app" react-app\:"React app"))'
- main_commands=('add\:"Add a dependency to package.json" bun\:"Generate a bundle" create\:"Create a new project" dev\:"Start a dev server" help\:"Show command help" install\:"Install packages from package.json" x\:"Run a command from a local or remote NPM package" pm\:"Manage local packages" remove\:"Remove a dependency from package.json" run\:"Run a script or package bin" upgrade\:"Upgrade to the latest version of bun"')
- main_commands=($main_commands)
- _alternative "$scripts" "args:command:(($main_commands))" "files:files:(($files_list))"
;;
args)
- case $line[1] in
- add)
+ case $line[2] in
+ next)
+ pmargs=(
+ '1: :->cmd'
+ '2: :->cmd2'
+ '3: :->file'
+ '--force[Overwrite existing files]'
+ '--no-install[Don'"'"'t install node_modules]'
+ '--no-git[Don'"'"'t create a git repository]'
+ '--verbose[verbose]'
+ '--no-package-json[Disable package.json transforms]'
+ '--open[On finish, start bun & open in-browser]'
+ )
- # ---- Command: add
+ # ---- Command: create next
_arguments -s -C \
- '1: :->cmd1' \
- '*: :->package' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--registry[Change default registry (default: \$BUN_CONFIG_REGISTRY || \$npm_config_registry)]:registry' \
- '--token[Authentication token used for npm registry requests (default: \$npm_config_token)]:token' \
- '-y[Write a yarn.lock file (yarn v1)]' \
- '--yarn[Write a yarn.lock file (yarn v1)]' \
- '-g[Add a package globally]' \
- '--global[Add a package globally]' \
- '--production[Don'"'"'t install devDependencies]' \
- '--frozen-lockfile[Disallow changes to lockfile]' \
- '--optional[Add dependency to optionalDependencies]' \
- '--dev[Add dependency to devDependencies]' \
- '-d[Add dependency to devDependencies]' \
- '-p[Don'"'"'t install devDependencies]' \
- '--no-save[]' \
- '--dry-run[Don'"'"'t install anything]' \
- '--force[Always request the latest versions from the registry & reinstall all dependenices]' \
- '--lockfile[Store & load a lockfile at a specific filepath]:lockfile' \
- '--cache-dir[Store & load cached data from a specific directory path]:cache-dir' \
- '--no-cache[Ignore manifest cache entirely]' \
- '--silent[Don'"'"'t output anything]' \
- '--verbose[Excessively verbose logging]' \
- '--cwd[Set a specific cwd]:cwd' \
- '--backend[Platform-specific optimizations for installing dependencies]:backend:("clonefile" "copyfile" "hardlink" "clonefile_each_dir", "symlink")' \
- '--link-native-bins[Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo]:link-native-bins' &&
+ $pmargs &&
ret=0
case $state in
- package)
- _bun_add_param_package_completion
+ file)
+ _files
+
;;
esac
;;
- unlink)
+ react)
- # ---- Command: unlink
+ # ---- Command: create react
_arguments -s -C \
- '1: :->cmd1' \
- '*: :->package' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--registry[Change default registry (default: \$BUN_CONFIG_REGISTRY || \$npm_config_registry)]:registry' \
- '--token[Authentication token used for npm registry requests (default: \$npm_config_token)]:token' \
- '-y[Write a yarn.lock file (yarn v1)]' \
- '--yarn[Write a yarn.lock file (yarn v1)]' \
- '--global[Add a package globally]' \
- '--production[Don'"'"'t install devDependencies]' \
- '--frozen-lockfile[Disallow changes to lockfile]' \
- '--optional[Add dependency to optionalDependencies]' \
- '--dev[Add dependency to devDependencies]' \
- '-d[Add dependency to devDependencies]' \
- '-p[Don'"'"'t install devDependencies]' \
- '--no-save[]' \
- '--dry-run[Don'"'"'t install anything]' \
- '--force[Always request the latest versions from the registry & reinstall all dependenices]' \
- '--lockfile[Store & load a lockfile at a specific filepath]:lockfile' \
- '--cache-dir[Store & load cached data from a specific directory path]:cache-dir' \
- '--no-cache[Ignore manifest cache entirely]' \
- '--silent[Don'"'"'t output anything]' \
- '--verbose[Excessively verbose logging]' \
- '--cwd[Set a specific cwd]:cwd' \
- '--backend[Platform-specific optimizations for installing dependencies]:backend:("clonefile" "copyfile" "hardlink" "clonefile_each_dir", "symlink")' \
- '--link-native-bins[Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo]:link-native-bins' &&
+ $pmargs &&
ret=0
- ;;
- link)
+ case $state in
+ file)
+ _files
- # ---- Command: unlink
- _arguments -s -C \
- '1: :->cmd1' \
- '*: :->package' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--registry[Change default registry (default: \$BUN_CONFIG_REGISTRY || \$npm_config_registry)]:registry' \
- '--token[Authentication token used for npm registry requests (default: \$npm_config_token)]:token' \
- '-y[Write a yarn.lock file (yarn v1)]' \
- '--yarn[Write a yarn.lock file (yarn v1)]' \
- '--global[Add a package globally]' \
- '--production[Don'"'"'t install devDependencies]' \
- '--frozen-lockfile[Disallow changes to lockfile]' \
- '--optional[Add dependency to optionalDependencies]' \
- '--dev[Add dependency to devDependencies]' \
- '-d[Add dependency to devDependencies]' \
- '-p[Don'"'"'t install devDependencies]' \
- '--no-save[]' \
- '--dry-run[Don'"'"'t install anything]' \
- '--force[Always request the latest versions from the registry & reinstall all dependenices]' \
- '--lockfile[Store & load a lockfile at a specific filepath]:lockfile' \
- '--cache-dir[Store & load cached data from a specific directory path]:cache-dir' \
- '--no-cache[Ignore manifest cache entirely]' \
- '--silent[Don'"'"'t output anything]' \
- '--verbose[Excessively verbose logging]' \
- '--cwd[Set a specific cwd]:cwd' \
- '--backend[Platform-specific optimizations for installing dependencies]:backend:("clonefile" "copyfile" "hardlink" "clonefile_each_dir", "symlink")' \
- '--link-native-bins[Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo]:link-native-bins' &&
- ret=0
+ ;;
+ esac
;;
+ *)
- bun)
-
- # ---- Command: bun
+ # ---- Command: create from other template
_arguments -s -C \
- '1: :->cmd' \
- '*: :->file' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--use[Use a framework, e.g. "next"]:use' &&
+ $pmargs &&
ret=0
case $state in
file)
_files
+
;;
esac
;;
- init)
- # ---- Command: init
+ esac
+
+ ;;
+
+ esac
+}
+
+_bun_pm_completion() {
+ _arguments -s -C \
+ '1: :->cmd' \
+ '2: :->cmd2' \
+ '*: :->args' &&
+ ret=0
+
+ case $state in
+ cmd2)
+ sub_commands=(
+ 'bin\:"print the path to bin folder" '
+ 'ls\:"list the dependency tree according to the current lockfile" '
+ 'hash\:"generate & print the hash of the current lockfile" '
+ 'hash-string\:"print the string used to hash the lockfile" '
+ 'hash-print\:"print the hash stored in the current lockfile" '
+ 'cache\:"print the path to the cache folder" '
+ )
+
+ _alternative "args:cmd3:(($sub_commands))"
+
+ ;;
+ args)
+ case $line[2] in
+ cache)
_arguments -s -C \
'1: :->cmd' \
- '-y[Answer yes to all prompts]' \
- '--yes[Answer yes to all prompts]' &&
+ '2: :->cmd2' \
+ ':::(rm)' &&
ret=0
;;
- create)
+ bin)
+ pmargs=(
+ "-g[print the global path to bin folder]"
+ )
- # ---- Command: create
_arguments -s -C \
'1: :->cmd' \
'2: :->cmd2' \
- '*: :->args' &&
+ $pmargs &&
ret=0
- case $state in
- cmd2)
- _alternative 'args:create:((next\:"Next.js app" react\:"React app"))'
- ;;
+ ;;
+ ls)
+ pmargs=(
+ "--all[list the entire dependency tree according to the current lockfile]"
+ )
- args)
- case $line[2] in
- next)
+ _arguments -s -C \
+ '1: :->cmd' \
+ '2: :->cmd2' \
+ $pmargs &&
+ ret=0
- # ---- Command: create next
- _arguments -s -C \
- '1: :->cmd' \
- '2: :->cmd2' \
- '3: :->file' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-h[Show command help]' &&
- ret=0
+ ;;
+ esac
- case $state in
- file)
- _files
- ;;
- esac
+ ;;
+ esac
+}
- ;;
- react)
+_bun_install_completion() {
+ _arguments -s -C \
+ '1: :->cmd1' \
+ '--config[Load config(bunfig.toml)]: :->config' \
+ '-c[Load config(bunfig.toml)]: :->config' \
+ '--yarn[Write a yarn.lock file (yarn v1)]' \
+ '-y[Write a yarn.lock file (yarn v1)]' \
+ '--production[Don'"'"'t install devDependencies]' \
+ '-p[Don'"'"'t install devDependencies]' \
+ '--no-save[Don'"'"'t save a lockfile]' \
+ '--save[Save to package.json]' \
+ '--dry-run[Don'"'"'t install anything]' \
+ '--frozen-lockfile[Disallow changes to lockfile]' \
+ '--force[Always request the latest versions from the registry & reinstall all dependencies]' \
+ '-f[Always request the latest versions from the registry & reinstall all dependencies]' \
+ '--cache-dir[Store & load cached data from a specific directory path]:cache-dir' \
+ '--no-cache[Ignore manifest cache entirely]' \
+ '--silent[Don'"'"'t log anything]' \
+ '--verbose[Excessively verbose logging]' \
+ '--no-progress[Disable the progress bar]' \
+ '--no-summary[Don'"'"'t print a summary]' \
+ '--no-verify[Skip verifying integrity of newly downloaded packages]' \
+ '--ignore-scripts[Skip lifecycle scripts in the package.json (dependency scripts are never run)]' \
+ '--global[Add a package globally]' \
+ '-g[Add a package globally]' \
+ '--cwd[Set a specific cwd]:cwd' \
+ '--backend[Platform-specific optimizations for installing dependencies]:backend:("copyfile" "hardlink" "symlink")' \
+ '--link-native-bins[Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo]:link-native-bins' \
+ '--help[Print this help menu]' \
+ '--dev[Add dependence to "devDependencies]' \
+ '-d[Add dependence to "devDependencies]' \
+ '--development[]' \
+ '-D[]' \
+ '--optional[Add dependency to "optionalDependencies]' \
+ '--exact[Add the exact version instead of the ^range]' &&
+ ret=0
- # ---- Command: create react
- _arguments -s -C \
- '1: :->cmd' \
- '2: :->cmd2' \
- '3: :->file' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-h[Show command help]' &&
- ret=0
+ case $state in
+ config)
+ _bun_list_bunfig_toml
- case $state in
- file)
- _files
- ;;
- esac
+ ;;
+ esac
+}
- ;;
- esac
+_bun_remove_completion() {
+ _arguments -s -C \
+ '1: :->cmd1' \
+ '*: :->package' \
+ '--config[Load config(bunfig.toml)]: :->config' \
+ '-c[Load config(bunfig.toml)]: :->config' \
+ '--yarn[Write a yarn.lock file (yarn v1)]' \
+ '-y[Write a yarn.lock file (yarn v1)]' \
+ '--production[Don'"'"'t install devDependencies]' \
+ '-p[Don'"'"'t install devDependencies]' \
+ '--no-save[Don'"'"'t save a lockfile]' \
+ '--save[Save to package.json]' \
+ '--dry-run[Don'"'"'t install anything]' \
+ '--frozen-lockfile[Disallow changes to lockfile]' \
+ '--force[Always request the latest versions from the registry & reinstall all dependencies]' \
+ '-f[Always request the latest versions from the registry & reinstall all dependencies]' \
+ '--cache-dir[Store & load cached data from a specific directory path]:cache-dir' \
+ '--no-cache[Ignore manifest cache entirely]' \
+ '--silent[Don'"'"'t log anything]' \
+ '--verbose[Excessively verbose logging]' \
+ '--no-progress[Disable the progress bar]' \
+ '--no-summary[Don'"'"'t print a summary]' \
+ '--no-verify[Skip verifying integrity of newly downloaded packages]' \
+ '--ignore-scripts[Skip lifecycle scripts in the package.json (dependency scripts are never run)]' \
+ '--global[Add a package globally]' \
+ '-g[Add a package globally]' \
+ '--cwd[Set a specific cwd]:cwd' \
+ '--backend[Platform-specific optimizations for installing dependencies]:backend:("copyfile" "hardlink" "symlink")' \
+ '--link-native-bins[Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo]:link-native-bins' \
+ '--help[Print this help menu]' &&
+ ret=0
- ;;
+ case $state in
+ config)
+ _bun_list_bunfig_toml
+
+ ;;
+ package)
+ _bun_remove_param_package_completion
+
+ ;;
+ esac
+}
+
+_bun_run_completion() {
+ _arguments -s -C \
+ '1: :->cmd' \
+ '2: :->script' \
+ '*: :->other' \
+ '--help[Display this help and exit]' \
+ '-h[Display this help and exit]' \
+ '--bun[Force a script or package to use Bun'"'"'s runtime instead of Node.js (via symlinking node)]' \
+ '-b[Force a script or package to use Bun'"'"'s runtime instead of Node.js (via symlinking node)]' \
+ '--cwd[Absolute path to resolve files & entry points from. This just changes the process cwd]:cwd' \
+ '--config[Config file to load bun from (e.g. -c bunfig.toml]: :->config' \
+ '-c[Config file to load bun from (e.g. -c bunfig.toml]: :->config' \
+ '--extension-order[Defaults to: .tsx,.ts,.jsx,.js,.json]:extension-order' \
+ '--jsx-factory[Changes the function called when compiling JSX elements using the classic JSX runtime]:jsx-factory' \
+ '--jsx-fragment[Changes the function called when compiling JSX fragments]:jsx-fragment' \
+ '--jsx-import-source[Declares the module specifier to be used for importing the jsx and jsxs factory functions. Default: "react"]:jsx-import-source' \
+ '--jsx-runtime["automatic" (default) or "classic"]: :->jsx-runtime' \
+ '--preload[Import a module before other modules are loaded]:preload' \
+ '-r[Import a module before other modules are loaded]:preload' \
+ '--main-fields[Main fields to lookup in package.json. Defaults to --target dependent]:main-fields' \
+ '--no-summary[Don'"'"'t print a summary]' \
+ '--version[Print version and exit]' \
+ '-v[Print version and exit]' \
+ '--revision[Print version with revision and exit]' \
+ '--tsconfig-override[Load tsconfig from path instead of cwd/tsconfig.json]:tsconfig-override' \
+ '--define[Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:"development". Values are parsed as JSON.]:define' \
+ '-d[Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:"development". Values are parsed as JSON.]:define' \
+ '--external[Exclude module from transpilation (can use * wildcards). ex: -e react]:external' \
+ '-e[Exclude module from transpilation (can use * wildcards). ex: -e react]:external' \
+ '--loader[Parse files with .ext:loader, e.g. --loader .js:jsx. Valid loaders: js, jsx, ts, tsx, json, toml, text, file, wasm, napi]:loader' \
+ '-l[Parse files with .ext:loader, e.g. --loader .js:jsx. Valid loaders: js, jsx, ts, tsx, json, toml, text, file, wasm, napi]:loader' \
+ '--origin[Rewrite import URLs to start with --origin. Default: ""]:origin' \
+ '-u[Rewrite import URLs to start with --origin. Default: ""]:origin' \
+ '--port[Port to serve bun'"'"'s dev server on. Default: '"'"'3000'"'"']:port' \
+ '-p[Port to serve bun'"'"'s dev server on. Default: '"'"'3000'"'"']:port' \
+ '--smol[Use less memory, but run garbage collection more often]' \
+ '--minify[Minify (experimental)]' \
+ '--minify-syntax[Minify syntax and inline data (experimental)]' \
+ '--minify-whitespace[Minify Whitespace (experimental)]' \
+ '--minify-identifiers[Minify identifiers]' \
+ '--no-macros[Disable macros from being executed in the bundler, transpiler and runtime]' \
+ '--target[The intended execution environment for the bundle. "browser", "bun" or "node"]: :->target' \
+ '--inspect[Activate Bun'"'"'s Debugger]:inspect' \
+ '--inspect-wait[Activate Bun'"'"'s Debugger, wait for a connection before executing]:inspect-wait' \
+ '--inspect-brk[Activate Bun'"'"'s Debugger, set breakpoint on first line of code and wait]:inspect-brk' \
+ '--hot[Enable auto reload in bun'"'"'s JavaScript runtime]' \
+ '--watch[Automatically restart bun'"'"'s JavaScript runtime on file change]' \
+ '--no-install[Disable auto install in bun'"'"'s JavaScript runtime]' \
+ '--install[Install dependencies automatically when no node_modules are present, default: "auto". "force" to ignore node_modules, fallback to install any missing]: :->install_' \
+ '-i[Automatically install dependencies and use global cache in bun'"'"'s runtime, equivalent to --install=fallback'] \
+ '--prefer-offline[Skip staleness checks for packages in bun'"'"'s JavaScript runtime and resolve from disk]' \
+ '--prefer-latest[Use the latest matching versions of packages in bun'"'"'s JavaScript runtime, always checking npm]' \
+ '--silent[Don'"'"'t repeat the command for bun run]' \
+ '--dump-environment-variables[Dump environment variables from .env and process as JSON and quit. Useful for debugging]' \
+ '--dump-limits[Dump system limits. Userful for debugging]' &&
+ ret=0
+
+ case $state in
+ script)
+ curcontext="${curcontext%:*:*}:bun-grouped"
+ _bun_run_param_script_completion
+
+ ;;
+ jsx-runtime)
+ _alternative 'args:cmd3:((classic automatic))'
+
+ ;;
+ target)
+ _alternative 'args:cmd3:((browser bun node))'
+
+ ;;
+ install_)
+ _alternative 'args:cmd3:((auto force fallback))'
+
+ ;;
+ other)
+ _files
+
+ ;;
+ esac
+
+}
+
+_bun_upgrade_completion() {
+ _arguments -s -C \
+ '1: :->cmd' \
+ '--canary[Upgrade to canary build]' &&
+ ret=0
+
+}
+
+_bun_build_completion() {
+ _arguments -s -C \
+ '1: :->cmd' \
+ '*: :->file' \
+ '--outfile[Write the output to a specific file (default: stdout)]:outfile' \
+ '--outdir[Write the output to a directory (required for splitting)]:outdir' \
+ '--minify[Enable all minification flags]' \
+ '--minify-whitespace[Remove unneeded whitespace]' \
+ '--minify-syntax[Transform code to use less syntax]' \
+ '--minify-identifiers[Shorten variable names]' \
+ '--sourcemap[Generate sourcemaps]: :->sourcemap' \
+ '--target[The intended execution environment for the bundle. "browser", "bun" or "node"]: :->target' \
+ '--splitting[Whether to enable code splitting (requires --outdir)]' \
+ '--compile[generating a standalone binary from a TypeScript or JavaScript file]' \
+ '--format[Specifies the module format to be used in the generated bundles]: :->format' &&
+ ret=0
+
+ case $state in
+ file)
+ _files
+
+ ;;
+ target)
+ _alternative 'args:cmd3:((browser bun node))'
+
+ ;;
+ sourcemap)
+ _alternative 'args:cmd3:((none external inline))'
+
+ ;;
+ format)
+
+ _alternative 'args:cmd3:((esm cjs iife))'
+ ;;
+ esac
+}
+
+_bun_update_completion() {
+ _arguments -s -C \
+ '1: :->cmd1' \
+ '-c[Load config(bunfig.toml)]: :->config' \
+ '--config[Load config(bunfig.toml)]: :->config' \
+ '-y[Write a yarn.lock file (yarn v1)]' \
+ '--yarn[Write a yarn.lock file (yarn v1)]' \
+ '-p[Don'"'"'t install devDependencies]' \
+ '--production[Don'"'"'t install devDependencies]' \
+ '--no-save[Don'"'"'t save a lockfile]' \
+ '--save[Save to package.json]' \
+ '--dry-run[Don'"'"'t install anything]' \
+ '--frozen-lockfile[Disallow changes to lockfile]' \
+ '-f[Always request the latest versions from the registry & reinstall all dependencies]' \
+ '--force[Always request the latest versions from the registry & reinstall all dependencies]' \
+ '--cache-dir[Store & load cached data from a specific directory path]:cache-dir' \
+ '--no-cache[Ignore manifest cache entirely]' \
+ '--silent[Don'"'"'t log anything]' \
+ '--verbose[Excessively verbose logging]' \
+ '--no-progress[Disable the progress bar]' \
+ '--no-summary[Don'"'"'t print a summary]' \
+ '--no-verify[Skip verifying integrity of newly downloaded packages]' \
+ '--ignore-scripts[Skip lifecycle scripts in the package.json (dependency scripts are never run)]' \
+ '-g[Add a package globally]' \
+ '--global[Add a package globally]' \
+ '--cwd[Set a specific cwd]:cwd' \
+ '--backend[Platform-specific optimizations for installing dependencies]:backend:("copyfile" "hardlink" "symlink")' \
+ '--link-native-bins[Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo]:link-native-bins' \
+ '--help[Print this help menu]' &&
+ ret=0
+
+ case $state in
+ config)
+ _bun_list_bunfig_toml
+
+ ;;
+ esac
+}
+
+_bun_test_completion() {
+ _arguments -s -C \
+ '1: :->cmd1' \
+ '*: :->file' \
+ '-h[Display this help and exit]' \
+ '--help[Display this help and exit]' \
+ '-b[Force a script or package to use Bun.js instead of Node.js (via symlinking node)]' \
+ '--bun[Force a script or package to use Bun.js instead of Node.js (via symlinking node)]' \
+ '--cwd[Set a specific cwd]:cwd' \
+ '-c[Load config(bunfig.toml)]: :->config' \
+ '--config[Load config(bunfig.toml)]: :->config' \
+ '--extension-order[Defaults to: .tsx,.ts,.jsx,.js,.json]:extension-order' \
+ '--jsx-factory[Changes the function called when compiling JSX elements using the classic JSX runtime]:jsx-factory' \
+ '--jsx-fragment[Changes the function called when compiling JSX fragments]:jsx-fragment' \
+ '--jsx-import-source[Declares the module specifier to be used for importing the jsx and jsxs factory functions. Default: "react"]:jsx-import-source' \
+ '--jsx-runtime["automatic" (default) or "classic"]: :->jsx-runtime' \
+ '--preload[Import a module before other modules are loaded]:preload' \
+ '-r[Import a module before other modules are loaded]:preload' \
+ '--main-fields[Main fields to lookup in package.json. Defaults to --target dependent]:main-fields' \
+ '--no-summary[Don'"'"'t print a summary]' \
+ '--version[Print version and exit]' \
+ '-v[Print version and exit]' \
+ '--revision[Print version with revision and exit]' \
+ '--tsconfig-override[Load tsconfig from path instead of cwd/tsconfig.json]:tsconfig-override' \
+ '--define[Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:"development". Values are parsed as JSON.]:define' \
+ '-d[Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:"development". Values are parsed as JSON.]:define' \
+ '--external[Exclude module from transpilation (can use * wildcards). ex: -e react]:external' \
+ '-e[Exclude module from transpilation (can use * wildcards). ex: -e react]:external' \
+ '--loader[Parse files with .ext:loader, e.g. --loader .js:jsx. Valid loaders: js, jsx, ts, tsx, json, toml, text, file, wasm, napi]:loader' \
+ '-l[Parse files with .ext:loader, e.g. --loader .js:jsx. Valid loaders: js, jsx, ts, tsx, json, toml, text, file, wasm, napi]:loader' \
+ '--origin[Rewrite import URLs to start with --origin. Default: ""]:origin' \
+ '-u[Rewrite import URLs to start with --origin. Default: ""]:origin' \
+ '--port[Port to serve bun'"'"'s dev server on. Default: '"'"'3000'"'"']:port' \
+ '-p[Port to serve bun'"'"'s dev server on. Default: '"'"'3000'"'"']:port' \
+ '--smol[Use less memory, but run garbage collection more often]' \
+ '--minify[Minify (experimental)]' \
+ '--minify-syntax[Minify syntax and inline data (experimental)]' \
+ '--minify-identifiers[Minify identifiers]' \
+ '--no-macros[Disable macros from being executed in the bundler, transpiler and runtime]' \
+ '--target[The intended execution environment for the bundle. "browser", "bun" or "node"]: :->target' \
+ '--inspect[Activate Bun'"'"'s Debugger]:inspect' \
+ '--inspect-wait[Activate Bun'"'"'s Debugger, wait for a connection before executing]:inspect-wait' \
+ '--inspect-brk[Activate Bun'"'"'s Debugger, set breakpoint on first line of code and wait]:inspect-brk' \
+ '--watch[Automatically restart bun'"'"'s JavaScript runtime on file change]' \
+ '--timeout[Set the per-test timeout in milliseconds, default is 5000.]:timeout' \
+ '--update-snapshots[Update snapshot files]' \
+ '--rerun-each[Re-run each test file <NUMBER> times, helps catch certain bugs]:rerun' \
+ '--only[Only run tests that are marked with "test.only()"]' \
+ '--todo[Include tests that are marked with "test.todo()"]' \
+ '--coverage[Generate a coverage profile]' \
+ '--bail[Exit the test suite after <NUMBER> failures. If you do not specify a number, it defaults to 1.]:bail' \
+ '--test-name-pattern[Run only tests with a name that matches the given regex]:pattern' \
+ '-t[Run only tests with a name that matches the given regex]:pattern' &&
+ ret=0
+
+ case $state in
+ file)
+ _bun_test_param_script_completion
+
+ ;;
+ config)
+ _files
+
+ ;;
+
+ esac
+
+}
+
+_bun() {
+ zstyle ':completion:*:*:bun:*' group-name ''
+ zstyle ':completion:*:*:bun-grouped:*' group-name ''
+
+ zstyle ':completion:*:*:bun::descriptions' format '%F{green}-- %d --%f'
+ zstyle ':completion:*:*:bun-grouped:*' format '%F{green}-- %d --%f'
+ # zstyle ':completion:*:options' list-colors '=^(-- *)=34'
+
+ local program=bun
+ typeset -A opt_args
+ local curcontext="$curcontext" state line context
+
+ # ---- Command:
+ _arguments -s \
+ '1: :->cmd' \
+ '*: :->args' &&
+ ret=0
+
+ case $state in
+ cmd)
+ local -a scripts_list
+ IFS=$'\n' scripts_list=($(SHELL=zsh bun getcompletes i))
+ scripts="scripts:scripts:(($scripts_list))"
+ IFS=$'\n' files_list=($(SHELL=zsh bun getcompletes j))
+
+ main_commands=(
+ 'run\:"Run JavaScript with Bun, a package.json script, or a bin" '
+ 'test\:"Run unit tests with Bun" '
+ 'x\:"Install and execute a package bin (bunx)" '
+ 'repl\:"Start a REPL session with Bun" '
+ 'init\:"Start an empty Bun project from a blank template" '
+ 'create\:"Create a new project from a template (bun c)" '
+ 'install\:"Install dependencies for a package.json (bun i)" '
+ 'add\:"Add a dependency to package.json (bun a)" '
+ 'remove\:"Remove a dependency from package.json (bun rm)" '
+ 'update\:"Update outdated dependencies & save to package.json" '
+ 'link\:"Link an npm package globally" '
+ 'unlink\:"Globally unlink an npm package" '
+ 'pm\:"More commands for managing packages" '
+ 'build\:"Bundle TypeScript & JavaScript into a single file" '
+ 'upgrade\:"Get the latest version of bun" '
+ 'help\:"Show all supported flags and commands" '
+ )
+ main_commands=($main_commands)
+ _alternative "$scripts" "args:command:(($main_commands))" "files:files:(($files_list))"
+
+ ;;
+ args)
+ case $line[1] in
+ add|a)
+ _bun_add_completion
- esac
;;
- dev)
+ unlink)
+ _bun_unlink_completion
- # ---- Command: dev
- _arguments -s -C \
- '1: :->cmd' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--bunfile[Use a specific .bun file (default: node_modules.bun)]:bunfile' \
- '--origin[Rewrite import paths to start from a different url. Default: http://localhost:3000]:origin' \
- '-u[Rewrite import paths to start from a different url. Default: http://localhost:3000]:u' \
- '--server-bunfile[Use a specific .bun file for SSR in bun dev (default: node_modules.server.bun)]:server-bunfile' \
- '--extension-order[defaults to: .tsx,.ts,.jsx,.js,.json]:extension-order' \
- '--jsx-runtime[JSX runtime to use. Defaults to "automatic"]:jsx-runtime:("automatic" "classic")' \
- '--main-fields[Main fields to lookup in package.json. Defaults to --platform dependent]:main-fields' \
- '--disable-react-fast-refresh[Disable React Fast Refresh]' \
- '--disable-hmr[Disable Hot Module Reloading]' \
- '--jsx-factory[Changes the function called when compiling JSX elements using the classic JSX runtime]:jsx-factory' \
- '--jsx-fragment[Changes the function called when compiling JSX fragments]:jsx-fragment' \
- '--jsx-import-source[Declares the module specifier to be used for importing the jsx and jsxs factory functions. Default: "react"]:jsx-import-source' \
- '--port[Port number]:port' &&
- ret=0
+ ;;
+ link)
+ _bun_link_completion
;;
+ bun)
+ _bun_bun_completion
- x)
- _arguments -s -C \
- '1: :->cmd' \
- '2: :->cmd2' \
- '*: :->args' &&
- ret=0
;;
- pm)
+ init)
+ _bun_init_completion
- pmargs=('-c[Load config (bunfig.toml)]'
- '--config[Load config (bunfig.toml)]'
- '-y[Write a yarn.lock file (yarn v1)]'
- '--yarn[Write a yarn.lock file (yarn v1)]'
- '-p[Do not install devDependencies]'
- '--production[Do not install devDependencies]'
- '--frozen-lockfile[Disallow changes to lockfile]' \
- '--no-save[Do not save a lockfile]'
- '--dry-run[Do not install anything]'
- '--lockfile[Store & load a lockfile at a specific filepath]'
- '-f[Always request the latest versions from the registry & reinstall all dependencies]'
- '--force[Always request the latest versions from the registry & reinstall all dependencies]'
- '--cache-dir[Store & load cached data from a specific directory path]'
- '--no-cache[Ignore manifest cache entirely]'
- '--silent[Do not log anything]'
- '--verbose[Excessively verbose logging]'
- '--no-progress[Disable the progress bar]'
- '--no-summary[Do not print a summary]'
- '--no-verify[Skip verifying integrity of newly downloaded packages]'
- '--ignore-scripts[Skip lifecycle scripts in the package.json (dependency scripts are never run)]'
- '-g[Install globally]'
- '--global[Install globally]'
- '--cwd[Set a specific cwd]'
- '--backend[Platform-specific optimizations for installing dependencies. Possible values: "clonefile" (default), "hardlink", "symlink", "copyfile"]'
- '--link-native-bins[Link "bin" from a matching platform-specific "optionalDependencies" instead. Default: esbuild, turbo]'
- '--help[Print this help menu]'
- )
+ ;;
+ create|c)
+ _bun_create_completion
- # ---- Command: help
+ ;;
+ x)
_arguments -s -C \
'1: :->cmd' \
'2: :->cmd2' \
'*: :->args' &&
ret=0
+ ;;
+ pm)
+ _bun_pm_completion
- case $state in
- cmd2)
- _alternative 'args:cmd3:((bin ls cache hash hash-print hash-string))'
- ;;
+ ;;
+ install|i)
+ _bun_install_completion
- args)
+ ;;
+ remove|rm)
+ _bun_remove_completion
- case $line[2] in
- cache)
+ ;;
+ run)
+ _bun_run_completion
- _arguments -s -C \
- '1: :->cmd' \
- '2: :->cmd2' \
- ':::(rm)' \
- $pmargs &&
- ret=0
- ;;
- *)
+ ;;
+ upgrade)
+ _bun_upgrade_completion
- _arguments -s -C \
- '1: :->cmd' \
- '2: :->cmd2' \
- $pmargs &&
- ret=0
- ;;
- esac
- ;;
+ ;;
+ build)
+ _bun_build_completion
- esac
;;
+ update)
+ _bun_update_completion
- \
- \
- help)
+ ;;
+ 'test')
+ _bun_test_completion
+ ;;
+ help)
# ---- Command: help
_arguments -s -C \
'1: :->cmd' \
@@ -354,300 +752,133 @@ _bun() {
case $state in
cmd2)
- _alternative 'args:cmd3:((bun create dev run upgrade))'
- ;;
+ curcontext="${curcontext%:*:*}:bun-grouped"
+ _alternative "args:command:(($main_commands))"
+ ;;
args)
case $line[2] in
- bun)
-
- # ---- Command: help bun
- _arguments -s -C \
- '1: :->cmd' \
- '2: :->cmd2' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--all[]' &&
- ret=0
+ add)
+ _bun_add_completion
;;
- install)
-
- # ---- Command: help install
- _arguments -s -C \
- '1: :->cmd1' \
- '2: :->cmd2' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-g[Add a package globally]' \
- '--global[Add a package globally]' \
- '-h[Show command help]' \
- '--all[]' &&
- ret=0
+ unlink)
+ _bun_unlink_completion
;;
+ link)
+ _bun_link_completion
- remove)
-
- # ---- Command: help remove
- _arguments -s -C \
- '1: :->cmd1' \
- '2: :->cmd2' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '-g[Remove a package globally]' \
- '--global[Remove a package globally]' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--all[]' &&
- ret=0
+ ;;
+ bun)
+ _bun_bun_completion
;;
+ init)
+ _bun_init_completion
+ ;;
create)
+ _bun_create_completion
- # ---- Command: help create
+ ;;
+ x)
_arguments -s -C \
'1: :->cmd' \
'2: :->cmd2' \
- '3: :->cmd3' \
'*: :->args' &&
ret=0
-
- case $state in
- cmd3)
- _alternative 'args:create:((next react))'
- ;;
-
- args)
- case $line[3] in
- next)
-
- # ---- Command: help create next
- _arguments -s -C \
- '1: :->cmd' \
- '2: :->cmd2' \
- '3: :->cmd3' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--all[]' &&
- ret=0
-
- ;;
-
- react)
-
- # ---- Command: help create react
- _arguments -s -C \
- '1: :->cmd' \
- '2: :->cmd2' \
- '3: :->cmd3' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--all[]' &&
- ret=0
-
- ;;
-
- esac
-
- ;;
-
- esac
;;
- dev)
+ pm)
+ _bun_pm_completion
- # ---- Command: help dev
- _arguments -s -C \
- '1: :->cmd' \
- '2: :->cmd2' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--all[]' &&
- ret=0
+ ;;
+ install)
+ _bun_install_completion
;;
+ remove)
+ _bun_remove_completion
+ ;;
run)
- # ---- Command: help run
- _arguments -s -C \
- '1: :->cmd' \
- '2: :->cmd2' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--hot[Enable hot reloading]' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--all[]' &&
- ret=0
+ _bun_run_completion
;;
-
upgrade)
-
- # ---- Command: help upgrade
- _arguments -s -C \
- '1: :->cmd' \
- '2: :->cmd2' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--all[]' &&
- ret=0
+ _bun_upgrade_completion
;;
+ build)
+ _bun_build_completion
- esac
-
- ;;
-
- esac
- ;;
- install)
-
- # ---- Command: install
- _arguments -s -C \
- '1: :->cmd1' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--registry[Change default registry (default: \$BUN_CONFIG_REGISTRY || \$npm_config_registry)]:registry' \
- '--token[Authentication token used for npm registry requests (default: \$npm_config_token)]:token' \
- '-y[Write a yarn.lock file (yarn v1)]' \
- '--yarn[Write a yarn.lock file (yarn v1)]' \
- '--production[Don'"'"'t install devDependencies]' \
- '-p[Don'"'"'t install devDependencies]' \
- '--frozen-lockfile[Disallow changes to lockfile]' \
- '--no-save[]' \
- '--dry-run[Don'"'"'t install anything]' \
- '--force[Always request the latest versions from the registry & reinstall all dependenices]' \
- '--lockfile[Store & load a lockfile at a specific filepath]:lockfile' \
- '--cache-dir[Store & load cached data from a specific directory path]:cache-dir' \
- '--no-cache[Ignore manifest cache entirely]' \
- '--silent[Don'"'"'t output anything]' \
- '--verbose[Excessively verbose logging]' \
- '--cwd[Set a specific cwd]:cwd' \
- '-g[Add a package globally]' \
- '--global[Add a package globally]' \
- '--backend[Platform-specific optimizations for installing dependencies]:backend:("clonefile" "copyfile" "hardlink" "clonefile_each_dir", "symlink")' \
- '--link-native-bins[Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo]:link-native-bins' &&
- ret=0
-
- ;;
-
- remove)
-
- # ---- Command: remove
- _arguments -s -C \
- '1: :->cmd1' \
- '*: :->package' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--registry[Change default registry (default: \$BUN_CONFIG_REGISTRY || \$npm_config_registry)]:registry' \
- '--token[Authentication token used for npm registry requests (default: \$npm_config_token)]:token' \
- '-y[Write a yarn.lock file (yarn v1)]' \
- '--yarn[Write a yarn.lock file (yarn v1)]' \
- '--production[Don'"'"'t install devDependencies]' \
- '-p[Don'"'"'t install devDependencies]' \
- '--frozen-lockfile[Disallow changes to lockfile]' \
- '--no-save[]' \
- '--dry-run[Don'"'"'t install anything]' \
- '-g[Remove a package globally]' \
- '--global[Remove a package globally]' \
- '--force[Always request the latest versions from the registry & reinstall all dependenices]' \
- '--lockfile[Store & load a lockfile at a specific filepath]:lockfile' \
- '--cache-dir[Store & load cached data from a specific directory path]:cache-dir' \
- '--no-cache[Ignore manifest cache entirely]' \
- '--silent[Don'"'"'t output anything]' \
- '--verbose[Excessively verbose logging]' \
- '--backend[Platform-specific optimizations for installing dependencies]:backend:("clonefile" "copyfile" "hardlink" "clonefile_each_dir", "symlink")' \
- '--link-native-bins[Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo]:link-native-bins' &&
- ret=0
-
- case $state in
- package) ;;
+ ;;
+ update)
+ _bun_update_completion
- esac
+ ;;
+ 'test')
+ _bun_test_completion
- ;;
- run)
- # ---- Command: run
- _arguments -s -C \
- '1: :->cmd' \
- '2: :->script' \
- '*: :->other' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-h[Show command help]' \
- '--silent[Don'"'"'t echo the command]' &&
- ret=0
+ ;;
+ esac
- case $state in
- script)
- curcontext="${curcontext%:*:*}:bun-grouped"
- _bun_run_param_script_completion
- ;;
- other)
- _files
;;
esac
;;
- upgrade)
-
- # ---- Command: upgrade
- _arguments -s -C \
- '1: :->cmd' \
- '--version[Show version and exit]' \
- '-V[Show version and exit]' \
- '--cwd[Change directory]:cwd' \
- '--help[Show command help]' \
- '-h[Show command help]' &&
- ret=0
-
- ;;
-
esac
;;
-
esac
+}
+_bun_list_bunfig_toml() {
+ # _alternative "files:file:_files -g '*.toml'"
+ _files
}
_bun_run_param_script_completion() {
local -a scripts_list
IFS=$'\n' scripts_list=($(SHELL=zsh bun getcompletes s))
IFS=$'\n' bins=($(SHELL=zsh bun getcompletes b))
-
+
_alternative "scripts:scripts:(($scripts_list))"
_alternative "bin:bin:(($bins))"
_alternative "files:file:_files -g '*.(js|ts|jsx|tsx|wasm)'"
}
+_bun_link_param_package_completion() {
+ # Read packages from ~/.bun/install/global/node_modules
+ install_env=$BUN_INSTALL
+ install_dir=${(P)install_env:-$HOME/.bun}
+ global_node_modules=$install_dir/install/global/node_modules
+
+ local -a packages_full_path=(${global_node_modules}/*(N))
+ packages=$(echo $packages_full_path | tr ' ' '\n' | xargs basename)
+ _alternative "dirs:directory:(($packages))"
+}
+
+_bun_remove_param_package_completion() {
+ if ! command -v jq &>/dev/null; then
+ return
+ fi
+
+ # TODO: move to "bun getcompletes"
+ if [ -f "package.json" ]; then
+ local dependencies=$(jq -r '.dependencies | keys[]' package.json)
+ local dev_dependencies=$(jq -r '.devDependencies | keys[]' package.json)
+ _alternative "deps:dependency:(($dependencies))"
+ _alternative "deps:dependency:(($dev_dependencies))"
+ fi
+}
+
+_bun_test_param_script_completion() {
+ local -a scripts_list
+
+ _alternative "files:file:_files -g '*(_|.)(test|spec).(js|ts|jsx|tsx)'"
+}
+
_set_remove() {
comm -23 <(echo $1 | sort | tr " " "\n") <(echo $2 | sort | tr " " "\n") 2>/dev/null
}
diff --git a/completions/spec.yaml b/completions/spec.yaml
index c3391c192..a07c5c797 100644
--- a/completions/spec.yaml
+++ b/completions/spec.yaml
@@ -119,9 +119,6 @@ subcommands:
- no-save --
- dry-run -- "Don't install anything"
- force -- "Always request the latest versions from the registry & reinstall all dependenices"
- - name: lockfile
- type: string
- summary: "Store & load a lockfile at a specific filepath"
- name: cache-dir
type: string
summary: "Store & load cached data from a specific directory path"
@@ -160,9 +157,6 @@ subcommands:
- no-cache -- "Ignore manifest cache entirely"
- silent -- "Don't output anything"
- verbose -- "Excessively verbose logging"
- - name: lockfile
- type: string
- summary: "Store & load a lockfile at a specific filepath"
- name: cache-dir
type: string
summary: "Store & load cached data from a specific directory path"
@@ -198,9 +192,6 @@ subcommands:
- no-save --
- dry-run -- "Don't install anything"
- force -- "Always request the latest versions from the registry & reinstall all dependenices"
- - name: lockfile
- type: string
- summary: "Store & load a lockfile at a specific filepath"
- name: cache-dir
type: string
summary: "Store & load cached data from a specific directory path"
diff --git a/dockerhub/Dockerfile-alpine b/dockerhub/Dockerfile-alpine
deleted file mode 100644
index 5530f438f..000000000
--- a/dockerhub/Dockerfile-alpine
+++ /dev/null
@@ -1,29 +0,0 @@
-# bun:alpine
-# Not officially supported (yet)
-
-ARG GLIBC_RELEASE=2.35-r0
-
-FROM alpine:latest AS build
-
-WORKDIR /tmp
-RUN apk --no-cache add unzip
-
-ARG GLIBC_RELEASE
-RUN wget https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
-wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_RELEASE}/glibc-${GLIBC_RELEASE}.apk
-
-ADD https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64.zip bun-linux-x64.zip
-RUN unzip bun-linux-x64.zip
-
-FROM alpine:latest
-
-ARG GLIBC_RELEASE
-COPY --from=build /tmp/sgerrand.rsa.pub /etc/apk/keys
-COPY --from=build /tmp/glibc-${GLIBC_RELEASE}.apk /tmp
-COPY --from=build /tmp/bun-linux-x64/bun /usr/local/bin
-
-RUN apk --no-cache --force-overwrite add /tmp/glibc-${GLIBC_RELEASE}.apk \
-&& rm /etc/apk/keys/sgerrand.rsa.pub \
-&& rm /tmp/glibc-${GLIBC_RELEASE}.apk
-
-RUN bun --version
diff --git a/dockerhub/Dockerfile-debian b/dockerhub/Dockerfile-debian
deleted file mode 100644
index eaca05403..000000000
--- a/dockerhub/Dockerfile-debian
+++ /dev/null
@@ -1,77 +0,0 @@
-FROM debian:bullseye-slim AS build
-
-# https://github.com/oven-sh/bun/releases
-ARG BUN_VERSION=latest
-
-RUN apt-get update -qq \
- && apt-get install -qq --no-install-recommends \
- ca-certificates \
- curl \
- dirmngr \
- gpg \
- gpg-agent \
- unzip \
- && apt-get clean \
- && rm -rf /var/lib/apt/lists/* \
- && arch="$(dpkg --print-architecture)" \
- && case "${arch##*-}" in \
- amd64) build="x64-baseline";; \
- arm64) build="aarch64";; \
- *) echo "error: unsupported architecture: ($arch)"; exit 1 ;; \
- esac \
- && version="$BUN_VERSION" \
- && case "$version" in \
- latest | canary | bun-v*) tag="$version"; ;; \
- v*) tag="bun-$version"; ;; \
- *) tag="bun-v$version"; ;; \
- esac \
- && case "$tag" in \
- latest) release="latest/download"; ;; \
- *) release="download/$tag"; ;; \
- esac \
- && curl "https://github.com/oven-sh/bun/releases/$release/bun-linux-$build.zip" \
- -fsSLO \
- --compressed \
- --retry 5 \
- || (echo "error: unknown release: ($tag)" && exit 1) \
- && for key in \
- "F3DCC08A8572C0749B3E18888EAB4D40A7B22B59" \
- ; do \
- gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" \
- || gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
- done \
- && gpg --update-trustdb \
- && curl "https://github.com/oven-sh/bun/releases/$release/SHASUMS256.txt.asc" \
- -fsSLO \
- --compressed \
- --retry 5 \
- && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
- || (echo "error: failed to verify release: ($tag)" && exit 1) \
- && grep " bun-linux-$build.zip\$" SHASUMS256.txt | sha256sum -c - \
- || (echo "error: failed to verify release: ($tag)" && exit 1) \
- && unzip "bun-linux-$build.zip" \
- && mv "bun-linux-$build/bun" /usr/local/bin/bun \
- && rm -f "bun-linux-$build.zip" SHASUMS256.txt.asc SHASUMS256.txt \
- && chmod +x /usr/local/bin/bun \
- && ln -s /usr/local/bin/bun /usr/local/bin/bunx \
- && which bun \
- && which bunx \
- && bun --version
-
-FROM debian:bullseye-slim
-
-RUN groupadd bun \
- --gid 1000 \
- && useradd bun \
- --uid 1000 \
- --gid bun \
- --shell /bin/sh \
- --create-home
-
-COPY docker-entrypoint.sh /usr/local/bin
-COPY --from=build /usr/local/bin/bun /usr/local/bin
-COPY --from=build /usr/local/bin/bunx /usr/local/bin
-
-WORKDIR /home/bun/app
-ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
-CMD ["/usr/local/bin/bun"]
diff --git a/dockerhub/alpine/Dockerfile b/dockerhub/alpine/Dockerfile
new file mode 100644
index 000000000..74d509e21
--- /dev/null
+++ b/dockerhub/alpine/Dockerfile
@@ -0,0 +1,113 @@
+FROM alpine:3.18 AS build
+
+# https://github.com/oven-sh/bun/releases
+ARG BUN_VERSION=latest
+
+# TODO: Instead of downloading glibc from a third-party source, we should
+# build it from source. This is a temporary solution.
+# See: https://github.com/sgerrand/alpine-pkg-glibc
+
+# https://github.com/sgerrand/alpine-pkg-glibc/releases
+# https://github.com/sgerrand/alpine-pkg-glibc/issues/176
+ARG GLIBC_VERSION=2.34-r0
+
+# https://github.com/oven-sh/bun/issues/5545#issuecomment-1722461083
+ARG GLIBC_VERSION_AARCH64=2.26-r1
+
+RUN apk --no-cache add \
+ ca-certificates \
+ curl \
+ dirmngr \
+ gpg \
+ gpg-agent \
+ unzip \
+ && arch="$(apk --print-arch)" \
+ && case "${arch##*-}" in \
+ x86_64) build="x64-baseline";; \
+ aarch64) build="aarch64";; \
+ *) echo "error: unsupported architecture: $arch"; exit 1 ;; \
+ esac \
+ && version="$BUN_VERSION" \
+ && case "$version" in \
+ latest | canary | bun-v*) tag="$version"; ;; \
+ v*) tag="bun-$version"; ;; \
+ *) tag="bun-v$version"; ;; \
+ esac \
+ && case "$tag" in \
+ latest) release="latest/download"; ;; \
+ *) release="download/$tag"; ;; \
+ esac \
+ && curl "https://github.com/oven-sh/bun/releases/$release/bun-linux-$build.zip" \
+ -fsSLO \
+ --compressed \
+ --retry 5 \
+ || (echo "error: failed to download: $tag" && exit 1) \
+ && for key in \
+ "F3DCC08A8572C0749B3E18888EAB4D40A7B22B59" \
+ ; do \
+ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" \
+ || gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
+ done \
+ && curl "https://github.com/oven-sh/bun/releases/$release/SHASUMS256.txt.asc" \
+ -fsSLO \
+ --compressed \
+ --retry 5 \
+ && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
+ || (echo "error: failed to verify: $tag" && exit 1) \
+ && grep " bun-linux-$build.zip\$" SHASUMS256.txt | sha256sum -c - \
+ || (echo "error: failed to verify: $tag" && exit 1) \
+ && unzip "bun-linux-$build.zip" \
+ && mv "bun-linux-$build/bun" /usr/local/bin/bun \
+ && rm -f "bun-linux-$build.zip" SHASUMS256.txt.asc SHASUMS256.txt \
+ && chmod +x /usr/local/bin/bun \
+ && cd /tmp \
+ && case "${arch##*-}" in \
+ x86_64) curl "https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk" \
+ -fsSLO \
+ --compressed \
+ --retry 5 \
+ || (echo "error: failed to download: glibc v${GLIBC_VERSION}" && exit 1) \
+ && mv "glibc-${GLIBC_VERSION}.apk" glibc.apk \
+ && curl "https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-bin-${GLIBC_VERSION}.apk" \
+ -fsSLO \
+ --compressed \
+ --retry 5 \
+ || (echo "error: failed to download: glibc-bin v${GLIBC_VERSION}" && exit 1) \
+ && mv "glibc-bin-${GLIBC_VERSION}.apk" glibc-bin.apk ;; \
+ aarch64) curl "https://raw.githubusercontent.com/squishyu/alpine-pkg-glibc-aarch64-bin/master/glibc-${GLIBC_VERSION_AARCH64}.apk" \
+ -fsSLO \
+ --compressed \
+ --retry 5 \
+ || (echo "error: failed to download: glibc v${GLIBC_VERSION_AARCH64}" && exit 1) \
+ && mv "glibc-${GLIBC_VERSION_AARCH64}.apk" glibc.apk \
+ && curl "https://raw.githubusercontent.com/squishyu/alpine-pkg-glibc-aarch64-bin/master/glibc-bin-${GLIBC_VERSION_AARCH64}.apk" \
+ -fsSLO \
+ --compressed \
+ --retry 5 \
+ || (echo "error: failed to download: glibc-bin v${GLIBC_VERSION_AARCH64}" && exit 1) \
+ && mv "glibc-bin-${GLIBC_VERSION_AARCH64}.apk" glibc-bin.apk ;; \
+ *) echo "error: unsupported architecture '$arch'"; exit 1 ;; \
+ esac
+
+FROM alpine:3.18
+
+COPY --from=build /tmp/glibc.apk /tmp/
+COPY --from=build /tmp/glibc-bin.apk /tmp/
+COPY --from=build /usr/local/bin/bun /usr/local/bin/
+COPY docker-entrypoint.sh /usr/local/bin/
+
+RUN addgroup -g 1000 bun \
+ && adduser -u 1000 -G bun -s /bin/sh -D bun \
+ && apk --no-cache --force-overwrite --allow-untrusted add \
+ /tmp/glibc.apk \
+ /tmp/glibc-bin.apk \
+ && rm /tmp/glibc.apk \
+ && rm /tmp/glibc-bin.apk \
+ && ln -s /usr/local/bin/bun /usr/local/bin/bunx \
+ && which bun \
+ && which bunx \
+ && bun --version
+
+WORKDIR /home/bun/app
+ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
+CMD ["/usr/local/bin/bun"]
diff --git a/dockerhub/docker-entrypoint.sh b/dockerhub/alpine/docker-entrypoint.sh
index a0e45cbb5..a0e45cbb5 100755
--- a/dockerhub/docker-entrypoint.sh
+++ b/dockerhub/alpine/docker-entrypoint.sh
diff --git a/dockerhub/debian-slim/Dockerfile b/dockerhub/debian-slim/Dockerfile
index 954c48d2f..c53e46ec2 100644
--- a/dockerhub/debian-slim/Dockerfile
+++ b/dockerhub/debian-slim/Dockerfile
@@ -1,7 +1,7 @@
FROM debian:bullseye-slim AS build
# https://github.com/oven-sh/bun/releases
-ARG BUN_VERSION=0.5.7
+ARG BUN_VERSION=latest
RUN apt-get update -qq \
&& apt-get install -qq --no-install-recommends \
@@ -17,7 +17,7 @@ RUN apt-get update -qq \
&& case "${arch##*-}" in \
amd64) build="x64-baseline";; \
arm64) build="aarch64";; \
- *) echo "error: unsupported architecture: ($arch)"; exit 1 ;; \
+ *) echo "error: unsupported architecture: $arch"; exit 1 ;; \
esac \
&& version="$BUN_VERSION" \
&& case "$version" in \
@@ -33,44 +33,44 @@ RUN apt-get update -qq \
-fsSLO \
--compressed \
--retry 5 \
- || (echo "error: unknown release: ($tag)" && exit 1) \
+ || (echo "error: failed to download: $tag" && exit 1) \
&& for key in \
"F3DCC08A8572C0749B3E18888EAB4D40A7B22B59" \
; do \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" \
|| gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
done \
- && gpg --update-trustdb \
&& curl "https://github.com/oven-sh/bun/releases/$release/SHASUMS256.txt.asc" \
-fsSLO \
--compressed \
--retry 5 \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
- || (echo "error: failed to verify release: ($tag)" && exit 1) \
+ || (echo "error: failed to verify: $tag" && exit 1) \
&& grep " bun-linux-$build.zip\$" SHASUMS256.txt | sha256sum -c - \
- || (echo "error: failed to verify release: ($tag)" && exit 1) \
+ || (echo "error: failed to verify: $tag" && exit 1) \
&& unzip "bun-linux-$build.zip" \
&& mv "bun-linux-$build/bun" /usr/local/bin/bun \
&& rm -f "bun-linux-$build.zip" SHASUMS256.txt.asc SHASUMS256.txt \
&& chmod +x /usr/local/bin/bun \
- && ln -s /usr/local/bin/bun /usr/local/bin/bunx \
&& which bun \
- && which bunx \
&& bun --version
FROM debian:bullseye-slim
+COPY docker-entrypoint.sh /usr/local/bin
+COPY --from=build /usr/local/bin/bun /usr/local/bin/bun
+
RUN groupadd bun \
--gid 1000 \
&& useradd bun \
--uid 1000 \
--gid bun \
--shell /bin/sh \
- --create-home
-
-COPY docker-entrypoint.sh /usr/local/bin
-COPY --from=build /usr/local/bin/bun /usr/local/bin
-COPY --from=build /usr/local/bin/bunx /usr/local/bin
+ --create-home \
+ && ln -s /usr/local/bin/bun /usr/local/bin/bunx \
+ && which bun \
+ && which bunx \
+ && bun --version
WORKDIR /home/bun/app
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
diff --git a/dockerhub/debian/Dockerfile b/dockerhub/debian/Dockerfile
index a16befb6f..71aca159a 100644
--- a/dockerhub/debian/Dockerfile
+++ b/dockerhub/debian/Dockerfile
@@ -1,7 +1,7 @@
FROM debian:bullseye-slim AS build
# https://github.com/oven-sh/bun/releases
-ARG BUN_VERSION=0.5.7
+ARG BUN_VERSION=latest
RUN apt-get update -qq \
&& apt-get install -qq --no-install-recommends \
@@ -17,7 +17,7 @@ RUN apt-get update -qq \
&& case "${arch##*-}" in \
amd64) build="x64-baseline";; \
arm64) build="aarch64";; \
- *) echo "error: unsupported architecture: ($arch)"; exit 1 ;; \
+ *) echo "error: unsupported architecture: $arch"; exit 1 ;; \
esac \
&& version="$BUN_VERSION" \
&& case "$version" in \
@@ -33,44 +33,42 @@ RUN apt-get update -qq \
-fsSLO \
--compressed \
--retry 5 \
- || (echo "error: unknown release: ($tag)" && exit 1) \
+ || (echo "error: failed to download: $tag" && exit 1) \
&& for key in \
"F3DCC08A8572C0749B3E18888EAB4D40A7B22B59" \
; do \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" \
|| gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
done \
- && gpg --update-trustdb \
&& curl "https://github.com/oven-sh/bun/releases/$release/SHASUMS256.txt.asc" \
-fsSLO \
--compressed \
--retry 5 \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
- || (echo "error: failed to verify release: ($tag)" && exit 1) \
+ || (echo "error: failed to verify: $tag" && exit 1) \
&& grep " bun-linux-$build.zip\$" SHASUMS256.txt | sha256sum -c - \
- || (echo "error: failed to verify release: ($tag)" && exit 1) \
+ || (echo "error: failed to verify: $tag" && exit 1) \
&& unzip "bun-linux-$build.zip" \
&& mv "bun-linux-$build/bun" /usr/local/bin/bun \
&& rm -f "bun-linux-$build.zip" SHASUMS256.txt.asc SHASUMS256.txt \
- && chmod +x /usr/local/bin/bun \
- && ln -s /usr/local/bin/bun /usr/local/bin/bunx \
- && which bun \
- && which bunx \
- && bun --version
+ && chmod +x /usr/local/bin/bun
FROM debian:bullseye
+COPY docker-entrypoint.sh /usr/local/bin
+COPY --from=build /usr/local/bin/bun /usr/local/bin/bun
+
RUN groupadd bun \
--gid 1000 \
&& useradd bun \
--uid 1000 \
--gid bun \
--shell /bin/sh \
- --create-home
-
-COPY docker-entrypoint.sh /usr/local/bin
-COPY --from=build /usr/local/bin/bun /usr/local/bin
-COPY --from=build /usr/local/bin/bunx /usr/local/bin
+ --create-home \
+ && ln -s /usr/local/bin/bun /usr/local/bin/bunx \
+ && which bun \
+ && which bunx \
+ && bun --version
WORKDIR /home/bun/app
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
diff --git a/dockerhub/Dockerfile-distroless b/dockerhub/distroless/Dockerfile
index ab079d194..6a89c8d28 100644
--- a/dockerhub/Dockerfile-distroless
+++ b/dockerhub/distroless/Dockerfile
@@ -1,5 +1,4 @@
FROM debian:bullseye-slim AS build
-# Not officially supported (yet)
# https://github.com/oven-sh/bun/releases
ARG BUN_VERSION=latest
@@ -18,7 +17,7 @@ RUN apt-get update -qq \
&& case "${arch##*-}" in \
amd64) build="x64-baseline";; \
arm64) build="aarch64";; \
- *) echo "error: unsupported architecture: ($arch)"; exit 1 ;; \
+ *) echo "error: unsupported architecture: $arch"; exit 1 ;; \
esac \
&& version="$BUN_VERSION" \
&& case "$version" in \
@@ -34,36 +33,37 @@ RUN apt-get update -qq \
-fsSLO \
--compressed \
--retry 5 \
- || (echo "error: unknown release: ($tag)" && exit 1) \
+ || (echo "error: failed to download: $tag" && exit 1) \
&& for key in \
"F3DCC08A8572C0749B3E18888EAB4D40A7B22B59" \
; do \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" \
|| gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
done \
- && gpg --update-trustdb \
&& curl "https://github.com/oven-sh/bun/releases/$release/SHASUMS256.txt.asc" \
-fsSLO \
--compressed \
--retry 5 \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
- || (echo "error: failed to verify release: ($tag)" && exit 1) \
+ || (echo "error: failed to verify: $tag" && exit 1) \
&& grep " bun-linux-$build.zip\$" SHASUMS256.txt | sha256sum -c - \
- || (echo "error: failed to verify release: ($tag)" && exit 1) \
+ || (echo "error: failed to verify: $tag" && exit 1) \
&& unzip "bun-linux-$build.zip" \
&& mv "bun-linux-$build/bun" /usr/local/bin/bun \
&& rm -f "bun-linux-$build.zip" SHASUMS256.txt.asc SHASUMS256.txt \
&& chmod +x /usr/local/bin/bun \
- && ln -s /usr/local/bin/bun /usr/local/bin/bunx \
&& which bun \
- && which bunx \
&& bun --version
FROM gcr.io/distroless/base-nossl-debian11
-COPY --from=build /usr/local/bin/bun /usr/local/bin
-COPY --from=build /usr/local/bin/bunx /usr/local/bin
+COPY --from=build /usr/local/bin/bun /usr/local/bin/
+
+# Temporarily use the `build`-stage image binaries to create a symlink:
+RUN --mount=type=bind,from=build,source=/usr/bin,target=/usr/bin \
+ --mount=type=bind,from=build,source=/bin,target=/bin <<EOF
+ ln -s /usr/local/bin/bun /usr/local/bin/bunx
+ which bunx
+EOF
-WORKDIR /app
ENTRYPOINT ["/usr/local/bin/bun"]
-CMD ["/usr/local/bin/bun"]
diff --git a/docs/api/binary-data.md b/docs/api/binary-data.md
index a75d08309..91b314b98 100644
--- a/docs/api/binary-data.md
+++ b/docs/api/binary-data.md
@@ -26,10 +26,10 @@ Below is a quick "cheat sheet" that doubles as a table of contents. Click an ite
---
-<!-- - [`File`](#file)
-- _Browser only_. A subclass of `Blob` that represents a file. Has a `name` and `lastModified` timestamp. There is experimental support in Node.js v20; Bun does not support `File` yet; most of its functionality is provided by `BunFile`.
+- [`File`](#file)
+- A subclass of `Blob` that represents a file. Has a `name` and `lastModified` timestamp. There is experimental support in Node.js v20.
---- -->
+---
- [`BunFile`](#bunfile)
- _Bun only_. A subclass of `Blob` that represents a lazily-loaded file on disk. Created with `Bun.file(path)`.
@@ -412,7 +412,7 @@ For complete documentation, refer to the [Node.js documentation](https://nodejs.
`Blob` is a Web API commonly used for representing files. `Blob` was initially implemented in browsers (unlike `ArrayBuffer` which is part of JavaScript itself), but it is now supported in Node and Bun.
-It isn't common to directly create `Blob` instances. More often, you'll recieve instances of `Blob` from an external source (like an `<input type="file">` element in the browser) or library. That said, it is possible to create a `Blob` from one or more string or binary "blob parts".
+It isn't common to directly create `Blob` instances. More often, you'll receive instances of `Blob` from an external source (like an `<input type="file">` element in the browser) or library. That said, it is possible to create a `Blob` from one or more string or binary "blob parts".
```ts
const blob = new Blob(["<html>Hello</html>"], {
@@ -507,7 +507,7 @@ for await (const chunk of stream) {
}
```
-For a more complete discusson of streams in Bun, see [API > Streams](/docs/api/streams).
+For a more complete discussion of streams in Bun, see [API > Streams](/docs/api/streams).
## Conversion
diff --git a/docs/api/file-io.md b/docs/api/file-io.md
index e6902cc6a..f37473c33 100644
--- a/docs/api/file-io.md
+++ b/docs/api/file-io.md
@@ -2,7 +2,7 @@
<!-- **Note** — The `Bun.file` and `Bun.write` APIs documented on this page are heavily optimized and represent the recommended way to perform file-system tasks using Bun. Existing Node.js projects may use Bun's [nearly complete](/docs/runtime/nodejs-apis#node-fs) implementation of the [`node:fs`](https://nodejs.org/api/fs.html) module. -->
-**Note** — The `Bun.file` and `Bun.write` APIs documented on this page are heavily optimized and represent the recommended way to perform file-system tasks using Bun. For operations that are not yet available with `Bun.file`, such as `mkdir`, you can use Bun's [nearly complete](/docs/runtime/nodejs-apis#node-fs) implementation of the [`node:fs`](https://nodejs.org/api/fs.html) module.
+**Note** — The `Bun.file` and `Bun.write` APIs documented on this page are heavily optimized and represent the recommended way to perform file-system tasks using Bun. For operations that are not yet available with `Bun.file`, such as `mkdir` or `readdir`, you can use Bun's [nearly complete](/docs/runtime/nodejs-apis#node-fs) implementation of the [`node:fs`](https://nodejs.org/api/fs.html) module.
{% /callout %}
diff --git a/docs/api/file-system-router.md b/docs/api/file-system-router.md
index 964652401..8e1fbe0fc 100644
--- a/docs/api/file-system-router.md
+++ b/docs/api/file-system-router.md
@@ -93,6 +93,7 @@ interface Bun {
style: "nextjs";
origin?: string;
assetPrefix?: string;
+ fileExtensions?: string[];
});
reload(): void;
diff --git a/docs/api/http.md b/docs/api/http.md
index 629570335..3f476feb2 100644
--- a/docs/api/http.md
+++ b/docs/api/http.md
@@ -71,7 +71,7 @@ In development mode, Bun will surface errors in-browser with a built-in error pa
{% image src="/images/exception_page.png" caption="Bun's built-in 500 page" /%}
-To handle server-side errors, implement an `error` handler. This function should return a `Response` to served to the client when an error occurs. This response will supercede Bun's default error page in `development` mode.
+To handle server-side errors, implement an `error` handler. This function should return a `Response` to serve to the client when an error occurs. This response will supersede Bun's default error page in `development` mode.
```ts
Bun.serve({
@@ -212,9 +212,7 @@ $ bun --hot server.ts
To stream a file, return a `Response` object with a `BunFile` object as the body.
```ts
-import { serve, file } from "bun";
-
-serve({
+Bun.serve({
fetch(req) {
return new Response(Bun.file("./hello.txt"));
},
diff --git a/docs/api/import-meta.md b/docs/api/import-meta.md
index 3c22308ce..37f35884d 100644
--- a/docs/api/import-meta.md
+++ b/docs/api/import-meta.md
@@ -39,7 +39,7 @@ import.meta.resolveSync("zod")
---
- `import.meta.resolve{Sync}`
-- Resolve a module specifier (e.g. `"zod"` or `"./file.tsx`) to an absolute path. While file would be imported if the specifier were imported from this file?
+- Resolve a module specifier (e.g. `"zod"` or `"./file.tsx"`) to an absolute path. While file would be imported if the specifier were imported from this file?
```ts
import.meta.resolveSync("zod");
diff --git a/docs/api/spawn.md b/docs/api/spawn.md
index a85f9d08c..644f8cee3 100644
--- a/docs/api/spawn.md
+++ b/docs/api/spawn.md
@@ -183,6 +183,60 @@ const proc = Bun.spawn(["echo", "hello"]);
proc.unref();
```
+## Inter-process communication (IPC)
+
+Bun supports direct inter-process communication channel between two `bun` processes. To receive messages from a spawned Bun subprocess, specify an `ipc` handler.
+{%callout%}
+**Note** — This API is only compatible with other `bun` processes. Use `process.execPath` to get a path to the currently running `bun` executable.
+{%/callout%}
+
+```ts#parent.ts
+const child = Bun.spawn(["bun", "child.ts"], {
+ ipc(message) {
+ /**
+ * The message received from the sub process
+ **/
+ },
+});
+```
+
+The parent process can send messages to the subprocess using the `.send()` method on the returned `Subprocess` instance. A reference to the sending subprocess is also available as the second argument in the `ipc` handler.
+
+```ts#parent.ts
+const childProc = Bun.spawn(["bun", "child.ts"], {
+ ipc(message, childProc) {
+ /**
+ * The message received from the sub process
+ **/
+ childProc.send("Respond to child")
+ },
+});
+
+childProc.send("I am your father"); // The parent can send messages to the child as well
+```
+
+Meanwhile the child process can send messages to its parent using with `process.send()` and receive messages with `process.on("message")`. This is the same API used for `child_process.fork()` in Node.js.
+
+```ts#child.ts
+process.send("Hello from child as string");
+process.send({ message: "Hello from child as object" });
+
+process.on("message", (message) => {
+ // print message from parent
+ console.log(message);
+});
+```
+
+All messages are serialized using the JSC `serialize` API, which allows for the same set of [transferrable types](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Transferable_objects) supported by `postMessage` and `structuredClone`, including strings, typed arrays, streams, and objects.
+
+```ts#child.ts
+// send a string
+process.send("Hello from child as string");
+
+// send an object
+process.send({ message: "Hello from child as object" });
+```
+
## Blocking API (`Bun.spawnSync()`)
Bun provides a synchronous equivalent of `Bun.spawn` called `Bun.spawnSync`. This is a blocking API that supports the same inputs and parameters as `Bun.spawn`. It returns a `SyncSubprocess` object, which differs from `Subprocess` in a few ways.
diff --git a/docs/api/sqlite.md b/docs/api/sqlite.md
index e04b8ded7..3749fb8b4 100644
--- a/docs/api/sqlite.md
+++ b/docs/api/sqlite.md
@@ -99,6 +99,20 @@ const query = db.prepare("SELECT * FROM foo WHERE bar = ?");
{% /callout %}
+## WAL mode
+
+SQLite supports [write-ahead log mode](https://www.sqlite.org/wal.html) (WAL) which dramatically improves performance, especially in situations with many concurrent writes. It's broadly recommended to enable WAL mode for most typical applications.
+
+To enable WAL mode, run this pragma query at the beginning of your application:
+
+```ts
+db.exec("PRAGMA journal_mode = WAL;");
+```
+
+{% details summary="What is WAL mode" %}
+In WAL mode, writes to the database are written directly to a separate file called the "WAL file" (write-ahead log). This file will be later integrated into the main database file. Think of it as a buffer for pending writes. Refer to the [SQLite docs](https://www.sqlite.org/wal.html) for a more detailed overview.
+{% /details %}
+
## Statements
A `Statement` is a _prepared query_, which means it's been parsed and compiled into an efficient binary form. It can be executed multiple times in a performant way.
diff --git a/docs/api/transpiler.md b/docs/api/transpiler.md
index 6d81a1ef9..ede4ee7cc 100644
--- a/docs/api/transpiler.md
+++ b/docs/api/transpiler.md
@@ -76,7 +76,7 @@ await transpiler.transform("<div>hi!</div>", "tsx");
```
{% details summary="Nitty gritty" %}
-The `.tranform()` method runs the transpiler in Bun's worker threadpool, so if you run it 100 times, it will run it across `Math.floor($cpu_count * 0.8)` threads, without blocking the main JavaScript thread.
+The `.transform()` method runs the transpiler in Bun's worker threadpool, so if you run it 100 times, it will run it across `Math.floor($cpu_count * 0.8)` threads, without blocking the main JavaScript thread.
If your code uses a macro, it will potentially spawn a new copy of Bun's JavaScript runtime environment in that new thread.
{% /details %}
diff --git a/docs/api/utils.md b/docs/api/utils.md
index de2dc6994..9889d6aa0 100644
--- a/docs/api/utils.md
+++ b/docs/api/utils.md
@@ -183,7 +183,7 @@ const currentFile = import.meta.url;
Bun.openInEditor(currentFile);
```
-You can override this via the `debug.editor` setting in your [`bunfig.toml`](/docs/runtime/configuration)
+You can override this via the `debug.editor` setting in your [`bunfig.toml`](/docs/runtime/bunfig)
```toml-diff#bunfig.toml
+ [debug]
@@ -204,7 +204,7 @@ Bun.ArrayBufferSink;
## `Bun.deepEquals()`
-Nestedly checks if two objects are equivalent. This is used internally by `expect().toEqual()` in `bun:test`.
+Recursively checks if two objects are equivalent. This is used internally by `expect().toEqual()` in `bun:test`.
```ts
const foo = { a: 1, b: 2, c: { d: 3 } };
diff --git a/docs/api/websockets.md b/docs/api/websockets.md
index e704419bb..4e55b8761 100644
--- a/docs/api/websockets.md
+++ b/docs/api/websockets.md
@@ -87,7 +87,7 @@ ws.send(new Uint8Array([1, 2, 3])); // TypedArray | DataView
### Headers
-Once the upgrade succeeds, Bun will send a `101 Switching Protocols` response per the [spec](https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism). Additional `headers` can be attched to this `Response` in the call to `server.upgrade()`.
+Once the upgrade succeeds, Bun will send a `101 Switching Protocols` response per the [spec](https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism). Additional `headers` can be attached to this `Response` in the call to `server.upgrade()`.
```ts
Bun.serve({
@@ -161,7 +161,7 @@ socket.addEventListener("message", event => {
### Pub/Sub
-Bun's `ServerWebSocket` implementation implements a native publish-subscribe API for topic-based broadcasting. Individual sockets can `.subscribe()` to a topic (specified with a string identifier) and `.publish()` messages to all other subscribers to that topic. This topic-based broadcast API is similar to [MQTT](https://en.wikipedia.org/wiki/MQTT) and [Redis Pub/Sub](https://redis.io/topics/pubsub).
+Bun's `ServerWebSocket` implementation implements a native publish-subscribe API for topic-based broadcasting. Individual sockets can `.subscribe()` to a topic (specified with a string identifier) and `.publish()` messages to all other subscribers to that topic (excluding itself). This topic-based broadcast API is similar to [MQTT](https://en.wikipedia.org/wiki/MQTT) and [Redis Pub/Sub](https://redis.io/topics/pubsub).
```ts
const server = Bun.serve<{ username: string }>({
@@ -200,7 +200,18 @@ const server = Bun.serve<{ username: string }>({
console.log(`Listening on ${server.hostname}:${server.port}`);
```
-Calling `.publish(data)` will send the message to all subscribers of a topic _except_ the socket that called `.publish()`.
+Calling `.publish(data)` will send the message to all subscribers of a topic _except_ the socket that called `.publish()`. To send a message to all subscribers of a topic, use the `.publish()` method on the `Server` instance.
+
+```ts
+const server = Bun.serve({
+ websocket: {
+ // ...
+ },
+});
+
+// listen for some external event
+server.publish("the-group-chat", "Hello world");
+```
### Compression
diff --git a/docs/api/workers.md b/docs/api/workers.md
index 417b77148..2b8c4fe13 100644
--- a/docs/api/workers.md
+++ b/docs/api/workers.md
@@ -10,7 +10,7 @@ Bun implements a minimal version of the [Web Workers API](https://developer.mozi
Like in browsers, [`Worker`](https://developer.mozilla.org/en-US/docs/Web/API/Worker) is a global. Use it to create a new worker thread.
-From the main thread:
+### From the main thread
```js#Main_thread
const workerURL = new URL("worker.ts", import.meta.url).href;
@@ -22,16 +22,25 @@ worker.onmessage = event => {
};
```
-Worker thread:
+### Worker thread
```ts#worker.ts_(Worker_thread)
+// prevents TS errors
+declare var self: Worker;
+
self.onmessage = (event: MessageEvent) => {
console.log(event.data);
postMessage("world");
};
```
-You can use `import`/`export` syntax in your worker code. Unlike in browsers, there's no need to specify `{type: "module"}` to use ES Modules.
+To prevent TypeScript errors when using `self`, add this line to the top of your worker file.
+
+```ts
+declare var self: Worker;
+```
+
+You can use `import` and `export` syntax in your worker code. Unlike in browsers, there's no need to specify `{type: "module"}` to use ES Modules.
To simplify error handling, the initial script to load is resolved at the time `new Worker(url)` is called.
@@ -123,14 +132,14 @@ By default, an active `Worker` will keep the main (spawning) process alive, so a
### `worker.unref()`
-To stop a running worker from keeping the process alive, call `worker.unref()`. This decouples the lifetime of the worker to the lifetime of the main process, and is equivlent to what Node.js' `worker_threads` does.
+To stop a running worker from keeping the process alive, call `worker.unref()`. This decouples the lifetime of the worker to the lifetime of the main process, and is equivalent to what Node.js' `worker_threads` does.
```ts
const worker = new Worker(new URL("worker.ts", import.meta.url).href);
worker.unref();
```
-Note: `worker.unref()` is not available in browers.
+Note: `worker.unref()` is not available in browsers.
### `worker.ref()`
@@ -151,7 +160,7 @@ const worker = new Worker(new URL("worker.ts", import.meta.url).href, {
});
```
-Note: `worker.ref()` is not available in browers.
+Note: `worker.ref()` is not available in browsers.
## Memory usage with `smol`
diff --git a/docs/bundler/index.md b/docs/bundler/index.md
index 585a6ac52..3069654b2 100644
--- a/docs/bundler/index.md
+++ b/docs/bundler/index.md
@@ -29,6 +29,10 @@ The bundler is a key piece of infrastructure in the JavaScript ecosystem. As a b
Let's jump into the bundler API.
+{% callout %}
+Note that the Bun bundler is not intended to replace `tsc` for typechecking or generating type declarations.
+{% /callout %}
+
## Basic example
Let's build our first bundle. You have the following two files, which implement a simple client-side rendered React app.
@@ -132,6 +136,14 @@ Visit `http://localhost:5000` to see your bundled app in action.
{% /details %}
+## Watch mode
+
+Like the runtime and test runner, the bundler supports watch mode natively.
+
+```sh
+$ bun build ./index.tsx --outdir ./out --watch
+```
+
## Content types
Like the Bun runtime, the bundler supports an array of file types out of the box. The following table breaks down the bundler's set of standard "loaders". Refer to [Bundler > File types](/docs/runtime/loaders) for full documentation.
@@ -316,7 +328,7 @@ Depending on the target, Bun will apply different module resolution rules and op
All bundles generated with `target: "bun"` are marked with a special `// @bun` pragma, which indicates to the Bun runtime that there's no need to re-transpile the file before execution.
- If any entrypoints contains a Bun shebang (`#!/usr/bin/env bun`) the bundler will default to `target: "bun"` instead of `"browser`.
+ If any entrypoints contains a Bun shebang (`#!/usr/bin/env bun`) the bundler will default to `target: "bun"` instead of `"browser"`.
---
@@ -1084,7 +1096,7 @@ interface BuildArtifact extends Blob {
The `outputs` array contains all the files that were generated by the build. Each artifact implements the `Blob` interface.
```ts
-const build = Bun.build({
+const build = await Bun.build({
/* */
});
@@ -1128,7 +1140,7 @@ Each artifact also contains the following properties:
Similar to `BunFile`, `BuildArtifact` objects can be passed directly into `new Response()`.
```ts
-const build = Bun.build({
+const build = await Bun.build({
/* */
});
@@ -1144,7 +1156,7 @@ The Bun runtime implements special pretty-printing of `BuildArtifact` object to
```ts#Build_script
// build.ts
-const build = Bun.build({/* */});
+const build = await Bun.build({/* */});
const artifact = build.outputs[0];
console.log(artifact);
diff --git a/docs/bundler/intro.md b/docs/bundler/intro.md
index 5056c26a9..8927053d5 100644
--- a/docs/bundler/intro.md
+++ b/docs/bundler/intro.md
@@ -40,7 +40,7 @@ When a user visits this website, the files are loaded in the following order:
This approach works, it requires three round-trip HTTP requests before the browser is ready to render the page. On slow internet connections, this may add up to a non-trivial delay.
-This example is extremely simplistic. A modern app may be loading dozens of modules from `node_modules`, each consisting of hundrends of files. Loading each of these files with a separate HTTP request becomes untenable very quickly. While most of these requests will be running in parallel, the number of round-trip requests can still be very high; plus, there are limits on how many simultaneous requests a browser can make.
+This example is extremely simplistic. A modern app may be loading dozens of modules from `node_modules`, each consisting of hundred of files. Loading each of these files with a separate HTTP request becomes untenable very quickly. While most of these requests will be running in parallel, the number of round-trip requests can still be very high; plus, there are limits on how many simultaneous requests a browser can make.
{% callout %}
Some recent advances like modulepreload and HTTP/3 are intended to solve some of these problems, but at the moment bundling is still the most performant approach.
diff --git a/docs/bundler/loaders.md b/docs/bundler/loaders.md
index c15ce926f..d013913d6 100644
--- a/docs/bundler/loaders.md
+++ b/docs/bundler/loaders.md
@@ -16,7 +16,7 @@ Parses the code and applies a set of default transforms, like dead-code eliminat
**JavaScript + JSX.**. Default for `.js` and `.jsx`.
-Same as the `js` loader, but JSX syntax is supported. By default, JSX is downconverted to plain JavaScript; the details of how this is done depends on the `jsx*` compiler options in your `tsconfig.json`. Refer to the TypeScript documentation [on JSX](https://www.typescriptlang.org/docs/handbook/jsx.html) for more information.
+Same as the `js` loader, but JSX syntax is supported. By default, JSX is down-converted to plain JavaScript; the details of how this is done depends on the `jsx*` compiler options in your `tsconfig.json`. Refer to the TypeScript documentation [on JSX](https://www.typescriptlang.org/docs/handbook/jsx.html) for more information.
### `ts`
diff --git a/docs/bundler/macros.md b/docs/bundler/macros.md
index ecba16c0d..c0dcff319 100644
--- a/docs/bundler/macros.md
+++ b/docs/bundler/macros.md
@@ -129,7 +129,7 @@ if (returnFalse()) {
}
```
-## Serializablility
+## Serializability
Bun's transpiler needs to be able to serialize the result of the macro so it can be inlined into the AST. All JSON-compatible data structures are supported:
diff --git a/docs/bundler/vs-esbuild.md b/docs/bundler/vs-esbuild.md
index 0d145721a..67bed3dc3 100644
--- a/docs/bundler/vs-esbuild.md
+++ b/docs/bundler/vs-esbuild.md
@@ -125,13 +125,13 @@ In Bun's CLI, simple boolean flags like `--minify` do not accept an argument. Ot
- `--target`
- n/a
-- No supported. Bun's bundler performs no syntactic downleveling at this time.
+- No supported. Bun's bundler performs no syntactic down-leveling at this time.
---
- `--watch`
-- n/a
-- Not applicable
+- `--watch`
+- No differences
---
diff --git a/docs/cli/add.md b/docs/cli/add.md
new file mode 100644
index 000000000..4b555d5a6
--- /dev/null
+++ b/docs/cli/add.md
@@ -0,0 +1,155 @@
+To add a particular package:
+
+```bash
+$ bun add preact
+```
+
+To specify a version, version range, or tag:
+
+```bash
+$ bun add zod@3.20.0
+$ bun add zod@^3.0.0
+$ bun add zod@latest
+```
+
+## `--dev`
+
+{% callout %}
+**Alias** — `--development`, `-d`, `-D`
+{% /callout %}
+
+To add a package as a dev dependency (`"devDependencies"`):
+
+```bash
+$ bun add --dev @types/react
+$ bun add -d @types/react
+```
+
+## `--optional`
+
+To add a package as an optional dependency (`"optionalDependencies"`):
+
+```bash
+$ bun add --optional lodash
+```
+
+## `--exact`
+
+To add a package and pin to the resolved version, use `--exact`. This will resolve the version of the package and add it to your `package.json` with an exact version number instead of a version range.
+
+```bash
+$ bun add react --exact
+$ bun add react -E
+```
+
+This will add the following to your `package.json`:
+
+```jsonc
+{
+ "dependencies": {
+ // without --exact
+ "react": "^18.2.0", // this matches >= 18.2.0 < 19.0.0
+
+ // with --exact
+ "react": "18.2.0" // this matches only 18.2.0 exactly
+ }
+}
+```
+
+To view a complete list of options for this command:
+
+```bash
+$ bun add --help
+```
+
+## `--global`
+
+{% callout %}
+**Note** — This would not modify package.json of your current project folder.
+**Alias** - `bun add --global`, `bun add -g`, `bun install --global` and `bun install -g`
+{% /callout %}
+
+To install a package globally, use the `-g`/`--global` flag. This will not modify the `package.json` of your current project. Typically this is used for installing command-line tools.
+
+```bash
+$ bun add --global cowsay # or `bun add -g cowsay`
+$ cowsay "Bun!"
+ ______
+< Bun! >
+ ------
+ \ ^__^
+ \ (oo)\_______
+ (__)\ )\/\
+ ||----w |
+ || ||
+```
+
+{% details summary="Configuring global installation behavior" %}
+
+```toml
+[install]
+# where `bun add --global` installs packages
+globalDir = "~/.bun/install/global"
+
+# where globally-installed package bins are linked
+globalBinDir = "~/.bun/bin"
+```
+
+{% /details %}
+
+## Trusted dependencies
+
+Unlike other npm clients, Bun does not execute arbitrary lifecycle scripts for installed dependencies, such as `postinstall`. These scripts represent a potential security risk, as they can execute arbitrary code on your machine.
+
+To tell Bun to allow lifecycle scripts for a particular package, add the package to `trustedDependencies` in your package.json.
+
+```json-diff
+ {
+ "name": "my-app",
+ "version": "1.0.0",
++ "trustedDependencies": ["my-trusted-package"]
+ }
+```
+
+Bun reads this field and will run lifecycle scripts for `my-trusted-package`.
+
+<!-- Bun maintains an allow-list of popular packages containing `postinstall` scripts that are known to be safe. To run lifecycle scripts for packages that aren't on this list, add the package to `trustedDependencies` in your package.json. -->
+
+## Git dependencies
+
+To add a dependency from a git repository:
+
+```bash
+$ bun add git@github.com:moment/moment.git
+```
+
+Bun supports a variety of protocols, including [`github`](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#github-urls), [`git`](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#git-urls-as-dependencies), `git+ssh`, `git+https`, and many more.
+
+```json
+{
+ "dependencies": {
+ "dayjs": "git+https://github.com/iamkun/dayjs.git",
+ "lodash": "git+ssh://github.com/lodash/lodash.git#4.17.21",
+ "moment": "git@github.com:moment/moment.git",
+ "zod": "github:colinhacks/zod"
+ }
+}
+```
+
+## Tarball dependencies
+
+A package name can correspond to a publicly hosted `.tgz` file. During installation, Bun will download and install the package from the specified tarball URL, rather than from the package registry.
+
+```sh
+$ bun add zod@https://registry.npmjs.org/zod/-/zod-3.21.4.tgz
+```
+
+This will add the following line to your `package.json`:
+
+```json#package.json
+{
+ "dependencies": {
+ "zod": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz"
+ }
+}
+```
diff --git a/docs/templates.md b/docs/cli/bun-create.md
index c80caa153..c5cc602b6 100644
--- a/docs/templates.md
+++ b/docs/cli/bun-create.md
@@ -1,42 +1,18 @@
-## `bun init`
-
-Scaffold an empty project with the interactive `bun init` command.
-
-```bash
-$ bun init
-bun init helps you get started with a minimal project and tries to
-guess sensible defaults. Press ^C anytime to quit.
-
-package name (quickstart):
-entry point (index.ts):
-
-Done! A package.json file was saved in the current directory.
- + index.ts
- + .gitignore
- + tsconfig.json (for editor auto-complete)
- + README.md
-
-To get started, run:
- bun run index.ts
-```
-
-Press `enter` to accept the default answer for each prompt, or pass the `-y` flag to auto-accept the defaults.
-
-## `bun create`
-
{% callout %}
**Note** — You don’t need `bun create` to use Bun. You don’t need any configuration at all. This command exists to make getting started a bit quicker and easier.
{% /callout %}
Template a new Bun project with `bun create`. This is a flexible command that can be used to create a new project with a `create-<template>` npm package, a GitHub repo, or a local template.
-### From `npm`
+If you're looking to create a brand new empty project, use [`bun init`](/docs/cli/init).
+
+## From `npm`
```sh
$ bun create <template> [<destination>]
```
-Assuming you don't have a [local template](#local-templates) with the same name, this command will download and execute the `create-<template>` package from npm. The following two commands will behave identically:
+Assuming you don't have a [local template](#from-a-local-template) with the same name, this command will download and execute the `create-<template>` package from npm. The following two commands will behave identically:
```sh
$ bun create remix
@@ -45,7 +21,7 @@ $ bunx create-remix
Refer to the documentation of the associated `create-<template>` package for complete documentation and usage instructions.
-### From GitHub
+## From GitHub
This will download the contents of the GitHub repo to disk.
@@ -115,7 +91,7 @@ $ bun create https://github.com/ahfarmer/calculator ./myapp
Bun installs the files as they currently exist current default branch (usually `main` or `master`). Unlike `git clone` it doesn't download the commit history or configure a remote. -->
-### From a local template
+## From a local template
{% callout %}
**⚠️ Warning** — Unlike remote templates, running `bun create` with a local template will delete the entire destination folder if it already exists! Be careful.
diff --git a/docs/cli/bun-install.md b/docs/cli/bun-install.md
index 8050070be..0cbc21e1d 100644
--- a/docs/cli/bun-install.md
+++ b/docs/cli/bun-install.md
@@ -21,7 +21,7 @@ Configuring with `bunfig.toml` is optional. Bun tries to be zero configuration i
# Scope name The value can be a URL string or an object
"@mybigcompany" = { token = "123456", url = "https://registry.mybigcompany.com" }
-# URL is optional and fallsback to the default registry
+# URL is optional and falls back to the default registry
# The "@" in the scope is optional
mybigcompany2 = { token = "123456" }
@@ -47,7 +47,7 @@ registry = "https://registry.yarnpkg.com/"
# Install for production? This is the equivalent to the "--production" CLI argument
production = false
-# Disallow changes to lockfile? This is the equivalent to the "--fozen-lockfile" CLI argument
+# Disallow changes to lockfile? This is the equivalent to the "--frozen-lockfile" CLI argument
frozenLockfile = false
# Don't actually install
@@ -89,12 +89,6 @@ disableManifest = false
# Note: it does not load the lockfile, it just converts bun.lockb into a yarn.lock
print = "yarn"
-# Path to read bun.lockb from
-path = "bun.lockb"
-
-# Path to save bun.lockb to
-savePath = "bun.lockb"
-
# Save the lockfile to disk
save = true
@@ -142,8 +136,6 @@ export interface Cache {
export interface Lockfile {
print?: "yarn";
- path: string;
- savePath: string;
save: boolean;
}
```
@@ -156,7 +148,6 @@ Environment variables have a higher priority than `bunfig.toml`.
| -------------------------------- | ------------------------------------------------------------- |
| BUN_CONFIG_REGISTRY | Set an npm registry (default: <https://registry.npmjs.org>) |
| BUN_CONFIG_TOKEN | Set an auth token (currently does nothing) |
-| BUN_CONFIG_LOCKFILE_SAVE_PATH | File path to save the lockfile to (default: bun.lockb) |
| BUN_CONFIG_YARN_LOCKFILE | Save a Yarn v1-style yarn.lock |
| BUN_CONFIG_LINK_NATIVE_BINS | Point `bin` in package.json to a platform-specific dependency |
| BUN_CONFIG_SKIP_SAVE_LOCKFILE | Don’t save a lockfile |
diff --git a/docs/cli/bundler.md b/docs/cli/bundler.md
index 6900e9292..1b4c419c1 100644
--- a/docs/cli/bundler.md
+++ b/docs/cli/bundler.md
@@ -1,6 +1,6 @@
Bundling is currently an important mechanism for building complex web apps.
-Modern apps typically consist of a large number of files and package dependencies. Despite the fact that modern browsers support [ES Module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) imports, it's still too slow to fetch each file via inidividual HTTP requests. _Bundling_ is the process of concatenating several source files into a single large file that can be loaded in a single request.
+Modern apps typically consist of a large number of files and package dependencies. Despite the fact that modern browsers support [ES Module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) imports, it's still too slow to fetch each file via individual HTTP requests. _Bundling_ is the process of concatenating several source files into a single large file that can be loaded in a single request.
{% callout %}
**On bundling** — Despite recent advances like [`modulepreload`](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/modulepreload) and [HTTP/3](https://en.wikipedia.org/wiki/HTTP/3), bundling is still the most performant approach.
diff --git a/docs/cli/create.md b/docs/cli/create.md
deleted file mode 100644
index d59912f2b..000000000
--- a/docs/cli/create.md
+++ /dev/null
@@ -1,256 +0,0 @@
-## `bun init`
-
-Scaffold an empty project with `bun init`. It's an interactive tool.
-
-```bash
-$ bun init
-bun init helps you get started with a minimal project and tries to
-guess sensible defaults. Press ^C anytime to quit.
-
-package name (quickstart):
-entry point (index.ts):
-
-Done! A package.json file was saved in the current directory.
- + index.ts
- + .gitignore
- + tsconfig.json (for editor auto-complete)
- + README.md
-
-To get started, run:
- bun run index.ts
-```
-
-Press `enter` to accept the default answer for each prompt, or pass the `-y` flag to auto-accept the defaults.
-
-## `bun create`
-
-Template a new Bun project with `bun create`.
-
-```bash
-$ bun create <template> <destination>
-```
-
-{% callout %}
-**Note** — You don’t need `bun create` to use Bun. You don’t need any configuration at all. This command exists to make getting started a bit quicker and easier.
-{% /callout %}
-
-A template can take a number of forms:
-
-```bash
-$ bun create <template> # an official template (remote)
-$ bun create <username>/<repo> # a GitHub repo (remote)
-$ bun create <local-template> # a custom template (local)
-```
-
-Running `bun create` performs the following steps:
-
-- Download the template (remote templates only)
-- Copy all template files into the destination folder. By default Bun will _not overwrite_ any existing files. Use the `--force` flag to overwrite existing files.
-- Install dependencies with `bun install`.
-- Initialize a fresh Git repo. Opt out with the `--no-git` flag.
-- Run the template's configured `start` script, if defined.
-
-<!-- ## Official templates
-
-The following official templates are available.
-
-```bash
-bun create next ./myapp
-bun create react ./myapp
-bun create svelte-kit ./myapp
-bun create elysia ./myapp
-bun create hono ./myapp
-bun create kingworld ./myapp
-```
-
-Each of these corresponds to a directory in the [bun-community/create-templates](https://github.com/bun-community/create-templates) repo. If you think a major framework is missing, please open a PR there. This list will change over time as additional examples are added. To see an up-to-date list, run `bun create` with no arguments.
-
-```bash
-$ bun create
-Welcome to bun! Create a new project by pasting any of the following:
- <list of templates>
-```
-
-{% callout %}
-⚡️ **Speed** — At the time of writing, `bun create react app` runs ~11x faster on a M1 Macbook Pro than `yarn create react-app app`.
-{% /callout %} -->
-
-## GitHub repos
-
-A template of the form `<username>/<repo>` will be downloaded from GitHub.
-
-```bash
-$ bun create ahfarmer/calculator ./myapp
-```
-
-Complete GitHub URLs will also work:
-
-```bash
-$ bun create github.com/ahfarmer/calculator ./myapp
-$ bun create https://github.com/ahfarmer/calculator ./myapp
-```
-
-Bun installs the files as they currently exist current default branch (usually `main`). Unlike `git clone` it doesn't download the commit history or configure a remote.
-
-## Local templates
-
-{% callout %}
-**⚠️ Warning** — Unlike remote templates, running `bun create` with a local template will delete the entire destination folder if it already exists! Be careful.
-{% /callout %}
-Bun's templater can be extended to support custom templates defined on your local file system. These templates should live in one of the following directories:
-
-- `$HOME/.bun-create/<name>`: global templates
-- `<project root>/.bun-create/<name>`: project-specific templates
-
-{% callout %}
-**Note** — You can customize the global template path by setting the `BUN_CREATE_DIR` environment variable.
-{% /callout %}
-
-To create a local template, navigate to `$HOME/.bun-create` and create a new directory with the desired name of your template.
-
-```bash
-$ cd $HOME/.bun-create
-$ mkdir foo
-$ cd foo
-```
-
-Then, create a `package.json` file in that directory with the following contents:
-
-```json
-{
- "name": "foo"
-}
-```
-
-You can run `bun create foo` elsewhere on your file system to verify that Bun is correctly finding your local template.
-
-{% table %}
-
----
-
-- `postinstall`
-- runs after installing dependencies
-
----
-
-- `preinstall`
-- runs before installing dependencies
-
-<!-- ---
-
-- `start`
-- a command to auto-start the application -->
-
-{% /table %}
-
-Each of these can correspond to a string or array of strings. An array of commands will be executed in order. Here is an example:
-
-```json
-{
- "name": "@bun-examples/simplereact",
- "version": "0.0.1",
- "main": "index.js",
- "dependencies": {
- "react": "^17.0.2",
- "react-dom": "^17.0.2"
- },
- "bun-create": {
- "preinstall": "echo 'Installing...'", // a single command
- "postinstall": ["echo 'Done!'"], // an array of commands
- "start": "bun run echo 'Hello world!'"
- }
-}
-```
-
-When cloning a template, `bun create` will automatically remove the `"bun-create"` section from `package.json` before writing it to the destination folder.
-
-## Reference
-
-### CLI flags
-
-{% table %}
-
-- Flag
-- Description
-
----
-
-- `--force`
-- Overwrite existing files
-
----
-
-- `--no-install`
-- Skip installing `node_modules` & tasks
-
----
-
-- `--no-git`
-- Don’t initialize a git repository
-
----
-
-- `--open`
-- Start & open in-browser after finish
-
-{% /table %}
-
-### Environment variables
-
-{% table %}
-
-- Name
-- Description
-
----
-
-- `GITHUB_API_DOMAIN`
-- If you’re using a GitHub enterprise or a proxy, you can customize the GitHub domain Bun pings for downloads
-
----
-
-- `GITHUB_API_TOKEN`
-- This lets `bun create` work with private repositories or if you get rate-limited
-
-{% /table %}
-
-{% details summary="How `bun create` works" %}
-
-When you run `bun create ${template} ${destination}`, here’s what happens:
-
-IF remote template
-
-1. GET `registry.npmjs.org/@bun-examples/${template}/latest` and parse it
-2. GET `registry.npmjs.org/@bun-examples/${template}/-/${template}-${latestVersion}.tgz`
-3. Decompress & extract `${template}-${latestVersion}.tgz` into `${destination}`
-
- - If there are files that would overwrite, warn and exit unless `--force` is passed
-
-IF GitHub repo
-
-1. Download the tarball from GitHub’s API
-2. Decompress & extract into `${destination}`
-
- - If there are files that would overwrite, warn and exit unless `--force` is passed
-
-ELSE IF local template
-
-1. Open local template folder
-2. Delete destination directory recursively
-3. Copy files recursively using the fastest system calls available (on macOS `fcopyfile` and Linux, `copy_file_range`). Do not copy or traverse into `node_modules` folder if exists (this alone makes it faster than `cp`)
-
-4. Parse the `package.json` (again!), update `name` to be `${basename(destination)}`, remove the `bun-create` section from the `package.json` and save the updated `package.json` to disk.
- - IF Next.js is detected, add `bun-framework-next` to the list of dependencies
- - IF Create React App is detected, add the entry point in /src/index.{js,jsx,ts,tsx} to `public/index.html`
- - IF Relay is detected, add `bun-macro-relay` so that Relay works
-5. Auto-detect the npm client, preferring `pnpm`, `yarn` (v1), and lastly `npm`
-6. Run any tasks defined in `"bun-create": { "preinstall" }` with the npm client
-7. Run `${npmClient} install` unless `--no-install` is passed OR no dependencies are in package.json
-8. Run any tasks defined in `"bun-create": { "preinstall" }` with the npm client
-9. Run `git init; git add -A .; git commit -am "Initial Commit";`
-
- - Rename `gitignore` to `.gitignore`. NPM automatically removes `.gitignore` files from appearing in packages.
- - If there are dependencies, this runs in a separate thread concurrently while node_modules are being installed
- - Using libgit2 if available was tested and performed 3x slower in microbenchmarks
-
-{% /details %}
diff --git a/docs/cli/bun-init.md b/docs/cli/init.md
index bc51614e3..f17c8e1b7 100644
--- a/docs/cli/bun-init.md
+++ b/docs/cli/init.md
@@ -1,3 +1,27 @@
+Scaffold an empty Bun project with the interactive `bun init` command.
+
+```bash
+$ bun init
+bun init helps you get started with a minimal project and tries to
+guess sensible defaults. Press ^C anytime to quit.
+
+package name (quickstart):
+entry point (index.ts):
+
+Done! A package.json file was saved in the current directory.
+ + index.ts
+ + .gitignore
+ + tsconfig.json (for editor auto-complete)
+ + README.md
+
+To get started, run:
+ bun run index.ts
+```
+
+Press `enter` to accept the default answer for each prompt, or pass the `-y` flag to auto-accept the defaults.
+
+{% details summary="How `bun init` works" %}
+
`bun init` is a quick way to start a blank project with Bun. It guesses with sane defaults and is non-destructive when run multiple times.
![Demo](https://user-images.githubusercontent.com/709451/183006613-271960a3-ff22-4f7c-83f5-5e18f684c836.gif)
@@ -13,6 +37,4 @@ If you pass `-y` or `--yes`, it will assume you want to continue without asking
At the end, it runs `bun install` to install `bun-types`.
-#### How is `bun init` different than `bun create`?
-
-`bun init` is for blank projects. `bun create` applies templates.
+{% /details %}
diff --git a/docs/cli/install.md b/docs/cli/install.md
index a608a8950..573a6f106 100644
--- a/docs/cli/install.md
+++ b/docs/cli/install.md
@@ -23,43 +23,19 @@ sudo apt install --install-recommends linux-generic-hwe-20.04
{% /details %}
-## Manage dependencies
-
-### `bun install`
-
To install all dependencies of a project:
```bash
$ bun install
```
-On Linux, `bun install` tends to install packages 20-100x faster than `npm install`. On macOS, it's more like 4-80x.
-
-![package install benchmark](https://user-images.githubusercontent.com/709451/147004342-571b6123-17a9-49a2-8bfd-dcfc5204047e.png)
-
Running `bun install` will:
- **Install** all `dependencies`, `devDependencies`, and `optionalDependencies`. Bun does not install `peerDependencies` by default.
- **Run** your project's `{pre|post}install` and `{pre|post}prepare` scripts at the appropriate time. For security reasons Bun _does not execute_ lifecycle scripts of installed dependencies.
- **Write** a `bun.lockb` lockfile to the project root.
-To install in production mode (i.e. without `devDependencies`):
-
-```bash
-$ bun install --production
-```
-
-To install with reproducible dependencies, use `--frozen-lockfile`. If your `package.json` disagrees with `bun.lockb`, Bun will exit with an error. This is useful for production builds and CI environments.
-
-```bash
-$ bun install --frozen-lockfile
-```
-
-To perform a dry run (i.e. don't actually install anything):
-
-```bash
-$ bun install --dry-run
-```
+## Logging
To modify logging verbosity:
@@ -68,86 +44,59 @@ $ bun install --verbose # debug logging
$ bun install --silent # no logging
```
-{% details summary="Configuring behavior" %}
-The default behavior of `bun install` can be configured in `bun.toml`:
-
-```toml
-[install]
-
-# whether to install optionalDependencies
-optional = true
-
-# whether to install devDependencies
-dev = true
-
-# whether to install peerDependencies
-peer = false
-
-# equivalent to `--production` flag
-production = false
-
-# equivalent to `--frozen-lockfile` flag
-frozenLockfile = false
-
-# equivalent to `--dry-run` flag
-dryRun = false
-```
-
-{% /details %}
-
-### `bun add`
-
-To add a particular package:
-
-```bash
-$ bun add preact
-```
-
-To specify a version, version range, or tag:
+## Lifecycle scripts
-```bash
-$ bun add zod@3.20.0
-$ bun add zod@^3.0.0
-$ bun add zod@latest
-```
+Unlike other npm clients, Bun does not execute arbitrary lifecycle scripts like `postinstall` for installed dependencies. Executing arbitrary scripts represents a potential security risk.
-To add a package as a dev dependency (`"devDependencies"`):
+To tell Bun to allow lifecycle scripts for a particular package, add the package to `trustedDependencies` in your package.json.
-```bash
-$ bun add --dev @types/react
-$ bun add -d @types/react
+```json-diff
+ {
+ "name": "my-app",
+ "version": "1.0.0",
++ "trustedDependencies": ["my-trusted-package"]
+ }
```
-To add a package as an optional dependency (`"optionalDependencies"`):
+Then re-install the package. Bun will read this field and run lifecycle scripts for `my-trusted-package`.
-```bash
-$ bun add --optional lodash
-```
+## Workspaces
-To add a package and pin to the resolved version, use `--exact`. This will resolve the version of the package and add it to your `package.json` with an exact version number instead of a version range.
+Bun supports `"workspaces"` in package.json. For complete documentation refer to [Package manager > Workspaces](/docs/install/workspaces).
-```bash
-$ bun add react --exact
+```json#package.json
+{
+ "name": "my-app",
+ "version": "1.0.0",
+ "workspaces": ["packages/*"],
+ "dependencies": {
+ "preact": "^10.5.13"
+ }
+}
```
-This will add the following to your `package.json`:
+## Overrides and resolutions
-```jsonc
-{
- "dependencies": {
- // without --exact
- "react": "^18.2.0", // this matches >= 18.2.0 < 19.0.0
+Bun supports npm's `"overrides"` and Yarn's `"resolutions"` in `package.json`. These are mechanisms for specifying a version range for _metadependencies_—the dependencies of your dependencies. Refer to [Package manager > Overrides and resolutions](/docs/install/overrides) for complete documentation.
- // with --exact
- "react": "18.2.0" // this matches only 18.2.0 exactly
+```json-diff#package.json
+ {
+ "name": "my-app",
+ "dependencies": {
+ "foo": "^2.0.0"
+ },
++ "overrides": {
++ "bar": "~4.4.0"
++ }
}
-}
```
-To install a package globally:
+## Global packages
+
+To install a package globally, use the `-g`/`--global` flag. Typically this is used for installing command-line tools.
```bash
-$ bun add --global cowsay # or `bun add -g cowsay`
+$ bun install --global cowsay # or `bun install -g cowsay`
$ cowsay "Bun!"
______
< Bun! >
@@ -159,149 +108,75 @@ $ cowsay "Bun!"
|| ||
```
-{% details summary="Configuring global installation behavior" %}
-
-```toml
-[install]
-# where `bun install --global` installs packages
-globalDir = "~/.bun/install/global"
-
-# where globally-installed package bins are linked
-globalBinDir = "~/.bun/bin"
-```
+## Production mode
-{% /details %}
-To view a complete list of options for a given command:
+To install in production mode (i.e. without `devDependencies` or `optionalDependencies`):
```bash
-$ bun add --help
+$ bun install --production
```
-### `bun remove`
-
-To remove a dependency:
+For reproducible installs, use `--frozen-lockfile`. This will install the exact versions of each package specified in the lockfile. If your `package.json` disagrees with `bun.lockb`, Bun will exit with an error. The lockfile will not be updated.
```bash
-$ bun remove preact
+$ bun install --frozen-lockfile
```
-## Local packages (`bun link`)
-
-Use `bun link` in a local directory to register the current package as a "linkable" package.
-
-```bash
-$ cd /path/to/cool-pkg
-$ cat package.json
-{
- "name": "cool-pkg",
- "version": "1.0.0"
-}
-$ bun link
-bun link v1.x (7416672e)
-Success! Registered "cool-pkg"
-
-To use cool-pkg in a project, run:
- bun link cool-pkg
+For more information on Bun's binary lockfile `bun.lockb`, refer to [Package manager > Lockfile](/docs/install/lockfile).
-Or add it in dependencies in your package.json file:
- "cool-pkg": "link:cool-pkg"
-```
+## Dry run
-This package can now be "linked" into other projects using `bun link cool-pkg`. This will create a symlink in the `node_modules` directory of the target project, pointing to the local directory.
+To perform a dry run (i.e. don't actually install anything):
```bash
-$ cd /path/to/my-app
-$ bun link cool-pkg
-```
-
-In addition, the `--save` flag can be used to add `cool-pkg` to the `dependencies` field of your app's package.json with a special version specifier that tells Bun to load from the registered local directory instead of installing from `npm`:
-
-```json-diff
- {
- "name": "my-app",
- "version": "1.0.0",
- "dependencies": {
-+ "cool-pkg": "link:cool-pkg"
- }
- }
-```
-
-## Trusted dependencies
-
-Unlike other npm clients, Bun does not execute arbitrary lifecycle scripts for installed dependencies, such as `postinstall`. These scripts represent a potential security risk, as they can execute arbitrary code on your machine.
-
-<!-- Bun maintains an allow-list of popular packages containing `postinstall` scripts that are known to be safe. To run lifecycle scripts for packages that aren't on this list, add the package to `trustedDependencies` in your package.json. -->
-
-To tell Bun to allow lifecycle scripts for a particular package, add the package to `trustedDependencies` in your package.json.
-
-<!-- ```json-diff
- {
- "name": "my-app",
- "version": "1.0.0",
-+ "trustedDependencies": {
-+ "my-trusted-package": "*"
-+ }
- }
-``` -->
-
-```json-diff
- {
- "name": "my-app",
- "version": "1.0.0",
-+ "trustedDependencies": ["my-trusted-package"]
- }
+$ bun install --dry-run
```
-Bun reads this field and will run lifecycle scripts for `my-trusted-package`.
-
-<!-- If you specify a version range, Bun will only execute lifecycle scripts if the resolved package version matches the range. -->
-<!--
-```json
-{
- "name": "my-app",
- "version": "1.0.0",
- "trustedDependencies": {
- "my-trusted-package": "^1.0.0"
- }
-}
-``` -->
-
-## Git dependencies
+## Non-npm dependencies
-To add a dependency from a git repository:
+Bun supports installing dependencies from Git, GitHub, and local or remotely-hosted tarballs. For complete documentation refer to [Package manager > Git, GitHub, and tarball dependencies](/docs/cli/add).
-```bash
-$ bun install git@github.com:moment/moment.git
-```
-
-Bun supports a variety of protocols, including [`github`](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#github-urls), [`git`](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#git-urls-as-dependencies), `git+ssh`, `git+https`, and many more.
-
-```json
+```json#package.json
{
"dependencies": {
"dayjs": "git+https://github.com/iamkun/dayjs.git",
"lodash": "git+ssh://github.com/lodash/lodash.git#4.17.21",
"moment": "git@github.com:moment/moment.git",
- "zod": "github:colinhacks/zod"
+ "zod": "github:colinhacks/zod",
+ "react": "https://registry.npmjs.org/react/-/react-18.2.0.tgz"
}
}
```
-## Tarball dependencies
+## Configuration
-A package name can correspond to a publically hosted `.tgz` file. During `bun install`, Bun will download and install the package from the specified tarball URL, rather than from the package registry.
+The default behavior of `bun install` can be configured in `bunfig.toml`. The default values are shown below.
-```json#package.json
-{
- "dependencies": {
- "zod": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz"
- }
-}
+```toml
+[install]
+
+# whether to install optionalDependencies
+optional = true
+
+# whether to install devDependencies
+dev = true
+
+# whether to install peerDependencies
+peer = false
+
+# equivalent to `--production` flag
+production = false
+
+# equivalent to `--frozen-lockfile` flag
+frozenLockfile = false
+
+# equivalent to `--dry-run` flag
+dryRun = false
```
## CI/CD
-Looking to speed up your CI? Use the official `oven-sh/setup-bun` action to install `bun` in a GitHub Actions pipeline.
+Looking to speed up your CI? Use the official [`oven-sh/setup-bun`](https://github.com/oven-sh/setup-bun) action to install `bun` in a GitHub Actions pipeline.
```yaml#.github/workflows/release.yml
name: bun-types
diff --git a/docs/cli/link.md b/docs/cli/link.md
new file mode 100644
index 000000000..9adc73765
--- /dev/null
+++ b/docs/cli/link.md
@@ -0,0 +1,46 @@
+Use `bun link` in a local directory to register the current package as a "linkable" package.
+
+```bash
+$ cd /path/to/cool-pkg
+$ cat package.json
+{
+ "name": "cool-pkg",
+ "version": "1.0.0"
+}
+$ bun link
+bun link v1.x (7416672e)
+Success! Registered "cool-pkg"
+
+To use cool-pkg in a project, run:
+ bun link cool-pkg
+
+Or add it in dependencies in your package.json file:
+ "cool-pkg": "link:cool-pkg"
+```
+
+This package can now be "linked" into other projects using `bun link cool-pkg`. This will create a symlink in the `node_modules` directory of the target project, pointing to the local directory.
+
+```bash
+$ cd /path/to/my-app
+$ bun link cool-pkg
+```
+
+In addition, the `--save` flag can be used to add `cool-pkg` to the `dependencies` field of your app's package.json with a special version specifier that tells Bun to load from the registered local directory instead of installing from `npm`:
+
+```json-diff
+ {
+ "name": "my-app",
+ "version": "1.0.0",
+ "dependencies": {
++ "cool-pkg": "link:cool-pkg"
+ }
+ }
+```
+
+To _unregister_ a local package, navigate to the package's root directory and run `bun unlink`.
+
+```bash
+$ cd /path/to/cool-pkg
+$ bun unlink
+bun unlink v1.x (7416672e)
+```
diff --git a/docs/install/utilities.md b/docs/cli/pm.md
index 689f177d8..689f177d8 100644
--- a/docs/install/utilities.md
+++ b/docs/cli/pm.md
diff --git a/docs/cli/remove.md b/docs/cli/remove.md
new file mode 100644
index 000000000..8054711d3
--- /dev/null
+++ b/docs/cli/remove.md
@@ -0,0 +1,5 @@
+To remove a dependency:
+
+```bash
+$ bun remove ts-node
+```
diff --git a/docs/cli/run.md b/docs/cli/run.md
index 65c4842cc..c710e4f73 100644
--- a/docs/cli/run.md
+++ b/docs/cli/run.md
@@ -1,5 +1,28 @@
The `bun` CLI can be used to execute JavaScript/TypeScript files, `package.json` scripts, and [executable packages](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#bin).
+## Performance
+
+Bun is designed to start fast and run fast.
+
+Under the hood Bun uses the [JavaScriptCore engine](https://developer.apple.com/documentation/javascriptcore), which is developed by Apple for Safari. In most cases, the startup and running performance is faster than V8, the engine used by Node.js and Chromium-based browsers. Its transpiler and runtime are written in Zig, a modern, high-performance language. On Linux, this translates into startup times [4x faster](https://twitter.com/jarredsumner/status/1499225725492076544) than Node.js.
+
+{% table %}
+
+---
+
+- `bun hello.js`
+- `5.2ms`
+
+---
+
+- `node hello.js`
+- `25.1ms`
+
+{% /table %}
+{% caption content="Running a simple Hello World script on Linux" /%}
+
+<!-- {% image src="/images/bun-run-speed.jpeg" caption="Bun vs Node.js vs Deno running Hello World" /%} -->
+
<!-- ## Speed -->
<!--
@@ -26,10 +49,11 @@ $ bun run index.ts
$ bun run index.tsx
```
-The "naked" `bun` command is equivalent to `bun run`.
+Alternatively, you can omit the `run` keyword and use the "naked" command; it behaves identically.
```bash
$ bun index.tsx
+$ bun index.js
```
### `--watch`
@@ -40,6 +64,17 @@ To run a file in watch mode, use the `--watch` flag.
$ bun --watch run index.tsx
```
+{% callout %}
+**Note** — When using `bun run`, put Bun flags like `--watch` immediately after `bun`.
+
+```bash
+$ bun --watch run dev # ✔️ do this
+$ bun run dev --watch # ❌ don't do this
+```
+
+Flags that occur at the end of the command will be ignored and passed through to the `"dev"` script itself.
+{% /callout %}
+
### `--smol`
In memory-constrained environments, use the `--smol` flag to reduce memory usage at a cost to performance.
@@ -54,6 +89,10 @@ $ bun --smol run index.tsx
Compare to `npm run <script>` or `yarn <script>`
{% /note %}
+```sh
+$ bun [bun flags] run <script> [script flags]
+```
+
Your `package.json` can define a number of named `"scripts"` that correspond to shell commands.
```jsonc
@@ -66,10 +105,10 @@ Your `package.json` can define a number of named `"scripts"` that correspond to
}
```
-Use `bun <script>` to execute these scripts.
+Use `bun run <script>` to execute these scripts.
```bash
-$ bun clean
+$ bun run clean
$ rm -rf dist && echo 'Done.'
Cleaning...
Done.
@@ -104,22 +143,18 @@ quickstart scripts:
Bun respects lifecycle hooks. For instance, `bun run clean` will execute `preclean` and `postclean`, if defined. If the `pre<script>` fails, Bun will not execute the script itself.
-## Environment variables
+### `--bun`
-Bun automatically loads environment variables from `.env` files before running a file, script, or executable. The following files are checked, in order:
+It's common for `package.json` scripts to reference locally-installed CLIs like `vite` or `next`. These CLIs are often JavaScript files marked with a [shebang](<https://en.wikipedia.org/wiki/Shebang_(Unix)>) to indicate that they should be executed with `node`.
-1. `.env.local` (first)
-2. `NODE_ENV` === `"production"` ? `.env.production` : `.env.development`
-3. `.env`
+```js
+#!/usr/bin/env node
-To debug environment variables, run `bun run env` to view a list of resolved environment variables.
-
-## Performance
-
-Bun is designed to start fast and run fast.
-
-Under the hood Bun uses the [JavaScriptCore engine](https://developer.apple.com/documentation/javascriptcore), which is developed by Apple for Safari. In most cases, the startup and running performance is faster than V8, the engine used by Node.js and Chromium-based browsers. Its transpiler and runtime are written in Zig, a modern, high-performance language. On Linux, this translates into startup times [4x faster](https://twitter.com/jarredsumner/status/1499225725492076544) than Node.js.
+// do stuff
+```
-{% image src="/images/bun-run-speed.jpeg" caption="Bun vs Node.js vs Deno running Hello World" /%}
+By default, Bun respects this shebang and executes the script with `node`. However, you can override this behavior with the `--bun` flag. For Node.js-based CLIs, this will run the CLI with Bun instead of Node.js.
-<!-- If no `node_modules` directory is found in the working directory or above, Bun will abandon Node.js-style module resolution in favor of the `Bun module resolution algorithm`. Under Bun-style module resolution, all packages are _auto-installed_ on the fly into a [global module cache](/docs/install/cache). For full details on this algorithm, refer to [Runtime > Modules](/docs/runtime/modules). -->
+```bash
+$ bun run --bun vite
+```
diff --git a/docs/cli/test.md b/docs/cli/test.md
index dfe78c45b..d505cd6a8 100644
--- a/docs/cli/test.md
+++ b/docs/cli/test.md
@@ -1,4 +1,4 @@
-Bun ships with a fast built-in test runner. Tests are executed with the Bun runtime, and support the following features.
+Bun ships with a fast, built-in, Jest-compatible test runner. Tests are executed with the Bun runtime, and support the following features.
- TypeScript and JSX
- Lifecycle hooks
@@ -7,6 +7,10 @@ Bun ships with a fast built-in test runner. Tests are executed with the Bun runt
- Watch mode with `--watch`
- Script pre-loading with `--preload`
+{% callout %}
+Bun aims for compatibility with Jest, but not everything is implemented. To track compatibility, see [this tracking issue](https://github.com/oven-sh/bun/issues/1825).
+{% /callout %}
+
## Run tests
```bash
@@ -103,7 +107,11 @@ See [Test > Lifecycle](/docs/test/lifecycle) for complete documentation.
## Mocks
-Create mocks with the `mock` function. Mocks are automatically reset between tests.
+{% callout %}
+Module mocking (`jest.mock()`) is not yet supported. Track support for it [here](https://github.com/oven-sh/bun/issues/5394).
+{% /callout %}
+
+Create mock functions with the `mock` function. Mocks are automatically reset between tests.
```ts
import { test, expect, mock } from "bun:test";
@@ -117,11 +125,38 @@ test("random", async () => {
});
```
+Alternatively, you can use `jest.fn()`, it behaves identically.
+
+```ts-diff
+- import { test, expect, mock } from "bun:test";
++ import { test, expect, jest } from "bun:test";
+
+- const random = mock(() => Math.random());
++ const random = jest.fn(() => Math.random());
+```
+
See [Test > Mocks](/docs/test/mocks) for complete documentation.
## Snapshot testing
-Snapshots are supported by `bun test`. See [Test > Snapshots](/docs/test/snapshots) for complete documentation.
+Snapshots are supported by `bun test`.
+
+```ts
+// example usage of toMatchSnapshot
+import { test, expect } from "bun:test";
+
+test("snapshot", async () => {
+ expect({ a: 1 }).toMatchSnapshot();
+});
+```
+
+To update snapshots, use the `--update-snapshots` flag.
+
+```sh
+$ bun test --update-snapshots
+```
+
+See [Test > Snapshots](/docs/test/snapshots) for complete documentation.
## UI & DOM testing
diff --git a/docs/cli/update.md b/docs/cli/update.md
new file mode 100644
index 000000000..dfda37f01
--- /dev/null
+++ b/docs/cli/update.md
@@ -0,0 +1,7 @@
+To update all dependencies to the latest version _that's compatible with the version range specified in your `package.json`_:
+
+```sh
+$ bun update
+```
+
+This will not edit your `package.json`. There's currently no command to force-update all dependencies to the latest version regardless version ranges.
diff --git a/docs/dev/css.md b/docs/dev/css.md
index a74f5d1ea..53ebc6c06 100644
--- a/docs/dev/css.md
+++ b/docs/dev/css.md
@@ -49,7 +49,7 @@ This is useful for preventing flash of unstyled content.
## With `bun bun`
-Bun bundles `.css` files imported via `@import` into a single file. It doesn’t autoprefix or minify CSS today. Multiple `.css` files imported in one JavaScript file will _not_ be bundled into one file. You’ll have to import those from a `.css` file.
+Bun bundles `.css` files imported via `@import` into a single file. It doesn’t auto-prefix or minify CSS today. Multiple `.css` files imported in one JavaScript file will _not_ be bundled into one file. You’ll have to import those from a `.css` file.
This input:
diff --git a/docs/dev/frameworks.md b/docs/dev/frameworks.md
deleted file mode 100644
index 9af7fc45b..000000000
--- a/docs/dev/frameworks.md
+++ /dev/null
@@ -1,151 +0,0 @@
-{% callout %}
-**Warning** — This will soon have breaking changes. It was designed when Bun was mostly a dev server and not a JavaScript runtime.
-{% /callout %}
-
-Frameworks preconfigure Bun to enable developers to use Bun with their existing tooling.
-
-Frameworks are configured via the `framework` object in the `package.json` of the framework (not in the application’s `package.json`):
-
-Here is an example:
-
-```json
-{
- "name": "bun-framework-next",
- "version": "0.0.0-18",
- "description": "",
- "framework": {
- "displayName": "Next.js",
- "static": "public",
- "assetPrefix": "_next/",
- "router": {
- "dir": ["pages", "src/pages"],
- "extensions": [".js", ".ts", ".tsx", ".jsx"]
- },
- "css": "onimportcss",
- "development": {
- "client": "client.development.tsx",
- "fallback": "fallback.development.tsx",
- "server": "server.development.tsx",
- "css": "onimportcss",
- "define": {
- "client": {
- ".env": "NEXT_PUBLIC_",
- "defaults": {
- "process.env.__NEXT_TRAILING_SLASH": "false",
- "process.env.NODE_ENV": "\"development\"",
- "process.env.__NEXT_ROUTER_BASEPATH": "''",
- "process.env.__NEXT_SCROLL_RESTORATION": "false",
- "process.env.__NEXT_I18N_SUPPORT": "false",
- "process.env.__NEXT_HAS_REWRITES": "false",
- "process.env.__NEXT_ANALYTICS_ID": "null",
- "process.env.__NEXT_OPTIMIZE_CSS": "false",
- "process.env.__NEXT_CROSS_ORIGIN": "''",
- "process.env.__NEXT_STRICT_MODE": "false",
- "process.env.__NEXT_IMAGE_OPTS": "null"
- }
- },
- "server": {
- ".env": "NEXT_",
- "defaults": {
- "process.env.__NEXT_TRAILING_SLASH": "false",
- "process.env.__NEXT_OPTIMIZE_FONTS": "false",
- "process.env.NODE_ENV": "\"development\"",
- "process.env.__NEXT_OPTIMIZE_IMAGES": "false",
- "process.env.__NEXT_OPTIMIZE_CSS": "false",
- "process.env.__NEXT_ROUTER_BASEPATH": "''",
- "process.env.__NEXT_SCROLL_RESTORATION": "false",
- "process.env.__NEXT_I18N_SUPPORT": "false",
- "process.env.__NEXT_HAS_REWRITES": "false",
- "process.env.__NEXT_ANALYTICS_ID": "null",
- "process.env.__NEXT_CROSS_ORIGIN": "''",
- "process.env.__NEXT_STRICT_MODE": "false",
- "process.env.__NEXT_IMAGE_OPTS": "null",
- "global": "globalThis",
- "window": "undefined"
- }
- }
- }
- }
- }
-}
-```
-
-Here are type definitions:
-
-```ts
-type Framework = Environment & {
- // This changes what’s printed in the console on load
- displayName?: string;
-
- // This allows a prefix to be added (and ignored) to requests.
- // Useful for integrating an existing framework that expects internal routes to have a prefix
- // e.g. "_next"
- assetPrefix?: string;
-
- development?: Environment;
- production?: Environment;
-
- // The directory used for serving unmodified assets like fonts and images
- // Defaults to "public" if exists, else "static", else disabled.
- static?: string;
-
- // "onimportcss" disables the automatic "onimportcss" feature
- // If the framework does routing, you may want to handle CSS manually
- // "facade" removes CSS imports from JavaScript files,
- // and replaces an imported object with a proxy that mimics CSS module support without doing any class renaming.
- css?: "onimportcss" | "facade";
-
- // Bun's filesystem router
- router?: Router;
-};
-
-type Define = {
- // By passing ".env", Bun will automatically load .env.local, .env.development, and .env if exists in the project root
- // (in addition to the processes’ environment variables)
- // When "*", all environment variables will be automatically injected into the JavaScript loader
- // When a string like "NEXT_PUBLIC_", only environment variables starting with that prefix will be injected
-
- ".env": string | "*";
-
- // These environment variables will be injected into the JavaScript loader
- // These are the equivalent of Webpack’s resolve.alias and esbuild’s --define.
- // Values are parsed as JSON, so they must be valid JSON. The only exception is '' is a valid string, to simplify writing stringified JSON in JSON.
- // If not set, `process.env.NODE_ENV` will be transformed into "development".
- "defaults": Record<string, string>;
-};
-
-type Environment = {
- // This is a wrapper for the client-side entry point for a route.
- // This allows frameworks to run initialization code on pages.
- client: string;
- // This is a wrapper for the server-side entry point for a route.
- // This allows frameworks to run initialization code on pages.
- server: string;
- // This runs when "server" code fails to load due to an exception.
- fallback: string;
-
- // This is how environment variables and .env is configured.
- define?: Define;
-};
-
-// Bun's filesystem router
-// Currently, Bun supports pages by either an absolute match or a parameter match.
-// pages/index.tsx will be executed on navigation to "/" and "/index"
-// pages/posts/[id].tsx will be executed on navigation to "/posts/123"
-// Routes & parameters are automatically passed to `fallback` and `server`.
-type Router = {
- // This determines the folder to look for pages
- dir: string[];
-
- // These are the allowed file extensions for pages.
- extensions?: string[];
-};
-```
-
-To use a framework, you pass `bun bun --use package-name`.
-
-Your framework’s `package.json` `name` should start with `bun-framework-`. This is so that people can type something like `bun bun --use next` and it will check `bun-framework-next` first. This is similar to how Babel plugins tend to start with `babel-plugin-`.
-
-For developing frameworks, you can also do `bun bun --use ./relative-path-to-framework`.
-
-If you’re interested in adding a framework integration, please reach out. There’s a lot here, and it’s not entirely documented yet.
diff --git a/docs/dev/nextjs.md b/docs/dev/nextjs.md
deleted file mode 100644
index 92849c989..000000000
--- a/docs/dev/nextjs.md
+++ /dev/null
@@ -1,33 +0,0 @@
-To create a new Next.js app with bun:
-
-```bash
-$ bun create next ./app
-$ cd app
-$ bun dev # start dev server
-```
-
-To use an existing Next.js app with bun:
-
-```bash
-$ bun add bun-framework-next
-$ echo "framework = 'next'" > bunfig.toml
-$ bun bun # bundle dependencies
-$ bun dev # start dev server
-```
-
-Many of Next.js’ features are supported, but not all.
-
-Here’s what doesn’t work yet:
-
-- `getStaticPaths`
-- same-origin `fetch` inside of `getStaticProps` or `getServerSideProps`
-- locales, zones, `assetPrefix` (workaround: change `--origin \"http://localhost:3000/assetPrefixInhere\"`)
-- `next/image` is polyfilled to a regular `<img src>` tag.
-- `proxy` and anything else in `next.config.js`
-- API routes, middleware (middleware is easier to support, though! Similar SSR API)
-- styled-jsx (technically not Next.js, but often used with it)
-- React Server Components
-
-When using Next.js, Bun automatically reads configuration from `.env.local`, `.env.development` and `.env` (in that order). `process.env.NEXT_PUBLIC_` and `process.env.NEXT_` automatically are replaced via `--define`.
-
-Currently, any time you import new dependencies from `node_modules`, you will need to re-run `bun bun --use next`. This will eventually be automatic.
diff --git a/docs/guides/binary/blob-to-stream.md b/docs/guides/binary/blob-to-stream.md
index 37a916ab3..ff2b3fbe0 100644
--- a/docs/guides/binary/blob-to-stream.md
+++ b/docs/guides/binary/blob-to-stream.md
@@ -2,7 +2,7 @@
name: Convert a Blob to a ReadableStream
---
-The [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) class provides a number of methods for consuming its contents in different formats, inluding `.stream()`. This returns `Promise<ReadableStream>`.
+The [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) class provides a number of methods for consuming its contents in different formats, including `.stream()`. This returns `Promise<ReadableStream>`.
```ts
const blob = new Blob(["hello world"]);
diff --git a/docs/guides/binary/blob-to-string.md b/docs/guides/binary/blob-to-string.md
index 05692c32e..0b334af66 100644
--- a/docs/guides/binary/blob-to-string.md
+++ b/docs/guides/binary/blob-to-string.md
@@ -2,7 +2,7 @@
name: Convert a Blob to a string
---
-The [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) class provides a number of methods for consuming its contents in different formats, inluding `.text()`.
+The [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) class provides a number of methods for consuming its contents in different formats, including `.text()`.
```ts
const blob = new Blob(["hello world"]);
diff --git a/docs/guides/ecosystem/astro.md b/docs/guides/ecosystem/astro.md
index 6a8a9fa5f..04be12012 100644
--- a/docs/guides/ecosystem/astro.md
+++ b/docs/guides/ecosystem/astro.md
@@ -2,15 +2,15 @@
name: Build an app with Astro and Bun
---
-Initialize a fresh Astro app with `bunx create-astro`. The `create-astro` package detects when you are using `bunx` and will automatically install dependencies using `bun`.
+Initialize a fresh Astro app with `bun create astro`. The `create-astro` package detects when you are using `bunx` and will automatically install dependencies using `bun`.
```sh
-$ bunx create-astro
+$ bun create astro
╭─────╮ Houston:
│ ◠ ◡ ◠ We're glad to have you on board.
╰─────╯
- astro v2.10.5 Launch sequence initiated.
+ astro v3.1.4 Launch sequence initiated.
dir Where should we create your new project?
./fumbling-field
@@ -55,21 +55,17 @@ By default, Bun will run the dev server with Node.js. To use the Bun runtime ins
```sh
$ bunx --bun astro dev
- 🚀 astro v2.10.5 started in 200ms
+ 🚀 astro v3.1.4 started in 200ms
- ┃ Local http://localhost:3000/
+ ┃ Local http://localhost:4321/
┃ Network use --host to expose
-
-01:48:34 PM [content] Watching src/content/ for changes
-01:48:34 PM [content] Types generated
-01:48:34 PM [astro] update /.astro/types.d.ts
```
---
-Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. Astro will hot-reload your app as you edit your source files.
+Open [http://localhost:4321](http://localhost:4321) with your browser to see the result. Astro will hot-reload your app as you edit your source files.
-{% image src="https://github.com/vitejs/vite/assets/3084745/bb1d5063-32f4-4598-b33e-50b44a1c4e8a" caption="An Astro starter app running on Bun" %}
+{% image src="https://i.imgur.com/Dswiu6w.png" caption="An Astro v3 starter app running on Bun" %}
---
diff --git a/docs/guides/ecosystem/discordjs.md b/docs/guides/ecosystem/discordjs.md
index 0a70f6f05..ec12a247d 100644
--- a/docs/guides/ecosystem/discordjs.md
+++ b/docs/guides/ecosystem/discordjs.md
@@ -74,4 +74,4 @@ Ready! Logged in as my-bot#1234
---
-You're up and running with a bare-bones Discord.js bot! This is a basic guide to setting up your bot with Bun; we recommend the [official Discord docs](https://discordjs.guide/) for complete information on the `discord.js` API.
+You're up and running with a bare-bones Discord.js bot! This is a basic guide to setting up your bot with Bun; we recommend the [official discord.js docs](https://discordjs.guide/) for complete information on the `discord.js` API.
diff --git a/docs/guides/ecosystem/docker.md b/docs/guides/ecosystem/docker.md
new file mode 100644
index 000000000..26a1eaccd
--- /dev/null
+++ b/docs/guides/ecosystem/docker.md
@@ -0,0 +1,140 @@
+---
+name: Containerize a Bun application with Docker
+---
+
+{% callout %}
+This guide assumes you already have [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed.
+{% /callout %}
+
+[Docker](https://www.docker.com) is a platform for packaging and running an application as a lightweight, portable _container_ that encapsulates all the necessary dependencies.
+
+---
+
+To _containerize_ our application, we define a `Dockerfile`. This file contains a list of instructions to initialize the container, copy our local project files into it, install dependencies, and starts the application.
+
+```docker#Dockerfile
+# use the official Bun image
+# see all versions at https://hub.docker.com/r/oven/bun/tags
+FROM oven/bun:1 as base
+WORKDIR /usr/src/app
+
+# install dependencies into temp directory
+# this will cache them and speed up future builds
+FROM base AS install
+RUN mkdir -p /temp/dev
+COPY package.json bun.lockb /temp/dev/
+RUN cd /temp/dev && bun install --frozen-lockfile
+
+# install with --production (exclude devDependencies)
+RUN mkdir -p /temp/prod
+COPY package.json bun.lockb /temp/prod/
+RUN cd /temp/prod && bun install --frozen-lockfile --production
+
+# copy node_modules from temp directory
+# then copy all (non-ignored) project files into the image
+FROM install AS prerelease
+COPY --from=install /temp/dev/node_modules node_modules
+COPY . .
+
+# [optional] tests & build
+ENV NODE_ENV=production
+RUN bun test
+RUN bun run build
+
+# copy production dependencies and source code into final image
+FROM base AS release
+COPY --from=install /temp/prod/node_modules node_modules
+COPY --from=prerelease /usr/src/app/index.ts .
+COPY --from=prerelease /usr/src/app/package.json .
+
+# run the app
+USER bun
+EXPOSE 3000/tcp
+ENTRYPOINT [ "bun", "run", "index.ts" ]
+```
+
+---
+
+Now that you have your docker image, let's look at `.dockerignore` which has the same syntax as `.gitignore`, here you need to specify the files/directories that must not go in any stage of the docker build. An example for a ignore file is
+
+```txt#.dockerignore
+node_modules
+Dockerfile*
+docker-compose*
+.dockerignore
+.git
+.gitignore
+README.md
+LICENSE
+.vscode
+Makefile
+helm-charts
+.env
+.editorconfig
+.idea
+coverage*
+```
+
+---
+
+We'll now use `docker build` to convert this `Dockerfile` into a _Docker image_, is a self-contained template containing all the dependencies and configuration required to run the application.
+
+The `-t` flag lets us specify a name for the image, and `--pull` tells Docker to automatically download the latest version of the base image (`oven/bun`). The initial build will take longer, as Docker will download all the base images and dependencies.
+
+```bash
+$ docker build --pull -t bun-hello-world .
+[+] Building 0.9s (21/21) FINISHED
+ => [internal] load build definition from Dockerfile 0.0s
+ => => transferring dockerfile: 37B 0.0s
+ => [internal] load .dockerignore 0.0s
+ => => transferring context: 35B 0.0s
+ => [internal] load metadata for docker.io/oven/bun:1 0.8s
+ => [auth] oven/bun:pull token for registry-1.docker.io 0.0s
+ => [base 1/2] FROM docker.io/oven/bun:1@sha256:373265748d3cd3624cb3f3ee6004f45b1fc3edbd07a622aeeec17566d2756997 0.0s
+ => [internal] load build context 0.0s
+ => => transferring context: 155B 0.0s
+ # ...lots of commands...
+ => exporting to image 0.0s
+ => => exporting layers 0.0s
+ => => writing image sha256:360663f7fdcd6f11e8e94761d5592e2e4dfc8d167f034f15cd5a863d5dc093c4 0.0s
+ => => naming to docker.io/library/bun-hello-world 0.0s
+```
+
+---
+
+We've built a new _Docker image_. Now let's use that image to spin up an actual, running _container_.
+
+We'll use `docker run` to start a new container using the `bun-hello-world` image. It will be run in _detached_ mode (`-d`) and we'll map the container's port 3000 to our local machine's port 3000 (`-p 3000:3000`).
+
+The `run` command prints a string representing the _container ID_.
+
+```sh
+$ docker run -d -p 3000:3000 bun-hello-world
+7f03e212a15ede8644379bce11a13589f563d3909a9640446c5bbefce993678d
+```
+
+---
+
+The container is now running in the background. Visit [localhost:3000](http://localhost:3000). You should see a `Hello, World!` message.
+
+---
+
+To stop the container, we'll use `docker stop <container-id>`.
+
+```sh
+$ docker stop 7f03e212a15ede8644379bce11a13589f563d3909a9640446c5bbefce993678d
+```
+
+---
+
+If you can't find the container ID, you can use `docker ps` to list all running containers.
+
+```sh
+$ docker ps
+CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
+7f03e212a15e bun-hello-world "bun run index.ts" 2 minutes ago Up 2 minutes 0.0.0.0:3000->3000/tcp flamboyant_cerf
+```
+
+---
+
+That's it! Refer to the [Docker documentation](https://docs.docker.com/) for more advanced usage.
diff --git a/docs/guides/ecosystem/elysia.md b/docs/guides/ecosystem/elysia.md
index ae1a8e37b..019686a63 100644
--- a/docs/guides/ecosystem/elysia.md
+++ b/docs/guides/ecosystem/elysia.md
@@ -21,7 +21,7 @@ const app = new Elysia()
.get('/', () => 'Hello Elysia')
.listen(8080)
-console.log(`🦊 Elysia is running at on port ${app.server.port}...`)
+console.log(`🦊 Elysia is running at on port ${app.server?.port}...`)
```
---
diff --git a/docs/guides/ecosystem/hono.md b/docs/guides/ecosystem/hono.md
index 6d928a655..df662973d 100644
--- a/docs/guides/ecosystem/hono.md
+++ b/docs/guides/ecosystem/hono.md
@@ -18,7 +18,7 @@ export default app;
Use `create-hono` to get started with one of Hono's project templates. Select `bun` when prompted for a template.
```bash
-$ bunx create-hono myapp
+$ bun create hono myapp
✔ Which template do you want to use? › bun
cloned honojs/starter#main to /path/to/myapp
✔ Copied project files
diff --git a/docs/guides/ecosystem/nextjs.md b/docs/guides/ecosystem/nextjs.md
index a455eb23e..d8bf337c2 100644
--- a/docs/guides/ecosystem/nextjs.md
+++ b/docs/guides/ecosystem/nextjs.md
@@ -3,7 +3,7 @@ name: Build an app with Next.js and Bun
---
{% callout %}
-Next.js currently relies on Node.js APIs that Bun does not yet implement. The guide below uses Bun to initialize a project and install dependencies, but it uses Node.js to run the dev server.
+The Next.js [App Router](https://nextjs.org/docs/app) currently relies on Node.js APIs that Bun does not yet implement. The guide below uses Bun to initialize a project and install dependencies, but it uses Node.js to run the dev server.
{% /callout %}
---
@@ -11,7 +11,7 @@ Next.js currently relies on Node.js APIs that Bun does not yet implement. The gu
Initialize a Next.js app with `create-next-app`. This automatically installs dependencies using `npm`.
```sh
-$ bunx create-next-app
+$ bun create next-app
✔ What is your project named? … my-app
✔ Would you like to use TypeScript with this project? … No / Yes
✔ Would you like to use ESLint with this project? … No / Yes
@@ -23,7 +23,16 @@ Creating a new Next.js app in /path/to/my-app.
---
-To start the dev server, run `bun run dev` from the project root.
+To start the dev server with Bun, run `bun --bun run dev` from the project root.
+
+```sh
+$ cd my-app
+$ bun --bun run dev
+```
+
+---
+
+To run the dev server with Node.js instead, omit `--bun`.
```sh
$ cd my-app
@@ -32,4 +41,4 @@ $ bun run dev
---
-Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. Any changes you make to `pages/index.tsx` will be hot-reloaded in the browser.
+Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. Any changes you make to `(pages/app)/index.tsx` will be hot-reloaded in the browser.
diff --git a/docs/guides/ecosystem/nuxt.md b/docs/guides/ecosystem/nuxt.md
index c86029dc2..ca42c765b 100644
--- a/docs/guides/ecosystem/nuxt.md
+++ b/docs/guides/ecosystem/nuxt.md
@@ -22,7 +22,7 @@ bun install v1.x (16b4bf34)
---
-To start the dev server, run `bun run dev` from the project root. This will execute the `nuxt dev` command (as defined in the `"dev"` script in `package.json`).
+To start the dev server, run `bun --bun run dev` from the project root. This will execute the `nuxt dev` command (as defined in the `"dev"` script in `package.json`).
{% callout %}
The `nuxt` CLI uses Node.js by default; passing the `--bun` flag forces the dev server to use the Bun runtime instead.
diff --git a/docs/guides/ecosystem/pm2.md b/docs/guides/ecosystem/pm2.md
new file mode 100644
index 000000000..c775c8ca3
--- /dev/null
+++ b/docs/guides/ecosystem/pm2.md
@@ -0,0 +1,54 @@
+---
+name: Run Bun as a daemon with PM2
+---
+
+[PM2](https://pm2.keymetrics.io/) is a popular process manager that manages and runs your applications as daemons (background processes).
+
+It offers features like process monitoring, automatic restarts, and easy scaling. Using a process manager is common when deploying a Bun application on a cloud-hosted virtual private server (VPS), as it:
+
+- Keeps your Node.js application running continuously.
+- Ensure high availability and reliability of your application.
+- Monitor and manage multiple processes with ease.
+- Simplify the deployment process.
+
+---
+
+You can use PM2 with Bun in two ways: as a CLI option or in a configuration file.
+
+### With `--interpreter`
+
+---
+
+To start your application with PM2 and Bun as the interpreter, open your terminal and run the following command:
+
+```bash
+pm2 start --interpreter ~/.bun/bin/bun index.ts
+```
+
+---
+
+### With a configuration file
+
+---
+
+Alternatively, you can create a PM2 configuration file. Create a file named `pm2.config.js` in your project directory and add the following content.
+
+```javascript
+module.exports = {
+ name: "app", // Name of your application
+ script: "index.ts", // Entry point of your application
+ interpreter: "~/.bun/bin/bun", // Path to the Bun interpreter
+};
+```
+
+---
+
+After saving the file, you can start your application with PM2
+
+```bash
+pm2 start pm2.config.js
+```
+
+---
+
+That’s it! Your JavaScript/TypeScript web server is now running as a daemon with PM2 using Bun as the interpreter.
diff --git a/docs/guides/ecosystem/prisma.md b/docs/guides/ecosystem/prisma.md
index e697e2133..af83a47e4 100644
--- a/docs/guides/ecosystem/prisma.md
+++ b/docs/guides/ecosystem/prisma.md
@@ -2,20 +2,26 @@
name: Get started using Prisma
---
+{% callout %}
+**Note** — At the moment Prisma needs Node.js to be installed to run certain generation code. Make sure Node.js is installed in the environment where you're running `bunx prisma` commands.
+{% /callout %}
+
+---
+
Prisma works out of the box with Bun. First, create a directory and initialize it with `bun init`.
```bash
-mkdir prisma-app
-cd prisma-app
-bun init
+$ mkdir prisma-app
+$ cd prisma-app
+$ bun init
```
---
-Then add Prisma as a dependency.
+Then install the Prisma CLI (`prisma`) and Prisma Client (`@prisma/client`) as dependencies.
```bash
-bun add prisma
+$ bun add prisma @prisma/client
```
---
@@ -23,7 +29,7 @@ bun add prisma
We'll use the Prisma CLI with `bunx` to initialize our schema and migration directory. For simplicity we'll be using an in-memory SQLite database.
```bash
-bunx prisma init --datasource-provider sqlite
+$ bunx prisma init --datasource-provider sqlite
```
---
@@ -54,14 +60,37 @@ Then generate and run initial migration.
This will generate a `.sql` migration file in `prisma/migrations`, create a new SQLite instance, and execute the migration against the new instance.
```bash
-bunx prisma migrate dev --name init
+$ bunx prisma migrate dev --name init
+Environment variables loaded from .env
+Prisma schema loaded from prisma/schema.prisma
+Datasource "db": SQLite database "dev.db" at "file:./dev.db"
+
+SQLite database dev.db created at file:./dev.db
+
+Applying migration `20230928182242_init`
+
+The following migration(s) have been created and applied from new schema changes:
+
+migrations/
+ └─ 20230928182242_init/
+ └─ migration.sql
+
+Your database is now in sync with your schema.
+
+✔ Generated Prisma Client (v5.3.1) to ./node_modules/@prisma/client in 41ms
```
---
-Prisma automatically generates our _Prisma client_ whenever we execute a new migration. The client provides a fully typed API for reading and writing from our database.
+As indicated in the output, Prisma re-generates our _Prisma client_ whenever we execute a new migration. The client provides a fully typed API for reading and writing from our database. You can manually re-generate the client with the Prisma CLI.
+
+```sh
+$ bunx prisma generate
+```
+
+---
-It can be imported from `@prisma/client`.
+We can import the generated client from `@prisma/client`.
```ts#src/index.ts
import {PrismaClient} from "@prisma/client";
diff --git a/docs/guides/ecosystem/qwik.md b/docs/guides/ecosystem/qwik.md
new file mode 100644
index 000000000..45d3f9c1a
--- /dev/null
+++ b/docs/guides/ecosystem/qwik.md
@@ -0,0 +1,107 @@
+---
+name: Build an app with Qwik and Bun
+---
+
+Initialize a new Qwik app with `bunx create-qwik`.
+
+The `create-qwik` package detects when you are using `bunx` and will automatically install dependencies using `bun`.
+
+```sh
+$ bun create qwik
+
+ ............
+ .::: :--------:.
+ .:::: .:-------:.
+ .:::::. .:-------.
+ ::::::. .:------.
+ ::::::. :-----:
+ ::::::. .:-----.
+ :::::::. .-----.
+ ::::::::.. ---:.
+ .:::::::::. :-:.
+ ..::::::::::::
+ ...::::
+
+
+┌ Let's create a Qwik App ✨ (v1.2.10)
+│
+◇ Where would you like to create your new project? (Use '.' or './' for current directory)
+│ ./my-app
+│
+● Creating new project in /path/to/my-app ... 🐇
+│
+◇ Select a starter
+│ Basic App
+│
+◇ Would you like to install bun dependencies?
+│ Yes
+│
+◇ Initialize a new git repository?
+│ No
+│
+◇ Finishing the install. Wanna hear a joke?
+│ Yes
+│
+○ ────────────────────────────────────────────────────────╮
+│ │
+│ How do you know if there’s an elephant under your bed? │
+│ Your head hits the ceiling! │
+│ │
+├──────────────────────────────────────────────────────────╯
+│
+◇ App Created 🐰
+│
+◇ Installed bun dependencies 📋
+│
+○ Result ─────────────────────────────────────────────╮
+│ │
+│ Success! Project created in my-app directory │
+│ │
+│ Integrations? Add Netlify, Cloudflare, Tailwind... │
+│ bun qwik add │
+│ │
+│ Relevant docs: │
+│ https://qwik.builder.io/docs/getting-started/ │
+│ │
+│ Questions? Start the conversation at: │
+│ https://qwik.builder.io/chat │
+│ https://twitter.com/QwikDev │
+│ │
+│ Presentations, Podcasts and Videos: │
+│ https://qwik.builder.io/media/ │
+│ │
+│ Next steps: │
+│ cd my-app │
+│ bun start │
+│ │
+│ │
+├──────────────────────────────────────────────────────╯
+│
+└ Happy coding! 🎉
+
+```
+
+---
+
+Run `bun run dev` to start the development server.
+
+```sh
+$ bun run dev
+ $ vite--mode ssr
+
+ VITE v4.4.7 ready in 1190 ms
+
+ ➜ Local: http://localhost:5173/
+ ➜ Network: use --host to expose
+ ➜ press h to show help
+```
+
+---
+
+Open [http://localhost:5173](http://localhost:5173) with your browser to see the result. Qwik will hot-reload your app as you edit your source files.
+
+{% image src="https://github.com/oven-sh/bun/assets/3084745/ec35f2f7-03dd-4c90-851e-fb4ad150bb28" alt="Qwik screenshot" /%}
+
+---
+
+Refer to the [Qwik docs](https://qwik.builder.io/docs/getting-started/) for complete documentation.
diff --git a/docs/guides/ecosystem/react.md b/docs/guides/ecosystem/react.md
index b712e210e..f3c16c153 100644
--- a/docs/guides/ecosystem/react.md
+++ b/docs/guides/ecosystem/react.md
@@ -2,29 +2,48 @@
name: Use React and JSX
---
-React just works with Bun. Bun supports `.jsx` and `.tsx` files out of the box. Bun's internal transpiler converts JSX syntax into vanilla JavaScript before execution.
-
-```tsx#react.tsx
-function Component(props: {message: string}) {
- return (
- <body>
- <h1 style={{color: 'red'}}>{props.message}</h1>
- </body>
- );
-}
-
-console.log(<Component message="Hello world!" />);
+React just works with Bun. Bun supports `.jsx` and `.tsx` files out of the box.
+
+Remember that JSX is just a special syntax for including HTML-like syntax in JavaScript files. It's commonReact uses JSX syntax, as do other React alternatives like [Preact](https://preactjs.com/) and [Solid](https://www.solidjs.com/). Bun's internal transpiler converts JSX syntax into vanilla JavaScript before execution.
+
+---
+
+Bun _assumes_ you're using React (unless you [configure it otherwise](/docs/runtime/bunfig#jsx)) so a line like this:
+
+```
+const element = <h1>Hello, world!</h1>;
```
---
-Bun implements special logging for JSX to make debugging easier.
+is internally converted into something like this:
+
+```ts
+// jsxDEV
+import { jsx } from "react/jsx-dev-runtime";
+
+const element = jsx("h1", { children: "Hello, world!" });
+```
+
+---
+
+This code requires `react` to run, so make sure you you've installed React.
```bash
-$ bun run react.tsx
+$ bun install react
+```
+
+---
+
+Bun implements special logging for JSX components to make debugging easier.
+
+```bash
+$ bun run log-my-component.tsx
<Component message="Hello world!" />
```
---
+As far as "official support" for React goes, that's it. React is a library like any other, and Bun can run that library. Bun is not a framework, so you should use a framework like [Vite](https://vitejs.dev/) to build an app with server-side rendering and hot reloading in the browser.
+
Refer to [Runtime > JSX](/docs/runtime/jsx) for complete documentation on configuring JSX.
diff --git a/docs/guides/ecosystem/remix.md b/docs/guides/ecosystem/remix.md
index ee6185294..5adf648ec 100644
--- a/docs/guides/ecosystem/remix.md
+++ b/docs/guides/ecosystem/remix.md
@@ -3,7 +3,7 @@ name: Build an app with Remix and Bun
---
{% callout %}
-Remix currently relies on Node.js APIs that Bun does not yet implement. The guide below uses Bun to initialize a project and install dependencies, but it uses Node.js to run the dev server.
+Currently the Remix development server (`remix dev`) relies on Node.js APIs that Bun does not yet implement. The guide below uses Bun to initialize a project and install dependencies, but it uses Node.js to run the dev server.
{% /callout %}
---
@@ -11,14 +11,14 @@ Remix currently relies on Node.js APIs that Bun does not yet implement. The guid
Initialize a Remix app with `create-remix`.
```sh
-$ bunx create-remix
+$ bun create remix
remix v1.19.3 💿 Let's build a better website...
dir Where should we create your new project?
./my-app
- ◼ Using basic template See https://remix.run/docs/pages/templates for more
+ ◼ Using basic template See https://remix.run/docs/en/main/guides/templates#templates for more
✔ Template copied
git Initialize a new git repository?
@@ -58,3 +58,21 @@ $ bun run dev
Open [http://localhost:3000](http://localhost:3000) to see the app. Any changes you make to `app/routes/_index.tsx` will be hot-reloaded in the browser.
{% image src="https://github.com/oven-sh/bun/assets/3084745/c26f1059-a5d4-4c0b-9a88-d9902472fd77" caption="Remix app running on localhost" /%}
+
+---
+
+To build and start your app, run `bun run build` then `bun run start` from the project root.
+
+```sh
+$ bun run build
+ $ remix build
+ info building... (NODE_ENV=production)
+ info built (158ms)
+$ bun start
+ $ remix-serve ./build/index.js
+ [remix-serve] http://localhost:3000 (http://192.168.86.237:3000)
+```
+
+---
+
+Read the [Remix docs](https://remix.run/) for more information on how to build apps with Remix.
diff --git a/docs/guides/ecosystem/solidstart.md b/docs/guides/ecosystem/solidstart.md
index ca2ef471e..fb8d54d91 100644
--- a/docs/guides/ecosystem/solidstart.md
+++ b/docs/guides/ecosystem/solidstart.md
@@ -11,7 +11,7 @@ SolidStart currently relies on Node.js APIs that Bun does not yet implement. The
Initialize a SolidStart app with `create-solid`.
```sh
-$ bunx create-solid my-app
+$ bun create solid my-app
create-solid version 0.2.31
Welcome to the SolidStart setup wizard!
diff --git a/docs/guides/ecosystem/sveltekit.md b/docs/guides/ecosystem/sveltekit.md
index 172b77299..6386673bc 100644
--- a/docs/guides/ecosystem/sveltekit.md
+++ b/docs/guides/ecosystem/sveltekit.md
@@ -2,10 +2,10 @@
name: Build an app with SvelteKit and Bun
---
-Use `bunx` to scaffold your app with the `create-svelte` CLI. Answer the prompts to select a template and set up your development environment.
+Use `bun create` to scaffold your app with the `svelte` package. Answer the prompts to select a template and set up your development environment.
```sh
-$ bunx create-svelte my-app
+$ bun create svelte@latest my-app
┌ Welcome to SvelteKit!
◇ Which Svelte app template?
diff --git a/docs/guides/ecosystem/systemd.md b/docs/guides/ecosystem/systemd.md
new file mode 100644
index 000000000..c22fc9ae2
--- /dev/null
+++ b/docs/guides/ecosystem/systemd.md
@@ -0,0 +1,113 @@
+---
+name: Run Bun as a daemon with systemd
+---
+
+[systemd](https://systemd.io) is an init system and service manager for Linux operating systems that manages the startup and control of system processes and services.
+
+<!-- systemd provides aggressive parallelization capabilities, uses socket and D-Bus activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux control groups, maintains mount and auto mount points, and implements an elaborate transactional dependency-based service control logic. systemd supports SysV and LSB init scripts and works as a replacement for sysvinit. -->
+
+<!-- Other parts include a logging daemon, utilities to control basic system configuration like the hostname, date, locale, maintain a list of logged-in users and running containers and virtual machines, system accounts, runtime directories and settings, and daemons to manage simple network configuration, network time synchronization, log forwarding, and name resolution. -->
+
+---
+
+To run a Bun application as a daemon using **systemd** you'll need to create a _service file_ in `/lib/systemd/system/`.
+
+```sh
+$ cd /lib/systemd/system
+$ touch my-app.service
+```
+
+---
+
+Here is a typical service file that runs an application on system start. You can use this as a template for your own service. Replace `YOUR_USER` with the name of the user you want to run the application as. To run as `root`, replace `YOUR_USER` with `root`, though this is generally not recommended for security reasons.
+
+Refer to the [systemd documentation](https://www.freedesktop.org/software/systemd/man/systemd.service.html) for more information on each setting.
+
+```ini#my-app.service
+[Unit]
+# describe the app
+Description=My App
+# start the app after the network is available
+After=network.target
+
+[Service]
+# usually you'll use 'simple'
+# one of https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=
+Type=simple
+# which user to use when starting the app
+User=YOUR_USER
+# path to your application's root directory
+WorkingDirectory=/home/YOUR_USER/path/to/my-app
+# the command to start the app
+# requires absolute paths
+ExecStart=/home/YOUR_USER/.bun/bin/bun run index.ts
+# restart policy
+# one of {no|on-success|on-failure|on-abnormal|on-watchdog|on-abort|always}
+Restart=always
+
+[Install]
+# start the app automatically
+WantedBy=multi-user.target
+```
+
+---
+
+If your application starts a webserver, note that non-`root` users are not able to listen on ports 80 or 443 by default. To permanently allow Bun to listen on these ports when executed by a non-`root` user, use the following command. This step isn't necessary when running as `root`.
+
+```bash
+$ sudo setcap CAP_NET_BIND_SERVICE=+eip ~/.bun/bin/bun
+```
+
+---
+
+With the service file configured, you can now _enable_ the service. Once enabled, it will start automatically on reboot. This requires `sudo` permissions.
+
+```bash
+$ sudo systemctl enable my-app
+```
+
+---
+
+To start the service without rebooting, you can manually _start_ it.
+
+```bash
+$ sudo systemctl start my-app
+```
+
+---
+
+Check the status of your application with `systemctl status`. If you've started your app successfully, you should see something like this:
+
+```bash
+$ sudo systemctl status my-app
+● my-app.service - My App
+ Loaded: loaded (/lib/systemd/system/my-app.service; enabled; preset: enabled)
+ Active: active (running) since Thu 2023-10-12 11:34:08 UTC; 1h 8min ago
+ Main PID: 309641 (bun)
+ Tasks: 3 (limit: 503)
+ Memory: 40.9M
+ CPU: 1.093s
+ CGroup: /system.slice/my-app.service
+ └─309641 /home/YOUR_USER/.bun/bin/bun run /home/YOUR_USER/application/index.ts
+```
+
+---
+
+To update the service, edit the contents of the service file, then reload the daemon.
+
+```bash
+$ sudo systemctl daemon-reload
+```
+
+---
+
+For a complete guide on the service unit configuration, you can check [this page](https://www.freedesktop.org/software/systemd/man/systemd.service.html). Or refer to this cheatsheet of common commands:
+
+```bash
+$ sudo systemctl daemon-reload # tell systemd that some files got changed
+$ sudo systemctl enable my-app # enable the app (to allow auto-start)
+$ sudo systemctl disable my-app # disable the app (turns off auto-start)
+$ sudo systemctl start my-app # start the app if is stopped
+$ sudo systemctl stop my-app # stop the app
+$ sudo systemctl restart my-app # restart the app
+```
diff --git a/docs/guides/ecosystem/vite.md b/docs/guides/ecosystem/vite.md
index 3cad145f9..cf77e7249 100644
--- a/docs/guides/ecosystem/vite.md
+++ b/docs/guides/ecosystem/vite.md
@@ -11,7 +11,7 @@ While Vite currently works with Bun, it has not been heavily optimized, nor has
Vite works out of the box with Bun. Get started with one of Vite's templates.
```bash
-$ bunx create-vite my-app
+$ bun create vite my-app
✔ Select a framework: › React
✔ Select a variant: › TypeScript + SWC
Scaffolding project in /path/to/my-app...
@@ -30,8 +30,7 @@ bun install
Start the development server with the `vite` CLI using `bunx`.
-The `--bun` flag tells Bun to run Vite's CLI using `bun` instead of `node`; by default Bun respects Vite's `#!/usr/bin/env node` [shebang line](<https://en.wikipedia.org/wiki/Shebang_(Unix)>). After Bun 1.0 this flag will no longer be necessary.
-
+The `--bun` flag tells Bun to run Vite's CLI using `bun` instead of `node`; by default Bun respects Vite's `#!/usr/bin/env node` [shebang line](<https://en.wikipedia.org/wiki/Shebang_(Unix)>).
```bash
bunx --bun vite
```
diff --git a/docs/guides/http/file-uploads.md b/docs/guides/http/file-uploads.md
index 7cc0e742a..ce23b5d0c 100644
--- a/docs/guides/http/file-uploads.md
+++ b/docs/guides/http/file-uploads.md
@@ -59,7 +59,7 @@ Listening on http://localhost:4000
Our form will send a `POST` request to the `/action` endpoint with the form data. Let's handle that request in our server.
-First we use the [`.formData()`](https://developer.mozilla.org/en-US/docs/Web/API/Request/formData) method on the incoming `Request` to asynchonously parse its contents to a `FormData` instance. Then we can use the [`.get()`](https://developer.mozilla.org/en-US/docs/Web/API/FormData/get) method to extract the value of the `name` and `profilePicture` fields. Here `name` corresponds to a `string` and `profilePicture` is a `Blob`.
+First we use the [`.formData()`](https://developer.mozilla.org/en-US/docs/Web/API/Request/formData) method on the incoming `Request` to asynchronously parse its contents to a `FormData` instance. Then we can use the [`.get()`](https://developer.mozilla.org/en-US/docs/Web/API/FormData/get) method to extract the value of the `name` and `profilePicture` fields. Here `name` corresponds to a `string` and `profilePicture` is a `Blob`.
Finally, we write the `Blob` to disk using [`Bun.write()`](/docs/api/file-io#writing-files-bun-write).
diff --git a/docs/guides/install/azure-artifacts.md b/docs/guides/install/azure-artifacts.md
new file mode 100644
index 000000000..659e75fd6
--- /dev/null
+++ b/docs/guides/install/azure-artifacts.md
@@ -0,0 +1,73 @@
+---
+name: Using bun install with an Azure Artifacts npm registry
+---
+
+{% callout %}
+In [Azure Artifact's](https://learn.microsoft.com/en-us/azure/devops/artifacts/npm/npmrc?view=azure-devops&tabs=windows%2Cclassic) instructions for `.npmrc`, they say to base64 encode the password. Do not do this for `bun install`. Bun will automatically base64 encode the password for you if needed.
+{% /callout %}
+
+[Azure Artifacts](https://azure.microsoft.com/en-us/products/devops/artifacts) is a package management system for Azure DevOps. It allows you to host your own private npm registry, npm packages, and other types of packages as well.
+
+---
+
+### Configure with bunfig.toml
+
+---
+
+To use it with `bun install`, add a `bunfig.toml` file to your project with the following contents. Make sure to replace `my-azure-artifacts-user` with your Azure Artifacts username, such as `jarred1234`.
+
+```toml#bunfig.toml
+[install.registry]
+url = "https://pkgs.dev.azure.com/my-azure-artifacts-user/_packaging/my-azure-artifacts-user/npm/registry"
+username = "my-azure-artifacts-user"
+# Bun v1.0.3+ supports using an environment variable here
+password = "$NPM_PASSWORD"
+```
+
+---
+
+Then assign your Azure Personal Access Token to the the `NPM_PASSWORD` environment variable. Bun [automatically reads](/docs/runtime/env) `.env` files, so create a file called `.env` in your project root. There is no need to base-64 encode this token! Bun will do this for you.
+
+```txt#.env
+NPM_PASSWORD=<paste token here>
+```
+
+---
+
+### Configure with environment variables
+
+---
+
+To configure Azure Artifacts without `bunfig.toml`, you can set the `NPM_CONFIG_REGISTRY` environment variable. The URL should include `:username` and `:_password` as query parameters. Replace `<USERNAME>` and `<PASSWORD>` with the apprropriate values.
+
+```bash#shell
+NPM_CONFIG_REGISTRY=https://pkgs.dev.azure.com/my-azure-artifacts-user/_packaging/my-azure-artifacts-user/npm/registry/:username=<USERNAME>:_password=<PASSWORD>
+```
+
+---
+
+### Don't base64 encode the password
+
+---
+
+In [Azure Artifact's](https://learn.microsoft.com/en-us/azure/devops/artifacts/npm/npmrc?view=azure-devops&tabs=windows%2Cclassic) instructions for `.npmrc`, they say to base64 encode the password. Do not do this for `bun install`. Bun will automatically base64 encode the password for you if needed.
+
+{% callout %}
+**Tip** — If it ends with `==`, it probably is base64 encoded.
+{% /callout %}
+
+---
+
+To decode a base64-encoded password, open your browser console and run:
+
+```js
+atob("<base64-encoded password>");
+```
+
+---
+
+Alternatively, use the `base64` command line tool, but doing so means it may be saved in your terminal history which is not recommended:
+
+```bash
+echo "base64-encoded-password" | base64 --decode
+```
diff --git a/docs/guides/install/custom-registry.md b/docs/guides/install/custom-registry.md
index 64b3cf76b..12bb3b77f 100644
--- a/docs/guides/install/custom-registry.md
+++ b/docs/guides/install/custom-registry.md
@@ -18,7 +18,7 @@ registry = "https://username:password@registry.npmjs.org"
---
-Your `bunfig.toml` can reference environment variables. Bun automatically loads environment variables from `.env.local`, `.env.[NODE_ENV]`, and `.env`. See [Docs > Environment variables](/docs/cli/run#environment-variables) for more information.
+Your `bunfig.toml` can reference environment variables. Bun automatically loads environment variables from `.env.local`, `.env.[NODE_ENV]`, and `.env`. See [Docs > Environment variables](/docs/runtime/env) for more information.
```toml#bunfig.toml
[install]
diff --git a/docs/guides/install/jfrog-artifactory.md b/docs/guides/install/jfrog-artifactory.md
new file mode 100644
index 000000000..e4872982b
--- /dev/null
+++ b/docs/guides/install/jfrog-artifactory.md
@@ -0,0 +1,28 @@
+---
+name: Using bun install with Artifactory
+---
+
+[JFrog Artifactory](https://jfrog.com/artifactory/) is a package management system for npm, Docker, Maven, NuGet, Ruby, Helm, and more. It allows you to host your own private npm registry, npm packages, and other types of packages as well.
+
+To use it with `bun install`, add a `bunfig.toml` file to your project with the following contents:
+
+---
+
+### Configure with bunfig.toml
+
+Make sure to replace `MY_SUBDOMAIN` with your JFrog Artifactory subdomain, such as `jarred1234` and MY_TOKEN with your JFrog Artifactory token.
+
+```toml#bunfig.toml
+[install.registry]
+url = "https://MY_SUBDOMAIN.jfrog.io/artifactory/api/npm/npm/_auth=MY_TOKEN"
+# Bun v1.0.3+ supports using an environment variable here
+# url = "$NPM_CONFIG_REGISTRY"
+```
+
+---
+
+### Configure with `$NPM_CONFIG_REGISTRY`
+
+Like with npm, you can use the `NPM_CONFIG_REGISTRY` environment variable to configure JFrog Artifactory with bun install.
+
+---
diff --git a/docs/guides/install/registry-scope.md b/docs/guides/install/registry-scope.md
index 48f7dee79..aade23116 100644
--- a/docs/guides/install/registry-scope.md
+++ b/docs/guides/install/registry-scope.md
@@ -11,7 +11,11 @@ Bun does not read `.npmrc` files; instead private registries are configured via
# as an object with username/password
# you can reference environment variables
-"@myorg2" = { username = "myusername", password = "$npm_pass", url = "https://registry.myorg.com/" }
+"@myorg2" = {
+ username = "myusername",
+ password = "$npm_pass",
+ url = "https://registry.myorg.com/"
+}
# as an object with token
"@myorg3" = { token = "$npm_token", url = "https://registry.myorg.com/" }
@@ -20,7 +24,7 @@ Bun does not read `.npmrc` files; instead private registries are configured via
---
-Your `bunfig.toml` can reference environment variables. Bun automatically loads environment variables from `.env.local`, `.env.[NODE_ENV]`, and `.env`. See [Docs > Environment variables](/docs/cli/run#environment-variables) for more information.
+Your `bunfig.toml` can reference environment variables. Bun automatically loads environment variables from `.env.local`, `.env.[NODE_ENV]`, and `.env`. See [Docs > Environment variables](/docs/runtime/env) for more information.
```toml#bunfig.toml
[install.scopes]
diff --git a/docs/guides/install/trusted.md b/docs/guides/install/trusted.md
new file mode 100644
index 000000000..0c1ac6362
--- /dev/null
+++ b/docs/guides/install/trusted.md
@@ -0,0 +1,50 @@
+---
+name: Add a trusted dependency
+---
+
+Unlike other npm clients, Bun does not execute arbitrary lifecycle scripts for installed dependencies, such as `postinstall` and `node-gyp` builds. These scripts represent a potential security risk, as they can execute arbitrary code on your machine.
+
+{% callout %}
+Soon, Bun will include a built-in allow-list that automatically allows lifecycle scripts to be run by popular packages that are known to be safe. This is still under development.
+{% /callout %}
+
+---
+
+If you are seeing one of the following errors, you are probably trying to use a package that uses `postinstall` to work properly:
+
+- `error: could not determine executable to run for package`
+- `InvalidExe`
+
+---
+
+To tell Bun to allow lifecycle scripts for a particular package, add the package to `trustedDependencies` in your package.json.
+
+Note that this only allows lifecycle scripts for the specific package listed in `trustedDependencies`, _not_ the dependencies of that dependency!
+
+<!-- Bun maintains an allow-list of popular packages containing `postinstall` scripts that are known to be safe. To run lifecycle scripts for packages that aren't on this list, add the package to `trustedDependencies` in your package.json. -->
+
+```json-diff
+ {
+ "name": "my-app",
+ "version": "1.0.0",
++ "trustedDependencies": ["my-trusted-package"]
+ }
+```
+
+---
+
+Once this is added, run a fresh install. Bun will re-install your dependencies and properly install
+
+```sh
+$ rm -rf node_modules
+$ rm bun.lockb
+$ bun install
+```
+
+---
+
+Note that this only allows lifecycle scripts for the specific package listed in `trustedDependencies`, _not_ the dependencies of that dependency!
+
+---
+
+See [Docs > Package manager > Trusted dependencies](/docs/install/lifecycle) for complete documentation of trusted dependencies.
diff --git a/docs/guides/install/workspaces.md b/docs/guides/install/workspaces.md
index f87c1e337..b271a33b0 100644
--- a/docs/guides/install/workspaces.md
+++ b/docs/guides/install/workspaces.md
@@ -4,6 +4,8 @@ name: Configuring a monorepo using workspaces
Bun's package manager supports npm `"workspaces"`. This allows you to split a codebase into multiple distinct "packages" that live in the same repository, can depend on each other, and (when possible) share a `node_modules` directory.
+Clone [this sample project](https://github.com/colinhacks/bun-workspaces) to experiment with workspaces.
+
---
The root `package.json` should not contain any `"dependencies"`, `"devDependencies"`, etc. Each individual package should be self-contained and declare its own dependencies. Similarly, it's conventional to declare `"private": true` to avoid accidentally publishing the root package to `npm`.
@@ -35,13 +37,13 @@ It's common to place all packages in a `packages` directory. The `"workspaces"`
---
-To add one workspace as a dependency of another, modify its `package.json`. Here we're adding `stuff-a` as a dependency of `stuff-b`.
+To add dependencies between workspaces, use the `"workspace:*"` syntax. Here we're adding `stuff-a` as a dependency of `stuff-b`.
-```json#packages/stuff-b/package.json
+```json-diff#packages/stuff-b/package.json
{
"name": "stuff-b",
"dependencies": {
-+ "stuff-a": "*"
++ "stuff-a": "workspace:*"
}
}
```
diff --git a/docs/guides/process/ipc.md b/docs/guides/process/ipc.md
new file mode 100644
index 000000000..af029a524
--- /dev/null
+++ b/docs/guides/process/ipc.md
@@ -0,0 +1,66 @@
+---
+name: Spawn a child process and communicate using IPC
+---
+
+Use [`Bun.spawn()`](/docs/api/spawn) to spawn a child process. When spawning a second `bun` process, you can open a direct inter-process communication (IPC) channel between the two processes.
+
+{%callout%}
+**Note** — This API is only compatible with other `bun` processes. Use `process.execPath` to get a path to the currently running `bun` executable.
+{%/callout%}
+
+```ts#parent.ts
+const child = Bun.spawn(["bun", "child.ts"], {
+ ipc(message) {
+ /**
+ * The message received from the sub process
+ **/
+ },
+});
+```
+
+---
+
+The parent process can send messages to the subprocess using the `.send()` method on the returned `Subprocess` instance. A reference to the sending subprocess is also available as the second argument in the `ipc` handler.
+
+```ts#parent.ts
+const childProc = Bun.spawn(["bun", "child.ts"], {
+ ipc(message, childProc) {
+ /**
+ * The message received from the sub process
+ **/
+ childProc.send("Respond to child")
+ },
+});
+
+childProc.send("I am your father"); // The parent can send messages to the child as well
+```
+
+---
+
+Meanwhile the child process can send messages to its parent using with `process.send()` and receive messages with `process.on("message")`. This is the same API used for `child_process.fork()` in Node.js.
+
+```ts#child.ts
+process.send("Hello from child as string");
+process.send({ message: "Hello from child as object" });
+
+process.on("message", (message) => {
+ // print message from parent
+ console.log(message);
+});
+```
+
+---
+
+All messages are serialized using the JSC `serialize` API, which allows for the same set of [transferrable types](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Transferable_objects) supported by `postMessage` and `structuredClone`, including strings, typed arrays, streams, and objects.
+
+```ts#child.ts
+// send a string
+process.send("Hello from child as string");
+
+// send an object
+process.send({ message: "Hello from child as object" });
+```
+
+---
+
+See [Docs > API > Child processes](/docs/api/spawn) for complete documentation.
diff --git a/docs/guides/read-file/exists.md b/docs/guides/read-file/exists.md
index fd6cbbf9a..0359f5728 100644
--- a/docs/guides/read-file/exists.md
+++ b/docs/guides/read-file/exists.md
@@ -8,7 +8,7 @@ The `Bun.file()` function accepts a path and returns a `BunFile` instance. Use t
const path = "/path/to/package.json";
const file = Bun.file(path);
-file.exists(); // boolean;
+await file.exists(); // boolean;
```
---
diff --git a/docs/guides/read-file/stream.md b/docs/guides/read-file/stream.md
index ac4bd9e2f..bc54af2ce 100644
--- a/docs/guides/read-file/stream.md
+++ b/docs/guides/read-file/stream.md
@@ -8,7 +8,7 @@ The `Bun.file()` function accepts a path and returns a `BunFile` instance. The `
const path = "/path/to/package.json";
const file = Bun.file(path);
-const stream = await file.stream();
+const stream = file.stream();
```
---
diff --git a/docs/guides/runtime/read-env.md b/docs/guides/runtime/read-env.md
index 512f731dd..7295a6726 100644
--- a/docs/guides/runtime/read-env.md
+++ b/docs/guides/runtime/read-env.md
@@ -29,4 +29,4 @@ FOOBAR=aaaaaa
---
-See [Docs > Runtime > Environment variables](/docs/cli/run#environment-variables) for more information on using environment variables with Bun.
+See [Docs > Runtime > Environment variables](/docs/runtime/env) for more information on using environment variables with Bun.
diff --git a/docs/guides/runtime/set-env.md b/docs/guides/runtime/set-env.md
index 97cac3488..684da940a 100644
--- a/docs/guides/runtime/set-env.md
+++ b/docs/guides/runtime/set-env.md
@@ -34,4 +34,4 @@ $ FOO=helloworld bun run dev
---
-See [Docs > Runtime > Environment variables](/docs/cli/run#environment-variables) for more information on using environment variables with Bun.
+See [Docs > Runtime > Environment variables](/docs/runtime/env) for more information on using environment variables with Bun.
diff --git a/docs/guides/runtime/tsconfig-paths.md b/docs/guides/runtime/tsconfig-paths.md
index 5c3f591f5..176051d5a 100644
--- a/docs/guides/runtime/tsconfig-paths.md
+++ b/docs/guides/runtime/tsconfig-paths.md
@@ -8,8 +8,8 @@ Bun reads the `paths` field in your `tsconfig.json` to re-write import paths. Th
{
"compilerOptions": {
"paths": {
- "my-custom-name": "zod",
- "@components/*": "./src/components/*"
+ "my-custom-name": ["zod"],
+ "@components/*": ["./src/components/*"]
}
}
}
diff --git a/docs/guides/runtime/typescript.md b/docs/guides/runtime/typescript.md
new file mode 100644
index 000000000..f6afe02c1
--- /dev/null
+++ b/docs/guides/runtime/typescript.md
@@ -0,0 +1,69 @@
+---
+name: Install TypeScript declarations for Bun
+---
+
+To install TypeScript definitions for Bun's built-in APIs in your project, install `bun-types`.
+
+```sh
+$ bun add -d bun-types # dev dependency
+```
+
+---
+
+Then include `"bun-types"` in the `compilerOptions.types` in your `tsconfig.json`:
+
+```json-diff
+ {
+ "compilerOptions": {
++ "types": ["bun-types"]
+ }
+ }
+```
+
+---
+
+Unfortunately, setting a value for `"types"` means that TypeScript will ignore other global type definitions, including `lib: ["dom"]`. If you need to add DOM types into your project, add the following [triple-slash directives](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html) at the top of any TypeScript file in your project.
+
+```ts
+/// <reference lib="dom" />
+/// <reference lib="dom.iterable" />
+```
+
+---
+
+Below is the full set of recommended `compilerOptions` for a Bun project. With this `tsconfig.json`, you can use top-level await, extensioned or extensionless imports, and JSX.
+
+```jsonc
+{
+ "compilerOptions": {
+ // add Bun type definitions
+ "types": ["bun-types"],
+
+ // enable latest features
+ "lib": ["esnext"],
+ "module": "esnext",
+ "target": "esnext",
+
+ // if TS 5.x+
+ "moduleResolution": "bundler",
+ "noEmit": true,
+ "allowImportingTsExtensions": true,
+ "moduleDetection": "force",
+ // if TS 4.x or earlier
+ // "moduleResolution": "nodenext",
+
+ "jsx": "react-jsx", // support JSX
+ "allowJs": true, // allow importing `.js` from `.ts`
+ "esModuleInterop": true, // allow default imports for CommonJS modules
+
+ // best practices
+ "strict": true,
+ "forceConsistentCasingInFileNames": true,
+ "skipLibCheck": true
+ }
+}
+```
+
+---
+
+Refer to [Ecosystem > TypeScript](/docs/runtime/typescript) for a complete guide to TypeScript support in Bun.
diff --git a/docs/guides/runtime/vscode-debugger.md b/docs/guides/runtime/vscode-debugger.md
index 616524c17..fdfdb2f2e 100644
--- a/docs/guides/runtime/vscode-debugger.md
+++ b/docs/guides/runtime/vscode-debugger.md
@@ -2,6 +2,12 @@
name: Debugging Bun with the VS Code extension
---
+{% note %}
+
+VSCode extension support is currently buggy. We recommend the [Web Debugger](https://bun.sh/guides/runtime/web-debugger) for now.
+
+{% /note %}
+
Bun speaks the [WebKit Inspector Protocol](https://github.com/oven-sh/bun/blob/main/packages/bun-vscode/types/jsc.d.ts) so you can debug your code with an interactive debugger.
---
diff --git a/docs/guides/test/happy-dom.md b/docs/guides/test/happy-dom.md
index 9c6728f88..072790929 100644
--- a/docs/guides/test/happy-dom.md
+++ b/docs/guides/test/happy-dom.md
@@ -49,7 +49,7 @@ test("set button text", () => {
---
-With Happy DOM propertly configured, this test runs as expected.
+With Happy DOM properly configured, this test runs as expected.
```sh
$ bun test
diff --git a/docs/guides/test/migrate-from-jest.md b/docs/guides/test/migrate-from-jest.md
new file mode 100644
index 000000000..4adbddc34
--- /dev/null
+++ b/docs/guides/test/migrate-from-jest.md
@@ -0,0 +1,112 @@
+---
+name: Migrate from Jest to Bun's test runner
+---
+
+In many cases, Bun's test runner can run Jest test suites with no code changes. Just run `bun test` instead of `npx jest`, `yarn test`, etc.
+
+```sh-diff
+- $ npx jest
+- $ yarn test
++ $ bun test
+```
+
+---
+
+There's often no need for code changes.
+
+- Bun internally re-writes imports from `@jest/globals` to use the `bun:test` equivalents.
+- If you're relying on Jest to inject `test`, `expect`, etc. as globals, Bun does that too.
+
+But if you'd rather switch to the `bun:test` imports, you can do that too.
+
+```ts-diff
+- import {test, expect} from "@jest/globals";
++ import {test, expect} from "bun:test";
+```
+
+---
+
+Bun implements the vast majority of Jest's matchers, but compatibility isn't 100% yet. Refer to the full compatibility table at [Docs > Test runner > Writing tests](/docs/test/writing#matchers).
+
+Some notable missing features:
+
+- `expect.extend()`
+- `expect().toMatchInlineSnapshot()`
+- `expect().toHaveBeenCalledWith()`
+- `expect().toHaveReturned()`
+
+---
+
+If you're using `testEnvironment: "jsdom"` to run your tests in a browser-like environment, you should follow the [DOM testing with Bun and happy-dom](/guides/test/happy-dom) guide to inject browser APIs into the global scope. This guide relies on [`happy-dom`](https://github.com/capricorn86/happy-dom), which is a leaner and faster alternative to [`jsdom`](https://github.com/jsdom/jsdom).
+
+At the moment jsdom does not work in Bun due to its internal use of V8 APIs. Track support for it [here](https://github.com/oven-sh/bun/issues/3554).
+
+```toml#bunfig.toml
+[test]
+preload = ["./happy-dom.ts"]
+```
+
+---
+
+Replace `bail` in your Jest config with the `--bail` CLI flag.
+
+<!-- ```ts-diff
+- import type {Config} from 'jest';
+-
+- const config: Config = {
+- bail: 3
+- };
+``` -->
+
+```sh-diff
+$ bun test --bail 3
+```
+
+---
+
+Replace `collectCoverage` with the `--coverage` CLI flag.
+
+<!-- ```ts-diff
+- import type {Config} from 'jest';
+-
+- const config: Config = {
+- collectCoverageFrom: [
+- '**/*.{js,jsx}',
+- '!**/node_modules/**',
+- '!**/vendor/**',
+- ],
+- };
+``` -->
+
+```sh
+$ bun test --coverage
+```
+
+---
+
+Replace `testTimeout` with the `--test-timeout` CLI flag.
+
+```sh
+$ bun test --timeout 10000
+```
+
+---
+
+Many other flags become irrelevant or obsolete when using `bun test`.
+
+- `transform` — Buns supports TypeScript & JSX. Other file types can be configured with [Plugins](/docs/runtime/plugins).
+- `extensionsToTreatAsEsm`
+- `haste` — Bun uses it's own internal source maps
+- `watchman`, `watchPlugins`, `watchPathIgnorePatterns` — use `--watch` to run tests in watch mode
+- `verbose` — set `logLevel: "debug"` in [`bunfig.toml`](/docs/runtime/bunfig#loglevel)
+
+---
+
+Settings that aren't mentioned here are not supported or have no equivalent. Please [file a feature request](https://github.com/oven-sh/bun) if something important is missing.
+
+---
+
+See also:
+
+- [Mark a test as a todo](/guides/test/todo-tests)
+- [Docs > Test runner > Writing tests](/docs/test/writing)
diff --git a/docs/guides/test/mock-functions.md b/docs/guides/test/mock-functions.md
index c7e8af411..fbcf03e86 100644
--- a/docs/guides/test/mock-functions.md
+++ b/docs/guides/test/mock-functions.md
@@ -47,7 +47,7 @@ random.mock.results;
These extra properties make it possible to write `expect` assertions about usage of the mock function, including how many times it was called, the arguments, and the return values.
```ts
-import { test, mock } from "bun:test";
+import { test, expect, mock } from "bun:test";
const random = mock((multiplier: number) => multiplier * Math.random());
diff --git a/docs/guides/test/spy-on.md b/docs/guides/test/spy-on.md
index 003c05d96..4d4902f9d 100644
--- a/docs/guides/test/spy-on.md
+++ b/docs/guides/test/spy-on.md
@@ -36,7 +36,7 @@ Once the spy is created, it can be used to write `expect` assertions relating to
+ test("turtles", ()=>{
+ expect(spy).toHaveBeenCalledTimes(0);
+ leo.sayHi("pizza");
-+ expect(spy).toHaveBeenCalledTimes(0);
++ expect(spy).toHaveBeenCalledTimes(1);
+ expect(spy.mock.calls).toEqual([[ "pizza" ]]);
+ })
```
diff --git a/docs/guides/util/entrypoint.md b/docs/guides/util/entrypoint.md
index e53d4c9a1..63d71b630 100644
--- a/docs/guides/util/entrypoint.md
+++ b/docs/guides/util/entrypoint.md
@@ -5,9 +5,9 @@ name: Check if the current file is the entrypoint
Bun provides a handful of module-specific utilities on the [`import.meta`](/docs/api/import-meta) object. Use `import.meta.main` to check if the current file is the entrypoint of the current process.
```ts#index.ts
-if(import.meta.main){
+if (import.meta.main) {
// this file is directly executed with `bun run`
-}else{
+} else {
// this file is being imported by another file
}
```
diff --git a/docs/guides/websocket/context.md b/docs/guides/websocket/context.md
index 9e387d685..8658c5d4b 100644
--- a/docs/guides/websocket/context.md
+++ b/docs/guides/websocket/context.md
@@ -47,7 +47,7 @@ Bun.serve<WebSocketData>({
// use a library to parse cookies
const cookies = parseCookies(req.headers.get("Cookie"));
const token = cookies["X-Token"];
- const user = await getUserFromToken(ws.data.authToken);
+ const user = await getUserFromToken(token);
const upgraded = server.upgrade(req, {
data: {
diff --git a/docs/guides/websocket/simple.md b/docs/guides/websocket/simple.md
index 5aabf2fdf..e1d95ce36 100644
--- a/docs/guides/websocket/simple.md
+++ b/docs/guides/websocket/simple.md
@@ -29,5 +29,5 @@ const server = Bun.serve<{ authToken: string }>({
},
});
-console.log(`Listening on localhost:\${server.port}`);
+console.log(`Listening on ${server.hostname}:${server.port}`);
```
diff --git a/docs/index.md b/docs/index.md
index 0cc294150..3fbb7576d 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -26,7 +26,7 @@ Get started with one of the quick links below, or read on to learn more about Bu
{% arrowbutton href="/docs/installation" text="Install Bun" /%}
{% arrowbutton href="/docs/quickstart" text="Do the quickstart" /%}
{% arrowbutton href="/docs/cli/install" text="Install a package" /%}
-{% arrowbutton href="/docs/templates" text="Use a project template" /%}
+{% arrowbutton href="/docs/cli/bun-create" text="Use a project template" /%}
{% arrowbutton href="/docs/bundler" text="Bundle code for production" /%}
{% arrowbutton href="/docs/api/http" text="Build an HTTP server" /%}
{% arrowbutton href="/docs/api/websockets" text="Build a Websocket server" /%}
@@ -37,11 +37,14 @@ Get started with one of the quick links below, or read on to learn more about Bu
## What is a runtime?
-JavaScript (or, more formally, ECMAScript) is just a _specification_ for a programming language. Anyone can write a JavaScript _engine_ that ingests a valid JavaScript program and executes it. The two most popular engines in use today are V8 (developed by Google) and JavaScriptCore (developed by Apple). Both are open source.
+JavaScript (or, more formally, ECMAScript) is just a _specification_ for a programming language. Anyone can write a JavaScript _engine_ that ingests a valid JavaScript program and executes it. The two most popular engines in use today are V8 (developed by Google)
+and JavaScriptCore (developed by Apple). Both are open source.
+
+But most JavaScript programs don't run in a vacuum. They need a way to access the outside world to perform useful tasks. This is where _runtimes_ come in. They implement additional APIs that are then made available to the JavaScript programs they execute.
### Browsers
-But most JavaScript programs don't run in a vacuum. They need a way to access the outside world to perform useful tasks. This is where _runtimes_ come in. They implement additional APIs that are then made available to the JavaScript programs they execute. Notably, browsers ship with JavaScript runtimes that implement a set of Web-specific APIs that are exposed via the global `window` object. Any JavaScript code executed by the browser can use these APIs to implement interactive or dynamic behavior in the context of the current webpage.
+Notably, browsers ship with JavaScript runtimes that implement a set of Web-specific APIs that are exposed via the global `window` object. Any JavaScript code executed by the browser can use these APIs to implement interactive or dynamic behavior in the context of the current webpage.
<!-- JavaScript runtime that exposes JavaScript engines are designed to run "vanilla" JavaScript programs, but it's often JavaScript _runtimes_ use an engine internally to execute the code and implement additional APIs that are then made available to executed programs.
JavaScript was [initially designed](https://en.wikipedia.org/wiki/JavaScript) as a language to run in web browsers to implement interactivity and dynamic behavior in web pages. Browsers are the first JavaScript runtimes. JavaScript programs that are executed in browsers have access to a set of Web-specific global APIs on the `window` object. -->
diff --git a/docs/install/index.md b/docs/install/index.md
index 540ade9f0..11e0d4fd4 100644
--- a/docs/install/index.md
+++ b/docs/install/index.md
@@ -69,7 +69,7 @@ $ bun install --silent # no logging
```
{% details summary="Configuring behavior" %}
-The default behavior of `bun install` can be configured in `bun.toml`:
+The default behavior of `bun install` can be configured in `bunfig.toml`:
```toml
[install]
@@ -188,7 +188,7 @@ Bun supports a variety of protocols, including [`github`](https://docs.npmjs.com
## Tarball dependencies
-A package name can correspond to a publically hosted `.tgz` file. During `bun install`, Bun will download and install the package from the specified tarball URL, rather than from the package registry.
+A package name can correspond to a publicly hosted `.tgz` file. During `bun install`, Bun will download and install the package from the specified tarball URL, rather than from the package registry.
```json#package.json
{
diff --git a/docs/install/lifecycle.md b/docs/install/lifecycle.md
new file mode 100644
index 000000000..035ead24d
--- /dev/null
+++ b/docs/install/lifecycle.md
@@ -0,0 +1,44 @@
+Packages on `npm` can define _lifecycle scripts_ in their `package.json`. Some of the most common are below, but there are [many others](https://docs.npmjs.com/cli/v10/using-npm/scripts).
+
+- `preinstall`: Runs before the package is installed
+- `postinstall`: Runs after the package is installed
+- `preuninstall`: Runs before the package is uninstalled
+- `prepublishOnly`: Runs before the package is published
+
+These scripts are arbitrary shell commands that the package manager is expected to read and execute at the appropriate time. But executing arbitrary scripts represents a potential security risk, so—unlike other `npm` clients—Bun does not execute arbitrary lifecycle scripts by default.
+
+## `postinstall`
+
+The `postinstall` script is particularly important. It's widely used to build or install platform-specific binaries for packages that are implemented as [native Node.js add-ons](https://nodejs.org/api/addons.html). For example, `node-sass` is a popular package that uses `postinstall` to build a native binary for Sass.
+
+```json
+{
+ "name": "my-app",
+ "version": "1.0.0",
+ "dependencies": {
+ "node-sass": "^6.0.1"
+ }
+}
+```
+
+## `trustedDependencies`
+
+Instead of executing arbitrary scripts, Bun uses a "default-secure" approach. You can add certain packages to an allow list, and Bun will execute lifecycle scripts for those packages. To tell Bun to allow lifecycle scripts for a particular package, add the package name to `trustedDependencies` array in your `package.json`.
+
+```json-diff
+ {
+ "name": "my-app",
+ "version": "1.0.0",
++ "trustedDependencies": ["node-sass"]
+ }
+```
+
+Once added to `trustedDependencies`, install/re-install the package. Bun will read this field and run lifecycle scripts for `my-trusted-package`.
+
+## `--ignore-scripts`
+
+To disable lifecycle scripts for all packages, use the `--no-scripts` flag.
+
+```bash
+$ bun install --no-scripts
+```
diff --git a/docs/install/lockfile.md b/docs/install/lockfile.md
index 599403913..f8e3001ca 100644
--- a/docs/install/lockfile.md
+++ b/docs/install/lockfile.md
@@ -10,30 +10,24 @@ Run `bun install -y` to generate a Yarn-compatible `yarn.lock` (v1) that can be
#### How do I `git diff` Bun's lockfile?
-To add to the global gitattributes file:
-
-- First try `$XDG_CONFIG_HOME/git/attributes`
-- If `$XDG_CONFIG_HOME` is not set, try `~/.config/git/attributes`
-
-For example, on macOS, add the following to `~/.config/git/attributes`:
+Add the following to your local or global `.gitattributes` file:
```
-*.lockb diff=lockb
+*.lockb binary diff=lockb
```
-Then add the following to `~/.gitconfig`:
+Then add the following to you local git config with:
-```
-[diff "lockb"]
- textconv = bun
- binary = true
+```sh
+$ git config diff.lockb.textconv bun
+$ git config diff.lockb.binary true
```
-To only add to the local gitattributes file:
+Or to your global git config (system-wide) with the `--global` option:
```sh
-$ git config diff.lockb.textconv bun
-$ git config diff.lockb.binary true
+$ git config --global diff.lockb.textconv bun
+$ git config --global diff.lockb.binary true
```
**Why this works:**
@@ -85,12 +79,6 @@ print = "yarn"
```toml
[install.lockfile]
-# path to read bun.lockb from
-path = "bun.lockb"
-
-# path to save bun.lockb to
-savePath = "bun.lockb"
-
# whether to save the lockfile to disk
save = true
diff --git a/docs/install/overrides.md b/docs/install/overrides.md
new file mode 100644
index 000000000..f226c35bd
--- /dev/null
+++ b/docs/install/overrides.md
@@ -0,0 +1,73 @@
+Bun supports npm's `"overrides"` and Yarn's `"resolutions"` in `package.json`. These are mechanisms for specifying a version range for _metadependencies_—the dependencies of your dependencies. Refer to [Package manager > Overrides and resolutions](/docs/install/overrides) for complete documentation.
+
+```json-diff#package.json
+ {
+ "name": "my-app",
+ "dependencies": {
+ "foo": "^2.0.0"
+ },
++ "overrides": {
++ "bar": "~4.4.0"
++ }
+ }
+```
+
+By default, Bun will install the latest version of all dependencies and metadependencies, according to the ranges specified in each package's `package.json`. Let's say you have a project with one dependency, `foo`, which in turn has a dependency on `bar`. This means `bar` is a _metadependency_ of our project.
+
+```json#package.json
+{
+ "name": "my-app",
+ "dependencies": {
+ "foo": "^2.0.0"
+ }
+}
+```
+
+When you run `bun install`, Bun will install the latest versions of each package.
+
+```
+# tree layout of node_modules
+node_modules
+├── foo@1.2.3
+└── bar@4.5.6
+```
+
+But what if a security vulnerability was introduced in `bar@4.5.6`? We may want a way to pin `bar` to an older version that doesn't have the vulerability. This is where `"overrides"`/`"resolutions"` come in.
+
+## `"overrides"`
+
+Add `bar` to the `"overrides"` field in `package.json`. Bun will defer to the specified version range when determining which version of `bar` to install, whether it's a dependency or a metadependency.
+
+{% callout %}
+**Note** — Bun currently only supports top-level `"overrides"`. [Nested overrides](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides) are not supported.
+{% /callout %}
+
+```json-diff#package.json
+ {
+ "name": "my-app",
+ "dependencies": {
+ "foo": "^2.0.0"
+ },
++ "overrides": {
++ "bar": "~4.4.0"
++ }
+ }
+```
+
+## `"resolutions"`
+
+The syntax is similar for `"resolutions"`, which is Yarn's alternative to `"overrides"`. Bun supports this feature to make migration from Yarn easier.
+
+As with `"overrides"`, _nested resolutions_ are not currently supported.
+
+```json-diff#package.json
+ {
+ "name": "my-app",
+ "dependencies": {
+ "foo": "^2.0.0"
+ },
++ "resolutions": {
++ "bar": "~4.4.0"
++ }
+ }
+```
diff --git a/docs/install/workspaces.md b/docs/install/workspaces.md
index f2a45048a..079ef7dd4 100644
--- a/docs/install/workspaces.md
+++ b/docs/install/workspaces.md
@@ -1,12 +1,39 @@
Bun supports [`workspaces`](https://docs.npmjs.com/cli/v9/using-npm/workspaces?v=true#description) in `package.json`. Workspaces make it easy to develop complex software as a _monorepo_ consisting of several independent packages.
-To try it, specify a list of sub-packages in the `workspaces` field of your `package.json`; it's conventional to place these sub-packages in a directory called `packages`.
+It's common for a monorepo to have the following structure:
+
+```
+tree
+<root>
+├── README.md
+├── bun.lockb
+├── package.json
+├── tsconfig.json
+└── packages
+    ├── pkg-a
+    │   ├── index.ts
+    │   ├── package.json
+    │   └── tsconfig.json
+    ├── pkg-b
+    │   ├── index.ts
+    │   ├── package.json
+    │   └── tsconfig.json
+    └── pkg-c
+    ├── index.ts
+    ├── package.json
+    └── tsconfig.json
+```
+
+In the root `package.json`, the `"workspaces"` key is used to indicate which subdirectories should be considered packages/workspaces within the monorepo. It conventional to place all the workspace in a directory called `packages`.
```json
{
"name": "my-project",
"version": "1.0.0",
- "workspaces": ["packages/*"]
+ "workspaces": ["packages/*"],
+ "devDependencies": {
+ "example-package-in-monorepo": "workspace:*"
+ }
}
```
@@ -14,9 +41,25 @@ To try it, specify a list of sub-packages in the `workspaces` field of your `pac
**Glob support** — Bun supports simple `<directory>/*` globs in `"workspaces"`. Full glob syntax (e.g. `**` and `?`) is not yet supported.
{% /callout %}
-This has a couple major benefits.
+Each workspace has it's own `package.json` When referencing other packages in the monorepo, use `"workspace:*"` as the version field in your `package.json`.
+
+```json
+{
+ "name": "pkg-a",
+ "version": "1.0.0",
+ "dependencies": {
+ "pkg-b": "workspace:*"
+ }
+}
+```
+
+{% callout %}
+**Version support** — Bun supports simple `workspace:*` versions in `"dependencies"`. Full version syntax (e.g. `workspace:^*`) is not yet supported.
+{% /callout %}
+
+Workspaces have a couple major benefits.
-- **Code can be split into logical parts.** If one package relies on another, you can simply add it as a dependency with `bun add`. If package `b` depends on `a`, `bun install` will symlink your local `packages/a` directory into the `node_modules` folder of `b`, instead of trying to download it from the npm registry.
+- **Code can be split into logical parts.** If one package relies on another, you can simply add it as a dependency in `package.json`. If package `b` depends on `a`, `bun install` will install your local `packages/a` directory into `node_modules` instead of downloading it from the npm registry.
- **Dependencies can be de-duplicated.** If `a` and `b` share a common dependency, it will be _hoisted_ to the root `node_modules` directory. This reduces redundant disk usage and minimizes "dependency hell" issues associated with having multiple versions of a package installed simultaneously.
{% callout %}
diff --git a/docs/installation.md b/docs/installation.md
index ad6e31c8f..6aa51737a 100644
--- a/docs/installation.md
+++ b/docs/installation.md
@@ -1,15 +1,20 @@
Bun ships as a single executable that can be installed a few different ways.
-## macOS and Linux
+## Installing
+
+### macOS and Linux
{% callout %}
-**Linux users** — The `unzip` package is required to install Bun. Kernel version 5.6 or higher is strongly recommended, but the minimum is 5.1.
+**Linux users** — The `unzip` package is required to install Bun. Use `sudo apt install unzip` to install `unzip` package.
+Kernel version 5.6 or higher is strongly recommended, but the minimum is 5.1. Use `uname -r` to check Kernel version.
{% /callout %}
{% codetabs %}
```bash#macOS/Linux_(curl)
$ curl -fsSL https://bun.sh/install | bash # for macOS, Linux, and WSL
+# to install a specific version
+$ curl -fsSL https://bun.sh/install | bash -s "bun-v1.0.0"
```
```bash#NPM
@@ -32,7 +37,7 @@ $ proto install bun
{% /codetabs %}
-## Windows
+### Windows
Bun provides a _limited, experimental_ native build for Windows. At the moment, only the Bun runtime is supported.
@@ -46,6 +51,77 @@ The test runner, package manager, and bundler are still under development. The f
- `bun link/unlink`
- `bun build`
+## Docker
+
+Bun provides a [Docker image](https://hub.docker.com/r/oven/bun/tags) that supports both Linux x64 and arm64.
+
+```bash
+$ docker pull oven/bun
+$ docker run --rm --init --ulimit memlock=-1:-1 oven/bun
+```
+
+There are also image variants for different operating systems.
+
+```bash
+$ docker pull oven/bun:debian
+$ docker pull oven/bun:slim
+$ docker pull oven/bun:alpine
+$ docker pull oven/bun:distroless
+```
+
+## Checking installation
+
+To check that Bun was installed successfully, open a new terminal window and run `bun --version`.
+
+```sh
+$ bun --version
+1.x.y
+```
+
+To see the precise commit of [oven-sh/bun](https://github.com/oven-sh/bun) that you're using, run `bun --revision`.
+
+```sh
+$ bun --revision
+1.x.y+b7982ac1318937560f38e0f8eb18f45eaa43480f
+```
+
+If you've installed Bun but are seeing a `command not found` error, you may have to manually add the installation directory (`~/.bun/bin`) to your `PATH`.
+
+{% details summary="How to add to your `PATH`" %}
+First, determine what shell you're using:
+
+```sh
+$ echo $SHELL
+/bin/zsh # or /bin/bash or /bin/fish
+```
+
+Then add these lines below to bottom of your shell's configuration file.
+
+{% codetabs %}
+
+```bash#~/.zshrc
+# add to ~/.zshrc
+export BUN_INSTALL="$HOME/.bun"
+export PATH="$BUN_INSTALL/bin:$PATH"
+```
+
+```bash#~/.bashrc
+# add to ~/.bashrc
+export BUN_INSTALL="$HOME/.bun"
+export PATH="$BUN_INSTALL/bin:$PATH"
+```
+
+```sh#~/.config/fish/config.fish
+# add to ~/.config/fish/config.fish
+export BUN_INSTALL="$HOME/.bun"
+export PATH="$BUN_INSTALL/bin:$PATH"
+```
+
+{% /codetabs %}
+Save the file. You'll need to open a new shell/terminal window for the changes to take effect.
+
+{% /details %}
+
## Upgrading
Once installed, the binary can upgrade itself.
@@ -68,6 +144,10 @@ $ bun upgrade --canary
[View canary build](https://github.com/oven-sh/bun/releases/tag/canary)
+{% callout %}
+**Note** — To switch back to a stable release from canary, run `bun upgrade` again with no flags.
+{% /callout %}
+
<!--
## Native
@@ -113,29 +193,9 @@ $ docker run --rm --init --ulimit memlock=-1:-1 oven/bun:edge
this is some output
``` -->
-## TypeScript
+<!-- ## Completions
-To install TypeScript definitions for Bun's built-in APIs in your project, install `bun-types`.
-
-```sh
-$ bun add -d bun-types # dev dependency
-```
-
-Then include `"bun-types"` in the `compilerOptions.types` in your `tsconfig.json`:
-
-```json-diff
- {
- "compilerOptions": {
-+ "types": ["bun-types"]
- }
- }
-```
-
-Refer to [Ecosystem > TypeScript](/docs/runtime/typescript) for a complete guide to TypeScript support in Bun.
-
-## Completions
-
-Shell auto-completion should be configured automatically when Bun is installed.
+Shell auto-completion should be configured automatically when Bun is installed!
If not, run the following command. It uses `$SHELL` to determine which shell you're using and writes a completion file to the appropriate place on disk. It's automatically re-run on every `bun upgrade`.
@@ -148,4 +208,28 @@ To write the completions to a custom location:
```bash
$ bun completions > path-to-file # write to file
$ bun completions /path/to/directory # write into directory
+``` -->
+
+## Uninstall
+
+If you need to remove Bun from your system, use the following commands.
+
+{% codetabs %}
+
+```bash#macOS/Linux_(curl)
+$ rm -rf ~/.bun # for macOS, Linux, and WSL
+```
+
+```bash#NPM
+$ npm uninstall -g bun
```
+
+```bash#Homebrew
+$ brew uninstall bun
+```
+
+```bash#Proto
+$ proto uninstall bun
+```
+
+{% /codetabs %}
diff --git a/docs/nav.ts b/docs/nav.ts
index 633177ade..edd50089e 100644
--- a/docs/nav.ts
+++ b/docs/nav.ts
@@ -35,12 +35,16 @@ export default {
page("quickstart", "Quickstart", {
description: "Get started with Bun by building and running a simple HTTP server in 6 lines of TypeScript.",
}),
- page("templates", "Templates", {
- description: "Hit the ground running with one of Bun's official templates, or download a template from GitHub.",
+ page("typescript", "TypeScript", {
+ description: "Install and configure type declarations for Bun's APIs",
}),
- page("guides", "Guides", {
- description: "A set of walkthrough guides and code snippets for performing common tasks with Bun",
- href: "/guides",
+
+ divider("Templating"),
+ page("cli/init", "`bun init`", {
+ description: "Scaffold an empty Bun project.",
+ }),
+ page("cli/bun-create", "`bun create`", {
+ description: "Scaffold a new Bun project from an official template or GitHub repo.",
}),
// page("typescript", "TypeScript"),
@@ -78,7 +82,6 @@ export default {
// page("bundev", "Dev server"),
// page("benchmarks", "Benchmarks"),
- // divider("Runtime"),
divider("Runtime"),
page("cli/run", "`bun run`", {
description: "Use `bun run` to execute JavaScript/TypeScript files and package.json scripts.",
@@ -101,6 +104,9 @@ export default {
// page("runtime/apis", "APIs", {
// description: `Bun is a new JavaScript runtime designed to be a faster, leaner, more modern replacement for Node.js.`,
// }),
+ page("runtime/env", "Environment variables", {
+ description: `How to read and set environment variables, plus how to use them to configure Bun`,
+ }),
page("runtime/bun-apis", "Bun APIs", {
description: `Bun provides a set of highly optimized native APIs for performing common tasks.`,
}),
@@ -129,7 +135,7 @@ export default {
page("runtime/autoimport", "Auto-install", {
description: `Never use node_modules again. Bun can optionally auto-install your dependencies on the fly.`,
}),
- page("runtime/configuration", "Configuration", {
+ page("runtime/bunfig", "bunfig.toml", {
description: `Bun's runtime is configurable with environment variables and the bunfig.toml config file.`,
}),
page("runtime/debugger", "Debugger", {
@@ -146,6 +152,21 @@ export default {
description:
"Install all dependencies with `bun install`, or manage dependencies with `bun add` and `bun remove`.",
}),
+ page("cli/add", "`bun add`", {
+ description: "Add dependencies to your project.",
+ }),
+ page("cli/remove", "`bun remove`", {
+ description: "Remove dependencies from your project.",
+ }),
+ page("cli/update", "`bun update`", {
+ description: "Update your project's dependencies.",
+ }),
+ page("cli/link", "`bun link`", {
+ description: "Install local packages as dependencies in your project.",
+ }),
+ page("cli/pm", "`bun pm`", {
+ description: "Utilities relating to package management with Bun.",
+ }),
page("install/cache", "Global cache", {
description:
"Bun's package manager installs all packages into a shared global cache to avoid redundant re-downloads.",
@@ -153,20 +174,26 @@ export default {
page("install/workspaces", "Workspaces", {
description: "Bun's package manager supports workspaces and mono-repo development workflows.",
}),
+ page("install/lifecycle", "Lifecycle scripts", {
+ description: "How Bun handles package lifecycle scripts with trustedDependencies",
+ }),
page("install/lockfile", "Lockfile", {
description:
- "Bun's binary lockfile `bun.lockb` tracks your resolved dependency ytrr, making future installs fast and repeatable.",
+ "Bun's binary lockfile `bun.lockb` tracks your resolved dependency tree, making future installs fast and repeatable.",
}),
page("install/registries", "Scopes and registries", {
description: "How to configure private scopes and custom package registries.",
}),
- page("install/utilities", "Utilities", {
- description: "Use `bun pm` to introspect your global module cache or project dependency tree.",
+ page("install/overrides", "Overrides and resolutions", {
+ description: "Specify version ranges for nested dependencies",
}),
+ // page("install/utilities", "Utilities", {
+ // description: "Use `bun pm` to introspect your global module cache or project dependency tree.",
+ // }),
divider("Bundler"),
page("bundler", "`Bun.build`", {
- description: "Bundle code for comsumption in the browser with Bun's native bundler.",
+ description: "Bundle code for consumption in the browser with Bun's native bundler.",
}),
// page("bundler/intro", "How bundlers work", {
// description: "A visual introduction to bundling",
@@ -328,7 +355,7 @@ export default {
page("project/benchmarking", "Benchmarking", {
description: `Bun is designed for performance. Learn how to benchmark Bun yourself.`,
}),
- page("project/development", "Development", {
+ page("project/contributing", "Contributing", {
description: "Learn how to contribute to Bun and get your local development environment up and running.",
}),
page("project/licensing", "License", {
diff --git a/docs/project/development.md b/docs/project/contributing.md
index c5345772c..9d0bee9f5 100644
--- a/docs/project/development.md
+++ b/docs/project/contributing.md
@@ -32,31 +32,37 @@ $ proto install bun
## Install LLVM
-Bun requires LLVM 15 and Clang 15 (`clang` is part of LLVM). This version requirement is to match WebKit (precompiled), as mismatching versions will cause memory allocation failures at runtime. In most cases, you can install LLVM through your system package manager:
+Bun requires LLVM 16 and Clang 16 (`clang` is part of LLVM). This version requirement is to match WebKit (precompiled), as mismatching versions will cause memory allocation failures at runtime. In most cases, you can install LLVM through your system package manager:
{% codetabs %}
```bash#macOS (Homebrew)
-$ brew install llvm@15
+$ brew install llvm@16
```
```bash#Ubuntu/Debian
$ # LLVM has an automatic installation script that is compatible with all versions of Ubuntu
-$ wget https://apt.llvm.org/llvm.sh -O - | sudo bash -s -- 15 all
+$ wget https://apt.llvm.org/llvm.sh -O - | sudo bash -s -- 16 all
```
```bash#Arch
$ sudo pacman -S llvm clang lld
```
+```bash#Fedora
+$ sudo dnf install 'dnf-command(copr)'
+$ sudo dnf copr enable -y @fedora-llvm-team/llvm-snapshots
+$ sudo dnf install llvm clang lld
+```
+
{% /codetabs %}
-If none of the above solutions apply, you will have to install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-15.0.7).
+If none of the above solutions apply, you will have to install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.6).
-Make sure LLVM 15 is in your path:
+Make sure LLVM 16 is in your path:
```bash
-$ which clang-15
+$ which clang-16
```
If not, run this to manually link it:
@@ -65,9 +71,17 @@ If not, run this to manually link it:
```bash#macOS (Homebrew)
# use fish_add_path if you're using fish
-$ export PATH="$PATH:$(brew --prefix llvm@15)/bin"
-$ export LDFLAGS="$LDFLAGS -L$(brew --prefix llvm@15)/lib"
-$ export CPPFLAGS="$CPPFLAGS -I$(brew --prefix llvm@15)/include"
+$ export PATH="$PATH:$(brew --prefix llvm@16)/bin"
+$ export LDFLAGS="$LDFLAGS -L$(brew --prefix llvm@16)/lib"
+$ export CPPFLAGS="$CPPFLAGS -I$(brew --prefix llvm@16)/include"
+```
+
+```bash#Arch
+
+$ export PATH="$PATH:/usr/lib/llvm16/bin"
+$ export LDFLAGS="$LDFLAGS -L/usr/lib/llvm16/lib"
+$ export CPPFLAGS="$CPPFLAGS -I/usr/lib/llvm16/include"
+
```
{% /codetabs %}
@@ -87,7 +101,11 @@ $ sudo apt install cargo ccache cmake git golang libtool ninja-build pkg-config
```
```bash#Arch
-$ pacman -S base-devel ccache cmake esbuild git go libiconv libtool make ninja pkg-config python rust sed unzip
+$ sudo pacman -S base-devel ccache cmake esbuild git go libiconv libtool make ninja pkg-config python rust sed unzip
+```
+
+```bash#Fedora
+$ sudo dnf install cargo ccache cmake git golang libtool ninja-build pkg-config rustc golang-github-evanw-esbuild libatomic-static libstdc++-static sed unzip
```
{% /codetabs %}
@@ -112,11 +130,11 @@ Zig can be installed either with our npm package [`@oven/zig`](https://www.npmjs
```bash
$ bun install -g @oven/zig
-$ zigup 0.12.0-dev.163+6780a6bbf
+$ zigup 0.12.0-dev.888+130227491
```
{% callout %}
-We last updated Zig on **July 18th, 2023**
+We last updated Zig on **October 12th, 2023**
{% /callout %}
## First Build
@@ -276,26 +294,6 @@ The above will probably also need Zig and/or C++ code rebuilt.
VSCode is the recommended IDE for working on Bun, as it has been configured. Once opening, you can run `Extensions: Show Recommended Extensions` to install the recommended extensions for Zig and C++. ZLS is automatically configured.
-### ZLS
-
-ZLS is the language server for Zig. The latest binary that the extension auto-updates may not function with the version of Zig that Bun uses. It may be more reliable to build ZLS from source:
-
-```bash
-$ git clone https://github.com/zigtools/zls
-$ cd zls
-$ git checkout f91ff831f4959efcb7e648dba4f0132c296d26c0
-$ zig build
-```
-
-Then add absolute paths to Zig and ZLS in your vscode config:
-
-```json
-{
- "zig.zigPath": "/path/to/zig/install/zig",
- "zig.zls.path": "/path/to/zls/zig-out/bin/zls"
-}
-```
-
## JavaScript builtins
When you change anything in `src/js/builtins/*` or switch branches, run this:
@@ -387,34 +385,32 @@ $ valgrind --fair-sched=try --track-origins=yes bun-debug <args>
## Updating `WebKit`
-The Bun team will occasionally bump the version of WebKit used in Bun. When this happens, you may see something like this with you run `git status`.
-
-```bash
-$ git status
-On branch my-branch
-Changes not staged for commit:
- (use "git add <file>..." to update what will be committed)
- (use "git restore <file>..." to discard changes in working directory)
- modified: src/bun.js/WebKit (new commits)
-```
-
-For performance reasons, `make submodule` does not automatically update the WebKit submodule. To update, run the following commands from the root of the Bun repo:
+The Bun team will occasionally bump the version of WebKit used in Bun. When this happens, you may see errors in `src/bun.js/bindings` during builds. When you see this, install the latest version of `bun-webkit` and re-compile.
```bash
$ bun install
$ make cpp
```
-<!-- Check the [Bun repo](https://github.com/oven-sh/bun/tree/main/src/bun.js) to get the hash of the commit of WebKit is currently being used.
+## Building WebKit locally + Debug mode of JSC
-{% image width="270" src="https://github.com/oven-sh/bun/assets/3084745/51730b73-89ef-4358-9a41-9563a60a54be" /%} -->
+WebKit is not cloned by default (to save time and disk space). To clone and build WebKit locally, run:
-<!--
```bash
-$ cd src/bun.js/WebKit
-$ git fetch
-$ git checkout <hash>
-``` -->
+# once you run this, `make submodule` can be used to automatically
+# update WebKit and the other submodules
+$ git submodule update --init --depth 1 --checkout src/bun.js/WebKit
+# to make a jsc release build
+$ make jsc
+# JSC debug build does not work perfectly with Bun yet, this is actively being
+# worked on and will eventually become the default.
+$ make jsc-build-linux-compile-debug cpp
+$ make jsc-build-mac-compile-debug cpp
+```
+
+Note that the WebKit folder, including build artifacts, is 8GB+ in size.
+
+If you are using a JSC debug build and using VScode, make sure to run the `C/C++: Select a Configuration` command to configure intellisense to find the debug headers.
## Troubleshooting
@@ -475,7 +471,7 @@ If you see an error about `cmakeconfig.h` not being found, this is because the p
$ bun install
```
-Check to see the command installed webkit, and you can manully look for `node_modules/bun-webkit-{platform}-{arch}`:
+Check to see the command installed webkit, and you can manually look for `node_modules/bun-webkit-{platform}-{arch}`:
```bash
# this should reveal two directories. if not, something went wrong
diff --git a/docs/quickstart.md b/docs/quickstart.md
index ea36a961f..ae7fc6087 100644
--- a/docs/quickstart.md
+++ b/docs/quickstart.md
@@ -42,6 +42,22 @@ const server = Bun.serve({
console.log(`Listening on http://localhost:${server.port} ...`);
```
+If you're using TypeScript, you may see a type error on the `Bun` global. To fix this, install `bun-types`.
+
+```sh
+$ bun add -d bun-types
+```
+
+Then add the following line to your `compilerOptions` in `tsconfig.json`.
+
+```json-diff#tsconfig.json
+{
+ "compilerOptions": {
++ "types": ["bun-types"]
+ }
+}
+```
+
Run the file from your shell.
```bash
@@ -74,7 +90,7 @@ Then run it with `bun run start`.
```bash
$ bun run start
$ bun run index.ts
- Listening on http://localhost:4000...
+ Listening on http://localhost:3000 ...
```
{% callout %}
diff --git a/docs/runtime/bunfig.md b/docs/runtime/bunfig.md
new file mode 100644
index 000000000..6950d8233
--- /dev/null
+++ b/docs/runtime/bunfig.md
@@ -0,0 +1,429 @@
+Bun's behavior can be configured using its configuration file, `bunfig.toml`.
+
+In general, Bun relies on pre-existing configuration files like `package.json` and `tsconfig.json` to configure its behavior. `bunfig.toml` is only necessary for configuring Bun-specific things. This file is optional, and Bun will work out of the box without it.
+
+## Global vs. local
+
+In general, it's recommended to add a `bunfig.toml` file to your project root, alongside your `package.json`.
+
+To configure Bun globally, you can also create a `.bunfig.toml` file at one of the following paths:
+
+- `$HOME/.bunfig.toml`
+- `$XDG_CONFIG_HOME/.bunfig.toml`
+
+If both a global and local `bunfig` are detected, the results are shallow-merged, with local overriding global. CLI flags will override `bunfig` setting where applicable.
+
+## Runtime
+
+Bun's runtime behavior is configured using top-level fields in the `bunfig.toml` file.
+
+### `preload`
+
+An array of scripts/plugins to execute before running a file or script.
+
+```toml
+# scripts to run before `bun run`-ing a file or script
+# register plugins by adding them to this list
+preload = ["./preload.ts"]
+```
+
+### `jsx`
+
+Configure how Bun handles JSX. You can also set these fields in the `compilerOptions` of your `tsconfig.json`, but they are supported here as well for non-TypeScript projects.
+
+```toml
+jsx = "react"
+jsxFactory = "h"
+jsxFragment = "Fragment"
+jsxImportSource = "react"
+```
+
+Refer to the tsconfig docs for more information on these fields.
+
+- [jsx](https://www.typescriptlang.org/tsconfig#jsx)
+- [jsxFactory](https://www.typescriptlang.org/tsconfig#jsxFactory)
+- [jsxFragment](https://www.typescriptlang.org/tsconfig#jsxFragment)
+- [jsxImportSource](https://www.typescriptlang.org/tsconfig#jsxImportSource)
+
+### `smol`
+
+Enable `smol` mode. This reduces memory usage at the cost of performance.
+
+```toml
+# Reduce memory usage at the cost of performance
+smol = true
+```
+
+### `logLevel`
+
+Set the log level. This can be one of `"debug"`, `"warn"`, or `"error"`.
+
+```toml
+logLevel = "debug" # "debug" | "warn" | "error"
+```
+
+### `define`
+
+The `define` field allows you to replace certain global identifiers with constant expressions. Bun will replace any usage of the identifier with the expression. The expression should be a JSON string.
+
+```toml
+[define]
+# Replace any usage of "process.env.bagel" with the string `lox`.
+# The values are parsed as JSON, except single-quoted strings are supported and `'undefined'` becomes `undefined` in JS.
+# This will probably change in a future release to be just regular TOML instead. It is a holdover from the CLI argument parsing.
+"process.env.bagel" = "'lox'"
+```
+
+### `loader`
+
+Configure how Bun maps file extensions to loaders. This is useful for loading files that aren't natively supported by Bun. If
+
+```toml
+[loader]
+# when a .bagel file is imported, treat it like a tsx file
+".bagel" = "tsx"
+```
+
+Bun supports the following loaders:
+
+- `jsx`
+- `js`
+- `ts`
+- `tsx`
+- `css`
+- `file`
+- `json`
+- `toml`
+- `wasm`
+- `napi`
+- `base64`
+- `dataurl`
+- `text`
+
+### `telemetry`
+
+The `telemetry` field permit to enable/disable the analytics records. Bun records bundle timings (so we can answer with data, "is Bun getting faster?") and feature usage (e.g., "are people actually using macros?"). The request body size is about 60 bytes, so it's not a lot of data. By default the telemetry is enabled. Equivalent of `DO_NOT_TRACK` env variable.
+
+```toml
+telemetry = false
+```
+
+## Test runner
+
+The test runner is configured under the `[test]` section of your bunfig.toml.
+
+```toml
+[test]
+# configuration goes here
+```
+
+### `test.root`
+
+The root directory to run tests from. Default `.`.
+
+```toml
+[test]
+root = "./__tests__"
+```
+
+### `test.preload`
+
+Same as the top-level `preload` field, but only applies to `bun test`.
+
+```toml
+[test]
+preload = ["./setup.ts"]
+```
+
+### `test.smol`
+
+Same as the top-level `smol` field, but only applies to `bun test`.
+
+```toml
+[test]
+smol = true
+```
+
+### `test.coverage`
+
+Enables coverage reporting. Default `false`. Use `--coverage` to override.
+
+```toml
+[test]
+coverage = false
+```
+
+### `test.coverageThreshold`
+
+To specify a coverage threshold. By default, no threshold is set. If your test suite does not meet or exceed this threshold, `bun test` will exit with a non-zero exit code to indicate the failure.
+
+```toml
+[test]
+
+# to require 90% line-level and function-level coverage
+coverageThreshold = 0.9
+```
+
+Different thresholds can be specified for line-wise, function-wise, and statement-wise coverage.
+
+```toml
+[test]
+coverageThreshold = { line = 0.7, function = 0.8, statement = 0.9 }
+```
+
+### `test.coverageSkipTestFiles`
+
+Whether to skip test files when computing coverage statistics. Default `false`.
+
+```toml
+[test]
+coverageSkipTestFiles = false
+```
+
+## Package manager
+
+Package management is a complex issue; to support a range of use cases, the behavior of `bun install` can be configured under the `[install]` section.
+
+```toml
+[install]
+# configuration here
+```
+
+### `install.optional`
+
+Whether to install optional dependencies. Default `true`.
+
+```toml
+[install]
+optional = true
+```
+
+### `install.dev`
+
+Whether to install development dependencies. Default `true`.
+
+```toml
+[install]
+dev = true
+```
+
+### `install.peer`
+
+Whether to install peer dependencies. Default `true`.
+
+```toml
+[install]
+peer = false
+```
+
+### `install.production`
+
+Whether `bun install` will run in "production mode". Default `false`.
+
+In production mode, `"devDependencies"` are not installed. You can use `--production` in the CLI to override this setting.
+
+```toml
+[install]
+production = false
+```
+
+### `install.exact`
+
+Whether to set an exact version in `package.json`. Default `false`.
+
+By default Bun uses caret ranges; if the `latest` version of a package is `2.4.1`, the version range in your `package.json` will be `^2.4.1`. This indicates that any version from `2.4.1` up to (but not including) `3.0.0` is acceptable.
+
+```toml
+[install]
+exact = false
+```
+
+<!--
+### `install.prefer`
+
+Whether the package manager should prefer offline or online dependency resolution. Default `"online"`.
+
+```toml
+[install]
+prefer = "online"
+```
+
+Valid values are:
+
+{% table %}
+
+---
+
+- `"online"`
+- Prefer online resolution. This is the default. If a package is not found in the local cache, it will be downloaded from the registry.
+
+---
+
+- `"offline"`
+- Prefer offline resolution. When possible, packages will be installed from the global cache. This minimizes the fraction of the time Bun will check for newer versions from the registry. If a package is not found in the global cache, it will be downloaded from the registry.
+
+{% /table %} -->
+
+### `install.auto`
+
+To configure Bun's package auto-install behavior. Default `"auto"` — when no `node_modules` folder is found, Bun will automatically install dependencies on the fly during execution.
+
+```toml
+[install]
+auto = "auto"
+```
+
+Valid values are:
+
+{% table %}
+
+- Value
+- Description
+
+---
+
+- `"auto"`
+- Resolve modules from local `node_modules` if it exists. Otherwise, auto-install dependencies on the fly.
+
+---
+
+- `"force"`
+- Always auto-install dependencies, even if `node_modules` exists.
+
+---
+
+- `"disable"`
+- Never auto-install dependencies.
+
+---
+
+- `"fallback"`
+- Check local `node_modules` first, the auto-install any packages that aren't found. You can enable this from the CLI with `bun -i`.
+
+{% /table %}
+
+### `install.frozenLockfile`
+
+When true, `bun install` will not update `bun.lockb`. Default `false`. If `package.json` and the existing `bun.lockb` are not in agreement, this will error.
+
+```toml
+[install]
+frozenLockfile = false
+```
+
+### `install.dryRun`
+
+Whether to install optional dependencies. Default `false`. When true, it's equivalent to setting `--dry-run` on all `bun install` commands.
+
+```toml
+[install]
+dryRun = false
+```
+
+### `install.globalDir`
+
+To configure the directory where Bun puts globally installed packages.
+
+```toml
+[install]
+# where `bun install --global` installs packages
+globalDir = "~/.bun/install/global"
+```
+
+### `install.globalBinDir`
+
+To configure the directory where Bun installs globally installed binaries and CLIs.
+
+```toml
+# where globally-installed package bins are linked
+globalBinDir = "~/.bun/bin"
+```
+
+### `install.registry`
+
+The default registry is `https://registry.npmjs.org/`. This can be globally configured in `bunfig.toml`:
+
+```toml
+[install]
+# set default registry as a string
+registry = "https://registry.npmjs.org"
+# set a token
+registry = { url = "https://registry.npmjs.org", token = "123456" }
+# set a username/password
+registry = "https://username:password@registry.npmjs.org"
+```
+
+### `install.scopes`
+
+To configure a registry for a particular scope (e.g. `@myorg/<package>`) use `install.scopes`. You can reference environment variables with `$variable` notation.
+
+```toml
+[install.scopes]
+# registry as string
+myorg = "https://username:password@registry.myorg.com/"
+
+# registry with username/password
+# you can reference environment variables
+myorg = { username = "myusername", password = "$npm_password", url = "https://registry.myorg.com/" }
+
+# registry with token
+myorg = { token = "$npm_token", url = "https://registry.myorg.com/" }
+```
+
+### `install.cache`
+
+To configure the cache behavior:
+
+```toml
+[install.cache]
+
+# the directory to use for the cache
+dir = "~/.bun/install/cache"
+
+# when true, don't load from the global cache.
+# Bun may still write to node_modules/.cache
+disable = false
+
+# when true, always resolve the latest versions from the registry
+disableManifest = false
+```
+
+### `install.lockfile`
+
+To configure lockfile behavior, use the `install.lockfile` section.
+
+Whether to generate a lockfile on `bun install`. Default `true`.
+
+```toml
+[install.lockfile]
+save = true
+```
+
+Whether to generate a non-Bun lockfile alongside `bun.lockb`. (A `bun.lockb` will always be created.) Currently `"yarn"` is the only supported value.
+
+```toml
+[install.lockfile]
+print = "yarn"
+```
+
+<!-- ## Debugging -->
+
+<!--
+```toml
+[debug]
+# When navigating to a blob: or src: link, open the file in your editor
+# If not, it tries $EDITOR or $VISUAL
+# If that still fails, it will try Visual Studio Code, then Sublime Text, then a few others
+# This is used by Bun.openInEditor()
+editor = "code"
+
+# List of editors:
+# - "subl", "sublime"
+# - "vscode", "code"
+# - "textmate", "mate"
+# - "idea"
+# - "webstorm"
+# - "nvim", "neovim"
+# - "vim","vi"
+# - "emacs"
+``` -->
diff --git a/docs/runtime/configuration.md b/docs/runtime/configuration.md
deleted file mode 100644
index 96385b87d..000000000
--- a/docs/runtime/configuration.md
+++ /dev/null
@@ -1,210 +0,0 @@
-There are two primary mechanisms for configuring the behavior of Bun.
-
-- environment variables
-- `bunfig.toml`: Bun's configuration file
-
-Configuring with `bunfig.toml` is optional. Bun aims to be zero-configuration out of the box, but is also highly configurable for advanced use cases. Your `bunfig.toml` should live in your project root alongside `package.json`.
-
-You can also create a global configuration file at the following paths:
-
-- `$HOME/.bunfig.toml`
-- `$XDG_CONFIG_HOME/.bunfig.toml`
-
-If both a global and local `bunfig` are detected, the results are shallow-merged, with local overridding global. CLI flags will override `bunfig` setting where applicable.
-
-## Runtime
-
-```toml
-# scripts to run before `bun run`ning a file or script
-# useful for registering plugins
-preload = ["./preload.ts"]
-
-# equivalent to corresponding tsconfig compilerOptions
-jsx = "react"
-jsxFactory = "h"
-jsxFragment = "Fragment"
-jsxImportSource = "react"
-
-# Reduce memory usage at the cost of performance
-smol = true
-
-# Set Bun's log level
-logLevel = "debug" # "debug", "warn", "error"
-
-[define]
-# Replace any usage of "process.env.bagel" with the string `lox`.
-# The values are parsed as JSON, except single-quoted strings are supported and `'undefined'` becomes `undefined` in JS.
-# This will probably change in a future release to be just regular TOML instead. It is a holdover from the CLI argument parsing.
-"process.env.bagel" = "'lox'"
-
-[loader]
-# When loading a .bagel file, run the JS parser
-".bagel" = "js"
-```
-
-## Test runner
-
-```toml
-[test]
-# Scripts to run before all test files
-preload = ["./setup.ts"]
-
-# Reduce memory usage at the cost of performance
-smol = true
-```
-
-## Package manager
-
-Package management is a complex issue; to support a range of use cases, the behavior of `bun install` can be configured in [`bunfig.toml`](/docs/runtime/configuration).
-
-### Default flags
-
-The following settings modify the core behavior of Bun's package management commands. **The default values are shown below.**
-
-```toml
-[install]
-
-# whether to install optionalDependencies
-optional = true
-
-# whether to install devDependencies
-dev = true
-
-# whether to install peerDependencies
-peer = false
-
-# equivalent to `--production` flag
-production = false
-
-# equivalent to `--frozen-lockfile` flag
-frozenLockfile = false
-
-# equivalent to `--dry-run` flag
-dryRun = false
-```
-
-### Private scopes and registries
-
-The default registry is `https://registry.npmjs.org/`. This can be globally configured in `bunfig.toml`:
-
-```toml
-[install]
-# set default registry as a string
-registry = "https://registry.npmjs.org"
-# set a token
-registry = { url = "https://registry.npmjs.org", token = "123456" }
-# set a username/password
-registry = "https://username:password@registry.npmjs.org"
-```
-
-To configure scoped registries:
-
-```toml
-[install.scopes]
-# registry as string
-myorg1 = "https://username:password@registry.myorg.com/"
-
-# registry with username/password
-# you can reference environment variables
-myorg12 = { username = "myusername", password = "$NPM_PASS", url = "https://registry.myorg.com/" }
-
-# registry with token
-myorg3 = { token = "$npm_token", url = "https://registry.myorg.com/" }
-```
-
-### Cache
-
-To configure caching behavior:
-
-```toml
-[install]
-# where `bun install --global` installs packages
-globalDir = "~/.bun/install/global"
-
-# where globally-installed package bins are linked
-globalBinDir = "~/.bun/bin"
-
-[install.cache]
-# the directory to use for the cache
-dir = "~/.bun/install/cache"
-
-# when true, don't load from the global cache.
-# Bun may still write to node_modules/.cache
-disable = false
-
-# when true, always resolve the latest versions from the registry
-disableManifest = false
-```
-
-### Lockfile
-
-To configure lockfile behavior:
-
-```toml
-[install.lockfile]
-
-# path to read bun.lockb from
-path = "bun.lockb"
-
-# path to save bun.lockb to
-savePath = "bun.lockb"
-
-# whether to save the lockfile to disk
-save = true
-
-# whether to save a non-Bun lockfile alongside bun.lockb
-# only "yarn" is supported
-print = "yarn"
-```
-
-### Debugging
-
-```toml
-[debug]
-# When navigating to a blob: or src: link, open the file in your editor
-# If not, it tries $EDITOR or $VISUAL
-# If that still fails, it will try Visual Studio Code, then Sublime Text, then a few others
-# This is used by Bun.openInEditor()
-editor = "code"
-
-# List of editors:
-# - "subl", "sublime"
-# - "vscode", "code"
-# - "textmate", "mate"
-# - "idea"
-# - "webstorm"
-# - "nvim", "neovim"
-# - "vim","vi"
-# - "emacs"
-```
-
-## Environment variables
-
-These environment variables are checked by Bun to detect functionality and toggle features.
-
-{% table %}
-
-- Name
-- Description
-
----
-
-- `TMPDIR`
-- Bun occasionally requires a directory to store intermediate assets during bundling or other operations. If unset, defaults to the platform-specific temporary directory: `/tmp` on Linux, `/private/tmp` on macOS.
-
----
-
-- `NO_COLOR`
-- If `NO_COLOR=1`, then ANSI color output is [disabled](https://no-color.org/).
-
----
-
-- `FORCE_COLOR`
-- If `FORCE_COLOR=1`, then ANSI color output is force enabled, even if `NO_COLOR` is set.
-
----
-
-- `DO_NOT_TRACK`
-- If `DO_NOT_TRACK=1`, then analytics are [disabled](https://do-not-track.dev/). Bun records bundle timings (so we can answer with data, "is Bun getting faster?") and feature usage (e.g., "are people actually using macros?"). The request body size is about 60 bytes, so it's not a lot of data.
-
-{% /table %}
diff --git a/docs/runtime/env.md b/docs/runtime/env.md
new file mode 100644
index 000000000..e38eabffd
--- /dev/null
+++ b/docs/runtime/env.md
@@ -0,0 +1,147 @@
+Bun reads your `.env` files automatically and provides idiomatic ways to read and write your environment variables programmatically. Plus, some aspects of Bun's runtime behavior can be configured with Bun-specific environment variables.
+
+## Setting environment variables
+
+Bun reads the following files automatically (listed in order of increasing precedence).
+
+- `.env`
+- `.env.production`, `.env.development`, `.env.test` (depending on value of `NODE_ENV`)
+- `.env.local`
+
+```txt#.env
+FOO=hello
+BAR=world
+```
+
+Variables can also be set via the command line.
+
+```sh
+$ FOO=helloworld bun run dev
+```
+
+Or programmatically by assigning a property to `process.env`.
+
+```ts
+process.env.FOO = "hello";
+```
+
+### Quotation marks
+
+Bun supports double quotes, single quotes, and
+
+### Expansion
+
+Environment variables are automatically _expanded_. This means you can reference previously-defined variables in your environment variables.
+
+```txt#.env
+FOO=world
+BAR=hello$FOO
+```
+
+```ts
+process.env.BAR; // => "helloworld"
+```
+
+This is useful for constructing connection strings or other compound values.
+
+```txt#.env
+DB_USER=postgres
+DB_PASSWORD=secret
+DB_HOST=localhost
+DB_PORT=5432
+DB_URL=postgres://$DB_USER:$DB_PASSWORD@$DB_HOST:$DB_PORT/$DB_NAME
+```
+
+This can be disabled by escaping the `$` with a backslash.
+
+```txt#.env
+FOO=world
+BAR=hello\$FOO
+```
+
+```ts
+process.env.BAR; // => "hello$FOO"
+```
+
+### `dotenv`
+
+Generally speaking, you won't need `dotenv` or `dotenv-expand` anymore, because Bun reads `.env` files automatically.
+
+## Reading environment variables
+
+The current environment variables can be accessed via `process.env`.
+
+```ts
+process.env.API_TOKEN; // => "secret"
+```
+
+Bun also exposes these variables via `Bun.env`, which is a simple alias of `process.env`.
+
+```ts
+Bun.env.API_TOKEN; // => "secret"
+```
+
+To print all currently-set environment variables to the command line, run `bun run env`. This is useful for debugging.
+
+```sh
+$ bun run env
+BAZ=stuff
+FOOBAR=aaaaaa
+<lots more lines>
+```
+
+## TypeScript
+
+In TypeScript, all properties of `process.env` are typed as `string | undefined`.
+
+```ts
+Bun.env.whatever;
+// string | undefined
+```
+
+To get autocompletion and tell TypeScript to treat a variable as a non-optional string, we'll use [interface merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-interfaces).
+
+```ts
+declare module "bun" {
+ interface Env {
+ AWESOME: string;
+ }
+}
+```
+
+Add this line to any file in your project. It will globally add the `AWESOME` property to `process.env` and `Bun.env`.
+
+```ts
+process.env.AWESOME; // => string
+```
+
+## Configuring Bun
+
+These environment variables are read by Bun and configure aspects of its behavior.
+
+{% table %}
+
+- Name
+- Description
+
+---
+
+- `TMPDIR`
+- Bun occasionally requires a directory to store intermediate assets during bundling or other operations. If unset, defaults to the platform-specific temporary directory: `/tmp` on Linux, `/private/tmp` on macOS.
+
+---
+
+- `NO_COLOR`
+- If `NO_COLOR=1`, then ANSI color output is [disabled](https://no-color.org/).
+
+---
+
+- `FORCE_COLOR`
+- If `FORCE_COLOR=1`, then ANSI color output is force enabled, even if `NO_COLOR` is set.
+
+---
+
+- `DO_NOT_TRACK`
+- If `DO_NOT_TRACK=1`, then analytics are [disabled](https://do-not-track.dev/). Bun records bundle timings (so we can answer with data, "is Bun getting faster?") and feature usage (e.g., "are people actually using macros?"). The request body size is about 60 bytes, so it's not a lot of data. Equivalent of `telemetry=false` in bunfig.
+
+{% /table %}
diff --git a/docs/runtime/hot.md b/docs/runtime/hot.md
index 07f3f0f66..c54868689 100644
--- a/docs/runtime/hot.md
+++ b/docs/runtime/hot.md
@@ -1,6 +1,6 @@
Bun supports two kinds of automatic reloading via CLI flags:
-- `--watch` mode, which hard restarts Bun's process when imported files change/
+- `--watch` mode, which hard restarts Bun's process when imported files change.
- `--hot` mode, which soft reloads the code (without restarting the process) when imported files change.
## `--watch` mode
@@ -52,6 +52,7 @@ serve({
{% /codetabs %}
+In this example, Bun is
![bun watch gif](https://user-images.githubusercontent.com/709451/228439002-7b9fad11-0db2-4e48-b82d-2b88c8625625.gif)
Running `bun test` in watch mode and `save-on-keypress` enabled:
@@ -64,7 +65,9 @@ $ bun --watch test
## `--hot` mode
-Use `bun --hot` to enable hot reloading when executing code with Bun.
+Use `bun --hot` to enable hot reloading when executing code with Bun. This is distinct from `--watch` mode in that Bun does not hard-restart the entire process. Instead, it detects code changes and updates its internal module cache with the new code.
+
+**Note** — This is not the same as hot reloading in the browser! Many frameworks provide a "hot reloading" experience, where you can edit & save your frontend code (say, a React component) and see the changes reflected in the browser without refreshing the page. Bun's `--hot` is the server-side equivalent of this experience. To get hot reloading in the browser, use a framework like [Vite](https://vitejs.dev).
```bash
$ bun --hot server.ts
@@ -99,15 +102,13 @@ Traditional file watchers like `nodemon` restart the entire process, so HTTP ser
### HTTP servers
-Bun provides the following simplified API for implementing HTTP servers. Refer to [API > HTTP](/docs/api/http) for full details.
+This makes it possible, for instance, to update your HTTP request handler without shutting down the server itself. When you save the file, your HTTP server will be reloaded with the updated code without the process being restarted. This results in seriously fast refresh speeds.
```ts#server.ts
-import {serve} from "bun";
-
globalThis.count ??= 0;
globalThis.count++;
-serve({
+Bun.serve({
fetch(req: Request) {
return new Response(`Reloaded ${globalThis.count} times`);
},
@@ -115,18 +116,16 @@ serve({
});
```
-The file above is simply exporting an object with a `fetch` handler defined. When this file is executed, Bun interprets this as an HTTP server and passes the exported object into `Bun.serve`.
-
-When you save the file, your HTTP server be reloaded with the updated code without the process being restarted. This results in seriously fast refresh speeds.
+<!-- The file above is simply exporting an object with a `fetch` handler defined. When this file is executed, Bun interprets this as an HTTP server and passes the exported object into `Bun.serve`. -->
-{% image src="https://user-images.githubusercontent.com/709451/195477632-5fd8a73e-014d-4589-9ba2-e075ad9eb040.gif" alt="Bun vs Nodemon refresh speeds" caption="Bun on the left, Nodemon on the right." /%}
+<!-- {% image src="https://user-images.githubusercontent.com/709451/195477632-5fd8a73e-014d-4589-9ba2-e075ad9eb040.gif" alt="Bun vs Nodemon refresh speeds" caption="Bun on the left, Nodemon on the right." /%} -->
{% callout %}
**Note** — In a future version of Bun, support for Vite's `import.meta.hot` is planned to enable better lifecycle management for hot reloading and to align with the ecosystem.
{% /callout %}
-{% details summary="Implementation `details`" %}
+{% details summary="Implementation details" %}
On hot reload, Bun:
diff --git a/docs/runtime/jsx.md b/docs/runtime/jsx.md
index ab9a14a8d..31a61652b 100644
--- a/docs/runtime/jsx.md
+++ b/docs/runtime/jsx.md
@@ -14,7 +14,7 @@ console.log(<Component message="Hello world!" />);
## Configuration
-Bun reads your `tsconfig.json` or `jsconfig.json` configuration files to determines how to perform the JSX transform internally. To avoid using either of these, the following options can also be defined in [`bunfig.toml`](/docs/runtime/configuration).
+Bun reads your `tsconfig.json` or `jsconfig.json` configuration files to determines how to perform the JSX transform internally. To avoid using either of these, the following options can also be defined in [`bunfig.toml`](/docs/runtime/bunfig).
The following compiler options are respected.
@@ -175,7 +175,7 @@ The function name used to represent [JSX fragments](https://react.dev/reference/
// output
import { myjsx, MyFragment } from "react";
- createElement("Box", { width: 5 }, "Hello");
+ myjsx(MyFragment, null, "Hello");
```
{% /table %}
diff --git a/docs/runtime/modules.md b/docs/runtime/modules.md
index 380903c6f..486ddea5f 100644
--- a/docs/runtime/modules.md
+++ b/docs/runtime/modules.md
@@ -24,24 +24,29 @@ export function hello() {
{% /codetabs %}
-When we run `index.ts`, it prints "Hello world".
+When we run `index.ts`, it prints "Hello world!".
```bash
$ bun index.ts
Hello world!
```
-In this case, we are importing from `./hello`, a relative path with no extension. To resolve this import, Bun will check for the following files in order:
+In this case, we are importing from `./hello`, a relative path with no extension. **Extensioned imports are optional but supported.** To resolve this import, Bun will check for the following files in order:
-- `./hello.ts`
- `./hello.tsx`
-- `./hello.js`
+- `./hello.jsx`
+- `./hello.ts`
- `./hello.mjs`
+- `./hello.js`
- `./hello.cjs`
+- `./hello.json`
+- `./hello/index.tsx`
+- `./hello/index.jsx`
- `./hello/index.ts`
+- `./hello/index.mjs`
- `./hello/index.js`
+- `./hello/index.cjs`
- `./hello/index.json`
-- `./hello/index.mjs`
Import paths are case-insensitive, meaning these are all valid imports:
@@ -58,7 +63,7 @@ import { hello } from "./hello";
import { hello } from "./hello.ts"; // this works
```
-There is one exception: if you import `from "*.js{x}"`, Bun will additionally check for a matching `*.ts{x}` file, to be compatible with TypeScript's [ES module support](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#new-file-extensions).
+If you import `from "*.js{x}"`, Bun will additionally check for a matching `*.ts{x}` file, to be compatible with TypeScript's [ES module support](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#new-file-extensions).
```ts#index.ts
import { hello } from "./hello";
@@ -88,7 +93,86 @@ exports.hello = hello;
That said, using CommonJS is discouraged in new projects.
-## Resolution
+## Module systems
+
+Bun has native support for CommonJS and ES modules. ES Modules are the recommended module format for new projects, but CommonJS modules are still widely used in the Node.js ecosystem.
+
+In Bun's JavaScript runtime, `require` can be used by both ES Modules and CommonJS modules. If the target module is an ES Module, `require` returns the module namespace object (equivalent to `import * as`). If the target module is a CommonJS module, `require` returns the `module.exports` object (as in Node.js).
+
+| Module Type | `require()` | `import * as` |
+| ----------- | ---------------- | ----------------------------------------------------------------------- |
+| ES Module | Module Namespace | Module Namespace |
+| CommonJS | module.exports | `default` is `module.exports`, keys of module.exports are named exports |
+
+### Using `require()`
+
+You can `require()` any file or package, even `.ts` or `.mjs` files.
+
+```ts
+const { foo } = require("./foo"); // extensions are optional
+const { bar } = require("./bar.mjs");
+const { baz } = require("./baz.tsx");
+```
+
+{% details summary="What is a CommonJS module?" %}
+
+In 2016, ECMAScript added support for [ES Modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules). ES Modules are the standard for JavaScript modules. However, millions of npm packages still use CommonJS modules.
+
+CommonJS modules are modules that use `module.exports` to export values. Typically, `require` is used to import CommonJS modules.
+
+```ts
+// my-commonjs.cjs
+const stuff = require("./stuff");
+module.exports = { stuff };
+```
+
+The biggest difference between CommonJS and ES Modules is that CommonJS modules are synchronous, while ES Modules are asynchronous. There are other differences too.
+
+- ES Modules support top-level `await` and CommonJS modules don't.
+- ES Modules are always in [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode), while CommonJS modules are not.
+- Browsers do not have native support for CommonJS modules, but they do have native support for ES Modules via `<script type="module">`.
+- CommonJS modules are not statically analyzable, while ES Modules only allow static imports and exports.
+
+**CommonJS Modules:** These are a type of module system used in JavaScript. One key feature of CommonJS modules is that they load and execute synchronously. This means that when you import a CommonJS module, the code in that module runs immediately, and your program waits for it to finish before moving on to the next task. It's similar to reading a book from start to finish without skipping pages.
+
+**ES Modules (ESM):** These are another type of module system introduced in JavaScript. They have a slightly different behavior compared to CommonJS. In ESM, static imports (imports made using `import` statements) are synchronous, just like CommonJS. This means that when you import an ESM using a regular `import` statement, the code in that module runs immediately, and your program proceeds in a step-by-step manner. Think of it like reading a book page by page.
+
+**Dynamic imports:** Now, here comes the part that might be confusing. ES Modules also support importing modules on the fly via the `import()` function. This is called a "dynamic import" and it's asynchronous, so it doesn't block the main program execution. Instead, it fetches and loads the module in the background while your program continues to run. Once the module is ready, you can use it. This is like getting additional information from a book while you're still reading it, without having to pause your reading.
+
+**In summary:**
+
+- CommonJS modules and static ES Modules (`import` statements) work in a similar synchronous way, like reading a book from start to finish.
+- ES Modules also offer the option to import modules asynchronously using the `import()` function. This is like looking up additional information in the middle of reading the book without stopping.
+
+{% /details %}
+
+### Using `import`
+
+You can `import` any file or package, even `.cjs` files.
+
+```ts
+import { foo } from "./foo"; // extensions are optional
+import bar from "./bar.ts";
+import { stuff } from "./my-commonjs.cjs";
+```
+
+### Using `import` and `require()` together
+
+In Bun, you can use `import` or `require` in the same file—they both work, all the time.
+
+```ts
+import { stuff } from "./my-commonjs.cjs";
+import Stuff from "./my-commonjs.cjs";
+const myStuff = require("./my-commonjs.cjs");
+```
+
+### Top level await
+
+The only exception to this rule is top-level await. You can't `require()` a file that uses top-level await, since the `require()` function is inherently synchronous.
+
+Fortunately, very few libraries use top-level await, so this is rarely a problem. But if you're using top-level await in your application code, make sure that file isn't being `require()` from elsewhere in your application. Instead, you should use `import` or [dynamic `import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import).
+
+## Importing packages
Bun implements the Node.js module resolution algorithm, so you can import packages from `node_modules` with a bare specifier.
@@ -107,8 +191,8 @@ Once it finds the `foo` package, Bun reads the `package.json` to determine how t
"bun": "./index.js",
"worker": "./index.js",
"node": "./index.js",
- "require": "./index.js", # if importer is CommonJS
- "import": "./index.mjs", # if importer is ES module
+ "require": "./index.js", // if importer is CommonJS
+ "import": "./index.mjs", // if importer is ES module
"default": "./index.js",
}
}
@@ -116,18 +200,38 @@ Once it finds the `foo` package, Bun reads the `package.json` to determine how t
Whichever one of these conditions occurs _first_ in the `package.json` is used to determine the package's entrypoint.
-Bun respects subpath [`"exports"`](https://nodejs.org/api/packages.html#subpath-exports) and [`"imports"`](https://nodejs.org/api/packages.html#imports). Specifying any subpath in the `"exports"` map will prevent other subpaths from being importable.
+Bun respects subpath [`"exports"`](https://nodejs.org/api/packages.html#subpath-exports) and [`"imports"`](https://nodejs.org/api/packages.html#imports).
```jsonc#package.json
{
"name": "foo",
"exports": {
- ".": "./index.js",
- "./package.json": "./package.json" // subpath
+ ".": "./index.js"
}
}
```
+Subpath imports and conditional imports work in conjunction with each other.
+
+```json
+{
+ "name": "foo",
+ "exports": {
+ ".": {
+ "import": "./index.mjs",
+ "require": "./index.js"
+ }
+ }
+}
+```
+
+As in Node.js, Specifying any subpath in the `"exports"` map will prevent other subpaths from being importable; you can only import files that are explicitly exported. Given the `package.json` above:
+
+```ts
+import stuff from "foo"; // this works
+import stuff from "foo/index.mjs"; // this doesn't
+```
+
{% callout %}
**Shipping TypeScript** — Note that Bun supports the special `"bun"` export condition. If your library is written in TypeScript, you can publish your (un-transpiled!) TypeScript files to `npm` directly. If you specify your package's `*.ts` entrypoint in the `"bun"` condition, Bun will directly import and execute your TypeScript source files.
{% /callout %}
@@ -159,67 +263,6 @@ In the spirit of treating TypeScript as a first-class citizen, the Bun runtime w
If you aren't a TypeScript user, you can create a [`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) in your project root to achieve the same behavior.
-## CommonJS
-
-Bun has native support for CommonJS modules. ES Modules are the recommended module format, but CommonJS modules are still widely used in the Node.js ecosystem. Bun supports both module formats.
-
-In Bun's JavaScript runtime, `require` can be used by both ES Modules and CommonJS modules. If the target module is an ES Module, `require` returns the module namespace object (equivalent to `import * as`). If the target module is a CommonJS module, `require` returns the `module.exports` object (as in Node.js).
-
-| Module Type | `require()` | `import * as` |
-| ----------- | ---------------- | ----------------------------------------------------------------------- |
-| ES Module | Module Namespace | Module Namespace |
-| CommonJS | module.exports | `default` is `module.exports`, keys of module.exports are named exports |
-
-### What is a CommonJS module?
-
-In 2016, ECMAScript added support for [ES Modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules). ES Modules are the standard for JavaScript modules. However, millions of npm packages still use CommonJS modules.
-
-CommonJS modules are modules that use `module.exports` to export values. Typically, `require` is used to import CommonJS modules.
-
-```ts
-// my-commonjs.cjs
-const stuff = require("./stuff");
-module.exports = { stuff };
-```
-
-The biggest difference between CommonJS and ES Modules is that CommonJS modules are synchronous, while ES Modules are asynchronous. There are other differences too, like ES Modules support top-level `await` and CommonJS modules don't. ES Modules are always in [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode), while CommonJS modules are not. Browsers do not have native support for CommonJS modules, but they do have native support for ES Modules (`<script type="module">`). CommonJS modules are not statically analyzable, while ES Modules only allow static imports and exports.
-
-### Importing CommonJS from ESM
-
-You can `import` or `require` CommonJS modules from ESM modules.
-
-```ts
-import { stuff } from "./my-commonjs.cjs";
-import Stuff from "./my-commonjs.cjs";
-const myStuff = require("./my-commonjs.cjs");
-```
-
-### Importing ESM from CommonJS
-
-```ts
-// this works in Bun but not Node.js
-const { stuff } = require("./my-esm.mjs");
-```
-
-### Importing CommonJS from CommonJS
-
-```ts
-const { stuff } = require("./my-commonjs.cjs");
-```
-
-#### Top-level await
-
-If you are using top-level await, you must use `import()` to import ESM modules from CommonJS modules.
-
-```ts
-import("./my-esm.js").then(({ stuff }) => {
- // ...
-});
-
-// this will throw an error if "my-esm.js" uses top-level await
-const { stuff } = require("./my-esm.js");
-```
-
{% details summary="Low-level details of CommonJS interop in Bun" %}
Bun's JavaScript runtime has native support for CommonJS. When Bun's JavaScript transpiler detects usages of `module.exports`, it treats the file as CommonJS. The module loader will then wrap the transpiled module in a function shaped like this:
diff --git a/docs/runtime/nodejs-apis.md b/docs/runtime/nodejs-apis.md
index 72504e664..4b58343e0 100644
--- a/docs/runtime/nodejs-apis.md
+++ b/docs/runtime/nodejs-apis.md
@@ -1,16 +1,16 @@
Bun aims for complete Node.js API compatibility. Most `npm` packages intended for `Node.js` environments will work with Bun out of the box; the best way to know for certain is to try it.
-This page is updated regularly to reflect compatibility status of the latest version of Bun. If you run into any bugs with a particular package, please [open an issue](https://bun.sh/issues). Opening issues for compatibility bugs helps us prioritize what to work on next.
+This page is updated regularly to reflect compatibility status of the latest version of Bun. The information below reflects Bun's compatibility with _Node.js v20_. If you run into any bugs with a particular package, please [open an issue](https://bun.sh/issues). Opening issues for compatibility bugs helps us prioritize what to work on next.
## Built-in modules
### [`node:assert`](https://nodejs.org/api/assert.html)
-🟢 Fully implemented.
+🟡 Missing `doesNotMatch`
### [`node:async_hooks`](https://nodejs.org/api/async_hooks.html)
-🟡 Only `AsyncLocalStorage`, and `AsyncResource` are implemented.
+🟡 Only `AsyncLocalStorage`, and `AsyncResource` are implemented. `AsyncResource` is missing `bind`.
### [`node:buffer`](https://nodejs.org/api/buffer.html)
@@ -18,7 +18,7 @@ This page is updated regularly to reflect compatibility status of the latest ver
### [`node:child_process`](https://nodejs.org/api/child_process.html)
-🟡 Missing `Stream` stdio, `proc.gid`, `proc.uid`. IPC has partial support and only current only works with other `bun` processes.
+🟡 Missing `Stream` stdio, `proc.gid` `proc.uid`. IPC has partial support and only current only works with other `bun` processes.
### [`node:cluster`](https://nodejs.org/api/cluster.html)
@@ -26,11 +26,13 @@ This page is updated regularly to reflect compatibility status of the latest ver
### [`node:console`](https://nodejs.org/api/console.html)
-🟡 Missing `Console` constructor.
+🟢 Fully implemented.
### [`node:crypto`](https://nodejs.org/api/crypto.html)
-🟡 Missing `crypto.Certificate` `crypto.ECDH` `crypto.KeyObject` `crypto.X509Certificate` `crypto.checkPrime{Sync}` `crypto.createPrivateKey` `crypto.createPublicKey` `crypto.createSecretKey` `crypto.diffieHellman` `crypto.generateKey{Sync}` `crypto.generateKeyPair{Sync}` `crypto.generatePrime{Sync}` `crypto.getCipherInfo` `crypto.{get|set}Fips` `crypto.hkdf` `crypto.hkdfSync` `crypto.secureHeapUsed` `crypto.setEngine` `crypto.sign` `crypto.verify`. Some methods are not optimized yet.
+🟡 Missing `Certificate` `ECDH` `X509Certificate` `checkPrime` `checkPrimeSync` `diffieHellman` `generatePrime` `generatePrimeSync` `getCipherInfo` `getFips` `hkdf` `hkdfSync` `secureHeapUsed` `setEngine` `setFips`
+
+Some methods are not optimized yet.
### [`node:dgram`](https://nodejs.org/api/dgram.html)
@@ -42,19 +44,19 @@ This page is updated regularly to reflect compatibility status of the latest ver
### [`node:dns`](https://nodejs.org/api/dns.html)
-🟢 Fully implemented.
+🟡 Missing `cancel` `setServers` `getDefaultResultOrder`
### [`node:domain`](https://nodejs.org/api/domain.html)
-🟢 Fully implemented.
+🟡 Missing `Domain` `active`
### [`node:events`](https://nodejs.org/api/events.html)
-🟡 Missing `on`
+🟡 Missing `on` `addAbortListener` `getMaxListeners`
### [`node:fs`](https://nodejs.org/api/fs.html)
-🟡 Missing `fs.fdatasync{Sync}` `fs.opendir{Sync}`. `fs.promises.open` incorrectly returns a file descriptor instead of a `FileHandle`.
+🟡 Missing `Dir` `fdatasync` `fdatasyncSync` `openAsBlob` `opendir` `opendirSync` `statfs` `statfsSync`. `fs.promises.open` incorrectly returns a file descriptor instead of a `FileHandle`.
### [`node:http`](https://nodejs.org/api/http.html)
@@ -74,11 +76,11 @@ This page is updated regularly to reflect compatibility status of the latest ver
### [`node:module`](https://nodejs.org/api/module.html)
-🟢 Fully implemented.
+🟢 Missing `runMain` `syncBuiltinESMExports`, `Module#load()`. Attempts to override or patch the module cache will fail.
### [`node:net`](https://nodejs.org/api/net.html)
-🟡 Missing `net.{get|set}DefaultAutoSelectFamily` `net.SocketAddress` `net.BlockList`.
+🟡 Missing `BlockList` `SocketAddress` `Stream` `getDefaultAutoSelectFamily` `getDefaultAutoSelectFamilyAttemptTimeout` `setDefaultAutoSelectFamily` `setDefaultAutoSelectFamilyAttemptTimeout` `Server#ref()` `Server#unref()` `Socket#ref()` `Socket#unref()`.
### [`node:os`](https://nodejs.org/api/os.html)
@@ -90,11 +92,11 @@ This page is updated regularly to reflect compatibility status of the latest ver
### [`node:perf_hooks`](https://nodejs.org/api/perf_hooks.html)
-🟡 Only `perf_hooks.performance.now()` and `perf_hooks.performance.timeOrigin` are implemented. Recommended to use `performance` global instead of `perf_hooks.performance`.
+🟡 Only `perf_hooks.performance.now()` and `perf_hooks.performance.timeOrigin` are implemented. Missing `Performance` `PerformanceMark` `PerformanceMeasure` `PerformanceObserverEntryList` `PerformanceResourceTiming` `createHistogram` `monitorEventLoopDelay`. It's recommended to use `performance` global instead of `perf_hooks.performance`.
### [`node:process`](https://nodejs.org/api/process.html)
-🟡 See `Globals > process`.
+🟡 See [`process`](#process) Global.
### [`node:punycode`](https://nodejs.org/api/punycode.html)
@@ -114,7 +116,7 @@ This page is updated regularly to reflect compatibility status of the latest ver
### [`node:stream`](https://nodejs.org/api/stream.html)
-🟢 Fully implemented.
+🟡 Missing `getDefaultHighWaterMark` `setDefaultHighWaterMark`
### [`node:string_decoder`](https://nodejs.org/api/string_decoder.html)
@@ -122,7 +124,7 @@ This page is updated regularly to reflect compatibility status of the latest ver
### [`node:sys`](https://nodejs.org/api/util.html)
-🟡 See `node:util`.
+🟡 See [`node:util`](#node-util).
### [`node:timers`](https://nodejs.org/api/timers.html)
@@ -130,7 +132,7 @@ This page is updated regularly to reflect compatibility status of the latest ver
### [`node:tls`](https://nodejs.org/api/tls.html)
-🟡 Missing `tls.createSecurePair`
+🟡 Missing `tls.createSecurePair`.
### [`node:trace_events`](https://nodejs.org/api/tracing.html)
@@ -142,11 +144,11 @@ This page is updated regularly to reflect compatibility status of the latest ver
### [`node:url`](https://nodejs.org/api/url.html)
-🟡 Missing `url.domainTo{ASCII|Unicode}`. Recommended to use `URL` and `URLSearchParams` globals instead.
+🟡 Missing `domainToASCII` `domainToUnicode`. It's recommended to use `URL` and `URLSearchParams` globals instead.
### [`node:util`](https://nodejs.org/api/util.html)
-🟡 Missing `util.MIMEParams` `util.MIMEType` `util.getSystemErrorMap()` `util.getSystemErrorName()` `util.parseArgs()` `util.stripVTControlCharacters()` `util.transferableAbortController()` `util.transferableAbortSignal()`.
+🟡 Missing `MIMEParams` `MIMEType` `aborted` `debug` `getSystemErrorMap` `getSystemErrorName` `parseArgs` `transferableAbortController` `transferableAbortSignal` `stripVTControlCharacters`
### [`node:v8`](https://nodejs.org/api/v8.html)
@@ -154,7 +156,7 @@ This page is updated regularly to reflect compatibility status of the latest ver
### [`node:vm`](https://nodejs.org/api/vm.html)
-🟡 Core functionality works, but VM modules are not implemented. `ShadowRealm` can be used.
+🟡 Core functionality works, but VM modules are not implemented. Missing `createScript`. `ShadowRealm` can be used.
### [`node:wasi`](https://nodejs.org/api/wasi.html)
@@ -162,266 +164,11 @@ This page is updated regularly to reflect compatibility status of the latest ver
### [`node:worker_threads`](https://nodejs.org/api/worker_threads.html)
-🟡 `Worker` doesn't support the following options: `eval`, `argv`, `execArgv`, `stdin`, `stdout`, `stderr`, `trackedUnmanagedFds`, `resourceLimits`. Missing `markAsUntransferable`, `moveMessagePortToContext`, `getHeapSnapshot`.
+🟡 `Worker` doesn't support the following options: `eval` `argv` `execArgv` `stdin` `stdout` `stderr` `trackedUnmanagedFds` `resourceLimits`. Missing `markAsUntransferable` `moveMessagePortToContext` `getHeapSnapshot`.
### [`node:zlib`](https://nodejs.org/api/zlib.html)
-🟡 Missing `zlib.brotli*`. Has not been optimized.
-
-<!-- {% block className="ScrollFrame" %}
-{% table %}
-
-- Module
-- Status
-- Notes
-
----
-
-- {% anchor id="node_assert" %} [`node:assert`](https://nodejs.org/api/assert.html) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_async_hooks" %} [`node:async_hooks`](https://nodejs.org/api/async_hooks.html) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_buffer" %} [`node:buffer`](https://nodejs.org/api/buffer.html) {% /anchor %}
-- 🟢
-
----
-
-- {% anchor id="node_child_process" %} [`node:child_process`](https://nodejs.org/api/child_process.html) {% /anchor %}
-- 🟡
-- Missing IPC, `Stream` stdio, `proc.gid`, `proc.uid`, advanced serialization.
-
----
-
-- {% anchor id="node_cluster" %} [`node:cluster`](https://nodejs.org/api/cluster.html) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_console" %} [`node:console`](https://nodejs.org/api/console.html) {% /anchor %}
-- 🟢
-- Recommended to use `console` global instead
-
----
-
-- {% anchor id="node_crypto" %} [`node:crypto`](https://nodejs.org/api/crypto.html) {% /anchor %}
-- 🟡
-- Missing `crypto.Certificate` `crypto.ECDH` `crypto.KeyObject` `crypto.X509Certificate` `crypto.checkPrime{Sync}` `crypto.createPrivateKey` `crypto.createPublicKey` `crypto.createSecretKey` `crypto.diffieHellman` `crypto.generateKey{Sync}` `crypto.generateKeyPair{Sync}` `crypto.generatePrime{Sync}` `crypto.getCipherInfo` `crypto.{get|set}Fips` `crypto.hkdf` `crypto.hkdfSync` `crypto.secureHeapUsed` `crypto.setEngine` `crypto.sign` `crypto.verify`. Some methods are not optimized yet.
-
----
-
-- {% anchor id="node_dgram" %} [`node:dgram`](https://nodejs.org/api/dgram.html) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_diagnostics_channel" %} [`node:diagnostics_channel`](https://nodejs.org/api/diagnostics_channel.html) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_dns" %} [`node:dns`](https://nodejs.org/api/dns.html) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_domain" %} [`node:domain`](https://nodejs.org/api/domain.html) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_events" %} [`node:events`](https://nodejs.org/api/events.html) {% /anchor %}
-- 🟡
-- Missing `EventEmitterAsyncResource` `events.on`.
-
----
-
-- {% anchor id="node_fs" %} [`node:fs`](https://nodejs.org/api/fs.html) {% /anchor %}
-- 🟡
-- Missing `fs.fdatasync{Sync}` `fs.opendir{Sync}`. `fs.promises.open` incorrectly returns a file descriptor instead of a `FileHandle`.
-
----
-
-- {% anchor id="node_http" %} [`node:http`](https://nodejs.org/api/http.html) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_http2" %} [`node:http2`](https://nodejs.org/api/http2.html) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_https" %} [`node:https`](https://nodejs.org/api/https.html) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_inspector" %} [`node:inspector`](https://nodejs.org/api/inspector.html) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_module" %} [`node:module`](https://nodejs.org/api/module.html) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_net" %} [`node:net`](https://nodejs.org/api/net.html) {% /anchor %}
-- 🟡
-- Missing `net.{get|set}DefaultAutoSelectFamily` `net.SocketAddress` `net.BlockList`.
-
----
-
-- {% anchor id="node_os" %} [`node:os`](https://nodejs.org/api/os.html) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_path" %} [`node:path`](https://nodejs.org/api/path.html) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_perf_hooks" %} [`node:perf_hooks`](https://nodejs.org/api/perf_hooks.html) {% /anchor %}
-- 🟡
-- Only `perf_hooks.performance.now()` and `perf_hooks.performance.timeOrigin` are implemented. Recommended to use `performance` global instead of `perf_hooks.performance`.
-
----
-
-- {% anchor id="node_process" %} [`node:process`](https://nodejs.org/api/process.html) {% /anchor %}
-- 🟡
-- See `Globals > process`.
-
----
-
-- {% anchor id="node_punycode" %} [`node:punycode`](https://nodejs.org/api/punycode.html) {% /anchor %}
-- 🟢
-- Fully implemented. _Deprecated by Node.js._
-
----
-
-- {% anchor id="node_querystring" %} [`node:querystring`](https://nodejs.org/api/querystring.html) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_readline" %} [`node:readline`](https://nodejs.org/api/readline.html) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_repl" %} [`node:repl`](https://nodejs.org/api/repl.html) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_stream" %} [`node:stream`](https://nodejs.org/api/stream.html) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_string_decoder" %} [`node:string_decoder`](https://nodejs.org/api/string_decoder.html) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_sys" %} [`node:sys`](https://nodejs.org/api/util.html) {% /anchor %}
-- 🟡
-- See `node:util`.
-
----
-
-- {% anchor id="node_timers" %} [`node:timers`](https://nodejs.org/api/timers.html) {% /anchor %}
-- 🟢
-- Recommended to use global `setTimeout`, et. al. instead.
-
----
-
-- {% anchor id="node_tls" %} [`node:tls`](https://nodejs.org/api/tls.html) {% /anchor %}
-- 🟡
-- Missing `tls.createSecurePair`
-
----
-
-- {% anchor id="node_trace_events" %} [`node:trace_events`](https://nodejs.org/api/tracing.html) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_tty" %} [`node:tty`](https://nodejs.org/api/tty.html) {% /anchor %}
-- 🟡
-- Missing `tty.ReadStream` and `tty.WriteStream`.
-
----
-
-- {% anchor id="node_url" %} [`node:url`](https://nodejs.org/api/url.html) {% /anchor %}
-- 🟡
-- Missing `url.domainTo{ASCII|Unicode}`. Recommended to use `URL` and `URLSearchParams` globals instead.
-
----
-
-- {% anchor id="node_util" %} [`node:util`](https://nodejs.org/api/util.html) {% /anchor %}
-- 🟡
-- Missing `util.MIMEParams` `util.MIMEType` `util.formatWithOptions()` `util.getSystemErrorMap()` `util.getSystemErrorName()` `util.parseArgs()` `util.stripVTControlCharacters()` `util.transferableAbortController()` `util.transferableAbortSignal()`.
-
----
-
-- {% anchor id="node_v8" %} [`node:v8`](https://nodejs.org/api/v8.html) {% /anchor %}
-- 🔴
-- `serialize` and `deserialize` use JavaScriptCore's wire format instead of V8's. Otherwise, not implemented. For profiling, use [`bun:jsc`](/docs/project/benchmarking#bunjsc) instead.
-
----
-
-- {% anchor id="node_vm" %} [`node:vm`](https://nodejs.org/api/vm.html) {% /anchor %}
-- 🟡
-- Core functionality works, but VM modules are not implemented. `ShadowRealm` can be used.
-
----
-
-- {% anchor id="node_wasi" %} [`node:wasi`](https://nodejs.org/api/wasi.html) {% /anchor %}
-- 🟡
-- Partially implemented.
-
----
-
-- {% anchor id="node_worker_threads" %} [`node:worker_threads`](https://nodejs.org/api/worker_threads.html) {% /anchor %}
-- 🔴
-- Not implemented, but coming soon.
-
----
-
-- {% anchor id="node_zlib" %} [`node:zlib`](https://nodejs.org/api/zlib.html) {% /anchor %}
-- 🟡
-- Missing `zlib.brotli*`
-
-{% /table %}
-{% /block %} -->
+🟡 Missing `BrotliCompress` `BrotliDecompress` `brotliCompressSync` `brotliDecompress` `brotliDecompressSync` `createBrotliCompress` `createBrotliDecompress`. Unoptimized.
## Globals
@@ -485,7 +232,7 @@ The table below lists all globals implemented by Node.js and Bun's current compa
### [`console`](https://developer.mozilla.org/en-US/docs/Web/API/console)
-🟡 Missing `Console` constructor.
+🟢 Fully implemented.
### [`CountQueuingStrategy`](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy)
@@ -589,7 +336,7 @@ The table below lists all globals implemented by Node.js and Bun's current compa
### [`process`](https://nodejs.org/api/process.html)
-🟡 Missing `process.allowedNodeEnvironmentFlags` `process.channel` `process.constrainedMemory()` `process.getActiveResourcesInfo/setActiveResourcesInfo()` `process.setuid/setgid/setegid/seteuid/setgroups()` `process.hasUncaughtExceptionCaptureCallback` `process.initGroups()` `process.report` `process.resourceUsage()`.
+🟡 Missing `domain` `hasUncaughtExceptionCaptureCallback` `initgroups` `report` `resourceUsage` `setUncaughtExceptionCaptureCallback` `setegid` `seteuid` `setgid` `setgroups` `setuid` `allowedNodeEnvironmentFlags` `getActiveResourcesInfo` `setActiveResourcesInfo` `moduleLoadList` `setSourceMapsEnabled` `channel`. `process.binding` is partially implemented.
### [`queueMicrotask()`](https://developer.mozilla.org/en-US/docs/Web/API/queueMicrotask)
@@ -621,7 +368,7 @@ The table below lists all globals implemented by Node.js and Bun's current compa
### [`require()`](https://nodejs.org/api/globals.html#require)
-🟢 Fully implemented, as well as [`require.main`](https://nodejs.org/api/modules.html#requiremain), [`require.cache`](https://nodejs.org/api/modules.html#requirecache), and [`require.resolve`](https://nodejs.org/api/modules.html#requireresolverequest-options)
+🟢 Fully implemented, including [`require.main`](https://nodejs.org/api/modules.html#requiremain), [`require.cache`](https://nodejs.org/api/modules.html#requirecache), [`require.resolve`](https://nodejs.org/api/modules.html#requireresolverequest-options)
### [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
@@ -702,421 +449,3 @@ The table below lists all globals implemented by Node.js and Bun's current compa
### [`WritableStreamDefaultWriter`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter)
🟢 Fully implemented.
-
-<!-- {% table %}
-
----
-
-- {% anchor id="node_abortcontroller" %} [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_abortsignal" %} [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_blob" %} [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_buffer" %} [`Buffer`](https://nodejs.org/api/buffer.html#class-buffer) {% /anchor %}
-- 🟡
-- Incomplete implementation of `base64` and `base64url` encodings.
-
----
-
-- {% anchor id="node_bytelengthqueuingstrategy" %} [`ByteLengthQueuingStrategy`](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_dirname" %} [`__dirname`](https://nodejs.org/api/globals.html#__dirname) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_filename" %} [`__filename`](https://nodejs.org/api/globals.html#__filename) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_atob" %} [`atob()`](https://developer.mozilla.org/en-US/docs/Web/API/atob) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_broadcastchannel" %} [`BroadcastChannel`](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_btoa" %} [`btoa()`](https://developer.mozilla.org/en-US/docs/Web/API/btoa) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_clearimmediate" %} [`clearImmediate()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/clearImmediate) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_clearinterval" %} [`clearInterval()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/clearInterval) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_cleartimeout" %} [`clearTimeout()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/clearTimeout) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_compressionstream" %} [`CompressionStream`](https://developer.mozilla.org/en-US/docs/Web/API/CompressionStream) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_console" %} [`console`](https://developer.mozilla.org/en-US/docs/Web/API/console) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_countqueuingstrategy" %} [`CountQueuingStrategy`](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_crypto" %} [`Crypto`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_crypto" %} [`SubtleCrypto (crypto)`](https://developer.mozilla.org/en-US/docs/Web/API/crypto) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_cryptokey" %} [`CryptoKey`](https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_customevent" %} [`CustomEvent`](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_decompressionstream" %} [`DecompressionStream`](https://developer.mozilla.org/en-US/docs/Web/API/DecompressionStream) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_event" %} [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_eventtarget" %} [`EventTarget`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_exports" %} [`exports`](https://nodejs.org/api/globals.html#exports) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_fetch" %} [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/fetch) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_formdata" %} [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_global" %} [`global`](https://nodejs.org/api/globals.html#global) {% /anchor %}
-- 🟢
-- Implemented. This is an object containing all objects in the global namespace. It's rarely referenced directly, as its contents are available without an additional prefix, e.g. `__dirname` instead of `global.__dirname`.
-
----
-
-- {% anchor id="node_globalthis" %} [`globalThis`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis) {% /anchor %}
-- 🟢
-- Aliases to `global`.
-
----
-
-- {% anchor id="node_headers" %} [`Headers`](https://developer.mozilla.org/en-US/docs/Web/API/Headers) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_messagechannel" %} [`MessageChannel`](https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_messageevent" %} [`MessageEvent`](https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_messageport" %} [`MessagePort`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_module" %} [`module`](https://nodejs.org/api/globals.html#module) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_performanceentry" %} [`PerformanceEntry`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_performancemark" %} [`PerformanceMark`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMark) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_performancemeasure" %} [`PerformanceMeasure`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMeasure) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_performanceobserver" %} [`PerformanceObserver`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_performanceobserverentrylist" %} [`PerformanceObserverEntryList`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserverEntryList) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_performanceresourcetiming" %} [`PerformanceResourceTiming`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_performance" %} [`performance`](https://developer.mozilla.org/en-US/docs/Web/API/performance) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_process" %} [`process`](https://nodejs.org/api/process.html) {% /anchor %}
-- 🟡
-- Missing `process.allowedNodeEnvironmentFlags` `process.channel()` `process.connected` `process.constrainedMemory()` `process.disconnect()` `process.getActiveResourcesInfo/setActiveResourcesInfo()` `process.setuid/setgid/setegid/seteuid/setgroups()` `process.hasUncaughtExceptionCaptureCallback` `process.initGroups()` `process.report` `process.resourceUsage()` `process.send()`.
-
----
-
-- {% anchor id="node_queuemicrotask" %} [`queueMicrotask()`](https://developer.mozilla.org/en-US/docs/Web/API/queueMicrotask) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_readablebytestreamcontroller" %} [`ReadableByteStreamController`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_readablestream" %} [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_readablestreambyobreader" %} [`ReadableStreamBYOBReader`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_readablestreambyobrequest" %} [`ReadableStreamBYOBRequest`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_readablestreamdefaultcontroller" %} [`ReadableStreamDefaultController`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_readablestreamdefaultreader" %} [`ReadableStreamDefaultReader`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_require" %} [`require()`](https://nodejs.org/api/globals.html#require) {% /anchor %}
-- 🟢
-- Fully implemented, as well as [`require.main`](https://nodejs.org/api/modules.html#requiremain), [`require.cache`](https://nodejs.org/api/modules.html#requirecache), and [`require.resolve`](https://nodejs.org/api/modules.html#requireresolverequest-options)
-
----
-
-- {% anchor id="node_response" %} [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_request" %} [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_setimmediate" %} [`setImmediate()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_setinterval" %} [`setInterval()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/setInterval) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_settimeout" %} [`setTimeout()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_structuredclone" %} [`structuredClone()`](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_subtlecrypto" %} [`SubtleCrypto`](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_domexception" %} [`DOMException`](https://developer.mozilla.org/en-US/docs/Web/API/DOMException) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_textdecoder" %} [`TextDecoder`](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_textdecoderstream" %} [`TextDecoderStream`](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoderStream) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_textencoder" %} [`TextEncoder`](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_textencoderstream" %} [`TextEncoderStream`](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoderStream) {% /anchor %}
-- 🔴
-- Not implemented.
-
----
-
-- {% anchor id="node_transformstream" %} [`TransformStream`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_transformstreamdefaultcontroller" %} [`TransformStreamDefaultController`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_url" %} [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_urlsearchparams" %} [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_webassembly" %} [`WebAssembly`](https://nodejs.org/api/globals.html#webassembly) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_writablestream" %} [`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_writablestreamdefaultcontroller" %} [`WritableStreamDefaultController`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController) {% /anchor %}
-- 🟢
-- Fully implemented.
-
----
-
-- {% anchor id="node_writablestreamdefaultwriter" %} [`WritableStreamDefaultWriter`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter) {% /anchor %}
-- 🟢
-- Fully implemented.
-
-{% /table %} -->
diff --git a/docs/runtime/plugins.md b/docs/runtime/plugins.md
index 0286c7887..f2e0d7c77 100644
--- a/docs/runtime/plugins.md
+++ b/docs/runtime/plugins.md
@@ -17,7 +17,7 @@ const myPlugin: BunPlugin = {
};
```
-Plugins have to be registered before any other code runs! To achieve this, use the `preload` option in your [`bunfig.toml`](/docs/runtime/configuration). Bun automatically loads the files/modules specified in `preload` before running a file.
+Plugins have to be registered before any other code runs! To achieve this, use the `preload` option in your [`bunfig.toml`](/docs/runtime/bunfig). Bun automatically loads the files/modules specified in `preload` before running a file.
```toml
preload = ["./myPlugin.ts"]
@@ -45,7 +45,7 @@ plugin(
);
```
-Bun's plugin API is based on [esbuild](https://esbuild.github.io/plugins). Only [a subset](/docs/bundler/vs-esbuild#plugin-api) of the esbuild API is implemented, but some esbuild plugins "just work" in Bun, like the official [MDX loader](https://mdxjs.com/packages/esbuild/):
+Bun's plugin API is loosely based on [esbuild](https://esbuild.github.io/plugins). Only [a subset](/docs/bundler/vs-esbuild#plugin-api) of the esbuild API is implemented, but some esbuild plugins "just work" in Bun, like the official [MDX loader](https://mdxjs.com/packages/esbuild/):
```jsx
import { plugin } from "bun";
@@ -84,15 +84,20 @@ plugin({
});
```
-With this plugin, data can be directly imported from `.yaml` files.
+Register this file in `preload`:
+
+```toml#bunfig.toml
+preload = ["./yamlPlugin.ts"]
+```
+
+Once the plugin is registered, `.yaml` and `.yml` files can be directly imported.
{% codetabs %}
```ts#index.ts
-import "./yamlPlugin.ts"
-import {name, releaseYear} from "./data.yml"
+import data from "./data.yml"
-console.log(name, releaseYear);
+console.log(data);
```
```yaml#data.yml
@@ -127,7 +132,7 @@ In this case we're using `"object"`—a built-in loader (intended for use by plu
---
- `ts`
-- `.ts` `.mts` `cts`
+- `.ts` `.mts` `.cts`
- Transform TypeScript then transpile
---
@@ -212,6 +217,91 @@ import MySvelteComponent from "./component.svelte";
console.log(mySvelteComponent.render());
```
+## Virtual Modules
+
+{% note %}
+
+This feature is currently only available at runtime with `Bun.plugin` and not yet supported in the bundler, but you can mimick the behavior using `onResolve` and `onLoad`.
+
+{% /note %}
+
+To create virtual modules at runtime, use `builder.module(specifier, callback)` in the `setup` function of a `Bun.plugin`.
+
+For example:
+
+```js
+import { plugin } from "bun";
+
+plugin({
+ name: "my-virtual-module",
+
+ setup(build) {
+ build.module(
+ // The specifier, which can be any string
+ "my-transpiled-virtual-module",
+ // The callback to run when the module is imported or required for the first time
+ () => {
+ return {
+ contents: "console.log('hello world!')",
+ loader: "js",
+ };
+ },
+ );
+
+ build.module("my-object-virtual-module", () => {
+ return {
+ exports: {
+ foo: "bar",
+ },
+ loader: "object",
+ };
+ });
+ },
+});
+
+// Sometime later
+// All of these work
+import "my-transpiled-virtual-module";
+require("my-transpiled-virtual-module");
+await import("my-transpiled-virtual-module");
+require.resolve("my-transpiled-virtual-module");
+
+import { foo } from "my-object-virtual-module";
+const object = require("my-object-virtual-module");
+await import("my-object-virtual-module");
+require.resolve("my-object-virtual-module");
+```
+
+### Overriding existing modules
+
+You can also override existing modules with `build.module`.
+
+```js
+import { plugin } from "bun";
+build.module("my-object-virtual-module", () => {
+ return {
+ exports: {
+ foo: "bar",
+ },
+ loader: "object",
+ };
+});
+
+require("my-object-virtual-module"); // { foo: "bar" }
+await import("my-object-virtual-module"); // { foo: "bar" }
+
+build.module("my-object-virtual-module", () => {
+ return {
+ exports: {
+ baz: "quix",
+ },
+ loader: "object",
+ };
+});
+require("my-object-virtual-module"); // { baz: "quix" }
+await import("my-object-virtual-module"); // { baz: "quix" }
+```
+
## Reading the config
Plugins can read and write to the [build config](/docs/bundler#api) with `build.config`.
diff --git a/docs/runtime/typescript.md b/docs/runtime/typescript.md
index eade2f13b..e7c59fb1a 100644
--- a/docs/runtime/typescript.md
+++ b/docs/runtime/typescript.md
@@ -1,119 +1,35 @@
Bun treats TypeScript as a first-class citizen.
-## Running `.ts` files
-
-Bun can directly execute `.ts` and `.tsx` files just like vanilla JavaScript, with no extra configuration. If you import a `.ts` or `.tsx` file (or an `npm` module that exports these files), Bun internally transpiles it into JavaScript then executes the file.
-
-**Note** — Similar to other build tools, Bun does not typecheck the files. Use [`tsc`](https://www.typescriptlang.org/docs/handbook/compiler-options.html) (the official TypeScript CLI) if you're looking to catch static type errors.
-
{% callout %}
-**Is transpiling still necessary?** — Because Bun can directly execute TypeScript, you may not need to transpile your TypeScript to run in production. Bun internally transpiles every file it executes (both `.js` and `.ts`), so the additional overhead of directly executing your `.ts/.tsx` source files is negligible.
-
-That said, if you are using Bun as a development tool but still targeting Node.js or browsers in production, you'll still need to transpile.
+**Note** — To add type declarations for Bun APIs like the `Bun` global, follow the instructions at [Intro > TypeScript](/docs/typescript). This page describes how the Bun runtime runs TypeScript code.
{% /callout %}
-## Configuring `tsconfig.json`
-
-Bun supports a number of features that TypeScript doesn't support by default, such as extensioned imports, top-level await, and `exports` conditions. It also implements global APIs like the `Bun`. To enable these features, your `tsconfig.json` must be configured properly.
-
-{% callout %}
-If you initialized your project with `bun init`, everything is already configured properly.
-{% /callout %}
-
-To get started, install the `bun-types` package.
-
-```sh
-$ bun add -d bun-types # dev dependency
-```
-
-If you're using a canary build of Bun, use the `canary` tag. The canary package is updated on every commit to the `main` branch.
+## Running `.ts` files
-```sh
-$ bun add -d bun-types@canary
-```
+Bun can directly execute `.ts` and `.tsx` files just like vanilla JavaScript, with no extra configuration. If you import a `.ts` or `.tsx` file (or an `npm` module that exports these files), Bun internally transpiles it into JavaScript then executes the file.
-<!-- ### Quick setup
+**Note** — Similar to other build tools, Bun does not typecheck the files. Use [`tsc`](https://www.typescriptlang.org/docs/handbook/compiler-options.html) (the official TypeScript CLI) if you're looking to catch static type errors.
{% callout %}
-**Note** — This approach requires TypeScript 5.0 or later!
-
-{% /callout %}
-
-Add the following to your `tsconfig.json`.
+**Is transpiling still necessary?** — Because Bun can directly execute TypeScript, you may not need to transpile your TypeScript to run in production. Bun internally transpiles every file it executes (both `.js` and `.ts`), so the additional overhead of directly executing your `.ts/.tsx` source files is negligible.
-```json-diff
- {
-+ "extends": ["bun-types"]
- // other options...
- }
-```
+That said, if you are using Bun as a development tool but still targeting Node.js or browsers in production, you'll still need to transpile.
-{% callout %}
-**Note** — The `"extends"` field in your `tsconfig.json` can accept an array of values. If you're already using `"extends"`, just add `"bun-types"` to the array.
{% /callout %}
-That's it! You should be able to use Bun's full feature set without seeing any TypeScript compiler errors.
-
-### Manual setup -->
-
-### Recommended `compilerOptions`
-
-These are the recommended `compilerOptions` for a Bun project.
-
-```jsonc
-{
- "compilerOptions": {
- // add Bun type definitions
- "types": ["bun-types"],
-
- // enable latest features
- "lib": ["esnext"],
- "module": "esnext",
- "target": "esnext",
-
- // if TS 5.x+
- "moduleResolution": "bundler",
- "noEmit": true,
- "allowImportingTsExtensions": true,
- "moduleDetection": "force",
- // if TS 4.x or earlier
- "moduleResolution": "nodenext",
-
- "jsx": "react-jsx", // support JSX
- "allowJs": true, // allow importing `.js` from `.ts`
- "esModuleInterop": true, // allow default imports for CommonJS modules
-
- // best practices
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "skipLibCheck": true
- }
-}
-```
-
-### Add DOM types
-
-Settings `"types": ["bun-types"]` means TypeScript will ignore other global type definitions, including `lib: ["dom"]`. To add DOM types into your project, add the following [triple-slash directives](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html) at the top of any TypeScript file in your project.
-
-```ts
-/// <reference lib="dom" />
-/// <reference lib="dom.iterable" />
-```
-
-The same applies to other global type definition _libs_ like `webworker`.
-
## Path mapping
When resolving modules, Bun's runtime respects path mappings defined in [`compilerOptions.paths`](https://www.typescriptlang.org/tsconfig#paths) in your `tsconfig.json`. No other runtime does this.
-Given the following `tsconfig.json`...
+Consider the following `tsconfig.json`.
```json
{
"compilerOptions": {
+ "baseUrl": "./src",
"paths": {
"data": ["./data.ts"]
}
@@ -121,7 +37,14 @@ Given the following `tsconfig.json`...
}
```
-...the import from `"data"` will work as expected.
+Bun will use `baseUrl` to resolve module paths.
+
+```ts
+// resolves to ./src/components/Button.tsx
+import { Button } from "components/Button.tsx";
+```
+
+Bun will also correctly resolve imports from `"data"`.
{% codetabs %}
diff --git a/docs/test/lifecycle.md b/docs/test/lifecycle.md
index fd804c9bb..3fa69b1e3 100644
--- a/docs/test/lifecycle.md
+++ b/docs/test/lifecycle.md
@@ -44,11 +44,11 @@ To scope the hooks to a test file:
```ts
import { describe, beforeAll } from "bun:test";
-describe("test group", () => {
- beforeAll(() => {
- // setup
- });
+beforeAll(() => {
+ // setup
+});
+describe("test group", () => {
// tests...
});
```
diff --git a/docs/test/mocks.md b/docs/test/mocks.md
index 31b5dab41..645e2a394 100644
--- a/docs/test/mocks.md
+++ b/docs/test/mocks.md
@@ -12,6 +12,23 @@ test("random", async () => {
});
```
+{% callout %}
+Alternatively, you can use the `jest.fn()` function, as in Jest. It behaves identically.
+
+```ts
+import { test, expect, jest } from "bun:test";
+const random = jest.fn(() => Math.random());
+
+test("random", async () => {
+ const val = random();
+ expect(val).toBeGreaterThan(0);
+ expect(random).toHaveBeenCalled();
+ expect(random).toHaveBeenCalledTimes(1);
+});
+```
+
+{% /callout %}
+
The result of `mock()` is a new function that's been decorated with some additional properties.
```ts
@@ -31,6 +48,29 @@ random.mock.results;
// ]
```
+The following properties and methods are implemented on mock functions.
+
+- [x] [mockFn.getMockName()](https://jestjs.io/docs/mock-function-api#mockfngetmockname)
+- [x] [mockFn.mock.calls](https://jestjs.io/docs/mock-function-api#mockfnmockcalls)
+- [x] [mockFn.mock.results](https://jestjs.io/docs/mock-function-api#mockfnmockresults)
+- [x] [mockFn.mock.instances](https://jestjs.io/docs/mock-function-api#mockfnmockinstances)
+- [x] [mockFn.mock.contexts](https://jestjs.io/docs/mock-function-api#mockfnmockcontexts)
+- [x] [mockFn.mock.lastCall](https://jestjs.io/docs/mock-function-api#mockfnmocklastcall)
+- [x] [mockFn.mockClear()](https://jestjs.io/docs/mock-function-api#mockfnmockclear)
+- [x] [mockFn.mockReset()](https://jestjs.io/docs/mock-function-api#mockfnmockreset)
+- [x] [mockFn.mockRestore()](https://jestjs.io/docs/mock-function-api#mockfnmockrestore)
+- [x] [mockFn.mockImplementation(fn)](https://jestjs.io/docs/mock-function-api#mockfnmockimplementationfn)
+- [x] [mockFn.mockImplementationOnce(fn)](https://jestjs.io/docs/mock-function-api#mockfnmockimplementationoncefn)
+- [x] [mockFn.mockName(name)](https://jestjs.io/docs/mock-function-api#mockfnmocknamename)
+- [x] [mockFn.mockReturnThis()](https://jestjs.io/docs/mock-function-api#mockfnmockreturnthis)
+- [x] [mockFn.mockReturnValue(value)](https://jestjs.io/docs/mock-function-api#mockfnmockreturnvaluevalue)
+- [x] [mockFn.mockReturnValueOnce(value)](https://jestjs.io/docs/mock-function-api#mockfnmockreturnvalueoncevalue)
+- [x] [mockFn.mockResolvedValue(value)](https://jestjs.io/docs/mock-function-api#mockfnmockresolvedvaluevalue)
+- [x] [mockFn.mockResolvedValueOnce(value)](https://jestjs.io/docs/mock-function-api#mockfnmockresolvedvalueoncevalue)
+- [x] [mockFn.mockRejectedValue(value)](https://jestjs.io/docs/mock-function-api#mockfnmockrejectedvaluevalue)
+- [x] [mockFn.mockRejectedValueOnce(value)](https://jestjs.io/docs/mock-function-api#mockfnmockrejectedvalueoncevalue)
+- [x] [mockFn.withImplementation(fn, callback)](https://jestjs.io/docs/mock-function-api#mockfnwithimplementationfn-callback)
+
## `.spyOn()`
It's possible to track calls to a function without replacing it with a mock. Use `spyOn()` to create a spy; these spies can be passed to `.toHaveBeenCalled()` and `.toHaveBeenCalledTimes()`.
diff --git a/docs/test/writing.md b/docs/test/writing.md
index ef26a802a..b8b0118f7 100644
--- a/docs/test/writing.md
+++ b/docs/test/writing.md
@@ -143,12 +143,6 @@ To run a test conditionally, use `test.if()`. The test will run if the condition
test.if(Math.random() > 0.5)("runs half the time", () => {
// ...
});
-```
-
-```ts
-test.if(Math.random() > 0.5)("runs half the time", () => {
- // ...
-});
const macOS = process.arch === "darwin";
test.if(macOS)("runs on macOS", () => {
@@ -174,252 +168,252 @@ Bun implements the following matchers. Full Jest compatibility is on the roadmap
---
-- 🟢
+- ✅
- [`.not`](https://jestjs.io/docs/expect#not)
---
-- 🟢
+- ✅
- [`.toBe()`](https://jestjs.io/docs/expect#tobevalue)
---
-- 🟢
+- ✅
- [`.toEqual()`](https://jestjs.io/docs/expect#toequalvalue)
---
-- 🟢
+- ✅
- [`.toBeNull()`](https://jestjs.io/docs/expect#tobenull)
---
-- 🟢
+- ✅
- [`.toBeUndefined()`](https://jestjs.io/docs/expect#tobeundefined)
---
-- 🟢
+- ✅
- [`.toBeNaN()`](https://jestjs.io/docs/expect#tobenan)
---
-- 🟢
+- ✅
- [`.toBeDefined()`](https://jestjs.io/docs/expect#tobedefined)
---
-- 🟢
+- ✅
- [`.toBeFalsy()`](https://jestjs.io/docs/expect#tobefalsy)
---
-- 🟢
+- ✅
- [`.toBeTruthy()`](https://jestjs.io/docs/expect#tobetruthy)
---
-- 🟢
+- ✅
- [`.toContain()`](https://jestjs.io/docs/expect#tocontainitem)
---
-- 🟢
+- ✅
- [`.toStrictEqual()`](https://jestjs.io/docs/expect#tostrictequalvalue)
---
-- 🟢
+- ✅
- [`.toThrow()`](https://jestjs.io/docs/expect#tothrowerror)
---
-- 🟢
+- ✅
- [`.toHaveLength()`](https://jestjs.io/docs/expect#tohavelengthnumber)
---
-- 🟢
+- ✅
- [`.toHaveProperty()`](https://jestjs.io/docs/expect#tohavepropertykeypath-value)
---
-- 🔴
+- ❌
- [`.extend`](https://jestjs.io/docs/expect#expectextendmatchers)
---
-- 🟢
+- ✅
- [`.anything()`](https://jestjs.io/docs/expect#expectanything)
---
-- 🟢
+- ✅
- [`.any()`](https://jestjs.io/docs/expect#expectanyconstructor)
---
-- 🔴
+- ❌
- [`.arrayContaining()`](https://jestjs.io/docs/expect#expectarraycontainingarray)
---
-- 🔴
+- ❌
- [`.assertions()`](https://jestjs.io/docs/expect#expectassertionsnumber)
---
-- 🔴
+- ❌
- [`.closeTo()`](https://jestjs.io/docs/expect#expectclosetonumber-numdigits)
---
-- 🔴
+- ❌
- [`.hasAssertions()`](https://jestjs.io/docs/expect#expecthasassertions)
---
-- 🔴
+- ❌
- [`.objectContaining()`](https://jestjs.io/docs/expect#expectobjectcontainingobject)
---
-- 🟢
+- ✅
- [`.stringContaining()`](https://jestjs.io/docs/expect#expectstringcontainingstring)
---
-- 🟢
+- ✅
- [`.stringMatching()`](https://jestjs.io/docs/expect#expectstringmatchingstring--regexp)
---
-- 🔴
+- ❌
- [`.addSnapshotSerializer()`](https://jestjs.io/docs/expect#expectaddsnapshotserializerserializer)
---
-- 🟢
+- ✅
- [`.resolves()`](https://jestjs.io/docs/expect#resolves)
---
-- 🟢
+- ✅
- [`.rejects()`](https://jestjs.io/docs/expect#rejects)
---
-- 🟢
+- ✅
- [`.toHaveBeenCalled()`](https://jestjs.io/docs/expect#tohavebeencalled)
---
-- 🟢
+- ✅
- [`.toHaveBeenCalledTimes()`](https://jestjs.io/docs/expect#tohavebeencalledtimesnumber)
---
-- 🔴
+- ❌
- [`.toHaveBeenCalledWith()`](https://jestjs.io/docs/expect#tohavebeencalledwitharg1-arg2-)
---
-- 🔴
+- ❌
- [`.toHaveBeenLastCalledWith()`](https://jestjs.io/docs/expect#tohavebeenlastcalledwitharg1-arg2-)
---
-- 🔴
+- ❌
- [`.toHaveBeenNthCalledWith()`](https://jestjs.io/docs/expect#tohavebeennthcalledwithnthcall-arg1-arg2-)
---
-- 🔴
+- ❌
- [`.toHaveReturned()`](https://jestjs.io/docs/expect#tohavereturned)
---
-- 🔴
+- ❌
- [`.toHaveReturnedTimes()`](https://jestjs.io/docs/expect#tohavereturnedtimesnumber)
---
-- 🔴
+- ❌
- [`.toHaveReturnedWith()`](https://jestjs.io/docs/expect#tohavereturnedwithvalue)
---
-- 🔴
+- ❌
- [`.toHaveLastReturnedWith()`](https://jestjs.io/docs/expect#tohavelastreturnedwithvalue)
---
-- 🔴
+- ❌
- [`.toHaveNthReturnedWith()`](https://jestjs.io/docs/expect#tohaventhreturnedwithnthcall-value)
---
-- 🟢
+- ✅
- [`.toBeCloseTo()`](https://jestjs.io/docs/expect#tobeclosetonumber-numdigits)
---
-- 🟢
+- ✅
- [`.toBeGreaterThan()`](https://jestjs.io/docs/expect#tobegreaterthannumber--bigint)
---
-- 🟢
+- ✅
- [`.toBeGreaterThanOrEqual()`](https://jestjs.io/docs/expect#tobegreaterthanorequalnumber--bigint)
---
-- 🟢
+- ✅
- [`.toBeLessThan()`](https://jestjs.io/docs/expect#tobelessthannumber--bigint)
---
-- 🟢
+- ✅
- [`.toBeLessThanOrEqual()`](https://jestjs.io/docs/expect#tobelessthanorequalnumber--bigint)
---
-- 🟢
+- ✅
- [`.toBeInstanceOf()`](https://jestjs.io/docs/expect#tobeinstanceofclass)
---
-- 🔴
+- ❌
- [`.toContainEqual()`](https://jestjs.io/docs/expect#tocontainequalitem)
---
-- 🟢
+- ✅
- [`.toMatch()`](https://jestjs.io/docs/expect#tomatchregexp--string)
---
-- 🟢
+- ✅
- [`.toMatchObject()`](https://jestjs.io/docs/expect#tomatchobjectobject)
---
-- 🟢
+- ✅
- [`.toMatchSnapshot()`](https://jestjs.io/docs/expect#tomatchsnapshotpropertymatchers-hint)
---
-- 🔴
+- ❌
- [`.toMatchInlineSnapshot()`](https://jestjs.io/docs/expect#tomatchinlinesnapshotpropertymatchers-inlinesnapshot)
---
-- 🔴
+- ❌
- [`.toThrowErrorMatchingSnapshot()`](https://jestjs.io/docs/expect#tothrowerrormatchingsnapshothint)
---
-- 🔴
+- ❌
- [`.toThrowErrorMatchingInlineSnapshot()`](https://jestjs.io/docs/expect#tothrowerrormatchinginlinesnapshotinlinesnapshot)
{% /table %}
diff --git a/docs/typescript.md b/docs/typescript.md
new file mode 100644
index 000000000..ca1b5cefd
--- /dev/null
+++ b/docs/typescript.md
@@ -0,0 +1,73 @@
+To install the TypeScript definitions for Bun's built-in APIs, install `bun-types`.
+
+```sh
+$ bun add -d bun-types # dev dependency
+```
+
+Then include `"bun-types"` in the `compilerOptions.types` in your `tsconfig.json`:
+
+```json-diff
+ {
+ "compilerOptions": {
++ "types": ["bun-types"]
+ }
+ }
+```
+
+At this point, you should be able to reference the `Bun` global in your TypeScript files without seeing errors in your editor.
+
+```ts
+console.log(Bun.version);
+```
+
+## Suggested `compilerOptions`
+
+Bun supports things like top-level await, JSX, and extensioned `.ts` imports, which TypeScript doesn't allow by default. Below is a set of recommended `compilerOptions` for a Bun project, so you can use these features without seeing compiler warnings from TypeScript.
+
+```jsonc
+{
+ "compilerOptions": {
+ // add Bun type definitions
+ "types": ["bun-types"],
+
+ // enable latest features
+ "lib": ["ESNext"],
+ "module": "esnext",
+ "target": "esnext",
+
+ // if TS 5.x+
+ "moduleResolution": "bundler",
+ "noEmit": true,
+ "allowImportingTsExtensions": true,
+ "moduleDetection": "force",
+ // if TS 4.x or earlier
+ // "moduleResolution": "nodenext",
+
+ "jsx": "react-jsx", // support JSX
+ "allowJs": true, // allow importing `.js` from `.ts`
+
+ // best practices
+ "strict": true,
+ "forceConsistentCasingInFileNames": true,
+ "skipLibCheck": true,
+ "composite": true,
+ "downlevelIteration": true,
+ "allowSyntheticDefaultImports": true
+ }
+}
+```
+
+If you run `bun init` in a new directory, this `tsconfig.json` will be generated for you.
+
+```sh
+$ bun init
+```
+
+## DOM types
+
+Unfortunately, setting a value for `"types"` means that TypeScript will ignore other global type definitions, including `lib: ["dom"]`. If you need to add DOM types into your project, add the following [triple-slash directives](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html) at the top of any TypeScript file in your project.
+
+```ts
+/// <reference lib="dom" />
+/// <reference lib="dom.iterable" />
+```
diff --git a/misctools/cold-jsc-start.cpp b/misctools/cold-jsc-start.cpp
index 2703d7016..cc1a25c25 100644
--- a/misctools/cold-jsc-start.cpp
+++ b/misctools/cold-jsc-start.cpp
@@ -132,9 +132,10 @@ int main(int argc, char **argv) {
vm.ref();
if (argc > 2) {
- auto source = JSC::makeSource(WTF::String::fromUTF8(argv[argc - 1]),
- SourceOrigin(WTF::URL("file://eval.js"_s)),
- "eval.js"_s);
+ auto source =
+ JSC::makeSource(WTF::String::fromUTF8(argv[argc - 1]),
+ SourceOrigin(WTF::URL("file://eval.js"_s)),
+ JSC::SourceTaintedOrigin::Untainted, "eval.js"_s);
NakedPtr<Exception> evaluationException;
JSValue returnValue =
@@ -163,7 +164,8 @@ int main(int argc, char **argv) {
if (auto contents = WTF::FileSystemImpl::readEntireFile(fileURLString)) {
auto source =
JSC::makeSource(WTF::String::fromUTF8(contents.value()),
- SourceOrigin(WTF::URL(fileURLString)), fileURLString);
+ SourceOrigin(WTF::URL(fileURLString)),
+ JSC::SourceTaintedOrigin::Untainted, fileURLString);
NakedPtr<Exception> evaluationException;
JSValue returnValue =
diff --git a/misctools/mime.js b/misctools/mime.js
index 27b58a5b7..0ff968918 100644
--- a/misctools/mime.js
+++ b/misctools/mime.js
@@ -15,8 +15,8 @@ for (let key of Object.keys(json).sort()) {
}
const withExtensions = [
- ...new Set([
- ...Object.keys(json)
+ ...new Set(
+ Object.keys(json)
.filter(key => {
return !!json[key]?.extensions?.length;
})
@@ -26,7 +26,7 @@ const withExtensions = [
});
})
.sort(),
- ]),
+ ),
];
all += "\n";
diff --git a/misctools/nodejs-compat.ts b/misctools/nodejs-compat.ts
new file mode 100644
index 000000000..92d865ee5
--- /dev/null
+++ b/misctools/nodejs-compat.ts
@@ -0,0 +1,210 @@
+const nodejsBuiltinModules = [
+ "assert",
+ "async_hooks",
+ "buffer",
+ "child_process",
+ "cluster",
+ "console",
+ "constants",
+ "crypto",
+ "dgram",
+ "diagnostics_channel",
+ "dns",
+ "domain",
+ "events",
+ "fs",
+ "http",
+ "http2",
+ "https",
+ "inspector",
+ "module",
+ "net",
+ "os",
+ "path",
+ "perf_hooks",
+ "process",
+ "punycode",
+ "querystring",
+ "readline",
+ "repl",
+ "stream",
+ "string_decoder",
+ "timers",
+ "tls",
+ "trace_events",
+ "tty",
+ "url",
+ "util",
+ "v8",
+ "vm",
+ "wasi",
+ "worker_threads",
+ "zlib",
+];
+
+function getModuleKeys(moduleName: string): string[] {
+ const script = `import('${moduleName}').then(mod=>console.log(JSON.stringify(Object.keys(mod))))`;
+ const nodeProc = Bun.spawnSync(["node", "-e", script], {
+ stderr: "ignore",
+ });
+ const nodeKeys: string[] = JSON.parse(nodeProc.stdout.toString());
+ return nodeKeys;
+}
+function getAllProperties(obj = {}) {
+ const allKeys = new Set();
+ do {
+ Reflect.ownKeys(obj).forEach(key => allKeys.add(key));
+ } while ((obj = Object.getPrototypeOf(obj)));
+ return [...allKeys];
+}
+
+function getPrototypeKeys(moduleName: string, className: string): string[] {
+ // const script = `import('${moduleName}').then(mod=>console.log(JSON.stringify(Object.keys(mod.${className}.prototype))))`;
+ const script = `
+ import("${moduleName}").then((mod) => {
+ const lines = new Set();
+ let obj = mod.${className}.prototype;
+ do {
+ Reflect.ownKeys(obj).forEach((key) => lines.add(key));
+ } while ((obj = Object.getPrototypeOf(obj)));
+ console.log("[", [...lines].map(k => \`"\${String(k)}"\`).join(","), "]");
+});`.replace(/\n/g, "");
+ // remove whitespace
+ // .replace(/\s+/g, "");
+ // console.log(script);
+ const nodeProc = Bun.spawnSync(["node", "-e", script], {
+ // stderr: "inherit",
+ // stdout: "inherit",
+ });
+ // console.log(nodeProc.stdout.toString());
+ const nodeKeys: string[] = JSON.parse(nodeProc.stdout.toString());
+
+ return nodeKeys;
+}
+const SKIP: Record<string, boolean> = {
+ "buffer.File": true,
+ "process.abort": true,
+ "process.exit": true,
+ "process.kill": true,
+ "process.reallyExit": true,
+ "vm.Script": true,
+ "zlib.deflate": true,
+ "zlib.inflate": true,
+ "zlib.unzip": true,
+ "zlib.deflateRaw": true,
+ "zlib.gunzip": true,
+ "zlib.gzip": true,
+ "zlib.inflateRaw": true,
+ "console.assert": true,
+ "console.count": true,
+ // "fs.mkdtempSync": true,
+ // "fs.read": true,
+ // "fs.readv": true,
+ // "fs.writev": true,
+ // "fs.writeSync": true,
+ // "fs.writeFileSync": true,
+ // "fs.writeFile": true,
+ // "fs.write": true,
+ // "fs.writevSync": true,
+ // "fs.watchFile": true,
+ // "fs.watch": true,
+ // "fs.utimesSync": true,
+ // "fs.utimes": true,
+ // "fs.unwatchFile": true,
+ // "fs.unlinkSync": true,
+ // "fs.unlink": true,
+ // "fs.truncateSync": true,
+ // "fs.truncate": true,
+ // "fs.symlinkSync": true,
+};
+
+for (const moduleName of nodejsBuiltinModules) {
+ const heading = `======== ${moduleName} ========`;
+
+ // print equals sign to match the length of heading
+ console.log("\n\n" + "=".repeat(heading.length));
+ console.log(heading);
+ console.log("=".repeat(heading.length));
+ const mod = await import(moduleName);
+ const bunKeys: string[] = Object.keys(mod);
+ const nodeKeys = getModuleKeys(moduleName);
+
+ // print top-level elements that are missing
+ // const missingKeys = nodeKeys
+ // .filter((key) => !bunKeys.includes(key))
+ // .filter((k) => !k.startsWith("_"));
+ // const notMissing = nodeKeys.filter((key) => bunKeys.includes(key));
+
+ // if (missingKeys.length === 0) {
+ // console.log(`Fully implemented.`);
+ // } else {
+ // console.log(`Missing ${missingKeys.map((k) => `\`${k}\``).join(" ")}`);
+ // }
+ console.log();
+
+ // check for prototype compatibility
+ let missing = false;
+ for (const k of nodeKeys) {
+ if (k.startsWith("_")) continue;
+ if (!bunKeys.includes(k)) {
+ missing = true;
+ console.log(` [${moduleName}.${k}] Not implemented.`);
+ continue;
+ }
+ if (mod[k] && typeof mod[k] === "function") {
+ if (!!mod[k].prototype) {
+ const className = `${moduleName}.${k}`;
+
+ const bunProtoKeys = getAllProperties(mod[k].prototype);
+ // console.log(mod[k].prototype);
+ // getAllProperties;
+ // for (const l in mod[k].prototype) {
+ // bunProtoKeys.push(l);
+ // }
+
+ const nodeProtoKeys = getPrototypeKeys(moduleName, k);
+ // console.log("nodeProtoKeys", nodeProtoKeys);
+ // console.log("bunProtoKeys", bunProtoKeys);
+
+ // console.log("nodeProtoKeys", nodeProtoKeys);
+ // console.log("bunProtoKeys", bunProtoKeys);
+ const missingProtoKeys = nodeProtoKeys.filter(key => !bunProtoKeys.includes(key));
+ // const notMissingProtoKeys = nodeProtoKeys.filter((key) =>
+ // bunProtoKeys.includes(key)
+ // );
+ if (missingProtoKeys.length === 0) {
+ console.log(` [${className}] Fully implemented.`);
+ } else {
+ missing = true;
+ console.log(
+ ` [${className}] Missing ${missingProtoKeys
+ .filter(k => !k.startsWith("_"))
+ .map(k => `\`${k}\``)
+ .join(" ")}`,
+ );
+ }
+ } else {
+ if (moduleName === "console") continue;
+ if (moduleName === "fs") continue;
+ if (SKIP[`${moduleName}.${k}`]) continue;
+ try {
+ // console.log(`trying ${moduleName}.${k}...`);
+ await mod[k]();
+ await Bun.sleep(1);
+ } catch (err: any) {
+ if ((err?.message as string).includes("not yet implemented")) {
+ missing = true;
+ console.log(` [${moduleName}.${k}] Not implemented.`);
+ }
+ }
+ }
+ }
+ }
+
+ if (!missing) {
+ console.log(`[${moduleName}] Fully implemented.`);
+ }
+}
+
+console.log("\n\n================\nDONE.");
+process.exit();
diff --git a/package.json b/package.json
index 45c27a719..86da17974 100644
--- a/package.json
+++ b/package.json
@@ -1,4 +1,5 @@
{
+ "name": "bun",
"dependencies": {
"@vscode/debugadapter": "^1.61.0",
"esbuild": "^0.17.15",
@@ -26,7 +27,7 @@
"@types/react": "^18.0.25",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.31.0",
- "bun-webkit": "0.0.1-48c1316e907ca597e27e5a7624160dc18a4df8ec"
+ "bun-webkit": "0.0.1-1a49a1f94bf42ab4f8c6b11d7bbbb21e491d2d62"
},
"version": "0.0.0",
"prettier": "./.prettierrc.cjs"
diff --git a/packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts b/packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts
index 51b2765b5..41847c6db 100644
--- a/packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts
+++ b/packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts
@@ -5,7 +5,7 @@ import { spawnSync } from "node:child_process";
run().catch(console.error);
async function run() {
- const cwd = new URL("../protocol/", import.meta.url);
+ const cwd = new URL("../src/protocol/", import.meta.url);
const runner = "Bun" in globalThis ? "bunx" : "npx";
const write = (name: string, data: string) => {
const path = new URL(name, cwd);
diff --git a/packages/bun-debug-adapter-protocol/src/protocol/index.d.ts b/packages/bun-debug-adapter-protocol/src/protocol/index.d.ts
index abf9ecdec..7a8dcc312 100644
--- a/packages/bun-debug-adapter-protocol/src/protocol/index.d.ts
+++ b/packages/bun-debug-adapter-protocol/src/protocol/index.d.ts
@@ -638,7 +638,7 @@ export namespace DAP {
*/
export type BreakpointLocationsRequest = {
/**
- * The source location of the breakpoints; either `source.path` or `source.reference` must be specified.
+ * The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified.
*/
source: Source;
/**
@@ -1139,6 +1139,12 @@ export namespace DAP {
* The value should be less than or equal to 2147483647 (2^31-1).
*/
indexedVariables?: number;
+ /**
+ * A memory reference to a location appropriate for this result.
+ * For pointer type eval results, this is generally a reference to the memory address contained in the pointer.
+ * This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
+ */
+ memoryReference?: string;
};
/**
* Arguments for `source` request.
@@ -1286,7 +1292,7 @@ export namespace DAP {
/**
* A memory reference to a location appropriate for this result.
* For pointer type eval results, this is generally a reference to the memory address contained in the pointer.
- * This attribute should be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
+ * This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
*/
memoryReference?: string;
};
@@ -1344,6 +1350,12 @@ export namespace DAP {
* The value should be less than or equal to 2147483647 (2^31-1).
*/
indexedVariables?: number;
+ /**
+ * A memory reference to a location appropriate for this result.
+ * For pointer type eval results, this is generally a reference to the memory address contained in the pointer.
+ * This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
+ */
+ memoryReference?: string;
};
/**
* Arguments for `stepInTargets` request.
@@ -2064,8 +2076,10 @@ export namespace DAP {
*/
indexedVariables?: number;
/**
- * The memory reference for the variable if the variable represents executable code, such as a function pointer.
- * This attribute is only required if the corresponding capability `supportsMemoryReferences` is true.
+ * A memory reference associated with this variable.
+ * For pointer type variables, this is generally a reference to the memory address contained in the pointer.
+ * For executable data, this reference may later be used in a `disassemble` request.
+ * This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
*/
memoryReference?: string;
};
diff --git a/packages/bun-debug-adapter-protocol/src/protocol/protocol.json b/packages/bun-debug-adapter-protocol/src/protocol/protocol.json
index 00a2ab014..41d65608e 100644
--- a/packages/bun-debug-adapter-protocol/src/protocol/protocol.json
+++ b/packages/bun-debug-adapter-protocol/src/protocol/protocol.json
@@ -108,7 +108,7 @@
{ "$ref": "#/definitions/Request" },
{
"type": "object",
- "description": "The `cancel` request is used by the client in two situations:\n- to indicate that it is no longer interested in the result produced by a specific request issued earlier\n- to cancel a progress sequence. Clients should only call this request if the corresponding capability `supportsCancelRequest` is true.\nThis request has a hint characteristic: a debug adapter can only be expected to make a 'best effort' in honoring this request but there are no guarantees.\nThe `cancel` request may return an error if it could not cancel an operation but a client should refrain from presenting this error to end users.\nThe request that got cancelled still needs to send a response back. This can either be a normal result (`success` attribute true) or an error response (`success` attribute false and the `message` set to `cancelled`).\nReturning partial results from a cancelled request is possible but please note that a client has no generic way for detecting that a response is partial or not.\nThe progress that got cancelled still needs to send a `progressEnd` event back.\n A client should not assume that progress just got cancelled after sending the `cancel` request.",
+ "description": "The `cancel` request is used by the client in two situations:\n- to indicate that it is no longer interested in the result produced by a specific request issued earlier\n- to cancel a progress sequence.\nClients should only call this request if the corresponding capability `supportsCancelRequest` is true.\nThis request has a hint characteristic: a debug adapter can only be expected to make a 'best effort' in honoring this request but there are no guarantees.\nThe `cancel` request may return an error if it could not cancel an operation but a client should refrain from presenting this error to end users.\nThe request that got cancelled still needs to send a response back. This can either be a normal result (`success` attribute true) or an error response (`success` attribute false and the `message` set to `cancelled`).\nReturning partial results from a cancelled request is possible but please note that a client has no generic way for detecting that a response is partial or not.\nThe progress that got cancelled still needs to send a `progressEnd` event back.\n A client should not assume that progress just got cancelled after sending the `cancel` request.",
"properties": {
"command": { "type": "string", "enum": ["cancel"] },
"arguments": { "$ref": "#/definitions/CancelArguments" }
@@ -1074,7 +1074,7 @@
"properties": {
"source": {
"$ref": "#/definitions/Source",
- "description": "The source location of the breakpoints; either `source.path` or `source.reference` must be specified."
+ "description": "The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified."
},
"line": {
"type": "integer",
@@ -2035,6 +2035,10 @@
"indexedVariables": {
"type": "integer",
"description": "The number of indexed child variables.\nThe client can use this information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31-1)."
+ },
+ "memoryReference": {
+ "type": "string",
+ "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
}
},
"required": ["value"]
@@ -2326,7 +2330,7 @@
},
"memoryReference": {
"type": "string",
- "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute should be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
+ "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
}
},
"required": ["result", "variablesReference"]
@@ -2397,6 +2401,10 @@
"indexedVariables": {
"type": "integer",
"description": "The number of indexed child variables.\nThe client can use this information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31-1)."
+ },
+ "memoryReference": {
+ "type": "string",
+ "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
}
},
"required": ["value"]
@@ -3240,7 +3248,7 @@
},
"memoryReference": {
"type": "string",
- "description": "The memory reference for the variable if the variable represents executable code, such as a function pointer.\nThis attribute is only required if the corresponding capability `supportsMemoryReferences` is true."
+ "description": "A memory reference associated with this variable.\nFor pointer type variables, this is generally a reference to the memory address contained in the pointer.\nFor executable data, this reference may later be used in a `disassemble` request.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
}
},
"required": ["name", "value", "variablesReference"]
@@ -3299,8 +3307,8 @@
"Indicates that the object is a constant.",
"Indicates that the object is read only.",
"Indicates that the object is a raw string.",
- "Indicates that the object can have an Object ID created for it.",
- "Indicates that the object has an Object ID associated with it.",
+ "Indicates that the object can have an Object ID created for it. This is a vestigial attribute that is used by some clients; 'Object ID's are not specified in the protocol.",
+ "Indicates that the object has an Object ID associated with it. This is a vestigial attribute that is used by some clients; 'Object ID's are not specified in the protocol.",
"Indicates that the evaluation had side effects.",
"Indicates that the object has its value tracked by a data breakpoint."
]
diff --git a/packages/bun-ecosystem/.gitignore b/packages/bun-ecosystem/.gitignore
deleted file mode 100644
index 2817d4e0b..000000000
--- a/packages/bun-ecosystem/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-node_modules
-tmp
diff --git a/packages/bun-ecosystem/README.md b/packages/bun-ecosystem/README.md
deleted file mode 100644
index 2ed8df0c7..000000000
--- a/packages/bun-ecosystem/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# bun-ecosystem
-
-A registry to test `npm` packages using Bun. This can be used as a tool to find bugs in Bun by running the test suites of these packages. In the future, we will run theses tests to catch regressions between releases.
-
-```sh
-bun run test
-```
diff --git a/packages/bun-ecosystem/bun.lockb b/packages/bun-ecosystem/bun.lockb
deleted file mode 100755
index 4eb6aded1..000000000
--- a/packages/bun-ecosystem/bun.lockb
+++ /dev/null
Binary files differ
diff --git a/packages/bun-ecosystem/package.json b/packages/bun-ecosystem/package.json
deleted file mode 100644
index 190314a31..000000000
--- a/packages/bun-ecosystem/package.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "name": "bun-ecosystem-ci",
- "private": true,
- "dependencies": {
- "globby": "^13.1.3"
- },
- "devDependencies": {
- "bun-types": "canary",
- "prettier": "^2.8.2"
- },
- "scripts": {
- "format": "prettier --write src",
- "test": "bun run src/runner.ts"
- }
-}
diff --git a/packages/bun-ecosystem/src/packages.ts b/packages/bun-ecosystem/src/packages.ts
deleted file mode 100644
index 677bfdf16..000000000
--- a/packages/bun-ecosystem/src/packages.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-export type Package = {
- readonly name: string;
- readonly repository: string;
- readonly cwd?: string;
- readonly tests?: {
- readonly style: "jest" | "ava" | "tape" | "custom";
- readonly include: string[];
- readonly exclude?: string[];
- readonly disabled?: boolean;
- };
-};
-
-export const packages: Package[] = [
- {
- name: "lodash",
- repository: github("lodash/lodash"),
- tests: {
- style: "jest",
- include: ["test/*.js"],
- exclude: [
- "debounce.test.js", // hangs runner
- "size.test.js", // require('vm').runInNewContext()
- "merge.test.js", // failing
- ],
- },
- },
- {
- name: "chalk",
- repository: github("chalk/chalk"),
- tests: {
- style: "ava",
- include: ["test/*.js"],
- },
- },
- {
- name: "request",
- repository: github("request/request"),
- tests: {
- style: "tape",
- include: ["tests/*.js"],
- },
- },
- {
- name: "commander",
- repository: github("tj/commander.js"),
- tests: {
- style: "jest",
- include: ["tests/*.js"],
- },
- },
- {
- name: "express",
- repository: github("expressjs/express"),
- tests: {
- style: "jest",
- include: ["test/**/*.js"],
- exclude: [
- "test/res.sendStatus.js", // https://github.com/oven-sh/bun/issues/887
- "test/Route.js", // https://github.com/oven-sh/bun/issues/2030
- ],
- // Most tests fail due to lack of "http2"
- disabled: true,
- },
- },
-];
-
-function github(repository: string): string {
- return `git@github.com:${repository}.git`;
-}
diff --git a/packages/bun-ecosystem/src/runner.ts b/packages/bun-ecosystem/src/runner.ts
deleted file mode 100644
index f95174808..000000000
--- a/packages/bun-ecosystem/src/runner.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-import type { Package } from "./packages";
-import { packages } from "./packages";
-import { existsSync, copyFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { globby } from "globby";
-
-for (const pkg of packages) {
- try {
- await loadPackage(pkg, "tmp");
- } catch (error) {
- console.error(pkg.name, error);
- }
-}
-
-async function loadPackage(pkg: Package, cwd?: string): Promise<void> {
- await gitClone({
- cwd,
- repository: pkg.repository,
- name: pkg.name,
- });
- const dir = join(cwd ?? "", pkg.name, pkg.cwd ?? "");
- await spawn({
- cwd: dir,
- cmd: ["bun", "install"],
- });
- if (!pkg.tests || pkg.tests.style !== "jest") {
- return;
- }
- const files = await globby(pkg.tests.include, {
- cwd: dir,
- ignore: pkg.tests.exclude ?? [crypto.randomUUID()],
- onlyFiles: true,
- caseSensitiveMatch: false,
- });
- if (!files.length) {
- throw new Error("No tests found");
- }
- for (const file of files) {
- let path = file;
- if (!file.includes(".test.")) {
- const ext = path.lastIndexOf(".");
- path = file.substring(0, ext) + ".test" + file.substring(ext);
- copyFileSync(join(dir, file), join(dir, path));
- }
- await spawn({
- cwd: dir,
- cmd: ["bun", "test", path],
- });
- }
-}
-
-type GitCloneOptions = {
- repository: string;
- cwd?: string;
- name?: string;
-};
-
-async function gitClone(options: GitCloneOptions): Promise<void> {
- const name = options.name ?? dirname(options.repository);
- const cwd = options.cwd ?? process.cwd();
- const path = join(cwd, name);
- if (existsSync(path)) {
- await spawn({
- cwd: path,
- cmd: ["git", "pull"],
- });
- } else {
- const url = `${options.repository}`;
- await spawn({
- cwd,
- cmd: ["git", "clone", "--single-branch", "--depth", "1", url, name],
- });
- }
-}
-
-type SpawnOptions = {
- cwd: string;
- cmd: string[];
-};
-
-async function spawn({ cwd, cmd }: SpawnOptions) {
- const { exited } = await Bun.spawn({
- cwd,
- cmd,
- stdout: "inherit",
- stderr: "inherit",
- });
- const exitCode = await exited;
- if (exitCode !== 0) {
- throw new Error(`"${cmd.join(" ")}" exited with ${exitCode}`);
- }
-}
diff --git a/packages/bun-ecosystem/tsconfig.json b/packages/bun-ecosystem/tsconfig.json
deleted file mode 100644
index 1b2f41220..000000000
--- a/packages/bun-ecosystem/tsconfig.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "compilerOptions": {
- "lib": ["ESNext"],
- "module": "ESNext",
- "target": "ESNext",
- "moduleResolution": "node",
- "types": ["bun-types"],
- "esModuleInterop": true,
- "allowJs": true,
- "strict": true,
- "resolveJsonModule": true
- },
- "include": [
- "src"
- ]
-}
diff --git a/packages/bun-framework-next/.npmignore b/packages/bun-framework-next/.npmignore
deleted file mode 100644
index cdb7baa1d..000000000
--- a/packages/bun-framework-next/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*.bun
-node_modules
-pnpm-log.yaml
-yarn-error.log
-yarn.lock \ No newline at end of file
diff --git a/packages/bun-framework-next/README.md b/packages/bun-framework-next/README.md
deleted file mode 100644
index 4df8999d1..000000000
--- a/packages/bun-framework-next/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-# bun-framework-next
-
-This package lets you use Next.js 12.2 with bun. This readme assumes you already installed bun.
-
-To start a new project:
-
-```bash
-bun create next --open
-```
-
-To use Next.js 12 with an existing project:
-
-```bash
-bun add bun-framework-next
-echo "framework = 'next'" > bunfig.toml
-bun bun
-```
-
-Launch the development server:
-
-```bash
-bun dev
-```
-
-Open http://localhost:3000 with your browser to see the result.
diff --git a/packages/bun-framework-next/appInjector.js b/packages/bun-framework-next/appInjector.js
deleted file mode 100644
index e8bf22d21..000000000
--- a/packages/bun-framework-next/appInjector.js
+++ /dev/null
@@ -1,15 +0,0 @@
-export function maybeInjectApp(expr) {
- var app;
- try {
- const path = Bun.routesDir + "/_app";
- app = Bun.resolveSync(path, Bun.cwd + "/");
- } catch (exception) {
- return undefined;
- }
-
- return (
- <>
- <import path={app} />
- </>
- );
-}
diff --git a/packages/bun-framework-next/bun.lockb b/packages/bun-framework-next/bun.lockb
deleted file mode 100755
index 7cb21bc37..000000000
--- a/packages/bun-framework-next/bun.lockb
+++ /dev/null
Binary files differ
diff --git a/packages/bun-framework-next/client.development.tsx b/packages/bun-framework-next/client.development.tsx
deleted file mode 100644
index 470dd2085..000000000
--- a/packages/bun-framework-next/client.development.tsx
+++ /dev/null
@@ -1,463 +0,0 @@
-globalThis.global = globalThis;
-globalThis.Bun_disableCSSImports = true;
-
-import * as React from "react";
-
-var ReactDOM;
-try {
- ReactDOM = require("react-dom/client");
-} catch (exception) {}
-
-if (!ReactDOM) {
- try {
- ReactDOM = require("react-dom");
- } catch (exception) {}
-}
-
-import NextApp from "next/app";
-import mitt, { MittEmitter } from "next/dist/shared/lib/mitt";
-import { RouterContext } from "next/dist/shared/lib/router-context";
-import Router, {
- AppComponent,
- AppProps,
- PrivateRouteInfo,
-} from "next/dist/shared/lib/router/router";
-
-import NextRouteLoader from "next/dist/client/route-loader";
-import { isDynamicRoute } from "next/dist/shared/lib/router/utils/is-dynamic";
-import {
- urlQueryToSearchParams,
- assign,
-} from "next/dist/shared/lib/router/utils/querystring";
-import { setConfig } from "next/dist/shared/lib/runtime-config";
-import { getURL, NEXT_DATA } from "next/dist/shared/lib/utils";
-
-import initHeadManager from "next/dist/client/head-manager";
-import { HeadManagerContext } from "next/dist/shared/lib/head-manager-context";
-import PageLoader from "./page-loader";
-import {
- createRouter,
- makePublicRouterInstance,
-} from "next/dist/client/router";
-
-export const emitter: MittEmitter<string> = mitt();
-
-declare global {
- interface Window {
- /* test fns */
- __NEXT_HYDRATED?: boolean;
- __NEXT_HYDRATED_CB?: () => void;
-
- /* prod */
- __NEXT_PRELOADREADY?: (ids?: (string | number)[]) => void;
- __NEXT_DATA__: NEXT_DATA;
- __NEXT_P: any[];
- }
-}
-
-function nextDataFromBunData() {
- const {
- router: { routes, route, params: paramsList },
- } = globalThis.__BUN_DATA__;
-
- const paramsMap = new Map();
- for (let i = 0; i < paramsList.keys.length; i++) {
- paramsMap.set(
- decodeURIComponent(paramsList.keys[i]),
- decodeURIComponent(paramsList.values[i]),
- );
- }
-
- const params = {};
- var url = new URL(location.href);
- Object.assign(params, Object.fromEntries(url.searchParams.entries()));
- Object.assign(params, Object.fromEntries(paramsMap.entries()));
-
- const pages = routes.keys.reduce((acc, routeName, i) => {
- const routePath = routes.values[i];
- acc[routeName] = [routePath];
- return acc;
- }, {});
-
- return {
- page: routes.keys[route],
- buildId: "1234",
- assetPrefix: "",
- isPreview: false,
- locale: null,
- locales: [],
- isFallback: false,
- err: null,
- props: {},
- query: params,
- pages,
- };
-}
-
-type RenderRouteInfo = PrivateRouteInfo & {
- App: AppComponent;
- scroll?: { x: number; y: number } | null;
-};
-
-const nextDataTag = document.getElementById("__NEXT_DATA__");
-
-// pages is added at runtime and doesn't exist in Next types
-const data: NEXT_DATA & { pages: Record<string, string[]> } = nextDataTag
- ? JSON.parse(document.getElementById("__NEXT_DATA__")!.textContent!)
- : nextDataFromBunData();
-
-window.__NEXT_DATA__ = data;
-
-const {
- props: hydrateProps,
- err: hydrateErr,
- page,
- query,
- buildId,
- assetPrefix,
- runtimeConfig,
- // Todo, revist this constant when supporting dynamic()
- dynamicIds,
- isFallback,
- locale,
- locales,
- domainLocales,
- isPreview,
- pages,
-} = data;
-
-const prefix: string = assetPrefix || "";
-
-setConfig({
- serverRuntimeConfig: {},
- publicRuntimeConfig: runtimeConfig || {},
-});
-
-let asPath: string = getURL();
-const basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || "";
-
-function pathNoQueryHash(path: string) {
- const queryIndex = path.indexOf("?");
- const hashIndex = path.indexOf("#");
-
- if (queryIndex > -1 || hashIndex > -1) {
- path = path.substring(0, queryIndex > -1 ? queryIndex : hashIndex);
- }
- return path;
-}
-
-function hasBasePath(path: string): boolean {
- path = pathNoQueryHash(path);
- return path === prefix || path.startsWith(prefix + "/");
-}
-
-function delBasePath(path: string): string {
- path = path.slice(basePath.length);
- if (!path.startsWith("/")) path = `/${path}`;
- return path;
-}
-
-// make sure not to attempt stripping basePath for 404s
-if (hasBasePath(asPath)) {
- asPath = delBasePath(asPath);
-}
-
-export const pageLoader: PageLoader = new PageLoader(buildId, prefix, pages);
-
-const headManager: {
- mountedInstances: Set<unknown>;
- updateHead: (head: JSX.Element[]) => void;
-} = initHeadManager();
-
-export let router: Router;
-
-let CachedApp: AppComponent = null;
-
-export default function boot(EntryPointNamespace) {
- _boot(EntryPointNamespace, false);
-}
-
-class Container extends React.Component<{
- fn: (err: Error, info?: any) => void;
-}> {
- componentDidCatch(componentErr: Error, info: any) {
- this.props.fn(componentErr, info);
- }
-
- componentDidMount() {
- this.scrollToHash();
-
- // We need to replace the router state if:
- // - the page was (auto) exported and has a query string or search (hash)
- // - it was auto exported and is a dynamic route (to provide params)
- // - if it is a client-side skeleton (fallback render)
- if (
- router.isSsr &&
- // We don't update for 404 requests as this can modify
- // the asPath unexpectedly e.g. adding basePath when
- // it wasn't originally present
- page !== "/404" &&
- page !== "/_error" &&
- (isFallback ||
- (data.nextExport &&
- (isDynamicRoute(router.pathname) ||
- location.search ||
- process.env.__NEXT_HAS_REWRITES)) ||
- (hydrateProps &&
- hydrateProps.__N_SSG &&
- (location.search || process.env.__NEXT_HAS_REWRITES)))
- ) {
- // update query on mount for exported pages
- router.replace(
- router.pathname +
- "?" +
- String(
- assign(
- urlQueryToSearchParams(router.query),
- new URLSearchParams(location.search),
- ),
- ),
- asPath,
- {
- // @ts-ignore
- // WARNING: `_h` is an internal option for handing Next.js
- // client-side hydration. Your app should _never_ use this property.
- // It may change at any time without notice.
- _h: 1,
- // Fallback pages must trigger the data fetch, so the transition is
- // not shallow.
- // Other pages (strictly updating query) happens shallowly, as data
- // requirements would already be present.
- shallow: !isFallback,
- },
- );
- }
- }
-
- componentDidUpdate() {
- this.scrollToHash();
- }
-
- scrollToHash() {
- let { hash } = location;
- hash = hash && hash.substring(1);
- if (!hash) return;
-
- const el: HTMLElement | null = document.getElementById(hash);
- if (!el) return;
-
- // If we call scrollIntoView() in here without a setTimeout
- // it won't scroll properly.
- setTimeout(() => el.scrollIntoView(), 0);
- }
-
- render() {
- return this.props.children;
- }
-}
-
-let CachedComponent: React.ComponentType;
-
-const wrapApp =
- (App: AppComponent) =>
- (wrappedAppProps: Record<string, any>): JSX.Element => {
- const appProps: AppProps = {
- ...wrappedAppProps,
- Component: CachedComponent,
- err: hydrateErr,
- router,
- };
- return (
- <AppContainer>
- <App {...appProps} />
- </AppContainer>
- );
- };
-
-function AppContainer({
- children,
-}: React.PropsWithChildren<{}>): React.ReactElement {
- return (
- <Container fn={(error) => <div>{JSON.stringify(error)}</div>}>
- <RouterContext.Provider value={makePublicRouterInstance(router)}>
- <HeadManagerContext.Provider value={headManager}>
- {children}
- </HeadManagerContext.Provider>
- </RouterContext.Provider>
- </Container>
- );
-}
-
-let reactRoot: any = null;
-
-const USE_REACT_18 = "hydrateRoot" in ReactDOM;
-
-class BootError extends Error {
- constructor(message) {
- super(message);
- this.name = "BootError";
- }
-}
-
-export async function _boot(EntryPointNamespace, isError) {
- NextRouteLoader.getClientBuildManifest = () => Promise.resolve({});
-
- const PageComponent = EntryPointNamespace.default;
-
- const appScripts = globalThis.__NEXT_DATA__.pages["/_app"];
-
- // Type 'typeof App' is not assignable to type 'ComponentClass<AppProps, any>'.
- // Construct signature return types 'App<any, any, any>' and 'Component<AppProps, any, any>' are incompatible.
- // @ts-expect-error
- CachedApp = NextApp;
- CachedComponent = PageComponent;
-
- if (appScripts && appScripts.length > 0) {
- let appSrc;
- for (let asset of appScripts) {
- if (!asset.endsWith(".css")) {
- appSrc = asset;
- break;
- }
- }
-
- if (appSrc) {
- const AppModule = await import(appSrc);
-
- console.assert(
- AppModule.default,
- appSrc + " must have a default export'd React component",
- );
-
- if ("default" in AppModule) {
- CachedApp = AppModule.default;
- }
- }
- }
-
- router = createRouter(page, query, asPath, {
- initialProps: hydrateProps,
- pageLoader,
- App: CachedApp,
- Component: CachedComponent,
- wrapApp,
- err: null,
- isFallback: Boolean(isFallback),
- subscription: async (info, App, scroll) => {
- return render(
- Object.assign<
- {},
- Omit<RenderRouteInfo, "App" | "scroll" | "Component">,
- Pick<RenderRouteInfo, "App" | "scroll" | "Component">
- >({}, info, {
- // If we don't have an info.Component, we may be shallow routing,
- // fallback to current entry point
- Component: info.Component || CachedComponent,
- App,
- scroll,
- }),
- );
- },
- locale,
- locales,
- defaultLocale: "",
- domainLocales,
- isPreview,
- });
-
- globalThis.next.router = router;
-
- var domEl = document.querySelector("#__next");
-
- if (!domEl) {
- const nextEl = document.createElement("div");
- nextEl.id = "__next";
- document.body.appendChild(nextEl);
- domEl = nextEl;
- }
-
- const reactEl = (
- <TopLevelRender
- App={CachedApp}
- Component={PageComponent}
- props={hydrateProps}
- />
- );
-
- if (USE_REACT_18) {
- if (!isError && domEl.hasChildNodes() && !reactRoot) {
- try {
- // Unlike with createRoot, you don't need a separate root.render() call here
- reactRoot = ReactDOM.hydrateRoot(domEl, reactEl);
- } catch (exception) {
- try {
- reactRoot = ReactDOM.createRoot(domEl);
- reactRoot.render(reactEl);
- } catch {
- throw exception;
- }
- }
- } else {
- if (!reactRoot) {
- reactRoot = ReactDOM.createRoot(domEl);
- }
-
- reactRoot.render(reactEl);
- }
- } else {
- if (isError || !domEl.hasChildNodes() || !("hydrate" in ReactDOM)) {
- ReactDOM.render(reactEl, domEl);
- } else {
- try {
- ReactDOM.hydrate(reactEl, domEl);
- } catch (e) {
- ReactDOM.render(reactEl, domEl);
- }
- }
- }
-}
-
-function TopLevelRender({ App, Component, props }) {
- return (
- <AppContainer>
- <App Component={Component} {...props}></App>
- </AppContainer>
- );
-}
-
-export function render(props) {
- if (USE_REACT_18) {
- reactRoot.render(<TopLevelRender {...props} />);
- } else {
- ReactDOM.render(
- <TopLevelRender {...props} />,
- document.getElementById("__next"),
- );
- }
-}
-
-export function renderError(e) {
- const reactEl = <AppContainer>{null}</AppContainer>;
-
- if (USE_REACT_18) {
- if (!reactRoot) {
- const domEl = document.querySelector("#__next");
-
- // Unlike with createRoot, you don't need a separate root.render() call here
- reactRoot = ReactDOM.hydrateRoot(domEl, reactEl);
- } else {
- reactRoot.render(reactEl);
- }
- } else {
- const domEl = document.querySelector("#__next");
-
- ReactDOM.render(reactEl, domEl);
- }
-}
-
-globalThis.next = {
- version: "12.0.4",
- emitter,
- render,
- renderError,
-};
diff --git a/packages/bun-framework-next/empty.js b/packages/bun-framework-next/empty.js
deleted file mode 100644
index bbf5800ce..000000000
--- a/packages/bun-framework-next/empty.js
+++ /dev/null
@@ -1 +0,0 @@
-// Keep this file here so that main resolves correctly
diff --git a/packages/bun-framework-next/fallback.development.tsx b/packages/bun-framework-next/fallback.development.tsx
deleted file mode 100644
index 6e3ff00ff..000000000
--- a/packages/bun-framework-next/fallback.development.tsx
+++ /dev/null
@@ -1,102 +0,0 @@
-import type { FallbackMessageContainer } from "../../src/api/schema";
-import { maybeInjectApp } from "macro:./appInjector";
-
-var globalStyles = [];
-function insertGlobalStyleSheet({ detail: url }) {
- globalStyles.push(
- new Promise((resolve, reject) => {
- const link: HTMLLinkElement = document.createElement("link");
- link.rel = "stylesheet";
- link.href = url;
- link.onload = resolve;
- link.onabort = reject;
- link.onerror = reject;
- document.head.appendChild(link);
- }),
- );
-}
-
-const nCSS = document.createElement("noscript");
-nCSS.setAttribute("data-n-css", "");
-document.head.appendChild(nCSS);
-
-document.addEventListener("onimportcss", insertGlobalStyleSheet);
-
-var once = false;
-function insertNextHeadCount() {
- if (!once) {
- document.head.insertAdjacentHTML(
- "beforeend",
- `<meta name="next-head-count" content="0">`,
- );
- once = true;
- }
-}
-
-maybeInjectApp();
-
-globalThis.__BUN_APP_STYLES = [...globalThis["__BUN"].allImportedStyles].map(
- (style) => {
- const url = new URL(style, location.origin);
- if (url.origin === location.origin && url.href === style) {
- return url.pathname;
- }
-
- return style;
- },
-);
-
-import { _boot, pageLoader } from "./client.development";
-
-function renderFallback({ router }: FallbackMessageContainer) {
- const route = router.routes.values[router.route];
-
- if (!document.getElementById("__next")) {
- const next = document.createElement("div");
- next.id = "__next";
- document.body.prepend(next);
- }
-
- document.removeEventListener("onimportcss", insertGlobalStyleSheet);
- document.addEventListener("onimportcss", pageLoader.onImportCSS);
-
- var cssQueue;
- return import(route)
- .then((Namespace) => {
- nCSS.remove();
- document.head.appendChild(nCSS);
- cssQueue = [...globalStyles, ...pageLoader.cssQueue];
- pageLoader.cssQueue = [];
- insertNextHeadCount();
- return _boot(Namespace, true);
- })
- .then(() => {
- cssQueue = [...cssQueue, ...pageLoader.cssQueue.slice()];
- pageLoader.cssQueue = [];
- return Promise.allSettled(cssQueue);
- })
- .finally(() => {
- document.body.style.visibility = "visible";
- document.removeEventListener("onimportcss", pageLoader.onImportCSS);
- });
-}
-
-export default function render(props: FallbackMessageContainer) {
- // @ts-expect-error bun:error.js is real
- return import("/bun:error.js").then(({ renderFallbackError }) => {
- return renderFallback(props).then(
- () => {
- Promise.all(pageLoader.cssQueue).finally(() => {
- renderFallbackError(props);
- document.body.style.visibility = "visible";
- });
- },
- (err) => {
- console.error(err);
- Promise.all(pageLoader.cssQueue).finally(() => {
- renderFallbackError(props);
- });
- },
- );
- });
-}
diff --git a/packages/bun-framework-next/next-image-polyfill.tsx b/packages/bun-framework-next/next-image-polyfill.tsx
deleted file mode 100644
index edc3775d7..000000000
--- a/packages/bun-framework-next/next-image-polyfill.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-function NextImagePolyfill({
- src,
- width,
- height,
- objectFit,
- style,
- layout,
- ...otherProps
-}) {
- var _style = style;
- if (layout === "fit") {
- objectFit = "contain";
- } else if (layout === "fill") {
- objectFit = "cover";
- }
-
- if (objectFit) {
- if (!_style) {
- _style = { objectFit: objectFit };
- } else {
- _style.objectFit = objectFit;
- }
- }
-
- return (
- <img
- src={src}
- width={width}
- height={height}
- style={_style}
- {...otherProps}
- />
- );
-}
-
-export default NextImagePolyfill;
diff --git a/packages/bun-framework-next/package.json b/packages/bun-framework-next/package.json
deleted file mode 100644
index a06294ba5..000000000
--- a/packages/bun-framework-next/package.json
+++ /dev/null
@@ -1,101 +0,0 @@
-{
- "name": "bun-framework-next",
- "version": "12.2.5",
- "main": "empty.js",
- "repository": "https://github.com/oven-sh/bun",
- "module": "empty.js",
- "description": "bun compatibility layer for Next.js >= v12.2.3",
- "homepage": "https://bun.sh",
- "bugs": {
- "url": "https://github.com/oven-sh/bun/issues"
- },
- "scripts": {
- "check": "tsc --noEmit"
- },
- "license": "MIT",
- "dependencies": {
- "react-is": "*"
- },
- "peerDependencies": {
- "next": "~12.2.3"
- },
- "devDependencies": {
- "@types/react": "^18",
- "@types/react-dom": "^18",
- "next": "^12.2.3",
- "react": "^18",
- "react-dom": "^18",
- "typescript": "^4"
- },
- "framework": {
- "displayName": "Next.js",
- "static": "public",
- "assetPrefix": "_next/",
- "router": {
- "dir": [
- "pages",
- "src/pages"
- ],
- "extensions": [
- ".js",
- ".ts",
- ".tsx",
- ".jsx"
- ]
- },
- "css": "onimportcss",
- "development": {
- "client": "client.development.tsx",
- "fallback": "fallback.development.tsx",
- "server": "server.development.tsx",
- "css": "onimportcss",
- "override": {
- "next/dist/client/image.js": "next-image-polyfill.tsx"
- },
- "define": {
- "client": {
- ".env": "NEXT_PUBLIC_",
- "defaults": {
- "process.env.__NEXT_TRAILING_SLASH": "false",
- "process.env.NODE_ENV": "'development'",
- "process.env.__NEXT_ROUTER_BASEPATH": "''",
- "process.env.__NEXT_SCROLL_RESTORATION": "false",
- "process.env.__NEXT_I18N_SUPPORT": "false",
- "process.env.__NEXT_HAS_REWRITES": "false",
- "process.env.__NEXT_ANALYTICS_ID": "null",
- "process.env.__NEXT_OPTIMIZE_CSS": "false",
- "process.env.__NEXT_CROSS_ORIGIN": "''",
- "process.env.__NEXT_STRICT_MODE": "false",
- "process.env.__NEXT_IMAGE_OPTS": "null"
- }
- },
- "server": {
- ".env": "NEXT_",
- "defaults": {
- "process.env.__NEXT_TRAILING_SLASH": "false",
- "process.env.__NEXT_OPTIMIZE_FONTS": "false",
- "process.env.NODE_ENV": "\"development\"",
- "process.env.__NEXT_OPTIMIZE_IMAGES": "false",
- "process.env.__NEXT_OPTIMIZE_CSS": "false",
- "process.env.__NEXT_ROUTER_BASEPATH": "''",
- "process.env.__NEXT_SCROLL_RESTORATION": "false",
- "process.env.__NEXT_I18N_SUPPORT": "false",
- "process.env.__NEXT_HAS_REWRITES": "false",
- "process.env.__NEXT_ANALYTICS_ID": "null",
- "process.env.__NEXT_CROSS_ORIGIN": "''",
- "process.env.__NEXT_STRICT_MODE": "false",
- "process.env.__NEXT_IMAGE_OPTS": "null",
- "global": "globalThis",
- "window": "undefined"
- }
- }
- }
- },
- "production": {
- "client": "empty.js",
- "server": "empty.js",
- "fallback": "empty.js",
- "css": "onimportcss"
- }
- }
-}
diff --git a/packages/bun-framework-next/packageVersion.ts b/packages/bun-framework-next/packageVersion.ts
deleted file mode 100644
index d6ff0b21d..000000000
--- a/packages/bun-framework-next/packageVersion.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import { readFileSync } from "fs";
-
-var memoizeMap;
-
-// This gives us a package version inline into the build without pulling in the whole package.json
-// it only parses the package.json for a given package name once (relative to the directory of this file)
-export function packageVersion(call) {
- var name = call.arguments[0].toString();
-
- // in the general case, this would break when using multiple versions of the same package
- // but people don't use multiple versions of next in the same bundle
- // so we don't need to worry about it here
- // and it skips resolveSync which is a bit faster
- if (memoizeMap) {
- const value = memoizeMap.get(name);
- if (value) return value;
- }
- var nextPath;
- try {
- nextPath = Bun.resolveSync(`${name}/package.json`, import.meta.dir);
- } catch (exception) {
- throw new Error(`${name} is not a valid package name`);
- }
-
- var json;
- try {
- // TODO: Add sync methods to FileBlob?
- json = JSON.parse(readFileSync(nextPath, "utf8"));
- } catch (exc) {
- throw new AggregateError([exc], `Error parsing ${name}/package.json`);
- }
-
- if (!json.version) {
- throw new Error(`${name}/package.json is missing a version`);
- }
-
- if (!memoizeMap) {
- memoizeMap = new Map();
- }
-
- memoizeMap.set(name, json.version);
-
- return json.version;
-}
diff --git a/packages/bun-framework-next/page-loader.ts b/packages/bun-framework-next/page-loader.ts
deleted file mode 100644
index c74b22fbf..000000000
--- a/packages/bun-framework-next/page-loader.ts
+++ /dev/null
@@ -1,138 +0,0 @@
-import NextPageLoader, {
- GoodPageCache as NextGoodPageCache,
-} from "next/dist/client/page-loader";
-import getAssetPathFromRoute from "next/dist/shared/lib/router/utils/get-asset-path-from-route";
-
-export function insertStyleSheet(url: string, isFallback: boolean = false) {
- if (document.querySelector(`link[href="${url}"]`)) {
- return Promise.resolve();
- }
-
- return new Promise((resolve, reject) => {
- const link: HTMLLinkElement = document.createElement("link");
- link.rel = "stylesheet";
-
- // marking this resolve as void seems to break other things
- link.onload = resolve;
- link.onerror = reject;
-
- link.href = url;
-
- if (isFallback) {
- link.setAttribute("data-href", url);
- }
-
- document.head.appendChild(link);
- });
-}
-
-interface GoodPageCache extends NextGoodPageCache {
- __N_SSG: boolean;
- __N_SSP: boolean;
-}
-
-export default class PageLoader extends NextPageLoader {
- constructor(_, __, pages) {
- super(_, __);
-
- // TODO: assetPrefix?
-
- // Rewrite the pages object to omit the entry script
- // At this point, the entry point has been loaded so we don't want to do that again.
- for (let name in pages) {
- for (let i = 0; i < pages[name].length; i += 1) {
- const lastDot = pages[name][i].lastIndexOf(".");
- if (lastDot == -1) continue;
- if (
- pages[name][i].substring(lastDot - ".entry".length, lastDot) !==
- ".entry"
- )
- continue;
-
- pages[name][i] =
- pages[name][i].substring(0, lastDot - ".entry".length) +
- pages[name][i].substring(lastDot);
- }
- }
-
- this.pages = pages;
- this.pageList = Object.keys(this.pages);
- }
-
- pageList: string[];
- pages: Record<string, string[]>;
-
- getPageList() {
- return this.pageList;
- }
-
- async getMiddlewareList() {
- return [];
- }
-
- cssQueue = [];
-
- onImportCSS = (event) => {
- this.cssQueue.push(
- insertStyleSheet(event.detail).then(
- () => {},
- () => {},
- ),
- );
- };
-
- prefetch() {
- return Promise.resolve();
- }
-
- async loadPage(route: string): Promise<GoodPageCache> {
- const assets =
- this.pages[route] || this.pages[getAssetPathFromRoute(route)];
-
- var src;
- for (let asset of assets) {
- if (!asset.endsWith(".css")) {
- src = asset;
- break;
- }
- }
- console.assert(src, "Invalid or unknown route passed to loadPage");
-
- if ("__BunClearBuildFailure" in globalThis) {
- globalThis.__BunClearBuildFailure();
- }
-
- document.removeEventListener("onimportcss", this.onImportCSS);
- this.cssQueue.length = 0;
- document.addEventListener("onimportcss", this.onImportCSS, {
- passive: true,
- });
-
- try {
- const res = await import(src);
-
- if (this.cssQueue.length > 0) {
- await Promise.all(this.cssQueue);
- this.cssQueue.length = 0;
- }
-
- document.removeEventListener("onimportcss", this.onImportCSS);
-
- if (this.cssQueue.length > 0) {
- await Promise.all(this.cssQueue);
-
- this.cssQueue.length = 0;
- }
-
- return {
- page: res.default,
- mod: res,
- styleSheets: [],
- __N_SSG: false,
- __N_SSP: false,
- };
- } catch (exception) {
- console.error({ exception });
- }
- }
-}
diff --git a/packages/bun-framework-next/renderDocument.tsx b/packages/bun-framework-next/renderDocument.tsx
deleted file mode 100644
index 5eae9ebf1..000000000
--- a/packages/bun-framework-next/renderDocument.tsx
+++ /dev/null
@@ -1,835 +0,0 @@
-import App from "next/app";
-import { AmpStateContext } from "next/dist/shared/lib/amp-context";
-import { HeadManagerContext } from "next/dist/shared/lib/head-manager-context";
-import Loadable from "next/dist/shared/lib/loadable";
-import { LoadableContext } from "next/dist/shared/lib/loadable-context";
-import { RouterContext } from "next/dist/shared/lib/router-context";
-import type { NextRouter } from "next/dist/shared/lib/router/router";
-import {
- getDisplayName,
- loadGetInitialProps,
- type AppType,
- type ComponentsEnhancer,
- type DocumentInitialProps,
- type DocumentProps,
- type DocumentType,
- type NextComponentType,
- type RenderPage,
- type RenderPageResult,
-} from "next/dist/shared/lib/utils";
-import { HtmlContext } from "next/dist/shared/lib/html-context";
-import type { RenderOpts } from "next/dist/server/render";
-import * as NextDocument from "next/document";
-import * as ReactDOMServer from "react-dom/server.browser";
-import * as React from "react";
-import * as ReactIs from "react-is";
-import packageJson from "next/package.json";
-
-const nextVersion = packageJson.version;
-
-function appendNextBody(documentHTML: string, pageContent: string) {
- if (nextVersion.startsWith("12.0")) {
- const NEXT_12_0_BODY_RENDER_TARGET = "__NEXT_BODY_RENDER_TARGET__";
-
- const bodyRenderIdx = documentHTML.indexOf(NEXT_12_0_BODY_RENDER_TARGET);
-
- if (!documentHTML.startsWith("<!DOCTYPE html>")) {
- documentHTML = "<!DOCTYPE html>" + documentHTML;
- }
-
- return (
- documentHTML.substring(0, bodyRenderIdx) +
- pageContent +
- documentHTML.substring(
- bodyRenderIdx + NEXT_12_0_BODY_RENDER_TARGET.length,
- )
- );
- } else {
- var [renderTargetPrefix, renderTargetSuffix] = documentHTML.split(
- "<next-js-internal-body-render-target></next-js-internal-body-render-target>",
- );
-
- if (!renderTargetPrefix || !renderTargetSuffix) {
- throw new Error(
- "Can't find where your <App /> starts or where the <Document /> ends. \nThis is probably a version incompatibility. Please mention this error in Bun's discord\n\n" +
- documentHTML,
- );
- }
-
- if (!renderTargetPrefix.startsWith("<!DOCTYPE html>")) {
- renderTargetPrefix = "<!DOCTYPE html>" + renderTargetPrefix;
- }
-
- return (
- renderTargetPrefix +
- `<div id="__next">${pageContent || ""}</div>` +
- renderTargetSuffix
- );
- }
-}
-
-const dev = process.env.NODE_ENV === "development";
-
-type ParsedUrlQuery = Record<string, string | string[]>;
-
-const isJSFile = (file: string) =>
- file.endsWith(".js") ||
- file.endsWith(".jsx") ||
- file.endsWith(".mjs") ||
- file.endsWith(".ts") ||
- file.endsWith(".tsx");
-
-type DocumentFiles = {
- sharedFiles: readonly string[];
- pageFiles: readonly string[];
- allFiles: readonly string[];
-};
-
-function getScripts(files: DocumentFiles) {
- const { context, props } = this;
- const {
- assetPrefix,
- buildManifest,
- isDevelopment,
- devOnlyCacheBusterQueryString,
- } = context;
-
- const normalScripts = files?.allFiles?.filter(isJSFile) ?? [];
- const lowPriorityScripts =
- buildManifest?.lowPriorityFiles?.filter(isJSFile) ?? [];
- var entryPointIndex = -1;
- const scripts = [...normalScripts, ...lowPriorityScripts].map(
- (file, index) => {
- // if (file.includes(".entry.")) {
- // entryPointIndex = index;
- // }
-
- return (
- <script
- key={file}
- src={`${encodeURI(file)}${devOnlyCacheBusterQueryString}`}
- nonce={props.nonce}
- async
- crossOrigin={props.crossOrigin || process.env.__NEXT_CROSS_ORIGIN}
- type="module"
- />
- );
- },
- );
- // if (entryPointIndex > 0) {
- // const entry = scripts.splice(entryPointIndex, 1);
- // scripts.unshift(...entry);
- // }
-
- return scripts;
-}
-
-interface DomainLocale {
- defaultLocale: string;
- domain: string;
- http?: true;
- locales?: string[];
-}
-
-function renderDocument(
- Document: DocumentType,
- {
- buildManifest,
- docComponentsRendered,
- props,
- docProps,
- pathname,
- query,
- buildId,
- page,
- canonicalBase,
- assetPrefix,
- runtimeConfig,
- nextExport,
- autoExport,
- isFallback,
- dynamicImportsIds,
- dangerousAsPath,
- err,
- dev,
- ampPath,
- ampState,
- inAmpMode,
- hybridAmp,
- dynamicImports,
- headTags,
- gsp,
- gssp,
- customServer,
- gip,
- appGip,
- unstable_runtimeJS,
- unstable_JsPreload,
- devOnlyCacheBusterQueryString,
- scriptLoader,
- locale,
- locales,
- defaultLocale,
- domainLocales,
- isPreview,
- disableOptimizedLoading,
- }: RenderOpts & {
- props: any;
- //
- page: string;
- //
- docComponentsRendered: DocumentProps["docComponentsRendered"];
- docProps: DocumentInitialProps;
- pathname: string;
- query: ParsedUrlQuery;
- dangerousAsPath: string;
- ampState: any;
- ampPath: string;
- inAmpMode: boolean;
- hybridAmp: boolean;
- dynamicImportsIds: (string | number)[];
- dynamicImports: string[];
- headTags: any;
- isFallback?: boolean;
- gsp?: boolean;
- gssp?: boolean;
- customServer?: boolean;
- gip?: boolean;
- appGip?: boolean;
- devOnlyCacheBusterQueryString: string;
- scriptLoader: any;
- isPreview?: boolean;
- autoExport?: boolean;
- },
-): string {
- const htmlProps = {
- __NEXT_DATA__: {
- props, // The result of getInitialProps
- page: page, // The rendered page
- query, // querystring parsed / passed by the user
- buildId, // buildId is used to facilitate caching of page bundles, we send it to the client so that pageloader knows where to load bundles
- assetPrefix: assetPrefix === "" ? undefined : assetPrefix, // send assetPrefix to the client side when configured, otherwise don't sent in the resulting HTML
- runtimeConfig, // runtimeConfig if provided, otherwise don't sent in the resulting HTML
- nextExport, // If this is a page exported by `next export`
- autoExport, // If this is an auto exported page
- isFallback,
- dynamicIds:
- dynamicImportsIds.length === 0 ? undefined : dynamicImportsIds,
- err: err || undefined, // err: err ? serializeError(dev, err) : undefined, // Error if one happened, otherwise don't sent in the resulting HTML
- gsp, // whether the page is getStaticProps
- gssp, // whether the page is getServerSideProps
- customServer, // whether the user is using a custom server
- gip, // whether the page has getInitialProps
- appGip, // whether the _app has getInitialProps
- locale,
- locales,
- defaultLocale,
- domainLocales,
- isPreview,
-
- pages: buildManifest.pages,
- },
- buildManifest,
- docComponentsRendered,
- dangerousAsPath,
- canonicalBase,
- ampPath,
- inAmpMode,
- isDevelopment: !!dev,
- hybridAmp,
- dynamicImports,
- assetPrefix,
- headTags,
- unstable_runtimeJS,
- unstable_JsPreload,
- devOnlyCacheBusterQueryString,
- scriptLoader,
- locale,
- disableOptimizedLoading,
- useMaybeDeferContent,
- ...docProps,
- };
-
- return ReactDOMServer.renderToStaticMarkup(
- <AmpStateContext.Provider value={ampState}>
- {/* HTMLContextProvider expects useMainContent */}
- {/* @ts-expect-error */}
- <HtmlContext.Provider value={htmlProps}>
- {/* Document doesn't expect useMaybeDeferContent */}
- {/* @ts-expect-error */}
- <Document {...htmlProps} {...docProps}></Document>
- </HtmlContext.Provider>
- </AmpStateContext.Provider>,
- );
-}
-
-class ServerRouter implements NextRouter {
- route: string;
- pathname: string;
- query: ParsedUrlQuery;
- asPath: string;
- basePath: string;
- events: any;
- isFallback: boolean;
- locale?: string;
- isReady: boolean;
- locales?: string[];
- defaultLocale?: string;
- domainLocales?: DomainLocale[];
- isPreview: boolean;
- isLocaleDomain: boolean;
-
- constructor(
- pathname: string,
- query: ParsedUrlQuery,
- as: string,
- { isFallback }: { isFallback: boolean },
- isReady: boolean,
- basePath: string,
- locale?: string,
- locales?: string[],
- defaultLocale?: string,
- domainLocales?: DomainLocale[],
- isPreview?: boolean,
- isLocaleDomain?: boolean,
- ) {
- this.route = pathname.replace(/\/$/, "") || "/";
- this.pathname = new URL(
- pathname || "/",
- Bun.origin || "http://localhost:3000",
- ).href;
-
- this.query = query;
- this.asPath = new URL(
- as || "/",
- Bun.origin || "http://localhost:3000",
- ).href;
- this.isFallback = isFallback;
- this.basePath = basePath;
- this.locale = locale;
- this.locales = locales;
- this.defaultLocale = defaultLocale;
- this.isReady = isReady;
- this.domainLocales = domainLocales;
- this.isPreview = !!isPreview;
- this.isLocaleDomain = !!isLocaleDomain;
- }
-
- push(): any {
- noRouter();
- }
- replace(): any {
- noRouter();
- }
- reload() {
- noRouter();
- }
- back() {
- noRouter();
- }
- prefetch(): any {
- noRouter();
- }
- beforePopState() {
- noRouter();
- }
-}
-
-function noRouter() {
- const message =
- 'No router instance found. you should only use "next/router" inside the client side of your app. https://nextjs.org/docs/messages/no-router-instance';
- throw new Error(message);
-}
-
-function enhanceComponents(
- options: ComponentsEnhancer,
- App: AppType,
- Component: NextComponentType,
-): {
- App: AppType;
- Component: NextComponentType;
-} {
- // For backwards compatibility
- if (typeof options === "function") {
- return {
- App,
- Component: options(Component),
- };
- }
-
- return {
- App: options.enhanceApp ? options.enhanceApp(App) : App,
- Component: options.enhanceComponent
- ? options.enhanceComponent(Component)
- : Component,
- };
-}
-const scriptsGetter = {
- get() {
- return getScripts;
- },
-};
-
-Object.defineProperty(NextDocument.Head.prototype, "getScripts", scriptsGetter);
-Object.defineProperty(
- NextDocument.NextScript.prototype,
- "getScripts",
- scriptsGetter,
-);
-try {
- Object.defineProperty(
- NextDocument.default.prototype,
- "getScripts",
- scriptsGetter,
- );
-} catch {}
-try {
- Object.defineProperty(NextDocument.default, "getScripts", scriptsGetter);
-} catch {}
-
-export async function render({
- route,
- request,
- PageNamespace,
- AppNamespace,
- appStylesheets = [],
- pageStylesheets = [],
- DocumentNamespace = null,
- buildId,
- routePaths = [],
- routeNames = [],
-}: {
- buildId: number;
- route: any;
- PageNamespace: { default: NextComponentType<any> };
- AppNamespace: { default: NextComponentType<any> } | null;
- DocumentNamespace: Object | null;
- appStylesheets: string[];
- pageStylesheets: string[];
- routePaths: string[];
- routeNames: string[];
- request: Request;
-}): Promise<Response> {
- const { default: Component } = PageNamespace || {};
- const getStaticProps = (PageNamespace as any)?.getStaticProps || null;
- const { default: AppComponent_ } = AppNamespace || {};
- var query = Object.assign({}, route.query);
- const origin = Bun.origin;
-
- // These are reversed in our Router versus Next.js...mostly due to personal preference.
- const pathname = route.name;
- var asPath = route.pathname;
- const pages = {};
-
- for (let i = 0; i < routeNames.length; i++) {
- const filePath = routePaths[i];
- const name = routeNames[i];
- pages[name] = [filePath];
- }
-
- if (appStylesheets.length > 0) {
- if (pages["/_app"]) {
- pages["/_app"].push(...appStylesheets);
- } else {
- pages["/_app"] = appStylesheets;
- }
- }
- pages[pathname] = [route.scriptSrc, ...pageStylesheets];
-
- if (!("/_app" in pages)) {
- pages["/_app"] = [];
- }
-
- const AppComponent = AppComponent_ || App;
- const Document = (DocumentNamespace as any)?.default || NextDocument.default;
-
- const callMiddleware = async (method: string, args: any[], props = false) => {
- let results: any = props ? {} : [];
-
- if ((Document as any)[`${method}Middleware`]) {
- let middlewareFunc = await (Document as any)[`${method}Middleware`];
- middlewareFunc = middlewareFunc.default || middlewareFunc;
-
- const curResults = await middlewareFunc(...args);
- if (props) {
- for (const result of curResults) {
- results = {
- ...results,
- ...result,
- };
- }
- } else {
- results = curResults;
- }
- }
- return results;
- };
-
- const headTags = (...args: any) => callMiddleware("headTags", args);
-
- if (!ReactIs.isValidElementType(Component)) {
- const exportNames = Object.keys(PageNamespace || {});
-
- const reactComponents = exportNames.filter(ReactIs.isValidElementType);
- if (reactComponents.length > 2) {
- throw new Error(
- `\"export default\" missing in ${
- route.filePath
- }.\nTry exporting one of ${reactComponents.join(", ")}\n`,
- );
- } else if (reactComponents.length === 2) {
- throw new Error(
- `\"export default\" missing in ${route.filePath}.\n\nTry exporting <${reactComponents[0]} /> or <${reactComponents[1]} />\n`,
- );
- } else if (reactComponents.length == 1) {
- throw new Error(
- `\"export default\" missing in ${route.filePath}. Try adding this to the bottom of the file:\n\n export default ${reactComponents[0]};\n`,
- );
- } else if (reactComponents.length == 0) {
- throw new Error(
- `\"export default\" missing in ${route.filePath}. Try exporting a React component.\n`,
- );
- }
- }
-
- const isFallback = !!query.__nextFallback;
- delete query.__nextFallback;
- delete query.__nextLocale;
- delete query.__nextDefaultLocale;
-
- // const isSSG = !!getStaticProps;
-
- const defaultAppGetInitialProps =
- App.getInitialProps === (App as any).origGetInitialProps;
-
- const hasPageGetInitialProps = !!(Component as any).getInitialProps;
- const pageIsDynamic = route.kind === "dynamic";
- const isPreview = false;
- const isAutoExport = false;
- const nextExport = isAutoExport || isFallback;
-
- if (isAutoExport || isFallback) {
- // // remove query values except ones that will be set during export
- // query = {
- // ...(query.amp
- // ? {
- // amp: query.amp,
- // }
- // : {}),
- // };
- asPath = `${asPath}${
- // ensure trailing slash is present for non-dynamic auto-export pages
- asPath.endsWith("/") && asPath !== "/" && !pageIsDynamic ? "/" : ""
- }`;
- }
-
- let head: JSX.Element[] = [
- <meta charSet="utf-8" />,
- <meta name="viewport" content="width=device-width" />,
- ];
-
- const reactLoadableModules: string[] = [];
- var scriptLoader = {};
- const AppContainer = ({ children }: any) => (
- <RouterContext.Provider value={router}>
- {/* <AmpStateContext.Provider value={ampState}> */}
- <HeadManagerContext.Provider
- value={{
- updateHead: (state) => {
- head = state;
- },
- updateScripts: (scripts) => {
- scriptLoader = scripts;
- },
- scripts: {},
- mountedInstances: new Set(),
- }}
- >
- <LoadableContext.Provider
- value={(moduleName) => reactLoadableModules.push(moduleName)}
- >
- {children}
- </LoadableContext.Provider>
- </HeadManagerContext.Provider>
- {/* </AmpStateContext.Provider> */}
- </RouterContext.Provider>
- );
-
- // Todo: Double check this when adding support for dynamic()
- await Loadable.preloadAll(); // Make sure all dynamic imports are loaded
-
- const router = new ServerRouter(
- pathname,
- query,
- asPath,
- {
- isFallback: isFallback,
- },
- true,
- origin,
- null,
- [], // renderOpts.locales,
- null, //renderOpts.defaultLocale,
- [], // renderOpts.domainLocales,
- false,
- false,
- );
-
- const ctx = {
- err: null,
- req: undefined,
- res: undefined,
- pathname,
- query,
- asPath,
- locale: null,
- locales: [],
- defaultLocale: null,
- AppTree: (props: any) => {
- return (
- <AppContainer>
- <App {...props} Component={Component} router={router} />
- </AppContainer>
- );
- },
- defaultGetInitialProps: async (
- docCtx: NextDocument.DocumentContext,
- ): Promise<DocumentInitialProps> => {
- const enhanceApp = (AppComp: any) => {
- return (props: any) => <AppComp {...props} />;
- };
-
- const { html, head } = await docCtx.renderPage({ enhanceApp });
- // const styles = jsxStyleRegistry.styles();
- return { html, head };
- },
- };
-
- var props: any = await loadGetInitialProps(AppComponent, {
- AppTree: ctx.AppTree,
- Component,
- router,
- ctx,
- });
-
- const pageProps = Object.assign({}, props.pageProps || {});
- // We don't call getServerSideProps on clients.
- // @ts-expect-error
- const getServerSideProps = PageNamespace.getServerSideProps;
-
- var responseHeaders: Headers;
-
- if (typeof getServerSideProps === "function") {
- const result = await getServerSideProps({
- params: route.params,
- query: route.query,
- req: {
- destroy() {},
- method: request.method,
- httpVersion: "1.1",
- rawHeaders: [],
- rawTrailers: [],
- socket: null,
- statusCode: 200,
- statusMessage: "OK",
- trailers: {},
- url: request.url,
- headers: new Proxy(
- {},
- {
- get(target, name) {
- return request.headers.get(name as string);
- },
- has(target, name) {
- return request.headers.has(name as string);
- },
- },
- ),
- },
- res: {
- getHeaders() {
- return {};
- },
- getHeaderNames() {
- return {};
- },
- flushHeaders() {},
- getHeader(name) {
- if (!responseHeaders) return undefined;
- return responseHeaders.get(name);
- },
- hasHeader(name) {
- if (!responseHeaders) return undefined;
- return responseHeaders.has(name);
- },
- headersSent: false,
- setHeader(name, value) {
- responseHeaders = responseHeaders || new Headers();
- responseHeaders.set(name, String(value));
- },
- cork() {},
- end() {},
- finished: false,
- },
- resolvedUrl: route.pathname,
- preview: false,
- previewData: null,
- locale: null,
- locales: [],
- defaultLocale: null,
- });
-
- if (result) {
- if ("props" in result) {
- if (typeof result.props === "object") {
- Object.assign(pageProps, result.props);
- }
- }
- }
- } else if (typeof getStaticProps === "function") {
- const result = await getStaticProps({
- params: route.params,
- query: route.query,
- req: null,
- res: null,
- resolvedUrl: route.pathname,
- preview: false,
- previewData: null,
- locale: null,
- locales: [],
- defaultLocale: null,
- });
-
- if (result) {
- if ("props" in result) {
- if (typeof result.props === "object") {
- Object.assign(pageProps, result.props);
- }
- }
- }
- }
-
- const renderToString = ReactDOMServer.renderToString;
- const ErrorDebug = null;
-
- props.pageProps = pageProps;
-
- const renderPage: RenderPage = (
- options: ComponentsEnhancer = {},
- ): RenderPageResult | Promise<RenderPageResult> => {
- if (ctx.err && ErrorDebug) {
- const htmlOrPromise = renderToString(<ErrorDebug error={ctx.err} />);
- return { html: htmlOrPromise, head };
- }
-
- if (dev && (props.router || props.Component)) {
- throw new Error(
- `'router' and 'Component' can not be returned in getInitialProps from _app.js https://nextjs.org/docs/messages/cant-override-next-props`,
- );
- }
-
- const { App: EnhancedApp, Component: EnhancedComponent } =
- // Argument of type 'NextComponentType<any, {}, {}> | typeof App' is not assignable to parameter of type 'AppType'.
- // @ts-expect-error
- enhanceComponents(options, AppComponent, Component);
-
- const htmlOrPromise = renderToString(
- <AppContainer>
- <EnhancedApp
- Component={EnhancedComponent}
- router={router}
- {...props}
- pageProps={pageProps}
- />
- </AppContainer>,
- );
-
- return { html: htmlOrPromise, head };
- };
-
- const documentCtx = { ...ctx, renderPage };
- const docProps: DocumentInitialProps = await loadGetInitialProps(
- Document,
- documentCtx,
- );
-
- if (!docProps || typeof docProps.html !== "string") {
- const message = `"${getDisplayName(
- Document,
- )}.getInitialProps()" should resolve to an object with a "html" prop set with a valid html string`;
- throw new Error(message);
- }
-
- const renderOpts = {
- params: route.params,
- };
-
- const docComponentsRendered: DocumentProps["docComponentsRendered"] = {};
-
- let html = renderDocument(Document, {
- docComponentsRendered,
- ...renderOpts,
- disableOptimizedLoading: false,
- canonicalBase: origin,
- buildManifest: {
- devFiles: [],
- allFiles: [],
- polyfillFiles: [],
- lowPriorityFiles: [],
- // buildManifest doesn't expect pages, even though its used
- // @ts-expect-error
- pages,
- },
- // Only enabled in production as development mode has features relying on HMR (style injection for example)
- // @ts-expect-error
- unstable_runtimeJS: true,
- // process.env.NODE_ENV === "production"
- // ? pageConfig.unstable_runtimeJS
- // : undefined,
- // unstable_JsPreload: pageConfig.unstable_JsPreload,
- // @ts-expect-error
- unstable_JsPreload: true,
- dangerousAsPath: router.asPath,
- ampState: undefined,
- props,
- assetPrefix: "",
- headTags: await headTags(documentCtx),
- isFallback,
- docProps,
- page: pathname,
- pathname,
- ampPath: undefined,
- query,
- inAmpMode: false,
- hybridAmp: undefined,
- dynamicImportsIds: [], // Array.from(dynamicImportsIds),
- dynamicImports: [], //Array.from(dynamicImports),
- gsp: !!getStaticProps ? true : undefined,
- gssp: !!getServerSideProps ? true : undefined,
- gip: hasPageGetInitialProps ? true : undefined,
- appGip: !defaultAppGetInitialProps ? true : undefined,
- devOnlyCacheBusterQueryString: "",
- scriptLoader,
- isPreview: isPreview,
- autoExport: nextExport === true ? true : undefined,
- nextExport: nextExport,
- useMaybeDeferContent,
- });
- // __NEXT_BODY_RENDER_TARGET__
- html = appendNextBody(html, docProps.html);
- html = html
- .replaceAll('"/_next/http://', '"http://')
- .replaceAll('"/_next/https://', '"https://');
- if (responseHeaders) {
- return new Response(html, { headers: responseHeaders });
- } else {
- return new Response(html);
- }
-}
-
-export function useMaybeDeferContent(
- _name: string,
- contentFn: () => JSX.Element,
-): [boolean, JSX.Element] {
- return [false, contentFn()];
-}
diff --git a/packages/bun-framework-next/server.development.tsx b/packages/bun-framework-next/server.development.tsx
deleted file mode 100644
index a19ffd149..000000000
--- a/packages/bun-framework-next/server.development.tsx
+++ /dev/null
@@ -1,91 +0,0 @@
-import { render } from "./renderDocument";
-import packagejson from "next/package.json";
-
-const version = packagejson.version;
-
-if (!version.startsWith("12.2")) {
- console.warn(
- "Possibly incompatible Next.js version: ",
- version,
- ". Please upgrade to Next.js 12.2.0+.\n",
- );
-}
-
-let buildId = 0;
-
-let DocumentLoaded = false;
-let DocumentNamespace;
-
-import(Bun.routesDir + "_document").then(
- (doc) => {
- DocumentNamespace = doc;
- DocumentLoaded = true;
- },
- (err) => {
- // ResolveError is defined outside of bun-framework-next in ../../src/runtime/errors
- // @ts-expect-error
- if (err instanceof ResolveError) {
- DocumentLoaded = true;
- } else {
- console.error(err);
- }
- },
-);
-
-addEventListener("fetch", async (event: FetchEvent) => {
- const route = Bun.match(event);
-
- // This imports the currently matched route.
- let PageNamespace: any;
-
- try {
- PageNamespace = await import(route.filePath);
- } catch (exception) {
- console.error("Error loading page:", route.filePath);
- throw exception;
- }
-
- // This returns all .css files that were imported in the line above.
- // It's recursive, so any file that imports a CSS file will be included.
- const pageStylesheets = (Bun.getImportedStyles() as string[]).slice();
-
- let appRoute: any;
-
- try {
- appRoute = await import(Bun.routesDir + "_app");
- } catch (exception) {
- // ResolveError is defined outside of bun-framework-next in ../../src/runtime/errors
- // @ts-expect-error
- if (exception && !(exception instanceof ResolveError)) {
- console.error("Error loading app:", Bun.routesDir + "_app");
- throw exception;
- }
- }
-
- const appStylesheets = (Bun.getImportedStyles() as string[]).slice();
- let response: Response;
- try {
- response = await render({
- route,
- PageNamespace,
- appStylesheets,
- pageStylesheets,
- DocumentNamespace,
- AppNamespace: appRoute,
- buildId,
- routePaths: Bun.getRouteFiles(),
- routeNames: Bun.getRouteNames(),
- request: event.request,
- });
- } catch (exception) {
- console.error("Error rendering route", route.filePath);
- throw exception;
- }
-
- event.respondWith(response);
-
- buildId++;
-});
-
-declare let Bun: any;
-export {};
diff --git a/packages/bun-framework-next/tsconfig.json b/packages/bun-framework-next/tsconfig.json
deleted file mode 100644
index 96e13d1eb..000000000
--- a/packages/bun-framework-next/tsconfig.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "extends": "../../tsconfig.base.json",
- "compilerOptions": {
- "target": "esnext",
- "lib": [
- "dom",
- "dom.iterable",
- "esnext",
- "WebWorker"
- ],
- "strict": false,
- "forceConsistentCasingInFileNames": true,
- "noEmit": true,
- "esModuleInterop": true,
- "resolveJsonModule": true,
- "isolatedModules": true,
- "jsx": "preserve",
- },
- "include": [
- "next-env.d.ts",
- "**/*.ts",
- "**/*.tsx",
- "empty.js"
- ],
- "exclude": [
- "node_modules"
- ],
-} \ No newline at end of file
diff --git a/packages/bun-inspector-protocol/scripts/generate-protocol.ts b/packages/bun-inspector-protocol/scripts/generate-protocol.ts
index c53153bb4..7a0826009 100644
--- a/packages/bun-inspector-protocol/scripts/generate-protocol.ts
+++ b/packages/bun-inspector-protocol/scripts/generate-protocol.ts
@@ -5,7 +5,7 @@ import { spawnSync } from "node:child_process";
run().catch(console.error);
async function run() {
- const cwd = new URL("../protocol/", import.meta.url);
+ const cwd = new URL("../src/protocol/", import.meta.url);
const runner = "Bun" in globalThis ? "bunx" : "npx";
const write = (name: string, data: string) => {
const path = new URL(name, cwd);
diff --git a/packages/bun-inspector-protocol/src/protocol/v8/index.d.ts b/packages/bun-inspector-protocol/src/protocol/v8/index.d.ts
index f0e82acb4..579adf70c 100644
--- a/packages/bun-inspector-protocol/src/protocol/v8/index.d.ts
+++ b/packages/bun-inspector-protocol/src/protocol/v8/index.d.ts
@@ -1136,7 +1136,8 @@ export namespace V8 {
| "Canceled"
| "RpPageNotVisible"
| "SilentMediationFailure"
- | "ThirdPartyCookiesBlocked";
+ | "ThirdPartyCookiesBlocked"
+ | "NotSignedInWithIdp";
export type FederatedAuthUserInfoRequestIssueDetails = {
federatedAuthUserInfoRequestIssueReason: FederatedAuthUserInfoRequestIssueReason;
};
@@ -1192,6 +1193,25 @@ export namespace V8 {
*/
failedRequestInfo?: FailedRequestInfo | undefined;
};
+ export type PropertyRuleIssueReason = "InvalidSyntax" | "InvalidInitialValue" | "InvalidInherits" | "InvalidName";
+ /**
+ * This issue warns about errors in property rules that lead to property
+ * registrations being ignored.
+ */
+ export type PropertyRuleIssueDetails = {
+ /**
+ * Source code position of the property rule.
+ */
+ sourceCodeLocation: SourceCodeLocation;
+ /**
+ * Reason why the property rule was discarded.
+ */
+ propertyRuleIssueReason: PropertyRuleIssueReason;
+ /**
+ * The value of the property rule property that failed to parse
+ */
+ propertyValue?: string | undefined;
+ };
/**
* A unique identifier for the type of issue. Each type may use one of the
* optional fields in InspectorIssueDetails to convey more specific
@@ -1215,7 +1235,8 @@ export namespace V8 {
| "FederatedAuthRequestIssue"
| "BounceTrackingIssue"
| "StylesheetLoadingIssue"
- | "FederatedAuthUserInfoRequestIssue";
+ | "FederatedAuthUserInfoRequestIssue"
+ | "PropertyRuleIssue";
/**
* This struct holds a list of optional fields with additional information
* specific to the kind of issue. When adding a new issue code, please also
@@ -1239,6 +1260,7 @@ export namespace V8 {
federatedAuthRequestIssueDetails?: FederatedAuthRequestIssueDetails | undefined;
bounceTrackingIssueDetails?: BounceTrackingIssueDetails | undefined;
stylesheetLoadingIssueDetails?: StylesheetLoadingIssueDetails | undefined;
+ propertyRuleIssueDetails?: PropertyRuleIssueDetails | undefined;
federatedAuthUserInfoRequestIssueDetails?: FederatedAuthUserInfoRequestIssueDetails | undefined;
};
/**
@@ -1390,17 +1412,83 @@ export namespace V8 {
*/
name: string;
/**
- * address field name, for example Jon Doe.
+ * address field value, for example Jon Doe.
*/
value: string;
};
+ /**
+ * A list of address fields.
+ */
+ export type AddressFields = {
+ fields: AddressField[];
+ };
export type Address = {
/**
- * fields and values defining a test address.
+ * fields and values defining an address.
*/
fields: AddressField[];
};
/**
+ * Defines how an address can be displayed like in chrome://settings/addresses.
+ * Address UI is a two dimensional array, each inner array is an "address information line", and when rendered in a UI surface should be displayed as such.
+ * The following address UI for instance:
+ * [[{name: "GIVE_NAME", value: "Jon"}, {name: "FAMILY_NAME", value: "Doe"}], [{name: "CITY", value: "Munich"}, {name: "ZIP", value: "81456"}]]
+ * should allow the receiver to render:
+ * Jon Doe
+ * Munich 81456
+ */
+ export type AddressUI = {
+ /**
+ * A two dimension array containing the repesentation of values from an address profile.
+ */
+ addressFields: AddressFields[];
+ };
+ /**
+ * Specified whether a filled field was done so by using the html autocomplete attribute or autofill heuristics.
+ */
+ export type FillingStrategy = "autocompleteAttribute" | "autofillInferred";
+ export type FilledField = {
+ /**
+ * The type of the field, e.g text, password etc.
+ */
+ htmlType: string;
+ /**
+ * the html id
+ */
+ id: string;
+ /**
+ * the html name
+ */
+ name: string;
+ /**
+ * the field value
+ */
+ value: string;
+ /**
+ * The actual field type, e.g FAMILY_NAME
+ */
+ autofillType: string;
+ /**
+ * The filling strategy
+ */
+ fillingStrategy: FillingStrategy;
+ };
+ /**
+ * Emitted when an address form is filled.
+ * @event `Autofill.addressFormFilled`
+ */
+ export type AddressFormFilledEvent = {
+ /**
+ * Information about the fields that were filled
+ */
+ filledFields: FilledField[];
+ /**
+ * An UI representation of the address used to fill the form.
+ * Consists of a 2D array where each child represents an address/profile line.
+ */
+ addressUi: AddressUI;
+ };
+ /**
* Trigger autofill on a form identified by the fieldId.
* If the field and related form cannot be autofilled, returns an error.
* @request `Autofill.trigger`
@@ -1437,6 +1525,26 @@ export namespace V8 {
* @response `Autofill.setAddresses`
*/
export type SetAddressesResponse = {};
+ /**
+ * Disables autofill domain notifications.
+ * @request `Autofill.disable`
+ */
+ export type DisableRequest = {};
+ /**
+ * Disables autofill domain notifications.
+ * @response `Autofill.disable`
+ */
+ export type DisableResponse = {};
+ /**
+ * Enables autofill domain notifications.
+ * @request `Autofill.enable`
+ */
+ export type EnableRequest = {};
+ /**
+ * Enables autofill domain notifications.
+ * @response `Autofill.enable`
+ */
+ export type EnableResponse = {};
}
export namespace BackgroundService {
/**
@@ -3574,6 +3682,25 @@ export namespace V8 {
*/
export type SetEffectivePropertyValueForNodeResponse = {};
/**
+ * Modifies the property rule property name.
+ * @request `CSS.setPropertyRulePropertyName`
+ */
+ export type SetPropertyRulePropertyNameRequest = {
+ styleSheetId: StyleSheetId;
+ range: SourceRange;
+ propertyName: string;
+ };
+ /**
+ * Modifies the property rule property name.
+ * @response `CSS.setPropertyRulePropertyName`
+ */
+ export type SetPropertyRulePropertyNameResponse = {
+ /**
+ * The resulting key text after modification.
+ */
+ propertyName: Value;
+ };
+ /**
* Modifies the keyframe rule key text.
* @request `CSS.setKeyframeKey`
*/
@@ -7168,6 +7295,16 @@ export namespace V8 {
* @response `EventBreakpoints.removeInstrumentationBreakpoint`
*/
export type RemoveInstrumentationBreakpointResponse = {};
+ /**
+ * Removes all breakpoints
+ * @request `EventBreakpoints.disable`
+ */
+ export type DisableRequest = {};
+ /**
+ * Removes all breakpoints
+ * @response `EventBreakpoints.disable`
+ */
+ export type DisableResponse = {};
}
export namespace FedCm {
/**
@@ -7178,7 +7315,7 @@ export namespace V8 {
/**
* Whether the dialog shown is an account chooser or an auto re-authentication dialog.
*/
- export type DialogType = "AccountChooser" | "AutoReauthn" | "ConfirmIdpSignin";
+ export type DialogType = "AccountChooser" | "AutoReauthn" | "ConfirmIdpLogin";
/**
* Corresponds to IdentityRequestAccount
*/
@@ -7189,7 +7326,7 @@ export namespace V8 {
givenName: string;
pictureUrl: string;
idpConfigUrl: string;
- idpSigninUrl: string;
+ idpLoginUrl: string;
loginState: LoginState;
/**
* These two are only set if the loginState is signUp
@@ -7253,6 +7390,20 @@ export namespace V8 {
*/
export type SelectAccountResponse = {};
/**
+ * Only valid if the dialog type is ConfirmIdpLogin. Acts as if the user had
+ * clicked the continue button.
+ * @request `FedCm.confirmIdpLogin`
+ */
+ export type ConfirmIdpLoginRequest = {
+ dialogId: string;
+ };
+ /**
+ * Only valid if the dialog type is ConfirmIdpLogin. Acts as if the user had
+ * clicked the continue button.
+ * @response `FedCm.confirmIdpLogin`
+ */
+ export type ConfirmIdpLoginResponse = {};
+ /**
* undefined
* @request `FedCm.dismissDialog`
*/
@@ -10477,6 +10628,7 @@ export namespace V8 {
| "ch-ect"
| "ch-prefers-color-scheme"
| "ch-prefers-reduced-motion"
+ | "ch-prefers-reduced-transparency"
| "ch-rtt"
| "ch-save-data"
| "ch-ua"
@@ -13109,7 +13261,6 @@ export namespace V8 {
| "LowEndDevice"
| "InvalidSchemeRedirect"
| "InvalidSchemeNavigation"
- | "InProgressNavigation"
| "NavigationRequestBlockedByCsp"
| "MainFrameNavigation"
| "MojoBinderPolicy"
@@ -13121,7 +13272,6 @@ export namespace V8 {
| "NavigationBadHttpStatus"
| "ClientCertRequested"
| "NavigationRequestNetworkError"
- | "MaxNumOfRunningPrerendersExceeded"
| "CancelAllHostsForTesting"
| "DidFailLoad"
| "Stop"
@@ -13133,9 +13283,8 @@ export namespace V8 {
| "MixedContent"
| "TriggerBackgrounded"
| "MemoryLimitExceeded"
- | "FailToGetMemoryUsage"
| "DataSaverEnabled"
- | "HasEffectiveUrl"
+ | "TriggerUrlHasEffectiveUrl"
| "ActivatedBeforeStarted"
| "InactivePageRestriction"
| "StartFailed"
@@ -13166,7 +13315,13 @@ export namespace V8 {
| "PrerenderingDisabledByDevTools"
| "ResourceLoadBlockedByClient"
| "SpeculationRuleRemoved"
- | "ActivatedWithAuxiliaryBrowsingContexts";
+ | "ActivatedWithAuxiliaryBrowsingContexts"
+ | "MaxNumOfRunningEagerPrerendersExceeded"
+ | "MaxNumOfRunningNonEagerPrerendersExceeded"
+ | "MaxNumOfRunningEmbedderPrerendersExceeded"
+ | "PrerenderingUrlHasEffectiveUrl"
+ | "RedirectedPrerenderingUrlHasEffectiveUrl"
+ | "ActivationUrlHasEffectiveUrl";
/**
* Preloading status values, see also PreloadingTriggeringOutcome. This
* status is shared by prefetchStatusUpdated and prerenderStatusUpdated.
@@ -13222,24 +13377,6 @@ export namespace V8 {
id: RuleSetId;
};
/**
- * Fired when a prerender attempt is completed.
- * @event `Preload.prerenderAttemptCompleted`
- */
- export type PrerenderAttemptCompletedEvent = {
- key: PreloadingAttemptKey;
- /**
- * The frame id of the frame initiating prerendering.
- */
- initiatingFrameId: Page.FrameId;
- prerenderingUrl: string;
- finalStatus: PrerenderFinalStatus;
- /**
- * This is used to give users more information about the name of the API call
- * that is incompatible with prerender and has caused the cancellation of the attempt
- */
- disallowedApiMethod?: string | undefined;
- };
- /**
* Fired when a preload enabled state is updated.
* @event `Preload.preloadEnabledStateUpdated`
*/
@@ -13935,12 +14072,21 @@ export namespace V8 {
/**
* Enum of interest group access types.
*/
- export type InterestGroupAccessType = "join" | "leave" | "update" | "loaded" | "bid" | "win";
+ export type InterestGroupAccessType =
+ | "join"
+ | "leave"
+ | "update"
+ | "loaded"
+ | "bid"
+ | "win"
+ | "additionalBid"
+ | "additionalBidWin"
+ | "clear";
/**
* Ad advertising element inside an interest group.
*/
export type InterestGroupAd = {
- renderUrl: string;
+ renderURL: string;
metadata?: string | undefined;
};
/**
@@ -13951,10 +14097,10 @@ export namespace V8 {
name: string;
expirationTime: Network.TimeSinceEpoch;
joiningOrigin: string;
- biddingUrl?: string | undefined;
- biddingWasmHelperUrl?: string | undefined;
- updateUrl?: string | undefined;
- trustedBiddingSignalsUrl?: string | undefined;
+ biddingLogicURL?: string | undefined;
+ biddingWasmHelperURL?: string | undefined;
+ updateURL?: string | undefined;
+ trustedBiddingSignalsURL?: string | undefined;
trustedBiddingSignalsKeys: string[];
userBiddingSignals?: string | undefined;
ads: InterestGroupAd[];
@@ -14099,20 +14245,27 @@ export namespace V8 {
key: string;
value: UnsignedInt128AsBase16;
};
- export type AttributionReportingSourceRegistration = {
- time: Network.TimeSinceEpoch;
+ export type AttributionReportingEventReportWindows = {
/**
* duration in seconds
*/
- expiry?: number | undefined;
+ start: number;
+ /**
+ * duration in seconds
+ */
+ ends: number[];
+ };
+ export type AttributionReportingSourceRegistration = {
+ time: Network.TimeSinceEpoch;
/**
* duration in seconds
*/
- eventReportWindow?: number | undefined;
+ expiry: number;
+ eventReportWindows: AttributionReportingEventReportWindows;
/**
* duration in seconds
*/
- aggregatableReportWindow?: number | undefined;
+ aggregatableReportWindow: number;
type: AttributionReportingSourceType;
sourceOrigin: string;
reportingOrigin: string;
@@ -16381,6 +16534,7 @@ export namespace V8 {
"Animation.animationCreated": Animation.AnimationCreatedEvent;
"Animation.animationStarted": Animation.AnimationStartedEvent;
"Audits.issueAdded": Audits.IssueAddedEvent;
+ "Autofill.addressFormFilled": Autofill.AddressFormFilledEvent;
"BackgroundService.recordingStateChanged": BackgroundService.RecordingStateChangedEvent;
"BackgroundService.backgroundServiceEventReceived": BackgroundService.BackgroundServiceEventReceivedEvent;
"Browser.downloadWillBegin": Browser.DownloadWillBeginEvent;
@@ -16460,7 +16614,6 @@ export namespace V8 {
"PerformanceTimeline.timelineEventAdded": PerformanceTimeline.TimelineEventAddedEvent;
"Preload.ruleSetUpdated": Preload.RuleSetUpdatedEvent;
"Preload.ruleSetRemoved": Preload.RuleSetRemovedEvent;
- "Preload.prerenderAttemptCompleted": Preload.PrerenderAttemptCompletedEvent;
"Preload.preloadEnabledStateUpdated": Preload.PreloadEnabledStateUpdatedEvent;
"Preload.prefetchStatusUpdated": Preload.PrefetchStatusUpdatedEvent;
"Preload.prerenderStatusUpdated": Preload.PrerenderStatusUpdatedEvent;
@@ -16533,6 +16686,8 @@ export namespace V8 {
"Audits.checkFormsIssues": Audits.CheckFormsIssuesRequest;
"Autofill.trigger": Autofill.TriggerRequest;
"Autofill.setAddresses": Autofill.SetAddressesRequest;
+ "Autofill.disable": Autofill.DisableRequest;
+ "Autofill.enable": Autofill.EnableRequest;
"BackgroundService.startObserving": BackgroundService.StartObservingRequest;
"BackgroundService.stopObserving": BackgroundService.StopObservingRequest;
"BackgroundService.setRecording": BackgroundService.SetRecordingRequest;
@@ -16583,6 +16738,7 @@ export namespace V8 {
"CSS.trackComputedStyleUpdates": CSS.TrackComputedStyleUpdatesRequest;
"CSS.takeComputedStyleUpdates": CSS.TakeComputedStyleUpdatesRequest;
"CSS.setEffectivePropertyValueForNode": CSS.SetEffectivePropertyValueForNodeRequest;
+ "CSS.setPropertyRulePropertyName": CSS.SetPropertyRulePropertyNameRequest;
"CSS.setKeyframeKey": CSS.SetKeyframeKeyRequest;
"CSS.setMediaText": CSS.SetMediaTextRequest;
"CSS.setContainerQueryText": CSS.SetContainerQueryTextRequest;
@@ -16705,9 +16861,11 @@ export namespace V8 {
"Emulation.setAutomationOverride": Emulation.SetAutomationOverrideRequest;
"EventBreakpoints.setInstrumentationBreakpoint": EventBreakpoints.SetInstrumentationBreakpointRequest;
"EventBreakpoints.removeInstrumentationBreakpoint": EventBreakpoints.RemoveInstrumentationBreakpointRequest;
+ "EventBreakpoints.disable": EventBreakpoints.DisableRequest;
"FedCm.enable": FedCm.EnableRequest;
"FedCm.disable": FedCm.DisableRequest;
"FedCm.selectAccount": FedCm.SelectAccountRequest;
+ "FedCm.confirmIdpLogin": FedCm.ConfirmIdpLoginRequest;
"FedCm.dismissDialog": FedCm.DismissDialogRequest;
"FedCm.resetCooldown": FedCm.ResetCooldownRequest;
"Fetch.disable": Fetch.DisableRequest;
@@ -16979,6 +17137,8 @@ export namespace V8 {
"Audits.checkFormsIssues": Audits.CheckFormsIssuesResponse;
"Autofill.trigger": Autofill.TriggerResponse;
"Autofill.setAddresses": Autofill.SetAddressesResponse;
+ "Autofill.disable": Autofill.DisableResponse;
+ "Autofill.enable": Autofill.EnableResponse;
"BackgroundService.startObserving": BackgroundService.StartObservingResponse;
"BackgroundService.stopObserving": BackgroundService.StopObservingResponse;
"BackgroundService.setRecording": BackgroundService.SetRecordingResponse;
@@ -17029,6 +17189,7 @@ export namespace V8 {
"CSS.trackComputedStyleUpdates": CSS.TrackComputedStyleUpdatesResponse;
"CSS.takeComputedStyleUpdates": CSS.TakeComputedStyleUpdatesResponse;
"CSS.setEffectivePropertyValueForNode": CSS.SetEffectivePropertyValueForNodeResponse;
+ "CSS.setPropertyRulePropertyName": CSS.SetPropertyRulePropertyNameResponse;
"CSS.setKeyframeKey": CSS.SetKeyframeKeyResponse;
"CSS.setMediaText": CSS.SetMediaTextResponse;
"CSS.setContainerQueryText": CSS.SetContainerQueryTextResponse;
@@ -17151,9 +17312,11 @@ export namespace V8 {
"Emulation.setAutomationOverride": Emulation.SetAutomationOverrideResponse;
"EventBreakpoints.setInstrumentationBreakpoint": EventBreakpoints.SetInstrumentationBreakpointResponse;
"EventBreakpoints.removeInstrumentationBreakpoint": EventBreakpoints.RemoveInstrumentationBreakpointResponse;
+ "EventBreakpoints.disable": EventBreakpoints.DisableResponse;
"FedCm.enable": FedCm.EnableResponse;
"FedCm.disable": FedCm.DisableResponse;
"FedCm.selectAccount": FedCm.SelectAccountResponse;
+ "FedCm.confirmIdpLogin": FedCm.ConfirmIdpLoginResponse;
"FedCm.dismissDialog": FedCm.DismissDialogResponse;
"FedCm.resetCooldown": FedCm.ResetCooldownResponse;
"Fetch.disable": Fetch.DisableResponse;
diff --git a/packages/bun-inspector-protocol/src/protocol/v8/protocol.json b/packages/bun-inspector-protocol/src/protocol/v8/protocol.json
index 979091bf0..cee8c2ca4 100644
--- a/packages/bun-inspector-protocol/src/protocol/v8/protocol.json
+++ b/packages/bun-inspector-protocol/src/protocol/v8/protocol.json
@@ -1091,7 +1091,8 @@
"Canceled",
"RpPageNotVisible",
"SilentMediationFailure",
- "ThirdPartyCookiesBlocked"
+ "ThirdPartyCookiesBlocked",
+ "NotSignedInWithIdp"
]
},
{
@@ -1164,6 +1165,34 @@
]
},
{
+ "id": "PropertyRuleIssueReason",
+ "type": "string",
+ "enum": ["InvalidSyntax", "InvalidInitialValue", "InvalidInherits", "InvalidName"]
+ },
+ {
+ "id": "PropertyRuleIssueDetails",
+ "description": "This issue warns about errors in property rules that lead to property\nregistrations being ignored.",
+ "type": "object",
+ "properties": [
+ {
+ "name": "sourceCodeLocation",
+ "description": "Source code position of the property rule.",
+ "$ref": "SourceCodeLocation"
+ },
+ {
+ "name": "propertyRuleIssueReason",
+ "description": "Reason why the property rule was discarded.",
+ "$ref": "PropertyRuleIssueReason"
+ },
+ {
+ "name": "propertyValue",
+ "description": "The value of the property rule property that failed to parse",
+ "optional": true,
+ "type": "string"
+ }
+ ]
+ },
+ {
"id": "InspectorIssueCode",
"description": "A unique identifier for the type of issue. Each type may use one of the\noptional fields in InspectorIssueDetails to convey more specific\ninformation about the kind of issue.",
"type": "string",
@@ -1185,7 +1214,8 @@
"FederatedAuthRequestIssue",
"BounceTrackingIssue",
"StylesheetLoadingIssue",
- "FederatedAuthUserInfoRequestIssue"
+ "FederatedAuthUserInfoRequestIssue",
+ "PropertyRuleIssue"
]
},
{
@@ -1227,6 +1257,7 @@
},
{ "name": "bounceTrackingIssueDetails", "optional": true, "$ref": "BounceTrackingIssueDetails" },
{ "name": "stylesheetLoadingIssueDetails", "optional": true, "$ref": "StylesheetLoadingIssueDetails" },
+ { "name": "propertyRuleIssueDetails", "optional": true, "$ref": "PropertyRuleIssueDetails" },
{
"name": "federatedAuthUserInfoRequestIssueDetails",
"optional": true,
@@ -1344,20 +1375,76 @@
"type": "object",
"properties": [
{ "name": "name", "description": "address field name, for example GIVEN_NAME.", "type": "string" },
- { "name": "value", "description": "address field name, for example Jon Doe.", "type": "string" }
+ { "name": "value", "description": "address field value, for example Jon Doe.", "type": "string" }
]
},
{
+ "id": "AddressFields",
+ "description": "A list of address fields.",
+ "type": "object",
+ "properties": [{ "name": "fields", "type": "array", "items": { "$ref": "AddressField" } }]
+ },
+ {
"id": "Address",
"type": "object",
"properties": [
{
"name": "fields",
- "description": "fields and values defining a test address.",
+ "description": "fields and values defining an address.",
"type": "array",
"items": { "$ref": "AddressField" }
}
]
+ },
+ {
+ "id": "AddressUI",
+ "description": "Defines how an address can be displayed like in chrome://settings/addresses.\nAddress UI is a two dimensional array, each inner array is an \"address information line\", and when rendered in a UI surface should be displayed as such.\nThe following address UI for instance:\n[[{name: \"GIVE_NAME\", value: \"Jon\"}, {name: \"FAMILY_NAME\", value: \"Doe\"}], [{name: \"CITY\", value: \"Munich\"}, {name: \"ZIP\", value: \"81456\"}]]\nshould allow the receiver to render:\nJon Doe\nMunich 81456",
+ "type": "object",
+ "properties": [
+ {
+ "name": "addressFields",
+ "description": "A two dimension array containing the repesentation of values from an address profile.",
+ "type": "array",
+ "items": { "$ref": "AddressFields" }
+ }
+ ]
+ },
+ {
+ "id": "FillingStrategy",
+ "description": "Specified whether a filled field was done so by using the html autocomplete attribute or autofill heuristics.",
+ "type": "string",
+ "enum": ["autocompleteAttribute", "autofillInferred"]
+ },
+ {
+ "id": "FilledField",
+ "type": "object",
+ "properties": [
+ { "name": "htmlType", "description": "The type of the field, e.g text, password etc.", "type": "string" },
+ { "name": "id", "description": "the html id", "type": "string" },
+ { "name": "name", "description": "the html name", "type": "string" },
+ { "name": "value", "description": "the field value", "type": "string" },
+ { "name": "autofillType", "description": "The actual field type, e.g FAMILY_NAME", "type": "string" },
+ { "name": "fillingStrategy", "description": "The filling strategy", "$ref": "FillingStrategy" }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "addressFormFilled",
+ "description": "Emitted when an address form is filled.",
+ "parameters": [
+ {
+ "name": "filledFields",
+ "description": "Information about the fields that were filled",
+ "type": "array",
+ "items": { "$ref": "FilledField" }
+ },
+ {
+ "name": "addressUi",
+ "description": "An UI representation of the address used to fill the form.\nConsists of a 2D array where each child represents an address/profile line.",
+ "$ref": "AddressUI"
+ }
+ ]
}
],
"commands": [
@@ -1387,7 +1474,9 @@
"name": "setAddresses",
"description": "Set addresses so that developers can verify their forms implementation.",
"parameters": [{ "name": "addresses", "type": "array", "items": { "$ref": "Address" } }]
- }
+ },
+ { "name": "disable", "description": "Disables autofill domain notifications." },
+ { "name": "enable", "description": "Enables autofill domain notifications." }
]
},
{
@@ -3212,6 +3301,18 @@
]
},
{
+ "name": "setPropertyRulePropertyName",
+ "description": "Modifies the property rule property name.",
+ "parameters": [
+ { "name": "styleSheetId", "$ref": "StyleSheetId" },
+ { "name": "range", "$ref": "SourceRange" },
+ { "name": "propertyName", "type": "string" }
+ ],
+ "returns": [
+ { "name": "propertyName", "description": "The resulting key text after modification.", "$ref": "Value" }
+ ]
+ },
+ {
"name": "setKeyframeKey",
"description": "Modifies the keyframe rule key text.",
"parameters": [
@@ -4628,7 +4729,7 @@
{
"domain": "DOMDebugger",
"description": "DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript\nexecution will stop on these operations as if there was a regular breakpoint set.",
- "dependencies": ["DOM", "Debugger", "Runtime"],
+ "dependencies": ["DOM", "Runtime"],
"types": [
{
"id": "DOMBreakpointType",
@@ -4738,6 +4839,8 @@
"name": "removeInstrumentationBreakpoint",
"description": "Removes breakpoint on particular native event.",
"experimental": true,
+ "deprecated": true,
+ "redirect": "EventBreakpoints",
"parameters": [{ "name": "eventName", "description": "Instrumentation name to stop on.", "type": "string" }]
},
{
@@ -4788,6 +4891,8 @@
"name": "setInstrumentationBreakpoint",
"description": "Sets breakpoint on particular native event.",
"experimental": true,
+ "deprecated": true,
+ "redirect": "EventBreakpoints",
"parameters": [{ "name": "eventName", "description": "Instrumentation name to stop on.", "type": "string" }]
},
{
@@ -6069,7 +6174,7 @@
},
{
"domain": "EventBreakpoints",
- "description": "EventBreakpoints permits setting breakpoints on particular operations and\nevents in targets that run JavaScript but do not have a DOM.\nJavaScript execution will stop on these operations as if there was a regular\nbreakpoint set.",
+ "description": "EventBreakpoints permits setting JavaScript breakpoints on operations and events\noccurring in native code invoked from JavaScript. Once breakpoint is hit, it is\nreported through Debugger domain, similarly to regular breakpoints being hit.",
"experimental": true,
"commands": [
{
@@ -6081,7 +6186,8 @@
"name": "removeInstrumentationBreakpoint",
"description": "Removes breakpoint on particular native event.",
"parameters": [{ "name": "eventName", "description": "Instrumentation name to stop on.", "type": "string" }]
- }
+ },
+ { "name": "disable", "description": "Removes all breakpoints" }
]
},
{
@@ -6099,7 +6205,7 @@
"id": "DialogType",
"description": "Whether the dialog shown is an account chooser or an auto re-authentication dialog.",
"type": "string",
- "enum": ["AccountChooser", "AutoReauthn", "ConfirmIdpSignin"]
+ "enum": ["AccountChooser", "AutoReauthn", "ConfirmIdpLogin"]
},
{
"id": "Account",
@@ -6112,7 +6218,7 @@
{ "name": "givenName", "type": "string" },
{ "name": "pictureUrl", "type": "string" },
{ "name": "idpConfigUrl", "type": "string" },
- { "name": "idpSigninUrl", "type": "string" },
+ { "name": "idpLoginUrl", "type": "string" },
{ "name": "loginState", "$ref": "LoginState" },
{
"name": "termsOfServiceUrl",
@@ -6161,6 +6267,11 @@
]
},
{
+ "name": "confirmIdpLogin",
+ "description": "Only valid if the dialog type is ConfirmIdpLogin. Acts as if the user had\nclicked the continue button.",
+ "parameters": [{ "name": "dialogId", "type": "string" }]
+ },
+ {
"name": "dismissDialog",
"parameters": [
{ "name": "dialogId", "type": "string" },
@@ -6987,16 +7098,14 @@
{
"name": "tiltX",
"description": "The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0)",
- "experimental": true,
"optional": true,
- "type": "integer"
+ "type": "number"
},
{
"name": "tiltY",
"description": "The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0).",
- "experimental": true,
"optional": true,
- "type": "integer"
+ "type": "number"
},
{
"name": "twist",
@@ -7280,16 +7389,14 @@
{
"name": "tiltX",
"description": "The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0).",
- "experimental": true,
"optional": true,
- "type": "integer"
+ "type": "number"
},
{
"name": "tiltY",
"description": "The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0).",
- "experimental": true,
"optional": true,
- "type": "integer"
+ "type": "number"
},
{
"name": "twist",
@@ -9158,6 +9265,7 @@
"ch-ect",
"ch-prefers-color-scheme",
"ch-prefers-reduced-motion",
+ "ch-prefers-reduced-transparency",
"ch-rtt",
"ch-save-data",
"ch-ua",
@@ -11403,7 +11511,6 @@
"LowEndDevice",
"InvalidSchemeRedirect",
"InvalidSchemeNavigation",
- "InProgressNavigation",
"NavigationRequestBlockedByCsp",
"MainFrameNavigation",
"MojoBinderPolicy",
@@ -11415,7 +11522,6 @@
"NavigationBadHttpStatus",
"ClientCertRequested",
"NavigationRequestNetworkError",
- "MaxNumOfRunningPrerendersExceeded",
"CancelAllHostsForTesting",
"DidFailLoad",
"Stop",
@@ -11427,9 +11533,8 @@
"MixedContent",
"TriggerBackgrounded",
"MemoryLimitExceeded",
- "FailToGetMemoryUsage",
"DataSaverEnabled",
- "HasEffectiveUrl",
+ "TriggerUrlHasEffectiveUrl",
"ActivatedBeforeStarted",
"InactivePageRestriction",
"StartFailed",
@@ -11460,7 +11565,13 @@
"PrerenderingDisabledByDevTools",
"ResourceLoadBlockedByClient",
"SpeculationRuleRemoved",
- "ActivatedWithAuxiliaryBrowsingContexts"
+ "ActivatedWithAuxiliaryBrowsingContexts",
+ "MaxNumOfRunningEagerPrerendersExceeded",
+ "MaxNumOfRunningNonEagerPrerendersExceeded",
+ "MaxNumOfRunningEmbedderPrerendersExceeded",
+ "PrerenderingUrlHasEffectiveUrl",
+ "RedirectedPrerenderingUrlHasEffectiveUrl",
+ "ActivationUrlHasEffectiveUrl"
]
},
{
@@ -11516,26 +11627,6 @@
},
{ "name": "ruleSetRemoved", "parameters": [{ "name": "id", "$ref": "RuleSetId" }] },
{
- "name": "prerenderAttemptCompleted",
- "description": "Fired when a prerender attempt is completed.",
- "parameters": [
- { "name": "key", "$ref": "PreloadingAttemptKey" },
- {
- "name": "initiatingFrameId",
- "description": "The frame id of the frame initiating prerendering.",
- "$ref": "Page.FrameId"
- },
- { "name": "prerenderingUrl", "type": "string" },
- { "name": "finalStatus", "$ref": "PrerenderFinalStatus" },
- {
- "name": "disallowedApiMethod",
- "description": "This is used to give users more information about the name of the API call\nthat is incompatible with prerender and has caused the cancellation of the attempt",
- "optional": true,
- "type": "string"
- }
- ]
- },
- {
"name": "preloadEnabledStateUpdated",
"description": "Fired when a preload enabled state is updated.",
"parameters": [
@@ -12077,14 +12168,14 @@
"id": "InterestGroupAccessType",
"description": "Enum of interest group access types.",
"type": "string",
- "enum": ["join", "leave", "update", "loaded", "bid", "win"]
+ "enum": ["join", "leave", "update", "loaded", "bid", "win", "additionalBid", "additionalBidWin", "clear"]
},
{
"id": "InterestGroupAd",
"description": "Ad advertising element inside an interest group.",
"type": "object",
"properties": [
- { "name": "renderUrl", "type": "string" },
+ { "name": "renderURL", "type": "string" },
{ "name": "metadata", "optional": true, "type": "string" }
]
},
@@ -12097,10 +12188,10 @@
{ "name": "name", "type": "string" },
{ "name": "expirationTime", "$ref": "Network.TimeSinceEpoch" },
{ "name": "joiningOrigin", "type": "string" },
- { "name": "biddingUrl", "optional": true, "type": "string" },
- { "name": "biddingWasmHelperUrl", "optional": true, "type": "string" },
- { "name": "updateUrl", "optional": true, "type": "string" },
- { "name": "trustedBiddingSignalsUrl", "optional": true, "type": "string" },
+ { "name": "biddingLogicURL", "optional": true, "type": "string" },
+ { "name": "biddingWasmHelperURL", "optional": true, "type": "string" },
+ { "name": "updateURL", "optional": true, "type": "string" },
+ { "name": "trustedBiddingSignalsURL", "optional": true, "type": "string" },
{ "name": "trustedBiddingSignalsKeys", "type": "array", "items": { "type": "string" } },
{ "name": "userBiddingSignals", "optional": true, "type": "string" },
{ "name": "ads", "type": "array", "items": { "$ref": "InterestGroupAd" } },
@@ -12276,19 +12367,23 @@
]
},
{
+ "id": "AttributionReportingEventReportWindows",
+ "experimental": true,
+ "type": "object",
+ "properties": [
+ { "name": "start", "description": "duration in seconds", "type": "integer" },
+ { "name": "ends", "description": "duration in seconds", "type": "array", "items": { "type": "integer" } }
+ ]
+ },
+ {
"id": "AttributionReportingSourceRegistration",
"experimental": true,
"type": "object",
"properties": [
{ "name": "time", "$ref": "Network.TimeSinceEpoch" },
- { "name": "expiry", "description": "duration in seconds", "optional": true, "type": "integer" },
- { "name": "eventReportWindow", "description": "duration in seconds", "optional": true, "type": "integer" },
- {
- "name": "aggregatableReportWindow",
- "description": "duration in seconds",
- "optional": true,
- "type": "integer"
- },
+ { "name": "expiry", "description": "duration in seconds", "type": "integer" },
+ { "name": "eventReportWindows", "$ref": "AttributionReportingEventReportWindows" },
+ { "name": "aggregatableReportWindow", "description": "duration in seconds", "type": "integer" },
{ "name": "type", "$ref": "AttributionReportingSourceType" },
{ "name": "sourceOrigin", "type": "string" },
{ "name": "reportingOrigin", "type": "string" },
diff --git a/packages/bun-inspector-protocol/src/util/preview.ts b/packages/bun-inspector-protocol/src/util/preview.ts
index c6d748304..78b1484ed 100644
--- a/packages/bun-inspector-protocol/src/util/preview.ts
+++ b/packages/bun-inspector-protocol/src/util/preview.ts
@@ -46,7 +46,10 @@ export function objectPreviewToString(objectPreview: JSC.Runtime.ObjectPreview):
items = entries.map(entryPreviewToString).sort();
} else if (properties) {
if (isIndexed(subtype)) {
- items = properties.map(indexedPropertyPreviewToString).sort();
+ items = properties.map(indexedPropertyPreviewToString);
+ if (subtype !== "array") {
+ items.sort();
+ }
} else {
items = properties.map(namedPropertyPreviewToString).sort();
}
diff --git a/packages/bun-internal-test/bun.lockb b/packages/bun-internal-test/bun.lockb
index f0d6d2032..cef9d5e7e 100755
--- a/packages/bun-internal-test/bun.lockb
+++ b/packages/bun-internal-test/bun.lockb
Binary files differ
diff --git a/packages/bun-lambda/README.md b/packages/bun-lambda/README.md
index 1553714ae..87d4fbb53 100644
--- a/packages/bun-lambda/README.md
+++ b/packages/bun-lambda/README.md
@@ -8,7 +8,7 @@ First, you will need to deploy the layer to your AWS account. Clone this reposit
```sh
git clone git@github.com:oven-sh/bun.git
-cd packages/bun-lambda
+cd bun/packages/bun-lambda
bun install
bun run publish-layer
```
diff --git a/packages/bun-lambda/package.json b/packages/bun-lambda/package.json
index f670787eb..9643d5463 100644
--- a/packages/bun-lambda/package.json
+++ b/packages/bun-lambda/package.json
@@ -2,6 +2,7 @@
"name": "bun-lambda",
"private": true,
"devDependencies": {
+ "@oclif/plugin-plugins": "^3.5.0",
"bun-types": "^0.7.0",
"jszip": "^3.10.1",
"oclif": "^3.6.5",
diff --git a/packages/bun-types/README.md b/packages/bun-types/README.md
index 19964c6f8..c11c1371d 100644
--- a/packages/bun-types/README.md
+++ b/packages/bun-types/README.md
@@ -12,7 +12,7 @@ Install the `bun-types` npm package:
```bash
# yarn/npm/pnpm work too, "bun-types" is an ordinary npm package
-bun add bun-types
+bun add -d bun-types
```
# Usage
@@ -21,9 +21,11 @@ Add this to your `tsconfig.json` or `jsconfig.json`:
```jsonc-diff
{
-
-+ "types": ["bun-types"],
-
+ "compilerOptions": {
++ "types": ["bun-types"]
+ // other options...
+ }
+
// other options...
}
```
diff --git a/packages/bun-types/buffer.d.ts b/packages/bun-types/buffer.d.ts
index fd7201677..6b9cc78c1 100644
--- a/packages/bun-types/buffer.d.ts
+++ b/packages/bun-types/buffer.d.ts
@@ -2084,31 +2084,31 @@ declare module "buffer" {
values(): IterableIterator<number>;
}
var Buffer: BufferConstructor;
+ }
- /**
- * This function returns `true` if `input` contains only valid UTF-8-encoded data,
- * including the case in which `input` is empty.
- *
- * Throws if the `input` is a detached array buffer.
- * @since Bun v0.6.13
- * @param input The input to validate.
- */
- export function isUtf8(
- input: TypedArray | ArrayBufferLike | DataView,
- ): boolean;
+ /**
+ * This function returns `true` if `input` contains only valid UTF-8-encoded data,
+ * including the case in which `input` is empty.
+ *
+ * Throws if the `input` is a detached array buffer.
+ * @since Bun v0.6.13
+ * @param input The input to validate.
+ */
+ export function isUtf8(
+ input: TypedArray | ArrayBufferLike | DataView,
+ ): boolean;
- /**
- * This function returns `true` if `input` contains only valid ASCII-encoded data,
- * including the case in which `input` is empty.
- *
- * Throws if the `input` is a detached array buffer.
- * @since Bun v0.6.13
- * @param input The input to validate.
- */
- export function isAscii(
- input: TypedArray | ArrayBufferLike | DataView,
- ): boolean;
- }
+ /**
+ * This function returns `true` if `input` contains only valid ASCII-encoded data,
+ * including the case in which `input` is empty.
+ *
+ * Throws if the `input` is a detached array buffer.
+ * @since Bun v0.6.13
+ * @param input The input to validate.
+ */
+ export function isAscii(
+ input: TypedArray | ArrayBufferLike | DataView,
+ ): boolean;
}
declare module "node:buffer" {
export * from "buffer";
diff --git a/packages/bun-types/bun-test.d.ts b/packages/bun-types/bun-test.d.ts
index 03a067dc2..57814d2aa 100644
--- a/packages/bun-types/bun-test.d.ts
+++ b/packages/bun-types/bun-test.d.ts
@@ -114,7 +114,7 @@ declare module "bun:test" {
export function spyOn<T extends object, K extends keyof T>(
obj: T,
methodOrPropertyValue: K,
- ): Mock<() => T[K]>;
+ ): Mock<T[K] extends AnyFunction ? T[K] : never>;
/**
* Describes a group of related tests.
@@ -174,18 +174,26 @@ declare module "bun:test" {
*
* @param table Array of Arrays with the arguments that are passed into the test fn for each row.
*/
- each<T extends ReadonlyArray<unknown>>(
+
+ each<T extends Readonly<[any, ...any[]]>>(
table: ReadonlyArray<T>,
): (
label: string,
- fn: (...args: T) => void | Promise<unknown>,
+ fn: (...args: [...T]) => void | Promise<unknown>,
options?: number | TestOptions,
) => void;
- each<T>(
+ each<T extends Array<any>>(
table: ReadonlyArray<T>,
): (
label: string,
- fn: (arg: T) => void | Promise<unknown>,
+ fn: (...args: Readonly<T>) => void | Promise<unknown>,
+ options?: number | TestOptions,
+ ) => void;
+ each<T>(
+ table: Array<T>,
+ ): (
+ label: string,
+ fn: (...args: T[]) => void | Promise<unknown>,
options?: number | TestOptions,
) => void;
};
@@ -419,18 +427,25 @@ declare module "bun:test" {
*
* @param table Array of Arrays with the arguments that are passed into the test fn for each row.
*/
- each<T extends ReadonlyArray<unknown>>(
+ each<T extends Readonly<[any, ...any[]]>>(
table: ReadonlyArray<T>,
): (
label: string,
- fn: (...args: T) => void | Promise<unknown>,
+ fn: (...args: [...T]) => void | Promise<unknown>,
options?: number | TestOptions,
) => void;
- each<T>(
+ each<T extends Array<any>>(
table: ReadonlyArray<T>,
): (
label: string,
- fn: (arg: T, done: (err?: unknown) => void) => void | Promise<unknown>,
+ fn: (...args: Readonly<T>) => void | Promise<unknown>,
+ options?: number | TestOptions,
+ ) => void;
+ each<T>(
+ table: Array<T>,
+ ): (
+ label: string,
+ fn: (...args: T[]) => void | Promise<unknown>,
options?: number | TestOptions,
) => void;
};
@@ -464,13 +479,13 @@ declare module "bun:test" {
* @param actual the actual value
*/
export const expect: {
- (actual?: unknown): Expect;
+ <T = unknown>(actual?: T): Expect<T>;
any: (
constructor: ((..._: any[]) => any) | { new (..._: any[]): any },
) => Expect;
anything: () => Expect;
- stringContaining: (str: string) => Expect;
- stringMatching: (regex: RegExp | string) => Expect;
+ stringContaining: (str: string) => Expect<string>;
+ stringMatching: <T extends RegExp | string>(regex: T) => Expect<T>;
};
/**
* Asserts that a value matches some criteria.
@@ -968,6 +983,16 @@ declare module "bun:test" {
*/
toBeWithin(start: number, end: number): void;
/**
+ * Asserts that a value is equal to the expected string, ignoring any whitespace.
+ *
+ * @example
+ * expect(" foo ").toEqualIgnoringWhitespace("foo");
+ * expect("bar").toEqualIgnoringWhitespace(" bar ");
+ *
+ * @param expected the expected string
+ */
+ toEqualIgnoringWhitespace(expected: string): void;
+ /**
* Asserts that a value is a `symbol`.
*
* @example
diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts
index f0161ef88..d183f1b33 100644
--- a/packages/bun-types/bun.d.ts
+++ b/packages/bun-types/bun.d.ts
@@ -70,6 +70,19 @@ declare module "bun" {
options?: { PATH?: string; cwd?: string },
): string | null;
+ interface TOML {
+ /**
+ * Parse a TOML string into a JavaScript object.
+ *
+ * @param {string} command The name of the executable or script
+ * @param {string} options.PATH Overrides the PATH environment variable
+ * @param {string} options.cwd Limits the search to a particular directory in which to searc
+ *
+ */
+ parse(input: string): object;
+ }
+ export const TOML: TOML;
+
export type Serve<WebSocketDataType = undefined> =
| ServeOptions
| TLSServeOptions
@@ -150,6 +163,10 @@ declare module "bun" {
export function write(
destination: BunFile | PathLike,
input: Blob | TypedArray | ArrayBufferLike | string | BlobPart[],
+ options?: {
+ /** If writing to a PathLike, set the permissions of the file. */
+ mode?: number;
+ },
): Promise<number>;
/**
@@ -908,6 +925,14 @@ declare module "bun" {
* Minify whitespace and comments from the output.
*/
minifyWhitespace?: boolean;
+ /**
+ * **Experimental**
+ *
+ * Enabled by default, use this to disable dead code elimination.
+ *
+ * Some other transpiler options may still do some specific dead code elimination.
+ */
+ deadCodeElimination?: boolean;
/**
* This does two things (and possibly more in the future):
@@ -1846,6 +1871,15 @@ declare module "bun" {
port?: string | number;
/**
+ * If the `SO_REUSEPORT` flag should be set.
+ *
+ * This allows multiple processes to bind to the same port, which is useful for load balancing.
+ *
+ * @default false
+ */
+ reusePort?: boolean;
+
+ /**
* What hostname should the server listen on?
*
* @default
@@ -2184,6 +2218,21 @@ declare module "bun" {
tls?: TLSOptions;
}
+ export interface SocketAddress {
+ /**
+ * The IP address of the client.
+ */
+ address: string;
+ /**
+ * The port of the client.
+ */
+ port: number;
+ /**
+ * The IP family ("IPv4" or "IPv6").
+ */
+ family: "IPv4" | "IPv6";
+ }
+
/**
* HTTP & HTTPS Server
*
@@ -2223,7 +2272,7 @@ declare module "bun" {
* });
*
* // Update the server to return a different response
- * server.update({
+ * server.reload({
* fetch(request) {
* return new Response("Hello World v2")
* }
@@ -2332,6 +2381,20 @@ declare module "bun" {
): ServerWebSocketSendStatus;
/**
+ * Returns the client IP address and port of the given Request. If the request was closed or is a unix socket, returns null.
+ *
+ * @example
+ * ```js
+ * export default {
+ * async fetch(request, server) {
+ * return new Response(server.requestIP(request));
+ * }
+ * }
+ * ```
+ */
+ requestIP(request: Request): SocketAddress | null;
+
+ /**
* How many requests are in-flight right now?
*/
readonly pendingRequests: number;
@@ -3160,7 +3223,7 @@ declare module "bun" {
loader: Loader;
}
- type OnLoadResult = OnLoadResultSourceCode | OnLoadResultObject;
+ type OnLoadResult = OnLoadResultSourceCode | OnLoadResultObject | undefined;
type OnLoadCallback = (
args: OnLoadArgs,
) => OnLoadResult | Promise<OnLoadResult>;
@@ -3252,6 +3315,37 @@ declare module "bun" {
* The config object passed to `Bun.build` as is. Can be mutated.
*/
config: BuildConfig & { plugins: BunPlugin[] };
+
+ /**
+ * Create a lazy-loaded virtual module that can be `import`ed or `require`d from other modules
+ *
+ * @param specifier The module specifier to register the callback for
+ * @param callback The function to run when the module is imported or required
+ *
+ * ### Example
+ * @example
+ * ```ts
+ * Bun.plugin({
+ * setup(builder) {
+ * builder.module("hello:world", () => {
+ * return { exports: { foo: "bar" }, loader: "object" };
+ * });
+ * },
+ * });
+ *
+ * // sometime later
+ * const { foo } = await import("hello:world");
+ * console.log(foo); // "bar"
+ *
+ * // or
+ * const { foo } = require("hello:world");
+ * console.log(foo); // "bar"
+ * ```
+ */
+ module(
+ specifier: string,
+ callback: () => OnLoadResult | Promise<OnLoadResult>,
+ ): void;
}
interface BunPlugin {
@@ -3815,7 +3909,7 @@ declare module "bun" {
: undefined;
type ReadableToSyncIO<X extends Readable> = X extends "pipe" | undefined
- ? Uint8Array
+ ? Buffer
: undefined;
type WritableIO = FileSink | number | undefined;
diff --git a/packages/bun-types/dns.d.ts b/packages/bun-types/dns.d.ts
index 247227fc2..8eee83361 100644
--- a/packages/bun-types/dns.d.ts
+++ b/packages/bun-types/dns.d.ts
@@ -701,10 +701,10 @@ declare module "dns" {
* one of the `DNS error codes`.
* @since v0.1.16
*/
- // export function reverse(
- // ip: string,
- // callback: (err: ErrnoException | null, hostnames: string[]) => void,
- // ): void;
+ export function reverse(
+ ip: string,
+ callback: (err: ErrnoException | null, hostnames: string[]) => void,
+ ): void;
/**
* Sets the IP address and port of servers to be used when performing DNS
* resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
@@ -749,7 +749,7 @@ declare module "dns" {
* ```
* @since v0.11.3
*/
- // export function getServers(): string[];
+ export function getServers(): string[];
/**
* Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be:
*
@@ -841,7 +841,7 @@ declare module "dns" {
* @since v8.3.0
*/
cancel(): void;
- // getServers: typeof getServers;
+ getServers: typeof getServers;
resolve: typeof resolve;
resolve4: typeof resolve4;
resolve6: typeof resolve6;
@@ -854,7 +854,7 @@ declare module "dns" {
resolveSoa: typeof resolveSoa;
resolveSrv: typeof resolveSrv;
resolveTxt: typeof resolveTxt;
- // reverse: typeof reverse;
+ reverse: typeof reverse;
/**
* The resolver instance will send its requests from the specified IP address.
* This allows programs to specify outbound interfaces when used on multi-homed
diff --git a/packages/bun-types/globals.d.ts b/packages/bun-types/globals.d.ts
index d43ee78bd..57dd4aafa 100644
--- a/packages/bun-types/globals.d.ts
+++ b/packages/bun-types/globals.d.ts
@@ -1,5 +1,3 @@
-// import * as tls from 'node:tls';
-
/**
* "blob" is not supported yet
*/
@@ -105,6 +103,15 @@ type MultipleResolveListener = (
) => void;
// type WorkerListener = (worker: Worker) => void;
+interface ConsoleOptions {
+ stdout: import("stream").Writable;
+ stderr?: import("stream").Writable;
+ ignoreErrors?: boolean;
+ colorMode?: boolean | "auto";
+ inspectOptions?: import("util").InspectOptions;
+ groupIndentation?: number;
+}
+
interface Console {
/**
* Asynchronously read lines from standard input (fd 0)
@@ -205,7 +212,19 @@ interface Console {
warn(...data: any[]): void;
}
-declare var console: Console;
+declare var console: Console & {
+ /**
+ * Creates a new Console with one or two writable stream instances. stdout is a writable stream to print log or info output. stderr is used for warning or error output. If stderr is not provided, stdout is used for stderr.
+ */
+ Console: {
+ new (options: ConsoleOptions): Console;
+ new (
+ stdout: import("stream").Writable,
+ stderr?: import("stream").Writable,
+ ignoreErrors?: boolean,
+ ): Console;
+ };
+};
declare namespace NodeJS {
interface RequireResolve {
@@ -527,6 +546,12 @@ interface Worker extends EventTarget, AbstractWorker {
*/
unref(): void;
+ /**
+ * An integer identifier for the referenced thread. Inside the worker thread,
+ * it is available as `require('node:worker_threads').threadId`.
+ * This value is unique for each `Worker` instance inside a single process.
+ * @since v10.5.0
+ */
threadId: number;
}
@@ -662,7 +687,7 @@ interface Process {
*/
setSourceMapsEnabled(enabled: boolean): void;
- kill(pid: number, signal?: string | number): void;
+ kill(pid: number, signal?: string | number): true;
on(event: "beforeExit", listener: BeforeExitListener): this;
// on(event: "disconnect", listener: DisconnectListener): this;
@@ -706,6 +731,16 @@ interface Process {
* @param listener The event handler function
*/
listenerCount(eventName: string | symbol, listener?: Function): number;
+
+ /**
+ * Get the constrained memory size for the process.
+ *
+ * On Linux, this is the memory limit for the process, accounting for cgroups 1 and 2.
+ * On other operating systems, this returns `undefined`.
+ */
+ constrainedMemory(): number | undefined;
+
+ send(data: any): void;
}
interface MemoryUsageObject {
@@ -1290,7 +1325,6 @@ interface RequestInit {
}
interface FetchRequestInit extends RequestInit {
-
/**
* Log the raw HTTP request & response to stdout. This API may be
* removed in a future version of Bun without notice.
@@ -2448,6 +2482,14 @@ declare var URL: {
createObjectURL(obj: Blob): string;
/** Not implemented yet */
revokeObjectURL(url: string): void;
+
+ /**
+ * Check if `url` is a valid URL string
+ *
+ * @param url URL string to parse
+ * @param base URL to resolve against
+ */
+ canParse(url: string, base?: string): boolean;
};
type TimerHandler = (...args: any[]) => void;
@@ -3500,8 +3542,9 @@ interface CallSite {
}
interface ArrayBufferConstructor {
- new (params: { byteLength: number; maxByteLength?: number }): ArrayBuffer;
+ new (byteLength: number, options: { maxByteLength?: number }): ArrayBuffer;
}
+
interface ArrayBuffer {
/**
* Read-only. The length of the ArrayBuffer (in bytes).
@@ -3800,3 +3843,11 @@ interface PromiseConstructor {
reject: (reason?: any) => void;
};
}
+
+interface Navigator {
+ readonly userAgent: string;
+ readonly platform: "MacIntel" | "Win32" | "Linux x86_64";
+ readonly hardwareConcurrency: number;
+}
+
+declare var navigator: Navigator;
diff --git a/packages/bun-types/package.json b/packages/bun-types/package.json
index 059ab0bfc..40ce131e4 100644
--- a/packages/bun-types/package.json
+++ b/packages/bun-types/package.json
@@ -1,6 +1,7 @@
{
"name": "bun-types",
"repository": "https://github.com/oven-sh/bun",
+ "license": "MIT",
"devDependencies": {
"conditional-type-checks": "^1.0.6",
"prettier": "^2.4.1",
@@ -12,7 +13,7 @@
"prebuild": "echo $(pwd)",
"build": "rm -rf ./dist && bun run bundle && bun run fmt",
"bundle": "bun scripts/bundle.ts ./dist",
- "test": "tsd",
+ "test": "tsc",
"fmt": "echo $(which prettier) && prettier --write './**/*.{ts,tsx,js,jsx}'"
},
"tsd": {
diff --git a/packages/bun-types/scripts/bundle.ts b/packages/bun-types/scripts/bundle.ts
index 031a90359..4b9109882 100644
--- a/packages/bun-types/scripts/bundle.ts
+++ b/packages/bun-types/scripts/bundle.ts
@@ -23,7 +23,7 @@ try {
const header = await file(join(import.meta.dir, "..", "header.txt")).text();
const filesToCat = (await getDotTsFiles("./")).filter(
- f => !["./index.d.ts"].some(tf => f === tf),
+ f => f !== "./index.d.ts",
);
const fileContents: string[] = [];
diff --git a/packages/bun-types/tests/array-buffer.test-d.ts b/packages/bun-types/tests/array-buffer.test-d.ts
index 7d28e2097..a3253138e 100644
--- a/packages/bun-types/tests/array-buffer.test-d.ts
+++ b/packages/bun-types/tests/array-buffer.test-d.ts
@@ -1,5 +1,4 @@
-const buffer = new ArrayBuffer({
- byteLength: 1024,
+const buffer = new ArrayBuffer(1024, {
maxByteLength: 2048,
});
diff --git a/packages/bun-types/tests/bun.test-d.ts b/packages/bun-types/tests/bun.test-d.ts
index 03301c13d..cd5a40eca 100644
--- a/packages/bun-types/tests/bun.test-d.ts
+++ b/packages/bun-types/tests/bun.test-d.ts
@@ -41,3 +41,6 @@ import * as tsd from "tsd";
env: { ...process.env, dummy: "" },
});
}
+{
+ Bun.TOML.parse("asdf = asdf");
+}
diff --git a/packages/bun-types/tests/dns.test-d.ts b/packages/bun-types/tests/dns.test-d.ts
new file mode 100644
index 000000000..3f701f346
--- /dev/null
+++ b/packages/bun-types/tests/dns.test-d.ts
@@ -0,0 +1,5 @@
+import * as dns from "node:dns";
+
+dns.resolve("asdf", "A", () => {});
+dns.reverse("asdf", () => {});
+dns.getServers();
diff --git a/packages/bun-types/tests/test.test-d.ts b/packages/bun-types/tests/test.test-d.ts
index 1d504272d..b385c3051 100644
--- a/packages/bun-types/tests/test.test-d.ts
+++ b/packages/bun-types/tests/test.test-d.ts
@@ -6,7 +6,12 @@ import {
afterAll,
beforeEach,
afterEach,
+ spyOn,
} from "bun:test";
+import { expectType } from "tsd";
+
+const spy = spyOn(console, "log");
+expectType<any[][]>(spy.mock.calls);
const hooks = [beforeAll, beforeEach, afterAll, afterEach];
@@ -40,6 +45,7 @@ describe("bun:test", () => {
test("expect()", () => {
expect(1).toBe(1);
expect(1).not.toBe(2);
+ // @ts-expect-error
expect({ a: 1 }).toEqual({ a: 1, b: undefined });
expect({ a: 1 }).toStrictEqual({ a: 1 });
expect(new Set()).toHaveProperty("size");
@@ -58,3 +64,69 @@ describe("bun:test", () => {
expect(undefined).not.toBeDefined();
});
});
+
+// inference should work when data is passed directly in
+test.each([
+ ["a", true, 5],
+ ["b", false, 1234],
+])("test.each", (a, b, c) => {
+ expectType<string>(a);
+ expectType<boolean>(b);
+ expectType<number | string>(c);
+});
+describe.each([
+ ["a", true, 5],
+ ["b", false, 5],
+])("test.each", (a, b, c) => {
+ expectType<string>(a);
+ expectType<boolean>(b);
+ expectType<number | string>(c);
+});
+describe.each([
+ ["a", true, 5],
+ ["b", false, "asdf"],
+])("test.each", (a, b, c) => {
+ expectType<string>(a);
+ expectType<boolean>(b);
+ expectType<number | string>(c);
+});
+describe.each([{ asdf: "asdf" }, { asdf: "asdf" }])("test.each", (a, b, c) => {
+ expectType<{ asdf: string }>(a);
+ expectType<{ asdf: string }>(c);
+});
+
+// no inference on data
+const data = [
+ ["a", true, 5],
+ ["b", false, "asdf"],
+];
+test.each(data)("test.each", (...args) => {
+ expectType<string | number | boolean>(args[0]);
+});
+describe.each(data)("test.each", (a, b, c) => {
+ expectType<string | number | boolean>(a);
+ expectType<string | number | boolean>(b);
+ expectType<string | number | boolean>(c);
+});
+
+// as const
+const dataAsConst = [
+ ["a", true, 5],
+ ["b", false, "asdf"],
+] as const;
+
+test.each(dataAsConst)("test.each", (...args) => {
+ expectType<string>(args[0]);
+ expectType<boolean>(args[1]);
+ expectType<string | number>(args[2]);
+});
+describe.each(dataAsConst)("test.each", (...args) => {
+ expectType<string>(args[0]);
+ expectType<boolean>(args[1]);
+ expectType<string | number>(args[2]);
+});
+describe.each(dataAsConst)("test.each", (a, b, c) => {
+ expectType<"a" | "b">(a);
+ expectType<boolean>(b);
+ expectType<5 | "asdf">(c);
+});
diff --git a/packages/bun-types/tsconfig.json b/packages/bun-types/tsconfig.json
index ad946c2e0..ed37def14 100644
--- a/packages/bun-types/tsconfig.json
+++ b/packages/bun-types/tsconfig.json
@@ -9,7 +9,9 @@
"allowSyntheticDefaultImports": true,
"disableSolutionSearching": true,
"noUnusedLocals": true,
- "outDir": "build"
+ "outDir": "build",
+ "noEmit": true,
+ "resolveJsonModule": true
},
"exclude": [
"dist",
diff --git a/packages/bun-types/ws.d.ts b/packages/bun-types/ws.d.ts
index a14f87edd..fc489006f 100644
--- a/packages/bun-types/ws.d.ts
+++ b/packages/bun-types/ws.d.ts
@@ -74,6 +74,8 @@ declare module "ws" {
WebSocket?: U | undefined;
}
+ interface ServerOption extends WebSocketServerOptions {}
+
interface AddressInfo {
address: string;
family: string;
@@ -219,4 +221,6 @@ declare module "ws" {
listener: (...args: any[]) => void,
): this;
}
+
+ var Server: typeof WebSocketServer;
}
diff --git a/packages/bun-usockets/src/bsd.c b/packages/bun-usockets/src/bsd.c
index 7683acd7d..fc501e4d9 100644
--- a/packages/bun-usockets/src/bsd.c
+++ b/packages/bun-usockets/src/bsd.c
@@ -665,9 +665,39 @@ int bsd_udp_packet_buffer_ecn(void *msgvec, int index) {
return 0; // no ecn defaults to 0
}
-static int bsd_do_connect(struct addrinfo *result, int fd)
+static int bsd_do_connect_raw(struct addrinfo *rp, int fd)
{
- return connect(fd, result->ai_addr, (socklen_t) result->ai_addrlen);
+ do {
+ if (connect(fd, rp->ai_addr, rp->ai_addrlen) == 0 || errno == EINPROGRESS) {
+ return 0;
+ }
+ } while (errno == EINTR);
+
+ return LIBUS_SOCKET_ERROR;
+}
+
+static int bsd_do_connect(struct addrinfo *rp, int *fd)
+{
+ while (rp != NULL) {
+ if (bsd_do_connect_raw(rp, *fd) == 0) {
+ return 0;
+ }
+
+ rp = rp->ai_next;
+ bsd_close_socket(*fd);
+
+ if (rp == NULL) {
+ return LIBUS_SOCKET_ERROR;
+ }
+
+ int resultFd = bsd_create_socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
+ if (resultFd < 0) {
+ return LIBUS_SOCKET_ERROR;
+ }
+ *fd = resultFd;
+ }
+
+ return LIBUS_SOCKET_ERROR;
}
LIBUS_SOCKET_DESCRIPTOR bsd_create_connect_socket(const char *host, int port, const char *source_host, int options) {
@@ -700,18 +730,21 @@ LIBUS_SOCKET_DESCRIPTOR bsd_create_connect_socket(const char *host, int port, co
return LIBUS_SOCKET_ERROR;
}
}
- }
-
- do {
- if (bsd_do_connect(result, fd) != 0 && errno != EINPROGRESS) {
+
+ if (bsd_do_connect_raw(result, fd) != 0) {
bsd_close_socket(fd);
freeaddrinfo(result);
return LIBUS_SOCKET_ERROR;
}
- } while (errno == EINTR);
-
+ } else {
+ if (bsd_do_connect(result, &fd) != 0) {
+ freeaddrinfo(result);
+ return LIBUS_SOCKET_ERROR;
+ }
+ }
+
+
freeaddrinfo(result);
-
return fd;
}
diff --git a/packages/bun-usockets/src/context.c b/packages/bun-usockets/src/context.c
index a4d243e85..9e0dd5356 100644
--- a/packages/bun-usockets/src/context.c
+++ b/packages/bun-usockets/src/context.c
@@ -29,6 +29,7 @@ int default_is_low_prio_handler(struct us_socket_t *s) {
unsigned short us_socket_context_timestamp(int ssl, struct us_socket_context_t *context) {
return context->timestamp;
}
+int us_internal_raw_root_certs(struct us_cert_string_t** out);
int us_raw_root_certs(struct us_cert_string_t**out){
return us_internal_raw_root_certs(out);
}
@@ -568,7 +569,7 @@ void *us_socket_context_ext(int ssl, struct us_socket_context_t *context) {
void us_socket_context_on_handshake(int ssl, struct us_socket_context_t *context, void (*on_handshake)(struct us_socket_context_t *, int success, struct us_bun_verify_error_t verify_error, void* custom_data), void* custom_data) {
#ifndef LIBUS_NO_SSL
if (ssl) {
- us_internal_on_ssl_handshake((struct us_internal_ssl_socket_context_t *) context, on_handshake, custom_data);
+ us_internal_on_ssl_handshake((struct us_internal_ssl_socket_context_t *) context, (void (*)(struct us_internal_ssl_socket_t *, int success, struct us_bun_verify_error_t verify_error, void* custom_data))on_handshake, custom_data);
return;
}
#endif
diff --git a/packages/bun-usockets/src/crypto/openssl.c b/packages/bun-usockets/src/crypto/openssl.c
index 0b55ca866..a03bf3520 100644
--- a/packages/bun-usockets/src/crypto/openssl.c
+++ b/packages/bun-usockets/src/crypto/openssl.c
@@ -45,7 +45,7 @@ void *sni_find(void *sni, const char *hostname);
#include "./root_certs.h"
#include <stdatomic.h>
-static const root_certs_size = sizeof(root_certs) / sizeof(root_certs[0]);
+static const size_t root_certs_size = sizeof(root_certs) / sizeof(root_certs[0]);
static X509* root_cert_instances[root_certs_size] = {NULL};
static atomic_flag root_cert_instances_lock = ATOMIC_FLAG_INIT;
static atomic_bool root_cert_instances_initialized = 0;
diff --git a/packages/bun-usockets/src/eventing/epoll_kqueue.c b/packages/bun-usockets/src/eventing/epoll_kqueue.c
index 7ab2be826..d051f5b5a 100644
--- a/packages/bun-usockets/src/eventing/epoll_kqueue.c
+++ b/packages/bun-usockets/src/eventing/epoll_kqueue.c
@@ -30,13 +30,13 @@ void Bun__internal_dispatch_ready_poll(void* loop, void* poll);
#include <stdint.h>
#endif
-void us_loop_run_bun_tick(struct us_loop_t *loop, int64_t timeoutMs);
+void us_loop_run_bun_tick(struct us_loop_t *loop, int64_t timeoutMs, void*);
/* Pointer tags are used to indicate a Bun pointer versus a uSockets pointer */
#define UNSET_BITS_49_UNTIL_64 0x0000FFFFFFFFFFFF
#define CLEAR_POINTER_TAG(p) ((void *) ((uintptr_t) (p) & UNSET_BITS_49_UNTIL_64))
-#define LIKELY(cond) __builtin_expect((uint64_t)(void*)cond, 1)
-#define UNLIKELY(cond) __builtin_expect((uint64_t)(void*)cond, 0)
+#define LIKELY(cond) __builtin_expect((uint64_t)(void*)(cond), 1)
+#define UNLIKELY(cond) __builtin_expect((uint64_t)(void*)(cond), 0)
#ifdef LIBUS_USE_EPOLL
#define GET_READY_POLL(loop, index) (struct us_poll_t *) loop->ready_polls[index].data.ptr
@@ -174,13 +174,20 @@ void us_loop_run(struct us_loop_t *loop) {
}
}
+void bun_on_tick_before(void* ctx);
+void bun_on_tick_after(void* ctx);
-void us_loop_run_bun_tick(struct us_loop_t *loop, int64_t timeoutMs) {
+
+void us_loop_run_bun_tick(struct us_loop_t *loop, int64_t timeoutMs, void* tickCallbackContext) {
us_loop_integrate(loop);
if (loop->num_polls == 0)
return;
+ if (tickCallbackContext) {
+ bun_on_tick_before(tickCallbackContext);
+ }
+
/* Emit pre callback */
us_internal_loop_pre(loop);
@@ -202,6 +209,10 @@ void us_loop_run_bun_tick(struct us_loop_t *loop, int64_t timeoutMs) {
}
#endif
+ if (tickCallbackContext) {
+ bun_on_tick_after(tickCallbackContext);
+ }
+
/* Iterate ready polls, dispatching them by type */
for (loop->current_ready_poll = 0; loop->current_ready_poll < loop->num_ready_polls; loop->current_ready_poll++) {
struct us_poll_t *poll = GET_READY_POLL(loop, loop->current_ready_poll);
@@ -403,14 +414,18 @@ struct us_timer_t *us_create_timer(struct us_loop_t *loop, int fallthrough, unsi
#endif
#ifdef LIBUS_USE_EPOLL
-void us_timer_close(struct us_timer_t *timer) {
+void us_timer_close(struct us_timer_t *timer, int fallthrough) {
struct us_internal_callback_t *cb = (struct us_internal_callback_t *) timer;
us_poll_stop(&cb->p, cb->loop);
close(us_poll_fd(&cb->p));
- /* (regular) sockets are the only polls which are not freed immediately */
- us_poll_free((struct us_poll_t *) timer, cb->loop);
+ /* (regular) sockets are the only polls which are not freed immediately */
+ if(fallthrough){
+ us_free(timer);
+ }else {
+ us_poll_free((struct us_poll_t *) timer, cb->loop);
+ }
}
void us_timer_set(struct us_timer_t *t, void (*cb)(struct us_timer_t *t), int ms, int repeat_ms) {
@@ -427,7 +442,7 @@ void us_timer_set(struct us_timer_t *t, void (*cb)(struct us_timer_t *t), int ms
us_poll_start((struct us_poll_t *) t, internal_cb->loop, LIBUS_SOCKET_READABLE);
}
#else
-void us_timer_close(struct us_timer_t *timer) {
+void us_timer_close(struct us_timer_t *timer, int fallthrough) {
struct us_internal_callback_t *internal_cb = (struct us_internal_callback_t *) timer;
struct kevent64_s event;
@@ -435,7 +450,11 @@ void us_timer_close(struct us_timer_t *timer) {
kevent64(internal_cb->loop->fd, &event, 1, NULL, 0, 0, NULL);
/* (regular) sockets are the only polls which are not freed immediately */
- us_poll_free((struct us_poll_t *) timer, internal_cb->loop);
+ if(fallthrough){
+ us_free(timer);
+ }else {
+ us_poll_free((struct us_poll_t *) timer, internal_cb->loop);
+ }
}
void us_timer_set(struct us_timer_t *t, void (*cb)(struct us_timer_t *t), int ms, int repeat_ms) {
diff --git a/packages/bun-usockets/src/libusockets.h b/packages/bun-usockets/src/libusockets.h
index 5f4563605..cff9a1bd2 100644
--- a/packages/bun-usockets/src/libusockets.h
+++ b/packages/bun-usockets/src/libusockets.h
@@ -132,7 +132,7 @@ struct us_timer_t *us_create_timer(struct us_loop_t *loop, int fallthrough, unsi
void *us_timer_ext(struct us_timer_t *timer);
/* */
-void us_timer_close(struct us_timer_t *timer);
+void us_timer_close(struct us_timer_t *timer, int fallthrough);
/* Arm a timer with a delay from now and eventually a repeat delay.
* Specify 0 as repeat delay to disable repeating. Specify both 0 to disarm. */
@@ -382,16 +382,17 @@ int us_socket_local_port(int ssl, struct us_socket_t *s);
/* Copy remote (IP) address of socket, or fail with zero length. */
void us_socket_remote_address(int ssl, struct us_socket_t *s, char *buf, int *length);
+void us_socket_local_address(int ssl, struct us_socket_t *s, char *buf, int *length);
/* Bun extras */
struct us_socket_t *us_socket_pair(struct us_socket_context_t *ctx, int socket_ext_size, LIBUS_SOCKET_DESCRIPTOR* fds);
struct us_socket_t *us_socket_from_fd(struct us_socket_context_t *ctx, int socket_ext_size, LIBUS_SOCKET_DESCRIPTOR fd);
-struct us_socket_t *us_socket_detach(int ssl, struct us_socket_t *s);
struct us_socket_t *us_socket_attach(int ssl, LIBUS_SOCKET_DESCRIPTOR client_fd, struct us_socket_context_t *ctx, int flags, int socket_ext_size);
struct us_socket_t *us_socket_wrap_with_tls(int ssl, struct us_socket_t *s, struct us_bun_socket_context_options_t options, struct us_socket_events_t events, int socket_ext_size);
int us_socket_raw_write(int ssl, struct us_socket_t *s, const char *data, int length, int msg_more);
struct us_socket_t* us_socket_open(int ssl, struct us_socket_t * s, int is_client, char* ip, int ip_length);
int us_raw_root_certs(struct us_cert_string_t**out);
+unsigned int us_get_remote_address_info(char *buf, struct us_socket_t *s, const char **dest, int *port, int *is_ipv6);
#ifdef __cplusplus
}
diff --git a/packages/bun-usockets/src/loop.c b/packages/bun-usockets/src/loop.c
index 9ad1e64bf..e230fa29b 100644
--- a/packages/bun-usockets/src/loop.c
+++ b/packages/bun-usockets/src/loop.c
@@ -47,7 +47,7 @@ void us_internal_loop_data_free(struct us_loop_t *loop) {
free(loop->data.recv_buf);
- us_timer_close(loop->data.sweep_timer);
+ us_timer_close(loop->data.sweep_timer, 0);
us_internal_async_close(loop->data.wakeup_async);
}
diff --git a/packages/bun-usockets/src/socket.c b/packages/bun-usockets/src/socket.c
index 5f5a91acb..d8371c2ff 100644
--- a/packages/bun-usockets/src/socket.c
+++ b/packages/bun-usockets/src/socket.c
@@ -48,6 +48,16 @@ void us_socket_remote_address(int ssl, struct us_socket_t *s, char *buf, int *le
}
}
+void us_socket_local_address(int ssl, struct us_socket_t *s, char *buf, int *length) {
+ struct bsd_addr_t addr;
+ if (bsd_local_addr(us_poll_fd(&s->p), &addr) || *length < bsd_addr_get_ip_length(&addr)) {
+ *length = 0;
+ } else {
+ *length = bsd_addr_get_ip_length(&addr);
+ memcpy(buf, bsd_addr_get_ip(&addr), *length);
+ }
+}
+
struct us_socket_context_t *us_socket_context(int ssl, struct us_socket_t *s) {
return s->context;
}
@@ -140,59 +150,6 @@ struct us_socket_t *us_socket_close(int ssl, struct us_socket_t *s, int code, vo
return s;
}
-// This function is the same as us_socket_close but:
-// - does not emit on_close event
-// - does not close
-struct us_socket_t *us_socket_detach(int ssl, struct us_socket_t *s) {
- if (!us_socket_is_closed(0, s)) {
- if (s->low_prio_state == 1) {
- /* Unlink this socket from the low-priority queue */
- if (!s->prev) s->context->loop->data.low_prio_head = s->next;
- else s->prev->next = s->next;
-
- if (s->next) s->next->prev = s->prev;
-
- s->prev = 0;
- s->next = 0;
- s->low_prio_state = 0;
- } else {
- us_internal_socket_context_unlink(s->context, s);
- }
- us_poll_stop((struct us_poll_t *) s, s->context->loop);
-
- /* Link this socket to the close-list and let it be deleted after this iteration */
- s->next = s->context->loop->data.closed_head;
- s->context->loop->data.closed_head = s;
-
- /* Any socket with prev = context is marked as closed */
- s->prev = (struct us_socket_t *) s->context;
-
- return s;
- }
- return s;
-}
-
-// This function is used for moving a socket between two different event loops
-struct us_socket_t *us_socket_attach(int ssl, LIBUS_SOCKET_DESCRIPTOR client_fd, struct us_socket_context_t *ctx, int flags, int socket_ext_size) {
- struct us_poll_t *accepted_p = us_create_poll(ctx->loop, 0, sizeof(struct us_socket_t) - sizeof(struct us_poll_t) + socket_ext_size);
- us_poll_init(accepted_p, client_fd, POLL_TYPE_SOCKET);
- us_poll_start(accepted_p, ctx->loop, flags);
-
- struct us_socket_t *s = (struct us_socket_t *) accepted_p;
-
- s->context = ctx;
- s->timeout = 0;
- s->low_prio_state = 0;
-
- /* We always use nodelay */
- bsd_socket_nodelay(client_fd, 1);
- us_internal_socket_context_link(ctx, s);
-
- if (ctx->on_open) ctx->on_open(s, 0, 0, 0);
-
- return s;
-}
-
struct us_socket_t *us_socket_pair(struct us_socket_context_t *ctx, int socket_ext_size, LIBUS_SOCKET_DESCRIPTOR* fds) {
#ifdef LIBUS_USE_LIBUV
return 0;
@@ -333,3 +290,25 @@ int us_socket_raw_write(int ssl, struct us_socket_t *s, const char *data, int le
// non-TLS is always raw
return us_socket_write(ssl, s, data, length, msg_more);
}
+
+unsigned int us_get_remote_address_info(char *buf, struct us_socket_t *s, const char **dest, int *port, int *is_ipv6)
+{
+ // This function is manual inlining + modification of
+ // us_socket_remote_address
+ // AsyncSocket::getRemoteAddress
+ // To get { ip, port, is_ipv6 } for Bun.serve().requestIP()
+ struct bsd_addr_t addr;
+ if (bsd_remote_addr(us_poll_fd(&s->p), &addr)) {
+ return 0;
+ }
+
+ int length = bsd_addr_get_ip_length(&addr);
+ if (!length) {
+ return 0;
+ }
+
+ memcpy(buf, bsd_addr_get_ip(&addr), length);
+ *port = bsd_addr_get_port(&addr);
+
+ return length;
+}
diff --git a/packages/bun-uws/capi/examples/Broadcast.c b/packages/bun-uws/capi/examples/Broadcast.c
index dc6787349..ef1b09101 100644
--- a/packages/bun-uws/capi/examples/Broadcast.c
+++ b/packages/bun-uws/capi/examples/Broadcast.c
@@ -14,7 +14,7 @@ void uws_timer_close(struct us_timer_t *timer)
struct timer_handler_data *data;
memcpy(&data, us_timer_ext(t), sizeof(struct timer_handler_data *));
free(data);
- us_timer_close(t);
+ us_timer_close(t, 0);
}
//Timer create helper
struct us_timer_t *uws_create_timer(int ms, int repeat_ms, void (*handler)(void *data), void *data)
@@ -47,7 +47,7 @@ struct us_timer_t *uws_create_timer(int ms, int repeat_ms, void (*handler)(void
if (!data->repeat)
{
free(data);
- us_timer_close(t);
+ us_timer_close(t, 0);
}
},
ms, repeat_ms);
diff --git a/packages/bun-uws/capi/examples/HelloWorldAsync.c b/packages/bun-uws/capi/examples/HelloWorldAsync.c
index b8549b07e..e22dd44c1 100644
--- a/packages/bun-uws/capi/examples/HelloWorldAsync.c
+++ b/packages/bun-uws/capi/examples/HelloWorldAsync.c
@@ -19,7 +19,7 @@ void uws_timer_close(struct us_timer_t *timer)
struct timer_handler_data *data;
memcpy(&data, us_timer_ext(t), sizeof(struct timer_handler_data *));
free(data);
- us_timer_close(t);
+ us_timer_close(t, 0);
}
//Timer create helper
struct us_timer_t *uws_create_timer(int ms, int repeat_ms, void (*handler)(void *data), void *data)
@@ -52,7 +52,7 @@ struct us_timer_t *uws_create_timer(int ms, int repeat_ms, void (*handler)(void
if (!data->repeat)
{
free(data);
- us_timer_close(t);
+ us_timer_close(t, 0);
}
},
ms, repeat_ms);
diff --git a/packages/bun-uws/capi/examples/UpgradeAsync.c b/packages/bun-uws/capi/examples/UpgradeAsync.c
index 3dacd8c8e..8c6e73542 100644
--- a/packages/bun-uws/capi/examples/UpgradeAsync.c
+++ b/packages/bun-uws/capi/examples/UpgradeAsync.c
@@ -62,7 +62,7 @@ void uws_timer_close(struct us_timer_t *timer)
struct timer_handler_data *data;
memcpy(&data, us_timer_ext(t), sizeof(struct timer_handler_data *));
free(data);
- us_timer_close(t);
+ us_timer_close(t, 0);
}
//Timer create helper
struct us_timer_t *uws_create_timer(int ms, int repeat_ms, void (*handler)(void *data), void *data)
@@ -95,7 +95,7 @@ struct us_timer_t *uws_create_timer(int ms, int repeat_ms, void (*handler)(void
if (!data->repeat)
{
free(data);
- us_timer_close(t);
+ us_timer_close(t, 0);
}
},
ms, repeat_ms);
diff --git a/packages/bun-uws/capi/libuwebsockets.h b/packages/bun-uws/capi/libuwebsockets.h
index 25c330af7..3008d1992 100644
--- a/packages/bun-uws/capi/libuwebsockets.h
+++ b/packages/bun-uws/capi/libuwebsockets.h
@@ -205,6 +205,7 @@ extern "C"
DLL_EXPORT unsigned int uws_ws_get_buffered_amount(int ssl, uws_websocket_t *ws);
DLL_EXPORT size_t uws_ws_get_remote_address(int ssl, uws_websocket_t *ws, const char **dest);
DLL_EXPORT size_t uws_ws_get_remote_address_as_text(int ssl, uws_websocket_t *ws, const char **dest);
+ DLL_EXPORT void uws_res_get_remote_address_info(uws_res_t *res, const char **dest, size_t *length, unsigned int *port);
//Response
DLL_EXPORT void uws_res_end(int ssl, uws_res_t *res, const char *data, size_t length, bool close_connection);
diff --git a/packages/bun-uws/examples/UpgradeAsync.cpp b/packages/bun-uws/examples/UpgradeAsync.cpp
index 0c5301be4..045605831 100644
--- a/packages/bun-uws/examples/UpgradeAsync.cpp
+++ b/packages/bun-uws/examples/UpgradeAsync.cpp
@@ -90,7 +90,7 @@ int main() {
delete upgradeData;
- us_timer_close(t);
+ us_timer_close(t, 0);
}, 5000, 0);
},
diff --git a/packages/bun-uws/src/AsyncSocket.h b/packages/bun-uws/src/AsyncSocket.h
index 8e3301f24..1051271a2 100644
--- a/packages/bun-uws/src/AsyncSocket.h
+++ b/packages/bun-uws/src/AsyncSocket.h
@@ -121,18 +121,25 @@ public:
void corkUnchecked() {
/* What if another socket is corked? */
getLoopData()->corkedSocket = this;
+ getLoopData()->corkedSocketIsSSL = SSL;
}
/* Cork this socket. Only one socket may ever be corked per-loop at any given time */
void cork() {
/* Extra check for invalid corking of others */
if (getLoopData()->corkOffset && getLoopData()->corkedSocket != this) {
- std::cerr << "Error: Cork buffer must not be acquired without checking canCork!" << std::endl;
- std::terminate();
+ // We uncork the other socket early instead of terminating the program
+ // is unlikely to be cause any issues and is better than crashing
+ if(getLoopData()->corkedSocketIsSSL) {
+ ((AsyncSocket<true> *) getLoopData()->corkedSocket)->uncork();
+ } else {
+ ((AsyncSocket<false> *) getLoopData()->corkedSocket)->uncork();
+ }
}
/* What if another socket is corked? */
getLoopData()->corkedSocket = this;
+ getLoopData()->corkedSocketIsSSL = SSL;
}
/* Returns the corked socket or nullptr */
diff --git a/packages/bun-uws/src/HttpResponse.h b/packages/bun-uws/src/HttpResponse.h
index d73f98152..aa372e4e3 100644
--- a/packages/bun-uws/src/HttpResponse.h
+++ b/packages/bun-uws/src/HttpResponse.h
@@ -77,12 +77,12 @@ public:
writeHeader("Date", std::string_view(((LoopData *) us_loop_ext(us_socket_context_loop(SSL, (us_socket_context(SSL, (us_socket_t *) this)))))->date, 29));
/* You can disable this altogether */
-#ifndef UWS_HTTPRESPONSE_NO_WRITEMARK
- if (!Super::getLoopData()->noMark) {
- /* We only expose major version */
- writeHeader("uWebSockets", "20");
- }
-#endif
+// #ifndef UWS_HTTPRESPONSE_NO_WRITEMARK
+// if (!Super::getLoopData()->noMark) {
+// /* We only expose major version */
+// writeHeader("uWebSockets", "20");
+// }
+// #endif
}
/* Returns true on success, indicating that it might be feasible to write more data.
@@ -439,6 +439,24 @@ public:
return {internalEnd(data, totalSize, true, true, closeConnection), hasResponded()};
}
+ /* Write the end of chunked encoded stream */
+ bool sendTerminatingChunk(bool closeConnection = false) {
+ writeStatus(HTTP_200_OK);
+ HttpResponseData<SSL> *httpResponseData = getHttpResponseData();
+ if (!(httpResponseData->state & HttpResponseData<SSL>::HTTP_WRITE_CALLED)) {
+ /* Write mark on first call to write */
+ writeMark();
+
+ writeHeader("Transfer-Encoding", "chunked");
+ httpResponseData->state |= HttpResponseData<SSL>::HTTP_WRITE_CALLED;
+ }
+
+ /* Terminating 0 chunk */
+ Super::write("\r\n0\r\n\r\n", 7);
+
+ return internalEnd({nullptr, 0}, 0, false, false, closeConnection);
+ }
+
/* Write parts of the response in chunking fashion. Starts timeout if failed. */
bool write(std::string_view data) {
writeStatus(HTTP_200_OK);
diff --git a/packages/bun-uws/src/Loop.h b/packages/bun-uws/src/Loop.h
index 6c7bdfc9e..7311dd976 100644
--- a/packages/bun-uws/src/Loop.h
+++ b/packages/bun-uws/src/Loop.h
@@ -58,12 +58,6 @@ private:
for (auto &p : loopData->postHandlers) {
p.second((Loop *) loop);
}
-
- /* After every event loop iteration, we must not hold the cork buffer */
- if (loopData->corkedSocket) {
- std::cerr << "Error: Cork buffer must not be held across event loop iterations!" << std::endl;
- std::terminate();
- }
}
Loop() = delete;
@@ -132,7 +126,7 @@ public:
LoopData *loopData = (LoopData *) us_loop_ext((us_loop_t *) this);
/* Stop and free dateTimer first */
- us_timer_close(loopData->dateTimer);
+ us_timer_close(loopData->dateTimer, 1);
loopData->~LoopData();
/* uSockets will track whether this loop is owned by us or a borrowed alien loop */
diff --git a/packages/bun-uws/src/LoopData.h b/packages/bun-uws/src/LoopData.h
index 986bf0cbd..92bd9ffff 100644
--- a/packages/bun-uws/src/LoopData.h
+++ b/packages/bun-uws/src/LoopData.h
@@ -98,6 +98,7 @@ public:
char *corkBuffer = new char[CORK_BUFFER_SIZE];
unsigned int corkOffset = 0;
void *corkedSocket = nullptr;
+ bool corkedSocketIsSSL = false;
/* Per message deflate data */
ZlibContext *zlibContext = nullptr;
diff --git a/packages/bun-vscode/README.md b/packages/bun-vscode/README.md
index c3d94924c..6848f8977 100644
--- a/packages/bun-vscode/README.md
+++ b/packages/bun-vscode/README.md
@@ -73,7 +73,7 @@ You can use the following configurations to debug JavaScript and TypeScript file
"name": "Attach to Bun",
// The URL of the WebSocket inspector to attach to.
- // This value can be retreived by using `bun --inspect`.
+ // This value can be retrieved by using `bun --inspect`.
"url": "ws://localhost:6499/",
}
]
@@ -89,12 +89,10 @@ You can use the following configurations to customize the behavior of the Bun ex
// The path to the `bun` executable.
"bun.runtime": "/path/to/bun",
- "bun.debugTerminal": {
- // If support for Bun should be added to the default "JavaScript Debug Terminal".
- "enabled": true,
-
- // If the debugger should stop on the first line of the program.
- "stopOnEntry": false,
- }
+ // If support for Bun should be added to the default "JavaScript Debug Terminal".
+ "bun.debugTerminal.enabled": true,
+
+ // If the debugger should stop on the first line of the program.
+ "bun.debugTerminal.stopOnEntry": false,
}
``` \ No newline at end of file
diff --git a/packages/bun-vscode/assets/vscode.css b/packages/bun-vscode/assets/vscode.css
new file mode 100644
index 000000000..32bdcc5b2
--- /dev/null
+++ b/packages/bun-vscode/assets/vscode.css
@@ -0,0 +1,69 @@
+.mtk1 { color: #cccccc; }
+.mtk2 { color: #1f1f1f; }
+.mtk3 { color: #d4d4d4; }
+.mtk4 { color: #000080; }
+.mtk5 { color: #6a9955; }
+.mtk6 { color: #569cd6; }
+.mtk7 { color: #b5cea8; }
+.mtk8 { color: #646695; }
+.mtk9 { color: #d7ba7d; }
+.mtk10 { color: #9cdcfe; }
+.mtk11 { color: #f44747; }
+.mtk12 { color: #ce9178; }
+.mtk13 { color: #6796e6; }
+.mtk14 { color: #808080; }
+.mtk15 { color: #d16969; }
+.mtk16 { color: #dcdcaa; }
+.mtk17 { color: #4ec9b0; }
+.mtk18 { color: #c586c0; }
+.mtk19 { color: #4fc1ff; }
+.mtk20 { color: #c8c8c8; }
+.mtk21 { color: #606060; }
+.mtk22 { color: #ffffff; }
+.mtk23 { color: #cd9731; }
+.mtk24 { color: #b267e6; }
+.mtki { font-style: italic; }
+.mtkb { font-weight: bold; }
+.mtku { text-decoration: underline; text-underline-position: under; }
+.mtks { text-decoration: line-through; }
+.mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }
+
+.bunlock {
+ display: flex;
+ flex-direction: row;
+}
+
+.lines {
+ display: flex;
+ flex-direction: column;
+ width: 30px;
+ margin-right: 15px;
+ text-align: right;
+ opacity: 0.5;
+
+ font-size: var(--vscode-editor-font-size);
+ font-weight: var(--vscode-editor-font-weight);
+ font-family: var(--vscode-editor-font-family);
+ background-color: var(--vscode-editor-background);
+}
+
+.lines > span {
+ margin-top: 1px;
+ margin-bottom: 1px;
+}
+
+code {
+ white-space: pre;
+
+ font-size: var(--vscode-editor-font-size);
+ font-weight: var(--vscode-editor-font-weight);
+ font-family: var(--vscode-editor-font-family);
+ background-color: var(--vscode-editor-background);
+}
+
+code > span {
+ display: inline-block;
+ width: 100%;
+ margin-top: 1px;
+ margin-bottom: 1px;
+}
diff --git a/packages/bun-vscode/bun.lockb b/packages/bun-vscode/bun.lockb
index c879b518e..c879b518e 100755..100644
--- a/packages/bun-vscode/bun.lockb
+++ b/packages/bun-vscode/bun.lockb
Binary files differ
diff --git a/packages/bun-vscode/example/package.json b/packages/bun-vscode/example/package.json
index 602fba159..eed10159d 100644
--- a/packages/bun-vscode/example/package.json
+++ b/packages/bun-vscode/example/package.json
@@ -7,6 +7,12 @@
"mime": "^3.0.0",
"mime-db": "^1.52.0"
},
+ "scripts": {
+ "run": "node hello.js",
+ "start": "hello.js",
+ "start:bun": "bun hello.js",
+ "start:bun:quotes": "bun run hello.js"
+ },
"trustedDependencies": [
"mime"
],
diff --git a/packages/bun-vscode/package.json b/packages/bun-vscode/package.json
index 39b5d37de..501257eb0 100644
--- a/packages/bun-vscode/package.json
+++ b/packages/bun-vscode/package.json
@@ -54,13 +54,7 @@
"../bun-inspector-protocol"
],
"activationEvents": [
- "onLanguage:javascript",
- "onLanguage:javascriptreact",
- "onLanguage:typescript",
- "onLanguage:typescriptreact",
- "workspaceContains:**/.lockb",
- "onDebugResolve:bun",
- "onDebugDynamicConfigurations:bun"
+ "onStartupFinished"
],
"browser": "dist/web-extension.js",
"bugs": {
@@ -95,7 +89,7 @@
},
"bun.debugTerminal.stopOnEntry": {
"type": "boolean",
- "description": "If Bun should stop on entry when used in the JavaScript Debug Terminal.",
+ "description": "If the debugger should stop on the first line when used in the JavaScript Debug Terminal.",
"scope": "window",
"default": false
}
@@ -177,12 +171,12 @@
"properties": {
"runtime": {
"type": "string",
- "description": "The path to Bun.",
+ "description": "The path to the `bun` executable. Defaults to `PATH` environment variable.",
"default": "bun"
},
"runtimeArgs": {
"type": "array",
- "description": "The command-line arguments passed to Bun.",
+ "description": "The command-line arguments passed to the `bun` executable. Unlike `args`, these arguments are not passed to the program, but to the `bun` executable itself.",
"items": {
"type": "string"
},
@@ -208,7 +202,7 @@
},
"env": {
"type": "object",
- "description": "The environment variables passed to Bun.",
+ "description": "The environment variables to pass to Bun.",
"default": {}
},
"strictEnv": {
@@ -218,7 +212,7 @@
},
"stopOnEntry": {
"type": "boolean",
- "description": "If a breakpoint should be set at the first line.",
+ "description": "If the debugger should stop on the first line of the program.",
"default": false
},
"noDebug": {
@@ -231,7 +225,7 @@
"boolean",
"string"
],
- "description": "If the process should be restarted when files change.",
+ "description": "If the process should be restarted when files change. Equivalent to passing `--watch` or `--hot` to the `bun` executable.",
"enum": [
true,
false,
@@ -245,7 +239,7 @@
"properties": {
"url": {
"type": "string",
- "description": "The URL of the Bun process to attach to."
+ "description": "The URL of the WebSocket inspector to attach to."
},
"noDebug": {
"type": "boolean",
@@ -254,7 +248,7 @@
},
"stopOnEntry": {
"type": "boolean",
- "description": "If a breakpoint should when the program is attached.",
+ "description": "If the debugger should stop on the first line of the program.",
"default": false
}
}
@@ -294,6 +288,20 @@
],
"priority": "default"
}
+ ],
+ "taskDefinitions": [
+ {
+ "type": "bun",
+ "required": [
+ "script"
+ ],
+ "properties": {
+ "script": {
+ "type": "string",
+ "description": "The script to execute"
+ }
+ }
+ }
]
}
}
diff --git a/packages/bun-vscode/scripts/build.mjs b/packages/bun-vscode/scripts/build.mjs
index 261965840..4f2292599 100644
--- a/packages/bun-vscode/scripts/build.mjs
+++ b/packages/bun-vscode/scripts/build.mjs
@@ -12,6 +12,9 @@ buildSync({
external: ["vscode"],
platform: "node",
format: "cjs",
+ // The following settings are required to allow for extension debugging
+ minify: false,
+ sourcemap: true,
});
rmSync("extension", { recursive: true, force: true });
diff --git a/packages/bun-vscode/src/extension.ts b/packages/bun-vscode/src/extension.ts
index e333aedd7..175165fa7 100644
--- a/packages/bun-vscode/src/extension.ts
+++ b/packages/bun-vscode/src/extension.ts
@@ -1,10 +1,14 @@
import * as vscode from "vscode";
-import activateLockfile from "./features/lockfile";
-import activateDebug from "./features/debug";
+import { registerTaskProvider } from "./features/tasks/tasks";
+import { registerDebugger } from "./features/debug";
+import { registerPackageJsonProviders } from "./features/tasks/package.json";
+import { registerBunlockEditor } from "./features/lockfile";
export function activate(context: vscode.ExtensionContext) {
- activateLockfile(context);
- activateDebug(context);
+ registerBunlockEditor(context);
+ registerDebugger(context);
+ registerTaskProvider(context);
+ registerPackageJsonProviders(context);
}
export function deactivate() {}
diff --git a/packages/bun-vscode/src/features/debug.ts b/packages/bun-vscode/src/features/debug.ts
index 2ea21dbe8..caa0c9378 100644
--- a/packages/bun-vscode/src/features/debug.ts
+++ b/packages/bun-vscode/src/features/debug.ts
@@ -4,43 +4,43 @@ import { DebugAdapter, UnixSignal } from "../../../bun-debug-adapter-protocol";
import { DebugSession } from "@vscode/debugadapter";
import { tmpdir } from "node:os";
-const debugConfiguration: vscode.DebugConfiguration = {
+export const DEBUG_CONFIGURATION: vscode.DebugConfiguration = {
type: "bun",
+ internalConsoleOptions: "neverOpen",
request: "launch",
name: "Debug File",
program: "${file}",
cwd: "${workspaceFolder}",
stopOnEntry: false,
watchMode: false,
- internalConsoleOptions: "neverOpen",
};
-const runConfiguration: vscode.DebugConfiguration = {
+export const RUN_CONFIGURATION: vscode.DebugConfiguration = {
type: "bun",
+ internalConsoleOptions: "neverOpen",
request: "launch",
name: "Run File",
program: "${file}",
cwd: "${workspaceFolder}",
noDebug: true,
watchMode: false,
- internalConsoleOptions: "neverOpen",
};
-const attachConfiguration: vscode.DebugConfiguration = {
+const ATTACH_CONFIGURATION: vscode.DebugConfiguration = {
type: "bun",
+ internalConsoleOptions: "neverOpen",
request: "attach",
name: "Attach Bun",
url: "ws://localhost:6499/",
stopOnEntry: false,
- internalConsoleOptions: "neverOpen",
};
const adapters = new Map<string, FileDebugSession>();
-export default function (context: vscode.ExtensionContext, factory?: vscode.DebugAdapterDescriptorFactory) {
+export function registerDebugger(context: vscode.ExtensionContext, factory?: vscode.DebugAdapterDescriptorFactory) {
context.subscriptions.push(
- vscode.commands.registerCommand("extension.bun.runFile", RunFileCommand),
- vscode.commands.registerCommand("extension.bun.debugFile", DebugFileCommand),
+ vscode.commands.registerCommand("extension.bun.runFile", runFileCommand),
+ vscode.commands.registerCommand("extension.bun.debugFile", debugFileCommand),
vscode.debug.registerDebugConfigurationProvider(
"bun",
new DebugConfigurationProvider(),
@@ -52,15 +52,15 @@ export default function (context: vscode.ExtensionContext, factory?: vscode.Debu
vscode.DebugConfigurationProviderTriggerKind.Dynamic,
),
vscode.debug.registerDebugAdapterDescriptorFactory("bun", factory ?? new InlineDebugAdapterFactory()),
- vscode.window.onDidOpenTerminal(InjectDebugTerminal),
+ vscode.window.onDidOpenTerminal(injectDebugTerminal),
);
}
-function RunFileCommand(resource?: vscode.Uri): void {
+function runFileCommand(resource?: vscode.Uri): void {
const path = getActivePath(resource);
if (path) {
vscode.debug.startDebugging(undefined, {
- ...runConfiguration,
+ ...RUN_CONFIGURATION,
noDebug: true,
program: path,
runtime: getRuntime(resource),
@@ -68,22 +68,21 @@ function RunFileCommand(resource?: vscode.Uri): void {
}
}
-function DebugFileCommand(resource?: vscode.Uri): void {
+export function debugCommand(command: string) {
+ vscode.debug.startDebugging(undefined, {
+ ...DEBUG_CONFIGURATION,
+ program: command,
+ runtime: getRuntime(),
+ });
+}
+
+function debugFileCommand(resource?: vscode.Uri) {
const path = getActivePath(resource);
- if (path) {
- vscode.debug.startDebugging(undefined, {
- ...debugConfiguration,
- program: path,
- runtime: getRuntime(resource),
- });
- }
+ if (path) debugCommand(path);
}
-function InjectDebugTerminal(terminal: vscode.Terminal): void {
- const enabled = getConfig("debugTerminal.enabled");
- if (enabled === false) {
- return;
- }
+function injectDebugTerminal(terminal: vscode.Terminal): void {
+ if (!getConfig("debugTerminal.enabled")) return;
const { name, creationOptions } = terminal;
if (name !== "JavaScript Debug Terminal") {
@@ -118,16 +117,9 @@ function InjectDebugTerminal(terminal: vscode.Terminal): void {
setTimeout(() => terminal.dispose(), 100);
}
-class TerminalProfileProvider implements vscode.TerminalProfileProvider {
- provideTerminalProfile(token: vscode.CancellationToken): vscode.ProviderResult<vscode.TerminalProfile> {
- const { terminalProfile } = new TerminalDebugSession();
- return terminalProfile;
- }
-}
-
class DebugConfigurationProvider implements vscode.DebugConfigurationProvider {
provideDebugConfigurations(folder?: vscode.WorkspaceFolder): vscode.ProviderResult<vscode.DebugConfiguration[]> {
- return [debugConfiguration, runConfiguration, attachConfiguration];
+ return [DEBUG_CONFIGURATION, RUN_CONFIGURATION, ATTACH_CONFIGURATION];
}
resolveDebugConfiguration(
@@ -139,9 +131,9 @@ class DebugConfigurationProvider implements vscode.DebugConfigurationProvider {
const { request } = config;
if (request === "attach") {
- target = attachConfiguration;
+ target = ATTACH_CONFIGURATION;
} else {
- target = debugConfiguration;
+ target = DEBUG_CONFIGURATION;
}
// If the configuration is missing a default property, copy it from the template.
@@ -219,7 +211,7 @@ class TerminalDebugSession extends FileDebugSession {
this.signal = new UnixSignal();
this.signal.on("Signal.received", () => {
vscode.debug.startDebugging(undefined, {
- ...attachConfiguration,
+ ...ATTACH_CONFIGURATION,
url: this.adapter.url,
});
});
@@ -238,34 +230,18 @@ class TerminalDebugSession extends FileDebugSession {
}
}
-function getActiveDocument(): vscode.TextDocument | undefined {
- return vscode.window.activeTextEditor?.document;
-}
-
function getActivePath(target?: vscode.Uri): string | undefined {
- if (!target) {
- target = getActiveDocument()?.uri;
- }
- return target?.fsPath;
-}
-
-function isJavaScript(languageId?: string): boolean {
- return (
- languageId === "javascript" ||
- languageId === "javascriptreact" ||
- languageId === "typescript" ||
- languageId === "typescriptreact"
- );
+ return target?.fsPath ?? vscode.window.activeTextEditor?.document?.uri.fsPath;
}
function getRuntime(scope?: vscode.ConfigurationScope): string {
- const value = getConfig("runtime", scope);
+ const value = getConfig<string>("runtime", scope);
if (typeof value === "string" && value.trim().length > 0) {
return value;
}
return "bun";
}
-function getConfig<T>(path: string, scope?: vscode.ConfigurationScope): unknown {
- return vscode.workspace.getConfiguration("bun", scope).get(path);
+function getConfig<T>(path: string, scope?: vscode.ConfigurationScope) {
+ return vscode.workspace.getConfiguration("bun", scope).get<T>(path);
}
diff --git a/packages/bun-vscode/src/features/lockfile.ts b/packages/bun-vscode/src/features/lockfile.ts
deleted file mode 100644
index 81adf5b9e..000000000
--- a/packages/bun-vscode/src/features/lockfile.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-import * as vscode from "vscode";
-import { spawn } from "node:child_process";
-
-export type BunLockfile = vscode.CustomDocument & {
- readonly preview: string;
-};
-
-export class BunLockfileEditorProvider implements vscode.CustomReadonlyEditorProvider {
- constructor(context: vscode.ExtensionContext) {}
-
- async openCustomDocument(
- uri: vscode.Uri,
- openContext: vscode.CustomDocumentOpenContext,
- token: vscode.CancellationToken,
- ): Promise<BunLockfile> {
- const preview = await previewLockfile(uri, token);
- return {
- uri,
- preview,
- dispose() {},
- };
- }
-
- async resolveCustomEditor(
- document: BunLockfile,
- webviewPanel: vscode.WebviewPanel,
- token: vscode.CancellationToken,
- ): Promise<void> {
- const { preview } = document;
- renderLockfile(webviewPanel, preview);
- }
-}
-
-function renderLockfile(webviewPanel: vscode.WebviewPanel, preview: string): void {
- // TODO: Improve syntax highlighting to match that of yarn.lock
- webviewPanel.webview.html = `<pre><code class="language-yaml">${preview}</code></pre>`;
-}
-
-function previewLockfile(uri: vscode.Uri, token?: vscode.CancellationToken): Promise<string> {
- return new Promise((resolve, reject) => {
- const process = spawn("bun", [uri.fsPath], {
- stdio: ["ignore", "pipe", "pipe"],
- });
- token.onCancellationRequested(() => {
- process.kill();
- });
- let stdout = "";
- process.stdout.on("data", (data: Buffer) => {
- stdout += data.toString();
- });
- let stderr = "";
- process.stderr.on("data", (data: Buffer) => {
- stderr += data.toString();
- });
- process.on("error", error => {
- reject(error);
- });
- process.on("exit", code => {
- if (code === 0) {
- resolve(stdout);
- } else {
- reject(new Error(`Bun exited with code: ${code}\n${stderr}`));
- }
- });
- });
-}
-
-export default function (context: vscode.ExtensionContext): void {
- const viewType = "bun.lockb";
- const provider = new BunLockfileEditorProvider(context);
-
- vscode.window.registerCustomEditorProvider(viewType, provider, {
- supportsMultipleEditorsPerDocument: true,
- webviewOptions: {
- enableFindWidget: true,
- retainContextWhenHidden: true,
- },
- });
-}
diff --git a/packages/bun-vscode/src/features/lockfile/index.ts b/packages/bun-vscode/src/features/lockfile/index.ts
new file mode 100644
index 000000000..cef9a1768
--- /dev/null
+++ b/packages/bun-vscode/src/features/lockfile/index.ts
@@ -0,0 +1,109 @@
+import * as vscode from "vscode";
+import { spawn } from "node:child_process";
+import { styleLockfile } from "./lockfile.style";
+
+export type BunLockfile = vscode.CustomDocument & {
+ readonly preview: string;
+};
+
+export class BunLockfileEditorProvider implements vscode.CustomReadonlyEditorProvider {
+ constructor(private context: vscode.ExtensionContext) {}
+
+ async openCustomDocument(
+ uri: vscode.Uri,
+ openContext: vscode.CustomDocumentOpenContext,
+ token: vscode.CancellationToken,
+ ): Promise<BunLockfile> {
+ const preview = await previewLockfile(uri, token);
+ return {
+ uri,
+ preview,
+ dispose() {},
+ };
+ }
+
+ async resolveCustomEditor(
+ document: BunLockfile,
+ webviewPanel: vscode.WebviewPanel,
+ token: vscode.CancellationToken,
+ ): Promise<void> {
+ const { preview } = document;
+ webviewPanel.webview.options = {
+ localResourceRoots: [this.context.extensionUri],
+ };
+ renderLockfile(webviewPanel, preview, this.context.extensionUri);
+ }
+}
+
+function renderLockfile({ webview }: vscode.WebviewPanel, preview: string, extensionUri: vscode.Uri): void {
+ const styleVSCodeUri = webview.asWebviewUri(vscode.Uri.joinPath(extensionUri, "assets", "vscode.css"));
+ const lockfileContent = styleLockfile(preview);
+
+ const lineNumbers: string[] = [];
+ for (let i = 0; i < lockfileContent.split("\n").length; i++) {
+ lineNumbers.push(`<span class="line-number">${i + 1}</span>`);
+ }
+
+ webview.html = `
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8">
+ <meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src ${webview.cspSource};">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link href="${styleVSCodeUri}" rel="stylesheet" />
+ </head>
+ <body>
+ <div class="bunlock">
+ <div class="lines">
+ ${lineNumbers.join("\n")}
+ </div>
+ <code>${lockfileContent}</code>
+ </div>
+ </body>
+</html>`;
+}
+
+function previewLockfile(uri: vscode.Uri, token?: vscode.CancellationToken): Promise<string> {
+ return new Promise((resolve, reject) => {
+ const process = spawn("bun", [uri.fsPath], {
+ stdio: ["ignore", "pipe", "pipe"],
+ });
+ token?.onCancellationRequested(() => {
+ process.kill();
+ });
+ let stdout = "";
+ process.stdout.on("data", (data: Buffer) => {
+ stdout += data.toString();
+ });
+ let stderr = "";
+ process.stderr.on("data", (data: Buffer) => {
+ stderr += data.toString();
+ });
+ process.on("error", error => {
+ reject(error);
+ });
+ process.on("exit", code => {
+ if (code === 0) {
+ resolve(stdout);
+ } else {
+ reject(new Error(`Bun exited with code: ${code}\n${stderr}`));
+ }
+ });
+ });
+}
+
+export function registerBunlockEditor(context: vscode.ExtensionContext): void {
+ const viewType = "bun.lockb";
+ const provider = new BunLockfileEditorProvider(context);
+
+ context.subscriptions.push(
+ vscode.window.registerCustomEditorProvider(viewType, provider, {
+ supportsMultipleEditorsPerDocument: true,
+ webviewOptions: {
+ enableFindWidget: true,
+ retainContextWhenHidden: true,
+ },
+ }),
+ );
+}
diff --git a/packages/bun-vscode/src/features/lockfile/lockfile.style.ts b/packages/bun-vscode/src/features/lockfile/lockfile.style.ts
new file mode 100644
index 000000000..7c4650497
--- /dev/null
+++ b/packages/bun-vscode/src/features/lockfile/lockfile.style.ts
@@ -0,0 +1,35 @@
+export function styleLockfile(preview: string) {
+ // Match all lines that don't start with a whitespace character
+ const lines = preview.split(/\n(?!\s)/);
+
+ return lines.map(styleSection).join("\n");
+}
+
+function styleSection(section: string) {
+ const lines = section.split(/\n/);
+
+ return lines.map(styleLine).join("\n");
+}
+
+function styleLine(line: string) {
+ if (line.startsWith("#")) {
+ return `<span class="mtk5">${line}</span>`;
+ }
+
+ const parts = line.trim().split(" ");
+ if (line.startsWith(" ")) {
+ return `<span><span class="mtk1">&nbsp;&nbsp;&nbsp;&nbsp;${parts[0]}&nbsp;</span><span class="mtk16">${parts[1]}</span></span>`;
+ }
+ if (line.startsWith(" ")) {
+ const leftPart = `<span class="mtk6">&nbsp;&nbsp;${parts[0]}&nbsp;</span>`;
+
+ if (parts.length === 1) return `<span>${leftPart}</span>`;
+
+ if (parts[1].startsWith('"http://') || parts[1].startsWith('"https://'))
+ return `<span>${leftPart}<span class="mtk12 detected-link">${parts[1]}</span></span>`;
+ if (parts[1].startsWith('"')) return `<span>${leftPart}<span class="mtk16">${parts[1]}</span></span>`;
+
+ return `<span>${leftPart}<span class="mtk6">${parts[1]}</span></span>`;
+ }
+ return `<span class="mtk1">${line}&nbsp;</span>`;
+}
diff --git a/packages/bun-vscode/src/features/tasks/package.json.ts b/packages/bun-vscode/src/features/tasks/package.json.ts
new file mode 100644
index 000000000..55947a4a1
--- /dev/null
+++ b/packages/bun-vscode/src/features/tasks/package.json.ts
@@ -0,0 +1,201 @@
+/**
+ * Automatically generates tasks from package.json scripts.
+ */
+import * as vscode from "vscode";
+import { BunTask } from "./tasks";
+import { debugCommand } from "../debug";
+
+/**
+ * Parses tasks defined in the package.json.
+ */
+export async function providePackageJsonTasks(): Promise<BunTask[]> {
+ //
+ const scripts: Record<string, string> = await (async () => {
+ try {
+ const file = vscode.Uri.file(vscode.workspace.workspaceFolders[0]?.uri.fsPath + "/package.json");
+
+ // Load contents of package.json, no need to check if file exists, we return null if it doesn't
+ const contents = await vscode.workspace.fs.readFile(file);
+ return JSON.parse(contents.toString()).scripts;
+ } catch {
+ return null;
+ }
+ })();
+ if (!scripts) return [];
+
+ return Object.entries(scripts).map(([name, script]) => {
+ // Prefix script with bun if it doesn't already start with bun
+ const shellCommand = script.startsWith("bun run ") ? script : `bun run ${script}`;
+
+ const task = new BunTask({
+ script,
+ name,
+ detail: `${shellCommand} - package.json`,
+ execution: new vscode.ShellExecution(shellCommand),
+ });
+ return task;
+ });
+}
+
+export function registerPackageJsonProviders(context: vscode.ExtensionContext) {
+ registerCodeLensProvider(context);
+ registerHoverProvider(context);
+}
+
+/**
+ * Utility function to extract the scripts from a package.json file, including their name and position in the document.
+ */
+function extractScriptsFromPackageJson(document: vscode.TextDocument) {
+ const content = document.getText();
+ const matches = content.match(/"scripts"\s*:\s*{([\s\S]*?)}/);
+ if (!matches || matches.length < 2) return null;
+
+ const startIndex = content.indexOf(matches[0]);
+ const endIndex = startIndex + matches[0].length;
+ const range = new vscode.Range(document.positionAt(startIndex), document.positionAt(endIndex));
+
+ const scripts = matches[1].split(/,\s*/).map(script => {
+ const elements = script.match(/"([^"\\]|\\.|\\\n)*"/g);
+ if (elements?.length != 2) return null;
+ const [name, command] = elements;
+ return {
+ name: name.replace('"', "").trim(),
+ command: command.replace(/(?<!\\)"/g, "").trim(),
+ range: new vscode.Range(
+ document.positionAt(startIndex + matches[0].indexOf(name)),
+ document.positionAt(startIndex + matches[0].indexOf(name) + name.length + command.length),
+ ),
+ };
+ });
+
+ return {
+ range,
+ scripts,
+ };
+}
+
+/**
+ * This function registers a CodeLens provider for package.json files. It is used to display the "Run" and "Debug" buttons
+ * above the scripts properties in package.json (inline).
+ */
+function registerCodeLensProvider(context: vscode.ExtensionContext) {
+ context.subscriptions.push(
+ // Register CodeLens provider for package.json files
+ vscode.languages.registerCodeLensProvider(
+ {
+ language: "json",
+ scheme: "file",
+ pattern: "**/package.json",
+ },
+ {
+ provideCodeLenses(document: vscode.TextDocument) {
+ const { range } = extractScriptsFromPackageJson(document);
+
+ const codeLenses: vscode.CodeLens[] = [];
+ codeLenses.push(
+ new vscode.CodeLens(range, {
+ title: "$(breakpoints-view-icon) Bun: Debug",
+ tooltip: "Debug a script using bun",
+ command: "extension.bun.codelens.run",
+ arguments: [{ type: "debug" }],
+ }),
+ new vscode.CodeLens(range, {
+ title: "$(debug-start) Bun: Run",
+ tooltip: "Run a script using bun",
+ command: "extension.bun.codelens.run",
+ arguments: [{ type: "run" }],
+ }),
+ );
+ return codeLenses;
+ },
+ resolveCodeLens(codeLens) {
+ return codeLens;
+ },
+ },
+ ),
+ // Register the commands that are executed when clicking the CodeLens buttons
+ vscode.commands.registerCommand("extension.bun.codelens.run", async ({ type }: { type: "debug" | "run" }) => {
+ const tasks = (await vscode.tasks.fetchTasks({ type: "bun" })) as BunTask[];
+ if (tasks.length === 0) return;
+
+ const pick = await vscode.window.showQuickPick(
+ tasks
+ .filter(task => task.detail.endsWith("package.json"))
+ .map(task => ({
+ label: task.name,
+ detail: task.detail,
+ })),
+ );
+ if (!pick) return;
+
+ const task = tasks.find(task => task.name === pick.label);
+ if (!task) return;
+
+ const command = type === "debug" ? "extension.bun.codelens.debug.task" : "extension.bun.codelens.run.task";
+
+ vscode.commands.executeCommand(command, {
+ script: task.definition.script,
+ name: task.name,
+ });
+ }),
+ );
+}
+
+function getActiveTerminal(name: string) {
+ return vscode.window.terminals.filter(terminal => terminal.name === name);
+}
+
+interface CommandArgs {
+ script: string;
+ name: string;
+}
+
+/**
+ * This function registers a Hover language feature provider for package.json files. It is used to display the
+ * "Run" and "Debug" buttons when hovering over a script property in package.json.
+ */
+function registerHoverProvider(context: vscode.ExtensionContext) {
+ context.subscriptions.push(
+ vscode.languages.registerHoverProvider("json", {
+ provideHover(document, position) {
+ const { scripts } = extractScriptsFromPackageJson(document);
+
+ return {
+ contents: scripts.map(script => {
+ if (!script.range.contains(position)) return null;
+
+ const command = encodeURI(JSON.stringify({ script: script.command, name: script.name }));
+
+ const markdownString = new vscode.MarkdownString(
+ `[Debug](command:extension.bun.codelens.debug.task?${command}) | [Run](command:extension.bun.codelens.run.task?${command})`,
+ );
+ markdownString.isTrusted = true;
+
+ return markdownString;
+ }),
+ };
+ },
+ }),
+ vscode.commands.registerCommand("extension.bun.codelens.debug.task", async ({ script, name }: CommandArgs) => {
+ if (script.startsWith("bun run ")) script = script.slice(8);
+ if (script.startsWith("bun ")) script = script.slice(4);
+
+ debugCommand(script);
+ }),
+ vscode.commands.registerCommand("extension.bun.codelens.run.task", async ({ script, name }: CommandArgs) => {
+ if (script.startsWith("bun run ")) script = script.slice(8);
+
+ name = `Bun Task: ${name}`;
+ const terminals = getActiveTerminal(name);
+ if (terminals.length > 0) {
+ terminals[0].show();
+ terminals[0].sendText(`bun run ${script}`);
+ return;
+ }
+
+ const terminal = vscode.window.createTerminal({ name });
+ terminal.show();
+ terminal.sendText(`bun run ${script}`);
+ }),
+ );
+}
diff --git a/packages/bun-vscode/src/features/tasks/tasks.ts b/packages/bun-vscode/src/features/tasks/tasks.ts
new file mode 100644
index 000000000..aabeb3920
--- /dev/null
+++ b/packages/bun-vscode/src/features/tasks/tasks.ts
@@ -0,0 +1,59 @@
+import * as vscode from "vscode";
+import { providePackageJsonTasks } from "./package.json";
+
+interface BunTaskDefinition extends vscode.TaskDefinition {
+ script: string;
+}
+
+export class BunTask extends vscode.Task {
+ declare definition: BunTaskDefinition;
+
+ constructor({
+ script,
+ name,
+ detail,
+ execution,
+ scope = vscode.TaskScope.Workspace,
+ }: {
+ script: string;
+ name: string;
+ detail?: string;
+ scope?: vscode.WorkspaceFolder | vscode.TaskScope.Global | vscode.TaskScope.Workspace;
+ execution?: vscode.ProcessExecution | vscode.ShellExecution | vscode.CustomExecution;
+ }) {
+ super({ type: "bun", script }, scope, name, "bun", execution);
+ this.detail = detail;
+ }
+}
+
+/**
+ * Registers the task provider for the bun extension.
+ */
+export function registerTaskProvider(context: vscode.ExtensionContext) {
+ const taskProvider: vscode.TaskProvider<BunTask> = {
+ provideTasks: async () => await providePackageJsonTasks(),
+ resolveTask: task => resolveTask(task),
+ };
+ context.subscriptions.push(vscode.tasks.registerTaskProvider("bun", taskProvider));
+}
+
+/**
+ * Parses tasks defined in the vscode tasks.json file.
+ * For more information, see https://code.visualstudio.com/api/extension-guides/task-provider
+ */
+export function resolveTask(task: BunTask): BunTask | undefined {
+ // Make sure the task has a script defined
+ const definition: BunTask["definition"] = task.definition;
+ if (!definition.script) return task;
+ const shellCommand = definition.script.startsWith("bun ") ? definition.script : `bun ${definition.script}`;
+
+ const newTask = new vscode.Task(
+ definition,
+ task.scope ?? vscode.TaskScope.Workspace,
+ task.name,
+ "bun",
+ new vscode.ShellExecution(shellCommand),
+ ) as BunTask;
+ newTask.detail = `${shellCommand} - tasks.json`;
+ return newTask;
+}
diff --git a/src/baby_list.zig b/src/baby_list.zig
index 5881f2c50..a691ea1c7 100644
--- a/src/baby_list.zig
+++ b/src/baby_list.zig
@@ -279,5 +279,13 @@ pub fn BabyList(comptime Type: type) type {
return this.len - initial;
}
+
+ pub fn writeTypeAsBytesAssumeCapacity(this: *@This(), comptime Int: type, int: Int) void {
+ if (comptime Type != u8)
+ @compileError("Unsupported for type " ++ @typeName(Type));
+ std.debug.assert(this.cap >= this.len + @sizeOf(Int));
+ @as([*]align(1) Int, @ptrCast(this.ptr[this.len .. this.len + @sizeOf(Int)]))[0] = int;
+ this.len += @sizeOf(Int);
+ }
};
}
diff --git a/src/build-id b/src/build-id
index 56a6051ca..62f945751 100644
--- a/src/build-id
+++ b/src/build-id
@@ -1 +1 @@
-1 \ No newline at end of file
+6 \ No newline at end of file
diff --git a/src/bun.js/WebKit b/src/bun.js/WebKit
-Subproject a780bdf0255ae1a7ed15e4b3f31c14af705faca
+Subproject 1a49a1f94bf42ab4f8c6b11d7bbbb21e491d2d6
diff --git a/src/bun.js/api/JSTranspiler.zig b/src/bun.js/api/JSTranspiler.zig
index 8cec025eb..d41458acb 100644
--- a/src/bun.js/api/JSTranspiler.zig
+++ b/src/bun.js/api/JSTranspiler.zig
@@ -72,6 +72,7 @@ const TranspilerOptions = struct {
trim_unused_imports: ?bool = null,
inlining: bool = false,
+ dead_code_elimination: bool = true,
minify_whitespace: bool = false,
minify_identifiers: bool = false,
minify_syntax: bool = false,
@@ -541,6 +542,10 @@ fn transformOptionsFromJSC(globalObject: JSC.C.JSContextRef, temp_allocator: std
transpiler.minify_whitespace = flag.toBoolean();
}
+ if (object.get(globalThis, "deadCodeElimination")) |flag| {
+ transpiler.dead_code_elimination = flag.toBoolean();
+ }
+
if (object.getTruthy(globalThis, "minify")) |hot| {
if (hot.isBoolean()) {
transpiler.minify_whitespace = hot.coerce(bool, globalThis);
@@ -800,6 +805,7 @@ pub fn constructor(
bundler.options.macro_remap = transpiler_options.macro_map;
}
+ bundler.options.dead_code_elimination = transpiler_options.dead_code_elimination;
bundler.options.minify_whitespace = transpiler_options.minify_whitespace;
// Keep defaults for these
diff --git a/src/bun.js/api/bun.zig b/src/bun.js/api/bun.zig
index 966c82d38..21c2ecd0e 100644
--- a/src/bun.js/api/bun.zig
+++ b/src/bun.js/api/bun.zig
@@ -782,11 +782,17 @@ fn doResolveWithArgs(
var errorable: ErrorableString = undefined;
var query_string = ZigString.Empty;
+ const specifier_decoded = if (specifier.hasPrefixComptime("file://"))
+ bun.JSC.URL.pathFromFileURL(specifier)
+ else
+ specifier.dupeRef();
+ defer specifier_decoded.deref();
+
if (comptime is_file_path) {
VirtualMachine.resolveFilePathForAPI(
&errorable,
ctx.ptr(),
- specifier,
+ specifier_decoded,
from,
&query_string,
is_esm,
@@ -795,7 +801,7 @@ fn doResolveWithArgs(
VirtualMachine.resolveForAPI(
&errorable,
ctx.ptr(),
- specifier,
+ specifier_decoded,
from,
&query_string,
is_esm,
@@ -1098,10 +1104,12 @@ pub const Crypto = struct {
}
pub fn reset(this: *EVP, engine: *BoringSSL.ENGINE) void {
+ BoringSSL.ERR_clear_error();
_ = BoringSSL.EVP_DigestInit_ex(&this.ctx, this.md, engine);
}
pub fn hash(this: *EVP, engine: *BoringSSL.ENGINE, input: []const u8, output: []u8) ?u32 {
+ BoringSSL.ERR_clear_error();
var outsize: c_uint = @min(@as(u16, @truncate(output.len)), this.size());
if (BoringSSL.EVP_Digest(input.ptr, input.len, output.ptr, &outsize, this.md, engine) != 1) {
return null;
@@ -1111,6 +1119,7 @@ pub const Crypto = struct {
}
pub fn final(this: *EVP, engine: *BoringSSL.ENGINE, output: []u8) []const u8 {
+ BoringSSL.ERR_clear_error();
var outsize: u32 = @min(@as(u16, @truncate(output.len)), this.size());
if (BoringSSL.EVP_DigestFinal_ex(
&this.ctx,
@@ -1126,6 +1135,7 @@ pub const Crypto = struct {
}
pub fn update(this: *EVP, input: []const u8) void {
+ BoringSSL.ERR_clear_error();
_ = BoringSSL.EVP_DigestUpdate(&this.ctx, input.ptr, input.len);
}
@@ -1134,6 +1144,7 @@ pub const Crypto = struct {
}
pub fn copy(this: *const EVP, engine: *BoringSSL.ENGINE) error{OutOfMemory}!EVP {
+ BoringSSL.ERR_clear_error();
var new = init(this.algorithm, this.md, engine);
if (BoringSSL.EVP_MD_CTX_copy_ex(&new.ctx, &this.ctx) == 0) {
return error.OutOfMemory;
@@ -2004,7 +2015,6 @@ pub const Crypto = struct {
pub const digest = JSC.wrapInstanceMethod(CryptoHasher, "digest_", false);
pub const hash = JSC.wrapStaticMethod(CryptoHasher, "hash_", false);
-
pub fn getByteLength(
this: *CryptoHasher,
_: *JSC.JSGlobalObject,
@@ -3594,7 +3604,7 @@ pub const Timer = struct {
this.poll_ref.unref(vm);
- this.timer.deinit();
+ this.timer.deinit(false);
// balance double unreffing in doUnref
vm.event_loop_handle.?.num_polls += @as(i32, @intFromBool(this.did_unref_timer));
diff --git a/src/bun.js/api/bun/dns_resolver.zig b/src/bun.js/api/bun/dns_resolver.zig
index 8232318a2..3c20f4df7 100644
--- a/src/bun.js/api/bun/dns_resolver.zig
+++ b/src/bun.js/api/bun/dns_resolver.zig
@@ -102,11 +102,12 @@ const LibInfo = struct {
) catch unreachable;
const promise_value = request.head.promise.value();
+ const hints = query.options.toLibC();
const errno = getaddrinfo_async_start_(
&request.backend.libinfo.machport,
name_z.ptr,
null,
- null,
+ if (hints != null) &hints.? else null,
GetAddrInfoRequest.getAddrInfoAsyncCallback,
request,
);
@@ -812,6 +813,170 @@ pub const GetHostByAddrInfoRequest = struct {
}
};
+pub const CAresNameInfo = struct {
+ const log = Output.scoped(@This(), true);
+
+ globalThis: *JSC.JSGlobalObject = undefined,
+ promise: JSC.JSPromise.Strong,
+ poll_ref: JSC.PollRef,
+ allocated: bool = false,
+ next: ?*@This() = null,
+ name: []const u8,
+
+ pub fn init(globalThis: *JSC.JSGlobalObject, allocator: std.mem.Allocator, name: []const u8) !*@This() {
+ var this = try allocator.create(@This());
+ var poll_ref = JSC.PollRef.init();
+ poll_ref.ref(globalThis.bunVM());
+ this.* = .{ .globalThis = globalThis, .promise = JSC.JSPromise.Strong.init(globalThis), .poll_ref = poll_ref, .allocated = true, .name = name };
+ return this;
+ }
+
+ pub fn processResolve(this: *@This(), err_: ?c_ares.Error, _: i32, result: ?c_ares.struct_nameinfo) void {
+ if (err_) |err| {
+ var promise = this.promise;
+ var globalThis = this.globalThis;
+ const error_value = globalThis.createErrorInstance("lookupService failed: {s}", .{err.label()});
+ error_value.put(
+ globalThis,
+ JSC.ZigString.static("code"),
+ JSC.ZigString.init(err.code()).toValueGC(globalThis),
+ );
+
+ promise.reject(globalThis, error_value);
+ this.deinit();
+ return;
+ }
+ if (result == null) {
+ var promise = this.promise;
+ var globalThis = this.globalThis;
+ const error_value = globalThis.createErrorInstance("lookupService failed: No results", .{});
+ error_value.put(
+ globalThis,
+ JSC.ZigString.static("code"),
+ JSC.ZigString.init("EUNREACHABLE").toValueGC(globalThis),
+ );
+
+ promise.reject(globalThis, error_value);
+ this.deinit();
+ return;
+ }
+ var name_info = result.?;
+ const array = name_info.toJSResponse(this.globalThis.allocator(), this.globalThis);
+ this.onComplete(array);
+ return;
+ }
+
+ pub fn onComplete(this: *@This(), result: JSC.JSValue) void {
+ var promise = this.promise;
+ var globalThis = this.globalThis;
+ this.promise = .{};
+ promise.resolve(globalThis, result);
+ this.deinit();
+ }
+
+ pub fn deinit(this: *@This()) void {
+ this.poll_ref.unrefOnNextTick(this.globalThis.bunVM());
+ // freed
+ bun.default_allocator.free(this.name);
+
+ if (this.allocated)
+ this.globalThis.allocator().destroy(this);
+ }
+};
+
+pub const GetNameInfoRequest = struct {
+ const request_type = @This();
+
+ const log = Output.scoped(@This(), false);
+
+ resolver_for_caching: ?*DNSResolver = null,
+ hash: u64 = 0,
+ cache: @This().CacheConfig = @This().CacheConfig{},
+ head: CAresNameInfo,
+ tail: *CAresNameInfo = undefined,
+
+ pub fn init(
+ cache: DNSResolver.LookupCacheHit(@This()),
+ resolver: ?*DNSResolver,
+ name: []const u8,
+ globalThis: *JSC.JSGlobalObject,
+ comptime cache_field: []const u8,
+ ) !*@This() {
+ var request = try globalThis.allocator().create(@This());
+ var hasher = std.hash.Wyhash.init(0);
+ hasher.update(name);
+ const hash = hasher.final();
+ var poll_ref = JSC.PollRef.init();
+ poll_ref.ref(globalThis.bunVM());
+ request.* = .{
+ .resolver_for_caching = resolver,
+ .hash = hash,
+ .head = .{ .poll_ref = poll_ref, .globalThis = globalThis, .promise = JSC.JSPromise.Strong.init(globalThis), .allocated = false, .name = name },
+ };
+ request.tail = &request.head;
+ if (cache == .new) {
+ request.resolver_for_caching = resolver;
+ request.cache = @This().CacheConfig{
+ .pending_cache = true,
+ .entry_cache = false,
+ .pos_in_pending = @as(u5, @truncate(@field(resolver.?, cache_field).indexOf(cache.new).?)),
+ .name_len = @as(u9, @truncate(name.len)),
+ };
+ cache.new.lookup = request;
+ }
+ return request;
+ }
+
+ pub const CacheConfig = packed struct(u16) {
+ pending_cache: bool = false,
+ entry_cache: bool = false,
+ pos_in_pending: u5 = 0,
+ name_len: u9 = 0,
+ };
+
+ pub const PendingCacheKey = struct {
+ hash: u64,
+ len: u16,
+ lookup: *request_type = undefined,
+
+ pub fn append(this: *PendingCacheKey, cares_lookup: *CAresNameInfo) void {
+ var tail = this.lookup.tail;
+ tail.next = cares_lookup;
+ this.lookup.tail = cares_lookup;
+ }
+
+ pub fn init(name: []const u8) PendingCacheKey {
+ var hasher = std.hash.Wyhash.init(0);
+ hasher.update(name);
+ const hash = hasher.final();
+ return PendingCacheKey{
+ .hash = hash,
+ .len = @as(u16, @truncate(name.len)),
+ .lookup = undefined,
+ };
+ }
+ };
+
+ pub fn onCaresComplete(this: *@This(), err_: ?c_ares.Error, timeout: i32, result: ?c_ares.struct_nameinfo) void {
+ if (this.resolver_for_caching) |resolver| {
+ if (this.cache.pending_cache) {
+ resolver.drainPendingNameInfoCares(
+ this.cache.pos_in_pending,
+ err_,
+ timeout,
+ result,
+ );
+ return;
+ }
+ }
+
+ var head = this.head;
+ bun.default_allocator.destroy(this);
+
+ head.processResolve(err_, timeout, result);
+ }
+};
+
pub const GetAddrInfoRequest = struct {
const log = Output.scoped(.GetAddrInfoRequest, false);
@@ -1086,7 +1251,7 @@ pub const CAresReverse = struct {
return;
}
var node = result.?;
- const array = node.toJSReponse(this.globalThis.allocator(), this.globalThis, "");
+ const array = node.toJSResponse(this.globalThis.allocator(), this.globalThis, "");
this.onComplete(array);
return;
}
@@ -1157,7 +1322,7 @@ pub fn CAresLookup(comptime cares_type: type, comptime type_name: []const u8) ty
return;
}
var node = result.?;
- const array = node.toJSReponse(this.globalThis.allocator(), this.globalThis, type_name);
+ const array = node.toJSResponse(this.globalThis.allocator(), this.globalThis, type_name);
this.onComplete(array);
return;
}
@@ -1325,6 +1490,7 @@ pub const DNSResolver = struct {
pending_ptr_cache_cares: PtrPendingCache = PtrPendingCache.init(),
pending_cname_cache_cares: CnamePendingCache = CnamePendingCache.init(),
pending_addr_cache_crares: AddrPendingCache = AddrPendingCache.init(),
+ pending_nameinfo_cache_cares: NameInfoPendingCache = NameInfoPendingCache.init(),
const PendingCache = bun.HiveArray(GetAddrInfoRequest.PendingCacheKey, 32);
const SrvPendingCache = bun.HiveArray(ResolveInfoRequest(c_ares.struct_ares_srv_reply, "srv").PendingCacheKey, 32);
@@ -1337,6 +1503,7 @@ pub const DNSResolver = struct {
const PtrPendingCache = bun.HiveArray(ResolveInfoRequest(c_ares.struct_hostent, "ptr").PendingCacheKey, 32);
const CnamePendingCache = bun.HiveArray(ResolveInfoRequest(c_ares.struct_hostent, "cname").PendingCacheKey, 32);
const AddrPendingCache = bun.HiveArray(GetHostByAddrInfoRequest.PendingCacheKey, 32);
+ const NameInfoPendingCache = bun.HiveArray(GetNameInfoRequest.PendingCacheKey, 32);
fn getKey(this: *DNSResolver, index: u8, comptime cache_name: []const u8, comptime request_type: type) request_type.PendingCacheKey {
var cache = &@field(this, cache_name);
@@ -1370,7 +1537,7 @@ pub const DNSResolver = struct {
var pending: ?*CAresLookup(cares_type, lookup_name) = key.lookup.head.next;
var prev_global = key.lookup.head.globalThis;
- var array = addr.toJSReponse(this.vm.allocator, prev_global, lookup_name);
+ var array = addr.toJSResponse(this.vm.allocator, prev_global, lookup_name);
defer addr.deinit();
array.ensureStillAlive();
key.lookup.head.onComplete(array);
@@ -1381,7 +1548,7 @@ pub const DNSResolver = struct {
while (pending) |value| {
var new_global = value.globalThis;
if (prev_global != new_global) {
- array = addr.toJSReponse(this.vm.allocator, new_global, lookup_name);
+ array = addr.toJSResponse(this.vm.allocator, new_global, lookup_name);
prev_global = new_global;
}
pending = value.next;
@@ -1500,7 +1667,48 @@ pub const DNSResolver = struct {
// The callback need not and should not attempt to free the memory
// pointed to by hostent; the ares library will free it when the
// callback returns.
- var array = addr.toJSReponse(this.vm.allocator, prev_global, "");
+ var array = addr.toJSResponse(this.vm.allocator, prev_global, "");
+ array.ensureStillAlive();
+ key.lookup.head.onComplete(array);
+ bun.default_allocator.destroy(key.lookup);
+
+ array.ensureStillAlive();
+
+ while (pending) |value| {
+ var new_global = value.globalThis;
+ if (prev_global != new_global) {
+ array = addr.toJSResponse(this.vm.allocator, new_global, "");
+ prev_global = new_global;
+ }
+ pending = value.next;
+
+ {
+ array.ensureStillAlive();
+ value.onComplete(array);
+ array.ensureStillAlive();
+ }
+ }
+ }
+
+ pub fn drainPendingNameInfoCares(this: *DNSResolver, index: u8, err: ?c_ares.Error, timeout: i32, result: ?c_ares.struct_nameinfo) void {
+ const key = this.getKey(index, "pending_nameinfo_cache_cares", GetNameInfoRequest);
+
+ var name_info = result orelse {
+ var pending: ?*CAresNameInfo = key.lookup.head.next;
+ key.lookup.head.processResolve(err, timeout, null);
+ bun.default_allocator.destroy(key.lookup);
+
+ while (pending) |value| {
+ pending = value.next;
+ value.processResolve(err, timeout, null);
+ }
+ return;
+ };
+
+ var pending: ?*CAresNameInfo = key.lookup.head.next;
+ var prev_global = key.lookup.head.globalThis;
+
+ var array = name_info.toJSResponse(this.vm.allocator, prev_global);
array.ensureStillAlive();
key.lookup.head.onComplete(array);
bun.default_allocator.destroy(key.lookup);
@@ -1510,7 +1718,7 @@ pub const DNSResolver = struct {
while (pending) |value| {
var new_global = value.globalThis;
if (prev_global != new_global) {
- array = addr.toJSReponse(this.vm.allocator, new_global, "");
+ array = name_info.toJSResponse(this.vm.allocator, new_global);
prev_global = new_global;
}
pending = value.next;
@@ -1977,11 +2185,6 @@ pub const DNSResolver = struct {
return .zero;
};
- if (name_str.length() == 0) {
- globalThis.throwInvalidArgumentType("resolveSoa", "hostname", "non-empty string");
- return .zero;
- }
-
const name = name_str.toSliceClone(globalThis, bun.default_allocator);
var vm = globalThis.bunVM();
@@ -2039,11 +2242,6 @@ pub const DNSResolver = struct {
return .zero;
};
- if (name_str.length() == 0) {
- globalThis.throwInvalidArgumentType("resolveNs", "hostname", "non-empty string");
- return .zero;
- }
-
const name = name_str.toSliceClone(globalThis, bun.default_allocator);
var vm = globalThis.bunVM();
@@ -2278,7 +2476,7 @@ pub const DNSResolver = struct {
return dns_lookup.promise.value();
}
- // var hints_buf = &[_]c_ares.AddrInfo_hints{query.toCAres()};
+ var hints_buf = &[_]c_ares.AddrInfo_hints{query.toCAres()};
var request = GetAddrInfoRequest.init(
cache,
.{
@@ -2294,7 +2492,7 @@ pub const DNSResolver = struct {
channel.getAddrInfo(
query.name,
query.port,
- &.{},
+ hints_buf,
GetAddrInfoRequest,
request,
GetAddrInfoRequest.onCaresComplete,
@@ -2386,6 +2584,95 @@ pub const DNSResolver = struct {
return values;
}
+ // Resolves the given address and port into a host name and service using the operating system's underlying getnameinfo implementation.
+ // If address is not a valid IP address, a TypeError will be thrown. The port will be coerced to a number.
+ // If it is not a legal port, a TypeError will be thrown.
+ pub fn lookupService(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(.C) JSC.JSValue {
+ const arguments = callframe.arguments(3);
+ if (arguments.len < 2) {
+ globalThis.throwNotEnoughArguments("lookupService", 3, arguments.len);
+ return .zero;
+ }
+
+ const addr_value = arguments.ptr[0];
+ const port_value = arguments.ptr[1];
+ if (addr_value.isEmptyOrUndefinedOrNull() or !addr_value.isString()) {
+ globalThis.throwInvalidArgumentType("lookupService", "address", "string");
+ return .zero;
+ }
+ const addr_str = addr_value.toStringOrNull(globalThis) orelse {
+ return .zero;
+ };
+ if (addr_str.length() == 0) {
+ globalThis.throwInvalidArgumentType("lookupService", "address", "non-empty string");
+ return .zero;
+ }
+
+ const addr_s = addr_str.getZigString(globalThis).slice();
+ const port: u16 = if (port_value.isNumber()) blk: {
+ break :blk port_value.to(u16);
+ } else {
+ globalThis.throwInvalidArgumentType("lookupService", "port", "invalid port");
+ return .zero;
+ };
+
+ var sa: std.os.sockaddr.storage = std.mem.zeroes(std.os.sockaddr.storage);
+ if (c_ares.getSockaddr(addr_s, port, @as(*std.os.sockaddr, @ptrCast(&sa))) != 0) {
+ globalThis.throwInvalidArgumentType("lookupService", "address", "invalid address");
+ return .zero;
+ }
+
+ var vm = globalThis.bunVM();
+ var resolver = vm.rareData().globalDNSResolver(vm);
+ var channel: *c_ares.Channel = switch (resolver.getChannel()) {
+ .result => |res| res,
+ .err => |err| {
+ const system_error = JSC.SystemError{
+ .errno = -1,
+ .code = bun.String.static(err.code()),
+ .message = bun.String.static(err.label()),
+ };
+
+ globalThis.throwValue(system_error.toErrorInstance(globalThis));
+ return .zero;
+ },
+ };
+
+ // This string will be freed in `CAresNameInfo.deinit`
+ const cache_name = std.fmt.allocPrint(bun.default_allocator, "{s}|{d}", .{ addr_s, port }) catch unreachable;
+
+ const key = GetNameInfoRequest.PendingCacheKey.init(cache_name);
+ var cache = resolver.getOrPutIntoResolvePendingCache(
+ GetNameInfoRequest,
+ key,
+ "pending_nameinfo_cache_cares",
+ );
+
+ if (cache == .inflight) {
+ var info = CAresNameInfo.init(globalThis, globalThis.allocator(), cache_name) catch unreachable;
+ cache.inflight.append(info);
+ return info.promise.value();
+ }
+
+ var request = GetNameInfoRequest.init(
+ cache,
+ resolver,
+ cache_name, // transfer ownership here
+ globalThis,
+ "pending_nameinfo_cache_cares",
+ ) catch unreachable;
+
+ const promise = request.tail.promise.value();
+ channel.getNameInfo(
+ @as(*std.os.sockaddr, @ptrCast(&sa)),
+ GetNameInfoRequest,
+ request,
+ GetNameInfoRequest.onCaresComplete,
+ );
+
+ return promise;
+ }
+
comptime {
@export(
resolve,
@@ -2465,11 +2752,13 @@ pub const DNSResolver = struct {
.name = "Bun__DNSResolver__reverse",
},
);
+ @export(
+ lookupService,
+ .{
+ .name = "Bun__DNSResolver__lookupService",
+ },
+ );
}
- // pub fn lookupService(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(.C) JSC.JSValue {
- // const arguments = callframe.arguments(3);
-
- // }
// pub fn cancel(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(.C) JSC.JSValue {
// const arguments = callframe.arguments(3);
diff --git a/src/bun.js/api/bun/socket.zig b/src/bun.js/api/bun/socket.zig
index 2ad44ffb0..e89ee5aa1 100644
--- a/src/bun.js/api/bun/socket.zig
+++ b/src/bun.js/api/bun/socket.zig
@@ -771,7 +771,7 @@ pub const Listener = struct {
Socket.dataSetCached(this_socket.getThisValue(globalObject), globalObject, default_data);
}
socket.ext(**anyopaque).?.* = bun.cast(**anyopaque, this_socket);
- socket.timeout(120000);
+ socket.setTimeout(120000);
}
// pub fn addServerName(this: *Listener, _: *JSC.JSGlobalObject, _: *JSC.CallFrame) callconv(.C) JSValue {
@@ -996,7 +996,12 @@ pub const Listener = struct {
handlers.vm.allocator.destroy(handlers_ptr);
handlers.promise.deinit();
bun.default_allocator.destroy(tls);
- exception.* = ZigString.static("Failed to connect").toErrorInstance(globalObject).asObjectRef();
+ const err = JSC.SystemError{
+ .message = bun.String.static("Failed to connect"),
+ .syscall = bun.String.static("connect"),
+ .code = if (port == null) bun.String.static("ENOENT") else bun.String.static("ECONNREFUSED"),
+ };
+ exception.* = err.toErrorInstance(globalObject).asObjectRef();
return .zero;
};
tls.poll_ref.ref(handlers.vm);
@@ -1022,7 +1027,12 @@ pub const Listener = struct {
handlers.vm.allocator.destroy(handlers_ptr);
handlers.promise.deinit();
bun.default_allocator.destroy(tcp);
- exception.* = ZigString.static("Failed to connect").toErrorInstance(globalObject).asObjectRef();
+ const err = JSC.SystemError{
+ .message = bun.String.static("Failed to connect"),
+ .syscall = bun.String.static("connect"),
+ .code = if (port == null) bun.String.static("ENOENT") else bun.String.static("ECONNREFUSED"),
+ };
+ exception.* = err.toErrorInstance(globalObject).asObjectRef();
return .zero;
};
tcp.poll_ref.ref(handlers.vm);
@@ -1205,6 +1215,12 @@ fn NewSocket(comptime ssl: bool) type {
.errno = errno,
.message = bun.String.static("Failed to connect"),
.syscall = bun.String.static("connect"),
+
+ // For some reason errno is 0 which causes this to be success.
+ // Unix socket case wont hit this callback because it instantly errors.
+ .code = bun.String.static("ECONNREFUSED"),
+ // .code = bun.String.static(@tagName(bun.sys.getErrno(errno))),
+ // .code = bun.String.static(@tagName(@as(bun.C.E, @enumFromInt(errno)))),
};
if (callback == .zero) {
@@ -1583,7 +1599,7 @@ fn NewSocket(comptime ssl: bool) type {
return .zero;
}
- this.socket.timeout(@as(c_uint, @intCast(t)));
+ this.socket.setTimeout(@as(c_uint, @intCast(t)));
return JSValue.jsUndefined();
}
@@ -1913,7 +1929,7 @@ fn NewSocket(comptime ssl: bool) type {
}
pub fn finalize(this: *This) callconv(.C) void {
- log("finalize()", .{});
+ log("finalize() {d}", .{@intFromPtr(this)});
if (!this.detached) {
this.detached = true;
if (!this.socket.isClosed()) {
@@ -2946,6 +2962,17 @@ pub fn NewWrappedHandler(comptime tls: bool) type {
}
}
+ pub fn onLongTimeout(
+ this: WrappedSocket,
+ socket: Socket,
+ ) void {
+ if (comptime tls) {
+ TLSSocket.onTimeout(this.tls, socket);
+ } else {
+ TLSSocket.onTimeout(this.tcp, socket);
+ }
+ }
+
pub fn onConnectError(
this: WrappedSocket,
socket: Socket,
diff --git a/src/bun.js/api/bun/subprocess.zig b/src/bun.js/api/bun/subprocess.zig
index 5695c15ad..f6d86d91a 100644
--- a/src/bun.js/api/bun/subprocess.zig
+++ b/src/bun.js/api/bun/subprocess.zig
@@ -62,12 +62,11 @@ pub const Subprocess = struct {
is_sync: bool = false,
this_jsvalue: JSC.JSValue = .zero,
- ipc: IPCMode,
- // this is only ever accessed when `ipc` is not `none`
- ipc_socket: IPC.Socket = undefined,
+ ipc_mode: IPCMode,
ipc_callback: JSC.Strong = .{},
- ipc_buffer: bun.ByteList,
+ ipc: IPC.IPCData,
+ has_pending_unref: bool = false,
pub const SignalCode = bun.SignalCode;
pub const IPCMode = enum {
@@ -82,7 +81,7 @@ pub const Subprocess = struct {
pub fn updateHasPendingActivityFlag(this: *Subprocess) void {
@fence(.SeqCst);
- this.has_pending_activity.store(this.waitpid_err == null and this.exit_code == null and this.ipc == .none, .SeqCst);
+ this.has_pending_activity.store(this.waitpid_err == null and this.exit_code == null and this.ipc_mode == .none and this.has_pending_unref, .SeqCst);
}
pub fn hasPendingActivity(this: *Subprocess) callconv(.C) bool {
@@ -92,7 +91,7 @@ pub const Subprocess = struct {
pub fn updateHasPendingActivity(this: *Subprocess) void {
@fence(.Release);
- this.has_pending_activity.store(this.waitpid_err == null and this.exit_code == null and this.ipc == .none, .Release);
+ this.has_pending_activity.store(this.waitpid_err == null and this.exit_code == null and this.ipc_mode == .none and this.has_pending_unref, .Release);
}
pub fn ref(this: *Subprocess) void {
@@ -111,8 +110,10 @@ pub const Subprocess = struct {
}
}
+ /// This disables the keeping process alive flag on the poll and also in the stdin, stdout, and stderr
pub fn unref(this: *Subprocess) void {
var vm = this.globalThis.bunVM();
+
if (this.poll_ref) |poll| poll.disableKeepingProcessAlive(vm);
if (!this.hasCalledGetter(.stdin)) {
this.stdin.unref();
@@ -425,7 +426,7 @@ pub const Subprocess = struct {
}
pub fn doSend(this: *Subprocess, global: *JSC.JSGlobalObject, callFrame: *JSC.CallFrame) callconv(.C) JSValue {
- if (this.ipc == .none) {
+ if (this.ipc_mode == .none) {
global.throw("Subprocess.send() can only be used if an IPC channel is open.", .{});
return .zero;
}
@@ -437,20 +438,16 @@ pub const Subprocess = struct {
const value = callFrame.argument(0);
- const success = IPC.serializeJSValueForSubprocess(
- global,
- value,
- this.ipc_socket.fd(),
- );
+ const success = this.ipc.serializeAndSend(global, value);
if (!success) return .zero;
return JSC.JSValue.jsUndefined();
}
pub fn disconnect(this: *Subprocess) void {
- if (this.ipc == .none) return;
- this.ipc_socket.close(0, null);
- this.ipc = .none;
+ if (this.ipc_mode == .none) return;
+ this.ipc.socket.close(0, null);
+ this.ipc_mode = .none;
}
pub fn getPid(
@@ -1538,15 +1535,15 @@ pub const Subprocess = struct {
.stderr = Readable.init(stdio[bun.STDERR_FD], stderr_pipe[0], jsc_vm.allocator, default_max_buffer_size),
.on_exit_callback = if (on_exit_callback != .zero) JSC.Strong.create(on_exit_callback, globalThis) else .{},
.is_sync = is_sync,
- .ipc = ipc_mode,
+ .ipc_mode = ipc_mode,
// will be assigned in the block below
- .ipc_socket = socket,
- .ipc_buffer = bun.ByteList{},
+ .ipc = .{ .socket = socket },
.ipc_callback = if (ipc_callback != .zero) JSC.Strong.create(ipc_callback, globalThis) else undefined,
};
if (ipc_mode != .none) {
var ptr = socket.ext(*Subprocess);
ptr.?.* = subprocess;
+ subprocess.ipc.writeVersionPacket();
}
if (subprocess.stdin == .pipe) {
@@ -1805,8 +1802,29 @@ pub const Subprocess = struct {
}
}
- if (this.hasExited())
- this.unref();
+ if (this.hasExited()) {
+ const Holder = struct {
+ process: *Subprocess,
+ task: JSC.AnyTask,
+
+ pub fn unref(self: *@This()) void {
+ // this calls disableKeepingProcessAlive on pool_ref and stdin, stdout, stderr
+ self.process.unref();
+ self.process.has_pending_unref = false;
+ self.process.updateHasPendingActivity();
+ bun.default_allocator.destroy(self);
+ }
+ };
+
+ var holder = bun.default_allocator.create(Holder) catch @panic("OOM");
+ this.has_pending_unref = true;
+ holder.* = .{
+ .process = this,
+ .task = JSC.AnyTask.New(Holder, Holder.unref).init(holder),
+ };
+
+ this.globalThis.bunVM().enqueueTask(JSC.Task.init(&holder.task));
+ }
}
const os = std.os;
@@ -2036,7 +2054,7 @@ pub const Subprocess = struct {
const result = cb.callWithThis(
this.globalThis,
this.this_jsvalue,
- &[_]JSValue{data},
+ &[_]JSValue{ data, this.this_jsvalue },
);
data.ensureStillAlive();
if (result.isAnyError()) {
@@ -2049,7 +2067,7 @@ pub const Subprocess = struct {
pub fn handleIPCClose(this: *Subprocess, _: IPC.Socket) void {
// uSocket is already freed so calling .close() on the socket can segfault
- this.ipc = .none;
+ this.ipc_mode = .none;
this.updateHasPendingActivity();
}
diff --git a/src/bun.js/api/bun/x509.zig b/src/bun.js/api/bun/x509.zig
index 9c902b39c..a94d47c45 100644
--- a/src/bun.js/api/bun/x509.zig
+++ b/src/bun.js/api/bun/x509.zig
@@ -273,7 +273,8 @@ fn x509PrintGeneralName(out: *BoringSSL.BIO, name: *BoringSSL.GENERAL_NAME) bool
// instead always print its numeric representation.
var oline: [256]u8 = undefined;
_ = BoringSSL.OBJ_obj2txt(&oline, @sizeOf(@TypeOf(oline)), name.d.rid, 1);
- _ = BoringSSL.BIO_printf(out, "Registered ID:%s", &oline);
+ // Workaround for https://github.com/ziglang/zig/issues/16197
+ _ = BoringSSL.BIO_printf(out, "Registered ID:%s", @as([*]const u8, &oline));
} else if (name.name_type == .GEN_X400) {
_ = BoringSSL.BIO_printf(out, "X400Name:<unsupported>");
} else if (name.name_type == .GEN_EDIPARTY) {
@@ -301,7 +302,8 @@ fn x509InfoAccessPrint(out: *BoringSSL.BIO, ext: *BoringSSL.X509_EXTENSION) bool
}
var tmp: [80]u8 = undefined;
_ = BoringSSL.i2t_ASN1_OBJECT(&tmp, @sizeOf(@TypeOf(tmp)), desc.method);
- _ = BoringSSL.BIO_printf(out, "%s - ", &tmp);
+ // Workaround for https://github.com/ziglang/zig/issues/16197
+ _ = BoringSSL.BIO_printf(out, "%s - ", @as([*]const u8, &tmp));
if (!x509PrintGeneralName(out, desc.location)) {
return false;
diff --git a/src/bun.js/api/ffi.zig b/src/bun.js/api/ffi.zig
index 097b66d35..a7a03e784 100644
--- a/src/bun.js/api/ffi.zig
+++ b/src/bun.js/api/ffi.zig
@@ -318,7 +318,11 @@ pub const FFI = struct {
};
};
- var obj = JSC.JSValue.createEmptyObject(global, symbols.values().len);
+ var size = symbols.values().len;
+ if (size >= 63) {
+ size = 0;
+ }
+ var obj = JSC.JSValue.createEmptyObject(global, size);
obj.protect();
defer obj.unprotect();
for (symbols.values()) |*function| {
diff --git a/src/bun.js/api/html_rewriter.zig b/src/bun.js/api/html_rewriter.zig
index 1bda47512..1f2366ad9 100644
--- a/src/bun.js/api/html_rewriter.zig
+++ b/src/bun.js/api/html_rewriter.zig
@@ -384,10 +384,10 @@ pub const HTMLRewriter = struct {
result.* = Response{
.allocator = bun.default_allocator,
+ .init = .{
+ .status_code = 200,
+ },
.body = .{
- .init = .{
- .status_code = 200,
- },
.value = .{
.Locked = .{
.global = global,
@@ -397,16 +397,16 @@ pub const HTMLRewriter = struct {
},
};
- result.body.init.method = original.body.init.method;
- result.body.init.status_code = original.body.init.status_code;
+ result.init.method = original.init.method;
+ result.init.status_code = original.init.status_code;
+ result.init.status_text = original.init.status_text.clone();
// https://github.com/oven-sh/bun/issues/3334
- if (original.body.init.headers) |headers| {
- result.body.init.headers = headers.cloneThis(global);
+ if (original.init.headers) |headers| {
+ result.init.headers = headers.cloneThis(global);
}
result.url = original.url.clone();
- result.status_text = original.status_text.clone();
var value = original.getBodyValue();
sink.bodyValueBufferer = JSC.WebCore.BodyValueBufferer.init(sink, onFinishedBuffering, sink.global, bun.default_allocator);
sink.bodyValueBufferer.?.run(value) catch |buffering_error| {
@@ -606,10 +606,10 @@ pub const HTMLRewriter = struct {
// result.* = Response{
// .allocator = bun.default_allocator,
+ // .init = .{
+ // .status_code = 200,
+ // },
// .body = .{
- // .init = .{
- // .status_code = 200,
- // },
// .value = .{
// .Locked = .{
// .global = global,
@@ -619,9 +619,9 @@ pub const HTMLRewriter = struct {
// },
// };
- // result.body.init.headers = original.body.init.headers;
- // result.body.init.method = original.body.init.method;
- // result.body.init.status_code = original.body.init.status_code;
+ // result.init.headers = original.init.headers;
+ // result.init.method = original.init.method;
+ // result.init.status_code = original.init.status_code;
// result.url = bun.default_allocator.dupe(u8, original.url) catch unreachable;
// result.status_text = bun.default_allocator.dupe(u8, original.status_text) catch unreachable;
diff --git a/src/bun.js/api/server.classes.ts b/src/bun.js/api/server.classes.ts
index 544f37ce6..81ec30988 100644
--- a/src/bun.js/api/server.classes.ts
+++ b/src/bun.js/api/server.classes.ts
@@ -24,6 +24,10 @@ function generate(name) {
fn: "doStop",
length: 1,
},
+ requestIP: {
+ fn: "doRequestIP",
+ length: 1,
+ },
port: {
getter: "getPort",
},
@@ -41,6 +45,10 @@ function generate(name) {
getter: "getHostname",
cache: true,
},
+ address: {
+ getter: "getAddress",
+ cache: true,
+ },
protocol: {
getter: "getProtocol",
},
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig
index 85d4dadb5..edf1d6d69 100644
--- a/src/bun.js/api/server.zig
+++ b/src/bun.js/api/server.zig
@@ -1125,6 +1125,92 @@ fn NewFlags(comptime debug_mode: bool) type {
};
}
+/// A generic wrapper for the HTTP(s) Server`RequestContext`s.
+/// Only really exists because of `NewServer()` and `NewRequestContext()` generics.
+pub const AnyRequestContext = struct {
+ pub const Pointer = bun.TaggedPointerUnion(.{
+ HTTPServer.RequestContext,
+ HTTPSServer.RequestContext,
+ DebugHTTPServer.RequestContext,
+ DebugHTTPSServer.RequestContext,
+ });
+
+ tagged_pointer: Pointer,
+
+ pub const Null = .{ .tagged_pointer = Pointer.Null };
+
+ pub fn init(request_ctx: anytype) AnyRequestContext {
+ return .{ .tagged_pointer = Pointer.init(request_ctx) };
+ }
+
+ pub fn getRemoteSocketInfo(self: AnyRequestContext) ?uws.SocketAddress {
+ if (self.tagged_pointer.isNull()) {
+ return null;
+ }
+
+ switch (self.tagged_pointer.tag()) {
+ @field(Pointer.Tag, bun.meta.typeBaseName(@typeName(HTTPServer.RequestContext))) => {
+ return self.tagged_pointer.as(HTTPServer.RequestContext).getRemoteSocketInfo();
+ },
+ @field(Pointer.Tag, bun.meta.typeBaseName(@typeName(HTTPSServer.RequestContext))) => {
+ return self.tagged_pointer.as(HTTPSServer.RequestContext).getRemoteSocketInfo();
+ },
+ @field(Pointer.Tag, bun.meta.typeBaseName(@typeName(DebugHTTPServer.RequestContext))) => {
+ return self.tagged_pointer.as(DebugHTTPServer.RequestContext).getRemoteSocketInfo();
+ },
+ @field(Pointer.Tag, bun.meta.typeBaseName(@typeName(DebugHTTPSServer.RequestContext))) => {
+ return self.tagged_pointer.as(DebugHTTPSServer.RequestContext).getRemoteSocketInfo();
+ },
+ else => @panic("Unexpected AnyRequestContext tag"),
+ }
+ }
+
+ /// Wont actually set anything if `self` is `.none`
+ pub fn setRequest(self: AnyRequestContext, req: *uws.Request) void {
+ if (self.tagged_pointer.isNull()) {
+ return;
+ }
+
+ switch (self.tagged_pointer.tag()) {
+ @field(Pointer.Tag, bun.meta.typeBaseName(@typeName(HTTPServer.RequestContext))) => {
+ self.tagged_pointer.as(HTTPServer.RequestContext).req = req;
+ },
+ @field(Pointer.Tag, bun.meta.typeBaseName(@typeName(HTTPSServer.RequestContext))) => {
+ self.tagged_pointer.as(HTTPSServer.RequestContext).req = req;
+ },
+ @field(Pointer.Tag, bun.meta.typeBaseName(@typeName(DebugHTTPServer.RequestContext))) => {
+ self.tagged_pointer.as(DebugHTTPServer.RequestContext).req = req;
+ },
+ @field(Pointer.Tag, bun.meta.typeBaseName(@typeName(DebugHTTPSServer.RequestContext))) => {
+ self.tagged_pointer.as(DebugHTTPSServer.RequestContext).req = req;
+ },
+ else => @panic("Unexpected AnyRequestContext tag"),
+ }
+ }
+
+ pub fn getRequest(self: AnyRequestContext) ?*uws.Request {
+ if (self.tagged_pointer.isNull()) {
+ return null;
+ }
+
+ switch (self.tagged_pointer.tag()) {
+ @field(Pointer.Tag, bun.meta.typeBaseName(@typeName(HTTPServer.RequestContext))) => {
+ return self.tagged_pointer.as(HTTPServer.RequestContext).req;
+ },
+ @field(Pointer.Tag, bun.meta.typeBaseName(@typeName(HTTPSServer.RequestContext))) => {
+ return self.tagged_pointer.as(HTTPSServer.RequestContext).req;
+ },
+ @field(Pointer.Tag, bun.meta.typeBaseName(@typeName(DebugHTTPServer.RequestContext))) => {
+ return self.tagged_pointer.as(DebugHTTPServer.RequestContext).req;
+ },
+ @field(Pointer.Tag, bun.meta.typeBaseName(@typeName(DebugHTTPSServer.RequestContext))) => {
+ return self.tagged_pointer.as(DebugHTTPSServer.RequestContext).req;
+ },
+ else => @panic("Unexpected AnyRequestContext tag"),
+ }
+ }
+};
+
// This is defined separately partially to work-around an LLVM debugger bug.
fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comptime ThisServer: type) type {
return struct {
@@ -1443,6 +1529,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
}
pub fn endStream(this: *RequestContext, closeConnection: bool) void {
+ ctxLog("endStream", .{});
if (this.resp) |resp| {
if (this.flags.is_waiting_for_request_body) {
this.flags.is_waiting_for_request_body = false;
@@ -1537,8 +1624,17 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
pub fn onAbort(this: *RequestContext, resp: *App.Response) void {
std.debug.assert(this.resp == resp);
std.debug.assert(!this.flags.aborted);
- //mark request as aborted
+ // mark request as aborted
this.flags.aborted = true;
+ var any_js_calls = false;
+ var vm = this.server.vm;
+ defer {
+ // This is a task in the event loop.
+ // If we called into JavaScript, we must drain the microtask queue
+ if (any_js_calls) {
+ vm.drainMicrotasks();
+ }
+ }
// if signal is not aborted, abort the signal
if (this.signal) |signal| {
@@ -1547,6 +1643,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
const reason = JSC.WebCore.AbortSignal.createAbortError(JSC.ZigString.static("The user aborted a request"), &JSC.ZigString.Empty, this.server.globalThis);
reason.ensureStillAlive();
_ = signal.signal(reason);
+ any_js_calls = true;
}
_ = signal.unref();
}
@@ -1578,6 +1675,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
} else if (body.value.Locked.readable != null) {
body.value.Locked.readable.?.abort(this.server.globalThis);
body.value.Locked.readable = null;
+ any_js_calls = true;
}
body.value.toErrorInstance(JSC.toTypeError(.ABORT_ERR, "Request aborted", .{}, this.server.globalThis), this.server.globalThis);
}
@@ -1588,6 +1686,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
if (response.body.value.Locked.readable) |*readable| {
response.body.value.Locked.readable = null;
readable.abort(this.server.globalThis);
+ any_js_calls = true;
}
}
}
@@ -1597,10 +1696,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
this.pending_promises_for_abort += 1;
this.promise = null;
promise.asAnyPromise().?.reject(this.server.globalThis, JSC.toTypeError(.ABORT_ERR, "Request aborted", .{}, this.server.globalThis));
- }
-
- if (this.pending_promises_for_abort > 0) {
- this.server.vm.tick();
+ any_js_calls = true;
}
}
}
@@ -1720,6 +1816,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
this: *RequestContext,
headers: *JSC.FetchHeaders,
) void {
+ ctxLog("writeHeaders", .{});
headers.fastRemove(.ContentLength);
headers.fastRemove(.TransferEncoding);
if (!ssl_enabled) headers.fastRemove(.StrictTransportSecurity);
@@ -2091,6 +2188,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
}
fn doRenderStream(pair: *StreamPair) void {
+ ctxLog("doRenderStream", .{});
var this = pair.this;
var stream = pair.stream;
if (this.resp == null or this.flags.aborted) {
@@ -2214,6 +2312,14 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
},
}
return;
+ } else {
+ // if is not a promise we treat it as Error
+ streamLog("returned an error", .{});
+ if (!this.flags.aborted) resp.clearAborted();
+ response_stream.detach();
+ this.sink = null;
+ response_stream.sink.destroy();
+ return this.handleReject(assignment_result);
}
}
@@ -2223,6 +2329,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
defer stream.value.unprotect();
response_stream.sink.markDone();
this.finalizeForAbort();
+ response_stream.sink.onFirstWrite = null;
response_stream.sink.finalize();
return;
@@ -2246,7 +2353,12 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
this.setAbortHandler();
streamLog("is in progress, but did not return a Promise. Finalizing request context", .{});
- this.finalize();
+ response_stream.sink.onFirstWrite = null;
+ response_stream.sink.ctx = null;
+ response_stream.detach();
+ stream.cancel(globalThis);
+ response_stream.sink.markDone();
+ this.renderMissing();
}
const streamLog = Output.scoped(.ReadableStream, false);
@@ -2256,7 +2368,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
}
fn toAsyncWithoutAbortHandler(ctx: *RequestContext, req: *uws.Request, request_object: *Request) void {
- request_object.uws_request = req;
+ request_object.request_context.setRequest(req);
request_object.ensureURL() catch {
request_object.url = bun.String.empty;
@@ -2269,7 +2381,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
// This object dies after the stack frame is popped
// so we have to clear it in here too
- request_object.uws_request = null;
+ request_object.request_context = JSC.API.AnyRequestContext.Null;
}
fn toAsync(
@@ -2446,7 +2558,6 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
}
streamLog("onResolve({any})", .{wrote_anything});
-
//aborted so call finalizeForAbort
if (req.flags.aborted or req.resp == null) {
req.finalizeForAbort();
@@ -2723,7 +2834,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
}
pub fn doRender(this: *RequestContext) void {
- ctxLog("render", .{});
+ ctxLog("doRender", .{});
if (this.flags.aborted) {
this.finalizeForAbort();
@@ -2877,7 +2988,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
var needs_content_type = true;
const content_type: MimeType = brk: {
- if (response.body.init.headers) |headers_| {
+ if (response.init.headers) |headers_| {
if (headers_.fastGet(.ContentType)) |content| {
needs_content_type = false;
break :brk MimeType.byName(content.slice());
@@ -2897,7 +3008,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
};
var has_content_disposition = false;
- if (response.body.init.headers) |headers_| {
+ if (response.init.headers) |headers_| {
has_content_disposition = headers_.fastHas(.ContentDisposition);
needs_content_range = needs_content_range and headers_.fastHas(.ContentRange);
if (needs_content_range) {
@@ -2907,7 +3018,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
this.writeStatus(status);
this.writeHeaders(headers_);
- response.body.init.headers = null;
+ response.init.headers = null;
headers_.deref();
} else if (needs_content_range) {
status = 206;
@@ -3039,7 +3150,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
if (last) {
var bytes = this.request_body_buf;
- defer this.request_body_buf = .{};
+
var old = body.value;
const total = bytes.items.len + chunk.len;
@@ -3070,6 +3181,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
};
// }
}
+ this.request_body_buf = .{};
if (old == .Locked) {
var vm = this.server.vm;
@@ -3142,6 +3254,10 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
return onStartStreamingRequestBody(bun.cast(*RequestContext, this));
}
+ pub fn getRemoteSocketInfo(this: *RequestContext) ?uws.SocketAddress {
+ return (this.resp orelse return null).getRemoteSocketInfo();
+ }
+
pub const Export = shim.exportFunctions(.{
.onResolve = onResolve,
.onReject = onReject,
@@ -4667,17 +4783,6 @@ pub const ServerWebSocket = struct {
return JSValue.jsBoolean(this.websocket.isSubscribed(topic.slice()));
}
- // pub fn getTopics(
- // this: *ServerWebSocket,
- // globalThis: *JSC.JSGlobalObject,
- // ) callconv(.C) JSValue {
- // if (this.closed) {
- // return JSValue.createStringArray(globalThis, bun.default_allocator, null, 0, false);
- // }
-
- // this
- // }
-
pub fn getRemoteAddress(
this: *ServerWebSocket,
globalThis: *JSC.JSGlobalObject,
@@ -4704,7 +4809,7 @@ pub const ServerWebSocket = struct {
pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comptime debug_mode_: bool) type {
return struct {
pub const ssl_enabled = ssl_enabled_;
- const debug_mode = debug_mode_;
+ pub const debug_mode = debug_mode_;
const ThisServer = @This();
pub const RequestContext = NewRequestContext(ssl_enabled, debug_mode, @This());
@@ -4742,6 +4847,7 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp
pub const doPublish = JSC.wrapInstanceMethod(ThisServer, "publish", false);
pub const doReload = onReload;
pub const doFetch = onFetch;
+ pub const doRequestIP = JSC.wrapInstanceMethod(ThisServer, "requestIP", false);
pub usingnamespace NamespaceType;
@@ -4749,6 +4855,24 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp
globalThis.throw("Server() is not a constructor", .{});
return null;
}
+
+ extern fn JSSocketAddress__create(global: *JSC.JSGlobalObject, ip: JSValue, port: i32, is_ipv6: bool) JSValue;
+
+ pub fn requestIP(this: *ThisServer, request: *JSC.WebCore.Request) JSC.JSValue {
+ if (this.config.address == .unix) {
+ return JSValue.jsNull();
+ }
+ return if (request.request_context.getRemoteSocketInfo()) |info|
+ JSSocketAddress__create(
+ this.globalThis,
+ bun.String.static(info.ip).toJSConst(this.globalThis),
+ info.port,
+ info.is_ipv6,
+ )
+ else
+ JSValue.jsNull();
+ }
+
pub fn publish(this: *ThisServer, globalThis: *JSC.JSGlobalObject, topic: ZigString, message_value: JSValue, compress_value: ?JSValue, exception: JSC.C.ExceptionRef) JSValue {
if (this.config.websocket == null)
return JSValue.jsNumber(0);
@@ -5092,7 +5216,7 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp
return JSPromise.rejectedPromiseValue(ctx, err);
}
- var request = ctx.bunVM().allocator.create(Request) catch unreachable;
+ var request = bun.default_allocator.create(Request) catch unreachable;
request.* = existing_request;
const response_value = this.config.onRequest.callWithThis(
@@ -5173,6 +5297,37 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp
return JSC.JSValue.jsNumber(@as(i32, @intCast(@as(u31, @truncate(this.activeSocketsCount())))));
}
+ pub fn getAddress(this: *ThisServer, globalThis: *JSGlobalObject) callconv(.C) JSC.JSValue {
+ switch (this.config.address) {
+ .unix => |unix| {
+ var value = bun.String.create(bun.sliceTo(@constCast(unix), 0));
+ defer value.deref();
+ return value.toJS(globalThis);
+ },
+ .tcp => {
+ var port: u16 = this.config.address.tcp.port;
+
+ if (this.listener) |listener| {
+ port = @intCast(listener.getLocalPort());
+
+ var buf: [64]u8 = [_]u8{0} ** 64;
+ var is_ipv6: bool = false;
+
+ if (listener.socket().localAddressText(&buf, &is_ipv6)) |slice| {
+ var ip = bun.String.create(slice);
+ return JSSocketAddress__create(
+ this.globalThis,
+ ip.toJS(this.globalThis),
+ port,
+ is_ipv6,
+ );
+ }
+ }
+ return JSValue.jsNull();
+ },
+ }
+ }
+
pub fn getHostname(this: *ThisServer, globalThis: *JSGlobalObject) callconv(.C) JSC.JSValue {
if (this.cached_hostname.isEmpty()) {
if (this.listener) |listener| {
@@ -5254,6 +5409,10 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp
var listener = this.listener orelse return;
this.listener = null;
this.unref();
+
+ if (!ssl_enabled_)
+ this.vm.removeListeningSocketForWatchMode(@intCast(listener.socket().fd()));
+
if (!abrupt) {
listener.close();
} else if (!this.flags.terminated) {
@@ -5388,24 +5547,18 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp
if (error_instance == .zero) {
switch (this.config.address) {
.tcp => |tcp| {
- error_instance = ZigString.init(
- std.fmt.bufPrint(&output_buf, "Failed to start server. Is port {d} in use?", .{tcp.port}) catch "Failed to start server",
- ).toErrorInstance(
- this.globalThis,
- );
+ error_instance = (JSC.SystemError{
+ .message = bun.String.init(std.fmt.bufPrint(&output_buf, "Failed to start server. Is port {d} in use?", .{tcp.port}) catch "Failed to start server"),
+ .code = bun.String.static("EADDRINUSE"),
+ .syscall = bun.String.static("listen"),
+ }).toErrorInstance(this.globalThis);
},
.unix => |unix| {
- error_instance = ZigString.init(
- std.fmt.bufPrint(
- &output_buf,
- "Failed to listen on unix socket {}",
- .{
- strings.QuotedFormatter{ .text = bun.sliceTo(unix, 0) },
- },
- ) catch "Failed to start server",
- ).toErrorInstance(
- this.globalThis,
- );
+ error_instance = (JSC.SystemError{
+ .message = bun.String.init(std.fmt.bufPrint(&output_buf, "Failed to listen on unix socket {}", .{strings.QuotedFormatter{ .text = bun.sliceTo(unix, 0) }}) catch "Failed to start server"),
+ .code = bun.String.static("EADDRINUSE"),
+ .syscall = bun.String.static("listen"),
+ }).toErrorInstance(this.globalThis);
},
}
}
@@ -5428,6 +5581,8 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp
this.listener = socket;
this.vm.event_loop_handle = uws.Loop.get();
+ if (!ssl_enabled_)
+ this.vm.addListeningSocketForWatchMode(@intCast(socket.?.socket().fd()));
}
pub fn ref(this: *ThisServer) void {
@@ -5512,21 +5667,19 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp
req.setYield(false);
var ctx = this.request_pool_allocator.tryGet() catch @panic("ran out of memory");
ctx.create(this, req, resp);
+ this.vm.jsc.reportExtraMemory(@sizeOf(RequestContext));
var request_object = this.allocator.create(JSC.WebCore.Request) catch unreachable;
var body = JSC.WebCore.InitRequestBodyValue(.{ .Null = {} }) catch unreachable;
ctx.request_body = body;
- const js_signal = JSC.WebCore.AbortSignal.create(this.globalThis);
- js_signal.ensureStillAlive();
- if (JSC.WebCore.AbortSignal.fromJS(js_signal)) |signal| {
- ctx.signal = signal.ref().ref(); // +2 refs 1 for the request and 1 for the request context
- }
+ var signal = JSC.WebCore.AbortSignal.new(this.globalThis);
+ ctx.signal = signal;
request_object.* = .{
.method = ctx.method,
- .uws_request = req,
+ .request_context = AnyRequestContext.init(ctx),
.https = ssl_enabled,
- .signal = ctx.signal,
+ .signal = signal.ref(),
.body = body.ref(),
};
@@ -5593,7 +5746,7 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp
const response_value = this.config.onRequest.callWithThis(this.globalThis, this.thisObject, &args);
defer {
// uWS request will not live longer than this function
- request_object.uws_request = null;
+ request_object.request_context = JSC.API.AnyRequestContext.Null;
}
var should_deinit_context = false;
@@ -5608,7 +5761,7 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp
ctx.defer_deinit_until_callback_completes = null;
if (should_deinit_context) {
- request_object.uws_request = null;
+ request_object.request_context = JSC.API.AnyRequestContext.Null;
ctx.deinit();
return;
}
@@ -5637,18 +5790,15 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp
var body = JSC.WebCore.InitRequestBodyValue(.{ .Null = {} }) catch unreachable;
ctx.request_body = body;
- const js_signal = JSC.WebCore.AbortSignal.create(this.globalThis);
- js_signal.ensureStillAlive();
- if (JSC.WebCore.AbortSignal.fromJS(js_signal)) |signal| {
- ctx.signal = signal.ref().ref(); // +2 refs 1 for the request and 1 for the request context
- }
+ var signal = JSC.WebCore.AbortSignal.new(this.globalThis);
+ ctx.signal = signal;
request_object.* = .{
.method = ctx.method,
- .uws_request = req,
+ .request_context = AnyRequestContext.init(ctx),
.upgrader = ctx,
.https = ssl_enabled,
- .signal = ctx.signal,
+ .signal = signal.ref(),
.body = body.ref(),
};
ctx.upgrade_context = upgrade_ctx;
@@ -5663,7 +5813,7 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp
const response_value = this.config.onRequest.callWithThis(this.globalThis, this.thisObject, &args);
defer {
// uWS request will not live longer than this function
- request_object.uws_request = null;
+ request_object.request_context = JSC.API.AnyRequestContext.Null;
}
var should_deinit_context = false;
@@ -5678,7 +5828,7 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp
ctx.defer_deinit_until_callback_completes = null;
if (should_deinit_context) {
- request_object.uws_request = null;
+ request_object.request_context = JSC.API.AnyRequestContext.Null;
ctx.deinit();
return;
}
diff --git a/src/bun.js/base.zig b/src/bun.js/base.zig
index d050804e3..70e5351cc 100644
--- a/src/bun.js/base.zig
+++ b/src/bun.js/base.zig
@@ -1179,8 +1179,7 @@ pub fn DOMCall(
\\ thisObject->putDirect(
\\ globalObject->vm(),
\\ Identifier::fromString(globalObject->vm(), "{[name]s}"_s),
- \\ function,
- \\ JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0
+ \\ function
\\ );
\\}}
;
@@ -1794,12 +1793,19 @@ pub const FilePoll = struct {
pub fn deinit(this: *FilePoll) void {
var vm = JSC.VirtualMachine.get();
- this.deinitWithVM(vm);
+ var loop = vm.event_loop_handle.?;
+ this.deinitPossiblyDefer(vm, loop, vm.rareData().filePolls(vm), false);
+ }
+
+ pub fn deinitForceUnregister(this: *FilePoll) void {
+ var vm = JSC.VirtualMachine.get();
+ var loop = vm.event_loop_handle.?;
+ this.deinitPossiblyDefer(vm, loop, vm.rareData().filePolls(vm), true);
}
- fn deinitPossiblyDefer(this: *FilePoll, vm: *JSC.VirtualMachine, loop: *uws.Loop, polls: *JSC.FilePoll.Store) void {
+ fn deinitPossiblyDefer(this: *FilePoll, vm: *JSC.VirtualMachine, loop: *uws.Loop, polls: *JSC.FilePoll.Store, force_unregister: bool) void {
if (this.isRegistered()) {
- _ = this.unregister(loop);
+ _ = this.unregister(loop, force_unregister);
}
this.owner = Deactivated.owner;
@@ -1811,7 +1817,7 @@ pub const FilePoll = struct {
pub fn deinitWithVM(this: *FilePoll, vm: *JSC.VirtualMachine) void {
var loop = vm.event_loop_handle.?;
- this.deinitPossiblyDefer(vm, loop, vm.rareData().filePolls(vm));
+ this.deinitPossiblyDefer(vm, loop, vm.rareData().filePolls(vm), false);
}
pub fn isRegistered(this: *const FilePoll) bool {
@@ -2204,10 +2210,12 @@ pub const FilePoll = struct {
var event = linux.epoll_event{ .events = flags, .data = .{ .u64 = @intFromPtr(Pollable.init(this).ptr()) } };
+ var op: u32 = if (this.isRegistered() or this.flags.contains(.needs_rearm)) linux.EPOLL.CTL_MOD else linux.EPOLL.CTL_ADD;
+
const ctl = linux.epoll_ctl(
watcher_fd,
- if (this.isRegistered() or this.flags.contains(.needs_rearm)) linux.EPOLL.CTL_MOD else linux.EPOLL.CTL_ADD,
- @as(std.os.fd_t, @intCast(fd)),
+ op,
+ @intCast(fd),
&event,
);
this.flags.insert(.was_ever_registered);
@@ -2321,11 +2329,11 @@ pub const FilePoll = struct {
const invalid_fd = bun.invalid_fd;
- pub fn unregister(this: *FilePoll, loop: *uws.Loop) JSC.Maybe(void) {
- return this.unregisterWithFd(loop, this.fd);
+ pub fn unregister(this: *FilePoll, loop: *uws.Loop, force_unregister: bool) JSC.Maybe(void) {
+ return this.unregisterWithFd(loop, this.fd, force_unregister);
}
- pub fn unregisterWithFd(this: *FilePoll, loop: *uws.Loop, fd: bun.UFileDescriptor) JSC.Maybe(void) {
+ pub fn unregisterWithFd(this: *FilePoll, loop: *uws.Loop, fd: bun.UFileDescriptor, force_unregister: bool) JSC.Maybe(void) {
if (!(this.flags.contains(.poll_readable) or this.flags.contains(.poll_writable) or this.flags.contains(.poll_process) or this.flags.contains(.poll_machport))) {
// no-op
return JSC.Maybe(void).success;
@@ -2346,7 +2354,7 @@ pub const FilePoll = struct {
return JSC.Maybe(void).success;
};
- if (this.flags.contains(.needs_rearm)) {
+ if (this.flags.contains(.needs_rearm) and !force_unregister) {
log("unregister: {s} ({d}) skipped due to needs_rearm", .{ @tagName(flag), fd });
this.flags.remove(.poll_process);
this.flags.remove(.poll_readable);
@@ -2361,7 +2369,7 @@ pub const FilePoll = struct {
const ctl = linux.epoll_ctl(
watcher_fd,
linux.EPOLL.CTL_DEL,
- @as(std.os.fd_t, @intCast(fd)),
+ @intCast(fd),
null,
);
diff --git a/src/bun.js/bindings/AsyncContextFrame.cpp b/src/bun.js/bindings/AsyncContextFrame.cpp
index 1c541b2a8..7b715d3d7 100644
--- a/src/bun.js/bindings/AsyncContextFrame.cpp
+++ b/src/bun.js/bindings/AsyncContextFrame.cpp
@@ -22,7 +22,7 @@ AsyncContextFrame* AsyncContextFrame::create(VM& vm, JSC::Structure* structure,
AsyncContextFrame* AsyncContextFrame::create(JSGlobalObject* global, JSValue callback, JSValue context)
{
auto& vm = global->vm();
- AsyncContextFrame* asyncContextData = new (NotNull, allocateCell<AsyncContextFrame>(vm)) AsyncContextFrame(vm, static_cast<Zig::GlobalObject*>(global)->AsyncContextFrameStructure());
+ AsyncContextFrame* asyncContextData = new (NotNull, allocateCell<AsyncContextFrame>(vm)) AsyncContextFrame(vm, jsCast<Zig::GlobalObject*>(global)->AsyncContextFrameStructure());
asyncContextData->finishCreation(vm);
asyncContextData->callback.set(vm, asyncContextData, callback);
asyncContextData->context.set(vm, asyncContextData, context);
@@ -47,7 +47,7 @@ JSValue AsyncContextFrame::withAsyncContextIfNeeded(JSGlobalObject* globalObject
auto& vm = globalObject->vm();
return AsyncContextFrame::create(
vm,
- static_cast<Zig::GlobalObject*>(globalObject)->AsyncContextFrameStructure(),
+ jsCast<Zig::GlobalObject*>(globalObject)->AsyncContextFrameStructure(),
callback,
context);
}
diff --git a/src/bun.js/bindings/BunDebugger.cpp b/src/bun.js/bindings/BunDebugger.cpp
index 046739923..55942d2f6 100644
--- a/src/bun.js/bindings/BunDebugger.cpp
+++ b/src/bun.js/bindings/BunDebugger.cpp
@@ -452,12 +452,13 @@ extern "C" void Bun__ensureDebugger(ScriptExecutionContextIdentifier scriptId, b
}
}
-extern "C" void BunDebugger__willHotReload() {
+extern "C" void BunDebugger__willHotReload()
+{
if (debuggerScriptExecutionContext == nullptr) {
return;
}
- debuggerScriptExecutionContext->postTaskConcurrently([](ScriptExecutionContext &context){
+ debuggerScriptExecutionContext->postTaskConcurrently([](ScriptExecutionContext& context) {
WTF::LockHolder locker(inspectorConnectionsLock);
for (auto& connections : *inspectorConnections) {
for (auto* connection : connections.value) {
diff --git a/src/bun.js/bindings/BunObject.cpp b/src/bun.js/bindings/BunObject.cpp
index 0b78d1367..498b83b45 100644
--- a/src/bun.js/bindings/BunObject.cpp
+++ b/src/bun.js/bindings/BunObject.cpp
@@ -190,7 +190,7 @@ static JSValue constructPluginObject(VM& vm, JSObject* bunObject)
auto* globalObject = bunObject->globalObject();
JSFunction* pluginFunction = JSFunction::create(vm, globalObject, 1, String("plugin"_s), jsFunctionBunPlugin, ImplementationVisibility::Public, NoIntrinsic);
pluginFunction->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "clearAll"_s), 1, jsFunctionBunPluginClear, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
return pluginFunction;
}
@@ -215,37 +215,40 @@ extern "C" EncodedJSValue Bun__DNSResolver__resolvePtr(JSGlobalObject*, JSC::Cal
extern "C" EncodedJSValue Bun__DNSResolver__resolveCname(JSGlobalObject*, JSC::CallFrame*);
extern "C" EncodedJSValue Bun__DNSResolver__getServers(JSGlobalObject*, JSC::CallFrame*);
extern "C" EncodedJSValue Bun__DNSResolver__reverse(JSGlobalObject*, JSC::CallFrame*);
+extern "C" EncodedJSValue Bun__DNSResolver__lookupService(JSGlobalObject*, JSC::CallFrame*);
static JSValue constructDNSObject(VM& vm, JSObject* bunObject)
{
JSGlobalObject* globalObject = bunObject->globalObject();
JSC::JSObject* dnsObject = JSC::constructEmptyObject(globalObject);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "lookup"_s), 2, Bun__DNSResolver__lookup, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolve"_s), 2, Bun__DNSResolver__resolve, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveSrv"_s), 2, Bun__DNSResolver__resolveSrv, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveTxt"_s), 2, Bun__DNSResolver__resolveTxt, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveSoa"_s), 2, Bun__DNSResolver__resolveSoa, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveNaptr"_s), 2, Bun__DNSResolver__resolveNaptr, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveMx"_s), 2, Bun__DNSResolver__resolveMx, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveCaa"_s), 2, Bun__DNSResolver__resolveCaa, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveNs"_s), 2, Bun__DNSResolver__resolveNs, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolvePtr"_s), 2, Bun__DNSResolver__resolvePtr, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveCname"_s), 2, Bun__DNSResolver__resolveCname, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "getServers"_s), 2, Bun__DNSResolver__getServers, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "reverse"_s), 2, Bun__DNSResolver__reverse, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
+ dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "lookupService"_s), 2, Bun__DNSResolver__lookupService, ImplementationVisibility::Public, NoIntrinsic,
+ JSC::PropertyAttribute::DontDelete | 0);
return dnsObject;
}
@@ -255,7 +258,7 @@ static JSValue constructBunPeekObject(VM& vm, JSObject* bunObject)
JSC::Identifier identifier = JSC::Identifier::fromString(vm, "peek"_s);
JSFunction* peekFunction = JSFunction::create(vm, globalObject, 2, WTF::String("peek"_s), functionBunPeek, ImplementationVisibility::Public, NoIntrinsic);
JSFunction* peekStatus = JSFunction::create(vm, globalObject, 1, WTF::String("status"_s), functionBunPeekStatus, ImplementationVisibility::Public, NoIntrinsic);
- peekFunction->putDirect(vm, PropertyName(JSC::Identifier::fromString(vm, "status"_s)), peekStatus, JSC::PropertyAttribute::Function | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete | 0);
+ peekFunction->putDirect(vm, PropertyName(JSC::Identifier::fromString(vm, "status"_s)), peekStatus, JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete | 0);
return peekFunction;
}
@@ -602,7 +605,7 @@ JSC_DEFINE_HOST_FUNCTION(functionHashCode,
hash BunObject_getter_wrap_hash DontDelete|PropertyCallback
indexOfLine BunObject_callback_indexOfLine DontDelete|Function 1
inflateSync BunObject_callback_inflateSync DontDelete|Function 1
- inspect BunObject_getter_wrap_inspect DontDelete|PropertyCallback
+ inspect BunObject_getter_wrap_inspect DontDelete|PropertyCallback
isMainThread constructIsMainThread ReadOnly|DontDelete|PropertyCallback
jest BunObject_callback_jest DontEnum|DontDelete|Function 1
listen BunObject_callback_listen DontDelete|Function 1
@@ -660,6 +663,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSBunObject, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -670,15 +674,14 @@ public:
void finishCreation(JSC::VM& vm)
{
Base::finishCreation(vm);
-
JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
}
static JSBunObject* create(JSC::VM& vm, JSGlobalObject* globalObject)
{
- auto* object = new (NotNull, JSC::allocateCell<JSBunObject>(vm)) JSBunObject(vm, createStructure(vm, globalObject, globalObject->objectPrototype()));
+ auto structure = createStructure(vm, globalObject, globalObject->objectPrototype());
+ auto* object = new (NotNull, JSC::allocateCell<JSBunObject>(vm)) JSBunObject(vm, structure);
object->finishCreation(vm);
-
return object;
}
};
@@ -699,11 +702,11 @@ public:
#undef bunObjectReadableStreamToJSONCodeGenerator
#undef bunObjectReadableStreamToTextCodeGenerator
-const JSC::ClassInfo JSBunObject::s_info = { "Bun"_s, &JSNonFinalObject::s_info, &bunObjectTable, nullptr, CREATE_METHOD_TABLE(JSBunObject) };
+const JSC::ClassInfo JSBunObject::s_info = { "Bun"_s, &Base::s_info, &bunObjectTable, nullptr, CREATE_METHOD_TABLE(JSBunObject) };
-JSValue createBunObject(Zig::GlobalObject* globalObject)
+JSC::JSObject* createBunObject(VM& vm, JSObject* globalObject)
{
- return JSBunObject::create(globalObject->vm(), globalObject);
+ return JSBunObject::create(vm, jsCast<Zig::GlobalObject*>(globalObject));
}
}
diff --git a/src/bun.js/bindings/BunObject.h b/src/bun.js/bindings/BunObject.h
index c2abfe06f..f527f5729 100644
--- a/src/bun.js/bindings/BunObject.h
+++ b/src/bun.js/bindings/BunObject.h
@@ -13,5 +13,5 @@ JSC_DECLARE_HOST_FUNCTION(functionBunNanoseconds);
JSC_DECLARE_HOST_FUNCTION(functionPathToFileURL);
JSC_DECLARE_HOST_FUNCTION(functionFileURLToPath);
-JSC::JSValue createBunObject(Zig::GlobalObject* globalObject);
+JSC::JSObject* createBunObject(VM& vm, JSObject* globalObject);
}
diff --git a/src/bun.js/bindings/BunObject.lut.h b/src/bun.js/bindings/BunObject.lut.h
index 1971cb8da..a2aa95fda 100644
--- a/src/bun.js/bindings/BunObject.lut.h
+++ b/src/bun.js/bindings/BunObject.lut.h
@@ -1,4 +1,4 @@
-// File generated via `make generate-builtins`
+// File generated via `make static-hash-table` / `make cpp`
static const struct CompactHashIndex bunObjectTableIndex[269] = {
{ 75, -1 },
{ -1, -1 },
diff --git a/src/bun.js/bindings/BunPlugin.cpp b/src/bun.js/bindings/BunPlugin.cpp
index 129d7816b..e0527c724 100644
--- a/src/bun.js/bindings/BunPlugin.cpp
+++ b/src/bun.js/bindings/BunPlugin.cpp
@@ -11,14 +11,17 @@
#include "JavaScriptCore/JSObjectInlines.h"
#include "wtf/text/WTFString.h"
#include "JavaScriptCore/JSCInlines.h"
+#include "JavaScriptCore/StrongInlines.h"
#include "JavaScriptCore/ObjectConstructor.h"
#include "JavaScriptCore/SubspaceInlines.h"
#include "JavaScriptCore/RegExpObject.h"
#include "JavaScriptCore/JSPromise.h"
#include "BunClientData.h"
-
+#include "isBuiltinModule.h"
#include "JavaScriptCore/RegularExpression.h"
+#include "JavaScriptCore/JSMap.h"
+#include "JavaScriptCore/JSMapInlines.h"
namespace Zig {
@@ -86,6 +89,76 @@ static EncodedJSValue jsFunctionAppendOnLoadPluginBody(JSC::JSGlobalObject* glob
return JSValue::encode(jsUndefined());
}
+static EncodedJSValue jsFunctionAppendVirtualModulePluginBody(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callframe)
+{
+ JSC::VM& vm = globalObject->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ if (callframe->argumentCount() < 2) {
+ throwException(globalObject, scope, createError(globalObject, "module() needs 2 arguments: a module ID and a function to call"_s));
+ return JSValue::encode(jsUndefined());
+ }
+
+ JSValue moduleIdValue = callframe->uncheckedArgument(0);
+ JSValue functionValue = callframe->uncheckedArgument(1);
+
+ if (!moduleIdValue.isString()) {
+ throwException(globalObject, scope, createError(globalObject, "module() expects first argument to be a string for the module ID"_s));
+ return JSValue::encode(jsUndefined());
+ }
+
+ if (!functionValue.isCallable()) {
+ throwException(globalObject, scope, createError(globalObject, "module() expects second argument to be a function"_s));
+ return JSValue::encode(jsUndefined());
+ }
+
+ String moduleId = moduleIdValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+
+ if (moduleId.isEmpty()) {
+ throwException(globalObject, scope, createError(globalObject, "virtual module cannot be blank"_s));
+ return JSValue::encode(jsUndefined());
+ }
+
+ if (Bun::isBuiltinModule(moduleId)) {
+ throwException(globalObject, scope, createError(globalObject, makeString("module() cannot be used to override builtin module \""_s, moduleId, "\""_s)));
+ return JSValue::encode(jsUndefined());
+ }
+
+ if (moduleId.startsWith("."_s)) {
+ throwException(globalObject, scope, createError(globalObject, "virtual module cannot start with \".\""_s));
+ return JSValue::encode(jsUndefined());
+ }
+
+ Zig::GlobalObject* global = Zig::jsCast<Zig::GlobalObject*>(globalObject);
+ if (global->onLoadPlugins.virtualModules == nullptr) {
+ global->onLoadPlugins.virtualModules = new BunPlugin::VirtualModuleMap;
+ }
+ auto* virtualModules = global->onLoadPlugins.virtualModules;
+
+ virtualModules->set(moduleId, JSC::Strong<JSC::JSObject> { vm, jsCast<JSC::JSObject*>(functionValue) });
+
+ JSMap* esmRegistry;
+
+ if (auto loaderValue = global->getIfPropertyExists(global, JSC::Identifier::fromString(vm, "Loader"_s))) {
+ if (auto registryValue = loaderValue.getObject()->getIfPropertyExists(global, JSC::Identifier::fromString(vm, "registry"_s))) {
+ esmRegistry = jsCast<JSC::JSMap*>(registryValue);
+ }
+ }
+
+ global->requireMap()->remove(globalObject, moduleIdValue);
+ esmRegistry && esmRegistry->remove(globalObject, moduleIdValue);
+
+ // bool hasBeenRequired = global->requireMap()->has(globalObject, moduleIdValue);
+ // bool hasBeenImported = esmRegistry && esmRegistry->has(globalObject, moduleIdValue);
+ // if (hasBeenRequired || hasBeenImported) {
+ // // callAndReplaceModule(global, moduleIdValue, functionValue, global->requireMap(), esmRegistry, hasBeenRequired, hasBeenImported);
+ // // RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ // }
+
+ return JSValue::encode(jsUndefined());
+}
+
static EncodedJSValue jsFunctionAppendOnResolvePluginBody(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callframe, BunPluginTarget target, BunPlugin::Base& plugin, void* ctx, OnAppendPluginCallback callback)
{
JSC::VM& vm = globalObject->vm();
@@ -143,7 +216,7 @@ static EncodedJSValue jsFunctionAppendOnResolvePluginGlobal(JSC::JSGlobalObject*
{
Zig::GlobalObject* global = Zig::jsCast<Zig::GlobalObject*>(globalObject);
- auto& plugins = global->onResolvePlugins[target];
+ auto& plugins = global->onResolvePlugins;
auto callback = Bun__onDidAppendPlugin;
return jsFunctionAppendOnResolvePluginBody(globalObject, callframe, target, plugins, global->bunVM(), callback);
}
@@ -152,7 +225,7 @@ static EncodedJSValue jsFunctionAppendOnLoadPluginGlobal(JSC::JSGlobalObject* gl
{
Zig::GlobalObject* global = Zig::jsCast<Zig::GlobalObject*>(globalObject);
- auto& plugins = global->onLoadPlugins[target];
+ auto& plugins = global->onLoadPlugins;
auto callback = Bun__onDidAppendPlugin;
return jsFunctionAppendOnLoadPluginBody(globalObject, callframe, target, plugins, global->bunVM(), callback);
}
@@ -182,6 +255,11 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionAppendOnResolvePluginBun, (JSC::JSGlobalObjec
return jsFunctionAppendOnResolvePluginGlobal(globalObject, callframe, BunPluginTargetBun);
}
+JSC_DEFINE_HOST_FUNCTION(jsFunctionAppendVirtualModule, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callframe))
+{
+ return jsFunctionAppendVirtualModulePluginBody(globalObject, callframe);
+}
+
JSC_DEFINE_HOST_FUNCTION(jsFunctionAppendOnResolvePluginBrowser, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callframe))
{
return jsFunctionAppendOnResolvePluginGlobal(globalObject, callframe, BunPluginTargetBrowser);
@@ -190,12 +268,12 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionAppendOnResolvePluginBrowser, (JSC::JSGlobalO
extern "C" EncodedJSValue jsFunctionBunPluginClear(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callframe)
{
Zig::GlobalObject* global = reinterpret_cast<Zig::GlobalObject*>(globalObject);
- for (uint8_t i = 0; i < BunPluginTargetMax + 1; i++) {
- global->onLoadPlugins[i].fileNamespace.clear();
- global->onResolvePlugins[i].fileNamespace.clear();
- global->onLoadPlugins[i].groups.clear();
- global->onResolvePlugins[i].namespaces.clear();
- }
+ global->onLoadPlugins.fileNamespace.clear();
+ global->onResolvePlugins.fileNamespace.clear();
+ global->onLoadPlugins.groups.clear();
+ global->onResolvePlugins.namespaces.clear();
+
+ delete global->onLoadPlugins.virtualModules;
return JSValue::encode(jsUndefined());
}
@@ -239,76 +317,37 @@ extern "C" EncodedJSValue setupBunPlugin(JSC::JSGlobalObject* globalObject, JSC:
}
JSFunction* setupFunction = jsCast<JSFunction*>(setupFunctionValue);
- JSObject* builderObject = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype(), 3);
-
- switch (target) {
- case BunPluginTargetNode: {
- builderObject->putDirect(vm, Identifier::fromString(vm, "target"_s), jsString(vm, String("node"_s)), 0);
- builderObject->putDirectNativeFunction(
- vm,
- globalObject,
- JSC::Identifier::fromString(vm, "onLoad"_s),
- 1,
- jsFunctionAppendOnLoadPluginNode,
- ImplementationVisibility::Public,
- NoIntrinsic,
- JSC::PropertyAttribute::DontDelete | 0);
- builderObject->putDirectNativeFunction(
- vm,
- globalObject,
- JSC::Identifier::fromString(vm, "onResolve"_s),
- 1,
- jsFunctionAppendOnResolvePluginNode,
- ImplementationVisibility::Public,
- NoIntrinsic,
- JSC::PropertyAttribute::DontDelete | 0);
- break;
- }
- case BunPluginTargetBun: {
- builderObject->putDirect(vm, Identifier::fromString(vm, "target"_s), jsString(vm, String("bun"_s)), 0);
- builderObject->putDirectNativeFunction(
- vm,
- globalObject,
- JSC::Identifier::fromString(vm, "onLoad"_s),
- 1,
- jsFunctionAppendOnLoadPluginBun,
- ImplementationVisibility::Public,
- NoIntrinsic,
- JSC::PropertyAttribute::DontDelete | 0);
- builderObject->putDirectNativeFunction(
- vm,
- globalObject,
- JSC::Identifier::fromString(vm, "onResolve"_s),
- 1,
- jsFunctionAppendOnResolvePluginBun,
- ImplementationVisibility::Public,
- NoIntrinsic,
- JSC::PropertyAttribute::DontDelete | 0);
- break;
- }
- case BunPluginTargetBrowser: {
- builderObject->putDirect(vm, Identifier::fromString(vm, "target"_s), jsString(vm, String("browser"_s)), 0);
- builderObject->putDirectNativeFunction(
- vm,
- globalObject,
- JSC::Identifier::fromString(vm, "onLoad"_s),
- 1,
- jsFunctionAppendOnLoadPluginBrowser,
- ImplementationVisibility::Public,
- NoIntrinsic,
- JSC::PropertyAttribute::DontDelete | 0);
- builderObject->putDirectNativeFunction(
- vm,
- globalObject,
- JSC::Identifier::fromString(vm, "onResolve"_s),
- 1,
- jsFunctionAppendOnResolvePluginBrowser,
- ImplementationVisibility::Public,
- NoIntrinsic,
- JSC::PropertyAttribute::DontDelete | 0);
- break;
- }
- }
+ JSObject* builderObject = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype(), 4);
+
+ builderObject->putDirect(vm, Identifier::fromString(vm, "target"_s), jsString(vm, String("bun"_s)), 0);
+ builderObject->putDirectNativeFunction(
+ vm,
+ globalObject,
+ JSC::Identifier::fromString(vm, "onLoad"_s),
+ 1,
+ jsFunctionAppendOnLoadPluginBun,
+ ImplementationVisibility::Public,
+ NoIntrinsic,
+ JSC::PropertyAttribute::DontDelete | 0);
+ builderObject->putDirectNativeFunction(
+ vm,
+ globalObject,
+ JSC::Identifier::fromString(vm, "onResolve"_s),
+ 1,
+ jsFunctionAppendOnResolvePluginBun,
+ ImplementationVisibility::Public,
+ NoIntrinsic,
+ JSC::PropertyAttribute::DontDelete | 0);
+
+ builderObject->putDirectNativeFunction(
+ vm,
+ globalObject,
+ JSC::Identifier::fromString(vm, "module"_s),
+ 1,
+ jsFunctionAppendVirtualModule,
+ ImplementationVisibility::Public,
+ NoIntrinsic,
+ JSC::PropertyAttribute::DontDelete | 0);
JSC::MarkedArgumentBuffer args;
args.append(builderObject);
@@ -329,9 +368,7 @@ extern "C" EncodedJSValue setupBunPlugin(JSC::JSGlobalObject* globalObject, JSC:
extern "C" EncodedJSValue jsFunctionBunPlugin(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callframe)
{
Zig::GlobalObject* global = reinterpret_cast<Zig::GlobalObject*>(globalObject);
- BunPluginTarget target = global->defaultBunPluginTarget;
-
- return setupBunPlugin(globalObject, callframe, target);
+ return setupBunPlugin(globalObject, callframe, BunPluginTargetBun);
}
void BunPlugin::Group::append(JSC::VM& vm, JSC::RegExp* filter, JSC::JSFunction* func)
@@ -513,10 +550,60 @@ EncodedJSValue BunPlugin::OnResolve::run(JSC::JSGlobalObject* globalObject, BunS
extern "C" JSC::EncodedJSValue Bun__runOnResolvePlugins(Zig::GlobalObject* globalObject, BunString* namespaceString, BunString* path, BunString* from, BunPluginTarget target)
{
- return globalObject->onResolvePlugins[target].run(globalObject, namespaceString, path, from);
+ return globalObject->onResolvePlugins.run(globalObject, namespaceString, path, from);
}
extern "C" JSC::EncodedJSValue Bun__runOnLoadPlugins(Zig::GlobalObject* globalObject, BunString* namespaceString, BunString* path, BunPluginTarget target)
{
- return globalObject->onLoadPlugins[target].run(globalObject, namespaceString, path);
+ return globalObject->onLoadPlugins.run(globalObject, namespaceString, path);
+}
+
+namespace Bun {
+JSC::JSValue runVirtualModule(Zig::GlobalObject* globalObject, BunString* specifier)
+{
+ auto fallback = [&]() -> JSC::JSValue {
+ return JSValue::decode(Bun__runVirtualModule(globalObject, specifier));
+ };
+
+ if (!globalObject->onLoadPlugins.virtualModules) {
+ return fallback();
+ }
+ auto& virtualModules = *globalObject->onLoadPlugins.virtualModules;
+ WTF::String specifierString = Bun::toWTFString(*specifier);
+ if (auto virtualModuleFn = virtualModules.get(specifierString)) {
+ auto& vm = globalObject->vm();
+ JSC::JSObject* function = virtualModuleFn.get();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+
+ JSC::MarkedArgumentBuffer arguments;
+ JSC::CallData callData = JSC::getCallData(function);
+ RELEASE_ASSERT(callData.type != JSC::CallData::Type::None);
+
+ auto result = call(globalObject, function, callData, JSC::jsUndefined(), arguments);
+ RETURN_IF_EXCEPTION(throwScope, JSC::jsUndefined());
+
+ if (auto* promise = JSC::jsDynamicCast<JSPromise*>(result)) {
+ switch (promise->status(vm)) {
+ case JSPromise::Status::Rejected:
+ case JSPromise::Status::Pending: {
+ return promise;
+ }
+ case JSPromise::Status::Fulfilled: {
+ result = promise->result(vm);
+ break;
+ }
+ }
+ }
+
+ if (!result.isObject()) {
+ JSC::throwTypeError(globalObject, throwScope, "virtual module expects an object returned"_s);
+ return JSC::jsUndefined();
+ }
+
+ return result;
+ }
+
+ return fallback();
}
+
+} \ No newline at end of file
diff --git a/src/bun.js/bindings/BunPlugin.h b/src/bun.js/bindings/BunPlugin.h
index cf37b739b..f4d09883d 100644
--- a/src/bun.js/bindings/BunPlugin.h
+++ b/src/bun.js/bindings/BunPlugin.h
@@ -15,6 +15,8 @@ using namespace JSC;
class BunPlugin {
public:
+ using VirtualModuleMap = WTF::HashMap<String, JSC::Strong<JSC::JSObject>>;
+
// This is a list of pairs of regexps and functions to match against
class Group {
@@ -67,7 +69,15 @@ public:
{
}
- EncodedJSValue run(JSC::JSGlobalObject* globalObject, BunString* namespaceString, BunString* path);
+ VirtualModuleMap* virtualModules = nullptr;
+ JSC::EncodedJSValue run(JSC::JSGlobalObject* globalObject, BunString* namespaceString, BunString* path);
+
+ ~OnLoad()
+ {
+ if (virtualModules) {
+ delete virtualModules;
+ }
+ }
};
class OnResolve final : public Base {
@@ -78,8 +88,14 @@ public:
{
}
- EncodedJSValue run(JSC::JSGlobalObject* globalObject, BunString* namespaceString, BunString* path, BunString* importer);
+ JSC::EncodedJSValue run(JSC::JSGlobalObject* globalObject, BunString* namespaceString, BunString* path, BunString* importer);
};
};
-} // namespace Zig \ No newline at end of file
+class GlobalObject;
+
+} // namespace Zig
+
+namespace Bun {
+JSC::JSValue runVirtualModule(Zig::GlobalObject*, BunString* specifier);
+} \ No newline at end of file
diff --git a/src/bun.js/bindings/BunString.cpp b/src/bun.js/bindings/BunString.cpp
index 416d5d334..99fd02175 100644
--- a/src/bun.js/bindings/BunString.cpp
+++ b/src/bun.js/bindings/BunString.cpp
@@ -3,12 +3,13 @@
#include "JavaScriptCore/JSCJSValueInlines.h"
#include "helpers.h"
#include "simdutf.h"
-#include "wtf/text/ExternalStringImpl.h"
+#include "wtf/Seconds.h"
#include "GCDefferalContext.h"
#include <JavaScriptCore/JSONObject.h>
#include <wtf/text/AtomString.h>
using namespace JSC;
+extern "C" BunString BunString__fromBytes(const char* bytes, size_t length);
extern "C" bool Bun__WTFStringImpl__hasPrefix(const WTF::StringImpl* impl, const char* bytes, size_t length)
{
@@ -74,7 +75,10 @@ JSC::JSValue toJS(JSC::JSGlobalObject* globalObject, BunString bunString, size_t
#endif
return jsSubstring(globalObject, jsUndefined(), Bun::toWTFString(bunString), 0, length);
}
-
+BunString toString(const char* bytes, size_t length)
+{
+ return BunString__fromBytes(bytes, length);
+}
WTF::String toWTFString(const BunString& bunString)
{
if (bunString.tag == BunStringTag::ZigString) {
@@ -190,22 +194,6 @@ BunString toStringRef(WTF::StringImpl* wtfString)
return { BunStringTag::WTFStringImpl, { .wtf = wtfString } };
}
-BunString fromString(WTF::String& wtfString)
-{
- if (wtfString.isEmpty())
- return { BunStringTag::Empty };
-
- return { BunStringTag::WTFStringImpl, { .wtf = wtfString.impl() } };
-}
-
-BunString fromString(WTF::StringImpl* wtfString)
-{
- if (wtfString->isEmpty())
- return { BunStringTag::Empty };
-
- return { BunStringTag::WTFStringImpl, { .wtf = wtfString } };
-}
-
}
extern "C" JSC::EncodedJSValue BunString__toJS(JSC::JSGlobalObject* globalObject, BunString* bunString)
@@ -252,7 +240,7 @@ extern "C" BunString BunString__fromUTF8(const char* bytes, size_t length)
auto str = WTF::String::fromUTF8ReplacingInvalidSequences(reinterpret_cast<const LChar*>(bytes), length);
str.impl()->ref();
- return Bun::fromString(str);
+ return Bun::toString(str);
}
extern "C" BunString BunString__fromLatin1(const char* bytes, size_t length)
@@ -381,7 +369,17 @@ extern "C" BunString URL__getHref(BunString* input)
return Bun::toStringRef(url.string());
}
-extern "C" BunString URL__getHrefJoin(BunString* baseStr, BunString *relativeStr)
+extern "C" BunString URL__pathFromFileURL(BunString* input)
+{
+ auto&& str = Bun::toWTFString(*input);
+ auto url = WTF::URL(str);
+ if (!url.isValid() || url.isEmpty())
+ return { BunStringTag::Dead };
+
+ return Bun::toStringRef(url.fileSystemPath());
+}
+
+extern "C" BunString URL__getHrefJoin(BunString* baseStr, BunString* relativeStr)
{
auto base = Bun::toWTFString(*baseStr);
auto relative = Bun::toWTFString(*relativeStr);
@@ -455,4 +453,4 @@ extern "C" uint32_t URL__port(WTF::URL* url)
extern "C" BunString URL__pathname(WTF::URL* url)
{
return Bun::toStringRef(url->path().toStringWithoutCopying());
-} \ No newline at end of file
+}
diff --git a/src/bun.js/bindings/CallSite.cpp b/src/bun.js/bindings/CallSite.cpp
index 48fe82275..7667d9606 100644
--- a/src/bun.js/bindings/CallSite.cpp
+++ b/src/bun.js/bindings/CallSite.cpp
@@ -45,7 +45,7 @@ void CallSite::finishCreation(VM& vm, JSC::JSGlobalObject* globalObject, JSCStac
m_function.set(vm, this, JSC::jsUndefined());
m_flags |= static_cast<unsigned int>(Flags::IsStrict);
} else {
- if (callFrame) {
+ if (callFrame && callFrame->thisValue()) {
// We know that we're not in strict mode
m_thisValue.set(vm, this, callFrame->thisValue().toThis(globalObject, JSC::ECMAMode::sloppy()));
} else {
diff --git a/src/bun.js/bindings/CallSitePrototype.h b/src/bun.js/bindings/CallSitePrototype.h
index 000bce2de..8aa543fd3 100644
--- a/src/bun.js/bindings/CallSitePrototype.h
+++ b/src/bun.js/bindings/CallSitePrototype.h
@@ -26,6 +26,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(CallSitePrototype, Base);
return &vm.plainObjectSpace();
}
diff --git a/src/bun.js/bindings/CommonJSModuleRecord.cpp b/src/bun.js/bindings/CommonJSModuleRecord.cpp
index b94386ab3..f47c57559 100644
--- a/src/bun.js/bindings/CommonJSModuleRecord.cpp
+++ b/src/bun.js/bindings/CommonJSModuleRecord.cpp
@@ -8,7 +8,7 @@
* Then, at runtime, we create a JSCommonJSModule object.
*
* On this special object, we override the setter for the "exports" property in
- * a non-observable way (`static bool put ...`)
+ * a non-observable way using a CustomGetterSetter.
*
* When the setter is called, we set the internal "exports" property to the
* value passed in and we also update the requireMap with the new value.
@@ -20,17 +20,13 @@
*
* If an exception occurs, we remove the entry from the requireMap.
*
- * We tried using a CustomGetterSetter instead of overriding `put`, but it led
- * to returning the getter itself
- *
- * How cyclical dependencies are handled
+ * How cyclical dependencies are handled:
*
* Before executing the CommonJS module, we set the exports object in the
* requireMap to an empty object. When the CommonJS module is required again, we
* return the exports object from the requireMap. The values should be in sync
* while the module is being executed, unless module.exports is re-assigned to a
* different value. In that case, it will have a stale value.
- *
*/
#include "root.h"
@@ -71,6 +67,8 @@
#include <JavaScriptCore/JSSourceCode.h>
#include <JavaScriptCore/LazyPropertyInlines.h>
+extern "C" bool Bun__isBunMain(JSC::JSGlobalObject* global, const char* input_ptr, uint64_t input_len);
+
namespace Bun {
using namespace JSC;
@@ -96,28 +94,36 @@ static bool canPerformFastEnumeration(Structure* s)
static bool evaluateCommonJSModuleOnce(JSC::VM& vm, Zig::GlobalObject* globalObject, JSCommonJSModule* moduleObject, JSString* dirname, JSValue filename, WTF::NakedPtr<Exception>& exception)
{
JSC::Structure* thisObjectStructure = globalObject->commonJSFunctionArgumentsStructure();
- JSC::JSObject* thisObject = JSC::constructEmptyObject(
- vm,
- thisObjectStructure);
- thisObject->putDirectOffset(
- vm,
- 0,
- moduleObject);
- thisObject->putDirectOffset(
- vm,
- 1,
- dirname);
+ JSFunction* resolveFunction = JSC::JSBoundFunction::create(vm,
+ globalObject,
+ globalObject->requireResolveFunctionUnbound(),
+ moduleObject->id(),
+ ArgList(), 1, jsString(vm, String("resolve"_s)));
+ JSFunction* requireFunction = JSC::JSBoundFunction::create(vm,
+ globalObject,
+ globalObject->requireFunctionUnbound(),
+ moduleObject,
+ ArgList(), 1, jsString(vm, String("require"_s)));
+ requireFunction->putDirect(vm, vm.propertyNames->resolve, resolveFunction, 0);
+ moduleObject->putDirect(vm, WebCore::clientData(vm)->builtinNames().requirePublicName(), requireFunction, 0);
- thisObject->putDirectOffset(
- vm,
- 2,
- filename);
+ JSC::JSObject* thisObject = JSC::constructEmptyObject(vm, thisObjectStructure);
+ thisObject->putDirectOffset(vm, 0, moduleObject);
+ thisObject->putDirectOffset(vm, 1, requireFunction);
+ thisObject->putDirectOffset(vm, 2, resolveFunction);
+ thisObject->putDirectOffset(vm, 3, dirname);
+ thisObject->putDirectOffset(vm, 4, filename);
moduleObject->hasEvaluated = true;
+ // TODO: try to not use this write barrier. it needs some extensive testing.
+ // there is some possible GC issue where `thisObject` is gc'd before it should be
globalObject->m_BunCommonJSModuleValue.set(vm, globalObject, thisObject);
JSValue empty = JSC::evaluate(globalObject, moduleObject->sourceCode.get()->sourceCode(), thisObject, exception);
+
+ ensureStillAliveHere(thisObject);
+ globalObject->m_BunCommonJSModuleValue.clear();
moduleObject->sourceCode.clear();
return exception.get() == nullptr;
@@ -190,11 +196,25 @@ static const HashTableValue RequireFunctionPrototypeValues[] = {
{ "cache"_s, static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor), NoIntrinsic, { HashTableValue::GetterSetterType, jsRequireCacheGetter, jsRequireCacheSetter } },
};
+Structure* RequireFunctionPrototype::createStructure(
+ JSC::VM& vm,
+ JSC::JSGlobalObject* globalObject)
+{
+ return Structure::create(vm, globalObject, globalObject->functionPrototype(), TypeInfo(JSFunctionType, StructureFlags), info());
+}
+
+Structure* RequireResolveFunctionPrototype::createStructure(
+ JSC::VM& vm,
+ JSC::JSGlobalObject* globalObject)
+{
+ return Structure::create(vm, globalObject, globalObject->functionPrototype(), TypeInfo(JSFunctionType, StructureFlags), info());
+}
+
RequireResolveFunctionPrototype* RequireResolveFunctionPrototype::create(JSC::JSGlobalObject* globalObject)
{
auto& vm = globalObject->vm();
- auto* structure = RequireResolveFunctionPrototype::createStructure(vm, globalObject, globalObject->functionPrototype());
+ auto* structure = RequireResolveFunctionPrototype::createStructure(vm, globalObject);
RequireResolveFunctionPrototype* prototype = new (NotNull, JSC::allocateCell<RequireResolveFunctionPrototype>(vm)) RequireResolveFunctionPrototype(vm, structure);
prototype->finishCreation(vm);
return prototype;
@@ -205,11 +225,11 @@ RequireFunctionPrototype* RequireFunctionPrototype::create(
{
auto& vm = globalObject->vm();
- auto* structure = RequireFunctionPrototype::createStructure(vm, globalObject, globalObject->functionPrototype());
+ auto* structure = RequireFunctionPrototype::createStructure(vm, globalObject);
RequireFunctionPrototype* prototype = new (NotNull, JSC::allocateCell<RequireFunctionPrototype>(vm)) RequireFunctionPrototype(vm, structure);
prototype->finishCreation(vm);
- prototype->putDirect(vm, JSC::Identifier::fromString(vm, "resolve"_s), static_cast<Zig::GlobalObject*>(globalObject)->requireResolveFunctionUnbound(), PropertyAttribute::Function | 0);
+ prototype->putDirect(vm, JSC::Identifier::fromString(vm, "resolve"_s), jsCast<Zig::GlobalObject*>(globalObject)->requireResolveFunctionUnbound(), 0);
return prototype;
}
@@ -217,7 +237,7 @@ RequireFunctionPrototype* RequireFunctionPrototype::create(
void RequireFunctionPrototype::finishCreation(JSC::VM& vm)
{
Base::finishCreation(vm);
- ASSERT(inherits(vm, info()));
+ ASSERT(inherits(info()));
reifyStaticProperties(vm, info(), RequireFunctionPrototypeValues, *this);
JSC::JSFunction* requireDotMainFunction = JSFunction::create(
@@ -225,11 +245,11 @@ void RequireFunctionPrototype::finishCreation(JSC::VM& vm)
moduleMainCodeGenerator(vm),
globalObject()->globalScope());
- this->putDirect(
- vm,
+ this->putDirectAccessor(
+ globalObject(),
JSC::Identifier::fromString(vm, "main"_s),
- JSC::GetterSetter::create(vm, globalObject(), requireDotMainFunction, JSValue()),
- PropertyAttribute::Builtin | PropertyAttribute::Accessor | PropertyAttribute::ReadOnly | 0);
+ JSC::GetterSetter::create(vm, globalObject(), requireDotMainFunction, requireDotMainFunction),
+ PropertyAttribute::Accessor | PropertyAttribute::ReadOnly | 0);
auto extensions = constructEmptyObject(globalObject());
extensions->putDirect(vm, JSC::Identifier::fromString(vm, ".js"_s), jsBoolean(true), 0);
@@ -265,6 +285,31 @@ JSC_DEFINE_CUSTOM_GETTER(getterPath, (JSC::JSGlobalObject * globalObject, JSC::E
return JSValue::encode(thisObject->m_id.get());
}
+JSC_DEFINE_CUSTOM_GETTER(getterParent, (JSC::JSGlobalObject * globalObject, JSC::EncodedJSValue thisValue, JSC::PropertyName))
+{
+ JSCommonJSModule* thisObject = jsDynamicCast<JSCommonJSModule*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!thisObject)) {
+ return JSValue::encode(jsUndefined());
+ }
+ auto v = thisObject->m_parent.get();
+ if (v)
+ return JSValue::encode(thisObject->m_parent.get());
+
+ // initialize parent by checking if it is the main module. we do this lazily because most people
+ // dont need `module.parent` and creating commonjs module records is done a ton.
+ auto idValue = thisObject->m_id.get();
+ if (idValue) {
+ auto id = idValue->value(globalObject).utf8();
+ if (Bun__isBunMain(globalObject, id.data(), id.length())) {
+ thisObject->m_parent.set(globalObject->vm(), thisObject, jsNull());
+ return JSValue::encode(jsNull());
+ }
+ }
+
+ thisObject->m_parent.set(globalObject->vm(), thisObject, jsUndefined());
+ return JSValue::encode(jsUndefined());
+}
+
JSC_DEFINE_CUSTOM_SETTER(setterPath,
(JSC::JSGlobalObject * globalObject, JSC::EncodedJSValue thisValue,
JSC::EncodedJSValue value, JSC::PropertyName propertyName))
@@ -294,6 +339,16 @@ JSC_DEFINE_CUSTOM_GETTER(getterPaths, (JSC::JSGlobalObject * globalObject, JSC::
return JSValue::encode(thisObject->m_paths.get());
}
+JSC_DEFINE_CUSTOM_GETTER(getterLoaded, (JSC::JSGlobalObject * globalObject, JSC::EncodedJSValue thisValue, JSC::PropertyName))
+{
+ JSCommonJSModule* thisObject = jsDynamicCast<JSCommonJSModule*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!thisObject)) {
+ return JSValue::encode(jsUndefined());
+ }
+
+ return JSValue::encode(jsBoolean(thisObject->hasEvaluated));
+}
+
JSC_DEFINE_CUSTOM_SETTER(setterPaths,
(JSC::JSGlobalObject * globalObject, JSC::EncodedJSValue thisValue,
JSC::EncodedJSValue value, JSC::PropertyName propertyName))
@@ -329,27 +384,100 @@ JSC_DEFINE_CUSTOM_SETTER(setterId,
thisObject->m_id.set(globalObject->vm(), thisObject, JSValue::decode(value).toString(globalObject));
return true;
}
-
-static JSValue createLoaded(VM& vm, JSObject* object)
+JSC_DEFINE_CUSTOM_SETTER(setterParent,
+ (JSC::JSGlobalObject * globalObject, JSC::EncodedJSValue thisValue,
+ JSC::EncodedJSValue value, JSC::PropertyName propertyName))
{
- JSCommonJSModule* cjs = jsCast<JSCommonJSModule*>(object);
- return jsBoolean(cjs->hasEvaluated);
+ JSCommonJSModule* thisObject = jsDynamicCast<JSCommonJSModule*>(JSValue::decode(thisValue));
+ if (!thisObject)
+ return false;
+
+ thisObject->m_parent.set(globalObject->vm(), thisObject, JSValue::decode(value));
+
+ return true;
}
-static JSValue createParent(VM& vm, JSObject* object)
+JSC_DEFINE_CUSTOM_SETTER(setterLoaded,
+ (JSC::JSGlobalObject * globalObject, JSC::EncodedJSValue thisValue,
+ JSC::EncodedJSValue value, JSC::PropertyName propertyName))
{
- return jsUndefined();
+ JSCommonJSModule* thisObject = jsDynamicCast<JSCommonJSModule*>(JSValue::decode(thisValue));
+ if (!thisObject)
+ return false;
+
+ thisObject->hasEvaluated = JSValue::decode(value).toBoolean(globalObject);
+
+ return true;
}
+
static JSValue createChildren(VM& vm, JSObject* object)
{
return constructEmptyArray(object->globalObject(), nullptr, 0);
}
+JSC_DEFINE_HOST_FUNCTION(functionCommonJSModuleRecord_compile, (JSGlobalObject * globalObject, CallFrame* callframe))
+{
+ auto* moduleObject = jsDynamicCast<JSCommonJSModule*>(callframe->thisValue());
+ if (!moduleObject) {
+ return JSValue::encode(jsUndefined());
+ }
+
+ auto& vm = globalObject->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+
+ String sourceString = callframe->argument(0).toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(throwScope, JSValue::encode({}));
+
+ String filenameString = callframe->argument(1).toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(throwScope, JSValue::encode({}));
+
+ String wrappedString = makeString(
+ "(function(exports,require,module,__filename,__dirname){"_s,
+ sourceString,
+ "\n}).call(this.module.exports,this.module.exports,this.require,this.module,this.__filename,this.__dirname)"_s);
+
+ SourceCode sourceCode = makeSource(
+ WTFMove(wrappedString),
+ SourceOrigin(URL::fileURLWithFileSystemPath(filenameString)),
+ JSC::SourceTaintedOrigin::Untainted,
+ filenameString,
+ WTF::TextPosition(),
+ JSC::SourceProviderSourceType::Program);
+ JSSourceCode* jsSourceCode = JSSourceCode::create(vm, WTFMove(sourceCode));
+ moduleObject->sourceCode.set(vm, moduleObject, jsSourceCode);
+
+ auto index = filenameString.reverseFind('/', filenameString.length());
+ String dirnameString;
+ if (index != WTF::notFound) {
+ dirnameString = filenameString.substring(0, index);
+ } else {
+ dirnameString = "/"_s;
+ }
+
+ WTF::NakedPtr<JSC::Exception> exception;
+ evaluateCommonJSModuleOnce(
+ vm,
+ jsCast<Zig::GlobalObject*>(globalObject),
+ moduleObject,
+ jsString(vm, dirnameString),
+ jsString(vm, filenameString),
+ exception);
+
+ if (exception) {
+ throwException(globalObject, throwScope, exception.get());
+ exception.clear();
+ return JSValue::encode({});
+ }
+
+ return JSValue::encode(jsUndefined());
+}
+
static const struct HashTableValue JSCommonJSModulePrototypeTableValues[] = {
- { "children"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback | PropertyAttribute::DontEnum | 0), NoIntrinsic, { HashTableValue::LazyPropertyType, createChildren } },
+ { "_compile"_s, static_cast<unsigned>(PropertyAttribute::Function | PropertyAttribute::DontEnum), NoIntrinsic, { HashTableValue::NativeFunctionType, functionCommonJSModuleRecord_compile, 2 } },
+ { "children"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, createChildren } },
{ "filename"_s, static_cast<unsigned>(PropertyAttribute::CustomAccessor), NoIntrinsic, { HashTableValue::GetterSetterType, getterFilename, setterFilename } },
{ "id"_s, static_cast<unsigned>(PropertyAttribute::CustomAccessor), NoIntrinsic, { HashTableValue::GetterSetterType, getterId, setterId } },
- { "loaded"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback | PropertyAttribute::DontEnum | 0), NoIntrinsic, { HashTableValue::LazyPropertyType, createLoaded } },
- { "parent"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback | PropertyAttribute::DontEnum | 0), NoIntrinsic, { HashTableValue::LazyPropertyType, createParent } },
+ { "loaded"_s, static_cast<unsigned>(PropertyAttribute::CustomAccessor), NoIntrinsic, { HashTableValue::GetterSetterType, getterLoaded, setterLoaded } },
+ { "parent"_s, static_cast<unsigned>(PropertyAttribute::CustomAccessor | PropertyAttribute::DontEnum), NoIntrinsic, { HashTableValue::GetterSetterType, getterParent, setterParent } },
{ "path"_s, static_cast<unsigned>(PropertyAttribute::CustomAccessor), NoIntrinsic, { HashTableValue::GetterSetterType, getterPath, setterPath } },
{ "paths"_s, static_cast<unsigned>(PropertyAttribute::CustomAccessor), NoIntrinsic, { HashTableValue::GetterSetterType, getterPaths, setterPaths } },
};
@@ -367,6 +495,14 @@ public:
return prototype;
}
+ static JSC::Structure* createStructure(
+ JSC::VM& vm,
+ JSC::JSGlobalObject* globalObject,
+ JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(vm, globalObject, prototype, TypeInfo(JSC::ObjectType, StructureFlags), info());
+ }
+
DECLARE_INFO;
JSCommonJSModulePrototype(
@@ -379,36 +515,36 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSCommonJSModulePrototype, Base);
return &vm.plainObjectSpace();
}
void finishCreation(JSC::VM& vm, JSC::JSGlobalObject* globalObject)
{
Base::finishCreation(vm);
- ASSERT(inherits(vm, info()));
- reifyStaticProperties(vm, JSCommonJSModule::info(), JSCommonJSModulePrototypeTableValues, *this);
-
- this->putDirect(vm, clientData(vm)->builtinNames().requirePublicName(), (static_cast<Zig::GlobalObject*>(globalObject))->requireFunctionUnbound(), PropertyAttribute::Builtin | PropertyAttribute::Function | 0);
+ ASSERT(inherits(info()));
+ reifyStaticProperties(vm, info(), JSCommonJSModulePrototypeTableValues, *this);
this->putDirectNativeFunction(
vm,
globalObject,
clientData(vm)->builtinNames().requirePrivateName(),
2,
- jsFunctionRequireCommonJS, ImplementationVisibility::Public, NoIntrinsic, JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete | 0);
+ jsFunctionRequireCommonJS, ImplementationVisibility::Public, NoIntrinsic, JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete);
}
};
-const JSC::ClassInfo JSCommonJSModulePrototype::s_info = { "Module"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCommonJSModulePrototype) };
+const JSC::ClassInfo JSCommonJSModulePrototype::s_info = { "ModulePrototype"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCommonJSModulePrototype) };
void JSCommonJSModule::finishCreation(JSC::VM& vm, JSC::JSString* id, JSValue filename, JSC::JSString* dirname, JSC::JSSourceCode* sourceCode)
{
Base::finishCreation(vm);
- ASSERT(inherits(vm, info()));
+ ASSERT(inherits(info()));
m_id.set(vm, this, id);
m_filename.set(vm, this, filename);
m_dirname.set(vm, this, dirname);
- this->sourceCode.set(vm, this, sourceCode);
+ if (sourceCode)
+ this->sourceCode.set(vm, this, sourceCode);
}
JSC::Structure* JSCommonJSModule::createStructure(
@@ -439,23 +575,23 @@ JSCommonJSModule* JSCommonJSModule::create(
JSC_DEFINE_HOST_FUNCTION(jsFunctionCreateCommonJSModule, (JSGlobalObject * globalObject, CallFrame* callframe))
{
auto& vm = globalObject->vm();
+ RELEASE_ASSERT(callframe->argumentCount() == 4);
- auto id = callframe->argument(0).toWTFString(globalObject);
+ auto id = callframe->uncheckedArgument(0).toWTFString(globalObject);
+ JSValue object = callframe->uncheckedArgument(1);
+ JSValue hasEvaluated = callframe->uncheckedArgument(2);
+ ASSERT(hasEvaluated.isBoolean());
+ JSValue parent = callframe->uncheckedArgument(3);
- JSValue object = callframe->argument(1);
-
- return JSValue::encode(
- JSCommonJSModule::create(
- jsCast<Zig::GlobalObject*>(globalObject),
- id,
- object, callframe->argument(2).isBoolean() && callframe->argument(2).asBoolean()));
+ return JSValue::encode(JSCommonJSModule::create(jsCast<Zig::GlobalObject*>(globalObject), id, object, hasEvaluated.isTrue(), parent));
}
JSCommonJSModule* JSCommonJSModule::create(
Zig::GlobalObject* globalObject,
const WTF::String& key,
JSValue exportsObject,
- bool hasEvaluated)
+ bool hasEvaluated,
+ JSValue parent)
{
auto& vm = globalObject->vm();
JSString* requireMapKey = JSC::jsStringWithCache(vm, key);
@@ -470,8 +606,14 @@ JSCommonJSModule* JSCommonJSModule::create(
globalObject->CommonJSModuleObjectStructure(),
requireMapKey, requireMapKey, dirname, nullptr);
- out->putDirect(vm, WebCore::clientData(vm)->builtinNames().exportsPublicName(), exportsObject, exportsObject.isCell() && exportsObject.isCallable() ? JSC::PropertyAttribute::Function | 0 : 0);
+ out->putDirect(
+ vm,
+ WebCore::clientData(vm)->builtinNames().exportsPublicName(),
+ exportsObject,
+ 0);
out->hasEvaluated = hasEvaluated;
+ out->m_parent.set(vm, out, parent);
+
return out;
}
@@ -543,7 +685,7 @@ void JSCommonJSModule::toSyntheticSource(JSC::JSGlobalObject* globalObject,
bool needsToAssignDefault = true;
if (result.isObject()) {
- auto* exports = asObject(result);
+ auto* exports = result.getObject();
auto* structure = exports->structure();
uint32_t size = structure->inlineSize() + structure->outOfLineSize();
@@ -673,33 +815,6 @@ JSValue JSCommonJSModule::id()
return m_id.get();
}
-bool JSCommonJSModule::put(
- JSC::JSCell* cell,
- JSC::JSGlobalObject* globalObject,
- JSC::PropertyName propertyName,
- JSC::JSValue value,
- JSC::PutPropertySlot& slot)
-{
-
- auto& vm = globalObject->vm();
- auto* clientData = WebCore::clientData(vm);
- auto throwScope = DECLARE_THROW_SCOPE(vm);
-
- RELEASE_AND_RETURN(throwScope, Base::put(cell, globalObject, propertyName, value, slot));
-}
-
-template<typename, SubspaceAccess mode> JSC::GCClient::IsoSubspace* JSCommonJSModule::subspaceFor(JSC::VM& vm)
-{
- if constexpr (mode == JSC::SubspaceAccess::Concurrently)
- return nullptr;
- return WebCore::subspaceForImpl<JSCommonJSModule, WebCore::UseCustomHeapCellType::No>(
- vm,
- [](auto& spaces) { return spaces.m_clientSubspaceForCommonJSModuleRecord.get(); },
- [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForCommonJSModuleRecord = std::forward<decltype(space)>(space); },
- [](auto& spaces) { return spaces.m_subspaceForCommonJSModuleRecord.get(); },
- [](auto& spaces, auto&& space) { spaces.m_subspaceForCommonJSModuleRecord = std::forward<decltype(space)>(space); });
-}
-
Structure* createCommonJSModuleStructure(
Zig::GlobalObject* globalObject)
{
@@ -740,7 +855,7 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionRequireCommonJS, (JSGlobalObject * lexicalGlo
// Special-case for "process" to just return the process object directly.
if (UNLIKELY(specifier == "process"_s || specifier == "node:process"_s)) {
- jsDynamicCast<JSCommonJSModule*>(callframe->argument(1))->putDirect(vm, builtinNames(vm).exportsPublicName(), globalObject->processObject(), 0);
+ jsCast<JSCommonJSModule*>(callframe->argument(1))->putDirect(vm, builtinNames(vm).exportsPublicName(), globalObject->processObject(), 0);
return JSValue::encode(globalObject->processObject());
}
@@ -752,7 +867,7 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionRequireCommonJS, (JSGlobalObject * lexicalGlo
JSValue fetchResult = Bun::fetchCommonJSModule(
globalObject,
- jsDynamicCast<JSCommonJSModule*>(callframe->argument(1)),
+ jsCast<JSCommonJSModule*>(callframe->argument(1)),
specifierValue,
&specifierStr,
&referrerStr);
@@ -763,9 +878,9 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionRequireCommonJS, (JSGlobalObject * lexicalGlo
void RequireResolveFunctionPrototype::finishCreation(JSC::VM& vm)
{
Base::finishCreation(vm);
- ASSERT(inherits(vm, info()));
+ ASSERT(inherits(info()));
- reifyStaticProperties(vm, RequireResolveFunctionPrototype::info(), RequireResolveFunctionPrototypeValues, *this);
+ reifyStaticProperties(vm, info(), RequireResolveFunctionPrototypeValues, *this);
JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
}
@@ -909,8 +1024,6 @@ JSObject* JSCommonJSModule::createBoundRequireFunction(VM& vm, JSGlobalObject* l
globalObject->CommonJSModuleObjectStructure(),
filename, filename, dirname, nullptr);
- auto& builtinNames = WebCore::builtinNames(vm);
-
JSFunction* requireFunction = JSC::JSBoundFunction::create(vm,
globalObject,
globalObject->requireFunctionUnbound(),
@@ -921,9 +1034,9 @@ JSObject* JSCommonJSModule::createBoundRequireFunction(VM& vm, JSGlobalObject* l
globalObject,
globalObject->requireResolveFunctionUnbound(),
moduleObject,
- ArgList(), 1, jsString(vm, String("require"_s)));
+ ArgList(), 1, jsString(vm, String("resolve"_s)));
- requireFunction->putDirect(vm, builtinNames.resolvePublicName(), resolveFunction, PropertyAttribute::Function | 0);
+ requireFunction->putDirect(vm, vm.propertyNames->resolve, resolveFunction, 0);
return requireFunction;
}
diff --git a/src/bun.js/bindings/CommonJSModuleRecord.h b/src/bun.js/bindings/CommonJSModuleRecord.h
index e38d2e083..37353978e 100644
--- a/src/bun.js/bindings/CommonJSModuleRecord.h
+++ b/src/bun.js/bindings/CommonJSModuleRecord.h
@@ -20,13 +20,14 @@ JSC_DECLARE_HOST_FUNCTION(jsFunctionLoadModule);
class JSCommonJSModule final : public JSC::JSDestructibleObject {
public:
using Base = JSC::JSDestructibleObject;
- static constexpr unsigned StructureFlags = Base::StructureFlags | JSC::OverridesPut;
+ static constexpr unsigned StructureFlags = Base::StructureFlags;
- mutable JSC::WriteBarrier<JSC::JSString> m_id;
- mutable JSC::WriteBarrier<JSC::Unknown> m_filename;
- mutable JSC::WriteBarrier<JSC::JSString> m_dirname;
+ mutable JSC::WriteBarrier<JSString> m_id;
+ mutable JSC::WriteBarrier<Unknown> m_filename;
+ mutable JSC::WriteBarrier<JSString> m_dirname;
mutable JSC::WriteBarrier<Unknown> m_paths;
- mutable JSC::WriteBarrier<JSC::JSSourceCode> sourceCode;
+ mutable JSC::WriteBarrier<Unknown> m_parent;
+ mutable JSC::WriteBarrier<JSSourceCode> sourceCode;
bool ignoreESModuleAnnotation { false };
static void destroy(JSC::JSCell*);
@@ -54,8 +55,7 @@ public:
static JSCommonJSModule* create(
Zig::GlobalObject* globalObject,
const WTF::String& key,
- JSValue exportsObject,
- bool hasEvaluated = false);
+ JSValue exportsObject, bool hasEvaluated, JSValue parent);
static JSCommonJSModule* create(
Zig::GlobalObject* globalObject,
@@ -72,15 +72,21 @@ public:
JSValue exportsObject();
JSValue id();
+ DECLARE_INFO;
DECLARE_VISIT_CHILDREN;
- static bool put(JSC::JSCell* cell, JSC::JSGlobalObject* globalObject,
- JSC::PropertyName propertyName, JSC::JSValue value,
- JSC::PutPropertySlot& slot);
-
- DECLARE_INFO;
template<typename, SubspaceAccess mode>
- static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm);
+ static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
+ {
+ if constexpr (mode == JSC::SubspaceAccess::Concurrently)
+ return nullptr;
+ return WebCore::subspaceForImpl<JSCommonJSModule, WebCore::UseCustomHeapCellType::No>(
+ vm,
+ [](auto& spaces) { return spaces.m_clientSubspaceForCommonJSModuleRecord.get(); },
+ [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForCommonJSModuleRecord = std::forward<decltype(space)>(space); },
+ [](auto& spaces) { return spaces.m_subspaceForCommonJSModuleRecord.get(); },
+ [](auto& spaces, auto&& space) { spaces.m_subspaceForCommonJSModuleRecord = std::forward<decltype(space)>(space); });
+ }
bool hasEvaluated = false;
@@ -114,7 +120,9 @@ inline std::optional<JSC::SourceCode> createCommonJSModule(
class RequireResolveFunctionPrototype final : public JSC::JSNonFinalObject {
public:
using Base = JSC::JSNonFinalObject;
+
static RequireResolveFunctionPrototype* create(JSC::JSGlobalObject* globalObject);
+ static Structure* createStructure(VM& vm, JSC::JSGlobalObject* globalObject);
DECLARE_INFO;
@@ -128,6 +136,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(RequireResolveFunctionPrototype, Base);
return &vm.plainObjectSpace();
}
@@ -137,7 +146,11 @@ public:
class RequireFunctionPrototype final : public JSC::JSNonFinalObject {
public:
using Base = JSC::JSNonFinalObject;
+
static RequireFunctionPrototype* create(JSC::JSGlobalObject* globalObject);
+ static Structure* createStructure(VM& vm, JSC::JSGlobalObject* globalObject);
+
+ DECLARE_INFO;
RequireFunctionPrototype(
JSC::VM& vm,
@@ -149,12 +162,11 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(RequireFunctionPrototype, Base);
return &vm.plainObjectSpace();
}
- DECLARE_INFO;
-
- void finishCreation(JSC::VM& vm);
+ void finishCreation(JSC::VM&);
};
} // namespace Bun
diff --git a/src/bun.js/bindings/DOMURL.cpp b/src/bun.js/bindings/DOMURL.cpp
index 31381b867..b88161a4d 100644
--- a/src/bun.js/bindings/DOMURL.cpp
+++ b/src/bun.js/bindings/DOMURL.cpp
@@ -36,26 +36,45 @@
namespace WebCore {
+static inline String redact(const String& input)
+{
+ if (input.contains("@"_s))
+ return "<redacted>"_s;
+
+ return makeString('"', input, '"');
+}
+
inline DOMURL::DOMURL(URL&& completeURL, const URL& baseURL)
: m_baseURL(baseURL)
, m_url(WTFMove(completeURL))
{
}
+DOMURL::~DOMURL() = default;
+
+bool DOMURL::canParse(const String& url, const String& base)
+{
+ URL baseURL { base };
+ if (!base.isNull() && !baseURL.isValid())
+ return false;
+ URL completeURL { baseURL, url };
+ return completeURL.isValid();
+}
+
ExceptionOr<Ref<DOMURL>> DOMURL::create(const String& url, const URL& base)
{
ASSERT(base.isValid() || base.isNull());
URL completeURL { base, url };
if (!completeURL.isValid())
- return Exception { TypeError };
+ return Exception { TypeError, makeString(redact(url), " cannot be parsed as a URL.") };
return adoptRef(*new DOMURL(WTFMove(completeURL), base));
}
ExceptionOr<Ref<DOMURL>> DOMURL::create(const String& url, const String& base)
{
- URL baseURL { URL {}, base };
+ URL baseURL { base };
if (!base.isNull() && !baseURL.isValid())
- return Exception { TypeError };
+ return Exception { TypeError, makeString(redact(url), " cannot be parsed as a URL against "_s, redact(base)) };
return create(url, baseURL);
}
@@ -64,13 +83,13 @@ ExceptionOr<Ref<DOMURL>> DOMURL::create(const String& url, const DOMURL& base)
return create(url, base.href());
}
-DOMURL::~DOMURL() = default;
-
ExceptionOr<void> DOMURL::setHref(const String& url)
{
URL completeURL { URL {}, url };
- if (!completeURL.isValid())
- return Exception { TypeError };
+ if (!completeURL.isValid()) {
+
+ return Exception { TypeError, makeString(redact(url), " cannot be parsed as a URL.") };
+ }
m_url = WTFMove(completeURL);
if (m_searchParams)
m_searchParams->updateFromAssociatedURL();
diff --git a/src/bun.js/bindings/DOMURL.h b/src/bun.js/bindings/DOMURL.h
index 0a6210690..0f19510b6 100644
--- a/src/bun.js/bindings/DOMURL.h
+++ b/src/bun.js/bindings/DOMURL.h
@@ -43,6 +43,7 @@ public:
static ExceptionOr<Ref<DOMURL>> create(const String& url, const DOMURL& base);
~DOMURL();
+ static bool canParse(const String& url, const String& base);
const URL& href() const { return m_url; }
ExceptionOr<void> setHref(const String&);
void setQuery(const String&);
diff --git a/src/bun.js/bindings/ErrorStackTrace.cpp b/src/bun.js/bindings/ErrorStackTrace.cpp
index a8c5b65d8..f7013c9c4 100644
--- a/src/bun.js/bindings/ErrorStackTrace.cpp
+++ b/src/bun.js/bindings/ErrorStackTrace.cpp
@@ -12,6 +12,7 @@
#include <JavaScriptCore/JSCInlines.h>
#include <JavaScriptCore/ErrorInstance.h>
#include <JavaScriptCore/StackVisitor.h>
+#include <JavaScriptCore/NativeCallee.h>
#include <wtf/IterationStatus.h>
using namespace JSC;
@@ -130,8 +131,8 @@ JSCStackFrame::JSCStackFrame(JSC::VM& vm, JSC::StackVisitor& visitor)
: m_vm(vm)
, m_codeBlock(nullptr)
, m_bytecodeIndex(JSC::BytecodeIndex())
- , m_sourceURL(nullptr)
- , m_functionName(nullptr)
+ , m_sourceURL()
+ , m_functionName()
, m_isWasmFrame(false)
, m_sourcePositionsState(SourcePositionsState::NotCalculated)
{
@@ -139,9 +140,18 @@ JSCStackFrame::JSCStackFrame(JSC::VM& vm, JSC::StackVisitor& visitor)
m_callFrame = visitor->callFrame();
// Based on JSC's GetStackTraceFunctor (Interpreter.cpp)
- if (visitor->isWasmFrame()) {
- m_wasmFunctionIndexOrName = visitor->wasmFunctionIndexOrName();
- m_isWasmFrame = true;
+ if (visitor->isNativeCalleeFrame()) {
+ auto* nativeCallee = visitor->callee().asNativeCallee();
+ switch (nativeCallee->category()) {
+ case NativeCallee::Category::Wasm: {
+ m_wasmFunctionIndexOrName = visitor->wasmFunctionIndexOrName();
+ m_isWasmFrame = true;
+ break;
+ }
+ case NativeCallee::Category::InlineCache: {
+ break;
+ }
+ }
} else if (!!visitor->codeBlock() && !visitor->codeBlock()->unlinkedCodeBlock()->isBuiltinFunction()) {
m_codeBlock = visitor->codeBlock();
m_bytecodeIndex = visitor->bytecodeIndex();
@@ -153,8 +163,8 @@ JSCStackFrame::JSCStackFrame(JSC::VM& vm, const JSC::StackFrame& frame)
, m_callFrame(nullptr)
, m_codeBlock(nullptr)
, m_bytecodeIndex(JSC::BytecodeIndex())
- , m_sourceURL(nullptr)
- , m_functionName(nullptr)
+ , m_sourceURL()
+ , m_functionName()
, m_isWasmFrame(false)
, m_sourcePositionsState(SourcePositionsState::NotCalculated)
{
@@ -183,7 +193,7 @@ JSC::JSString* JSCStackFrame::sourceURL()
m_sourceURL = retrieveSourceURL();
}
- return m_sourceURL;
+ return jsString(this->m_vm, m_sourceURL);
}
JSC::JSString* JSCStackFrame::functionName()
@@ -192,7 +202,7 @@ JSC::JSString* JSCStackFrame::functionName()
m_functionName = retrieveFunctionName();
}
- return m_functionName;
+ return jsString(this->m_vm, m_functionName);
}
JSC::JSString* JSCStackFrame::typeName()
@@ -201,7 +211,7 @@ JSC::JSString* JSCStackFrame::typeName()
m_typeName = retrieveTypeName();
}
- return m_typeName;
+ return jsString(this->m_vm, m_typeName);
}
JSCStackFrame::SourcePositions* JSCStackFrame::getSourcePositions()
@@ -213,91 +223,61 @@ JSCStackFrame::SourcePositions* JSCStackFrame::getSourcePositions()
return (SourcePositionsState::Calculated == m_sourcePositionsState) ? &m_sourcePositions : nullptr;
}
-ALWAYS_INLINE JSC::JSString* JSCStackFrame::retrieveSourceURL()
+ALWAYS_INLINE String JSCStackFrame::retrieveSourceURL()
{
static auto sourceURLWasmString = MAKE_STATIC_STRING_IMPL("[wasm code]");
static auto sourceURLNativeString = MAKE_STATIC_STRING_IMPL("[native code]");
if (m_isWasmFrame) {
- return jsOwnedString(m_vm, sourceURLWasmString);
+ return String(sourceURLWasmString);
}
if (!m_codeBlock) {
- return jsOwnedString(m_vm, sourceURLNativeString);
+ return String(sourceURLNativeString);
}
- String sourceURL = m_codeBlock->ownerExecutable()->sourceURL();
- return sourceURL.isNull() ? m_vm.smallStrings.emptyString() : JSC::jsString(m_vm, sourceURL);
+ return m_codeBlock->ownerExecutable()->sourceURL();
}
-ALWAYS_INLINE JSC::JSString* JSCStackFrame::retrieveFunctionName()
+ALWAYS_INLINE String JSCStackFrame::retrieveFunctionName()
{
static auto functionNameEvalCodeString = MAKE_STATIC_STRING_IMPL("eval code");
static auto functionNameModuleCodeString = MAKE_STATIC_STRING_IMPL("module code");
static auto functionNameGlobalCodeString = MAKE_STATIC_STRING_IMPL("global code");
if (m_isWasmFrame) {
- return jsString(m_vm, JSC::Wasm::makeString(m_wasmFunctionIndexOrName));
+ return JSC::Wasm::makeString(m_wasmFunctionIndexOrName);
}
if (m_codeBlock) {
switch (m_codeBlock->codeType()) {
case JSC::EvalCode:
- return JSC::jsOwnedString(m_vm, functionNameEvalCodeString);
+ return String(functionNameEvalCodeString);
case JSC::ModuleCode:
- return JSC::jsOwnedString(m_vm, functionNameModuleCodeString);
+ return String(functionNameModuleCodeString);
case JSC::FunctionCode:
break;
case JSC::GlobalCode:
- return JSC::jsOwnedString(m_vm, functionNameGlobalCodeString);
+ return String(functionNameGlobalCodeString);
default:
ASSERT_NOT_REACHED();
}
}
- if (!m_callee || !m_callee->isObject()) {
- return m_vm.smallStrings.emptyString();
- }
-
- JSC::JSObject* calleeAsObject = JSC::jsCast<JSC::JSObject*>(m_callee);
-
- // First, try the "displayName" property
- JSC::JSValue displayName = calleeAsObject->getDirect(m_vm, m_vm.propertyNames->displayName);
- if (displayName && isJSString(displayName)) {
- return JSC::asString(displayName);
- }
-
- // Our addition - if there's no "dispalyName" property, try the "name" property
- JSC::JSValue name = calleeAsObject->getDirect(m_vm, m_vm.propertyNames->name);
- if (name && isJSString(name)) {
- return JSC::asString(name);
- }
-
- /* For functions (either JSFunction or InternalFunction), fallback to their "native" name property.
- * Based on JSC::getCalculatedDisplayName, "inlining" the
- * JSFunction::calculatedDisplayName\InternalFunction::calculatedDisplayName calls */
- if (JSC::JSFunction* function = JSC::jsDynamicCast<JSC::JSFunction*>(calleeAsObject)) {
- // Based on JSC::JSFunction::calculatedDisplayName, skipping the "displayName" property check
- WTF::String actualName = function->name(m_vm);
- if (!actualName.isEmpty() || function->isHostOrBuiltinFunction()) {
- return JSC::jsString(m_vm, actualName);
- }
-
- return JSC::jsString(m_vm, function->jsExecutable()->name().string());
- }
- if (JSC::InternalFunction* function = JSC::jsDynamicCast<JSC::InternalFunction*>(calleeAsObject)) {
- // Based on JSC::InternalFunction::calculatedDisplayName, skipping the "displayName" property check
- return JSC::jsString(m_vm, function->name());
+ String name;
+ if (m_callee) {
+ if (m_callee->isObject())
+ name = getCalculatedDisplayName(m_vm, jsCast<JSObject*>(m_callee)).impl();
}
- return m_vm.smallStrings.emptyString();
+ return name.isNull() ? emptyString() : name;
}
-ALWAYS_INLINE JSC::JSString* JSCStackFrame::retrieveTypeName()
+ALWAYS_INLINE String JSCStackFrame::retrieveTypeName()
{
JSC::JSObject* calleeObject = JSC::jsCast<JSC::JSObject*>(m_callee);
// return JSC::jsTypeStringForValue(m_globalObjectcalleeObject->toThis()
- return jsString(m_vm, makeString(calleeObject->className()));
+ return calleeObject->className();
}
// General flow here is based on JSC's appendSourceToError (ErrorInstance.cpp)
diff --git a/src/bun.js/bindings/ErrorStackTrace.h b/src/bun.js/bindings/ErrorStackTrace.h
index 1284376a4..ac40eaf4b 100644
--- a/src/bun.js/bindings/ErrorStackTrace.h
+++ b/src/bun.js/bindings/ErrorStackTrace.h
@@ -61,9 +61,9 @@ private:
JSC::BytecodeIndex m_bytecodeIndex;
// Lazy-initialized
- JSC::JSString* m_sourceURL;
- JSC::JSString* m_functionName;
- JSC::JSString* m_typeName;
+ WTF::String m_sourceURL;
+ WTF::String m_functionName;
+ WTF::String m_typeName;
// m_wasmFunctionIndexOrName has meaning only when m_isWasmFrame is set
JSC::Wasm::IndexOrName m_wasmFunctionIndexOrName;
@@ -105,7 +105,7 @@ public:
bool isConstructor() const { return m_codeBlock && (JSC::CodeForConstruct == m_codeBlock->specializationKind()); }
private:
- ALWAYS_INLINE JSC::JSString* retrieveSourceURL();
+ ALWAYS_INLINE String retrieveSourceURL();
/* Regarding real functions (not eval\module\global code), both v8 and JSC seem to follow
* the same logic, which is to first try the function's "display name", and if it's not defined,
@@ -119,9 +119,9 @@ private:
* and just try to use the "name" property when needed, so our lookup will be:
* "display name" property -> "name" property -> JSFunction\InternalFunction "name" methods.
*/
- ALWAYS_INLINE JSC::JSString* retrieveFunctionName();
+ ALWAYS_INLINE String retrieveFunctionName();
- ALWAYS_INLINE JSC::JSString* retrieveTypeName();
+ ALWAYS_INLINE String retrieveTypeName();
bool calculateSourcePositions();
};
diff --git a/src/bun.js/bindings/FFI.zig b/src/bun.js/bindings/FFI.zig
index 9d16bd78e..da98438ba 100644
--- a/src/bun.js/bindings/FFI.zig
+++ b/src/bun.js/bindings/FFI.zig
@@ -20,8 +20,9 @@ pub const EncodedJSValue = union_EncodedJSValue;
pub export var ValueUndefined: EncodedJSValue = EncodedJSValue{
.asInt64 = @as(i64, @bitCast(@as(c_longlong, @as(c_int, 2) | @as(c_int, 8)))),
};
+pub const TrueI64 = @as(i64, @bitCast(@as(c_longlong, (@as(c_int, 2) | @as(c_int, 4)) | @as(c_int, 1))));
pub export var ValueTrue: EncodedJSValue = EncodedJSValue{
- .asInt64 = @as(i64, @bitCast(@as(c_longlong, (@as(c_int, 2) | @as(c_int, 4)) | @as(c_int, 1)))),
+ .asInt64 = TrueI64,
};
pub const JSContext = ?*anyopaque;
pub inline fn JSVALUE_IS_CELL(arg_val: EncodedJSValue) bool {
diff --git a/src/bun.js/bindings/ImportMetaObject.cpp b/src/bun.js/bindings/ImportMetaObject.cpp
index 4160102a5..199a13392 100644
--- a/src/bun.js/bindings/ImportMetaObject.cpp
+++ b/src/bun.js/bindings/ImportMetaObject.cpp
@@ -64,6 +64,12 @@ static EncodedJSValue functionRequireResolve(JSC::JSGlobalObject* globalObject,
JSC::JSValue moduleName = callFrame->argument(0);
auto doIt = [&](const WTF::String& fromStr) -> JSC::EncodedJSValue {
+ if (auto* virtualModules = jsCast<Zig::GlobalObject*>(globalObject)->onLoadPlugins.virtualModules) {
+ if (virtualModules->contains(fromStr)) {
+ return JSC::JSValue::encode(jsString(vm, fromStr));
+ }
+ }
+
BunString from = Bun::toString(fromStr);
auto result = Bun__resolveSyncWithSource(globalObject, JSC::JSValue::encode(moduleName), &from, false);
@@ -160,6 +166,14 @@ extern "C" EncodedJSValue functionImportMeta__resolveSync(JSC::JSGlobalObject* g
JSC__JSValue from;
bool isESM = true;
+ if (auto* virtualModules = jsCast<Zig::GlobalObject*>(globalObject)->onLoadPlugins.virtualModules) {
+ if (moduleName.isString()) {
+ if (virtualModules->contains(moduleName.toWTFString(globalObject))) {
+ return JSC::JSValue::encode(moduleName);
+ }
+ }
+ }
+
if (callFrame->argumentCount() > 1) {
if (callFrame->argumentCount() > 2) {
@@ -226,6 +240,7 @@ extern "C" EncodedJSValue functionImportMeta__resolveSyncPrivate(JSC::JSGlobalOb
{
JSC::VM& vm = globalObject->vm();
auto scope = DECLARE_THROW_SCOPE(globalObject->vm());
+ auto* global = jsDynamicCast<Zig::GlobalObject*>(globalObject);
JSC::JSValue moduleName = callFrame->argument(0);
JSValue from = callFrame->argument(1);
@@ -239,12 +254,19 @@ extern "C" EncodedJSValue functionImportMeta__resolveSyncPrivate(JSC::JSGlobalOb
RETURN_IF_EXCEPTION(scope, JSC::JSValue::encode(JSC::JSValue {}));
+ if (auto* virtualModules = global->onLoadPlugins.virtualModules) {
+ if (moduleName.isString()) {
+ if (virtualModules->contains(moduleName.toWTFString(globalObject))) {
+ return JSC::JSValue::encode(moduleName);
+ }
+ }
+ }
+
if (!isESM) {
- auto* global = jsDynamicCast<Zig::GlobalObject*>(globalObject);
if (LIKELY(global)) {
auto overrideHandler = global->m_nodeModuleOverriddenResolveFilename.get();
if (UNLIKELY(overrideHandler)) {
- ASSERT(overrideHandler.isCallable(globalObject));
+ ASSERT(overrideHandler->isCallable());
MarkedArgumentBuffer args;
args.append(moduleName);
args.append(from);
@@ -289,6 +311,14 @@ JSC_DEFINE_HOST_FUNCTION(functionImportMeta__resolve,
JSC__JSValue from;
+ if (auto* virtualModules = jsCast<Zig::GlobalObject*>(globalObject)->onLoadPlugins.virtualModules) {
+ if (moduleName.isString()) {
+ if (virtualModules->contains(moduleName.toWTFString(globalObject))) {
+ return JSC::JSValue::encode(moduleName);
+ }
+ }
+ }
+
if (callFrame->argumentCount() > 1 && callFrame->argument(1).isString()) {
from = JSC::JSValue::encode(callFrame->argument(1));
} else {
@@ -404,6 +434,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(ImportMetaObjectPrototype, Base);
return &vm.plainObjectSpace();
}
@@ -417,11 +448,13 @@ public:
reifyStaticProperties(vm, ImportMetaObject::info(), ImportMetaObjectPrototypeValues, *this);
JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
- this->putDirect(
- vm,
+ auto mainGetter = JSFunction::create(vm, importMetaObjectMainCodeGenerator(vm), globalObject);
+
+ this->putDirectAccessor(
+ this->globalObject(),
builtinNames.mainPublicName(),
- GetterSetter::create(vm, globalObject, JSFunction::create(vm, importMetaObjectMainCodeGenerator(vm), globalObject), nullptr),
- JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin | 0);
+ GetterSetter::create(vm, globalObject, mainGetter, mainGetter),
+ JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | 0);
}
ImportMetaObjectPrototype(JSC::VM& vm, JSC::Structure* structure)
@@ -433,7 +466,7 @@ public:
const ClassInfo ImportMetaObjectPrototype::s_info = {
"ImportMeta"_s,
- Base::info(), nullptr, nullptr, CREATE_METHOD_TABLE(ImportMetaObjectPrototype)
+ &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(ImportMetaObjectPrototype)
};
JSC::Structure* ImportMetaObject::createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject)
diff --git a/src/bun.js/bindings/InternalModuleRegistry.cpp b/src/bun.js/bindings/InternalModuleRegistry.cpp
index 8dbf42a02..03f946192 100644
--- a/src/bun.js/bindings/InternalModuleRegistry.cpp
+++ b/src/bun.js/bindings/InternalModuleRegistry.cpp
@@ -33,7 +33,9 @@ static void maybeAddCodeCoverage(JSC::VM& vm, const JSC::SourceCode& code)
#define INTERNAL_MODULE_REGISTRY_GENERATE_(globalObject, vm, SOURCE, moduleName, urlString) \
auto throwScope = DECLARE_THROW_SCOPE(vm); \
auto&& origin = SourceOrigin(WTF::URL(urlString)); \
- SourceCode source = JSC::makeSource(SOURCE, origin, moduleName); \
+ SourceCode source = JSC::makeSource(SOURCE, origin, \
+ JSC::SourceTaintedOrigin::Untainted, \
+ moduleName); \
maybeAddCodeCoverage(vm, source); \
JSFunction* func \
= JSFunction::create( \
@@ -118,16 +120,23 @@ DEFINE_VISIT_CHILDREN_WITH_MODIFIER(JS_EXPORT_PRIVATE, InternalModuleRegistry);
InternalModuleRegistry* InternalModuleRegistry::create(VM& vm, Structure* structure)
{
InternalModuleRegistry* registry = new (NotNull, allocateCell<InternalModuleRegistry>(vm)) InternalModuleRegistry(vm, structure);
+ registry->finishCreation(vm);
+ return registry;
+}
+
+void InternalModuleRegistry::finishCreation(VM& vm)
+{
+ Base::finishCreation(vm);
+ ASSERT(inherits(info()));
+
for (uint8_t i = 0; i < BUN_INTERNAL_MODULE_COUNT; i++) {
- registry->internalField(static_cast<Field>(i))
- .set(vm, registry, jsUndefined());
+ this->internalField(static_cast<Field>(i)).set(vm, this, jsUndefined());
}
- return registry;
}
Structure* InternalModuleRegistry::createStructure(VM& vm, JSGlobalObject* globalObject)
{
- return Structure::create(vm, globalObject, jsNull(), TypeInfo(InternalFieldTupleType, StructureFlags), info(), 0, 48);
+ return Structure::create(vm, globalObject, jsNull(), TypeInfo(InternalFieldTupleType, StructureFlags), info(), 0, 0);
}
JSValue InternalModuleRegistry::requireId(JSGlobalObject* globalObject, VM& vm, Field id)
@@ -150,7 +159,7 @@ JSC_DEFINE_HOST_FUNCTION(InternalModuleRegistry::jsCreateInternalModuleById, (JS
auto throwScope = DECLARE_THROW_SCOPE(vm);
auto id = callframe->argument(0).toUInt32(lexicalGlobalObject);
- auto registry = static_cast<Zig::GlobalObject*>(lexicalGlobalObject)->internalModuleRegistry();
+ auto registry = jsCast<Zig::GlobalObject*>(lexicalGlobalObject)->internalModuleRegistry();
auto mod = registry->createInternalModuleById(lexicalGlobalObject, vm, static_cast<Field>(id));
RETURN_IF_EXCEPTION(throwScope, {});
registry->internalField(static_cast<Field>(id)).set(vm, registry, mod);
diff --git a/src/bun.js/bindings/InternalModuleRegistry.h b/src/bun.js/bindings/InternalModuleRegistry.h
index d14625e00..0944a382a 100644
--- a/src/bun.js/bindings/InternalModuleRegistry.h
+++ b/src/bun.js/bindings/InternalModuleRegistry.h
@@ -16,19 +16,21 @@ using namespace JSC;
// - some are written in JS (src/js, there is a readme file that explain those files more.
// - others are native code (src/bun.js/modules), see _NativeModule.h in there.
class InternalModuleRegistry : public JSInternalFieldObjectImpl<BUN_INTERNAL_MODULE_COUNT> {
-protected:
- JS_EXPORT_PRIVATE InternalModuleRegistry(VM&, Structure*);
- DECLARE_DEFAULT_FINISH_CREATION;
- DECLARE_VISIT_CHILDREN_WITH_MODIFIER(JS_EXPORT_PRIVATE);
-
public:
using Base = JSInternalFieldObjectImpl<BUN_INTERNAL_MODULE_COUNT>;
DECLARE_EXPORT_INFO;
+ static size_t allocationSize(Checked<size_t> inlineCapacity)
+ {
+ ASSERT_UNUSED(inlineCapacity, inlineCapacity == 0U);
+ return sizeof(InternalModuleRegistry);
+ }
+
enum Field : uint8_t {
#include "../../../src/js/out/InternalModuleRegistry+enum.h"
};
+
const WriteBarrier<Unknown>& internalField(Field field) const { return Base::internalField(static_cast<uint32_t>(field)); }
WriteBarrier<Unknown>& internalField(Field field) { return Base::internalField(static_cast<uint32_t>(field)); }
@@ -52,8 +54,11 @@ public:
static JSC_DECLARE_HOST_FUNCTION(jsCreateInternalModuleById);
-protected:
+private:
+ JS_EXPORT_PRIVATE InternalModuleRegistry(VM&, Structure*);
+ DECLARE_VISIT_CHILDREN_WITH_MODIFIER(JS_EXPORT_PRIVATE);
JSValue createInternalModuleById(JSGlobalObject* globalObject, VM& vm, Field id);
+ void finishCreation(VM&);
};
} // namespace Bun
diff --git a/src/bun.js/bindings/JSBuffer.cpp b/src/bun.js/bindings/JSBuffer.cpp
index 9227e47b3..524007f86 100644
--- a/src/bun.js/bindings/JSBuffer.cpp
+++ b/src/bun.js/bindings/JSBuffer.cpp
@@ -819,6 +819,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSBufferPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -865,28 +866,49 @@ static inline JSC::EncodedJSValue jsBufferPrototypeFunction_compareBody(JSC::JSG
size_t sourceEndInit = castedThis->byteLength();
size_t sourceEnd = sourceEndInit;
+ JSValue targetStartValue = jsUndefined();
+ JSValue targetEndValue = jsUndefined();
+ JSValue sourceStartValue = jsUndefined();
+ JSValue sourceEndValue = jsUndefined();
+
switch (callFrame->argumentCount()) {
default:
- sourceEnd = parseIndex(lexicalGlobalObject, throwScope, callFrame->uncheckedArgument(4));
- RETURN_IF_EXCEPTION(throwScope, JSValue::encode(jsUndefined()));
+ sourceEndValue = callFrame->uncheckedArgument(4);
FALLTHROUGH;
case 4:
- sourceStart = parseIndex(lexicalGlobalObject, throwScope, callFrame->uncheckedArgument(3));
- RETURN_IF_EXCEPTION(throwScope, JSValue::encode(jsUndefined()));
+ sourceStartValue = callFrame->uncheckedArgument(3);
FALLTHROUGH;
case 3:
- targetEnd = parseIndex(lexicalGlobalObject, throwScope, callFrame->uncheckedArgument(2));
- RETURN_IF_EXCEPTION(throwScope, JSValue::encode(jsUndefined()));
+ targetEndValue = callFrame->uncheckedArgument(2);
FALLTHROUGH;
case 2:
- targetStart = parseIndex(lexicalGlobalObject, throwScope, callFrame->uncheckedArgument(1));
- RETURN_IF_EXCEPTION(throwScope, JSValue::encode(jsUndefined()));
+ targetStartValue = callFrame->uncheckedArgument(1);
break;
case 1:
case 0:
break;
}
+ if (!targetStartValue.isUndefined()) {
+ targetStart = parseIndex(lexicalGlobalObject, throwScope, callFrame->uncheckedArgument(1));
+ RETURN_IF_EXCEPTION(throwScope, JSValue::encode(jsUndefined()));
+ }
+
+ if (!targetEndValue.isUndefined()) {
+ targetEnd = parseIndex(lexicalGlobalObject, throwScope, callFrame->uncheckedArgument(2));
+ RETURN_IF_EXCEPTION(throwScope, JSValue::encode(jsUndefined()));
+ }
+
+ if (!sourceStartValue.isUndefined()) {
+ sourceStart = parseIndex(lexicalGlobalObject, throwScope, callFrame->uncheckedArgument(3));
+ RETURN_IF_EXCEPTION(throwScope, JSValue::encode(jsUndefined()));
+ }
+
+ if (!sourceEndValue.isUndefined()) {
+ sourceEnd = parseIndex(lexicalGlobalObject, throwScope, callFrame->uncheckedArgument(4));
+ RETURN_IF_EXCEPTION(throwScope, JSValue::encode(jsUndefined()));
+ }
+
targetStart = std::min(targetStart, std::min(targetEnd, targetEndInit));
sourceStart = std::min(sourceStart, std::min(sourceEnd, sourceEndInit));
@@ -931,24 +953,40 @@ static inline JSC::EncodedJSValue jsBufferPrototypeFunction_copyBody(JSC::JSGlob
size_t sourceEndInit = castedThis->byteLength();
size_t sourceEnd = sourceEndInit;
+ JSValue targetStartValue = jsUndefined();
+ JSValue sourceStartValue = jsUndefined();
+ JSValue sourceEndValue = jsUndefined();
+
switch (callFrame->argumentCount()) {
default:
- sourceEnd = parseIndex(lexicalGlobalObject, throwScope, callFrame->uncheckedArgument(3));
- RETURN_IF_EXCEPTION(throwScope, JSValue::encode(jsUndefined()));
+ sourceEndValue = callFrame->uncheckedArgument(3);
FALLTHROUGH;
case 3:
- sourceStart = parseIndex(lexicalGlobalObject, throwScope, callFrame->uncheckedArgument(2));
- RETURN_IF_EXCEPTION(throwScope, JSValue::encode(jsUndefined()));
+ sourceStartValue = callFrame->uncheckedArgument(2);
FALLTHROUGH;
case 2:
- targetStart = parseIndex(lexicalGlobalObject, throwScope, callFrame->uncheckedArgument(1));
- RETURN_IF_EXCEPTION(throwScope, JSValue::encode(jsUndefined()));
+ targetStartValue = callFrame->uncheckedArgument(1);
break;
case 1:
case 0:
break;
}
+ if (!targetStartValue.isUndefined()) {
+ targetStart = parseIndex(lexicalGlobalObject, throwScope, callFrame->uncheckedArgument(1));
+ RETURN_IF_EXCEPTION(throwScope, JSValue::encode(jsUndefined()));
+ }
+
+ if (!sourceStartValue.isUndefined()) {
+ sourceStart = parseIndex(lexicalGlobalObject, throwScope, callFrame->uncheckedArgument(2));
+ RETURN_IF_EXCEPTION(throwScope, JSValue::encode(jsUndefined()));
+ }
+
+ if (!sourceEndValue.isUndefined()) {
+ sourceEnd = parseIndex(lexicalGlobalObject, throwScope, callFrame->uncheckedArgument(3));
+ RETURN_IF_EXCEPTION(throwScope, JSValue::encode(jsUndefined()));
+ }
+
targetStart = std::min(targetStart, targetEnd);
sourceEnd = std::min(sourceEnd, sourceEndInit);
sourceStart = std::min(sourceStart, sourceEnd);
@@ -1614,7 +1652,7 @@ JSC_DEFINE_HOST_FUNCTION(jsBufferConstructorFunction_toBuffer, (JSGlobalObject *
class JSBufferConstructor final : public JSC::InternalFunction {
public:
using Base = JSC::InternalFunction;
- static constexpr unsigned StructureFlags = Base::StructureFlags;
+ static constexpr unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
~JSBufferConstructor() = default;
@@ -1700,8 +1738,6 @@ JSC_DEFINE_JIT_OPERATION(jsBufferConstructorAllocUnsafeSlowWithoutTypeChecks, JS
JSC_ANNOTATE_HOST_FUNCTION(JSBufferConstructorConstruct, JSBufferConstructor::construct);
-const ClassInfo JSBufferConstructor::s_info = { "Buffer"_s, nullptr, nullptr, nullptr, CREATE_METHOD_TABLE(JSBufferConstructor) };
-
class JSBuffer : public JSC::JSNonFinalObject {
DECLARE_INFO;
@@ -1790,8 +1826,8 @@ static const HashTableValue JSBufferPrototypeTableValues[]
{ "lastIndexOf"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferPrototypeFunction_lastIndexOf, 3 } },
{ "latin1Slice"_s, static_cast<unsigned>(JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, jsBufferPrototypeLatin1SliceCodeGenerator, 2 } },
{ "latin1Write"_s, static_cast<unsigned>(JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, jsBufferPrototypeLatin1WriteCodeGenerator, 1 } },
- { "offset"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, jsBufferPrototypeOffsetCodeGenerator, 0 } },
- { "parent"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, jsBufferPrototypeParentCodeGenerator, 0 } },
+ { "offset"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinAccessorType, jsBufferPrototypeOffsetCodeGenerator, 0 } },
+ { "parent"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinAccessorType, jsBufferPrototypeParentCodeGenerator, 0 } },
{ "readBigInt64"_s, static_cast<unsigned>(JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, jsBufferPrototypeReadBigInt64LECodeGenerator, 1 } },
{ "readBigInt64BE"_s, static_cast<unsigned>(JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, jsBufferPrototypeReadBigInt64BECodeGenerator, 1 } },
{ "readBigInt64LE"_s, static_cast<unsigned>(JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, jsBufferPrototypeReadBigInt64LECodeGenerator, 1 } },
@@ -1899,8 +1935,7 @@ const ClassInfo JSBufferPrototype::s_info = {
// We must use the same naming convention to match Node
// Some packages (like MongoDB's official Node.js client) rely on this behavior.
"Uint8Array"_s,
-
- nullptr, nullptr, nullptr, CREATE_METHOD_TABLE(JSBufferPrototype)
+ &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSBufferPrototype)
};
static const JSC::DOMJIT::Signature DOMJITSignaturejsBufferConstructorAlloc(jsBufferConstructorAllocWithoutTypeChecks,
@@ -1917,27 +1952,27 @@ static const JSC::DOMJIT::Signature DOMJITSignaturejsBufferConstructorAllocUnsaf
JSC::DOMJIT::Effect::forWriteKinds(JSC::DFG::AbstractHeapKind::Heap),
JSC::SpecUint8Array, JSC::SpecInt32Only);
-/* Hash table for constructor */
-static const HashTableValue JSBufferConstructorTableValues[] = {
- // { "alloc"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction), NoIntrinsic, { HashTableValue::DOMJITFunctionType, jsBufferConstructorFunction_alloc, &DOMJITSignaturejsBufferConstructorAlloc } },
- { "alloc"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_alloc, 1 } },
- // { "allocUnsafe"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction), NoIntrinsic, { HashTableValue::DOMJITFunctionType, jsBufferConstructorFunction_allocUnsafe, &DOMJITSignaturejsBufferConstructorAllocUnsafe } },
- { "allocUnsafe"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_allocUnsafe, 1 } },
- // { "allocUnsafeSlow"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction), NoIntrinsic, { HashTableValue::DOMJITFunctionType, jsBufferConstructorFunction_allocUnsafeSlow, &DOMJITSignaturejsBufferConstructorAllocUnsafeSlow } },
- { "allocUnsafeSlow"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_allocUnsafeSlow, 1 } },
- { "byteLength"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_byteLength, 2 } },
- { "compare"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_compare, 2 } },
- { "concat"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_concat, 2 } },
- { "from"_s, static_cast<unsigned>(JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, jsBufferConstructorFromCodeGenerator, 1 } },
- { "isBuffer"_s, static_cast<unsigned>(JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, jsBufferConstructorIsBufferCodeGenerator, 1 } },
- { "toBuffer"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_toBuffer, 1 } },
- { "isEncoding"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_isEncoding, 1 } },
-};
+/* Source for JSBuffer.lut.h
+@begin jsBufferConstructorTable
+ alloc jsBufferConstructorFunction_alloc Constructable|Function 1
+ allocUnsafe jsBufferConstructorFunction_allocUnsafe Constructable|Function 1
+ allocUnsafeSlow jsBufferConstructorFunction_allocUnsafeSlow Constructable|Function 1
+ byteLength jsBufferConstructorFunction_byteLength Function 2
+ compare jsBufferConstructorFunction_compare Function 2
+ concat jsBufferConstructorFunction_concat Function 2
+ from JSBuiltin Builtin|Function 1
+ isBuffer JSBuiltin Builtin|Function 1
+ toBuffer jsBufferConstructorFunction_toBuffer Function 1
+ isEncoding jsBufferConstructorFunction_isEncoding Function 1
+@end
+*/
+#include "JSBuffer.lut.h"
+
+const ClassInfo JSBufferConstructor::s_info = { "Buffer"_s, &Base::s_info, &jsBufferConstructorTable, nullptr, CREATE_METHOD_TABLE(JSBufferConstructor) };
void JSBufferConstructor::finishCreation(VM& vm, JSGlobalObject* globalObject, JSC::JSObject* prototype)
{
Base::finishCreation(vm, 3, "Buffer"_s, PropertyAdditionMode::WithoutStructureTransition);
- reifyStaticProperties(vm, JSBufferConstructor::info(), JSBufferConstructorTableValues, *this);
putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
prototype->putDirect(vm, vm.propertyNames->speciesSymbol, this, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
}
diff --git a/src/bun.js/bindings/JSBuffer.lut.h b/src/bun.js/bindings/JSBuffer.lut.h
new file mode 100644
index 000000000..35a3acea9
--- /dev/null
+++ b/src/bun.js/bindings/JSBuffer.lut.h
@@ -0,0 +1,52 @@
+// File generated via `make static-hash-table` / `make cpp`
+static const struct CompactHashIndex jsBufferConstructorTableIndex[33] = {
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 1, 32 },
+ { 0, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 8, -1 },
+ { 3, -1 },
+ { -1, -1 },
+ { 5, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 9, -1 },
+ { -1, -1 },
+ { 4, -1 },
+ { -1, -1 },
+ { 6, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 2, -1 },
+ { -1, -1 },
+ { 7, -1 },
+};
+
+static const struct HashTableValue jsBufferConstructorTableValues[10] = {
+ { "alloc"_s, static_cast<unsigned>(PropertyAttribute::Constructable|PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_alloc, 1 } },
+ { "allocUnsafe"_s, static_cast<unsigned>(PropertyAttribute::Constructable|PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_allocUnsafe, 1 } },
+ { "allocUnsafeSlow"_s, static_cast<unsigned>(PropertyAttribute::Constructable|PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_allocUnsafeSlow, 1 } },
+ { "byteLength"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_byteLength, 2 } },
+ { "compare"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_compare, 2 } },
+ { "concat"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_concat, 2 } },
+ { "from"_s, ((static_cast<unsigned>(PropertyAttribute::Builtin|PropertyAttribute::Function)) & ~PropertyAttribute::Function) | PropertyAttribute::Builtin, NoIntrinsic, { HashTableValue::BuiltinGeneratorType, jsBufferConstructorFromCodeGenerator, 1 } },
+ { "isBuffer"_s, ((static_cast<unsigned>(PropertyAttribute::Builtin|PropertyAttribute::Function)) & ~PropertyAttribute::Function) | PropertyAttribute::Builtin, NoIntrinsic, { HashTableValue::BuiltinGeneratorType, jsBufferConstructorIsBufferCodeGenerator, 1 } },
+ { "toBuffer"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_toBuffer, 1 } },
+ { "isEncoding"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferConstructorFunction_isEncoding, 1 } },
+};
+
+static const struct HashTable jsBufferConstructorTable =
+ { 10, 31, false, nullptr, jsBufferConstructorTableValues, jsBufferConstructorTableIndex };
diff --git a/src/bun.js/bindings/JSBufferList.cpp b/src/bun.js/bindings/JSBufferList.cpp
index a8cefa710..0db5527d7 100644
--- a/src/bun.js/bindings/JSBufferList.cpp
+++ b/src/bun.js/bindings/JSBufferList.cpp
@@ -118,8 +118,7 @@ JSC::JSValue JSBufferList::_getString(JSC::VM& vm, JSC::JSGlobalObject* lexicalG
RELEASE_AND_RETURN(throwScope, JSC::jsEmptyString(vm));
}
- auto iter = m_deque.begin();
- JSC::JSString* str = JSC::jsDynamicCast<JSC::JSString*>(iter->get());
+ JSC::JSString* str = JSC::jsDynamicCast<JSC::JSString*>(m_deque.first().get());
if (UNLIKELY(!str)) {
return throwTypeError(lexicalGlobalObject, throwScope, "_getString can only be called when all buffers are string"_s);
}
@@ -132,13 +131,14 @@ JSC::JSValue JSBufferList::_getString(JSC::VM& vm, JSC::JSGlobalObject* lexicalG
}
if (n < len) {
JSString* firstHalf = JSC::jsSubstring(lexicalGlobalObject, str, 0, n);
- iter->set(vm, this, JSC::jsSubstring(lexicalGlobalObject, str, n, len - n));
+ m_deque.first().set(vm, this, JSC::jsSubstring(lexicalGlobalObject, str, n, len - n));
RELEASE_AND_RETURN(throwScope, firstHalf);
}
JSRopeString::RopeBuilder<RecordOverflow> ropeBuilder(vm);
- for (const auto end = m_deque.end(); iter != end; ++iter) {
- JSC::JSString* str = JSC::jsDynamicCast<JSC::JSString*>(iter->get());
+ while (m_deque.size() > 0) {
+ auto& element = m_deque.first();
+ JSC::JSString* str = JSC::jsDynamicCast<JSC::JSString*>(element.get());
if (UNLIKELY(!str)) {
return throwTypeError(lexicalGlobalObject, throwScope, "_getString can only be called when all buffers are string"_s);
}
@@ -147,7 +147,7 @@ JSC::JSValue JSBufferList::_getString(JSC::VM& vm, JSC::JSGlobalObject* lexicalG
JSString* firstHalf = JSC::jsSubstring(lexicalGlobalObject, str, 0, n);
if (!ropeBuilder.append(firstHalf))
return throwOutOfMemoryError(lexicalGlobalObject, throwScope);
- iter->set(vm, this, JSC::jsSubstring(lexicalGlobalObject, str, n, len - n));
+ element.set(vm, this, JSC::jsSubstring(lexicalGlobalObject, str, n, len - n));
break;
}
if (!ropeBuilder.append(str))
@@ -169,8 +169,7 @@ JSC::JSValue JSBufferList::_getBuffer(JSC::VM& vm, JSC::JSGlobalObject* lexicalG
RELEASE_AND_RETURN(throwScope, JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, 0));
}
- auto iter = m_deque.begin();
- JSC::JSUint8Array* array = JSC::jsDynamicCast<JSC::JSUint8Array*>(iter->get());
+ JSC::JSUint8Array* array = JSC::jsDynamicCast<JSC::JSUint8Array*>(m_deque.first().get());
if (UNLIKELY(!array)) {
return throwTypeError(lexicalGlobalObject, throwScope, "_getBuffer can only be called when all buffers are Uint8Array"_s);
}
@@ -185,7 +184,7 @@ JSC::JSValue JSBufferList::_getBuffer(JSC::VM& vm, JSC::JSGlobalObject* lexicalG
auto buffer = array->possiblySharedBuffer();
JSC::JSUint8Array* retArray = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, buffer, 0, n);
JSC::JSUint8Array* newArray = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, buffer, n, len - n);
- iter->set(vm, this, newArray);
+ m_deque.first().set(vm, this, newArray);
RELEASE_AND_RETURN(throwScope, retArray);
}
@@ -196,8 +195,9 @@ JSC::JSValue JSBufferList::_getBuffer(JSC::VM& vm, JSC::JSGlobalObject* lexicalG
}
JSC::JSUint8Array* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTFMove(arrayBuffer), 0, n);
size_t offset = 0;
- for (const auto end = m_deque.end(); iter != end; ++iter) {
- JSC::JSUint8Array* array = JSC::jsDynamicCast<JSC::JSUint8Array*>(iter->get());
+ while (m_deque.size() > 0) {
+ auto& element = m_deque.first();
+ JSC::JSUint8Array* array = JSC::jsDynamicCast<JSC::JSUint8Array*>(element.get());
if (UNLIKELY(!array)) {
return throwTypeError(lexicalGlobalObject, throwScope, "_getBuffer can only be called when all buffers are Uint8Array"_s);
}
@@ -208,7 +208,7 @@ JSC::JSValue JSBufferList::_getBuffer(JSC::VM& vm, JSC::JSGlobalObject* lexicalG
}
auto buffer = array->possiblySharedBuffer();
JSC::JSUint8Array* newArray = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, buffer, n, len - n);
- iter->set(vm, this, newArray);
+ element.set(vm, this, newArray);
offset += n;
break;
}
@@ -411,11 +411,11 @@ static const HashTableValue JSBufferListPrototypeTableValues[]
void JSBufferListPrototype::finishCreation(VM& vm, JSC::JSGlobalObject* globalThis)
{
Base::finishCreation(vm);
- this->setPrototypeDirect(vm, globalThis->objectPrototype());
reifyStaticProperties(vm, JSBufferList::info(), JSBufferListPrototypeTableValues, *this);
+ ASSERT(inherits(info()));
}
-const ClassInfo JSBufferListPrototype::s_info = { "BufferList"_s, nullptr, nullptr, nullptr, CREATE_METHOD_TABLE(JSBufferListPrototype) };
+const ClassInfo JSBufferListPrototype::s_info = { "BufferList"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSBufferListPrototype) };
void JSBufferListConstructor::finishCreation(VM& vm, JSC::JSGlobalObject* globalObject, JSBufferListPrototype* prototype)
{
diff --git a/src/bun.js/bindings/JSBufferList.h b/src/bun.js/bindings/JSBufferList.h
index 94a69c8d1..ebbc1781e 100644
--- a/src/bun.js/bindings/JSBufferList.h
+++ b/src/bun.js/bindings/JSBufferList.h
@@ -46,7 +46,7 @@ public:
void finishCreation(JSC::VM& vm, JSC::JSGlobalObject* globalObject);
static void destroy(JSCell*) {}
- size_t length() { return m_deque.size(); }
+ inline size_t length() { return m_deque.size(); }
void push(JSC::VM& vm, JSC::JSValue v)
{
m_deque.append(WriteBarrier<Unknown>());
@@ -100,6 +100,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSBufferListPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
diff --git a/src/bun.js/bindings/JSBundlerPlugin.cpp b/src/bun.js/bindings/JSBundlerPlugin.cpp
index 6ae266df7..d896d5b3d 100644
--- a/src/bun.js/bindings/JSBundlerPlugin.cpp
+++ b/src/bun.js/bindings/JSBundlerPlugin.cpp
@@ -31,6 +31,7 @@ namespace Bun {
extern "C" void JSBundlerPlugin__addError(void*, void*, JSC::EncodedJSValue, JSC::EncodedJSValue);
extern "C" void JSBundlerPlugin__onLoadAsync(void*, void*, JSC::EncodedJSValue, JSC::EncodedJSValue);
extern "C" void JSBundlerPlugin__onResolveAsync(void*, void*, JSC::EncodedJSValue, JSC::EncodedJSValue, JSC::EncodedJSValue);
+extern "C" void JSBundlerPlugin__onVirtualModulePlugin(void*, void*, JSC::EncodedJSValue, JSC::EncodedJSValue, JSC::EncodedJSValue);
JSC_DECLARE_HOST_FUNCTION(jsBundlerPluginFunction_addFilter);
JSC_DECLARE_HOST_FUNCTION(jsBundlerPluginFunction_addError);
@@ -154,6 +155,7 @@ public:
Bun::BundlerPlugin plugin;
JSC::LazyProperty<JSBundlerPlugin, JSC::JSFunction> onLoadFunction;
JSC::LazyProperty<JSBundlerPlugin, JSC::JSFunction> onResolveFunction;
+ JSC::LazyProperty<JSBundlerPlugin, JSC::JSFunction> moduleFunction;
JSC::LazyProperty<JSBundlerPlugin, JSC::JSFunction> setupFunction;
private:
diff --git a/src/bun.js/bindings/JSCUSocketsLoopIntegration.cpp b/src/bun.js/bindings/JSCUSocketsLoopIntegration.cpp
new file mode 100644
index 000000000..0e3fcf47d
--- /dev/null
+++ b/src/bun.js/bindings/JSCUSocketsLoopIntegration.cpp
@@ -0,0 +1,30 @@
+#include "root.h"
+#include "JavaScriptCore/VM.h"
+
+// On Linux, signals are used to suspend/resume threads in JavaScriptCore
+// When `.acquireAccess` is called, the signal might be raised.
+// This causes issues with LLDB which might catch the signal.
+// So we want to avoid that, we really only want this code to be executed when the debugger is attached
+// But it's pretty hard to tell if LLDB is attached or not, so we just disable this code on Linux when in debug mode
+#ifndef ACQUIRE_RELEASE_HEAP_ACCESS
+#if OS(DARWIN)
+#define ACQUIRE_RELEASE_HEAP_ACCESS 1
+#else
+#ifndef BUN_DEBUG
+#define ACQUIRE_RELEASE_HEAP_ACCESS 1
+#endif
+#endif
+#endif
+
+extern "C" void bun_on_tick_before(JSC::VM* vm)
+{
+#if ACQUIRE_RELEASE_HEAP_ACCESS
+ // vm->heap.releaseAccess();
+#endif
+}
+extern "C" void bun_on_tick_after(JSC::VM* vm)
+{
+#if ACQUIRE_RELEASE_HEAP_ACCESS
+ // vm->heap.acquireAccess();
+#endif
+} \ No newline at end of file
diff --git a/src/bun.js/bindings/JSDOMFile.cpp b/src/bun.js/bindings/JSDOMFile.cpp
index 1d7770ac1..1e1f9f2bc 100644
--- a/src/bun.js/bindings/JSDOMFile.cpp
+++ b/src/bun.js/bindings/JSDOMFile.cpp
@@ -17,7 +17,7 @@ class JSDOMFile : public JSC::InternalFunction {
public:
JSDOMFile(JSC::VM& vm, JSC::Structure* structure)
- : Base(vm, structure, nullptr, construct)
+ : Base(vm, structure, call, construct)
{
}
@@ -43,7 +43,8 @@ public:
static JSDOMFile* create(JSC::VM& vm, JSGlobalObject* globalObject)
{
auto* zigGlobal = reinterpret_cast<Zig::GlobalObject*>(globalObject);
- auto* object = new (NotNull, JSC::allocateCell<JSDOMFile>(vm)) JSDOMFile(vm, createStructure(vm, globalObject, zigGlobal->functionPrototype()));
+ auto structure = createStructure(vm, globalObject, zigGlobal->functionPrototype());
+ auto* object = new (NotNull, JSC::allocateCell<JSDOMFile>(vm)) JSDOMFile(vm, structure);
object->finishCreation(vm);
// This is not quite right. But we'll fix it if someone files an issue about it.
@@ -91,6 +92,12 @@ public:
return JSValue::encode(
WebCore::JSBlob::create(vm, globalObject, structure, ptr));
}
+
+ static EncodedJSValue call(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
+ {
+ auto scope = DECLARE_THROW_SCOPE(lexicalGlobalObject->vm());
+ throwTypeError(lexicalGlobalObject, scope, "Class constructor File cannot be invoked without 'new"_s);
+ }
};
const JSC::ClassInfo JSDOMFile::s_info = { "File"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDOMFile) };
diff --git a/src/bun.js/bindings/JSDOMWrapperCache.h b/src/bun.js/bindings/JSDOMWrapperCache.h
index 7656c7c17..e06f2607d 100644
--- a/src/bun.js/bindings/JSDOMWrapperCache.h
+++ b/src/bun.js/bindings/JSDOMWrapperCache.h
@@ -215,6 +215,10 @@ template<typename DOMClass> inline void setSubclassStructureIfNeeded(JSC::JSGlob
JSC::VM& vm = lexicalGlobalObject->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
+ // If the new target isn't actually callable
+ if (UNLIKELY(!newTarget->isCallable()))
+ newTarget = constructor;
+
auto* functionGlobalObject = JSC::getFunctionRealm(lexicalGlobalObject, newTarget);
RETURN_IF_EXCEPTION(scope, void());
auto* newTargetGlobalObject = JSC::jsCast<JSDOMGlobalObject*>(functionGlobalObject);
diff --git a/src/bun.js/bindings/JSMockFunction.cpp b/src/bun.js/bindings/JSMockFunction.cpp
index a8bac7c56..498864dfc 100644
--- a/src/bun.js/bindings/JSMockFunction.cpp
+++ b/src/bun.js/bindings/JSMockFunction.cpp
@@ -486,6 +486,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSMockFunctionPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -623,7 +624,6 @@ extern "C" EncodedJSValue JSMock__jsSpyOn(JSC::JSGlobalObject* lexicalGlobalObje
mock->copyNameAndLength(vm, globalObject, value);
- attributes |= PropertyAttribute::Function;
object->putDirect(vm, propertyKey, mock, attributes);
RETURN_IF_EXCEPTION(scope, {});
@@ -1320,7 +1320,7 @@ MockWithImplementationCleanupData* MockWithImplementationCleanupData::create(VM&
}
Structure* MockWithImplementationCleanupData::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
{
- return Structure::create(vm, globalObject, prototype, TypeInfo(CellType, StructureFlags), info());
+ return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
}
MockWithImplementationCleanupData::MockWithImplementationCleanupData(VM& vm, Structure* structure)
diff --git a/src/bun.js/bindings/JSNextTickQueue.cpp b/src/bun.js/bindings/JSNextTickQueue.cpp
index 8916ef6c8..18963645c 100644
--- a/src/bun.js/bindings/JSNextTickQueue.cpp
+++ b/src/bun.js/bindings/JSNextTickQueue.cpp
@@ -18,7 +18,7 @@ namespace Bun {
using namespace JSC;
-const JSC::ClassInfo JSNextTickQueue::s_info = { "JSNextTickQueue"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSNextTickQueue) };
+const JSC::ClassInfo JSNextTickQueue::s_info = { "NextTickQueue"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSNextTickQueue) };
template<typename, JSC::SubspaceAccess mode>
JSC::GCClient::IsoSubspace* JSNextTickQueue::subspaceFor(JSC::VM& vm)
@@ -34,11 +34,12 @@ JSC::GCClient::IsoSubspace* JSNextTickQueue::subspaceFor(JSC::VM& vm)
JSNextTickQueue* JSNextTickQueue::create(VM& vm, Structure* structure)
{
JSNextTickQueue* mod = new (NotNull, allocateCell<JSNextTickQueue>(vm)) JSNextTickQueue(vm, structure);
+ mod->finishCreation(vm);
return mod;
}
Structure* JSNextTickQueue::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
{
- return Structure::create(vm, globalObject, prototype, TypeInfo(CellType, StructureFlags), info());
+ return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
}
JSNextTickQueue::JSNextTickQueue(VM& vm, Structure* structure)
@@ -65,7 +66,6 @@ JSNextTickQueue* JSNextTickQueue::create(JSC::JSGlobalObject* globalObject)
{
auto& vm = globalObject->vm();
auto* obj = create(vm, createStructure(vm, globalObject, jsNull()));
- obj->finishCreation(vm);
return obj;
}
diff --git a/src/bun.js/bindings/JSNextTickQueue.h b/src/bun.js/bindings/JSNextTickQueue.h
index c3bd228cc..3a499345d 100644
--- a/src/bun.js/bindings/JSNextTickQueue.h
+++ b/src/bun.js/bindings/JSNextTickQueue.h
@@ -10,7 +10,6 @@ using namespace JSC;
class JSNextTickQueue : public JSC::JSInternalFieldObjectImpl<3> {
public:
- static constexpr unsigned numberOfInternalFields = 3;
using Base = JSC::JSInternalFieldObjectImpl<3>;
template<typename, JSC::SubspaceAccess mode> static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm);
diff --git a/src/bun.js/bindings/JSReadableState.cpp b/src/bun.js/bindings/JSReadableState.cpp
index 1f3a36def..22b1ec357 100644
--- a/src/bun.js/bindings/JSReadableState.cpp
+++ b/src/bun.js/bindings/JSReadableState.cpp
@@ -314,12 +314,12 @@ JSReadableState_NULLABLE_BOOLEAN_GETTER_SETTER(paused)
#undef JSReadableState_JSVALUE_GETTER_SETTER
-#define JSReadableState_GETTER_SETTER_HASH_TABLE_VALUE(NAME) \
- { \
-#NAME ""_s, static_cast < unsigned>(JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, \
- { \
- HashTableValue::GetterSetterType, jsReadableState_##NAME, setJSReadableState_##NAME \
- } \
+#define JSReadableState_GETTER_SETTER_HASH_TABLE_VALUE(NAME) \
+ { \
+ #NAME ""_s, static_cast<unsigned>(JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, \
+ { \
+ HashTableValue::GetterSetterType, jsReadableState_##NAME, setJSReadableState_##NAME \
+ } \
}
/* Hash table for prototype */
diff --git a/src/bun.js/bindings/JSReadableState.h b/src/bun.js/bindings/JSReadableState.h
index c67baebad..78a716910 100644
--- a/src/bun.js/bindings/JSReadableState.h
+++ b/src/bun.js/bindings/JSReadableState.h
@@ -107,6 +107,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSReadableStatePrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
diff --git a/src/bun.js/bindings/JSSink.cpp b/src/bun.js/bindings/JSSink.cpp
index d986ae590..ef6343849 100644
--- a/src/bun.js/bindings/JSSink.cpp
+++ b/src/bun.js/bindings/JSSink.cpp
@@ -711,6 +711,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSArrayBufferSinkPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -743,6 +744,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSReadableArrayBufferSinkControllerPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -798,17 +800,19 @@ void JSReadableArrayBufferSinkController::detach()
auto readableStream = m_weakReadableStream.get();
auto onClose = m_onClose.get();
- m_onClose.clear();
if (readableStream && onClose) {
- JSC::JSGlobalObject* globalObject = this->globalObject();
auto callData = JSC::getCallData(onClose);
- JSC::MarkedArgumentBuffer arguments;
- arguments.append(readableStream);
- arguments.append(jsUndefined());
- call(globalObject, onClose, callData, JSC::jsUndefined(), arguments);
+ if (callData.type != JSC::CallData::Type::None) {
+ JSC::JSGlobalObject* globalObject = this->globalObject();
+ JSC::MarkedArgumentBuffer arguments;
+ arguments.append(readableStream);
+ arguments.append(jsUndefined());
+ call(globalObject, onClose, callData, JSC::jsUndefined(), arguments);
+ }
}
+ m_onClose.clear();
m_weakReadableStream.clear();
}
@@ -965,6 +969,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSFileSinkPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -997,6 +1002,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSReadableFileSinkControllerPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -1052,17 +1058,19 @@ void JSReadableFileSinkController::detach()
auto readableStream = m_weakReadableStream.get();
auto onClose = m_onClose.get();
- m_onClose.clear();
if (readableStream && onClose) {
- JSC::JSGlobalObject* globalObject = this->globalObject();
auto callData = JSC::getCallData(onClose);
- JSC::MarkedArgumentBuffer arguments;
- arguments.append(readableStream);
- arguments.append(jsUndefined());
- call(globalObject, onClose, callData, JSC::jsUndefined(), arguments);
+ if (callData.type != JSC::CallData::Type::None) {
+ JSC::JSGlobalObject* globalObject = this->globalObject();
+ JSC::MarkedArgumentBuffer arguments;
+ arguments.append(readableStream);
+ arguments.append(jsUndefined());
+ call(globalObject, onClose, callData, JSC::jsUndefined(), arguments);
+ }
}
+ m_onClose.clear();
m_weakReadableStream.clear();
}
@@ -1219,6 +1227,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSHTTPResponseSinkPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -1251,6 +1260,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSReadableHTTPResponseSinkControllerPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -1306,17 +1316,19 @@ void JSReadableHTTPResponseSinkController::detach()
auto readableStream = m_weakReadableStream.get();
auto onClose = m_onClose.get();
- m_onClose.clear();
if (readableStream && onClose) {
- JSC::JSGlobalObject* globalObject = this->globalObject();
auto callData = JSC::getCallData(onClose);
- JSC::MarkedArgumentBuffer arguments;
- arguments.append(readableStream);
- arguments.append(jsUndefined());
- call(globalObject, onClose, callData, JSC::jsUndefined(), arguments);
+ if (callData.type != JSC::CallData::Type::None) {
+ JSC::JSGlobalObject* globalObject = this->globalObject();
+ JSC::MarkedArgumentBuffer arguments;
+ arguments.append(readableStream);
+ arguments.append(jsUndefined());
+ call(globalObject, onClose, callData, JSC::jsUndefined(), arguments);
+ }
}
+ m_onClose.clear();
m_weakReadableStream.clear();
}
@@ -1473,6 +1485,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSHTTPSResponseSinkPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -1505,6 +1518,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSReadableHTTPSResponseSinkControllerPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -1560,17 +1574,19 @@ void JSReadableHTTPSResponseSinkController::detach()
auto readableStream = m_weakReadableStream.get();
auto onClose = m_onClose.get();
- m_onClose.clear();
if (readableStream && onClose) {
- JSC::JSGlobalObject* globalObject = this->globalObject();
auto callData = JSC::getCallData(onClose);
- JSC::MarkedArgumentBuffer arguments;
- arguments.append(readableStream);
- arguments.append(jsUndefined());
- call(globalObject, onClose, callData, JSC::jsUndefined(), arguments);
+ if (callData.type != JSC::CallData::Type::None) {
+ JSC::JSGlobalObject* globalObject = this->globalObject();
+ JSC::MarkedArgumentBuffer arguments;
+ arguments.append(readableStream);
+ arguments.append(jsUndefined());
+ call(globalObject, onClose, callData, JSC::jsUndefined(), arguments);
+ }
}
+ m_onClose.clear();
m_weakReadableStream.clear();
}
diff --git a/src/bun.js/bindings/JSSocketAddress.cpp b/src/bun.js/bindings/JSSocketAddress.cpp
new file mode 100644
index 000000000..181507339
--- /dev/null
+++ b/src/bun.js/bindings/JSSocketAddress.cpp
@@ -0,0 +1,63 @@
+#include "JSSocketAddress.h"
+#include "ZigGlobalObject.h"
+#include "JavaScriptCore/JSObjectInlines.h"
+#include "JavaScriptCore/ObjectConstructor.h"
+#include "JavaScriptCore/JSCast.h"
+
+using namespace JSC;
+
+namespace Bun {
+namespace JSSocketAddress {
+
+// Using a structure with inlined offsets should be more lightweight than a class.
+Structure* createStructure(VM& vm, JSGlobalObject* globalObject)
+{
+ JSC::Structure* structure = globalObject->structureCache().emptyObjectStructureForPrototype(
+ globalObject,
+ globalObject->objectPrototype(),
+ 3);
+
+ JSC::PropertyOffset offset;
+ structure = structure->addPropertyTransition(
+ vm,
+ structure,
+ JSC::Identifier::fromString(vm, "address"_s),
+ 0,
+ offset);
+
+ structure = structure->addPropertyTransition(
+ vm,
+ structure,
+ JSC::Identifier::fromString(vm, "family"_s),
+ 0,
+ offset);
+
+ structure = structure->addPropertyTransition(
+ vm,
+ structure,
+ JSC::Identifier::fromString(vm, "port"_s),
+ 0,
+ offset);
+
+ return structure;
+}
+
+} // namespace JSSocketAddress
+} // namespace Bun
+
+extern "C" JSObject* JSSocketAddress__create(JSGlobalObject* globalObject, JSString* value, int32_t port, bool isIPv6)
+{
+ static const NeverDestroyed<String> IPv4 = MAKE_STATIC_STRING_IMPL("IPv4");
+ static const NeverDestroyed<String> IPv6 = MAKE_STATIC_STRING_IMPL("IPv6");
+
+ VM& vm = globalObject->vm();
+
+ auto* global = jsCast<Zig::GlobalObject*>(globalObject);
+
+ JSObject* thisObject = constructEmptyObject(vm, global->JSSocketAddressStructure());
+ thisObject->putDirectOffset(vm, 0, value);
+ thisObject->putDirectOffset(vm, 1, isIPv6 ? jsString(vm, IPv6) : jsString(vm, IPv4));
+ thisObject->putDirectOffset(vm, 2, jsNumber(port));
+
+ return thisObject;
+}
diff --git a/src/bun.js/bindings/JSSocketAddress.h b/src/bun.js/bindings/JSSocketAddress.h
new file mode 100644
index 000000000..77bdca5d4
--- /dev/null
+++ b/src/bun.js/bindings/JSSocketAddress.h
@@ -0,0 +1,16 @@
+// The object returned by Bun.serve's .requestIP()
+#pragma once
+#include "root.h"
+#include "JavaScriptCore/JSObjectInlines.h"
+
+using namespace JSC;
+
+namespace Bun {
+namespace JSSocketAddress {
+
+Structure* createStructure(VM& vm, JSGlobalObject* globalObject);
+
+} // namespace JSSocketAddress
+} // namespace Bun
+
+extern "C" JSObject* JSSocketAddress__create(JSGlobalObject* globalObject, JSString* value, int port, bool isIPv6);
diff --git a/src/bun.js/bindings/JSStringDecoder.h b/src/bun.js/bindings/JSStringDecoder.h
index bce1ae05d..cd2e017d6 100644
--- a/src/bun.js/bindings/JSStringDecoder.h
+++ b/src/bun.js/bindings/JSStringDecoder.h
@@ -77,6 +77,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSStringDecoderPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
diff --git a/src/bun.js/bindings/KeyObject.cpp b/src/bun.js/bindings/KeyObject.cpp
new file mode 100644
index 000000000..d5782779d
--- /dev/null
+++ b/src/bun.js/bindings/KeyObject.cpp
@@ -0,0 +1,2389 @@
+// Attribution: Some parts of of this module are derived from code originating from the Node.js
+// crypto module which is licensed under an MIT license:
+//
+// Copyright Node.js contributors. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+
+#include "KeyObject.h"
+#include "webcrypto/JSCryptoKey.h"
+#include "webcrypto/JSSubtleCrypto.h"
+#include "webcrypto/CryptoKeyOKP.h"
+#include "webcrypto/CryptoKeyEC.h"
+#include "webcrypto/CryptoKeyRSA.h"
+#include "webcrypto/CryptoKeyAES.h"
+#include "webcrypto/CryptoKeyHMAC.h"
+#include "webcrypto/CryptoKeyRaw.h"
+#include "webcrypto/CryptoKeyUsage.h"
+#include "webcrypto/JsonWebKey.h"
+#include "webcrypto/JSJsonWebKey.h"
+#include "JavaScriptCore/JSObject.h"
+#include "JavaScriptCore/ObjectConstructor.h"
+#include "headers-handwritten.h"
+#include <openssl/evp.h>
+#include <openssl/mem.h>
+#include <openssl/x509.h>
+#include <openssl/pem.h>
+#include <openssl/curve25519.h>
+#include "JSBuffer.h"
+
+using namespace JSC;
+using namespace Bun;
+using JSGlobalObject
+ = JSC::JSGlobalObject;
+using Exception = JSC::Exception;
+using JSValue = JSC::JSValue;
+using JSString = JSC::JSString;
+using JSModuleLoader = JSC::JSModuleLoader;
+using JSModuleRecord = JSC::JSModuleRecord;
+using Identifier = JSC::Identifier;
+using SourceOrigin = JSC::SourceOrigin;
+using JSObject = JSC::JSObject;
+using JSNonFinalObject = JSC::JSNonFinalObject;
+
+namespace WebCore {
+
+static bool KeyObject__IsASN1Sequence(const unsigned char* data, size_t size,
+ size_t* data_offset, size_t* data_size)
+{
+ if (size < 2 || data[0] != 0x30)
+ return false;
+
+ if (data[1] & 0x80) {
+ // Long form.
+ size_t n_bytes = data[1] & ~0x80;
+ if (n_bytes + 2 > size || n_bytes > sizeof(size_t))
+ return false;
+ size_t length = 0;
+ for (size_t i = 0; i < n_bytes; i++)
+ length = (length << 8) | data[i + 2];
+ *data_offset = 2 + n_bytes;
+ *data_size = std::min(size - 2 - n_bytes, length);
+ } else {
+ // Short form.
+ *data_offset = 2;
+ *data_size = std::min<size_t>(size - 2, data[1]);
+ }
+
+ return true;
+}
+static bool KeyObject__IsRSAPrivateKey(const unsigned char* data, size_t size)
+{
+ // Both RSAPrivateKey and RSAPublicKey structures start with a SEQUENCE.
+ size_t offset, len;
+ if (!KeyObject__IsASN1Sequence(data, size, &offset, &len))
+ return false;
+
+ // An RSAPrivateKey sequence always starts with a single-byte integer whose
+ // value is either 0 or 1, whereas an RSAPublicKey starts with the modulus
+ // (which is the product of two primes and therefore at least 4), so we can
+ // decide the type of the structure based on the first three bytes of the
+ // sequence.
+ return len >= 3 && data[offset] == 2 && data[offset + 1] == 1 && !(data[offset + 2] & 0xfe);
+}
+
+static bool KeyObject__IsEncryptedPrivateKeyInfo(const unsigned char* data, size_t size)
+{
+ // Both PrivateKeyInfo and EncryptedPrivateKeyInfo start with a SEQUENCE.
+ size_t offset, len;
+ if (!KeyObject__IsASN1Sequence(data, size, &offset, &len))
+ return false;
+
+ // A PrivateKeyInfo sequence always starts with an integer whereas an
+ // EncryptedPrivateKeyInfo starts with an AlgorithmIdentifier.
+ return len >= 1 && data[offset] != 2;
+}
+
+struct AsymmetricKeyValue {
+ EVP_PKEY* key;
+ bool owned;
+};
+
+struct AsymmetricKeyValueWithDER {
+ EVP_PKEY* key;
+ unsigned char* der_data;
+ long der_len;
+};
+
+struct PrivateKeyPassphrase {
+ char* passphrase;
+ size_t passphrase_len;
+};
+
+int PasswordCallback(char* buf, int size, int rwflag, void* u)
+{
+ auto result = static_cast<PrivateKeyPassphrase*>(u);
+ if (result != nullptr && size > 0 && result->passphrase != nullptr) {
+ size_t buflen = static_cast<size_t>(size);
+ size_t len = result->passphrase_len;
+ if (buflen < len)
+ return -1;
+ memcpy(buf, result->passphrase, buflen);
+ return len;
+ }
+
+ return -1;
+}
+
+AsymmetricKeyValueWithDER KeyObject__ParsePublicKeyPEM(const char* key_pem,
+ size_t key_pem_len)
+{
+ auto bp = BIOPtr(BIO_new_mem_buf(const_cast<char*>(key_pem), key_pem_len));
+ auto result = (AsymmetricKeyValueWithDER) { .key = nullptr, .der_data = nullptr, .der_len = 0 };
+
+ if (!bp) {
+ ERR_clear_error();
+ return result;
+ }
+
+ // Try parsing as a SubjectPublicKeyInfo first.
+ if (PEM_bytes_read_bio(&result.der_data, &result.der_len, nullptr, "PUBLIC KEY", bp.get(), nullptr, nullptr) == 1) {
+ // OpenSSL might modify the pointer, so we need to make a copy before parsing.
+ const unsigned char* p = result.der_data;
+ result.key = d2i_PUBKEY(nullptr, &p, result.der_len);
+ if (result.key) {
+ return result;
+ }
+ }
+
+ ERR_clear_error();
+ BIO_reset(bp.get());
+
+ // Maybe it is PKCS#1.
+ if (PEM_bytes_read_bio(&result.der_data, &result.der_len, nullptr, "RSA PUBLIC KEY", bp.get(), nullptr, nullptr) == 1) {
+ const unsigned char* p = result.der_data;
+ result.key = d2i_PublicKey(EVP_PKEY_RSA, nullptr, &p, result.der_len);
+ if (result.key) {
+ return result;
+ }
+ }
+ ERR_clear_error();
+ BIO_reset(bp.get());
+
+ // X.509 fallback.
+ if (PEM_bytes_read_bio(&result.der_data, &result.der_len, nullptr, "CERTIFICATE", bp.get(), nullptr, nullptr) == 1) {
+ const unsigned char* p = result.der_data;
+ X509Ptr x509(d2i_X509(nullptr, &p, result.der_len));
+ result.key = x509 ? X509_get_pubkey(x509.get()) : nullptr;
+ if (result.key) {
+ return result;
+ }
+ OPENSSL_clear_free(result.der_data, result.der_len);
+ ERR_clear_error();
+ result.der_data = nullptr;
+ result.der_len = 0;
+ } else {
+ OPENSSL_clear_free(result.der_data, result.der_len);
+ ERR_clear_error();
+ result.der_data = nullptr;
+ result.der_len = 0;
+ }
+ return result;
+}
+
+JSC::EncodedJSValue KeyObject__createPrivateKey(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame)
+{
+
+ auto count = callFrame->argumentCount();
+ auto& vm = globalObject->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ if (count < 1) {
+ JSC::throwTypeError(globalObject, scope, "createPrivateKey requires 1 arguments"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ auto* options = jsDynamicCast<JSC::JSObject*>(callFrame->argument(0));
+ if (!options) {
+ JSC::throwTypeError(globalObject, scope, "expected options to be a object"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ JSValue keyJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "key"_s)));
+ if (keyJSValue.isUndefinedOrNull() || keyJSValue.isEmpty()) {
+ JSC::throwTypeError(globalObject, scope, "key is required"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ if (!keyJSValue.isCell()) {
+ JSC::throwTypeError(globalObject, scope, "key must be a Buffer, Array-like or object"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ JSValue formatJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "format"_s)));
+ if (formatJSValue.isUndefinedOrNull() || formatJSValue.isEmpty()) {
+ JSC::throwTypeError(globalObject, scope, "format is required"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ if (!formatJSValue.isString()) {
+ JSC::throwTypeError(globalObject, scope, "format must be a string"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto format = formatJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+
+ Zig::GlobalObject* zigGlobalObject = reinterpret_cast<Zig::GlobalObject*>(globalObject);
+ auto* structure = zigGlobalObject->JSCryptoKeyStructure();
+
+ void* data;
+ size_t byteLength;
+
+ auto keyJSValueCell = keyJSValue.asCell();
+ auto type = keyJSValueCell->type();
+
+ switch (type) {
+
+ case DataViewType:
+ case Uint8ArrayType:
+ case Uint8ClampedArrayType:
+ case Uint16ArrayType:
+ case Uint32ArrayType:
+ case Int8ArrayType:
+ case Int16ArrayType:
+ case Int32ArrayType:
+ case Float32ArrayType:
+ case Float64ArrayType:
+ case BigInt64ArrayType:
+ case BigUint64ArrayType: {
+ JSC::JSArrayBufferView* view = jsCast<JSC::JSArrayBufferView*>(keyJSValueCell);
+
+ data = view->vector();
+ byteLength = view->length();
+ break;
+ }
+ case ArrayBufferType: {
+ auto* jsBuffer = jsDynamicCast<JSC::JSArrayBuffer*>(keyJSValueCell);
+ if (UNLIKELY(!jsBuffer)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "ERR_INVALID_ARG_TYPE: expected key to be Buffer or array-like object"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto* buffer = jsBuffer->impl();
+ data = buffer->data();
+ byteLength = buffer->byteLength();
+ break;
+ }
+ default: {
+ if (auto* keyObj = jsDynamicCast<JSC::JSObject*>(keyJSValue)) {
+ if (format != "jwk"_s) {
+ JSC::throwTypeError(globalObject, scope, "format should be 'jwk' when key type is 'object'"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto jwk = WebCore::convertDictionary<JsonWebKey>(*globalObject, keyJSValue);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ if (jwk.kty == "OKP"_s) {
+ if (jwk.crv == "Ed25519"_s) {
+ auto result = CryptoKeyOKP::importJwk(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::Ed25519, WTFMove(jwk), true, CryptoKeyUsageSign);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid Ed25519 private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ if (impl->type() != CryptoKeyType::Private) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (jwk.crv == "X25519"_s) {
+ auto result = CryptoKeyOKP::importJwk(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::X25519, WTFMove(jwk), true, CryptoKeyUsageSign);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid X25519 private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ if (impl->type() != CryptoKeyType::Private) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else {
+ throwException(globalObject, scope, createTypeError(globalObject, "Unsupported OKP curve"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ } else if (jwk.kty == "EC"_s) {
+ auto result = CryptoKeyEC::importJwk(CryptoAlgorithmIdentifier::ECDSA, jwk.crv, WTFMove(jwk), true, jwk.usages);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid EC private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ if (impl->type() != CryptoKeyType::Private) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (jwk.kty == "RSA"_s) {
+ auto result = CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier::RSA_OAEP, std::nullopt, WTFMove(jwk), true, jwk.usages);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid RSA private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ if (impl->type() != CryptoKeyType::Private) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else {
+ throwException(globalObject, scope, createTypeError(globalObject, "Unsupported private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ }
+ JSC::throwTypeError(globalObject, scope, "The \"key\" property must be of type object"_s);
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ }
+
+ if (format == "jwk"_s) {
+ JSC::throwTypeError(globalObject, scope, "The \"key\" property must be of type object"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ if (UNLIKELY(!data) || UNLIKELY(!byteLength)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "ERR_INVALID_ARG_TYPE: expected key to be Buffer or array-like object"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+
+ JSValue passphraseJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "passphrase"_s)));
+ PrivateKeyPassphrase passphrase = { nullptr, 0 };
+
+ auto hasPassphrase = !passphraseJSValue.isUndefinedOrNull() && !passphraseJSValue.isEmpty();
+
+ if (hasPassphrase) {
+ if (passphraseJSValue.isString()) {
+ auto passphrase_wtfstr = passphraseJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ if (!passphrase_wtfstr.isNull()) {
+ if (auto pass = passphrase_wtfstr.tryGetUTF8()) {
+ if (pass.has_value()) {
+ auto value = pass.value();
+ passphrase.passphrase = const_cast<char*>(value.data());
+ passphrase.passphrase_len = value.length();
+ }
+ }
+ }
+ } else if (auto* passphraseBuffer = jsDynamicCast<JSUint8Array*>(passphraseJSValue)) {
+ passphrase.passphrase = (char*)passphraseBuffer->vector();
+ passphrase.passphrase_len = passphraseBuffer->byteLength();
+ } else {
+ JSC::throwTypeError(globalObject, scope, "passphrase must be a Buffer or String"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ }
+
+ if (format == "pem"_s) {
+ auto bio = BIOPtr(BIO_new_mem_buf(const_cast<char*>((char*)data), byteLength));
+ auto pkey = EvpPKeyPtr(PEM_read_bio_PrivateKey(bio.get(), nullptr, PasswordCallback, &passphrase));
+
+ if (!pkey) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid private key pem file"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto pKeyID = EVP_PKEY_id(pkey.get());
+
+ if (pKeyID == EVP_PKEY_RSA || pKeyID == EVP_PKEY_RSA_PSS) {
+ auto impl = CryptoKeyRSA::create(pKeyID == EVP_PKEY_RSA_PSS ? CryptoAlgorithmIdentifier::RSA_PSS : CryptoAlgorithmIdentifier::RSA_OAEP, CryptoAlgorithmIdentifier::SHA_1, false, CryptoKeyType::Private, WTFMove(pkey), true, CryptoKeyUsageDecrypt);
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (pKeyID == EVP_PKEY_ED25519 || pKeyID == EVP_PKEY_X25519) {
+ size_t out_len = 0;
+ if (!EVP_PKEY_get_raw_private_key(pkey.get(), nullptr, &out_len)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ Vector<uint8_t> out(out_len);
+ if (!EVP_PKEY_get_raw_private_key(pkey.get(), out.data(), &out_len) || out_len != out.size()) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto result = CryptoKeyOKP::create(CryptoAlgorithmIdentifier::Ed25519, pKeyID == EVP_PKEY_ED25519 ? CryptoKeyOKP::NamedCurve::Ed25519 : CryptoKeyOKP::NamedCurve::X25519, CryptoKeyType::Private, WTFMove(out), true, CryptoKeyUsageSign);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (pKeyID == EVP_PKEY_EC) {
+ EC_KEY* ec_key = EVP_PKEY_get1_EC_KEY(pkey.get());
+ if (UNLIKELY(ec_key == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid EC private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ const EC_GROUP* ec_group = EC_KEY_get0_group(ec_key);
+ // Get the curve name
+ int curve_name = EC_GROUP_get_curve_name(ec_group);
+ if (curve_name == NID_undef) {
+ EC_KEY_free(ec_key);
+ throwException(globalObject, scope, createTypeError(globalObject, "Unable to identify EC curve"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ CryptoKeyEC::NamedCurve curve;
+ if (curve_name == NID_X9_62_prime256v1)
+ curve = CryptoKeyEC::NamedCurve::P256;
+ else if (curve_name == NID_secp384r1)
+ curve = CryptoKeyEC::NamedCurve::P384;
+ else if (curve_name == NID_secp521r1)
+ curve = CryptoKeyEC::NamedCurve::P521;
+ else {
+ EC_KEY_free(ec_key);
+ throwException(globalObject, scope, createTypeError(globalObject, "Unsupported EC curve"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ EC_KEY_free(ec_key);
+ auto impl = CryptoKeyEC::create(CryptoAlgorithmIdentifier::ECDH, curve, CryptoKeyType::Private, WTFMove(pkey), true, CryptoKeyUsageSign);
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else {
+ throwException(globalObject, scope, createTypeError(globalObject, "Unsupported private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ }
+ if (format == "der"_s) {
+ JSValue typeJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "type"_s)));
+ WTF::String type = "pkcs8"_s;
+ if (!typeJSValue.isUndefinedOrNull() && !typeJSValue.isEmpty()) {
+ if (!typeJSValue.isString()) {
+ JSC::throwTypeError(globalObject, scope, "type must be a string"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ type = typeJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ }
+
+ if (type == "pkcs1"_s) {
+ // must be RSA
+ const unsigned char* p = reinterpret_cast<const unsigned char*>(data);
+ auto pkey = EvpPKeyPtr(d2i_PrivateKey(EVP_PKEY_RSA, nullptr, &p, byteLength));
+ if (!pkey) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid use of PKCS#1 as private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto pKeyID = EVP_PKEY_id(pkey.get());
+ auto impl = CryptoKeyRSA::create(pKeyID == EVP_PKEY_RSA_PSS ? CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5 : CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5, CryptoAlgorithmIdentifier::SHA_1, false, CryptoKeyType::Private, WTFMove(pkey), true, CryptoKeyUsageDecrypt);
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (type == "pkcs8"_s) {
+
+ auto bio = BIOPtr(BIO_new_mem_buf(const_cast<char*>((char*)data), byteLength));
+ WebCore::EvpPKeyPtr pkey;
+ if (KeyObject__IsEncryptedPrivateKeyInfo(const_cast<unsigned char*>((unsigned char*)data), byteLength)) {
+ pkey = EvpPKeyPtr(d2i_PKCS8PrivateKey_bio(bio.get(),
+ nullptr,
+ PasswordCallback,
+ &passphrase));
+ } else {
+ auto* p8inf = d2i_PKCS8_PRIV_KEY_INFO_bio(bio.get(), nullptr);
+ if (!p8inf) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid PKCS8 data"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ pkey = EvpPKeyPtr(EVP_PKCS82PKEY(p8inf));
+ }
+ if (!pkey) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto pKeyID = EVP_PKEY_id(pkey.get());
+
+ if (pKeyID == EVP_PKEY_RSA || pKeyID == EVP_PKEY_RSA_PSS) {
+ auto impl = CryptoKeyRSA::create(pKeyID == EVP_PKEY_RSA_PSS ? CryptoAlgorithmIdentifier::RSA_PSS : CryptoAlgorithmIdentifier::RSA_OAEP, CryptoAlgorithmIdentifier::SHA_1, false, CryptoKeyType::Private, WTFMove(pkey), true, CryptoKeyUsageDecrypt);
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (pKeyID == EVP_PKEY_ED25519) {
+ auto result = CryptoKeyOKP::importPkcs8(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::Ed25519, Vector<uint8_t>((uint8_t*)data, byteLength), true, CryptoKeyUsageSign);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid Ed25519 private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (pKeyID == EVP_PKEY_X25519) {
+ auto result = CryptoKeyOKP::importPkcs8(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::X25519, Vector<uint8_t>((uint8_t*)data, byteLength), true, CryptoKeyUsageSign);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid Ed25519 private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (pKeyID == EVP_PKEY_EC) {
+ EC_KEY* ec_key = EVP_PKEY_get1_EC_KEY(pkey.get());
+ if (UNLIKELY(ec_key == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid EC private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ const EC_GROUP* ec_group = EC_KEY_get0_group(ec_key);
+ // Get the curve name
+ int curve_name = EC_GROUP_get_curve_name(ec_group);
+ if (curve_name == NID_undef) {
+ EC_KEY_free(ec_key);
+ throwException(globalObject, scope, createTypeError(globalObject, "Unable to identify EC curve"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ CryptoKeyEC::NamedCurve curve;
+ if (curve_name == NID_X9_62_prime256v1)
+ curve = CryptoKeyEC::NamedCurve::P256;
+ else if (curve_name == NID_secp384r1)
+ curve = CryptoKeyEC::NamedCurve::P384;
+ else if (curve_name == NID_secp521r1)
+ curve = CryptoKeyEC::NamedCurve::P521;
+ else {
+ EC_KEY_free(ec_key);
+ throwException(globalObject, scope, createTypeError(globalObject, "Unsupported EC curve"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto result = CryptoKeyEC::platformImportPkcs8(CryptoAlgorithmIdentifier::ECDH, curve, Vector<uint8_t>((uint8_t*)data, byteLength), true, CryptoKeyUsageSign);
+ if (UNLIKELY(result == nullptr)) {
+ result = CryptoKeyEC::platformImportPkcs8(CryptoAlgorithmIdentifier::ECDSA, curve, Vector<uint8_t>((uint8_t*)data, byteLength), true, CryptoKeyUsageSign);
+ }
+ EC_KEY_free(ec_key);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid EC private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else {
+ throwException(globalObject, scope, createTypeError(globalObject, "Unsupported private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ } else if (type == "sec1"_s) {
+ const unsigned char* p = reinterpret_cast<const unsigned char*>(data);
+ auto pkey = EvpPKeyPtr(d2i_PrivateKey(EVP_PKEY_EC, nullptr, &p, byteLength));
+ auto pKeyID = EVP_PKEY_id(pkey.get());
+
+ if (pKeyID == EVP_PKEY_EC) {
+ EC_KEY* ec_key = EVP_PKEY_get1_EC_KEY(pkey.get());
+ if (UNLIKELY(ec_key == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid EC private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ const EC_GROUP* ec_group = EC_KEY_get0_group(ec_key);
+ // Get the curve name
+ int curve_name = EC_GROUP_get_curve_name(ec_group);
+ if (curve_name == NID_undef) {
+ EC_KEY_free(ec_key);
+ throwException(globalObject, scope, createTypeError(globalObject, "Unable to identify EC curve"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ CryptoKeyEC::NamedCurve curve;
+ if (curve_name == NID_X9_62_prime256v1)
+ curve = CryptoKeyEC::NamedCurve::P256;
+ else if (curve_name == NID_secp384r1)
+ curve = CryptoKeyEC::NamedCurve::P384;
+ else if (curve_name == NID_secp521r1)
+ curve = CryptoKeyEC::NamedCurve::P521;
+ else {
+ EC_KEY_free(ec_key);
+ throwException(globalObject, scope, createTypeError(globalObject, "Unsupported EC curve"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ EC_KEY_free(ec_key);
+ auto impl = CryptoKeyEC::create(CryptoAlgorithmIdentifier::ECDH, curve, CryptoKeyType::Private, WTFMove(pkey), true, CryptoKeyUsageSign);
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid EC private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ }
+
+ JSC::throwTypeError(globalObject, scope, "type should be 'pkcs1', 'pkcs8' or 'sec1'"_s);
+ return JSValue::encode(JSC::jsUndefined());
+ }
+
+ JSC::throwTypeError(globalObject, scope, "format should be 'pem' or 'der'"_s);
+ return JSValue::encode(JSC::jsUndefined());
+}
+
+static JSC::EncodedJSValue KeyObject__createRSAFromPrivate(JSC::JSGlobalObject* globalObject, EVP_PKEY* pkey, WebCore::CryptoAlgorithmIdentifier alg)
+{
+ auto& vm = globalObject->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ const RSA* rsa_key = EVP_PKEY_get0_RSA(pkey);
+
+ auto publicRSA = RSAPtr(RSAPublicKey_dup(rsa_key));
+ if (!publicRSA) {
+ JSC::throwTypeError(globalObject, scope, "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Failed to create a public key from private"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto publicPKey = EvpPKeyPtr(EVP_PKEY_new());
+ if (EVP_PKEY_set1_RSA(publicPKey.get(), publicRSA.get()) <= 0) {
+ JSC::throwTypeError(globalObject, scope, "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Failed to create a public key from private"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto impl = CryptoKeyRSA::create(alg, CryptoAlgorithmIdentifier::SHA_1, false, CryptoKeyType::Public, WTFMove(publicPKey), true, CryptoKeyUsageVerify);
+ Zig::GlobalObject* zigGlobalObject = reinterpret_cast<Zig::GlobalObject*>(globalObject);
+ auto* structure = zigGlobalObject->JSCryptoKeyStructure();
+
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+}
+
+static JSC::EncodedJSValue KeyObject__createECFromPrivate(JSC::JSGlobalObject* globalObject, EVP_PKEY* pkey, CryptoKeyEC::NamedCurve namedCurve, WebCore::CryptoAlgorithmIdentifier alg)
+{
+ auto& vm = globalObject->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ EC_KEY* ec_key = EVP_PKEY_get0_EC_KEY(pkey);
+ auto point = ECPointPtr(EC_POINT_dup(EC_KEY_get0_public_key(ec_key), EC_KEY_get0_group(ec_key)));
+ if (!point) {
+ JSC::throwTypeError(globalObject, scope, "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Failed to create a public key from private 1"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto curve = NID_undef;
+
+ switch (namedCurve) {
+ case CryptoKeyEC::NamedCurve::P256:
+ curve = NID_X9_62_prime256v1;
+ break;
+ case CryptoKeyEC::NamedCurve::P384:
+ curve = NID_secp384r1;
+ break;
+ case CryptoKeyEC::NamedCurve::P521:
+ curve = NID_secp521r1;
+ break;
+ }
+ auto publicECKey = ECKeyPtr(EC_KEY_new_by_curve_name(curve));
+ if (!publicECKey) {
+ JSC::throwTypeError(globalObject, scope, "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Failed to create a public key from private 2"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ // OPENSSL_EC_NAMED_CURVE needs to be set to export the key with the curve name, not with the curve parameters.
+ EC_KEY_set_asn1_flag(publicECKey.get(), OPENSSL_EC_NAMED_CURVE);
+ if (EC_KEY_set_public_key(publicECKey.get(), point.get()) <= 0) {
+ JSC::throwTypeError(globalObject, scope, "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Failed to create a public key from private 3"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto publicPKey = EvpPKeyPtr(EVP_PKEY_new());
+ if (EVP_PKEY_set1_EC_KEY(publicPKey.get(), publicECKey.get()) <= 0) {
+ JSC::throwTypeError(globalObject, scope, "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Failed to create a public key from private 4"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto impl = CryptoKeyEC::create(alg, namedCurve, CryptoKeyType::Public, WTFMove(publicPKey), true, CryptoKeyUsageVerify);
+
+ Zig::GlobalObject* zigGlobalObject = reinterpret_cast<Zig::GlobalObject*>(globalObject);
+ auto* structure = zigGlobalObject->JSCryptoKeyStructure();
+
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+}
+
+static JSC::EncodedJSValue KeyObject__createOKPFromPrivate(JSC::JSGlobalObject* globalObject, const WebCore::CryptoKeyOKP::KeyMaterial keyData, CryptoKeyOKP::NamedCurve namedCurve, WebCore::CryptoAlgorithmIdentifier alg)
+{
+ auto& vm = globalObject->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ uint8_t public_key[ED25519_PUBLIC_KEY_LEN];
+
+ if (namedCurve == CryptoKeyOKP::NamedCurve::Ed25519) {
+ memcpy(public_key, keyData.data() + ED25519_PRIVATE_KEY_LEN, ED25519_PUBLIC_KEY_LEN);
+ } else {
+ X25519_public_from_private(public_key, keyData.data());
+ }
+ auto result = CryptoKeyOKP::create(alg, namedCurve, CryptoKeyType::Public, Vector<uint8_t>(public_key), true, CryptoKeyUsageVerify);
+ if (UNLIKELY(result == nullptr)) {
+ JSC::throwTypeError(globalObject, scope, "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Failed to create a public key from private"_s);
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+
+ Zig::GlobalObject* zigGlobalObject = reinterpret_cast<Zig::GlobalObject*>(globalObject);
+ auto* structure = zigGlobalObject->JSCryptoKeyStructure();
+
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+}
+
+static JSC::EncodedJSValue KeyObject__createPublicFromPrivate(JSC::JSGlobalObject* globalObject, EVP_PKEY* pkey)
+{
+ auto& vm = globalObject->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ auto pKeyID = EVP_PKEY_id(pkey);
+ if (pKeyID == EVP_PKEY_RSA || pKeyID == EVP_PKEY_RSA_PSS) {
+ return KeyObject__createRSAFromPrivate(globalObject, pkey, pKeyID == EVP_PKEY_RSA_PSS ? CryptoAlgorithmIdentifier::RSA_PSS : CryptoAlgorithmIdentifier::RSA_OAEP);
+ } else if (pKeyID == EVP_PKEY_EC) {
+
+ EC_KEY* ec_key = EVP_PKEY_get1_EC_KEY(pkey);
+ if (UNLIKELY(ec_key == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid EC key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ const EC_GROUP* ec_group = EC_KEY_get0_group(ec_key);
+ // Get the curve name
+ int curve_name = EC_GROUP_get_curve_name(ec_group);
+ if (curve_name == NID_undef) {
+ EC_KEY_free(ec_key);
+ throwException(globalObject, scope, createTypeError(globalObject, "Unable to identify EC curve"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ CryptoKeyEC::NamedCurve curve;
+ if (curve_name == NID_X9_62_prime256v1)
+ curve = CryptoKeyEC::NamedCurve::P256;
+ else if (curve_name == NID_secp384r1)
+ curve = CryptoKeyEC::NamedCurve::P384;
+ else if (curve_name == NID_secp521r1)
+ curve = CryptoKeyEC::NamedCurve::P521;
+ else {
+ EC_KEY_free(ec_key);
+ throwException(globalObject, scope, createTypeError(globalObject, "Unsupported EC curve"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ EC_KEY_free(ec_key);
+ return KeyObject__createECFromPrivate(globalObject, pkey, curve, CryptoAlgorithmIdentifier::ECDSA);
+ } else if (pKeyID == EVP_PKEY_ED25519 || pKeyID == EVP_PKEY_X25519) {
+ size_t out_len = 0;
+ auto& vm = globalObject->vm();
+ if (!EVP_PKEY_get_raw_private_key(pkey, nullptr, &out_len)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ Vector<uint8_t> out(out_len);
+ if (!EVP_PKEY_get_raw_private_key(pkey, out.data(), &out_len) || out_len != out.size()) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid private key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ return KeyObject__createOKPFromPrivate(globalObject, out, pKeyID == EVP_PKEY_ED25519 ? CryptoKeyOKP::NamedCurve::Ed25519 : CryptoKeyOKP::NamedCurve::X25519, CryptoAlgorithmIdentifier::Ed25519);
+ } else {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid private key type"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+}
+
+JSC::EncodedJSValue KeyObject__createPublicKey(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame)
+{
+
+ auto count = callFrame->argumentCount();
+ auto& vm = globalObject->vm();
+
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ if (count < 1) {
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ JSC::throwTypeError(globalObject, scope, "createPublicKey requires 1 arguments"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto* options = jsDynamicCast<JSC::JSObject*>(callFrame->argument(0));
+ if (!options) {
+ JSC::throwTypeError(globalObject, scope, "expected options to be a object"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ JSValue keyJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "key"_s)));
+ if (keyJSValue.isUndefinedOrNull() || keyJSValue.isEmpty()) {
+ JSC::throwTypeError(globalObject, scope, "key is required"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ Zig::GlobalObject* zigGlobalObject = reinterpret_cast<Zig::GlobalObject*>(globalObject);
+ auto* structure = zigGlobalObject->JSCryptoKeyStructure();
+
+ void* data;
+ size_t byteLength;
+ if (auto* key = jsDynamicCast<JSCryptoKey*>(keyJSValue)) {
+ auto& wrapped = key->wrapped();
+ auto key_type = wrapped.type();
+ if (key_type != CryptoKeyType::Private) {
+ JSC::throwTypeError(globalObject, scope, "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type, expected private"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto id = wrapped.keyClass();
+
+ switch (id) {
+ case CryptoKeyClass::RSA: {
+ return KeyObject__createRSAFromPrivate(globalObject, downcast<WebCore::CryptoKeyRSA>(wrapped).platformKey(), wrapped.algorithmIdentifier());
+ }
+ case CryptoKeyClass::EC: {
+ auto& impl = downcast<WebCore::CryptoKeyEC>(wrapped);
+ return KeyObject__createECFromPrivate(globalObject, impl.platformKey(), impl.namedCurve(), wrapped.algorithmIdentifier());
+ }
+ case CryptoKeyClass::OKP: {
+ auto& impl = downcast<WebCore::CryptoKeyOKP>(wrapped);
+ return KeyObject__createOKPFromPrivate(globalObject, impl.exportKey(), impl.namedCurve(), wrapped.algorithmIdentifier());
+ }
+ default: {
+ JSC::throwTypeError(globalObject, scope, "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type, expected private"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ }
+ }
+ if (!keyJSValue.isCell()) {
+ JSC::throwTypeError(globalObject, scope, "expected options to be a object"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ JSValue formatJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "format"_s)));
+ if (formatJSValue.isUndefinedOrNull() || formatJSValue.isEmpty()) {
+ JSC::throwTypeError(globalObject, scope, "format is required"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ if (!formatJSValue.isString()) {
+ JSC::throwTypeError(globalObject, scope, "format must be a string"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto format = formatJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+
+ auto keyJSValueCell = keyJSValue.asCell();
+ auto type = keyJSValueCell->type();
+
+ switch (type) {
+
+ case DataViewType:
+ case Uint8ArrayType:
+ case Uint8ClampedArrayType:
+ case Uint16ArrayType:
+ case Uint32ArrayType:
+ case Int8ArrayType:
+ case Int16ArrayType:
+ case Int32ArrayType:
+ case Float32ArrayType:
+ case Float64ArrayType:
+ case BigInt64ArrayType:
+ case BigUint64ArrayType: {
+ JSC::JSArrayBufferView* view = jsCast<JSC::JSArrayBufferView*>(keyJSValueCell);
+
+ data = view->vector();
+ byteLength = view->length();
+ break;
+ }
+ case ArrayBufferType: {
+ auto* jsBuffer = jsDynamicCast<JSC::JSArrayBuffer*>(keyJSValueCell);
+ if (UNLIKELY(!jsBuffer)) {
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ throwException(globalObject, scope, createTypeError(globalObject, "ERR_INVALID_ARG_TYPE: expected key to be Buffer or array-like object"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto* buffer = jsBuffer->impl();
+ data = buffer->data();
+ byteLength = buffer->byteLength();
+ break;
+ }
+ default: {
+ if (auto* keyObj = jsDynamicCast<JSC::JSObject*>(keyJSValue)) {
+ if (format != "jwk"_s) {
+ JSC::throwTypeError(globalObject, scope, "format should be 'jwk' when key type is 'object'"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto jwk = WebCore::convertDictionary<JsonWebKey>(*globalObject, keyJSValue);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ if (jwk.kty == "OKP"_s) {
+ if (jwk.crv == "Ed25519"_s) {
+ auto result = CryptoKeyOKP::importPublicJwk(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::Ed25519, WTFMove(jwk), true, CryptoKeyUsageVerify);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid Ed25519 public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ if (impl->type() == CryptoKeyType::Private) {
+ return KeyObject__createOKPFromPrivate(globalObject, impl.get().exportKey(), CryptoKeyOKP::NamedCurve::Ed25519, CryptoAlgorithmIdentifier::Ed25519);
+ }
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (jwk.crv == "X25519"_s) {
+ auto result = CryptoKeyOKP::importPublicJwk(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::X25519, WTFMove(jwk), true, CryptoKeyUsageVerify);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid X25519 public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ if (impl->type() == CryptoKeyType::Private) {
+ return KeyObject__createOKPFromPrivate(globalObject, impl.get().exportKey(), CryptoKeyOKP::NamedCurve::X25519, CryptoAlgorithmIdentifier::Ed25519);
+ }
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else {
+ throwException(globalObject, scope, createTypeError(globalObject, "Unsupported OKP curve"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ } else if (jwk.kty == "EC"_s) {
+ auto result = CryptoKeyEC::importJwk(CryptoAlgorithmIdentifier::ECDSA, jwk.crv, WTFMove(jwk), true, jwk.usages);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid EC public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ if (impl->type() == CryptoKeyType::Private) {
+ return KeyObject__createECFromPrivate(globalObject, impl.get().platformKey(), impl.get().namedCurve(), CryptoAlgorithmIdentifier::ECDSA);
+ }
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (jwk.kty == "RSA"_s) {
+ auto result = CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier::RSA_OAEP, std::nullopt, WTFMove(jwk), true, jwk.usages);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid RSA public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ if (impl->type() == CryptoKeyType::Private) {
+ return KeyObject__createRSAFromPrivate(globalObject, impl.get().platformKey(), CryptoAlgorithmIdentifier::RSA_OAEP);
+ }
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else {
+ throwException(globalObject, scope, createTypeError(globalObject, "Unsupported public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ }
+ }
+ }
+
+ if (format == "jwk"_s) {
+ JSC::throwTypeError(globalObject, scope, "The \"key\" property must be of type object"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ if (UNLIKELY(!data) || UNLIKELY(!byteLength)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "ERR_INVALID_ARG_TYPE: expected key to be Buffer or array-like object"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+
+ if (format == "pem"_s) {
+ auto pem = KeyObject__ParsePublicKeyPEM((const char*)data, byteLength);
+ if (!pem.key) {
+ // maybe is a private pem
+ auto bio = BIOPtr(BIO_new_mem_buf(const_cast<char*>((char*)data), byteLength));
+ JSValue passphraseJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "passphrase"_s)));
+ PrivateKeyPassphrase passphrase = { nullptr, 0 };
+
+ auto hasPassphrase = !passphraseJSValue.isUndefinedOrNull() && !passphraseJSValue.isEmpty();
+
+ if (hasPassphrase) {
+ if (passphraseJSValue.isString()) {
+ auto passphrase_wtfstr = passphraseJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ if (!passphrase_wtfstr.isNull()) {
+ if (auto pass = passphrase_wtfstr.tryGetUTF8()) {
+ if (pass.has_value()) {
+ auto value = pass.value();
+ passphrase.passphrase = const_cast<char*>(value.data());
+ passphrase.passphrase_len = value.length();
+ }
+ }
+ }
+ } else if (auto* passphraseBuffer = jsDynamicCast<JSUint8Array*>(passphraseJSValue)) {
+ passphrase.passphrase = (char*)passphraseBuffer->vector();
+ passphrase.passphrase_len = passphraseBuffer->byteLength();
+ } else {
+ JSC::throwTypeError(globalObject, scope, "passphrase must be a Buffer or String"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ }
+
+ auto pkey = EvpPKeyPtr(PEM_read_bio_PrivateKey(bio.get(), nullptr, PasswordCallback, &passphrase));
+ if (!pkey) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid PEM data"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ return KeyObject__createPublicFromPrivate(globalObject, pkey.get());
+ }
+ auto pkey = EvpPKeyPtr(pem.key);
+ auto pKeyID = EVP_PKEY_id(pem.key);
+ if (pKeyID == EVP_PKEY_RSA || pKeyID == EVP_PKEY_RSA_PSS) {
+ if (pem.der_data) {
+ OPENSSL_clear_free(pem.der_data, pem.der_len);
+ }
+ auto impl = CryptoKeyRSA::create(pKeyID == EVP_PKEY_RSA_PSS ? CryptoAlgorithmIdentifier::RSA_PSS : CryptoAlgorithmIdentifier::RSA_OAEP, CryptoAlgorithmIdentifier::SHA_1, false, CryptoKeyType::Public, WTFMove(pkey), true, CryptoKeyUsageEncrypt);
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (pKeyID == EVP_PKEY_ED25519) {
+ auto result = CryptoKeyOKP::importSpki(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::Ed25519, Vector<uint8_t>((uint8_t*)pem.der_data, (size_t)pem.der_len), true, CryptoKeyUsageVerify);
+ if (pem.der_data) {
+ OPENSSL_clear_free(pem.der_data, pem.der_len);
+ }
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid Ed25519 public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (pKeyID == EVP_PKEY_X25519) {
+ auto result = CryptoKeyOKP::importSpki(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::X25519, Vector<uint8_t>((uint8_t*)pem.der_data, (size_t)pem.der_len), true, CryptoKeyUsageVerify);
+ if (pem.der_data) {
+ OPENSSL_clear_free(pem.der_data, pem.der_len);
+ }
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid Ed25519 public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (pKeyID == EVP_PKEY_EC) {
+ EC_KEY* ec_key = EVP_PKEY_get1_EC_KEY(pkey.get());
+ if (UNLIKELY(ec_key == nullptr)) {
+ if (pem.der_data) {
+ OPENSSL_clear_free(pem.der_data, pem.der_len);
+ }
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid EC public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ const EC_GROUP* ec_group = EC_KEY_get0_group(ec_key);
+ // Get the curve name
+ int curve_name = EC_GROUP_get_curve_name(ec_group);
+ if (curve_name == NID_undef) {
+ if (pem.der_data) {
+ OPENSSL_clear_free(pem.der_data, pem.der_len);
+ }
+ EC_KEY_free(ec_key);
+ throwException(globalObject, scope, createTypeError(globalObject, "Unable to identify EC curve"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ CryptoKeyEC::NamedCurve curve;
+ if (curve_name == NID_X9_62_prime256v1)
+ curve = CryptoKeyEC::NamedCurve::P256;
+ else if (curve_name == NID_secp384r1)
+ curve = CryptoKeyEC::NamedCurve::P384;
+ else if (curve_name == NID_secp521r1)
+ curve = CryptoKeyEC::NamedCurve::P521;
+ else {
+ if (pem.der_data) {
+ OPENSSL_clear_free(pem.der_data, pem.der_len);
+ }
+ EC_KEY_free(ec_key);
+ throwException(globalObject, scope, createTypeError(globalObject, "Unsupported EC curve"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto result = CryptoKeyEC::platformImportSpki(CryptoAlgorithmIdentifier::ECDH, curve, Vector<uint8_t>((uint8_t*)pem.der_data, (size_t)pem.der_len), true, CryptoKeyUsageVerify);
+ if (UNLIKELY(result == nullptr)) {
+ result = CryptoKeyEC::platformImportSpki(CryptoAlgorithmIdentifier::ECDSA, curve, Vector<uint8_t>((uint8_t*)pem.der_data, (size_t)pem.der_len), true, CryptoKeyUsageVerify);
+ }
+ if (pem.der_data) {
+ OPENSSL_clear_free(pem.der_data, pem.der_len);
+ }
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid EC public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else {
+ if (pem.der_data) {
+ OPENSSL_clear_free(pem.der_data, pem.der_len);
+ }
+ throwException(globalObject, scope, createTypeError(globalObject, "Unsupported public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ }
+ if (format == "der"_s) {
+ JSValue typeJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "type"_s)));
+ WTF::String type = "spki"_s;
+ if (!typeJSValue.isUndefinedOrNull() && !typeJSValue.isEmpty()) {
+ if (!typeJSValue.isString()) {
+ JSC::throwTypeError(globalObject, scope, "type must be a string"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ type = typeJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ }
+
+ if (type == "pkcs1"_s) {
+ // must be RSA
+ const unsigned char* p = reinterpret_cast<const unsigned char*>(data);
+ auto pkey = EvpPKeyPtr(d2i_PublicKey(EVP_PKEY_RSA, nullptr, &p, byteLength));
+ if (!pkey) {
+ // maybe is a private RSA key
+ const unsigned char* p = reinterpret_cast<const unsigned char*>(data);
+ pkey = EvpPKeyPtr(d2i_PrivateKey(EVP_PKEY_RSA, nullptr, &p, byteLength));
+ if (!pkey) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid PKCS#1"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+
+ auto pKeyID = EVP_PKEY_id(pkey.get());
+ return KeyObject__createRSAFromPrivate(globalObject, pkey.get(), pKeyID == EVP_PKEY_RSA_PSS ? CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5 : CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5);
+ }
+
+ auto pKeyID = EVP_PKEY_id(pkey.get());
+ auto impl = CryptoKeyRSA::create(pKeyID == EVP_PKEY_RSA_PSS ? CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5 : CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5, CryptoAlgorithmIdentifier::SHA_1, false, CryptoKeyType::Public, WTFMove(pkey), true, CryptoKeyUsageEncrypt);
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (type == "spki"_s) {
+ // We use d2i_PUBKEY() to import a public key.
+ const uint8_t* ptr = reinterpret_cast<const uint8_t*>(data);
+ auto pkey = EvpPKeyPtr(d2i_PUBKEY(nullptr, &ptr, byteLength));
+ if (!pkey) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto pKeyID = EVP_PKEY_id(pkey.get());
+
+ if (pKeyID == EVP_PKEY_RSA || pKeyID == EVP_PKEY_RSA_PSS) {
+ auto impl = CryptoKeyRSA::create(pKeyID == EVP_PKEY_RSA_PSS ? CryptoAlgorithmIdentifier::RSA_PSS : CryptoAlgorithmIdentifier::RSA_OAEP, CryptoAlgorithmIdentifier::SHA_1, false, CryptoKeyType::Public, WTFMove(pkey), true, CryptoKeyUsageEncrypt);
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (pKeyID == EVP_PKEY_ED25519) {
+ auto result = CryptoKeyOKP::importSpki(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::Ed25519, Vector<uint8_t>((uint8_t*)data, byteLength), true, CryptoKeyUsageVerify);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid Ed25519 public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (pKeyID == EVP_PKEY_X25519) {
+ auto result = CryptoKeyOKP::importSpki(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::X25519, Vector<uint8_t>((uint8_t*)data, byteLength), true, CryptoKeyUsageVerify);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid Ed25519 public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else if (pKeyID == EVP_PKEY_EC) {
+ EC_KEY* ec_key = EVP_PKEY_get1_EC_KEY(pkey.get());
+ if (UNLIKELY(ec_key == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid EC public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ const EC_GROUP* ec_group = EC_KEY_get0_group(ec_key);
+ // Get the curve name
+ int curve_name = EC_GROUP_get_curve_name(ec_group);
+ if (curve_name == NID_undef) {
+ EC_KEY_free(ec_key);
+ throwException(globalObject, scope, createTypeError(globalObject, "Unable to identify EC curve"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ CryptoKeyEC::NamedCurve curve;
+ if (curve_name == NID_X9_62_prime256v1)
+ curve = CryptoKeyEC::NamedCurve::P256;
+ else if (curve_name == NID_secp384r1)
+ curve = CryptoKeyEC::NamedCurve::P384;
+ else if (curve_name == NID_secp521r1)
+ curve = CryptoKeyEC::NamedCurve::P521;
+ else {
+ EC_KEY_free(ec_key);
+ throwException(globalObject, scope, createTypeError(globalObject, "Unsupported EC curve"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto alg = CryptoAlgorithmIdentifier::ECDH;
+ auto result = CryptoKeyEC::platformImportSpki(alg, curve, Vector<uint8_t>((uint8_t*)data, byteLength), true, CryptoKeyUsageVerify);
+ if (UNLIKELY(result == nullptr)) {
+ alg = CryptoAlgorithmIdentifier::ECDSA;
+ result = CryptoKeyEC::platformImportSpki(CryptoAlgorithmIdentifier::ECDSA, curve, Vector<uint8_t>((uint8_t*)data, byteLength), true, CryptoKeyUsageVerify);
+ }
+ if (UNLIKELY(result == nullptr)) {
+ throwException(globalObject, scope, createTypeError(globalObject, "Invalid EC public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ auto impl = result.releaseNonNull();
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(impl)));
+ } else {
+ throwException(globalObject, scope, createTypeError(globalObject, "Unsupported public key"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ }
+
+ JSC::throwTypeError(globalObject, scope, "type should be 'pkcs1' or 'spki'"_s);
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ JSC::throwTypeError(globalObject, scope, "format should be 'pem' or 'der'"_s);
+ return JSValue::encode(JSC::jsUndefined());
+}
+
+JSC::EncodedJSValue KeyObject__createSecretKey(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)
+{
+
+ JSValue bufferArg = callFrame->uncheckedArgument(0);
+ auto& vm = lexicalGlobalObject->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ auto* structure = globalObject->JSCryptoKeyStructure();
+
+ if (!bufferArg.isCell()) {
+ throwException(lexicalGlobalObject, scope, createTypeError(lexicalGlobalObject, "ERR_INVALID_ARG_TYPE: expected Buffer or array-like object"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+
+ auto bufferArgCell = bufferArg.asCell();
+ auto type = bufferArgCell->type();
+
+ switch (type) {
+
+ case DataViewType:
+ case Uint8ArrayType:
+ case Uint8ClampedArrayType:
+ case Uint16ArrayType:
+ case Uint32ArrayType:
+ case Int8ArrayType:
+ case Int16ArrayType:
+ case Int32ArrayType:
+ case Float32ArrayType:
+ case Float64ArrayType:
+ case BigInt64ArrayType:
+ case BigUint64ArrayType: {
+ JSC::JSArrayBufferView* view = jsCast<JSC::JSArrayBufferView*>(bufferArgCell);
+
+ void* data = view->vector();
+ size_t byteLength = view->length();
+ if (UNLIKELY(!data)) {
+ break;
+ }
+ auto impl = CryptoKeyHMAC::generateFromBytes(data, byteLength, CryptoAlgorithmIdentifier::HMAC, true, CryptoKeyUsageSign | CryptoKeyUsageVerify).releaseNonNull();
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, globalObject, WTFMove(impl)));
+ }
+ case ArrayBufferType: {
+ auto* jsBuffer = jsDynamicCast<JSC::JSArrayBuffer*>(bufferArgCell);
+ if (UNLIKELY(!jsBuffer)) {
+ break;
+ }
+ auto* buffer = jsBuffer->impl();
+ void* data = buffer->data();
+ size_t byteLength = buffer->byteLength();
+ if (UNLIKELY(!data)) {
+ break;
+ }
+ Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ auto impl = CryptoKeyHMAC::generateFromBytes(data, byteLength, CryptoAlgorithmIdentifier::HMAC, true, CryptoKeyUsageSign | CryptoKeyUsageVerify).releaseNonNull();
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, globalObject, WTFMove(impl)));
+ }
+ default:
+ throwException(lexicalGlobalObject, scope, createTypeError(lexicalGlobalObject, "ERR_INVALID_ARG_TYPE: expected Buffer or array-like object"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+}
+
+JSC::EncodedJSValue KeyObject__Exports(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame)
+{
+
+ auto count = callFrame->argumentCount();
+ auto& vm = globalObject->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ if (count < 2) {
+ JSC::throwTypeError(globalObject, scope, "exports requires 2 arguments"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ auto* key = jsDynamicCast<JSCryptoKey*>(callFrame->argument(0));
+ if (!key) {
+ // No JSCryptoKey instance
+ JSC::throwTypeError(globalObject, scope, "expected CryptoKey as first argument"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ auto& wrapped = key->wrapped();
+ auto key_type = wrapped.type();
+ auto id = wrapped.keyClass();
+ if (auto* options = jsDynamicCast<JSC::JSObject*>(callFrame->argument(1))) {
+ JSValue formatJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "format"_s)));
+ JSValue typeJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "type"_s)));
+ JSValue passphraseJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "passphrase"_s)));
+ auto hasPassphrase = !passphraseJSValue.isUndefinedOrNull() && !passphraseJSValue.isEmpty();
+ if (formatJSValue.isUndefinedOrNull() || formatJSValue.isEmpty()) {
+ JSC::throwTypeError(globalObject, scope, "format is expected to be a string"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ auto string = formatJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ if (string == "jwk"_s && hasPassphrase) {
+ JSC::throwTypeError(globalObject, scope, "encryption is not supported for jwk format"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ switch (id) {
+ case CryptoKeyClass::HMAC: {
+ const auto& hmac = downcast<WebCore::CryptoKeyHMAC>(wrapped);
+ if (string == "buffer"_s) {
+ auto keyData = hmac.key();
+ auto size = keyData.size();
+ auto* buffer = jsCast<JSUint8Array*>(JSValue::decode(JSBuffer__bufferFromLength(globalObject, size)));
+ if (size > 0)
+ memcpy(buffer->vector(), keyData.data(), size);
+
+ return JSC::JSValue::encode(buffer);
+ } else if (string == "jwk"_s) {
+ const JsonWebKey& jwkValue = hmac.exportJwk();
+ Zig::GlobalObject* domGlobalObject = reinterpret_cast<Zig::GlobalObject*>(globalObject);
+ return JSC::JSValue::encode(WebCore::convertDictionaryToJS(*globalObject, *domGlobalObject, jwkValue, true));
+ }
+ break;
+ }
+ case CryptoKeyClass::AES: {
+ const auto& aes = downcast<WebCore::CryptoKeyAES>(wrapped);
+ if (string == "buffer"_s) {
+ auto keyData = aes.key();
+ auto size = keyData.size();
+ auto* buffer = jsCast<JSUint8Array*>(JSValue::decode(JSBuffer__bufferFromLength(globalObject, size)));
+ if (size > 0)
+ memcpy(buffer->vector(), keyData.data(), size);
+
+ return JSC::JSValue::encode(buffer);
+ } else if (string == "jwk"_s) {
+ const JsonWebKey& jwkValue = aes.exportJwk();
+ Zig::GlobalObject* domGlobalObject = reinterpret_cast<Zig::GlobalObject*>(globalObject);
+ return JSC::JSValue::encode(WebCore::convertDictionaryToJS(*globalObject, *domGlobalObject, jwkValue, true));
+ }
+ break;
+ }
+ case CryptoKeyClass::RSA: {
+ const auto& rsa = downcast<WebCore::CryptoKeyRSA>(wrapped);
+ if (string == "jwk"_s) {
+ const JsonWebKey& jwkValue = rsa.exportJwk();
+ Zig::GlobalObject* domGlobalObject = reinterpret_cast<Zig::GlobalObject*>(globalObject);
+ return JSC::JSValue::encode(WebCore::convertDictionaryToJS(*globalObject, *domGlobalObject, jwkValue, true));
+ } else {
+ WTF::String type = "pkcs1"_s;
+ if (!typeJSValue.isUndefinedOrNull() && !typeJSValue.isEmpty()) {
+ if (!typeJSValue.isString()) {
+ JSC::throwTypeError(globalObject, scope, "type must be a string"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ type = typeJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ }
+
+ auto* bio = BIO_new(BIO_s_mem());
+ auto* rsaKey = rsa.platformKey();
+ auto* rsa_ptr = EVP_PKEY_get0_RSA(rsaKey);
+
+ if (key_type == CryptoKeyType::Public) {
+ if (string == "pem"_s) {
+ if (type == "pkcs1"_s) {
+ if (PEM_write_bio_RSAPublicKey(bio, rsa_ptr) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write public key"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else if (type == "spki"_s) {
+ if (PEM_write_bio_PUBKEY(bio, rsaKey) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write public key"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "type should be 'pkcs1' or 'spki'"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ } else if (string == "der"_s) {
+ if (type == "pkcs1"_s) {
+ if (i2d_RSAPublicKey_bio(bio, rsa_ptr) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write public key"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else if (type == "spki"_s) {
+ if (i2d_PUBKEY_bio(bio, rsaKey) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write public key"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "type should be 'pkcs1' or 'spki'"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "format expected to be 'der', 'pem' or 'jwk'"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSValue cipherJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "cipher"_s)));
+
+ const EVP_CIPHER* cipher = nullptr;
+ if (!cipherJSValue.isUndefinedOrNull() && !cipherJSValue.isEmpty() && cipherJSValue.isString()) {
+ auto cipher_wtfstr = cipherJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ if (!cipher_wtfstr.isNull()) {
+ auto cipherOrError = cipher_wtfstr.tryGetUTF8();
+ if (!cipherOrError.has_value()) {
+ JSC::throwTypeError(globalObject, scope, "invalid cipher name"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ } else {
+ auto value = cipherOrError.value();
+ auto cipher_str = value.data();
+ if (cipher_str != nullptr) {
+ cipher = EVP_get_cipherbyname(cipher_str);
+ }
+ }
+ }
+ }
+ void* passphrase = nullptr;
+ size_t passphrase_len = 0;
+ if (hasPassphrase) {
+ if (!cipher) {
+ JSC::throwTypeError(globalObject, scope, "cipher is required when passphrase is specified"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ if (passphraseJSValue.isString()) {
+ auto passphrase_wtfstr = passphraseJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ if (!passphrase_wtfstr.isNull()) {
+ if (auto pass = passphrase_wtfstr.tryGetUTF8()) {
+ if (pass.has_value()) {
+ auto value = pass.value();
+ passphrase = const_cast<char*>(value.data());
+ passphrase_len = value.length();
+ }
+ }
+ }
+ } else if (auto* passphraseBuffer = jsDynamicCast<JSUint8Array*>(passphraseJSValue)) {
+ passphrase = passphraseBuffer->vector();
+ passphrase_len = passphraseBuffer->byteLength();
+ } else {
+ JSC::throwTypeError(globalObject, scope, "passphrase must be a Buffer or String"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ }
+
+ if (string == "pem"_s) {
+ if (type == "pkcs1"_s) {
+ if (PEM_write_bio_RSAPrivateKey(bio, rsa_ptr, cipher, (unsigned char*)passphrase, passphrase_len, nullptr, nullptr) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write private key"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else if (type == "pkcs8"_s) {
+ if (PEM_write_bio_PKCS8PrivateKey(bio, rsaKey, cipher, (char*)passphrase, passphrase_len, nullptr, nullptr) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write private key"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "type should be 'pkcs1' or 'pkcs8'"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else if (string == "der"_s) {
+ if (type == "pkcs1"_s) {
+ if (i2d_RSAPrivateKey_bio(bio, rsa_ptr) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write private key"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else if (type == "pkcs8"_s) {
+ if (i2d_PKCS8PrivateKey_bio(bio, rsaKey, cipher, (char*)passphrase, passphrase_len, nullptr, nullptr) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write private key"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "type should be 'pkcs1' or 'pkcs8'"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "format expected to be 'der', 'pem' or 'jwk'"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ }
+
+ BUF_MEM* bptr;
+ BIO_get_mem_ptr(bio, &bptr);
+ auto length = bptr->length;
+ if (string == "pem"_s) {
+ auto str = WTF::String::fromUTF8(bptr->data, length);
+ return JSValue::encode(JSC::jsString(vm, str));
+ }
+
+ auto* buffer = jsCast<JSUint8Array*>(JSValue::decode(JSBuffer__bufferFromLength(globalObject, length)));
+ if (length > 0)
+ memcpy(buffer->vector(), bptr->data, length);
+
+ BIO_free(bio);
+ return JSC::JSValue::encode(buffer);
+ }
+ }
+ case CryptoKeyClass::EC: {
+ const auto& ec = downcast<WebCore::CryptoKeyEC>(wrapped);
+ if (string == "jwk"_s) {
+ auto result = ec.exportJwk();
+ if (result.hasException()) {
+ WebCore::propagateException(*globalObject, scope, result.releaseException());
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ const JsonWebKey& jwkValue = result.releaseReturnValue();
+ Zig::GlobalObject* domGlobalObject = reinterpret_cast<Zig::GlobalObject*>(globalObject);
+ return JSC::JSValue::encode(WebCore::convertDictionaryToJS(*globalObject, *domGlobalObject, jwkValue, true));
+ } else {
+ WTF::String type = "spki"_s;
+ if (!typeJSValue.isUndefinedOrNull() && !typeJSValue.isEmpty()) {
+ if (!typeJSValue.isString()) {
+ JSC::throwTypeError(globalObject, scope, "type must be a string"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ type = typeJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ }
+
+ auto* bio = BIO_new(BIO_s_mem());
+ auto* ecKey = ec.platformKey();
+ auto* ec_ptr = EVP_PKEY_get1_EC_KEY(ecKey);
+
+ if (key_type == CryptoKeyType::Public) {
+ if (string == "pem"_s) {
+ if (type == "spki"_s) {
+ if (PEM_write_bio_PUBKEY(bio, ecKey) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write public key"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "type should be 'spki'"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ } else if (string == "der"_s) {
+ if (type == "spki"_s) {
+ if (i2d_PUBKEY_bio(bio, ecKey) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write public key"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "type should be 'spki'"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "format expected to be 'der', 'pem' or 'jwk'"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSValue passphraseJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "passphrase"_s)));
+ JSValue cipherJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "cipher"_s)));
+
+ const EVP_CIPHER* cipher = nullptr;
+ if (!cipherJSValue.isUndefinedOrNull() && !cipherJSValue.isEmpty()) {
+ auto cipher_wtfstr = cipherJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ if (!cipher_wtfstr.isNull()) {
+ auto cipherOrError = cipher_wtfstr.tryGetUTF8();
+ if (!cipherOrError.has_value()) {
+ JSC::throwTypeError(globalObject, scope, "invalid cipher name"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ } else {
+ auto value = cipherOrError.value();
+ auto cipher_str = value.data();
+ if (cipher_str != nullptr) {
+ cipher = EVP_get_cipherbyname(cipher_str);
+ }
+ }
+ }
+ }
+ void* passphrase = nullptr;
+ size_t passphrase_len = 0;
+ auto hasPassphrase = !passphraseJSValue.isUndefinedOrNull() && !passphraseJSValue.isEmpty();
+
+ if (hasPassphrase) {
+ if (!cipher) {
+ JSC::throwTypeError(globalObject, scope, "cipher is required when passphrase is specified"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ if (passphraseJSValue.isString()) {
+ auto passphrase_wtfstr = passphraseJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ if (!passphrase_wtfstr.isNull()) {
+ if (auto pass = passphrase_wtfstr.tryGetUTF8()) {
+ if (pass.has_value()) {
+ auto value = pass.value();
+ passphrase = const_cast<char*>(value.data());
+ passphrase_len = value.length();
+ }
+ }
+ }
+ } else if (auto* passphraseBuffer = jsDynamicCast<JSUint8Array*>(passphraseJSValue)) {
+ passphrase = passphraseBuffer->vector();
+ passphrase_len = passphraseBuffer->byteLength();
+ } else {
+ JSC::throwTypeError(globalObject, scope, "passphrase must be a Buffer or String"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ }
+
+ if (string == "pem"_s) {
+ if (type == "sec1"_s) {
+ if (PEM_write_bio_ECPrivateKey(bio, ec_ptr, cipher, (unsigned char*)passphrase, passphrase_len, nullptr, nullptr) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write private key"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else if (type == "pkcs8"_s) {
+ if (PEM_write_bio_PKCS8PrivateKey(bio, ecKey, cipher, (char*)passphrase, passphrase_len, nullptr, nullptr) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write private key"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "type should be 'sec1' or 'pkcs8'"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else if (string == "der"_s) {
+ if (type == "sec1"_s) {
+ if (i2d_ECPrivateKey_bio(bio, ec_ptr) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write private key"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else if (type == "pkcs8"_s) {
+ if (i2d_PKCS8PrivateKey_bio(bio, ecKey, cipher, (char*)passphrase, passphrase_len, nullptr, nullptr) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write private key"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "type should be 'sec1' or 'pkcs8'"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "format expected to be 'der', 'pem' or 'jwk'"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ }
+
+ BUF_MEM* bptr;
+ BIO_get_mem_ptr(bio, &bptr);
+ auto length = bptr->length;
+ if (string == "pem"_s) {
+ auto str = WTF::String::fromUTF8(bptr->data, length);
+ return JSValue::encode(JSC::jsString(vm, str));
+ }
+
+ auto* buffer = jsCast<JSUint8Array*>(JSValue::decode(JSBuffer__bufferFromLength(globalObject, length)));
+ if (length > 0)
+ memcpy(buffer->vector(), bptr->data, length);
+
+ BIO_free(bio);
+ return JSC::JSValue::encode(buffer);
+ }
+ }
+ case CryptoKeyClass::OKP: {
+ const auto& okpKey = downcast<WebCore::CryptoKeyOKP>(wrapped);
+ if (string == "jwk"_s) {
+ auto result = okpKey.exportJwk();
+ if (result.hasException()) {
+ WebCore::propagateException(*globalObject, scope, result.releaseException());
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ const JsonWebKey& jwkValue = result.releaseReturnValue();
+ Zig::GlobalObject* domGlobalObject = reinterpret_cast<Zig::GlobalObject*>(globalObject);
+ return JSC::JSValue::encode(WebCore::convertDictionaryToJS(*globalObject, *domGlobalObject, jwkValue, true));
+ } else {
+ WTF::String type = "pkcs8"_s;
+ if (!typeJSValue.isUndefinedOrNull() && !typeJSValue.isEmpty()) {
+ if (!typeJSValue.isString()) {
+ JSC::throwTypeError(globalObject, scope, "type must be a string"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ type = typeJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ }
+
+ auto keyData = okpKey.exportKey();
+ auto* bio = BIO_new(BIO_s_mem());
+
+ EVP_PKEY* evpKey;
+ // TODO: CHECK THIS WHEN X488 AND ED448 ARE ADDED
+ if (okpKey.type() == CryptoKeyType::Private) {
+ evpKey = EVP_PKEY_new_raw_private_key(okpKey.namedCurve() == CryptoKeyOKP::NamedCurve::X25519 ? EVP_PKEY_X25519 : EVP_PKEY_ED25519, nullptr, keyData.data(), keyData.size());
+ JSValue passphraseJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "passphrase"_s)));
+ JSValue cipherJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "cipher"_s)));
+
+ const EVP_CIPHER* cipher = nullptr;
+ if (!cipherJSValue.isUndefinedOrNull() && !cipherJSValue.isEmpty() && cipherJSValue.isString()) {
+ auto cipher_wtfstr = cipherJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ if (!cipher_wtfstr.isNull()) {
+ auto cipherOrError = cipher_wtfstr.tryGetUTF8();
+ if (!cipherOrError.has_value()) {
+ JSC::throwTypeError(globalObject, scope, "invalid cipher name"_s);
+ BIO_free(bio);
+ EVP_PKEY_free(evpKey);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ } else {
+ auto value = cipherOrError.value();
+ auto cipher_str = value.data();
+ if (cipher_str != nullptr) {
+ cipher = EVP_get_cipherbyname(cipher_str);
+ }
+ }
+ }
+ }
+ void* passphrase = nullptr;
+ size_t passphrase_len = 0;
+ auto hasPassphrase = !passphraseJSValue.isUndefinedOrNull() && !passphraseJSValue.isEmpty();
+
+ if (hasPassphrase) {
+ if (!cipher) {
+ JSC::throwTypeError(globalObject, scope, "cipher is required when passphrase is specified"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ if (passphraseJSValue.isString()) {
+ auto passphrase_wtfstr = passphraseJSValue.toWTFString(globalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ if (!passphrase_wtfstr.isNull()) {
+ if (auto pass = passphrase_wtfstr.tryGetUTF8()) {
+ if (pass.has_value()) {
+ auto value = pass.value();
+ passphrase = const_cast<char*>(value.data());
+ passphrase_len = value.length();
+ }
+ }
+ }
+ } else if (auto* passphraseBuffer = jsDynamicCast<JSUint8Array*>(passphraseJSValue)) {
+ passphrase = passphraseBuffer->vector();
+ passphrase_len = passphraseBuffer->byteLength();
+ } else {
+ JSC::throwTypeError(globalObject, scope, "passphrase must be a Buffer or String"_s);
+ BIO_free(bio);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ }
+
+ if (string == "pem"_s) {
+ if (type == "pkcs8"_s) {
+ if (PEM_write_bio_PKCS8PrivateKey(bio, evpKey, cipher, (char*)passphrase, passphrase_len, nullptr, nullptr) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write private key"_s);
+ BIO_free(bio);
+ EVP_PKEY_free(evpKey);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "type should be 'pkcs8'"_s);
+ BIO_free(bio);
+ EVP_PKEY_free(evpKey);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else if (string == "der"_s) {
+ if (type == "pkcs8"_s) {
+ if (i2d_PKCS8PrivateKey_bio(bio, evpKey, cipher, (char*)passphrase, passphrase_len, nullptr, nullptr) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write private key"_s);
+ BIO_free(bio);
+ EVP_PKEY_free(evpKey);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "type should be 'pkcs8'"_s);
+ BIO_free(bio);
+ EVP_PKEY_free(evpKey);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "format expected to be 'der', 'pem' or 'jwk'"_s);
+ BIO_free(bio);
+ EVP_PKEY_free(evpKey);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ evpKey = EVP_PKEY_new_raw_public_key(okpKey.namedCurve() == CryptoKeyOKP::NamedCurve::X25519 ? EVP_PKEY_X25519 : EVP_PKEY_ED25519, nullptr, keyData.data(), keyData.size());
+ if (string == "pem"_s) {
+ if (type == "spki"_s) {
+ if (PEM_write_bio_PUBKEY(bio, evpKey) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write public key"_s);
+ BIO_free(bio);
+ EVP_PKEY_free(evpKey);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "type should be 'spki'"_s);
+ BIO_free(bio);
+ EVP_PKEY_free(evpKey);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ } else if (string == "der"_s) {
+ if (type == "spki"_s) {
+ if (i2d_PUBKEY_bio(bio, evpKey) != 1) {
+ JSC::throwTypeError(globalObject, scope, "Failed to write public key"_s);
+ BIO_free(bio);
+ EVP_PKEY_free(evpKey);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "type should be 'spki'"_s);
+ BIO_free(bio);
+ EVP_PKEY_free(evpKey);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ } else {
+ JSC::throwTypeError(globalObject, scope, "format expected to be 'der', 'pem' or 'jwk'"_s);
+ BIO_free(bio);
+ EVP_PKEY_free(evpKey);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ }
+
+ BUF_MEM* bptr;
+ BIO_get_mem_ptr(bio, &bptr);
+ auto length = bptr->length;
+ if (string == "pem"_s) {
+ auto str = WTF::String::fromUTF8(bptr->data, length);
+ EVP_PKEY_free(evpKey);
+ return JSValue::encode(JSC::jsString(vm, str));
+ }
+
+ auto* buffer = jsCast<JSUint8Array*>(JSValue::decode(JSBuffer__bufferFromLength(globalObject, length)));
+ if (length > 0)
+ memcpy(buffer->vector(), bptr->data, length);
+
+ BIO_free(bio);
+ EVP_PKEY_free(evpKey);
+ return JSC::JSValue::encode(buffer);
+ }
+ }
+ case CryptoKeyClass::Raw: {
+ const auto& raw = downcast<WebCore::CryptoKeyRaw>(wrapped);
+ if (string == "buffer"_s) {
+ auto keyData = raw.key();
+ auto size = keyData.size();
+ auto* buffer = jsCast<JSUint8Array*>(JSValue::decode(JSBuffer__bufferFromLength(globalObject, size)));
+ if (size > 0)
+ memcpy(buffer->vector(), keyData.data(), size);
+
+ return JSC::JSValue::encode(buffer);
+ }
+
+ JSC::throwTypeError(globalObject, scope, "format is expected to be 'buffer'"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ default: {
+ JSC::throwTypeError(globalObject, scope, "Invalid Operation"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ }
+ JSC::throwTypeError(globalObject, scope, "format is expected to be 'buffer' or 'jwk'"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ } else {
+ JSC::throwTypeError(globalObject, scope, "expected options to be a object"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+}
+
+static char* bignum_to_string(const BIGNUM* bn)
+{
+ char *tmp, *ret;
+ size_t len;
+
+ // Display large numbers in hex and small numbers in decimal. Converting to
+ // decimal takes quadratic time and is no more useful than hex for large
+ // numbers.
+ if (BN_num_bits(bn) < 32) {
+ return BN_bn2dec(bn);
+ }
+
+ tmp = BN_bn2hex(bn);
+ if (tmp == NULL) {
+ return NULL;
+ }
+
+ len = strlen(tmp) + 3;
+ ret = (char*)OPENSSL_malloc(len);
+ if (ret == NULL) {
+ OPENSSL_free(tmp);
+ return NULL;
+ }
+
+ // Prepend "0x", but place it after the "-" if negative.
+ if (tmp[0] == '-') {
+ OPENSSL_strlcpy(ret, "-0x", len);
+ OPENSSL_strlcat(ret, tmp + 1, len);
+ } else {
+ OPENSSL_strlcpy(ret, "0x", len);
+ OPENSSL_strlcat(ret, tmp, len);
+ }
+ OPENSSL_free(tmp);
+ return ret;
+}
+
+JSC::EncodedJSValue KeyObject_AsymmetricKeyDetails(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)
+{
+
+ if (auto* key = jsDynamicCast<JSCryptoKey*>(callFrame->argument(0))) {
+ auto id = key->wrapped().algorithmIdentifier();
+ auto& vm = lexicalGlobalObject->vm();
+ switch (id) {
+ case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
+ case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
+ case CryptoAlgorithmIdentifier::RSA_OAEP:
+ case CryptoAlgorithmIdentifier::RSA_PSS: {
+ auto* obj = JSC::constructEmptyObject(lexicalGlobalObject);
+
+ auto& wrapped = key->wrapped();
+ const auto& rsa = downcast<WebCore::CryptoKeyRSA>(wrapped);
+ auto* platformKey = rsa.platformKey();
+ const BIGNUM* e; // Public Exponent
+ const BIGNUM* n; // Modulus
+ const RSA* rsa_key = EVP_PKEY_get0_RSA(platformKey);
+ if (rsa_key == nullptr) {
+ return JSValue::encode(JSC::jsUndefined());
+ }
+
+ RSA_get0_key(rsa_key, &n, &e, nullptr);
+
+ auto modulus_length = BN_num_bits(n);
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "modulusLength"_s)), jsNumber(modulus_length), 0);
+
+ auto str = bignum_to_string(e);
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "publicExponent"_s)), JSC::JSBigInt::stringToBigInt(lexicalGlobalObject, StringView::fromLatin1(str)), 0);
+ OPENSSL_free(str);
+
+ if (id == CryptoAlgorithmIdentifier::RSA_PSS) {
+ // Due to the way ASN.1 encoding works, default values are omitted when
+ // encoding the data structure. However, there are also RSA-PSS keys for
+ // which no parameters are set. In that case, the ASN.1 RSASSA-PSS-params
+ // sequence will be missing entirely and RSA_get0_pss_params will return
+ // nullptr. If parameters are present but all parameters are set to their
+ // default values, an empty sequence will be stored in the ASN.1 structure.
+ // In that case, RSA_get0_pss_params does not return nullptr but all fields
+ // of the returned RSA_PSS_PARAMS will be set to nullptr.
+
+ auto* params = RSA_get0_pss_params(rsa_key);
+ if (params != nullptr) {
+ int hash_nid = NID_sha1;
+ int mgf_nid = NID_mgf1;
+ int mgf1_hash_nid = NID_sha1;
+ int64_t salt_length = 20;
+
+ if (params->hashAlgorithm != nullptr) {
+ hash_nid = OBJ_obj2nid(params->hashAlgorithm->algorithm);
+ }
+ auto* hash_srt = OBJ_nid2ln(hash_nid);
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "hashAlgorithm"_s)), Bun::toJS(lexicalGlobalObject, Bun::toString(hash_srt, strlen(hash_srt))), 0);
+ if (params->maskGenAlgorithm != nullptr) {
+ mgf_nid = OBJ_obj2nid(params->maskGenAlgorithm->algorithm);
+ if (mgf_nid == NID_mgf1) {
+ mgf1_hash_nid = OBJ_obj2nid(params->maskHash->algorithm);
+ }
+ }
+
+ // If, for some reason, the MGF is not MGF1, then the MGF1 hash function
+ // is intentionally not added to the object.
+ if (mgf_nid == NID_mgf1) {
+ auto* mgf1_hash_srt = OBJ_nid2ln(mgf1_hash_nid);
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "mgf1HashAlgorithm"_s)), Bun::toJS(lexicalGlobalObject, Bun::toString(mgf1_hash_srt, strlen(mgf1_hash_srt))), 0);
+ }
+
+ if (params->saltLength != nullptr) {
+ if (ASN1_INTEGER_get_int64(&salt_length, params->saltLength) != 1) {
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ throwException(lexicalGlobalObject, scope, createTypeError(lexicalGlobalObject, "Failed to get saltLenght"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ }
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "saltLength"_s)), jsNumber(salt_length), 0);
+ }
+ }
+ return JSC::JSValue::encode(obj);
+ }
+ case CryptoAlgorithmIdentifier::ECDSA:
+ case CryptoAlgorithmIdentifier::ECDH: {
+ auto* obj = JSC::constructEmptyObject(lexicalGlobalObject, lexicalGlobalObject->objectPrototype(), 1);
+
+ auto& wrapped = key->wrapped();
+ const auto& ec = downcast<WebCore::CryptoKeyEC>(wrapped);
+ static const NeverDestroyed<String> values[] = {
+ MAKE_STATIC_STRING_IMPL("prime256v1"),
+ MAKE_STATIC_STRING_IMPL("secp384r1"),
+ MAKE_STATIC_STRING_IMPL("secp521r1"),
+ };
+
+ WTF::String named_curve;
+ switch (ec.namedCurve()) {
+ case CryptoKeyEC::NamedCurve::P256:
+ named_curve = values[0];
+ break;
+ case CryptoKeyEC::NamedCurve::P384:
+ named_curve = values[1];
+ break;
+ case CryptoKeyEC::NamedCurve::P521:
+ named_curve = values[2];
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ named_curve = WTF::emptyString();
+ }
+
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "namedCurve"_s)), JSC::jsString(vm, named_curve), 0);
+ return JSC::JSValue::encode(obj);
+ }
+ case CryptoAlgorithmIdentifier::Ed25519: {
+ auto* obj = JSC::constructEmptyObject(lexicalGlobalObject, lexicalGlobalObject->objectPrototype(), 1);
+ auto& wrapped = key->wrapped();
+ const auto& okp = downcast<WebCore::CryptoKeyOKP>(wrapped);
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "namedCurve"_s)), JSC::jsString(vm, okp.namedCurveString()), 0);
+ return JSC::JSValue::encode(obj);
+ }
+ default:
+ return JSC::JSValue::encode(JSC::jsUndefined());
+ }
+ }
+ return JSC::JSValue::encode(JSC::jsUndefined());
+}
+
+JSC::EncodedJSValue KeyObject__generateKeyPairSync(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)
+{
+ auto count = callFrame->argumentCount();
+ auto& vm = lexicalGlobalObject->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ if (count < 1) {
+ JSC::throwTypeError(lexicalGlobalObject, scope, "generateKeyPairSync requires 1 arguments"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ auto type = callFrame->argument(0);
+ if (type.isUndefinedOrNull() || type.isEmpty() || !type.isString()) {
+ JSC::throwTypeError(lexicalGlobalObject, scope, "type is expected to be a string"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto type_str = type.toWTFString(lexicalGlobalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+
+ Zig::GlobalObject* zigGlobalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ auto* structure = zigGlobalObject->JSCryptoKeyStructure();
+ // TODO: rsa-pss
+ if (type_str == "rsa"_s) {
+ if (count == 1) {
+ JSC::throwTypeError(lexicalGlobalObject, scope, "options.modulusLength are required for rsa"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto* options = jsDynamicCast<JSC::JSObject*>(callFrame->argument(1));
+ if (options == nullptr) {
+ JSC::throwTypeError(lexicalGlobalObject, scope, "options is expected to be a object"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto modulusLengthJS = options->getIfPropertyExists(lexicalGlobalObject, PropertyName(Identifier::fromString(vm, "modulusLength"_s)));
+ if (!modulusLengthJS.isNumber()) {
+ JSC::throwTypeError(lexicalGlobalObject, scope, "options.modulusLength is expected to be a number"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto publicExponentJS = options->getIfPropertyExists(lexicalGlobalObject, PropertyName(Identifier::fromString(vm, "publicExponent"_s)));
+ uint32_t publicExponent = 0x10001;
+ if (publicExponentJS.isNumber()) {
+ publicExponent = publicExponentJS.toUInt32(lexicalGlobalObject);
+ } else if (!publicExponentJS.isUndefinedOrNull() && !publicExponentJS.isEmpty()) {
+ JSC::throwTypeError(lexicalGlobalObject, scope, "options.publicExponent is expected to be a number"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ uint8_t publicExponentArray[4];
+ publicExponentArray[0] = (uint8_t)(publicExponent >> 24);
+ publicExponentArray[1] = (uint8_t)(publicExponent >> 16);
+ publicExponentArray[2] = (uint8_t)(publicExponent >> 8);
+ publicExponentArray[3] = (uint8_t)publicExponent;
+
+ int modulusLength = modulusLengthJS.toUInt32(lexicalGlobalObject);
+ auto returnValue = JSC::JSValue {};
+ auto keyPairCallback = [&](CryptoKeyPair&& pair) {
+ pair.publicKey->setUsagesBitmap(pair.publicKey->usagesBitmap() & CryptoKeyUsageVerify);
+ pair.privateKey->setUsagesBitmap(pair.privateKey->usagesBitmap() & CryptoKeyUsageSign);
+
+ auto obj = JSC::constructEmptyObject(lexicalGlobalObject, lexicalGlobalObject->objectPrototype(), 2);
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "publicKey"_s)), JSCryptoKey::create(structure, zigGlobalObject, pair.publicKey.releaseNonNull()), 0);
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "privateKey"_s)), JSCryptoKey::create(structure, zigGlobalObject, pair.privateKey.releaseNonNull()), 0);
+ returnValue = obj;
+ };
+ auto failureCallback = [&]() {
+ throwException(lexicalGlobalObject, scope, createTypeError(lexicalGlobalObject, "Failed to generate key pair"_s));
+ };
+ // this is actually sync
+ CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSA_OAEP, CryptoAlgorithmIdentifier::SHA_1, false, modulusLength, Vector<uint8_t>((uint8_t*)&publicExponentArray, 4), true, CryptoKeyUsageEncrypt | CryptoKeyUsageDecrypt, WTFMove(keyPairCallback), WTFMove(failureCallback), zigGlobalObject->scriptExecutionContext());
+ return JSValue::encode(returnValue);
+ } else if (type_str == "ec"_s) {
+ if (count == 1) {
+ JSC::throwTypeError(lexicalGlobalObject, scope, "options.namedCurve is required for ec"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto* options = jsDynamicCast<JSC::JSObject*>(callFrame->argument(1));
+ if (options == nullptr) {
+ JSC::throwTypeError(lexicalGlobalObject, scope, "options is expected to be a object"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto namedCurveJS = options->getIfPropertyExists(lexicalGlobalObject, PropertyName(Identifier::fromString(vm, "namedCurve"_s)));
+ if (namedCurveJS.isUndefinedOrNull() || namedCurveJS.isEmpty() || !namedCurveJS.isString()) {
+ JSC::throwTypeError(lexicalGlobalObject, scope, "namedCurve is expected to be a string"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto namedCurve = namedCurveJS.toWTFString(lexicalGlobalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ if(namedCurve == "P-384"_s || namedCurve == "p384"_s || namedCurve == "secp384r1"_s) {
+ namedCurve = "P-384"_s;
+ } else if(namedCurve == "P-256"_s || namedCurve == "p256"_s || namedCurve == "prime256v1"_s) {
+ namedCurve = "P-256"_s;
+ } else if(namedCurve == "P-521"_s || namedCurve == "p521"_s || namedCurve == "secp521r1"_s) {
+ namedCurve = "P-521"_s;
+ }else {
+ throwException(lexicalGlobalObject, scope, createTypeError(lexicalGlobalObject, "curve not supported"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+
+ auto result = CryptoKeyEC::generatePair(CryptoAlgorithmIdentifier::ECDSA, namedCurve, true, CryptoKeyUsageSign | CryptoKeyUsageVerify);
+ if (result.hasException()) {
+ WebCore::propagateException(*lexicalGlobalObject, scope, result.releaseException());
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto pair = result.releaseReturnValue();
+ auto obj = JSC::constructEmptyObject(lexicalGlobalObject, lexicalGlobalObject->objectPrototype(), 2);
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "publicKey"_s)), JSCryptoKey::create(structure, zigGlobalObject, pair.publicKey.releaseNonNull()), 0);
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "privateKey"_s)), JSCryptoKey::create(structure, zigGlobalObject, pair.privateKey.releaseNonNull()), 0);
+ return JSValue::encode(obj);
+ } else if (type_str == "ed25519"_s) {
+ auto result = CryptoKeyOKP::generatePair(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::Ed25519, true, CryptoKeyUsageSign | CryptoKeyUsageVerify);
+ if (result.hasException()) {
+ WebCore::propagateException(*lexicalGlobalObject, scope, result.releaseException());
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto pair = result.releaseReturnValue();
+ auto obj = JSC::constructEmptyObject(lexicalGlobalObject, lexicalGlobalObject->objectPrototype(), 2);
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "publicKey"_s)), JSCryptoKey::create(structure, zigGlobalObject, pair.publicKey.releaseNonNull()), 0);
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "privateKey"_s)), JSCryptoKey::create(structure, zigGlobalObject, pair.privateKey.releaseNonNull()), 0);
+ return JSValue::encode(obj);
+ } else if (type_str == "x25519"_s) {
+ auto result = CryptoKeyOKP::generatePair(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::X25519, true, CryptoKeyUsageSign | CryptoKeyUsageVerify);
+ if (result.hasException()) {
+ WebCore::propagateException(*lexicalGlobalObject, scope, result.releaseException());
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ auto pair = result.releaseReturnValue();
+ auto obj = JSC::constructEmptyObject(lexicalGlobalObject, lexicalGlobalObject->objectPrototype(), 2);
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "publicKey"_s)), JSCryptoKey::create(structure, zigGlobalObject, pair.publicKey.releaseNonNull()), 0);
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "privateKey"_s)), JSCryptoKey::create(structure, zigGlobalObject, pair.privateKey.releaseNonNull()), 0);
+ return JSValue::encode(obj);
+ } else {
+ throwException(lexicalGlobalObject, scope, createTypeError(lexicalGlobalObject, "algorithm should be 'rsa', 'ec', 'x25519' or 'ed25519'"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ return JSValue::encode(JSC::jsUndefined());
+}
+JSC::EncodedJSValue KeyObject__generateKeySync(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)
+{
+ auto count = callFrame->argumentCount();
+ auto& vm = lexicalGlobalObject->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ if (count < 2) {
+ JSC::throwTypeError(lexicalGlobalObject, scope, "generateKeySync requires 2 arguments"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ auto type = callFrame->argument(0);
+ if (type.isUndefinedOrNull() || type.isEmpty() || !type.isString()) {
+ JSC::throwTypeError(lexicalGlobalObject, scope, "type is expected to be a string"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+
+ auto type_str = type.toWTFString(lexicalGlobalObject);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+
+ if (type_str == "hmac"_s) {
+ Zig::GlobalObject* zigGlobalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ auto* structure = zigGlobalObject->JSCryptoKeyStructure();
+ size_t lengthBits = 0;
+ auto length = callFrame->argument(1);
+ if (!length.isNumber()) {
+ JSC::throwTypeError(lexicalGlobalObject, scope, "length is expected to be a number"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ lengthBits = length.toUInt32(lexicalGlobalObject);
+ auto result = CryptoKeyHMAC::generate(lengthBits, WebCore::CryptoAlgorithmIdentifier::HMAC, true, CryptoKeyUsageSign | CryptoKeyUsageVerify);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(lexicalGlobalObject, scope, createTypeError(lexicalGlobalObject, "Invalid length"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(result.releaseNonNull())));
+ } else if (type_str == "aes"_s) {
+ Zig::GlobalObject* zigGlobalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ auto* structure = zigGlobalObject->JSCryptoKeyStructure();
+ size_t lengthBits = 0;
+ if (count > 1) {
+ auto length = callFrame->argument(1);
+ if (!length.isNumber()) {
+ JSC::throwTypeError(lexicalGlobalObject, scope, "length is expected to be a number"_s);
+ return JSC::JSValue::encode(JSC::JSValue {});
+ }
+ lengthBits = length.toUInt32(lexicalGlobalObject);
+ }
+
+ auto result = CryptoKeyAES::generate(WebCore::CryptoAlgorithmIdentifier::AES_CBC, lengthBits, true, CryptoKeyUsageSign | CryptoKeyUsageVerify);
+ if (UNLIKELY(result == nullptr)) {
+ throwException(lexicalGlobalObject, scope, createTypeError(lexicalGlobalObject, "Invalid length"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ return JSC::JSValue::encode(JSCryptoKey::create(structure, zigGlobalObject, WTFMove(result.releaseNonNull())));
+ } else {
+ throwException(lexicalGlobalObject, scope, createTypeError(lexicalGlobalObject, "algorithm should be 'aes' or 'hmac'"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+}
+
+JSC::EncodedJSValue KeyObject__AsymmetricKeyType(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)
+{
+ static const NeverDestroyed<String> values[] = {
+ MAKE_STATIC_STRING_IMPL("rsa"),
+ MAKE_STATIC_STRING_IMPL("rsa-pss"),
+ MAKE_STATIC_STRING_IMPL("ec"),
+ MAKE_STATIC_STRING_IMPL("x25519"),
+ MAKE_STATIC_STRING_IMPL("ed25519"),
+ };
+
+ // TODO: Look into DSA and DH
+ if (auto* key = jsDynamicCast<JSCryptoKey*>(callFrame->argument(0))) {
+ auto id = key->wrapped().algorithmIdentifier();
+ switch (id) {
+ case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
+ case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
+ case CryptoAlgorithmIdentifier::RSA_OAEP:
+ return JSC::JSValue::encode(JSC::jsStringWithCache(lexicalGlobalObject->vm(), values[0]));
+ case CryptoAlgorithmIdentifier::RSA_PSS:
+ return JSC::JSValue::encode(JSC::jsStringWithCache(lexicalGlobalObject->vm(), values[1]));
+ case CryptoAlgorithmIdentifier::ECDSA:
+ case CryptoAlgorithmIdentifier::ECDH:
+ return JSC::JSValue::encode(JSC::jsStringWithCache(lexicalGlobalObject->vm(), values[2]));
+ case CryptoAlgorithmIdentifier::Ed25519: {
+ const auto& okpKey = downcast<WebCore::CryptoKeyOKP>(key->wrapped());
+ // TODO: CHECK THIS WHEN X488 AND ED448 ARE ADDED
+ return JSC::JSValue::encode(JSC::jsStringWithCache(lexicalGlobalObject->vm(), String(okpKey.namedCurve() == CryptoKeyOKP::NamedCurve::X25519 ? values[3] : values[4])));
+ }
+ default:
+ return JSC::JSValue::encode(JSC::jsUndefined());
+ }
+ }
+ return JSC::JSValue::encode(JSC::jsUndefined());
+}
+
+static Vector<uint8_t> GetRawKeyFromSecret(WebCore::CryptoKey& key)
+{
+ auto id = key.keyClass();
+ switch (id) {
+ case CryptoKeyClass::HMAC: {
+ const auto& hmac = downcast<WebCore::CryptoKeyHMAC>(key);
+ return hmac.key();
+ }
+ case CryptoKeyClass::AES: {
+ const auto& aes = downcast<WebCore::CryptoKeyAES>(key);
+ return aes.key();
+ }
+ case CryptoKeyClass::Raw: {
+ const auto& raw = downcast<WebCore::CryptoKeyRaw>(key);
+ return raw.key();
+ }
+ default: {
+ Vector<uint8_t> empty;
+ return empty;
+ }
+ }
+}
+static AsymmetricKeyValue GetInternalAsymmetricKey(WebCore::CryptoKey& key)
+{
+ auto id = key.algorithmIdentifier();
+ switch (id) {
+ case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
+ case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
+ case CryptoAlgorithmIdentifier::RSA_OAEP:
+ case CryptoAlgorithmIdentifier::RSA_PSS:
+ return (AsymmetricKeyValue) { .key = downcast<WebCore::CryptoKeyRSA>(key).platformKey(), .owned = false };
+ case CryptoAlgorithmIdentifier::ECDSA:
+ case CryptoAlgorithmIdentifier::ECDH:
+ return (AsymmetricKeyValue) { .key = downcast<WebCore::CryptoKeyEC>(key).platformKey(), .owned = false };
+ case CryptoAlgorithmIdentifier::Ed25519: {
+ const auto& okpKey = downcast<WebCore::CryptoKeyOKP>(key);
+ auto keyData = okpKey.exportKey();
+ if (okpKey.type() == CryptoKeyType::Private) {
+ auto* evp_key = EVP_PKEY_new_raw_private_key(okpKey.namedCurve() == CryptoKeyOKP::NamedCurve::X25519 ? EVP_PKEY_X25519 : EVP_PKEY_ED25519, nullptr, keyData.data(), keyData.size());
+ return (AsymmetricKeyValue) { .key = evp_key, .owned = true };
+ } else {
+ auto* evp_key = EVP_PKEY_new_raw_public_key(okpKey.namedCurve() == CryptoKeyOKP::NamedCurve::X25519 ? EVP_PKEY_X25519 : EVP_PKEY_ED25519, nullptr, keyData.data(), keyData.size());
+ return (AsymmetricKeyValue) { .key = evp_key, .owned = true };
+ }
+ }
+ default:
+ return (AsymmetricKeyValue) { .key = NULL, .owned = false };
+ }
+}
+
+JSC::EncodedJSValue KeyObject__Equals(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)
+{
+ if (auto* key = jsDynamicCast<JSCryptoKey*>(callFrame->argument(0))) {
+ if (auto* key2 = jsDynamicCast<JSCryptoKey*>(callFrame->argument(1))) {
+ auto& wrapped = key->wrapped();
+ auto& wrapped2 = key2->wrapped();
+ auto key_type = wrapped.type();
+ auto key_class = wrapped.keyClass();
+ if (key_type != wrapped2.type()) {
+ return JSC::JSValue::encode(jsBoolean(false));
+ }
+
+ if (key_type == CryptoKeyType::Secret) {
+ auto keyData = GetRawKeyFromSecret(wrapped);
+ auto keyData2 = GetRawKeyFromSecret(wrapped2);
+ auto size = keyData.size();
+
+ if (size != keyData2.size()) {
+ return JSC::JSValue::encode(jsBoolean(false));
+ }
+ return JSC::JSValue::encode(jsBoolean(CRYPTO_memcmp(keyData.data(), keyData2.data(), size) == 0));
+ }
+ auto evp_key = GetInternalAsymmetricKey(wrapped);
+ auto evp_key2 = GetInternalAsymmetricKey(wrapped2);
+
+ int ok = !evp_key.key || !evp_key2.key ? -2 : EVP_PKEY_cmp(evp_key.key, evp_key2.key);
+
+ if (evp_key.key && evp_key.owned) {
+ EVP_PKEY_free(evp_key.key);
+ }
+ if (evp_key2.key && evp_key2.owned) {
+ EVP_PKEY_free(evp_key2.key);
+ }
+ if (ok == -2) {
+ auto& vm = lexicalGlobalObject->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ throwException(lexicalGlobalObject, scope, createTypeError(lexicalGlobalObject, "ERR_CRYPTO_UNSUPPORTED_OPERATION"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+ return JSC::JSValue::encode(jsBoolean(ok == 1));
+ }
+ }
+ return JSC::JSValue::encode(jsBoolean(false));
+}
+
+JSC::EncodedJSValue KeyObject__SymmetricKeySize(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame)
+{
+ if (auto* key = jsDynamicCast<JSCryptoKey*>(callFrame->argument(0))) {
+ auto& wrapped = key->wrapped();
+ auto id = wrapped.keyClass();
+ size_t size = 0;
+ switch (id) {
+ case CryptoKeyClass::HMAC: {
+ const auto& hmac = downcast<WebCore::CryptoKeyHMAC>(wrapped);
+ auto keyData = hmac.key();
+ size = keyData.size();
+ break;
+ }
+ case CryptoKeyClass::AES: {
+ const auto& aes = downcast<WebCore::CryptoKeyAES>(wrapped);
+ auto keyData = aes.key();
+ size = keyData.size();
+ break;
+ }
+ case CryptoKeyClass::Raw: {
+ const auto& raw = downcast<WebCore::CryptoKeyRaw>(wrapped);
+ auto keyData = raw.key();
+ size = keyData.size();
+ break;
+ }
+ default: {
+ return JSC::JSValue::encode(JSC::jsUndefined());
+ }
+ }
+
+ if (!size) {
+ return JSC::JSValue::encode(JSC::jsUndefined());
+ }
+
+ return JSC::JSValue::encode(JSC::jsNumber(size));
+ }
+
+ return JSC::JSValue::encode(JSC::jsUndefined());
+}
+
+} \ No newline at end of file
diff --git a/src/bun.js/bindings/KeyObject.h b/src/bun.js/bindings/KeyObject.h
new file mode 100644
index 000000000..c9b172e3b
--- /dev/null
+++ b/src/bun.js/bindings/KeyObject.h
@@ -0,0 +1,18 @@
+
+#pragma once
+
+#include "root.h"
+#include "helpers.h"
+namespace WebCore {
+
+JSC::EncodedJSValue KeyObject__AsymmetricKeyType(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC::EncodedJSValue KeyObject_AsymmetricKeyDetails(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC::EncodedJSValue KeyObject__SymmetricKeySize(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame);
+JSC::EncodedJSValue KeyObject__Equals(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC::EncodedJSValue KeyObject__Exports(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame);
+JSC::EncodedJSValue KeyObject__createSecretKey(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC::EncodedJSValue KeyObject__createPublicKey(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC::EncodedJSValue KeyObject__createPrivateKey(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC::EncodedJSValue KeyObject__generateKeySync(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC::EncodedJSValue KeyObject__generateKeyPairSync(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+} \ No newline at end of file
diff --git a/src/bun.js/bindings/ModuleLoader.cpp b/src/bun.js/bindings/ModuleLoader.cpp
index 252c446b1..ac980d062 100644
--- a/src/bun.js/bindings/ModuleLoader.cpp
+++ b/src/bun.js/bindings/ModuleLoader.cpp
@@ -27,7 +27,6 @@
#include "EventEmitter.h"
#include "JSEventEmitter.h"
-#include "CommonJSModuleRecord.h"
#include <JavaScriptCore/JSModuleLoader.h>
#include <JavaScriptCore/Completion.h>
#include <JavaScriptCore/JSModuleNamespaceObject.h>
@@ -93,13 +92,20 @@ generateInternalModuleSourceCode(JSC::JSGlobalObject* globalObject, InternalModu
exportNames.reserveCapacity(len);
exportValues.ensureCapacity(len);
- exportNames.append(vm.propertyNames->defaultKeyword);
- exportValues.append(object);
+ bool hasDefault = false;
for (auto& entry : properties) {
+ if (UNLIKELY(entry == vm.propertyNames->defaultKeyword)) {
+ hasDefault = true;
+ }
exportNames.append(entry);
exportValues.append(object->get(globalObject, entry));
}
+
+ if (!hasDefault) {
+ exportNames.append(vm.propertyNames->defaultKeyword);
+ exportValues.append(object);
+ }
};
}
@@ -139,7 +145,7 @@ PendingVirtualModuleResult* PendingVirtualModuleResult::create(VM& vm, Structure
}
Structure* PendingVirtualModuleResult::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
{
- return Structure::create(vm, globalObject, prototype, TypeInfo(CellType, StructureFlags), info());
+ return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
}
PendingVirtualModuleResult::PendingVirtualModuleResult(VM& vm, Structure* structure)
@@ -459,7 +465,7 @@ JSValue fetchCommonJSModule(
}
}
- if (JSC::JSValue virtualModuleResult = JSValue::decode(Bun__runVirtualModule(globalObject, specifier))) {
+ if (JSC::JSValue virtualModuleResult = Bun::runVirtualModule(globalObject, specifier)) {
JSPromise* promise = jsCast<JSPromise*>(handleVirtualModuleResult<true>(globalObject, virtualModuleResult, res, specifier, referrer));
switch (promise->status(vm)) {
case JSPromise::Status::Rejected: {
@@ -534,7 +540,7 @@ JSValue fetchCommonJSModule(
RELEASE_AND_RETURN(scope, {});
}
- target->putDirect(vm, WebCore::clientData(vm)->builtinNames().exportsPublicName(), value, value.isCell() && value.isCallable() ? JSC::PropertyAttribute::Function | 0 : 0);
+ target->putDirect(vm, WebCore::clientData(vm)->builtinNames().exportsPublicName(), value, 0);
target->hasEvaluated = true;
RELEASE_AND_RETURN(scope, target);
}
@@ -634,7 +640,7 @@ static JSValue fetchESMSourceCode(
}
}
- if (JSC::JSValue virtualModuleResult = JSValue::decode(Bun__runVirtualModule(globalObject, specifier))) {
+ if (JSC::JSValue virtualModuleResult = Bun::runVirtualModule(globalObject, specifier)) {
return handleVirtualModuleResult<allowPromise>(globalObject, virtualModuleResult, res, specifier, referrer);
}
diff --git a/src/bun.js/bindings/ModuleLoader.h b/src/bun.js/bindings/ModuleLoader.h
index ee726ebcf..72dd8b49a 100644
--- a/src/bun.js/bindings/ModuleLoader.h
+++ b/src/bun.js/bindings/ModuleLoader.h
@@ -4,6 +4,9 @@
#include "JavaScriptCore/JSCInlines.h"
#include "BunClientData.h"
+extern "C" JSC::EncodedJSValue jsFunctionOnLoadObjectResultResolve(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame);
+extern "C" JSC::EncodedJSValue jsFunctionOnLoadObjectResultReject(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame);
+
namespace Zig {
class GlobalObject;
}
diff --git a/src/bun.js/bindings/NodeVMScript.cpp b/src/bun.js/bindings/NodeVMScript.cpp
index 05921dd8d..e0e0dc93a 100644
--- a/src/bun.js/bindings/NodeVMScript.cpp
+++ b/src/bun.js/bindings/NodeVMScript.cpp
@@ -19,6 +19,7 @@
#include "JavaScriptCore/JSWeakMap.h"
#include "JavaScriptCore/JSWeakMapInlines.h"
#include "JavaScriptCore/JSWithScope.h"
+#include "JavaScriptCore/JSGlobalProxyInlines.h"
#include "Buffer.h"
#include "GCDefferalContext.h"
#include "Buffer.h"
@@ -120,7 +121,7 @@ constructScript(JSGlobalObject* globalObject, CallFrame* callFrame, JSValue newT
auto scope = DECLARE_THROW_SCOPE(vm);
SourceCode source(
- JSC::StringSourceProvider::create(sourceString, JSC::SourceOrigin(WTF::URL::fileURLWithFileSystemPath(options.filename)), options.filename, TextPosition(options.lineOffset, options.columnOffset)),
+ JSC::StringSourceProvider::create(sourceString, JSC::SourceOrigin(WTF::URL::fileURLWithFileSystemPath(options.filename)), options.filename, JSC::SourceTaintedOrigin::Untainted, TextPosition(options.lineOffset, options.columnOffset)),
options.lineOffset.zeroBasedInt(), options.columnOffset.zeroBasedInt());
RETURN_IF_EXCEPTION(scope, {});
NodeVMScript* script = NodeVMScript::create(vm, globalObject, structure, source);
@@ -263,7 +264,7 @@ JSC_DEFINE_HOST_FUNCTION(vmModuleRunInNewContext, (JSGlobalObject * globalObject
}
}
SourceCode source(
- JSC::StringSourceProvider::create(sourceString, JSC::SourceOrigin(WTF::URL::fileURLWithFileSystemPath(options.filename)), options.filename, TextPosition(options.lineOffset, options.columnOffset)),
+ JSC::StringSourceProvider::create(sourceString, JSC::SourceOrigin(WTF::URL::fileURLWithFileSystemPath(options.filename)), options.filename, JSC::SourceTaintedOrigin::Untainted, TextPosition(options.lineOffset, options.columnOffset)),
options.lineOffset.zeroBasedInt(), options.columnOffset.zeroBasedInt());
auto* zigGlobal = reinterpret_cast<Zig::GlobalObject*>(globalObject);
@@ -332,7 +333,7 @@ JSC_DEFINE_HOST_FUNCTION(vmModuleRunInThisContext, (JSGlobalObject * globalObjec
}
}
SourceCode source(
- JSC::StringSourceProvider::create(sourceString, JSC::SourceOrigin(WTF::URL::fileURLWithFileSystemPath(options.filename)), options.filename, TextPosition(options.lineOffset, options.columnOffset)),
+ JSC::StringSourceProvider::create(sourceString, JSC::SourceOrigin(WTF::URL::fileURLWithFileSystemPath(options.filename)), options.filename, JSC::SourceTaintedOrigin::Untainted, TextPosition(options.lineOffset, options.columnOffset)),
options.lineOffset.zeroBasedInt(), options.columnOffset.zeroBasedInt());
auto* zigGlobal = reinterpret_cast<Zig::GlobalObject*>(globalObject);
JSObject* context = asObject(contextObjectValue);
@@ -501,6 +502,7 @@ public:
template<typename CellType, SubspaceAccess>
static GCClient::IsoSubspace* subspaceFor(VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(NodeVMScriptPrototype, Base);
return &vm.plainObjectSpace();
}
static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
diff --git a/src/bun.js/bindings/Path.cpp b/src/bun.js/bindings/Path.cpp
index 808613b0c..6507b7122 100644
--- a/src/bun.js/bindings/Path.cpp
+++ b/src/bun.js/bindings/Path.cpp
@@ -173,7 +173,7 @@ static JSC::JSObject* createPath(JSGlobalObject* globalThis, bool isWindows)
JSC::JSFunction::create(vm, JSC::jsCast<JSC::JSGlobalObject*>(globalThis), 0,
"relative"_s, Path_functionRelative, ImplementationVisibility::Public),
0);
- path->putDirect(vm, clientData->builtinNames().resolvePublicName(),
+ path->putDirect(vm, vm.propertyNames->resolve,
JSC::JSFunction::create(vm, JSC::jsCast<JSC::JSGlobalObject*>(globalThis), 0,
"resolve"_s, Path_functionResolve, ImplementationVisibility::Public),
0);
diff --git a/src/bun.js/bindings/Process.cpp b/src/bun.js/bindings/Process.cpp
index 282cf6460..6fbc797cd 100644
--- a/src/bun.js/bindings/Process.cpp
+++ b/src/bun.js/bindings/Process.cpp
@@ -20,6 +20,8 @@
#include <errno.h>
#include <sys/ioctl.h>
#include "JSNextTickQueue.h"
+#include "ProcessBindingUV.h"
+#include "ProcessBindingNatives.h"
#pragma mark - Node.js Process
@@ -39,11 +41,11 @@
#include <unistd.h> // setuid, getuid
#endif
-namespace Zig {
+namespace Bun {
using namespace JSC;
-#define REPORTED_NODE_VERSION "18.15.0"
+#define REPORTED_NODE_VERSION "20.8.0"
#define processObjectBindingCodeGenerator processObjectInternalsBindingCodeGenerator
#define processObjectMainModuleCodeGenerator moduleMainCodeGenerator
@@ -226,7 +228,7 @@ JSC_DEFINE_HOST_FUNCTION(Process_functionDlopen,
}
}
- JSC::EncodedJSValue (*napi_register_module_v1)(JSC::JSGlobalObject * globalObject,
+ JSC::EncodedJSValue (*napi_register_module_v1)(JSC::JSGlobalObject* globalObject,
JSC::EncodedJSValue exports);
napi_register_module_v1 = reinterpret_cast<JSC::EncodedJSValue (*)(JSC::JSGlobalObject*,
@@ -618,7 +620,7 @@ static void onDidChangeListeners(EventEmitter& eventEmitter, const Identifier& e
continue;
JSGlobalObject* lexicalGlobalObject = context->jsGlobalObject();
- Zig::GlobalObject* globalObject = static_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ Zig::GlobalObject* globalObject = jsCast<Zig::GlobalObject*>(lexicalGlobalObject);
Process* process = jsCast<Process*>(globalObject->processObject());
@@ -677,7 +679,7 @@ JSC_DEFINE_HOST_FUNCTION(Process_functionAbort, (JSGlobalObject * globalObject,
JSC_DEFINE_HOST_FUNCTION(Process_emitWarning, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
{
- Zig::GlobalObject* globalObject = static_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ Zig::GlobalObject* globalObject = jsCast<Zig::GlobalObject*>(lexicalGlobalObject);
VM& vm = globalObject->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
@@ -747,8 +749,8 @@ JSC_DEFINE_CUSTOM_SETTER(setProcessExitCode, (JSC::JSGlobalObject * lexicalGloba
int exitCodeInt = exitCode.toInt32(lexicalGlobalObject);
RETURN_IF_EXCEPTION(throwScope, false);
- if (exitCodeInt < 0 || exitCodeInt > 127) {
- throwRangeError(lexicalGlobalObject, throwScope, "exitCode must be between 0 and 127"_s);
+ if (exitCodeInt < 0 || exitCodeInt > 255) {
+ throwRangeError(lexicalGlobalObject, throwScope, "exitCode must be between 0 and 255"_s);
return false;
}
@@ -808,12 +810,12 @@ static JSValue constructVersions(VM& vm, JSObject* processObject)
object->putDirect(vm, JSC::Identifier::fromString(vm, "usockets"_s),
JSC::JSValue(JSC::jsString(vm, makeString(Bun__versions_usockets))), 0);
- object->putDirect(vm, JSC::Identifier::fromString(vm, "v8"_s), JSValue(JSC::jsString(vm, makeString("10.8.168.20-node.8"_s))), 0);
- object->putDirect(vm, JSC::Identifier::fromString(vm, "uv"_s), JSValue(JSC::jsString(vm, makeString("1.44.2"_s))), 0);
- object->putDirect(vm, JSC::Identifier::fromString(vm, "napi"_s), JSValue(JSC::jsString(vm, makeString("8"_s))), 0);
+ object->putDirect(vm, JSC::Identifier::fromString(vm, "v8"_s), JSValue(JSC::jsString(vm, makeString("11.3.244.8-node.15"_s))), 0);
+ object->putDirect(vm, JSC::Identifier::fromString(vm, "uv"_s), JSValue(JSC::jsString(vm, makeString("1.46.0"_s))), 0);
+ object->putDirect(vm, JSC::Identifier::fromString(vm, "napi"_s), JSValue(JSC::jsString(vm, makeString("9"_s))), 0);
object->putDirect(vm, JSC::Identifier::fromString(vm, "modules"_s),
- JSC::JSValue(JSC::jsString(vm, makeAtomString("108"))));
+ JSC::JSValue(JSC::jsString(vm, makeAtomString("115"))));
return object;
}
@@ -950,7 +952,7 @@ static JSValue constructProcessSend(VM& vm, JSObject* processObject)
if (Bun__GlobalObject__hasIPC(globalObject)) {
return JSC::JSFunction::create(vm, globalObject, 1, String("send"_s), Bun__Process__send, ImplementationVisibility::Public);
} else {
- return jsNumber(4);
+ return jsUndefined();
}
}
@@ -1121,6 +1123,91 @@ JSC_DEFINE_HOST_FUNCTION(Process_functionAssert, (JSGlobalObject * globalObject,
return JSValue::encode(jsUndefined());
}
+#define PROCESS_BINDING_NOT_IMPLEMENTED_ISSUE(str, issue) \
+ { \
+ throwScope.throwException(globalObject, createError(globalObject, String("process.binding(\"" str "\") is not implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/" issue ""_s))); \
+ return JSValue::encode(JSValue {}); \
+ }
+
+#define PROCESS_BINDING_NOT_IMPLEMENTED(str) \
+ { \
+ throwScope.throwException(globalObject, createError(globalObject, String("process.binding(\"" str "\") is not implemented in Bun. If that breaks something, please file an issue and include a reproducible code sample."_s))); \
+ return JSValue::encode(JSValue {}); \
+ }
+
+inline JSValue processBindingUtil(Zig::GlobalObject* globalObject, JSC::VM& vm)
+{
+ auto& builtinNames = WebCore::builtinNames(vm);
+ auto fn = globalObject->getDirect(vm, builtinNames.requireNativeModulePrivateName());
+ auto callData = JSC::getCallData(fn);
+ JSC::MarkedArgumentBuffer args;
+ args.append(jsString(vm, String("util/types"_s)));
+ return JSC::call(globalObject, fn, callData, globalObject, args);
+}
+
+inline JSValue processBindingConfig(Zig::GlobalObject* globalObject, JSC::VM& vm)
+{
+ auto config = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype(), 9);
+#ifdef BUN_DEBUG
+ config->putDirect(vm, Identifier::fromString(vm, "isDebugBuild"_s), jsBoolean(true), 0);
+#else
+ config->putDirect(vm, Identifier::fromString(vm, "isDebugBuild"_s), jsBoolean(false), 0);
+#endif
+ config->putDirect(vm, Identifier::fromString(vm, "hasOpenSSL"_s), jsBoolean(true), 0);
+ config->putDirect(vm, Identifier::fromString(vm, "fipsMode"_s), jsBoolean(true), 0);
+ config->putDirect(vm, Identifier::fromString(vm, "hasIntl"_s), jsBoolean(true), 0);
+ config->putDirect(vm, Identifier::fromString(vm, "hasTracing"_s), jsBoolean(true), 0);
+ config->putDirect(vm, Identifier::fromString(vm, "hasNodeOptions"_s), jsBoolean(true), 0);
+ config->putDirect(vm, Identifier::fromString(vm, "hasInspector"_s), jsBoolean(true), 0);
+ config->putDirect(vm, Identifier::fromString(vm, "noBrowserGlobals"_s), jsBoolean(false), 0);
+ config->putDirect(vm, Identifier::fromString(vm, "bits"_s), jsNumber(64), 0);
+ return config;
+}
+
+JSC_DEFINE_HOST_FUNCTION(Process_functionBinding, (JSGlobalObject * jsGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = jsGlobalObject->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ auto globalObject = jsCast<Zig::GlobalObject*>(jsGlobalObject);
+ auto process = jsCast<Process*>(globalObject->processObject());
+ auto moduleName = callFrame->argument(0).toWTFString(globalObject);
+
+ // clang-format off
+ if (moduleName == "async_wrap"_s) PROCESS_BINDING_NOT_IMPLEMENTED("async_wrap");
+ if (moduleName == "buffer"_s) PROCESS_BINDING_NOT_IMPLEMENTED_ISSUE("buffer", "2020");
+ if (moduleName == "cares_wrap"_s) PROCESS_BINDING_NOT_IMPLEMENTED("cares_wrap");
+ if (moduleName == "config"_s) return JSValue::encode(processBindingConfig(globalObject, vm));
+ if (moduleName == "constants"_s) return JSValue::encode(globalObject->processBindingConstants());
+ if (moduleName == "contextify"_s) PROCESS_BINDING_NOT_IMPLEMENTED("contextify");
+ if (moduleName == "crypto"_s) PROCESS_BINDING_NOT_IMPLEMENTED("crypto");
+ if (moduleName == "fs"_s) PROCESS_BINDING_NOT_IMPLEMENTED_ISSUE("fs", "3546");
+ if (moduleName == "fs_event_wrap"_s) PROCESS_BINDING_NOT_IMPLEMENTED("fs_event_wrap");
+ if (moduleName == "http_parser"_s) PROCESS_BINDING_NOT_IMPLEMENTED("http_parser");
+ if (moduleName == "icu"_s) PROCESS_BINDING_NOT_IMPLEMENTED("icu");
+ if (moduleName == "inspector"_s) PROCESS_BINDING_NOT_IMPLEMENTED("inspector");
+ if (moduleName == "js_stream"_s) PROCESS_BINDING_NOT_IMPLEMENTED("js_stream");
+ if (moduleName == "natives"_s) return JSValue::encode(process->bindingNatives());
+ if (moduleName == "os"_s) PROCESS_BINDING_NOT_IMPLEMENTED("os");
+ if (moduleName == "pipe_wrap"_s) PROCESS_BINDING_NOT_IMPLEMENTED("pipe_wrap");
+ if (moduleName == "process_wrap"_s) PROCESS_BINDING_NOT_IMPLEMENTED("process_wrap");
+ if (moduleName == "signal_wrap"_s) PROCESS_BINDING_NOT_IMPLEMENTED("signal_wrap");
+ if (moduleName == "spawn_sync"_s) PROCESS_BINDING_NOT_IMPLEMENTED("spawn_sync");
+ if (moduleName == "stream_wrap"_s) PROCESS_BINDING_NOT_IMPLEMENTED_ISSUE("stream_wrap", "4957");
+ if (moduleName == "tcp_wrap"_s) PROCESS_BINDING_NOT_IMPLEMENTED("tcp_wrap");
+ if (moduleName == "tls_wrap"_s) PROCESS_BINDING_NOT_IMPLEMENTED("tls_wrap");
+ if (moduleName == "tty_wrap"_s) PROCESS_BINDING_NOT_IMPLEMENTED_ISSUE("tty_wrap", "4694");
+ if (moduleName == "udp_wrap"_s) PROCESS_BINDING_NOT_IMPLEMENTED("udp_wrap");
+ if (moduleName == "url"_s) PROCESS_BINDING_NOT_IMPLEMENTED("url");
+ if (moduleName == "util"_s) return JSValue::encode(processBindingUtil(globalObject, vm));
+ if (moduleName == "uv"_s) return JSValue::encode(process->bindingUV());
+ if (moduleName == "v8"_s) PROCESS_BINDING_NOT_IMPLEMENTED("v8");
+ if (moduleName == "zlib"_s) PROCESS_BINDING_NOT_IMPLEMENTED("zlib");
+ // clang-format on
+
+ throwScope.throwException(globalObject, createError(globalObject, makeString("No such module: "_s, moduleName)));
+ return JSValue::encode(jsUndefined());
+}
+
JSC_DEFINE_HOST_FUNCTION(Process_functionReallyExit, (JSGlobalObject * globalObject, CallFrame* callFrame))
{
auto& vm = globalObject->vm();
@@ -1158,8 +1245,10 @@ void Process::visitChildrenImpl(JSCell* cell, Visitor& visitor)
Process* thisObject = jsCast<Process*>(cell);
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
Base::visitChildren(thisObject, visitor);
- thisObject->cpuUsageStructure.visit(visitor);
- thisObject->memoryUsageStructure.visit(visitor);
+ thisObject->m_cpuUsageStructure.visit(visitor);
+ thisObject->m_memoryUsageStructure.visit(visitor);
+ thisObject->m_bindingUV.visit(visitor);
+ thisObject->m_bindingNatives.visit(visitor);
}
DEFINE_VISIT_CHILDREN(Process);
@@ -1239,6 +1328,16 @@ static Process* getProcessObject(JSC::JSGlobalObject* lexicalGlobalObject, JSVal
return process;
}
+JSC_DEFINE_HOST_FUNCTION(Process_functionConstrainedMemory,
+ (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
+{
+#if OS(LINUX) || OS(FREEBSD)
+ return JSValue::encode(jsDoubleNumber(static_cast<double>(WTF::ramSize())));
+#else
+ return JSValue::encode(jsUndefined());
+#endif
+}
+
JSC_DEFINE_HOST_FUNCTION(Process_functionCpuUsage,
(JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
{
@@ -1252,7 +1351,7 @@ JSC_DEFINE_HOST_FUNCTION(Process_functionCpuUsage,
auto* process = getProcessObject(globalObject, callFrame->thisValue());
- Structure* cpuUsageStructure = process->cpuUsageStructure.getInitializedOnMainThread(process);
+ Structure* cpuUsageStructure = process->cpuUsageStructure();
constexpr double MICROS_PER_SEC = 1000000.0;
@@ -1405,7 +1504,7 @@ JSC_DEFINE_HOST_FUNCTION(Process_functionMemoryUsage,
return JSC::JSValue::encode(JSC::JSValue {});
}
- JSC::JSObject* result = JSC::constructEmptyObject(vm, process->memoryUsageStructure.getInitializedOnMainThread(process));
+ JSC::JSObject* result = JSC::constructEmptyObject(vm, process->memoryUsageStructure());
if (UNLIKELY(throwScope.exception())) {
return JSC::JSValue::encode(JSC::JSValue {});
}
@@ -1525,7 +1624,7 @@ static JSValue constructMemoryUsage(VM& vm, JSObject* processObject)
JSC::JSFunction* rss = JSC::JSFunction::create(vm, globalObject, 0,
String("rss"_s), Process_functionMemoryUsageRSS, ImplementationVisibility::Public);
- memoryUsage->putDirect(vm, JSC::Identifier::fromString(vm, "rss"_s), rss, JSC::PropertyAttribute::Function | 0);
+ memoryUsage->putDirect(vm, JSC::Identifier::fromString(vm, "rss"_s), rss, 0);
return memoryUsage;
}
@@ -1548,14 +1647,14 @@ static JSValue constructProcessNextTickFn(VM& vm, JSObject* processObject)
Zig::GlobalObject* globalObject = jsCast<Zig::GlobalObject*>(lexicalGlobalObject);
JSValue nextTickQueueObject;
if (!globalObject->m_nextTickQueue) {
- Bun::JSNextTickQueue* queue = Bun::JSNextTickQueue::create(globalObject);
- globalObject->m_nextTickQueue.set(vm, globalObject, queue);
- nextTickQueueObject = queue;
+ nextTickQueueObject = Bun::JSNextTickQueue::create(globalObject);
+ globalObject->m_nextTickQueue.set(vm, globalObject, nextTickQueueObject);
} else {
nextTickQueueObject = jsCast<Bun::JSNextTickQueue*>(globalObject->m_nextTickQueue.get());
}
JSC::JSFunction* initializer = JSC::JSFunction::create(vm, processObjectInternalsInitializeNextTickQueueCodeGenerator(vm), lexicalGlobalObject);
+
JSC::MarkedArgumentBuffer args;
args.append(processObject);
args.append(nextTickQueueObject);
@@ -1736,7 +1835,7 @@ JSC_DEFINE_HOST_FUNCTION(Process_functionKill,
return JSValue::encode(jsUndefined());
}
- return JSValue::encode(jsUndefined());
+ return JSValue::encode(jsBoolean(true));
}
extern "C" void Process__emitMessageEvent(Zig::GlobalObject* global, EncodedJSValue value)
@@ -1770,11 +1869,12 @@ extern "C" void Process__emitDisconnectEvent(Zig::GlobalObject* global)
argv constructArgv PropertyCallback
argv0 constructArgv0 PropertyCallback
assert Process_functionAssert Function 1
- binding JSBuiltin Function 1
+ binding Process_functionBinding Function 1
browser constructBrowser PropertyCallback
chdir Process_functionChdir Function 1
config constructProcessConfigObject PropertyCallback
connected processConnected CustomAccessor
+ constrainedMemory Process_functionConstrainedMemory Function 0
cpuUsage Process_functionCpuUsage Function 1
cwd Process_functionCwd Function 1
debugPort processDebugPort CustomAccessor
@@ -1831,7 +1931,6 @@ extern "C" void Process__emitDisconnectEvent(Zig::GlobalObject* global)
_kill Process_functionReallyKill Function 2
@end
*/
-
#include "Process.lut.h"
const JSC::ClassInfo Process::s_info = { "Process"_s, &Base::s_info, &processObjectTable, nullptr,
CREATE_METHOD_TABLE(Process) };
@@ -1840,17 +1939,24 @@ void Process::finishCreation(JSC::VM& vm)
{
Base::finishCreation(vm);
- this->wrapped().onDidChangeListener = &onDidChangeListeners;
+ wrapped().onDidChangeListener = &onDidChangeListeners;
- this->cpuUsageStructure.initLater([](const JSC::LazyProperty<JSC::JSObject, JSC::Structure>::Initializer& init) {
+ m_cpuUsageStructure.initLater([](const JSC::LazyProperty<Process, JSC::Structure>::Initializer& init) {
init.set(constructCPUUsageStructure(init.vm, init.owner->globalObject()));
});
- this->memoryUsageStructure.initLater([](const JSC::LazyProperty<JSC::JSObject, JSC::Structure>::Initializer& init) {
+ m_memoryUsageStructure.initLater([](const JSC::LazyProperty<Process, JSC::Structure>::Initializer& init) {
init.set(constructMemoryUsageStructure(init.vm, init.owner->globalObject()));
});
- this->putDirect(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, String("process"_s)), 0);
+ m_bindingUV.initLater([](const JSC::LazyProperty<Process, JSC::JSObject>::Initializer& init) {
+ init.set(Bun::ProcessBindingUV::create(init.vm, init.owner->globalObject()));
+ });
+ m_bindingNatives.initLater([](const JSC::LazyProperty<Process, JSC::JSObject>::Initializer& init) {
+ init.set(Bun::ProcessBindingNatives::create(init.vm, ProcessBindingNatives::createStructure(init.vm, init.owner->globalObject())));
+ });
+
+ putDirect(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, String("process"_s)), 0);
}
-} // namespace Zig
+} // namespace Bun
diff --git a/src/bun.js/bindings/Process.h b/src/bun.js/bindings/Process.h
index ab344c7fe..1615aabdd 100644
--- a/src/bun.js/bindings/Process.h
+++ b/src/bun.js/bindings/Process.h
@@ -6,7 +6,7 @@
#include "BunClientData.h"
#include "JSEventEmitter.h"
-namespace Zig {
+namespace Bun {
// TODO: find a better place for this
int getRSS(size_t* rss);
@@ -16,6 +16,11 @@ using namespace JSC;
class Process : public WebCore::JSEventEmitter {
using Base = WebCore::JSEventEmitter;
+ LazyProperty<Process, Structure> m_cpuUsageStructure;
+ LazyProperty<Process, Structure> m_memoryUsageStructure;
+ LazyProperty<Process, JSObject> m_bindingUV;
+ LazyProperty<Process, JSObject> m_bindingNatives;
+
public:
Process(JSC::Structure* structure, WebCore::JSDOMGlobalObject& globalObject, Ref<WebCore::EventEmitter>&& impl)
: Base(structure, globalObject, WTFMove(impl))
@@ -50,9 +55,6 @@ public:
return accessor;
}
- LazyProperty<JSObject, Structure> cpuUsageStructure;
- LazyProperty<JSObject, Structure> memoryUsageStructure;
-
DECLARE_VISIT_CHILDREN;
template<typename, SubspaceAccess mode>
@@ -69,6 +71,11 @@ public:
}
void finishCreation(JSC::VM& vm);
+
+ inline Structure* cpuUsageStructure() { return m_cpuUsageStructure.getInitializedOnMainThread(this); }
+ inline Structure* memoryUsageStructure() { return m_memoryUsageStructure.getInitializedOnMainThread(this); }
+ inline JSObject* bindingUV() { return m_bindingUV.getInitializedOnMainThread(this); }
+ inline JSObject* bindingNatives() { return m_bindingNatives.getInitializedOnMainThread(this); }
};
-} // namespace Zig \ No newline at end of file
+} // namespace Bun \ No newline at end of file
diff --git a/src/bun.js/bindings/Process.lut.h b/src/bun.js/bindings/Process.lut.h
index dda54ff01..6016466c2 100644
--- a/src/bun.js/bindings/Process.lut.h
+++ b/src/bun.js/bindings/Process.lut.h
@@ -1,6 +1,6 @@
-// File generated via `make generate-builtins`
-static const struct CompactHashIndex processObjectTableIndex[267] = {
- { 47, -1 },
+// File generated via `make static-hash-table` / `make cpp`
+static const struct CompactHashIndex processObjectTableIndex[268] = {
+ { 48, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
@@ -14,9 +14,9 @@ static const struct CompactHashIndex processObjectTableIndex[267] = {
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 20, -1 },
+ { 21, -1 },
{ -1, -1 },
- { 49, -1 },
+ { 50, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
@@ -41,14 +41,14 @@ static const struct CompactHashIndex processObjectTableIndex[267] = {
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 34, -1 },
+ { 35, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 29, -1 },
- { 13, -1 },
+ { 30, -1 },
+ { 14, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
@@ -57,11 +57,11 @@ static const struct CompactHashIndex processObjectTableIndex[267] = {
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 59, -1 },
+ { 60, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 55, -1 },
+ { 56, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
@@ -75,36 +75,36 @@ static const struct CompactHashIndex processObjectTableIndex[267] = {
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 43, -1 },
+ { 44, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
{ 0, -1 },
- { 28, -1 },
- { 37, -1 },
- { 42, -1 },
+ { 29, -1 },
+ { 38, -1 },
+ { 43, -1 },
{ -1, -1 },
- { 25, -1 },
- { 12, -1 },
+ { 26, -1 },
+ { 13, -1 },
{ -1, -1 },
{ -1, -1 },
- { 62, -1 },
+ { 63, -1 },
{ -1, -1 },
{ -1, -1 },
- { 33, -1 },
- { 44, -1 },
+ { 34, -1 },
+ { 45, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 26, -1 },
+ { 27, -1 },
{ -1, -1 },
{ -1, -1 },
- { 22, -1 },
+ { 23, -1 },
{ -1, -1 },
{ 5, -1 },
{ -1, -1 },
- { 64, -1 },
+ { 65, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
@@ -115,19 +115,19 @@ static const struct CompactHashIndex processObjectTableIndex[267] = {
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 27, 261 },
+ { 28, 262 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 23, 262 },
+ { 24, 263 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 50, 265 },
+ { 51, 266 },
{ -1, -1 },
- { 19, -1 },
+ { 20, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
@@ -139,10 +139,10 @@ static const struct CompactHashIndex processObjectTableIndex[267] = {
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 17, 257 },
+ { 18, 257 },
{ -1, -1 },
- { 14, -1 },
- { 57, -1 },
+ { 15, -1 },
+ { 58, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
@@ -161,12 +161,12 @@ static const struct CompactHashIndex processObjectTableIndex[267] = {
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 3, 266 },
+ { 3, 267 },
{ 1, -1 },
{ -1, -1 },
- { 63, -1 },
+ { 64, -1 },
{ -1, -1 },
- { 11, -1 },
+ { 12, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
@@ -174,24 +174,24 @@ static const struct CompactHashIndex processObjectTableIndex[267] = {
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 56, -1 },
+ { 57, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
{ 10, 256 },
{ -1, -1 },
- { 16, 263 },
+ { 17, 264 },
{ -1, -1 },
- { 39, -1 },
+ { 40, -1 },
{ -1, -1 },
- { 41, -1 },
+ { 42, -1 },
{ -1, -1 },
- { 38, -1 },
- { 6, 264 },
+ { 11, 260 },
+ { 6, 265 },
{ -1, -1 },
{ -1, -1 },
{ 4, -1 },
- { 51, -1 },
+ { 52, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
@@ -205,11 +205,11 @@ static const struct CompactHashIndex processObjectTableIndex[267] = {
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 31, 260 },
+ { 32, 261 },
{ -1, -1 },
{ -1, -1 },
- { 48, -1 },
- { 18, 258 },
+ { 49, -1 },
+ { 19, 258 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
@@ -219,10 +219,10 @@ static const struct CompactHashIndex processObjectTableIndex[267] = {
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 53, -1 },
+ { 54, -1 },
{ -1, -1 },
- { 32, -1 },
- { 24, -1 },
+ { 33, -1 },
+ { 25, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
@@ -233,12 +233,12 @@ static const struct CompactHashIndex processObjectTableIndex[267] = {
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 52, -1 },
+ { 53, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 15, 259 },
+ { 16, 259 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
@@ -256,31 +256,33 @@ static const struct CompactHashIndex processObjectTableIndex[267] = {
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 21, -1 },
- { 30, -1 },
- { 35, -1 },
+ { 22, -1 },
+ { 31, -1 },
{ 36, -1 },
- { 40, -1 },
- { 45, -1 },
+ { 37, -1 },
+ { 39, -1 },
+ { 41, -1 },
{ 46, -1 },
- { 54, -1 },
- { 58, -1 },
- { 60, -1 },
+ { 47, -1 },
+ { 55, -1 },
+ { 59, -1 },
{ 61, -1 },
+ { 62, -1 },
};
-static const struct HashTableValue processObjectTableValues[65] = {
+static const struct HashTableValue processObjectTableValues[66] = {
{ "abort"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, Process_functionAbort, 1 } },
{ "allowedNodeEnvironmentFlags"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, Process_stubEmptySet } },
{ "arch"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, constructArch } },
{ "argv"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, constructArgv } },
{ "argv0"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, constructArgv0 } },
{ "assert"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, Process_functionAssert, 1 } },
- { "binding"_s, ((static_cast<unsigned>(PropertyAttribute::Function)) & ~PropertyAttribute::Function) | PropertyAttribute::Builtin, NoIntrinsic, { HashTableValue::BuiltinGeneratorType, processObjectBindingCodeGenerator, 1 } },
+ { "binding"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, Process_functionBinding, 1 } },
{ "browser"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, constructBrowser } },
{ "chdir"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, Process_functionChdir, 1 } },
{ "config"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, constructProcessConfigObject } },
{ "connected"_s, static_cast<unsigned>(PropertyAttribute::CustomAccessor), NoIntrinsic, { HashTableValue::GetterSetterType, processConnected, setProcessConnected } },
+ { "constrainedMemory"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, Process_functionConstrainedMemory, 0 } },
{ "cpuUsage"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, Process_functionCpuUsage, 1 } },
{ "cwd"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, Process_functionCwd, 1 } },
{ "debugPort"_s, static_cast<unsigned>(PropertyAttribute::CustomAccessor), NoIntrinsic, { HashTableValue::GetterSetterType, processDebugPort, setProcessDebugPort } },
@@ -338,4 +340,4 @@ static const struct HashTableValue processObjectTableValues[65] = {
};
static const struct HashTable processObjectTable =
- { 65, 255, true, nullptr, processObjectTableValues, processObjectTableIndex };
+ { 66, 255, true, nullptr, processObjectTableValues, processObjectTableIndex };
diff --git a/src/bun.js/bindings/ProcessBindingConstants.cpp b/src/bun.js/bindings/ProcessBindingConstants.cpp
index 36a4a7f96..8544b2f20 100644
--- a/src/bun.js/bindings/ProcessBindingConstants.cpp
+++ b/src/bun.js/bindings/ProcessBindingConstants.cpp
@@ -685,9 +685,6 @@ static JSValue processBindingConstantsGetFs(VM& vm, JSObject* bindingObject)
#ifdef O_DIRECTORY
object->putDirect(vm, PropertyName(Identifier::fromString(vm, "O_DIRECTORY"_s)), jsNumber(O_DIRECTORY));
#endif
-#ifdef O_EXCL
- object->putDirect(vm, PropertyName(Identifier::fromString(vm, "O_EXCL"_s)), jsNumber(O_EXCL));
-#endif
#ifdef O_NOATIME
object->putDirect(vm, PropertyName(Identifier::fromString(vm, "O_NOATIME"_s)), jsNumber(O_NOATIME));
#endif
@@ -1082,15 +1079,18 @@ static JSValue processBindingConstantsGetZlib(VM& vm, JSObject* bindingObject)
return object;
}
-static const HashTableValue ProcessBindingConstantsValues[] = {
- { "os"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingConstantsGetOs } },
- { "fs"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingConstantsGetFs } },
- { "crypto"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingConstantsGetCrypto } },
- { "zlib"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingConstantsGetZlib } },
- { "trace"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingConstantsGetTrace } },
-};
+/* Source for ProcessBindingConstants.lut.h
+@begin processBindingConstantsTable
+ os processBindingConstantsGetOs PropertyCallback
+ fs processBindingConstantsGetFs PropertyCallback
+ crypto processBindingConstantsGetCrypto PropertyCallback
+ zlib processBindingConstantsGetZlib PropertyCallback
+ trace processBindingConstantsGetTrace PropertyCallback
+@end
+*/
+#include "ProcessBindingConstants.lut.h"
-const ClassInfo ProcessBindingConstants::s_info = { "ProcessBindingConstants"_s, Base::info(), nullptr, nullptr, CREATE_METHOD_TABLE(ProcessBindingConstants) };
+const ClassInfo ProcessBindingConstants::s_info = { "ProcessBindingConstants"_s, &Base::s_info, &processBindingConstantsTable, nullptr, CREATE_METHOD_TABLE(ProcessBindingConstants) };
ProcessBindingConstants* ProcessBindingConstants::create(VM& vm, Structure* structure)
{
@@ -1107,8 +1107,7 @@ Structure* ProcessBindingConstants::createStructure(VM& vm, JSGlobalObject* glob
void ProcessBindingConstants::finishCreation(JSC::VM& vm)
{
Base::finishCreation(vm);
- reifyStaticProperties(vm, ProcessBindingConstants::info(), ProcessBindingConstantsValues, *this);
- ASSERT(inherits(vm, info()));
+ ASSERT(inherits(info()));
}
template<typename Visitor>
diff --git a/src/bun.js/bindings/ProcessBindingConstants.h b/src/bun.js/bindings/ProcessBindingConstants.h
index 5a9be7ce7..6115534a0 100644
--- a/src/bun.js/bindings/ProcessBindingConstants.h
+++ b/src/bun.js/bindings/ProcessBindingConstants.h
@@ -1,3 +1,4 @@
+#pragma once
#include "root.h"
namespace Bun {
@@ -11,12 +12,15 @@ public:
using Base = JSC::JSNonFinalObject;
+ static constexpr unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
static ProcessBindingConstants* create(JSC::VM& vm, JSC::Structure* structure);
static Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject);
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(ProcessBindingConstants, Base);
return &vm.plainObjectSpace();
}
diff --git a/src/bun.js/bindings/ProcessBindingConstants.lut.h b/src/bun.js/bindings/ProcessBindingConstants.lut.h
new file mode 100644
index 000000000..4ad86860d
--- /dev/null
+++ b/src/bun.js/bindings/ProcessBindingConstants.lut.h
@@ -0,0 +1,31 @@
+// File generated via `make static-hash-table` / `make cpp`
+static const struct CompactHashIndex processBindingConstantsTableIndex[17] = {
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 2, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 0, 16 },
+ { -1, -1 },
+ { -1, -1 },
+ { 4, -1 },
+ { 3, -1 },
+};
+
+static const struct HashTableValue processBindingConstantsTableValues[5] = {
+ { "os"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingConstantsGetOs } },
+ { "fs"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingConstantsGetFs } },
+ { "crypto"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingConstantsGetCrypto } },
+ { "zlib"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingConstantsGetZlib } },
+ { "trace"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingConstantsGetTrace } },
+};
+
+static const struct HashTable processBindingConstantsTable =
+ { 5, 15, false, nullptr, processBindingConstantsTableValues, processBindingConstantsTableIndex };
diff --git a/src/bun.js/bindings/ProcessBindingNatives.cpp b/src/bun.js/bindings/ProcessBindingNatives.cpp
new file mode 100644
index 000000000..2a2685524
--- /dev/null
+++ b/src/bun.js/bindings/ProcessBindingNatives.cpp
@@ -0,0 +1,131 @@
+// Modelled off of https://github.com/nodejs/node/blob/main/src/node_constants.cc
+// Note that if you change any of this code, you probably also have to change NodeConstantsModule.h
+#include "ProcessBindingNatives.h"
+#include "JavaScriptCore/ObjectConstructor.h"
+
+namespace Bun {
+using namespace JSC;
+
+static JSValue processBindingNativesGetter(VM& vm, JSObject* bindingObject)
+{
+ // Instead of actually returning our source code, we just return a dummy string.
+ // Most people just use `process.binding('natives')` to get a list of builtin modules
+ // We also don't report internal modules.
+ // If any of this breaks your package, please open an issue.
+ return jsString(vm, String("/* [native code] */"_s));
+}
+
+static JSValue processBindingNativesReturnUndefined(VM& vm, JSObject* bindingObject)
+{
+ // process.binding('natives').config === undefined
+ return jsUndefined();
+}
+
+/* Source for ProcessBindingNatives.lut.h
+@begin processBindingNativesTable
+ _http_agent processBindingNativesGetter PropertyCallback
+ _http_client processBindingNativesGetter PropertyCallback
+ _http_common processBindingNativesGetter PropertyCallback
+ _http_incoming processBindingNativesGetter PropertyCallback
+ _http_outgoing processBindingNativesGetter PropertyCallback
+ _http_server processBindingNativesGetter PropertyCallback
+ _stream_duplex processBindingNativesGetter PropertyCallback
+ _stream_passthrough processBindingNativesGetter PropertyCallback
+ _stream_readable processBindingNativesGetter PropertyCallback
+ _stream_transform processBindingNativesGetter PropertyCallback
+ _stream_wrap processBindingNativesGetter PropertyCallback
+ _stream_writable processBindingNativesGetter PropertyCallback
+ _tls_common processBindingNativesGetter PropertyCallback
+ _tls_wrap processBindingNativesGetter PropertyCallback
+ assert processBindingNativesGetter PropertyCallback
+ assert/strict processBindingNativesGetter PropertyCallback
+ async_hooks processBindingNativesGetter PropertyCallback
+ buffer processBindingNativesGetter PropertyCallback
+ child_process processBindingNativesGetter PropertyCallback
+ cluster processBindingNativesGetter PropertyCallback
+ console processBindingNativesGetter PropertyCallback
+ constants processBindingNativesGetter PropertyCallback
+ crypto processBindingNativesGetter PropertyCallback
+ dgram processBindingNativesGetter PropertyCallback
+ diagnostics_channel processBindingNativesGetter PropertyCallback
+ dns processBindingNativesGetter PropertyCallback
+ dns/promises processBindingNativesGetter PropertyCallback
+ domain processBindingNativesGetter PropertyCallback
+ events processBindingNativesGetter PropertyCallback
+ fs processBindingNativesGetter PropertyCallback
+ fs/promises processBindingNativesGetter PropertyCallback
+ http processBindingNativesGetter PropertyCallback
+ http2 processBindingNativesGetter PropertyCallback
+ https processBindingNativesGetter PropertyCallback
+ inspector processBindingNativesGetter PropertyCallback
+ inspector/promises processBindingNativesGetter PropertyCallback
+ module processBindingNativesGetter PropertyCallback
+ net processBindingNativesGetter PropertyCallback
+ os processBindingNativesGetter PropertyCallback
+ path processBindingNativesGetter PropertyCallback
+ path/posix processBindingNativesGetter PropertyCallback
+ path/win32 processBindingNativesGetter PropertyCallback
+ perf_hooks processBindingNativesGetter PropertyCallback
+ process processBindingNativesGetter PropertyCallback
+ punycode processBindingNativesGetter PropertyCallback
+ querystring processBindingNativesGetter PropertyCallback
+ readline processBindingNativesGetter PropertyCallback
+ readline/promises processBindingNativesGetter PropertyCallback
+ repl processBindingNativesGetter PropertyCallback
+ stream processBindingNativesGetter PropertyCallback
+ stream/consumers processBindingNativesGetter PropertyCallback
+ stream/promises processBindingNativesGetter PropertyCallback
+ stream/web processBindingNativesGetter PropertyCallback
+ string_decoder processBindingNativesGetter PropertyCallback
+ sys processBindingNativesGetter PropertyCallback
+ test processBindingNativesGetter PropertyCallback
+ test/reporters processBindingNativesGetter PropertyCallback
+ timers processBindingNativesGetter PropertyCallback
+ timers/promises processBindingNativesGetter PropertyCallback
+ tls processBindingNativesGetter PropertyCallback
+ trace_events processBindingNativesGetter PropertyCallback
+ tty processBindingNativesGetter PropertyCallback
+ url processBindingNativesGetter PropertyCallback
+ util processBindingNativesGetter PropertyCallback
+ util/types processBindingNativesGetter PropertyCallback
+ v8 processBindingNativesGetter PropertyCallback
+ vm processBindingNativesGetter PropertyCallback
+ wasi processBindingNativesGetter PropertyCallback
+ worker_threads processBindingNativesGetter PropertyCallback
+ zlib processBindingNativesGetter PropertyCallback
+ configs processBindingNativesReturnUndefined PropertyCallback
+@end
+*/
+#include "ProcessBindingNatives.lut.h"
+
+const ClassInfo ProcessBindingNatives::s_info = { "ProcessBindingNatives"_s, &Base::s_info, &processBindingNativesTable, nullptr, CREATE_METHOD_TABLE(ProcessBindingNatives) };
+
+ProcessBindingNatives* ProcessBindingNatives::create(VM& vm, Structure* structure)
+{
+ ProcessBindingNatives* obj = new (NotNull, allocateCell<ProcessBindingNatives>(vm)) ProcessBindingNatives(vm, structure);
+ obj->finishCreation(vm);
+ return obj;
+}
+
+Structure* ProcessBindingNatives::createStructure(VM& vm, JSGlobalObject* globalObject)
+{
+ return Structure::create(vm, globalObject, jsNull(), TypeInfo(ObjectType, StructureFlags), ProcessBindingNatives::info());
+}
+
+void ProcessBindingNatives::finishCreation(JSC::VM& vm)
+{
+ Base::finishCreation(vm);
+ ASSERT(inherits(info()));
+}
+
+template<typename Visitor>
+void ProcessBindingNatives::visitChildrenImpl(JSCell* cell, Visitor& visitor)
+{
+ ProcessBindingNatives* thisObject = jsCast<ProcessBindingNatives*>(cell);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+ Base::visitChildren(thisObject, visitor);
+}
+
+DEFINE_VISIT_CHILDREN(ProcessBindingNatives);
+
+} // namespace Bun
diff --git a/src/bun.js/bindings/ProcessBindingNatives.h b/src/bun.js/bindings/ProcessBindingNatives.h
new file mode 100644
index 000000000..bbeaaa524
--- /dev/null
+++ b/src/bun.js/bindings/ProcessBindingNatives.h
@@ -0,0 +1,36 @@
+#pragma once
+#include "root.h"
+
+namespace Bun {
+using namespace JSC;
+
+// The object returned from process.binding('natives')
+class ProcessBindingNatives final : public JSC::JSNonFinalObject {
+public:
+ DECLARE_INFO;
+ DECLARE_VISIT_CHILDREN;
+
+ using Base = JSC::JSNonFinalObject;
+
+ static constexpr unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+ static ProcessBindingNatives* create(JSC::VM& vm, JSC::Structure* structure);
+ static Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject);
+
+ template<typename CellType, JSC::SubspaceAccess>
+ static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
+ {
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(ProcessBindingNatives, Base);
+ return &vm.plainObjectSpace();
+ }
+
+private:
+ void finishCreation(JSC::VM& vm);
+
+ ProcessBindingNatives(JSC::VM& vm, JSC::Structure* structure)
+ : Base(vm, structure)
+ {
+ }
+};
+
+} // namespace Bun
diff --git a/src/bun.js/bindings/ProcessBindingNatives.lut.h b/src/bun.js/bindings/ProcessBindingNatives.lut.h
new file mode 100644
index 000000000..2bc7e34f5
--- /dev/null
+++ b/src/bun.js/bindings/ProcessBindingNatives.lut.h
@@ -0,0 +1,339 @@
+// File generated via `make static-hash-table` / `make cpp`
+static const struct CompactHashIndex processBindingNativesTableIndex[259] = {
+ { 11, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 16, -1 },
+ { 40, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 17, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 18, -1 },
+ { -1, -1 },
+ { 59, -1 },
+ { -1, -1 },
+ { 58, -1 },
+ { 29, -1 },
+ { -1, -1 },
+ { 12, -1 },
+ { 56, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 64, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 63, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 61, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 50, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 35, -1 },
+ { 42, -1 },
+ { 55, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 66, -1 },
+ { -1, -1 },
+ { 52, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 60, -1 },
+ { -1, -1 },
+ { 41, -1 },
+ { 21, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 47, -1 },
+ { 30, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 15, -1 },
+ { 70, -1 },
+ { 26, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 54, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 51, -1 },
+ { -1, -1 },
+ { 2, -1 },
+ { 28, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 14, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 27, -1 },
+ { -1, -1 },
+ { 37, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 36, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 1, -1 },
+ { -1, -1 },
+ { 3, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 19, -1 },
+ { -1, -1 },
+ { 10, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 8, 257 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 43, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 5, -1 },
+ { -1, -1 },
+ { 62, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 57, -1 },
+ { 38, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 6, 256 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 22, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 0, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 48, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 4, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 32, -1 },
+ { -1, -1 },
+ { 31, -1 },
+ { 49, -1 },
+ { 34, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 68, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 69, -1 },
+ { 33, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 9, -1 },
+ { 44, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 23, -1 },
+ { -1, -1 },
+ { 7, -1 },
+ { 67, -1 },
+ { -1, -1 },
+ { 24, -1 },
+ { 25, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 20, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 65, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 46, -1 },
+ { -1, -1 },
+ { 45, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 13, -1 },
+ { 39, 258 },
+ { 53, -1 },
+};
+
+static const struct HashTableValue processBindingNativesTableValues[71] = {
+ { "_http_agent"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "_http_client"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "_http_common"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "_http_incoming"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "_http_outgoing"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "_http_server"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "_stream_duplex"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "_stream_passthrough"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "_stream_readable"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "_stream_transform"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "_stream_wrap"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "_stream_writable"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "_tls_common"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "_tls_wrap"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "assert"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "assert/strict"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "async_hooks"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "buffer"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "child_process"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "cluster"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "console"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "constants"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "crypto"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "dgram"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "diagnostics_channel"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "dns"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "dns/promises"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "domain"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "events"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "fs"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "fs/promises"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "http"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "http2"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "https"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "inspector"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "inspector/promises"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "module"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "net"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "os"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "path"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "path/posix"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "path/win32"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "perf_hooks"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "process"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "punycode"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "querystring"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "readline"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "readline/promises"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "repl"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "stream"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "stream/consumers"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "stream/promises"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "stream/web"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "string_decoder"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "sys"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "test"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "test/reporters"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "timers"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "timers/promises"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "tls"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "trace_events"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "tty"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "url"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "util"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "util/types"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "v8"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "vm"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "wasi"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "worker_threads"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "zlib"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesGetter } },
+ { "configs"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, processBindingNativesReturnUndefined } },
+};
+
+static const struct HashTable processBindingNativesTable =
+ { 71, 255, false, nullptr, processBindingNativesTableValues, processBindingNativesTableIndex };
diff --git a/src/bun.js/bindings/ProcessBindingUV.cpp b/src/bun.js/bindings/ProcessBindingUV.cpp
new file mode 100644
index 000000000..8173072a9
--- /dev/null
+++ b/src/bun.js/bindings/ProcessBindingUV.cpp
@@ -0,0 +1,158 @@
+#include "ProcessBindingUV.h"
+#include "ZigGlobalObject.h"
+#include "JavaScriptCore/ObjectConstructor.h"
+#include "JavaScriptCore/JSMap.h"
+#include "JavaScriptCore/JSMapInlines.h"
+
+// clang-format off
+
+#define UV_ERRNO_MAP(macro) \
+ macro(E2BIG, -7, "argument list too long") \
+ macro(EACCES, -13, "permission denied") \
+ macro(EADDRINUSE, -48, "address already in use") \
+ macro(EADDRNOTAVAIL, -49, "address not available") \
+ macro(EAFNOSUPPORT, -47, "address family not supported") \
+ macro(EAGAIN, -35, "resource temporarily unavailable") \
+ macro(EAI_ADDRFAMILY, -3000, "address family not supported") \
+ macro(EAI_AGAIN, -3001, "temporary failure") \
+ macro(EAI_BADFLAGS, -3002, "bad ai_flags value") \
+ macro(EAI_BADHINTS, -3013, "invalid value for hints") \
+ macro(EAI_CANCELED, -3003, "request canceled") \
+ macro(EAI_FAIL, -3004, "permanent failure") \
+ macro(EAI_FAMILY, -3005, "ai_family not supported") \
+ macro(EAI_MEMORY, -3006, "out of memory") \
+ macro(EAI_NODATA, -3007, "no address") \
+ macro(EAI_NONAME, -3008, "unknown node or service") \
+ macro(EAI_OVERFLOW, -3009, "argument buffer overflow") \
+ macro(EAI_PROTOCOL, -3014, "resolved protocol is unknown") \
+ macro(EAI_SERVICE, -3010, "service not available for socket type") \
+ macro(EAI_SOCKTYPE, -3011, "socket type not supported") \
+ macro(EALREADY, -37, "connection already in progress") \
+ macro(EBADF, -9, "bad file descriptor") \
+ macro(EBUSY, -16, "resource busy or locked") \
+ macro(ECANCELED, -89, "operation canceled") \
+ macro(ECHARSET, -4080, "invalid Unicode character") \
+ macro(ECONNABORTED, -53, "software caused connection abort") \
+ macro(ECONNREFUSED, -61, "connection refused") \
+ macro(ECONNRESET, -54, "connection reset by peer") \
+ macro(EDESTADDRREQ, -39, "destination address required") \
+ macro(EEXIST, -17, "file already exists") \
+ macro(EFAULT, -14, "bad address in system call argument") \
+ macro(EFBIG, -27, "file too large") \
+ macro(EHOSTUNREACH, -65, "host is unreachable") \
+ macro(EINTR, -4, "interrupted system call") \
+ macro(EINVAL, -22, "invalid argument") \
+ macro(EIO, -5, "i/o error") \
+ macro(EISCONN, -56, "socket is already connected") \
+ macro(EISDIR, -21, "illegal operation on a directory") \
+ macro(ELOOP, -62, "too many symbolic links encountered") \
+ macro(EMFILE, -24, "too many open files") \
+ macro(EMSGSIZE, -40, "message too long") \
+ macro(ENAMETOOLONG, -63, "name too long") \
+ macro(ENETDOWN, -50, "network is down") \
+ macro(ENETUNREACH, -51, "network is unreachable") \
+ macro(ENFILE, -23, "file table overflow") \
+ macro(ENOBUFS, -55, "no buffer space available") \
+ macro(ENODEV, -19, "no such device") \
+ macro(ENOENT, -2, "no such file or directory") \
+ macro(ENOMEM, -12, "not enough memory") \
+ macro(ENONET, -4056, "machine is not on the network") \
+ macro(ENOPROTOOPT, -42, "protocol not available") \
+ macro(ENOSPC, -28, "no space left on device") \
+ macro(ENOSYS, -78, "function not implemented") \
+ macro(ENOTCONN, -57, "socket is not connected") \
+ macro(ENOTDIR, -20, "not a directory") \
+ macro(ENOTEMPTY, -66, "directory not empty") \
+ macro(ENOTSOCK, -38, "socket operation on non-socket") \
+ macro(ENOTSUP, -45, "operation not supported on socket") \
+ macro(EOVERFLOW, -84, "value too large for defined data type") \
+ macro(EPERM, -1, "operation not permitted") \
+ macro(EPIPE, -32, "broken pipe") \
+ macro(EPROTO, -100, "protocol error") \
+ macro(EPROTONOSUPPORT, -43, "protocol not supported") \
+ macro(EPROTOTYPE, -41, "protocol wrong type for socket") \
+ macro(ERANGE, -34, "result too large") \
+ macro(EROFS, -30, "read-only file system") \
+ macro(ESHUTDOWN, -58, "cannot send after transport endpoint shutdown") \
+ macro(ESPIPE, -29, "invalid seek") \
+ macro(ESRCH, -3, "no such process") \
+ macro(ETIMEDOUT, -60, "connection timed out") \
+ macro(ETXTBSY, -26, "text file is busy") \
+ macro(EXDEV, -18, "cross-device link not permitted") \
+ macro(UNKNOWN, -4094, "unknown error") \
+ macro(EOF, -4095, "end of file") \
+ macro(ENXIO, -6, "no such device or address") \
+ macro(EMLINK, -31, "too many links") \
+ macro(EHOSTDOWN, -64, "host is down") \
+ macro(EREMOTEIO, -4030, "remote I/O error") \
+ macro(ENOTTY, -25, "inappropriate ioctl for device") \
+ macro(EFTYPE, -79, "inappropriate file type or format") \
+ macro(EILSEQ, -92, "illegal byte sequence") \
+ macro(ESOCKTNOSUPPORT, -44, "socket type not supported") \
+ macro(ENODATA, -96, "no data available") \
+ macro(EUNATCH, -4023, "protocol driver not attache")
+
+// clang-format on
+namespace Bun {
+namespace ProcessBindingUV {
+
+JSC_DEFINE_HOST_FUNCTION(jsErrname, (JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
+{
+ auto arg0 = callFrame->argument(0);
+ auto& vm = globalObject->vm();
+
+ // Node.js will actualy crash here, lol.
+ if (!arg0.isInt32())
+ return JSValue::encode(jsString(vm, makeString("Unknown system error "_s, arg0.toWTFString(globalObject))));
+
+ auto err = arg0.asInt32();
+ switch (err) {
+#define CASE(name, value, desc) \
+ case value: \
+ return JSValue::encode(JSC::jsString(vm, String(#name##_s)));
+
+ UV_ERRNO_MAP(CASE)
+#undef CASE
+ }
+
+ return JSValue::encode(jsString(vm, makeString("Unknown system error "_s, String::number(err))));
+}
+
+JSC_DEFINE_HOST_FUNCTION(jsGetErrorMap, (JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
+{
+ auto& vm = globalObject->vm();
+ auto map = JSC::JSMap::create(vm, globalObject->mapStructure());
+
+#define PUT_PROPERTY(name, value, desc) \
+ { \
+ auto arr = JSC::constructEmptyArray(globalObject, nullptr, 2); \
+ arr->putDirectIndex(globalObject, 0, JSC::jsString(vm, String(#name##_s))); \
+ arr->putDirectIndex(globalObject, 1, JSC::jsString(vm, String(desc##_s))); \
+ map->set(globalObject, JSC::jsNumber(value), arr); \
+ }
+
+ UV_ERRNO_MAP(PUT_PROPERTY)
+#undef PUT_PROPERTY
+
+ return JSValue::encode(map);
+}
+
+JSObject* create(VM& vm, JSGlobalObject* globalObject)
+{
+ auto bindingObject = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype(), 0);
+
+ bindingObject->putDirect(vm, JSC::Identifier::fromString(vm, "errname"_s), JSC::JSFunction::create(vm, globalObject, 1, "errname"_s, jsErrname, ImplementationVisibility::Public));
+
+#define PUT_PROPERTY(name, value, desc) \
+ bindingObject->putDirect(vm, JSC::Identifier::fromString(vm, "UV_" #name##_s), JSC::jsNumber(value));
+
+ UV_ERRNO_MAP(PUT_PROPERTY)
+#undef PUT_PROPERTY
+
+ bindingObject->putDirect(vm, JSC::Identifier::fromString(vm, "getErrorMap"_s), JSC::JSFunction::create(vm, globalObject, 0, "getErrorMap"_s, jsGetErrorMap, ImplementationVisibility::Public));
+
+ return bindingObject;
+}
+
+} // namespace ProcessBindingUV
+} // namespace Bun \ No newline at end of file
diff --git a/src/bun.js/bindings/ProcessBindingUV.h b/src/bun.js/bindings/ProcessBindingUV.h
new file mode 100644
index 000000000..4306e21f8
--- /dev/null
+++ b/src/bun.js/bindings/ProcessBindingUV.h
@@ -0,0 +1,13 @@
+#include "root.h"
+
+namespace Bun {
+namespace ProcessBindingUV {
+
+JSC_DECLARE_HOST_FUNCTION(jsErrname);
+
+JSC_DECLARE_HOST_FUNCTION(jsGetErrorMap);
+
+JSC::JSObject* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject);
+
+} // namespace ProcessBindingUV
+} // namespace Bun \ No newline at end of file
diff --git a/src/bun.js/bindings/RegularExpression.cpp b/src/bun.js/bindings/RegularExpression.cpp
index 1c8df1bc0..c59e6fa4c 100644
--- a/src/bun.js/bindings/RegularExpression.cpp
+++ b/src/bun.js/bindings/RegularExpression.cpp
@@ -1,12 +1,16 @@
#include "root.h"
#include "headers-handwritten.h"
#include "JavaScriptCore/RegularExpression.h"
+#include "JavaScriptCore/Options.h"
using namespace JSC;
using namespace JSC::Yarr;
extern "C" RegularExpression* Yarr__RegularExpression__init(BunString pattern, uint16_t flags)
{
+ // TODO: Remove this, we technically are accessing options before we finalize them.
+ // This means you cannot use BUN_JSC_dumpCompiledRegExpPatterns on the flag passed to `bun test -t`
+ Options::AllowUnfinalizedAccessScope scope;
return new RegularExpression(Bun::toWTFString(pattern), OptionSet<Flags>(static_cast<Flags>(flags)));
}
extern "C" void Yarr__RegularExpression__deinit(RegularExpression* re)
diff --git a/src/bun.js/bindings/ScriptExecutionContext.cpp b/src/bun.js/bindings/ScriptExecutionContext.cpp
index 2113c9f64..9f824dde5 100644
--- a/src/bun.js/bindings/ScriptExecutionContext.cpp
+++ b/src/bun.js/bindings/ScriptExecutionContext.cpp
@@ -105,7 +105,7 @@ bool ScriptExecutionContext::postTaskTo(ScriptExecutionContextIdentifier identif
void ScriptExecutionContext::didCreateDestructionObserver(ContextDestructionObserver& observer)
{
- ASSERT(!m_inScriptExecutionContextDestructor);
+ // ASSERT(!m_inScriptExecutionContextDestructor);
m_destructionObservers.add(&observer);
}
@@ -181,7 +181,7 @@ void ScriptExecutionContext::dispatchMessagePortEvents()
ASSERT(isContextThread());
checkConsistency();
- ASSERT(m_willprocessMessageWithMessagePortsSoon);
+ ASSERT(m_willProcessMessageWithMessagePortsSoon);
m_willProcessMessageWithMessagePortsSoon = false;
auto completionHandlers = std::exchange(m_processMessageWithMessagePortsSoonHandlers, Vector<CompletionHandler<void()>> {});
diff --git a/src/bun.js/bindings/Serialization.cpp b/src/bun.js/bindings/Serialization.cpp
index 89937ebbb..fdaf2ab75 100644
--- a/src/bun.js/bindings/Serialization.cpp
+++ b/src/bun.js/bindings/Serialization.cpp
@@ -8,9 +8,15 @@
using namespace JSC;
using namespace WebCore;
-/// This is used for Bun.spawn() IPC because otherwise we would have to copy the data once to get it to zig, then write it.
-/// Returns `true` on success, `false` on failure + throws a JS error.
-extern "C" bool Bun__serializeJSValueForSubprocess(JSGlobalObject* globalObject, EncodedJSValue encodedValue, int fd)
+// Must be synced with bindings.zig's JSValue.SerializedScriptValue.External
+struct SerializedValueSlice {
+ uint8_t* bytes;
+ size_t size;
+ WebCore::SerializedScriptValue* value;
+};
+
+/// Returns a "slice" that also contains a pointer to the SerializedScriptValue. Must be freed by the caller
+extern "C" SerializedValueSlice Bun__serializeJSValue(JSGlobalObject* globalObject, EncodedJSValue encodedValue)
{
JSValue value = JSValue::decode(encodedValue);
@@ -25,19 +31,23 @@ extern "C" bool Bun__serializeJSValueForSubprocess(JSGlobalObject* globalObject,
if (serialized.hasException()) {
WebCore::propagateException(*globalObject, scope,
serialized.releaseException());
- RELEASE_AND_RETURN(scope, false);
+ RELEASE_AND_RETURN(scope, { 0 });
}
auto serializedValue = serialized.releaseReturnValue();
- auto bytes = serializedValue.ptr()->wireBytes();
- uint8_t id = 2; // IPCMessageType.SerializedMessage
- write(fd, &id, sizeof(uint8_t));
- uint32_t size = bytes.size();
- write(fd, &size, sizeof(uint32_t));
- write(fd, bytes.data(), size);
+ auto bytes = serializedValue->wireBytes();
- RELEASE_AND_RETURN(scope, true);
+ return {
+ bytes.data(),
+ bytes.size(),
+ &serializedValue.leakRef(),
+ };
+}
+
+extern "C" void Bun__SerializedScriptSlice__free(SerializedScriptValue* value)
+{
+ delete value;
}
extern "C" EncodedJSValue Bun__JSValue__deserialize(JSGlobalObject* globalObject, const uint8_t* bytes, size_t size)
diff --git a/src/bun.js/bindings/URLDecomposition.cpp b/src/bun.js/bindings/URLDecomposition.cpp
index d3f11b27f..21168f70f 100644
--- a/src/bun.js/bindings/URLDecomposition.cpp
+++ b/src/bun.js/bindings/URLDecomposition.cpp
@@ -35,7 +35,14 @@ String URLDecomposition::origin() const
if (fullURL.protocolIsInHTTPFamily() or fullURL.protocolIsInFTPFamily() or fullURL.protocolIs("ws"_s) or fullURL.protocolIs("wss"_s))
return fullURL.protocolHostAndPort();
-
+ if (fullURL.protocolIsBlob()) {
+ const String& path = fullURL.path().toString();
+ const URL subUrl { URL {}, path };
+ if (subUrl.isValid()) {
+ if (subUrl.protocolIsInHTTPFamily() or subUrl.protocolIsInFTPFamily() or subUrl.protocolIs("ws"_s) or subUrl.protocolIs("wss"_s) or subUrl.protocolIsFile())
+ return subUrl.protocolHostAndPort();
+ }
+ }
return "null"_s;
}
diff --git a/src/bun.js/bindings/ZigGeneratedClasses+DOMClientIsoSubspaces.h b/src/bun.js/bindings/ZigGeneratedClasses+DOMClientIsoSubspaces.h
index a364c0a48..cef5c512a 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses+DOMClientIsoSubspaces.h
+++ b/src/bun.js/bindings/ZigGeneratedClasses+DOMClientIsoSubspaces.h
@@ -16,6 +16,7 @@ std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForEndTag;
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForExpect;
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForExpectConstructor;std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForExpectAny;
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForExpectAnything;
+std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForExpectArrayContaining;
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForExpectStringContaining;
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForExpectStringMatching;
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForFFI;
diff --git a/src/bun.js/bindings/ZigGeneratedClasses+DOMIsoSubspaces.h b/src/bun.js/bindings/ZigGeneratedClasses+DOMIsoSubspaces.h
index e98ea16c3..d06451eda 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses+DOMIsoSubspaces.h
+++ b/src/bun.js/bindings/ZigGeneratedClasses+DOMIsoSubspaces.h
@@ -16,6 +16,7 @@ std::unique_ptr<IsoSubspace> m_subspaceForEndTag;
std::unique_ptr<IsoSubspace> m_subspaceForExpect;
std::unique_ptr<IsoSubspace> m_subspaceForExpectConstructor;std::unique_ptr<IsoSubspace> m_subspaceForExpectAny;
std::unique_ptr<IsoSubspace> m_subspaceForExpectAnything;
+std::unique_ptr<IsoSubspace> m_subspaceForExpectArrayContaining;
std::unique_ptr<IsoSubspace> m_subspaceForExpectStringContaining;
std::unique_ptr<IsoSubspace> m_subspaceForExpectStringMatching;
std::unique_ptr<IsoSubspace> m_subspaceForFFI;
diff --git a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h
index 2c075a508..381378262 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h
+++ b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h
@@ -1,300 +1,204 @@
JSC::Structure* JSAttributeIteratorStructure() { return m_JSAttributeIterator.getInitializedOnMainThread(this); }
- JSC::JSObject* JSAttributeIteratorConstructor() { return m_JSAttributeIterator.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSAttributeIteratorPrototype() { return m_JSAttributeIterator.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSAttributeIteratorConstructor() { return m_JSAttributeIterator.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSAttributeIteratorPrototype() { return m_JSAttributeIterator.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSAttributeIterator;
- bool hasJSAttributeIteratorSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSAttributeIteratorSetterValue;
JSC::Structure* JSBigIntStatsStructure() { return m_JSBigIntStats.getInitializedOnMainThread(this); }
- JSC::JSObject* JSBigIntStatsConstructor() { return m_JSBigIntStats.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSBigIntStatsPrototype() { return m_JSBigIntStats.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSBigIntStatsConstructor() { return m_JSBigIntStats.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSBigIntStatsPrototype() { return m_JSBigIntStats.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSBigIntStats;
- bool hasJSBigIntStatsSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSBigIntStatsSetterValue;
JSC::Structure* JSBlobStructure() { return m_JSBlob.getInitializedOnMainThread(this); }
- JSC::JSObject* JSBlobConstructor() { return m_JSBlob.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSBlobPrototype() { return m_JSBlob.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSBlobConstructor() { return m_JSBlob.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSBlobPrototype() { return m_JSBlob.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSBlob;
- bool hasJSBlobSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSBlobSetterValue;
JSC::Structure* JSBuildArtifactStructure() { return m_JSBuildArtifact.getInitializedOnMainThread(this); }
- JSC::JSObject* JSBuildArtifactConstructor() { return m_JSBuildArtifact.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSBuildArtifactPrototype() { return m_JSBuildArtifact.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSBuildArtifactConstructor() { return m_JSBuildArtifact.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSBuildArtifactPrototype() { return m_JSBuildArtifact.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSBuildArtifact;
- bool hasJSBuildArtifactSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSBuildArtifactSetterValue;
JSC::Structure* JSBuildMessageStructure() { return m_JSBuildMessage.getInitializedOnMainThread(this); }
- JSC::JSObject* JSBuildMessageConstructor() { return m_JSBuildMessage.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSBuildMessagePrototype() { return m_JSBuildMessage.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSBuildMessageConstructor() { return m_JSBuildMessage.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSBuildMessagePrototype() { return m_JSBuildMessage.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSBuildMessage;
- bool hasJSBuildMessageSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSBuildMessageSetterValue;
JSC::Structure* JSCommentStructure() { return m_JSComment.getInitializedOnMainThread(this); }
- JSC::JSObject* JSCommentConstructor() { return m_JSComment.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSCommentPrototype() { return m_JSComment.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSCommentConstructor() { return m_JSComment.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSCommentPrototype() { return m_JSComment.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSComment;
- bool hasJSCommentSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSCommentSetterValue;
JSC::Structure* JSCryptoStructure() { return m_JSCrypto.getInitializedOnMainThread(this); }
- JSC::JSObject* JSCryptoConstructor() { return m_JSCrypto.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSCryptoPrototype() { return m_JSCrypto.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSCryptoConstructor() { return m_JSCrypto.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSCryptoPrototype() { return m_JSCrypto.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSCrypto;
- bool hasJSCryptoSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSCryptoSetterValue;
JSC::Structure* JSCryptoHasherStructure() { return m_JSCryptoHasher.getInitializedOnMainThread(this); }
- JSC::JSObject* JSCryptoHasherConstructor() { return m_JSCryptoHasher.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSCryptoHasherPrototype() { return m_JSCryptoHasher.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSCryptoHasherConstructor() { return m_JSCryptoHasher.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSCryptoHasherPrototype() { return m_JSCryptoHasher.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSCryptoHasher;
- bool hasJSCryptoHasherSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSCryptoHasherSetterValue;
JSC::Structure* JSDebugHTTPSServerStructure() { return m_JSDebugHTTPSServer.getInitializedOnMainThread(this); }
- JSC::JSObject* JSDebugHTTPSServerConstructor() { return m_JSDebugHTTPSServer.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSDebugHTTPSServerPrototype() { return m_JSDebugHTTPSServer.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSDebugHTTPSServerConstructor() { return m_JSDebugHTTPSServer.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSDebugHTTPSServerPrototype() { return m_JSDebugHTTPSServer.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSDebugHTTPSServer;
- bool hasJSDebugHTTPSServerSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSDebugHTTPSServerSetterValue;
JSC::Structure* JSDebugHTTPServerStructure() { return m_JSDebugHTTPServer.getInitializedOnMainThread(this); }
- JSC::JSObject* JSDebugHTTPServerConstructor() { return m_JSDebugHTTPServer.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSDebugHTTPServerPrototype() { return m_JSDebugHTTPServer.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSDebugHTTPServerConstructor() { return m_JSDebugHTTPServer.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSDebugHTTPServerPrototype() { return m_JSDebugHTTPServer.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSDebugHTTPServer;
- bool hasJSDebugHTTPServerSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSDebugHTTPServerSetterValue;
JSC::Structure* JSDirentStructure() { return m_JSDirent.getInitializedOnMainThread(this); }
- JSC::JSObject* JSDirentConstructor() { return m_JSDirent.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSDirentPrototype() { return m_JSDirent.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSDirentConstructor() { return m_JSDirent.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSDirentPrototype() { return m_JSDirent.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSDirent;
- bool hasJSDirentSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSDirentSetterValue;
JSC::Structure* JSDocEndStructure() { return m_JSDocEnd.getInitializedOnMainThread(this); }
- JSC::JSObject* JSDocEndConstructor() { return m_JSDocEnd.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSDocEndPrototype() { return m_JSDocEnd.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSDocEndConstructor() { return m_JSDocEnd.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSDocEndPrototype() { return m_JSDocEnd.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSDocEnd;
- bool hasJSDocEndSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSDocEndSetterValue;
JSC::Structure* JSDocTypeStructure() { return m_JSDocType.getInitializedOnMainThread(this); }
- JSC::JSObject* JSDocTypeConstructor() { return m_JSDocType.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSDocTypePrototype() { return m_JSDocType.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSDocTypeConstructor() { return m_JSDocType.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSDocTypePrototype() { return m_JSDocType.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSDocType;
- bool hasJSDocTypeSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSDocTypeSetterValue;
JSC::Structure* JSElementStructure() { return m_JSElement.getInitializedOnMainThread(this); }
- JSC::JSObject* JSElementConstructor() { return m_JSElement.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSElementPrototype() { return m_JSElement.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSElementConstructor() { return m_JSElement.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSElementPrototype() { return m_JSElement.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSElement;
- bool hasJSElementSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSElementSetterValue;
JSC::Structure* JSEndTagStructure() { return m_JSEndTag.getInitializedOnMainThread(this); }
- JSC::JSObject* JSEndTagConstructor() { return m_JSEndTag.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSEndTagPrototype() { return m_JSEndTag.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSEndTagConstructor() { return m_JSEndTag.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSEndTagPrototype() { return m_JSEndTag.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSEndTag;
- bool hasJSEndTagSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSEndTagSetterValue;
JSC::Structure* JSExpectStructure() { return m_JSExpect.getInitializedOnMainThread(this); }
- JSC::JSObject* JSExpectConstructor() { return m_JSExpect.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSExpectPrototype() { return m_JSExpect.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSExpectConstructor() { return m_JSExpect.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSExpectPrototype() { return m_JSExpect.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSExpect;
- bool hasJSExpectSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSExpectSetterValue;
JSC::Structure* JSExpectAnyStructure() { return m_JSExpectAny.getInitializedOnMainThread(this); }
- JSC::JSObject* JSExpectAnyConstructor() { return m_JSExpectAny.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSExpectAnyPrototype() { return m_JSExpectAny.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSExpectAnyConstructor() { return m_JSExpectAny.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSExpectAnyPrototype() { return m_JSExpectAny.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSExpectAny;
- bool hasJSExpectAnySetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSExpectAnySetterValue;
JSC::Structure* JSExpectAnythingStructure() { return m_JSExpectAnything.getInitializedOnMainThread(this); }
- JSC::JSObject* JSExpectAnythingConstructor() { return m_JSExpectAnything.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSExpectAnythingPrototype() { return m_JSExpectAnything.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSExpectAnythingConstructor() { return m_JSExpectAnything.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSExpectAnythingPrototype() { return m_JSExpectAnything.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSExpectAnything;
- bool hasJSExpectAnythingSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSExpectAnythingSetterValue;
+JSC::Structure* JSExpectArrayContainingStructure() { return m_JSExpectArrayContaining.getInitializedOnMainThread(this); }
+ JSC::JSObject* JSExpectArrayContainingConstructor() { return m_JSExpectArrayContaining.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSExpectArrayContainingPrototype() { return m_JSExpectArrayContaining.prototypeInitializedOnMainThread(this); }
+ JSC::LazyClassStructure m_JSExpectArrayContaining;
JSC::Structure* JSExpectStringContainingStructure() { return m_JSExpectStringContaining.getInitializedOnMainThread(this); }
- JSC::JSObject* JSExpectStringContainingConstructor() { return m_JSExpectStringContaining.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSExpectStringContainingPrototype() { return m_JSExpectStringContaining.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSExpectStringContainingConstructor() { return m_JSExpectStringContaining.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSExpectStringContainingPrototype() { return m_JSExpectStringContaining.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSExpectStringContaining;
- bool hasJSExpectStringContainingSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSExpectStringContainingSetterValue;
JSC::Structure* JSExpectStringMatchingStructure() { return m_JSExpectStringMatching.getInitializedOnMainThread(this); }
- JSC::JSObject* JSExpectStringMatchingConstructor() { return m_JSExpectStringMatching.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSExpectStringMatchingPrototype() { return m_JSExpectStringMatching.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSExpectStringMatchingConstructor() { return m_JSExpectStringMatching.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSExpectStringMatchingPrototype() { return m_JSExpectStringMatching.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSExpectStringMatching;
- bool hasJSExpectStringMatchingSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSExpectStringMatchingSetterValue;
JSC::Structure* JSFFIStructure() { return m_JSFFI.getInitializedOnMainThread(this); }
- JSC::JSObject* JSFFIConstructor() { return m_JSFFI.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSFFIPrototype() { return m_JSFFI.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSFFIConstructor() { return m_JSFFI.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSFFIPrototype() { return m_JSFFI.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSFFI;
- bool hasJSFFISetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSFFISetterValue;
JSC::Structure* JSFSWatcherStructure() { return m_JSFSWatcher.getInitializedOnMainThread(this); }
- JSC::JSObject* JSFSWatcherConstructor() { return m_JSFSWatcher.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSFSWatcherPrototype() { return m_JSFSWatcher.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSFSWatcherConstructor() { return m_JSFSWatcher.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSFSWatcherPrototype() { return m_JSFSWatcher.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSFSWatcher;
- bool hasJSFSWatcherSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSFSWatcherSetterValue;
JSC::Structure* JSFileSystemRouterStructure() { return m_JSFileSystemRouter.getInitializedOnMainThread(this); }
- JSC::JSObject* JSFileSystemRouterConstructor() { return m_JSFileSystemRouter.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSFileSystemRouterPrototype() { return m_JSFileSystemRouter.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSFileSystemRouterConstructor() { return m_JSFileSystemRouter.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSFileSystemRouterPrototype() { return m_JSFileSystemRouter.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSFileSystemRouter;
- bool hasJSFileSystemRouterSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSFileSystemRouterSetterValue;
JSC::Structure* JSHTMLRewriterStructure() { return m_JSHTMLRewriter.getInitializedOnMainThread(this); }
- JSC::JSObject* JSHTMLRewriterConstructor() { return m_JSHTMLRewriter.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSHTMLRewriterPrototype() { return m_JSHTMLRewriter.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSHTMLRewriterConstructor() { return m_JSHTMLRewriter.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSHTMLRewriterPrototype() { return m_JSHTMLRewriter.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSHTMLRewriter;
- bool hasJSHTMLRewriterSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSHTMLRewriterSetterValue;
JSC::Structure* JSHTTPSServerStructure() { return m_JSHTTPSServer.getInitializedOnMainThread(this); }
- JSC::JSObject* JSHTTPSServerConstructor() { return m_JSHTTPSServer.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSHTTPSServerPrototype() { return m_JSHTTPSServer.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSHTTPSServerConstructor() { return m_JSHTTPSServer.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSHTTPSServerPrototype() { return m_JSHTTPSServer.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSHTTPSServer;
- bool hasJSHTTPSServerSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSHTTPSServerSetterValue;
JSC::Structure* JSHTTPServerStructure() { return m_JSHTTPServer.getInitializedOnMainThread(this); }
- JSC::JSObject* JSHTTPServerConstructor() { return m_JSHTTPServer.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSHTTPServerPrototype() { return m_JSHTTPServer.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSHTTPServerConstructor() { return m_JSHTTPServer.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSHTTPServerPrototype() { return m_JSHTTPServer.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSHTTPServer;
- bool hasJSHTTPServerSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSHTTPServerSetterValue;
JSC::Structure* JSListenerStructure() { return m_JSListener.getInitializedOnMainThread(this); }
- JSC::JSObject* JSListenerConstructor() { return m_JSListener.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSListenerPrototype() { return m_JSListener.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSListenerConstructor() { return m_JSListener.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSListenerPrototype() { return m_JSListener.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSListener;
- bool hasJSListenerSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSListenerSetterValue;
JSC::Structure* JSMD4Structure() { return m_JSMD4.getInitializedOnMainThread(this); }
- JSC::JSObject* JSMD4Constructor() { return m_JSMD4.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSMD4Prototype() { return m_JSMD4.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSMD4Constructor() { return m_JSMD4.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSMD4Prototype() { return m_JSMD4.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSMD4;
- bool hasJSMD4SetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSMD4SetterValue;
JSC::Structure* JSMD5Structure() { return m_JSMD5.getInitializedOnMainThread(this); }
- JSC::JSObject* JSMD5Constructor() { return m_JSMD5.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSMD5Prototype() { return m_JSMD5.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSMD5Constructor() { return m_JSMD5.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSMD5Prototype() { return m_JSMD5.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSMD5;
- bool hasJSMD5SetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSMD5SetterValue;
JSC::Structure* JSMatchedRouteStructure() { return m_JSMatchedRoute.getInitializedOnMainThread(this); }
- JSC::JSObject* JSMatchedRouteConstructor() { return m_JSMatchedRoute.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSMatchedRoutePrototype() { return m_JSMatchedRoute.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSMatchedRouteConstructor() { return m_JSMatchedRoute.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSMatchedRoutePrototype() { return m_JSMatchedRoute.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSMatchedRoute;
- bool hasJSMatchedRouteSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSMatchedRouteSetterValue;
JSC::Structure* JSNodeJSFSStructure() { return m_JSNodeJSFS.getInitializedOnMainThread(this); }
- JSC::JSObject* JSNodeJSFSConstructor() { return m_JSNodeJSFS.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSNodeJSFSPrototype() { return m_JSNodeJSFS.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSNodeJSFSConstructor() { return m_JSNodeJSFS.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSNodeJSFSPrototype() { return m_JSNodeJSFS.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSNodeJSFS;
- bool hasJSNodeJSFSSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSNodeJSFSSetterValue;
JSC::Structure* JSRequestStructure() { return m_JSRequest.getInitializedOnMainThread(this); }
- JSC::JSObject* JSRequestConstructor() { return m_JSRequest.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSRequestPrototype() { return m_JSRequest.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSRequestConstructor() { return m_JSRequest.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSRequestPrototype() { return m_JSRequest.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSRequest;
- bool hasJSRequestSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSRequestSetterValue;
JSC::Structure* JSResolveMessageStructure() { return m_JSResolveMessage.getInitializedOnMainThread(this); }
- JSC::JSObject* JSResolveMessageConstructor() { return m_JSResolveMessage.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSResolveMessagePrototype() { return m_JSResolveMessage.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSResolveMessageConstructor() { return m_JSResolveMessage.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSResolveMessagePrototype() { return m_JSResolveMessage.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSResolveMessage;
- bool hasJSResolveMessageSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSResolveMessageSetterValue;
JSC::Structure* JSResponseStructure() { return m_JSResponse.getInitializedOnMainThread(this); }
- JSC::JSObject* JSResponseConstructor() { return m_JSResponse.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSResponsePrototype() { return m_JSResponse.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSResponseConstructor() { return m_JSResponse.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSResponsePrototype() { return m_JSResponse.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSResponse;
- bool hasJSResponseSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSResponseSetterValue;
JSC::Structure* JSSHA1Structure() { return m_JSSHA1.getInitializedOnMainThread(this); }
- JSC::JSObject* JSSHA1Constructor() { return m_JSSHA1.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSSHA1Prototype() { return m_JSSHA1.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSSHA1Constructor() { return m_JSSHA1.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSSHA1Prototype() { return m_JSSHA1.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSSHA1;
- bool hasJSSHA1SetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSSHA1SetterValue;
JSC::Structure* JSSHA224Structure() { return m_JSSHA224.getInitializedOnMainThread(this); }
- JSC::JSObject* JSSHA224Constructor() { return m_JSSHA224.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSSHA224Prototype() { return m_JSSHA224.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSSHA224Constructor() { return m_JSSHA224.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSSHA224Prototype() { return m_JSSHA224.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSSHA224;
- bool hasJSSHA224SetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSSHA224SetterValue;
JSC::Structure* JSSHA256Structure() { return m_JSSHA256.getInitializedOnMainThread(this); }
- JSC::JSObject* JSSHA256Constructor() { return m_JSSHA256.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSSHA256Prototype() { return m_JSSHA256.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSSHA256Constructor() { return m_JSSHA256.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSSHA256Prototype() { return m_JSSHA256.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSSHA256;
- bool hasJSSHA256SetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSSHA256SetterValue;
JSC::Structure* JSSHA384Structure() { return m_JSSHA384.getInitializedOnMainThread(this); }
- JSC::JSObject* JSSHA384Constructor() { return m_JSSHA384.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSSHA384Prototype() { return m_JSSHA384.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSSHA384Constructor() { return m_JSSHA384.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSSHA384Prototype() { return m_JSSHA384.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSSHA384;
- bool hasJSSHA384SetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSSHA384SetterValue;
JSC::Structure* JSSHA512Structure() { return m_JSSHA512.getInitializedOnMainThread(this); }
- JSC::JSObject* JSSHA512Constructor() { return m_JSSHA512.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSSHA512Prototype() { return m_JSSHA512.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSSHA512Constructor() { return m_JSSHA512.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSSHA512Prototype() { return m_JSSHA512.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSSHA512;
- bool hasJSSHA512SetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSSHA512SetterValue;
JSC::Structure* JSSHA512_256Structure() { return m_JSSHA512_256.getInitializedOnMainThread(this); }
- JSC::JSObject* JSSHA512_256Constructor() { return m_JSSHA512_256.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSSHA512_256Prototype() { return m_JSSHA512_256.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSSHA512_256Constructor() { return m_JSSHA512_256.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSSHA512_256Prototype() { return m_JSSHA512_256.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSSHA512_256;
- bool hasJSSHA512_256SetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSSHA512_256SetterValue;
JSC::Structure* JSServerWebSocketStructure() { return m_JSServerWebSocket.getInitializedOnMainThread(this); }
- JSC::JSObject* JSServerWebSocketConstructor() { return m_JSServerWebSocket.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSServerWebSocketPrototype() { return m_JSServerWebSocket.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSServerWebSocketConstructor() { return m_JSServerWebSocket.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSServerWebSocketPrototype() { return m_JSServerWebSocket.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSServerWebSocket;
- bool hasJSServerWebSocketSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSServerWebSocketSetterValue;
JSC::Structure* JSStatWatcherStructure() { return m_JSStatWatcher.getInitializedOnMainThread(this); }
- JSC::JSObject* JSStatWatcherConstructor() { return m_JSStatWatcher.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSStatWatcherPrototype() { return m_JSStatWatcher.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSStatWatcherConstructor() { return m_JSStatWatcher.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSStatWatcherPrototype() { return m_JSStatWatcher.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSStatWatcher;
- bool hasJSStatWatcherSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSStatWatcherSetterValue;
JSC::Structure* JSStatsStructure() { return m_JSStats.getInitializedOnMainThread(this); }
- JSC::JSObject* JSStatsConstructor() { return m_JSStats.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSStatsPrototype() { return m_JSStats.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSStatsConstructor() { return m_JSStats.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSStatsPrototype() { return m_JSStats.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSStats;
- bool hasJSStatsSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSStatsSetterValue;
JSC::Structure* JSSubprocessStructure() { return m_JSSubprocess.getInitializedOnMainThread(this); }
- JSC::JSObject* JSSubprocessConstructor() { return m_JSSubprocess.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSSubprocessPrototype() { return m_JSSubprocess.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSSubprocessConstructor() { return m_JSSubprocess.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSSubprocessPrototype() { return m_JSSubprocess.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSSubprocess;
- bool hasJSSubprocessSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSSubprocessSetterValue;
JSC::Structure* JSTCPSocketStructure() { return m_JSTCPSocket.getInitializedOnMainThread(this); }
- JSC::JSObject* JSTCPSocketConstructor() { return m_JSTCPSocket.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSTCPSocketPrototype() { return m_JSTCPSocket.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSTCPSocketConstructor() { return m_JSTCPSocket.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSTCPSocketPrototype() { return m_JSTCPSocket.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSTCPSocket;
- bool hasJSTCPSocketSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSTCPSocketSetterValue;
JSC::Structure* JSTLSSocketStructure() { return m_JSTLSSocket.getInitializedOnMainThread(this); }
- JSC::JSObject* JSTLSSocketConstructor() { return m_JSTLSSocket.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSTLSSocketPrototype() { return m_JSTLSSocket.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSTLSSocketConstructor() { return m_JSTLSSocket.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSTLSSocketPrototype() { return m_JSTLSSocket.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSTLSSocket;
- bool hasJSTLSSocketSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSTLSSocketSetterValue;
JSC::Structure* JSTextChunkStructure() { return m_JSTextChunk.getInitializedOnMainThread(this); }
- JSC::JSObject* JSTextChunkConstructor() { return m_JSTextChunk.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSTextChunkPrototype() { return m_JSTextChunk.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSTextChunkConstructor() { return m_JSTextChunk.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSTextChunkPrototype() { return m_JSTextChunk.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSTextChunk;
- bool hasJSTextChunkSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSTextChunkSetterValue;
JSC::Structure* JSTextDecoderStructure() { return m_JSTextDecoder.getInitializedOnMainThread(this); }
- JSC::JSObject* JSTextDecoderConstructor() { return m_JSTextDecoder.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSTextDecoderPrototype() { return m_JSTextDecoder.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSTextDecoderConstructor() { return m_JSTextDecoder.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSTextDecoderPrototype() { return m_JSTextDecoder.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSTextDecoder;
- bool hasJSTextDecoderSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSTextDecoderSetterValue;
JSC::Structure* JSTimeoutStructure() { return m_JSTimeout.getInitializedOnMainThread(this); }
- JSC::JSObject* JSTimeoutConstructor() { return m_JSTimeout.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSTimeoutPrototype() { return m_JSTimeout.prototypeInitializedOnMainThread(this); }
+ JSC::JSObject* JSTimeoutConstructor() { return m_JSTimeout.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSTimeoutPrototype() { return m_JSTimeout.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSTimeout;
- bool hasJSTimeoutSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSTimeoutSetterValue;
JSC::Structure* JSTranspilerStructure() { return m_JSTranspiler.getInitializedOnMainThread(this); }
- JSC::JSObject* JSTranspilerConstructor() { return m_JSTranspiler.constructorInitializedOnMainThread(this); }
- JSC::JSValue JSTranspilerPrototype() { return m_JSTranspiler.prototypeInitializedOnMainThread(this); }
- JSC::LazyClassStructure m_JSTranspiler;
- bool hasJSTranspilerSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSTranspilerSetterValue; \ No newline at end of file
+ JSC::JSObject* JSTranspilerConstructor() { return m_JSTranspiler.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSTranspilerPrototype() { return m_JSTranspiler.prototypeInitializedOnMainThread(this); }
+ JSC::LazyClassStructure m_JSTranspiler; \ No newline at end of file
diff --git a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
index cb4c47ccb..84d3df7a0 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
+++ b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
@@ -1,4 +1,4 @@
-void GlobalObject::initGeneratedLazyClasses() {
+ALWAYS_INLINE void GlobalObject::initGeneratedLazyClasses() {
m_JSAttributeIterator.initLater(
[](LazyClassStructure::Initializer& init) {
init.setPrototype(WebCore::JSAttributeIterator::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
@@ -107,6 +107,12 @@ void GlobalObject::initGeneratedLazyClasses() {
init.setStructure(WebCore::JSExpectAnything::createStructure(init.vm, init.global, init.prototype));
});
+ m_JSExpectArrayContaining.initLater(
+ [](LazyClassStructure::Initializer& init) {
+ init.setPrototype(WebCore::JSExpectArrayContaining::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
+ init.setStructure(WebCore::JSExpectArrayContaining::createStructure(init.vm, init.global, init.prototype));
+
+ });
m_JSExpectStringContaining.initLater(
[](LazyClassStructure::Initializer& init) {
init.setPrototype(WebCore::JSExpectStringContaining::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
@@ -303,54 +309,55 @@ void GlobalObject::initGeneratedLazyClasses() {
template<typename Visitor>
void GlobalObject::visitGeneratedLazyClasses(GlobalObject *thisObject, Visitor& visitor)
{
- thisObject->m_JSAttributeIterator.visit(visitor); visitor.append(thisObject->m_JSAttributeIteratorSetterValue);
- thisObject->m_JSBigIntStats.visit(visitor); visitor.append(thisObject->m_JSBigIntStatsSetterValue);
- thisObject->m_JSBlob.visit(visitor); visitor.append(thisObject->m_JSBlobSetterValue);
- thisObject->m_JSBuildArtifact.visit(visitor); visitor.append(thisObject->m_JSBuildArtifactSetterValue);
- thisObject->m_JSBuildMessage.visit(visitor); visitor.append(thisObject->m_JSBuildMessageSetterValue);
- thisObject->m_JSComment.visit(visitor); visitor.append(thisObject->m_JSCommentSetterValue);
- thisObject->m_JSCrypto.visit(visitor); visitor.append(thisObject->m_JSCryptoSetterValue);
- thisObject->m_JSCryptoHasher.visit(visitor); visitor.append(thisObject->m_JSCryptoHasherSetterValue);
- thisObject->m_JSDebugHTTPSServer.visit(visitor); visitor.append(thisObject->m_JSDebugHTTPSServerSetterValue);
- thisObject->m_JSDebugHTTPServer.visit(visitor); visitor.append(thisObject->m_JSDebugHTTPServerSetterValue);
- thisObject->m_JSDirent.visit(visitor); visitor.append(thisObject->m_JSDirentSetterValue);
- thisObject->m_JSDocEnd.visit(visitor); visitor.append(thisObject->m_JSDocEndSetterValue);
- thisObject->m_JSDocType.visit(visitor); visitor.append(thisObject->m_JSDocTypeSetterValue);
- thisObject->m_JSElement.visit(visitor); visitor.append(thisObject->m_JSElementSetterValue);
- thisObject->m_JSEndTag.visit(visitor); visitor.append(thisObject->m_JSEndTagSetterValue);
- thisObject->m_JSExpect.visit(visitor); visitor.append(thisObject->m_JSExpectSetterValue);
- thisObject->m_JSExpectAny.visit(visitor); visitor.append(thisObject->m_JSExpectAnySetterValue);
- thisObject->m_JSExpectAnything.visit(visitor); visitor.append(thisObject->m_JSExpectAnythingSetterValue);
- thisObject->m_JSExpectStringContaining.visit(visitor); visitor.append(thisObject->m_JSExpectStringContainingSetterValue);
- thisObject->m_JSExpectStringMatching.visit(visitor); visitor.append(thisObject->m_JSExpectStringMatchingSetterValue);
- thisObject->m_JSFFI.visit(visitor); visitor.append(thisObject->m_JSFFISetterValue);
- thisObject->m_JSFSWatcher.visit(visitor); visitor.append(thisObject->m_JSFSWatcherSetterValue);
- thisObject->m_JSFileSystemRouter.visit(visitor); visitor.append(thisObject->m_JSFileSystemRouterSetterValue);
- thisObject->m_JSHTMLRewriter.visit(visitor); visitor.append(thisObject->m_JSHTMLRewriterSetterValue);
- thisObject->m_JSHTTPSServer.visit(visitor); visitor.append(thisObject->m_JSHTTPSServerSetterValue);
- thisObject->m_JSHTTPServer.visit(visitor); visitor.append(thisObject->m_JSHTTPServerSetterValue);
- thisObject->m_JSListener.visit(visitor); visitor.append(thisObject->m_JSListenerSetterValue);
- thisObject->m_JSMD4.visit(visitor); visitor.append(thisObject->m_JSMD4SetterValue);
- thisObject->m_JSMD5.visit(visitor); visitor.append(thisObject->m_JSMD5SetterValue);
- thisObject->m_JSMatchedRoute.visit(visitor); visitor.append(thisObject->m_JSMatchedRouteSetterValue);
- thisObject->m_JSNodeJSFS.visit(visitor); visitor.append(thisObject->m_JSNodeJSFSSetterValue);
- thisObject->m_JSRequest.visit(visitor); visitor.append(thisObject->m_JSRequestSetterValue);
- thisObject->m_JSResolveMessage.visit(visitor); visitor.append(thisObject->m_JSResolveMessageSetterValue);
- thisObject->m_JSResponse.visit(visitor); visitor.append(thisObject->m_JSResponseSetterValue);
- thisObject->m_JSSHA1.visit(visitor); visitor.append(thisObject->m_JSSHA1SetterValue);
- thisObject->m_JSSHA224.visit(visitor); visitor.append(thisObject->m_JSSHA224SetterValue);
- thisObject->m_JSSHA256.visit(visitor); visitor.append(thisObject->m_JSSHA256SetterValue);
- thisObject->m_JSSHA384.visit(visitor); visitor.append(thisObject->m_JSSHA384SetterValue);
- thisObject->m_JSSHA512.visit(visitor); visitor.append(thisObject->m_JSSHA512SetterValue);
- thisObject->m_JSSHA512_256.visit(visitor); visitor.append(thisObject->m_JSSHA512_256SetterValue);
- thisObject->m_JSServerWebSocket.visit(visitor); visitor.append(thisObject->m_JSServerWebSocketSetterValue);
- thisObject->m_JSStatWatcher.visit(visitor); visitor.append(thisObject->m_JSStatWatcherSetterValue);
- thisObject->m_JSStats.visit(visitor); visitor.append(thisObject->m_JSStatsSetterValue);
- thisObject->m_JSSubprocess.visit(visitor); visitor.append(thisObject->m_JSSubprocessSetterValue);
- thisObject->m_JSTCPSocket.visit(visitor); visitor.append(thisObject->m_JSTCPSocketSetterValue);
- thisObject->m_JSTLSSocket.visit(visitor); visitor.append(thisObject->m_JSTLSSocketSetterValue);
- thisObject->m_JSTextChunk.visit(visitor); visitor.append(thisObject->m_JSTextChunkSetterValue);
- thisObject->m_JSTextDecoder.visit(visitor); visitor.append(thisObject->m_JSTextDecoderSetterValue);
- thisObject->m_JSTimeout.visit(visitor); visitor.append(thisObject->m_JSTimeoutSetterValue);
- thisObject->m_JSTranspiler.visit(visitor); visitor.append(thisObject->m_JSTranspilerSetterValue);
+ thisObject->m_JSAttributeIterator.visit(visitor);
+ thisObject->m_JSBigIntStats.visit(visitor);
+ thisObject->m_JSBlob.visit(visitor);
+ thisObject->m_JSBuildArtifact.visit(visitor);
+ thisObject->m_JSBuildMessage.visit(visitor);
+ thisObject->m_JSComment.visit(visitor);
+ thisObject->m_JSCrypto.visit(visitor);
+ thisObject->m_JSCryptoHasher.visit(visitor);
+ thisObject->m_JSDebugHTTPSServer.visit(visitor);
+ thisObject->m_JSDebugHTTPServer.visit(visitor);
+ thisObject->m_JSDirent.visit(visitor);
+ thisObject->m_JSDocEnd.visit(visitor);
+ thisObject->m_JSDocType.visit(visitor);
+ thisObject->m_JSElement.visit(visitor);
+ thisObject->m_JSEndTag.visit(visitor);
+ thisObject->m_JSExpect.visit(visitor);
+ thisObject->m_JSExpectAny.visit(visitor);
+ thisObject->m_JSExpectAnything.visit(visitor);
+ thisObject->m_JSExpectArrayContaining.visit(visitor);
+ thisObject->m_JSExpectStringContaining.visit(visitor);
+ thisObject->m_JSExpectStringMatching.visit(visitor);
+ thisObject->m_JSFFI.visit(visitor);
+ thisObject->m_JSFSWatcher.visit(visitor);
+ thisObject->m_JSFileSystemRouter.visit(visitor);
+ thisObject->m_JSHTMLRewriter.visit(visitor);
+ thisObject->m_JSHTTPSServer.visit(visitor);
+ thisObject->m_JSHTTPServer.visit(visitor);
+ thisObject->m_JSListener.visit(visitor);
+ thisObject->m_JSMD4.visit(visitor);
+ thisObject->m_JSMD5.visit(visitor);
+ thisObject->m_JSMatchedRoute.visit(visitor);
+ thisObject->m_JSNodeJSFS.visit(visitor);
+ thisObject->m_JSRequest.visit(visitor);
+ thisObject->m_JSResolveMessage.visit(visitor);
+ thisObject->m_JSResponse.visit(visitor);
+ thisObject->m_JSSHA1.visit(visitor);
+ thisObject->m_JSSHA224.visit(visitor);
+ thisObject->m_JSSHA256.visit(visitor);
+ thisObject->m_JSSHA384.visit(visitor);
+ thisObject->m_JSSHA512.visit(visitor);
+ thisObject->m_JSSHA512_256.visit(visitor);
+ thisObject->m_JSServerWebSocket.visit(visitor);
+ thisObject->m_JSStatWatcher.visit(visitor);
+ thisObject->m_JSStats.visit(visitor);
+ thisObject->m_JSSubprocess.visit(visitor);
+ thisObject->m_JSTCPSocket.visit(visitor);
+ thisObject->m_JSTLSSocket.visit(visitor);
+ thisObject->m_JSTextChunk.visit(visitor);
+ thisObject->m_JSTextDecoder.visit(visitor);
+ thisObject->m_JSTimeout.visit(visitor);
+ thisObject->m_JSTranspiler.visit(visitor);
} \ No newline at end of file
diff --git a/src/bun.js/bindings/ZigGeneratedClasses.cpp b/src/bun.js/bindings/ZigGeneratedClasses.cpp
index ec2add296..8d8c98154 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses.cpp
+++ b/src/bun.js/bindings/ZigGeneratedClasses.cpp
@@ -43,6 +43,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSAttributeIteratorPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -150,7 +151,7 @@ void JSAttributeIteratorPrototype::finishCreation(JSC::VM& vm, JSC::JSGlobalObje
{
Base::finishCreation(vm);
reifyStaticProperties(vm, JSAttributeIterator::info(), JSAttributeIteratorPrototypeTableValues, *this);
- this->putDirect(vm, vm.propertyNames->iteratorSymbol, JSFunction::create(vm, globalObject, 1, String("iterator"_s), AttributeIteratorPrototype__iteratorCallback, ImplementationVisibility::Public), PropertyAttribute::Function | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | 0);
+ this->putDirect(vm, vm.propertyNames->iteratorSymbol, JSFunction::create(vm, globalObject, 1, String("iterator"_s), AttributeIteratorPrototype__iteratorCallback, ImplementationVisibility::Public), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | 0);
JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
}
@@ -245,6 +246,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSBigIntStatsPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -1301,6 +1303,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSBlobPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -1777,7 +1780,7 @@ JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSBlobConstructor::construct(JSC::J
}
JSBlob* instance = JSBlob::create(vm, globalObject, structure, ptr);
- vm.heap.reportExtraMemoryAllocated(Blob__estimatedSize(instance->wrapped()));
+ vm.heap.reportExtraMemoryAllocated(instance, Blob__estimatedSize(instance->wrapped()));
return JSValue::encode(instance);
}
@@ -1871,7 +1874,7 @@ extern "C" EncodedJSValue Blob__create(Zig::GlobalObject* globalObject, void* pt
auto& vm = globalObject->vm();
JSC::Structure* structure = globalObject->JSBlobStructure();
JSBlob* instance = JSBlob::create(vm, globalObject, structure, ptr);
- vm.heap.reportExtraMemoryAllocated(Blob__estimatedSize(ptr));
+ vm.heap.reportExtraMemoryAllocated(instance, Blob__estimatedSize(ptr));
return JSValue::encode(instance);
}
@@ -1924,6 +1927,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSBuildArtifactPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -2471,6 +2475,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSBuildMessagePrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -2752,7 +2757,7 @@ void JSBuildMessagePrototype::finishCreation(JSC::VM& vm, JSC::JSGlobalObject* g
{
Base::finishCreation(vm);
reifyStaticProperties(vm, JSBuildMessage::info(), JSBuildMessagePrototypeTableValues, *this);
- this->putDirect(vm, vm.propertyNames->toPrimitiveSymbol, JSFunction::create(vm, globalObject, 1, String("toPrimitive"_s), BuildMessagePrototype__toPrimitiveCallback, ImplementationVisibility::Public), PropertyAttribute::Function | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | 0);
+ this->putDirect(vm, vm.propertyNames->toPrimitiveSymbol, JSFunction::create(vm, globalObject, 1, String("toPrimitive"_s), BuildMessagePrototype__toPrimitiveCallback, ImplementationVisibility::Public), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | 0);
this->putDirect(vm, vm.propertyNames->name, jsString(vm, String("BuildMessage"_s)), PropertyAttribute::ReadOnly | 0);
JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
}
@@ -2950,6 +2955,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSCommentPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -3262,6 +3268,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSCryptoPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -3715,6 +3722,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSCryptoHasherPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -4146,6 +4154,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSDebugHTTPSServerPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -4167,6 +4176,9 @@ JSC_DECLARE_CUSTOM_GETTER(jsDebugHTTPSServerConstructor);
extern "C" void DebugHTTPSServerClass__finalize(void*);
+extern "C" JSC::EncodedJSValue DebugHTTPSServerPrototype__getAddress(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
+JSC_DECLARE_CUSTOM_GETTER(DebugHTTPSServerPrototype__addressGetterWrap);
+
extern "C" JSC::EncodedJSValue DebugHTTPSServerPrototype__getDevelopment(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
JSC_DECLARE_CUSTOM_GETTER(DebugHTTPSServerPrototype__developmentGetterWrap);
@@ -4197,6 +4209,9 @@ JSC_DECLARE_HOST_FUNCTION(DebugHTTPSServerPrototype__publishCallback);
extern "C" EncodedJSValue DebugHTTPSServerPrototype__doReload(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(DebugHTTPSServerPrototype__reloadCallback);
+extern "C" EncodedJSValue DebugHTTPSServerPrototype__doRequestIP(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(DebugHTTPSServerPrototype__requestIPCallback);
+
extern "C" EncodedJSValue DebugHTTPSServerPrototype__doStop(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(DebugHTTPSServerPrototype__stopCallback);
@@ -4206,6 +4221,7 @@ JSC_DECLARE_HOST_FUNCTION(DebugHTTPSServerPrototype__upgradeCallback);
STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSDebugHTTPSServerPrototype, JSDebugHTTPSServerPrototype::Base);
static const HashTableValue JSDebugHTTPSServerPrototypeTableValues[] = {
+ { "address"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, DebugHTTPSServerPrototype__addressGetterWrap, 0 } },
{ "development"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, DebugHTTPSServerPrototype__developmentGetterWrap, 0 } },
{ "fetch"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, DebugHTTPSServerPrototype__fetchCallback, 1 } },
{ "hostname"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, DebugHTTPSServerPrototype__hostnameGetterWrap, 0 } },
@@ -4216,6 +4232,7 @@ static const HashTableValue JSDebugHTTPSServerPrototypeTableValues[] = {
{ "protocol"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, DebugHTTPSServerPrototype__protocolGetterWrap, 0 } },
{ "publish"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, DebugHTTPSServerPrototype__publishCallback, 3 } },
{ "reload"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, DebugHTTPSServerPrototype__reloadCallback, 2 } },
+ { "requestIP"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, DebugHTTPSServerPrototype__requestIPCallback, 1 } },
{ "stop"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, DebugHTTPSServerPrototype__stopCallback, 1 } },
{ "upgrade"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, DebugHTTPSServerPrototype__upgradeCallback, 1 } }
};
@@ -4234,6 +4251,37 @@ JSC_DEFINE_CUSTOM_GETTER(jsDebugHTTPSServerConstructor, (JSGlobalObject * lexica
return JSValue::encode(globalObject->JSDebugHTTPSServerConstructor());
}
+JSC_DEFINE_CUSTOM_GETTER(DebugHTTPSServerPrototype__addressGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
+{
+ auto& vm = lexicalGlobalObject->vm();
+ Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ JSDebugHTTPSServer* thisObject = jsCast<JSDebugHTTPSServer*>(JSValue::decode(thisValue));
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ if (JSValue cachedValue = thisObject->m_address.get())
+ return JSValue::encode(cachedValue);
+
+ JSC::JSValue result = JSC::JSValue::decode(
+ DebugHTTPSServerPrototype__getAddress(thisObject->wrapped(), globalObject));
+ RETURN_IF_EXCEPTION(throwScope, {});
+ thisObject->m_address.set(vm, thisObject, result);
+ RELEASE_AND_RETURN(throwScope, JSValue::encode(result));
+}
+
+extern "C" void DebugHTTPSServerPrototype__addressSetCachedValue(JSC::EncodedJSValue thisValue, JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value)
+{
+ auto& vm = globalObject->vm();
+ auto* thisObject = jsCast<JSDebugHTTPSServer*>(JSValue::decode(thisValue));
+ thisObject->m_address.set(vm, thisObject, JSValue::decode(value));
+}
+
+extern "C" EncodedJSValue DebugHTTPSServerPrototype__addressGetCachedValue(JSC::EncodedJSValue thisValue)
+{
+ auto* thisObject = jsCast<JSDebugHTTPSServer*>(JSValue::decode(thisValue));
+ return JSValue::encode(thisObject->m_address.get());
+}
+
JSC_DEFINE_CUSTOM_GETTER(DebugHTTPSServerPrototype__developmentGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
{
auto& vm = lexicalGlobalObject->vm();
@@ -4440,6 +4488,34 @@ JSC_DEFINE_HOST_FUNCTION(DebugHTTPSServerPrototype__reloadCallback, (JSGlobalObj
return DebugHTTPSServerPrototype__doReload(thisObject->wrapped(), lexicalGlobalObject, callFrame);
}
+JSC_DEFINE_HOST_FUNCTION(DebugHTTPSServerPrototype__requestIPCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSDebugHTTPSServer* thisObject = jsDynamicCast<JSDebugHTTPSServer*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ throwVMTypeError(lexicalGlobalObject, throwScope, "Expected 'this' to be instanceof DebugHTTPSServer"_s);
+ return JSValue::encode({});
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return DebugHTTPSServerPrototype__doRequestIP(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
JSC_DEFINE_HOST_FUNCTION(DebugHTTPSServerPrototype__stopCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
{
auto& vm = lexicalGlobalObject->vm();
@@ -4598,6 +4674,7 @@ void JSDebugHTTPSServer::visitAdditionalChildren(Visitor& visitor)
JSDebugHTTPSServer* thisObject = this;
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+ visitor.append(thisObject->m_address);
visitor.append(thisObject->m_hostname);
visitor.append(thisObject->m_id);
}
@@ -4628,6 +4705,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSDebugHTTPServerPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -4649,6 +4727,9 @@ JSC_DECLARE_CUSTOM_GETTER(jsDebugHTTPServerConstructor);
extern "C" void DebugHTTPServerClass__finalize(void*);
+extern "C" JSC::EncodedJSValue DebugHTTPServerPrototype__getAddress(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
+JSC_DECLARE_CUSTOM_GETTER(DebugHTTPServerPrototype__addressGetterWrap);
+
extern "C" JSC::EncodedJSValue DebugHTTPServerPrototype__getDevelopment(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
JSC_DECLARE_CUSTOM_GETTER(DebugHTTPServerPrototype__developmentGetterWrap);
@@ -4679,6 +4760,9 @@ JSC_DECLARE_HOST_FUNCTION(DebugHTTPServerPrototype__publishCallback);
extern "C" EncodedJSValue DebugHTTPServerPrototype__doReload(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(DebugHTTPServerPrototype__reloadCallback);
+extern "C" EncodedJSValue DebugHTTPServerPrototype__doRequestIP(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(DebugHTTPServerPrototype__requestIPCallback);
+
extern "C" EncodedJSValue DebugHTTPServerPrototype__doStop(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(DebugHTTPServerPrototype__stopCallback);
@@ -4688,6 +4772,7 @@ JSC_DECLARE_HOST_FUNCTION(DebugHTTPServerPrototype__upgradeCallback);
STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSDebugHTTPServerPrototype, JSDebugHTTPServerPrototype::Base);
static const HashTableValue JSDebugHTTPServerPrototypeTableValues[] = {
+ { "address"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, DebugHTTPServerPrototype__addressGetterWrap, 0 } },
{ "development"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, DebugHTTPServerPrototype__developmentGetterWrap, 0 } },
{ "fetch"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, DebugHTTPServerPrototype__fetchCallback, 1 } },
{ "hostname"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, DebugHTTPServerPrototype__hostnameGetterWrap, 0 } },
@@ -4698,6 +4783,7 @@ static const HashTableValue JSDebugHTTPServerPrototypeTableValues[] = {
{ "protocol"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, DebugHTTPServerPrototype__protocolGetterWrap, 0 } },
{ "publish"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, DebugHTTPServerPrototype__publishCallback, 3 } },
{ "reload"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, DebugHTTPServerPrototype__reloadCallback, 2 } },
+ { "requestIP"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, DebugHTTPServerPrototype__requestIPCallback, 1 } },
{ "stop"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, DebugHTTPServerPrototype__stopCallback, 1 } },
{ "upgrade"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, DebugHTTPServerPrototype__upgradeCallback, 1 } }
};
@@ -4716,6 +4802,37 @@ JSC_DEFINE_CUSTOM_GETTER(jsDebugHTTPServerConstructor, (JSGlobalObject * lexical
return JSValue::encode(globalObject->JSDebugHTTPServerConstructor());
}
+JSC_DEFINE_CUSTOM_GETTER(DebugHTTPServerPrototype__addressGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
+{
+ auto& vm = lexicalGlobalObject->vm();
+ Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ JSDebugHTTPServer* thisObject = jsCast<JSDebugHTTPServer*>(JSValue::decode(thisValue));
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ if (JSValue cachedValue = thisObject->m_address.get())
+ return JSValue::encode(cachedValue);
+
+ JSC::JSValue result = JSC::JSValue::decode(
+ DebugHTTPServerPrototype__getAddress(thisObject->wrapped(), globalObject));
+ RETURN_IF_EXCEPTION(throwScope, {});
+ thisObject->m_address.set(vm, thisObject, result);
+ RELEASE_AND_RETURN(throwScope, JSValue::encode(result));
+}
+
+extern "C" void DebugHTTPServerPrototype__addressSetCachedValue(JSC::EncodedJSValue thisValue, JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value)
+{
+ auto& vm = globalObject->vm();
+ auto* thisObject = jsCast<JSDebugHTTPServer*>(JSValue::decode(thisValue));
+ thisObject->m_address.set(vm, thisObject, JSValue::decode(value));
+}
+
+extern "C" EncodedJSValue DebugHTTPServerPrototype__addressGetCachedValue(JSC::EncodedJSValue thisValue)
+{
+ auto* thisObject = jsCast<JSDebugHTTPServer*>(JSValue::decode(thisValue));
+ return JSValue::encode(thisObject->m_address.get());
+}
+
JSC_DEFINE_CUSTOM_GETTER(DebugHTTPServerPrototype__developmentGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
{
auto& vm = lexicalGlobalObject->vm();
@@ -4922,6 +5039,34 @@ JSC_DEFINE_HOST_FUNCTION(DebugHTTPServerPrototype__reloadCallback, (JSGlobalObje
return DebugHTTPServerPrototype__doReload(thisObject->wrapped(), lexicalGlobalObject, callFrame);
}
+JSC_DEFINE_HOST_FUNCTION(DebugHTTPServerPrototype__requestIPCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSDebugHTTPServer* thisObject = jsDynamicCast<JSDebugHTTPServer*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ throwVMTypeError(lexicalGlobalObject, throwScope, "Expected 'this' to be instanceof DebugHTTPServer"_s);
+ return JSValue::encode({});
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return DebugHTTPServerPrototype__doRequestIP(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
JSC_DEFINE_HOST_FUNCTION(DebugHTTPServerPrototype__stopCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
{
auto& vm = lexicalGlobalObject->vm();
@@ -5080,6 +5225,7 @@ void JSDebugHTTPServer::visitAdditionalChildren(Visitor& visitor)
JSDebugHTTPServer* thisObject = this;
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+ visitor.append(thisObject->m_address);
visitor.append(thisObject->m_hostname);
visitor.append(thisObject->m_id);
}
@@ -5110,6 +5256,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSDirentPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -5644,6 +5791,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSDocEndPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -5814,6 +5962,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSDocTypePrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -6092,6 +6241,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSElementPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -6808,6 +6958,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSEndTagPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -7072,6 +7223,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSExpectPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -7257,6 +7409,9 @@ JSC_DECLARE_HOST_FUNCTION(ExpectPrototype__toEndWithCallback);
extern "C" EncodedJSValue ExpectPrototype__toEqual(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(ExpectPrototype__toEqualCallback);
+extern "C" EncodedJSValue ExpectPrototype__toEqualIgnoringWhitespace(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(ExpectPrototype__toEqualIgnoringWhitespaceCallback);
+
extern "C" EncodedJSValue ExpectPrototype__toHaveBeenCalled(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(ExpectPrototype__toHaveBeenCalledCallback);
@@ -7371,6 +7526,7 @@ static const HashTableValue JSExpectPrototypeTableValues[] = {
{ "toContainEqual"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, ExpectPrototype__toContainEqualCallback, 1 } },
{ "toEndWith"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, ExpectPrototype__toEndWithCallback, 1 } },
{ "toEqual"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, ExpectPrototype__toEqualCallback, 1 } },
+ { "toEqualIgnoringWhitespace"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, ExpectPrototype__toEqualIgnoringWhitespaceCallback, 1 } },
{ "toHaveBeenCalled"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, ExpectPrototype__toHaveBeenCalledCallback, 0 } },
{ "toHaveBeenCalledTimes"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, ExpectPrototype__toHaveBeenCalledTimesCallback, 1 } },
{ "toHaveBeenCalledWith"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, ExpectPrototype__toHaveBeenCalledWithCallback, 1 } },
@@ -8538,6 +8694,34 @@ JSC_DEFINE_HOST_FUNCTION(ExpectPrototype__toEqualCallback, (JSGlobalObject * lex
return ExpectPrototype__toEqual(thisObject->wrapped(), lexicalGlobalObject, callFrame);
}
+JSC_DEFINE_HOST_FUNCTION(ExpectPrototype__toEqualIgnoringWhitespaceCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSExpect* thisObject = jsDynamicCast<JSExpect*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ throwVMTypeError(lexicalGlobalObject, throwScope, "Expected 'this' to be instanceof Expect"_s);
+ return JSValue::encode({});
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return ExpectPrototype__toEqualIgnoringWhitespace(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
JSC_DEFINE_HOST_FUNCTION(ExpectPrototype__toHaveBeenCalledCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
{
auto& vm = lexicalGlobalObject->vm();
@@ -9436,6 +9620,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSExpectAnyPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -9604,6 +9789,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSExpectAnythingPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -9712,6 +9898,175 @@ extern "C" EncodedJSValue ExpectAnything__create(Zig::GlobalObject* globalObject
return JSValue::encode(instance);
}
+class JSExpectArrayContainingPrototype final : public JSC::JSNonFinalObject {
+public:
+ using Base = JSC::JSNonFinalObject;
+
+ static JSExpectArrayContainingPrototype* create(JSC::VM& vm, JSGlobalObject* globalObject, JSC::Structure* structure)
+ {
+ JSExpectArrayContainingPrototype* ptr = new (NotNull, JSC::allocateCell<JSExpectArrayContainingPrototype>(vm)) JSExpectArrayContainingPrototype(vm, globalObject, structure);
+ ptr->finishCreation(vm, globalObject);
+ return ptr;
+ }
+
+ DECLARE_INFO;
+ template<typename CellType, JSC::SubspaceAccess>
+ static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
+ {
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSExpectArrayContainingPrototype, Base);
+ return &vm.plainObjectSpace();
+ }
+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+ }
+
+private:
+ JSExpectArrayContainingPrototype(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+ : Base(vm, structure)
+ {
+ }
+
+ void finishCreation(JSC::VM&, JSC::JSGlobalObject*);
+};
+
+extern "C" void ExpectArrayContainingClass__finalize(void*);
+extern "C" JSC_DECLARE_HOST_FUNCTION(ExpectArrayContainingClass__call);
+
+STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSExpectArrayContainingPrototype, JSExpectArrayContainingPrototype::Base);
+
+static const HashTableValue JSExpectArrayContainingPrototypeTableValues[] = {};
+
+const ClassInfo JSExpectArrayContainingPrototype::s_info = { "ExpectArrayContaining"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSExpectArrayContainingPrototype) };
+
+extern "C" void ExpectArrayContainingPrototype__arrayValueSetCachedValue(JSC::EncodedJSValue thisValue, JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value)
+{
+ auto& vm = globalObject->vm();
+ auto* thisObject = jsCast<JSExpectArrayContaining*>(JSValue::decode(thisValue));
+ thisObject->m_arrayValue.set(vm, thisObject, JSValue::decode(value));
+}
+
+extern "C" EncodedJSValue ExpectArrayContainingPrototype__arrayValueGetCachedValue(JSC::EncodedJSValue thisValue)
+{
+ auto* thisObject = jsCast<JSExpectArrayContaining*>(JSValue::decode(thisValue));
+ return JSValue::encode(thisObject->m_arrayValue.get());
+}
+
+void JSExpectArrayContainingPrototype::finishCreation(JSC::VM& vm, JSC::JSGlobalObject* globalObject)
+{
+ Base::finishCreation(vm);
+
+ JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
+}
+
+JSExpectArrayContaining::~JSExpectArrayContaining()
+{
+ if (m_ctx) {
+ ExpectArrayContainingClass__finalize(m_ctx);
+ }
+}
+void JSExpectArrayContaining::destroy(JSCell* cell)
+{
+ static_cast<JSExpectArrayContaining*>(cell)->JSExpectArrayContaining::~JSExpectArrayContaining();
+}
+
+const ClassInfo JSExpectArrayContaining::s_info = { "ExpectArrayContaining"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSExpectArrayContaining) };
+
+void JSExpectArrayContaining::finishCreation(VM& vm)
+{
+ Base::finishCreation(vm);
+ ASSERT(inherits(info()));
+}
+
+JSExpectArrayContaining* JSExpectArrayContaining::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, void* ctx)
+{
+ JSExpectArrayContaining* ptr = new (NotNull, JSC::allocateCell<JSExpectArrayContaining>(vm)) JSExpectArrayContaining(vm, structure, ctx);
+ ptr->finishCreation(vm);
+ return ptr;
+}
+
+extern "C" void* ExpectArrayContaining__fromJS(JSC::EncodedJSValue value)
+{
+ JSC::JSValue decodedValue = JSC::JSValue::decode(value);
+ if (decodedValue.isEmpty() || !decodedValue.isCell())
+ return nullptr;
+
+ JSC::JSCell* cell = decodedValue.asCell();
+ JSExpectArrayContaining* object = JSC::jsDynamicCast<JSExpectArrayContaining*>(cell);
+
+ if (!object)
+ return nullptr;
+
+ return object->wrapped();
+}
+
+extern "C" bool ExpectArrayContaining__dangerouslySetPtr(JSC::EncodedJSValue value, void* ptr)
+{
+ JSExpectArrayContaining* object = JSC::jsDynamicCast<JSExpectArrayContaining*>(JSValue::decode(value));
+ if (!object)
+ return false;
+
+ object->m_ctx = ptr;
+ return true;
+}
+
+extern "C" const size_t ExpectArrayContaining__ptrOffset = JSExpectArrayContaining::offsetOfWrapped();
+
+void JSExpectArrayContaining::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer)
+{
+ auto* thisObject = jsCast<JSExpectArrayContaining*>(cell);
+ if (void* wrapped = thisObject->wrapped()) {
+ // if (thisObject->scriptExecutionContext())
+ // analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
+ }
+ Base::analyzeHeap(cell, analyzer);
+}
+
+JSObject* JSExpectArrayContaining::createPrototype(VM& vm, JSDOMGlobalObject* globalObject)
+{
+ return JSExpectArrayContainingPrototype::create(vm, globalObject, JSExpectArrayContainingPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
+}
+
+extern "C" EncodedJSValue ExpectArrayContaining__create(Zig::GlobalObject* globalObject, void* ptr)
+{
+ auto& vm = globalObject->vm();
+ JSC::Structure* structure = globalObject->JSExpectArrayContainingStructure();
+ JSExpectArrayContaining* instance = JSExpectArrayContaining::create(vm, globalObject, structure, ptr);
+
+ return JSValue::encode(instance);
+}
+
+template<typename Visitor>
+void JSExpectArrayContaining::visitChildrenImpl(JSCell* cell, Visitor& visitor)
+{
+ JSExpectArrayContaining* thisObject = jsCast<JSExpectArrayContaining*>(cell);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+ Base::visitChildren(thisObject, visitor);
+
+ thisObject->visitAdditionalChildren<Visitor>(visitor);
+}
+
+DEFINE_VISIT_CHILDREN(JSExpectArrayContaining);
+
+template<typename Visitor>
+void JSExpectArrayContaining::visitAdditionalChildren(Visitor& visitor)
+{
+ JSExpectArrayContaining* thisObject = this;
+ ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+ visitor.append(thisObject->m_arrayValue);
+}
+
+DEFINE_VISIT_ADDITIONAL_CHILDREN(JSExpectArrayContaining);
+
+template<typename Visitor>
+void JSExpectArrayContaining::visitOutputConstraintsImpl(JSCell* cell, Visitor& visitor)
+{
+ JSExpectArrayContaining* thisObject = jsCast<JSExpectArrayContaining*>(cell);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+ thisObject->visitAdditionalChildren<Visitor>(visitor);
+}
+
+DEFINE_VISIT_OUTPUT_CONSTRAINTS(JSExpectArrayContaining);
class JSExpectStringContainingPrototype final : public JSC::JSNonFinalObject {
public:
using Base = JSC::JSNonFinalObject;
@@ -9727,6 +10082,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSExpectStringContainingPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -9895,6 +10251,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSExpectStringMatchingPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -10063,6 +10420,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSFFIPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -10313,6 +10671,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSFSWatcherPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -10617,6 +10976,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSFileSystemRouterPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -11063,6 +11423,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSHTMLRewriterPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -11401,6 +11762,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSHTTPSServerPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -11422,6 +11784,9 @@ JSC_DECLARE_CUSTOM_GETTER(jsHTTPSServerConstructor);
extern "C" void HTTPSServerClass__finalize(void*);
+extern "C" JSC::EncodedJSValue HTTPSServerPrototype__getAddress(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
+JSC_DECLARE_CUSTOM_GETTER(HTTPSServerPrototype__addressGetterWrap);
+
extern "C" JSC::EncodedJSValue HTTPSServerPrototype__getDevelopment(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
JSC_DECLARE_CUSTOM_GETTER(HTTPSServerPrototype__developmentGetterWrap);
@@ -11452,6 +11817,9 @@ JSC_DECLARE_HOST_FUNCTION(HTTPSServerPrototype__publishCallback);
extern "C" EncodedJSValue HTTPSServerPrototype__doReload(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(HTTPSServerPrototype__reloadCallback);
+extern "C" EncodedJSValue HTTPSServerPrototype__doRequestIP(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(HTTPSServerPrototype__requestIPCallback);
+
extern "C" EncodedJSValue HTTPSServerPrototype__doStop(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(HTTPSServerPrototype__stopCallback);
@@ -11461,6 +11829,7 @@ JSC_DECLARE_HOST_FUNCTION(HTTPSServerPrototype__upgradeCallback);
STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSHTTPSServerPrototype, JSHTTPSServerPrototype::Base);
static const HashTableValue JSHTTPSServerPrototypeTableValues[] = {
+ { "address"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, HTTPSServerPrototype__addressGetterWrap, 0 } },
{ "development"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, HTTPSServerPrototype__developmentGetterWrap, 0 } },
{ "fetch"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, HTTPSServerPrototype__fetchCallback, 1 } },
{ "hostname"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, HTTPSServerPrototype__hostnameGetterWrap, 0 } },
@@ -11471,6 +11840,7 @@ static const HashTableValue JSHTTPSServerPrototypeTableValues[] = {
{ "protocol"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, HTTPSServerPrototype__protocolGetterWrap, 0 } },
{ "publish"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, HTTPSServerPrototype__publishCallback, 3 } },
{ "reload"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, HTTPSServerPrototype__reloadCallback, 2 } },
+ { "requestIP"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, HTTPSServerPrototype__requestIPCallback, 1 } },
{ "stop"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, HTTPSServerPrototype__stopCallback, 1 } },
{ "upgrade"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, HTTPSServerPrototype__upgradeCallback, 1 } }
};
@@ -11489,6 +11859,37 @@ JSC_DEFINE_CUSTOM_GETTER(jsHTTPSServerConstructor, (JSGlobalObject * lexicalGlob
return JSValue::encode(globalObject->JSHTTPSServerConstructor());
}
+JSC_DEFINE_CUSTOM_GETTER(HTTPSServerPrototype__addressGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
+{
+ auto& vm = lexicalGlobalObject->vm();
+ Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ JSHTTPSServer* thisObject = jsCast<JSHTTPSServer*>(JSValue::decode(thisValue));
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ if (JSValue cachedValue = thisObject->m_address.get())
+ return JSValue::encode(cachedValue);
+
+ JSC::JSValue result = JSC::JSValue::decode(
+ HTTPSServerPrototype__getAddress(thisObject->wrapped(), globalObject));
+ RETURN_IF_EXCEPTION(throwScope, {});
+ thisObject->m_address.set(vm, thisObject, result);
+ RELEASE_AND_RETURN(throwScope, JSValue::encode(result));
+}
+
+extern "C" void HTTPSServerPrototype__addressSetCachedValue(JSC::EncodedJSValue thisValue, JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value)
+{
+ auto& vm = globalObject->vm();
+ auto* thisObject = jsCast<JSHTTPSServer*>(JSValue::decode(thisValue));
+ thisObject->m_address.set(vm, thisObject, JSValue::decode(value));
+}
+
+extern "C" EncodedJSValue HTTPSServerPrototype__addressGetCachedValue(JSC::EncodedJSValue thisValue)
+{
+ auto* thisObject = jsCast<JSHTTPSServer*>(JSValue::decode(thisValue));
+ return JSValue::encode(thisObject->m_address.get());
+}
+
JSC_DEFINE_CUSTOM_GETTER(HTTPSServerPrototype__developmentGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
{
auto& vm = lexicalGlobalObject->vm();
@@ -11695,6 +12096,34 @@ JSC_DEFINE_HOST_FUNCTION(HTTPSServerPrototype__reloadCallback, (JSGlobalObject *
return HTTPSServerPrototype__doReload(thisObject->wrapped(), lexicalGlobalObject, callFrame);
}
+JSC_DEFINE_HOST_FUNCTION(HTTPSServerPrototype__requestIPCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSHTTPSServer* thisObject = jsDynamicCast<JSHTTPSServer*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ throwVMTypeError(lexicalGlobalObject, throwScope, "Expected 'this' to be instanceof HTTPSServer"_s);
+ return JSValue::encode({});
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return HTTPSServerPrototype__doRequestIP(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
JSC_DEFINE_HOST_FUNCTION(HTTPSServerPrototype__stopCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
{
auto& vm = lexicalGlobalObject->vm();
@@ -11853,6 +12282,7 @@ void JSHTTPSServer::visitAdditionalChildren(Visitor& visitor)
JSHTTPSServer* thisObject = this;
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+ visitor.append(thisObject->m_address);
visitor.append(thisObject->m_hostname);
visitor.append(thisObject->m_id);
}
@@ -11883,6 +12313,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSHTTPServerPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -11904,6 +12335,9 @@ JSC_DECLARE_CUSTOM_GETTER(jsHTTPServerConstructor);
extern "C" void HTTPServerClass__finalize(void*);
+extern "C" JSC::EncodedJSValue HTTPServerPrototype__getAddress(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
+JSC_DECLARE_CUSTOM_GETTER(HTTPServerPrototype__addressGetterWrap);
+
extern "C" JSC::EncodedJSValue HTTPServerPrototype__getDevelopment(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
JSC_DECLARE_CUSTOM_GETTER(HTTPServerPrototype__developmentGetterWrap);
@@ -11934,6 +12368,9 @@ JSC_DECLARE_HOST_FUNCTION(HTTPServerPrototype__publishCallback);
extern "C" EncodedJSValue HTTPServerPrototype__doReload(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(HTTPServerPrototype__reloadCallback);
+extern "C" EncodedJSValue HTTPServerPrototype__doRequestIP(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(HTTPServerPrototype__requestIPCallback);
+
extern "C" EncodedJSValue HTTPServerPrototype__doStop(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(HTTPServerPrototype__stopCallback);
@@ -11943,6 +12380,7 @@ JSC_DECLARE_HOST_FUNCTION(HTTPServerPrototype__upgradeCallback);
STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSHTTPServerPrototype, JSHTTPServerPrototype::Base);
static const HashTableValue JSHTTPServerPrototypeTableValues[] = {
+ { "address"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, HTTPServerPrototype__addressGetterWrap, 0 } },
{ "development"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, HTTPServerPrototype__developmentGetterWrap, 0 } },
{ "fetch"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, HTTPServerPrototype__fetchCallback, 1 } },
{ "hostname"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, HTTPServerPrototype__hostnameGetterWrap, 0 } },
@@ -11953,6 +12391,7 @@ static const HashTableValue JSHTTPServerPrototypeTableValues[] = {
{ "protocol"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, HTTPServerPrototype__protocolGetterWrap, 0 } },
{ "publish"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, HTTPServerPrototype__publishCallback, 3 } },
{ "reload"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, HTTPServerPrototype__reloadCallback, 2 } },
+ { "requestIP"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, HTTPServerPrototype__requestIPCallback, 1 } },
{ "stop"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, HTTPServerPrototype__stopCallback, 1 } },
{ "upgrade"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, HTTPServerPrototype__upgradeCallback, 1 } }
};
@@ -11971,6 +12410,37 @@ JSC_DEFINE_CUSTOM_GETTER(jsHTTPServerConstructor, (JSGlobalObject * lexicalGloba
return JSValue::encode(globalObject->JSHTTPServerConstructor());
}
+JSC_DEFINE_CUSTOM_GETTER(HTTPServerPrototype__addressGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
+{
+ auto& vm = lexicalGlobalObject->vm();
+ Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ JSHTTPServer* thisObject = jsCast<JSHTTPServer*>(JSValue::decode(thisValue));
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ if (JSValue cachedValue = thisObject->m_address.get())
+ return JSValue::encode(cachedValue);
+
+ JSC::JSValue result = JSC::JSValue::decode(
+ HTTPServerPrototype__getAddress(thisObject->wrapped(), globalObject));
+ RETURN_IF_EXCEPTION(throwScope, {});
+ thisObject->m_address.set(vm, thisObject, result);
+ RELEASE_AND_RETURN(throwScope, JSValue::encode(result));
+}
+
+extern "C" void HTTPServerPrototype__addressSetCachedValue(JSC::EncodedJSValue thisValue, JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value)
+{
+ auto& vm = globalObject->vm();
+ auto* thisObject = jsCast<JSHTTPServer*>(JSValue::decode(thisValue));
+ thisObject->m_address.set(vm, thisObject, JSValue::decode(value));
+}
+
+extern "C" EncodedJSValue HTTPServerPrototype__addressGetCachedValue(JSC::EncodedJSValue thisValue)
+{
+ auto* thisObject = jsCast<JSHTTPServer*>(JSValue::decode(thisValue));
+ return JSValue::encode(thisObject->m_address.get());
+}
+
JSC_DEFINE_CUSTOM_GETTER(HTTPServerPrototype__developmentGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
{
auto& vm = lexicalGlobalObject->vm();
@@ -12177,6 +12647,34 @@ JSC_DEFINE_HOST_FUNCTION(HTTPServerPrototype__reloadCallback, (JSGlobalObject *
return HTTPServerPrototype__doReload(thisObject->wrapped(), lexicalGlobalObject, callFrame);
}
+JSC_DEFINE_HOST_FUNCTION(HTTPServerPrototype__requestIPCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSHTTPServer* thisObject = jsDynamicCast<JSHTTPServer*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ throwVMTypeError(lexicalGlobalObject, throwScope, "Expected 'this' to be instanceof HTTPServer"_s);
+ return JSValue::encode({});
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return HTTPServerPrototype__doRequestIP(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
JSC_DEFINE_HOST_FUNCTION(HTTPServerPrototype__stopCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
{
auto& vm = lexicalGlobalObject->vm();
@@ -12335,6 +12833,7 @@ void JSHTTPServer::visitAdditionalChildren(Visitor& visitor)
JSHTTPServer* thisObject = this;
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+ visitor.append(thisObject->m_address);
visitor.append(thisObject->m_hostname);
visitor.append(thisObject->m_id);
}
@@ -12365,6 +12864,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSListenerPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -12781,6 +13281,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSMD4Prototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -13111,6 +13612,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSMD5Prototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -13441,6 +13943,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSMatchedRoutePrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -13898,6 +14401,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSNodeJSFSPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -16889,6 +17393,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSRequestPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -17514,7 +18019,7 @@ JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSRequestConstructor::construct(JSC
}
JSRequest* instance = JSRequest::create(vm, globalObject, structure, ptr);
- vm.heap.reportExtraMemoryAllocated(Request__estimatedSize(instance->wrapped()));
+ vm.heap.reportExtraMemoryAllocated(instance, Request__estimatedSize(instance->wrapped()));
return JSValue::encode(instance);
}
@@ -17608,7 +18113,7 @@ extern "C" EncodedJSValue Request__create(Zig::GlobalObject* globalObject, void*
auto& vm = globalObject->vm();
JSC::Structure* structure = globalObject->JSRequestStructure();
JSRequest* instance = JSRequest::create(vm, globalObject, structure, ptr);
- vm.heap.reportExtraMemoryAllocated(Request__estimatedSize(ptr));
+ vm.heap.reportExtraMemoryAllocated(instance, Request__estimatedSize(ptr));
return JSValue::encode(instance);
}
@@ -17664,6 +18169,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSResolveMessagePrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -18085,7 +18591,7 @@ void JSResolveMessagePrototype::finishCreation(JSC::VM& vm, JSC::JSGlobalObject*
{
Base::finishCreation(vm);
reifyStaticProperties(vm, JSResolveMessage::info(), JSResolveMessagePrototypeTableValues, *this);
- this->putDirect(vm, vm.propertyNames->toPrimitiveSymbol, JSFunction::create(vm, globalObject, 1, String("toPrimitive"_s), ResolveMessagePrototype__toPrimitiveCallback, ImplementationVisibility::Public), PropertyAttribute::Function | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | 0);
+ this->putDirect(vm, vm.propertyNames->toPrimitiveSymbol, JSFunction::create(vm, globalObject, 1, String("toPrimitive"_s), ResolveMessagePrototype__toPrimitiveCallback, ImplementationVisibility::Public), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | 0);
this->putDirect(vm, vm.propertyNames->name, jsString(vm, String("ResolveMessage"_s)), PropertyAttribute::ReadOnly | 0);
JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
}
@@ -18287,6 +18793,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSResponsePrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -18841,7 +19348,7 @@ JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSResponseConstructor::construct(JS
}
JSResponse* instance = JSResponse::create(vm, globalObject, structure, ptr);
- vm.heap.reportExtraMemoryAllocated(Response__estimatedSize(instance->wrapped()));
+ vm.heap.reportExtraMemoryAllocated(instance, Response__estimatedSize(instance->wrapped()));
return JSValue::encode(instance);
}
@@ -18935,7 +19442,7 @@ extern "C" EncodedJSValue Response__create(Zig::GlobalObject* globalObject, void
auto& vm = globalObject->vm();
JSC::Structure* structure = globalObject->JSResponseStructure();
JSResponse* instance = JSResponse::create(vm, globalObject, structure, ptr);
- vm.heap.reportExtraMemoryAllocated(Response__estimatedSize(ptr));
+ vm.heap.reportExtraMemoryAllocated(instance, Response__estimatedSize(ptr));
return JSValue::encode(instance);
}
@@ -18991,6 +19498,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSSHA1Prototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -19321,6 +19829,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSSHA224Prototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -19651,6 +20160,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSSHA256Prototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -19981,6 +20491,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSSHA384Prototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -20311,6 +20822,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSSHA512Prototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -20641,6 +21153,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSSHA512_256Prototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -20971,6 +21484,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSServerWebSocketPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -21929,6 +22443,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSStatWatcherPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -22201,6 +22716,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSStatsPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -23173,6 +23689,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSSubprocessPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -23736,6 +24253,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTCPSocketPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -24723,8 +25241,10 @@ bool JSTCPSocket::hasPendingActivity(void* ctx)
JSTCPSocket::~JSTCPSocket()
{
+ printf("~JSTCPSocket\n");
if (m_ctx) {
TCPSocketClass__finalize(m_ctx);
+ m_ctx = nullptr;
}
}
void JSTCPSocket::destroy(JSCell* cell)
@@ -24847,6 +25367,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTLSSocketPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -25958,6 +26479,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTextChunkPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -26324,6 +26846,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTextDecoderPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -26409,12 +26932,16 @@ JSC_DECLARE_CUSTOM_GETTER(TextDecoderPrototype__encodingGetterWrap);
extern "C" JSC::EncodedJSValue TextDecoderPrototype__getFatal(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
JSC_DECLARE_CUSTOM_GETTER(TextDecoderPrototype__fatalGetterWrap);
+extern "C" JSC::EncodedJSValue TextDecoderPrototype__getIgnoreBOM(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
+JSC_DECLARE_CUSTOM_GETTER(TextDecoderPrototype__ignoreBOMGetterWrap);
+
STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTextDecoderPrototype, JSTextDecoderPrototype::Base);
static const HashTableValue JSTextDecoderPrototypeTableValues[] = {
{ "decode"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::DOMJITFunctionType, TextDecoderPrototype__decodeCallback, &DOMJITSignatureForTextDecoderPrototype__decode } },
{ "encoding"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TextDecoderPrototype__encodingGetterWrap, 0 } },
- { "fatal"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TextDecoderPrototype__fatalGetterWrap, 0 } }
+ { "fatal"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TextDecoderPrototype__fatalGetterWrap, 0 } },
+ { "ignoreBOM"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TextDecoderPrototype__ignoreBOMGetterWrap, 0 } }
};
const ClassInfo JSTextDecoderPrototype::s_info = { "TextDecoder"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTextDecoderPrototype) };
@@ -26502,6 +27029,18 @@ JSC_DEFINE_CUSTOM_GETTER(TextDecoderPrototype__fatalGetterWrap, (JSGlobalObject
RELEASE_AND_RETURN(throwScope, result);
}
+JSC_DEFINE_CUSTOM_GETTER(TextDecoderPrototype__ignoreBOMGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
+{
+ auto& vm = lexicalGlobalObject->vm();
+ Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ JSTextDecoder* thisObject = jsCast<JSTextDecoder*>(JSValue::decode(thisValue));
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+ JSC::EncodedJSValue result = TextDecoderPrototype__getIgnoreBOM(thisObject->wrapped(), globalObject);
+ RETURN_IF_EXCEPTION(throwScope, {});
+ RELEASE_AND_RETURN(throwScope, result);
+}
+
void JSTextDecoderPrototype::finishCreation(JSC::VM& vm, JSC::JSGlobalObject* globalObject)
{
Base::finishCreation(vm);
@@ -26700,6 +27239,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTimeoutPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -26914,7 +27454,7 @@ void JSTimeoutPrototype::finishCreation(JSC::VM& vm, JSC::JSGlobalObject* global
{
Base::finishCreation(vm);
reifyStaticProperties(vm, JSTimeout::info(), JSTimeoutPrototypeTableValues, *this);
- this->putDirect(vm, vm.propertyNames->toPrimitiveSymbol, JSFunction::create(vm, globalObject, 1, String("toPrimitive"_s), TimeoutPrototype__toPrimitiveCallback, ImplementationVisibility::Public), PropertyAttribute::Function | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | 0);
+ this->putDirect(vm, vm.propertyNames->toPrimitiveSymbol, JSFunction::create(vm, globalObject, 1, String("toPrimitive"_s), TimeoutPrototype__toPrimitiveCallback, ImplementationVisibility::Public), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | 0);
JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
}
@@ -27042,6 +27582,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTranspilerPrototype, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
diff --git a/src/bun.js/bindings/ZigGeneratedClasses.h b/src/bun.js/bindings/ZigGeneratedClasses.h
index 142a96746..c1d7ca99e 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses.h
+++ b/src/bun.js/bindings/ZigGeneratedClasses.h
@@ -510,6 +510,7 @@ public:
template<typename Visitor> void visitAdditionalChildren(Visitor&);
DECLARE_VISIT_OUTPUT_CONSTRAINTS;
+ mutable JSC::WriteBarrier<JSC::Unknown> m_address;
mutable JSC::WriteBarrier<JSC::Unknown> m_hostname;
mutable JSC::WriteBarrier<JSC::Unknown> m_id;
};
@@ -567,6 +568,7 @@ public:
template<typename Visitor> void visitAdditionalChildren(Visitor&);
DECLARE_VISIT_OUTPUT_CONSTRAINTS;
+ mutable JSC::WriteBarrier<JSC::Unknown> m_address;
mutable JSC::WriteBarrier<JSC::Unknown> m_hostname;
mutable JSC::WriteBarrier<JSC::Unknown> m_id;
};
@@ -1004,6 +1006,62 @@ public:
void finishCreation(JSC::VM&);
};
+class JSExpectArrayContaining final : public JSC::JSDestructibleObject {
+public:
+ using Base = JSC::JSDestructibleObject;
+ static JSExpectArrayContaining* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, void* ctx);
+
+ DECLARE_EXPORT_INFO;
+ template<typename, JSC::SubspaceAccess mode> static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
+ {
+ if constexpr (mode == JSC::SubspaceAccess::Concurrently)
+ return nullptr;
+ return WebCore::subspaceForImpl<JSExpectArrayContaining, WebCore::UseCustomHeapCellType::No>(
+ vm,
+ [](auto& spaces) { return spaces.m_clientSubspaceForExpectArrayContaining.get(); },
+ [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForExpectArrayContaining = std::forward<decltype(space)>(space); },
+ [](auto& spaces) { return spaces.m_subspaceForExpectArrayContaining.get(); },
+ [](auto& spaces, auto&& space) { spaces.m_subspaceForExpectArrayContaining = std::forward<decltype(space)>(space); });
+ }
+
+ static void destroy(JSC::JSCell*);
+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(static_cast<JSC::JSType>(0b11101110), StructureFlags), info());
+ }
+
+ static JSObject* createPrototype(VM& vm, JSDOMGlobalObject* globalObject);
+ ;
+
+ ~JSExpectArrayContaining();
+
+ void* wrapped() const { return m_ctx; }
+
+ void detach()
+ {
+ m_ctx = nullptr;
+ }
+
+ static void analyzeHeap(JSCell*, JSC::HeapAnalyzer&);
+ static ptrdiff_t offsetOfWrapped() { return OBJECT_OFFSETOF(JSExpectArrayContaining, m_ctx); }
+
+ void* m_ctx { nullptr };
+
+ JSExpectArrayContaining(JSC::VM& vm, JSC::Structure* structure, void* sinkPtr)
+ : Base(vm, structure)
+ {
+ m_ctx = sinkPtr;
+ }
+
+ void finishCreation(JSC::VM&);
+
+ DECLARE_VISIT_CHILDREN;
+ template<typename Visitor> void visitAdditionalChildren(Visitor&);
+ DECLARE_VISIT_OUTPUT_CONSTRAINTS;
+
+ mutable JSC::WriteBarrier<JSC::Unknown> m_arrayValue;
+};
+
class JSExpectStringContaining final : public JSC::JSDestructibleObject {
public:
using Base = JSC::JSDestructibleObject;
@@ -1416,6 +1474,7 @@ public:
template<typename Visitor> void visitAdditionalChildren(Visitor&);
DECLARE_VISIT_OUTPUT_CONSTRAINTS;
+ mutable JSC::WriteBarrier<JSC::Unknown> m_address;
mutable JSC::WriteBarrier<JSC::Unknown> m_hostname;
mutable JSC::WriteBarrier<JSC::Unknown> m_id;
};
@@ -1473,6 +1532,7 @@ public:
template<typename Visitor> void visitAdditionalChildren(Visitor&);
DECLARE_VISIT_OUTPUT_CONSTRAINTS;
+ mutable JSC::WriteBarrier<JSC::Unknown> m_address;
mutable JSC::WriteBarrier<JSC::Unknown> m_hostname;
mutable JSC::WriteBarrier<JSC::Unknown> m_id;
};
diff --git a/src/bun.js/bindings/ZigGeneratedCode.cpp b/src/bun.js/bindings/ZigGeneratedCode.cpp
index 057eaf28e..777c6455e 100644
--- a/src/bun.js/bindings/ZigGeneratedCode.cpp
+++ b/src/bun.js/bindings/ZigGeneratedCode.cpp
@@ -51,8 +51,7 @@ extern "C" void FFI__ptr__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSV
thisObject->putDirect(
globalObject->vm(),
Identifier::fromString(globalObject->vm(), "ptr"_s),
- function,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0);
+ function);
}
extern "C" JSC_DECLARE_HOST_FUNCTION(Reader__u8__slowpathWrapper);
@@ -92,8 +91,7 @@ extern "C" void Reader__u8__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJ
thisObject->putDirect(
globalObject->vm(),
Identifier::fromString(globalObject->vm(), "u8"_s),
- function,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0);
+ function);
}
extern "C" JSC_DECLARE_HOST_FUNCTION(Reader__u16__slowpathWrapper);
@@ -133,8 +131,7 @@ extern "C" void Reader__u16__put(JSC::JSGlobalObject* globalObject, JSC::Encoded
thisObject->putDirect(
globalObject->vm(),
Identifier::fromString(globalObject->vm(), "u16"_s),
- function,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0);
+ function);
}
extern "C" JSC_DECLARE_HOST_FUNCTION(Reader__u32__slowpathWrapper);
@@ -174,8 +171,7 @@ extern "C" void Reader__u32__put(JSC::JSGlobalObject* globalObject, JSC::Encoded
thisObject->putDirect(
globalObject->vm(),
Identifier::fromString(globalObject->vm(), "u32"_s),
- function,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0);
+ function);
}
extern "C" JSC_DECLARE_HOST_FUNCTION(Reader__ptr__slowpathWrapper);
@@ -215,8 +211,7 @@ extern "C" void Reader__ptr__put(JSC::JSGlobalObject* globalObject, JSC::Encoded
thisObject->putDirect(
globalObject->vm(),
Identifier::fromString(globalObject->vm(), "ptr"_s),
- function,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0);
+ function);
}
extern "C" JSC_DECLARE_HOST_FUNCTION(Reader__i8__slowpathWrapper);
@@ -256,8 +251,7 @@ extern "C" void Reader__i8__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJ
thisObject->putDirect(
globalObject->vm(),
Identifier::fromString(globalObject->vm(), "i8"_s),
- function,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0);
+ function);
}
extern "C" JSC_DECLARE_HOST_FUNCTION(Reader__i16__slowpathWrapper);
@@ -297,8 +291,7 @@ extern "C" void Reader__i16__put(JSC::JSGlobalObject* globalObject, JSC::Encoded
thisObject->putDirect(
globalObject->vm(),
Identifier::fromString(globalObject->vm(), "i16"_s),
- function,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0);
+ function);
}
extern "C" JSC_DECLARE_HOST_FUNCTION(Reader__i32__slowpathWrapper);
@@ -338,8 +331,7 @@ extern "C" void Reader__i32__put(JSC::JSGlobalObject* globalObject, JSC::Encoded
thisObject->putDirect(
globalObject->vm(),
Identifier::fromString(globalObject->vm(), "i32"_s),
- function,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0);
+ function);
}
extern "C" JSC_DECLARE_HOST_FUNCTION(Reader__i64__slowpathWrapper);
@@ -379,8 +371,7 @@ extern "C" void Reader__i64__put(JSC::JSGlobalObject* globalObject, JSC::Encoded
thisObject->putDirect(
globalObject->vm(),
Identifier::fromString(globalObject->vm(), "i64"_s),
- function,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0);
+ function);
}
extern "C" JSC_DECLARE_HOST_FUNCTION(Reader__u64__slowpathWrapper);
@@ -420,8 +411,7 @@ extern "C" void Reader__u64__put(JSC::JSGlobalObject* globalObject, JSC::Encoded
thisObject->putDirect(
globalObject->vm(),
Identifier::fromString(globalObject->vm(), "u64"_s),
- function,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0);
+ function);
}
extern "C" JSC_DECLARE_HOST_FUNCTION(Reader__intptr__slowpathWrapper);
@@ -461,8 +451,7 @@ extern "C" void Reader__intptr__put(JSC::JSGlobalObject* globalObject, JSC::Enco
thisObject->putDirect(
globalObject->vm(),
Identifier::fromString(globalObject->vm(), "intptr"_s),
- function,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0);
+ function);
}
extern "C" JSC_DECLARE_HOST_FUNCTION(Reader__f32__slowpathWrapper);
@@ -502,8 +491,7 @@ extern "C" void Reader__f32__put(JSC::JSGlobalObject* globalObject, JSC::Encoded
thisObject->putDirect(
globalObject->vm(),
Identifier::fromString(globalObject->vm(), "f32"_s),
- function,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0);
+ function);
}
extern "C" JSC_DECLARE_HOST_FUNCTION(Reader__f64__slowpathWrapper);
@@ -543,8 +531,7 @@ extern "C" void Reader__f64__put(JSC::JSGlobalObject* globalObject, JSC::Encoded
thisObject->putDirect(
globalObject->vm(),
Identifier::fromString(globalObject->vm(), "f64"_s),
- function,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0);
+ function);
}
/* -- END DOMCall DEFINITIONS-- */
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp
index cdc4adb1b..93f9a0fa2 100644
--- a/src/bun.js/bindings/ZigGlobalObject.cpp
+++ b/src/bun.js/bindings/ZigGlobalObject.cpp
@@ -23,6 +23,7 @@
#include "JavaScriptCore/InitializeThreading.h"
#include "JavaScriptCore/IteratorOperations.h"
#include "JavaScriptCore/JSArray.h"
+#include "JavaScriptCore/JSGlobalProxyInlines.h"
#include "JavaScriptCore/JSCallbackConstructor.h"
#include "JavaScriptCore/JSCallbackObject.h"
@@ -38,6 +39,7 @@
#include "JavaScriptCore/JSMap.h"
#include "JavaScriptCore/JSModuleLoader.h"
#include "JavaScriptCore/JSModuleNamespaceObject.h"
+#include "JavaScriptCore/JSModuleNamespaceObjectInlines.h"
#include "JavaScriptCore/JSModuleRecord.h"
#include "JavaScriptCore/JSNativeStdFunction.h"
#include "JavaScriptCore/JSObject.h"
@@ -103,6 +105,7 @@
#include "JavaScriptCore/LazyClassStructure.h"
#include "JavaScriptCore/LazyClassStructureInlines.h"
#include "JavaScriptCore/FunctionPrototype.h"
+#include "JavaScriptCore/GetterSetter.h"
#include "napi.h"
#include "JSSQLStatement.h"
#include "ModuleLoader.h"
@@ -125,6 +128,8 @@
#include "JSDOMFile.h"
+#include "ProcessBindingConstants.h"
+
#if ENABLE(REMOTE_INSPECTOR)
#include "JavaScriptCore/RemoteInspectorServer.h"
#endif
@@ -186,9 +191,6 @@ namespace JSCastingHelpers = JSC::JSCastingHelpers;
#include "DOMJITHelpers.h"
#include <JavaScriptCore/DFGAbstractHeap.h>
-#include "webcrypto/JSCryptoKey.h"
-#include "webcrypto/JSSubtleCrypto.h"
-
#include "JSDOMFormData.h"
#include "JSDOMBinding.h"
#include "JSDOMConstructor.h"
@@ -201,6 +203,7 @@ namespace JSCastingHelpers = JSC::JSCastingHelpers;
#include "JSDOMConvertStrings.h"
#include "JSDOMConvertUnion.h"
#include "AddEventListenerOptions.h"
+#include "JSSocketAddress.h"
#include "ErrorStackTrace.h"
#include "CallSite.h"
@@ -211,6 +214,9 @@ namespace JSCastingHelpers = JSC::JSCastingHelpers;
#include <wtf/text/Base64.h>
#include "simdutf.h"
#include "libusockets.h"
+#include "KeyObject.h"
+#include "webcrypto/JSCryptoKey.h"
+#include "webcrypto/JSSubtleCrypto.h"
constexpr size_t DEFAULT_ERROR_STACK_TRACE_LIMIT = 10;
@@ -226,6 +232,10 @@ static bool has_loaded_jsc = false;
Structure* createMemoryFootprintStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject);
+namespace Bun {
+extern JSC::EncodedJSValue Process_functionInternalGetWindowSize(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame);
+}
+
namespace WebCore {
class Base64Utilities {
public:
@@ -270,6 +280,7 @@ extern "C" void JSCInitialize(const char* envp[], size_t envc, void (*onCrash)(c
JSC::Options::useShadowRealm() = true;
JSC::Options::useResizableArrayBuffer() = true;
JSC::Options::usePromiseWithResolversMethod() = true;
+ JSC::Options::useV8DateParser() = true;
#ifdef BUN_DEBUG
JSC::Options::showPrivateScriptsInStackTraces() = true;
@@ -305,29 +316,16 @@ static bool skipNextComputeErrorInfo = false;
// error.stack calls this function
static String computeErrorInfoWithoutPrepareStackTrace(JSC::VM& vm, Vector<StackFrame>& stackTrace, unsigned& line, unsigned& column, String& sourceURL, JSObject* errorInstance)
{
- if (!errorInstance) {
- return String();
- }
-
- if (skipNextComputeErrorInfo) {
- return String();
- }
-
- Zig::GlobalObject* globalObject = jsDynamicCast<Zig::GlobalObject*>(errorInstance->globalObject());
- if (!globalObject) {
- // Happens in node:vm
- globalObject = jsDynamicCast<Zig::GlobalObject*>(Bun__getDefaultGlobal());
- }
+ auto* lexicalGlobalObject = errorInstance->globalObject();
+ Zig::GlobalObject* globalObject = jsDynamicCast<Zig::GlobalObject*>(lexicalGlobalObject);
WTF::String name = "Error"_s;
WTF::String message;
- if (errorInstance) {
- // Note that we are not allowed to allocate memory in here. It's called inside a finalizer.
- if (auto* instance = jsDynamicCast<ErrorInstance*>(errorInstance)) {
- name = instance->sanitizedNameString(globalObject);
- message = instance->sanitizedMessageString(globalObject);
- }
+ // Note that we are not allowed to allocate memory in here. It's called inside a finalizer.
+ if (auto* instance = jsDynamicCast<ErrorInstance*>(errorInstance)) {
+ name = instance->sanitizedNameString(lexicalGlobalObject);
+ message = instance->sanitizedMessageString(lexicalGlobalObject);
}
WTF::StringBuilder sb;
@@ -381,20 +379,23 @@ static String computeErrorInfoWithoutPrepareStackTrace(JSC::VM& vm, Vector<Stack
unsigned int thisColumn = 0;
frame.computeLineAndColumn(thisLine, thisColumn);
memset(remappedFrames + i, 0, sizeof(ZigStackFrame));
-
remappedFrames[i].position.line = thisLine;
remappedFrames[i].position.column_start = thisColumn;
+
String sourceURLForFrame = frame.sourceURL(vm);
- if (!sourceURLForFrame.isEmpty()) {
- remappedFrames[i].source_url = Bun::toString(sourceURLForFrame);
- } else {
- // https://github.com/oven-sh/bun/issues/3595
- remappedFrames[i].source_url = BunStringEmpty;
- }
+ // If it's not a Zig::GlobalObject, don't bother source-mapping it.
+ if (globalObject) {
+ if (!sourceURLForFrame.isEmpty()) {
+ remappedFrames[i].source_url = Bun::toString(sourceURLForFrame);
+ } else {
+ // https://github.com/oven-sh/bun/issues/3595
+ remappedFrames[i].source_url = BunStringEmpty;
+ }
- // This ensures the lifetime of the sourceURL is accounted for correctly
- Bun__remapStackFramePositions(globalObject, remappedFrames + i, 1);
+ // This ensures the lifetime of the sourceURL is accounted for correctly
+ Bun__remapStackFramePositions(globalObject, remappedFrames + i, 1);
+ }
if (!hasSet) {
hasSet = true;
@@ -402,11 +403,9 @@ static String computeErrorInfoWithoutPrepareStackTrace(JSC::VM& vm, Vector<Stack
column = thisColumn;
sourceURL = frame.sourceURL(vm);
- if (errorInstance) {
- if (remappedFrames[i].remapped) {
- errorInstance->putDirect(vm, Identifier::fromString(vm, "originalLine"_s), jsNumber(thisLine), 0);
- errorInstance->putDirect(vm, Identifier::fromString(vm, "originalColumn"_s), jsNumber(thisColumn), 0);
- }
+ if (remappedFrames[i].remapped) {
+ errorInstance->putDirect(vm, Identifier::fromString(vm, "originalLine"_s), jsNumber(thisLine), 0);
+ errorInstance->putDirect(vm, Identifier::fromString(vm, "originalColumn"_s), jsNumber(thisColumn), 0);
}
}
@@ -428,8 +427,95 @@ static String computeErrorInfoWithoutPrepareStackTrace(JSC::VM& vm, Vector<Stack
return sb.toString();
}
+static String computeErrorInfoWithPrepareStackTrace(JSC::VM& vm, Zig::GlobalObject* globalObject, JSC::JSGlobalObject* lexicalGlobalObject, Vector<StackFrame>& stackFrames, unsigned& line, unsigned& column, String& sourceURL, JSObject* errorObject, JSObject* prepareStackTrace)
+{
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ size_t stackTraceLimit = globalObject->stackTraceLimit().value();
+ if (stackTraceLimit == 0) {
+ stackTraceLimit = DEFAULT_ERROR_STACK_TRACE_LIMIT;
+ }
+
+ JSCStackTrace stackTrace = JSCStackTrace::fromExisting(vm, stackFrames);
+
+ // Note: we cannot use tryCreateUninitializedRestricted here because we cannot allocate memory inside initializeIndex()
+ JSC::JSArray* callSites = JSC::JSArray::create(vm,
+ globalObject->arrayStructureForIndexingTypeDuringAllocation(JSC::ArrayWithContiguous),
+ stackTrace.size());
+
+ // Create the call sites (one per frame)
+ GlobalObject::createCallSitesFromFrames(globalObject, lexicalGlobalObject, stackTrace, callSites);
+
+ // We need to sourcemap it if it's a GlobalObject.
+ if (globalObject == lexicalGlobalObject) {
+ size_t framesCount = stackTrace.size();
+ ZigStackFrame remappedFrames[framesCount];
+ for (int i = 0; i < framesCount; i++) {
+ memset(remappedFrames + i, 0, sizeof(ZigStackFrame));
+ remappedFrames[i].source_url = Bun::toString(lexicalGlobalObject, stackTrace.at(i).sourceURL());
+ if (JSCStackFrame::SourcePositions* sourcePositions = stackTrace.at(i).getSourcePositions()) {
+ remappedFrames[i].position.line = sourcePositions->line.zeroBasedInt();
+ remappedFrames[i].position.column_start = sourcePositions->startColumn.zeroBasedInt() + 1;
+ } else {
+ remappedFrames[i].position.line = -1;
+ remappedFrames[i].position.column_start = -1;
+ }
+ }
+
+ Bun__remapStackFramePositions(globalObject, remappedFrames, framesCount);
+
+ for (size_t i = 0; i < framesCount; i++) {
+ JSC::JSValue callSiteValue = callSites->getIndex(lexicalGlobalObject, i);
+ CallSite* callSite = JSC::jsDynamicCast<CallSite*>(callSiteValue);
+ if (remappedFrames[i].remapped) {
+ int32_t remappedColumnStart = remappedFrames[i].position.column_start;
+ JSC::JSValue columnNumber = JSC::jsNumber(remappedColumnStart);
+ callSite->setColumnNumber(columnNumber);
+
+ int32_t remappedLine = remappedFrames[i].position.line;
+ JSC::JSValue lineNumber = JSC::jsNumber(remappedLine);
+ callSite->setLineNumber(lineNumber);
+ }
+ }
+ }
+
+ globalObject->formatStackTrace(vm, lexicalGlobalObject, errorObject, callSites, prepareStackTrace);
+
+ RETURN_IF_EXCEPTION(scope, String());
+ return String();
+}
+
static String computeErrorInfo(JSC::VM& vm, Vector<StackFrame>& stackTrace, unsigned& line, unsigned& column, String& sourceURL, JSObject* errorInstance)
{
+ if (skipNextComputeErrorInfo) {
+ return String();
+ }
+
+ if (!errorInstance) {
+ return String();
+ }
+
+ auto* lexicalGlobalObject = errorInstance->globalObject();
+ Zig::GlobalObject* globalObject = jsDynamicCast<Zig::GlobalObject*>(lexicalGlobalObject);
+
+ // Error.prepareStackTrace - https://v8.dev/docs/stack-trace-api#customizing-stack-traces
+ if (!globalObject) {
+ // node:vm will use a different JSGlobalObject
+ globalObject = Bun__getDefaultGlobal();
+
+ auto* errorConstructor = lexicalGlobalObject->m_errorStructure.constructor(lexicalGlobalObject);
+ if (JSValue prepareStackTrace = errorConstructor->getIfPropertyExists(lexicalGlobalObject, Identifier::fromString(vm, "prepareStackTrace"_s))) {
+ if (prepareStackTrace.isCell() && prepareStackTrace.isObject() && prepareStackTrace.isCallable()) {
+ return computeErrorInfoWithPrepareStackTrace(vm, globalObject, lexicalGlobalObject, stackTrace, line, column, sourceURL, errorInstance, prepareStackTrace.getObject());
+ }
+ }
+ } else {
+ if (JSValue prepareStackTrace = globalObject->m_errorConstructorPrepareStackTraceValue.get()) {
+ if (prepareStackTrace.isCell() && prepareStackTrace.isObject() && prepareStackTrace.isCallable()) {
+ return computeErrorInfoWithPrepareStackTrace(vm, globalObject, lexicalGlobalObject, stackTrace, line, column, sourceURL, errorInstance, prepareStackTrace.getObject());
+ }
+ }
+ }
+
return computeErrorInfoWithoutPrepareStackTrace(vm, stackTrace, line, column, sourceURL, errorInstance);
}
@@ -627,69 +713,17 @@ extern "C" bool Zig__GlobalObject__resetModuleRegistryMap(JSC__JSGlobalObject* g
return true;
}
-#define BUN_LAZY_GETTER_FN_NAME(GetterName) BunLazyGetter##GetterName##_getter
-
-#define DEFINE_BUN_LAZY_GETTER(GetterName, __propertyName) \
- JSC_DEFINE_CUSTOM_GETTER(GetterName, \
- (JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue, \
- JSC::PropertyName)) \
- { \
- Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject); \
- return JSC::JSValue::encode(thisObject->__propertyName()); \
- }
-
-#define GENERATED_CONSTRUCTOR_GETTER(ConstructorName) \
- JSC_DECLARE_CUSTOM_GETTER(ConstructorName##_getter); \
- JSC_DEFINE_CUSTOM_GETTER(ConstructorName##_getter, \
- (JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue, \
- JSC::PropertyName)) \
- { \
- Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject); \
- if (JSValue override = thisObject->m_##ConstructorName##SetterValue.get()) { \
- return JSC::JSValue::encode(override); \
- } \
- return JSC::JSValue::encode( \
- thisObject->ConstructorName##Constructor()); \
- }
-
-#define GENERATED_CONSTRUCTOR_SETTER(ConstructorName) \
- JSC_DECLARE_CUSTOM_SETTER(ConstructorName##_setter); \
- JSC_DEFINE_CUSTOM_SETTER(ConstructorName##_setter, \
- (JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue, \
- EncodedJSValue value, JSC::PropertyName)) \
- { \
- Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject); \
- thisObject->m_##ConstructorName##SetterValue.set(thisObject->vm(), thisObject, JSValue::decode(value)); \
- return true; \
- }
-
-#define WEBCORE_GENERATED_CONSTRUCTOR_GETTER(ConstructorName) \
- JSC_DECLARE_CUSTOM_GETTER(ConstructorName##_getter); \
- JSC_DEFINE_CUSTOM_GETTER(ConstructorName##_getter, \
- (JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue, \
- JSC::PropertyName)) \
- { \
- Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject); \
- if (JSValue override = thisObject->m_##ConstructorName##SetterValue.get()) { \
- return JSC::JSValue::encode(override); \
- } \
- return JSC::JSValue::encode( \
- WebCore::ConstructorName::getConstructor(JSC::getVM(lexicalGlobalObject), thisObject)); \
- }
-
-#define WEBCORE_GENERATED_CONSTRUCTOR_SETTER(ConstructorName) \
- JSC_DECLARE_CUSTOM_SETTER(ConstructorName##_setter); \
- JSC_DEFINE_CUSTOM_SETTER(ConstructorName##_setter, \
- (JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue, \
- EncodedJSValue value, JSC::PropertyName)) \
- { \
- Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject); \
- thisObject->m_##ConstructorName##SetterValue.set(thisObject->vm(), thisObject, JSValue::decode(value)); \
- return true; \
- }
-
-#define PUT_WEBCORE_GENERATED_CONSTRUCTOR(name, ConstructorName) \
- putDirectCustomAccessor(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, name)), JSC::CustomGetterSetter::create(vm, ConstructorName##_getter, ConstructorName##_setter), 0)
+#define WEBCORE_GENERATED_CONSTRUCTOR_GETTER(ConstructorName) \
+ JSValue ConstructorName##ConstructorCallback(VM& vm, JSObject* lexicalGlobalObject) \
+ { \
+ return WebCore::JS##ConstructorName::getConstructor(vm, JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject)); \
+ } \
+ JSC_DEFINE_CUSTOM_GETTER(ConstructorName##_getter, \
+ (JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue, \
+ JSC::PropertyName)) \
+ { \
+ return JSC::JSValue::encode(WebCore::JS##ConstructorName::getConstructor(lexicalGlobalObject->vm(), JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject))); \
+ }
String GlobalObject::defaultAgentClusterID()
{
@@ -708,9 +742,6 @@ namespace Zig {
using namespace WebCore;
-const JSC::ClassInfo GlobalObject::s_info = { "GlobalObject"_s, &Base::s_info, nullptr, nullptr,
- CREATE_METHOD_TABLE(GlobalObject) };
-
static JSGlobalObject* deriveShadowRealmGlobalObject(JSGlobalObject* globalObject)
{
auto& vm = globalObject->vm();
@@ -734,9 +765,9 @@ extern "C" JSC__JSValue JSC__JSValue__makeWithNameAndPrototype(JSC__JSGlobalObje
JSC::JSObject* wrapped = JSC::JSValue::decode(reinterpret_cast<JSC__JSValue>(wrappedRef)).getObject();
object->setPrototypeDirect(vm, wrapped);
JSString* nameString = JSC::jsNontrivialString(vm, Zig::toString(*visibleInterfaceName));
- object->putDirect(vm, vm.propertyNames->name, nameString, JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
+ object->putDirect(vm, vm.propertyNames->name, nameString, PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);
object->putDirect(vm, vm.propertyNames->toStringTagSymbol,
- nameString, JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly);
+ nameString, PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
return JSC::JSValue::encode(JSC::JSValue(object));
}
@@ -801,7 +832,7 @@ GlobalObject::~GlobalObject()
finalizer(toNapi(this), napiInstanceData, napiInstanceDataFinalizerHint);
}
- delete crypto;
+ delete m_subtleCrypto;
scriptExecutionContext()->removeFromContextsMap();
}
@@ -851,9 +882,31 @@ void GlobalObject::setConsole(void* console)
this->setConsoleClient(new Zig::ConsoleClient(console));
}
+JSC_DEFINE_CUSTOM_GETTER(errorConstructorPrepareStackTraceGetter,
+ (JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue,
+ JSC::PropertyName))
+{
+ Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject);
+ JSValue value = jsUndefined();
+ if (thisObject->m_errorConstructorPrepareStackTraceValue) {
+ value = thisObject->m_errorConstructorPrepareStackTraceValue.get();
+ }
+ return JSValue::encode(value);
+}
+
+JSC_DEFINE_CUSTOM_SETTER(errorConstructorPrepareStackTraceSetter,
+ (JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue,
+ JSC::EncodedJSValue encodedValue, JSC::PropertyName property))
+{
+ auto& vm = JSC::getVM(lexicalGlobalObject);
+ Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject);
+ thisObject->m_errorConstructorPrepareStackTraceValue.set(vm, thisObject, JSValue::decode(encodedValue));
+ return true;
+}
+
#pragma mark - Globals
-JSC_DEFINE_CUSTOM_GETTER(globalGetterOnMessage,
+JSC_DEFINE_CUSTOM_GETTER(globalOnMessage,
(JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue,
JSC::PropertyName))
{
@@ -861,7 +914,7 @@ JSC_DEFINE_CUSTOM_GETTER(globalGetterOnMessage,
return JSValue::encode(eventHandlerAttribute(thisObject->eventTarget(), eventNames().messageEvent, thisObject->world()));
}
-JSC_DEFINE_CUSTOM_GETTER(globalGetterOnError,
+JSC_DEFINE_CUSTOM_GETTER(globalOnError,
(JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue,
JSC::PropertyName))
{
@@ -869,7 +922,7 @@ JSC_DEFINE_CUSTOM_GETTER(globalGetterOnError,
return JSValue::encode(eventHandlerAttribute(thisObject->eventTarget(), eventNames().errorEvent, thisObject->world()));
}
-JSC_DEFINE_CUSTOM_SETTER(globalSetterOnMessage,
+JSC_DEFINE_CUSTOM_SETTER(setGlobalOnMessage,
(JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue,
JSC::EncodedJSValue encodedValue, JSC::PropertyName property))
{
@@ -882,7 +935,7 @@ JSC_DEFINE_CUSTOM_SETTER(globalSetterOnMessage,
return true;
}
-JSC_DEFINE_CUSTOM_SETTER(globalSetterOnError,
+JSC_DEFINE_CUSTOM_SETTER(setGlobalOnError,
(JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue,
JSC::EncodedJSValue encodedValue, JSC::PropertyName property))
{
@@ -900,8 +953,6 @@ WebCore::EventTarget& GlobalObject::eventTarget()
return globalEventScope;
}
-JSC_DECLARE_CUSTOM_GETTER(functionLazyLoadStreamPrototypeMap_getter);
-
JSC_DEFINE_CUSTOM_GETTER(functionLazyLoadStreamPrototypeMap_getter,
(JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue,
JSC::PropertyName))
@@ -911,165 +962,61 @@ JSC_DEFINE_CUSTOM_GETTER(functionLazyLoadStreamPrototypeMap_getter,
thisObject->readableStreamNativeMap());
}
-JSC_DECLARE_CUSTOM_GETTER(JSDOMURL_getter);
-
-JSC_DEFINE_CUSTOM_GETTER(JSDOMURL_getter,
- (JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue,
- JSC::PropertyName))
-{
- Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject);
- return JSC::JSValue::encode(
- WebCore::JSDOMURL::getConstructor(JSC::getVM(lexicalGlobalObject), thisObject));
-}
-
-JSC_DEFINE_CUSTOM_GETTER(JSBuffer_privateGetter,
- (JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue,
- JSC::PropertyName))
-{
- Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject);
- return JSC::JSValue::encode(
- thisObject->JSBufferConstructor());
-}
-
-GENERATED_CONSTRUCTOR_GETTER(JSBuffer);
-GENERATED_CONSTRUCTOR_SETTER(JSBuffer);
-
-GENERATED_CONSTRUCTOR_GETTER(JSTextDecoder);
-GENERATED_CONSTRUCTOR_SETTER(JSTextDecoder);
-
-GENERATED_CONSTRUCTOR_GETTER(JSResponse);
-GENERATED_CONSTRUCTOR_SETTER(JSResponse);
-
-GENERATED_CONSTRUCTOR_GETTER(JSRequest);
-GENERATED_CONSTRUCTOR_SETTER(JSRequest);
-
-GENERATED_CONSTRUCTOR_GETTER(JSBlob);
-GENERATED_CONSTRUCTOR_SETTER(JSBlob);
-
-GENERATED_CONSTRUCTOR_GETTER(JSHTMLRewriter);
-GENERATED_CONSTRUCTOR_SETTER(JSHTMLRewriter);
-
-GENERATED_CONSTRUCTOR_GETTER(JSCrypto);
-GENERATED_CONSTRUCTOR_SETTER(JSCrypto);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSMessageEvent);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSMessageEvent);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSWebSocket);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSWebSocket);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSFetchHeaders);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSFetchHeaders);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSTextEncoder);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSTextEncoder);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSURLSearchParams);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSURLSearchParams);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSDOMFormData);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSDOMFormData);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSWorker);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSWorker);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSMessageChannel);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSMessageChannel);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSMessagePort);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSMessagePort);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSBroadcastChannel);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSBroadcastChannel);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSEvent);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSEvent);
-
-JSC_DECLARE_CUSTOM_GETTER(JSEvent_getter);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSDOMException);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSDOMException);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSEventTarget);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSEventTarget);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSCustomEvent);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSCustomEvent);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSErrorEvent);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSErrorEvent);
-
-WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSCloseEvent);
-WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSCloseEvent);
-
-JSC_DECLARE_CUSTOM_GETTER(JSDOMAbortController_getter);
-
-JSC_DEFINE_CUSTOM_GETTER(JSDOMAbortController_getter,
+JSC_DEFINE_CUSTOM_GETTER(JSBuffer_getter,
(JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue,
JSC::PropertyName))
{
- Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject);
- return JSC::JSValue::encode(
- WebCore::JSAbortController::getConstructor(JSC::getVM(lexicalGlobalObject), thisObject));
-}
-
-JSC_DECLARE_CUSTOM_GETTER(JSDOMAbortSignal_getter);
-
-JSC_DEFINE_CUSTOM_GETTER(JSDOMAbortSignal_getter,
- (JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue,
- JSC::PropertyName))
-{
- Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject);
- return JSC::JSValue::encode(
- WebCore::JSAbortSignal::getConstructor(JSC::getVM(lexicalGlobalObject), thisObject));
-}
-
-static JSC_DECLARE_CUSTOM_SETTER(property_lazyProcessSetter);
-static JSC_DECLARE_CUSTOM_GETTER(property_lazyProcessGetter);
-
-JSC_DEFINE_CUSTOM_SETTER(property_lazyProcessSetter,
- (JSC::JSGlobalObject * globalObject, JSC::EncodedJSValue thisValue,
- JSC::EncodedJSValue value, JSC::PropertyName))
-{
- return false;
-}
-
-JSC_DEFINE_CUSTOM_GETTER(property_lazyProcessGetter,
- (JSC::JSGlobalObject * _globalObject, JSC::EncodedJSValue thisValue,
- JSC::PropertyName))
-{
- Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(_globalObject);
-
- JSC::VM& vm = globalObject->vm();
- auto clientData = WebCore::clientData(vm);
- return JSC::JSValue::encode(
- globalObject->processObject());
-}
-
-JSC_DEFINE_CUSTOM_GETTER(property_lazyCryptoGetter,
- (JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue,
- JSC::PropertyName property))
+ return JSC::JSValue::encode(JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject)->JSBufferConstructor());
+}
+
+// This macro defines the getter needed for ZigGlobalObject.lut.h
+// "<ClassName>ConstructorCallback" is a PropertyCallback
+// it also defines "<ClassName>_getter" which is the getter for a JSC::CustomGetterSetter
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(AbortController);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(AbortSignal);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(BroadcastChannel);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(ByteLengthQueuingStrategy)
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(CloseEvent);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(CountQueuingStrategy)
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(CryptoKey);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(CustomEvent);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(DOMException);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(DOMFormData);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(DOMURL);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(ErrorEvent);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(Event);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(EventTarget);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(FetchHeaders);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(MessageChannel);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(MessageEvent);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(MessagePort);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(ReadableByteStreamController)
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(ReadableStream)
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(ReadableStreamBYOBReader)
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(ReadableStreamBYOBRequest)
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(ReadableStreamDefaultController)
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(ReadableStreamDefaultReader)
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(SubtleCrypto);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(TextEncoder);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(TransformStream)
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(TransformStreamDefaultController)
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(URLSearchParams);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(WebSocket);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(Worker);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(WritableStream);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(WritableStreamDefaultController);
+WEBCORE_GENERATED_CONSTRUCTOR_GETTER(WritableStreamDefaultWriter);
+
+JSC_DEFINE_HOST_FUNCTION(functionGetSelf,
+ (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
{
- Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(JSValue::decode(thisValue));
- JSValue cryptoObject = thisObject->cryptoObject();
- thisObject->putDirect(thisObject->vm(), property, cryptoObject, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
- return JSValue::encode(cryptoObject);
+ return JSC::JSValue::encode(callFrame->thisValue());
}
-JSC_DEFINE_CUSTOM_SETTER(lazyProcessEnvSetter,
- (JSC::JSGlobalObject * globalObject, JSC::EncodedJSValue thisValue,
- JSC::EncodedJSValue value, JSC::PropertyName))
-{
- return false;
-}
-
-JSC_DEFINE_CUSTOM_GETTER(lazyProcessEnvGetter,
- (JSC::JSGlobalObject * _globalObject, JSC::EncodedJSValue thisValue,
- JSC::PropertyName))
+JSC_DEFINE_HOST_FUNCTION(functionSetSelf,
+ (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
{
- Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(_globalObject);
- return JSC::JSValue::encode(
- globalObject->processEnvObject());
+ return JSC::JSValue::encode(jsUndefined());
}
JSC_DEFINE_HOST_FUNCTION(functionQueueMicrotask,
@@ -1385,7 +1332,7 @@ JSC_DEFINE_HOST_FUNCTION(functionBTOA,
static_cast<uint8_t>(WebCore::BufferEncodingType::base64)));
}
-static JSC_DEFINE_HOST_FUNCTION(functionATOB,
+JSC_DEFINE_HOST_FUNCTION(functionATOB,
(JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
{
JSC::VM& vm = globalObject->vm();
@@ -1408,7 +1355,7 @@ static JSC_DEFINE_HOST_FUNCTION(functionATOB,
RELEASE_AND_RETURN(throwScope, JSValue::encode(jsString(vm, result.releaseReturnValue())));
}
-static JSC_DEFINE_HOST_FUNCTION(functionReportError,
+JSC_DEFINE_HOST_FUNCTION(functionReportError,
(JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
{
switch (callFrame->argumentCount()) {
@@ -1538,6 +1485,89 @@ JSC_DEFINE_HOST_FUNCTION(jsTTYSetMode, (JSC::JSGlobalObject * globalObject, Call
return JSValue::encode(jsNumber(err));
}
+JSC_DEFINE_HOST_FUNCTION(jsHTTPGetHeader, (JSGlobalObject * globalObject, CallFrame* callFrame))
+{
+ auto& vm = globalObject->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ JSValue headersValue = callFrame->argument(0);
+
+ if (auto* headers = jsDynamicCast<WebCore::JSFetchHeaders*>(headersValue)) {
+ JSValue nameValue = callFrame->argument(1);
+ if (nameValue.isString()) {
+ FetchHeaders* impl = &headers->wrapped();
+ String name = nameValue.toWTFString(globalObject);
+ if (WTF::equalIgnoringASCIICase(name, "set-cookie"_s)) {
+ return fetchHeadersGetSetCookie(globalObject, vm, impl);
+ }
+
+ WebCore::ExceptionOr<String> res = impl->get(name);
+ if (res.hasException()) {
+ WebCore::propagateException(globalObject, scope, res.releaseException());
+ return JSValue::encode(jsUndefined());
+ }
+
+ String value = res.returnValue();
+ if (value.isEmpty()) {
+ return JSValue::encode(jsUndefined());
+ }
+
+ return JSC::JSValue::encode(jsString(vm, value));
+ }
+ }
+
+ return JSValue::encode(jsUndefined());
+}
+
+JSC_DEFINE_HOST_FUNCTION(jsHTTPSetHeader, (JSGlobalObject * globalObject, CallFrame* callFrame))
+{
+ auto& vm = globalObject->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ JSValue headersValue = callFrame->argument(0);
+
+ if (auto* headers = jsDynamicCast<WebCore::JSFetchHeaders*>(headersValue)) {
+ JSValue nameValue = callFrame->argument(1);
+ if (nameValue.isString()) {
+ String name = nameValue.toWTFString(globalObject);
+ FetchHeaders* impl = &headers->wrapped();
+
+ JSValue valueValue = callFrame->argument(2);
+ if (valueValue.isUndefined())
+ return JSValue::encode(jsUndefined());
+
+ if (isArray(globalObject, valueValue)) {
+ auto* array = jsCast<JSArray*>(valueValue);
+ unsigned length = array->length();
+ if (length > 0) {
+ JSValue item = array->getIndex(globalObject, 0);
+ if (UNLIKELY(scope.exception()))
+ return JSValue::encode(jsUndefined());
+ impl->set(name, item.getString(globalObject));
+ RETURN_IF_EXCEPTION(scope, JSValue::encode(jsUndefined()));
+ }
+ for (unsigned i = 1; i < length; ++i) {
+ JSValue value = array->getIndex(globalObject, i);
+ if (UNLIKELY(scope.exception()))
+ return JSValue::encode(jsUndefined());
+ if (!value.isString())
+ continue;
+ impl->append(name, value.getString(globalObject));
+ RETURN_IF_EXCEPTION(scope, JSValue::encode(jsUndefined()));
+ }
+ RELEASE_AND_RETURN(scope, JSValue::encode(jsUndefined()));
+ return JSValue::encode(jsUndefined());
+ }
+
+ impl->set(name, valueValue.getString(globalObject));
+ RETURN_IF_EXCEPTION(scope, JSValue::encode(jsUndefined()));
+ return JSValue::encode(jsUndefined());
+ }
+ }
+
+ return JSValue::encode(jsUndefined());
+}
+
JSC_DEFINE_CUSTOM_GETTER(noop_getter, (JSGlobalObject*, EncodedJSValue, PropertyName))
{
return JSC::JSValue::encode(JSC::jsUndefined());
@@ -1577,15 +1607,6 @@ enum ReadableStreamTag : int32_t {
Bytes = 4,
};
-JSC_DEFINE_HOST_FUNCTION(functionCallNotImplemented,
- (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
-{
- auto& vm = globalObject->vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
- throwTypeError(globalObject, scope, "Not implemented yet in Bun :("_s);
- return JSC::JSValue::encode(JSC::JSValue {});
-}
-
JSC_DEFINE_HOST_FUNCTION(jsReceiveMessageOnPort, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
{
auto& vm = lexicalGlobalObject->vm();
@@ -1614,11 +1635,9 @@ JSC_DEFINE_HOST_FUNCTION(jsReceiveMessageOnPort, (JSGlobalObject * lexicalGlobal
return JSC::JSValue::encode(jsUndefined());
}
-extern JSC::EncodedJSValue Process_functionInternalGetWindowSize(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame);
-
// we're trying out a new way to do this lazy loading
// this is $lazy() in js code
-static JSC_DEFINE_HOST_FUNCTION(functionLazyLoad,
+JSC_DEFINE_HOST_FUNCTION(functionLazyLoad,
(JSC::JSGlobalObject * lexicalGlobalObject, JSC::CallFrame* callFrame))
{
@@ -1628,7 +1647,7 @@ static JSC_DEFINE_HOST_FUNCTION(functionLazyLoad,
switch (callFrame->argumentCount()) {
case 0: {
- JSC::throwTypeError(globalObject, scope, "lazyLoad needs 1 argument (a string)"_s);
+ JSC::throwTypeError(globalObject, scope, "$lazy needs 1 argument (a string)"_s);
scope.release();
return JSC::JSValue::encode(JSC::JSValue {});
}
@@ -1637,7 +1656,7 @@ static JSC_DEFINE_HOST_FUNCTION(functionLazyLoad,
if (moduleName.isNumber()) {
switch (moduleName.toInt32(globalObject)) {
case 0: {
- JSC::throwTypeError(globalObject, scope, "lazyLoad expects a string"_s);
+ JSC::throwTypeError(globalObject, scope, "$lazy expects a string"_s);
scope.release();
return JSC::JSValue::encode(JSC::JSValue {});
}
@@ -1654,7 +1673,7 @@ static JSC_DEFINE_HOST_FUNCTION(functionLazyLoad,
default: {
auto scope = DECLARE_THROW_SCOPE(globalObject->vm());
- JSC::throwTypeError(globalObject, scope, "lazyLoad expects a string"_s);
+ JSC::throwTypeError(globalObject, scope, "$lazy expects a string"_s);
scope.release();
return JSC::JSValue::encode(JSC::JSValue {});
}
@@ -1663,7 +1682,7 @@ static JSC_DEFINE_HOST_FUNCTION(functionLazyLoad,
auto string = moduleName.toWTFString(globalObject);
if (string.isNull()) {
- JSC::throwTypeError(globalObject, scope, "lazyLoad expects a string"_s);
+ JSC::throwTypeError(globalObject, scope, "$lazy expects a string"_s);
scope.release();
return JSC::JSValue::encode(JSC::JSValue {});
}
@@ -1672,6 +1691,17 @@ static JSC_DEFINE_HOST_FUNCTION(functionLazyLoad,
return JSC::JSValue::encode(JSSQLStatementConstructor::create(vm, globalObject, JSSQLStatementConstructor::createStructure(vm, globalObject, globalObject->m_functionPrototype.get())));
}
+ if (string == "http"_s) {
+ auto* obj = constructEmptyObject(globalObject);
+ obj->putDirect(
+ vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "setHeader"_s)),
+ JSC::JSFunction::create(vm, globalObject, 3, "setHeader"_s, jsHTTPSetHeader, ImplementationVisibility::Public), NoIntrinsic);
+ obj->putDirect(
+ vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "getHeader"_s)),
+ JSC::JSFunction::create(vm, globalObject, 2, "getHeader"_s, jsHTTPGetHeader, ImplementationVisibility::Public), NoIntrinsic);
+ return JSC::JSValue::encode(obj);
+ }
+
if (string == "worker_threads"_s) {
JSValue workerData = jsUndefined();
@@ -1729,6 +1759,41 @@ static JSC_DEFINE_HOST_FUNCTION(functionLazyLoad,
if (string == "events"_s) {
return JSValue::encode(WebCore::JSEventEmitter::getConstructor(vm, globalObject));
}
+
+ if (string == "internal/crypto"_s) {
+ // auto sourceOrigin = callFrame->callerSourceOrigin(vm).url();
+ // bool isBuiltin = sourceOrigin.protocolIs("builtin"_s);
+ // if (!isBuiltin) {
+ // return JSC::JSValue::encode(JSC::jsUndefined());
+ // }
+ auto* obj = constructEmptyObject(globalObject);
+ obj->putDirect(
+ vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "symmetricKeySize"_s)), JSC::JSFunction::create(vm, globalObject, 1, "symmetricKeySize"_s, KeyObject__SymmetricKeySize, ImplementationVisibility::Public, NoIntrinsic), 0);
+ obj->putDirect(
+ vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "asymmetricKeyType"_s)), JSC::JSFunction::create(vm, globalObject, 1, "asymmetricKeyType"_s, KeyObject__AsymmetricKeyType, ImplementationVisibility::Public, NoIntrinsic), 0);
+ obj->putDirect(
+ vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "asymmetricKeyDetails"_s)), JSC::JSFunction::create(vm, globalObject, 1, "asymmetricKeyDetails"_s, KeyObject_AsymmetricKeyDetails, ImplementationVisibility::Public, NoIntrinsic), 0);
+ obj->putDirect(
+ vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "equals"_s)), JSC::JSFunction::create(vm, globalObject, 2, "equals"_s, KeyObject__Equals, ImplementationVisibility::Public, NoIntrinsic), 0);
+ obj->putDirect(
+ vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "exports"_s)), JSC::JSFunction::create(vm, globalObject, 2, "exports"_s, KeyObject__Exports, ImplementationVisibility::Public, NoIntrinsic), 0);
+
+ obj->putDirect(
+ vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "createSecretKey"_s)), JSC::JSFunction::create(vm, globalObject, 1, "createSecretKey"_s, KeyObject__createSecretKey, ImplementationVisibility::Public, NoIntrinsic), 0);
+
+ obj->putDirect(
+ vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "createPublicKey"_s)), JSC::JSFunction::create(vm, globalObject, 1, "createPublicKey"_s, KeyObject__createPublicKey, ImplementationVisibility::Public, NoIntrinsic), 0);
+
+ obj->putDirect(
+ vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "createPrivateKey"_s)), JSC::JSFunction::create(vm, globalObject, 1, "createPrivateKey"_s, KeyObject__createPrivateKey, ImplementationVisibility::Public, NoIntrinsic), 0);
+
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "generateKeySync"_s)), JSC::JSFunction::create(vm, globalObject, 2, "generateKeySync"_s, KeyObject__generateKeySync, ImplementationVisibility::Public, NoIntrinsic), 0);
+
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "generateKeyPairSync"_s)), JSC::JSFunction::create(vm, globalObject, 2, "generateKeyPairSync"_s, KeyObject__generateKeyPairSync, ImplementationVisibility::Public, NoIntrinsic), 0);
+
+ return JSValue::encode(obj);
+ }
+
if (string == "internal/tls"_s) {
auto* obj = constructEmptyObject(globalObject);
@@ -1759,10 +1824,6 @@ static JSC_DEFINE_HOST_FUNCTION(functionLazyLoad,
return JSValue::encode(obj);
}
- if (string == "masqueradesAsUndefined"_s) {
- return JSValue::encode(InternalFunction::createFunctionThatMasqueradesAsUndefined(vm, globalObject, 0, String(), functionCallNotImplemented));
- }
-
if (string == "vm"_s) {
auto* obj = constructEmptyObject(globalObject);
obj->putDirect(
@@ -1803,7 +1864,7 @@ static JSC_DEFINE_HOST_FUNCTION(functionLazyLoad,
obj->putDirect(vm, PropertyName(Identifier::fromString(vm, "isatty"_s)), JSFunction::create(vm, globalObject, 0, "isatty"_s, jsFunctionTty_isatty, ImplementationVisibility::Public), 1);
- obj->putDirect(vm, PropertyName(Identifier::fromString(vm, "getWindowSize"_s)), JSFunction::create(vm, globalObject, 0, "getWindowSize"_s, Process_functionInternalGetWindowSize, ImplementationVisibility::Public), 2);
+ obj->putDirect(vm, PropertyName(Identifier::fromString(vm, "getWindowSize"_s)), JSFunction::create(vm, globalObject, 0, "getWindowSize"_s, Bun::Process_functionInternalGetWindowSize, ImplementationVisibility::Public), 2);
return JSValue::encode(obj);
}
@@ -1812,9 +1873,9 @@ static JSC_DEFINE_HOST_FUNCTION(functionLazyLoad,
auto* obj = constructEmptyObject(globalObject);
obj->putDirectCustomAccessor(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "getterSetter"_s)), JSC::CustomGetterSetter::create(vm, noop_getter, noop_setter), 0);
Zig::JSFFIFunction* function = Zig::JSFFIFunction::create(vm, reinterpret_cast<Zig::GlobalObject*>(globalObject), 0, String(), functionNoop, JSC::NoIntrinsic);
- obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "function"_s)), function, JSC::PropertyAttribute::Function | 0);
- obj->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "functionRegular"_s), 1, functionNoop, ImplementationVisibility::Public, NoIntrinsic, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::Function);
- obj->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "callback"_s), 1, functionCallback, ImplementationVisibility::Public, NoIntrinsic, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::Function);
+ obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "function"_s)), function, 0);
+ obj->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "functionRegular"_s), 1, functionNoop, ImplementationVisibility::Public, NoIntrinsic, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
+ obj->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "callback"_s), 1, functionCallback, ImplementationVisibility::Public, NoIntrinsic, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
return JSC::JSValue::encode(obj);
}
@@ -1903,173 +1964,9 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionDispatchEvent, (JSGlobalObject * lexicalGloba
return jsFunctionDispatchEventBody(lexicalGlobalObject, callFrame, jsDynamicCast<Zig::GlobalObject*>(lexicalGlobalObject));
}
-static inline JSValue jsServiceWorkerGlobalScope_ByteLengthQueuingStrategyConstructorGetter(JSGlobalObject& lexicalGlobalObject, Zig::GlobalObject& thisObject)
-{
- UNUSED_PARAM(lexicalGlobalObject);
- return JSByteLengthQueuingStrategy::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
-}
-
-JSC_DEFINE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_ByteLengthQueuingStrategyConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- return IDLAttribute<Zig::GlobalObject>::get<jsServiceWorkerGlobalScope_ByteLengthQueuingStrategyConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
-}
-
-static inline JSValue jsServiceWorkerGlobalScope_CountQueuingStrategyConstructorGetter(JSGlobalObject& lexicalGlobalObject, Zig::GlobalObject& thisObject)
-{
- UNUSED_PARAM(lexicalGlobalObject);
- return JSCountQueuingStrategy::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
-}
-
-JSC_DEFINE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_CountQueuingStrategyConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- return IDLAttribute<Zig::GlobalObject>::get<jsServiceWorkerGlobalScope_CountQueuingStrategyConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
-}
-
-static inline JSValue jsServiceWorkerGlobalScope_ReadableByteStreamControllerConstructorGetter(JSGlobalObject& lexicalGlobalObject, Zig::GlobalObject& thisObject)
-{
- UNUSED_PARAM(lexicalGlobalObject);
- return JSReadableByteStreamController::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
-}
-
-JSC_DEFINE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_ReadableByteStreamControllerConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- return IDLAttribute<Zig::GlobalObject>::get<jsServiceWorkerGlobalScope_ReadableByteStreamControllerConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
-}
-
-static inline JSValue jsServiceWorkerGlobalScope_ReadableStreamConstructorGetter(JSGlobalObject& lexicalGlobalObject, Zig::GlobalObject& thisObject)
-{
- UNUSED_PARAM(lexicalGlobalObject);
- return JSReadableStream::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
-}
-
-JSC_DEFINE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_ReadableStreamConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- return IDLAttribute<Zig::GlobalObject>::get<jsServiceWorkerGlobalScope_ReadableStreamConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
-}
-
-static inline JSValue jsServiceWorkerGlobalScope_ReadableStreamBYOBReaderConstructorGetter(JSGlobalObject& lexicalGlobalObject, Zig::GlobalObject& thisObject)
-{
- UNUSED_PARAM(lexicalGlobalObject);
- return JSReadableStreamBYOBReader::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
-}
-
-JSC_DEFINE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_ReadableStreamBYOBReaderConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- return IDLAttribute<Zig::GlobalObject>::get<jsServiceWorkerGlobalScope_ReadableStreamBYOBReaderConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
-}
-
-static inline JSValue jsServiceWorkerGlobalScope_ReadableStreamBYOBRequestConstructorGetter(JSGlobalObject& lexicalGlobalObject, Zig::GlobalObject& thisObject)
-{
- UNUSED_PARAM(lexicalGlobalObject);
- return JSReadableStreamBYOBRequest::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
-}
-
-JSC_DEFINE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_ReadableStreamBYOBRequestConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- return IDLAttribute<Zig::GlobalObject>::get<jsServiceWorkerGlobalScope_ReadableStreamBYOBRequestConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
-}
-
-static inline JSValue jsServiceWorkerGlobalScope_ReadableStreamDefaultControllerConstructorGetter(JSGlobalObject& lexicalGlobalObject, Zig::GlobalObject& thisObject)
-{
- UNUSED_PARAM(lexicalGlobalObject);
- return JSReadableStreamDefaultController::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
-}
-
-JSC_DEFINE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_ReadableStreamDefaultControllerConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- return IDLAttribute<Zig::GlobalObject>::get<jsServiceWorkerGlobalScope_ReadableStreamDefaultControllerConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
-}
-
-static inline JSValue jsServiceWorkerGlobalScope_ReadableStreamDefaultReaderConstructorGetter(JSGlobalObject& lexicalGlobalObject, Zig::GlobalObject& thisObject)
-{
- UNUSED_PARAM(lexicalGlobalObject);
- return JSReadableStreamDefaultReader::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
-}
-
-JSC_DEFINE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_ReadableStreamDefaultReaderConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- return IDLAttribute<Zig::GlobalObject>::get<jsServiceWorkerGlobalScope_ReadableStreamDefaultReaderConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
-}
-
-static inline JSValue jsServiceWorkerGlobalScope_TransformStreamConstructorGetter(JSGlobalObject& lexicalGlobalObject, Zig::GlobalObject& thisObject)
-{
- UNUSED_PARAM(lexicalGlobalObject);
- return JSTransformStream::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
-}
-
-JSC_DEFINE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_TransformStreamConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- return IDLAttribute<Zig::GlobalObject>::get<jsServiceWorkerGlobalScope_TransformStreamConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
-}
-
-static inline JSValue jsServiceWorkerGlobalScope_TransformStreamDefaultControllerConstructorGetter(JSGlobalObject& lexicalGlobalObject, Zig::GlobalObject& thisObject)
-{
- UNUSED_PARAM(lexicalGlobalObject);
- return JSTransformStreamDefaultController::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
-}
-
-JSC_DEFINE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_TransformStreamDefaultControllerConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- return IDLAttribute<Zig::GlobalObject>::get<jsServiceWorkerGlobalScope_TransformStreamDefaultControllerConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
-}
-
-static inline JSValue jsServiceWorkerGlobalScope_WritableStreamConstructorGetter(JSGlobalObject& lexicalGlobalObject, Zig::GlobalObject& thisObject)
-{
- UNUSED_PARAM(lexicalGlobalObject);
- return JSWritableStream::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
-}
-
-JSC_DEFINE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_WritableStreamConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- return IDLAttribute<Zig::GlobalObject>::get<jsServiceWorkerGlobalScope_WritableStreamConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
-}
-
-static inline JSValue jsServiceWorkerGlobalScope_WritableStreamDefaultControllerConstructorGetter(JSGlobalObject& lexicalGlobalObject, Zig::GlobalObject& thisObject)
-{
- UNUSED_PARAM(lexicalGlobalObject);
- return JSWritableStreamDefaultController::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
-}
-
-JSC_DEFINE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_WritableStreamDefaultControllerConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- return IDLAttribute<Zig::GlobalObject>::get<jsServiceWorkerGlobalScope_WritableStreamDefaultControllerConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
-}
-
-static inline JSValue jsServiceWorkerGlobalScope_WritableStreamDefaultWriterConstructorGetter(JSGlobalObject& lexicalGlobalObject, Zig::GlobalObject& thisObject)
-{
- UNUSED_PARAM(lexicalGlobalObject);
- return JSWritableStreamDefaultWriter::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
-}
-
-JSC_DEFINE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_WritableStreamDefaultWriterConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- return IDLAttribute<Zig::GlobalObject>::get<jsServiceWorkerGlobalScope_WritableStreamDefaultWriterConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
-}
-
-JSC_DEFINE_CUSTOM_GETTER(getterSubtleCryptoConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject);
- return JSValue::encode(
- JSSubtleCrypto::getConstructor(thisObject->vm(), thisObject));
-}
-
-JSC_DEFINE_CUSTOM_GETTER(getterCryptoKeyConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
-{
- Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(lexicalGlobalObject);
- return JSValue::encode(
- JSCryptoKey::getConstructor(thisObject->vm(), thisObject));
-}
-
-static inline JSValue getterSubtleCryptoBody(JSGlobalObject& lexicalGlobalObject, Zig::GlobalObject& thisObject)
-{
- UNUSED_PARAM(lexicalGlobalObject);
- return thisObject.subtleCrypto();
-}
-
JSC_DEFINE_CUSTOM_GETTER(getterSubtleCrypto, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
{
- return JSValue::encode(
- getterSubtleCryptoBody(*lexicalGlobalObject, *reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject)));
+ return JSValue::encode(reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject)->subtleCrypto());
}
JSC_DECLARE_HOST_FUNCTION(makeThisTypeErrorForBuiltins);
@@ -2079,6 +1976,12 @@ JSC_DECLARE_HOST_FUNCTION(createWritableStreamFromInternal);
JSC_DECLARE_HOST_FUNCTION(getInternalWritableStream);
JSC_DECLARE_HOST_FUNCTION(whenSignalAborted);
JSC_DECLARE_HOST_FUNCTION(isAbortSignal);
+
+JSC_DEFINE_HOST_FUNCTION(jsCreateCJSImportMeta, (JSGlobalObject * globalObject, CallFrame* callFrame))
+{
+ return JSValue::encode(Zig::ImportMetaObject::create(globalObject, callFrame->argument(0).toString(globalObject)));
+}
+
JSC_DEFINE_HOST_FUNCTION(makeThisTypeErrorForBuiltins, (JSGlobalObject * globalObject, CallFrame* callFrame))
{
ASSERT(callFrame);
@@ -2296,9 +2199,11 @@ static inline EncodedJSValue functionPerformanceNowBody(JSGlobalObject* globalOb
{
auto* global = reinterpret_cast<GlobalObject*>(globalObject);
// nanoseconds to seconds
- uint64_t time = Bun__readOriginTimer(global->bunVM());
+ double time = static_cast<double>(Bun__readOriginTimer(global->bunVM()));
double result = time / 1000000.0;
- return JSValue::encode(jsNumber(result));
+
+ // https://github.com/oven-sh/bun/issues/5604
+ return JSValue::encode(jsDoubleNumber(result));
}
extern "C" {
@@ -2337,11 +2242,12 @@ private:
void finishCreation(JSC::VM& vm)
{
+ Base::finishCreation(vm);
static const JSC::DOMJIT::Signature DOMJITSignatureForPerformanceNow(
functionPerformanceNowWithoutTypeCheck,
JSPerformanceObject::info(),
JSC::DOMJIT::Effect::forWriteKinds(DFG::AbstractHeapKind::SideState),
- SpecBytecodeDouble);
+ SpecDoubleReal);
JSFunction* now = JSFunction::create(
vm,
@@ -2350,7 +2256,7 @@ private:
String("now"_s),
functionPerformanceNow, ImplementationVisibility::Public, NoIntrinsic, functionPerformanceNow,
&DOMJITSignatureForPerformanceNow);
- this->putDirect(vm, JSC::Identifier::fromString(vm, "now"_s), now, JSC::PropertyAttribute::DOMJITFunction | JSC::PropertyAttribute::Function);
+ this->putDirect(vm, JSC::Identifier::fromString(vm, "now"_s), now, 0);
JSFunction* noopNotImplemented = JSFunction::create(
vm,
@@ -2358,16 +2264,17 @@ private:
0,
String("noopNotImplemented"_s),
functionNoop, ImplementationVisibility::Public, NoIntrinsic, functionNoop,
- &DOMJITSignatureForPerformanceNow);
- this->putDirect(vm, JSC::Identifier::fromString(vm, "mark"_s), noopNotImplemented, JSC::PropertyAttribute::DOMJITFunction | JSC::PropertyAttribute::Function);
- this->putDirect(vm, JSC::Identifier::fromString(vm, "markResourceTiming"_s), noopNotImplemented, JSC::PropertyAttribute::DOMJITFunction | JSC::PropertyAttribute::Function);
- this->putDirect(vm, JSC::Identifier::fromString(vm, "measure"_s), noopNotImplemented, JSC::PropertyAttribute::DOMJITFunction | JSC::PropertyAttribute::Function);
+ nullptr);
+
+ this->putDirect(vm, JSC::Identifier::fromString(vm, "mark"_s), noopNotImplemented, 0);
+ this->putDirect(vm, JSC::Identifier::fromString(vm, "markResourceTiming"_s), noopNotImplemented, 0);
+ this->putDirect(vm, JSC::Identifier::fromString(vm, "measure"_s), noopNotImplemented, 0);
this->putDirect(
vm,
JSC::Identifier::fromString(vm, "timeOrigin"_s),
jsNumber(Bun__readOriginTimerStart(reinterpret_cast<Zig::GlobalObject*>(this->globalObject())->bunVM())),
- JSC::PropertyAttribute::ReadOnly | 0);
+ PropertyAttribute::ReadOnly | 0);
}
};
const ClassInfo JSPerformanceObject::s_info = { "Performance"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSPerformanceObject) };
@@ -2665,7 +2572,7 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionPerformMicrotaskVariadic, (JSGlobalObject * g
return JSValue::encode(jsUndefined());
}
-void GlobalObject::createCallSitesFromFrames(JSC::JSGlobalObject* lexicalGlobalObject, JSCStackTrace& stackTrace, JSC::JSArray* callSites)
+void GlobalObject::createCallSitesFromFrames(Zig::GlobalObject* globalObject, JSC::JSGlobalObject* lexicalGlobalObject, JSCStackTrace& stackTrace, JSC::JSArray* callSites)
{
/* From v8's "Stack Trace API" (https://github.com/v8/v8/wiki/Stack-Trace-API):
* "To maintain restrictions imposed on strict mode functions, frames that have a
@@ -2673,10 +2580,11 @@ void GlobalObject::createCallSitesFromFrames(JSC::JSGlobalObject* lexicalGlobalO
* their receiver and function objects. For those frames, getFunction() and getThis()
* will return undefined."." */
bool encounteredStrictFrame = false;
- GlobalObject* globalObject = reinterpret_cast<GlobalObject*>(lexicalGlobalObject);
+ // TODO: is it safe to use CallSite structure from a different JSGlobalObject? This case would happen within a node:vm
JSC::Structure* callSiteStructure = globalObject->callSiteStructure();
size_t framesCount = stackTrace.size();
+
for (size_t i = 0; i < framesCount; i++) {
CallSite* callSite = CallSite::create(lexicalGlobalObject, callSiteStructure, stackTrace.at(i), encounteredStrictFrame);
callSites->putDirectIndex(lexicalGlobalObject, i, callSite);
@@ -2687,40 +2595,19 @@ void GlobalObject::createCallSitesFromFrames(JSC::JSGlobalObject* lexicalGlobalO
}
}
-JSC::JSValue GlobalObject::formatStackTrace(JSC::VM& vm, JSC::JSGlobalObject* lexicalGlobalObject, JSC::JSObject* errorObject, JSC::JSArray* callSites)
+void GlobalObject::formatStackTrace(JSC::VM& vm, JSC::JSGlobalObject* lexicalGlobalObject, JSC::JSObject* errorObject, JSC::JSArray* callSites, JSValue prepareStackTrace)
{
auto scope = DECLARE_THROW_SCOPE(vm);
- JSValue errorValue = this->get(this, JSC::Identifier::fromString(vm, "Error"_s));
- if (UNLIKELY(scope.exception())) {
- return JSValue();
- }
- if (!errorValue || errorValue.isUndefined() || !errorValue.isObject()) {
- return JSValue(jsEmptyString(vm));
- }
+ auto* errorConstructor = lexicalGlobalObject->m_errorStructure.constructor(this);
- auto* errorConstructor = jsDynamicCast<JSC::JSObject*>(errorValue);
-
- /* If the user has set a callable Error.prepareStackTrace - use it to format the stack trace. */
- JSC::JSValue prepareStackTrace = errorConstructor->getIfPropertyExists(lexicalGlobalObject, JSC::Identifier::fromString(vm, "prepareStackTrace"_s));
- if (prepareStackTrace && prepareStackTrace.isCallable()) {
- JSC::CallData prepareStackTraceCallData = JSC::getCallData(prepareStackTrace);
-
- if (prepareStackTraceCallData.type != JSC::CallData::Type::None) {
- JSC::MarkedArgumentBuffer arguments;
- arguments.append(errorObject);
- arguments.append(callSites);
- ASSERT(!arguments.hasOverflowed());
-
- JSC::JSValue result = profiledCall(
- lexicalGlobalObject,
- JSC::ProfilingReason::Other,
- prepareStackTrace,
- prepareStackTraceCallData,
- errorConstructor,
- arguments);
- RETURN_IF_EXCEPTION(scope, JSC::jsUndefined());
- return result;
+ if (!prepareStackTrace) {
+ if (lexicalGlobalObject->inherits<Zig::GlobalObject>()) {
+ if (auto prepare = this->m_errorConstructorPrepareStackTraceValue.get()) {
+ prepareStackTrace = prepare;
+ }
+ } else {
+ prepareStackTrace = errorConstructor->getIfPropertyExists(lexicalGlobalObject, JSC::Identifier::fromString(vm, "prepareStackTrace"_s));
}
}
@@ -2749,7 +2636,43 @@ JSC::JSValue GlobalObject::formatStackTrace(JSC::VM& vm, JSC::JSGlobalObject* le
}
}
- return JSC::JSValue(jsString(vm, sb.toString()));
+ bool orignialSkipNextComputeErrorInfo = skipNextComputeErrorInfo;
+ skipNextComputeErrorInfo = true;
+ if (errorObject->hasProperty(lexicalGlobalObject, vm.propertyNames->stack)) {
+ skipNextComputeErrorInfo = true;
+ errorObject->deleteProperty(lexicalGlobalObject, vm.propertyNames->stack);
+ }
+ skipNextComputeErrorInfo = orignialSkipNextComputeErrorInfo;
+
+ // In Node, if you console.log(error.stack) inside Error.prepareStackTrace
+ // it will display the stack as a formatted string, so we have to do the same.
+ errorObject->putDirect(vm, vm.propertyNames->stack, JSC::JSValue(jsString(vm, sb.toString())), 0);
+
+ if (prepareStackTrace && prepareStackTrace.isCallable()) {
+ JSC::CallData prepareStackTraceCallData = JSC::getCallData(prepareStackTrace);
+
+ if (prepareStackTraceCallData.type != JSC::CallData::Type::None) {
+ JSC::MarkedArgumentBuffer arguments;
+ arguments.append(errorObject);
+ arguments.append(callSites);
+
+ JSC::JSValue result = profiledCall(
+ lexicalGlobalObject,
+ JSC::ProfilingReason::Other,
+ prepareStackTrace,
+ prepareStackTraceCallData,
+ errorConstructor,
+ arguments);
+
+ RETURN_IF_EXCEPTION(scope, void());
+
+ if (result.isUndefinedOrNull()) {
+ result = jsUndefined();
+ }
+
+ errorObject->putDirect(vm, vm.propertyNames->stack, result, 0);
+ }
+ }
}
JSC_DEFINE_HOST_FUNCTION(errorConstructorFuncAppendStackTrace, (JSC::JSGlobalObject * lexicalGlobalObject, JSC::CallFrame* callFrame))
@@ -2805,9 +2728,9 @@ JSC_DEFINE_HOST_FUNCTION(errorConstructorFuncCaptureStackTrace, (JSC::JSGlobalOb
stackTrace.size());
// Create the call sites (one per frame)
- GlobalObject::createCallSitesFromFrames(lexicalGlobalObject, stackTrace, callSites);
+ GlobalObject::createCallSitesFromFrames(globalObject, lexicalGlobalObject, stackTrace, callSites);
- /* Foramt the stack trace.
+ /* Format the stack trace.
* Note that v8 won't actually format the stack trace here, but will create a "stack" accessor
* on the error object, which will format the stack trace on the first access. For now, since
* we're not being used internally by JSC, we can assume callers of Error.captureStackTrace in
@@ -2847,23 +2770,9 @@ JSC_DEFINE_HOST_FUNCTION(errorConstructorFuncCaptureStackTrace, (JSC::JSGlobalOb
}
}
- JSC::JSValue formattedStackTrace = globalObject->formatStackTrace(vm, lexicalGlobalObject, errorObject, callSites);
+ globalObject->formatStackTrace(vm, lexicalGlobalObject, errorObject, callSites, JSC::JSValue());
RETURN_IF_EXCEPTION(scope, JSC::JSValue::encode({}));
- bool orignialSkipNextComputeErrorInfo = skipNextComputeErrorInfo;
- skipNextComputeErrorInfo = true;
- if (errorObject->hasProperty(lexicalGlobalObject, vm.propertyNames->stack)) {
- skipNextComputeErrorInfo = true;
- errorObject->deleteProperty(lexicalGlobalObject, vm.propertyNames->stack);
- }
- skipNextComputeErrorInfo = orignialSkipNextComputeErrorInfo;
-
- if (formattedStackTrace.isUndefinedOrNull()) {
- formattedStackTrace = JSC::jsUndefined();
- }
-
- errorObject->putDirect(vm, vm.propertyNames->stack, formattedStackTrace, 0);
-
if (auto* instance = jsDynamicCast<JSC::ErrorInstance*>(errorObject)) {
// we make a separate copy of the StackTrace unfortunately so that we
// can later console.log it without losing the info
@@ -2900,7 +2809,7 @@ void GlobalObject::finishCreation(VM& vm)
init.vm,
Identifier::fromString(init.vm, "subtle"_s),
JSC::CustomGetterSetter::create(init.vm, getterSubtleCrypto, nullptr),
- JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete | 0);
+ PropertyAttribute::ReadOnly | PropertyAttribute::DontDelete | 0);
init.set(crypto);
});
@@ -2950,11 +2859,20 @@ void GlobalObject::finishCreation(VM& vm)
m_commonJSFunctionArgumentsStructure.initLater(
[](const Initializer<Structure>& init) {
auto* globalObject = reinterpret_cast<Zig::GlobalObject*>(init.owner);
+
+ auto prototype = JSC::constructEmptyObject(init.owner, globalObject->objectPrototype(), 1);
+ prototype->putDirect(
+ init.vm,
+ Identifier::fromString(init.vm, "createImportMeta"_s),
+ JSFunction::create(init.vm, init.owner, 2, ""_s, jsCreateCJSImportMeta, ImplementationVisibility::Public),
+ PropertyAttribute::DontDelete | PropertyAttribute::DontEnum | 0);
+
JSC::Structure* structure = globalObject->structureCache().emptyObjectStructureForPrototype(
globalObject,
- globalObject->objectPrototype(),
- 3);
+ prototype,
+ 5);
JSC::PropertyOffset offset;
+
auto& vm = globalObject->vm();
structure = structure->addPropertyTransition(
@@ -2967,6 +2885,20 @@ void GlobalObject::finishCreation(VM& vm)
structure = structure->addPropertyTransition(
vm,
structure,
+ JSC::Identifier::fromString(vm, "require"_s),
+ 0,
+ offset);
+
+ structure = structure->addPropertyTransition(
+ vm,
+ structure,
+ JSC::Identifier::fromString(vm, "resolve"_s),
+ 0,
+ offset);
+
+ structure = structure->addPropertyTransition(
+ vm,
+ structure,
JSC::Identifier::fromString(vm, "__dirname"_s),
0,
offset);
@@ -2981,6 +2913,11 @@ void GlobalObject::finishCreation(VM& vm)
init.set(structure);
});
+ m_JSSocketAddressStructure.initLater(
+ [](const Initializer<Structure>& init) {
+ init.set(JSSocketAddress::createStructure(init.vm, init.owner));
+ });
+
// Change prototype from null to object for synthetic modules.
m_moduleNamespaceObjectStructure.initLater(
[](const Initializer<Structure>& init) {
@@ -3022,7 +2959,7 @@ void GlobalObject::finishCreation(VM& vm)
m_utilInspectFunction.initLater(
[](const Initializer<JSFunction>& init) {
- JSValue nodeUtilValue = static_cast<Zig::GlobalObject*>(init.owner)->internalModuleRegistry()->requireId(init.owner, init.vm, Bun::InternalModuleRegistry::Field::NodeUtil);
+ JSValue nodeUtilValue = jsCast<Zig::GlobalObject*>(init.owner)->internalModuleRegistry()->requireId(init.owner, init.vm, Bun::InternalModuleRegistry::Field::NodeUtil);
RELEASE_ASSERT(nodeUtilValue.isObject());
init.set(jsCast<JSFunction*>(nodeUtilValue.getObject()->getIfPropertyExists(init.owner, Identifier::fromString(init.vm, "inspect"_s))));
});
@@ -3034,7 +2971,7 @@ void GlobalObject::finishCreation(VM& vm)
// RETURN_IF_EXCEPTION(scope, {});
JSC::MarkedArgumentBuffer args;
- args.append(static_cast<Zig::GlobalObject*>(init.owner)->utilInspectFunction());
+ args.append(jsCast<Zig::GlobalObject*>(init.owner)->utilInspectFunction());
auto clientData = WebCore::clientData(init.vm);
JSC::CallData callData = JSC::getCallData(getStylize);
@@ -3078,7 +3015,7 @@ void GlobalObject::finishCreation(VM& vm)
JSC::JSObject* obj = JSC::constructEmptyObject(init.owner, init.owner->objectPrototype(), 4);
obj->putDirect(init.vm, userAgentIdentifier, JSC::jsString(init.vm, str));
obj->putDirect(init.vm, init.vm.propertyNames->toStringTagSymbol,
- jsNontrivialString(init.vm, "Navigator"_s), JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly);
+ jsNontrivialString(init.vm, "Navigator"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
// https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform
// https://github.com/oven-sh/bun/issues/4588
@@ -3091,8 +3028,7 @@ void GlobalObject::finishCreation(VM& vm)
#endif
obj->putDirect(init.vm, hardwareConcurrencyIdentifier, JSC::jsNumber(cpuCount));
- init.set(
- obj);
+ init.set(obj);
});
this->m_pendingVirtualModuleResultStructure.initLater(
@@ -3100,6 +3036,11 @@ void GlobalObject::finishCreation(VM& vm)
init.set(Bun::PendingVirtualModuleResult::createStructure(init.vm, init.owner, init.owner->objectPrototype()));
});
+ m_bunObject.initLater(
+ [](const JSC::LazyProperty<JSC::JSGlobalObject, JSObject>::Initializer& init) {
+ init.set(Bun::createBunObject(init.vm, init.owner));
+ });
+
this->initGeneratedLazyClasses();
m_cachedGlobalObjectStructure.initLater(
@@ -3119,13 +3060,12 @@ void GlobalObject::finishCreation(VM& vm)
m_subtleCryptoObject.initLater(
[](const JSC::LazyProperty<JSC::JSGlobalObject, JSC::JSObject>::Initializer& init) {
auto& global = *reinterpret_cast<Zig::GlobalObject*>(init.owner);
- if (global.crypto == nullptr) {
- global.crypto = WebCore::SubtleCrypto::createPtr(global.scriptExecutionContext());
- global.crypto->ref();
+
+ if (!global.m_subtleCrypto) {
+ global.m_subtleCrypto = &WebCore::SubtleCrypto::create(global.scriptExecutionContext()).leakRef();
}
- init.set(
- toJS<IDLInterface<SubtleCrypto>>(*init.owner, global, global.crypto).getObject());
+ init.set(toJS<IDLInterface<SubtleCrypto>>(*init.owner, global, global.m_subtleCrypto).getObject());
});
m_NapiClassStructure.initLater(
@@ -3173,8 +3113,8 @@ void GlobalObject::finishCreation(VM& vm)
m_processObject.initLater(
[](const JSC::LazyProperty<JSC::JSGlobalObject, JSC::JSObject>::Initializer& init) {
Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(init.owner);
- auto* process = Zig::Process::create(
- *globalObject, Zig::Process::createStructure(init.vm, init.owner, WebCore::JSEventEmitter::prototype(init.vm, *globalObject)));
+ auto* process = Bun::Process::create(
+ *globalObject, Bun::Process::createStructure(init.vm, init.owner, WebCore::JSEventEmitter::prototype(init.vm, *globalObject)));
init.set(process);
});
@@ -3234,7 +3174,7 @@ void GlobalObject::finishCreation(VM& vm)
});
m_processBindingConstants.initLater(
- [](const JSC::LazyProperty<JSC::JSGlobalObject, Bun::ProcessBindingConstants>::Initializer& init) {
+ [](const JSC::LazyProperty<JSC::JSGlobalObject, JSC::JSObject>::Initializer& init) {
init.set(
ProcessBindingConstants::create(
init.vm,
@@ -3291,6 +3231,14 @@ void GlobalObject::finishCreation(VM& vm)
init.setConstructor(constructor);
});
+ m_JSCryptoKey.initLater(
+ [](const JSC::LazyProperty<JSC::JSGlobalObject, JSC::Structure>::Initializer& init) {
+ Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(init.owner);
+ auto* prototype = JSCryptoKey::createPrototype(init.vm, *globalObject);
+ auto* structure = JSCryptoKey::createStructure(init.vm, init.owner, JSValue(prototype));
+ init.set(structure);
+ });
+
m_JSHTTPSResponseSinkClassStructure.initLater(
[](LazyClassStructure::Initializer& init) {
auto* prototype = createJSSinkPrototype(init.vm, init.global, WebCore::SinkID::HTTPSResponseSink);
@@ -3363,22 +3311,13 @@ void GlobalObject::finishCreation(VM& vm)
init.setConstructor(constructor);
});
- addBuiltinGlobals(vm);
-
#if ENABLE(REMOTE_INSPECTOR)
setInspectable(false);
#endif
- RELEASE_ASSERT(classInfo());
+ addBuiltinGlobals(vm);
- JSC::JSObject* errorConstructor = this->errorConstructor();
- errorConstructor->putDirectNativeFunction(vm, this, JSC::Identifier::fromString(vm, "captureStackTrace"_s), 2, errorConstructorFuncCaptureStackTrace, ImplementationVisibility::Public, JSC::NoIntrinsic, PropertyAttribute::DontEnum | 0);
- errorConstructor->putDirectNativeFunction(vm, this, JSC::Identifier::fromString(vm, "appendStackTrace"_s), 2, errorConstructorFuncAppendStackTrace, ImplementationVisibility::Private, JSC::NoIntrinsic, PropertyAttribute::DontEnum | 0);
- JSC::JSValue console = this->get(this, JSC::Identifier::fromString(vm, "console"_s));
- JSC::JSObject* consoleObject = console.getObject();
- consoleObject->putDirectBuiltinFunction(vm, this, vm.propertyNames->asyncIteratorSymbol, consoleObjectAsyncIteratorCodeGenerator(vm), PropertyAttribute::Builtin | PropertyAttribute::DontDelete);
- auto clientData = WebCore::clientData(vm);
- consoleObject->putDirectBuiltinFunction(vm, this, clientData->builtinNames().writePublicName(), consoleObjectWriteCodeGenerator(vm), PropertyAttribute::Builtin | PropertyAttribute::ReadOnly | PropertyAttribute::DontDelete);
+ ASSERT(classInfo());
}
JSC_DEFINE_HOST_FUNCTION(jsFunctionPostMessage,
@@ -3483,7 +3422,7 @@ JSC_DEFINE_CUSTOM_GETTER(BunCommonJSModule_getter, (JSGlobalObject * globalObjec
// This implementation works the same as setTimeout(myFunction, 0)
// TODO: make it more efficient
// https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate
-static JSC_DEFINE_HOST_FUNCTION(functionSetImmediate,
+JSC_DEFINE_HOST_FUNCTION(functionSetImmediate,
(JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
{
JSC::VM& vm = globalObject->vm();
@@ -3525,31 +3464,11 @@ static JSC_DEFINE_HOST_FUNCTION(functionSetImmediate,
return Bun__Timer__setTimeout(globalObject, JSC::JSValue::encode(job), JSC::JSValue::encode(jsNumber(0)), JSValue::encode(arguments));
}
-JSC_DEFINE_CUSTOM_GETTER(JSModuleLoader_getter, (JSGlobalObject * globalObject, EncodedJSValue thisValue, PropertyName))
-{
- return JSValue::encode(globalObject->moduleLoader());
-}
-
-JSC_DEFINE_CUSTOM_GETTER(functionResolveMessageGetter, (JSGlobalObject * globalObject, EncodedJSValue thisValue, PropertyName))
+JSValue getEventSourceConstructor(VM& vm, JSObject* thisObject)
{
- return JSValue::encode(reinterpret_cast<Zig::GlobalObject*>(globalObject)->JSResolveMessageConstructor());
-}
-JSC_DEFINE_CUSTOM_GETTER(functionBuildMessageGetter, (JSGlobalObject * globalObject, EncodedJSValue thisValue, PropertyName))
-{
- return JSValue::encode(reinterpret_cast<Zig::GlobalObject*>(globalObject)->JSBuildMessageConstructor());
-}
-
-JSC_DEFINE_CUSTOM_GETTER(
- EventSource_getter, (JSGlobalObject * globalObject, EncodedJSValue thisValue, PropertyName property))
-{
- auto& vm = globalObject->vm();
+ auto globalObject = jsCast<Zig::GlobalObject*>(thisObject);
auto scope = DECLARE_THROW_SCOPE(vm);
- // If "this" is not the Global object, just return undefined
- // you should not be able to reset the global object's EventSource if you muck around with prototypes
- if (JSValue::decode(thisValue) != globalObject)
- return JSValue::encode(JSC::jsUndefined());
-
JSC::JSFunction* getSourceEvent = JSC::JSFunction::create(vm, eventSourceGetEventSourceCodeGenerator(vm), globalObject);
RETURN_IF_EXCEPTION(scope, {});
@@ -3564,15 +3483,61 @@ JSC_DEFINE_CUSTOM_GETTER(
if (returnedException) {
throwException(globalObject, scope, returnedException.get());
+ return jsUndefined();
}
- RETURN_IF_EXCEPTION(scope, {});
+ RELEASE_AND_RETURN(scope, result);
+}
- if (LIKELY(result)) {
- globalObject->putDirect(vm, property, result, 0);
+// `console.Console` or `import { Console } from 'console';`
+JSC_DEFINE_CUSTOM_GETTER(getConsoleConstructor, (JSGlobalObject * globalObject, EncodedJSValue thisValue, PropertyName property))
+{
+ auto& vm = globalObject->vm();
+ auto console = JSValue::decode(thisValue).getObject();
+ JSC::JSFunction* createConsoleConstructor = JSC::JSFunction::create(vm, consoleObjectCreateConsoleConstructorCodeGenerator(vm), globalObject);
+ JSC::MarkedArgumentBuffer args;
+ args.append(console);
+ JSC::CallData callData = JSC::getCallData(createConsoleConstructor);
+ NakedPtr<JSC::Exception> returnedException = nullptr;
+ auto result = JSC::call(globalObject, createConsoleConstructor, callData, console, args, returnedException);
+ if (returnedException) {
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ throwException(globalObject, scope, returnedException.get());
}
+ console->putDirect(vm, property, result, 0);
+ return JSValue::encode(result);
+}
+
+// `console._stdout` is equal to `process.stdout`
+JSC_DEFINE_CUSTOM_GETTER(getConsoleStdout, (JSGlobalObject * globalObject, EncodedJSValue thisValue, PropertyName property))
+{
+ auto& vm = globalObject->vm();
+ auto console = JSValue::decode(thisValue).getObject();
+ auto global = jsCast<Zig::GlobalObject*>(globalObject);
- RELEASE_AND_RETURN(scope, JSValue::encode(result));
+ // instead of calling the constructor builtin, go through the process.stdout getter to ensure it's only created once.
+ auto stdout = global->processObject()->get(globalObject, Identifier::fromString(vm, "stdout"_s));
+ if (!stdout)
+ return JSValue::encode({});
+
+ console->putDirect(vm, property, stdout, PropertyAttribute::DontEnum | 0);
+ return JSValue::encode(stdout);
+}
+
+// `console._stderr` is equal to `process.stderr`
+JSC_DEFINE_CUSTOM_GETTER(getConsoleStderr, (JSGlobalObject * globalObject, EncodedJSValue thisValue, PropertyName property))
+{
+ auto& vm = globalObject->vm();
+ auto console = JSValue::decode(thisValue).getObject();
+ auto global = jsCast<Zig::GlobalObject*>(globalObject);
+
+ // instead of calling the constructor builtin, go through the process.stdout getter to ensure it's only created once.
+ auto stdout = global->processObject()->get(globalObject, Identifier::fromString(vm, "stderr"_s));
+ if (!stdout)
+ return JSValue::encode({});
+
+ console->putDirect(vm, property, stdout, PropertyAttribute::DontEnum | 0);
+ return JSValue::encode(stdout);
}
JSC_DEFINE_CUSTOM_SETTER(EventSource_setter,
@@ -3680,6 +3645,19 @@ extern "C" EncodedJSValue WebCore__alert(JSC::JSGlobalObject*, JSC::CallFrame*);
extern "C" EncodedJSValue WebCore__prompt(JSC::JSGlobalObject*, JSC::CallFrame*);
extern "C" EncodedJSValue WebCore__confirm(JSC::JSGlobalObject*, JSC::CallFrame*);
+JSValue GlobalObject_getPerformanceObject(VM& vm, JSObject* globalObject)
+{
+ return jsCast<Zig::GlobalObject*>(globalObject)->performanceObject();
+}
+
+JSValue GlobalObject_getGlobalThis(VM& vm, JSObject* globalObject)
+{
+ return jsCast<Zig::GlobalObject*>(globalObject)->globalThis();
+}
+
+// This is like `putDirectBuiltinFunction` but for the global static list.
+#define globalBuiltinFunction(vm, globalObject, identifier, function, attributes) JSC::JSGlobalObject::GlobalPropertyInfo(identifier, JSFunction::create(vm, function, globalObject), attributes)
+
void GlobalObject::addBuiltinGlobals(JSC::VM& vm)
{
m_builtinInternalFunctions.initialize(*this);
@@ -3687,318 +3665,63 @@ void GlobalObject::addBuiltinGlobals(JSC::VM& vm)
auto clientData = WebCore::clientData(vm);
auto& builtinNames = WebCore::builtinNames(vm);
- WTF::Vector<GlobalPropertyInfo> extraStaticGlobals;
- extraStaticGlobals.reserveCapacity(51);
-
- JSC::Identifier queueMicrotaskIdentifier = JSC::Identifier::fromString(vm, "queueMicrotask"_s);
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { JSC::Identifier::fromString(vm, "fetch"_s),
- JSC::JSFunction::create(vm, this, 2,
- "fetch"_s, Bun__fetch, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { queueMicrotaskIdentifier,
- JSC::JSFunction::create(vm, this, 2,
- "queueMicrotask"_s, functionQueueMicrotask, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { JSC::Identifier::fromString(vm, "setImmediate"_s),
- JSC::JSFunction::create(vm, this, 1,
- "setImmediate"_s, functionSetImmediate, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { JSC::Identifier::fromString(vm, "clearImmediate"_s),
- JSC::JSFunction::create(vm, this, 1,
- "clearImmediate"_s, functionClearTimeout, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
-
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { JSC::Identifier::fromString(vm, "structuredClone"_s),
- JSC::JSFunction::create(vm, this, 2,
- "structuredClone"_s, functionStructuredClone, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
-
- JSC::Identifier setTimeoutIdentifier = JSC::Identifier::fromString(vm, "setTimeout"_s);
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { setTimeoutIdentifier,
- JSC::JSFunction::create(vm, this, 1,
- "setTimeout"_s, functionSetTimeout, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
+ // ----- Private/Static Properties -----
- JSC::Identifier clearTimeoutIdentifier = JSC::Identifier::fromString(vm, "clearTimeout"_s);
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { clearTimeoutIdentifier,
- JSC::JSFunction::create(vm, this, 1,
- "clearTimeout"_s, functionClearTimeout, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
+ auto $lazy = JSC::JSFunction::create(vm, this, 0, "$lazy"_s, functionLazyLoad, ImplementationVisibility::Public);
- JSC::Identifier setIntervalIdentifier = JSC::Identifier::fromString(vm, "setInterval"_s);
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { setIntervalIdentifier,
- JSC::JSFunction::create(vm, this, 1,
- "setInterval"_s, functionSetInterval, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
-
- JSC::Identifier clearIntervalIdentifier = JSC::Identifier::fromString(vm, "clearInterval"_s);
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { clearIntervalIdentifier,
- JSC::JSFunction::create(vm, this, 1,
- "clearInterval"_s, functionClearInterval, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
-
- JSC::Identifier atobIdentifier = JSC::Identifier::fromString(vm, "atob"_s);
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { atobIdentifier,
- JSC::JSFunction::create(vm, this, 1,
- "atob"_s, functionATOB, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
-
- JSC::Identifier btoaIdentifier = JSC::Identifier::fromString(vm, "btoa"_s);
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { btoaIdentifier,
- JSC::JSFunction::create(vm, this, 1,
- "btoa"_s, functionBTOA, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
- JSC::Identifier reportErrorIdentifier = JSC::Identifier::fromString(vm, "reportError"_s);
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { reportErrorIdentifier,
- JSC::JSFunction::create(vm, this, 1,
- "reportError"_s, functionReportError, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
-
- {
- JSC::Identifier postMessageIdentifier = JSC::Identifier::fromString(vm, "postMessage"_s);
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { postMessageIdentifier,
- JSC::JSFunction::create(vm, this, 1,
- "postMessage"_s, jsFunctionPostMessage, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
- }
-
- {
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { JSC::Identifier::fromString(vm, "alert"_s),
- JSC::JSFunction::create(vm, this, 1,
- "alert"_s, WebCore__alert, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
- }
-
- {
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { JSC::Identifier::fromString(vm, "confirm"_s),
- JSC::JSFunction::create(vm, this, 1,
- "confirm"_s, WebCore__confirm, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
- }
-
- {
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { JSC::Identifier::fromString(vm, "prompt"_s),
- JSC::JSFunction::create(vm, this, 1,
- "prompt"_s, WebCore__prompt, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
- }
-
- JSValue bunObject = Bun::createBunObject(this);
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { builtinNames.BunPrivateName(),
- bunObject,
- JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete | 0 });
-
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { builtinNames.BunPublicName(),
- bunObject,
- JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete | 0 });
-
- extraStaticGlobals.uncheckedAppend(
+ GlobalPropertyInfo staticGlobals[] = {
GlobalPropertyInfo { builtinNames.startDirectStreamPrivateName(),
JSC::JSFunction::create(vm, this, 1,
String(), functionStartDirectStream, ImplementationVisibility::Public),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0 });
-
- static NeverDestroyed<const String> BunLazyString(MAKE_STATIC_STRING_IMPL("Bun.lazy"));
- JSC::Identifier BunLazyIdentifier = JSC::Identifier::fromUid(vm.symbolRegistry().symbolForKey(BunLazyString));
- JSC::JSFunction* lazyLoadFunction = JSC::JSFunction::create(vm, this, 0,
- BunLazyString, functionLazyLoad, ImplementationVisibility::Public);
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { BunLazyIdentifier,
- lazyLoadFunction,
- JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::Function | 0 });
-
- extraStaticGlobals.uncheckedAppend(
- GlobalPropertyInfo { builtinNames.lazyLoadPrivateName(),
- lazyLoadFunction,
- JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::Function | 0 });
-
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.makeThisTypeErrorPrivateName(), JSFunction::create(vm, this, 2, String(), makeThisTypeErrorForBuiltins, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.makeGetterTypeErrorPrivateName(), JSFunction::create(vm, this, 2, String(), makeGetterTypeErrorForBuiltins, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.makeDOMExceptionPrivateName(), JSFunction::create(vm, this, 2, String(), makeDOMExceptionForBuiltins, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.whenSignalAbortedPrivateName(), JSFunction::create(vm, this, 2, String(), whenSignalAborted, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.cloneArrayBufferPrivateName(), JSFunction::create(vm, this, 3, String(), cloneArrayBuffer, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.structuredCloneForStreamPrivateName(), JSFunction::create(vm, this, 1, String(), structuredCloneForStream, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.streamClosedPrivateName(), jsNumber(1), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::ConstantInteger));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.streamClosingPrivateName(), jsNumber(2), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::ConstantInteger));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.streamErroredPrivateName(), jsNumber(3), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::ConstantInteger));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.streamReadablePrivateName(), jsNumber(4), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::ConstantInteger));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.streamWaitingPrivateName(), jsNumber(5), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::ConstantInteger));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.streamWritablePrivateName(), jsNumber(6), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::ConstantInteger));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.isAbortSignalPrivateName(), JSFunction::create(vm, this, 1, String(), isAbortSignal, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.getInternalWritableStreamPrivateName(), JSFunction::create(vm, this, 1, String(), getInternalWritableStream, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.createWritableStreamFromInternalPrivateName(), JSFunction::create(vm, this, 1, String(), createWritableStreamFromInternal, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.fulfillModuleSyncPrivateName(), JSFunction::create(vm, this, 1, String(), functionFulfillModuleSync, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::Function));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(builtinNames.directPrivateName(), JSFunction::create(vm, this, 1, String(), functionGetDirectStreamDetails, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::Function));
- extraStaticGlobals.uncheckedAppend(GlobalPropertyInfo(vm.propertyNames->builtinNames().ArrayBufferPrivateName(), arrayBufferConstructor(), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly));
-
- this->addStaticGlobals(extraStaticGlobals.data(), extraStaticGlobals.size());
-
- extraStaticGlobals.releaseBuffer();
+ PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | 0 },
+
+ // TODO: Remove the "Bun.lazy" symbol
+ // The reason we cant do this easily is our tests rely on this being public to test the internals.
+ GlobalPropertyInfo { JSC::Identifier::fromUid(vm.symbolRegistry().symbolForKey(MAKE_STATIC_STRING_IMPL("Bun.lazy"))),
+ $lazy,
+ PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | 0 },
+
+ GlobalPropertyInfo { builtinNames.lazyPrivateName(),
+ $lazy,
+ PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | 0 },
+
+ GlobalPropertyInfo(builtinNames.makeThisTypeErrorPrivateName(), JSFunction::create(vm, this, 2, String(), makeThisTypeErrorForBuiltins, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+ GlobalPropertyInfo(builtinNames.makeGetterTypeErrorPrivateName(), JSFunction::create(vm, this, 2, String(), makeGetterTypeErrorForBuiltins, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+ GlobalPropertyInfo(builtinNames.makeDOMExceptionPrivateName(), JSFunction::create(vm, this, 2, String(), makeDOMExceptionForBuiltins, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+ GlobalPropertyInfo(builtinNames.whenSignalAbortedPrivateName(), JSFunction::create(vm, this, 2, String(), whenSignalAborted, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+ GlobalPropertyInfo(builtinNames.cloneArrayBufferPrivateName(), JSFunction::create(vm, this, 3, String(), cloneArrayBuffer, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+ GlobalPropertyInfo(builtinNames.structuredCloneForStreamPrivateName(), JSFunction::create(vm, this, 1, String(), structuredCloneForStream, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+ GlobalPropertyInfo(builtinNames.isAbortSignalPrivateName(), JSFunction::create(vm, this, 1, String(), isAbortSignal, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+ GlobalPropertyInfo(builtinNames.getInternalWritableStreamPrivateName(), JSFunction::create(vm, this, 1, String(), getInternalWritableStream, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+ GlobalPropertyInfo(builtinNames.createWritableStreamFromInternalPrivateName(), JSFunction::create(vm, this, 1, String(), createWritableStreamFromInternal, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+ GlobalPropertyInfo(builtinNames.fulfillModuleSyncPrivateName(), JSFunction::create(vm, this, 1, String(), functionFulfillModuleSync, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+ GlobalPropertyInfo(builtinNames.directPrivateName(), JSFunction::create(vm, this, 1, String(), functionGetDirectStreamDetails, ImplementationVisibility::Public), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+ GlobalPropertyInfo(vm.propertyNames->builtinNames().ArrayBufferPrivateName(), arrayBufferConstructor(), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+ GlobalPropertyInfo(builtinNames.LoaderPrivateName(), this->moduleLoader(), PropertyAttribute::DontDelete | 0),
+ GlobalPropertyInfo(builtinNames.internalModuleRegistryPrivateName(), this->internalModuleRegistry(), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+ GlobalPropertyInfo(builtinNames.processBindingConstantsPrivateName(), this->processBindingConstants(), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+ GlobalPropertyInfo(builtinNames.requireMapPrivateName(), this->requireMap(), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | 0),
+ };
+ addStaticGlobals(staticGlobals, std::size(staticGlobals));
+
+ // TODO: most/all of these private properties can be made as static globals.
+ // i've noticed doing it as is will work somewhat but getDirect() wont be able to find them
putDirectBuiltinFunction(vm, this, builtinNames.createFIFOPrivateName(), streamInternalsCreateFIFOCodeGenerator(vm), PropertyAttribute::Builtin | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
putDirectBuiltinFunction(vm, this, builtinNames.createEmptyReadableStreamPrivateName(), readableStreamCreateEmptyReadableStreamCodeGenerator(vm), PropertyAttribute::Builtin | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
+ putDirectBuiltinFunction(vm, this, builtinNames.createUsedReadableStreamPrivateName(), readableStreamCreateUsedReadableStreamCodeGenerator(vm), PropertyAttribute::Builtin | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
putDirectBuiltinFunction(vm, this, builtinNames.consumeReadableStreamPrivateName(), readableStreamConsumeReadableStreamCodeGenerator(vm), PropertyAttribute::Builtin | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
-
- putDirect(vm, builtinNames.LoaderPrivateName(), this->moduleLoader(), 0);
putDirectBuiltinFunction(vm, this, builtinNames.createNativeReadableStreamPrivateName(), readableStreamCreateNativeReadableStreamCodeGenerator(vm), PropertyAttribute::Builtin | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
-
putDirectBuiltinFunction(vm, this, builtinNames.requireESMPrivateName(), importMetaObjectRequireESMCodeGenerator(vm), PropertyAttribute::Builtin | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
putDirectBuiltinFunction(vm, this, builtinNames.loadCJS2ESMPrivateName(), importMetaObjectLoadCJS2ESMCodeGenerator(vm), PropertyAttribute::Builtin | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
putDirectBuiltinFunction(vm, this, builtinNames.internalRequirePrivateName(), importMetaObjectInternalRequireCodeGenerator(vm), PropertyAttribute::Builtin | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
putDirectBuiltinFunction(vm, this, builtinNames.requireNativeModulePrivateName(), moduleRequireNativeModuleCodeGenerator(vm), PropertyAttribute::Builtin | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
- putDirectNativeFunction(vm, this, builtinNames.createUninitializedArrayBufferPrivateName(), 1, functionCreateUninitializedArrayBuffer, ImplementationVisibility::Public, NoIntrinsic, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::Function);
- putDirectNativeFunction(vm, this, builtinNames.resolveSyncPrivateName(), 1, functionImportMeta__resolveSyncPrivate, ImplementationVisibility::Public, NoIntrinsic, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::Function);
- putDirectNativeFunction(vm, this, builtinNames.createInternalModuleByIdPrivateName(), 1, InternalModuleRegistry::jsCreateInternalModuleById, ImplementationVisibility::Public, NoIntrinsic, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::Function);
- putDirect(vm, builtinNames.internalModuleRegistryPrivateName(), this->internalModuleRegistry(), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
- putDirect(vm, builtinNames.processBindingConstantsPrivateName(), this->processBindingConstants(), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "process"_s), JSC::CustomGetterSetter::create(vm, property_lazyProcessGetter, property_lazyProcessSetter),
- JSC::PropertyAttribute::CustomAccessor | 0);
- putDirect(vm, JSC::Identifier::fromString(vm, "performance"_s), this->performanceObject(),
- 0);
+ putDirectBuiltinFunction(vm, this, builtinNames.overridableRequirePrivateName(), moduleOverridableRequireCodeGenerator(vm), 0);
- putDirect(vm, JSC::Identifier::fromString(vm, "self"_s), this->globalThis(), JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::DontDelete | 0);
- putDirect(vm, JSC::Identifier::fromString(vm, "global"_s), this->globalThis(), JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::DontDelete | 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "URL"_s), JSC::CustomGetterSetter::create(vm, JSDOMURL_getter, nullptr),
- JSC::PropertyAttribute::DontDelete | 0);
-
- putDirectCustomAccessor(vm, builtinNames.lazyStreamPrototypeMapPrivateName(), JSC::CustomGetterSetter::create(vm, functionLazyLoadStreamPrototypeMap_getter, nullptr),
- JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "navigator"_s), JSC::CustomGetterSetter::create(vm, functionLazyNavigatorGetter, nullptr),
- JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "ResolveError"_s), JSC::CustomGetterSetter::create(vm, functionResolveMessageGetter, nullptr),
- JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "ResolveMessage"_s), JSC::CustomGetterSetter::create(vm, functionResolveMessageGetter, nullptr),
- JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "BuildError"_s), JSC::CustomGetterSetter::create(vm, functionBuildMessageGetter, nullptr),
- JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "BuildMessage"_s), JSC::CustomGetterSetter::create(vm, functionBuildMessageGetter, nullptr),
- JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | 0);
-
- putDirect(vm, builtinNames.requireMapPrivateName(), this->requireMap(),
- JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "Request"_s), JSC::CustomGetterSetter::create(vm, JSRequest_getter, JSRequest_setter),
- JSC::PropertyAttribute::DontDelete | 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "Response"_s), JSC::CustomGetterSetter::create(vm, JSResponse_getter, JSResponse_setter),
- JSC::PropertyAttribute::DontDelete | 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "TextDecoder"_s), JSC::CustomGetterSetter::create(vm, JSTextDecoder_getter, JSTextDecoder_setter),
- JSC::PropertyAttribute::DontDelete | 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "Blob"_s), JSC::CustomGetterSetter::create(vm, JSBlob_getter, JSBlob_setter),
- JSC::PropertyAttribute::DontDelete | 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "HTMLRewriter"_s), JSC::CustomGetterSetter::create(vm, JSHTMLRewriter_getter, JSHTMLRewriter_setter),
- JSC::PropertyAttribute::DontDelete | 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "Crypto"_s), JSC::CustomGetterSetter::create(vm, JSCrypto_getter, JSCrypto_setter),
- JSC::PropertyAttribute::DontDelete | 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "File"_s), JSC::CustomGetterSetter::create(vm, JSDOMFileConstructor_getter, JSDOMFileConstructor_setter),
- JSC::PropertyAttribute::DontDelete | 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "DOMException"_s), JSC::CustomGetterSetter::create(vm, JSDOMException_getter, nullptr),
- JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "Event"_s), JSC::CustomGetterSetter::create(vm, JSEvent_getter, nullptr),
- JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "EventTarget"_s), JSC::CustomGetterSetter::create(vm, JSEventTarget_getter, nullptr),
- JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "AbortController"_s), JSC::CustomGetterSetter::create(vm, JSDOMAbortController_getter, nullptr),
- JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "AbortSignal"_s), JSC::CustomGetterSetter::create(vm, JSDOMAbortSignal_getter, nullptr),
- JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "$_BunCommonJSModule_$"_s), JSC::CustomGetterSetter::create(vm, BunCommonJSModule_getter, nullptr),
- JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "EventSource"_s), JSC::CustomGetterSetter::create(vm, EventSource_getter, EventSource_setter), 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "onmessage"_s), JSC::CustomGetterSetter::create(vm, globalGetterOnMessage, globalSetterOnMessage), 0);
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "onerror"_s), JSC::CustomGetterSetter::create(vm, globalGetterOnError, globalSetterOnError), 0);
-
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "crypto"_s), JSC::CustomGetterSetter::create(vm, property_lazyCryptoGetter, nullptr),
- JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete | 0);
-
- auto bufferAccessor = JSC::CustomGetterSetter::create(vm, JSBuffer_getter, JSBuffer_setter);
- auto realBufferAccessor = JSC::CustomGetterSetter::create(vm, JSBuffer_privateGetter, nullptr);
-
- //
- putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().BufferPublicName(), bufferAccessor,
- JSC::PropertyAttribute::DontDelete | 0);
- putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().BufferPrivateName(), realBufferAccessor,
- JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
-
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("BroadcastChannel"_s, JSBroadcastChannel);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("CloseEvent"_s, JSCloseEvent);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("CustomEvent"_s, JSCustomEvent);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("DOMException"_s, JSDOMException);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("ErrorEvent"_s, JSErrorEvent);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("Event"_s, JSEvent);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("EventTarget"_s, JSEventTarget);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("FormData"_s, JSDOMFormData);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("Headers"_s, JSFetchHeaders);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("MessageChannel"_s, JSMessageChannel);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("MessageEvent"_s, JSMessageEvent);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("MessagePort"_s, JSMessagePort);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("TextEncoder"_s, JSTextEncoder);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("URLSearchParams"_s, JSURLSearchParams);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("WebSocket"_s, JSWebSocket);
- PUT_WEBCORE_GENERATED_CONSTRUCTOR("Worker"_s, JSWorker);
-
- putDirectCustomAccessor(vm, builtinNames.TransformStreamPublicName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_TransformStreamConstructor, nullptr), attributesForStructure(static_cast<unsigned>(JSC::PropertyAttribute::DontEnum)));
- putDirectCustomAccessor(vm, builtinNames.TransformStreamPrivateName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_TransformStreamConstructor, nullptr), attributesForStructure(static_cast<unsigned>(JSC::PropertyAttribute::DontEnum)));
- putDirectCustomAccessor(vm, builtinNames.TransformStreamDefaultControllerPublicName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_TransformStreamDefaultControllerConstructor, nullptr), attributesForStructure(static_cast<unsigned>(JSC::PropertyAttribute::DontEnum)));
- putDirectCustomAccessor(vm, builtinNames.TransformStreamDefaultControllerPrivateName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_TransformStreamDefaultControllerConstructor, nullptr), attributesForStructure(static_cast<unsigned>(JSC::PropertyAttribute::DontEnum)));
- putDirectCustomAccessor(vm, builtinNames.ReadableByteStreamControllerPrivateName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_ReadableByteStreamControllerConstructor, nullptr), attributesForStructure(JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly));
- putDirectCustomAccessor(vm, builtinNames.ReadableStreamPrivateName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_ReadableStreamConstructor, nullptr), attributesForStructure(JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly));
- putDirectCustomAccessor(vm, builtinNames.ReadableStreamBYOBReaderPrivateName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_ReadableStreamBYOBReaderConstructor, nullptr), attributesForStructure(JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly));
- putDirectCustomAccessor(vm, builtinNames.ReadableStreamBYOBRequestPrivateName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_ReadableStreamBYOBRequestConstructor, nullptr), attributesForStructure(JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly));
- putDirectCustomAccessor(vm, builtinNames.ReadableStreamDefaultControllerPrivateName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_ReadableStreamDefaultControllerConstructor, nullptr), attributesForStructure(JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly));
- putDirectCustomAccessor(vm, builtinNames.ReadableStreamDefaultReaderPrivateName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_ReadableStreamDefaultReaderConstructor, nullptr), attributesForStructure(JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly));
- putDirectCustomAccessor(vm, builtinNames.WritableStreamPrivateName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_WritableStreamConstructor, nullptr), attributesForStructure(JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly));
- putDirectCustomAccessor(vm, builtinNames.WritableStreamDefaultControllerPrivateName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_WritableStreamDefaultControllerConstructor, nullptr), attributesForStructure(JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly));
- putDirectCustomAccessor(vm, builtinNames.WritableStreamDefaultWriterPrivateName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_WritableStreamDefaultWriterConstructor, nullptr), attributesForStructure(JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly));
- putDirectCustomAccessor(vm, builtinNames.AbortSignalPrivateName(), CustomGetterSetter::create(vm, JSDOMAbortSignal_getter, nullptr), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
- putDirectCustomAccessor(vm, builtinNames.ReadableByteStreamControllerPublicName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_ReadableByteStreamControllerConstructor, nullptr), JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
- putDirectCustomAccessor(vm, builtinNames.ReadableStreamPublicName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_ReadableStreamConstructor, nullptr), JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
- putDirectCustomAccessor(vm, builtinNames.ReadableStreamBYOBReaderPublicName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_ReadableStreamBYOBReaderConstructor, nullptr), JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
- putDirectCustomAccessor(vm, builtinNames.ReadableStreamBYOBRequestPublicName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_ReadableStreamBYOBRequestConstructor, nullptr), JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
- putDirectCustomAccessor(vm, builtinNames.ReadableStreamDefaultControllerPublicName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_ReadableStreamDefaultControllerConstructor, nullptr), JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
- putDirectCustomAccessor(vm, builtinNames.ReadableStreamDefaultReaderPublicName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_ReadableStreamDefaultReaderConstructor, nullptr), JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
- putDirectCustomAccessor(vm, builtinNames.WritableStreamPublicName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_WritableStreamConstructor, nullptr), JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
- putDirectCustomAccessor(vm, builtinNames.WritableStreamDefaultControllerPublicName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_WritableStreamDefaultControllerConstructor, nullptr), JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
- putDirectCustomAccessor(vm, builtinNames.WritableStreamDefaultWriterPublicName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_WritableStreamDefaultWriterConstructor, nullptr), JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
+ putDirectNativeFunction(vm, this, builtinNames.createUninitializedArrayBufferPrivateName(), 1, functionCreateUninitializedArrayBuffer, ImplementationVisibility::Public, NoIntrinsic, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
+ putDirectNativeFunction(vm, this, builtinNames.resolveSyncPrivateName(), 1, functionImportMeta__resolveSyncPrivate, ImplementationVisibility::Public, NoIntrinsic, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
+ putDirectNativeFunction(vm, this, builtinNames.createInternalModuleByIdPrivateName(), 1, InternalModuleRegistry::jsCreateInternalModuleById, ImplementationVisibility::Public, NoIntrinsic, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
putDirectNativeFunction(vm, this,
builtinNames.createCommonJSModulePrivateName(),
@@ -4006,42 +3729,60 @@ void GlobalObject::addBuiltinGlobals(JSC::VM& vm)
Bun::jsFunctionCreateCommonJSModule,
ImplementationVisibility::Public,
NoIntrinsic,
- JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ PropertyAttribute::ReadOnly | PropertyAttribute::DontDelete | 0);
putDirectNativeFunction(vm, this,
builtinNames.evaluateCommonJSModulePrivateName(),
2,
Bun::jsFunctionLoadModule,
ImplementationVisibility::Public,
NoIntrinsic,
- JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "ByteLengthQueuingStrategy"_s), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_ByteLengthQueuingStrategyConstructor, nullptr), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "CountQueuingStrategy"_s), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_CountQueuingStrategyConstructor, nullptr), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "SubtleCrypto"_s), JSC::CustomGetterSetter::create(vm, getterSubtleCryptoConstructor, nullptr), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
- putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "CryptoKey"_s), JSC::CustomGetterSetter::create(vm, getterCryptoKeyConstructor, nullptr), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
+ PropertyAttribute::ReadOnly | PropertyAttribute::DontDelete | 0);
+
+ putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().BufferPrivateName(), JSC::CustomGetterSetter::create(vm, JSBuffer_getter, nullptr), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::CustomAccessorOrValue);
+ putDirectCustomAccessor(vm, builtinNames.lazyStreamPrototypeMapPrivateName(), JSC::CustomGetterSetter::create(vm, functionLazyLoadStreamPrototypeMap_getter, nullptr), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::CustomAccessorOrValue);
+ putDirectCustomAccessor(vm, builtinNames.TransformStreamPrivateName(), CustomGetterSetter::create(vm, TransformStream_getter, nullptr), attributesForStructure(static_cast<unsigned>(PropertyAttribute::DontEnum)) | PropertyAttribute::CustomAccessorOrValue);
+ putDirectCustomAccessor(vm, builtinNames.TransformStreamDefaultControllerPrivateName(), CustomGetterSetter::create(vm, TransformStreamDefaultController_getter, nullptr), attributesForStructure(static_cast<unsigned>(PropertyAttribute::DontEnum)) | PropertyAttribute::CustomAccessorOrValue);
+ putDirectCustomAccessor(vm, builtinNames.ReadableByteStreamControllerPrivateName(), CustomGetterSetter::create(vm, ReadableByteStreamController_getter, nullptr), attributesForStructure(PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly) | PropertyAttribute::CustomAccessorOrValue);
+ putDirectCustomAccessor(vm, builtinNames.ReadableStreamPrivateName(), CustomGetterSetter::create(vm, ReadableStream_getter, nullptr), attributesForStructure(PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly) | PropertyAttribute::CustomAccessorOrValue);
+ putDirectCustomAccessor(vm, builtinNames.ReadableStreamBYOBReaderPrivateName(), CustomGetterSetter::create(vm, ReadableStreamBYOBReader_getter, nullptr), attributesForStructure(PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly) | PropertyAttribute::CustomAccessorOrValue);
+ putDirectCustomAccessor(vm, builtinNames.ReadableStreamBYOBRequestPrivateName(), CustomGetterSetter::create(vm, ReadableStreamBYOBRequest_getter, nullptr), attributesForStructure(PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly) | PropertyAttribute::CustomAccessorOrValue);
+ putDirectCustomAccessor(vm, builtinNames.ReadableStreamDefaultControllerPrivateName(), CustomGetterSetter::create(vm, ReadableStreamDefaultController_getter, nullptr), attributesForStructure(PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly) | PropertyAttribute::CustomAccessorOrValue);
+ putDirectCustomAccessor(vm, builtinNames.ReadableStreamDefaultReaderPrivateName(), CustomGetterSetter::create(vm, ReadableStreamDefaultReader_getter, nullptr), attributesForStructure(PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly) | PropertyAttribute::CustomAccessorOrValue);
+ putDirectCustomAccessor(vm, builtinNames.WritableStreamPrivateName(), CustomGetterSetter::create(vm, WritableStream_getter, nullptr), attributesForStructure(PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly) | PropertyAttribute::CustomAccessorOrValue);
+ putDirectCustomAccessor(vm, builtinNames.WritableStreamDefaultControllerPrivateName(), CustomGetterSetter::create(vm, WritableStreamDefaultController_getter, nullptr), attributesForStructure(PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly) | PropertyAttribute::CustomAccessorOrValue);
+ putDirectCustomAccessor(vm, builtinNames.WritableStreamDefaultWriterPrivateName(), CustomGetterSetter::create(vm, WritableStreamDefaultWriter_getter, nullptr), attributesForStructure(PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly) | PropertyAttribute::CustomAccessorOrValue);
+ putDirectCustomAccessor(vm, builtinNames.AbortSignalPrivateName(), CustomGetterSetter::create(vm, AbortSignal_getter, nullptr), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::CustomAccessorOrValue);
+
+ // ----- Public Properties -----
+
+ // a direct accessor (uses js functions for get and set) cannot be on the lookup table. i think.
+ putDirectAccessor(
+ this,
+ builtinNames.selfPublicName(),
+ JSC::GetterSetter::create(
+ vm,
+ this,
+ JSFunction::create(vm, this, 0, "get"_s, functionGetSelf, ImplementationVisibility::Public),
+ JSFunction::create(vm, this, 0, "set"_s, functionSetSelf, ImplementationVisibility::Public)),
+ PropertyAttribute::Accessor | 0);
- putDirectNativeFunction(vm, this,
- Identifier::fromString(vm, "addEventListener"_s),
- 2,
- jsFunctionAddEventListener,
- ImplementationVisibility::Public,
- NoIntrinsic,
- JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ // TODO: this should be usable on the lookup table. it crashed las time i tried it
+ putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "onmessage"_s), JSC::CustomGetterSetter::create(vm, globalOnMessage, setGlobalOnMessage), 0);
+ putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "onerror"_s), JSC::CustomGetterSetter::create(vm, globalOnError, setGlobalOnError), 0);
- putDirectNativeFunction(vm, this,
- Identifier::fromString(vm, "dispatchEvent"_s),
- 1,
- jsFunctionDispatchEvent,
- ImplementationVisibility::Public,
- NoIntrinsic,
- JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ // ----- Extensions to Built-in objects -----
- putDirectNativeFunction(vm, this,
- Identifier::fromString(vm, "removeEventListener"_s),
- 2,
- jsFunctionRemoveEventListener,
- ImplementationVisibility::Public,
- NoIntrinsic,
- JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::JSObject* errorConstructor = this->errorConstructor();
+ errorConstructor->putDirectNativeFunction(vm, this, JSC::Identifier::fromString(vm, "captureStackTrace"_s), 2, errorConstructorFuncCaptureStackTrace, ImplementationVisibility::Public, JSC::NoIntrinsic, PropertyAttribute::DontEnum | 0);
+ errorConstructor->putDirectNativeFunction(vm, this, JSC::Identifier::fromString(vm, "appendStackTrace"_s), 2, errorConstructorFuncAppendStackTrace, ImplementationVisibility::Private, JSC::NoIntrinsic, PropertyAttribute::DontEnum | 0);
+ errorConstructor->putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "prepareStackTrace"_s), JSC::CustomGetterSetter::create(vm, errorConstructorPrepareStackTraceGetter, errorConstructorPrepareStackTraceSetter), PropertyAttribute::DontEnum | PropertyAttribute::CustomValue);
+
+ JSC::JSObject* consoleObject = this->get(this, JSC::Identifier::fromString(vm, "console"_s)).getObject();
+ consoleObject->putDirectBuiltinFunction(vm, this, vm.propertyNames->asyncIteratorSymbol, consoleObjectAsyncIteratorCodeGenerator(vm), PropertyAttribute::Builtin | 0);
+ consoleObject->putDirectBuiltinFunction(vm, this, clientData->builtinNames().writePublicName(), consoleObjectWriteCodeGenerator(vm), PropertyAttribute::Builtin | 0);
+ consoleObject->putDirectCustomAccessor(vm, Identifier::fromString(vm, "Console"_s), CustomGetterSetter::create(vm, getConsoleConstructor, nullptr), PropertyAttribute::CustomValue | 0);
+ consoleObject->putDirectCustomAccessor(vm, Identifier::fromString(vm, "_stdout"_s), CustomGetterSetter::create(vm, getConsoleStdout, nullptr), PropertyAttribute::DontEnum | PropertyAttribute::CustomValue | 0);
+ consoleObject->putDirectCustomAccessor(vm, Identifier::fromString(vm, "_stderr"_s), CustomGetterSetter::create(vm, getConsoleStderr, nullptr), PropertyAttribute::DontEnum | PropertyAttribute::CustomValue | 0);
}
extern "C" bool JSC__JSGlobalObject__startRemoteInspector(JSC__JSGlobalObject* globalObject, unsigned char* host, uint16_t arg1)
@@ -4104,29 +3845,8 @@ void GlobalObject::visitChildrenImpl(JSCell* cell, Visitor& visitor)
visitor.append(thisObject->m_readableStreamToFormData);
visitor.append(thisObject->m_nodeModuleOverriddenResolveFilename);
- visitor.append(thisObject->m_JSBlobSetterValue);
- visitor.append(thisObject->m_JSBroadcastChannelSetterValue);
- visitor.append(thisObject->m_JSBufferSetterValue);
- visitor.append(thisObject->m_JSCloseEventSetterValue);
- visitor.append(thisObject->m_JSCustomEventSetterValue);
- visitor.append(thisObject->m_JSDOMExceptionSetterValue);
- visitor.append(thisObject->m_JSDOMFormDataSetterValue);
- visitor.append(thisObject->m_JSErrorEventSetterValue);
- visitor.append(thisObject->m_JSEventSetterValue);
- visitor.append(thisObject->m_JSEventTargetSetterValue);
- visitor.append(thisObject->m_JSFetchHeadersSetterValue);
- visitor.append(thisObject->m_JSMessageChannelSetterValue);
- visitor.append(thisObject->m_JSMessageEventSetterValue);
- visitor.append(thisObject->m_JSMessagePortSetterValue);
- visitor.append(thisObject->m_JSRequestSetterValue);
- visitor.append(thisObject->m_JSResponseSetterValue);
- visitor.append(thisObject->m_JSTextDecoderSetterValue);
- visitor.append(thisObject->m_JSTextEncoderSetterValue);
- visitor.append(thisObject->m_JSURLSearchParamsSetterValue);
- visitor.append(thisObject->m_JSWebSocketSetterValue);
- visitor.append(thisObject->m_JSWorkerSetterValue);
-
visitor.append(thisObject->m_nextTickQueue);
+ visitor.append(thisObject->m_errorConstructorPrepareStackTraceValue);
thisObject->m_JSArrayBufferSinkClassStructure.visit(visitor);
thisObject->m_JSBufferListClassStructure.visit(visitor);
@@ -4157,17 +3877,19 @@ void GlobalObject::visitChildrenImpl(JSCell* cell, Visitor& visitor)
thisObject->m_performanceObject.visit(visitor);
thisObject->m_processEnvObject.visit(visitor);
thisObject->m_processObject.visit(visitor);
+ thisObject->m_bunObject.visit(visitor);
thisObject->m_subtleCryptoObject.visit(visitor);
thisObject->m_JSHTTPResponseController.visit(visitor);
thisObject->m_callSiteStructure.visit(visitor);
thisObject->m_emitReadableNextTickFunction.visit(visitor);
thisObject->m_JSBufferSubclassStructure.visit(visitor);
+ thisObject->m_JSCryptoKey.visit(visitor);
+
thisObject->m_cryptoObject.visit(visitor);
thisObject->m_JSDOMFileConstructor.visit(visitor);
thisObject->m_requireFunctionUnbound.visit(visitor);
thisObject->m_requireResolveFunctionUnbound.visit(visitor);
- thisObject->m_processBindingConstants.visit(visitor);
thisObject->m_importMetaObjectStructure.visit(visitor);
thisObject->m_asyncBoundFunctionStructure.visit(visitor);
thisObject->m_internalModuleRegistry.visit(visitor);
@@ -4180,6 +3902,7 @@ void GlobalObject::visitChildrenImpl(JSCell* cell, Visitor& visitor)
thisObject->m_commonJSModuleObjectStructure.visit(visitor);
thisObject->m_memoryFootprintStructure.visit(visitor);
thisObject->m_commonJSFunctionArgumentsStructure.visit(visitor);
+ thisObject->m_JSSocketAddressStructure.visit(visitor);
thisObject->m_cachedGlobalObjectStructure.visit(visitor);
thisObject->m_cachedGlobalProxyStructure.visit(visitor);
@@ -4291,7 +4014,7 @@ template void GlobalObject::visitOutputConstraints(JSCell*, SlotVisitor&);
// void GlobalObject::destroy(JSCell* cell)
// {
-// static_cast<Zig::GlobalObject*>(cell)->Zig::GlobalObject::~Zig::GlobalObject();
+// jsCast<Zig::GlobalObject*>(cell)->Zig::GlobalObject::~Zig::GlobalObject();
// }
// template<typename Visitor>
@@ -4351,16 +4074,45 @@ extern "C" void JSC__JSGlobalObject__queueMicrotaskCallback(Zig::GlobalObject* g
globalObject->queueMicrotask(function, JSValue(bitwise_cast<double>(reinterpret_cast<uintptr_t>(ptr))), JSValue(bitwise_cast<double>(reinterpret_cast<uintptr_t>(callback))), jsUndefined(), jsUndefined());
}
-JSC::Identifier GlobalObject::moduleLoaderResolve(JSGlobalObject* globalObject,
+JSC::Identifier GlobalObject::moduleLoaderResolve(JSGlobalObject* jsGlobalObject,
JSModuleLoader* loader, JSValue key,
JSValue referrer, JSValue origin)
{
+ Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(jsGlobalObject);
+
ErrorableString res;
res.success = false;
- BunString keyZ = Bun::toString(globalObject, key);
- BunString referrerZ = referrer && !referrer.isUndefinedOrNull() && referrer.isString() ? Bun::toString(globalObject, referrer) : BunStringEmpty;
+
+ if (key.isString()) {
+ if (auto* virtualModules = globalObject->onLoadPlugins.virtualModules) {
+ auto keyString = key.toWTFString(globalObject);
+ if (virtualModules->contains(keyString)) {
+ return JSC::Identifier::fromString(globalObject->vm(), keyString);
+ }
+ }
+ }
+
+ BunString keyZ;
+ if (key.isString()) {
+ auto moduleName = jsCast<JSString*>(key)->value(globalObject);
+ if (moduleName.startsWith("file://"_s)) {
+ auto url = WTF::URL(moduleName);
+ if (url.isValid() && !url.isEmpty()) {
+ keyZ = Bun::toStringRef(url.fileSystemPath());
+ } else {
+ keyZ = Bun::toStringRef(moduleName);
+ }
+ } else {
+ keyZ = Bun::toStringRef(moduleName);
+ }
+ } else {
+ keyZ = Bun::toStringRef(globalObject, key);
+ }
+ BunString referrerZ = referrer && !referrer.isUndefinedOrNull() && referrer.isString() ? Bun::toStringRef(globalObject, referrer) : BunStringEmpty;
ZigString queryString = { 0, 0 };
Zig__GlobalObject__resolve(&res, globalObject, &keyZ, &referrerZ, &queryString);
+ keyZ.deref();
+ referrerZ.deref();
if (res.success) {
if (queryString.len > 0) {
@@ -4375,25 +4127,60 @@ JSC::Identifier GlobalObject::moduleLoaderResolve(JSGlobalObject* globalObject,
}
}
-JSC::JSInternalPromise* GlobalObject::moduleLoaderImportModule(JSGlobalObject* globalObject,
+JSC::JSInternalPromise* GlobalObject::moduleLoaderImportModule(JSGlobalObject* jsGlobalObject,
JSModuleLoader*,
JSString* moduleNameValue,
JSValue parameters,
const SourceOrigin& sourceOrigin)
{
+ auto* globalObject = reinterpret_cast<Zig::GlobalObject*>(jsGlobalObject);
JSC::VM& vm = globalObject->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
auto* promise = JSC::JSInternalPromise::create(vm, globalObject->internalPromiseStructure());
RETURN_IF_EXCEPTION(scope, promise->rejectWithCaughtException(globalObject, scope));
+ if (auto* virtualModules = globalObject->onLoadPlugins.virtualModules) {
+ auto keyString = moduleNameValue->value(globalObject);
+ if (virtualModules->contains(keyString)) {
+ auto resolvedIdentifier = JSC::Identifier::fromString(vm, keyString);
+
+ auto result = JSC::importModule(globalObject, resolvedIdentifier,
+ JSC::jsUndefined(), parameters, JSC::jsUndefined());
+
+ RETURN_IF_EXCEPTION(scope, promise->rejectWithCaughtException(globalObject, scope));
+ return result;
+ }
+ }
+
auto sourceURL = sourceOrigin.url();
ErrorableString resolved;
- auto moduleNameZ = Bun::toString(globalObject, moduleNameValue);
- auto sourceOriginZ = sourceURL.isEmpty() ? BunStringCwd : Bun::toString(sourceURL.fileSystemPath());
+ BunString moduleNameZ;
+
+ auto moduleName = moduleNameValue->value(globalObject);
+#if BUN_DEBUG
+ auto startRefCount = moduleName.impl()->refCount();
+#endif
+ if (moduleName.startsWith("file://"_s)) {
+ auto url = WTF::URL(moduleName);
+ if (url.isValid() && !url.isEmpty()) {
+ moduleNameZ = Bun::toStringRef(url.fileSystemPath());
+ } else {
+ moduleNameZ = Bun::toStringRef(moduleName);
+ }
+ } else {
+ moduleNameZ = Bun::toStringRef(moduleName);
+ }
+ auto sourceOriginZ = sourceURL.isEmpty() ? BunStringCwd : Bun::toStringRef(sourceURL.fileSystemPath());
ZigString queryString = { 0, 0 };
resolved.success = false;
Zig__GlobalObject__resolve(&resolved, globalObject, &moduleNameZ, &sourceOriginZ, &queryString);
+ moduleNameZ.deref();
+ sourceOriginZ.deref();
+#if BUN_DEBUG
+ // TODO: ASSERT doesnt work right now
+ RELEASE_ASSERT(startRefCount == moduleName.impl()->refCount());
+#endif
if (!resolved.success) {
throwException(scope, resolved.result.err, globalObject);
return promise->rejectWithCaughtException(globalObject, scope);
@@ -4549,5 +4336,9 @@ GlobalObject::PromiseFunctions GlobalObject::promiseHandlerID(EncodedJSValue (*h
}
#include "ZigGeneratedClasses+lazyStructureImpl.h"
+#include "ZigGlobalObject.lut.h"
+
+const JSC::ClassInfo GlobalObject::s_info = { "GlobalObject"_s, &Base::s_info, &bunGlobalObjectTable, nullptr,
+ CREATE_METHOD_TABLE(GlobalObject) };
} // namespace Zig
diff --git a/src/bun.js/bindings/ZigGlobalObject.h b/src/bun.js/bindings/ZigGlobalObject.h
index 29c1cd09c..19630d4b7 100644
--- a/src/bun.js/bindings/ZigGlobalObject.h
+++ b/src/bun.js/bindings/ZigGlobalObject.h
@@ -13,21 +13,22 @@ namespace JSC {
class Structure;
class Identifier;
class LazyClassStructure;
-
-} // namespace JSC
-
-namespace JSC {
-
enum class JSPromiseRejectionOperation : unsigned;
-
-}
+} // namespace JSC
namespace WebCore {
class ScriptExecutionContext;
class DOMGuardedObject;
class EventLoopTask;
class DOMWrapperWorld;
-}
+class GlobalScope;
+class SubtleCrypto;
+class EventTarget;
+} // namespace WebCore
+
+namespace Bun {
+class InternalModuleRegistry;
+} // namespace Bun
#include "root.h"
@@ -43,37 +44,9 @@ class DOMWrapperWorld;
#include "BunPlugin.h"
#include "JSMockFunction.h"
#include "InternalModuleRegistry.h"
-#include "ProcessBindingConstants.h"
-
-namespace WebCore {
-class GlobalScope;
-class SubtleCrypto;
-class EventTarget;
-}
extern "C" void Bun__reportError(JSC__JSGlobalObject*, JSC__JSValue);
extern "C" void Bun__reportUnhandledError(JSC__JSGlobalObject*, JSC::EncodedJSValue);
-// defined in ModuleLoader.cpp
-extern "C" JSC::EncodedJSValue jsFunctionOnLoadObjectResultResolve(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame);
-extern "C" JSC::EncodedJSValue jsFunctionOnLoadObjectResultReject(JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame);
-
-// #include "EventTarget.h"
-
-// namespace WebCore {
-// class GlobalEventTarget : public EventTargetWithInlineData, public ContextDestructionObserver {
-// WTF_MAKE_ISO_ALLOCATED(GlobalEventTarget);
-
-// public:
-// static Ref<GlobalEventTarget> create(ScriptExecutionContext&);
-
-// EventTargetInterface eventTargetInterface() const final { return DOMWindowEventTargetInterfaceType; }
-// ScriptExecutionContext* scriptExecutionContext() const final { return ContextDestructionObserver::scriptExecutionContext(); }
-// void refEventTarget() final {}
-// void derefEventTarget() final {}
-// void eventListenersDidChange() final;
-// };
-
-// }
namespace Zig {
@@ -179,27 +152,17 @@ public:
void clearDOMGuardedObjects();
- static void createCallSitesFromFrames(JSC::JSGlobalObject* lexicalGlobalObject, JSCStackTrace& stackTrace, JSC::JSArray* callSites);
- JSC::JSValue formatStackTrace(JSC::VM& vm, JSC::JSGlobalObject* lexicalGlobalObject, JSC::JSObject* errorObject, JSC::JSArray* callSites);
+ static void createCallSitesFromFrames(Zig::GlobalObject* globalObject, JSC::JSGlobalObject* lexicalGlobalObject, JSCStackTrace& stackTrace, JSC::JSArray* callSites);
+ void formatStackTrace(JSC::VM& vm, JSC::JSGlobalObject* lexicalGlobalObject, JSC::JSObject* errorObject, JSC::JSArray* callSites, JSValue prepareStack = JSC::jsUndefined());
static void reportUncaughtExceptionAtEventLoop(JSGlobalObject*, JSC::Exception*);
static JSGlobalObject* deriveShadowRealmGlobalObject(JSGlobalObject* globalObject);
- static JSC::JSInternalPromise* moduleLoaderImportModule(JSGlobalObject*, JSC::JSModuleLoader*,
- JSC::JSString* moduleNameValue,
- JSC::JSValue parameters,
- const JSC::SourceOrigin&);
- static JSC::Identifier moduleLoaderResolve(JSGlobalObject*, JSC::JSModuleLoader*,
- JSC::JSValue keyValue, JSC::JSValue referrerValue,
- JSC::JSValue);
- static JSC::JSInternalPromise* moduleLoaderFetch(JSGlobalObject*, JSC::JSModuleLoader*,
- JSC::JSValue, JSC::JSValue, JSC::JSValue);
- static JSC::JSObject* moduleLoaderCreateImportMetaProperties(JSGlobalObject*,
- JSC::JSModuleLoader*, JSC::JSValue,
- JSC::JSModuleRecord*, JSC::JSValue);
- static JSC::JSValue moduleLoaderEvaluate(JSGlobalObject*, JSC::JSModuleLoader*, JSC::JSValue,
- JSC::JSValue, JSC::JSValue, JSC::JSValue, JSC::JSValue);
- static void promiseRejectionTracker(JSGlobalObject*, JSC::JSPromise*,
- JSC::JSPromiseRejectionOperation);
+ static JSC::JSInternalPromise* moduleLoaderImportModule(JSGlobalObject*, JSC::JSModuleLoader*, JSC::JSString* moduleNameValue, JSC::JSValue parameters, const JSC::SourceOrigin&);
+ static JSC::Identifier moduleLoaderResolve(JSGlobalObject*, JSC::JSModuleLoader*, JSC::JSValue keyValue, JSC::JSValue referrerValue, JSC::JSValue);
+ static JSC::JSInternalPromise* moduleLoaderFetch(JSGlobalObject*, JSC::JSModuleLoader*, JSC::JSValue, JSC::JSValue, JSC::JSValue);
+ static JSC::JSObject* moduleLoaderCreateImportMetaProperties(JSGlobalObject*, JSC::JSModuleLoader*, JSC::JSValue, JSC::JSModuleRecord*, JSC::JSValue);
+ static JSC::JSValue moduleLoaderEvaluate(JSGlobalObject*, JSC::JSModuleLoader*, JSC::JSValue, JSC::JSValue, JSC::JSValue, JSC::JSValue, JSC::JSValue);
+ static void promiseRejectionTracker(JSGlobalObject*, JSC::JSPromise*, JSC::JSPromiseRejectionOperation);
void setConsole(void* console);
WebCore::JSBuiltinInternalFunctions& builtinInternalFunctions() { return m_builtinInternalFunctions; }
JSC::Structure* FFIFunctionStructure() { return m_JSFFIFunctionStructure.getInitializedOnMainThread(this); }
@@ -215,6 +178,8 @@ public:
JSC::JSValue JSBufferPrototype() { return m_JSBufferClassStructure.prototypeInitializedOnMainThread(this); }
JSC::Structure* JSBufferSubclassStructure() { return m_JSBufferSubclassStructure.getInitializedOnMainThread(this); }
+ JSC::Structure* JSCryptoKeyStructure() { return m_JSCryptoKey.getInitializedOnMainThread(this); }
+
JSC::Structure* ArrayBufferSinkStructure() { return m_JSArrayBufferSinkClassStructure.getInitializedOnMainThread(this); }
JSC::JSObject* ArrayBufferSink() { return m_JSArrayBufferSinkClassStructure.constructorInitializedOnMainThread(this); }
JSC::JSValue ArrayBufferSinkPrototype() { return m_JSArrayBufferSinkClassStructure.prototypeInitializedOnMainThread(this); }
@@ -266,7 +231,8 @@ public:
JSObject* requireFunctionUnbound() { return m_requireFunctionUnbound.getInitializedOnMainThread(this); }
JSObject* requireResolveFunctionUnbound() { return m_requireResolveFunctionUnbound.getInitializedOnMainThread(this); }
Bun::InternalModuleRegistry* internalModuleRegistry() { return m_internalModuleRegistry.getInitializedOnMainThread(this); }
- Bun::ProcessBindingConstants* processBindingConstants() { return m_processBindingConstants.getInitializedOnMainThread(this); }
+
+ JSObject* processBindingConstants() { return m_processBindingConstants.getInitializedOnMainThread(this); }
JSObject* lazyRequireCacheObject() { return m_lazyRequireCacheObject.getInitializedOnMainThread(this); }
@@ -281,36 +247,28 @@ public:
Structure* AsyncContextFrameStructure() { return m_asyncBoundFunctionStructure.getInitializedOnMainThread(this); }
Structure* commonJSFunctionArgumentsStructure() { return m_commonJSFunctionArgumentsStructure.getInitializedOnMainThread(this); }
+ Structure* JSSocketAddressStructure() { return m_JSSocketAddressStructure.getInitializedOnMainThread(this); }
JSWeakMap* vmModuleContextMap() { return m_vmModuleContextMap.getInitializedOnMainThread(this); }
bool hasProcessObject() const { return m_processObject.isInitialized(); }
- JSC::JSObject* processObject()
- {
- return m_processObject.getInitializedOnMainThread(this);
- }
-
- JSC::JSObject* processEnvObject()
- {
- return m_processEnvObject.getInitializedOnMainThread(this);
- }
+ JSC::JSObject* processObject() { return m_processObject.getInitializedOnMainThread(this); }
+ JSC::JSObject* processEnvObject() { return m_processEnvObject.getInitializedOnMainThread(this); }
+ JSC::JSObject* bunObject() { return m_bunObject.getInitializedOnMainThread(this); }
void drainMicrotasks();
void handleRejectedPromises();
- void initGeneratedLazyClasses();
+ ALWAYS_INLINE void initGeneratedLazyClasses();
template<typename Visitor>
void visitGeneratedLazyClasses(GlobalObject*, Visitor&);
- void* bunVM() { return m_bunVM; }
+ ALWAYS_INLINE void* bunVM() { return m_bunVM; }
bool isThreadLocalDefaultGlobalObject = false;
- JSObject* subtleCrypto()
- {
- return m_subtleCryptoObject.getInitializedOnMainThread(this);
- }
+ JSObject* subtleCrypto() { return m_subtleCryptoObject.getInitializedOnMainThread(this); }
EncodedJSValue assignToStream(JSValue stream, JSValue controller);
@@ -377,6 +335,7 @@ public:
* For example, if you don't add the queueMicrotask functions to visitChildrenImpl(),
* those callbacks will eventually never be called anymore. But it'll work the first time!
*/
+ // TODO: these should use LazyProperty
mutable WriteBarrier<JSFunction> m_assignToStream;
mutable WriteBarrier<JSFunction> m_readableStreamToArrayBuffer;
mutable WriteBarrier<JSFunction> m_readableStreamToArrayBufferResolve;
@@ -390,28 +349,14 @@ public:
mutable WriteBarrier<JSFunction> m_nodeModuleOverriddenResolveFilename;
mutable WriteBarrier<Unknown> m_nextTickQueue;
+ // Value of $_BunCommonJSModule_$
mutable WriteBarrier<Unknown> m_BunCommonJSModuleValue;
- mutable WriteBarrier<Unknown> m_JSBroadcastChannelSetterValue;
- mutable WriteBarrier<Unknown> m_JSBufferSetterValue;
- mutable WriteBarrier<Unknown> m_JSCloseEventSetterValue;
- mutable WriteBarrier<Unknown> m_JSCustomEventSetterValue;
- mutable WriteBarrier<Unknown> m_JSDOMExceptionSetterValue;
- mutable WriteBarrier<Unknown> m_JSDOMFormDataSetterValue;
- mutable WriteBarrier<Unknown> m_JSErrorEventSetterValue;
- mutable WriteBarrier<Unknown> m_JSEventSetterValue;
- mutable WriteBarrier<Unknown> m_JSEventTargetSetterValue;
- mutable WriteBarrier<Unknown> m_JSFetchHeadersSetterValue;
- mutable WriteBarrier<Unknown> m_JSMessageChannelSetterValue;
- mutable WriteBarrier<Unknown> m_JSMessageEventSetterValue;
- mutable WriteBarrier<Unknown> m_JSMessagePortSetterValue;
- mutable WriteBarrier<Unknown> m_JSTextEncoderSetterValue;
- mutable WriteBarrier<Unknown> m_JSURLSearchParamsSetterValue;
- mutable WriteBarrier<Unknown> m_JSWebSocketSetterValue;
- mutable WriteBarrier<Unknown> m_JSWorkerSetterValue;
-
- mutable WriteBarrier<Unknown> m_JSBunDebuggerValue;
+
+ // mutable WriteBarrier<Unknown> m_JSBunDebuggerValue;
mutable WriteBarrier<JSFunction> m_thenables[promiseFunctionsSize + 1];
+ mutable WriteBarrier<JSC::Unknown> m_errorConstructorPrepareStackTraceValue;
+
Structure* memoryFootprintStructure()
{
return m_memoryFootprintStructure.getInitializedOnMainThread(this);
@@ -439,9 +384,8 @@ public:
return false;
}
- BunPlugin::OnLoad onLoadPlugins[BunPluginTargetMax + 1] {};
- BunPlugin::OnResolve onResolvePlugins[BunPluginTargetMax + 1] {};
- BunPluginTarget defaultBunPluginTarget = BunPluginTargetBun;
+ BunPlugin::OnLoad onLoadPlugins {};
+ BunPlugin::OnResolve onResolvePlugins {};
// This increases the cache hit rate for JSC::VM's SourceProvider cache
// It also avoids an extra allocation for the SourceProvider
@@ -478,6 +422,7 @@ public:
private:
void addBuiltinGlobals(JSC::VM&);
+
void finishCreation(JSC::VM&);
friend void WebCore::JSBuiltinInternalFunctions::initialize(Zig::GlobalObject&);
WebCore::JSBuiltinInternalFunctions m_builtinInternalFunctions;
@@ -490,6 +435,9 @@ private:
WebCore::ScriptExecutionContext* m_scriptExecutionContext;
Ref<WebCore::DOMWrapperWorld> m_world;
+ // JSC's hashtable code-generator tries to access these properties, so we make them public.
+ // However, we'd like it better if they could be protected.
+public:
/**
* WARNING: You must update visitChildrenImpl() if you add a new field.
*
@@ -523,7 +471,7 @@ private:
* For example, if you don't add the queueMicrotask functions to visitChildrenImpl(),
* those callbacks will eventually never be called anymore. But it'll work the first time!
*/
- LazyProperty<JSGlobalObject, JSC::Structure> m_pendingVirtualModuleResultStructure;
+ LazyProperty<JSGlobalObject, Structure> m_pendingVirtualModuleResultStructure;
LazyProperty<JSGlobalObject, JSFunction> m_performMicrotaskFunction;
LazyProperty<JSGlobalObject, JSFunction> m_nativeMicrotaskTrampoline;
LazyProperty<JSGlobalObject, JSFunction> m_performMicrotaskVariadicFunction;
@@ -537,38 +485,40 @@ private:
LazyProperty<JSGlobalObject, JSObject> m_JSArrayBufferControllerPrototype;
LazyProperty<JSGlobalObject, JSObject> m_JSFileSinkControllerPrototype;
LazyProperty<JSGlobalObject, JSObject> m_JSHTTPSResponseControllerPrototype;
- LazyProperty<JSGlobalObject, JSObject> m_navigatorObject;
- LazyProperty<JSGlobalObject, JSObject> m_performanceObject;
- LazyProperty<JSGlobalObject, JSObject> m_processObject;
LazyProperty<JSGlobalObject, JSObject> m_subtleCryptoObject;
LazyProperty<JSGlobalObject, Structure> m_JSHTTPResponseController;
- LazyProperty<JSGlobalObject, JSC::Structure> m_JSBufferSubclassStructure;
+ LazyProperty<JSGlobalObject, Structure> m_JSBufferSubclassStructure;
LazyProperty<JSGlobalObject, JSWeakMap> m_vmModuleContextMap;
LazyProperty<JSGlobalObject, JSObject> m_lazyRequireCacheObject;
LazyProperty<JSGlobalObject, JSObject> m_lazyTestModuleObject;
LazyProperty<JSGlobalObject, JSObject> m_lazyPreloadTestModuleObject;
-
LazyProperty<JSGlobalObject, JSFunction> m_bunSleepThenCallback;
LazyProperty<JSGlobalObject, Structure> m_cachedGlobalObjectStructure;
LazyProperty<JSGlobalObject, Structure> m_cachedGlobalProxyStructure;
LazyProperty<JSGlobalObject, Structure> m_commonJSModuleObjectStructure;
LazyProperty<JSGlobalObject, Structure> m_commonJSFunctionArgumentsStructure;
+ LazyProperty<JSGlobalObject, Structure> m_JSSocketAddressStructure;
LazyProperty<JSGlobalObject, Structure> m_memoryFootprintStructure;
- LazyProperty<JSGlobalObject, JSObject> m_cryptoObject;
-
- LazyProperty<JSGlobalObject, JSC::JSObject> m_requireFunctionUnbound;
- LazyProperty<JSGlobalObject, JSC::JSObject> m_requireResolveFunctionUnbound;
+ LazyProperty<JSGlobalObject, JSObject> m_requireFunctionUnbound;
+ LazyProperty<JSGlobalObject, JSObject> m_requireResolveFunctionUnbound;
LazyProperty<JSGlobalObject, Bun::InternalModuleRegistry> m_internalModuleRegistry;
- LazyProperty<JSGlobalObject, Bun::ProcessBindingConstants> m_processBindingConstants;
- LazyProperty<JSGlobalObject, JSC::Structure> m_importMetaObjectStructure;
- LazyProperty<JSGlobalObject, JSC::Structure> m_asyncBoundFunctionStructure;
-
+ LazyProperty<JSGlobalObject, JSObject> m_processBindingConstants;
+ LazyProperty<JSGlobalObject, Structure> m_importMetaObjectStructure;
+ LazyProperty<JSGlobalObject, Structure> m_asyncBoundFunctionStructure;
LazyProperty<JSGlobalObject, JSC::JSObject> m_JSDOMFileConstructor;
+ LazyProperty<JSGlobalObject, Structure> m_JSCryptoKey;
+ LazyProperty<JSGlobalObject, JSObject> m_bunObject;
+ LazyProperty<JSGlobalObject, JSObject> m_cryptoObject;
+ LazyProperty<JSGlobalObject, JSObject> m_navigatorObject;
+ LazyProperty<JSGlobalObject, JSObject> m_performanceObject;
+ LazyProperty<JSGlobalObject, JSObject> m_processObject;
+
+private:
DOMGuardedObjectSet m_guardedObjects WTF_GUARDED_BY_LOCK(m_gcLock);
void* m_bunVM;
- WebCore::SubtleCrypto* crypto = nullptr;
+ WebCore::SubtleCrypto* m_subtleCrypto = nullptr;
WTF::Vector<JSC::Strong<JSC::JSPromise>> m_aboutToBeNotifiedRejectedPromises;
WTF::Vector<JSC::Strong<JSC::JSFunction>> m_ffiFunctions;
diff --git a/src/bun.js/bindings/ZigGlobalObject.lut.h b/src/bun.js/bindings/ZigGlobalObject.lut.h
new file mode 100644
index 000000000..6516648e8
--- /dev/null
+++ b/src/bun.js/bindings/ZigGlobalObject.lut.h
@@ -0,0 +1,341 @@
+// File generated via `make static-hash-table` / `make cpp`
+static const struct CompactHashIndex bunGlobalObjectTableIndex[260] = {
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 42, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 6, -1 },
+ { 3, -1 },
+ { -1, -1 },
+ { 34, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 29, 258 },
+ { -1, -1 },
+ { -1, -1 },
+ { 54, 257 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 51, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 2, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 18, -1 },
+ { 56, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 14, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 41, -1 },
+ { 47, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 69, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 39, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 38, -1 },
+ { 63, -1 },
+ { -1, -1 },
+ { 57, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 49, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 58, -1 },
+ { 11, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 0, -1 },
+ { -1, -1 },
+ { 37, -1 },
+ { 21, -1 },
+ { 66, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 70, -1 },
+ { -1, -1 },
+ { 45, -1 },
+ { -1, -1 },
+ { 48, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 24, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 33, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 50, -1 },
+ { 46, -1 },
+ { -1, -1 },
+ { 13, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 43, -1 },
+ { -1, -1 },
+ { 1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 32, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 28, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 26, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 17, -1 },
+ { -1, -1 },
+ { 31, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 35, -1 },
+ { 71, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 22, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 4, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 23, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 55, -1 },
+ { -1, -1 },
+ { 53, -1 },
+ { -1, -1 },
+ { 12, -1 },
+ { 25, -1 },
+ { 7, -1 },
+ { -1, -1 },
+ { 9, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 61, -1 },
+ { 60, -1 },
+ { -1, -1 },
+ { 5, 256 },
+ { -1, -1 },
+ { 64, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 36, -1 },
+ { -1, -1 },
+ { 15, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 40, 259 },
+ { -1, -1 },
+ { -1, -1 },
+ { 68, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 52, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 30, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 27, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 44, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 65, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 20, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 10, -1 },
+ { 16, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 19, -1 },
+ { -1, -1 },
+ { 8, -1 },
+ { 59, -1 },
+ { 62, -1 },
+ { 67, -1 },
+};
+
+static const struct HashTableValue bunGlobalObjectTableValues[72] = {
+ { "addEventListener"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsFunctionAddEventListener, 2 } },
+ { "alert"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, WebCore__alert, 1 } },
+ { "atob"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, functionATOB, 1 } },
+ { "btoa"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, functionBTOA, 1 } },
+ { "clearImmediate"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, functionClearTimeout, 1 } },
+ { "clearInterval"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, functionClearInterval, 1 } },
+ { "clearTimeout"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, functionClearTimeout, 1 } },
+ { "confirm"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, WebCore__confirm, 1 } },
+ { "dispatchEvent"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsFunctionDispatchEvent, 1 } },
+ { "fetch"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, Bun__fetch, 2 } },
+ { "postMessage"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsFunctionPostMessage, 1 } },
+ { "prompt"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, WebCore__prompt, 1 } },
+ { "queueMicrotask"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, functionQueueMicrotask, 2 } },
+ { "removeEventListener"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsFunctionRemoveEventListener, 2 } },
+ { "reportError"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, functionReportError, 1 } },
+ { "setImmediate"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, functionSetImmediate, 1 } },
+ { "setInterval"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, functionSetInterval, 1 } },
+ { "setTimeout"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, functionSetTimeout, 1 } },
+ { "structuredClone"_s, static_cast<unsigned>(PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, functionStructuredClone, 2 } },
+ { "global"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, GlobalObject_getGlobalThis } },
+ { "EventSource"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, getEventSourceConstructor } },
+ { "Bun"_s, static_cast<unsigned>(PropertyAttribute::CellProperty|PropertyAttribute::DontDelete|PropertyAttribute::ReadOnly), NoIntrinsic, { HashTableValue::LazyCellPropertyType, OBJECT_OFFSETOF(GlobalObject, m_bunObject) } },
+ { "File"_s, static_cast<unsigned>(PropertyAttribute::CellProperty), NoIntrinsic, { HashTableValue::LazyCellPropertyType, OBJECT_OFFSETOF(GlobalObject, m_JSDOMFileConstructor) } },
+ { "crypto"_s, static_cast<unsigned>(PropertyAttribute::CellProperty), NoIntrinsic, { HashTableValue::LazyCellPropertyType, OBJECT_OFFSETOF(GlobalObject, m_cryptoObject) } },
+ { "navigator"_s, static_cast<unsigned>(PropertyAttribute::CellProperty), NoIntrinsic, { HashTableValue::LazyCellPropertyType, OBJECT_OFFSETOF(GlobalObject, m_navigatorObject) } },
+ { "performance"_s, static_cast<unsigned>(PropertyAttribute::CellProperty), NoIntrinsic, { HashTableValue::LazyCellPropertyType, OBJECT_OFFSETOF(GlobalObject, m_performanceObject) } },
+ { "process"_s, static_cast<unsigned>(PropertyAttribute::CellProperty), NoIntrinsic, { HashTableValue::LazyCellPropertyType, OBJECT_OFFSETOF(GlobalObject, m_processObject) } },
+ { "Blob"_s, static_cast<unsigned>(PropertyAttribute::ClassStructure), NoIntrinsic, { HashTableValue::LazyClassStructureType, OBJECT_OFFSETOF(GlobalObject, m_JSBlob) } },
+ { "Buffer"_s, static_cast<unsigned>(PropertyAttribute::ClassStructure), NoIntrinsic, { HashTableValue::LazyClassStructureType, OBJECT_OFFSETOF(GlobalObject, m_JSBufferClassStructure) } },
+ { "BuildError"_s, static_cast<unsigned>(PropertyAttribute::ClassStructure), NoIntrinsic, { HashTableValue::LazyClassStructureType, OBJECT_OFFSETOF(GlobalObject, m_JSBuildMessage) } },
+ { "BuildMessage"_s, static_cast<unsigned>(PropertyAttribute::ClassStructure), NoIntrinsic, { HashTableValue::LazyClassStructureType, OBJECT_OFFSETOF(GlobalObject, m_JSBuildMessage) } },
+ { "Crypto"_s, static_cast<unsigned>(PropertyAttribute::ClassStructure), NoIntrinsic, { HashTableValue::LazyClassStructureType, OBJECT_OFFSETOF(GlobalObject, m_JSCrypto) } },
+ { "HTMLRewriter"_s, static_cast<unsigned>(PropertyAttribute::ClassStructure), NoIntrinsic, { HashTableValue::LazyClassStructureType, OBJECT_OFFSETOF(GlobalObject, m_JSHTMLRewriter) } },
+ { "Request"_s, static_cast<unsigned>(PropertyAttribute::ClassStructure), NoIntrinsic, { HashTableValue::LazyClassStructureType, OBJECT_OFFSETOF(GlobalObject, m_JSRequest) } },
+ { "ResolveError"_s, static_cast<unsigned>(PropertyAttribute::ClassStructure), NoIntrinsic, { HashTableValue::LazyClassStructureType, OBJECT_OFFSETOF(GlobalObject, m_JSResolveMessage) } },
+ { "ResolveMessage"_s, static_cast<unsigned>(PropertyAttribute::ClassStructure), NoIntrinsic, { HashTableValue::LazyClassStructureType, OBJECT_OFFSETOF(GlobalObject, m_JSResolveMessage) } },
+ { "Response"_s, static_cast<unsigned>(PropertyAttribute::ClassStructure), NoIntrinsic, { HashTableValue::LazyClassStructureType, OBJECT_OFFSETOF(GlobalObject, m_JSResponse) } },
+ { "TextDecoder"_s, static_cast<unsigned>(PropertyAttribute::ClassStructure), NoIntrinsic, { HashTableValue::LazyClassStructureType, OBJECT_OFFSETOF(GlobalObject, m_JSTextDecoder) } },
+ { "AbortController"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, AbortControllerConstructorCallback } },
+ { "AbortSignal"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, AbortSignalConstructorCallback } },
+ { "BroadcastChannel"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, BroadcastChannelConstructorCallback } },
+ { "ByteLengthQueuingStrategy"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, ByteLengthQueuingStrategyConstructorCallback } },
+ { "CloseEvent"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, CloseEventConstructorCallback } },
+ { "CountQueuingStrategy"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, CountQueuingStrategyConstructorCallback } },
+ { "CryptoKey"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, CryptoKeyConstructorCallback } },
+ { "CustomEvent"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, CustomEventConstructorCallback } },
+ { "DOMException"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, DOMExceptionConstructorCallback } },
+ { "ErrorEvent"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, ErrorEventConstructorCallback } },
+ { "Event"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, EventConstructorCallback } },
+ { "EventTarget"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, EventTargetConstructorCallback } },
+ { "FormData"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, DOMFormDataConstructorCallback } },
+ { "Headers"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, FetchHeadersConstructorCallback } },
+ { "MessageChannel"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, MessageChannelConstructorCallback } },
+ { "MessageEvent"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, MessageEventConstructorCallback } },
+ { "MessagePort"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, MessagePortConstructorCallback } },
+ { "ReadableByteStreamController"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, ReadableByteStreamControllerConstructorCallback } },
+ { "ReadableStream"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, ReadableStreamConstructorCallback } },
+ { "ReadableStreamBYOBReader"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, ReadableStreamBYOBReaderConstructorCallback } },
+ { "ReadableStreamBYOBRequest"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, ReadableStreamBYOBRequestConstructorCallback } },
+ { "ReadableStreamDefaultController"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, ReadableStreamDefaultControllerConstructorCallback } },
+ { "ReadableStreamDefaultReader"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, ReadableStreamDefaultReaderConstructorCallback } },
+ { "SubtleCrypto"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, SubtleCryptoConstructorCallback } },
+ { "TextEncoder"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, TextEncoderConstructorCallback } },
+ { "TransformStream"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, TransformStreamConstructorCallback } },
+ { "URL"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, DOMURLConstructorCallback } },
+ { "URLSearchParams"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, URLSearchParamsConstructorCallback } },
+ { "WebSocket"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, WebSocketConstructorCallback } },
+ { "Worker"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, WorkerConstructorCallback } },
+ { "WritableStream"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, WritableStreamConstructorCallback } },
+ { "WritableStreamDefaultController"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, WritableStreamDefaultControllerConstructorCallback } },
+ { "WritableStreamDefaultWriter"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, WritableStreamDefaultWriterConstructorCallback } },
+ { "TransformStreamDefaultController"_s, static_cast<unsigned>(PropertyAttribute::PropertyCallback), NoIntrinsic, { HashTableValue::LazyPropertyType, TransformStreamDefaultControllerConstructorCallback } },
+};
+
+static const struct HashTable bunGlobalObjectTable =
+ { 72, 255, false, nullptr, bunGlobalObjectTableValues, bunGlobalObjectTableIndex };
diff --git a/src/bun.js/bindings/ZigGlobalObject.lut.txt b/src/bun.js/bindings/ZigGlobalObject.lut.txt
new file mode 100644
index 000000000..aadaee92a
--- /dev/null
+++ b/src/bun.js/bindings/ZigGlobalObject.lut.txt
@@ -0,0 +1,82 @@
+// In a separate file because processing ZigGlobalObject.cpp takes 15+ seconds
+
+/* Source for ZigGlobalObject.lut.h
+@begin bunGlobalObjectTable
+ addEventListener jsFunctionAddEventListener Function 2
+ alert WebCore__alert Function 1
+ atob functionATOB Function 1
+ btoa functionBTOA Function 1
+ clearImmediate functionClearTimeout Function 1
+ clearInterval functionClearInterval Function 1
+ clearTimeout functionClearTimeout Function 1
+ confirm WebCore__confirm Function 1
+ dispatchEvent jsFunctionDispatchEvent Function 1
+ fetch Bun__fetch Function 2
+ postMessage jsFunctionPostMessage Function 1
+ prompt WebCore__prompt Function 1
+ queueMicrotask functionQueueMicrotask Function 2
+ removeEventListener jsFunctionRemoveEventListener Function 2
+ reportError functionReportError Function 1
+ setImmediate functionSetImmediate Function 1
+ setInterval functionSetInterval Function 1
+ setTimeout functionSetTimeout Function 1
+ structuredClone functionStructuredClone Function 2
+
+ global GlobalObject_getGlobalThis PropertyCallback
+ EventSource getEventSourceConstructor PropertyCallback
+
+ Bun GlobalObject::m_bunObject CellProperty|DontDelete|ReadOnly
+ File GlobalObject::m_JSDOMFileConstructor CellProperty
+ crypto GlobalObject::m_cryptoObject CellProperty
+ navigator GlobalObject::m_navigatorObject CellProperty
+ performance GlobalObject::m_performanceObject CellProperty
+ process GlobalObject::m_processObject CellProperty
+
+ Blob GlobalObject::m_JSBlob ClassStructure
+ Buffer GlobalObject::m_JSBufferClassStructure ClassStructure
+ BuildError GlobalObject::m_JSBuildMessage ClassStructure
+ BuildMessage GlobalObject::m_JSBuildMessage ClassStructure
+ Crypto GlobalObject::m_JSCrypto ClassStructure
+ HTMLRewriter GlobalObject::m_JSHTMLRewriter ClassStructure
+ Request GlobalObject::m_JSRequest ClassStructure
+ ResolveError GlobalObject::m_JSResolveMessage ClassStructure
+ ResolveMessage GlobalObject::m_JSResolveMessage ClassStructure
+ Response GlobalObject::m_JSResponse ClassStructure
+ TextDecoder GlobalObject::m_JSTextDecoder ClassStructure
+
+ AbortController AbortControllerConstructorCallback PropertyCallback
+ AbortSignal AbortSignalConstructorCallback PropertyCallback
+ BroadcastChannel BroadcastChannelConstructorCallback PropertyCallback
+ ByteLengthQueuingStrategy ByteLengthQueuingStrategyConstructorCallback PropertyCallback
+ CloseEvent CloseEventConstructorCallback PropertyCallback
+ CountQueuingStrategy CountQueuingStrategyConstructorCallback PropertyCallback
+ CryptoKey CryptoKeyConstructorCallback PropertyCallback
+ CustomEvent CustomEventConstructorCallback PropertyCallback
+ DOMException DOMExceptionConstructorCallback PropertyCallback
+ ErrorEvent ErrorEventConstructorCallback PropertyCallback
+ Event EventConstructorCallback PropertyCallback
+ EventTarget EventTargetConstructorCallback PropertyCallback
+ FormData DOMFormDataConstructorCallback PropertyCallback
+ Headers FetchHeadersConstructorCallback PropertyCallback
+ MessageChannel MessageChannelConstructorCallback PropertyCallback
+ MessageEvent MessageEventConstructorCallback PropertyCallback
+ MessagePort MessagePortConstructorCallback PropertyCallback
+ ReadableByteStreamController ReadableByteStreamControllerConstructorCallback PropertyCallback
+ ReadableStream ReadableStreamConstructorCallback PropertyCallback
+ ReadableStreamBYOBReader ReadableStreamBYOBReaderConstructorCallback PropertyCallback
+ ReadableStreamBYOBRequest ReadableStreamBYOBRequestConstructorCallback PropertyCallback
+ ReadableStreamDefaultController ReadableStreamDefaultControllerConstructorCallback PropertyCallback
+ ReadableStreamDefaultReader ReadableStreamDefaultReaderConstructorCallback PropertyCallback
+ SubtleCrypto SubtleCryptoConstructorCallback PropertyCallback
+ TextEncoder TextEncoderConstructorCallback PropertyCallback
+ TransformStream TransformStreamConstructorCallback PropertyCallback
+ URL DOMURLConstructorCallback PropertyCallback
+ URLSearchParams URLSearchParamsConstructorCallback PropertyCallback
+ WebSocket WebSocketConstructorCallback PropertyCallback
+ Worker WorkerConstructorCallback PropertyCallback
+ WritableStream WritableStreamConstructorCallback PropertyCallback
+ WritableStreamDefaultController WritableStreamDefaultControllerConstructorCallback PropertyCallback
+ WritableStreamDefaultWriter WritableStreamDefaultWriterConstructorCallback PropertyCallback
+ TransformStreamDefaultController TransformStreamDefaultControllerConstructorCallback PropertyCallback
+@end
+*/
diff --git a/src/bun.js/bindings/ZigLazyStaticFunctions-inlines.h b/src/bun.js/bindings/ZigLazyStaticFunctions-inlines.h
index c97393723..0c13ecd58 100644
--- a/src/bun.js/bindings/ZigLazyStaticFunctions-inlines.h
+++ b/src/bun.js/bindings/ZigLazyStaticFunctions-inlines.h
@@ -25,7 +25,7 @@ static void DOMCall__FFI__ptr__put(JSC::JSGlobalObject* globalObject, JSC::Encod
globalObject->vm(),
Identifier::fromString(globalObject->vm(), "ptr"_s),
function,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction | 0);
+ 0);
}
/* -- END DOMCall DEFINITIONS-- */
diff --git a/src/bun.js/bindings/ZigSourceProvider.cpp b/src/bun.js/bindings/ZigSourceProvider.cpp
index d11c748da..960e577b9 100644
--- a/src/bun.js/bindings/ZigSourceProvider.cpp
+++ b/src/bun.js/bindings/ZigSourceProvider.cpp
@@ -104,6 +104,7 @@ Ref<SourceProvider> SourceProvider::create(Zig::GlobalObject* globalObject, Reso
auto provider = adoptRef(*new SourceProvider(
globalObject->isThreadLocalDefaultGlobalObject ? globalObject : nullptr,
resolvedSource, stringImpl.releaseImpl().releaseNonNull(),
+ JSC::SourceTaintedOrigin::Untainted,
toSourceOrigin(sourceURLString, isBuiltin),
sourceURLString.impl(), TextPosition(),
sourceType));
diff --git a/src/bun.js/bindings/ZigSourceProvider.h b/src/bun.js/bindings/ZigSourceProvider.h
index 364e6ee23..b7574c7a4 100644
--- a/src/bun.js/bindings/ZigSourceProvider.h
+++ b/src/bun.js/bindings/ZigSourceProvider.h
@@ -69,9 +69,10 @@ public:
private:
SourceProvider(Zig::GlobalObject* globalObject, ResolvedSource resolvedSource, Ref<WTF::StringImpl>&& sourceImpl,
+ JSC::SourceTaintedOrigin taintedness,
const SourceOrigin& sourceOrigin, WTF::String&& sourceURL,
const TextPosition& startPosition, JSC::SourceProviderSourceType sourceType)
- : Base(sourceOrigin, WTFMove(sourceURL), String(), startPosition, sourceType)
+ : Base(sourceOrigin, WTFMove(sourceURL), String(), taintedness, startPosition, sourceType)
, m_source(sourceImpl)
{
diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp
index e46982aad..117b848ef 100644
--- a/src/bun.js/bindings/bindings.cpp
+++ b/src/bun.js/bindings/bindings.cpp
@@ -19,6 +19,7 @@
#include "JavaScriptCore/JSArray.h"
#include "JavaScriptCore/JSArrayBuffer.h"
#include "JavaScriptCore/JSArrayInlines.h"
+#include "JavaScriptCore/ErrorInstanceInlines.h"
#include "JavaScriptCore/JSCallbackObject.h"
#include "JavaScriptCore/JSClassRef.h"
@@ -229,6 +230,47 @@ AsymmetricMatcherResult matchAsymmetricMatcher(JSGlobalObject* globalObject, JSC
}
return AsymmetricMatcherResult::FAIL;
+ } else if (auto* expectArrayContaining = jsDynamicCast<JSExpectArrayContaining*>(matcherPropCell)) {
+ JSValue expectedArrayValue = expectArrayContaining->m_arrayValue.get();
+
+ if (JSC::isArray(globalObject, otherProp)) {
+ if (JSC::isArray(globalObject, expectedArrayValue)) {
+ JSArray* expectedArray = jsDynamicCast<JSArray*>(expectedArrayValue);
+ JSArray* otherArray = jsDynamicCast<JSArray*>(otherProp);
+
+ unsigned expectedLength = expectedArray->length();
+ unsigned otherLength = otherArray->length();
+
+ // A empty array is all array's subset
+ if (expectedLength == 0) {
+ return AsymmetricMatcherResult::PASS;
+ }
+
+ // O(m*n) but works for now
+ for (unsigned m = 0; m < expectedLength; m++) {
+ JSValue expectedValue = expectedArray->getIndex(globalObject, m);
+ bool found = false;
+
+ for (unsigned n = 0; n < otherLength; n++) {
+ JSValue otherValue = otherArray->getIndex(globalObject, n);
+ ThrowScope scope = DECLARE_THROW_SCOPE(globalObject->vm());
+ Vector<std::pair<JSValue, JSValue>, 16> stack;
+ if (Bun__deepEquals<false, true>(globalObject, expectedValue, otherValue, stack, &scope, true)) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ return AsymmetricMatcherResult::FAIL;
+ }
+ }
+
+ return AsymmetricMatcherResult::PASS;
+ }
+ }
+
+ return AsymmetricMatcherResult::FAIL;
}
return AsymmetricMatcherResult::NOT_MATCHER;
@@ -306,10 +348,8 @@ bool Bun__deepEquals(JSC__JSGlobalObject* globalObject, JSValue v1, JSValue v2,
// need to check this before primitives, asymmetric matchers
// can match against any type of value.
if constexpr (enableAsymmetricMatchers) {
- JSCell* c1 = v1.asCell();
- JSCell* c2 = v2.asCell();
- if (v2.isCell() && !v2.isEmpty() && c2->type() == JSC::JSType(JSDOMWrapperType)) {
- switch (matchAsymmetricMatcher(globalObject, c2, v1, scope)) {
+ if (v2.isCell() && !v2.isEmpty() && v2.asCell()->type() == JSC::JSType(JSDOMWrapperType)) {
+ switch (matchAsymmetricMatcher(globalObject, v2.asCell(), v1, scope)) {
case AsymmetricMatcherResult::FAIL:
return false;
case AsymmetricMatcherResult::PASS:
@@ -318,8 +358,8 @@ bool Bun__deepEquals(JSC__JSGlobalObject* globalObject, JSValue v1, JSValue v2,
// continue comparison
break;
}
- } else if (v1.isCell() && !v1.isEmpty() && c1->type() == JSC::JSType(JSDOMWrapperType)) {
- switch (matchAsymmetricMatcher(globalObject, c1, v2, scope)) {
+ } else if (v1.isCell() && !v1.isEmpty() && v1.asCell()->type() == JSC::JSType(JSDOMWrapperType)) {
+ switch (matchAsymmetricMatcher(globalObject, v1.asCell(), v2, scope)) {
case AsymmetricMatcherResult::FAIL:
return false;
case AsymmetricMatcherResult::PASS:
@@ -576,7 +616,7 @@ bool Bun__deepEquals(JSC__JSGlobalObject* globalObject, JSValue v1, JSValue v2,
case Float64ArrayType:
case BigInt64ArrayType:
case BigUint64ArrayType: {
- if (!isTypedArrayType(static_cast<JSC::JSType>(c2Type))) {
+ if (!isTypedArrayType(static_cast<JSC::JSType>(c2Type)) || c1Type != c2Type) {
return false;
}
@@ -627,6 +667,7 @@ bool Bun__deepEquals(JSC__JSGlobalObject* globalObject, JSValue v1, JSValue v2,
case JSDOMWrapperType: {
if (c2Type == JSDOMWrapperType) {
// https://github.com/oven-sh/bun/issues/4089
+ // https://github.com/oven-sh/bun/issues/6492
auto* url2 = jsDynamicCast<JSDOMURL*>(v2);
auto* url1 = jsDynamicCast<JSDOMURL*>(v1);
@@ -635,19 +676,15 @@ bool Bun__deepEquals(JSC__JSGlobalObject* globalObject, JSValue v1, JSValue v2,
if ((url2 == nullptr) != (url1 == nullptr)) {
return false;
}
-
- if (url2 && url1) {
- return url1->wrapped().href() != url2->wrapped().href();
- }
- } else {
- if (url2 && url1) {
- // toEqual should return false when the URLs' href is not equal
- // But you could have added additional properties onto the
- // url object itself, so we must check those as well
- // But it's definitely not equal if the href() is not the same
- if (url1->wrapped().href() != url2->wrapped().href()) {
- return false;
- }
+ }
+
+ if (url2 && url1) {
+ // toEqual or toStrictEqual should return false when the URLs' href is not equal
+ // But you could have added additional properties onto the
+ // url object itself, so we must check those as well
+ // But it's definitely not equal if the href() is not the same
+ if (url1->wrapped().href() != url2->wrapped().href()) {
+ return false;
}
}
}
@@ -1045,7 +1082,9 @@ void WebCore__FetchHeaders__toUWSResponse(WebCore__FetchHeaders* arg0, bool is_s
WebCore__FetchHeaders* WebCore__FetchHeaders__createEmpty()
{
- return new WebCore::FetchHeaders({ WebCore::FetchHeaders::Guard::None, {} });
+ auto* headers = new WebCore::FetchHeaders({ WebCore::FetchHeaders::Guard::None, {} });
+ headers->relaxAdoptionRequirement();
+ return headers;
}
void WebCore__FetchHeaders__append(WebCore__FetchHeaders* headers, const ZigString* arg1, const ZigString* arg2,
JSC__JSGlobalObject* lexicalGlobalObject)
@@ -1074,6 +1113,7 @@ WebCore__FetchHeaders* WebCore__FetchHeaders__createFromJS(JSC__JSGlobalObject*
RETURN_IF_EXCEPTION(throwScope, nullptr);
auto* headers = new WebCore::FetchHeaders({ WebCore::FetchHeaders::Guard::None, {} });
+ headers->relaxAdoptionRequirement();
if (init) {
// `fill` doesn't set an exception on the VM if it fails, it returns an
// ExceptionOr<void>. So we need to check for the exception and, if set,
@@ -1112,6 +1152,7 @@ WebCore__FetchHeaders* WebCore__FetchHeaders__cloneThis(WebCore__FetchHeaders* h
{
auto throwScope = DECLARE_THROW_SCOPE(lexicalGlobalObject->vm());
auto* clone = new WebCore::FetchHeaders({ WebCore::FetchHeaders::Guard::None, {} });
+ clone->relaxAdoptionRequirement();
WebCore::propagateException(*lexicalGlobalObject, throwScope,
clone->fill(*headers));
return clone;
@@ -1181,6 +1222,7 @@ WebCore::FetchHeaders* WebCore__FetchHeaders__createFromPicoHeaders_(const void*
{
PicoHTTPHeaders pico_headers = *reinterpret_cast<const PicoHTTPHeaders*>(arg1);
auto* headers = new WebCore::FetchHeaders({ WebCore::FetchHeaders::Guard::None, {} });
+ headers->relaxAdoptionRequirement(); // This prevents an assertion later, but may not be the proper approach.
if (pico_headers.len > 0) {
HTTPHeaderMap map = HTTPHeaderMap();
@@ -1223,6 +1265,8 @@ WebCore::FetchHeaders* WebCore__FetchHeaders__createFromUWS(JSC__JSGlobalObject*
size_t i = 0;
auto* headers = new WebCore::FetchHeaders({ WebCore::FetchHeaders::Guard::None, {} });
+ headers->relaxAdoptionRequirement(); // This prevents an assertion later, but may not be the proper approach.
+
HTTPHeaderMap map = HTTPHeaderMap();
for (const auto& header : req) {
@@ -1246,7 +1290,6 @@ WebCore::FetchHeaders* WebCore__FetchHeaders__createFromUWS(JSC__JSGlobalObject*
if (i > 56)
__builtin_unreachable();
}
-
headers->setInternalHeaders(WTFMove(map));
return headers;
}
@@ -1354,15 +1397,22 @@ BunString WebCore__DOMURL__fileSystemPath(WebCore__DOMURL* arg0)
extern "C" JSC__JSValue ZigString__toJSONObject(const ZigString* strPtr, JSC::JSGlobalObject* globalObject)
{
auto str = Zig::toString(*strPtr);
- auto throwScope = DECLARE_THROW_SCOPE(globalObject->vm());
- auto scope = DECLARE_CATCH_SCOPE(globalObject->vm());
- JSValue result = JSONParseWithException(globalObject, str);
- if (auto* exception = scope.exception()) {
+ auto scope = DECLARE_THROW_SCOPE(globalObject->vm());
+
+ // JSONParseWithException does not propagate exceptions as expected. See #5859
+ JSValue result = JSONParse(globalObject, str);
+
+ if (!result && !scope.exception()) {
+ scope.throwException(globalObject, createSyntaxError(globalObject, "Failed to parse JSON"_s));
+ }
+
+ if (scope.exception()) {
+ auto* exception = scope.exception();
scope.clearException();
- RELEASE_AND_RETURN(throwScope, JSC::JSValue::encode(exception->value()));
+ return JSC::JSValue::encode(exception);
}
- RELEASE_AND_RETURN(throwScope, JSValue::encode(result));
+ return JSValue::encode(result);
}
JSC__JSValue SystemError__toErrorInstance(const SystemError* arg0,
@@ -2063,7 +2113,7 @@ JSC__JSValue JSC__JSModuleLoader__evaluate(JSC__JSGlobalObject* globalObject, co
JSC::VM& vm = globalObject->vm();
JSC::SourceCode sourceCode = JSC::makeSource(
- src, JSC::SourceOrigin { origin }, origin.fileSystemPath(),
+ src, JSC::SourceOrigin { origin }, JSC::SourceTaintedOrigin::Untainted, origin.fileSystemPath(),
WTF::TextPosition(), JSC::SourceProviderSourceType::Module);
globalObject->moduleLoader()->provideFetch(globalObject, jsString(vm, origin.fileSystemPath()), WTFMove(sourceCode));
auto* promise = JSC::importModule(globalObject, JSC::Identifier::fromString(vm, origin.fileSystemPath()), JSValue(jsString(vm, referrer.fileSystemPath())), JSValue(), JSValue());
@@ -2116,6 +2166,14 @@ JSC__JSValue ReadableStream__empty(Zig::GlobalObject* globalObject)
return JSValue::encode(JSC::call(globalObject, function, JSC::ArgList(), "ReadableStream.create"_s));
}
+JSC__JSValue ReadableStream__used(Zig::GlobalObject* globalObject)
+{
+ auto& vm = globalObject->vm();
+ auto clientData = WebCore::clientData(vm);
+ auto* function = globalObject->getDirect(vm, clientData->builtinNames().createUsedReadableStreamPrivateName()).getObject();
+ return JSValue::encode(JSC::call(globalObject, function, JSC::ArgList(), "ReadableStream.create"_s));
+}
+
JSC__JSValue JSC__JSValue__createRangeError(const ZigString* message, const ZigString* arg1,
JSC__JSGlobalObject* globalObject)
{
@@ -2303,29 +2361,31 @@ JSC__JSValue JSC__JSValue__createStringArray(JSC__JSGlobalObject* globalObject,
JSC::JSArray* array = nullptr;
{
+ JSC::GCDeferralContext deferralContext(vm);
JSC::ObjectInitializationScope initializationScope(vm);
if ((array = JSC::JSArray::tryCreateUninitializedRestricted(
- initializationScope, nullptr,
+ initializationScope, &deferralContext,
globalObject->arrayStructureForIndexingTypeDuringAllocation(JSC::ArrayWithContiguous),
arg2))) {
if (!clone) {
for (size_t i = 0; i < arg2; ++i) {
- array->putDirectIndex(globalObject, i, JSC::jsString(vm, Zig::toString(arg1[i])));
+ array->putDirectIndex(globalObject, i, JSC::jsString(vm, Zig::toString(arg1[i]), &deferralContext));
}
} else {
for (size_t i = 0; i < arg2; ++i) {
- array->putDirectIndex(globalObject, i, JSC::jsString(vm, Zig::toStringCopy(arg1[i])));
+ array->putDirectIndex(globalObject, i, JSC::jsString(vm, Zig::toStringCopy(arg1[i]), &deferralContext));
}
}
}
- }
- if (!array) {
- JSC::throwOutOfMemoryError(globalObject, scope);
- return JSC::JSValue::encode(JSC::JSValue());
- }
- RELEASE_AND_RETURN(scope, JSC::JSValue::encode(JSC::JSValue(array)));
+ if (!array) {
+ JSC::throwOutOfMemoryError(globalObject, scope);
+ return JSC::JSValue::encode(JSC::JSValue());
+ }
+
+ RELEASE_AND_RETURN(scope, JSC::JSValue::encode(JSC::JSValue(array)));
+ }
}
JSC__JSValue JSC__JSGlobalObject__createAggregateError(JSC__JSGlobalObject* globalObject,
@@ -2803,7 +2863,7 @@ JSC__VM* JSC__JSGlobalObject__vm(JSC__JSGlobalObject* arg0) { return &arg0->vm()
void JSC__JSGlobalObject__handleRejectedPromises(JSC__JSGlobalObject* arg0)
{
- return static_cast<Zig::GlobalObject*>(arg0)->handleRejectedPromises();
+ return jsCast<Zig::GlobalObject*>(arg0)->handleRejectedPromises();
}
#pragma mark - JSC::JSValue
@@ -3012,20 +3072,16 @@ JSC__JSValue JSC__JSValue__jsNumberFromUint64(uint64_t arg0)
int64_t JSC__JSValue__toInt64(JSC__JSValue val)
{
- JSC::JSValue _val = JSC::JSValue::decode(val);
-
- int64_t result = JSC::tryConvertToInt52(_val.asDouble());
- if (result != JSC::JSValue::notInt52) {
- return result;
- }
-
- if (_val.isHeapBigInt()) {
-
- if (auto* heapBigInt = _val.asHeapBigInt()) {
+ JSC::JSValue value = JSC::JSValue::decode(val);
+ ASSERT(value.isHeapBigInt() || value.isNumber());
+ if (value.isHeapBigInt()) {
+ if (auto* heapBigInt = value.asHeapBigInt()) {
return heapBigInt->toBigInt64(heapBigInt);
}
}
- return _val.asAnyInt();
+ if (value.isInt32())
+ return value.asInt32();
+ return static_cast<int64_t>(value.asDouble());
}
uint8_t JSC__JSValue__asBigIntCompare(JSC__JSValue JSValue0, JSC__JSGlobalObject* globalObject, JSC__JSValue JSValue1)
@@ -3086,28 +3142,28 @@ JSC__JSValue JSC__JSValue__fromUInt64NoTruncate(JSC__JSGlobalObject* globalObjec
uint64_t JSC__JSValue__toUInt64NoTruncate(JSC__JSValue val)
{
- JSC::JSValue _val = JSC::JSValue::decode(val);
-
- int64_t result = JSC::tryConvertToInt52(_val.asDouble());
- if (result != JSC::JSValue::notInt52) {
- if (result < 0)
- return 0;
+ JSC::JSValue value = JSC::JSValue::decode(val);
+ ASSERT(value.isHeapBigInt() || value.isNumber());
- return static_cast<uint64_t>(result);
- }
-
- if (_val.isHeapBigInt()) {
-
- if (auto* heapBigInt = _val.asHeapBigInt()) {
+ if (value.isHeapBigInt()) {
+ if (auto* heapBigInt = value.asHeapBigInt()) {
return heapBigInt->toBigUInt64(heapBigInt);
}
}
- if (!_val.isNumber()) {
- return 0;
+ if (value.isInt32()) {
+ return static_cast<uint64_t>(value.asInt32());
}
+ ASSERT(value.isDouble());
- return static_cast<uint64_t>(_val.asAnyInt());
+ int64_t result = JSC::tryConvertToInt52(value.asDouble());
+ if (result != JSC::JSValue::notInt52) {
+ if (result < 0)
+ return 0;
+
+ return static_cast<uint64_t>(result);
+ }
+ return 0;
}
JSC__JSValue JSC__JSValue__createObject2(JSC__JSGlobalObject* globalObject, const ZigString* arg1,
@@ -4046,6 +4102,7 @@ enum class BuiltinNamesMap : uint8_t {
method,
headers,
status,
+ statusText,
url,
body,
data,
@@ -4065,6 +4122,9 @@ static JSC::Identifier builtinNameMap(JSC::JSGlobalObject* globalObject, unsigne
case BuiltinNamesMap::headers: {
return clientData->builtinNames().headersPublicName();
}
+ case BuiltinNamesMap::statusText: {
+ return clientData->builtinNames().statusTextPublicName();
+ }
case BuiltinNamesMap::status: {
return clientData->builtinNames().statusPublicName();
}
@@ -4485,6 +4545,14 @@ extern "C" void JSC__JSGlobalObject__queueMicrotaskJob(JSC__JSGlobalObject* arg0
JSC::JSValue::decode(JSValue4));
}
+extern "C" WebCore::AbortSignal* WebCore__AbortSignal__new(JSC__JSGlobalObject* globalObject)
+{
+ Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(globalObject);
+ auto* context = thisObject->scriptExecutionContext();
+ RefPtr<WebCore::AbortSignal> abortSignal = WebCore::AbortSignal::create(context);
+ return abortSignal.leakRef();
+}
+
extern "C" JSC__JSValue WebCore__AbortSignal__create(JSC__JSGlobalObject* globalObject)
{
Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(globalObject);
@@ -4701,4 +4769,4 @@ CPP_DECL void JSC__VM__setControlFlowProfiler(JSC__VM* vm, bool isEnabled)
} else {
vm->disableControlFlowProfiler();
}
-} \ No newline at end of file
+}
diff --git a/src/bun.js/bindings/bindings.zig b/src/bun.js/bindings/bindings.zig
index 1a82fc5e6..98e91c1ca 100644
--- a/src/bun.js/bindings/bindings.zig
+++ b/src/bun.js/bindings/bindings.zig
@@ -1969,6 +1969,12 @@ pub const AbortSignal = extern opaque {
return cppFn("create", .{global});
}
+ extern fn WebCore__AbortSignal__new(*JSGlobalObject) *AbortSignal;
+ pub fn new(global: *JSGlobalObject) *AbortSignal {
+ JSC.markBinding(@src());
+ return WebCore__AbortSignal__new(global);
+ }
+
pub fn createAbortError(message: *const ZigString, code: *const ZigString, global: *JSGlobalObject) JSValue {
return cppFn("createAbortError", .{ message, code, global });
}
@@ -3034,7 +3040,7 @@ pub const JSValue = enum(JSValueReprInt) {
zero = 0,
undefined = @as(JSValueReprInt, @bitCast(@as(i64, 0xa))),
null = @as(JSValueReprInt, @bitCast(@as(i64, 0x2))),
- true = @as(JSValueReprInt, @bitCast(@as(i64, 0x4))),
+ true = FFI.TrueI64,
false = @as(JSValueReprInt, @bitCast(@as(i64, 0x6))),
_,
@@ -3224,7 +3230,7 @@ pub const JSValue = enum(JSValueReprInt) {
};
}
- pub fn isObject(this: JSType) bool {
+ pub inline fn isObject(this: JSType) bool {
// inline constexpr bool isObjectType(JSType type) { return type >= ObjectType; }
return @intFromEnum(this) >= @intFromEnum(JSType.Object);
}
@@ -3527,7 +3533,7 @@ pub const JSValue = enum(JSValueReprInt) {
}
pub fn createEmptyObject(global: *JSGlobalObject, len: usize) JSValue {
- std.debug.assert(len <= 64); // max inline capacity JSC allows is 64. If you run into this, just set it to 0.
+ std.debug.assert(len <= 63); // max inline capacity JSC allows is 63. If you run into this, just set it to 0.
return cppFn("createEmptyObject", .{ global, len });
}
@@ -3903,6 +3909,10 @@ pub const JSValue = enum(JSValueReprInt) {
return jsNumberFromInt32(@as(i32, @intCast(i)));
}
+ return jsNumberFromPtrSize(i);
+ }
+
+ pub fn jsNumberFromPtrSize(i: usize) JSValue {
return jsNumberFromDouble(@as(f64, @floatFromInt(@as(i52, @intCast(@as(u51, @truncate(i)))))));
}
@@ -4255,6 +4265,7 @@ pub const JSValue = enum(JSValueReprInt) {
method,
headers,
status,
+ statusText,
url,
body,
data,
@@ -4924,6 +4935,34 @@ pub const JSValue = enum(JSValueReprInt) {
pub inline fn deserialize(bytes: []const u8, global: *JSGlobalObject) JSValue {
return Bun__JSValue__deserialize(global, bytes.ptr, @intCast(bytes.len));
}
+
+ extern fn Bun__serializeJSValue(global: *JSC.JSGlobalObject, value: JSValue) SerializedScriptValue.External;
+ extern fn Bun__SerializedScriptSlice__free(*anyopaque) void;
+
+ pub const SerializedScriptValue = struct {
+ data: []const u8,
+ handle: *anyopaque,
+
+ const External = extern struct {
+ bytes: ?[*]const u8,
+ size: isize,
+ handle: ?*anyopaque,
+ };
+
+ pub inline fn deinit(self: @This()) void {
+ Bun__SerializedScriptSlice__free(self.handle);
+ }
+ };
+
+ /// Throws a JS exception and returns null if the serialization fails, otherwise returns a SerializedScriptValue.
+ /// Must be freed when you are done with the bytes.
+ pub inline fn serialize(this: JSValue, global: *JSGlobalObject) ?SerializedScriptValue {
+ const value = Bun__serializeJSValue(global, this);
+ return if (value.bytes) |bytes|
+ .{ .data = bytes[0..@intCast(value.size)], .handle = value.handle.? }
+ else
+ null;
+ }
};
extern "c" fn AsyncContextFrame__withAsyncContextIfNeeded(global: *JSGlobalObject, callback: JSValue) JSValue;
@@ -5492,6 +5531,7 @@ pub const URL = opaque {
extern fn URL__getHref(*String) String;
extern fn URL__getFileURLString(*String) String;
extern fn URL__getHrefJoin(*String, *String) String;
+ extern fn URL__pathFromFileURL(*String) String;
pub fn hrefFromString(str: bun.String) String {
JSC.markBinding(@src());
@@ -5512,6 +5552,12 @@ pub const URL = opaque {
return URL__getFileURLString(&input);
}
+ pub fn pathFromFileURL(str: bun.String) String {
+ JSC.markBinding(@src());
+ var input = str;
+ return URL__pathFromFileURL(&input);
+ }
+
/// This percent-encodes the URL, punycode-encodes the hostname, and returns the result
/// If it fails, the tag is marked Dead
pub fn hrefFromJS(value: JSValue, globalObject: *JSC.JSGlobalObject) String {
@@ -5816,7 +5862,7 @@ pub fn initialize() void {
\\
\\ https://github.com/oven-sh/webkit/blob/main/Source/JavaScriptCore/runtime/OptionsList.h
\\
- \\Environment variables must be prefixed with "BUN_JSC_". This code runs before .env files are loaded, so those won't work here.
+ \\Environment variables must be prefixed with "BUN_JSC_". This code runs before .env files are loaded, so those won't work here.
\\
\\Warning: options change between releases of Bun and WebKit without notice. This is not a stable API, you should not rely on it beyond debugging something, and it may be removed entirely in a future version of Bun.
,
diff --git a/src/bun.js/bindings/c-bindings.cpp b/src/bun.js/bindings/c-bindings.cpp
index ff4c8c4e7..f53ff52cc 100644
--- a/src/bun.js/bindings/c-bindings.cpp
+++ b/src/bun.js/bindings/c-bindings.cpp
@@ -1,4 +1,5 @@
// when we don't want to use @cInclude, we can just stick wrapper functions here
+#include "root.h"
#include <sys/resource.h>
#include <cstdint>
#include <unistd.h>
@@ -6,6 +7,32 @@
#include <sys/stat.h>
#include <sys/signal.h>
+#if CPU(X86_64)
+#include <cstring>
+#include <cpuid.h>
+
+extern "C" void bun_warn_avx_missing(const char* url)
+{
+ __builtin_cpu_init();
+ if (__builtin_cpu_supports("avx")) {
+ return;
+ }
+
+ static constexpr const char* str = "warn: CPU lacks AVX support, strange crashes may occur. Reinstall Bun or use *-baseline build:\n ";
+ const size_t len = strlen(str);
+
+ char buf[512];
+ strcpy(buf, str);
+ strcpy(buf + len, url);
+ strcpy(buf + len + strlen(url), "\n\0");
+ write(STDERR_FILENO, buf, strlen(buf));
+}
+#else
+extern "C" void bun_warn_avx_missing(char* url)
+{
+}
+#endif
+
extern "C" int32_t get_process_priority(uint32_t pid)
{
return getpriority(PRIO_PROCESS, pid);
@@ -48,4 +75,4 @@ extern "C" ssize_t bun_sysconf__SC_CLK_TCK()
#else
return 0;
#endif
-} \ No newline at end of file
+}
diff --git a/src/bun.js/bindings/exports.zig b/src/bun.js/bindings/exports.zig
index 18b7c8bce..617530ec6 100644
--- a/src/bun.js/bindings/exports.zig
+++ b/src/bun.js/bindings/exports.zig
@@ -969,7 +969,7 @@ pub const ZigConsoleClient = struct {
Output.prettyFmt("<r><red>Assertion failed<r>\n", true)
else
"Assertion failed\n";
- console.error_writer.unbuffered_writer.writeAll(text) catch unreachable;
+ console.error_writer.unbuffered_writer.writeAll(text) catch {};
return;
}
@@ -983,28 +983,48 @@ pub const ZigConsoleClient = struct {
else
console.writer;
var writer = buffered_writer.writer();
-
const Writer = @TypeOf(writer);
- if (len > 0)
+
+ var print_length = len;
+ var print_options: FormatOptions = .{
+ .enable_colors = enable_colors,
+ .add_newline = true,
+ .flush = true,
+ };
+
+ if (message_type == .Dir and len >= 2) {
+ print_length = 1;
+ var opts = vals[1];
+ if (opts.isObject()) {
+ if (opts.get(global, "depth")) |depth_prop| {
+ if (depth_prop.isNumber())
+ print_options.max_depth = depth_prop.toU16();
+ if (depth_prop.isNull() or depth_prop.toInt64() == std.math.maxInt(i64))
+ print_options.max_depth = std.math.maxInt(u16);
+ }
+ if (opts.get(global, "colors")) |colors_prop| {
+ if (colors_prop.isBoolean())
+ print_options.enable_colors = colors_prop.toBoolean();
+ }
+ }
+ }
+
+ if (print_length > 0)
format(
level,
global,
vals,
- len,
+ print_length,
@TypeOf(buffered_writer.unbuffered_writer.context),
Writer,
writer,
- .{
- .enable_colors = enable_colors,
- .add_newline = true,
- .flush = true,
- },
+ print_options,
)
else if (message_type == .Log) {
_ = console.writer.write("\n") catch 0;
console.writer.flush() catch {};
} else if (message_type != .Trace)
- writer.writeAll("undefined\n") catch unreachable;
+ writer.writeAll("undefined\n") catch {};
if (message_type == .Trace) {
writeTrace(Writer, writer, global);
@@ -1026,14 +1046,14 @@ pub const ZigConsoleClient = struct {
writer,
exception.stack,
true,
- ) catch unreachable
+ ) catch {}
else
JS.VirtualMachine.printStackTrace(
Writer,
writer,
exception.stack,
false,
- ) catch unreachable;
+ ) catch {};
}
pub const FormatOptions = struct {
@@ -1042,7 +1062,7 @@ pub const ZigConsoleClient = struct {
flush: bool,
ordered_properties: bool = false,
quote_strings: bool = false,
- max_depth: u16 = 8,
+ max_depth: u16 = 2,
};
pub fn format(
@@ -1082,7 +1102,7 @@ pub const ZigConsoleClient = struct {
if (tag.tag == .String) {
if (options.enable_colors) {
if (level == .Error) {
- unbuffered_writer.writeAll(comptime Output.prettyFmt("<r><red>", true)) catch unreachable;
+ unbuffered_writer.writeAll(comptime Output.prettyFmt("<r><red>", true)) catch {};
}
fmt.format(
tag,
@@ -1093,7 +1113,7 @@ pub const ZigConsoleClient = struct {
true,
);
if (level == .Error) {
- unbuffered_writer.writeAll(comptime Output.prettyFmt("<r>", true)) catch unreachable;
+ unbuffered_writer.writeAll(comptime Output.prettyFmt("<r>", true)) catch {};
}
} else {
fmt.format(
@@ -1155,7 +1175,7 @@ pub const ZigConsoleClient = struct {
var any = false;
if (options.enable_colors) {
if (level == .Error) {
- writer.writeAll(comptime Output.prettyFmt("<r><red>", true)) catch unreachable;
+ writer.writeAll(comptime Output.prettyFmt("<r><red>", true)) catch {};
}
while (true) {
if (any) {
@@ -1177,7 +1197,7 @@ pub const ZigConsoleClient = struct {
fmt.remaining_values = fmt.remaining_values[1..];
}
if (level == .Error) {
- writer.writeAll(comptime Output.prettyFmt("<r>", true)) catch unreachable;
+ writer.writeAll(comptime Output.prettyFmt("<r>", true)) catch {};
}
} else {
while (true) {
@@ -2119,7 +2139,7 @@ pub const ZigConsoleClient = struct {
this.globalThis,
this.custom_formatted_object.function,
this.custom_formatted_object.this,
- this.max_depth - this.depth,
+ this.max_depth -| this.depth,
this.max_depth,
enable_ansi_colors,
);
@@ -2158,7 +2178,7 @@ pub const ZigConsoleClient = struct {
this.addForNewLine(printable.len);
if (printable.len == 0) {
- writer.print(comptime Output.prettyFmt("<cyan>[class]<r>", enable_ansi_colors), .{});
+ writer.print(comptime Output.prettyFmt("<cyan>[class (anonymous)]<r>", enable_ansi_colors), .{});
} else {
writer.print(comptime Output.prettyFmt("<cyan>[class {}]<r>", enable_ansi_colors), .{printable});
}
diff --git a/src/bun.js/bindings/generated_classes.zig b/src/bun.js/bindings/generated_classes.zig
index 329506718..c4f63084b 100644
--- a/src/bun.js/bindings/generated_classes.zig
+++ b/src/bun.js/bindings/generated_classes.zig
@@ -1220,6 +1220,28 @@ pub const JSDebugHTTPSServer = struct {
return DebugHTTPSServer__fromJS(value);
}
+ extern fn DebugHTTPSServerPrototype__addressSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+
+ extern fn DebugHTTPSServerPrototype__addressGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `DebugHTTPSServer.address` setter
+ /// This value will be visited by the garbage collector.
+ pub fn addressSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ DebugHTTPSServerPrototype__addressSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `DebugHTTPSServer.address` getter
+ /// This value will be visited by the garbage collector.
+ pub fn addressGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = DebugHTTPSServerPrototype__addressGetCachedValue(thisValue);
+ if (result == .zero)
+ return null;
+
+ return result;
+ }
+
extern fn DebugHTTPSServerPrototype__hostnameSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
extern fn DebugHTTPSServerPrototype__hostnameGetCachedValue(JSC.JSValue) JSC.JSValue;
@@ -1300,6 +1322,9 @@ pub const JSDebugHTTPSServer = struct {
@compileLog("DebugHTTPSServer.finalize is not a finalizer");
}
+ if (@TypeOf(DebugHTTPSServer.getAddress) != GetterType)
+ @compileLog("Expected DebugHTTPSServer.getAddress to be a getter");
+
if (@TypeOf(DebugHTTPSServer.getDevelopment) != GetterType)
@compileLog("Expected DebugHTTPSServer.getDevelopment to be a getter");
@@ -1327,6 +1352,8 @@ pub const JSDebugHTTPSServer = struct {
@compileLog("Expected DebugHTTPSServer.doPublish to be a callback but received " ++ @typeName(@TypeOf(DebugHTTPSServer.doPublish)));
if (@TypeOf(DebugHTTPSServer.doReload) != CallbackType)
@compileLog("Expected DebugHTTPSServer.doReload to be a callback but received " ++ @typeName(@TypeOf(DebugHTTPSServer.doReload)));
+ if (@TypeOf(DebugHTTPSServer.doRequestIP) != CallbackType)
+ @compileLog("Expected DebugHTTPSServer.doRequestIP to be a callback but received " ++ @typeName(@TypeOf(DebugHTTPSServer.doRequestIP)));
if (@TypeOf(DebugHTTPSServer.doStop) != CallbackType)
@compileLog("Expected DebugHTTPSServer.doStop to be a callback but received " ++ @typeName(@TypeOf(DebugHTTPSServer.doStop)));
if (@TypeOf(DebugHTTPSServer.doUpgrade) != CallbackType)
@@ -1335,9 +1362,11 @@ pub const JSDebugHTTPSServer = struct {
@export(DebugHTTPSServer.doFetch, .{ .name = "DebugHTTPSServerPrototype__doFetch" });
@export(DebugHTTPSServer.doPublish, .{ .name = "DebugHTTPSServerPrototype__doPublish" });
@export(DebugHTTPSServer.doReload, .{ .name = "DebugHTTPSServerPrototype__doReload" });
+ @export(DebugHTTPSServer.doRequestIP, .{ .name = "DebugHTTPSServerPrototype__doRequestIP" });
@export(DebugHTTPSServer.doStop, .{ .name = "DebugHTTPSServerPrototype__doStop" });
@export(DebugHTTPSServer.doUpgrade, .{ .name = "DebugHTTPSServerPrototype__doUpgrade" });
@export(DebugHTTPSServer.finalize, .{ .name = "DebugHTTPSServerClass__finalize" });
+ @export(DebugHTTPSServer.getAddress, .{ .name = "DebugHTTPSServerPrototype__getAddress" });
@export(DebugHTTPSServer.getDevelopment, .{ .name = "DebugHTTPSServerPrototype__getDevelopment" });
@export(DebugHTTPSServer.getHostname, .{ .name = "DebugHTTPSServerPrototype__getHostname" });
@export(DebugHTTPSServer.getId, .{ .name = "DebugHTTPSServerPrototype__getId" });
@@ -1363,6 +1392,28 @@ pub const JSDebugHTTPServer = struct {
return DebugHTTPServer__fromJS(value);
}
+ extern fn DebugHTTPServerPrototype__addressSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+
+ extern fn DebugHTTPServerPrototype__addressGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `DebugHTTPServer.address` setter
+ /// This value will be visited by the garbage collector.
+ pub fn addressSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ DebugHTTPServerPrototype__addressSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `DebugHTTPServer.address` getter
+ /// This value will be visited by the garbage collector.
+ pub fn addressGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = DebugHTTPServerPrototype__addressGetCachedValue(thisValue);
+ if (result == .zero)
+ return null;
+
+ return result;
+ }
+
extern fn DebugHTTPServerPrototype__hostnameSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
extern fn DebugHTTPServerPrototype__hostnameGetCachedValue(JSC.JSValue) JSC.JSValue;
@@ -1443,6 +1494,9 @@ pub const JSDebugHTTPServer = struct {
@compileLog("DebugHTTPServer.finalize is not a finalizer");
}
+ if (@TypeOf(DebugHTTPServer.getAddress) != GetterType)
+ @compileLog("Expected DebugHTTPServer.getAddress to be a getter");
+
if (@TypeOf(DebugHTTPServer.getDevelopment) != GetterType)
@compileLog("Expected DebugHTTPServer.getDevelopment to be a getter");
@@ -1470,6 +1524,8 @@ pub const JSDebugHTTPServer = struct {
@compileLog("Expected DebugHTTPServer.doPublish to be a callback but received " ++ @typeName(@TypeOf(DebugHTTPServer.doPublish)));
if (@TypeOf(DebugHTTPServer.doReload) != CallbackType)
@compileLog("Expected DebugHTTPServer.doReload to be a callback but received " ++ @typeName(@TypeOf(DebugHTTPServer.doReload)));
+ if (@TypeOf(DebugHTTPServer.doRequestIP) != CallbackType)
+ @compileLog("Expected DebugHTTPServer.doRequestIP to be a callback but received " ++ @typeName(@TypeOf(DebugHTTPServer.doRequestIP)));
if (@TypeOf(DebugHTTPServer.doStop) != CallbackType)
@compileLog("Expected DebugHTTPServer.doStop to be a callback but received " ++ @typeName(@TypeOf(DebugHTTPServer.doStop)));
if (@TypeOf(DebugHTTPServer.doUpgrade) != CallbackType)
@@ -1478,9 +1534,11 @@ pub const JSDebugHTTPServer = struct {
@export(DebugHTTPServer.doFetch, .{ .name = "DebugHTTPServerPrototype__doFetch" });
@export(DebugHTTPServer.doPublish, .{ .name = "DebugHTTPServerPrototype__doPublish" });
@export(DebugHTTPServer.doReload, .{ .name = "DebugHTTPServerPrototype__doReload" });
+ @export(DebugHTTPServer.doRequestIP, .{ .name = "DebugHTTPServerPrototype__doRequestIP" });
@export(DebugHTTPServer.doStop, .{ .name = "DebugHTTPServerPrototype__doStop" });
@export(DebugHTTPServer.doUpgrade, .{ .name = "DebugHTTPServerPrototype__doUpgrade" });
@export(DebugHTTPServer.finalize, .{ .name = "DebugHTTPServerClass__finalize" });
+ @export(DebugHTTPServer.getAddress, .{ .name = "DebugHTTPServerPrototype__getAddress" });
@export(DebugHTTPServer.getDevelopment, .{ .name = "DebugHTTPServerPrototype__getDevelopment" });
@export(DebugHTTPServer.getHostname, .{ .name = "DebugHTTPServerPrototype__getHostname" });
@export(DebugHTTPServer.getId, .{ .name = "DebugHTTPServerPrototype__getId" });
@@ -2205,6 +2263,8 @@ pub const JSExpect = struct {
@compileLog("Expected Expect.toEndWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toEndWith)));
if (@TypeOf(Expect.toEqual) != CallbackType)
@compileLog("Expected Expect.toEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toEqual)));
+ if (@TypeOf(Expect.toEqualIgnoringWhitespace) != CallbackType)
+ @compileLog("Expected Expect.toEqualIgnoringWhitespace to be a callback but received " ++ @typeName(@TypeOf(Expect.toEqualIgnoringWhitespace)));
if (@TypeOf(Expect.toHaveBeenCalled) != CallbackType)
@compileLog("Expected Expect.toHaveBeenCalled to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenCalled)));
if (@TypeOf(Expect.toHaveBeenCalledTimes) != CallbackType)
@@ -2341,6 +2401,7 @@ pub const JSExpect = struct {
@export(Expect.toContainEqual, .{ .name = "ExpectPrototype__toContainEqual" });
@export(Expect.toEndWith, .{ .name = "ExpectPrototype__toEndWith" });
@export(Expect.toEqual, .{ .name = "ExpectPrototype__toEqual" });
+ @export(Expect.toEqualIgnoringWhitespace, .{ .name = "ExpectPrototype__toEqualIgnoringWhitespace" });
@export(Expect.toHaveBeenCalled, .{ .name = "ExpectPrototype__toHaveBeenCalled" });
@export(Expect.toHaveBeenCalledTimes, .{ .name = "ExpectPrototype__toHaveBeenCalledTimes" });
@export(Expect.toHaveBeenCalledWith, .{ .name = "ExpectPrototype__toHaveBeenCalledWith" });
@@ -2507,6 +2568,87 @@ pub const JSExpectAnything = struct {
}
}
};
+pub const JSExpectArrayContaining = struct {
+ const ExpectArrayContaining = Classes.ExpectArrayContaining;
+ const GetterType = fn (*ExpectArrayContaining, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*ExpectArrayContaining, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*ExpectArrayContaining, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*ExpectArrayContaining, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*ExpectArrayContaining, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+
+ /// Return the pointer to the wrapped object.
+ /// If the object does not match the type, return null.
+ pub fn fromJS(value: JSC.JSValue) ?*ExpectArrayContaining {
+ JSC.markBinding(@src());
+ return ExpectArrayContaining__fromJS(value);
+ }
+
+ extern fn ExpectArrayContainingPrototype__arrayValueSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+
+ extern fn ExpectArrayContainingPrototype__arrayValueGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `ExpectArrayContaining.arrayValue` setter
+ /// This value will be visited by the garbage collector.
+ pub fn arrayValueSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ ExpectArrayContainingPrototype__arrayValueSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `ExpectArrayContaining.arrayValue` getter
+ /// This value will be visited by the garbage collector.
+ pub fn arrayValueGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = ExpectArrayContainingPrototype__arrayValueGetCachedValue(thisValue);
+ if (result == .zero)
+ return null;
+
+ return result;
+ }
+
+ /// Create a new instance of ExpectArrayContaining
+ pub fn toJS(this: *ExpectArrayContaining, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
+ JSC.markBinding(@src());
+ if (comptime Environment.allow_assert) {
+ const value__ = ExpectArrayContaining__create(globalObject, this);
+ std.debug.assert(value__.as(ExpectArrayContaining).? == this); // If this fails, likely a C ABI issue.
+ return value__;
+ } else {
+ return ExpectArrayContaining__create(globalObject, this);
+ }
+ }
+
+ /// Modify the internal ptr to point to a new instance of ExpectArrayContaining.
+ pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*ExpectArrayContaining) bool {
+ JSC.markBinding(@src());
+ return ExpectArrayContaining__dangerouslySetPtr(value, ptr);
+ }
+
+ /// Detach the ptr from the thisValue
+ pub fn detachPtr(_: *ExpectArrayContaining, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ std.debug.assert(ExpectArrayContaining__dangerouslySetPtr(value, null));
+ }
+
+ extern fn ExpectArrayContaining__fromJS(JSC.JSValue) ?*ExpectArrayContaining;
+ extern fn ExpectArrayContaining__getConstructor(*JSC.JSGlobalObject) JSC.JSValue;
+
+ extern fn ExpectArrayContaining__create(globalObject: *JSC.JSGlobalObject, ptr: ?*ExpectArrayContaining) JSC.JSValue;
+
+ extern fn ExpectArrayContaining__dangerouslySetPtr(JSC.JSValue, ?*ExpectArrayContaining) bool;
+
+ comptime {
+ if (@TypeOf(ExpectArrayContaining.finalize) != (fn (*ExpectArrayContaining) callconv(.C) void)) {
+ @compileLog("ExpectArrayContaining.finalize is not a finalizer");
+ }
+
+ if (@TypeOf(ExpectArrayContaining.call) != StaticCallbackType)
+ @compileLog("Expected ExpectArrayContaining.call to be a static callback");
+ if (!JSC.is_bindgen) {
+ @export(ExpectArrayContaining.call, .{ .name = "ExpectArrayContainingClass__call" });
+ @export(ExpectArrayContaining.finalize, .{ .name = "ExpectArrayContainingClass__finalize" });
+ }
+ }
+};
pub const JSExpectStringContaining = struct {
const ExpectStringContaining = Classes.ExpectStringContaining;
const GetterType = fn (*ExpectStringContaining, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
@@ -3089,6 +3231,28 @@ pub const JSHTTPSServer = struct {
return HTTPSServer__fromJS(value);
}
+ extern fn HTTPSServerPrototype__addressSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+
+ extern fn HTTPSServerPrototype__addressGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `HTTPSServer.address` setter
+ /// This value will be visited by the garbage collector.
+ pub fn addressSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ HTTPSServerPrototype__addressSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `HTTPSServer.address` getter
+ /// This value will be visited by the garbage collector.
+ pub fn addressGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = HTTPSServerPrototype__addressGetCachedValue(thisValue);
+ if (result == .zero)
+ return null;
+
+ return result;
+ }
+
extern fn HTTPSServerPrototype__hostnameSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
extern fn HTTPSServerPrototype__hostnameGetCachedValue(JSC.JSValue) JSC.JSValue;
@@ -3169,6 +3333,9 @@ pub const JSHTTPSServer = struct {
@compileLog("HTTPSServer.finalize is not a finalizer");
}
+ if (@TypeOf(HTTPSServer.getAddress) != GetterType)
+ @compileLog("Expected HTTPSServer.getAddress to be a getter");
+
if (@TypeOf(HTTPSServer.getDevelopment) != GetterType)
@compileLog("Expected HTTPSServer.getDevelopment to be a getter");
@@ -3196,6 +3363,8 @@ pub const JSHTTPSServer = struct {
@compileLog("Expected HTTPSServer.doPublish to be a callback but received " ++ @typeName(@TypeOf(HTTPSServer.doPublish)));
if (@TypeOf(HTTPSServer.doReload) != CallbackType)
@compileLog("Expected HTTPSServer.doReload to be a callback but received " ++ @typeName(@TypeOf(HTTPSServer.doReload)));
+ if (@TypeOf(HTTPSServer.doRequestIP) != CallbackType)
+ @compileLog("Expected HTTPSServer.doRequestIP to be a callback but received " ++ @typeName(@TypeOf(HTTPSServer.doRequestIP)));
if (@TypeOf(HTTPSServer.doStop) != CallbackType)
@compileLog("Expected HTTPSServer.doStop to be a callback but received " ++ @typeName(@TypeOf(HTTPSServer.doStop)));
if (@TypeOf(HTTPSServer.doUpgrade) != CallbackType)
@@ -3204,9 +3373,11 @@ pub const JSHTTPSServer = struct {
@export(HTTPSServer.doFetch, .{ .name = "HTTPSServerPrototype__doFetch" });
@export(HTTPSServer.doPublish, .{ .name = "HTTPSServerPrototype__doPublish" });
@export(HTTPSServer.doReload, .{ .name = "HTTPSServerPrototype__doReload" });
+ @export(HTTPSServer.doRequestIP, .{ .name = "HTTPSServerPrototype__doRequestIP" });
@export(HTTPSServer.doStop, .{ .name = "HTTPSServerPrototype__doStop" });
@export(HTTPSServer.doUpgrade, .{ .name = "HTTPSServerPrototype__doUpgrade" });
@export(HTTPSServer.finalize, .{ .name = "HTTPSServerClass__finalize" });
+ @export(HTTPSServer.getAddress, .{ .name = "HTTPSServerPrototype__getAddress" });
@export(HTTPSServer.getDevelopment, .{ .name = "HTTPSServerPrototype__getDevelopment" });
@export(HTTPSServer.getHostname, .{ .name = "HTTPSServerPrototype__getHostname" });
@export(HTTPSServer.getId, .{ .name = "HTTPSServerPrototype__getId" });
@@ -3232,6 +3403,28 @@ pub const JSHTTPServer = struct {
return HTTPServer__fromJS(value);
}
+ extern fn HTTPServerPrototype__addressSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+
+ extern fn HTTPServerPrototype__addressGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `HTTPServer.address` setter
+ /// This value will be visited by the garbage collector.
+ pub fn addressSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ HTTPServerPrototype__addressSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `HTTPServer.address` getter
+ /// This value will be visited by the garbage collector.
+ pub fn addressGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = HTTPServerPrototype__addressGetCachedValue(thisValue);
+ if (result == .zero)
+ return null;
+
+ return result;
+ }
+
extern fn HTTPServerPrototype__hostnameSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
extern fn HTTPServerPrototype__hostnameGetCachedValue(JSC.JSValue) JSC.JSValue;
@@ -3312,6 +3505,9 @@ pub const JSHTTPServer = struct {
@compileLog("HTTPServer.finalize is not a finalizer");
}
+ if (@TypeOf(HTTPServer.getAddress) != GetterType)
+ @compileLog("Expected HTTPServer.getAddress to be a getter");
+
if (@TypeOf(HTTPServer.getDevelopment) != GetterType)
@compileLog("Expected HTTPServer.getDevelopment to be a getter");
@@ -3339,6 +3535,8 @@ pub const JSHTTPServer = struct {
@compileLog("Expected HTTPServer.doPublish to be a callback but received " ++ @typeName(@TypeOf(HTTPServer.doPublish)));
if (@TypeOf(HTTPServer.doReload) != CallbackType)
@compileLog("Expected HTTPServer.doReload to be a callback but received " ++ @typeName(@TypeOf(HTTPServer.doReload)));
+ if (@TypeOf(HTTPServer.doRequestIP) != CallbackType)
+ @compileLog("Expected HTTPServer.doRequestIP to be a callback but received " ++ @typeName(@TypeOf(HTTPServer.doRequestIP)));
if (@TypeOf(HTTPServer.doStop) != CallbackType)
@compileLog("Expected HTTPServer.doStop to be a callback but received " ++ @typeName(@TypeOf(HTTPServer.doStop)));
if (@TypeOf(HTTPServer.doUpgrade) != CallbackType)
@@ -3347,9 +3545,11 @@ pub const JSHTTPServer = struct {
@export(HTTPServer.doFetch, .{ .name = "HTTPServerPrototype__doFetch" });
@export(HTTPServer.doPublish, .{ .name = "HTTPServerPrototype__doPublish" });
@export(HTTPServer.doReload, .{ .name = "HTTPServerPrototype__doReload" });
+ @export(HTTPServer.doRequestIP, .{ .name = "HTTPServerPrototype__doRequestIP" });
@export(HTTPServer.doStop, .{ .name = "HTTPServerPrototype__doStop" });
@export(HTTPServer.doUpgrade, .{ .name = "HTTPServerPrototype__doUpgrade" });
@export(HTTPServer.finalize, .{ .name = "HTTPServerClass__finalize" });
+ @export(HTTPServer.getAddress, .{ .name = "HTTPServerPrototype__getAddress" });
@export(HTTPServer.getDevelopment, .{ .name = "HTTPServerPrototype__getDevelopment" });
@export(HTTPServer.getHostname, .{ .name = "HTTPServerPrototype__getHostname" });
@export(HTTPServer.getId, .{ .name = "HTTPServerPrototype__getId" });
@@ -6781,6 +6981,9 @@ pub const JSTextDecoder = struct {
if (@TypeOf(TextDecoder.getFatal) != GetterType)
@compileLog("Expected TextDecoder.getFatal to be a getter");
+ if (@TypeOf(TextDecoder.getIgnoreBOM) != GetterType)
+ @compileLog("Expected TextDecoder.getIgnoreBOM to be a getter");
+
if (!JSC.is_bindgen) {
@export(TextDecoder.constructor, .{ .name = "TextDecoderClass__construct" });
@export(TextDecoder.decode, .{ .name = "TextDecoderPrototype__decode" });
@@ -6788,6 +6991,7 @@ pub const JSTextDecoder = struct {
@export(TextDecoder.finalize, .{ .name = "TextDecoderClass__finalize" });
@export(TextDecoder.getEncoding, .{ .name = "TextDecoderPrototype__getEncoding" });
@export(TextDecoder.getFatal, .{ .name = "TextDecoderPrototype__getFatal" });
+ @export(TextDecoder.getIgnoreBOM, .{ .name = "TextDecoderPrototype__getIgnoreBOM" });
}
}
};
@@ -7006,6 +7210,7 @@ comptime {
_ = JSExpect;
_ = JSExpectAny;
_ = JSExpectAnything;
+ _ = JSExpectArrayContaining;
_ = JSExpectStringContaining;
_ = JSExpectStringMatching;
_ = JSFFI;
diff --git a/src/bun.js/bindings/generated_classes_list.zig b/src/bun.js/bindings/generated_classes_list.zig
index a86f74dd3..3b45f33b8 100644
--- a/src/bun.js/bindings/generated_classes_list.zig
+++ b/src/bun.js/bindings/generated_classes_list.zig
@@ -17,6 +17,7 @@ pub const Classes = struct {
pub const ExpectAnything = JSC.Expect.ExpectAnything;
pub const ExpectStringContaining = JSC.Expect.ExpectStringContaining;
pub const ExpectStringMatching = JSC.Expect.ExpectStringMatching;
+ pub const ExpectArrayContaining = JSC.Expect.ExpectArrayContaining;
pub const FileSystemRouter = JSC.API.FileSystemRouter;
pub const Bundler = JSC.API.JSBundler;
pub const JSBundler = Bundler;
diff --git a/src/bun.js/bindings/headers-handwritten.h b/src/bun.js/bindings/headers-handwritten.h
index e19be7abe..d8cfa58ef 100644
--- a/src/bun.js/bindings/headers-handwritten.h
+++ b/src/bun.js/bindings/headers-handwritten.h
@@ -17,10 +17,6 @@ typedef union BunStringImpl {
void* wtf;
} BunStringImpl;
-typedef struct BunString {
- BunStringTag tag;
- BunStringImpl impl;
-} BunString;
#else
typedef union BunStringImpl {
ZigString zig;
@@ -34,13 +30,15 @@ enum class BunStringTag : uint8_t {
StaticZigString = 3,
Empty = 4,
};
+#endif
typedef struct BunString {
BunStringTag tag;
BunStringImpl impl;
-} BunString;
-#endif
+ inline void ref();
+ inline void deref();
+} BunString;
typedef struct ZigErrorType {
ZigErrorCode code;
@@ -241,6 +239,7 @@ extern "C" void BunString__toWTFString(BunString*);
namespace Bun {
JSC::JSValue toJS(JSC::JSGlobalObject*, BunString);
BunString toString(JSC::JSGlobalObject* globalObject, JSC::JSValue value);
+BunString toString(const char* bytes, size_t length);
WTF::String toWTFString(const BunString& bunString);
BunString toString(WTF::String& wtfString);
BunString toString(const WTF::String& wtfString);
@@ -348,3 +347,16 @@ class ScriptArguments;
using ScriptArguments = Inspector::ScriptArguments;
#endif
+
+ALWAYS_INLINE void BunString::ref()
+{
+ if (this->tag == BunStringTag::WTFStringImpl) {
+ this->impl.wtf->ref();
+ }
+}
+ALWAYS_INLINE void BunString::deref()
+{
+ if (this->tag == BunStringTag::WTFStringImpl) {
+ this->impl.wtf->deref();
+ }
+} \ No newline at end of file
diff --git a/src/bun.js/bindings/isBuiltinModule.cpp b/src/bun.js/bindings/isBuiltinModule.cpp
new file mode 100644
index 000000000..b8e69f479
--- /dev/null
+++ b/src/bun.js/bindings/isBuiltinModule.cpp
@@ -0,0 +1,98 @@
+#include "root.h"
+
+static constexpr ASCIILiteral builtinModuleNamesSortedLength[] = {
+ "fs"_s,
+ "os"_s,
+ "v8"_s,
+ "vm"_s,
+ "ws"_s,
+ "bun"_s,
+ "dns"_s,
+ "net"_s,
+ "sys"_s,
+ "tls"_s,
+ "tty"_s,
+ "url"_s,
+ "http"_s,
+ "path"_s,
+ "repl"_s,
+ "util"_s,
+ "wasi"_s,
+ "zlib"_s,
+ "dgram"_s,
+ "http2"_s,
+ "https"_s,
+ "assert"_s,
+ "buffer"_s,
+ "crypto"_s,
+ "domain"_s,
+ "events"_s,
+ "module"_s,
+ "stream"_s,
+ "timers"_s,
+ "undici"_s,
+ "bun:ffi"_s,
+ "bun:jsc"_s,
+ "cluster"_s,
+ "console"_s,
+ "process"_s,
+ "bun:wrap"_s,
+ "punycode"_s,
+ "bun:test"_s,
+ "bun:main"_s,
+ "readline"_s,
+ "_tls_wrap"_s,
+ "constants"_s,
+ "inspector"_s,
+ "bun:sqlite"_s,
+ "path/posix"_s,
+ "path/win32"_s,
+ "perf_hooks"_s,
+ "stream/web"_s,
+ "util/types"_s,
+ "_http_agent"_s,
+ "_tls_common"_s,
+ "async_hooks"_s,
+ "detect-libc"_s,
+ "fs/promises"_s,
+ "querystring"_s,
+ "_http_client"_s,
+ "_http_common"_s,
+ "_http_server"_s,
+ "_stream_wrap"_s,
+ "dns/promises"_s,
+ "trace_events"_s,
+ "assert/strict"_s,
+ "child_process"_s,
+ "_http_incoming"_s,
+ "_http_outgoing"_s,
+ "_stream_duplex"_s,
+ "string_decoder"_s,
+ "worker_threads"_s,
+ "stream/promises"_s,
+ "timers/promises"_s,
+ "_stream_readable"_s,
+ "_stream_writable"_s,
+ "stream/consumers"_s,
+ "_stream_transform"_s,
+ "readline/promises"_s,
+ "inspector/promises"_s,
+ "_stream_passthrough"_s,
+ "diagnostics_channel"_s,
+};
+
+namespace Bun {
+
+bool isBuiltinModule(const String &namePossiblyWithNodePrefix) {
+ String name = namePossiblyWithNodePrefix;
+ if (name.startsWith("node:"_s))
+ name = name.substringSharingImpl(5);
+
+ for (auto &builtinModule : builtinModuleNamesSortedLength) {
+ if (name == builtinModule)
+ return true;
+ }
+ return false;
+}
+
+} // namespace Bun \ No newline at end of file
diff --git a/src/bun.js/bindings/isBuiltinModule.h b/src/bun.js/bindings/isBuiltinModule.h
new file mode 100644
index 000000000..d66f025d1
--- /dev/null
+++ b/src/bun.js/bindings/isBuiltinModule.h
@@ -0,0 +1,5 @@
+#pragma once
+
+namespace Bun {
+bool isBuiltinModule(const String &namePossiblyWithNodePrefix);
+} // namespace Bun \ No newline at end of file
diff --git a/src/bun.js/bindings/napi.cpp b/src/bun.js/bindings/napi.cpp
index 72ca50dcb..005a753d0 100644
--- a/src/bun.js/bindings/napi.cpp
+++ b/src/bun.js/bindings/napi.cpp
@@ -83,7 +83,7 @@ JSC::SourceCode generateSourceCode(WTF::String keyString, JSC::VM& vm, JSC::JSOb
sourceCodeBuilder.append(";\n"_s);
}
globalObject->putDirect(vm, ident, object, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::DontEnum);
- return JSC::makeSource(sourceCodeBuilder.toString(), JSC::SourceOrigin(), keyString, WTF::TextPosition(), JSC::SourceProviderSourceType::Module);
+ return JSC::makeSource(sourceCodeBuilder.toString(), JSC::SourceOrigin(), JSC::SourceTaintedOrigin::Untainted, keyString, WTF::TextPosition(), JSC::SourceProviderSourceType::Module);
}
}
@@ -200,10 +200,6 @@ static uint32_t getPropertyAttributes(napi_property_descriptor prop)
// result |= JSC::PropertyAttribute::ReadOnly;
// }
- if (prop.method) {
- result |= JSC::PropertyAttribute::Function;
- }
-
return result;
}
@@ -257,7 +253,7 @@ static void defineNapiProperty(Zig::GlobalObject* globalObject, JSC::JSObject* t
value = JSC::JSValue(function);
// }
- to->putDirect(vm, propertyName, value, getPropertyAttributes(property) | JSC::PropertyAttribute::Function);
+ to->putDirect(vm, propertyName, value, getPropertyAttributes(property));
return;
}
@@ -317,6 +313,10 @@ static void defineNapiProperty(Zig::GlobalObject* globalObject, JSC::JSObject* t
extern "C" napi_status napi_set_property(napi_env env, napi_value target,
napi_value key, napi_value value)
{
+ if (UNLIKELY(!env || !target || !key)) {
+ return napi_invalid_arg;
+ }
+
auto globalObject = toJS(env);
auto& vm = globalObject->vm();
auto* object = toJS(target).getObject();
@@ -327,7 +327,8 @@ extern "C" napi_status napi_set_property(napi_env env, napi_value target,
auto keyProp = toJS(key);
auto scope = DECLARE_CATCH_SCOPE(vm);
- object->putDirect(globalObject->vm(), keyProp.toPropertyKey(globalObject), toJS(value));
+ PutPropertySlot slot(object, true);
+ object->put(object, globalObject, keyProp.toPropertyKey(globalObject), toJS(value), slot);
RETURN_IF_EXCEPTION(scope, napi_generic_failure);
scope.clearException();
@@ -336,6 +337,10 @@ extern "C" napi_status napi_set_property(napi_env env, napi_value target,
extern "C" napi_status napi_has_property(napi_env env, napi_value object,
napi_value key, bool* result)
{
+ if (UNLIKELY(!object || !env)) {
+ return napi_invalid_arg;
+ }
+
auto globalObject = toJS(env);
auto& vm = globalObject->vm();
auto* target = toJS(object).getObject();
@@ -345,8 +350,7 @@ extern "C" napi_status napi_has_property(napi_env env, napi_value object,
auto keyProp = toJS(key);
auto scope = DECLARE_CATCH_SCOPE(vm);
- // TODO: use the slot directly?
- *result = !!target->getIfPropertyExists(globalObject, keyProp.toPropertyKey(globalObject));
+ *result = target->hasProperty(globalObject, keyProp.toPropertyKey(globalObject));
RETURN_IF_EXCEPTION(scope, napi_generic_failure);
scope.clearException();
@@ -495,6 +499,81 @@ extern "C" napi_status napi_get_named_property(napi_env env, napi_value object,
return napi_ok;
}
+#if !COMPILER(MSVC)
+__attribute__((visibility("default")))
+#endif
+extern "C" napi_status
+node_api_create_external_string_latin1(napi_env env,
+ char* str,
+ size_t length,
+ napi_finalize finalize_callback,
+ void* finalize_hint,
+ napi_value* result,
+ bool* copied)
+{
+ // https://nodejs.org/api/n-api.html#node_api_create_external_string_latin1
+ if (UNLIKELY(!str || !result)) {
+ return napi_invalid_arg;
+ }
+
+ length = length == NAPI_AUTO_LENGTH ? strlen(str) : length;
+ WTF::ExternalStringImpl& impl = WTF::ExternalStringImpl::create(reinterpret_cast<LChar*>(str), static_cast<unsigned int>(length), finalize_hint, [finalize_callback](void* hint, void* str, unsigned length) {
+ if (finalize_callback) {
+ finalize_callback(reinterpret_cast<napi_env>(Bun__getDefaultGlobal()), nullptr, hint);
+ }
+ });
+ JSGlobalObject* globalObject = toJS(env);
+ // globalObject is allowed to be null here
+ if (UNLIKELY(!globalObject)) {
+ globalObject = Bun__getDefaultGlobal();
+ }
+
+ JSString* out = JSC::jsString(globalObject->vm(), WTF::String(impl));
+ ensureStillAliveHere(out);
+ *result = toNapi(out);
+ ensureStillAliveHere(out);
+
+ return napi_ok;
+}
+
+#if !COMPILER(MSVC)
+__attribute__((visibility("default")))
+#endif
+
+extern "C" napi_status
+node_api_create_external_string_utf16(napi_env env,
+ char16_t* str,
+ size_t length,
+ napi_finalize finalize_callback,
+ void* finalize_hint,
+ napi_value* result,
+ bool* copied)
+{
+ // https://nodejs.org/api/n-api.html#node_api_create_external_string_utf16
+ if (UNLIKELY(!str || !result)) {
+ return napi_invalid_arg;
+ }
+
+ length = length == NAPI_AUTO_LENGTH ? std::char_traits<char16_t>::length(str) : length;
+ WTF::ExternalStringImpl& impl = WTF::ExternalStringImpl::create(reinterpret_cast<UChar*>(str), static_cast<unsigned int>(length), finalize_hint, [finalize_callback](void* hint, void* str, unsigned length) {
+ if (finalize_callback) {
+ finalize_callback(reinterpret_cast<napi_env>(Bun__getDefaultGlobal()), nullptr, hint);
+ }
+ });
+ JSGlobalObject* globalObject = toJS(env);
+ // globalObject is allowed to be null here
+ if (UNLIKELY(!globalObject)) {
+ globalObject = Bun__getDefaultGlobal();
+ }
+
+ JSString* out = JSC::jsString(globalObject->vm(), WTF::String(impl));
+ ensureStillAliveHere(out);
+ *result = toNapi(out);
+ ensureStillAliveHere(out);
+
+ return napi_ok;
+}
+
extern "C" void napi_module_register(napi_module* mod)
{
auto* globalObject = Bun__getDefaultGlobal();
@@ -1028,7 +1107,7 @@ extern "C" napi_status napi_fatal_exception(napi_env env,
napi_value err)
{
auto globalObject = toJS(env);
- JSC::JSValue value = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(err));
+ JSC::JSValue value = toJS(err);
JSC::JSObject* obj = value.getObject();
if (UNLIKELY(obj == nullptr || !obj->isErrorInstance())) {
return napi_invalid_arg;
@@ -1045,7 +1124,7 @@ extern "C" napi_status napi_throw(napi_env env, napi_value error)
JSC::VM& vm = globalObject->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
- JSC::JSValue value = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(error));
+ JSC::JSValue value = toJS(error);
if (value) {
JSC::throwException(globalObject, throwScope, value);
} else {
@@ -1131,8 +1210,8 @@ extern "C" napi_status napi_create_type_error(napi_env env, napi_value code,
Zig::GlobalObject* globalObject = toJS(env);
JSC::VM& vm = globalObject->vm();
- JSC::JSValue codeValue = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(code));
- JSC::JSValue messageValue = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(msg));
+ JSC::JSValue codeValue = toJS(code);
+ JSC::JSValue messageValue = toJS(msg);
auto error = JSC::createTypeError(globalObject, messageValue.toWTFString(globalObject));
if (codeValue) {
@@ -1150,10 +1229,11 @@ extern "C" napi_status napi_create_error(napi_env env, napi_value code,
Zig::GlobalObject* globalObject = toJS(env);
JSC::VM& vm = globalObject->vm();
- JSC::JSValue codeValue = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(code));
- JSC::JSValue messageValue = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(msg));
+ JSC::JSValue codeValue = toJS(code);
+ JSC::JSValue messageValue = toJS(msg);
- auto error = JSC::createError(globalObject, messageValue.toWTFString(globalObject));
+ WTF::String message = messageValue.toWTFString(globalObject);
+ auto* error = JSC::createError(globalObject, message);
if (codeValue) {
error->putDirect(vm, WebCore::builtinNames(vm).codePublicName(), codeValue, 0);
}
@@ -1557,15 +1637,15 @@ extern "C" napi_status napi_define_class(napi_env env,
extern "C" napi_status napi_coerce_to_string(napi_env env, napi_value value,
napi_value* result)
{
- if (UNLIKELY(result == nullptr)) {
+ if (UNLIKELY(result == nullptr || value == nullptr || env == nullptr)) {
return napi_invalid_arg;
}
Zig::GlobalObject* globalObject = toJS(env);
JSC::VM& vm = globalObject->vm();
- auto scope = DECLARE_CATCH_SCOPE(vm);
- JSC::JSValue jsValue = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(value));
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ JSC::JSValue jsValue = toJS(value);
JSC::EnsureStillAliveScope ensureStillAlive(jsValue);
// .toString() can throw
@@ -1588,7 +1668,7 @@ extern "C" napi_status napi_get_property_names(napi_env env, napi_value object,
Zig::GlobalObject* globalObject = toJS(env);
JSC::VM& vm = globalObject->vm();
- JSC::JSValue jsValue = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(object));
+ JSC::JSValue jsValue = toJS(object);
if (!jsValue || !jsValue.isObject()) {
return napi_invalid_arg;
}
@@ -1717,7 +1797,7 @@ extern "C" napi_status napi_get_element(napi_env env, napi_value objectValue,
uint32_t index, napi_value* result)
{
JSValue jsValue = toJS(objectValue);
- if (!jsValue || !jsValue.isObject()) {
+ if (UNLIKELY(!env || !jsValue || !jsValue.isObject())) {
return napi_invalid_arg;
}
@@ -1737,7 +1817,7 @@ extern "C" napi_status napi_get_element(napi_env env, napi_value objectValue,
extern "C" napi_status napi_create_object(napi_env env, napi_value* result)
{
- if (UNLIKELY(result == nullptr)) {
+ if (UNLIKELY(result == nullptr || env == nullptr)) {
return napi_invalid_arg;
}
diff --git a/src/bun.js/bindings/process.d.ts b/src/bun.js/bindings/process.d.ts
deleted file mode 100644
index 194ea2b6a..000000000
--- a/src/bun.js/bindings/process.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
- * The process object provides information about, and control over, the
- * current Bun.js process. While it is available as a global, it is
- * recommended to explicitly access it via require or import
- */
-export interface Process {
- //
-}
diff --git a/src/bun.js/bindings/sqlite/JSSQLStatement.cpp b/src/bun.js/bindings/sqlite/JSSQLStatement.cpp
index 8519cb2e2..2ce4cc9a6 100644
--- a/src/bun.js/bindings/sqlite/JSSQLStatement.cpp
+++ b/src/bun.js/bindings/sqlite/JSSQLStatement.cpp
@@ -83,6 +83,11 @@ static JSC_DECLARE_CUSTOM_GETTER(jsSqlStatementGetColumnCount);
static JSC_DECLARE_HOST_FUNCTION(jsSQLStatementSerialize);
static JSC_DECLARE_HOST_FUNCTION(jsSQLStatementDeserialize);
+static inline JSC::JSValue jsNumberFromSQLite(sqlite3_stmt* stmt, unsigned int i)
+{
+ int64_t num = sqlite3_column_int64(stmt, i);
+ return num > INT_MAX || num < INT_MIN ? JSC::jsDoubleNumber(static_cast<double>(num)) : JSC::jsNumber(static_cast<int>(num));
+}
#define CHECK_THIS \
if (UNLIKELY(!castedThis)) { \
@@ -183,7 +188,7 @@ public:
JSC::JSValue rebind(JSGlobalObject* globalObject, JSC::JSValue values, bool clone);
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
{
- return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::JSFunctionType, StructureFlags), info());
}
bool need_update() { return version_db->version.load() != version; }
@@ -336,10 +341,6 @@ void JSSQLStatement::destroy(JSC::JSCell* cell)
thisObject->stmt = nullptr;
}
-void JSSQLStatementConstructor::destroy(JSC::JSCell* cell)
-{
-}
-
static inline bool rebindValue(JSC::JSGlobalObject* lexicalGlobalObject, sqlite3_stmt* stmt, int i, JSC::JSValue value, JSC::ThrowScope& scope, bool clone)
{
#define CHECK_BIND(param) \
@@ -690,6 +691,11 @@ JSC_DEFINE_HOST_FUNCTION(jsSQLStatementLoadExtensionFunction, (JSC::JSGlobalObje
return JSValue::encode(JSC::jsUndefined());
}
+ if (sqlite3_compileoption_used("SQLITE_OMIT_LOAD_EXTENSION")) {
+ throwException(lexicalGlobalObject, scope, createError(lexicalGlobalObject, "This build of sqlite3 does not support dynamic extension loading"_s));
+ return JSValue::encode(JSC::jsUndefined());
+ }
+
auto entryPointStr = callFrame->argumentCount() > 2 && callFrame->argument(2).isString() ? callFrame->argument(2).toWTFString(lexicalGlobalObject) : String();
const char* entryPoint = entryPointStr.length() == 0 ? NULL : entryPointStr.utf8().data();
char* error;
@@ -1054,7 +1060,7 @@ static const HashTableValue JSSQLStatementConstructorTableValues[] = {
{ "deserialize"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsSQLStatementDeserialize, 2 } },
};
-const ClassInfo JSSQLStatementConstructor::s_info = { "SQLStatement"_s, nullptr, nullptr, nullptr, CREATE_METHOD_TABLE(JSSQLStatementConstructor) };
+const ClassInfo JSSQLStatementConstructor::s_info = { "SQLStatement"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSQLStatementConstructor) };
void JSSQLStatementConstructor::finishCreation(VM& vm)
{
@@ -1090,7 +1096,7 @@ static inline JSC::JSValue constructResultObject(JSC::JSGlobalObject* lexicalGlo
switch (sqlite3_column_type(stmt, i)) {
case SQLITE_INTEGER: {
// https://github.com/oven-sh/bun/issues/1536
- value = jsNumber(sqlite3_column_int64(stmt, i));
+ value = jsNumberFromSQLite(stmt, i);
break;
}
case SQLITE_FLOAT: {
@@ -1146,11 +1152,11 @@ static inline JSC::JSValue constructResultObject(JSC::JSGlobalObject* lexicalGlo
switch (sqlite3_column_type(stmt, i)) {
case SQLITE_INTEGER: {
// https://github.com/oven-sh/bun/issues/1536
- result->putDirect(vm, name, jsNumber(sqlite3_column_int64(stmt, i)), 0);
+ result->putDirect(vm, name, jsNumberFromSQLite(stmt, i), 0);
break;
}
case SQLITE_FLOAT: {
- result->putDirect(vm, name, jsNumber(sqlite3_column_double(stmt, i)), 0);
+ result->putDirect(vm, name, jsDoubleNumber(sqlite3_column_double(stmt, i)), 0);
break;
}
// > Note that the SQLITE_TEXT constant was also used in SQLite version
@@ -1205,11 +1211,11 @@ static inline JSC::JSArray* constructResultRow(JSC::JSGlobalObject* lexicalGloba
switch (sqlite3_column_type(stmt, i)) {
case SQLITE_INTEGER: {
// https://github.com/oven-sh/bun/issues/1536
- result->putDirectIndex(lexicalGlobalObject, i, jsNumber(sqlite3_column_int64(stmt, i)));
+ result->putDirectIndex(lexicalGlobalObject, i, jsNumberFromSQLite(stmt, i));
break;
}
case SQLITE_FLOAT: {
- result->putDirectIndex(lexicalGlobalObject, i, jsNumber(sqlite3_column_double(stmt, i)));
+ result->putDirectIndex(lexicalGlobalObject, i, jsDoubleNumber(sqlite3_column_double(stmt, i)));
break;
}
// > Note that the SQLITE_TEXT constant was also used in SQLite version
@@ -1251,7 +1257,6 @@ static inline JSC::JSArray* constructResultRow(JSC::JSGlobalObject* lexicalGloba
JSC_DEFINE_HOST_FUNCTION(jsSQLStatementExecuteStatementFunctionAll, (JSC::JSGlobalObject * lexicalGlobalObject, JSC::CallFrame* callFrame))
{
-
JSC::VM& vm = lexicalGlobalObject->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
auto castedThis = jsDynamicCast<JSSQLStatement*>(callFrame->thisValue());
@@ -1283,7 +1288,6 @@ JSC_DEFINE_HOST_FUNCTION(jsSQLStatementExecuteStatementFunctionAll, (JSC::JSGlob
size_t columnCount = castedThis->columnNames->size();
JSValue result = jsUndefined();
-
if (status == SQLITE_ROW) {
// this is a count from UPDATE or another query like that
if (columnCount == 0) {
@@ -1305,11 +1309,7 @@ JSC_DEFINE_HOST_FUNCTION(jsSQLStatementExecuteStatementFunctionAll, (JSC::JSGlob
result = resultArray;
}
} else if (status == SQLITE_DONE) {
- if (columnCount == 0) {
- result = jsNumber(sqlite3_changes(castedThis->version_db->db));
- } else {
- result = JSC::constructEmptyArray(lexicalGlobalObject, nullptr, 0);
- }
+ result = JSC::constructEmptyArray(lexicalGlobalObject, nullptr, 0);
}
if (UNLIKELY(status != SQLITE_DONE && status != SQLITE_OK)) {
@@ -1632,7 +1632,7 @@ JSC_DEFINE_HOST_FUNCTION(jsSQLStatementFunctionFinalize, (JSC::JSGlobalObject *
RELEASE_AND_RETURN(scope, JSValue::encode(jsUndefined()));
}
-const ClassInfo JSSQLStatement::s_info = { "SQLStatement"_s, nullptr, nullptr, nullptr, CREATE_METHOD_TABLE(JSSQLStatement) };
+const ClassInfo JSSQLStatement::s_info = { "SQLStatement"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSQLStatement) };
/* Hash table for prototype */
static const HashTableValue JSSQLStatementTableValues[] = {
diff --git a/src/bun.js/bindings/sqlite/JSSQLStatement.h b/src/bun.js/bindings/sqlite/JSSQLStatement.h
index 8566fcdd9..b628f2a38 100644
--- a/src/bun.js/bindings/sqlite/JSSQLStatement.h
+++ b/src/bun.js/bindings/sqlite/JSSQLStatement.h
@@ -50,25 +50,15 @@ namespace WebCore {
class JSSQLStatementConstructor final : public JSC::JSFunction {
public:
using Base = JSC::JSFunction;
+ static constexpr unsigned StructureFlags = Base::StructureFlags;
+
static JSSQLStatementConstructor* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure);
DECLARE_INFO;
- template<typename, SubspaceAccess mode> static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
- {
- if constexpr (mode == JSC::SubspaceAccess::Concurrently)
- return nullptr;
- return WebCore::subspaceForImpl<JSSQLStatementConstructor, WebCore::UseCustomHeapCellType::No>(
- vm,
- [](auto& spaces) { return spaces.m_clientSubspaceForJSSQLStatementConstructor.get(); },
- [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForJSSQLStatementConstructor = std::forward<decltype(space)>(space); },
- [](auto& spaces) { return spaces.m_subspaceForJSSQLStatementConstructor.get(); },
- [](auto& spaces, auto&& space) { spaces.m_subspaceForJSSQLStatementConstructor = std::forward<decltype(space)>(space); });
- }
- static void destroy(JSC::JSCell*);
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
{
- return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSFunctionType, StructureFlags), info());
}
private:
@@ -79,5 +69,6 @@ private:
void finishCreation(JSC::VM&);
};
+static_assert(sizeof(JSSQLStatementConstructor) == sizeof(JSFunction), "Allocate JSSQLStatementConstructor in JSFunction IsoSubspace");
} \ No newline at end of file
diff --git a/src/bun.js/bindings/sqlite/lazy_sqlite3.h b/src/bun.js/bindings/sqlite/lazy_sqlite3.h
index 8b23a7e03..a012f6ab6 100644
--- a/src/bun.js/bindings/sqlite/lazy_sqlite3.h
+++ b/src/bun.js/bindings/sqlite/lazy_sqlite3.h
@@ -71,6 +71,7 @@ typedef int (*lazy_sqlite3_deserialize_type)(
);
typedef int (*lazy_sqlite3_stmt_readonly_type)(sqlite3_stmt* pStmt);
+typedef int (*lazy_sqlite3_compileoption_used_type)(const char *zOptName);
static lazy_sqlite3_bind_blob_type lazy_sqlite3_bind_blob;
static lazy_sqlite3_bind_double_type lazy_sqlite3_bind_double;
@@ -112,6 +113,7 @@ static lazy_sqlite3_malloc64_type lazy_sqlite3_malloc64;
static lazy_sqlite3_serialize_type lazy_sqlite3_serialize;
static lazy_sqlite3_deserialize_type lazy_sqlite3_deserialize;
static lazy_sqlite3_stmt_readonly_type lazy_sqlite3_stmt_readonly;
+static lazy_sqlite3_compileoption_used_type lazy_sqlite3_compileoption_used;
#define sqlite3_bind_blob lazy_sqlite3_bind_blob
#define sqlite3_bind_double lazy_sqlite3_bind_double
@@ -152,6 +154,7 @@ static lazy_sqlite3_stmt_readonly_type lazy_sqlite3_stmt_readonly;
#define sqlite3_deserialize lazy_sqlite3_deserialize
#define sqlite3_stmt_readonly lazy_sqlite3_stmt_readonly
#define sqlite3_column_int64 lazy_sqlite3_column_int64
+#define sqlite3_compileoption_used lazy_sqlite3_compileoption_used;
static void* sqlite3_handle = nullptr;
static const char* sqlite3_lib_path = "libsqlite3.dylib";
@@ -204,6 +207,7 @@ static int lazyLoadSQLite()
lazy_sqlite3_deserialize = (lazy_sqlite3_deserialize_type)dlsym(sqlite3_handle, "sqlite3_deserialize");
lazy_sqlite3_malloc64 = (lazy_sqlite3_malloc64_type)dlsym(sqlite3_handle, "sqlite3_malloc64");
lazy_sqlite3_stmt_readonly = (lazy_sqlite3_stmt_readonly_type)dlsym(sqlite3_handle, "sqlite3_stmt_readonly");
+ lazy_sqlite3_compileoption_used = (lazy_sqlite3_compileoption_used_type)dlsym(sqlite3_handle, "sqlite3_compileoption_used");
return 0;
}
diff --git a/src/bun.js/bindings/webcore/AbortSignal.h b/src/bun.js/bindings/webcore/AbortSignal.h
index 6f4abf5ba..b60d2a6bf 100644
--- a/src/bun.js/bindings/webcore/AbortSignal.h
+++ b/src/bun.js/bindings/webcore/AbortSignal.h
@@ -45,6 +45,7 @@ class AbortSignal final : public RefCounted<AbortSignal>, public EventTargetWith
public:
static Ref<AbortSignal> create(ScriptExecutionContext*);
WEBCORE_EXPORT ~AbortSignal();
+ using NativeCallbackTuple = std::tuple<void*, void (*)(void*, JSC::EncodedJSValue)>;
static Ref<AbortSignal> abort(JSDOMGlobalObject&, ScriptExecutionContext&, JSC::JSValue reason);
static Ref<AbortSignal> timeout(ScriptExecutionContext&, uint64_t milliseconds);
@@ -66,7 +67,7 @@ public:
using Algorithm = Function<void(JSValue)>;
void addAlgorithm(Algorithm&& algorithm) { m_algorithms.append(WTFMove(algorithm)); }
void cleanNativeBindings(void* ref);
- void addNativeCallback(std::tuple<void*, void (*)(void*, JSC::EncodedJSValue)> callback) { m_native_callbacks.append(callback); }
+ void addNativeCallback(NativeCallbackTuple callback) { m_native_callbacks.append(callback); }
bool isFollowingSignal() const { return !!m_followingSignal; }
@@ -87,8 +88,8 @@ private:
void eventListenersDidChange() final;
bool m_aborted { false };
- Vector<Algorithm> m_algorithms;
- Vector<std::tuple<void*, void (*)(void*, JSC::EncodedJSValue)>> m_native_callbacks;
+ Vector<Algorithm, 2> m_algorithms;
+ Vector<NativeCallbackTuple, 2> m_native_callbacks;
WeakPtr<AbortSignal> m_followingSignal;
JSC::Strong<JSC::Unknown> m_reason;
bool m_hasActiveTimeoutTimer { false };
diff --git a/src/bun.js/bindings/webcore/JSDOMURL.cpp b/src/bun.js/bindings/webcore/JSDOMURL.cpp
index 747154bed..3f99fc2b7 100644
--- a/src/bun.js/bindings/webcore/JSDOMURL.cpp
+++ b/src/bun.js/bindings/webcore/JSDOMURL.cpp
@@ -64,6 +64,7 @@ using namespace JSC;
static JSC_DECLARE_HOST_FUNCTION(jsDOMURLPrototypeFunction_toJSON);
static JSC_DECLARE_HOST_FUNCTION(jsDOMURLConstructorFunction_createObjectURL);
static JSC_DECLARE_HOST_FUNCTION(jsDOMURLConstructorFunction_revokeObjectURL);
+static JSC_DECLARE_HOST_FUNCTION(jsDOMURLConstructorFunction_canParse);
static JSC_DECLARE_HOST_FUNCTION(jsDOMURLPrototypeFunction_toString);
// Attributes
@@ -131,6 +132,7 @@ using JSDOMURLDOMConstructor = JSDOMConstructor<JSDOMURL>;
static const HashTableValue JSDOMURLConstructorTableValues[] = {
{ "createObjectURL"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsDOMURLConstructorFunction_createObjectURL, 1 } },
{ "revokeObjectURL"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsDOMURLConstructorFunction_revokeObjectURL, 1 } },
+ { "canParse"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsDOMURLConstructorFunction_canParse, 2 } },
};
static inline EncodedJSValue constructJSDOMURL1(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
@@ -688,6 +690,33 @@ JSC_DEFINE_HOST_FUNCTION(jsDOMURLConstructorFunction_revokeObjectURL, (JSGlobalO
return IDLOperation<JSDOMURL>::callStatic<jsDOMURLConstructorFunction_revokeObjectURLBody>(*lexicalGlobalObject, *callFrame, "revokeObjectURL");
}
+static inline JSC::EncodedJSValue jsDOMURLConstructorFunction_canParseBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)
+{
+ auto& vm = JSC::getVM(lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+
+ if (UNLIKELY(callFrame->argumentCount() < 1))
+ return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject));
+
+ EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0);
+ auto url = convert<IDLUSVString>(*lexicalGlobalObject, argument0.value());
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+
+ EnsureStillAliveScope argument1 = callFrame->argument(1);
+ String base;
+ if (!argument1.value().isUndefinedOrNull()) {
+ base = convert<IDLUSVString>(*lexicalGlobalObject, argument1.value());
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+ }
+
+ return JSValue::encode(jsBoolean(DOMURL::canParse(url, base)));
+}
+
+JSC_DEFINE_HOST_FUNCTION(jsDOMURLConstructorFunction_canParse, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ return IDLOperation<JSDOMURL>::callStatic<jsDOMURLConstructorFunction_canParseBody>(*lexicalGlobalObject, *callFrame, "canParse");
+}
+
#if ENABLE(MEDIA_SOURCE)
static inline JSC::EncodedJSValue jsDOMURLConstructorFunction_createObjectURL2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)
{
diff --git a/src/bun.js/bindings/webcore/JSEventEmitter.cpp b/src/bun.js/bindings/webcore/JSEventEmitter.cpp
index 959cbd8d7..e81af9549 100644
--- a/src/bun.js/bindings/webcore/JSEventEmitter.cpp
+++ b/src/bun.js/bindings/webcore/JSEventEmitter.cpp
@@ -109,9 +109,10 @@ template<> EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSEventEmitterDOMConstructor:
if constexpr (IsExceptionOr<decltype(object)>)
RETURN_IF_EXCEPTION(throwScope, {});
- if (JSValue maxListeners = castedThis->getIfPropertyExists(lexicalGlobalObject, JSC::Identifier::fromString(vm, "defaultMaxListeners"_s))) {
- if (maxListeners.isUInt32())
- object->setMaxListeners(maxListeners.toUInt32(lexicalGlobalObject));
+ JSValue maxListeners = castedThis->getIfPropertyExists(lexicalGlobalObject, JSC::Identifier::fromString(vm, "defaultMaxListeners"_s));
+ RETURN_IF_EXCEPTION(throwScope, {});
+ if (maxListeners && maxListeners.isUInt32()) {
+ object->setMaxListeners(maxListeners.toUInt32(lexicalGlobalObject));
}
static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef);
auto jsValue = toJSNewlyCreated<IDLInterface<EventEmitter>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object));
diff --git a/src/bun.js/bindings/webcore/JSFetchHeaders.cpp b/src/bun.js/bindings/webcore/JSFetchHeaders.cpp
index 2ae8dd547..421a042e5 100644
--- a/src/bun.js/bindings/webcore/JSFetchHeaders.cpp
+++ b/src/bun.js/bindings/webcore/JSFetchHeaders.cpp
@@ -245,17 +245,11 @@ JSC_DEFINE_HOST_FUNCTION(jsFetchHeadersPrototypeFunction_getAll, (JSGlobalObject
return JSValue::encode(array);
}
-JSC_DEFINE_HOST_FUNCTION(jsFetchHeadersPrototypeFunction_getSetCookie, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+JSC_DEFINE_HOST_FUNCTION(fetchHeadersGetSetCookie, (JSC::JSGlobalObject * lexicalGlobalObject, VM& vm, WebCore::FetchHeaders* impl))
{
- auto& vm = JSC::getVM(lexicalGlobalObject);
auto scope = DECLARE_THROW_SCOPE(vm);
- JSFetchHeaders* castedThis = jsDynamicCast<JSFetchHeaders*>(callFrame->thisValue());
- if (UNLIKELY(!castedThis)) {
- return JSValue::encode(jsUndefined());
- }
- auto& impl = castedThis->wrapped();
- auto values = impl.getSetCookieHeaders();
+ auto values = impl->getSetCookieHeaders();
unsigned count = values.size();
if (!count) {
@@ -263,20 +257,31 @@ JSC_DEFINE_HOST_FUNCTION(jsFetchHeadersPrototypeFunction_getSetCookie, (JSGlobal
}
JSC::JSArray* array = constructEmptyArray(lexicalGlobalObject, nullptr, count);
- RETURN_IF_EXCEPTION(scope, JSValue::encode(jsUndefined()));
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
if (UNLIKELY(!array)) {
throwOutOfMemoryError(lexicalGlobalObject, scope);
- return JSValue::encode(jsUndefined());
+ return encodedJSValue();
}
for (unsigned i = 0; i < count; ++i) {
array->putDirectIndex(lexicalGlobalObject, i, jsString(vm, values[i]));
- RETURN_IF_EXCEPTION(scope, JSValue::encode(jsUndefined()));
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
}
return JSValue::encode(array);
}
+JSC_DEFINE_HOST_FUNCTION(jsFetchHeadersPrototypeFunction_getSetCookie, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = JSC::getVM(lexicalGlobalObject);
+ JSFetchHeaders* castedThis = jsDynamicCast<JSFetchHeaders*>(callFrame->thisValue());
+ if (UNLIKELY(!castedThis)) {
+ return JSValue::encode(jsUndefined());
+ }
+ auto& impl = castedThis->wrapped();
+ return fetchHeadersGetSetCookie(lexicalGlobalObject, vm, &impl);
+}
+
/* Hash table for prototype */
static const HashTableValue JSFetchHeadersPrototypeTableValues[] = {
@@ -324,7 +329,7 @@ void JSFetchHeaders::finishCreation(VM& vm)
void JSFetchHeaders::computeMemoryCost()
{
m_memoryCost = wrapped().memoryCost();
- globalObject()->vm().heap.reportExtraMemoryAllocated(m_memoryCost);
+ globalObject()->vm().heap.reportExtraMemoryAllocated(this, m_memoryCost);
}
JSObject* JSFetchHeaders::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
@@ -688,7 +693,6 @@ extern void* _ZTVN7WebCore12FetchHeadersE[];
JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref<FetchHeaders>&& impl)
{
-
if constexpr (std::is_polymorphic_v<FetchHeaders>) {
#if ENABLE(BINDING_INTEGRITY)
const void* actualVTablePointer = getVTablePointer(impl.ptr());
diff --git a/src/bun.js/bindings/webcore/JSFetchHeaders.h b/src/bun.js/bindings/webcore/JSFetchHeaders.h
index 4efcc5f5f..58b61bbbb 100644
--- a/src/bun.js/bindings/webcore/JSFetchHeaders.h
+++ b/src/bun.js/bindings/webcore/JSFetchHeaders.h
@@ -97,4 +97,6 @@ template<> struct JSDOMWrapperConverterTraits<FetchHeaders> {
using ToWrappedReturnType = FetchHeaders*;
};
+JSC::EncodedJSValue fetchHeadersGetSetCookie(JSC::JSGlobalObject* lexicalGlobalObject, VM& vm, WebCore::FetchHeaders* impl);
+
} // namespace WebCore
diff --git a/src/bun.js/bindings/webcore/JSMessageEvent.cpp b/src/bun.js/bindings/webcore/JSMessageEvent.cpp
index 68414fe46..0a7ca6a5f 100644
--- a/src/bun.js/bindings/webcore/JSMessageEvent.cpp
+++ b/src/bun.js/bindings/webcore/JSMessageEvent.cpp
@@ -295,7 +295,7 @@ void JSMessageEvent::finishCreation(VM& vm)
// static_assert(!std::is_base_of<ActiveDOMObject, MessageEvent>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject.");
- vm.heap.reportExtraMemoryAllocated(wrapped().memoryCost());
+ vm.heap.reportExtraMemoryAllocated(this, wrapped().memoryCost());
}
JSObject* JSMessageEvent::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
diff --git a/src/bun.js/bindings/webcore/JSReadableStream.cpp b/src/bun.js/bindings/webcore/JSReadableStream.cpp
index 3fea3d44f..0a0ef3b23 100644
--- a/src/bun.js/bindings/webcore/JSReadableStream.cpp
+++ b/src/bun.js/bindings/webcore/JSReadableStream.cpp
@@ -108,7 +108,7 @@ template<> FunctionExecutable* JSReadableStreamDOMConstructor::initializeExecuta
static const HashTableValue JSReadableStreamPrototypeTableValues[] = {
{ "constructor"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { HashTableValue::GetterSetterType, jsReadableStreamConstructor, 0 } },
- { "locked"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableStreamLockedCodeGenerator, 0 } },
+ { "locked"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinAccessorType, readableStreamLockedCodeGenerator, 0 } },
{ "cancel"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableStreamCancelCodeGenerator, 0 } },
{ "getReader"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableStreamGetReaderCodeGenerator, 0 } },
{ "pipeTo"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableStreamPipeToCodeGenerator, 1 } },
diff --git a/src/bun.js/bindings/webcore/JSReadableStreamDefaultController.cpp b/src/bun.js/bindings/webcore/JSReadableStreamDefaultController.cpp
index fea3ffc8c..b15084041 100644
--- a/src/bun.js/bindings/webcore/JSReadableStreamDefaultController.cpp
+++ b/src/bun.js/bindings/webcore/JSReadableStreamDefaultController.cpp
@@ -108,7 +108,7 @@ template<> FunctionExecutable* JSReadableStreamDefaultControllerDOMConstructor::
static const HashTableValue JSReadableStreamDefaultControllerPrototypeTableValues[] = {
{ "constructor"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { HashTableValue::GetterSetterType, jsReadableStreamDefaultControllerConstructor, 0 } },
- { "desiredSize"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableStreamDefaultControllerDesiredSizeCodeGenerator, 0 } },
+ { "desiredSize"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinAccessorType, readableStreamDefaultControllerDesiredSizeCodeGenerator, 0 } },
{ "enqueue"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableStreamDefaultControllerEnqueueCodeGenerator, 0 } },
{ "close"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableStreamDefaultControllerCloseCodeGenerator, 0 } },
{ "error"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableStreamDefaultControllerErrorCodeGenerator, 0 } },
diff --git a/src/bun.js/bindings/webcore/JSReadableStreamDefaultReader.cpp b/src/bun.js/bindings/webcore/JSReadableStreamDefaultReader.cpp
index 55b89ad46..68b587a92 100644
--- a/src/bun.js/bindings/webcore/JSReadableStreamDefaultReader.cpp
+++ b/src/bun.js/bindings/webcore/JSReadableStreamDefaultReader.cpp
@@ -108,7 +108,7 @@ template<> FunctionExecutable* JSReadableStreamDefaultReaderDOMConstructor::init
static const HashTableValue JSReadableStreamDefaultReaderPrototypeTableValues[] = {
{ "constructor"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { HashTableValue::GetterSetterType, jsReadableStreamDefaultReaderConstructor, 0 } },
- { "closed"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableStreamDefaultReaderClosedCodeGenerator, 0 } },
+ { "closed"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinAccessorType, readableStreamDefaultReaderClosedCodeGenerator, 0 } },
{ "read"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableStreamDefaultReaderReadCodeGenerator, 0 } },
{ "readMany"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableStreamDefaultReaderReadManyCodeGenerator, 0 } },
{ "cancel"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableStreamDefaultReaderCancelCodeGenerator, 0 } },
diff --git a/src/bun.js/bindings/webcore/JSURLSearchParams.cpp b/src/bun.js/bindings/webcore/JSURLSearchParams.cpp
index 0d401fa00..4c0f0e912 100644
--- a/src/bun.js/bindings/webcore/JSURLSearchParams.cpp
+++ b/src/bun.js/bindings/webcore/JSURLSearchParams.cpp
@@ -182,6 +182,7 @@ static const HashTableValue JSURLSearchParamsPrototypeTableValues[] = {
{ "toString"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsURLSearchParamsPrototypeFunction_toString, 0 } },
{ "toJSON"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsURLSearchParamsPrototypeFunction_toJSON, 0 } },
{ "length"_s, static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::DontEnum), NoIntrinsic, { HashTableValue::GetterSetterType, jsURLSearchParamsPrototype_getLength, 0 } },
+ { "size"_s, static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, jsURLSearchParamsPrototype_getLength, 0 } },
};
const ClassInfo JSURLSearchParamsPrototype::s_info = { "URLSearchParams"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSURLSearchParamsPrototype) };
diff --git a/src/bun.js/bindings/webcore/MessagePort.cpp b/src/bun.js/bindings/webcore/MessagePort.cpp
index da2bd32e8..b463791df 100644
--- a/src/bun.js/bindings/webcore/MessagePort.cpp
+++ b/src/bun.js/bindings/webcore/MessagePort.cpp
@@ -141,7 +141,7 @@ MessagePort::MessagePort(ScriptExecutionContext& scriptExecutionContext, const M
, m_identifier(local)
, m_remoteIdentifier(remote)
{
- LOG(MessagePorts, "Created MessagePort %s (%p) in process %" PRIu64, m_identifier.logString().utf8().data(), this, ProcessIdent::identifier().toUInt64());
+ // LOG(MessagePorts, "Created MessagePort %s (%p) in process %" PRIu64, m_identifier.logString().utf8().data(), this, ProcessIdent::identifier().toUInt64());
Locker locker { allMessagePortsLock };
allMessagePorts().set(m_identifier, this);
@@ -157,7 +157,7 @@ MessagePort::MessagePort(ScriptExecutionContext& scriptExecutionContext, const M
MessagePort::~MessagePort()
{
- LOG(MessagePorts, "Destroyed MessagePort %s (%p) in process %" PRIu64, m_identifier.logString().utf8().data(), this, ProcessIdent::identifier().toUInt64());
+ // LOG(MessagePorts, "Destroyed MessagePort %s (%p) in process %" PRIu64, m_identifier.logString().utf8().data(), this, ProcessIdent::identifier().toUInt64());
ASSERT(allMessagePortsLock.isLocked());
@@ -175,7 +175,7 @@ void MessagePort::entangle()
ExceptionOr<void> MessagePort::postMessage(JSC::JSGlobalObject& state, JSC::JSValue messageValue, StructuredSerializeOptions&& options)
{
- LOG(MessagePorts, "Attempting to post message to port %s (to be received by port %s)", m_identifier.logString().utf8().data(), m_remoteIdentifier.logString().utf8().data());
+ // LOG(MessagePorts, "Attempting to post message to port %s (to be received by port %s)", m_identifier.logString().utf8().data(), m_remoteIdentifier.logString().utf8().data());
Vector<RefPtr<MessagePort>> ports;
auto messageData = SerializedScriptValue::create(state, messageValue, WTFMove(options.transfer), ports, SerializationForStorage::No, SerializationContext::WorkerPostMessage);
@@ -202,7 +202,7 @@ ExceptionOr<void> MessagePort::postMessage(JSC::JSGlobalObject& state, JSC::JSVa
MessageWithMessagePorts message { messageData.releaseReturnValue(), WTFMove(transferredPorts) };
- LOG(MessagePorts, "Actually posting message to port %s (to be received by port %s)", m_identifier.logString().utf8().data(), m_remoteIdentifier.logString().utf8().data());
+ // LOG(MessagePorts, "Actually posting message to port %s (to be received by port %s)", m_identifier.logString().utf8().data(), m_remoteIdentifier.logString().utf8().data());
ScriptExecutionContextIdentifier contextId = contextIdForMessagePortId(m_remoteIdentifier);
@@ -280,7 +280,7 @@ void MessagePort::dispatchMessages()
auto messagesTakenHandler = [this, protectedThis = Ref { *this }](Vector<MessageWithMessagePorts>&& messages, CompletionHandler<void()>&& completionCallback) mutable {
auto scopeExit = makeScopeExit(WTFMove(completionCallback));
- LOG(MessagePorts, "MessagePort %s (%p) dispatching %zu messages", m_identifier.logString().utf8().data(), this, messages.size());
+ // LOG(MessagePorts, "MessagePort %s (%p) dispatching %zu messages", m_identifier.logString().utf8().data(), this, messages.size());
auto* context = scriptExecutionContext();
if (!context || !context->jsGlobalObject())
@@ -382,7 +382,7 @@ ExceptionOr<Vector<TransferredMessagePort>> MessagePort::disentanglePorts(Vector
Vector<RefPtr<MessagePort>> MessagePort::entanglePorts(ScriptExecutionContext& context, Vector<TransferredMessagePort>&& transferredPorts)
{
- LOG(MessagePorts, "Entangling %zu transferred ports to ScriptExecutionContext %s (%p)", transferredPorts.size(), context.url().string().utf8().data(), &context);
+ // LOG(MessagePorts, "Entangling %zu transferred ports to ScriptExecutionContext %s (%p)", transferredPorts.size(), context.url().string().utf8().data(), &context);
if (transferredPorts.isEmpty())
return {};
diff --git a/src/bun.js/bindings/webcore/MessagePortChannel.cpp b/src/bun.js/bindings/webcore/MessagePortChannel.cpp
index 031679204..425fb8c11 100644
--- a/src/bun.js/bindings/webcore/MessagePortChannel.cpp
+++ b/src/bun.js/bindings/webcore/MessagePortChannel.cpp
@@ -75,7 +75,7 @@ void MessagePortChannel::entanglePortWithProcess(const MessagePortIdentifier& po
ASSERT(port == m_ports[0] || port == m_ports[1]);
size_t i = port == m_ports[0] ? 0 : 1;
- LOG(MessagePorts, "MessagePortChannel %s (%p) entangling port %s (that port has %zu messages available)", logString().utf8().data(), this, port.logString().utf8().data(), m_pendingMessages[i].size());
+ // LOG(MessagePorts, "MessagePortChannel %s (%p) entangling port %s (that port has %zu messages available)", logString().utf8().data(), this, port.logString().utf8().data(), m_pendingMessages[i].size());
ASSERT(!m_processes[i] || *m_processes[i] == process);
m_processes[i] = process;
@@ -85,7 +85,7 @@ void MessagePortChannel::entanglePortWithProcess(const MessagePortIdentifier& po
void MessagePortChannel::disentanglePort(const MessagePortIdentifier& port)
{
- LOG(MessagePorts, "MessagePortChannel %s (%p) disentangling port %s", logString().utf8().data(), this, port.logString().utf8().data());
+ // LOG(MessagePorts, "MessagePortChannel %s (%p) disentangling port %s", logString().utf8().data(), this, port.logString().utf8().data());
ASSERT(port == m_ports[0] || port == m_ports[1]);
size_t i = port == m_ports[0] ? 0 : 1;
@@ -123,7 +123,7 @@ bool MessagePortChannel::postMessageToRemote(MessageWithMessagePorts&& message,
size_t i = remoteTarget == m_ports[0] ? 0 : 1;
m_pendingMessages[i].append(WTFMove(message));
- LOG(MessagePorts, "MessagePortChannel %s (%p) now has %zu messages pending on port %s", logString().utf8().data(), this, m_pendingMessages[i].size(), remoteTarget.logString().utf8().data());
+ // LOG(MessagePorts, "MessagePortChannel %s (%p) now has %zu messages pending on port %s", logString().utf8().data(), this, m_pendingMessages[i].size(), remoteTarget.logString().utf8().data());
if (m_pendingMessages[i].size() == 1) {
m_pendingMessageProtectors[i] = this;
@@ -136,7 +136,7 @@ bool MessagePortChannel::postMessageToRemote(MessageWithMessagePorts&& message,
void MessagePortChannel::takeAllMessagesForPort(const MessagePortIdentifier& port, CompletionHandler<void(Vector<MessageWithMessagePorts>&&, CompletionHandler<void()>&&)>&& callback)
{
- LOG(MessagePorts, "MessagePortChannel %p taking all messages for port %s", this, port.logString().utf8().data());
+ // LOG(MessagePorts, "MessagePortChannel %p taking all messages for port %s", this, port.logString().utf8().data());
ASSERT(port == m_ports[0] || port == m_ports[1]);
size_t i = port == m_ports[0] ? 0 : 1;
@@ -153,7 +153,7 @@ void MessagePortChannel::takeAllMessagesForPort(const MessagePortIdentifier& por
++m_messageBatchesInFlight;
- LOG(MessagePorts, "There are %zu messages to take for port %s. Taking them now, messages in flight is now %" PRIu64, result.size(), port.logString().utf8().data(), m_messageBatchesInFlight);
+ // LOG(MessagePorts, "There are %zu messages to take for port %s. Taking them now, messages in flight is now %" PRIu64, result.size(), port.logString().utf8().data(), m_messageBatchesInFlight);
auto size = result.size();
callback(WTFMove(result), [size, this, port, protectedThis = WTFMove(m_pendingMessageProtectors[i])] {
@@ -162,7 +162,7 @@ void MessagePortChannel::takeAllMessagesForPort(const MessagePortIdentifier& por
UNUSED_PARAM(size);
#endif
--m_messageBatchesInFlight;
- LOG(MessagePorts, "Message port channel %s was notified that a batch of %zu message port messages targeted for port %s just completed dispatch, in flight is now %" PRIu64, logString().utf8().data(), size, port.logString().utf8().data(), m_messageBatchesInFlight);
+ // LOG(MessagePorts, "Message port channel %s was notified that a batch of %zu message port messages targeted for port %s just completed dispatch, in flight is now %" PRIu64, logString().utf8().data(), size, port.logString().utf8().data(), m_messageBatchesInFlight);
});
}
diff --git a/src/bun.js/bindings/webcore/MessagePortChannelProvider.cpp b/src/bun.js/bindings/webcore/MessagePortChannelProvider.cpp
index 7675a2e75..cde0d0dd4 100644
--- a/src/bun.js/bindings/webcore/MessagePortChannelProvider.cpp
+++ b/src/bun.js/bindings/webcore/MessagePortChannelProvider.cpp
@@ -38,7 +38,8 @@ static MessagePortChannelProviderImpl* globalProvider;
MessagePortChannelProvider& MessagePortChannelProvider::singleton()
{
- ASSERT(isMainThread());
+ // TODO: I think this assertion is relevant. Bun will call this on the Worker's thread
+ // ASSERT(isMainThread());
static std::once_flag onceFlag;
std::call_once(onceFlag, [] {
if (!globalProvider)
diff --git a/src/bun.js/bindings/webcore/MessagePortChannelRegistry.cpp b/src/bun.js/bindings/webcore/MessagePortChannelRegistry.cpp
index 5096357f2..a92262f63 100644
--- a/src/bun.js/bindings/webcore/MessagePortChannelRegistry.cpp
+++ b/src/bun.js/bindings/webcore/MessagePortChannelRegistry.cpp
@@ -30,6 +30,9 @@
#include <wtf/CompletionHandler.h>
#include <wtf/MainThread.h>
+// ASSERT(isMainThread()) is used alot here, and I think it may be required, but i'm not 100% sure.
+// we totally are calling these off the main thread in many cases in Bun, so ........
+
namespace WebCore {
MessagePortChannelRegistry::MessagePortChannelRegistry() = default;
@@ -41,15 +44,15 @@ MessagePortChannelRegistry::~MessagePortChannelRegistry()
void MessagePortChannelRegistry::didCreateMessagePortChannel(const MessagePortIdentifier& port1, const MessagePortIdentifier& port2)
{
- LOG(MessagePorts, "Registry: Creating MessagePortChannel %p linking %s and %s", this, port1.logString().utf8().data(), port2.logString().utf8().data());
- ASSERT(isMainThread());
+ // LOG(MessagePorts, "Registry: Creating MessagePortChannel %p linking %s and %s", this, port1.logString().utf8().data(), port2.logString().utf8().data());
+ // ASSERT(isMainThread());
MessagePortChannel::create(*this, port1, port2);
}
void MessagePortChannelRegistry::messagePortChannelCreated(MessagePortChannel& channel)
{
- ASSERT(isMainThread());
+ // ASSERT(isMainThread());
auto result = m_openChannels.ensure(channel.port1(), [channel = &channel] {
return channel;
@@ -64,7 +67,7 @@ void MessagePortChannelRegistry::messagePortChannelCreated(MessagePortChannel& c
void MessagePortChannelRegistry::messagePortChannelDestroyed(MessagePortChannel& channel)
{
- ASSERT(isMainThread());
+ // ASSERT(isMainThread());
ASSERT(m_openChannels.get(channel.port1()) == &channel);
ASSERT(m_openChannels.get(channel.port2()) == &channel);
@@ -72,12 +75,12 @@ void MessagePortChannelRegistry::messagePortChannelDestroyed(MessagePortChannel&
m_openChannels.remove(channel.port1());
m_openChannels.remove(channel.port2());
- LOG(MessagePorts, "Registry: After removing channel %s there are %u channels left in the registry:", channel.logString().utf8().data(), m_openChannels.size());
+ // LOG(MessagePorts, "Registry: After removing channel %s there are %u channels left in the registry:", channel.logString().utf8().data(), m_openChannels.size());
}
void MessagePortChannelRegistry::didEntangleLocalToRemote(const MessagePortIdentifier& local, const MessagePortIdentifier& remote, ProcessIdentifier process)
{
- ASSERT(isMainThread());
+ // ASSERT(isMainThread());
// The channel might be gone if the remote side was closed.
auto* channel = m_openChannels.get(local);
@@ -91,7 +94,7 @@ void MessagePortChannelRegistry::didEntangleLocalToRemote(const MessagePortIdent
void MessagePortChannelRegistry::didDisentangleMessagePort(const MessagePortIdentifier& port)
{
- ASSERT(isMainThread());
+ // ASSERT(isMainThread());
// The channel might be gone if the remote side was closed.
auto* channel = m_openChannels.get(port);
@@ -103,17 +106,17 @@ void MessagePortChannelRegistry::didDisentangleMessagePort(const MessagePortIden
void MessagePortChannelRegistry::didCloseMessagePort(const MessagePortIdentifier& port)
{
- ASSERT(isMainThread());
+ // ASSERT(isMainThread());
- LOG(MessagePorts, "Registry: MessagePort %s closed in registry", port.logString().utf8().data());
+ // LOG(MessagePorts, "Registry: MessagePort %s closed in registry", port.logString().utf8().data());
auto* channel = m_openChannels.get(port);
if (!channel)
return;
#ifndef NDEBUG
- if (channel && channel->hasAnyMessagesPendingOrInFlight())
- LOG(MessagePorts, "Registry: (Note) The channel closed for port %s had messages pending or in flight", port.logString().utf8().data());
+ // if (channel && channel->hasAnyMessagesPendingOrInFlight())
+ // LOG(MessagePorts, "Registry: (Note) The channel closed for port %s had messages pending or in flight", port.logString().utf8().data());
#endif
channel->closePort(port);
@@ -124,14 +127,14 @@ void MessagePortChannelRegistry::didCloseMessagePort(const MessagePortIdentifier
bool MessagePortChannelRegistry::didPostMessageToRemote(MessageWithMessagePorts&& message, const MessagePortIdentifier& remoteTarget)
{
- ASSERT(isMainThread());
+ // ASSERT(isMainThread());
- LOG(MessagePorts, "Registry: Posting message to MessagePort %s in registry", remoteTarget.logString().utf8().data());
+ // LOG(MessagePorts, "Registry: Posting message to MessagePort %s in registry", remoteTarget.logString().utf8().data());
// The channel might be gone if the remote side was closed.
auto* channel = m_openChannels.get(remoteTarget);
if (!channel) {
- LOG(MessagePorts, "Registry: Could not find MessagePortChannel for port %s; It was probably closed. Message will be dropped.", remoteTarget.logString().utf8().data());
+ // LOG(MessagePorts, "Registry: Could not find MessagePortChannel for port %s; It was probably closed. Message will be dropped.", remoteTarget.logString().utf8().data());
return false;
}
@@ -140,9 +143,9 @@ bool MessagePortChannelRegistry::didPostMessageToRemote(MessageWithMessagePorts&
void MessagePortChannelRegistry::takeAllMessagesForPort(const MessagePortIdentifier& port, CompletionHandler<void(Vector<MessageWithMessagePorts>&&, CompletionHandler<void()>&&)>&& callback)
{
- ASSERT(isMainThread());
+ // ASSERT(isMainThread());
- LOG(MessagePorts, "Registry: Taking all messages for MessagePort %s", port.logString().utf8().data());
+ // LOG(MessagePorts, "Registry: Taking all messages for MessagePort %s", port.logString().utf8().data());
// The channel might be gone if the remote side was closed.
auto* channel = m_openChannels.get(port);
@@ -156,9 +159,9 @@ void MessagePortChannelRegistry::takeAllMessagesForPort(const MessagePortIdentif
std::optional<MessageWithMessagePorts> MessagePortChannelRegistry::tryTakeMessageForPort(const MessagePortIdentifier& port)
{
- ASSERT(isMainThread());
+ // ASSERT(isMainThread());
- LOG(MessagePorts, "Registry: Trying to take a message for MessagePort %s", port.logString().utf8().data());
+ // LOG(MessagePorts, "Registry: Trying to take a message for MessagePort %s", port.logString().utf8().data());
// The channel might be gone if the remote side was closed.
auto* channel = m_openChannels.get(port);
@@ -170,7 +173,7 @@ std::optional<MessageWithMessagePorts> MessagePortChannelRegistry::tryTakeMessag
MessagePortChannel* MessagePortChannelRegistry::existingChannelContainingPort(const MessagePortIdentifier& port)
{
- ASSERT(isMainThread());
+ // ASSERT(isMainThread());
return m_openChannels.get(port);
}
diff --git a/src/bun.js/bindings/webcore/WebCoreTypedArrayController.cpp b/src/bun.js/bindings/webcore/WebCoreTypedArrayController.cpp
index ca8c79aef..5c8f4fbea 100644
--- a/src/bun.js/bindings/webcore/WebCoreTypedArrayController.cpp
+++ b/src/bun.js/bindings/webcore/WebCoreTypedArrayController.cpp
@@ -35,6 +35,16 @@
#include "JavaScriptCore/JSArrayBuffer.h"
+extern "C" Zig::GlobalObject* Bun__getDefaultGlobal();
+static inline WebCore::JSDOMGlobalObject* getDefaultGlobal(JSC::JSGlobalObject* lexicalGlobalObject)
+{
+ if (auto* global = jsDynamicCast<WebCore::JSDOMGlobalObject*>(lexicalGlobalObject)) {
+ return global;
+ }
+
+ return Bun__getDefaultGlobal();
+}
+
namespace WebCore {
WebCoreTypedArrayController::WebCoreTypedArrayController(bool allowAtomicsWait)
@@ -46,7 +56,7 @@ WebCoreTypedArrayController::~WebCoreTypedArrayController() = default;
JSC::JSArrayBuffer* WebCoreTypedArrayController::toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSC::JSGlobalObject* globalObject, JSC::ArrayBuffer* buffer)
{
- return JSC::jsCast<JSC::JSArrayBuffer*>(WebCore::toJS(lexicalGlobalObject, JSC::jsCast<JSDOMGlobalObject*>(globalObject), buffer));
+ return JSC::jsCast<JSC::JSArrayBuffer*>(WebCore::toJS(lexicalGlobalObject, getDefaultGlobal(globalObject), buffer));
}
void WebCoreTypedArrayController::registerWrapper(JSC::JSGlobalObject* globalObject, JSC::ArrayBuffer* native, JSC::JSArrayBuffer* wrapper)
diff --git a/src/bun.js/bindings/webcore/WebSocket.cpp b/src/bun.js/bindings/webcore/WebSocket.cpp
index c1a4054f5..4f7f933c5 100644
--- a/src/bun.js/bindings/webcore/WebSocket.cpp
+++ b/src/bun.js/bindings/webcore/WebSocket.cpp
@@ -161,7 +161,6 @@ WebSocket::WebSocket(ScriptExecutionContext& context)
{
m_state = CONNECTING;
m_hasPendingActivity.store(true);
- ref();
}
WebSocket::~WebSocket()
@@ -650,7 +649,7 @@ ExceptionOr<void> WebSocket::close(std::optional<unsigned short> optionalCode, c
ExceptionOr<void> WebSocket::terminate()
{
- LOG(Network, "WebSocket %p terminate()", this);
+ // LOG(Network, "WebSocket %p terminate()", this);
if (m_state == CLOSING || m_state == CLOSED)
return {};
@@ -692,7 +691,7 @@ ExceptionOr<void> WebSocket::terminate()
ExceptionOr<void> WebSocket::ping()
{
auto message = WTF::String::number(WTF::jsCurrentTime());
- LOG(Network, "WebSocket %p ping() Sending Timestamp '%s'", this, message.data());
+ // LOG(Network, "WebSocket %p ping() Sending Timestamp '%s'", this, message.data());
if (m_state == CONNECTING)
return Exception { InvalidStateError };
@@ -711,7 +710,7 @@ ExceptionOr<void> WebSocket::ping()
ExceptionOr<void> WebSocket::ping(const String& message)
{
- LOG(Network, "WebSocket %p ping() Sending String '%s'", this, message.utf8().data());
+ // LOG(Network, "WebSocket %p ping() Sending String '%s'", this, message.utf8().data());
if (m_state == CONNECTING)
return Exception { InvalidStateError };
@@ -731,7 +730,7 @@ ExceptionOr<void> WebSocket::ping(const String& message)
ExceptionOr<void> WebSocket::ping(ArrayBuffer& binaryData)
{
- LOG(Network, "WebSocket %p ping() Sending ArrayBuffer %p", this, &binaryData);
+ // LOG(Network, "WebSocket %p ping() Sending ArrayBuffer %p", this, &binaryData);
if (m_state == CONNECTING)
return Exception { InvalidStateError };
@@ -751,7 +750,7 @@ ExceptionOr<void> WebSocket::ping(ArrayBuffer& binaryData)
ExceptionOr<void> WebSocket::ping(ArrayBufferView& arrayBufferView)
{
- LOG(Network, "WebSocket %p ping() Sending ArrayBufferView %p", this, &arrayBufferView);
+ // LOG(Network, "WebSocket %p ping() Sending ArrayBufferView %p", this, &arrayBufferView);
if (m_state == CONNECTING)
return Exception { InvalidStateError };
@@ -774,7 +773,7 @@ ExceptionOr<void> WebSocket::ping(ArrayBufferView& arrayBufferView)
ExceptionOr<void> WebSocket::pong()
{
auto message = WTF::String::number(WTF::jsCurrentTime());
- LOG(Network, "WebSocket %p pong() Sending Timestamp '%s'", this, message.data());
+ // LOG(Network, "WebSocket %p pong() Sending Timestamp '%s'", this, message.data());
if (m_state == CONNECTING)
return Exception { InvalidStateError };
@@ -793,7 +792,7 @@ ExceptionOr<void> WebSocket::pong()
ExceptionOr<void> WebSocket::pong(const String& message)
{
- LOG(Network, "WebSocket %p pong() Sending String '%s'", this, message.utf8().data());
+ // LOG(Network, "WebSocket %p pong() Sending String '%s'", this, message.utf8().data());
if (m_state == CONNECTING)
return Exception { InvalidStateError };
@@ -813,7 +812,7 @@ ExceptionOr<void> WebSocket::pong(const String& message)
ExceptionOr<void> WebSocket::pong(ArrayBuffer& binaryData)
{
- LOG(Network, "WebSocket %p pong() Sending ArrayBuffer %p", this, &binaryData);
+ // LOG(Network, "WebSocket %p pong() Sending ArrayBuffer %p", this, &binaryData);
if (m_state == CONNECTING)
return Exception { InvalidStateError };
@@ -833,7 +832,7 @@ ExceptionOr<void> WebSocket::pong(ArrayBuffer& binaryData)
ExceptionOr<void> WebSocket::pong(ArrayBufferView& arrayBufferView)
{
- LOG(Network, "WebSocket %p pong() Sending ArrayBufferView %p", this, &arrayBufferView);
+ // LOG(Network, "WebSocket %p pong() Sending ArrayBufferView %p", this, &arrayBufferView);
if (m_state == CONNECTING)
return Exception { InvalidStateError };
@@ -1431,7 +1430,7 @@ extern "C" void WebSocket__didAbruptClose(WebCore::WebSocket* webSocket, int32_t
{
webSocket->didFailWithErrorCode(errorCode);
}
-extern "C" void WebSocket__didClose(WebCore::WebSocket* webSocket, uint16_t errorCode, const BunString *reason)
+extern "C" void WebSocket__didClose(WebCore::WebSocket* webSocket, uint16_t errorCode, const BunString* reason)
{
WTF::String wtf_reason = Bun::toWTFString(*reason);
webSocket->didClose(0, errorCode, WTFMove(wtf_reason));
diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyAES.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyAES.cpp
index 17cbf48d9..ce23ce5dd 100644
--- a/src/bun.js/bindings/webcrypto/CryptoKeyAES.cpp
+++ b/src/bun.js/bindings/webcrypto/CryptoKeyAES.cpp
@@ -25,7 +25,7 @@
#include "config.h"
#include "CryptoKeyAES.h"
-
+#include "../wtf-bindings.h"
#if ENABLE(WEB_CRYPTO)
#include "CryptoAesKeyAlgorithm.h"
@@ -107,7 +107,7 @@ JsonWebKey CryptoKeyAES::exportJwk() const
{
JsonWebKey result;
result.kty = "oct"_s;
- result.k = base64URLEncodeToString(m_key);
+ result.k = Bun::base64URLEncodeToString(m_key);
result.key_ops = usages();
result.ext = extractable();
return result;
diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyEC.h b/src/bun.js/bindings/webcrypto/CryptoKeyEC.h
index f2cf7383f..8e8f5eb35 100644
--- a/src/bun.js/bindings/webcrypto/CryptoKeyEC.h
+++ b/src/bun.js/bindings/webcrypto/CryptoKeyEC.h
@@ -91,6 +91,8 @@ public:
String namedCurveString() const;
PlatformECKey platformKey() const { return m_platformKey.get(); }
static bool isValidECAlgorithm(CryptoAlgorithmIdentifier);
+ static RefPtr<CryptoKeyEC> platformImportSpki(CryptoAlgorithmIdentifier, NamedCurve, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap);
+ static RefPtr<CryptoKeyEC> platformImportPkcs8(CryptoAlgorithmIdentifier, NamedCurve, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap);
private:
CryptoKeyEC(CryptoAlgorithmIdentifier, NamedCurve, CryptoKeyType, PlatformECKeyContainer&&, bool extractable, CryptoKeyUsageBitmap);
@@ -104,8 +106,6 @@ private:
static RefPtr<CryptoKeyEC> platformImportRaw(CryptoAlgorithmIdentifier, NamedCurve, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap);
static RefPtr<CryptoKeyEC> platformImportJWKPublic(CryptoAlgorithmIdentifier, NamedCurve, Vector<uint8_t>&& x, Vector<uint8_t>&& y, bool extractable, CryptoKeyUsageBitmap);
static RefPtr<CryptoKeyEC> platformImportJWKPrivate(CryptoAlgorithmIdentifier, NamedCurve, Vector<uint8_t>&& x, Vector<uint8_t>&& y, Vector<uint8_t>&& d, bool extractable, CryptoKeyUsageBitmap);
- static RefPtr<CryptoKeyEC> platformImportSpki(CryptoAlgorithmIdentifier, NamedCurve, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap);
- static RefPtr<CryptoKeyEC> platformImportPkcs8(CryptoAlgorithmIdentifier, NamedCurve, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap);
Vector<uint8_t> platformExportRaw() const;
bool platformAddFieldElements(JsonWebKey&) const;
Vector<uint8_t> platformExportSpki() const;
diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyECOpenSSL.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyECOpenSSL.cpp
index bb5dc5e62..c2b363b32 100644
--- a/src/bun.js/bindings/webcrypto/CryptoKeyECOpenSSL.cpp
+++ b/src/bun.js/bindings/webcrypto/CryptoKeyECOpenSSL.cpp
@@ -25,6 +25,7 @@
#include "config.h"
#include "CryptoKeyEC.h"
+#include "../wtf-bindings.h"
#if ENABLE(WEB_CRYPTO)
@@ -408,15 +409,15 @@ bool CryptoKeyEC::platformAddFieldElements(JsonWebKey& jwk) const
auto x = BIGNUMPtr(BN_new());
auto y = BIGNUMPtr(BN_new());
if (1 == EC_POINT_get_affine_coordinates_GFp(EC_KEY_get0_group(key), publicKey, x.get(), y.get(), ctx.get())) {
- jwk.x = base64URLEncodeToString(convertToBytesExpand(x.get(), keySizeInBytes));
- jwk.y = base64URLEncodeToString(convertToBytesExpand(y.get(), keySizeInBytes));
+ jwk.x = Bun::base64URLEncodeToString(convertToBytesExpand(x.get(), keySizeInBytes));
+ jwk.y = Bun::base64URLEncodeToString(convertToBytesExpand(y.get(), keySizeInBytes));
}
}
if (type() == Type::Private) {
const BIGNUM* privateKey = EC_KEY_get0_private_key(key);
if (privateKey)
- jwk.d = base64URLEncodeToString(convertToBytes(privateKey));
+ jwk.d = Bun::base64URLEncodeToString(convertToBytes(privateKey));
}
return true;
}
diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyHMAC.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyHMAC.cpp
index aafb3b2fe..9428998cb 100644
--- a/src/bun.js/bindings/webcrypto/CryptoKeyHMAC.cpp
+++ b/src/bun.js/bindings/webcrypto/CryptoKeyHMAC.cpp
@@ -25,6 +25,7 @@
#include "config.h"
#include "CryptoKeyHMAC.h"
+#include "../wtf-bindings.h"
#if ENABLE(WEB_CRYPTO)
@@ -69,6 +70,13 @@ CryptoKeyHMAC::CryptoKeyHMAC(Vector<uint8_t>&& key, CryptoAlgorithmIdentifier ha
CryptoKeyHMAC::~CryptoKeyHMAC() = default;
+
+RefPtr<CryptoKeyHMAC> CryptoKeyHMAC::generateFromBytes(void* data, size_t byteLength, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap usages) {
+
+ Vector<uint8_t> vec_data((uint8_t*)data, byteLength);
+ return adoptRef(new CryptoKeyHMAC(vec_data, hash, extractable, usages));
+}
+
RefPtr<CryptoKeyHMAC> CryptoKeyHMAC::generate(size_t lengthBits, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap usages)
{
if (!lengthBits) {
@@ -118,11 +126,13 @@ RefPtr<CryptoKeyHMAC> CryptoKeyHMAC::importJwk(size_t lengthBits, CryptoAlgorith
return CryptoKeyHMAC::importRaw(lengthBits, hash, WTFMove(*octetSequence), extractable, usages);
}
+
JsonWebKey CryptoKeyHMAC::exportJwk() const
-{
+{
+
JsonWebKey result;
result.kty = "oct"_s;
- result.k = base64URLEncodeToString(m_key);
+ result.k = Bun::base64URLEncodeToString(m_key);
result.key_ops = usages();
result.ext = extractable();
return result;
diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyHMAC.h b/src/bun.js/bindings/webcrypto/CryptoKeyHMAC.h
index 0c7ba38cb..714888019 100644
--- a/src/bun.js/bindings/webcrypto/CryptoKeyHMAC.h
+++ b/src/bun.js/bindings/webcrypto/CryptoKeyHMAC.h
@@ -43,9 +43,11 @@ public:
{
return adoptRef(*new CryptoKeyHMAC(key, hash, extractable, usage));
}
+
virtual ~CryptoKeyHMAC();
static RefPtr<CryptoKeyHMAC> generate(size_t lengthBits, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap);
+ static RefPtr<CryptoKeyHMAC> generateFromBytes(void* data, size_t byteLength, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap);
static RefPtr<CryptoKeyHMAC> importRaw(size_t lengthBits, CryptoAlgorithmIdentifier hash, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap);
using CheckAlgCallback = Function<bool(CryptoAlgorithmIdentifier, const String&)>;
static RefPtr<CryptoKeyHMAC> importJwk(size_t lengthBits, CryptoAlgorithmIdentifier hash, JsonWebKey&&, bool extractable, CryptoKeyUsageBitmap, CheckAlgCallback&&);
diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyOKP.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyOKP.cpp
index b7dc55018..4b5d8d588 100644
--- a/src/bun.js/bindings/webcrypto/CryptoKeyOKP.cpp
+++ b/src/bun.js/bindings/webcrypto/CryptoKeyOKP.cpp
@@ -119,14 +119,13 @@ RefPtr<CryptoKeyOKP> CryptoKeyOKP::importRaw(CryptoAlgorithmIdentifier identifie
return create(identifier, namedCurve, usages & CryptoKeyUsageSign ? CryptoKeyType::Private : CryptoKeyType::Public, WTFMove(keyData), extractable, usages);
}
-RefPtr<CryptoKeyOKP> CryptoKeyOKP::importJwk(CryptoAlgorithmIdentifier identifier, NamedCurve namedCurve, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages)
-{
+RefPtr<CryptoKeyOKP> CryptoKeyOKP::importJwkInternal(CryptoAlgorithmIdentifier identifier, NamedCurve namedCurve, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages, bool onlyPublic) {
if (!isPlatformSupportedCurve(namedCurve))
return nullptr;
switch (namedCurve) {
case NamedCurve::Ed25519:
- if (!keyData.d.isEmpty()) {
+ if (!keyData.d.isEmpty() && !onlyPublic) {
if (usages & (CryptoKeyUsageEncrypt | CryptoKeyUsageDecrypt | CryptoKeyUsageVerify | CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits | CryptoKeyUsageWrapKey | CryptoKeyUsageUnwrapKey))
return nullptr;
} else {
@@ -137,8 +136,6 @@ RefPtr<CryptoKeyOKP> CryptoKeyOKP::importJwk(CryptoAlgorithmIdentifier identifie
return nullptr;
if (keyData.crv != "Ed25519"_s)
return nullptr;
- if (!keyData.alg.isEmpty() && keyData.alg != "EdDSA"_s)
- return nullptr;
if (usages && !keyData.use.isEmpty() && keyData.use != "sig"_s)
return nullptr;
if (keyData.key_ops && ((keyData.usages & usages) != usages))
@@ -153,12 +150,14 @@ RefPtr<CryptoKeyOKP> CryptoKeyOKP::importJwk(CryptoAlgorithmIdentifier identifie
break;
}
- if (!keyData.d.isNull()) {
- // FIXME: Validate keyData.x is paired with keyData.d
- auto d = base64URLDecode(keyData.d);
- if (!d)
- return nullptr;
- return create(identifier, namedCurve, CryptoKeyType::Private, WTFMove(*d), extractable, usages);
+ if(!onlyPublic){
+ if (!keyData.d.isNull()) {
+ // FIXME: Validate keyData.x is paired with keyData.d
+ auto d = base64URLDecode(keyData.d);
+ if (!d)
+ return nullptr;
+ return create(identifier, namedCurve, CryptoKeyType::Private, WTFMove(*d), extractable, usages);
+ }
}
if (keyData.x.isNull())
@@ -168,6 +167,14 @@ RefPtr<CryptoKeyOKP> CryptoKeyOKP::importJwk(CryptoAlgorithmIdentifier identifie
if (!x)
return nullptr;
return create(identifier, namedCurve, CryptoKeyType::Public, WTFMove(*x), extractable, usages);
+}
+
+RefPtr<CryptoKeyOKP> CryptoKeyOKP::importPublicJwk(CryptoAlgorithmIdentifier identifier, NamedCurve namedCurve, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages) {
+ return importJwkInternal(identifier, namedCurve, WTFMove(keyData), extractable, usages, true);
+}
+RefPtr<CryptoKeyOKP> CryptoKeyOKP::importJwk(CryptoAlgorithmIdentifier identifier, NamedCurve namedCurve, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages)
+{
+ return importJwkInternal(identifier, namedCurve, WTFMove(keyData), extractable, usages, false);
}
ExceptionOr<Vector<uint8_t>> CryptoKeyOKP::exportRaw() const
diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyOKP.h b/src/bun.js/bindings/webcrypto/CryptoKeyOKP.h
index cc1fe2c73..4d521227f 100644
--- a/src/bun.js/bindings/webcrypto/CryptoKeyOKP.h
+++ b/src/bun.js/bindings/webcrypto/CryptoKeyOKP.h
@@ -48,6 +48,7 @@ public:
WEBCORE_EXPORT static ExceptionOr<CryptoKeyPair> generatePair(CryptoAlgorithmIdentifier, NamedCurve, bool extractable, CryptoKeyUsageBitmap);
WEBCORE_EXPORT static RefPtr<CryptoKeyOKP> importRaw(CryptoAlgorithmIdentifier, NamedCurve, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap);
+ static RefPtr<CryptoKeyOKP> importPublicJwk(CryptoAlgorithmIdentifier, NamedCurve, JsonWebKey&&, bool extractable, CryptoKeyUsageBitmap);
static RefPtr<CryptoKeyOKP> importJwk(CryptoAlgorithmIdentifier, NamedCurve, JsonWebKey&&, bool extractable, CryptoKeyUsageBitmap);
static RefPtr<CryptoKeyOKP> importSpki(CryptoAlgorithmIdentifier, NamedCurve, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap);
static RefPtr<CryptoKeyOKP> importPkcs8(CryptoAlgorithmIdentifier, NamedCurve, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap);
@@ -88,6 +89,7 @@ private:
Vector<uint8_t> platformExportRaw() const;
Vector<uint8_t> platformExportSpki() const;
Vector<uint8_t> platformExportPkcs8() const;
+ static RefPtr<CryptoKeyOKP> importJwkInternal(CryptoAlgorithmIdentifier identifier, NamedCurve namedCurve, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages, bool onlyPublic);
NamedCurve m_curve;
KeyMaterial m_data;
diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyOKPOpenSSL.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyOKPOpenSSL.cpp
index ea3a4d498..82e352d0a 100644
--- a/src/bun.js/bindings/webcrypto/CryptoKeyOKPOpenSSL.cpp
+++ b/src/bun.js/bindings/webcrypto/CryptoKeyOKPOpenSSL.cpp
@@ -25,7 +25,7 @@
#include "config.h"
#include "CryptoKeyOKP.h"
-
+#include "../wtf-bindings.h"
#if ENABLE(WEB_CRYPTO)
#include "JsonWebKey.h"
@@ -296,9 +296,9 @@ String CryptoKeyOKP::generateJwkD() const
ASSERT(type() == CryptoKeyType::Private);
if (namedCurve() == NamedCurve::Ed25519) {
ASSERT(m_exportKey);
- return base64URLEncodeToString(*m_exportKey);
+ return Bun::base64URLEncodeToString(*m_exportKey);
}
- return base64URLEncodeToString(m_data);
+ return Bun::base64URLEncodeToString(m_data);
}
CryptoKeyOKP::KeyMaterial CryptoKeyOKP::ed25519PublicFromPrivate(const KeyMaterial& seed)
@@ -333,15 +333,15 @@ CryptoKeyOKP::KeyMaterial CryptoKeyOKP::ed25519PrivateFromSeed(KeyMaterial&& see
String CryptoKeyOKP::generateJwkX() const
{
if (type() == CryptoKeyType::Public)
- return base64URLEncodeToString(m_data);
+ return Bun::base64URLEncodeToString(m_data);
ASSERT(type() == CryptoKeyType::Private);
if (namedCurve() == NamedCurve::Ed25519)
- return base64URLEncodeToString(WTFMove(ed25519PublicFromPrivate(const_cast<KeyMaterial&>(m_data))));
+ return Bun::base64URLEncodeToString(WTFMove(ed25519PublicFromPrivate(const_cast<KeyMaterial&>(m_data))));
ASSERT(namedCurve() == NamedCurve::X25519);
- return base64URLEncodeToString(WTFMove(x25519PublicFromPrivate(const_cast<KeyMaterial&>(m_data))));
+ return Bun::base64URLEncodeToString(WTFMove(x25519PublicFromPrivate(const_cast<KeyMaterial&>(m_data))));
}
CryptoKeyOKP::KeyMaterial CryptoKeyOKP::platformExportRaw() const
diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp
index 273218721..859767107 100644
--- a/src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp
+++ b/src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp
@@ -28,6 +28,7 @@
#include "CryptoKeyRSAComponents.h"
#include "JsonWebKey.h"
+#include "../wtf-bindings.h"
#include <wtf/text/Base64.h>
#if ENABLE(WEB_CRYPTO)
@@ -143,30 +144,30 @@ JsonWebKey CryptoKeyRSA::exportJwk() const
return result;
// public key
- result.n = base64URLEncodeToString(rsaComponents->modulus());
- result.e = base64URLEncodeToString(rsaComponents->exponent());
+ result.n = Bun::base64URLEncodeToString(rsaComponents->modulus());
+ result.e = Bun::base64URLEncodeToString(rsaComponents->exponent());
if (rsaComponents->type() == CryptoKeyRSAComponents::Type::Public)
return result;
// private key
- result.d = base64URLEncodeToString(rsaComponents->privateExponent());
+ result.d = Bun::base64URLEncodeToString(rsaComponents->privateExponent());
if (!rsaComponents->hasAdditionalPrivateKeyParameters())
return result;
- result.p = base64URLEncodeToString(rsaComponents->firstPrimeInfo().primeFactor);
- result.q = base64URLEncodeToString(rsaComponents->secondPrimeInfo().primeFactor);
- result.dp = base64URLEncodeToString(rsaComponents->firstPrimeInfo().factorCRTExponent);
- result.dq = base64URLEncodeToString(rsaComponents->secondPrimeInfo().factorCRTExponent);
- result.qi = base64URLEncodeToString(rsaComponents->secondPrimeInfo().factorCRTCoefficient);
+ result.p = Bun::base64URLEncodeToString(rsaComponents->firstPrimeInfo().primeFactor);
+ result.q = Bun::base64URLEncodeToString(rsaComponents->secondPrimeInfo().primeFactor);
+ result.dp = Bun::base64URLEncodeToString(rsaComponents->firstPrimeInfo().factorCRTExponent);
+ result.dq = Bun::base64URLEncodeToString(rsaComponents->secondPrimeInfo().factorCRTExponent);
+ result.qi = Bun::base64URLEncodeToString(rsaComponents->secondPrimeInfo().factorCRTCoefficient);
if (rsaComponents->otherPrimeInfos().isEmpty())
return result;
Vector<RsaOtherPrimesInfo> oth;
for (const auto& info : rsaComponents->otherPrimeInfos()) {
RsaOtherPrimesInfo otherInfo;
- otherInfo.r = base64URLEncodeToString(info.primeFactor);
- otherInfo.d = base64URLEncodeToString(info.factorCRTExponent);
- otherInfo.t = base64URLEncodeToString(info.factorCRTCoefficient);
+ otherInfo.r = Bun::base64URLEncodeToString(info.primeFactor);
+ otherInfo.d = Bun::base64URLEncodeToString(info.factorCRTExponent);
+ otherInfo.t = Bun::base64URLEncodeToString(info.factorCRTCoefficient);
oth.append(WTFMove(otherInfo));
}
result.oth = WTFMove(oth);
diff --git a/src/bun.js/bindings/webcrypto/JSCryptoKey.cpp b/src/bun.js/bindings/webcrypto/JSCryptoKey.cpp
index d2ec84afb..5b38d78c9 100644
--- a/src/bun.js/bindings/webcrypto/JSCryptoKey.cpp
+++ b/src/bun.js/bindings/webcrypto/JSCryptoKey.cpp
@@ -196,6 +196,8 @@ void JSCryptoKey::finishCreation(VM& vm)
// static_assert(!std::is_base_of<ActiveDOMObject, CryptoKey>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject.");
}
+
+
JSObject* JSCryptoKey::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
{
return JSCryptoKeyPrototype::create(vm, &globalObject, JSCryptoKeyPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
diff --git a/src/bun.js/bindings/webcrypto/JSJsonWebKey.cpp b/src/bun.js/bindings/webcrypto/JSJsonWebKey.cpp
index 39ed1ff31..067421303 100644
--- a/src/bun.js/bindings/webcrypto/JSJsonWebKey.cpp
+++ b/src/bun.js/bindings/webcrypto/JSJsonWebKey.cpp
@@ -256,7 +256,7 @@ template<> JsonWebKey convertDictionary<JsonWebKey>(JSGlobalObject& lexicalGloba
return result;
}
-JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject& lexicalGlobalObject, JSDOMGlobalObject& globalObject, const JsonWebKey& dictionary)
+JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject& lexicalGlobalObject, JSDOMGlobalObject& globalObject, const JsonWebKey& dictionary, bool ignoreExtAndKeyOps)
{
auto& vm = JSC::getVM(&lexicalGlobalObject);
auto throwScope = DECLARE_THROW_SCOPE(vm);
@@ -293,7 +293,7 @@ JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject& lexicalGlobalObject, J
RETURN_IF_EXCEPTION(throwScope, { });
result->putDirect(vm, JSC::Identifier::fromString(vm, "e"_s), eValue);
}
- if (!IDLBoolean::isNullValue(dictionary.ext)) {
+ if (!ignoreExtAndKeyOps && !IDLBoolean::isNullValue(dictionary.ext)) {
auto extValue = toJS<IDLBoolean>(lexicalGlobalObject, throwScope, IDLBoolean::extractValueFromNullable(dictionary.ext));
RETURN_IF_EXCEPTION(throwScope, { });
result->putDirect(vm, JSC::Identifier::fromString(vm, "ext"_s), extValue);
@@ -303,7 +303,7 @@ JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject& lexicalGlobalObject, J
RETURN_IF_EXCEPTION(throwScope, { });
result->putDirect(vm, JSC::Identifier::fromString(vm, "k"_s), kValue);
}
- if (!IDLSequence<IDLEnumeration<CryptoKeyUsage>>::isNullValue(dictionary.key_ops)) {
+ if (!ignoreExtAndKeyOps && !IDLSequence<IDLEnumeration<CryptoKeyUsage>>::isNullValue(dictionary.key_ops)) {
auto key_opsValue = toJS<IDLSequence<IDLEnumeration<CryptoKeyUsage>>>(lexicalGlobalObject, globalObject, throwScope, IDLSequence<IDLEnumeration<CryptoKeyUsage>>::extractValueFromNullable(dictionary.key_ops));
RETURN_IF_EXCEPTION(throwScope, { });
result->putDirect(vm, JSC::Identifier::fromString(vm, "key_ops"_s), key_opsValue);
diff --git a/src/bun.js/bindings/webcrypto/JSJsonWebKey.h b/src/bun.js/bindings/webcrypto/JSJsonWebKey.h
index 07e7960be..c1b287c4d 100644
--- a/src/bun.js/bindings/webcrypto/JSJsonWebKey.h
+++ b/src/bun.js/bindings/webcrypto/JSJsonWebKey.h
@@ -29,7 +29,7 @@ namespace WebCore {
template<> JsonWebKey convertDictionary<JsonWebKey>(JSC::JSGlobalObject&, JSC::JSValue);
-JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject&, JSDOMGlobalObject&, const JsonWebKey&);
+JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject&, JSDOMGlobalObject&, const JsonWebKey&, bool ignoreExtAndKeyOps = false);
} // namespace WebCore
diff --git a/src/bun.js/bindings/wtf-bindings.cpp b/src/bun.js/bindings/wtf-bindings.cpp
index d05fb255b..2ec3d7ee8 100644
--- a/src/bun.js/bindings/wtf-bindings.cpp
+++ b/src/bun.js/bindings/wtf-bindings.cpp
@@ -237,4 +237,24 @@ extern "C" size_t WTF__base64URLEncode(const unsigned char* __restrict inputData
destinationDataBuffer[didx++] = '=';
return destinationDataBufferSize;
-} \ No newline at end of file
+}
+
+namespace Bun {
+String base64URLEncodeToString(Vector<uint8_t> data)
+{
+ auto size = data.size();
+ size_t encodedLength = ((size * 4) + 2) / 3;
+ if (!encodedLength)
+ return String();
+
+ LChar* ptr;
+ auto result = String::createUninitialized(encodedLength, ptr);
+ if (UNLIKELY(!ptr)) {
+ RELEASE_ASSERT_NOT_REACHED();
+ return String();
+ }
+ encodedLength = WTF__base64URLEncode(data.data(), data.size(), ptr, encodedLength);
+ RELEASE_ASSERT(result.length() == encodedLength);
+ return result;
+}
+}
diff --git a/src/bun.js/bindings/wtf-bindings.h b/src/bun.js/bindings/wtf-bindings.h
index 1721b0e1c..3df543934 100644
--- a/src/bun.js/bindings/wtf-bindings.h
+++ b/src/bun.js/bindings/wtf-bindings.h
@@ -4,3 +4,7 @@
#include "wtf/text/ASCIIFastPath.h"
extern "C" void WTF__copyLCharsFromUCharSource(LChar* destination, const UChar* source, size_t length);
+
+namespace Bun {
+String base64URLEncodeToString(Vector<uint8_t> data);
+} \ No newline at end of file
diff --git a/src/bun.js/event_loop.zig b/src/bun.js/event_loop.zig
index f22d8793a..bdee2cefb 100644
--- a/src/bun.js/event_loop.zig
+++ b/src/bun.js/event_loop.zig
@@ -118,6 +118,7 @@ pub fn WorkTask(comptime Context: type, comptime async_io: bool) type {
}
pub fn runFromThreadPool(task: *TaskType) void {
+ JSC.markBinding(@src());
var this = @fieldParentPtr(This, "task", task);
Context.run(this.ctx, this);
}
@@ -303,6 +304,48 @@ const PollPendingModulesTask = JSC.ModuleLoader.AsyncModule.Queue;
// const PromiseTask = JSInternalPromise.Completion.PromiseTask;
const GetAddrInfoRequestTask = JSC.DNS.GetAddrInfoRequest.Task;
const JSCDeferredWorkTask = JSCScheduler.JSCDeferredWorkTask;
+
+const Stat = JSC.Node.Async.stat;
+const Lstat = JSC.Node.Async.lstat;
+const Fstat = JSC.Node.Async.fstat;
+const Open = JSC.Node.Async.open;
+const ReadFile = JSC.Node.Async.readFile;
+const WriteFile = JSC.Node.Async.writeFile;
+const CopyFile = JSC.Node.Async.copyFile;
+const Read = JSC.Node.Async.read;
+const Write = JSC.Node.Async.write;
+const Truncate = JSC.Node.Async.truncate;
+const FTruncate = JSC.Node.Async.ftruncate;
+const Readdir = JSC.Node.Async.readdir;
+const Readv = JSC.Node.Async.readv;
+const Writev = JSC.Node.Async.writev;
+const Close = JSC.Node.Async.close;
+const Rm = JSC.Node.Async.rm;
+const Rmdir = JSC.Node.Async.rmdir;
+const Chown = JSC.Node.Async.chown;
+const FChown = JSC.Node.Async.fchown;
+const Utimes = JSC.Node.Async.utimes;
+const Lutimes = JSC.Node.Async.lutimes;
+const Chmod = JSC.Node.Async.chmod;
+const Fchmod = JSC.Node.Async.fchmod;
+const Link = JSC.Node.Async.link;
+const Symlink = JSC.Node.Async.symlink;
+const Readlink = JSC.Node.Async.readlink;
+const Realpath = JSC.Node.Async.realpath;
+const Mkdir = JSC.Node.Async.mkdir;
+const Fsync = JSC.Node.Async.fsync;
+const Rename = JSC.Node.Async.rename;
+const Fdatasync = JSC.Node.Async.fdatasync;
+const Access = JSC.Node.Async.access;
+const AppendFile = JSC.Node.Async.appendFile;
+const Mkdtemp = JSC.Node.Async.mkdtemp;
+const Exists = JSC.Node.Async.exists;
+const Futimes = JSC.Node.Async.futimes;
+const Lchmod = JSC.Node.Async.lchmod;
+const Lchown = JSC.Node.Async.lchown;
+const Unlink = JSC.Node.Async.unlink;
+
+// Task.get(ReadFileTask) -> ?ReadFileTask
pub const Task = TaggedPointerUnion(.{
FetchTasklet,
Microtask,
@@ -321,13 +364,49 @@ pub const Task = TaggedPointerUnion(.{
GetAddrInfoRequestTask,
FSWatchTask,
JSCDeferredWorkTask,
-
- // PromiseTask,
- // TimeoutTasklet,
+ Stat,
+ Lstat,
+ Fstat,
+ Open,
+ ReadFile,
+ WriteFile,
+ CopyFile,
+ Read,
+ Write,
+ Truncate,
+ FTruncate,
+ Readdir,
+ Close,
+ Rm,
+ Rmdir,
+ Chown,
+ FChown,
+ Utimes,
+ Lutimes,
+ Chmod,
+ Fchmod,
+ Link,
+ Symlink,
+ Readlink,
+ Realpath,
+ Mkdir,
+ Fsync,
+ Fdatasync,
+ Writev,
+ Readv,
+ Rename,
+ Access,
+ AppendFile,
+ Mkdtemp,
+ Exists,
+ Futimes,
+ Lchmod,
+ Lchown,
+ Unlink,
});
const UnboundedQueue = @import("./unbounded_queue.zig").UnboundedQueue;
pub const ConcurrentTask = struct {
- task: Task = undefined,
+ task: if (JSC.is_bindgen) void else Task = undefined,
next: ?*ConcurrentTask = null,
auto_delete: bool = false,
@@ -348,14 +427,19 @@ pub const ConcurrentTask = struct {
}
pub fn createFrom(task: anytype) *ConcurrentTask {
+ JSC.markBinding(@src());
return create(Task.init(task));
}
pub fn fromCallback(ptr: anytype, comptime callback: anytype) *ConcurrentTask {
+ JSC.markBinding(@src());
+
return create(ManagedTask.New(std.meta.Child(@TypeOf(ptr)), callback).init(ptr));
}
pub fn from(this: *ConcurrentTask, of: anytype, auto_deinit: AutoDeinit) *ConcurrentTask {
+ JSC.markBinding(@src());
+
this.* = .{
.task = Task.init(of),
.next = null,
@@ -377,6 +461,7 @@ pub const GarbageCollectionController = struct {
gc_repeating_timer: *uws.Timer = undefined,
gc_timer_interval: i32 = 0,
gc_repeating_timer_fast: bool = true,
+ disabled: bool = false,
pub fn init(this: *GarbageCollectionController, vm: *VirtualMachine) void {
var actual = vm.event_loop_handle.?;
@@ -391,8 +476,12 @@ pub const GarbageCollectionController = struct {
}
} else |_| {}
}
- this.gc_repeating_timer.set(this, onGCRepeatingTimer, gc_timer_interval, gc_timer_interval);
this.gc_timer_interval = gc_timer_interval;
+
+ this.disabled = vm.bundler.env.has("BUN_GC_TIMER_DISABLE");
+
+ if (!this.disabled)
+ this.gc_repeating_timer.set(this, onGCRepeatingTimer, gc_timer_interval, gc_timer_interval);
}
pub fn scheduleGCTimer(this: *GarbageCollectionController) void {
@@ -406,6 +495,7 @@ pub const GarbageCollectionController = struct {
pub fn onGCTimer(timer: *uws.Timer) callconv(.C) void {
var this = timer.as(*GarbageCollectionController);
+ if (this.disabled) return;
this.gc_timer_state = .run_on_next_tick;
}
@@ -450,11 +540,12 @@ pub const GarbageCollectionController = struct {
}
pub fn processGCTimer(this: *GarbageCollectionController) void {
- var vm = this.bunVM().global.vm();
+ if (this.disabled) return;
+ var vm = this.bunVM().jsc;
this.processGCTimerWithHeapSize(vm, vm.blockBytesAllocated());
}
- pub fn processGCTimerWithHeapSize(this: *GarbageCollectionController, vm: *JSC.VM, this_heap_size: usize) void {
+ fn processGCTimerWithHeapSize(this: *GarbageCollectionController, vm: *JSC.VM, this_heap_size: usize) void {
const prev = this.gc_last_heap_size;
switch (this.gc_timer_state) {
@@ -490,7 +581,8 @@ pub const GarbageCollectionController = struct {
}
pub fn performGC(this: *GarbageCollectionController) void {
- var vm = this.bunVM().global.vm();
+ if (this.disabled) return;
+ var vm = this.bunVM().jsc;
vm.collectAsync();
this.gc_last_heap_size = vm.blockBytesAllocated();
}
@@ -515,7 +607,7 @@ comptime {
pub const DeferredRepeatingTask = *const (fn (*anyopaque) bool);
pub const EventLoop = struct {
- tasks: Queue = undefined,
+ tasks: if (JSC.is_bindgen) void else Queue = undefined,
concurrent_tasks: ConcurrentTask.Queue = ConcurrentTask.Queue{},
global: *JSGlobalObject = undefined,
virtual_machine: *JSC.VirtualMachine = undefined,
@@ -530,7 +622,7 @@ pub const EventLoop = struct {
pub fn tickWhilePaused(this: *EventLoop, done: *bool) void {
while (!done.*) {
- this.virtual_machine.event_loop_handle.?.tick();
+ this.virtual_machine.event_loop_handle.?.tick(this.virtual_machine.jsc);
}
}
extern fn JSC__JSGlobalObject__drainMicrotasks(*JSC.JSGlobalObject) void;
@@ -662,6 +754,162 @@ pub const EventLoop = struct {
any.runFromJS();
any.deinit();
},
+ @field(Task.Tag, typeBaseName(@typeName(Stat))) => {
+ var any: *Stat = task.get(Stat).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Lstat))) => {
+ var any: *Lstat = task.get(Lstat).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Fstat))) => {
+ var any: *Fstat = task.get(Fstat).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Open))) => {
+ var any: *Open = task.get(Open).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(ReadFile))) => {
+ var any: *ReadFile = task.get(ReadFile).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(WriteFile))) => {
+ var any: *WriteFile = task.get(WriteFile).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(CopyFile))) => {
+ var any: *CopyFile = task.get(CopyFile).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Read))) => {
+ var any: *Read = task.get(Read).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Write))) => {
+ var any: *Write = task.get(Write).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Truncate))) => {
+ var any: *Truncate = task.get(Truncate).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Writev))) => {
+ var any: *Writev = task.get(Writev).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Readv))) => {
+ var any: *Readv = task.get(Readv).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Rename))) => {
+ var any: *Rename = task.get(Rename).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(FTruncate))) => {
+ var any: *FTruncate = task.get(FTruncate).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Readdir))) => {
+ var any: *Readdir = task.get(Readdir).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Close))) => {
+ var any: *Close = task.get(Close).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Rm))) => {
+ var any: *Rm = task.get(Rm).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Rmdir))) => {
+ var any: *Rmdir = task.get(Rmdir).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Chown))) => {
+ var any: *Chown = task.get(Chown).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(FChown))) => {
+ var any: *FChown = task.get(FChown).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Utimes))) => {
+ var any: *Utimes = task.get(Utimes).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Lutimes))) => {
+ var any: *Lutimes = task.get(Lutimes).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Chmod))) => {
+ var any: *Chmod = task.get(Chmod).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Fchmod))) => {
+ var any: *Fchmod = task.get(Fchmod).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Link))) => {
+ var any: *Link = task.get(Link).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Symlink))) => {
+ var any: *Symlink = task.get(Symlink).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Readlink))) => {
+ var any: *Readlink = task.get(Readlink).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Realpath))) => {
+ var any: *Realpath = task.get(Realpath).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Mkdir))) => {
+ var any: *Mkdir = task.get(Mkdir).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Fsync))) => {
+ var any: *Fsync = task.get(Fsync).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Fdatasync))) => {
+ var any: *Fdatasync = task.get(Fdatasync).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Access))) => {
+ var any: *Access = task.get(Access).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(AppendFile))) => {
+ var any: *AppendFile = task.get(AppendFile).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Mkdtemp))) => {
+ var any: *Mkdtemp = task.get(Mkdtemp).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Exists))) => {
+ var any: *Exists = task.get(Exists).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Futimes))) => {
+ var any: *Futimes = task.get(Futimes).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Lchmod))) => {
+ var any: *Lchmod = task.get(Lchmod).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Lchown))) => {
+ var any: *Lchown = task.get(Lchown).?;
+ any.runFromJSThread();
+ },
+ @field(Task.Tag, typeBaseName(@typeName(Unlink))) => {
+ var any: *Unlink = task.get(Unlink).?;
+ any.runFromJSThread();
+ },
else => if (Environment.allow_assert) {
bun.Output.prettyln("\nUnexpected tag: {s}\n", .{@tagName(task.tag())});
} else {
@@ -683,6 +931,7 @@ pub const EventLoop = struct {
}
pub fn tickConcurrentWithCount(this: *EventLoop) usize {
+ JSC.markBinding(@src());
var concurrent = this.concurrent_tasks.popBatch();
const count = concurrent.count;
if (count == 0)
@@ -740,8 +989,9 @@ pub const EventLoop = struct {
}
if (loop.num_polls > 0 or loop.active > 0) {
- loop.tick();
this.processGCTimer();
+ loop.tick(ctx.jsc);
+
ctx.onAfterEventLoop();
// this.afterUSocketsTick();
}
@@ -764,8 +1014,8 @@ pub const EventLoop = struct {
}
if (loop.num_polls > 0 or loop.active > 0) {
- loop.tickWithTimeout(timeoutMs);
this.processGCTimer();
+ loop.tickWithTimeout(timeoutMs, ctx.jsc);
ctx.onAfterEventLoop();
// this.afterUSocketsTick();
}
@@ -789,8 +1039,8 @@ pub const EventLoop = struct {
}
}
- loop.tick();
this.processGCTimer();
+ loop.tick(ctx.jsc);
ctx.onAfterEventLoop();
this.tickConcurrent();
this.tick();
@@ -812,8 +1062,8 @@ pub const EventLoop = struct {
}
if (loop.active > 0) {
- loop.tick();
this.processGCTimer();
+ loop.tick(ctx.jsc);
ctx.onAfterEventLoop();
// this.afterUSocketsTick();
}
@@ -824,13 +1074,15 @@ pub const EventLoop = struct {
}
pub fn tick(this: *EventLoop) void {
+ JSC.markBinding(@src());
+
var ctx = this.virtual_machine;
this.tickConcurrent();
this.processGCTimer();
var global = ctx.global;
- var global_vm = global.vm();
+ var global_vm = ctx.jsc;
while (true) {
while (this.tickWithCount() > 0) : (this.global.handleRejectedPromises()) {
this.tickConcurrent();
@@ -851,12 +1103,12 @@ pub const EventLoop = struct {
}
pub fn waitForPromise(this: *EventLoop, promise: JSC.AnyPromise) void {
- switch (promise.status(this.global.vm())) {
+ switch (promise.status(this.virtual_machine.jsc)) {
JSC.JSPromise.Status.Pending => {
- while (promise.status(this.global.vm()) == .Pending) {
+ while (promise.status(this.virtual_machine.jsc) == .Pending) {
this.tick();
- if (promise.status(this.global.vm()) == .Pending) {
+ if (promise.status(this.virtual_machine.jsc) == .Pending) {
this.autoTick();
}
}
@@ -868,16 +1120,16 @@ pub const EventLoop = struct {
// TODO: this implementation is terrible
// we should not be checking the millitimestamp every time
pub fn waitForPromiseWithTimeout(this: *EventLoop, promise: JSC.AnyPromise, timeout: u32) bool {
- return switch (promise.status(this.global.vm())) {
+ return switch (promise.status(this.virtual_machine.jsc)) {
JSC.JSPromise.Status.Pending => {
if (timeout == 0) {
return false;
}
var start_time = std.time.milliTimestamp();
- while (promise.status(this.global.vm()) == .Pending) {
+ while (promise.status(this.virtual_machine.jsc) == .Pending) {
this.tick();
- if (promise.status(this.global.vm()) == .Pending) {
+ if (promise.status(this.virtual_machine.jsc) == .Pending) {
const remaining = std.time.milliTimestamp() - start_time;
if (remaining >= timeout) {
return false;
@@ -893,6 +1145,7 @@ pub const EventLoop = struct {
}
pub fn enqueueTask(this: *EventLoop, task: Task) void {
+ JSC.markBinding(@src());
this.tasks.writeItem(task) catch unreachable;
}
@@ -905,7 +1158,7 @@ pub const EventLoop = struct {
pub fn callTask(timer: *uws.Timer) callconv(.C) void {
var task = Task.from(timer.as(*anyopaque));
- timer.deinit();
+ defer timer.deinit(true);
JSC.VirtualMachine.get().enqueueTask(task);
}
@@ -916,7 +1169,7 @@ pub const EventLoop = struct {
this.virtual_machine.event_loop_handle = uws.Loop.get();
this.virtual_machine.gc_controller.init(this.virtual_machine);
// _ = actual.addPostHandler(*JSC.EventLoop, this, JSC.EventLoop.afterUSocketsTick);
- // _ = actual.addPreHandler(*JSC.VM, this.virtual_machine.global.vm(), JSC.VM.drainMicrotasks);
+ // _ = actual.addPreHandler(*JSC.VM, this.virtual_machine.jsc, JSC.VM.drainMicrotasks);
}
}
@@ -995,7 +1248,7 @@ pub const MiniEventLoop = struct {
while (!isDone(context)) {
if (this.tickConcurrentWithCount() == 0 and this.tasks.count == 0) {
this.loop.num_polls += 1;
- this.loop.tick();
+ this.loop.tick(null);
this.loop.num_polls -= 1;
}
@@ -1086,7 +1339,7 @@ pub const AnyEventLoop = union(enum) {
// var concurrent = bun.default_allocator.create(ConcurrentTask) catch unreachable;
// _ = concurrent.from(JSC.Task.init(&@field(ctx, field)));
// concurrent.auto_delete = true;
- // this.jsc.enqueueTaskConcurrent(concurrent);
+ // this.virtual_machine.jsc.enqueueTaskConcurrent(concurrent);
},
.mini => {
this.mini.enqueueTaskConcurrent(Context, ParentContext, ctx, Callback, field);
diff --git a/src/bun.js/ipc.zig b/src/bun.js/ipc.zig
index 57fcef75f..a0742a0c4 100644
--- a/src/bun.js/ipc.zig
+++ b/src/bun.js/ipc.zig
@@ -35,6 +35,11 @@ pub const IPCMessageType = enum(u8) {
_,
};
+pub const IPCBuffer = struct {
+ list: bun.ByteList = .{},
+ cursor: u32 = 0,
+};
+
/// Given potentially unfinished buffer `data`, attempt to decode and process a message from it.
/// Returns `NotEnoughBytes` if there werent enough bytes
/// Returns `InvalidFormat` if the message was invalid, probably close the socket in this case
@@ -89,12 +94,74 @@ pub fn decodeIPCMessage(
pub const Socket = uws.NewSocketHandler(false);
+pub const IPCData = struct {
+ socket: Socket,
+ incoming: bun.ByteList = .{}, // Maybe we should use IPCBuffer here as well
+ outgoing: IPCBuffer = .{},
+
+ has_written_version: if (Environment.allow_assert) u1 else u0 = 0,
+
+ pub fn writeVersionPacket(this: *IPCData) void {
+ if (Environment.allow_assert) {
+ std.debug.assert(this.has_written_version == 0);
+ }
+ const VersionPacket = extern struct {
+ type: IPCMessageType align(1) = .Version,
+ version: u32 align(1) = ipcVersion,
+ };
+ const bytes = comptime std.mem.asBytes(&VersionPacket{});
+ const n = this.socket.write(bytes, false);
+ if (n != bytes.len) {
+ var list = this.outgoing.list.listManaged(bun.default_allocator);
+ list.appendSlice(bytes) catch @panic("OOM");
+ }
+ if (Environment.allow_assert) {
+ this.has_written_version = 1;
+ }
+ }
+
+ pub fn serializeAndSend(ipc_data: *IPCData, globalThis: *JSGlobalObject, value: JSValue) bool {
+ if (Environment.allow_assert) {
+ std.debug.assert(ipc_data.has_written_version == 1);
+ }
+
+ const serialized = value.serialize(globalThis) orelse return false;
+ defer serialized.deinit();
+
+ const size: u32 = @intCast(serialized.data.len);
+
+ const payload_length: usize = @sizeOf(IPCMessageType) + @sizeOf(u32) + size;
+
+ ipc_data.outgoing.list.ensureUnusedCapacity(bun.default_allocator, payload_length) catch @panic("OOM");
+ const start_offset = ipc_data.outgoing.list.len;
+
+ ipc_data.outgoing.list.writeTypeAsBytesAssumeCapacity(u8, @intFromEnum(IPCMessageType.SerializedMessage));
+ ipc_data.outgoing.list.writeTypeAsBytesAssumeCapacity(u32, size);
+ ipc_data.outgoing.list.appendSliceAssumeCapacity(serialized.data);
+
+ std.debug.assert(ipc_data.outgoing.list.len == start_offset + payload_length);
+
+ if (start_offset == 0) {
+ std.debug.assert(ipc_data.outgoing.cursor == 0);
+
+ const n = ipc_data.socket.write(ipc_data.outgoing.list.ptr[start_offset..payload_length], false);
+ if (n == payload_length) {
+ ipc_data.outgoing.list.len = 0;
+ } else if (n > 0) {
+ ipc_data.outgoing.cursor = @intCast(n);
+ }
+ }
+
+ return true;
+ }
+};
+
/// This type is shared between VirtualMachine and Subprocess for their respective IPC handlers
///
/// `Context` must be a struct that implements this interface:
/// struct {
/// globalThis: ?*JSGlobalObject,
-/// ipc_buffer: bun.ByteList,
+/// ipc: IPCData,
///
/// fn handleIPCMessage(*Context, DecodedIPCMessage) void
/// fn handleIPCClose(*Context, Socket) void
@@ -102,18 +169,18 @@ pub const Socket = uws.NewSocketHandler(false);
pub fn NewIPCHandler(comptime Context: type) type {
return struct {
pub fn onOpen(
- _: *Context,
- socket: Socket,
+ _: *anyopaque,
+ _: Socket,
) void {
- // Write the version message
- const Data = extern struct {
- type: IPCMessageType align(1) = .Version,
- version: u32 align(1) = ipcVersion,
- };
- const data: []const u8 = comptime @as([@sizeOf(Data)]u8, @bitCast(Data{}))[0..];
- _ = socket.write(data, false);
- socket.flush();
+ // it is NOT safe to use the first argument here because it has not been initialized yet.
+ // ideally we would call .ipc.writeVersionPacket() here, and we need that to handle the
+ // theoretical write failure, but since the .ipc.outgoing buffer isn't available, that
+ // data has nowhere to go.
+ //
+ // therefore, initializers of IPC handlers need to call .ipc.writeVersionPacket() themselves
+ // this is covered by an assertion.
}
+
pub fn onClose(
this: *Context,
socket: Socket,
@@ -124,7 +191,7 @@ pub fn NewIPCHandler(comptime Context: type) type {
log("onClose\n", .{});
this.handleIPCClose(socket);
}
- // extern fn getpid() i32;
+
pub fn onData(
this: *Context,
socket: Socket,
@@ -133,10 +200,6 @@ pub fn NewIPCHandler(comptime Context: type) type {
var data = data_;
log("onData {}", .{std.fmt.fmtSliceHexLower(data)});
- // if (comptime Context == bun.JSC.VirtualMachine.IPCInstance) {
- // logDataOnly("{d} -> '{}'", .{ getpid(), std.fmt.fmtSliceHexLower(data) });
- // }
-
// In the VirtualMachine case, `globalThis` is an optional, in case
// the vm is freed before the socket closes.
var globalThis = switch (@typeInfo(@TypeOf(this.globalThis))) {
@@ -154,11 +217,11 @@ pub fn NewIPCHandler(comptime Context: type) type {
// Decode the message with just the temporary buffer, and if that
// fails (not enough bytes) then we allocate to .ipc_buffer
- if (this.ipc_buffer.len == 0) {
+ if (this.ipc.incoming.len == 0) {
while (true) {
const result = decodeIPCMessage(data, globalThis) catch |e| switch (e) {
error.NotEnoughBytes => {
- _ = this.ipc_buffer.write(bun.default_allocator, data) catch @panic("OOM");
+ _ = this.ipc.incoming.write(bun.default_allocator, data) catch @panic("OOM");
log("hit NotEnoughBytes", .{});
return;
},
@@ -180,15 +243,15 @@ pub fn NewIPCHandler(comptime Context: type) type {
}
}
- _ = this.ipc_buffer.write(bun.default_allocator, data) catch @panic("OOM");
+ _ = this.ipc.incoming.write(bun.default_allocator, data) catch @panic("OOM");
- var slice = this.ipc_buffer.slice();
+ var slice = this.ipc.incoming.slice();
while (true) {
const result = decodeIPCMessage(slice, globalThis) catch |e| switch (e) {
error.NotEnoughBytes => {
// copy the remaining bytes to the start of the buffer
- bun.copy(u8, this.ipc_buffer.ptr[0..slice.len], slice);
- this.ipc_buffer.len = @truncate(slice.len);
+ bun.copy(u8, this.ipc.incoming.ptr[0..slice.len], slice);
+ this.ipc.incoming.len = @truncate(slice.len);
log("hit NotEnoughBytes2", .{});
return;
},
@@ -206,34 +269,47 @@ pub fn NewIPCHandler(comptime Context: type) type {
slice = slice[result.bytes_consumed..];
} else {
// clear the buffer
- this.ipc_buffer.len = 0;
+ this.ipc.incoming.len = 0;
return;
}
}
}
pub fn onWritable(
- _: *Context,
- _: Socket,
- ) void {}
+ context: *Context,
+ socket: Socket,
+ ) void {
+ const to_write = context.ipc.outgoing.list.ptr[context.ipc.outgoing.cursor..context.ipc.outgoing.list.len];
+ if (to_write.len == 0) {
+ context.ipc.outgoing.cursor = 0;
+ context.ipc.outgoing.list.len = 0;
+ return;
+ }
+ const n = socket.write(to_write, false);
+ if (n == to_write.len) {
+ context.ipc.outgoing.cursor = 0;
+ context.ipc.outgoing.list.len = 0;
+ } else if (n > 0) {
+ context.ipc.outgoing.cursor += @intCast(n);
+ }
+ }
+
pub fn onTimeout(
_: *Context,
_: Socket,
) void {}
+
pub fn onConnectError(
- _: *Context,
+ _: *anyopaque,
_: Socket,
_: c_int,
- ) void {}
+ ) void {
+ // context has not been initialized
+ }
+
pub fn onEnd(
_: *Context,
_: Socket,
) void {}
};
}
-
-/// This is used for Bun.spawn() IPC because otherwise we would have to copy the data once to get it to zig, then write it.
-/// Returns `true` on success, `false` on failure + throws a JS error.
-extern fn Bun__serializeJSValueForSubprocess(global: *JSC.JSGlobalObject, value: JSValue, fd: bun.FileDescriptor) bool;
-
-pub const serializeJSValueForSubprocess = Bun__serializeJSValueForSubprocess;
diff --git a/src/bun.js/javascript.zig b/src/bun.js/javascript.zig
index e2e44e63a..1c996039d 100644
--- a/src/bun.js/javascript.zig
+++ b/src/bun.js/javascript.zig
@@ -294,13 +294,8 @@ pub export fn Bun__Process__send(
return .zero;
}
var vm = globalObject.bunVM();
- if (vm.ipc) |ipc| {
- const fd = ipc.socket.fd();
- const success = IPC.serializeJSValueForSubprocess(
- globalObject,
- callFrame.argument(0),
- fd,
- );
+ if (vm.ipc) |ipc_instance| {
+ const success = ipc_instance.ipc.serializeAndSend(globalObject, callFrame.argument(0));
return if (success) .undefined else .zero;
} else {
globalObject.throw("IPC Socket is no longer open.", .{});
@@ -308,10 +303,15 @@ pub export fn Bun__Process__send(
}
}
+pub export fn Bun__isBunMain(globalObject: *JSGlobalObject, input_ptr: [*]const u8, input_len: usize) bool {
+ return strings.eql(globalObject.bunVM().main, input_ptr[0..input_len]);
+}
+
pub export fn Bun__Process__disconnect(
globalObject: *JSGlobalObject,
callFrame: *JSC.CallFrame,
) JSValue {
+ JSC.markBinding(@src());
_ = callFrame;
_ = globalObject;
return .undefined;
@@ -320,14 +320,20 @@ pub export fn Bun__Process__disconnect(
/// This function is called on the main thread
/// The bunVM() call will assert this
pub export fn Bun__queueTask(global: *JSGlobalObject, task: *JSC.CppTask) void {
+ JSC.markBinding(@src());
+
global.bunVM().eventLoop().enqueueTask(Task.init(task));
}
pub export fn Bun__queueTaskWithTimeout(global: *JSGlobalObject, task: *JSC.CppTask, milliseconds: i32) void {
+ JSC.markBinding(@src());
+
global.bunVM().eventLoop().enqueueTaskWithTimeout(Task.init(task), milliseconds);
}
pub export fn Bun__reportUnhandledError(globalObject: *JSGlobalObject, value: JSValue) callconv(.C) JSValue {
+ JSC.markBinding(@src());
+
var jsc_vm = globalObject.bunVM();
jsc_vm.onUnhandledError(globalObject, value);
return JSC.JSValue.jsUndefined();
@@ -337,6 +343,8 @@ pub export fn Bun__reportUnhandledError(globalObject: *JSGlobalObject, value: JS
/// The main difference: we need to allocate the task & wakeup the thread
/// We can avoid that if we run it from the main thread.
pub export fn Bun__queueTaskConcurrently(global: *JSGlobalObject, task: *JSC.CppTask) void {
+ JSC.markBinding(@src());
+
var concurrent = bun.default_allocator.create(JSC.ConcurrentTask) catch unreachable;
concurrent.* = JSC.ConcurrentTask{
.task = Task.init(task),
@@ -346,6 +354,8 @@ pub export fn Bun__queueTaskConcurrently(global: *JSGlobalObject, task: *JSC.Cpp
}
pub export fn Bun__handleRejectedPromise(global: *JSGlobalObject, promise: *JSC.JSPromise) void {
+ JSC.markBinding(@src());
+
const result = promise.result(global.vm());
var jsc_vm = global.bunVM();
@@ -369,6 +379,14 @@ pub export fn Bun__onDidAppendPlugin(jsc_vm: *VirtualMachine, globalObject: *JSG
jsc_vm.bundler.linker.plugin_runner = &jsc_vm.plugin_runner.?;
}
+// pub fn getGlobalExitCodeForPipeFailure() u8 {
+// if (VirtualMachine.is_main_thread_vm) {
+// return VirtualMachine.get().exit_handler.exit_code;
+// }
+
+// return 0;
+// }
+
pub const ExitHandler = struct {
exit_code: u8 = 0,
@@ -401,6 +419,50 @@ pub const ExitHandler = struct {
pub const WebWorker = @import("./web_worker.zig").WebWorker;
+pub const ImportWatcher = union(enum) {
+ none: void,
+ hot: *HotReloader.Watcher,
+ watch: *WatchReloader.Watcher,
+
+ pub fn start(this: ImportWatcher) !void {
+ switch (this) {
+ inline .hot => |watcher| try watcher.start(),
+ inline .watch => |watcher| try watcher.start(),
+ else => {},
+ }
+ }
+
+ pub inline fn watchlist(this: ImportWatcher) Watcher.WatchListArray {
+ return switch (this) {
+ inline .hot, .watch => |wacher| wacher.watchlist,
+ else => .{},
+ };
+ }
+
+ pub inline fn indexOf(this: ImportWatcher, hash: Watcher.HashType) ?u32 {
+ return switch (this) {
+ inline .hot, .watch => |wacher| wacher.indexOf(hash),
+ else => null,
+ };
+ }
+
+ pub inline fn addFile(
+ this: ImportWatcher,
+ fd: StoredFileDescriptorType,
+ file_path: string,
+ hash: Watcher.HashType,
+ loader: options.Loader,
+ dir_fd: StoredFileDescriptorType,
+ package_json: ?*PackageJSON,
+ comptime copy_file_path: bool,
+ ) !void {
+ switch (this) {
+ inline .hot, .watch => |wacher| try wacher.addFile(fd, file_path, hash, loader, dir_fd, package_json, copy_file_path),
+ else => {},
+ }
+ }
+};
+
/// TODO: rename this to ScriptExecutionContext
/// This is the shared global state for a single JS instance execution
/// Today, Bun is one VM per thread, so the name "VirtualMachine" sort of makes sense
@@ -410,8 +472,7 @@ pub const VirtualMachine = struct {
allocator: std.mem.Allocator,
has_loaded_constructors: bool = false,
bundler: Bundler,
- bun_dev_watcher: ?*http.Watcher = null,
- bun_watcher: ?*JSC.Watcher = null,
+ bun_watcher: ImportWatcher = .{ .none = {} },
console: *ZigConsoleClient,
log: *logger.Log,
main: string = "",
@@ -980,6 +1041,8 @@ pub const VirtualMachine = struct {
pub const MacroMap = std.AutoArrayHashMap(i32, js.JSObjectRef);
pub fn enableMacroMode(this: *VirtualMachine) void {
+ JSC.markBinding(@src());
+
if (!this.has_enabled_macro_mode) {
this.has_enabled_macro_mode = true;
this.macro_event_loop.tasks = EventLoop.Queue.init(default_allocator);
@@ -1006,7 +1069,7 @@ pub const VirtualMachine = struct {
}
pub fn isWatcherEnabled(this: *VirtualMachine) bool {
- return this.bun_dev_watcher != null or this.bun_watcher != null;
+ return this.bun_watcher != .none;
}
/// Instead of storing timestamp as a i128, we store it as a u64.
@@ -1033,6 +1096,7 @@ pub const VirtualMachine = struct {
pub fn initWithModuleGraph(
opts: Options,
) !*VirtualMachine {
+ JSC.markBinding(@src());
const allocator = opts.allocator;
VMHolder.vm = try allocator.create(VirtualMachine);
var console = try allocator.create(ZigConsoleClient);
@@ -1129,6 +1193,7 @@ pub const VirtualMachine = struct {
};
pub fn init(opts: Options) !*VirtualMachine {
+ JSC.markBinding(@src());
const allocator = opts.allocator;
var log: *logger.Log = undefined;
if (opts.log) |__log| {
@@ -1258,6 +1323,7 @@ pub const VirtualMachine = struct {
worker: *WebWorker,
opts: Options,
) anyerror!*VirtualMachine {
+ JSC.markBinding(@src());
var log: *logger.Log = undefined;
const allocator = opts.allocator;
if (opts.log) |__log| {
@@ -1372,6 +1438,7 @@ pub const VirtualMachine = struct {
pub fn refCountedStringWithWasNew(this: *VirtualMachine, new: *bool, input_: []const u8, hash_: ?u32, comptime dupe: bool) *JSC.RefString {
JSC.markBinding(@src());
+ std.debug.assert(input_.len > 0);
const hash = hash_ orelse JSC.RefString.computeHash(input_);
this.ref_strings_mutex.lock();
defer this.ref_strings_mutex.unlock();
@@ -1400,6 +1467,7 @@ pub const VirtualMachine = struct {
}
pub fn refCountedString(this: *VirtualMachine, input_: []const u8, hash_: ?u32, comptime dupe: bool) *JSC.RefString {
+ std.debug.assert(input_.len > 0);
var _was_new = false;
return this.refCountedStringWithWasNew(&_was_new, input_, hash_, comptime dupe);
}
@@ -1476,7 +1544,6 @@ pub const VirtualMachine = struct {
fn normalizeSpecifierForResolution(specifier_: []const u8, query_string: *[]const u8) []const u8 {
var specifier = specifier_;
- if (strings.hasPrefixComptime(specifier, "file://")) specifier = specifier["file://".len..];
if (strings.indexOfChar(specifier, '?')) |i| {
query_string.* = specifier[i..];
@@ -1673,7 +1740,7 @@ pub const VirtualMachine = struct {
printed,
),
};
- res.* = ErrorableString.err(error.NameTooLong, ResolveMessage.create(global, VirtualMachine.get().allocator, msg, source.utf8()).asVoid());
+ res.* = ErrorableString.err(error.NameTooLong, ResolveMessage.create(global, VirtualMachine.get().allocator, msg, source_utf8.slice()).asVoid());
return;
}
@@ -1987,7 +2054,7 @@ pub const VirtualMachine = struct {
try this.entry_point.generate(
this.allocator,
- this.bun_watcher != null,
+ this.bun_watcher != .none,
Fs.PathName.init(entry_path),
main_file_name,
);
@@ -2044,7 +2111,7 @@ pub const VirtualMachine = struct {
defer JSValue.fromCell(promise).unprotect();
// pending_internal_promise can change if hot module reloading is enabled
- if (this.bun_watcher != null) {
+ if (this.isWatcherEnabled()) {
this.eventLoop().performGC();
switch (this.pending_internal_promise.status(this.global.vm())) {
JSC.JSPromise.Status.Pending => {
@@ -2099,7 +2166,7 @@ pub const VirtualMachine = struct {
var promise = try this.reloadEntryPoint(entry_path);
// pending_internal_promise can change if hot module reloading is enabled
- if (this.bun_watcher != null) {
+ if (this.isWatcherEnabled()) {
this.eventLoop().performGC();
switch (this.pending_internal_promise.status(this.global.vm())) {
JSC.JSPromise.Status.Pending => {
@@ -2125,6 +2192,21 @@ pub const VirtualMachine = struct {
return this.pending_internal_promise;
}
+ pub fn addListeningSocketForWatchMode(this: *VirtualMachine, socket: bun.FileDescriptor) void {
+ if (this.hot_reload != .watch) {
+ return;
+ }
+
+ this.rareData().addListeningSocketForWatchMode(socket);
+ }
+ pub fn removeListeningSocketForWatchMode(this: *VirtualMachine, socket: bun.FileDescriptor) void {
+ if (this.hot_reload != .watch) {
+ return;
+ }
+
+ this.rareData().removeListeningSocketForWatchMode(socket);
+ }
+
pub fn loadMacroEntryPoint(this: *VirtualMachine, entry_path: string, function_name: string, specifier: string, hash: i32) !*JSInternalPromise {
var entry_point_entry = try this.macro_entry_points.getOrPut(hash);
@@ -2742,9 +2824,8 @@ pub const VirtualMachine = struct {
pub const IPCInstance = struct {
globalThis: ?*JSGlobalObject,
- socket: IPC.Socket,
uws_context: *uws.SocketContext,
- ipc_buffer: bun.ByteList,
+ ipc: IPC.IPCData,
pub fn handleIPCMessage(
this: *IPCInstance,
@@ -2794,13 +2875,13 @@ pub const VirtualMachine = struct {
var instance = bun.default_allocator.create(IPCInstance) catch @panic("OOM");
instance.* = .{
.globalThis = this.global,
- .socket = socket,
.uws_context = context,
- .ipc_buffer = bun.ByteList{},
+ .ipc = .{ .socket = socket },
};
var ptr = socket.ext(*IPCInstance);
ptr.?.* = instance;
this.ipc = instance;
+ instance.ipc.writeVersionPacket();
}
comptime {
if (!JSC.is_bindgen)
@@ -2809,6 +2890,7 @@ pub const VirtualMachine = struct {
};
pub const HotReloader = NewHotReloader(VirtualMachine, JSC.EventLoop, false);
+pub const WatchReloader = NewHotReloader(VirtualMachine, JSC.EventLoop, true);
pub const Watcher = HotReloader.Watcher;
extern fn BunDebugger__willHotReload() void;
@@ -2835,6 +2917,8 @@ pub fn NewHotReloader(comptime Ctx: type, comptime EventLoopType: type, comptime
this.eventLoop().enqueueTaskConcurrent(task);
}
+ pub var clear_screen = false;
+
pub const HotReloadTask = struct {
reloader: *Reloader,
count: u8 = 0,
@@ -2860,11 +2944,16 @@ pub fn NewHotReloader(comptime Ctx: type, comptime EventLoopType: type, comptime
}
pub fn enqueue(this: *HotReloadTask) void {
+ JSC.markBinding(@src());
if (this.count == 0)
return;
if (comptime reload_immediately) {
- bun.reloadProcess(bun.default_allocator, Output.enable_ansi_colors);
+ Output.flush();
+ if (comptime Ctx == ImportWatcher) {
+ this.reloader.ctx.rareData().closeAllListenSocketsForWatchMode();
+ }
+ bun.reloadProcess(bun.default_allocator, clear_screen);
unreachable;
}
@@ -2898,23 +2987,51 @@ pub fn NewHotReloader(comptime Ctx: type, comptime EventLoopType: type, comptime
) void);
pub fn enableHotModuleReloading(this: *Ctx) void {
- if (this.bun_watcher != null)
- return;
+ if (comptime @TypeOf(this.bun_watcher) == ImportWatcher) {
+ if (this.bun_watcher != .none)
+ return;
+ } else {
+ if (this.bun_watcher != null)
+ return;
+ }
var reloader = bun.default_allocator.create(Reloader) catch @panic("OOM");
reloader.* = .{
.ctx = this,
.verbose = if (@hasField(Ctx, "log")) this.log.level.atLeast(.info) else false,
};
- this.bun_watcher = @This().Watcher.init(
- reloader,
- this.bundler.fs,
- bun.default_allocator,
- ) catch @panic("Failed to enable File Watcher");
- this.bundler.resolver.watcher = Resolver.ResolveWatcher(*@This().Watcher, onMaybeWatchDirectory).init(this.bun_watcher.?);
+ if (comptime @TypeOf(this.bun_watcher) == ImportWatcher) {
+ this.bun_watcher = if (reload_immediately)
+ .{ .watch = @This().Watcher.init(
+ reloader,
+ this.bundler.fs,
+ bun.default_allocator,
+ ) catch @panic("Failed to enable File Watcher") }
+ else
+ .{ .hot = @This().Watcher.init(
+ reloader,
+ this.bundler.fs,
+ bun.default_allocator,
+ ) catch @panic("Failed to enable File Watcher") };
+
+ if (reload_immediately) {
+ this.bundler.resolver.watcher = Resolver.ResolveWatcher(*@This().Watcher, onMaybeWatchDirectory).init(this.bun_watcher.watch);
+ } else {
+ this.bundler.resolver.watcher = Resolver.ResolveWatcher(*@This().Watcher, onMaybeWatchDirectory).init(this.bun_watcher.hot);
+ }
+ } else {
+ this.bun_watcher = @This().Watcher.init(
+ reloader,
+ this.bundler.fs,
+ bun.default_allocator,
+ ) catch @panic("Failed to enable File Watcher");
+ this.bundler.resolver.watcher = Resolver.ResolveWatcher(*@This().Watcher, onMaybeWatchDirectory).init(this.bun_watcher.?);
+ }
+
+ clear_screen = Output.enable_ansi_colors and !strings.eqlComptime(this.bundler.env.map.get("BUN_CONFIG_NO_CLEAR_TERMINAL_ON_RELOAD") orelse "0", "true");
- this.bun_watcher.?.start() catch @panic("Failed to start File Watcher");
+ reloader.getContext().start() catch @panic("Failed to start File Watcher");
}
pub fn onMaybeWatchDirectory(watch: *@This().Watcher, file_path: string, dir_fd: StoredFileDescriptorType) void {
@@ -2941,6 +3058,18 @@ pub fn NewHotReloader(comptime Ctx: type, comptime EventLoopType: type, comptime
Output.prettyErrorln("<r>Watcher crashed: <red><b>{s}<r>", .{@errorName(err)});
}
+ pub fn getContext(this: *@This()) *@This().Watcher {
+ if (comptime @TypeOf(this.ctx.bun_watcher) == ImportWatcher) {
+ if (reload_immediately) {
+ return this.ctx.bun_watcher.watch;
+ } else {
+ return this.ctx.bun_watcher.hot;
+ }
+ } else {
+ return this.ctx.bun_watcher.?;
+ }
+ }
+
pub fn onFileUpdate(
this: *@This(),
events: []watcher.WatchEvent,
@@ -2954,7 +3083,7 @@ pub fn NewHotReloader(comptime Ctx: type, comptime EventLoopType: type, comptime
const hashes = slice.items(.hash);
const parents = slice.items(.parent_hash);
var file_descriptors = slice.items(.fd);
- var ctx = this.ctx.bun_watcher.?;
+ var ctx = this.getContext();
defer ctx.flushEvictions();
defer Output.flush();
diff --git a/src/bun.js/module_loader.zig b/src/bun.js/module_loader.zig
index cf86cb460..9a46d403b 100644
--- a/src/bun.js/module_loader.zig
+++ b/src/bun.js/module_loader.zig
@@ -154,21 +154,26 @@ const BunDebugHolder = struct {
pub var lock: bun.Lock = undefined;
};
-fn dumpSource(specifier: string, printer: anytype) !void {
+/// Dumps the module source to a file in /tmp/bun-debug-src/{filepath}
+///
+/// This can technically fail if concurrent access across processes happens, or permission issues.
+/// Errors here should always be ignored.
+fn dumpSource(specifier: string, printer: anytype) void {
if (BunDebugHolder.dir == null) {
- BunDebugHolder.dir = try std.fs.cwd().makeOpenPathIterable("/tmp/bun-debug-src/", .{});
+ BunDebugHolder.dir = std.fs.cwd().makeOpenPathIterable("/tmp/bun-debug-src/", .{}) catch return;
BunDebugHolder.lock = bun.Lock.init();
}
BunDebugHolder.lock.lock();
defer BunDebugHolder.lock.unlock();
+ const dir = BunDebugHolder.dir orelse return;
if (std.fs.path.dirname(specifier)) |dir_path| {
- var parent = try BunDebugHolder.dir.?.dir.makeOpenPathIterable(dir_path[1..], .{});
+ var parent = dir.dir.makeOpenPathIterable(dir_path[1..], .{}) catch return;
defer parent.close();
- try parent.dir.writeFile(std.fs.path.basename(specifier), printer.ctx.getWritten());
+ parent.dir.writeFile(std.fs.path.basename(specifier), printer.ctx.getWritten()) catch return;
} else {
- try BunDebugHolder.dir.?.dir.writeFile(std.fs.path.basename(specifier), printer.ctx.getWritten());
+ dir.dir.writeFile(std.fs.path.basename(specifier), printer.ctx.getWritten()) catch return;
}
}
@@ -363,18 +368,15 @@ pub const RuntimeTranspilerStore = struct {
var package_json: ?*PackageJSON = null;
const hash = JSC.Watcher.getHash(path.text);
- if (vm.bun_dev_watcher) |watcher| {
- if (watcher.indexOf(hash)) |index| {
- const _fd = watcher.watchlist.items(.fd)[index];
- fd = if (_fd > 0) _fd else null;
- package_json = watcher.watchlist.items(.package_json)[index];
- }
- } else if (vm.bun_watcher) |watcher| {
- if (watcher.indexOf(hash)) |index| {
- const _fd = watcher.watchlist.items(.fd)[index];
- fd = if (_fd > 0) _fd else null;
- package_json = watcher.watchlist.items(.package_json)[index];
- }
+ switch (vm.bun_watcher) {
+ .hot, .watch => {
+ if (vm.bun_watcher.indexOf(hash)) |index| {
+ const _fd = vm.bun_watcher.watchlist().items(.fd)[index];
+ fd = if (_fd > 0) _fd else null;
+ package_json = vm.bun_watcher.watchlist().items(.package_json)[index];
+ }
+ },
+ else => {},
}
// this should be a cheap lookup because 24 bytes == 8 * 3 so it's read 3 machine words
@@ -405,6 +407,7 @@ pub const RuntimeTranspilerStore = struct {
.file_hash = hash,
.macro_remappings = macro_remappings,
.jsx = bundler.options.jsx,
+ .emit_decorator_metadata = bundler.options.emit_decorator_metadata,
.virtual_source = null,
.dont_bundle_twice = true,
.allow_commonjs = true,
@@ -438,9 +441,9 @@ pub const RuntimeTranspilerStore = struct {
) orelse {
if (vm.isWatcherEnabled()) {
if (input_file_fd != 0) {
- if (vm.bun_watcher != null and !is_node_override and std.fs.path.isAbsolute(path.text) and !strings.contains(path.text, "node_modules")) {
+ if (!is_node_override and std.fs.path.isAbsolute(path.text) and !strings.contains(path.text, "node_modules")) {
should_close_input_file_fd = false;
- vm.bun_watcher.?.addFile(
+ vm.bun_watcher.addFile(
input_file_fd,
path.text,
hash,
@@ -459,11 +462,11 @@ pub const RuntimeTranspilerStore = struct {
if (vm.isWatcherEnabled()) {
if (input_file_fd != 0) {
- if (vm.bun_watcher != null and !is_node_override and
+ if (!is_node_override and
std.fs.path.isAbsolute(path.text) and !strings.contains(path.text, "node_modules"))
{
should_close_input_file_fd = false;
- vm.bun_watcher.?.addFile(
+ vm.bun_watcher.addFile(
input_file_fd,
path.text,
hash,
@@ -547,7 +550,7 @@ pub const RuntimeTranspilerStore = struct {
}
if (comptime Environment.dump_source) {
- dumpSource(specifier, &printer) catch {};
+ dumpSource(specifier, &printer);
}
this.resolved_source = ResolvedSource{
@@ -689,6 +692,7 @@ pub const ModuleLoader = struct {
.onPackageDownloadError = onPackageDownloadError,
.progress_bar = true,
},
+ true,
PackageManager.Options.LogLevel.default,
) catch unreachable;
} else {
@@ -701,6 +705,7 @@ pub const ModuleLoader = struct {
.onPackageManifestError = onPackageManifestError,
.onPackageDownloadError = onPackageDownloadError,
},
+ true,
PackageManager.Options.LogLevel.default_no_progress,
) catch unreachable;
}
@@ -1232,7 +1237,7 @@ pub const ModuleLoader = struct {
}
if (comptime Environment.dump_source) {
- try dumpSource(specifier, &printer);
+ dumpSource(specifier, &printer);
}
var commonjs_exports = try bun.default_allocator.alloc(ZigString, parse_result.ast.commonjs_export_names.len);
@@ -1244,8 +1249,8 @@ pub const ModuleLoader = struct {
var resolved_source = jsc_vm.refCountedResolvedSource(printer.ctx.written, bun.String.init(specifier), path.text, null, false);
if (parse_result.input_fd) |fd_| {
- if (jsc_vm.bun_watcher != null and std.fs.path.isAbsolute(path.text) and !strings.contains(path.text, "node_modules")) {
- jsc_vm.bun_watcher.?.addFile(
+ if (std.fs.path.isAbsolute(path.text) and !strings.contains(path.text, "node_modules")) {
+ jsc_vm.bun_watcher.addFile(
fd_,
path.text,
this.hash,
@@ -1379,18 +1384,10 @@ pub const ModuleLoader = struct {
var fd: ?StoredFileDescriptorType = null;
var package_json: ?*PackageJSON = null;
- if (jsc_vm.bun_dev_watcher) |watcher| {
- if (watcher.indexOf(hash)) |index| {
- const _fd = watcher.watchlist.items(.fd)[index];
- fd = if (_fd > 0) _fd else null;
- package_json = watcher.watchlist.items(.package_json)[index];
- }
- } else if (jsc_vm.bun_watcher) |watcher| {
- if (watcher.indexOf(hash)) |index| {
- const _fd = watcher.watchlist.items(.fd)[index];
- fd = if (_fd > 0) _fd else null;
- package_json = watcher.watchlist.items(.package_json)[index];
- }
+ if (jsc_vm.bun_watcher.indexOf(hash)) |index| {
+ const _fd = jsc_vm.bun_watcher.watchlist().items(.fd)[index];
+ fd = if (_fd > 0) _fd else null;
+ package_json = jsc_vm.bun_watcher.watchlist().items(.package_json)[index];
}
var old = jsc_vm.bundler.log;
@@ -1438,6 +1435,7 @@ pub const ModuleLoader = struct {
.file_hash = hash,
.macro_remappings = macro_remappings,
.jsx = jsc_vm.bundler.options.jsx,
+ .emit_decorator_metadata = jsc_vm.bundler.options.emit_decorator_metadata,
.virtual_source = virtual_source,
.dont_bundle_twice = true,
.allow_commonjs = true,
@@ -1470,9 +1468,9 @@ pub const ModuleLoader = struct {
if (comptime !disable_transpilying) {
if (jsc_vm.isWatcherEnabled()) {
if (input_file_fd != 0) {
- if (jsc_vm.bun_watcher != null and !is_node_override and std.fs.path.isAbsolute(path.text) and !strings.contains(path.text, "node_modules")) {
+ if (!is_node_override and std.fs.path.isAbsolute(path.text) and !strings.contains(path.text, "node_modules")) {
should_close_input_file_fd = false;
- jsc_vm.bun_watcher.?.addFile(
+ jsc_vm.bun_watcher.addFile(
input_file_fd,
path.text,
hash,
@@ -1513,9 +1511,9 @@ pub const ModuleLoader = struct {
if (comptime !disable_transpilying) {
if (jsc_vm.isWatcherEnabled()) {
if (input_file_fd != 0) {
- if (jsc_vm.bun_watcher != null and !is_node_override and std.fs.path.isAbsolute(path.text) and !strings.contains(path.text, "node_modules")) {
+ if (!is_node_override and std.fs.path.isAbsolute(path.text) and !strings.contains(path.text, "node_modules")) {
should_close_input_file_fd = false;
- jsc_vm.bun_watcher.?.addFile(
+ jsc_vm.bun_watcher.addFile(
input_file_fd,
path.text,
hash,
@@ -1635,7 +1633,7 @@ pub const ModuleLoader = struct {
};
if (comptime Environment.dump_source) {
- try dumpSource(specifier, &printer);
+ dumpSource(specifier, &printer);
}
var commonjs_exports = try bun.default_allocator.alloc(ZigString, parse_result.ast.commonjs_export_names.len);
@@ -1715,7 +1713,7 @@ pub const ModuleLoader = struct {
// const hash = http.Watcher.getHash(path.text);
// if (jsc_vm.watcher) |watcher| {
// if (watcher.indexOf(hash)) |index| {
- // const _fd = watcher.watchlist.items(.fd)[index];
+ // const _fd = watcher.watchlist().items(.fd)[index];
// fd = if (_fd > 0) _fd else null;
// }
// }
@@ -1946,14 +1944,21 @@ pub const ModuleLoader = struct {
}
}
- const synchronous_loader = loader orelse
- // Unknown extensions are to be treated as file loader
- if (jsc_vm.has_loaded or jsc_vm.is_in_preload)
- options.Loader.file
- else
- // Unless it's potentially the main module
- // This is important so that "bun run ./foo-i-have-no-extension" works
- options.Loader.js;
+ const synchronous_loader = loader orelse loader: {
+ if (jsc_vm.has_loaded or jsc_vm.is_in_preload) {
+ // Extensionless files in this context are treated as the JS loader
+ if (path.name.ext.len == 0) {
+ break :loader options.Loader.tsx;
+ }
+
+ // Unknown extensions are to be treated as file loader
+ break :loader options.Loader.file;
+ } else {
+ // Unless it's potentially the main module
+ // This is important so that "bun run ./foo-i-have-no-extension" works
+ break :loader options.Loader.tsx;
+ }
+ };
var promise: ?*JSC.JSInternalPromise = null;
ret.* = ErrorableResolvedSource.ok(
@@ -1981,6 +1986,7 @@ pub const ModuleLoader = struct {
if (err == error.PluginError) {
return null;
}
+
VirtualMachine.processFetchLog(globalObject, specifier_ptr.*, referrer.*, &log, ret, err);
return null;
},
@@ -2152,7 +2158,7 @@ pub const ModuleLoader = struct {
const path = Fs.Path.init(specifier);
const loader = if (loader_ != ._none)
- options.Loader.fromString(@tagName(loader_)).?
+ options.Loader.fromAPI(loader_)
else
jsc_vm.bundler.options.loaders.get(path.name.ext) orelse brk: {
if (strings.eqlLong(specifier, jsc_vm.main, true)) {
@@ -2171,7 +2177,7 @@ pub const ModuleLoader = struct {
referrer_slice.slice(),
specifier_ptr.*,
path,
- options.Loader.fromString(@tagName(loader)).?,
+ loader,
&log,
&virtual_source,
ret,
diff --git a/src/bun.js/modules/BunJSCModule.h b/src/bun.js/modules/BunJSCModule.h
index 73823e16e..74e745bad 100644
--- a/src/bun.js/modules/BunJSCModule.h
+++ b/src/bun.js/modules/BunJSCModule.h
@@ -238,7 +238,7 @@ JSC_DEFINE_HOST_FUNCTION(functionCreateMemoryFootprint,
&peak_rss, &current_commit, &peak_commit, &page_faults);
// mi_process_info produces incorrect rss size on linux.
- Zig::getRSS(&current_rss);
+ Bun::getRSS(&current_rss);
VM &vm = globalObject->vm();
JSC::JSObject *object = JSC::constructEmptyObject(
@@ -746,7 +746,7 @@ JSC_DEFINE_HOST_FUNCTION(functionCodeCoverageForFile,
namespace Zig {
DEFINE_NATIVE_MODULE(BunJSC)
{
- INIT_NATIVE_MODULE(33);
+ INIT_NATIVE_MODULE(34);
putNativeFn(Identifier::fromString(vm, "callerSourceOrigin"_s), functionCallerSourceOrigin);
putNativeFn(Identifier::fromString(vm, "jscDescribe"_s), functionDescribe);
diff --git a/src/bun.js/modules/NodeConstantsModule.h b/src/bun.js/modules/NodeConstantsModule.h
index c1e324b0a..ce701f5e3 100644
--- a/src/bun.js/modules/NodeConstantsModule.h
+++ b/src/bun.js/modules/NodeConstantsModule.h
@@ -1,6 +1,8 @@
#include "_NativeModule.h"
-// Modelled off of https://github.com/nodejs/node/blob/main/src/node_constants.cc
-// Note that if you change any of this code, you probably also have to change ProcessBindingConstants.cpp
+// Modelled off of
+// https://github.com/nodejs/node/blob/main/src/node_constants.cc Note that if
+// you change any of this code, you probably also have to change
+// ProcessBindingConstants.cpp
// require('constants') is implemented in node as a spread of:
// - constants.os.dlopen
@@ -12,16 +14,17 @@
// Instead of loading $processBindingConstants, we just inline it
// These headers may not all be needed, but they are the ones node references.
-// Most of the constants are defined with #if checks on existing #defines, instead of platform-checks
-#include <openssl/ec.h>
-#include <openssl/ssl.h>
-#include <zlib.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+// Most of the constants are defined with #if checks on existing #defines,
+// instead of platform-checks
#include <cerrno>
#include <csignal>
+#include <fcntl.h>
#include <limits>
+#include <openssl/ec.h>
+#include <openssl/ssl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <zlib.h>
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
@@ -47,870 +50,940 @@ namespace Zig {
using namespace WebCore;
DEFINE_NATIVE_MODULE(NodeConstants) {
- INIT_NATIVE_MODULE(63);
+ INIT_NATIVE_MODULE(0);
#ifdef RTLD_LAZY
- put(Identifier::fromString(vm, "RTLD_LAZY"_s), jsNumber(RTLD_LAZY));
+ put(Identifier::fromString(vm, "RTLD_LAZY"_s), jsNumber(RTLD_LAZY));
#endif
#ifdef RTLD_NOW
- put(Identifier::fromString(vm, "RTLD_NOW"_s), jsNumber(RTLD_NOW));
+ put(Identifier::fromString(vm, "RTLD_NOW"_s), jsNumber(RTLD_NOW));
#endif
#ifdef RTLD_GLOBAL
- put(Identifier::fromString(vm, "RTLD_GLOBAL"_s), jsNumber(RTLD_GLOBAL));
+ put(Identifier::fromString(vm, "RTLD_GLOBAL"_s), jsNumber(RTLD_GLOBAL));
#endif
#ifdef RTLD_LOCAL
- put(Identifier::fromString(vm, "RTLD_LOCAL"_s), jsNumber(RTLD_LOCAL));
+ put(Identifier::fromString(vm, "RTLD_LOCAL"_s), jsNumber(RTLD_LOCAL));
#endif
#ifdef RTLD_DEEPBIND
- put(Identifier::fromString(vm, "RTLD_DEEPBIND"_s), jsNumber(RTLD_DEEPBIND));
+ put(Identifier::fromString(vm, "RTLD_DEEPBIND"_s), jsNumber(RTLD_DEEPBIND));
#endif
#ifdef E2BIG
- put(Identifier::fromString(vm, "E2BIG"_s), jsNumber(E2BIG));
+ put(Identifier::fromString(vm, "E2BIG"_s), jsNumber(E2BIG));
#endif
#ifdef EACCES
- put(Identifier::fromString(vm, "EACCES"_s), jsNumber(EACCES));
+ put(Identifier::fromString(vm, "EACCES"_s), jsNumber(EACCES));
#endif
#ifdef EADDRINUSE
- put(Identifier::fromString(vm, "EADDRINUSE"_s), jsNumber(EADDRINUSE));
+ put(Identifier::fromString(vm, "EADDRINUSE"_s), jsNumber(EADDRINUSE));
#endif
#ifdef EADDRNOTAVAIL
- put(Identifier::fromString(vm, "EADDRNOTAVAIL"_s), jsNumber(EADDRNOTAVAIL));
+ put(Identifier::fromString(vm, "EADDRNOTAVAIL"_s), jsNumber(EADDRNOTAVAIL));
#endif
#ifdef EAFNOSUPPORT
- put(Identifier::fromString(vm, "EAFNOSUPPORT"_s), jsNumber(EAFNOSUPPORT));
+ put(Identifier::fromString(vm, "EAFNOSUPPORT"_s), jsNumber(EAFNOSUPPORT));
#endif
#ifdef EAGAIN
- put(Identifier::fromString(vm, "EAGAIN"_s), jsNumber(EAGAIN));
+ put(Identifier::fromString(vm, "EAGAIN"_s), jsNumber(EAGAIN));
#endif
#ifdef EALREADY
- put(Identifier::fromString(vm, "EALREADY"_s), jsNumber(EALREADY));
+ put(Identifier::fromString(vm, "EALREADY"_s), jsNumber(EALREADY));
#endif
#ifdef EBADF
- put(Identifier::fromString(vm, "EBADF"_s), jsNumber(EBADF));
+ put(Identifier::fromString(vm, "EBADF"_s), jsNumber(EBADF));
#endif
#ifdef EBADMSG
- put(Identifier::fromString(vm, "EBADMSG"_s), jsNumber(EBADMSG));
+ put(Identifier::fromString(vm, "EBADMSG"_s), jsNumber(EBADMSG));
#endif
#ifdef EBUSY
- put(Identifier::fromString(vm, "EBUSY"_s), jsNumber(EBUSY));
+ put(Identifier::fromString(vm, "EBUSY"_s), jsNumber(EBUSY));
#endif
#ifdef ECANCELED
- put(Identifier::fromString(vm, "ECANCELED"_s), jsNumber(ECANCELED));
+ put(Identifier::fromString(vm, "ECANCELED"_s), jsNumber(ECANCELED));
#endif
#ifdef ECHILD
- put(Identifier::fromString(vm, "ECHILD"_s), jsNumber(ECHILD));
+ put(Identifier::fromString(vm, "ECHILD"_s), jsNumber(ECHILD));
#endif
#ifdef ECONNABORTED
- put(Identifier::fromString(vm, "ECONNABORTED"_s), jsNumber(ECONNABORTED));
+ put(Identifier::fromString(vm, "ECONNABORTED"_s), jsNumber(ECONNABORTED));
#endif
#ifdef ECONNREFUSED
- put(Identifier::fromString(vm, "ECONNREFUSED"_s), jsNumber(ECONNREFUSED));
+ put(Identifier::fromString(vm, "ECONNREFUSED"_s), jsNumber(ECONNREFUSED));
#endif
#ifdef ECONNRESET
- put(Identifier::fromString(vm, "ECONNRESET"_s), jsNumber(ECONNRESET));
+ put(Identifier::fromString(vm, "ECONNRESET"_s), jsNumber(ECONNRESET));
#endif
#ifdef EDEADLK
- put(Identifier::fromString(vm, "EDEADLK"_s), jsNumber(EDEADLK));
+ put(Identifier::fromString(vm, "EDEADLK"_s), jsNumber(EDEADLK));
#endif
#ifdef EDESTADDRREQ
- put(Identifier::fromString(vm, "EDESTADDRREQ"_s), jsNumber(EDESTADDRREQ));
+ put(Identifier::fromString(vm, "EDESTADDRREQ"_s), jsNumber(EDESTADDRREQ));
#endif
#ifdef EDOM
- put(Identifier::fromString(vm, "EDOM"_s), jsNumber(EDOM));
+ put(Identifier::fromString(vm, "EDOM"_s), jsNumber(EDOM));
#endif
#ifdef EDQUOT
- put(Identifier::fromString(vm, "EDQUOT"_s), jsNumber(EDQUOT));
+ put(Identifier::fromString(vm, "EDQUOT"_s), jsNumber(EDQUOT));
#endif
#ifdef EEXIST
- put(Identifier::fromString(vm, "EEXIST"_s), jsNumber(EEXIST));
+ put(Identifier::fromString(vm, "EEXIST"_s), jsNumber(EEXIST));
#endif
#ifdef EFAULT
- put(Identifier::fromString(vm, "EFAULT"_s), jsNumber(EFAULT));
+ put(Identifier::fromString(vm, "EFAULT"_s), jsNumber(EFAULT));
#endif
#ifdef EFBIG
- put(Identifier::fromString(vm, "EFBIG"_s), jsNumber(EFBIG));
+ put(Identifier::fromString(vm, "EFBIG"_s), jsNumber(EFBIG));
#endif
#ifdef EHOSTUNREACH
- put(Identifier::fromString(vm, "EHOSTUNREACH"_s), jsNumber(EHOSTUNREACH));
+ put(Identifier::fromString(vm, "EHOSTUNREACH"_s), jsNumber(EHOSTUNREACH));
#endif
#ifdef EIDRM
- put(Identifier::fromString(vm, "EIDRM"_s), jsNumber(EIDRM));
+ put(Identifier::fromString(vm, "EIDRM"_s), jsNumber(EIDRM));
#endif
#ifdef EILSEQ
- put(Identifier::fromString(vm, "EILSEQ"_s), jsNumber(EILSEQ));
+ put(Identifier::fromString(vm, "EILSEQ"_s), jsNumber(EILSEQ));
#endif
#ifdef EINPROGRESS
- put(Identifier::fromString(vm, "EINPROGRESS"_s), jsNumber(EINPROGRESS));
+ put(Identifier::fromString(vm, "EINPROGRESS"_s), jsNumber(EINPROGRESS));
#endif
#ifdef EINTR
- put(Identifier::fromString(vm, "EINTR"_s), jsNumber(EINTR));
+ put(Identifier::fromString(vm, "EINTR"_s), jsNumber(EINTR));
#endif
#ifdef EINVAL
- put(Identifier::fromString(vm, "EINVAL"_s), jsNumber(EINVAL));
+ put(Identifier::fromString(vm, "EINVAL"_s), jsNumber(EINVAL));
#endif
#ifdef EIO
- put(Identifier::fromString(vm, "EIO"_s), jsNumber(EIO));
+ put(Identifier::fromString(vm, "EIO"_s), jsNumber(EIO));
#endif
#ifdef EISCONN
- put(Identifier::fromString(vm, "EISCONN"_s), jsNumber(EISCONN));
+ put(Identifier::fromString(vm, "EISCONN"_s), jsNumber(EISCONN));
#endif
#ifdef EISDIR
- put(Identifier::fromString(vm, "EISDIR"_s), jsNumber(EISDIR));
+ put(Identifier::fromString(vm, "EISDIR"_s), jsNumber(EISDIR));
#endif
#ifdef ELOOP
- put(Identifier::fromString(vm, "ELOOP"_s), jsNumber(ELOOP));
+ put(Identifier::fromString(vm, "ELOOP"_s), jsNumber(ELOOP));
#endif
#ifdef EMFILE
- put(Identifier::fromString(vm, "EMFILE"_s), jsNumber(EMFILE));
+ put(Identifier::fromString(vm, "EMFILE"_s), jsNumber(EMFILE));
#endif
#ifdef EMLINK
- put(Identifier::fromString(vm, "EMLINK"_s), jsNumber(EMLINK));
+ put(Identifier::fromString(vm, "EMLINK"_s), jsNumber(EMLINK));
#endif
#ifdef EMSGSIZE
- put(Identifier::fromString(vm, "EMSGSIZE"_s), jsNumber(EMSGSIZE));
+ put(Identifier::fromString(vm, "EMSGSIZE"_s), jsNumber(EMSGSIZE));
#endif
#ifdef EMULTIHOP
- put(Identifier::fromString(vm, "EMULTIHOP"_s), jsNumber(EMULTIHOP));
+ put(Identifier::fromString(vm, "EMULTIHOP"_s), jsNumber(EMULTIHOP));
#endif
#ifdef ENAMETOOLONG
- put(Identifier::fromString(vm, "ENAMETOOLONG"_s), jsNumber(ENAMETOOLONG));
+ put(Identifier::fromString(vm, "ENAMETOOLONG"_s), jsNumber(ENAMETOOLONG));
#endif
#ifdef ENETDOWN
- put(Identifier::fromString(vm, "ENETDOWN"_s), jsNumber(ENETDOWN));
+ put(Identifier::fromString(vm, "ENETDOWN"_s), jsNumber(ENETDOWN));
#endif
#ifdef ENETRESET
- put(Identifier::fromString(vm, "ENETRESET"_s), jsNumber(ENETRESET));
+ put(Identifier::fromString(vm, "ENETRESET"_s), jsNumber(ENETRESET));
#endif
#ifdef ENETUNREACH
- put(Identifier::fromString(vm, "ENETUNREACH"_s), jsNumber(ENETUNREACH));
+ put(Identifier::fromString(vm, "ENETUNREACH"_s), jsNumber(ENETUNREACH));
#endif
#ifdef ENFILE
- put(Identifier::fromString(vm, "ENFILE"_s), jsNumber(ENFILE));
+ put(Identifier::fromString(vm, "ENFILE"_s), jsNumber(ENFILE));
#endif
#ifdef ENOBUFS
- put(Identifier::fromString(vm, "ENOBUFS"_s), jsNumber(ENOBUFS));
+ put(Identifier::fromString(vm, "ENOBUFS"_s), jsNumber(ENOBUFS));
#endif
#ifdef ENODATA
- put(Identifier::fromString(vm, "ENODATA"_s), jsNumber(ENODATA));
+ put(Identifier::fromString(vm, "ENODATA"_s), jsNumber(ENODATA));
#endif
#ifdef ENODEV
- put(Identifier::fromString(vm, "ENODEV"_s), jsNumber(ENODEV));
+ put(Identifier::fromString(vm, "ENODEV"_s), jsNumber(ENODEV));
#endif
#ifdef ENOENT
- put(Identifier::fromString(vm, "ENOENT"_s), jsNumber(ENOENT));
+ put(Identifier::fromString(vm, "ENOENT"_s), jsNumber(ENOENT));
#endif
#ifdef ENOEXEC
- put(Identifier::fromString(vm, "ENOEXEC"_s), jsNumber(ENOEXEC));
+ put(Identifier::fromString(vm, "ENOEXEC"_s), jsNumber(ENOEXEC));
#endif
#ifdef ENOLCK
- put(Identifier::fromString(vm, "ENOLCK"_s), jsNumber(ENOLCK));
+ put(Identifier::fromString(vm, "ENOLCK"_s), jsNumber(ENOLCK));
#endif
#ifdef ENOLINK
- put(Identifier::fromString(vm, "ENOLINK"_s), jsNumber(ENOLINK));
+ put(Identifier::fromString(vm, "ENOLINK"_s), jsNumber(ENOLINK));
#endif
#ifdef ENOMEM
- put(Identifier::fromString(vm, "ENOMEM"_s), jsNumber(ENOMEM));
+ put(Identifier::fromString(vm, "ENOMEM"_s), jsNumber(ENOMEM));
#endif
#ifdef ENOMSG
- put(Identifier::fromString(vm, "ENOMSG"_s), jsNumber(ENOMSG));
+ put(Identifier::fromString(vm, "ENOMSG"_s), jsNumber(ENOMSG));
#endif
#ifdef ENOPROTOOPT
- put(Identifier::fromString(vm, "ENOPROTOOPT"_s), jsNumber(ENOPROTOOPT));
+ put(Identifier::fromString(vm, "ENOPROTOOPT"_s), jsNumber(ENOPROTOOPT));
#endif
#ifdef ENOSPC
- put(Identifier::fromString(vm, "ENOSPC"_s), jsNumber(ENOSPC));
+ put(Identifier::fromString(vm, "ENOSPC"_s), jsNumber(ENOSPC));
#endif
#ifdef ENOSR
- put(Identifier::fromString(vm, "ENOSR"_s), jsNumber(ENOSR));
+ put(Identifier::fromString(vm, "ENOSR"_s), jsNumber(ENOSR));
#endif
#ifdef ENOSTR
- put(Identifier::fromString(vm, "ENOSTR"_s), jsNumber(ENOSTR));
+ put(Identifier::fromString(vm, "ENOSTR"_s), jsNumber(ENOSTR));
#endif
#ifdef ENOSYS
- put(Identifier::fromString(vm, "ENOSYS"_s), jsNumber(ENOSYS));
+ put(Identifier::fromString(vm, "ENOSYS"_s), jsNumber(ENOSYS));
#endif
#ifdef ENOTCONN
- put(Identifier::fromString(vm, "ENOTCONN"_s), jsNumber(ENOTCONN));
+ put(Identifier::fromString(vm, "ENOTCONN"_s), jsNumber(ENOTCONN));
#endif
#ifdef ENOTDIR
- put(Identifier::fromString(vm, "ENOTDIR"_s), jsNumber(ENOTDIR));
+ put(Identifier::fromString(vm, "ENOTDIR"_s), jsNumber(ENOTDIR));
#endif
#ifdef ENOTEMPTY
- put(Identifier::fromString(vm, "ENOTEMPTY"_s), jsNumber(ENOTEMPTY));
+ put(Identifier::fromString(vm, "ENOTEMPTY"_s), jsNumber(ENOTEMPTY));
#endif
#ifdef ENOTSOCK
- put(Identifier::fromString(vm, "ENOTSOCK"_s), jsNumber(ENOTSOCK));
+ put(Identifier::fromString(vm, "ENOTSOCK"_s), jsNumber(ENOTSOCK));
#endif
#ifdef ENOTSUP
- put(Identifier::fromString(vm, "ENOTSUP"_s), jsNumber(ENOTSUP));
+ put(Identifier::fromString(vm, "ENOTSUP"_s), jsNumber(ENOTSUP));
#endif
#ifdef ENOTTY
- put(Identifier::fromString(vm, "ENOTTY"_s), jsNumber(ENOTTY));
+ put(Identifier::fromString(vm, "ENOTTY"_s), jsNumber(ENOTTY));
#endif
#ifdef ENXIO
- put(Identifier::fromString(vm, "ENXIO"_s), jsNumber(ENXIO));
+ put(Identifier::fromString(vm, "ENXIO"_s), jsNumber(ENXIO));
#endif
#ifdef EOPNOTSUPP
- put(Identifier::fromString(vm, "EOPNOTSUPP"_s), jsNumber(EOPNOTSUPP));
+ put(Identifier::fromString(vm, "EOPNOTSUPP"_s), jsNumber(EOPNOTSUPP));
#endif
#ifdef EOVERFLOW
- put(Identifier::fromString(vm, "EOVERFLOW"_s), jsNumber(EOVERFLOW));
+ put(Identifier::fromString(vm, "EOVERFLOW"_s), jsNumber(EOVERFLOW));
#endif
#ifdef EPERM
- put(Identifier::fromString(vm, "EPERM"_s), jsNumber(EPERM));
+ put(Identifier::fromString(vm, "EPERM"_s), jsNumber(EPERM));
#endif
#ifdef EPIPE
- put(Identifier::fromString(vm, "EPIPE"_s), jsNumber(EPIPE));
+ put(Identifier::fromString(vm, "EPIPE"_s), jsNumber(EPIPE));
#endif
#ifdef EPROTO
- put(Identifier::fromString(vm, "EPROTO"_s), jsNumber(EPROTO));
+ put(Identifier::fromString(vm, "EPROTO"_s), jsNumber(EPROTO));
#endif
#ifdef EPROTONOSUPPORT
- put(Identifier::fromString(vm, "EPROTONOSUPPORT"_s), jsNumber(EPROTONOSUPPORT));
+ put(Identifier::fromString(vm, "EPROTONOSUPPORT"_s),
+ jsNumber(EPROTONOSUPPORT));
#endif
#ifdef EPROTOTYPE
- put(Identifier::fromString(vm, "EPROTOTYPE"_s), jsNumber(EPROTOTYPE));
+ put(Identifier::fromString(vm, "EPROTOTYPE"_s), jsNumber(EPROTOTYPE));
#endif
#ifdef ERANGE
- put(Identifier::fromString(vm, "ERANGE"_s), jsNumber(ERANGE));
+ put(Identifier::fromString(vm, "ERANGE"_s), jsNumber(ERANGE));
#endif
#ifdef EROFS
- put(Identifier::fromString(vm, "EROFS"_s), jsNumber(EROFS));
+ put(Identifier::fromString(vm, "EROFS"_s), jsNumber(EROFS));
#endif
#ifdef ESPIPE
- put(Identifier::fromString(vm, "ESPIPE"_s), jsNumber(ESPIPE));
+ put(Identifier::fromString(vm, "ESPIPE"_s), jsNumber(ESPIPE));
#endif
#ifdef ESRCH
- put(Identifier::fromString(vm, "ESRCH"_s), jsNumber(ESRCH));
+ put(Identifier::fromString(vm, "ESRCH"_s), jsNumber(ESRCH));
#endif
#ifdef ESTALE
- put(Identifier::fromString(vm, "ESTALE"_s), jsNumber(ESTALE));
+ put(Identifier::fromString(vm, "ESTALE"_s), jsNumber(ESTALE));
#endif
#ifdef ETIME
- put(Identifier::fromString(vm, "ETIME"_s), jsNumber(ETIME));
+ put(Identifier::fromString(vm, "ETIME"_s), jsNumber(ETIME));
#endif
#ifdef ETIMEDOUT
- put(Identifier::fromString(vm, "ETIMEDOUT"_s), jsNumber(ETIMEDOUT));
+ put(Identifier::fromString(vm, "ETIMEDOUT"_s), jsNumber(ETIMEDOUT));
#endif
#ifdef ETXTBSY
- put(Identifier::fromString(vm, "ETXTBSY"_s), jsNumber(ETXTBSY));
+ put(Identifier::fromString(vm, "ETXTBSY"_s), jsNumber(ETXTBSY));
#endif
#ifdef EWOULDBLOCK
- put(Identifier::fromString(vm, "EWOULDBLOCK"_s), jsNumber(EWOULDBLOCK));
+ put(Identifier::fromString(vm, "EWOULDBLOCK"_s), jsNumber(EWOULDBLOCK));
#endif
#ifdef EXDEV
- put(Identifier::fromString(vm, "EXDEV"_s), jsNumber(EXDEV));
+ put(Identifier::fromString(vm, "EXDEV"_s), jsNumber(EXDEV));
#endif
#ifdef WSAEINTR
- put(Identifier::fromString(vm, "WSAEINTR"_s), jsNumber(WSAEINTR));
+ put(Identifier::fromString(vm, "WSAEINTR"_s), jsNumber(WSAEINTR));
#endif
#ifdef WSAEBADF
- put(Identifier::fromString(vm, "WSAEBADF"_s), jsNumber(WSAEBADF));
+ put(Identifier::fromString(vm, "WSAEBADF"_s), jsNumber(WSAEBADF));
#endif
#ifdef WSAEACCES
- put(Identifier::fromString(vm, "WSAEACCES"_s), jsNumber(WSAEACCES));
+ put(Identifier::fromString(vm, "WSAEACCES"_s), jsNumber(WSAEACCES));
#endif
#ifdef WSAEFAULT
- put(Identifier::fromString(vm, "WSAEFAULT"_s), jsNumber(WSAEFAULT));
+ put(Identifier::fromString(vm, "WSAEFAULT"_s), jsNumber(WSAEFAULT));
#endif
#ifdef WSAEINVAL
- put(Identifier::fromString(vm, "WSAEINVAL"_s), jsNumber(WSAEINVAL));
+ put(Identifier::fromString(vm, "WSAEINVAL"_s), jsNumber(WSAEINVAL));
#endif
#ifdef WSAEMFILE
- put(Identifier::fromString(vm, "WSAEMFILE"_s), jsNumber(WSAEMFILE));
+ put(Identifier::fromString(vm, "WSAEMFILE"_s), jsNumber(WSAEMFILE));
#endif
#ifdef WSAEWOULDBLOCK
- put(Identifier::fromString(vm, "WSAEWOULDBLOCK"_s), jsNumber(WSAEWOULDBLOCK));
+ put(Identifier::fromString(vm, "WSAEWOULDBLOCK"_s), jsNumber(WSAEWOULDBLOCK));
#endif
#ifdef WSAEINPROGRESS
- put(Identifier::fromString(vm, "WSAEINPROGRESS"_s), jsNumber(WSAEINPROGRESS));
+ put(Identifier::fromString(vm, "WSAEINPROGRESS"_s), jsNumber(WSAEINPROGRESS));
#endif
#ifdef WSAEALREADY
- put(Identifier::fromString(vm, "WSAEALREADY"_s), jsNumber(WSAEALREADY));
+ put(Identifier::fromString(vm, "WSAEALREADY"_s), jsNumber(WSAEALREADY));
#endif
#ifdef WSAENOTSOCK
- put(Identifier::fromString(vm, "WSAENOTSOCK"_s), jsNumber(WSAENOTSOCK));
+ put(Identifier::fromString(vm, "WSAENOTSOCK"_s), jsNumber(WSAENOTSOCK));
#endif
#ifdef WSAEDESTADDRREQ
- put(Identifier::fromString(vm, "WSAEDESTADDRREQ"_s), jsNumber(WSAEDESTADDRREQ));
+ put(Identifier::fromString(vm, "WSAEDESTADDRREQ"_s),
+ jsNumber(WSAEDESTADDRREQ));
#endif
#ifdef WSAEMSGSIZE
- put(Identifier::fromString(vm, "WSAEMSGSIZE"_s), jsNumber(WSAEMSGSIZE));
+ put(Identifier::fromString(vm, "WSAEMSGSIZE"_s), jsNumber(WSAEMSGSIZE));
#endif
#ifdef WSAEPROTOTYPE
- put(Identifier::fromString(vm, "WSAEPROTOTYPE"_s), jsNumber(WSAEPROTOTYPE));
+ put(Identifier::fromString(vm, "WSAEPROTOTYPE"_s), jsNumber(WSAEPROTOTYPE));
#endif
#ifdef WSAENOPROTOOPT
- put(Identifier::fromString(vm, "WSAENOPROTOOPT"_s), jsNumber(WSAENOPROTOOPT));
+ put(Identifier::fromString(vm, "WSAENOPROTOOPT"_s), jsNumber(WSAENOPROTOOPT));
#endif
#ifdef WSAEPROTONOSUPPORT
- put(Identifier::fromString(vm, "WSAEPROTONOSUPPORT"_s), jsNumber(WSAEPROTONOSUPPORT));
+ put(Identifier::fromString(vm, "WSAEPROTONOSUPPORT"_s),
+ jsNumber(WSAEPROTONOSUPPORT));
#endif
#ifdef WSAESOCKTNOSUPPORT
- put(Identifier::fromString(vm, "WSAESOCKTNOSUPPORT"_s), jsNumber(WSAESOCKTNOSUPPORT));
+ put(Identifier::fromString(vm, "WSAESOCKTNOSUPPORT"_s),
+ jsNumber(WSAESOCKTNOSUPPORT));
#endif
#ifdef WSAEOPNOTSUPP
- put(Identifier::fromString(vm, "WSAEOPNOTSUPP"_s), jsNumber(WSAEOPNOTSUPP));
+ put(Identifier::fromString(vm, "WSAEOPNOTSUPP"_s), jsNumber(WSAEOPNOTSUPP));
#endif
#ifdef WSAEPFNOSUPPORT
- put(Identifier::fromString(vm, "WSAEPFNOSUPPORT"_s), jsNumber(WSAEPFNOSUPPORT));
+ put(Identifier::fromString(vm, "WSAEPFNOSUPPORT"_s),
+ jsNumber(WSAEPFNOSUPPORT));
#endif
#ifdef WSAEAFNOSUPPORT
- put(Identifier::fromString(vm, "WSAEAFNOSUPPORT"_s), jsNumber(WSAEAFNOSUPPORT));
+ put(Identifier::fromString(vm, "WSAEAFNOSUPPORT"_s),
+ jsNumber(WSAEAFNOSUPPORT));
#endif
#ifdef WSAEADDRINUSE
- put(Identifier::fromString(vm, "WSAEADDRINUSE"_s), jsNumber(WSAEADDRINUSE));
+ put(Identifier::fromString(vm, "WSAEADDRINUSE"_s), jsNumber(WSAEADDRINUSE));
#endif
#ifdef WSAEADDRNOTAVAIL
- put(Identifier::fromString(vm, "WSAEADDRNOTAVAIL"_s), jsNumber(WSAEADDRNOTAVAIL));
+ put(Identifier::fromString(vm, "WSAEADDRNOTAVAIL"_s),
+ jsNumber(WSAEADDRNOTAVAIL));
#endif
#ifdef WSAENETDOWN
- put(Identifier::fromString(vm, "WSAENETDOWN"_s), jsNumber(WSAENETDOWN));
+ put(Identifier::fromString(vm, "WSAENETDOWN"_s), jsNumber(WSAENETDOWN));
#endif
#ifdef WSAENETUNREACH
- put(Identifier::fromString(vm, "WSAENETUNREACH"_s), jsNumber(WSAENETUNREACH));
+ put(Identifier::fromString(vm, "WSAENETUNREACH"_s), jsNumber(WSAENETUNREACH));
#endif
#ifdef WSAENETRESET
- put(Identifier::fromString(vm, "WSAENETRESET"_s), jsNumber(WSAENETRESET));
+ put(Identifier::fromString(vm, "WSAENETRESET"_s), jsNumber(WSAENETRESET));
#endif
#ifdef WSAECONNABORTED
- put(Identifier::fromString(vm, "WSAECONNABORTED"_s), jsNumber(WSAECONNABORTED));
+ put(Identifier::fromString(vm, "WSAECONNABORTED"_s),
+ jsNumber(WSAECONNABORTED));
#endif
#ifdef WSAECONNRESET
- put(Identifier::fromString(vm, "WSAECONNRESET"_s), jsNumber(WSAECONNRESET));
+ put(Identifier::fromString(vm, "WSAECONNRESET"_s), jsNumber(WSAECONNRESET));
#endif
#ifdef WSAENOBUFS
- put(Identifier::fromString(vm, "WSAENOBUFS"_s), jsNumber(WSAENOBUFS));
+ put(Identifier::fromString(vm, "WSAENOBUFS"_s), jsNumber(WSAENOBUFS));
#endif
#ifdef WSAEISCONN
- put(Identifier::fromString(vm, "WSAEISCONN"_s), jsNumber(WSAEISCONN));
+ put(Identifier::fromString(vm, "WSAEISCONN"_s), jsNumber(WSAEISCONN));
#endif
#ifdef WSAENOTCONN
- put(Identifier::fromString(vm, "WSAENOTCONN"_s), jsNumber(WSAENOTCONN));
+ put(Identifier::fromString(vm, "WSAENOTCONN"_s), jsNumber(WSAENOTCONN));
#endif
#ifdef WSAESHUTDOWN
- put(Identifier::fromString(vm, "WSAESHUTDOWN"_s), jsNumber(WSAESHUTDOWN));
+ put(Identifier::fromString(vm, "WSAESHUTDOWN"_s), jsNumber(WSAESHUTDOWN));
#endif
#ifdef WSAETOOMANYREFS
- put(Identifier::fromString(vm, "WSAETOOMANYREFS"_s), jsNumber(WSAETOOMANYREFS));
+ put(Identifier::fromString(vm, "WSAETOOMANYREFS"_s),
+ jsNumber(WSAETOOMANYREFS));
#endif
#ifdef WSAETIMEDOUT
- put(Identifier::fromString(vm, "WSAETIMEDOUT"_s), jsNumber(WSAETIMEDOUT));
+ put(Identifier::fromString(vm, "WSAETIMEDOUT"_s), jsNumber(WSAETIMEDOUT));
#endif
#ifdef WSAECONNREFUSED
- put(Identifier::fromString(vm, "WSAECONNREFUSED"_s), jsNumber(WSAECONNREFUSED));
+ put(Identifier::fromString(vm, "WSAECONNREFUSED"_s),
+ jsNumber(WSAECONNREFUSED));
#endif
#ifdef WSAELOOP
- put(Identifier::fromString(vm, "WSAELOOP"_s), jsNumber(WSAELOOP));
+ put(Identifier::fromString(vm, "WSAELOOP"_s), jsNumber(WSAELOOP));
#endif
#ifdef WSAENAMETOOLONG
- put(Identifier::fromString(vm, "WSAENAMETOOLONG"_s), jsNumber(WSAENAMETOOLONG));
+ put(Identifier::fromString(vm, "WSAENAMETOOLONG"_s),
+ jsNumber(WSAENAMETOOLONG));
#endif
#ifdef WSAEHOSTDOWN
- put(Identifier::fromString(vm, "WSAEHOSTDOWN"_s), jsNumber(WSAEHOSTDOWN));
+ put(Identifier::fromString(vm, "WSAEHOSTDOWN"_s), jsNumber(WSAEHOSTDOWN));
#endif
#ifdef WSAEHOSTUNREACH
- put(Identifier::fromString(vm, "WSAEHOSTUNREACH"_s), jsNumber(WSAEHOSTUNREACH));
+ put(Identifier::fromString(vm, "WSAEHOSTUNREACH"_s),
+ jsNumber(WSAEHOSTUNREACH));
#endif
#ifdef WSAENOTEMPTY
- put(Identifier::fromString(vm, "WSAENOTEMPTY"_s), jsNumber(WSAENOTEMPTY));
+ put(Identifier::fromString(vm, "WSAENOTEMPTY"_s), jsNumber(WSAENOTEMPTY));
#endif
#ifdef WSAEPROCLIM
- put(Identifier::fromString(vm, "WSAEPROCLIM"_s), jsNumber(WSAEPROCLIM));
+ put(Identifier::fromString(vm, "WSAEPROCLIM"_s), jsNumber(WSAEPROCLIM));
#endif
#ifdef WSAEUSERS
- put(Identifier::fromString(vm, "WSAEUSERS"_s), jsNumber(WSAEUSERS));
+ put(Identifier::fromString(vm, "WSAEUSERS"_s), jsNumber(WSAEUSERS));
#endif
#ifdef WSAEDQUOT
- put(Identifier::fromString(vm, "WSAEDQUOT"_s), jsNumber(WSAEDQUOT));
+ put(Identifier::fromString(vm, "WSAEDQUOT"_s), jsNumber(WSAEDQUOT));
#endif
#ifdef WSAESTALE
- put(Identifier::fromString(vm, "WSAESTALE"_s), jsNumber(WSAESTALE));
+ put(Identifier::fromString(vm, "WSAESTALE"_s), jsNumber(WSAESTALE));
#endif
#ifdef WSAEREMOTE
- put(Identifier::fromString(vm, "WSAEREMOTE"_s), jsNumber(WSAEREMOTE));
+ put(Identifier::fromString(vm, "WSAEREMOTE"_s), jsNumber(WSAEREMOTE));
#endif
#ifdef WSASYSNOTREADY
- put(Identifier::fromString(vm, "WSASYSNOTREADY"_s), jsNumber(WSASYSNOTREADY));
+ put(Identifier::fromString(vm, "WSASYSNOTREADY"_s), jsNumber(WSASYSNOTREADY));
#endif
#ifdef WSAVERNOTSUPPORTED
- put(Identifier::fromString(vm, "WSAVERNOTSUPPORTED"_s), jsNumber(WSAVERNOTSUPPORTED));
+ put(Identifier::fromString(vm, "WSAVERNOTSUPPORTED"_s),
+ jsNumber(WSAVERNOTSUPPORTED));
#endif
#ifdef WSANOTINITIALISED
- put(Identifier::fromString(vm, "WSANOTINITIALISED"_s), jsNumber(WSANOTINITIALISED));
+ put(Identifier::fromString(vm, "WSANOTINITIALISED"_s),
+ jsNumber(WSANOTINITIALISED));
#endif
#ifdef WSAEDISCON
- put(Identifier::fromString(vm, "WSAEDISCON"_s), jsNumber(WSAEDISCON));
+ put(Identifier::fromString(vm, "WSAEDISCON"_s), jsNumber(WSAEDISCON));
#endif
#ifdef WSAENOMORE
- put(Identifier::fromString(vm, "WSAENOMORE"_s), jsNumber(WSAENOMORE));
+ put(Identifier::fromString(vm, "WSAENOMORE"_s), jsNumber(WSAENOMORE));
#endif
#ifdef WSAECANCELLED
- put(Identifier::fromString(vm, "WSAECANCELLED"_s), jsNumber(WSAECANCELLED));
+ put(Identifier::fromString(vm, "WSAECANCELLED"_s), jsNumber(WSAECANCELLED));
#endif
#ifdef WSAEINVALIDPROCTABLE
- put(Identifier::fromString(vm, "WSAEINVALIDPROCTABLE"_s), jsNumber(WSAEINVALIDPROCTABLE));
+ put(Identifier::fromString(vm, "WSAEINVALIDPROCTABLE"_s),
+ jsNumber(WSAEINVALIDPROCTABLE));
#endif
#ifdef WSAEINVALIDPROVIDER
- put(Identifier::fromString(vm, "WSAEINVALIDPROVIDER"_s), jsNumber(WSAEINVALIDPROVIDER));
+ put(Identifier::fromString(vm, "WSAEINVALIDPROVIDER"_s),
+ jsNumber(WSAEINVALIDPROVIDER));
#endif
#ifdef WSAEPROVIDERFAILEDINIT
- put(Identifier::fromString(vm, "WSAEPROVIDERFAILEDINIT"_s), jsNumber(WSAEPROVIDERFAILEDINIT));
+ put(Identifier::fromString(vm, "WSAEPROVIDERFAILEDINIT"_s),
+ jsNumber(WSAEPROVIDERFAILEDINIT));
#endif
#ifdef WSASYSCALLFAILURE
- put(Identifier::fromString(vm, "WSASYSCALLFAILURE"_s), jsNumber(WSASYSCALLFAILURE));
+ put(Identifier::fromString(vm, "WSASYSCALLFAILURE"_s),
+ jsNumber(WSASYSCALLFAILURE));
#endif
#ifdef WSASERVICE_NOT_FOUND
- put(Identifier::fromString(vm, "WSASERVICE_NOT_FOUND"_s), jsNumber(WSASERVICE_NOT_FOUND));
+ put(Identifier::fromString(vm, "WSASERVICE_NOT_FOUND"_s),
+ jsNumber(WSASERVICE_NOT_FOUND));
#endif
#ifdef WSATYPE_NOT_FOUND
- put(Identifier::fromString(vm, "WSATYPE_NOT_FOUND"_s), jsNumber(WSATYPE_NOT_FOUND));
+ put(Identifier::fromString(vm, "WSATYPE_NOT_FOUND"_s),
+ jsNumber(WSATYPE_NOT_FOUND));
#endif
#ifdef WSA_E_NO_MORE
- put(Identifier::fromString(vm, "WSA_E_NO_MORE"_s), jsNumber(WSA_E_NO_MORE));
+ put(Identifier::fromString(vm, "WSA_E_NO_MORE"_s), jsNumber(WSA_E_NO_MORE));
#endif
#ifdef WSA_E_CANCELLED
- put(Identifier::fromString(vm, "WSA_E_CANCELLED"_s), jsNumber(WSA_E_CANCELLED));
+ put(Identifier::fromString(vm, "WSA_E_CANCELLED"_s),
+ jsNumber(WSA_E_CANCELLED));
#endif
#ifdef WSAEREFUSED
- put(Identifier::fromString(vm, "WSAEREFUSED"_s), jsNumber(WSAEREFUSED));
-#endif
- put(Identifier::fromString(vm, "PRIORITY_LOW"_s), jsNumber(19));
- put(Identifier::fromString(vm, "PRIORITY_BELOW_NORMAL"_s), jsNumber(10));
- put(Identifier::fromString(vm, "PRIORITY_NORMAL"_s), jsNumber(0));
- put(Identifier::fromString(vm, "PRIORITY_ABOVE_NORMAL"_s), jsNumber(-7));
- put(Identifier::fromString(vm, "PRIORITY_HIGH"_s), jsNumber(-14));
- put(Identifier::fromString(vm, "PRIORITY_HIGHEST"_s), jsNumber(-20));
+ put(Identifier::fromString(vm, "WSAEREFUSED"_s), jsNumber(WSAEREFUSED));
+#endif
+ put(Identifier::fromString(vm, "PRIORITY_LOW"_s), jsNumber(19));
+ put(Identifier::fromString(vm, "PRIORITY_BELOW_NORMAL"_s), jsNumber(10));
+ put(Identifier::fromString(vm, "PRIORITY_NORMAL"_s), jsNumber(0));
+ put(Identifier::fromString(vm, "PRIORITY_ABOVE_NORMAL"_s), jsNumber(-7));
+ put(Identifier::fromString(vm, "PRIORITY_HIGH"_s), jsNumber(-14));
+ put(Identifier::fromString(vm, "PRIORITY_HIGHEST"_s), jsNumber(-20));
#ifdef SIGHUP
- put(Identifier::fromString(vm, "SIGHUP"_s), jsNumber(SIGHUP));
+ put(Identifier::fromString(vm, "SIGHUP"_s), jsNumber(SIGHUP));
#endif
#ifdef SIGINT
- put(Identifier::fromString(vm, "SIGINT"_s), jsNumber(SIGINT));
+ put(Identifier::fromString(vm, "SIGINT"_s), jsNumber(SIGINT));
#endif
#ifdef SIGQUIT
- put(Identifier::fromString(vm, "SIGQUIT"_s), jsNumber(SIGQUIT));
+ put(Identifier::fromString(vm, "SIGQUIT"_s), jsNumber(SIGQUIT));
#endif
#ifdef SIGILL
- put(Identifier::fromString(vm, "SIGILL"_s), jsNumber(SIGILL));
+ put(Identifier::fromString(vm, "SIGILL"_s), jsNumber(SIGILL));
#endif
#ifdef SIGTRAP
- put(Identifier::fromString(vm, "SIGTRAP"_s), jsNumber(SIGTRAP));
+ put(Identifier::fromString(vm, "SIGTRAP"_s), jsNumber(SIGTRAP));
#endif
#ifdef SIGABRT
- put(Identifier::fromString(vm, "SIGABRT"_s), jsNumber(SIGABRT));
+ put(Identifier::fromString(vm, "SIGABRT"_s), jsNumber(SIGABRT));
#endif
#ifdef SIGIOT
- put(Identifier::fromString(vm, "SIGIOT"_s), jsNumber(SIGIOT));
+ put(Identifier::fromString(vm, "SIGIOT"_s), jsNumber(SIGIOT));
#endif
#ifdef SIGBUS
- put(Identifier::fromString(vm, "SIGBUS"_s), jsNumber(SIGBUS));
+ put(Identifier::fromString(vm, "SIGBUS"_s), jsNumber(SIGBUS));
#endif
#ifdef SIGFPE
- put(Identifier::fromString(vm, "SIGFPE"_s), jsNumber(SIGFPE));
+ put(Identifier::fromString(vm, "SIGFPE"_s), jsNumber(SIGFPE));
#endif
#ifdef SIGKILL
- put(Identifier::fromString(vm, "SIGKILL"_s), jsNumber(SIGKILL));
+ put(Identifier::fromString(vm, "SIGKILL"_s), jsNumber(SIGKILL));
#endif
#ifdef SIGUSR1
- put(Identifier::fromString(vm, "SIGUSR1"_s), jsNumber(SIGUSR1));
+ put(Identifier::fromString(vm, "SIGUSR1"_s), jsNumber(SIGUSR1));
#endif
#ifdef SIGSEGV
- put(Identifier::fromString(vm, "SIGSEGV"_s), jsNumber(SIGSEGV));
+ put(Identifier::fromString(vm, "SIGSEGV"_s), jsNumber(SIGSEGV));
#endif
#ifdef SIGUSR2
- put(Identifier::fromString(vm, "SIGUSR2"_s), jsNumber(SIGUSR2));
+ put(Identifier::fromString(vm, "SIGUSR2"_s), jsNumber(SIGUSR2));
#endif
#ifdef SIGPIPE
- put(Identifier::fromString(vm, "SIGPIPE"_s), jsNumber(SIGPIPE));
+ put(Identifier::fromString(vm, "SIGPIPE"_s), jsNumber(SIGPIPE));
#endif
#ifdef SIGALRM
- put(Identifier::fromString(vm, "SIGALRM"_s), jsNumber(SIGALRM));
+ put(Identifier::fromString(vm, "SIGALRM"_s), jsNumber(SIGALRM));
#endif
#ifdef SIGTERM
- put(Identifier::fromString(vm, "SIGTERM"_s), jsNumber(SIGTERM));
+ put(Identifier::fromString(vm, "SIGTERM"_s), jsNumber(SIGTERM));
#endif
#ifdef SIGCHLD
- put(Identifier::fromString(vm, "SIGCHLD"_s), jsNumber(SIGCHLD));
+ put(Identifier::fromString(vm, "SIGCHLD"_s), jsNumber(SIGCHLD));
#endif
#ifdef SIGSTKFLT
- put(Identifier::fromString(vm, "SIGSTKFLT"_s), jsNumber(SIGSTKFLT));
+ put(Identifier::fromString(vm, "SIGSTKFLT"_s), jsNumber(SIGSTKFLT));
#endif
#ifdef SIGCONT
- put(Identifier::fromString(vm, "SIGCONT"_s), jsNumber(SIGCONT));
+ put(Identifier::fromString(vm, "SIGCONT"_s), jsNumber(SIGCONT));
#endif
#ifdef SIGSTOP
- put(Identifier::fromString(vm, "SIGSTOP"_s), jsNumber(SIGSTOP));
+ put(Identifier::fromString(vm, "SIGSTOP"_s), jsNumber(SIGSTOP));
#endif
#ifdef SIGTSTP
- put(Identifier::fromString(vm, "SIGTSTP"_s), jsNumber(SIGTSTP));
+ put(Identifier::fromString(vm, "SIGTSTP"_s), jsNumber(SIGTSTP));
#endif
#ifdef SIGBREAK
- put(Identifier::fromString(vm, "SIGBREAK"_s), jsNumber(SIGBREAK));
+ put(Identifier::fromString(vm, "SIGBREAK"_s), jsNumber(SIGBREAK));
#endif
#ifdef SIGTTIN
- put(Identifier::fromString(vm, "SIGTTIN"_s), jsNumber(SIGTTIN));
+ put(Identifier::fromString(vm, "SIGTTIN"_s), jsNumber(SIGTTIN));
#endif
#ifdef SIGTTOU
- put(Identifier::fromString(vm, "SIGTTOU"_s), jsNumber(SIGTTOU));
+ put(Identifier::fromString(vm, "SIGTTOU"_s), jsNumber(SIGTTOU));
#endif
#ifdef SIGURG
- put(Identifier::fromString(vm, "SIGURG"_s), jsNumber(SIGURG));
+ put(Identifier::fromString(vm, "SIGURG"_s), jsNumber(SIGURG));
#endif
#ifdef SIGXCPU
- put(Identifier::fromString(vm, "SIGXCPU"_s), jsNumber(SIGXCPU));
+ put(Identifier::fromString(vm, "SIGXCPU"_s), jsNumber(SIGXCPU));
#endif
#ifdef SIGXFSZ
- put(Identifier::fromString(vm, "SIGXFSZ"_s), jsNumber(SIGXFSZ));
+ put(Identifier::fromString(vm, "SIGXFSZ"_s), jsNumber(SIGXFSZ));
#endif
#ifdef SIGVTALRM
- put(Identifier::fromString(vm, "SIGVTALRM"_s), jsNumber(SIGVTALRM));
+ put(Identifier::fromString(vm, "SIGVTALRM"_s), jsNumber(SIGVTALRM));
#endif
#ifdef SIGPROF
- put(Identifier::fromString(vm, "SIGPROF"_s), jsNumber(SIGPROF));
+ put(Identifier::fromString(vm, "SIGPROF"_s), jsNumber(SIGPROF));
#endif
#ifdef SIGWINCH
- put(Identifier::fromString(vm, "SIGWINCH"_s), jsNumber(SIGWINCH));
+ put(Identifier::fromString(vm, "SIGWINCH"_s), jsNumber(SIGWINCH));
#endif
#ifdef SIGIO
- put(Identifier::fromString(vm, "SIGIO"_s), jsNumber(SIGIO));
+ put(Identifier::fromString(vm, "SIGIO"_s), jsNumber(SIGIO));
#endif
#ifdef SIGPOLL
- put(Identifier::fromString(vm, "SIGPOLL"_s), jsNumber(SIGPOLL));
+ put(Identifier::fromString(vm, "SIGPOLL"_s), jsNumber(SIGPOLL));
#endif
#ifdef SIGLOST
- put(Identifier::fromString(vm, "SIGLOST"_s), jsNumber(SIGLOST));
+ put(Identifier::fromString(vm, "SIGLOST"_s), jsNumber(SIGLOST));
#endif
#ifdef SIGPWR
- put(Identifier::fromString(vm, "SIGPWR"_s), jsNumber(SIGPWR));
+ put(Identifier::fromString(vm, "SIGPWR"_s), jsNumber(SIGPWR));
#endif
#ifdef SIGINFO
- put(Identifier::fromString(vm, "SIGINFO"_s), jsNumber(SIGINFO));
+ put(Identifier::fromString(vm, "SIGINFO"_s), jsNumber(SIGINFO));
#endif
#ifdef SIGSYS
- put(Identifier::fromString(vm, "SIGSYS"_s), jsNumber(SIGSYS));
+ put(Identifier::fromString(vm, "SIGSYS"_s), jsNumber(SIGSYS));
#endif
#ifdef SIGUNUSED
- put(Identifier::fromString(vm, "SIGUNUSED"_s), jsNumber(SIGUNUSED));
+ put(Identifier::fromString(vm, "SIGUNUSED"_s), jsNumber(SIGUNUSED));
#endif
- put(Identifier::fromString(vm, "UV_FS_SYMLINK_DIR"_s), jsNumber(1));
- put(Identifier::fromString(vm, "UV_FS_SYMLINK_JUNCTION"_s), jsNumber(2));
- put(Identifier::fromString(vm, "O_RDONLY"_s), jsNumber(O_RDONLY));
- put(Identifier::fromString(vm, "O_WRONLY"_s), jsNumber(O_WRONLY));
- put(Identifier::fromString(vm, "O_RDWR"_s), jsNumber(O_RDWR));
+ put(Identifier::fromString(vm, "UV_FS_SYMLINK_DIR"_s), jsNumber(1));
+ put(Identifier::fromString(vm, "UV_FS_SYMLINK_JUNCTION"_s), jsNumber(2));
+ put(Identifier::fromString(vm, "O_RDONLY"_s), jsNumber(O_RDONLY));
+ put(Identifier::fromString(vm, "O_WRONLY"_s), jsNumber(O_WRONLY));
+ put(Identifier::fromString(vm, "O_RDWR"_s), jsNumber(O_RDWR));
- put(Identifier::fromString(vm, "UV_DIRENT_UNKNOWN"_s), jsNumber(0));
- put(Identifier::fromString(vm, "UV_DIRENT_FILE"_s), jsNumber(1));
- put(Identifier::fromString(vm, "UV_DIRENT_DIR"_s), jsNumber(2));
- put(Identifier::fromString(vm, "UV_DIRENT_LINK"_s), jsNumber(3));
- put(Identifier::fromString(vm, "UV_DIRENT_FIFO"_s), jsNumber(4));
- put(Identifier::fromString(vm, "UV_DIRENT_SOCKET"_s), jsNumber(5));
- put(Identifier::fromString(vm, "UV_DIRENT_CHAR"_s), jsNumber(6));
- put(Identifier::fromString(vm, "UV_DIRENT_BLOCK"_s), jsNumber(7));
+ put(Identifier::fromString(vm, "UV_DIRENT_UNKNOWN"_s), jsNumber(0));
+ put(Identifier::fromString(vm, "UV_DIRENT_FILE"_s), jsNumber(1));
+ put(Identifier::fromString(vm, "UV_DIRENT_DIR"_s), jsNumber(2));
+ put(Identifier::fromString(vm, "UV_DIRENT_LINK"_s), jsNumber(3));
+ put(Identifier::fromString(vm, "UV_DIRENT_FIFO"_s), jsNumber(4));
+ put(Identifier::fromString(vm, "UV_DIRENT_SOCKET"_s), jsNumber(5));
+ put(Identifier::fromString(vm, "UV_DIRENT_CHAR"_s), jsNumber(6));
+ put(Identifier::fromString(vm, "UV_DIRENT_BLOCK"_s), jsNumber(7));
- put(Identifier::fromString(vm, "S_IFMT"_s), jsNumber(S_IFMT));
- put(Identifier::fromString(vm, "S_IFREG"_s), jsNumber(S_IFREG));
- put(Identifier::fromString(vm, "S_IFDIR"_s), jsNumber(S_IFDIR));
- put(Identifier::fromString(vm, "S_IFCHR"_s), jsNumber(S_IFCHR));
+ put(Identifier::fromString(vm, "S_IFMT"_s), jsNumber(S_IFMT));
+ put(Identifier::fromString(vm, "S_IFREG"_s), jsNumber(S_IFREG));
+ put(Identifier::fromString(vm, "S_IFDIR"_s), jsNumber(S_IFDIR));
+ put(Identifier::fromString(vm, "S_IFCHR"_s), jsNumber(S_IFCHR));
#ifdef S_IFBLK
- put(Identifier::fromString(vm, "S_IFBLK"_s), jsNumber(S_IFBLK));
+ put(Identifier::fromString(vm, "S_IFBLK"_s), jsNumber(S_IFBLK));
#endif
#ifdef S_IFIFO
- put(Identifier::fromString(vm, "S_IFIFO"_s), jsNumber(S_IFIFO));
+ put(Identifier::fromString(vm, "S_IFIFO"_s), jsNumber(S_IFIFO));
#endif
#ifdef S_IFLNK
- put(Identifier::fromString(vm, "S_IFLNK"_s), jsNumber(S_IFLNK));
+ put(Identifier::fromString(vm, "S_IFLNK"_s), jsNumber(S_IFLNK));
#endif
#ifdef S_IFSOCK
- put(Identifier::fromString(vm, "S_IFSOCK"_s), jsNumber(S_IFSOCK));
+ put(Identifier::fromString(vm, "S_IFSOCK"_s), jsNumber(S_IFSOCK));
#endif
#ifdef O_CREAT
- put(Identifier::fromString(vm, "O_CREAT"_s), jsNumber(O_CREAT));
+ put(Identifier::fromString(vm, "O_CREAT"_s), jsNumber(O_CREAT));
#endif
#ifdef O_EXCL
- put(Identifier::fromString(vm, "O_EXCL"_s), jsNumber(O_EXCL));
+ put(Identifier::fromString(vm, "O_EXCL"_s), jsNumber(O_EXCL));
#endif
- put(Identifier::fromString(vm, "UV_FS_O_FILEMAP"_s), jsNumber(0));
+ put(Identifier::fromString(vm, "UV_FS_O_FILEMAP"_s), jsNumber(0));
#ifdef O_NOCTTY
- put(Identifier::fromString(vm, "O_NOCTTY"_s), jsNumber(O_NOCTTY));
+ put(Identifier::fromString(vm, "O_NOCTTY"_s), jsNumber(O_NOCTTY));
#endif
#ifdef O_TRUNC
- put(Identifier::fromString(vm, "O_TRUNC"_s), jsNumber(O_TRUNC));
+ put(Identifier::fromString(vm, "O_TRUNC"_s), jsNumber(O_TRUNC));
#endif
#ifdef O_APPEND
- put(Identifier::fromString(vm, "O_APPEND"_s), jsNumber(O_APPEND));
+ put(Identifier::fromString(vm, "O_APPEND"_s), jsNumber(O_APPEND));
#endif
#ifdef O_DIRECTORY
- put(Identifier::fromString(vm, "O_DIRECTORY"_s), jsNumber(O_DIRECTORY));
-#endif
-#ifdef O_EXCL
- put(Identifier::fromString(vm, "O_EXCL"_s), jsNumber(O_EXCL));
+ put(Identifier::fromString(vm, "O_DIRECTORY"_s), jsNumber(O_DIRECTORY));
#endif
#ifdef O_NOATIME
- put(Identifier::fromString(vm, "O_NOATIME"_s), jsNumber(O_NOATIME));
+ put(Identifier::fromString(vm, "O_NOATIME"_s), jsNumber(O_NOATIME));
#endif
#ifdef O_NOFOLLOW
- put(Identifier::fromString(vm, "O_NOFOLLOW"_s), jsNumber(O_NOFOLLOW));
+ put(Identifier::fromString(vm, "O_NOFOLLOW"_s), jsNumber(O_NOFOLLOW));
#endif
#ifdef O_SYNC
- put(Identifier::fromString(vm, "O_SYNC"_s), jsNumber(O_SYNC));
+ put(Identifier::fromString(vm, "O_SYNC"_s), jsNumber(O_SYNC));
#endif
#ifdef O_DSYNC
- put(Identifier::fromString(vm, "O_DSYNC"_s), jsNumber(O_DSYNC));
+ put(Identifier::fromString(vm, "O_DSYNC"_s), jsNumber(O_DSYNC));
#endif
#ifdef O_SYMLINK
- put(Identifier::fromString(vm, "O_SYMLINK"_s), jsNumber(O_SYMLINK));
+ put(Identifier::fromString(vm, "O_SYMLINK"_s), jsNumber(O_SYMLINK));
#endif
#ifdef O_DIRECT
- put(Identifier::fromString(vm, "O_DIRECT"_s), jsNumber(O_DIRECT));
+ put(Identifier::fromString(vm, "O_DIRECT"_s), jsNumber(O_DIRECT));
#endif
#ifdef O_NONBLOCK
- put(Identifier::fromString(vm, "O_NONBLOCK"_s), jsNumber(O_NONBLOCK));
+ put(Identifier::fromString(vm, "O_NONBLOCK"_s), jsNumber(O_NONBLOCK));
#endif
#ifdef S_IRWXU
- put(Identifier::fromString(vm, "S_IRWXU"_s), jsNumber(S_IRWXU));
+ put(Identifier::fromString(vm, "S_IRWXU"_s), jsNumber(S_IRWXU));
#endif
#ifdef S_IRUSR
- put(Identifier::fromString(vm, "S_IRUSR"_s), jsNumber(S_IRUSR));
+ put(Identifier::fromString(vm, "S_IRUSR"_s), jsNumber(S_IRUSR));
#endif
#ifdef S_IWUSR
- put(Identifier::fromString(vm, "S_IWUSR"_s), jsNumber(S_IWUSR));
+ put(Identifier::fromString(vm, "S_IWUSR"_s), jsNumber(S_IWUSR));
#endif
#ifdef S_IXUSR
- put(Identifier::fromString(vm, "S_IXUSR"_s), jsNumber(S_IXUSR));
+ put(Identifier::fromString(vm, "S_IXUSR"_s), jsNumber(S_IXUSR));
#endif
#ifdef S_IRWXG
- put(Identifier::fromString(vm, "S_IRWXG"_s), jsNumber(S_IRWXG));
+ put(Identifier::fromString(vm, "S_IRWXG"_s), jsNumber(S_IRWXG));
#endif
#ifdef S_IRGRP
- put(Identifier::fromString(vm, "S_IRGRP"_s), jsNumber(S_IRGRP));
+ put(Identifier::fromString(vm, "S_IRGRP"_s), jsNumber(S_IRGRP));
#endif
#ifdef S_IWGRP
- put(Identifier::fromString(vm, "S_IWGRP"_s), jsNumber(S_IWGRP));
+ put(Identifier::fromString(vm, "S_IWGRP"_s), jsNumber(S_IWGRP));
#endif
#ifdef S_IXGRP
- put(Identifier::fromString(vm, "S_IXGRP"_s), jsNumber(S_IXGRP));
+ put(Identifier::fromString(vm, "S_IXGRP"_s), jsNumber(S_IXGRP));
#endif
#ifdef S_IRWXO
- put(Identifier::fromString(vm, "S_IRWXO"_s), jsNumber(S_IRWXO));
+ put(Identifier::fromString(vm, "S_IRWXO"_s), jsNumber(S_IRWXO));
#endif
#ifdef S_IROTH
- put(Identifier::fromString(vm, "S_IROTH"_s), jsNumber(S_IROTH));
+ put(Identifier::fromString(vm, "S_IROTH"_s), jsNumber(S_IROTH));
#endif
#ifdef S_IWOTH
- put(Identifier::fromString(vm, "S_IWOTH"_s), jsNumber(S_IWOTH));
+ put(Identifier::fromString(vm, "S_IWOTH"_s), jsNumber(S_IWOTH));
#endif
#ifdef S_IXOTH
- put(Identifier::fromString(vm, "S_IXOTH"_s), jsNumber(S_IXOTH));
+ put(Identifier::fromString(vm, "S_IXOTH"_s), jsNumber(S_IXOTH));
#endif
#ifdef F_OK
- put(Identifier::fromString(vm, "F_OK"_s), jsNumber(F_OK));
+ put(Identifier::fromString(vm, "F_OK"_s), jsNumber(F_OK));
#endif
#ifdef R_OK
- put(Identifier::fromString(vm, "R_OK"_s), jsNumber(R_OK));
+ put(Identifier::fromString(vm, "R_OK"_s), jsNumber(R_OK));
#endif
#ifdef W_OK
- put(Identifier::fromString(vm, "W_OK"_s), jsNumber(W_OK));
+ put(Identifier::fromString(vm, "W_OK"_s), jsNumber(W_OK));
#endif
#ifdef X_OK
- put(Identifier::fromString(vm, "X_OK"_s), jsNumber(X_OK));
-#endif
- put(Identifier::fromString(vm, "UV_FS_COPYFILE_EXCL"_s), jsNumber(1));
- put(Identifier::fromString(vm, "COPYFILE_EXCL"_s), jsNumber(1));
- put(Identifier::fromString(vm, "UV_FS_COPYFILE_FICLONE"_s), jsNumber(2));
- put(Identifier::fromString(vm, "COPYFILE_FICLONE"_s), jsNumber(2));
- put(Identifier::fromString(vm, "UV_FS_COPYFILE_FICLONE_FORCE"_s), jsNumber(4));
- put(Identifier::fromString(vm, "COPYFILE_FICLONE_FORCE"_s), jsNumber(4));
+ put(Identifier::fromString(vm, "X_OK"_s), jsNumber(X_OK));
+#endif
+ put(Identifier::fromString(vm, "UV_FS_COPYFILE_EXCL"_s), jsNumber(1));
+ put(Identifier::fromString(vm, "COPYFILE_EXCL"_s), jsNumber(1));
+ put(Identifier::fromString(vm, "UV_FS_COPYFILE_FICLONE"_s), jsNumber(2));
+ put(Identifier::fromString(vm, "COPYFILE_FICLONE"_s), jsNumber(2));
+ put(Identifier::fromString(vm, "UV_FS_COPYFILE_FICLONE_FORCE"_s),
+ jsNumber(4));
+ put(Identifier::fromString(vm, "COPYFILE_FICLONE_FORCE"_s), jsNumber(4));
#ifdef OPENSSL_VERSION_NUMBER
- put(Identifier::fromString(vm, "OPENSSL_VERSION_NUMBER"_s), jsNumber(OPENSSL_VERSION_NUMBER));
+ put(Identifier::fromString(vm, "OPENSSL_VERSION_NUMBER"_s),
+ jsNumber(OPENSSL_VERSION_NUMBER));
#endif
#ifdef SSL_OP_ALL
- put(Identifier::fromString(vm, "SSL_OP_ALL"_s), jsNumber(SSL_OP_ALL));
+ put(Identifier::fromString(vm, "SSL_OP_ALL"_s), jsNumber(SSL_OP_ALL));
#endif
#ifdef SSL_OP_ALLOW_NO_DHE_KEX
- put(Identifier::fromString(vm, "SSL_OP_ALLOW_NO_DHE_KEX"_s), jsNumber(SSL_OP_ALLOW_NO_DHE_KEX));
+ put(Identifier::fromString(vm, "SSL_OP_ALLOW_NO_DHE_KEX"_s),
+ jsNumber(SSL_OP_ALLOW_NO_DHE_KEX));
#endif
#ifdef SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
- put(Identifier::fromString(vm, "SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION"_s), jsNumber(SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION));
+ put(Identifier::fromString(vm, "SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION"_s),
+ jsNumber(SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION));
#endif
#ifdef SSL_OP_CIPHER_SERVER_PREFERENCE
- put(Identifier::fromString(vm, "SSL_OP_CIPHER_SERVER_PREFERENCE"_s), jsNumber(SSL_OP_CIPHER_SERVER_PREFERENCE));
+ put(Identifier::fromString(vm, "SSL_OP_CIPHER_SERVER_PREFERENCE"_s),
+ jsNumber(SSL_OP_CIPHER_SERVER_PREFERENCE));
#endif
#ifdef SSL_OP_CISCO_ANYCONNECT
- put(Identifier::fromString(vm, "SSL_OP_CISCO_ANYCONNECT"_s), jsNumber(SSL_OP_CISCO_ANYCONNECT));
+ put(Identifier::fromString(vm, "SSL_OP_CISCO_ANYCONNECT"_s),
+ jsNumber(SSL_OP_CISCO_ANYCONNECT));
#endif
#ifdef SSL_OP_COOKIE_EXCHANGE
- put(Identifier::fromString(vm, "SSL_OP_COOKIE_EXCHANGE"_s), jsNumber(SSL_OP_COOKIE_EXCHANGE));
+ put(Identifier::fromString(vm, "SSL_OP_COOKIE_EXCHANGE"_s),
+ jsNumber(SSL_OP_COOKIE_EXCHANGE));
#endif
#ifdef SSL_OP_CRYPTOPRO_TLSEXT_BUG
- put(Identifier::fromString(vm, "SSL_OP_CRYPTOPRO_TLSEXT_BUG"_s), jsNumber(SSL_OP_CRYPTOPRO_TLSEXT_BUG));
+ put(Identifier::fromString(vm, "SSL_OP_CRYPTOPRO_TLSEXT_BUG"_s),
+ jsNumber(SSL_OP_CRYPTOPRO_TLSEXT_BUG));
#endif
#ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
- put(Identifier::fromString(vm, "SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS"_s), jsNumber(SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS));
+ put(Identifier::fromString(vm, "SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS"_s),
+ jsNumber(SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS));
#endif
#ifdef SSL_OP_LEGACY_SERVER_CONNECT
- put(Identifier::fromString(vm, "SSL_OP_LEGACY_SERVER_CONNECT"_s), jsNumber(SSL_OP_LEGACY_SERVER_CONNECT));
+ put(Identifier::fromString(vm, "SSL_OP_LEGACY_SERVER_CONNECT"_s),
+ jsNumber(SSL_OP_LEGACY_SERVER_CONNECT));
#endif
#ifdef SSL_OP_NO_COMPRESSION
- put(Identifier::fromString(vm, "SSL_OP_NO_COMPRESSION"_s), jsNumber(SSL_OP_NO_COMPRESSION));
+ put(Identifier::fromString(vm, "SSL_OP_NO_COMPRESSION"_s),
+ jsNumber(SSL_OP_NO_COMPRESSION));
#endif
#ifdef SSL_OP_NO_ENCRYPT_THEN_MAC
- put(Identifier::fromString(vm, "SSL_OP_NO_ENCRYPT_THEN_MAC"_s), jsNumber(SSL_OP_NO_ENCRYPT_THEN_MAC));
+ put(Identifier::fromString(vm, "SSL_OP_NO_ENCRYPT_THEN_MAC"_s),
+ jsNumber(SSL_OP_NO_ENCRYPT_THEN_MAC));
#endif
#ifdef SSL_OP_NO_QUERY_MTU
- put(Identifier::fromString(vm, "SSL_OP_NO_QUERY_MTU"_s), jsNumber(SSL_OP_NO_QUERY_MTU));
+ put(Identifier::fromString(vm, "SSL_OP_NO_QUERY_MTU"_s),
+ jsNumber(SSL_OP_NO_QUERY_MTU));
#endif
#ifdef SSL_OP_NO_RENEGOTIATION
- put(Identifier::fromString(vm, "SSL_OP_NO_RENEGOTIATION"_s), jsNumber(SSL_OP_NO_RENEGOTIATION));
+ put(Identifier::fromString(vm, "SSL_OP_NO_RENEGOTIATION"_s),
+ jsNumber(SSL_OP_NO_RENEGOTIATION));
#endif
#ifdef SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
- put(Identifier::fromString(vm, "SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION"_s), jsNumber(SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION));
+ put(Identifier::fromString(vm,
+ "SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION"_s),
+ jsNumber(SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION));
#endif
#ifdef SSL_OP_NO_SSLv2
- put(Identifier::fromString(vm, "SSL_OP_NO_SSLv2"_s), jsNumber(SSL_OP_NO_SSLv2));
+ put(Identifier::fromString(vm, "SSL_OP_NO_SSLv2"_s),
+ jsNumber(SSL_OP_NO_SSLv2));
#endif
#ifdef SSL_OP_NO_SSLv3
- put(Identifier::fromString(vm, "SSL_OP_NO_SSLv3"_s), jsNumber(SSL_OP_NO_SSLv3));
+ put(Identifier::fromString(vm, "SSL_OP_NO_SSLv3"_s),
+ jsNumber(SSL_OP_NO_SSLv3));
#endif
#ifdef SSL_OP_NO_TICKET
- put(Identifier::fromString(vm, "SSL_OP_NO_TICKET"_s), jsNumber(SSL_OP_NO_TICKET));
+ put(Identifier::fromString(vm, "SSL_OP_NO_TICKET"_s),
+ jsNumber(SSL_OP_NO_TICKET));
#endif
#ifdef SSL_OP_NO_TLSv1
- put(Identifier::fromString(vm, "SSL_OP_NO_TLSv1"_s), jsNumber(SSL_OP_NO_TLSv1));
+ put(Identifier::fromString(vm, "SSL_OP_NO_TLSv1"_s),
+ jsNumber(SSL_OP_NO_TLSv1));
#endif
#ifdef SSL_OP_NO_TLSv1_1
- put(Identifier::fromString(vm, "SSL_OP_NO_TLSv1_1"_s), jsNumber(SSL_OP_NO_TLSv1_1));
+ put(Identifier::fromString(vm, "SSL_OP_NO_TLSv1_1"_s),
+ jsNumber(SSL_OP_NO_TLSv1_1));
#endif
#ifdef SSL_OP_NO_TLSv1_2
- put(Identifier::fromString(vm, "SSL_OP_NO_TLSv1_2"_s), jsNumber(SSL_OP_NO_TLSv1_2));
+ put(Identifier::fromString(vm, "SSL_OP_NO_TLSv1_2"_s),
+ jsNumber(SSL_OP_NO_TLSv1_2));
#endif
#ifdef SSL_OP_NO_TLSv1_3
- put(Identifier::fromString(vm, "SSL_OP_NO_TLSv1_3"_s), jsNumber(SSL_OP_NO_TLSv1_3));
+ put(Identifier::fromString(vm, "SSL_OP_NO_TLSv1_3"_s),
+ jsNumber(SSL_OP_NO_TLSv1_3));
#endif
#ifdef SSL_OP_PRIORITIZE_CHACHA
- put(Identifier::fromString(vm, "SSL_OP_PRIORITIZE_CHACHA"_s), jsNumber(SSL_OP_PRIORITIZE_CHACHA));
+ put(Identifier::fromString(vm, "SSL_OP_PRIORITIZE_CHACHA"_s),
+ jsNumber(SSL_OP_PRIORITIZE_CHACHA));
#endif
#ifdef SSL_OP_TLS_ROLLBACK_BUG
- put(Identifier::fromString(vm, "SSL_OP_TLS_ROLLBACK_BUG"_s), jsNumber(SSL_OP_TLS_ROLLBACK_BUG));
+ put(Identifier::fromString(vm, "SSL_OP_TLS_ROLLBACK_BUG"_s),
+ jsNumber(SSL_OP_TLS_ROLLBACK_BUG));
#endif
#ifndef OPENSSL_NO_ENGINE
#ifdef ENGINE_METHOD_RSA
- put(Identifier::fromString(vm, "ENGINE_METHOD_RSA"_s), jsNumber(ENGINE_METHOD_RSA));
+ put(Identifier::fromString(vm, "ENGINE_METHOD_RSA"_s),
+ jsNumber(ENGINE_METHOD_RSA));
#endif
#ifdef ENGINE_METHOD_DSA
- put(Identifier::fromString(vm, "ENGINE_METHOD_DSA"_s), jsNumber(ENGINE_METHOD_DSA));
+ put(Identifier::fromString(vm, "ENGINE_METHOD_DSA"_s),
+ jsNumber(ENGINE_METHOD_DSA));
#endif
#ifdef ENGINE_METHOD_DH
- put(Identifier::fromString(vm, "ENGINE_METHOD_DH"_s), jsNumber(ENGINE_METHOD_DH));
+ put(Identifier::fromString(vm, "ENGINE_METHOD_DH"_s),
+ jsNumber(ENGINE_METHOD_DH));
#endif
#ifdef ENGINE_METHOD_RAND
- put(Identifier::fromString(vm, "ENGINE_METHOD_RAND"_s), jsNumber(ENGINE_METHOD_RAND));
+ put(Identifier::fromString(vm, "ENGINE_METHOD_RAND"_s),
+ jsNumber(ENGINE_METHOD_RAND));
#endif
#ifdef ENGINE_METHOD_EC
- put(Identifier::fromString(vm, "ENGINE_METHOD_EC"_s), jsNumber(ENGINE_METHOD_EC));
+ put(Identifier::fromString(vm, "ENGINE_METHOD_EC"_s),
+ jsNumber(ENGINE_METHOD_EC));
#endif
#ifdef ENGINE_METHOD_CIPHERS
- put(Identifier::fromString(vm, "ENGINE_METHOD_CIPHERS"_s), jsNumber(ENGINE_METHOD_CIPHERS));
+ put(Identifier::fromString(vm, "ENGINE_METHOD_CIPHERS"_s),
+ jsNumber(ENGINE_METHOD_CIPHERS));
#endif
#ifdef ENGINE_METHOD_DIGESTS
- put(Identifier::fromString(vm, "ENGINE_METHOD_DIGESTS"_s), jsNumber(ENGINE_METHOD_DIGESTS));
+ put(Identifier::fromString(vm, "ENGINE_METHOD_DIGESTS"_s),
+ jsNumber(ENGINE_METHOD_DIGESTS));
#endif
#ifdef ENGINE_METHOD_PKEY_METHS
- put(Identifier::fromString(vm, "ENGINE_METHOD_PKEY_METHS"_s), jsNumber(ENGINE_METHOD_PKEY_METHS));
+ put(Identifier::fromString(vm, "ENGINE_METHOD_PKEY_METHS"_s),
+ jsNumber(ENGINE_METHOD_PKEY_METHS));
#endif
#ifdef ENGINE_METHOD_PKEY_ASN1_METHS
- put(Identifier::fromString(vm, "ENGINE_METHOD_PKEY_ASN1_METHS"_s), jsNumber(ENGINE_METHOD_PKEY_ASN1_METHS));
+ put(Identifier::fromString(vm, "ENGINE_METHOD_PKEY_ASN1_METHS"_s),
+ jsNumber(ENGINE_METHOD_PKEY_ASN1_METHS));
#endif
#ifdef ENGINE_METHOD_ALL
- put(Identifier::fromString(vm, "ENGINE_METHOD_ALL"_s), jsNumber(ENGINE_METHOD_ALL));
+ put(Identifier::fromString(vm, "ENGINE_METHOD_ALL"_s),
+ jsNumber(ENGINE_METHOD_ALL));
#endif
#ifdef ENGINE_METHOD_NONE
- put(Identifier::fromString(vm, "ENGINE_METHOD_NONE"_s), jsNumber(ENGINE_METHOD_NONE));
+ put(Identifier::fromString(vm, "ENGINE_METHOD_NONE"_s),
+ jsNumber(ENGINE_METHOD_NONE));
#endif
#endif // !OPENSSL_NO_ENGINE
#ifdef DH_CHECK_P_NOT_SAFE_PRIME
- put(Identifier::fromString(vm, "DH_CHECK_P_NOT_SAFE_PRIME"_s), jsNumber(DH_CHECK_P_NOT_SAFE_PRIME));
+ put(Identifier::fromString(vm, "DH_CHECK_P_NOT_SAFE_PRIME"_s),
+ jsNumber(DH_CHECK_P_NOT_SAFE_PRIME));
#endif
#ifdef DH_CHECK_P_NOT_PRIME
- put(Identifier::fromString(vm, "DH_CHECK_P_NOT_PRIME"_s), jsNumber(DH_CHECK_P_NOT_PRIME));
+ put(Identifier::fromString(vm, "DH_CHECK_P_NOT_PRIME"_s),
+ jsNumber(DH_CHECK_P_NOT_PRIME));
#endif
#ifdef DH_UNABLE_TO_CHECK_GENERATOR
- put(Identifier::fromString(vm, "DH_UNABLE_TO_CHECK_GENERATOR"_s), jsNumber(DH_UNABLE_TO_CHECK_GENERATOR));
+ put(Identifier::fromString(vm, "DH_UNABLE_TO_CHECK_GENERATOR"_s),
+ jsNumber(DH_UNABLE_TO_CHECK_GENERATOR));
#endif
#ifdef DH_NOT_SUITABLE_GENERATOR
- put(Identifier::fromString(vm, "DH_NOT_SUITABLE_GENERATOR"_s), jsNumber(DH_NOT_SUITABLE_GENERATOR));
+ put(Identifier::fromString(vm, "DH_NOT_SUITABLE_GENERATOR"_s),
+ jsNumber(DH_NOT_SUITABLE_GENERATOR));
#endif
#ifdef RSA_PKCS1_PADDING
- put(Identifier::fromString(vm, "RSA_PKCS1_PADDING"_s), jsNumber(RSA_PKCS1_PADDING));
+ put(Identifier::fromString(vm, "RSA_PKCS1_PADDING"_s),
+ jsNumber(RSA_PKCS1_PADDING));
#endif
#ifdef RSA_SSLV23_PADDING
- put(Identifier::fromString(vm, "RSA_SSLV23_PADDING"_s), jsNumber(RSA_SSLV23_PADDING));
+ put(Identifier::fromString(vm, "RSA_SSLV23_PADDING"_s),
+ jsNumber(RSA_SSLV23_PADDING));
#endif
#ifdef RSA_NO_PADDING
- put(Identifier::fromString(vm, "RSA_NO_PADDING"_s), jsNumber(RSA_NO_PADDING));
+ put(Identifier::fromString(vm, "RSA_NO_PADDING"_s), jsNumber(RSA_NO_PADDING));
#endif
#ifdef RSA_PKCS1_OAEP_PADDING
- put(Identifier::fromString(vm, "RSA_PKCS1_OAEP_PADDING"_s), jsNumber(RSA_PKCS1_OAEP_PADDING));
+ put(Identifier::fromString(vm, "RSA_PKCS1_OAEP_PADDING"_s),
+ jsNumber(RSA_PKCS1_OAEP_PADDING));
#endif
#ifdef RSA_X931_PADDING
- put(Identifier::fromString(vm, "RSA_X931_PADDING"_s), jsNumber(RSA_X931_PADDING));
+ put(Identifier::fromString(vm, "RSA_X931_PADDING"_s),
+ jsNumber(RSA_X931_PADDING));
#endif
#ifdef RSA_PKCS1_PSS_PADDING
- put(Identifier::fromString(vm, "RSA_PKCS1_PSS_PADDING"_s), jsNumber(RSA_PKCS1_PSS_PADDING));
+ put(Identifier::fromString(vm, "RSA_PKCS1_PSS_PADDING"_s),
+ jsNumber(RSA_PKCS1_PSS_PADDING));
#endif
#ifdef RSA_PSS_SALTLEN_DIGEST
- put(Identifier::fromString(vm, "RSA_PSS_SALTLEN_DIGEST"_s), jsNumber(RSA_PSS_SALTLEN_DIGEST));
+ put(Identifier::fromString(vm, "RSA_PSS_SALTLEN_DIGEST"_s),
+ jsNumber(RSA_PSS_SALTLEN_DIGEST));
#endif
#ifdef RSA_PSS_SALTLEN_MAX_SIGN
- put(Identifier::fromString(vm, "RSA_PSS_SALTLEN_MAX_SIGN"_s), jsNumber(RSA_PSS_SALTLEN_MAX_SIGN));
+ put(Identifier::fromString(vm, "RSA_PSS_SALTLEN_MAX_SIGN"_s),
+ jsNumber(RSA_PSS_SALTLEN_MAX_SIGN));
#endif
#ifdef RSA_PSS_SALTLEN_AUTO
- put(Identifier::fromString(vm, "RSA_PSS_SALTLEN_AUTO"_s), jsNumber(RSA_PSS_SALTLEN_AUTO));
-#endif
- auto cipherList = String("TLS_AES_256_GCM_SHA384:"
- "TLS_CHACHA20_POLY1305_SHA256:"
- "TLS_AES_128_GCM_SHA256:"
- "ECDHE-RSA-AES128-GCM-SHA256:"
- "ECDHE-ECDSA-AES128-GCM-SHA256:"
- "ECDHE-RSA-AES256-GCM-SHA384:"
- "ECDHE-ECDSA-AES256-GCM-SHA384:"
- "DHE-RSA-AES128-GCM-SHA256:"
- "ECDHE-RSA-AES128-SHA256:"
- "DHE-RSA-AES128-SHA256:"
- "ECDHE-RSA-AES256-SHA384:"
- "DHE-RSA-AES256-SHA384:"
- "ECDHE-RSA-AES256-SHA256:"
- "DHE-RSA-AES256-SHA256:"
- "HIGH:"
- "!aNULL:"
- "!eNULL:"
- "!EXPORT:"
- "!DES:"
- "!RC4:"
- "!MD5:"
- "!PSK:"
- "!SRP:"
- "!CAMELLIA"_s);
- put(Identifier::fromString(vm, "defaultCoreCipherList"_s),
- jsString(vm, cipherList));
- put(Identifier::fromString(vm, "defaultCipherList"_s),
- jsString(vm, cipherList));
+ put(Identifier::fromString(vm, "RSA_PSS_SALTLEN_AUTO"_s),
+ jsNumber(RSA_PSS_SALTLEN_AUTO));
+#endif
+ auto cipherList = String("TLS_AES_256_GCM_SHA384:"
+ "TLS_CHACHA20_POLY1305_SHA256:"
+ "TLS_AES_128_GCM_SHA256:"
+ "ECDHE-RSA-AES128-GCM-SHA256:"
+ "ECDHE-ECDSA-AES128-GCM-SHA256:"
+ "ECDHE-RSA-AES256-GCM-SHA384:"
+ "ECDHE-ECDSA-AES256-GCM-SHA384:"
+ "DHE-RSA-AES128-GCM-SHA256:"
+ "ECDHE-RSA-AES128-SHA256:"
+ "DHE-RSA-AES128-SHA256:"
+ "ECDHE-RSA-AES256-SHA384:"
+ "DHE-RSA-AES256-SHA384:"
+ "ECDHE-RSA-AES256-SHA256:"
+ "DHE-RSA-AES256-SHA256:"
+ "HIGH:"
+ "!aNULL:"
+ "!eNULL:"
+ "!EXPORT:"
+ "!DES:"
+ "!RC4:"
+ "!MD5:"
+ "!PSK:"
+ "!SRP:"
+ "!CAMELLIA"_s);
+ put(Identifier::fromString(vm, "defaultCoreCipherList"_s),
+ jsString(vm, cipherList));
+ put(Identifier::fromString(vm, "defaultCipherList"_s),
+ jsString(vm, cipherList));
#ifdef TLS1_VERSION
- put(Identifier::fromString(vm, "TLS1_VERSION"_s), jsNumber(TLS1_VERSION));
+ put(Identifier::fromString(vm, "TLS1_VERSION"_s), jsNumber(TLS1_VERSION));
#endif
#ifdef TLS1_1_VERSION
- put(Identifier::fromString(vm, "TLS1_1_VERSION"_s), jsNumber(TLS1_1_VERSION));
+ put(Identifier::fromString(vm, "TLS1_1_VERSION"_s), jsNumber(TLS1_1_VERSION));
#endif
#ifdef TLS1_2_VERSION
- put(Identifier::fromString(vm, "TLS1_2_VERSION"_s), jsNumber(TLS1_2_VERSION));
+ put(Identifier::fromString(vm, "TLS1_2_VERSION"_s), jsNumber(TLS1_2_VERSION));
#endif
#ifdef TLS1_3_VERSION
- put(Identifier::fromString(vm, "TLS1_3_VERSION"_s), jsNumber(TLS1_3_VERSION));
-#endif
- put(Identifier::fromString(vm, "POINT_CONVERSION_COMPRESSED"_s), jsNumber(POINT_CONVERSION_COMPRESSED));
- put(Identifier::fromString(vm, "POINT_CONVERSION_UNCOMPRESSED"_s), jsNumber(POINT_CONVERSION_UNCOMPRESSED));
- put(Identifier::fromString(vm, "POINT_CONVERSION_HYBRID"_s), jsNumber(POINT_CONVERSION_HYBRID));
- RETURN_NATIVE_MODULE();
+ put(Identifier::fromString(vm, "TLS1_3_VERSION"_s), jsNumber(TLS1_3_VERSION));
+#endif
+ put(Identifier::fromString(vm, "POINT_CONVERSION_COMPRESSED"_s),
+ jsNumber(POINT_CONVERSION_COMPRESSED));
+ put(Identifier::fromString(vm, "POINT_CONVERSION_UNCOMPRESSED"_s),
+ jsNumber(POINT_CONVERSION_UNCOMPRESSED));
+ put(Identifier::fromString(vm, "POINT_CONVERSION_HYBRID"_s),
+ jsNumber(POINT_CONVERSION_HYBRID));
+
+ // RETURN_NATIVE_MODULE();
}
} // namespace Zig
diff --git a/src/bun.js/modules/NodeModuleModule.h b/src/bun.js/modules/NodeModuleModule.h
index b3c34eb5e..804d1dd9d 100644
--- a/src/bun.js/modules/NodeModuleModule.h
+++ b/src/bun.js/modules/NodeModuleModule.h
@@ -1,8 +1,11 @@
+#pragma once
+
#include "CommonJSModuleRecord.h"
#include "ImportMetaObject.h"
#include "JavaScriptCore/JSBoundFunction.h"
#include "JavaScriptCore/ObjectConstructor.h"
#include "_NativeModule.h"
+#include "isBuiltinModule.h"
using namespace Zig;
using namespace JSC;
@@ -88,18 +91,6 @@ static constexpr ASCIILiteral builtinModuleNames[] = {
"zlib"_s,
};
-static bool isBuiltinModule(const String &namePossiblyWithNodePrefix) {
- String name = namePossiblyWithNodePrefix;
- if (name.startsWith("node:"_s))
- name = name.substringSharingImpl(5);
-
- for (auto &builtinModule : builtinModuleNames) {
- if (name == builtinModule)
- return true;
- }
- return false;
-}
-
JSC_DEFINE_HOST_FUNCTION(jsFunctionNodeModuleModuleConstructor,
(JSC::JSGlobalObject * globalObject,
JSC::CallFrame *callFrame)) {
@@ -158,7 +149,7 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionIsBuiltinModule,
auto moduleStr = moduleName.toWTFString(globalObject);
RETURN_IF_EXCEPTION(scope, JSValue::encode(jsBoolean(false)));
- return JSValue::encode(jsBoolean(isBuiltinModule(moduleStr)));
+ return JSValue::encode(jsBoolean(Bun::isBuiltinModule(moduleStr)));
}
JSC_DEFINE_HOST_FUNCTION(jsFunctionWrap, (JSC::JSGlobalObject * globalObject,
@@ -304,6 +295,39 @@ JSC_DEFINE_CUSTOM_SETTER(set_resolveFilename,
return false;
}
+// These two setters are only used if you directly hit
+// `Module.prototype.require` or `module.require`. When accessing the cjs
+// require argument, this is a bound version of `require`, which calls into the
+// overridden one.
+//
+// This require function also intentionally does not have .resolve on it, nor
+// does it have any of the other properties.
+//
+// Note: allowing require to be overridable at all is only needed for Next.js to
+// work (they do Module.prototype.require = ...)
+
+JSC_DEFINE_CUSTOM_GETTER(getterRequireFunction,
+ (JSC::JSGlobalObject * globalObject,
+ JSC::EncodedJSValue thisValue, JSC::PropertyName)) {
+ return JSValue::encode(globalObject->getDirect(
+ globalObject->vm(), WebCore::clientData(globalObject->vm())
+ ->builtinNames()
+ .overridableRequirePrivateName()));
+}
+
+JSC_DEFINE_CUSTOM_SETTER(setterRequireFunction,
+ (JSC::JSGlobalObject * globalObject,
+ JSC::EncodedJSValue thisValue,
+ JSC::EncodedJSValue value,
+ JSC::PropertyName propertyName)) {
+ globalObject->putDirect(globalObject->vm(),
+ WebCore::clientData(globalObject->vm())
+ ->builtinNames()
+ .overridableRequirePrivateName(),
+ JSValue::decode(value), 0);
+ return true;
+}
+
namespace Zig {
DEFINE_NATIVE_MODULE(NodeModule) {
@@ -330,13 +354,18 @@ DEFINE_NATIVE_MODULE(NodeModule) {
exportNames.append(name);
exportValues.append(value);
};
- exportNames.reserveCapacity(15);
- exportValues.ensureCapacity(15);
+ exportNames.reserveCapacity(16);
+ exportValues.ensureCapacity(16);
exportNames.append(vm.propertyNames->defaultKeyword);
exportValues.append(defaultObject);
put(Identifier::fromString(vm, "Module"_s), defaultObject);
+ // Module._extensions === require.extensions
+ put(Identifier::fromString(vm, "_extensions"_s),
+ globalObject->requireFunctionUnbound()->get(
+ globalObject, Identifier::fromString(vm, "extensions"_s)));
+
defaultObject->putDirectCustomAccessor(
vm, JSC::Identifier::fromString(vm, "_resolveFilename"_s),
JSC::CustomGetterSetter::create(vm, get_resolveFilename,
@@ -366,8 +395,15 @@ DEFINE_NATIVE_MODULE(NodeModule) {
put(Identifier::fromString(vm, "globalPaths"_s),
constructEmptyArray(globalObject, nullptr, 0));
- put(Identifier::fromString(vm, "prototype"_s),
- constructEmptyObject(globalObject));
+ auto prototype =
+ constructEmptyObject(globalObject, globalObject->objectPrototype(), 1);
+ prototype->putDirectCustomAccessor(
+ vm, JSC::Identifier::fromString(vm, "require"_s),
+ JSC::CustomGetterSetter::create(vm, getterRequireFunction,
+ setterRequireFunction),
+ 0);
+
+ defaultObject->putDirect(vm, vm.propertyNames->prototype, prototype);
JSC::JSArray *builtinModules = JSC::JSArray::create(
vm,
@@ -381,8 +417,6 @@ DEFINE_NATIVE_MODULE(NodeModule) {
}
put(JSC::Identifier::fromString(vm, "builtinModules"_s), builtinModules);
-
- RETURN_NATIVE_MODULE();
}
} // namespace Zig
diff --git a/src/bun.js/modules/NodeUtilTypesModule.h b/src/bun.js/modules/NodeUtilTypesModule.h
index de9b147a4..e0b990603 100644
--- a/src/bun.js/modules/NodeUtilTypesModule.h
+++ b/src/bun.js/modules/NodeUtilTypesModule.h
@@ -203,7 +203,10 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionIsWeakSet, (JSC::JSGlobalObject * globalObjec
JSC_DEFINE_HOST_FUNCTION(jsFunctionIsArrayBuffer, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callframe))
{
GET_FIRST_CELL
- return JSValue::encode(jsBoolean(jsDynamicCast<JSArrayBuffer*>(cell) != nullptr));
+ auto* arrayBuffer = jsDynamicCast<JSArrayBuffer*>(cell);
+ if (!arrayBuffer)
+ return JSValue::encode(jsBoolean(false));
+ return JSValue::encode(jsBoolean(!arrayBuffer->isShared()));
}
JSC_DEFINE_HOST_FUNCTION(jsFunctionIsDataView, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callframe))
{
diff --git a/src/bun.js/modules/_NativeModule.h b/src/bun.js/modules/_NativeModule.h
index b23906ad0..6d3d76176 100644
--- a/src/bun.js/modules/_NativeModule.h
+++ b/src/bun.js/modules/_NativeModule.h
@@ -40,18 +40,19 @@
// that what you passed to INIT_NATIVE_MODULE is indeed correct.
#define RETURN_NATIVE_MODULE() \
ASSERT_WITH_MESSAGE(numberOfActualExportNames == passedNumberOfExportNames, \
- "NATIVE_MODULE_START() was given the incorrect value.");
+ "NATIVE_MODULE_START() was should be given %d", numberOfActualExportNames);
-#define __NATIVE_MODULE_ASSERT_DECL \
+#define __NATIVE_MODULE_ASSERT_DECL(numberOfExportNames) \
int numberOfActualExportNames = 0; \
int passedNumberOfExportNames = numberOfExportNames; \
+
#define __NATIVE_MODULE_ASSERT_INCR numberOfActualExportNames++;
#else
#define RETURN_NATIVE_MODULE() ;
#define __NATIVE_MODULE_ASSERT_INCR ;
-#define __NATIVE_MODULE_ASSERT_DECL ;
+#define __NATIVE_MODULE_ASSERT_DECL(numberOfExportNames) ;
#endif
@@ -67,7 +68,7 @@
JSC::VM &vm = globalObject->vm(); \
JSC::JSObject *defaultObject = JSC::constructEmptyObject( \
globalObject, globalObject->objectPrototype(), numberOfExportNames); \
- __NATIVE_MODULE_ASSERT_DECL \
+ __NATIVE_MODULE_ASSERT_DECL(numberOfExportNames); \
auto put = [&](JSC::Identifier name, JSC::JSValue value) { \
defaultObject->putDirect(vm, name, value); \
exportNames.append(name); \
diff --git a/src/bun.js/node/node_fs.zig b/src/bun.js/node/node_fs.zig
index d9e3ed119..173f750a5 100644
--- a/src/bun.js/node/node_fs.zig
+++ b/src/bun.js/node/node_fs.zig
@@ -55,468 +55,151 @@ else
// TODO:
0;
+const SliceWithUnderlyingStringOrBuffer = JSC.Node.SliceWithUnderlyingStringOrBuffer;
const ArrayBuffer = JSC.MarkedArrayBuffer;
const Buffer = JSC.Buffer;
const FileSystemFlags = JSC.Node.FileSystemFlags;
+pub const Async = struct {
+ pub const access = NewAsyncFSTask(Return.Access, Arguments.Access, NodeFS.access);
+ pub const appendFile = NewAsyncFSTask(Return.AppendFile, Arguments.AppendFile, NodeFS.appendFile);
+ pub const chmod = NewAsyncFSTask(Return.Chmod, Arguments.Chmod, NodeFS.chmod);
+ pub const chown = NewAsyncFSTask(Return.Chown, Arguments.Chown, NodeFS.chown);
+ pub const close = NewAsyncFSTask(Return.Close, Arguments.Close, NodeFS.close);
+ pub const copyFile = NewAsyncFSTask(Return.CopyFile, Arguments.CopyFile, NodeFS.copyFile);
+ pub const exists = NewAsyncFSTask(Return.Exists, Arguments.Exists, NodeFS.exists);
+ pub const fchmod = NewAsyncFSTask(Return.Fchmod, Arguments.FChmod, NodeFS.fchmod);
+ pub const fchown = NewAsyncFSTask(Return.Fchown, Arguments.Fchown, NodeFS.fchown);
+ pub const fdatasync = NewAsyncFSTask(Return.Fdatasync, Arguments.FdataSync, NodeFS.fdatasync);
+ pub const fstat = NewAsyncFSTask(Return.Fstat, Arguments.Fstat, NodeFS.fstat);
+ pub const fsync = NewAsyncFSTask(Return.Fsync, Arguments.Fsync, NodeFS.fsync);
+ pub const ftruncate = NewAsyncFSTask(Return.Ftruncate, Arguments.FTruncate, NodeFS.ftruncate);
+ pub const futimes = NewAsyncFSTask(Return.Futimes, Arguments.Futimes, NodeFS.futimes);
+ pub const lchmod = NewAsyncFSTask(Return.Lchmod, Arguments.LCHmod, NodeFS.lchmod);
+ pub const lchown = NewAsyncFSTask(Return.Lchown, Arguments.LChown, NodeFS.lchown);
+ pub const link = NewAsyncFSTask(Return.Link, Arguments.Link, NodeFS.link);
+ pub const lstat = NewAsyncFSTask(Return.Stat, Arguments.Stat, NodeFS.lstat);
+ pub const lutimes = NewAsyncFSTask(Return.Lutimes, Arguments.Lutimes, NodeFS.lutimes);
+ pub const mkdir = NewAsyncFSTask(Return.Mkdir, Arguments.Mkdir, NodeFS.mkdir);
+ pub const mkdtemp = NewAsyncFSTask(Return.Mkdtemp, Arguments.MkdirTemp, NodeFS.mkdtemp);
+ pub const open = NewAsyncFSTask(Return.Open, Arguments.Open, NodeFS.open);
+ pub const read = NewAsyncFSTask(Return.Read, Arguments.Read, NodeFS.read);
+ pub const readdir = NewAsyncFSTask(Return.Readdir, Arguments.Readdir, NodeFS.readdir);
+ pub const readFile = NewAsyncFSTask(Return.ReadFile, Arguments.ReadFile, NodeFS.readFile);
+ pub const readlink = NewAsyncFSTask(Return.Readlink, Arguments.Readlink, NodeFS.readlink);
+ pub const readv = NewAsyncFSTask(Return.Readv, Arguments.Readv, NodeFS.readv);
+ pub const realpath = NewAsyncFSTask(Return.Realpath, Arguments.Realpath, NodeFS.realpath);
+ pub const rename = NewAsyncFSTask(Return.Rename, Arguments.Rename, NodeFS.rename);
+ pub const rm = NewAsyncFSTask(Return.Rm, Arguments.Rm, NodeFS.rm);
+ pub const rmdir = NewAsyncFSTask(Return.Rmdir, Arguments.RmDir, NodeFS.rmdir);
+ pub const stat = NewAsyncFSTask(Return.Stat, Arguments.Stat, NodeFS.stat);
+ pub const symlink = NewAsyncFSTask(Return.Symlink, Arguments.Symlink, NodeFS.symlink);
+ pub const truncate = NewAsyncFSTask(Return.Truncate, Arguments.Truncate, NodeFS.truncate);
+ pub const unlink = NewAsyncFSTask(Return.Unlink, Arguments.Unlink, NodeFS.unlink);
+ pub const utimes = NewAsyncFSTask(Return.Utimes, Arguments.Utimes, NodeFS.utimes);
+ pub const write = NewAsyncFSTask(Return.Write, Arguments.Write, NodeFS.write);
+ pub const writeFile = NewAsyncFSTask(Return.WriteFile, Arguments.WriteFile, NodeFS.writeFile);
+ pub const writev = NewAsyncFSTask(Return.Writev, Arguments.Writev, NodeFS.writev);
+
+ pub const cp = AsyncCpTask;
+
+ fn NewAsyncFSTask(comptime ReturnType: type, comptime ArgumentType: type, comptime Function: anytype) type {
+ return struct {
+ promise: JSC.JSPromise.Strong,
+ args: ArgumentType,
+ globalObject: *JSC.JSGlobalObject,
+ task: JSC.WorkPoolTask = .{ .callback = &workPoolCallback },
+ result: JSC.Maybe(ReturnType),
+ ref: JSC.PollRef = .{},
+ tracker: JSC.AsyncTaskTracker,
+
+ pub const Task = @This();
+
+ pub fn create(
+ globalObject: *JSC.JSGlobalObject,
+ args: ArgumentType,
+ vm: *JSC.VirtualMachine,
+ ) JSC.JSValue {
+ var task = bun.default_allocator.create(Task) catch @panic("out of memory");
+ task.* = Task{
+ .promise = JSC.JSPromise.Strong.init(globalObject),
+ .args = args,
+ .result = undefined,
+ .globalObject = globalObject,
+ .tracker = JSC.AsyncTaskTracker.init(vm),
+ };
+ task.ref.ref(vm);
+ task.args.toThreadSafe();
+ task.tracker.didSchedule(globalObject);
+ JSC.WorkPool.schedule(&task.task);
-pub const AsyncReaddirTask = struct {
- promise: JSC.JSPromise.Strong,
- args: Arguments.Readdir,
- globalObject: *JSC.JSGlobalObject,
- task: JSC.WorkPoolTask = .{ .callback = &workPoolCallback },
- result: JSC.Maybe(Return.Readdir),
- ref: JSC.PollRef = .{},
- arena: bun.ArenaAllocator,
- tracker: JSC.AsyncTaskTracker,
-
- pub fn create(globalObject: *JSC.JSGlobalObject, readdir_args: Arguments.Readdir, vm: *JSC.VirtualMachine, arena: bun.ArenaAllocator) JSC.JSValue {
- var task = bun.default_allocator.create(AsyncReaddirTask) catch @panic("out of memory");
- task.* = AsyncReaddirTask{
- .promise = JSC.JSPromise.Strong.init(globalObject),
- .args = readdir_args,
- .result = undefined,
- .globalObject = globalObject,
- .arena = arena,
- .tracker = JSC.AsyncTaskTracker.init(vm),
- };
- task.ref.ref(vm);
- task.args.path.toThreadSafe();
- task.tracker.didSchedule(globalObject);
- JSC.WorkPool.schedule(&task.task);
-
- return task.promise.value();
- }
-
- fn workPoolCallback(task: *JSC.WorkPoolTask) void {
- var this: *AsyncReaddirTask = @fieldParentPtr(AsyncReaddirTask, "task", task);
-
- var node_fs = NodeFS{};
- this.result = node_fs.readdir(this.args, .promise);
-
- if (this.result == .err) {
- this.result.err.path = bun.default_allocator.dupe(u8, this.result.err.path) catch "";
- }
-
- this.globalObject.bunVMConcurrently().eventLoop().enqueueTaskConcurrent(JSC.ConcurrentTask.fromCallback(this, runFromJSThread));
- }
-
- fn runFromJSThread(this: *AsyncReaddirTask) void {
- var globalObject = this.globalObject;
-
- var success = @as(JSC.Maybe(Return.Readdir).Tag, this.result) == .result;
- const result = switch (this.result) {
- .err => |err| err.toJSC(globalObject),
- .result => |res| brk: {
- var exceptionref: JSC.C.JSValueRef = null;
- const out = JSC.JSValue.c(JSC.To.JS.withType(Return.Readdir, res, globalObject, &exceptionref));
- const exception = JSC.JSValue.c(exceptionref);
- if (exception != .zero) {
- success = false;
- break :brk exception;
- }
-
- break :brk out;
- },
- };
- var promise_value = this.promise.value();
- var promise = this.promise.get();
- promise_value.ensureStillAlive();
-
- const tracker = this.tracker;
- this.deinit();
-
- tracker.willDispatch(globalObject);
- defer tracker.didDispatch(globalObject);
- switch (success) {
- false => {
- promise.reject(globalObject, result);
- },
- true => {
- promise.resolve(globalObject, result);
- },
- }
- }
-
- pub fn deinit(this: *AsyncReaddirTask) void {
- this.ref.unref(this.globalObject.bunVM());
- this.args.deinitAndUnprotect();
- this.promise.strong.deinit();
- this.arena.deinit();
- bun.default_allocator.destroy(this);
- }
-};
-
-pub const AsyncStatTask = struct {
- promise: JSC.JSPromise.Strong,
- args: Arguments.Stat,
- globalObject: *JSC.JSGlobalObject,
- task: JSC.WorkPoolTask = .{ .callback = &workPoolCallback },
- result: JSC.Maybe(Return.Stat),
- ref: JSC.PollRef = .{},
- is_lstat: bool = false,
- arena: bun.ArenaAllocator,
- tracker: JSC.AsyncTaskTracker,
-
- pub fn create(
- globalObject: *JSC.JSGlobalObject,
- readdir_args: Arguments.Stat,
- vm: *JSC.VirtualMachine,
- is_lstat: bool,
- arena: bun.ArenaAllocator,
- ) JSC.JSValue {
- var task = bun.default_allocator.create(AsyncStatTask) catch @panic("out of memory");
- task.* = AsyncStatTask{
- .promise = JSC.JSPromise.Strong.init(globalObject),
- .args = readdir_args,
- .result = undefined,
- .globalObject = globalObject,
- .is_lstat = is_lstat,
- .tracker = JSC.AsyncTaskTracker.init(vm),
- .arena = arena,
- };
- task.ref.ref(vm);
- task.args.path.toThreadSafe();
- task.tracker.didSchedule(globalObject);
-
- JSC.WorkPool.schedule(&task.task);
-
- return task.promise.value();
- }
+ return task.promise.value();
+ }
- fn workPoolCallback(task: *JSC.WorkPoolTask) void {
- var this: *AsyncStatTask = @fieldParentPtr(AsyncStatTask, "task", task);
+ fn workPoolCallback(task: *JSC.WorkPoolTask) void {
+ var this: *Task = @fieldParentPtr(Task, "task", task);
- var node_fs = NodeFS{};
- this.result = if (this.is_lstat)
- node_fs.lstat(this.args, .promise)
- else
- node_fs.stat(this.args, .promise);
+ var node_fs = NodeFS{};
+ this.result = Function(&node_fs, this.args, .promise);
- this.globalObject.bunVMConcurrently().eventLoop().enqueueTaskConcurrent(JSC.ConcurrentTask.fromCallback(this, runFromJSThread));
- }
-
- fn runFromJSThread(this: *AsyncStatTask) void {
- var globalObject = this.globalObject;
- var success = @as(JSC.Maybe(Return.Lstat).Tag, this.result) == .result;
- const result = switch (this.result) {
- .err => |err| err.toJSC(globalObject),
- .result => |res| brk: {
- var exceptionref: JSC.C.JSValueRef = null;
- const out = JSC.JSValue.c(JSC.To.JS.withType(Return.Lstat, res, globalObject, &exceptionref));
- const exception = JSC.JSValue.c(exceptionref);
- if (exception != .zero) {
- success = false;
- break :brk exception;
+ if (this.result == .err) {
+ this.result.err.path = bun.default_allocator.dupe(u8, this.result.err.path) catch "";
+ std.mem.doNotOptimizeAway(&node_fs);
}
- break :brk out;
- },
- };
- var promise_value = this.promise.value();
- var promise = this.promise.get();
- promise_value.ensureStillAlive();
-
- const tracker = this.tracker;
- tracker.willDispatch(globalObject);
- defer tracker.didDispatch(globalObject);
-
- this.deinit();
- switch (success) {
- false => {
- promise.reject(globalObject, result);
- },
- true => {
- promise.resolve(globalObject, result);
- },
- }
- }
-
- pub fn deinit(this: *AsyncStatTask) void {
- this.ref.unref(this.globalObject.bunVM());
- this.args.deinitAndUnprotect();
- this.promise.strong.deinit();
- this.arena.deinit();
- bun.default_allocator.destroy(this);
- }
-};
-
-pub const AsyncRealpathTask = struct {
- promise: JSC.JSPromise.Strong,
- args: Arguments.Realpath,
- globalObject: *JSC.JSGlobalObject,
- task: JSC.WorkPoolTask = .{ .callback = &workPoolCallback },
- result: JSC.Maybe(Return.Realpath),
- ref: JSC.PollRef = .{},
- arena: bun.ArenaAllocator,
- tracker: JSC.AsyncTaskTracker,
-
- pub fn create(
- globalObject: *JSC.JSGlobalObject,
- args: Arguments.Realpath,
- vm: *JSC.VirtualMachine,
- arena: bun.ArenaAllocator,
- ) JSC.JSValue {
- var task = bun.default_allocator.create(AsyncRealpathTask) catch @panic("out of memory");
- task.* = AsyncRealpathTask{
- .promise = JSC.JSPromise.Strong.init(globalObject),
- .args = args,
- .result = undefined,
- .globalObject = globalObject,
- .arena = arena,
- .tracker = JSC.AsyncTaskTracker.init(vm),
- };
- task.ref.ref(vm);
- task.args.path.toThreadSafe();
- task.tracker.didSchedule(globalObject);
- JSC.WorkPool.schedule(&task.task);
-
- return task.promise.value();
- }
-
- fn workPoolCallback(task: *JSC.WorkPoolTask) void {
- var this: *AsyncRealpathTask = @fieldParentPtr(AsyncRealpathTask, "task", task);
-
- var node_fs = NodeFS{};
- this.result = node_fs.realpath(this.args, .promise);
-
- if (this.result == .err) {
- this.result.err.path = bun.default_allocator.dupe(u8, this.result.err.path) catch "";
- }
+ this.globalObject.bunVMConcurrently().eventLoop().enqueueTaskConcurrent(JSC.ConcurrentTask.create(JSC.Task.init(this)));
+ }
- this.globalObject.bunVMConcurrently().eventLoop().enqueueTaskConcurrent(JSC.ConcurrentTask.fromCallback(this, runFromJSThread));
- }
+ pub fn runFromJSThread(this: *Task) void {
+ var globalObject = this.globalObject;
+ var success = @as(JSC.Maybe(ReturnType).Tag, this.result) == .result;
+ const result = switch (this.result) {
+ .err => |err| err.toJSC(globalObject),
+ .result => |res| brk: {
+ var exceptionref: JSC.C.JSValueRef = null;
+ const out = JSC.JSValue.c(JSC.To.JS.withType(ReturnType, res, globalObject, &exceptionref));
+ const exception = JSC.JSValue.c(exceptionref);
+ if (exception != .zero) {
+ success = false;
+ break :brk exception;
+ }
- fn runFromJSThread(this: *AsyncRealpathTask) void {
- var globalObject = this.globalObject;
- var success = @as(JSC.Maybe(Return.Realpath).Tag, this.result) == .result;
- const result = switch (this.result) {
- .err => |err| err.toJSC(globalObject),
- .result => |res| brk: {
- var exceptionref: JSC.C.JSValueRef = null;
- const out = JSC.JSValue.c(JSC.To.JS.withType(Return.Realpath, res, globalObject, &exceptionref));
- const exception = JSC.JSValue.c(exceptionref);
- if (exception != .zero) {
- success = false;
- break :brk exception;
+ break :brk out;
+ },
+ };
+ var promise_value = this.promise.value();
+ var promise = this.promise.get();
+ promise_value.ensureStillAlive();
+
+ const tracker = this.tracker;
+ tracker.willDispatch(globalObject);
+ defer tracker.didDispatch(globalObject);
+
+ this.deinit();
+ switch (success) {
+ false => {
+ promise.reject(globalObject, result);
+ },
+ true => {
+ promise.resolve(globalObject, result);
+ },
}
+ }
- break :brk out;
- },
- };
- var promise_value = this.promise.value();
- var promise = this.promise.get();
- promise_value.ensureStillAlive();
-
- const tracker = this.tracker;
- tracker.willDispatch(globalObject);
- defer tracker.didDispatch(globalObject);
-
- this.deinit();
- switch (success) {
- false => {
- promise.reject(globalObject, result);
- },
- true => {
- promise.resolve(globalObject, result);
- },
- }
- }
-
- pub fn deinit(this: *AsyncRealpathTask) void {
- if (this.result == .err) {
- bun.default_allocator.free(this.result.err.path);
- }
-
- this.ref.unref(this.globalObject.bunVM());
- this.args.deinitAndUnprotect();
- this.promise.strong.deinit();
- this.arena.deinit();
- bun.default_allocator.destroy(this);
- }
-};
-
-pub const AsyncReadFileTask = struct {
- promise: JSC.JSPromise.Strong,
- args: Arguments.ReadFile,
- globalObject: *JSC.JSGlobalObject,
- task: JSC.WorkPoolTask = .{ .callback = &workPoolCallback },
- result: JSC.Maybe(Return.ReadFile),
- ref: JSC.PollRef = .{},
- arena: bun.ArenaAllocator,
- tracker: JSC.AsyncTaskTracker,
-
- pub fn create(
- globalObject: *JSC.JSGlobalObject,
- args: Arguments.ReadFile,
- vm: *JSC.VirtualMachine,
- arena: bun.ArenaAllocator,
- ) JSC.JSValue {
- var task = bun.default_allocator.create(AsyncReadFileTask) catch @panic("out of memory");
- task.* = AsyncReadFileTask{
- .promise = JSC.JSPromise.Strong.init(globalObject),
- .args = args,
- .result = undefined,
- .globalObject = globalObject,
- .arena = arena,
- .tracker = JSC.AsyncTaskTracker.init(vm),
- };
- task.ref.ref(vm);
- task.args.path.toThreadSafe();
- task.tracker.didSchedule(globalObject);
- JSC.WorkPool.schedule(&task.task);
-
- return task.promise.value();
- }
-
- fn workPoolCallback(task: *JSC.WorkPoolTask) void {
- var this: *AsyncReadFileTask = @fieldParentPtr(AsyncReadFileTask, "task", task);
-
- var node_fs = NodeFS{};
- this.result = node_fs.readFile(this.args, .promise);
-
- if (this.result == .err) {
- this.result.err.path = bun.default_allocator.dupe(u8, this.result.err.path) catch "";
- }
-
- this.globalObject.bunVMConcurrently().eventLoop().enqueueTaskConcurrent(JSC.ConcurrentTask.fromCallback(this, runFromJSThread));
- }
-
- fn runFromJSThread(this: *AsyncReadFileTask) void {
- var globalObject = this.globalObject;
-
- var success = @as(JSC.Maybe(Return.ReadFile).Tag, this.result) == .result;
- const result = switch (this.result) {
- .err => |err| err.toJSC(globalObject),
- .result => |res| brk: {
- var exceptionref: JSC.C.JSValueRef = null;
- const out = JSC.JSValue.c(JSC.To.JS.withType(Return.ReadFile, res, globalObject, &exceptionref));
- const exception = JSC.JSValue.c(exceptionref);
- if (exception != .zero) {
- success = false;
- break :brk exception;
+ pub fn deinit(this: *Task) void {
+ if (this.result == .err) {
+ bun.default_allocator.free(this.result.err.path);
}
- break :brk out;
- },
- };
- var promise_value = this.promise.value();
- var promise = this.promise.get();
- promise_value.ensureStillAlive();
-
- const tracker = this.tracker;
- tracker.willDispatch(globalObject);
- defer tracker.didDispatch(globalObject);
-
- this.deinit();
- switch (success) {
- false => {
- promise.reject(globalObject, result);
- },
- true => {
- promise.resolve(globalObject, result);
- },
- }
- }
-
- pub fn deinit(this: *AsyncReadFileTask) void {
- this.ref.unref(this.globalObject.bunVM());
- this.args.deinitAndUnprotect();
- this.promise.strong.deinit();
- this.arena.deinit();
- bun.default_allocator.destroy(this);
- }
-};
-
-pub const AsyncCopyFileTask = struct {
- promise: JSC.JSPromise.Strong,
- args: Arguments.CopyFile,
- globalObject: *JSC.JSGlobalObject,
- task: JSC.WorkPoolTask = .{ .callback = &workPoolCallback },
- result: JSC.Maybe(Return.CopyFile),
- ref: JSC.PollRef = .{},
- arena: bun.ArenaAllocator,
- tracker: JSC.AsyncTaskTracker,
-
- pub fn create(
- globalObject: *JSC.JSGlobalObject,
- copyfile_args: Arguments.CopyFile,
- vm: *JSC.VirtualMachine,
- arena: bun.ArenaAllocator,
- ) JSC.JSValue {
- var task = bun.default_allocator.create(AsyncCopyFileTask) catch @panic("out of memory");
- task.* = AsyncCopyFileTask{
- .promise = JSC.JSPromise.Strong.init(globalObject),
- .args = copyfile_args,
- .result = undefined,
- .globalObject = globalObject,
- .tracker = JSC.AsyncTaskTracker.init(vm),
- .arena = arena,
- };
- task.ref.ref(vm);
- task.args.src.toThreadSafe();
- task.args.dest.toThreadSafe();
- task.tracker.didSchedule(globalObject);
-
- JSC.WorkPool.schedule(&task.task);
-
- return task.promise.value();
- }
-
- fn workPoolCallback(task: *JSC.WorkPoolTask) void {
- var this: *AsyncCopyFileTask = @fieldParentPtr(AsyncCopyFileTask, "task", task);
-
- var node_fs = NodeFS{};
- this.result = node_fs.copyFile(this.args, .promise);
-
- if (this.result == .err) {
- this.result.err.path = bun.default_allocator.dupe(u8, this.result.err.path) catch "";
- }
-
- this.globalObject.bunVMConcurrently().eventLoop().enqueueTaskConcurrent(JSC.ConcurrentTask.fromCallback(this, runFromJSThread));
- }
-
- fn runFromJSThread(this: *AsyncCopyFileTask) void {
- var globalObject = this.globalObject;
- var success = @as(JSC.Maybe(Return.CopyFile).Tag, this.result) == .result;
- const result = switch (this.result) {
- .err => |err| err.toJSC(globalObject),
- .result => |res| brk: {
- var exceptionref: JSC.C.JSValueRef = null;
- const out = JSC.JSValue.c(JSC.To.JS.withType(Return.CopyFile, res, globalObject, &exceptionref));
- const exception = JSC.JSValue.c(exceptionref);
- if (exception != .zero) {
- success = false;
- break :brk exception;
+ this.ref.unref(this.globalObject.bunVM());
+ if (@hasDecl(ArgumentType, "deinitAndUnprotect")) {
+ this.args.deinitAndUnprotect();
+ } else {
+ this.args.deinit();
}
-
- break :brk out;
- },
+ this.promise.strong.deinit();
+ bun.default_allocator.destroy(this);
+ }
};
- var promise_value = this.promise.value();
- var promise = this.promise.get();
- promise_value.ensureStillAlive();
-
- const tracker = this.tracker;
- tracker.willDispatch(globalObject);
- defer tracker.didDispatch(globalObject);
-
- this.deinit();
- switch (success) {
- false => {
- promise.reject(globalObject, result);
- },
- true => {
- promise.resolve(globalObject, result);
- },
- }
- }
-
- pub fn deinit(this: *AsyncCopyFileTask) void {
- this.ref.unref(this.globalObject.bunVM());
- this.args.deinit();
- this.promise.strong.deinit();
- this.arena.deinit();
- bun.default_allocator.destroy(this);
}
};
@@ -710,6 +393,16 @@ pub const Arguments = struct {
this.new_path.deinit();
}
+ pub fn deinitAndUnprotect(this: @This()) void {
+ this.old_path.deinitAndUnprotect();
+ this.new_path.deinitAndUnprotect();
+ }
+
+ pub fn toThreadSafe(this: *@This()) void {
+ this.old_path.toThreadSafe();
+ this.new_path.toThreadSafe();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Rename {
const old_path = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
@@ -748,8 +441,16 @@ pub const Arguments = struct {
this.path.deinit();
}
+ pub fn deinitAndUnprotect(this: *@This()) void {
+ this.path.deinitAndUnprotect();
+ }
+
+ pub fn toThreadSafe(this: *@This()) void {
+ this.path.toThreadSafe();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Truncate {
- const path = PathOrFileDescriptor.fromJS(ctx, arguments, arguments.arena.allocator(), exception) orelse {
+ const path = PathOrFileDescriptor.fromJS(ctx, arguments, bun.default_allocator, exception) orelse {
if (exception.* == null) {
JSC.throwInvalidArguments(
"path must be a string or TypedArray",
@@ -783,6 +484,21 @@ pub const Arguments = struct {
pub fn deinit(_: *const @This()) void {}
+ pub fn deinitAndUnprotect(this: *const @This()) void {
+ this.buffers.value.unprotect();
+ this.buffers.buffers.deinit();
+ }
+
+ pub fn toThreadSafe(this: *@This()) void {
+ this.buffers.value.protect();
+
+ var clone = bun.default_allocator.dupe(std.os.iovec, this.buffers.buffers.items) catch @panic("out of memory");
+ this.buffers.buffers.deinit();
+ this.buffers.buffers.items = clone;
+ this.buffers.buffers.capacity = clone.len;
+ this.buffers.buffers.allocator = bun.default_allocator;
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Writev {
const fd_value = arguments.nextEat() orelse {
if (exception.* == null) {
@@ -855,7 +571,23 @@ pub const Arguments = struct {
buffers: JSC.Node.VectorArrayBuffer,
position: ?u52 = 0,
- pub fn deinit(_: *const @This()) void {}
+ pub fn deinit(this: *const @This()) void {
+ _ = this;
+ }
+
+ pub fn deinitAndUnprotect(this: *const @This()) void {
+ this.buffers.value.unprotect();
+ this.buffers.buffers.deinit();
+ }
+
+ pub fn toThreadSafe(this: *@This()) void {
+ this.buffers.value.protect();
+ var clone = bun.default_allocator.dupe(std.os.iovec, this.buffers.buffers.items) catch @panic("out of memory");
+ this.buffers.buffers.deinit();
+ this.buffers.buffers.items = clone;
+ this.buffers.buffers.capacity = clone.len;
+ this.buffers.buffers.allocator = bun.default_allocator;
+ }
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Readv {
const fd_value = arguments.nextEat() orelse {
@@ -932,6 +664,14 @@ pub const Arguments = struct {
_ = this;
}
+ pub fn deinitAndUnprotect(this: *@This()) void {
+ _ = this;
+ }
+
+ pub fn toThreadSafe(this: *const @This()) void {
+ _ = this;
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?FTruncate {
const fd = JSC.Node.fileDescriptorFromJS(ctx, arguments.next() orelse {
if (exception.* == null) {
@@ -982,6 +722,14 @@ pub const Arguments = struct {
this.path.deinit();
}
+ pub fn deinitAndUnprotect(this: *@This()) void {
+ this.path.deinitAndUnprotect();
+ }
+
+ pub fn toThreadSafe(this: *@This()) void {
+ this.path.toThreadSafe();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Chown {
const path = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
@@ -1040,6 +788,8 @@ pub const Arguments = struct {
pub fn deinit(_: @This()) void {}
+ pub fn toThreadSafe(_: *const @This()) void {}
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Fchown {
const fd = JSC.Node.fileDescriptorFromJS(ctx, arguments.next() orelse {
if (exception.* == null) {
@@ -1114,6 +864,14 @@ pub const Arguments = struct {
this.path.deinit();
}
+ pub fn deinitAndUnprotect(this: *@This()) void {
+ this.path.deinitAndUnprotect();
+ }
+
+ pub fn toThreadSafe(this: *@This()) void {
+ this.path.toThreadSafe();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Lutimes {
const path = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
@@ -1189,6 +947,14 @@ pub const Arguments = struct {
this.path.deinit();
}
+ pub fn toThreadSafe(this: *@This()) void {
+ this.path.toThreadSafe();
+ }
+
+ pub fn deinitAndUnprotect(this: *@This()) void {
+ this.path.deinitAndUnprotect();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Chmod {
const path = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
@@ -1234,6 +1000,10 @@ pub const Arguments = struct {
fd: FileDescriptor,
mode: Mode = 0x777,
+ pub fn deinit(_: *const @This()) void {}
+
+ pub fn toThreadSafe(_: *const @This()) void {}
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?FChmod {
const fd = JSC.Node.fileDescriptorFromJS(ctx, arguments.next() orelse {
if (exception.* == null) {
@@ -1303,8 +1073,12 @@ pub const Arguments = struct {
this.path.deinitAndUnprotect();
}
+ pub fn toThreadSafe(this: *Stat) void {
+ this.path.toThreadSafe();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Stat {
- const path = PathLike.fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception) orelse {
+ const path = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
JSC.throwInvalidArguments(
"path must be a string or TypedArray",
@@ -1356,6 +1130,8 @@ pub const Arguments = struct {
pub fn deinit(_: @This()) void {}
+ pub fn toThreadSafe(_: *@This()) void {}
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Fstat {
const fd = JSC.Node.fileDescriptorFromJS(ctx, arguments.next() orelse {
if (exception.* == null) {
@@ -1412,6 +1188,16 @@ pub const Arguments = struct {
this.new_path.deinit();
}
+ pub fn deinitAndUnprotect(this: *Link) void {
+ this.old_path.deinitAndUnprotect();
+ this.new_path.deinitAndUnprotect();
+ }
+
+ pub fn toThreadSafe(this: *Link) void {
+ this.old_path.toThreadSafe();
+ this.new_path.toThreadSafe();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Link {
const old_path = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
@@ -1454,6 +1240,16 @@ pub const Arguments = struct {
this.new_path.deinit();
}
+ pub fn deinitAndUnprotect(this: Symlink) void {
+ this.old_path.deinitAndUnprotect();
+ this.new_path.deinitAndUnprotect();
+ }
+
+ pub fn toThreadSafe(this: *@This()) void {
+ this.old_path.toThreadSafe();
+ this.new_path.toThreadSafe();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Symlink {
const old_path = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
@@ -1512,6 +1308,14 @@ pub const Arguments = struct {
this.path.deinit();
}
+ pub fn deinitAndUnprotect(this: *Readlink) void {
+ this.path.deinitAndUnprotect();
+ }
+
+ pub fn toThreadSafe(this: *Readlink) void {
+ this.path.toThreadSafe();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Readlink {
const path = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
@@ -1560,6 +1364,10 @@ pub const Arguments = struct {
this.path.deinitAndUnprotect();
}
+ pub fn toThreadSafe(this: *Realpath) void {
+ this.path.toThreadSafe();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Realpath {
const path = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
@@ -1599,6 +1407,18 @@ pub const Arguments = struct {
pub const Unlink = struct {
path: PathLike,
+ pub fn deinit(this: Unlink) void {
+ this.path.deinit();
+ }
+
+ pub fn deinitAndUnprotect(this: *Unlink) void {
+ this.path.deinitAndUnprotect();
+ }
+
+ pub fn toThreadSafe(this: *Unlink) void {
+ this.path.toThreadSafe();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Unlink {
const path = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
@@ -1620,13 +1440,7 @@ pub const Arguments = struct {
}
};
- pub const Rm = struct {
- path: PathLike,
- force: bool = false,
- max_retries: u32 = 0,
- recursive: bool = false,
- retry_delay: c_uint = 100,
- };
+ pub const Rm = RmDir;
pub const RmDir = struct {
path: PathLike,
@@ -1637,6 +1451,14 @@ pub const Arguments = struct {
recursive: bool = false,
retry_delay: c_uint = 100,
+ pub fn deinitAndUnprotect(this: *RmDir) void {
+ this.path.deinitAndUnprotect();
+ }
+
+ pub fn toThreadSafe(this: *RmDir) void {
+ this.path.toThreadSafe();
+ }
+
pub fn deinit(this: RmDir) void {
this.path.deinit();
}
@@ -1701,6 +1523,14 @@ pub const Arguments = struct {
this.path.deinit();
}
+ pub fn deinitAndUnprotect(this: *Mkdir) void {
+ this.path.deinitAndUnprotect();
+ }
+
+ pub fn toThreadSafe(this: *Mkdir) void {
+ this.path.toThreadSafe();
+ }
+
pub fn fromJS(ctx: *JSC.JSGlobalObject, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Mkdir {
const path = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
@@ -1752,10 +1582,18 @@ pub const Arguments = struct {
this.prefix.deinit();
}
+ pub fn deinitAndUnprotect(this: *MkdirTemp) void {
+ this.prefix.deinit();
+ }
+
+ pub fn toThreadSafe(this: *MkdirTemp) void {
+ this.prefix.toThreadSafe();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?MkdirTemp {
const prefix_value = arguments.next() orelse return MkdirTemp{};
- var prefix = JSC.Node.SliceOrBuffer.fromJS(ctx, arguments.arena.allocator(), prefix_value) orelse {
+ var prefix = JSC.Node.SliceOrBuffer.fromJS(ctx, bun.default_allocator, prefix_value) orelse {
if (exception.* == null) {
JSC.throwInvalidArguments(
"prefix must be a string or TypedArray",
@@ -1810,8 +1648,12 @@ pub const Arguments = struct {
this.path.deinitAndUnprotect();
}
+ pub fn toThreadSafe(this: *Readdir) void {
+ this.path.toThreadSafe();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Readdir {
- const path = PathLike.fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception) orelse {
+ const path = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
JSC.throwInvalidArguments(
"path must be a string or TypedArray",
@@ -1864,6 +1706,7 @@ pub const Arguments = struct {
fd: FileDescriptor,
pub fn deinit(_: Close) void {}
+ pub fn toThreadSafe(_: Close) void {}
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Close {
const fd = JSC.Node.fileDescriptorFromJS(ctx, arguments.next() orelse {
@@ -1905,6 +1748,14 @@ pub const Arguments = struct {
this.path.deinit();
}
+ pub fn deinitAndUnprotect(this: Open) void {
+ this.path.deinitAndUnprotect();
+ }
+
+ pub fn toThreadSafe(this: *Open) void {
+ this.path.toThreadSafe();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Open {
const path = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
@@ -1971,6 +1822,10 @@ pub const Arguments = struct {
pub fn deinit(_: Futimes) void {}
+ pub fn toThreadSafe(self: *const @This()) void {
+ _ = self;
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Futimes {
const fd = JSC.Node.fileDescriptorFromJS(ctx, arguments.next() orelse {
if (exception.* == null) {
@@ -2052,42 +1907,6 @@ pub const Arguments = struct {
}
};
- pub const FSync = struct {
- fd: FileDescriptor,
-
- pub fn deinit(_: FSync) void {}
-
- pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?FSync {
- const fd = JSC.Node.fileDescriptorFromJS(ctx, arguments.next() orelse {
- if (exception.* == null) {
- JSC.throwInvalidArguments(
- "File descriptor is required",
- .{},
- ctx,
- exception,
- );
- }
- return null;
- }, exception) orelse {
- if (exception.* == null) {
- JSC.throwInvalidArguments(
- "fd must be a number",
- .{},
- ctx,
- exception,
- );
- }
- return null;
- };
-
- if (exception.* != null) return null;
-
- return FSync{
- .fd = fd,
- };
- }
- };
-
/// Write `buffer` to the file specified by `fd`. If `buffer` is a normal object, it
/// must have an own `toString` function property.
///
@@ -2114,14 +1933,24 @@ pub const Arguments = struct {
///
pub const Write = struct {
fd: FileDescriptor,
- buffer: StringOrBuffer,
+ buffer: JSC.Node.SliceWithUnderlyingStringOrBuffer,
// buffer_val: JSC.JSValue = JSC.JSValue.zero,
offset: u64 = 0,
length: u64 = std.math.maxInt(u64),
position: ?ReadPosition = null,
encoding: Encoding = Encoding.buffer,
- pub fn deinit(_: Write) void {}
+ pub fn deinit(this: *const @This()) void {
+ this.buffer.deinit();
+ }
+
+ pub fn deinitAndUnprotect(this: *@This()) void {
+ this.buffer.deinitAndUnprotect();
+ }
+
+ pub fn toThreadSafe(self: *@This()) void {
+ self.buffer.toThreadSafe();
+ }
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Write {
const fd = JSC.Node.fileDescriptorFromJS(ctx, arguments.next() orelse {
@@ -2150,7 +1979,7 @@ pub const Arguments = struct {
if (exception.* != null) return null;
- const buffer = StringOrBuffer.fromJS(ctx.ptr(), arguments.arena.allocator(), arguments.next() orelse {
+ const buffer = SliceWithUnderlyingStringOrBuffer.fromJS(ctx.ptr(), bun.default_allocator, arguments.next() orelse {
if (exception.* == null) {
JSC.throwInvalidArguments(
"data is required",
@@ -2177,7 +2006,7 @@ pub const Arguments = struct {
.fd = fd,
.buffer = buffer,
.encoding = switch (buffer) {
- .string => Encoding.utf8,
+ .SliceWithUnderlyingString => Encoding.utf8,
.buffer => Encoding.buffer,
},
};
@@ -2190,7 +2019,7 @@ pub const Arguments = struct {
var current = current_;
switch (buffer) {
// fs.write(fd, string[, position[, encoding]], callback)
- .string => {
+ .SliceWithUnderlyingString => {
if (current.isNumber()) {
args.position = current.to(i52);
arguments.eat();
@@ -2239,6 +2068,14 @@ pub const Arguments = struct {
pub fn deinit(_: Read) void {}
+ pub fn toThreadSafe(this: Read) void {
+ this.buffer.buffer.value.protect();
+ }
+
+ pub fn deinitAndUnprotect(this: *Read) void {
+ this.buffer.buffer.value.unprotect();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Read {
const fd = JSC.Node.fileDescriptorFromJS(ctx, arguments.next() orelse {
if (exception.* == null) {
@@ -2377,6 +2214,10 @@ pub const Arguments = struct {
self.path.deinitAndUnprotect();
}
+ pub fn toThreadSafe(self: *ReadFile) void {
+ self.path.toThreadSafe();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?ReadFile {
const path = PathOrFileDescriptor.fromJS(ctx, arguments, bun.default_allocator, exception) orelse {
if (exception.* == null) {
@@ -2463,8 +2304,16 @@ pub const Arguments = struct {
self.file.deinit();
}
+ pub fn toThreadSafe(self: *WriteFile) void {
+ self.file.toThreadSafe();
+ }
+
+ pub fn deinitAndUnprotect(self: *WriteFile) void {
+ self.file.deinitAndUnprotect();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?WriteFile {
- const file = PathOrFileDescriptor.fromJS(ctx, arguments, arguments.arena.allocator(), exception) orelse {
+ const file = PathOrFileDescriptor.fromJS(ctx, arguments, bun.default_allocator, exception) orelse {
if (exception.* == null) {
JSC.throwInvalidArguments(
"path must be a string or a file descriptor",
@@ -2478,7 +2327,7 @@ pub const Arguments = struct {
if (exception.* != null) return null;
- const data = StringOrBuffer.fromJS(ctx.ptr(), arguments.arena.allocator(), arguments.next() orelse {
+ const data = StringOrBuffer.fromJS(ctx.ptr(), bun.default_allocator, arguments.next() orelse {
if (exception.* == null) {
JSC.throwInvalidArguments(
"data is required",
@@ -2673,6 +2522,18 @@ pub const Arguments = struct {
}
}
+ pub fn toThreadSafe(this: *Exists) void {
+ if (this.path) |*path| {
+ path.toThreadSafe();
+ }
+ }
+
+ pub fn deinitAndUnprotect(this: *Exists) void {
+ if (this.path) |*path| {
+ path.deinitAndUnprotect();
+ }
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Exists {
return Exists{
.path = PathLike.fromJS(ctx, arguments, exception),
@@ -2688,6 +2549,14 @@ pub const Arguments = struct {
this.path.deinit();
}
+ pub fn toThreadSafe(this: *Access) void {
+ this.path.toThreadSafe();
+ }
+
+ pub fn deinitAndUnprotect(this: *Access) void {
+ this.path.deinitAndUnprotect();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Access {
const path = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
@@ -3002,6 +2871,9 @@ pub const Arguments = struct {
fd: FileDescriptor,
pub fn deinit(_: FdataSync) void {}
+ pub fn toThreadSafe(self: *const @This()) void {
+ _ = self;
+ }
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?FdataSync {
const fd = JSC.Node.fileDescriptorFromJS(ctx, arguments.next() orelse {
@@ -3039,13 +2911,23 @@ pub const Arguments = struct {
dest: PathLike,
mode: Constants.Copyfile,
- fn deinit(this: CopyFile) void {
+ pub fn deinit(this: CopyFile) void {
this.src.deinit();
this.dest.deinit();
}
+ pub fn toThreadSafe(this: *CopyFile) void {
+ this.src.toThreadSafe();
+ this.dest.toThreadSafe();
+ }
+
+ pub fn deinitAndUnprotect(this: *CopyFile) void {
+ this.src.deinitAndUnprotect();
+ this.dest.deinitAndUnprotect();
+ }
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?CopyFile {
- const src = PathLike.fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception) orelse {
+ const src = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
JSC.throwInvalidArguments(
"src must be a string or buffer",
@@ -3059,7 +2941,7 @@ pub const Arguments = struct {
if (exception.* != null) return null;
- const dest = PathLike.fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception) orelse {
+ const dest = PathLike.fromJS(ctx, arguments, exception) orelse {
src.deinit();
if (exception.* == null) {
@@ -3109,7 +2991,7 @@ pub const Arguments = struct {
}
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Cp {
- const src = PathLike.fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception) orelse {
+ const src = PathLike.fromJS(ctx, arguments, exception) orelse {
if (exception.* == null) {
JSC.throwInvalidArguments(
"src must be a string or buffer",
@@ -3123,7 +3005,7 @@ pub const Arguments = struct {
if (exception.* != null) return null;
- const dest = PathLike.fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception) orelse {
+ const dest = PathLike.fromJS(ctx, arguments, exception) orelse {
defer src.deinit();
if (exception.* == null) {
JSC.throwInvalidArguments(
@@ -3196,6 +3078,9 @@ pub const Arguments = struct {
pub const Fsync = struct {
fd: FileDescriptor,
+ pub fn deinit(_: Fsync) void {}
+ pub fn toThreadSafe(_: *const @This()) void {}
+
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Fsync {
const fd = JSC.Node.fileDescriptorFromJS(ctx, arguments.next() orelse {
if (exception.* == null) {
@@ -3411,69 +3296,49 @@ pub const NodeFS = struct {
}
pub fn appendFile(this: *NodeFS, args: Arguments.AppendFile, comptime flavor: Flavor) Maybe(Return.AppendFile) {
+ _ = flavor;
var data = args.data.slice();
switch (args.file) {
.fd => |fd| {
- switch (comptime flavor) {
- .sync => {
- while (data.len > 0) {
- const written = switch (Syscall.write(fd, data)) {
- .result => |result| result,
- .err => |err| return .{ .err = err },
- };
- data = data[written..];
- }
-
- return Maybe(Return.AppendFile).success;
- },
- else => {
- @compileError("Not implemented yet");
- },
+ while (data.len > 0) {
+ const written = switch (Syscall.write(fd, data)) {
+ .result => |result| result,
+ .err => |err| return .{ .err = err },
+ };
+ data = data[written..];
}
+
+ return Maybe(Return.AppendFile).success;
},
.path => |path_| {
const path = path_.sliceZ(&this.sync_error_buf);
- switch (comptime flavor) {
- .sync => {
- const fd = switch (Syscall.open(path, @intFromEnum(FileSystemFlags.a), 0o000666)) {
- .result => |result| result,
- .err => |err| return .{ .err = err },
- };
- defer {
- _ = Syscall.close(fd);
- }
+ const fd = switch (Syscall.open(path, @intFromEnum(FileSystemFlags.a), 0o000666)) {
+ .result => |result| result,
+ .err => |err| return .{ .err = err },
+ };
- while (data.len > 0) {
- const written = switch (Syscall.write(fd, data)) {
- .result => |result| result,
- .err => |err| return .{ .err = err },
- };
- data = data[written..];
- }
+ defer {
+ _ = Syscall.close(fd);
+ }
- return Maybe(Return.AppendFile).success;
- },
- else => {
- @compileError("Not implemented yet");
- },
+ while (data.len > 0) {
+ const written = switch (Syscall.write(fd, data)) {
+ .result => |result| result,
+ .err => |err| return .{ .err = err },
+ };
+ data = data[written..];
}
+
+ return Maybe(Return.AppendFile).success;
},
}
-
- return Maybe(Return.AppendFile).todo;
}
pub fn close(_: *NodeFS, args: Arguments.Close, comptime flavor: Flavor) Maybe(Return.Close) {
- switch (comptime flavor) {
- .sync => {
- return if (Syscall.close(args.fd)) |err| .{ .err = err } else Maybe(Return.Close).success;
- },
- else => {},
- }
-
- return .{ .err = Syscall.Error.todo };
+ _ = flavor;
+ return if (Syscall.close(args.fd)) |err| .{ .err = err } else Maybe(Return.Close).success;
}
// since we use a 64 KB stack buffer, we should not let this function get inlined
@@ -3714,132 +3579,92 @@ pub const NodeFS = struct {
}
pub fn exists(this: *NodeFS, args: Arguments.Exists, comptime flavor: Flavor) Maybe(Return.Exists) {
+ _ = flavor;
const Ret = Maybe(Return.Exists);
- switch (comptime flavor) {
- .sync => {
- const path = args.path orelse return Ret{ .result = false };
- const slice = path.sliceZ(&this.sync_error_buf);
- // access() may not work correctly on NFS file systems with UID
- // mapping enabled, because UID mapping is done on the server and
- // hidden from the client, which checks permissions. Similar
- // problems can occur to FUSE mounts.
- const rc = (system.access(slice, std.os.F_OK));
- return Ret{ .result = rc == 0 };
- },
- else => {},
- }
-
- return Ret.todo;
+ const path = args.path orelse return Ret{ .result = false };
+ const slice = path.sliceZ(&this.sync_error_buf);
+ // access() may not work correctly on NFS file systems with UID
+ // mapping enabled, because UID mapping is done on the server and
+ // hidden from the client, which checks permissions. Similar
+ // problems can occur to FUSE mounts.
+ const rc = (system.access(slice, std.os.F_OK));
+ return Ret{ .result = rc == 0 };
}
pub fn chown(this: *NodeFS, args: Arguments.Chown, comptime flavor: Flavor) Maybe(Return.Chown) {
+ _ = flavor;
if (comptime Environment.isWindows) {
return Maybe(Return.Fchmod).todo;
}
const path = args.path.sliceZ(&this.sync_error_buf);
- switch (comptime flavor) {
- .sync => return Syscall.chown(path, args.uid, args.gid),
- else => {},
- }
-
- return Maybe(Return.Chown).todo;
+ return Syscall.chown(path, args.uid, args.gid);
}
/// This should almost never be async
pub fn chmod(this: *NodeFS, args: Arguments.Chmod, comptime flavor: Flavor) Maybe(Return.Chmod) {
+ _ = flavor;
if (comptime Environment.isWindows) {
return Maybe(Return.Fchmod).todo;
}
const path = args.path.sliceZ(&this.sync_error_buf);
- switch (comptime flavor) {
- .sync => {
- return Maybe(Return.Chmod).errnoSysP(C.chmod(path, args.mode), .chmod, path) orelse
- Maybe(Return.Chmod).success;
- },
- else => {},
- }
-
- return Maybe(Return.Chmod).todo;
+ return Maybe(Return.Chmod).errnoSysP(C.chmod(path, args.mode), .chmod, path) orelse
+ Maybe(Return.Chmod).success;
}
/// This should almost never be async
pub fn fchmod(_: *NodeFS, args: Arguments.FChmod, comptime flavor: Flavor) Maybe(Return.Fchmod) {
+ _ = flavor;
if (comptime Environment.isWindows) {
return Maybe(Return.Fchmod).todo;
}
- switch (comptime flavor) {
- .sync => {
- return Syscall.fchmod(args.fd, args.mode);
- },
- else => {},
- }
-
- return Maybe(Return.Fchmod).todo;
+ return Syscall.fchmod(args.fd, args.mode);
}
pub fn fchown(_: *NodeFS, args: Arguments.Fchown, comptime flavor: Flavor) Maybe(Return.Fchown) {
+ _ = flavor;
if (comptime Environment.isWindows) {
return Maybe(Return.Fchown).todo;
}
- switch (comptime flavor) {
- .sync => {
- return Maybe(Return.Fchown).errnoSys(C.fchown(args.fd, args.uid, args.gid), .fchown) orelse
- Maybe(Return.Fchown).success;
- },
- else => {},
- }
-
- return Maybe(Return.Fchown).todo;
+ return Maybe(Return.Fchown).errnoSys(C.fchown(args.fd, args.uid, args.gid), .fchown) orelse
+ Maybe(Return.Fchown).success;
}
pub fn fdatasync(_: *NodeFS, args: Arguments.FdataSync, comptime flavor: Flavor) Maybe(Return.Fdatasync) {
+ _ = flavor;
if (comptime Environment.isWindows) {
return Maybe(Return.Fdatasync).todo;
}
- switch (comptime flavor) {
- .sync => return Maybe(Return.Fdatasync).errnoSys(system.fdatasync(args.fd), .fdatasync) orelse
- Maybe(Return.Fdatasync).success,
- else => {},
- }
-
- return Maybe(Return.Fdatasync).todo;
+ return Maybe(Return.Fdatasync).errnoSys(system.fdatasync(args.fd), .fdatasync) orelse
+ Maybe(Return.Fdatasync).success;
}
pub fn fstat(_: *NodeFS, args: Arguments.Fstat, comptime flavor: Flavor) Maybe(Return.Fstat) {
+ _ = flavor;
if (comptime Environment.isWindows) {
return Maybe(Return.Fstat).todo;
}
- switch (comptime flavor) {
- .sync => {
- if (comptime Environment.isPosix) {
- return switch (Syscall.fstat(args.fd)) {
- .result => |result| Maybe(Return.Fstat){ .result = Stats.init(result, false) },
- .err => |err| Maybe(Return.Fstat){ .err = err },
- };
- }
- },
- else => {},
+ if (comptime Environment.isPosix) {
+ return switch (Syscall.fstat(args.fd)) {
+ .result => |result| Maybe(Return.Fstat){ .result = Stats.init(result, false) },
+ .err => |err| Maybe(Return.Fstat){ .err = err },
+ };
}
return Maybe(Return.Fstat).todo;
}
pub fn fsync(_: *NodeFS, args: Arguments.Fsync, comptime flavor: Flavor) Maybe(Return.Fsync) {
+ _ = flavor;
if (comptime Environment.isWindows) {
return Maybe(Return.Fsync).todo;
}
- switch (comptime flavor) {
- .sync => return Maybe(Return.Fsync).errnoSys(system.fsync(args.fd), .fsync) orelse
- Maybe(Return.Fsync).success,
- else => {},
- }
-
- return Maybe(Return.Fsync).todo;
+ return Maybe(Return.Fsync).errnoSys(system.fsync(args.fd), .fsync) orelse
+ Maybe(Return.Fsync).success;
}
pub fn ftruncateSync(args: Arguments.FTruncate) Maybe(Return.Ftruncate) {
@@ -3847,14 +3672,11 @@ pub const NodeFS = struct {
}
pub fn ftruncate(_: *NodeFS, args: Arguments.FTruncate, comptime flavor: Flavor) Maybe(Return.Ftruncate) {
- switch (comptime flavor) {
- .sync => return ftruncateSync(args),
- else => {},
- }
-
- return Maybe(Return.Ftruncate).todo;
+ _ = flavor;
+ return ftruncateSync(args);
}
pub fn futimes(_: *NodeFS, args: Arguments.Futimes, comptime flavor: Flavor) Maybe(Return.Futimes) {
+ _ = flavor;
if (comptime Environment.isWindows) {
return Maybe(Return.Futimes).todo;
}
@@ -3870,66 +3692,43 @@ pub const NodeFS = struct {
},
};
- switch (comptime flavor) {
- .sync => return if (Maybe(Return.Futimes).errnoSys(system.futimens(args.fd, &times), .futimens)) |err|
- err
- else
- Maybe(Return.Futimes).success,
- else => {},
- }
-
- return Maybe(Return.Futimes).todo;
+ return if (Maybe(Return.Futimes).errnoSys(system.futimens(args.fd, &times), .futimens)) |err|
+ err
+ else
+ Maybe(Return.Futimes).success;
}
pub fn lchmod(this: *NodeFS, args: Arguments.LCHmod, comptime flavor: Flavor) Maybe(Return.Lchmod) {
+ _ = flavor;
if (comptime Environment.isWindows) {
return Maybe(Return.Lchmod).todo;
}
const path = args.path.sliceZ(&this.sync_error_buf);
- switch (comptime flavor) {
- .sync => {
- return Maybe(Return.Lchmod).errnoSysP(C.lchmod(path, args.mode), .lchmod, path) orelse
- Maybe(Return.Lchmod).success;
- },
- else => {},
- }
-
- return Maybe(Return.Lchmod).todo;
+ return Maybe(Return.Lchmod).errnoSysP(C.lchmod(path, args.mode), .lchmod, path) orelse
+ Maybe(Return.Lchmod).success;
}
pub fn lchown(this: *NodeFS, args: Arguments.LChown, comptime flavor: Flavor) Maybe(Return.Lchown) {
+ _ = flavor;
if (comptime Environment.isWindows) {
return Maybe(Return.Lchown).todo;
}
const path = args.path.sliceZ(&this.sync_error_buf);
- switch (comptime flavor) {
- .sync => {
- return Maybe(Return.Lchown).errnoSysP(C.lchown(path, args.uid, args.gid), .lchown, path) orelse
- Maybe(Return.Lchown).success;
- },
- else => {},
- }
-
- return Maybe(Return.Lchown).todo;
+ return Maybe(Return.Lchown).errnoSysP(C.lchown(path, args.uid, args.gid), .lchown, path) orelse
+ Maybe(Return.Lchown).success;
}
pub fn link(this: *NodeFS, args: Arguments.Link, comptime flavor: Flavor) Maybe(Return.Link) {
+ _ = flavor;
var new_path_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
const from = args.old_path.sliceZ(&this.sync_error_buf);
const to = args.new_path.sliceZ(&new_path_buf);
- switch (comptime flavor) {
- .sync => {
- return Maybe(Return.Link).errnoSysP(system.link(from, to, 0), .link, from) orelse
- Maybe(Return.Link).success;
- },
- else => {},
- }
-
- return Maybe(Return.Link).todo;
+ return Maybe(Return.Link).errnoSysP(system.link(from, to, 0), .link, from) orelse
+ Maybe(Return.Link).success;
}
pub fn lstat(this: *NodeFS, args: Arguments.Lstat, comptime flavor: Flavor) Maybe(Return.Lstat) {
if (comptime Environment.isWindows) {
@@ -3957,158 +3756,146 @@ pub const NodeFS = struct {
}
// Node doesn't absolute the path so we don't have to either
fn mkdirNonRecursive(this: *NodeFS, args: Arguments.Mkdir, comptime flavor: Flavor) Maybe(Return.Mkdir) {
- switch (comptime flavor) {
- .sync => {
- const path = args.path.sliceZ(&this.sync_error_buf);
- return switch (Syscall.mkdir(path, args.mode)) {
- .result => Maybe(Return.Mkdir){ .result = bun.String.empty },
- .err => |err| Maybe(Return.Mkdir){ .err = err },
- };
- },
- else => {},
- }
+ _ = flavor;
- return Maybe(Return.Mkdir).todo;
+ const path = args.path.sliceZ(&this.sync_error_buf);
+ return switch (Syscall.mkdir(path, args.mode)) {
+ .result => Maybe(Return.Mkdir){ .result = bun.String.empty },
+ .err => |err| Maybe(Return.Mkdir){ .err = err },
+ };
}
// TODO: windows
// TODO: verify this works correctly with unicode codepoints
pub fn mkdirRecursive(this: *NodeFS, args: Arguments.Mkdir, comptime flavor: Flavor) Maybe(Return.Mkdir) {
+ _ = flavor;
const Option = Maybe(Return.Mkdir);
if (comptime Environment.isWindows) return Option.todo;
- switch (comptime flavor) {
- // The sync version does no allocation except when returning the path
- .sync => {
- var buf: [bun.MAX_PATH_BYTES]u8 = undefined;
- const path = args.path.sliceZWithForceCopy(&buf, true);
- const len = @as(u16, @truncate(path.len));
+ var buf: [bun.MAX_PATH_BYTES]u8 = undefined;
+ const path = args.path.sliceZWithForceCopy(&buf, true);
+ const len = @as(u16, @truncate(path.len));
- // First, attempt to create the desired directory
- // If that fails, then walk back up the path until we have a match
- switch (Syscall.mkdir(path, args.mode)) {
- .err => |err| {
- switch (err.getErrno()) {
- else => {
- @memcpy(this.sync_error_buf[0..len], path[0..len]);
- return .{ .err = err.withPath(this.sync_error_buf[0..len]) };
- },
-
- .EXIST => {
- return Option{ .result = bun.String.empty };
- },
- // continue
- .NOENT => {},
- }
+ // First, attempt to create the desired directory
+ // If that fails, then walk back up the path until we have a match
+ switch (Syscall.mkdir(path, args.mode)) {
+ .err => |err| {
+ switch (err.getErrno()) {
+ else => {
+ @memcpy(this.sync_error_buf[0..len], path[0..len]);
+ return .{ .err = err.withPath(this.sync_error_buf[0..len]) };
},
- .result => {
- return Option{
- .result = if (args.path == .slice_with_underlying_string)
- args.path.slice_with_underlying_string.underlying
- else
- bun.String.create(args.path.slice()),
- };
+
+ .EXIST => {
+ return Option{ .result = bun.String.empty };
},
+ // continue
+ .NOENT => {},
}
+ },
+ .result => {
+ return Option{
+ .result = if (args.path == .slice_with_underlying_string)
+ args.path.slice_with_underlying_string.underlying
+ else
+ bun.String.create(args.path.slice()),
+ };
+ },
+ }
- var working_mem = &this.sync_error_buf;
- @memcpy(working_mem[0..len], path[0..len]);
+ var working_mem = &this.sync_error_buf;
+ @memcpy(working_mem[0..len], path[0..len]);
- var i: u16 = len - 1;
+ var i: u16 = len - 1;
- // iterate backwards until creating the directory works successfully
- while (i > 0) : (i -= 1) {
- if (path[i] == std.fs.path.sep) {
- working_mem[i] = 0;
- var parent: [:0]u8 = working_mem[0..i :0];
+ // iterate backwards until creating the directory works successfully
+ while (i > 0) : (i -= 1) {
+ if (path[i] == std.fs.path.sep) {
+ working_mem[i] = 0;
+ var parent: [:0]u8 = working_mem[0..i :0];
- switch (Syscall.mkdir(parent, args.mode)) {
- .err => |err| {
- working_mem[i] = std.fs.path.sep;
- switch (err.getErrno()) {
- .EXIST => {
- // Handle race condition
- break;
- },
- .NOENT => {
- continue;
- },
- else => return .{ .err = err.withPath(parent) },
- }
- },
- .result => {
- // We found a parent that worked
- working_mem[i] = std.fs.path.sep;
+ switch (Syscall.mkdir(parent, args.mode)) {
+ .err => |err| {
+ working_mem[i] = std.fs.path.sep;
+ switch (err.getErrno()) {
+ .EXIST => {
+ // Handle race condition
break;
},
- }
- }
- }
- var first_match: u16 = i;
- i += 1;
- // after we find one that works, we go forward _after_ the first working directory
- while (i < len) : (i += 1) {
- if (path[i] == std.fs.path.sep) {
- working_mem[i] = 0;
- var parent: [:0]u8 = working_mem[0..i :0];
-
- switch (Syscall.mkdir(parent, args.mode)) {
- .err => |err| {
- working_mem[i] = std.fs.path.sep;
- switch (err.getErrno()) {
- .EXIST => {
- if (Environment.allow_assert) std.debug.assert(false);
- continue;
- },
- else => return .{ .err = err },
- }
- },
-
- .result => {
- working_mem[i] = std.fs.path.sep;
+ .NOENT => {
+ continue;
},
+ else => return .{ .err = err.withPath(parent) },
}
- }
+ },
+ .result => {
+ // We found a parent that worked
+ working_mem[i] = std.fs.path.sep;
+ break;
+ },
}
+ }
+ }
+ var first_match: u16 = i;
+ i += 1;
+ // after we find one that works, we go forward _after_ the first working directory
+ while (i < len) : (i += 1) {
+ if (path[i] == std.fs.path.sep) {
+ working_mem[i] = 0;
+ var parent: [:0]u8 = working_mem[0..i :0];
- working_mem[len] = 0;
-
- // Our final directory will not have a trailing separator
- // so we have to create it once again
- switch (Syscall.mkdir(working_mem[0..len :0], args.mode)) {
+ switch (Syscall.mkdir(parent, args.mode)) {
.err => |err| {
+ working_mem[i] = std.fs.path.sep;
switch (err.getErrno()) {
- // handle the race condition
.EXIST => {
- var display_path = bun.String.empty;
- if (first_match != std.math.maxInt(u16)) {
- display_path = bun.String.create(working_mem[0..first_match]);
- }
- return Option{ .result = display_path };
- },
-
- // NOENT shouldn't happen here
- else => return .{
- .err = err.withPath(path),
+ if (Environment.allow_assert) std.debug.assert(false);
+ continue;
},
+ else => return .{ .err = err },
}
},
+
.result => {
- return Option{
- .result = if (first_match != std.math.maxInt(u16))
- bun.String.create(working_mem[0..first_match])
- else if (args.path == .slice_with_underlying_string)
- args.path.slice_with_underlying_string.underlying
- else
- bun.String.create(args.path.slice()),
- };
+ working_mem[i] = std.fs.path.sep;
},
}
- },
- else => {},
+ }
}
- return Maybe(Return.Mkdir).todo;
+ working_mem[len] = 0;
+
+ // Our final directory will not have a trailing separator
+ // so we have to create it once again
+ switch (Syscall.mkdir(working_mem[0..len :0], args.mode)) {
+ .err => |err| {
+ switch (err.getErrno()) {
+ // handle the race condition
+ .EXIST => {
+ var display_path = bun.String.empty;
+ if (first_match != std.math.maxInt(u16)) {
+ display_path = bun.String.create(working_mem[0..first_match]);
+ }
+ return Option{ .result = display_path };
+ },
+
+ // NOENT shouldn't happen here
+ else => return .{
+ .err = err.withPath(path),
+ },
+ }
+ },
+ .result => {
+ return Option{
+ .result = if (first_match != std.math.maxInt(u16))
+ bun.String.create(working_mem[0..first_match])
+ else if (args.path == .slice_with_underlying_string)
+ args.path.slice_with_underlying_string.underlying
+ else
+ bun.String.create(args.path.slice()),
+ };
+ },
+ }
}
pub fn mkdtemp(this: *NodeFS, args: Arguments.MkdirTemp, comptime _: Flavor) Maybe(Return.Mkdtemp) {
@@ -4136,75 +3923,54 @@ pub const NodeFS = struct {
return .{ .err = Syscall.Error{ .errno = @as(Syscall.Error.Int, @truncate(@intFromEnum(errno))), .syscall = .mkdtemp } };
}
pub fn open(this: *NodeFS, args: Arguments.Open, comptime flavor: Flavor) Maybe(Return.Open) {
- switch (comptime flavor) {
- // The sync version does no allocation except when returning the path
- .sync => {
- const path = args.path.sliceZ(&this.sync_error_buf);
- return switch (Syscall.open(path, @intFromEnum(args.flags), args.mode)) {
- .err => |err| .{
- .err = err.withPath(args.path.slice()),
- },
- .result => |fd| .{ .result = fd },
- };
+ _ = flavor;
+ const path = args.path.sliceZ(&this.sync_error_buf);
+ return switch (Syscall.open(path, @intFromEnum(args.flags), args.mode)) {
+ .err => |err| .{
+ .err = err.withPath(args.path.slice()),
},
- else => {},
- }
-
- return Maybe(Return.Open).todo;
+ .result => |fd| .{ .result = fd },
+ };
}
pub fn openDir(_: *NodeFS, _: Arguments.OpenDir, comptime _: Flavor) Maybe(Return.OpenDir) {
return Maybe(Return.OpenDir).todo;
}
fn _read(_: *NodeFS, args: Arguments.Read, comptime flavor: Flavor) Maybe(Return.Read) {
+ _ = flavor;
if (Environment.allow_assert) std.debug.assert(args.position == null);
+ var buf = args.buffer.slice();
+ buf = buf[@min(args.offset, buf.len)..];
+ buf = buf[0..@min(buf.len, args.length)];
- switch (comptime flavor) {
- // The sync version does no allocation except when returning the path
- .sync => {
- var buf = args.buffer.slice();
- buf = buf[@min(args.offset, buf.len)..];
- buf = buf[0..@min(buf.len, args.length)];
-
- return switch (Syscall.read(args.fd, buf)) {
- .err => |err| .{
- .err = err,
- },
- .result => |amt| .{
- .result = .{
- .bytes_read = @as(u52, @truncate(amt)),
- },
- },
- };
+ return switch (Syscall.read(args.fd, buf)) {
+ .err => |err| .{
+ .err = err,
},
- else => {},
- }
-
- return Maybe(Return.Read).todo;
+ .result => |amt| .{
+ .result = .{
+ .bytes_read = @as(u52, @truncate(amt)),
+ },
+ },
+ };
}
fn _pread(_: *NodeFS, args: Arguments.Read, comptime flavor: Flavor) Maybe(Return.Read) {
- switch (comptime flavor) {
- .sync => {
- var buf = args.buffer.slice();
- buf = buf[@min(args.offset, buf.len)..];
- buf = buf[0..@min(buf.len, args.length)];
-
- return switch (Syscall.pread(args.fd, buf, args.position.?)) {
- .err => |err| .{
- .err = err,
- },
- .result => |amt| .{
- .result = .{
- .bytes_read = @as(u52, @truncate(amt)),
- },
- },
- };
- },
- else => {},
- }
+ _ = flavor;
+ var buf = args.buffer.slice();
+ buf = buf[@min(args.offset, buf.len)..];
+ buf = buf[0..@min(buf.len, args.length)];
- return Maybe(Return.Read).todo;
+ return switch (Syscall.pread(args.fd, buf, args.position.?)) {
+ .err => |err| .{
+ .err = err,
+ },
+ .result => |amt| .{
+ .result = .{
+ .bytes_read = @as(u52, @truncate(amt)),
+ },
+ },
+ };
}
pub fn read(this: *NodeFS, args: Arguments.Read, comptime flavor: Flavor) Maybe(Return.Read) {
@@ -4236,127 +4002,91 @@ pub const NodeFS = struct {
return if (args.position != null) _pwrite(this, args, flavor) else _write(this, args, flavor);
}
fn _write(_: *NodeFS, args: Arguments.Write, comptime flavor: Flavor) Maybe(Return.Write) {
- switch (comptime flavor) {
- .sync => {
- var buf = args.buffer.slice();
- buf = buf[@min(args.offset, buf.len)..];
- buf = buf[0..@min(buf.len, args.length)];
-
- return switch (Syscall.write(args.fd, buf)) {
- .err => |err| .{
- .err = err,
- },
- .result => |amt| .{
- .result = .{
- .bytes_written = @as(u52, @truncate(amt)),
- },
- },
- };
- },
- else => {},
- }
+ _ = flavor;
- return Maybe(Return.Write).todo;
+ var buf = args.buffer.slice();
+ buf = buf[@min(args.offset, buf.len)..];
+ buf = buf[0..@min(buf.len, args.length)];
+
+ return switch (Syscall.write(args.fd, buf)) {
+ .err => |err| .{
+ .err = err,
+ },
+ .result => |amt| .{
+ .result = .{
+ .bytes_written = @as(u52, @truncate(amt)),
+ },
+ },
+ };
}
fn _pwrite(_: *NodeFS, args: Arguments.Write, comptime flavor: Flavor) Maybe(Return.Write) {
+ _ = flavor;
const position = args.position.?;
- switch (comptime flavor) {
- .sync => {
- var buf = args.buffer.slice();
- buf = buf[@min(args.offset, buf.len)..];
- buf = buf[0..@min(args.length, buf.len)];
+ var buf = args.buffer.slice();
+ buf = buf[@min(args.offset, buf.len)..];
+ buf = buf[0..@min(args.length, buf.len)];
- return switch (Syscall.pwrite(args.fd, buf, position)) {
- .err => |err| .{
- .err = err,
- },
- .result => |amt| .{ .result = .{
- .bytes_written = @as(u52, @truncate(amt)),
- } },
- };
+ return switch (Syscall.pwrite(args.fd, buf, position)) {
+ .err => |err| .{
+ .err = err,
},
- else => {},
- }
-
- return Maybe(Return.Write).todo;
+ .result => |amt| .{ .result = .{
+ .bytes_written = @as(u52, @truncate(amt)),
+ } },
+ };
}
fn _preadv(_: *NodeFS, args: Arguments.Readv, comptime flavor: Flavor) Maybe(Return.Readv) {
+ _ = flavor;
const position = args.position.?;
- switch (comptime flavor) {
- .sync => {
- return switch (Syscall.preadv(args.fd, args.buffers.buffers.items, position)) {
- .err => |err| .{
- .err = err,
- },
- .result => |amt| .{ .result = .{
- .bytes_read = @as(u52, @truncate(amt)),
- } },
- };
+ return switch (Syscall.preadv(args.fd, args.buffers.buffers.items, position)) {
+ .err => |err| .{
+ .err = err,
},
- else => {},
- }
-
- return Maybe(Return.Write).todo;
+ .result => |amt| .{ .result = .{
+ .bytes_read = @as(u52, @truncate(amt)),
+ } },
+ };
}
fn _readv(_: *NodeFS, args: Arguments.Readv, comptime flavor: Flavor) Maybe(Return.Readv) {
- switch (comptime flavor) {
- .sync => {
- return switch (Syscall.readv(args.fd, args.buffers.buffers.items)) {
- .err => |err| .{
- .err = err,
- },
- .result => |amt| .{ .result = .{
- .bytes_read = @as(u52, @truncate(amt)),
- } },
- };
+ _ = flavor;
+ return switch (Syscall.readv(args.fd, args.buffers.buffers.items)) {
+ .err => |err| .{
+ .err = err,
},
- else => {},
- }
-
- return Maybe(Return.Write).todo;
+ .result => |amt| .{ .result = .{
+ .bytes_read = @as(u52, @truncate(amt)),
+ } },
+ };
}
fn _pwritev(_: *NodeFS, args: Arguments.Writev, comptime flavor: Flavor) Maybe(Return.Write) {
+ _ = flavor;
const position = args.position.?;
-
- switch (comptime flavor) {
- .sync => {
- return switch (Syscall.pwritev(args.fd, args.buffers.buffers.items, position)) {
- .err => |err| .{
- .err = err,
- },
- .result => |amt| .{ .result = .{
- .bytes_written = @as(u52, @truncate(amt)),
- } },
- };
+ return switch (Syscall.pwritev(args.fd, args.buffers.buffers.items, position)) {
+ .err => |err| .{
+ .err = err,
},
- else => {},
- }
-
- return Maybe(Return.Write).todo;
+ .result => |amt| .{ .result = .{
+ .bytes_written = @as(u52, @truncate(amt)),
+ } },
+ };
}
fn _writev(_: *NodeFS, args: Arguments.Writev, comptime flavor: Flavor) Maybe(Return.Write) {
- switch (comptime flavor) {
- .sync => {
- return switch (Syscall.writev(args.fd, args.buffers.buffers.items)) {
- .err => |err| .{
- .err = err,
- },
- .result => |amt| .{ .result = .{
- .bytes_written = @as(u52, @truncate(amt)),
- } },
- };
+ _ = flavor;
+ return switch (Syscall.writev(args.fd, args.buffers.buffers.items)) {
+ .err => |err| .{
+ .err = err,
},
- else => {},
- }
-
- return Maybe(Return.Write).todo;
+ .result => |amt| .{ .result = .{
+ .bytes_written = @as(u52, @truncate(amt)),
+ } },
+ };
}
pub fn readdir(this: *NodeFS, args: Arguments.Readdir, comptime flavor: Flavor) Maybe(Return.Readdir) {
@@ -4751,50 +4481,39 @@ pub const NodeFS = struct {
return Maybe(Return.WriteFile).success;
}
- pub fn writeFile(this: *NodeFS, args: Arguments.WriteFile, comptime flavor: Flavor) Maybe(Return.WriteFile) {
- switch (comptime flavor) {
- .sync => return writeFileWithPathBuffer(&this.sync_error_buf, args),
- else => {},
- }
-
- return Maybe(Return.WriteFile).todo;
+ pub fn writeFile(this: *NodeFS, args: Arguments.WriteFile, comptime _: Flavor) Maybe(Return.WriteFile) {
+ return writeFileWithPathBuffer(&this.sync_error_buf, args);
}
- pub fn readlink(this: *NodeFS, args: Arguments.Readlink, comptime flavor: Flavor) Maybe(Return.Readlink) {
+ pub fn readlink(this: *NodeFS, args: Arguments.Readlink, comptime _: Flavor) Maybe(Return.Readlink) {
var outbuf: [bun.MAX_PATH_BYTES]u8 = undefined;
var inbuf = &this.sync_error_buf;
- switch (comptime flavor) {
- .sync => {
- const path = args.path.sliceZ(inbuf);
- const len = switch (Syscall.readlink(path, &outbuf)) {
- .err => |err| return .{
- .err = err.withPath(args.path.slice()),
- },
- .result => |buf_| buf_,
- };
+ const path = args.path.sliceZ(inbuf);
- return .{
- .result = switch (args.encoding) {
- .buffer => .{
- .buffer = Buffer.fromString(outbuf[0..len], bun.default_allocator) catch unreachable,
- },
- else => if (args.path == .slice_with_underlying_string and
- strings.eqlLong(args.path.slice_with_underlying_string.slice(), outbuf[0..len], true))
- .{
- .BunString = args.path.slice_with_underlying_string.underlying.dupeRef(),
- }
- else
- .{
- .BunString = bun.String.create(outbuf[0..len]),
- },
- },
- };
+ const len = switch (Syscall.readlink(path, &outbuf)) {
+ .err => |err| return .{
+ .err = err.withPath(args.path.slice()),
},
- else => {},
- }
+ .result => |buf_| buf_,
+ };
- return Maybe(Return.Readlink).todo;
+ return .{
+ .result = switch (args.encoding) {
+ .buffer => .{
+ .buffer = Buffer.fromString(outbuf[0..len], bun.default_allocator) catch unreachable,
+ },
+ else => if (args.path == .slice_with_underlying_string and
+ strings.eqlLong(args.path.slice_with_underlying_string.slice(), outbuf[0..len], true))
+ .{
+ .BunString = args.path.slice_with_underlying_string.underlying.dupeRef(),
+ }
+ else
+ .{
+ .BunString = bun.String.create(outbuf[0..len]),
+ },
+ },
+ };
}
pub fn realpath(this: *NodeFS, args: Arguments.Realpath, comptime _: Flavor) Maybe(Return.Realpath) {
var outbuf: [bun.MAX_PATH_BYTES]u8 = undefined;
@@ -4857,325 +4576,227 @@ pub const NodeFS = struct {
// return error.NotImplementedYet;
// }
pub fn rename(this: *NodeFS, args: Arguments.Rename, comptime flavor: Flavor) Maybe(Return.Rename) {
+ _ = flavor;
var from_buf = &this.sync_error_buf;
var to_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
- switch (comptime flavor) {
- .sync => {
- var from = args.old_path.sliceZ(from_buf);
- var to = args.new_path.sliceZ(&to_buf);
- return Syscall.rename(from, to);
- },
- else => {},
- }
-
- return Maybe(Return.Rename).todo;
+ var from = args.old_path.sliceZ(from_buf);
+ var to = args.new_path.sliceZ(&to_buf);
+ return Syscall.rename(from, to);
}
- pub fn rmdir(this: *NodeFS, args: Arguments.RmDir, comptime flavor: Flavor) Maybe(Return.Rmdir) {
- switch (comptime flavor) {
- .sync => {
- if (comptime Environment.isMac) {
- if (args.recursive) {
- var dest = args.path.sliceZ(&this.sync_error_buf);
-
- var flags: u32 = bun.C.darwin.RemoveFileFlags.cross_mount |
- bun.C.darwin.RemoveFileFlags.allow_long_paths |
- bun.C.darwin.RemoveFileFlags.recursive;
-
- while (true) {
- if (Maybe(Return.Rmdir).errnoSys(bun.C.darwin.removefileat(std.os.AT.FDCWD, dest, null, flags), .rmdir)) |errno| {
- switch (@as(os.E, @enumFromInt(errno.err.errno))) {
- .AGAIN, .INTR => continue,
- .NOENT => return Maybe(Return.Rmdir).success,
- .MLINK => {
- var copy: [bun.MAX_PATH_BYTES]u8 = undefined;
- @memcpy(copy[0..dest.len], dest);
- copy[dest.len] = 0;
- var dest_copy = copy[0..dest.len :0];
- switch (Syscall.unlink(dest_copy).getErrno()) {
- .AGAIN, .INTR => continue,
- .NOENT => return errno,
- .SUCCESS => continue,
- else => return errno,
- }
- },
- .SUCCESS => unreachable,
- else => return errno,
- }
- }
-
- return Maybe(Return.Rmdir).success;
- }
- }
-
- return Maybe(Return.Rmdir).errnoSysP(system.rmdir(args.path.sliceZ(&this.sync_error_buf)), .rmdir, args.path.slice()) orelse
- Maybe(Return.Rmdir).success;
- } else if (comptime Environment.isLinux) {
- if (args.recursive) {
- std.fs.cwd().deleteTree(args.path.slice()) catch |err| {
- const errno: std.os.E = switch (err) {
- error.InvalidHandle => .BADF,
- error.AccessDenied => .PERM,
- error.FileTooBig => .FBIG,
- error.SymLinkLoop => .LOOP,
- error.ProcessFdQuotaExceeded => .NFILE,
- error.NameTooLong => .NAMETOOLONG,
- error.SystemFdQuotaExceeded => .MFILE,
- error.SystemResources => .NOMEM,
- error.ReadOnlyFileSystem => .ROFS,
- error.FileSystem => .IO,
- error.FileBusy => .BUSY,
- error.DeviceBusy => .BUSY,
-
- // One of the path components was not a directory.
- // This error is unreachable if `sub_path` does not contain a path separator.
- error.NotDir => .NOTDIR,
- // On Windows, file paths must be valid Unicode.
- error.InvalidUtf8 => .INVAL,
-
- // On Windows, file paths cannot contain these characters:
- // '/', '*', '?', '"', '<', '>', '|'
- error.BadPathName => .INVAL,
-
- else => .FAULT,
- };
- return Maybe(Return.Rm){
- .err = bun.sys.Error.fromCode(errno, .rmdir),
- };
- };
+ pub fn rmdir(this: *NodeFS, args: Arguments.RmDir, comptime _: Flavor) Maybe(Return.Rmdir) {
+ if (comptime Environment.isPosix) {
+ if (args.recursive) {
+ std.fs.cwd().deleteTree(args.path.slice()) catch |err| {
+ const errno: std.os.E = switch (err) {
+ error.InvalidHandle => .BADF,
+ error.AccessDenied => .PERM,
+ error.FileTooBig => .FBIG,
+ error.SymLinkLoop => .LOOP,
+ error.ProcessFdQuotaExceeded => .NFILE,
+ error.NameTooLong => .NAMETOOLONG,
+ error.SystemFdQuotaExceeded => .MFILE,
+ error.SystemResources => .NOMEM,
+ error.ReadOnlyFileSystem => .ROFS,
+ error.FileSystem => .IO,
+ error.FileBusy => .BUSY,
+ error.DeviceBusy => .BUSY,
+
+ // One of the path components was not a directory.
+ // This error is unreachable if `sub_path` does not contain a path separator.
+ error.NotDir => .NOTDIR,
+ // On Windows, file paths must be valid Unicode.
+ error.InvalidUtf8 => .INVAL,
+
+ // On Windows, file paths cannot contain these characters:
+ // '/', '*', '?', '"', '<', '>', '|'
+ error.BadPathName => .INVAL,
+
+ else => .FAULT,
+ };
+ return Maybe(Return.Rm){
+ .err = bun.sys.Error.fromCode(errno, .rmdir),
+ };
+ };
- return Maybe(Return.Rmdir).success;
- }
+ return Maybe(Return.Rmdir).success;
+ }
- return Maybe(Return.Rmdir).errnoSysP(system.rmdir(args.path.sliceZ(&this.sync_error_buf)), .rmdir, args.path.slice()) orelse
- Maybe(Return.Rmdir).success;
- }
- },
- else => {},
+ return Maybe(Return.Rmdir).errnoSysP(system.rmdir(args.path.sliceZ(&this.sync_error_buf)), .rmdir, args.path.slice()) orelse
+ Maybe(Return.Rmdir).success;
}
return Maybe(Return.Rmdir).todo;
}
pub fn rm(this: *NodeFS, args: Arguments.RmDir, comptime flavor: Flavor) Maybe(Return.Rm) {
- switch (comptime flavor) {
- .sync => {
- if (comptime Environment.isMac) {
- var dest = args.path.sliceZ(&this.sync_error_buf);
-
- while (true) {
- var flags: u32 = 0;
- if (args.recursive) {
- flags |= bun.C.darwin.RemoveFileFlags.cross_mount;
- flags |= bun.C.darwin.RemoveFileFlags.allow_long_paths;
- flags |= bun.C.darwin.RemoveFileFlags.recursive;
- }
-
- if (Maybe(Return.Rm).errnoSys(bun.C.darwin.removefileat(std.os.AT.FDCWD, dest, null, flags), .unlink)) |errno| {
- switch (@as(os.E, @enumFromInt(errno.err.errno))) {
- .AGAIN, .INTR => continue,
- .NOENT => {
- if (args.force) {
- return Maybe(Return.Rm).success;
- }
-
- return errno;
- },
-
- .MLINK => {
- var copy: [bun.MAX_PATH_BYTES]u8 = undefined;
- @memcpy(copy[0..dest.len], dest);
- copy[dest.len] = 0;
- var dest_copy = copy[0..dest.len :0];
- switch (Syscall.unlink(dest_copy).getErrno()) {
- .AGAIN, .INTR => continue,
- .NOENT => {
- if (args.force) {
- continue;
- }
-
- return errno;
- },
- .SUCCESS => continue,
- else => return errno,
- }
- },
- .SUCCESS => unreachable,
- else => return errno,
- }
- }
+ _ = flavor;
+ if (comptime Environment.isPosix) {
+ // We cannot use removefileat() on macOS because it does not handle write-protected files as expected.
+ if (args.recursive) {
+ // TODO: switch to an implementation which does not use any "unreachable"
+ std.fs.cwd().deleteTree(args.path.slice()) catch |err| {
+ const errno: E = switch (err) {
+ error.InvalidHandle => .BADF,
+ error.AccessDenied => .PERM,
+ error.FileTooBig => .FBIG,
+ error.SymLinkLoop => .LOOP,
+ error.ProcessFdQuotaExceeded => .NFILE,
+ error.NameTooLong => .NAMETOOLONG,
+ error.SystemFdQuotaExceeded => .MFILE,
+ error.SystemResources => .NOMEM,
+ error.ReadOnlyFileSystem => .ROFS,
+ error.FileSystem => .IO,
+ error.FileBusy => .BUSY,
+ error.DeviceBusy => .BUSY,
+
+ // One of the path components was not a directory.
+ // This error is unreachable if `sub_path` does not contain a path separator.
+ error.NotDir => .NOTDIR,
+ // On Windows, file paths must be valid Unicode.
+ error.InvalidUtf8 => .INVAL,
+
+ // On Windows, file paths cannot contain these characters:
+ // '/', '*', '?', '"', '<', '>', '|'
+ error.BadPathName => .INVAL,
+
+ else => .FAULT,
+ };
+ if (args.force) {
return Maybe(Return.Rm).success;
}
- } else if (comptime Environment.isLinux or Environment.isWindows) {
- if (args.recursive) {
- std.fs.cwd().deleteTree(args.path.slice()) catch |err| {
- const errno: E = switch (err) {
- error.InvalidHandle => .BADF,
- error.AccessDenied => .PERM,
- error.FileTooBig => .FBIG,
- error.SymLinkLoop => .LOOP,
- error.ProcessFdQuotaExceeded => .NFILE,
- error.NameTooLong => .NAMETOOLONG,
- error.SystemFdQuotaExceeded => .MFILE,
- error.SystemResources => .NOMEM,
- error.ReadOnlyFileSystem => .ROFS,
- error.FileSystem => .IO,
- error.FileBusy => .BUSY,
- error.DeviceBusy => .BUSY,
-
- // One of the path components was not a directory.
- // This error is unreachable if `sub_path` does not contain a path separator.
- error.NotDir => .NOTDIR,
- // On Windows, file paths must be valid Unicode.
- error.InvalidUtf8 => .INVAL,
-
- // On Windows, file paths cannot contain these characters:
- // '/', '*', '?', '"', '<', '>', '|'
- error.BadPathName => .INVAL,
-
- else => .FAULT,
- };
- if (args.force) {
- return Maybe(Return.Rm).success;
- }
- return Maybe(Return.Rm){
- .err = bun.sys.Error.fromCode(errno, .unlink),
- };
- };
- return Maybe(Return.Rm).success;
- }
- }
-
- if (comptime Environment.isPosix) {
- var dest = args.path.osPath(&this.sync_error_buf);
- std.os.unlinkZ(dest) catch |er| {
- // empircally, it seems to return AccessDenied when the
- // file is actually a directory on macOS.
- if (args.recursive and
- (er == error.IsDir or er == error.NotDir or er == error.AccessDenied))
- {
- std.os.rmdirZ(dest) catch |err| {
- if (args.force) {
- return Maybe(Return.Rm).success;
- }
-
- const code: E = switch (err) {
- error.AccessDenied => .PERM,
- error.SymLinkLoop => .LOOP,
- error.NameTooLong => .NAMETOOLONG,
- error.SystemResources => .NOMEM,
- error.ReadOnlyFileSystem => .ROFS,
- error.FileBusy => .BUSY,
- error.FileNotFound => .NOENT,
- error.InvalidUtf8 => .INVAL,
- error.BadPathName => .INVAL,
- else => .FAULT,
- };
+ return Maybe(Return.Rm){
+ .err = bun.sys.Error.fromCode(errno, .unlink),
+ };
+ };
+ return Maybe(Return.Rm).success;
+ }
- return .{
- .err = bun.sys.Error.fromCode(
- code,
- .rmdir,
- ),
- };
- };
-
- return Maybe(Return.Rm).success;
- }
+ var dest = args.path.sliceZ(&this.sync_error_buf);
+ std.os.unlinkZ(dest) catch |er| {
+ // empircally, it seems to return AccessDenied when the
+ // file is actually a directory on macOS.
+ if (args.recursive and
+ (er == error.IsDir or er == error.NotDir or er == error.AccessDenied))
+ {
+ std.os.rmdirZ(dest) catch |err| {
if (args.force) {
return Maybe(Return.Rm).success;
}
- {
- const code: E = switch (er) {
- error.AccessDenied => .PERM,
- error.SymLinkLoop => .LOOP,
- error.NameTooLong => .NAMETOOLONG,
- error.SystemResources => .NOMEM,
- error.ReadOnlyFileSystem => .ROFS,
- error.FileBusy => .BUSY,
- error.InvalidUtf8 => .INVAL,
- error.BadPathName => .INVAL,
- error.FileNotFound => .NOENT,
- else => .FAULT,
- };
+ const code: E = switch (err) {
+ error.AccessDenied => .PERM,
+ error.SymLinkLoop => .LOOP,
+ error.NameTooLong => .NAMETOOLONG,
+ error.SystemResources => .NOMEM,
+ error.ReadOnlyFileSystem => .ROFS,
+ error.FileBusy => .BUSY,
+ error.FileNotFound => .NOENT,
+ error.InvalidUtf8 => .INVAL,
+ error.BadPathName => .INVAL,
+ else => .FAULT,
+ };
- return .{
- .err = bun.sys.Error.fromCode(
- code,
- .unlink,
- ),
- };
- }
+ return .{
+ .err = bun.sys.Error.fromCode(
+ code,
+ .rmdir,
+ ),
+ };
};
return Maybe(Return.Rm).success;
}
- if (comptime Environment.isWindows) {
- var dest = args.path.osPath(&this.sync_error_buf);
- std.os.windows.DeleteFile(dest, .{
- .dir = null,
- .remove_dir = brk: {
- const file_attrs = std.os.windows.GetFileAttributesW(dest.ptr) catch |err| {
- if (args.force) {
- return Maybe(Return.Rm).success;
- }
+ if (args.force) {
+ return Maybe(Return.Rm).success;
+ }
- const code: E = switch (err) {
- error.FileNotFound => .NOENT,
- error.PermissionDenied => .PERM,
- else => .INVAL,
- };
+ {
+ const code: E = switch (er) {
+ error.AccessDenied => .PERM,
+ error.SymLinkLoop => .LOOP,
+ error.NameTooLong => .NAMETOOLONG,
+ error.SystemResources => .NOMEM,
+ error.ReadOnlyFileSystem => .ROFS,
+ error.FileBusy => .BUSY,
+ error.InvalidUtf8 => .INVAL,
+ error.BadPathName => .INVAL,
+ error.FileNotFound => .NOENT,
+ else => .FAULT,
+ };
- return .{
- .err = bun.sys.Error.fromCode(
- code,
- .unlink,
- ),
- };
- };
- // TODO: check FILE_ATTRIBUTE_INVALID
- break :brk (file_attrs & std.os.windows.FILE_ATTRIBUTE_DIRECTORY) != 0;
- },
- }) catch |er| {
- // empircally, it seems to return AccessDenied when the
- // file is actually a directory on macOS.
+ return .{
+ .err = bun.sys.Error.fromCode(
+ code,
+ .unlink,
+ ),
+ };
+ }
+ };
+ return Maybe(Return.Rm).success;
+ }
+
+ if (comptime Environment.isWindows) {
+ var dest = args.path.osPath(&this.sync_error_buf);
+ std.os.windows.DeleteFile(dest, .{
+ .dir = null,
+ .remove_dir = brk: {
+ const file_attrs = std.os.windows.GetFileAttributesW(dest.ptr) catch |err| {
if (args.force) {
return Maybe(Return.Rm).success;
}
- {
- const code: E = switch (er) {
- error.FileNotFound => .NOENT,
- error.AccessDenied => .PERM,
- error.NameTooLong => .INVAL,
- error.FileBusy => .BUSY,
- error.NotDir => .NOTDIR,
- error.IsDir => .ISDIR,
- error.DirNotEmpty => .INVAL,
- error.NetworkNotFound => .NOENT,
- else => .UNKNOWN,
- };
+ const code: E = switch (err) {
+ error.FileNotFound => .NOENT,
+ error.PermissionDenied => .PERM,
+ else => .INVAL,
+ };
- return .{
- .err = bun.sys.Error.fromCode(
- code,
- .unlink,
- ),
- };
- }
+ return .{
+ .err = bun.sys.Error.fromCode(
+ code,
+ .unlink,
+ ),
+ };
};
+ // TODO: check FILE_ATTRIBUTE_INVALID
+ break :brk (file_attrs & std.os.windows.FILE_ATTRIBUTE_DIRECTORY) != 0;
+ },
+ }) catch |er| {
+ // empircally, it seems to return AccessDenied when the
+ // file is actually a directory on macOS.
+ if (args.force) {
return Maybe(Return.Rm).success;
}
- },
- else => {},
- }
- return Maybe(Return.Rm).todo;
+ {
+ const code: E = switch (er) {
+ error.FileNotFound => .NOENT,
+ error.AccessDenied => .PERM,
+ error.NameTooLong => .INVAL,
+ error.FileBusy => .BUSY,
+ error.NotDir => .NOTDIR,
+ error.IsDir => .ISDIR,
+ error.DirNotEmpty => .INVAL,
+ error.NetworkNotFound => .NOENT,
+ else => .UNKNOWN,
+ };
+
+ return .{
+ .err = bun.sys.Error.fromCode(
+ code,
+ .unlink,
+ ),
+ };
+ }
+ };
+
+ return Maybe(Return.Rm).success;
+ }
}
pub fn stat(this: *NodeFS, args: Arguments.Stat, comptime flavor: Flavor) Maybe(Return.Stat) {
if (comptime Environment.isWindows) {
@@ -5199,38 +4820,26 @@ pub const NodeFS = struct {
}
pub fn symlink(this: *NodeFS, args: Arguments.Symlink, comptime flavor: Flavor) Maybe(Return.Symlink) {
+ _ = flavor;
if (comptime Environment.isWindows) {
return Maybe(Return.Symlink).todo;
}
var to_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
- switch (comptime flavor) {
- .sync => {
- return Syscall.symlink(
- args.old_path.sliceZ(&this.sync_error_buf),
- args.new_path.sliceZ(&to_buf),
- );
- },
- else => {},
- }
-
- return Maybe(Return.Symlink).todo;
+ return Syscall.symlink(
+ args.old_path.sliceZ(&this.sync_error_buf),
+ args.new_path.sliceZ(&to_buf),
+ );
}
fn _truncate(this: *NodeFS, path: PathLike, len: JSC.WebCore.Blob.SizeType, comptime flavor: Flavor) Maybe(Return.Truncate) {
+ _ = flavor;
if (comptime Environment.isWindows) {
return Maybe(Return.Truncate).todo;
}
- switch (comptime flavor) {
- .sync => {
- return Maybe(Return.Truncate).errno(C.truncate(path.sliceZ(&this.sync_error_buf), len)) orelse
- Maybe(Return.Truncate).success;
- },
- else => {},
- }
-
- return Maybe(Return.Truncate).todo;
+ return Maybe(Return.Truncate).errno(C.truncate(path.sliceZ(&this.sync_error_buf), len)) orelse
+ Maybe(Return.Truncate).success;
}
pub fn truncate(this: *NodeFS, args: Arguments.Truncate, comptime flavor: Flavor) Maybe(Return.Truncate) {
return switch (args.path) {
@@ -5246,19 +4855,13 @@ pub const NodeFS = struct {
};
}
pub fn unlink(this: *NodeFS, args: Arguments.Unlink, comptime flavor: Flavor) Maybe(Return.Unlink) {
+ _ = flavor;
if (comptime Environment.isWindows) {
return Maybe(Return.Unlink).todo;
}
- switch (comptime flavor) {
- .sync => {
- return Maybe(Return.Unlink).errnoSysP(system.unlink(args.path.sliceZ(&this.sync_error_buf)), .unlink, args.path.slice()) orelse
- Maybe(Return.Unlink).success;
- },
- else => {},
- }
-
- return Maybe(Return.Unlink).todo;
+ return Maybe(Return.Unlink).errnoSysP(system.unlink(args.path.sliceZ(&this.sync_error_buf)), .unlink, args.path.slice()) orelse
+ Maybe(Return.Unlink).success;
}
pub fn watchFile(_: *NodeFS, args: Arguments.WatchFile, comptime flavor: Flavor) Maybe(Return.WatchFile) {
std.debug.assert(flavor == .sync);
@@ -5283,6 +4886,7 @@ pub const NodeFS = struct {
return Maybe(Return.UnwatchFile).todo;
}
pub fn utimes(this: *NodeFS, args: Arguments.Utimes, comptime flavor: Flavor) Maybe(Return.Utimes) {
+ _ = flavor;
if (comptime Environment.isWindows) {
return Maybe(Return.Utimes).todo;
}
@@ -5300,21 +4904,13 @@ pub const NodeFS = struct {
},
};
- switch (comptime flavor) {
- // futimes uses the syscall version
- // we use libc because here, not for a good reason
- // just missing from the linux syscall interface in zig and I don't want to modify that right now
- .sync => return if (Maybe(Return.Utimes).errnoSysP(std.c.utimes(args.path.sliceZ(&this.sync_error_buf), &times), .utimes, args.path.slice())) |err|
- err
- else
- Maybe(Return.Utimes).success,
- else => {},
- }
-
- return Maybe(Return.Utimes).todo;
+ return if (Maybe(Return.Utimes).errnoSysP(std.c.utimes(args.path.sliceZ(&this.sync_error_buf), &times), .utimes, args.path.slice())) |err|
+ err
+ else
+ Maybe(Return.Utimes).success;
}
- pub fn lutimes(this: *NodeFS, args: Arguments.Lutimes, comptime flavor: Flavor) Maybe(Return.Lutimes) {
+ pub fn lutimes(this: *NodeFS, args: Arguments.Lutimes, comptime _: Flavor) Maybe(Return.Lutimes) {
if (comptime Environment.isWindows) {
return Maybe(Return.Lutimes).todo;
}
@@ -5332,18 +4928,10 @@ pub const NodeFS = struct {
},
};
- switch (comptime flavor) {
- // futimes uses the syscall version
- // we use libc because here, not for a good reason
- // just missing from the linux syscall interface in zig and I don't want to modify that right now
- .sync => return if (Maybe(Return.Lutimes).errnoSysP(C.lutimes(args.path.sliceZ(&this.sync_error_buf), &times), .lutimes, args.path.slice())) |err|
- err
- else
- Maybe(Return.Lutimes).success,
- else => {},
- }
-
- return Maybe(Return.Lutimes).todo;
+ return if (Maybe(Return.Lutimes).errnoSysP(C.lutimes(args.path.sliceZ(&this.sync_error_buf), &times), .lutimes, args.path.slice())) |err|
+ err
+ else
+ Maybe(Return.Lutimes).success;
}
pub fn watch(_: *NodeFS, args: Arguments.Watch, comptime _: Flavor) Maybe(Return.Watch) {
if (comptime Environment.isWindows) {
diff --git a/src/bun.js/node/node_fs_binding.zig b/src/bun.js/node/node_fs_binding.zig
index b3866b557..967acbe53 100644
--- a/src/bun.js/node/node_fs_binding.zig
+++ b/src/bun.js/node/node_fs_binding.zig
@@ -67,6 +67,7 @@ fn callSync(comptime FunctionEnum: NodeFSFunctionEnum) NodeFSFunction {
args,
comptime Flavor.sync,
);
+
switch (result) {
.err => |err| {
globalObject.throwValue(JSC.JSValue.c(err.toJS(globalObject)));
@@ -108,14 +109,6 @@ fn call(comptime FunctionEnum: NodeFSFunctionEnum) NodeFSFunction {
globalObject: *JSC.JSGlobalObject,
callframe: *JSC.CallFrame,
) callconv(.C) JSC.JSValue {
- switch (comptime FunctionEnum) {
- .readdir, .lstat, .stat, .readFile, .realpath, .copyFile, .cp => {},
- else => {
- globalObject.throw("Not implemented yet", .{});
- return .zero;
- },
- }
-
var arguments = callframe.arguments(8);
var slice = ArgumentsSlice.init(globalObject.bunVM(), arguments.ptr[0..arguments.len]);
@@ -142,57 +135,12 @@ fn call(comptime FunctionEnum: NodeFSFunctionEnum) NodeFSFunction {
// TODO: handle globalObject.throwValue
- if (comptime FunctionEnum == .readdir) {
- return JSC.Node.AsyncReaddirTask.create(globalObject, args, slice.vm, slice.arena);
- }
-
- if (comptime FunctionEnum == .readFile) {
- return JSC.Node.AsyncReadFileTask.create(globalObject, args, slice.vm, slice.arena);
- }
-
- if (comptime FunctionEnum == .realpath) {
- return JSC.Node.AsyncRealpathTask.create(globalObject, args, slice.vm, slice.arena);
- }
-
- if (comptime FunctionEnum == .stat or FunctionEnum == .lstat) {
- return JSC.Node.AsyncStatTask.create(globalObject, args, slice.vm, FunctionEnum == .lstat, slice.arena);
- }
-
- if (comptime FunctionEnum == .copyFile) {
- return JSC.Node.AsyncCopyFileTask.create(globalObject, args, slice.vm, slice.arena);
- }
-
+ const Task = @field(JSC.Node.Async, @tagName(FunctionEnum));
if (comptime FunctionEnum == .cp) {
- return JSC.Node.AsyncCpTask.create(globalObject, args, slice.vm, slice.arena);
+ return Task.create(globalObject, args, globalObject.bunVM(), slice.arena);
+ } else {
+ return Task.create(globalObject, args, globalObject.bunVM());
}
-
- // defer {
- // for (arguments.len) |arg| {
- // JSC.C.JSValueUnprotect(ctx, arg);
- // }
- // slice.arena.deinit();
- // }
-
- // const args = if (comptime Arguments != void)
- // Arguments.fromJS(ctx, &slice, exception)
- // else
- // Arguments{};
- // if (exception.* != null) return null;
-
- // const result: Maybe(Result) = Function(this, comptime Flavor.sync, args);
- // switch (result) {
- // .err => |err| {
- // exception.* = err.toJS(ctx);
- // return null;
- // },
- // .result => |res| {
- // return switch (comptime Result) {
- // void => JSC.JSValue.jsUndefined().asRef(),
- // else => res.toJS(ctx),
- // };
- // },
- // }
- // unreachable;
}
};
return NodeBindingClosure.bind;
diff --git a/src/bun.js/node/node_fs_constant.zig b/src/bun.js/node/node_fs_constant.zig
index 0d8ec66c5..75211723d 100644
--- a/src/bun.js/node/node_fs_constant.zig
+++ b/src/bun.js/node/node_fs_constant.zig
@@ -6,8 +6,9 @@ fn get(comptime name: []const u8) comptime_int {
return if (@hasDecl(std.os.O, name))
return @field(std.os.O, name)
else
- return 0;
+ @compileError("Unknown Constant: " ++ name);
}
+
pub const Constants = struct {
// File Access Constants
/// Constant for fs.access(). File is visible to the calling process.
@@ -41,16 +42,15 @@ pub const Constants = struct {
};
/// Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists.
- pub const COPYFILE_EXCL: i32 = 1 << Copyfile.exclusive;
-
+ pub const COPYFILE_EXCL: i32 = Copyfile.exclusive;
///
/// Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink.
/// If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used.
- pub const COPYFILE_FICLONE: i32 = 1 << Copyfile.clone;
+ pub const COPYFILE_FICLONE: i32 = Copyfile.clone;
///
/// Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink.
/// If the underlying platform does not support copy-on-write, then the operation will fail with an error.
- pub const COPYFILE_FICLONE_FORCE: i32 = 1 << Copyfile.force;
+ pub const COPYFILE_FICLONE_FORCE: i32 = Copyfile.force;
// File Open Constants
/// Constant for fs.open(). Flag indicating to open a file for read-only access.
pub const O_RDONLY = std.os.O.RDONLY;
@@ -142,64 +142,3 @@ pub const Constants = struct {
/// this flag is ignored.
pub const UV_FS_O_FILEMAP = 49152;
};
-
-// Due to zig's format support max 32 arguments, we need to split
-// here.
-const constants_string_format1 =
- \\var constants = {{
- \\ F_OK: {d},
- \\ R_OK: {d},
- \\ W_OK: {d},
- \\ X_OK: {d},
- \\ COPYFILE_EXCL: {d},
- \\ COPYFILE_FICLONE: {d},
- \\ COPYFILE_FICLONE_FORCE: {d},
- \\ O_RDONLY: {d},
- \\ O_WRONLY: {d},
- \\ O_RDWR: {d},
- \\ O_CREAT: {d},
- \\ O_EXCL: {d},
- \\ O_NOCTTY: {d},
- \\ O_TRUNC: {d},
- \\ O_APPEND: {d},
- \\ O_DIRECTORY: {d},
- \\ O_NOATIME: {d},
- \\ O_NOFOLLOW: {d},
- \\ O_SYNC: {d},
- \\ O_DSYNC: {d},
-;
-const constants_string_format2 =
- \\ O_SYMLINK: {s},
- \\ O_DIRECT: {d},
- \\ O_NONBLOCK: {d},
- \\ S_IFMT: {d},
- \\ S_IFREG: {d},
- \\ S_IFDIR: {d},
- \\ S_IFCHR: {d},
- \\ S_IFBLK: {d},
- \\ S_IFIFO: {d},
- \\ S_IFLNK: {d},
- \\ S_IFSOCK: {d},
- \\ S_IRWXU: {d},
- \\ S_IRUSR: {d},
- \\ S_IWUSR: {d},
- \\ S_IXUSR: {d},
- \\ S_IRWXG: {d},
- \\ S_IRGRP: {d},
- \\ S_IWGRP: {d},
- \\ S_IXGRP: {d},
- \\ S_IRWXO: {d},
- \\ S_IROTH: {d},
- \\ S_IWOTH: {d},
- \\ S_IXOTH: {d},
- \\ UV_FS_O_FILEMAP: {d}
- \\}};
- \\
-;
-
-const constants_string1 = std.fmt.comptimePrint(constants_string_format1, .{ Constants.F_OK, Constants.R_OK, Constants.W_OK, Constants.X_OK, Constants.COPYFILE_EXCL, Constants.COPYFILE_FICLONE, Constants.COPYFILE_FICLONE_FORCE, Constants.O_RDONLY, Constants.O_WRONLY, Constants.O_RDWR, Constants.O_CREAT, Constants.O_EXCL, Constants.O_NOCTTY, Constants.O_TRUNC, Constants.O_APPEND, Constants.O_DIRECTORY, Constants.O_NOATIME, Constants.O_NOFOLLOW, Constants.O_SYNC, Constants.O_DSYNC });
-
-const constants_string2 =
- std.fmt.comptimePrint(constants_string_format2, .{ if (@TypeOf(Constants.O_SYMLINK) == void) "undefined" else std.fmt.comptimePrint("{}", .{Constants.O_SYMLINK}), Constants.O_DIRECT, Constants.O_NONBLOCK, Constants.S_IFMT, Constants.S_IFREG, Constants.S_IFDIR, Constants.S_IFCHR, Constants.S_IFBLK, Constants.S_IFIFO, Constants.S_IFLNK, Constants.S_IFSOCK, Constants.S_IRWXU, Constants.S_IRUSR, Constants.S_IWUSR, Constants.S_IXUSR, Constants.S_IRWXG, Constants.S_IRGRP, Constants.S_IWGRP, Constants.S_IXGRP, Constants.S_IRWXO, Constants.S_IROTH, Constants.S_IWOTH, Constants.S_IXOTH, Constants.UV_FS_O_FILEMAP });
-
-pub const constants_string = constants_string1 ++ constants_string2;
diff --git a/src/bun.js/node/node_fs_stat_watcher.zig b/src/bun.js/node/node_fs_stat_watcher.zig
index c2690c200..158a08ff7 100644
--- a/src/bun.js/node/node_fs_stat_watcher.zig
+++ b/src/bun.js/node/node_fs_stat_watcher.zig
@@ -97,7 +97,7 @@ pub const StatWatcherScheduler = struct {
prev = next;
} else {
if (this.head.load(.Monotonic) == null) {
- this.timer.?.deinit();
+ this.timer.?.deinit(false);
this.timer = null;
// The scheduler is not deinit here, but it will get reused.
}
@@ -198,7 +198,7 @@ pub const StatWatcher = struct {
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Arguments {
const vm = ctx.vm();
- const path = PathLike.fromJS(ctx, arguments, exception) orelse {
+ const path = PathLike.fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception) orelse {
if (exception.* == null) {
JSC.throwInvalidArguments(
"filename must be a string or TypedArray",
diff --git a/src/bun.js/node/node_os.zig b/src/bun.js/node/node_os.zig
index 07dec1c7d..ae8f527ce 100644
--- a/src/bun.js/node/node_os.zig
+++ b/src/bun.js/node/node_os.zig
@@ -531,6 +531,9 @@ pub const Os = struct {
addr_data[3], addr_data[4], addr_data[5],
}) catch unreachable;
interface.put(globalThis, JSC.ZigString.static("mac"), JSC.ZigString.init(mac).withEncoding().toValueGC(globalThis));
+ } else {
+ const mac = "00:00:00:00:00:00";
+ interface.put(globalThis, JSC.ZigString.static("mac"), JSC.ZigString.init(mac).withEncoding().toValueGC(globalThis));
}
}
diff --git a/src/bun.js/node/path_watcher.zig b/src/bun.js/node/path_watcher.zig
index 4f44a68ff..e00451a38 100644
--- a/src/bun.js/node/path_watcher.zig
+++ b/src/bun.js/node/path_watcher.zig
@@ -286,17 +286,8 @@ pub const PathWatcherManager = struct {
if (!(path.len == 1 and entry_point[0] == '/')) {
path = path[entry_point.len..];
- if (path.len == 0) {
- while (path.len > 0) {
- if (bun.strings.startsWithChar(path, '/')) {
- path = path[1..];
- break;
- } else {
- path = path[1..];
- }
- }
- } else {
- // Skip forward slash
+ // Skip leading slash
+ if (bun.strings.startsWithChar(path, '/')) {
path = path[1..];
}
}
diff --git a/src/bun.js/node/types.zig b/src/bun.js/node/types.zig
index 35daea52c..96d1a00ef 100644
--- a/src/bun.js/node/types.zig
+++ b/src/bun.js/node/types.zig
@@ -315,6 +315,89 @@ pub const StringOrBunStringOrBuffer = union(enum) {
}
};
+pub const SliceWithUnderlyingStringOrBuffer = union(enum) {
+ SliceWithUnderlyingString: bun.SliceWithUnderlyingString,
+ buffer: Buffer,
+
+ pub fn toThreadSafe(this: *@This()) void {
+ switch (this.*) {
+ .SliceWithUnderlyingString => this.SliceWithUnderlyingString.toThreadSafe(),
+ else => {},
+ }
+ }
+
+ pub fn toJS(this: *SliceWithUnderlyingStringOrBuffer, ctx: JSC.C.JSContextRef, exception: JSC.C.ExceptionRef) JSC.C.JSValueRef {
+ return switch (this) {
+ .SliceWithUnderlyingStringOrBuffer => {
+ defer {
+ this.SliceWithUnderlyingString.deinit();
+ this.SliceWithUnderlyingString.underlying = bun.String.empty;
+ this.SliceWithUnderlyingString.utf8 = .{};
+ }
+
+ return this.SliceWithUnderlyingString.underlying.toJS(ctx);
+ },
+ .buffer => this.buffer.toJSObjectRef(ctx, exception),
+ };
+ }
+
+ pub fn slice(this: *const SliceWithUnderlyingStringOrBuffer) []const u8 {
+ return switch (this.*) {
+ .SliceWithUnderlyingString => this.SliceWithUnderlyingString.slice(),
+ .buffer => this.buffer.slice(),
+ };
+ }
+
+ pub fn deinit(this: *const SliceWithUnderlyingStringOrBuffer) void {
+ switch (this.*) {
+ .SliceWithUnderlyingString => |*str| {
+ str.deinit();
+ },
+ else => {},
+ }
+ }
+
+ pub fn deinitAndUnprotect(this: *const SliceWithUnderlyingStringOrBuffer) void {
+ switch (this.*) {
+ .SliceWithUnderlyingString => |*str| {
+ str.deinit();
+ },
+ .buffer => |buffer| {
+ buffer.buffer.value.unprotect();
+ },
+ }
+ }
+
+ pub fn fromJS(global: *JSC.JSGlobalObject, allocator: std.mem.Allocator, value: JSC.JSValue, exception: JSC.C.ExceptionRef) ?SliceWithUnderlyingStringOrBuffer {
+ _ = exception;
+ return switch (value.jsType()) {
+ JSC.JSValue.JSType.String, JSC.JSValue.JSType.StringObject, JSC.JSValue.JSType.DerivedStringObject, JSC.JSValue.JSType.Object => {
+ var str = bun.String.tryFromJS(value, global) orelse return null;
+ str.ref();
+ return SliceWithUnderlyingStringOrBuffer{ .SliceWithUnderlyingString = str.toSlice(allocator) };
+ },
+
+ .ArrayBuffer,
+ .Int8Array,
+ .Uint8Array,
+ .Uint8ClampedArray,
+ .Int16Array,
+ .Uint16Array,
+ .Int32Array,
+ .Uint32Array,
+ .Float32Array,
+ .Float64Array,
+ .BigInt64Array,
+ .BigUint64Array,
+ .DataView,
+ => SliceWithUnderlyingStringOrBuffer{
+ .buffer = Buffer.fromArrayBuffer(global, value),
+ },
+ else => null,
+ };
+ }
+};
+
/// Like StringOrBuffer but actually returns a Node.js Buffer
pub const StringOrNodeBuffer = union(Tag) {
string: string,
@@ -401,6 +484,20 @@ pub const SliceOrBuffer = union(Tag) {
}
}
+ pub fn toThreadSafe(this: *SliceOrBuffer) void {
+ var buffer: ?Buffer = null;
+ if (this.* == .buffer) {
+ buffer = this.buffer;
+ this.buffer.buffer.value.ensureStillAlive();
+ }
+ defer {
+ if (buffer) |buf| {
+ buf.buffer.value.unprotect();
+ }
+ }
+ this.ensureCloned(bun.default_allocator) catch unreachable;
+ }
+
pub const Tag = enum { string, buffer };
pub fn slice(this: SliceOrBuffer) []const u8 {
@@ -650,6 +747,10 @@ pub const PathLike = union(Tag) {
if (this.* == .slice_with_underlying_string) {
this.slice_with_underlying_string.toThreadSafe();
}
+
+ if (this.* == .buffer) {
+ this.buffer.buffer.value.protect();
+ }
}
pub fn deinitAndUnprotect(this: *const PathLike) void {
@@ -722,7 +823,7 @@ pub const PathLike = union(Tag) {
}
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?PathLike {
- return fromJSWithAllocator(ctx, arguments, arguments.arena.allocator(), exception);
+ return fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception);
}
pub fn fromJSWithAllocator(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, allocator: std.mem.Allocator, exception: JSC.C.ExceptionRef) ?PathLike {
const arg = arguments.next() orelse return null;
@@ -801,11 +902,7 @@ pub const Valid = struct {
pub fn pathSlice(zig_str: JSC.ZigString.Slice, ctx: JSC.C.JSContextRef, exception: JSC.C.ExceptionRef) bool {
switch (zig_str.len) {
- 0 => {
- JSC.throwInvalidArguments("Invalid path string: can't be empty", .{}, ctx, exception);
- return false;
- },
- 1...bun.MAX_PATH_BYTES => return true,
+ 0...bun.MAX_PATH_BYTES => return true,
else => {
// TODO: should this be an EINVAL?
JSC.throwInvalidArguments(
@@ -823,11 +920,7 @@ pub const Valid = struct {
pub fn pathStringLength(len: usize, ctx: JSC.C.JSContextRef, exception: JSC.C.ExceptionRef) bool {
switch (len) {
- 0 => {
- JSC.throwInvalidArguments("Invalid path string: can't be empty", .{}, ctx, exception);
- return false;
- },
- 1...bun.MAX_PATH_BYTES => return true,
+ 0...bun.MAX_PATH_BYTES => return true,
else => {
// TODO: should this be an EINVAL?
JSC.throwInvalidArguments(
@@ -2120,6 +2213,8 @@ pub const Path = struct {
if (comptime is_bindgen) return JSC.JSValue.jsUndefined();
if (args_len == 0) return JSC.ZigString.init("").toValue(globalThis);
var arena = @import("root").bun.ArenaAllocator.init(heap_allocator);
+ defer arena.deinit();
+
var arena_allocator = arena.allocator();
var stack_fallback_allocator = std.heap.stackFallback(
((32 * @sizeOf(string)) + 1024),
@@ -2127,18 +2222,27 @@ pub const Path = struct {
);
var allocator = stack_fallback_allocator.get();
- defer arena.deinit();
var buf: [bun.MAX_PATH_BYTES]u8 = undefined;
+ var count: usize = 0;
var to_join = allocator.alloc(string, args_len) catch unreachable;
for (args_ptr[0..args_len], 0..) |arg, i| {
const zig_str: JSC.ZigString = arg.getZigString(globalThis);
to_join[i] = zig_str.toSlice(allocator).slice();
+ count += to_join[i].len;
+ }
+
+ var buf_to_use: []u8 = &buf;
+ if (count * 2 >= buf.len) {
+ buf_to_use = allocator.alloc(u8, count * 2) catch {
+ globalThis.throwOutOfMemory();
+ return .zero;
+ };
}
const out = if (!isWindows)
- PathHandler.joinStringBuf(&buf, to_join, .posix)
+ PathHandler.joinStringBuf(buf_to_use, to_join, .posix)
else
- PathHandler.joinStringBuf(&buf, to_join, .windows);
+ PathHandler.joinStringBuf(buf_to_use, to_join, .windows);
var str = bun.String.create(out);
defer str.deref();
diff --git a/src/bun.js/rare_data.zig b/src/bun.js/rare_data.zig
index 44e482049..c9d742d96 100644
--- a/src/bun.js/rare_data.zig
+++ b/src/bun.js/rare_data.zig
@@ -39,6 +39,32 @@ mime_types: ?bun.HTTP.MimeType.Map = null,
node_fs_stat_watcher_scheduler: ?*StatWatcherScheduler = null,
+listening_sockets_for_watch_mode: std.ArrayListUnmanaged(bun.FileDescriptor) = .{},
+listening_sockets_for_watch_mode_lock: bun.Lock = bun.Lock.init(),
+
+pub fn addListeningSocketForWatchMode(this: *RareData, socket: bun.FileDescriptor) void {
+ this.listening_sockets_for_watch_mode_lock.lock();
+ defer this.listening_sockets_for_watch_mode_lock.unlock();
+ this.listening_sockets_for_watch_mode.append(bun.default_allocator, socket) catch {};
+}
+
+pub fn removeListeningSocketForWatchMode(this: *RareData, socket: bun.FileDescriptor) void {
+ this.listening_sockets_for_watch_mode_lock.lock();
+ defer this.listening_sockets_for_watch_mode_lock.unlock();
+ if (std.mem.indexOfScalar(bun.FileDescriptor, this.listening_sockets_for_watch_mode.items, socket)) |i| {
+ _ = this.listening_sockets_for_watch_mode.swapRemove(i);
+ }
+}
+
+pub fn closeAllListenSocketsForWatchMode(this: *RareData) void {
+ this.listening_sockets_for_watch_mode_lock.lock();
+ defer this.listening_sockets_for_watch_mode_lock.unlock();
+ for (this.listening_sockets_for_watch_mode.items) |socket| {
+ _ = Syscall.close(socket);
+ }
+ this.listening_sockets_for_watch_mode = .{};
+}
+
pub fn hotMap(this: *RareData, allocator: std.mem.Allocator) *HotMap {
if (this.hot_map == null) {
this.hot_map = HotMap.init(allocator);
diff --git a/src/bun.js/scripts/create_hash_table b/src/bun.js/scripts/create_hash_table
index e2645b429..bd604ceaa 100755
--- a/src/bun.js/scripts/create_hash_table
+++ b/src/bun.js/scripts/create_hash_table
@@ -5,7 +5,7 @@
# (c) 2000-2002 by Harri Porten <porten@kde.org> and
# David Faure <faure@kde.org>
# Modified (c) 2004 by Nikolas Zimmermann <wildfox@kde.org>
-# Copyright (C) 2007-2022 Apple Inc. All rights reserved.
+# Copyright (C) 2007-2023 Apple Inc. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -24,6 +24,7 @@
use strict;
use warnings;
+use Math::BigInt;
use Getopt::Long qw(:config pass_through);
my $file = shift @ARGV or die("Must provide source file as final argument.");
@@ -33,7 +34,6 @@ open(IN, $file) or die "No such file $file";
my @keys = ();
my @attrs = ();
my @values = ();
-my @hashes = ();
my @table = ();
my @links = ();
@@ -46,11 +46,13 @@ my $pefectHashSize;
my $compactSize;
my $compactHashSizeMask;
my $banner = 0;
-sub calcPerfectHashSize();
-sub calcCompactHashSize();
+my $mask64 = 2**64 - 1;
+my $mask32 = 2**32 - 1;
+sub calcPerfectHashSize($);
+sub calcCompactHashSize($);
sub output();
sub jsc_ucfirst($);
-sub hashValue($);
+sub hashValue($$);
while (<IN>) {
chomp;
@@ -64,16 +66,11 @@ while (<IN>) {
print STDERR "WARNING: \@begin without table name, skipping $_\n";
}
} elsif (/^\@end\s*$/ && $inside) {
- calcPerfectHashSize();
- calcCompactHashSize();
output();
@keys = ();
@attrs = ();
@values = ();
- @hashes = ();
- @table = ();
- @links = ();
$includeBuiltin = 0;
$inside = 0;
@@ -114,7 +111,6 @@ while (<IN>) {
} else {
push(@values, { "type" => "Lexer", "value" => $val });
}
- push(@hashes, hashValue($key));
} elsif ($inside) {
die "invalid data {" . $_ . "}";
}
@@ -147,13 +143,14 @@ sub ceilingToPowerOf2
return $powerOf2;
}
-sub calcPerfectHashSize()
+sub calcPerfectHashSize($)
{
+ my ($isMac) = @_;
tableSizeLoop:
for ($pefectHashSize = ceilingToPowerOf2(scalar @keys); ; $pefectHashSize += $pefectHashSize) {
my @table = ();
foreach my $key (@keys) {
- my $h = hashValue($key) % $pefectHashSize;
+ my $h = hashValue($key, $isMac) % $pefectHashSize;
next tableSizeLoop if $table[$h];
$table[$h] = 1;
}
@@ -166,8 +163,9 @@ sub leftShift($$) {
return (($value << $distance) & 0xFFFFFFFF);
}
-sub calcCompactHashSize()
+sub calcCompactHashSize($)
{
+ my ($isMac) = @_;
my $compactHashSize = ceilingToPowerOf2(2 * @keys);
$compactHashSizeMask = $compactHashSize - 1;
$compactSize = $compactHashSize;
@@ -176,7 +174,7 @@ sub calcCompactHashSize()
my $i = 0;
foreach my $key (@keys) {
my $depth = 0;
- my $h = hashValue($key) % $compactHashSize;
+ my $h = hashValue($key, $isMac) % $compactHashSize;
while (defined($table[$h])) {
if (defined($links[$h])) {
$h = $links[$h];
@@ -194,60 +192,222 @@ sub calcCompactHashSize()
}
}
+sub avalancheBits($) {
+ my ($value) = @_;
+
+ $value &= $mask32;
+
+ # Force "avalanching" of lower 32 bits
+ $value ^= leftShift($value, 3);
+ $value += ($value >> 5);
+ $value = ($value & $mask32);
+ $value ^= (leftShift($value, 2) & $mask32);
+ $value += ($value >> 15);
+ $value = $value & $mask32;
+ $value ^= (leftShift($value, 10) & $mask32);
+
+ return $value;
+}
+
+sub maskTop8BitsAndAvoidZero($) {
+ my ($value) = @_;
+
+ $value &= $mask32;
+
+ # Save 8 bits for StringImpl to use as flags.
+ $value &= 0xffffff;
+
+ # This avoids ever returning a hash code of 0, since that is used to
+ # signal "hash not computed yet". Setting the high bit maintains
+ # reasonable fidelity to a hash code of 0 because it is likely to yield
+ # exactly 0 when hash lookup masks out the high bits.
+ $value = (0x80000000 >> 8) if ($value == 0);
+
+ return $value;
+}
+
# Paul Hsieh's SuperFastHash
# http://www.azillionmonkeys.com/qed/hash.html
-sub hashValue($) {
- my @chars = split(/ */, $_[0]);
-
- # This hash is designed to work on 16-bit chunks at a time. But since the normal case
- # (above) is to hash UTF-16 characters, we just treat the 8-bit chars as if they
- # were 16-bit chunks, which should give matching results
-
- my $EXP2_32 = 4294967296;
-
- my $hash = 0x9e3779b9;
- my $l = scalar @chars; #I wish this was in Ruby --- Maks
- my $rem = $l & 1;
- $l = $l >> 1;
-
- my $s = 0;
-
- # Main loop
- for (; $l > 0; $l--) {
- $hash += ord($chars[$s]);
- my $tmp = leftShift(ord($chars[$s+1]), 11) ^ $hash;
- $hash = (leftShift($hash, 16)% $EXP2_32) ^ $tmp;
- $s += 2;
- $hash += $hash >> 11;
- $hash %= $EXP2_32;
- }
-
- # Handle end case
- if ($rem != 0) {
- $hash += ord($chars[$s]);
- $hash ^= (leftShift($hash, 11)% $EXP2_32);
- $hash += $hash >> 17;
- }
-
- # Force "avalanching" of final 127 bits
- $hash ^= leftShift($hash, 3);
- $hash += ($hash >> 5);
- $hash = ($hash% $EXP2_32);
- $hash ^= (leftShift($hash, 2)% $EXP2_32);
- $hash += ($hash >> 15);
- $hash = $hash% $EXP2_32;
- $hash ^= (leftShift($hash, 10)% $EXP2_32);
-
- # Save 8 bits for StringImpl to use as flags.
- $hash &= 0xffffff;
-
- # This avoids ever returning a hash code of 0, since that is used to
- # signal "hash not computed yet". Setting the high bit maintains
- # reasonable fidelity to a hash code of 0 because it is likely to yield
- # exactly 0 when hash lookup masks out the high bits.
- $hash = (0x80000000 >> 8) if ($hash == 0);
-
- return $hash;
+sub superFastHash {
+ my @chars = @_;
+
+ # This hash is designed to work on 16-bit chunks at a time. But since the normal case
+ # (above) is to hash UTF-16 characters, we just treat the 8-bit chars as if they
+ # were 16-bit chunks, which should give matching results
+
+ my $hash = 0x9e3779b9;
+ my $l = scalar @chars; #I wish this was in Ruby --- Maks
+ my $rem = $l & 1;
+ $l = $l >> 1;
+
+ my $s = 0;
+
+ # Main loop
+ for (; $l > 0; $l--) {
+ $hash += ord($chars[$s]);
+ my $tmp = leftShift(ord($chars[$s+1]), 11) ^ $hash;
+ $hash = (leftShift($hash, 16) & $mask32) ^ $tmp;
+ $s += 2;
+ $hash += $hash >> 11;
+ $hash &= $mask32;
+ }
+
+ # Handle end case
+ if ($rem != 0) {
+ $hash += ord($chars[$s]);
+ $hash ^= (leftShift($hash, 11) & $mask32);
+ $hash += $hash >> 17;
+ }
+
+ $hash = avalancheBits($hash);
+ return maskTop8BitsAndAvoidZero($hash);
+}
+
+sub uint64_add($$) {
+ my ($a, $b) = @_;
+ my $sum = $a + $b;
+ return $sum & $mask64;
+}
+
+sub uint64_multi($$) {
+ my ($a, $b) = @_;
+ my $product = $a * $b;
+ return $product & $mask64;
+}
+
+sub wymum($$) {
+ my ($A, $B) = @_;
+
+ my $ha = $A >> 32;
+ my $hb = $B >> 32;
+ my $la = $A & $mask32;
+ my $lb = $B & $mask32;
+ my $hi;
+ my $lo;
+ my $rh = uint64_multi($ha, $hb);
+ my $rm0 = uint64_multi($ha, $lb);
+ my $rm1 = uint64_multi($hb, $la);
+ my $rl = uint64_multi($la, $lb);
+ my $t = uint64_add($rl, ($rm0 << 32));
+ my $c = int($t < $rl);
+
+ $lo = uint64_add($t, ($rm1 << 32));
+ $c += int($lo < $t);
+ $hi = uint64_add($rh, uint64_add(($rm0 >> 32), uint64_add(($rm1 >> 32), $c)));
+
+ return ($lo, $hi);
+};
+
+sub wymix($$) {
+ my ($A, $B) = @_;
+ ($A, $B) = wymum($A, $B);
+ return $A ^ $B;
+}
+
+sub convert32BitTo64Bit($) {
+ my ($v) = @_;
+ my ($mask1) = 281470681808895; # 0x0000_ffff_0000_ffff
+ $v = ($v | ($v << 16)) & $mask1;
+ my ($mask2) = 71777214294589695; # 0x00ff_00ff_00ff_00ff
+ return ($v | ($v << 8)) & $mask2;
+}
+
+sub convert16BitTo32Bit($) {
+ my ($v) = @_;
+ return ($v | ($v << 8)) & 0x00ff_00ff;
+}
+
+sub wyhash {
+ # https://github.com/wangyi-fudan/wyhash
+ my @chars = @_;
+ my $charCount = scalar @chars;
+ my $byteCount = $charCount << 1;
+ my $charIndex = 0;
+ my $seed = 0;
+ my @secret = ( 11562461410679940143, 16646288086500911323, 10285213230658275043, 6384245875588680899 );
+ my $move1 = (($byteCount >> 3) << 2) >> 1;
+
+ $seed ^= wymix($seed ^ $secret[0], $secret[1]);
+ my $a = 0;
+ my $b = 0;
+
+ local *c2i = sub {
+ my ($i) = @_;
+ return ord($chars[$i]);
+ };
+
+ local *wyr8 = sub {
+ my ($i) = @_;
+ my $v = c2i($i) | (c2i($i + 1) << 8) | (c2i($i + 2) << 16) | (c2i($i + 3) << 24);
+ return convert32BitTo64Bit($v);
+ };
+
+ local *wyr4 = sub {
+ my ($i) = @_;
+ my $v = c2i($i) | (c2i($i + 1) << 8);
+ return convert16BitTo32Bit($v);
+ };
+
+ local *wyr2 = sub {
+ my ($i) = @_;
+ return c2i($i) << 16;
+ };
+
+ if ($byteCount <= 16) {
+ if ($byteCount >= 4) {
+ $a = (wyr4($charIndex) << 32) | wyr4($charIndex + $move1);
+ $charIndex = $charIndex + $charCount - 2;
+ $b = (wyr4($charIndex) << 32) | wyr4($charIndex - $move1);
+ } elsif ($byteCount > 0) {
+ $a = wyr2($charIndex);
+ $b = 0;
+ } else {
+ $a = $b = 0;
+ }
+ } else {
+ my $i = $byteCount;
+ if ($i > 48) {
+ my $see1 = $seed;
+ my $see2 = $seed;
+ do {
+ $seed = wymix(wyr8($charIndex) ^ $secret[1], wyr8($charIndex + 4) ^ $seed);
+ $see1 = wymix(wyr8($charIndex + 8) ^ $secret[2], wyr8($charIndex + 12) ^ $see1);
+ $see2 = wymix(wyr8($charIndex + 16) ^ $secret[3], wyr8($charIndex + 20) ^ $see2);
+ $charIndex += 24;
+ $i -= 48;
+ } while ($i > 48);
+ $seed ^= $see1 ^ $see2;
+ }
+ while ($i > 16) {
+ $seed = wymix(wyr8($charIndex) ^ $secret[1], wyr8($charIndex + 4) ^ $seed);
+ $i -= 16;
+ $charIndex += 8;
+ }
+ my $move2 = $i >> 1;
+ $a = wyr8($charIndex + $move2 - 8);
+ $b = wyr8($charIndex + $move2 - 4);
+ }
+ $a ^= $secret[1];
+ $b ^= $seed;
+
+ ($a, $b) = wymum($a, $b);
+ my $hash = wymix($a ^ $secret[0] ^ $byteCount, $b ^ $secret[1]) & $mask32;
+
+ return maskTop8BitsAndAvoidZero($hash);
+}
+
+sub hashValue($$) {
+ my ($string, $isMac) = @_;
+ my @chars = split(/ */, $string);
+ my $charCount = scalar @chars;
+ if ($isMac) {
+ if ($charCount <= 48) {
+ return superFastHash(@chars);
+ }
+ return wyhash(@chars);
+ } else {
+ return superFastHash(@chars);
+ }
}
sub output() {
@@ -267,81 +427,110 @@ sub output() {
print "\n";
print "namespace JSC {\n";
print "\n";
- if ($compactSize != 0) {
- print "static const struct CompactHashIndex ${nameIndex}\[$compactSize\] = {\n";
- for (my $i = 0; $i < $compactSize; $i++) {
- my $T = -1;
- if (defined($table[$i])) { $T = $table[$i]; }
- my $L = -1;
- if (defined($links[$i])) { $L = $links[$i]; }
- print " { $T, $L },\n";
+
+ local *generateHashTableHelper = sub {
+ my ($isMac, $setToOldValues) = @_;
+ my $oldCompactSize = $compactSize;
+ my $oldCompactHashSizeMask = $compactHashSizeMask;
+ calcPerfectHashSize($isMac);
+ calcCompactHashSize($isMac);
+
+ my $hashTableString = "";
+
+ if ($compactSize != 0) {
+ $hashTableString .= "static const struct CompactHashIndex ${nameIndex}\[$compactSize\] = {\n";
+ for (my $i = 0; $i < $compactSize; $i++) {
+ my $T = -1;
+ if (defined($table[$i])) { $T = $table[$i]; }
+ my $L = -1;
+ if (defined($links[$i])) { $L = $links[$i]; }
+ $hashTableString .= " { $T, $L },\n";
+ }
+ } else {
+ # MSVC dislikes empty arrays.
+ $hashTableString .= "static const struct CompactHashIndex ${nameIndex}\[1\] = {\n";
+ $hashTableString .= " { 0, 0 }\n";
}
- } else {
- # MSVC dislikes empty arrays.
- print "static const struct CompactHashIndex ${nameIndex}\[1\] = {\n";
- print " { 0, 0 }\n";
- }
- print "};\n";
- print "\n";
+ $hashTableString .= "};\n";
+ $hashTableString .= "\n";
- my $packedSize = scalar @keys;
- if ($packedSize != 0) {
- print "static const struct HashTableValue ${nameEntries}\[$packedSize\] = {\n";
- } else {
- # MSVC dislikes empty arrays.
- print "static const struct HashTableValue ${nameEntries}\[1\] = {\n";
- print " { { }, 0, NoIntrinsic, { HashTableValue::End } }\n";
- }
- my $i = 0;
- foreach my $key (@keys) {
- my $typeTag = "";
- my $firstValue = "";
- my $secondValue = "";
- my $hasSecondValue = 1;
- my $intrinsic = "NoIntrinsic";
-
- if ($values[$i]{"type"} eq "PropertyAttribute::Function") {
- $typeTag = "NativeFunction";
- $firstValue = $values[$i]{"function"};
- $secondValue = $values[$i]{"params"};
- $intrinsic = $values[$i]{"intrinsic"};
- } elsif ($values[$i]{"type"} eq "PropertyAttribute::Property") {
- $typeTag = "GetterSetter";
- $firstValue = $values[$i]{"get"};
- $secondValue = $values[$i]{"put"};
- } elsif ($values[$i]{"type"} eq "Lexer") {
- $typeTag = "Lexer";
- $firstValue = $values[$i]{"value"};
- $hasSecondValue = 0;
- } elsif ($values[$i]{"type"} eq "PropertyAttribute::CellProperty" || $values[$i]{"type"} eq "PropertyAttribute::ClassStructure") {
- $typeTag = ($values[$i]{"type"} eq "PropertyAttribute::CellProperty") ? "LazyCellProperty" : "LazyClassStructure";
- $values[$i]{"property"} =~ /\A([a-zA-Z0-9_]+)::(.*)\Z/ or die;
- $firstValue = "OBJECT_OFFSETOF($1, $2)";
- $hasSecondValue = 0;
- } elsif ($values[$i]{"type"} eq "PropertyAttribute::PropertyCallback") {
- $typeTag = "LazyProperty";
- $firstValue = $values[$i]{"cback"};
- $hasSecondValue = 0;
+ my $packedSize = scalar @keys;
+ if ($packedSize != 0) {
+ $hashTableString .= "static const struct HashTableValue ${nameEntries}\[$packedSize\] = {\n";
+ } else {
+ # MSVC dislikes empty arrays.
+ $hashTableString .= "static const struct HashTableValue ${nameEntries}\[1\] = {\n";
+ $hashTableString .= " { { }, 0, NoIntrinsic, { HashTableValue::End } }\n";
}
- my $attributes = "PropertyAttribute::" . $attrs[$i];
- $attributes =~ s/\|/\|PropertyAttribute::/g;
- $attributes = "static_cast<unsigned>(" . $attributes . ")";
- if ($values[$i]{"type"} eq "PropertyAttribute::Function" && $firstValue eq "JSBuiltin") {
- $typeTag = "BuiltinGenerator";
- my $tableHead = $name;
- $tableHead =~ s/Table$//;
- print " { \"$key\"_s, (($attributes) & ~PropertyAttribute::Function) | PropertyAttribute::Builtin, $intrinsic, { HashTableValue::" . $typeTag . "Type, " . $tableHead . ucfirst($key) . "CodeGenerator, $secondValue } },\n";
+ my $i = 0;
+ foreach my $key (@keys) {
+ my $typeTag = "";
+ my $firstValue = "";
+ my $secondValue = "";
+ my $hasSecondValue = 1;
+ my $intrinsic = "NoIntrinsic";
+
+ if ($values[$i]{"type"} eq "PropertyAttribute::Function") {
+ $typeTag = "NativeFunction";
+ $firstValue = $values[$i]{"function"};
+ $secondValue = $values[$i]{"params"};
+ $intrinsic = $values[$i]{"intrinsic"};
+ } elsif ($values[$i]{"type"} eq "PropertyAttribute::Property") {
+ $typeTag = "GetterSetter";
+ $firstValue = $values[$i]{"get"};
+ $secondValue = $values[$i]{"put"};
+ } elsif ($values[$i]{"type"} eq "Lexer") {
+ $typeTag = "Lexer";
+ $firstValue = $values[$i]{"value"};
+ $hasSecondValue = 0;
+ } elsif ($values[$i]{"type"} eq "PropertyAttribute::CellProperty" || $values[$i]{"type"} eq "PropertyAttribute::ClassStructure") {
+ $typeTag = ($values[$i]{"type"} eq "PropertyAttribute::CellProperty") ? "LazyCellProperty" : "LazyClassStructure";
+ $values[$i]{"property"} =~ /\A([a-zA-Z0-9_]+)::(.*)\Z/ or die;
+ $firstValue = "OBJECT_OFFSETOF($1, $2)";
+ $hasSecondValue = 0;
+ } elsif ($values[$i]{"type"} eq "PropertyAttribute::PropertyCallback") {
+ $typeTag = "LazyProperty";
+ $firstValue = $values[$i]{"cback"};
+ $hasSecondValue = 0;
+ }
+
+ my $attributes = "PropertyAttribute::" . $attrs[$i];
+ $attributes =~ s/\|/\|PropertyAttribute::/g;
+ $attributes = "static_cast<unsigned>(" . $attributes . ")";
+ if ($values[$i]{"type"} eq "PropertyAttribute::Function" && $firstValue eq "JSBuiltin") {
+ $typeTag = "BuiltinGenerator";
+ my $tableHead = $name;
+ $tableHead =~ s/Table$//;
+ $hashTableString .= " { \"$key\"_s, (($attributes) & ~PropertyAttribute::Function) | PropertyAttribute::Builtin, $intrinsic, { HashTableValue::" . $typeTag . "Type, " . $tableHead . ucfirst($key) . "CodeGenerator, $secondValue } },\n";
+ }
+ else {
+ $hashTableString .= " { \"$key\"_s, $attributes, $intrinsic, { HashTableValue::" . $typeTag . "Type, $firstValue" . ($hasSecondValue ? ", " . $secondValue : "") . " } },\n";
+ }
+ $i++;
}
- else {
- print " { \"$key\"_s, $attributes, $intrinsic, { HashTableValue::" . $typeTag . "Type, $firstValue" . ($hasSecondValue ? ", " . $secondValue : "") . " } },\n";
+ $hashTableString .= "};\n";
+ $hashTableString .= "\n";
+ $hashTableString .= "static const struct HashTable $name =\n";
+ $hashTableString .= " \{ $packedSize, $compactHashSizeMask, $hasSetter, nullptr, $nameEntries, $nameIndex \};\n";
+ $hashTableString .= "\n";
+
+ @table = ();
+ @links = ();
+ if ($setToOldValues) {
+ $compactSize = $oldCompactSize;
+ $compactHashSizeMask = $oldCompactHashSizeMask;
}
- $i++;
+ return $hashTableString;
+ };
+
+ my $hashTableForMacOS = generateHashTableHelper(1, 1);
+ my $hashTableForIOS = generateHashTableHelper(0, 0);
+ my $hashTableToWrite = $hashTableForMacOS;
+ if ($hashTableForMacOS ne $hashTableForIOS) {
+ $hashTableToWrite = "#if PLATFORM(MAC)\n" . $hashTableForMacOS . "#else\n" . $hashTableForIOS . "#endif\n";
}
- print "};\n";
- print "\n";
- print "static const struct HashTable $name =\n";
- print " \{ $packedSize, $compactHashSizeMask, $hasSetter, nullptr, $nameEntries, $nameIndex \};\n";
- print "\n";
+ print $hashTableToWrite;
+
print "} // namespace JSC\n";
}
diff --git a/src/bun.js/scripts/generate-classes.ts b/src/bun.js/scripts/generate-classes.ts
index b6fbe0915..ae28f4fe5 100644
--- a/src/bun.js/scripts/generate-classes.ts
+++ b/src/bun.js/scripts/generate-classes.ts
@@ -335,7 +335,7 @@ function generatePrototype(typeName, obj) {
this->putDirect(vm, vm.propertyNames->${symbol}Symbol, JSFunction::create(vm, globalObject, 1, String("${symbol}"_s), ${protoSymbolName(
typeName,
symbol,
- )}Callback, ImplementationVisibility::Public), PropertyAttribute::Function | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | 0);`;
+ )}Callback, ImplementationVisibility::Public), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | 0);`;
}
return `
@@ -420,6 +420,7 @@ function generatePrototypeHeader(typename) {
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(${proto}, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -555,7 +556,7 @@ JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES ${name}::construct(JSC::JSGlobalObj
${className(typeName)}* instance = ${className(typeName)}::create(vm, globalObject, structure, ptr);
${
obj.estimatedSize
- ? `vm.heap.reportExtraMemoryAllocated(${symbolName(obj.name, "estimatedSize")}(instance->wrapped()));`
+ ? `vm.heap.reportExtraMemoryAllocated(instance, ${symbolName(obj.name, "estimatedSize")}(instance->wrapped()));`
: ""
}
@@ -1208,7 +1209,11 @@ extern "C" EncodedJSValue ${typeName}__create(Zig::GlobalObject* globalObject, v
auto &vm = globalObject->vm();
JSC::Structure* structure = globalObject->${className(typeName)}Structure();
${className(typeName)}* instance = ${className(typeName)}::create(vm, globalObject, structure, ptr);
- ${obj.estimatedSize ? `vm.heap.reportExtraMemoryAllocated(${symbolName(obj.name, "estimatedSize")}(ptr));` : ""}
+ ${
+ obj.estimatedSize
+ ? `vm.heap.reportExtraMemoryAllocated(instance, ${symbolName(obj.name, "estimatedSize")}(ptr));`
+ : ""
+ }
return JSValue::encode(instance);
}
@@ -1556,43 +1561,19 @@ ${[...exports]
function generateLazyClassStructureHeader(typeName, { klass = {}, proto = {} }) {
return `
- JSC::Structure* ${className(typeName)}Structure() { return m_${className(
+ JSC::Structure* ${className(typeName)}Structure() { return m_${className(
typeName,
)}.getInitializedOnMainThread(this); }
- JSC::JSObject* ${className(typeName)}Constructor() { return m_${className(
+ JSC::JSObject* ${className(typeName)}Constructor() { return m_${className(
typeName,
)}.constructorInitializedOnMainThread(this); }
- JSC::JSValue ${className(typeName)}Prototype() { return m_${className(
+ JSC::JSValue ${className(typeName)}Prototype() { return m_${className(
typeName,
)}.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_${className(typeName)};
- bool has${className(typeName)}SetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_${className(typeName)}SetterValue;
- `.trim();
-}
-
-function generateLazyStructureHeader(typeName, { klass = {}, proto = {} }) {
- return `
- JSC::Structure* ${className(typeName)}Structure() { return m_${className(typeName)}.get(this); }
- JSC::LazyProperty<Zig::GlobalObject, Structure> m_${className(typeName)};
- bool has${className(typeName)}SetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_${className(typeName)}SetterValue;
`.trim();
}
-function generateLazyStructureImpl(typeName, { klass = {}, proto = {} }) {
- return `
- m_${className(typeName)}.initLater(
- [](const JSC::LazyProperty<JSC::JSGlobalObject, JSC::JSObject>::Initializer& init) {
- auto *prototype = WebCore::${className(
- typeName,
- )}::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.owner));
- init.set(WebCore::${className(typeName)}::createStructure(init.vm, init.owner, prototype));
- });
-
- `.trim();
-}
-
function generateLazyClassStructureImpl(typeName, { klass = {}, proto = {}, noConstructor = false }) {
return `
m_${className(typeName)}.initLater(
@@ -1685,7 +1666,7 @@ const GENERATED_CLASSES_IMPL_FOOTER = `
function initLazyClasses(initLaterFunctions) {
return `
-void GlobalObject::initGeneratedLazyClasses() {
+ALWAYS_INLINE void GlobalObject::initGeneratedLazyClasses() {
${initLaterFunctions.map(a => a.trim()).join("\n ")}
}
@@ -1698,14 +1679,7 @@ function visitLazyClasses(classes) {
template<typename Visitor>
void GlobalObject::visitGeneratedLazyClasses(GlobalObject *thisObject, Visitor& visitor)
{
- ${classes
- .map(
- a =>
- `thisObject->m_${className(a.name)}.visit(visitor); visitor.append(thisObject->m_${className(
- a.name,
- )}SetterValue);`,
- )
- .join("\n ")}
+ ${classes.map(a => `thisObject->m_${className(a.name)}.visit(visitor);`).join("\n ")}
}
`.trim();
diff --git a/src/bun.js/scripts/generate-jssink.js b/src/bun.js/scripts/generate-jssink.js
index ef60efbba..758b1863b 100644
--- a/src/bun.js/scripts/generate-jssink.js
+++ b/src/bun.js/scripts/generate-jssink.js
@@ -548,6 +548,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(${prototypeName}, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -580,6 +581,7 @@ class ${controllerPrototypeName} final : public JSC::JSNonFinalObject {
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(${controllerPrototypeName}, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -636,17 +638,19 @@ void JS${controllerName}::detach() {
auto readableStream = m_weakReadableStream.get();
auto onClose = m_onClose.get();
- m_onClose.clear();
if (readableStream && onClose) {
- JSC::JSGlobalObject *globalObject = this->globalObject();
auto callData = JSC::getCallData(onClose);
- JSC::MarkedArgumentBuffer arguments;
- arguments.append(readableStream);
- arguments.append(jsUndefined());
- call(globalObject, onClose, callData, JSC::jsUndefined(), arguments);
+ if(callData.type != JSC::CallData::Type::None) {
+ JSC::JSGlobalObject *globalObject = this->globalObject();
+ JSC::MarkedArgumentBuffer arguments;
+ arguments.append(readableStream);
+ arguments.append(jsUndefined());
+ call(globalObject, onClose, callData, JSC::jsUndefined(), arguments);
+ }
}
-
+
+ m_onClose.clear();
m_weakReadableStream.clear();
}
`;
diff --git a/src/bun.js/test/expect.zig b/src/bun.js/test/expect.zig
index 0d3ff663e..f83a9b194 100644
--- a/src/bun.js/test/expect.zig
+++ b/src/bun.js/test/expect.zig
@@ -1518,7 +1518,7 @@ pub const Expect = struct {
}
const expected_diff = std.math.pow(f64, 10, -precision) / 2;
- const actual_diff = std.math.fabs(received - expected);
+ const actual_diff = @abs(received - expected);
var pass = actual_diff < expected_diff;
const not = this.flags.not;
@@ -1697,7 +1697,7 @@ pub const Expect = struct {
const result: JSValue = result_.?;
var formatter = JSC.ZigConsoleClient.Formatter{ .globalThis = globalObject, .quote_strings = true };
- if (expected_value.isEmpty()) {
+ if (expected_value.isEmpty() or expected_value.isUndefined()) {
const signature_no_args = comptime getSignature("toThrow", "", true);
if (result.toError()) |err| {
const name = err.get(globalObject, "name") orelse JSValue.undefined;
@@ -1780,7 +1780,7 @@ pub const Expect = struct {
const signature = comptime getSignature("toThrow", "<green>expected<r>", false);
if (did_throw) {
- if (expected_value.isEmpty()) return thisValue;
+ if (expected_value.isEmpty() or expected_value.isUndefined()) return thisValue;
const result: JSValue = if (result_.?.toError()) |r|
r
@@ -1915,7 +1915,7 @@ pub const Expect = struct {
var formatter = JSC.ZigConsoleClient.Formatter{ .globalThis = globalObject, .quote_strings = true };
const received_line = "Received function did not throw\n";
- if (expected_value.isEmpty()) {
+ if (expected_value.isEmpty() or expected_value.isUndefined()) {
const fmt = comptime getSignature("toThrow", "", false) ++ "\n\n" ++ received_line;
if (Output.enable_ansi_colors) {
globalObject.throw(Output.prettyFmt(fmt, true), .{});
@@ -2649,6 +2649,83 @@ pub const Expect = struct {
return .zero;
}
+ pub fn toEqualIgnoringWhitespace(this: *Expect, globalThis: *JSGlobalObject, callFrame: *CallFrame) callconv(.C) JSValue {
+ defer this.postMatch(globalThis);
+
+ const thisValue = callFrame.this();
+ const _arguments = callFrame.arguments(1);
+ const arguments: []const JSValue = _arguments.ptr[0.._arguments.len];
+
+ if (arguments.len < 1) {
+ globalThis.throwInvalidArguments("toEqualIgnoringWhitespace() requires 1 argument", .{});
+ return .zero;
+ }
+
+ active_test_expectation_counter.actual += 1;
+
+ const expected = arguments[0];
+ const value: JSValue = this.getValue(globalThis, thisValue, "toEqualIgnoringWhitespace", "<green>expected<r>") orelse return .zero;
+
+ if (!expected.isString()) {
+ globalThis.throw("toEqualIgnoringWhitespace() requires argument to be a string", .{});
+ return .zero;
+ }
+
+ const not = this.flags.not;
+ var pass = value.isString() and expected.isString();
+
+ if (pass) {
+ var valueStr = value.toString(globalThis).toSlice(globalThis, default_allocator).slice();
+ var expectedStr = expected.toString(globalThis).toSlice(globalThis, default_allocator).slice();
+
+ var left: usize = 0;
+ var right: usize = 0;
+
+ // Skip leading whitespaces
+ while (left < valueStr.len and std.ascii.isWhitespace(valueStr[left])) left += 1;
+ while (right < expectedStr.len and std.ascii.isWhitespace(expectedStr[right])) right += 1;
+
+ while (left < valueStr.len and right < expectedStr.len) {
+ const left_char = valueStr[left];
+ const right_char = expectedStr[right];
+
+ if (left_char != right_char) {
+ pass = false;
+ break;
+ }
+
+ left += 1;
+ right += 1;
+
+ // Skip trailing whitespaces
+ while (left < valueStr.len and std.ascii.isWhitespace(valueStr[left])) left += 1;
+ while (right < expectedStr.len and std.ascii.isWhitespace(expectedStr[right])) right += 1;
+ }
+
+ if (left < valueStr.len or right < expectedStr.len) {
+ pass = false;
+ }
+ }
+
+ if (not) pass = !pass;
+ if (pass) return thisValue;
+
+ // handle failure
+ var formatter = JSC.ZigConsoleClient.Formatter{ .globalThis = globalThis, .quote_strings = true };
+ const expected_fmt = expected.toFmt(globalThis, &formatter);
+ const value_fmt = value.toFmt(globalThis, &formatter);
+
+ if (not) {
+ const fmt = comptime getSignature("toEqualIgnoringWhitespace", "<green>expected<r>", true) ++ "\n\n" ++ "Expected: not <green>{any}<r>\n" ++ "Received: <red>{any}<r>\n";
+ globalThis.throwPretty(fmt, .{ expected_fmt, value_fmt });
+ return .zero;
+ }
+
+ const fmt = comptime getSignature("toEqualIgnoringWhitespace", "<green>expected<r>", false) ++ "\n\n" ++ "Expected: <green>{any}<r>\n" ++ "Received: <red>{any}<r>\n";
+ globalThis.throwPretty(fmt, .{ expected_fmt, value_fmt });
+ return .zero;
+ }
+
pub fn toBeSymbol(this: *Expect, globalThis: *JSGlobalObject, callFrame: *CallFrame) callconv(.C) JSValue {
defer this.postMatch(globalThis);
@@ -3271,7 +3348,7 @@ pub const Expect = struct {
globalObject.throw(Output.prettyFmt(fmt, false), .{calls.toFmt(globalObject, &formatter)});
return .zero;
} else {
- const signature = comptime getSignature("toHaveBeenCalled", "", true);
+ const signature = comptime getSignature("toHaveBeenCalled", "", false);
const fmt = signature ++ "\n\nExpected <green>{any}<r>\n";
if (Output.enable_ansi_colors) {
globalObject.throw(Output.prettyFmt(fmt, true), .{calls.toFmt(globalObject, &formatter)});
@@ -3326,7 +3403,7 @@ pub const Expect = struct {
globalObject.throw(Output.prettyFmt(fmt, false), .{calls.toFmt(globalObject, &formatter)});
return .zero;
} else {
- const signature = comptime getSignature("toHaveBeenCalledTimes", "<green>expected<r>", true);
+ const signature = comptime getSignature("toHaveBeenCalledTimes", "<green>expected<r>", false);
const fmt = signature ++ "\n\nExpected <green>{any}<r>\n";
if (Output.enable_ansi_colors) {
globalObject.throw(Output.prettyFmt(fmt, true), .{calls.toFmt(globalObject, &formatter)});
@@ -3437,8 +3514,11 @@ pub const Expect = struct {
return ExpectStringMatching.call(globalObject, callFrame);
}
+ pub fn arrayContaining(globalObject: *JSGlobalObject, callFrame: *JSC.CallFrame) callconv(.C) JSValue {
+ return ExpectArrayContaining.call(globalObject, callFrame);
+ }
+
pub const extend = notImplementedStaticFn;
- pub const arrayContaining = notImplementedStaticFn;
pub const assertions = notImplementedStaticFn;
pub const hasAssertions = notImplementedStaticFn;
pub const objectContaining = notImplementedStaticFn;
@@ -3621,6 +3701,43 @@ pub const ExpectAny = struct {
}
};
+pub const ExpectArrayContaining = struct {
+ pub usingnamespace JSC.Codegen.JSExpectArrayContaining;
+
+ pub fn finalize(
+ this: *ExpectArrayContaining,
+ ) callconv(.C) void {
+ VirtualMachine.get().allocator.destroy(this);
+ }
+
+ pub fn call(globalObject: *JSC.JSGlobalObject, callFrame: *JSC.CallFrame) callconv(.C) JSValue {
+ const args = callFrame.arguments(1).slice();
+
+ if (args.len == 0 or !args[0].jsType().isArray()) {
+ const fmt = "<d>expect.<r>arrayContaining<d>(<r>array<d>)<r>\n\nExpected a array\n";
+ globalObject.throwPretty(fmt, .{});
+ return .zero;
+ }
+
+ const array_value = args[0];
+ const array_containing = globalObject.bunVM().allocator.create(ExpectArrayContaining) catch unreachable;
+
+ if (Jest.runner.?.pending_test == null) {
+ const err = globalObject.createErrorInstance("expect.arrayContaining() must be called in a test", .{});
+ err.put(globalObject, ZigString.static("name"), ZigString.init("TestNotRunningError").toValueGC(globalObject));
+ globalObject.throwValue(err);
+ return .zero;
+ }
+
+ const array_containing_js_value = array_containing.toJS(globalObject);
+ ExpectArrayContaining.arrayValueSetCached(array_containing_js_value, globalObject, array_value);
+
+ var vm = globalObject.bunVM();
+ vm.autoGarbageCollect();
+ return array_containing_js_value;
+ }
+};
+
/// JSValue.zero is used to indicate it was not a JSMockFunction
/// If there were no calls, it returns an empty JSArray*
extern fn JSMockFunction__getCalls(JSValue) JSValue;
diff --git a/src/bun.js/test/jest.classes.ts b/src/bun.js/test/jest.classes.ts
index d40acbf07..f10d9fb37 100644
--- a/src/bun.js/test/jest.classes.ts
+++ b/src/bun.js/test/jest.classes.ts
@@ -49,6 +49,18 @@ export default [
proto: {},
}),
define({
+ name: "ExpectArrayContaining",
+ construct: false,
+ noConstructor: true,
+ call: true,
+ finalize: true,
+ JSType: "0b11101110",
+ values: ["arrayValue"],
+ configurable: false,
+ klass: {},
+ proto: {},
+ }),
+ define({
name: "Expect",
construct: true,
call: true,
@@ -333,6 +345,10 @@ export default [
fn: "toBeWithin",
length: 2,
},
+ toEqualIgnoringWhitespace: {
+ fn: "toEqualIgnoringWhitespace",
+ length: 1,
+ },
toBeSymbol: {
fn: "toBeSymbol",
length: 0,
diff --git a/src/bun.js/test/jest.zig b/src/bun.js/test/jest.zig
index f3c9ffa26..a95897414 100644
--- a/src/bun.js/test/jest.zig
+++ b/src/bun.js/test/jest.zig
@@ -793,14 +793,33 @@ pub const DescribeScope = struct {
current_test_id: TestRunner.Test.ID = 0,
value: JSValue = .zero,
done: bool = false,
- is_skip: bool = false,
skip_count: u32 = 0,
tag: Tag = .pass,
- pub fn isAllSkipped(this: *const DescribeScope) bool {
- if (this.is_skip) return true;
- const total = this.tests.items.len;
- return total > 0 and @as(usize, this.skip_count) >= total;
+ fn isWithinOnlyScope(this: *const DescribeScope) bool {
+ if (this.tag == .only) return true;
+ if (this.parent != null) return this.parent.?.isWithinOnlyScope();
+ return false;
+ }
+
+ fn isWithinSkipScope(this: *const DescribeScope) bool {
+ if (this.tag == .skip) return true;
+ if (this.parent != null) return this.parent.?.isWithinSkipScope();
+ return false;
+ }
+
+ fn isWithinTodoScope(this: *const DescribeScope) bool {
+ if (this.tag == .todo) return true;
+ if (this.parent != null) return this.parent.?.isWithinTodoScope();
+ return false;
+ }
+
+ pub fn shouldEvaluateScope(this: *const DescribeScope) bool {
+ if (this.tag == .skip or
+ this.tag == .todo) return false;
+ if (Jest.runner.?.only and this.tag == .only) return true;
+ if (this.parent != null) return this.parent.?.shouldEvaluateScope();
+ return true;
}
pub fn push(new: *DescribeScope) void {
@@ -1114,7 +1133,7 @@ pub const DescribeScope = struct {
var i: TestRunner.Test.ID = 0;
- if (!this.isAllSkipped()) {
+ if (this.shouldEvaluateScope()) {
if (this.runCallback(globalObject, .beforeAll)) |_| {
while (i < end) {
Jest.runner.?.reportFailure(i + this.test_id_start, source.path.text, tests[i].label, 0, 0, this);
@@ -1168,7 +1187,7 @@ pub const DescribeScope = struct {
return;
}
- if (!this.isAllSkipped()) {
+ if (this.shouldEvaluateScope()) {
// Run the afterAll callbacks, in reverse order
// unless there were no tests for this scope
if (this.execCallback(globalThis, .afterAll)) |err| {
@@ -1267,8 +1286,8 @@ pub const TestRunnerTask = struct {
var test_: TestScope = this.describe.tests.items[test_id];
describe.current_test_id = test_id;
- if (test_.func == .zero or (describe.is_skip and test_.tag != .only)) {
- var tag = if (describe.is_skip) describe.tag else test_.tag;
+ if (test_.func == .zero or !describe.shouldEvaluateScope()) {
+ var tag = if (!describe.shouldEvaluateScope()) describe.tag else test_.tag;
switch (tag) {
.todo => {
this.processTestResult(globalThis, .{ .todo = {} }, test_, test_id, describe);
@@ -1609,8 +1628,7 @@ inline fn createScope(
.label = label,
.parent = parent,
.file_id = parent.file_id,
- .tag = if (parent.is_skip) parent.tag else tag,
- .is_skip = is_skip or parent.is_skip,
+ .tag = tag,
};
return scope.run(globalThis, function, &.{});
@@ -1983,8 +2001,7 @@ fn eachBind(
.label = formattedLabel,
.parent = parent,
.file_id = parent.file_id,
- .tag = if (parent.is_skip) parent.tag else .pass,
- .is_skip = parent.is_skip,
+ .tag = .pass,
};
const ret = scope.run(globalThis, function, function_args);
diff --git a/src/bun.js/webcore.zig b/src/bun.js/webcore.zig
index 168c4339b..411d3ed2e 100644
--- a/src/bun.js/webcore.zig
+++ b/src/bun.js/webcore.zig
@@ -107,9 +107,11 @@ fn confirm(globalObject: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callcon
// 6. Pause until the user responds either positively or negatively.
var stdin = std.io.getStdIn();
- var reader = stdin.reader();
+ var unbuffered_reader = stdin.reader();
+ var buffered = std.io.bufferedReader(unbuffered_reader);
+ var reader = buffered.reader();
- const first_byte = reader.readByte() catch {
+ var first_byte = reader.readByte() catch {
return .false;
};
@@ -122,13 +124,14 @@ fn confirm(globalObject: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callcon
'y', 'Y' => {
const next_byte = reader.readByte() catch {
// They may have said yes, but the stdin is invalid.
+
return .false;
};
if (next_byte == '\n') {
// 8. If the user responded positively, return true;
// otherwise, the user responded negatively: return false.
- return .false;
+ return .true;
}
},
else => {},
diff --git a/src/bun.js/webcore/blob.zig b/src/bun.js/webcore/blob.zig
index 54c37e679..f9699cffc 100644
--- a/src/bun.js/webcore/blob.zig
+++ b/src/bun.js/webcore/blob.zig
@@ -1040,7 +1040,10 @@ pub const Blob = struct {
break :brk result;
},
.err => |err| {
- return JSC.JSPromise.rejectedPromiseValue(globalThis, err.toJSC(globalThis));
+ return JSC.JSPromise.rejectedPromiseValue(
+ globalThis,
+ err.withPath(pathlike.path.slice()).toJSC(globalThis),
+ );
},
}
unreachable;
@@ -1080,8 +1083,13 @@ pub const Blob = struct {
needs_async.* = true;
return .zero;
}
-
- return JSC.JSPromise.rejectedPromiseValue(globalThis, err.toJSC(globalThis));
+ if (comptime !needs_open) {
+ return JSC.JSPromise.rejectedPromiseValue(globalThis, err.toJSC(globalThis));
+ }
+ return JSC.JSPromise.rejectedPromiseValue(
+ globalThis,
+ err.withPath(pathlike.path.slice()).toJSC(globalThis),
+ );
},
}
}
@@ -1110,7 +1118,10 @@ pub const Blob = struct {
break :brk result;
},
.err => |err| {
- return JSC.JSPromise.rejectedPromiseValue(globalThis, err.toJSC(globalThis));
+ return JSC.JSPromise.rejectedPromiseValue(
+ globalThis,
+ err.withPath(pathlike.path.slice()).toJSC(globalThis),
+ );
},
}
unreachable;
@@ -1145,7 +1156,13 @@ pub const Blob = struct {
needs_async.* = true;
return .zero;
}
- return JSC.JSPromise.rejectedPromiseValue(globalThis, err.toJSC(globalThis));
+ if (comptime !needs_open) {
+ return JSC.JSPromise.rejectedPromiseValue(globalThis, err.toJSC(globalThis));
+ }
+ return JSC.JSPromise.rejectedPromiseValue(
+ globalThis,
+ err.withPath(pathlike.path.slice()).toJSC(globalThis),
+ );
},
}
}
@@ -1680,6 +1697,7 @@ pub const Blob = struct {
read_completion: HTTPClient.NetworkThread.Completion = undefined,
read_len: SizeType = 0,
read_off: SizeType = 0,
+ read_eof: bool = false,
size: SizeType = 0,
buffer: []u8 = undefined,
task: HTTPClient.NetworkThread.Task = undefined,
@@ -1797,8 +1815,7 @@ pub const Blob = struct {
pub fn onRead(this: *ReadFile, completion: *HTTPClient.NetworkThread.Completion, result: AsyncIO.ReadError!usize) void {
defer this.doReadLoop();
-
- this.read_len = @as(SizeType, @truncate(result catch |err| {
+ const read_len = @as(SizeType, @truncate(result catch |err| {
if (@hasField(HTTPClient.NetworkThread.Completion, "result")) {
this.errno = AsyncIO.asError(-completion.result);
this.system_error = (bun.sys.Error{
@@ -1821,6 +1838,8 @@ pub const Blob = struct {
this.read_len = 0;
return;
}));
+ this.read_eof = read_len == 0;
+ this.read_len = read_len;
}
fn runAsync(this: *ReadFile, task: *ReadFileTask) void {
@@ -1930,7 +1949,7 @@ pub const Blob = struct {
this.read_off += this.read_len;
var remain = this.buffer[@min(this.read_off, @as(Blob.SizeType, @truncate(this.buffer.len)))..];
- if (remain.len > 0 and this.errno == null) {
+ if (remain.len > 0 and this.errno == null and !this.read_eof) {
this.doRead();
return;
}
@@ -2287,7 +2306,7 @@ pub const Blob = struct {
this.source_fd = 0;
}
- this.system_error = errno.toSystemError();
+ this.system_error = errno.withPath(this.destination_file_store.pathlike.path.slice()).toSystemError();
return AsyncIO.asError(errno.errno);
},
};
@@ -2737,17 +2756,7 @@ pub const Blob = struct {
value: JSC.JSValue,
global: *JSGlobalObject,
) JSC.JSValue {
- if (value.isError()) {
- return JSC.JSPromise.rejectedPromiseValue(global, value);
- }
-
- if (value.jsType() == .JSPromise)
- return value;
-
- return JSPromise.resolvedPromiseValue(
- global,
- value,
- );
+ return JSC.JSPromise.wrap(global, value);
}
pub fn getText(
@@ -3011,12 +3020,13 @@ pub const Blob = struct {
}
}
+ const offset = this.offset +| @as(SizeType, @intCast(relativeStart));
const len = @as(SizeType, @intCast(@max(relativeEnd -| relativeStart, 0)));
// This copies over the is_all_ascii flag
// which is okay because this will only be a <= slice
var blob = this.dupe();
- blob.offset = @as(SizeType, @intCast(relativeStart));
+ blob.offset = offset;
blob.size = len;
// infer the content type if it was not specified
@@ -3671,11 +3681,7 @@ pub const Blob = struct {
if (comptime lifetime != .temporary) this.setIsASCIIFlag(true);
}
- if (comptime lifetime == .temporary) {
- return ZigString.init(buf).toJSONObject(global);
- } else {
- return ZigString.init(buf).toJSONObject(global);
- }
+ return ZigString.init(buf).toJSONObject(global);
}
pub fn toFormDataWithBytes(this: *Blob, global: *JSGlobalObject, buf: []u8, comptime _: Lifetime) JSValue {
diff --git a/src/bun.js/webcore/body.zig b/src/bun.js/webcore/body.zig
index 621acc0b3..e38f03c08 100644
--- a/src/bun.js/webcore/body.zig
+++ b/src/bun.js/webcore/body.zig
@@ -51,7 +51,6 @@ const Request = JSC.WebCore.Request;
// https://developer.mozilla.org/en-US/docs/Web/API/Body
pub const Body = struct {
- init: Init = Init{ .headers = null, .status_code = 200 },
value: Value, // = Value.empty,
pub inline fn len(this: *const Body) Blob.SizeType {
@@ -68,7 +67,6 @@ pub const Body = struct {
pub fn clone(this: *Body, globalThis: *JSGlobalObject) Body {
return Body{
- .init = this.init.clone(globalThis),
.value = this.value.clone(globalThis),
};
}
@@ -79,19 +77,7 @@ pub const Body = struct {
try formatter.writeIndent(Writer, writer);
try writer.writeAll(comptime Output.prettyFmt("<r>bodyUsed<d>:<r> ", enable_ansi_colors));
formatter.printAs(.Boolean, Writer, writer, JSC.JSValue.jsBoolean(this.value == .Used), .BooleanObject, enable_ansi_colors);
- formatter.printComma(Writer, writer, enable_ansi_colors) catch unreachable;
- try writer.writeAll("\n");
- // if (this.init.headers) |headers| {
- // try formatter.writeIndent(Writer, writer);
- // try writer.writeAll("headers: ");
- // try headers.leak().writeFormat(formatter, writer, comptime enable_ansi_colors);
- // try writer.writeAll("\n");
- // }
-
- try formatter.writeIndent(Writer, writer);
- try writer.writeAll(comptime Output.prettyFmt("<r>status<d>:<r> ", enable_ansi_colors));
- formatter.printAs(.Double, Writer, writer, JSC.JSValue.jsNumber(this.init.status_code), .NumberObject, enable_ansi_colors);
if (this.value == .Blob) {
try formatter.printComma(Writer, writer, enable_ansi_colors);
try writer.writeAll("\n");
@@ -113,87 +99,9 @@ pub const Body = struct {
}
pub fn deinit(this: *Body, _: std.mem.Allocator) void {
- if (this.init.headers) |headers| {
- this.init.headers = null;
-
- headers.deref();
- }
this.value.deinit();
}
- pub const Init = struct {
- headers: ?*FetchHeaders = null,
- status_code: u16,
- method: Method = Method.GET,
-
- pub fn clone(this: Init, ctx: *JSGlobalObject) Init {
- var that = this;
- var headers = this.headers;
- if (headers) |head| {
- that.headers = head.cloneThis(ctx);
- }
-
- return that;
- }
-
- pub fn init(allocator: std.mem.Allocator, ctx: *JSGlobalObject, response_init: JSC.JSValue) !?Init {
- var result = Init{ .status_code = 200 };
-
- if (!response_init.isCell())
- return null;
-
- if (response_init.jsType() == .DOMWrapper) {
- // fast path: it's a Request object or a Response object
- // we can skip calling JS getters
- if (response_init.as(Request)) |req| {
- if (req.headers) |headers| {
- if (!headers.isEmpty()) {
- result.headers = headers.cloneThis(ctx);
- }
- }
-
- result.method = req.method;
- return result;
- }
-
- if (response_init.as(Response)) |req| {
- return req.body.init.clone(ctx);
- }
- }
-
- if (response_init.fastGet(ctx, .headers)) |headers| {
- if (headers.as(FetchHeaders)) |orig| {
- if (!orig.isEmpty()) {
- result.headers = orig.cloneThis(ctx);
- }
- } else {
- result.headers = FetchHeaders.createFromJS(ctx.ptr(), headers);
- }
- }
-
- if (response_init.fastGet(ctx, .status)) |status_value| {
- const number = status_value.coerceToInt64(ctx);
- if ((200 <= number and number < 600) or number == 101) {
- result.status_code = @as(u16, @truncate(@as(u32, @intCast(number))));
- } else {
- const err = ctx.createRangeErrorInstance("The status provided ({d}) must be 101 or in the range of [200, 599]", .{number});
- ctx.throwValue(err);
- return null;
- }
- }
-
- if (response_init.fastGet(ctx, .method)) |method_value| {
- var method_str = method_value.toSlice(ctx, allocator);
- defer method_str.deinit();
- if (method_str.len > 0) {
- result.method = Method.which(method_str.slice()) orelse .GET;
- }
- }
-
- return result;
- }
- };
-
pub const PendingValue = struct {
promise: ?JSValue = null,
readable: ?JSC.WebCore.ReadableStream = null,
@@ -466,7 +374,10 @@ pub const Body = struct {
JSC.markBinding(@src());
switch (this.*) {
- .Used, .Empty => {
+ .Used => {
+ return JSC.WebCore.ReadableStream.used(globalThis);
+ },
+ .Empty => {
return JSC.WebCore.ReadableStream.empty(globalThis);
},
.Null => {
@@ -493,6 +404,9 @@ pub const Body = struct {
if (locked.readable) |readable| {
return readable.value;
}
+ if (locked.promise != null) {
+ return JSC.WebCore.ReadableStream.used(globalThis);
+ }
var drain_result: JSC.WebCore.DrainResult = .{
.estimated_size = 0,
};
@@ -998,72 +912,12 @@ pub const Body = struct {
}
};
- pub fn @"404"(_: js.JSContextRef) Body {
- return Body{
- .init = Init{
- .headers = null,
- .status_code = 404,
- },
- .value = Value{ .Null = {} },
- };
- }
-
- pub fn @"200"(_: js.JSContextRef) Body {
- return Body{
- .init = Init{
- .status_code = 200,
- },
- .value = Value{ .Null = {} },
- };
- }
-
- pub fn extract(
- globalThis: *JSGlobalObject,
- value: JSValue,
- ) ?Body {
- return extractBody(
- globalThis,
- value,
- false,
- JSValue.zero,
- );
- }
-
- pub fn extractWithInit(
- globalThis: *JSGlobalObject,
- value: JSValue,
- init: JSValue,
- ) ?Body {
- return extractBody(
- globalThis,
- value,
- true,
- init,
- );
- }
-
// https://github.com/WebKit/webkit/blob/main/Source/WebCore/Modules/fetch/FetchBody.cpp#L45
- inline fn extractBody(
+ pub fn extract(
globalThis: *JSGlobalObject,
value: JSValue,
- comptime has_init: bool,
- init: JSValue,
) ?Body {
- var body = Body{
- .value = Value{ .Null = {} },
- .init = Init{ .headers = null, .status_code = 200 },
- };
- var allocator = getAllocator(globalThis);
-
- if (comptime has_init) {
- if (Init.init(allocator, globalThis, init)) |maybeInit| {
- if (maybeInit) |init_| {
- body.init = init_;
- }
- } else |_| {
- return null;
- }
- }
+ var body = Body{ .value = Value{ .Null = {} } };
body.value = Value.fromJS(globalThis, value) orelse return null;
if (body.value == .Blob)
@@ -1104,8 +958,7 @@ pub fn BodyMixin(comptime Type: type) type {
var body: *Body.Value = this.getBodyValue();
if (body.* == .Used) {
- // TODO: make this closed
- return JSC.WebCore.ReadableStream.empty(globalThis);
+ return JSC.WebCore.ReadableStream.used(globalThis);
}
return body.toReadableStream(globalThis);
@@ -1136,7 +989,9 @@ pub fn BodyMixin(comptime Type: type) type {
}
var blob = value.useAsAnyBlobAllowNonUTF8String();
- return JSC.JSPromise.wrap(globalObject, blob.toJSON(globalObject, .share));
+ const result = blob.toJSON(globalObject, .share);
+
+ return JSC.JSPromise.wrap(globalObject, result);
}
fn handleBodyAlreadyUsed(globalObject: *JSC.JSGlobalObject) JSValue {
diff --git a/src/bun.js/webcore/encoding.classes.ts b/src/bun.js/webcore/encoding.classes.ts
index 118dfd09e..7114f210e 100644
--- a/src/bun.js/webcore/encoding.classes.ts
+++ b/src/bun.js/webcore/encoding.classes.ts
@@ -16,6 +16,9 @@ export default [
fatal: {
getter: "getFatal",
},
+ ignoreBOM: {
+ getter: "getIgnoreBOM",
+ },
decode: {
fn: "decode",
diff --git a/src/bun.js/webcore/encoding.zig b/src/bun.js/webcore/encoding.zig
index 53933fdb7..18e70b261 100644
--- a/src/bun.js/webcore/encoding.zig
+++ b/src/bun.js/webcore/encoding.zig
@@ -559,6 +559,13 @@ pub const TextDecoder = struct {
remainder = remainder[1..];
continue;
},
+ // BOM handling
+ 0xFEFF => {
+ buffer.ensureTotalCapacity(allocator, 1) catch unreachable;
+ buffer.items.ptr[buffer.items.len] = remainder[0];
+ buffer.items.len += 1;
+ remainder = remainder[1..];
+ },
// Is this an unpaired low surrogate or four-digit hex escape?
else => {
@@ -629,8 +636,13 @@ pub const TextDecoder = struct {
},
EncodingLabel.@"UTF-8" => {
const toUTF16 = if (stream) strings.toUTF16Alloc else strings.toUTF16AllocNoTrim;
+ const moved_buffer_slice_8 = if (!this.ignore_bom and buffer_slice.len > 3 and std.mem.eql(u8, &[_]u8{ '\xEF', '\xBB', '\xBF' }, buffer_slice[0..3]))
+ buffer_slice[3..]
+ else
+ buffer_slice;
+
if (this.fatal) {
- if (toUTF16(default_allocator, buffer_slice, true)) |result_| {
+ if (toUTF16(default_allocator, moved_buffer_slice_8, true)) |result_| {
if (result_) |result| {
return ZigString.toExternalU16(result.ptr, result.len, globalThis);
}
@@ -649,7 +661,7 @@ pub const TextDecoder = struct {
}
}
} else {
- if (toUTF16(default_allocator, buffer_slice, false)) |result_| {
+ if (toUTF16(default_allocator, moved_buffer_slice_8, false)) |result_| {
if (result_) |result| {
return ZigString.toExternalU16(result.ptr, result.len, globalThis);
}
@@ -664,15 +676,20 @@ pub const TextDecoder = struct {
}
// Experiment: using mimalloc directly is slightly slower
- return ZigString.init(buffer_slice).toValueGC(globalThis);
+ return ZigString.init(moved_buffer_slice_8).toValueGC(globalThis);
},
EncodingLabel.@"UTF-16LE" => {
- if (std.mem.isAligned(@intFromPtr(buffer_slice.ptr), @alignOf([*]const u16))) {
- return this.decodeUTF16WithAlignment([]align(2) const u16, @as([]align(2) const u16, @alignCast(std.mem.bytesAsSlice(u16, buffer_slice))), globalThis);
+ const moved_buffer_slice_16 = if (!this.ignore_bom and buffer_slice.len > 2 and std.mem.eql(u8, &[_]u8{ '\xFF', '\xFE' }, buffer_slice[0..2]))
+ buffer_slice[2..]
+ else
+ buffer_slice;
+
+ if (std.mem.isAligned(@intFromPtr(moved_buffer_slice_16.ptr), @alignOf([*]const u16))) {
+ return this.decodeUTF16WithAlignment([]align(2) const u16, @as([]align(2) const u16, @alignCast(std.mem.bytesAsSlice(u16, moved_buffer_slice_16))), globalThis);
}
- return this.decodeUTF16WithAlignment([]align(1) const u16, std.mem.bytesAsSlice(u16, buffer_slice), globalThis);
+ return this.decodeUTF16WithAlignment([]align(1) const u16, std.mem.bytesAsSlice(u16, moved_buffer_slice_16), globalThis);
},
else => {
globalThis.throwInvalidArguments("TextDecoder.decode set to unsupported encoding", .{});
@@ -702,6 +719,9 @@ pub const TextDecoder = struct {
globalThis.throwInvalidArguments("Unsupported encoding label \"{s}\"", .{str.slice()});
return null;
}
+ } else if (arguments[0].isUndefined()) {
+ // default to utf-8
+ decoder.encoding = EncodingLabel.@"UTF-8";
} else {
globalThis.throwInvalidArguments("TextDecoder(encoding) label is invalid", .{});
return null;
@@ -745,7 +765,7 @@ pub const Encoder = struct {
export fn Bun__encoding__writeLatin1(input: [*]const u8, len: usize, to: [*]u8, to_len: usize, encoding: u8) usize {
return switch (@as(JSC.Node.Encoding, @enumFromInt(encoding))) {
.utf8 => writeU8(input, len, to, to_len, .utf8),
- .latin1 => writeU8(input, len, to, to_len, .ascii),
+ .latin1 => writeU8(input, len, to, to_len, .latin1),
.ascii => writeU8(input, len, to, to_len, .ascii),
.ucs2 => writeU8(input, len, to, to_len, .utf16le),
.utf16le => writeU8(input, len, to, to_len, .utf16le),
@@ -947,13 +967,13 @@ pub const Encoder = struct {
// if (comptime encoding.isBinaryToText()) {}
switch (comptime encoding) {
- .buffer => {
+ .buffer, .latin1 => {
const written = @min(len, to_len);
@memcpy(to_ptr[0..written], input[0..written]);
return written;
},
- .latin1, .ascii => {
+ .ascii => {
const written = @min(len, to_len);
var to = to_ptr[0..written];
diff --git a/src/bun.js/webcore/request.zig b/src/bun.js/webcore/request.zig
index fc38e1825..95f92145b 100644
--- a/src/bun.js/webcore/request.zig
+++ b/src/bun.js/webcore/request.zig
@@ -50,6 +50,7 @@ const InternalBlob = JSC.WebCore.InternalBlob;
const BodyMixin = JSC.WebCore.BodyMixin;
const Body = JSC.WebCore.Body;
const Blob = JSC.WebCore.Blob;
+const Response = JSC.WebCore.Response;
const body_value_pool_size: u16 = 256;
pub const BodyValueRef = bun.HiveRef(Body.Value, body_value_pool_size);
@@ -68,7 +69,7 @@ pub const Request = struct {
signal: ?*AbortSignal = null,
body: *BodyValueRef,
method: Method = Method.GET,
- uws_request: ?*uws.Request = null,
+ request_context: JSC.API.AnyRequestContext = JSC.API.AnyRequestContext.Null,
https: bool = false,
upgrader: ?*anyopaque = null,
@@ -89,7 +90,7 @@ pub const Request = struct {
pub fn getContentType(
this: *Request,
) ?ZigString.Slice {
- if (this.uws_request) |req| {
+ if (this.request_context.getRequest()) |req| {
if (req.header("content-type")) |value| {
return ZigString.Slice.fromUTF8NeverFree(value);
}
@@ -324,7 +325,7 @@ pub const Request = struct {
if (this.url.length() > 0)
return this.url.byteSlice().len;
- if (this.uws_request) |req| {
+ if (this.request_context.getRequest()) |req| {
const req_url = req.url();
if (req_url.len > 0 and req_url[0] == '/') {
if (req.header("host")) |host| {
@@ -351,7 +352,7 @@ pub const Request = struct {
pub fn ensureURL(this: *Request) !void {
if (!this.url.isEmpty()) return;
- if (this.uws_request) |req| {
+ if (this.request_context.getRequest()) |req| {
const req_url = req.url();
if (req_url.len > 0 and req_url[0] == '/') {
if (req.header("host")) |host| {
@@ -507,10 +508,9 @@ pub const Request = struct {
};
const values_to_try = values_to_try_[0 .. @as(usize, @intFromBool(!is_first_argument_a_url)) +
@as(usize, @intFromBool(arguments.len > 1 and arguments[1].isObject()))];
-
for (values_to_try) |value| {
const value_type = value.jsType();
-
+ const explicit_check = values_to_try.len == 2 and value_type == .FinalObject and values_to_try[1].jsType() == .DOMWrapper;
if (value_type == .DOMWrapper) {
if (value.as(Request)) |request| {
if (values_to_try.len == 1) {
@@ -543,12 +543,12 @@ pub const Request = struct {
if (value.as(JSC.WebCore.Response)) |response| {
if (!fields.contains(.method)) {
- req.method = response.body.init.method;
+ req.method = response.init.method;
fields.insert(.method);
}
if (!fields.contains(.headers)) {
- if (response.body.init.headers) |headers| {
+ if (response.init.headers) |headers| {
req.headers = headers.cloneThis(globalThis);
fields.insert(.headers);
}
@@ -608,9 +608,8 @@ pub const Request = struct {
}
if (!fields.contains(.signal)) {
- if (value.get(globalThis, "signal")) |signal_| {
+ if (value.getTruthy(globalThis, "signal")) |signal_| {
fields.insert(.signal);
-
if (AbortSignal.fromJS(signal_)) |signal| {
//Keep it alive
signal_.ensureStillAlive();
@@ -625,24 +624,26 @@ pub const Request = struct {
}
if (!fields.contains(.method) or !fields.contains(.headers)) {
- if (Body.Init.init(globalThis.allocator(), globalThis, value) catch null) |init| {
- if (!fields.contains(.method)) {
- req.method = init.method;
- fields.insert(.method);
+ if (Response.Init.init(globalThis.allocator(), globalThis, value) catch null) |init| {
+ if (!explicit_check or (explicit_check and value.fastGet(globalThis, .method) != null)) {
+ if (!fields.contains(.method)) {
+ req.method = init.method;
+ fields.insert(.method);
+ }
}
-
- if (init.headers) |headers| {
- if (!fields.contains(.headers)) {
- req.headers = headers;
- fields.insert(.headers);
- } else {
- headers.deref();
+ if (!explicit_check or (explicit_check and value.fastGet(globalThis, .headers) != null)) {
+ if (init.headers) |headers| {
+ if (!fields.contains(.headers)) {
+ req.headers = headers;
+ fields.insert(.headers);
+ } else {
+ headers.deref();
+ }
}
}
}
}
}
-
if (req.url.isEmpty()) {
globalThis.throw("Failed to construct 'Request': url is required.", .{});
req.finalizeWithoutDeinit();
@@ -724,7 +725,7 @@ pub const Request = struct {
globalThis: *JSC.JSGlobalObject,
) callconv(.C) JSC.JSValue {
if (this.headers == null) {
- if (this.uws_request) |req| {
+ if (this.request_context.getRequest()) |req| {
this.headers = FetchHeaders.createFromUWS(globalThis, req);
} else {
this.headers = FetchHeaders.createEmpty();
@@ -743,7 +744,7 @@ pub const Request = struct {
pub fn cloneHeaders(this: *Request, globalThis: *JSGlobalObject) ?*FetchHeaders {
if (this.headers == null) {
- if (this.uws_request) |uws_req| {
+ if (this.request_context.getRequest()) |uws_req| {
this.headers = FetchHeaders.createFromUWS(globalThis, uws_req);
}
}
diff --git a/src/bun.js/webcore/response.zig b/src/bun.js/webcore/response.zig
index 0e80adfc4..f7ada2862 100644
--- a/src/bun.js/webcore/response.zig
+++ b/src/bun.js/webcore/response.zig
@@ -63,8 +63,8 @@ pub const Response = struct {
allocator: std.mem.Allocator,
body: Body,
+ init: Init,
url: bun.String = bun.String.empty,
- status_text: bun.String = bun.String.empty,
redirected: bool = false,
// We must report a consistent value for this
@@ -89,7 +89,7 @@ pub const Response = struct {
return this.reported_estimated_size orelse brk: {
this.reported_estimated_size = @as(
u63,
- @intCast(this.body.value.estimatedSize() + this.url.byteSlice().len + this.status_text.byteSlice().len + @sizeOf(Response)),
+ @intCast(this.body.value.estimatedSize() + this.url.byteSlice().len + this.init.status_text.byteSlice().len + @sizeOf(Response)),
);
break :brk this.reported_estimated_size.?;
};
@@ -104,11 +104,11 @@ pub const Response = struct {
pub fn getFetchHeaders(
this: *Response,
) ?*FetchHeaders {
- return this.body.init.headers;
+ return this.init.headers;
}
pub inline fn statusCode(this: *const Response) u16 {
- return this.body.init.status_code;
+ return this.init.status_code;
}
pub fn redirectLocation(this: *const Response) ?[]const u8 {
@@ -116,7 +116,7 @@ pub const Response = struct {
}
pub fn header(this: *const Response, name: JSC.FetchHeaders.HTTPHeaderName) ?[]const u8 {
- return if ((this.body.init.headers orelse return null).fastGet(name)) |str|
+ return if ((this.init.headers orelse return null).fastGet(name)) |str|
str.slice()
else
null;
@@ -146,14 +146,20 @@ pub const Response = struct {
try writer.writeAll("\n");
try formatter.writeIndent(Writer, writer);
- try writer.writeAll(comptime Output.prettyFmt("<r>headers<d>:<r> ", enable_ansi_colors));
- formatter.printAs(.Private, Writer, writer, this.getHeaders(formatter.globalThis), .DOMWrapper, enable_ansi_colors);
+ try writer.writeAll(comptime Output.prettyFmt("<r>status<d>:<r> ", enable_ansi_colors));
+ formatter.printAs(.Double, Writer, writer, JSC.JSValue.jsNumber(this.init.status_code), .NumberObject, enable_ansi_colors);
formatter.printComma(Writer, writer, enable_ansi_colors) catch unreachable;
try writer.writeAll("\n");
try formatter.writeIndent(Writer, writer);
try writer.writeAll(comptime Output.prettyFmt("<r>statusText<d>:<r> ", enable_ansi_colors));
- try writer.print(comptime Output.prettyFmt("<r>\"<b>{}<r>\"", enable_ansi_colors), .{this.status_text});
+ try writer.print(comptime Output.prettyFmt("<r>\"<b>{}<r>\"", enable_ansi_colors), .{this.init.status_text});
+ formatter.printComma(Writer, writer, enable_ansi_colors) catch unreachable;
+ try writer.writeAll("\n");
+
+ try formatter.writeIndent(Writer, writer);
+ try writer.writeAll(comptime Output.prettyFmt("<r>headers<d>:<r> ", enable_ansi_colors));
+ formatter.printAs(.Private, Writer, writer, this.getHeaders(formatter.globalThis), .DOMWrapper, enable_ansi_colors);
formatter.printComma(Writer, writer, enable_ansi_colors) catch unreachable;
try writer.writeAll("\n");
@@ -162,6 +168,7 @@ pub const Response = struct {
formatter.printAs(.Boolean, Writer, writer, JSC.JSValue.jsBoolean(this.redirected), .BooleanObject, enable_ansi_colors);
formatter.printComma(Writer, writer, enable_ansi_colors) catch unreachable;
try writer.writeAll("\n");
+
formatter.resetLine();
try this.body.writeFormat(Formatter, formatter, writer, enable_ansi_colors);
}
@@ -172,7 +179,7 @@ pub const Response = struct {
}
pub fn isOK(this: *const Response) bool {
- return this.body.init.status_code == 304 or (this.body.init.status_code >= 200 and this.body.init.status_code <= 299);
+ return this.init.status_code >= 200 and this.init.status_code <= 299;
}
pub fn getURL(
@@ -187,7 +194,7 @@ pub const Response = struct {
this: *Response,
globalThis: *JSC.JSGlobalObject,
) callconv(.C) JSC.JSValue {
- if (this.body.init.status_code < 200) {
+ if (this.init.status_code < 200) {
return ZigString.init("error").toValue(globalThis);
}
@@ -199,7 +206,7 @@ pub const Response = struct {
globalThis: *JSC.JSGlobalObject,
) callconv(.C) JSC.JSValue {
// https://developer.mozilla.org/en-US/docs/Web/API/Response/statusText
- return this.status_text.toJS(globalThis);
+ return this.init.status_text.toJS(globalThis);
}
pub fn getRedirected(
@@ -219,18 +226,18 @@ pub const Response = struct {
}
fn getOrCreateHeaders(this: *Response, globalThis: *JSC.JSGlobalObject) *FetchHeaders {
- if (this.body.init.headers == null) {
- this.body.init.headers = FetchHeaders.createEmpty();
+ if (this.init.headers == null) {
+ this.init.headers = FetchHeaders.createEmpty();
if (this.body.value == .Blob) {
const content_type = this.body.value.Blob.content_type;
if (content_type.len > 0) {
- this.body.init.headers.?.put("content-type", content_type, globalThis);
+ this.init.headers.?.put("content-type", content_type, globalThis);
}
}
}
- return this.body.init.headers.?;
+ return this.init.headers.?;
}
pub fn getHeaders(
@@ -262,8 +269,8 @@ pub const Response = struct {
new_response.* = Response{
.allocator = allocator,
.body = this.body.clone(globalThis),
+ .init = this.init.clone(globalThis),
.url = this.url.clone(),
- .status_text = this.status_text.clone(),
.redirected = this.redirected,
};
}
@@ -279,17 +286,16 @@ pub const Response = struct {
_: *JSC.JSGlobalObject,
) callconv(.C) JSC.JSValue {
// https://developer.mozilla.org/en-US/docs/Web/API/Response/status
- return JSValue.jsNumber(this.body.init.status_code);
+ return JSValue.jsNumber(this.init.status_code);
}
pub fn finalize(
this: *Response,
) callconv(.C) void {
- this.body.deinit(this.allocator);
-
var allocator = this.allocator;
- this.status_text.deref();
+ this.init.deinit(allocator);
+ this.body.deinit(allocator);
this.url.deref();
allocator.destroy(this);
@@ -348,7 +354,7 @@ pub const Response = struct {
pub fn getContentType(
this: *Response,
) ?ZigString.Slice {
- if (this.body.init.headers) |headers| {
+ if (this.init.headers) |headers| {
if (headers.fastGet(.ContentType)) |value| {
return value.toSlice(bun.default_allocator);
}
@@ -373,11 +379,11 @@ pub const Response = struct {
var response = Response{
.body = Body{
- .init = Body.Init{
- .status_code = 200,
- },
.value = .{ .Empty = {} },
},
+ .init = Response.Init{
+ .status_code = 200,
+ },
.allocator = getAllocator(globalThis),
.url = bun.String.empty,
};
@@ -409,10 +415,10 @@ pub const Response = struct {
if (args.nextEat()) |init| {
if (init.isUndefinedOrNull()) {} else if (init.isNumber()) {
- response.body.init.status_code = @as(u16, @intCast(@min(@max(0, init.toInt32()), std.math.maxInt(u16))));
+ response.init.status_code = @as(u16, @intCast(@min(@max(0, init.toInt32()), std.math.maxInt(u16))));
} else {
- if (Body.Init.init(getAllocator(globalThis), globalThis, init) catch null) |_init| {
- response.body.init = _init;
+ if (Response.Init.init(getAllocator(globalThis), globalThis, init) catch null) |_init| {
+ response.init = _init;
}
}
}
@@ -434,10 +440,10 @@ pub const Response = struct {
// var response = getAllocator(globalThis).create(Response) catch unreachable;
var response = Response{
+ .init = Response.Init{
+ .status_code = 302,
+ },
.body = Body{
- .init = Body.Init{
- .status_code = 302,
- },
.value = .{ .Empty = {} },
},
.allocator = getAllocator(globalThis),
@@ -455,17 +461,17 @@ pub const Response = struct {
if (args.nextEat()) |init| {
if (init.isUndefinedOrNull()) {} else if (init.isNumber()) {
- response.body.init.status_code = @as(u16, @intCast(@min(@max(0, init.toInt32()), std.math.maxInt(u16))));
+ response.init.status_code = @as(u16, @intCast(@min(@max(0, init.toInt32()), std.math.maxInt(u16))));
} else {
- if (Body.Init.init(getAllocator(globalThis), globalThis, init) catch null) |_init| {
- response.body.init = _init;
- response.body.init.status_code = 302;
+ if (Response.Init.init(getAllocator(globalThis), globalThis, init) catch null) |_init| {
+ response.init = _init;
+ response.init.status_code = 302;
}
}
}
- response.body.init.headers = response.getOrCreateHeaders(globalThis);
- var headers_ref = response.body.init.headers.?;
+ response.init.headers = response.getOrCreateHeaders(globalThis);
+ var headers_ref = response.init.headers.?;
headers_ref.put("location", url_string_slice.slice(), globalThis);
var ptr = response.allocator.create(Response) catch unreachable;
ptr.* = response;
@@ -478,10 +484,10 @@ pub const Response = struct {
) callconv(.C) JSValue {
var response = getAllocator(globalThis).create(Response) catch unreachable;
response.* = Response{
+ .init = Response.Init{
+ .status_code = 0,
+ },
.body = Body{
- .init = Body.Init{
- .status_code = 0,
- },
.value = .{ .Empty = {} },
},
.allocator = getAllocator(globalThis),
@@ -494,6 +500,8 @@ pub const Response = struct {
globalThis: *JSC.JSGlobalObject,
callframe: *JSC.CallFrame,
) callconv(.C) ?*Response {
+ var allocator = getAllocator(globalThis);
+
const args_list = brk: {
var args = callframe.arguments(2);
if (args.len > 1 and args.ptr[1].isEmptyOrUndefinedOrNull()) {
@@ -503,17 +511,24 @@ pub const Response = struct {
};
const arguments = args_list.ptr[0..args_list.len];
- const body: Body = @as(?Body, brk: {
+
+ const init: Init = @as(?Init, brk: {
switch (arguments.len) {
0 => {
- break :brk Body.@"200"(globalThis);
+ break :brk Init{
+ .status_code = 200,
+ .headers = null,
+ };
},
1 => {
- break :brk Body.extract(globalThis, arguments[0]);
+ break :brk Init{
+ .status_code = 200,
+ .headers = null,
+ };
},
else => {
if (arguments[1].isObject()) {
- break :brk Body.extractWithInit(globalThis, arguments[0], arguments[1]);
+ break :brk Init.init(allocator, globalThis, arguments[1]) catch null;
}
std.debug.assert(!arguments[1].isEmptyOrUndefinedOrNull());
@@ -526,23 +541,152 @@ pub const Response = struct {
unreachable;
}) orelse return null;
- var response = getAllocator(globalThis).create(Response) catch unreachable;
+ const body: Body = brk: {
+ switch (arguments.len) {
+ 0 => {
+ break :brk Body{
+ .value = Body.Value{ .Null = {} },
+ };
+ },
+ else => {
+ break :brk Body.extract(globalThis, arguments[0]);
+ },
+ }
+ unreachable;
+ } orelse return null;
+
+ var response = allocator.create(Response) catch unreachable;
response.* = Response{
.body = body,
+ .init = init,
.allocator = getAllocator(globalThis),
};
if (response.body.value == .Blob and
- response.body.init.headers != null and
+ response.init.headers != null and
response.body.value.Blob.content_type.len > 0 and
- !response.body.init.headers.?.fastHas(.ContentType))
+ !response.init.headers.?.fastHas(.ContentType))
{
- response.body.init.headers.?.put("content-type", response.body.value.Blob.content_type, globalThis);
+ response.init.headers.?.put("content-type", response.body.value.Blob.content_type, globalThis);
}
return response;
}
+
+ pub const Init = struct {
+ headers: ?*FetchHeaders = null,
+ status_code: u16,
+ status_text: bun.String = bun.String.empty,
+ method: Method = Method.GET,
+
+ pub fn clone(this: Init, ctx: *JSGlobalObject) Init {
+ var that = this;
+ var headers = this.headers;
+ if (headers) |head| {
+ that.headers = head.cloneThis(ctx);
+ }
+ that.status_text = this.status_text.clone();
+
+ return that;
+ }
+
+ pub fn init(allocator: std.mem.Allocator, ctx: *JSGlobalObject, response_init: JSC.JSValue) !?Init {
+ var result = Init{ .status_code = 200 };
+
+ if (!response_init.isCell())
+ return null;
+
+ if (response_init.jsType() == .DOMWrapper) {
+ // fast path: it's a Request object or a Response object
+ // we can skip calling JS getters
+ if (response_init.as(Request)) |req| {
+ if (req.headers) |headers| {
+ if (!headers.isEmpty()) {
+ result.headers = headers.cloneThis(ctx);
+ }
+ }
+
+ result.method = req.method;
+ return result;
+ }
+
+ if (response_init.as(Response)) |resp| {
+ return resp.init.clone(ctx);
+ }
+ }
+
+ if (response_init.fastGet(ctx, .headers)) |headers| {
+ if (headers.as(FetchHeaders)) |orig| {
+ if (!orig.isEmpty()) {
+ result.headers = orig.cloneThis(ctx);
+ }
+ } else {
+ result.headers = FetchHeaders.createFromJS(ctx.ptr(), headers);
+ }
+ }
+
+ if (response_init.fastGet(ctx, .status)) |status_value| {
+ const number = status_value.coerceToInt64(ctx);
+ if ((200 <= number and number < 600) or number == 101) {
+ result.status_code = @as(u16, @truncate(@as(u32, @intCast(number))));
+ } else {
+ const err = ctx.createRangeErrorInstance("The status provided ({d}) must be 101 or in the range of [200, 599]", .{number});
+ ctx.throwValue(err);
+ return null;
+ }
+ }
+
+ if (response_init.fastGet(ctx, .statusText)) |status_text| {
+ result.status_text = bun.String.fromJS(status_text, ctx).dupeRef();
+ }
+
+ if (response_init.fastGet(ctx, .method)) |method_value| {
+ var method_str = method_value.toSlice(ctx, allocator);
+ defer method_str.deinit();
+ if (method_str.len > 0) {
+ result.method = Method.which(method_str.slice()) orelse .GET;
+ }
+ }
+
+ return result;
+ }
+
+ pub fn deinit(this: *Init, _: std.mem.Allocator) void {
+ if (this.headers) |headers| {
+ this.headers = null;
+
+ headers.deref();
+ }
+
+ this.status_text.deref();
+ }
+ };
+
+ pub fn @"404"(globalThis: *JSC.JSGlobalObject) Response {
+ return emptyWithStatus(globalThis, 404);
+ }
+
+ pub fn @"200"(globalThis: *JSC.JSGlobalObject) Response {
+ return emptyWithStatus(globalThis, 200);
+ }
+
+ inline fn emptyWithStatus(globalThis: *JSC.JSGlobalObject, status: u16) Response {
+ var allocator = getAllocator(globalThis);
+ var response = allocator.create(Response) catch unreachable;
+
+ response.* = Response{
+ .body = Body{
+ .value = Body.Value{ .Null = {} },
+ },
+ .init = Init{
+ .status_code = status,
+ },
+ .allocator = getAllocator(globalThis),
+ };
+
+ return response;
+ }
};
const null_fd = bun.invalid_fd;
@@ -778,27 +922,27 @@ pub const Fetch = struct {
if (!success) {
const err = this.onReject();
err.ensureStillAlive();
+ // if we are streaming update with error
+ if (this.readable_stream_ref.get()) |readable| {
+ readable.ptr.Bytes.onData(
+ .{
+ .err = .{ .JSValue = err },
+ },
+ bun.default_allocator,
+ );
+ }
+ // if we are buffering resolve the promise
if (this.response.get()) |response_js| {
if (response_js.as(Response)) |response| {
const body = response.body;
- if (body.value == .Locked) {
- if (body.value.Locked.readable) |readable| {
- readable.ptr.Bytes.onData(
- .{
- .err = .{ .JSValue = err },
- },
- bun.default_allocator,
- );
- return;
- }
+ if (body.value.Locked.promise) |promise_| {
+ const promise = promise_.asAnyPromise().?;
+ promise.reject(globalThis, err);
}
response.body.value.toErrorInstance(err, globalThis);
- return;
}
}
-
- globalThis.throwValue(err);
return;
}
@@ -1238,13 +1382,13 @@ pub const Fetch = struct {
return Response{
.allocator = allocator,
.url = bun.String.createAtomIfPossible(metadata.url),
- .status_text = bun.String.createAtomIfPossible(http_response.status),
.redirected = this.result.redirected,
+ .init = .{
+ .headers = FetchHeaders.createFromPicoHeaders(http_response.headers),
+ .status_code = @as(u16, @truncate(http_response.status_code)),
+ .status_text = bun.String.createAtomIfPossible(http_response.status),
+ },
.body = .{
- .init = .{
- .headers = FetchHeaders.createFromPicoHeaders(http_response.headers),
- .status_code = @as(u16, @truncate(http_response.status_code)),
- },
.value = this.toBodyValue(),
},
};
@@ -1488,15 +1632,15 @@ pub const Fetch = struct {
response.* = Response{
.body = Body{
- .init = Body.Init{
- .status_code = 200,
- },
.value = .{
.Blob = blob,
},
},
+ .init = Response.Init{
+ .status_code = 200,
+ .status_text = bun.String.createAtom("OK"),
+ },
.allocator = allocator,
- .status_text = bun.String.createAtom("OK"),
.url = data_url.url.dupeRef(),
};
@@ -1708,7 +1852,7 @@ pub const Fetch = struct {
if (decompress.isBoolean()) {
disable_decompression = !decompress.asBoolean();
} else if (decompress.isNumber()) {
- disable_keepalive = decompress.to(i32) == 0;
+ disable_decompression = decompress.to(i32) == 0;
}
}
@@ -1901,7 +2045,7 @@ pub const Fetch = struct {
if (decompress.isBoolean()) {
disable_decompression = !decompress.asBoolean();
} else if (decompress.isNumber()) {
- disable_keepalive = decompress.to(i32) == 0;
+ disable_decompression = decompress.to(i32) == 0;
}
}
@@ -2009,11 +2153,11 @@ pub const Fetch = struct {
response.* = Response{
.body = Body{
- .init = Body.Init{
- .status_code = 200,
- },
.value = .{ .Blob = bun_file },
},
+ .init = Response.Init{
+ .status_code = 200,
+ },
.allocator = bun.default_allocator,
.url = file_url_string.clone(),
};
diff --git a/src/bun.js/webcore/streams.zig b/src/bun.js/webcore/streams.zig
index a578313d7..6c51daf94 100644
--- a/src/bun.js/webcore/streams.zig
+++ b/src/bun.js/webcore/streams.zig
@@ -225,6 +225,7 @@ pub const ReadableStream = struct {
extern fn ReadableStream__isDisturbed(possibleReadableStream: JSValue, globalObject: *JSGlobalObject) bool;
extern fn ReadableStream__isLocked(possibleReadableStream: JSValue, globalObject: *JSGlobalObject) bool;
extern fn ReadableStream__empty(*JSGlobalObject) JSC.JSValue;
+ extern fn ReadableStream__used(*JSGlobalObject) JSC.JSValue;
extern fn ReadableStream__cancel(stream: JSValue, *JSGlobalObject) void;
extern fn ReadableStream__abort(stream: JSValue, *JSGlobalObject) void;
extern fn ReadableStream__detach(stream: JSValue, *JSGlobalObject) void;
@@ -367,6 +368,12 @@ pub const ReadableStream = struct {
return ReadableStream__empty(globalThis);
}
+ pub fn used(globalThis: *JSGlobalObject) JSC.JSValue {
+ JSC.markBinding(@src());
+
+ return ReadableStream__used(globalThis);
+ }
+
const Base = @import("../../ast/base.zig");
pub const StreamTag = enum(usize) {
invalid = 0,
@@ -2634,6 +2641,7 @@ pub fn HTTPServerWritable(comptime ssl: bool) type {
}
fn flushFromJSNoWait(this: *@This()) JSC.Node.Maybe(JSValue) {
+ log("flushFromJSNoWait", .{});
if (this.hasBackpressure() or this.done) {
return .{ .result = JSValue.jsNumberFromInt32(0) };
}
@@ -3595,6 +3603,9 @@ pub const ByteStream = struct {
this.buffer = try std.ArrayList(u8).initCapacity(bun.default_allocator, chunk.len);
this.buffer.appendSliceAssumeCapacity(chunk);
},
+ .err => {
+ this.pending.result = .{ .err = stream.err };
+ },
else => unreachable,
}
return;
@@ -3604,6 +3615,9 @@ pub const ByteStream = struct {
.temporary_and_done, .temporary => {
try this.buffer.appendSlice(chunk);
},
+ .err => {
+ this.pending.result = .{ .err = stream.err };
+ },
// We don't support the rest of these yet
else => unreachable,
}
@@ -3788,7 +3802,6 @@ pub const FIFO = struct {
},
signal: JSC.WebCore.Signal = .{},
is_first_read: bool = true,
- auto_close: bool = true,
has_adjusted_pipe_size_on_linux: bool = false,
drained: bool = true,
@@ -3807,7 +3820,12 @@ pub const FIFO = struct {
pub fn close(this: *FIFO) void {
if (this.poll_ref) |poll| {
this.poll_ref = null;
- poll.deinit();
+ if (comptime Environment.isLinux) {
+ // force target fd to be removed from epoll
+ poll.deinitForceUnregister();
+ } else {
+ poll.deinit();
+ }
}
const fd = this.fd;
@@ -3815,8 +3833,7 @@ pub const FIFO = struct {
defer if (signal_close) this.signal.close(null);
if (signal_close) {
this.fd = bun.invalid_fd;
- if (this.auto_close)
- _ = bun.sys.close(fd);
+ _ = bun.sys.close(fd);
}
this.to_read = null;
@@ -3831,7 +3848,7 @@ pub const FIFO = struct {
pub fn getAvailableToReadOnLinux(this: *FIFO) u32 {
var len: c_int = 0;
- const rc: c_int = std.c.ioctl(this.fd, std.os.linux.T.FIONREAD, &len);
+ const rc: c_int = std.c.ioctl(this.fd, std.os.linux.T.FIONREAD, @as(*c_int, &len));
if (rc != 0) {
len = 0;
}
@@ -4198,10 +4215,15 @@ pub const File = struct {
file: *Blob.FileStore,
) StreamStart {
var file_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
- var auto_close = file.pathlike == .path;
- var fd = if (!auto_close)
- file.pathlike.fd
+ var fd = if (file.pathlike != .path)
+ // We will always need to close the file descriptor.
+ switch (Syscall.dup(@intCast(file.pathlike.fd))) {
+ .result => |_fd| _fd,
+ .err => |err| {
+ return .{ .err = err.withPath(file.pathlike.path.slice()) };
+ },
+ }
else switch (Syscall.open(file.pathlike.path.sliceZ(&file_buf), std.os.O.RDONLY | std.os.O.NONBLOCK | std.os.O.CLOEXEC, 0)) {
.result => |_fd| _fd,
.err => |err| {
@@ -4218,7 +4240,7 @@ pub const File = struct {
}
}
- if (!auto_close and !(file.is_atty orelse false)) {
+ if (file.pathlike != .path and !(file.is_atty orelse false)) {
if (comptime Environment.isWindows) {
bun.todo(@src(), {});
} else {
@@ -4229,7 +4251,6 @@ pub const File = struct {
// if we do not, clone the descriptor and set non-blocking
// it is important for us to clone it so we don't cause Weird Things to happen
if ((flags & std.os.O.NONBLOCK) == 0) {
- auto_close = true;
fd = switch (Syscall.fcntl(fd, std.os.F.DUPFD, 0)) {
.result => |_fd| @as(@TypeOf(fd), @intCast(_fd)),
.err => |err| return .{ .err = err },
@@ -4249,24 +4270,18 @@ pub const File = struct {
const stat: bun.Stat = switch (Syscall.fstat(fd)) {
.result => |result| result,
.err => |err| {
- if (auto_close) {
- _ = Syscall.close(fd);
- }
+ _ = Syscall.close(fd);
return .{ .err = err };
},
};
if (std.os.S.ISDIR(stat.mode)) {
- if (auto_close) {
- _ = Syscall.close(fd);
- }
+ _ = Syscall.close(fd);
return .{ .err = Syscall.Error.fromCode(.ISDIR, .fstat) };
}
if (std.os.S.ISSOCK(stat.mode)) {
- if (auto_close) {
- _ = Syscall.close(fd);
- }
+ _ = Syscall.close(fd);
return .{ .err = Syscall.Error.fromCode(.INVAL, .fstat) };
}
@@ -4292,9 +4307,7 @@ pub const File = struct {
file.max_size = this.remaining_bytes;
if (this.remaining_bytes == 0) {
- if (auto_close) {
- _ = Syscall.close(fd);
- }
+ _ = Syscall.close(fd);
return .{ .empty = {} };
}
@@ -4303,7 +4316,6 @@ pub const File = struct {
}
this.fd = fd;
- this.auto_close = auto_close;
return StreamStart{ .ready = {} };
}
@@ -4725,7 +4737,6 @@ pub const FileReader = struct {
.readable = .{
.FIFO = .{
.fd = readable_file.fd,
- .auto_close = readable_file.auto_close,
.drained = this.buffered_data.len == 0,
},
},
@@ -4885,7 +4896,7 @@ pub fn NewReadyWatcher(
const fd = @as(c_int, @intCast(fd_));
std.debug.assert(@as(c_int, @intCast(this.poll_ref.?.fd)) == fd);
std.debug.assert(
- this.poll_ref.?.unregister(JSC.VirtualMachine.get().event_loop_handle.?) == .result,
+ this.poll_ref.?.unregister(JSC.VirtualMachine.get().event_loop_handle.?, false) == .result,
);
}
diff --git a/src/bun.zig b/src/bun.zig
index 0e5c87991..a93b3c5ae 100644
--- a/src/bun.zig
+++ b/src/bun.zig
@@ -664,7 +664,7 @@ pub fn StringEnum(comptime Type: type, comptime Map: anytype, value: []const u8)
pub const Bunfig = @import("./bunfig.zig").Bunfig;
-pub const HTTPThead = @import("./http_client_async.zig").HTTPThread;
+pub const HTTPThread = @import("./http_client_async.zig").HTTPThread;
pub const Analytics = @import("./analytics/analytics_thread.zig");
@@ -1841,3 +1841,100 @@ pub fn fdi32(fd_: anytype) i32 {
}
pub const OSPathSlice = if (Environment.isWindows) [:0]const u16 else [:0]const u8;
+pub const LazyBoolValue = enum {
+ unknown,
+ no,
+ yes,
+};
+/// Create a lazily computed boolean value.
+/// Getter must be a function that takes a pointer to the parent struct and returns a boolean.
+/// Parent must be a type which contains the field we are getting.
+pub fn LazyBool(comptime Getter: anytype, comptime Parent: type, comptime field: string) type {
+ return struct {
+ value: LazyBoolValue = .unknown,
+ pub fn get(self: *@This()) bool {
+ if (self.value == .unknown) {
+ self.value = switch (Getter(@fieldParentPtr(Parent, field, self))) {
+ true => .yes,
+ false => .no,
+ };
+ }
+
+ return self.value == .yes;
+ }
+ };
+}
+
+pub fn serializable(input: anytype) @TypeOf(input) {
+ const T = @TypeOf(input);
+ comptime {
+ if (std.meta.trait.isExtern(T)) {
+ if (@typeInfo(T) == .Union) {
+ @compileError("Extern unions must be serialized with serializableInto");
+ }
+ }
+ }
+ var zeroed: [@sizeOf(T)]u8 align(@alignOf(T)) = comptime brk: {
+ var buf: [@sizeOf(T)]u8 align(@alignOf(T)) = undefined;
+ for (&buf) |*ptr| {
+ ptr.* = 0;
+ }
+ break :brk buf;
+ };
+ const result: *T = @ptrCast(&zeroed);
+
+ inline for (comptime std.meta.fieldNames(T)) |field_name| {
+ @field(result, field_name) = @field(input, field_name);
+ }
+
+ return result.*;
+}
+
+pub inline fn serializableInto(comptime T: type, init: anytype) T {
+ var zeroed: [@sizeOf(T)]u8 align(@alignOf(T)) = comptime brk: {
+ var buf: [@sizeOf(T)]u8 align(@alignOf(T)) = undefined;
+ for (&buf) |*ptr| {
+ ptr.* = 0;
+ }
+ break :brk buf;
+ };
+ const result: *T = @ptrCast(&zeroed);
+
+ inline for (comptime std.meta.fieldNames(@TypeOf(init))) |field_name| {
+ @field(result, field_name) = @field(init, field_name);
+ }
+
+ return result.*;
+}
+
+/// Like std.fs.Dir.makePath except instead of infinite looping on dangling
+/// symlink, it deletes the symlink and tries again.
+pub fn makePath(dir: std.fs.Dir, sub_path: []const u8) !void {
+ var it = try std.fs.path.componentIterator(sub_path);
+ var component = it.last() orelse return;
+ while (true) {
+ dir.makeDir(component.path) catch |err| switch (err) {
+ error.PathAlreadyExists => {
+ var path_buf2: [MAX_PATH_BYTES * 2]u8 = undefined;
+ copy(u8, &path_buf2, component.path);
+
+ path_buf2[component.path.len] = 0;
+ var path_to_use = path_buf2[0..component.path.len :0];
+ const result = sys.lstat(path_to_use);
+ try result.throw();
+ const is_dir = std.os.S.ISDIR(result.result.mode);
+ // dangling symlink
+ if (!is_dir) {
+ dir.deleteTree(component.path) catch {};
+ continue;
+ }
+ },
+ error.FileNotFound => |e| {
+ component = it.previous() orelse return e;
+ continue;
+ },
+ else => |e| return e,
+ };
+ component = it.next() orelse return;
+ }
+}
diff --git a/src/bun_js.zig b/src/bun_js.zig
index 29ecf28b8..6b807cf46 100644
--- a/src/bun_js.zig
+++ b/src/bun_js.zig
@@ -243,8 +243,10 @@ pub const Run = struct {
vm.hot_reload = this.ctx.debug.hot_reload;
vm.onUnhandledRejection = &onUnhandledRejectionBeforeClose;
- if (this.ctx.debug.hot_reload != .none) {
- JSC.HotReloader.enableHotModuleReloading(vm);
+ switch (this.ctx.debug.hot_reload) {
+ .hot => JSC.HotReloader.enableHotModuleReloading(vm),
+ .watch => JSC.WatchReloader.enableHotModuleReloading(vm),
+ else => {},
}
if (strings.eqlComptime(this.entry_path, ".") and vm.bundler.fs.top_level_dir.len > 0) {
diff --git a/src/bundler.zig b/src/bundler.zig
index 76fbc02ee..479843bcd 100644
--- a/src/bundler.zig
+++ b/src/bundler.zig
@@ -398,7 +398,8 @@ pub const Bundler = struct {
DotEnv.instance = env_loader;
}
- env_loader.quiet = !log.level.atLeast(.warn);
+ // hide elapsed time when loglevel is warn or error
+ env_loader.quiet = !log.level.atLeast(.info);
// var pool = try allocator.create(ThreadPool);
// try pool.init(ThreadPool.InitConfig{
@@ -435,13 +436,14 @@ pub const Bundler = struct {
);
if (auto_jsx) {
- // If we don't explicitly pass JSX, try to get it from the root tsconfig
- if (bundler.options.transform_options.jsx == null) {
- // Most of the time, this will already be cached
- if (bundler.resolver.readDirInfo(bundler.fs.top_level_dir) catch null) |root_dir| {
- if (root_dir.tsconfig_json) |tsconfig| {
+ // Most of the time, this will already be cached
+ if (bundler.resolver.readDirInfo(bundler.fs.top_level_dir) catch null) |root_dir| {
+ if (root_dir.tsconfig_json) |tsconfig| {
+ // If we don't explicitly pass JSX, try to get it from the root tsconfig
+ if (bundler.options.transform_options.jsx == null) {
bundler.options.jsx = tsconfig.jsx;
}
+ bundler.options.emit_decorator_metadata = tsconfig.emit_decorator_metadata;
}
}
}
@@ -780,6 +782,7 @@ pub const Bundler = struct {
.file_descriptor = file_descriptor,
.file_hash = filepath_hash,
.macro_remappings = bundler.options.macro_remap,
+ .emit_decorator_metadata = resolve_result.emit_decorator_metadata,
.jsx = resolve_result.jsx,
},
client_entry_point,
@@ -899,6 +902,7 @@ pub const Bundler = struct {
.file_hash = null,
.macro_remappings = bundler.options.macro_remap,
.jsx = resolve_result.jsx,
+ .emit_decorator_metadata = resolve_result.emit_decorator_metadata,
},
client_entry_point_,
) orelse {
@@ -1102,6 +1106,7 @@ pub const Bundler = struct {
.minify_syntax = bundler.options.minify_syntax,
.minify_identifiers = bundler.options.minify_identifiers,
.transform_only = bundler.options.transform_only,
+ .import_meta_ref = ast.import_meta_ref,
},
enable_source_map,
),
@@ -1125,6 +1130,7 @@ pub const Bundler = struct {
.transform_only = bundler.options.transform_only,
.module_type = if (ast.exports_kind == .cjs) .cjs else .esm,
.inline_require_and_import_errors = false,
+ .import_meta_ref = ast.import_meta_ref,
},
enable_source_map,
),
@@ -1188,6 +1194,7 @@ pub const Bundler = struct {
replace_exports: runtime.Runtime.Features.ReplaceableExport.Map = .{},
inject_jest_globals: bool = false,
set_breakpoint_on_first_line: bool = false,
+ emit_decorator_metadata: bool = false,
dont_bundle_twice: bool = false,
allow_commonjs: bool = false,
@@ -1300,7 +1307,9 @@ pub const Bundler = struct {
jsx.parse = loader.isJSX();
var opts = js_parser.Parser.Options.init(jsx, loader);
+
opts.legacy_transform_require_to_import = bundler.options.allow_runtime and !bundler.options.target.isBun();
+ opts.features.emit_decorator_metadata = this_parse.emit_decorator_metadata;
opts.features.allow_runtime = bundler.options.allow_runtime;
opts.features.set_breakpoint_on_first_line = this_parse.set_breakpoint_on_first_line;
opts.features.trim_unused_imports = bundler.options.trim_unused_imports orelse loader.isTypeScript();
@@ -1333,6 +1342,7 @@ pub const Bundler = struct {
opts.features.inject_jest_globals = this_parse.inject_jest_globals;
opts.features.minify_syntax = bundler.options.minify_syntax;
opts.features.minify_identifiers = bundler.options.minify_identifiers;
+ opts.features.dead_code_elimination = bundler.options.dead_code_elimination;
if (bundler.macro_context == null) {
bundler.macro_context = js_ast.Macro.MacroContext.init(bundler);
diff --git a/src/bundler/bundle_v2.zig b/src/bundler/bundle_v2.zig
index d75c1923c..f2595c16d 100644
--- a/src/bundler/bundle_v2.zig
+++ b/src/bundler/bundle_v2.zig
@@ -511,8 +511,8 @@ pub const BundleV2 = struct {
source,
import_record.range,
this.graph.allocator,
- "Could not resolve Node.js builtin: \"{s}\". To use Node.js builtins, set target to 'node' or 'bun'",
- .{path_to_use},
+ "Browser build cannot {s} Node.js module: \"{s}\". To use Node.js builtins, set target to 'node' or 'bun'",
+ .{ import_record.kind.errorLabel(), path_to_use },
import_record.kind,
) catch unreachable;
} else {
@@ -1914,8 +1914,8 @@ pub const BundleV2 = struct {
source,
import_record.range,
this.graph.allocator,
- "Could not resolve Node.js builtin: \"{s}\". To use Node.js builtins, set target to 'node' or 'bun'",
- .{import_record.path.text},
+ "Browser build cannot {s} Node.js builtin: \"{s}\". To use Node.js builtins, set target to 'node' or 'bun'",
+ .{ import_record.kind.errorLabel(), import_record.path.text },
import_record.kind,
) catch @panic("unexpected log error");
} else {
@@ -2276,6 +2276,7 @@ pub const ParseTask = struct {
tree_shaking: bool = false,
known_target: ?options.Target = null,
module_type: options.ModuleType = .unknown,
+ emit_decorator_metadata: bool = false,
ctx: *BundleV2,
package_version: string = "",
@@ -2298,6 +2299,7 @@ pub const ParseTask = struct {
.jsx = resolve_result.jsx,
.source_index = source_index orelse Index.invalid,
.module_type = resolve_result.module_type,
+ .emit_decorator_metadata = resolve_result.emit_decorator_metadata,
.package_version = if (resolve_result.package_json) |package_json| package_json.version else "",
};
}
@@ -2600,6 +2602,7 @@ pub const ParseTask = struct {
opts.features.minify_syntax = bundler.options.minify_syntax;
opts.features.minify_identifiers = bundler.options.minify_identifiers;
opts.features.should_fold_typescript_constant_expressions = opts.features.inlining or loader.isTypeScript();
+ opts.features.emit_decorator_metadata = bundler.options.emit_decorator_metadata;
opts.tree_shaking = if (source.index.isRuntime()) true else bundler.options.tree_shaking;
opts.module_type = task.module_type;
@@ -9799,15 +9802,45 @@ const LinkerContext = struct {
// time, so we emit a debug message and rewrite the value to the literal
// "undefined" instead of emitting an error.
symbol.import_item_status = .missing;
- c.log.addRangeWarningFmt(
+ if (c.resolver.opts.target == .browser and JSC.HardcodedModule.Aliases.has(next_source.path.pretty, .bun)) {
+ c.log.addRangeWarningFmtWithNote(
+ source,
+ r,
+ c.allocator,
+ "Browser polyfill for module \"{s}\" doesn't have a matching export named \"{s}\"",
+ .{
+ next_source.path.pretty,
+ named_import.alias.?,
+ },
+ "Bun's bundler defaults to browser builds instead of node or bun builds. If you want to use node or bun builds, you can set the target to \"node\" or \"bun\" in the bundler options.",
+ .{},
+ r,
+ ) catch unreachable;
+ } else {
+ c.log.addRangeWarningFmt(
+ source,
+ r,
+ c.allocator,
+ "Import \"{s}\" will always be undefined because there is no matching export in \"{s}\"",
+ .{
+ named_import.alias.?,
+ next_source.path.pretty,
+ },
+ ) catch unreachable;
+ }
+ } else if (c.resolver.opts.target == .browser and JSC.HardcodedModule.Aliases.has(next_source.path.pretty, .browser)) {
+ c.log.addRangeErrorFmtWithNote(
source,
r,
c.allocator,
- "Import \"{s}\" will always be undefined because there is no matching export in \"{s}\"",
+ "Browser polyfill for module \"{s}\" doesn't have a matching export named \"{s}\"",
.{
- named_import.alias.?,
next_source.path.pretty,
+ named_import.alias.?,
},
+ "Bun's bundler defaults to browser builds instead of node or bun builds. If you want to use node or bun builds, you can set the target to \"node\" or \"bun\" in the bundler options.",
+ .{},
+ r,
) catch unreachable;
} else {
c.log.addRangeErrorFmt(
diff --git a/src/bundler/entry_points.zig b/src/bundler/entry_points.zig
index 5e8310d92..9101cef08 100644
--- a/src/bundler/entry_points.zig
+++ b/src/bundler/entry_points.zig
@@ -6,6 +6,7 @@ const Fs = @import("../fs.zig");
const js_ast = bun.JSAst;
const Bundler = bun.Bundler;
const strings = bun.strings;
+
pub const FallbackEntryPoint = struct {
code_buffer: [8096]u8 = undefined,
path_buffer: [bun.MAX_PATH_BYTES]u8 = undefined,
@@ -156,6 +157,25 @@ pub const ClientEntryPoint = struct {
}
};
+const QuoteEscapeFormat = struct {
+ data: []const u8,
+
+ pub fn format(self: QuoteEscapeFormat, comptime _: []const u8, _: std.fmt.FormatOptions, writer: anytype) !void {
+ var i: usize = 0;
+ while (std.mem.indexOfAnyPos(u8, self.data, i, "\"\n\\")) |j| : (i = j + 1) {
+ try writer.writeAll(self.data[i..j]);
+ try writer.writeAll(switch (self.data[j]) {
+ '"' => "\\\"",
+ '\n' => "\\n",
+ '\\' => "\\\\",
+ else => unreachable,
+ });
+ }
+ if (i == self.data.len) return;
+ try writer.writeAll(self.data[i..]);
+ }
+};
+
pub const ServerEntryPoint = struct {
source: logger.Source = undefined,
@@ -185,7 +205,7 @@ pub const ServerEntryPoint = struct {
allocator,
\\// @bun
\\var hmrSymbol = Symbol.for("BunServerHMR");
- \\import * as start from '{s}{s}';
+ \\import * as start from "{}{}";
\\var entryNamespace = start;
\\if (typeof entryNamespace?.then === 'function') {{
\\ entryNamespace = entryNamespace.then((entryNamespace) => {{
@@ -211,15 +231,15 @@ pub const ServerEntryPoint = struct {
\\
,
.{
- dir_to_use,
- original_path.filename,
+ QuoteEscapeFormat{ .data = dir_to_use },
+ QuoteEscapeFormat{ .data = original_path.filename },
},
);
}
break :brk try std.fmt.allocPrint(
allocator,
\\// @bun
- \\import * as start from '{s}{s}';
+ \\import * as start from "{}{}";
\\var entryNamespace = start;
\\if (typeof entryNamespace?.then === 'function') {{
\\ entryNamespace = entryNamespace.then((entryNamespace) => {{
@@ -233,8 +253,8 @@ pub const ServerEntryPoint = struct {
\\
,
.{
- dir_to_use,
- original_path.filename,
+ QuoteEscapeFormat{ .data = dir_to_use },
+ QuoteEscapeFormat{ .data = original_path.filename },
},
);
};
diff --git a/src/bunfig.zig b/src/bunfig.zig
index 76f33cb82..a777475da 100644
--- a/src/bunfig.zig
+++ b/src/bunfig.zig
@@ -55,51 +55,68 @@ pub const Bunfig = struct {
return error.@"Invalid Bunfig";
}
- fn parseRegistry(this: *Parser, expr: js_ast.Expr) !Api.NpmRegistry {
+ fn parseRegistryURLString(this: *Parser, str: *js_ast.E.String) !Api.NpmRegistry {
+ const url = URL.parse(str.data);
+ var registry = std.mem.zeroes(Api.NpmRegistry);
+
+ // Token
+ if (url.username.len == 0 and url.password.len > 0) {
+ registry.token = url.password;
+ registry.url = try std.fmt.allocPrint(this.allocator, "{s}://{}/{s}/", .{ url.displayProtocol(), url.displayHost(), std.mem.trim(u8, url.pathname, "/") });
+ } else if (url.username.len > 0 and url.password.len > 0) {
+ registry.username = url.username;
+ registry.password = url.password;
+
+ registry.url = try std.fmt.allocPrint(this.allocator, "{s}://{}/{s}/", .{ url.displayProtocol(), url.displayHost(), std.mem.trim(u8, url.pathname, "/") });
+ } else {
+ // Do not include a trailing slash. There might be parameters at the end.
+ registry.url = url.href;
+ }
+
+ return registry;
+ }
+
+ fn parseRegistryObject(this: *Parser, obj: *js_ast.E.Object) !Api.NpmRegistry {
var registry = std.mem.zeroes(Api.NpmRegistry);
+ if (obj.get("url")) |url| {
+ try this.expect(url, .e_string);
+ const href = url.data.e_string.data;
+ // Do not include a trailing slash. There might be parameters at the end.
+ registry.url = href;
+ }
+
+ if (obj.get("username")) |username| {
+ try this.expect(username, .e_string);
+ registry.username = username.data.e_string.data;
+ }
+
+ if (obj.get("password")) |password| {
+ try this.expect(password, .e_string);
+ registry.password = password.data.e_string.data;
+ }
+
+ if (obj.get("token")) |token| {
+ try this.expect(token, .e_string);
+ registry.token = token.data.e_string.data;
+ }
+
+ return registry;
+ }
+
+ fn parseRegistry(this: *Parser, expr: js_ast.Expr) !Api.NpmRegistry {
switch (expr.data) {
.e_string => |str| {
- const url = URL.parse(str.data);
- // Token
- if (url.username.len == 0 and url.password.len > 0) {
- registry.token = url.password;
- registry.url = try std.fmt.allocPrint(this.allocator, "{s}://{s}/{s}", .{ url.displayProtocol(), url.displayHostname(), std.mem.trimLeft(u8, url.pathname, "/") });
- } else if (url.username.len > 0 and url.password.len > 0) {
- registry.username = url.username;
- registry.password = url.password;
- registry.url = try std.fmt.allocPrint(this.allocator, "{s}://{s}/{s}", .{ url.displayProtocol(), url.displayHostname(), std.mem.trimLeft(u8, url.pathname, "/") });
- } else {
- registry.url = url.href;
- }
+ return this.parseRegistryURLString(str);
},
.e_object => |obj| {
- if (obj.get("url")) |url| {
- try this.expect(url, .e_string);
- registry.url = url.data.e_string.data;
- }
-
- if (obj.get("username")) |username| {
- try this.expect(username, .e_string);
- registry.username = username.data.e_string.data;
- }
-
- if (obj.get("password")) |password| {
- try this.expect(password, .e_string);
- registry.password = password.data.e_string.data;
- }
-
- if (obj.get("token")) |token| {
- try this.expect(token, .e_string);
- registry.token = token.data.e_string.data;
- }
+ return this.parseRegistryObject(obj);
},
else => {
try this.addError(expr.loc, "Expected registry to be a URL string or an object");
+ return std.mem.zeroes(Api.NpmRegistry);
},
}
-
- return registry;
}
fn loadLogLevel(this: *Parser, expr: js_ast.Expr) !void {
@@ -199,6 +216,11 @@ pub const Bunfig = struct {
if (json.get("preload")) |expr| {
try this.loadPreload(allocator, expr);
}
+
+ if (json.get("telemetry")) |expr| {
+ try this.expect(expr, .e_boolean);
+ Analytics.disabled = !expr.data.e_boolean.value;
+ }
}
if (comptime cmd == .RunCommand or cmd == .AutoCommand) {
diff --git a/src/cli.zig b/src/cli.zig
index 303063574..a05fb3768 100644
--- a/src/cli.zig
+++ b/src/cli.zig
@@ -75,6 +75,7 @@ pub const Cli = struct {
\\ <cyan>--target<r> The intended execution environment for the bundle.
\\ ("browser", "bun" or "node")
\\ <cyan>--splitting<r> Enable code splitting (requires --outdir)
+ \\ <cyan>--watch<r> Run bundler in watch mode
\\
\\<b>Examples:<r>
\\ <d>Frontend web apps:<r>
@@ -168,7 +169,7 @@ pub const Arguments = struct {
clap.parseParam("-h, --help Display this help and exit.") catch unreachable,
clap.parseParam("-b, --bun Force a script or package to use Bun's runtime instead of Node.js (via symlinking node)") catch unreachable,
clap.parseParam("--cwd <STR> Absolute path to resolve files & entry points from. This just changes the process' cwd.") catch unreachable,
- clap.parseParam("-c, --config <PATH>? Config file to load bun from (e.g. -c bunfig.toml") catch unreachable,
+ clap.parseParam("-c, --config <PATH>? Config file to load Bun from (e.g. -c bunfig.toml") catch unreachable,
clap.parseParam("--extension-order <STR>... Defaults to: .tsx,.ts,.jsx,.js,.json ") catch unreachable,
clap.parseParam("--jsx-factory <STR> Changes the function called when compiling JSX elements using the classic JSX runtime") catch unreachable,
clap.parseParam("--jsx-fragment <STR> Changes the function called when compiling JSX fragments") catch unreachable,
@@ -184,7 +185,7 @@ pub const Arguments = struct {
clap.parseParam("-e, --external <STR>... Exclude module from transpilation (can use * wildcards). ex: -e react") catch unreachable,
clap.parseParam("-l, --loader <STR>... Parse files with .ext:loader, e.g. --loader .js:jsx. Valid loaders: js, jsx, ts, tsx, json, toml, text, file, wasm, napi") catch unreachable,
clap.parseParam("-u, --origin <STR> Rewrite import URLs to start with --origin. Default: \"\"") catch unreachable,
- clap.parseParam("-p, --port <STR> Port to serve bun's dev server on. Default: \"3000\"") catch unreachable,
+ clap.parseParam("-p, --port <STR> Port to serve Bun's dev server on. Default: \"3000\"") catch unreachable,
clap.parseParam("--smol Use less memory, but run garbage collection more often") catch unreachable,
clap.parseParam("--minify Minify (experimental)") catch unreachable,
clap.parseParam("--minify-syntax Minify syntax and inline data (experimental)") catch unreachable,
@@ -195,19 +196,20 @@ pub const Arguments = struct {
clap.parseParam("--inspect <STR>? Activate Bun's Debugger") catch unreachable,
clap.parseParam("--inspect-wait <STR>? Activate Bun's Debugger, wait for a connection before executing") catch unreachable,
clap.parseParam("--inspect-brk <STR>? Activate Bun's Debugger, set breakpoint on first line of code and wait") catch unreachable,
+ clap.parseParam("--if-present Exit if the entrypoint does not exist") catch unreachable,
clap.parseParam("<POS>... ") catch unreachable,
};
// note: we are keeping --port and --origin as it can be reused for bun
// build and elsewhere
pub const not_bun_dev_flags = [_]ParamType{
- clap.parseParam("--hot Enable auto reload in bun's JavaScript runtime") catch unreachable,
- clap.parseParam("--watch Automatically restart bun's JavaScript runtime on file change") catch unreachable,
- clap.parseParam("--no-install Disable auto install in bun's JavaScript runtime") catch unreachable,
- clap.parseParam("-i Automatically install dependencies and use global cache in bun's runtime, equivalent to --install=fallback") catch unreachable,
+ clap.parseParam("--hot Enable auto reload in the Bun runtime, test runner, or bundler") catch unreachable,
+ clap.parseParam("--watch Automatically restart the process on file change") catch unreachable,
+ clap.parseParam("--no-install Disable auto install in the Bun runtime") catch unreachable,
+ clap.parseParam("-i Automatically install dependencies and use global cache in Bun's runtime, equivalent to --install=fallback") catch unreachable,
clap.parseParam("--install <STR> Install dependencies automatically when no node_modules are present, default: \"auto\". \"force\" to ignore node_modules, fallback to install any missing") catch unreachable,
- clap.parseParam("--prefer-offline Skip staleness checks for packages in bun's JavaScript runtime and resolve from disk") catch unreachable,
- clap.parseParam("--prefer-latest Use the latest matching versions of packages in bun's JavaScript runtime, always checking npm") catch unreachable,
+ clap.parseParam("--prefer-offline Skip staleness checks for packages in the Bun runtime and resolve from disk") catch unreachable,
+ clap.parseParam("--prefer-latest Use the latest matching versions of packages in the Bun runtime, always checking npm") catch unreachable,
clap.parseParam("--silent Don't repeat the command for bun run") catch unreachable,
};
@@ -537,6 +539,7 @@ pub const Arguments = struct {
ctx.preloads = preloads;
}
+ ctx.runtime_options.if_present = args.flag("--if-present");
ctx.runtime_options.smol = args.flag("--smol");
if (args.option("--inspect")) |inspect_flag| {
ctx.runtime_options.debugger = if (inspect_flag.len == 0)
@@ -896,7 +899,7 @@ pub const HelpCommand = struct {
\\ <b><blue>install<r> Install dependencies for a package.json <d>(bun i)<r>
\\ <b><blue>add<r> <d>{s:<16}<r> Add a dependency to package.json <d>(bun a)<r>
\\ <b><blue>remove<r> <d>{s:<16}<r> Remove a dependency from package.json <d>(bun rm)<r>
- \\ <b><blue>update<r> <d>{s:<16}<r> Update outdated dependencies & save to package.json
+ \\ <b><blue>update<r> <d>{s:<16}<r> Update outdated dependencies
\\ <b><blue>link<r> Link an npm package globally
\\ <b><blue>unlink<r> Globally unlink an npm package
\\ <b>pm<r> More commands for managing packages
@@ -1021,6 +1024,7 @@ pub const Command = struct {
pub const RuntimeOptions = struct {
smol: bool = false,
debugger: Debugger = .{ .unspecified = {} },
+ if_present: bool = false,
};
pub const Context = struct {
@@ -1191,6 +1195,7 @@ pub const Command = struct {
"install",
"add",
"run",
+ "update",
"link",
"unlink",
"remove",
@@ -1198,6 +1203,7 @@ pub const Command = struct {
"bun",
"upgrade",
"discord",
+ "test",
"pm",
"x",
"repl",
@@ -1510,6 +1516,28 @@ pub const Command = struct {
const template_name = positionals[0];
+ // if template_name is "react"
+ // print message telling user to use "bun create vite" instead
+ if (strings.eqlComptime(template_name, "react")) {
+ Output.prettyErrorln(
+ \\The "react" template has been deprecated.
+ \\It is recommended to use "react-app" or "vite" instead.
+ \\
+ \\To create a project using Create React App, run
+ \\
+ \\ bun create react-app
+ \\
+ \\To create a React project using Vite, run
+ \\
+ \\ bun create vite
+ \\
+ \\Then select "React" from the list of frameworks.
+ \\
+ , .{});
+ Global.exit(1);
+ return;
+ }
+
const use_bunx = !HardcodedNonBunXList.has(template_name) and
(!strings.containsComptime(template_name, "/") or
strings.startsWithChar(template_name, '@'));
@@ -1641,6 +1669,10 @@ pub const Command = struct {
Global.exit(1);
}
+ if (ctx.runtime_options.if_present) {
+ return;
+ }
+
if (was_js_like) {
Output.prettyErrorln("<r><red>error<r><d>:<r> module not found \"<b>{s}<r>\"", .{
ctx.positionals[0],
diff --git a/src/cli/bunx_command.zig b/src/cli/bunx_command.zig
index f721eb98b..e7f35d10d 100644
--- a/src/cli/bunx_command.zig
+++ b/src/cli/bunx_command.zig
@@ -23,7 +23,8 @@ pub const BunxCommand = struct {
var new_str = try allocator.allocSentinel(u8, input.len + prefixLength, 0);
if (input[0] == '@') {
- if (strings.indexAnyComptime(input, "/")) |index| {
+ if (strings.indexAnyComptime(input, "/")) |slashIndex| {
+ const index = slashIndex + 1;
@memcpy(new_str[0..index], input[0..index]);
@memcpy(new_str[index .. index + prefixLength], "create-");
@memcpy(new_str[index + prefixLength ..], input[index..]);
@@ -159,7 +160,8 @@ pub const BunxCommand = struct {
Global.exit(1);
}
- pub fn exec(ctx: bun.CLI.Command.Context, argv: [][*:0]const u8) !void {
+ pub fn exec(ctx_: bun.CLI.Command.Context, argv: [][*:0]const u8) !void {
+ var ctx = ctx_;
var requests_buf = bun.PackageManager.UpdateRequest.Array.init(0) catch unreachable;
var run_in_bun = ctx.debug.run_in_bun;
@@ -220,6 +222,9 @@ pub const BunxCommand = struct {
Global.exit(1);
}
+ // Don't log stuff
+ ctx.debug.silent = true;
+
var update_request = update_requests[0];
// if you type "tsc" and TypeScript is not installed:
@@ -231,6 +236,8 @@ pub const BunxCommand = struct {
const initial_bin_name = if (strings.eqlComptime(update_request.name, "typescript"))
"tsc"
+ else if (update_request.version.tag == .github)
+ update_request.version.value.github.repo.slice(update_request.version_buf)
else if (strings.lastIndexOfChar(update_request.name, '/')) |index|
update_request.name[index + 1 ..]
else
@@ -257,94 +264,123 @@ pub const BunxCommand = struct {
else
update_request.version.literal.slice(update_request.version_buf);
+ const package_fmt = brk: {
+ if (update_request.version.tag == .github) {
+ break :brk update_request.version.literal.slice(update_request.version_buf);
+ }
+
+ break :brk try std.fmt.allocPrint(
+ ctx.allocator,
+ "{s}@{s}",
+ .{
+ update_request.name,
+ display_version,
+ },
+ );
+ };
+
const PATH_FOR_BIN_DIRS = PATH;
if (PATH.len > 0) {
PATH = try std.fmt.allocPrint(
ctx.allocator,
- bun.fs.FileSystem.RealFS.PLATFORM_TMP_DIR ++ "/{s}@{s}--bunx/node_modules/.bin:{s}",
- .{ update_request.name, display_version, PATH },
+ bun.fs.FileSystem.RealFS.PLATFORM_TMP_DIR ++ "/{s}--bunx/node_modules/.bin:{s}",
+ .{ package_fmt, PATH },
);
} else {
PATH = try std.fmt.allocPrint(
ctx.allocator,
- bun.fs.FileSystem.RealFS.PLATFORM_TMP_DIR ++ "/{s}@{s}--bunx/node_modules/.bin",
- .{ update_request.name, display_version },
+ bun.fs.FileSystem.RealFS.PLATFORM_TMP_DIR ++ "/{s}--bunx/node_modules/.bin",
+ .{package_fmt},
);
}
try this_bundler.env.map.put("PATH", PATH);
- const bunx_cache_dir = PATH[0 .. bun.fs.FileSystem.RealFS.PLATFORM_TMP_DIR.len + "/--bunx@".len + update_request.name.len + display_version.len];
+ const bunx_cache_dir = PATH[0 .. bun.fs.FileSystem.RealFS.PLATFORM_TMP_DIR.len + "/--bunx".len + package_fmt.len];
var absolute_in_cache_dir_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
var absolute_in_cache_dir = std.fmt.bufPrint(&absolute_in_cache_dir_buf, "/{s}/node_modules/.bin/{s}", .{ bunx_cache_dir, initial_bin_name }) catch unreachable;
const passthrough = passthrough_list.items;
- // Similar to "npx":
- //
- // 1. Try the bin in the current node_modules and then we try the bin in the global cache
- if (bun.which(
- &path_buf,
- PATH_FOR_BIN_DIRS,
- this_bundler.fs.top_level_dir,
- initial_bin_name,
- ) orelse bun.which(
- &path_buf,
- bunx_cache_dir,
- this_bundler.fs.top_level_dir,
- absolute_in_cache_dir,
- )) |destination| {
- const out = bun.asByteSlice(destination);
- _ = try Run.runBinary(
- ctx,
- try this_bundler.fs.dirname_store.append(@TypeOf(out), out),
- this_bundler.fs.top_level_dir,
- this_bundler.env,
- passthrough,
- );
- // we are done!
- Global.exit(0);
- }
+ if (update_request.version.literal.isEmpty() or update_request.version.tag != .dist_tag) {
+ var destination_: ?[:0]const u8 = null;
- // 2. The "bin" is possibly not the same as the package name, so we load the package.json to figure out what "bin" to use
- if (getBinName(&this_bundler, bun.fdcast(root_dir_info.getFileDescriptor()), bunx_cache_dir, initial_bin_name)) |package_name_for_bin| {
- // if we check the bin name and its actually the same, we don't need to check $PATH here again
- if (!strings.eqlLong(package_name_for_bin, initial_bin_name, true)) {
- absolute_in_cache_dir = std.fmt.bufPrint(&absolute_in_cache_dir_buf, "{s}/node_modules/.bin/{s}", .{ bunx_cache_dir, package_name_for_bin }) catch unreachable;
-
- if (bun.which(
+ // Only use the system-installed version if there is no version specified
+ if (update_request.version.literal.isEmpty()) {
+ destination_ = bun.which(
&path_buf,
PATH_FOR_BIN_DIRS,
this_bundler.fs.top_level_dir,
- package_name_for_bin,
- ) orelse bun.which(
- &path_buf,
- bunx_cache_dir,
+ initial_bin_name,
+ );
+ }
+
+ // Similar to "npx":
+ //
+ // 1. Try the bin in the current node_modules and then we try the bin in the global cache
+ if (destination_ orelse bun.which(
+ &path_buf,
+ bunx_cache_dir,
+ this_bundler.fs.top_level_dir,
+ absolute_in_cache_dir,
+ )) |destination| {
+ const out = bun.asByteSlice(destination);
+ _ = try Run.runBinary(
+ ctx,
+ try this_bundler.fs.dirname_store.append(@TypeOf(out), out),
this_bundler.fs.top_level_dir,
- absolute_in_cache_dir,
- )) |destination| {
- const out = bun.asByteSlice(destination);
- _ = try Run.runBinary(
- ctx,
- try this_bundler.fs.dirname_store.append(@TypeOf(out), out),
+ this_bundler.env,
+ passthrough,
+ );
+ // we are done!
+ Global.exit(0);
+ }
+
+ // 2. The "bin" is possibly not the same as the package name, so we load the package.json to figure out what "bin" to use
+ if (getBinName(&this_bundler, bun.fdcast(root_dir_info.getFileDescriptor()), bunx_cache_dir, initial_bin_name)) |package_name_for_bin| {
+ // if we check the bin name and its actually the same, we don't need to check $PATH here again
+ if (!strings.eqlLong(package_name_for_bin, initial_bin_name, true)) {
+ absolute_in_cache_dir = std.fmt.bufPrint(&absolute_in_cache_dir_buf, "{s}/node_modules/.bin/{s}", .{ bunx_cache_dir, package_name_for_bin }) catch unreachable;
+
+ // Only use the system-installed version if there is no version specified
+ if (update_request.version.literal.isEmpty()) {
+ destination_ = bun.which(
+ &path_buf,
+ PATH_FOR_BIN_DIRS,
+ this_bundler.fs.top_level_dir,
+ package_name_for_bin,
+ );
+ }
+
+ if (destination_ orelse bun.which(
+ &path_buf,
+ bunx_cache_dir,
this_bundler.fs.top_level_dir,
- this_bundler.env,
- passthrough,
- );
- // we are done!
- Global.exit(0);
+ absolute_in_cache_dir,
+ )) |destination| {
+ const out = bun.asByteSlice(destination);
+ _ = try Run.runBinary(
+ ctx,
+ try this_bundler.fs.dirname_store.append(@TypeOf(out), out),
+ this_bundler.fs.top_level_dir,
+ this_bundler.env,
+ passthrough,
+ );
+ // we are done!
+ Global.exit(0);
+ }
+ }
+ } else |err| {
+ if (err == error.NoBinFound) {
+ Output.prettyErrorln("<r><red>error<r><d>:<r> could not determine executable to run for package <r><b>{s}<r>", .{update_request.name});
+ Global.exit(1);
}
- }
- } else |err| {
- if (err == error.NoBinFound) {
- Output.prettyErrorln("<r><red>error<r><d>:<r> could not determine executable to run for package <r><b>{s}<r>", .{update_request.name});
- Global.exit(1);
}
}
var bunx_install_dir_path = try std.fmt.allocPrint(
ctx.allocator,
- bun.fs.FileSystem.RealFS.PLATFORM_TMP_DIR ++ "/{s}@{s}--bunx",
- .{ update_request.name, display_version },
+ bun.fs.FileSystem.RealFS.PLATFORM_TMP_DIR ++ "/{s}--bunx",
+ .{package_fmt},
);
// TODO: fix this after zig upgrade
@@ -353,22 +389,22 @@ pub const BunxCommand = struct {
create_package_json: {
// create package.json, but only if it doesn't exist
- var package_json = bunx_install_dir.createFileZ("package.json", .{ .truncate = false }) catch break :create_package_json;
+ var package_json = bunx_install_dir.createFileZ("package.json", .{ .truncate = true }) catch break :create_package_json;
defer package_json.close();
package_json.writeAll("{}\n") catch {};
}
var args_buf = [_]string{
- try std.fs.selfExePathAlloc(ctx.allocator), "add", "--no-summary", try std.fmt.allocPrint(
- ctx.allocator,
- "{s}@{s}",
- .{
- update_request.name,
- display_version,
- },
- ),
+ try std.fs.selfExePathAlloc(ctx.allocator), "add", "--no-summary",
+ package_fmt,
+ // disable the manifest cache when a tag is specified
+ // so that @latest is fetched from the registry
+ "--no-cache",
};
- var child_process = std.ChildProcess.init(&args_buf, default_allocator);
+
+ const argv_to_use: []const string = args_buf[0 .. args_buf.len - @as(usize, @intFromBool(update_request.version.tag != .dist_tag))];
+
+ var child_process = std.ChildProcess.init(argv_to_use, default_allocator);
child_process.cwd = bunx_install_dir_path;
child_process.cwd_dir = bunx_install_dir;
const env_map = try this_bundler.env.map.cloneToEnvMap(ctx.allocator);
@@ -400,14 +436,10 @@ pub const BunxCommand = struct {
// Similar to "npx":
//
- // 1. Try the bin in the current node_modules and then we try the bin in the global cache
+ // 1. Try the bin in the global cache
+ // Do not try $PATH because we already checked it above if we should
if (bun.which(
&path_buf,
- PATH_FOR_BIN_DIRS,
- this_bundler.fs.top_level_dir,
- initial_bin_name,
- ) orelse bun.which(
- &path_buf,
bunx_cache_dir,
this_bundler.fs.top_level_dir,
absolute_in_cache_dir,
@@ -426,18 +458,11 @@ pub const BunxCommand = struct {
// 2. The "bin" is possibly not the same as the package name, so we load the package.json to figure out what "bin" to use
if (getBinNameFromTempDirectory(&this_bundler, bunx_cache_dir, update_request.name)) |package_name_for_bin| {
-
- // if we check the bin name and its actually the same, we don't need to check $PATH here again
if (!strings.eqlLong(package_name_for_bin, initial_bin_name, true)) {
absolute_in_cache_dir = std.fmt.bufPrint(&absolute_in_cache_dir_buf, "{s}/node_modules/.bin/{s}", .{ bunx_cache_dir, package_name_for_bin }) catch unreachable;
if (bun.which(
&path_buf,
- PATH_FOR_BIN_DIRS,
- this_bundler.fs.top_level_dir,
- package_name_for_bin,
- ) orelse bun.which(
- &path_buf,
bunx_cache_dir,
this_bundler.fs.top_level_dir,
absolute_in_cache_dir,
diff --git a/src/cli/create_command.zig b/src/cli/create_command.zig
index b052a11df..b112d5899 100644
--- a/src/cli/create_command.zig
+++ b/src/cli/create_command.zig
@@ -272,7 +272,7 @@ pub const CreateCommand = struct {
var example_tag = Example.Tag.unknown;
- var unsupported_packages = UnsupportedPackages{};
+ // var unsupported_packages = UnsupportedPackages{};
const template = brk: {
var positional = positionals[0];
@@ -753,55 +753,55 @@ pub const CreateCommand = struct {
}
}
- const Needs = struct {
- bun_bun_for_nextjs: bool = false,
- bun_macro_relay: bool = false,
- bun_macro_relay_dependency: bool = false,
- bun_framework_next: bool = false,
- react_refresh: bool = false,
- };
- var needs = Needs{};
- var has_relay = false;
- var has_bun_framework_next = false;
- var has_react_refresh = false;
- var has_bun_macro_relay = false;
- var has_react = false;
- var has_react_scripts = false;
-
- const Prune = struct {
- pub const packages = ComptimeStringMap(void, .{
- .{ "@parcel/babel-preset", {} },
- .{ "@parcel/core", {} },
- .{ "@swc/cli", {} },
- .{ "@swc/core", {} },
- .{ "@webpack/cli", {} },
- .{ "react-scripts", {} },
- .{ "webpack-cli", {} },
- .{ "webpack", {} },
-
- // one of cosmic config's imports breaks stuff
- .{ "cosmiconfig", {} },
- });
- pub var prune_count: u16 = 0;
-
- pub fn prune(list: []js_ast.G.Property) []js_ast.G.Property {
- var i: usize = 0;
- var out_i: usize = 0;
- while (i < list.len) : (i += 1) {
- const key = list[i].key.?.data.e_string.data;
-
- const do_prune = packages.has(key);
- prune_count += @as(u16, @intCast(@intFromBool(do_prune)));
-
- if (!do_prune) {
- list[out_i] = list[i];
- out_i += 1;
- }
- }
-
- return list[0..out_i];
- }
- };
+ // const Needs = struct {
+ // bun_bun_for_nextjs: bool = false,
+ // bun_macro_relay: bool = false,
+ // bun_macro_relay_dependency: bool = false,
+ // bun_framework_next: bool = false,
+ // react_refresh: bool = false,
+ // };
+ // var needs = Needs{};
+ // var has_relay = false;
+ // var has_bun_framework_next = false;
+ // var has_react_refresh = false;
+ // var has_bun_macro_relay = false;
+ // var has_react = false;
+ // var has_react_scripts = false;
+
+ // const Prune = struct {
+ // pub const packages = ComptimeStringMap(void, .{
+ // .{ "@parcel/babel-preset", {} },
+ // .{ "@parcel/core", {} },
+ // .{ "@swc/cli", {} },
+ // .{ "@swc/core", {} },
+ // .{ "@webpack/cli", {} },
+ // .{ "react-scripts", {} },
+ // .{ "webpack-cli", {} },
+ // .{ "webpack", {} },
+
+ // // one of cosmic config's imports breaks stuff
+ // .{ "cosmiconfig", {} },
+ // });
+ // pub var prune_count: u16 = 0;
+
+ // pub fn prune(list: []js_ast.G.Property) []js_ast.G.Property {
+ // var i: usize = 0;
+ // var out_i: usize = 0;
+ // while (i < list.len) : (i += 1) {
+ // const key = list[i].key.?.data.e_string.data;
+
+ // const do_prune = packages.has(key);
+ // prune_count += @as(u16, @intCast(@intFromBool(do_prune)));
+
+ // if (!do_prune) {
+ // list[out_i] = list[i];
+ // out_i += 1;
+ // }
+ // }
+
+ // return list[0..out_i];
+ // }
+ // };
var dev_dependencies: ?js_ast.Expr = null;
var dependencies: ?js_ast.Expr = null;
@@ -810,20 +810,20 @@ pub const CreateCommand = struct {
const property = q.expr;
if (property.data == .e_object and property.data.e_object.properties.len > 0) {
- unsupported_packages.update(property);
+ // unsupported_packages.update(property);
- has_react_scripts = has_react_scripts or property.hasAnyPropertyNamed(&.{"react-scripts"});
- has_relay = has_relay or property.hasAnyPropertyNamed(&.{ "react-relay", "relay-runtime", "babel-plugin-relay" });
+ // has_react_scripts = has_react_scripts or property.hasAnyPropertyNamed(&.{"react-scripts"});
+ // has_relay = has_relay or property.hasAnyPropertyNamed(&.{ "react-relay", "relay-runtime", "babel-plugin-relay" });
- property.data.e_object.properties = js_ast.G.Property.List.init(Prune.prune(property.data.e_object.properties.slice()));
+ // property.data.e_object.properties = js_ast.G.Property.List.init(Prune.prune(property.data.e_object.properties.slice()));
if (property.data.e_object.properties.len > 0) {
has_dependencies = true;
dev_dependencies = q.expr;
- has_bun_framework_next = has_bun_framework_next or property.hasAnyPropertyNamed(&.{"bun-framework-next"});
- has_react = has_react or property.hasAnyPropertyNamed(&.{ "react", "react-dom", "react-relay", "@emotion/react" });
- has_bun_macro_relay = has_bun_macro_relay or property.hasAnyPropertyNamed(&.{"bun-macro-relay"});
- has_react_refresh = has_react_refresh or property.hasAnyPropertyNamed(&.{"react-refresh"});
+ // has_bun_framework_next = has_bun_framework_next or property.hasAnyPropertyNamed(&.{"bun-framework-next"});
+ // has_react = has_react or property.hasAnyPropertyNamed(&.{ "react", "react-dom", "react-relay", "@emotion/react" });
+ // has_bun_macro_relay = has_bun_macro_relay or property.hasAnyPropertyNamed(&.{"bun-macro-relay"});
+ // has_react_refresh = has_react_refresh or property.hasAnyPropertyNamed(&.{"react-refresh"});
}
}
}
@@ -832,101 +832,102 @@ pub const CreateCommand = struct {
const property = q.expr;
if (property.data == .e_object and property.data.e_object.properties.len > 0) {
- unsupported_packages.update(property);
+ // unsupported_packages.update(property);
- has_react_scripts = has_react_scripts or property.hasAnyPropertyNamed(&.{"react-scripts"});
- has_relay = has_relay or property.hasAnyPropertyNamed(&.{ "react-relay", "relay-runtime", "babel-plugin-relay" });
- property.data.e_object.properties = js_ast.G.Property.List.init(Prune.prune(property.data.e_object.properties.slice()));
+ // has_react_scripts = has_react_scripts or property.hasAnyPropertyNamed(&.{"react-scripts"});
+ // has_relay = has_relay or property.hasAnyPropertyNamed(&.{ "react-relay", "relay-runtime", "babel-plugin-relay" });
+ // property.data.e_object.properties = js_ast.G.Property.List.init(Prune.prune(property.data.e_object.properties.slice()));
+ property.data.e_object.properties = js_ast.G.Property.List.init(property.data.e_object.properties.slice());
if (property.data.e_object.properties.len > 0) {
has_dependencies = true;
dependencies = q.expr;
- if (property.asProperty("next")) |next_q| {
- is_nextjs = true;
- needs.bun_bun_for_nextjs = true;
+ // if (property.asProperty("next")) |next_q| {
+ // is_nextjs = true;
+ // needs.bun_bun_for_nextjs = true;
- next_q.expr.data.e_string.data = constStrToU8(target_nextjs_version);
- }
+ // next_q.expr.data.e_string.data = constStrToU8(target_nextjs_version);
+ // }
- has_bun_framework_next = has_bun_framework_next or property.hasAnyPropertyNamed(&.{"bun-framework-next"});
- has_react = has_react or is_nextjs or property.hasAnyPropertyNamed(&.{ "react", "react-dom", "react-relay", "@emotion/react" });
- has_react_refresh = has_react_refresh or property.hasAnyPropertyNamed(&.{"react-refresh"});
- has_bun_macro_relay = has_bun_macro_relay or property.hasAnyPropertyNamed(&.{"bun-macro-relay"});
+ // has_bun_framework_next = has_bun_framework_next or property.hasAnyPropertyNamed(&.{"bun-framework-next"});
+ // has_react = has_react or is_nextjs or property.hasAnyPropertyNamed(&.{ "react", "react-dom", "react-relay", "@emotion/react" });
+ // has_react_refresh = has_react_refresh or property.hasAnyPropertyNamed(&.{"react-refresh"});
+ // has_bun_macro_relay = has_bun_macro_relay or property.hasAnyPropertyNamed(&.{"bun-macro-relay"});
}
}
}
- needs.bun_macro_relay = !has_bun_macro_relay and has_relay;
- needs.react_refresh = !has_react_refresh and has_react;
- needs.bun_framework_next = is_nextjs and !has_bun_framework_next;
- needs.bun_bun_for_nextjs = is_nextjs;
- needs.bun_macro_relay_dependency = needs.bun_macro_relay;
- var bun_bun_for_react_scripts = false;
-
- var bun_macros_prop: ?js_ast.Expr = null;
- var bun_prop: ?js_ast.Expr = null;
- var bun_relay_prop: ?js_ast.Expr = null;
-
- var needs_bun_prop = needs.bun_macro_relay or has_bun_macro_relay;
- var needs_bun_macros_prop = needs_bun_prop;
-
- if (needs_bun_macros_prop) {
- if (package_json_expr.asProperty("bun")) |bun_| {
- needs_bun_prop = false;
- bun_prop = bun_.expr;
- if (bun_.expr.asProperty("macros")) |macros_q| {
- bun_macros_prop = macros_q.expr;
- needs_bun_macros_prop = false;
- if (macros_q.expr.asProperty("react-relay")) |react_relay_q| {
- bun_relay_prop = react_relay_q.expr;
- needs.bun_macro_relay = react_relay_q.expr.asProperty("graphql") == null;
- }
-
- if (macros_q.expr.asProperty("babel-plugin-relay/macro")) |react_relay_q| {
- bun_relay_prop = react_relay_q.expr;
- needs.bun_macro_relay = react_relay_q.expr.asProperty("graphql") == null;
- }
- }
- }
- }
+ // needs.bun_macro_relay = !has_bun_macro_relay and has_relay;
+ // needs.react_refresh = !has_react_refresh and has_react;
+ // needs.bun_framework_next = is_nextjs and !has_bun_framework_next;
+ // needs.bun_bun_for_nextjs = is_nextjs;
+ // needs.bun_macro_relay_dependency = needs.bun_macro_relay;
+ // var bun_bun_for_react_scripts = false;
+
+ // var bun_macros_prop: ?js_ast.Expr = null;
+ // var bun_prop: ?js_ast.Expr = null;
+ // var bun_relay_prop: ?js_ast.Expr = null;
+
+ // var needs_bun_prop = needs.bun_macro_relay or has_bun_macro_relay;
+ // var needs_bun_macros_prop = needs_bun_prop;
+
+ // if (needs_bun_macros_prop) {
+ // if (package_json_expr.asProperty("bun")) |bun_| {
+ // needs_bun_prop = false;
+ // bun_prop = bun_.expr;
+ // if (bun_.expr.asProperty("macros")) |macros_q| {
+ // bun_macros_prop = macros_q.expr;
+ // needs_bun_macros_prop = false;
+ // if (macros_q.expr.asProperty("react-relay")) |react_relay_q| {
+ // bun_relay_prop = react_relay_q.expr;
+ // needs.bun_macro_relay = react_relay_q.expr.asProperty("graphql") == null;
+ // }
+
+ // if (macros_q.expr.asProperty("babel-plugin-relay/macro")) |react_relay_q| {
+ // bun_relay_prop = react_relay_q.expr;
+ // needs.bun_macro_relay = react_relay_q.expr.asProperty("graphql") == null;
+ // }
+ // }
+ // }
+ // }
- if (Prune.prune_count > 0) {
- Output.prettyErrorln("<r><d>[package.json] Pruned {d} unnecessary packages<r>", .{Prune.prune_count});
- }
+ // if (Prune.prune_count > 0) {
+ // Output.prettyErrorln("<r><d>[package.json] Pruned {d} unnecessary packages<r>", .{Prune.prune_count});
+ // }
// if (create_options.verbose) {
- if (needs.bun_macro_relay) {
- Output.prettyErrorln("<r><d>[package.json] Detected Relay -> added \"bun-macro-relay\"<r>", .{});
- }
+ // if (needs.bun_macro_relay) {
+ // Output.prettyErrorln("<r><d>[package.json] Detected Relay -> added \"bun-macro-relay\"<r>", .{});
+ // }
- if (needs.react_refresh) {
- Output.prettyErrorln("<r><d>[package.json] Detected React -> added \"react-refresh\"<r>", .{});
- }
+ // if (needs.react_refresh) {
+ // Output.prettyErrorln("<r><d>[package.json] Detected React -> added \"react-refresh\"<r>", .{});
+ // }
- if (needs.bun_framework_next) {
- Output.prettyErrorln("<r><d>[package.json] Detected Next -> added \"bun-framework-next\"<r>", .{});
- } else if (is_nextjs) {
- Output.prettyErrorln("<r><d>[package.json] Detected Next.js<r>", .{});
- }
+ // if (needs.bun_framework_next) {
+ // Output.prettyErrorln("<r><d>[package.json] Detected Next -> added \"bun-framework-next\"<r>", .{});
+ // } else if (is_nextjs) {
+ // Output.prettyErrorln("<r><d>[package.json] Detected Next.js<r>", .{});
+ // }
// }
- var needs_to_inject_dev_dependency = needs.react_refresh or needs.bun_macro_relay;
- var needs_to_inject_dependency = needs.bun_framework_next;
+ // var needs_to_inject_dev_dependency = needs.react_refresh or needs.bun_macro_relay;
+ // var needs_to_inject_dependency = needs.bun_framework_next;
- const dependencies_to_inject_count = @as(usize, @intCast(@intFromBool(needs.bun_framework_next)));
+ // const dependencies_to_inject_count = @as(usize, @intCast(@intFromBool(needs.bun_framework_next)));
- const dev_dependencies_to_inject_count = @as(usize, @intCast(@intFromBool(needs.react_refresh))) +
- @as(usize, @intCast(@intFromBool(needs.bun_macro_relay)));
+ // const dev_dependencies_to_inject_count = @as(usize, @intCast(@intFromBool(needs.react_refresh))) +
+ // @as(usize, @intCast(@intFromBool(needs.bun_macro_relay)));
- const new_properties_count = @as(usize, @intCast(@intFromBool(needs_to_inject_dev_dependency and dev_dependencies == null))) +
- @as(usize, @intCast(@intFromBool(needs_to_inject_dependency and dependencies == null))) +
- @as(usize, @intCast(@intFromBool(needs_bun_prop)));
+ // const new_properties_count = @as(usize, @intCast(@intFromBool(needs_to_inject_dev_dependency and dev_dependencies == null))) +
+ // @as(usize, @intCast(@intFromBool(needs_to_inject_dependency and dependencies == null))) +
+ // @as(usize, @intCast(@intFromBool(needs_bun_prop)));
- if (new_properties_count != 0) {
- try properties_list.ensureUnusedCapacity(new_properties_count);
- }
+ // if (new_properties_count != 0) {
+ // try properties_list.ensureUnusedCapacity(new_properties_count);
+ // }
const E = js_ast.E;
@@ -1126,31 +1127,31 @@ pub const CreateCommand = struct {
InjectionPrefill.bun_macros_relay_object.properties = js_ast.G.Property.List.init(&InjectionPrefill.bun_macros_relay_object_properties);
InjectionPrefill.bun_macros_relay_only_object.properties = js_ast.G.Property.List.init(&InjectionPrefill.bun_macros_relay_only_object_properties);
- if (needs_to_inject_dev_dependency and dev_dependencies == null) {
- var e_object = try ctx.allocator.create(E.Object);
+ // if (needs_to_inject_dev_dependency and dev_dependencies == null) {
+ // var e_object = try ctx.allocator.create(E.Object);
- e_object.* = E.Object{};
+ // e_object.* = E.Object{};
- const value = js_ast.Expr{ .data = .{ .e_object = e_object }, .loc = logger.Loc.Empty };
- properties_list.appendAssumeCapacity(js_ast.G.Property{
- .key = InjectionPrefill.dev_dependencies_key,
- .value = value,
- });
- dev_dependencies = value;
- }
+ // const value = js_ast.Expr{ .data = .{ .e_object = e_object }, .loc = logger.Loc.Empty };
+ // properties_list.appendAssumeCapacity(js_ast.G.Property{
+ // .key = InjectionPrefill.dev_dependencies_key,
+ // .value = value,
+ // });
+ // dev_dependencies = value;
+ // }
- if (needs_to_inject_dependency and dependencies == null) {
- var e_object = try ctx.allocator.create(E.Object);
+ // if (needs_to_inject_dependency and dependencies == null) {
+ // var e_object = try ctx.allocator.create(E.Object);
- e_object.* = E.Object{};
+ // e_object.* = E.Object{};
- const value = js_ast.Expr{ .data = .{ .e_object = e_object }, .loc = logger.Loc.Empty };
- properties_list.appendAssumeCapacity(js_ast.G.Property{
- .key = InjectionPrefill.dependencies_key,
- .value = value,
- });
- dependencies = value;
- }
+ // const value = js_ast.Expr{ .data = .{ .e_object = e_object }, .loc = logger.Loc.Empty };
+ // properties_list.appendAssumeCapacity(js_ast.G.Property{
+ // .key = InjectionPrefill.dependencies_key,
+ // .value = value,
+ // });
+ // dependencies = value;
+ // }
// inject an object like this, handling each permutation of what may or may not exist:
// {
@@ -1162,80 +1163,80 @@ pub const CreateCommand = struct {
// }
// }
// }
- bun_section: {
-
- // "bun.macros.react-relay.graphql"
- if (needs.bun_macro_relay and !needs_bun_prop and !needs_bun_macros_prop) {
- // "graphql" is the only valid one for now, so anything else in this object is invalid.
- bun_relay_prop.?.data.e_object = InjectionPrefill.bun_macros_relay_object.properties.ptr[0].value.?.data.e_object;
- needs_bun_macros_prop = false;
- needs_bun_prop = false;
- needs.bun_macro_relay = false;
- break :bun_section;
- }
-
- // "bun.macros"
- if (needs_bun_macros_prop and !needs_bun_prop) {
- var obj = bun_prop.?.data.e_object;
- var properties = try std.ArrayList(js_ast.G.Property).initCapacity(
- ctx.allocator,
- obj.properties.len + InjectionPrefill.bun_macros_relay_object.properties.len,
- );
- defer obj.properties.update(properties);
-
- try properties.insertSlice(0, obj.properties.slice());
- try properties.insertSlice(0, InjectionPrefill.bun_macros_relay_object.properties.slice());
-
- needs_bun_macros_prop = false;
- needs_bun_prop = false;
- needs.bun_macro_relay = false;
- break :bun_section;
- }
+ // bun_section: {
+
+ // "bun.macros.react-relay.graphql"
+ // if (needs.bun_macro_relay and !needs_bun_prop and !needs_bun_macros_prop) {
+ // // "graphql" is the only valid one for now, so anything else in this object is invalid.
+ // bun_relay_prop.?.data.e_object = InjectionPrefill.bun_macros_relay_object.properties.ptr[0].value.?.data.e_object;
+ // needs_bun_macros_prop = false;
+ // needs_bun_prop = false;
+ // needs.bun_macro_relay = false;
+ // break :bun_section;
+ // }
- // "bun"
- if (needs_bun_prop) {
- try properties_list.append(InjectionPrefill.bun_only_macros_relay_property);
- needs_bun_macros_prop = false;
- needs_bun_prop = false;
- needs.bun_macro_relay = false;
- break :bun_section;
- }
- }
+ // "bun.macros"
+ // if (needs_bun_macros_prop and !needs_bun_prop) {
+ // var obj = bun_prop.?.data.e_object;
+ // var properties = try std.ArrayList(js_ast.G.Property).initCapacity(
+ // ctx.allocator,
+ // obj.properties.len + InjectionPrefill.bun_macros_relay_object.properties.len,
+ // );
+ // defer obj.properties.update(properties);
+
+ // try properties.insertSlice(0, obj.properties.slice());
+ // try properties.insertSlice(0, InjectionPrefill.bun_macros_relay_object.properties.slice());
+
+ // needs_bun_macros_prop = false;
+ // needs_bun_prop = false;
+ // needs.bun_macro_relay = false;
+ // break :bun_section;
+ // }
- if (needs_to_inject_dependency) {
- defer needs_to_inject_dependency = false;
- var obj = dependencies.?.data.e_object;
- var properties = try std.ArrayList(js_ast.G.Property).initCapacity(
- ctx.allocator,
- obj.properties.len + dependencies_to_inject_count,
- );
- try properties.insertSlice(0, obj.properties.slice());
- defer obj.properties.update(properties);
- if (needs.bun_framework_next) {
- properties.appendAssumeCapacity(InjectionPrefill.bun_framework_next_property);
- needs.bun_framework_next = false;
- }
- }
+ // "bun"
+ // if (needs_bun_prop) {
+ // try properties_list.append(InjectionPrefill.bun_only_macros_relay_property);
+ // needs_bun_macros_prop = false;
+ // needs_bun_prop = false;
+ // needs.bun_macro_relay = false;
+ // break :bun_section;
+ // }
+ // }
- if (needs_to_inject_dev_dependency) {
- defer needs_to_inject_dev_dependency = false;
- var obj = dev_dependencies.?.data.e_object;
- var properties = try std.ArrayList(js_ast.G.Property).initCapacity(
- ctx.allocator,
- obj.properties.len + dev_dependencies_to_inject_count,
- );
- try properties.insertSlice(0, obj.properties.slice());
- defer obj.properties.update(properties);
- if (needs.bun_macro_relay_dependency) {
- properties.appendAssumeCapacity(InjectionPrefill.bun_macro_relay_dependency);
- needs.bun_macro_relay_dependency = false;
- }
+ // if (needs_to_inject_dependency) {
+ // defer needs_to_inject_dependency = false;
+ // var obj = dependencies.?.data.e_object;
+ // var properties = try std.ArrayList(js_ast.G.Property).initCapacity(
+ // ctx.allocator,
+ // obj.properties.len + dependencies_to_inject_count,
+ // );
+ // try properties.insertSlice(0, obj.properties.slice());
+ // defer obj.properties.update(properties);
+ // if (needs.bun_framework_next) {
+ // properties.appendAssumeCapacity(InjectionPrefill.bun_framework_next_property);
+ // needs.bun_framework_next = false;
+ // }
+ // }
- if (needs.react_refresh) {
- properties.appendAssumeCapacity(InjectionPrefill.react_refresh_dependency);
- needs.react_refresh = false;
- }
- }
+ // if (needs_to_inject_dev_dependency) {
+ // defer needs_to_inject_dev_dependency = false;
+ // var obj = dev_dependencies.?.data.e_object;
+ // var properties = try std.ArrayList(js_ast.G.Property).initCapacity(
+ // ctx.allocator,
+ // obj.properties.len + dev_dependencies_to_inject_count,
+ // );
+ // try properties.insertSlice(0, obj.properties.slice());
+ // defer obj.properties.update(properties);
+ // if (needs.bun_macro_relay_dependency) {
+ // properties.appendAssumeCapacity(InjectionPrefill.bun_macro_relay_dependency);
+ // needs.bun_macro_relay_dependency = false;
+ // }
+
+ // if (needs.react_refresh) {
+ // properties.appendAssumeCapacity(InjectionPrefill.react_refresh_dependency);
+ // needs.react_refresh = false;
+ // }
+ // }
// this is a little dicey
// The idea is:
@@ -1248,89 +1249,89 @@ pub const CreateCommand = struct {
// 3. has a src/index.{jsx,tsx,ts,mts,mcjs}
// If at any point those expectations are not matched OR the string /src/index.js already exists in the HTML
// don't do it!
- if (has_react_scripts) {
- bail: {
- var public_index_html_parts = [_]string{ destination, "public/index.html" };
- var public_index_html_path = filesystem.absBuf(&public_index_html_parts, &bun_path_buf);
-
- const public_index_html_file = std.fs.openFileAbsolute(public_index_html_path, .{ .mode = .read_write }) catch break :bail;
- defer public_index_html_file.close();
-
- const file_extensions_to_try = [_]string{ ".tsx", ".ts", ".jsx", ".js", ".mts", ".mcjs" };
-
- var found_file = false;
- var entry_point_path: string = "";
- var entry_point_file_parts = [_]string{ destination, "src/index" };
- var entry_point_file_path_base = filesystem.absBuf(&entry_point_file_parts, &bun_path_buf);
-
- for (file_extensions_to_try) |ext| {
- bun.copy(u8, bun_path_buf[entry_point_file_path_base.len..], ext);
- entry_point_path = bun_path_buf[0 .. entry_point_file_path_base.len + ext.len];
- std.fs.accessAbsolute(entry_point_path, .{}) catch continue;
- found_file = true;
- break;
- }
- if (!found_file) break :bail;
-
- var public_index_file_contents = public_index_html_file.readToEndAlloc(ctx.allocator, public_index_html_file.getEndPos() catch break :bail) catch break :bail;
-
- if (std.mem.indexOf(u8, public_index_file_contents, entry_point_path[destination.len..]) != null) {
- break :bail;
- }
-
- var body_closing_tag: usize = std.mem.lastIndexOf(u8, public_index_file_contents, "</body>") orelse break :bail;
-
- var public_index_file_out = std.ArrayList(u8).initCapacity(ctx.allocator, public_index_file_contents.len) catch break :bail;
- var html_writer = public_index_file_out.writer();
-
- _ = html_writer.writeAll(public_index_file_contents[0..body_closing_tag]) catch break :bail;
-
- create_react_app_entry_point_path = std.fmt.allocPrint(
- ctx.allocator,
- "./{s}",
-
- .{
- std.mem.trimLeft(
- u8,
- entry_point_path[destination.len..],
- "/",
- ),
- },
- ) catch break :bail;
-
- html_writer.print(
- "<script type=\"module\" async src=\"/{s}\"></script>\n{s}",
- .{
- create_react_app_entry_point_path[2..],
- public_index_file_contents[body_closing_tag..],
- },
- ) catch break :bail;
-
- var outfile = std.mem.replaceOwned(u8, ctx.allocator, public_index_file_out.items, "%PUBLIC_URL%", "") catch break :bail;
-
- // don't do this actually
- // it completely breaks when there is more than one CSS file loaded
- // // bonus: check for an index.css file
- // // inject it into the .html file statically if the file exists but isn't already in
- // inject_css: {
- // const head_i: usize = std.mem.indexOf(u8, outfile, "<head>") orelse break :inject_css;
- // if (std.mem.indexOf(u8, outfile, "/src/index.css") != null) break :inject_css;
-
- // bun.copy(u8, bun_path_buf[destination.len + "/src/index".len ..], ".css");
- // var index_css_file_path = bun_path_buf[0 .. destination.len + "/src/index.css".len];
- // std.fs.accessAbsolute(index_css_file_path, .{}) catch break :inject_css;
- // var list = std.ArrayList(u8).fromOwnedSlice(ctx.allocator, outfile);
- // list.insertSlice(head_i + "<head>".len, "<link rel=\"stylesheet\" href=\"/src/index.css\">\n") catch break :inject_css;
- // outfile =try list.toOwnedSlice();
- // }
-
- public_index_html_file.pwriteAll(outfile, 0) catch break :bail;
- std.os.ftruncate(public_index_html_file.handle, outfile.len + 1) catch break :bail;
- bun_bun_for_react_scripts = true;
- is_create_react_app = true;
- Output.prettyln("<r><d>[package.json] Added entry point {s} to public/index.html", .{create_react_app_entry_point_path});
- }
- }
+ // if (has_react_scripts) {
+ // bail: {
+ // var public_index_html_parts = [_]string{ destination, "public/index.html" };
+ // var public_index_html_path = filesystem.absBuf(&public_index_html_parts, &bun_path_buf);
+
+ // const public_index_html_file = std.fs.openFileAbsolute(public_index_html_path, .{ .mode = .read_write }) catch break :bail;
+ // defer public_index_html_file.close();
+
+ // const file_extensions_to_try = [_]string{ ".tsx", ".ts", ".jsx", ".js", ".mts", ".mcjs" };
+
+ // var found_file = false;
+ // var entry_point_path: string = "";
+ // var entry_point_file_parts = [_]string{ destination, "src/index" };
+ // var entry_point_file_path_base = filesystem.absBuf(&entry_point_file_parts, &bun_path_buf);
+
+ // for (file_extensions_to_try) |ext| {
+ // bun.copy(u8, bun_path_buf[entry_point_file_path_base.len..], ext);
+ // entry_point_path = bun_path_buf[0 .. entry_point_file_path_base.len + ext.len];
+ // std.fs.accessAbsolute(entry_point_path, .{}) catch continue;
+ // found_file = true;
+ // break;
+ // }
+ // if (!found_file) break :bail;
+
+ // var public_index_file_contents = public_index_html_file.readToEndAlloc(ctx.allocator, public_index_html_file.getEndPos() catch break :bail) catch break :bail;
+
+ // if (std.mem.indexOf(u8, public_index_file_contents, entry_point_path[destination.len..]) != null) {
+ // break :bail;
+ // }
+
+ // var body_closing_tag: usize = std.mem.lastIndexOf(u8, public_index_file_contents, "</body>") orelse break :bail;
+
+ // var public_index_file_out = std.ArrayList(u8).initCapacity(ctx.allocator, public_index_file_contents.len) catch break :bail;
+ // var html_writer = public_index_file_out.writer();
+
+ // _ = html_writer.writeAll(public_index_file_contents[0..body_closing_tag]) catch break :bail;
+
+ // create_react_app_entry_point_path = std.fmt.allocPrint(
+ // ctx.allocator,
+ // "./{s}",
+
+ // .{
+ // std.mem.trimLeft(
+ // u8,
+ // entry_point_path[destination.len..],
+ // "/",
+ // ),
+ // },
+ // ) catch break :bail;
+
+ // html_writer.print(
+ // "<script type=\"module\" async src=\"/{s}\"></script>\n{s}",
+ // .{
+ // create_react_app_entry_point_path[2..],
+ // public_index_file_contents[body_closing_tag..],
+ // },
+ // ) catch break :bail;
+
+ // var outfile = std.mem.replaceOwned(u8, ctx.allocator, public_index_file_out.items, "%PUBLIC_URL%", "") catch break :bail;
+
+ // // don't do this actually
+ // // it completely breaks when there is more than one CSS file loaded
+ // // // bonus: check for an index.css file
+ // // // inject it into the .html file statically if the file exists but isn't already in
+ // // inject_css: {
+ // // const head_i: usize = std.mem.indexOf(u8, outfile, "<head>") orelse break :inject_css;
+ // // if (std.mem.indexOf(u8, outfile, "/src/index.css") != null) break :inject_css;
+
+ // // bun.copy(u8, bun_path_buf[destination.len + "/src/index".len ..], ".css");
+ // // var index_css_file_path = bun_path_buf[0 .. destination.len + "/src/index.css".len];
+ // // std.fs.accessAbsolute(index_css_file_path, .{}) catch break :inject_css;
+ // // var list = std.ArrayList(u8).fromOwnedSlice(ctx.allocator, outfile);
+ // // list.insertSlice(head_i + "<head>".len, "<link rel=\"stylesheet\" href=\"/src/index.css\">\n") catch break :inject_css;
+ // // outfile =try list.toOwnedSlice();
+ // // }
+
+ // public_index_html_file.pwriteAll(outfile, 0) catch break :bail;
+ // std.os.ftruncate(public_index_html_file.handle, outfile.len + 1) catch break :bail;
+ // bun_bun_for_react_scripts = true;
+ // is_create_react_app = true;
+ // Output.prettyln("<r><d>[package.json] Added entry point {s} to public/index.html", .{create_react_app_entry_point_path});
+ // }
+ // }
package_json_expr.data.e_object.is_single_line = false;
@@ -1396,20 +1397,20 @@ pub const CreateCommand = struct {
const items = tasks.slice();
for (items) |task| {
if (task.asString(ctx.allocator)) |task_entry| {
- if (needs.bun_bun_for_nextjs or bun_bun_for_react_scripts) {
- var iter = std.mem.split(u8, task_entry, " ");
- var last_was_bun = false;
- while (iter.next()) |current| {
- if (strings.eqlComptime(current, "bun")) {
- if (last_was_bun) {
- needs.bun_bun_for_nextjs = false;
- bun_bun_for_react_scripts = false;
- break;
- }
- last_was_bun = true;
- }
- }
- }
+ // if (needs.bun_bun_for_nextjs or bun_bun_for_react_scripts) {
+ // var iter = std.mem.split(u8, task_entry, " ");
+ // var last_was_bun = false;
+ // while (iter.next()) |current| {
+ // if (strings.eqlComptime(current, "bun")) {
+ // if (last_was_bun) {
+ // needs.bun_bun_for_nextjs = false;
+ // bun_bun_for_react_scripts = false;
+ // break;
+ // }
+ // last_was_bun = true;
+ // }
+ // }
+ // }
try postinstall_tasks.append(
ctx.allocator,
@@ -1465,13 +1466,13 @@ pub const CreateCommand = struct {
std.os.ftruncate(package_json_file.?.handle, written + 1) catch {};
- if (!create_options.skip_install) {
- if (needs.bun_bun_for_nextjs) {
- try postinstall_tasks.append(ctx.allocator, InjectionPrefill.bun_bun_for_nextjs_task);
- } else if (bun_bun_for_react_scripts) {
- try postinstall_tasks.append(ctx.allocator, try std.fmt.allocPrint(ctx.allocator, "bun bun {s}", .{create_react_app_entry_point_path}));
- }
- }
+ // if (!create_options.skip_install) {
+ // if (needs.bun_bun_for_nextjs) {
+ // try postinstall_tasks.append(ctx.allocator, InjectionPrefill.bun_bun_for_nextjs_task);
+ // } else if (bun_bun_for_react_scripts) {
+ // try postinstall_tasks.append(ctx.allocator, try std.fmt.allocPrint(ctx.allocator, "bun bun {s}", .{create_react_app_entry_point_path}));
+ // }
+ // }
}
}
@@ -1573,12 +1574,12 @@ pub const CreateCommand = struct {
Output.flush();
}
- if (unsupported_packages.@"styled-jsx") {
- Output.prettyErrorln("\n", .{});
- unsupported_packages.print();
- Output.prettyErrorln("\n", .{});
- Output.flush();
- }
+ // if (unsupported_packages.@"styled-jsx") {
+ // Output.prettyErrorln("\n", .{});
+ // unsupported_packages.print();
+ // Output.prettyErrorln("\n", .{});
+ // Output.flush();
+ // }
if (!create_options.skip_git and !create_options.skip_install) {
Output.pretty(
diff --git a/src/cli/gitignore-for-init b/src/cli/gitignore-for-init
index 3d75225a1..ab5afb295 100644
--- a/src/cli/gitignore-for-init
+++ b/src/cli/gitignore-for-init
@@ -170,3 +170,7 @@ dist
# IntelliJ based IDEs
.idea
+
+# Finder (MacOS) folder config
+.DS_Store
+
diff --git a/src/cli/package_manager_command.zig b/src/cli/package_manager_command.zig
index a70dec020..00326bc97 100644
--- a/src/cli/package_manager_command.zig
+++ b/src/cli/package_manager_command.zig
@@ -162,7 +162,7 @@ pub const PackageManagerCommand = struct {
Global.crash();
};
- if (pm.options.positionals.len > 0 and strings.eqlComptime(pm.options.positionals[0], "rm")) {
+ if (pm.options.positionals.len > 1 and strings.eqlComptime(pm.options.positionals[1], "rm")) {
std.fs.deleteTreeAbsolute(outpath) catch |err| {
Output.prettyErrorln("{s} deleting cache directory", .{@errorName(err)});
Global.crash();
@@ -244,6 +244,32 @@ pub const PackageManagerCommand = struct {
}
Global.exit(0);
+ } else if (strings.eqlComptime(subcommand, "migrate")) {
+ if (!pm.options.enable.force_save_lockfile) try_load_bun: {
+ std.fs.cwd().accessZ("bun.lockb", .{ .mode = .read_only }) catch break :try_load_bun;
+
+ Output.prettyErrorln(
+ \\<r><red>error<r>: bun.lockb already exists
+ \\run with --force to overwrite
+ , .{});
+ Global.exit(1);
+ }
+ const load_lockfile = @import("../install/migration.zig").detectAndLoadOtherLockfile(
+ pm.lockfile,
+ ctx.allocator,
+ pm.log,
+ pm.options.lockfile_path,
+ );
+ if (load_lockfile == .not_found) {
+ Output.prettyErrorln(
+ \\<r><red>error<r>: could not find any other lockfile
+ , .{});
+ Global.exit(1);
+ }
+ handleLoadLockfileErrors(load_lockfile, pm);
+ const lockfile = load_lockfile.ok;
+ lockfile.saveToDisk(pm.options.lockfile_path);
+ Global.exit(0);
}
Output.prettyln(
@@ -258,6 +284,7 @@ pub const PackageManagerCommand = struct {
\\ bun pm <b>hash-print<r> print the hash stored in the current lockfile
\\ bun pm <b>cache<r> print the path to the cache folder
\\ bun pm <b>cache rm<r> clear the cache
+ \\ bun pm <b>migrate<r> migrate another package manager's lockfile without installing anything
\\
\\Learn more about these at <magenta>https://bun.sh/docs/install/utilities<r>
\\
diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig
index f5240246c..cf1e4dc99 100644
--- a/src/cli/run_command.zig
+++ b/src/cli/run_command.zig
@@ -618,7 +618,10 @@ pub const RunCommand = struct {
child_process.stdout_behavior = .Inherit;
const result = child_process.spawnAndWait() catch |err| {
- Output.prettyErrorln("<r><red>error<r>: Failed to run script <b>{s}<r> due to error <b>{s}<r>", .{ name, @errorName(err) });
+ if (!silent) {
+ Output.prettyErrorln("<r><red>error<r>: Failed to run script <b>{s}<r> due to error <b>{s}<r>", .{ name, @errorName(err) });
+ }
+
Output.flush();
return true;
};
@@ -626,7 +629,7 @@ pub const RunCommand = struct {
switch (result) {
.Exited => |code| {
if (code > 0) {
- if (code != 2) {
+ if (code != 2 and !silent) {
Output.prettyErrorln("<r><red>error<r><d>:<r> script <b>\"{s}\"<r> exited with {any}<r>", .{ name, bun.SignalCode.from(code) });
Output.flush();
}
@@ -635,14 +638,18 @@ pub const RunCommand = struct {
}
},
.Signal => |signal| {
- Output.prettyErrorln("<r><red>error<r><d>:<r> script <b>\"{s}\"<r> exited with {any}<r>", .{ name, bun.SignalCode.from(signal) });
- Output.flush();
+ if (!silent) {
+ Output.prettyErrorln("<r><red>error<r><d>:<r> script <b>\"{s}\"<r> exited with {any}<r>", .{ name, bun.SignalCode.from(signal) });
+ Output.flush();
+ }
Global.exit(1);
},
.Stopped => |signal| {
- Output.prettyErrorln("<r><red>error<r><d>:<r> script <b>\"{s}\"<r> was stopped by signal {any}<r>", .{ name, bun.SignalCode.from(signal) });
- Output.flush();
+ if (!silent) {
+ Output.prettyErrorln("<r><red>error<r><d>:<r> script <b>\"{s}\"<r> was stopped by signal {any}<r>", .{ name, bun.SignalCode.from(signal) });
+ Output.flush();
+ }
Global.exit(1);
},
@@ -678,6 +685,7 @@ pub const RunCommand = struct {
child_process.stderr_behavior = .Inherit;
child_process.stdin_behavior = .Inherit;
child_process.stdout_behavior = .Inherit;
+ const silent = ctx.debug.silent;
const result = child_process.spawnAndWait() catch |err| {
if (err == error.AccessDenied) {
@@ -686,7 +694,8 @@ pub const RunCommand = struct {
const rc = bun.C.stat(executable[0.. :0].ptr, &stat);
if (rc == 0) {
if (std.os.S.ISDIR(stat.mode)) {
- Output.prettyErrorln("<r><red>error<r>: Failed to run directory \"<b>{s}<r>\"\n", .{executable});
+ if (!silent)
+ Output.prettyErrorln("<r><red>error<r>: Failed to run directory \"<b>{s}<r>\"\n", .{executable});
Global.exit(1);
}
}
@@ -698,24 +707,25 @@ pub const RunCommand = struct {
switch (result) {
.Exited => |sig| {
// 2 is SIGINT, which is CTRL + C so that's kind of annoying to show
- if (sig > 0 and sig != 2)
+ if (sig > 0 and sig != 2 and !silent)
Output.prettyErrorln("<r><red>error<r><d>:<r> \"<b>{s}<r>\" exited with <b>{any}<r>", .{ std.fs.path.basename(executable), bun.SignalCode.from(sig) });
Global.exit(sig);
},
.Signal => |sig| {
// 2 is SIGINT, which is CTRL + C so that's kind of annoying to show
- if (sig > 0 and sig != 2) {
+ if (sig > 0 and sig != 2 and !silent) {
Output.prettyErrorln("<r><red>error<r><d>:<r> \"<b>{s}<r>\" exited with <b>{any}<r>", .{ std.fs.path.basename(executable), bun.SignalCode.from(sig) });
}
Global.exit(std.mem.asBytes(&sig)[0]);
},
.Stopped => |sig| {
- if (sig > 0)
+ if (sig > 0 and !silent)
Output.prettyErrorln("<r><red>error<r> \"<b>{s}<r>\" stopped with {any}<r>", .{ std.fs.path.basename(executable), bun.SignalCode.from(sig) });
Global.exit(std.mem.asBytes(&sig)[0]);
},
.Unknown => |sig| {
- Output.prettyErrorln("<r><red>error<r> \"<b>{s}<r>\" stopped: {d}<r>", .{ std.fs.path.basename(executable), sig });
+ if (!silent)
+ Output.prettyErrorln("<r><red>error<r> \"<b>{s}<r>\" stopped: {d}<r>", .{ std.fs.path.basename(executable), sig });
Global.exit(1);
},
}
@@ -965,7 +975,7 @@ pub const RunCommand = struct {
// the use of npm/? is copying yarn
// e.g.
// > "yarn/1.22.4 npm/? node/v12.16.3 darwin x64",
- "bun/" ++ Global.package_json_version ++ " npm/? node/v18.15.0 " ++ Global.os_name ++ " " ++ Global.arch_name,
+ "bun/" ++ Global.package_json_version ++ " npm/? node/v20.8.0 " ++ Global.os_name ++ " " ++ Global.arch_name,
) catch unreachable;
if (this_bundler.env.get("npm_execpath") == null) {
@@ -1292,14 +1302,14 @@ pub const RunCommand = struct {
// "White space after #! is optional."
var shebang_buf: [64]u8 = undefined;
const shebang_size = file.pread(&shebang_buf, 0) catch |err| {
- Output.prettyErrorln("<r><red>error<r>: Failed to read file <b>{s}<r> due to error <b>{s}<r>", .{ file_path, @errorName(err) });
+ if (!ctx.debug.silent)
+ Output.prettyErrorln("<r><red>error<r>: Failed to read file <b>{s}<r> due to error <b>{s}<r>", .{ file_path, @errorName(err) });
Global.exit(1);
};
var shebang: string = shebang_buf[0..shebang_size];
shebang = std.mem.trim(u8, shebang, " \r\n\t");
- if (shebang.len == 0) break :possibly_open_with_bun_js;
if (strings.hasPrefixComptime(shebang, "#!")) {
const first_arg: string = if (bun.argv().len > 0) bun.span(bun.argv()[0]) else "";
const filename = std.fs.path.basename(first_arg);
@@ -1487,6 +1497,10 @@ pub const RunCommand = struct {
}
}
+ if (ctx.runtime_options.if_present) {
+ return true;
+ }
+
if (comptime log_errors) {
Output.prettyError("<r><red>error<r><d>:<r> missing script \"<b>{s}<r>\"\n", .{script_name_to_search});
Global.exit(1);
diff --git a/src/cli/test_command.zig b/src/cli/test_command.zig
index 75ac87e5d..141d7ff25 100644
--- a/src/cli/test_command.zig
+++ b/src/cli/test_command.zig
@@ -669,7 +669,7 @@ pub const TestCommand = struct {
.dirs_to_scan = Scanner.Fifo.init(ctx.allocator),
.options = &vm.bundler.options,
.fs = vm.bundler.fs,
- .filter_names = ctx.positionals[1..],
+ .filter_names = if (ctx.positionals.len == 0) &[0][]const u8{} else ctx.positionals[1..],
.results = std.ArrayList(PathString).init(ctx.allocator),
};
const dir_to_scan = brk: {
@@ -685,8 +685,13 @@ pub const TestCommand = struct {
const test_files = try scanner.results.toOwnedSlice();
if (test_files.len > 0) {
vm.hot_reload = ctx.debug.hot_reload;
- if (vm.hot_reload != .none)
- JSC.HotReloader.enableHotModuleReloading(vm);
+
+ switch (vm.hot_reload) {
+ .hot => JSC.HotReloader.enableHotModuleReloading(vm),
+ .watch => JSC.WatchReloader.enableHotModuleReloading(vm),
+ else => {},
+ }
+
// vm.bundler.fs.fs.readDirectory(_dir: string, _handle: ?std.fs.Dir)
runAllTests(reporter, vm, test_files, ctx.allocator);
}
diff --git a/src/cli/tsconfig-for-init.json b/src/cli/tsconfig-for-init.json
index 1449bc3d9..7556e1d4b 100644
--- a/src/cli/tsconfig-for-init.json
+++ b/src/cli/tsconfig-for-init.json
@@ -11,7 +11,7 @@
"strict": true,
"downlevelIteration": true,
"skipLibCheck": true,
- "jsx": "preserve",
+ "jsx": "react-jsx",
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"allowJs": true,
diff --git a/src/cli/upgrade_command.zig b/src/cli/upgrade_command.zig
index 60ae953d3..d865d990d 100644
--- a/src/cli/upgrade_command.zig
+++ b/src/cli/upgrade_command.zig
@@ -83,7 +83,9 @@ pub const Version = struct {
pub const triplet = platform_label ++ "-" ++ arch_label;
const suffix = if (Environment.baseline) "-baseline" else "";
pub const folder_name = "bun-" ++ triplet ++ suffix;
+ pub const baseline_folder_name = "bun-" ++ triplet ++ "-baseline";
pub const zip_filename = folder_name ++ ".zip";
+ pub const baseline_zip_filename = baseline_folder_name ++ ".zip";
pub const profile_folder_name = "bun-" ++ triplet ++ suffix ++ "-profile";
pub const profile_zip_filename = profile_folder_name ++ ".zip";
@@ -95,6 +97,11 @@ pub const Version = struct {
zip_filename,
});
+ pub const Bun__githubBaselineURL: [:0]const u8 = std.fmt.comptimePrint("https://github.com/oven-sh/bun/release/bun-v{s}/{s}", .{
+ Global.package_json_version,
+ baseline_zip_filename,
+ });
+
pub fn isCurrent(this: Version) bool {
return strings.eqlComptime(this.tag, current_version);
}
diff --git a/src/darwin_c.zig b/src/darwin_c.zig
index 1e494db47..3d3b28f3f 100644
--- a/src/darwin_c.zig
+++ b/src/darwin_c.zig
@@ -728,29 +728,6 @@ const IO_CTL_RELATED = struct {
pub usingnamespace IO_CTL_RELATED;
-pub const RemoveFileFlags = struct {
- /// If path is a directory, recurse (depth first traversal)
- pub const recursive: u32 = (1 << 0);
- /// Remove contents but not directory itself
- pub const keep_parent: u32 = (1 << 1);
- /// 7 pass DoD algorithm
- pub const secure_7_pass: u32 = (1 << 2);
- /// 35-pass Gutmann algorithm (overrides REMOVEFILE_SECURE_7_PASS)
- pub const secure_35_pass: u32 = (1 << 3);
- /// 1 pass single overwrite),
- pub const secure_1_pass: u32 = (1 << 4);
- /// 3 pass overwrite
- pub const secure_3_pass: u32 = (1 << 5);
- /// Single-pass overwrite, with 0 instead of random data
- pub const secure_1_pass_zero: u32 = (1 << 6);
- /// Cross mountpoints when deleting recursively. << 6),
- pub const cross_mount: u32 = (1 << 7);
- /// Paths may be longer than PATH_MAX - requires temporarily changing cwd
- pub const allow_long_paths: u32 = (1 << 8);
-};
-pub const removefile_state_t = opaque {};
-pub extern fn removefileat(fd: c_int, path: [*c]const u8, state: ?*removefile_state_t, flags: u32) c_int;
-
// As of Zig v0.11.0-dev.1393+38eebf3c4, ifaddrs.h is not included in the headers
pub const ifaddrs = extern struct {
ifa_next: ?*ifaddrs,
diff --git a/src/deps/_libusockets.h b/src/deps/_libusockets.h
index 5ca0e7df8..e9dbb6938 100644
--- a/src/deps/_libusockets.h
+++ b/src/deps/_libusockets.h
@@ -264,7 +264,7 @@ void uws_res_write_header(int ssl, uws_res_t *res, const char *key,
void uws_res_write_header_int(int ssl, uws_res_t *res, const char *key,
size_t key_length, uint64_t value);
-void uws_res_end_without_body(int ssl, uws_res_t *res);
+void uws_res_end_without_body(int ssl, uws_res_t *res, bool close_connection);
void uws_res_end_stream(int ssl, uws_res_t *res, bool close_connection);
bool uws_res_write(int ssl, uws_res_t *res, const char *data, size_t length);
uintmax_t uws_res_get_write_offset(int ssl, uws_res_t *res);
@@ -304,7 +304,6 @@ size_t uws_req_get_parameter(uws_req_t *res, unsigned short index,
const char **dest);
void uws_req_for_each_header(uws_req_t *res, uws_get_headers_server_handler handler, void *user_data);
-
struct us_loop_t *uws_get_loop();
struct us_loop_t *uws_get_loop_with_native(void* existing_native_loop);
@@ -336,4 +335,4 @@ void uws_app_close(int ssl, uws_app_t *app);
}
#endif
-#endif \ No newline at end of file
+#endif
diff --git a/src/deps/c_ares.zig b/src/deps/c_ares.zig
index 457fcef0e..5290ffcc8 100644
--- a/src/deps/c_ares.zig
+++ b/src/deps/c_ares.zig
@@ -181,7 +181,7 @@ pub const struct_hostent = extern struct {
h_length: c_int,
h_addr_list: [*c][*c]u8,
- pub fn toJSReponse(this: *struct_hostent, _: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime lookup_name: []const u8) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_hostent, _: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime lookup_name: []const u8) JSC.JSValue {
// A cname lookup always returns a single record but we follow the common API here.
if (comptime strings.eqlComptime(lookup_name, "cname")) {
@@ -284,6 +284,55 @@ pub const struct_hostent = extern struct {
ares_free_hostent(this);
}
};
+
+pub const struct_nameinfo = extern struct {
+ node: [*c]u8,
+ service: [*c]u8,
+
+ pub fn toJSResponse(this: *struct_nameinfo, _: std.mem.Allocator, globalThis: *JSC.JSGlobalObject) JSC.JSValue {
+ const array = JSC.JSValue.createEmptyArray(globalThis, 2); // [node, service]
+
+ if (this.node != null) {
+ const node_len = bun.len(this.node);
+ const node_slice = this.node[0..node_len];
+ array.putIndex(globalThis, 0, JSC.ZigString.fromUTF8(node_slice).toValueGC(globalThis));
+ } else {
+ array.putIndex(globalThis, 0, JSC.JSValue.jsUndefined());
+ }
+
+ if (this.service != null) {
+ const service_len = bun.len(this.service);
+ const service_slice = this.service[0..service_len];
+ array.putIndex(globalThis, 1, JSC.ZigString.fromUTF8(service_slice).toValueGC(globalThis));
+ } else {
+ array.putIndex(globalThis, 1, JSC.JSValue.jsUndefined());
+ }
+
+ return array;
+ }
+
+ pub fn Callback(comptime Type: type) type {
+ return fn (*Type, status: ?Error, timeouts: i32, node: ?struct_nameinfo) void;
+ }
+
+ pub fn CallbackWrapper(
+ comptime Type: type,
+ comptime function: Callback(Type),
+ ) ares_nameinfo_callback {
+ return &struct {
+ pub fn handle(ctx: ?*anyopaque, status: c_int, timeouts: c_int, node: [*c]u8, service: [*c]u8) callconv(.C) void {
+ var this = bun.cast(*Type, ctx.?);
+ if (status != ARES_SUCCESS) {
+ function(this, Error.get(status), timeouts, null);
+ return;
+ }
+ function(this, null, timeouts, .{ .node = node, .service = service });
+ return;
+ }
+ }.handle;
+ }
+};
+
pub const struct_timeval = opaque {};
pub const struct_Channeldata = opaque {};
pub const AddrInfo_cname = extern struct {
@@ -524,11 +573,12 @@ pub const Channel = opaque {
}
pub fn resolve(this: *Channel, name: []const u8, comptime lookup_name: []const u8, comptime Type: type, ctx: *Type, comptime cares_type: type, comptime callback: cares_type.Callback(Type)) void {
+ if (name.len >= 1023 or (name.len == 0 and !(bun.strings.eqlComptime(lookup_name, "ns") or bun.strings.eqlComptime(lookup_name, "soa")))) {
+ return cares_type.callbackWrapper(lookup_name, Type, callback).?(ctx, ARES_EBADNAME, 0, null, 0);
+ }
+
var name_buf: [1024]u8 = undefined;
- const name_ptr: ?[*:0]const u8 = brk: {
- if (name.len == 0 or name.len >= 1023) {
- break :brk null;
- }
+ const name_ptr: [*:0]const u8 = brk: {
const len = @min(name.len, name_buf.len - 1);
@memcpy(name_buf[0..len], name[0..len]);
@@ -571,6 +621,20 @@ pub const Channel = opaque {
struct_hostent.hostCallbackWrapper(Type, callback).?(ctx, ARES_ENOTIMP, 0, null);
}
+ // https://c-ares.org/ares_getnameinfo.html
+ pub fn getNameInfo(this: *Channel, sa: *std.os.sockaddr, comptime Type: type, ctx: *Type, comptime callback: struct_nameinfo.Callback(Type)) void {
+ return ares_getnameinfo(
+ this,
+ sa,
+ if (sa.*.family == std.os.AF.INET) @sizeOf(std.os.sockaddr.in) else @sizeOf(std.os.sockaddr.in6),
+ // node returns ENOTFOUND for addresses like 255.255.255.255:80
+ // So, it requires setting the ARES_NI_NAMEREQD flag
+ ARES_NI_NAMEREQD | ARES_NI_LOOKUPHOST | ARES_NI_LOOKUPSERVICE,
+ struct_nameinfo.CallbackWrapper(Type, callback),
+ ctx,
+ );
+ }
+
pub inline fn process(this: *Channel, fd: i32, readable: bool, writable: bool) void {
ares_process_fd(
this,
@@ -669,7 +733,7 @@ pub const struct_ares_caa_reply = extern struct {
value: [*c]u8,
length: usize,
- pub fn toJSReponse(this: *struct_ares_caa_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_ares_caa_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
var stack = std.heap.stackFallback(2048, parent_allocator);
var arena = @import("root").bun.ArenaAllocator.init(stack.get());
defer arena.deinit();
@@ -747,7 +811,7 @@ pub const struct_ares_srv_reply = extern struct {
weight: c_ushort,
port: c_ushort,
- pub fn toJSReponse(this: *struct_ares_srv_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_ares_srv_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
var stack = std.heap.stackFallback(2048, parent_allocator);
var arena = @import("root").bun.ArenaAllocator.init(stack.get());
defer arena.deinit();
@@ -830,7 +894,7 @@ pub const struct_ares_mx_reply = extern struct {
host: [*c]u8,
priority: c_ushort,
- pub fn toJSReponse(this: *struct_ares_mx_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_ares_mx_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
var stack = std.heap.stackFallback(2048, parent_allocator);
var arena = @import("root").bun.ArenaAllocator.init(stack.get());
defer arena.deinit();
@@ -904,7 +968,7 @@ pub const struct_ares_txt_reply = extern struct {
txt: [*c]u8,
length: usize,
- pub fn toJSReponse(this: *struct_ares_txt_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_ares_txt_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
var stack = std.heap.stackFallback(2048, parent_allocator);
var arena = @import("root").bun.ArenaAllocator.init(stack.get());
defer arena.deinit();
@@ -984,7 +1048,7 @@ pub const struct_ares_naptr_reply = extern struct {
order: c_ushort,
preference: c_ushort,
- pub fn toJSReponse(this: *struct_ares_naptr_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_ares_naptr_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
var stack = std.heap.stackFallback(2048, parent_allocator);
var arena = @import("root").bun.ArenaAllocator.init(stack.get());
defer arena.deinit();
@@ -1076,7 +1140,7 @@ pub const struct_ares_soa_reply = extern struct {
expire: c_uint,
minttl: c_uint,
- pub fn toJSReponse(this: *struct_ares_soa_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_ares_soa_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
var stack = std.heap.stackFallback(2048, parent_allocator);
var arena = @import("root").bun.ArenaAllocator.init(stack.get());
defer arena.deinit();
@@ -1188,7 +1252,7 @@ pub extern fn ares_set_servers_csv(channel: *Channel, servers: [*c]const u8) c_i
pub extern fn ares_set_servers_ports_csv(channel: *Channel, servers: [*c]const u8) c_int;
pub extern fn ares_get_servers(channel: *Channel, servers: *?*struct_ares_addr_port_node) c_int;
pub extern fn ares_get_servers_ports(channel: *Channel, servers: *?*struct_ares_addr_port_node) c_int;
-pub extern fn ares_inet_ntop(af: c_int, src: ?*const anyopaque, dst: [*c]u8, size: ares_socklen_t) [*c]const u8;
+pub extern fn ares_inet_ntop(af: c_int, src: ?*const anyopaque, dst: [*c]u8, size: ares_socklen_t) ?[*:0]const u8;
pub extern fn ares_inet_pton(af: c_int, src: [*c]const u8, dst: ?*anyopaque) c_int;
pub const ARES_SUCCESS = 0;
pub const ARES_ENODATA = 1;
@@ -1470,6 +1534,52 @@ pub export fn Bun__canonicalizeIP(
return .zero;
}
}
+
+/// Creates a sockaddr structure from an address, port.
+///
+/// # Parameters
+/// - `addr`: A byte slice representing the IP address.
+/// - `port`: A 16-bit unsigned integer representing the port number.
+/// - `sa`: A pointer to a sockaddr structure where the result will be stored.
+///
+/// # Returns
+///
+/// This function returns 0 on success.
+pub fn getSockaddr(addr: []const u8, port: u16, sa: *std.os.sockaddr) c_int {
+ const buf_size = 128;
+
+ var buf: [buf_size]u8 = undefined;
+ const addr_ptr: [*:0]const u8 = brk: {
+ if (addr.len == 0 or addr.len >= buf_size) {
+ return -1;
+ }
+ const len = @min(addr.len, buf.len - 1);
+ @memcpy(buf[0..len], addr[0..len]);
+
+ buf[len] = 0;
+ break :brk buf[0..len :0];
+ };
+
+ {
+ const in: *std.os.sockaddr.in = @as(*std.os.sockaddr.in, @alignCast(@ptrCast(sa)));
+ if (ares_inet_pton(std.os.AF.INET, addr_ptr, &in.addr) == 1) {
+ in.*.family = std.os.AF.INET;
+ in.*.port = std.mem.nativeToBig(u16, port);
+ return 0;
+ }
+ }
+ {
+ const in6: *std.os.sockaddr.in6 = @as(*std.os.sockaddr.in6, @alignCast(@ptrCast(sa)));
+ if (ares_inet_pton(std.os.AF.INET6, addr_ptr, &in6.addr) == 1) {
+ in6.*.family = std.os.AF.INET6;
+ in6.*.port = std.mem.nativeToBig(u16, port);
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
comptime {
if (!JSC.is_bindgen) {
_ = Bun__canonicalizeIP;
diff --git a/src/deps/libuwsockets.cpp b/src/deps/libuwsockets.cpp
index 67778c3e3..a815e87df 100644
--- a/src/deps/libuwsockets.cpp
+++ b/src/deps/libuwsockets.cpp
@@ -1,11 +1,12 @@
+// clang-format off
#include "_libusockets.h"
-
#include <bun-uws/src/App.h>
#include <bun-uws/src/AsyncSocket.h>
-
#include <bun-usockets/src/internal/internal.h>
#include <string_view>
+extern "C" const char* ares_inet_ntop(int af, const char *src, char *dst, size_t size);
+
extern "C"
{
@@ -1040,14 +1041,14 @@ extern "C"
uWS::HttpResponse<true> *uwsRes = (uWS::HttpResponse<true> *)res;
uwsRes->getHttpResponseData()->onWritable = nullptr;
uwsRes->onAborted(nullptr);
- uwsRes->endWithoutBody(std::nullopt, close_connection);
+ uwsRes->sendTerminatingChunk(close_connection);
}
else
{
uWS::HttpResponse<false> *uwsRes = (uWS::HttpResponse<false> *)res;
uwsRes->getHttpResponseData()->onWritable = nullptr;
uwsRes->onAborted(nullptr);
- uwsRes->endWithoutBody(std::nullopt, close_connection);
+ uwsRes->sendTerminatingChunk(close_connection);
}
}
@@ -1141,21 +1142,46 @@ extern "C"
}
}
- void uws_res_end_without_body(int ssl, uws_res_t *res)
+ void uws_res_end_without_body(int ssl, uws_res_t *res, bool close_connection)
{
if (ssl)
{
uWS::HttpResponse<true> *uwsRes = (uWS::HttpResponse<true> *)res;
auto *data = uwsRes->getHttpResponseData();
+ if (close_connection)
+ {
+ if (!(data->state & uWS::HttpResponseData<true>::HTTP_CONNECTION_CLOSE))
+ {
+ uwsRes->writeHeader("Connection", "close");
+ }
+ data->state |= uWS::HttpResponseData<true>::HTTP_CONNECTION_CLOSE;
+ }
+ if (!(data->state & uWS::HttpResponseData<true>::HTTP_END_CALLED))
+ {
+ uwsRes->AsyncSocket<true>::write("\r\n", 2);
+ }
data->state |= uWS::HttpResponseData<true>::HTTP_END_CALLED;
data->markDone();
us_socket_timeout(true, (us_socket_t *)uwsRes, uWS::HTTP_TIMEOUT_S);
}
else
{
-
uWS::HttpResponse<false> *uwsRes = (uWS::HttpResponse<false> *)res;
auto *data = uwsRes->getHttpResponseData();
+ if (close_connection)
+ {
+ if (!(data->state & uWS::HttpResponseData<false>::HTTP_CONNECTION_CLOSE))
+ {
+ uwsRes->writeHeader("Connection", "close");
+ }
+ data->state |= uWS::HttpResponseData<false>::HTTP_CONNECTION_CLOSE;
+ }
+ if (!(data->state & uWS::HttpResponseData<false>::HTTP_END_CALLED))
+ {
+ // Some HTTP clients require the complete "<header>\r\n\r\n" to be sent.
+ // If not, they may throw a ConnectionError.
+ uwsRes->AsyncSocket<false>::write("\r\n", 2);
+ }
data->state |= uWS::HttpResponseData<false>::HTTP_END_CALLED;
data->markDone();
us_socket_timeout(false, (us_socket_t *)uwsRes, uWS::HTTP_TIMEOUT_S);
@@ -1577,4 +1603,30 @@ extern "C"
s->context->loop->data.last_write_failed = 1;
us_poll_change(&s->p, s->context->loop, LIBUS_SOCKET_READABLE | LIBUS_SOCKET_WRITABLE);
}
+
+ // Gets the remote address and port
+ // Returns 0 if failure / unix socket
+ uint64_t uws_res_get_remote_address_info(uws_res_t *res, const char **dest, int *port, bool *is_ipv6)
+ {
+ // This function is manual inlining + modification of
+ // us_socket_remote_address
+ // AsyncSocket::getRemoteAddress
+ // AsyncSocket::addressAsText
+ // To get { ip, port, is_ipv6 } for Bun.serve().requestIP()
+ static thread_local char b[64];
+ auto length = us_get_remote_address_info(b, (us_socket_t *)res, dest, port, (int*)is_ipv6);
+
+ if (length == 0) return 0;
+ if (length == 4) {
+ length = snprintf(b, 64, "%u.%u.%u.%u", b[0], b[1], b[2], b[3]);
+ *dest = b;
+ *is_ipv6 = false;
+ return length;
+ } else {
+ ares_inet_ntop(AF_INET6, b, &b[16], 64 - 16);
+ *dest = &b[16];
+ *is_ipv6 = true;
+ return strlen(*dest);
+ }
+ }
}
diff --git a/src/deps/lol-html.zig b/src/deps/lol-html.zig
index 9a9137856..12604d4e0 100644
--- a/src/deps/lol-html.zig
+++ b/src/deps/lol-html.zig
@@ -582,7 +582,7 @@ pub const HTMLString = extern struct {
pub fn toString(this: HTMLString) bun.String {
const bytes = this.slice();
- if (bun.strings.isAllASCII(bytes)) {
+ if (bytes.len > 0 and bun.strings.isAllASCII(bytes)) {
return bun.String.createExternal(bytes, true, @constCast(bytes.ptr), &deinit_external);
}
defer this.deinit();
diff --git a/src/deps/uws.zig b/src/deps/uws.zig
index 032e5f6e6..6d3fb4613 100644
--- a/src/deps/uws.zig
+++ b/src/deps/uws.zig
@@ -40,6 +40,20 @@ pub fn NewSocketHandler(comptime is_ssl: bool) type {
return us_socket_timeout(comptime ssl_int, this.socket, seconds);
}
+ pub fn setTimeout(this: ThisSocket, seconds: c_uint) void {
+ if (seconds > 240) {
+ us_socket_timeout(comptime ssl_int, this.socket, 0);
+ us_socket_long_timeout(comptime ssl_int, this.socket, seconds / 60);
+ } else {
+ us_socket_timeout(comptime ssl_int, this.socket, seconds);
+ us_socket_long_timeout(comptime ssl_int, this.socket, 0);
+ }
+ }
+
+ pub fn setTimeoutMinutes(this: ThisSocket, minutes: c_uint) void {
+ return us_socket_long_timeout(comptime ssl_int, this.socket, minutes);
+ }
+
pub fn startTLS(this: ThisSocket, is_client: bool) void {
_ = us_socket_open(comptime ssl_int, this.socket, @intFromBool(is_client), null, 0);
}
@@ -126,6 +140,13 @@ pub fn NewSocketHandler(comptime is_ssl: bool) type {
);
return socket;
}
+ pub fn on_long_timeout(socket: *Socket) callconv(.C) ?*Socket {
+ Fields.onLongTimeout(
+ getValue(socket),
+ TLSSocket{ .socket = socket },
+ );
+ return socket;
+ }
pub fn on_connect_error(socket: *Socket, code: i32) callconv(.C) ?*Socket {
Fields.onConnectError(
getValue(socket),
@@ -155,6 +176,7 @@ pub fn NewSocketHandler(comptime is_ssl: bool) type {
.on_connect_error = SocketHandler.on_connect_error,
.on_end = SocketHandler.on_end,
.on_handshake = SocketHandler.on_handshake,
+ .on_long_timeout = SocketHandler.on_long_timeout,
};
const socket = us_socket_wrap_with_tls(ssl_int, this.socket, options, events, socket_ext_size) orelse return null;
@@ -284,6 +306,64 @@ pub fn NewSocketHandler(comptime is_ssl: bool) type {
);
}
+ /// Get the local address of a socket in binary format.
+ ///
+ /// # Arguments
+ /// - `buf`: A buffer to store the binary address data.
+ ///
+ /// # Returns
+ /// This function returns a slice of the buffer on success, or null on failure.
+ pub fn localAddressBinary(this: ThisSocket, buf: []u8) ?[]const u8 {
+ var length: i32 = @intCast(buf.len);
+ us_socket_local_address(
+ comptime ssl_int,
+ this.socket,
+ buf.ptr,
+ &length,
+ );
+
+ if (length <= 0) {
+ return null;
+ }
+ return buf[0..@intCast(length)];
+ }
+
+ /// Get the local address of a socket in text format.
+ ///
+ /// # Arguments
+ /// - `buf`: A buffer to store the text address data.
+ /// - `is_ipv6`: A pointer to a boolean representing whether the address is IPv6.
+ ///
+ /// # Returns
+ /// This function returns a slice of the buffer on success, or null on failure.
+ pub fn localAddressText(this: ThisSocket, buf: []u8, is_ipv6: *bool) ?[]const u8 {
+ const addr_v4_len = @sizeOf(std.meta.FieldType(std.os.sockaddr.in, .addr));
+ const addr_v6_len = @sizeOf(std.meta.FieldType(std.os.sockaddr.in6, .addr));
+
+ var sa_buf: [addr_v6_len + 1]u8 = undefined;
+ const binary = this.localAddressBinary(&sa_buf);
+ if (binary == null) {
+ return null;
+ }
+ const addr_len: usize = binary.?.len;
+ sa_buf[addr_len] = 0;
+
+ var ret: ?[*:0]const u8 = null;
+ if (addr_len == addr_v4_len) {
+ ret = bun.c_ares.ares_inet_ntop(std.os.AF.INET, &sa_buf, buf.ptr, @as(u32, @intCast(buf.len)));
+ is_ipv6.* = false;
+ } else if (addr_len == addr_v6_len) {
+ ret = bun.c_ares.ares_inet_ntop(std.os.AF.INET6, &sa_buf, buf.ptr, @as(u32, @intCast(buf.len)));
+ is_ipv6.* = true;
+ }
+
+ if (ret) |_| {
+ const length: usize = @intCast(bun.len(bun.cast([*:0]u8, buf)));
+ return buf[0..length];
+ }
+ return null;
+ }
+
pub fn connect(
host: []const u8,
port: i32,
@@ -578,6 +658,13 @@ pub fn NewSocketHandler(comptime is_ssl: bool) type {
);
return socket;
}
+ pub fn on_long_timeout(socket: *Socket) callconv(.C) ?*Socket {
+ Fields.onLongTimeout(
+ getValue(socket),
+ ThisSocket{ .socket = socket },
+ );
+ return socket;
+ }
pub fn on_connect_error(socket: *Socket, code: i32) callconv(.C) ?*Socket {
Fields.onConnectError(
getValue(socket),
@@ -614,6 +701,8 @@ pub fn NewSocketHandler(comptime is_ssl: bool) type {
us_socket_context_on_end(ssl_int, ctx, SocketHandler.on_end);
if (comptime @hasDecl(Type, "onHandshake") and @typeInfo(@TypeOf(Type.onHandshake)) != .Null)
us_socket_context_on_handshake(ssl_int, ctx, SocketHandler.on_handshake, null);
+ if (comptime @hasDecl(Type, "onLongTimeout") and @typeInfo(@TypeOf(Type.onLongTimeout)) != .Null)
+ us_socket_context_on_long_timeout(ssl_int, ctx, SocketHandler.on_long_timeout);
}
pub fn from(socket: *Socket) ThisSocket {
@@ -669,9 +758,9 @@ pub const Timer = opaque {
@as(*@TypeOf(ptr), @ptrCast(@alignCast(value_ptr))).* = ptr;
}
- pub fn deinit(this: *Timer) void {
+ pub fn deinit(this: *Timer, comptime fallthrough: bool) void {
debug("Timer.deinit()", .{});
- us_timer_close(this);
+ us_timer_close(this, @intFromBool(fallthrough));
}
pub fn ext(this: *Timer, comptime Type: type) ?*Type {
@@ -836,12 +925,12 @@ pub const Loop = extern struct {
return us_wakeup_loop(this);
}
- pub fn tick(this: *Loop) void {
- us_loop_run_bun_tick(this, 0);
+ pub fn tick(this: *Loop, ctx: ?*anyopaque) void {
+ us_loop_run_bun_tick(this, 0, ctx);
}
- pub fn tickWithTimeout(this: *Loop, timeoutMs: i64) void {
- us_loop_run_bun_tick(this, timeoutMs);
+ pub fn tickWithTimeout(this: *Loop, timeoutMs: i64, ctx: ?*anyopaque) void {
+ us_loop_run_bun_tick(this, timeoutMs, ctx);
}
pub fn nextTick(this: *Loop, comptime UserType: type, user_data: UserType, comptime deferCallback: fn (ctx: UserType) void) void {
@@ -903,7 +992,7 @@ pub const Loop = extern struct {
extern fn us_loop_free(loop: ?*Loop) void;
extern fn us_loop_ext(loop: ?*Loop) ?*anyopaque;
extern fn us_loop_run(loop: ?*Loop) void;
- extern fn us_loop_run_bun_tick(loop: ?*Loop, timeoutMs: i64) void;
+ extern fn us_loop_run_bun_tick(loop: ?*Loop, timouetMs: i64, ?*anyopaque) void;
extern fn us_wakeup_loop(loop: ?*Loop) void;
extern fn us_loop_integrate(loop: ?*Loop) void;
extern fn us_loop_iteration_number(loop: ?*Loop) c_longlong;
@@ -916,7 +1005,7 @@ const uintmax_t = c_ulong;
extern fn us_create_timer(loop: ?*Loop, fallthrough: i32, ext_size: c_uint) *Timer;
extern fn us_timer_ext(timer: ?*Timer) *?*anyopaque;
-extern fn us_timer_close(timer: ?*Timer) void;
+extern fn us_timer_close(timer: ?*Timer, fallthrough: i32) void;
extern fn us_timer_set(timer: ?*Timer, cb: ?*const fn (*Timer) callconv(.C) void, ms: i32, repeat_ms: i32) void;
extern fn us_timer_loop(t: ?*Timer) ?*Loop;
pub const us_socket_context_options_t = extern struct {
@@ -986,6 +1075,7 @@ extern fn us_socket_context_on_writable(ssl: i32, context: ?*SocketContext, on_w
extern fn us_socket_context_on_handshake(ssl: i32, context: ?*SocketContext, on_handshake: *const fn (*Socket, i32, us_bun_verify_error_t, ?*anyopaque) callconv(.C) void, ?*anyopaque) void;
extern fn us_socket_context_on_timeout(ssl: i32, context: ?*SocketContext, on_timeout: *const fn (*Socket) callconv(.C) ?*Socket) void;
+extern fn us_socket_context_on_long_timeout(ssl: i32, context: ?*SocketContext, on_timeout: *const fn (*Socket) callconv(.C) ?*Socket) void;
extern fn us_socket_context_on_connect_error(ssl: i32, context: ?*SocketContext, on_connect_error: *const fn (*Socket, i32) callconv(.C) ?*Socket) void;
extern fn us_socket_context_on_end(ssl: i32, context: ?*SocketContext, on_end: *const fn (*Socket) callconv(.C) ?*Socket) void;
extern fn us_socket_context_ext(ssl: i32, context: ?*SocketContext) ?*anyopaque;
@@ -1090,6 +1180,7 @@ pub const Poll = opaque {
extern fn us_socket_get_native_handle(ssl: i32, s: ?*Socket) ?*anyopaque;
extern fn us_socket_timeout(ssl: i32, s: ?*Socket, seconds: c_uint) void;
+extern fn us_socket_long_timeout(ssl: i32, s: ?*Socket, seconds: c_uint) void;
extern fn us_socket_ext(ssl: i32, s: ?*Socket) ?*anyopaque;
extern fn us_socket_context(ssl: i32, s: ?*Socket) ?*SocketContext;
extern fn us_socket_flush(ssl: i32, s: ?*Socket) void;
@@ -1106,6 +1197,7 @@ extern fn us_socket_open(ssl: i32, s: ?*Socket, is_client: i32, ip: [*c]const u8
extern fn us_socket_local_port(ssl: i32, s: ?*Socket) i32;
extern fn us_socket_remote_address(ssl: i32, s: ?*Socket, buf: [*c]u8, length: [*c]i32) void;
+extern fn us_socket_local_address(ssl: i32, s: ?*Socket, buf: [*c]u8, length: [*c]i32) void;
pub const uws_app_s = opaque {};
pub const uws_req_s = opaque {};
pub const uws_header_iterator_s = opaque {};
@@ -1405,6 +1497,12 @@ extern fn us_listen_socket_close(ssl: i32, ls: *ListenSocket) void;
extern fn uws_app_close(ssl: i32, app: *uws_app_s) void;
extern fn us_socket_context_close(ssl: i32, ctx: *anyopaque) void;
+pub const SocketAddress = struct {
+ ip: []const u8,
+ port: i32,
+ is_ipv6: bool,
+};
+
pub fn NewApp(comptime ssl: bool) type {
return opaque {
const ssl_flag = @as(i32, @intFromBool(ssl));
@@ -1768,8 +1866,8 @@ pub fn NewApp(comptime ssl: bool) type {
pub fn writeHeaderInt(res: *Response, key: []const u8, value: u64) void {
uws_res_write_header_int(ssl_flag, res.downcast(), key.ptr, key.len, value);
}
- pub fn endWithoutBody(res: *Response, _: bool) void {
- uws_res_end_without_body(ssl_flag, res.downcast());
+ pub fn endWithoutBody(res: *Response, close_connection: bool) void {
+ uws_res_end_without_body(ssl_flag, res.downcast(), close_connection);
}
pub fn write(res: *Response, data: []const u8) bool {
return uws_res_write(ssl_flag, res.downcast(), data.ptr, data.len);
@@ -1787,6 +1885,33 @@ pub fn NewApp(comptime ssl: bool) type {
pub fn getNativeHandle(res: *Response) i32 {
return @as(i32, @intCast(@intFromPtr(uws_res_get_native_handle(ssl_flag, res.downcast()))));
}
+ pub fn getRemoteAddress(res: *Response) ?[]const u8 {
+ var buf: [*]const u8 = undefined;
+ const size = uws_res_get_remote_address(ssl_flag, res.downcast(), &buf);
+ return if (size > 0) buf[0..size] else null;
+ }
+ pub fn getRemoteAddressAsText(res: *Response) ?[]const u8 {
+ var buf: [*]const u8 = undefined;
+ const size = uws_res_get_remote_address_as_text(ssl_flag, res.downcast(), &buf);
+ return if (size > 0) buf[0..size] else null;
+ }
+ pub fn getRemoteSocketInfo(res: *Response) ?SocketAddress {
+ var address = SocketAddress{
+ .ip = undefined,
+ .port = undefined,
+ .is_ipv6 = undefined,
+ };
+ // This function will fill in the slots and return len.
+ // if len is zero it will not fill in the slots so it is ub to
+ // return the struct in that case.
+ address.ip.len = uws_res_get_remote_address_info(
+ res.downcast(),
+ &address.ip.ptr,
+ &address.port,
+ &address.is_ipv6,
+ );
+ return if (address.ip.len > 0) address else null;
+ }
pub fn onWritable(
res: *Response,
comptime UserDataType: type,
@@ -2070,6 +2195,8 @@ pub fn NewApp(comptime ssl: bool) type {
extern fn uws_res_end_stream(ssl: i32, res: *uws_res, close_connection: bool) void;
extern fn uws_res_prepare_for_sendfile(ssl: i32, res: *uws_res) void;
extern fn uws_res_get_native_handle(ssl: i32, res: *uws_res) *Socket;
+extern fn uws_res_get_remote_address(ssl: i32, res: *uws_res, dest: *[*]const u8) usize;
+extern fn uws_res_get_remote_address_as_text(ssl: i32, res: *uws_res, dest: *[*]const u8) usize;
extern fn uws_create_app(ssl: i32, options: us_bun_socket_context_options_t) *uws_app_t;
extern fn uws_app_destroy(ssl: i32, app: *uws_app_t) void;
extern fn uws_app_get(ssl: i32, app: *uws_app_t, pattern: [*c]const u8, handler: uws_method_handler, user_data: ?*anyopaque) void;
@@ -2123,6 +2250,8 @@ extern fn uws_ws_publish_with_options(ssl: i32, ws: ?*RawWebSocket, topic: [*c]c
extern fn uws_ws_get_buffered_amount(ssl: i32, ws: ?*RawWebSocket) c_uint;
extern fn uws_ws_get_remote_address(ssl: i32, ws: ?*RawWebSocket, dest: *[*]u8) usize;
extern fn uws_ws_get_remote_address_as_text(ssl: i32, ws: ?*RawWebSocket, dest: *[*]u8) usize;
+extern fn uws_res_get_remote_address_info(res: *uws_res, dest: *[*]const u8, port: *i32, is_ipv6: *bool) usize;
+
const uws_res = opaque {};
extern fn uws_res_uncork(ssl: i32, res: *uws_res) void;
extern fn uws_res_end(ssl: i32, res: *uws_res, data: [*c]const u8, length: usize, close_connection: bool) void;
@@ -2140,7 +2269,7 @@ extern fn uws_res_write_continue(ssl: i32, res: *uws_res) void;
extern fn uws_res_write_status(ssl: i32, res: *uws_res, status: [*c]const u8, length: usize) void;
extern fn uws_res_write_header(ssl: i32, res: *uws_res, key: [*c]const u8, key_length: usize, value: [*c]const u8, value_length: usize) void;
extern fn uws_res_write_header_int(ssl: i32, res: *uws_res, key: [*c]const u8, key_length: usize, value: u64) void;
-extern fn uws_res_end_without_body(ssl: i32, res: *uws_res) void;
+extern fn uws_res_end_without_body(ssl: i32, res: *uws_res, close_connection: bool) void;
extern fn uws_res_write(ssl: i32, res: *uws_res, data: [*c]const u8, length: usize) bool;
extern fn uws_res_get_write_offset(ssl: i32, res: *uws_res) uintmax_t;
extern fn uws_res_override_write_offset(ssl: i32, res: *uws_res, uintmax_t) void;
diff --git a/src/env_loader.zig b/src/env_loader.zig
index c57cc8b55..f89e566e2 100644
--- a/src/env_loader.zig
+++ b/src/env_loader.zig
@@ -35,7 +35,12 @@ pub const Loader = struct {
did_load_process: bool = false,
- const empty_string_value: string = "\"\"";
+ pub fn has(this: *const Loader, input: []const u8) bool {
+ const value = this.map.get(input) orelse return false;
+ if (value.len == 0) return false;
+
+ return !strings.eqlComptime(value, "\"\"") and !strings.eqlComptime(value, "''") and !strings.eqlComptime(value, "0") and !strings.eqlComptime(value, "false");
+ }
pub fn isProduction(this: *const Loader) bool {
const env = this.map.get("BUN_ENV") orelse this.map.get("NODE_ENV") orelse return false;
@@ -102,18 +107,24 @@ pub const Loader = struct {
if (url.isHTTP()) {
if (this.map.get("http_proxy") orelse this.map.get("HTTP_PROXY")) |proxy| {
- if (proxy.len > 0) http_proxy = URL.parse(proxy);
+ if (proxy.len > 0 and !strings.eqlComptime(proxy, "\"\"") and !strings.eqlComptime(proxy, "''")) {
+ http_proxy = URL.parse(proxy);
+ }
}
} else {
if (this.map.get("https_proxy") orelse this.map.get("HTTPS_PROXY")) |proxy| {
- if (proxy.len > 0) http_proxy = URL.parse(proxy);
+ if (proxy.len > 0 and !strings.eqlComptime(proxy, "\"\"") and !strings.eqlComptime(proxy, "''")) {
+ http_proxy = URL.parse(proxy);
+ }
}
}
// NO_PROXY filter
if (http_proxy != null) {
if (this.map.get("no_proxy") orelse this.map.get("NO_PROXY")) |no_proxy_text| {
- if (no_proxy_text.len == 0) return http_proxy;
+ if (no_proxy_text.len == 0 or strings.eqlComptime(no_proxy_text, "\"\"") or strings.eqlComptime(no_proxy_text, "''")) {
+ return http_proxy;
+ }
var no_proxy_list = std.mem.split(u8, no_proxy_text, ",");
var next = no_proxy_list.next();
@@ -161,7 +172,12 @@ pub const Loader = struct {
}
pub fn getAuto(this: *const Loader, key: string) string {
- return this.get(key) orelse key;
+ // If it's "" or "$", it's not a variable
+ if (key.len < 2 or key[0] != '$') {
+ return key;
+ }
+
+ return this.get(key[1..]) orelse key;
}
/// Load values from the environment into Define.
@@ -291,7 +307,7 @@ pub const Loader = struct {
}
} else {
while (iter.next()) |entry| {
- const value: string = if (entry.value_ptr.value.len == 0) empty_string_value else entry.value_ptr.value;
+ const value: string = entry.value_ptr.value;
const key = std.fmt.allocPrint(key_allocator, "process.env.{s}", .{entry.key_ptr.*}) catch unreachable;
e_strings[0] = js_ast.E.String{
@@ -345,15 +361,11 @@ pub const Loader = struct {
var key = env[0..i];
var value = env[i + 1 ..];
if (key.len > 0) {
- if (value.len > 0) {
- this.map.put(key, value) catch unreachable;
- } else {
- this.map.put(key, empty_string_value) catch unreachable;
- }
+ this.map.put(key, value) catch unreachable;
}
} else {
if (env.len > 0) {
- this.map.put(env, empty_string_value) catch unreachable;
+ this.map.put(env, "") catch unreachable;
}
}
}
@@ -890,8 +902,8 @@ pub const Map = struct {
var iter_ = this.map.iterator();
while (iter_.next()) |entry| {
- // Allow var from .env.development or .env.production to be loaded again. Also don't clone empty vars.
- if (!entry.value_ptr.conditional and entry.value_ptr.value.len > 0) {
+ // Allow var from .env.development or .env.production to be loaded again
+ if (!entry.value_ptr.conditional) {
try env_map.putMove(bun.constStrToU8(entry.key_ptr.*), bun.constStrToU8(entry.value_ptr.value));
}
}
diff --git a/src/fs.zig b/src/fs.zig
index d062bd0c3..9c0114f49 100644
--- a/src/fs.zig
+++ b/src/fs.zig
@@ -1338,8 +1338,10 @@ pub const PathName = struct {
base: string,
dir: string,
/// includes the leading .
+ /// extensionless files report ""
ext: string,
filename: string,
+
pub fn nonUniqueNameStringBase(self: *const PathName) string {
// /bar/foo/index.js -> foo
if (self.dir.len > 0 and strings.eqlComptime(self.base, "index")) {
@@ -1398,7 +1400,7 @@ pub const PathName = struct {
pub fn init(_path: string) PathName {
var path = _path;
var base = path;
- var ext = path;
+ var ext: []const u8 = undefined;
var dir = path;
var is_absolute = true;
@@ -1419,10 +1421,11 @@ pub const PathName = struct {
}
// Strip off the extension
- var _dot = strings.lastIndexOfChar(base, '.');
- if (_dot) |dot| {
+ if (strings.lastIndexOfChar(base, '.')) |dot| {
ext = base[dot..];
base = base[0..dot];
+ } else {
+ ext = "";
}
if (is_absolute) {
diff --git a/src/http/mime_type.zig b/src/http/mime_type.zig
index fb4043482..555adaa70 100644
--- a/src/http/mime_type.zig
+++ b/src/http/mime_type.zig
@@ -133,7 +133,7 @@ pub fn init(str_: string, allocator: ?std.mem.Allocator, allocated: ?*bool) Mime
}
}
- if (strings.eqlComptimeIgnoreLen(str, "octet-stream")) {
+ if (strings.eqlComptime(str, "octet-stream")) {
return other;
}
diff --git a/src/http_client_async.zig b/src/http_client_async.zig
index f06474219..fac496620 100644
--- a/src/http_client_async.zig
+++ b/src/http_client_async.zig
@@ -33,7 +33,7 @@ const BoringSSL = bun.BoringSSL;
const X509 = @import("./bun.js/api/bun/x509.zig");
const c_ares = @import("./deps/c_ares.zig");
-const URLBufferPool = ObjectPool([4096]u8, null, false, 10);
+const URLBufferPool = ObjectPool([8192]u8, null, false, 10);
const uws = bun.uws;
pub const MimeType = @import("./http/mime_type.zig");
pub const URLPath = @import("./http/url_path.zig");
@@ -68,6 +68,10 @@ pub const Signals = struct {
aborted: ?*std.atomic.Atomic(bool) = null,
cert_errors: ?*std.atomic.Atomic(bool) = null,
+ pub fn isEmpty(this: *const Signals) bool {
+ return this.aborted == null and this.body_streaming == null and this.header_progress == null and this.cert_errors == null;
+ }
+
pub const Store = struct {
header_progress: std.atomic.Atomic(bool) = std.atomic.Atomic(bool).init(false),
body_streaming: std.atomic.Atomic(bool) = std.atomic.Atomic(bool).init(false),
@@ -396,7 +400,8 @@ fn NewHTTPContext(comptime ssl: bool) type {
if (this.pending_sockets.get()) |pending| {
socket.ext(**anyopaque).?.* = bun.cast(**anyopaque, ActiveSocket.init(pending).ptr());
socket.flush();
- socket.timeout(300);
+ socket.timeout(0);
+ socket.setTimeoutMinutes(5);
pending.http_socket = socket;
@memcpy(pending.hostname_buf[0..hostname.len], hostname);
@@ -471,10 +476,10 @@ fn NewHTTPContext(comptime ssl: bool) type {
std.debug.assert(context().pending_sockets.put(pooled));
}
- socket.ext(**anyopaque).?.* = bun.cast(**anyopaque, ActiveSocket.init(&dead_socket).ptr());
- socket.close(0, null);
- if (comptime Environment.allow_assert) {
- std.debug.assert(false);
+ // we can reach here if we are aborted
+ if (!socket.isClosed()) {
+ socket.ext(**anyopaque).?.* = bun.cast(**anyopaque, ActiveSocket.init(&dead_socket).ptr());
+ socket.close(0, null);
}
}
pub fn onClose(
@@ -531,7 +536,7 @@ fn NewHTTPContext(comptime ssl: bool) type {
);
}
}
- pub fn onTimeout(
+ pub fn onLongTimeout(
ptr: *anyopaque,
socket: HTTPSocket,
) void {
@@ -1071,17 +1076,24 @@ pub fn onClose(
const in_progress = client.state.stage != .done and client.state.stage != .fail;
- // if the peer closed after a full chunk, treat this
- // as if the transfer had complete, browsers appear to ignore
- // a missing 0\r\n chunk
- if (in_progress and client.state.isChunkedEncoding()) {
- if (picohttp.phr_decode_chunked_is_in_data(&client.state.chunked_decoder) == 0) {
- var buf = client.state.getBodyBuffer();
- if (buf.list.items.len > 0) {
- client.state.received_last_chunk = true;
- client.progressUpdate(comptime is_ssl, if (is_ssl) &http_thread.https_context else &http_thread.http_context, socket);
- return;
+ if (in_progress) {
+ // if the peer closed after a full chunk, treat this
+ // as if the transfer had complete, browsers appear to ignore
+ // a missing 0\r\n chunk
+ if (client.state.isChunkedEncoding()) {
+ if (picohttp.phr_decode_chunked_is_in_data(&client.state.chunked_decoder) == 0) {
+ var buf = client.state.getBodyBuffer();
+ if (buf.list.items.len > 0) {
+ client.state.received_last_chunk = true;
+ client.progressUpdate(comptime is_ssl, if (is_ssl) &http_thread.https_context else &http_thread.http_context, socket);
+ return;
+ }
}
+ } else if (client.state.content_length == null and client.state.response_stage == .body) {
+ // no content length informed so we are done here
+ client.state.received_last_chunk = true;
+ client.progressUpdate(comptime is_ssl, if (is_ssl) &http_thread.https_context else &http_thread.http_context, socket);
+ return;
}
}
@@ -1092,7 +1104,7 @@ pub fn onClose(
}
if (in_progress) {
- client.fail(error.ConnectionClosed);
+ client.closeAndFail(error.ConnectionClosed, is_ssl, socket);
}
}
pub fn onTimeout(
@@ -1121,12 +1133,31 @@ pub fn onConnectError(
pub fn onEnd(
client: *HTTPClient,
comptime is_ssl: bool,
- _: NewHTTPContext(is_ssl).HTTPSocket,
+ socket: NewHTTPContext(is_ssl).HTTPSocket,
) void {
log("onEnd {s}\n", .{client.url.href});
-
- if (client.state.stage != .done and client.state.stage != .fail)
- client.fail(error.ConnectionClosed);
+ const in_progress = client.state.stage != .done and client.state.stage != .fail;
+ if (in_progress) {
+ // if the peer closed after a full chunk, treat this
+ // as if the transfer had complete, browsers appear to ignore
+ // a missing 0\r\n chunk
+ if (client.state.isChunkedEncoding()) {
+ if (picohttp.phr_decode_chunked_is_in_data(&client.state.chunked_decoder) == 0) {
+ var buf = client.state.getBodyBuffer();
+ if (buf.list.items.len > 0) {
+ client.state.received_last_chunk = true;
+ client.progressUpdate(comptime is_ssl, if (is_ssl) &http_thread.https_context else &http_thread.http_context, socket);
+ return;
+ }
+ }
+ } else if (client.state.content_length == null and client.state.response_stage == .body) {
+ // no content length informed so we are done here
+ client.state.received_last_chunk = true;
+ client.progressUpdate(comptime is_ssl, if (is_ssl) &http_thread.https_context else &http_thread.http_context, socket);
+ return;
+ }
+ }
+ client.fail(error.ConnectionClosed);
}
pub inline fn getAllocator() std.mem.Allocator {
@@ -1278,6 +1309,7 @@ pub const InternalState = struct {
allow_keepalive: bool = true,
received_last_chunk: bool = false,
+ did_set_content_encoding: bool = false,
transfer_encoding: Encoding = Encoding.identity,
encoding: Encoding = Encoding.identity,
content_encoding_i: u8 = std.math.maxInt(u8),
@@ -1324,9 +1356,6 @@ pub const InternalState = struct {
reader.deinit();
}
- // if we are holding a cloned_metadata we need to deinit it
- // this should never happen because we should always return the metadata to the user
- std.debug.assert(this.cloned_metadata == null);
// just in case we check and free to avoid leaks
if (this.cloned_metadata != null) {
this.cloned_metadata.?.deinit(allocator);
@@ -1369,8 +1398,8 @@ pub const InternalState = struct {
return this.total_body_received >= content_length;
}
- // TODO: in future to handle Content-Type: text/event-stream we should be done only when Close/End/Timeout connection
- return true;
+ // Content-Type: text/event-stream we should be done only when Close/End/Timeout connection
+ return this.received_last_chunk;
}
fn decompressConst(this: *InternalState, buffer: []const u8, body_out_str: *MutableString) !void {
@@ -2122,7 +2151,7 @@ pub fn buildRequest(this: *HTTPClient, body_len: usize) picohttp.Request {
header_count += 1;
}
- if (!override_accept_encoding) {
+ if (!override_accept_encoding and !this.disable_decompression) {
request_headers_buf[header_count] = accept_encoding_header;
header_count += 1;
}
@@ -2252,7 +2281,7 @@ pub fn onWritable(this: *HTTPClient, comptime is_first_call: bool, comptime is_s
defer if (list.capacity > stack_fallback.buffer.len) list.deinit();
var writer = &list.writer();
- this.setTimeout(socket, 60);
+ this.setTimeout(socket, 5);
const request = this.buildRequest(this.state.original_request_body.len());
@@ -2289,10 +2318,6 @@ pub fn onWritable(this: *HTTPClient, comptime is_first_call: bool, comptime is_s
};
}
- if (this.verbose) {
- printRequest(request);
- }
-
const headers_len = list.items.len;
std.debug.assert(list.items.len == writer.context.items.len);
if (this.state.request_body.len > 0 and list.capacity - list.items.len > 0 and !this.proxy_tunneling) {
@@ -2327,6 +2352,10 @@ pub fn onWritable(this: *HTTPClient, comptime is_first_call: bool, comptime is_s
this.state.request_sent_len += @as(usize, @intCast(amount));
const has_sent_headers = this.state.request_sent_len >= headers_len;
+ if (has_sent_headers and this.verbose) {
+ printRequest(request);
+ }
+
if (has_sent_headers and this.state.request_body.len > 0) {
this.state.request_body = this.state.request_body[this.state.request_sent_len - headers_len ..];
}
@@ -2362,7 +2391,7 @@ pub fn onWritable(this: *HTTPClient, comptime is_first_call: bool, comptime is_s
}
},
.body => {
- this.setTimeout(socket, 60);
+ this.setTimeout(socket, 5);
switch (this.state.original_request_body) {
.bytes => {
@@ -2408,7 +2437,7 @@ pub fn onWritable(this: *HTTPClient, comptime is_first_call: bool, comptime is_s
}
var proxy = this.proxy_tunnel orelse return;
- this.setTimeout(socket, 60);
+ this.setTimeout(socket, 5);
const to_send = this.state.request_body;
const amount = proxy.ssl.write(to_send) catch |err| {
@@ -2430,15 +2459,13 @@ pub fn onWritable(this: *HTTPClient, comptime is_first_call: bool, comptime is_s
.proxy_headers => {
const proxy = this.proxy_tunnel orelse return;
- this.setTimeout(socket, 60);
+ this.setTimeout(socket, 5);
var stack_fallback = std.heap.stackFallback(16384, default_allocator);
var allocator = stack_fallback.get();
var list = std.ArrayList(u8).initCapacity(allocator, stack_fallback.buffer.len) catch unreachable;
defer if (list.capacity > stack_fallback.buffer.len) list.deinit();
var writer = &list.writer();
- this.setTimeout(socket, 60);
-
const request = this.buildRequest(this.state.request_body.len);
writeRequest(
@TypeOf(writer),
@@ -2509,7 +2536,7 @@ pub fn onWritable(this: *HTTPClient, comptime is_first_call: bool, comptime is_s
else => {
//Just check if need to call SSL_read if requested to be writable
var proxy = this.proxy_tunnel orelse return;
- this.setTimeout(socket, 60);
+ this.setTimeout(socket, 5);
var data = proxy.getSSLData(null) catch |err| {
this.closeAndFail(err, is_ssl, socket);
return;
@@ -2624,7 +2651,7 @@ pub fn onData(this: *HTTPClient, comptime is_ssl: bool, incoming_data: []const u
}
}
- this.setTimeout(socket, 60);
+ this.setTimeout(socket, 5);
},
else => {
this.closeAndFail(err, is_ssl, socket);
@@ -2637,9 +2664,17 @@ pub fn onData(this: *HTTPClient, comptime is_ssl: bool, incoming_data: []const u
this.state.pending_response = response;
var body_buf = to_read[@min(@as(usize, @intCast(response.bytes_read)), to_read.len)..];
+ // handle the case where we have a 100 Continue
+ if (response.status_code == 100) {
+ // we still can have the 200 OK in the same buffer sometimes
+ if (body_buf.len > 0) {
+ this.onData(is_ssl, body_buf, ctx, socket);
+ }
+ return;
+ }
var deferred_redirect: ?*URLBufferPool.Node = null;
- const can_continue = this.handleResponseMetadata(
+ const should_continue = this.handleResponseMetadata(
&response,
// If there are multiple consecutive redirects
// and the redirect differs in hostname
@@ -2676,17 +2711,17 @@ pub fn onData(this: *HTTPClient, comptime is_ssl: bool, incoming_data: []const u
return;
};
- if (this.state.content_encoding_i < response.headers.len) {
+ if (this.state.content_encoding_i < response.headers.len and !this.state.did_set_content_encoding) {
// if it compressed with this header, it is no longer because we will decompress it
var mutable_headers = std.ArrayListUnmanaged(picohttp.Header){ .items = response.headers, .capacity = response.headers.len };
- _ = mutable_headers.orderedRemove(this.state.content_encoding_i);
+ this.state.did_set_content_encoding = true;
response.headers = mutable_headers.items;
this.state.content_encoding_i = std.math.maxInt(@TypeOf(this.state.content_encoding_i));
// we need to reset the pending response because we removed a header
this.state.pending_response = response;
}
- if (!can_continue) {
+ if (should_continue == .finished) {
// this means that the request ended
// clone metadata and return the progress at this point
this.cloneMetadata();
@@ -2728,7 +2763,7 @@ pub fn onData(this: *HTTPClient, comptime is_ssl: bool, incoming_data: []const u
}
}
} else if (this.state.response_stage == .body_chunk) {
- this.setTimeout(socket, 500);
+ this.setTimeout(socket, 5);
{
const report_progress = this.handleResponseBodyChunkedEncoding(body_buf) catch |err| {
this.closeAndFail(err, is_ssl, socket);
@@ -2750,7 +2785,7 @@ pub fn onData(this: *HTTPClient, comptime is_ssl: bool, incoming_data: []const u
},
.body => {
- this.setTimeout(socket, 60);
+ this.setTimeout(socket, 5);
if (this.proxy_tunnel != null) {
var proxy = this.proxy_tunnel.?;
@@ -2785,7 +2820,7 @@ pub fn onData(this: *HTTPClient, comptime is_ssl: bool, incoming_data: []const u
},
.body_chunk => {
- this.setTimeout(socket, 500);
+ this.setTimeout(socket, 5);
if (this.proxy_tunnel != null) {
var proxy = this.proxy_tunnel.?;
@@ -2822,7 +2857,7 @@ pub fn onData(this: *HTTPClient, comptime is_ssl: bool, incoming_data: []const u
.fail => {},
.proxy_headers => {
- this.setTimeout(socket, 60);
+ this.setTimeout(socket, 5);
var proxy = this.proxy_tunnel orelse return;
var data = proxy.getSSLData(incoming_data) catch |err| {
this.closeAndFail(err, is_ssl, socket);
@@ -2839,7 +2874,7 @@ pub fn onData(this: *HTTPClient, comptime is_ssl: bool, incoming_data: []const u
this.onData(is_ssl, decoded_data, ctx, socket);
},
.proxy_handshake => {
- this.setTimeout(socket, 60);
+ this.setTimeout(socket, 5);
// put more data into SSL
const proxy = this.proxy_tunnel orelse return;
@@ -2866,9 +2901,6 @@ fn fail(this: *HTTPClient, err: anyerror) void {
_ = socket_async_http_abort_tracker.swapRemove(this.async_http_id);
}
- this.state.reset(this.allocator);
- this.proxy_tunneling = false;
-
this.state.request_stage = .fail;
this.state.response_stage = .fail;
this.state.fail = err;
@@ -2876,6 +2908,9 @@ fn fail(this: *HTTPClient, err: anyerror) void {
const callback = this.result_callback;
const result = this.toResult();
+ this.state.reset(this.allocator);
+ this.proxy_tunneling = false;
+
callback.run(result);
}
@@ -2883,9 +2918,6 @@ fn fail(this: *HTTPClient, err: anyerror) void {
fn cloneMetadata(this: *HTTPClient) void {
std.debug.assert(this.state.pending_response != null);
if (this.state.pending_response) |response| {
- // we should never clone metadata twice
- std.debug.assert(this.state.cloned_metadata == null);
- // just in case we check and free
if (this.state.cloned_metadata != null) {
this.state.cloned_metadata.?.deinit(this.allocator);
this.state.cloned_metadata = null;
@@ -2915,13 +2947,15 @@ fn cloneMetadata(this: *HTTPClient) void {
}
}
-pub fn setTimeout(this: *HTTPClient, socket: anytype, amount: c_uint) void {
+pub fn setTimeout(this: *HTTPClient, socket: anytype, minutes: c_uint) void {
if (this.disable_timeout) {
socket.timeout(0);
+ socket.setTimeoutMinutes(0);
return;
}
- socket.timeout(amount);
+ socket.timeout(0);
+ socket.setTimeoutMinutes(minutes);
}
pub fn progressUpdate(this: *HTTPClient, comptime is_ssl: bool, ctx: *NewHTTPContext(is_ssl), socket: NewHTTPContext(is_ssl).HTTPSocket) void {
@@ -3081,10 +3115,10 @@ const preallocate_max = 1024 * 1024 * 256;
pub fn handleResponseBody(this: *HTTPClient, incoming_data: []const u8, is_only_buffer: bool) !bool {
std.debug.assert(this.state.transfer_encoding == .identity);
- const content_length = this.state.content_length orelse 0;
+ const content_length = this.state.content_length;
// is it exactly as much as we need?
- if (is_only_buffer and incoming_data.len >= content_length) {
- try handleResponseBodyFromSinglePacket(this, incoming_data[0..content_length]);
+ if (is_only_buffer and content_length != null and incoming_data.len >= content_length.?) {
+ try handleResponseBodyFromSinglePacket(this, incoming_data[0..content_length.?]);
return true;
} else {
return handleResponseBodyFromMultiplePackets(this, incoming_data);
@@ -3127,16 +3161,19 @@ fn handleResponseBodyFromSinglePacket(this: *HTTPClient, incoming_data: []const
fn handleResponseBodyFromMultiplePackets(this: *HTTPClient, incoming_data: []const u8) !bool {
var buffer = this.state.getBodyBuffer();
- const content_length = this.state.content_length orelse 0;
+ const content_length = this.state.content_length;
- if (buffer.list.items.len == 0 and
- content_length > 0 and incoming_data.len < preallocate_max)
- {
+ if (buffer.list.items.len == 0 and incoming_data.len < preallocate_max) {
buffer.list.ensureTotalCapacityPrecise(buffer.allocator, incoming_data.len) catch {};
}
- const remaining_content_length = content_length -| this.state.total_body_received;
- var remainder = incoming_data[0..@min(incoming_data.len, remaining_content_length)];
+ var remainder: []const u8 = undefined;
+ if (content_length != null) {
+ const remaining_content_length = content_length.? -| this.state.total_body_received;
+ remainder = incoming_data[0..@min(incoming_data.len, remaining_content_length)];
+ } else {
+ remainder = incoming_data;
+ }
_ = try buffer.write(remainder);
@@ -3149,7 +3186,7 @@ fn handleResponseBodyFromMultiplePackets(this: *HTTPClient, incoming_data: []con
}
// done or streaming
- const is_done = this.state.total_body_received >= content_length;
+ const is_done = content_length != null and this.state.total_body_received >= content_length.?;
if (is_done or this.signals.get(.body_streaming)) {
const processed = try this.state.processBodyBuffer(buffer.*);
@@ -3317,13 +3354,19 @@ fn handleResponseBodyChunkedEncodingFromSinglePacket(
unreachable;
}
+const ShouldContinue = enum {
+ continue_streaming,
+ finished,
+};
+
pub fn handleResponseMetadata(
this: *HTTPClient,
response: *picohttp.Response,
deferred_redirect: *?*URLBufferPool.Node,
-) !bool {
+) !ShouldContinue {
var location: string = "";
var pretend_304 = false;
+ var is_server_sent_events = false;
for (response.headers, 0..) |header, header_i| {
switch (hashHeaderName(header.name)) {
hashHeaderConst("Content-Length") => {
@@ -3335,6 +3378,11 @@ pub fn handleResponseMetadata(
this.state.content_length = 0;
}
},
+ hashHeaderConst("Content-Type") => {
+ if (strings.contains(header.value, "text/event-stream")) {
+ is_server_sent_events = true;
+ }
+ },
hashHeaderConst("Content-Encoding") => {
if (!this.disable_decompression) {
if (strings.eqlComptime(header.value, "gzip")) {
@@ -3391,19 +3439,24 @@ pub fn handleResponseMetadata(
if (this.proxy_tunneling and this.proxy_tunnel == null) {
if (response.status_code == 200) {
- //signal to continue the proxing
- return true;
+ // signal to continue the proxing
+ return ShouldContinue.continue_streaming;
}
//proxy denied connection so return proxy result (407, 403 etc)
this.proxy_tunneling = false;
}
- const is_redirect = response.status_code >= 300 and response.status_code <= 399;
+ const status_code = response.status_code;
+
+ // if is no redirect or if is redirect == "manual" just proceed
+ const is_redirect = status_code >= 300 and status_code <= 399;
if (is_redirect) {
if (this.redirect_type == FetchRedirect.follow and location.len > 0 and this.remaining_redirect_count > 0) {
- switch (response.status_code) {
+ switch (status_code) {
302, 301, 307, 308, 303 => {
+ var is_same_origin = true;
+
if (strings.indexOf(location, "://")) |i| {
var url_buf = URLBufferPool.get(default_allocator);
@@ -3434,7 +3487,9 @@ pub fn handleResponseMetadata(
bun.copy(u8, &url_buf.data, location);
}
- this.url = URL.parse(url_buf.data[0..url_buf_len]);
+ const new_url = URL.parse(url_buf.data[0..url_buf_len]);
+ is_same_origin = strings.eqlCaseInsensitiveASCII(strings.withoutTrailingSlash(new_url.origin), strings.withoutTrailingSlash(this.url.origin), true);
+ this.url = new_url;
this.redirect = url_buf;
} else if (strings.hasPrefixComptime(location, "//")) {
var url_buf = URLBufferPool.get(default_allocator);
@@ -3458,49 +3513,107 @@ pub fn handleResponseMetadata(
url_buf_len += "https:".len;
}
- this.url = URL.parse(url_buf.data[0..url_buf_len]);
+ const new_url = URL.parse(url_buf.data[0..url_buf_len]);
+ is_same_origin = strings.eqlCaseInsensitiveASCII(strings.withoutTrailingSlash(new_url.origin), strings.withoutTrailingSlash(this.url.origin), true);
+ this.url = new_url;
this.redirect = url_buf;
} else {
var url_buf = URLBufferPool.get(default_allocator);
+ var fba = std.heap.FixedBufferAllocator.init(&url_buf.data);
const original_url = this.url;
- const port = original_url.getPortAuto();
-
- if (port == original_url.getDefaultPort()) {
- this.url = URL.parse(std.fmt.bufPrint(
- &url_buf.data,
- "{s}://{s}{s}",
- .{ original_url.displayProtocol(), original_url.displayHostname(), location },
- ) catch return error.RedirectURLTooLong);
- } else {
- this.url = URL.parse(std.fmt.bufPrint(
- &url_buf.data,
- "{s}://{s}:{d}{s}",
- .{ original_url.displayProtocol(), original_url.displayHostname(), port, location },
- ) catch return error.RedirectURLTooLong);
+
+ const new_url_ = bun.JSC.URL.join(
+ bun.String.fromUTF8(original_url.href),
+ bun.String.fromUTF8(location),
+ );
+ defer new_url_.deref();
+
+ if (new_url_.isEmpty()) {
+ return error.InvalidRedirectURL;
}
+ const new_url = new_url_.toOwnedSlice(fba.allocator()) catch {
+ return error.RedirectURLTooLong;
+ };
+ this.url = URL.parse(new_url);
+
+ is_same_origin = strings.eqlCaseInsensitiveASCII(strings.withoutTrailingSlash(this.url.origin), strings.withoutTrailingSlash(original_url.origin), true);
deferred_redirect.* = this.redirect;
this.redirect = url_buf;
}
- // Note: RFC 1945 and RFC 2068 specify that the client is not allowed to change
- // the method on the redirected request. However, most existing user agent
- // implementations treat 302 as if it were a 303 response, performing a GET on
- // the Location field-value regardless of the original request method. The
- // status codes 303 and 307 have been added for servers that wish to make
- // unambiguously clear which kind of reaction is expected of the client.
- if (response.status_code == 302) {
- switch (this.method) {
- .GET, .HEAD => {},
- else => {
- this.method = .GET;
- },
+ // If one of the following is true
+ // - internalResponse’s status is 301 or 302 and request’s method is `POST`
+ // - internalResponse’s status is 303 and request’s method is not `GET` or `HEAD`
+ // then:
+ if (((status_code == 301 or status_code == 302) and this.method == .POST) or
+ (status_code == 303 and this.method != .GET and this.method != .HEAD))
+ {
+ // - Set request’s method to `GET` and request’s body to null.
+ this.method = .GET;
+
+ // https://github.com/oven-sh/bun/issues/6053
+ if (this.header_entries.len > 0) {
+ // A request-body-header name is a header name that is a byte-case-insensitive match for one of:
+ // - `Content-Encoding`
+ // - `Content-Language`
+ // - `Content-Location`
+ // - `Content-Type`
+ const @"request-body-header" = &.{
+ "Content-Encoding",
+ "Content-Language",
+ "Content-Location",
+ };
+ var i: usize = 0;
+
+ // - For each headerName of request-body-header name, delete headerName from request’s header list.
+ const names = this.header_entries.items(.name);
+ var len = names.len;
+ outer: while (i < len) {
+ const name = this.headerStr(names[i]);
+ switch (name.len) {
+ "Content-Type".len => {
+ const hash = hashHeaderName(name);
+ if (hash == comptime hashHeaderConst("Content-Type")) {
+ _ = this.header_entries.orderedRemove(i);
+ len = this.header_entries.len;
+ continue :outer;
+ }
+ },
+ "Content-Encoding".len => {
+ const hash = hashHeaderName(name);
+ inline for (@"request-body-header") |hash_value| {
+ if (hash == comptime hashHeaderConst(hash_value)) {
+ _ = this.header_entries.orderedRemove(i);
+ len = this.header_entries.len;
+ continue :outer;
+ }
+ }
+ },
+ else => {},
+ }
+ i += 1;
+ }
}
}
- // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303
- if (response.status_code == 303 and this.method != .HEAD) {
- this.method = .GET;
+ // https://fetch.spec.whatwg.org/#concept-http-redirect-fetch
+ // If request’s current URL’s origin is not same origin with
+ // locationURL’s origin, then for each headerName of CORS
+ // non-wildcard request-header name, delete headerName from
+ // request’s header list.
+ if (!is_same_origin and this.header_entries.len > 0) {
+ const authorization_header_hash = comptime hashHeaderConst("Authorization");
+ for (this.header_entries.items(.name), 0..) |name_ptr, i| {
+ const name = this.headerStr(name_ptr);
+ if (name.len == "Authorization".len) {
+ const hash = hashHeaderName(name);
+ if (hash == authorization_header_hash) {
+ this.header_entries.orderedRemove(i);
+ break;
+ }
+ }
+ }
}
return error.Redirect;
@@ -3513,9 +3626,17 @@ pub fn handleResponseMetadata(
}
}
- // if is no redirect or if is redirect == "manual" just proceed
this.state.response_stage = if (this.state.transfer_encoding == .chunked) .body_chunk else .body;
- const content_length = this.state.content_length orelse 0;
- // if no body is expected we should stop processing
- return this.method.hasBody() and (content_length > 0 or this.state.transfer_encoding == .chunked);
+ const content_length = this.state.content_length;
+ if (content_length) |length| {
+ log("handleResponseMetadata: content_length is {} and transfer_encoding {}", .{ length, this.state.transfer_encoding });
+ } else {
+ log("handleResponseMetadata: content_length is null and transfer_encoding {}", .{this.state.transfer_encoding});
+ }
+
+ if (this.method.hasBody() and ((content_length != null and content_length.? > 0) or !this.state.allow_keepalive or this.state.transfer_encoding == .chunked or is_server_sent_events)) {
+ return ShouldContinue.continue_streaming;
+ } else {
+ return ShouldContinue.finished;
+ }
}
diff --git a/src/identity_context.zig b/src/identity_context.zig
index 7bcfa3dbc..5e0cfe987 100644
--- a/src/identity_context.zig
+++ b/src/identity_context.zig
@@ -20,4 +20,14 @@ pub const ArrayIdentityContext = struct {
pub fn eql(_: @This(), a: u32, b: u32, _: usize) bool {
return a == b;
}
+
+ pub const U64 = struct {
+ pub fn hash(_: @This(), key: u64) u32 {
+ return @truncate(key);
+ }
+
+ pub fn eql(_: @This(), a: u64, b: u64, _: usize) bool {
+ return a == b;
+ }
+ };
};
diff --git a/src/import_record.zig b/src/import_record.zig
index 3044c9b47..d48cfb1b0 100644
--- a/src/import_record.zig
+++ b/src/import_record.zig
@@ -51,10 +51,27 @@ pub const ImportKind = enum(u8) {
break :brk labels;
};
+ pub const error_labels: Label = brk: {
+ var labels = Label.initFill("");
+ labels.set(ImportKind.entry_point, "entry point");
+ labels.set(ImportKind.stmt, "import");
+ labels.set(ImportKind.require, "require()");
+ labels.set(ImportKind.dynamic, "import()");
+ labels.set(ImportKind.require_resolve, "require.resolve");
+ labels.set(ImportKind.at, "@import");
+ labels.set(ImportKind.url, "url()");
+ labels.set(ImportKind.internal, "<bun internal>");
+ break :brk labels;
+ };
+
pub inline fn label(this: ImportKind) []const u8 {
return all_labels.get(this);
}
+ pub inline fn errorLabel(this: ImportKind) []const u8 {
+ return error_labels.get(this);
+ }
+
pub inline fn isCommonJS(this: ImportKind) bool {
return switch (this) {
.require, .require_resolve => true,
diff --git a/src/install/bin.zig b/src/install/bin.zig
index 0a8d62c8c..3c101e388 100644
--- a/src/install/bin.zig
+++ b/src/install/bin.zig
@@ -20,7 +20,8 @@ pub const Bin = extern struct {
tag: Tag = Tag.none,
_padding_tag: [3]u8 = .{0} ** 3,
- value: Value = Value{ .none = {} },
+ // Largest member must be zero initialized
+ value: Value = Value{ .map = ExternalStringList{} },
pub fn verify(this: *const Bin, extern_strings: []const ExternalString) void {
if (comptime !Environment.allow_assert)
@@ -67,36 +68,55 @@ pub const Bin = extern struct {
}
pub fn clone(this: *const Bin, buf: []const u8, prev_external_strings: []const ExternalString, all_extern_strings: []ExternalString, extern_strings_slice: []ExternalString, comptime StringBuilder: type, builder: StringBuilder) Bin {
- return switch (this.tag) {
- .none => Bin{ .tag = .none, .value = .{ .none = {} } },
- .file => Bin{
- .tag = .file,
- .value = .{ .file = builder.append(String, this.value.file.slice(buf)) },
+ switch (this.tag) {
+ .none => {
+ return Bin{
+ .tag = .none,
+ .value = Value.init(.{ .none = {} }),
+ };
},
- .named_file => Bin{
- .tag = .named_file,
- .value = .{
- .named_file = [2]String{
- builder.append(String, this.value.named_file[0].slice(buf)),
- builder.append(String, this.value.named_file[1].slice(buf)),
- },
- },
+ .file => {
+ return Bin{
+ .tag = .file,
+ .value = Value.init(.{ .file = builder.append(String, this.value.file.slice(buf)) }),
+ };
+ },
+ .named_file => {
+ return Bin{
+ .tag = .named_file,
+ .value = Value.init(
+ .{
+ .named_file = [2]String{
+ builder.append(String, this.value.named_file[0].slice(buf)),
+ builder.append(String, this.value.named_file[1].slice(buf)),
+ },
+ },
+ ),
+ };
},
- .dir => Bin{
- .tag = .dir,
- .value = .{ .dir = builder.append(String, this.value.dir.slice(buf)) },
+ .dir => {
+ return Bin{
+ .tag = .dir,
+ .value = Value.init(.{ .dir = builder.append(String, this.value.dir.slice(buf)) }),
+ };
},
.map => {
for (this.value.map.get(prev_external_strings), 0..) |extern_string, i| {
extern_strings_slice[i] = builder.append(ExternalString, extern_string.slice(buf));
}
- return .{
+ return Bin{
.tag = .map,
- .value = .{ .map = ExternalStringList.init(all_extern_strings, extern_strings_slice) },
+ .value = Value.init(.{ .map = ExternalStringList.init(all_extern_strings, extern_strings_slice) }),
};
},
- };
+ }
+
+ unreachable;
+ }
+
+ pub fn init() Bin {
+ return bun.serializable(.{ .tag = .none, .value = Value.init(.{ .none = {} }) });
}
pub const Value = extern union {
@@ -132,6 +152,11 @@ pub const Bin = extern struct {
/// }
///```
map: ExternalStringList,
+
+ /// To avoid undefined memory between union values, we must zero initialize the union first.
+ pub fn init(field: anytype) Value {
+ return bun.serializableInto(Value, field);
+ }
};
pub const Tag = enum(u8) {
diff --git a/src/install/dependency.zig b/src/install/dependency.zig
index 3a9ee6b54..ca0d702aa 100644
--- a/src/install/dependency.zig
+++ b/src/install/dependency.zig
@@ -49,10 +49,10 @@ version: Dependency.Version = .{},
/// - `peerDependencies`
/// Technically, having the same package name specified under multiple fields is invalid
/// But we don't want to allocate extra arrays for them. So we use a bitfield instead.
-behavior: Behavior = .uninitialized,
+behavior: Behavior = Behavior.uninitialized,
/// Sorting order for dependencies is:
-/// 1. [`dependencies`, `devDependencies`, `optionalDependencies`, `peerDependencies`]
+/// 1. [ `peerDependencies`, `optionalDependencies`, `devDependencies`, `dependencies` ]
/// 2. name ASC
/// "name" must be ASC so that later, when we rebuild the lockfile
/// we insert it back in reverse order without an extra sorting pass
@@ -147,7 +147,7 @@ pub fn toDependency(
return Dependency{
.name = name,
.name_hash = @as(u64, @bitCast(this[8..16].*)),
- .behavior = @as(Dependency.Behavior, @enumFromInt(this[16])),
+ .behavior = @bitCast(this[16]),
.version = Dependency.Version.toVersion(name, this[17..this.len].*, ctx),
};
}
@@ -156,7 +156,7 @@ pub fn toExternal(this: Dependency) External {
var bytes: External = undefined;
bytes[0..this.name.bytes.len].* = this.name.bytes;
bytes[8..16].* = @as([8]u8, @bitCast(this.name_hash));
- bytes[16] = @intFromEnum(this.behavior);
+ bytes[16] = @bitCast(this.behavior);
bytes[17..bytes.len].* = this.version.toExternal();
return bytes;
}
@@ -189,24 +189,28 @@ pub inline fn isGitHubRepoPath(dependency: string) bool {
if (dependency.len < 3) return false;
var hash_index: usize = 0;
- var slash_index: usize = 0;
+
+ // the branch could have slashes
+ // - oven-sh/bun#brach/name
+ var first_slash_index: usize = 0;
for (dependency, 0..) |c, i| {
switch (c) {
'/' => {
if (i == 0) return false;
- if (slash_index > 0) return false;
- slash_index = i;
+ if (first_slash_index == 0) {
+ first_slash_index = i;
+ }
},
'#' => {
if (i == 0) return false;
if (hash_index > 0) return false;
- if (slash_index == 0) return false;
+ if (first_slash_index == 0) return false;
hash_index = i;
},
// Not allowed in username
'.', '_' => {
- if (slash_index == 0) return false;
+ if (first_slash_index == 0) return false;
},
// Must be alphanumeric
'-', 'a'...'z', 'A'...'Z', '0'...'9' => {},
@@ -214,7 +218,31 @@ pub inline fn isGitHubRepoPath(dependency: string) bool {
}
}
- return hash_index != dependency.len - 1 and slash_index > 0 and slash_index != dependency.len - 1;
+ return hash_index != dependency.len - 1 and first_slash_index > 0 and first_slash_index != dependency.len - 1;
+}
+
+/// Github allows for the following format of URL:
+/// https://github.com/<org>/<repo>/tarball/<ref>
+/// This is a legacy (but still supported) method of retrieving a tarball of an
+/// entire source tree at some git reference. (ref = branch, tag, etc. Note: branch
+/// can have arbitrary number of slashes)
+///
+/// This also checks for a github url that ends with ".tar.gz"
+pub inline fn isGitHubTarballPath(dependency: string) bool {
+ if (isTarball(dependency)) return true;
+
+ var parts = strings.split(dependency, "/");
+
+ var n_parts: usize = 0;
+
+ while (parts.next()) |part| {
+ n_parts += 1;
+ if (n_parts == 3) {
+ return strings.eql(part, "tarball");
+ }
+ }
+
+ return false;
}
// This won't work for query string params, but I'll let someone file an issue
@@ -224,7 +252,7 @@ pub inline fn isTarball(dependency: string) bool {
}
pub const Version = struct {
- tag: Dependency.Version.Tag = .uninitialized,
+ tag: Tag = .uninitialized,
literal: String = .{},
value: Value = .{ .uninitialized = {} },
@@ -489,8 +517,33 @@ pub const Version = struct {
},
else => {},
}
+
if (strings.hasPrefixComptime(url, "github.com/")) {
- if (isGitHubRepoPath(url["github.com/".len..])) return .github;
+ const path = url["github.com/".len..];
+ if (isGitHubTarballPath(path)) return .tarball;
+ if (isGitHubRepoPath(path)) return .github;
+ }
+
+ if (strings.indexOfChar(url, '.')) |dot| {
+ if (Repository.Hosts.has(url[0..dot])) return .git;
+ }
+
+ return .tarball;
+ }
+ }
+ },
+ 's' => {
+ if (strings.hasPrefixComptime(dependency, "ssh")) {
+ var url = dependency["ssh".len..];
+ if (url.len > 2) {
+ if (url[0] == ':') {
+ if (strings.hasPrefixComptime(url, "://")) {
+ url = url["://".len..];
+ }
+ }
+
+ if (strings.indexOfChar(url, '.')) |dot| {
+ if (Repository.Hosts.has(url[0..dot])) return .git;
}
}
}
@@ -561,7 +614,7 @@ pub const Version = struct {
}
};
- const NpmInfo = struct {
+ pub const NpmInfo = struct {
name: String,
version: Semver.Query.Group,
@@ -570,7 +623,7 @@ pub const Version = struct {
}
};
- const TagInfo = struct {
+ pub const TagInfo = struct {
name: String,
tag: String,
@@ -579,7 +632,7 @@ pub const Version = struct {
}
};
- const TarballInfo = struct {
+ pub const TarballInfo = struct {
uri: URI,
package_name: String = .{},
@@ -621,7 +674,8 @@ pub inline fn parse(
sliced: *const SlicedString,
log: ?*logger.Log,
) ?Version {
- return parseWithOptionalTag(allocator, alias, dependency, null, sliced, log);
+ const dep = std.mem.trimLeft(u8, dependency, " \t\n\r");
+ return parseWithTag(allocator, alias, dep, Version.Tag.infer(dep), sliced, log);
}
pub fn parseWithOptionalTag(
@@ -839,6 +893,12 @@ pub fn parseWithTag(
.literal = sliced.value(),
.value = .{ .tarball = .{ .uri = .{ .local = sliced.sub(dependency[7..]).value() } } },
};
+ } else if (strings.hasPrefixComptime(dependency, "file:")) {
+ return .{
+ .tag = .tarball,
+ .literal = sliced.value(),
+ .value = .{ .tarball = .{ .uri = .{ .local = sliced.sub(dependency[5..]).value() } } },
+ };
} else if (strings.contains(dependency, "://")) {
if (log_) |log| log.addErrorFmt(null, logger.Loc.Empty, allocator, "invalid or unsupported dependency \"{s}\"", .{dependency}) catch unreachable;
return null;
@@ -901,78 +961,83 @@ pub fn parseWithTag(
}
}
-pub const Behavior = enum(u8) {
- uninitialized = 0,
- _,
+pub const Behavior = packed struct(u8) {
+ pub const uninitialized: Behavior = .{};
- pub const normal: u8 = 1 << 1;
- pub const optional: u8 = 1 << 2;
- pub const dev: u8 = 1 << 3;
- pub const peer: u8 = 1 << 4;
- pub const workspace: u8 = 1 << 5;
+ // these padding fields are to have compatibility
+ // with older versions of lockfile v2
+ _unused_1: u1 = 0,
+
+ normal: bool = false,
+ optional: bool = false,
+ dev: bool = false,
+ peer: bool = false,
+ workspace: bool = false,
+
+ _unused_2: u2 = 0,
+
+ pub const normal = Behavior{ .normal = true };
+ pub const optional = Behavior{ .optional = true };
+ pub const dev = Behavior{ .dev = true };
+ pub const peer = Behavior{ .peer = true };
+ pub const workspace = Behavior{ .workspace = true };
pub inline fn isNormal(this: Behavior) bool {
- return (@intFromEnum(this) & Behavior.normal) != 0;
+ return this.normal;
}
pub inline fn isOptional(this: Behavior) bool {
- return (@intFromEnum(this) & Behavior.optional) != 0 and !this.isPeer();
+ return this.optional and !this.isPeer();
}
pub inline fn isDev(this: Behavior) bool {
- return (@intFromEnum(this) & Behavior.dev) != 0;
+ return this.dev;
}
pub inline fn isPeer(this: Behavior) bool {
- return (@intFromEnum(this) & Behavior.peer) != 0;
+ return this.peer;
}
pub inline fn isWorkspace(this: Behavior) bool {
- return (@intFromEnum(this) & Behavior.workspace) != 0;
+ return this.workspace;
}
pub inline fn setNormal(this: Behavior, value: bool) Behavior {
- if (value) {
- return @as(Behavior, @enumFromInt(@intFromEnum(this) | Behavior.normal));
- } else {
- return @as(Behavior, @enumFromInt(@intFromEnum(this) & ~Behavior.normal));
- }
+ var b = this;
+ b.normal = value;
+ return b;
}
pub inline fn setOptional(this: Behavior, value: bool) Behavior {
- if (value) {
- return @as(Behavior, @enumFromInt(@intFromEnum(this) | Behavior.optional));
- } else {
- return @as(Behavior, @enumFromInt(@intFromEnum(this) & ~Behavior.optional));
- }
+ var b = this;
+ b.optional = value;
+ return b;
}
pub inline fn setDev(this: Behavior, value: bool) Behavior {
- if (value) {
- return @as(Behavior, @enumFromInt(@intFromEnum(this) | Behavior.dev));
- } else {
- return @as(Behavior, @enumFromInt(@intFromEnum(this) & ~Behavior.dev));
- }
+ var b = this;
+ b.dev = value;
+ return b;
}
pub inline fn setPeer(this: Behavior, value: bool) Behavior {
- if (value) {
- return @as(Behavior, @enumFromInt(@intFromEnum(this) | Behavior.peer));
- } else {
- return @as(Behavior, @enumFromInt(@intFromEnum(this) & ~Behavior.peer));
- }
+ var b = this;
+ b.peer = value;
+ return b;
}
pub inline fn setWorkspace(this: Behavior, value: bool) Behavior {
- if (value) {
- return @as(Behavior, @enumFromInt(@intFromEnum(this) | Behavior.workspace));
- } else {
- return @as(Behavior, @enumFromInt(@intFromEnum(this) & ~Behavior.workspace));
- }
+ var b = this;
+ b.workspace = value;
+ return b;
+ }
+
+ pub inline fn eq(lhs: Behavior, rhs: Behavior) bool {
+ return @as(u8, @bitCast(lhs)) == @as(u8, @bitCast(rhs));
}
pub inline fn cmp(lhs: Behavior, rhs: Behavior) std.math.Order {
- if (@intFromEnum(lhs) == @intFromEnum(rhs)) {
+ if (eq(lhs, rhs)) {
return .eq;
}
@@ -1025,4 +1090,42 @@ pub const Behavior = enum(u8) {
(features.peer_dependencies and this.isPeer()) or
this.isWorkspace();
}
+
+ pub fn format(self: Behavior, comptime _: []const u8, _: std.fmt.FormatOptions, writer: anytype) !void {
+ const fields = std.meta.fields(Behavior);
+ var num_fields: u8 = 0;
+ inline for (fields) |f| {
+ if (f.type == bool and @field(self, f.name)) {
+ num_fields += 1;
+ }
+ }
+ switch (num_fields) {
+ 0 => try writer.writeAll("Behavior.uninitialized"),
+ 1 => {
+ inline for (fields) |f| {
+ if (f.type == bool and @field(self, f.name)) {
+ try writer.writeAll("Behavior." ++ f.name);
+ break;
+ }
+ }
+ },
+ else => {
+ try writer.writeAll("Behavior{");
+ inline for (fields) |f| {
+ if (f.type == bool and @field(self, f.name)) {
+ try writer.writeAll(" " ++ f.name);
+ }
+ }
+ try writer.writeAll(" }");
+ },
+ }
+ }
+
+ comptime {
+ std.debug.assert(@as(u8, @bitCast(Behavior.normal)) == (1 << 1));
+ std.debug.assert(@as(u8, @bitCast(Behavior.optional)) == (1 << 2));
+ std.debug.assert(@as(u8, @bitCast(Behavior.dev)) == (1 << 3));
+ std.debug.assert(@as(u8, @bitCast(Behavior.peer)) == (1 << 4));
+ std.debug.assert(@as(u8, @bitCast(Behavior.workspace)) == (1 << 5));
+ }
};
diff --git a/src/install/extract_tarball.zig b/src/install/extract_tarball.zig
index 2bcad3a53..d0dff72c5 100644
--- a/src/install/extract_tarball.zig
+++ b/src/install/extract_tarball.zig
@@ -374,8 +374,10 @@ fn extract(this: *const ExtractTarball, tgz_bytes: []const u8) !Install.ExtractD
}
const ret_json_path = try FileSystem.instance.dirname_store.append(@TypeOf(json_path), json_path);
+ const url = try FileSystem.instance.dirname_store.append(@TypeOf(this.url.slice()), this.url.slice());
+
return .{
- .url = this.url.slice(),
+ .url = url,
.resolved = resolved,
.json_path = ret_json_path,
.json_buf = json_buf,
diff --git a/src/install/install.zig b/src/install/install.zig
index d455e5670..4a20d1b9f 100644
--- a/src/install/install.zig
+++ b/src/install/install.zig
@@ -125,8 +125,8 @@ pub fn ExternalSlice(comptime Type: type) type {
pub fn ExternalSliceAligned(comptime Type: type, comptime alignment_: ?u29) type {
return extern struct {
- const alignment = alignment_ orelse @alignOf(*Type);
- const Slice = @This();
+ pub const alignment = alignment_ orelse @alignOf(*Type);
+ pub const Slice = @This();
pub const Child: type = Type;
@@ -172,7 +172,7 @@ pub const ExternalStringMap = extern struct {
value: ExternalStringList = .{},
};
-pub const PackageNameHash = u64;
+pub const PackageNameHash = u64; // Use String.Builder.stringHash to compute this
pub const Aligner = struct {
pub fn write(comptime Type: type, comptime Writer: type, writer: Writer, pos: usize) !usize {
@@ -254,16 +254,29 @@ const NetworkTask = struct {
warn_on_error: bool,
) !void {
this.url_buf = blk: {
+
+ // Not all registries support scoped package names when fetching the manifest.
+ // registry.npmjs.org supports both "@storybook%2Faddons" and "@storybook/addons"
+ // Other registries like AWS codeartifact only support the former.
+ // "npm" CLI requests the manifest with the encoded name.
+ var arena = std.heap.ArenaAllocator.init(bun.default_allocator);
+ defer arena.deinit();
+ var stack_fallback_allocator = std.heap.stackFallback(512, arena.allocator());
+ var encoded_name = name;
+ if (strings.containsChar(name, '/')) {
+ encoded_name = try std.mem.replaceOwned(u8, stack_fallback_allocator.get(), name, "/", "%2f");
+ }
+
const tmp = bun.JSC.URL.join(
bun.String.fromUTF8(scope.url.href),
- bun.String.fromUTF8(name),
+ bun.String.fromUTF8(encoded_name),
);
defer tmp.deref();
if (tmp.tag == .Dead) {
const msg = .{
- .fmt = "Failed to join registry \"{s}\" and package \"{s}\" URLs",
- .args = .{ scope.url.href, name },
+ .fmt = "Failed to join registry {} and package {} URLs",
+ .args = .{ strings.QuotedFormatter{ .text = scope.url.href }, strings.QuotedFormatter{ .text = name } },
};
if (warn_on_error)
@@ -347,6 +360,10 @@ const NetworkTask = struct {
);
this.http.client.reject_unauthorized = this.package_manager.tlsRejectUnauthorized();
+ if (PackageManager.verbose_install) {
+ this.http.client.verbose = true;
+ }
+
this.callback = .{
.package_manifest = .{
.name = try strings.StringOrTinyString.initAppendIfNeeded(name, *FileSystem.FilenameStore, &FileSystem.FilenameStore.instance),
@@ -426,6 +443,9 @@ const NetworkTask = struct {
null,
);
this.http.client.reject_unauthorized = this.package_manager.tlsRejectUnauthorized();
+ if (PackageManager.verbose_install) {
+ this.http.client.verbose = true;
+ }
this.callback = .{ .extract = tarball };
}
@@ -1072,6 +1092,7 @@ const PackageInstall = struct {
)) {
0 => {},
else => |errno| switch (std.os.errno(errno)) {
+ .XDEV => return error.NotSupported, // not same file system
.OPNOTSUPP => return error.NotSupported,
.NOENT => return error.FileNotFound,
// sometimes the downlowded npm package has already node_modules with it, so just ignore exist error here
@@ -1130,6 +1151,7 @@ const PackageInstall = struct {
)) {
0 => .{ .success = {} },
else => |errno| switch (std.os.errno(errno)) {
+ .XDEV => error.NotSupported, // not same file system
.OPNOTSUPP => error.NotSupported,
.NOENT => error.FileNotFound,
// We first try to delete the directory
@@ -1683,6 +1705,9 @@ pub const PackageManager = struct {
cpu_count: u32 = 0,
package_json_updates: []UpdateRequest = &[_]UpdateRequest{},
+ // used for looking up workspaces that aren't loaded into Lockfile.workspace_paths
+ workspaces: std.StringArrayHashMap(?Semver.Version),
+
// progress bar stuff when not stack allocated
root_progress_node: *std.Progress.Node = undefined,
root_download_node: std.Progress.Node = undefined,
@@ -1722,6 +1747,9 @@ pub const PackageManager = struct {
wait_count: std.atomic.Atomic(usize) = std.atomic.Atomic(usize).init(0),
onWake: WakeHandler = .{},
+ ci_mode: bun.LazyBool(computeIsContinuousIntegration, @This(), "ci_mode") = .{},
+
+ peer_dependencies: std.ArrayListUnmanaged(DependencyID) = .{},
uws_event_loop: *uws.Loop,
file_poll_store: JSC.FilePoll.Store,
@@ -1745,6 +1773,14 @@ pub const PackageManager = struct {
return this.env.getTLSRejectUnauthorized();
}
+ pub fn computeIsContinuousIntegration(this: *PackageManager) bool {
+ return this.env.isCI();
+ }
+
+ pub inline fn isContinuousIntegration(this: *PackageManager) bool {
+ return this.ci_mode.get();
+ }
+
pub const WakeHandler = struct {
// handler: fn (ctx: *anyopaque, pm: *PackageManager) void = undefined,
// onDependencyError: fn (ctx: *anyopaque, Dependency, PackageID, anyerror) void = undefined,
@@ -1783,7 +1819,7 @@ pub const PackageManager = struct {
pub fn sleep(this: *PackageManager) void {
if (this.wait_count.swap(0, .Monotonic) > 0) return;
- bun.Mimalloc.mi_collect(false);
+ Output.flush();
_ = this.waiter.wait() catch 0;
}
@@ -1834,6 +1870,7 @@ pub const PackageManager = struct {
dep_id,
&this.lockfile.buffers.dependencies.items[dep_id],
invalid_package_id,
+ false,
assignRootResolution,
failRootResolution,
) catch |err| {
@@ -1848,7 +1885,7 @@ pub const PackageManager = struct {
switch (this.options.log_level) {
inline else => |log_level| {
if (log_level.showProgress()) this.startProgressBarIfNone();
- while (this.pending_tasks > 0) : (this.sleep()) {
+ while (this.pending_tasks > 0) {
this.runTasks(
void,
{},
@@ -1858,10 +1895,18 @@ pub const PackageManager = struct {
.onPackageManifestError = {},
.onPackageDownloadError = {},
},
+ false,
log_level,
) catch |err| {
return .{ .failure = err };
};
+
+ if (PackageManager.verbose_install and this.pending_tasks > 0) {
+ Output.prettyErrorln("<d>[PackageManager]<r> waiting for {d} tasks\n", .{this.pending_tasks});
+ }
+
+ if (this.pending_tasks > 0)
+ this.sleep();
}
},
}
@@ -1914,6 +1959,47 @@ pub const PackageManager = struct {
@memset(this.preinstall_state.items[offset..], PreinstallState.unknown);
}
+ pub fn formatLaterVersionInCache(
+ this: *PackageManager,
+ name: []const u8,
+ name_hash: PackageNameHash,
+ resolution: Resolution,
+ ) ?Semver.Version.Formatter {
+ switch (resolution.tag) {
+ Resolution.Tag.npm => {
+ if (resolution.value.npm.version.tag.hasPre())
+ // TODO:
+ return null;
+
+ // We skip this in CI because we don't want any performance impact in an environment you'll probably never use
+ // and it makes tests more consistent
+ if (this.isContinuousIntegration())
+ return null;
+
+ const manifest: *const Npm.PackageManifest = this.manifests.getPtr(name_hash) orelse brk: {
+ if (Npm.PackageManifest.Serializer.load(this.allocator, this.getCacheDirectory(), name) catch null) |manifest_| {
+ this.manifests.put(this.allocator, name_hash, manifest_) catch return null;
+ break :brk this.manifests.getPtr(name_hash).?;
+ }
+
+ return null;
+ };
+
+ if (manifest.findByDistTag("latest")) |latest_version| {
+ if (latest_version.version.order(
+ resolution.value.npm.version,
+ manifest.string_buf,
+ this.lockfile.buffers.string_bytes.items,
+ ) != .gt) return null;
+ return latest_version.version.fmt(manifest.string_buf);
+ }
+
+ return null;
+ },
+ else => return null,
+ }
+ }
+
pub fn setPreinstallState(this: *PackageManager, package_id: PackageID, lockfile: *Lockfile, value: PreinstallState) void {
this.ensurePreinstallStateListCapacity(lockfile.packages.len) catch return;
this.preinstall_state.items[package_id] = value;
@@ -2111,20 +2197,27 @@ pub const PackageManager = struct {
}
fn allocGitHubURL(this: *const PackageManager, repository: *const Repository) string {
- var github_api_domain: string = "api.github.com";
- if (this.env.map.get("GITHUB_API_DOMAIN")) |api_domain| {
- if (api_domain.len > 0) {
- github_api_domain = api_domain;
+ var github_api_url: string = "https://api.github.com";
+ if (this.env.map.get("GITHUB_API_URL")) |url| {
+ if (url.len > 0) {
+ github_api_url = url;
}
}
+
+ const owner = this.lockfile.str(&repository.owner);
+ const repo = this.lockfile.str(&repository.repo);
+ const committish = this.lockfile.str(&repository.committish);
+
return std.fmt.allocPrint(
this.allocator,
- "https://{s}/repos/{s}/{s}/tarball/{s}",
+ "{s}/repos/{s}/{s}{s}tarball/{s}",
.{
- github_api_domain,
- this.lockfile.str(&repository.owner),
- this.lockfile.str(&repository.repo),
- this.lockfile.str(&repository.committish),
+ strings.withoutTrailingSlash(github_api_url),
+ owner,
+ repo,
+ // repo might be empty if dep is https://github.com/... style
+ if (repo.len > 0) "/" else "",
+ committish,
},
) catch unreachable;
}
@@ -2447,13 +2540,14 @@ pub const PackageManager = struct {
behavior: Behavior,
manifest: *const Npm.PackageManifest,
find_result: Npm.PackageManifest.FindResult,
+ install_peer: bool,
comptime successFn: SuccessFn,
) !?ResolvedPackageResult {
// Was this package already allocated? Let's reuse the existing one.
if (this.lockfile.getPackageID(
name_hash,
- if (behavior.isPeer()) version else null,
+ if (behavior.isPeer() and !install_peer) version else null,
&.{
.tag = .npm,
.value = .{
@@ -2469,7 +2563,7 @@ pub const PackageManager = struct {
.package = this.lockfile.packages.get(id),
.is_first_time = false,
};
- } else if (behavior.isPeer()) {
+ } else if (behavior.isPeer() and !install_peer) {
return null;
}
@@ -2574,7 +2668,7 @@ pub const PackageManager = struct {
if (comptime Environment.allow_assert) {
std.debug.assert(dependency_id < buffers.resolutions.items.len);
std.debug.assert(package_id < this.lockfile.packages.len);
- std.debug.assert(buffers.resolutions.items[dependency_id] == invalid_package_id);
+ // std.debug.assert(buffers.resolutions.items[dependency_id] == invalid_package_id);
}
buffers.resolutions.items[dependency_id] = package_id;
const string_buf = buffers.string_bytes.items;
@@ -2609,6 +2703,7 @@ pub const PackageManager = struct {
behavior: Behavior,
dependency_id: DependencyID,
resolution: PackageID,
+ install_peer: bool,
comptime successFn: SuccessFn,
) !?ResolvedPackageResult {
name.assertDefined();
@@ -2619,6 +2714,29 @@ pub const PackageManager = struct {
switch (version.tag) {
.npm, .dist_tag => {
+ if (version.tag == .npm) {
+ if (this.lockfile.workspace_versions.count() > 0) resolve_from_workspace: {
+ if (this.lockfile.workspace_versions.get(name_hash)) |workspace_version| {
+ if (version.value.npm.version.satisfies(workspace_version)) {
+ const root_package = this.lockfile.rootPackage() orelse break :resolve_from_workspace;
+ const root_dependencies = root_package.dependencies.get(this.lockfile.buffers.dependencies.items);
+ const root_resolutions = root_package.resolutions.get(this.lockfile.buffers.resolutions.items);
+
+ for (root_dependencies, root_resolutions) |root_dep, workspace_package_id| {
+ if (workspace_package_id != invalid_package_id and root_dep.version.tag == .workspace and root_dep.name_hash == name_hash) {
+ // make sure verifyResolutions sees this resolution as a valid package id
+ this.lockfile.buffers.resolutions.items[dependency_id] = workspace_package_id;
+ return .{
+ .package = this.lockfile.packages.get(workspace_package_id),
+ .is_first_time = false,
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+
// Resolve the version from the loaded NPM manifest
const manifest = this.manifests.getPtr(name_hash) orelse return null; // manifest might still be downloading. This feels unreliable.
const find_result: Npm.PackageManifest.FindResult = switch (version.tag) {
@@ -2639,6 +2757,7 @@ pub const PackageManager = struct {
behavior,
manifest,
find_result,
+ install_peer,
successFn,
);
},
@@ -2661,8 +2780,8 @@ pub const PackageManager = struct {
}
},
.workspace => {
- // relative to cwd
- const workspace_path: *const String = this.lockfile.workspace_paths.getPtr(@truncate(String.Builder.stringHash(this.lockfile.str(&version.value.workspace)))) orelse &version.value.workspace;
+ // package name hash should be used to find workspace path from map
+ const workspace_path: *const String = this.lockfile.workspace_paths.getPtr(@truncate(name_hash)) orelse &version.value.workspace;
const res = FolderResolution.getOrPut(.{ .relative = .workspace }, version, this.lockfile.str(workspace_path), this);
@@ -2912,16 +3031,20 @@ pub const PackageManager = struct {
/// This must be a *const to prevent UB
dependency: *const Dependency,
resolution: PackageID,
+ install_peer: bool,
) !void {
return this.enqueueDependencyWithMainAndSuccessFn(
id,
dependency,
resolution,
+ install_peer,
assignResolution,
null,
);
}
+ const debug = Output.scoped(.PackageManager, true);
+
/// Q: "What do we do with a dependency in a package.json?"
/// A: "We enqueue it!"
fn enqueueDependencyWithMainAndSuccessFn(
@@ -2930,19 +3053,35 @@ pub const PackageManager = struct {
/// This must be a *const to prevent UB
dependency: *const Dependency,
resolution: PackageID,
+ install_peer: bool,
comptime successFn: SuccessFn,
comptime failFn: ?FailFn,
) !void {
- const name = dependency.realname();
+ var name = dependency.realname();
- const name_hash = switch (dependency.version.tag) {
- .dist_tag, .git, .github, .npm, .tarball => String.Builder.stringHash(this.lockfile.str(&name)),
+ var name_hash = switch (dependency.version.tag) {
+ .dist_tag, .git, .github, .npm, .tarball, .workspace => String.Builder.stringHash(this.lockfile.str(&name)),
else => dependency.name_hash,
};
- const version = dependency.version;
+ const version = version: {
+ if (this.lockfile.overrides.get(name_hash)) |new| {
+ debug("override: {s} -> {s}", .{ this.lockfile.str(&dependency.version.literal), this.lockfile.str(&new.literal) });
+ name = switch (new.tag) {
+ .dist_tag => new.value.dist_tag.name,
+ .git => new.value.git.package_name,
+ .github => new.value.github.package_name,
+ .npm => new.value.npm.name,
+ .tarball => new.value.tarball.package_name,
+ else => name,
+ };
+ name_hash = String.Builder.stringHash(this.lockfile.str(&name));
+ break :version new;
+ }
+ break :version dependency.version;
+ };
var loaded_manifest: ?Npm.PackageManifest = null;
- switch (dependency.version.tag) {
+ switch (version.tag) {
.dist_tag, .folder, .npm => {
retry_from_manifests_ptr: while (true) {
var resolve_result_ = this.getOrPutResolvedPackage(
@@ -2952,6 +3091,7 @@ pub const PackageManager = struct {
dependency.behavior,
id,
resolution,
+ install_peer,
successFn,
);
@@ -3048,13 +3188,37 @@ pub const PackageManager = struct {
this.enqueueNetworkTask(network_task);
}
}
- } else if (dependency.version.tag.isNPM()) {
+
+ if (comptime Environment.allow_assert)
+ debug(
+ "enqueueDependency({d}, {s}, {s}, {s}) = {d}",
+ .{
+ id,
+ @tagName(version.tag),
+ this.lockfile.str(&name),
+ this.lockfile.str(&version.literal),
+ result.package.meta.id,
+ },
+ );
+ } else if (version.tag.isNPM()) {
const name_str = this.lockfile.str(&name);
const task_id = Task.Id.forManifest(name_str);
if (comptime Environment.allow_assert) std.debug.assert(task_id != 0);
- if (!dependency.behavior.isPeer()) {
+ if (comptime Environment.allow_assert)
+ debug(
+ "enqueueDependency({d}, {s}, {s}, {s}) = task {d}",
+ .{
+ id,
+ @tagName(version.tag),
+ this.lockfile.str(&name),
+ this.lockfile.str(&version.literal),
+ task_id,
+ },
+ );
+
+ if (!dependency.behavior.isPeer() or install_peer) {
var network_entry = try this.network_dedupe_map.getOrPutContext(this.allocator, task_id, .{});
if (!network_entry.found_existing) {
if (this.options.enable.manifest_cache) {
@@ -3068,8 +3232,8 @@ pub const PackageManager = struct {
// If it's an exact package version already living in the cache
// We can skip the network request, even if it's beyond the caching period
- if (dependency.version.tag == .npm and dependency.version.value.npm.version.isExact()) {
- if (loaded_manifest.?.findByVersion(dependency.version.value.npm.version.head.head.range.left.version)) |find_result| {
+ if (version.tag == .npm and version.value.npm.version.isExact()) {
+ if (loaded_manifest.?.findByVersion(version.value.npm.version.head.head.range.left.version)) |find_result| {
if (this.getOrPutResolvedPackageWithFindResult(
name_hash,
name,
@@ -3078,6 +3242,7 @@ pub const PackageManager = struct {
dependency.behavior,
&loaded_manifest.?,
find_result,
+ install_peer,
successFn,
) catch null) |new_resolve_result| {
resolve_result_ = new_resolve_result;
@@ -3115,6 +3280,10 @@ pub const PackageManager = struct {
);
this.enqueueNetworkTask(network_task);
}
+ } else {
+ if (this.options.do.install_peer_dependencies) {
+ try this.peer_dependencies.append(this.allocator, id);
+ }
}
var manifest_entry_parse = try this.task_queue.getOrPutContext(this.allocator, task_id, .{});
@@ -3131,7 +3300,7 @@ pub const PackageManager = struct {
return;
},
.git => {
- const dep = &dependency.version.value.git;
+ const dep = &version.value.git;
const res = Resolution{
.tag = .git,
.value = .{
@@ -3154,6 +3323,18 @@ pub const PackageManager = struct {
id,
);
+ if (comptime Environment.allow_assert)
+ debug(
+ "enqueueDependency({d}, {s}, {s}, {s}) = {s}",
+ .{
+ id,
+ @tagName(version.tag),
+ this.lockfile.str(&name),
+ this.lockfile.str(&version.literal),
+ url,
+ },
+ );
+
if (this.git_repositories.get(clone_id)) |repo_fd| {
const resolved = try Repository.findCommit(
this.allocator,
@@ -3198,7 +3379,7 @@ pub const PackageManager = struct {
}
},
.github => {
- const dep = &dependency.version.value.github;
+ const dep = &version.value.github;
const res = Resolution{
.tag = .github,
.value = .{
@@ -3220,6 +3401,18 @@ pub const PackageManager = struct {
entry.value_ptr.* = TaskCallbackList{};
}
+ if (comptime Environment.allow_assert)
+ debug(
+ "enqueueDependency({d}, {s}, {s}, {s}) = {s}",
+ .{
+ id,
+ @tagName(version.tag),
+ this.lockfile.str(&name),
+ this.lockfile.str(&version.literal),
+ url,
+ },
+ );
+
const callback_tag = comptime if (successFn == assignRootResolution) "root_dependency" else "dependency";
try entry.value_ptr.append(this.allocator, @unionInit(TaskCallbackContext, callback_tag, id));
@@ -3240,6 +3433,7 @@ pub const PackageManager = struct {
dependency.behavior,
id,
resolution,
+ install_peer,
successFn,
) catch |err| brk: {
if (err == error.MissingPackageJSON) {
@@ -3287,6 +3481,18 @@ pub const PackageManager = struct {
// should not trigger a network call
if (comptime Environment.allow_assert) std.debug.assert(result.network_task == null);
+
+ if (comptime Environment.allow_assert)
+ debug(
+ "enqueueDependency({d}, {s}, {s}, {s}) = {d}",
+ .{
+ id,
+ @tagName(version.tag),
+ this.lockfile.str(&name),
+ this.lockfile.str(&version.literal),
+ result.package.meta.id,
+ },
+ );
} else if (dependency.behavior.isRequired()) {
if (comptime dependency_tag == .workspace) {
this.log.addErrorFmt(
@@ -3336,7 +3542,7 @@ pub const PackageManager = struct {
}
},
.tarball => {
- const res: Resolution = switch (dependency.version.value.tarball.uri) {
+ const res: Resolution = switch (version.value.tarball.uri) {
.local => |path| .{
.tag = .local_tarball,
.value = .{
@@ -3357,7 +3563,7 @@ pub const PackageManager = struct {
return;
}
- const url = switch (dependency.version.value.tarball.uri) {
+ const url = switch (version.value.tarball.uri) {
.local => |path| this.lockfile.str(&path),
.remote => |url| this.lockfile.str(&url),
};
@@ -3367,11 +3573,23 @@ pub const PackageManager = struct {
entry.value_ptr.* = TaskCallbackList{};
}
+ if (comptime Environment.allow_assert)
+ debug(
+ "enqueueDependency({d}, {s}, {s}, {s}) = {s}",
+ .{
+ id,
+ @tagName(version.tag),
+ this.lockfile.str(&name),
+ this.lockfile.str(&version.literal),
+ url,
+ },
+ );
+
const callback_tag = comptime if (successFn == assignRootResolution) "root_dependency" else "dependency";
try entry.value_ptr.append(this.allocator, @unionInit(TaskCallbackContext, callback_tag, id));
if (dependency.behavior.isPeer()) return;
- switch (dependency.version.value.tarball.uri) {
+ switch (version.value.tarball.uri) {
.local => {
const network_entry = try this.network_dedupe_map.getOrPutContext(this.allocator, task_id, .{});
if (network_entry.found_existing) return;
@@ -3420,6 +3638,7 @@ pub const PackageManager = struct {
i,
&dependency,
lockfile.buffers.resolutions.items[i],
+ false,
) catch {};
}
}
@@ -3459,8 +3678,36 @@ pub const PackageManager = struct {
const lockfile = this.lockfile;
// Step 1. Go through main dependencies
- var i = dependencies_list.off;
+ var begin = dependencies_list.off;
const end = dependencies_list.off +| dependencies_list.len;
+
+ // if dependency is peer and is going to be installed
+ // through "dependencies", skip it
+ if (end - begin > 1 and lockfile.buffers.dependencies.items[0].behavior.isPeer()) {
+ var peer_i: usize = 0;
+ var peer = &lockfile.buffers.dependencies.items[peer_i];
+ while (peer.behavior.isPeer()) {
+ var dep_i: usize = end - 1;
+ var dep = lockfile.buffers.dependencies.items[dep_i];
+ while (!dep.behavior.isPeer()) {
+ if (!dep.behavior.isDev()) {
+ if (peer.name_hash == dep.name_hash) {
+ peer.* = lockfile.buffers.dependencies.items[begin];
+ begin += 1;
+ break;
+ }
+ }
+ dep_i -= 1;
+ dep = lockfile.buffers.dependencies.items[dep_i];
+ }
+ peer_i += 1;
+ if (peer_i == end) break;
+ peer = &lockfile.buffers.dependencies.items[peer_i];
+ }
+ }
+
+ var i = begin;
+
// we have to be very careful with pointers here
while (i < end) : (i += 1) {
const dependency = lockfile.buffers.dependencies.items[i];
@@ -3469,6 +3716,7 @@ pub const PackageManager = struct {
i,
&dependency,
resolution,
+ false,
) catch |err| {
const note = .{
.fmt = "error occured while resolving {s}",
@@ -3499,7 +3747,12 @@ pub const PackageManager = struct {
_ = this.scheduleTasks();
}
- fn processDependencyListItem(this: *PackageManager, item: TaskCallbackContext, any_root: ?*bool) !void {
+ fn processDependencyListItem(
+ this: *PackageManager,
+ item: TaskCallbackContext,
+ any_root: ?*bool,
+ install_peer: bool,
+ ) !void {
switch (item) {
.dependency => |dependency_id| {
const dependency = this.lockfile.buffers.dependencies.items[dependency_id];
@@ -3509,6 +3762,7 @@ pub const PackageManager = struct {
dependency_id,
&dependency,
resolution,
+ install_peer,
);
},
.root_dependency => |dependency_id| {
@@ -3519,6 +3773,7 @@ pub const PackageManager = struct {
dependency_id,
&dependency,
resolution,
+ install_peer,
assignRootResolution,
failRootResolution,
);
@@ -3533,18 +3788,37 @@ pub const PackageManager = struct {
}
}
+ fn processPeerDependencyList(
+ this: *PackageManager,
+ ) !void {
+ if (this.peer_dependencies.items.len > 0) {
+ for (this.peer_dependencies.items) |peer_dependency_id| {
+ try this.processDependencyListItem(.{ .dependency = peer_dependency_id }, null, true);
+ const dependency = this.lockfile.buffers.dependencies.items[peer_dependency_id];
+ const resolution = this.lockfile.buffers.resolutions.items[peer_dependency_id];
+ try this.enqueueDependencyWithMain(
+ peer_dependency_id,
+ &dependency,
+ resolution,
+ true,
+ );
+ }
+ }
+ }
+
fn processDependencyList(
this: *PackageManager,
dep_list: TaskCallbackList,
comptime Context: type,
ctx: Context,
comptime callbacks: anytype,
+ install_peer: bool,
) !void {
if (dep_list.items.len > 0) {
var dependency_list = dep_list;
var any_root = false;
for (dependency_list.items) |item| {
- try this.processDependencyListItem(item, &any_root);
+ try this.processDependencyListItem(item, &any_root, install_peer);
}
if (comptime @TypeOf(callbacks) != void and @TypeOf(callbacks.onResolve) != void) {
@@ -3744,6 +4018,7 @@ pub const PackageManager = struct {
comptime ExtractCompletionContext: type,
extract_ctx: ExtractCompletionContext,
comptime callbacks: anytype,
+ install_peer: bool,
comptime log_level: Options.LogLevel,
) anyerror!void {
var has_updated_this_run = false;
@@ -3835,10 +4110,10 @@ pub const PackageManager = struct {
switch (response.status_code) {
404 => {
if (comptime log_level != .silent) {
- const fmt = "\n<r><red>error<r>: package <b>\"{s}\"<r> not found <d>{s}{s} 404<r>\n";
+ const fmt = "\n<r><red>error<r>: package <b>\"{s}\"<r> not found <d>{}{s} 404<r>\n";
const args = .{
name.slice(),
- task.http.url.displayHostname(),
+ task.http.url.displayHost(),
task.http.url.pathname,
};
@@ -3852,10 +4127,10 @@ pub const PackageManager = struct {
},
401 => {
if (comptime log_level != .silent) {
- const fmt = "\n<r><red>error<r>: unauthorized <b>\"{s}\"<r> <d>{s}{s} 401<r>\n";
+ const fmt = "\n<r><red>error<r>: unauthorized <b>\"{s}\"<r> <d>{}{s} 401<r>\n";
const args = .{
name.slice(),
- task.http.url.displayHostname(),
+ task.http.url.displayHost(),
task.http.url.pathname,
};
@@ -3939,7 +4214,7 @@ pub const PackageManager = struct {
var dependency_list = dependency_list_entry.value_ptr.*;
dependency_list_entry.value_ptr.* = .{};
- try manager.processDependencyList(dependency_list, ExtractCompletionContext, extract_ctx, callbacks);
+ try manager.processDependencyList(dependency_list, ExtractCompletionContext, extract_ctx, callbacks, install_peer);
continue;
}
@@ -4116,7 +4391,7 @@ pub const PackageManager = struct {
var dependency_list = dependency_list_entry.value_ptr.*;
dependency_list_entry.value_ptr.* = .{};
- try manager.processDependencyList(dependency_list, ExtractCompletionContext, extract_ctx, callbacks);
+ try manager.processDependencyList(dependency_list, ExtractCompletionContext, extract_ctx, callbacks, install_peer);
if (comptime log_level.showProgress()) {
if (!has_updated_this_run) {
@@ -4202,7 +4477,7 @@ pub const PackageManager = struct {
},
else => unreachable,
}
- try manager.processDependencyListItem(dep, &any_root);
+ try manager.processDependencyListItem(dep, &any_root, install_peer);
},
else => {
// if it's a node_module folder to install, handle that after we process all the dependencies within the onExtract callback.
@@ -4217,12 +4492,15 @@ pub const PackageManager = struct {
var dependency_list = dependency_list_entry.value_ptr.*;
dependency_list_entry.value_ptr.* = .{};
- try manager.processDependencyList(dependency_list, void, {}, {});
+ try manager.processDependencyList(dependency_list, void, {}, {}, install_peer);
}
manager.setPreinstallState(package_id, manager.lockfile, .done);
if (comptime @TypeOf(callbacks.onExtract) != void) {
+ if (ExtractCompletionContext == *PackageInstaller) {
+ extract_ctx.fixCachedLockfilePackageSlices();
+ }
callbacks.onExtract(extract_ctx, dependency_id, task.data.extract, comptime log_level);
}
@@ -4268,7 +4546,7 @@ pub const PackageManager = struct {
var dependency_list = dependency_list_entry.value_ptr.*;
dependency_list_entry.value_ptr.* = .{};
- try manager.processDependencyList(dependency_list, ExtractCompletionContext, extract_ctx, callbacks);
+ try manager.processDependencyList(dependency_list, ExtractCompletionContext, extract_ctx, callbacks, install_peer);
if (comptime log_level.showProgress()) {
if (!has_updated_this_run) {
@@ -4328,7 +4606,7 @@ pub const PackageManager = struct {
var repo = &manager.lockfile.buffers.dependencies.items[id].version.value.git;
repo.resolved = pkg.resolution.value.git.resolved;
repo.package_name = pkg.name;
- try manager.processDependencyListItem(dep, &any_root);
+ try manager.processDependencyListItem(dep, &any_root, install_peer);
},
else => {
// if it's a node_module folder to install, handle that after we process all the dependencies within the onExtract callback.
@@ -4385,7 +4663,6 @@ pub const PackageManager = struct {
bin_path: stringZ = "node_modules/.bin",
lockfile_path: stringZ = Lockfile.default_filename,
- save_lockfile_path: stringZ = Lockfile.default_filename,
did_override_default_scope: bool = false,
scope: Npm.Registry.Scope = undefined,
@@ -4533,9 +4810,8 @@ pub const PackageManager = struct {
env: *DotEnv.Loader,
cli_: ?CommandLineArguments,
bun_install_: ?*Api.BunInstall,
+ subcommand: Subcommand,
) !void {
- this.save_lockfile_path = this.lockfile_path;
-
var base = Api.NpmRegistry{
.url = "",
.username = "",
@@ -4596,6 +4872,7 @@ pub const PackageManager = struct {
}
if (bun_install.save_peer) |save| {
+ this.do.install_peer_dependencies = save;
this.remote_package_features.peer_dependencies = save;
}
@@ -4623,19 +4900,6 @@ pub const PackageManager = struct {
this.local_package_features.optional_dependencies = save;
}
- if (bun_install.lockfile_path) |save| {
- if (save.len > 0) {
- this.lockfile_path = try allocator.dupeZ(u8, save);
- this.save_lockfile_path = this.lockfile_path;
- }
- }
-
- if (bun_install.save_lockfile_path) |save| {
- if (save.len > 0) {
- this.save_lockfile_path = try allocator.dupeZ(u8, save);
- }
- }
-
this.explicit_global_directory = bun_install.global_dir orelse this.explicit_global_directory;
}
@@ -4716,14 +4980,6 @@ pub const PackageManager = struct {
if (cli.token.len > 0) {
this.scope.token = cli.token;
}
-
- if (cli.lockfile.len > 0) {
- this.lockfile_path = try allocator.dupeZ(u8, cli.lockfile);
- }
- }
-
- if (env.map.get("BUN_CONFIG_LOCKFILE_SAVE_PATH")) |save_lockfile_path| {
- this.save_lockfile_path = try allocator.dupeZ(u8, save_lockfile_path);
}
if (env.map.get("BUN_CONFIG_YARN_LOCKFILE") != null) {
@@ -4772,6 +5028,12 @@ pub const PackageManager = struct {
this.do.verify_integrity = !strings.eqlComptime(check_bool, "0");
}
+ // Update should never read from manifest cache
+ if (subcommand == .update) {
+ this.enable.manifest_cache = false;
+ this.enable.manifest_cache_control = false;
+ }
+
if (cli_) |cli| {
if (cli.no_save) {
this.do.save_lockfile = false;
@@ -4881,6 +5143,7 @@ pub const PackageManager = struct {
print_meta_hash_string: bool = false,
verify_integrity: bool = true,
summary: bool = true,
+ install_peer_dependencies: bool = true,
};
pub const Enable = struct {
@@ -5203,21 +5466,22 @@ pub const PackageManager = struct {
bun.copy(u8, &cwd_buf, original_cwd);
+ var workspace_names = Package.WorkspaceMap.init(ctx.allocator);
+
// Step 1. Find the nearest package.json directory
//
- // We will walk up from the cwd, calling chdir on each directory until we find a package.json
- // If we fail to find one, we will report an error saying no packages to install
+ // We will walk up from the cwd, trying to find the nearest package.json file.
const package_json_file = brk: {
var this_cwd = original_cwd;
const child_json = child: {
while (true) {
- var dir = std.fs.openDirAbsolute(this_cwd, .{}) catch |err| {
- Output.prettyErrorln("Error {s} accessing {s}", .{ @errorName(err), this_cwd });
- Output.flush();
- return err;
- };
- defer dir.close();
- break :child dir.openFileZ("package.json", .{ .mode = .read_write }) catch {
+ const this_cwd_without_trailing_slash = strings.withoutTrailingSlash(this_cwd);
+ var buf2: [bun.MAX_PATH_BYTES + 1]u8 = undefined;
+ @memcpy(buf2[0..this_cwd_without_trailing_slash.len], this_cwd_without_trailing_slash);
+ buf2[this_cwd_without_trailing_slash.len..buf2.len][0.."/package.json".len].* = "/package.json".*;
+ buf2[this_cwd_without_trailing_slash.len + "/package.json".len] = 0;
+
+ break :child std.fs.cwd().openFileZ(buf2[0 .. this_cwd_without_trailing_slash.len + "/package.json".len :0].ptr, .{ .mode = .read_write }) catch {
if (std.fs.path.dirname(this_cwd)) |parent| {
this_cwd = parent;
continue;
@@ -5233,9 +5497,13 @@ pub const PackageManager = struct {
// Check if this is a workspace; if so, use root package
var found = false;
while (std.fs.path.dirname(this_cwd)) |parent| : (this_cwd = parent) {
- var dir = std.fs.openDirAbsolute(parent, .{}) catch break;
- defer dir.close();
- const json_file = dir.openFileZ("package.json", .{ .mode = .read_write }) catch {
+ const parent_without_trailing_slash = strings.withoutTrailingSlash(parent);
+ var buf2: [bun.MAX_PATH_BYTES + 1]u8 = undefined;
+ @memcpy(buf2[0..parent_without_trailing_slash.len], parent_without_trailing_slash);
+ buf2[parent_without_trailing_slash.len..buf2.len][0.."/package.json".len].* = "/package.json".*;
+ buf2[parent_without_trailing_slash.len + "/package.json".len] = 0;
+
+ const json_file = std.fs.cwd().openFileZ(buf2[0 .. parent_without_trailing_slash.len + "/package.json".len :0].ptr, .{ .mode = .read_write }) catch {
continue;
};
defer if (!found) json_file.close();
@@ -5248,8 +5516,6 @@ pub const PackageManager = struct {
initializeStore();
const json = try json_parser.ParseJSONUTF8(&json_source, ctx.log, ctx.allocator);
if (json.asProperty("workspaces")) |prop| {
- var workspace_names = Package.WorkspaceMap.init(ctx.allocator);
- defer workspace_names.deinit();
const json_array = switch (prop.expr.data) {
.e_array => |arr| arr,
.e_object => |obj| if (obj.get("packages")) |packages| switch (packages.data) {
@@ -5260,7 +5526,7 @@ pub const PackageManager = struct {
};
var log = logger.Log.init(ctx.allocator);
defer log.deinit();
- _ = Package.processWorkspaceNamesArray(
+ const workspace_packages_count = Package.processWorkspaceNamesArray(
&workspace_names,
ctx.allocator,
&log,
@@ -5269,6 +5535,7 @@ pub const PackageManager = struct {
prop.loc,
null,
) catch break;
+ _ = workspace_packages_count;
for (workspace_names.keys()) |path| {
if (strings.eql(child_cwd, path)) {
fs.top_level_dir = parent;
@@ -5331,6 +5598,13 @@ pub const PackageManager = struct {
} else |_| {}
}
+ var workspaces = std.StringArrayHashMap(?Semver.Version).init(ctx.allocator);
+ for (workspace_names.values()) |entry| {
+ try workspaces.put(entry.name, entry.version);
+ }
+
+ workspace_names.map.deinit();
+
var manager = &instance;
// var progress = Progress{};
// var node = progress.start(name: []const u8, estimated_total_items: usize)
@@ -5348,7 +5622,8 @@ pub const PackageManager = struct {
.resolve_tasks = TaskChannel.init(),
.lockfile = undefined,
.root_package_json_file = package_json_file,
- .waiter = Waiter.fromUWSLoop(uws.Loop.get()),
+ .waiter = try Waker.init(ctx.allocator),
+ .workspaces = workspaces,
// .progress
.uws_event_loop = uws.Loop.get(),
.file_poll_store = JSC.FilePoll.Store.init(ctx.allocator),
@@ -5379,6 +5654,7 @@ pub const PackageManager = struct {
env,
cli,
ctx.install,
+ subcommand,
);
manager.timestamp_for_manifest_cache_control = @as(u32, @truncate(@as(u64, @intCast(@max(std.time.timestamp(), 0)))));
@@ -5427,9 +5703,8 @@ pub const PackageManager = struct {
.resolve_tasks = TaskChannel.init(),
.lockfile = undefined,
.root_package_json_file = undefined,
- .waiter = Waiter.fromUWSLoop(uws.Loop.get()),
- .uws_event_loop = uws.Loop.get(),
- .file_poll_store = JSC.FilePoll.Store.init(allocator),
+ .waiter = try Waker.init(allocator),
+ .workspaces = std.StringArrayHashMap(?Semver.Version).init(allocator),
};
manager.lockfile = try allocator.create(Lockfile);
@@ -5466,6 +5741,7 @@ pub const PackageManager = struct {
env,
cli,
bun_install,
+ .install,
);
manager.timestamp_for_manifest_cache_control = @as(
@@ -5822,7 +6098,6 @@ pub const PackageManager = struct {
clap.parseParam("--no-save Don't save a lockfile") catch unreachable,
clap.parseParam("--save Save to package.json") catch unreachable,
clap.parseParam("--dry-run Don't install anything") catch unreachable,
- clap.parseParam("--lockfile <PATH> Store & load a lockfile at a specific filepath") catch unreachable,
clap.parseParam("--frozen-lockfile Disallow changes to lockfile") catch unreachable,
clap.parseParam("-f, --force Always request the latest versions from the registry & reinstall all dependencies") catch unreachable,
clap.parseParam("--cache-dir <PATH> Store & load cached data from a specific directory path") catch unreachable,
@@ -5848,7 +6123,7 @@ pub const PackageManager = struct {
clap.parseParam("-d, --dev Add dependency to \"devDependencies\"") catch unreachable,
clap.parseParam("-D, --development") catch unreachable,
clap.parseParam("--optional Add dependency to \"optionalDependencies\"") catch unreachable,
- clap.parseParam("--exact Add the exact version instead of the ^range") catch unreachable,
+ clap.parseParam("-E, --exact Add the exact version instead of the ^range") catch unreachable,
clap.parseParam("<POS> ... ") catch unreachable,
};
@@ -5864,12 +6139,12 @@ pub const PackageManager = struct {
clap.parseParam("-d, --dev Add dependency to \"devDependencies\"") catch unreachable,
clap.parseParam("-D, --development") catch unreachable,
clap.parseParam("--optional Add dependency to \"optionalDependencies\"") catch unreachable,
- clap.parseParam("--exact Add the exact version instead of the ^range") catch unreachable,
- clap.parseParam("<POS> ... \"name\" or \"name@version\" of packages to install") catch unreachable,
+ clap.parseParam("-E, --exact Add the exact version instead of the ^range") catch unreachable,
+ clap.parseParam("<POS> ... \"name\" or \"name@version\" of package(s) to install") catch unreachable,
};
const remove_params = install_params_ ++ [_]ParamType{
- clap.parseParam("<POS> ... \"name\" of packages to remove from package.json") catch unreachable,
+ clap.parseParam("<POS> ... \"name\" of package(s) to remove from package.json") catch unreachable,
};
const link_params = install_params_ ++ [_]ParamType{
@@ -6012,10 +6287,6 @@ pub const PackageManager = struct {
// }
// }
- if (args.option("--lockfile")) |lockfile| {
- cli.lockfile = lockfile;
- }
-
if (args.option("--cwd")) |cwd_| {
var buf: [bun.MAX_PATH_BYTES]u8 = undefined;
var buf2: [bun.MAX_PATH_BYTES]u8 = undefined;
@@ -6096,7 +6367,7 @@ pub const PackageManager = struct {
var value = input;
var alias: ?string = null;
- if (strings.isNPMPackageName(input)) {
+ if (!Dependency.isTarball(input) and strings.isNPMPackageName(input)) {
alias = input;
value = input[input.len..];
} else if (input.len > 1) {
@@ -6155,6 +6426,8 @@ pub const PackageManager = struct {
request.is_aliased = true;
request.name = allocator.dupe(u8, name) catch unreachable;
request.name_hash = String.Builder.stringHash(name);
+ } else if (version.tag == .github and version.value.github.committish.isEmpty()) {
+ request.name_hash = String.Builder.stringHash(version.literal.slice(input));
} else {
request.name_hash = String.Builder.stringHash(version.literal.slice(input));
}
@@ -6213,7 +6486,7 @@ pub const PackageManager = struct {
) !void {
var update_requests = try UpdateRequest.Array.init(0);
- if (manager.options.positionals.len == 1) {
+ if (manager.options.positionals.len <= 1) {
var examples_to_print: [3]string = undefined;
const off = @as(u64, @intCast(std.time.milliTimestamp()));
@@ -6645,6 +6918,7 @@ pub const PackageManager = struct {
folder_path_buf: [bun.MAX_PATH_BYTES]u8 = undefined,
install_count: usize = 0,
successfully_installed: Bitset,
+ tree_iterator: *Lockfile.Tree.Iterator,
// For linking native binaries, we only want to link after we've installed the companion dependencies
// We don't want to introduce dependent callbacks like that for every single package
@@ -6656,6 +6930,16 @@ pub const PackageManager = struct {
node_modules_folder: std.fs.IterableDir,
};
+ /// Call when you mutate the length of `lockfile.packages`
+ pub fn fixCachedLockfilePackageSlices(this: *PackageInstaller) void {
+ var packages = this.lockfile.packages.slice();
+ this.metas = packages.items(.meta);
+ this.names = packages.items(.name);
+ this.bins = packages.items(.bin);
+ this.resolutions = packages.items(.resolution);
+ this.tree_iterator.reload(this.lockfile);
+ }
+
/// Install versions of a package which are waiting on a network request
pub fn installEnqueuedPackages(
this: *PackageInstaller,
@@ -7265,38 +7549,38 @@ pub const PackageManager = struct {
var summary = PackageInstall.Summary{};
{
- var parts = lockfile.packages.slice();
- var metas = parts.items(.meta);
- var names = parts.items(.name);
- var dependencies = lockfile.buffers.dependencies.items;
- const resolutions_buffer: []const PackageID = lockfile.buffers.resolutions.items;
- const resolution_lists: []const Lockfile.PackageIDSlice = parts.items(.resolutions);
- var resolutions = parts.items(.resolution);
-
var iterator = Lockfile.Tree.Iterator.init(lockfile);
- var installer = PackageInstaller{
- .manager = this,
- .options = &this.options,
- .metas = metas,
- .bins = parts.items(.bin),
- .root_node_modules_folder = node_modules_folder,
- .names = names,
- .resolutions = resolutions,
- .lockfile = lockfile,
- .node = &install_node,
- .node_modules_folder = node_modules_folder,
- .progress = progress,
- .skip_verify_installed_version_number = skip_verify_installed_version_number,
- .skip_delete = skip_delete,
- .summary = &summary,
- .global_bin_dir = this.options.global_bin_dir,
- .force_install = force_install,
- .install_count = lockfile.buffers.hoisted_dependencies.items.len,
- .successfully_installed = try Bitset.initEmpty(
- this.allocator,
- lockfile.packages.len,
- ),
+ var installer: PackageInstaller = brk: {
+ // These slices potentially get resized during iteration
+ // so we want to make sure they're not accessible to the rest of this function
+ // to make mistakes harder
+ var parts = lockfile.packages.slice();
+
+ break :brk PackageInstaller{
+ .manager = this,
+ .options = &this.options,
+ .metas = parts.items(.meta),
+ .bins = parts.items(.bin),
+ .root_node_modules_folder = node_modules_folder,
+ .names = parts.items(.name),
+ .resolutions = parts.items(.resolution),
+ .lockfile = lockfile,
+ .node = &install_node,
+ .node_modules_folder = node_modules_folder,
+ .progress = progress,
+ .skip_verify_installed_version_number = skip_verify_installed_version_number,
+ .skip_delete = skip_delete,
+ .summary = &summary,
+ .global_bin_dir = this.options.global_bin_dir,
+ .force_install = force_install,
+ .install_count = lockfile.buffers.hoisted_dependencies.items.len,
+ .successfully_installed = try Bitset.initEmpty(
+ this.allocator,
+ lockfile.packages.len,
+ ),
+ .tree_iterator = &iterator,
+ };
};
while (iterator.nextNodeModulesFolder()) |node_modules| {
@@ -7305,7 +7589,10 @@ pub const PackageManager = struct {
// We use this file descriptor to know where to put it.
installer.node_modules_folder = cwd.openIterableDir(node_modules.relative_path, .{}) catch brk: {
// Avoid extra mkdir() syscall
- try cwd.makePath(bun.span(node_modules.relative_path));
+ //
+ // note: this will recursively delete any dangling symlinks
+ // in the next.js repo, it encounters a dangling symlink in node_modules/@next/codemod/node_modules/cheerio
+ try bun.makePath(cwd, bun.span(node_modules.relative_path));
break :brk try cwd.openIterableDir(node_modules.relative_path, .{});
};
@@ -7335,6 +7622,7 @@ pub const PackageManager = struct {
.onPackageManifestError = {},
.onPackageDownloadError = {},
},
+ true,
log_level,
);
if (!installer.options.do.install_packages) return error.InstallFailed;
@@ -7354,12 +7642,13 @@ pub const PackageManager = struct {
.onPackageManifestError = {},
.onPackageDownloadError = {},
},
+ true,
log_level,
);
if (!installer.options.do.install_packages) return error.InstallFailed;
}
- while (this.pending_tasks > 0 and installer.options.do.install_packages) : (this.sleep()) {
+ while (this.pending_tasks > 0 and installer.options.do.install_packages) {
try this.runTasks(
*PackageInstaller,
&installer,
@@ -7369,94 +7658,110 @@ pub const PackageManager = struct {
.onPackageManifestError = {},
.onPackageDownloadError = {},
},
+ true,
log_level,
);
+
+ if (PackageManager.verbose_install and this.pending_tasks > 0) {
+ Output.prettyErrorln("<d>[PackageManager]<r> waiting for {d} tasks\n", .{this.pending_tasks});
+ }
+
+ if (this.pending_tasks > 0)
+ this.sleep();
}
if (!installer.options.do.install_packages) return error.InstallFailed;
summary.successfully_installed = installer.successfully_installed;
- outer: for (installer.platform_binlinks.items) |deferred| {
- const dependency_id = deferred.dependency_id;
- const package_id = resolutions_buffer[dependency_id];
- const folder = deferred.node_modules_folder;
-
- const package_resolutions: []const PackageID = resolution_lists[package_id].get(resolutions_buffer);
- const original_bin: Bin = installer.bins[package_id];
-
- for (package_resolutions) |resolved_id| {
- if (resolved_id >= names.len) continue;
- const meta: Lockfile.Package.Meta = metas[resolved_id];
-
- // This is specifically for platform-specific binaries
- if (meta.os == .all and meta.arch == .all) continue;
-
- // Don't attempt to link incompatible binaries
- if (meta.isDisabled()) continue;
-
- const name = lockfile.str(&dependencies[dependency_id].name);
-
- if (!installer.has_created_bin) {
- if (!this.options.global) {
- if (comptime Environment.isWindows) {
- std.os.mkdiratW(node_modules_folder.dir.fd, bun.strings.w(".bin"), 0) catch {};
- } else {
- node_modules_folder.dir.makeDirZ(".bin") catch {};
+ {
+ var parts = lockfile.packages.slice();
+ var metas = parts.items(.meta);
+ var names = parts.items(.name);
+ var dependencies = lockfile.buffers.dependencies.items;
+ const resolutions_buffer: []const PackageID = lockfile.buffers.resolutions.items;
+ const resolution_lists: []const Lockfile.PackageIDSlice = parts.items(.resolutions);
+ outer: for (installer.platform_binlinks.items) |deferred| {
+ const dependency_id = deferred.dependency_id;
+ const package_id = resolutions_buffer[dependency_id];
+ const folder = deferred.node_modules_folder;
+
+ const package_resolutions: []const PackageID = resolution_lists[package_id].get(resolutions_buffer);
+ const original_bin: Bin = installer.bins[package_id];
+
+ for (package_resolutions) |resolved_id| {
+ if (resolved_id >= names.len) continue;
+ const meta: Lockfile.Package.Meta = metas[resolved_id];
+
+ // This is specifically for platform-specific binaries
+ if (meta.os == .all and meta.arch == .all) continue;
+
+ // Don't attempt to link incompatible binaries
+ if (meta.isDisabled()) continue;
+
+ const name = lockfile.str(&dependencies[dependency_id].name);
+
+ if (!installer.has_created_bin) {
+ if (!this.options.global) {
+ if (comptime Environment.isWindows) {
+ std.os.mkdiratW(node_modules_folder.dir.fd, bun.strings.w(".bin"), 0) catch {};
+ } else {
+ node_modules_folder.dir.makeDirZ(".bin") catch {};
+ }
}
+ if (comptime Environment.isPosix)
+ Bin.Linker.umask = C.umask(0);
+ installer.has_created_bin = true;
}
- if (comptime Environment.isPosix)
- Bin.Linker.umask = C.umask(0);
- installer.has_created_bin = true;
- }
- var bin_linker = Bin.Linker{
- .bin = original_bin,
- .package_installed_node_modules = bun.toFD(folder.dir.fd),
- .root_node_modules_folder = bun.toFD(node_modules_folder.dir.fd),
- .global_bin_path = this.options.bin_path,
- .global_bin_dir = this.options.global_bin_dir.dir,
+ var bin_linker = Bin.Linker{
+ .bin = original_bin,
+ .package_installed_node_modules = bun.toFD(folder.dir.fd),
+ .root_node_modules_folder = bun.toFD(node_modules_folder.dir.fd),
+ .global_bin_path = this.options.bin_path,
+ .global_bin_dir = this.options.global_bin_dir.dir,
- .package_name = strings.StringOrTinyString.init(name),
- .string_buf = lockfile.buffers.string_bytes.items,
- .extern_string_buf = lockfile.buffers.extern_strings.items,
- };
+ .package_name = strings.StringOrTinyString.init(name),
+ .string_buf = lockfile.buffers.string_bytes.items,
+ .extern_string_buf = lockfile.buffers.extern_strings.items,
+ };
- bin_linker.link(this.options.global);
+ bin_linker.link(this.options.global);
- if (bin_linker.err) |err| {
- if (comptime log_level != .silent) {
- const fmt = "\n<r><red>error:<r> linking <b>{s}<r>: {s}\n";
- const args = .{ name, @errorName(err) };
+ if (bin_linker.err) |err| {
+ if (comptime log_level != .silent) {
+ const fmt = "\n<r><red>error:<r> linking <b>{s}<r>: {s}\n";
+ const args = .{ name, @errorName(err) };
- if (comptime log_level.showProgress()) {
- switch (Output.enable_ansi_colors) {
- inline else => |enable_ansi_colors| {
- this.progress.log(comptime Output.prettyFmt(fmt, enable_ansi_colors), args);
- },
+ if (comptime log_level.showProgress()) {
+ switch (Output.enable_ansi_colors) {
+ inline else => |enable_ansi_colors| {
+ this.progress.log(comptime Output.prettyFmt(fmt, enable_ansi_colors), args);
+ },
+ }
+ } else {
+ Output.prettyErrorln(fmt, args);
}
- } else {
- Output.prettyErrorln(fmt, args);
}
+
+ if (this.options.enable.fail_early) Global.crash();
}
- if (this.options.enable.fail_early) Global.crash();
+ continue :outer;
}
- continue :outer;
- }
-
- if (comptime log_level != .silent) {
- const fmt = "\n<r><yellow>warn:<r> no compatible binaries found for <b>{s}<r>\n";
- const args = .{lockfile.str(&names[package_id])};
+ if (comptime log_level != .silent) {
+ const fmt = "\n<r><yellow>warn:<r> no compatible binaries found for <b>{s}<r>\n";
+ const args = .{lockfile.str(&names[package_id])};
- if (comptime log_level.showProgress()) {
- switch (Output.enable_ansi_colors) {
- inline else => |enable_ansi_colors| {
- this.progress.log(comptime Output.prettyFmt(fmt, enable_ansi_colors), args);
- },
+ if (comptime log_level.showProgress()) {
+ switch (Output.enable_ansi_colors) {
+ inline else => |enable_ansi_colors| {
+ this.progress.log(comptime Output.prettyFmt(fmt, enable_ansi_colors), args);
+ },
+ }
+ } else {
+ Output.prettyErrorln(fmt, args);
}
- } else {
- Output.prettyErrorln(fmt, args);
}
}
}
@@ -7515,15 +7820,17 @@ pub const PackageManager = struct {
)
else
.{ .not_found = {} };
+
var root = Lockfile.Package{};
- var needs_new_lockfile = load_lockfile_result != .ok or (load_lockfile_result.ok.buffers.dependencies.items.len == 0 and manager.package_json_updates.len > 0);
+ var needs_new_lockfile = load_lockfile_result != .ok or
+ (load_lockfile_result.ok.buffers.dependencies.items.len == 0 and manager.package_json_updates.len > 0);
+
// this defaults to false
// but we force allowing updates to the lockfile when you do bun add
var had_any_diffs = false;
manager.progress = .{};
// Step 2. Parse the package.json file
- //
var package_json_source = logger.Source.initPathString(package_json_cwd, package_json_contents);
switch (load_lockfile_result) {
@@ -7539,6 +7846,9 @@ pub const PackageManager = struct {
.read_file => Output.prettyError("<r><red>error<r> reading lockfile:<r> {s}\n<r>", .{
@errorName(cause.value),
}),
+ .migrating => Output.prettyError("<r><red>error<r> migrating lockfile:<r> {s}\n<r>", .{
+ @errorName(cause.value),
+ }),
}
if (manager.options.enable.fail_early) {
@@ -7617,6 +7927,8 @@ pub const PackageManager = struct {
new_dep.count(lockfile.buffers.string_bytes.items, *Lockfile.StringBuilder, builder);
}
+ lockfile.overrides.count(&lockfile, builder);
+
maybe_root.scripts.count(lockfile.buffers.string_bytes.items, *Lockfile.StringBuilder, builder);
const off = @as(u32, @truncate(manager.lockfile.buffers.dependencies.items.len));
@@ -7630,6 +7942,27 @@ pub const PackageManager = struct {
manager.root_dependency_list = dep_lists[0];
try builder.allocate();
+ const all_name_hashes: []PackageNameHash = brk: {
+ if (!manager.summary.overrides_changed) break :brk &.{};
+ const hashes_len = manager.lockfile.overrides.map.entries.len + lockfile.overrides.map.entries.len;
+ if (hashes_len == 0) break :brk &.{};
+ var all_name_hashes = try bun.default_allocator.alloc(PackageNameHash, hashes_len);
+ @memcpy(all_name_hashes[0..manager.lockfile.overrides.map.entries.len], manager.lockfile.overrides.map.keys());
+ @memcpy(all_name_hashes[manager.lockfile.overrides.map.entries.len..], lockfile.overrides.map.keys());
+ var i = manager.lockfile.overrides.map.entries.len;
+ while (i < all_name_hashes.len) {
+ if (std.mem.indexOfScalar(PackageNameHash, all_name_hashes[0..i], all_name_hashes[i]) != null) {
+ all_name_hashes[i] = all_name_hashes[all_name_hashes.len - 1];
+ all_name_hashes.len -= 1;
+ } else {
+ i += 1;
+ }
+ }
+ break :brk all_name_hashes;
+ };
+
+ manager.lockfile.overrides = try lockfile.overrides.clone(&lockfile, manager.lockfile, builder);
+
try manager.lockfile.buffers.dependencies.ensureUnusedCapacity(manager.lockfile.allocator, len);
try manager.lockfile.buffers.resolutions.ensureUnusedCapacity(manager.lockfile.allocator, len);
@@ -7652,6 +7985,20 @@ pub const PackageManager = struct {
}
}
+ if (manager.summary.overrides_changed and all_name_hashes.len > 0) {
+ for (manager.lockfile.buffers.dependencies.items, 0..) |*dependency, dependency_i| {
+ if (std.mem.indexOfScalar(PackageNameHash, all_name_hashes, dependency.name_hash)) |_| {
+ manager.lockfile.buffers.resolutions.items[dependency_i] = invalid_package_id;
+ try manager.enqueueDependencyWithMain(
+ @truncate(dependency_i),
+ dependency,
+ manager.lockfile.buffers.resolutions.items[dependency_i],
+ false,
+ );
+ }
+ }
+ }
+
manager.lockfile.packages.items(.scripts)[0] = maybe_root.scripts.clone(
lockfile.buffers.string_bytes.items,
*Lockfile.StringBuilder,
@@ -7667,6 +8014,7 @@ pub const PackageManager = struct {
_ = manager.getCacheDirectory();
_ = manager.getTemporaryDirectory();
+
while (counter_i < changes) : (counter_i += 1) {
if (mapping[counter_i] == invalid_package_id) {
const dependency_i = counter_i + off;
@@ -7675,6 +8023,7 @@ pub const PackageManager = struct {
dependency_i,
&dependency,
manager.lockfile.buffers.resolutions.items[dependency_i],
+ false,
);
}
}
@@ -7729,7 +8078,7 @@ pub const PackageManager = struct {
manager.drainDependencyList();
}
- if (manager.pending_tasks > 0) {
+ if (manager.pending_tasks > 0 or manager.peer_dependencies.items.len > 0) {
if (root.dependencies.len > 0) {
_ = manager.getCacheDirectory();
_ = manager.getTemporaryDirectory();
@@ -7742,7 +8091,7 @@ pub const PackageManager = struct {
Output.flush();
}
- while (manager.pending_tasks > 0) : (manager.sleep()) {
+ while (manager.pending_tasks > 0) {
try manager.runTasks(
*PackageManager,
manager,
@@ -7753,8 +8102,45 @@ pub const PackageManager = struct {
.onPackageDownloadError = {},
.progress_bar = true,
},
+ false,
log_level,
);
+
+ if (PackageManager.verbose_install and manager.pending_tasks > 0) {
+ Output.prettyErrorln("<d>[PackageManager]<r> waiting for {d} tasks\n", .{manager.pending_tasks});
+ }
+
+ if (manager.pending_tasks > 0)
+ manager.sleep();
+ }
+
+ if (manager.options.do.install_peer_dependencies) {
+ try manager.processPeerDependencyList();
+
+ manager.drainDependencyList();
+
+ while (manager.pending_tasks > 0) {
+ try manager.runTasks(
+ *PackageManager,
+ manager,
+ .{
+ .onExtract = {},
+ .onResolve = {},
+ .onPackageManifestError = {},
+ .onPackageDownloadError = {},
+ .progress_bar = true,
+ },
+ true,
+ log_level,
+ );
+
+ if (PackageManager.verbose_install and manager.pending_tasks > 0) {
+ Output.prettyErrorln("<d>[PackageManager]<r> waiting for {d} tasks\n", .{manager.pending_tasks});
+ }
+
+ if (manager.pending_tasks > 0)
+ manager.sleep();
+ }
}
if (comptime log_level.showProgress()) {
@@ -7810,7 +8196,7 @@ pub const PackageManager = struct {
save: {
if (manager.lockfile.isEmpty()) {
if (!manager.options.dry_run) {
- std.fs.cwd().deleteFileZ(manager.options.save_lockfile_path) catch |err| brk: {
+ std.fs.cwd().deleteFileZ(manager.options.lockfile_path) catch |err| brk: {
// we don't care
if (err == error.FileNotFound) {
if (had_any_diffs) break :save;
@@ -7838,7 +8224,7 @@ pub const PackageManager = struct {
manager.progress.refresh();
}
- manager.lockfile.saveToDisk(manager.options.save_lockfile_path);
+ manager.lockfile.saveToDisk(manager.options.lockfile_path);
if (comptime log_level.showProgress()) {
node.end();
manager.progress.refresh();
@@ -7943,13 +8329,14 @@ pub const PackageManager = struct {
if (install_summary.success > 0) {
// it's confusing when it shows 3 packages and says it installed 1
- Output.pretty("\n <green>{d}<r> packages<r> installed ", .{@max(
+ const pkgs_installed = @max(
install_summary.success,
@as(
u32,
@truncate(manager.package_json_updates.len),
),
- )});
+ );
+ Output.pretty("\n <green>{d}<r> package{s}<r> installed ", .{ pkgs_installed, if (pkgs_installed == 1) "" else "s" });
Output.printStartEndStdout(ctx.start_time, std.time.nanoTimestamp());
printed_timestamp = true;
Output.pretty("<r>\n", .{});
@@ -7964,7 +8351,7 @@ pub const PackageManager = struct {
}
}
- Output.pretty("\n <r><b>{d}<r> packages removed ", .{manager.summary.remove});
+ Output.pretty("\n <r><b>{d}<r> package{s} removed ", .{ manager.summary.remove, if (manager.summary.remove == 1) "" else "s" });
Output.printStartEndStdout(ctx.start_time, std.time.nanoTimestamp());
printed_timestamp = true;
Output.pretty("<r>\n", .{});
@@ -7973,16 +8360,19 @@ pub const PackageManager = struct {
const count = @as(PackageID, @truncate(manager.lockfile.packages.len));
if (count != install_summary.skipped) {
- Output.pretty("Checked <green>{d} installs<r> across {d} packages <d>(no changes)<r> ", .{
+ Output.pretty("Checked <green>{d} install{s}<r> across {d} package{s} <d>(no changes)<r> ", .{
install_summary.skipped,
+ if (install_summary.skipped == 1) "" else "s",
count,
+ if (count == 1) "" else "s",
});
Output.printStartEndStdout(ctx.start_time, std.time.nanoTimestamp());
printed_timestamp = true;
Output.pretty("<r>\n", .{});
} else {
- Output.pretty("<r> <green>Done<r>! Checked {d} packages<r> <d>(no changes)<r> ", .{
+ Output.pretty("<r> <green>Done<r>! Checked {d} package{s}<r> <d>(no changes)<r> ", .{
install_summary.skipped,
+ if (install_summary.skipped == 1) "" else "s",
});
Output.printStartEndStdout(ctx.start_time, std.time.nanoTimestamp());
printed_timestamp = true;
@@ -7991,7 +8381,7 @@ pub const PackageManager = struct {
}
if (install_summary.fail > 0) {
- Output.prettyln("<r>Failed to install <red><b>{d}<r> packages\n", .{install_summary.fail});
+ Output.prettyln("<r>Failed to install <red><b>{d}<r> package{s}\n", .{ install_summary.fail, if (install_summary.fail == 1) "" else "s" });
Output.flush();
}
}
@@ -8048,6 +8438,7 @@ test "UpdateRequests.parse" {
"baz",
"boo@1.0.0",
"bing@latest",
+ "github:bar/foo",
};
var reqs = PackageManager.UpdateRequest.parse(default_allocator, &log, updates, &array, .add);
@@ -8056,11 +8447,12 @@ test "UpdateRequests.parse" {
try std.testing.expectEqualStrings(reqs[2].name, "bar");
try std.testing.expectEqualStrings(reqs[3].name, "baz");
try std.testing.expectEqualStrings(reqs[4].name, "boo");
+ try std.testing.expectEqualStrings(reqs[7].name, "github:bar/foo");
try std.testing.expectEqual(reqs[4].version.tag, Dependency.Version.Tag.npm);
try std.testing.expectEqualStrings(reqs[4].version.literal.slice("boo@1.0.0"), "1.0.0");
try std.testing.expectEqual(reqs[5].version.tag, Dependency.Version.Tag.dist_tag);
try std.testing.expectEqualStrings(reqs[5].version.literal.slice("bing@1.0.0"), "latest");
- try std.testing.expectEqual(updates.len, 6);
+ try std.testing.expectEqual(updates.len, 7);
}
test "PackageManager.Options - default registry, default values" {
diff --git a/src/install/integrity.zig b/src/install/integrity.zig
index dd11140de..c0b02d4bf 100644
--- a/src/install/integrity.zig
+++ b/src/install/integrity.zig
@@ -3,34 +3,26 @@ const strings = @import("../string_immutable.zig");
const Crypto = @import("../sha.zig").Hashers;
pub const Integrity = extern struct {
+ const empty_digest_buf: [Integrity.digest_buf_len]u8 = [_]u8{0} ** Integrity.digest_buf_len;
+
tag: Tag = Tag.unknown,
/// Possibly a [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) value initially
/// We transform it though.
- value: [digest_buf_len]u8 = undefined,
+ value: [digest_buf_len]u8 = empty_digest_buf,
const Base64 = std.base64.standard_no_pad;
- pub const digest_buf_len: usize = brk: {
- const values = [_]usize{
- std.crypto.hash.Sha1.digest_length,
- std.crypto.hash.sha2.Sha512.digest_length,
- std.crypto.hash.sha2.Sha256.digest_length,
- std.crypto.hash.sha2.Sha384.digest_length,
- };
-
- var value: usize = 0;
- for (values) |val| {
- value = @max(val, value);
- }
-
- break :brk value;
- };
+ pub const digest_buf_len: usize = @max(
+ std.crypto.hash.Sha1.digest_length,
+ std.crypto.hash.sha2.Sha512.digest_length,
+ std.crypto.hash.sha2.Sha256.digest_length,
+ std.crypto.hash.sha2.Sha384.digest_length,
+ );
pub fn parseSHASum(buf: []const u8) !Integrity {
if (buf.len == 0) {
return Integrity{
.tag = Tag.unknown,
- .value = undefined,
};
}
@@ -40,8 +32,11 @@ pub const Integrity = extern struct {
var out_i: usize = 0;
var i: usize = 0;
- {
- @memset(&integrity.value, 0);
+ // initializer should zero it out
+ if (comptime @import("root").bun.Environment.allow_assert) {
+ for (integrity.value) |c| {
+ std.debug.assert(c == 0);
+ }
}
while (i < end) {
@@ -74,23 +69,20 @@ pub const Integrity = extern struct {
if (buf.len < "sha256-".len) {
return Integrity{
.tag = Tag.unknown,
- .value = undefined,
};
}
- var out: [digest_buf_len]u8 = undefined;
+ var out: [digest_buf_len]u8 = empty_digest_buf;
const tag = Tag.parse(buf);
if (tag == Tag.unknown) {
return Integrity{
.tag = Tag.unknown,
- .value = undefined,
};
}
Base64.Decoder.decode(&out, std.mem.trimRight(u8, buf["sha256-".len..], "=")) catch {
return Integrity{
.tag = Tag.unknown,
- .value = undefined,
};
};
@@ -203,4 +195,13 @@ pub const Integrity = extern struct {
unreachable;
}
+
+ comptime {
+ var integrity = Integrity{ .tag = Tag.sha1 };
+ for (integrity.value) |c| {
+ if (c != 0) {
+ @compileError("Integrity buffer is not zeroed");
+ }
+ }
+ }
};
diff --git a/src/install/lockfile.zig b/src/install/lockfile.zig
index 759c5be90..bcfd72038 100644
--- a/src/install/lockfile.zig
+++ b/src/install/lockfile.zig
@@ -22,6 +22,7 @@ const json_parser = bun.JSON;
const JSPrinter = bun.js_printer;
const linker = @import("../linker.zig");
+const migration = @import("./migration.zig");
const sync = @import("../sync.zig");
const Api = @import("../api/schema.zig").Api;
@@ -86,9 +87,9 @@ const StaticHashMap = @import("../StaticHashMap.zig").StaticHashMap;
const MetaHash = [std.crypto.hash.sha2.Sha512256.digest_length]u8;
const zero_hash = std.mem.zeroes(MetaHash);
-const NameHashMap = std.ArrayHashMapUnmanaged(u32, String, ArrayIdentityContext, false);
-const NameHashSet = std.ArrayHashMapUnmanaged(u32, void, ArrayIdentityContext, false);
-const VersionHashMap = std.ArrayHashMapUnmanaged(u32, Semver.Version, ArrayIdentityContext, false);
+pub const NameHashMap = std.ArrayHashMapUnmanaged(PackageNameHash, String, ArrayIdentityContext.U64, false);
+pub const NameHashSet = std.ArrayHashMapUnmanaged(u32, void, ArrayIdentityContext, false);
+pub const VersionHashMap = std.ArrayHashMapUnmanaged(PackageNameHash, Semver.Version, ArrayIdentityContext.U64, false);
const assertNoUninitializedPadding = @import("./padding_checker.zig").assertNoUninitializedPadding;
@@ -114,6 +115,7 @@ workspace_versions: VersionHashMap = .{},
has_trusted_dependencies: bool = false,
trusted_dependencies: NameHashSet = .{},
+overrides: OverrideMap = .{},
const Stream = std.io.FixedBufferStream([]u8);
pub const default_filename = "bun.lockb";
@@ -185,7 +187,7 @@ pub fn isEmpty(this: *const Lockfile) bool {
return this.packages.len == 0 or this.packages.len == 1 or this.packages.get(0).resolutions.len == 0;
}
-pub const LoadFromDiskResult = union(Tag) {
+pub const LoadFromDiskResult = union(enum) {
not_found: void,
err: struct {
step: Step,
@@ -193,26 +195,30 @@ pub const LoadFromDiskResult = union(Tag) {
},
ok: *Lockfile,
- pub const Step = enum { open_file, read_file, parse_file };
-
- pub const Tag = enum {
- not_found,
- err,
- ok,
- };
+ pub const Step = enum { open_file, read_file, parse_file, migrating };
};
pub fn loadFromDisk(this: *Lockfile, allocator: Allocator, log: *logger.Log, filename: stringZ) LoadFromDiskResult {
if (comptime Environment.allow_assert) std.debug.assert(FileSystem.instance_loaded);
- var file = std.io.getStdIn();
- if (filename.len > 0)
- file = std.fs.cwd().openFileZ(filename, .{ .mode = .read_only }) catch |err| {
+ var file = if (filename.len > 0)
+ std.fs.cwd().openFileZ(filename, .{ .mode = .read_only }) catch |err| {
return switch (err) {
- error.FileNotFound, error.AccessDenied, error.BadPathName => LoadFromDiskResult{ .not_found = {} },
+ error.FileNotFound => {
+ // Attempt to load from "package-lock.json", "yarn.lock", etc.
+ return migration.detectAndLoadOtherLockfile(
+ this,
+ allocator,
+ log,
+ filename,
+ );
+ },
+ error.AccessDenied, error.BadPathName => LoadFromDiskResult{ .not_found = {} },
else => LoadFromDiskResult{ .err = .{ .step = .open_file, .value = err } },
};
- };
+ }
+ else
+ std.io.getStdIn();
defer file.close();
var buf = file.readToEndAlloc(allocator, std.math.maxInt(usize)) catch |err| {
@@ -230,11 +236,16 @@ pub fn loadFromBytes(this: *Lockfile, buf: []u8, allocator: Allocator, log: *log
this.trusted_dependencies = .{};
this.workspace_paths = .{};
this.workspace_versions = .{};
+ this.overrides = .{};
Lockfile.Serializer.load(this, &stream, allocator, log) catch |err| {
return LoadFromDiskResult{ .err = .{ .step = .parse_file, .value = err } };
};
+ if (Environment.allow_assert) {
+ this.verifyData() catch @panic("lockfile data is corrupt");
+ }
+
return LoadFromDiskResult{ .ok = this };
}
@@ -315,6 +326,14 @@ pub const Tree = struct {
};
}
+ pub fn reload(this: *Iterator, lockfile: *const Lockfile) void {
+ this.trees = lockfile.buffers.trees.items;
+ this.dependency_ids = lockfile.buffers.hoisted_dependencies.items;
+ this.dependencies = lockfile.buffers.dependencies.items;
+ this.resolutions = lockfile.buffers.resolutions.items;
+ this.string_buf = lockfile.buffers.string_bytes.items;
+ }
+
pub fn nextNodeModulesFolder(this: *Iterator) ?NodeModulesFolder {
if (this.tree_id >= this.trees.len) return null;
@@ -401,7 +420,7 @@ pub const Tree = struct {
dependencies: Lockfile.DependencyIDList,
};
- pub const ArrayList = std.MultiArrayList(Entry);
+ pub const ArrayList = bun.MultiArrayList(Entry);
/// Flatten the multi-dimensional ArrayList of package IDs into a single easily serializable array
pub fn clean(this: *Builder) !DependencyIDList {
@@ -698,7 +717,7 @@ pub fn cleanWithLogger(
// If yes, choose that version instead.
// Why lower?
//
- // Normally, the problem is looks like this:
+ // Normally, the problem looks like this:
// Package A: "react@^17"
// Package B: "react@17.0.1
//
@@ -729,7 +748,7 @@ pub fn cleanWithLogger(
// }
// }
- var new = try old.allocator.create(Lockfile);
+ var new: *Lockfile = try old.allocator.create(Lockfile);
try new.initEmpty(
old.allocator,
);
@@ -740,6 +759,13 @@ pub fn cleanWithLogger(
old.scratch.dependency_list_queue.head = 0;
+ {
+ var builder = new.stringBuilder();
+ old.overrides.count(old, &builder);
+ try builder.allocate();
+ new.overrides = try old.overrides.clone(old, new, &builder);
+ }
+
// Step 1. Recreate the lockfile with only the packages that are still alive
const root = old.rootPackage() orelse return error.NoPackage;
@@ -756,12 +782,73 @@ pub fn cleanWithLogger(
.clone_queue = clone_queue_,
.log = log,
};
+
// try clone_queue.ensureUnusedCapacity(root.dependencies.len);
_ = try root.clone(old, new, package_id_mapping, &cloner);
+ // Clone workspace_paths and workspace_versions at the end.
+ if (old.workspace_paths.count() > 0 or old.workspace_versions.count() > 0) {
+ try new.workspace_paths.ensureTotalCapacity(z_allocator, old.workspace_paths.count());
+ try new.workspace_versions.ensureTotalCapacity(z_allocator, old.workspace_versions.count());
+
+ var workspace_paths_builder = new.stringBuilder();
+
+ const WorkspacePathSorter = struct {
+ string_buf: []const u8,
+ entries: NameHashMap.DataList,
+
+ pub fn lessThan(sorter: @This(), a: usize, b: usize) bool {
+ const left = sorter.entries.items(.value)[a];
+ const right = sorter.entries.items(.value)[b];
+ return strings.order(left.slice(sorter.string_buf), right.slice(sorter.string_buf)) == .lt;
+ }
+ };
+
+ // Sort by name for determinism
+ old.workspace_paths.sort(WorkspacePathSorter{
+ .entries = old.workspace_paths.entries,
+ .string_buf = old.buffers.string_bytes.items,
+ });
+
+ for (old.workspace_paths.values()) |*path| {
+ workspace_paths_builder.count(old.str(path));
+ }
+ const versions: []const Semver.Version = old.workspace_versions.values();
+ for (versions) |version| {
+ version.count(old.buffers.string_bytes.items, @TypeOf(&workspace_paths_builder), &workspace_paths_builder);
+ }
+
+ try workspace_paths_builder.allocate();
+
+ new.workspace_paths.entries.len = old.workspace_paths.entries.len;
+
+ for (old.workspace_paths.values(), new.workspace_paths.values()) |*src, *dest| {
+ dest.* = workspace_paths_builder.append(String, old.str(src));
+ }
+ @memcpy(
+ new.workspace_paths.keys(),
+ old.workspace_paths.keys(),
+ );
+
+ try new.workspace_versions.ensureTotalCapacity(z_allocator, old.workspace_versions.count());
+ new.workspace_versions.entries.len = old.workspace_versions.entries.len;
+ for (versions, new.workspace_versions.values()) |src, *dest| {
+ dest.* = src.clone(old.buffers.string_bytes.items, @TypeOf(&workspace_paths_builder), &workspace_paths_builder);
+ }
+
+ @memcpy(
+ new.workspace_versions.keys(),
+ old.workspace_versions.keys(),
+ );
+
+ workspace_paths_builder.clamp();
+
+ try new.workspace_versions.reIndex(z_allocator);
+ try new.workspace_paths.reIndex(z_allocator);
+ }
+
// When you run `"bun add react"
// This is where we update it in the lockfile from "latest" to "^17.0.2"
-
try cloner.flush();
// Don't allow invalid memory to happen
@@ -791,6 +878,7 @@ pub fn cleanWithLogger(
}
new.trusted_dependencies = old_trusted_dependencies;
new.scripts = old_scripts;
+
return new;
}
@@ -962,6 +1050,9 @@ pub const Printer = struct {
.read_file => Output.prettyErrorln("<r><red>error<r> reading lockfile:<r> {s}", .{
@errorName(cause.value),
}),
+ .migrating => Output.prettyErrorln("<r><red>error<r> while migrating lockfile:<r> {s}", .{
+ @errorName(cause.value),
+ }),
}
if (log.errors > 0) {
switch (Output.enable_ansi_colors) {
@@ -1017,6 +1108,7 @@ pub const Printer = struct {
env_loader,
null,
null,
+ .install,
);
var printer = Printer{
@@ -1083,21 +1175,39 @@ pub const Printer = struct {
if (!installed.isSet(package_id)) continue;
- const fmt = comptime brk: {
- if (enable_ansi_colors) {
- break :brk Output.prettyFmt("<r> <green>+<r> <b>{s}<r><d>@{}<r>\n", enable_ansi_colors);
- } else {
- break :brk Output.prettyFmt("<r> + {s}<r><d>@{}<r>\n", enable_ansi_colors);
- }
- };
+ if (PackageManager.instance.formatLaterVersionInCache(package_name, dependency.name_hash, resolved[package_id])) |later_version_fmt| {
+ const fmt = comptime brk: {
+ if (enable_ansi_colors) {
+ break :brk Output.prettyFmt("<r> <green>+<r> <b>{s}<r><d>@{}<r> <d>(<blue>v{} available<r><d>)<r>\n", enable_ansi_colors);
+ } else {
+ break :brk Output.prettyFmt("<r> + {s}<r><d>@{}<r> <d>(v{} available)<r>\n", enable_ansi_colors);
+ }
+ };
+ try writer.print(
+ fmt,
+ .{
+ package_name,
+ resolved[package_id].fmt(string_buf),
+ later_version_fmt,
+ },
+ );
+ } else {
+ const fmt = comptime brk: {
+ if (enable_ansi_colors) {
+ break :brk Output.prettyFmt("<r> <green>+<r> <b>{s}<r><d>@{}<r>\n", enable_ansi_colors);
+ } else {
+ break :brk Output.prettyFmt("<r> + {s}<r><d>@{}<r>\n", enable_ansi_colors);
+ }
+ };
- try writer.print(
- fmt,
- .{
- package_name,
- resolved[package_id].fmt(string_buf),
- },
- );
+ try writer.print(
+ fmt,
+ .{
+ package_name,
+ resolved[package_id].fmt(string_buf),
+ },
+ );
+ }
}
} else {
outer: for (dependencies_buffer, resolutions_buffer, 0..) |dependency, package_id, dep_id| {
@@ -1206,6 +1316,24 @@ pub const Printer = struct {
comptime Writer: type,
writer: Writer,
) !void {
+ // internal for debugging, print the lockfile as custom json
+ // limited to debug because we don't want people to rely on this format.
+ if (Environment.isDebug) {
+ if (std.os.getenv("JSON")) |_| {
+ try std.json.stringify(
+ this.lockfile,
+ .{
+ .whitespace = .indent_2,
+ .emit_null_optional_fields = true,
+ .emit_nonportable_numbers_as_strings = true,
+ },
+ writer,
+ );
+ try writer.writeAll("\n");
+ return;
+ }
+ }
+
try writer.writeAll(
\\# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
\\# yarn lockfile v1
@@ -1362,7 +1490,7 @@ pub const Printer = struct {
var behavior = Behavior.uninitialized;
var dependency_behavior_change_count: u8 = 0;
for (dependencies) |dep| {
- if (dep.behavior != behavior) {
+ if (!dep.behavior.eq(behavior)) {
if (dep.behavior.isOptional()) {
try writer.writeAll(" optionalDependencies:\n");
if (comptime Environment.allow_assert) dependency_behavior_change_count += 1;
@@ -1404,20 +1532,18 @@ pub const Printer = struct {
pub fn verifyData(this: *Lockfile) !void {
std.debug.assert(this.format == Lockfile.FormatVersion.current);
- {
- var i: usize = 0;
- while (i < this.packages.len) : (i += 1) {
- const package: Lockfile.Package = this.packages.get(i);
- std.debug.assert(this.str(&package.name).len == @as(usize, package.name.len()));
- std.debug.assert(String.Builder.stringHash(this.str(&package.name)) == @as(usize, package.name_hash));
- std.debug.assert(package.dependencies.get(this.buffers.dependencies.items).len == @as(usize, package.dependencies.len));
- std.debug.assert(package.resolutions.get(this.buffers.resolutions.items).len == @as(usize, package.resolutions.len));
- std.debug.assert(package.resolutions.get(this.buffers.resolutions.items).len == @as(usize, package.dependencies.len));
- const dependencies = package.dependencies.get(this.buffers.dependencies.items);
- for (dependencies) |dependency| {
- std.debug.assert(this.str(&dependency.name).len == @as(usize, dependency.name.len()));
- std.debug.assert(String.Builder.stringHash(this.str(&dependency.name)) == dependency.name_hash);
- }
+ var i: usize = 0;
+ while (i < this.packages.len) : (i += 1) {
+ const package: Lockfile.Package = this.packages.get(i);
+ std.debug.assert(this.str(&package.name).len == @as(usize, package.name.len()));
+ std.debug.assert(String.Builder.stringHash(this.str(&package.name)) == @as(usize, package.name_hash));
+ std.debug.assert(package.dependencies.get(this.buffers.dependencies.items).len == @as(usize, package.dependencies.len));
+ std.debug.assert(package.resolutions.get(this.buffers.resolutions.items).len == @as(usize, package.resolutions.len));
+ std.debug.assert(package.resolutions.get(this.buffers.resolutions.items).len == @as(usize, package.dependencies.len));
+ const dependencies = package.dependencies.get(this.buffers.dependencies.items);
+ for (dependencies) |dependency| {
+ std.debug.assert(this.str(&dependency.name).len == @as(usize, dependency.name.len()));
+ std.debug.assert(String.Builder.stringHash(this.str(&dependency.name)) == dependency.name_hash);
}
}
}
@@ -1437,7 +1563,7 @@ pub fn verifyResolutions(this: *Lockfile, local_features: Features, remote_featu
for (resolution_list.get(resolutions_buffer), dependency_list.get(dependencies_buffer)) |package_id, failed_dep| {
if (package_id < end) continue;
if (failed_dep.behavior.isPeer() or !failed_dep.behavior.isEnabled(
- if (root_list.contains(@as(PackageID, @truncate(parent_id))))
+ if (root_list.contains(@truncate(parent_id)))
local_features
else
remote_features,
@@ -1634,7 +1760,7 @@ pub fn appendPackage(this: *Lockfile, package_: Lockfile.Package) !Lockfile.Pack
fn appendPackageWithID(this: *Lockfile, package_: Lockfile.Package, id: PackageID) !Lockfile.Package {
defer {
- if (comptime Environment.isDebug) {
+ if (comptime Environment.allow_assert) {
std.debug.assert(this.getPackageID(package_.name_hash, null, &package_.resolution) != null);
}
}
@@ -1795,13 +1921,307 @@ pub const PackageIndex = struct {
};
};
+pub const OverrideMap = struct {
+ const debug = Output.scoped(.OverrideMap, false);
+
+ map: std.ArrayHashMapUnmanaged(PackageNameHash, Dependency, ArrayIdentityContext.U64, false) = .{},
+
+ /// In the future, this `get` function should handle multi-level resolutions. This is difficult right
+ /// now because given a Dependency ID, there is no fast way to trace it to it's package.
+ ///
+ /// A potential approach is to add another buffer to the lockfile that maps Dependency ID to Package ID,
+ /// and from there `OverrideMap.map` can have a union as the value, where the union is between "override all"
+ /// and "here is a list of overrides depending on the package that imported" similar to PackageIndex above.
+ pub fn get(this: *const OverrideMap, name_hash: PackageNameHash) ?Dependency.Version {
+ debug("looking up override for {x}", .{name_hash});
+ return if (this.map.get(name_hash)) |dep|
+ dep.version
+ else
+ null;
+ }
+
+ pub fn deinit(this: *OverrideMap, allocator: Allocator) void {
+ this.map.deinit(allocator);
+ }
+
+ pub fn count(this: *OverrideMap, lockfile: *Lockfile, builder: *Lockfile.StringBuilder) void {
+ for (this.map.values()) |dep| {
+ dep.count(lockfile.buffers.string_bytes.items, @TypeOf(builder), builder);
+ }
+ }
+
+ pub fn clone(this: *OverrideMap, old_lockfile: *Lockfile, new_lockfile: *Lockfile, new_builder: *Lockfile.StringBuilder) !OverrideMap {
+ var new = OverrideMap{};
+ try new.map.ensureTotalCapacity(new_lockfile.allocator, this.map.entries.len);
+
+ for (this.map.keys(), this.map.values()) |k, v| {
+ new.map.putAssumeCapacity(
+ k,
+ try v.clone(old_lockfile.buffers.string_bytes.items, @TypeOf(new_builder), new_builder),
+ );
+ }
+
+ return new;
+ }
+
+ // the rest of this struct is expression parsing code:
+
+ pub fn parseCount(
+ _: *OverrideMap,
+ lockfile: *Lockfile,
+ expr: Expr,
+ builder: *Lockfile.StringBuilder,
+ ) void {
+ if (expr.asProperty("overrides")) |overrides| {
+ if (overrides.expr.data != .e_object)
+ return;
+
+ for (overrides.expr.data.e_object.properties.slice()) |entry| {
+ builder.count(entry.key.?.asString(lockfile.allocator).?);
+ switch (entry.value.?.data) {
+ .e_string => |s| {
+ builder.count(s.slice(lockfile.allocator));
+ },
+ .e_object => {
+ if (entry.value.?.asProperty(".")) |dot| {
+ if (dot.expr.asString(lockfile.allocator)) |s| {
+ builder.count(s);
+ }
+ }
+ },
+ else => {},
+ }
+ }
+ } else if (expr.asProperty("resolutions")) |resolutions| {
+ if (resolutions.expr.data != .e_object)
+ return;
+
+ for (resolutions.expr.data.e_object.properties.slice()) |entry| {
+ builder.count(entry.key.?.asString(lockfile.allocator).?);
+ builder.count(entry.value.?.asString(lockfile.allocator) orelse continue);
+ }
+ }
+ }
+
+ /// Given a package json expression, detect and parse override configuration into the given override map.
+ /// It is assumed the input map is uninitialized (zero entries)
+ pub fn parseAppend(
+ this: *OverrideMap,
+ lockfile: *Lockfile,
+ root_package: *Lockfile.Package,
+ log: *logger.Log,
+ json_source: logger.Source,
+ expr: Expr,
+ builder: *Lockfile.StringBuilder,
+ ) !void {
+ if (Environment.allow_assert) {
+ std.debug.assert(this.map.entries.len == 0); // only call parse once
+ }
+ if (expr.asProperty("overrides")) |overrides| {
+ try this.parseFromOverrides(lockfile, root_package, json_source, log, overrides.expr, builder);
+ } else if (expr.asProperty("resolutions")) |resolutions| {
+ try this.parseFromResolutions(lockfile, root_package, json_source, log, resolutions.expr, builder);
+ }
+ debug("parsed {d} overrides", .{this.map.entries.len});
+ }
+
+ /// https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides
+ pub fn parseFromOverrides(
+ this: *OverrideMap,
+ lockfile: *Lockfile,
+ root_package: *Lockfile.Package,
+ source: logger.Source,
+ log: *logger.Log,
+ expr: Expr,
+ builder: *Lockfile.StringBuilder,
+ ) !void {
+ if (expr.data != .e_object) {
+ try log.addWarningFmt(&source, expr.loc, lockfile.allocator, "\"overrides\" must be an object", .{});
+ return error.Invalid;
+ }
+
+ try this.map.ensureUnusedCapacity(lockfile.allocator, expr.data.e_object.properties.len);
+
+ for (expr.data.e_object.properties.slice()) |prop| {
+ const key = prop.key.?;
+ var k = key.asString(lockfile.allocator).?;
+ if (k.len == 0) {
+ try log.addWarningFmt(&source, key.loc, lockfile.allocator, "Missing overridden package name", .{});
+ continue;
+ }
+
+ const name_hash = String.Builder.stringHash(k);
+
+ const value = value: {
+ // for one level deep, we will only support a string and { ".": value }
+ const value_expr = prop.value.?;
+ if (value_expr.data == .e_string) {
+ break :value value_expr;
+ } else if (value_expr.data == .e_object) {
+ if (value_expr.asProperty(".")) |dot| {
+ if (dot.expr.data == .e_string) {
+ if (value_expr.data.e_object.properties.len > 1) {
+ try log.addWarningFmt(&source, value_expr.loc, lockfile.allocator, "Bun currently does not support nested \"overrides\"", .{});
+ }
+ break :value dot.expr;
+ } else {
+ try log.addWarningFmt(&source, value_expr.loc, lockfile.allocator, "Invalid override value for \"{s}\"", .{k});
+ continue;
+ }
+ } else {
+ try log.addWarningFmt(&source, value_expr.loc, lockfile.allocator, "Bun currently does not support nested \"overrides\"", .{});
+ continue;
+ }
+ }
+ try log.addWarningFmt(&source, value_expr.loc, lockfile.allocator, "Invalid override value for \"{s}\"", .{k});
+ continue;
+ };
+
+ if (try parseOverrideValue(
+ "override",
+ lockfile,
+ root_package,
+ source,
+ value.loc,
+ log,
+ k,
+ value.data.e_string.slice(lockfile.allocator),
+ builder,
+ )) |version| {
+ this.map.putAssumeCapacity(name_hash, version);
+ }
+ }
+ }
+
+ /// yarn classic: https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/
+ /// yarn berry: https://yarnpkg.com/configuration/manifest#resolutions
+ pub fn parseFromResolutions(
+ this: *OverrideMap,
+ lockfile: *Lockfile,
+ root_package: *Lockfile.Package,
+ source: logger.Source,
+ log: *logger.Log,
+ expr: Expr,
+ builder: *Lockfile.StringBuilder,
+ ) !void {
+ if (expr.data != .e_object) {
+ try log.addWarningFmt(&source, expr.loc, lockfile.allocator, "\"resolutions\" must be an object with string values", .{});
+ return;
+ }
+ try this.map.ensureUnusedCapacity(lockfile.allocator, expr.data.e_object.properties.len);
+ for (expr.data.e_object.properties.slice()) |prop| {
+ const key = prop.key.?;
+ var k = key.asString(lockfile.allocator).?;
+ if (strings.hasPrefixComptime(k, "**/"))
+ k = k[3..];
+ if (k.len == 0) {
+ try log.addWarningFmt(&source, key.loc, lockfile.allocator, "Missing resolution package name", .{});
+ continue;
+ }
+ const value = prop.value.?;
+ if (value.data != .e_string) {
+ try log.addWarningFmt(&source, key.loc, lockfile.allocator, "Expected string value for resolution \"{s}\"", .{k});
+ continue;
+ }
+ // currently we only support one level deep, so we should error if there are more than one
+ // - "foo/bar":
+ // - "@namespace/hello/world"
+ if (k[0] == '@') {
+ const first_slash = strings.indexOfChar(k, '/') orelse {
+ try log.addWarningFmt(&source, key.loc, lockfile.allocator, "Invalid package name \"{s}\"", .{k});
+ continue;
+ };
+ if (strings.indexOfChar(k[first_slash + 1 ..], '/') != null) {
+ try log.addWarningFmt(&source, key.loc, lockfile.allocator, "Bun currently does not support nested \"resolutions\"", .{});
+ continue;
+ }
+ } else if (strings.indexOfChar(k, '/') != null) {
+ try log.addWarningFmt(&source, key.loc, lockfile.allocator, "Bun currently does not support nested \"resolutions\"", .{});
+ continue;
+ }
+
+ if (try parseOverrideValue(
+ "resolution",
+ lockfile,
+ root_package,
+ source,
+ value.loc,
+ log,
+ k,
+ value.data.e_string.data,
+ builder,
+ )) |version| {
+ const name_hash = String.Builder.stringHash(k);
+ this.map.putAssumeCapacity(name_hash, version);
+ }
+ }
+ }
+
+ pub fn parseOverrideValue(
+ comptime field: []const u8,
+ lockfile: *Lockfile,
+ root_package: *Lockfile.Package,
+ source: logger.Source,
+ loc: logger.Loc,
+ log: *logger.Log,
+ key: []const u8,
+ value: []const u8,
+ builder: *Lockfile.StringBuilder,
+ ) !?Dependency {
+ if (value.len == 0) {
+ try log.addWarningFmt(&source, loc, lockfile.allocator, "Missing " ++ field ++ " value", .{});
+ return null;
+ }
+
+ // "Overrides may also be defined as a reference to a spec for a direct dependency
+ // by prefixing the name of the package you wish the version to match with a `$`"
+ // https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides
+ // This is why a `*Lockfile.Package` is needed here.
+ if (value[0] == '$') {
+ const ref_name = value[1..];
+ // This is fine for this string to not share the string pool, because it's only used for .eql()
+ const ref_name_str = String.init(ref_name, ref_name);
+ const pkg_deps: []const Dependency = root_package.dependencies.get(lockfile.buffers.dependencies.items);
+ for (pkg_deps) |dep| {
+ if (dep.name.eql(ref_name_str, lockfile.buffers.string_bytes.items, ref_name)) {
+ return dep;
+ }
+ }
+ try log.addWarningFmt(&source, loc, lockfile.allocator, "Could not resolve " ++ field ++ " \"{s}\" (you need \"{s}\" in your dependencies)", .{ value, ref_name });
+ return null;
+ }
+
+ const literalString = builder.append(String, value);
+ const literalSliced = literalString.sliced(lockfile.buffers.string_bytes.items);
+
+ const name_hash = String.Builder.stringHash(key);
+ const name = builder.appendWithHash(String, key, name_hash);
+
+ return Dependency{
+ .name = name,
+ .name_hash = name_hash,
+ .version = Dependency.parse(
+ lockfile.allocator,
+ name,
+ literalSliced.slice,
+ &literalSliced,
+ log,
+ ) orelse {
+ try log.addWarningFmt(&source, loc, lockfile.allocator, "Invalid " ++ field ++ " value \"{s}\"", .{value});
+ return null;
+ },
+ };
+ }
+};
+
pub const FormatVersion = enum(u32) {
- v0,
+ v0 = 0,
// bun v0.0.x - bun v0.1.6
- v1,
+ v1 = 1,
// bun v0.1.7+
// This change added tarball URLs to npm-resolved packages
- v2,
+ v2 = 2,
+
_,
pub const current = FormatVersion.v2;
};
@@ -1821,7 +2241,7 @@ pub const Package = extern struct {
name: String = .{},
name_hash: PackageNameHash = 0,
- /// How a package has been resolved
+ /// How this package has been resolved
/// When .tag is uninitialized, that means the package is not resolved yet.
resolution: Resolution = .{},
@@ -1830,8 +2250,18 @@ pub const Package = extern struct {
/// if resolutions[i] is an invalid package ID, then dependencies[i] is not resolved
dependencies: DependencySlice = .{},
- /// The resolved package IDs for the dependencies
- resolutions: DependencyIDSlice = .{},
+ /// The resolved package IDs for this package's dependencies. Instead of storing this
+ /// on the `Dependency` struct within `.dependencies`, it is stored on the package itself
+ /// so we can access it faster.
+ ///
+ /// Each index in this array corresponds to the same index in dependencies.
+ /// Each value in this array corresponds to the resolved package ID for that dependency.
+ ///
+ /// So this is how you say "what package ID for lodash does this package actually resolve to?"
+ ///
+ /// By default, the underlying buffer is filled with "invalid_id" to indicate this package ID
+ /// was not resolved
+ resolutions: PackageIDSlice = .{},
meta: Meta = .{},
bin: Bin = .{},
@@ -1971,11 +2401,11 @@ pub const Package = extern struct {
field: string,
behavior: Behavior,
- pub const dependencies = DependencyGroup{ .prop = "dependencies", .field = "dependencies", .behavior = @as(Behavior, @enumFromInt(Behavior.normal)) };
- pub const dev = DependencyGroup{ .prop = "devDependencies", .field = "dev_dependencies", .behavior = @as(Behavior, @enumFromInt(Behavior.dev)) };
- pub const optional = DependencyGroup{ .prop = "optionalDependencies", .field = "optional_dependencies", .behavior = @as(Behavior, @enumFromInt(Behavior.optional)) };
- pub const peer = DependencyGroup{ .prop = "peerDependencies", .field = "peer_dependencies", .behavior = @as(Behavior, @enumFromInt(Behavior.peer)) };
- pub const workspaces = DependencyGroup{ .prop = "workspaces", .field = "workspaces", .behavior = @as(Behavior, @enumFromInt(Behavior.workspace)) };
+ pub const dependencies = DependencyGroup{ .prop = "dependencies", .field = "dependencies", .behavior = Behavior.normal };
+ pub const dev = DependencyGroup{ .prop = "devDependencies", .field = "dev_dependencies", .behavior = Behavior.dev };
+ pub const optional = DependencyGroup{ .prop = "optionalDependencies", .field = "optional_dependencies", .behavior = Behavior.optional };
+ pub const peer = DependencyGroup{ .prop = "peerDependencies", .field = "peer_dependencies", .behavior = Behavior.peer };
+ pub const workspaces = DependencyGroup{ .prop = "workspaces", .field = "workspaces", .behavior = Behavior.workspace };
};
pub inline fn isDisabled(this: *const Lockfile.Package) bool {
@@ -2409,6 +2839,7 @@ pub const Package = extern struct {
add: u32 = 0,
remove: u32 = 0,
update: u32 = 0,
+ overrides_changed: bool = false,
pub inline fn sum(this: *Summary, that: Summary) void {
this.add += that.add;
@@ -2417,7 +2848,7 @@ pub const Package = extern struct {
}
pub inline fn hasDiffs(this: Summary) bool {
- return this.add > 0 or this.remove > 0 or this.update > 0;
+ return this.add > 0 or this.remove > 0 or this.update > 0 or this.overrides_changed;
}
};
@@ -2436,6 +2867,23 @@ pub const Package = extern struct {
const from_deps = from.dependencies.get(from_lockfile.buffers.dependencies.items);
const from_resolutions = from.resolutions.get(from_lockfile.buffers.resolutions.items);
var to_i: usize = 0;
+ var skipped_workspaces: usize = 0;
+
+ if (from_lockfile.overrides.map.count() != to_lockfile.overrides.map.count()) {
+ summary.overrides_changed = true;
+ } else {
+ for (
+ from_lockfile.overrides.map.keys(),
+ from_lockfile.overrides.map.values(),
+ to_lockfile.overrides.map.keys(),
+ to_lockfile.overrides.map.values(),
+ ) |from_k, *from_override, to_k, *to_override| {
+ if ((from_k != to_k) or (!from_override.eql(to_override, from_lockfile.buffers.string_bytes.items, to_lockfile.buffers.string_bytes.items))) {
+ summary.overrides_changed = true;
+ break;
+ }
+ }
+ }
for (from_deps, 0..) |*from_dep, i| {
found: {
@@ -2454,6 +2902,11 @@ pub const Package = extern struct {
if (from_dep.name_hash == to_deps[to_i].name_hash) break :found;
}
+ if (PackageManager.instance.workspaces.contains(from_lockfile.str(&from_dep.name))) {
+ skipped_workspaces += 1;
+ continue;
+ }
+
// We found a removed dependency!
// We don't need to remove it
// It will be cleaned up later
@@ -2479,7 +2932,7 @@ pub const Package = extern struct {
if (id_mapping) |mapping| {
const version = to_deps[to_i].version;
if (switch (version.tag) {
- .workspace => if (to_lockfile.workspace_paths.getPtr(@truncate(from_dep.name_hash))) |path_ptr| brk: {
+ .workspace => if (to_lockfile.workspace_paths.getPtr(from_dep.name_hash)) |path_ptr| brk: {
const path = to_lockfile.str(path_ptr);
var file = std.fs.cwd().openFile(Path.join(
&[_]string{ path, "package.json" },
@@ -2521,7 +2974,7 @@ pub const Package = extern struct {
summary.update += 1;
}
- summary.add = @truncate(to_deps.len - (from_deps.len - summary.remove));
+ summary.add = @truncate((to_deps.len + skipped_workspaces) - (from_deps.len - summary.remove));
inline for (Package.Scripts.Hooks) |hook| {
if (!@field(to.scripts, hook).eql(
@@ -2567,7 +3020,6 @@ pub const Package = extern struct {
comptime features: Features,
) !void {
initializeStore();
-
const json = json_parser.ParseJSONUTF8(&source, log, allocator) catch |err| {
switch (Output.enable_ansi_colors) {
inline else => |enable_ansi_colors| {
@@ -2637,8 +3089,20 @@ pub const Package = extern struct {
} else external_alias.hash,
else => external_alias.hash,
};
- const workspace_path = if (comptime tag == null) lockfile.workspace_paths.get(@truncate(name_hash)) else null;
- const workspace_version = if (comptime tag == null) lockfile.workspace_versions.get(@truncate(name_hash)) else workspace_ver;
+
+ var workspace_path: ?String = null;
+ var workspace_version = workspace_ver;
+ if (comptime tag == null) {
+ workspace_path = lockfile.workspace_paths.get(name_hash);
+ workspace_version = lockfile.workspace_versions.get(name_hash);
+
+ if (workspace_path == null or workspace_version == null) {
+ if (PackageManager.instance.workspaces.get(lockfile.str(&external_alias.value))) |_workspace_version| {
+ workspace_path = external_alias.value;
+ workspace_version = _workspace_version;
+ }
+ }
+ }
switch (dependency_version.tag) {
.folder => {
@@ -2716,7 +3180,7 @@ pub const Package = extern struct {
dependency_version.literal = path;
dependency_version.value.workspace = path;
- var workspace_entry = try lockfile.workspace_paths.getOrPut(allocator, @truncate(name_hash));
+ var workspace_entry = try lockfile.workspace_paths.getOrPut(allocator, name_hash);
if (workspace_entry.found_existing) {
if (strings.eqlComptime(workspace, "*")) return null;
@@ -2733,7 +3197,7 @@ pub const Package = extern struct {
workspace_entry.value_ptr.* = path;
if (workspace_version) |ver| {
- try lockfile.workspace_versions.put(allocator, @truncate(name_hash), ver);
+ try lockfile.workspace_versions.put(allocator, name_hash, ver);
for (package_dependencies[0..dependencies_count]) |*package_dep| {
if (switch (package_dep.version.tag) {
@@ -3181,7 +3645,7 @@ pub const Package = extern struct {
a: usize,
b: usize,
) bool {
- return std.mem.order(u8, self.values[a].name, self.values[b].name) == .lt;
+ return strings.order(self.values[a].name, self.values[b].name) == .lt;
}
}{
.values = workspace_names.values(),
@@ -3356,15 +3820,7 @@ pub const Package = extern struct {
return error.InvalidPackageJSON;
}
for (obj.properties.slice()) |item| {
- const key = item.key.?.asString(allocator) orelse {
- log.addErrorFmt(&source, item.key.?.loc, allocator,
- \\{0s} expects a map of specifiers, e.g.
- \\"{0s}": {{
- \\ "bun": "latest"
- \\}}
- , .{group.prop}) catch {};
- return error.InvalidPackageJSON;
- };
+ const key = item.key.?.asString(allocator).?;
const value = item.value.?.asString(allocator) orelse {
log.addErrorFmt(&source, item.value.?.loc, allocator,
\\{0s} expects a map of specifiers, e.g.
@@ -3440,6 +3896,10 @@ pub const Package = extern struct {
}
}
+ if (comptime features.is_main) {
+ lockfile.overrides.parseCount(lockfile, json, &string_builder);
+ }
+
try string_builder.allocate();
try lockfile.buffers.dependencies.ensureUnusedCapacity(lockfile.allocator, total_dependencies_count);
try lockfile.buffers.resolutions.ensureUnusedCapacity(lockfile.allocator, total_dependencies_count);
@@ -3597,6 +4057,11 @@ pub const Package = extern struct {
)) |dep| {
package_dependencies[total_dependencies_count] = dep;
total_dependencies_count += 1;
+
+ try lockfile.workspace_paths.put(allocator, external_name.hash, dep.version.value.workspace);
+ if (entry.version) |v| {
+ try lockfile.workspace_versions.put(allocator, external_name.hash, v);
+ }
}
}
} else {
@@ -3656,24 +4121,34 @@ pub const Package = extern struct {
lockfile.buffers.dependencies.items = lockfile.buffers.dependencies.items.ptr[0..new_len];
lockfile.buffers.resolutions.items = lockfile.buffers.resolutions.items.ptr[0..new_len];
+ // This function depends on package.dependencies being set, so it is done at the very end.
+ if (comptime features.is_main) {
+ try lockfile.overrides.parseAppend(lockfile, package, log, source, json, &string_builder);
+ }
+
string_builder.clamp();
}
- pub const List = std.MultiArrayList(Lockfile.Package);
+ pub const List = bun.MultiArrayList(Lockfile.Package);
pub const Meta = extern struct {
+ // TODO: when we bump the lockfile version, we should reorder this to:
+ // id(32), arch(16), os(16), id(8), man_dir(8), integrity(72 align 8)
+ // should allow us to remove padding bytes
+
+ // TODO: remove origin. it doesnt do anything and can be inferred from the resolution
origin: Origin = Origin.npm,
_padding_origin: u8 = 0,
arch: Npm.Architecture = Npm.Architecture.all,
os: Npm.OperatingSystem = Npm.OperatingSystem.all,
-
_padding_os: u16 = 0,
id: PackageID = invalid_package_id,
man_dir: String = String{},
integrity: Integrity = Integrity{},
+ _padding_integrity: [3]u8 = .{0} ** 3,
/// Does the `cpu` arch and `os` match the requirements listed in the package?
/// This is completely unrelated to "devDependencies", "peerDependencies", "optionalDependencies" etc
@@ -3686,11 +4161,14 @@ pub const Package = extern struct {
}
pub fn clone(this: *const Meta, id: PackageID, buf: []const u8, comptime StringBuilderType: type, builder: StringBuilderType) Meta {
- var new = this.*;
- new.id = id;
- new.man_dir = builder.append(String, this.man_dir.slice(buf));
-
- return new;
+ return Meta{
+ .id = id,
+ .man_dir = builder.append(String, this.man_dir.slice(buf)),
+ .integrity = this.integrity,
+ .arch = this.arch,
+ .os = this.os,
+ .origin = this.origin,
+ };
}
};
@@ -3767,6 +4245,8 @@ pub const Package = extern struct {
inline for (FieldsEnum.fields) |field| {
const value = sliced.items(@field(Lockfile.Package.List.Field, field.name));
+ if (comptime Environment.allow_assert)
+ debug("save(\"{s}\") = {d} bytes", .{ field.name, std.mem.sliceAsBytes(value).len });
comptime assertNoUninitializedPadding(@TypeOf(value));
try writer.writeAll(std.mem.sliceAsBytes(value));
@@ -3848,16 +4328,20 @@ pub fn deinit(this: *Lockfile) void {
this.trusted_dependencies.deinit(this.allocator);
this.workspace_paths.deinit(this.allocator);
this.workspace_versions.deinit(this.allocator);
+ this.overrides.deinit(this.allocator);
}
const Buffers = struct {
trees: Tree.List = .{},
hoisted_dependencies: DependencyIDList = .{},
+ /// This is the underlying buffer used for the `resolutions` external slices inside of `Package`
+ /// Should be the same length as `dependencies`
resolutions: PackageIDList = .{},
+ /// This is the underlying buffer used for the `dependencies` external slices inside of `Package`
dependencies: DependencyList = .{},
+ /// This is the underlying buffer used for any `Semver.ExternalString` instance in the lockfile
extern_strings: ExternalStringBuffer = .{},
- // node_modules_folders: NodeModulesFolderList = NodeModulesFolderList{},
- // node_modules_package_ids: PackageIDList = PackageIDList{},
+ /// This is where all non-inlinable `Semver.String`s are stored.
string_bytes: StringBuffer = .{},
pub fn deinit(this: *Buffers, allocator: Allocator) void {
@@ -4147,6 +4631,10 @@ pub const Serializer = struct {
pub const version = "bun-lockfile-format-v0\n";
const header_bytes: string = "#!/usr/bin/env bun\n" ++ version;
+ const has_workspace_package_ids_tag: u64 = @bitCast([_]u8{ 'w', 'O', 'r', 'K', 's', 'P', 'a', 'C' });
+ const has_trusted_dependencies_tag: u64 = @bitCast([_]u8{ 't', 'R', 'u', 'S', 't', 'E', 'D', 'd' });
+ const has_overrides_tag: u64 = @bitCast([_]u8{ 'o', 'V', 'e', 'R', 'r', 'i', 'D', 's' });
+
pub fn save(this: *Lockfile, comptime StreamType: type, stream: StreamType) !void {
var old_package_list = this.packages;
this.packages = try this.packages.clone(z_allocator);
@@ -4164,6 +4652,90 @@ pub const Serializer = struct {
try Lockfile.Package.Serializer.save(this.packages, StreamType, stream, @TypeOf(&writer), &writer);
try Lockfile.Buffers.save(this.buffers, z_allocator, StreamType, stream, @TypeOf(&writer), &writer);
try writer.writeIntLittle(u64, 0);
+
+ // < Bun v1.0.4 stopped right here when reading the lockfile
+ // So we add an extra 8 byte tag to say "hey, there's more data here"
+ if (this.workspace_versions.count() > 0) {
+ try writer.writeAll(std.mem.asBytes(&has_workspace_package_ids_tag));
+
+ // We need to track the "version" field in "package.json" of workspace member packages
+ // We do not necessarily have that in the Resolution struct. So we store it here.
+ try Lockfile.Buffers.writeArray(
+ StreamType,
+ stream,
+ @TypeOf(&writer),
+ &writer,
+ []PackageNameHash,
+ this.workspace_versions.keys(),
+ );
+ try Lockfile.Buffers.writeArray(
+ StreamType,
+ stream,
+ @TypeOf(&writer),
+ &writer,
+ []Semver.Version,
+ this.workspace_versions.values(),
+ );
+
+ try Lockfile.Buffers.writeArray(
+ StreamType,
+ stream,
+ @TypeOf(&writer),
+ &writer,
+ []PackageNameHash,
+ this.workspace_paths.keys(),
+ );
+ try Lockfile.Buffers.writeArray(
+ StreamType,
+ stream,
+ @TypeOf(&writer),
+ &writer,
+ []String,
+ this.workspace_paths.values(),
+ );
+ }
+
+ if (this.trusted_dependencies.count() > 0) {
+ try writer.writeAll(std.mem.asBytes(&has_trusted_dependencies_tag));
+
+ try Lockfile.Buffers.writeArray(
+ StreamType,
+ stream,
+ @TypeOf(&writer),
+ &writer,
+ []u32,
+ this.trusted_dependencies.keys(),
+ );
+ }
+
+ if (this.overrides.map.count() > 0) {
+ try writer.writeAll(std.mem.asBytes(&has_overrides_tag));
+
+ try Lockfile.Buffers.writeArray(
+ StreamType,
+ stream,
+ @TypeOf(&writer),
+ &writer,
+ []PackageNameHash,
+ this.overrides.map.keys(),
+ );
+ var external_overrides = try std.ArrayListUnmanaged(Dependency.External).initCapacity(z_allocator, this.overrides.map.count());
+ defer external_overrides.deinit(z_allocator);
+ external_overrides.items.len = this.overrides.map.count();
+ for (external_overrides.items, this.overrides.map.values()) |*dest, src| {
+ dest.* = src.toExternal();
+ }
+
+ try Lockfile.Buffers.writeArray(
+ StreamType,
+ stream,
+ @TypeOf(&writer),
+ &writer,
+ []Dependency.External,
+ external_overrides.items,
+ );
+ }
+
const end = try stream.getPos();
try writer.writeAll(&alignment_bytes_to_repeat_buffer);
@@ -4210,29 +4782,161 @@ pub const Serializer = struct {
return error.@"Lockfile is malformed (expected 0 at the end)";
}
- if (comptime Environment.allow_assert) std.debug.assert(stream.pos == total_buffer_size);
+ var has_workspace_name_hashes = false;
+ // < Bun v1.0.4 stopped right here when reading the lockfile
+ // So we add an extra 8 byte tag to say "hey, there's more data here"
+ {
+ const remaining_in_buffer = total_buffer_size -| stream.pos;
+
+ if (remaining_in_buffer > 8 and total_buffer_size <= stream.buffer.len) {
+ const next_num = try reader.readIntLittle(u64);
+ if (next_num == has_workspace_package_ids_tag) {
+ {
+ var workspace_package_name_hashes = try Lockfile.Buffers.readArray(
+ stream,
+ allocator,
+ std.ArrayListUnmanaged(PackageNameHash),
+ );
+ defer workspace_package_name_hashes.deinit(allocator);
- lockfile.scratch = Lockfile.Scratch.init(allocator);
+ var workspace_versions_list = try Lockfile.Buffers.readArray(
+ stream,
+ allocator,
+ std.ArrayListUnmanaged(Semver.Version),
+ );
+ comptime {
+ if (PackageNameHash != @TypeOf((VersionHashMap.KV{ .key = undefined, .value = undefined }).key)) {
+ @compileError("VersionHashMap must be in sync with serialization");
+ }
+ if (Semver.Version != @TypeOf((VersionHashMap.KV{ .key = undefined, .value = undefined }).value)) {
+ @compileError("VersionHashMap must be in sync with serialization");
+ }
+ }
+ defer workspace_versions_list.deinit(allocator);
+ try lockfile.workspace_versions.ensureTotalCapacity(allocator, workspace_versions_list.items.len);
+ lockfile.workspace_versions.entries.len = workspace_versions_list.items.len;
+ @memcpy(lockfile.workspace_versions.keys(), workspace_package_name_hashes.items);
+ @memcpy(lockfile.workspace_versions.values(), workspace_versions_list.items);
+ try lockfile.workspace_versions.reIndex(allocator);
+ }
+
+ {
+ var workspace_paths_hashes = try Lockfile.Buffers.readArray(
+ stream,
+ allocator,
+ std.ArrayListUnmanaged(PackageNameHash),
+ );
+ defer workspace_paths_hashes.deinit(allocator);
+ var workspace_paths_strings = try Lockfile.Buffers.readArray(
+ stream,
+ allocator,
+ std.ArrayListUnmanaged(String),
+ );
+ defer workspace_paths_strings.deinit(allocator);
+
+ try lockfile.workspace_paths.ensureTotalCapacity(allocator, workspace_paths_strings.items.len);
+
+ lockfile.workspace_paths.entries.len = workspace_paths_strings.items.len;
+ @memcpy(lockfile.workspace_paths.keys(), workspace_paths_hashes.items);
+ @memcpy(lockfile.workspace_paths.values(), workspace_paths_strings.items);
+ try lockfile.workspace_paths.reIndex(allocator);
+ }
+ } else {
+ stream.pos -= 8;
+ }
+ }
+ }
{
- lockfile.package_index = PackageIndex.Map.initContext(allocator, .{});
- lockfile.string_pool = StringPool.initContext(allocator, .{});
- try lockfile.package_index.ensureTotalCapacity(@as(u32, @truncate(lockfile.packages.len)));
+ const remaining_in_buffer = total_buffer_size -| stream.pos;
+
+ if (remaining_in_buffer > 8 and total_buffer_size <= stream.buffer.len) {
+ const next_num = try reader.readIntLittle(u64);
+ if (next_num == has_trusted_dependencies_tag) {
+ var trusted_dependencies_hashes = try Lockfile.Buffers.readArray(
+ stream,
+ allocator,
+ std.ArrayListUnmanaged(u32),
+ );
+ defer trusted_dependencies_hashes.deinit(allocator);
+
+ try lockfile.trusted_dependencies.ensureTotalCapacity(allocator, trusted_dependencies_hashes.items.len);
+
+ lockfile.trusted_dependencies.entries.len = trusted_dependencies_hashes.items.len;
+ @memcpy(lockfile.trusted_dependencies.keys(), trusted_dependencies_hashes.items);
+ try lockfile.trusted_dependencies.reIndex(allocator);
+ } else {
+ stream.pos -= 8;
+ }
+ }
+ }
+
+ {
+ const remaining_in_buffer = total_buffer_size -| stream.pos;
+
+ if (remaining_in_buffer > 8 and total_buffer_size <= stream.buffer.len) {
+ const next_num = try reader.readIntLittle(u64);
+ if (next_num == has_overrides_tag) {
+ var overrides_name_hashes = try Lockfile.Buffers.readArray(
+ stream,
+ allocator,
+ std.ArrayListUnmanaged(PackageNameHash),
+ );
+ defer overrides_name_hashes.deinit(allocator);
+
+ var map = lockfile.overrides.map;
+ defer lockfile.overrides.map = map;
+
+ try map.ensureTotalCapacity(allocator, overrides_name_hashes.items.len);
+ var override_versions_external = try Lockfile.Buffers.readArray(
+ stream,
+ allocator,
+ std.ArrayListUnmanaged(Dependency.External),
+ );
+ const context: Dependency.Context = .{
+ .allocator = allocator,
+ .log = log,
+ .buffer = lockfile.buffers.string_bytes.items,
+ };
+ for (overrides_name_hashes.items, override_versions_external.items) |name, value| {
+ map.putAssumeCapacity(name, Dependency.toDependency(value, context));
+ }
+ } else {
+ stream.pos -= 8;
+ }
+ }
+ }
+
+ lockfile.scratch = Lockfile.Scratch.init(allocator);
+ lockfile.package_index = PackageIndex.Map.initContext(allocator, .{});
+ lockfile.string_pool = StringPool.initContext(allocator, .{});
+ try lockfile.package_index.ensureTotalCapacity(@as(u32, @truncate(lockfile.packages.len)));
+
+ if (!has_workspace_name_hashes) {
const slice = lockfile.packages.slice();
const name_hashes = slice.items(.name_hash);
const resolutions = slice.items(.resolution);
for (name_hashes, resolutions, 0..) |name_hash, resolution, id| {
try lockfile.getOrPutID(@as(PackageID, @truncate(id)), name_hash);
+ // compatibility with < Bun v1.0.4
switch (resolution.tag) {
.workspace => {
- try lockfile.workspace_paths.put(allocator, @as(u32, @truncate(name_hash)), resolution.value.workspace);
+ try lockfile.workspace_paths.put(allocator, name_hash, resolution.value.workspace);
},
else => {},
}
}
+ } else {
+ const slice = lockfile.packages.slice();
+ const name_hashes = slice.items(.name_hash);
+ for (name_hashes, 0..) |name_hash, id| {
+ try lockfile.getOrPutID(@as(PackageID, @truncate(id)), name_hash);
+ }
}
+ if (comptime Environment.allow_assert) std.debug.assert(stream.pos == total_buffer_size);
+
// const end = try reader.readIntLittle(u64);
}
};
@@ -4242,7 +4946,7 @@ pub fn hasMetaHashChanged(this: *Lockfile, print_name_version_string: bool) !boo
this.meta_hash = try this.generateMetaHash(print_name_version_string);
return !strings.eqlLong(&previous_meta_hash, &this.meta_hash, false);
}
-fn generateMetaHash(this: *Lockfile, print_name_version_string: bool) !MetaHash {
+pub fn generateMetaHash(this: *Lockfile, print_name_version_string: bool) !MetaHash {
if (this.packages.len <= 1)
return zero_hash;
@@ -4402,3 +5106,294 @@ pub fn hasTrustedDependency(this: *Lockfile, name: []const u8) bool {
return default_trusted_dependencies.has(name);
}
}
+
+pub fn jsonStringifyDependency(this: *const Lockfile, w: anytype, dep: Dependency, res: ?PackageID) !void {
+ const sb = this.buffers.string_bytes.items;
+ var buf: [2048]u8 = undefined;
+
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ try w.objectField("literal");
+ try w.write(dep.version.literal.slice(sb));
+
+ try w.objectField(@tagName(dep.version.tag));
+ switch (dep.version.tag) {
+ .uninitialized => try w.write(null),
+ .npm => {
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ const info: Dependency.Version.NpmInfo = dep.version.value.npm;
+
+ try w.objectField("name");
+ try w.write(info.name.slice(sb));
+
+ try w.objectField("version");
+ try w.write(try std.fmt.bufPrint(&buf, "{}", .{info.version}));
+ },
+ .dist_tag => {
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ const info: Dependency.Version.TagInfo = dep.version.value.dist_tag;
+
+ try w.objectField("name");
+ try w.write(info.name.slice(sb));
+
+ try w.objectField("tag");
+ try w.write(info.name.slice(sb));
+ },
+ .tarball => {
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ const info: Dependency.Version.TarballInfo = dep.version.value.tarball;
+ try w.objectField(@tagName(info.uri));
+ try w.write(switch (info.uri) {
+ inline else => |s| s.slice(sb),
+ });
+
+ try w.objectField("package_name");
+ try w.write(info.package_name.slice(sb));
+ },
+ .folder => {
+ try w.write(dep.version.value.folder.slice(sb));
+ },
+ .symlink => {
+ try w.write(dep.version.value.symlink.slice(sb));
+ },
+ .workspace => {
+ try w.write(dep.version.value.workspace.slice(sb));
+ },
+ .git => {
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ const info: Repository = dep.version.value.git;
+
+ try w.objectField("owner");
+ try w.write(info.owner.slice(sb));
+ try w.objectField("repo");
+ try w.write(info.repo.slice(sb));
+ try w.objectField("committish");
+ try w.write(info.committish.slice(sb));
+ try w.objectField("resolved");
+ try w.write(info.resolved.slice(sb));
+ try w.objectField("package_name");
+ try w.write(info.package_name.slice(sb));
+ },
+ .github => {
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ const info: Repository = dep.version.value.github;
+
+ try w.objectField("owner");
+ try w.write(info.owner.slice(sb));
+ try w.objectField("repo");
+ try w.write(info.repo.slice(sb));
+ try w.objectField("committish");
+ try w.write(info.committish.slice(sb));
+ try w.objectField("resolved");
+ try w.write(info.resolved.slice(sb));
+ try w.objectField("package_name");
+ try w.write(info.package_name.slice(sb));
+ },
+ }
+
+ try w.objectField("resolved_id");
+ try w.write(if (res) |r| if (r == invalid_package_id) null else r else null);
+
+ const behavior = try std.fmt.bufPrint(&buf, "{}", .{dep.behavior});
+ try w.objectField("behavior");
+ try w.write(behavior);
+}
+
+pub fn jsonStringify(this: *const Lockfile, w: anytype) !void {
+ var buf: [2048]u8 = undefined;
+ const sb = this.buffers.string_bytes.items;
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ try w.objectField("format");
+ try w.write(@tagName(this.format));
+ try w.objectField("meta_hash");
+ try w.write(std.fmt.bytesToHex(this.meta_hash, .lower));
+
+ {
+ try w.objectField("package_index");
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ var iter = this.package_index.iterator();
+ while (iter.next()) |it| {
+ const entry: PackageIndex.Entry = it.value_ptr.*;
+ const first_id = switch (entry) {
+ .PackageID => |id| id,
+ .PackageIDMultiple => |ids| ids.items[0],
+ };
+ const name = this.packages.items(.name)[first_id].slice(sb);
+ try w.objectField(name);
+ switch (entry) {
+ .PackageID => |id| try w.write(id),
+ .PackageIDMultiple => |ids| {
+ try w.beginArray();
+ for (ids.items) |id| {
+ try w.write(id);
+ }
+ try w.endArray();
+ },
+ }
+ }
+ }
+ {
+ try w.objectField("packages");
+ try w.beginArray();
+ defer w.endArray() catch {};
+
+ for (0..this.packages.len) |i| {
+ const pkg: Package = this.packages.get(i);
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ try w.objectField("id");
+ try w.write(i);
+
+ try w.objectField("name");
+ try w.write(pkg.name.slice(sb));
+
+ try w.objectField("name_hash");
+ try w.write(pkg.name_hash);
+
+ try w.objectField("resolution");
+ if (pkg.resolution.tag == .uninitialized) {
+ try w.write(null);
+ } else {
+ const b = try std.fmt.bufPrint(&buf, "{s} {s}", .{ @tagName(pkg.resolution.tag), pkg.resolution.fmt(sb) });
+ try w.write(b);
+ }
+
+ try w.objectField("dependencies");
+ {
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ for (pkg.dependencies.get(this.buffers.dependencies.items), pkg.resolutions.get(this.buffers.resolutions.items)) |dep_, res| {
+ const dep: Dependency = dep_;
+ try w.objectField(dep.name.slice(sb));
+ try this.jsonStringifyDependency(w, dep, res);
+ }
+ }
+
+ if (@as(u16, @intFromEnum(pkg.meta.arch)) != Npm.Architecture.all_value) {
+ try w.objectField("arch");
+ try w.beginArray();
+ defer w.endArray() catch {};
+
+ for (Npm.Architecture.NameMap.kvs) |kv| {
+ if (pkg.meta.arch.has(kv.value)) {
+ try w.write(kv.key);
+ }
+ }
+ }
+
+ if (@as(u16, @intFromEnum(pkg.meta.os)) != Npm.OperatingSystem.all_value) {
+ try w.objectField("os");
+ try w.beginArray();
+ defer w.endArray() catch {};
+
+ for (Npm.OperatingSystem.NameMap.kvs) |kv| {
+ if (pkg.meta.os.has(kv.value)) {
+ try w.write(kv.key);
+ }
+ }
+ }
+
+ try w.objectField("integrity");
+ if (pkg.meta.integrity.tag != .unknown) {
+ try w.write(try std.fmt.bufPrint(&buf, "{}", .{pkg.meta.integrity}));
+ } else {
+ try w.write(null);
+ }
+
+ try w.objectField("man_dir");
+ try w.write(pkg.meta.man_dir.slice(sb));
+
+ try w.objectField("origin");
+ try w.write(@tagName(pkg.meta.origin));
+
+ try w.objectField("bin");
+ switch (pkg.bin.tag) {
+ .none => try w.write(null),
+ .file => {
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ try w.objectField("file");
+ try w.write(pkg.bin.value.file.slice(sb));
+ },
+ .named_file => {
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ try w.objectField("name");
+ try w.write(pkg.bin.value.named_file[0].slice(sb));
+
+ try w.objectField("file");
+ try w.write(pkg.bin.value.named_file[1].slice(sb));
+ },
+ .dir => {
+ try w.objectField("dir");
+ try w.write(pkg.bin.value.dir.slice(sb));
+ },
+ .map => {
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ const data: []const ExternalString = pkg.bin.value.map.get(this.buffers.extern_strings.items);
+ var bin_i: usize = 0;
+ while (bin_i < data.len) : (bin_i += 2) {
+ try w.objectField(data[bin_i].slice(sb));
+ try w.write(data[bin_i + 1].slice(sb));
+ }
+ },
+ }
+
+ {
+ try w.objectField("scripts");
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ inline for (comptime std.meta.fieldNames(Lockfile.Scripts)) |field_name| {
+ var script = @field(pkg.scripts, field_name).slice(sb);
+ if (script.len > 0) {
+ try w.objectField(field_name);
+ try w.write(script);
+ }
+ }
+ }
+ }
+ }
+
+ try w.objectField("workspace_paths");
+ {
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ for (this.workspace_paths.keys(), this.workspace_paths.values()) |k, v| {
+ try w.objectField(try std.fmt.bufPrint(&buf, "{d}", .{k}));
+ try w.write(v.slice(sb));
+ }
+ }
+ try w.objectField("workspace_versions");
+ {
+ try w.beginObject();
+ defer w.endObject() catch {};
+
+ for (this.workspace_versions.keys(), this.workspace_versions.values()) |k, v| {
+ try w.objectField(try std.fmt.bufPrint(&buf, "{d}", .{k}));
+ try w.write(try std.fmt.bufPrint(&buf, "{}", .{v.fmt(sb)}));
+ }
+ }
+}
diff --git a/src/install/migration.zig b/src/install/migration.zig
new file mode 100644
index 000000000..d74be7265
--- /dev/null
+++ b/src/install/migration.zig
@@ -0,0 +1,947 @@
+const std = @import("std");
+const Allocator = std.mem.Allocator;
+
+const bun = @import("root").bun;
+const string = bun.string;
+const Output = bun.Output;
+const Global = bun.Global;
+const Environment = bun.Environment;
+const strings = bun.strings;
+const MutableString = bun.MutableString;
+const stringZ = bun.stringZ;
+const logger = bun.logger;
+
+const Install = @import("./install.zig");
+const Resolution = @import("./resolution.zig").Resolution;
+const Dependency = @import("./dependency.zig");
+const VersionedURL = @import("./versioned_url.zig");
+const Npm = @import("./npm.zig");
+const Integrity = @import("./integrity.zig").Integrity;
+const Bin = @import("./bin.zig").Bin;
+
+const Semver = @import("./semver.zig");
+const String = Semver.String;
+const ExternalString = Semver.ExternalString;
+const stringHash = String.Builder.stringHash;
+
+const Lockfile = @import("./lockfile.zig");
+const LoadFromDiskResult = Lockfile.LoadFromDiskResult;
+
+const JSAst = bun.JSAst;
+const Expr = JSAst.Expr;
+const B = JSAst.B;
+const E = JSAst.E;
+const G = JSAst.G;
+const S = JSAst.S;
+
+const debug = Output.scoped(.migrate, false);
+
+pub fn detectAndLoadOtherLockfile(this: *Lockfile, allocator: Allocator, log: *logger.Log, bun_lockfile_path: stringZ) LoadFromDiskResult {
+ const dirname = bun_lockfile_path[0 .. strings.lastIndexOfChar(bun_lockfile_path, '/') orelse 0];
+ // check for package-lock.json, yarn.lock, etc...
+ // if it exists, do an in-memory migration
+ var buf: [bun.MAX_PATH_BYTES]u8 = undefined;
+ @memcpy(buf[0..dirname.len], dirname);
+
+ const cwd = std.fs.cwd();
+
+ npm: {
+ const npm_lockfile_name = "package-lock.json";
+ @memcpy(buf[dirname.len .. dirname.len + npm_lockfile_name.len], npm_lockfile_name);
+ buf[dirname.len + npm_lockfile_name.len] = 0;
+ const lockfile_path = buf[0 .. dirname.len + npm_lockfile_name.len :0];
+ var timer = std.time.Timer.start() catch unreachable;
+ const file = cwd.openFileZ(lockfile_path, .{ .mode = .read_only }) catch break :npm;
+ defer file.close();
+ var data = file.readToEndAlloc(allocator, std.math.maxInt(usize)) catch |err| {
+ return LoadFromDiskResult{ .err = .{ .step = .migrating, .value = err } };
+ };
+ const lockfile = migrateNPMLockfile(this, allocator, log, data, lockfile_path) catch |err| {
+ if (err == error.NPMLockfileVersionMismatch) {
+ Output.prettyErrorln(
+ \\<red><b>error<r><d>:<r> Please upgrade package-lock.json to lockfileVersion 3
+ \\
+ \\Run 'npm i --lockfile-version 3 --frozen-lockfile' to upgrade your lockfile without changing dependencies.
+ , .{});
+ Global.exit(1);
+ }
+ if (Environment.allow_assert) {
+ const maybe_trace = @errorReturnTrace();
+ Output.prettyErrorln("Error: {s}", .{@errorName(err)});
+ log.printForLogLevel(Output.errorWriter()) catch {};
+ if (maybe_trace) |trace| {
+ std.debug.dumpStackTrace(trace.*);
+ }
+ Output.prettyErrorln("Invalid NPM package-lock.json\nIn a release build, this would ignore and do a fresh install.\nAborting", .{});
+ Global.exit(1);
+ }
+ return LoadFromDiskResult{ .err = .{ .step = .migrating, .value = err } };
+ };
+
+ if (lockfile == .ok) {
+ Output.printElapsed(@as(f64, @floatFromInt(timer.read())) / std.time.ns_per_ms);
+ Output.prettyError(" ", .{});
+ Output.prettyErrorln("<d>migrated lockfile from <r><green>package-lock.json<r>", .{});
+ Output.flush();
+ }
+
+ return lockfile;
+ }
+
+ return LoadFromDiskResult{ .not_found = {} };
+}
+
+const IdMap = std.StringHashMapUnmanaged(IdMapValue);
+const IdMapValue = struct {
+ /// index into the old package-lock.json package entries.
+ old_json_index: u32,
+ /// this is the new package id for the bun lockfile
+ ///
+ /// - if this new_package_id is set to `package_id_is_link`, it means it's a link
+ /// and to get the actual package id, you need to lookup `.resolved` in the hashmap.
+ /// - if it is `package_id_is_bundled`, it means it's a bundled dependency that was not
+ /// marked by npm, which can happen to some transitive dependencies.
+ new_package_id: u32,
+};
+const package_id_is_link = std.math.maxInt(u32);
+const package_id_is_bundled = std.math.maxInt(u32) - 1;
+
+const unset_package_id = Install.invalid_package_id - 1;
+
+const dependency_keys = .{
+ .dependencies,
+ .devDependencies,
+ .peerDependencies,
+ .optionalDependencies,
+};
+
+pub fn migrateNPMLockfile(this: *Lockfile, allocator: Allocator, log: *logger.Log, data: string, path: string) !LoadFromDiskResult {
+ debug("begin lockfile migration", .{});
+
+ try this.initEmpty(allocator);
+ Install.initializeStore();
+
+ const json_src = logger.Source.initPathString(path, data);
+ const json = bun.JSON.ParseJSONUTF8(&json_src, log, allocator) catch return error.InvalidNPMLockfile;
+
+ if (json.data != .e_object) {
+ return error.InvalidNPMLockfile;
+ }
+ if (json.get("lockfileVersion")) |version| {
+ if (!(version.data == .e_number and version.data.e_number.value == 3)) {
+ return error.NPMLockfileVersionMismatch;
+ }
+ } else {
+ return error.InvalidNPMLockfile;
+ }
+
+ // Count pass
+ var builder_ = this.stringBuilder();
+ var builder = &builder_;
+ const name = (if (json.get("name")) |expr| expr.asString(allocator) else null) orelse "";
+ builder.count(name);
+
+ var root_package: *E.Object = undefined;
+ var packages_properties = brk: {
+ const obj = json.get("packages") orelse return error.InvalidNPMLockfile;
+ if (obj.data != .e_object) return error.InvalidNPMLockfile;
+ if (obj.data.e_object.properties.len == 0) return error.InvalidNPMLockfile;
+ const prop1 = obj.data.e_object.properties.at(0);
+ if (prop1.key) |k| {
+ if (k.data != .e_string) return error.InvalidNPMLockfile;
+ // first key must be the "", self reference
+ if (k.data.e_string.data.len != 0) return error.InvalidNPMLockfile;
+ if (prop1.value.?.data != .e_object) return error.InvalidNPMLockfile;
+ root_package = prop1.value.?.data.e_object;
+ } else return error.InvalidNPMLockfile;
+ break :brk obj.data.e_object.properties;
+ };
+
+ var num_deps: u32 = 0;
+
+ const workspace_map: ?Lockfile.Package.WorkspaceMap = workspace_map: {
+ if (root_package.get("workspaces")) |wksp| {
+ var workspaces = Lockfile.Package.WorkspaceMap.init(allocator);
+
+ const json_array = switch (wksp.data) {
+ .e_array => |arr| arr,
+ .e_object => |obj| if (obj.get("packages")) |packages| switch (packages.data) {
+ .e_array => |arr| arr,
+ else => return error.InvalidNPMLockfile,
+ } else return error.InvalidNPMLockfile,
+ else => return error.InvalidNPMLockfile,
+ };
+
+ const workspace_packages_count = try Lockfile.Package.processWorkspaceNamesArray(
+ &workspaces,
+ allocator,
+ log,
+ json_array,
+ &json_src,
+ wksp.loc,
+ builder,
+ );
+ debug("found {d} workspace packages", .{workspace_packages_count});
+ num_deps += workspace_packages_count;
+ break :workspace_map workspaces;
+ }
+ break :workspace_map null;
+ };
+
+ // Counting Phase
+ // This "IdMap" is used to make object key lookups faster for the `packages` object
+ // it also lets us resolve linked and bundled packages.
+ var id_map = IdMap{};
+ try id_map.ensureTotalCapacity(allocator, packages_properties.len);
+ var num_extern_strings: u32 = 0;
+ var package_idx: u32 = 0;
+ for (packages_properties.slice(), 0..) |entry, i| {
+ const pkg_path = entry.key.?.asString(allocator).?;
+ if (entry.value.?.data != .e_object)
+ return error.InvalidNPMLockfile;
+
+ const pkg = entry.value.?.data.e_object;
+
+ if (pkg.get("link") != null) {
+ id_map.putAssumeCapacity(
+ pkg_path,
+ IdMapValue{
+ .old_json_index = @truncate(i),
+ .new_package_id = package_id_is_link,
+ },
+ );
+ continue;
+ }
+ if (pkg.get("inBundle")) |x| if (x.data == .e_boolean and x.data.e_boolean.value) {
+ id_map.putAssumeCapacity(
+ pkg_path,
+ IdMapValue{
+ .old_json_index = @truncate(i),
+ .new_package_id = package_id_is_bundled,
+ },
+ );
+ continue;
+ };
+ if (pkg.get("extraneous")) |x| if (x.data == .e_boolean and x.data.e_boolean.value) {
+ continue;
+ };
+
+ id_map.putAssumeCapacity(
+ pkg_path,
+ IdMapValue{
+ .old_json_index = @truncate(i),
+ .new_package_id = package_idx,
+ },
+ );
+ package_idx += 1;
+
+ inline for (dependency_keys) |dep_key| {
+ if (pkg.get(@tagName(dep_key))) |deps| {
+ if (deps.data != .e_object) {
+ return error.InvalidNPMLockfile;
+ }
+ num_deps +|= @as(u32, deps.data.e_object.properties.len);
+
+ for (deps.data.e_object.properties.slice()) |dep| {
+ const dep_name = dep.key.?.asString(allocator).?;
+ const version_string = dep.value.?.asString(allocator) orelse return error.InvalidNPMLockfile;
+
+ builder.count(dep_name);
+ builder.count(version_string);
+
+ // If it's a folder or workspace, pessimistically assume we will need a maximum path
+ switch (Dependency.Version.Tag.infer(version_string)) {
+ .folder, .workspace => builder.cap += bun.MAX_PATH_BYTES,
+ else => {},
+ }
+ }
+ }
+ }
+
+ if (pkg.get("bin")) |bin| {
+ if (bin.data != .e_object) return error.InvalidNPMLockfile;
+ switch (bin.data.e_object.properties.len) {
+ 0 => return error.InvalidNPMLockfile,
+ 1 => {
+ const first_bin = bin.data.e_object.properties.at(0);
+ const key = first_bin.key.?.asString(allocator).?;
+
+ const workspace_entry = if (workspace_map) |map| map.map.get(pkg_path) else null;
+ const is_workspace = workspace_entry != null;
+
+ const pkg_name = if (is_workspace)
+ workspace_entry.?.name
+ else if (entry.value.?.get("name")) |set_name|
+ (set_name.asString(this.allocator) orelse return error.InvalidNPMLockfile)
+ else
+ packageNameFromPath(pkg_path);
+
+ if (!strings.eql(key, pkg_name)) {
+ builder.count(key);
+ }
+ builder.count(first_bin.value.?.asString(allocator) orelse return error.InvalidNPMLockfile);
+ },
+ else => {
+ for (bin.data.e_object.properties.slice()) |bin_entry| {
+ builder.count(bin_entry.key.?.asString(allocator).?);
+ builder.count(bin_entry.value.?.asString(allocator) orelse return error.InvalidNPMLockfile);
+ }
+ num_extern_strings += @truncate(bin.data.e_object.properties.len * 2);
+ },
+ }
+ }
+
+ if (pkg.get("resolved")) |resolved_expr| {
+ const resolved = resolved_expr.asString(allocator) orelse return error.InvalidNPMLockfile;
+ if (strings.hasPrefixComptime(resolved, "file:")) {
+ builder.count(resolved[5..]);
+ } else if (strings.hasPrefixComptime(resolved, "git+")) {
+ builder.count(resolved[4..]);
+ } else {
+ builder.count(resolved);
+
+ // this is over-counting but whatever. it would be too hard to determine if the case here
+ // is an `npm`/`dist_tag` version (the only times this is actually used)
+ if (pkg.get("version")) |v| if (v.asString(allocator)) |s| {
+ builder.count(s);
+ };
+ }
+ } else {
+ builder.count(pkg_path);
+ }
+ }
+ if (num_deps == std.math.maxInt(u32)) return error.InvalidNPMLockfile; // lol
+
+ debug("counted {d} dependencies", .{num_deps});
+ debug("counted {d} extern strings", .{num_extern_strings});
+ debug("counted {d} packages", .{package_idx});
+
+ try this.buffers.dependencies.ensureTotalCapacity(allocator, num_deps);
+ try this.buffers.resolutions.ensureTotalCapacity(allocator, num_deps);
+ try this.buffers.extern_strings.ensureTotalCapacity(allocator, num_extern_strings);
+ try this.packages.ensureTotalCapacity(allocator, package_idx);
+ // The package index is overallocated, but we know the upper bound
+ try this.package_index.ensureTotalCapacity(package_idx);
+ try builder.allocate();
+
+ if (workspace_map) |wksp| {
+ try this.workspace_paths.ensureTotalCapacity(allocator, wksp.map.unmanaged.entries.len);
+ try this.workspace_versions.ensureTotalCapacity(allocator, wksp.map.unmanaged.entries.len);
+
+ for (wksp.map.keys(), wksp.map.values()) |k, v| {
+ const name_hash = stringHash(v.name);
+ this.workspace_paths.putAssumeCapacity(name_hash, builder.append(String, k));
+ if (v.version) |version| this.workspace_versions.putAssumeCapacity(name_hash, version);
+ }
+ }
+
+ // Package Building Phase
+ // This initializes every package and sets the resolution to uninitialized
+ for (packages_properties.slice()) |entry| {
+ // this pass is allowed to make more assumptions because we already checked things during
+ // the counting pass
+ const pkg = entry.value.?.data.e_object;
+
+ if (pkg.get("link") != null or if (pkg.get("inBundle") orelse pkg.get("extraneous")) |x| x.data == .e_boolean and x.data.e_boolean.value else false) continue;
+
+ const pkg_path = entry.key.?.asString(allocator).?;
+
+ const workspace_entry = if (workspace_map) |map| map.map.get(pkg_path) else null;
+ const is_workspace = workspace_entry != null;
+
+ const pkg_name = if (is_workspace)
+ workspace_entry.?.name
+ else if (pkg.get("name")) |set_name|
+ (set_name.asString(this.allocator) orelse unreachable)
+ else
+ packageNameFromPath(pkg_path);
+
+ const name_hash = stringHash(pkg_name);
+
+ const package_id: Install.PackageID = @intCast(this.packages.len);
+ if (Environment.allow_assert) {
+ // If this is false, then it means we wrote wrong resolved ids
+ // During counting phase we assign all the packages an id.
+ std.debug.assert(package_id == id_map.get(pkg_path).?.new_package_id);
+ }
+
+ // Instead of calling this.appendPackage, manually append
+ // the other function has some checks that will fail since we have not set resolution+dependencies yet.
+ this.packages.appendAssumeCapacity(Lockfile.Package{
+ .name = builder.appendWithHash(String, pkg_name, name_hash),
+ .name_hash = name_hash,
+
+ // For non workspace packages these are set to .uninitialized, then in the third phase
+ // they are resolved. This is because the resolution uses the dependant's version
+ // specifier as a "hint" to resolve the dependency.
+ .resolution = if (is_workspace) Resolution.init(.{
+ // This string is counted by `processWorkspaceNamesArray`
+ .workspace = builder.append(String, pkg_path),
+ }) else Resolution{},
+
+ // we fill this data in later
+ .dependencies = undefined,
+ .resolutions = undefined,
+
+ .meta = .{
+ .id = package_id,
+
+ .origin = if (package_id == 0) .local else .npm,
+
+ .arch = if (pkg.get("cpu")) |cpu_array| arch: {
+ if (cpu_array.data != .e_array) return error.InvalidNPMLockfile;
+ var arch: Npm.Architecture = .none;
+ for (cpu_array.data.e_array.items.slice()) |item| {
+ if (item.data != .e_string) return error.InvalidNPMLockfile;
+ arch = arch.apply(item.data.e_string.data);
+ }
+ break :arch arch;
+ } else .all,
+
+ .os = if (pkg.get("os")) |cpu_array| arch: {
+ if (cpu_array.data != .e_array) return error.InvalidNPMLockfile;
+ var os: Npm.OperatingSystem = .none;
+ for (cpu_array.data.e_array.items.slice()) |item| {
+ if (item.data != .e_string) return error.InvalidNPMLockfile;
+ os = os.apply(item.data.e_string.data);
+ }
+ break :arch os;
+ } else .all,
+
+ .man_dir = String{},
+
+ .integrity = if (pkg.get("integrity")) |integrity|
+ try Integrity.parse(
+ integrity.asString(this.allocator) orelse
+ return error.InvalidNPMLockfile,
+ )
+ else
+ Integrity{},
+ },
+ .bin = if (pkg.get("bin")) |bin| bin: {
+ // we already check these conditions during counting
+ std.debug.assert(bin.data == .e_object);
+ std.debug.assert(bin.data.e_object.properties.len > 0);
+
+ // in npm lockfile, the bin is always an object, even if it is only a single one
+ // we need to detect if it's a single entry and lower it to a file.
+ if (bin.data.e_object.properties.len == 1) {
+ const prop = bin.data.e_object.properties.at(0);
+ const key = prop.key.?.asString(this.allocator) orelse return error.InvalidNPMLockfile;
+ const script_value = prop.value.?.asString(this.allocator) orelse return error.InvalidNPMLockfile;
+
+ if (strings.eql(key, pkg_name)) {
+ break :bin .{
+ .tag = .file,
+ .value = Bin.Value.init(.{
+ .file = builder.append(String, script_value),
+ }),
+ };
+ }
+
+ break :bin .{
+ .tag = .named_file,
+ .value = Bin.Value.init(.{
+ .named_file = .{
+ builder.append(String, key),
+ builder.append(String, script_value),
+ },
+ }),
+ };
+ }
+
+ const view: Install.ExternalStringList = .{
+ .off = @truncate(this.buffers.extern_strings.items.len),
+ .len = @intCast(bin.data.e_object.properties.len * 2),
+ };
+
+ for (bin.data.e_object.properties.slice()) |bin_entry| {
+ const key = bin_entry.key.?.asString(this.allocator) orelse return error.InvalidNPMLockfile;
+ const script_value = bin_entry.value.?.asString(this.allocator) orelse return error.InvalidNPMLockfile;
+ this.buffers.extern_strings.appendAssumeCapacity(builder.append(ExternalString, key));
+ this.buffers.extern_strings.appendAssumeCapacity(builder.append(ExternalString, script_value));
+ }
+
+ if (Environment.allow_assert) {
+ std.debug.assert(this.buffers.extern_strings.items.len == view.off + view.len);
+ std.debug.assert(this.buffers.extern_strings.items.len <= this.buffers.extern_strings.capacity);
+ }
+
+ break :bin .{
+ .tag = .map,
+ .value = Bin.Value.init(.{
+ .map = view,
+ }),
+ };
+ } else Bin.init(),
+
+ .scripts = .{},
+ });
+
+ if (is_workspace) {
+ std.debug.assert(package_id != 0); // root package should not be in it's own workspace
+
+ // we defer doing getOrPutID for non-workspace packages because it depends on the resolution being set.
+ try this.getOrPutID(package_id, name_hash);
+ }
+ }
+
+ if (Environment.allow_assert) {
+ std.debug.assert(this.packages.len == package_idx);
+ }
+
+ // ignoring length check because we pre-allocated it. the length may shrink later
+ // so it's faster if we ignore the underlying length buffer and just assign it at the very end.
+ var dependencies_buf = this.buffers.dependencies.items.ptr[0..num_deps];
+ var resolutions_buf = this.buffers.resolutions.items.ptr[0..num_deps];
+
+ // pre-initialize the dependencies and resolutions to `unset_package_id`
+ if (Environment.allow_assert) {
+ @memset(dependencies_buf, Dependency{});
+ @memset(resolutions_buf, unset_package_id);
+ }
+
+ var resolutions = this.packages.items(.resolution);
+ var metas = this.packages.items(.meta);
+ var dependencies_list = this.packages.items(.dependencies);
+ var resolution_list = this.packages.items(.resolutions);
+
+ if (Environment.allow_assert) {
+ for (resolutions) |r| {
+ std.debug.assert(r.tag == .uninitialized or r.tag == .workspace);
+ }
+ }
+
+ // Root resolution isn't hit through dependency tracing.
+ resolutions[0] = Resolution.init(.{ .root = {} });
+ metas[0].origin = .local;
+ try this.getOrPutID(0, this.packages.items(.name_hash)[0]);
+
+ // made it longer than max path just in case something stupid happens
+ var name_checking_buf: [bun.MAX_PATH_BYTES * 2]u8 = undefined;
+
+ // Dependency Linking Phase
+ package_idx = 0;
+ var is_first = true;
+ for (packages_properties.slice()) |entry| {
+ // this pass is allowed to make more assumptions because we already checked things during
+ // the counting pass
+ const pkg = entry.value.?.data.e_object;
+
+ if (pkg.get("link") != null or if (pkg.get("inBundle") orelse pkg.get("extraneous")) |x| x.data == .e_boolean and x.data.e_boolean.value else false) continue;
+
+ const pkg_path = entry.key.?.asString(allocator).?;
+
+ const dependencies_start = dependencies_buf.ptr;
+ const resolutions_start = resolutions_buf.ptr;
+
+ // this is in a defer because there are two places we end this loop iteration at.
+ defer {
+ if (dependencies_start == dependencies_buf.ptr) {
+ dependencies_list[package_idx] = .{ .len = 0 };
+ resolution_list[package_idx] = .{ .len = 0 };
+ } else {
+ // Calculate the offset + length by pointer arithmetic
+ const len: u32 = @truncate((@intFromPtr(resolutions_buf.ptr) - @intFromPtr(resolutions_start)) / @sizeOf(Install.PackageID));
+ if (Environment.allow_assert) {
+ std.debug.assert(len > 0);
+ std.debug.assert(len == ((@intFromPtr(dependencies_buf.ptr) - @intFromPtr(dependencies_start)) / @sizeOf(Dependency)));
+ }
+ dependencies_list[package_idx] = .{
+ .off = @truncate((@intFromPtr(dependencies_start) - @intFromPtr(this.buffers.dependencies.items.ptr)) / @sizeOf(Dependency)),
+ .len = len,
+ };
+ resolution_list[package_idx] = .{
+ .off = @truncate((@intFromPtr(resolutions_start) - @intFromPtr(this.buffers.resolutions.items.ptr)) / @sizeOf(Install.PackageID)),
+ .len = len,
+ };
+ }
+
+ package_idx += 1;
+ }
+
+ // a feature no one has heard about: https://docs.npmjs.com/cli/v10/configuring-npm/package-json#bundledependencies
+ const bundled_dependencies = if (pkg.get("bundleDependencies") orelse pkg.get("bundledDependencies")) |expr| deps: {
+ if (expr.data == .e_boolean) {
+ if (expr.data.e_boolean.value) continue;
+ break :deps null;
+ }
+ if (expr.data != .e_array) return error.InvalidNPMLockfile;
+ const arr: *E.Array = expr.data.e_array;
+ var map = std.StringArrayHashMapUnmanaged(void){};
+ try map.ensureTotalCapacity(allocator, arr.items.len);
+ for (arr.items.slice()) |item| {
+ map.putAssumeCapacity(item.asString(allocator) orelse return error.InvalidNPMLockfile, {});
+ }
+ break :deps map;
+ } else null;
+
+ if (is_first) {
+ is_first = false;
+ if (workspace_map) |wksp| {
+ for (wksp.keys(), wksp.values()) |key, value| {
+ const entry1 = id_map.get(key) orelse return error.InvalidNPMLockfile;
+ const name_hash = stringHash(value.name);
+ const wksp_name = builder.append(String, value.name);
+ const wksp_path = builder.append(String, key);
+ dependencies_buf[0] = Dependency{
+ .name = wksp_name,
+ .name_hash = name_hash,
+ .version = .{
+ .tag = .workspace,
+ .literal = wksp_path,
+ .value = .{
+ .workspace = wksp_path,
+ },
+ },
+ .behavior = .{
+ .workspace = true,
+ },
+ };
+ resolutions_buf[0] = entry1.new_package_id;
+
+ dependencies_buf = dependencies_buf[1..];
+ resolutions_buf = resolutions_buf[1..];
+ }
+ }
+ }
+
+ inline for (dependency_keys) |dep_key| {
+ if (pkg.get(@tagName(dep_key))) |deps| {
+ // fetch the peerDependenciesMeta if it exists
+ // this is only done for peerDependencies, obviously
+ const peer_dep_meta = if (dep_key == .peerDependencies)
+ if (pkg.get("peerDependenciesMeta")) |expr| peer_dep_meta: {
+ if (expr.data != .e_object) return error.InvalidNPMLockfile;
+ break :peer_dep_meta expr.data.e_object;
+ } else null
+ else
+ void{};
+
+ if (deps.data != .e_object) return error.InvalidNPMLockfile;
+ const properties = deps.data.e_object.properties;
+
+ dep_loop: for (properties.slice()) |prop| {
+ const name_bytes = prop.key.?.asString(this.allocator).?;
+ if (bundled_dependencies != null and bundled_dependencies.?.getIndex(name_bytes) != null) continue :dep_loop;
+
+ const version_bytes = prop.value.?.asString(this.allocator) orelse return error.InvalidNPMLockfile;
+ const name_hash = stringHash(name_bytes);
+ const dep_name = builder.appendWithHash(String, name_bytes, name_hash);
+
+ const dep_version = builder.append(String, version_bytes);
+ const sliced = dep_version.sliced(this.buffers.string_bytes.items);
+
+ debug("parsing {s}, {s}\n", .{ name_bytes, version_bytes });
+ const version = Dependency.parse(
+ this.allocator,
+ dep_name,
+ sliced.slice,
+ &sliced,
+ log,
+ ) orelse {
+ return error.InvalidNPMLockfile;
+ };
+ debug("-> {s}, {}\n", .{ @tagName(version.tag), version.value });
+
+ if (Environment.allow_assert) {
+ std.debug.assert(version.tag != .uninitialized);
+ }
+
+ const str_node_modules = if (pkg_path.len == 0) "node_modules/" else "/node_modules/";
+ const suffix_len = str_node_modules.len + name_bytes.len;
+
+ var buf_len: u32 = @as(u32, @intCast(pkg_path.len + suffix_len));
+ if (buf_len > name_checking_buf.len) {
+ return error.PathTooLong;
+ }
+
+ bun.copy(u8, name_checking_buf[0..pkg_path.len], pkg_path);
+ bun.copy(u8, name_checking_buf[pkg_path.len .. pkg_path.len + str_node_modules.len], str_node_modules);
+ bun.copy(u8, name_checking_buf[pkg_path.len + str_node_modules.len .. pkg_path.len + suffix_len], name_bytes);
+
+ while (true) {
+ debug("checking {s}", .{name_checking_buf[0..buf_len]});
+ if (id_map.get(name_checking_buf[0..buf_len])) |found_| {
+ var found = found_;
+ if (found.new_package_id == package_id_is_link) {
+ // it is a workspace package, resolve from the "link": true entry to the real entry.
+ const ref_pkg = packages_properties.at(found.old_json_index).value.?.data.e_object;
+ // the `else` here is technically possible to hit
+ const resolved_v = ref_pkg.get("resolved") orelse return error.LockfileWorkspaceMissingResolved;
+ const resolved = resolved_v.asString(this.allocator) orelse return error.InvalidNPMLockfile;
+ found = (id_map.get(resolved) orelse return error.InvalidNPMLockfile);
+ } else if (found.new_package_id == package_id_is_bundled) {
+ debug("skipping bundled dependency {s}", .{name_bytes});
+ continue :dep_loop;
+ }
+
+ const id = found.new_package_id;
+
+ var is_workspace = resolutions[id].tag == .workspace;
+
+ dependencies_buf[0] = Dependency{
+ .name = dep_name,
+ .name_hash = name_hash,
+ .version = version,
+ .behavior = .{
+ .normal = dep_key == .dependencies,
+ .optional = dep_key == .optionalDependencies,
+ .dev = dep_key == .devDependencies,
+ .peer = dep_key == .peerDependencies,
+ .workspace = is_workspace,
+ },
+ };
+ resolutions_buf[0] = id;
+
+ dependencies_buf = dependencies_buf[1..];
+ resolutions_buf = resolutions_buf[1..];
+
+ // If the package resolution is not set, resolve the target package
+ // using the information we have from the dependency declaration.
+ if (resolutions[id].tag == .uninitialized) {
+ debug("resolving '{s}'", .{name_bytes});
+
+ const res = resolved: {
+ const dep_pkg = packages_properties.at(found.old_json_index).value.?.data.e_object;
+ const npm_resolution = dep_pkg.get("resolved") orelse {
+ break :resolved Resolution.init(.{
+ .folder = builder.append(
+ String,
+ packages_properties.at(found.old_json_index).key.?.asString(allocator).?,
+ ),
+ });
+ };
+ const dep_resolved = npm_resolution.asString(this.allocator) orelse return error.InvalidNPMLockfile;
+
+ break :resolved switch (version.tag) {
+ .uninitialized => std.debug.panic("Version string {s} resolved to `.uninitialized`", .{version_bytes}),
+ .npm, .dist_tag => res: {
+ // It is theoretically possible to hit this in a case where the resolved dependency is NOT
+ // an npm dependency, but that case is so convoluted that it is not worth handling.
+ //
+ // Deleting 'package-lock.json' would completely break the installation of the project.
+ //
+ // We assume that the given URL is to *some* npm registry, or the resolution is to a workspace package.
+ // If it is a workspace package, then this branch will not be hit as the resolution was already set earlier.
+ const dep_actual_version = (dep_pkg.get("version") orelse return error.InvalidNPMLockfile)
+ .asString(this.allocator) orelse return error.InvalidNPMLockfile;
+
+ const dep_actual_version_str = builder.append(String, dep_actual_version);
+ const dep_actual_version_sliced = dep_actual_version_str.sliced(this.buffers.string_bytes.items);
+
+ break :res Resolution.init(.{
+ .npm = .{
+ .url = builder.append(String, dep_resolved),
+ .version = Semver.Version.parse(dep_actual_version_sliced).version.fill(),
+ },
+ });
+ },
+ .tarball => if (strings.hasPrefixComptime(dep_resolved, "file:"))
+ Resolution.init(.{ .local_tarball = builder.append(String, dep_resolved[5..]) })
+ else
+ Resolution.init(.{ .remote_tarball = builder.append(String, dep_resolved) }),
+ .folder => Resolution.init(.{ .folder = builder.append(String, dep_resolved) }),
+ // not sure if this is possible to hit
+ .symlink => Resolution.init(.{ .folder = builder.append(String, dep_resolved) }),
+ .workspace => workspace: {
+ var input = builder.append(String, dep_resolved).sliced(this.buffers.string_bytes.items);
+ if (strings.hasPrefixComptime(input.slice, "workspace:")) {
+ input = input.sub(input.slice["workspace:".len..]);
+ }
+ break :workspace Resolution.init(.{
+ .workspace = input.value(),
+ });
+ },
+ .git => res: {
+ const str = (if (strings.hasPrefixComptime(dep_resolved, "git+"))
+ builder.append(String, dep_resolved[4..])
+ else
+ builder.append(String, dep_resolved))
+ .sliced(this.buffers.string_bytes.items);
+
+ const hash_index = strings.lastIndexOfChar(str.slice, '#') orelse return error.InvalidNPMLockfile;
+
+ const commit = str.sub(str.slice[hash_index + 1 ..]).value();
+ break :res Resolution.init(.{
+ .git = .{
+ .owner = version.value.git.owner,
+ .repo = str.sub(str.slice[0..hash_index]).value(),
+ .committish = commit,
+ .resolved = commit,
+ .package_name = dep_name,
+ },
+ });
+ },
+ .github => res: {
+ const str = (if (strings.hasPrefixComptime(dep_resolved, "git+"))
+ builder.append(String, dep_resolved[4..])
+ else
+ builder.append(String, dep_resolved))
+ .sliced(this.buffers.string_bytes.items);
+
+ const hash_index = strings.lastIndexOfChar(str.slice, '#') orelse return error.InvalidNPMLockfile;
+
+ const commit = str.sub(str.slice[hash_index + 1 ..]).value();
+ break :res Resolution.init(.{
+ .git = .{
+ .owner = version.value.github.owner,
+ .repo = str.sub(str.slice[0..hash_index]).value(),
+ .committish = commit,
+ .resolved = commit,
+ .package_name = dep_name,
+ },
+ });
+ },
+ };
+ };
+ debug("-> {}", .{res.fmtForDebug(this.buffers.string_bytes.items)});
+
+ resolutions[id] = res;
+ metas[id].origin = switch (res.tag) {
+ // This works?
+ .root => .local,
+ else => .npm,
+ };
+
+ try this.getOrPutID(id, this.packages.items(.name_hash)[id]);
+ }
+
+ continue :dep_loop;
+ }
+ // step
+ if (strings.lastIndexOf(name_checking_buf[0..buf_len -| ("node_modules/".len + name_bytes.len)], "node_modules/")) |idx| {
+ debug("found 'node_modules/' at {d}", .{idx});
+ buf_len = @intCast(idx + "node_modules/".len + name_bytes.len);
+ bun.copy(u8, name_checking_buf[idx + "node_modules/".len .. idx + "node_modules/".len + name_bytes.len], name_bytes);
+ } else if (!strings.hasPrefixComptime(name_checking_buf[0..buf_len], "node_modules/")) {
+ // this is hit if you start from `packages/etc`, from `packages/etc/node_modules/xyz`
+ // we need to hit the root node_modules
+ buf_len = @intCast("node_modules/".len + name_bytes.len);
+ bun.copy(u8, name_checking_buf[0..buf_len], "node_modules/");
+ bun.copy(u8, name_checking_buf[buf_len - name_bytes.len .. buf_len], name_bytes);
+ } else {
+ // optional peer dependencies can be ... optional
+ if (dep_key == .peerDependencies) {
+ if (peer_dep_meta) |o| if (o.get(name_bytes)) |meta| {
+ if (meta.data != .e_object) return error.InvalidNPMLockfile;
+ if (meta.data.e_object.get("optional")) |optional| {
+ if (optional.data != .e_boolean) return error.InvalidNPMLockfile;
+ if (optional.data.e_boolean.value) {
+ dependencies_buf[0] = Dependency{
+ .name = dep_name,
+ .name_hash = name_hash,
+ .version = version,
+ .behavior = .{
+ .normal = dep_key == .dependencies,
+ .optional = true,
+ .dev = dep_key == .devDependencies,
+ .peer = dep_key == .peerDependencies,
+ .workspace = false,
+ },
+ };
+ resolutions_buf[0] = Install.invalid_package_id;
+ dependencies_buf = dependencies_buf[1..];
+ resolutions_buf = resolutions_buf[1..];
+ continue :dep_loop;
+ }
+ }
+ };
+ }
+
+ // it is technically possible to get a package-lock.json without a dependency.
+ // it's very unlikely, but possible. when NPM sees this, it essentially doesnt install the package, and treats it like it doesn't exist.
+ // in test/cli/install/migrate-fixture, you can observe this for `iconv-lite`
+ debug("could not find package '{s}' in '{s}'", .{ name_bytes, pkg_path });
+ continue :dep_loop;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ this.buffers.resolutions.items.len = (@intFromPtr(resolutions_buf.ptr) - @intFromPtr(this.buffers.resolutions.items.ptr)) / @sizeOf(Install.PackageID);
+ this.buffers.dependencies.items.len = this.buffers.resolutions.items.len;
+
+ // In allow_assert, we prefill this buffer with uninitialized values that we can detect later
+ // It is our fault if we hit an error here, making it safe to disable in release.
+ if (Environment.allow_assert) {
+ std.debug.assert(this.buffers.dependencies.items.len == (@intFromPtr(dependencies_buf.ptr) - @intFromPtr(this.buffers.dependencies.items.ptr)) / @sizeOf(Dependency));
+ std.debug.assert(this.buffers.dependencies.items.len <= num_deps);
+ var crash = false;
+ for (this.buffers.dependencies.items, 0..) |r, i| {
+ // 'if behavior is uninitialized'
+ if (r.behavior.eq(.{})) {
+ debug("dependency index '{d}' was not set", .{i});
+ crash = true;
+ }
+ }
+ for (this.buffers.resolutions.items, 0..) |r, i| {
+ if (r == unset_package_id) {
+ debug("resolution index '{d}' was not set", .{i});
+ crash = true;
+ }
+ }
+ if (crash) {
+ std.debug.panic("Assertion failure, see above", .{});
+ }
+ }
+
+ // A package not having a resolution, however, is not our fault.
+ // This can be triggered by a bad lockfile with extra packages. NPM should trim packages out automatically.
+ var is_missing_resolutions = false;
+ for (resolutions, 0..) |r, i| {
+ if (r.tag == .uninitialized) {
+ Output.printErrorln("Could not resolve package '{s}' in lockfile.", .{this.packages.items(.name)[i].slice(this.buffers.string_bytes.items)});
+ is_missing_resolutions = true;
+ } else if (Environment.allow_assert) {
+ // Assertion from appendPackage. If we do this too early it will always fail as we dont have the resolution written
+ // but after we write all the data, there is no excuse for this to fail.
+ //
+ // If this is hit, it means getOrPutID was not called on this package id. Look for where 'resolution[i]' is set
+ std.debug.assert(this.getPackageID(this.packages.items(.name_hash)[i], null, &r) != null);
+ }
+ }
+ if (is_missing_resolutions) {
+ return error.NotAllPackagesGotResolved;
+ }
+
+ // if (Environment.isDebug) {
+ // const dump_file = try std.fs.cwd().createFileZ("before-clean.json", .{});
+ // defer dump_file.close();
+ // try std.json.stringify(this, .{ .whitespace = .indent_2 }, dump_file.writer());
+ // }
+
+ // This is definitely a memory leak, but it's fine because there is no install api, so this can only be leaked once per process.
+ // This operation is neccecary because callers of `loadFromDisk` assume the data is written into the passed `this`.
+ // You'll find that not cleaning the lockfile will cause `bun install` to not actually install anything since it doesnt have any hoisted trees.
+ this.* = (try this.cleanWithLogger(&[_]Install.PackageManager.UpdateRequest{}, log, false)).*;
+
+ // if (Environment.isDebug) {
+ // const dump_file = try std.fs.cwd().createFileZ("after-clean.json", .{});
+ // defer dump_file.close();
+ // try std.json.stringify(this, .{ .whitespace = .indent_2 }, dump_file.writer());
+ // }
+
+ if (Environment.allow_assert) {
+ try this.verifyData();
+ }
+
+ this.meta_hash = try this.generateMetaHash(false);
+
+ return LoadFromDiskResult{ .ok = this };
+}
+
+fn packageNameFromPath(pkg_path: []const u8) []const u8 {
+ if (pkg_path.len == 0) return "";
+
+ const pkg_name_start: usize = if (strings.lastIndexOf(pkg_path, "/node_modules/")) |last_index|
+ last_index + "/node_modules/".len
+ else if (strings.hasPrefixComptime(pkg_path, "node_modules/"))
+ "node_modules/".len
+ else
+ strings.lastIndexOf(pkg_path, "/") orelse 0;
+
+ return pkg_path[pkg_name_start..];
+}
diff --git a/src/install/npm.zig b/src/install/npm.zig
index 9f3f2952c..4cf1c2b71 100644
--- a/src/install/npm.zig
+++ b/src/install/npm.zig
@@ -68,8 +68,20 @@ pub const Registry = struct {
pub fn fromAPI(name: string, registry_: Api.NpmRegistry, allocator: std.mem.Allocator, env: *DotEnv.Loader) !Scope {
var registry = registry_;
+
+ // Support $ENV_VAR for registry URLs
+ if (strings.startsWithChar(registry_.url, '$')) {
+ // If it became "$ENV_VAR/", then we need to remove the trailing slash
+ if (env.get(strings.trim(registry_.url[1..], "/"))) |replaced_url| {
+ if (replaced_url.len > 1) {
+ registry.url = replaced_url;
+ }
+ }
+ }
+
var url = URL.parse(registry.url);
var auth: string = "";
+ var needs_normalize = false;
if (registry.token.len == 0) {
outer: {
@@ -79,10 +91,12 @@ pub const Registry = struct {
url.pathname = pathname;
url.path = pathname;
}
-
+ var needs_to_check_slash = true;
while (strings.lastIndexOfChar(pathname, ':')) |colon| {
var segment = pathname[colon + 1 ..];
pathname = pathname[0..colon];
+ needs_to_check_slash = false;
+ needs_normalize = true;
if (pathname.len > 1 and pathname[pathname.len - 1] == '/') {
pathname = pathname[0 .. pathname.len - 1];
}
@@ -113,6 +127,47 @@ pub const Registry = struct {
continue;
}
}
+
+ // In this case, there is only one.
+ if (needs_to_check_slash) {
+ if (strings.lastIndexOfChar(pathname, '/')) |last_slash| {
+ var remain = pathname[last_slash + 1 ..];
+ if (strings.indexOfChar(remain, '=')) |eql_i| {
+ const segment = remain[0..eql_i];
+ var value = remain[eql_i + 1 ..];
+
+ // https://github.com/yarnpkg/yarn/blob/6db39cf0ff684ce4e7de29669046afb8103fce3d/src/registries/npm-registry.js#L364
+ // Bearer Token
+ if (strings.eqlComptime(segment, "_authToken")) {
+ registry.token = value;
+ pathname = pathname[0 .. last_slash + 1];
+ needs_normalize = true;
+ break :outer;
+ }
+
+ if (strings.eqlComptime(segment, "_auth")) {
+ auth = value;
+ pathname = pathname[0 .. last_slash + 1];
+ needs_normalize = true;
+ break :outer;
+ }
+
+ if (strings.eqlComptime(segment, "username")) {
+ registry.username = value;
+ pathname = pathname[0 .. last_slash + 1];
+ needs_normalize = true;
+ break :outer;
+ }
+
+ if (strings.eqlComptime(segment, "_password")) {
+ registry.password = value;
+ pathname = pathname[0 .. last_slash + 1];
+ needs_normalize = true;
+ break :outer;
+ }
+ }
+ }
+ }
}
registry.username = env.getAuto(registry.username);
@@ -133,6 +188,16 @@ pub const Registry = struct {
registry.token = env.getAuto(registry.token);
+ if (needs_normalize) {
+ url = URL.parse(
+ try std.fmt.allocPrint(allocator, "{s}://{}/{s}/", .{
+ url.displayProtocol(),
+ url.displayHost(),
+ strings.trim(url.pathname, "/"),
+ }),
+ );
+ }
+
return Scope{ .name = name, .url = url, .token = registry.token, .auth = auth };
}
};
@@ -262,12 +327,18 @@ pub const OperatingSystem = enum(u16) {
return (@intFromEnum(this) & linux) != 0;
} else if (comptime Environment.isMac) {
return (@intFromEnum(this) & darwin) != 0;
+ } else if (comptime Environment.isWindows) {
+ return (@intFromEnum(this) & win32) != 0;
} else {
return false;
}
}
- const NameMap = ComptimeStringMap(u16, .{
+ pub inline fn has(this: OperatingSystem, other: u16) bool {
+ return (@intFromEnum(this) & other) != 0;
+ }
+
+ pub const NameMap = ComptimeStringMap(u16, .{
.{ "aix", aix },
.{ "darwin", darwin },
.{ "freebsd", freebsd },
@@ -318,7 +389,7 @@ pub const Architecture = enum(u16) {
pub const all_value: u16 = arm | arm64 | ia32 | mips | mipsel | ppc | ppc64 | s390 | s390x | x32 | x64;
- const NameMap = ComptimeStringMap(u16, .{
+ pub const NameMap = ComptimeStringMap(u16, .{
.{ "arm", arm },
.{ "arm64", arm64 },
.{ "ia32", ia32 },
@@ -332,6 +403,10 @@ pub const Architecture = enum(u16) {
.{ "x64", x64 },
});
+ pub inline fn has(this: Architecture, other: u16) bool {
+ return (@intFromEnum(this) & other) != 0;
+ }
+
pub fn isMatch(this: Architecture) bool {
if (comptime Environment.isAarch64) {
return (@intFromEnum(this) & arm64) != 0;
@@ -733,29 +808,39 @@ pub const PackageManifest = struct {
return this.findByVersion(left.version);
}
- const releases = this.pkg.releases.keys.get(this.versions);
+ if (this.findByDistTag("latest")) |result| {
+ if (group.satisfies(result.version)) {
+ if (group.flags.isSet(Semver.Query.Group.Flags.pre)) {
+ if (left.version.order(result.version, this.string_buf, this.string_buf) == .eq) {
+ // if prerelease, use latest if semver+tag match range exactly
+ return result;
+ }
+ } else {
+ return result;
+ }
+ }
+ }
- if (group.flags.isSet(Semver.Query.Group.Flags.pre)) {
- const prereleases = this.pkg.prereleases.keys.get(this.versions);
- var i = prereleases.len;
+ {
+ const releases = this.pkg.releases.keys.get(this.versions);
+ var i = releases.len;
+ // For now, this is the dumb way
while (i > 0) : (i -= 1) {
- const version = prereleases[i - 1];
- const packages = this.pkg.prereleases.values.get(this.package_versions);
+ const version = releases[i - 1];
+ const packages = this.pkg.releases.values.get(this.package_versions);
if (group.satisfies(version)) {
return .{ .version = version, .package = &packages[i - 1] };
}
}
- } else if (this.findByDistTag("latest")) |result| {
- if (group.satisfies(result.version)) return result;
}
- {
- var i = releases.len;
- // // For now, this is the dumb way
+ if (group.flags.isSet(Semver.Query.Group.Flags.pre)) {
+ const prereleases = this.pkg.prereleases.keys.get(this.versions);
+ var i = prereleases.len;
while (i > 0) : (i -= 1) {
- const version = releases[i - 1];
- const packages = this.pkg.releases.values.get(this.package_versions);
+ const version = prereleases[i - 1];
+ const packages = this.pkg.prereleases.values.get(this.package_versions);
if (group.satisfies(version)) {
return .{ .version = version, .package = &packages[i - 1] };
@@ -796,7 +881,7 @@ pub const PackageManifest = struct {
}
}
- var result = PackageManifest{};
+ var result: PackageManifest = bun.serializable(PackageManifest{});
var string_pool = String.Builder.StringPool.init(default_allocator);
defer string_pool.deinit();
@@ -1029,6 +1114,9 @@ pub const PackageManifest = struct {
var dependency_values = version_extern_strings;
var dependency_names = all_dependency_names_and_values;
var prev_extern_bin_group = extern_strings_bin_entries;
+ const empty_version = bun.serializable(PackageVersion{
+ .bin = Bin.init(),
+ });
for (versions) |prop| {
const version_name = prop.key.?.asString(allocator) orelse continue;
@@ -1048,7 +1136,7 @@ pub const PackageManifest = struct {
}
if (!parsed_version.valid) continue;
- var package_version = PackageVersion{};
+ var package_version: PackageVersion = empty_version;
if (prop.value.?.asProperty("cpu")) |cpu| {
package_version.cpu = Architecture.all;
diff --git a/src/install/padding_checker.zig b/src/install/padding_checker.zig
index 1d9405a43..52d343b4f 100644
--- a/src/install/padding_checker.zig
+++ b/src/install/padding_checker.zig
@@ -55,7 +55,6 @@ pub fn assertNoUninitializedPadding(comptime T: type) void {
// if (info.layout != .Extern) {
// @compileError("assertNoUninitializedPadding(" ++ @typeName(T) ++ ") expects an extern struct type, got a struct of layout '" ++ @tagName(info.layout) ++ "'");
// }
- var i = 0;
for (info.fields) |field| {
const fieldInfo = @typeInfo(field.type);
switch (fieldInfo) {
@@ -69,9 +68,12 @@ pub fn assertNoUninitializedPadding(comptime T: type) void {
else => {},
}
}
+
if (info_ == .Union) {
return;
}
+
+ var i = 0;
for (info.fields, 0..) |field, j| {
const offset = @offsetOf(T, field.name);
if (offset != i) {
@@ -90,4 +92,17 @@ pub fn assertNoUninitializedPadding(comptime T: type) void {
}
i = offset + @sizeOf(field.type);
}
+
+ if (i != @sizeOf(T)) {
+ @compileError(std.fmt.comptimePrint(
+ \\Expected no possibly uninitialized bytes of memory in '{s}', but found a {d} byte gap at the end of the struct. This can be fixed by adding a padding field to the struct like `padding: [{d}]u8 = .{{0}} ** {d},` between these fields. For more information, look at `padding_checker.zig`
+ ,
+ .{
+ @typeName(T),
+ @sizeOf(T) - i,
+ @sizeOf(T) - i,
+ @sizeOf(T) - i,
+ },
+ ));
+ }
}
diff --git a/src/install/repository.zig b/src/install/repository.zig
index 564306733..17afec079 100644
--- a/src/install/repository.zig
+++ b/src/install/repository.zig
@@ -27,6 +27,12 @@ pub const Repository = extern struct {
resolved: GitSHA = .{},
package_name: String = .{},
+ pub const Hosts = bun.ComptimeStringMap(string, .{
+ .{ "bitbucket", ".org" },
+ .{ "github", ".com" },
+ .{ "gitlab", ".com" },
+ });
+
pub fn verify(this: *const Repository) void {
this.owner.assertDefined();
this.repo.assertDefined();
@@ -125,15 +131,31 @@ pub const Repository = extern struct {
if (strings.hasPrefixComptime(url, "ssh://")) {
final_path_buf[0.."https".len].* = "https".*;
bun.copy(u8, final_path_buf["https".len..], url["ssh".len..]);
- return final_path_buf[0..(url.len - "ssh".len + "https".len)];
+ return final_path_buf[0 .. url.len - "ssh".len + "https".len];
}
+
if (Dependency.isSCPLikePath(url)) {
final_path_buf[0.."https://".len].* = "https://".*;
var rest = final_path_buf["https://".len..];
+
+ const colon_index = strings.indexOfChar(url, ':');
+
+ if (colon_index) |colon| {
+ // make sure known hosts have `.com` or `.org`
+ if (Hosts.get(url[0..colon])) |tld| {
+ bun.copy(u8, rest, url[0..colon]);
+ bun.copy(u8, rest[colon..], tld);
+ rest[colon + tld.len] = '/';
+ bun.copy(u8, rest[colon + tld.len + 1 ..], url[colon + 1 ..]);
+ return final_path_buf[0 .. url.len + "https://".len + tld.len];
+ }
+ }
+
bun.copy(u8, rest, url);
- if (strings.indexOfChar(rest, ':')) |colon| rest[colon] = '/';
- return final_path_buf[0..(url.len + "https://".len)];
+ if (colon_index) |colon| rest[colon] = '/';
+ return final_path_buf[0 .. url.len + "https://".len];
}
+
return null;
}
diff --git a/src/install/resolution.zig b/src/install/resolution.zig
index 38f238bd4..84d43ff1a 100644
--- a/src/install/resolution.zig
+++ b/src/install/resolution.zig
@@ -8,12 +8,21 @@ const string = @import("../string_types.zig").string;
const ExtractTarball = @import("./extract_tarball.zig");
const strings = @import("../string_immutable.zig");
const VersionedURL = @import("./versioned_url.zig").VersionedURL;
+const bun = @import("root").bun;
pub const Resolution = extern struct {
tag: Tag = .uninitialized,
_padding: [7]u8 = .{0} ** 7,
value: Value = .{ .uninitialized = {} },
+ /// Use like Resolution.init(.{ .npm = VersionedURL{ ... } })
+ pub inline fn init(value: anytype) Resolution {
+ return Resolution{
+ .tag = @field(Tag, @typeInfo(@TypeOf(value)).Struct.fields[0].name),
+ .value = Value.init(value),
+ };
+ }
+
pub fn order(
lhs: *const Resolution,
rhs: *const Resolution,
@@ -73,51 +82,55 @@ pub const Resolution = extern struct {
}
pub fn clone(this: *const Resolution, buf: []const u8, comptime Builder: type, builder: Builder) Resolution {
- return Resolution{
+ return .{
.tag = this.tag,
.value = switch (this.tag) {
- .npm => .{
- .npm = this.value.npm.clone(buf, Builder, builder),
- },
- .local_tarball => .{
+ .npm => Value.init(.{ .npm = this.value.npm.clone(buf, Builder, builder) }),
+ .local_tarball => Value.init(.{
.local_tarball = builder.append(String, this.value.local_tarball.slice(buf)),
- },
- .folder => .{
+ }),
+ .folder => Value.init(.{
.folder = builder.append(String, this.value.folder.slice(buf)),
- },
- .remote_tarball => .{
+ }),
+ .remote_tarball => Value.init(.{
.remote_tarball = builder.append(String, this.value.remote_tarball.slice(buf)),
- },
- .workspace => .{
+ }),
+ .workspace => Value.init(.{
.workspace = builder.append(String, this.value.workspace.slice(buf)),
- },
- .symlink => .{
+ }),
+ .symlink => Value.init(.{
.symlink = builder.append(String, this.value.symlink.slice(buf)),
- },
- .single_file_module => .{
+ }),
+ .single_file_module => Value.init(.{
.single_file_module = builder.append(String, this.value.single_file_module.slice(buf)),
- },
- .git => .{
+ }),
+ .git => Value.init(.{
.git = this.value.git.clone(buf, Builder, builder),
- },
- .github => .{
+ }),
+ .github => Value.init(.{
.github = this.value.github.clone(buf, Builder, builder),
- },
- .gitlab => .{
+ }),
+ .gitlab => Value.init(.{
.gitlab = this.value.gitlab.clone(buf, Builder, builder),
+ }),
+ .root => Value.init(.{ .root = {} }),
+ else => {
+ std.debug.panic("Internal error: unexpected resolution tag: {}", .{this.tag});
},
- .root => .{ .root = {} },
- else => unreachable,
},
};
}
- pub fn fmt(this: *const Resolution, buf: []const u8) Formatter {
- return Formatter{ .resolution = this, .buf = buf };
+ pub fn fmt(this: *const Resolution, string_bytes: []const u8) Formatter {
+ return Formatter{ .resolution = this, .buf = string_bytes };
}
- pub fn fmtURL(this: *const Resolution, options: *const PackageManager.Options, buf: []const u8) URLFormatter {
- return URLFormatter{ .resolution = this, .buf = buf, .options = options };
+ pub fn fmtURL(this: *const Resolution, options: *const PackageManager.Options, string_bytes: []const u8) URLFormatter {
+ return URLFormatter{ .resolution = this, .buf = string_bytes, .options = options };
+ }
+
+ pub fn fmtForDebug(this: *const Resolution, string_bytes: []const u8) DebugFormatter {
+ return DebugFormatter{ .resolution = this, .buf = string_bytes };
}
pub fn eql(
@@ -224,6 +237,31 @@ pub const Resolution = extern struct {
}
};
+ pub const DebugFormatter = struct {
+ resolution: *const Resolution,
+ buf: []const u8,
+
+ pub fn format(formatter: DebugFormatter, comptime layout: []const u8, opts: std.fmt.FormatOptions, writer: anytype) !void {
+ try writer.writeAll("Resolution{ .");
+ try writer.writeAll(std.enums.tagName(Tag, formatter.resolution.tag) orelse "invalid");
+ try writer.writeAll(" = ");
+ switch (formatter.resolution.tag) {
+ .npm => try formatter.resolution.value.npm.version.fmt(formatter.buf).format(layout, opts, writer),
+ .local_tarball => try writer.writeAll(formatter.resolution.value.local_tarball.slice(formatter.buf)),
+ .folder => try writer.writeAll(formatter.resolution.value.folder.slice(formatter.buf)),
+ .remote_tarball => try writer.writeAll(formatter.resolution.value.remote_tarball.slice(formatter.buf)),
+ .git => try formatter.resolution.value.git.formatAs("git+", formatter.buf, layout, opts, writer),
+ .github => try formatter.resolution.value.github.formatAs("github:", formatter.buf, layout, opts, writer),
+ .gitlab => try formatter.resolution.value.gitlab.formatAs("gitlab:", formatter.buf, layout, opts, writer),
+ .workspace => try std.fmt.format(writer, "workspace:{s}", .{formatter.resolution.value.workspace.slice(formatter.buf)}),
+ .symlink => try std.fmt.format(writer, "link:{s}", .{formatter.resolution.value.symlink.slice(formatter.buf)}),
+ .single_file_module => try std.fmt.format(writer, "module:{s}", .{formatter.resolution.value.single_file_module.slice(formatter.buf)}),
+ else => try writer.writeAll("{}"),
+ }
+ try writer.writeAll(" }");
+ }
+ };
+
pub const Value = extern union {
uninitialized: void,
root: void,
@@ -248,6 +286,11 @@ pub const Resolution = extern struct {
symlink: String,
single_file_module: String,
+
+ /// To avoid undefined memory between union values, we must zero initialize the union first.
+ pub fn init(field: anytype) Value {
+ return bun.serializableInto(Value, field);
+ }
};
pub const Tag = enum(u8) {
diff --git a/src/install/semver.zig b/src/install/semver.zig
index f76238fa5..9572b85e2 100644
--- a/src/install/semver.zig
+++ b/src/install/semver.zig
@@ -576,23 +576,36 @@ pub const SlicedString = struct {
slice: string,
pub inline fn init(buf: string, slice: string) SlicedString {
+ if (Environment.allow_assert) {
+ if (@intFromPtr(buf.ptr) > @intFromPtr(slice.ptr)) {
+ @panic("SlicedString.init buf is not in front of slice");
+ }
+ }
return SlicedString{ .buf = buf, .slice = slice };
}
pub inline fn external(this: SlicedString) ExternalString {
- if (comptime Environment.allow_assert) std.debug.assert(@intFromPtr(this.buf.ptr) <= @intFromPtr(this.slice.ptr) and ((@intFromPtr(this.slice.ptr) + this.slice.len) <= (@intFromPtr(this.buf.ptr) + this.buf.len)));
+ if (comptime Environment.allow_assert) {
+ std.debug.assert(@intFromPtr(this.buf.ptr) <= @intFromPtr(this.slice.ptr) and ((@intFromPtr(this.slice.ptr) + this.slice.len) <= (@intFromPtr(this.buf.ptr) + this.buf.len)));
+ }
return ExternalString.init(this.buf, this.slice, bun.Wyhash.hash(0, this.slice));
}
pub inline fn value(this: SlicedString) String {
- if (comptime Environment.allow_assert) std.debug.assert(@intFromPtr(this.buf.ptr) <= @intFromPtr(this.slice.ptr) and ((@intFromPtr(this.slice.ptr) + this.slice.len) <= (@intFromPtr(this.buf.ptr) + this.buf.len)));
+ if (comptime Environment.allow_assert) {
+ std.debug.assert(@intFromPtr(this.buf.ptr) <= @intFromPtr(this.slice.ptr) and ((@intFromPtr(this.slice.ptr) + this.slice.len) <= (@intFromPtr(this.buf.ptr) + this.buf.len)));
+ }
return String.init(this.buf, this.slice);
}
pub inline fn sub(this: SlicedString, input: string) SlicedString {
- std.debug.assert(@intFromPtr(this.buf.ptr) <= @intFromPtr(this.buf.ptr) and ((@intFromPtr(input.ptr) + input.len) <= (@intFromPtr(this.buf.ptr) + this.buf.len)));
+ if (Environment.allow_assert) {
+ if (!(@intFromPtr(this.buf.ptr) <= @intFromPtr(this.buf.ptr) and ((@intFromPtr(input.ptr) + input.len) <= (@intFromPtr(this.buf.ptr) + this.buf.len)))) {
+ @panic("SlicedString.sub input is not a substring of the slice");
+ }
+ }
return SlicedString{ .buf = this.buf, .slice = input };
}
};
diff --git a/src/js/README.md b/src/js/README.md
index f1eb3c6ca..52c9ba6f5 100644
--- a/src/js/README.md
+++ b/src/js/README.md
@@ -75,7 +75,7 @@ object->putDirectBuiltinFunction(
// ReadableStream.ts, `function readableStreamToJSON()`
// This returns a FunctionExecutable* (extends JSCell*, but not JSFunction*).
readableStreamReadableStreamToJSONCodeGenerator(vm),
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0
+ JSC::PropertyAttribute::DontDelete | 0
);
```
diff --git a/src/js/_codegen/build-functions.ts b/src/js/_codegen/build-functions.ts
index 761682d44..275cd2e1a 100644
--- a/src/js/_codegen/build-functions.ts
+++ b/src/js/_codegen/build-functions.ts
@@ -1,40 +1,9 @@
-import { existsSync, mkdirSync, readdirSync, rmSync, writeFileSync } from "fs";
+import { existsSync, mkdirSync, readdirSync, rmSync } from "fs";
import path from "path";
import { sliceSourceCode } from "./builtin-parser";
-import { applyGlobalReplacements, enums, globalsToPrefix } from "./replacements";
+import { applyGlobalReplacements, define } from "./replacements";
import { cap, fmtCPPString, low } from "./helpers";
-import { spawn } from "bun";
-
-async function createStaticHashtables() {
- const STATIC_HASH_TABLES = ["src/bun.js/bindings/Process.cpp", "src/bun.js/bindings/BunObject.cpp"];
- console.time("Creating static hash tables...");
- const create_hash_table = path.join(import.meta.dir, "../../../src/bun.js/scripts/create_hash_table");
- if (!create_hash_table) {
- console.warn(
- "Could not find create_hash_table executable. Run `bun i` or clone webkit to build static hash tables",
- );
- return;
- }
- for (let cpp of STATIC_HASH_TABLES) {
- cpp = path.join(import.meta.dir, "../../../", cpp);
- const { stdout, exited } = spawn({
- cmd: [create_hash_table, cpp],
- stdout: "pipe",
- stderr: "inherit",
- });
- await exited;
- let str = await new Response(stdout).text();
- str = str.replaceAll(/^\/\/.*$/gm, "");
- str = str.replaceAll(/^#include.*$/gm, "");
- str = str.replaceAll(`namespace JSC {`, "");
- str = str.replaceAll(`} // namespace JSC`, "");
- str = "// File generated via `make generate-builtins`\n" + str.trim() + "\n";
- await Bun.write(cpp.replace(/\.cpp$/, ".lut.h"), str);
- }
- console.timeEnd("Creating static hash tables...");
-}
-const staticHashTablePromise = createStaticHashtables();
console.log("Bundling Bun builtin functions...");
const MINIFY = process.argv.includes("--minify") || process.argv.includes("-m");
@@ -48,24 +17,6 @@ const TMP_DIR = path.join(SRC_DIR, "../out/tmp/builtins");
if (existsSync(TMP_DIR)) rmSync(TMP_DIR, { recursive: true });
mkdirSync(TMP_DIR, { recursive: true });
-const define = {
- "process.env.NODE_ENV": "production",
- "IS_BUN_DEVELOPMENT": "false",
-};
-
-for (const name in enums) {
- const value = enums[name];
- if (typeof value !== "object") throw new Error("Invalid enum object " + name + " defined in " + import.meta.file);
- if (typeof value === null) throw new Error("Invalid enum object " + name + " defined in " + import.meta.file);
- const keys = Array.isArray(value) ? value : Object.keys(value).filter(k => !k.match(/^[0-9]+$/));
- define[`__intrinsic__${name}IdToLabel`] = "[" + keys.map(k => `"${k}"`).join(", ") + "]";
- define[`__intrinsic__${name}LabelToId`] = "{" + keys.map(k => `"${k}": ${keys.indexOf(k)}`).join(", ") + "}";
-}
-
-for (const name of globalsToPrefix) {
- define[name] = "__intrinsic__" + name;
-}
-
interface ParsedBuiltin {
name: string;
params: string[];
@@ -77,9 +28,9 @@ interface BundledBuiltin {
name: string;
directives: Record<string, any>;
isGetter: boolean;
- isConstructor: boolean;
+ constructAbility: string;
+ constructKind: string;
isLinkTimeConstant: boolean;
- isNakedConstructor: boolean;
intrinsic: string;
overriddenName: string;
source: string;
@@ -146,12 +97,13 @@ async function processFileSplit(filename: string): Promise<{ functions: BundledB
throw new SyntaxError("Could not parse directive value " + directive[2] + " (must be JSON parsable)");
}
if (name === "constructor") {
- throw new SyntaxError("$constructor not implemented");
- }
- if (name === "nakedConstructor") {
- throw new SyntaxError("$nakedConstructor not implemented");
+ directives.ConstructAbility = "CanConstruct";
+ } else if (name === "nakedConstructor") {
+ directives.ConstructAbility = "CanConstruct";
+ directives.ConstructKind = "Naked";
+ } else {
+ directives[name] = value;
}
- directives[name] = value;
contents = contents.slice(directive[0].length);
} else if (match[1] === "export function" || match[1] === "export async function") {
const declaration = contents.match(
@@ -218,7 +170,7 @@ $$capture_start$$(${fn.async ? "async " : ""}${
const build = await Bun.build({
entrypoints: [tmpFile],
define,
- minify: { syntax: true, whitespace: true },
+ minify: { syntax: true, whitespace: false },
});
if (!build.success) {
throw new AggregateError(build.logs, "Failed bundling builtin function " + fn.name + " from " + basename + ".ts");
@@ -231,7 +183,7 @@ $$capture_start$$(${fn.async ? "async " : ""}${
const finalReplacement =
(fn.directives.sloppy ? captured : captured.replace(/function\s*\(.*?\)\s*{/, '$&"use strict";'))
.replace(/^\((async )?function\(/, "($1function (")
- .replace(/__intrinsic__lazy\(/g, "globalThis[globalThis.Symbol.for('Bun.lazy')](")
+ // .replace(/__intrinsic__lazy\(/g, "globalThis[globalThis.Symbol.for('Bun.lazy')](")
.replace(/__intrinsic__/g, "@") + "\n";
bundledFunctions.push({
@@ -241,9 +193,9 @@ $$capture_start$$(${fn.async ? "async " : ""}${
params: fn.params,
visibility: fn.directives.visibility ?? (fn.directives.linkTimeConstant ? "Private" : "Public"),
isGetter: !!fn.directives.getter,
- isConstructor: !!fn.directives.constructor,
+ constructAbility: fn.directives.ConstructAbility ?? "CannotConstruct",
+ constructKind: fn.directives.ConstructKind ?? "None",
isLinkTimeConstant: !!fn.directives.linkTimeConstant,
- isNakedConstructor: !!fn.directives.nakedConstructor,
intrinsic: fn.directives.intrinsic ?? "NoIntrinsic",
overriddenName: fn.directives.getter
? `"get ${fn.name}"_s`
@@ -254,12 +206,14 @@ $$capture_start$$(${fn.async ? "async " : ""}${
}
return {
- functions: bundledFunctions,
+ functions: bundledFunctions.sort((a, b) => a.name.localeCompare(b.name)),
internal,
};
}
-const filesToProcess = readdirSync(SRC_DIR).filter(x => x.endsWith(".ts") && !x.endsWith(".d.ts"));
+const filesToProcess = readdirSync(SRC_DIR)
+ .filter(x => x.endsWith(".ts") && !x.endsWith(".d.ts"))
+ .sort();
const files: Array<{ basename: string; functions: BundledBuiltin[]; internal: boolean }> = [];
async function processFile(x: string) {
@@ -305,8 +259,8 @@ for (const { basename, functions } of files) {
for (const fn of functions) {
const name = `${lowerBasename}${cap(fn.name)}Code`;
bundledCPP += `// ${fn.name}
-const JSC::ConstructAbility s_${name}ConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_${name}ConstructorKind = JSC::ConstructorKind::None;
+const JSC::ConstructAbility s_${name}ConstructAbility = JSC::ConstructAbility::${fn.constructAbility};
+const JSC::ConstructorKind s_${name}ConstructorKind = JSC::ConstructorKind::${fn.constructKind};
const JSC::ImplementationVisibility s_${name}ImplementationVisibility = JSC::ImplementationVisibility::${fn.visibility};
const int s_${name}Length = ${fn.source.length};
static const JSC::Intrinsic s_${name}Intrinsic = JSC::NoIntrinsic;
@@ -459,7 +413,7 @@ public:
explicit ${basename}BuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
WEBCORE_FOREACH_${basename.toUpperCase()}_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
WEBCORE_FOREACH_${basename.toUpperCase()}_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
@@ -652,8 +606,6 @@ if (!KEEP_TMP) {
await rmSync(TMP_DIR, { recursive: true });
}
-await staticHashTablePromise;
-
console.log(
`Embedded JS size: %s bytes (across %s functions, %s files)`,
totalJSSize,
diff --git a/src/js/_codegen/build-modules.ts b/src/js/_codegen/build-modules.ts
index 3443db6f6..3591d812e 100644
--- a/src/js/_codegen/build-modules.ts
+++ b/src/js/_codegen/build-modules.ts
@@ -1,10 +1,11 @@
import fs from "fs";
import path from "path";
import { sliceSourceCode } from "./builtin-parser";
-import { cap, fmtCPPString, readdirRecursive, resolveSyncOrNull } from "./helpers";
+import { cap, checkAscii, fmtCPPString, readdirRecursive, resolveSyncOrNull } from "./helpers";
import { createAssertClientJS, createLogClientJS } from "./client-js";
import { builtinModules } from "node:module";
import { BuildConfig } from "bun";
+import { define } from "./replacements";
const t = new Bun.Transpiler({ loader: "tsx" });
@@ -28,7 +29,13 @@ const internalRegistry = new Map();
// Build Registry
for (let i = 0; i < moduleList.length; i++) {
- const prefix = moduleList[i].startsWith("node/") ? "node:" : moduleList[i].startsWith("bun:") ? "bun/" : undefined;
+ const prefix = moduleList[i].startsWith("node/")
+ ? "node:"
+ : moduleList[i].startsWith("bun:")
+ ? "bun/"
+ : moduleList[i].startsWith("internal/")
+ ? "internal/"
+ : undefined;
if (prefix) {
const id = prefix + moduleList[i].slice(prefix.length).replaceAll(".", "/").slice(0, -3);
internalRegistry.set(id, i);
@@ -90,7 +97,7 @@ globalThis.requireTransformer = (specifier: string, from: string) => {
return codegenRequireId(`${found}/*${path.relative(BASE, relativeMatch)}*/`);
}
- throw new Error(`Builtin Bundler: Could not resolve "${specifier}" in ${from}. These cannot be relative.`);
+ throw new Error(`Builtin Bundler: Could not resolve "${specifier}" in ${from}.`);
};
// Preprocess builtins
@@ -173,6 +180,7 @@ const config = ({ platform, debug }: { platform: string; debug?: boolean }) =>
target: "bun",
external: builtinModules,
define: {
+ ...define,
IS_BUN_DEVELOPMENT: String(!!debug),
__intrinsic__debug: debug ? "$debug_log_enabled" : "false",
"process.platform": JSON.stringify(platform),
@@ -222,7 +230,7 @@ for (const [name, bundle, outputs] of [
.replace(/\$\$EXPORT\$\$\((.*)\).\$\$EXPORT_END\$\$;/, "return $1")
.replace(/]\s*,\s*__(debug|assert)_end__\)/g, ")")
.replace(/]\s*,\s*__debug_end__\)/g, ")")
- .replace(/__intrinsic__lazy\(/g, "globalThis[globalThis.Symbol.for('Bun.lazy')](")
+ // .replace(/__intrinsic__lazy\(/g, "globalThis[globalThis.Symbol.for('Bun.lazy')](")
.replace(/import.meta.require\((.*?)\)/g, (expr, specifier) => {
try {
const str = JSON.parse(specifier);
@@ -325,6 +333,9 @@ JSValue InternalModuleRegistry::createInternalModuleById(JSGlobalObject* globalO
// This header is used by InternalModuleRegistry.cpp, and should only be included in that file.
// It inlines all the strings for the module IDs.
+//
+// We cannot use ASCIILiteral's `_s` operator for the module source code because for long
+// strings it fails a constexpr assert. Instead, we do that assert in JS before we format the string
fs.writeFileSync(
path.join(BASE, "out/InternalModuleRegistryConstants.h"),
`// clang-format off
@@ -338,7 +349,9 @@ namespace InternalModuleRegistryConstants {
.map(
(id, n) =>
`//
-static constexpr ASCIILiteral ${idToEnumName(id)}Code = ${fmtCPPString(bundledOutputs.darwin.get(id.slice(0, -3)))}_s;
+static constexpr ASCIILiteral ${idToEnumName(id)}Code = ASCIILiteral::fromLiteralUnsafe(${fmtCPPString(
+ checkAscii(bundledOutputs.darwin.get(id.slice(0, -3))),
+ )});
//
`,
)
@@ -348,7 +361,9 @@ static constexpr ASCIILiteral ${idToEnumName(id)}Code = ${fmtCPPString(bundledOu
.map(
(id, n) =>
`//
-static constexpr ASCIILiteral ${idToEnumName(id)}Code = ${fmtCPPString(bundledOutputs.win32.get(id.slice(0, -3)))}_s;
+static constexpr ASCIILiteral ${idToEnumName(id)}Code = ASCIILiteral::fromLiteralUnsafe(${fmtCPPString(
+ checkAscii(bundledOutputs.win32.get(id.slice(0, -3))),
+ )});
//
`,
)
@@ -359,7 +374,9 @@ static constexpr ASCIILiteral ${idToEnumName(id)}Code = ${fmtCPPString(bundledOu
.map(
(id, n) =>
`//
-static constexpr ASCIILiteral ${idToEnumName(id)}Code = ${fmtCPPString(bundledOutputs.linux.get(id.slice(0, -3)))}_s;
+static constexpr ASCIILiteral ${idToEnumName(id)}Code = ASCIILiteral::fromLiteralUnsafe(${fmtCPPString(
+ checkAscii(bundledOutputs.linux.get(id.slice(0, -3))),
+ )});
//
`,
)
@@ -373,7 +390,8 @@ static constexpr ASCIILiteral ${idToEnumName(id)}Code = ${fmtCPPString(bundledOu
// This is a generated enum for zig code (exports.zig)
fs.writeFileSync(
path.join(BASE, "out/ResolvedSourceTag.zig"),
- `pub const ResolvedSourceTag = enum(u32) {
+ `// zig fmt: off
+pub const ResolvedSourceTag = enum(u32) {
// Predefined
javascript = 0,
package_json_type_module = 1,
diff --git a/src/js/_codegen/builtin-parser.ts b/src/js/_codegen/builtin-parser.ts
index ffd5671c1..4e35f13dd 100644
--- a/src/js/_codegen/builtin-parser.ts
+++ b/src/js/_codegen/builtin-parser.ts
@@ -79,12 +79,14 @@ export function sliceSourceCode(
i = 1;
} else if (endOnComma && contents.startsWith(",")) {
if (bracketCount <= 1) {
- result += ",";
contents = contents.slice(1);
- // if the next non-whitespace character is ), also consume
+ // if the next non-whitespace character is ), we will treat it like a )
let match = contents.match(/^\s*\)/);
if (match) {
contents = contents.slice(match[0].length);
+ result += ")";
+ } else {
+ result += ",";
}
break;
}
diff --git a/src/js/_codegen/client-js.ts b/src/js/_codegen/client-js.ts
index 849240c1f..4dfa6acf6 100644
--- a/src/js/_codegen/client-js.ts
+++ b/src/js/_codegen/client-js.ts
@@ -15,10 +15,11 @@ let $debug_log_enabled = ((env) => (
.split(/[-_./]/g)
.join("_")
.toUpperCase()})
-))(@Bun.env);
+))(Bun.env);
+let $debug_pid_prefix = Bun.env.SHOW_PID === '1';
let $debug_log = $debug_log_enabled ? (...args) => {
// warn goes to stderr without colorizing
- console.warn(Bun.enableANSIColors ? '\\x1b[90m[${publicName}]\\x1b[0m' : '[${publicName}]', ...args);
+ console.warn(($debug_pid_prefix ? \`[\${process.pid}] \` : '') + (Bun.enableANSIColors ? '\\x1b[90m[${publicName}]\\x1b[0m' : '[${publicName}]'), ...args);
} : () => {};
`;
}
@@ -27,10 +28,18 @@ export function createAssertClientJS(publicName: string) {
return `
let $assert = function(check, sourceString, ...message) {
if (!check) {
- console.error('[${publicName}] ASSERTION FAILED: ' + sourceString);
- if(message.length)console.warn (' ${" ".repeat(publicName.length)}', ...message);
+ const prevPrepareStackTrace = Error.prepareStackTrace;
+ Error.prepareStackTrace = (e, stack) => {
+ return e.name + ': ' + e.message + '\\n' + stack.slice(1).map(x => ' at ' + x.toString()).join('\\n');
+ };
const e = new Error(sourceString);
+ e.stack; // materialize stack
e.name = 'AssertionError';
+ Error.prepareStackTrace = prevPrepareStackTrace;
+ console.error('[${publicName}] ASSERTION FAILED: ' + sourceString);
+ if (message.length) console.warn(...message);
+ console.warn(e.stack.split('\\n')[1] + '\\n');
+ if (Bun.env.ASSERT === 'CRASH') process.exit(0xAA);
throw e;
}
}
diff --git a/src/js/_codegen/helpers.ts b/src/js/_codegen/helpers.ts
index 7f0c29ba0..74680b956 100644
--- a/src/js/_codegen/helpers.ts
+++ b/src/js/_codegen/helpers.ts
@@ -1,5 +1,6 @@
import fs from "fs";
import path from "path";
+import { isAscii } from "buffer";
export function fmtCPPString(str: string) {
return (
@@ -42,3 +43,11 @@ export function resolveSyncOrNull(specifier: string, from: string) {
return null;
}
}
+
+export function checkAscii(str: string) {
+ if (!isAscii(Buffer.from(str))) {
+ throw new Error(`non-ascii character in string "${str}". this will not be a valid ASCIILiteral`);
+ }
+
+ return str;
+}
diff --git a/src/js/_codegen/replacements.ts b/src/js/_codegen/replacements.ts
index 4621d6134..45f2426b5 100644
--- a/src/js/_codegen/replacements.ts
+++ b/src/js/_codegen/replacements.ts
@@ -24,13 +24,14 @@ export const globalReplacements: ReplacementRule[] = [
];
// This is a list of globals we should access using @ notation
+// This prevents a global override attacks.
+// Note that the public `Bun` global is immutable.
// undefined -> __intrinsic__undefined -> @undefined
export const globalsToPrefix = [
"AbortSignal",
"Array",
"ArrayBuffer",
"Buffer",
- "Bun",
"Infinity",
"Loader",
"Promise",
@@ -79,6 +80,41 @@ export const warnOnIdentifiersNotPresentAtRuntime = [
"notImplementedIssueFn",
];
+// These are passed to --define to the bundler
+export const define: Record<string, string> = {
+ "process.env.NODE_ENV": "production",
+ "IS_BUN_DEVELOPMENT": "false",
+
+ $streamClosed: "1",
+ $streamClosing: "2",
+ $streamErrored: "3",
+ $streamReadable: "4",
+ $streamWaiting: "5",
+ $streamWritable: "6",
+};
+
+// ------------------------------ //
+
+for (const name in enums) {
+ const value = enums[name];
+ if (typeof value !== "object") throw new Error("Invalid enum object " + name + " defined in " + import.meta.file);
+ if (typeof value === null) throw new Error("Invalid enum object " + name + " defined in " + import.meta.file);
+ const keys = Array.isArray(value) ? value : Object.keys(value).filter(k => !k.match(/^[0-9]+$/));
+ define[`$${name}IdToLabel`] = "[" + keys.map(k => `"${k}"`).join(", ") + "]";
+ define[`$${name}LabelToId`] = "{" + keys.map(k => `"${k}": ${keys.indexOf(k)}`).join(", ") + "}";
+}
+
+for (const name of globalsToPrefix) {
+ define[name] = "__intrinsic__" + name;
+}
+
+for (const key in define) {
+ if (key.startsWith("$")) {
+ define["__intrinsic__" + key.slice(1)] = define[key];
+ delete define[key];
+ }
+}
+
export interface ReplacementRule {
from: RegExp;
to: string;
@@ -105,14 +141,27 @@ export function applyReplacements(src: string, length: number) {
];
} else if (name === "assert") {
const checkSlice = sliceSourceCode(rest, true, undefined, true);
+ let rest2 = checkSlice.rest;
+ let extraArgs = "";
+ if (checkSlice.result.at(-1) === ",") {
+ const sliced = sliceSourceCode("(" + rest2.slice(1), true, undefined, false);
+ extraArgs = ", " + sliced.result.slice(1, -1);
+ rest2 = sliced.rest;
+ }
return [
slice.slice(0, match.index) +
"(IS_BUN_DEVELOPMENT?$assert(" +
checkSlice.result.slice(1, -1) +
"," +
- JSON.stringify(checkSlice.result.slice(1, -1).replace(/__intrinsic__/g, "$")) +
+ JSON.stringify(
+ checkSlice.result
+ .slice(1, -1)
+ .replace(/__intrinsic__/g, "$")
+ .trim(),
+ ) +
+ extraArgs +
"):void 0)",
- checkSlice.rest,
+ rest2,
true,
];
}
diff --git a/src/js/_codegen/static-hash-tables.ts b/src/js/_codegen/static-hash-tables.ts
new file mode 100644
index 000000000..858974aa1
--- /dev/null
+++ b/src/js/_codegen/static-hash-tables.ts
@@ -0,0 +1,43 @@
+// TODO: move this file somewhere else. it doesnt make sense in src/js/
+// it generates C++ code not related to javascript at all
+import { spawn } from "bun";
+import path from "../node/path";
+
+const STATIC_HASH_TABLES = [
+ //
+ "src/bun.js/bindings/BunObject.cpp",
+ "src/bun.js/bindings/ZigGlobalObject.lut.txt",
+ "src/bun.js/bindings/JSBuffer.cpp",
+ "src/bun.js/bindings/Process.cpp",
+ "src/bun.js/bindings/ProcessBindingConstants.cpp",
+ "src/bun.js/bindings/ProcessBindingNatives.cpp",
+];
+
+console.time("Creating static hash tables...");
+const create_hash_table = path.join(import.meta.dir, "../../../src/bun.js/scripts/create_hash_table");
+if (!create_hash_table) {
+ console.warn("Could not find create_hash_table executable. Run `bun i` or clone webkit to build static hash tables");
+ process.exit(1);
+}
+
+await Promise.all(
+ STATIC_HASH_TABLES.map(async cpp => {
+ cpp = path.join(import.meta.dir, "../../../", cpp);
+ const { stdout, exited } = spawn({
+ cmd: [create_hash_table, cpp],
+ stdout: "pipe",
+ stderr: "inherit",
+ });
+ await exited;
+ let str = await new Response(stdout).text();
+ str = str.replaceAll(/^\/\/.*$/gm, "");
+ str = str.replaceAll(/^#include.*$/gm, "");
+ str = str.replaceAll(`namespace JSC {`, "");
+ str = str.replaceAll(`} // namespace JSC`, "");
+ str = "// File generated via `make static-hash-table` / `make cpp`\n" + str.trim() + "\n";
+ await Bun.write(cpp.replace(/\.cpp$/, ".lut.h").replace(/(\.lut)?\.txt$/, ".lut.h"), str);
+ console.log("Wrote", path.relative(process.cwd(), cpp.replace(/\.cpp$/, ".lut.h")));
+ }),
+);
+
+console.timeEnd("Creating static hash tables...");
diff --git a/src/js/builtins.d.ts b/src/js/builtins.d.ts
index 70d76e5a0..ee7bd68cf 100644
--- a/src/js/builtins.d.ts
+++ b/src/js/builtins.d.ts
@@ -12,7 +12,9 @@ declare function $debug(...args: any[]): void;
/** $assert is a preprocessor macro that only runs in debug mode. it throws an error if the first argument is falsy.
* The source code passed to `check` is inlined in the message, but in addition you can pass additional messages.
*/
-declare function $assert(check: any, ...message: any[]): void;
+declare function $assert(check: any, ...message: any[]): asserts check;
+
+declare const IS_BUN_DEVELOPMENT: boolean;
/** Place this directly above a function declaration (like a decorator) to make it a getter. */
declare const $getter: never;
@@ -26,6 +28,7 @@ declare var $visibility: "Public" | "Private";
declare var $nakedConstructor: never;
/** Assign to this directly above a function declaration (like a decorator) to set intrinsic */
declare var $intrinsic: string;
+/** Assign to this directly above a function declaration (like a decorator) to make it a constructor. */
declare var $constructor;
/** Place this directly above a function declaration (like a decorator) to NOT include "use strict" */
declare var $sloppy;
@@ -315,8 +318,6 @@ declare function $isPaused(): TODO;
declare function $isWindows(): TODO;
declare function $join(): TODO;
declare function $kind(): TODO;
-declare function $lazy(): TODO;
-declare function $lazyLoad(): TODO;
declare function $lazyStreamPrototypeMap(): TODO;
declare function $loadModule(): TODO;
declare function $localStreams(): TODO;
@@ -371,7 +372,7 @@ declare function $releaseLock(): TODO;
declare function $removeEventListener(): TODO;
declare function $require(): TODO;
declare function $requireESM(path: string): any;
-declare const $requireMap: Map<string, NodeModule>;
+declare const $requireMap: Map<string, CommonJSModuleRecord>;
declare const $internalModuleRegistry: InternalFieldObject<any[]>;
declare function $resolve(name: string, from: string): Promise<string>;
declare function $resolveSync(name: string, from: string, isESM?: boolean): string;
@@ -433,7 +434,14 @@ declare function $writer(): TODO;
declare function $writing(): TODO;
declare function $written(): TODO;
-declare function $createCommonJSModule(id: string, exports: any, hasEvaluated: boolean): NodeModule;
+declare function $createCommonJSModule(
+ id: string,
+ exports: any,
+ hasEvaluated: boolean,
+ parent: CommonJSModuleRecord,
+): CommonJSModuleRecord;
+
+declare function $overridableRequire(this: CommonJSModuleRecord, id: string): any;
// The following I cannot find any definitions of, but they are functional.
declare function $toLength(length: number): number;
diff --git a/src/js/builtins/BunBuiltinNames.h b/src/js/builtins/BunBuiltinNames.h
index 1c34f2726..f3266d5c2 100644
--- a/src/js/builtins/BunBuiltinNames.h
+++ b/src/js/builtins/BunBuiltinNames.h
@@ -69,8 +69,10 @@ using namespace JSC;
macro(createCommonJSModule) \
macro(createEmptyReadableStream) \
macro(createFIFO) \
+ macro(createInternalModuleById) \
macro(createNativeReadableStream) \
macro(createReadableStream) \
+ macro(createUsedReadableStream) \
macro(createUninitializedArrayBuffer) \
macro(createWritableStreamFromInternal) \
macro(cwd) \
@@ -119,6 +121,7 @@ using namespace JSC;
macro(inFlightCloseRequest) \
macro(inFlightWriteRequest) \
macro(initializeWith) \
+ macro(internalModuleRegistry) \
macro(internalRequire) \
macro(internalStream) \
macro(internalWritable) \
@@ -130,7 +133,6 @@ using namespace JSC;
macro(join) \
macro(kind) \
macro(lazy) \
- macro(lazyLoad) \
macro(lazyStreamPrototypeMap) \
macro(loadCJS2ESM) \
macro(localStreams) \
@@ -138,7 +140,6 @@ using namespace JSC;
macro(makeDOMException) \
macro(makeGetterTypeError) \
macro(makeThisTypeError) \
- macro(map) \
macro(method) \
macro(nextTick) \
macro(normalize) \
@@ -146,6 +147,7 @@ using namespace JSC;
macro(once) \
macro(options) \
macro(origin) \
+ macro(overridableRequire) \
macro(ownerReadableStream) \
macro(parse) \
macro(password) \
@@ -186,11 +188,10 @@ using namespace JSC;
macro(require) \
macro(requireESM) \
macro(requireMap) \
+ macro(requireNativeModule) \
macro(resolve) \
macro(resolveSync) \
macro(resume) \
- macro(search) \
- macro(searchParams) \
macro(self) \
macro(sep) \
macro(setBody) \
@@ -206,17 +207,12 @@ using namespace JSC;
macro(startedPromise) \
macro(state) \
macro(status) \
+ macro(statusText) \
macro(storedError) \
macro(strategy) \
macro(strategyHWM) \
macro(strategySizeAlgorithm) \
macro(stream) \
- macro(streamClosed) \
- macro(streamClosing) \
- macro(streamErrored) \
- macro(streamReadable) \
- macro(streamWaiting) \
- macro(streamWritable) \
macro(structuredCloneForStream) \
macro(syscall) \
macro(textDecoderStreamDecoder) \
@@ -245,9 +241,6 @@ using namespace JSC;
macro(writer) \
macro(writing) \
macro(written) \
- macro(createInternalModuleById) \
- macro(internalModuleRegistry) \
- macro(requireNativeModule) \
class BunBuiltinNames {
public:
diff --git a/src/js/builtins/BundlerPlugin.ts b/src/js/builtins/BundlerPlugin.ts
index 7be030ee8..d2c88b667 100644
--- a/src/js/builtins/BundlerPlugin.ts
+++ b/src/js/builtins/BundlerPlugin.ts
@@ -162,6 +162,9 @@ export function runSetupFunction(this: BundlerPlugin, setup: Setup, config: Buil
onResolve,
onStart: notImplementedIssueFn(2771, "On-start callbacks"),
resolve: notImplementedIssueFn(2771, "build.resolve()"),
+ module: () => {
+ throw new TypeError("module() is not supported in Bun.build() yet. Only via Bun.plugin() at runtime");
+ },
// esbuild's options argument is different, we provide some interop
initialOptions: {
...config,
diff --git a/src/js/builtins/ConsoleObject.ts b/src/js/builtins/ConsoleObject.ts
index 45746459a..b48593154 100644
--- a/src/js/builtins/ConsoleObject.ts
+++ b/src/js/builtins/ConsoleObject.ts
@@ -1,18 +1,55 @@
$overriddenName = "[Symbol.asyncIterator]";
export function asyncIterator(this: Console) {
- const Iterator = async function* ConsoleAsyncIterator() {
- const stream = Bun.stdin.stream();
- var reader = stream.getReader();
+ var stream = Bun.stdin.stream();
- // TODO: use builtin
- var decoder = new (globalThis as any).TextDecoder("utf-8", { fatal: false }) as TextDecoder;
- var deferredError;
- var indexOf = Bun.indexOfLine;
+ var decoder = new TextDecoder("utf-8", { fatal: false });
+ var indexOf = Bun.indexOfLine;
+ var actualChunk: Uint8Array;
+ var i: number = -1;
+ var idx: number;
+ var last: number;
+ var done: boolean;
+ var value: Uint8Array[];
+ var value_len: number;
+ var pendingChunk: Uint8Array | undefined;
+ async function* ConsoleAsyncIterator() {
+ var reader = stream.getReader();
+ var deferredError;
try {
+ if (i !== -1) {
+ last = i + 1;
+ i = indexOf(actualChunk, last);
+
+ while (i !== -1) {
+ yield decoder.decode(actualChunk.subarray(last, i));
+ last = i + 1;
+ i = indexOf(actualChunk, last);
+ }
+
+ for (idx++; idx < value_len; idx++) {
+ actualChunk = value[idx];
+ if (pendingChunk) {
+ actualChunk = Buffer.concat([pendingChunk, actualChunk]);
+ pendingChunk = undefined;
+ }
+
+ last = 0;
+ // TODO: "\r", 0x4048, 0x4049, 0x404A, 0x404B, 0x404C, 0x404D, 0x404E, 0x404F
+ i = indexOf(actualChunk, last);
+ while (i !== -1) {
+ yield decoder.decode(actualChunk.subarray(last, i));
+ last = i + 1;
+ i = indexOf(actualChunk, last);
+ }
+ i = -1;
+
+ pendingChunk = actualChunk.subarray(last);
+ }
+ actualChunk = undefined!;
+ }
+
while (true) {
- var done, value;
- var pendingChunk;
const firstResult = reader.readMany();
if ($isPromise(firstResult)) {
({ done, value } = await firstResult);
@@ -27,26 +64,29 @@ export function asyncIterator(this: Console) {
return;
}
- var actualChunk;
// we assume it was given line-by-line
- for (const chunk of value) {
- actualChunk = chunk;
+ for (idx = 0, value_len = value.length; idx < value_len; idx++) {
+ actualChunk = value[idx];
if (pendingChunk) {
- actualChunk = Buffer.concat([pendingChunk, chunk]);
- pendingChunk = null;
+ actualChunk = Buffer.concat([pendingChunk, actualChunk]);
+ pendingChunk = undefined;
}
- var last = 0;
+ last = 0;
// TODO: "\r", 0x4048, 0x4049, 0x404A, 0x404B, 0x404C, 0x404D, 0x404E, 0x404F
- var i = indexOf(actualChunk, last);
+ i = indexOf(actualChunk, last);
while (i !== -1) {
+ // This yield may end the function, in that case we need to be able to recover state
+ // if the iterator was fired up again.
yield decoder.decode(actualChunk.subarray(last, i));
last = i + 1;
i = indexOf(actualChunk, last);
}
+ i = -1;
pendingChunk = actualChunk.subarray(last);
}
+ actualChunk = undefined!;
}
} catch (e) {
deferredError = e;
@@ -57,11 +97,11 @@ export function asyncIterator(this: Console) {
throw deferredError;
}
}
- };
+ }
const symbol = globalThis.Symbol.asyncIterator;
- this[symbol] = Iterator;
- return Iterator();
+ this[symbol] = ConsoleAsyncIterator;
+ return ConsoleAsyncIterator();
}
export function write(this: Console, input) {
@@ -76,9 +116,769 @@ export function write(this: Console, input) {
const count = $argumentCount();
for (var i = 1; i < count; i++) {
- wrote += writer.write($argument(i));
+ wrote += writer.write(arguments[i]);
}
writer.flush(true);
return wrote;
}
+
+// This is the `console.Console` constructor. It is mostly copied from Node.
+// https://github.com/nodejs/node/blob/d2c7c367741bdcb6f7f77f55ce95a745f0b29fef/lib/internal/console/constructor.js
+// Some parts are copied from imported files and inlined here. Not too much of a performance issue
+// to do extra work at startup, since most people do not need `console.Console`.
+// TODO: probably could extract `getStringWidth`; probably make that a native function. note how it is copied from `readline.js`
+export function createConsoleConstructor(console: typeof globalThis.console) {
+ const { inspect, formatWithOptions } = require("node:util");
+ const { isBuffer } = require("node:buffer");
+
+ const StringPrototypeIncludes = String.prototype.includes;
+ const RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
+ const ArrayPrototypeUnshift = Array.prototype.unshift;
+ const StringPrototypeRepeat = String.prototype.repeat;
+ const StringPrototypeSlice = String.prototype.slice;
+ const ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
+ const StringPrototypePadStart = String.prototype.padStart;
+ const StringPrototypeSplit = String.prototype.split;
+ const NumberPrototypeToFixed = Number.prototype.toFixed;
+ const StringPrototypeNormalize = String.prototype.normalize;
+ const StringPrototypeCodePointAt = String.prototype.codePointAt;
+ const ArrayPrototypeMap = Array.prototype.map;
+ const ArrayPrototypeJoin = Array.prototype.join;
+ const ArrayPrototypePush = Array.prototype.push;
+
+ const kCounts = Symbol("counts");
+
+ const kSecond = 1000;
+ const kMinute = 60 * kSecond;
+ const kHour = 60 * kMinute;
+
+ // Regex used for ansi escape code splitting
+ // Adopted from https://github.com/chalk/ansi-regex/blob/HEAD/index.js
+ // License: MIT, authors: @sindresorhus, Qix-, arjunmehta and LitoMore
+ // Matches all ansi escape code sequences in a string
+ var ansiPattern =
+ "[\\u001B\\u009B][[\\]()#;?]*" +
+ "(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*" +
+ "|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)" +
+ "|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))";
+ var ansi = new RegExp(ansiPattern, "g");
+
+ /**
+ * Returns true if the character represented by a given
+ * Unicode code point is full-width. Otherwise returns false.
+ */
+ var isFullWidthCodePoint = code => {
+ // Code points are partially derived from:
+ // https://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt
+ return (
+ code >= 0x1100 &&
+ (code <= 0x115f || // Hangul Jamo
+ code === 0x2329 || // LEFT-POINTING ANGLE BRACKET
+ code === 0x232a || // RIGHT-POINTING ANGLE BRACKET
+ // CJK Radicals Supplement .. Enclosed CJK Letters and Months
+ (code >= 0x2e80 && code <= 0x3247 && code !== 0x303f) ||
+ // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
+ (code >= 0x3250 && code <= 0x4dbf) ||
+ // CJK Unified Ideographs .. Yi Radicals
+ (code >= 0x4e00 && code <= 0xa4c6) ||
+ // Hangul Jamo Extended-A
+ (code >= 0xa960 && code <= 0xa97c) ||
+ // Hangul Syllables
+ (code >= 0xac00 && code <= 0xd7a3) ||
+ // CJK Compatibility Ideographs
+ (code >= 0xf900 && code <= 0xfaff) ||
+ // Vertical Forms
+ (code >= 0xfe10 && code <= 0xfe19) ||
+ // CJK Compatibility Forms .. Small Form Variants
+ (code >= 0xfe30 && code <= 0xfe6b) ||
+ // Halfwidth and Fullwidth Forms
+ (code >= 0xff01 && code <= 0xff60) ||
+ (code >= 0xffe0 && code <= 0xffe6) ||
+ // Kana Supplement
+ (code >= 0x1b000 && code <= 0x1b001) ||
+ // Enclosed Ideographic Supplement
+ (code >= 0x1f200 && code <= 0x1f251) ||
+ // Miscellaneous Symbols and Pictographs 0x1f300 - 0x1f5ff
+ // Emoticons 0x1f600 - 0x1f64f
+ (code >= 0x1f300 && code <= 0x1f64f) ||
+ // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
+ (code >= 0x20000 && code <= 0x3fffd))
+ );
+ };
+
+ var isZeroWidthCodePoint = code => {
+ return (
+ code <= 0x1f || // C0 control codes
+ (code >= 0x7f && code <= 0x9f) || // C1 control codes
+ (code >= 0x300 && code <= 0x36f) || // Combining Diacritical Marks
+ (code >= 0x200b && code <= 0x200f) || // Modifying Invisible Characters
+ // Combining Diacritical Marks for Symbols
+ (code >= 0x20d0 && code <= 0x20ff) ||
+ (code >= 0xfe00 && code <= 0xfe0f) || // Variation Selectors
+ (code >= 0xfe20 && code <= 0xfe2f) || // Combining Half Marks
+ (code >= 0xe0100 && code <= 0xe01ef)
+ ); // Variation Selectors
+ };
+
+ function stripVTControlCharacters(str) {
+ return (RegExpPrototypeSymbolReplace as any).$call(ansi, str, "");
+ }
+
+ /**
+ * Returns the number of columns required to display the given string.
+ */
+ var getStringWidth = function getStringWidth(str, removeControlChars = true) {
+ var width = 0;
+
+ if (removeControlChars) str = stripVTControlCharacters(str);
+ str = StringPrototypeNormalize.$call(str, "NFC");
+ for (var char of str) {
+ var code = StringPrototypeCodePointAt.$call(char, 0);
+ if (isFullWidthCodePoint(code)) {
+ width += 2;
+ } else if (!isZeroWidthCodePoint(code)) {
+ width++;
+ }
+ }
+
+ return width;
+ };
+
+ const tableChars = {
+ middleMiddle: "─",
+ rowMiddle: "┼",
+ topRight: "┐",
+ topLeft: "┌",
+ leftMiddle: "├",
+ topMiddle: "┬",
+ bottomRight: "┘",
+ bottomLeft: "└",
+ bottomMiddle: "┴",
+ rightMiddle: "┤",
+ left: "│ ",
+ right: " │",
+ middle: " │ ",
+ };
+
+ const renderRow = (row, columnWidths) => {
+ let out = tableChars.left;
+ for (let i = 0; i < row.length; i++) {
+ const cell = row[i];
+ const len = getStringWidth(cell);
+ const needed = (columnWidths[i] - len) / 2;
+ // round(needed) + ceil(needed) will always add up to the amount
+ // of spaces we need while also left justifying the output.
+ out +=
+ (StringPrototypeRepeat as any).$call(" ", needed) + cell + StringPrototypeRepeat.$call(" ", Math.ceil(needed));
+ if (i !== row.length - 1) out += tableChars.middle;
+ }
+ out += tableChars.right;
+ return out;
+ };
+
+ const table = (head, columns) => {
+ const columnWidths = ArrayPrototypeMap.$call(head, h => getStringWidth(h)) as number[];
+ const longestColumn = Math.max(...(ArrayPrototypeMap as any).$call(columns, a => a.length));
+ const rows: any = $newArrayWithSize(longestColumn);
+
+ for (let i = 0; i < head.length; i++) {
+ const column = columns[i];
+ for (let j = 0; j < longestColumn; j++) {
+ if (rows[j] === undefined) rows[j] = [];
+ const value = (rows[j][i] = ObjectPrototypeHasOwnProperty.$call(column, j) ? column[j] : "");
+ const width = columnWidths[i] || 0;
+ const counted = getStringWidth(value);
+ columnWidths[i] = Math.max(width, counted);
+ }
+ }
+
+ const divider = ArrayPrototypeMap.$call(columnWidths, i =>
+ StringPrototypeRepeat.$call(tableChars.middleMiddle, i + 2),
+ );
+
+ let result =
+ tableChars.topLeft +
+ ArrayPrototypeJoin.$call(divider, tableChars.topMiddle) +
+ tableChars.topRight +
+ "\n" +
+ renderRow(head, columnWidths) +
+ "\n" +
+ tableChars.leftMiddle +
+ ArrayPrototypeJoin.$call(divider, tableChars.rowMiddle) +
+ tableChars.rightMiddle +
+ "\n";
+
+ for (const row of rows) result += `${renderRow(row, columnWidths)}\n`;
+
+ result +=
+ tableChars.bottomLeft + ArrayPrototypeJoin.$call(divider, tableChars.bottomMiddle) + tableChars.bottomRight;
+
+ return result;
+ };
+
+ // Track amount of indentation required via `console.group()`.
+ const kGroupIndent = Symbol("kGroupIndent");
+ const kGroupIndentationWidth = Symbol("kGroupIndentWidth");
+ const kFormatForStderr = Symbol("kFormatForStderr");
+ const kFormatForStdout = Symbol("kFormatForStdout");
+ const kGetInspectOptions = Symbol("kGetInspectOptions");
+ const kColorMode = Symbol("kColorMode");
+ const kIsConsole = Symbol("kIsConsole");
+ const kWriteToConsole = Symbol("kWriteToConsole");
+ const kBindProperties = Symbol("kBindProperties");
+ const kBindStreamsEager = Symbol("kBindStreamsEager");
+ const kBindStreamsLazy = Symbol("kBindStreamsLazy");
+ const kUseStdout = Symbol("kUseStdout");
+ const kUseStderr = Symbol("kUseStderr");
+
+ const optionsMap = new WeakMap<any, any>();
+ function Console(this: any, options /* or: stdout, stderr, ignoreErrors = true */) {
+ // We have to test new.target here to see if this function is called
+ // with new, because we need to define a custom instanceof to accommodate
+ // the global console.
+ if (new.target === undefined) {
+ return Reflect.construct(Console, arguments);
+ }
+
+ if (!options || typeof options.write === "function") {
+ options = {
+ stdout: options,
+ stderr: arguments[1],
+ ignoreErrors: arguments[2],
+ };
+ }
+
+ const {
+ stdout,
+ stderr = stdout,
+ ignoreErrors = true,
+ colorMode = "auto",
+ inspectOptions,
+ groupIndentation,
+ } = options;
+
+ if (!stdout || typeof stdout.write !== "function") {
+ // throw new ERR_CONSOLE_WRITABLE_STREAM("stdout");
+ throw new TypeError("stdout is not a writable stream");
+ }
+ if (!stderr || typeof stderr.write !== "function") {
+ // throw new ERR_CONSOLE_WRITABLE_STREAM("stderr");
+ throw new TypeError("stderr is not a writable stream");
+ }
+
+ if (typeof colorMode !== "boolean" && colorMode !== "auto") {
+ // throw new ERR_INVALID_ARG_VALUE("colorMode", colorMode);
+ throw new TypeError("colorMode must be a boolean or 'auto'");
+ }
+
+ if (groupIndentation !== undefined) {
+ // validateInteger(groupIndentation, "groupIndentation", 0, kMaxGroupIndentation);
+ }
+
+ if (inspectOptions !== undefined) {
+ // validateObject(inspectOptions, "options.inspectOptions");
+
+ if (inspectOptions.colors !== undefined && options.colorMode !== undefined) {
+ // throw new ERR_INCOMPATIBLE_OPTION_PAIR("options.inspectOptions.color", "colorMode");
+ }
+ optionsMap.set(this, inspectOptions);
+ }
+
+ // Bind the prototype functions to this Console instance
+ Object.keys(Console.prototype).forEach(key => {
+ // We have to bind the methods grabbed from the instance instead of from
+ // the prototype so that users extending the Console can override them
+ // from the prototype chain of the subclass.
+ this[key] = this[key].bind(this);
+ Object.defineProperty(this[key], "name", {
+ value: key,
+ });
+ });
+
+ this[kBindStreamsEager](stdout, stderr);
+ this[kBindProperties](ignoreErrors, colorMode, groupIndentation);
+ }
+
+ const consolePropAttributes = {
+ writable: true,
+ enumerable: false,
+ configurable: true,
+ };
+
+ // Fixup global.console instanceof global.console.Console
+ Object.defineProperty(Console, Symbol.hasInstance, {
+ value(instance) {
+ return instance[kIsConsole] || instance === console;
+ },
+ });
+
+ const kColorInspectOptions = { colors: true };
+ const kNoColorInspectOptions = {};
+
+ Object.defineProperties((Console.prototype = {}), {
+ [kBindStreamsEager]: {
+ ...consolePropAttributes,
+ // Eager version for the Console constructor
+ value: function (stdout, stderr) {
+ Object.defineProperties(this, {
+ "_stdout": { ...consolePropAttributes, value: stdout },
+ "_stderr": { ...consolePropAttributes, value: stderr },
+ });
+ },
+ },
+ [kBindStreamsLazy]: {
+ ...consolePropAttributes,
+ // Lazily load the stdout and stderr from an object so we don't
+ // create the stdio streams when they are not even accessed
+ value: function (object) {
+ let stdout;
+ let stderr;
+ Object.defineProperties(this, {
+ "_stdout": {
+ enumerable: false,
+ configurable: true,
+ get() {
+ if (!stdout) stdout = object.stdout;
+ return stdout;
+ },
+ set(value) {
+ stdout = value;
+ },
+ },
+ "_stderr": {
+ enumerable: false,
+ configurable: true,
+ get() {
+ if (!stderr) {
+ stderr = object.stderr;
+ }
+ return stderr;
+ },
+ set(value) {
+ stderr = value;
+ },
+ },
+ });
+ },
+ },
+ [kBindProperties]: {
+ ...consolePropAttributes,
+ value: function (ignoreErrors, colorMode, groupIndentation = 2) {
+ Object.defineProperties(this, {
+ "_stdoutErrorHandler": {
+ ...consolePropAttributes,
+ value: createWriteErrorHandler(this, kUseStdout),
+ },
+ "_stderrErrorHandler": {
+ ...consolePropAttributes,
+ value: createWriteErrorHandler(this, kUseStderr),
+ },
+ "_ignoreErrors": {
+ ...consolePropAttributes,
+ value: Boolean(ignoreErrors),
+ },
+ "_times": { ...consolePropAttributes, value: new Map() },
+ // Corresponds to https://console.spec.whatwg.org/#count-map
+ [kCounts]: { ...consolePropAttributes, value: new Map() },
+ [kColorMode]: { ...consolePropAttributes, value: colorMode },
+ [kIsConsole]: { ...consolePropAttributes, value: true },
+ [kGroupIndent]: { ...consolePropAttributes, value: "" },
+ [kGroupIndentationWidth]: {
+ ...consolePropAttributes,
+ value: groupIndentation,
+ },
+ [Symbol.toStringTag]: {
+ writable: false,
+ enumerable: false,
+ configurable: true,
+ value: "console",
+ },
+ });
+ },
+ },
+ [kWriteToConsole]: {
+ ...consolePropAttributes,
+ value: function (streamSymbol, string) {
+ const ignoreErrors = this._ignoreErrors;
+ const groupIndent = this[kGroupIndent];
+
+ const useStdout = streamSymbol === kUseStdout;
+ const stream = useStdout ? this._stdout : this._stderr;
+ const errorHandler = useStdout ? this._stdoutErrorHandler : this._stderrErrorHandler;
+
+ if (groupIndent.length !== 0) {
+ if (StringPrototypeIncludes.$call(string, "\n")) {
+ // ?!
+ string = (RegExpPrototypeSymbolReplace.$call as any)(/\n/g, string, `\n${groupIndent}`);
+ }
+ string = groupIndent + string;
+ }
+ string += "\n";
+
+ if (ignoreErrors === false) return stream.write(string);
+
+ // There may be an error occurring synchronously (e.g. for files or TTYs
+ // on POSIX systems) or asynchronously (e.g. pipes on POSIX systems), so
+ // handle both situations.
+ try {
+ // Add and later remove a noop error handler to catch synchronous
+ // errors.
+ if (stream.listenerCount("error") === 0) stream.once("error", noop);
+
+ stream.write(string, errorHandler);
+ } catch (e) {
+ // Console is a debugging utility, so it swallowing errors is not
+ // desirable even in edge cases such as low stack space.
+ // if (isStackOverflowError(e)) throw e;
+ // Sorry, there's no proper way to pass along the error here.
+ } finally {
+ stream.removeListener("error", noop);
+ }
+ },
+ },
+ [kGetInspectOptions]: {
+ ...consolePropAttributes,
+ value: function (stream) {
+ let color = this[kColorMode];
+ if (color === "auto") {
+ if (process.env.FORCE_COLOR !== undefined) {
+ color = Bun.enableANSIColors;
+ } else {
+ color = stream.isTTY && (typeof stream.getColorDepth === "function" ? stream.getColorDepth() > 2 : true);
+ }
+ }
+
+ const options = optionsMap.get(this);
+ if (options) {
+ if (options.colors === undefined) {
+ options.colors = color;
+ }
+ return options;
+ }
+
+ return color ? kColorInspectOptions : kNoColorInspectOptions;
+ },
+ },
+ [kFormatForStdout]: {
+ ...consolePropAttributes,
+ value: function (args) {
+ const opts = this[kGetInspectOptions](this._stdout);
+ return formatWithOptions(opts, ...args);
+ },
+ },
+ [kFormatForStderr]: {
+ ...consolePropAttributes,
+ value: function (args) {
+ const opts = this[kGetInspectOptions](this._stderr);
+ return formatWithOptions(opts, ...args);
+ },
+ },
+ });
+
+ // Make a function that can serve as the callback passed to `stream.write()`.
+ function createWriteErrorHandler(instance, streamSymbol) {
+ return err => {
+ // This conditional evaluates to true if and only if there was an error
+ // that was not already emitted (which happens when the _write callback
+ // is invoked asynchronously).
+ const stream = streamSymbol === kUseStdout ? instance._stdout : instance._stderr;
+ if (err !== null && !stream._writableState.errorEmitted) {
+ // If there was an error, it will be emitted on `stream` as
+ // an `error` event. Adding a `once` listener will keep that error
+ // from becoming an uncaught exception, but since the handler is
+ // removed after the event, non-console.* writes won't be affected.
+ // we are only adding noop if there is no one else listening for 'error'
+ if (stream.listenerCount("error") === 0) {
+ stream.once("error", noop);
+ }
+ }
+ };
+ }
+
+ const consoleMethods: any = {
+ log(...args) {
+ this[kWriteToConsole](kUseStdout, this[kFormatForStdout](args));
+ },
+
+ warn(...args) {
+ this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args));
+ },
+
+ dir(object, options) {
+ this[kWriteToConsole](
+ kUseStdout,
+ inspect(object, {
+ customInspect: false,
+ ...this[kGetInspectOptions](this._stdout),
+ ...options,
+ }),
+ );
+ },
+
+ time(label = "default") {
+ // Coerces everything other than Symbol to a string
+ label = `${label}`;
+ if (this._times.has(label)) {
+ process.emitWarning(`Label '${label}' already exists for console.time()`);
+ return;
+ }
+ // trace(kTraceBegin, kTraceConsoleCategory, `time::${label}`, 0);
+ this._times.set(label, process.hrtime());
+ },
+
+ timeEnd(label = "default") {
+ // Coerces everything other than Symbol to a string
+ label = `${label}`;
+ const found = timeLogImpl(this, "timeEnd", label);
+ // trace(kTraceEnd, kTraceConsoleCategory, `time::${label}`, 0);
+ if (found) {
+ this._times.delete(label);
+ }
+ },
+
+ timeLog(label = "default", ...data) {
+ // Coerces everything other than Symbol to a string
+ label = `${label}`;
+ timeLogImpl(this, "timeLog", label, data);
+ // trace(kTraceInstant, kTraceConsoleCategory, `time::${label}`, 0);
+ },
+
+ trace: function trace(...args) {
+ const err: Error = {
+ name: "Trace",
+ message: this[kFormatForStderr](args),
+ };
+ Error.captureStackTrace(err, trace);
+ this.error(err.stack);
+ },
+
+ assert(expression, ...args) {
+ if (!expression) {
+ args[0] = `Assertion failed${args.length === 0 ? "" : `: ${args[0]}`}`;
+ // The arguments will be formatted in warn() again
+ this.warn.$apply(this, args);
+ }
+ },
+
+ // Defined by: https://console.spec.whatwg.org/#clear
+ clear() {
+ // It only makes sense to clear if _stdout is a TTY.
+ // Otherwise, do nothing.
+ if (this._stdout.isTTY && process.env.TERM !== "dumb") {
+ this._stdout.write("\x1b[2J");
+ this._stdout.write("\x1b[0f");
+ }
+ },
+
+ // Defined by: https://console.spec.whatwg.org/#count
+ count(label = "default") {
+ // Ensures that label is a string, and only things that can be
+ // coerced to strings. e.g. Symbol is not allowed
+ label = `${label}`;
+ const counts = this[kCounts];
+ let count = counts.get(label);
+ if (count === undefined) count = 1;
+ else count++;
+ counts.set(label, count);
+ // trace(kTraceCount, kTraceConsoleCategory, `count::${label}`, 0, count);
+ this.log(`${label}: ${count}`);
+ },
+
+ // Defined by: https://console.spec.whatwg.org/#countreset
+ countReset(label = "default") {
+ const counts = this[kCounts];
+ if (!counts.has(label)) {
+ process.emitWarning(`Count for '${label}' does not exist`);
+ return;
+ }
+ // trace(kTraceCount, kTraceConsoleCategory, `count::${label}`, 0, 0);
+ counts.delete(`${label}`);
+ },
+
+ group(...data) {
+ if (data.length > 0) {
+ this.log.$apply(this, data);
+ }
+ this[kGroupIndent] += StringPrototypeRepeat.$call(" ", this[kGroupIndentationWidth]);
+ },
+
+ groupEnd() {
+ this[kGroupIndent] = StringPrototypeSlice.$call(
+ this[kGroupIndent],
+ 0,
+ this[kGroupIndent].length - this[kGroupIndentationWidth],
+ );
+ },
+
+ // https://console.spec.whatwg.org/#table
+ table(tabularData, properties) {
+ if (properties !== undefined) {
+ // validateArray(properties, "properties");
+ }
+
+ if (tabularData === null || typeof tabularData !== "object") return this.log(tabularData);
+ const final = (k, v) => this.log(table(k, v));
+
+ const _inspect = v => {
+ const depth = v !== null && typeof v === "object" && !isArray(v) && Object.keys(v).length > 2 ? -1 : 0;
+ const opt = {
+ depth,
+ maxArrayLength: 3,
+ breakLength: Infinity,
+ ...this[kGetInspectOptions](this._stdout),
+ };
+ return inspect(v, opt);
+ };
+ const getIndexArray = length => Array.from({ length }, (_, i) => _inspect(i));
+
+ const mapIter = $isMapIterator(tabularData);
+ let isKeyValue = false;
+ let i = 0;
+ // if (mapIter) {
+ // const res = previewEntries(tabularData, true);
+ // tabularData = res[0];
+ // isKeyValue = res[1];
+ // }
+
+ if (isKeyValue || $isMap(tabularData)) {
+ const keys = [];
+ const values = [];
+ let length = 0;
+ if (mapIter) {
+ for (; i < tabularData.length / 2; ++i) {
+ ArrayPrototypePush.$call(keys, _inspect(tabularData[i * 2]));
+ ArrayPrototypePush.$call(values, _inspect(tabularData[i * 2 + 1]));
+ length++;
+ }
+ } else {
+ for (const { 0: k, 1: v } of tabularData) {
+ ArrayPrototypePush.$call(keys, _inspect(k));
+ ArrayPrototypePush.$call(values, _inspect(v));
+ length++;
+ }
+ }
+ return final([iterKey, keyKey, valuesKey], [getIndexArray(length), keys, values]);
+ }
+
+ const setIter = $isSetIterator(tabularData);
+ // if (setIter) tabularData = previewEntries(tabularData);
+
+ const setlike = setIter || mapIter || $isSet(tabularData);
+ if (setlike) {
+ const values = [];
+ let length = 0;
+ for (const v of tabularData as Set<any>) {
+ ArrayPrototypePush.$call(values, _inspect(v));
+ length++;
+ }
+ return final([iterKey, valuesKey], [getIndexArray(length), values]);
+ }
+
+ const map = { __proto__: null };
+ let hasPrimitives = false;
+ const valuesKeyArray: any = [];
+ const indexKeyArray = Object.keys(tabularData);
+
+ for (; i < indexKeyArray.length; i++) {
+ const item = tabularData[indexKeyArray[i]];
+ const primitive = item === null || (typeof item !== "function" && typeof item !== "object");
+ if (properties === undefined && primitive) {
+ hasPrimitives = true;
+ valuesKeyArray[i] = _inspect(item);
+ } else {
+ const keys = properties || Object.keys(item);
+ for (const key of keys) {
+ map[key] ??= [];
+ if ((primitive && properties) || !ObjectPrototypeHasOwnProperty.$call(item, key)) map[key][i] = "";
+ else map[key][i] = _inspect(item[key]);
+ }
+ }
+ }
+
+ const keys = Object.keys(map);
+ const values = Object.values(map);
+ if (hasPrimitives) {
+ ArrayPrototypePush.$call(keys, valuesKey);
+ ArrayPrototypePush.$call(values, valuesKeyArray);
+ }
+ ArrayPrototypeUnshift.$call(keys, indexKey);
+ ArrayPrototypeUnshift.$call(values, indexKeyArray);
+
+ return final(keys, values);
+ },
+ };
+
+ // Returns true if label was found
+ function timeLogImpl(self, name, label, data?) {
+ const time = self._times.get(label);
+ if (time === undefined) {
+ process.emitWarning(`No such label '${label}' for console.${name}()`);
+ return false;
+ }
+ const duration = process.hrtime(time);
+ const ms = duration[0] * 1000 + duration[1] / 1e6;
+
+ const formatted = formatTime(ms);
+
+ if (data === undefined) {
+ self.log("%s: %s", label, formatted);
+ } else {
+ self.log("%s: %s", label, formatted, ...data);
+ }
+ return true;
+ }
+
+ function pad(value) {
+ return StringPrototypePadStart.$call(`${value}`, 2, "0");
+ }
+
+ function formatTime(ms) {
+ let hours = 0;
+ let minutes = 0;
+ let seconds: string | number = 0;
+
+ if (ms >= kSecond) {
+ if (ms >= kMinute) {
+ if (ms >= kHour) {
+ hours = Math.floor(ms / kHour);
+ ms = ms % kHour;
+ }
+ minutes = Math.floor(ms / kMinute);
+ ms = ms % kMinute;
+ }
+ seconds = ms / kSecond;
+ }
+
+ if (hours !== 0 || minutes !== 0) {
+ ({ 0: seconds, 1: ms } = (StringPrototypeSplit.$call as any)(NumberPrototypeToFixed.$call(seconds, 3), "."));
+ const res = hours !== 0 ? `${hours}:${pad(minutes)}` : minutes;
+ return `${res}:${pad(seconds)}.${ms} (${hours !== 0 ? "h:m" : ""}m:ss.mmm)`;
+ }
+
+ if (seconds !== 0) {
+ return `${NumberPrototypeToFixed.$call(seconds, 3)}s`;
+ }
+
+ return `${Number(NumberPrototypeToFixed.$call(ms, 3))}ms`;
+ }
+
+ const keyKey = "Key";
+ const valuesKey = "Values";
+ const indexKey = "(index)";
+ const iterKey = "(iteration index)";
+
+ const isArray = v => $isJSArray(v) || $isTypedArrayView(v) || isBuffer(v);
+
+ function noop() {}
+
+ for (const method of Reflect.ownKeys(consoleMethods)) Console.prototype[method] = consoleMethods[method];
+
+ Console.prototype.debug = Console.prototype.log;
+ Console.prototype.info = Console.prototype.log;
+ Console.prototype.dirxml = Console.prototype.log;
+ Console.prototype.error = Console.prototype.warn;
+ Console.prototype.groupCollapsed = Console.prototype.group;
+
+ return Console;
+}
diff --git a/src/js/builtins/ImportMetaObject.ts b/src/js/builtins/ImportMetaObject.ts
index 9409bb0f1..bf498e9f9 100644
--- a/src/js/builtins/ImportMetaObject.ts
+++ b/src/js/builtins/ImportMetaObject.ts
@@ -118,17 +118,17 @@ export function internalRequire(this: ImportMetaObject, id) {
if (last5 === ".json") {
var fs = (globalThis[Symbol.for("_fs")] ||= Bun.fs());
var exports = JSON.parse(fs.readFileSync(id, "utf8"));
- $requireMap.$set(id, $createCommonJSModule(id, exports, true));
+ $requireMap.$set(id, $createCommonJSModule(id, exports, true, undefined));
return exports;
} else if (last5 === ".node") {
- const module = $createCommonJSModule(id, {}, true);
+ const module = $createCommonJSModule(id, {}, true, undefined);
process.dlopen(module, id);
$requireMap.$set(id, module);
return module.exports;
} else if (last5 === ".toml") {
var fs = (globalThis[Symbol.for("_fs")] ||= Bun.fs());
var exports = Bun.TOML.parse(fs.readFileSync(id, "utf8"));
- $requireMap.$set(id, $createCommonJSModule(id, exports, true));
+ $requireMap.$set(id, $createCommonJSModule(id, exports, true, undefined));
return exports;
} else {
var exports = $requireESM(id);
@@ -136,7 +136,7 @@ export function internalRequire(this: ImportMetaObject, id) {
if (cachedModule) {
return cachedModule.exports;
}
- $requireMap.$set(id, $createCommonJSModule(id, exports, true));
+ $requireMap.$set(id, $createCommonJSModule(id, exports, true, undefined));
return exports;
}
}
@@ -152,7 +152,7 @@ export function createRequireCache() {
const esm = Loader.registry.$get(key);
if (esm?.evaluated) {
const namespace = Loader.getModuleNamespaceObject(esm.module);
- const mod = $createCommonJSModule(key, namespace, true);
+ const mod = $createCommonJSModule(key, namespace, true, undefined);
$requireMap.$set(key, mod);
return mod;
}
@@ -165,7 +165,7 @@ export function createRequireCache() {
},
has(target, key: string) {
- return $requireMap.$has(key) || Loader.registry.$has(key);
+ return $requireMap.$has(key) || Boolean(Loader.registry.$get(key)?.evaluated);
},
deleteProperty(target, key: string) {
@@ -177,13 +177,11 @@ export function createRequireCache() {
ownKeys(target) {
var array = [...$requireMap.$keys()];
- const registryKeys = [...Loader.registry.$keys()];
- for (const key of registryKeys) {
- if (!array.includes(key)) {
+ for (const key of Loader.registry.$keys()) {
+ if (!array.includes(key) && Loader.registry.$get(key)?.evaluated) {
$arrayPush(array, key);
}
}
-
return array;
},
@@ -193,7 +191,7 @@ export function createRequireCache() {
},
getOwnPropertyDescriptor(target, key: string) {
- if ($requireMap.$has(key) || Loader.registry.$has(key)) {
+ if ($requireMap.$has(key) || Loader.registry.$get(key)?.evaluated) {
return {
configurable: true,
enumerable: true,
diff --git a/src/js/builtins/JSBufferConstructor.ts b/src/js/builtins/JSBufferConstructor.ts
index a1072ea10..69615d8dc 100644
--- a/src/js/builtins/JSBufferConstructor.ts
+++ b/src/js/builtins/JSBufferConstructor.ts
@@ -1,3 +1,6 @@
+// This is marked as a constructor because Node.js allows `new Buffer.from`,
+// Some legacy dependencies depend on this, see #3638
+$constructor;
export function from(items) {
if ($isUndefinedOrNull(items)) {
throw new TypeError(
diff --git a/src/js/builtins/Module.ts b/src/js/builtins/Module.ts
index aa08bc728..b074d3488 100644
--- a/src/js/builtins/Module.ts
+++ b/src/js/builtins/Module.ts
@@ -1,21 +1,14 @@
-interface CommonJSModuleRecord {
- $require(id: string, mod: any): any;
- children: CommonJSModuleRecord[];
- exports: any;
- id: string;
- loaded: boolean;
- parent: undefined;
- path: string;
- paths: string[];
- require: typeof require;
-}
-
$getter;
export function main() {
return $requireMap.$get(Bun.main);
}
export function require(this: CommonJSModuleRecord, id: string) {
+ return $overridableRequire.$call(this, id);
+}
+
+// overridableRequire can be overridden by setting `Module.prototype.require`
+export function overridableRequire(this: CommonJSModuleRecord, id: string) {
const existing = $requireMap.$get(id) || $requireMap.$get((id = $resolveSync(id, this.path, false)));
if (existing) {
// Scenario where this is necessary:
@@ -45,7 +38,7 @@ export function require(this: CommonJSModuleRecord, id: string) {
// To handle import/export cycles, we need to create a module object and put
// it into the map before we import it.
- const mod = $createCommonJSModule(id, {}, false);
+ const mod = $createCommonJSModule(id, {}, false, this);
$requireMap.$set(id, mod);
// This is where we load the module. We will see if Module._load and
diff --git a/src/js/builtins/ProcessObjectInternals.ts b/src/js/builtins/ProcessObjectInternals.ts
index 2bb8648df..a72a96c2a 100644
--- a/src/js/builtins/ProcessObjectInternals.ts
+++ b/src/js/builtins/ProcessObjectInternals.ts
@@ -24,27 +24,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// TODO: move this to native code?
-export function binding(bindingName) {
- if (bindingName === "constants") {
- return $processBindingConstants;
- }
- const issue = {
- fs: 3546,
- buffer: 2020,
- natives: 2254,
- uv: 2891,
- }[bindingName];
- if (issue) {
- throw new Error(
- `process.binding("${bindingName}") is not implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/${issue}`,
- );
- }
- throw new TypeError(
- `process.binding("${bindingName}") is not implemented in Bun. If that breaks something, please file an issue and include a reproducible code sample.`,
- );
-}
-
export function getStdioWriteStream(fd) {
const tty = require("node:tty");
@@ -110,7 +89,8 @@ export function getStdinStream(fd) {
const tty = require("node:tty");
- const stream = new tty.ReadStream(fd);
+ const ReadStream = tty.isatty(fd) ? tty.ReadStream : require("node:fs").ReadStream;
+ const stream = new ReadStream(fd);
const originalOn = stream.on;
stream.on = function (event, listener) {
@@ -126,7 +106,7 @@ export function getStdinStream(fd) {
if (event === "readable") {
ref();
}
- return originalOn.call(this, event, listener);
+ return originalOn.$call(this, event, listener);
};
stream.fd = fd;
@@ -134,13 +114,13 @@ export function getStdinStream(fd) {
const originalPause = stream.pause;
stream.pause = function () {
unref();
- return originalPause.call(this);
+ return originalPause.$call(this);
};
const originalResume = stream.resume;
stream.resume = function () {
ref();
- return originalResume.call(this);
+ return originalResume.$call(this);
};
async function internalRead(stream) {
@@ -272,6 +252,11 @@ export function initializeNextTickQueue(process, nextTickQueue, drainMicrotasksF
// but allows much quicker checks.
class FixedCircularBuffer {
+ top: number;
+ bottom: number;
+ list: Array<FixedCircularBuffer | undefined>;
+ next: FixedCircularBuffer | null;
+
constructor() {
this.bottom = 0;
this.top = 0;
@@ -303,6 +288,9 @@ export function initializeNextTickQueue(process, nextTickQueue, drainMicrotasksF
}
class FixedQueue {
+ head: FixedCircularBuffer;
+ tail: FixedCircularBuffer;
+
constructor() {
this.head = this.tail = new FixedCircularBuffer();
}
@@ -401,3 +389,8 @@ export function initializeNextTickQueue(process, nextTickQueue, drainMicrotasksF
return nextTick;
}
+
+$getter;
+export function mainModule() {
+ return $requireMap.$get(Bun.main);
+}
diff --git a/src/js/builtins/ReadableStream.ts b/src/js/builtins/ReadableStream.ts
index 419a8e696..c1d43a430 100644
--- a/src/js/builtins/ReadableStream.ts
+++ b/src/js/builtins/ReadableStream.ts
@@ -291,6 +291,15 @@ export function createEmptyReadableStream() {
}
$linkTimeConstant;
+export function createUsedReadableStream() {
+ var stream = new ReadableStream({
+ pull() {},
+ } as any);
+ stream.getReader();
+ return stream;
+}
+
+$linkTimeConstant;
export function createNativeReadableStream(nativePtr, nativeType, autoAllocateChunkSize) {
return new ReadableStream({
$lazy: true,
diff --git a/src/js/builtins/ReadableStreamInternals.ts b/src/js/builtins/ReadableStreamInternals.ts
index e249aea0a..36f049f3e 100644
--- a/src/js/builtins/ReadableStreamInternals.ts
+++ b/src/js/builtins/ReadableStreamInternals.ts
@@ -1034,7 +1034,8 @@ export function createTextStream(highWaterMark) {
if (byteLength > 0) {
hasBuffer = true;
if (rope.length > 0) {
- $arrayPush(array, rope, chunk);
+ $arrayPush(array, rope);
+ $arrayPush(array, chunk);
rope = "";
} else {
$arrayPush(array, chunk);
@@ -1073,12 +1074,12 @@ export function createTextStream(highWaterMark) {
}
if (hasBuffer && !hasString) {
- return new globalThis.TextDecoder().decode($Bun.concatArrayBuffers(array));
+ return new globalThis.TextDecoder().decode(Bun.concatArrayBuffers(array));
}
// worst case: mixed content
- var arrayBufferSink = new $Bun.ArrayBufferSink();
+ var arrayBufferSink = new Bun.ArrayBufferSink();
arrayBufferSink.start({
highWaterMark: estimatedLength,
asUint8Array: true,
@@ -1205,7 +1206,7 @@ export function initializeArrayBufferStream(underlyingSource, highWaterMark) {
highWaterMark && typeof highWaterMark === "number"
? { highWaterMark, stream: true, asUint8Array: true }
: { stream: true, asUint8Array: true };
- var sink = new $Bun.ArrayBufferSink();
+ var sink = new Bun.ArrayBufferSink();
sink.start(opts);
var controller = {
@@ -1492,7 +1493,7 @@ export function lazyLoadStream(stream, autoAllocateChunkSize) {
var nativePtr = $getByIdDirectPrivate(stream, "bunNativePtr");
var Prototype = $lazyStreamPrototypeMap.$get(nativeType);
if (Prototype === undefined) {
- var [pull, start, cancel, setClose, deinit, setRefOrUnref, drain] = $lazyLoad(nativeType);
+ var [pull, start, cancel, setClose, deinit, setRefOrUnref, drain] = $lazy(nativeType);
var closer = [false];
var handleResult;
function handleNativeReadableStreamPromiseResult(val) {
@@ -1679,7 +1680,7 @@ export function readableStreamIntoText(stream) {
}
export function readableStreamToArrayBufferDirect(stream, underlyingSource) {
- var sink = new $Bun.ArrayBufferSink();
+ var sink = new Bun.ArrayBufferSink();
$putByIdDirectPrivate(stream, "underlyingSource", undefined);
var highWaterMark = $getByIdDirectPrivate(stream, "highWaterMark");
sink.start(highWaterMark ? { highWaterMark } : {});
diff --git a/src/js/builtins/tsconfig.json b/src/js/builtins/tsconfig.json
index edaedd2a9..71940a981 100644
--- a/src/js/builtins/tsconfig.json
+++ b/src/js/builtins/tsconfig.json
@@ -1,7 +1,9 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
- "noEmit": true
+ "noEmit": true,
+ "module": "esnext",
+ "moduleResolution": "bundler"
},
"include": [
".",
diff --git a/src/js/bun/ffi.ts b/src/js/bun/ffi.ts
index e7a9f469d..e737d8391 100644
--- a/src/js/bun/ffi.ts
+++ b/src/js/bun/ffi.ts
@@ -367,7 +367,6 @@ function FFIBuilder(params, returnType, functionToCall, name) {
break;
}
}
-
wrap.native = functionToCall;
wrap.ptr = functionToCall.ptr;
return wrap;
@@ -382,6 +381,7 @@ const native = {
function dlopen(path, options) {
const result = nativeDLOpen(path, options);
+ if (result instanceof Error) throw result;
for (let key in result.symbols) {
var symbol = result.symbols[key];
diff --git a/src/js/bun/sqlite.ts b/src/js/bun/sqlite.ts
index a3d862fd0..2e8a3c859 100644
--- a/src/js/bun/sqlite.ts
+++ b/src/js/bun/sqlite.ts
@@ -169,7 +169,7 @@ class Database {
if (typeof filenameGiven === "undefined") {
} else if (typeof filenameGiven !== "string") {
if (isTypedArray(filenameGiven)) {
- this.#handle = Database.deserialize(
+ this.#handle = Database.#deserialize(
filenameGiven,
typeof options === "object" && options
? !!options.readonly
@@ -243,7 +243,7 @@ class Database {
return SQL.serialize(this.#handle, optionalName || "main");
}
- static deserialize(serialized, isReadOnly = false) {
+ static #deserialize(serialized, isReadOnly = false) {
if (!SQL) {
SQL = $lazy("sqlite");
}
@@ -251,6 +251,10 @@ class Database {
return SQL.deserialize(serialized, isReadOnly);
}
+ static deserialize(serialized, isReadOnly = false) {
+ return new Database(serialized, isReadOnly ? constants.SQLITE_OPEN_READONLY : 0);
+ }
+
static setCustomSQLite(path) {
if (!SQL) {
SQL = $lazy("sqlite");
@@ -303,6 +307,8 @@ class Database {
throw new Error("SQL query cannot be empty.");
}
+ const willCache = this.#cachedQueriesKeys.length < Database.MAX_QUERY_CACHE_SIZE;
+
// this list should be pretty small
var index = this.#cachedQueriesLengths.indexOf(query.length);
while (index !== -1) {
@@ -322,8 +328,6 @@ class Database {
return stmt;
}
- const willCache = this.#cachedQueriesKeys.length < Database.MAX_QUERY_CACHE_SIZE;
-
var stmt = this.prepare(query, undefined, willCache ? constants.SQLITE_PREPARE_PERSISTENT : 0);
if (willCache) {
@@ -410,7 +414,7 @@ const wrapTransaction = (fn, db, { begin, commit, rollback, savepoint, release,
}
try {
before.run();
- const result = fn.apply(this, args);
+ const result = fn.$apply(this, args);
after.run();
return result;
} catch (ex) {
diff --git a/src/js/internal/debugger.ts b/src/js/internal/debugger.ts
index cd6f8f516..62020ac5b 100644
--- a/src/js/internal/debugger.ts
+++ b/src/js/internal/debugger.ts
@@ -57,10 +57,10 @@ class Debugger {
const backend = createBackend(executionContextId, refEventLoop, receive);
return {
write: message => {
- send.call(backend, message);
+ send.$call(backend, message);
return true;
},
- close: () => close.call(backend),
+ close: () => close.$call(backend),
};
};
this.#listen();
diff --git a/src/js/internal/primordials.js b/src/js/internal/primordials.js
new file mode 100644
index 000000000..727ccffd4
--- /dev/null
+++ b/src/js/internal/primordials.js
@@ -0,0 +1,219 @@
+// TODO: Use native code and JSC intrinsics for everything in this file.
+// Do not use this file for new code, many things here will be slow especailly when intrinsics for these operations is available.
+// It is primarily used for `internal/util`
+
+const createSafeIterator = (factory, next) => {
+ class SafeIterator {
+ constructor(iterable) {
+ this._iterator = factory(iterable);
+ }
+ next() {
+ return next(this._iterator);
+ }
+ [Symbol.iterator]() {
+ return this;
+ }
+ }
+ Object.setPrototypeOf(SafeIterator.prototype, null);
+ Object.freeze(SafeIterator.prototype);
+ Object.freeze(SafeIterator);
+ return SafeIterator;
+};
+
+// Intrinsics do not have `call` as a valid identifier, so this cannot be `Function.prototype.call.bind`.
+const FunctionPrototypeCall = $getByIdDirect(Function.prototype, "call");
+
+function getGetter(cls, getter) {
+ // TODO: __lookupGetter__ is deprecated, but Object.getOwnPropertyDescriptor doesn't work on built-ins like Typed Arrays.
+ return FunctionPrototypeCall.bind(cls.prototype.__lookupGetter__(getter));
+}
+
+function uncurryThis(func) {
+ // Intrinsics do not have `call` as a valid identifier, so this cannot be `Function.prototype.call.bind`.
+ return FunctionPrototypeCall.bind(func);
+}
+
+const copyProps = (src, dest) => {
+ ArrayPrototypeForEach(Reflect.ownKeys(src), key => {
+ if (!Reflect.getOwnPropertyDescriptor(dest, key)) {
+ Reflect.defineProperty(dest, key, Reflect.getOwnPropertyDescriptor(src, key));
+ }
+ });
+};
+
+const makeSafe = (unsafe, safe) => {
+ if (Symbol.iterator in unsafe.prototype) {
+ const dummy = new unsafe();
+ let next; // We can reuse the same `next` method.
+
+ ArrayPrototypeForEach(Reflect.ownKeys(unsafe.prototype), key => {
+ if (!Reflect.getOwnPropertyDescriptor(safe.prototype, key)) {
+ const desc = Reflect.getOwnPropertyDescriptor(unsafe.prototype, key);
+ if (
+ typeof desc.value === "function" &&
+ desc.value.length === 0 &&
+ Symbol.iterator in (desc.value.$call(dummy) || {})
+ ) {
+ const createIterator = uncurryThis(desc.value);
+ next ??= uncurryThis(createIterator(dummy).next);
+ const SafeIterator = createSafeIterator(createIterator, next);
+ desc.value = function () {
+ return new SafeIterator(this);
+ };
+ }
+ Reflect.defineProperty(safe.prototype, key, desc);
+ }
+ });
+ } else copyProps(unsafe.prototype, safe.prototype);
+ copyProps(unsafe, safe);
+
+ Object.setPrototypeOf(safe.prototype, null);
+ Object.freeze(safe.prototype);
+ Object.freeze(safe);
+ return safe;
+};
+
+const StringIterator = uncurryThis(String.prototype[Symbol.iterator]);
+const StringIteratorPrototype = Reflect.getPrototypeOf(StringIterator(""));
+const ArrayPrototypeForEach = uncurryThis(Array.prototype.forEach);
+
+function ErrorCaptureStackTrace(targetObject) {
+ const stack = new Error().stack;
+ // Remove the second line, which is this function
+ targetObject.stack = stack.replace(/.*\n.*/, "$1");
+}
+
+const arrayProtoPush = Array.prototype.push;
+
+export default {
+ makeSafe, // exported for testing
+ Array,
+ ArrayFrom: Array.from,
+ ArrayIsArray: Array.isArray,
+ ArrayPrototypeFlat: uncurryThis(Array.prototype.flat),
+ ArrayPrototypeFilter: uncurryThis(Array.prototype.filter),
+ ArrayPrototypeForEach,
+ ArrayPrototypeIncludes: uncurryThis(Array.prototype.includes),
+ ArrayPrototypeIndexOf: uncurryThis(Array.prototype.indexOf),
+ ArrayPrototypeJoin: uncurryThis(Array.prototype.join),
+ ArrayPrototypeMap: uncurryThis(Array.prototype.map),
+ ArrayPrototypePop: uncurryThis(Array.prototype.pop),
+ ArrayPrototypePush: uncurryThis(arrayProtoPush),
+ ArrayPrototypePushApply: (a, b) => arrayProtoPush.$apply(a, b),
+ ArrayPrototypeSlice: uncurryThis(Array.prototype.slice),
+ ArrayPrototypeSort: uncurryThis(Array.prototype.sort),
+ ArrayPrototypeSplice: uncurryThis(Array.prototype.splice),
+ ArrayPrototypeUnshift: uncurryThis(Array.prototype.unshift),
+ BigIntPrototypeValueOf: uncurryThis(BigInt.prototype.valueOf),
+ BooleanPrototypeValueOf: uncurryThis(Boolean.prototype.valueOf),
+ DatePrototypeGetTime: uncurryThis(Date.prototype.getTime),
+ DatePrototypeToISOString: uncurryThis(Date.prototype.toISOString),
+ DatePrototypeToString: uncurryThis(Date.prototype.toString),
+ ErrorCaptureStackTrace,
+ ErrorPrototypeToString: uncurryThis(Error.prototype.toString),
+ FunctionPrototypeToString: uncurryThis(Function.prototype.toString),
+ JSONStringify: JSON.stringify,
+ MapPrototypeGetSize: getGetter(Map, "size"),
+ MapPrototypeEntries: uncurryThis(Map.prototype.entries),
+ MapPrototypeValues: uncurryThis(Map.prototype.values),
+ MapPrototypeKeys: uncurryThis(Map.prototype.keys),
+ MathFloor: Math.floor,
+ MathMax: Math.max,
+ MathMin: Math.min,
+ MathRound: Math.round,
+ MathSqrt: Math.sqrt,
+ MathTrunc: Math.trunc,
+ Number,
+ NumberIsFinite: Number.isFinite,
+ NumberIsNaN: Number.isNaN,
+ NumberParseFloat: Number.parseFloat,
+ NumberParseInt: Number.parseInt,
+ NumberPrototypeToString: uncurryThis(Number.prototype.toString),
+ NumberPrototypeValueOf: uncurryThis(Number.prototype.valueOf),
+ Object,
+ ObjectAssign: Object.assign,
+ ObjectCreate: Object.create,
+ ObjectDefineProperty: Object.defineProperty,
+ ObjectEntries: Object.entries,
+ ObjectGetOwnPropertyDescriptor: Object.getOwnPropertyDescriptor,
+ ObjectGetOwnPropertyDescriptors: Object.getOwnPropertyDescriptors,
+ ObjectGetOwnPropertyNames: Object.getOwnPropertyNames,
+ ObjectGetOwnPropertySymbols: Object.getOwnPropertySymbols,
+ ObjectGetPrototypeOf: Object.getPrototypeOf,
+ ObjectIs: Object.is,
+ ObjectKeys: Object.keys,
+ ObjectPrototypeHasOwnProperty: uncurryThis(Object.prototype.hasOwnProperty),
+ ObjectPrototypePropertyIsEnumerable: uncurryThis(Object.prototype.propertyIsEnumerable),
+ ObjectPrototypeToString: uncurryThis(Object.prototype.toString),
+ ObjectSeal: Object.seal,
+ ObjectSetPrototypeOf: Object.setPrototypeOf,
+ ReflectApply: $getByIdDirect(Reflect, "apply"),
+ ReflectOwnKeys: Reflect.ownKeys,
+ RegExp,
+ RegExpPrototypeExec: uncurryThis(RegExp.prototype.exec),
+ RegExpPrototypeSymbolReplace: uncurryThis(RegExp.prototype[Symbol.replace]),
+ RegExpPrototypeSymbolSplit: uncurryThis(RegExp.prototype[Symbol.split]),
+ RegExpPrototypeTest: uncurryThis(RegExp.prototype.test),
+ RegExpPrototypeToString: uncurryThis(RegExp.prototype.toString),
+ SafeStringIterator: createSafeIterator(StringIterator, uncurryThis(StringIteratorPrototype.next)),
+ SafeMap: makeSafe(
+ Map,
+ class SafeMap extends Map {
+ constructor(i) {
+ super(i);
+ }
+ },
+ ),
+ SafeSet: makeSafe(
+ Set,
+ class SafeSet extends Set {
+ constructor(i) {
+ super(i);
+ }
+ },
+ ),
+ SetPrototypeGetSize: getGetter(Set, "size"),
+ SetPrototypeEntries: uncurryThis(Set.prototype.entries),
+ SetPrototypeValues: uncurryThis(Set.prototype.values),
+ String,
+ StringPrototypeCharCodeAt: uncurryThis(String.prototype.charCodeAt),
+ StringPrototypeCodePointAt: uncurryThis(String.prototype.codePointAt),
+ StringPrototypeEndsWith: uncurryThis(String.prototype.endsWith),
+ StringPrototypeIncludes: uncurryThis(String.prototype.includes),
+ StringPrototypeIndexOf: uncurryThis(String.prototype.indexOf),
+ StringPrototypeLastIndexOf: uncurryThis(String.prototype.lastIndexOf),
+ StringPrototypeMatch: uncurryThis(String.prototype.match),
+ StringPrototypeNormalize: uncurryThis(String.prototype.normalize),
+ StringPrototypePadEnd: uncurryThis(String.prototype.padEnd),
+ StringPrototypePadStart: uncurryThis(String.prototype.padStart),
+ StringPrototypeRepeat: uncurryThis(String.prototype.repeat),
+ StringPrototypeReplace: uncurryThis(String.prototype.replace),
+ StringPrototypeReplaceAll: uncurryThis(String.prototype.replaceAll),
+ StringPrototypeSlice: uncurryThis(String.prototype.slice),
+ StringPrototypeSplit: uncurryThis(String.prototype.split),
+ StringPrototypeStartsWith: uncurryThis(String.prototype.startsWith),
+ StringPrototypeToLowerCase: uncurryThis(String.prototype.toLowerCase),
+ StringPrototypeTrim: uncurryThis(String.prototype.trim),
+ StringPrototypeValueOf: uncurryThis(String.prototype.valueOf),
+ SymbolPrototypeToString: uncurryThis(Symbol.prototype.toString),
+ SymbolPrototypeValueOf: uncurryThis(Symbol.prototype.valueOf),
+ FunctionPrototypeToString: uncurryThis(Function.prototype.toString),
+ FunctionPrototypeBind: uncurryThis(Function.prototype.bind),
+ SymbolIterator: Symbol.iterator,
+ SymbolFor: Symbol.for,
+ SymbolToStringTag: Symbol.toStringTag,
+ TypedArrayPrototypeGetLength: getGetter(Uint8Array, "length"),
+ TypedArrayPrototypeGetSymbolToStringTag: getGetter(Uint8Array, Symbol.toStringTag),
+ Uint8ClampedArray,
+ Uint8Array,
+ Uint16Array,
+ Uint32Array,
+ Int8Array,
+ Int16Array,
+ Int32Array,
+ Float32Array,
+ Float64Array,
+ BigUint64Array,
+ BigInt64Array,
+ uncurryThis,
+};
diff --git a/src/js/internal/util/README.md b/src/js/internal/util/README.md
new file mode 100644
index 000000000..7cbef75c7
--- /dev/null
+++ b/src/js/internal/util/README.md
@@ -0,0 +1,77 @@
+# node-inspect-extracted
+
+Vendored copy of [node-inspect-extracted](https://github.com/hildjj/node-inspect-extracted) with adaptations for Bun.
+Some features not relevant to Bun have been removed. Others might be added or modified.
+
+This library provides an as-faithful-as-possible implementation of Node.js's
+[`util.inspect`](https://nodejs.org/api/util.html#util_util_inspect_object_options) function.
+
+This is currently done for compatibility reasons. In the future, this should be replaced with a 100% native implementation.
+
+## API
+
+The following [`util`](https://nodejs.org/api/util.html) functions:
+
+- [`inspect(object[,showHidden|options[,depth [, colors]]])`](https://nodejs.org/api/util.html#util_util_inspect_object_showhidden_depth_colors)
+- [`format(format[, ...args])`](https://nodejs.org/api/util.html#util_util_format_format_args)
+- [`formatWithOptions(inspectOptions, format[, ...args])`](https://nodejs.org/api/util.html#util_util_formatwithoptions_inspectoptions_format_args)
+
+<!--And these extras:
+
+- `stylizeWithColor(str, styleType)`: colorize `str` with ANSI escapes according to the styleType
+- `stylizeWithHTML(str, styleType)`: colorize `str` with HTML span tags
+
+## Colors
+
+If you specify `{colors: true}` in the inspect options, you will get ANSI
+escape codes, just as you would in Node. That's unlikely to be helpful to you
+on the Web, so you might want `stylizeWithHTML`, which is also exported from the package:
+
+```js
+inspect(
+ { a: 1 },
+ {
+ compact: false,
+ stylize: stylizeWithHTML,
+ },
+);
+```
+
+which yields this ugly HTML:
+
+```html
+{ a: <span style="color:yellow;">1</span> }
+```
+
+If you want better HTML, the [lightly-documented](https://nodejs.org/api/util.html#util_custom_inspection_functions_on_objects) `stylize` option requires
+a function that takes two parameters, a string, and a class name. The mappings
+from class names to colors is in `inspect.styles`, so start with this:
+
+```js
+function stylizeWithHTML(str, styleType) {
+ const style = inspect.styles[styleType];
+ if (style !== undefined) {
+ return `<span style="color:${style};">${str}</span>`;
+ }
+ return str;
+}
+```-->
+
+## Known Limitations
+
+- Objects that have been mangled with `Object.setPrototypeOf`
+ do not retain their original type information.
+ [[bug](https://github.com/hildjj/node-inspect-extracted/issues/3)]
+- `WeakMap` and `WeakSet` will not show their contents, because those contents
+ cannot be iterated over in unprivileged code.
+- Colorful stack traces are not completely accurate with respect to what
+ modules are Node-internal. This doesn't matter on the Web.
+
+## LICENSE
+
+This code is an adaptation of the Node.js internal implementation, mostly from
+the file lib/internal/util/inspect.js, which does not have the Joyent
+copyright header. The maintainers of this package will not assert copyright
+over this code, but will assign ownership to the Node.js contributors, with
+the same license as specified in the Node.js codebase; the portion adapted
+here should all be plain MIT license.
diff --git a/src/js/internal/util/inspect.d.ts b/src/js/internal/util/inspect.d.ts
new file mode 100644
index 000000000..49f7c3a65
--- /dev/null
+++ b/src/js/internal/util/inspect.d.ts
@@ -0,0 +1,347 @@
+/**
+ * Extracted from https://github.com/DefinitelyTyped/DefinitelyTyped
+ *
+ * This project is licensed under the MIT license.
+ * Copyrights are respective of each contributor listed at the beginning of each definition file.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+/**
+ * The `util` module supports the needs of Node.js internal APIs. Many of the
+ * utilities are useful for application and module developers as well. To access
+ * it:
+ *
+ * ```js
+ * const util = require('node-inspect-extracted');
+ * // or
+ * import * as util from 'node-inspect-extracted';
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v17.6.0/lib/util.js)
+ */
+declare module "node-inspect-extracted" {
+ export interface InspectOptions {
+ /**
+ * If set to `true`, getters are going to be
+ * inspected as well. If set to `'get'` only getters without setter are going
+ * to be inspected. If set to `'set'` only getters having a corresponding
+ * setter are going to be inspected. This might cause side effects depending on
+ * the getter function.
+ * @default `false`
+ */
+ getters?: "get" | "set" | boolean | undefined;
+ showHidden?: boolean | undefined;
+ /**
+ * @default 2
+ */
+ depth?: number | null | undefined;
+ colors?: boolean | undefined;
+ customInspect?: boolean | undefined;
+ showProxy?: boolean | undefined;
+ maxArrayLength?: number | null | undefined;
+ /**
+ * Specifies the maximum number of characters to
+ * include when formatting. Set to `null` or `Infinity` to show all elements.
+ * Set to `0` or negative to show no characters.
+ * @default 10000
+ */
+ maxStringLength?: number | null | undefined;
+ breakLength?: number | undefined;
+ /**
+ * Setting this to `false` causes each object key
+ * to be displayed on a new line. It will also add new lines to text that is
+ * longer than `breakLength`. If set to a number, the most `n` inner elements
+ * are united on a single line as long as all properties fit into
+ * `breakLength`. Short array elements are also grouped together. Note that no
+ * text will be reduced below 16 characters, no matter the `breakLength` size.
+ * For more information, see the example below.
+ * @default `true`
+ */
+ compact?: boolean | number | undefined;
+ sorted?: boolean | ((a: string, b: string) => number) | undefined;
+ numericSeparator?: boolean | undefined;
+ }
+
+ // Not exposed from node's `util` package.
+ // export const inspectDefaultOptions: Required<InspectOptions>;
+
+ export type Style =
+ | "special"
+ | "number"
+ | "bigint"
+ | "boolean"
+ | "undefined"
+ | "null"
+ | "string"
+ | "symbol"
+ | "date"
+ | "regexp"
+ | "module";
+ export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string;
+ export interface InspectOptionsStylized extends InspectOptions {
+ /**
+ * Write your own function for adding color to the output, or use one of the built-in stylize* functions.
+ */
+ stylize(text: string, styleType: Style): string;
+ }
+ /**
+ * The `util.format()` method returns a formatted string using the first argument
+ * as a `printf`\-like format string which can contain zero or more format
+ * specifiers. Each specifier is replaced with the converted value from the
+ * corresponding argument. Supported specifiers are:
+ *
+ * If a specifier does not have a corresponding argument, it is not replaced:
+ *
+ * ```js
+ * util.format('%s:%s', 'foo');
+ * // Returns: 'foo:%s'
+ * ```
+ *
+ * Values that are not part of the format string are formatted using`util.inspect()` if their type is not `string`.
+ *
+ * If there are more arguments passed to the `util.format()` method than the
+ * number of specifiers, the extra arguments are concatenated to the returned
+ * string, separated by spaces:
+ *
+ * ```js
+ * util.format('%s:%s', 'foo', 'bar', 'baz');
+ * // Returns: 'foo:bar baz'
+ * ```
+ *
+ * If the first argument does not contain a valid format specifier, `util.format()`returns a string that is the concatenation of all arguments separated by spaces:
+ *
+ * ```js
+ * util.format(1, 2, 3);
+ * // Returns: '1 2 3'
+ * ```
+ *
+ * If only one argument is passed to `util.format()`, it is returned as it is
+ * without any formatting:
+ *
+ * ```js
+ * util.format('%% %s');
+ * // Returns: '%% %s'
+ * ```
+ *
+ * `util.format()` is a synchronous method that is intended as a debugging tool.
+ * Some input values can have a significant performance overhead that can block the
+ * event loop. Use this function with care and never in a hot code path.
+ * @since v0.5.3
+ * @param format A `printf`-like format string.
+ */
+ export function format(format?: any, ...param: any[]): string;
+ /**
+ * This function is identical to {@link format}, except in that it takes
+ * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}.
+ *
+ * ```js
+ * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 });
+ * // Returns 'See object { foo: 42 }', where `42` is colored as a number
+ * // when printed to a terminal.
+ * ```
+ * @since v10.0.0
+ */
+ export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
+ /**
+ * The `util.inspect()` method returns a string representation of `object` that is
+ * intended for debugging. The output of `util.inspect` may change at any time
+ * and should not be depended upon programmatically. Additional `options` may be
+ * passed that alter the result.`util.inspect()` will use the constructor's name and/or `@@toStringTag` to make
+ * an identifiable tag for an inspected value.
+ *
+ * ```js
+ * class Foo {
+ * get [Symbol.toStringTag]() {
+ * return 'bar';
+ * }
+ * }
+ *
+ * class Bar {}
+ *
+ * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } });
+ *
+ * util.inspect(new Foo()); // 'Foo [bar] {}'
+ * util.inspect(new Bar()); // 'Bar {}'
+ * util.inspect(baz); // '[foo] {}'
+ * ```
+ *
+ * Circular references point to their anchor by using a reference index:
+ *
+ * ```js
+ * const { inspect } = require('util');
+ *
+ * const obj = {};
+ * obj.a = [obj];
+ * obj.b = {};
+ * obj.b.inner = obj.b;
+ * obj.b.obj = obj;
+ *
+ * console.log(inspect(obj));
+ * // <ref *1> {
+ * // a: [ [Circular *1] ],
+ * // b: <ref *2> { inner: [Circular *2], obj: [Circular *1] }
+ * // }
+ * ```
+ *
+ * The following example inspects all properties of the `util` object:
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * console.log(util.inspect(util, { showHidden: true, depth: null }));
+ * ```
+ *
+ * The following example highlights the effect of the `compact` option:
+ *
+ * ```js
+ * const util = require('util');
+ *
+ * const o = {
+ * a: [1, 2, [[
+ * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' +
+ * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.',
+ * 'test',
+ * 'foo']], 4],
+ * b: new Map([['za', 1], ['zb', 'test']])
+ * };
+ * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 }));
+ *
+ * // { a:
+ * // [ 1,
+ * // 2,
+ * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line
+ * // 'test',
+ * // 'foo' ] ],
+ * // 4 ],
+ * // b: Map(2) { 'za' => 1, 'zb' => 'test' } }
+ *
+ * // Setting `compact` to false or an integer creates more reader friendly output.
+ * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 }));
+ *
+ * // {
+ * // a: [
+ * // 1,
+ * // 2,
+ * // [
+ * // [
+ * // 'Lorem ipsum dolor sit amet,\n' +
+ * // 'consectetur adipiscing elit, sed do eiusmod \n' +
+ * // 'tempor incididunt ut labore et dolore magna aliqua.',
+ * // 'test',
+ * // 'foo'
+ * // ]
+ * // ],
+ * // 4
+ * // ],
+ * // b: Map(2) {
+ * // 'za' => 1,
+ * // 'zb' => 'test'
+ * // }
+ * // }
+ *
+ * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a
+ * // single line.
+ * ```
+ *
+ * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and
+ * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be
+ * inspected. If there are more entries than `maxArrayLength`, there is no
+ * guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may
+ * result in different output. Furthermore, entries
+ * with no remaining strong references may be garbage collected at any time.
+ *
+ * ```js
+ * const { inspect } = require('util');
+ *
+ * const obj = { a: 1 };
+ * const obj2 = { b: 2 };
+ * const weakSet = new WeakSet([obj, obj2]);
+ *
+ * console.log(inspect(weakSet, { showHidden: true }));
+ * // WeakSet { { a: 1 }, { b: 2 } }
+ * ```
+ *
+ * The `sorted` option ensures that an object's property insertion order does not
+ * impact the result of `util.inspect()`.
+ *
+ * ```js
+ * const { inspect } = require('util');
+ * const assert = require('assert');
+ *
+ * const o1 = {
+ * b: [2, 3, 1],
+ * a: '`a` comes before `b`',
+ * c: new Set([2, 3, 1])
+ * };
+ * console.log(inspect(o1, { sorted: true }));
+ * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } }
+ * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) }));
+ * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' }
+ *
+ * const o2 = {
+ * c: new Set([2, 1, 3]),
+ * a: '`a` comes before `b`',
+ * b: [2, 3, 1]
+ * };
+ * assert.strict.equal(
+ * inspect(o1, { sorted: true }),
+ * inspect(o2, { sorted: true })
+ * );
+ * ```
+ *
+ * `util.inspect()` is a synchronous method intended for debugging. Its maximum
+ * output length is approximately 128 MB. Inputs that result in longer output will
+ * be truncated.
+ * @since v0.3.0
+ * @param object Any JavaScript primitive or `Object`.
+ * @return The representation of `object`.
+ */
+ export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
+ export function inspect(object: any, options?: InspectOptions): string;
+ export namespace inspect {
+ let colors: { [key: number]: number };
+ let styles: {
+ [K in Style]: string;
+ };
+ let defaultOptions: InspectOptions;
+ /**
+ * Allows changing inspect settings from the repl.
+ */
+ let replDefaults: InspectOptions;
+ /**
+ * That can be used to declare custom inspect functions.
+ */
+ const custom: unique symbol;
+ }
+ /**
+ * Returns `str` with any ANSI escape codes removed.
+ *
+ * ```js
+ * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m'));
+ * // Prints "value"
+ * ```
+ * @since v16.11.0
+ */
+ export function stripVTControlCharacters(str: string): string;
+
+ /**
+ * Colorize `text` with ANSI escapes according to the styleType. Mostly used in inspect() options.
+ *
+ * ```typescript
+ * inspect({ a: 'b' }, { stylize: stylizeWithColor });
+ * ```
+ */
+ export function stylizeWithColor(text: string, styleType: Style): string;
+
+ /**
+ * Colorize `text` using HTML span tags and style. Mostly used in inspect() options.
+ *
+ * ```typescript
+ * inspect({ a: 'b' }, { stylize: stylizeWithHTML });
+ * ```
+ */
+ export function stylizeWithHTML(text: string, styleType: Style): string;
+}
diff --git a/src/js/internal/util/inspect.js b/src/js/internal/util/inspect.js
new file mode 100644
index 000000000..5342ef3e7
--- /dev/null
+++ b/src/js/internal/util/inspect.js
@@ -0,0 +1,2770 @@
+// This code is an adaptation of the Node.js internal implementation, mostly
+// from the file lib/internal/util/inspect.js, which does not have the Joyent
+// copyright header. The maintainers of this package will not assert copyright
+// over this code, but will assign ownership to the Node.js contributors, with
+// the same license as specified in the Node.js codebase; the portion adapted
+// here should all be plain MIT license.
+//
+// Node.js is licensed for use as follows:
+//
+// Copyright Node.js contributors. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+
+const { pathToFileURL } = require("node:url");
+
+const primordials = require("internal/primordials");
+const {
+ Array,
+ ArrayFrom,
+ ArrayIsArray,
+ ArrayPrototypeFilter,
+ ArrayPrototypeFlat,
+ ArrayPrototypeForEach,
+ ArrayPrototypeIncludes,
+ ArrayPrototypeIndexOf,
+ ArrayPrototypeJoin,
+ ArrayPrototypeMap,
+ ArrayPrototypePop,
+ ArrayPrototypePush,
+ ArrayPrototypePushApply,
+ ArrayPrototypeSlice,
+ ArrayPrototypeSplice,
+ ArrayPrototypeSort,
+ ArrayPrototypeUnshift,
+ BigIntPrototypeValueOf,
+ BooleanPrototypeValueOf,
+ DatePrototypeGetTime,
+ DatePrototypeToISOString,
+ DatePrototypeToString,
+ ErrorCaptureStackTrace,
+ ErrorPrototypeToString,
+ FunctionPrototypeBind,
+ FunctionPrototypeToString,
+ JSONStringify,
+ MapPrototypeGetSize,
+ MapPrototypeEntries,
+ MapPrototypeValues,
+ MapPrototypeKeys,
+ MathFloor,
+ MathMax,
+ MathMin,
+ MathRound,
+ MathSqrt,
+ MathTrunc,
+ Number,
+ NumberIsFinite,
+ NumberIsNaN,
+ NumberParseFloat,
+ NumberParseInt,
+ NumberPrototypeToString,
+ NumberPrototypeValueOf,
+ Object,
+ ObjectAssign,
+ ObjectDefineProperty,
+ ObjectEntries,
+ ObjectGetOwnPropertyDescriptor,
+ ObjectGetOwnPropertyDescriptors,
+ ObjectGetOwnPropertyNames,
+ ObjectGetOwnPropertySymbols,
+ ObjectGetPrototypeOf,
+ ObjectIs,
+ ObjectKeys,
+ ObjectPrototypeHasOwnProperty,
+ ObjectPrototypePropertyIsEnumerable,
+ ObjectPrototypeToString,
+ ObjectSeal,
+ ObjectSetPrototypeOf,
+ ReflectApply,
+ ReflectOwnKeys,
+ RegExp,
+ RegExpPrototypeExec,
+ RegExpPrototypeSymbolReplace,
+ RegExpPrototypeSymbolSplit,
+ RegExpPrototypeTest,
+ RegExpPrototypeToString,
+ SafeStringIterator,
+ SafeMap,
+ SafeSet,
+ SetPrototypeEntries,
+ SetPrototypeGetSize,
+ SetPrototypeValues,
+ String,
+ StringPrototypeCharCodeAt,
+ StringPrototypeCodePointAt,
+ StringPrototypeIncludes,
+ StringPrototypeIndexOf,
+ StringPrototypeLastIndexOf,
+ StringPrototypeMatch,
+ StringPrototypeNormalize,
+ StringPrototypePadEnd,
+ StringPrototypePadStart,
+ StringPrototypeRepeat,
+ StringPrototypeReplaceAll,
+ StringPrototypeSlice,
+ StringPrototypeSplit,
+ StringPrototypeEndsWith,
+ StringPrototypeStartsWith,
+ StringPrototypeToLowerCase,
+ StringPrototypeTrim,
+ StringPrototypeValueOf,
+ SymbolPrototypeToString,
+ SymbolPrototypeValueOf,
+ SymbolIterator,
+ SymbolToStringTag,
+ TypedArrayPrototypeGetLength,
+ TypedArrayPrototypeGetSymbolToStringTag,
+ Uint8Array,
+} = primordials;
+
+const customInspectSymbol = Symbol.for("nodejs.util.inspect.custom");
+const kPending = Symbol("kPending"); // state ID 0
+const kFulfilled = Symbol("kFulfilled"); // state ID 1
+const kRejected = Symbol("kRejected"); // state ID 2
+const ALL_PROPERTIES = 0;
+const ONLY_ENUMERABLE = 2;
+
+const isAsyncFunction = v =>
+ typeof v === "function" && StringPrototypeStartsWith(FunctionPrototypeToString(v), "async");
+const isGeneratorFunction = v =>
+ typeof v === "function" && StringPrototypeMatch(FunctionPrototypeToString(v), /^(async\s+)?function *\*/);
+
+function vmSafeInstanceof(val, ctor) {
+ if (val instanceof ctor) return true;
+ // instanceof doesn't work across vm boundaries, so check the whole inheritance chain
+ while (val) {
+ if (typeof val !== "object") return false;
+ if (ctor.name === internalGetConstructorName(val)) return true;
+ val = ObjectGetPrototypeOf(val);
+ }
+ return false;
+}
+function checkBox(ctor) {
+ return val => {
+ if (!vmSafeInstanceof(val, ctor)) return false;
+ try {
+ ctor.prototype.valueOf.$call(val);
+ } catch {
+ return false;
+ }
+ return true;
+ };
+}
+const isBigIntObject = checkBox(BigInt);
+const isSymbolObject = checkBox(Symbol);
+
+const {
+ //! The native versions of the commented out functions are currently buggy, so we use the polyfills above for now.
+ //isAsyncFunction,
+ //isGeneratorFunction,
+ isAnyArrayBuffer,
+ isArrayBuffer,
+ isArgumentsObject,
+ isBoxedPrimitive: _native_isBoxedPrimitive,
+ isDataView,
+ isExternal,
+ isMap,
+ isMapIterator,
+ isModuleNamespaceObject,
+ isNativeError,
+ isPromise,
+ isSet,
+ isSetIterator,
+ isWeakMap,
+ isWeakSet,
+ isRegExp,
+ isDate,
+ isTypedArray,
+ isStringObject,
+ isNumberObject,
+ isBooleanObject,
+ //isBigIntObject,
+} = require("node:util/types");
+
+//! temp workaround to apply is{BigInt,Symbol}Object fix
+const isBoxedPrimitive = val => isBigIntObject(val) || isSymbolObject(val) || _native_isBoxedPrimitive(val);
+
+// We need this duplicate here to avoid a circular dependency between node:assert and node:util.
+class AssertionError extends Error {
+ constructor(message, isForced = false) {
+ super(message);
+ this.name = "AssertionError";
+ this.code = "ERR_ASSERTION";
+ this.operator = "==";
+ this.generatedMessage = !isForced;
+ this.actual = isForced && undefined;
+ this.expected = !isForced || undefined;
+ }
+}
+function assert(p, message) {
+ if (!p) throw new AssertionError(message);
+}
+
+const codes = {}; // exported from errors.js
+{
+ // errors.js
+ // Sorted by a rough estimate on most frequently used entries.
+ const kTypes = [
+ "string",
+ "function",
+ "number",
+ "object",
+ // Accept 'Function' and 'Object' as alternative to the lower cased version.
+ "Function",
+ "Object",
+ "boolean",
+ "bigint",
+ "symbol",
+ ];
+ const classRegExp = /^([A-Z][a-z0-9]*)+$/;
+ const messages = new SafeMap();
+ const sym = "ERR_INVALID_ARG_TYPE";
+ messages.set(sym, (name, expected, actual) => {
+ assert(typeof name === "string", "'name' must be a string");
+ if (!ArrayIsArray(expected)) expected = [expected];
+
+ let msg = "The ";
+ if (StringPrototypeEndsWith(name, " argument")) msg += `${name} `; // For cases like 'first argument'
+ else msg += `"${name}" ${StringPrototypeIncludes(name, ".") ? "property" : "argument"} `;
+ msg += "must be ";
+
+ const types = [];
+ const instances = [];
+ const other = [];
+ for (const value of expected) {
+ assert(typeof value === "string", "All expected entries have to be of type string");
+ if (ArrayPrototypeIncludes(kTypes, value)) ArrayPrototypePush(types, StringPrototypeToLowerCase(value));
+ else if (RegExpPrototypeTest(classRegExp, value)) ArrayPrototypePush(instances, value);
+ else {
+ assert(value !== "object", 'The value "object" should be written as "Object"');
+ ArrayPrototypePush(other, value);
+ }
+ }
+ // Special handle `object` in case other instances are allowed to outline the differences between each other.
+ if (instances.length > 0) {
+ const pos = ArrayPrototypeIndexOf(types, "object");
+ if (pos !== -1) {
+ ArrayPrototypeSplice(types, pos, 1);
+ ArrayPrototypePush(instances, "Object");
+ }
+ }
+ if (types.length > 0) {
+ if (types.length > 2) msg += `one of type ${ArrayPrototypeJoin(types, ", ")}, or ${ArrayPrototypePop(types)}`;
+ else if (types.length === 2) msg += `one of type ${types[0]} or ${types[1]}`;
+ else msg += `of type ${types[0]}`;
+ if (instances.length > 0 || other.length > 0) msg += " or ";
+ }
+ if (instances.length > 0) {
+ if (instances.length > 2)
+ msg += `an instance of ${ArrayPrototypeJoin(instances, ", ")}, or ${ArrayPrototypePop(instances)}`;
+ else msg += `an instance of ${instances[0]}` + (instances.length === 2 ? ` or ${instances[1]}` : "");
+ if (other.length > 0) msg += " or ";
+ }
+ if (other.length > 0) {
+ if (other.length > 2) {
+ const last = ArrayPrototypePop(other);
+ msg += `one of ${ArrayPrototypeJoin(other, ", ")}, or ${last}`;
+ } else if (other.length === 2) {
+ msg += `one of ${other[0]} or ${other[1]}`;
+ } else {
+ if (StringPrototypeToLowerCase(other[0]) !== other[0]) msg += "an ";
+ msg += `${other[0]}`;
+ }
+ }
+
+ if (actual == null) msg += `. Received ${actual}`;
+ else if (typeof actual === "function" && actual.name) msg += `. Received function ${actual.name}`;
+ else if (typeof actual === "object") {
+ if (actual.constructor && actual.constructor.name) msg += `. Received an instance of ${actual.constructor.name}`;
+ else msg += `. Received ${inspect(actual, { depth: -1 })}`;
+ } else {
+ let inspected = inspect(actual, { colors: false });
+ if (inspected.length > 25) inspected = `${StringPrototypeSlice(inspected, 0, 25)}...`;
+ msg += `. Received type ${typeof actual} (${inspected})`;
+ }
+ return msg;
+ });
+ codes[sym] = function NodeError(...args) {
+ const limit = Error.stackTraceLimit;
+ Error.stackTraceLimit = 0;
+ const error = new TypeError();
+ Error.stackTraceLimit = limit; // Reset the limit and setting the name property.
+
+ const msg = messages.get(sym);
+ assert(typeof msg === "function");
+ assert(
+ msg.length <= args.length, // Default options do not count.
+ `Code: ${sym}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`,
+ );
+ const message = ReflectApply(msg, error, args);
+
+ ObjectDefineProperty(error, "message", { value: message, enumerable: false, writable: true, configurable: true });
+ ObjectDefineProperty(error, "toString", {
+ value() {
+ return `${this.name} [${sym}]: ${this.message}`;
+ },
+ enumerable: false,
+ writable: true,
+ configurable: true,
+ });
+ // addCodeToName + captureLargerStackTrace
+ let err = error;
+ const userStackTraceLimit = Error.stackTraceLimit;
+ Error.stackTraceLimit = Infinity;
+ ErrorCaptureStackTrace(err);
+ Error.stackTraceLimit = userStackTraceLimit; // Reset the limit
+ err.name = `${TypeError.name} [${sym}]`; // Add the error code to the name to include it in the stack trace.
+ err.stack; // Access the stack to generate the error message including the error code from the name.
+ delete err.name; // Reset the name to the actual name.
+ error.code = sym;
+ return error;
+ };
+}
+/**
+ * @param {unknown} value
+ * @param {string} name
+ * @param {{ allowArray?: boolean, allowFunction?: boolean, nullable?: boolean }} [options] */
+const validateObject = (value, name, allowArray = false) => {
+ if (
+ value === null ||
+ (!allowArray && ArrayIsArray(value)) ||
+ (typeof value !== "object" && typeof value !== "function")
+ )
+ throw new codes.ERR_INVALID_ARG_TYPE(name, "Object", value);
+};
+
+const builtInObjects = new SafeSet(
+ ArrayPrototypeFilter(
+ ObjectGetOwnPropertyNames(globalThis),
+ e => RegExpPrototypeExec(/^[A-Z][a-zA-Z0-9]+$/, e) !== null,
+ ),
+);
+
+// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
+const isUndetectableObject = v => typeof v === "undefined" && v !== undefined;
+
+// This is used for detecting stack overflows during inspection.
+// It will probably never need to be changed, but it's here just in case JSC does change the message.
+const ERROR_STACK_OVERFLOW_MSG = "Maximum call stack size exceeded.";
+
+// These options must stay in sync with `getUserOptions`. So if any option will
+// be added or removed, `getUserOptions` must also be updated accordingly.
+const inspectDefaultOptions = ObjectSeal({
+ showHidden: false,
+ depth: 2,
+ colors: false,
+ customInspect: true,
+ showProxy: false,
+ maxArrayLength: 100,
+ maxStringLength: 10000,
+ breakLength: 80,
+ compact: 3,
+ sorted: false,
+ getters: false,
+ numericSeparator: false,
+});
+const inspectReplDefaults = ObjectSeal({
+ ...inspectDefaultOptions,
+ colors: Bun.enableANSIColors,
+ showProxy: true,
+});
+
+const kObjectType = 0;
+const kArrayType = 1;
+const kArrayExtrasType = 2;
+
+// Work-arounds for Safari not implementing negative look-behinds.
+// Remove all of this once Safari 16.4 is rolled out "enough".
+let strEscapeSequencesRegExp,
+ strEscapeSequencesReplacer,
+ strEscapeSequencesRegExpSingle,
+ strEscapeSequencesReplacerSingle,
+ extractedSplitNewLines;
+try {
+ // Change from regex literals to RegExp constructors to avoid unrecoverable
+ // syntax error at load time.
+ strEscapeSequencesRegExp = new RegExp(
+ "[\\x00-\\x1f\\x27\\x5c\\x7f-\\x9f]|[\\ud800-\\udbff](?![\\udc00-\\udfff])|(?<![\\ud800-\\udbff])[\\udc00-\\udfff]",
+ );
+ strEscapeSequencesReplacer = new RegExp(
+ "[\x00-\\x1f\\x27\\x5c\\x7f-\\x9f]|[\\ud800-\\udbff](?![\\udc00-\\udfff])|(?<![\\ud800-\\udbff])[\\udc00-\\udfff]",
+ "g",
+ );
+ strEscapeSequencesRegExpSingle = new RegExp(
+ "[\\x00-\\x1f\\x5c\\x7f-\\x9f]|[\\ud800-\\udbff](?![\\udc00-\\udfff])|(?<![\\ud800-\\udbff])[\\udc00-\\udfff]",
+ );
+ strEscapeSequencesReplacerSingle = new RegExp(
+ "[\\x00-\\x1f\\x5c\\x7f-\\x9f]|[\\ud800-\\udbff](?![\\udc00-\\udfff])|(?<![\\ud800-\\udbff])[\\udc00-\\udfff]",
+ "g",
+ );
+ const extractedNewLineRe = new RegExp("(?<=\\n)");
+ extractedSplitNewLines = value => RegExpPrototypeSymbolSplit(extractedNewLineRe, value);
+ // CI doesn't run in an elderly runtime
+} catch {
+ // These are from a previous version of node,
+ // see commit 76372607a6743cc75eae50ca58657c9e8a654428
+ // dated 2021-12-06
+ strEscapeSequencesRegExp = /[\x00-\x1f\x27\x5c\x7f-\x9f]/;
+ strEscapeSequencesReplacer = /[\x00-\x1f\x27\x5c\x7f-\x9f]/g;
+ strEscapeSequencesRegExpSingle = /[\x00-\x1f\x5c\x7f-\x9f]/;
+ strEscapeSequencesReplacerSingle = /[\x00-\x1f\x5c\x7f-\x9f]/g;
+ extractedSplitNewLines = value => {
+ const lines = RegExpPrototypeSymbolSplit(/\n/, value);
+ const last = ArrayPrototypePop(lines);
+ const nlLines = ArrayPrototypeMap(lines, line => line + "\n");
+ if (last !== "") {
+ nlLines.push(last);
+ }
+ return nlLines;
+ };
+}
+
+const keyStrRegExp = /^[a-zA-Z_][a-zA-Z_0-9]*$/;
+const numberRegExp = /^(0|[1-9][0-9]*)$/;
+
+const coreModuleRegExp = /^ {4}at (?:[^/\\(]+ \(|)node:(.+):\d+:\d+\)?$/;
+const nodeModulesRegExp = /[/\\]node_modules[/\\](.+?)(?=[/\\])/g;
+
+const classRegExp = /^(\s+[^(]*?)\s*{/;
+const stripCommentsRegExp = /(\/\/.*?\n)|(\/\*(.|\n)*?\*\/)/g;
+
+const kMinLineLength = 16;
+
+// Constants to map the iterator state.
+const kWeak = 0;
+const kIterator = 1;
+const kMapEntries = 2;
+
+// Escaped control characters (plus the single quote and the backslash). Use
+// empty strings to fill up unused entries.
+const meta = [
+ "\\x00",
+ "\\x01",
+ "\\x02",
+ "\\x03",
+ "\\x04",
+ "\\x05",
+ "\\x06",
+ "\\x07", // x07
+ "\\b",
+ "\\t",
+ "\\n",
+ "\\x0B",
+ "\\f",
+ "\\r",
+ "\\x0E",
+ "\\x0F", // x0F
+ "\\x10",
+ "\\x11",
+ "\\x12",
+ "\\x13",
+ "\\x14",
+ "\\x15",
+ "\\x16",
+ "\\x17", // x17
+ "\\x18",
+ "\\x19",
+ "\\x1A",
+ "\\x1B",
+ "\\x1C",
+ "\\x1D",
+ "\\x1E",
+ "\\x1F", // x1F
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\\'",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "", // x2F
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "", // x3F
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "", // x4F
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\\\\",
+ "",
+ "",
+ "", // x5F
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "", // x6F
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\\x7F", // x7F
+ "\\x80",
+ "\\x81",
+ "\\x82",
+ "\\x83",
+ "\\x84",
+ "\\x85",
+ "\\x86",
+ "\\x87", // x87
+ "\\x88",
+ "\\x89",
+ "\\x8A",
+ "\\x8B",
+ "\\x8C",
+ "\\x8D",
+ "\\x8E",
+ "\\x8F", // x8F
+ "\\x90",
+ "\\x91",
+ "\\x92",
+ "\\x93",
+ "\\x94",
+ "\\x95",
+ "\\x96",
+ "\\x97", // x97
+ "\\x98",
+ "\\x99",
+ "\\x9A",
+ "\\x9B",
+ "\\x9C",
+ "\\x9D",
+ "\\x9E",
+ "\\x9F", // x9F
+];
+
+let getStringWidth;
+
+function getUserOptions(ctx, isCrossContext) {
+ const ret = {
+ stylize: ctx.stylize,
+ showHidden: ctx.showHidden,
+ depth: ctx.depth,
+ colors: ctx.colors,
+ customInspect: ctx.customInspect,
+ showProxy: ctx.showProxy,
+ maxArrayLength: ctx.maxArrayLength,
+ maxStringLength: ctx.maxStringLength,
+ breakLength: ctx.breakLength,
+ compact: ctx.compact,
+ sorted: ctx.sorted,
+ getters: ctx.getters,
+ numericSeparator: ctx.numericSeparator,
+ ...ctx.userOptions,
+ };
+
+ // Typically, the target value will be an instance of `Object`. If that is
+ // *not* the case, the object may come from another vm.Context, and we want
+ // to avoid passing it objects from this Context in that case, so we remove
+ // the prototype from the returned object itself + the `stylize()` function,
+ // and remove all other non-primitives, including non-primitive user options.
+ if (isCrossContext) {
+ ObjectSetPrototypeOf(ret, null);
+ for (const key of ObjectKeys(ret)) {
+ if ((typeof ret[key] === "object" || typeof ret[key] === "function") && ret[key] !== null) {
+ delete ret[key];
+ }
+ }
+ ret.stylize = ObjectSetPrototypeOf((value, flavour) => {
+ let stylized;
+ try {
+ stylized = `${ctx.stylize(value, flavour)}`;
+ } catch {
+ // Continue regardless of error.
+ }
+
+ if (typeof stylized !== "string") return value;
+ // `stylized` is a string as it should be, which is safe to pass along.
+ return stylized;
+ }, null);
+ }
+
+ return ret;
+}
+
+/**
+ * Echos the value of any input. Tries to print the value out
+ * in the best way possible given the different types.
+ * @param {any} value The value to print out.
+ * @param {object} opts Optional options object that alters the output.
+ */
+/* Legacy: value, showHidden, depth, colors */
+function inspect(value, opts) {
+ // Default options
+ const ctx = {
+ budget: {},
+ indentationLvl: 0,
+ seen: [],
+ currentDepth: 0,
+ stylize: stylizeNoColor,
+ showHidden: inspectDefaultOptions.showHidden,
+ depth: inspectDefaultOptions.depth,
+ colors: inspectDefaultOptions.colors,
+ customInspect: inspectDefaultOptions.customInspect,
+ showProxy: inspectDefaultOptions.showProxy,
+ maxArrayLength: inspectDefaultOptions.maxArrayLength,
+ maxStringLength: inspectDefaultOptions.maxStringLength,
+ breakLength: inspectDefaultOptions.breakLength,
+ compact: inspectDefaultOptions.compact,
+ sorted: inspectDefaultOptions.sorted,
+ getters: inspectDefaultOptions.getters,
+ numericSeparator: inspectDefaultOptions.numericSeparator,
+ };
+ if (arguments.length > 1) {
+ // Legacy...
+ if (arguments.length > 2) {
+ if (arguments[2] !== undefined) {
+ ctx.depth = arguments[2];
+ }
+ if (arguments.length > 3 && arguments[3] !== undefined) {
+ ctx.colors = arguments[3];
+ }
+ }
+ // Set user-specified options
+ if (typeof opts === "boolean") {
+ ctx.showHidden = opts;
+ } else if (opts) {
+ const optKeys = ObjectKeys(opts);
+ for (let i = 0; i < optKeys.length; ++i) {
+ const key = optKeys[i];
+ // TODO(BridgeAR): Find a solution what to do about stylize. Either make
+ // this function public or add a new API with a similar or better functionality.
+ if (ObjectPrototypeHasOwnProperty(inspectDefaultOptions, key) || key === "stylize") {
+ ctx[key] = opts[key];
+ } else if (ctx.userOptions === undefined) {
+ // This is required to pass through the actual user input.
+ ctx.userOptions = opts;
+ }
+ }
+ }
+ }
+ if (ctx.colors) ctx.stylize = stylizeWithColor;
+ if (ctx.maxArrayLength === null) ctx.maxArrayLength = Infinity;
+ if (ctx.maxStringLength === null) ctx.maxStringLength = Infinity;
+ return formatValue(ctx, value, 0);
+}
+inspect.custom = customInspectSymbol;
+ObjectDefineProperty(inspect, "defaultOptions", {
+ __proto__: null,
+ get() {
+ return inspectDefaultOptions;
+ },
+ set(options) {
+ validateObject(options, "options");
+ return ObjectAssign(inspectDefaultOptions, options);
+ },
+});
+ObjectDefineProperty(inspect, "replDefaults", {
+ __proto__: null,
+ get() {
+ return inspectReplDefaults;
+ },
+ set(options) {
+ validateObject(options, "options");
+ return ObjectAssign(inspectReplDefaults, options);
+ },
+});
+
+// Set Graphics Rendition https://en.wikipedia.org/wiki/ANSI_escape_code#graphics
+// Each color consists of an array with the color code as first entry and the
+// reset code as second entry.
+const defaultFG = 39;
+const defaultBG = 49;
+inspect.colors = {
+ __proto__: null,
+ reset: [0, 0],
+ bold: [1, 22],
+ dim: [2, 22], // Alias: faint
+ italic: [3, 23],
+ underline: [4, 24],
+ blink: [5, 25],
+ // Swap foreground and background colors
+ inverse: [7, 27], // Alias: swapcolors, swapColors
+ hidden: [8, 28], // Alias: conceal
+ strikethrough: [9, 29], // Alias: strikeThrough, crossedout, crossedOut
+ doubleunderline: [21, 24], // Alias: doubleUnderline
+ black: [30, defaultFG],
+ red: [31, defaultFG],
+ green: [32, defaultFG],
+ yellow: [33, defaultFG],
+ blue: [34, defaultFG],
+ magenta: [35, defaultFG],
+ cyan: [36, defaultFG],
+ white: [37, defaultFG],
+ bgBlack: [40, defaultBG],
+ bgRed: [41, defaultBG],
+ bgGreen: [42, defaultBG],
+ bgYellow: [43, defaultBG],
+ bgBlue: [44, defaultBG],
+ bgMagenta: [45, defaultBG],
+ bgCyan: [46, defaultBG],
+ bgWhite: [47, defaultBG],
+ framed: [51, 54],
+ overlined: [53, 55],
+ gray: [90, defaultFG], // Alias: grey, blackBright
+ redBright: [91, defaultFG],
+ greenBright: [92, defaultFG],
+ yellowBright: [93, defaultFG],
+ blueBright: [94, defaultFG],
+ magentaBright: [95, defaultFG],
+ cyanBright: [96, defaultFG],
+ whiteBright: [97, defaultFG],
+ bgGray: [100, defaultBG], // Alias: bgGrey, bgBlackBright
+ bgRedBright: [101, defaultBG],
+ bgGreenBright: [102, defaultBG],
+ bgYellowBright: [103, defaultBG],
+ bgBlueBright: [104, defaultBG],
+ bgMagentaBright: [105, defaultBG],
+ bgCyanBright: [106, defaultBG],
+ bgWhiteBright: [107, defaultBG],
+};
+
+function defineColorAlias(target, alias) {
+ ObjectDefineProperty(inspect.colors, alias, {
+ __proto__: null,
+ get() {
+ return this[target];
+ },
+ set(value) {
+ this[target] = value;
+ },
+ configurable: true,
+ enumerable: false,
+ });
+}
+
+defineColorAlias("gray", "grey");
+defineColorAlias("gray", "blackBright");
+defineColorAlias("bgGray", "bgGrey");
+defineColorAlias("bgGray", "bgBlackBright");
+defineColorAlias("dim", "faint");
+defineColorAlias("strikethrough", "crossedout");
+defineColorAlias("strikethrough", "strikeThrough");
+defineColorAlias("strikethrough", "crossedOut");
+defineColorAlias("hidden", "conceal");
+defineColorAlias("inverse", "swapColors");
+defineColorAlias("inverse", "swapcolors");
+defineColorAlias("doubleunderline", "doubleUnderline");
+
+// TODO(BridgeAR): Add function style support for more complex styles.
+// Don't use 'blue' not visible on cmd.exe
+inspect.styles = {
+ __proto__: null,
+ special: "cyan",
+ number: "yellow",
+ bigint: "yellow",
+ boolean: "yellow",
+ undefined: "grey",
+ null: "bold",
+ string: "green",
+ symbol: "green",
+ date: "magenta",
+ // "name": intentionally not styling
+ // TODO(BridgeAR): Highlight regular expressions properly.
+ regexp: "red",
+ module: "underline",
+};
+
+function addQuotes(str, quotes) {
+ if (quotes === -1) return `"${str}"`;
+ if (quotes === -2) return `\`${str}\``;
+ return `'${str}'`;
+}
+
+function escapeFn(str) {
+ const charCode = StringPrototypeCharCodeAt(str);
+ return meta.length > charCode ? meta[charCode] : `\\u${NumberPrototypeToString(charCode, 16)}`;
+}
+
+// Escape control characters, single quotes and the backslash.
+// This is similar to JSON stringify escaping.
+function strEscape(str) {
+ let escapeTest = strEscapeSequencesRegExp;
+ let escapeReplace = strEscapeSequencesReplacer;
+ let singleQuote = 39;
+
+ // Check for double quotes. If not present, do not escape single quotes and
+ // instead wrap the text in double quotes. If double quotes exist, check for
+ // backticks. If they do not exist, use those as fallback instead of the
+ // double quotes.
+ if (StringPrototypeIncludes(str, "'")) {
+ // This invalidates the charCode and therefore can not be matched for
+ // anymore.
+ if (!StringPrototypeIncludes(str, '"')) {
+ singleQuote = -1;
+ } else if (!StringPrototypeIncludes(str, "`") && !StringPrototypeIncludes(str, "${")) {
+ singleQuote = -2;
+ }
+ if (singleQuote !== 39) {
+ escapeTest = strEscapeSequencesRegExpSingle;
+ escapeReplace = strEscapeSequencesReplacerSingle;
+ }
+ }
+
+ // Some magic numbers that worked out fine while benchmarking with v8 6.0
+ if (str.length < 5000 && RegExpPrototypeExec(escapeTest, str) === null) return addQuotes(str, singleQuote);
+ if (str.length > 100) {
+ str = RegExpPrototypeSymbolReplace(escapeReplace, str, escapeFn);
+ return addQuotes(str, singleQuote);
+ }
+
+ let result = "";
+ let last = 0;
+ for (let i = 0; i < str.length; i++) {
+ const point = StringPrototypeCharCodeAt(str, i);
+ if (point === singleQuote || point === 92 || point < 32 || (point > 126 && point < 160)) {
+ if (last === i) {
+ result += meta[point];
+ } else {
+ result += `${StringPrototypeSlice(str, last, i)}${meta[point]}`;
+ }
+ last = i + 1;
+ } else if (point >= 0xd800 && point <= 0xdfff) {
+ if (point <= 0xdbff && i + 1 < str.length) {
+ const point = StringPrototypeCharCodeAt(str, i + 1);
+ if (point >= 0xdc00 && point <= 0xdfff) {
+ i++;
+ continue;
+ }
+ }
+ result += `${StringPrototypeSlice(str, last, i)}\\u${NumberPrototypeToString(point, 16)}`;
+ last = i + 1;
+ }
+ }
+
+ if (last !== str.length) {
+ result += StringPrototypeSlice(str, last);
+ }
+ return addQuotes(result, singleQuote);
+}
+
+function stylizeWithColor(str, styleType) {
+ const style = inspect.styles[styleType];
+ if (style !== undefined) {
+ const color = inspect.colors[style];
+ if (color !== undefined) return `\u001b[${color[0]}m${str}\u001b[${color[1]}m`;
+ }
+ return str;
+}
+
+function stylizeNoColor(str) {
+ return str;
+}
+
+// Return a new empty array to push in the results of the default formatter.
+function getEmptyFormatArray() {
+ return [];
+}
+
+function isInstanceof(object, proto) {
+ try {
+ return object instanceof proto;
+ } catch {
+ return false;
+ }
+}
+
+function getConstructorName(obj, ctx, recurseTimes, protoProps) {
+ let firstProto;
+ const tmp = obj;
+ while (obj || isUndetectableObject(obj)) {
+ const descriptor = ObjectGetOwnPropertyDescriptor(obj, "constructor");
+ if (
+ descriptor !== undefined &&
+ typeof descriptor.value === "function" &&
+ descriptor.value.name !== "" &&
+ isInstanceof(tmp, descriptor.value)
+ ) {
+ if (protoProps !== undefined && (firstProto !== obj || !builtInObjects.has(descriptor.value.name))) {
+ addPrototypeProperties(ctx, tmp, firstProto || tmp, recurseTimes, protoProps);
+ }
+ return String(descriptor.value.name);
+ }
+
+ obj = ObjectGetPrototypeOf(obj);
+ if (firstProto === undefined) {
+ firstProto = obj;
+ }
+ }
+
+ if (firstProto === null) {
+ return null;
+ }
+
+ const res = internalGetConstructorName(tmp);
+
+ if (recurseTimes > ctx.depth && ctx.depth !== null) {
+ return `${res} <Complex prototype>`;
+ }
+
+ const protoConstr = getConstructorName(firstProto, ctx, recurseTimes + 1, protoProps);
+
+ if (protoConstr === null) {
+ return `${res} <${inspect(firstProto, {
+ ...ctx,
+ customInspect: false,
+ depth: -1,
+ })}>`;
+ }
+
+ return `${res} <${protoConstr}>`;
+}
+
+// This function has the side effect of adding prototype properties to the
+// `output` argument (which is an array). This is intended to highlight user
+// defined prototype properties.
+function addPrototypeProperties(ctx, main, obj, recurseTimes, output) {
+ let depth = 0;
+ let keys;
+ let keySet;
+ do {
+ if (depth !== 0 || main === obj) {
+ obj = ObjectGetPrototypeOf(obj);
+ // Stop as soon as a null prototype is encountered.
+ if (obj === null) {
+ return;
+ }
+ // Stop as soon as a built-in object type is detected.
+ const descriptor = ObjectGetOwnPropertyDescriptor(obj, "constructor");
+ if (
+ descriptor !== undefined &&
+ typeof descriptor.value === "function" &&
+ builtInObjects.has(descriptor.value.name)
+ ) {
+ return;
+ }
+ }
+
+ if (depth === 0) {
+ keySet = new SafeSet();
+ } else {
+ ArrayPrototypeForEach(keys, key => keySet.add(key));
+ }
+ // Get all own property names and symbols.
+ keys = ReflectOwnKeys(obj);
+ ArrayPrototypePush(ctx.seen, main);
+ for (const key of keys) {
+ // Ignore the `constructor` property and keys that exist on layers above.
+ if (key === "constructor" || ObjectPrototypeHasOwnProperty(main, key) || (depth !== 0 && keySet.has(key))) {
+ continue;
+ }
+ const desc = ObjectGetOwnPropertyDescriptor(obj, key);
+ if (typeof desc.value === "function") {
+ continue;
+ }
+ const value = formatProperty(ctx, obj, recurseTimes, key, kObjectType, desc, main);
+ if (ctx.colors) {
+ // Faint!
+ ArrayPrototypePush(output, `\u001b[2m${value}\u001b[22m`);
+ } else {
+ ArrayPrototypePush(output, value);
+ }
+ }
+ ArrayPrototypePop(ctx.seen);
+ // Limit the inspection to up to three prototype layers. Using `recurseTimes`
+ // is not a good choice here, because it's as if the properties are declared
+ // on the current object from the users perspective.
+ } while (++depth !== 3);
+}
+
+function getPrefix(constructor, tag, fallback, size = "") {
+ if (constructor === null) {
+ if (tag !== "" && fallback !== tag) {
+ return `[${fallback}${size}: null prototype] [${tag}] `;
+ }
+ return `[${fallback}${size}: null prototype] `;
+ }
+
+ if (tag !== "" && constructor !== tag) {
+ return `${constructor}${size} [${tag}] `;
+ }
+ return `${constructor}${size} `;
+}
+
+// Look up the keys of the object.
+function getKeys(value, showHidden) {
+ let keys;
+ const symbols = ObjectGetOwnPropertySymbols(value);
+ if (showHidden) {
+ keys = ObjectGetOwnPropertyNames(value);
+ if (symbols.length !== 0) ArrayPrototypePushApply(keys, symbols);
+ } else {
+ // This might throw if `value` is a Module Namespace Object from an
+ // unevaluated module, but we don't want to perform the actual type
+ // check because it's expensive.
+ // TODO(devsnek): track https://github.com/tc39/ecma262/issues/1209
+ // and modify this logic as needed.
+ try {
+ keys = ObjectKeys(value);
+ } catch (err) {
+ assert(isNativeError(err) && err.name === "ReferenceError" && isModuleNamespaceObject(value));
+ keys = ObjectGetOwnPropertyNames(value);
+ }
+ if (symbols.length !== 0) {
+ const filter = key => ObjectPrototypePropertyIsEnumerable(value, key);
+ ArrayPrototypePushApply(keys, ArrayPrototypeFilter(symbols, filter));
+ }
+ }
+ return keys;
+}
+
+function getCtxStyle(value, constructor, tag) {
+ let fallback = "";
+ if (constructor === null) {
+ fallback = internalGetConstructorName(value);
+ if (fallback === tag) {
+ fallback = "Object";
+ }
+ }
+ return getPrefix(constructor, tag, fallback);
+}
+
+function formatProxy(ctx, proxy, recurseTimes) {
+ if (recurseTimes > ctx.depth && ctx.depth !== null) {
+ return ctx.stylize("Proxy [Array]", "special");
+ }
+ recurseTimes += 1;
+ ctx.indentationLvl += 2;
+ const res = [formatValue(ctx, proxy[0], recurseTimes), formatValue(ctx, proxy[1], recurseTimes)];
+ ctx.indentationLvl -= 2;
+ return reduceToSingleString(ctx, res, "", ["Proxy [", "]"], kArrayExtrasType, recurseTimes);
+}
+
+// Note: using `formatValue` directly requires the indentation level to be
+// corrected by setting `ctx.indentationLvL += diff` and then to decrease the
+// value afterwards again.
+function formatValue(ctx, value, recurseTimes, typedArray) {
+ // Primitive types cannot have properties.
+ if (typeof value !== "object" && typeof value !== "function" && !isUndetectableObject(value)) {
+ return formatPrimitive(ctx.stylize, value, ctx);
+ }
+ if (value === null) {
+ return ctx.stylize("null", "null");
+ }
+
+ // Memorize the context for custom inspection on proxies.
+ const context = value;
+ // Always check for proxies to prevent side effects and to prevent triggering any proxy handlers.
+ const proxy = getProxyDetails(value, !!ctx.showProxy);
+ if (proxy !== undefined) {
+ if (proxy === null || proxy[0] === null) {
+ return ctx.stylize("<Revoked Proxy>", "special");
+ }
+ if (ctx.showProxy) {
+ return formatProxy(ctx, proxy, recurseTimes);
+ }
+ value = proxy;
+ }
+
+ // Provide a hook for user-specified inspect functions.
+ // Check that value is an object with an inspect function on it.
+ if (ctx.customInspect) {
+ const maybeCustom = value[customInspectSymbol];
+ if (
+ typeof maybeCustom === "function" &&
+ // Filter out the util module, its inspect function is special.
+ maybeCustom !== inspect &&
+ // Also filter out any prototype objects using the circular check.
+ !(value.constructor && value.constructor.prototype === value)
+ ) {
+ // This makes sure the recurseTimes are reported as before while using
+ // a counter internally.
+ const depth = ctx.depth === null ? null : ctx.depth - recurseTimes;
+ const isCrossContext = proxy !== undefined || !(context instanceof Object);
+ const ret = maybeCustom.$call(context, depth, getUserOptions(ctx, isCrossContext), inspect);
+ // If the custom inspection method returned `this`, don't go into infinite recursion.
+ if (ret !== context) {
+ if (typeof ret !== "string") return formatValue(ctx, ret, recurseTimes);
+ return StringPrototypeReplaceAll(ret, "\n", `\n${StringPrototypeRepeat(" ", ctx.indentationLvl)}`);
+ }
+ }
+ }
+
+ // Using an array here is actually better for the average case than using
+ // a Set. `seen` will only check for the depth and will never grow too large.
+ if (ctx.seen.includes(value)) {
+ let index = 1;
+ if (ctx.circular === undefined) {
+ ctx.circular = new SafeMap();
+ ctx.circular.set(value, index);
+ } else {
+ index = ctx.circular.get(value);
+ if (index === undefined) {
+ index = ctx.circular.size + 1;
+ ctx.circular.set(value, index);
+ }
+ }
+ return ctx.stylize(`[Circular *${index}]`, "special");
+ }
+
+ return formatRaw(ctx, value, recurseTimes, typedArray);
+}
+
+function formatRaw(ctx, value, recurseTimes, typedArray) {
+ let keys;
+ let protoProps;
+ if (ctx.showHidden && (recurseTimes <= ctx.depth || ctx.depth === null)) {
+ protoProps = [];
+ }
+
+ const constructor = getConstructorName(value, ctx, recurseTimes, protoProps);
+ // Reset the variable to check for this later on.
+ if (protoProps !== undefined && protoProps.length === 0) {
+ protoProps = undefined;
+ }
+
+ let tag = value[SymbolToStringTag];
+ // Only list the tag in case it's non-enumerable / not an own property.
+ // Otherwise we'd print this twice.
+ if (
+ typeof tag !== "string" ||
+ (tag !== "" &&
+ (ctx.showHidden ? ObjectPrototypeHasOwnProperty : ObjectPrototypePropertyIsEnumerable)(value, SymbolToStringTag))
+ ) {
+ tag = "";
+ }
+ let base = "";
+ let formatter = getEmptyFormatArray;
+ let braces;
+ let noIterator = true;
+ let i = 0;
+ const filter = ctx.showHidden ? ALL_PROPERTIES : ONLY_ENUMERABLE;
+
+ let extrasType = kObjectType;
+
+ // Iterators and the rest are split to reduce checks.
+ // We have to check all values in case the constructor is set to null.
+ // Otherwise it would not possible to identify all types properly.
+ if (SymbolIterator in value || constructor === null) {
+ noIterator = false;
+ if (ArrayIsArray(value)) {
+ // Only set the constructor for non ordinary ("Array [...]") arrays.
+ const prefix =
+ constructor !== "Array" || tag !== "" ? getPrefix(constructor, tag, "Array", `(${value.length})`) : "";
+ keys = getOwnNonIndexProperties(value, filter);
+ braces = [`${prefix}[`, "]"];
+ if (value.length === 0 && keys.length === 0 && protoProps === undefined) return `${braces[0]}]`;
+ extrasType = kArrayExtrasType;
+ formatter = formatArray;
+ } else if (isSet(value)) {
+ const size = SetPrototypeGetSize(value);
+ const prefix = getPrefix(constructor, tag, "Set", `(${size})`);
+ keys = getKeys(value, ctx.showHidden);
+ formatter =
+ constructor !== null
+ ? FunctionPrototypeBind(formatSet, null, value)
+ : FunctionPrototypeBind(formatSet, null, SetPrototypeValues(value));
+ if (size === 0 && keys.length === 0 && protoProps === undefined) return `${prefix}{}`;
+ braces = [`${prefix}{`, "}"];
+ } else if (isMap(value)) {
+ const size = MapPrototypeGetSize(value);
+ const prefix = getPrefix(constructor, tag, "Map", `(${size})`);
+ keys = getKeys(value, ctx.showHidden);
+ formatter =
+ constructor !== null
+ ? FunctionPrototypeBind(formatMap, null, value)
+ : FunctionPrototypeBind(formatMap, null, MapPrototypeEntries(value));
+ if (size === 0 && keys.length === 0 && protoProps === undefined) return `${prefix}{}`;
+ braces = [`${prefix}{`, "}"];
+ } else if (isTypedArray(value)) {
+ keys = getOwnNonIndexProperties(value, filter);
+ let bound = value;
+ let fallback = "";
+ if (constructor === null) {
+ fallback = TypedArrayPrototypeGetSymbolToStringTag(value);
+ // Reconstruct the array information.
+ bound = new primordials[fallback](value);
+ }
+ const size = TypedArrayPrototypeGetLength(value);
+ const prefix = getPrefix(constructor, tag, fallback, `(${size})`);
+ braces = [`${prefix}[`, "]"];
+ if (value.length === 0 && keys.length === 0 && !ctx.showHidden) return `${braces[0]}]`;
+ // Special handle the value. The original value is required below. The
+ // bound function is required to reconstruct missing information.
+ formatter = FunctionPrototypeBind(formatTypedArray, null, bound, size);
+ extrasType = kArrayExtrasType;
+ } else if (isMapIterator(value)) {
+ keys = getKeys(value, ctx.showHidden);
+ braces = getIteratorBraces("Map", tag);
+ // Add braces to the formatter parameters.
+ formatter = FunctionPrototypeBind(formatIterator, null, braces);
+ } else if (isSetIterator(value)) {
+ keys = getKeys(value, ctx.showHidden);
+ braces = getIteratorBraces("Set", tag);
+ // Add braces to the formatter parameters.
+ formatter = FunctionPrototypeBind(formatIterator, null, braces);
+ } else {
+ noIterator = true;
+ }
+ }
+ if (noIterator) {
+ keys = getKeys(value, ctx.showHidden);
+ braces = ["{", "}"];
+ if (constructor === "Object") {
+ if (isArgumentsObject(value)) {
+ braces[0] = "[Arguments] {";
+ } else if (tag !== "") {
+ braces[0] = `${getPrefix(constructor, tag, "Object")}{`;
+ }
+ if (keys.length === 0 && protoProps === undefined) {
+ return `${braces[0]}}`;
+ }
+ } else if (typeof value === "function") {
+ base = getFunctionBase(value, constructor, tag);
+ if (keys.length === 0 && protoProps === undefined) return ctx.stylize(base, "special");
+ } else if (isRegExp(value)) {
+ // Make RegExps say that they are RegExps
+ base = RegExpPrototypeToString(constructor !== null ? value : new RegExp(value));
+ const prefix = getPrefix(constructor, tag, "RegExp");
+ if (prefix !== "RegExp ") base = `${prefix}${base}`;
+ if ((keys.length === 0 && protoProps === undefined) || (recurseTimes > ctx.depth && ctx.depth !== null)) {
+ return ctx.stylize(base, "regexp");
+ }
+ } else if (isDate(value)) {
+ // Make dates with properties first say the date
+ base = NumberIsNaN(DatePrototypeGetTime(value)) ? DatePrototypeToString(value) : DatePrototypeToISOString(value);
+ const prefix = getPrefix(constructor, tag, "Date");
+ if (prefix !== "Date ") base = `${prefix}${base}`;
+ if (keys.length === 0 && protoProps === undefined) {
+ return ctx.stylize(base, "date");
+ }
+ } else if (value instanceof Error) {
+ base = formatError(value, constructor, tag, ctx, keys);
+ if (keys.length === 0 && protoProps === undefined) return base;
+ } else if (isAnyArrayBuffer(value)) {
+ // Fast path for ArrayBuffer and SharedArrayBuffer.
+ // Can't do the same for DataView because it has a non-primitive
+ // .buffer property that we need to recurse for.
+ const arrayType = isArrayBuffer(value) ? "ArrayBuffer" : "SharedArrayBuffer";
+ const prefix = getPrefix(constructor, tag, arrayType);
+ if (typedArray === undefined) {
+ formatter = formatArrayBuffer;
+ } else if (keys.length === 0 && protoProps === undefined) {
+ return prefix + `{ byteLength: ${formatNumber(ctx.stylize, value.byteLength, false)} }`;
+ }
+ braces[0] = `${prefix}{`;
+ ArrayPrototypeUnshift(keys, "byteLength");
+ } else if (isDataView(value)) {
+ braces[0] = `${getPrefix(constructor, tag, "DataView")}{`;
+ // .buffer goes last, it's not a primitive like the others.
+ ArrayPrototypeUnshift(keys, "byteLength", "byteOffset", "buffer");
+ } else if (isPromise(value)) {
+ braces[0] = `${getPrefix(constructor, tag, "Promise")}{`;
+ formatter = formatPromise;
+ } else if (isWeakSet(value)) {
+ braces[0] = `${getPrefix(constructor, tag, "WeakSet")}{`;
+ formatter = ctx.showHidden ? formatWeakSet : formatWeakCollection;
+ } else if (isWeakMap(value)) {
+ braces[0] = `${getPrefix(constructor, tag, "WeakMap")}{`;
+ formatter = ctx.showHidden ? formatWeakMap : formatWeakCollection;
+ } else if (isModuleNamespaceObject(value)) {
+ braces[0] = `${getPrefix(constructor, tag, "Module")}{`;
+ // Special handle keys for namespace objects.
+ formatter = formatNamespaceObject.bind(null, keys);
+ } else if (isBoxedPrimitive(value)) {
+ base = getBoxedBase(value, ctx, keys, constructor, tag);
+ if (keys.length === 0 && protoProps === undefined) {
+ return base;
+ }
+ } else {
+ if (keys.length === 0 && protoProps === undefined) {
+ if (isExternal(value)) {
+ const address = "0"; //getExternalValue(value).toString(16);
+ return ctx.stylize(`[External: ${address}]`, "special");
+ }
+ return `${getCtxStyle(value, constructor, tag)}{}`;
+ }
+ braces[0] = `${getCtxStyle(value, constructor, tag)}{`;
+ }
+ }
+
+ if (recurseTimes > ctx.depth && ctx.depth !== null) {
+ let constructorName = StringPrototypeSlice(getCtxStyle(value, constructor, tag), 0, -1);
+ if (constructor !== null) constructorName = `[${constructorName}]`;
+ return ctx.stylize(constructorName, "special");
+ }
+ recurseTimes += 1;
+
+ ctx.seen.push(value);
+ ctx.currentDepth = recurseTimes;
+ let output;
+ const indentationLvl = ctx.indentationLvl;
+ try {
+ // JSC stack is too powerful it must be stopped manually
+ if (ctx.currentDepth > 1000) throw new RangeError(ERROR_STACK_OVERFLOW_MSG);
+ output = formatter(ctx, value, recurseTimes);
+ for (i = 0; i < keys.length; i++) {
+ ArrayPrototypePush(output, formatProperty(ctx, value, recurseTimes, keys[i], extrasType));
+ }
+ if (protoProps !== undefined) {
+ ArrayPrototypePushApply(output, protoProps);
+ }
+ } catch (err) {
+ if (err instanceof RangeError && err.message === ERROR_STACK_OVERFLOW_MSG) {
+ const constructorName = StringPrototypeSlice(getCtxStyle(value, constructor, tag), 0, -1);
+ ctx.seen.pop();
+ ctx.indentationLvl = indentationLvl;
+ return ctx.stylize(
+ `[${constructorName}: Inspection interrupted prematurely. Maximum call stack size exceeded.]`,
+ "special",
+ );
+ }
+ throw new AssertionError("handleMaxCallStackSize assertion failed: " + String(err), true);
+ }
+ if (ctx.circular !== undefined) {
+ const index = ctx.circular.get(value);
+ if (index !== undefined) {
+ ctx.seenRefs ??= new Set();
+ const SEEN = ctx.seenRefs.has(index);
+ if (!SEEN) {
+ ctx.seenRefs.add(index);
+ const reference = ctx.stylize(`<ref *${index}>`, "special");
+ // Add reference always to the very beginning of the output.
+ if (ctx.compact !== true) {
+ base = base === "" ? reference : `${reference} ${base}`;
+ } else {
+ braces[0] = `${reference} ${braces[0]}`;
+ }
+ } else {
+ //! this is a non-standard behavior compared to Node's implementation
+ // it optimizes the output by also collapsing indirect circular references
+ // this is not known to cause any issues so far but this note is left here just in case
+ const reference = ctx.stylize(`[Circular *${index}]`, "special");
+ //ctx.seen.pop(); //? uncommenting this line would allow more accurate display semantics but causes a ~2x slowdown
+ return reference;
+ }
+ }
+ }
+ ctx.seen.pop();
+
+ if (ctx.sorted) {
+ const comparator = ctx.sorted === true ? undefined : ctx.sorted;
+ if (extrasType === kObjectType) {
+ ArrayPrototypeSort(output, comparator);
+ } else if (keys.length > 1) {
+ const sorted = ArrayPrototypeSort(ArrayPrototypeSlice(output, output.length - keys.length), comparator);
+ ArrayPrototypeUnshift(sorted, output, output.length - keys.length, keys.length);
+ ReflectApply(ArrayPrototypeSplice, null, sorted);
+ }
+ }
+
+ const res = reduceToSingleString(ctx, output, base, braces, extrasType, recurseTimes, value);
+ const budget = ctx.budget[ctx.indentationLvl] || 0;
+ const newLength = budget + res.length;
+ ctx.budget[ctx.indentationLvl] = newLength;
+ // If any indentationLvl exceeds this limit, limit further inspecting to the
+ // minimum. Otherwise the recursive algorithm might continue inspecting the
+ // object even though the maximum string size (~2 ** 28 on 32 bit systems and
+ // ~2 ** 30 on 64 bit systems) exceeded. The actual output is not limited at
+ // exactly 2 ** 27 but a bit higher. This depends on the object shape.
+ // This limit also makes sure that huge objects don't block the event loop
+ // significantly.
+ if (newLength > 2 ** 27) {
+ ctx.depth = -1;
+ }
+ return res;
+}
+
+function getIteratorBraces(type, tag) {
+ if (tag !== `${type} Iterator`) {
+ if (tag !== "") tag += "] [";
+ tag += `${type} Iterator`;
+ }
+ return [`[${tag}] {`, "}"];
+}
+
+function getBoxedBase(value, ctx, keys, constructor, tag) {
+ let fn;
+ let type;
+ if (isNumberObject(value)) {
+ fn = NumberPrototypeValueOf;
+ type = "Number";
+ } else if (isStringObject(value)) {
+ fn = StringPrototypeValueOf;
+ type = "String";
+ // For boxed Strings, we have to remove the 0-n indexed entries,
+ // since they just noisy up the output and are redundant
+ // Make boxed primitive Strings look like such
+ keys.splice(0, value.length);
+ } else if (isBooleanObject(value)) {
+ fn = BooleanPrototypeValueOf;
+ type = "Boolean";
+ } else if (isBigIntObject(value)) {
+ fn = BigIntPrototypeValueOf;
+ type = "BigInt";
+ } else {
+ fn = SymbolPrototypeValueOf;
+ type = "Symbol";
+ }
+ let base = `[${type}`;
+ if (type !== constructor) {
+ if (constructor === null) {
+ base += " (null prototype)";
+ } else {
+ base += ` (${constructor})`;
+ }
+ }
+ base += `: ${formatPrimitive(stylizeNoColor, fn(value), ctx)}]`;
+ if (tag !== "" && tag !== constructor) {
+ base += ` [${tag}]`;
+ }
+ if (keys.length !== 0 || ctx.stylize === stylizeNoColor) return base;
+ return ctx.stylize(base, StringPrototypeToLowerCase(type));
+}
+
+function getClassBase(value, constructor, tag) {
+ const hasName = ObjectPrototypeHasOwnProperty(value, "name");
+ const name = (hasName && value.name) || "(anonymous)";
+ let base = `class ${name}`;
+ if (constructor !== "Function" && constructor !== null) {
+ base += ` [${constructor}]`;
+ }
+ if (tag !== "" && constructor !== tag) {
+ base += ` [${tag}]`;
+ }
+ if (constructor !== null) {
+ const superName = ObjectGetPrototypeOf(value).name;
+ if (superName) {
+ base += ` extends ${superName}`;
+ }
+ } else {
+ base += " extends [null prototype]";
+ }
+ return `[${base}]`;
+}
+
+function getFunctionBase(value, constructor, tag) {
+ const stringified = FunctionPrototypeToString(value);
+ if (StringPrototypeStartsWith(stringified, "class") && StringPrototypeEndsWith(stringified, "}")) {
+ const slice = StringPrototypeSlice(stringified, 5, -1);
+ const bracketIndex = StringPrototypeIndexOf(slice, "{");
+ if (
+ bracketIndex !== -1 &&
+ (!StringPrototypeIncludes(StringPrototypeSlice(slice, 0, bracketIndex), "(") ||
+ // Slow path to guarantee that it's indeed a class.
+ RegExpPrototypeExec(classRegExp, RegExpPrototypeSymbolReplace(stripCommentsRegExp, slice)) !== null)
+ ) {
+ return getClassBase(value, constructor, tag);
+ }
+ }
+ let type = "Function";
+ if (isGeneratorFunction(value)) {
+ type = `Generator${type}`;
+ }
+ if (isAsyncFunction(value)) {
+ type = `Async${type}`;
+ }
+ let base = `[${type}`;
+ if (constructor === null) {
+ base += " (null prototype)";
+ }
+ if (value.name === "") {
+ base += " (anonymous)";
+ } else {
+ base += `: ${value.name}`;
+ }
+ base += "]";
+ if (constructor !== type && constructor !== null) {
+ base += ` ${constructor}`;
+ }
+ if (tag !== "" && constructor !== tag) {
+ base += ` [${tag}]`;
+ }
+ return base;
+}
+
+function identicalSequenceRange(a, b) {
+ for (let i = 0; i < a.length - 3; i++) {
+ // Find the first entry of b that matches the current entry of a.
+ const pos = b.indexOf(a[i]);
+ if (pos !== -1) {
+ const rest = b.length - pos;
+ if (rest > 3) {
+ let len = 1;
+ const maxLen = MathMin(a.length - i, rest);
+ // Count the number of consecutive entries.
+ while (maxLen > len && a[i + len] === b[pos + len]) {
+ len++;
+ }
+ if (len > 3) {
+ return { len, offset: i };
+ }
+ }
+ }
+ }
+
+ return { len: 0, offset: 0 };
+}
+
+function getStackString(error) {
+ return error.stack ? String(error.stack) : ErrorPrototypeToString(error);
+}
+
+function getStackFrames(ctx, err, stack) {
+ const frames = StringPrototypeSplit(stack, "\n");
+
+ let cause;
+ try {
+ ({ cause } = err);
+ } catch {
+ // If 'cause' is a getter that throws, ignore it.
+ }
+
+ // Remove stack frames identical to frames in cause.
+ if (cause != null && cause instanceof Error) {
+ const causeStack = getStackString(cause);
+ const causeStackStart = StringPrototypeIndexOf(causeStack, "\n at");
+ if (causeStackStart !== -1) {
+ const causeFrames = StringPrototypeSplit(StringPrototypeSlice(causeStack, causeStackStart + 1), "\n");
+ const { len, offset } = identicalSequenceRange(frames, causeFrames);
+ if (len > 0) {
+ const skipped = len - 2;
+ const msg = ` ... ${skipped} lines matching cause stack trace ...`;
+ frames.splice(offset + 1, skipped, ctx.stylize(msg, "undefined"));
+ }
+ }
+ }
+ return frames;
+}
+
+function improveStack(stack, constructor, name, tag) {
+ // A stack trace may contain arbitrary data. Only manipulate the output
+ // for "regular errors" (errors that "look normal") for now.
+ let len = name.length;
+
+ if (
+ constructor === null ||
+ (StringPrototypeEndsWith(name, "Error") &&
+ StringPrototypeStartsWith(stack, name) &&
+ (stack.length === len || stack[len] === ":" || stack[len] === "\n"))
+ ) {
+ let fallback = "Error";
+ if (constructor === null) {
+ const start =
+ RegExpPrototypeExec(/^([A-Z][a-z_ A-Z0-9[\]()-]+)(?::|\n {4}at)/, stack) ||
+ RegExpPrototypeExec(/^([a-z_A-Z0-9-]*Error)$/, stack);
+ fallback = (start && start[1]) || "";
+ len = fallback.length;
+ fallback = fallback || "Error";
+ }
+ const prefix = StringPrototypeSlice(getPrefix(constructor, tag, fallback), 0, -1);
+ if (name !== prefix) {
+ if (StringPrototypeIncludes(prefix, name)) {
+ if (len === 0) {
+ stack = `${prefix}: ${stack}`;
+ } else {
+ stack = `${prefix}${StringPrototypeSlice(stack, len)}`;
+ }
+ } else {
+ stack = `${prefix} [${name}]${StringPrototypeSlice(stack, len)}`;
+ }
+ }
+ }
+ return stack;
+}
+
+function removeDuplicateErrorKeys(ctx, keys, err, stack) {
+ if (!ctx.showHidden && keys.length !== 0) {
+ for (const name of ["name", "message", "stack"]) {
+ const index = ArrayPrototypeIndexOf(keys, name);
+ // Only hide the property in case it's part of the original stack
+ if (index !== -1 && StringPrototypeIncludes(stack, err[name])) {
+ ArrayPrototypeSplice(keys, index, 1);
+ }
+ }
+ }
+}
+
+function markNodeModules(ctx, line) {
+ let tempLine = "";
+ let nodeModule;
+ let pos = 0;
+ while ((nodeModule = nodeModulesRegExp.exec(line)) !== null) {
+ // '/node_modules/'.length === 14
+ tempLine += StringPrototypeSlice(line, pos, nodeModule.index + 14);
+ tempLine += ctx.stylize(nodeModule[1], "module");
+ pos = nodeModule.index + nodeModule[0].length;
+ }
+ if (pos !== 0) {
+ line = tempLine + StringPrototypeSlice(line, pos);
+ }
+ return line;
+}
+
+function markCwd(ctx, line, workingDirectory) {
+ let cwdStartPos = StringPrototypeIndexOf(line, workingDirectory);
+ let tempLine = "";
+ let cwdLength = workingDirectory.length;
+ if (cwdStartPos !== -1) {
+ if (StringPrototypeSlice(line, cwdStartPos - 7, cwdStartPos) === "file://") {
+ cwdLength += 7;
+ cwdStartPos -= 7;
+ }
+ const start = line[cwdStartPos - 1] === "(" ? cwdStartPos - 1 : cwdStartPos;
+ const end = start !== cwdStartPos && StringPrototypeEndsWith(line, ")") ? -1 : line.length;
+ const workingDirectoryEndPos = cwdStartPos + cwdLength + 1;
+ const cwdSlice = StringPrototypeSlice(line, start, workingDirectoryEndPos);
+
+ tempLine += StringPrototypeSlice(line, 0, start);
+ tempLine += ctx.stylize(cwdSlice, "undefined");
+ tempLine += StringPrototypeSlice(line, workingDirectoryEndPos, end);
+ if (end === -1) {
+ tempLine += ctx.stylize(")", "undefined");
+ }
+ } else {
+ tempLine += line;
+ }
+ return tempLine;
+}
+
+function safeGetCWD() {
+ let workingDirectory;
+ try {
+ workingDirectory = process.cwd();
+ } catch {
+ return;
+ }
+ return workingDirectory;
+}
+
+function formatError(err, constructor, tag, ctx, keys) {
+ const name = err.name != null ? String(err.name) : "Error";
+ let stack = getStackString(err);
+
+ //! temp fix for Bun losing the error name from inherited errors + extraneous ": " with no message
+ stack = stack.replace(/^Error: /, `${name}${err.message ? ": " : ""}`);
+
+ removeDuplicateErrorKeys(ctx, keys, err, stack);
+
+ if ("cause" in err && (keys.length === 0 || !ArrayPrototypeIncludes(keys, "cause"))) {
+ ArrayPrototypePush(keys, "cause");
+ }
+
+ // Print errors aggregated into AggregateError
+ if (ArrayIsArray(err.errors) && (keys.length === 0 || !ArrayPrototypeIncludes(keys, "errors"))) {
+ ArrayPrototypePush(keys, "errors");
+ }
+
+ stack = improveStack(stack, constructor, name, tag);
+
+ // Ignore the error message if it's contained in the stack.
+ let pos = (err.message && StringPrototypeIndexOf(stack, err.message)) || -1;
+ if (pos !== -1) pos += err.message.length;
+ // Wrap the error in brackets in case it has no stack trace.
+ const stackStart = StringPrototypeIndexOf(stack, "\n at", pos);
+ if (stackStart === -1) {
+ stack = `[${stack}]`;
+ } else {
+ let newStack = StringPrototypeSlice(stack, 0, stackStart);
+ const stackFramePart = StringPrototypeSlice(stack, stackStart + 1);
+ const lines = getStackFrames(ctx, err, stackFramePart);
+ if (ctx.colors) {
+ // Highlight userland code and node modules.
+ const workingDirectory = safeGetCWD();
+ let esmWorkingDirectory;
+ for (let line of lines) {
+ const core = RegExpPrototypeExec(coreModuleRegExp, line);
+ if (
+ core !== null &&
+ (StringPrototypeStartsWith(core[1], "internal/") ||
+ ArrayPrototypeIncludes(require("node:module").builtinModules, core[1]))
+ ) {
+ newStack += `\n${ctx.stylize(line, "undefined")}`;
+ } else {
+ newStack += "\n";
+
+ line = markNodeModules(ctx, line);
+ if (workingDirectory !== undefined) {
+ let newLine = markCwd(ctx, line, workingDirectory);
+ if (newLine === line) {
+ esmWorkingDirectory ??= pathToFileURL(workingDirectory);
+ newLine = markCwd(ctx, line, esmWorkingDirectory);
+ }
+ line = newLine;
+ }
+
+ newStack += line;
+ }
+ }
+ } else {
+ newStack += `\n${ArrayPrototypeJoin(lines, "\n")}`;
+ }
+ stack = newStack;
+ }
+ // The message and the stack have to be indented as well!
+ if (ctx.indentationLvl !== 0) {
+ const indentation = StringPrototypeRepeat(" ", ctx.indentationLvl);
+ stack = StringPrototypeReplaceAll(stack, "\n", `\n${indentation}`);
+ }
+ return stack;
+}
+
+function groupArrayElements(ctx, output, value) {
+ let totalLength = 0;
+ let maxLength = 0;
+ let i = 0;
+ let outputLength = output.length;
+ if (ctx.maxArrayLength < output.length) {
+ // This makes sure the "... n more items" part is not taken into account.
+ outputLength--;
+ }
+ const separatorSpace = 2; // Add 1 for the space and 1 for the separator.
+ const dataLen = new Array(outputLength);
+ // Calculate the total length of all output entries and the individual max
+ // entries length of all output entries. We have to remove colors first,
+ // otherwise the length would not be calculated properly.
+ for (; i < outputLength; i++) {
+ const len = getStringWidth(output[i], ctx.colors);
+ dataLen[i] = len;
+ totalLength += len + separatorSpace;
+ if (maxLength < len) maxLength = len;
+ }
+ // Add two to `maxLength` as we add a single whitespace character plus a comma
+ // in-between two entries.
+ const actualMax = maxLength + separatorSpace;
+ // Check if at least three entries fit next to each other and prevent grouping
+ // of arrays that contains entries of very different length (i.e., if a single
+ // entry is longer than 1/5 of all other entries combined). Otherwise the
+ // space in-between small entries would be enormous.
+ if (actualMax * 3 + ctx.indentationLvl < ctx.breakLength && (totalLength / actualMax > 5 || maxLength <= 6)) {
+ const approxCharHeights = 2.5;
+ const averageBias = MathSqrt(actualMax - totalLength / output.length);
+ const biasedMax = MathMax(actualMax - 3 - averageBias, 1);
+ // Dynamically check how many columns seem possible.
+ const columns = MathMin(
+ // Ideally a square should be drawn. We expect a character to be about 2.5
+ // times as high as wide. This is the area formula to calculate a square
+ // which contains n rectangles of size `actualMax * approxCharHeights`.
+ // Divide that by `actualMax` to receive the correct number of columns.
+ // The added bias increases the columns for short entries.
+ MathRound(MathSqrt(approxCharHeights * biasedMax * outputLength) / biasedMax),
+ // Do not exceed the breakLength.
+ MathFloor((ctx.breakLength - ctx.indentationLvl) / actualMax),
+ // Limit array grouping for small `compact` modes as the user requested
+ // minimal grouping.
+ ctx.compact * 4,
+ // Limit the columns to a maximum of fifteen.
+ 15,
+ );
+ // Return with the original output if no grouping should happen.
+ if (columns <= 1) {
+ return output;
+ }
+ const tmp = [];
+ const maxLineLength = [];
+ for (let i = 0; i < columns; i++) {
+ let lineMaxLength = 0;
+ for (let j = i; j < output.length; j += columns) {
+ if (dataLen[j] > lineMaxLength) lineMaxLength = dataLen[j];
+ }
+ lineMaxLength += separatorSpace;
+ maxLineLength[i] = lineMaxLength;
+ }
+ let order = StringPrototypePadStart;
+ if (value !== undefined) {
+ for (let i = 0; i < output.length; i++) {
+ if (typeof value[i] !== "number" && typeof value[i] !== "bigint") {
+ order = StringPrototypePadEnd;
+ break;
+ }
+ }
+ }
+ // Each iteration creates a single line of grouped entries.
+ for (let i = 0; i < outputLength; i += columns) {
+ // The last lines may contain less entries than columns.
+ const max = MathMin(i + columns, outputLength);
+ let str = "";
+ let j = i;
+ for (; j < max - 1; j++) {
+ // Calculate extra color padding in case it's active. This has to be
+ // done line by line as some lines might contain more colors than
+ // others.
+ const padding = maxLineLength[j - i] + output[j].length - dataLen[j];
+ str += order(`${output[j]}, `, padding, " ");
+ }
+ if (order === StringPrototypePadStart) {
+ const padding = maxLineLength[j - i] + output[j].length - dataLen[j] - separatorSpace;
+ str += StringPrototypePadStart(output[j], padding, " ");
+ } else {
+ str += output[j];
+ }
+ ArrayPrototypePush(tmp, str);
+ }
+ if (ctx.maxArrayLength < output.length) {
+ ArrayPrototypePush(tmp, output[outputLength]);
+ }
+ output = tmp;
+ }
+ return output;
+}
+
+function addNumericSeparator(integerString) {
+ let result = "";
+ let i = integerString.length;
+ const start = StringPrototypeStartsWith(integerString, "-") ? 1 : 0;
+ for (; i >= start + 4; i -= 3) {
+ result = `_${StringPrototypeSlice(integerString, i - 3, i)}${result}`;
+ }
+ return i === integerString.length ? integerString : `${StringPrototypeSlice(integerString, 0, i)}${result}`;
+}
+
+function addNumericSeparatorEnd(integerString) {
+ let result = "";
+ let i = 0;
+ for (; i < integerString.length - 3; i += 3) {
+ result += `${StringPrototypeSlice(integerString, i, i + 3)}_`;
+ }
+ return i === 0 ? integerString : `${result}${StringPrototypeSlice(integerString, i)}`;
+}
+
+const remainingText = remaining => `... ${remaining} more item${remaining > 1 ? "s" : ""}`;
+
+function formatNumber(fn, number, numericSeparator) {
+ if (!numericSeparator) {
+ // Format -0 as '-0'. Checking `number === -0` won't distinguish 0 from -0.
+ if (ObjectIs(number, -0)) {
+ return fn("-0", "number");
+ }
+ return fn(`${number}`, "number");
+ }
+ const integer = MathTrunc(number);
+ const string = String(integer);
+ if (integer === number) {
+ if (!NumberIsFinite(number) || StringPrototypeIncludes(string, "e")) {
+ return fn(string, "number");
+ }
+ return fn(`${addNumericSeparator(string)}`, "number");
+ }
+ if (NumberIsNaN(number)) {
+ return fn(string, "number");
+ }
+ return fn(
+ `${addNumericSeparator(string)}.${addNumericSeparatorEnd(StringPrototypeSlice(String(number), string.length + 1))}`,
+ "number",
+ );
+}
+
+function formatBigInt(fn, bigint, numericSeparator) {
+ const string = String(bigint);
+ if (!numericSeparator) {
+ return fn(`${string}n`, "bigint");
+ }
+ return fn(`${addNumericSeparator(string)}n`, "bigint");
+}
+
+function formatPrimitive(fn, value, ctx) {
+ if (typeof value === "string") {
+ let trailer = "";
+ if (value.length > ctx.maxStringLength) {
+ const remaining = value.length - ctx.maxStringLength;
+ value = StringPrototypeSlice(value, 0, ctx.maxStringLength);
+ trailer = `... ${remaining} more character${remaining > 1 ? "s" : ""}`;
+ }
+ if (
+ ctx.compact !== true &&
+ // We do not support handling unicode characters width with
+ // the readline getStringWidth function as there are performance implications.
+ value.length > kMinLineLength &&
+ value.length > ctx.breakLength - ctx.indentationLvl - 4
+ ) {
+ return (
+ ArrayPrototypeJoin(
+ ArrayPrototypeMap(extractedSplitNewLines(value), line => fn(strEscape(line), "string")),
+ ` +\n${StringPrototypeRepeat(" ", ctx.indentationLvl + 2)}`,
+ ) + trailer
+ );
+ }
+ return fn(strEscape(value), "string") + trailer;
+ }
+ if (typeof value === "number") return formatNumber(fn, value, ctx.numericSeparator);
+ if (typeof value === "bigint") return formatBigInt(fn, value, ctx.numericSeparator);
+ if (typeof value === "boolean") return fn(`${value}`, "boolean");
+ if (typeof value === "undefined") return fn("undefined", "undefined");
+ // es6 symbol primitive
+ return fn(SymbolPrototypeToString(value), "symbol");
+}
+
+function formatNamespaceObject(keys, ctx, value, recurseTimes) {
+ const output = new Array(keys.length);
+ for (let i = 0; i < keys.length; i++) {
+ try {
+ output[i] = formatProperty(ctx, value, recurseTimes, keys[i], kObjectType);
+ } catch (err) {
+ assert(isNativeError(err) && err.name === "ReferenceError");
+ // Use the existing functionality. This makes sure the indentation and
+ // line breaks are always correct. Otherwise it is very difficult to keep
+ // this aligned, even though this is a hacky way of dealing with this.
+ const tmp = { [keys[i]]: "" };
+ output[i] = formatProperty(ctx, tmp, recurseTimes, keys[i], kObjectType);
+ const pos = StringPrototypeLastIndexOf(output[i], " ");
+ // We have to find the last whitespace and have to replace that value as
+ // it will be visualized as a regular string.
+ output[i] = StringPrototypeSlice(output[i], 0, pos + 1) + ctx.stylize("<uninitialized>", "special");
+ }
+ }
+ // Reset the keys to an empty array. This prevents duplicated inspection.
+ keys.length = 0;
+ return output;
+}
+
+// The array is sparse and/or has extra keys
+function formatSpecialArray(ctx, value, recurseTimes, maxLength, output, i) {
+ const keys = ObjectKeys(value);
+ let index = i;
+ for (; i < keys.length && output.length < maxLength; i++) {
+ const key = keys[i];
+ const tmp = +key;
+ // Arrays can only have up to 2^32 - 1 entries
+ if (tmp > 2 ** 32 - 2) {
+ break;
+ }
+ if (`${index}` !== key) {
+ if (RegExpPrototypeExec(numberRegExp, key) === null) {
+ break;
+ }
+ const emptyItems = tmp - index;
+ const ending = emptyItems > 1 ? "s" : "";
+ const message = `<${emptyItems} empty item${ending}>`;
+ ArrayPrototypePush(output, ctx.stylize(message, "undefined"));
+ index = tmp;
+ if (output.length === maxLength) {
+ break;
+ }
+ }
+ ArrayPrototypePush(output, formatProperty(ctx, value, recurseTimes, key, kArrayType));
+ index++;
+ }
+ const remaining = value.length - index;
+ if (output.length !== maxLength) {
+ if (remaining > 0) {
+ const ending = remaining > 1 ? "s" : "";
+ const message = `<${remaining} empty item${ending}>`;
+ ArrayPrototypePush(output, ctx.stylize(message, "undefined"));
+ }
+ } else if (remaining > 0) {
+ ArrayPrototypePush(output, remainingText(remaining));
+ }
+ return output;
+}
+
+function hexSlice(buf, start = 0, end) {
+ return ArrayPrototypeJoin(
+ ArrayPrototypeMap(buf.slice(start, end), x => ("00" + x.toString(16)).slice(-2)),
+ "",
+ );
+}
+
+function formatArrayBuffer(ctx, value) {
+ let buffer;
+ try {
+ buffer = new Uint8Array(value);
+ } catch {
+ return [ctx.stylize("(detached)", "special")];
+ }
+ let str = StringPrototypeTrim(
+ RegExpPrototypeSymbolReplace(/(.{2})/g, hexSlice(buffer, 0, MathMin(ctx.maxArrayLength, buffer.length)), "$1 "),
+ );
+ const remaining = buffer.length - ctx.maxArrayLength;
+ if (remaining > 0) str += ` ... ${remaining} more byte${remaining > 1 ? "s" : ""}`;
+ return [`${ctx.stylize("[Uint8Contents]", "special")}: <${str}>`];
+}
+
+function formatArray(ctx, value, recurseTimes) {
+ const valLen = value.length;
+ const len = MathMin(MathMax(0, ctx.maxArrayLength), valLen);
+
+ const remaining = valLen - len;
+ const output = [];
+ for (let i = 0; i < len; i++) {
+ // Special handle sparse arrays.
+ if (!ObjectPrototypeHasOwnProperty(value, i)) {
+ return formatSpecialArray(ctx, value, recurseTimes, len, output, i);
+ }
+ ArrayPrototypePush(output, formatProperty(ctx, value, recurseTimes, i, kArrayType));
+ }
+ if (remaining > 0) {
+ ArrayPrototypePush(output, remainingText(remaining));
+ }
+ return output;
+}
+
+function formatTypedArray(value, length, ctx, ignored, recurseTimes) {
+ const maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length);
+ const remaining = value.length - maxLength;
+ const output = new Array(maxLength);
+ const elementFormatter = value.length > 0 && typeof value[0] === "number" ? formatNumber : formatBigInt;
+ for (let i = 0; i < maxLength; ++i) {
+ output[i] = elementFormatter(ctx.stylize, value[i], ctx.numericSeparator);
+ }
+ if (remaining > 0) {
+ output[maxLength] = remainingText(remaining);
+ }
+ if (ctx.showHidden) {
+ // .buffer goes last, it's not a primitive like the others.
+ // All besides `BYTES_PER_ELEMENT` are actually getters.
+ ctx.indentationLvl += 2;
+ for (const key of ["BYTES_PER_ELEMENT", "length", "byteLength", "byteOffset", "buffer"]) {
+ const str = formatValue(ctx, value[key], recurseTimes, true);
+ ArrayPrototypePush(output, `[${key}]: ${str}`);
+ }
+ ctx.indentationLvl -= 2;
+ }
+ return output;
+}
+
+function formatSet(value, ctx, ignored, recurseTimes) {
+ const length = value.size;
+ const maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length);
+ const remaining = length - maxLength;
+ const output = [];
+ ctx.indentationLvl += 2;
+ let i = 0;
+ for (const v of value) {
+ if (i >= maxLength) break;
+ ArrayPrototypePush(output, formatValue(ctx, v, recurseTimes));
+ i++;
+ }
+ if (remaining > 0) {
+ ArrayPrototypePush(output, remainingText(remaining));
+ }
+ ctx.indentationLvl -= 2;
+ return output;
+}
+
+function formatMap(value, ctx, ignored, recurseTimes) {
+ const length = value.size;
+ const maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length);
+ const remaining = length - maxLength;
+ const output = [];
+ ctx.indentationLvl += 2;
+ let i = 0;
+ for (const { 0: k, 1: v } of value) {
+ if (i >= maxLength) break;
+ ArrayPrototypePush(output, `${formatValue(ctx, k, recurseTimes)} => ${formatValue(ctx, v, recurseTimes)}`);
+ i++;
+ }
+ if (remaining > 0) {
+ ArrayPrototypePush(output, remainingText(remaining));
+ }
+ ctx.indentationLvl -= 2;
+ return output;
+}
+
+function formatSetIterInner(ctx, recurseTimes, entries, state) {
+ const maxArrayLength = MathMax(ctx.maxArrayLength, 0);
+ const maxLength = MathMin(maxArrayLength, entries.length);
+ const output = new Array(maxLength);
+ ctx.indentationLvl += 2;
+ for (let i = 0; i < maxLength; i++) {
+ output[i] = formatValue(ctx, entries[i], recurseTimes);
+ }
+ ctx.indentationLvl -= 2;
+ if (state === kWeak && !ctx.sorted) {
+ // Sort all entries to have a halfway reliable output (if more entries than
+ // retrieved ones exist, we can not reliably return the same output) if the
+ // output is not sorted anyway.
+ ArrayPrototypeSort(output);
+ }
+ const remaining = entries.length - maxLength;
+ if (remaining > 0) {
+ ArrayPrototypePush(output, remainingText(remaining));
+ }
+ return output;
+}
+
+function formatMapIterInner(ctx, recurseTimes, entries, state) {
+ const maxArrayLength = MathMax(ctx.maxArrayLength, 0);
+ // Entries exist as [key1, val1, key2, val2, ...]
+ const len = entries.length / 2;
+ const remaining = len - maxArrayLength;
+ const maxLength = MathMin(maxArrayLength, len);
+ const output = new Array(maxLength);
+ let i = 0;
+ ctx.indentationLvl += 2;
+ if (state === kWeak) {
+ for (; i < maxLength; i++) {
+ const pos = i * 2;
+ output[i] = `${formatValue(ctx, entries[pos], recurseTimes)} => ${formatValue(
+ ctx,
+ entries[pos + 1],
+ recurseTimes,
+ )}`;
+ }
+ // Sort all entries to have a halfway reliable output (if more entries than
+ // retrieved ones exist, we can not reliably return the same output) if the
+ // output is not sorted anyway.
+ if (!ctx.sorted) ArrayPrototypeSort(output);
+ } else {
+ for (; i < maxLength; i++) {
+ const pos = i * 2;
+ const res = [formatValue(ctx, entries[pos], recurseTimes), formatValue(ctx, entries[pos + 1], recurseTimes)];
+ output[i] = reduceToSingleString(ctx, res, "", ["[", "]"], kArrayExtrasType, recurseTimes);
+ }
+ }
+ ctx.indentationLvl -= 2;
+ if (remaining > 0) {
+ ArrayPrototypePush(output, remainingText(remaining));
+ }
+ return output;
+}
+
+function formatWeakCollection(ctx) {
+ return [ctx.stylize("<items unknown>", "special")];
+}
+
+function formatWeakSet(ctx, value, recurseTimes) {
+ const entries = previewEntries(value);
+ return formatSetIterInner(ctx, recurseTimes, entries, kWeak);
+}
+
+function formatWeakMap(ctx, value, recurseTimes) {
+ const entries = previewEntries(value);
+ return formatMapIterInner(ctx, recurseTimes, entries, kWeak);
+}
+
+function formatIterator(braces, ctx, value, recurseTimes) {
+ const { 0: entries, 1: isKeyValue } = previewEntries(value, true);
+ if (isKeyValue) {
+ // TODO(bun): JSC can also differ between the keys and values iterator, maybe we should also distinguish those in the future?
+ // Mark entry iterators as such.
+ braces[0] = RegExpPrototypeSymbolReplace(/ Iterator] {$/, braces[0], " Entries] {");
+ return formatMapIterInner(ctx, recurseTimes, entries, kMapEntries);
+ }
+
+ return formatSetIterInner(ctx, recurseTimes, entries, kIterator);
+}
+
+function formatPromise(ctx, value, recurseTimes) {
+ let output;
+ const { 0: state, 1: result } = getPromiseDetails(value);
+ if (state === kPending) {
+ output = [ctx.stylize("<pending>", "special")];
+ } else {
+ ctx.indentationLvl += 2;
+ const str = formatValue(ctx, result, recurseTimes);
+ ctx.indentationLvl -= 2;
+ output = [state === kRejected ? `${ctx.stylize("<rejected>", "special")} ${str}` : str];
+ }
+ return output;
+}
+
+function formatProperty(ctx, value, recurseTimes, key, type, desc, original = value) {
+ let name, str;
+ let extra = " ";
+ desc ||= ObjectGetOwnPropertyDescriptor(value, key) || { value: value[key], enumerable: true };
+ if (desc.value !== undefined) {
+ const diff = ctx.compact !== true || type !== kObjectType ? 2 : 3;
+ ctx.indentationLvl += diff;
+ str = formatValue(ctx, desc.value, recurseTimes);
+ if (diff === 3 && ctx.breakLength < getStringWidth(str, ctx.colors)) {
+ extra = `\n${StringPrototypeRepeat(" ", ctx.indentationLvl)}`;
+ }
+ ctx.indentationLvl -= diff;
+ } else if (desc.get !== undefined) {
+ const label = desc.set !== undefined ? "Getter/Setter" : "Getter";
+ const s = ctx.stylize;
+ const sp = "special";
+ if (
+ ctx.getters &&
+ (ctx.getters === true ||
+ (ctx.getters === "get" && desc.set === undefined) ||
+ (ctx.getters === "set" && desc.set !== undefined))
+ ) {
+ try {
+ const tmp = desc.get.$call(original);
+ ctx.indentationLvl += 2;
+ if (tmp === null) {
+ str = `${s(`[${label}:`, sp)} ${s("null", "null")}${s("]", sp)}`;
+ } else if (typeof tmp === "object") {
+ str = `${s(`[${label}]`, sp)} ${formatValue(ctx, tmp, recurseTimes)}`;
+ } else {
+ const primitive = formatPrimitive(s, tmp, ctx);
+ str = `${s(`[${label}:`, sp)} ${primitive}${s("]", sp)}`;
+ }
+ ctx.indentationLvl -= 2;
+ } catch (err) {
+ const message = `<Inspection threw (${err.message})>`;
+ str = `${s(`[${label}:`, sp)} ${message}${s("]", sp)}`;
+ }
+ } else {
+ str = ctx.stylize(`[${label}]`, sp);
+ }
+ } else if (desc.set !== undefined) {
+ str = ctx.stylize("[Setter]", "special");
+ } else {
+ str = ctx.stylize("undefined", "undefined");
+ }
+ if (type === kArrayType) return str;
+ if (typeof key === "symbol") {
+ const tmp = RegExpPrototypeSymbolReplace(strEscapeSequencesReplacer, SymbolPrototypeToString(key), escapeFn);
+ name = `[${ctx.stylize(tmp, "symbol")}]`;
+ } else if (key === "__proto__") {
+ name = "['__proto__']";
+ } else if (desc.enumerable === false) {
+ const tmp = RegExpPrototypeSymbolReplace(strEscapeSequencesReplacer, key, escapeFn);
+ name = `[${tmp}]`;
+ } else if (RegExpPrototypeExec(keyStrRegExp, key) !== null) {
+ name = ctx.stylize(key, "name");
+ } else {
+ name = ctx.stylize(strEscape(key), "string");
+ }
+ return `${name}:${extra}${str}`;
+}
+
+function isBelowBreakLength(ctx, output, start, base) {
+ // Each entry is separated by at least a comma. Thus, we start with a total
+ // length of at least `output.length`. In addition, some cases have a
+ // whitespace in-between each other that is added to the total as well.
+ // TODO(BridgeAR): Add unicode support. Use the readline getStringWidth
+ // function. Check the performance overhead and make it an opt-in in case it's significant.
+ let totalLength = output.length + start;
+ if (totalLength + output.length > ctx.breakLength) return false;
+ for (let i = 0; i < output.length; i++) {
+ if (ctx.colors) {
+ totalLength += StringPrototypeReplaceAll(output[i], /\u001B\[\d\d?m/g, "").length; // remove colors
+ } else {
+ totalLength += output[i].length;
+ }
+ if (totalLength > ctx.breakLength) {
+ return false;
+ }
+ }
+ // Do not line up properties on the same line if `base` contains line breaks.
+ return base === "" || !StringPrototypeIncludes(base, "\n");
+}
+
+function reduceToSingleString(ctx, output, base, braces, extrasType, recurseTimes, value) {
+ if (ctx.compact !== true) {
+ if (typeof ctx.compact === "number" && ctx.compact >= 1) {
+ // Memorize the original output length. In case the output is grouped,
+ // prevent lining up the entries on a single line.
+ const entries = output.length;
+ // Group array elements together if the array contains at least six
+ // separate entries.
+ if (extrasType === kArrayExtrasType && entries > 6) {
+ output = groupArrayElements(ctx, output, value);
+ }
+ // `ctx.currentDepth` is set to the most inner depth of the currently
+ // inspected object part while `recurseTimes` is the actual current depth
+ // that is inspected.
+ //
+ // Example:
+ //
+ // const a = { first: [ 1, 2, 3 ], second: { inner: [ 1, 2, 3 ] } }
+ //
+ // The deepest depth of `a` is 2 (a.second.inner) and `a.first` has a max
+ // depth of 1.
+ //
+ // Consolidate all entries of the local most inner depth up to
+ // `ctx.compact`, as long as the properties are smaller than
+ // `ctx.breakLength`.
+ if (ctx.currentDepth - recurseTimes < ctx.compact && entries === output.length) {
+ // Line up all entries on a single line in case the entries do not
+ // exceed `breakLength`. Add 10 as constant to start next to all other
+ // factors that may reduce `breakLength`.
+ const start = output.length + ctx.indentationLvl + braces[0].length + base.length + 10;
+ if (isBelowBreakLength(ctx, output, start, base)) {
+ const joinedOutput = ArrayPrototypeJoin(output, ", ");
+ if (!StringPrototypeIncludes(joinedOutput, "\n")) {
+ return `${base ? `${base} ` : ""}${braces[0]} ${joinedOutput}` + ` ${braces[1]}`;
+ }
+ }
+ }
+ }
+ // Line up each entry on an individual line.
+ const indentation = `\n${StringPrototypeRepeat(" ", ctx.indentationLvl)}`;
+ return (
+ `${base ? `${base} ` : ""}${braces[0]}${indentation} ` +
+ `${ArrayPrototypeJoin(output, `,${indentation} `)}${indentation}${braces[1]}`
+ );
+ }
+ // Line up all entries on a single line in case the entries do not exceed
+ // `breakLength`.
+ if (isBelowBreakLength(ctx, output, 0, base)) {
+ return `${braces[0]}${base ? ` ${base}` : ""} ${ArrayPrototypeJoin(output, ", ")} ` + braces[1];
+ }
+ const indentation = StringPrototypeRepeat(" ", ctx.indentationLvl);
+ // If the opening "brace" is too large, like in the case of "Set {",
+ // we need to force the first item to be on the next line or the
+ // items will not line up correctly.
+ const ln = base === "" && braces[0].length === 1 ? " " : `${base ? ` ${base}` : ""}\n${indentation} `;
+ // Line up each entry on an individual line.
+ return `${braces[0]}${ln}${ArrayPrototypeJoin(output, `,\n${indentation} `)} ${braces[1]}`;
+}
+
+function hasBuiltInToString(value) {
+ // Prevent triggering proxy traps.
+ const proxyTarget = getProxyDetails(value, false);
+ if (proxyTarget !== undefined) {
+ if (proxyTarget === null) return true;
+ value = proxyTarget;
+ }
+
+ // Count objects that have no `toString` function as built-in.
+ if (typeof value.toString !== "function") return true;
+
+ // The object has a own `toString` property. Thus it's not not a built-in one.
+ if (ObjectPrototypeHasOwnProperty(value, "toString")) return false;
+
+ // Find the object that has the `toString` property as own property in the prototype chain.
+ let pointer = value;
+ do {
+ pointer = ObjectGetPrototypeOf(pointer);
+ } while (!ObjectPrototypeHasOwnProperty(pointer, "toString"));
+
+ // Check closer if the object is a built-in.
+ const descriptor = ObjectGetOwnPropertyDescriptor(pointer, "constructor");
+ return (
+ descriptor !== undefined && typeof descriptor.value === "function" && builtInObjects.has(descriptor.value.name)
+ );
+}
+
+const firstErrorLine = error => StringPrototypeSplit(error.message, "\n", 1)[0];
+let CIRCULAR_ERROR_MESSAGE;
+function tryStringify(arg) {
+ try {
+ return JSONStringify(arg);
+ } catch (err) {
+ // Populate the circular error message lazily
+ if (!CIRCULAR_ERROR_MESSAGE) {
+ try {
+ const a = {};
+ a.a = a;
+ JSONStringify(a);
+ } catch (circularError) {
+ CIRCULAR_ERROR_MESSAGE = firstErrorLine(circularError);
+ }
+ }
+ if (err.name === "TypeError" && firstErrorLine(err) === CIRCULAR_ERROR_MESSAGE) {
+ return "[Circular]";
+ }
+ throw err;
+ }
+}
+
+function format(...args) {
+ return formatWithOptionsInternal(undefined, args);
+}
+
+function formatWithOptions(inspectOptions, ...args) {
+ validateObject(inspectOptions, "inspectOptions", { allowArray: true });
+ return formatWithOptionsInternal(inspectOptions, args);
+}
+
+function formatNumberNoColor(number, options) {
+ return formatNumber(stylizeNoColor, number, options?.numericSeparator ?? inspectDefaultOptions.numericSeparator);
+}
+
+function formatBigIntNoColor(bigint, options) {
+ return formatBigInt(stylizeNoColor, bigint, options?.numericSeparator ?? inspectDefaultOptions.numericSeparator);
+}
+
+function formatWithOptionsInternal(inspectOptions, args) {
+ const first = args[0];
+ let a = 0;
+ let str = "";
+ let join = "";
+
+ if (typeof first === "string") {
+ if (args.length === 1) {
+ return first;
+ }
+ let tempStr;
+ let lastPos = 0;
+
+ for (let i = 0; i < first.length - 1; i++) {
+ if (StringPrototypeCharCodeAt(first, i) === 37) {
+ // '%'
+ const nextChar = StringPrototypeCharCodeAt(first, ++i);
+ if (a + 1 !== args.length) {
+ switch (nextChar) {
+ case 115: {
+ // 's'
+ const tempArg = args[++a];
+ if (typeof tempArg === "number") {
+ tempStr = formatNumberNoColor(tempArg, inspectOptions);
+ } else if (typeof tempArg === "bigint") {
+ tempStr = formatBigIntNoColor(tempArg, inspectOptions);
+ } else if (typeof tempArg !== "object" || tempArg === null || !hasBuiltInToString(tempArg)) {
+ tempStr = String(tempArg);
+ } else {
+ tempStr = inspect(tempArg, {
+ ...inspectOptions,
+ compact: 3,
+ colors: false,
+ depth: 0,
+ });
+ }
+ break;
+ }
+ case 106: // 'j'
+ tempStr = tryStringify(args[++a]);
+ break;
+ case 100: {
+ // 'd'
+ const tempNum = args[++a];
+ if (typeof tempNum === "bigint") {
+ tempStr = formatBigIntNoColor(tempNum, inspectOptions);
+ } else if (typeof tempNum === "symbol") {
+ tempStr = "NaN";
+ } else {
+ tempStr = formatNumberNoColor(Number(tempNum), inspectOptions);
+ }
+ break;
+ }
+ case 79: // 'O'
+ tempStr = inspect(args[++a], inspectOptions);
+ break;
+ case 111: // 'o'
+ tempStr = inspect(args[++a], {
+ ...inspectOptions,
+ showHidden: true,
+ showProxy: true,
+ depth: 4,
+ });
+ break;
+ case 105: {
+ // 'i'
+ const tempInteger = args[++a];
+ if (typeof tempInteger === "bigint") {
+ tempStr = formatBigIntNoColor(tempInteger, inspectOptions);
+ } else if (typeof tempInteger === "symbol") {
+ tempStr = "NaN";
+ } else {
+ tempStr = formatNumberNoColor(NumberParseInt(tempInteger), inspectOptions);
+ }
+ break;
+ }
+ case 102: {
+ // 'f'
+ const tempFloat = args[++a];
+ if (typeof tempFloat === "symbol") {
+ tempStr = "NaN";
+ } else {
+ tempStr = formatNumberNoColor(NumberParseFloat(tempFloat), inspectOptions);
+ }
+ break;
+ }
+ case 99: // 'c'
+ a += 1;
+ tempStr = "";
+ break;
+ case 37: // '%'
+ str += StringPrototypeSlice(first, lastPos, i);
+ lastPos = i + 1;
+ continue;
+ default: // Any other character is not a correct placeholder
+ continue;
+ }
+ if (lastPos !== i - 1) {
+ str += StringPrototypeSlice(first, lastPos, i - 1);
+ }
+ str += tempStr;
+ lastPos = i + 1;
+ } else if (nextChar === 37) {
+ str += StringPrototypeSlice(first, lastPos, i);
+ lastPos = i + 1;
+ }
+ }
+ }
+ if (lastPos !== 0) {
+ a++;
+ join = " ";
+ if (lastPos < first.length) {
+ str += StringPrototypeSlice(first, lastPos);
+ }
+ }
+ }
+
+ while (a < args.length) {
+ const value = args[a];
+ str += join;
+ str += typeof value !== "string" ? inspect(value, inspectOptions) : value;
+ join = " ";
+ a++;
+ }
+ return str;
+}
+
+function isZeroWidthCodePoint(code) {
+ return (
+ code <= 0x1f || // C0 control codes
+ (code >= 0x7f && code <= 0x9f) || // C1 control codes
+ (code >= 0x300 && code <= 0x36f) || // Combining Diacritical Marks
+ (code >= 0x200b && code <= 0x200f) || // Modifying Invisible Characters
+ // Combining Diacritical Marks for Symbols
+ (code >= 0x20d0 && code <= 0x20ff) ||
+ (code >= 0xfe00 && code <= 0xfe0f) || // Variation Selectors
+ (code >= 0xfe20 && code <= 0xfe2f) || // Combining Half Marks
+ (code >= 0xe0100 && code <= 0xe01ef)
+ ); // Variation Selectors
+}
+
+{
+ /**
+ * Returns the number of columns required to display the given string.
+ */
+ getStringWidth = function getStringWidth(str, removeControlChars = true) {
+ let width = 0;
+
+ if (removeControlChars) str = stripVTControlCharacters(str);
+ str = StringPrototypeNormalize(str, "NFC");
+ for (const char of new SafeStringIterator(str)) {
+ const code = StringPrototypeCodePointAt(char, 0);
+ if (isFullWidthCodePoint(code)) {
+ width += 2;
+ } else if (!isZeroWidthCodePoint(code)) {
+ width++;
+ }
+ }
+
+ return width;
+ };
+
+ /**
+ * Returns true if the character represented by a given
+ * Unicode code point is full-width. Otherwise returns false.
+ */
+ const isFullWidthCodePoint = code => {
+ // Code points are partially derived from:
+ // https://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt
+ return (
+ code >= 0x1100 &&
+ (code <= 0x115f || // Hangul Jamo
+ code === 0x2329 || // LEFT-POINTING ANGLE BRACKET
+ code === 0x232a || // RIGHT-POINTING ANGLE BRACKET
+ // CJK Radicals Supplement .. Enclosed CJK Letters and Months
+ (code >= 0x2e80 && code <= 0x3247 && code !== 0x303f) ||
+ // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
+ (code >= 0x3250 && code <= 0x4dbf) ||
+ // CJK Unified Ideographs .. Yi Radicals
+ (code >= 0x4e00 && code <= 0xa4c6) ||
+ // Hangul Jamo Extended-A
+ (code >= 0xa960 && code <= 0xa97c) ||
+ // Hangul Syllables
+ (code >= 0xac00 && code <= 0xd7a3) ||
+ // CJK Compatibility Ideographs
+ (code >= 0xf900 && code <= 0xfaff) ||
+ // Vertical Forms
+ (code >= 0xfe10 && code <= 0xfe19) ||
+ // CJK Compatibility Forms .. Small Form Variants
+ (code >= 0xfe30 && code <= 0xfe6b) ||
+ // Halfwidth and Fullwidth Forms
+ (code >= 0xff01 && code <= 0xff60) ||
+ (code >= 0xffe0 && code <= 0xffe6) ||
+ // Kana Supplement
+ (code >= 0x1b000 && code <= 0x1b001) ||
+ // Enclosed Ideographic Supplement
+ (code >= 0x1f200 && code <= 0x1f251) ||
+ // Miscellaneous Symbols and Pictographs 0x1f300 - 0x1f5ff
+ // Emoticons 0x1f600 - 0x1f64f
+ (code >= 0x1f300 && code <= 0x1f64f) ||
+ // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
+ (code >= 0x20000 && code <= 0x3fffd))
+ );
+ };
+}
+
+// Regex used for ansi escape code splitting
+// Adopted from https://github.com/chalk/ansi-regex/blob/HEAD/index.js
+// License: MIT, authors: @sindresorhus, Qix-, arjunmehta and LitoMore
+// Matches all ansi escape code sequences in a string
+const ansiPattern =
+ "[\\u001B\\u009B][[\\]()#;?]*" +
+ "(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*" +
+ "|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)" +
+ "|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))";
+const ansi = new RegExp(ansiPattern, "g");
+/** Remove all VT control characters. Use to estimate displayed string width. */
+function stripVTControlCharacters(str) {
+ if (typeof str !== "string") throw new codes.ERR_INVALID_ARG_TYPE("str", "string", str);
+ return RegExpPrototypeSymbolReplace(ansi, str, "");
+}
+
+// utils
+function getOwnNonIndexProperties(a, filter = ONLY_ENUMERABLE) {
+ const desc = ObjectGetOwnPropertyDescriptors(a);
+ const ret = [];
+ for (const [k, v] of ObjectEntries(desc)) {
+ if (!RegExpPrototypeTest(/^(0|[1-9][0-9]*)$/, k) || NumberParseInt(k, 10) >= 2 ** 32 - 1) {
+ // Arrays are limited in size
+ if (filter === ONLY_ENUMERABLE && !v.enumerable) continue;
+ else ArrayPrototypePush(ret, k);
+ }
+ }
+ for (const s of ObjectGetOwnPropertySymbols(a)) {
+ const v = ObjectGetOwnPropertyDescriptor(a, s);
+ if (filter === ONLY_ENUMERABLE && !v.enumerable) continue;
+ ArrayPrototypePush(ret, s);
+ }
+ return ret;
+}
+function getPromiseDetails(promise) {
+ const state = $getPromiseInternalField(promise, $promiseFieldFlags) & $promiseStateMask;
+ if (state !== $promiseStatePending) {
+ return [
+ state === $promiseStateRejected ? kRejected : kFulfilled,
+ $getPromiseInternalField(promise, $promiseFieldReactionsOrResult),
+ ];
+ }
+ return [kPending, undefined];
+}
+function getProxyDetails(proxy, withHandler = true) {
+ const isProxy = $isProxyObject(proxy);
+ if (!isProxy) return undefined;
+ const handler = $getProxyInternalField(proxy, $proxyFieldHandler);
+ // if handler is null, the proxy is revoked
+ const target = handler === null ? null : $getProxyInternalField(proxy, $proxyFieldTarget);
+ if (withHandler) return [target, handler];
+ else return target;
+}
+function previewEntries(val, isIterator = false) {
+ if (isIterator) {
+ // the Map or Set instance this iterator belongs to
+ const iteratedObject = $getInternalField(val, 1 /*iteratorFieldIteratedObject*/);
+ // for Maps: 0 = keys, 1 = values, 2 = entries
+ // for Sets: 1 = keys|values, 2 = entries
+ const kind = $getInternalField(val, 2 /*iteratorFieldKind*/);
+ const isEntries = kind === 2;
+ // TODO(bun): improve performance by not using Array.from and instead using the iterator directly to only get the first
+ // few entries which will actually be displayed (this requires changing some logic in the call sites of this function)
+ if ($isMap(iteratedObject)) {
+ if (isEntries) return [ArrayPrototypeFlat(ArrayFrom(iteratedObject)), true];
+ else if (kind === 1) return [ArrayFrom(MapPrototypeValues(iteratedObject)), false];
+ else return [ArrayFrom(MapPrototypeKeys(iteratedObject)), false];
+ } else if ($isSet(iteratedObject)) {
+ if (isEntries) return [ArrayPrototypeFlat(ArrayFrom(SetPrototypeEntries(iteratedObject))), true];
+ else return [ArrayFrom(iteratedObject), false];
+ }
+ // TODO(bun): This function is currently only called for Map and Set iterators
+ // perhaps we should add support for other iterators in the future? (e.g. ArrayIterator and StringIterator)
+ else throw new Error("previewEntries(): Invalid iterator received");
+ }
+ // TODO(bun): are there any JSC APIs for viewing the contents of these in JS?
+ if (isWeakMap(val)) return [];
+ if (isWeakSet(val)) return [];
+ else throw new Error("previewEntries(): Invalid object received");
+}
+function internalGetConstructorName(val) {
+ if (!val || typeof val !== "object") throw new Error("Invalid object");
+ if (val.constructor?.name) return val.constructor.name;
+ const str = ObjectPrototypeToString(val);
+ const m = StringPrototypeMatch(str, /^\[object ([^\]]+)\]/); // e.g. [object Boolean]
+ return m ? m[1] : "Object";
+}
+
+export default {
+ inspect,
+ format,
+ formatWithOptions,
+ stripVTControlCharacters,
+ //! non-standard properties, should these be kept? (not currently exposed)
+ //stylizeWithColor,
+ //stylizeWithHTML(str, styleType) {
+ // const style = inspect.styles[styleType];
+ // if (style !== undefined) {
+ // return `<span style="color:${style};">${escapeHTML(str)}</span>`;
+ // }
+ // return escapeHTML(str);
+ //},
+};
+
+// unused without `stylizeWithHTML`
+/*const entities = {
+ 34: "&quot;",
+ 38: "&amp;",
+ 39: "&apos;",
+ 60: "&lt;",
+ 62: "&gt;",
+ 160: "&nbsp;",
+};
+function escapeHTML(str) {
+ return str.replace(/[\u0000-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u00FF]/g, c => {
+ const code = String(c.charCodeAt(0));
+ const ent = entities[code];
+ return ent || "&#" + code + ";";
+ });
+}*/
diff --git a/src/js/node/assert.js b/src/js/node/assert.js
index 475f72006..75b7057b3 100644
--- a/src/js/node/assert.js
+++ b/src/js/node/assert.js
@@ -79,7 +79,7 @@ var require_errors = __commonJS({
_classCallCheck(this, NodeError2),
(_this = _possibleConstructorReturn(
this,
- _getPrototypeOf(NodeError2).call(this, getMessage(arg1, arg2, arg3)),
+ _getPrototypeOf(NodeError2).$call(this, getMessage(arg1, arg2, arg3)),
)),
(_this.code = code),
_this
@@ -298,7 +298,7 @@ var require_assertion_error = __commonJS({
if (typeof Reflect == "undefined" || !Reflect.construct || Reflect.construct.sham) return !1;
if (typeof Proxy == "function") return !0;
try {
- return Date.prototype.toString.call(Reflect.construct(Date, [], function () {})), !0;
+ return Date.prototype.toString.$call(Reflect.construct(Date, [], function () {})), !0;
} catch {
return !1;
}
@@ -309,16 +309,16 @@ var require_assertion_error = __commonJS({
? (_construct = Reflect.construct)
: (_construct = function (Parent2, args2, Class2) {
var a = [null];
- a.push.apply(a, args2);
- var Constructor = Function.bind.apply(Parent2, a),
+ a.push.$apply(a, args2);
+ var Constructor = Function.bind.$apply(Parent2, a),
instance = new Constructor();
return Class2 && _setPrototypeOf(instance, Class2.prototype), instance;
}),
- _construct.apply(null, arguments)
+ _construct.$apply(null, arguments)
);
}
function _isNativeFunction(fn) {
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
+ return Function.toString.$call(fn).indexOf("[native code]") !== -1;
}
function _setPrototypeOf(o, p) {
return (
@@ -663,7 +663,7 @@ var require_assertion_error = __commonJS({
expected = options.expected,
limit = Error.stackTraceLimit;
if (((Error.stackTraceLimit = 0), message != null))
- _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, String(message)));
+ _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).$call(this, String(message)));
else if (
(process.stderr &&
process.stderr.isTTY &&
@@ -683,7 +683,7 @@ var require_assertion_error = __commonJS({
)
_this = _possibleConstructorReturn(
this,
- _getPrototypeOf(AssertionError2).call(this, createErrDiff(actual, expected, operator)),
+ _getPrototypeOf(AssertionError2).$call(this, createErrDiff(actual, expected, operator)),
);
else if (operator === "notDeepStrictEqual" || operator === "notStrictEqual") {
var base = kReadableOperator[operator],
@@ -700,11 +700,11 @@ var require_assertion_error = __commonJS({
res.length === 1
? (_this = _possibleConstructorReturn(
this,
- _getPrototypeOf(AssertionError2).call(this, "".concat(base, " ").concat(res[0])),
+ _getPrototypeOf(AssertionError2).$call(this, "".concat(base, " ").concat(res[0])),
))
: (_this = _possibleConstructorReturn(
this,
- _getPrototypeOf(AssertionError2).call(
+ _getPrototypeOf(AssertionError2).$call(
this,
""
.concat(
@@ -757,7 +757,7 @@ should equal
: (other = " ".concat(operator, " ").concat(other))),
(_this = _possibleConstructorReturn(
this,
- _getPrototypeOf(AssertionError2).call(this, "".concat(_res).concat(other)),
+ _getPrototypeOf(AssertionError2).$call(this, "".concat(_res).concat(other)),
));
}
return (
@@ -902,7 +902,7 @@ var require_assert = __commonJS({
function ok() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)
args[_key] = arguments[_key];
- innerOk.apply(void 0, [ok, args.length].concat(args));
+ innerOk.$apply(void 0, [ok, args.length].concat(args));
}
assert.ok = ok;
assert.equal = function equal(actual, expected, message) {
@@ -1071,7 +1071,7 @@ var require_assert = __commonJS({
? !0
: Error.isPrototypeOf(expected)
? !1
- : expected.call({}, actual) === !0;
+ : expected.$call({}, actual) === !0;
}
function getActual(fn) {
if (typeof fn != "function") throw new ERR_INVALID_ARG_TYPE("fn", "Function", fn);
@@ -1168,25 +1168,25 @@ var require_assert = __commonJS({
assert.throws = function throws(promiseFn) {
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++)
args[_key2 - 1] = arguments[_key2];
- expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));
+ expectsError.$apply(void 0, [throws, getActual(promiseFn)].concat(args));
};
assert.rejects = function rejects(promiseFn) {
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++)
args[_key3 - 1] = arguments[_key3];
return waitForActual(promiseFn).then(function (result) {
- return expectsError.apply(void 0, [rejects, result].concat(args));
+ return expectsError.$apply(void 0, [rejects, result].concat(args));
});
};
assert.doesNotThrow = function doesNotThrow(fn) {
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++)
args[_key4 - 1] = arguments[_key4];
- expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));
+ expectsNoError.$apply(void 0, [doesNotThrow, getActual(fn)].concat(args));
};
assert.doesNotReject = function doesNotReject(fn) {
for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++)
args[_key5 - 1] = arguments[_key5];
return waitForActual(fn).then(function (result) {
- return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));
+ return expectsNoError.$apply(void 0, [doesNotReject, result].concat(args));
});
};
assert.ifError = function ifError(err) {
@@ -1240,7 +1240,7 @@ var require_assert = __commonJS({
function strict() {
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++)
args[_key6] = arguments[_key6];
- innerOk.apply(void 0, [strict, args.length].concat(args));
+ innerOk.$apply(void 0, [strict, args.length].concat(args));
}
assert.strict = objectAssign(strict, assert, {
equal: assert.strictEqual,
diff --git a/src/js/node/async_hooks.ts b/src/js/node/async_hooks.ts
index ef77b79f7..20d82f5e5 100644
--- a/src/js/node/async_hooks.ts
+++ b/src/js/node/async_hooks.ts
@@ -10,7 +10,7 @@
//
// This means context tracking is *kind-of* manual. If we recieve a callback in native code
// - In Zig, call jsValue.withAsyncContextIfNeeded(); which returns another JSValue. Store that and
-// then run .call() on it later.
+// then run .$call() on it later.
// - In C++, call AsyncContextFrame::withAsyncContextIfNeeded(jsValue). Then to call it,
// use AsyncContextFrame:: call(...) instead of JSC:: call.
//
@@ -19,17 +19,55 @@
// use. But the nature of this approach makes the implementation *itself* very low-impact on performance.
//
// AsyncContextData is an immutable array managed in here, formatted [key, value, key, value] where
-// each key is an AsyncLocalStorage object and the value is the associated value.
+// each key is an AsyncLocalStorage object and the value is the associated value. There are a ton of
+// calls to $assert which will verify this invariant (only during bun-debug)
//
const { cleanupLater, setAsyncHooksEnabled } = $lazy("async_hooks");
+// Only run during debug
+function assertValidAsyncContextArray(array: unknown): array is ReadonlyArray<any> | undefined {
+ // undefined is OK
+ if (array === undefined) return true;
+ // Otherwise, it must be an array
+ $assert(
+ Array.isArray(array),
+ "AsyncContextData must be an array or undefined, got",
+ Bun.inspect(array, { depth: 1 }),
+ );
+ // the array has to be even
+ $assert(array.length % 2 === 0, "AsyncContextData should be even-length, got", Bun.inspect(array, { depth: 1 }));
+ // if it is zero-length, use undefined instead
+ $assert(array.length > 0, "AsyncContextData should be undefined if empty, got", Bun.inspect(array, { depth: 1 }));
+ for (var i = 0; i < array.length; i += 2) {
+ $assert(
+ array[i] instanceof AsyncLocalStorage,
+ `Odd indexes in AsyncContextData should be an array of AsyncLocalStorage\nIndex %s was %s`,
+ i,
+ array[i],
+ );
+ }
+ return true;
+}
+
+// Only run during debug
+function debugFormatContextValue(value: ReadonlyArray<any> | undefined) {
+ if (value === undefined) return "undefined";
+ let str = "{\n";
+ for (var i = 0; i < value.length; i += 2) {
+ str += ` ${value[i].__id__}: typeof = ${typeof value[i + 1]}\n`;
+ }
+ str += "}";
+ return str;
+}
+
function get(): ReadonlyArray<any> | undefined {
- $debug("get", $getInternalField($asyncContext, 0));
+ $debug("get", debugFormatContextValue($getInternalField($asyncContext, 0)));
return $getInternalField($asyncContext, 0);
}
function set(contextValue: ReadonlyArray<any> | undefined) {
- $debug("set", contextValue);
+ $assert(assertValidAsyncContextArray(contextValue));
+ $debug("set", debugFormatContextValue(contextValue));
return $putInternalField($asyncContext, 0, contextValue);
}
@@ -38,6 +76,16 @@ class AsyncLocalStorage {
constructor() {
setAsyncHooksEnabled(true);
+
+ // In debug mode assign every AsyncLocalStorage a unique ID
+ if (IS_BUN_DEVELOPMENT) {
+ const uid = Math.random().toString(36).slice(2, 8);
+ const source = require("bun:jsc").callerSourceOrigin();
+
+ (this as any).__id__ = uid + "@" + require("node:path").basename(source);
+
+ $debug("new AsyncLocalStorage uid=", (this as any).__id__, source);
+ }
}
static bind(fn, ...args: any) {
@@ -67,8 +115,11 @@ class AsyncLocalStorage {
return;
}
var { length } = context;
+ $assert(length > 0);
+ $assert(length % 2 === 0);
for (var i = 0; i < length; i += 2) {
if (context[i] === this) {
+ $assert(length > i + 1);
const clone = context.slice();
clone[i + 1] = store;
set(clone);
@@ -76,33 +127,43 @@ class AsyncLocalStorage {
}
}
set(context.concat(this, store));
+ $assert(this.getStore() === store);
}
exit(cb, ...args) {
return this.run(undefined, cb, ...args);
}
- run(store, callback, ...args) {
+ // This function is literred with $asserts to ensure that everything that
+ // is assumed to be true is *actually* true.
+ run(store_value, callback, ...args) {
+ $debug("run " + (this as any).__id__);
var context = get() as any[]; // we make sure to .slice() before mutating
var hasPrevious = false;
- var previous;
+ var previous_value;
var i = 0;
- var contextWasInit = !context;
- if (contextWasInit) {
- set((context = [this, store]));
+ var contextWasAlreadyInit = !context;
+ if (contextWasAlreadyInit) {
+ set((context = [this, store_value]));
} else {
// it's safe to mutate context now that it was cloned
context = context!.slice();
i = context.indexOf(this);
if (i > -1) {
+ $assert(i % 2 === 0);
hasPrevious = true;
- previous = context[i + 1];
- context[i + 1] = store;
+ previous_value = context[i + 1];
+ context[i + 1] = store_value;
} else {
- context.push(this, store);
+ i = context.length;
+ context.push(this, store_value);
+ $assert(i % 2 === 0);
+ $assert(context.length % 2 === 0);
}
set(context);
}
+ $assert(i > -1, "i was not set");
+ $assert(this.getStore() === store_value, "run: store_value was not set");
try {
return callback(...args);
} catch (e) {
@@ -111,24 +172,36 @@ class AsyncLocalStorage {
// Note: early `return` will prevent `throw` above from working. I think...
// Set AsyncContextFrame to undefined if we are out of context values
if (!this.#disableCalled) {
- var context2 = get()! as any[];
- if (context2 === context && contextWasInit) {
+ var context2 = get()! as any[]; // we make sure to .slice() before mutating
+ if (context2 === context && contextWasAlreadyInit) {
+ $assert(context2.length === 2, "context was mutated without copy");
set(undefined);
} else {
context2 = context2.slice(); // array is cloned here
+ $assert(context2[i] === this);
if (hasPrevious) {
- context2[i + 1] = previous;
+ context2[i + 1] = previous_value;
set(context2);
} else {
+ // i wonder if this is a fair assert to make
context2.splice(i, 2);
+ $assert(context2.length % 2 === 0);
set(context2.length ? context2 : undefined);
}
}
+ $assert(
+ this.getStore() === previous_value,
+ "run: previous_value",
+ Bun.inspect(previous_value),
+ "was not restored, i see",
+ this.getStore(),
+ );
}
}
}
disable() {
+ $debug("disable " + (this as any).__id__);
// In this case, we actually do want to mutate the context state
if (!this.#disableCalled) {
var context = get() as any[];
@@ -147,6 +220,7 @@ class AsyncLocalStorage {
}
getStore() {
+ $debug("getStore " + (this as any).__id__);
var context = get();
if (!context) return;
var { length } = context;
@@ -156,11 +230,21 @@ class AsyncLocalStorage {
}
}
+if (IS_BUN_DEVELOPMENT) {
+ AsyncLocalStorage.prototype[Bun.inspect.custom] = function (depth, options) {
+ if (depth < 0) return `AsyncLocalStorage { ${Bun.inspect((this as any).__id__, options)} }`;
+ return `AsyncLocalStorage { [${options.stylize("debug id", "special")}]: ${Bun.inspect(
+ (this as any).__id__,
+ options,
+ )} }`;
+ };
+}
+
class AsyncResource {
type;
#snapshot;
- constructor(type, options) {
+ constructor(type, options?) {
if (typeof type !== "string") {
throw new TypeError('The "type" argument must be of type string. Received type ' + typeof type);
}
@@ -193,13 +277,22 @@ class AsyncResource {
var prev = get();
set(this.#snapshot);
try {
- return fn.apply(thisArg, args);
+ return fn.$apply(thisArg, args);
} catch (error) {
throw error;
} finally {
set(prev);
}
}
+
+ bind(fn, thisArg) {
+ return this.runInAsyncScope.bind(this, fn, thisArg ?? this);
+ }
+
+ static bind(fn, type, thisArg) {
+ type = type || fn.name;
+ return new AsyncResource(type || "bound-anonymous-fn").bind(fn, thisArg);
+ }
}
// The rest of async_hooks is not implemented and is stubbed with no-ops and warnings.
diff --git a/src/js/node/child_process.js b/src/js/node/child_process.js
index 859e01aa7..8840a59b1 100644
--- a/src/js/node/child_process.js
+++ b/src/js/node/child_process.js
@@ -286,12 +286,12 @@ function execFile(file, args, options, callback) {
let stdout;
let stderr;
if (encoding || (child.stdout && readableEncoding)) {
- stdout = ArrayPrototypeJoin.call(_stdout, "");
+ stdout = ArrayPrototypeJoin.$call(_stdout, "");
} else {
stdout = BufferConcat(_stdout);
}
if (encoding || (child.stderr && readableEncoding)) {
- stderr = ArrayPrototypeJoin.call(_stderr, "");
+ stderr = ArrayPrototypeJoin.$call(_stderr, "");
} else {
stderr = BufferConcat(_stderr);
}
@@ -301,7 +301,7 @@ function execFile(file, args, options, callback) {
return;
}
- if (args?.length) cmd += ` ${ArrayPrototypeJoin.call(args, " ")}`;
+ if (args?.length) cmd += ` ${ArrayPrototypeJoin.$call(args, " ")}`;
if (!ex) {
let message = `Command failed: ${cmd}`;
if (stderr) message += `\n${stderr}`;
@@ -353,7 +353,7 @@ function execFile(file, args, options, callback) {
"data",
maxBuffer === Infinity
? function onUnlimitedSizeBufferedData(chunk) {
- ArrayPrototypePush.call(_stdout, chunk);
+ ArrayPrototypePush.$call(_stdout, chunk);
}
: encoding
? function onChildStdoutEncoded(chunk) {
@@ -370,12 +370,12 @@ function execFile(file, args, options, callback) {
encodedStdoutLen += actualLen;
}
const truncatedLen = maxBuffer - (encodedStdoutLen - actualLen);
- ArrayPrototypePush.call(_stdout, StringPrototypeSlice.apply(chunk, 0, truncatedLen));
+ ArrayPrototypePush.$call(_stdout, StringPrototypeSlice.$apply(chunk, 0, truncatedLen));
ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER("stdout");
kill();
} else {
- ArrayPrototypePush.call(_stdout, chunk);
+ ArrayPrototypePush.$call(_stdout, chunk);
}
}
: function onChildStdoutRaw(chunk) {
@@ -383,12 +383,12 @@ function execFile(file, args, options, callback) {
if (stdoutLen > maxBuffer) {
const truncatedLen = maxBuffer - (stdoutLen - chunk.length);
- ArrayPrototypePush.call(_stdout, chunk.slice(0, truncatedLen));
+ ArrayPrototypePush.$call(_stdout, chunk.slice(0, truncatedLen));
ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER("stdout");
kill();
} else {
- ArrayPrototypePush.call(_stdout, chunk);
+ ArrayPrototypePush.$call(_stdout, chunk);
}
},
);
@@ -401,7 +401,7 @@ function execFile(file, args, options, callback) {
"data",
maxBuffer === Infinity
? function onUnlimitedSizeBufferedData(chunk) {
- ArrayPrototypePush.call(_stderr, chunk);
+ ArrayPrototypePush.$call(_stderr, chunk);
}
: encoding
? function onChildStderrEncoded(chunk) {
@@ -418,12 +418,12 @@ function execFile(file, args, options, callback) {
encodedStderrLen += actualLen;
}
const truncatedLen = maxBuffer - (encodedStderrLen - actualLen);
- ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen));
+ ArrayPrototypePush.$call(_stderr, StringPrototypeSlice.$call(chunk, 0, truncatedLen));
ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER("stderr");
kill();
} else {
- ArrayPrototypePush.call(_stderr, chunk);
+ ArrayPrototypePush.$call(_stderr, chunk);
}
}
: function onChildStderrRaw(chunk) {
@@ -431,12 +431,12 @@ function execFile(file, args, options, callback) {
if (stderrLen > maxBuffer) {
const truncatedLen = maxBuffer - (stderrLen - chunk.length);
- ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen));
+ ArrayPrototypePush.$call(_stderr, StringPrototypeSlice.$call(chunk, 0, truncatedLen));
ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER("stderr");
kill();
} else {
- ArrayPrototypePush.call(_stderr, chunk);
+ ArrayPrototypePush.$call(_stderr, chunk);
}
},
);
@@ -595,7 +595,7 @@ function spawnSync(file, args, options) {
if (!success) {
result.error = new SystemError(result.output[2], options.file, "spawnSync", -1, result.status);
- result.error.spawnargs = ArrayPrototypeSlice.call(options.args, 1);
+ result.error.spawnargs = ArrayPrototypeSlice.$call(options.args, 1);
}
return result;
@@ -630,7 +630,7 @@ function execFileSync(file, args, options) {
// if (inheritStderr && ret.stderr) process.stderr.write(ret.stderr);
const errArgs = [options.argv0 || file];
- ArrayPrototypePush.apply(errArgs, args);
+ ArrayPrototypePush.$apply(errArgs, args);
const err = checkExecSyncError(ret, errArgs);
if (err) throw err;
@@ -679,16 +679,16 @@ function stdioStringToArray(stdio, channel) {
case "ignore":
case "overlapped":
case "pipe":
- ArrayPrototypePush.call(options, stdio, stdio, stdio);
+ ArrayPrototypePush.$call(options, stdio, stdio, stdio);
break;
case "inherit":
- ArrayPrototypePush.call(options, 0, 1, 2);
+ ArrayPrototypePush.$call(options, 0, 1, 2);
break;
default:
throw new ERR_INVALID_ARG_VALUE("stdio", stdio);
}
- if (channel) ArrayPrototypePush.call(options, channel);
+ if (channel) ArrayPrototypePush.$call(options, channel);
return options;
}
@@ -738,19 +738,19 @@ function fork(modulePath, args = [], options) {
validateArgumentNullCheck(options.execPath, "options.execPath");
// Prepare arguments for fork:
- execArgv = options.execArgv || process.execArgv;
- validateArgumentsNullCheck(execArgv, "options.execArgv");
-
- if (execArgv === process.execArgv && process._eval != null) {
- const index = ArrayPrototypeLastIndexOf.call(execArgv, process._eval);
- if (index > 0) {
- // Remove the -e switch to avoid fork bombing ourselves.
- execArgv = ArrayPrototypeSlice.call(execArgv);
- ArrayPrototypeSplice.call(execArgv, index - 1, 2);
- }
- }
+ // execArgv = options.execArgv || process.execArgv;
+ // validateArgumentsNullCheck(execArgv, "options.execArgv");
+
+ // if (execArgv === process.execArgv && process._eval != null) {
+ // const index = ArrayPrototypeLastIndexOf.$call(execArgv, process._eval);
+ // if (index > 0) {
+ // // Remove the -e switch to avoid fork bombing ourselves.
+ // execArgv = ArrayPrototypeSlice.$call(execArgv);
+ // ArrayPrototypeSplice.$call(execArgv, index - 1, 2);
+ // }
+ // }
- args = [...execArgv, modulePath, ...args];
+ args = [/*...execArgv,*/ modulePath, ...args];
if (typeof options.stdio === "string") {
options.stdio = stdioStringToArray(options.stdio, "ipc");
@@ -758,7 +758,7 @@ function fork(modulePath, args = [], options) {
// Use a separate fd=3 for the IPC channel. Inherit stdin, stdout,
// and stderr from the parent if silent isn't set.
options.stdio = stdioStringToArray(options.silent ? "pipe" : "inherit", "ipc");
- } else if (!ArrayPrototypeIncludes.call(options.stdio, "ipc")) {
+ } else if (!ArrayPrototypeIncludes.$call(options.stdio, "ipc")) {
throw new ERR_CHILD_PROCESS_IPC_REQUIRED("options.stdio");
}
@@ -772,7 +772,7 @@ function convertToValidSignal(signal) {
if (typeof signal === "number" && getSignalsToNamesMapping()[signal]) return signal;
if (typeof signal === "string") {
- const signalName = signals[StringPrototypeToUpperCase.call(signal)];
+ const signalName = signals[StringPrototypeToUpperCase.$call(signal)];
if (signalName) return signalName;
}
@@ -801,7 +801,7 @@ function getSignalsToNamesMapping() {
function normalizeExecFileArgs(file, args, options, callback) {
if (ArrayIsArray(args)) {
- args = ArrayPrototypeSlice.call(args);
+ args = ArrayPrototypeSlice.$call(args);
} else if (args != null && typeof args === "object") {
callback = options;
options = args;
@@ -866,7 +866,7 @@ function normalizeSpawnArguments(file, args, options) {
if (file.length === 0) throw new ERR_INVALID_ARG_VALUE("file", file, "cannot be empty");
if (ArrayIsArray(args)) {
- args = ArrayPrototypeSlice.call(args);
+ args = ArrayPrototypeSlice.$call(args);
} else if (args == null) {
args = [];
} else if (typeof args !== "object") {
@@ -912,7 +912,7 @@ function normalizeSpawnArguments(file, args, options) {
// Handle shell
if (options.shell) {
validateArgumentNullCheck(options.shell, "options.shell");
- const command = ArrayPrototypeJoin.call([file, ...args], " ");
+ const command = ArrayPrototypeJoin.$call([file, ...args], " ");
// TODO: Windows moment
// Set the shell, switches, and commands.
// if (process.platform === "win32") {
@@ -935,9 +935,9 @@ function normalizeSpawnArguments(file, args, options) {
// Handle argv0
if (typeof options.argv0 === "string") {
- ArrayPrototypeUnshift.call(args, options.argv0);
+ ArrayPrototypeUnshift.$call(args, options.argv0);
} else {
- ArrayPrototypeUnshift.call(args, file);
+ ArrayPrototypeUnshift.$call(args, file);
}
const env = options.env || process.env;
@@ -959,7 +959,7 @@ function checkExecSyncError(ret, args, cmd) {
ObjectAssign(err, ret);
} else if (ret.status !== 0) {
let msg = "Command failed: ";
- msg += cmd || ArrayPrototypeJoin.call(args, " ");
+ msg += cmd || ArrayPrototypeJoin.$call(args, " ");
if (ret.stderr && ret.stderr.length > 0) msg += `\n${ret.stderr.toString()}`;
err = genericNodeError(msg, ret);
}
@@ -1019,7 +1019,7 @@ class ChildProcess extends EventEmitter {
if (this.spawnfile) err.path = this.spawnfile;
- err.spawnargs = ArrayPrototypeSlice.call(this.spawnargs, 1);
+ err.spawnargs = ArrayPrototypeSlice.$call(this.spawnargs, 1);
this.emit("error", err);
} else {
this.emit("exit", this.exitCode, this.signalCode);
@@ -1132,8 +1132,8 @@ class ChildProcess extends EventEmitter {
// if (options.envPairs === undefined) options.envPairs = [];
// else validateArray(options.envPairs, "options.envPairs");
- // ArrayPrototypePush.call(options.envPairs, `NODE_CHANNEL_FD=${ipcFd}`);
- // ArrayPrototypePush.call(
+ // ArrayPrototypePush.$call(options.envPairs, `NODE_CHANNEL_FD=${ipcFd}`);
+ // ArrayPrototypePush.$call(
// options.envPairs,
// `NODE_CHANNEL_SERIALIZATION_MODE=${serialization}`
// );
@@ -1174,6 +1174,7 @@ class ChildProcess extends EventEmitter {
env: env || process.env,
detached: typeof detachedOption !== "undefined" ? !!detachedOption : false,
onExit: (handle, exitCode, signalCode, err) => {
+ $debug("ChildProcess: onExit", exitCode, signalCode, err, this.pid);
this.#handle = handle;
this.pid = this.#handle.pid;
@@ -1189,6 +1190,8 @@ class ChildProcess extends EventEmitter {
});
this.pid = this.#handle.pid;
+ $debug("ChildProcess: spawn", this.pid, spawnargs);
+
onSpawnNT(this);
if (ipc) {
@@ -1298,7 +1301,7 @@ function nodeToBun(item) {
return item;
} else {
const result = nodeToBunLookup[item];
- if (result === undefined) throw new Error("Invalid stdio option");
+ if (result === undefined) throw new Error(`Invalid stdio option "${item}"`);
return result;
}
}
@@ -1430,7 +1433,7 @@ function validateMaxBuffer(maxBuffer) {
}
function validateArgumentNullCheck(arg, propName) {
- if (typeof arg === "string" && StringPrototypeIncludes.call(arg, "\u0000")) {
+ if (typeof arg === "string" && StringPrototypeIncludes.$call(arg, "\u0000")) {
throw new ERR_INVALID_ARG_VALUE(propName, arg, "must be a string without null bytes");
}
}
@@ -1487,9 +1490,9 @@ const validateAbortSignal = (signal, name) => {
/** @type {validateOneOf} */
const validateOneOf = (value, name, oneOf) => {
// const validateOneOf = hideStackFrames((value, name, oneOf) => {
- if (!ArrayPrototypeIncludes.call(oneOf, value)) {
- const allowed = ArrayPrototypeJoin.call(
- ArrayPrototypeMap.call(oneOf, v => (typeof v === "string" ? `'${v}'` : String(v))),
+ if (!ArrayPrototypeIncludes.$call(oneOf, value)) {
+ const allowed = ArrayPrototypeJoin.$call(
+ ArrayPrototypeMap.$call(oneOf, v => (typeof v === "string" ? `'${v}'` : String(v))),
", ",
);
const reason = "must be one of: " + allowed;
@@ -1516,7 +1519,7 @@ const validateObject = (value, name, options = null) => {
const nullable = options?.nullable ?? false;
if (
(!nullable && value === null) ||
- (!allowArray && ArrayIsArray.call(value)) ||
+ (!allowArray && ArrayIsArray.$call(value)) ||
(typeof value !== "object" && (!allowFunction || typeof value !== "function"))
) {
throw new ERR_INVALID_ARG_TYPE(name, "object", value);
@@ -1562,8 +1565,8 @@ function nullCheck(path, propName, throwError = true) {
// We can only perform meaningful checks on strings and Uint8Arrays.
if (
(!pathIsString && !pathIsUint8Array) ||
- (pathIsString && !StringPrototypeIncludes.call(path, "\u0000")) ||
- (pathIsUint8Array && !Uint8ArrayPrototypeIncludes.call(path, 0))
+ (pathIsString && !StringPrototypeIncludes.$call(path, "\u0000")) ||
+ (pathIsUint8Array && !Uint8ArrayPrototypeIncludes.$call(path, 0))
) {
return;
}
@@ -1698,7 +1701,7 @@ function genericNodeError(message, options) {
// typeof value === "string",
// "All expected entries have to be of type string"
// );
-// if (ArrayPrototypeIncludes.call(kTypes, value)) {
+// if (ArrayPrototypeIncludes.$call(kTypes, value)) {
// ArrayPrototypePush(types, StringPrototypeToLowerCase(value));
// } else if (RegExpPrototypeExec(classRegExp, value) !== null) {
// ArrayPrototypePush(instances, value);
@@ -1716,8 +1719,8 @@ function genericNodeError(message, options) {
// if (instances.length > 0) {
// const pos = ArrayPrototypeIndexOf(types, "object");
// if (pos !== -1) {
-// ArrayPrototypeSplice.call(types, pos, 1);
-// ArrayPrototypePush.call(instances, "Object");
+// ArrayPrototypeSplice.$call(types, pos, 1);
+// ArrayPrototypePush.$call(instances, "Object");
// }
// }
@@ -1752,7 +1755,7 @@ function genericNodeError(message, options) {
// if (other.length > 0) {
// if (other.length > 2) {
// const last = ArrayPrototypePop(other);
-// msg += `one of ${ArrayPrototypeJoin.call(other, ", ")}, or ${last}`;
+// msg += `one of ${ArrayPrototypeJoin.$call(other, ", ")}, or ${last}`;
// } else if (other.length === 2) {
// msg += `one of ${other[0]} or ${other[1]}`;
// } else {
diff --git a/src/js/node/crypto.js b/src/js/node/crypto.js
index a7b628ef8..ae7e24655 100644
--- a/src/js/node/crypto.js
+++ b/src/js/node/crypto.js
@@ -10,7 +10,40 @@ var Buffer = globalThis.Buffer;
const EMPTY_BUFFER = Buffer.alloc(0);
const { isAnyArrayBuffer, isArrayBufferView } = require("node:util/types");
+function exportIfKeyObject(key) {
+ if (key instanceof KeyObject) {
+ key = key.export();
+ } else if (key instanceof CryptoKey) {
+ key = KeyObject.from(key).export();
+ }
+ return key;
+}
+function getKeyFrom(key, type) {
+ if (key instanceof KeyObject) {
+ key = key.export();
+ } else if (key instanceof CryptoKey) {
+ key = KeyObject.from(key).export();
+ } else if (!Buffer.isBuffer(key) && typeof key === "object") {
+ if ((typeof key.format === "string" || typeof key.passphrase === "string") && typeof key.key !== "undefined") {
+ key = type === "public" ? _createPublicKey(key).export() : _createPrivateKey(key).export();
+ }
+ } else if (typeof key === "string" && type === "public") {
+ // make public key from non encrypted private PEM
+ key.indexOf("PRIVATE KEY-----") !== -1 && (key = _createPublicKey(key).export());
+ }
+ return key;
+}
function getArrayBufferOrView(buffer, name, encoding) {
+ if (buffer instanceof KeyObject) {
+ if (buffer.type !== "secret") {
+ const error = new TypeError(
+ `ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key.type}, expected secret`,
+ );
+ error.code = "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE";
+ throw error;
+ }
+ buffer = buffer.export();
+ }
if (isAnyArrayBuffer(buffer)) return buffer;
if (typeof buffer === "string") {
if (encoding === "buffer") encoding = "utf8";
@@ -135,7 +168,7 @@ var require_hash_base = __commonJS({
throw new TypeError(prefix + " must be a string or a buffer");
}
function HashBase(blockSize) {
- StreamModule.Transform.call(this),
+ StreamModule.Transform.$call(this),
(this._block = Buffer2.allocUnsafe(blockSize)),
(this._blockSize = blockSize),
(this._blockOffset = 0),
@@ -202,7 +235,7 @@ var require_md5 = __commonJS({
Buffer2 = require_safe_buffer().Buffer,
ARRAY16 = new Array(16);
function MD5() {
- HashBase.call(this, 64),
+ HashBase.$call(this, 64),
(this._a = 1732584193),
(this._b = 4023233417),
(this._c = 2562383102),
@@ -350,7 +383,7 @@ var require_ripemd160 = __commonJS({
hl = [0, 1518500249, 1859775393, 2400959708, 2840853838],
hr = [1352829926, 1548603684, 1836072691, 2053994217, 0];
function RIPEMD160() {
- HashBase.call(this, 64),
+ HashBase.$call(this, 64),
(this._a = 1732584193),
(this._b = 4023233417),
(this._c = 2562383102),
@@ -508,7 +541,7 @@ var require_sha = __commonJS({
K = [1518500249, 1859775393, -1894007588, -899497514],
W = new Array(80);
function Sha() {
- this.init(), (this._w = W), Hash.call(this, 64, 56);
+ this.init(), (this._w = W), Hash.$call(this, 64, 56);
}
inherits(Sha, Hash);
Sha.prototype.init = function () {
@@ -573,7 +606,7 @@ var require_sha1 = __commonJS({
K = [1518500249, 1859775393, -1894007588, -899497514],
W = new Array(80);
function Sha1() {
- this.init(), (this._w = W), Hash.call(this, 64, 56);
+ this.init(), (this._w = W), Hash.$call(this, 64, 56);
}
inherits(Sha1, Hash);
Sha1.prototype.init = function () {
@@ -650,7 +683,7 @@ var require_sha256 = __commonJS({
],
W = new Array(64);
function Sha256() {
- this.init(), (this._w = W), Hash.call(this, 64, 56);
+ this.init(), (this._w = W), Hash.$call(this, 64, 56);
}
inherits(Sha256, Hash);
Sha256.prototype.init = function () {
@@ -742,7 +775,7 @@ var require_sha224 = __commonJS({
Buffer2 = require_safe_buffer().Buffer,
W = new Array(64);
function Sha224() {
- this.init(), (this._w = W), Hash.call(this, 64, 56);
+ this.init(), (this._w = W), Hash.$call(this, 64, 56);
}
inherits(Sha224, Sha256);
Sha224.prototype.init = function () {
@@ -803,7 +836,7 @@ var require_sha512 = __commonJS({
],
W = new Array(160);
function Sha512() {
- this.init(), (this._w = W), Hash.call(this, 128, 112);
+ this.init(), (this._w = W), Hash.$call(this, 128, 112);
}
inherits(Sha512, Hash);
Sha512.prototype.init = function () {
@@ -985,7 +1018,7 @@ var require_sha384 = __commonJS({
Buffer2 = require_safe_buffer().Buffer,
W = new Array(160);
function Sha384() {
- this.init(), (this._w = W), Hash.call(this, 128, 112);
+ this.init(), (this._w = W), Hash.$call(this, 128, 112);
}
inherits(Sha384, SHA512);
Sha384.prototype.init = function () {
@@ -1052,15 +1085,17 @@ var require_cipher_base = __commonJS({
var Buffer2 = require_safe_buffer().Buffer,
inherits = require_inherits_browser();
function CipherBase(hashMode) {
- StreamModule.Transform.call(this),
+ StreamModule.Transform.$call(this),
(this.hashMode = typeof hashMode == "string"),
this.hashMode ? (this[hashMode] = this._finalOrDigest) : (this.final = this._finalOrDigest),
this._final && ((this.__final = this._final), (this._final = null)),
(this._decoder = null),
(this._encoding = null);
+ this._finalized = !1;
}
inherits(CipherBase, StreamModule.Transform);
CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
+ if (outputEnc === "buffer") outputEnc = undefined;
typeof data == "string" && (data = Buffer2.from(data, inputEnc));
var outData = this._update(data);
return this.hashMode ? this : (outputEnc && (outData = this._toString(outData, outputEnc)), outData);
@@ -1095,6 +1130,13 @@ var require_cipher_base = __commonJS({
done(err);
};
CipherBase.prototype._finalOrDigest = function (outputEnc) {
+ if (outputEnc === "buffer") outputEnc = undefined;
+ if (this._finalized) {
+ if (!this._encoding) return Buffer2.alloc(0);
+ return "";
+ }
+
+ this._finalized = !0;
var outData = this.__final() || Buffer2.alloc(0);
return outputEnc && (outData = this._toString(outData, outputEnc, !0)), outData;
};
@@ -1247,7 +1289,7 @@ var require_browser2 = __commonJS({
Object.defineProperty(LazyHash.prototype, method, {
get() {
Object.setPrototypeOf(this, lazyHashFullInitProto);
- StreamModule.Transform.call(this, this._options);
+ StreamModule.Transform.$call(this, this._options);
return this[method];
},
enumerable: false,
@@ -1274,7 +1316,9 @@ var require_legacy = __commonJS({
ZEROS = Buffer2.alloc(128),
blocksize = 64;
function Hmac(alg, key) {
- Base.call(this, "digest"),
+ key = exportIfKeyObject(key);
+
+ Base.$call(this, "digest"),
typeof key == "string" && (key = Buffer2.from(key)),
(this._alg = alg),
(this._key = key),
@@ -1327,7 +1371,9 @@ var require_browser3 = __commonJS({
var sha = require_sha2();
var ZEROS = Buffer2.alloc(128);
function Hmac(alg, key) {
- Base.call(this, "digest"), typeof key == "string" && (key = Buffer2.from(key));
+ key = exportIfKeyObject(key);
+
+ Base.$call(this, "digest"), typeof key == "string" && (key = Buffer2.from(key));
var blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64;
if (((this._alg = alg), (this._key = key), key.length > blocksize)) {
var hash = alg === "rmd160" ? new RIPEMD160() : sha(alg);
@@ -1350,9 +1396,11 @@ var require_browser3 = __commonJS({
Hmac.prototype._final = function () {
var h = this._hash.digest(),
hash = this._alg === "rmd160" ? new RIPEMD160() : sha(this._alg);
+
return hash.update(this._opad).update(h).digest();
};
module.exports = function (alg, key) {
+ key = exportIfKeyObject(key);
return (
(alg = alg.toLowerCase()),
alg === "rmd160" || alg === "ripemd160"
@@ -1419,23 +1467,28 @@ var require_algorithms = __commonJS({
hash: "sha1",
id: "",
},
+ sha1: {
+ sign: "ecdsa/rsa",
+ hash: "sha1",
+ id: "",
+ },
sha256: {
- sign: "ecdsa",
+ sign: "ecdsa/rsa",
hash: "sha256",
id: "",
},
sha224: {
- sign: "ecdsa",
+ sign: "ecdsa/rsa",
hash: "sha224",
id: "",
},
sha384: {
- sign: "ecdsa",
+ sign: "ecdsa/rsa",
hash: "sha384",
id: "",
},
sha512: {
- sign: "ecdsa",
+ sign: "ecdsa/rsa",
hash: "sha512",
id: "",
},
@@ -1593,6 +1646,7 @@ var require_sync_browser = __commonJS({
ripemd160: 20,
};
function Hmac(alg, key, saltLen) {
+ key = exportIfKeyObject(key);
var hash = getDigest(alg),
blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64;
key.length > blocksize
@@ -2007,7 +2061,7 @@ var require_des = __commonJS({
(this.tmp = new Array(2)), (this.keys = null);
}
function DES(options) {
- Cipher.call(this, options);
+ Cipher.$call(this, options);
var state = new DESState();
(this._desState = state), this.deriveKeys(state, options.key);
}
@@ -2089,7 +2143,7 @@ var require_cbc = __commonJS({
}
function instantiate(Base) {
function CBC(options) {
- Base.call(this, options), this._cbcInit();
+ Base.$call(this, options), this._cbcInit();
}
inherits(CBC, Base);
for (var keys = Object.keys(proto), i = 0; i < keys.length; i++) {
@@ -2114,10 +2168,10 @@ var require_cbc = __commonJS({
iv = state.iv;
if (this.type === "encrypt") {
for (var i = 0; i < this.blockSize; i++) iv[i] ^= inp[inOff + i];
- superProto._update.call(this, iv, 0, out, outOff);
+ superProto._update.$call(this, iv, 0, out, outOff);
for (var i = 0; i < this.blockSize; i++) iv[i] = out[outOff + i];
} else {
- superProto._update.call(this, inp, inOff, out, outOff);
+ superProto._update.$call(this, inp, inOff, out, outOff);
for (var i = 0; i < this.blockSize; i++) out[outOff + i] ^= iv[i];
for (var i = 0; i < this.blockSize; i++) iv[i] = inp[inOff + i];
}
@@ -2151,7 +2205,7 @@ var require_ede = __commonJS({
]);
}
function EDE(options) {
- Cipher.call(this, options);
+ Cipher.$call(this, options);
var state = new EDEState(this.type, this.options.key);
this._edeState = state;
}
@@ -2203,7 +2257,7 @@ var require_browserify_des = __commonJS({
module.exports = DES;
inherits(DES, CipherBase);
function DES(opts) {
- CipherBase.call(this);
+ CipherBase.$call(this);
var modeName = opts.mode.toLowerCase(),
mode = modes[modeName],
type;
@@ -2628,6 +2682,11 @@ var require_aes = __commonJS({
"node_modules/browserify-aes/aes.js"(exports, module) {
var Buffer2 = require_safe_buffer().Buffer;
function asUInt32Array(buf) {
+ if (buf instanceof KeyObject) {
+ buf = buf.export();
+ } else if (buf instanceof CryptoKey) {
+ buf = KeyObject.from(buf).export();
+ }
Buffer2.isBuffer(buf) || (buf = Buffer2.from(buf));
for (var len = (buf.length / 4) | 0, out = new Array(len), i = 0; i < len; i++) out[i] = buf.readUInt32BE(i * 4);
return out;
@@ -2919,7 +2978,7 @@ var require_authCipher = __commonJS({
return incr32(out), out;
}
function StreamCipher(mode, key, iv, decrypt) {
- Transform.call(this);
+ Transform.$call(this);
var h = Buffer2.alloc(4, 0);
this._cipher = new aes.AES(key);
var ck = this._cipher.encryptBlock(h);
@@ -2977,7 +3036,7 @@ var require_streamCipher = __commonJS({
Transform = require_cipher_base(),
inherits = require_inherits_browser();
function StreamCipher(mode, key, iv, decrypt) {
- Transform.call(this),
+ Transform.$call(this),
(this._cipher = new aes.AES(key)),
(this._prev = Buffer2.from(iv)),
(this._cache = Buffer2.allocUnsafe(0)),
@@ -3043,7 +3102,7 @@ var require_encrypter = __commonJS({
ebtk = require_evp_bytestokey(),
inherits = require_inherits_browser();
function Cipher(mode, key, iv) {
- Transform.call(this),
+ Transform.$call(this),
(this._cache = new Splitter()),
(this._cipher = new aes.AES(key)),
(this._prev = Buffer2.from(iv)),
@@ -3133,7 +3192,7 @@ var require_decrypter = __commonJS({
ebtk = require_evp_bytestokey(),
inherits = require_inherits_browser();
function Decipher(mode, key, iv) {
- Transform.call(this),
+ Transform.$call(this),
(this._cache = new Splitter()),
(this._last = void 0),
(this._cipher = new aes.AES(key)),
@@ -5072,7 +5131,7 @@ var require_bn = __commonJS({
return num.imul(this.k);
});
function K256() {
- MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
+ MPrime.$call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
}
inherits(K256, MPrime),
(K256.prototype.split = function (input, output) {
@@ -5102,15 +5161,15 @@ var require_bn = __commonJS({
);
});
function P224() {
- MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
+ MPrime.$call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
}
inherits(P224, MPrime);
function P192() {
- MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
+ MPrime.$call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
}
inherits(P192, MPrime);
function P25519() {
- MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
+ MPrime.$call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
}
inherits(P25519, MPrime),
(P25519.prototype.imulK = function (num) {
@@ -5256,7 +5315,7 @@ var require_bn = __commonJS({
return new Mont(num);
});
function Mont(m) {
- Red.call(this, m),
+ Red.$call(this, m),
(this.shift = this.m.bitLength()),
this.shift % 26 !== 0 && (this.shift += 26 - (this.shift % 26)),
(this.r = new BN(1).iushln(this.shift)),
@@ -5849,11 +5908,16 @@ var require_utils3 = __commonJS({
function cachedProperty(obj, name, computer) {
var key = "_" + name;
obj.prototype[name] = function () {
- return this[key] !== void 0 ? this[key] : (this[key] = computer.call(this));
+ return this[key] !== void 0 ? this[key] : (this[key] = computer.$call(this));
};
}
utils.cachedProperty = cachedProperty;
function parseBytes(bytes) {
+ if (bytes instanceof KeyObject) {
+ bytes = bytes.export();
+ } else if (bytes instanceof CryptoKey) {
+ bytes = KeyObject.from(bytes).export();
+ }
return typeof bytes == "string" ? utils.toArray(bytes, "hex") : bytes;
}
utils.parseBytes = parseBytes;
@@ -6104,7 +6168,7 @@ var require_short = __commonJS({
Base = require_base(),
assert = utils.assert;
function ShortCurve(conf) {
- Base.call(this, "short", conf),
+ Base.$call(this, "short", conf),
(this.a = new BN(conf.a, 16).toRed(this.red)),
(this.b = new BN(conf.b, 16).toRed(this.red)),
(this.tinv = this.two.redInvm()),
@@ -6247,7 +6311,7 @@ var require_short = __commonJS({
return res;
};
function Point(curve, x, y, isRed) {
- Base.BasePoint.call(this, curve, "affine"),
+ Base.BasePoint.$call(this, curve, "affine"),
x === null && y === null
? ((this.x = null), (this.y = null), (this.inf = !0))
: ((this.x = new BN(x, 16)),
@@ -6425,7 +6489,7 @@ var require_short = __commonJS({
return res;
};
function JPoint(curve, x, y, z) {
- Base.BasePoint.call(this, curve, "jacobian"),
+ Base.BasePoint.$call(this, curve, "jacobian"),
x === null && y === null && z === null
? ((this.x = this.curve.one), (this.y = this.curve.one), (this.z = new BN(0)))
: ((this.x = new BN(x, 16)), (this.y = new BN(y, 16)), (this.z = new BN(z, 16))),
@@ -6688,7 +6752,7 @@ var require_mont = __commonJS({
Base = require_base(),
utils = require_utils3();
function MontCurve(conf) {
- Base.call(this, "mont", conf),
+ Base.$call(this, "mont", conf),
(this.a = new BN(conf.a, 16).toRed(this.red)),
(this.b = new BN(conf.b, 16).toRed(this.red)),
(this.i4 = new BN(4).toRed(this.red).redInvm()),
@@ -6705,7 +6769,7 @@ var require_mont = __commonJS({
return y.redSqr().cmp(rhs) === 0;
};
function Point(curve, x, z) {
- Base.BasePoint.call(this, curve, "projective"),
+ Base.BasePoint.$call(this, curve, "projective"),
x === null && z === null
? ((this.x = this.curve.one), (this.z = this.curve.zero))
: ((this.x = new BN(x, 16)),
@@ -6804,7 +6868,7 @@ var require_edwards = __commonJS({
(this.twisted = (conf.a | 0) !== 1),
(this.mOneA = this.twisted && (conf.a | 0) === -1),
(this.extended = this.mOneA),
- Base.call(this, "edwards", conf),
+ Base.$call(this, "edwards", conf),
(this.a = new BN(conf.a, 16).umod(this.red.m)),
(this.a = this.a.toRed(this.red)),
(this.c = new BN(conf.c, 16).toRed(this.red)),
@@ -6860,7 +6924,7 @@ var require_edwards = __commonJS({
return lhs.cmp(rhs) === 0;
};
function Point(curve, x, y, z, t) {
- Base.BasePoint.call(this, curve, "projective"),
+ Base.BasePoint.$call(this, curve, "projective"),
x === null && y === null && z === null
? ((this.x = this.curve.zero),
(this.y = this.curve.one),
@@ -7398,7 +7462,7 @@ var require__ = __commonJS({
sha1_K = [1518500249, 1859775393, 2400959708, 3395469782];
function SHA1() {
if (!(this instanceof SHA1)) return new SHA1();
- BlockHash.call(this),
+ BlockHash.$call(this),
(this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]),
(this.W = new Array(80));
}
@@ -7463,7 +7527,7 @@ var require__2 = __commonJS({
];
function SHA256() {
if (!(this instanceof SHA256)) return new SHA256();
- BlockHash.call(this),
+ BlockHash.$call(this),
(this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225]),
(this.k = sha256_K),
(this.W = new Array(64));
@@ -7513,7 +7577,7 @@ var require__3 = __commonJS({
SHA256 = require__2();
function SHA224() {
if (!(this instanceof SHA224)) return new SHA224();
- SHA256.call(this),
+ SHA256.$call(this),
(this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]);
}
utils.inherits(SHA224, SHA256);
@@ -7569,7 +7633,7 @@ var require__4 = __commonJS({
];
function SHA512() {
if (!(this instanceof SHA512)) return new SHA512();
- BlockHash.call(this),
+ BlockHash.$call(this),
(this.h = [
1779033703, 4089235720, 3144134277, 2227873595, 1013904242, 4271175723, 2773480762, 1595750129, 1359893119,
2917565137, 2600822924, 725511199, 528734635, 4215389547, 1541459225, 327033209,
@@ -7749,7 +7813,7 @@ var require__5 = __commonJS({
SHA512 = require__4();
function SHA384() {
if (!(this instanceof SHA384)) return new SHA384();
- SHA512.call(this),
+ SHA512.$call(this),
(this.h = [
3418070365, 3238371032, 1654270250, 914150663, 2438529370, 812702999, 355462360, 4144912697, 1731405415,
4290775857, 2394180231, 1750603025, 3675008525, 1694076839, 1203062813, 3204075428,
@@ -7792,7 +7856,7 @@ var require_ripemd = __commonJS({
BlockHash = common.BlockHash;
function RIPEMD160() {
if (!(this instanceof RIPEMD160)) return new RIPEMD160();
- BlockHash.call(this),
+ BlockHash.$call(this),
(this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]),
(this.endian = "little");
}
@@ -7888,6 +7952,8 @@ var require_hmac = __commonJS({
var utils = require_utils4(),
assert = require_minimalistic_assert();
function Hmac(hash, key, enc) {
+ key = exportIfKeyObject(key);
+
if (!(this instanceof Hmac)) return new Hmac(hash, key, enc);
(this.Hash = hash),
(this.blockSize = hash.blockSize / 8),
@@ -9132,7 +9198,7 @@ var require_ec = __commonJS({
function EC(options) {
if (!(this instanceof EC)) return new EC(options);
typeof options == "string" &&
- (assert(Object.prototype.hasOwnProperty.call(curves, options), "Unknown curve " + options),
+ (assert(Object.prototype.hasOwnProperty.$call(curves, options), "Unknown curve " + options),
(options = curves[options])),
options instanceof curves.PresetCurve && (options = { curve: options }),
(this.curve = options.curve.curve),
@@ -9633,7 +9699,7 @@ var require_buffer = __commonJS({
Reporter = require_reporter().Reporter,
Buffer2 = require_safer().Buffer;
function DecoderBuffer(base, options) {
- if ((Reporter.call(this, options), !Buffer2.isBuffer(base))) {
+ if ((Reporter.$call(this, options), !Buffer2.isBuffer(base))) {
this.error("Input not Buffer");
return;
}
@@ -9659,7 +9725,7 @@ var require_buffer = __commonJS({
DecoderBuffer.prototype.save = function () {
return {
offset: this.offset,
- reporter: Reporter.prototype.save.call(this),
+ reporter: Reporter.prototype.save.$call(this),
};
};
DecoderBuffer.prototype.restore = function (save) {
@@ -9668,7 +9734,7 @@ var require_buffer = __commonJS({
(res.offset = save.offset),
(res.length = this.offset),
(this.offset = save.offset),
- Reporter.prototype.restore.call(this, save.reporter),
+ Reporter.prototype.restore.$call(this, save.reporter),
res
);
};
@@ -9858,14 +9924,14 @@ var require_node = __commonJS({
methods.forEach(function (method) {
this[method] = function () {
let clone = new this.constructor(this);
- return state.children.push(clone), clone[method].apply(clone, arguments);
+ return state.children.push(clone), clone[method].$apply(clone, arguments);
};
}, this);
};
Node.prototype._init = function (body) {
let state = this._baseState;
assert(state.parent === null),
- body.call(this),
+ body.$call(this),
(state.children = state.children.filter(function (child) {
return child._baseState.parent === this;
}, this)),
@@ -9910,7 +9976,7 @@ var require_node = __commonJS({
tags.forEach(function (tag) {
Node.prototype[tag] = function () {
let state = this._baseState,
- args = Array.prototype.slice.call(arguments);
+ args = Array.prototype.slice.$call(arguments);
return assert(state.tag === null), (state.tag = tag), this._useArgs(args), this;
};
});
@@ -9937,7 +10003,7 @@ var require_node = __commonJS({
};
Node.prototype.obj = function () {
let state = this._baseState,
- args = Array.prototype.slice.call(arguments);
+ args = Array.prototype.slice.$call(arguments);
return (state.obj = !0), args.length !== 0 && this._useArgs(args), this;
};
Node.prototype.key = function (newKey) {
@@ -10264,7 +10330,7 @@ var require_der2 = __commonJS({
return this.tree._encode(data, reporter).join();
};
function DERNode(parent) {
- Node.call(this, "der", parent);
+ Node.$call(this, "der", parent);
}
inherits(DERNode, Node);
DERNode.prototype._encodeComposite = function (tag, primitive, cls, content) {
@@ -10431,12 +10497,12 @@ var require_pem = __commonJS({
var inherits = require_inherits_browser(),
DEREncoder = require_der2();
function PEMEncoder(entity) {
- DEREncoder.call(this, entity), (this.enc = "pem");
+ DEREncoder.$call(this, entity), (this.enc = "pem");
}
inherits(PEMEncoder, DEREncoder);
module.exports = PEMEncoder;
PEMEncoder.prototype.encode = function (data, options) {
- let p = DEREncoder.prototype.encode.call(this, data).toString("base64"),
+ let p = DEREncoder.prototype.encode.$call(this, data).toString("base64"),
out = ["-----BEGIN " + options.label + "-----"];
for (let i = 0; i < p.length; i += 64) out.push(p.slice(i, i + 64));
return (
@@ -10483,7 +10549,7 @@ var require_der3 = __commonJS({
);
};
function DERNode(parent) {
- Node.call(this, "der", parent);
+ Node.$call(this, "der", parent);
}
inherits(DERNode, Node);
DERNode.prototype._peekTag = function (buffer, tag, any) {
@@ -10671,7 +10737,7 @@ var require_pem2 = __commonJS({
Buffer2 = require_safer().Buffer,
DERDecoder = require_der3();
function PEMDecoder(entity) {
- DERDecoder.call(this, entity), (this.enc = "pem");
+ DERDecoder.$call(this, entity), (this.enc = "pem");
}
inherits(PEMDecoder, DERDecoder);
module.exports = PEMDecoder;
@@ -10697,7 +10763,7 @@ var require_pem2 = __commonJS({
let base64 = lines.slice(start + 1, end).join("");
base64.replace(/[^a-z0-9+/=]+/gi, "");
let input = Buffer2.from(base64, "base64");
- return DERDecoder.prototype.decode.call(this, input, options);
+ return DERDecoder.prototype.decode.$call(this, input, options);
};
},
});
@@ -10735,7 +10801,7 @@ var require_api = __commonJS({
return (
inherits(Generated, Base),
(Generated.prototype._initNamed = function (entity, name2) {
- Base.call(this, entity, name2);
+ Base.$call(this, entity, name2);
}),
new Generated(this)
);
@@ -11042,8 +11108,67 @@ var require_parse_asn1 = __commonJS({
module.exports = parseKeys;
function parseKeys(buffer) {
var password;
- typeof buffer == "object" && !Buffer2.isBuffer(buffer) && ((password = buffer.passphrase), (buffer = buffer.key)),
- typeof buffer == "string" && (buffer = Buffer2.from(buffer));
+ if (buffer instanceof KeyObject) {
+ buffer = buffer.export();
+ } else if (buffer instanceof CryptoKey) {
+ buffer = KeyObject.from(buffer).export();
+ } else {
+ if (typeof buffer == "object" && !Buffer2.isBuffer(buffer)) {
+ password = buffer.passphrase;
+ buffer = buffer.key;
+
+ if (buffer instanceof KeyObject) {
+ var options;
+ switch (buffer.type) {
+ case "secret":
+ options = {
+ format: "buffer",
+ };
+ break;
+ case "public":
+ options = {
+ format: "pem",
+ type: "spki",
+ passphrase: password,
+ };
+ break;
+ case "private":
+ options = {
+ format: "pem",
+ type: "pkcs8",
+ passphrase: password,
+ };
+ break;
+ }
+ buffer = buffer.export(options);
+ } else if (buffer instanceof CryptoKey) {
+ var options;
+ switch (buffer.type) {
+ case "secret":
+ options = {
+ format: "buffer",
+ };
+ break;
+ case "public":
+ options = {
+ format: "pem",
+ type: "spki",
+ passphrase: password,
+ };
+ break;
+ case "private":
+ options = {
+ format: "pem",
+ type: "pkcs8",
+ passphrase: password,
+ };
+ break;
+ }
+ buffer = KeyObject.from(buffer).export(options);
+ }
+ }
+ }
+ typeof buffer == "string" && (buffer = Buffer2.from(buffer));
var stripped = fixProc(buffer, password),
type = stripped.tag,
data = stripped.data,
@@ -11165,7 +11290,8 @@ var require_sign = __commonJS({
parseKeys = require_parse_asn1(),
curves = require_curves2();
function sign(hash, key, hashType, signType, tag) {
- var priv = parseKeys(key);
+ var priv = parseKeys(getKeyFrom(key, "private"));
+
if (priv.curve) {
if (signType !== "ecdsa" && signType !== "ecdsa/rsa") throw new Error("wrong private key type");
return ecSign(hash, priv);
@@ -11291,7 +11417,7 @@ var require_verify = __commonJS({
parseKeys = require_parse_asn1(),
curves = require_curves2();
function verify(sig, hash, key, signType, tag) {
- var pub = parseKeys(key);
+ var pub = parseKeys(getKeyFrom(key, "public"));
if (pub.type === "ec") {
if (signType !== "ecdsa" && signType !== "ecdsa/rsa") throw new Error("wrong public key type");
return ecVerify(sig, hash, pub);
@@ -11362,7 +11488,10 @@ var require_browser8 = __commonJS({
(algorithms[key].id = Buffer2.from(algorithms[key].id, "hex")), (algorithms[key.toLowerCase()] = algorithms[key]);
});
function Sign(algorithm) {
- StreamModule.Writable.call(this);
+ if (typeof algorithm === "string") {
+ algorithm = algorithm.toLowerCase();
+ }
+ StreamModule.Writable.$call(this);
var data = algorithms[algorithm];
if (!data) throw new Error("Unknown message digest");
(this._hashType = data.hash),
@@ -11384,7 +11513,10 @@ var require_browser8 = __commonJS({
return enc ? sig.toString(enc) : sig;
};
function Verify(algorithm) {
- StreamModule.Writable.call(this);
+ StreamModule.Writable.$call(this);
+ if (typeof algorithm === "string") {
+ algorithm = algorithm.toLowerCase();
+ }
var data = algorithms[algorithm];
if (!data) throw new Error("Unknown message digest");
(this._hash = createHash(data.hash)), (this._tag = data.id), (this._signType = data.sign);
@@ -11682,13 +11814,19 @@ var require_privateDecrypt = __commonJS({
// node_modules/public-encrypt/browser.js
var require_browser10 = __commonJS({
"node_modules/public-encrypt/browser.js"(exports) {
- exports.publicEncrypt = require_publicEncrypt();
- exports.privateDecrypt = require_privateDecrypt();
+ var publicEncrypt = require_publicEncrypt();
+ exports.publicEncrypt = function (key, buf, options) {
+ return publicEncrypt(getKeyFrom(key, "public"), buf, options);
+ };
+ var privateDecrypt = require_privateDecrypt();
+ exports.privateDecrypt = function (key, buf, options) {
+ return privateDecrypt(getKeyFrom(key, "private"), buf, options);
+ };
exports.privateEncrypt = function (key, buf) {
- return exports.publicEncrypt(key, buf, !0);
+ return publicEncrypt(getKeyFrom(key, "private"), buf, !0);
};
exports.publicDecrypt = function (key, buf) {
- return exports.privateDecrypt(key, buf, !0);
+ return privateDecrypt(getKeyFrom(key, "public"), buf, !0);
};
},
});
@@ -11888,6 +12026,299 @@ const harcoded_curves = [
function getCurves() {
return harcoded_curves;
}
+const {
+ symmetricKeySize,
+ asymmetricKeyDetails,
+ asymmetricKeyType,
+ equals,
+ exports,
+ createSecretKey,
+ createPublicKey,
+ createPrivateKey,
+ generateKeySync,
+ generateKeyPairSync,
+} = $lazy("internal/crypto");
+
+const kCryptoKey = Symbol.for("::bunKeyObjectCryptoKey::");
+class KeyObject {
+ [kCryptoKey];
+ constructor(key) {
+ // TODO: check why this is fails
+ // if(!(key instanceof CryptoKey)) {
+ // throw new TypeError("The \"key\" argument must be an instance of CryptoKey.");
+ // }
+ if (typeof key !== "object") {
+ throw new TypeError('The "key" argument must be an instance of CryptoKey.');
+ }
+ this[kCryptoKey] = key;
+ }
+ toString() {
+ return "[object KeyObject]";
+ }
+
+ static from(key) {
+ if (key instanceof KeyObject) {
+ key = key[kCryptoKey];
+ }
+ return new KeyObject(key);
+ }
+
+ get asymmetricKeyDetails() {
+ return asymmetricKeyDetails(this[kCryptoKey]);
+ }
+
+ get symmetricKeySize() {
+ return symmetricKeySize(this[kCryptoKey]);
+ }
+
+ get asymmetricKeyType() {
+ return asymmetricKeyType(this[kCryptoKey]);
+ }
+
+ ["export"](options) {
+ switch (arguments.length) {
+ case 0:
+ switch (this.type) {
+ case "secret":
+ options = {
+ format: "buffer",
+ };
+ break;
+ case "public":
+ options = {
+ format: "pem",
+ type: "spki",
+ };
+ break;
+ case "private":
+ options = {
+ format: "pem",
+ type: "pkcs8",
+ };
+ break;
+ }
+ break;
+ case 1:
+ if (typeof options === "object" && !options.format) {
+ switch (this.type) {
+ case "secret":
+ options.format = "buffer";
+ break;
+ default:
+ options.format = "pem";
+ break;
+ }
+ }
+ }
+ return exports(this[kCryptoKey], options);
+ }
+
+ equals(otherKey) {
+ if (!(otherKey instanceof KeyObject)) {
+ throw new TypeError("otherKey must be a KeyObject");
+ }
+ return equals(this[kCryptoKey], otherKey[kCryptoKey]);
+ }
+
+ get type() {
+ return this[kCryptoKey].type;
+ }
+}
+
+crypto_exports.generateKeySync = function (algorithm, options) {
+ return KeyObject.from(generateKeySync(algorithm, options?.length));
+};
+
+crypto_exports.generateKey = function (algorithm, options, callback) {
+ try {
+ const key = KeyObject.from(generateKeySync(algorithm, options?.length));
+ typeof callback === "function" && callback(null, KeyObject.from(key));
+ } catch (err) {
+ typeof callback === "function" && callback(err);
+ }
+};
+
+function _generateKeyPairSync(algorithm, options) {
+ const result = generateKeyPairSync(algorithm, options);
+ if (result) {
+ const publicKeyEncoding = options?.publicKeyEncoding;
+ const privateKeyEncoding = options?.privateKeyEncoding;
+ result.publicKey = publicKeyEncoding
+ ? KeyObject.from(result.publicKey).export(publicKeyEncoding)
+ : KeyObject.from(result.publicKey);
+ result.privateKey = privateKeyEncoding
+ ? KeyObject.from(result.privateKey).export(privateKeyEncoding)
+ : KeyObject.from(result.privateKey);
+ }
+ return result;
+}
+crypto_exports.generateKeyPairSync = _generateKeyPairSync;
+
+crypto_exports.generateKeyPair = function (algorithm, options, callback) {
+ try {
+ const result = _generateKeyPairSync(algorithm, options);
+ typeof callback === "function" && callback(null, result.publicKey, result.privateKey);
+ } catch (err) {
+ typeof callback === "function" && callback(err);
+ }
+};
+
+crypto_exports.createSecretKey = function (key, encoding) {
+ if (key instanceof KeyObject || key instanceof CryptoKey) {
+ if (key.type !== "secret") {
+ const error = new TypeError(
+ `ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key.type}, expected secret`,
+ );
+ error.code = "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE";
+ throw error;
+ }
+ return KeyObject.from(key);
+ }
+
+ const buffer = getArrayBufferOrView(key, encoding || "utf8");
+ return KeyObject.from(createSecretKey(buffer));
+};
+
+function _createPrivateKey(key) {
+ if (typeof key === "string") {
+ key = Buffer.from(key, "utf8");
+ return KeyObject.from(createPrivateKey({ key, format: "pem" }));
+ } else if (isAnyArrayBuffer(key) || isArrayBufferView(key)) {
+ return KeyObject.from(createPrivateKey({ key, format: "pem" }));
+ } else if (typeof key === "object") {
+ if (key instanceof KeyObject || key instanceof CryptoKey) {
+ const error = new TypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key.type}`);
+ error.code = "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE";
+ throw error;
+ } else {
+ let actual_key = key.key;
+ if (typeof actual_key === "string") {
+ actual_key = Buffer.from(actual_key, key.encoding || "utf8");
+ key.key = actual_key;
+ } else if (actual_key instanceof KeyObject || actual_key instanceof CryptoKey) {
+ const error = new TypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key.type}`);
+ error.code = "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE";
+ throw error;
+ }
+ if (!isAnyArrayBuffer(actual_key) && !isArrayBufferView(actual_key) && typeof actual_key !== "object") {
+ var error = new TypeError(
+ `ERR_INVALID_ARG_TYPE: The "key" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ` +
+ actual_key,
+ );
+ error.code = "ERR_INVALID_ARG_TYPE";
+ throw error;
+ }
+ if (!key.format) {
+ key.format = "pem";
+ }
+ return KeyObject.from(createPrivateKey(key));
+ }
+ } else {
+ var error = new TypeError(
+ `ERR_INVALID_ARG_TYPE: The "key" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ` +
+ key,
+ );
+ error.code = "ERR_INVALID_ARG_TYPE";
+ throw error;
+ }
+}
+crypto_exports.createPrivateKey = _createPrivateKey;
+
+function _createPublicKey(key) {
+ if (typeof key === "string") {
+ key = Buffer.from(key, "utf8");
+ return KeyObject.from(createPublicKey({ key, format: "pem" }));
+ } else if (isAnyArrayBuffer(key) || isArrayBufferView(key)) {
+ return KeyObject.from(createPublicKey({ key, format: "pem" }));
+ } else if (typeof key === "object") {
+ if (key instanceof KeyObject || key instanceof CryptoKey) {
+ if (key.type === "private") {
+ return KeyObject.from(createPublicKey({ key: key[kCryptoKey] || key, format: "" }));
+ }
+ const error = new TypeError(
+ `ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key.type}, expected private`,
+ );
+ error.code = "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE";
+ throw error;
+ } else {
+ // must be an encrypted private key (this option is not documented at all)
+ if (key.passphrase) {
+ //TODO: handle encrypted keys in one native call
+ let actual_key = key.key;
+ if (typeof actual_key === "string") {
+ actual_key = Buffer.from(actual_key, key.encoding || "utf8");
+ }
+ return KeyObject.from(
+ createPublicKey({
+ key: createPrivateKey({ key: actual_key, format: key.format, passphrase: key.passphrase }),
+ format: "",
+ }),
+ );
+ }
+ let actual_key = key.key;
+ if (typeof actual_key === "string") {
+ actual_key = Buffer.from(actual_key, key.encoding || "utf8");
+ key.key = actual_key;
+ } else if (actual_key instanceof KeyObject || actual_key instanceof CryptoKey) {
+ if (actual_key.type === "private") {
+ return KeyObject.from(createPublicKey({ key: actual_key[kCryptoKey] || actual_key, format: "" }));
+ }
+ const error = new TypeError(
+ `ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${actual_key.type}, expected private`,
+ );
+ error.code = "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE";
+ throw error;
+ }
+ if (!isAnyArrayBuffer(actual_key) && !isArrayBufferView(actual_key) && typeof actual_key !== "object") {
+ var error = new TypeError(
+ `ERR_INVALID_ARG_TYPE: The "key" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ` +
+ key,
+ );
+ error.code = "ERR_INVALID_ARG_TYPE";
+ throw error;
+ }
+ if (!key.format) {
+ key.format = "pem";
+ }
+ return KeyObject.from(createPublicKey(key));
+ }
+ } else {
+ var error = new TypeError(
+ `ERR_INVALID_ARG_TYPE: The "key" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ` +
+ key,
+ );
+ error.code = "ERR_INVALID_ARG_TYPE";
+ throw error;
+ }
+}
+crypto_exports.createPublicKey = _createPublicKey;
+crypto_exports.KeyObject = KeyObject;
+const _createSign = crypto_exports.createSign;
+crypto_exports.sign = function (algorithm, data, key, encoding, callback) {
+ if (typeof callback === "function") {
+ try {
+ const result = _createSign(algorithm).update(data, encoding).sign(key, encoding);
+ callback(null, result);
+ } catch (err) {
+ callback(err);
+ }
+ } else {
+ return _createSign(algorithm).update(data, encoding).sign(key, encoding);
+ }
+};
+const _createVerify = crypto_exports.createVerify;
+crypto_exports.verify = function (algorithm, data, key, signature, callback) {
+ if (typeof callback === "function") {
+ try {
+ const result = _createVerify(algorithm).update(data).verify(key, signature);
+ callback(null, result);
+ } catch (err) {
+ callback(err);
+ }
+ } else {
+ return _createVerify(algorithm).update(data).verify(key, signature);
+ }
+};
var webcrypto = crypto;
__export(crypto_exports, {
diff --git a/src/js/node/diagnostics_channel.js b/src/js/node/diagnostics_channel.js
index 664c80693..5a9ee620b 100644
--- a/src/js/node/diagnostics_channel.js
+++ b/src/js/node/diagnostics_channel.js
@@ -10,7 +10,7 @@ const ArrayPrototypeSplice = (array, start, deleteCount) => array.splice(start,
const ObjectGetPrototypeOf = Object.getPrototypeOf;
const ObjectSetPrototypeOf = Object.setPrototypeOf;
const SymbolHasInstance = Symbol.hasInstance;
-const ReflectApply = Reflect.apply;
+const ReflectApply = $getByIdDirect(Reflect, "apply");
const PromiseResolve = Promise.resolve;
const PromiseReject = Promise.reject;
const PromisePrototypeThen = (promise, onFulfilled, onRejected) => promise.then(onFulfilled, onRejected);
diff --git a/src/js/node/dns.js b/src/js/node/dns.js
index a6de07351..e82e6a4b5 100644
--- a/src/js/node/dns.js
+++ b/src/js/node/dns.js
@@ -1,5 +1,5 @@
// Hardcoded module "node:dns"
-// only resolve4, resolve, lookup, resolve6 and resolveSrv are implemented.
+// only resolve4, resolve, lookup, resolve6, resolveSrv, and reverse are implemented.
const dns = Bun.dns;
function getServers() {
@@ -19,6 +19,16 @@ function lookup(domain, options, callback) {
options = { family: options };
}
+ if (domain !== domain || (typeof domain !== "number" && !domain)) {
+ console.warn(
+ `DeprecationWarning: The provided hostname "${String(
+ domain,
+ )}" is not a valid hostname, and is supported in the dns module solely for compatibility.`,
+ );
+ callback(null, null, 4);
+ return;
+ }
+
dns.lookup(domain, options).then(
res => {
res.sort((a, b) => a.family - b.family);
@@ -176,7 +186,14 @@ function lookupService(address, port, callback) {
throw new TypeError("callback must be a function");
}
- callback(null, address, port);
+ dns.lookupService(address, port, callback).then(
+ results => {
+ callback(null, ...results);
+ },
+ error => {
+ callback(error);
+ },
+ );
}
function reverse(ip, callback) {
@@ -517,7 +534,7 @@ const promises = {
},
lookupService(address, port) {
- return Promise.resolve([]);
+ return dns.lookupService(address, port);
},
resolve(hostname, rrtype) {
diff --git a/src/js/node/domain.ts b/src/js/node/domain.ts
index b03367ff4..7bed189e5 100644
--- a/src/js/node/domain.ts
+++ b/src/js/node/domain.ts
@@ -18,9 +18,9 @@ domain.createDomain = domain.create = function () {
};
d.bind = function (fn) {
return function () {
- var args = Array.prototype.slice.call(arguments);
+ var args = Array.prototype.slice.$call(arguments);
try {
- fn.apply(null, args);
+ fn.$apply(null, args);
} catch (err) {
emitError(err);
}
@@ -31,9 +31,9 @@ domain.createDomain = domain.create = function () {
if (err) {
emitError(err);
} else {
- var args = Array.prototype.slice.call(arguments, 1);
+ var args = Array.prototype.slice.$call(arguments, 1);
try {
- fn.apply(null, args);
+ fn.$apply(null, args);
} catch (err) {
emitError(err);
}
diff --git a/src/js/node/events.js b/src/js/node/events.js
index bd79dd3ae..0c7434518 100644
--- a/src/js/node/events.js
+++ b/src/js/node/events.js
@@ -14,7 +14,7 @@ const ArrayPrototypeSlice = Array.prototype.slice;
var defaultMaxListeners = 10;
-// EventEmitter must be a standard function because some old code will do weird tricks like `EventEmitter.apply(this)`.
+// EventEmitter must be a standard function because some old code will do weird tricks like `EventEmitter.$apply(this)`.
const EventEmitter = function EventEmitter(opts) {
if (this._events === undefined || this._events === this.__proto__._events) {
this._events = { __proto__: null };
@@ -49,14 +49,14 @@ function emitError(emitter, args) {
if (!events) throw args[0];
var errorMonitor = events[kErrorMonitor];
if (errorMonitor) {
- for (var handler of ArrayPrototypeSlice.call(errorMonitor)) {
- handler.apply(emitter, args);
+ for (var handler of ArrayPrototypeSlice.$call(errorMonitor)) {
+ handler.$apply(emitter, args);
}
}
var handlers = events.error;
if (!handlers) throw args[0];
- for (var handler of ArrayPrototypeSlice.call(handlers)) {
- handler.apply(emitter, args);
+ for (var handler of ArrayPrototypeSlice.$call(handlers)) {
+ handler.$apply(emitter, args);
}
return true;
}
@@ -92,9 +92,30 @@ const emitWithoutRejectionCapture = function emit(type, ...args) {
if (events === undefined) return false;
var handlers = events[type];
if (handlers === undefined) return false;
-
- for (var handler of [...handlers]) {
- handler.apply(this, args);
+ // Clone handlers array if necessary since handlers can be added/removed during the loop.
+ // Cloning is skipped for performance reasons in the case of exactly one attached handler
+ // since array length changes have no side-effects in a for-loop of length 1.
+ const maybeClonedHandlers = handlers.length > 1 ? handlers.slice() : handlers;
+ for (let i = 0, { length } = maybeClonedHandlers; i < length; i++) {
+ const handler = maybeClonedHandlers[i];
+ // For performance reasons Function.call(...) is used whenever possible.
+ switch (args.length) {
+ case 0:
+ handler.$call(this);
+ break;
+ case 1:
+ handler.$call(this, args[0]);
+ break;
+ case 2:
+ handler.$call(this, args[0], args[1]);
+ break;
+ case 3:
+ handler.$call(this, args[0], args[1], args[2]);
+ break;
+ default:
+ handler.$apply(this, args);
+ break;
+ }
}
return true;
};
@@ -107,8 +128,31 @@ const emitWithRejectionCapture = function emit(type, ...args) {
if (events === undefined) return false;
var handlers = events[type];
if (handlers === undefined) return false;
- for (var handler of [...handlers]) {
- var result = handler.apply(this, args);
+ // Clone handlers array if necessary since handlers can be added/removed during the loop.
+ // Cloning is skipped for performance reasons in the case of exactly one attached handler
+ // since array length changes have no side-effects in a for-loop of length 1.
+ const maybeClonedHandlers = handlers.length > 1 ? handlers.slice() : handlers;
+ for (let i = 0, { length } = maybeClonedHandlers; i < length; i++) {
+ const handler = maybeClonedHandlers[i];
+ let result;
+ // For performance reasons Function.call(...) is used whenever possible.
+ switch (args.length) {
+ case 0:
+ result = handler.$call(this);
+ break;
+ case 1:
+ result = handler.$call(this, args[0]);
+ break;
+ case 2:
+ result = handler.$call(this, args[0], args[1]);
+ break;
+ case 3:
+ result = handler.$call(this, args[0], args[1], args[2]);
+ break;
+ default:
+ result = handler.$apply(this, args);
+ break;
+ }
if (result !== undefined && $isPromise(result)) {
addCatch(this, result, type, args);
}
@@ -181,7 +225,7 @@ function overflowWarning(emitter, type, handlers) {
function onceWrapper(type, listener, ...args) {
this.removeListener(type, listener);
- listener.apply(this, args);
+ listener.$apply(this, args);
}
EventEmitterPrototype.once = function once(type, fn) {
diff --git a/src/js/node/fs.js b/src/js/node/fs.js
index b4165311f..39c257c9f 100644
--- a/src/js/node/fs.js
+++ b/src/js/node/fs.js
@@ -109,73 +109,86 @@ class StatWatcher extends EventEmitter {
}
var access = function access(...args) {
- callbackify(fs.accessSync, args);
+ callbackify(fs.access, args);
},
appendFile = function appendFile(...args) {
- callbackify(fs.appendFileSync, args);
+ callbackify(fs.appendFile, args);
},
close = function close(...args) {
- callbackify(fs.closeSync, args);
+ callbackify(fs.close, args);
},
rm = function rm(...args) {
- callbackify(fs.rmSync, args);
+ callbackify(fs.rm, args);
},
rmdir = function rmdir(...args) {
- callbackify(fs.rmdirSync, args);
+ callbackify(fs.rmdir, args);
},
copyFile = function copyFile(...args) {
const callback = args[args.length - 1];
if (typeof callback !== "function") {
- // TODO: set code
- throw new TypeError("Callback must be a function");
+ const err = new TypeError("Callback must be a function");
+ err.code = "ERR_INVALID_ARG_TYPE";
+ throw err;
}
fs.copyFile(...args).then(result => callback(null, result), callback);
},
- exists = function exists(...args) {
- callbackify(fs.existsSync, args);
+ exists = function exists(path, callback) {
+ if (typeof callback !== "function") {
+ const err = new TypeError("Callback must be a function");
+ err.code = "ERR_INVALID_ARG_TYPE";
+ throw err;
+ }
+ try {
+ fs.exists.$apply(fs, [path]).then(
+ existed => callback(existed),
+ _ => callback(false),
+ );
+ } catch (e) {
+ callback(false);
+ }
},
chown = function chown(...args) {
- callbackify(fs.chownSync, args);
+ callbackify(fs.chown, args);
},
chmod = function chmod(...args) {
- callbackify(fs.chmodSync, args);
+ callbackify(fs.chmod, args);
},
fchmod = function fchmod(...args) {
- callbackify(fs.fchmodSync, args);
+ callbackify(fs.fchmod, args);
},
fchown = function fchown(...args) {
- callbackify(fs.fchownSync, args);
+ callbackify(fs.fchown, args);
},
fstat = function fstat(...args) {
- callbackify(fs.fstatSync, args);
+ callbackify(fs.fstat, args);
},
fsync = function fsync(...args) {
- callbackify(fs.fsyncSync, args);
+ callbackify(fs.fsync, args);
},
ftruncate = function ftruncate(...args) {
- callbackify(fs.ftruncateSync, args);
+ callbackify(fs.ftruncate, args);
},
futimes = function futimes(...args) {
- callbackify(fs.futimesSync, args);
+ callbackify(fs.futimes, args);
},
lchmod = function lchmod(...args) {
- callbackify(fs.lchmodSync, args);
+ callbackify(fs.lchmod, args);
},
lchown = function lchown(...args) {
- callbackify(fs.lchownSync, args);
+ callbackify(fs.lchown, args);
},
link = function link(...args) {
- callbackify(fs.linkSync, args);
+ callbackify(fs.link, args);
},
mkdir = function mkdir(...args) {
- callbackify(fs.mkdirSync, args);
+ callbackify(fs.mkdir, args);
},
mkdtemp = function mkdtemp(...args) {
- callbackify(fs.mkdtempSync, args);
+ callbackify(fs.mkdtemp, args);
},
open = function open(...args) {
- callbackify(fs.openSync, args);
+ callbackify(fs.open, args);
},
read = function read(fd, buffer, offsetOrOptions, length, position, callback) {
let offset = offsetOrOptions;
@@ -210,7 +223,7 @@ var access = function access(...args) {
});
},
write = function write(...args) {
- callbackify(fs.writeSync, args);
+ callbackify(fs.write, args);
},
readdir = function readdir(...args) {
const callback = args[args.length - 1];
@@ -231,10 +244,10 @@ var access = function access(...args) {
fs.readFile(...args).then(result => callback(null, result), callback);
},
writeFile = function writeFile(...args) {
- callbackify(fs.writeFileSync, args);
+ callbackify(fs.writeFile, args);
},
readlink = function readlink(...args) {
- callbackify(fs.readlinkSync, args);
+ callbackify(fs.readlink, args);
},
realpath = function realpath(...args) {
const callback = args[args.length - 1];
@@ -246,7 +259,7 @@ var access = function access(...args) {
fs.realpath(...args).then(result => callback(null, result), callback);
},
rename = function rename(...args) {
- callbackify(fs.renameSync, args);
+ callbackify(fs.rename, args);
},
lstat = function lstat(...args) {
const callback = args[args.length - 1];
@@ -267,19 +280,19 @@ var access = function access(...args) {
fs.stat(...args).then(result => callback(null, result), callback);
},
symlink = function symlink(...args) {
- callbackify(fs.symlinkSync, args);
+ callbackify(fs.symlink, args);
},
truncate = function truncate(...args) {
- callbackify(fs.truncateSync, args);
+ callbackify(fs.truncate, args);
},
unlink = function unlink(...args) {
- callbackify(fs.unlinkSync, args);
+ callbackify(fs.unlink, args);
},
utimes = function utimes(...args) {
- callbackify(fs.utimesSync, args);
+ callbackify(fs.utimes, args);
},
lutimes = function lutimes(...args) {
- callbackify(fs.lutimesSync, args);
+ callbackify(fs.lutimes, args);
},
accessSync = fs.accessSync.bind(fs),
appendFileSync = fs.appendFileSync.bind(fs),
@@ -406,16 +419,18 @@ function unwatchFile(filename, listener) {
}
function callbackify(fsFunction, args) {
+ const callback = args[args.length - 1];
try {
- const result = fsFunction.apply(fs, args.slice(0, args.length - 1));
- const callback = args[args.length - 1];
- if (typeof callback === "function") {
- queueMicrotask(() => callback(null, result));
- }
+ var result = fsFunction.$apply(fs, args.slice(0, args.length - 1));
+ result.then(
+ (...args) => callback(null, ...args),
+ err => callback(err),
+ );
} catch (e) {
- const callback = args[args.length - 1];
if (typeof callback === "function") {
- queueMicrotask(() => callback(e));
+ callback(e);
+ } else {
+ throw e;
}
}
}
@@ -874,7 +889,7 @@ var WriteStreamClass = (WriteStream = function WriteStream(path, options = defau
tempThis.fd = fs.openSync(path, flags, mode);
}
- NativeWritable.call(this, tempThis.fd, {
+ NativeWritable.$call(this, tempThis.fd, {
...options,
decodeStrings: false,
autoDestroy,
@@ -978,7 +993,7 @@ WriteStreamPrototype[writeStreamPathFastPathCallSymbol] = function WriteStreamPa
},
err => {
readStream[kIoDone] = this[kIoDone] = true;
- WriteStream_errorOrDestroy.call(this, err);
+ WriteStream_errorOrDestroy.$call(this, err);
readStream.emit("error", err);
},
);
@@ -994,7 +1009,7 @@ WriteStreamPrototype.disableBunFastPath = function disableBunFastPath() {
function WriteStream_handleWrite(er, bytes) {
if (er) {
- return WriteStream_errorOrDestroy.call(this, er);
+ return WriteStream_errorOrDestroy.$call(this, er);
}
this.bytesWritten += bytes;
@@ -1026,11 +1041,11 @@ WriteStreamPrototype._destroy = function _destroy(err, cb) {
}
if (this[kIoDone]) {
- this.once(kIoDone, () => WriteStream_internalClose.call(this, err, cb));
+ this.once(kIoDone, () => WriteStream_internalClose.$call(this, err, cb));
return;
}
- WriteStream_internalClose.call(this, err, cb);
+ WriteStream_internalClose.$call(this, err, cb);
};
WriteStreamPrototype.close = function close(cb) {
@@ -1065,7 +1080,7 @@ WriteStreamPrototype.write = function write(chunk, encoding, cb) {
const callback = native
? (err, bytes) => {
this[kIoDone] = false;
- WriteStream_handleWrite.call(this, err, bytes);
+ WriteStream_handleWrite.$call(this, err, bytes);
this.emit(kIoDone);
if (cb) !err ? cb() : cb(err);
}
@@ -1074,7 +1089,7 @@ WriteStreamPrototype.write = function write(chunk, encoding, cb) {
if (this._write) {
return this._write(chunk, encoding, callback);
} else {
- return NativeWritable.prototype.write.call(this, chunk, encoding, callback, native);
+ return NativeWritable.prototype.write.$call(this, chunk, encoding, callback, native);
}
};
@@ -1084,7 +1099,7 @@ WriteStreamPrototype._writev = undefined;
WriteStreamPrototype.end = function end(chunk, encoding, cb) {
var native = this.pos === undefined;
- return NativeWritable.prototype.end.call(this, chunk, encoding, cb, native);
+ return NativeWritable.prototype.end.$call(this, chunk, encoding, cb, native);
};
WriteStreamPrototype._destroy = function _destroy(err, cb) {
diff --git a/src/js/node/fs.promises.ts b/src/js/node/fs.promises.ts
index 8921e42d3..91566d155 100644
--- a/src/js/node/fs.promises.ts
+++ b/src/js/node/fs.promises.ts
@@ -9,14 +9,6 @@ var fs = Bun.fs();
// in some cases, node swaps around arguments or makes small tweaks to the return type
// this is just better than nothing.
const notrace = "::bunternal::";
-var promisify = {
- [notrace]: fsFunction => {
- return async function (...args) {
- await 1;
- return fsFunction.apply(fs, args);
- };
- },
-}[notrace];
function watch(
filename: string | Buffer | URL,
@@ -139,72 +131,57 @@ async function opendir(dir: string) {
}
export default {
- access: promisify(fs.accessSync),
- appendFile: promisify(fs.appendFileSync),
- close: promisify(fs.closeSync),
+ access: fs.access.bind(fs),
+ appendFile: fs.appendFile.bind(fs),
+ close: fs.close.bind(fs),
copyFile: fs.copyFile.bind(fs),
cp,
- exists: promisify(fs.existsSync),
- chown: promisify(fs.chownSync),
- chmod: promisify(fs.chmodSync),
- fchmod: promisify(fs.fchmodSync),
- fchown: promisify(fs.fchownSync),
- fstat: promisify(fs.fstatSync),
- fsync: promisify(fs.fsyncSync),
- ftruncate: promisify(fs.ftruncateSync),
- futimes: promisify(fs.futimesSync),
- lchmod: promisify(fs.lchmodSync),
- lchown: promisify(fs.lchownSync),
- link: promisify(fs.linkSync),
+ exists: fs.exists.bind(fs),
+ chown: fs.chown.bind(fs),
+ chmod: fs.chmod.bind(fs),
+ fchmod: fs.fchmod.bind(fs),
+ fchown: fs.fchown.bind(fs),
+ fstat: fs.fstat.bind(fs),
+ fsync: fs.fsync.bind(fs),
+ ftruncate: fs.ftruncate.bind(fs),
+ futimes: fs.futimes.bind(fs),
+ lchmod: fs.lchmod.bind(fs),
+ lchown: fs.lchown.bind(fs),
+ link: fs.link.bind(fs),
lstat: fs.lstat.bind(fs),
- mkdir: promisify(fs.mkdirSync),
- mkdtemp: promisify(fs.mkdtempSync),
- open: promisify(fs.openSync),
- read: promisify(fs.readSync),
- write: promisify(fs.writeSync),
+ mkdir: fs.mkdir.bind(fs),
+ mkdtemp: fs.mkdtemp.bind(fs),
+ open: fs.open.bind(fs),
+ read: fs.read.bind(fs),
+ write: fs.write.bind(fs),
readdir: fs.readdir.bind(fs),
readFile: fs.readFile.bind(fs),
- writeFile: promisify(fs.writeFileSync),
- readlink: promisify(fs.readlinkSync),
+ writeFile: fs.writeFile.bind(fs),
+ readlink: fs.readlink.bind(fs),
realpath: fs.realpath.bind(fs),
- rename: promisify(fs.renameSync),
+ rename: fs.rename.bind(fs),
stat: fs.stat.bind(fs),
- symlink: promisify(fs.symlinkSync),
- truncate: promisify(fs.truncateSync),
- unlink: promisify(fs.unlinkSync),
- utimes: promisify(fs.utimesSync),
- lutimes: promisify(fs.lutimesSync),
- rm: promisify(fs.rmSync),
- rmdir: promisify(fs.rmdirSync),
- writev: (fd, buffers, position) => {
- return new Promise((resolve, reject) => {
- try {
- var bytesWritten = fs.writevSync(fd, buffers, position);
- } catch (err) {
- reject(err);
- return;
- }
-
- resolve({
- bytesWritten,
- buffers,
- });
- });
+ symlink: fs.symlink.bind(fs),
+ truncate: fs.truncate.bind(fs),
+ unlink: fs.unlink.bind(fs),
+ utimes: fs.utimes.bind(fs),
+ lutimes: fs.lutimes.bind(fs),
+ rm: fs.rm.bind(fs),
+ rmdir: fs.rmdir.bind(fs),
+ writev: async (fd, buffers, position) => {
+ var bytesWritten = await fs.writev(fd, buffers, position);
+ return {
+ bytesWritten,
+ buffers,
+ };
},
- readv: (fd, buffers, position) => {
- return new Promise((resolve, reject) => {
- try {
- var bytesRead = fs.readvSync(fd, buffers, position);
- } catch (err) {
- reject(err);
- return;
- }
+ readv: async (fd, buffers, position) => {
+ var bytesRead = await fs.readv(fd, buffers, position);
- resolve({
- bytesRead,
- buffers,
- });
- });
+ return {
+ bytesRead,
+ buffers,
+ };
},
constants,
watch,
diff --git a/src/js/node/http.ts b/src/js/node/http.ts
index 70ee6cead..27dab8c3d 100644
--- a/src/js/node/http.ts
+++ b/src/js/node/http.ts
@@ -2,6 +2,7 @@
const EventEmitter = require("node:events");
const { isTypedArray } = require("node:util/types");
const { Duplex, Readable, Writable } = require("node:stream");
+const { getHeader, setHeader } = $lazy("http");
const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
/**
@@ -11,7 +12,7 @@ const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
* field-vchar = VCHAR / obs-text
*/
function checkInvalidHeaderChar(val: string) {
- return RegExpPrototypeExec.call(headerCharRegex, val) !== null;
+ return RegExpPrototypeExec.$call(headerCharRegex, val) !== null;
}
const validateHeaderName = (name, label) => {
@@ -75,13 +76,9 @@ const searchParamsSymbol = Symbol.for("query"); // This is the symbol used in No
const StringPrototypeSlice = String.prototype.slice;
const StringPrototypeStartsWith = String.prototype.startsWith;
const StringPrototypeToUpperCase = String.prototype.toUpperCase;
-const StringPrototypeIncludes = String.prototype.includes;
-const StringPrototypeCharCodeAt = String.prototype.charCodeAt;
-const StringPrototypeIndexOf = String.prototype.indexOf;
const ArrayIsArray = Array.isArray;
const RegExpPrototypeExec = RegExp.prototype.exec;
const ObjectAssign = Object.assign;
-const ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
const INVALID_PATH_REGEX = /[^\u0021-\u00ff]/;
const NODE_HTTP_WARNING =
@@ -126,30 +123,20 @@ function validateFunction(callable: any, field: string) {
return callable;
}
-function getHeader(headers, name) {
- if (!headers) return;
- const result = headers.get(name);
- return result == null ? undefined : result;
-}
-
type FakeSocket = InstanceType<typeof FakeSocket>;
var FakeSocket = class Socket extends Duplex {
- [kInternalSocketData]: any;
+ [kInternalSocketData]!: [import("bun").Server, OutgoingMessage, Request];
bytesRead = 0;
bytesWritten = 0;
connecting = false;
- remoteAddress: string | null = null;
- remotePort;
timeout = 0;
-
isServer = false;
+ #address;
address() {
- return {
- address: this.localAddress,
- family: this.localFamily,
- port: this.localPort,
- };
+ // Call server.requestIP() without doing any propety getter twice.
+ var internalData;
+ return (this.#address ??= (internalData = this[kInternalSocketData])?.[0]?.requestIP(internalData[2]) ?? {});
}
get bufferSize() {
@@ -193,8 +180,31 @@ var FakeSocket = class Socket extends Duplex {
ref() {}
+ get remoteAddress() {
+ return this.address()?.address;
+ }
+
+ set remoteAddress(val) {
+ // initialize the object so that other properties wouldn't be lost
+ this.address().address = val;
+ }
+
+ get remotePort() {
+ return this.address()?.port;
+ }
+
+ set remotePort(val) {
+ // initialize the object so that other properties wouldn't be lost
+ this.address().port = val;
+ }
+
get remoteFamily() {
- return "IPv4";
+ return this.address()?.family;
+ }
+
+ set remoteFamily(val) {
+ // initialize the object so that other properties wouldn't be lost
+ this.address().family = val;
}
resetAndDestroy() {}
@@ -437,13 +447,7 @@ class Server extends EventEmitter {
address() {
if (!this.#server) return null;
-
- const address = this.#server.hostname;
- return {
- address,
- family: isIPv6(address) ? "IPv6" : "IPv4",
- port: this.#server.port,
- };
+ return this.#server.address;
}
listen(port, host, backlog, onListen) {
@@ -521,14 +525,14 @@ class Server extends EventEmitter {
const http_req = new RequestClass(req);
const http_res = new ResponseClass({ reply, req: http_req });
+ http_req.socket[kInternalSocketData] = [_server, http_res, req];
+
http_req.once("error", err => reject(err));
http_res.once("error", err => reject(err));
const upgrade = req.headers.get("upgrade");
if (upgrade) {
- const socket = http_req.socket;
- socket[kInternalSocketData] = [_server, http_res, req];
- server.emit("upgrade", http_req, socket, kEmptyBuffer);
+ server.emit("upgrade", http_req, http_req.socket, kEmptyBuffer);
} else {
server.emit("request", http_req, http_res);
}
@@ -549,7 +553,7 @@ class Server extends EventEmitter {
});
setTimeout(emitListeningNextTick, 1, this, onListen, null, this.#server.hostname, this.#server.port);
} catch (err) {
- setTimeout(emitListeningNextTick, 1, this, onListen, err);
+ server.emit("error", err);
}
return this;
@@ -608,12 +612,11 @@ class IncomingMessage extends Readable {
this.#bodyStream = undefined;
const socket = new FakeSocket();
- socket.remoteAddress = url.hostname;
- socket.remotePort = url.port;
+ if (url.protocol === "https:") socket.encrypted = true;
this.#fakeSocket = socket;
this.url = url.pathname + url.search;
- this.#nodeReq = this.req = nodeReq;
+ this.req = nodeReq;
assignHeaders(this, req);
}
@@ -628,7 +631,6 @@ class IncomingMessage extends Readable {
#req;
url;
#type;
- #nodeReq;
_construct(callback) {
// TODO: streaming
@@ -654,7 +656,7 @@ class IncomingMessage extends Readable {
if (this.#aborted) return;
if (done) {
this.push(null);
- this.destroy();
+ process.nextTick(destroyBodyStreamNT, this);
break;
}
for (var v of value) {
@@ -958,8 +960,11 @@ let OriginalWriteHeadFn, OriginalImplicitHeadFn;
class ServerResponse extends Writable {
declare _writableState: any;
- constructor({ req, reply }) {
+ constructor(c) {
super();
+ if (!c) c = {};
+ var req = c.req || {};
+ var reply = c.reply;
this.req = req;
this._reply = reply;
this.sendDate = true;
@@ -1174,7 +1179,7 @@ class ServerResponse extends Writable {
setHeader(name, value) {
var headers = (this.#headers ??= new Headers());
- headers.set(name, value);
+ setHeader(headers, name, value);
return this;
}
@@ -1391,7 +1396,7 @@ class ClientRequest extends OutgoingMessage {
if (options.path) {
const path = String(options.path);
- if (RegExpPrototypeExec.call(INVALID_PATH_REGEX, path) !== null) {
+ if (RegExpPrototypeExec.$call(INVALID_PATH_REGEX, path) !== null) {
$debug('Path contains unescaped characters: "%s"', path);
throw new Error("Path contains unescaped characters");
// throw new ERR_UNESCAPED_CHARACTERS("Request path");
@@ -1438,7 +1443,7 @@ class ClientRequest extends OutgoingMessage {
// throw new ERR_INVALID_HTTP_TOKEN("Method", method);
throw new Error("ERR_INVALID_HTTP_TOKEN: Method");
}
- method = this.#method = StringPrototypeToUpperCase.call(method);
+ method = this.#method = StringPrototypeToUpperCase.$call(method);
} else {
method = this.#method = "GET";
}
@@ -1515,7 +1520,7 @@ class ClientRequest extends OutgoingMessage {
// // For the Host header, ensure that IPv6 addresses are enclosed
// // in square brackets, as defined by URI formatting
// // https://tools.ietf.org/html/rfc3986#section-3.2.2
- // const posColon = StringPrototypeIndexOf.call(hostHeader, ":");
+ // const posColon = StringPrototypeIndexOf.$call(hostHeader, ":");
// if (
// posColon !== -1 &&
// StringPrototypeIncludes(hostHeader, ":", posColon + 1) &&
@@ -1614,8 +1619,8 @@ function urlToHttpOptions(url) {
return {
protocol,
hostname:
- typeof hostname === "string" && StringPrototypeStartsWith.call(hostname, "[")
- ? StringPrototypeSlice.call(hostname, 1, -1)
+ typeof hostname === "string" && StringPrototypeStartsWith.$call(hostname, "[")
+ ? StringPrototypeSlice.$call(hostname, 1, -1)
: hostname,
hash,
search,
@@ -1646,7 +1651,7 @@ const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;
* See https://tools.ietf.org/html/rfc7230#section-3.2.6
*/
function checkIsHttpToken(val) {
- return RegExpPrototypeExec.call(tokenRegExp, val) !== null;
+ return RegExpPrototypeExec.$call(tokenRegExp, val) !== null;
}
// Copyright Joyent, Inc. and other Node contributors.
diff --git a/src/js/node/net.js b/src/js/node/net.js
index f0873ae22..56b0f9ced 100644
--- a/src/js/node/net.js
+++ b/src/js/node/net.js
@@ -66,6 +66,14 @@ const bunSocketServerOptions = Symbol.for("::bunnetserveroptions::");
const bunSocketInternal = Symbol.for("::bunnetsocketinternal::");
const bunTLSConnectOptions = Symbol.for("::buntlsconnectoptions::");
+function closeNT(self) {
+ self.emit("close");
+}
+function endNT(socket, callback, err) {
+ socket.end();
+ callback(err);
+}
+
var SocketClass;
const Socket = (function (InternalSocket) {
SocketClass = InternalSocket;
@@ -74,17 +82,15 @@ const Socket = (function (InternalSocket) {
enumerable: false,
});
- return Object.defineProperty(
- function Socket(options) {
- return new InternalSocket(options);
- },
- Symbol.hasInstance,
- {
- value(instance) {
- return instance instanceof InternalSocket;
- },
+ function Socket(options) {
+ return new InternalSocket(options);
+ }
+ Socket.prototype = InternalSocket.prototype;
+ return Object.defineProperty(Socket, Symbol.hasInstance, {
+ value(instance) {
+ return instance instanceof InternalSocket;
},
- );
+ });
})(
class Socket extends Duplex {
static #Handlers = {
@@ -317,7 +323,7 @@ const Socket = (function (InternalSocket) {
this._parent = this;
this._parentWrap = this;
this.#pendingRead = undefined;
- this.#upgraded = false;
+ this.#upgraded = null;
if (socket instanceof Socket) {
this.#socket = socket;
}
@@ -352,6 +358,14 @@ const Socket = (function (InternalSocket) {
Socket.#Drain(socket);
}
+ #closeRawConnection() {
+ const connection = this.#upgraded;
+ connection[bunSocketInternal] = null;
+ connection.unref();
+ connection.destroy();
+ process.nextTick(closeNT, connection);
+ }
+
connect(port, host, connectListener) {
var path;
var connection = this.#socket;
@@ -412,7 +426,7 @@ const Socket = (function (InternalSocket) {
var tls = undefined;
if (typeof bunTLS === "function") {
- tls = bunTLS.call(this, port, host, true);
+ tls = bunTLS.$call(this, port, host, true);
// Client always request Cert
this._requestCert = true;
this._rejectUnauthorized = rejectUnauthorized;
@@ -446,90 +460,97 @@ const Socket = (function (InternalSocket) {
} else if (connectListener) this.on("connect", connectListener);
// start using existing connection
- if (connection) {
- const socket = connection[bunSocketInternal];
-
- if (socket) {
- this.connecting = true;
- this.#upgraded = true;
- const result = socket.upgradeTLS({
- data: this,
- tls,
- socket: Socket.#Handlers,
- });
- if (result) {
- const [raw, tls] = result;
- // replace socket
- connection[bunSocketInternal] = raw;
- raw.timeout(raw.timeout);
- raw.connecting = false;
- this[bunSocketInternal] = tls;
- } else {
- this[bunSocketInternal] = null;
- throw new Error("Invalid socket");
- }
- } else {
- // wait to be connected
- connection.once("connect", () => {
- const socket = connection[bunSocketInternal];
- if (!socket) return;
+ try {
+ if (connection) {
+ const socket = connection[bunSocketInternal];
+ if (socket) {
this.connecting = true;
- this.#upgraded = true;
+ this.#upgraded = connection;
const result = socket.upgradeTLS({
data: this,
tls,
socket: Socket.#Handlers,
});
-
if (result) {
const [raw, tls] = result;
// replace socket
connection[bunSocketInternal] = raw;
raw.timeout(raw.timeout);
+ this.once("end", this.#closeRawConnection);
raw.connecting = false;
this[bunSocketInternal] = tls;
} else {
this[bunSocketInternal] = null;
throw new Error("Invalid socket");
}
+ } else {
+ // wait to be connected
+ connection.once("connect", () => {
+ const socket = connection[bunSocketInternal];
+ if (!socket) return;
+
+ this.connecting = true;
+ this.#upgraded = connection;
+ const result = socket.upgradeTLS({
+ data: this,
+ tls,
+ socket: Socket.#Handlers,
+ });
+
+ if (result) {
+ const [raw, tls] = result;
+ // replace socket
+ connection[bunSocketInternal] = raw;
+ raw.timeout(raw.timeout);
+ this.once("end", this.#closeRawConnection);
+ raw.connecting = false;
+ this[bunSocketInternal] = tls;
+ } else {
+ this[bunSocketInternal] = null;
+ throw new Error("Invalid socket");
+ }
+ });
+ }
+ } else if (path) {
+ // start using unix socket
+ bunConnect({
+ data: this,
+ unix: path,
+ socket: Socket.#Handlers,
+ tls,
+ }).catch(error => {
+ this.emit("error", error);
+ this.emit("close");
+ });
+ } else {
+ // default start
+ bunConnect({
+ data: this,
+ hostname: host || "localhost",
+ port: port,
+ socket: Socket.#Handlers,
+ tls,
+ }).catch(error => {
+ this.emit("error", error);
+ this.emit("close");
});
}
- } else if (path) {
- // start using unix socket
- bunConnect({
- data: this,
- unix: path,
- socket: Socket.#Handlers,
- tls,
- }).catch(error => {
- this.emit("error", error);
- this.emit("close");
- });
- } else {
- // default start
- bunConnect({
- data: this,
- hostname: host || "localhost",
- port: port,
- socket: Socket.#Handlers,
- tls,
- }).catch(error => {
- this.emit("error", error);
- this.emit("close");
- });
+ } catch (error) {
+ process.nextTick(emitErrorAndCloseNextTick, this, error);
}
return this;
}
_destroy(err, callback) {
- this[bunSocketInternal]?.end();
- callback(err);
+ const socket = this[bunSocketInternal];
+ socket && process.nextTick(endNT, socket, callback, err);
}
_final(callback) {
this[bunSocketInternal]?.end();
callback();
+ process.nextTick(closeNT, this);
}
get localAddress() {
@@ -552,8 +573,10 @@ const Socket = (function (InternalSocket) {
const queue = this.#readQueue;
let chunk;
while ((chunk = queue.peek())) {
- if (!this.push(chunk)) return;
+ const can_continue = !this.push(chunk);
+ // always remove from queue push will queue it internally if needed
queue.shift();
+ if (!can_continue) break;
}
}
@@ -815,7 +838,7 @@ class Server extends EventEmitter {
const options = this[bunSocketServerOptions];
if (typeof bunTLS === "function") {
- [tls, TLSSocketClass] = bunTLS.call(this, port, hostname, false);
+ [tls, TLSSocketClass] = bunTLS.$call(this, port, hostname, false);
options.servername = tls.serverName;
options.InternalSocketClass = TLSSocketClass;
} else {
@@ -864,6 +887,11 @@ function emitErrorNextTick(self, error) {
self.emit("error", error);
}
+function emitErrorAndCloseNextTick(self, error) {
+ self.emit("error", error);
+ self.emit("close");
+}
+
function emitListeningNextTick(self, onListen) {
if (typeof onListen === "function") {
try {
diff --git a/src/js/node/os.ts b/src/js/node/os.ts
index c5b202444..744131bb6 100644
--- a/src/js/node/os.ts
+++ b/src/js/node/os.ts
@@ -77,6 +77,9 @@ function lazyCpus({ cpus }) {
function bound(obj) {
return {
+ availableParallelism: () => {
+ return navigator.hardwareConcurrency;
+ },
arch: obj.arch.bind(obj),
cpus: lazyCpus(obj),
endianness: obj.endianness.bind(obj),
diff --git a/src/js/node/querystring.js b/src/js/node/querystring.js
index 232bdac75..d7104cfcd 100644
--- a/src/js/node/querystring.js
+++ b/src/js/node/querystring.js
@@ -27,13 +27,13 @@ var require_object_keys = __commonJS((exports, module) => {
var prop;
var i;
for (prop in obj) {
- if (hasOwnProperty.call(obj, prop)) {
+ if (hasOwnProperty.$call(obj, prop)) {
result.push(prop);
}
}
if (hasDontEnumBug) {
for (i = 0; i < dontEnumsLength; i++) {
- if (hasOwnProperty.call(obj, dontEnums[i])) {
+ if (hasOwnProperty.$call(obj, dontEnums[i])) {
result.push(dontEnums[i]);
}
}
@@ -345,7 +345,7 @@ var require_src = __commonJS((exports, module) => {
decode: parse,
});
var objectKeys = require_object_keys();
- var isArray = arg => Object.prototype.toString.call(arg) === "[object Array]";
+ var isArray = arg => Object.prototype.toString.$call(arg) === "[object Array]";
var indexOf = (arr, searchElement, fromIndex) => {
var k;
if (arr == null) {
diff --git a/src/js/node/readline.js b/src/js/node/readline.js
index 6b3cddd80..16f4e1995 100644
--- a/src/js/node/readline.js
+++ b/src/js/node/readline.js
@@ -74,12 +74,11 @@ var NumberMIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER;
var MathCeil = Math.ceil;
var MathFloor = Math.floor;
var MathMax = Math.max;
-var MathMaxApply = Math.max.apply;
var DateNow = Date.now;
var FunctionPrototype = Function.prototype;
var StringPrototype = String.prototype;
var StringPrototypeSymbolIterator = StringPrototype[SymbolIterator];
-var StringIteratorPrototypeNext = StringPrototypeSymbolIterator.call("").next;
+var StringIteratorPrototypeNext = StringPrototypeSymbolIterator.$call("").next;
var ObjectSetPrototypeOf = Object.setPrototypeOf;
var ObjectDefineProperty = Object.defineProperty;
var ObjectDefineProperties = Object.defineProperties;
@@ -93,10 +92,10 @@ var createSafeIterator = (factory, next) => {
class SafeIterator {
#iterator;
constructor(iterable) {
- this.#iterator = factory.call(iterable);
+ this.#iterator = factory.$call(iterable);
}
next() {
- return next.call(this.#iterator);
+ return next.$call(this.#iterator);
}
[SymbolIterator]() {
return this;
@@ -178,9 +177,9 @@ var getStringWidth = function getStringWidth(str, removeControlChars = true) {
var width = 0;
if (removeControlChars) str = stripVTControlCharacters(str);
- str = StringPrototypeNormalize.call(str, "NFC");
+ str = StringPrototypeNormalize.$call(str, "NFC");
for (var char of new SafeStringIterator(str)) {
- var code = StringPrototypeCodePointAt.call(char, 0);
+ var code = StringPrototypeCodePointAt.$call(char, 0);
if (isFullWidthCodePoint(code)) {
width += 2;
} else if (!isZeroWidthCodePoint(code)) {
@@ -207,7 +206,7 @@ var ansi = new RegExp(ansiPattern, "g");
*/
function stripVTControlCharacters(str) {
validateString(str, "str");
- return RegExpPrototypeSymbolReplace.call(ansi, str, "");
+ return RegExpPrototypeSymbolReplace.$call(ansi, str, "");
}
// Promisify
@@ -238,7 +237,7 @@ function promisify(original) {
function fn(...args) {
return new Promise((resolve, reject) => {
- ArrayPrototypePush.call(args, (err, ...values) => {
+ ArrayPrototypePush.$call(args, (err, ...values) => {
if (err) {
return reject(err);
}
@@ -449,7 +448,7 @@ function validateObject(value, name, options = null) {
var nullable = options?.nullable ?? false;
if (
(!nullable && value === null) ||
- (!allowArray && ArrayIsArray.call(value)) ||
+ (!allowArray && ArrayIsArray.$call(value)) ||
(typeof value !== "object" && (!allowFunction || typeof value !== "function"))
) {
throw new ERR_INVALID_ARG_TYPE(name, "object", value);
@@ -518,8 +517,8 @@ CSI.kClearToLineEnd = kClearToLineEnd = CSI`0K`;
function charLengthLeft(str, i) {
if (i <= 0) return 0;
if (
- (i > 1 && StringPrototypeCodePointAt.call(str, i - 2) >= kUTF16SurrogateThreshold) ||
- StringPrototypeCodePointAt.call(str, i - 1) >= kUTF16SurrogateThreshold
+ (i > 1 && StringPrototypeCodePointAt.$call(str, i - 2) >= kUTF16SurrogateThreshold) ||
+ StringPrototypeCodePointAt.$call(str, i - 1) >= kUTF16SurrogateThreshold
) {
return 2;
}
@@ -532,7 +531,7 @@ function charLengthAt(str, i) {
// moving to the right.
return 1;
}
- return StringPrototypeCodePointAt.call(str, i) >= kUTF16SurrogateThreshold ? 2 : 1;
+ return StringPrototypeCodePointAt.$call(str, i) >= kUTF16SurrogateThreshold ? 2 : 1;
}
/*
@@ -670,13 +669,13 @@ function* emitKeys(stream) {
* We buffered enough data, now trying to extract code
* and modifier from it
*/
- var cmd = StringPrototypeSlice.call(s, cmdStart);
+ var cmd = StringPrototypeSlice.$call(s, cmdStart);
var match;
- if ((match = RegExpPrototypeExec.call(/^(\d\d?)(;(\d))?([~^$])$/, cmd))) {
+ if ((match = RegExpPrototypeExec.$call(/^(\d\d?)(;(\d))?([~^$])$/, cmd))) {
code += match[1] + match[4];
modifier = (match[3] || 1) - 1;
- } else if ((match = RegExpPrototypeExec.call(/^((\d;)?(\d))?([A-Za-z])$/, cmd))) {
+ } else if ((match = RegExpPrototypeExec.$call(/^((\d;)?(\d))?([A-Za-z])$/, cmd))) {
code += match[4];
modifier = (match[3] || 1) - 1;
} else {
@@ -985,12 +984,12 @@ function* emitKeys(stream) {
keyMeta = escaped;
} else if (!escaped && ch <= "\x1a") {
// ctrl+letter
- keyName = StringFromCharCode(StringPrototypeCharCodeAt.call(ch) + StringPrototypeCharCodeAt.call("a") - 1);
+ keyName = StringFromCharCode(StringPrototypeCharCodeAt.$call(ch) + StringPrototypeCharCodeAt.$call("a") - 1);
keyCtrl = true;
- } else if (RegExpPrototypeExec.call(/^[0-9A-Za-z]$/, ch) !== null) {
+ } else if (RegExpPrototypeExec.$call(/^[0-9A-Za-z]$/, ch) !== null) {
// Letter, number, shift+letter
- keyName = StringPrototypeToLowerCase.call(ch);
- keyShift = RegExpPrototypeExec.call(/^[A-Z]$/, ch) !== null;
+ keyName = StringPrototypeToLowerCase.$call(ch);
+ keyShift = RegExpPrototypeExec.$call(/^[A-Z]$/, ch) !== null;
keyMeta = escaped;
} else if (escaped) {
// Escape sequence timeout
@@ -1034,12 +1033,12 @@ function commonPrefix(strings) {
if (strings.length === 1) {
return strings[0];
}
- var sorted = ArrayPrototypeSort.call(ArrayPrototypeSlice.call(strings));
+ var sorted = ArrayPrototypeSort.$call(ArrayPrototypeSlice.$call(strings));
var min = sorted[0];
var max = sorted[sorted.length - 1];
for (var i = 0; i < min.length; i++) {
if (min[i] !== max[i]) {
- return StringPrototypeSlice.call(min, 0, i);
+ return StringPrototypeSlice.$call(min, 0, i);
}
}
return min;
@@ -1402,7 +1401,7 @@ function onKeyPress(s, key) {
// If the keySeq is half of a surrogate pair
// (>= 0xd800 and <= 0xdfff), refresh the line so
// the character is displayed appropriately.
- var ch = StringPrototypeCodePointAt.call(key.sequence, 0);
+ var ch = StringPrototypeCodePointAt.$call(key.sequence, 0);
if (ch >= 0xd800 && ch <= 0xdfff) this[kRefreshLine]();
}
}
@@ -1416,7 +1415,7 @@ function InterfaceConstructor(input, output, completer, terminal) {
return new InterfaceConstructor(input, output, completer, terminal);
}
- EventEmitter.call(this);
+ EventEmitter.$call(this);
this[kOnSelfCloseWithoutTerminal] = onSelfCloseWithoutTerminal.bind(this);
this[kOnSelfCloseWithTerminal] = onSelfCloseWithTerminal.bind(this);
@@ -1613,7 +1612,7 @@ var _Interface = class Interface extends InterfaceConstructor {
var setRawMode = this.input.setRawMode;
if (typeof setRawMode === "function") {
- setRawMode.call(this.input, mode);
+ setRawMode.$call(this.input, mode);
}
return wasInRawMode;
@@ -1686,19 +1685,19 @@ var _Interface = class Interface extends InterfaceConstructor {
if (this.historySize === 0) return this.line;
// If the trimmed line is empty then return the line
- if (StringPrototypeTrim.call(this.line).length === 0) return this.line;
+ if (StringPrototypeTrim.$call(this.line).length === 0) return this.line;
if (this.history.length === 0 || this.history[0] !== this.line) {
if (this.removeHistoryDuplicates) {
// Remove older history line if identical to new one
- var dupIndex = ArrayPrototypeIndexOf.call(this.history, this.line);
- if (dupIndex !== -1) ArrayPrototypeSplice.call(this.history, dupIndex, 1);
+ var dupIndex = ArrayPrototypeIndexOf.$call(this.history, this.line);
+ if (dupIndex !== -1) ArrayPrototypeSplice.$call(this.history, dupIndex, 1);
}
- ArrayPrototypeUnshift.call(this.history, this.line);
+ ArrayPrototypeUnshift.$call(this.history, this.line);
// Only store so many
- if (this.history.length > this.historySize) ArrayPrototypePop.call(this.history);
+ if (this.history.length > this.historySize) ArrayPrototypePop.$call(this.history);
}
this.historyIndex = -1;
@@ -1819,30 +1818,30 @@ var _Interface = class Interface extends InterfaceConstructor {
}
var string = this[kDecoder].write(b);
if (this[kSawReturnAt] && DateNow() - this[kSawReturnAt] <= this.crlfDelay) {
- if (StringPrototypeCodePointAt.call(string) === 10) string = StringPrototypeSlice.call(string, 1);
+ if (StringPrototypeCodePointAt.$call(string) === 10) string = StringPrototypeSlice.$call(string, 1);
this[kSawReturnAt] = 0;
}
// Run test() on the new string chunk, not on the entire line buffer.
- var newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);
+ var newPartContainsEnding = RegExpPrototypeExec.$call(lineEnding, string);
if (newPartContainsEnding !== null) {
if (this[kLine_buffer]) {
string = this[kLine_buffer] + string;
this[kLine_buffer] = null;
- newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);
+ newPartContainsEnding = RegExpPrototypeExec.$call(lineEnding, string);
}
- this[kSawReturnAt] = StringPrototypeEndsWith.call(string, "\r") ? DateNow() : 0;
+ this[kSawReturnAt] = StringPrototypeEndsWith.$call(string, "\r") ? DateNow() : 0;
var indexes = [0, newPartContainsEnding.index, lineEnding.lastIndex];
var nextMatch;
- while ((nextMatch = RegExpPrototypeExec.call(lineEnding, string)) !== null) {
- ArrayPrototypePush.call(indexes, nextMatch.index, lineEnding.lastIndex);
+ while ((nextMatch = RegExpPrototypeExec.$call(lineEnding, string)) !== null) {
+ ArrayPrototypePush.$call(indexes, nextMatch.index, lineEnding.lastIndex);
}
var lastIndex = indexes.length - 1;
// Either '' or (conceivably) the unfinished portion of the next line
- this[kLine_buffer] = StringPrototypeSlice.call(string, indexes[lastIndex]);
+ this[kLine_buffer] = StringPrototypeSlice.$call(string, indexes[lastIndex]);
for (var i = 1; i < lastIndex; i += 2) {
- this[kOnLine](StringPrototypeSlice.call(string, indexes[i - 1], indexes[i]));
+ this[kOnLine](StringPrototypeSlice.$call(string, indexes[i - 1], indexes[i]));
}
} else if (string) {
// No newlines this time, save what we have for next time
@@ -1857,8 +1856,8 @@ var _Interface = class Interface extends InterfaceConstructor {
[kInsertString](c) {
this[kBeforeEdit](this.line, this.cursor);
if (this.cursor < this.line.length) {
- var beg = StringPrototypeSlice.call(this.line, 0, this.cursor);
- var end = StringPrototypeSlice.call(this.line, this.cursor, this.line.length);
+ var beg = StringPrototypeSlice.$call(this.line, 0, this.cursor);
+ var end = StringPrototypeSlice.$call(this.line, this.cursor, this.line.length);
this.line = beg + c + end;
this.cursor += c.length;
this[kRefreshLine]();
@@ -1878,7 +1877,7 @@ var _Interface = class Interface extends InterfaceConstructor {
async [kTabComplete](lastKeypressWasTab) {
this.pause();
- var string = StringPrototypeSlice.call(this.line, 0, this.cursor);
+ var string = StringPrototypeSlice.$call(this.line, 0, this.cursor);
var value;
try {
value = await this.completer(string);
@@ -1899,15 +1898,15 @@ var _Interface = class Interface extends InterfaceConstructor {
}
// If there is a common prefix to all matches, then apply that portion.
- var prefix = commonPrefix(ArrayPrototypeFilter.call(completions, e => e !== ""));
- if (StringPrototypeStartsWith.call(prefix, completeOn) && prefix.length > completeOn.length) {
- this[kInsertString](StringPrototypeSlice.call(prefix, completeOn.length));
+ var prefix = commonPrefix(ArrayPrototypeFilter.$call(completions, e => e !== ""));
+ if (StringPrototypeStartsWith.$call(prefix, completeOn) && prefix.length > completeOn.length) {
+ this[kInsertString](StringPrototypeSlice.$call(prefix, completeOn.length));
return;
- } else if (!StringPrototypeStartsWith.call(completeOn, prefix)) {
+ } else if (!StringPrototypeStartsWith.$call(completeOn, prefix)) {
this.line =
- StringPrototypeSlice.call(this.line, 0, this.cursor - completeOn.length) +
+ StringPrototypeSlice.$call(this.line, 0, this.cursor - completeOn.length) +
prefix +
- StringPrototypeSlice.call(this.line, this.cursor, this.line.length);
+ StringPrototypeSlice.$call(this.line, this.cursor, this.line.length);
this.cursor = this.cursor - completeOn.length + prefix.length;
this._refreshLine();
return;
@@ -1920,8 +1919,8 @@ var _Interface = class Interface extends InterfaceConstructor {
this[kBeforeEdit](this.line, this.cursor);
// Apply/show completions.
- var completionsWidth = ArrayPrototypeMap.call(completions, e => getStringWidth(e));
- var width = MathMaxApply(completionsWidth) + 2; // 2 space padding
+ var completionsWidth = ArrayPrototypeMap.$call(completions, e => getStringWidth(e));
+ var width = MathMax.$apply(completionsWidth) + 2; // 2 space padding
var maxColumns = MathFloor(this.columns / width) || 1;
if (maxColumns === Infinity) {
maxColumns = 1;
@@ -1936,7 +1935,7 @@ var _Interface = class Interface extends InterfaceConstructor {
lineIndex = 0;
whitespace = 0;
} else {
- output += StringPrototypeRepeat.call(" ", whitespace);
+ output += StringPrototypeRepeat.$call(" ", whitespace);
}
if (completion !== "") {
output += completion;
@@ -1957,17 +1956,17 @@ var _Interface = class Interface extends InterfaceConstructor {
if (this.cursor > 0) {
// Reverse the string and match a word near beginning
// to avoid quadratic time complexity
- var leading = StringPrototypeSlice.call(this.line, 0, this.cursor);
- var reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), "");
- var match = RegExpPrototypeExec.call(/^\s*(?:[^\w\s]+|\w+)?/, reversed);
+ var leading = StringPrototypeSlice.$call(this.line, 0, this.cursor);
+ var reversed = ArrayPrototypeJoin.$call(ArrayPrototypeReverse.$call(ArrayFrom(leading)), "");
+ var match = RegExpPrototypeExec.$call(/^\s*(?:[^\w\s]+|\w+)?/, reversed);
this[kMoveCursor](-match[0].length);
}
}
[kWordRight]() {
if (this.cursor < this.line.length) {
- var trailing = StringPrototypeSlice.call(this.line, this.cursor);
- var match = RegExpPrototypeExec.call(/^(?:\s+|[^\w\s]+|\w+)\s*/, trailing);
+ var trailing = StringPrototypeSlice.$call(this.line, this.cursor);
+ var match = RegExpPrototypeExec.$call(/^(?:\s+|[^\w\s]+|\w+)\s*/, trailing);
this[kMoveCursor](match[0].length);
}
}
@@ -1978,8 +1977,8 @@ var _Interface = class Interface extends InterfaceConstructor {
// The number of UTF-16 units comprising the character to the left
var charSize = charLengthLeft(this.line, this.cursor);
this.line =
- StringPrototypeSlice.call(this.line, 0, this.cursor - charSize) +
- StringPrototypeSlice.call(this.line, this.cursor, this.line.length);
+ StringPrototypeSlice.$call(this.line, 0, this.cursor - charSize) +
+ StringPrototypeSlice.$call(this.line, this.cursor, this.line.length);
this.cursor -= charSize;
this[kRefreshLine]();
@@ -1992,8 +1991,8 @@ var _Interface = class Interface extends InterfaceConstructor {
// The number of UTF-16 units comprising the character to the left
var charSize = charLengthAt(this.line, this.cursor);
this.line =
- StringPrototypeSlice.call(this.line, 0, this.cursor) +
- StringPrototypeSlice.call(this.line, this.cursor + charSize, this.line.length);
+ StringPrototypeSlice.$call(this.line, 0, this.cursor) +
+ StringPrototypeSlice.$call(this.line, this.cursor + charSize, this.line.length);
this[kRefreshLine]();
}
}
@@ -2003,11 +2002,11 @@ var _Interface = class Interface extends InterfaceConstructor {
this[kBeforeEdit](this.line, this.cursor);
// Reverse the string and match a word near beginning
// to avoid quadratic time complexity
- var leading = StringPrototypeSlice.call(this.line, 0, this.cursor);
- var reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), "");
- var match = RegExpPrototypeExec.call(/^\s*(?:[^\w\s]+|\w+)?/, reversed);
- leading = StringPrototypeSlice.call(leading, 0, leading.length - match[0].length);
- this.line = leading + StringPrototypeSlice.call(this.line, this.cursor, this.line.length);
+ var leading = StringPrototypeSlice.$call(this.line, 0, this.cursor);
+ var reversed = ArrayPrototypeJoin.$call(ArrayPrototypeReverse.$call(ArrayFrom(leading)), "");
+ var match = RegExpPrototypeExec.$call(/^\s*(?:[^\w\s]+|\w+)?/, reversed);
+ leading = StringPrototypeSlice.$call(leading, 0, leading.length - match[0].length);
+ this.line = leading + StringPrototypeSlice.$call(this.line, this.cursor, this.line.length);
this.cursor = leading.length;
this[kRefreshLine]();
}
@@ -2016,18 +2015,18 @@ var _Interface = class Interface extends InterfaceConstructor {
[kDeleteWordRight]() {
if (this.cursor < this.line.length) {
this[kBeforeEdit](this.line, this.cursor);
- var trailing = StringPrototypeSlice.call(this.line, this.cursor);
- var match = RegExpPrototypeExec.call(/^(?:\s+|\W+|\w+)\s*/, trailing);
+ var trailing = StringPrototypeSlice.$call(this.line, this.cursor);
+ var match = RegExpPrototypeExec.$call(/^(?:\s+|\W+|\w+)\s*/, trailing);
this.line =
- StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(trailing, match[0].length);
+ StringPrototypeSlice.$call(this.line, 0, this.cursor) + StringPrototypeSlice.$call(trailing, match[0].length);
this[kRefreshLine]();
}
}
[kDeleteLineLeft]() {
this[kBeforeEdit](this.line, this.cursor);
- var del = StringPrototypeSlice.call(this.line, 0, this.cursor);
- this.line = StringPrototypeSlice.call(this.line, this.cursor);
+ var del = StringPrototypeSlice.$call(this.line, 0, this.cursor);
+ this.line = StringPrototypeSlice.$call(this.line, this.cursor);
this.cursor = 0;
this[kPushToKillRing](del);
this[kRefreshLine]();
@@ -2035,17 +2034,17 @@ var _Interface = class Interface extends InterfaceConstructor {
[kDeleteLineRight]() {
this[kBeforeEdit](this.line, this.cursor);
- var del = StringPrototypeSlice.call(this.line, this.cursor);
- this.line = StringPrototypeSlice.call(this.line, 0, this.cursor);
+ var del = StringPrototypeSlice.$call(this.line, this.cursor);
+ this.line = StringPrototypeSlice.$call(this.line, 0, this.cursor);
this[kPushToKillRing](del);
this[kRefreshLine]();
}
[kPushToKillRing](del) {
if (!del || del === this[kKillRing][0]) return;
- ArrayPrototypeUnshift.call(this[kKillRing], del);
+ ArrayPrototypeUnshift.$call(this[kKillRing], del);
this[kKillRingCursor] = 0;
- while (this[kKillRing].length > kMaxLengthOfKillRing) ArrayPrototypePop.call(this[kKillRing]);
+ while (this[kKillRing].length > kMaxLengthOfKillRing) ArrayPrototypePop.$call(this[kKillRing]);
}
[kYank]() {
@@ -2066,8 +2065,8 @@ var _Interface = class Interface extends InterfaceConstructor {
this[kKillRingCursor] = 0;
}
var currentYank = this[kKillRing][this[kKillRingCursor]];
- var head = StringPrototypeSlice.call(this.line, 0, this.cursor - lastYank.length);
- var tail = StringPrototypeSlice.call(this.line, this.cursor);
+ var head = StringPrototypeSlice.$call(this.line, 0, this.cursor - lastYank.length);
+ var tail = StringPrototypeSlice.$call(this.line, this.cursor);
this.line = head + currentYank + tail;
this.cursor = head.length + currentYank.length;
this[kRefreshLine]();
@@ -2091,20 +2090,20 @@ var _Interface = class Interface extends InterfaceConstructor {
}
[kPushToUndoStack](text, cursor) {
- if (ArrayPrototypePush.call(this[kUndoStack], { text, cursor }) > kMaxUndoRedoStackSize) {
- ArrayPrototypeShift.call(this[kUndoStack]);
+ if (ArrayPrototypePush.$call(this[kUndoStack], { text, cursor }) > kMaxUndoRedoStackSize) {
+ ArrayPrototypeShift.$call(this[kUndoStack]);
}
}
[kUndo]() {
if (this[kUndoStack].length <= 0) return;
- ArrayPrototypePush.call(this[kRedoStack], {
+ ArrayPrototypePush.$call(this[kRedoStack], {
text: this.line,
cursor: this.cursor,
});
- var entry = ArrayPrototypePop.call(this[kUndoStack]);
+ var entry = ArrayPrototypePop.$call(this[kUndoStack]);
this.line = entry.text;
this.cursor = entry.cursor;
@@ -2114,12 +2113,12 @@ var _Interface = class Interface extends InterfaceConstructor {
[kRedo]() {
if (this[kRedoStack].length <= 0) return;
- ArrayPrototypePush.call(this[kUndoStack], {
+ ArrayPrototypePush.$call(this[kUndoStack], {
text: this.line,
cursor: this.cursor,
});
- var entry = ArrayPrototypePop.call(this[kRedoStack]);
+ var entry = ArrayPrototypePop.$call(this[kRedoStack]);
this.line = entry.text;
this.cursor = entry.cursor;
@@ -2133,7 +2132,7 @@ var _Interface = class Interface extends InterfaceConstructor {
var index = this.historyIndex - 1;
while (
index >= 0 &&
- (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index])
+ (!StringPrototypeStartsWith.$call(this.history[index], search) || this.line === this.history[index])
) {
index--;
}
@@ -2155,7 +2154,7 @@ var _Interface = class Interface extends InterfaceConstructor {
var index = this.historyIndex + 1;
while (
index < this.history.length &&
- (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index])
+ (!StringPrototypeStartsWith.$call(this.history[index], search) || this.line === this.history[index])
) {
index++;
}
@@ -2213,7 +2212,7 @@ var _Interface = class Interface extends InterfaceConstructor {
* }}
*/
getCursorPos() {
- var strBeforeCursor = this[kPrompt] + StringPrototypeSlice.call(this.line, 0, this.cursor);
+ var strBeforeCursor = this[kPrompt] + StringPrototypeSlice.$call(this.line, 0, this.cursor);
return this[kGetDisplayPos](strBeforeCursor);
}
@@ -2259,7 +2258,7 @@ var _Interface = class Interface extends InterfaceConstructor {
// Activate or deactivate substring search.
if ((keyName === "up" || keyName === "down") && !keyCtrl && !keyMeta && !keyShift) {
if (this[kSubstringSearch] === null) {
- this[kSubstringSearch] = StringPrototypeSlice.call(this.line, 0, this.cursor);
+ this[kSubstringSearch] = StringPrototypeSlice.$call(this.line, 0, this.cursor);
}
} else if (this[kSubstringSearch] !== null) {
this[kSubstringSearch] = null;
@@ -2271,7 +2270,7 @@ var _Interface = class Interface extends InterfaceConstructor {
// Undo & Redo
if (typeof keySeq === "string") {
- switch (StringPrototypeCodePointAt.call(keySeq, 0)) {
+ switch (StringPrototypeCodePointAt.$call(keySeq, 0)) {
case 0x1f:
this[kUndo]();
return;
@@ -2497,13 +2496,13 @@ var _Interface = class Interface extends InterfaceConstructor {
// falls through
default:
if (typeof s === "string" && s) {
- var nextMatch = RegExpPrototypeExec.call(lineEnding, s);
+ var nextMatch = RegExpPrototypeExec.$call(lineEnding, s);
if (nextMatch !== null) {
- this[kInsertString](StringPrototypeSlice.call(s, 0, nextMatch.index));
+ this[kInsertString](StringPrototypeSlice.$call(s, 0, nextMatch.index));
var { lastIndex } = lineEnding;
- while ((nextMatch = RegExpPrototypeExec.call(lineEnding, s)) !== null) {
+ while ((nextMatch = RegExpPrototypeExec.$call(lineEnding, s)) !== null) {
this[kLine]();
- this[kInsertString](StringPrototypeSlice.call(s, lastIndex, nextMatch.index));
+ this[kInsertString](StringPrototypeSlice.$call(s, lastIndex, nextMatch.index));
({ lastIndex } = lineEnding);
}
if (lastIndex === s.length) this[kLine]();
@@ -2549,7 +2548,7 @@ function Interface(input, output, completer, terminal) {
completer = (v, cb) => cb(null, realCompleter(v));
}
- InterfaceConstructor.call(this, input, output, completer, terminal);
+ InterfaceConstructor.$call(this, input, output, completer, terminal);
// TODO: Test this
if (process.env.TERM === "dumb") {
@@ -2879,7 +2878,7 @@ Interface.prototype._tabComplete = function (lastKeypressWasTab) {
// Overriding parent method because `this.completer` in the legacy
// implementation takes a callback instead of being an async function.
this.pause();
- var string = StringPrototypeSlice.call(this.line, 0, this.cursor);
+ var string = StringPrototypeSlice.$call(this.line, 0, this.cursor);
this.completer(string, (err, value) => {
this.resume();
@@ -2980,7 +2979,7 @@ class Readline {
var data = y == null ? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;
if (this.#autoCommit) process.nextTick(() => this.#stream.write(data));
- else ArrayPrototypePush.call(this.#todo, data);
+ else ArrayPrototypePush.$call(this.#todo, data);
return this;
}
@@ -3010,7 +3009,7 @@ class Readline {
data += CSI`${dy}B`;
}
if (this.#autoCommit) process.nextTick(() => this.#stream.write(data));
- else ArrayPrototypePush.call(this.#todo, data);
+ else ArrayPrototypePush.$call(this.#todo, data);
}
return this;
}
@@ -3028,7 +3027,7 @@ class Readline {
var data = dir < 0 ? kClearToLineBeginning : dir > 0 ? kClearToLineEnd : kClearLine;
if (this.#autoCommit) process.nextTick(() => this.#stream.write(data));
- else ArrayPrototypePush.call(this.#todo, data);
+ else ArrayPrototypePush.$call(this.#todo, data);
return this;
}
@@ -3040,7 +3039,7 @@ class Readline {
if (this.#autoCommit) {
process.nextTick(() => this.#stream.write(kClearScreenDown));
} else {
- ArrayPrototypePush.call(this.#todo, kClearScreenDown);
+ ArrayPrototypePush.$call(this.#todo, kClearScreenDown);
}
return this;
}
@@ -3053,7 +3052,7 @@ class Readline {
*/
commit() {
return new Promise(resolve => {
- this.#stream.write(ArrayPrototypeJoin.call(this.#todo, ""), resolve);
+ this.#stream.write(ArrayPrototypeJoin.$call(this.#todo, ""), resolve);
this.#todo = [];
});
}
diff --git a/src/js/node/stream.js b/src/js/node/stream.js
index f9d4377b5..5297c033c 100644
--- a/src/js/node/stream.js
+++ b/src/js/node/stream.js
@@ -106,10 +106,10 @@ var require_primordials = __commonJS({
},
Error,
FunctionPrototypeCall(fn, thisArgs, ...args) {
- return fn.call(thisArgs, ...args);
+ return fn.$call(thisArgs, ...args);
},
FunctionPrototypeSymbolHasInstance(self, instance) {
- return Function.prototype[Symbol.hasInstance].call(self, instance);
+ return Function.prototype[Symbol.hasInstance].$call(self, instance);
},
MathFloor: Math.floor,
Number,
@@ -143,7 +143,7 @@ var require_primordials = __commonJS({
PromiseReject(err) {
return Promise.reject(err);
},
- ReflectApply: Reflect.apply,
+ ReflectApply: $getByIdDirect(Reflect, "apply"),
RegExpPrototypeTest(self, value) {
return self.test(value);
},
@@ -210,7 +210,7 @@ var require_util = __commonJS({
return;
}
called = true;
- callback.apply(this, args);
+ callback.$apply(this, args);
};
},
createDeferredPromise: function () {
@@ -1161,7 +1161,7 @@ var require_end_of_stream = __commonJS({
return;
}
if (!readable || readableFinished) {
- callback.call(stream);
+ callback.$call(stream);
}
};
let readableFinished = isReadableFinished(stream, false);
@@ -1174,26 +1174,26 @@ var require_end_of_stream = __commonJS({
return;
}
if (!writable || writableFinished) {
- callback.call(stream);
+ callback.$call(stream);
}
};
const onerror = err => {
- callback.call(stream, err);
+ callback.$call(stream, err);
};
let closed = isClosed(stream);
const onclose = () => {
closed = true;
const errored = isWritableErrored(stream) || isReadableErrored(stream);
if (errored && typeof errored !== "boolean") {
- return callback.call(stream, errored);
+ return callback.$call(stream, errored);
}
if (readable && !readableFinished && isReadableNodeStream(stream, true)) {
- if (!isReadableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE());
+ if (!isReadableFinished(stream, false)) return callback.$call(stream, new ERR_STREAM_PREMATURE_CLOSE());
}
if (writable && !writableFinished) {
- if (!isWritableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE());
+ if (!isWritableFinished(stream, false)) return callback.$call(stream, new ERR_STREAM_PREMATURE_CLOSE());
}
- callback.call(stream);
+ callback.$call(stream);
};
const onrequest = () => {
stream.req.on("finish", onfinish);
@@ -1263,7 +1263,7 @@ var require_end_of_stream = __commonJS({
const abort = () => {
const endCallback = callback;
cleanup();
- endCallback.call(
+ endCallback.$call(
stream,
new AbortError(void 0, {
cause: options.signal.reason,
@@ -1276,7 +1276,7 @@ var require_end_of_stream = __commonJS({
const originalCallback = callback;
callback = once((...args) => {
options.signal.removeEventListener("abort", abort);
- originalCallback.apply(stream, args);
+ originalCallback.$apply(stream, args);
});
options.signal.addEventListener("abort", abort);
}
@@ -1450,7 +1450,7 @@ var require_operators = __commonJS({
resume = null;
}
}
- }.call(this);
+ }.$call(this);
}
function asIndexedPairs(options = void 0) {
if (options != null) {
@@ -1476,10 +1476,10 @@ var require_operators = __commonJS({
}
yield [index++, val];
}
- }.call(this);
+ }.$call(this);
}
async function some(fn, options = void 0) {
- for await (const unused of filter.call(this, fn, options)) {
+ for await (const unused of filter.$call(this, fn, options)) {
return true;
}
return false;
@@ -1488,7 +1488,7 @@ var require_operators = __commonJS({
if (typeof fn !== "function") {
throw new ERR_INVALID_ARG_TYPE("fn", ["Function", "AsyncFunction"], fn);
}
- return !(await some.call(
+ return !(await some.$call(
this,
async (...args) => {
return !(await fn(...args));
@@ -1497,7 +1497,7 @@ var require_operators = __commonJS({
));
}
async function find(fn, options) {
- for await (const result of filter.call(this, fn, options)) {
+ for await (const result of filter.$call(this, fn, options)) {
return result;
}
return void 0;
@@ -1510,7 +1510,7 @@ var require_operators = __commonJS({
await fn(value, options2);
return kEmpty;
}
- for await (const unused of map.call(this, forEachFn, options));
+ for await (const unused of map.$call(this, forEachFn, options));
}
function filter(fn, options) {
if (typeof fn !== "function") {
@@ -1522,7 +1522,7 @@ var require_operators = __commonJS({
}
return kEmpty;
}
- return map.call(this, filterFn, options);
+ return map.$call(this, filterFn, options);
}
var ReduceAwareErrMissingArgs = class extends ERR_MISSING_ARGS {
constructor() {
@@ -1622,12 +1622,12 @@ var require_operators = __commonJS({
return result;
}
function flatMap(fn, options) {
- const values = map.call(this, fn, options);
+ const values = map.$call(this, fn, options);
return async function* flatMap2() {
for await (const val of values) {
yield* val;
}
- }.call(this);
+ }.$call(this);
}
function toIntegerOrInfinity(number) {
number = Number2(number);
@@ -1673,7 +1673,7 @@ var require_operators = __commonJS({
yield val;
}
}
- }.call(this);
+ }.$call(this);
}
function take(number, options = void 0) {
if (options != null) {
@@ -1711,7 +1711,7 @@ var require_operators = __commonJS({
return;
}
}
- }.call(this);
+ }.$call(this);
}
module.exports.streamReturningOperators = {
asIndexedPairs,
@@ -2001,7 +2001,7 @@ var require_legacy = __commonJS({
function Stream(options) {
if (!(this instanceof Stream)) return new Stream(options);
- EE.call(this, options);
+ EE.$call(this, options);
}
Stream.prototype = {};
ObjectSetPrototypeOf(Stream.prototype, EE.prototype);
@@ -2274,7 +2274,7 @@ var require_readable = __commonJS({
if (typeof construct === "function") this._construct = construct;
if (signal && !isDuplex) addAbortSignal(signal, this);
}
- Stream.call(this, options);
+ Stream.$call(this, options);
destroyImpl.construct(this, () => {
if (this._readableState.needReadable) {
@@ -2287,7 +2287,7 @@ var require_readable = __commonJS({
ObjectSetPrototypeOf(Readable, Stream);
Readable.prototype.on = function (ev, fn) {
- const res = Stream.prototype.on.call(this, ev, fn);
+ const res = Stream.prototype.on.$call(this, ev, fn);
const state = this._readableState;
if (ev === "data") {
state.readableListening = this.listenerCount("readable") > 0;
@@ -2975,7 +2975,7 @@ var require_readable = __commonJS({
};
Readable.prototype.addListener = Readable.prototype.on;
Readable.prototype.removeListener = function (ev, fn) {
- const res = Stream.prototype.removeListener.call(this, ev, fn);
+ const res = Stream.prototype.removeListener.$call(this, ev, fn);
if (ev === "readable") {
runOnNextTick(updateReadableListening, this);
}
@@ -2983,7 +2983,7 @@ var require_readable = __commonJS({
};
Readable.prototype.off = Readable.prototype.removeListener;
Readable.prototype.removeAllListeners = function (ev) {
- const res = Stream.prototype.removeAllListeners.apply(this, arguments);
+ const res = Stream.prototype.removeAllListeners.$apply(this, arguments);
if (ev === "readable" || ev === void 0) {
runOnNextTick(updateReadableListening, this);
}
@@ -3433,7 +3433,7 @@ var require_writable = __commonJS({
if (typeof options.construct === "function") this._construct = options.construct;
if (options.signal) addAbortSignal(options.signal, this);
}
- Stream.call(this, options);
+ Stream.$call(this, options);
destroyImpl.construct(this, () => {
const state = this._writableState;
@@ -4003,7 +4003,7 @@ var require_writable = __commonJS({
if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length)) {
runOnNextTick(errorBuffer, state);
}
- destroy.call(this, err, cb);
+ destroy.$call(this, err, cb);
return this;
};
Writable.prototype._undestroy = destroyImpl.undestroy;
@@ -4387,8 +4387,8 @@ var require_duplex = __commonJS({
function Duplex(options) {
if (!(this instanceof Duplex)) return new Duplex(options);
- Readable.call(this, options);
- Writable.call(this, options);
+ Readable.$call(this, options);
+ Writable.$call(this, options);
if (options) {
this.allowHalfOpen = options.allowHalfOpen !== false;
@@ -4473,7 +4473,7 @@ var require_transform = __commonJS({
var Duplex = require_duplex();
function Transform(options) {
if (!(this instanceof Transform)) return new Transform(options);
- Duplex.call(this, options);
+ Duplex.$call(this, options);
this._readableState.sync = false;
this[kCallback] = null;
@@ -4519,7 +4519,7 @@ var require_transform = __commonJS({
}
function prefinish() {
if (this._final !== final) {
- final.call(this);
+ final.$call(this);
}
}
Transform.prototype._final = final;
@@ -4570,7 +4570,7 @@ var require_passthrough = __commonJS({
function PassThrough(options) {
if (!(this instanceof PassThrough)) return new PassThrough(options);
- Transform.call(this, options);
+ Transform.$call(this, options);
}
PassThrough.prototype = {};
@@ -4643,7 +4643,7 @@ var require_pipeline = __commonJS({
if (!Readable) {
Readable = require_readable();
}
- yield* Readable.prototype[SymbolAsyncIterator].call(val);
+ yield* Readable.prototype[SymbolAsyncIterator].$call(val);
}
async function pump(iterable, writable, finish, { end }) {
let error;
@@ -4806,7 +4806,7 @@ var require_pipeline = __commonJS({
const then = (_ret = ret) === null || _ret === void 0 ? void 0 : _ret.then;
if (typeof then === "function") {
finishCount++;
- then.call(
+ then.$call(
ret,
val => {
value = val;
@@ -5478,7 +5478,7 @@ const _fileSink = Symbol("fileSink");
const _native = Symbol("native");
function NativeWritable(pathOrFdOrSink, options = {}) {
- Writable.call(this, options);
+ Writable.$call(this, options);
this[_native] = true;
@@ -5521,7 +5521,7 @@ const WritablePrototypeWrite = Writable.prototype.write;
NativeWritable.prototype.write = function NativeWritablePrototypeWrite(chunk, encoding, cb, native) {
if (!(native ?? this[_native])) {
this[_native] = false;
- return WritablePrototypeWrite.call(this, chunk, encoding, cb);
+ return WritablePrototypeWrite.$call(this, chunk, encoding, cb);
}
var fileSink = this[_fileSink] ?? NativeWritable_lazyConstruct(this);
@@ -5540,13 +5540,17 @@ NativeWritable.prototype.write = function NativeWritablePrototypeWrite(chunk, en
return false;
}
fileSink.flush(true);
+
+ if (typeof encoding === "function") {
+ cb = encoding;
+ }
// TODO: Should we just have a calculation based on encoding and length of chunk?
if (cb) cb(null, chunk.byteLength);
return true;
};
const WritablePrototypeEnd = Writable.prototype.end;
NativeWritable.prototype.end = function end(chunk, encoding, cb, native) {
- return WritablePrototypeEnd.call(this, chunk, encoding, cb, native ?? this[_native]);
+ return WritablePrototypeEnd.$call(this, chunk, encoding, cb, native ?? this[_native]);
};
function NativeWritable_internalDestroy(error, cb) {
diff --git a/src/js/node/tls.js b/src/js/node/tls.js
index bdf06faac..ef9232d7b 100644
--- a/src/js/node/tls.js
+++ b/src/js/node/tls.js
@@ -42,16 +42,16 @@ function isValidTLSArray(obj) {
}
function unfqdn(host) {
- return RegExpPrototypeSymbolReplace.call(/[.]$/, host, "");
+ return RegExpPrototypeSymbolReplace.$call(/[.]$/, host, "");
}
// String#toLowerCase() is locale-sensitive so we use
// a conservative version that only lowercases A-Z.
function toLowerCase(c) {
- return StringFromCharCode.call(32 + StringPrototypeCharCodeAt.call(c, 0));
+ return StringFromCharCode.$call(32 + StringPrototypeCharCodeAt.$call(c, 0));
}
function splitHost(host) {
- return StringPrototypeSplit.call(RegExpPrototypeSymbolReplace.call(/[A-Z]/g, unfqdn(host), toLowerCase), ".");
+ return StringPrototypeSplit.$call(RegExpPrototypeSymbolReplace.$call(/[A-Z]/g, unfqdn(host), toLowerCase), ".");
}
function check(hostParts, pattern, wildcards) {
@@ -63,14 +63,14 @@ function check(hostParts, pattern, wildcards) {
if (hostParts.length !== patternParts.length) return false;
// Pattern has empty components, e.g. "bad..example.com".
- if (ArrayPrototypeIncludes.call(patternParts, "")) return false;
+ if (ArrayPrototypeIncludes.$call(patternParts, "")) return false;
// RFC 6125 allows IDNA U-labels (Unicode) in names but we have no
// good way to detect their encoding or normalize them so we simply
// reject them. Control characters and blanks are rejected as well
// because nothing good can come from accepting them.
- const isBad = s => RegExpPrototypeExec.call(/[^\u0021-\u007F]/u, s) !== null;
- if (ArrayPrototypeSome.call(patternParts, isBad)) return false;
+ const isBad = s => RegExpPrototypeExec.$call(/[^\u0021-\u007F]/u, s) !== null;
+ if (ArrayPrototypeSome.$call(patternParts, isBad)) return false;
// Check host parts from right to left first.
for (let i = hostParts.length - 1; i > 0; i -= 1) {
@@ -79,12 +79,12 @@ function check(hostParts, pattern, wildcards) {
const hostSubdomain = hostParts[0];
const patternSubdomain = patternParts[0];
- const patternSubdomainParts = StringPrototypeSplit.call(patternSubdomain, "*");
+ const patternSubdomainParts = StringPrototypeSplit.$call(patternSubdomain, "*");
// Short-circuit when the subdomain does not contain a wildcard.
// RFC 6125 does not allow wildcard substitution for components
// containing IDNA A-labels (Punycode) so match those verbatim.
- if (patternSubdomainParts.length === 1 || StringPrototypeIncludes.call(patternSubdomain, "xn--"))
+ if (patternSubdomainParts.length === 1 || StringPrototypeIncludes.$call(patternSubdomain, "xn--"))
return hostSubdomain === patternSubdomain;
if (!wildcards) return false;
@@ -99,9 +99,9 @@ function check(hostParts, pattern, wildcards) {
if (prefix.length + suffix.length > hostSubdomain.length) return false;
- if (!StringPrototypeStartsWith.call(hostSubdomain, prefix)) return false;
+ if (!StringPrototypeStartsWith.$call(hostSubdomain, prefix)) return false;
- if (!StringPrototypeEndsWith.call(hostSubdomain, suffix)) return false;
+ if (!StringPrototypeEndsWith.$call(hostSubdomain, suffix)) return false;
return true;
}
@@ -118,12 +118,12 @@ function splitEscapedAltNames(altNames) {
let currentToken = "";
let offset = 0;
while (offset !== altNames.length) {
- const nextSep = StringPrototypeIndexOf.call(altNames, ", ", offset);
- const nextQuote = StringPrototypeIndexOf.call(altNames, '"', offset);
+ const nextSep = StringPrototypeIndexOf.$call(altNames, ", ", offset);
+ const nextQuote = StringPrototypeIndexOf.$call(altNames, '"', offset);
if (nextQuote !== -1 && (nextSep === -1 || nextQuote < nextSep)) {
// There is a quote character and there is no separator before the quote.
- currentToken += StringPrototypeSubstring.call(altNames, offset, nextQuote);
- const match = RegExpPrototypeExec.call(jsonStringPattern, StringPrototypeSubstring.call(altNames, nextQuote));
+ currentToken += StringPrototypeSubstring.$call(altNames, offset, nextQuote);
+ const match = RegExpPrototypeExec.$call(jsonStringPattern, StringPrototypeSubstring.$call(altNames, nextQuote));
if (!match) {
let error = new SyntaxError("ERR_TLS_CERT_ALTNAME_FORMAT: Invalid subject alternative name string");
error.name = ERR_TLS_CERT_ALTNAME_FORMAT;
@@ -133,16 +133,16 @@ function splitEscapedAltNames(altNames) {
offset = nextQuote + match[0].length;
} else if (nextSep !== -1) {
// There is a separator and no quote before it.
- currentToken += StringPrototypeSubstring.call(altNames, offset, nextSep);
- ArrayPrototypePush.call(result, currentToken);
+ currentToken += StringPrototypeSubstring.$call(altNames, offset, nextSep);
+ ArrayPrototypePush.$call(result, currentToken);
currentToken = "";
offset = nextSep + 2;
} else {
- currentToken += StringPrototypeSubstring.call(altNames, offset);
+ currentToken += StringPrototypeSubstring.$call(altNames, offset);
offset = altNames.length;
}
}
- ArrayPrototypePush.call(result, currentToken);
+ ArrayPrototypePush.$call(result, currentToken);
return result;
}
@@ -155,14 +155,14 @@ function checkServerIdentity(hostname, cert) {
hostname = "" + hostname;
if (altNames) {
- const splitAltNames = StringPrototypeIncludes.call(altNames, '"')
+ const splitAltNames = StringPrototypeIncludes.$call(altNames, '"')
? splitEscapedAltNames(altNames)
- : StringPrototypeSplit.call(altNames, ", ");
- ArrayPrototypeForEach.call(splitAltNames, name => {
- if (StringPrototypeStartsWith.call(name, "DNS:")) {
- ArrayPrototypePush.call(dnsNames, StringPrototypeSlice.call(name, 4));
- } else if (StringPrototypeStartsWith.call(name, "IP Address:")) {
- ArrayPrototypePush.call(ips, canonicalizeIP(StringPrototypeSlice.call(name, 11)));
+ : StringPrototypeSplit.$call(altNames, ", ");
+ ArrayPrototypeForEach.$call(splitAltNames, name => {
+ if (StringPrototypeStartsWith.$call(name, "DNS:")) {
+ ArrayPrototypePush.$call(dnsNames, StringPrototypeSlice.$call(name, 4));
+ } else if (StringPrototypeStartsWith.$call(name, "IP Address:")) {
+ ArrayPrototypePush.$call(ips, canonicalizeIP(StringPrototypeSlice.$call(name, 11)));
}
});
}
@@ -172,20 +172,20 @@ function checkServerIdentity(hostname, cert) {
hostname = unfqdn(hostname); // Remove trailing dot for error messages.
if (net.isIP(hostname)) {
- valid = ArrayPrototypeIncludes.call(ips, canonicalizeIP(hostname));
- if (!valid) reason = `IP: ${hostname} is not in the cert's list: ` + ArrayPrototypeJoin.call(ips, ", ");
+ valid = ArrayPrototypeIncludes.$call(ips, canonicalizeIP(hostname));
+ if (!valid) reason = `IP: ${hostname} is not in the cert's list: ` + ArrayPrototypeJoin.$call(ips, ", ");
} else if (dnsNames.length > 0 || subject?.CN) {
const hostParts = splitHost(hostname);
const wildcard = pattern => check(hostParts, pattern, true);
if (dnsNames.length > 0) {
- valid = ArrayPrototypeSome.call(dnsNames, wildcard);
+ valid = ArrayPrototypeSome.$call(dnsNames, wildcard);
if (!valid) reason = `Host: ${hostname}. is not in the cert's altnames: ${altNames}`;
} else {
// Match against Common Name only if no supported identifiers exist.
const cn = subject.CN;
- if (Array.isArray(cn)) valid = ArrayPrototypeSome.call(cn, wildcard);
+ if (Array.isArray(cn)) valid = ArrayPrototypeSome.$call(cn, wildcard);
else if (cn) valid = wildcard(cn);
if (!valid) reason = `Host: ${hostname}. is not cert's CN: ${cn}`;
@@ -281,7 +281,7 @@ function translatePeerCertificate(c) {
const info = c.infoAccess;
c.infoAccess = { __proto__: null };
// XXX: More key validation?
- RegExpPrototypeSymbolReplace.call(/([^\n:]*):([^\n]*)(?:\n|$)/g, info, (all, key, val) => {
+ RegExpPrototypeSymbolReplace.$call(/([^\n:]*):([^\n]*)(?:\n|$)/g, info, (all, key, val) => {
if (val.charCodeAt(0) === 0x22) {
// The translatePeerCertificate function is only
// used on internally created legacy certificate
@@ -290,7 +290,7 @@ function translatePeerCertificate(c) {
// so this should never throw.
val = JSONParse(val);
}
- if (key in c.infoAccess) ArrayPrototypePush.call(c.infoAccess[key], val);
+ if (key in c.infoAccess) ArrayPrototypePush.$call(c.infoAccess[key], val);
else c.infoAccess[key] = [val];
});
}
@@ -306,18 +306,15 @@ const TLSSocket = (function (InternalTLSSocket) {
value: "TLSSocket",
enumerable: false,
});
-
- return Object.defineProperty(
- function Socket(options) {
- return new InternalTLSSocket(options);
- },
- Symbol.hasInstance,
- {
- value(instance) {
- return instance instanceof InternalTLSSocket;
- },
+ function Socket(options) {
+ return new InternalTLSSocket(options);
+ }
+ Socket.prototype = InternalTLSSocket.prototype;
+ return Object.defineProperty(Socket, Symbol.hasInstance, {
+ value(instance) {
+ return instance instanceof InternalTLSSocket;
},
- );
+ });
})(
class TLSSocket extends InternalTCPSocket {
#secureContext;
@@ -630,7 +627,7 @@ function getCiphers() {
function convertProtocols(protocols) {
const lens = new Array(protocols.length);
const buff = Buffer.allocUnsafe(
- ArrayPrototypeReduce.call(
+ ArrayPrototypeReduce.$call(
protocols,
(p, c, i) => {
const len = Buffer.byteLength(c);
diff --git a/src/js/node/tty.js b/src/js/node/tty.js
index d5645c6da..6e138b0cf 100644
--- a/src/js/node/tty.js
+++ b/src/js/node/tty.js
@@ -1,36 +1,43 @@
const { ttySetMode, isatty, getWindowSize: _getWindowSize } = $lazy("tty");
+// primordials
+const NumberIsInteger = Number.isInteger;
+
function ReadStream(fd) {
if (!(this instanceof ReadStream)) return new ReadStream(fd);
if (fd >> 0 !== fd || fd < 0) throw new RangeError("fd must be a positive integer");
- const stream = require("node:fs").ReadStream.call(this, "", {
+ const stream = require("node:fs").ReadStream.$call(this, "", {
fd,
});
+ Object.setPrototypeOf(stream, ReadStream.prototype);
stream.isRaw = false;
- stream.isTTY = isatty(stream.fd);
+ stream.isTTY = true;
+
+ $assert(stream instanceof ReadStream);
return stream;
}
Object.defineProperty(ReadStream, "prototype", {
get() {
- const Real = require("node:fs").ReadStream.prototype;
+ const Prototype = Object.create(require("node:fs").ReadStream.prototype);
- Object.defineProperty(ReadStream, "prototype", { value: Real });
- ReadStream.prototype.setRawMode = function (flag) {
+ Prototype.setRawMode = function (flag) {
const mode = flag ? 1 : 0;
const err = ttySetMode(this.fd, mode);
if (err) {
- this.emit("error", new Error("setRawMode failed with errno:", err));
+ this.emit("error", new Error("setRawMode failed with errno: " + err));
return this;
}
this.isRaw = flag;
return this;
};
- return Real;
+ Object.defineProperty(ReadStream, "prototype", { value: Prototype });
+
+ return Prototype;
},
enumerable: true,
configurable: true,
@@ -95,7 +102,7 @@ function WriteStream(fd) {
if (!(this instanceof WriteStream)) return new WriteStream(fd);
if (fd >> 0 !== fd || fd < 0) throw new RangeError("fd must be a positive integer");
- const stream = require("node:fs").WriteStream.call(this, "", {
+ const stream = require("node:fs").WriteStream.$call(this, "", {
fd,
});
@@ -185,7 +192,7 @@ Object.defineProperty(WriteStream, "prototype", {
// Lazy load for startup performance.
if (OSRelease === undefined) {
const { release } = require("node:os");
- OSRelease = StringPrototypeSplit(release(), ".");
+ OSRelease = release().split(".");
}
// Windows 10 build 10586 is the first Windows release that supports 256
// colors. Windows 10 build 14931 is the first release that supports
@@ -216,14 +223,12 @@ Object.defineProperty(WriteStream, "prototype", {
}
if ("TEAMCITY_VERSION" in env) {
- return RegExpPrototypeExec(/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/, env.TEAMCITY_VERSION) !== null
- ? COLORS_16
- : COLORS_2;
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? COLORS_16 : COLORS_2;
}
switch (env.TERM_PROGRAM) {
case "iTerm.app":
- if (!env.TERM_PROGRAM_VERSION || RegExpPrototypeExec(/^[0-2]\./, env.TERM_PROGRAM_VERSION) !== null) {
+ if (!env.TERM_PROGRAM_VERSION || /^[0-2]\./.test(env.TERM_PROGRAM_VERSION)) {
return COLORS_256;
}
return COLORS_16m;
@@ -239,16 +244,16 @@ Object.defineProperty(WriteStream, "prototype", {
}
if (env.TERM) {
- if (RegExpPrototypeExec(/^xterm-256/, env.TERM) !== null) {
+ if (/^xterm-256/.test(env.TERM) !== null) {
return COLORS_256;
}
- const termEnv = StringPrototypeToLowerCase(env.TERM);
+ const termEnv = env.TERM.toLowerCase();
if (TERM_ENVS[termEnv]) {
return TERM_ENVS[termEnv];
}
- if (ArrayPrototypeSome(TERM_ENVS_REG_EXP, term => RegExpPrototypeExec(term, termEnv) !== null)) {
+ if (TERM_ENVS_REG_EXP.some(term => term.test(termEnv))) {
return COLORS_16;
}
}
@@ -286,7 +291,7 @@ Object.defineProperty(WriteStream, "prototype", {
var validateInteger = (value, name, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) => {
if (typeof value !== "number") throw new ERR_INVALID_ARG_TYPE(name, "number", value);
- if (!Number.isInteger(value)) throw new ERR_OUT_OF_RANGE(name, "an integer", value);
+ if (!NumberIsInteger(value)) throw new ERR_OUT_OF_RANGE(name, "an integer", value);
if (value < min || value > max) throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);
};
diff --git a/src/js/node/url.js b/src/js/node/url.js
index 3b6b57ac2..f5823cdc2 100644
--- a/src/js/node/url.js
+++ b/src/js/node/url.js
@@ -370,7 +370,8 @@ Url.prototype.parse = function (url, parseQueryString, slashesDenoteHost) {
this.search = rest.substr(qm);
this.query = rest.substr(qm + 1);
if (parseQueryString) {
- this.query = new URLSearchParams(this.query);
+ const query = this.query;
+ this.query = new URLSearchParams(query).toJSON();
}
rest = rest.slice(0, qm);
} else if (parseQueryString) {
@@ -409,7 +410,7 @@ function urlFormat(obj) {
obj = urlParse(obj);
}
if (!(obj instanceof Url)) {
- return Url.prototype.format.call(obj);
+ return Url.prototype.format.$call(obj);
}
return obj.format();
}
diff --git a/src/js/node/util.js b/src/js/node/util.js
index 10dc95e2e..dae341448 100644
--- a/src/js/node/util.js
+++ b/src/js/node/util.js
@@ -1,20 +1,13 @@
// Hardcoded module "node:util"
const types = require("node:util/types");
+/** @type {import('node-inspect-extracted')} */
+const utl = require("internal/util/inspect");
var cjs_exports = {};
-function isBufferInterface({ copy, fill, readUint8 }) {
- return typeof copy === "function" && typeof fill === "function" && typeof readUint8 === "function";
-}
-
function isBuffer(value) {
- return (
- Buffer.isBuffer(value) ||
- // incase it ends up as a browserify buffer
- (typeof value === "object" && isBufferInterface(value || {}))
- );
+ return Buffer.isBuffer(value);
}
-
function isFunction(value) {
return typeof value === "function";
}
@@ -22,55 +15,11 @@ function isFunction(value) {
const deepEquals = Bun.deepEquals;
const isDeepStrictEqual = (a, b) => deepEquals(a, b, true);
var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors;
-var formatRegExp = /%[sdjfoc%]/g;
-// This function is nowhere near what Node.js does but it is close enough of a shim.
-function formatWithOptions(inspectOptions, f) {
- if (!isString(f)) {
- var objects = [];
- for (var i = 0; i < arguments.length; i++) {
- objects.push(inspect(arguments[i], inspectOptions));
- }
- return objects.join(" ");
- }
- var i = 2;
- var args = arguments;
- var len = args.length;
- var str = String(f).replace(formatRegExp, function (x2) {
- if (x2 === "%%") return "%";
- if (i >= len) return x2;
- switch (x2) {
- case "%s":
- return String(args[i++]);
- case "%f":
- return Number(args[i++]);
- case "%d":
- return Math.round(Number(args[i++]));
- case "%j":
- try {
- return JSON.stringify(args[i++]);
- } catch (_) {
- return "[Circular]";
- }
- case "%o":
- return inspect(args[i++], { showHidden: true, showProxy: true, ...inspectOptions });
- case "%O":
- return inspect(args[i++], { showHidden: true, showProxy: true, ...inspectOptions });
- default:
- return x2;
- }
- });
- for (var x = args[i]; i < len; x = args[++i]) {
- if (isNull(x) || !isObject(x)) {
- str += " " + x;
- } else {
- str += " " + inspect(x, inspectOptions);
- }
- }
- return str;
-}
-function format(...args) {
- return formatWithOptions({}, ...args);
-}
+
+const inspect = utl.inspect;
+const formatWithOptions = utl.formatWithOptions;
+const format = utl.format;
+const stripVTControlCharacters = utl.stripVTControlCharacters;
function deprecate(fn, msg, code) {
if (process.noDeprecation === true) {
@@ -91,7 +40,7 @@ function deprecate(fn, msg, code) {
}
warned = true;
}
- return fn.apply(this, arguments);
+ return fn.$apply(this, arguments);
}
return deprecated;
}
@@ -114,7 +63,7 @@ function debuglog(set) {
if (debugEnvRegex.test(set)) {
var pid = process.pid;
debugs[set] = function () {
- var msg = format.apply(cjs_exports, arguments);
+ var msg = format.$apply(cjs_exports, arguments);
console.error("%s %d: %s", set, pid, msg);
};
} else {
@@ -123,277 +72,6 @@ function debuglog(set) {
}
return debugs[set];
}
-var kInspectCustom = Symbol.for("nodejs.util.inspect.custom");
-function inspect(obj, opts) {
- var ctx = {
- seen: [],
- stylize: stylizeNoColor,
- };
- if (arguments.length >= 3) ctx.depth = arguments[2];
- if (arguments.length >= 4) ctx.colors = arguments[3];
- if (isBoolean(opts)) {
- ctx.showHidden = opts;
- } else if (opts) {
- _extend(ctx, opts);
- }
- if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
- if (isUndefined(ctx.depth)) ctx.depth = 2;
- if (isUndefined(ctx.colors)) ctx.colors = false;
- if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
- if (ctx.colors) ctx.stylize = stylizeWithColor;
- return formatValue(ctx, obj, ctx.depth);
-}
-inspect.colors = {
- bold: [1, 22],
- italic: [3, 23],
- underline: [4, 24],
- inverse: [7, 27],
- white: [37, 39],
- grey: [90, 39],
- black: [30, 39],
- blue: [34, 39],
- cyan: [36, 39],
- green: [32, 39],
- magenta: [35, 39],
- red: [31, 39],
- yellow: [33, 39],
-};
-inspect.styles = {
- special: "cyan",
- number: "yellow",
- boolean: "yellow",
- undefined: "grey",
- null: "bold",
- string: "green",
- date: "magenta",
- regexp: "red",
-};
-inspect.custom = kInspectCustom;
-// JS polyfill doesnt support all these options
-inspect.defaultOptions = {
- showHidden: false,
- depth: 2,
- colors: false,
- customInspect: true,
- showProxy: false,
- maxArrayLength: 100,
- maxStringLength: 10000,
- breakLength: 80,
- compact: 3,
- sorted: false,
- getters: false,
- numericSeparator: false,
-};
-function stylizeWithColor(str, styleType) {
- const style = inspect.styles[styleType];
- if (style !== undefined) {
- const color = inspect.colors[style];
- if (color !== undefined) return `\u001b[${color[0]}m${str}\u001b[${color[1]}m`;
- }
- return str;
-}
-function stylizeNoColor(str, styleType) {
- return str;
-}
-function arrayToHash(array) {
- var hash = {};
- array.forEach(function (val, idx) {
- hash[val] = true;
- });
- return hash;
-}
-function formatValue(ctx, value, recurseTimes) {
- if (ctx.customInspect && value) {
- const customInspect = value[kInspectCustom];
- if (isFunction(customInspect)) {
- var ret = customInspect.call(value, recurseTimes, ctx, inspect);
- if (!isString(ret)) {
- ret = formatValue(ctx, ret, recurseTimes);
- }
- return ret;
- }
- }
- var primitive = formatPrimitive(ctx, value);
- if (primitive) {
- return primitive;
- }
- var keys = Object.keys(value).concat(Object.getOwnPropertySymbols(value));
- var visibleKeys = arrayToHash(keys);
- if (ctx.showHidden) {
- keys = Object.getOwnPropertyNames(value);
- }
- if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) {
- return formatError(value);
- }
- if (keys.length === 0) {
- if (isFunction(value)) {
- var name = value.name ? ": " + value.name : "";
- return ctx.stylize("[Function" + name + "]", "special");
- }
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
- }
- if (isDate(value)) {
- return ctx.stylize(Date.prototype.toString.call(value), "date");
- }
- if (isError(value)) {
- return formatError(value);
- }
- }
- var base = "",
- array = false,
- braces = ["{", "}"];
- if ($isArray(value)) {
- array = true;
- braces = ["[", "]"];
- }
- if (isFunction(value)) {
- var n = value.name ? ": " + value.name : "";
- base = " [Function" + n + "]";
- }
- if (isRegExp(value)) {
- base = " " + RegExp.prototype.toString.call(value);
- }
- if (isDate(value)) {
- base = " " + Date.prototype.toUTCString.call(value);
- }
- if (isError(value)) {
- base = " " + formatError(value);
- }
- if (keys.length === 0 && (!array || value.length == 0)) {
- return braces[0] + base + braces[1];
- }
- if (recurseTimes < 0) {
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
- } else {
- return ctx.stylize("[Object]", "special");
- }
- }
- ctx.seen.push(value);
- var output;
- if (array) {
- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
- } else {
- output = keys.map(function (key) {
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
- });
- }
- ctx.seen.pop();
- return reduceToSingleString(output, base, braces);
-}
-function formatPrimitive(ctx, value) {
- if (isUndefined(value)) return ctx.stylize("undefined", "undefined");
- if (isString(value)) {
- var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
- return ctx.stylize(simple, "string");
- }
- if (isNumber(value)) return ctx.stylize("" + value, "number");
- if (isBoolean(value)) return ctx.stylize("" + value, "boolean");
- if (isNull(value)) return ctx.stylize("null", "null");
-}
-function formatError(value) {
- return "[" + Error.prototype.toString.call(value) + "]";
-}
-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
- var output = [];
- for (var i = 0, l = value.length; i < l; ++i) {
- if (hasOwnProperty(value, String(i))) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));
- } else {
- output.push("");
- }
- }
- keys.forEach(function (key) {
- if (!key.match(/^\d+$/)) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
- }
- });
- return output;
-}
-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
- var name, str, desc;
- desc = Object.getOwnPropertyDescriptor(value, key) || {
- value: value[key],
- };
- if (desc.get) {
- if (desc.set) {
- str = ctx.stylize("[Getter/Setter]", "special");
- } else {
- str = ctx.stylize("[Getter]", "special");
- }
- } else {
- if (desc.set) {
- str = ctx.stylize("[Setter]", "special");
- }
- }
- if (!hasOwnProperty(visibleKeys, key)) {
- name = "[" + (typeof key === "symbol" ? key.description : key) + "]";
- }
- if (typeof key === "symbol") {
- name = "[" + ctx.stylize(`Symbol(${key.description})`, "string") + "]";
- }
- if (!str) {
- if (ctx.seen.indexOf(desc.value) < 0) {
- if (isNull(recurseTimes)) {
- str = formatValue(ctx, desc.value, null);
- } else {
- str = formatValue(ctx, desc.value, recurseTimes - 1);
- }
- if (str.indexOf("\n") > -1) {
- if (array) {
- str = str
- .split("\n")
- .map(function (line) {
- return " " + line;
- })
- .join("\n")
- .substr(2);
- } else {
- str =
- "\n" +
- str
- .split("\n")
- .map(function (line) {
- return " " + line;
- })
- .join("\n");
- }
- }
- } else {
- str = ctx.stylize("[Circular]", "special");
- }
- }
- if (isUndefined(name)) {
- if (array && key.match(/^\d+$/)) {
- return str;
- }
- name = JSON.stringify("" + key);
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
- name = name.substr(1, name.length - 2);
- name = ctx.stylize(name, "name");
- } else {
- name = name
- .replace(/'/g, "\\'")
- .replace(/\\"/g, '"')
- .replace(/(^"|"$)/g, "'");
- name = ctx.stylize(name, "string");
- }
- }
- return name + ": " + str;
-}
-function reduceToSingleString(output, base, braces) {
- var numLinesEst = 0;
- var length = output.reduce(function (prev, cur) {
- numLinesEst++;
- if (cur.indexOf("\n") >= 0) numLinesEst++;
- return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1;
- }, 0);
- if (length > 60) {
- return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n ") + " " + braces[1];
- }
- return braces[0] + base + " " + output.join(", ") + " " + braces[1];
-}
function isBoolean(arg) {
return typeof arg === "boolean";
@@ -447,7 +125,7 @@ function timestamp() {
return [d.getDate(), months[d.getMonth()], time].join(" ");
}
var log = function log() {
- console.log("%s - %s", timestamp(), format.apply(cjs_exports, arguments));
+ console.log("%s - %s", timestamp(), format.$apply(cjs_exports, arguments));
};
var inherits = function inherits(ctor, superCtor) {
ctor.super_ = superCtor;
@@ -469,9 +147,6 @@ var _extend = function (origin, add) {
}
return origin;
};
-function hasOwnProperty(obj, prop) {
- return Object.prototype.hasOwnProperty.call(obj, prop);
-}
var kCustomPromisifiedSymbol = Symbol.for("util.promisify.custom");
var promisify = function promisify(original) {
if (typeof original !== "function") throw new TypeError('The "original" argument must be of type Function');
@@ -506,7 +181,7 @@ var promisify = function promisify(original) {
}
});
try {
- original.apply(this, args);
+ original.$apply(this, args);
} catch (err) {
promiseReject(err);
}
@@ -537,16 +212,16 @@ function callbackify(original) {
throw new TypeError('The "original" argument must be of type Function');
}
function callbackified() {
- var args = Array.prototype.slice.call(arguments);
+ var args = Array.prototype.slice.$call(arguments);
var maybeCb = args.pop();
if (typeof maybeCb !== "function") {
throw new TypeError("The last argument must be of type Function");
}
var self = this;
var cb = function () {
- return maybeCb.apply(self, arguments);
+ return maybeCb.$apply(self, arguments);
};
- original.apply(this, args).then(
+ original.$apply(this, args).then(
function (ret) {
process.nextTick(cb, null, ret);
},
@@ -566,6 +241,7 @@ var toUSVString = input => {
export default Object.assign(cjs_exports, {
format,
formatWithOptions,
+ stripVTControlCharacters,
deprecate,
debuglog,
_extend,
diff --git a/src/js/node/worker_threads.ts b/src/js/node/worker_threads.ts
index f1f15b64e..df9b5bdf4 100644
--- a/src/js/node/worker_threads.ts
+++ b/src/js/node/worker_threads.ts
@@ -224,6 +224,10 @@ class Worker extends EventEmitter {
this.#worker.addEventListener("open", this.#onOpen.bind(this));
}
+ get threadId() {
+ return this.#worker.threadId;
+ }
+
ref() {
this.#worker.ref();
}
@@ -261,7 +265,7 @@ class Worker extends EventEmitter {
}
terminate() {
- var onExitPromise = this.#onExitPromise;
+ const onExitPromise = this.#onExitPromise;
if (onExitPromise) {
return $isPromise(onExitPromise) ? onExitPromise : Promise.resolve(onExitPromise);
}
diff --git a/src/js/node/zlib.js b/src/js/node/zlib.js
index 06c523b85..407fac4e4 100644
--- a/src/js/node/zlib.js
+++ b/src/js/node/zlib.js
@@ -43,10 +43,10 @@ var require_common = __commonJS({
var TYPED_OK =
typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Int32Array !== "undefined";
function _has(obj, key) {
- return Object.prototype.hasOwnProperty.call(obj, key);
+ return Object.prototype.hasOwnProperty.$call(obj, key);
}
exports.assign = function (obj) {
- var sources = Array.prototype.slice.call(arguments, 1);
+ var sources = Array.prototype.slice.$call(arguments, 1);
while (sources.length) {
var source = sources.shift();
if (!source) {
@@ -106,7 +106,7 @@ var require_common = __commonJS({
}
},
flattenChunks: function (chunks) {
- return [].concat.apply([], chunks);
+ return [].concat.$apply([], chunks);
},
};
exports.setTyped = function (on) {
@@ -4111,31 +4111,31 @@ var require_lib = __commonJS({
}
function Deflate(opts) {
if (!(this instanceof Deflate)) return new Deflate(opts);
- Zlib.call(this, opts, binding.DEFLATE);
+ Zlib.$call(this, opts, binding.DEFLATE);
}
function Inflate(opts) {
if (!(this instanceof Inflate)) return new Inflate(opts);
- Zlib.call(this, opts, binding.INFLATE);
+ Zlib.$call(this, opts, binding.INFLATE);
}
function Gzip(opts) {
if (!(this instanceof Gzip)) return new Gzip(opts);
- Zlib.call(this, opts, binding.GZIP);
+ Zlib.$call(this, opts, binding.GZIP);
}
function Gunzip(opts) {
if (!(this instanceof Gunzip)) return new Gunzip(opts);
- Zlib.call(this, opts, binding.GUNZIP);
+ Zlib.$call(this, opts, binding.GUNZIP);
}
function DeflateRaw(opts) {
if (!(this instanceof DeflateRaw)) return new DeflateRaw(opts);
- Zlib.call(this, opts, binding.DEFLATERAW);
+ Zlib.$call(this, opts, binding.DEFLATERAW);
}
function InflateRaw(opts) {
if (!(this instanceof InflateRaw)) return new InflateRaw(opts);
- Zlib.call(this, opts, binding.INFLATERAW);
+ Zlib.$call(this, opts, binding.INFLATERAW);
}
function Unzip(opts) {
if (!(this instanceof Unzip)) return new Unzip(opts);
- Zlib.call(this, opts, binding.UNZIP);
+ Zlib.$call(this, opts, binding.UNZIP);
}
function isValidFlushFlag(flag) {
return (
@@ -4151,7 +4151,7 @@ var require_lib = __commonJS({
var _this = this;
this._opts = opts = opts || {};
this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK;
- Transform.call(this, opts);
+ Transform.$call(this, opts);
if (opts.flush && !isValidFlushFlag(opts.flush)) {
throw new Error("Invalid flush flag: " + opts.flush);
}
diff --git a/src/js/out/InternalModuleRegistry+createInternalModuleById.h b/src/js/out/InternalModuleRegistry+createInternalModuleById.h
index a7b9c376e..9521f43a7 100644
--- a/src/js/out/InternalModuleRegistry+createInternalModuleById.h
+++ b/src/js/out/InternalModuleRegistry+createInternalModuleById.h
@@ -18,9 +18,15 @@ JSValue InternalModuleRegistry::createInternalModuleById(JSGlobalObject* globalO
case Field::InternalFSCp: {
INTERNAL_MODULE_REGISTRY_GENERATE(globalObject, vm, "internal:fs/cp"_s, "internal/fs/cp.js"_s, InternalModuleRegistryConstants::InternalFSCpCode, "builtin://internal/fs/cp"_s);
}
+ case Field::InternalPrimordials: {
+ INTERNAL_MODULE_REGISTRY_GENERATE(globalObject, vm, "internal:primordials"_s, "internal/primordials.js"_s, InternalModuleRegistryConstants::InternalPrimordialsCode, "builtin://internal/primordials"_s);
+ }
case Field::InternalShared: {
INTERNAL_MODULE_REGISTRY_GENERATE(globalObject, vm, "internal:shared"_s, "internal/shared.js"_s, InternalModuleRegistryConstants::InternalSharedCode, "builtin://internal/shared"_s);
}
+ case Field::InternalUtilInspect: {
+ INTERNAL_MODULE_REGISTRY_GENERATE(globalObject, vm, "internal:util/inspect"_s, "internal/util/inspect.js"_s, InternalModuleRegistryConstants::InternalUtilInspectCode, "builtin://internal/util/inspect"_s);
+ }
case Field::NodeAssert: {
INTERNAL_MODULE_REGISTRY_GENERATE(globalObject, vm, "node:assert"_s, "node/assert.js"_s, InternalModuleRegistryConstants::NodeAssertCode, "builtin://node/assert"_s);
}
diff --git a/src/js/out/InternalModuleRegistry+enum.h b/src/js/out/InternalModuleRegistry+enum.h
index b45f56c07..e065ad481 100644
--- a/src/js/out/InternalModuleRegistry+enum.h
+++ b/src/js/out/InternalModuleRegistry+enum.h
@@ -3,59 +3,61 @@ BunSqlite = 1,
InternalDebugger = 2,
InternalFSCpSync = 3,
InternalFSCp = 4,
-InternalShared = 5,
-NodeAssert = 6,
-NodeAssertStrict = 7,
-NodeAsyncHooks = 8,
-NodeChildProcess = 9,
-NodeCluster = 10,
-NodeConsole = 11,
-NodeCrypto = 12,
-NodeDgram = 13,
-NodeDiagnosticsChannel = 14,
-NodeDNS = 15,
-NodeDNSPromises = 16,
-NodeDomain = 17,
-NodeEvents = 18,
-NodeFS = 19,
-NodeFSPromises = 20,
-NodeHttp = 21,
-NodeHttp2 = 22,
-NodeHttps = 23,
-NodeInspector = 24,
-NodeNet = 25,
-NodeOS = 26,
-NodePathPosix = 27,
-NodePath = 28,
-NodePathWin32 = 29,
-NodePerfHooks = 30,
-NodePunycode = 31,
-NodeQuerystring = 32,
-NodeReadline = 33,
-NodeReadlinePromises = 34,
-NodeRepl = 35,
-NodeStreamConsumers = 36,
-NodeStream = 37,
-NodeStreamPromises = 38,
-NodeStreamWeb = 39,
-NodeTimers = 40,
-NodeTimersPromises = 41,
-NodeTLS = 42,
-NodeTraceEvents = 43,
-NodeTty = 44,
-NodeUrl = 45,
-NodeUtil = 46,
-NodeV8 = 47,
-NodeVM = 48,
-NodeWasi = 49,
-NodeWorkerThreads = 50,
-NodeZlib = 51,
-ThirdpartyDepd = 52,
-ThirdpartyDetectLibc = 53,
-ThirdpartyDetectLibcLinux = 54,
-ThirdpartyIsomorphicFetch = 55,
-ThirdpartyNodeFetch = 56,
-ThirdpartyUndici = 57,
-ThirdpartyVercelFetch = 58,
-ThirdpartyWS = 59,
+InternalPrimordials = 5,
+InternalShared = 6,
+InternalUtilInspect = 7,
+NodeAssert = 8,
+NodeAssertStrict = 9,
+NodeAsyncHooks = 10,
+NodeChildProcess = 11,
+NodeCluster = 12,
+NodeConsole = 13,
+NodeCrypto = 14,
+NodeDgram = 15,
+NodeDiagnosticsChannel = 16,
+NodeDNS = 17,
+NodeDNSPromises = 18,
+NodeDomain = 19,
+NodeEvents = 20,
+NodeFS = 21,
+NodeFSPromises = 22,
+NodeHttp = 23,
+NodeHttp2 = 24,
+NodeHttps = 25,
+NodeInspector = 26,
+NodeNet = 27,
+NodeOS = 28,
+NodePathPosix = 29,
+NodePath = 30,
+NodePathWin32 = 31,
+NodePerfHooks = 32,
+NodePunycode = 33,
+NodeQuerystring = 34,
+NodeReadline = 35,
+NodeReadlinePromises = 36,
+NodeRepl = 37,
+NodeStreamConsumers = 38,
+NodeStream = 39,
+NodeStreamPromises = 40,
+NodeStreamWeb = 41,
+NodeTimers = 42,
+NodeTimersPromises = 43,
+NodeTLS = 44,
+NodeTraceEvents = 45,
+NodeTty = 46,
+NodeUrl = 47,
+NodeUtil = 48,
+NodeV8 = 49,
+NodeVM = 50,
+NodeWasi = 51,
+NodeWorkerThreads = 52,
+NodeZlib = 53,
+ThirdpartyDepd = 54,
+ThirdpartyDetectLibc = 55,
+ThirdpartyDetectLibcLinux = 56,
+ThirdpartyIsomorphicFetch = 57,
+ThirdpartyNodeFetch = 58,
+ThirdpartyUndici = 59,
+ThirdpartyVercelFetch = 60,
+ThirdpartyWS = 61,
diff --git a/src/js/out/InternalModuleRegistry+numberOfModules.h b/src/js/out/InternalModuleRegistry+numberOfModules.h
index 5dbb103b3..af572e965 100644
--- a/src/js/out/InternalModuleRegistry+numberOfModules.h
+++ b/src/js/out/InternalModuleRegistry+numberOfModules.h
@@ -1 +1 @@
-#define BUN_INTERNAL_MODULE_COUNT 60
+#define BUN_INTERNAL_MODULE_COUNT 62
diff --git a/src/js/out/InternalModuleRegistryConstants.h b/src/js/out/InternalModuleRegistryConstants.h
index 0baa2b5fa..bdd7ac5dd 100644
--- a/src/js/out/InternalModuleRegistryConstants.h
+++ b/src/js/out/InternalModuleRegistryConstants.h
@@ -6,726 +6,750 @@ namespace InternalModuleRegistryConstants {
#if __APPLE__
//
-static constexpr ASCIILiteral BunFFICode = "(function (){\"use strict\";// src/js/out/tmp/bun/ffi.ts\nvar FFIBuilder = function(params, returnType, functionToCall, name) {\n const hasReturnType = typeof FFIType[returnType] === \"number\" && FFIType[returnType] !== FFIType.void;\n var paramNames = new Array(params.length), args = new Array(params.length);\n for (let i = 0;i < params.length; i++) {\n paramNames[i] = `p${i}`;\n const wrapper = ffiWrappers[FFIType[params[i]]];\n if (wrapper)\n args[i] = `(val=>${wrapper})(p${i})`;\n else\n @throwTypeError(`Unsupported type ${params[i]}. Must be one of: ${Object.keys(FFIType).sort().join(\", \")}`);\n }\n var code = `functionToCall(${args.join(\", \")})`;\n if (hasReturnType)\n if (FFIType[returnType] === FFIType.cstring)\n code = `return new __GlobalBunCString(${code})`;\n else\n code = `return ${code}`;\n var func = new Function(\"functionToCall\", ...paramNames, code);\n Object.defineProperty(func, \"name\", {\n value: name\n });\n var wrap;\n switch (paramNames.length) {\n case 0:\n wrap = () => func(functionToCall);\n break;\n case 1:\n wrap = (arg1) => func(functionToCall, arg1);\n break;\n case 2:\n wrap = (arg1, arg2) => func(functionToCall, arg1, arg2);\n break;\n case 3:\n wrap = (arg1, arg2, arg3) => func(functionToCall, arg1, arg2, arg3);\n break;\n case 4:\n wrap = (arg1, arg2, arg3, arg4) => func(functionToCall, arg1, arg2, arg3, arg4);\n break;\n case 5:\n wrap = (arg1, arg2, arg3, arg4, arg5) => func(functionToCall, arg1, arg2, arg3, arg4, arg5);\n break;\n case 6:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6);\n break;\n case 7:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7);\n break;\n case 8:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);\n break;\n case 9:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);\n break;\n default: {\n wrap = (...args2) => func(functionToCall, ...args2);\n break;\n }\n }\n return wrap.native = functionToCall, wrap.ptr = functionToCall.ptr, wrap;\n}, dlopen = function(path, options) {\n const result = nativeDLOpen(path, options);\n for (let key in result.symbols) {\n var symbol = result.symbols[key];\n if (options[key]\?.args\?.length || FFIType[options[key]\?.returns] === FFIType.cstring)\n result.symbols[key] = FFIBuilder(options[key].args \?\? [], options[key].returns \?\? FFIType.void, symbol, path.includes(\"/\") \? `${key} (${path.split(\"/\").pop()})` : `${key} (${path})`);\n else\n result.symbols[key].native = result.symbols[key];\n }\n return result.close = result.close.bind(result), result;\n}, linkSymbols = function(options) {\n const result = nativeLinkSymbols(options);\n for (let key in result.symbols) {\n var symbol = result.symbols[key];\n if (options[key]\?.args\?.length || FFIType[options[key]\?.returns] === FFIType.cstring)\n result.symbols[key] = FFIBuilder(options[key].args \?\? [], options[key].returns \?\? FFIType.void, symbol, key);\n else\n result.symbols[key].native = result.symbols[key];\n }\n return result;\n}, onCloseCFunction = function(close) {\n close();\n}, CFunction = function(options) {\n const identifier = `CFunction${cFunctionI++}`;\n var result = linkSymbols({\n [identifier]: options\n }), hasClosed = !1, close = result.close.bind(result);\n return result.symbols[identifier].close = () => {\n if (hasClosed || !close)\n return;\n hasClosed = !0, close(), close = void 0;\n }, cFunctionRegistry ||= new FinalizationRegistry(onCloseCFunction), cFunctionRegistry.register(result.symbols[identifier], result.symbols[identifier].close), result.symbols[identifier];\n}, $, FFIType = {\n \"0\": 0,\n \"1\": 1,\n \"2\": 2,\n \"3\": 3,\n \"4\": 4,\n \"5\": 5,\n \"6\": 6,\n \"7\": 7,\n \"8\": 8,\n \"9\": 9,\n \"10\": 10,\n \"11\": 11,\n \"12\": 12,\n \"13\": 13,\n \"14\": 14,\n \"15\": 15,\n \"16\": 16,\n \"17\": 17,\n bool: 11,\n c_int: 5,\n c_uint: 6,\n char: 0,\n \"char*\": 12,\n double: 9,\n f32: 10,\n f64: 9,\n float: 10,\n i16: 3,\n i32: 5,\n i64: 7,\n i8: 1,\n int: 5,\n int16_t: 3,\n int32_t: 5,\n int64_t: 7,\n int8_t: 1,\n isize: 7,\n u16: 4,\n u32: 6,\n u64: 8,\n u8: 2,\n uint16_t: 4,\n uint32_t: 6,\n uint64_t: 8,\n uint8_t: 2,\n usize: 8,\n \"void*\": 12,\n ptr: 12,\n pointer: 12,\n void: 13,\n cstring: 14,\n i64_fast: 15,\n u64_fast: 16,\n function: 17,\n callback: 17,\n fn: 17\n};\nvar ffi = globalThis.Bun.FFI, ptr = (arg1, arg2) => typeof arg2 === \"undefined\" \? ffi.ptr(arg1) : ffi.ptr(arg1, arg2), toBuffer = ffi.toBuffer, toArrayBuffer = ffi.toArrayBuffer, viewSource = ffi.viewSource, BunCString = ffi.CString, nativeLinkSymbols = ffi.linkSymbols, nativeDLOpen = ffi.dlopen, nativeCallback = ffi.callback, closeCallback = ffi.closeCallback;\ndelete ffi.callback;\ndelete ffi.closeCallback;\n\nclass JSCallback {\n constructor(cb, options) {\n const { ctx, ptr: ptr2 } = nativeCallback(options, cb);\n this.#ctx = ctx, this.ptr = ptr2, this.#threadsafe = !!options\?.threadsafe;\n }\n ptr;\n #ctx;\n #threadsafe;\n get threadsafe() {\n return this.#threadsafe;\n }\n [Symbol.toPrimitive]() {\n const { ptr: ptr2 } = this;\n return typeof ptr2 === \"number\" \? ptr2 : 0;\n }\n close() {\n const ctx = this.#ctx;\n if (this.ptr = null, this.#ctx = null, ctx)\n closeCallback(ctx);\n }\n}\n\nclass CString extends String {\n constructor(ptr2, byteOffset, byteLength) {\n super(ptr2 \? typeof byteLength === \"number\" && Number.isSafeInteger(byteLength) \? BunCString(ptr2, byteOffset || 0, byteLength) : BunCString(ptr2) : \"\");\n if (this.ptr = typeof ptr2 === \"number\" \? ptr2 : 0, typeof byteOffset !== \"undefined\")\n this.byteOffset = byteOffset;\n if (typeof byteLength !== \"undefined\")\n this.byteLength = byteLength;\n }\n ptr;\n byteOffset;\n byteLength;\n #cachedArrayBuffer;\n get arrayBuffer() {\n if (this.#cachedArrayBuffer)\n return this.#cachedArrayBuffer;\n if (!this.ptr)\n return this.#cachedArrayBuffer = new ArrayBuffer(0);\n return this.#cachedArrayBuffer = toArrayBuffer(this.ptr, this.byteOffset, this.byteLength);\n }\n}\nObject.defineProperty(globalThis, \"__GlobalBunCString\", {\n value: CString,\n enumerable: !1,\n configurable: !1\n});\nvar ffiWrappers = new Array(18), char = \"val|0\";\nffiWrappers.fill(char);\nffiWrappers[FFIType.uint8_t] = \"val<0\?0:val>=255\?255:val|0\";\nffiWrappers[FFIType.int16_t] = \"val<=-32768\?-32768:val>=32768\?32768:val|0\";\nffiWrappers[FFIType.uint16_t] = \"val<=0\?0:val>=65536\?65536:val|0\";\nffiWrappers[FFIType.int32_t] = \"val|0\";\nffiWrappers[FFIType.uint32_t] = \"val<=0\?0:val>=0xffffffff\?0xffffffff:+val||0\";\nffiWrappers[FFIType.i64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(-Number.MAX_SAFE_INTEGER)) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.i64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(-Number.MAX_SAFE_INTEGER)) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.u64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= 0) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.int64_t] = `{\n if (typeof val === \"bigint\") {\n return val;\n }\n\n if (typeof val === \"number\") {\n return BigInt(val || 0);\n }\n\n return BigInt(+val || 0);\n}`;\nffiWrappers[FFIType.uint64_t] = `{\n if (typeof val === \"bigint\") {\n return val;\n }\n\n if (typeof val === \"number\") {\n return val <= 0 \? BigInt(0) : BigInt(val || 0);\n }\n\n return BigInt(+val || 0);\n}`;\nffiWrappers[FFIType.u64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(0)) return Number(val);\n return val;\n }\n\n return typeof val === \"number\" \? (val <= 0 \? 0 : +val || 0) : +val || 0;\n}`;\nffiWrappers[FFIType.uint16_t] = `{\n const ret = (typeof val === \"bigint\" \? Number(val) : val) | 0;\n return ret <= 0 \? 0 : ret > 0xffff \? 0xffff : ret;\n}`;\nffiWrappers[FFIType.double] = `{\n if (typeof val === \"bigint\") {\n if (val.valueOf() < BigInt(Number.MAX_VALUE)) {\n return Math.abs(Number(val).valueOf()) + 0.00000000000001 - 0.00000000000001;\n }\n }\n\n if (!val) {\n return 0 + 0.00000000000001 - 0.00000000000001;\n }\n\n return val + 0.00000000000001 - 0.00000000000001;\n}`;\nffiWrappers[FFIType.float] = ffiWrappers[10] = `{\n return Math.fround(val);\n}`;\nffiWrappers[FFIType.bool] = `{\n return !!val;\n}`;\nObject.defineProperty(globalThis, \"__GlobalBunFFIPtrFunctionForWrapper\", {\n value: ptr,\n enumerable: !1,\n configurable: !0\n});\nffiWrappers[FFIType.cstring] = ffiWrappers[FFIType.pointer] = `{\n if (typeof val === \"number\") return val;\n if (!val) {\n return null;\n }\n\n if (ArrayBuffer.isView(val) || val instanceof ArrayBuffer) {\n return __GlobalBunFFIPtrFunctionForWrapper(val);\n }\n\n if (typeof val === \"string\") {\n throw new TypeError(\"To convert a string to a pointer, encode it as a buffer\");\n }\n\n throw new TypeError(\\`Unable to convert \\${ val } to a pointer\\`);\n}`;\nffiWrappers[FFIType.function] = `{\n if (typeof val === \"number\") {\n return val;\n }\n\n if (typeof val === \"bigint\") {\n return Number(val);\n }\n\n var ptr = val && val.ptr;\n\n if (!ptr) {\n throw new TypeError(\"Expected function to be a JSCallback or a number\");\n }\n\n return ptr;\n}`;\nvar native = {\n dlopen: nativeDLOpen,\n callback: () => {\n throw new Error(\"Deprecated. Use new JSCallback(options, fn) instead\");\n }\n}, cFunctionI = 0, cFunctionRegistry, read = ffi.read;\n$ = {\n CFunction,\n CString,\n FFIType,\n JSCallback,\n dlopen,\n linkSymbols,\n native,\n ptr,\n read,\n suffix: \"dylib\",\n toArrayBuffer,\n toBuffer,\n viewSource\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral BunFFICode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/bun/ffi.ts\nvar FFIBuilder = function(params, returnType, functionToCall, name) {\n const hasReturnType = typeof FFIType[returnType] === \"number\" && FFIType[returnType] !== FFIType.void;\n var paramNames = new @Array(params.length), args = new @Array(params.length);\n for (let i = 0;i < params.length; i++) {\n paramNames[i] = `p${i}`;\n const wrapper = ffiWrappers[FFIType[params[i]]];\n if (wrapper)\n args[i] = `(val=>${wrapper})(p${i})`;\n else\n @throwTypeError(`Unsupported type ${params[i]}. Must be one of: ${Object.keys(FFIType).sort().join(\", \")}`);\n }\n var code = `functionToCall(${args.join(\", \")})`;\n if (hasReturnType)\n if (FFIType[returnType] === FFIType.cstring)\n code = `return new __GlobalBunCString(${code})`;\n else\n code = `return ${code}`;\n var func = new Function(\"functionToCall\", ...paramNames, code);\n Object.defineProperty(func, \"name\", {\n value: name\n });\n var wrap;\n switch (paramNames.length) {\n case 0:\n wrap = () => func(functionToCall);\n break;\n case 1:\n wrap = (arg1) => func(functionToCall, arg1);\n break;\n case 2:\n wrap = (arg1, arg2) => func(functionToCall, arg1, arg2);\n break;\n case 3:\n wrap = (arg1, arg2, arg3) => func(functionToCall, arg1, arg2, arg3);\n break;\n case 4:\n wrap = (arg1, arg2, arg3, arg4) => func(functionToCall, arg1, arg2, arg3, arg4);\n break;\n case 5:\n wrap = (arg1, arg2, arg3, arg4, arg5) => func(functionToCall, arg1, arg2, arg3, arg4, arg5);\n break;\n case 6:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6);\n break;\n case 7:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7);\n break;\n case 8:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);\n break;\n case 9:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);\n break;\n default: {\n wrap = (...args2) => func(functionToCall, ...args2);\n break;\n }\n }\n return wrap.native = functionToCall, wrap.ptr = functionToCall.ptr, wrap;\n}, dlopen = function(path, options) {\n const result = nativeDLOpen(path, options);\n if (result instanceof Error)\n throw result;\n for (let key in result.symbols) {\n var symbol = result.symbols[key];\n if (options[key]\?.args\?.length || FFIType[options[key]\?.returns] === FFIType.cstring)\n result.symbols[key] = FFIBuilder(options[key].args \?\? [], options[key].returns \?\? FFIType.void, symbol, path.includes(\"/\") \? `${key} (${path.split(\"/\").pop()})` : `${key} (${path})`);\n else\n result.symbols[key].native = result.symbols[key];\n }\n return result.close = result.close.bind(result), result;\n}, linkSymbols = function(options) {\n const result = nativeLinkSymbols(options);\n for (let key in result.symbols) {\n var symbol = result.symbols[key];\n if (options[key]\?.args\?.length || FFIType[options[key]\?.returns] === FFIType.cstring)\n result.symbols[key] = FFIBuilder(options[key].args \?\? [], options[key].returns \?\? FFIType.void, symbol, key);\n else\n result.symbols[key].native = result.symbols[key];\n }\n return result;\n}, onCloseCFunction = function(close) {\n close();\n}, CFunction = function(options) {\n const identifier = `CFunction${cFunctionI++}`;\n var result = linkSymbols({\n [identifier]: options\n }), hasClosed = !1, close = result.close.bind(result);\n return result.symbols[identifier].close = () => {\n if (hasClosed || !close)\n return;\n hasClosed = !0, close(), close = @undefined;\n }, cFunctionRegistry ||= new FinalizationRegistry(onCloseCFunction), cFunctionRegistry.register(result.symbols[identifier], result.symbols[identifier].close), result.symbols[identifier];\n}, $, FFIType = {\n \"0\": 0,\n \"1\": 1,\n \"2\": 2,\n \"3\": 3,\n \"4\": 4,\n \"5\": 5,\n \"6\": 6,\n \"7\": 7,\n \"8\": 8,\n \"9\": 9,\n \"10\": 10,\n \"11\": 11,\n \"12\": 12,\n \"13\": 13,\n \"14\": 14,\n \"15\": 15,\n \"16\": 16,\n \"17\": 17,\n bool: 11,\n c_int: 5,\n c_uint: 6,\n char: 0,\n \"char*\": 12,\n double: 9,\n f32: 10,\n f64: 9,\n float: 10,\n i16: 3,\n i32: 5,\n i64: 7,\n i8: 1,\n int: 5,\n int16_t: 3,\n int32_t: 5,\n int64_t: 7,\n int8_t: 1,\n isize: 7,\n u16: 4,\n u32: 6,\n u64: 8,\n u8: 2,\n uint16_t: 4,\n uint32_t: 6,\n uint64_t: 8,\n uint8_t: 2,\n usize: 8,\n \"void*\": 12,\n ptr: 12,\n pointer: 12,\n void: 13,\n cstring: 14,\n i64_fast: 15,\n u64_fast: 16,\n function: 17,\n callback: 17,\n fn: 17\n};\nvar ffi = globalThis.Bun.FFI, ptr = (arg1, arg2) => typeof arg2 === \"undefined\" \? ffi.ptr(arg1) : ffi.ptr(arg1, arg2), toBuffer = ffi.toBuffer, toArrayBuffer = ffi.toArrayBuffer, viewSource = ffi.viewSource, BunCString = ffi.CString, nativeLinkSymbols = ffi.linkSymbols, nativeDLOpen = ffi.dlopen, nativeCallback = ffi.callback, closeCallback = ffi.closeCallback;\ndelete ffi.callback;\ndelete ffi.closeCallback;\n\nclass JSCallback {\n constructor(cb, options) {\n const { ctx, ptr: ptr2 } = nativeCallback(options, cb);\n this.#ctx = ctx, this.ptr = ptr2, this.#threadsafe = !!options\?.threadsafe;\n }\n ptr;\n #ctx;\n #threadsafe;\n get threadsafe() {\n return this.#threadsafe;\n }\n [Symbol.toPrimitive]() {\n const { ptr: ptr2 } = this;\n return typeof ptr2 === \"number\" \? ptr2 : 0;\n }\n close() {\n const ctx = this.#ctx;\n if (this.ptr = null, this.#ctx = null, ctx)\n closeCallback(ctx);\n }\n}\n\nclass CString extends @String {\n constructor(ptr2, byteOffset, byteLength) {\n super(ptr2 \? typeof byteLength === \"number\" && Number.isSafeInteger(byteLength) \? BunCString(ptr2, byteOffset || 0, byteLength) : BunCString(ptr2) : \"\");\n if (this.ptr = typeof ptr2 === \"number\" \? ptr2 : 0, typeof byteOffset !== \"undefined\")\n this.byteOffset = byteOffset;\n if (typeof byteLength !== \"undefined\")\n this.byteLength = byteLength;\n }\n ptr;\n byteOffset;\n byteLength;\n #cachedArrayBuffer;\n get arrayBuffer() {\n if (this.#cachedArrayBuffer)\n return this.#cachedArrayBuffer;\n if (!this.ptr)\n return this.#cachedArrayBuffer = new @ArrayBuffer(0);\n return this.#cachedArrayBuffer = toArrayBuffer(this.ptr, this.byteOffset, this.byteLength);\n }\n}\nObject.defineProperty(globalThis, \"__GlobalBunCString\", {\n value: CString,\n enumerable: !1,\n configurable: !1\n});\nvar ffiWrappers = new @Array(18), char = \"val|0\";\nffiWrappers.fill(char);\nffiWrappers[FFIType.uint8_t] = \"val<0\?0:val>=255\?255:val|0\";\nffiWrappers[FFIType.int16_t] = \"val<=-32768\?-32768:val>=32768\?32768:val|0\";\nffiWrappers[FFIType.uint16_t] = \"val<=0\?0:val>=65536\?65536:val|0\";\nffiWrappers[FFIType.int32_t] = \"val|0\";\nffiWrappers[FFIType.uint32_t] = \"val<=0\?0:val>=0xffffffff\?0xffffffff:+val||0\";\nffiWrappers[FFIType.i64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(-Number.MAX_SAFE_INTEGER)) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.i64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(-Number.MAX_SAFE_INTEGER)) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.u64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= 0) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.int64_t] = `{\n if (typeof val === \"bigint\") {\n return val;\n }\n\n if (typeof val === \"number\") {\n return BigInt(val || 0);\n }\n\n return BigInt(+val || 0);\n}`;\nffiWrappers[FFIType.uint64_t] = `{\n if (typeof val === \"bigint\") {\n return val;\n }\n\n if (typeof val === \"number\") {\n return val <= 0 \? BigInt(0) : BigInt(val || 0);\n }\n\n return BigInt(+val || 0);\n}`;\nffiWrappers[FFIType.u64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(0)) return Number(val);\n return val;\n }\n\n return typeof val === \"number\" \? (val <= 0 \? 0 : +val || 0) : +val || 0;\n}`;\nffiWrappers[FFIType.uint16_t] = `{\n const ret = (typeof val === \"bigint\" \? Number(val) : val) | 0;\n return ret <= 0 \? 0 : ret > 0xffff \? 0xffff : ret;\n}`;\nffiWrappers[FFIType.double] = `{\n if (typeof val === \"bigint\") {\n if (val.valueOf() < BigInt(Number.MAX_VALUE)) {\n return Math.abs(Number(val).valueOf()) + 0.00000000000001 - 0.00000000000001;\n }\n }\n\n if (!val) {\n return 0 + 0.00000000000001 - 0.00000000000001;\n }\n\n return val + 0.00000000000001 - 0.00000000000001;\n}`;\nffiWrappers[FFIType.float] = ffiWrappers[10] = `{\n return Math.fround(val);\n}`;\nffiWrappers[FFIType.bool] = `{\n return !!val;\n}`;\nObject.defineProperty(globalThis, \"__GlobalBunFFIPtrFunctionForWrapper\", {\n value: ptr,\n enumerable: !1,\n configurable: !0\n});\nffiWrappers[FFIType.cstring] = ffiWrappers[FFIType.pointer] = `{\n if (typeof val === \"number\") return val;\n if (!val) {\n return null;\n }\n\n if (ArrayBuffer.isView(val) || val instanceof ArrayBuffer) {\n return __GlobalBunFFIPtrFunctionForWrapper(val);\n }\n\n if (typeof val === \"string\") {\n throw new TypeError(\"To convert a string to a pointer, encode it as a buffer\");\n }\n\n throw new TypeError(\\`Unable to convert \\${ val } to a pointer\\`);\n}`;\nffiWrappers[FFIType.function] = `{\n if (typeof val === \"number\") {\n return val;\n }\n\n if (typeof val === \"bigint\") {\n return Number(val);\n }\n\n var ptr = val && val.ptr;\n\n if (!ptr) {\n throw new TypeError(\"Expected function to be a JSCallback or a number\");\n }\n\n return ptr;\n}`;\nvar native = {\n dlopen: nativeDLOpen,\n callback: () => {\n throw new Error(\"Deprecated. Use new JSCallback(options, fn) instead\");\n }\n}, cFunctionI = 0, cFunctionRegistry, read = ffi.read;\n$ = {\n CFunction,\n CString,\n FFIType,\n JSCallback,\n dlopen,\n linkSymbols,\n native,\n ptr,\n read,\n suffix: \"dylib\",\n toArrayBuffer,\n toBuffer,\n viewSource\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral BunSqliteCode = "(function (){\"use strict\";// src/js/out/tmp/bun/sqlite.ts\nvar $, defineProperties = Object.defineProperties, toStringTag = Symbol.toStringTag, isArray = Array.isArray, isTypedArray = ArrayBuffer.isView, constants = {\n SQLITE_OPEN_READONLY: 1,\n SQLITE_OPEN_READWRITE: 2,\n SQLITE_OPEN_CREATE: 4,\n SQLITE_OPEN_DELETEONCLOSE: 8,\n SQLITE_OPEN_EXCLUSIVE: 16,\n SQLITE_OPEN_AUTOPROXY: 32,\n SQLITE_OPEN_URI: 64,\n SQLITE_OPEN_MEMORY: 128,\n SQLITE_OPEN_MAIN_DB: 256,\n SQLITE_OPEN_TEMP_DB: 512,\n SQLITE_OPEN_TRANSIENT_DB: 1024,\n SQLITE_OPEN_MAIN_JOURNAL: 2048,\n SQLITE_OPEN_TEMP_JOURNAL: 4096,\n SQLITE_OPEN_SUBJOURNAL: 8192,\n SQLITE_OPEN_SUPER_JOURNAL: 16384,\n SQLITE_OPEN_NOMUTEX: 32768,\n SQLITE_OPEN_FULLMUTEX: 65536,\n SQLITE_OPEN_SHAREDCACHE: 131072,\n SQLITE_OPEN_PRIVATECACHE: 262144,\n SQLITE_OPEN_WAL: 524288,\n SQLITE_OPEN_NOFOLLOW: 16777216,\n SQLITE_OPEN_EXRESCODE: 33554432,\n SQLITE_PREPARE_PERSISTENT: 1,\n SQLITE_PREPARE_NORMALIZE: 2,\n SQLITE_PREPARE_NO_VTAB: 4\n}, SQL, controllers;\n\nclass Statement {\n constructor(raw) {\n switch (this.#raw = raw, raw.paramsCount) {\n case 0: {\n this.get = this.#getNoArgs, this.all = this.#allNoArgs, this.values = this.#valuesNoArgs, this.run = this.#runNoArgs;\n break;\n }\n default: {\n this.get = this.#get, this.all = this.#all, this.values = this.#values, this.run = this.#run;\n break;\n }\n }\n }\n #raw;\n get;\n all;\n values;\n run;\n isFinalized = !1;\n toJSON() {\n return {\n sql: this.native.toString(),\n isFinalized: this.isFinalized,\n paramsCount: this.paramsCount,\n columnNames: this.columnNames\n };\n }\n get [toStringTag]() {\n return `\"${this.native.toString()}\"`;\n }\n toString() {\n return this.native.toString();\n }\n get native() {\n return this.#raw;\n }\n #getNoArgs() {\n return this.#raw.get();\n }\n #allNoArgs() {\n return this.#raw.all();\n }\n #valuesNoArgs() {\n return this.#raw.values();\n }\n #runNoArgs() {\n this.#raw.run();\n }\n #get(...args) {\n if (args.length === 0)\n return this.#getNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.get(args) : this.#raw.get(...args);\n }\n #all(...args) {\n if (args.length === 0)\n return this.#allNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.all(args) : this.#raw.all(...args);\n }\n #values(...args) {\n if (args.length === 0)\n return this.#valuesNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.values(args) : this.#raw.values(...args);\n }\n #run(...args) {\n if (args.length === 0)\n return this.#runNoArgs();\n var arg0 = args[0];\n !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.run(args) : this.#raw.run(...args);\n }\n get columnNames() {\n return this.#raw.columns;\n }\n get paramsCount() {\n return this.#raw.paramsCount;\n }\n finalize(...args) {\n return this.isFinalized = !0, this.#raw.finalize(...args);\n }\n}\nvar cachedCount = Symbol.for(\"Bun.Database.cache.count\");\n\nclass Database {\n constructor(filenameGiven, options) {\n if (typeof filenameGiven === \"undefined\")\n ;\n else if (typeof filenameGiven !== \"string\") {\n if (isTypedArray(filenameGiven)) {\n this.#handle = Database.deserialize(filenameGiven, typeof options === \"object\" && options \? !!options.readonly : ((options | 0) & constants.SQLITE_OPEN_READONLY) != 0), this.filename = \":memory:\";\n return;\n }\n @throwTypeError(`Expected 'filename' to be a string, got '${typeof filenameGiven}'`);\n }\n var filename = typeof filenameGiven === \"string\" \? filenameGiven.trim() : \":memory:\", flags = constants.SQLITE_OPEN_READWRITE | constants.SQLITE_OPEN_CREATE;\n if (typeof options === \"object\" && options) {\n if (flags = 0, options.readonly)\n flags = constants.SQLITE_OPEN_READONLY;\n if (\"readOnly\" in options)\n @throwTypeError('Misspelled option \"readOnly\" should be \"readonly\"');\n if (options.create)\n flags = constants.SQLITE_OPEN_READWRITE | constants.SQLITE_OPEN_CREATE;\n if (options.readwrite)\n flags |= constants.SQLITE_OPEN_READWRITE;\n } else if (typeof options === \"number\")\n flags = options;\n const anonymous = filename === \"\" || filename === \":memory:\";\n if (anonymous && (flags & constants.SQLITE_OPEN_READONLY) !== 0)\n throw new Error(\"Cannot open an anonymous database in read-only mode.\");\n if (!SQL)\n SQL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"sqlite\");\n this.#handle = SQL.open(anonymous \? \":memory:\" : filename, flags), this.filename = filename;\n }\n #handle;\n #cachedQueriesKeys = [];\n #cachedQueriesLengths = [];\n #cachedQueriesValues = [];\n filename;\n get handle() {\n return this.#handle;\n }\n get inTransaction() {\n return SQL.isInTransaction(this.#handle);\n }\n static open(filename, options) {\n return new Database(filename, options);\n }\n loadExtension(name, entryPoint) {\n return SQL.loadExtension(this.#handle, name, entryPoint);\n }\n serialize(optionalName) {\n return SQL.serialize(this.#handle, optionalName || \"main\");\n }\n static deserialize(serialized, isReadOnly = !1) {\n if (!SQL)\n SQL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"sqlite\");\n return SQL.deserialize(serialized, isReadOnly);\n }\n static setCustomSQLite(path) {\n if (!SQL)\n SQL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"sqlite\");\n return SQL.setCustomSQLite(path);\n }\n close() {\n return this.clearQueryCache(), SQL.close(this.#handle);\n }\n clearQueryCache() {\n for (let item of this.#cachedQueriesValues)\n item.finalize();\n this.#cachedQueriesKeys.length = 0, this.#cachedQueriesValues.length = 0, this.#cachedQueriesLengths.length = 0;\n }\n run(query, ...params) {\n if (params.length === 0) {\n SQL.run(this.#handle, query);\n return;\n }\n var arg0 = params[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? SQL.run(this.#handle, query, params) : SQL.run(this.#handle, query, ...params);\n }\n prepare(query, params, flags) {\n return new Statement(SQL.prepare(this.#handle, query, params, flags || 0));\n }\n static MAX_QUERY_CACHE_SIZE = 20;\n get [cachedCount]() {\n return this.#cachedQueriesKeys.length;\n }\n query(query) {\n if (typeof query !== \"string\")\n @throwTypeError(`Expected 'query' to be a string, got '${typeof query}'`);\n if (query.length === 0)\n throw new Error(\"SQL query cannot be empty.\");\n var index = this.#cachedQueriesLengths.indexOf(query.length);\n while (index !== -1) {\n if (this.#cachedQueriesKeys[index] !== query) {\n index = this.#cachedQueriesLengths.indexOf(query.length, index + 1);\n continue;\n }\n var stmt = this.#cachedQueriesValues[index];\n if (stmt.isFinalized)\n return this.#cachedQueriesValues[index] = this.prepare(query, void 0, willCache \? constants.SQLITE_PREPARE_PERSISTENT : 0);\n return stmt;\n }\n const willCache = this.#cachedQueriesKeys.length < Database.MAX_QUERY_CACHE_SIZE;\n var stmt = this.prepare(query, void 0, willCache \? constants.SQLITE_PREPARE_PERSISTENT : 0);\n if (willCache)\n this.#cachedQueriesKeys.push(query), this.#cachedQueriesLengths.push(query.length), this.#cachedQueriesValues.push(stmt);\n return stmt;\n }\n transaction(fn, self) {\n if (typeof fn !== \"function\")\n @throwTypeError(\"Expected first argument to be a function\");\n const db = this, controller = getController(db, self), properties = {\n default: { value: wrapTransaction(fn, db, controller.default) },\n deferred: { value: wrapTransaction(fn, db, controller.deferred) },\n immediate: {\n value: wrapTransaction(fn, db, controller.immediate)\n },\n exclusive: {\n value: wrapTransaction(fn, db, controller.exclusive)\n },\n database: { value: this, enumerable: !0 }\n };\n return defineProperties(properties.default.value, properties), defineProperties(properties.deferred.value, properties), defineProperties(properties.immediate.value, properties), defineProperties(properties.exclusive.value, properties), properties.default.value;\n }\n}\nDatabase.prototype.exec = Database.prototype.run;\nvar getController = (db, self) => {\n let controller = (controllers ||= new WeakMap).get(db);\n if (!controller) {\n const shared = {\n commit: db.prepare(\"COMMIT\", void 0, 0),\n rollback: db.prepare(\"ROLLBACK\", void 0, 0),\n savepoint: db.prepare(\"SAVEPOINT `\\t_bs3.\\t`\", void 0, 0),\n release: db.prepare(\"RELEASE `\\t_bs3.\\t`\", void 0, 0),\n rollbackTo: db.prepare(\"ROLLBACK TO `\\t_bs3.\\t`\", void 0, 0)\n };\n controllers.set(db, controller = {\n default: Object.assign({ begin: db.prepare(\"BEGIN\", void 0, 0) }, shared),\n deferred: Object.assign({ begin: db.prepare(\"BEGIN DEFERRED\", void 0, 0) }, shared),\n immediate: Object.assign({ begin: db.prepare(\"BEGIN IMMEDIATE\", void 0, 0) }, shared),\n exclusive: Object.assign({ begin: db.prepare(\"BEGIN EXCLUSIVE\", void 0, 0) }, shared)\n });\n }\n return controller;\n}, wrapTransaction = (fn, db, { begin, commit, rollback, savepoint, release, rollbackTo }) => function transaction(...args) {\n let before, after, undo;\n if (db.inTransaction)\n before = savepoint, after = release, undo = rollbackTo;\n else\n before = begin, after = commit, undo = rollback;\n try {\n before.run();\n const result = fn.apply(this, args);\n return after.run(), result;\n } catch (ex) {\n if (db.inTransaction) {\n if (undo.run(), undo !== rollback)\n after.run();\n }\n throw ex;\n }\n};\n$ = {\n __esModule: !0,\n Database,\n Statement,\n constants,\n default: Database\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral BunSqliteCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/bun/sqlite.ts\nvar $, defineProperties = Object.defineProperties, toStringTag = Symbol.toStringTag, isArray = @Array.isArray, isTypedArray = @ArrayBuffer.isView, constants = {\n SQLITE_OPEN_READONLY: 1,\n SQLITE_OPEN_READWRITE: 2,\n SQLITE_OPEN_CREATE: 4,\n SQLITE_OPEN_DELETEONCLOSE: 8,\n SQLITE_OPEN_EXCLUSIVE: 16,\n SQLITE_OPEN_AUTOPROXY: 32,\n SQLITE_OPEN_URI: 64,\n SQLITE_OPEN_MEMORY: 128,\n SQLITE_OPEN_MAIN_DB: 256,\n SQLITE_OPEN_TEMP_DB: 512,\n SQLITE_OPEN_TRANSIENT_DB: 1024,\n SQLITE_OPEN_MAIN_JOURNAL: 2048,\n SQLITE_OPEN_TEMP_JOURNAL: 4096,\n SQLITE_OPEN_SUBJOURNAL: 8192,\n SQLITE_OPEN_SUPER_JOURNAL: 16384,\n SQLITE_OPEN_NOMUTEX: 32768,\n SQLITE_OPEN_FULLMUTEX: 65536,\n SQLITE_OPEN_SHAREDCACHE: 131072,\n SQLITE_OPEN_PRIVATECACHE: 262144,\n SQLITE_OPEN_WAL: 524288,\n SQLITE_OPEN_NOFOLLOW: 16777216,\n SQLITE_OPEN_EXRESCODE: 33554432,\n SQLITE_PREPARE_PERSISTENT: 1,\n SQLITE_PREPARE_NORMALIZE: 2,\n SQLITE_PREPARE_NO_VTAB: 4\n}, SQL, controllers;\n\nclass Statement {\n constructor(raw) {\n switch (this.#raw = raw, raw.paramsCount) {\n case 0: {\n this.get = this.#getNoArgs, this.all = this.#allNoArgs, this.values = this.#valuesNoArgs, this.run = this.#runNoArgs;\n break;\n }\n default: {\n this.get = this.#get, this.all = this.#all, this.values = this.#values, this.run = this.#run;\n break;\n }\n }\n }\n #raw;\n get;\n all;\n values;\n run;\n isFinalized = !1;\n toJSON() {\n return {\n sql: this.native.toString(),\n isFinalized: this.isFinalized,\n paramsCount: this.paramsCount,\n columnNames: this.columnNames\n };\n }\n get [toStringTag]() {\n return `\"${this.native.toString()}\"`;\n }\n toString() {\n return this.native.toString();\n }\n get native() {\n return this.#raw;\n }\n #getNoArgs() {\n return this.#raw.get();\n }\n #allNoArgs() {\n return this.#raw.all();\n }\n #valuesNoArgs() {\n return this.#raw.values();\n }\n #runNoArgs() {\n this.#raw.run();\n }\n #get(...args) {\n if (args.length === 0)\n return this.#getNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.get(args) : this.#raw.get(...args);\n }\n #all(...args) {\n if (args.length === 0)\n return this.#allNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.all(args) : this.#raw.all(...args);\n }\n #values(...args) {\n if (args.length === 0)\n return this.#valuesNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.values(args) : this.#raw.values(...args);\n }\n #run(...args) {\n if (args.length === 0)\n return this.#runNoArgs();\n var arg0 = args[0];\n !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.run(args) : this.#raw.run(...args);\n }\n get columnNames() {\n return this.#raw.columns;\n }\n get paramsCount() {\n return this.#raw.paramsCount;\n }\n finalize(...args) {\n return this.isFinalized = !0, this.#raw.finalize(...args);\n }\n}\nvar cachedCount = Symbol.for(\"Bun.Database.cache.count\");\n\nclass Database {\n constructor(filenameGiven, options) {\n if (typeof filenameGiven === \"undefined\")\n ;\n else if (typeof filenameGiven !== \"string\") {\n if (isTypedArray(filenameGiven)) {\n this.#handle = Database.#deserialize(filenameGiven, typeof options === \"object\" && options \? !!options.readonly : ((options | 0) & constants.SQLITE_OPEN_READONLY) != 0), this.filename = \":memory:\";\n return;\n }\n @throwTypeError(`Expected 'filename' to be a string, got '${typeof filenameGiven}'`);\n }\n var filename = typeof filenameGiven === \"string\" \? filenameGiven.trim() : \":memory:\", flags = constants.SQLITE_OPEN_READWRITE | constants.SQLITE_OPEN_CREATE;\n if (typeof options === \"object\" && options) {\n if (flags = 0, options.readonly)\n flags = constants.SQLITE_OPEN_READONLY;\n if (\"readOnly\" in options)\n @throwTypeError('Misspelled option \"readOnly\" should be \"readonly\"');\n if (options.create)\n flags = constants.SQLITE_OPEN_READWRITE | constants.SQLITE_OPEN_CREATE;\n if (options.readwrite)\n flags |= constants.SQLITE_OPEN_READWRITE;\n } else if (typeof options === \"number\")\n flags = options;\n const anonymous = filename === \"\" || filename === \":memory:\";\n if (anonymous && (flags & constants.SQLITE_OPEN_READONLY) !== 0)\n throw new Error(\"Cannot open an anonymous database in read-only mode.\");\n if (!SQL)\n SQL = @lazy(\"sqlite\");\n this.#handle = SQL.open(anonymous \? \":memory:\" : filename, flags), this.filename = filename;\n }\n #handle;\n #cachedQueriesKeys = [];\n #cachedQueriesLengths = [];\n #cachedQueriesValues = [];\n filename;\n get handle() {\n return this.#handle;\n }\n get inTransaction() {\n return SQL.isInTransaction(this.#handle);\n }\n static open(filename, options) {\n return new Database(filename, options);\n }\n loadExtension(name, entryPoint) {\n return SQL.loadExtension(this.#handle, name, entryPoint);\n }\n serialize(optionalName) {\n return SQL.serialize(this.#handle, optionalName || \"main\");\n }\n static #deserialize(serialized, isReadOnly = !1) {\n if (!SQL)\n SQL = @lazy(\"sqlite\");\n return SQL.deserialize(serialized, isReadOnly);\n }\n static deserialize(serialized, isReadOnly = !1) {\n return new Database(serialized, isReadOnly \? constants.SQLITE_OPEN_READONLY : 0);\n }\n static setCustomSQLite(path) {\n if (!SQL)\n SQL = @lazy(\"sqlite\");\n return SQL.setCustomSQLite(path);\n }\n close() {\n return this.clearQueryCache(), SQL.close(this.#handle);\n }\n clearQueryCache() {\n for (let item of this.#cachedQueriesValues)\n item.finalize();\n this.#cachedQueriesKeys.length = 0, this.#cachedQueriesValues.length = 0, this.#cachedQueriesLengths.length = 0;\n }\n run(query, ...params) {\n if (params.length === 0) {\n SQL.run(this.#handle, query);\n return;\n }\n var arg0 = params[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? SQL.run(this.#handle, query, params) : SQL.run(this.#handle, query, ...params);\n }\n prepare(query, params, flags) {\n return new Statement(SQL.prepare(this.#handle, query, params, flags || 0));\n }\n static MAX_QUERY_CACHE_SIZE = 20;\n get [cachedCount]() {\n return this.#cachedQueriesKeys.length;\n }\n query(query) {\n if (typeof query !== \"string\")\n @throwTypeError(`Expected 'query' to be a string, got '${typeof query}'`);\n if (query.length === 0)\n throw new Error(\"SQL query cannot be empty.\");\n const willCache = this.#cachedQueriesKeys.length < Database.MAX_QUERY_CACHE_SIZE;\n var index = this.#cachedQueriesLengths.indexOf(query.length);\n while (index !== -1) {\n if (this.#cachedQueriesKeys[index] !== query) {\n index = this.#cachedQueriesLengths.indexOf(query.length, index + 1);\n continue;\n }\n var stmt = this.#cachedQueriesValues[index];\n if (stmt.isFinalized)\n return this.#cachedQueriesValues[index] = this.prepare(query, @undefined, willCache \? constants.SQLITE_PREPARE_PERSISTENT : 0);\n return stmt;\n }\n var stmt = this.prepare(query, @undefined, willCache \? constants.SQLITE_PREPARE_PERSISTENT : 0);\n if (willCache)\n this.#cachedQueriesKeys.push(query), this.#cachedQueriesLengths.push(query.length), this.#cachedQueriesValues.push(stmt);\n return stmt;\n }\n transaction(fn, self) {\n if (typeof fn !== \"function\")\n @throwTypeError(\"Expected first argument to be a function\");\n const db = this, controller = getController(db, self), properties = {\n default: { value: wrapTransaction(fn, db, controller.default) },\n deferred: { value: wrapTransaction(fn, db, controller.deferred) },\n immediate: {\n value: wrapTransaction(fn, db, controller.immediate)\n },\n exclusive: {\n value: wrapTransaction(fn, db, controller.exclusive)\n },\n database: { value: this, enumerable: !0 }\n };\n return defineProperties(properties.default.value, properties), defineProperties(properties.deferred.value, properties), defineProperties(properties.immediate.value, properties), defineProperties(properties.exclusive.value, properties), properties.default.value;\n }\n}\nDatabase.prototype.exec = Database.prototype.run;\nvar getController = (db, self) => {\n let controller = (controllers ||= new WeakMap).get(db);\n if (!controller) {\n const shared = {\n commit: db.prepare(\"COMMIT\", @undefined, 0),\n rollback: db.prepare(\"ROLLBACK\", @undefined, 0),\n savepoint: db.prepare(\"SAVEPOINT `\\t_bs3.\\t`\", @undefined, 0),\n release: db.prepare(\"RELEASE `\\t_bs3.\\t`\", @undefined, 0),\n rollbackTo: db.prepare(\"ROLLBACK TO `\\t_bs3.\\t`\", @undefined, 0)\n };\n controllers.set(db, controller = {\n default: Object.assign({ begin: db.prepare(\"BEGIN\", @undefined, 0) }, shared),\n deferred: Object.assign({ begin: db.prepare(\"BEGIN DEFERRED\", @undefined, 0) }, shared),\n immediate: Object.assign({ begin: db.prepare(\"BEGIN IMMEDIATE\", @undefined, 0) }, shared),\n exclusive: Object.assign({ begin: db.prepare(\"BEGIN EXCLUSIVE\", @undefined, 0) }, shared)\n });\n }\n return controller;\n}, wrapTransaction = (fn, db, { begin, commit, rollback, savepoint, release, rollbackTo }) => function transaction(...args) {\n let before, after, undo;\n if (db.inTransaction)\n before = savepoint, after = release, undo = rollbackTo;\n else\n before = begin, after = commit, undo = rollback;\n try {\n before.run();\n const result = fn.@apply(this, args);\n return after.run(), result;\n } catch (ex) {\n if (db.inTransaction) {\n if (undo.run(), undo !== rollback)\n after.run();\n }\n throw ex;\n }\n};\n$ = {\n __esModule: !0,\n Database,\n Statement,\n constants,\n default: Database\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral InternalDebuggerCode = "(function (){\"use strict\";// src/js/out/tmp/internal/debugger.ts\nvar versionInfo = function() {\n return {\n \"Protocol-Version\": \"1.3\",\n Browser: \"Bun\",\n \"User-Agent\": navigator.userAgent,\n \"WebKit-Version\": process.versions.webkit,\n \"Bun-Version\": Bun.version,\n \"Bun-Revision\": Bun.revision\n };\n}, webSocketWriter = function(ws) {\n return {\n write: (message) => !!ws.sendText(message),\n close: () => ws.close()\n };\n}, socketWriter = function(socket) {\n return {\n write: (message) => !!socket.write(message),\n close: () => socket.end()\n };\n}, bufferedWriter = function(writer) {\n let draining = !1, pendingMessages = [];\n return {\n write: (message) => {\n if (draining || !writer.write(message))\n pendingMessages.push(message);\n return !0;\n },\n drain: () => {\n draining = !0;\n try {\n for (let i = 0;i < pendingMessages.length; i++)\n if (!writer.write(pendingMessages[i])) {\n pendingMessages = pendingMessages.slice(i);\n return;\n }\n } finally {\n draining = !1;\n }\n },\n close: () => {\n writer.close(), pendingMessages.length = 0;\n }\n };\n}, parseUrl = function(url) {\n try {\n if (!url)\n return new URL(randomId(), `ws://${defaultHostname}:${defaultPort}/`);\n else if (url.startsWith(\"/\"))\n return new URL(url, `ws://${defaultHostname}:${defaultPort}/`);\n else if (/^[a-z+]+:\\/\\//i.test(url))\n return new URL(url);\n else if (/^\\d+$/.test(url))\n return new URL(randomId(), `ws://${defaultHostname}:${url}/`);\n else if (!url.includes(\"/\") && url.includes(\":\"))\n return new URL(randomId(), `ws://${url}/`);\n else if (!url.includes(\":\")) {\n const [hostname, pathname] = url.split(\"/\", 2);\n return new URL(`ws://${hostname}:${defaultPort}/${pathname}`);\n } else\n return new URL(randomId(), `ws://${url}`);\n } catch {\n @throwTypeError(`Invalid hostname or URL: '${url}'`);\n }\n}, randomId = function() {\n return Math.random().toString(36).slice(2);\n}, dim = function(string) {\n if (enableANSIColors)\n return `\\x1B[2m${string}\\x1B[22m`;\n return string;\n}, link = function(url) {\n if (enableANSIColors)\n return `\\x1B[1m\\x1B]8;;${url}\\x1B\\\\${url}\\x1B]8;;\\x1B\\\\\\x1B[22m`;\n return url;\n}, reset = function() {\n if (enableANSIColors)\n return \"\\x1B[49m\";\n return \"\";\n}, notify = function(unix) {\n Bun.connect({\n unix,\n socket: {\n open: (socket) => {\n socket.end(\"1\");\n },\n data: () => {\n }\n }\n }).finally(() => {\n });\n}, exit = function(...args) {\n console.error(...args), process.exit(1);\n}, $;\n$ = function(executionContextId, url, createBackend, send, close) {\n let debug;\n try {\n debug = new Debugger(executionContextId, url, createBackend, send, close);\n } catch (error) {\n exit(\"Failed to start inspector:\\n\", error);\n }\n const { protocol, href, host, pathname } = debug.url;\n if (!protocol.includes(\"unix\")) {\n if (console.log(dim(\"--------------------- Bun Inspector ---------------------\"), reset()), console.log(`Listening:\\n ${dim(href)}`), protocol.includes(\"ws\"))\n console.log(`Inspect in browser:\\n ${link(`https://debug.bun.sh/#${host}${pathname}`)}`);\n console.log(dim(\"--------------------- Bun Inspector ---------------------\"), reset());\n }\n const unix = process.env.BUN_INSPECT_NOTIFY;\n if (unix) {\n const { protocol: protocol2, pathname: pathname2 } = parseUrl(unix);\n if (protocol2 === \"unix:\")\n notify(pathname2);\n }\n};\n\nclass Debugger {\n #url;\n #createBackend;\n constructor(executionContextId, url, createBackend, send, close) {\n this.#url = parseUrl(url), this.#createBackend = (refEventLoop, receive) => {\n const backend = createBackend(executionContextId, refEventLoop, receive);\n return {\n write: (message) => {\n return send.call(backend, message), !0;\n },\n close: () => close.call(backend)\n };\n }, this.#listen();\n }\n get url() {\n return this.#url;\n }\n #listen() {\n const { protocol, hostname, port, pathname } = this.#url;\n if (protocol === \"ws:\" || protocol === \"ws+tcp:\") {\n const server = Bun.serve({\n hostname,\n port,\n fetch: this.#fetch.bind(this),\n websocket: this.#websocket\n });\n this.#url.hostname = server.hostname, this.#url.port = `${server.port}`;\n return;\n }\n if (protocol === \"ws+unix:\") {\n Bun.serve({\n unix: pathname,\n fetch: this.#fetch.bind(this),\n websocket: this.#websocket\n });\n return;\n }\n @throwTypeError(`Unsupported protocol: '${protocol}' (expected 'ws:', 'ws+unix:', or 'unix:')`);\n }\n get #websocket() {\n return {\n idleTimeout: 0,\n closeOnBackpressureLimit: !1,\n open: (ws) => this.#open(ws, webSocketWriter(ws)),\n message: (ws, message) => {\n if (typeof message === \"string\")\n this.#message(ws, message);\n else\n this.#error(ws, new Error(`Unexpected binary message: ${message.toString()}`));\n },\n drain: (ws) => this.#drain(ws),\n close: (ws) => this.#close(ws)\n };\n }\n #fetch(request, server) {\n const { method, url, headers } = request, { pathname } = new URL(url);\n if (method !== \"GET\")\n return new Response(null, {\n status: 405\n });\n switch (pathname) {\n case \"/json/version\":\n return Response.json(versionInfo());\n case \"/json\":\n case \"/json/list\":\n }\n if (!this.#url.protocol.includes(\"unix\") && this.#url.pathname !== pathname)\n return new Response(null, {\n status: 404\n });\n const data = {\n refEventLoop: headers.get(\"Ref-Event-Loop\") === \"0\"\n };\n if (!server.upgrade(request, { data }))\n return new Response(null, {\n status: 426,\n headers: {\n Upgrade: \"websocket\"\n }\n });\n }\n get #socket() {\n return {\n open: (socket) => this.#open(socket, socketWriter(socket)),\n data: (socket, message) => this.#message(socket, message.toString()),\n drain: (socket) => this.#drain(socket),\n close: (socket) => this.#close(socket),\n error: (socket, error) => this.#error(socket, error),\n connectError: (_, error) => exit(\"Failed to start inspector:\\n\", error)\n };\n }\n #open(connection, writer) {\n const { data } = connection, { refEventLoop } = data, client = bufferedWriter(writer), backend = this.#createBackend(refEventLoop, (...messages) => {\n for (let message of messages)\n client.write(message);\n });\n data.client = client, data.backend = backend;\n }\n #message(connection, message) {\n const { data } = connection, { backend } = data;\n backend\?.write(message);\n }\n #drain(connection) {\n const { data } = connection, { client } = data;\n client\?.drain\?.();\n }\n #close(connection) {\n const { data } = connection, { backend } = data;\n backend\?.close();\n }\n #error(connection, error) {\n const { data } = connection, { backend } = data;\n console.error(error), backend\?.close();\n }\n}\nvar defaultHostname = \"localhost\", defaultPort = 6499, { enableANSIColors } = Bun;\nreturn $})\n"_s;
+static constexpr ASCIILiteral InternalDebuggerCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/debugger.ts\nvar versionInfo = function() {\n return {\n \"Protocol-Version\": \"1.3\",\n Browser: \"Bun\",\n \"User-Agent\": navigator.userAgent,\n \"WebKit-Version\": process.versions.webkit,\n \"Bun-Version\": Bun.version,\n \"Bun-Revision\": Bun.revision\n };\n}, webSocketWriter = function(ws) {\n return {\n write: (message) => !!ws.sendText(message),\n close: () => ws.close()\n };\n}, socketWriter = function(socket) {\n return {\n write: (message) => !!socket.write(message),\n close: () => socket.end()\n };\n}, bufferedWriter = function(writer) {\n let draining = !1, pendingMessages = [];\n return {\n write: (message) => {\n if (draining || !writer.write(message))\n pendingMessages.push(message);\n return !0;\n },\n drain: () => {\n draining = !0;\n try {\n for (let i = 0;i < pendingMessages.length; i++)\n if (!writer.write(pendingMessages[i])) {\n pendingMessages = pendingMessages.slice(i);\n return;\n }\n } finally {\n draining = !1;\n }\n },\n close: () => {\n writer.close(), pendingMessages.length = 0;\n }\n };\n}, parseUrl = function(url) {\n try {\n if (!url)\n return new URL(randomId(), `ws://${defaultHostname}:${defaultPort}/`);\n else if (url.startsWith(\"/\"))\n return new URL(url, `ws://${defaultHostname}:${defaultPort}/`);\n else if (/^[a-z+]+:\\/\\//i.test(url))\n return new URL(url);\n else if (/^\\d+$/.test(url))\n return new URL(randomId(), `ws://${defaultHostname}:${url}/`);\n else if (!url.includes(\"/\") && url.includes(\":\"))\n return new URL(randomId(), `ws://${url}/`);\n else if (!url.includes(\":\")) {\n const [hostname, pathname] = url.split(\"/\", 2);\n return new URL(`ws://${hostname}:${defaultPort}/${pathname}`);\n } else\n return new URL(randomId(), `ws://${url}`);\n } catch {\n @throwTypeError(`Invalid hostname or URL: '${url}'`);\n }\n}, randomId = function() {\n return Math.random().toString(36).slice(2);\n}, dim = function(string) {\n if (enableANSIColors)\n return `\\x1B[2m${string}\\x1B[22m`;\n return string;\n}, link = function(url) {\n if (enableANSIColors)\n return `\\x1B[1m\\x1B]8;;${url}\\x1B\\\\${url}\\x1B]8;;\\x1B\\\\\\x1B[22m`;\n return url;\n}, reset = function() {\n if (enableANSIColors)\n return \"\\x1B[49m\";\n return \"\";\n}, notify = function(unix) {\n Bun.connect({\n unix,\n socket: {\n open: (socket) => {\n socket.end(\"1\");\n },\n data: () => {\n }\n }\n }).finally(() => {\n });\n}, exit = function(...args) {\n console.error(...args), process.exit(1);\n}, $;\n$ = function(executionContextId, url, createBackend, send, close) {\n let debug;\n try {\n debug = new Debugger(executionContextId, url, createBackend, send, close);\n } catch (error) {\n exit(\"Failed to start inspector:\\n\", error);\n }\n const { protocol, href, host, pathname } = debug.url;\n if (!protocol.includes(\"unix\")) {\n if (console.log(dim(\"--------------------- Bun Inspector ---------------------\"), reset()), console.log(`Listening:\\n ${dim(href)}`), protocol.includes(\"ws\"))\n console.log(`Inspect in browser:\\n ${link(`https://debug.bun.sh/#${host}${pathname}`)}`);\n console.log(dim(\"--------------------- Bun Inspector ---------------------\"), reset());\n }\n const unix = process.env.BUN_INSPECT_NOTIFY;\n if (unix) {\n const { protocol: protocol2, pathname: pathname2 } = parseUrl(unix);\n if (protocol2 === \"unix:\")\n notify(pathname2);\n }\n};\n\nclass Debugger {\n #url;\n #createBackend;\n constructor(executionContextId, url, createBackend, send, close) {\n this.#url = parseUrl(url), this.#createBackend = (refEventLoop, receive) => {\n const backend = createBackend(executionContextId, refEventLoop, receive);\n return {\n write: (message) => {\n return send.@call(backend, message), !0;\n },\n close: () => close.@call(backend)\n };\n }, this.#listen();\n }\n get url() {\n return this.#url;\n }\n #listen() {\n const { protocol, hostname, port, pathname } = this.#url;\n if (protocol === \"ws:\" || protocol === \"ws+tcp:\") {\n const server = Bun.serve({\n hostname,\n port,\n fetch: this.#fetch.bind(this),\n websocket: this.#websocket\n });\n this.#url.hostname = server.hostname, this.#url.port = `${server.port}`;\n return;\n }\n if (protocol === \"ws+unix:\") {\n Bun.serve({\n unix: pathname,\n fetch: this.#fetch.bind(this),\n websocket: this.#websocket\n });\n return;\n }\n @throwTypeError(`Unsupported protocol: '${protocol}' (expected 'ws:', 'ws+unix:', or 'unix:')`);\n }\n get #websocket() {\n return {\n idleTimeout: 0,\n closeOnBackpressureLimit: !1,\n open: (ws) => this.#open(ws, webSocketWriter(ws)),\n message: (ws, message) => {\n if (typeof message === \"string\")\n this.#message(ws, message);\n else\n this.#error(ws, new Error(`Unexpected binary message: ${message.toString()}`));\n },\n drain: (ws) => this.#drain(ws),\n close: (ws) => this.#close(ws)\n };\n }\n #fetch(request, server) {\n const { method, url, headers } = request, { pathname } = new URL(url);\n if (method !== \"GET\")\n return new Response(null, {\n status: 405\n });\n switch (pathname) {\n case \"/json/version\":\n return Response.json(versionInfo());\n case \"/json\":\n case \"/json/list\":\n }\n if (!this.#url.protocol.includes(\"unix\") && this.#url.pathname !== pathname)\n return new Response(null, {\n status: 404\n });\n const data = {\n refEventLoop: headers.get(\"Ref-Event-Loop\") === \"0\"\n };\n if (!server.upgrade(request, { data }))\n return new Response(null, {\n status: 426,\n headers: {\n Upgrade: \"websocket\"\n }\n });\n }\n get #socket() {\n return {\n open: (socket) => this.#open(socket, socketWriter(socket)),\n data: (socket, message) => this.#message(socket, message.toString()),\n drain: (socket) => this.#drain(socket),\n close: (socket) => this.#close(socket),\n error: (socket, error) => this.#error(socket, error),\n connectError: (_, error) => exit(\"Failed to start inspector:\\n\", error)\n };\n }\n #open(connection, writer) {\n const { data } = connection, { refEventLoop } = data, client = bufferedWriter(writer), backend = this.#createBackend(refEventLoop, (...messages) => {\n for (let message of messages)\n client.write(message);\n });\n data.client = client, data.backend = backend;\n }\n #message(connection, message) {\n const { data } = connection, { backend } = data;\n backend\?.write(message);\n }\n #drain(connection) {\n const { data } = connection, { client } = data;\n client\?.drain\?.();\n }\n #close(connection) {\n const { data } = connection, { backend } = data;\n backend\?.close();\n }\n #error(connection, error) {\n const { data } = connection, { backend } = data;\n console.error(error), backend\?.close();\n }\n}\nvar defaultHostname = \"localhost\", defaultPort = 6499, { enableANSIColors } = Bun;\nreturn $})\n");
//
//
-static constexpr ASCIILiteral InternalFSCpSyncCode = "(function (){\"use strict\";// src/js/out/tmp/internal/fs/cp-sync.ts\nvar areIdentical = function(srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;\n}, isSrcSubdir = function(src, dest) {\n const srcArr = normalizePathToArray(src), destArr = normalizePathToArray(dest);\n return ArrayPrototypeEvery.@call(srcArr, (cur, i) => destArr[i] === cur);\n}, cpSyncFn = function(src, dest, opts) {\n const { srcStat, destStat, skipped } = checkPathsSync(src, dest, opts);\n if (skipped)\n return;\n return checkParentPathsSync(src, srcStat, dest), checkParentDir(destStat, src, dest, opts);\n}, checkPathsSync = function(src, dest, opts) {\n if (opts.filter) {\n const shouldCopy = opts.filter(src, dest);\n if (isPromise(shouldCopy))\n throw new Error(\"Expected a boolean from the filter function, but got a promise. Use `fs.promises.cp` instead.\");\n if (!shouldCopy)\n return { __proto__: null, skipped: !0 };\n }\n const { srcStat, destStat } = getStatsSync(src, dest, opts);\n if (destStat) {\n if (areIdentical(srcStat, destStat))\n throw new Error(\"src and dest cannot be the same\");\n if (srcStat.isDirectory() && !destStat.isDirectory())\n throw new Error(`cannot overwrite directory ${src} with non-directory ${dest}`);\n if (!srcStat.isDirectory() && destStat.isDirectory())\n throw new Error(`cannot overwrite non-directory ${src} with directory ${dest}`);\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return { __proto__: null, srcStat, destStat, skipped: !1 };\n}, getStatsSync = function(src, dest, opts) {\n let destStat;\n const statFunc = opts.dereference \? (file) => statSync(file, { bigint: !0 }) : (file) => lstatSync(file, { bigint: !0 }), srcStat = statFunc(src);\n try {\n destStat = statFunc(dest);\n } catch (err) {\n if (err.code === \"ENOENT\")\n return { srcStat, destStat: null };\n throw err;\n }\n return { srcStat, destStat };\n}, checkParentPathsSync = function(src, srcStat, dest) {\n const srcParent = resolve(dirname(src)), destParent = resolve(dirname(dest));\n if (destParent === srcParent || destParent === parse(destParent).root)\n return;\n let destStat;\n try {\n destStat = statSync(destParent, { bigint: !0 });\n } catch (err) {\n if (err.code === \"ENOENT\")\n return;\n throw err;\n }\n if (areIdentical(srcStat, destStat))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return checkParentPathsSync(src, srcStat, destParent);\n}, checkParentDir = function(destStat, src, dest, opts) {\n const destParent = dirname(dest);\n if (!existsSync(destParent))\n mkdirSync(destParent, { recursive: !0 });\n return getStats(destStat, src, dest, opts);\n}, getStats = function(destStat, src, dest, opts) {\n const srcStat = (opts.dereference \? statSync : lstatSync)(src);\n if (srcStat.isDirectory() && opts.recursive)\n return onDir(srcStat, destStat, src, dest, opts);\n else if (srcStat.isDirectory())\n throw new Error(`${src} is a directory (not copied)`);\n else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())\n return onFile(srcStat, destStat, src, dest, opts);\n else if (srcStat.isSymbolicLink())\n return onLink(destStat, src, dest, opts);\n else if (srcStat.isSocket())\n throw new Error(`cannot copy a socket file: ${dest}`);\n else if (srcStat.isFIFO())\n throw new Error(`cannot copy a FIFO pipe: ${dest}`);\n throw new Error(`cannot copy an unknown file type: ${dest}`);\n}, onFile = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return copyFile(srcStat, src, dest, opts);\n return mayCopyFile(srcStat, src, dest, opts);\n}, mayCopyFile = function(srcStat, src, dest, opts) {\n if (opts.force)\n return unlinkSync(dest), copyFile(srcStat, src, dest, opts);\n else if (opts.errorOnExist)\n throw new Error(`${dest} already exists`);\n}, copyFile = function(srcStat, src, dest, opts) {\n if (copyFileSync(src, dest, opts.mode), opts.preserveTimestamps)\n handleTimestamps(srcStat.mode, src, dest);\n return setDestMode(dest, srcStat.mode);\n}, handleTimestamps = function(srcMode, src, dest) {\n if (fileIsNotWritable(srcMode))\n makeFileWritable(dest, srcMode);\n return setDestTimestamps(src, dest);\n}, fileIsNotWritable = function(srcMode) {\n return (srcMode & 128) === 0;\n}, makeFileWritable = function(dest, srcMode) {\n return setDestMode(dest, srcMode | 128);\n}, setDestMode = function(dest, srcMode) {\n return chmodSync(dest, srcMode);\n}, setDestTimestamps = function(src, dest) {\n const updatedSrcStat = statSync(src);\n return utimesSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\n}, onDir = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return mkDirAndCopy(srcStat.mode, src, dest, opts);\n return copyDir(src, dest, opts);\n}, mkDirAndCopy = function(srcMode, src, dest, opts) {\n return mkdirSync(dest), copyDir(src, dest, opts), setDestMode(dest, srcMode);\n}, copyDir = function(src, dest, opts) {\n for (let dirent of readdirSync(src, { withFileTypes: !0 })) {\n const { name } = dirent, srcItem = join(src, name), destItem = join(dest, name), { destStat, skipped } = checkPathsSync(srcItem, destItem, opts);\n if (!skipped)\n getStats(destStat, srcItem, destItem, opts);\n }\n}, onLink = function(destStat, src, dest, opts) {\n let resolvedSrc = readlinkSync(src);\n if (!opts.verbatimSymlinks && !isAbsolute(resolvedSrc))\n resolvedSrc = resolve(dirname(src), resolvedSrc);\n if (!destStat)\n return symlinkSync(resolvedSrc, dest);\n let resolvedDest;\n try {\n resolvedDest = readlinkSync(dest);\n } catch (err) {\n if (err.code === \"EINVAL\" || err.code === \"UNKNOWN\")\n return symlinkSync(resolvedSrc, dest);\n throw err;\n }\n if (!isAbsolute(resolvedDest))\n resolvedDest = resolve(dirname(dest), resolvedDest);\n if (isSrcSubdir(resolvedSrc, resolvedDest))\n throw new Error(`cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`);\n if (statSync(dest).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc))\n throw new Error(`cannot overwrite ${resolvedDest} with ${resolvedSrc}`);\n return copyLink(resolvedSrc, dest);\n}, copyLink = function(resolvedSrc, dest) {\n return unlinkSync(dest), symlinkSync(resolvedSrc, dest);\n}, ArrayPrototypeEvery = Array.prototype.every, ArrayPrototypeFilter = Array.prototype.filter, StringPrototypeSplit = String.prototype.split, normalizePathToArray = (path) => ArrayPrototypeFilter.@call(StringPrototypeSplit.@call(resolve(path), sep), Boolean), {\n chmodSync,\n copyFileSync,\n existsSync,\n lstatSync,\n mkdirSync,\n readdirSync,\n readlinkSync,\n statSync,\n symlinkSync,\n unlinkSync,\n utimesSync\n} = @getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19), { dirname, isAbsolute, join, parse, resolve, sep } = @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28), { isPromise } = @requireNativeModule(\"util/types\");\nreturn cpSyncFn})\n"_s;
+static constexpr ASCIILiteral InternalFSCpSyncCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/fs/cp-sync.ts\nvar areIdentical = function(srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;\n}, isSrcSubdir = function(src, dest) {\n const srcArr = normalizePathToArray(src), destArr = normalizePathToArray(dest);\n return ArrayPrototypeEvery.@call(srcArr, (cur, i) => destArr[i] === cur);\n}, cpSyncFn = function(src, dest, opts) {\n const { srcStat, destStat, skipped } = checkPathsSync(src, dest, opts);\n if (skipped)\n return;\n return checkParentPathsSync(src, srcStat, dest), checkParentDir(destStat, src, dest, opts);\n}, checkPathsSync = function(src, dest, opts) {\n if (opts.filter) {\n const shouldCopy = opts.filter(src, dest);\n if (isPromise(shouldCopy))\n throw new Error(\"Expected a boolean from the filter function, but got a promise. Use `fs.promises.cp` instead.\");\n if (!shouldCopy)\n return { __proto__: null, skipped: !0 };\n }\n const { srcStat, destStat } = getStatsSync(src, dest, opts);\n if (destStat) {\n if (areIdentical(srcStat, destStat))\n throw new Error(\"src and dest cannot be the same\");\n if (srcStat.isDirectory() && !destStat.isDirectory())\n throw new Error(`cannot overwrite directory ${src} with non-directory ${dest}`);\n if (!srcStat.isDirectory() && destStat.isDirectory())\n throw new Error(`cannot overwrite non-directory ${src} with directory ${dest}`);\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return { __proto__: null, srcStat, destStat, skipped: !1 };\n}, getStatsSync = function(src, dest, opts) {\n let destStat;\n const statFunc = opts.dereference \? (file) => statSync(file, { bigint: !0 }) : (file) => lstatSync(file, { bigint: !0 }), srcStat = statFunc(src);\n try {\n destStat = statFunc(dest);\n } catch (err) {\n if (err.code === \"ENOENT\")\n return { srcStat, destStat: null };\n throw err;\n }\n return { srcStat, destStat };\n}, checkParentPathsSync = function(src, srcStat, dest) {\n const srcParent = resolve(dirname(src)), destParent = resolve(dirname(dest));\n if (destParent === srcParent || destParent === parse(destParent).root)\n return;\n let destStat;\n try {\n destStat = statSync(destParent, { bigint: !0 });\n } catch (err) {\n if (err.code === \"ENOENT\")\n return;\n throw err;\n }\n if (areIdentical(srcStat, destStat))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return checkParentPathsSync(src, srcStat, destParent);\n}, checkParentDir = function(destStat, src, dest, opts) {\n const destParent = dirname(dest);\n if (!existsSync(destParent))\n mkdirSync(destParent, { recursive: !0 });\n return getStats(destStat, src, dest, opts);\n}, getStats = function(destStat, src, dest, opts) {\n const srcStat = (opts.dereference \? statSync : lstatSync)(src);\n if (srcStat.isDirectory() && opts.recursive)\n return onDir(srcStat, destStat, src, dest, opts);\n else if (srcStat.isDirectory())\n throw new Error(`${src} is a directory (not copied)`);\n else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())\n return onFile(srcStat, destStat, src, dest, opts);\n else if (srcStat.isSymbolicLink())\n return onLink(destStat, src, dest, opts);\n else if (srcStat.isSocket())\n throw new Error(`cannot copy a socket file: ${dest}`);\n else if (srcStat.isFIFO())\n throw new Error(`cannot copy a FIFO pipe: ${dest}`);\n throw new Error(`cannot copy an unknown file type: ${dest}`);\n}, onFile = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return copyFile(srcStat, src, dest, opts);\n return mayCopyFile(srcStat, src, dest, opts);\n}, mayCopyFile = function(srcStat, src, dest, opts) {\n if (opts.force)\n return unlinkSync(dest), copyFile(srcStat, src, dest, opts);\n else if (opts.errorOnExist)\n throw new Error(`${dest} already exists`);\n}, copyFile = function(srcStat, src, dest, opts) {\n if (copyFileSync(src, dest, opts.mode), opts.preserveTimestamps)\n handleTimestamps(srcStat.mode, src, dest);\n return setDestMode(dest, srcStat.mode);\n}, handleTimestamps = function(srcMode, src, dest) {\n if (fileIsNotWritable(srcMode))\n makeFileWritable(dest, srcMode);\n return setDestTimestamps(src, dest);\n}, fileIsNotWritable = function(srcMode) {\n return (srcMode & 128) === 0;\n}, makeFileWritable = function(dest, srcMode) {\n return setDestMode(dest, srcMode | 128);\n}, setDestMode = function(dest, srcMode) {\n return chmodSync(dest, srcMode);\n}, setDestTimestamps = function(src, dest) {\n const updatedSrcStat = statSync(src);\n return utimesSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\n}, onDir = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return mkDirAndCopy(srcStat.mode, src, dest, opts);\n return copyDir(src, dest, opts);\n}, mkDirAndCopy = function(srcMode, src, dest, opts) {\n return mkdirSync(dest), copyDir(src, dest, opts), setDestMode(dest, srcMode);\n}, copyDir = function(src, dest, opts) {\n for (let dirent of readdirSync(src, { withFileTypes: !0 })) {\n const { name } = dirent, srcItem = join(src, name), destItem = join(dest, name), { destStat, skipped } = checkPathsSync(srcItem, destItem, opts);\n if (!skipped)\n getStats(destStat, srcItem, destItem, opts);\n }\n}, onLink = function(destStat, src, dest, opts) {\n let resolvedSrc = readlinkSync(src);\n if (!opts.verbatimSymlinks && !isAbsolute(resolvedSrc))\n resolvedSrc = resolve(dirname(src), resolvedSrc);\n if (!destStat)\n return symlinkSync(resolvedSrc, dest);\n let resolvedDest;\n try {\n resolvedDest = readlinkSync(dest);\n } catch (err) {\n if (err.code === \"EINVAL\" || err.code === \"UNKNOWN\")\n return symlinkSync(resolvedSrc, dest);\n throw err;\n }\n if (!isAbsolute(resolvedDest))\n resolvedDest = resolve(dirname(dest), resolvedDest);\n if (isSrcSubdir(resolvedSrc, resolvedDest))\n throw new Error(`cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`);\n if (statSync(dest).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc))\n throw new Error(`cannot overwrite ${resolvedDest} with ${resolvedSrc}`);\n return copyLink(resolvedSrc, dest);\n}, copyLink = function(resolvedSrc, dest) {\n return unlinkSync(dest), symlinkSync(resolvedSrc, dest);\n}, ArrayPrototypeEvery = @Array.prototype.every, ArrayPrototypeFilter = @Array.prototype.filter, StringPrototypeSplit = @String.prototype.split, normalizePathToArray = (path) => ArrayPrototypeFilter.@call(StringPrototypeSplit.@call(resolve(path), sep), Boolean), {\n chmodSync,\n copyFileSync,\n existsSync,\n lstatSync,\n mkdirSync,\n readdirSync,\n readlinkSync,\n statSync,\n symlinkSync,\n unlinkSync,\n utimesSync\n} = @getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21), { dirname, isAbsolute, join, parse, resolve, sep } = @getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30), { isPromise } = @requireNativeModule(\"util/types\");\nreturn cpSyncFn})\n");
//
//
-static constexpr ASCIILiteral InternalFSCpCode = "(function (){\"use strict\";// src/js/out/tmp/internal/fs/cp.ts\nasync function cpFn(src, dest, opts) {\n const stats = await checkPaths(src, dest, opts), { srcStat, destStat, skipped } = stats;\n if (skipped)\n return;\n return await checkParentPaths(src, srcStat, dest), checkParentDir(destStat, src, dest, opts);\n}\nasync function checkPaths(src, dest, opts) {\n if (opts.filter && !await opts.filter(src, dest))\n return { __proto__: null, skipped: !0 };\n const { 0: srcStat, 1: destStat } = await getStats(src, dest, opts);\n if (destStat) {\n if (areIdentical(srcStat, destStat))\n throw new Error(\"Source and destination must not be the same.\");\n if (srcStat.isDirectory() && !destStat.isDirectory())\n throw new Error(`cannot overwrite directory ${src} with non-directory ${dest}`);\n if (!srcStat.isDirectory() && destStat.isDirectory())\n throw new Error(`cannot overwrite non-directory ${src} with directory ${dest}`);\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return { __proto__: null, srcStat, destStat, skipped: !1 };\n}\nvar areIdentical = function(srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;\n}, getStats = function(src, dest, opts) {\n const statFunc = opts.dereference \? (file) => stat(file, { bigint: !0 }) : (file) => lstat(file, { bigint: !0 });\n return SafePromiseAll([\n statFunc(src),\n PromisePrototypeThen.@call(statFunc(dest), void 0, (err) => {\n if (err.code === \"ENOENT\")\n return null;\n throw err;\n })\n ]);\n};\nasync function checkParentDir(destStat, src, dest, opts) {\n const destParent = dirname(dest);\n if (await pathExists(destParent))\n return getStatsForCopy(destStat, src, dest, opts);\n return await mkdir(destParent, { recursive: !0 }), getStatsForCopy(destStat, src, dest, opts);\n}\nvar pathExists = function(dest) {\n return PromisePrototypeThen(stat(dest), () => !0, (err) => err.code === \"ENOENT\" \? !1 : PromiseReject(err));\n};\nasync function checkParentPaths(src, srcStat, dest) {\n const srcParent = resolve(dirname(src)), destParent = resolve(dirname(dest));\n if (destParent === srcParent || destParent === parse(destParent).root)\n return;\n let destStat;\n try {\n destStat = await stat(destParent, { bigint: !0 });\n } catch (err) {\n if (err.code === \"ENOENT\")\n return;\n throw err;\n }\n if (areIdentical(srcStat, destStat))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return checkParentPaths(src, srcStat, destParent);\n}\nvar isSrcSubdir = function(src, dest) {\n const srcArr = normalizePathToArray(src), destArr = normalizePathToArray(dest);\n return ArrayPrototypeEvery.@call(srcArr, (cur, i) => destArr[i] === cur);\n};\nasync function getStatsForCopy(destStat, src, dest, opts) {\n const srcStat = await (opts.dereference \? stat : lstat)(src);\n if (srcStat.isDirectory() && opts.recursive)\n return onDir(srcStat, destStat, src, dest, opts);\n else if (srcStat.isDirectory())\n throw new Error(`${src} is a directory (not copied)`);\n else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())\n return onFile(srcStat, destStat, src, dest, opts);\n else if (srcStat.isSymbolicLink())\n return onLink(destStat, src, dest, opts);\n else if (srcStat.isSocket())\n throw new Error(`cannot copy a socket file: ${dest}`);\n else if (srcStat.isFIFO())\n throw new Error(`cannot copy a FIFO pipe: ${dest}`);\n throw new Error(`cannot copy an unknown file type: ${dest}`);\n}\nvar onFile = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return _copyFile(srcStat, src, dest, opts);\n return mayCopyFile(srcStat, src, dest, opts);\n};\nasync function mayCopyFile(srcStat, src, dest, opts) {\n if (opts.force)\n return await unlink(dest), _copyFile(srcStat, src, dest, opts);\n else if (opts.errorOnExist)\n throw new Error(`${dest} already exists`);\n}\nasync function _copyFile(srcStat, src, dest, opts) {\n if (await copyFile(src, dest, opts.mode), opts.preserveTimestamps)\n return handleTimestampsAndMode(srcStat.mode, src, dest);\n return setDestMode(dest, srcStat.mode);\n}\nasync function handleTimestampsAndMode(srcMode, src, dest) {\n if (fileIsNotWritable(srcMode))\n return await makeFileWritable(dest, srcMode), setDestTimestampsAndMode(srcMode, src, dest);\n return setDestTimestampsAndMode(srcMode, src, dest);\n}\nvar fileIsNotWritable = function(srcMode) {\n return (srcMode & 128) === 0;\n}, makeFileWritable = function(dest, srcMode) {\n return setDestMode(dest, srcMode | 128);\n};\nasync function setDestTimestampsAndMode(srcMode, src, dest) {\n return await setDestTimestamps(src, dest), setDestMode(dest, srcMode);\n}\nvar setDestMode = function(dest, srcMode) {\n return chmod(dest, srcMode);\n};\nasync function setDestTimestamps(src, dest) {\n const updatedSrcStat = await stat(src);\n return utimes(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\n}\nvar onDir = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return mkDirAndCopy(srcStat.mode, src, dest, opts);\n return copyDir(src, dest, opts);\n};\nasync function mkDirAndCopy(srcMode, src, dest, opts) {\n return await mkdir(dest), await copyDir(src, dest, opts), setDestMode(dest, srcMode);\n}\nasync function copyDir(src, dest, opts) {\n const dir = await opendir(src);\n for await (let { name } of dir) {\n const srcItem = join(src, name), destItem = join(dest, name), { destStat, skipped } = await checkPaths(srcItem, destItem, opts);\n if (!skipped)\n await getStatsForCopy(destStat, srcItem, destItem, opts);\n }\n}\nasync function onLink(destStat, src, dest, opts) {\n let resolvedSrc = await readlink(src);\n if (!opts.verbatimSymlinks && !isAbsolute(resolvedSrc))\n resolvedSrc = resolve(dirname(src), resolvedSrc);\n if (!destStat)\n return symlink(resolvedSrc, dest);\n let resolvedDest;\n try {\n resolvedDest = await readlink(dest);\n } catch (err) {\n if (err.code === \"EINVAL\" || err.code === \"UNKNOWN\")\n return symlink(resolvedSrc, dest);\n throw err;\n }\n if (!isAbsolute(resolvedDest))\n resolvedDest = resolve(dirname(dest), resolvedDest);\n if (isSrcSubdir(resolvedSrc, resolvedDest))\n throw new Error(`cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`);\n if ((await stat(src)).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc))\n throw new Error(`cannot overwrite ${resolvedDest} with ${resolvedSrc}`);\n return copyLink(resolvedSrc, dest);\n}\nasync function copyLink(resolvedSrc, dest) {\n return await unlink(dest), symlink(resolvedSrc, dest);\n}\nvar { chmod, copyFile, lstat, mkdir, opendir, readlink, stat, symlink, unlink, utimes } = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { dirname, isAbsolute, join, parse, resolve, sep } = @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28), SafePromiseAll = Promise.all, PromisePrototypeThen = Promise.prototype.then, PromiseReject = Promise.reject, ArrayPrototypeFilter = Array.prototype.filter, StringPrototypeSplit = String.prototype.split, ArrayPrototypeEvery = Array.prototype.every, normalizePathToArray = (path) => ArrayPrototypeFilter.@call(StringPrototypeSplit(resolve(path), sep), Boolean);\nreturn cpFn})\n"_s;
+static constexpr ASCIILiteral InternalFSCpCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/fs/cp.ts\nasync function cpFn(src, dest, opts) {\n const stats = await checkPaths(src, dest, opts), { srcStat, destStat, skipped } = stats;\n if (skipped)\n return;\n return await checkParentPaths(src, srcStat, dest), checkParentDir(destStat, src, dest, opts);\n}\nasync function checkPaths(src, dest, opts) {\n if (opts.filter && !await opts.filter(src, dest))\n return { __proto__: null, skipped: !0 };\n const { 0: srcStat, 1: destStat } = await getStats(src, dest, opts);\n if (destStat) {\n if (areIdentical(srcStat, destStat))\n throw new Error(\"Source and destination must not be the same.\");\n if (srcStat.isDirectory() && !destStat.isDirectory())\n throw new Error(`cannot overwrite directory ${src} with non-directory ${dest}`);\n if (!srcStat.isDirectory() && destStat.isDirectory())\n throw new Error(`cannot overwrite non-directory ${src} with directory ${dest}`);\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return { __proto__: null, srcStat, destStat, skipped: !1 };\n}\nvar areIdentical = function(srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;\n}, getStats = function(src, dest, opts) {\n const statFunc = opts.dereference \? (file) => stat(file, { bigint: !0 }) : (file) => lstat(file, { bigint: !0 });\n return SafePromiseAll([\n statFunc(src),\n PromisePrototypeThen.@call(statFunc(dest), @undefined, (err) => {\n if (err.code === \"ENOENT\")\n return null;\n throw err;\n })\n ]);\n};\nasync function checkParentDir(destStat, src, dest, opts) {\n const destParent = dirname(dest);\n if (await pathExists(destParent))\n return getStatsForCopy(destStat, src, dest, opts);\n return await mkdir(destParent, { recursive: !0 }), getStatsForCopy(destStat, src, dest, opts);\n}\nvar pathExists = function(dest) {\n return PromisePrototypeThen(stat(dest), () => !0, (err) => err.code === \"ENOENT\" \? !1 : PromiseReject(err));\n};\nasync function checkParentPaths(src, srcStat, dest) {\n const srcParent = resolve(dirname(src)), destParent = resolve(dirname(dest));\n if (destParent === srcParent || destParent === parse(destParent).root)\n return;\n let destStat;\n try {\n destStat = await stat(destParent, { bigint: !0 });\n } catch (err) {\n if (err.code === \"ENOENT\")\n return;\n throw err;\n }\n if (areIdentical(srcStat, destStat))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return checkParentPaths(src, srcStat, destParent);\n}\nvar isSrcSubdir = function(src, dest) {\n const srcArr = normalizePathToArray(src), destArr = normalizePathToArray(dest);\n return ArrayPrototypeEvery.@call(srcArr, (cur, i) => destArr[i] === cur);\n};\nasync function getStatsForCopy(destStat, src, dest, opts) {\n const srcStat = await (opts.dereference \? stat : lstat)(src);\n if (srcStat.isDirectory() && opts.recursive)\n return onDir(srcStat, destStat, src, dest, opts);\n else if (srcStat.isDirectory())\n throw new Error(`${src} is a directory (not copied)`);\n else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())\n return onFile(srcStat, destStat, src, dest, opts);\n else if (srcStat.isSymbolicLink())\n return onLink(destStat, src, dest, opts);\n else if (srcStat.isSocket())\n throw new Error(`cannot copy a socket file: ${dest}`);\n else if (srcStat.isFIFO())\n throw new Error(`cannot copy a FIFO pipe: ${dest}`);\n throw new Error(`cannot copy an unknown file type: ${dest}`);\n}\nvar onFile = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return _copyFile(srcStat, src, dest, opts);\n return mayCopyFile(srcStat, src, dest, opts);\n};\nasync function mayCopyFile(srcStat, src, dest, opts) {\n if (opts.force)\n return await unlink(dest), _copyFile(srcStat, src, dest, opts);\n else if (opts.errorOnExist)\n throw new Error(`${dest} already exists`);\n}\nasync function _copyFile(srcStat, src, dest, opts) {\n if (await copyFile(src, dest, opts.mode), opts.preserveTimestamps)\n return handleTimestampsAndMode(srcStat.mode, src, dest);\n return setDestMode(dest, srcStat.mode);\n}\nasync function handleTimestampsAndMode(srcMode, src, dest) {\n if (fileIsNotWritable(srcMode))\n return await makeFileWritable(dest, srcMode), setDestTimestampsAndMode(srcMode, src, dest);\n return setDestTimestampsAndMode(srcMode, src, dest);\n}\nvar fileIsNotWritable = function(srcMode) {\n return (srcMode & 128) === 0;\n}, makeFileWritable = function(dest, srcMode) {\n return setDestMode(dest, srcMode | 128);\n};\nasync function setDestTimestampsAndMode(srcMode, src, dest) {\n return await setDestTimestamps(src, dest), setDestMode(dest, srcMode);\n}\nvar setDestMode = function(dest, srcMode) {\n return chmod(dest, srcMode);\n};\nasync function setDestTimestamps(src, dest) {\n const updatedSrcStat = await stat(src);\n return utimes(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\n}\nvar onDir = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return mkDirAndCopy(srcStat.mode, src, dest, opts);\n return copyDir(src, dest, opts);\n};\nasync function mkDirAndCopy(srcMode, src, dest, opts) {\n return await mkdir(dest), await copyDir(src, dest, opts), setDestMode(dest, srcMode);\n}\nasync function copyDir(src, dest, opts) {\n const dir = await opendir(src);\n for await (let { name } of dir) {\n const srcItem = join(src, name), destItem = join(dest, name), { destStat, skipped } = await checkPaths(srcItem, destItem, opts);\n if (!skipped)\n await getStatsForCopy(destStat, srcItem, destItem, opts);\n }\n}\nasync function onLink(destStat, src, dest, opts) {\n let resolvedSrc = await readlink(src);\n if (!opts.verbatimSymlinks && !isAbsolute(resolvedSrc))\n resolvedSrc = resolve(dirname(src), resolvedSrc);\n if (!destStat)\n return symlink(resolvedSrc, dest);\n let resolvedDest;\n try {\n resolvedDest = await readlink(dest);\n } catch (err) {\n if (err.code === \"EINVAL\" || err.code === \"UNKNOWN\")\n return symlink(resolvedSrc, dest);\n throw err;\n }\n if (!isAbsolute(resolvedDest))\n resolvedDest = resolve(dirname(dest), resolvedDest);\n if (isSrcSubdir(resolvedSrc, resolvedDest))\n throw new Error(`cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`);\n if ((await stat(src)).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc))\n throw new Error(`cannot overwrite ${resolvedDest} with ${resolvedSrc}`);\n return copyLink(resolvedSrc, dest);\n}\nasync function copyLink(resolvedSrc, dest) {\n return await unlink(dest), symlink(resolvedSrc, dest);\n}\nvar { chmod, copyFile, lstat, mkdir, opendir, readlink, stat, symlink, unlink, utimes } = @getInternalField(@internalModuleRegistry, 22) || @createInternalModuleById(22), { dirname, isAbsolute, join, parse, resolve, sep } = @getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30), SafePromiseAll = @Promise.all, PromisePrototypeThen = @Promise.prototype.then, PromiseReject = @Promise.reject, ArrayPrototypeFilter = @Array.prototype.filter, StringPrototypeSplit = @String.prototype.split, ArrayPrototypeEvery = @Array.prototype.every, normalizePathToArray = (path) => ArrayPrototypeFilter.@call(StringPrototypeSplit(resolve(path), sep), Boolean);\nreturn cpFn})\n");
//
//
-static constexpr ASCIILiteral InternalSharedCode = "(function (){\"use strict\";// src/js/out/tmp/internal/shared.ts\nvar throwNotImplemented = function(feature, issue) {\n throw hideFromStack(throwNotImplemented), new NotImplementedError(feature, issue);\n}, hideFromStack = function(...fns) {\n for (let fn of fns)\n Object.defineProperty(fn, \"name\", {\n value: \"::bunternal::\"\n });\n}, $;\n\nclass NotImplementedError extends Error {\n code;\n constructor(feature, issue) {\n super(feature + \" is not yet implemented in Bun.\" + (issue \? \" Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/\" + issue : \"\"));\n this.name = \"NotImplementedError\", this.code = \"ERR_NOT_IMPLEMENTED\", hideFromStack(NotImplementedError);\n }\n}\n$ = {\n NotImplementedError,\n throwNotImplemented,\n hideFromStack\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral InternalPrimordialsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/primordials.ts\nvar getGetter = function(cls, getter) {\n return FunctionPrototypeCall.bind(cls.prototype.__lookupGetter__(getter));\n}, uncurryThis = function(func) {\n return FunctionPrototypeCall.bind(func);\n}, ErrorCaptureStackTrace = function(targetObject) {\n const stack = new Error().stack;\n targetObject.stack = stack.replace(/.*\\n.*/, \"$1\");\n}, $, createSafeIterator = (factory, next) => {\n\n class SafeIterator {\n constructor(iterable) {\n this._iterator = factory(iterable);\n }\n next() {\n return next(this._iterator);\n }\n [Symbol.iterator]() {\n return this;\n }\n }\n return Object.setPrototypeOf(SafeIterator.prototype, null), Object.freeze(SafeIterator.prototype), Object.freeze(SafeIterator), SafeIterator;\n}, FunctionPrototypeCall = @getByIdDirect(Function.prototype, \"call\"), copyProps = (src, dest) => {\n ArrayPrototypeForEach(Reflect.ownKeys(src), (key) => {\n if (!Reflect.getOwnPropertyDescriptor(dest, key))\n Reflect.defineProperty(dest, key, Reflect.getOwnPropertyDescriptor(src, key));\n });\n}, makeSafe = (unsafe, safe) => {\n if (Symbol.iterator in unsafe.prototype) {\n const dummy = new unsafe;\n let next;\n ArrayPrototypeForEach(Reflect.ownKeys(unsafe.prototype), (key) => {\n if (!Reflect.getOwnPropertyDescriptor(safe.prototype, key)) {\n const desc = Reflect.getOwnPropertyDescriptor(unsafe.prototype, key);\n if (typeof desc.value === \"function\" && desc.value.length === 0 && (Symbol.iterator in (desc.value.@call(dummy) || {}))) {\n const createIterator = uncurryThis(desc.value);\n next \?\?= uncurryThis(createIterator(dummy).next);\n const SafeIterator = createSafeIterator(createIterator, next);\n desc.value = function() {\n return new SafeIterator(this);\n };\n }\n Reflect.defineProperty(safe.prototype, key, desc);\n }\n });\n } else\n copyProps(unsafe.prototype, safe.prototype);\n return copyProps(unsafe, safe), Object.setPrototypeOf(safe.prototype, null), Object.freeze(safe.prototype), Object.freeze(safe), safe;\n}, StringIterator = uncurryThis(@String.prototype[Symbol.iterator]), StringIteratorPrototype = Reflect.getPrototypeOf(StringIterator(\"\")), ArrayPrototypeForEach = uncurryThis(@Array.prototype.forEach), arrayProtoPush = @Array.prototype.push;\n$ = {\n makeSafe,\n Array: @Array,\n ArrayFrom: @Array.from,\n ArrayIsArray: @Array.isArray,\n ArrayPrototypeFlat: uncurryThis(@Array.prototype.flat),\n ArrayPrototypeFilter: uncurryThis(@Array.prototype.filter),\n ArrayPrototypeForEach,\n ArrayPrototypeIncludes: uncurryThis(@Array.prototype.includes),\n ArrayPrototypeIndexOf: uncurryThis(@Array.prototype.indexOf),\n ArrayPrototypeJoin: uncurryThis(@Array.prototype.join),\n ArrayPrototypeMap: uncurryThis(@Array.prototype.map),\n ArrayPrototypePop: uncurryThis(@Array.prototype.pop),\n ArrayPrototypePush: uncurryThis(arrayProtoPush),\n ArrayPrototypePushApply: (a, b) => arrayProtoPush.@apply(a, b),\n ArrayPrototypeSlice: uncurryThis(@Array.prototype.slice),\n ArrayPrototypeSort: uncurryThis(@Array.prototype.sort),\n ArrayPrototypeSplice: uncurryThis(@Array.prototype.splice),\n ArrayPrototypeUnshift: uncurryThis(@Array.prototype.unshift),\n BigIntPrototypeValueOf: uncurryThis(BigInt.prototype.valueOf),\n BooleanPrototypeValueOf: uncurryThis(Boolean.prototype.valueOf),\n DatePrototypeGetTime: uncurryThis(Date.prototype.getTime),\n DatePrototypeToISOString: uncurryThis(Date.prototype.toISOString),\n DatePrototypeToString: uncurryThis(Date.prototype.toString),\n ErrorCaptureStackTrace,\n ErrorPrototypeToString: uncurryThis(Error.prototype.toString),\n FunctionPrototypeToString: uncurryThis(Function.prototype.toString),\n JSONStringify: JSON.stringify,\n MapPrototypeGetSize: getGetter(Map, \"size\"),\n MapPrototypeEntries: uncurryThis(Map.prototype.entries),\n MapPrototypeValues: uncurryThis(Map.prototype.values),\n MapPrototypeKeys: uncurryThis(Map.prototype.keys),\n MathFloor: Math.floor,\n MathMax: Math.max,\n MathMin: Math.min,\n MathRound: Math.round,\n MathSqrt: Math.sqrt,\n MathTrunc: Math.trunc,\n Number,\n NumberIsFinite: Number.isFinite,\n NumberIsNaN: Number.isNaN,\n NumberParseFloat: Number.parseFloat,\n NumberParseInt: Number.parseInt,\n NumberPrototypeToString: uncurryThis(Number.prototype.toString),\n NumberPrototypeValueOf: uncurryThis(Number.prototype.valueOf),\n Object,\n ObjectAssign: Object.assign,\n ObjectCreate: Object.create,\n ObjectDefineProperty: Object.defineProperty,\n ObjectEntries: Object.entries,\n ObjectGetOwnPropertyDescriptor: Object.getOwnPropertyDescriptor,\n ObjectGetOwnPropertyDescriptors: Object.getOwnPropertyDescriptors,\n ObjectGetOwnPropertyNames: Object.getOwnPropertyNames,\n ObjectGetOwnPropertySymbols: Object.getOwnPropertySymbols,\n ObjectGetPrototypeOf: Object.getPrototypeOf,\n ObjectIs: Object.is,\n ObjectKeys: Object.keys,\n ObjectPrototypeHasOwnProperty: uncurryThis(Object.prototype.hasOwnProperty),\n ObjectPrototypePropertyIsEnumerable: uncurryThis(Object.prototype.propertyIsEnumerable),\n ObjectPrototypeToString: uncurryThis(Object.prototype.toString),\n ObjectSeal: Object.seal,\n ObjectSetPrototypeOf: Object.setPrototypeOf,\n ReflectApply: @getByIdDirect(Reflect, \"apply\"),\n ReflectOwnKeys: Reflect.ownKeys,\n RegExp: @RegExp,\n RegExpPrototypeExec: uncurryThis(@RegExp.prototype.exec),\n RegExpPrototypeSymbolReplace: uncurryThis(@RegExp.prototype[Symbol.replace]),\n RegExpPrototypeSymbolSplit: uncurryThis(@RegExp.prototype[Symbol.split]),\n RegExpPrototypeTest: uncurryThis(@RegExp.prototype.test),\n RegExpPrototypeToString: uncurryThis(@RegExp.prototype.toString),\n SafeStringIterator: createSafeIterator(StringIterator, uncurryThis(StringIteratorPrototype.next)),\n SafeMap: makeSafe(Map, class SafeMap extends Map {\n constructor(i) {\n super(i);\n }\n }),\n SafeSet: makeSafe(Set, class SafeSet extends Set {\n constructor(i) {\n super(i);\n }\n }),\n SetPrototypeGetSize: getGetter(Set, \"size\"),\n SetPrototypeEntries: uncurryThis(Set.prototype.entries),\n SetPrototypeValues: uncurryThis(Set.prototype.values),\n String: @String,\n StringPrototypeCharCodeAt: uncurryThis(@String.prototype.charCodeAt),\n StringPrototypeCodePointAt: uncurryThis(@String.prototype.codePointAt),\n StringPrototypeEndsWith: uncurryThis(@String.prototype.endsWith),\n StringPrototypeIncludes: uncurryThis(@String.prototype.includes),\n StringPrototypeIndexOf: uncurryThis(@String.prototype.indexOf),\n StringPrototypeLastIndexOf: uncurryThis(@String.prototype.lastIndexOf),\n StringPrototypeMatch: uncurryThis(@String.prototype.match),\n StringPrototypeNormalize: uncurryThis(@String.prototype.normalize),\n StringPrototypePadEnd: uncurryThis(@String.prototype.padEnd),\n StringPrototypePadStart: uncurryThis(@String.prototype.padStart),\n StringPrototypeRepeat: uncurryThis(@String.prototype.repeat),\n StringPrototypeReplace: uncurryThis(@String.prototype.replace),\n StringPrototypeReplaceAll: uncurryThis(@String.prototype.replaceAll),\n StringPrototypeSlice: uncurryThis(@String.prototype.slice),\n StringPrototypeSplit: uncurryThis(@String.prototype.split),\n StringPrototypeStartsWith: uncurryThis(@String.prototype.startsWith),\n StringPrototypeToLowerCase: uncurryThis(@String.prototype.toLowerCase),\n StringPrototypeTrim: uncurryThis(@String.prototype.trim),\n StringPrototypeValueOf: uncurryThis(@String.prototype.valueOf),\n SymbolPrototypeToString: uncurryThis(Symbol.prototype.toString),\n SymbolPrototypeValueOf: uncurryThis(Symbol.prototype.valueOf),\n FunctionPrototypeToString: uncurryThis(Function.prototype.toString),\n FunctionPrototypeBind: uncurryThis(Function.prototype.bind),\n SymbolIterator: Symbol.iterator,\n SymbolFor: Symbol.for,\n SymbolToStringTag: Symbol.toStringTag,\n TypedArrayPrototypeGetLength: getGetter(@Uint8Array, \"length\"),\n TypedArrayPrototypeGetSymbolToStringTag: getGetter(@Uint8Array, Symbol.toStringTag),\n Uint8ClampedArray,\n Uint8Array: @Uint8Array,\n Uint16Array,\n Uint32Array,\n Int8Array,\n Int16Array,\n Int32Array,\n Float32Array,\n Float64Array,\n BigUint64Array,\n BigInt64Array,\n uncurryThis\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeAssertCode = "(function (){\"use strict\";// src/js/out/tmp/node/assert.ts\nvar CallTracker = function() {\n throw new Error(\"CallTracker is not supported yet\");\n}, util = @getInternalField(@internalModuleRegistry, 46) || @createInternalModuleById(46), isDeepEqual = Bun.deepEquals, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_errors = __commonJS({\n \"assert/build/internal/errors.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n var codes = {}, assert, util2;\n function createErrorType(code, message, Base) {\n Base || (Base = Error);\n function getMessage(arg1, arg2, arg3) {\n return typeof message == \"string\" \? message : message(arg1, arg2, arg3);\n }\n var NodeError = function(_Base) {\n _inherits(NodeError2, _Base);\n function NodeError2(arg1, arg2, arg3) {\n var _this;\n return _classCallCheck(this, NodeError2), _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError2).call(this, getMessage(arg1, arg2, arg3))), _this.code = code, _this;\n }\n return NodeError2;\n }(Base);\n codes[code] = NodeError;\n }\n function oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n return expected = expected.map(function(i) {\n return String(i);\n }), len > 2 \? \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1] : len === 2 \? \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]) : \"of \".concat(thing, \" \").concat(expected[0]);\n } else\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n function startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 \? 0 : +pos, search.length) === search;\n }\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function includes(str, search, start) {\n return typeof start != \"number\" && (start = 0), start + search.length > str.length \? !1 : str.indexOf(search, start) !== -1;\n }\n createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError), createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n assert === void 0 && (assert = require_assert()), assert(typeof name == \"string\", \"'name' must be a string\");\n var determiner;\n typeof expected == \"string\" && startsWith(expected, \"not \") \? (determiner = \"must not be\", expected = expected.replace(/^not /, \"\")) : determiner = \"must be\";\n var msg;\n if (endsWith(name, \" argument\"))\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n else {\n var type = includes(name, \".\") \? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n }\n return msg += \". Received type \".concat(_typeof(actual)), msg;\n }, TypeError), createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== void 0 \? arguments[2] : \"is invalid\", inspected = util2.inspect(value);\n return inspected.length > 128 && (inspected = \"\".concat(inspected.slice(0, 128), \"...\")), \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n }, TypeError, RangeError), createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n return value && value.constructor && value.constructor.name \? type = \"instance of \".concat(value.constructor.name) : type = \"type \".concat(_typeof(value)), \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n }, TypeError), createErrorType(\"ERR_MISSING_ARGS\", function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n assert === void 0 && (assert = require_assert()), assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \", len = args.length;\n switch (args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n }), len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \"), msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n }, TypeError), module2.exports.codes = codes;\n }\n}), require_assertion_error = __commonJS({\n \"assert/build/internal/assert/assertion_error.js\"(exports, module2) {\n function _objectSpread(target) {\n for (var i = 1;i < arguments.length; i++) {\n var source = arguments[i] != null \? arguments[i] : {}, ownKeys = Object.keys(source);\n typeof Object.getOwnPropertySymbols == \"function\" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }))), ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n }\n function _defineProperty(obj, key, value) {\n return (key in obj) \? Object.defineProperty(obj, key, {\n value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : obj[key] = value, obj;\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _defineProperties(target, props) {\n for (var i = 0;i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, (\"value\" in descriptor) && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map == \"function\" \? new Map : void 0;\n return _wrapNativeSuper = function(Class2) {\n if (Class2 === null || !_isNativeFunction(Class2))\n return Class2;\n if (typeof Class2 != \"function\")\n @throwTypeError(\"Super expression must either be null or a function\");\n if (typeof _cache != \"undefined\") {\n if (_cache.has(Class2))\n return _cache.get(Class2);\n _cache.set(Class2, Wrapper);\n }\n function Wrapper() {\n return _construct(Class2, arguments, _getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(Class2.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), _setPrototypeOf(Wrapper, Class2);\n }, _wrapNativeSuper(Class);\n }\n function isNativeReflectConstruct() {\n if (typeof Reflect == \"undefined\" || !Reflect.construct || Reflect.construct.sham)\n return !1;\n if (typeof Proxy == \"function\")\n return !0;\n try {\n return Date.prototype.toString.call(Reflect.construct(Date, [], function() {\n })), !0;\n } catch {\n return !1;\n }\n }\n function _construct(Parent, args, Class) {\n return isNativeReflectConstruct() \? _construct = Reflect.construct : _construct = function(Parent2, args2, Class2) {\n var a = [null];\n a.push.apply(a, args2);\n var Constructor = Function.bind.apply(Parent2, a), instance = new Constructor;\n return Class2 && _setPrototypeOf(instance, Class2.prototype), instance;\n }, _construct.apply(null, arguments);\n }\n function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n var inspect = util.inspect, _require2 = require_errors(), ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function repeat(str, count) {\n if (count = Math.floor(count), str.length == 0 || count == 0)\n return \"\";\n var maxCount = str.length * count;\n for (count = Math.floor(Math.log(count) / Math.log(2));count; )\n str += str, count--;\n return str += str.substring(0, maxCount - str.length), str;\n }\n var blue = \"\", green = \"\", red = \"\", white = \"\", kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n }, kMaxShortLength = 10;\n function copyError(source) {\n var keys = Object.keys(source), target = Object.create(Object.getPrototypeOf(source));\n return keys.forEach(function(key) {\n target[key] = source[key];\n }), Object.defineProperty(target, \"message\", {\n value: source.message\n }), target;\n }\n function inspectValue(val) {\n return inspect(val, {\n compact: !1,\n customInspect: !1,\n depth: 1000,\n maxArrayLength: Infinity,\n showHidden: !1,\n breakLength: Infinity,\n showProxy: !1,\n sorted: !0,\n getters: !0\n });\n }\n function createErrDiff(actual, expected, operator) {\n var other = \"\", res = \"\", lastPos = 0, end = \"\", skipped = !1, actualInspected = inspectValue(actual), actualLines = actualInspected.split(`\n`), expectedLines = inspectValue(expected).split(`\n`), i = 0, indicator = \"\";\n if (operator === \"strictEqual\" && _typeof(actual) === \"object\" && _typeof(expected) === \"object\" && actual !== null && expected !== null && (operator = \"strictEqualObject\"), actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== \"object\" || actual === null) && (_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0))\n return \"\".concat(kReadableOperator[operator], `\n\n`) + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], `\n`);\n } else if (operator !== \"strictEqualObject\") {\n var maxLength = process.stderr && process.stderr.isTTY \? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n for (;actualLines[0][i] === expectedLines[0][i]; )\n i++;\n i > 2 && (indicator = `\n `.concat(repeat(\" \", i), \"^\"), i = 0);\n }\n }\n }\n for (var a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];a === b && (i++ < 2 \? end = `\n `.concat(a).concat(end) : other = a, actualLines.pop(), expectedLines.pop(), !(actualLines.length === 0 || expectedLines.length === 0)); )\n a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n if (maxLines === 0) {\n var _actualLines = actualInspected.split(`\n`);\n if (_actualLines.length > 30)\n for (_actualLines[26] = \"\".concat(blue, \"...\").concat(white);_actualLines.length > 27; )\n _actualLines.pop();\n return \"\".concat(kReadableOperator.notIdentical, `\n\n`).concat(_actualLines.join(`\n`), `\n`);\n }\n i > 3 && (end = `\n`.concat(blue, \"...\").concat(white).concat(end), skipped = !0), other !== \"\" && (end = `\n `.concat(other).concat(end), other = \"\");\n var printedLines = 0, msg = kReadableOperator[operator] + `\n`.concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white), skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0;i < maxLines; i++) {\n var cur = i - lastPos;\n if (actualLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(expectedLines[i - 2]), printedLines++), res += `\n `.concat(expectedLines[i - 1]), printedLines++), lastPos = i, other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]), printedLines++;\n else if (expectedLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLines[i]), printedLines++;\n else {\n var expectedLine = expectedLines[i], actualLine = actualLines[i], divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n divergingLines && endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine && (divergingLines = !1, actualLine += \",\"), divergingLines \? (cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLine), other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLine), printedLines += 2) : (res += other, other = \"\", (cur === 1 || i === 0) && (res += `\n `.concat(actualLine), printedLines++));\n }\n if (printedLines > 20 && i < maxLines - 2)\n return \"\".concat(msg).concat(skippedMsg, `\n`).concat(res, `\n`).concat(blue, \"...\").concat(white).concat(other, `\n`) + \"\".concat(blue, \"...\").concat(white);\n }\n return \"\".concat(msg).concat(skipped \? skippedMsg : \"\", `\n`).concat(res).concat(other).concat(end).concat(indicator);\n }\n var AssertionError = function(_Error) {\n function AssertionError2(options) {\n var _this;\n if (_classCallCheck(this, AssertionError2), _typeof(options) !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var { message, operator, stackStartFn, actual, expected } = options, limit = Error.stackTraceLimit;\n if (Error.stackTraceLimit = 0, message != null)\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, String(message)));\n else if (process.stderr && process.stderr.isTTY && (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1 \? (blue = \"\", green = \"\", white = \"\", red = \"\") : (blue = \"\", green = \"\", white = \"\", red = \"\")), _typeof(actual) === \"object\" && actual !== null && _typeof(expected) === \"object\" && expected !== null && (\"stack\" in actual) && actual instanceof Error && (\"stack\" in expected) && expected instanceof Error && (actual = copyError(actual), expected = copyError(expected)), operator === \"deepStrictEqual\" || operator === \"strictEqual\")\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, createErrDiff(actual, expected, operator)));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n var base = kReadableOperator[operator], res = inspectValue(actual).split(`\n`);\n if (operator === \"notStrictEqual\" && _typeof(actual) === \"object\" && actual !== null && (base = kReadableOperator.notStrictEqualObject), res.length > 30)\n for (res[26] = \"\".concat(blue, \"...\").concat(white);res.length > 27; )\n res.pop();\n res.length === 1 \? _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, \" \").concat(res[0]))) : _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, `\n\n`).concat(res.join(`\n`), `\n`)));\n } else {\n var _res = inspectValue(actual), other = \"\", knownOperators = kReadableOperator[operator];\n operator === \"notDeepEqual\" || operator === \"notEqual\" \? (_res = \"\".concat(kReadableOperator[operator], `\n\n`).concat(_res), _res.length > 1024 && (_res = \"\".concat(_res.slice(0, 1021), \"...\"))) : (other = \"\".concat(inspectValue(expected)), _res.length > 512 && (_res = \"\".concat(_res.slice(0, 509), \"...\")), other.length > 512 && (other = \"\".concat(other.slice(0, 509), \"...\")), operator === \"deepEqual\" || operator === \"equal\" \? _res = \"\".concat(knownOperators, `\n\n`).concat(_res, `\n\nshould equal\n\n`) : other = \" \".concat(operator, \" \").concat(other)), _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(_res).concat(other)));\n }\n return Error.stackTraceLimit = limit, _this.generatedMessage = !message, Object.defineProperty(_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: !1,\n writable: !0,\n configurable: !0\n }), _this.code = \"ERR_ASSERTION\", _this.actual = actual, _this.expected = expected, _this.operator = operator, Error.captureStackTrace && Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn), _this.stack, _this.name = \"AssertionError\", _possibleConstructorReturn(_this);\n }\n return AssertionError2.prototype = {}, _inherits(AssertionError2, _Error), _createClass(AssertionError2, [\n {\n key: \"toString\",\n value: function() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: inspect.custom,\n value: function(recurseTimes, ctx) {\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: !1,\n depth: 0\n }));\n }\n }\n ]), AssertionError2;\n }(_wrapNativeSuper(Error));\n module2.exports = AssertionError;\n }\n}), require_assert = __commonJS({\n \"assert/build/assert.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n var _require = require_errors(), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, AssertionError = require_assertion_error(), _require2 = util, inspect = _require2.inspect, _require$types = util.types, isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp, objectAssign = Object.assign, objectIs = Object.is, errorCache = new Map, warned = !1, assert = module2.exports = ok, NO_EXCEPTION_SENTINEL = {};\n function innerFail(obj) {\n throw obj.message instanceof Error \? obj.message : new AssertionError(obj);\n }\n function fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length, internalMessage;\n if (argsLen === 0)\n internalMessage = \"Failed\";\n else if (argsLen === 1)\n message = actual, actual = void 0;\n else {\n if (warned === !1) {\n warned = !0;\n var warn = process.emitWarning \? process.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n argsLen === 2 && (operator = \"!=\");\n }\n if (message instanceof Error)\n throw message;\n var errArgs = {\n actual,\n expected,\n operator: operator === void 0 \? \"fail\" : operator,\n stackStartFn: stackStartFn || fail\n };\n message !== void 0 && (errArgs.message = message);\n var err = new AssertionError(errArgs);\n throw internalMessage && (err.message = internalMessage, err.generatedMessage = !0), err;\n }\n assert.fail = fail, assert.AssertionError = AssertionError;\n function innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = !1;\n if (argLen === 0)\n generatedMessage = !0, message = \"No value argument passed to `assert.ok()`\";\n else if (message instanceof Error)\n throw message;\n var err = new AssertionError({\n actual: value,\n expected: !0,\n message,\n operator: \"==\",\n stackStartFn: fn\n });\n throw err.generatedMessage = generatedMessage, err;\n }\n }\n function ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n innerOk.apply(void 0, [ok, args.length].concat(args));\n }\n assert.ok = ok, assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual != expected && innerFail({\n actual,\n expected,\n message,\n operator: \"==\",\n stackStartFn: equal\n });\n }, assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual == expected && innerFail({\n actual,\n expected,\n message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n }, assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n }, assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n }, assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n }, assert.notDeepStrictEqual = notDeepStrictEqual;\n function notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: notDeepStrictEqual\n });\n }\n assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) || innerFail({\n actual,\n expected,\n message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n }, assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) && innerFail({\n actual,\n expected,\n message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n }, assert.match = function match(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!isRegExp(expected))\n throw new ERR_INVALID_ARG_TYPE(\"expected\", \"RegExp\", expected);\n expected.test(actual) || innerFail({\n actual,\n expected,\n message,\n operator: \"match\",\n stackStartFn: match\n });\n };\n var Comparison = function Comparison2(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison2), keys.forEach(function(key) {\n (key in obj) && (actual !== void 0 && typeof actual[key] == \"string\" && isRegExp(obj[key]) && obj[key].test(actual[key]) \? _this[key] = actual[key] : _this[key] = obj[key]);\n });\n };\n function compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepEqual(actual[key], expected[key], !0)) {\n if (!message) {\n var a = new Comparison(actual, keys), b = new Comparison(expected, keys, actual), err = new AssertionError({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.actual = actual, err.expected = expected, err.operator = fn.name, err;\n }\n innerFail({\n actual,\n expected,\n message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n }\n function expectedException(actual, expected, msg, fn) {\n if (typeof expected != \"function\") {\n if (isRegExp(expected))\n return expected.test(actual);\n if (arguments.length === 2)\n throw new ERR_INVALID_ARG_TYPE(\"expected\", [\"Function\", \"RegExp\"], expected);\n if (_typeof(actual) !== \"object\" || actual === null) {\n var err = new AssertionError({\n actual,\n expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.operator = fn.name, err;\n }\n var keys = Object.keys(expected);\n if (expected instanceof Error)\n keys.push(\"name\", \"message\");\n else if (keys.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n return keys.forEach(function(key) {\n return typeof actual[key] == \"string\" && isRegExp(expected[key]) && expected[key].test(actual[key]) || compareExceptionKey(actual, expected, key, msg, keys, fn);\n }), !0;\n }\n return expected.prototype !== void 0 && actual instanceof expected \? !0 : Error.isPrototypeOf(expected) \? !1 : expected.call({}, actual) === !0;\n }\n function getActual(fn) {\n if (typeof fn != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n }\n function checkIsPromise(obj) {\n return isPromise(obj) || obj !== null && _typeof(obj) === \"object\" && typeof obj.then == \"function\" && typeof obj.catch == \"function\";\n }\n function waitForActual(promiseFn) {\n return Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn == \"function\") {\n if (resultPromise = promiseFn(), !checkIsPromise(resultPromise))\n throw new ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if (checkIsPromise(promiseFn))\n resultPromise = promiseFn;\n else\n throw new ERR_INVALID_ARG_TYPE(\"promiseFn\", [\"Function\", \"Promise\"], promiseFn);\n return Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n }\n function expectsError(stackStartFn, actual, error, message) {\n if (typeof error == \"string\") {\n if (arguments.length === 4)\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error, error = void 0;\n } else if (error != null && _typeof(error) !== \"object\" && typeof error != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n error && error.name && (details += \" (\".concat(error.name, \")\")), details += message \? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" \? \"rejection\" : \"exception\";\n innerFail({\n actual: void 0,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn))\n throw actual;\n }\n function expectsNoError(stackStartFn, actual, error, message) {\n if (actual !== NO_EXCEPTION_SENTINEL) {\n if (typeof error == \"string\" && (message = error, error = void 0), !error || expectedException(actual, error)) {\n var details = message \? \": \".concat(message) : \".\", fnType = stackStartFn.name === \"doesNotReject\" \? \"rejection\" : \"exception\";\n innerFail({\n actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, `\n`) + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn\n });\n }\n throw actual;\n }\n }\n assert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 \? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++)\n args[_key2 - 1] = arguments[_key2];\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n }, assert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 \? _len3 - 1 : 0), _key3 = 1;_key3 < _len3; _key3++)\n args[_key3 - 1] = arguments[_key3];\n return waitForActual(promiseFn).then(function(result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n }, assert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 \? _len4 - 1 : 0), _key4 = 1;_key4 < _len4; _key4++)\n args[_key4 - 1] = arguments[_key4];\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n }, assert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 \? _len5 - 1 : 0), _key5 = 1;_key5 < _len5; _key5++)\n args[_key5 - 1] = arguments[_key5];\n return waitForActual(fn).then(function(result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n }, assert.ifError = function ifError(err) {\n if (err != null) {\n var message = \"ifError got unwanted exception: \";\n _typeof(err) === \"object\" && typeof err.message == \"string\" \? err.message.length === 0 && err.constructor \? message += err.constructor.name : message += err.message : message += inspect(err);\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message,\n stackStartFn: ifError\n }), origStack = err.stack;\n if (typeof origStack == \"string\") {\n var tmp2 = origStack.split(`\n`);\n tmp2.shift();\n for (var tmp1 = newErr.stack.split(`\n`), i = 0;i < tmp2.length; i++) {\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(`\n`), `\n`).concat(tmp2.join(`\n`));\n }\n throw newErr;\n }\n };\n function strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0;_key6 < _len6; _key6++)\n args[_key6] = arguments[_key6];\n innerOk.apply(void 0, [strict, args.length].concat(args));\n }\n assert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n }), assert.strict.strict = assert.strict;\n }\n}), assert_module = require_assert();\nassert_module.CallTracker = CallTracker;\nreturn assert_module})\n"_s;
+static constexpr ASCIILiteral InternalSharedCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/shared.ts\nvar throwNotImplemented = function(feature, issue) {\n throw hideFromStack(throwNotImplemented), new NotImplementedError(feature, issue);\n}, hideFromStack = function(...fns) {\n for (let fn of fns)\n Object.defineProperty(fn, \"name\", {\n value: \"::bunternal::\"\n });\n}, $;\n\nclass NotImplementedError extends Error {\n code;\n constructor(feature, issue) {\n super(feature + \" is not yet implemented in Bun.\" + (issue \? \" Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/\" + issue : \"\"));\n this.name = \"NotImplementedError\", this.code = \"ERR_NOT_IMPLEMENTED\", hideFromStack(NotImplementedError);\n }\n}\n$ = {\n NotImplementedError,\n throwNotImplemented,\n hideFromStack\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeAssertStrictCode = "(function (){\"use strict\";// src/js/out/tmp/node/assert.strict.ts\nreturn (@getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6)).strict})\n"_s;
+static constexpr ASCIILiteral InternalUtilInspectCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/util/inspect.ts\nvar vmSafeInstanceof = function(val, ctor) {\n if (val instanceof ctor)\n return !0;\n while (val) {\n if (typeof val !== \"object\")\n return !1;\n if (ctor.name === internalGetConstructorName(val))\n return !0;\n val = ObjectGetPrototypeOf(val);\n }\n return !1;\n}, checkBox = function(ctor) {\n return (val) => {\n if (!vmSafeInstanceof(val, ctor))\n return !1;\n try {\n ctor.prototype.valueOf.@call(val);\n } catch {\n return !1;\n }\n return !0;\n };\n}, assert = function(p, message) {\n if (!p)\n throw new AssertionError(message);\n}, getUserOptions = function(ctx, isCrossContext) {\n const ret = {\n stylize: ctx.stylize,\n showHidden: ctx.showHidden,\n depth: ctx.depth,\n colors: ctx.colors,\n customInspect: ctx.customInspect,\n showProxy: ctx.showProxy,\n maxArrayLength: ctx.maxArrayLength,\n maxStringLength: ctx.maxStringLength,\n breakLength: ctx.breakLength,\n compact: ctx.compact,\n sorted: ctx.sorted,\n getters: ctx.getters,\n numericSeparator: ctx.numericSeparator,\n ...ctx.userOptions\n };\n if (isCrossContext) {\n ObjectSetPrototypeOf(ret, null);\n for (let key of ObjectKeys(ret))\n if ((typeof ret[key] === \"object\" || typeof ret[key] === \"function\") && ret[key] !== null)\n delete ret[key];\n ret.stylize = ObjectSetPrototypeOf((value, flavour) => {\n let stylized;\n try {\n stylized = `${ctx.stylize(value, flavour)}`;\n } catch {\n }\n if (typeof stylized !== \"string\")\n return value;\n return stylized;\n }, null);\n }\n return ret;\n}, inspect = function(value, opts) {\n const ctx = {\n budget: {},\n indentationLvl: 0,\n seen: [],\n currentDepth: 0,\n stylize: stylizeNoColor,\n showHidden: inspectDefaultOptions.showHidden,\n depth: inspectDefaultOptions.depth,\n colors: inspectDefaultOptions.colors,\n customInspect: inspectDefaultOptions.customInspect,\n showProxy: inspectDefaultOptions.showProxy,\n maxArrayLength: inspectDefaultOptions.maxArrayLength,\n maxStringLength: inspectDefaultOptions.maxStringLength,\n breakLength: inspectDefaultOptions.breakLength,\n compact: inspectDefaultOptions.compact,\n sorted: inspectDefaultOptions.sorted,\n getters: inspectDefaultOptions.getters,\n numericSeparator: inspectDefaultOptions.numericSeparator\n };\n if (arguments.length > 1) {\n if (arguments.length > 2) {\n if (arguments[2] !== @undefined)\n ctx.depth = arguments[2];\n if (arguments.length > 3 && arguments[3] !== @undefined)\n ctx.colors = arguments[3];\n }\n if (typeof opts === \"boolean\")\n ctx.showHidden = opts;\n else if (opts) {\n const optKeys = ObjectKeys(opts);\n for (let i = 0;i < optKeys.length; ++i) {\n const key = optKeys[i];\n if (ObjectPrototypeHasOwnProperty(inspectDefaultOptions, key) || key === \"stylize\")\n ctx[key] = opts[key];\n else if (ctx.userOptions === @undefined)\n ctx.userOptions = opts;\n }\n }\n }\n if (ctx.colors)\n ctx.stylize = stylizeWithColor;\n if (ctx.maxArrayLength === null)\n ctx.maxArrayLength = @Infinity;\n if (ctx.maxStringLength === null)\n ctx.maxStringLength = @Infinity;\n return formatValue(ctx, value, 0);\n}, defineColorAlias = function(target, alias) {\n ObjectDefineProperty(inspect.colors, alias, {\n __proto__: null,\n get() {\n return this[target];\n },\n set(value) {\n this[target] = value;\n },\n configurable: !0,\n enumerable: !1\n });\n}, addQuotes = function(str, quotes) {\n if (quotes === -1)\n return `\"${str}\"`;\n if (quotes === -2)\n return `\\`${str}\\``;\n return `'${str}'`;\n}, escapeFn = function(str) {\n const charCode = StringPrototypeCharCodeAt(str);\n return meta.length > charCode \? meta[charCode] : `\\\\u${NumberPrototypeToString(charCode, 16)}`;\n}, strEscape = function(str) {\n let escapeTest = strEscapeSequencesRegExp, escapeReplace = strEscapeSequencesReplacer, singleQuote = 39;\n if (StringPrototypeIncludes(str, \"'\")) {\n if (!StringPrototypeIncludes(str, '\"'))\n singleQuote = -1;\n else if (!StringPrototypeIncludes(str, \"`\") && !StringPrototypeIncludes(str, \"${\"))\n singleQuote = -2;\n if (singleQuote !== 39)\n escapeTest = strEscapeSequencesRegExpSingle, escapeReplace = strEscapeSequencesReplacerSingle;\n }\n if (str.length < 5000 && RegExpPrototypeExec(escapeTest, str) === null)\n return addQuotes(str, singleQuote);\n if (str.length > 100)\n return str = RegExpPrototypeSymbolReplace(escapeReplace, str, escapeFn), addQuotes(str, singleQuote);\n let result = \"\", last = 0;\n for (let i = 0;i < str.length; i++) {\n const point = StringPrototypeCharCodeAt(str, i);\n if (point === singleQuote || point === 92 || point < 32 || point > 126 && point < 160) {\n if (last === i)\n result += meta[point];\n else\n result += `${StringPrototypeSlice(str, last, i)}${meta[point]}`;\n last = i + 1;\n } else if (point >= 55296 && point <= 57343) {\n if (point <= 56319 && i + 1 < str.length) {\n const point2 = StringPrototypeCharCodeAt(str, i + 1);\n if (point2 >= 56320 && point2 <= 57343) {\n i++;\n continue;\n }\n }\n result += `${StringPrototypeSlice(str, last, i)}\\\\u${NumberPrototypeToString(point, 16)}`, last = i + 1;\n }\n }\n if (last !== str.length)\n result += StringPrototypeSlice(str, last);\n return addQuotes(result, singleQuote);\n}, stylizeWithColor = function(str, styleType) {\n const style = inspect.styles[styleType];\n if (style !== @undefined) {\n const color = inspect.colors[style];\n if (color !== @undefined)\n return `\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`;\n }\n return str;\n}, stylizeNoColor = function(str) {\n return str;\n}, getEmptyFormatArray = function() {\n return [];\n}, isInstanceof = function(object, proto) {\n try {\n return object instanceof proto;\n } catch {\n return !1;\n }\n}, getConstructorName = function(obj, ctx, recurseTimes, protoProps) {\n let firstProto;\n const tmp = obj;\n while (obj || isUndetectableObject(obj)) {\n const descriptor = ObjectGetOwnPropertyDescriptor(obj, \"constructor\");\n if (descriptor !== @undefined && typeof descriptor.value === \"function\" && descriptor.value.name !== \"\" && isInstanceof(tmp, descriptor.value)) {\n if (protoProps !== @undefined && (firstProto !== obj || !builtInObjects.has(descriptor.value.name)))\n addPrototypeProperties(ctx, tmp, firstProto || tmp, recurseTimes, protoProps);\n return String(descriptor.value.name);\n }\n if (obj = ObjectGetPrototypeOf(obj), firstProto === @undefined)\n firstProto = obj;\n }\n if (firstProto === null)\n return null;\n const res = internalGetConstructorName(tmp);\n if (recurseTimes > ctx.depth && ctx.depth !== null)\n return `${res} <Complex prototype>`;\n const protoConstr = getConstructorName(firstProto, ctx, recurseTimes + 1, protoProps);\n if (protoConstr === null)\n return `${res} <${inspect(firstProto, {\n ...ctx,\n customInspect: !1,\n depth: -1\n })}>`;\n return `${res} <${protoConstr}>`;\n}, addPrototypeProperties = function(ctx, main, obj, recurseTimes, output) {\n let depth = 0, keys, keySet;\n do {\n if (depth !== 0 || main === obj) {\n if (obj = ObjectGetPrototypeOf(obj), obj === null)\n return;\n const descriptor = ObjectGetOwnPropertyDescriptor(obj, \"constructor\");\n if (descriptor !== @undefined && typeof descriptor.value === \"function\" && builtInObjects.has(descriptor.value.name))\n return;\n }\n if (depth === 0)\n keySet = new SafeSet;\n else\n ArrayPrototypeForEach(keys, (key) => keySet.add(key));\n keys = ReflectOwnKeys(obj), ArrayPrototypePush(ctx.seen, main);\n for (let key of keys) {\n if (key === \"constructor\" || ObjectPrototypeHasOwnProperty(main, key) || depth !== 0 && keySet.has(key))\n continue;\n const desc = ObjectGetOwnPropertyDescriptor(obj, key);\n if (typeof desc.value === \"function\")\n continue;\n const value = formatProperty(ctx, obj, recurseTimes, key, kObjectType, desc, main);\n if (ctx.colors)\n ArrayPrototypePush(output, `\\x1B[2m${value}\\x1B[22m`);\n else\n ArrayPrototypePush(output, value);\n }\n ArrayPrototypePop(ctx.seen);\n } while (++depth !== 3);\n}, getPrefix = function(constructor, tag, fallback, size = \"\") {\n if (constructor === null) {\n if (tag !== \"\" && fallback !== tag)\n return `[${fallback}${size}: null prototype] [${tag}] `;\n return `[${fallback}${size}: null prototype] `;\n }\n if (tag !== \"\" && constructor !== tag)\n return `${constructor}${size} [${tag}] `;\n return `${constructor}${size} `;\n}, getKeys = function(value, showHidden) {\n let keys;\n const symbols = ObjectGetOwnPropertySymbols(value);\n if (showHidden) {\n if (keys = ObjectGetOwnPropertyNames(value), symbols.length !== 0)\n ArrayPrototypePushApply(keys, symbols);\n } else {\n try {\n keys = ObjectKeys(value);\n } catch (err) {\n assert(isNativeError(err) && err.name === \"ReferenceError\" && isModuleNamespaceObject(value)), keys = ObjectGetOwnPropertyNames(value);\n }\n if (symbols.length !== 0)\n ArrayPrototypePushApply(keys, ArrayPrototypeFilter(symbols, (key) => ObjectPrototypePropertyIsEnumerable(value, key)));\n }\n return keys;\n}, getCtxStyle = function(value, constructor, tag) {\n let fallback = \"\";\n if (constructor === null) {\n if (fallback = internalGetConstructorName(value), fallback === tag)\n fallback = \"Object\";\n }\n return getPrefix(constructor, tag, fallback);\n}, formatProxy = function(ctx, proxy, recurseTimes) {\n if (recurseTimes > ctx.depth && ctx.depth !== null)\n return ctx.stylize(\"Proxy [Array]\", \"special\");\n recurseTimes += 1, ctx.indentationLvl += 2;\n const res = [formatValue(ctx, proxy[0], recurseTimes), formatValue(ctx, proxy[1], recurseTimes)];\n return ctx.indentationLvl -= 2, reduceToSingleString(ctx, res, \"\", [\"Proxy [\", \"]\"], kArrayExtrasType, recurseTimes);\n}, formatValue = function(ctx, value, recurseTimes, typedArray) {\n if (typeof value !== \"object\" && typeof value !== \"function\" && !isUndetectableObject(value))\n return formatPrimitive(ctx.stylize, value, ctx);\n if (value === null)\n return ctx.stylize(\"null\", \"null\");\n const context = value, proxy = getProxyDetails(value, !!ctx.showProxy);\n if (proxy !== @undefined) {\n if (proxy === null || proxy[0] === null)\n return ctx.stylize(\"<Revoked Proxy>\", \"special\");\n if (ctx.showProxy)\n return formatProxy(ctx, proxy, recurseTimes);\n value = proxy;\n }\n if (ctx.customInspect) {\n const maybeCustom = value[customInspectSymbol];\n if (typeof maybeCustom === \"function\" && maybeCustom !== inspect && !(value.constructor && value.constructor.prototype === value)) {\n const depth = ctx.depth === null \? null : ctx.depth - recurseTimes, isCrossContext = proxy !== @undefined || !(context instanceof Object), ret = maybeCustom.@call(context, depth, getUserOptions(ctx, isCrossContext), inspect);\n if (ret !== context) {\n if (typeof ret !== \"string\")\n return formatValue(ctx, ret, recurseTimes);\n return StringPrototypeReplaceAll(ret, \"\\n\", `\\n${StringPrototypeRepeat(\" \", ctx.indentationLvl)}`);\n }\n }\n }\n if (ctx.seen.includes(value)) {\n let index = 1;\n if (ctx.circular === @undefined)\n ctx.circular = new SafeMap, ctx.circular.set(value, index);\n else if (index = ctx.circular.get(value), index === @undefined)\n index = ctx.circular.size + 1, ctx.circular.set(value, index);\n return ctx.stylize(`[Circular *${index}]`, \"special\");\n }\n return formatRaw(ctx, value, recurseTimes, typedArray);\n}, formatRaw = function(ctx, value, recurseTimes, typedArray) {\n let keys, protoProps;\n if (ctx.showHidden && (recurseTimes <= ctx.depth || ctx.depth === null))\n protoProps = [];\n const constructor = getConstructorName(value, ctx, recurseTimes, protoProps);\n if (protoProps !== @undefined && protoProps.length === 0)\n protoProps = @undefined;\n let tag = value[SymbolToStringTag];\n if (typeof tag !== \"string\" || tag !== \"\" && (ctx.showHidden \? ObjectPrototypeHasOwnProperty : ObjectPrototypePropertyIsEnumerable)(value, SymbolToStringTag))\n tag = \"\";\n let base = \"\", formatter = getEmptyFormatArray, braces, noIterator = !0, i = 0;\n const filter = ctx.showHidden \? 0 : 2;\n let extrasType = kObjectType;\n if ((SymbolIterator in value) || constructor === null)\n if (noIterator = !1, ArrayIsArray(value)) {\n const prefix = constructor !== \"Array\" || tag !== \"\" \? getPrefix(constructor, tag, \"Array\", `(${value.length})`) : \"\";\n if (keys = getOwnNonIndexProperties(value, filter), braces = [`${prefix}[`, \"]\"], value.length === 0 && keys.length === 0 && protoProps === @undefined)\n return `${braces[0]}]`;\n extrasType = kArrayExtrasType, formatter = formatArray;\n } else if (isSet(value)) {\n const size = SetPrototypeGetSize(value), prefix = getPrefix(constructor, tag, \"Set\", `(${size})`);\n if (keys = getKeys(value, ctx.showHidden), formatter = constructor !== null \? FunctionPrototypeBind(formatSet, null, value) : FunctionPrototypeBind(formatSet, null, SetPrototypeValues(value)), size === 0 && keys.length === 0 && protoProps === @undefined)\n return `${prefix}{}`;\n braces = [`${prefix}{`, \"}\"];\n } else if (isMap(value)) {\n const size = MapPrototypeGetSize(value), prefix = getPrefix(constructor, tag, \"Map\", `(${size})`);\n if (keys = getKeys(value, ctx.showHidden), formatter = constructor !== null \? FunctionPrototypeBind(formatMap, null, value) : FunctionPrototypeBind(formatMap, null, MapPrototypeEntries(value)), size === 0 && keys.length === 0 && protoProps === @undefined)\n return `${prefix}{}`;\n braces = [`${prefix}{`, \"}\"];\n } else if (isTypedArray(value)) {\n keys = getOwnNonIndexProperties(value, filter);\n let bound = value, fallback = \"\";\n if (constructor === null)\n fallback = TypedArrayPrototypeGetSymbolToStringTag(value), bound = new primordials[fallback](value);\n const size = TypedArrayPrototypeGetLength(value);\n if (braces = [`${getPrefix(constructor, tag, fallback, `(${size})`)}[`, \"]\"], value.length === 0 && keys.length === 0 && !ctx.showHidden)\n return `${braces[0]}]`;\n formatter = FunctionPrototypeBind(formatTypedArray, null, bound, size), extrasType = kArrayExtrasType;\n } else if (isMapIterator(value))\n keys = getKeys(value, ctx.showHidden), braces = getIteratorBraces(\"Map\", tag), formatter = FunctionPrototypeBind(formatIterator, null, braces);\n else if (isSetIterator(value))\n keys = getKeys(value, ctx.showHidden), braces = getIteratorBraces(\"Set\", tag), formatter = FunctionPrototypeBind(formatIterator, null, braces);\n else\n noIterator = !0;\n if (noIterator)\n if (keys = getKeys(value, ctx.showHidden), braces = [\"{\", \"}\"], constructor === \"Object\") {\n if (isArgumentsObject(value))\n braces[0] = \"[Arguments] {\";\n else if (tag !== \"\")\n braces[0] = `${getPrefix(constructor, tag, \"Object\")}{`;\n if (keys.length === 0 && protoProps === @undefined)\n return `${braces[0]}}`;\n } else if (typeof value === \"function\") {\n if (base = getFunctionBase(value, constructor, tag), keys.length === 0 && protoProps === @undefined)\n return ctx.stylize(base, \"special\");\n } else if (isRegExp(value)) {\n base = RegExpPrototypeToString(constructor !== null \? value : new RegExp(value));\n const prefix = getPrefix(constructor, tag, \"RegExp\");\n if (prefix !== \"RegExp \")\n base = `${prefix}${base}`;\n if (keys.length === 0 && protoProps === @undefined || recurseTimes > ctx.depth && ctx.depth !== null)\n return ctx.stylize(base, \"regexp\");\n } else if (isDate(value)) {\n base = NumberIsNaN(DatePrototypeGetTime(value)) \? DatePrototypeToString(value) : DatePrototypeToISOString(value);\n const prefix = getPrefix(constructor, tag, \"Date\");\n if (prefix !== \"Date \")\n base = `${prefix}${base}`;\n if (keys.length === 0 && protoProps === @undefined)\n return ctx.stylize(base, \"date\");\n } else if (value instanceof Error) {\n if (base = formatError(value, constructor, tag, ctx, keys), keys.length === 0 && protoProps === @undefined)\n return base;\n } else if (isAnyArrayBuffer(value)) {\n const arrayType = isArrayBuffer(value) \? \"ArrayBuffer\" : \"SharedArrayBuffer\", prefix = getPrefix(constructor, tag, arrayType);\n if (typedArray === @undefined)\n formatter = formatArrayBuffer;\n else if (keys.length === 0 && protoProps === @undefined)\n return prefix + `{ byteLength: ${formatNumber(ctx.stylize, value.byteLength, !1)} }`;\n braces[0] = `${prefix}{`, ArrayPrototypeUnshift(keys, \"byteLength\");\n } else if (isDataView(value))\n braces[0] = `${getPrefix(constructor, tag, \"DataView\")}{`, ArrayPrototypeUnshift(keys, \"byteLength\", \"byteOffset\", \"buffer\");\n else if (isPromise(value))\n braces[0] = `${getPrefix(constructor, tag, \"Promise\")}{`, formatter = formatPromise;\n else if (isWeakSet(value))\n braces[0] = `${getPrefix(constructor, tag, \"WeakSet\")}{`, formatter = ctx.showHidden \? formatWeakSet : formatWeakCollection;\n else if (isWeakMap(value))\n braces[0] = `${getPrefix(constructor, tag, \"WeakMap\")}{`, formatter = ctx.showHidden \? formatWeakMap : formatWeakCollection;\n else if (isModuleNamespaceObject(value))\n braces[0] = `${getPrefix(constructor, tag, \"Module\")}{`, formatter = formatNamespaceObject.bind(null, keys);\n else if (isBoxedPrimitive(value)) {\n if (base = getBoxedBase(value, ctx, keys, constructor, tag), keys.length === 0 && protoProps === @undefined)\n return base;\n } else {\n if (keys.length === 0 && protoProps === @undefined) {\n if (isExternal(value))\n return ctx.stylize(\"[External: 0]\", \"special\");\n return `${getCtxStyle(value, constructor, tag)}{}`;\n }\n braces[0] = `${getCtxStyle(value, constructor, tag)}{`;\n }\n if (recurseTimes > ctx.depth && ctx.depth !== null) {\n let constructorName = StringPrototypeSlice(getCtxStyle(value, constructor, tag), 0, -1);\n if (constructor !== null)\n constructorName = `[${constructorName}]`;\n return ctx.stylize(constructorName, \"special\");\n }\n recurseTimes += 1, ctx.seen.push(value), ctx.currentDepth = recurseTimes;\n let output;\n const indentationLvl = ctx.indentationLvl;\n try {\n if (ctx.currentDepth > 1000)\n @throwRangeError(ERROR_STACK_OVERFLOW_MSG);\n output = formatter(ctx, value, recurseTimes);\n for (i = 0;i < keys.length; i++)\n ArrayPrototypePush(output, formatProperty(ctx, value, recurseTimes, keys[i], extrasType));\n if (protoProps !== @undefined)\n ArrayPrototypePushApply(output, protoProps);\n } catch (err) {\n if (err instanceof RangeError && err.message === ERROR_STACK_OVERFLOW_MSG) {\n const constructorName = StringPrototypeSlice(getCtxStyle(value, constructor, tag), 0, -1);\n return ctx.seen.pop(), ctx.indentationLvl = indentationLvl, ctx.stylize(`[${constructorName}: Inspection interrupted prematurely. Maximum call stack size exceeded.]`, \"special\");\n }\n throw new AssertionError(\"handleMaxCallStackSize assertion failed: \" + String(err), !0);\n }\n if (ctx.circular !== @undefined) {\n const index = ctx.circular.get(value);\n if (index !== @undefined)\n if (ctx.seenRefs \?\?= new Set, !ctx.seenRefs.has(index)) {\n ctx.seenRefs.add(index);\n const reference = ctx.stylize(`<ref *${index}>`, \"special\");\n if (ctx.compact !== !0)\n base = base === \"\" \? reference : `${reference} ${base}`;\n else\n braces[0] = `${reference} ${braces[0]}`;\n } else {\n //! this is a non-standard behavior compared to Node's implementation\n return ctx.stylize(`[Circular *${index}]`, \"special\");\n }\n }\n if (ctx.seen.pop(), ctx.sorted) {\n const comparator = ctx.sorted === !0 \? @undefined : ctx.sorted;\n if (extrasType === kObjectType)\n ArrayPrototypeSort(output, comparator);\n else if (keys.length > 1) {\n const sorted = ArrayPrototypeSort(ArrayPrototypeSlice(output, output.length - keys.length), comparator);\n ArrayPrototypeUnshift(sorted, output, output.length - keys.length, keys.length), ReflectApply(ArrayPrototypeSplice, null, sorted);\n }\n }\n const res = reduceToSingleString(ctx, output, base, braces, extrasType, recurseTimes, value), newLength = (ctx.budget[ctx.indentationLvl] || 0) + res.length;\n if (ctx.budget[ctx.indentationLvl] = newLength, newLength > 134217728)\n ctx.depth = -1;\n return res;\n}, getIteratorBraces = function(type, tag) {\n if (tag !== `${type} Iterator`) {\n if (tag !== \"\")\n tag += \"] [\";\n tag += `${type} Iterator`;\n }\n return [`[${tag}] {`, \"}\"];\n}, getBoxedBase = function(value, ctx, keys, constructor, tag) {\n let fn, type;\n if (isNumberObject(value))\n fn = NumberPrototypeValueOf, type = \"Number\";\n else if (isStringObject(value))\n fn = StringPrototypeValueOf, type = \"String\", keys.splice(0, value.length);\n else if (isBooleanObject(value))\n fn = BooleanPrototypeValueOf, type = \"Boolean\";\n else if (isBigIntObject(value))\n fn = BigIntPrototypeValueOf, type = \"BigInt\";\n else\n fn = SymbolPrototypeValueOf, type = \"Symbol\";\n let base = `[${type}`;\n if (type !== constructor)\n if (constructor === null)\n base += \" (null prototype)\";\n else\n base += ` (${constructor})`;\n if (base += `: ${formatPrimitive(stylizeNoColor, fn(value), ctx)}]`, tag !== \"\" && tag !== constructor)\n base += ` [${tag}]`;\n if (keys.length !== 0 || ctx.stylize === stylizeNoColor)\n return base;\n return ctx.stylize(base, StringPrototypeToLowerCase(type));\n}, getClassBase = function(value, constructor, tag) {\n let base = `class ${ObjectPrototypeHasOwnProperty(value, \"name\") && value.name || \"(anonymous)\"}`;\n if (constructor !== \"Function\" && constructor !== null)\n base += ` [${constructor}]`;\n if (tag !== \"\" && constructor !== tag)\n base += ` [${tag}]`;\n if (constructor !== null) {\n const superName = ObjectGetPrototypeOf(value).name;\n if (superName)\n base += ` extends ${superName}`;\n } else\n base += \" extends [null prototype]\";\n return `[${base}]`;\n}, getFunctionBase = function(value, constructor, tag) {\n const stringified = FunctionPrototypeToString(value);\n if (StringPrototypeStartsWith(stringified, \"class\") && StringPrototypeEndsWith(stringified, \"}\")) {\n const slice = StringPrototypeSlice(stringified, 5, -1), bracketIndex = StringPrototypeIndexOf(slice, \"{\");\n if (bracketIndex !== -1 && (!StringPrototypeIncludes(StringPrototypeSlice(slice, 0, bracketIndex), \"(\") || RegExpPrototypeExec(classRegExp, RegExpPrototypeSymbolReplace(stripCommentsRegExp, slice)) !== null))\n return getClassBase(value, constructor, tag);\n }\n let type = \"Function\";\n if (isGeneratorFunction(value))\n type = `Generator${type}`;\n if (isAsyncFunction(value))\n type = `Async${type}`;\n let base = `[${type}`;\n if (constructor === null)\n base += \" (null prototype)\";\n if (value.name === \"\")\n base += \" (anonymous)\";\n else\n base += `: ${value.name}`;\n if (base += \"]\", constructor !== type && constructor !== null)\n base += ` ${constructor}`;\n if (tag !== \"\" && constructor !== tag)\n base += ` [${tag}]`;\n return base;\n}, identicalSequenceRange = function(a, b) {\n for (let i = 0;i < a.length - 3; i++) {\n const pos = b.indexOf(a[i]);\n if (pos !== -1) {\n const rest = b.length - pos;\n if (rest > 3) {\n let len = 1;\n const maxLen = MathMin(a.length - i, rest);\n while (maxLen > len && a[i + len] === b[pos + len])\n len++;\n if (len > 3)\n return { len, offset: i };\n }\n }\n }\n return { len: 0, offset: 0 };\n}, getStackString = function(error) {\n return error.stack \? String(error.stack) : ErrorPrototypeToString(error);\n}, getStackFrames = function(ctx, err, stack) {\n const frames = StringPrototypeSplit(stack, \"\\n\");\n let cause;\n try {\n ({ cause } = err);\n } catch {\n }\n if (cause != null && cause instanceof Error) {\n const causeStack = getStackString(cause), causeStackStart = StringPrototypeIndexOf(causeStack, \"\\n at\");\n if (causeStackStart !== -1) {\n const causeFrames = StringPrototypeSplit(StringPrototypeSlice(causeStack, causeStackStart + 1), \"\\n\"), { len, offset } = identicalSequenceRange(frames, causeFrames);\n if (len > 0) {\n const skipped = len - 2, msg = ` ... ${skipped} lines matching cause stack trace ...`;\n frames.splice(offset + 1, skipped, ctx.stylize(msg, \"undefined\"));\n }\n }\n }\n return frames;\n}, improveStack = function(stack, constructor, name, tag) {\n let len = name.length;\n if (constructor === null || StringPrototypeEndsWith(name, \"Error\") && StringPrototypeStartsWith(stack, name) && (stack.length === len || stack[len] === \":\" || stack[len] === \"\\n\")) {\n let fallback = \"Error\";\n if (constructor === null) {\n const start = RegExpPrototypeExec(/^([A-Z][a-z_ A-Z0-9[\\]()-]+)(\?::|\\n {4}at)/, stack) || RegExpPrototypeExec(/^([a-z_A-Z0-9-]*Error)$/, stack);\n fallback = start && start[1] || \"\", len = fallback.length, fallback = fallback || \"Error\";\n }\n const prefix = StringPrototypeSlice(getPrefix(constructor, tag, fallback), 0, -1);\n if (name !== prefix)\n if (StringPrototypeIncludes(prefix, name))\n if (len === 0)\n stack = `${prefix}: ${stack}`;\n else\n stack = `${prefix}${StringPrototypeSlice(stack, len)}`;\n else\n stack = `${prefix} [${name}]${StringPrototypeSlice(stack, len)}`;\n }\n return stack;\n}, removeDuplicateErrorKeys = function(ctx, keys, err, stack) {\n if (!ctx.showHidden && keys.length !== 0)\n for (let name of [\"name\", \"message\", \"stack\"]) {\n const index = ArrayPrototypeIndexOf(keys, name);\n if (index !== -1 && StringPrototypeIncludes(stack, err[name]))\n ArrayPrototypeSplice(keys, index, 1);\n }\n}, markNodeModules = function(ctx, line) {\n let tempLine = \"\", nodeModule, pos = 0;\n while ((nodeModule = nodeModulesRegExp.exec(line)) !== null)\n tempLine += StringPrototypeSlice(line, pos, nodeModule.index + 14), tempLine += ctx.stylize(nodeModule[1], \"module\"), pos = nodeModule.index + nodeModule[0].length;\n if (pos !== 0)\n line = tempLine + StringPrototypeSlice(line, pos);\n return line;\n}, markCwd = function(ctx, line, workingDirectory) {\n let cwdStartPos = StringPrototypeIndexOf(line, workingDirectory), tempLine = \"\", cwdLength = workingDirectory.length;\n if (cwdStartPos !== -1) {\n if (StringPrototypeSlice(line, cwdStartPos - 7, cwdStartPos) === \"file://\")\n cwdLength += 7, cwdStartPos -= 7;\n const start = line[cwdStartPos - 1] === \"(\" \? cwdStartPos - 1 : cwdStartPos, end = start !== cwdStartPos && StringPrototypeEndsWith(line, \")\") \? -1 : line.length, workingDirectoryEndPos = cwdStartPos + cwdLength + 1, cwdSlice = StringPrototypeSlice(line, start, workingDirectoryEndPos);\n if (tempLine += StringPrototypeSlice(line, 0, start), tempLine += ctx.stylize(cwdSlice, \"undefined\"), tempLine += StringPrototypeSlice(line, workingDirectoryEndPos, end), end === -1)\n tempLine += ctx.stylize(\")\", \"undefined\");\n } else\n tempLine += line;\n return tempLine;\n}, safeGetCWD = function() {\n let workingDirectory;\n try {\n workingDirectory = process.cwd();\n } catch {\n return;\n }\n return workingDirectory;\n}, formatError = function(err, constructor, tag, ctx, keys) {\n const name = err.name != null \? String(err.name) : \"Error\";\n let stack = getStackString(err);\n //! temp fix for Bun losing the error name from inherited errors + extraneous \": \" with no message\n if (stack = stack.replace(/^Error: /, `${name}${err.message \? \": \" : \"\"}`), removeDuplicateErrorKeys(ctx, keys, err, stack), (\"cause\" in err) && (keys.length === 0 || !ArrayPrototypeIncludes(keys, \"cause\")))\n ArrayPrototypePush(keys, \"cause\");\n if (ArrayIsArray(err.errors) && (keys.length === 0 || !ArrayPrototypeIncludes(keys, \"errors\")))\n ArrayPrototypePush(keys, \"errors\");\n stack = improveStack(stack, constructor, name, tag);\n let pos = err.message && StringPrototypeIndexOf(stack, err.message) || -1;\n if (pos !== -1)\n pos += err.message.length;\n const stackStart = StringPrototypeIndexOf(stack, \"\\n at\", pos);\n if (stackStart === -1)\n stack = `[${stack}]`;\n else {\n let newStack = StringPrototypeSlice(stack, 0, stackStart);\n const stackFramePart = StringPrototypeSlice(stack, stackStart + 1), lines = getStackFrames(ctx, err, stackFramePart);\n if (ctx.colors) {\n const workingDirectory = safeGetCWD();\n let esmWorkingDirectory;\n for (let line of lines) {\n const core = RegExpPrototypeExec(coreModuleRegExp, line);\n if (core !== null && (StringPrototypeStartsWith(core[1], \"internal/\") || ArrayPrototypeIncludes(@requireNativeModule(\"module\").builtinModules, core[1])))\n newStack += `\\n${ctx.stylize(line, \"undefined\")}`;\n else {\n if (newStack += \"\\n\", line = markNodeModules(ctx, line), workingDirectory !== @undefined) {\n let newLine = markCwd(ctx, line, workingDirectory);\n if (newLine === line)\n esmWorkingDirectory \?\?= pathToFileURL(workingDirectory), newLine = markCwd(ctx, line, esmWorkingDirectory);\n line = newLine;\n }\n newStack += line;\n }\n }\n } else\n newStack += `\\n${ArrayPrototypeJoin(lines, \"\\n\")}`;\n stack = newStack;\n }\n if (ctx.indentationLvl !== 0) {\n const indentation = StringPrototypeRepeat(\" \", ctx.indentationLvl);\n stack = StringPrototypeReplaceAll(stack, \"\\n\", `\\n${indentation}`);\n }\n return stack;\n}, groupArrayElements = function(ctx, output, value) {\n let totalLength = 0, maxLength = 0, i = 0, outputLength = output.length;\n if (ctx.maxArrayLength < output.length)\n outputLength--;\n const separatorSpace = 2, dataLen = new Array(outputLength);\n for (;i < outputLength; i++) {\n const len = getStringWidth(output[i], ctx.colors);\n if (dataLen[i] = len, totalLength += len + separatorSpace, maxLength < len)\n maxLength = len;\n }\n const actualMax = maxLength + separatorSpace;\n if (actualMax * 3 + ctx.indentationLvl < ctx.breakLength && (totalLength / actualMax > 5 || maxLength <= 6)) {\n const averageBias = MathSqrt(actualMax - totalLength / output.length), biasedMax = MathMax(actualMax - 3 - averageBias, 1), columns = MathMin(MathRound(MathSqrt(2.5 * biasedMax * outputLength) / biasedMax), MathFloor((ctx.breakLength - ctx.indentationLvl) / actualMax), ctx.compact * 4, 15);\n if (columns <= 1)\n return output;\n const tmp = [], maxLineLength = [];\n for (let i2 = 0;i2 < columns; i2++) {\n let lineMaxLength = 0;\n for (let j = i2;j < output.length; j += columns)\n if (dataLen[j] > lineMaxLength)\n lineMaxLength = dataLen[j];\n lineMaxLength += separatorSpace, maxLineLength[i2] = lineMaxLength;\n }\n let order = StringPrototypePadStart;\n if (value !== @undefined) {\n for (let i2 = 0;i2 < output.length; i2++)\n if (typeof value[i2] !== \"number\" && typeof value[i2] !== \"bigint\") {\n order = StringPrototypePadEnd;\n break;\n }\n }\n for (let i2 = 0;i2 < outputLength; i2 += columns) {\n const max = MathMin(i2 + columns, outputLength);\n let str = \"\", j = i2;\n for (;j < max - 1; j++) {\n const padding = maxLineLength[j - i2] + output[j].length - dataLen[j];\n str += order(`${output[j]}, `, padding, \" \");\n }\n if (order === StringPrototypePadStart) {\n const padding = maxLineLength[j - i2] + output[j].length - dataLen[j] - separatorSpace;\n str += StringPrototypePadStart(output[j], padding, \" \");\n } else\n str += output[j];\n ArrayPrototypePush(tmp, str);\n }\n if (ctx.maxArrayLength < output.length)\n ArrayPrototypePush(tmp, output[outputLength]);\n output = tmp;\n }\n return output;\n}, addNumericSeparator = function(integerString) {\n let result = \"\", i = integerString.length;\n const start = StringPrototypeStartsWith(integerString, \"-\") \? 1 : 0;\n for (;i >= start + 4; i -= 3)\n result = `_${StringPrototypeSlice(integerString, i - 3, i)}${result}`;\n return i === integerString.length \? integerString : `${StringPrototypeSlice(integerString, 0, i)}${result}`;\n}, addNumericSeparatorEnd = function(integerString) {\n let result = \"\", i = 0;\n for (;i < integerString.length - 3; i += 3)\n result += `${StringPrototypeSlice(integerString, i, i + 3)}_`;\n return i === 0 \? integerString : `${result}${StringPrototypeSlice(integerString, i)}`;\n}, formatNumber = function(fn, number, numericSeparator) {\n if (!numericSeparator) {\n if (ObjectIs(number, -0))\n return fn(\"-0\", \"number\");\n return fn(`${number}`, \"number\");\n }\n const integer = MathTrunc(number), string = String(integer);\n if (integer === number) {\n if (!NumberIsFinite(number) || StringPrototypeIncludes(string, \"e\"))\n return fn(string, \"number\");\n return fn(`${addNumericSeparator(string)}`, \"number\");\n }\n if (NumberIsNaN(number))\n return fn(string, \"number\");\n return fn(`${addNumericSeparator(string)}.${addNumericSeparatorEnd(StringPrototypeSlice(String(number), string.length + 1))}`, \"number\");\n}, formatBigInt = function(fn, bigint, numericSeparator) {\n const string = String(bigint);\n if (!numericSeparator)\n return fn(`${string}n`, \"bigint\");\n return fn(`${addNumericSeparator(string)}n`, \"bigint\");\n}, formatPrimitive = function(fn, value, ctx) {\n if (typeof value === \"string\") {\n let trailer = \"\";\n if (value.length > ctx.maxStringLength) {\n const remaining = value.length - ctx.maxStringLength;\n value = StringPrototypeSlice(value, 0, ctx.maxStringLength), trailer = `... ${remaining} more character${remaining > 1 \? \"s\" : \"\"}`;\n }\n if (ctx.compact !== !0 && value.length > kMinLineLength && value.length > ctx.breakLength - ctx.indentationLvl - 4)\n return ArrayPrototypeJoin(ArrayPrototypeMap(extractedSplitNewLines(value), (line) => fn(strEscape(line), \"string\")), ` +\\n${StringPrototypeRepeat(\" \", ctx.indentationLvl + 2)}`) + trailer;\n return fn(strEscape(value), \"string\") + trailer;\n }\n if (typeof value === \"number\")\n return formatNumber(fn, value, ctx.numericSeparator);\n if (typeof value === \"bigint\")\n return formatBigInt(fn, value, ctx.numericSeparator);\n if (typeof value === \"boolean\")\n return fn(`${value}`, \"boolean\");\n if (typeof value === \"undefined\")\n return fn(\"undefined\", \"undefined\");\n return fn(SymbolPrototypeToString(value), \"symbol\");\n}, formatNamespaceObject = function(keys, ctx, value, recurseTimes) {\n const output = new Array(keys.length);\n for (let i = 0;i < keys.length; i++)\n try {\n output[i] = formatProperty(ctx, value, recurseTimes, keys[i], kObjectType);\n } catch (err) {\n assert(isNativeError(err) && err.name === \"ReferenceError\");\n const tmp = { [keys[i]]: \"\" };\n output[i] = formatProperty(ctx, tmp, recurseTimes, keys[i], kObjectType);\n const pos = StringPrototypeLastIndexOf(output[i], \" \");\n output[i] = StringPrototypeSlice(output[i], 0, pos + 1) + ctx.stylize(\"<uninitialized>\", \"special\");\n }\n return keys.length = 0, output;\n}, formatSpecialArray = function(ctx, value, recurseTimes, maxLength, output, i) {\n const keys = ObjectKeys(value);\n let index = i;\n for (;i < keys.length && output.length < maxLength; i++) {\n const key = keys[i], tmp = +key;\n if (tmp > 4294967294)\n break;\n if (`${index}` !== key) {\n if (RegExpPrototypeExec(numberRegExp, key) === null)\n break;\n const emptyItems = tmp - index, ending = emptyItems > 1 \? \"s\" : \"\", message = `<${emptyItems} empty item${ending}>`;\n if (ArrayPrototypePush(output, ctx.stylize(message, \"undefined\")), index = tmp, output.length === maxLength)\n break;\n }\n ArrayPrototypePush(output, formatProperty(ctx, value, recurseTimes, key, kArrayType)), index++;\n }\n const remaining = value.length - index;\n if (output.length !== maxLength) {\n if (remaining > 0) {\n const ending = remaining > 1 \? \"s\" : \"\", message = `<${remaining} empty item${ending}>`;\n ArrayPrototypePush(output, ctx.stylize(message, \"undefined\"));\n }\n } else if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return output;\n}, hexSlice = function(buf, start = 0, end) {\n return ArrayPrototypeJoin(ArrayPrototypeMap(buf.slice(start, end), (x) => (\"00\" + x.toString(16)).slice(-2)), \"\");\n}, formatArrayBuffer = function(ctx, value) {\n let buffer;\n try {\n buffer = new Uint8Array(value);\n } catch {\n return [ctx.stylize(\"(detached)\", \"special\")];\n }\n let str = StringPrototypeTrim(RegExpPrototypeSymbolReplace(/(.{2})/g, hexSlice(buffer, 0, MathMin(ctx.maxArrayLength, buffer.length)), \"$1 \"));\n const remaining = buffer.length - ctx.maxArrayLength;\n if (remaining > 0)\n str += ` ... ${remaining} more byte${remaining > 1 \? \"s\" : \"\"}`;\n return [`${ctx.stylize(\"[Uint8Contents]\", \"special\")}: <${str}>`];\n}, formatArray = function(ctx, value, recurseTimes) {\n const valLen = value.length, len = MathMin(MathMax(0, ctx.maxArrayLength), valLen), remaining = valLen - len, output = [];\n for (let i = 0;i < len; i++) {\n if (!ObjectPrototypeHasOwnProperty(value, i))\n return formatSpecialArray(ctx, value, recurseTimes, len, output, i);\n ArrayPrototypePush(output, formatProperty(ctx, value, recurseTimes, i, kArrayType));\n }\n if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return output;\n}, formatTypedArray = function(value, length, ctx, ignored, recurseTimes) {\n const maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length), remaining = value.length - maxLength, output = new Array(maxLength), elementFormatter = value.length > 0 && typeof value[0] === \"number\" \? formatNumber : formatBigInt;\n for (let i = 0;i < maxLength; ++i)\n output[i] = elementFormatter(ctx.stylize, value[i], ctx.numericSeparator);\n if (remaining > 0)\n output[maxLength] = remainingText(remaining);\n if (ctx.showHidden) {\n ctx.indentationLvl += 2;\n for (let key of [\"BYTES_PER_ELEMENT\", \"length\", \"byteLength\", \"byteOffset\", \"buffer\"]) {\n const str = formatValue(ctx, value[key], recurseTimes, !0);\n ArrayPrototypePush(output, `[${key}]: ${str}`);\n }\n ctx.indentationLvl -= 2;\n }\n return output;\n}, formatSet = function(value, ctx, ignored, recurseTimes) {\n const length = value.size, maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length), remaining = length - maxLength, output = [];\n ctx.indentationLvl += 2;\n let i = 0;\n for (let v of value) {\n if (i >= maxLength)\n break;\n ArrayPrototypePush(output, formatValue(ctx, v, recurseTimes)), i++;\n }\n if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return ctx.indentationLvl -= 2, output;\n}, formatMap = function(value, ctx, ignored, recurseTimes) {\n const length = value.size, maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length), remaining = length - maxLength, output = [];\n ctx.indentationLvl += 2;\n let i = 0;\n for (let { 0: k, 1: v } of value) {\n if (i >= maxLength)\n break;\n ArrayPrototypePush(output, `${formatValue(ctx, k, recurseTimes)} => ${formatValue(ctx, v, recurseTimes)}`), i++;\n }\n if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return ctx.indentationLvl -= 2, output;\n}, formatSetIterInner = function(ctx, recurseTimes, entries, state) {\n const maxArrayLength = MathMax(ctx.maxArrayLength, 0), maxLength = MathMin(maxArrayLength, entries.length), output = new Array(maxLength);\n ctx.indentationLvl += 2;\n for (let i = 0;i < maxLength; i++)\n output[i] = formatValue(ctx, entries[i], recurseTimes);\n if (ctx.indentationLvl -= 2, state === kWeak && !ctx.sorted)\n ArrayPrototypeSort(output);\n const remaining = entries.length - maxLength;\n if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return output;\n}, formatMapIterInner = function(ctx, recurseTimes, entries, state) {\n const maxArrayLength = MathMax(ctx.maxArrayLength, 0), len = entries.length / 2, remaining = len - maxArrayLength, maxLength = MathMin(maxArrayLength, len), output = new Array(maxLength);\n let i = 0;\n if (ctx.indentationLvl += 2, state === kWeak) {\n for (;i < maxLength; i++) {\n const pos = i * 2;\n output[i] = `${formatValue(ctx, entries[pos], recurseTimes)} => ${formatValue(ctx, entries[pos + 1], recurseTimes)}`;\n }\n if (!ctx.sorted)\n ArrayPrototypeSort(output);\n } else\n for (;i < maxLength; i++) {\n const pos = i * 2, res = [formatValue(ctx, entries[pos], recurseTimes), formatValue(ctx, entries[pos + 1], recurseTimes)];\n output[i] = reduceToSingleString(ctx, res, \"\", [\"[\", \"]\"], kArrayExtrasType, recurseTimes);\n }\n if (ctx.indentationLvl -= 2, remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return output;\n}, formatWeakCollection = function(ctx) {\n return [ctx.stylize(\"<items unknown>\", \"special\")];\n}, formatWeakSet = function(ctx, value, recurseTimes) {\n const entries = previewEntries(value);\n return formatSetIterInner(ctx, recurseTimes, entries, kWeak);\n}, formatWeakMap = function(ctx, value, recurseTimes) {\n const entries = previewEntries(value);\n return formatMapIterInner(ctx, recurseTimes, entries, kWeak);\n}, formatIterator = function(braces, ctx, value, recurseTimes) {\n const { 0: entries, 1: isKeyValue } = previewEntries(value, !0);\n if (isKeyValue)\n return braces[0] = RegExpPrototypeSymbolReplace(/ Iterator] {$/, braces[0], \" Entries] {\"), formatMapIterInner(ctx, recurseTimes, entries, kMapEntries);\n return formatSetIterInner(ctx, recurseTimes, entries, kIterator);\n}, formatPromise = function(ctx, value, recurseTimes) {\n let output;\n const { 0: state, 1: result } = getPromiseDetails(value);\n if (state === kPending)\n output = [ctx.stylize(\"<pending>\", \"special\")];\n else {\n ctx.indentationLvl += 2;\n const str = formatValue(ctx, result, recurseTimes);\n ctx.indentationLvl -= 2, output = [state === kRejected \? `${ctx.stylize(\"<rejected>\", \"special\")} ${str}` : str];\n }\n return output;\n}, formatProperty = function(ctx, value, recurseTimes, key, type, desc, original = value) {\n let name, str, extra = \" \";\n if (desc ||= ObjectGetOwnPropertyDescriptor(value, key) || { value: value[key], enumerable: !0 }, desc.value !== @undefined) {\n const diff = ctx.compact !== !0 || type !== kObjectType \? 2 : 3;\n if (ctx.indentationLvl += diff, str = formatValue(ctx, desc.value, recurseTimes), diff === 3 && ctx.breakLength < getStringWidth(str, ctx.colors))\n extra = `\\n${StringPrototypeRepeat(\" \", ctx.indentationLvl)}`;\n ctx.indentationLvl -= diff;\n } else if (desc.get !== @undefined) {\n const label = desc.set !== @undefined \? \"Getter/Setter\" : \"Getter\", s = ctx.stylize;\n if (ctx.getters && (ctx.getters === !0 || ctx.getters === \"get\" && desc.set === @undefined || ctx.getters === \"set\" && desc.set !== @undefined))\n try {\n const tmp = desc.get.@call(original);\n if (ctx.indentationLvl += 2, tmp === null)\n str = `${s(`[${label}:`, \"special\")} ${s(\"null\", \"null\")}${s(\"]\", \"special\")}`;\n else if (typeof tmp === \"object\")\n str = `${s(`[${label}]`, \"special\")} ${formatValue(ctx, tmp, recurseTimes)}`;\n else {\n const primitive = formatPrimitive(s, tmp, ctx);\n str = `${s(`[${label}:`, \"special\")} ${primitive}${s(\"]\", \"special\")}`;\n }\n ctx.indentationLvl -= 2;\n } catch (err) {\n const message = `<Inspection threw (${err.message})>`;\n str = `${s(`[${label}:`, \"special\")} ${message}${s(\"]\", \"special\")}`;\n }\n else\n str = ctx.stylize(`[${label}]`, \"special\");\n } else if (desc.set !== @undefined)\n str = ctx.stylize(\"[Setter]\", \"special\");\n else\n str = ctx.stylize(\"undefined\", \"undefined\");\n if (type === kArrayType)\n return str;\n if (typeof key === \"symbol\") {\n const tmp = RegExpPrototypeSymbolReplace(strEscapeSequencesReplacer, SymbolPrototypeToString(key), escapeFn);\n name = `[${ctx.stylize(tmp, \"symbol\")}]`;\n } else if (key === \"__proto__\")\n name = \"['__proto__']\";\n else if (desc.enumerable === !1)\n name = `[${RegExpPrototypeSymbolReplace(strEscapeSequencesReplacer, key, escapeFn)}]`;\n else if (RegExpPrototypeExec(keyStrRegExp, key) !== null)\n name = ctx.stylize(key, \"name\");\n else\n name = ctx.stylize(strEscape(key), \"string\");\n return `${name}:${extra}${str}`;\n}, isBelowBreakLength = function(ctx, output, start, base) {\n let totalLength = output.length + start;\n if (totalLength + output.length > ctx.breakLength)\n return !1;\n for (let i = 0;i < output.length; i++) {\n if (ctx.colors)\n totalLength += StringPrototypeReplaceAll(output[i], /\\u001B\\[\\d\\d\?m/g, \"\").length;\n else\n totalLength += output[i].length;\n if (totalLength > ctx.breakLength)\n return !1;\n }\n return base === \"\" || !StringPrototypeIncludes(base, \"\\n\");\n}, reduceToSingleString = function(ctx, output, base, braces, extrasType, recurseTimes, value) {\n if (ctx.compact !== !0) {\n if (typeof ctx.compact === \"number\" && ctx.compact >= 1) {\n const entries = output.length;\n if (extrasType === kArrayExtrasType && entries > 6)\n output = groupArrayElements(ctx, output, value);\n if (ctx.currentDepth - recurseTimes < ctx.compact && entries === output.length) {\n const start = output.length + ctx.indentationLvl + braces[0].length + base.length + 10;\n if (isBelowBreakLength(ctx, output, start, base)) {\n const joinedOutput = ArrayPrototypeJoin(output, \", \");\n if (!StringPrototypeIncludes(joinedOutput, \"\\n\"))\n return `${base \? `${base} ` : \"\"}${braces[0]} ${joinedOutput}` + ` ${braces[1]}`;\n }\n }\n }\n const indentation2 = `\\n${StringPrototypeRepeat(\" \", ctx.indentationLvl)}`;\n return `${base \? `${base} ` : \"\"}${braces[0]}${indentation2} ` + `${ArrayPrototypeJoin(output, `,${indentation2} `)}${indentation2}${braces[1]}`;\n }\n if (isBelowBreakLength(ctx, output, 0, base))\n return `${braces[0]}${base \? ` ${base}` : \"\"} ${ArrayPrototypeJoin(output, \", \")} ` + braces[1];\n const indentation = StringPrototypeRepeat(\" \", ctx.indentationLvl), ln = base === \"\" && braces[0].length === 1 \? \" \" : `${base \? ` ${base}` : \"\"}\\n${indentation} `;\n return `${braces[0]}${ln}${ArrayPrototypeJoin(output, `,\\n${indentation} `)} ${braces[1]}`;\n}, hasBuiltInToString = function(value) {\n const proxyTarget = getProxyDetails(value, !1);\n if (proxyTarget !== @undefined) {\n if (proxyTarget === null)\n return !0;\n value = proxyTarget;\n }\n if (typeof value.toString !== \"function\")\n return !0;\n if (ObjectPrototypeHasOwnProperty(value, \"toString\"))\n return !1;\n let pointer = value;\n do\n pointer = ObjectGetPrototypeOf(pointer);\n while (!ObjectPrototypeHasOwnProperty(pointer, \"toString\"));\n const descriptor = ObjectGetOwnPropertyDescriptor(pointer, \"constructor\");\n return descriptor !== @undefined && typeof descriptor.value === \"function\" && builtInObjects.has(descriptor.value.name);\n}, tryStringify = function(arg) {\n try {\n return JSONStringify(arg);\n } catch (err) {\n if (!CIRCULAR_ERROR_MESSAGE)\n try {\n const a = {};\n a.a = a, JSONStringify(a);\n } catch (circularError) {\n CIRCULAR_ERROR_MESSAGE = firstErrorLine(circularError);\n }\n if (err.name === \"TypeError\" && firstErrorLine(err) === CIRCULAR_ERROR_MESSAGE)\n return \"[Circular]\";\n throw err;\n }\n}, format = function(...args) {\n return formatWithOptionsInternal(@undefined, args);\n}, formatWithOptions = function(inspectOptions, ...args) {\n return validateObject(inspectOptions, \"inspectOptions\", { allowArray: !0 }), formatWithOptionsInternal(inspectOptions, args);\n}, formatNumberNoColor = function(number, options) {\n return formatNumber(stylizeNoColor, number, options\?.numericSeparator \?\? inspectDefaultOptions.numericSeparator);\n}, formatBigIntNoColor = function(bigint, options) {\n return formatBigInt(stylizeNoColor, bigint, options\?.numericSeparator \?\? inspectDefaultOptions.numericSeparator);\n}, formatWithOptionsInternal = function(inspectOptions, args) {\n const first = args[0];\n let a = 0, str = \"\", join = \"\";\n if (typeof first === \"string\") {\n if (args.length === 1)\n return first;\n let tempStr, lastPos = 0;\n for (let i = 0;i < first.length - 1; i++)\n if (StringPrototypeCharCodeAt(first, i) === 37) {\n const nextChar = StringPrototypeCharCodeAt(first, ++i);\n if (a + 1 !== args.length) {\n switch (nextChar) {\n case 115: {\n const tempArg = args[++a];\n if (typeof tempArg === \"number\")\n tempStr = formatNumberNoColor(tempArg, inspectOptions);\n else if (typeof tempArg === \"bigint\")\n tempStr = formatBigIntNoColor(tempArg, inspectOptions);\n else if (typeof tempArg !== \"object\" || tempArg === null || !hasBuiltInToString(tempArg))\n tempStr = String(tempArg);\n else\n tempStr = inspect(tempArg, {\n ...inspectOptions,\n compact: 3,\n colors: !1,\n depth: 0\n });\n break;\n }\n case 106:\n tempStr = tryStringify(args[++a]);\n break;\n case 100: {\n const tempNum = args[++a];\n if (typeof tempNum === \"bigint\")\n tempStr = formatBigIntNoColor(tempNum, inspectOptions);\n else if (typeof tempNum === \"symbol\")\n tempStr = \"NaN\";\n else\n tempStr = formatNumberNoColor(Number(tempNum), inspectOptions);\n break;\n }\n case 79:\n tempStr = inspect(args[++a], inspectOptions);\n break;\n case 111:\n tempStr = inspect(args[++a], {\n ...inspectOptions,\n showHidden: !0,\n showProxy: !0,\n depth: 4\n });\n break;\n case 105: {\n const tempInteger = args[++a];\n if (typeof tempInteger === \"bigint\")\n tempStr = formatBigIntNoColor(tempInteger, inspectOptions);\n else if (typeof tempInteger === \"symbol\")\n tempStr = \"NaN\";\n else\n tempStr = formatNumberNoColor(NumberParseInt(tempInteger), inspectOptions);\n break;\n }\n case 102: {\n const tempFloat = args[++a];\n if (typeof tempFloat === \"symbol\")\n tempStr = \"NaN\";\n else\n tempStr = formatNumberNoColor(NumberParseFloat(tempFloat), inspectOptions);\n break;\n }\n case 99:\n a += 1, tempStr = \"\";\n break;\n case 37:\n str += StringPrototypeSlice(first, lastPos, i), lastPos = i + 1;\n continue;\n default:\n continue;\n }\n if (lastPos !== i - 1)\n str += StringPrototypeSlice(first, lastPos, i - 1);\n str += tempStr, lastPos = i + 1;\n } else if (nextChar === 37)\n str += StringPrototypeSlice(first, lastPos, i), lastPos = i + 1;\n }\n if (lastPos !== 0) {\n if (a++, join = \" \", lastPos < first.length)\n str += StringPrototypeSlice(first, lastPos);\n }\n }\n while (a < args.length) {\n const value = args[a];\n str += join, str += typeof value !== \"string\" \? inspect(value, inspectOptions) : value, join = \" \", a++;\n }\n return str;\n}, isZeroWidthCodePoint = function(code) {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, stripVTControlCharacters = function(str) {\n if (typeof str !== \"string\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"str\", \"string\", str);\n return RegExpPrototypeSymbolReplace(ansi, str, \"\");\n}, getOwnNonIndexProperties = function(a, filter = 2) {\n const desc = ObjectGetOwnPropertyDescriptors(a), ret = [];\n for (let [k, v] of ObjectEntries(desc))\n if (!RegExpPrototypeTest(/^(0|[1-9][0-9]*)$/, k) || NumberParseInt(k, 10) >= 4294967295)\n if (filter === 2 && !v.enumerable)\n continue;\n else\n ArrayPrototypePush(ret, k);\n for (let s of ObjectGetOwnPropertySymbols(a)) {\n const v = ObjectGetOwnPropertyDescriptor(a, s);\n if (filter === 2 && !v.enumerable)\n continue;\n ArrayPrototypePush(ret, s);\n }\n return ret;\n}, getPromiseDetails = function(promise) {\n const state = @getPromiseInternalField(promise, @promiseFieldFlags) & @promiseStateMask;\n if (state !== @promiseStatePending)\n return [\n state === @promiseStateRejected \? kRejected : kFulfilled,\n @getPromiseInternalField(promise, @promiseFieldReactionsOrResult)\n ];\n return [kPending, @undefined];\n}, getProxyDetails = function(proxy, withHandler = !0) {\n if (!@isProxyObject(proxy))\n return @undefined;\n const handler = @getProxyInternalField(proxy, @proxyFieldHandler), target = handler === null \? null : @getProxyInternalField(proxy, @proxyFieldTarget);\n if (withHandler)\n return [target, handler];\n else\n return target;\n}, previewEntries = function(val, isIterator = !1) {\n if (isIterator) {\n const iteratedObject = @getInternalField(val, 1), kind = @getInternalField(val, 2), isEntries = kind === 2;\n if (@isMap(iteratedObject))\n if (isEntries)\n return [ArrayPrototypeFlat(ArrayFrom(iteratedObject)), !0];\n else if (kind === 1)\n return [ArrayFrom(MapPrototypeValues(iteratedObject)), !1];\n else\n return [ArrayFrom(MapPrototypeKeys(iteratedObject)), !1];\n else if (@isSet(iteratedObject))\n if (isEntries)\n return [ArrayPrototypeFlat(ArrayFrom(SetPrototypeEntries(iteratedObject))), !0];\n else\n return [ArrayFrom(iteratedObject), !1];\n else\n throw new Error(\"previewEntries(): Invalid iterator received\");\n }\n if (isWeakMap(val))\n return [];\n if (isWeakSet(val))\n return [];\n else\n throw new Error(\"previewEntries(): Invalid object received\");\n}, internalGetConstructorName = function(val) {\n if (!val || typeof val !== \"object\")\n throw new Error(\"Invalid object\");\n if (val.constructor\?.name)\n return val.constructor.name;\n const str = ObjectPrototypeToString(val), m = StringPrototypeMatch(str, /^\\[object ([^\\]]+)\\]/);\n return m \? m[1] : \"Object\";\n}, $, { pathToFileURL } = @getInternalField(@internalModuleRegistry, 47) || @createInternalModuleById(47), primordials = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), {\n Array,\n ArrayFrom,\n ArrayIsArray,\n ArrayPrototypeFilter,\n ArrayPrototypeFlat,\n ArrayPrototypeForEach,\n ArrayPrototypeIncludes,\n ArrayPrototypeIndexOf,\n ArrayPrototypeJoin,\n ArrayPrototypeMap,\n ArrayPrototypePop,\n ArrayPrototypePush,\n ArrayPrototypePushApply,\n ArrayPrototypeSlice,\n ArrayPrototypeSplice,\n ArrayPrototypeSort,\n ArrayPrototypeUnshift,\n BigIntPrototypeValueOf,\n BooleanPrototypeValueOf,\n DatePrototypeGetTime,\n DatePrototypeToISOString,\n DatePrototypeToString,\n ErrorCaptureStackTrace,\n ErrorPrototypeToString,\n FunctionPrototypeBind,\n FunctionPrototypeToString,\n JSONStringify,\n MapPrototypeGetSize,\n MapPrototypeEntries,\n MapPrototypeValues,\n MapPrototypeKeys,\n MathFloor,\n MathMax,\n MathMin,\n MathRound,\n MathSqrt,\n MathTrunc,\n Number,\n NumberIsFinite,\n NumberIsNaN,\n NumberParseFloat,\n NumberParseInt,\n NumberPrototypeToString,\n NumberPrototypeValueOf,\n Object,\n ObjectAssign,\n ObjectDefineProperty,\n ObjectEntries,\n ObjectGetOwnPropertyDescriptor,\n ObjectGetOwnPropertyDescriptors,\n ObjectGetOwnPropertyNames,\n ObjectGetOwnPropertySymbols,\n ObjectGetPrototypeOf,\n ObjectIs,\n ObjectKeys,\n ObjectPrototypeHasOwnProperty,\n ObjectPrototypePropertyIsEnumerable,\n ObjectPrototypeToString,\n ObjectSeal,\n ObjectSetPrototypeOf,\n ReflectApply,\n ReflectOwnKeys,\n RegExp,\n RegExpPrototypeExec,\n RegExpPrototypeSymbolReplace,\n RegExpPrototypeSymbolSplit,\n RegExpPrototypeTest,\n RegExpPrototypeToString,\n SafeStringIterator,\n SafeMap,\n SafeSet,\n SetPrototypeEntries,\n SetPrototypeGetSize,\n SetPrototypeValues,\n String,\n StringPrototypeCharCodeAt,\n StringPrototypeCodePointAt,\n StringPrototypeIncludes,\n StringPrototypeIndexOf,\n StringPrototypeLastIndexOf,\n StringPrototypeMatch,\n StringPrototypeNormalize,\n StringPrototypePadEnd,\n StringPrototypePadStart,\n StringPrototypeRepeat,\n StringPrototypeReplaceAll,\n StringPrototypeSlice,\n StringPrototypeSplit,\n StringPrototypeEndsWith,\n StringPrototypeStartsWith,\n StringPrototypeToLowerCase,\n StringPrototypeTrim,\n StringPrototypeValueOf,\n SymbolPrototypeToString,\n SymbolPrototypeValueOf,\n SymbolIterator,\n SymbolToStringTag,\n TypedArrayPrototypeGetLength,\n TypedArrayPrototypeGetSymbolToStringTag,\n Uint8Array\n} = primordials, customInspectSymbol = Symbol.for(\"nodejs.util.inspect.custom\"), kPending = Symbol(\"kPending\"), kFulfilled = Symbol(\"kFulfilled\"), kRejected = Symbol(\"kRejected\");\nvar isAsyncFunction = (v) => typeof v === \"function\" && StringPrototypeStartsWith(FunctionPrototypeToString(v), \"async\"), isGeneratorFunction = (v) => typeof v === \"function\" && StringPrototypeMatch(FunctionPrototypeToString(v), /^(async\\s+)\?function *\\*/), isBigIntObject = checkBox(BigInt), isSymbolObject = checkBox(Symbol), {\n isAnyArrayBuffer,\n isArrayBuffer,\n isArgumentsObject,\n isBoxedPrimitive: _native_isBoxedPrimitive,\n isDataView,\n isExternal,\n isMap,\n isMapIterator,\n isModuleNamespaceObject,\n isNativeError,\n isPromise,\n isSet,\n isSetIterator,\n isWeakMap,\n isWeakSet,\n isRegExp,\n isDate,\n isTypedArray,\n isStringObject,\n isNumberObject,\n isBooleanObject\n} = @requireNativeModule(\"util/types\");\n//! The native versions of the commented out functions are currently buggy, so we use the polyfills above for now.\n//! temp workaround to apply is{BigInt,Symbol}Object fix\nvar isBoxedPrimitive = (val) => isBigIntObject(val) || isSymbolObject(val) || _native_isBoxedPrimitive(val);\n\nclass AssertionError extends Error {\n constructor(message, isForced = !1) {\n super(message);\n this.name = \"AssertionError\", this.code = \"ERR_ASSERTION\", this.operator = \"==\", this.generatedMessage = !isForced, this.actual = isForced && @undefined, this.expected = !isForced || @undefined;\n }\n}\nvar codes = {};\n{\n const kTypes = [\n \"string\",\n \"function\",\n \"number\",\n \"object\",\n \"Function\",\n \"Object\",\n \"boolean\",\n \"bigint\",\n \"symbol\"\n ], classRegExp = /^([A-Z][a-z0-9]*)+$/, messages = new SafeMap;\n messages.set(\"ERR_INVALID_ARG_TYPE\", (name, expected, actual) => {\n if (assert(typeof name === \"string\", \"'name' must be a string\"), !ArrayIsArray(expected))\n expected = [expected];\n let msg = \"The \";\n if (StringPrototypeEndsWith(name, \" argument\"))\n msg += `${name} `;\n else\n msg += `\"${name}\" ${StringPrototypeIncludes(name, \".\") \? \"property\" : \"argument\"} `;\n msg += \"must be \";\n const types = [], instances = [], other = [];\n for (let value of expected)\n if (assert(typeof value === \"string\", \"All expected entries have to be of type string\"), ArrayPrototypeIncludes(kTypes, value))\n ArrayPrototypePush(types, StringPrototypeToLowerCase(value));\n else if (RegExpPrototypeTest(classRegExp, value))\n ArrayPrototypePush(instances, value);\n else\n assert(value !== \"object\", 'The value \"object\" should be written as \"Object\"'), ArrayPrototypePush(other, value);\n if (instances.length > 0) {\n const pos = ArrayPrototypeIndexOf(types, \"object\");\n if (pos !== -1)\n ArrayPrototypeSplice(types, pos, 1), ArrayPrototypePush(instances, \"Object\");\n }\n if (types.length > 0) {\n if (types.length > 2)\n msg += `one of type ${ArrayPrototypeJoin(types, \", \")}, or ${ArrayPrototypePop(types)}`;\n else if (types.length === 2)\n msg += `one of type ${types[0]} or ${types[1]}`;\n else\n msg += `of type ${types[0]}`;\n if (instances.length > 0 || other.length > 0)\n msg += \" or \";\n }\n if (instances.length > 0) {\n if (instances.length > 2)\n msg += `an instance of ${ArrayPrototypeJoin(instances, \", \")}, or ${ArrayPrototypePop(instances)}`;\n else\n msg += `an instance of ${instances[0]}` + (instances.length === 2 \? ` or ${instances[1]}` : \"\");\n if (other.length > 0)\n msg += \" or \";\n }\n if (other.length > 0)\n if (other.length > 2) {\n const last = ArrayPrototypePop(other);\n msg += `one of ${ArrayPrototypeJoin(other, \", \")}, or ${last}`;\n } else if (other.length === 2)\n msg += `one of ${other[0]} or ${other[1]}`;\n else {\n if (StringPrototypeToLowerCase(other[0]) !== other[0])\n msg += \"an \";\n msg += `${other[0]}`;\n }\n if (actual == null)\n msg += `. Received ${actual}`;\n else if (typeof actual === \"function\" && actual.name)\n msg += `. Received function ${actual.name}`;\n else if (typeof actual === \"object\")\n if (actual.constructor && actual.constructor.name)\n msg += `. Received an instance of ${actual.constructor.name}`;\n else\n msg += `. Received ${inspect(actual, { depth: -1 })}`;\n else {\n let inspected = inspect(actual, { colors: !1 });\n if (inspected.length > 25)\n inspected = `${StringPrototypeSlice(inspected, 0, 25)}...`;\n msg += `. Received type ${typeof actual} (${inspected})`;\n }\n return msg;\n }), codes[\"ERR_INVALID_ARG_TYPE\"] = function NodeError(...args) {\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n const error = @makeTypeError();\n Error.stackTraceLimit = limit;\n const msg = messages.get(\"ERR_INVALID_ARG_TYPE\");\n assert(typeof msg === \"function\"), assert(msg.length <= args.length, `Code: ERR_INVALID_ARG_TYPE; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`);\n const message = ReflectApply(msg, error, args);\n ObjectDefineProperty(error, \"message\", { value: message, enumerable: !1, writable: !0, configurable: !0 }), ObjectDefineProperty(error, \"toString\", {\n value() {\n return `${this.name} [ERR_INVALID_ARG_TYPE]: ${this.message}`;\n },\n enumerable: !1,\n writable: !0,\n configurable: !0\n });\n let err = error;\n const userStackTraceLimit = Error.stackTraceLimit;\n return Error.stackTraceLimit = @Infinity, ErrorCaptureStackTrace(err), Error.stackTraceLimit = userStackTraceLimit, err.name = `${TypeError.name} [ERR_INVALID_ARG_TYPE]`, err.stack, delete err.name, error.code = \"ERR_INVALID_ARG_TYPE\", error;\n };\n}\nvar validateObject = (value, name, allowArray = !1) => {\n if (value === null || !allowArray && ArrayIsArray(value) || typeof value !== \"object\" && typeof value !== \"function\")\n throw new codes.ERR_INVALID_ARG_TYPE(name, \"Object\", value);\n}, builtInObjects = new SafeSet(ArrayPrototypeFilter(ObjectGetOwnPropertyNames(globalThis), (e) => RegExpPrototypeExec(/^[A-Z][a-zA-Z0-9]+$/, e) !== null)), isUndetectableObject = (v) => typeof v === \"undefined\" && v !== @undefined, ERROR_STACK_OVERFLOW_MSG = \"Maximum call stack size exceeded.\", inspectDefaultOptions = ObjectSeal({\n showHidden: !1,\n depth: 2,\n colors: !1,\n customInspect: !0,\n showProxy: !1,\n maxArrayLength: 100,\n maxStringLength: 1e4,\n breakLength: 80,\n compact: 3,\n sorted: !1,\n getters: !1,\n numericSeparator: !1\n}), inspectReplDefaults = ObjectSeal({\n ...inspectDefaultOptions,\n colors: Bun.enableANSIColors,\n showProxy: !0\n}), kObjectType = 0, kArrayType = 1, kArrayExtrasType = 2, strEscapeSequencesRegExp, strEscapeSequencesReplacer, strEscapeSequencesRegExpSingle, strEscapeSequencesReplacerSingle, extractedSplitNewLines;\ntry {\n strEscapeSequencesRegExp = new RegExp(\"[\\\\x00-\\\\x1f\\\\x27\\\\x5c\\\\x7f-\\\\x9f]|[\\\\ud800-\\\\udbff](\?![\\\\udc00-\\\\udfff])|(\?<![\\\\ud800-\\\\udbff])[\\\\udc00-\\\\udfff]\"), strEscapeSequencesReplacer = new RegExp(\"[\\0-\\\\x1f\\\\x27\\\\x5c\\\\x7f-\\\\x9f]|[\\\\ud800-\\\\udbff](\?![\\\\udc00-\\\\udfff])|(\?<![\\\\ud800-\\\\udbff])[\\\\udc00-\\\\udfff]\", \"g\"), strEscapeSequencesRegExpSingle = new RegExp(\"[\\\\x00-\\\\x1f\\\\x5c\\\\x7f-\\\\x9f]|[\\\\ud800-\\\\udbff](\?![\\\\udc00-\\\\udfff])|(\?<![\\\\ud800-\\\\udbff])[\\\\udc00-\\\\udfff]\"), strEscapeSequencesReplacerSingle = new RegExp(\"[\\\\x00-\\\\x1f\\\\x5c\\\\x7f-\\\\x9f]|[\\\\ud800-\\\\udbff](\?![\\\\udc00-\\\\udfff])|(\?<![\\\\ud800-\\\\udbff])[\\\\udc00-\\\\udfff]\", \"g\");\n const extractedNewLineRe = new RegExp(\"(\?<=\\\\n)\");\n extractedSplitNewLines = (value) => RegExpPrototypeSymbolSplit(extractedNewLineRe, value);\n} catch {\n strEscapeSequencesRegExp = /[\\x00-\\x1f\\x27\\x5c\\x7f-\\x9f]/, strEscapeSequencesReplacer = /[\\x00-\\x1f\\x27\\x5c\\x7f-\\x9f]/g, strEscapeSequencesRegExpSingle = /[\\x00-\\x1f\\x5c\\x7f-\\x9f]/, strEscapeSequencesReplacerSingle = /[\\x00-\\x1f\\x5c\\x7f-\\x9f]/g, extractedSplitNewLines = (value) => {\n const lines = RegExpPrototypeSymbolSplit(/\\n/, value), last = ArrayPrototypePop(lines), nlLines = ArrayPrototypeMap(lines, (line) => line + \"\\n\");\n if (last !== \"\")\n nlLines.push(last);\n return nlLines;\n };\n}\nvar keyStrRegExp = /^[a-zA-Z_][a-zA-Z_0-9]*$/, numberRegExp = /^(0|[1-9][0-9]*)$/, coreModuleRegExp = /^ {4}at (\?:[^/\\\\(]+ \\(|)node:(.+):\\d+:\\d+\\)\?$/, nodeModulesRegExp = /[/\\\\]node_modules[/\\\\](.+\?)(\?=[/\\\\])/g, classRegExp = /^(\\s+[^(]*\?)\\s*{/, stripCommentsRegExp = /(\\/\\/.*\?\\n)|(\\/\\*(.|\\n)*\?\\*\\/)/g, kMinLineLength = 16, kWeak = 0, kIterator = 1, kMapEntries = 2, meta = [\n \"\\\\x00\",\n \"\\\\x01\",\n \"\\\\x02\",\n \"\\\\x03\",\n \"\\\\x04\",\n \"\\\\x05\",\n \"\\\\x06\",\n \"\\\\x07\",\n \"\\\\b\",\n \"\\\\t\",\n \"\\\\n\",\n \"\\\\x0B\",\n \"\\\\f\",\n \"\\\\r\",\n \"\\\\x0E\",\n \"\\\\x0F\",\n \"\\\\x10\",\n \"\\\\x11\",\n \"\\\\x12\",\n \"\\\\x13\",\n \"\\\\x14\",\n \"\\\\x15\",\n \"\\\\x16\",\n \"\\\\x17\",\n \"\\\\x18\",\n \"\\\\x19\",\n \"\\\\x1A\",\n \"\\\\x1B\",\n \"\\\\x1C\",\n \"\\\\x1D\",\n \"\\\\x1E\",\n \"\\\\x1F\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\\\\'\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\\\\\\\\\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\\\\x7F\",\n \"\\\\x80\",\n \"\\\\x81\",\n \"\\\\x82\",\n \"\\\\x83\",\n \"\\\\x84\",\n \"\\\\x85\",\n \"\\\\x86\",\n \"\\\\x87\",\n \"\\\\x88\",\n \"\\\\x89\",\n \"\\\\x8A\",\n \"\\\\x8B\",\n \"\\\\x8C\",\n \"\\\\x8D\",\n \"\\\\x8E\",\n \"\\\\x8F\",\n \"\\\\x90\",\n \"\\\\x91\",\n \"\\\\x92\",\n \"\\\\x93\",\n \"\\\\x94\",\n \"\\\\x95\",\n \"\\\\x96\",\n \"\\\\x97\",\n \"\\\\x98\",\n \"\\\\x99\",\n \"\\\\x9A\",\n \"\\\\x9B\",\n \"\\\\x9C\",\n \"\\\\x9D\",\n \"\\\\x9E\",\n \"\\\\x9F\"\n], getStringWidth;\ninspect.custom = customInspectSymbol;\nObjectDefineProperty(inspect, \"defaultOptions\", {\n __proto__: null,\n get() {\n return inspectDefaultOptions;\n },\n set(options) {\n return validateObject(options, \"options\"), ObjectAssign(inspectDefaultOptions, options);\n }\n});\nObjectDefineProperty(inspect, \"replDefaults\", {\n __proto__: null,\n get() {\n return inspectReplDefaults;\n },\n set(options) {\n return validateObject(options, \"options\"), ObjectAssign(inspectReplDefaults, options);\n }\n});\nvar defaultFG = 39, defaultBG = 49;\ninspect.colors = {\n __proto__: null,\n reset: [0, 0],\n bold: [1, 22],\n dim: [2, 22],\n italic: [3, 23],\n underline: [4, 24],\n blink: [5, 25],\n inverse: [7, 27],\n hidden: [8, 28],\n strikethrough: [9, 29],\n doubleunderline: [21, 24],\n black: [30, defaultFG],\n red: [31, defaultFG],\n green: [32, defaultFG],\n yellow: [33, defaultFG],\n blue: [34, defaultFG],\n magenta: [35, defaultFG],\n cyan: [36, defaultFG],\n white: [37, defaultFG],\n bgBlack: [40, defaultBG],\n bgRed: [41, defaultBG],\n bgGreen: [42, defaultBG],\n bgYellow: [43, defaultBG],\n bgBlue: [44, defaultBG],\n bgMagenta: [45, defaultBG],\n bgCyan: [46, defaultBG],\n bgWhite: [47, defaultBG],\n framed: [51, 54],\n overlined: [53, 55],\n gray: [90, defaultFG],\n redBright: [91, defaultFG],\n greenBright: [92, defaultFG],\n yellowBright: [93, defaultFG],\n blueBright: [94, defaultFG],\n magentaBright: [95, defaultFG],\n cyanBright: [96, defaultFG],\n whiteBright: [97, defaultFG],\n bgGray: [100, defaultBG],\n bgRedBright: [101, defaultBG],\n bgGreenBright: [102, defaultBG],\n bgYellowBright: [103, defaultBG],\n bgBlueBright: [104, defaultBG],\n bgMagentaBright: [105, defaultBG],\n bgCyanBright: [106, defaultBG],\n bgWhiteBright: [107, defaultBG]\n};\ndefineColorAlias(\"gray\", \"grey\");\ndefineColorAlias(\"gray\", \"blackBright\");\ndefineColorAlias(\"bgGray\", \"bgGrey\");\ndefineColorAlias(\"bgGray\", \"bgBlackBright\");\ndefineColorAlias(\"dim\", \"faint\");\ndefineColorAlias(\"strikethrough\", \"crossedout\");\ndefineColorAlias(\"strikethrough\", \"strikeThrough\");\ndefineColorAlias(\"strikethrough\", \"crossedOut\");\ndefineColorAlias(\"hidden\", \"conceal\");\ndefineColorAlias(\"inverse\", \"swapColors\");\ndefineColorAlias(\"inverse\", \"swapcolors\");\ndefineColorAlias(\"doubleunderline\", \"doubleUnderline\");\ninspect.styles = {\n __proto__: null,\n special: \"cyan\",\n number: \"yellow\",\n bigint: \"yellow\",\n boolean: \"yellow\",\n undefined: \"grey\",\n null: \"bold\",\n string: \"green\",\n symbol: \"green\",\n date: \"magenta\",\n regexp: \"red\",\n module: \"underline\"\n};\nvar remainingText = (remaining) => `... ${remaining} more item${remaining > 1 \? \"s\" : \"\"}`, firstErrorLine = (error) => StringPrototypeSplit(error.message, \"\\n\", 1)[0], CIRCULAR_ERROR_MESSAGE;\n{\n getStringWidth = function getStringWidth(str, removeControlChars = !0) {\n let width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize(str, \"NFC\");\n for (let char of new SafeStringIterator(str)) {\n const code = StringPrototypeCodePointAt(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n };\n const isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n };\n}\nvar ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new RegExp(ansiPattern, \"g\");\n$ = {\n inspect,\n format,\n formatWithOptions,\n stripVTControlCharacters\n};\n//! non-standard properties, should these be kept\? (not currently exposed)\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeAsyncHooksCode = "(function (){\"use strict\";// src/js/out/tmp/node/async_hooks.ts\nvar get = function() {\n return @getInternalField(@asyncContext, 0);\n}, set = function(contextValue) {\n return @putInternalField(@asyncContext, 0, contextValue);\n}, createWarning = function(message) {\n let warned = !1;\n var wrapped = function() {\n if (warned)\n return;\n if (new Error().stack.includes(\"zx/build/core.js\"))\n return;\n warned = !0, console.warn(\"[bun] Warning:\", message);\n };\n return wrapped;\n}, createHook = function(callbacks) {\n return {\n enable: createHookNotImpl,\n disable: createHookNotImpl\n };\n}, executionAsyncId = function() {\n return executionAsyncIdNotImpl(), 0;\n}, triggerAsyncId = function() {\n return 0;\n}, executionAsyncResource = function() {\n return executionAsyncResourceWarning(), process.stdin;\n}, $, { cleanupLater, setAsyncHooksEnabled } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"async_hooks\");\n\nclass AsyncLocalStorage {\n #disableCalled = !1;\n constructor() {\n setAsyncHooksEnabled(!0);\n }\n static bind(fn, ...args) {\n return this.snapshot().bind(null, fn, ...args);\n }\n static snapshot() {\n var context = get();\n return (fn, ...args) => {\n var prev = get();\n set(context);\n try {\n return fn(...args);\n } catch (error) {\n throw error;\n } finally {\n set(prev);\n }\n };\n }\n enterWith(store) {\n cleanupLater();\n var context = get();\n if (!context) {\n set([this, store]);\n return;\n }\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this) {\n const clone = context.slice();\n clone[i + 1] = store, set(clone);\n return;\n }\n set(context.concat(this, store));\n }\n exit(cb, ...args) {\n return this.run(void 0, cb, ...args);\n }\n run(store, callback, ...args) {\n var context = get(), hasPrevious = !1, previous, i = 0, contextWasInit = !context;\n if (contextWasInit)\n set(context = [this, store]);\n else {\n if (context = context.slice(), i = context.indexOf(this), i > -1)\n hasPrevious = !0, previous = context[i + 1], context[i + 1] = store;\n else\n context.push(this, store);\n set(context);\n }\n try {\n return callback(...args);\n } catch (e) {\n throw e;\n } finally {\n if (!this.#disableCalled) {\n var context2 = get();\n if (context2 === context && contextWasInit)\n set(void 0);\n else if (context2 = context2.slice(), hasPrevious)\n context2[i + 1] = previous, set(context2);\n else\n context2.splice(i, 2), set(context2.length \? context2 : void 0);\n }\n }\n }\n disable() {\n if (!this.#disableCalled) {\n var context = get();\n if (context) {\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this) {\n context.splice(i, 2), set(context.length \? context : void 0);\n break;\n }\n }\n this.#disableCalled = !0;\n }\n }\n getStore() {\n var context = get();\n if (!context)\n return;\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this)\n return context[i + 1];\n }\n}\n\nclass AsyncResource {\n type;\n #snapshot;\n constructor(type, options) {\n if (typeof type !== \"string\")\n @throwTypeError('The \"type\" argument must be of type string. Received type ' + typeof type);\n setAsyncHooksEnabled(!0), this.type = type, this.#snapshot = get();\n }\n emitBefore() {\n return !0;\n }\n emitAfter() {\n return !0;\n }\n asyncId() {\n return 0;\n }\n triggerAsyncId() {\n return 0;\n }\n emitDestroy() {\n }\n runInAsyncScope(fn, thisArg, ...args) {\n var prev = get();\n set(this.#snapshot);\n try {\n return fn.apply(thisArg, args);\n } catch (error) {\n throw error;\n } finally {\n set(prev);\n }\n }\n}\nvar createHookNotImpl = createWarning(\"async_hooks.createHook is not implemented in Bun. Hooks can still be created but will never be called.\"), executionAsyncIdNotImpl = createWarning(\"async_hooks.executionAsyncId/triggerAsyncId are not implemented in Bun. It will return 0 every time.\"), executionAsyncResourceWarning = createWarning(\"async_hooks.executionAsyncResource is not implemented in Bun. It returns a reference to process.stdin every time.\"), asyncWrapProviders = {\n NONE: 0,\n DIRHANDLE: 1,\n DNSCHANNEL: 2,\n ELDHISTOGRAM: 3,\n FILEHANDLE: 4,\n FILEHANDLECLOSEREQ: 5,\n FIXEDSIZEBLOBCOPY: 6,\n FSEVENTWRAP: 7,\n FSREQCALLBACK: 8,\n FSREQPROMISE: 9,\n GETADDRINFOREQWRAP: 10,\n GETNAMEINFOREQWRAP: 11,\n HEAPSNAPSHOT: 12,\n HTTP2SESSION: 13,\n HTTP2STREAM: 14,\n HTTP2PING: 15,\n HTTP2SETTINGS: 16,\n HTTPINCOMINGMESSAGE: 17,\n HTTPCLIENTREQUEST: 18,\n JSSTREAM: 19,\n JSUDPWRAP: 20,\n MESSAGEPORT: 21,\n PIPECONNECTWRAP: 22,\n PIPESERVERWRAP: 23,\n PIPEWRAP: 24,\n PROCESSWRAP: 25,\n PROMISE: 26,\n QUERYWRAP: 27,\n SHUTDOWNWRAP: 28,\n SIGNALWRAP: 29,\n STATWATCHER: 30,\n STREAMPIPE: 31,\n TCPCONNECTWRAP: 32,\n TCPSERVERWRAP: 33,\n TCPWRAP: 34,\n TTYWRAP: 35,\n UDPSENDWRAP: 36,\n UDPWRAP: 37,\n SIGINTWATCHDOG: 38,\n WORKER: 39,\n WORKERHEAPSNAPSHOT: 40,\n WRITEWRAP: 41,\n ZLIB: 42,\n CHECKPRIMEREQUEST: 43,\n PBKDF2REQUEST: 44,\n KEYPAIRGENREQUEST: 45,\n KEYGENREQUEST: 46,\n KEYEXPORTREQUEST: 47,\n CIPHERREQUEST: 48,\n DERIVEBITSREQUEST: 49,\n HASHREQUEST: 50,\n RANDOMBYTESREQUEST: 51,\n RANDOMPRIMEREQUEST: 52,\n SCRYPTREQUEST: 53,\n SIGNREQUEST: 54,\n TLSWRAP: 55,\n VERIFYREQUEST: 56,\n INSPECTORJSBINDING: 57\n};\n$ = {\n AsyncLocalStorage,\n createHook,\n executionAsyncId,\n triggerAsyncId,\n executionAsyncResource,\n asyncWrapProviders,\n AsyncResource\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeAssertCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/assert.ts\nvar CallTracker = function() {\n throw new Error(\"CallTracker is not supported yet\");\n}, util = @getInternalField(@internalModuleRegistry, 48) || @createInternalModuleById(48), isDeepEqual = Bun.deepEquals, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_errors = __commonJS({\n \"assert/build/internal/errors.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n var codes = {}, assert, util2;\n function createErrorType(code, message, Base) {\n Base || (Base = Error);\n function getMessage(arg1, arg2, arg3) {\n return typeof message == \"string\" \? message : message(arg1, arg2, arg3);\n }\n var NodeError = function(_Base) {\n _inherits(NodeError2, _Base);\n function NodeError2(arg1, arg2, arg3) {\n var _this;\n return _classCallCheck(this, NodeError2), _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError2).@call(this, getMessage(arg1, arg2, arg3))), _this.code = code, _this;\n }\n return NodeError2;\n }(Base);\n codes[code] = NodeError;\n }\n function oneOf(expected, thing) {\n if (@Array.isArray(expected)) {\n var len = expected.length;\n return expected = expected.map(function(i) {\n return @String(i);\n }), len > 2 \? \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1] : len === 2 \? \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]) : \"of \".concat(thing, \" \").concat(expected[0]);\n } else\n return \"of \".concat(thing, \" \").concat(@String(expected));\n }\n function startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 \? 0 : +pos, search.length) === search;\n }\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function includes(str, search, start) {\n return typeof start != \"number\" && (start = 0), start + search.length > str.length \? !1 : str.indexOf(search, start) !== -1;\n }\n createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError), createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n assert === void 0 && (assert = require_assert()), assert(typeof name == \"string\", \"'name' must be a string\");\n var determiner;\n typeof expected == \"string\" && startsWith(expected, \"not \") \? (determiner = \"must not be\", expected = expected.replace(/^not /, \"\")) : determiner = \"must be\";\n var msg;\n if (endsWith(name, \" argument\"))\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n else {\n var type = includes(name, \".\") \? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n }\n return msg += \". Received type \".concat(_typeof(actual)), msg;\n }, TypeError), createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== void 0 \? arguments[2] : \"is invalid\", inspected = util2.inspect(value);\n return inspected.length > 128 && (inspected = \"\".concat(inspected.slice(0, 128), \"...\")), \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n }, TypeError, RangeError), createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n return value && value.constructor && value.constructor.name \? type = \"instance of \".concat(value.constructor.name) : type = \"type \".concat(_typeof(value)), \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n }, TypeError), createErrorType(\"ERR_MISSING_ARGS\", function() {\n for (var _len = arguments.length, args = new @Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n assert === void 0 && (assert = require_assert()), assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \", len = args.length;\n switch (args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n }), len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \"), msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n }, TypeError), module2.exports.codes = codes;\n }\n}), require_assertion_error = __commonJS({\n \"assert/build/internal/assert/assertion_error.js\"(exports, module2) {\n function _objectSpread(target) {\n for (var i = 1;i < arguments.length; i++) {\n var source = arguments[i] != null \? arguments[i] : {}, ownKeys = Object.keys(source);\n typeof Object.getOwnPropertySymbols == \"function\" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }))), ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n }\n function _defineProperty(obj, key, value) {\n return (key in obj) \? Object.defineProperty(obj, key, {\n value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : obj[key] = value, obj;\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _defineProperties(target, props) {\n for (var i = 0;i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, (\"value\" in descriptor) && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map == \"function\" \? new Map : void 0;\n return _wrapNativeSuper = function(Class2) {\n if (Class2 === null || !_isNativeFunction(Class2))\n return Class2;\n if (typeof Class2 != \"function\")\n @throwTypeError(\"Super expression must either be null or a function\");\n if (typeof _cache != \"undefined\") {\n if (_cache.has(Class2))\n return _cache.get(Class2);\n _cache.set(Class2, Wrapper);\n }\n function Wrapper() {\n return _construct(Class2, arguments, _getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(Class2.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), _setPrototypeOf(Wrapper, Class2);\n }, _wrapNativeSuper(Class);\n }\n function isNativeReflectConstruct() {\n if (typeof Reflect == \"undefined\" || !Reflect.construct || Reflect.construct.sham)\n return !1;\n if (typeof Proxy == \"function\")\n return !0;\n try {\n return Date.prototype.toString.@call(Reflect.construct(Date, [], function() {\n })), !0;\n } catch {\n return !1;\n }\n }\n function _construct(Parent, args, Class) {\n return isNativeReflectConstruct() \? _construct = Reflect.construct : _construct = function(Parent2, args2, Class2) {\n var a = [null];\n a.push.@apply(a, args2);\n var Constructor = Function.bind.@apply(Parent2, a), instance = new Constructor;\n return Class2 && _setPrototypeOf(instance, Class2.prototype), instance;\n }, _construct.@apply(null, arguments);\n }\n function _isNativeFunction(fn) {\n return Function.toString.@call(fn).indexOf(\"[native code]\") !== -1;\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n var inspect = util.inspect, _require2 = require_errors(), ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function repeat(str, count) {\n if (count = Math.floor(count), str.length == 0 || count == 0)\n return \"\";\n var maxCount = str.length * count;\n for (count = Math.floor(Math.log(count) / Math.log(2));count; )\n str += str, count--;\n return str += str.substring(0, maxCount - str.length), str;\n }\n var blue = \"\", green = \"\", red = \"\", white = \"\", kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n }, kMaxShortLength = 10;\n function copyError(source) {\n var keys = Object.keys(source), target = Object.create(Object.getPrototypeOf(source));\n return keys.forEach(function(key) {\n target[key] = source[key];\n }), Object.defineProperty(target, \"message\", {\n value: source.message\n }), target;\n }\n function inspectValue(val) {\n return inspect(val, {\n compact: !1,\n customInspect: !1,\n depth: 1000,\n maxArrayLength: Infinity,\n showHidden: !1,\n breakLength: Infinity,\n showProxy: !1,\n sorted: !0,\n getters: !0\n });\n }\n function createErrDiff(actual, expected, operator) {\n var other = \"\", res = \"\", lastPos = 0, end = \"\", skipped = !1, actualInspected = inspectValue(actual), actualLines = actualInspected.split(`\n`), expectedLines = inspectValue(expected).split(`\n`), i = 0, indicator = \"\";\n if (operator === \"strictEqual\" && _typeof(actual) === \"object\" && _typeof(expected) === \"object\" && actual !== null && expected !== null && (operator = \"strictEqualObject\"), actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== \"object\" || actual === null) && (_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0))\n return \"\".concat(kReadableOperator[operator], `\n\n`) + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], `\n`);\n } else if (operator !== \"strictEqualObject\") {\n var maxLength = process.stderr && process.stderr.isTTY \? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n for (;actualLines[0][i] === expectedLines[0][i]; )\n i++;\n i > 2 && (indicator = `\n `.concat(repeat(\" \", i), \"^\"), i = 0);\n }\n }\n }\n for (var a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];a === b && (i++ < 2 \? end = `\n `.concat(a).concat(end) : other = a, actualLines.pop(), expectedLines.pop(), !(actualLines.length === 0 || expectedLines.length === 0)); )\n a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n if (maxLines === 0) {\n var _actualLines = actualInspected.split(`\n`);\n if (_actualLines.length > 30)\n for (_actualLines[26] = \"\".concat(blue, \"...\").concat(white);_actualLines.length > 27; )\n _actualLines.pop();\n return \"\".concat(kReadableOperator.notIdentical, `\n\n`).concat(_actualLines.join(`\n`), `\n`);\n }\n i > 3 && (end = `\n`.concat(blue, \"...\").concat(white).concat(end), skipped = !0), other !== \"\" && (end = `\n `.concat(other).concat(end), other = \"\");\n var printedLines = 0, msg = kReadableOperator[operator] + `\n`.concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white), skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0;i < maxLines; i++) {\n var cur = i - lastPos;\n if (actualLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(expectedLines[i - 2]), printedLines++), res += `\n `.concat(expectedLines[i - 1]), printedLines++), lastPos = i, other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]), printedLines++;\n else if (expectedLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLines[i]), printedLines++;\n else {\n var expectedLine = expectedLines[i], actualLine = actualLines[i], divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n divergingLines && endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine && (divergingLines = !1, actualLine += \",\"), divergingLines \? (cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLine), other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLine), printedLines += 2) : (res += other, other = \"\", (cur === 1 || i === 0) && (res += `\n `.concat(actualLine), printedLines++));\n }\n if (printedLines > 20 && i < maxLines - 2)\n return \"\".concat(msg).concat(skippedMsg, `\n`).concat(res, `\n`).concat(blue, \"...\").concat(white).concat(other, `\n`) + \"\".concat(blue, \"...\").concat(white);\n }\n return \"\".concat(msg).concat(skipped \? skippedMsg : \"\", `\n`).concat(res).concat(other).concat(end).concat(indicator);\n }\n var AssertionError = function(_Error) {\n function AssertionError2(options) {\n var _this;\n if (_classCallCheck(this, AssertionError2), _typeof(options) !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var { message, operator, stackStartFn, actual, expected } = options, limit = Error.stackTraceLimit;\n if (Error.stackTraceLimit = 0, message != null)\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, @String(message)));\n else if (process.stderr && process.stderr.isTTY && (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1 \? (blue = \"\", green = \"\", white = \"\", red = \"\") : (blue = \"\", green = \"\", white = \"\", red = \"\")), _typeof(actual) === \"object\" && actual !== null && _typeof(expected) === \"object\" && expected !== null && (\"stack\" in actual) && actual instanceof Error && (\"stack\" in expected) && expected instanceof Error && (actual = copyError(actual), expected = copyError(expected)), operator === \"deepStrictEqual\" || operator === \"strictEqual\")\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, createErrDiff(actual, expected, operator)));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n var base = kReadableOperator[operator], res = inspectValue(actual).split(`\n`);\n if (operator === \"notStrictEqual\" && _typeof(actual) === \"object\" && actual !== null && (base = kReadableOperator.notStrictEqualObject), res.length > 30)\n for (res[26] = \"\".concat(blue, \"...\").concat(white);res.length > 27; )\n res.pop();\n res.length === 1 \? _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, \"\".concat(base, \" \").concat(res[0]))) : _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, \"\".concat(base, `\n\n`).concat(res.join(`\n`), `\n`)));\n } else {\n var _res = inspectValue(actual), other = \"\", knownOperators = kReadableOperator[operator];\n operator === \"notDeepEqual\" || operator === \"notEqual\" \? (_res = \"\".concat(kReadableOperator[operator], `\n\n`).concat(_res), _res.length > 1024 && (_res = \"\".concat(_res.slice(0, 1021), \"...\"))) : (other = \"\".concat(inspectValue(expected)), _res.length > 512 && (_res = \"\".concat(_res.slice(0, 509), \"...\")), other.length > 512 && (other = \"\".concat(other.slice(0, 509), \"...\")), operator === \"deepEqual\" || operator === \"equal\" \? _res = \"\".concat(knownOperators, `\n\n`).concat(_res, `\n\nshould equal\n\n`) : other = \" \".concat(operator, \" \").concat(other)), _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, \"\".concat(_res).concat(other)));\n }\n return Error.stackTraceLimit = limit, _this.generatedMessage = !message, Object.defineProperty(_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: !1,\n writable: !0,\n configurable: !0\n }), _this.code = \"ERR_ASSERTION\", _this.actual = actual, _this.expected = expected, _this.operator = operator, Error.captureStackTrace && Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn), _this.stack, _this.name = \"AssertionError\", _possibleConstructorReturn(_this);\n }\n return AssertionError2.prototype = {}, _inherits(AssertionError2, _Error), _createClass(AssertionError2, [\n {\n key: \"toString\",\n value: function() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: inspect.custom,\n value: function(recurseTimes, ctx) {\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: !1,\n depth: 0\n }));\n }\n }\n ]), AssertionError2;\n }(_wrapNativeSuper(Error));\n module2.exports = AssertionError;\n }\n}), require_assert = __commonJS({\n \"assert/build/assert.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n var _require = require_errors(), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, AssertionError = require_assertion_error(), _require2 = util, inspect = _require2.inspect, _require$types = util.types, isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp, objectAssign = Object.assign, objectIs = Object.is, errorCache = new Map, warned = !1, assert = module2.exports = ok, NO_EXCEPTION_SENTINEL = {};\n function innerFail(obj) {\n throw obj.message instanceof Error \? obj.message : new AssertionError(obj);\n }\n function fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length, internalMessage;\n if (argsLen === 0)\n internalMessage = \"Failed\";\n else if (argsLen === 1)\n message = actual, actual = void 0;\n else {\n if (warned === !1) {\n warned = !0;\n var warn = process.emitWarning \? process.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n argsLen === 2 && (operator = \"!=\");\n }\n if (message instanceof Error)\n throw message;\n var errArgs = {\n actual,\n expected,\n operator: operator === void 0 \? \"fail\" : operator,\n stackStartFn: stackStartFn || fail\n };\n message !== void 0 && (errArgs.message = message);\n var err = new AssertionError(errArgs);\n throw internalMessage && (err.message = internalMessage, err.generatedMessage = !0), err;\n }\n assert.fail = fail, assert.AssertionError = AssertionError;\n function innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = !1;\n if (argLen === 0)\n generatedMessage = !0, message = \"No value argument passed to `assert.ok()`\";\n else if (message instanceof Error)\n throw message;\n var err = new AssertionError({\n actual: value,\n expected: !0,\n message,\n operator: \"==\",\n stackStartFn: fn\n });\n throw err.generatedMessage = generatedMessage, err;\n }\n }\n function ok() {\n for (var _len = arguments.length, args = new @Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n innerOk.@apply(void 0, [ok, args.length].concat(args));\n }\n assert.ok = ok, assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual != expected && innerFail({\n actual,\n expected,\n message,\n operator: \"==\",\n stackStartFn: equal\n });\n }, assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual == expected && innerFail({\n actual,\n expected,\n message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n }, assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n }, assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n }, assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n }, assert.notDeepStrictEqual = notDeepStrictEqual;\n function notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: notDeepStrictEqual\n });\n }\n assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) || innerFail({\n actual,\n expected,\n message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n }, assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) && innerFail({\n actual,\n expected,\n message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n }, assert.match = function match(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!isRegExp(expected))\n throw new ERR_INVALID_ARG_TYPE(\"expected\", \"RegExp\", expected);\n expected.test(actual) || innerFail({\n actual,\n expected,\n message,\n operator: \"match\",\n stackStartFn: match\n });\n };\n var Comparison = function Comparison2(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison2), keys.forEach(function(key) {\n (key in obj) && (actual !== void 0 && typeof actual[key] == \"string\" && isRegExp(obj[key]) && obj[key].test(actual[key]) \? _this[key] = actual[key] : _this[key] = obj[key]);\n });\n };\n function compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepEqual(actual[key], expected[key], !0)) {\n if (!message) {\n var a = new Comparison(actual, keys), b = new Comparison(expected, keys, actual), err = new AssertionError({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.actual = actual, err.expected = expected, err.operator = fn.name, err;\n }\n innerFail({\n actual,\n expected,\n message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n }\n function expectedException(actual, expected, msg, fn) {\n if (typeof expected != \"function\") {\n if (isRegExp(expected))\n return expected.test(actual);\n if (arguments.length === 2)\n throw new ERR_INVALID_ARG_TYPE(\"expected\", [\"Function\", \"RegExp\"], expected);\n if (_typeof(actual) !== \"object\" || actual === null) {\n var err = new AssertionError({\n actual,\n expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.operator = fn.name, err;\n }\n var keys = Object.keys(expected);\n if (expected instanceof Error)\n keys.push(\"name\", \"message\");\n else if (keys.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n return keys.forEach(function(key) {\n return typeof actual[key] == \"string\" && isRegExp(expected[key]) && expected[key].test(actual[key]) || compareExceptionKey(actual, expected, key, msg, keys, fn);\n }), !0;\n }\n return expected.prototype !== void 0 && actual instanceof expected \? !0 : Error.isPrototypeOf(expected) \? !1 : expected.@call({}, actual) === !0;\n }\n function getActual(fn) {\n if (typeof fn != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n }\n function checkIsPromise(obj) {\n return isPromise(obj) || obj !== null && _typeof(obj) === \"object\" && typeof obj.then == \"function\" && typeof obj.catch == \"function\";\n }\n function waitForActual(promiseFn) {\n return @Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn == \"function\") {\n if (resultPromise = promiseFn(), !checkIsPromise(resultPromise))\n throw new ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if (checkIsPromise(promiseFn))\n resultPromise = promiseFn;\n else\n throw new ERR_INVALID_ARG_TYPE(\"promiseFn\", [\"Function\", \"Promise\"], promiseFn);\n return @Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n }\n function expectsError(stackStartFn, actual, error, message) {\n if (typeof error == \"string\") {\n if (arguments.length === 4)\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error, error = void 0;\n } else if (error != null && _typeof(error) !== \"object\" && typeof error != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n error && error.name && (details += \" (\".concat(error.name, \")\")), details += message \? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" \? \"rejection\" : \"exception\";\n innerFail({\n actual: void 0,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn))\n throw actual;\n }\n function expectsNoError(stackStartFn, actual, error, message) {\n if (actual !== NO_EXCEPTION_SENTINEL) {\n if (typeof error == \"string\" && (message = error, error = void 0), !error || expectedException(actual, error)) {\n var details = message \? \": \".concat(message) : \".\", fnType = stackStartFn.name === \"doesNotReject\" \? \"rejection\" : \"exception\";\n innerFail({\n actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, `\n`) + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn\n });\n }\n throw actual;\n }\n }\n assert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new @Array(_len2 > 1 \? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++)\n args[_key2 - 1] = arguments[_key2];\n expectsError.@apply(void 0, [throws, getActual(promiseFn)].concat(args));\n }, assert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new @Array(_len3 > 1 \? _len3 - 1 : 0), _key3 = 1;_key3 < _len3; _key3++)\n args[_key3 - 1] = arguments[_key3];\n return waitForActual(promiseFn).then(function(result) {\n return expectsError.@apply(void 0, [rejects, result].concat(args));\n });\n }, assert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new @Array(_len4 > 1 \? _len4 - 1 : 0), _key4 = 1;_key4 < _len4; _key4++)\n args[_key4 - 1] = arguments[_key4];\n expectsNoError.@apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n }, assert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new @Array(_len5 > 1 \? _len5 - 1 : 0), _key5 = 1;_key5 < _len5; _key5++)\n args[_key5 - 1] = arguments[_key5];\n return waitForActual(fn).then(function(result) {\n return expectsNoError.@apply(void 0, [doesNotReject, result].concat(args));\n });\n }, assert.ifError = function ifError(err) {\n if (err != null) {\n var message = \"ifError got unwanted exception: \";\n _typeof(err) === \"object\" && typeof err.message == \"string\" \? err.message.length === 0 && err.constructor \? message += err.constructor.name : message += err.message : message += inspect(err);\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message,\n stackStartFn: ifError\n }), origStack = err.stack;\n if (typeof origStack == \"string\") {\n var tmp2 = origStack.split(`\n`);\n tmp2.shift();\n for (var tmp1 = newErr.stack.split(`\n`), i = 0;i < tmp2.length; i++) {\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(`\n`), `\n`).concat(tmp2.join(`\n`));\n }\n throw newErr;\n }\n };\n function strict() {\n for (var _len6 = arguments.length, args = new @Array(_len6), _key6 = 0;_key6 < _len6; _key6++)\n args[_key6] = arguments[_key6];\n innerOk.@apply(void 0, [strict, args.length].concat(args));\n }\n assert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n }), assert.strict.strict = assert.strict;\n }\n}), assert_module = require_assert();\nassert_module.CallTracker = CallTracker;\nreturn assert_module})\n");
//
//
-static constexpr ASCIILiteral NodeChildProcessCode = "(function (){\"use strict\";// src/js/out/tmp/node/child_process.ts\nvar spawn = function(file, args, options) {\n options = normalizeSpawnArguments(file, args, options), validateTimeout(options.timeout), validateAbortSignal(options.signal, \"options.signal\");\n const killSignal2 = sanitizeKillSignal(options.killSignal), child = new ChildProcess;\n if (child.spawn(options), options.timeout > 0) {\n let timeoutId = setTimeout(() => {\n if (timeoutId) {\n try {\n child.kill(killSignal2);\n } catch (err) {\n child.emit(\"error\", err);\n }\n timeoutId = null;\n }\n });\n child.once(\"exit\", () => {\n if (timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n });\n }\n if (options.signal) {\n let onAbortListener2 = function() {\n abortChildProcess(child, killSignal2, options.signal.reason);\n };\n var onAbortListener = onAbortListener2;\n const signal = options.signal;\n if (signal.aborted)\n process.nextTick(onAbortListener2);\n else\n signal.addEventListener(\"abort\", onAbortListener2, { once: !0 }), child.once(\"exit\", () => signal.removeEventListener(\"abort\", onAbortListener2));\n }\n return child;\n}, execFile = function(file, args, options, callback) {\n ({ file, args, options, callback } = normalizeExecFileArgs(file, args, options, callback)), options = {\n encoding: \"utf8\",\n timeout: 0,\n maxBuffer: MAX_BUFFER,\n killSignal: \"SIGTERM\",\n cwd: null,\n env: null,\n shell: !1,\n ...options\n };\n const maxBuffer = options.maxBuffer;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const child = spawn(file, args, {\n cwd: options.cwd,\n env: options.env,\n shell: options.shell,\n signal: options.signal\n });\n let encoding;\n const _stdout = [], _stderr = [];\n if (options.encoding !== \"buffer\" && BufferIsEncoding(options.encoding))\n encoding = options.encoding;\n else\n encoding = null;\n let stdoutLen = 0, stderrLen = 0, killed = !1, exited = !1, timeoutId, encodedStdoutLen, encodedStderrLen, ex = null, cmd = file;\n function exitHandler(code, signal) {\n if (exited)\n return;\n if (exited = !0, timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n if (!callback)\n return;\n const readableEncoding = child\?.stdout\?.readableEncoding;\n let stdout, stderr;\n if (encoding || child.stdout && readableEncoding)\n stdout = ArrayPrototypeJoin.call(_stdout, \"\");\n else\n stdout = BufferConcat(_stdout);\n if (encoding || child.stderr && readableEncoding)\n stderr = ArrayPrototypeJoin.call(_stderr, \"\");\n else\n stderr = BufferConcat(_stderr);\n if (!ex && code === 0 && signal === null) {\n callback(null, stdout, stderr);\n return;\n }\n if (args\?.length)\n cmd += ` ${ArrayPrototypeJoin.call(args, \" \")}`;\n if (!ex) {\n let message = `Command failed: ${cmd}`;\n if (stderr)\n message += `\\n${stderr}`;\n ex = genericNodeError(message, {\n code,\n killed: child.killed || killed,\n signal\n });\n }\n ex.cmd = cmd, callback(ex, stdout, stderr);\n }\n function errorHandler(e) {\n if (ex = e, child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n exitHandler();\n }\n function kill() {\n if (child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n killed = !0;\n try {\n child.kill(options.killSignal);\n } catch (e) {\n ex = e, exitHandler();\n }\n }\n if (options.timeout > 0)\n timeoutId = setTimeout(function delayedKill() {\n kill(), timeoutId = null;\n }, options.timeout);\n if (child.stdout) {\n if (encoding)\n child.stdout.setEncoding(encoding);\n child.stdout.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stdout, chunk);\n } : encoding \? function onChildStdoutEncoded(chunk) {\n if (stdoutLen += chunk.length, stdoutLen * 4 > maxBuffer) {\n const encoding2 = child.stdout.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStdoutLen === void 0)\n for (let i = 0;i < _stdout.length; i++)\n encodedStdoutLen += Buffer.byteLength(_stdout[i], encoding2);\n else\n encodedStdoutLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStdoutLen - actualLen);\n ArrayPrototypePush.call(_stdout, StringPrototypeSlice.apply(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n } : function onChildStdoutRaw(chunk) {\n if (stdoutLen += chunk.length, stdoutLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stdoutLen - chunk.length);\n ArrayPrototypePush.call(_stdout, chunk.slice(0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n });\n }\n if (child.stderr) {\n if (encoding)\n child.stderr.setEncoding(encoding);\n child.stderr.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stderr, chunk);\n } : encoding \? function onChildStderrEncoded(chunk) {\n if (stderrLen += chunk.length, stderrLen * 4 > maxBuffer) {\n const encoding2 = child.stderr.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStderrLen === void 0)\n for (let i = 0;i < _stderr.length; i++)\n encodedStderrLen += Buffer.byteLength(_stderr[i], encoding2);\n else\n encodedStderrLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStderrLen - actualLen);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n } : function onChildStderrRaw(chunk) {\n if (stderrLen += chunk.length, stderrLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stderrLen - chunk.length);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n });\n }\n return child.addListener(\"close\", exitHandler), child.addListener(\"error\", errorHandler), child;\n}, exec = function(command, options, callback) {\n const opts = normalizeExecArgs(command, options, callback);\n return execFile(opts.file, opts.options, opts.callback);\n}, spawnSync = function(file, args, options) {\n options = {\n maxBuffer: MAX_BUFFER,\n ...normalizeSpawnArguments(file, args, options)\n };\n const { maxBuffer, encoding } = options;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const stdio = options.stdio || \"pipe\", bunStdio = getBunStdioFromOptions(stdio);\n var { input } = options;\n if (input)\n if (ArrayBufferIsView(input))\n bunStdio[0] = input;\n else if (typeof input === \"string\")\n bunStdio[0] = Buffer.from(input, encoding || \"utf8\");\n else\n throw new ERR_INVALID_ARG_TYPE(\"options.stdio[0]\", [\"Buffer\", \"TypedArray\", \"DataView\", \"string\"], input);\n const { stdout, stderr, success, exitCode } = Bun.spawnSync({\n cmd: options.args,\n env: options.env || void 0,\n cwd: options.cwd || void 0,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2]\n }), result = {\n signal: null,\n status: exitCode,\n output: [null, stdout, stderr]\n };\n if (stdout && encoding && encoding !== \"buffer\")\n result.output[1] = result.output[1]\?.toString(encoding);\n if (stderr && encoding && encoding !== \"buffer\")\n result.output[2] = result.output[2]\?.toString(encoding);\n if (result.stdout = result.output[1], result.stderr = result.output[2], !success)\n result.error = new SystemError(result.output[2], options.file, \"spawnSync\", -1, result.status), result.error.spawnargs = ArrayPrototypeSlice.call(options.args, 1);\n return result;\n}, execFileSync = function(file, args, options) {\n ({ file, args, options } = normalizeExecFileArgs(file, args, options));\n const ret = spawnSync(file, args, options), errArgs = [options.argv0 || file];\n ArrayPrototypePush.apply(errArgs, args);\n const err = checkExecSyncError(ret, errArgs);\n if (err)\n throw err;\n return ret.stdout;\n}, execSync = function(command, options) {\n const opts = normalizeExecArgs(command, options, null), ret = spawnSync(opts.file, opts.options), err = checkExecSyncError(ret, void 0, command);\n if (err)\n throw err;\n return ret.stdout;\n}, stdioStringToArray = function(stdio, channel) {\n const options = [];\n switch (stdio) {\n case \"ignore\":\n case \"overlapped\":\n case \"pipe\":\n ArrayPrototypePush.call(options, stdio, stdio, stdio);\n break;\n case \"inherit\":\n ArrayPrototypePush.call(options, 0, 1, 2);\n break;\n default:\n throw new ERR_INVALID_ARG_VALUE(\"stdio\", stdio);\n }\n if (channel)\n ArrayPrototypePush.call(options, channel);\n return options;\n}, fork = function(modulePath, args = [], options) {\n modulePath = getValidatedPath(modulePath, \"modulePath\");\n let execArgv;\n if (args == null)\n args = [];\n else if (typeof args === \"object\" && !ArrayIsArray(args))\n options = args, args = [];\n else\n validateArray(args, \"args\");\n if (options != null)\n validateObject(options, \"options\");\n if (options = { __proto__: null, ...options, shell: !1 }, options.execPath = options.execPath || process.execPath, validateArgumentNullCheck(options.execPath, \"options.execPath\"), execArgv = options.execArgv || process.execArgv, validateArgumentsNullCheck(execArgv, \"options.execArgv\"), execArgv === process.execArgv && process._eval != null) {\n const index = ArrayPrototypeLastIndexOf.call(execArgv, process._eval);\n if (index > 0)\n execArgv = ArrayPrototypeSlice.call(execArgv), ArrayPrototypeSplice.call(execArgv, index - 1, 2);\n }\n if (args = [...execArgv, modulePath, ...args], typeof options.stdio === \"string\")\n options.stdio = stdioStringToArray(options.stdio, \"ipc\");\n else if (!ArrayIsArray(options.stdio))\n options.stdio = stdioStringToArray(options.silent \? \"pipe\" : \"inherit\", \"ipc\");\n else if (!ArrayPrototypeIncludes.call(options.stdio, \"ipc\"))\n throw new ERR_CHILD_PROCESS_IPC_REQUIRED(\"options.stdio\");\n return spawn(options.execPath, args, options);\n}, convertToValidSignal = function(signal) {\n if (typeof signal === \"number\" && getSignalsToNamesMapping()[signal])\n return signal;\n if (typeof signal === \"string\") {\n const signalName = signals[StringPrototypeToUpperCase.call(signal)];\n if (signalName)\n return signalName;\n }\n throw new ERR_UNKNOWN_SIGNAL(signal);\n}, sanitizeKillSignal = function(killSignal2) {\n if (typeof killSignal2 === \"string\" || typeof killSignal2 === \"number\")\n return convertToValidSignal(killSignal2);\n else if (killSignal2 != null)\n throw new ERR_INVALID_ARG_TYPE(\"options.killSignal\", [\"string\", \"number\"], killSignal2);\n}, getSignalsToNamesMapping = function() {\n if (signalsToNamesMapping !== void 0)\n return signalsToNamesMapping;\n signalsToNamesMapping = ObjectCreate(null);\n for (let key in signals)\n signalsToNamesMapping[signals[key]] = key;\n return signalsToNamesMapping;\n}, normalizeExecFileArgs = function(file, args, options, callback) {\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args != null && typeof args === \"object\")\n callback = options, options = args, args = null;\n else if (typeof args === \"function\")\n callback = args, options = null, args = null;\n if (args == null)\n args = [];\n if (typeof options === \"function\")\n callback = options;\n else if (options != null)\n validateObject(options, \"options\");\n if (options == null)\n options = kEmptyObject;\n if (callback != null)\n validateFunction(callback, \"callback\");\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n return { file, args, options, callback };\n}, normalizeExecArgs = function(command, options, callback) {\n if (validateString(command, \"command\"), validateArgumentNullCheck(command, \"command\"), typeof options === \"function\")\n callback = options, options = void 0;\n return options = { ...options }, options.shell = typeof options.shell === \"string\" \? options.shell : !0, {\n file: command,\n options,\n callback\n };\n}, normalizeSpawnArguments = function(file, args, options) {\n if (validateString(file, \"file\"), validateArgumentNullCheck(file, \"file\"), file.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"file\", file, \"cannot be empty\");\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args == null)\n args = [];\n else if (typeof args !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"args\", \"object\", args);\n else\n options = args, args = [];\n if (validateArgumentsNullCheck(args, \"args\"), options === void 0)\n options = {};\n else\n validateObject(options, \"options\");\n let cwd = options.cwd;\n if (cwd != null)\n cwd = getValidatedPath(cwd, \"options.cwd\");\n var detached = !1;\n const { detached: detachedOption } = options;\n if (detachedOption != null)\n detached = !!detachedOption;\n if (options.shell != null && typeof options.shell !== \"boolean\" && typeof options.shell !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(\"options.shell\", [\"boolean\", \"string\"], options.shell);\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n if (options.shell) {\n validateArgumentNullCheck(options.shell, \"options.shell\");\n const command = ArrayPrototypeJoin.call([file, ...args], \" \");\n if (typeof options.shell === \"string\")\n file = options.shell;\n else\n file = \"sh\";\n args = [\"-c\", command];\n }\n if (typeof options.argv0 === \"string\")\n ArrayPrototypeUnshift.call(args, options.argv0);\n else\n ArrayPrototypeUnshift.call(args, file);\n const envPairs = options.env || process.env;\n return { ...options, detached, file, args, cwd, envPairs };\n}, checkExecSyncError = function(ret, args, cmd) {\n let err;\n if (ret.error)\n err = ret.error, ObjectAssign(err, ret);\n else if (ret.status !== 0) {\n let msg = \"Command failed: \";\n if (msg += cmd || ArrayPrototypeJoin.call(args, \" \"), ret.stderr && ret.stderr.length > 0)\n msg += `\\n${ret.stderr.toString()}`;\n err = genericNodeError(msg, ret);\n }\n return err;\n}, nodeToBun = function(item) {\n if (typeof item === \"number\")\n return item;\n else {\n const result = nodeToBunLookup[item];\n if (result === void 0)\n throw new Error(\"Invalid stdio option\");\n return result;\n }\n}, fdToStdioName = function(fd) {\n switch (fd) {\n case 0:\n return \"stdin\";\n case 1:\n return \"stdout\";\n case 2:\n return \"stderr\";\n default:\n return null;\n }\n}, getBunStdioFromOptions = function(stdio) {\n return normalizeStdio(stdio).map((item) => nodeToBun(item));\n}, normalizeStdio = function(stdio) {\n if (typeof stdio === \"string\")\n switch (stdio) {\n case \"ignore\":\n return [\"ignore\", \"ignore\", \"ignore\"];\n case \"pipe\":\n return [\"pipe\", \"pipe\", \"pipe\"];\n case \"inherit\":\n return [\"inherit\", \"inherit\", \"inherit\"];\n default:\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n }\n else if (ArrayIsArray(stdio)) {\n let processedStdio;\n if (stdio.length === 0)\n processedStdio = [\"pipe\", \"pipe\", \"pipe\"];\n else if (stdio.length === 1)\n processedStdio = [stdio[0], \"pipe\", \"pipe\"];\n else if (stdio.length === 2)\n processedStdio = [stdio[0], stdio[1], \"pipe\"];\n else if (stdio.length >= 3)\n processedStdio = [stdio[0], stdio[1], stdio[2]];\n return processedStdio.map((item) => !item \? \"pipe\" : item);\n } else\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n}, flushStdio = function(subprocess) {\n const stdio = subprocess.stdio;\n if (stdio == null)\n return;\n for (let i = 0;i < stdio.length; i++) {\n const stream = stdio[i];\n if (!stream || !stream.readable)\n continue;\n stream.resume();\n }\n}, onSpawnNT = function(self) {\n self.emit(\"spawn\");\n}, abortChildProcess = function(child, killSignal2, reason) {\n if (!child)\n return;\n try {\n if (child.kill(killSignal2))\n child.emit(\"error\", new AbortError(void 0, { cause: reason }));\n } catch (err) {\n child.emit(\"error\", err);\n }\n}, validateMaxBuffer = function(maxBuffer) {\n if (maxBuffer != null && !(typeof maxBuffer === \"number\" && maxBuffer >= 0))\n throw new ERR_OUT_OF_RANGE(\"options.maxBuffer\", \"a positive number\", maxBuffer);\n}, validateArgumentNullCheck = function(arg, propName) {\n if (typeof arg === \"string\" && StringPrototypeIncludes.call(arg, \"\\0\"))\n throw new ERR_INVALID_ARG_VALUE(propName, arg, \"must be a string without null bytes\");\n}, validateArgumentsNullCheck = function(args, propName) {\n for (let i = 0;i < args.length; ++i)\n validateArgumentNullCheck(args[i], `${propName}[${i}]`);\n}, validateTimeout = function(timeout) {\n if (timeout != null && !(NumberIsInteger(timeout) && timeout >= 0))\n throw new ERR_OUT_OF_RANGE(\"timeout\", \"an unsigned integer\", timeout);\n};\nvar validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, nullCheck = function(path, propName, throwError = !0) {\n const pathIsString = typeof path === \"string\", pathIsUint8Array = isUint8Array(path);\n if (!pathIsString && !pathIsUint8Array || pathIsString && !StringPrototypeIncludes.call(path, \"\\0\") || pathIsUint8Array && !Uint8ArrayPrototypeIncludes.call(path, 0))\n return;\n const err = new ERR_INVALID_ARG_VALUE(propName, path, \"must be a string or Uint8Array without null bytes\");\n if (throwError)\n throw err;\n return err;\n}, validatePath = function(path, propName = \"path\") {\n if (typeof path !== \"string\" && !isUint8Array(path))\n throw new ERR_INVALID_ARG_TYPE(propName, [\"string\", \"Buffer\", \"URL\"], path);\n const err = nullCheck(path, propName, !1);\n if (err !== void 0)\n throw err;\n}, getValidatedPath = function(fileURLOrPath, propName = \"path\") {\n const path = toPathIfFileURL(fileURLOrPath);\n return validatePath(path, propName), path;\n}, isUint8Array = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof Uint8Array;\n}, isURLInstance = function(fileURLOrPath) {\n return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin;\n}, toPathIfFileURL = function(fileURLOrPath) {\n if (!isURLInstance(fileURLOrPath))\n return fileURLOrPath;\n return Bun.fileURLToPath(fileURLOrPath);\n}, genericNodeError = function(message, options) {\n const err = new Error(message);\n return err.code = options.code, err.killed = options.killed, err.signal = options.signal, err;\n}, ERR_OUT_OF_RANGE = function(str, range, input, replaceDefaultBoolean = !1) {\n return new RangeError(`The value of ${str} is out of range. It must be ${range}. Received ${input}`);\n}, ERR_CHILD_PROCESS_STDIO_MAXBUFFER = function(stdio) {\n return Error(`${stdio} maxBuffer length exceeded`);\n}, ERR_UNKNOWN_SIGNAL = function(name) {\n const err = @makeTypeError(`Unknown signal: ${name}`);\n return err.code = \"ERR_UNKNOWN_SIGNAL\", err;\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value\?.toString()}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_INVALID_OPT_VALUE = function(name, value) {\n return @makeTypeError(`The value \"${value}\" is invalid for option \"${name}\"`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value \"${value}\" is invalid for argument '${name}'. Reason: ${reason}`);\n}, ERR_CHILD_PROCESS_IPC_REQUIRED = function(name) {\n const err = @makeTypeError(`Forked processes must have an IPC channel, missing value 'ipc' in ${name}`);\n return err.code = \"ERR_CHILD_PROCESS_IPC_REQUIRED\", err;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), StreamModule = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), {\n constants: { signals }\n} = @getInternalField(@internalModuleRegistry, 26) || @createInternalModuleById(26), { promisify } = @getInternalField(@internalModuleRegistry, 46) || @createInternalModuleById(46), ObjectCreate = Object.create, ObjectAssign = Object.assign, ObjectDefineProperty = Object.defineProperty, BufferConcat = Buffer.concat, BufferIsEncoding = Buffer.isEncoding, kEmptyObject = ObjectCreate(null), ArrayPrototypePush = Array.prototype.push, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypeIncludes = Array.prototype.includes, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeUnshift = Array.prototype.unshift, ArrayPrototypeLastIndexOf = Array.prototype.lastIndexOf, ArrayPrototypeSplice = Array.prototype.splice, ArrayIsArray = Array.isArray, ArrayBufferIsView = ArrayBuffer.isView, NumberIsInteger = Number.isInteger;\nvar StringPrototypeToUpperCase = String.prototype.toUpperCase, StringPrototypeIncludes = String.prototype.includes, StringPrototypeSlice = String.prototype.slice, Uint8ArrayPrototypeIncludes = Uint8Array.prototype.includes, MAX_BUFFER = 1048576, NativeWritable, ReadableFromWeb, customPromiseExecFunction = (orig) => {\n return (...args) => {\n let resolve, reject;\n const promise = new Promise((res, rej) => {\n resolve = res, reject = rej;\n });\n return promise.child = orig(...args, (err, stdout, stderr) => {\n if (err !== null)\n err.stdout = stdout, err.stderr = stderr, reject(err);\n else\n resolve({ stdout, stderr });\n }), promise;\n };\n};\nObjectDefineProperty(exec, promisify.custom, {\n __proto__: null,\n enumerable: !1,\n value: customPromiseExecFunction(exec)\n});\nvar signalsToNamesMapping;\n\nclass ChildProcess extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n #handle;\n #exited = !1;\n #closesNeeded = 1;\n #closesGot = 0;\n connected = !1;\n signalCode = null;\n exitCode = null;\n spawnfile;\n spawnargs;\n pid;\n channel;\n get killed() {\n if (this.#handle == null)\n return !1;\n }\n #handleOnExit(exitCode, signalCode, err) {\n if (this.#exited)\n return;\n if (signalCode)\n this.signalCode = signalCode;\n else\n this.exitCode = exitCode;\n if (this.#stdin)\n this.#stdin.destroy();\n if (this.#handle)\n this.#handle = null;\n if (exitCode < 0) {\n const err2 = new SystemError(`Spawned process exited with error code: ${exitCode}`, void 0, \"spawn\", \"EUNKNOWN\", \"ERR_CHILD_PROCESS_UNKNOWN_ERROR\");\n if (this.spawnfile)\n err2.path = this.spawnfile;\n err2.spawnargs = ArrayPrototypeSlice.call(this.spawnargs, 1), this.emit(\"error\", err2);\n } else\n this.emit(\"exit\", this.exitCode, this.signalCode);\n process.nextTick(flushStdio, this), this.#maybeClose(), this.#exited = !0, this.#stdioOptions = [\"destroyed\", \"destroyed\", \"destroyed\"];\n }\n #getBunSpawnIo(i, encoding) {\n NativeWritable ||= StreamModule.NativeWritable, ReadableFromWeb ||= StreamModule.Readable.fromWeb;\n const io = this.#stdioOptions[i];\n switch (i) {\n case 0:\n switch (io) {\n case \"pipe\":\n return new NativeWritable(this.#handle.stdin);\n case \"inherit\":\n return process.stdin || null;\n case \"destroyed\":\n return new ShimmedStdin;\n default:\n return null;\n }\n case 2:\n case 1:\n switch (io) {\n case \"pipe\":\n return ReadableFromWeb(this.#handle[fdToStdioName(i)], { encoding });\n case \"inherit\":\n return process[fdToStdioName(i)] || null;\n case \"destroyed\":\n return new ShimmedStdioOutStream;\n default:\n return null;\n }\n }\n }\n #stdin;\n #stdout;\n #stderr;\n #stdioObject;\n #encoding;\n #stdioOptions;\n #createStdioObject() {\n return Object.create(null, {\n 0: {\n get: () => this.stdin\n },\n 1: {\n get: () => this.stdout\n },\n 2: {\n get: () => this.stderr\n }\n });\n }\n get stdin() {\n return this.#stdin \?\?= this.#getBunSpawnIo(0, this.#encoding);\n }\n get stdout() {\n return this.#stdout \?\?= this.#getBunSpawnIo(1, this.#encoding);\n }\n get stderr() {\n return this.#stderr \?\?= this.#getBunSpawnIo(2, this.#encoding);\n }\n get stdio() {\n return this.#stdioObject \?\?= this.#createStdioObject();\n }\n spawn(options) {\n validateObject(options, \"options\"), validateString(options.file, \"options.file\");\n var file = this.spawnfile = options.file, spawnargs;\n if (options.args == null)\n spawnargs = this.spawnargs = [];\n else\n validateArray(options.args, \"options.args\"), spawnargs = this.spawnargs = options.args;\n const stdio = options.stdio || [\"pipe\", \"pipe\", \"pipe\"], bunStdio = getBunStdioFromOptions(stdio), ipc = @isArray(stdio) && stdio[3] === \"ipc\";\n var env = options.envPairs || void 0;\n const detachedOption = options.detached;\n if (this.#encoding = options.encoding || void 0, this.#stdioOptions = bunStdio, this.#handle = Bun.spawn({\n cmd: spawnargs,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2],\n cwd: options.cwd || void 0,\n env: env || process.env,\n detached: typeof detachedOption !== \"undefined\" \? !!detachedOption : !1,\n onExit: (handle, exitCode, signalCode, err) => {\n this.#handle = handle, this.pid = this.#handle.pid, process.nextTick((exitCode2, signalCode2, err2) => this.#handleOnExit(exitCode2, signalCode2, err2), exitCode, signalCode, err);\n },\n lazy: !0,\n ipc: ipc \? this.#emitIpcMessage.bind(this) : void 0\n }), this.pid = this.#handle.pid, onSpawnNT(this), ipc)\n this.send = this.#send, this.disconnect = this.#disconnect;\n }\n #emitIpcMessage(message) {\n this.emit(\"message\", message);\n }\n #send(message, handle, options, callback) {\n if (typeof handle === \"function\")\n callback = handle, handle = void 0, options = void 0;\n else if (typeof options === \"function\")\n callback = options, options = void 0;\n else if (options !== void 0) {\n if (typeof options !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n }\n if (!this.#handle) {\n if (callback)\n process.nextTick(callback, @makeTypeError(\"Process was closed while trying to send message\"));\n else\n this.emit(\"error\", @makeTypeError(\"Process was closed while trying to send message\"));\n return !1;\n }\n try {\n if (this.#handle.send(message), callback)\n process.nextTick(callback);\n return !0;\n } catch (error) {\n if (callback)\n process.nextTick(callback, error);\n else\n this.emit(\"error\", error);\n return !1;\n }\n }\n #disconnect() {\n if (!this.connected) {\n this.emit(\"error\", @makeTypeError(\"Process was closed while trying to send message\"));\n return;\n }\n this.connected = !1, this.#handle.disconnect();\n }\n kill(sig) {\n const signal = sig === 0 \? sig : convertToValidSignal(sig === void 0 \? \"SIGTERM\" : sig);\n if (this.#handle)\n this.#handle.kill(signal);\n return this.#maybeClose(), !0;\n }\n #maybeClose() {\n if (this.#closesGot++, this.#closesGot === this.#closesNeeded)\n this.emit(\"close\", this.exitCode, this.signalCode);\n }\n ref() {\n if (this.#handle)\n this.#handle.ref();\n }\n unref() {\n if (this.#handle)\n this.#handle.unref();\n }\n}\nvar nodeToBunLookup = {\n ignore: null,\n pipe: \"pipe\",\n overlapped: \"pipe\",\n inherit: \"inherit\"\n};\n\nclass ShimmedStdin extends EventEmitter {\n constructor() {\n super();\n }\n write() {\n return !1;\n }\n destroy() {\n }\n end() {\n }\n pipe() {\n }\n}\n\nclass ShimmedStdioOutStream extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n pipe() {\n }\n}\nvar validateAbortSignal = (signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n};\nvar validateObject = (value, name, options = null) => {\n const allowArray = options\?.allowArray \?\? !1, allowFunction = options\?.allowFunction \?\? !1;\n if (!(options\?.nullable \?\? !1) && value === null || !allowArray && ArrayIsArray.call(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE(name, \"object\", value);\n}, validateArray = (value, name, minLength = 0) => {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, Error = globalThis.Error, TypeError = globalThis.TypeError, RangeError = globalThis.RangeError;\n\nclass AbortError extends Error {\n code = \"ABORT_ERR\";\n name = \"AbortError\";\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n }\n}\n\nclass SystemError extends Error {\n path;\n syscall;\n errno;\n code;\n constructor(message, path, syscall, errno, code) {\n super(message);\n this.path = path, this.syscall = syscall, this.errno = errno, this.code = code;\n }\n get name() {\n return \"SystemError\";\n }\n}\n$ = {\n ChildProcess,\n spawn,\n execFile,\n exec,\n fork,\n spawnSync,\n execFileSync,\n execSync\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeAssertStrictCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/assert.strict.ts\nreturn (@getInternalField(@internalModuleRegistry, 8) || @createInternalModuleById(8)).strict})\n");
//
//
-static constexpr ASCIILiteral NodeClusterCode = "(function (){\"use strict\";// src/js/out/tmp/node/cluster.ts\nvar EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5);\n\nclass Cluster extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n isWorker = !1;\n isPrimary = !0;\n isMaster = !0;\n workers = {};\n settings = {};\n SCHED_NONE = 1;\n SCHED_RR = 2;\n schedulingPolicy = 2;\n Worker = function Worker() {\n throwNotImplemented(\"node:cluster Worker\", 2428);\n };\n setupPrimary() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n setupMaster() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n fork() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n disconnect() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n}\nreturn new Cluster})\n"_s;
+static constexpr ASCIILiteral NodeAsyncHooksCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/async_hooks.ts\nvar get = function() {\n return @getInternalField(@asyncContext, 0);\n}, set = function(contextValue) {\n return @putInternalField(@asyncContext, 0, contextValue);\n}, createWarning = function(message) {\n let warned = !1;\n var wrapped = function() {\n if (warned)\n return;\n if (new Error().stack.includes(\"zx/build/core.js\"))\n return;\n warned = !0, console.warn(\"[bun] Warning:\", message);\n };\n return wrapped;\n}, createHook = function(callbacks) {\n return {\n enable: createHookNotImpl,\n disable: createHookNotImpl\n };\n}, executionAsyncId = function() {\n return executionAsyncIdNotImpl(), 0;\n}, triggerAsyncId = function() {\n return 0;\n}, executionAsyncResource = function() {\n return executionAsyncResourceWarning(), process.stdin;\n}, $, { cleanupLater, setAsyncHooksEnabled } = @lazy(\"async_hooks\");\n\nclass AsyncLocalStorage {\n #disableCalled = !1;\n constructor() {\n setAsyncHooksEnabled(!0);\n }\n static bind(fn, ...args) {\n return this.snapshot().bind(null, fn, ...args);\n }\n static snapshot() {\n var context = get();\n return (fn, ...args) => {\n var prev = get();\n set(context);\n try {\n return fn(...args);\n } catch (error) {\n throw error;\n } finally {\n set(prev);\n }\n };\n }\n enterWith(store) {\n cleanupLater();\n var context = get();\n if (!context) {\n set([this, store]);\n return;\n }\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this) {\n const clone = context.slice();\n clone[i + 1] = store, set(clone);\n return;\n }\n set(context.concat(this, store));\n }\n exit(cb, ...args) {\n return this.run(@undefined, cb, ...args);\n }\n run(store_value, callback, ...args) {\n var context = get(), hasPrevious = !1, previous_value, i = 0, contextWasAlreadyInit = !context;\n if (contextWasAlreadyInit)\n set(context = [this, store_value]);\n else {\n if (context = context.slice(), i = context.indexOf(this), i > -1)\n hasPrevious = !0, previous_value = context[i + 1], context[i + 1] = store_value;\n else\n i = context.length, context.push(this, store_value);\n set(context);\n }\n try {\n return callback(...args);\n } catch (e) {\n throw e;\n } finally {\n if (!this.#disableCalled) {\n var context2 = get();\n if (context2 === context && contextWasAlreadyInit)\n set(@undefined);\n else if (context2 = context2.slice(), hasPrevious)\n context2[i + 1] = previous_value, set(context2);\n else\n context2.splice(i, 2), set(context2.length \? context2 : @undefined);\n }\n }\n }\n disable() {\n if (!this.#disableCalled) {\n var context = get();\n if (context) {\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this) {\n context.splice(i, 2), set(context.length \? context : @undefined);\n break;\n }\n }\n this.#disableCalled = !0;\n }\n }\n getStore() {\n var context = get();\n if (!context)\n return;\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this)\n return context[i + 1];\n }\n}\n\nclass AsyncResource {\n type;\n #snapshot;\n constructor(type, options) {\n if (typeof type !== \"string\")\n @throwTypeError('The \"type\" argument must be of type string. Received type ' + typeof type);\n setAsyncHooksEnabled(!0), this.type = type, this.#snapshot = get();\n }\n emitBefore() {\n return !0;\n }\n emitAfter() {\n return !0;\n }\n asyncId() {\n return 0;\n }\n triggerAsyncId() {\n return 0;\n }\n emitDestroy() {\n }\n runInAsyncScope(fn, thisArg, ...args) {\n var prev = get();\n set(this.#snapshot);\n try {\n return fn.@apply(thisArg, args);\n } catch (error) {\n throw error;\n } finally {\n set(prev);\n }\n }\n bind(fn, thisArg) {\n return this.runInAsyncScope.bind(this, fn, thisArg \?\? this);\n }\n static bind(fn, type, thisArg) {\n return type = type || fn.name, new AsyncResource(type || \"bound-anonymous-fn\").bind(fn, thisArg);\n }\n}\nvar createHookNotImpl = createWarning(\"async_hooks.createHook is not implemented in Bun. Hooks can still be created but will never be called.\"), executionAsyncIdNotImpl = createWarning(\"async_hooks.executionAsyncId/triggerAsyncId are not implemented in Bun. It will return 0 every time.\"), executionAsyncResourceWarning = createWarning(\"async_hooks.executionAsyncResource is not implemented in Bun. It returns a reference to process.stdin every time.\"), asyncWrapProviders = {\n NONE: 0,\n DIRHANDLE: 1,\n DNSCHANNEL: 2,\n ELDHISTOGRAM: 3,\n FILEHANDLE: 4,\n FILEHANDLECLOSEREQ: 5,\n FIXEDSIZEBLOBCOPY: 6,\n FSEVENTWRAP: 7,\n FSREQCALLBACK: 8,\n FSREQPROMISE: 9,\n GETADDRINFOREQWRAP: 10,\n GETNAMEINFOREQWRAP: 11,\n HEAPSNAPSHOT: 12,\n HTTP2SESSION: 13,\n HTTP2STREAM: 14,\n HTTP2PING: 15,\n HTTP2SETTINGS: 16,\n HTTPINCOMINGMESSAGE: 17,\n HTTPCLIENTREQUEST: 18,\n JSSTREAM: 19,\n JSUDPWRAP: 20,\n MESSAGEPORT: 21,\n PIPECONNECTWRAP: 22,\n PIPESERVERWRAP: 23,\n PIPEWRAP: 24,\n PROCESSWRAP: 25,\n PROMISE: 26,\n QUERYWRAP: 27,\n SHUTDOWNWRAP: 28,\n SIGNALWRAP: 29,\n STATWATCHER: 30,\n STREAMPIPE: 31,\n TCPCONNECTWRAP: 32,\n TCPSERVERWRAP: 33,\n TCPWRAP: 34,\n TTYWRAP: 35,\n UDPSENDWRAP: 36,\n UDPWRAP: 37,\n SIGINTWATCHDOG: 38,\n WORKER: 39,\n WORKERHEAPSNAPSHOT: 40,\n WRITEWRAP: 41,\n ZLIB: 42,\n CHECKPRIMEREQUEST: 43,\n PBKDF2REQUEST: 44,\n KEYPAIRGENREQUEST: 45,\n KEYGENREQUEST: 46,\n KEYEXPORTREQUEST: 47,\n CIPHERREQUEST: 48,\n DERIVEBITSREQUEST: 49,\n HASHREQUEST: 50,\n RANDOMBYTESREQUEST: 51,\n RANDOMPRIMEREQUEST: 52,\n SCRYPTREQUEST: 53,\n SIGNREQUEST: 54,\n TLSWRAP: 55,\n VERIFYREQUEST: 56,\n INSPECTORJSBINDING: 57\n};\n$ = {\n AsyncLocalStorage,\n createHook,\n executionAsyncId,\n triggerAsyncId,\n executionAsyncResource,\n asyncWrapProviders,\n AsyncResource\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeConsoleCode = "(function (){\"use strict\";// src/js/out/tmp/node/console.ts\nreturn console})\n"_s;
+static constexpr ASCIILiteral NodeChildProcessCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/child_process.ts\nvar spawn = function(file, args, options) {\n options = normalizeSpawnArguments(file, args, options), validateTimeout(options.timeout), validateAbortSignal(options.signal, \"options.signal\");\n const killSignal2 = sanitizeKillSignal(options.killSignal), child = new ChildProcess;\n if (child.spawn(options), options.timeout > 0) {\n let timeoutId = setTimeout(() => {\n if (timeoutId) {\n try {\n child.kill(killSignal2);\n } catch (err) {\n child.emit(\"error\", err);\n }\n timeoutId = null;\n }\n });\n child.once(\"exit\", () => {\n if (timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n });\n }\n if (options.signal) {\n let onAbortListener2 = function() {\n abortChildProcess(child, killSignal2, options.signal.reason);\n };\n var onAbortListener = onAbortListener2;\n const signal = options.signal;\n if (signal.aborted)\n process.nextTick(onAbortListener2);\n else\n signal.addEventListener(\"abort\", onAbortListener2, { once: !0 }), child.once(\"exit\", () => signal.removeEventListener(\"abort\", onAbortListener2));\n }\n return child;\n}, execFile = function(file, args, options, callback) {\n ({ file, args, options, callback } = normalizeExecFileArgs(file, args, options, callback)), options = {\n encoding: \"utf8\",\n timeout: 0,\n maxBuffer: MAX_BUFFER,\n killSignal: \"SIGTERM\",\n cwd: null,\n env: null,\n shell: !1,\n ...options\n };\n const maxBuffer = options.maxBuffer;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const child = spawn(file, args, {\n cwd: options.cwd,\n env: options.env,\n shell: options.shell,\n signal: options.signal\n });\n let encoding;\n const _stdout = [], _stderr = [];\n if (options.encoding !== \"buffer\" && BufferIsEncoding(options.encoding))\n encoding = options.encoding;\n else\n encoding = null;\n let stdoutLen = 0, stderrLen = 0, killed = !1, exited = !1, timeoutId, encodedStdoutLen, encodedStderrLen, ex = null, cmd = file;\n function exitHandler(code, signal) {\n if (exited)\n return;\n if (exited = !0, timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n if (!callback)\n return;\n const readableEncoding = child\?.stdout\?.readableEncoding;\n let stdout, stderr;\n if (encoding || child.stdout && readableEncoding)\n stdout = ArrayPrototypeJoin.@call(_stdout, \"\");\n else\n stdout = BufferConcat(_stdout);\n if (encoding || child.stderr && readableEncoding)\n stderr = ArrayPrototypeJoin.@call(_stderr, \"\");\n else\n stderr = BufferConcat(_stderr);\n if (!ex && code === 0 && signal === null) {\n callback(null, stdout, stderr);\n return;\n }\n if (args\?.length)\n cmd += ` ${ArrayPrototypeJoin.@call(args, \" \")}`;\n if (!ex) {\n let message = `Command failed: ${cmd}`;\n if (stderr)\n message += `\\n${stderr}`;\n ex = genericNodeError(message, {\n code,\n killed: child.killed || killed,\n signal\n });\n }\n ex.cmd = cmd, callback(ex, stdout, stderr);\n }\n function errorHandler(e) {\n if (ex = e, child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n exitHandler();\n }\n function kill() {\n if (child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n killed = !0;\n try {\n child.kill(options.killSignal);\n } catch (e) {\n ex = e, exitHandler();\n }\n }\n if (options.timeout > 0)\n timeoutId = setTimeout(function delayedKill() {\n kill(), timeoutId = null;\n }, options.timeout);\n if (child.stdout) {\n if (encoding)\n child.stdout.setEncoding(encoding);\n child.stdout.on(\"data\", maxBuffer === @Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.@call(_stdout, chunk);\n } : encoding \? function onChildStdoutEncoded(chunk) {\n if (stdoutLen += chunk.length, stdoutLen * 4 > maxBuffer) {\n const encoding2 = child.stdout.readableEncoding, actualLen = @Buffer.byteLength(chunk, encoding2);\n if (encodedStdoutLen === @undefined)\n for (let i = 0;i < _stdout.length; i++)\n encodedStdoutLen += @Buffer.byteLength(_stdout[i], encoding2);\n else\n encodedStdoutLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStdoutLen - actualLen);\n ArrayPrototypePush.@call(_stdout, StringPrototypeSlice.@apply(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.@call(_stdout, chunk);\n } : function onChildStdoutRaw(chunk) {\n if (stdoutLen += chunk.length, stdoutLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stdoutLen - chunk.length);\n ArrayPrototypePush.@call(_stdout, chunk.slice(0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.@call(_stdout, chunk);\n });\n }\n if (child.stderr) {\n if (encoding)\n child.stderr.setEncoding(encoding);\n child.stderr.on(\"data\", maxBuffer === @Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.@call(_stderr, chunk);\n } : encoding \? function onChildStderrEncoded(chunk) {\n if (stderrLen += chunk.length, stderrLen * 4 > maxBuffer) {\n const encoding2 = child.stderr.readableEncoding, actualLen = @Buffer.byteLength(chunk, encoding2);\n if (encodedStderrLen === @undefined)\n for (let i = 0;i < _stderr.length; i++)\n encodedStderrLen += @Buffer.byteLength(_stderr[i], encoding2);\n else\n encodedStderrLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStderrLen - actualLen);\n ArrayPrototypePush.@call(_stderr, StringPrototypeSlice.@call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.@call(_stderr, chunk);\n } : function onChildStderrRaw(chunk) {\n if (stderrLen += chunk.length, stderrLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stderrLen - chunk.length);\n ArrayPrototypePush.@call(_stderr, StringPrototypeSlice.@call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.@call(_stderr, chunk);\n });\n }\n return child.addListener(\"close\", exitHandler), child.addListener(\"error\", errorHandler), child;\n}, exec = function(command, options, callback) {\n const opts = normalizeExecArgs(command, options, callback);\n return execFile(opts.file, opts.options, opts.callback);\n}, spawnSync = function(file, args, options) {\n options = {\n maxBuffer: MAX_BUFFER,\n ...normalizeSpawnArguments(file, args, options)\n };\n const { maxBuffer, encoding } = options;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const stdio = options.stdio || \"pipe\", bunStdio = getBunStdioFromOptions(stdio);\n var { input } = options;\n if (input)\n if (ArrayBufferIsView(input))\n bunStdio[0] = input;\n else if (typeof input === \"string\")\n bunStdio[0] = @Buffer.from(input, encoding || \"utf8\");\n else\n throw new ERR_INVALID_ARG_TYPE(\"options.stdio[0]\", [\"Buffer\", \"TypedArray\", \"DataView\", \"string\"], input);\n const { stdout, stderr, success, exitCode } = Bun.spawnSync({\n cmd: options.args,\n env: options.env || @undefined,\n cwd: options.cwd || @undefined,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2]\n }), result = {\n signal: null,\n status: exitCode,\n output: [null, stdout, stderr]\n };\n if (stdout && encoding && encoding !== \"buffer\")\n result.output[1] = result.output[1]\?.toString(encoding);\n if (stderr && encoding && encoding !== \"buffer\")\n result.output[2] = result.output[2]\?.toString(encoding);\n if (result.stdout = result.output[1], result.stderr = result.output[2], !success)\n result.error = new SystemError(result.output[2], options.file, \"spawnSync\", -1, result.status), result.error.spawnargs = ArrayPrototypeSlice.@call(options.args, 1);\n return result;\n}, execFileSync = function(file, args, options) {\n ({ file, args, options } = normalizeExecFileArgs(file, args, options));\n const ret = spawnSync(file, args, options), errArgs = [options.argv0 || file];\n ArrayPrototypePush.@apply(errArgs, args);\n const err = checkExecSyncError(ret, errArgs);\n if (err)\n throw err;\n return ret.stdout;\n}, execSync = function(command, options) {\n const opts = normalizeExecArgs(command, options, null), ret = spawnSync(opts.file, opts.options), err = checkExecSyncError(ret, @undefined, command);\n if (err)\n throw err;\n return ret.stdout;\n}, stdioStringToArray = function(stdio, channel) {\n const options = [];\n switch (stdio) {\n case \"ignore\":\n case \"overlapped\":\n case \"pipe\":\n ArrayPrototypePush.@call(options, stdio, stdio, stdio);\n break;\n case \"inherit\":\n ArrayPrototypePush.@call(options, 0, 1, 2);\n break;\n default:\n throw new ERR_INVALID_ARG_VALUE(\"stdio\", stdio);\n }\n if (channel)\n ArrayPrototypePush.@call(options, channel);\n return options;\n}, fork = function(modulePath, args = [], options) {\n modulePath = getValidatedPath(modulePath, \"modulePath\");\n let execArgv;\n if (args == null)\n args = [];\n else if (typeof args === \"object\" && !ArrayIsArray(args))\n options = args, args = [];\n else\n validateArray(args, \"args\");\n if (options != null)\n validateObject(options, \"options\");\n if (options = { __proto__: null, ...options, shell: !1 }, options.execPath = options.execPath || process.execPath, validateArgumentNullCheck(options.execPath, \"options.execPath\"), args = [modulePath, ...args], typeof options.stdio === \"string\")\n options.stdio = stdioStringToArray(options.stdio, \"ipc\");\n else if (!ArrayIsArray(options.stdio))\n options.stdio = stdioStringToArray(options.silent \? \"pipe\" : \"inherit\", \"ipc\");\n else if (!ArrayPrototypeIncludes.@call(options.stdio, \"ipc\"))\n throw new ERR_CHILD_PROCESS_IPC_REQUIRED(\"options.stdio\");\n return spawn(options.execPath, args, options);\n}, convertToValidSignal = function(signal) {\n if (typeof signal === \"number\" && getSignalsToNamesMapping()[signal])\n return signal;\n if (typeof signal === \"string\") {\n const signalName = signals[StringPrototypeToUpperCase.@call(signal)];\n if (signalName)\n return signalName;\n }\n throw new ERR_UNKNOWN_SIGNAL(signal);\n}, sanitizeKillSignal = function(killSignal2) {\n if (typeof killSignal2 === \"string\" || typeof killSignal2 === \"number\")\n return convertToValidSignal(killSignal2);\n else if (killSignal2 != null)\n throw new ERR_INVALID_ARG_TYPE(\"options.killSignal\", [\"string\", \"number\"], killSignal2);\n}, getSignalsToNamesMapping = function() {\n if (signalsToNamesMapping !== @undefined)\n return signalsToNamesMapping;\n signalsToNamesMapping = ObjectCreate(null);\n for (let key in signals)\n signalsToNamesMapping[signals[key]] = key;\n return signalsToNamesMapping;\n}, normalizeExecFileArgs = function(file, args, options, callback) {\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.@call(args);\n else if (args != null && typeof args === \"object\")\n callback = options, options = args, args = null;\n else if (typeof args === \"function\")\n callback = args, options = null, args = null;\n if (args == null)\n args = [];\n if (typeof options === \"function\")\n callback = options;\n else if (options != null)\n validateObject(options, \"options\");\n if (options == null)\n options = kEmptyObject;\n if (callback != null)\n validateFunction(callback, \"callback\");\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n return { file, args, options, callback };\n}, normalizeExecArgs = function(command, options, callback) {\n if (validateString(command, \"command\"), validateArgumentNullCheck(command, \"command\"), typeof options === \"function\")\n callback = options, options = @undefined;\n return options = { ...options }, options.shell = typeof options.shell === \"string\" \? options.shell : !0, {\n file: command,\n options,\n callback\n };\n}, normalizeSpawnArguments = function(file, args, options) {\n if (validateString(file, \"file\"), validateArgumentNullCheck(file, \"file\"), file.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"file\", file, \"cannot be empty\");\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.@call(args);\n else if (args == null)\n args = [];\n else if (typeof args !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"args\", \"object\", args);\n else\n options = args, args = [];\n if (validateArgumentsNullCheck(args, \"args\"), options === @undefined)\n options = {};\n else\n validateObject(options, \"options\");\n let cwd = options.cwd;\n if (cwd != null)\n cwd = getValidatedPath(cwd, \"options.cwd\");\n var detached = !1;\n const { detached: detachedOption } = options;\n if (detachedOption != null)\n detached = !!detachedOption;\n if (options.shell != null && typeof options.shell !== \"boolean\" && typeof options.shell !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(\"options.shell\", [\"boolean\", \"string\"], options.shell);\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n if (options.shell) {\n validateArgumentNullCheck(options.shell, \"options.shell\");\n const command = ArrayPrototypeJoin.@call([file, ...args], \" \");\n if (typeof options.shell === \"string\")\n file = options.shell;\n else\n file = \"sh\";\n args = [\"-c\", command];\n }\n if (typeof options.argv0 === \"string\")\n ArrayPrototypeUnshift.@call(args, options.argv0);\n else\n ArrayPrototypeUnshift.@call(args, file);\n const envPairs = options.env || process.env;\n return { ...options, detached, file, args, cwd, envPairs };\n}, checkExecSyncError = function(ret, args, cmd) {\n let err;\n if (ret.error)\n err = ret.error, ObjectAssign(err, ret);\n else if (ret.status !== 0) {\n let msg = \"Command failed: \";\n if (msg += cmd || ArrayPrototypeJoin.@call(args, \" \"), ret.stderr && ret.stderr.length > 0)\n msg += `\\n${ret.stderr.toString()}`;\n err = genericNodeError(msg, ret);\n }\n return err;\n}, nodeToBun = function(item) {\n if (typeof item === \"number\")\n return item;\n else {\n const result = nodeToBunLookup[item];\n if (result === @undefined)\n throw new Error(`Invalid stdio option \"${item}\"`);\n return result;\n }\n}, fdToStdioName = function(fd) {\n switch (fd) {\n case 0:\n return \"stdin\";\n case 1:\n return \"stdout\";\n case 2:\n return \"stderr\";\n default:\n return null;\n }\n}, getBunStdioFromOptions = function(stdio) {\n return normalizeStdio(stdio).map((item) => nodeToBun(item));\n}, normalizeStdio = function(stdio) {\n if (typeof stdio === \"string\")\n switch (stdio) {\n case \"ignore\":\n return [\"ignore\", \"ignore\", \"ignore\"];\n case \"pipe\":\n return [\"pipe\", \"pipe\", \"pipe\"];\n case \"inherit\":\n return [\"inherit\", \"inherit\", \"inherit\"];\n default:\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n }\n else if (ArrayIsArray(stdio)) {\n let processedStdio;\n if (stdio.length === 0)\n processedStdio = [\"pipe\", \"pipe\", \"pipe\"];\n else if (stdio.length === 1)\n processedStdio = [stdio[0], \"pipe\", \"pipe\"];\n else if (stdio.length === 2)\n processedStdio = [stdio[0], stdio[1], \"pipe\"];\n else if (stdio.length >= 3)\n processedStdio = [stdio[0], stdio[1], stdio[2]];\n return processedStdio.map((item) => !item \? \"pipe\" : item);\n } else\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n}, flushStdio = function(subprocess) {\n const stdio = subprocess.stdio;\n if (stdio == null)\n return;\n for (let i = 0;i < stdio.length; i++) {\n const stream = stdio[i];\n if (!stream || !stream.readable)\n continue;\n stream.resume();\n }\n}, onSpawnNT = function(self) {\n self.emit(\"spawn\");\n}, abortChildProcess = function(child, killSignal2, reason) {\n if (!child)\n return;\n try {\n if (child.kill(killSignal2))\n child.emit(\"error\", new AbortError(@undefined, { cause: reason }));\n } catch (err) {\n child.emit(\"error\", err);\n }\n}, validateMaxBuffer = function(maxBuffer) {\n if (maxBuffer != null && !(typeof maxBuffer === \"number\" && maxBuffer >= 0))\n throw new ERR_OUT_OF_RANGE(\"options.maxBuffer\", \"a positive number\", maxBuffer);\n}, validateArgumentNullCheck = function(arg, propName) {\n if (typeof arg === \"string\" && StringPrototypeIncludes.@call(arg, \"\\0\"))\n throw new ERR_INVALID_ARG_VALUE(propName, arg, \"must be a string without null bytes\");\n}, validateArgumentsNullCheck = function(args, propName) {\n for (let i = 0;i < args.length; ++i)\n validateArgumentNullCheck(args[i], `${propName}[${i}]`);\n}, validateTimeout = function(timeout) {\n if (timeout != null && !(NumberIsInteger(timeout) && timeout >= 0))\n throw new ERR_OUT_OF_RANGE(\"timeout\", \"an unsigned integer\", timeout);\n};\nvar validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, nullCheck = function(path, propName, throwError = !0) {\n const pathIsString = typeof path === \"string\", pathIsUint8Array = isUint8Array(path);\n if (!pathIsString && !pathIsUint8Array || pathIsString && !StringPrototypeIncludes.@call(path, \"\\0\") || pathIsUint8Array && !Uint8ArrayPrototypeIncludes.@call(path, 0))\n return;\n const err = new ERR_INVALID_ARG_VALUE(propName, path, \"must be a string or Uint8Array without null bytes\");\n if (throwError)\n throw err;\n return err;\n}, validatePath = function(path, propName = \"path\") {\n if (typeof path !== \"string\" && !isUint8Array(path))\n throw new ERR_INVALID_ARG_TYPE(propName, [\"string\", \"Buffer\", \"URL\"], path);\n const err = nullCheck(path, propName, !1);\n if (err !== @undefined)\n throw err;\n}, getValidatedPath = function(fileURLOrPath, propName = \"path\") {\n const path = toPathIfFileURL(fileURLOrPath);\n return validatePath(path, propName), path;\n}, isUint8Array = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof @Uint8Array;\n}, isURLInstance = function(fileURLOrPath) {\n return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin;\n}, toPathIfFileURL = function(fileURLOrPath) {\n if (!isURLInstance(fileURLOrPath))\n return fileURLOrPath;\n return Bun.fileURLToPath(fileURLOrPath);\n}, genericNodeError = function(message, options) {\n const err = new Error(message);\n return err.code = options.code, err.killed = options.killed, err.signal = options.signal, err;\n}, ERR_OUT_OF_RANGE = function(str, range, input, replaceDefaultBoolean = !1) {\n return new RangeError(`The value of ${str} is out of range. It must be ${range}. Received ${input}`);\n}, ERR_CHILD_PROCESS_STDIO_MAXBUFFER = function(stdio) {\n return Error(`${stdio} maxBuffer length exceeded`);\n}, ERR_UNKNOWN_SIGNAL = function(name) {\n const err = @makeTypeError(`Unknown signal: ${name}`);\n return err.code = \"ERR_UNKNOWN_SIGNAL\", err;\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value\?.toString()}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_INVALID_OPT_VALUE = function(name, value) {\n return @makeTypeError(`The value \"${value}\" is invalid for option \"${name}\"`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value \"${value}\" is invalid for argument '${name}'. Reason: ${reason}`);\n}, ERR_CHILD_PROCESS_IPC_REQUIRED = function(name) {\n const err = @makeTypeError(`Forked processes must have an IPC channel, missing value 'ipc' in ${name}`);\n return err.code = \"ERR_CHILD_PROCESS_IPC_REQUIRED\", err;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), StreamModule = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), {\n constants: { signals }\n} = @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28), { promisify } = @getInternalField(@internalModuleRegistry, 48) || @createInternalModuleById(48), ObjectCreate = Object.create, ObjectAssign = Object.assign, ObjectDefineProperty = Object.defineProperty, BufferConcat = @Buffer.concat, BufferIsEncoding = @Buffer.isEncoding, kEmptyObject = ObjectCreate(null), ArrayPrototypePush = @Array.prototype.push, ArrayPrototypeJoin = @Array.prototype.join, ArrayPrototypeMap = @Array.prototype.map, ArrayPrototypeIncludes = @Array.prototype.includes, ArrayPrototypeSlice = @Array.prototype.slice, ArrayPrototypeUnshift = @Array.prototype.unshift, ArrayPrototypeLastIndexOf = @Array.prototype.lastIndexOf, ArrayPrototypeSplice = @Array.prototype.splice, ArrayIsArray = @Array.isArray, ArrayBufferIsView = @ArrayBuffer.isView, NumberIsInteger = Number.isInteger;\nvar StringPrototypeToUpperCase = @String.prototype.toUpperCase, StringPrototypeIncludes = @String.prototype.includes, StringPrototypeSlice = @String.prototype.slice, Uint8ArrayPrototypeIncludes = @Uint8Array.prototype.includes, MAX_BUFFER = 1048576, NativeWritable, ReadableFromWeb, customPromiseExecFunction = (orig) => {\n return (...args) => {\n let resolve, reject;\n const promise = new @Promise((res, rej) => {\n resolve = res, reject = rej;\n });\n return promise.child = orig(...args, (err, stdout, stderr) => {\n if (err !== null)\n err.stdout = stdout, err.stderr = stderr, reject(err);\n else\n resolve({ stdout, stderr });\n }), promise;\n };\n};\nObjectDefineProperty(exec, promisify.custom, {\n __proto__: null,\n enumerable: !1,\n value: customPromiseExecFunction(exec)\n});\nvar signalsToNamesMapping;\n\nclass ChildProcess extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n #handle;\n #exited = !1;\n #closesNeeded = 1;\n #closesGot = 0;\n connected = !1;\n signalCode = null;\n exitCode = null;\n spawnfile;\n spawnargs;\n pid;\n channel;\n get killed() {\n if (this.#handle == null)\n return !1;\n }\n #handleOnExit(exitCode, signalCode, err) {\n if (this.#exited)\n return;\n if (signalCode)\n this.signalCode = signalCode;\n else\n this.exitCode = exitCode;\n if (this.#stdin)\n this.#stdin.destroy();\n if (this.#handle)\n this.#handle = null;\n if (exitCode < 0) {\n const err2 = new SystemError(`Spawned process exited with error code: ${exitCode}`, @undefined, \"spawn\", \"EUNKNOWN\", \"ERR_CHILD_PROCESS_UNKNOWN_ERROR\");\n if (this.spawnfile)\n err2.path = this.spawnfile;\n err2.spawnargs = ArrayPrototypeSlice.@call(this.spawnargs, 1), this.emit(\"error\", err2);\n } else\n this.emit(\"exit\", this.exitCode, this.signalCode);\n process.nextTick(flushStdio, this), this.#maybeClose(), this.#exited = !0, this.#stdioOptions = [\"destroyed\", \"destroyed\", \"destroyed\"];\n }\n #getBunSpawnIo(i, encoding) {\n NativeWritable ||= StreamModule.NativeWritable, ReadableFromWeb ||= StreamModule.Readable.fromWeb;\n const io = this.#stdioOptions[i];\n switch (i) {\n case 0:\n switch (io) {\n case \"pipe\":\n return new NativeWritable(this.#handle.stdin);\n case \"inherit\":\n return process.stdin || null;\n case \"destroyed\":\n return new ShimmedStdin;\n default:\n return null;\n }\n case 2:\n case 1:\n switch (io) {\n case \"pipe\":\n return ReadableFromWeb(this.#handle[fdToStdioName(i)], { encoding });\n case \"inherit\":\n return process[fdToStdioName(i)] || null;\n case \"destroyed\":\n return new ShimmedStdioOutStream;\n default:\n return null;\n }\n }\n }\n #stdin;\n #stdout;\n #stderr;\n #stdioObject;\n #encoding;\n #stdioOptions;\n #createStdioObject() {\n return Object.create(null, {\n 0: {\n get: () => this.stdin\n },\n 1: {\n get: () => this.stdout\n },\n 2: {\n get: () => this.stderr\n }\n });\n }\n get stdin() {\n return this.#stdin \?\?= this.#getBunSpawnIo(0, this.#encoding);\n }\n get stdout() {\n return this.#stdout \?\?= this.#getBunSpawnIo(1, this.#encoding);\n }\n get stderr() {\n return this.#stderr \?\?= this.#getBunSpawnIo(2, this.#encoding);\n }\n get stdio() {\n return this.#stdioObject \?\?= this.#createStdioObject();\n }\n spawn(options) {\n validateObject(options, \"options\"), validateString(options.file, \"options.file\");\n var file = this.spawnfile = options.file, spawnargs;\n if (options.args == null)\n spawnargs = this.spawnargs = [];\n else\n validateArray(options.args, \"options.args\"), spawnargs = this.spawnargs = options.args;\n const stdio = options.stdio || [\"pipe\", \"pipe\", \"pipe\"], bunStdio = getBunStdioFromOptions(stdio), ipc = @isArray(stdio) && stdio[3] === \"ipc\";\n var env = options.envPairs || @undefined;\n const detachedOption = options.detached;\n if (this.#encoding = options.encoding || @undefined, this.#stdioOptions = bunStdio, this.#handle = Bun.spawn({\n cmd: spawnargs,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2],\n cwd: options.cwd || @undefined,\n env: env || process.env,\n detached: typeof detachedOption !== \"undefined\" \? !!detachedOption : !1,\n onExit: (handle, exitCode, signalCode, err) => {\n this.#handle = handle, this.pid = this.#handle.pid, process.nextTick((exitCode2, signalCode2, err2) => this.#handleOnExit(exitCode2, signalCode2, err2), exitCode, signalCode, err);\n },\n lazy: !0,\n ipc: ipc \? this.#emitIpcMessage.bind(this) : @undefined\n }), this.pid = this.#handle.pid, onSpawnNT(this), ipc)\n this.send = this.#send, this.disconnect = this.#disconnect;\n }\n #emitIpcMessage(message) {\n this.emit(\"message\", message);\n }\n #send(message, handle, options, callback) {\n if (typeof handle === \"function\")\n callback = handle, handle = @undefined, options = @undefined;\n else if (typeof options === \"function\")\n callback = options, options = @undefined;\n else if (options !== @undefined) {\n if (typeof options !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n }\n if (!this.#handle) {\n if (callback)\n process.nextTick(callback, @makeTypeError(\"Process was closed while trying to send message\"));\n else\n this.emit(\"error\", @makeTypeError(\"Process was closed while trying to send message\"));\n return !1;\n }\n try {\n if (this.#handle.send(message), callback)\n process.nextTick(callback);\n return !0;\n } catch (error) {\n if (callback)\n process.nextTick(callback, error);\n else\n this.emit(\"error\", error);\n return !1;\n }\n }\n #disconnect() {\n if (!this.connected) {\n this.emit(\"error\", @makeTypeError(\"Process was closed while trying to send message\"));\n return;\n }\n this.connected = !1, this.#handle.disconnect();\n }\n kill(sig) {\n const signal = sig === 0 \? sig : convertToValidSignal(sig === @undefined \? \"SIGTERM\" : sig);\n if (this.#handle)\n this.#handle.kill(signal);\n return this.#maybeClose(), !0;\n }\n #maybeClose() {\n if (this.#closesGot++, this.#closesGot === this.#closesNeeded)\n this.emit(\"close\", this.exitCode, this.signalCode);\n }\n ref() {\n if (this.#handle)\n this.#handle.ref();\n }\n unref() {\n if (this.#handle)\n this.#handle.unref();\n }\n}\nvar nodeToBunLookup = {\n ignore: null,\n pipe: \"pipe\",\n overlapped: \"pipe\",\n inherit: \"inherit\"\n};\n\nclass ShimmedStdin extends EventEmitter {\n constructor() {\n super();\n }\n write() {\n return !1;\n }\n destroy() {\n }\n end() {\n }\n pipe() {\n }\n}\n\nclass ShimmedStdioOutStream extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n pipe() {\n }\n}\nvar validateAbortSignal = (signal, name) => {\n if (signal !== @undefined && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n};\nvar validateObject = (value, name, options = null) => {\n const allowArray = options\?.allowArray \?\? !1, allowFunction = options\?.allowFunction \?\? !1;\n if (!(options\?.nullable \?\? !1) && value === null || !allowArray && ArrayIsArray.@call(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE(name, \"object\", value);\n}, validateArray = (value, name, minLength = 0) => {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, Error = globalThis.Error, TypeError = globalThis.TypeError, RangeError = globalThis.RangeError;\n\nclass AbortError extends Error {\n code = \"ABORT_ERR\";\n name = \"AbortError\";\n constructor(message = \"The operation was aborted\", options = @undefined) {\n if (options !== @undefined && typeof options !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n }\n}\n\nclass SystemError extends Error {\n path;\n syscall;\n errno;\n code;\n constructor(message, path, syscall, errno, code) {\n super(message);\n this.path = path, this.syscall = syscall, this.errno = errno, this.code = code;\n }\n get name() {\n return \"SystemError\";\n }\n}\n$ = {\n ChildProcess,\n spawn,\n execFile,\n exec,\n fork,\n spawnSync,\n execFileSync,\n execSync\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeCryptoCode = "(function (){\"use strict\";// src/js/out/tmp/node/crypto.ts\nvar getArrayBufferOrView = function(buffer, name, encoding) {\n if (isAnyArrayBuffer(buffer))\n return buffer;\n if (typeof buffer === \"string\") {\n if (encoding === \"buffer\")\n encoding = \"utf8\";\n return Buffer.from(buffer, encoding);\n }\n if (!isArrayBufferView(buffer)) {\n var error = @makeTypeError(`ERR_INVALID_ARG_TYPE: The \"${name}\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, or DataView. Received ` + buffer);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n return buffer;\n}, getCurves = function() {\n return harcoded_curves;\n}, $, __defProp = Object.defineProperty, __getOwnPropNames = Object.getOwnPropertyNames, StreamModule = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), BufferModule = @requireNativeModule(\"buffer\"), StringDecoder = @requireNativeModule(\"string_decoder\").StringDecoder, MAX_STRING_LENGTH = 536870888, Buffer = globalThis.Buffer, EMPTY_BUFFER = Buffer.alloc(0), { isAnyArrayBuffer, isArrayBufferView } = @requireNativeModule(\"util/types\"), crypto = globalThis.crypto, globalCrypto = crypto, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: !0 });\n}, require_safe_buffer = __commonJS({\n \"node_modules/safe-buffer/index.js\"(exports, module) {\n var buffer = BufferModule, Buffer2 = buffer.Buffer;\n function copyProps(src, dst) {\n for (var key in src)\n dst[key] = src[key];\n }\n Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow \? module.exports = buffer : (copyProps(buffer, exports), exports.Buffer = SafeBuffer);\n function SafeBuffer(arg, encodingOrOffset, length) {\n return Buffer2(arg, encodingOrOffset, length);\n }\n SafeBuffer.prototype = Object.create(Buffer2.prototype), copyProps(Buffer2, SafeBuffer), SafeBuffer.from = function(arg, encodingOrOffset, length) {\n if (typeof arg == \"number\")\n @throwTypeError(\"Argument must not be a number\");\n return Buffer2(arg, encodingOrOffset, length);\n }, SafeBuffer.alloc = function(size, fill, encoding) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n var buf = Buffer2(size);\n return fill !== void 0 \? typeof encoding == \"string\" \? buf.fill(fill, encoding) : buf.fill(fill) : buf.fill(0), buf;\n }, SafeBuffer.allocUnsafe = function(size) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n return Buffer2(size);\n }, SafeBuffer.allocUnsafeSlow = function(size) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n return buffer.SlowBuffer(size);\n };\n }\n}), require_browser = __commonJS({\n \"node_modules/randombytes/browser.js\"(exports, module) {\n var MAX_BYTES = 65536, MAX_UINT32 = 4294967295;\n function oldBrowser() {\n throw new Error(`Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11`);\n }\n var Buffer2 = require_safe_buffer().Buffer, crypto2 = globalCrypto;\n crypto2 && crypto2.getRandomValues \? module.exports = randomBytes : module.exports = oldBrowser;\n function randomBytes(size, cb) {\n if (size > MAX_UINT32)\n @throwRangeError(\"requested too many random bytes\");\n var bytes = Buffer2.allocUnsafe(size);\n if (size > 0)\n if (size > MAX_BYTES)\n for (var generated = 0;generated < size; generated += MAX_BYTES)\n crypto2.getRandomValues(bytes.slice(generated, generated + MAX_BYTES));\n else\n crypto2.getRandomValues(bytes);\n return typeof cb == \"function\" \? process.nextTick(function() {\n cb(null, bytes);\n }) : bytes;\n }\n }\n}), require_inherits_browser = __commonJS({\n \"node_modules/inherits/inherits_browser.js\"(exports, module) {\n module.exports = function(ctor, superCtor) {\n superCtor && (ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }));\n };\n }\n}), require_hash_base = __commonJS({\n \"node_modules/hash-base/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, inherits = require_inherits_browser();\n function throwIfNotStringOrBuffer(val, prefix) {\n if (!Buffer2.isBuffer(val) && typeof val != \"string\")\n @throwTypeError(prefix + \" must be a string or a buffer\");\n }\n function HashBase(blockSize) {\n StreamModule.Transform.call(this), this._block = Buffer2.allocUnsafe(blockSize), this._blockSize = blockSize, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = !1;\n }\n inherits(HashBase, StreamModule.Transform), HashBase.prototype._transform = function(chunk, encoding, callback) {\n var error = null;\n try {\n this.update(chunk, encoding);\n } catch (err) {\n error = err;\n }\n callback(error);\n }, HashBase.prototype._flush = function(callback) {\n var error = null;\n try {\n this.push(this.digest());\n } catch (err) {\n error = err;\n }\n callback(error);\n }, HashBase.prototype.update = function(data, encoding) {\n if (throwIfNotStringOrBuffer(data, \"Data\"), this._finalized)\n throw new Error(\"Digest already called\");\n Buffer2.isBuffer(data) || (data = Buffer2.from(data, encoding));\n for (var block = this._block, offset = 0;this._blockOffset + data.length - offset >= this._blockSize; ) {\n for (var i = this._blockOffset;i < this._blockSize; )\n block[i++] = data[offset++];\n this._update(), this._blockOffset = 0;\n }\n for (;offset < data.length; )\n block[this._blockOffset++] = data[offset++];\n for (var j = 0, carry = data.length * 8;carry > 0; ++j)\n this._length[j] += carry, carry = this._length[j] / 4294967296 | 0, carry > 0 && (this._length[j] -= 4294967296 * carry);\n return this;\n }, HashBase.prototype._update = function() {\n throw new Error(\"_update is not implemented\");\n }, HashBase.prototype.digest = function(encoding) {\n if (this._finalized)\n throw new Error(\"Digest already called\");\n this._finalized = !0;\n var digest = this._digest();\n encoding !== void 0 && (digest = digest.toString(encoding)), this._block.fill(0), this._blockOffset = 0;\n for (var i = 0;i < 4; ++i)\n this._length[i] = 0;\n return digest;\n }, HashBase.prototype._digest = function() {\n throw new Error(\"_digest is not implemented\");\n }, module.exports = HashBase;\n }\n}), require_md5 = __commonJS({\n \"node_modules/md5.js/index.js\"(exports, module) {\n var inherits = require_inherits_browser(), HashBase = require_hash_base(), Buffer2 = require_safe_buffer().Buffer, ARRAY16 = new Array(16);\n function MD5() {\n HashBase.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878;\n }\n inherits(MD5, HashBase), MD5.prototype._update = function() {\n for (var M = ARRAY16, i = 0;i < 16; ++i)\n M[i] = this._block.readInt32LE(i * 4);\n var a = this._a, b = this._b, c = this._c, d = this._d;\n a = fnF(a, b, c, d, M[0], 3614090360, 7), d = fnF(d, a, b, c, M[1], 3905402710, 12), c = fnF(c, d, a, b, M[2], 606105819, 17), b = fnF(b, c, d, a, M[3], 3250441966, 22), a = fnF(a, b, c, d, M[4], 4118548399, 7), d = fnF(d, a, b, c, M[5], 1200080426, 12), c = fnF(c, d, a, b, M[6], 2821735955, 17), b = fnF(b, c, d, a, M[7], 4249261313, 22), a = fnF(a, b, c, d, M[8], 1770035416, 7), d = fnF(d, a, b, c, M[9], 2336552879, 12), c = fnF(c, d, a, b, M[10], 4294925233, 17), b = fnF(b, c, d, a, M[11], 2304563134, 22), a = fnF(a, b, c, d, M[12], 1804603682, 7), d = fnF(d, a, b, c, M[13], 4254626195, 12), c = fnF(c, d, a, b, M[14], 2792965006, 17), b = fnF(b, c, d, a, M[15], 1236535329, 22), a = fnG(a, b, c, d, M[1], 4129170786, 5), d = fnG(d, a, b, c, M[6], 3225465664, 9), c = fnG(c, d, a, b, M[11], 643717713, 14), b = fnG(b, c, d, a, M[0], 3921069994, 20), a = fnG(a, b, c, d, M[5], 3593408605, 5), d = fnG(d, a, b, c, M[10], 38016083, 9), c = fnG(c, d, a, b, M[15], 3634488961, 14), b = fnG(b, c, d, a, M[4], 3889429448, 20), a = fnG(a, b, c, d, M[9], 568446438, 5), d = fnG(d, a, b, c, M[14], 3275163606, 9), c = fnG(c, d, a, b, M[3], 4107603335, 14), b = fnG(b, c, d, a, M[8], 1163531501, 20), a = fnG(a, b, c, d, M[13], 2850285829, 5), d = fnG(d, a, b, c, M[2], 4243563512, 9), c = fnG(c, d, a, b, M[7], 1735328473, 14), b = fnG(b, c, d, a, M[12], 2368359562, 20), a = fnH(a, b, c, d, M[5], 4294588738, 4), d = fnH(d, a, b, c, M[8], 2272392833, 11), c = fnH(c, d, a, b, M[11], 1839030562, 16), b = fnH(b, c, d, a, M[14], 4259657740, 23), a = fnH(a, b, c, d, M[1], 2763975236, 4), d = fnH(d, a, b, c, M[4], 1272893353, 11), c = fnH(c, d, a, b, M[7], 4139469664, 16), b = fnH(b, c, d, a, M[10], 3200236656, 23), a = fnH(a, b, c, d, M[13], 681279174, 4), d = fnH(d, a, b, c, M[0], 3936430074, 11), c = fnH(c, d, a, b, M[3], 3572445317, 16), b = fnH(b, c, d, a, M[6], 76029189, 23), a = fnH(a, b, c, d, M[9], 3654602809, 4), d = fnH(d, a, b, c, M[12], 3873151461, 11), c = fnH(c, d, a, b, M[15], 530742520, 16), b = fnH(b, c, d, a, M[2], 3299628645, 23), a = fnI(a, b, c, d, M[0], 4096336452, 6), d = fnI(d, a, b, c, M[7], 1126891415, 10), c = fnI(c, d, a, b, M[14], 2878612391, 15), b = fnI(b, c, d, a, M[5], 4237533241, 21), a = fnI(a, b, c, d, M[12], 1700485571, 6), d = fnI(d, a, b, c, M[3], 2399980690, 10), c = fnI(c, d, a, b, M[10], 4293915773, 15), b = fnI(b, c, d, a, M[1], 2240044497, 21), a = fnI(a, b, c, d, M[8], 1873313359, 6), d = fnI(d, a, b, c, M[15], 4264355552, 10), c = fnI(c, d, a, b, M[6], 2734768916, 15), b = fnI(b, c, d, a, M[13], 1309151649, 21), a = fnI(a, b, c, d, M[4], 4149444226, 6), d = fnI(d, a, b, c, M[11], 3174756917, 10), c = fnI(c, d, a, b, M[2], 718787259, 15), b = fnI(b, c, d, a, M[9], 3951481745, 21), this._a = this._a + a | 0, this._b = this._b + b | 0, this._c = this._c + c | 0, this._d = this._d + d | 0;\n }, MD5.prototype._digest = function() {\n this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();\n var buffer = Buffer2.allocUnsafe(16);\n return buffer.writeInt32LE(this._a, 0), buffer.writeInt32LE(this._b, 4), buffer.writeInt32LE(this._c, 8), buffer.writeInt32LE(this._d, 12), buffer;\n };\n function rotl(x, n) {\n return x << n | x >>> 32 - n;\n }\n function fnF(a, b, c, d, m, k, s) {\n return rotl(a + (b & c | ~b & d) + m + k | 0, s) + b | 0;\n }\n function fnG(a, b, c, d, m, k, s) {\n return rotl(a + (b & d | c & ~d) + m + k | 0, s) + b | 0;\n }\n function fnH(a, b, c, d, m, k, s) {\n return rotl(a + (b ^ c ^ d) + m + k | 0, s) + b | 0;\n }\n function fnI(a, b, c, d, m, k, s) {\n return rotl(a + (c ^ (b | ~d)) + m + k | 0, s) + b | 0;\n }\n module.exports = MD5;\n }\n}), require_ripemd160 = __commonJS({\n \"node_modules/ripemd160/index.js\"(exports, module) {\n var Buffer2 = Buffer, inherits = require_inherits_browser(), HashBase = require_hash_base(), ARRAY16 = new Array(16), zl = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 7,\n 4,\n 13,\n 1,\n 10,\n 6,\n 15,\n 3,\n 12,\n 0,\n 9,\n 5,\n 2,\n 14,\n 11,\n 8,\n 3,\n 10,\n 14,\n 4,\n 9,\n 15,\n 8,\n 1,\n 2,\n 7,\n 0,\n 6,\n 13,\n 11,\n 5,\n 12,\n 1,\n 9,\n 11,\n 10,\n 0,\n 8,\n 12,\n 4,\n 13,\n 3,\n 7,\n 15,\n 14,\n 5,\n 6,\n 2,\n 4,\n 0,\n 5,\n 9,\n 7,\n 12,\n 2,\n 10,\n 14,\n 1,\n 3,\n 8,\n 11,\n 6,\n 15,\n 13\n ], zr = [\n 5,\n 14,\n 7,\n 0,\n 9,\n 2,\n 11,\n 4,\n 13,\n 6,\n 15,\n 8,\n 1,\n 10,\n 3,\n 12,\n 6,\n 11,\n 3,\n 7,\n 0,\n 13,\n 5,\n 10,\n 14,\n 15,\n 8,\n 12,\n 4,\n 9,\n 1,\n 2,\n 15,\n 5,\n 1,\n 3,\n 7,\n 14,\n 6,\n 9,\n 11,\n 8,\n 12,\n 2,\n 10,\n 0,\n 4,\n 13,\n 8,\n 6,\n 4,\n 1,\n 3,\n 11,\n 15,\n 0,\n 5,\n 12,\n 2,\n 13,\n 9,\n 7,\n 10,\n 14,\n 12,\n 15,\n 10,\n 4,\n 1,\n 5,\n 8,\n 7,\n 6,\n 2,\n 13,\n 14,\n 0,\n 3,\n 9,\n 11\n ], sl = [\n 11,\n 14,\n 15,\n 12,\n 5,\n 8,\n 7,\n 9,\n 11,\n 13,\n 14,\n 15,\n 6,\n 7,\n 9,\n 8,\n 7,\n 6,\n 8,\n 13,\n 11,\n 9,\n 7,\n 15,\n 7,\n 12,\n 15,\n 9,\n 11,\n 7,\n 13,\n 12,\n 11,\n 13,\n 6,\n 7,\n 14,\n 9,\n 13,\n 15,\n 14,\n 8,\n 13,\n 6,\n 5,\n 12,\n 7,\n 5,\n 11,\n 12,\n 14,\n 15,\n 14,\n 15,\n 9,\n 8,\n 9,\n 14,\n 5,\n 6,\n 8,\n 6,\n 5,\n 12,\n 9,\n 15,\n 5,\n 11,\n 6,\n 8,\n 13,\n 12,\n 5,\n 12,\n 13,\n 14,\n 11,\n 8,\n 5,\n 6\n ], sr = [\n 8,\n 9,\n 9,\n 11,\n 13,\n 15,\n 15,\n 5,\n 7,\n 7,\n 8,\n 11,\n 14,\n 14,\n 12,\n 6,\n 9,\n 13,\n 15,\n 7,\n 12,\n 8,\n 9,\n 11,\n 7,\n 7,\n 12,\n 7,\n 6,\n 15,\n 13,\n 11,\n 9,\n 7,\n 15,\n 11,\n 8,\n 6,\n 6,\n 14,\n 12,\n 13,\n 5,\n 14,\n 13,\n 13,\n 7,\n 5,\n 15,\n 5,\n 8,\n 11,\n 14,\n 14,\n 6,\n 14,\n 6,\n 9,\n 12,\n 9,\n 12,\n 5,\n 15,\n 8,\n 8,\n 5,\n 12,\n 9,\n 12,\n 5,\n 14,\n 6,\n 8,\n 13,\n 6,\n 5,\n 15,\n 13,\n 11,\n 11\n ], hl = [0, 1518500249, 1859775393, 2400959708, 2840853838], hr = [1352829926, 1548603684, 1836072691, 2053994217, 0];\n function RIPEMD160() {\n HashBase.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520;\n }\n inherits(RIPEMD160, HashBase), RIPEMD160.prototype._update = function() {\n for (var words = ARRAY16, j = 0;j < 16; ++j)\n words[j] = this._block.readInt32LE(j * 4);\n for (var al = this._a | 0, bl = this._b | 0, cl = this._c | 0, dl = this._d | 0, el = this._e | 0, ar = this._a | 0, br = this._b | 0, cr = this._c | 0, dr = this._d | 0, er = this._e | 0, i = 0;i < 80; i += 1) {\n var tl, tr;\n i < 16 \? (tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i]), tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])) : i < 32 \? (tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i]), tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])) : i < 48 \? (tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i]), tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])) : i < 64 \? (tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i]), tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])) : (tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i]), tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])), al = el, el = dl, dl = rotl(cl, 10), cl = bl, bl = tl, ar = er, er = dr, dr = rotl(cr, 10), cr = br, br = tr;\n }\n var t = this._b + cl + dr | 0;\n this._b = this._c + dl + er | 0, this._c = this._d + el + ar | 0, this._d = this._e + al + br | 0, this._e = this._a + bl + cr | 0, this._a = t;\n }, RIPEMD160.prototype._digest = function() {\n this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();\n var buffer = Buffer2.alloc \? Buffer2.alloc(20) : new Buffer2(20);\n return buffer.writeInt32LE(this._a, 0), buffer.writeInt32LE(this._b, 4), buffer.writeInt32LE(this._c, 8), buffer.writeInt32LE(this._d, 12), buffer.writeInt32LE(this._e, 16), buffer;\n };\n function rotl(x, n) {\n return x << n | x >>> 32 - n;\n }\n function fn1(a, b, c, d, e, m, k, s) {\n return rotl(a + (b ^ c ^ d) + m + k | 0, s) + e | 0;\n }\n function fn2(a, b, c, d, e, m, k, s) {\n return rotl(a + (b & c | ~b & d) + m + k | 0, s) + e | 0;\n }\n function fn3(a, b, c, d, e, m, k, s) {\n return rotl(a + ((b | ~c) ^ d) + m + k | 0, s) + e | 0;\n }\n function fn4(a, b, c, d, e, m, k, s) {\n return rotl(a + (b & d | c & ~d) + m + k | 0, s) + e | 0;\n }\n function fn5(a, b, c, d, e, m, k, s) {\n return rotl(a + (b ^ (c | ~d)) + m + k | 0, s) + e | 0;\n }\n module.exports = RIPEMD160;\n }\n}), require_hash = __commonJS({\n \"node_modules/sha.js/hash.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n function Hash(blockSize, finalSize) {\n this._block = Buffer2.alloc(blockSize), this._finalSize = finalSize, this._blockSize = blockSize, this._len = 0;\n }\n Hash.prototype = {}, Hash.prototype.update = function(data, enc) {\n typeof data == \"string\" && (enc = enc || \"utf8\", data = Buffer2.from(data, enc));\n for (var block = this._block, blockSize = this._blockSize, length = data.length, accum = this._len, offset = 0;offset < length; ) {\n for (var assigned = accum % blockSize, remainder = Math.min(length - offset, blockSize - assigned), i = 0;i < remainder; i++)\n block[assigned + i] = data[offset + i];\n accum += remainder, offset += remainder, accum % blockSize === 0 && this._update(block);\n }\n return this._len += length, this;\n }, Hash.prototype.digest = function(enc) {\n var rem = this._len % this._blockSize;\n this._block[rem] = 128, this._block.fill(0, rem + 1), rem >= this._finalSize && (this._update(this._block), this._block.fill(0));\n var bits = this._len * 8;\n if (bits <= 4294967295)\n this._block.writeUInt32BE(bits, this._blockSize - 4);\n else {\n var lowBits = (bits & 4294967295) >>> 0, highBits = (bits - lowBits) / 4294967296;\n this._block.writeUInt32BE(highBits, this._blockSize - 8), this._block.writeUInt32BE(lowBits, this._blockSize - 4);\n }\n this._update(this._block);\n var hash = this._hash();\n return enc \? hash.toString(enc) : hash;\n }, Hash.prototype._update = function() {\n throw new Error(\"_update must be implemented by subclass\");\n }, module.exports = Hash;\n }\n}), require_sha = __commonJS({\n \"node_modules/sha.js/sha.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [1518500249, 1859775393, -1894007588, -899497514], W = new Array(80);\n function Sha() {\n this.init(), this._w = W, Hash.call(this, 64, 56);\n }\n inherits(Sha, Hash), Sha.prototype.init = function() {\n return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;\n };\n function rotl5(num) {\n return num << 5 | num >>> 27;\n }\n function rotl30(num) {\n return num << 30 | num >>> 2;\n }\n function ft(s, b, c, d) {\n return s === 0 \? b & c | ~b & d : s === 2 \? b & c | b & d | c & d : b ^ c ^ d;\n }\n Sha.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 80; ++i)\n W2[i] = W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16];\n for (var j = 0;j < 80; ++j) {\n var s = ~~(j / 20), t = rotl5(a) + ft(s, b, c, d) + e + W2[j] + K[s] | 0;\n e = d, d = c, c = rotl30(b), b = a, a = t;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0;\n }, Sha.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(20);\n return H.writeInt32BE(this._a | 0, 0), H.writeInt32BE(this._b | 0, 4), H.writeInt32BE(this._c | 0, 8), H.writeInt32BE(this._d | 0, 12), H.writeInt32BE(this._e | 0, 16), H;\n }, module.exports = Sha;\n }\n}), require_sha1 = __commonJS({\n \"node_modules/sha.js/sha1.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [1518500249, 1859775393, -1894007588, -899497514], W = new Array(80);\n function Sha1() {\n this.init(), this._w = W, Hash.call(this, 64, 56);\n }\n inherits(Sha1, Hash), Sha1.prototype.init = function() {\n return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;\n };\n function rotl1(num) {\n return num << 1 | num >>> 31;\n }\n function rotl5(num) {\n return num << 5 | num >>> 27;\n }\n function rotl30(num) {\n return num << 30 | num >>> 2;\n }\n function ft(s, b, c, d) {\n return s === 0 \? b & c | ~b & d : s === 2 \? b & c | b & d | c & d : b ^ c ^ d;\n }\n Sha1.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 80; ++i)\n W2[i] = rotl1(W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16]);\n for (var j = 0;j < 80; ++j) {\n var s = ~~(j / 20), t = rotl5(a) + ft(s, b, c, d) + e + W2[j] + K[s] | 0;\n e = d, d = c, c = rotl30(b), b = a, a = t;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0;\n }, Sha1.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(20);\n return H.writeInt32BE(this._a | 0, 0), H.writeInt32BE(this._b | 0, 4), H.writeInt32BE(this._c | 0, 8), H.writeInt32BE(this._d | 0, 12), H.writeInt32BE(this._e | 0, 16), H;\n }, module.exports = Sha1;\n }\n}), require_sha256 = __commonJS({\n \"node_modules/sha.js/sha256.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [\n 1116352408,\n 1899447441,\n 3049323471,\n 3921009573,\n 961987163,\n 1508970993,\n 2453635748,\n 2870763221,\n 3624381080,\n 310598401,\n 607225278,\n 1426881987,\n 1925078388,\n 2162078206,\n 2614888103,\n 3248222580,\n 3835390401,\n 4022224774,\n 264347078,\n 604807628,\n 770255983,\n 1249150122,\n 1555081692,\n 1996064986,\n 2554220882,\n 2821834349,\n 2952996808,\n 3210313671,\n 3336571891,\n 3584528711,\n 113926993,\n 338241895,\n 666307205,\n 773529912,\n 1294757372,\n 1396182291,\n 1695183700,\n 1986661051,\n 2177026350,\n 2456956037,\n 2730485921,\n 2820302411,\n 3259730800,\n 3345764771,\n 3516065817,\n 3600352804,\n 4094571909,\n 275423344,\n 430227734,\n 506948616,\n 659060556,\n 883997877,\n 958139571,\n 1322822218,\n 1537002063,\n 1747873779,\n 1955562222,\n 2024104815,\n 2227730452,\n 2361852424,\n 2428436474,\n 2756734187,\n 3204031479,\n 3329325298\n ], W = new Array(64);\n function Sha256() {\n this.init(), this._w = W, Hash.call(this, 64, 56);\n }\n inherits(Sha256, Hash), Sha256.prototype.init = function() {\n return this._a = 1779033703, this._b = 3144134277, this._c = 1013904242, this._d = 2773480762, this._e = 1359893119, this._f = 2600822924, this._g = 528734635, this._h = 1541459225, this;\n };\n function ch(x, y, z) {\n return z ^ x & (y ^ z);\n }\n function maj(x, y, z) {\n return x & y | z & (x | y);\n }\n function sigma0(x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10);\n }\n function sigma1(x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7);\n }\n function gamma0(x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ x >>> 3;\n }\n function gamma1(x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ x >>> 10;\n }\n Sha256.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, f = this._f | 0, g = this._g | 0, h = this._h | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 64; ++i)\n W2[i] = gamma1(W2[i - 2]) + W2[i - 7] + gamma0(W2[i - 15]) + W2[i - 16] | 0;\n for (var j = 0;j < 64; ++j) {\n var T1 = h + sigma1(e) + ch(e, f, g) + K[j] + W2[j] | 0, T2 = sigma0(a) + maj(a, b, c) | 0;\n h = g, g = f, f = e, e = d + T1 | 0, d = c, c = b, b = a, a = T1 + T2 | 0;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0, this._f = f + this._f | 0, this._g = g + this._g | 0, this._h = h + this._h | 0;\n }, Sha256.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(32);\n return H.writeInt32BE(this._a, 0), H.writeInt32BE(this._b, 4), H.writeInt32BE(this._c, 8), H.writeInt32BE(this._d, 12), H.writeInt32BE(this._e, 16), H.writeInt32BE(this._f, 20), H.writeInt32BE(this._g, 24), H.writeInt32BE(this._h, 28), H;\n }, module.exports = Sha256;\n }\n}), require_sha224 = __commonJS({\n \"node_modules/sha.js/sha224.js\"(exports, module) {\n var inherits = require_inherits_browser(), Sha256 = require_sha256(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, W = new Array(64);\n function Sha224() {\n this.init(), this._w = W, Hash.call(this, 64, 56);\n }\n inherits(Sha224, Sha256), Sha224.prototype.init = function() {\n return this._a = 3238371032, this._b = 914150663, this._c = 812702999, this._d = 4144912697, this._e = 4290775857, this._f = 1750603025, this._g = 1694076839, this._h = 3204075428, this;\n }, Sha224.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(28);\n return H.writeInt32BE(this._a, 0), H.writeInt32BE(this._b, 4), H.writeInt32BE(this._c, 8), H.writeInt32BE(this._d, 12), H.writeInt32BE(this._e, 16), H.writeInt32BE(this._f, 20), H.writeInt32BE(this._g, 24), H;\n }, module.exports = Sha224;\n }\n}), require_sha512 = __commonJS({\n \"node_modules/sha.js/sha512.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [\n 1116352408,\n 3609767458,\n 1899447441,\n 602891725,\n 3049323471,\n 3964484399,\n 3921009573,\n 2173295548,\n 961987163,\n 4081628472,\n 1508970993,\n 3053834265,\n 2453635748,\n 2937671579,\n 2870763221,\n 3664609560,\n 3624381080,\n 2734883394,\n 310598401,\n 1164996542,\n 607225278,\n 1323610764,\n 1426881987,\n 3590304994,\n 1925078388,\n 4068182383,\n 2162078206,\n 991336113,\n 2614888103,\n 633803317,\n 3248222580,\n 3479774868,\n 3835390401,\n 2666613458,\n 4022224774,\n 944711139,\n 264347078,\n 2341262773,\n 604807628,\n 2007800933,\n 770255983,\n 1495990901,\n 1249150122,\n 1856431235,\n 1555081692,\n 3175218132,\n 1996064986,\n 2198950837,\n 2554220882,\n 3999719339,\n 2821834349,\n 766784016,\n 2952996808,\n 2566594879,\n 3210313671,\n 3203337956,\n 3336571891,\n 1034457026,\n 3584528711,\n 2466948901,\n 113926993,\n 3758326383,\n 338241895,\n 168717936,\n 666307205,\n 1188179964,\n 773529912,\n 1546045734,\n 1294757372,\n 1522805485,\n 1396182291,\n 2643833823,\n 1695183700,\n 2343527390,\n 1986661051,\n 1014477480,\n 2177026350,\n 1206759142,\n 2456956037,\n 344077627,\n 2730485921,\n 1290863460,\n 2820302411,\n 3158454273,\n 3259730800,\n 3505952657,\n 3345764771,\n 106217008,\n 3516065817,\n 3606008344,\n 3600352804,\n 1432725776,\n 4094571909,\n 1467031594,\n 275423344,\n 851169720,\n 430227734,\n 3100823752,\n 506948616,\n 1363258195,\n 659060556,\n 3750685593,\n 883997877,\n 3785050280,\n 958139571,\n 3318307427,\n 1322822218,\n 3812723403,\n 1537002063,\n 2003034995,\n 1747873779,\n 3602036899,\n 1955562222,\n 1575990012,\n 2024104815,\n 1125592928,\n 2227730452,\n 2716904306,\n 2361852424,\n 442776044,\n 2428436474,\n 593698344,\n 2756734187,\n 3733110249,\n 3204031479,\n 2999351573,\n 3329325298,\n 3815920427,\n 3391569614,\n 3928383900,\n 3515267271,\n 566280711,\n 3940187606,\n 3454069534,\n 4118630271,\n 4000239992,\n 116418474,\n 1914138554,\n 174292421,\n 2731055270,\n 289380356,\n 3203993006,\n 460393269,\n 320620315,\n 685471733,\n 587496836,\n 852142971,\n 1086792851,\n 1017036298,\n 365543100,\n 1126000580,\n 2618297676,\n 1288033470,\n 3409855158,\n 1501505948,\n 4234509866,\n 1607167915,\n 987167468,\n 1816402316,\n 1246189591\n ], W = new Array(160);\n function Sha512() {\n this.init(), this._w = W, Hash.call(this, 128, 112);\n }\n inherits(Sha512, Hash), Sha512.prototype.init = function() {\n return this._ah = 1779033703, this._bh = 3144134277, this._ch = 1013904242, this._dh = 2773480762, this._eh = 1359893119, this._fh = 2600822924, this._gh = 528734635, this._hh = 1541459225, this._al = 4089235720, this._bl = 2227873595, this._cl = 4271175723, this._dl = 1595750129, this._el = 2917565137, this._fl = 725511199, this._gl = 4215389547, this._hl = 327033209, this;\n };\n function Ch(x, y, z) {\n return z ^ x & (y ^ z);\n }\n function maj(x, y, z) {\n return x & y | z & (x | y);\n }\n function sigma0(x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25);\n }\n function sigma1(x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23);\n }\n function Gamma0(x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ x >>> 7;\n }\n function Gamma0l(x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25);\n }\n function Gamma1(x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ x >>> 6;\n }\n function Gamma1l(x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26);\n }\n function getCarry(a, b) {\n return a >>> 0 < b >>> 0 \? 1 : 0;\n }\n Sha512.prototype._update = function(M) {\n for (var W2 = this._w, ah = this._ah | 0, bh = this._bh | 0, ch = this._ch | 0, dh = this._dh | 0, eh = this._eh | 0, fh = this._fh | 0, gh = this._gh | 0, hh = this._hh | 0, al = this._al | 0, bl = this._bl | 0, cl = this._cl | 0, dl = this._dl | 0, el = this._el | 0, fl = this._fl | 0, gl = this._gl | 0, hl = this._hl | 0, i = 0;i < 32; i += 2)\n W2[i] = M.readInt32BE(i * 4), W2[i + 1] = M.readInt32BE(i * 4 + 4);\n for (;i < 160; i += 2) {\n var xh = W2[i - 30], xl = W2[i - 30 + 1], gamma0 = Gamma0(xh, xl), gamma0l = Gamma0l(xl, xh);\n xh = W2[i - 4], xl = W2[i - 4 + 1];\n var gamma1 = Gamma1(xh, xl), gamma1l = Gamma1l(xl, xh), Wi7h = W2[i - 14], Wi7l = W2[i - 14 + 1], Wi16h = W2[i - 32], Wi16l = W2[i - 32 + 1], Wil = gamma0l + Wi7l | 0, Wih = gamma0 + Wi7h + getCarry(Wil, gamma0l) | 0;\n Wil = Wil + gamma1l | 0, Wih = Wih + gamma1 + getCarry(Wil, gamma1l) | 0, Wil = Wil + Wi16l | 0, Wih = Wih + Wi16h + getCarry(Wil, Wi16l) | 0, W2[i] = Wih, W2[i + 1] = Wil;\n }\n for (var j = 0;j < 160; j += 2) {\n Wih = W2[j], Wil = W2[j + 1];\n var majh = maj(ah, bh, ch), majl = maj(al, bl, cl), sigma0h = sigma0(ah, al), sigma0l = sigma0(al, ah), sigma1h = sigma1(eh, el), sigma1l = sigma1(el, eh), Kih = K[j], Kil = K[j + 1], chh = Ch(eh, fh, gh), chl = Ch(el, fl, gl), t1l = hl + sigma1l | 0, t1h = hh + sigma1h + getCarry(t1l, hl) | 0;\n t1l = t1l + chl | 0, t1h = t1h + chh + getCarry(t1l, chl) | 0, t1l = t1l + Kil | 0, t1h = t1h + Kih + getCarry(t1l, Kil) | 0, t1l = t1l + Wil | 0, t1h = t1h + Wih + getCarry(t1l, Wil) | 0;\n var t2l = sigma0l + majl | 0, t2h = sigma0h + majh + getCarry(t2l, sigma0l) | 0;\n hh = gh, hl = gl, gh = fh, gl = fl, fh = eh, fl = el, el = dl + t1l | 0, eh = dh + t1h + getCarry(el, dl) | 0, dh = ch, dl = cl, ch = bh, cl = bl, bh = ah, bl = al, al = t1l + t2l | 0, ah = t1h + t2h + getCarry(al, t1l) | 0;\n }\n this._al = this._al + al | 0, this._bl = this._bl + bl | 0, this._cl = this._cl + cl | 0, this._dl = this._dl + dl | 0, this._el = this._el + el | 0, this._fl = this._fl + fl | 0, this._gl = this._gl + gl | 0, this._hl = this._hl + hl | 0, this._ah = this._ah + ah + getCarry(this._al, al) | 0, this._bh = this._bh + bh + getCarry(this._bl, bl) | 0, this._ch = this._ch + ch + getCarry(this._cl, cl) | 0, this._dh = this._dh + dh + getCarry(this._dl, dl) | 0, this._eh = this._eh + eh + getCarry(this._el, el) | 0, this._fh = this._fh + fh + getCarry(this._fl, fl) | 0, this._gh = this._gh + gh + getCarry(this._gl, gl) | 0, this._hh = this._hh + hh + getCarry(this._hl, hl) | 0;\n }, Sha512.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(64);\n function writeInt64BE(h, l, offset) {\n H.writeInt32BE(h, offset), H.writeInt32BE(l, offset + 4);\n }\n return writeInt64BE(this._ah, this._al, 0), writeInt64BE(this._bh, this._bl, 8), writeInt64BE(this._ch, this._cl, 16), writeInt64BE(this._dh, this._dl, 24), writeInt64BE(this._eh, this._el, 32), writeInt64BE(this._fh, this._fl, 40), writeInt64BE(this._gh, this._gl, 48), writeInt64BE(this._hh, this._hl, 56), H;\n }, module.exports = Sha512;\n }\n}), require_sha384 = __commonJS({\n \"node_modules/sha.js/sha384.js\"(exports, module) {\n var inherits = require_inherits_browser(), SHA512 = require_sha512(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, W = new Array(160);\n function Sha384() {\n this.init(), this._w = W, Hash.call(this, 128, 112);\n }\n inherits(Sha384, SHA512), Sha384.prototype.init = function() {\n return this._ah = 3418070365, this._bh = 1654270250, this._ch = 2438529370, this._dh = 355462360, this._eh = 1731405415, this._fh = 2394180231, this._gh = 3675008525, this._hh = 1203062813, this._al = 3238371032, this._bl = 914150663, this._cl = 812702999, this._dl = 4144912697, this._el = 4290775857, this._fl = 1750603025, this._gl = 1694076839, this._hl = 3204075428, this;\n }, Sha384.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(48);\n function writeInt64BE(h, l, offset) {\n H.writeInt32BE(h, offset), H.writeInt32BE(l, offset + 4);\n }\n return writeInt64BE(this._ah, this._al, 0), writeInt64BE(this._bh, this._bl, 8), writeInt64BE(this._ch, this._cl, 16), writeInt64BE(this._dh, this._dl, 24), writeInt64BE(this._eh, this._el, 32), writeInt64BE(this._fh, this._fl, 40), H;\n }, module.exports = Sha384;\n }\n}), require_sha2 = __commonJS({\n \"node_modules/sha.js/index.js\"(exports, module) {\n var exports = module.exports = function(algorithm) {\n algorithm = algorithm.toLowerCase();\n var Algorithm = exports[algorithm];\n if (!Algorithm)\n throw new Error(algorithm + \" is not supported (we accept pull requests)\");\n return new Algorithm;\n };\n exports.sha = require_sha(), exports.sha1 = require_sha1(), exports.sha224 = require_sha224(), exports.sha256 = require_sha256(), exports.sha384 = require_sha384(), exports.sha512 = require_sha512();\n }\n}), require_cipher_base = __commonJS({\n \"node_modules/cipher-base/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, inherits = require_inherits_browser();\n function CipherBase(hashMode) {\n StreamModule.Transform.call(this), this.hashMode = typeof hashMode == \"string\", this.hashMode \? this[hashMode] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null;\n }\n inherits(CipherBase, StreamModule.Transform), CipherBase.prototype.update = function(data, inputEnc, outputEnc) {\n typeof data == \"string\" && (data = Buffer2.from(data, inputEnc));\n var outData = this._update(data);\n return this.hashMode \? this : (outputEnc && (outData = this._toString(outData, outputEnc)), outData);\n }, CipherBase.prototype.setAutoPadding = function() {\n }, CipherBase.prototype.getAuthTag = function() {\n throw new Error(\"trying to get auth tag in unsupported state\");\n }, CipherBase.prototype.setAuthTag = function() {\n throw new Error(\"trying to set auth tag in unsupported state\");\n }, CipherBase.prototype.setAAD = function() {\n throw new Error(\"trying to set aad in unsupported state\");\n }, CipherBase.prototype._transform = function(data, _, next) {\n var err;\n try {\n this.hashMode \? this._update(data) : this.push(this._update(data));\n } catch (e) {\n err = e;\n } finally {\n next(err);\n }\n }, CipherBase.prototype._flush = function(done) {\n var err;\n try {\n this.push(this.__final());\n } catch (e) {\n err = e;\n }\n done(err);\n }, CipherBase.prototype._finalOrDigest = function(outputEnc) {\n var outData = this.__final() || Buffer2.alloc(0);\n return outputEnc && (outData = this._toString(outData, outputEnc, !0)), outData;\n }, CipherBase.prototype._toString = function(value, enc, fin) {\n if (this._decoder || (this._decoder = new StringDecoder(enc), this._encoding = enc), this._encoding !== enc)\n throw new Error(\"can't switch encodings\");\n var out = this._decoder.write(value);\n return fin && (out += this._decoder.end()), out;\n }, module.exports = CipherBase;\n }\n}), require_browser2 = __commonJS({\n \"node_modules/create-hash/browser.js\"(exports, module) {\n const LazyHash = function Hash(algorithm, options) {\n this._options = options, this._hasher = new CryptoHasher(algorithm, options), this._finalized = !1;\n };\n LazyHash.prototype = Object.create(StreamModule.Transform.prototype), LazyHash.prototype.update = function update(data, encoding) {\n return this._checkFinalized(), this._hasher.update(data, encoding), this;\n }, LazyHash.prototype.digest = function update(data, encoding) {\n return this._checkFinalized(), this._finalized = !0, this._hasher.digest(data, encoding);\n }, LazyHash.prototype._checkFinalized = function _checkFinalized() {\n if (this._finalized) {\n var err = new Error(\"Digest already called\");\n throw err.code = \"ERR_CRYPTO_HASH_FINALIZED\", err;\n }\n }, LazyHash.prototype.copy = function copy() {\n const copy = Object.create(LazyHash.prototype);\n return copy._options = this._options, copy._hasher = this._hasher.copy(), copy._finalized = this._finalized, copy;\n };\n const lazyHashFullInitProto = {\n __proto__: StreamModule.Transform.prototype,\n ...LazyHash.prototype,\n _transform(data, encoding, callback) {\n this.update(data, encoding), callback && callback();\n },\n _flush(callback) {\n this.push(this.digest()), callback();\n }\n }, triggerMethods = [\n \"_events\",\n \"_eventsCount\",\n \"_final\",\n \"_maxListeners\",\n \"_maxListeners\",\n \"_read\",\n \"_undestroy\",\n \"_writableState\",\n \"_write\",\n \"_writev\",\n \"addListener\",\n \"asIndexedPairs\",\n \"closed\",\n \"compose\",\n \"constructor\",\n \"cork\",\n \"destroy\",\n \"destroyed\",\n \"drop\",\n \"emit\",\n \"end\",\n \"errored\",\n \"eventNames\",\n \"every\",\n \"filter\",\n \"find\",\n \"flatMap\",\n \"forEach\",\n \"getMaxListeners\",\n \"hasOwnProperty\",\n \"isPaused\",\n \"isPrototypeOf\",\n \"iterator\",\n \"listenerCount\",\n \"listeners\",\n \"map\",\n \"off\",\n \"on\",\n \"once\",\n \"pause\",\n \"pipe\",\n \"prependListener\",\n \"prependOnceListener\",\n \"propertyIsEnumerable\",\n \"push\",\n \"rawListeners\",\n \"read\",\n \"readable\",\n \"readableAborted\",\n \"readableBuffer\",\n \"readableDidRead\",\n \"readableEncoding\",\n \"readableEnded\",\n \"readableFlowing\",\n \"readableHighWaterMark\",\n \"readableLength\",\n \"readableObjectMode\",\n \"reduce\",\n \"removeAllListeners\",\n \"removeListener\",\n \"resume\",\n \"setDefaultEncoding\",\n \"setEncoding\",\n \"setMaxListeners\",\n \"some\",\n \"take\",\n \"toArray\",\n \"toLocaleString\",\n \"toString\",\n \"uncork\",\n \"unpipe\",\n \"unshift\",\n \"valueOf\",\n \"wrap\",\n \"writable\",\n \"writableBuffer\",\n \"writableCorked\",\n \"writableEnded\",\n \"writableFinished\",\n \"writableHighWaterMark\",\n \"writableLength\",\n \"writableNeedDrain\",\n \"writableObjectMode\",\n \"write\"\n ];\n for (let method of triggerMethods)\n Object.defineProperty(LazyHash.prototype, method, {\n get() {\n return Object.setPrototypeOf(this, lazyHashFullInitProto), StreamModule.Transform.call(this, this._options), this[method];\n },\n enumerable: !1,\n configurable: !0\n });\n module.exports = function createHash(algorithm) {\n return new LazyHash(algorithm);\n }, module.exports.createHash = module.exports, module.exports.Hash = LazyHash;\n }\n}), require_legacy = __commonJS({\n \"node_modules/create-hmac/legacy.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safe_buffer().Buffer, Base = require_cipher_base(), ZEROS = Buffer2.alloc(128), blocksize = 64;\n function Hmac(alg, key) {\n Base.call(this, \"digest\"), typeof key == \"string\" && (key = Buffer2.from(key)), this._alg = alg, this._key = key, key.length > blocksize \? key = alg(key) : key.length < blocksize && (key = Buffer2.concat([key, ZEROS], blocksize));\n for (var ipad = this._ipad = Buffer2.allocUnsafe(blocksize), opad = this._opad = Buffer2.allocUnsafe(blocksize), i = 0;i < blocksize; i++)\n ipad[i] = key[i] ^ 54, opad[i] = key[i] ^ 92;\n this._hash = [ipad];\n }\n Hmac.prototype = {}, inherits(Hmac, Base), Hmac.prototype._update = function(data) {\n this._hash.push(data);\n }, Hmac.prototype._final = function() {\n var h = this._alg(Buffer2.concat(this._hash));\n return this._alg(Buffer2.concat([this._opad, h]));\n }, module.exports = Hmac;\n }\n}), require_md52 = __commonJS({\n \"node_modules/create-hash/md5.js\"(exports, module) {\n var MD5 = require_md5();\n module.exports = function(buffer) {\n return new MD5().update(buffer).digest();\n };\n }\n}), require_browser3 = __commonJS({\n \"node_modules/create-hmac/browser.js\"(exports, module) {\n var inherits = require_inherits_browser(), Legacy = require_legacy(), Base = require_cipher_base(), Buffer2 = require_safe_buffer().Buffer, md5 = require_md52(), RIPEMD160 = require_ripemd160(), sha = require_sha2(), ZEROS = Buffer2.alloc(128);\n function Hmac(alg, key) {\n Base.call(this, \"digest\"), typeof key == \"string\" && (key = Buffer2.from(key));\n var blocksize = alg === \"sha512\" || alg === \"sha384\" \? 128 : 64;\n if (this._alg = alg, this._key = key, key.length > blocksize) {\n var hash = alg === \"rmd160\" \? new RIPEMD160 : sha(alg);\n key = hash.update(key).digest();\n } else\n key.length < blocksize && (key = Buffer2.concat([key, ZEROS], blocksize));\n for (var ipad = this._ipad = Buffer2.allocUnsafe(blocksize), opad = this._opad = Buffer2.allocUnsafe(blocksize), i = 0;i < blocksize; i++)\n ipad[i] = key[i] ^ 54, opad[i] = key[i] ^ 92;\n this._hash = alg === \"rmd160\" \? new RIPEMD160 : sha(alg), this._hash.update(ipad);\n }\n inherits(Hmac, Base), Hmac.prototype._update = function(data) {\n this._hash.update(data);\n }, Hmac.prototype._final = function() {\n var h = this._hash.digest(), hash = this._alg === \"rmd160\" \? new RIPEMD160 : sha(this._alg);\n return hash.update(this._opad).update(h).digest();\n }, module.exports = function(alg, key) {\n return alg = alg.toLowerCase(), alg === \"rmd160\" || alg === \"ripemd160\" \? new Hmac(\"rmd160\", key) : alg === \"md5\" \? new Legacy(md5, key) : new Hmac(alg, key);\n };\n }\n}), require_algorithms = __commonJS({\n \"node_modules/browserify-sign/browser/algorithms.json\"(exports, module) {\n module.exports = {\n sha224WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha224\",\n id: \"302d300d06096086480165030402040500041c\"\n },\n \"RSA-SHA224\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha224\",\n id: \"302d300d06096086480165030402040500041c\"\n },\n sha256WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha256\",\n id: \"3031300d060960864801650304020105000420\"\n },\n \"RSA-SHA256\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha256\",\n id: \"3031300d060960864801650304020105000420\"\n },\n sha384WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha384\",\n id: \"3041300d060960864801650304020205000430\"\n },\n \"RSA-SHA384\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha384\",\n id: \"3041300d060960864801650304020205000430\"\n },\n sha512WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha512\",\n id: \"3051300d060960864801650304020305000440\"\n },\n \"RSA-SHA512\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha512\",\n id: \"3051300d060960864801650304020305000440\"\n },\n \"RSA-SHA1\": {\n sign: \"rsa\",\n hash: \"sha1\",\n id: \"3021300906052b0e03021a05000414\"\n },\n \"ecdsa-with-SHA1\": {\n sign: \"ecdsa\",\n hash: \"sha1\",\n id: \"\"\n },\n sha256: {\n sign: \"ecdsa\",\n hash: \"sha256\",\n id: \"\"\n },\n sha224: {\n sign: \"ecdsa\",\n hash: \"sha224\",\n id: \"\"\n },\n sha384: {\n sign: \"ecdsa\",\n hash: \"sha384\",\n id: \"\"\n },\n sha512: {\n sign: \"ecdsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-SHA\": {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n \"DSA-SHA1\": {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n DSA: {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n \"DSA-WITH-SHA224\": {\n sign: \"dsa\",\n hash: \"sha224\",\n id: \"\"\n },\n \"DSA-SHA224\": {\n sign: \"dsa\",\n hash: \"sha224\",\n id: \"\"\n },\n \"DSA-WITH-SHA256\": {\n sign: \"dsa\",\n hash: \"sha256\",\n id: \"\"\n },\n \"DSA-SHA256\": {\n sign: \"dsa\",\n hash: \"sha256\",\n id: \"\"\n },\n \"DSA-WITH-SHA384\": {\n sign: \"dsa\",\n hash: \"sha384\",\n id: \"\"\n },\n \"DSA-SHA384\": {\n sign: \"dsa\",\n hash: \"sha384\",\n id: \"\"\n },\n \"DSA-WITH-SHA512\": {\n sign: \"dsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-SHA512\": {\n sign: \"dsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-RIPEMD160\": {\n sign: \"dsa\",\n hash: \"rmd160\",\n id: \"\"\n },\n ripemd160WithRSA: {\n sign: \"rsa\",\n hash: \"rmd160\",\n id: \"3021300906052b2403020105000414\"\n },\n \"RSA-RIPEMD160\": {\n sign: \"rsa\",\n hash: \"rmd160\",\n id: \"3021300906052b2403020105000414\"\n },\n md5WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"md5\",\n id: \"3020300c06082a864886f70d020505000410\"\n },\n \"RSA-MD5\": {\n sign: \"rsa\",\n hash: \"md5\",\n id: \"3020300c06082a864886f70d020505000410\"\n }\n };\n }\n}), require_algos = __commonJS({\n \"node_modules/browserify-sign/algos.js\"(exports, module) {\n module.exports = require_algorithms();\n }\n}), require_precondition = __commonJS({\n \"node_modules/pbkdf2/lib/precondition.js\"(exports, module) {\n var MAX_ALLOC = Math.pow(2, 30) - 1;\n module.exports = function(iterations, keylen) {\n if (typeof iterations != \"number\")\n @throwTypeError(\"Iterations not a number\");\n if (iterations < 0)\n @throwTypeError(\"Bad iterations\");\n if (typeof keylen != \"number\")\n @throwTypeError(\"Key length not a number\");\n if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen)\n @throwTypeError(\"Bad key length\");\n };\n }\n}), require_default_encoding = __commonJS({\n \"node_modules/pbkdf2/lib/default-encoding.js\"(exports, module) {\n var defaultEncoding;\n global.process && global.process.browser \? defaultEncoding = \"utf-8\" : global.process && global.process.version \? (pVersionMajor = parseInt(process.version.split(\".\")[0].slice(1), 10), defaultEncoding = pVersionMajor >= 6 \? \"utf-8\" : \"binary\") : defaultEncoding = \"utf-8\";\n var pVersionMajor;\n module.exports = defaultEncoding;\n }\n}), require_to_buffer = __commonJS({\n \"node_modules/pbkdf2/lib/to-buffer.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(thing, encoding, name) {\n if (Buffer2.isBuffer(thing))\n return thing;\n if (typeof thing == \"string\")\n return Buffer2.from(thing, encoding);\n if (ArrayBuffer.isView(thing))\n return Buffer2.from(thing.buffer);\n @throwTypeError(name + \" must be a string, a Buffer, a typed array or a DataView\");\n };\n }\n}), require_sync_browser = __commonJS({\n \"node_modules/pbkdf2/lib/sync-browser.js\"(exports, module) {\n var md5 = require_md52(), RIPEMD160 = require_ripemd160(), sha = require_sha2(), Buffer2 = require_safe_buffer().Buffer, checkParameters = require_precondition(), defaultEncoding = require_default_encoding(), toBuffer = require_to_buffer(), ZEROS = Buffer2.alloc(128), sizes = {\n md5: 16,\n sha1: 20,\n sha224: 28,\n sha256: 32,\n sha384: 48,\n sha512: 64,\n rmd160: 20,\n ripemd160: 20\n };\n function Hmac(alg, key, saltLen) {\n var hash = getDigest(alg), blocksize = alg === \"sha512\" || alg === \"sha384\" \? 128 : 64;\n key.length > blocksize \? key = hash(key) : key.length < blocksize && (key = Buffer2.concat([key, ZEROS], blocksize));\n for (var ipad = Buffer2.allocUnsafe(blocksize + sizes[alg]), opad = Buffer2.allocUnsafe(blocksize + sizes[alg]), i = 0;i < blocksize; i++)\n ipad[i] = key[i] ^ 54, opad[i] = key[i] ^ 92;\n var ipad1 = Buffer2.allocUnsafe(blocksize + saltLen + 4);\n ipad.copy(ipad1, 0, 0, blocksize), this.ipad1 = ipad1, this.ipad2 = ipad, this.opad = opad, this.alg = alg, this.blocksize = blocksize, this.hash = hash, this.size = sizes[alg];\n }\n Hmac.prototype = {}, Hmac.prototype.run = function(data, ipad) {\n data.copy(ipad, this.blocksize);\n var h = this.hash(ipad);\n return h.copy(this.opad, this.blocksize), this.hash(this.opad);\n };\n function getDigest(alg) {\n function shaFunc(data) {\n return sha(alg).update(data).digest();\n }\n function rmd160Func(data) {\n return new RIPEMD160().update(data).digest();\n }\n return alg === \"rmd160\" || alg === \"ripemd160\" \? rmd160Func : alg === \"md5\" \? md5 : shaFunc;\n }\n function pbkdf2(password, salt, iterations, keylen, digest) {\n checkParameters(iterations, keylen), password = toBuffer(password, defaultEncoding, \"Password\"), salt = toBuffer(salt, defaultEncoding, \"Salt\"), digest = digest || \"sha1\";\n var hmac = new Hmac(digest, password, salt.length), DK = Buffer2.allocUnsafe(keylen), block1 = Buffer2.allocUnsafe(salt.length + 4);\n salt.copy(block1, 0, 0, salt.length);\n for (var destPos = 0, hLen = sizes[digest], l = Math.ceil(keylen / hLen), i = 1;i <= l; i++) {\n block1.writeUInt32BE(i, salt.length);\n for (var T = hmac.run(block1, hmac.ipad1), U = T, j = 1;j < iterations; j++) {\n U = hmac.run(U, hmac.ipad2);\n for (var k = 0;k < hLen; k++)\n T[k] ^= U[k];\n }\n T.copy(DK, destPos), destPos += hLen;\n }\n return DK;\n }\n module.exports = pbkdf2;\n }\n}), require_async = __commonJS({\n \"node_modules/pbkdf2/lib/async.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, checkParameters = require_precondition(), defaultEncoding = require_default_encoding(), sync = require_sync_browser(), toBuffer = require_to_buffer(), ZERO_BUF, subtle = globalCrypto.subtle, toBrowser = {\n sha: \"SHA-1\",\n \"sha-1\": \"SHA-1\",\n sha1: \"SHA-1\",\n sha256: \"SHA-256\",\n \"sha-256\": \"SHA-256\",\n sha384: \"SHA-384\",\n \"sha-384\": \"SHA-384\",\n \"sha-512\": \"SHA-512\",\n sha512: \"SHA-512\"\n }, checks = [];\n function checkNative(algo) {\n if (global.process && !global.process.browser || !subtle || !subtle.importKey || !subtle.deriveBits)\n return Promise.resolve(!1);\n if (checks[algo] !== void 0)\n return checks[algo];\n ZERO_BUF = ZERO_BUF || Buffer2.alloc(8);\n var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo).then(function() {\n return !0;\n }).catch(function() {\n return !1;\n });\n return checks[algo] = prom, prom;\n }\n var nextTick;\n function getNextTick() {\n return nextTick || (global.process && global.process.nextTick \? nextTick = global.process.nextTick : global.queueMicrotask \? nextTick = global.queueMicrotask : global.setImmediate \? nextTick = global.setImmediate : nextTick = global.setTimeout, nextTick);\n }\n function browserPbkdf2(password, salt, iterations, length, algo) {\n return subtle.importKey(\"raw\", password, { name: \"PBKDF2\" }, !1, [\"deriveBits\"]).then(function(key) {\n return subtle.deriveBits({\n name: \"PBKDF2\",\n salt,\n iterations,\n hash: {\n name: algo\n }\n }, key, length << 3);\n }).then(function(res) {\n return Buffer2.from(res);\n });\n }\n function resolvePromise(promise, callback) {\n promise.then(function(out) {\n getNextTick()(function() {\n callback(null, out);\n });\n }, function(e) {\n getNextTick()(function() {\n callback(e);\n });\n });\n }\n module.exports = function(password, salt, iterations, keylen, digest, callback) {\n typeof digest == \"function\" && (callback = digest, digest = void 0), digest = digest || \"sha1\";\n var algo = toBrowser[digest.toLowerCase()];\n if (!algo || typeof global.Promise != \"function\") {\n getNextTick()(function() {\n var out;\n try {\n out = sync(password, salt, iterations, keylen, digest);\n } catch (e) {\n return callback(e);\n }\n callback(null, out);\n });\n return;\n }\n if (checkParameters(iterations, keylen), password = toBuffer(password, defaultEncoding, \"Password\"), salt = toBuffer(salt, defaultEncoding, \"Salt\"), typeof callback != \"function\")\n throw new Error(\"No callback provided to pbkdf2\");\n resolvePromise(checkNative(algo).then(function(resp) {\n return resp \? browserPbkdf2(password, salt, iterations, keylen, algo) : sync(password, salt, iterations, keylen, digest);\n }), callback);\n };\n }\n}), require_browser4 = __commonJS({\n \"node_modules/pbkdf2/browser.js\"(exports) {\n exports.pbkdf2 = require_async(), exports.pbkdf2Sync = require_sync_browser();\n }\n}), require_utils = __commonJS({\n \"node_modules/des.js/lib/des/utils.js\"(exports) {\n exports.readUInt32BE = function(bytes, off) {\n var res = bytes[0 + off] << 24 | bytes[1 + off] << 16 | bytes[2 + off] << 8 | bytes[3 + off];\n return res >>> 0;\n }, exports.writeUInt32BE = function(bytes, value, off) {\n bytes[0 + off] = value >>> 24, bytes[1 + off] = value >>> 16 & 255, bytes[2 + off] = value >>> 8 & 255, bytes[3 + off] = value & 255;\n }, exports.ip = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 6;i >= 0; i -= 2) {\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >>> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inL >>> j + i & 1;\n }\n for (var i = 6;i >= 0; i -= 2) {\n for (var j = 1;j <= 25; j += 8)\n outR <<= 1, outR |= inR >>> j + i & 1;\n for (var j = 1;j <= 25; j += 8)\n outR <<= 1, outR |= inL >>> j + i & 1;\n }\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.rip = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 0;i < 4; i++)\n for (var j = 24;j >= 0; j -= 8)\n outL <<= 1, outL |= inR >>> j + i & 1, outL <<= 1, outL |= inL >>> j + i & 1;\n for (var i = 4;i < 8; i++)\n for (var j = 24;j >= 0; j -= 8)\n outR <<= 1, outR |= inR >>> j + i & 1, outR <<= 1, outR |= inL >>> j + i & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.pc1 = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 7;i >= 5; i--) {\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inL >> j + i & 1;\n }\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >> j + i & 1;\n for (var i = 1;i <= 3; i++) {\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inR >> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inL >> j + i & 1;\n }\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inL >> j + i & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.r28shl = function(num, shift) {\n return num << shift & 268435455 | num >>> 28 - shift;\n };\n var pc2table = [\n 14,\n 11,\n 17,\n 4,\n 27,\n 23,\n 25,\n 0,\n 13,\n 22,\n 7,\n 18,\n 5,\n 9,\n 16,\n 24,\n 2,\n 20,\n 12,\n 21,\n 1,\n 8,\n 15,\n 26,\n 15,\n 4,\n 25,\n 19,\n 9,\n 1,\n 26,\n 16,\n 5,\n 11,\n 23,\n 8,\n 12,\n 7,\n 17,\n 0,\n 22,\n 3,\n 10,\n 14,\n 6,\n 20,\n 27,\n 24\n ];\n exports.pc2 = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, len = pc2table.length >>> 1, i = 0;i < len; i++)\n outL <<= 1, outL |= inL >>> pc2table[i] & 1;\n for (var i = len;i < pc2table.length; i++)\n outR <<= 1, outR |= inR >>> pc2table[i] & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.expand = function(r, out, off) {\n var outL = 0, outR = 0;\n outL = (r & 1) << 5 | r >>> 27;\n for (var i = 23;i >= 15; i -= 4)\n outL <<= 6, outL |= r >>> i & 63;\n for (var i = 11;i >= 3; i -= 4)\n outR |= r >>> i & 63, outR <<= 6;\n outR |= (r & 31) << 1 | r >>> 31, out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n };\n var sTable = [\n 14,\n 0,\n 4,\n 15,\n 13,\n 7,\n 1,\n 4,\n 2,\n 14,\n 15,\n 2,\n 11,\n 13,\n 8,\n 1,\n 3,\n 10,\n 10,\n 6,\n 6,\n 12,\n 12,\n 11,\n 5,\n 9,\n 9,\n 5,\n 0,\n 3,\n 7,\n 8,\n 4,\n 15,\n 1,\n 12,\n 14,\n 8,\n 8,\n 2,\n 13,\n 4,\n 6,\n 9,\n 2,\n 1,\n 11,\n 7,\n 15,\n 5,\n 12,\n 11,\n 9,\n 3,\n 7,\n 14,\n 3,\n 10,\n 10,\n 0,\n 5,\n 6,\n 0,\n 13,\n 15,\n 3,\n 1,\n 13,\n 8,\n 4,\n 14,\n 7,\n 6,\n 15,\n 11,\n 2,\n 3,\n 8,\n 4,\n 14,\n 9,\n 12,\n 7,\n 0,\n 2,\n 1,\n 13,\n 10,\n 12,\n 6,\n 0,\n 9,\n 5,\n 11,\n 10,\n 5,\n 0,\n 13,\n 14,\n 8,\n 7,\n 10,\n 11,\n 1,\n 10,\n 3,\n 4,\n 15,\n 13,\n 4,\n 1,\n 2,\n 5,\n 11,\n 8,\n 6,\n 12,\n 7,\n 6,\n 12,\n 9,\n 0,\n 3,\n 5,\n 2,\n 14,\n 15,\n 9,\n 10,\n 13,\n 0,\n 7,\n 9,\n 0,\n 14,\n 9,\n 6,\n 3,\n 3,\n 4,\n 15,\n 6,\n 5,\n 10,\n 1,\n 2,\n 13,\n 8,\n 12,\n 5,\n 7,\n 14,\n 11,\n 12,\n 4,\n 11,\n 2,\n 15,\n 8,\n 1,\n 13,\n 1,\n 6,\n 10,\n 4,\n 13,\n 9,\n 0,\n 8,\n 6,\n 15,\n 9,\n 3,\n 8,\n 0,\n 7,\n 11,\n 4,\n 1,\n 15,\n 2,\n 14,\n 12,\n 3,\n 5,\n 11,\n 10,\n 5,\n 14,\n 2,\n 7,\n 12,\n 7,\n 13,\n 13,\n 8,\n 14,\n 11,\n 3,\n 5,\n 0,\n 6,\n 6,\n 15,\n 9,\n 0,\n 10,\n 3,\n 1,\n 4,\n 2,\n 7,\n 8,\n 2,\n 5,\n 12,\n 11,\n 1,\n 12,\n 10,\n 4,\n 14,\n 15,\n 9,\n 10,\n 3,\n 6,\n 15,\n 9,\n 0,\n 0,\n 6,\n 12,\n 10,\n 11,\n 1,\n 7,\n 13,\n 13,\n 8,\n 15,\n 9,\n 1,\n 4,\n 3,\n 5,\n 14,\n 11,\n 5,\n 12,\n 2,\n 7,\n 8,\n 2,\n 4,\n 14,\n 2,\n 14,\n 12,\n 11,\n 4,\n 2,\n 1,\n 12,\n 7,\n 4,\n 10,\n 7,\n 11,\n 13,\n 6,\n 1,\n 8,\n 5,\n 5,\n 0,\n 3,\n 15,\n 15,\n 10,\n 13,\n 3,\n 0,\n 9,\n 14,\n 8,\n 9,\n 6,\n 4,\n 11,\n 2,\n 8,\n 1,\n 12,\n 11,\n 7,\n 10,\n 1,\n 13,\n 14,\n 7,\n 2,\n 8,\n 13,\n 15,\n 6,\n 9,\n 15,\n 12,\n 0,\n 5,\n 9,\n 6,\n 10,\n 3,\n 4,\n 0,\n 5,\n 14,\n 3,\n 12,\n 10,\n 1,\n 15,\n 10,\n 4,\n 15,\n 2,\n 9,\n 7,\n 2,\n 12,\n 6,\n 9,\n 8,\n 5,\n 0,\n 6,\n 13,\n 1,\n 3,\n 13,\n 4,\n 14,\n 14,\n 0,\n 7,\n 11,\n 5,\n 3,\n 11,\n 8,\n 9,\n 4,\n 14,\n 3,\n 15,\n 2,\n 5,\n 12,\n 2,\n 9,\n 8,\n 5,\n 12,\n 15,\n 3,\n 10,\n 7,\n 11,\n 0,\n 14,\n 4,\n 1,\n 10,\n 7,\n 1,\n 6,\n 13,\n 0,\n 11,\n 8,\n 6,\n 13,\n 4,\n 13,\n 11,\n 0,\n 2,\n 11,\n 14,\n 7,\n 15,\n 4,\n 0,\n 9,\n 8,\n 1,\n 13,\n 10,\n 3,\n 14,\n 12,\n 3,\n 9,\n 5,\n 7,\n 12,\n 5,\n 2,\n 10,\n 15,\n 6,\n 8,\n 1,\n 6,\n 1,\n 6,\n 4,\n 11,\n 11,\n 13,\n 13,\n 8,\n 12,\n 1,\n 3,\n 4,\n 7,\n 10,\n 14,\n 7,\n 10,\n 9,\n 15,\n 5,\n 6,\n 0,\n 8,\n 15,\n 0,\n 14,\n 5,\n 2,\n 9,\n 3,\n 2,\n 12,\n 13,\n 1,\n 2,\n 15,\n 8,\n 13,\n 4,\n 8,\n 6,\n 10,\n 15,\n 3,\n 11,\n 7,\n 1,\n 4,\n 10,\n 12,\n 9,\n 5,\n 3,\n 6,\n 14,\n 11,\n 5,\n 0,\n 0,\n 14,\n 12,\n 9,\n 7,\n 2,\n 7,\n 2,\n 11,\n 1,\n 4,\n 14,\n 1,\n 7,\n 9,\n 4,\n 12,\n 10,\n 14,\n 8,\n 2,\n 13,\n 0,\n 15,\n 6,\n 12,\n 10,\n 9,\n 13,\n 0,\n 15,\n 3,\n 3,\n 5,\n 5,\n 6,\n 8,\n 11\n ];\n exports.substitute = function(inL, inR) {\n for (var out = 0, i = 0;i < 4; i++) {\n var b = inL >>> 18 - i * 6 & 63, sb = sTable[i * 64 + b];\n out <<= 4, out |= sb;\n }\n for (var i = 0;i < 4; i++) {\n var b = inR >>> 18 - i * 6 & 63, sb = sTable[256 + i * 64 + b];\n out <<= 4, out |= sb;\n }\n return out >>> 0;\n };\n var permuteTable = [\n 16,\n 25,\n 12,\n 11,\n 3,\n 20,\n 4,\n 15,\n 31,\n 17,\n 9,\n 6,\n 27,\n 14,\n 1,\n 22,\n 30,\n 24,\n 8,\n 18,\n 0,\n 5,\n 29,\n 23,\n 13,\n 19,\n 2,\n 26,\n 10,\n 21,\n 28,\n 7\n ];\n exports.permute = function(num) {\n for (var out = 0, i = 0;i < permuteTable.length; i++)\n out <<= 1, out |= num >>> permuteTable[i] & 1;\n return out >>> 0;\n }, exports.padSplit = function(num, size, group) {\n for (var str = num.toString(2);str.length < size; )\n str = \"0\" + str;\n for (var out = [], i = 0;i < size; i += group)\n out.push(str.slice(i, i + group));\n return out.join(\" \");\n };\n }\n}), require_minimalistic_assert = __commonJS({\n \"node_modules/minimalistic-assert/index.js\"(exports, module) {\n module.exports = assert;\n function assert(val, msg) {\n if (!val)\n throw new Error(msg || \"Assertion failed\");\n }\n assert.equal = function(l, r, msg) {\n if (l != r)\n throw new Error(msg || \"Assertion failed: \" + l + \" != \" + r);\n };\n }\n}), require_cipher = __commonJS({\n \"node_modules/des.js/lib/des/cipher.js\"(exports, module) {\n var assert = require_minimalistic_assert();\n function Cipher(options) {\n this.options = options, this.type = this.options.type, this.blockSize = 8, this._init(), this.buffer = new Array(this.blockSize), this.bufferOff = 0;\n }\n Cipher.prototype = {}, module.exports = Cipher, Cipher.prototype._init = function() {\n }, Cipher.prototype.update = function(data) {\n return data.length === 0 \? [] : this.type === \"decrypt\" \? this._updateDecrypt(data) : this._updateEncrypt(data);\n }, Cipher.prototype._buffer = function(data, off) {\n for (var min = Math.min(this.buffer.length - this.bufferOff, data.length - off), i = 0;i < min; i++)\n this.buffer[this.bufferOff + i] = data[off + i];\n return this.bufferOff += min, min;\n }, Cipher.prototype._flushBuffer = function(out, off) {\n return this._update(this.buffer, 0, out, off), this.bufferOff = 0, this.blockSize;\n }, Cipher.prototype._updateEncrypt = function(data) {\n var inputOff = 0, outputOff = 0, count = (this.bufferOff + data.length) / this.blockSize | 0, out = new Array(count * this.blockSize);\n this.bufferOff !== 0 && (inputOff += this._buffer(data, inputOff), this.bufferOff === this.buffer.length && (outputOff += this._flushBuffer(out, outputOff)));\n for (var max = data.length - (data.length - inputOff) % this.blockSize;inputOff < max; inputOff += this.blockSize)\n this._update(data, inputOff, out, outputOff), outputOff += this.blockSize;\n for (;inputOff < data.length; inputOff++, this.bufferOff++)\n this.buffer[this.bufferOff] = data[inputOff];\n return out;\n }, Cipher.prototype._updateDecrypt = function(data) {\n for (var inputOff = 0, outputOff = 0, count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1, out = new Array(count * this.blockSize);count > 0; count--)\n inputOff += this._buffer(data, inputOff), outputOff += this._flushBuffer(out, outputOff);\n return inputOff += this._buffer(data, inputOff), out;\n }, Cipher.prototype.final = function(buffer) {\n var first;\n buffer && (first = this.update(buffer));\n var last;\n return this.type === \"encrypt\" \? last = this._finalEncrypt() : last = this._finalDecrypt(), first \? first.concat(last) : last;\n }, Cipher.prototype._pad = function(buffer, off) {\n if (off === 0)\n return !1;\n for (;off < buffer.length; )\n buffer[off++] = 0;\n return !0;\n }, Cipher.prototype._finalEncrypt = function() {\n if (!this._pad(this.buffer, this.bufferOff))\n return [];\n var out = new Array(this.blockSize);\n return this._update(this.buffer, 0, out, 0), out;\n }, Cipher.prototype._unpad = function(buffer) {\n return buffer;\n }, Cipher.prototype._finalDecrypt = function() {\n assert.equal(this.bufferOff, this.blockSize, \"Not enough data to decrypt\");\n var out = new Array(this.blockSize);\n return this._flushBuffer(out, 0), this._unpad(out);\n };\n }\n}), require_des = __commonJS({\n \"node_modules/des.js/lib/des/des.js\"(exports, module) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), utils = require_utils(), Cipher = require_cipher();\n function DESState() {\n this.tmp = new Array(2), this.keys = null;\n }\n function DES(options) {\n Cipher.call(this, options);\n var state = new DESState;\n this._desState = state, this.deriveKeys(state, options.key);\n }\n inherits(DES, Cipher), module.exports = DES, DES.create = function(options) {\n return new DES(options);\n };\n var shiftTable = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1];\n DES.prototype.deriveKeys = function(state, key) {\n state.keys = new Array(32), assert.equal(key.length, this.blockSize, \"Invalid key length\");\n var kL = utils.readUInt32BE(key, 0), kR = utils.readUInt32BE(key, 4);\n utils.pc1(kL, kR, state.tmp, 0), kL = state.tmp[0], kR = state.tmp[1];\n for (var i = 0;i < state.keys.length; i += 2) {\n var shift = shiftTable[i >>> 1];\n kL = utils.r28shl(kL, shift), kR = utils.r28shl(kR, shift), utils.pc2(kL, kR, state.keys, i);\n }\n }, DES.prototype._update = function(inp, inOff, out, outOff) {\n var state = this._desState, l = utils.readUInt32BE(inp, inOff), r = utils.readUInt32BE(inp, inOff + 4);\n utils.ip(l, r, state.tmp, 0), l = state.tmp[0], r = state.tmp[1], this.type === \"encrypt\" \? this._encrypt(state, l, r, state.tmp, 0) : this._decrypt(state, l, r, state.tmp, 0), l = state.tmp[0], r = state.tmp[1], utils.writeUInt32BE(out, l, outOff), utils.writeUInt32BE(out, r, outOff + 4);\n }, DES.prototype._pad = function(buffer, off) {\n for (var value = buffer.length - off, i = off;i < buffer.length; i++)\n buffer[i] = value;\n return !0;\n }, DES.prototype._unpad = function(buffer) {\n for (var pad = buffer[buffer.length - 1], i = buffer.length - pad;i < buffer.length; i++)\n assert.equal(buffer[i], pad);\n return buffer.slice(0, buffer.length - pad);\n }, DES.prototype._encrypt = function(state, lStart, rStart, out, off) {\n for (var l = lStart, r = rStart, i = 0;i < state.keys.length; i += 2) {\n var keyL = state.keys[i], keyR = state.keys[i + 1];\n utils.expand(r, state.tmp, 0), keyL ^= state.tmp[0], keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR), f = utils.permute(s), t = r;\n r = (l ^ f) >>> 0, l = t;\n }\n utils.rip(r, l, out, off);\n }, DES.prototype._decrypt = function(state, lStart, rStart, out, off) {\n for (var l = rStart, r = lStart, i = state.keys.length - 2;i >= 0; i -= 2) {\n var keyL = state.keys[i], keyR = state.keys[i + 1];\n utils.expand(l, state.tmp, 0), keyL ^= state.tmp[0], keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR), f = utils.permute(s), t = l;\n l = (r ^ f) >>> 0, r = t;\n }\n utils.rip(l, r, out, off);\n };\n }\n}), require_cbc = __commonJS({\n \"node_modules/des.js/lib/des/cbc.js\"(exports) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), proto = {};\n function CBCState(iv) {\n assert.equal(iv.length, 8, \"Invalid IV length\"), this.iv = new Array(8);\n for (var i = 0;i < this.iv.length; i++)\n this.iv[i] = iv[i];\n }\n function instantiate(Base) {\n function CBC(options) {\n Base.call(this, options), this._cbcInit();\n }\n inherits(CBC, Base);\n for (var keys = Object.keys(proto), i = 0;i < keys.length; i++) {\n var key = keys[i];\n CBC.prototype[key] = proto[key];\n }\n return CBC.create = function(options) {\n return new CBC(options);\n }, CBC;\n }\n exports.instantiate = instantiate, proto._cbcInit = function() {\n var state = new CBCState(this.options.iv);\n this._cbcState = state;\n }, proto._update = function(inp, inOff, out, outOff) {\n var state = this._cbcState, superProto = this.constructor.super_.prototype, iv = state.iv;\n if (this.type === \"encrypt\") {\n for (var i = 0;i < this.blockSize; i++)\n iv[i] ^= inp[inOff + i];\n superProto._update.call(this, iv, 0, out, outOff);\n for (var i = 0;i < this.blockSize; i++)\n iv[i] = out[outOff + i];\n } else {\n superProto._update.call(this, inp, inOff, out, outOff);\n for (var i = 0;i < this.blockSize; i++)\n out[outOff + i] ^= iv[i];\n for (var i = 0;i < this.blockSize; i++)\n iv[i] = inp[inOff + i];\n }\n };\n }\n}), require_ede = __commonJS({\n \"node_modules/des.js/lib/des/ede.js\"(exports, module) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), Cipher = require_cipher(), DES = require_des();\n function EDEState(type, key) {\n assert.equal(key.length, 24, \"Invalid key length\");\n var k1 = key.slice(0, 8), k2 = key.slice(8, 16), k3 = key.slice(16, 24);\n type === \"encrypt\" \? this.ciphers = [\n DES.create({ type: \"encrypt\", key: k1 }),\n DES.create({ type: \"decrypt\", key: k2 }),\n DES.create({ type: \"encrypt\", key: k3 })\n ] : this.ciphers = [\n DES.create({ type: \"decrypt\", key: k3 }),\n DES.create({ type: \"encrypt\", key: k2 }),\n DES.create({ type: \"decrypt\", key: k1 })\n ];\n }\n function EDE(options) {\n Cipher.call(this, options);\n var state = new EDEState(this.type, this.options.key);\n this._edeState = state;\n }\n inherits(EDE, Cipher), module.exports = EDE, EDE.create = function(options) {\n return new EDE(options);\n }, EDE.prototype._update = function(inp, inOff, out, outOff) {\n var state = this._edeState;\n state.ciphers[0]._update(inp, inOff, out, outOff), state.ciphers[1]._update(out, outOff, out, outOff), state.ciphers[2]._update(out, outOff, out, outOff);\n }, EDE.prototype._pad = DES.prototype._pad, EDE.prototype._unpad = DES.prototype._unpad;\n }\n}), require_des2 = __commonJS({\n \"node_modules/des.js/lib/des.js\"(exports) {\n exports.utils = require_utils(), exports.Cipher = require_cipher(), exports.DES = require_des(), exports.CBC = require_cbc(), exports.EDE = require_ede();\n }\n}), require_browserify_des = __commonJS({\n \"node_modules/browserify-des/index.js\"(exports, module) {\n var CipherBase = require_cipher_base(), des = require_des2(), inherits = require_inherits_browser(), Buffer2 = require_safe_buffer().Buffer, modes = {\n \"des-ede3-cbc\": des.CBC.instantiate(des.EDE),\n \"des-ede3\": des.EDE,\n \"des-ede-cbc\": des.CBC.instantiate(des.EDE),\n \"des-ede\": des.EDE,\n \"des-cbc\": des.CBC.instantiate(des.DES),\n \"des-ecb\": des.DES\n };\n modes.des = modes[\"des-cbc\"], modes.des3 = modes[\"des-ede3-cbc\"], module.exports = DES, inherits(DES, CipherBase);\n function DES(opts) {\n CipherBase.call(this);\n var modeName = opts.mode.toLowerCase(), mode = modes[modeName], type;\n opts.decrypt \? type = \"decrypt\" : type = \"encrypt\";\n var key = opts.key;\n Buffer2.isBuffer(key) || (key = Buffer2.from(key)), (modeName === \"des-ede\" || modeName === \"des-ede-cbc\") && (key = Buffer2.concat([key, key.slice(0, 8)]));\n var iv = opts.iv;\n Buffer2.isBuffer(iv) || (iv = Buffer2.from(iv)), this._des = mode.create({\n key,\n iv,\n type\n });\n }\n DES.prototype._update = function(data) {\n return Buffer2.from(this._des.update(data));\n }, DES.prototype._final = function() {\n return Buffer2.from(this._des.final());\n };\n }\n}), require_ecb = __commonJS({\n \"node_modules/browserify-aes/modes/ecb.js\"(exports) {\n exports.encrypt = function(self2, block) {\n return self2._cipher.encryptBlock(block);\n }, exports.decrypt = function(self2, block) {\n return self2._cipher.decryptBlock(block);\n };\n }\n}), require_buffer_xor = __commonJS({\n \"node_modules/buffer-xor/index.js\"(exports, module) {\n module.exports = function(a, b) {\n for (var length = Math.min(a.length, b.length), buffer = new Buffer(length), i = 0;i < length; ++i)\n buffer[i] = a[i] ^ b[i];\n return buffer;\n };\n }\n}), require_cbc2 = __commonJS({\n \"node_modules/browserify-aes/modes/cbc.js\"(exports) {\n var xor = require_buffer_xor();\n exports.encrypt = function(self2, block) {\n var data = xor(block, self2._prev);\n return self2._prev = self2._cipher.encryptBlock(data), self2._prev;\n }, exports.decrypt = function(self2, block) {\n var pad = self2._prev;\n self2._prev = block;\n var out = self2._cipher.decryptBlock(block);\n return xor(out, pad);\n };\n }\n}), require_cfb = __commonJS({\n \"node_modules/browserify-aes/modes/cfb.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer, xor = require_buffer_xor();\n function encryptStart(self2, data, decrypt) {\n var len = data.length, out = xor(data, self2._cache);\n return self2._cache = self2._cache.slice(len), self2._prev = Buffer2.concat([self2._prev, decrypt \? data : out]), out;\n }\n exports.encrypt = function(self2, data, decrypt) {\n for (var out = Buffer2.allocUnsafe(0), len;data.length; )\n if (self2._cache.length === 0 && (self2._cache = self2._cipher.encryptBlock(self2._prev), self2._prev = Buffer2.allocUnsafe(0)), self2._cache.length <= data.length)\n len = self2._cache.length, out = Buffer2.concat([out, encryptStart(self2, data.slice(0, len), decrypt)]), data = data.slice(len);\n else {\n out = Buffer2.concat([out, encryptStart(self2, data, decrypt)]);\n break;\n }\n return out;\n };\n }\n}), require_cfb8 = __commonJS({\n \"node_modules/browserify-aes/modes/cfb8.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer;\n function encryptByte(self2, byteParam, decrypt) {\n var pad = self2._cipher.encryptBlock(self2._prev), out = pad[0] ^ byteParam;\n return self2._prev = Buffer2.concat([self2._prev.slice(1), Buffer2.from([decrypt \? byteParam : out])]), out;\n }\n exports.encrypt = function(self2, chunk, decrypt) {\n for (var len = chunk.length, out = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n out[i] = encryptByte(self2, chunk[i], decrypt);\n return out;\n };\n }\n}), require_cfb1 = __commonJS({\n \"node_modules/browserify-aes/modes/cfb1.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer;\n function encryptByte(self2, byteParam, decrypt) {\n for (var pad, i = -1, len = 8, out = 0, bit, value;++i < len; )\n pad = self2._cipher.encryptBlock(self2._prev), bit = byteParam & 1 << 7 - i \? 128 : 0, value = pad[0] ^ bit, out += (value & 128) >> i % 8, self2._prev = shiftIn(self2._prev, decrypt \? bit : value);\n return out;\n }\n function shiftIn(buffer, value) {\n var len = buffer.length, i = -1, out = Buffer2.allocUnsafe(buffer.length);\n for (buffer = Buffer2.concat([buffer, Buffer2.from([value])]);++i < len; )\n out[i] = buffer[i] << 1 | buffer[i + 1] >> 7;\n return out;\n }\n exports.encrypt = function(self2, chunk, decrypt) {\n for (var len = chunk.length, out = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n out[i] = encryptByte(self2, chunk[i], decrypt);\n return out;\n };\n }\n}), require_ofb = __commonJS({\n \"node_modules/browserify-aes/modes/ofb.js\"(exports) {\n var xor = require_buffer_xor();\n function getBlock(self2) {\n return self2._prev = self2._cipher.encryptBlock(self2._prev), self2._prev;\n }\n exports.encrypt = function(self2, chunk) {\n for (;self2._cache.length < chunk.length; )\n self2._cache = Buffer.concat([self2._cache, getBlock(self2)]);\n var pad = self2._cache.slice(0, chunk.length);\n return self2._cache = self2._cache.slice(chunk.length), xor(chunk, pad);\n };\n }\n}), require_incr32 = __commonJS({\n \"node_modules/browserify-aes/incr32.js\"(exports, module) {\n function incr32(iv) {\n for (var len = iv.length, item;len--; )\n if (item = iv.readUInt8(len), item === 255)\n iv.writeUInt8(0, len);\n else {\n item++, iv.writeUInt8(item, len);\n break;\n }\n }\n module.exports = incr32;\n }\n}), require_ctr = __commonJS({\n \"node_modules/browserify-aes/modes/ctr.js\"(exports) {\n var xor = require_buffer_xor(), Buffer2 = require_safe_buffer().Buffer, incr32 = require_incr32();\n function getBlock(self2) {\n var out = self2._cipher.encryptBlockRaw(self2._prev);\n return incr32(self2._prev), out;\n }\n var blockSize = 16;\n exports.encrypt = function(self2, chunk) {\n var chunkNum = Math.ceil(chunk.length / blockSize), start = self2._cache.length;\n self2._cache = Buffer2.concat([self2._cache, Buffer2.allocUnsafe(chunkNum * blockSize)]);\n for (var i = 0;i < chunkNum; i++) {\n var out = getBlock(self2), offset = start + i * blockSize;\n self2._cache.writeUInt32BE(out[0], offset + 0), self2._cache.writeUInt32BE(out[1], offset + 4), self2._cache.writeUInt32BE(out[2], offset + 8), self2._cache.writeUInt32BE(out[3], offset + 12);\n }\n var pad = self2._cache.slice(0, chunk.length);\n return self2._cache = self2._cache.slice(chunk.length), xor(chunk, pad);\n };\n }\n}), require_list = __commonJS({\n \"node_modules/browserify-aes/modes/list.json\"(exports, module) {\n module.exports = {\n \"aes-128-ecb\": {\n cipher: \"AES\",\n key: 128,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-192-ecb\": {\n cipher: \"AES\",\n key: 192,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-256-ecb\": {\n cipher: \"AES\",\n key: 256,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-128-cbc\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-192-cbc\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-256-cbc\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes128: {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes192: {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes256: {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-128-cfb\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-192-cfb\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-256-cfb\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-128-cfb8\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-192-cfb8\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-256-cfb8\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-128-cfb1\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-192-cfb1\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-256-cfb1\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-128-ofb\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-192-ofb\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-256-ofb\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-128-ctr\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-192-ctr\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-256-ctr\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-128-gcm\": {\n cipher: \"AES\",\n key: 128,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n },\n \"aes-192-gcm\": {\n cipher: \"AES\",\n key: 192,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n },\n \"aes-256-gcm\": {\n cipher: \"AES\",\n key: 256,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n }\n };\n }\n}), require_modes = __commonJS({\n \"node_modules/browserify-aes/modes/index.js\"(exports, module) {\n var modeModules = {\n ECB: require_ecb(),\n CBC: require_cbc2(),\n CFB: require_cfb(),\n CFB8: require_cfb8(),\n CFB1: require_cfb1(),\n OFB: require_ofb(),\n CTR: require_ctr(),\n GCM: require_ctr()\n }, modes = require_list();\n for (key in modes)\n modes[key].module = modeModules[modes[key].mode];\n var key;\n module.exports = modes;\n }\n}), require_aes = __commonJS({\n \"node_modules/browserify-aes/aes.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n function asUInt32Array(buf) {\n Buffer2.isBuffer(buf) || (buf = Buffer2.from(buf));\n for (var len = buf.length / 4 | 0, out = new Array(len), i = 0;i < len; i++)\n out[i] = buf.readUInt32BE(i * 4);\n return out;\n }\n function scrubVec(v) {\n for (var i = 0;i < v.length; v++)\n v[i] = 0;\n }\n function cryptBlock(M, keySchedule, SUB_MIX, SBOX, nRounds) {\n for (var SUB_MIX0 = SUB_MIX[0], SUB_MIX1 = SUB_MIX[1], SUB_MIX2 = SUB_MIX[2], SUB_MIX3 = SUB_MIX[3], s0 = M[0] ^ keySchedule[0], s1 = M[1] ^ keySchedule[1], s2 = M[2] ^ keySchedule[2], s3 = M[3] ^ keySchedule[3], t0, t1, t2, t3, ksRow = 4, round = 1;round < nRounds; round++)\n t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[s1 >>> 16 & 255] ^ SUB_MIX2[s2 >>> 8 & 255] ^ SUB_MIX3[s3 & 255] ^ keySchedule[ksRow++], t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[s2 >>> 16 & 255] ^ SUB_MIX2[s3 >>> 8 & 255] ^ SUB_MIX3[s0 & 255] ^ keySchedule[ksRow++], t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[s3 >>> 16 & 255] ^ SUB_MIX2[s0 >>> 8 & 255] ^ SUB_MIX3[s1 & 255] ^ keySchedule[ksRow++], t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[s0 >>> 16 & 255] ^ SUB_MIX2[s1 >>> 8 & 255] ^ SUB_MIX3[s2 & 255] ^ keySchedule[ksRow++], s0 = t0, s1 = t1, s2 = t2, s3 = t3;\n return t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 255] << 16 | SBOX[s2 >>> 8 & 255] << 8 | SBOX[s3 & 255]) ^ keySchedule[ksRow++], t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 255] << 16 | SBOX[s3 >>> 8 & 255] << 8 | SBOX[s0 & 255]) ^ keySchedule[ksRow++], t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 255] << 16 | SBOX[s0 >>> 8 & 255] << 8 | SBOX[s1 & 255]) ^ keySchedule[ksRow++], t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 255] << 16 | SBOX[s1 >>> 8 & 255] << 8 | SBOX[s2 & 255]) ^ keySchedule[ksRow++], t0 = t0 >>> 0, t1 = t1 >>> 0, t2 = t2 >>> 0, t3 = t3 >>> 0, [t0, t1, t2, t3];\n }\n var RCON = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], G = function() {\n for (var d = new Array(256), j = 0;j < 256; j++)\n j < 128 \? d[j] = j << 1 : d[j] = j << 1 ^ 283;\n for (var SBOX = [], INV_SBOX = [], SUB_MIX = [[], [], [], []], INV_SUB_MIX = [[], [], [], []], x = 0, xi = 0, i = 0;i < 256; ++i) {\n var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n sx = sx >>> 8 ^ sx & 255 ^ 99, SBOX[x] = sx, INV_SBOX[sx] = x;\n var x2 = d[x], x4 = d[x2], x8 = d[x4], t = d[sx] * 257 ^ sx * 16843008;\n SUB_MIX[0][x] = t << 24 | t >>> 8, SUB_MIX[1][x] = t << 16 | t >>> 16, SUB_MIX[2][x] = t << 8 | t >>> 24, SUB_MIX[3][x] = t, t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008, INV_SUB_MIX[0][sx] = t << 24 | t >>> 8, INV_SUB_MIX[1][sx] = t << 16 | t >>> 16, INV_SUB_MIX[2][sx] = t << 8 | t >>> 24, INV_SUB_MIX[3][sx] = t, x === 0 \? x = xi = 1 : (x = x2 ^ d[d[d[x8 ^ x2]]], xi ^= d[d[xi]]);\n }\n return {\n SBOX,\n INV_SBOX,\n SUB_MIX,\n INV_SUB_MIX\n };\n }();\n function AES(key) {\n this._key = asUInt32Array(key), this._reset();\n }\n AES.prototype = {}, AES.blockSize = 16, AES.keySize = 32, AES.prototype.blockSize = AES.blockSize, AES.prototype.keySize = AES.keySize, AES.prototype._reset = function() {\n for (var keyWords = this._key, keySize = keyWords.length, nRounds = keySize + 6, ksRows = (nRounds + 1) * 4, keySchedule = [], k = 0;k < keySize; k++)\n keySchedule[k] = keyWords[k];\n for (k = keySize;k < ksRows; k++) {\n var t = keySchedule[k - 1];\n k % keySize === 0 \? (t = t << 8 | t >>> 24, t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255], t ^= RCON[k / keySize | 0] << 24) : keySize > 6 && k % keySize === 4 && (t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255]), keySchedule[k] = keySchedule[k - keySize] ^ t;\n }\n for (var invKeySchedule = [], ik = 0;ik < ksRows; ik++) {\n var ksR = ksRows - ik, tt = keySchedule[ksR - (ik % 4 \? 0 : 4)];\n ik < 4 || ksR <= 4 \? invKeySchedule[ik] = tt : invKeySchedule[ik] = G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^ G.INV_SUB_MIX[1][G.SBOX[tt >>> 16 & 255]] ^ G.INV_SUB_MIX[2][G.SBOX[tt >>> 8 & 255]] ^ G.INV_SUB_MIX[3][G.SBOX[tt & 255]];\n }\n this._nRounds = nRounds, this._keySchedule = keySchedule, this._invKeySchedule = invKeySchedule;\n }, AES.prototype.encryptBlockRaw = function(M) {\n return M = asUInt32Array(M), cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds);\n }, AES.prototype.encryptBlock = function(M) {\n var out = this.encryptBlockRaw(M), buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0], 0), buf.writeUInt32BE(out[1], 4), buf.writeUInt32BE(out[2], 8), buf.writeUInt32BE(out[3], 12), buf;\n }, AES.prototype.decryptBlock = function(M) {\n M = asUInt32Array(M);\n var m1 = M[1];\n M[1] = M[3], M[3] = m1;\n var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds), buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0], 0), buf.writeUInt32BE(out[3], 4), buf.writeUInt32BE(out[2], 8), buf.writeUInt32BE(out[1], 12), buf;\n }, AES.prototype.scrub = function() {\n scrubVec(this._keySchedule), scrubVec(this._invKeySchedule), scrubVec(this._key);\n }, module.exports.AES = AES;\n }\n}), require_ghash = __commonJS({\n \"node_modules/browserify-aes/ghash.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, ZEROES = Buffer2.alloc(16, 0);\n function toArray(buf) {\n return [buf.readUInt32BE(0), buf.readUInt32BE(4), buf.readUInt32BE(8), buf.readUInt32BE(12)];\n }\n function fromArray(out) {\n var buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0] >>> 0, 0), buf.writeUInt32BE(out[1] >>> 0, 4), buf.writeUInt32BE(out[2] >>> 0, 8), buf.writeUInt32BE(out[3] >>> 0, 12), buf;\n }\n function GHASH(key) {\n this.h = key, this.state = Buffer2.alloc(16, 0), this.cache = Buffer2.allocUnsafe(0);\n }\n GHASH.prototype = {}, GHASH.prototype.ghash = function(block) {\n for (var i = -1;++i < block.length; )\n this.state[i] ^= block[i];\n this._multiply();\n }, GHASH.prototype._multiply = function() {\n for (var Vi = toArray(this.h), Zi = [0, 0, 0, 0], j, xi, lsbVi, i = -1;++i < 128; ) {\n for (xi = (this.state[~~(i / 8)] & 1 << 7 - i % 8) !== 0, xi && (Zi[0] ^= Vi[0], Zi[1] ^= Vi[1], Zi[2] ^= Vi[2], Zi[3] ^= Vi[3]), lsbVi = (Vi[3] & 1) !== 0, j = 3;j > 0; j--)\n Vi[j] = Vi[j] >>> 1 | (Vi[j - 1] & 1) << 31;\n Vi[0] = Vi[0] >>> 1, lsbVi && (Vi[0] = Vi[0] ^ 225 << 24);\n }\n this.state = fromArray(Zi);\n }, GHASH.prototype.update = function(buf) {\n this.cache = Buffer2.concat([this.cache, buf]);\n for (var chunk;this.cache.length >= 16; )\n chunk = this.cache.slice(0, 16), this.cache = this.cache.slice(16), this.ghash(chunk);\n }, GHASH.prototype.final = function(abl, bl) {\n return this.cache.length && this.ghash(Buffer2.concat([this.cache, ZEROES], 16)), this.ghash(fromArray([0, abl, 0, bl])), this.state;\n }, module.exports = GHASH;\n }\n}), require_authCipher = __commonJS({\n \"node_modules/browserify-aes/authCipher.js\"(exports, module) {\n var aes = require_aes(), Buffer2 = require_safe_buffer().Buffer, Transform = require_cipher_base(), inherits = require_inherits_browser(), GHASH = require_ghash(), xor = require_buffer_xor(), incr32 = require_incr32();\n function xorTest(a, b) {\n var out = 0;\n a.length !== b.length && out++;\n for (var len = Math.min(a.length, b.length), i = 0;i < len; ++i)\n out += a[i] ^ b[i];\n return out;\n }\n function calcIv(self2, iv, ck) {\n if (iv.length === 12)\n return self2._finID = Buffer2.concat([iv, Buffer2.from([0, 0, 0, 1])]), Buffer2.concat([iv, Buffer2.from([0, 0, 0, 2])]);\n var ghash = new GHASH(ck), len = iv.length, toPad = len % 16;\n ghash.update(iv), toPad && (toPad = 16 - toPad, ghash.update(Buffer2.alloc(toPad, 0))), ghash.update(Buffer2.alloc(8, 0));\n var ivBits = len * 8, tail = Buffer2.alloc(8);\n tail.writeUIntBE(ivBits, 0, 8), ghash.update(tail), self2._finID = ghash.state;\n var out = Buffer2.from(self2._finID);\n return incr32(out), out;\n }\n function StreamCipher(mode, key, iv, decrypt) {\n Transform.call(this);\n var h = Buffer2.alloc(4, 0);\n this._cipher = new aes.AES(key);\n var ck = this._cipher.encryptBlock(h);\n this._ghash = new GHASH(ck), iv = calcIv(this, iv, ck), this._prev = Buffer2.from(iv), this._cache = Buffer2.allocUnsafe(0), this._secCache = Buffer2.allocUnsafe(0), this._decrypt = decrypt, this._alen = 0, this._len = 0, this._mode = mode, this._authTag = null, this._called = !1;\n }\n inherits(StreamCipher, Transform), StreamCipher.prototype._update = function(chunk) {\n if (!this._called && this._alen) {\n var rump = 16 - this._alen % 16;\n rump < 16 && (rump = Buffer2.alloc(rump, 0), this._ghash.update(rump));\n }\n this._called = !0;\n var out = this._mode.encrypt(this, chunk);\n return this._decrypt \? this._ghash.update(chunk) : this._ghash.update(out), this._len += chunk.length, out;\n }, StreamCipher.prototype._final = function() {\n if (this._decrypt && !this._authTag)\n throw new Error(\"Unsupported state or unable to authenticate data\");\n var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID));\n if (this._decrypt && xorTest(tag, this._authTag))\n throw new Error(\"Unsupported state or unable to authenticate data\");\n this._authTag = tag, this._cipher.scrub();\n }, StreamCipher.prototype.getAuthTag = function() {\n if (this._decrypt || !Buffer2.isBuffer(this._authTag))\n throw new Error(\"Attempting to get auth tag in unsupported state\");\n return this._authTag;\n }, StreamCipher.prototype.setAuthTag = function(tag) {\n if (!this._decrypt)\n throw new Error(\"Attempting to set auth tag in unsupported state\");\n this._authTag = tag;\n }, StreamCipher.prototype.setAAD = function(buf) {\n if (this._called)\n throw new Error(\"Attempting to set AAD in unsupported state\");\n this._ghash.update(buf), this._alen += buf.length;\n }, module.exports = StreamCipher;\n }\n}), require_streamCipher = __commonJS({\n \"node_modules/browserify-aes/streamCipher.js\"(exports, module) {\n var aes = require_aes(), Buffer2 = require_safe_buffer().Buffer, Transform = require_cipher_base(), inherits = require_inherits_browser();\n function StreamCipher(mode, key, iv, decrypt) {\n Transform.call(this), this._cipher = new aes.AES(key), this._prev = Buffer2.from(iv), this._cache = Buffer2.allocUnsafe(0), this._secCache = Buffer2.allocUnsafe(0), this._decrypt = decrypt, this._mode = mode;\n }\n inherits(StreamCipher, Transform), StreamCipher.prototype._update = function(chunk) {\n return this._mode.encrypt(this, chunk, this._decrypt);\n }, StreamCipher.prototype._final = function() {\n this._cipher.scrub();\n }, module.exports = StreamCipher;\n }\n}), require_evp_bytestokey = __commonJS({\n \"node_modules/evp_bytestokey/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, MD5 = require_md5();\n function EVP_BytesToKey(password, salt, keyBits, ivLen) {\n if (Buffer2.isBuffer(password) || (password = Buffer2.from(password, \"binary\")), salt && (Buffer2.isBuffer(salt) || (salt = Buffer2.from(salt, \"binary\")), salt.length !== 8))\n @throwRangeError(\"salt should be Buffer with 8 byte length\");\n for (var keyLen = keyBits / 8, key = Buffer2.alloc(keyLen), iv = Buffer2.alloc(ivLen || 0), tmp = Buffer2.alloc(0);keyLen > 0 || ivLen > 0; ) {\n var hash = new MD5;\n hash.update(tmp), hash.update(password), salt && hash.update(salt), tmp = hash.digest();\n var used = 0;\n if (keyLen > 0) {\n var keyStart = key.length - keyLen;\n used = Math.min(keyLen, tmp.length), tmp.copy(key, keyStart, 0, used), keyLen -= used;\n }\n if (used < tmp.length && ivLen > 0) {\n var ivStart = iv.length - ivLen, length = Math.min(ivLen, tmp.length - used);\n tmp.copy(iv, ivStart, used, used + length), ivLen -= length;\n }\n }\n return tmp.fill(0), { key, iv };\n }\n module.exports = EVP_BytesToKey;\n }\n}), require_encrypter = __commonJS({\n \"node_modules/browserify-aes/encrypter.js\"(exports) {\n var MODES = require_modes(), AuthCipher = require_authCipher(), Buffer2 = require_safe_buffer().Buffer, StreamCipher = require_streamCipher(), Transform = require_cipher_base(), aes = require_aes(), ebtk = require_evp_bytestokey(), inherits = require_inherits_browser();\n function Cipher(mode, key, iv) {\n Transform.call(this), this._cache = new Splitter, this._cipher = new aes.AES(key), this._prev = Buffer2.from(iv), this._mode = mode, this._autopadding = !0;\n }\n inherits(Cipher, Transform), Cipher.prototype._update = function(data) {\n this._cache.add(data);\n for (var chunk, thing, out = [];chunk = this._cache.get(); )\n thing = this._mode.encrypt(this, chunk), out.push(thing);\n return Buffer2.concat(out);\n };\n var PADDING = Buffer2.alloc(16, 16);\n Cipher.prototype._final = function() {\n var chunk = this._cache.flush();\n if (this._autopadding)\n return chunk = this._mode.encrypt(this, chunk), this._cipher.scrub(), chunk;\n if (!chunk.equals(PADDING))\n throw this._cipher.scrub(), new Error(\"data not multiple of block length\");\n }, Cipher.prototype.setAutoPadding = function(setTo) {\n return this._autopadding = !!setTo, this;\n };\n function Splitter() {\n this.cache = Buffer2.allocUnsafe(0);\n }\n Splitter.prototype = {}, Splitter.prototype.add = function(data) {\n this.cache = Buffer2.concat([this.cache, data]);\n }, Splitter.prototype.get = function() {\n if (this.cache.length > 15) {\n var out = this.cache.slice(0, 16);\n return this.cache = this.cache.slice(16), out;\n }\n return null;\n }, Splitter.prototype.flush = function() {\n for (var len = 16 - this.cache.length, padBuff = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n padBuff.writeUInt8(len, i);\n return Buffer2.concat([this.cache, padBuff]);\n };\n function createCipheriv(suite, password, iv) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n password = getArrayBufferOrView(password, \"password\");\n const iv_length = iv\?.length || 0, required_iv_length = config.iv || 0;\n if (iv = iv === null \? EMPTY_BUFFER : getArrayBufferOrView(iv, \"iv\"), password\?.length !== config.key / 8) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n if (config.mode !== \"GCM\" && iv_length !== required_iv_length) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n return config.type === \"stream\" \? new StreamCipher(config.module, password, iv) : config.type === \"auth\" \? new AuthCipher(config.module, password, iv) : new Cipher(config.module, password, iv);\n }\n function createCipher(suite, password) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, config.key, config.iv);\n return createCipheriv(suite, keys.key, keys.iv);\n }\n exports.createCipheriv = createCipheriv, exports.createCipher = createCipher;\n }\n}), require_decrypter = __commonJS({\n \"node_modules/browserify-aes/decrypter.js\"(exports) {\n var AuthCipher = require_authCipher(), Buffer2 = require_safe_buffer().Buffer, MODES = require_modes(), StreamCipher = require_streamCipher(), Transform = require_cipher_base(), aes = require_aes(), ebtk = require_evp_bytestokey(), inherits = require_inherits_browser();\n function Decipher(mode, key, iv) {\n Transform.call(this), this._cache = new Splitter, this._last = void 0, this._cipher = new aes.AES(key), this._prev = Buffer2.from(iv), this._mode = mode, this._autopadding = !0;\n }\n inherits(Decipher, Transform), Decipher.prototype._update = function(data) {\n this._cache.add(data);\n for (var chunk, thing, out = [];chunk = this._cache.get(this._autopadding); )\n thing = this._mode.decrypt(this, chunk), out.push(thing);\n return Buffer2.concat(out);\n }, Decipher.prototype._final = function() {\n var chunk = this._cache.flush();\n if (this._autopadding)\n return unpad(this._mode.decrypt(this, chunk));\n if (chunk)\n throw new Error(\"data not multiple of block length\");\n }, Decipher.prototype.setAutoPadding = function(setTo) {\n return this._autopadding = !!setTo, this;\n };\n function Splitter() {\n this.cache = Buffer2.allocUnsafe(0);\n }\n Splitter.prototype = {}, Splitter.prototype.add = function(data) {\n this.cache = Buffer2.concat([this.cache, data]);\n }, Splitter.prototype.get = function(autoPadding) {\n var out;\n if (autoPadding) {\n if (this.cache.length > 16)\n return out = this.cache.slice(0, 16), this.cache = this.cache.slice(16), out;\n } else if (this.cache.length >= 16)\n return out = this.cache.slice(0, 16), this.cache = this.cache.slice(16), out;\n return null;\n }, Splitter.prototype.flush = function() {\n if (this.cache.length)\n return this.cache;\n };\n function unpad(last) {\n var padded = last[15];\n if (padded < 1 || padded > 16)\n throw new Error(\"unable to decrypt data\");\n for (var i = -1;++i < padded; )\n if (last[i + (16 - padded)] !== padded)\n throw new Error(\"unable to decrypt data\");\n if (padded !== 16)\n return last.slice(0, 16 - padded);\n }\n function createDecipheriv(suite, password, iv) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n password = getArrayBufferOrView(password, \"password\");\n const iv_length = iv\?.length || 0, required_iv_length = config.iv || 0;\n if (iv = iv === null \? EMPTY_BUFFER : getArrayBufferOrView(iv, \"iv\"), config.mode !== \"GCM\" && iv_length !== required_iv_length) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n if (password.length !== config.key / 8) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n return config.type === \"stream\" \? new StreamCipher(config.module, password, iv, !0) : config.type === \"auth\" \? new AuthCipher(config.module, password, iv, !0) : new Decipher(config.module, password, iv);\n }\n function createDecipher(suite, password) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, config.key, config.iv);\n return createDecipheriv(suite, keys.key, keys.iv);\n }\n exports.createDecipher = createDecipher, exports.createDecipheriv = createDecipheriv;\n }\n}), require_browser5 = __commonJS({\n \"node_modules/browserify-aes/browser.js\"(exports) {\n var ciphers = require_encrypter(), deciphers = require_decrypter(), modes = require_list();\n function getCiphers() {\n return Object.keys(modes);\n }\n exports.createCipher = exports.Cipher = ciphers.createCipher, exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv, exports.createDecipher = exports.Decipher = deciphers.createDecipher, exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv, exports.listCiphers = exports.getCiphers = getCiphers;\n }\n}), require_modes2 = __commonJS({\n \"node_modules/browserify-des/modes.js\"(exports) {\n exports[\"des-ecb\"] = {\n key: 8,\n iv: 0\n }, exports[\"des-cbc\"] = exports.des = {\n key: 8,\n iv: 8\n }, exports[\"des-ede3-cbc\"] = exports.des3 = {\n key: 24,\n iv: 8\n }, exports[\"des-ede3\"] = {\n key: 24,\n iv: 0\n }, exports[\"des-ede-cbc\"] = {\n key: 16,\n iv: 8\n }, exports[\"des-ede\"] = {\n key: 16,\n iv: 0\n };\n }\n}), require_browser6 = __commonJS({\n \"node_modules/browserify-cipher/browser.js\"(exports) {\n var DES = require_browserify_des(), aes = require_browser5(), aesModes = require_modes(), desModes = require_modes2(), ebtk = require_evp_bytestokey();\n function createCipher(suite, password) {\n suite = suite.toLowerCase();\n var keyLen, ivLen;\n if (aesModes[suite])\n keyLen = aesModes[suite].key, ivLen = aesModes[suite].iv;\n else if (desModes[suite])\n keyLen = desModes[suite].key * 8, ivLen = desModes[suite].iv;\n else\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, keyLen, ivLen);\n return createCipheriv(suite, keys.key, keys.iv);\n }\n function createDecipher(suite, password) {\n suite = suite.toLowerCase();\n var keyLen, ivLen;\n if (aesModes[suite])\n keyLen = aesModes[suite].key, ivLen = aesModes[suite].iv;\n else if (desModes[suite])\n keyLen = desModes[suite].key * 8, ivLen = desModes[suite].iv;\n else\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, keyLen, ivLen);\n return createDecipheriv(suite, keys.key, keys.iv);\n }\n function createCipheriv(suite, key, iv) {\n if (suite = suite.toLowerCase(), aesModes[suite])\n return aes.createCipheriv(suite, key, iv);\n if (desModes[suite])\n return new DES({ key, iv, mode: suite });\n @throwTypeError(\"invalid suite type\");\n }\n function createDecipheriv(suite, key, iv) {\n if (suite = suite.toLowerCase(), aesModes[suite])\n return aes.createDecipheriv(suite, key, iv);\n if (desModes[suite])\n return new DES({ key, iv, mode: suite, decrypt: !0 });\n @throwTypeError(\"invalid suite type\");\n }\n function getCiphers() {\n return Object.keys(desModes).concat(aes.getCiphers());\n }\n exports.createCipher = exports.Cipher = createCipher, exports.createCipheriv = exports.Cipheriv = createCipheriv, exports.createDecipher = exports.Decipher = createDecipher, exports.createDecipheriv = exports.Decipheriv = createDecipheriv, exports.listCiphers = exports.getCiphers = getCiphers;\n }\n}), require_bn = __commonJS({\n \"node_modules/diffie-hellman/node_modules/bn.js/lib/bn.js\"(exports, module) {\n (function(module2, exports2) {\n function assert(val, msg) {\n if (!val)\n throw new Error(msg || \"Assertion failed\");\n }\n function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function() {\n };\n TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor, ctor.prototype.constructor = ctor;\n }\n function BN(number, base, endian) {\n if (BN.isBN(number))\n return number;\n this.negative = 0, this.words = null, this.length = 0, this.red = null, number !== null && ((base === \"le\" || base === \"be\") && (endian = base, base = 10), this._init(number || 0, base || 10, endian || \"be\"));\n }\n BN.prototype = {}, typeof module2 == \"object\" \? module2.exports = BN : exports2.BN = BN, BN.BN = BN, BN.wordSize = 26;\n var Buffer2 = Buffer;\n BN.isBN = function(num) {\n return num instanceof BN \? !0 : num !== null && typeof num == \"object\" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n }, BN.max = function(left, right) {\n return left.cmp(right) > 0 \? left : right;\n }, BN.min = function(left, right) {\n return left.cmp(right) < 0 \? left : right;\n }, BN.prototype._init = function(number, base, endian) {\n if (typeof number == \"number\")\n return this._initNumber(number, base, endian);\n if (typeof number == \"object\")\n return this._initArray(number, base, endian);\n base === \"hex\" && (base = 16), assert(base === (base | 0) && base >= 2 && base <= 36), number = number.toString().replace(/\\s+/g, \"\");\n var start = 0;\n number[0] === \"-\" && (start++, this.negative = 1), start < number.length && (base === 16 \? this._parseHex(number, start, endian) : (this._parseBase(number, base, start), endian === \"le\" && this._initArray(this.toArray(), base, endian)));\n }, BN.prototype._initNumber = function(number, base, endian) {\n number < 0 && (this.negative = 1, number = -number), number < 67108864 \? (this.words = [number & 67108863], this.length = 1) : number < 4503599627370496 \? (this.words = [number & 67108863, number / 67108864 & 67108863], this.length = 2) : (assert(number < 9007199254740992), this.words = [number & 67108863, number / 67108864 & 67108863, 1], this.length = 3), endian === \"le\" && this._initArray(this.toArray(), base, endian);\n }, BN.prototype._initArray = function(number, base, endian) {\n if (assert(typeof number.length == \"number\"), number.length <= 0)\n return this.words = [0], this.length = 1, this;\n this.length = Math.ceil(number.length / 3), this.words = new Array(this.length);\n for (var i = 0;i < this.length; i++)\n this.words[i] = 0;\n var j, w, off = 0;\n if (endian === \"be\")\n for (i = number.length - 1, j = 0;i >= 0; i -= 3)\n w = number[i] | number[i - 1] << 8 | number[i - 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26 && (off -= 26, j++);\n else if (endian === \"le\")\n for (i = 0, j = 0;i < number.length; i += 3)\n w = number[i] | number[i + 1] << 8 | number[i + 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26 && (off -= 26, j++);\n return this.strip();\n };\n function parseHex4Bits(string, index) {\n var c = string.charCodeAt(index);\n return c >= 65 && c <= 70 \? c - 55 : c >= 97 && c <= 102 \? c - 87 : c - 48 & 15;\n }\n function parseHexByte(string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n return index - 1 >= lowerBound && (r |= parseHex4Bits(string, index - 1) << 4), r;\n }\n BN.prototype._parseHex = function(number, start, endian) {\n this.length = Math.ceil((number.length - start) / 6), this.words = new Array(this.length);\n for (var i = 0;i < this.length; i++)\n this.words[i] = 0;\n var off = 0, j = 0, w;\n if (endian === \"be\")\n for (i = number.length - 1;i >= start; i -= 2)\n w = parseHexByte(number, start, i) << off, this.words[j] |= w & 67108863, off >= 18 \? (off -= 18, j += 1, this.words[j] |= w >>> 26) : off += 8;\n else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 \? start + 1 : start;i < number.length; i += 2)\n w = parseHexByte(number, start, i) << off, this.words[j] |= w & 67108863, off >= 18 \? (off -= 18, j += 1, this.words[j] |= w >>> 26) : off += 8;\n }\n this.strip();\n };\n function parseBase(str, start, end, mul) {\n for (var r = 0, len = Math.min(str.length, end), i = start;i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n r *= mul, c >= 49 \? r += c - 49 + 10 : c >= 17 \? r += c - 17 + 10 : r += c;\n }\n return r;\n }\n BN.prototype._parseBase = function(number, base, start) {\n this.words = [0], this.length = 1;\n for (var limbLen = 0, limbPow = 1;limbPow <= 67108863; limbPow *= base)\n limbLen++;\n limbLen--, limbPow = limbPow / base | 0;\n for (var total = number.length - start, mod = total % limbLen, end = Math.min(total, total - mod) + start, word = 0, i = start;i < end; i += limbLen)\n word = parseBase(number, i, i + limbLen, base), this.imuln(limbPow), this.words[0] + word < 67108864 \? this.words[0] += word : this._iaddn(word);\n if (mod !== 0) {\n var pow = 1;\n for (word = parseBase(number, i, number.length, base), i = 0;i < mod; i++)\n pow *= base;\n this.imuln(pow), this.words[0] + word < 67108864 \? this.words[0] += word : this._iaddn(word);\n }\n this.strip();\n }, BN.prototype.copy = function(dest) {\n dest.words = new Array(this.length);\n for (var i = 0;i < this.length; i++)\n dest.words[i] = this.words[i];\n dest.length = this.length, dest.negative = this.negative, dest.red = this.red;\n }, BN.prototype.clone = function() {\n var r = new BN(null);\n return this.copy(r), r;\n }, BN.prototype._expand = function(size) {\n for (;this.length < size; )\n this.words[this.length++] = 0;\n return this;\n }, BN.prototype.strip = function() {\n for (;this.length > 1 && this.words[this.length - 1] === 0; )\n this.length--;\n return this._normSign();\n }, BN.prototype._normSign = function() {\n return this.length === 1 && this.words[0] === 0 && (this.negative = 0), this;\n }, BN.prototype.inspect = function() {\n return (this.red \? \"<BN-R: \" : \"<BN: \") + this.toString(16) + \">\";\n };\n var zeros = [\n \"\",\n \"0\",\n \"00\",\n \"000\",\n \"0000\",\n \"00000\",\n \"000000\",\n \"0000000\",\n \"00000000\",\n \"000000000\",\n \"0000000000\",\n \"00000000000\",\n \"000000000000\",\n \"0000000000000\",\n \"00000000000000\",\n \"000000000000000\",\n \"0000000000000000\",\n \"00000000000000000\",\n \"000000000000000000\",\n \"0000000000000000000\",\n \"00000000000000000000\",\n \"000000000000000000000\",\n \"0000000000000000000000\",\n \"00000000000000000000000\",\n \"000000000000000000000000\",\n \"0000000000000000000000000\"\n ], groupSizes = [\n 0,\n 0,\n 25,\n 16,\n 12,\n 11,\n 10,\n 9,\n 8,\n 8,\n 7,\n 7,\n 7,\n 7,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5\n ], groupBases = [\n 0,\n 0,\n 33554432,\n 43046721,\n 16777216,\n 48828125,\n 60466176,\n 40353607,\n 16777216,\n 43046721,\n 1e7,\n 19487171,\n 35831808,\n 62748517,\n 7529536,\n 11390625,\n 16777216,\n 24137569,\n 34012224,\n 47045881,\n 64000000,\n 4084101,\n 5153632,\n 6436343,\n 7962624,\n 9765625,\n 11881376,\n 14348907,\n 17210368,\n 20511149,\n 24300000,\n 28629151,\n 33554432,\n 39135393,\n 45435424,\n 52521875,\n 60466176\n ];\n BN.prototype.toString = function(base, padding) {\n base = base || 10, padding = padding | 0 || 1;\n var out;\n if (base === 16 || base === \"hex\") {\n out = \"\";\n for (var off = 0, carry = 0, i = 0;i < this.length; i++) {\n var w = this.words[i], word = ((w << off | carry) & 16777215).toString(16);\n carry = w >>> 24 - off & 16777215, carry !== 0 || i !== this.length - 1 \? out = zeros[6 - word.length] + word + out : out = word + out, off += 2, off >= 26 && (off -= 26, i--);\n }\n for (carry !== 0 && (out = carry.toString(16) + out);out.length % padding !== 0; )\n out = \"0\" + out;\n return this.negative !== 0 && (out = \"-\" + out), out;\n }\n if (base === (base | 0) && base >= 2 && base <= 36) {\n var groupSize = groupSizes[base], groupBase = groupBases[base];\n out = \"\";\n var c = this.clone();\n for (c.negative = 0;!c.isZero(); ) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase), c.isZero() \? out = r + out : out = zeros[groupSize - r.length] + r + out;\n }\n for (this.isZero() && (out = \"0\" + out);out.length % padding !== 0; )\n out = \"0\" + out;\n return this.negative !== 0 && (out = \"-\" + out), out;\n }\n assert(!1, \"Base should be between 2 and 36\");\n }, BN.prototype.toNumber = function() {\n var ret = this.words[0];\n return this.length === 2 \? ret += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 \? ret += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && assert(!1, \"Number can only safely store up to 53 bits\"), this.negative !== 0 \? -ret : ret;\n }, BN.prototype.toJSON = function() {\n return this.toString(16);\n }, BN.prototype.toBuffer = function(endian, length) {\n return assert(typeof Buffer2 < \"u\"), this.toArrayLike(Buffer2, endian, length);\n }, BN.prototype.toArray = function(endian, length) {\n return this.toArrayLike(Array, endian, length);\n }, BN.prototype.toArrayLike = function(ArrayType, endian, length) {\n var byteLength = this.byteLength(), reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, \"byte array longer than desired length\"), assert(reqLength > 0, \"Requested array length <= 0\"), this.strip();\n var littleEndian = endian === \"le\", res = new ArrayType(reqLength), b, i, q = this.clone();\n if (littleEndian) {\n for (i = 0;!q.isZero(); i++)\n b = q.andln(255), q.iushrn(8), res[i] = b;\n for (;i < reqLength; i++)\n res[i] = 0;\n } else {\n for (i = 0;i < reqLength - byteLength; i++)\n res[i] = 0;\n for (i = 0;!q.isZero(); i++)\n b = q.andln(255), q.iushrn(8), res[reqLength - i - 1] = b;\n }\n return res;\n }, Math.clz32 \? BN.prototype._countBits = function(w) {\n return 32 - Math.clz32(w);\n } : BN.prototype._countBits = function(w) {\n var t = w, r = 0;\n return t >= 4096 && (r += 13, t >>>= 13), t >= 64 && (r += 7, t >>>= 7), t >= 8 && (r += 4, t >>>= 4), t >= 2 && (r += 2, t >>>= 2), r + t;\n }, BN.prototype._zeroBits = function(w) {\n if (w === 0)\n return 26;\n var t = w, r = 0;\n return (t & 8191) === 0 && (r += 13, t >>>= 13), (t & 127) === 0 && (r += 7, t >>>= 7), (t & 15) === 0 && (r += 4, t >>>= 4), (t & 3) === 0 && (r += 2, t >>>= 2), (t & 1) === 0 && r++, r;\n }, BN.prototype.bitLength = function() {\n var w = this.words[this.length - 1], hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n function toBitArray(num) {\n for (var w = new Array(num.bitLength()), bit = 0;bit < w.length; bit++) {\n var off = bit / 26 | 0, wbit = bit % 26;\n w[bit] = (num.words[off] & 1 << wbit) >>> wbit;\n }\n return w;\n }\n BN.prototype.zeroBits = function() {\n if (this.isZero())\n return 0;\n for (var r = 0, i = 0;i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n if (r += b, b !== 26)\n break;\n }\n return r;\n }, BN.prototype.byteLength = function() {\n return Math.ceil(this.bitLength() / 8);\n }, BN.prototype.toTwos = function(width) {\n return this.negative !== 0 \? this.abs().inotn(width).iaddn(1) : this.clone();\n }, BN.prototype.fromTwos = function(width) {\n return this.testn(width - 1) \? this.notn(width).iaddn(1).ineg() : this.clone();\n }, BN.prototype.isNeg = function() {\n return this.negative !== 0;\n }, BN.prototype.neg = function() {\n return this.clone().ineg();\n }, BN.prototype.ineg = function() {\n return this.isZero() || (this.negative ^= 1), this;\n }, BN.prototype.iuor = function(num) {\n for (;this.length < num.length; )\n this.words[this.length++] = 0;\n for (var i = 0;i < num.length; i++)\n this.words[i] = this.words[i] | num.words[i];\n return this.strip();\n }, BN.prototype.ior = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuor(num);\n }, BN.prototype.or = function(num) {\n return this.length > num.length \? this.clone().ior(num) : num.clone().ior(this);\n }, BN.prototype.uor = function(num) {\n return this.length > num.length \? this.clone().iuor(num) : num.clone().iuor(this);\n }, BN.prototype.iuand = function(num) {\n var b;\n this.length > num.length \? b = num : b = this;\n for (var i = 0;i < b.length; i++)\n this.words[i] = this.words[i] & num.words[i];\n return this.length = b.length, this.strip();\n }, BN.prototype.iand = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuand(num);\n }, BN.prototype.and = function(num) {\n return this.length > num.length \? this.clone().iand(num) : num.clone().iand(this);\n }, BN.prototype.uand = function(num) {\n return this.length > num.length \? this.clone().iuand(num) : num.clone().iuand(this);\n }, BN.prototype.iuxor = function(num) {\n var a, b;\n this.length > num.length \? (a = this, b = num) : (a = num, b = this);\n for (var i = 0;i < b.length; i++)\n this.words[i] = a.words[i] ^ b.words[i];\n if (this !== a)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this.length = a.length, this.strip();\n }, BN.prototype.ixor = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuxor(num);\n }, BN.prototype.xor = function(num) {\n return this.length > num.length \? this.clone().ixor(num) : num.clone().ixor(this);\n }, BN.prototype.uxor = function(num) {\n return this.length > num.length \? this.clone().iuxor(num) : num.clone().iuxor(this);\n }, BN.prototype.inotn = function(width) {\n assert(typeof width == \"number\" && width >= 0);\n var bytesNeeded = Math.ceil(width / 26) | 0, bitsLeft = width % 26;\n this._expand(bytesNeeded), bitsLeft > 0 && bytesNeeded--;\n for (var i = 0;i < bytesNeeded; i++)\n this.words[i] = ~this.words[i] & 67108863;\n return bitsLeft > 0 && (this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft), this.strip();\n }, BN.prototype.notn = function(width) {\n return this.clone().inotn(width);\n }, BN.prototype.setn = function(bit, val) {\n assert(typeof bit == \"number\" && bit >= 0);\n var off = bit / 26 | 0, wbit = bit % 26;\n return this._expand(off + 1), val \? this.words[off] = this.words[off] | 1 << wbit : this.words[off] = this.words[off] & ~(1 << wbit), this.strip();\n }, BN.prototype.iadd = function(num) {\n var r;\n if (this.negative !== 0 && num.negative === 0)\n return this.negative = 0, r = this.isub(num), this.negative ^= 1, this._normSign();\n if (this.negative === 0 && num.negative !== 0)\n return num.negative = 0, r = this.isub(num), num.negative = 1, r._normSign();\n var a, b;\n this.length > num.length \? (a = this, b = num) : (a = num, b = this);\n for (var carry = 0, i = 0;i < b.length; i++)\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry, this.words[i] = r & 67108863, carry = r >>> 26;\n for (;carry !== 0 && i < a.length; i++)\n r = (a.words[i] | 0) + carry, this.words[i] = r & 67108863, carry = r >>> 26;\n if (this.length = a.length, carry !== 0)\n this.words[this.length] = carry, this.length++;\n else if (a !== this)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this;\n }, BN.prototype.add = function(num) {\n var res;\n return num.negative !== 0 && this.negative === 0 \? (num.negative = 0, res = this.sub(num), num.negative ^= 1, res) : num.negative === 0 && this.negative !== 0 \? (this.negative = 0, res = num.sub(this), this.negative = 1, res) : this.length > num.length \? this.clone().iadd(num) : num.clone().iadd(this);\n }, BN.prototype.isub = function(num) {\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n return num.negative = 1, r._normSign();\n } else if (this.negative !== 0)\n return this.negative = 0, this.iadd(num), this.negative = 1, this._normSign();\n var cmp = this.cmp(num);\n if (cmp === 0)\n return this.negative = 0, this.length = 1, this.words[0] = 0, this;\n var a, b;\n cmp > 0 \? (a = this, b = num) : (a = num, b = this);\n for (var carry = 0, i = 0;i < b.length; i++)\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry, carry = r >> 26, this.words[i] = r & 67108863;\n for (;carry !== 0 && i < a.length; i++)\n r = (a.words[i] | 0) + carry, carry = r >> 26, this.words[i] = r & 67108863;\n if (carry === 0 && i < a.length && a !== this)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this.length = Math.max(this.length, i), a !== this && (this.negative = 1), this.strip();\n }, BN.prototype.sub = function(num) {\n return this.clone().isub(num);\n };\n function smallMulTo(self2, num, out) {\n out.negative = num.negative ^ self2.negative;\n var len = self2.length + num.length | 0;\n out.length = len, len = len - 1 | 0;\n var a = self2.words[0] | 0, b = num.words[0] | 0, r = a * b, lo = r & 67108863, carry = r / 67108864 | 0;\n out.words[0] = lo;\n for (var k = 1;k < len; k++) {\n for (var ncarry = carry >>> 26, rword = carry & 67108863, maxJ = Math.min(k, num.length - 1), j = Math.max(0, k - self2.length + 1);j <= maxJ; j++) {\n var i = k - j | 0;\n a = self2.words[i] | 0, b = num.words[j] | 0, r = a * b + rword, ncarry += r / 67108864 | 0, rword = r & 67108863;\n }\n out.words[k] = rword | 0, carry = ncarry | 0;\n }\n return carry !== 0 \? out.words[k] = carry | 0 : out.length--, out.strip();\n }\n var comb10MulTo = function(self2, num, out) {\n var a = self2.words, b = num.words, o = out.words, c = 0, lo, mid, hi, a0 = a[0] | 0, al0 = a0 & 8191, ah0 = a0 >>> 13, a1 = a[1] | 0, al1 = a1 & 8191, ah1 = a1 >>> 13, a2 = a[2] | 0, al2 = a2 & 8191, ah2 = a2 >>> 13, a3 = a[3] | 0, al3 = a3 & 8191, ah3 = a3 >>> 13, a4 = a[4] | 0, al4 = a4 & 8191, ah4 = a4 >>> 13, a5 = a[5] | 0, al5 = a5 & 8191, ah5 = a5 >>> 13, a6 = a[6] | 0, al6 = a6 & 8191, ah6 = a6 >>> 13, a7 = a[7] | 0, al7 = a7 & 8191, ah7 = a7 >>> 13, a8 = a[8] | 0, al8 = a8 & 8191, ah8 = a8 >>> 13, a9 = a[9] | 0, al9 = a9 & 8191, ah9 = a9 >>> 13, b0 = b[0] | 0, bl0 = b0 & 8191, bh0 = b0 >>> 13, b1 = b[1] | 0, bl1 = b1 & 8191, bh1 = b1 >>> 13, b2 = b[2] | 0, bl2 = b2 & 8191, bh2 = b2 >>> 13, b3 = b[3] | 0, bl3 = b3 & 8191, bh3 = b3 >>> 13, b4 = b[4] | 0, bl4 = b4 & 8191, bh4 = b4 >>> 13, b5 = b[5] | 0, bl5 = b5 & 8191, bh5 = b5 >>> 13, b6 = b[6] | 0, bl6 = b6 & 8191, bh6 = b6 >>> 13, b7 = b[7] | 0, bl7 = b7 & 8191, bh7 = b7 >>> 13, b8 = b[8] | 0, bl8 = b8 & 8191, bh8 = b8 >>> 13, b9 = b[9] | 0, bl9 = b9 & 8191, bh9 = b9 >>> 13;\n out.negative = self2.negative ^ num.negative, out.length = 19, lo = Math.imul(al0, bl0), mid = Math.imul(al0, bh0), mid = mid + Math.imul(ah0, bl0) | 0, hi = Math.imul(ah0, bh0);\n var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0, w0 &= 67108863, lo = Math.imul(al1, bl0), mid = Math.imul(al1, bh0), mid = mid + Math.imul(ah1, bl0) | 0, hi = Math.imul(ah1, bh0), lo = lo + Math.imul(al0, bl1) | 0, mid = mid + Math.imul(al0, bh1) | 0, mid = mid + Math.imul(ah0, bl1) | 0, hi = hi + Math.imul(ah0, bh1) | 0;\n var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0, w1 &= 67108863, lo = Math.imul(al2, bl0), mid = Math.imul(al2, bh0), mid = mid + Math.imul(ah2, bl0) | 0, hi = Math.imul(ah2, bh0), lo = lo + Math.imul(al1, bl1) | 0, mid = mid + Math.imul(al1, bh1) | 0, mid = mid + Math.imul(ah1, bl1) | 0, hi = hi + Math.imul(ah1, bh1) | 0, lo = lo + Math.imul(al0, bl2) | 0, mid = mid + Math.imul(al0, bh2) | 0, mid = mid + Math.imul(ah0, bl2) | 0, hi = hi + Math.imul(ah0, bh2) | 0;\n var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0, w2 &= 67108863, lo = Math.imul(al3, bl0), mid = Math.imul(al3, bh0), mid = mid + Math.imul(ah3, bl0) | 0, hi = Math.imul(ah3, bh0), lo = lo + Math.imul(al2, bl1) | 0, mid = mid + Math.imul(al2, bh1) | 0, mid = mid + Math.imul(ah2, bl1) | 0, hi = hi + Math.imul(ah2, bh1) | 0, lo = lo + Math.imul(al1, bl2) | 0, mid = mid + Math.imul(al1, bh2) | 0, mid = mid + Math.imul(ah1, bl2) | 0, hi = hi + Math.imul(ah1, bh2) | 0, lo = lo + Math.imul(al0, bl3) | 0, mid = mid + Math.imul(al0, bh3) | 0, mid = mid + Math.imul(ah0, bl3) | 0, hi = hi + Math.imul(ah0, bh3) | 0;\n var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0, w3 &= 67108863, lo = Math.imul(al4, bl0), mid = Math.imul(al4, bh0), mid = mid + Math.imul(ah4, bl0) | 0, hi = Math.imul(ah4, bh0), lo = lo + Math.imul(al3, bl1) | 0, mid = mid + Math.imul(al3, bh1) | 0, mid = mid + Math.imul(ah3, bl1) | 0, hi = hi + Math.imul(ah3, bh1) | 0, lo = lo + Math.imul(al2, bl2) | 0, mid = mid + Math.imul(al2, bh2) | 0, mid = mid + Math.imul(ah2, bl2) | 0, hi = hi + Math.imul(ah2, bh2) | 0, lo = lo + Math.imul(al1, bl3) | 0, mid = mid + Math.imul(al1, bh3) | 0, mid = mid + Math.imul(ah1, bl3) | 0, hi = hi + Math.imul(ah1, bh3) | 0, lo = lo + Math.imul(al0, bl4) | 0, mid = mid + Math.imul(al0, bh4) | 0, mid = mid + Math.imul(ah0, bl4) | 0, hi = hi + Math.imul(ah0, bh4) | 0;\n var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0, w4 &= 67108863, lo = Math.imul(al5, bl0), mid = Math.imul(al5, bh0), mid = mid + Math.imul(ah5, bl0) | 0, hi = Math.imul(ah5, bh0), lo = lo + Math.imul(al4, bl1) | 0, mid = mid + Math.imul(al4, bh1) | 0, mid = mid + Math.imul(ah4, bl1) | 0, hi = hi + Math.imul(ah4, bh1) | 0, lo = lo + Math.imul(al3, bl2) | 0, mid = mid + Math.imul(al3, bh2) | 0, mid = mid + Math.imul(ah3, bl2) | 0, hi = hi + Math.imul(ah3, bh2) | 0, lo = lo + Math.imul(al2, bl3) | 0, mid = mid + Math.imul(al2, bh3) | 0, mid = mid + Math.imul(ah2, bl3) | 0, hi = hi + Math.imul(ah2, bh3) | 0, lo = lo + Math.imul(al1, bl4) | 0, mid = mid + Math.imul(al1, bh4) | 0, mid = mid + Math.imul(ah1, bl4) | 0, hi = hi + Math.imul(ah1, bh4) | 0, lo = lo + Math.imul(al0, bl5) | 0, mid = mid + Math.imul(al0, bh5) | 0, mid = mid + Math.imul(ah0, bl5) | 0, hi = hi + Math.imul(ah0, bh5) | 0;\n var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0, w5 &= 67108863, lo = Math.imul(al6, bl0), mid = Math.imul(al6, bh0), mid = mid + Math.imul(ah6, bl0) | 0, hi = Math.imul(ah6, bh0), lo = lo + Math.imul(al5, bl1) | 0, mid = mid + Math.imul(al5, bh1) | 0, mid = mid + Math.imul(ah5, bl1) | 0, hi = hi + Math.imul(ah5, bh1) | 0, lo = lo + Math.imul(al4, bl2) | 0, mid = mid + Math.imul(al4, bh2) | 0, mid = mid + Math.imul(ah4, bl2) | 0, hi = hi + Math.imul(ah4, bh2) | 0, lo = lo + Math.imul(al3, bl3) | 0, mid = mid + Math.imul(al3, bh3) | 0, mid = mid + Math.imul(ah3, bl3) | 0, hi = hi + Math.imul(ah3, bh3) | 0, lo = lo + Math.imul(al2, bl4) | 0, mid = mid + Math.imul(al2, bh4) | 0, mid = mid + Math.imul(ah2, bl4) | 0, hi = hi + Math.imul(ah2, bh4) | 0, lo = lo + Math.imul(al1, bl5) | 0, mid = mid + Math.imul(al1, bh5) | 0, mid = mid + Math.imul(ah1, bl5) | 0, hi = hi + Math.imul(ah1, bh5) | 0, lo = lo + Math.imul(al0, bl6) | 0, mid = mid + Math.imul(al0, bh6) | 0, mid = mid + Math.imul(ah0, bl6) | 0, hi = hi + Math.imul(ah0, bh6) | 0;\n var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0, w6 &= 67108863, lo = Math.imul(al7, bl0), mid = Math.imul(al7, bh0), mid = mid + Math.imul(ah7, bl0) | 0, hi = Math.imul(ah7, bh0), lo = lo + Math.imul(al6, bl1) | 0, mid = mid + Math.imul(al6, bh1) | 0, mid = mid + Math.imul(ah6, bl1) | 0, hi = hi + Math.imul(ah6, bh1) | 0, lo = lo + Math.imul(al5, bl2) | 0, mid = mid + Math.imul(al5, bh2) | 0, mid = mid + Math.imul(ah5, bl2) | 0, hi = hi + Math.imul(ah5, bh2) | 0, lo = lo + Math.imul(al4, bl3) | 0, mid = mid + Math.imul(al4, bh3) | 0, mid = mid + Math.imul(ah4, bl3) | 0, hi = hi + Math.imul(ah4, bh3) | 0, lo = lo + Math.imul(al3, bl4) | 0, mid = mid + Math.imul(al3, bh4) | 0, mid = mid + Math.imul(ah3, bl4) | 0, hi = hi + Math.imul(ah3, bh4) | 0, lo = lo + Math.imul(al2, bl5) | 0, mid = mid + Math.imul(al2, bh5) | 0, mid = mid + Math.imul(ah2, bl5) | 0, hi = hi + Math.imul(ah2, bh5) | 0, lo = lo + Math.imul(al1, bl6) | 0, mid = mid + Math.imul(al1, bh6) | 0, mid = mid + Math.imul(ah1, bl6) | 0, hi = hi + Math.imul(ah1, bh6) | 0, lo = lo + Math.imul(al0, bl7) | 0, mid = mid + Math.imul(al0, bh7) | 0, mid = mid + Math.imul(ah0, bl7) | 0, hi = hi + Math.imul(ah0, bh7) | 0;\n var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0, w7 &= 67108863, lo = Math.imul(al8, bl0), mid = Math.imul(al8, bh0), mid = mid + Math.imul(ah8, bl0) | 0, hi = Math.imul(ah8, bh0), lo = lo + Math.imul(al7, bl1) | 0, mid = mid + Math.imul(al7, bh1) | 0, mid = mid + Math.imul(ah7, bl1) | 0, hi = hi + Math.imul(ah7, bh1) | 0, lo = lo + Math.imul(al6, bl2) | 0, mid = mid + Math.imul(al6, bh2) | 0, mid = mid + Math.imul(ah6, bl2) | 0, hi = hi + Math.imul(ah6, bh2) | 0, lo = lo + Math.imul(al5, bl3) | 0, mid = mid + Math.imul(al5, bh3) | 0, mid = mid + Math.imul(ah5, bl3) | 0, hi = hi + Math.imul(ah5, bh3) | 0, lo = lo + Math.imul(al4, bl4) | 0, mid = mid + Math.imul(al4, bh4) | 0, mid = mid + Math.imul(ah4, bl4) | 0, hi = hi + Math.imul(ah4, bh4) | 0, lo = lo + Math.imul(al3, bl5) | 0, mid = mid + Math.imul(al3, bh5) | 0, mid = mid + Math.imul(ah3, bl5) | 0, hi = hi + Math.imul(ah3, bh5) | 0, lo = lo + Math.imul(al2, bl6) | 0, mid = mid + Math.imul(al2, bh6) | 0, mid = mid + Math.imul(ah2, bl6) | 0, hi = hi + Math.imul(ah2, bh6) | 0, lo = lo + Math.imul(al1, bl7) | 0, mid = mid + Math.imul(al1, bh7) | 0, mid = mid + Math.imul(ah1, bl7) | 0, hi = hi + Math.imul(ah1, bh7) | 0, lo = lo + Math.imul(al0, bl8) | 0, mid = mid + Math.imul(al0, bh8) | 0, mid = mid + Math.imul(ah0, bl8) | 0, hi = hi + Math.imul(ah0, bh8) | 0;\n var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0, w8 &= 67108863, lo = Math.imul(al9, bl0), mid = Math.imul(al9, bh0), mid = mid + Math.imul(ah9, bl0) | 0, hi = Math.imul(ah9, bh0), lo = lo + Math.imul(al8, bl1) | 0, mid = mid + Math.imul(al8, bh1) | 0, mid = mid + Math.imul(ah8, bl1) | 0, hi = hi + Math.imul(ah8, bh1) | 0, lo = lo + Math.imul(al7, bl2) | 0, mid = mid + Math.imul(al7, bh2) | 0, mid = mid + Math.imul(ah7, bl2) | 0, hi = hi + Math.imul(ah7, bh2) | 0, lo = lo + Math.imul(al6, bl3) | 0, mid = mid + Math.imul(al6, bh3) | 0, mid = mid + Math.imul(ah6, bl3) | 0, hi = hi + Math.imul(ah6, bh3) | 0, lo = lo + Math.imul(al5, bl4) | 0, mid = mid + Math.imul(al5, bh4) | 0, mid = mid + Math.imul(ah5, bl4) | 0, hi = hi + Math.imul(ah5, bh4) | 0, lo = lo + Math.imul(al4, bl5) | 0, mid = mid + Math.imul(al4, bh5) | 0, mid = mid + Math.imul(ah4, bl5) | 0, hi = hi + Math.imul(ah4, bh5) | 0, lo = lo + Math.imul(al3, bl6) | 0, mid = mid + Math.imul(al3, bh6) | 0, mid = mid + Math.imul(ah3, bl6) | 0, hi = hi + Math.imul(ah3, bh6) | 0, lo = lo + Math.imul(al2, bl7) | 0, mid = mid + Math.imul(al2, bh7) | 0, mid = mid + Math.imul(ah2, bl7) | 0, hi = hi + Math.imul(ah2, bh7) | 0, lo = lo + Math.imul(al1, bl8) | 0, mid = mid + Math.imul(al1, bh8) | 0, mid = mid + Math.imul(ah1, bl8) | 0, hi = hi + Math.imul(ah1, bh8) | 0, lo = lo + Math.imul(al0, bl9) | 0, mid = mid + Math.imul(al0, bh9) | 0, mid = mid + Math.imul(ah0, bl9) | 0, hi = hi + Math.imul(ah0, bh9) | 0;\n var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0, w9 &= 67108863, lo = Math.imul(al9, bl1), mid = Math.imul(al9, bh1), mid = mid + Math.imul(ah9, bl1) | 0, hi = Math.imul(ah9, bh1), lo = lo + Math.imul(al8, bl2) | 0, mid = mid + Math.imul(al8, bh2) | 0, mid = mid + Math.imul(ah8, bl2) | 0, hi = hi + Math.imul(ah8, bh2) | 0, lo = lo + Math.imul(al7, bl3) | 0, mid = mid + Math.imul(al7, bh3) | 0, mid = mid + Math.imul(ah7, bl3) | 0, hi = hi + Math.imul(ah7, bh3) | 0, lo = lo + Math.imul(al6, bl4) | 0, mid = mid + Math.imul(al6, bh4) | 0, mid = mid + Math.imul(ah6, bl4) | 0, hi = hi + Math.imul(ah6, bh4) | 0, lo = lo + Math.imul(al5, bl5) | 0, mid = mid + Math.imul(al5, bh5) | 0, mid = mid + Math.imul(ah5, bl5) | 0, hi = hi + Math.imul(ah5, bh5) | 0, lo = lo + Math.imul(al4, bl6) | 0, mid = mid + Math.imul(al4, bh6) | 0, mid = mid + Math.imul(ah4, bl6) | 0, hi = hi + Math.imul(ah4, bh6) | 0, lo = lo + Math.imul(al3, bl7) | 0, mid = mid + Math.imul(al3, bh7) | 0, mid = mid + Math.imul(ah3, bl7) | 0, hi = hi + Math.imul(ah3, bh7) | 0, lo = lo + Math.imul(al2, bl8) | 0, mid = mid + Math.imul(al2, bh8) | 0, mid = mid + Math.imul(ah2, bl8) | 0, hi = hi + Math.imul(ah2, bh8) | 0, lo = lo + Math.imul(al1, bl9) | 0, mid = mid + Math.imul(al1, bh9) | 0, mid = mid + Math.imul(ah1, bl9) | 0, hi = hi + Math.imul(ah1, bh9) | 0;\n var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0, w10 &= 67108863, lo = Math.imul(al9, bl2), mid = Math.imul(al9, bh2), mid = mid + Math.imul(ah9, bl2) | 0, hi = Math.imul(ah9, bh2), lo = lo + Math.imul(al8, bl3) | 0, mid = mid + Math.imul(al8, bh3) | 0, mid = mid + Math.imul(ah8, bl3) | 0, hi = hi + Math.imul(ah8, bh3) | 0, lo = lo + Math.imul(al7, bl4) | 0, mid = mid + Math.imul(al7, bh4) | 0, mid = mid + Math.imul(ah7, bl4) | 0, hi = hi + Math.imul(ah7, bh4) | 0, lo = lo + Math.imul(al6, bl5) | 0, mid = mid + Math.imul(al6, bh5) | 0, mid = mid + Math.imul(ah6, bl5) | 0, hi = hi + Math.imul(ah6, bh5) | 0, lo = lo + Math.imul(al5, bl6) | 0, mid = mid + Math.imul(al5, bh6) | 0, mid = mid + Math.imul(ah5, bl6) | 0, hi = hi + Math.imul(ah5, bh6) | 0, lo = lo + Math.imul(al4, bl7) | 0, mid = mid + Math.imul(al4, bh7) | 0, mid = mid + Math.imul(ah4, bl7) | 0, hi = hi + Math.imul(ah4, bh7) | 0, lo = lo + Math.imul(al3, bl8) | 0, mid = mid + Math.imul(al3, bh8) | 0, mid = mid + Math.imul(ah3, bl8) | 0, hi = hi + Math.imul(ah3, bh8) | 0, lo = lo + Math.imul(al2, bl9) | 0, mid = mid + Math.imul(al2, bh9) | 0, mid = mid + Math.imul(ah2, bl9) | 0, hi = hi + Math.imul(ah2, bh9) | 0;\n var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0, w11 &= 67108863, lo = Math.imul(al9, bl3), mid = Math.imul(al9, bh3), mid = mid + Math.imul(ah9, bl3) | 0, hi = Math.imul(ah9, bh3), lo = lo + Math.imul(al8, bl4) | 0, mid = mid + Math.imul(al8, bh4) | 0, mid = mid + Math.imul(ah8, bl4) | 0, hi = hi + Math.imul(ah8, bh4) | 0, lo = lo + Math.imul(al7, bl5) | 0, mid = mid + Math.imul(al7, bh5) | 0, mid = mid + Math.imul(ah7, bl5) | 0, hi = hi + Math.imul(ah7, bh5) | 0, lo = lo + Math.imul(al6, bl6) | 0, mid = mid + Math.imul(al6, bh6) | 0, mid = mid + Math.imul(ah6, bl6) | 0, hi = hi + Math.imul(ah6, bh6) | 0, lo = lo + Math.imul(al5, bl7) | 0, mid = mid + Math.imul(al5, bh7) | 0, mid = mid + Math.imul(ah5, bl7) | 0, hi = hi + Math.imul(ah5, bh7) | 0, lo = lo + Math.imul(al4, bl8) | 0, mid = mid + Math.imul(al4, bh8) | 0, mid = mid + Math.imul(ah4, bl8) | 0, hi = hi + Math.imul(ah4, bh8) | 0, lo = lo + Math.imul(al3, bl9) | 0, mid = mid + Math.imul(al3, bh9) | 0, mid = mid + Math.imul(ah3, bl9) | 0, hi = hi + Math.imul(ah3, bh9) | 0;\n var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0, w12 &= 67108863, lo = Math.imul(al9, bl4), mid = Math.imul(al9, bh4), mid = mid + Math.imul(ah9, bl4) | 0, hi = Math.imul(ah9, bh4), lo = lo + Math.imul(al8, bl5) | 0, mid = mid + Math.imul(al8, bh5) | 0, mid = mid + Math.imul(ah8, bl5) | 0, hi = hi + Math.imul(ah8, bh5) | 0, lo = lo + Math.imul(al7, bl6) | 0, mid = mid + Math.imul(al7, bh6) | 0, mid = mid + Math.imul(ah7, bl6) | 0, hi = hi + Math.imul(ah7, bh6) | 0, lo = lo + Math.imul(al6, bl7) | 0, mid = mid + Math.imul(al6, bh7) | 0, mid = mid + Math.imul(ah6, bl7) | 0, hi = hi + Math.imul(ah6, bh7) | 0, lo = lo + Math.imul(al5, bl8) | 0, mid = mid + Math.imul(al5, bh8) | 0, mid = mid + Math.imul(ah5, bl8) | 0, hi = hi + Math.imul(ah5, bh8) | 0, lo = lo + Math.imul(al4, bl9) | 0, mid = mid + Math.imul(al4, bh9) | 0, mid = mid + Math.imul(ah4, bl9) | 0, hi = hi + Math.imul(ah4, bh9) | 0;\n var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0, w13 &= 67108863, lo = Math.imul(al9, bl5), mid = Math.imul(al9, bh5), mid = mid + Math.imul(ah9, bl5) | 0, hi = Math.imul(ah9, bh5), lo = lo + Math.imul(al8, bl6) | 0, mid = mid + Math.imul(al8, bh6) | 0, mid = mid + Math.imul(ah8, bl6) | 0, hi = hi + Math.imul(ah8, bh6) | 0, lo = lo + Math.imul(al7, bl7) | 0, mid = mid + Math.imul(al7, bh7) | 0, mid = mid + Math.imul(ah7, bl7) | 0, hi = hi + Math.imul(ah7, bh7) | 0, lo = lo + Math.imul(al6, bl8) | 0, mid = mid + Math.imul(al6, bh8) | 0, mid = mid + Math.imul(ah6, bl8) | 0, hi = hi + Math.imul(ah6, bh8) | 0, lo = lo + Math.imul(al5, bl9) | 0, mid = mid + Math.imul(al5, bh9) | 0, mid = mid + Math.imul(ah5, bl9) | 0, hi = hi + Math.imul(ah5, bh9) | 0;\n var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0, w14 &= 67108863, lo = Math.imul(al9, bl6), mid = Math.imul(al9, bh6), mid = mid + Math.imul(ah9, bl6) | 0, hi = Math.imul(ah9, bh6), lo = lo + Math.imul(al8, bl7) | 0, mid = mid + Math.imul(al8, bh7) | 0, mid = mid + Math.imul(ah8, bl7) | 0, hi = hi + Math.imul(ah8, bh7) | 0, lo = lo + Math.imul(al7, bl8) | 0, mid = mid + Math.imul(al7, bh8) | 0, mid = mid + Math.imul(ah7, bl8) | 0, hi = hi + Math.imul(ah7, bh8) | 0, lo = lo + Math.imul(al6, bl9) | 0, mid = mid + Math.imul(al6, bh9) | 0, mid = mid + Math.imul(ah6, bl9) | 0, hi = hi + Math.imul(ah6, bh9) | 0;\n var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0, w15 &= 67108863, lo = Math.imul(al9, bl7), mid = Math.imul(al9, bh7), mid = mid + Math.imul(ah9, bl7) | 0, hi = Math.imul(ah9, bh7), lo = lo + Math.imul(al8, bl8) | 0, mid = mid + Math.imul(al8, bh8) | 0, mid = mid + Math.imul(ah8, bl8) | 0, hi = hi + Math.imul(ah8, bh8) | 0, lo = lo + Math.imul(al7, bl9) | 0, mid = mid + Math.imul(al7, bh9) | 0, mid = mid + Math.imul(ah7, bl9) | 0, hi = hi + Math.imul(ah7, bh9) | 0;\n var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0, w16 &= 67108863, lo = Math.imul(al9, bl8), mid = Math.imul(al9, bh8), mid = mid + Math.imul(ah9, bl8) | 0, hi = Math.imul(ah9, bh8), lo = lo + Math.imul(al8, bl9) | 0, mid = mid + Math.imul(al8, bh9) | 0, mid = mid + Math.imul(ah8, bl9) | 0, hi = hi + Math.imul(ah8, bh9) | 0;\n var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0, w17 &= 67108863, lo = Math.imul(al9, bl9), mid = Math.imul(al9, bh9), mid = mid + Math.imul(ah9, bl9) | 0, hi = Math.imul(ah9, bh9);\n var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n return c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0, w18 &= 67108863, o[0] = w0, o[1] = w1, o[2] = w2, o[3] = w3, o[4] = w4, o[5] = w5, o[6] = w6, o[7] = w7, o[8] = w8, o[9] = w9, o[10] = w10, o[11] = w11, o[12] = w12, o[13] = w13, o[14] = w14, o[15] = w15, o[16] = w16, o[17] = w17, o[18] = w18, c !== 0 && (o[19] = c, out.length++), out;\n };\n Math.imul || (comb10MulTo = smallMulTo);\n function bigMulTo(self2, num, out) {\n out.negative = num.negative ^ self2.negative, out.length = self2.length + num.length;\n for (var carry = 0, hncarry = 0, k = 0;k < out.length - 1; k++) {\n var ncarry = hncarry;\n hncarry = 0;\n for (var rword = carry & 67108863, maxJ = Math.min(k, num.length - 1), j = Math.max(0, k - self2.length + 1);j <= maxJ; j++) {\n var i = k - j, a = self2.words[i] | 0, b = num.words[j] | 0, r = a * b, lo = r & 67108863;\n ncarry = ncarry + (r / 67108864 | 0) | 0, lo = lo + rword | 0, rword = lo & 67108863, ncarry = ncarry + (lo >>> 26) | 0, hncarry += ncarry >>> 26, ncarry &= 67108863;\n }\n out.words[k] = rword, carry = ncarry, ncarry = hncarry;\n }\n return carry !== 0 \? out.words[k] = carry : out.length--, out.strip();\n }\n function jumboMulTo(self2, num, out) {\n var fftm = new FFTM;\n return fftm.mulp(self2, num, out);\n }\n BN.prototype.mulTo = function(num, out) {\n var res, len = this.length + num.length;\n return this.length === 10 && num.length === 10 \? res = comb10MulTo(this, num, out) : len < 63 \? res = smallMulTo(this, num, out) : len < 1024 \? res = bigMulTo(this, num, out) : res = jumboMulTo(this, num, out), res;\n };\n function FFTM(x, y) {\n this.x = x, this.y = y;\n }\n FFTM.prototype = {}, FFTM.prototype.makeRBT = function(N) {\n for (var t = new Array(N), l = BN.prototype._countBits(N) - 1, i = 0;i < N; i++)\n t[i] = this.revBin(i, l, N);\n return t;\n }, FFTM.prototype.revBin = function(x, l, N) {\n if (x === 0 || x === N - 1)\n return x;\n for (var rb = 0, i = 0;i < l; i++)\n rb |= (x & 1) << l - i - 1, x >>= 1;\n return rb;\n }, FFTM.prototype.permute = function(rbt, rws, iws, rtws, itws, N) {\n for (var i = 0;i < N; i++)\n rtws[i] = rws[rbt[i]], itws[i] = iws[rbt[i]];\n }, FFTM.prototype.transform = function(rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n for (var s = 1;s < N; s <<= 1)\n for (var l = s << 1, rtwdf = Math.cos(2 * Math.PI / l), itwdf = Math.sin(2 * Math.PI / l), p = 0;p < N; p += l)\n for (var rtwdf_ = rtwdf, itwdf_ = itwdf, j = 0;j < s; j++) {\n var re = rtws[p + j], ie = itws[p + j], ro = rtws[p + j + s], io = itws[p + j + s], rx = rtwdf_ * ro - itwdf_ * io;\n io = rtwdf_ * io + itwdf_ * ro, ro = rx, rtws[p + j] = re + ro, itws[p + j] = ie + io, rtws[p + j + s] = re - ro, itws[p + j + s] = ie - io, j !== l && (rx = rtwdf * rtwdf_ - itwdf * itwdf_, itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_, rtwdf_ = rx);\n }\n }, FFTM.prototype.guessLen13b = function(n, m) {\n var N = Math.max(m, n) | 1, odd = N & 1, i = 0;\n for (N = N / 2 | 0;N; N = N >>> 1)\n i++;\n return 1 << i + 1 + odd;\n }, FFTM.prototype.conjugate = function(rws, iws, N) {\n if (!(N <= 1))\n for (var i = 0;i < N / 2; i++) {\n var t = rws[i];\n rws[i] = rws[N - i - 1], rws[N - i - 1] = t, t = iws[i], iws[i] = -iws[N - i - 1], iws[N - i - 1] = -t;\n }\n }, FFTM.prototype.normalize13b = function(ws, N) {\n for (var carry = 0, i = 0;i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;\n ws[i] = w & 67108863, w < 67108864 \? carry = 0 : carry = w / 67108864 | 0;\n }\n return ws;\n }, FFTM.prototype.convert13b = function(ws, len, rws, N) {\n for (var carry = 0, i = 0;i < len; i++)\n carry = carry + (ws[i] | 0), rws[2 * i] = carry & 8191, carry = carry >>> 13, rws[2 * i + 1] = carry & 8191, carry = carry >>> 13;\n for (i = 2 * len;i < N; ++i)\n rws[i] = 0;\n assert(carry === 0), assert((carry & -8192) === 0);\n }, FFTM.prototype.stub = function(N) {\n for (var ph = new Array(N), i = 0;i < N; i++)\n ph[i] = 0;\n return ph;\n }, FFTM.prototype.mulp = function(x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length), rbt = this.makeRBT(N), _ = this.stub(N), rws = new Array(N), rwst = new Array(N), iwst = new Array(N), nrws = new Array(N), nrwst = new Array(N), niwst = new Array(N), rmws = out.words;\n rmws.length = N, this.convert13b(x.words, x.length, rws, N), this.convert13b(y.words, y.length, nrws, N), this.transform(rws, _, rwst, iwst, N, rbt), this.transform(nrws, _, nrwst, niwst, N, rbt);\n for (var i = 0;i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i], rwst[i] = rx;\n }\n return this.conjugate(rwst, iwst, N), this.transform(rwst, iwst, rmws, _, N, rbt), this.conjugate(rmws, _, N), this.normalize13b(rmws, N), out.negative = x.negative ^ y.negative, out.length = x.length + y.length, out.strip();\n }, BN.prototype.mul = function(num) {\n var out = new BN(null);\n return out.words = new Array(this.length + num.length), this.mulTo(num, out);\n }, BN.prototype.mulf = function(num) {\n var out = new BN(null);\n return out.words = new Array(this.length + num.length), jumboMulTo(this, num, out);\n }, BN.prototype.imul = function(num) {\n return this.clone().mulTo(num, this);\n }, BN.prototype.imuln = function(num) {\n assert(typeof num == \"number\"), assert(num < 67108864);\n for (var carry = 0, i = 0;i < this.length; i++) {\n var w = (this.words[i] | 0) * num, lo = (w & 67108863) + (carry & 67108863);\n carry >>= 26, carry += w / 67108864 | 0, carry += lo >>> 26, this.words[i] = lo & 67108863;\n }\n return carry !== 0 && (this.words[i] = carry, this.length++), this;\n }, BN.prototype.muln = function(num) {\n return this.clone().imuln(num);\n }, BN.prototype.sqr = function() {\n return this.mul(this);\n }, BN.prototype.isqr = function() {\n return this.imul(this.clone());\n }, BN.prototype.pow = function(num) {\n var w = toBitArray(num);\n if (w.length === 0)\n return new BN(1);\n for (var res = this, i = 0;i < w.length && w[i] === 0; i++, res = res.sqr())\n ;\n if (++i < w.length)\n for (var q = res.sqr();i < w.length; i++, q = q.sqr())\n w[i] !== 0 && (res = res.mul(q));\n return res;\n }, BN.prototype.iushln = function(bits) {\n assert(typeof bits == \"number\" && bits >= 0);\n var r = bits % 26, s = (bits - r) / 26, carryMask = 67108863 >>> 26 - r << 26 - r, i;\n if (r !== 0) {\n var carry = 0;\n for (i = 0;i < this.length; i++) {\n var newCarry = this.words[i] & carryMask, c = (this.words[i] | 0) - newCarry << r;\n this.words[i] = c | carry, carry = newCarry >>> 26 - r;\n }\n carry && (this.words[i] = carry, this.length++);\n }\n if (s !== 0) {\n for (i = this.length - 1;i >= 0; i--)\n this.words[i + s] = this.words[i];\n for (i = 0;i < s; i++)\n this.words[i] = 0;\n this.length += s;\n }\n return this.strip();\n }, BN.prototype.ishln = function(bits) {\n return assert(this.negative === 0), this.iushln(bits);\n }, BN.prototype.iushrn = function(bits, hint, extended) {\n assert(typeof bits == \"number\" && bits >= 0);\n var h;\n hint \? h = (hint - hint % 26) / 26 : h = 0;\n var r = bits % 26, s = Math.min((bits - r) / 26, this.length), mask = 67108863 ^ 67108863 >>> r << r, maskedWords = extended;\n if (h -= s, h = Math.max(0, h), maskedWords) {\n for (var i = 0;i < s; i++)\n maskedWords.words[i] = this.words[i];\n maskedWords.length = s;\n }\n if (s !== 0)\n if (this.length > s)\n for (this.length -= s, i = 0;i < this.length; i++)\n this.words[i] = this.words[i + s];\n else\n this.words[0] = 0, this.length = 1;\n var carry = 0;\n for (i = this.length - 1;i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = carry << 26 - r | word >>> r, carry = word & mask;\n }\n return maskedWords && carry !== 0 && (maskedWords.words[maskedWords.length++] = carry), this.length === 0 && (this.words[0] = 0, this.length = 1), this.strip();\n }, BN.prototype.ishrn = function(bits, hint, extended) {\n return assert(this.negative === 0), this.iushrn(bits, hint, extended);\n }, BN.prototype.shln = function(bits) {\n return this.clone().ishln(bits);\n }, BN.prototype.ushln = function(bits) {\n return this.clone().iushln(bits);\n }, BN.prototype.shrn = function(bits) {\n return this.clone().ishrn(bits);\n }, BN.prototype.ushrn = function(bits) {\n return this.clone().iushrn(bits);\n }, BN.prototype.testn = function(bit) {\n assert(typeof bit == \"number\" && bit >= 0);\n var r = bit % 26, s = (bit - r) / 26, q = 1 << r;\n if (this.length <= s)\n return !1;\n var w = this.words[s];\n return !!(w & q);\n }, BN.prototype.imaskn = function(bits) {\n assert(typeof bits == \"number\" && bits >= 0);\n var r = bits % 26, s = (bits - r) / 26;\n if (assert(this.negative === 0, \"imaskn works only with positive numbers\"), this.length <= s)\n return this;\n if (r !== 0 && s++, this.length = Math.min(s, this.length), r !== 0) {\n var mask = 67108863 ^ 67108863 >>> r << r;\n this.words[this.length - 1] &= mask;\n }\n return this.strip();\n }, BN.prototype.maskn = function(bits) {\n return this.clone().imaskn(bits);\n }, BN.prototype.iaddn = function(num) {\n return assert(typeof num == \"number\"), assert(num < 67108864), num < 0 \? this.isubn(-num) : this.negative !== 0 \? this.length === 1 && (this.words[0] | 0) < num \? (this.words[0] = num - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(num), this.negative = 1, this) : this._iaddn(num);\n }, BN.prototype._iaddn = function(num) {\n this.words[0] += num;\n for (var i = 0;i < this.length && this.words[i] >= 67108864; i++)\n this.words[i] -= 67108864, i === this.length - 1 \? this.words[i + 1] = 1 : this.words[i + 1]++;\n return this.length = Math.max(this.length, i + 1), this;\n }, BN.prototype.isubn = function(num) {\n if (assert(typeof num == \"number\"), assert(num < 67108864), num < 0)\n return this.iaddn(-num);\n if (this.negative !== 0)\n return this.negative = 0, this.iaddn(num), this.negative = 1, this;\n if (this.words[0] -= num, this.length === 1 && this.words[0] < 0)\n this.words[0] = -this.words[0], this.negative = 1;\n else\n for (var i = 0;i < this.length && this.words[i] < 0; i++)\n this.words[i] += 67108864, this.words[i + 1] -= 1;\n return this.strip();\n }, BN.prototype.addn = function(num) {\n return this.clone().iaddn(num);\n }, BN.prototype.subn = function(num) {\n return this.clone().isubn(num);\n }, BN.prototype.iabs = function() {\n return this.negative = 0, this;\n }, BN.prototype.abs = function() {\n return this.clone().iabs();\n }, BN.prototype._ishlnsubmul = function(num, mul, shift) {\n var len = num.length + shift, i;\n this._expand(len);\n var w, carry = 0;\n for (i = 0;i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 67108863, carry = (w >> 26) - (right / 67108864 | 0), this.words[i + shift] = w & 67108863;\n }\n for (;i < this.length - shift; i++)\n w = (this.words[i + shift] | 0) + carry, carry = w >> 26, this.words[i + shift] = w & 67108863;\n if (carry === 0)\n return this.strip();\n for (assert(carry === -1), carry = 0, i = 0;i < this.length; i++)\n w = -(this.words[i] | 0) + carry, carry = w >> 26, this.words[i] = w & 67108863;\n return this.negative = 1, this.strip();\n }, BN.prototype._wordDiv = function(num, mode) {\n var shift = this.length - num.length, a = this.clone(), b = num, bhi = b.words[b.length - 1] | 0, bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits, shift !== 0 && (b = b.ushln(shift), a.iushln(shift), bhi = b.words[b.length - 1] | 0);\n var m = a.length - b.length, q;\n if (mode !== \"mod\") {\n q = new BN(null), q.length = m + 1, q.words = new Array(q.length);\n for (var i = 0;i < q.length; i++)\n q.words[i] = 0;\n }\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n diff.negative === 0 && (a = diff, q && (q.words[m] = 1));\n for (var j = m - 1;j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);\n for (qj = Math.min(qj / bhi | 0, 67108863), a._ishlnsubmul(b, qj, j);a.negative !== 0; )\n qj--, a.negative = 0, a._ishlnsubmul(b, 1, j), a.isZero() || (a.negative ^= 1);\n q && (q.words[j] = qj);\n }\n return q && q.strip(), a.strip(), mode !== \"div\" && shift !== 0 && a.iushrn(shift), {\n div: q || null,\n mod: a\n };\n }, BN.prototype.divmod = function(num, mode, positive) {\n if (assert(!num.isZero()), this.isZero())\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n var div, mod, res;\n return this.negative !== 0 && num.negative === 0 \? (res = this.neg().divmod(num, mode), mode !== \"mod\" && (div = res.div.neg()), mode !== \"div\" && (mod = res.mod.neg(), positive && mod.negative !== 0 && mod.iadd(num)), {\n div,\n mod\n }) : this.negative === 0 && num.negative !== 0 \? (res = this.divmod(num.neg(), mode), mode !== \"mod\" && (div = res.div.neg()), {\n div,\n mod: res.mod\n }) : (this.negative & num.negative) !== 0 \? (res = this.neg().divmod(num.neg(), mode), mode !== \"div\" && (mod = res.mod.neg(), positive && mod.negative !== 0 && mod.isub(num)), {\n div: res.div,\n mod\n }) : num.length > this.length || this.cmp(num) < 0 \? {\n div: new BN(0),\n mod: this\n } : num.length === 1 \? mode === \"div\" \? {\n div: this.divn(num.words[0]),\n mod: null\n } : mode === \"mod\" \? {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n } : {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n } : this._wordDiv(num, mode);\n }, BN.prototype.div = function(num) {\n return this.divmod(num, \"div\", !1).div;\n }, BN.prototype.mod = function(num) {\n return this.divmod(num, \"mod\", !1).mod;\n }, BN.prototype.umod = function(num) {\n return this.divmod(num, \"mod\", !0).mod;\n }, BN.prototype.divRound = function(num) {\n var dm = this.divmod(num);\n if (dm.mod.isZero())\n return dm.div;\n var mod = dm.div.negative !== 0 \? dm.mod.isub(num) : dm.mod, half = num.ushrn(1), r2 = num.andln(1), cmp = mod.cmp(half);\n return cmp < 0 || r2 === 1 && cmp === 0 \? dm.div : dm.div.negative !== 0 \? dm.div.isubn(1) : dm.div.iaddn(1);\n }, BN.prototype.modn = function(num) {\n assert(num <= 67108863);\n for (var p = (1 << 26) % num, acc = 0, i = this.length - 1;i >= 0; i--)\n acc = (p * acc + (this.words[i] | 0)) % num;\n return acc;\n }, BN.prototype.idivn = function(num) {\n assert(num <= 67108863);\n for (var carry = 0, i = this.length - 1;i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 67108864;\n this.words[i] = w / num | 0, carry = w % num;\n }\n return this.strip();\n }, BN.prototype.divn = function(num) {\n return this.clone().idivn(num);\n }, BN.prototype.egcd = function(p) {\n assert(p.negative === 0), assert(!p.isZero());\n var x = this, y = p.clone();\n x.negative !== 0 \? x = x.umod(p) : x = x.clone();\n for (var A = new BN(1), B = new BN(0), C = new BN(0), D = new BN(1), g = 0;x.isEven() && y.isEven(); )\n x.iushrn(1), y.iushrn(1), ++g;\n for (var yp = y.clone(), xp = x.clone();!x.isZero(); ) {\n for (var i = 0, im = 1;(x.words[0] & im) === 0 && i < 26; ++i, im <<= 1)\n ;\n if (i > 0)\n for (x.iushrn(i);i-- > 0; )\n (A.isOdd() || B.isOdd()) && (A.iadd(yp), B.isub(xp)), A.iushrn(1), B.iushrn(1);\n for (var j = 0, jm = 1;(y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1)\n ;\n if (j > 0)\n for (y.iushrn(j);j-- > 0; )\n (C.isOdd() || D.isOdd()) && (C.iadd(yp), D.isub(xp)), C.iushrn(1), D.iushrn(1);\n x.cmp(y) >= 0 \? (x.isub(y), A.isub(C), B.isub(D)) : (y.isub(x), C.isub(A), D.isub(B));\n }\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n }, BN.prototype._invmp = function(p) {\n assert(p.negative === 0), assert(!p.isZero());\n var a = this, b = p.clone();\n a.negative !== 0 \? a = a.umod(p) : a = a.clone();\n for (var x1 = new BN(1), x2 = new BN(0), delta = b.clone();a.cmpn(1) > 0 && b.cmpn(1) > 0; ) {\n for (var i = 0, im = 1;(a.words[0] & im) === 0 && i < 26; ++i, im <<= 1)\n ;\n if (i > 0)\n for (a.iushrn(i);i-- > 0; )\n x1.isOdd() && x1.iadd(delta), x1.iushrn(1);\n for (var j = 0, jm = 1;(b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1)\n ;\n if (j > 0)\n for (b.iushrn(j);j-- > 0; )\n x2.isOdd() && x2.iadd(delta), x2.iushrn(1);\n a.cmp(b) >= 0 \? (a.isub(b), x1.isub(x2)) : (b.isub(a), x2.isub(x1));\n }\n var res;\n return a.cmpn(1) === 0 \? res = x1 : res = x2, res.cmpn(0) < 0 && res.iadd(p), res;\n }, BN.prototype.gcd = function(num) {\n if (this.isZero())\n return num.abs();\n if (num.isZero())\n return this.abs();\n var a = this.clone(), b = num.clone();\n a.negative = 0, b.negative = 0;\n for (var shift = 0;a.isEven() && b.isEven(); shift++)\n a.iushrn(1), b.iushrn(1);\n do {\n for (;a.isEven(); )\n a.iushrn(1);\n for (;b.isEven(); )\n b.iushrn(1);\n var r = a.cmp(b);\n if (r < 0) {\n var t = a;\n a = b, b = t;\n } else if (r === 0 || b.cmpn(1) === 0)\n break;\n a.isub(b);\n } while (!0);\n return b.iushln(shift);\n }, BN.prototype.invm = function(num) {\n return this.egcd(num).a.umod(num);\n }, BN.prototype.isEven = function() {\n return (this.words[0] & 1) === 0;\n }, BN.prototype.isOdd = function() {\n return (this.words[0] & 1) === 1;\n }, BN.prototype.andln = function(num) {\n return this.words[0] & num;\n }, BN.prototype.bincn = function(bit) {\n assert(typeof bit == \"number\");\n var r = bit % 26, s = (bit - r) / 26, q = 1 << r;\n if (this.length <= s)\n return this._expand(s + 1), this.words[s] |= q, this;\n for (var carry = q, i = s;carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry, carry = w >>> 26, w &= 67108863, this.words[i] = w;\n }\n return carry !== 0 && (this.words[i] = carry, this.length++), this;\n }, BN.prototype.isZero = function() {\n return this.length === 1 && this.words[0] === 0;\n }, BN.prototype.cmpn = function(num) {\n var negative = num < 0;\n if (this.negative !== 0 && !negative)\n return -1;\n if (this.negative === 0 && negative)\n return 1;\n this.strip();\n var res;\n if (this.length > 1)\n res = 1;\n else {\n negative && (num = -num), assert(num <= 67108863, \"Number is too big\");\n var w = this.words[0] | 0;\n res = w === num \? 0 : w < num \? -1 : 1;\n }\n return this.negative !== 0 \? -res | 0 : res;\n }, BN.prototype.cmp = function(num) {\n if (this.negative !== 0 && num.negative === 0)\n return -1;\n if (this.negative === 0 && num.negative !== 0)\n return 1;\n var res = this.ucmp(num);\n return this.negative !== 0 \? -res | 0 : res;\n }, BN.prototype.ucmp = function(num) {\n if (this.length > num.length)\n return 1;\n if (this.length < num.length)\n return -1;\n for (var res = 0, i = this.length - 1;i >= 0; i--) {\n var a = this.words[i] | 0, b = num.words[i] | 0;\n if (a !== b) {\n a < b \? res = -1 : a > b && (res = 1);\n break;\n }\n }\n return res;\n }, BN.prototype.gtn = function(num) {\n return this.cmpn(num) === 1;\n }, BN.prototype.gt = function(num) {\n return this.cmp(num) === 1;\n }, BN.prototype.gten = function(num) {\n return this.cmpn(num) >= 0;\n }, BN.prototype.gte = function(num) {\n return this.cmp(num) >= 0;\n }, BN.prototype.ltn = function(num) {\n return this.cmpn(num) === -1;\n }, BN.prototype.lt = function(num) {\n return this.cmp(num) === -1;\n }, BN.prototype.lten = function(num) {\n return this.cmpn(num) <= 0;\n }, BN.prototype.lte = function(num) {\n return this.cmp(num) <= 0;\n }, BN.prototype.eqn = function(num) {\n return this.cmpn(num) === 0;\n }, BN.prototype.eq = function(num) {\n return this.cmp(num) === 0;\n }, BN.red = function(num) {\n return new Red(num);\n }, BN.prototype.toRed = function(ctx) {\n return assert(!this.red, \"Already a number in reduction context\"), assert(this.negative === 0, \"red works only with positives\"), ctx.convertTo(this)._forceRed(ctx);\n }, BN.prototype.fromRed = function() {\n return assert(this.red, \"fromRed works only with numbers in reduction context\"), this.red.convertFrom(this);\n }, BN.prototype._forceRed = function(ctx) {\n return this.red = ctx, this;\n }, BN.prototype.forceRed = function(ctx) {\n return assert(!this.red, \"Already a number in reduction context\"), this._forceRed(ctx);\n }, BN.prototype.redAdd = function(num) {\n return assert(this.red, \"redAdd works only with red numbers\"), this.red.add(this, num);\n }, BN.prototype.redIAdd = function(num) {\n return assert(this.red, \"redIAdd works only with red numbers\"), this.red.iadd(this, num);\n }, BN.prototype.redSub = function(num) {\n return assert(this.red, \"redSub works only with red numbers\"), this.red.sub(this, num);\n }, BN.prototype.redISub = function(num) {\n return assert(this.red, \"redISub works only with red numbers\"), this.red.isub(this, num);\n }, BN.prototype.redShl = function(num) {\n return assert(this.red, \"redShl works only with red numbers\"), this.red.shl(this, num);\n }, BN.prototype.redMul = function(num) {\n return assert(this.red, \"redMul works only with red numbers\"), this.red._verify2(this, num), this.red.mul(this, num);\n }, BN.prototype.redIMul = function(num) {\n return assert(this.red, \"redMul works only with red numbers\"), this.red._verify2(this, num), this.red.imul(this, num);\n }, BN.prototype.redSqr = function() {\n return assert(this.red, \"redSqr works only with red numbers\"), this.red._verify1(this), this.red.sqr(this);\n }, BN.prototype.redISqr = function() {\n return assert(this.red, \"redISqr works only with red numbers\"), this.red._verify1(this), this.red.isqr(this);\n }, BN.prototype.redSqrt = function() {\n return assert(this.red, \"redSqrt works only with red numbers\"), this.red._verify1(this), this.red.sqrt(this);\n }, BN.prototype.redInvm = function() {\n return assert(this.red, \"redInvm works only with red numbers\"), this.red._verify1(this), this.red.invm(this);\n }, BN.prototype.redNeg = function() {\n return assert(this.red, \"redNeg works only with red numbers\"), this.red._verify1(this), this.red.neg(this);\n }, BN.prototype.redPow = function(num) {\n return assert(this.red && !num.red, \"redPow(normalNum)\"), this.red._verify1(this), this.red.pow(this, num);\n };\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n function MPrime(name, p) {\n this.name = name, this.p = new BN(p, 16), this.n = this.p.bitLength(), this.k = new BN(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();\n }\n MPrime.prototype = {}, MPrime.prototype._tmp = function() {\n var tmp = new BN(null);\n return tmp.words = new Array(Math.ceil(this.n / 13)), tmp;\n }, MPrime.prototype.ireduce = function(num) {\n var r = num, rlen;\n do\n this.split(r, this.tmp), r = this.imulK(r), r = r.iadd(this.tmp), rlen = r.bitLength();\n while (rlen > this.n);\n var cmp = rlen < this.n \? -1 : r.ucmp(this.p);\n return cmp === 0 \? (r.words[0] = 0, r.length = 1) : cmp > 0 \? r.isub(this.p) : r.strip !== void 0 \? r.strip() : r._strip(), r;\n }, MPrime.prototype.split = function(input, out) {\n input.iushrn(this.n, 0, out);\n }, MPrime.prototype.imulK = function(num) {\n return num.imul(this.k);\n };\n function K256() {\n MPrime.call(this, \"k256\", \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\");\n }\n inherits(K256, MPrime), K256.prototype.split = function(input, output) {\n for (var mask = 4194303, outLen = Math.min(input.length, 9), i = 0;i < outLen; i++)\n output.words[i] = input.words[i];\n if (output.length = outLen, input.length <= 9) {\n input.words[0] = 0, input.length = 1;\n return;\n }\n var prev = input.words[9];\n for (output.words[output.length++] = prev & mask, i = 10;i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = (next & mask) << 4 | prev >>> 22, prev = next;\n }\n prev >>>= 22, input.words[i - 10] = prev, prev === 0 && input.length > 10 \? input.length -= 10 : input.length -= 9;\n }, K256.prototype.imulK = function(num) {\n num.words[num.length] = 0, num.words[num.length + 1] = 0, num.length += 2;\n for (var lo = 0, i = 0;i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 977, num.words[i] = lo & 67108863, lo = w * 64 + (lo / 67108864 | 0);\n }\n return num.words[num.length - 1] === 0 && (num.length--, num.words[num.length - 1] === 0 && num.length--), num;\n };\n function P224() {\n MPrime.call(this, \"p224\", \"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\");\n }\n inherits(P224, MPrime);\n function P192() {\n MPrime.call(this, \"p192\", \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\");\n }\n inherits(P192, MPrime);\n function P25519() {\n MPrime.call(this, \"25519\", \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\");\n }\n inherits(P25519, MPrime), P25519.prototype.imulK = function(num) {\n for (var carry = 0, i = 0;i < num.length; i++) {\n var hi = (num.words[i] | 0) * 19 + carry, lo = hi & 67108863;\n hi >>>= 26, num.words[i] = lo, carry = hi;\n }\n return carry !== 0 && (num.words[num.length++] = carry), num;\n }, BN._prime = function(name) {\n if (primes[name])\n return primes[name];\n var prime2;\n if (name === \"k256\")\n prime2 = new K256;\n else if (name === \"p224\")\n prime2 = new P224;\n else if (name === \"p192\")\n prime2 = new P192;\n else if (name === \"p25519\")\n prime2 = new P25519;\n else\n throw new Error(\"Unknown prime \" + name);\n return primes[name] = prime2, prime2;\n };\n function Red(m) {\n if (typeof m == \"string\") {\n var prime = BN._prime(m);\n this.m = prime.p, this.prime = prime;\n } else\n assert(m.gtn(1), \"modulus must be greater than 1\"), this.m = m, this.prime = null;\n }\n Red.prototype = {}, Red.prototype._verify1 = function(a) {\n assert(a.negative === 0, \"red works only with positives\"), assert(a.red, \"red works only with red numbers\");\n }, Red.prototype._verify2 = function(a, b) {\n assert((a.negative | b.negative) === 0, \"red works only with positives\"), assert(a.red && a.red === b.red, \"red works only with red numbers\");\n }, Red.prototype.imod = function(a) {\n return this.prime \? this.prime.ireduce(a)._forceRed(this) : a.umod(this.m)._forceRed(this);\n }, Red.prototype.neg = function(a) {\n return a.isZero() \? a.clone() : this.m.sub(a)._forceRed(this);\n }, Red.prototype.add = function(a, b) {\n this._verify2(a, b);\n var res = a.add(b);\n return res.cmp(this.m) >= 0 && res.isub(this.m), res._forceRed(this);\n }, Red.prototype.iadd = function(a, b) {\n this._verify2(a, b);\n var res = a.iadd(b);\n return res.cmp(this.m) >= 0 && res.isub(this.m), res;\n }, Red.prototype.sub = function(a, b) {\n this._verify2(a, b);\n var res = a.sub(b);\n return res.cmpn(0) < 0 && res.iadd(this.m), res._forceRed(this);\n }, Red.prototype.isub = function(a, b) {\n this._verify2(a, b);\n var res = a.isub(b);\n return res.cmpn(0) < 0 && res.iadd(this.m), res;\n }, Red.prototype.shl = function(a, num) {\n return this._verify1(a), this.imod(a.ushln(num));\n }, Red.prototype.imul = function(a, b) {\n return this._verify2(a, b), this.imod(a.imul(b));\n }, Red.prototype.mul = function(a, b) {\n return this._verify2(a, b), this.imod(a.mul(b));\n }, Red.prototype.isqr = function(a) {\n return this.imul(a, a.clone());\n }, Red.prototype.sqr = function(a) {\n return this.mul(a, a);\n }, Red.prototype.sqrt = function(a) {\n if (a.isZero())\n return a.clone();\n var mod3 = this.m.andln(3);\n if (assert(mod3 % 2 === 1), mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n for (var q = this.m.subn(1), s = 0;!q.isZero() && q.andln(1) === 0; )\n s++, q.iushrn(1);\n assert(!q.isZero());\n var one = new BN(1).toRed(this), nOne = one.redNeg(), lpow = this.m.subn(1).iushrn(1), z = this.m.bitLength();\n for (z = new BN(2 * z * z).toRed(this);this.pow(z, lpow).cmp(nOne) !== 0; )\n z.redIAdd(nOne);\n for (var c = this.pow(z, q), r = this.pow(a, q.addn(1).iushrn(1)), t = this.pow(a, q), m = s;t.cmp(one) !== 0; ) {\n for (var tmp = t, i = 0;tmp.cmp(one) !== 0; i++)\n tmp = tmp.redSqr();\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n r = r.redMul(b), c = b.redSqr(), t = t.redMul(c), m = i;\n }\n return r;\n }, Red.prototype.invm = function(a) {\n var inv = a._invmp(this.m);\n return inv.negative !== 0 \? (inv.negative = 0, this.imod(inv).redNeg()) : this.imod(inv);\n }, Red.prototype.pow = function(a, num) {\n if (num.isZero())\n return new BN(1).toRed(this);\n if (num.cmpn(1) === 0)\n return a.clone();\n var windowSize = 4, wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this), wnd[1] = a;\n for (var i = 2;i < wnd.length; i++)\n wnd[i] = this.mul(wnd[i - 1], a);\n var res = wnd[0], current = 0, currentLen = 0, start = num.bitLength() % 26;\n for (start === 0 && (start = 26), i = num.length - 1;i >= 0; i--) {\n for (var word = num.words[i], j = start - 1;j >= 0; j--) {\n var bit = word >> j & 1;\n if (res !== wnd[0] && (res = this.sqr(res)), bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n current <<= 1, current |= bit, currentLen++, !(currentLen !== windowSize && (i !== 0 || j !== 0)) && (res = this.mul(res, wnd[current]), currentLen = 0, current = 0);\n }\n start = 26;\n }\n return res;\n }, Red.prototype.convertTo = function(num) {\n var r = num.umod(this.m);\n return r === num \? r.clone() : r;\n }, Red.prototype.convertFrom = function(num) {\n var res = num.clone();\n return res.red = null, res;\n }, BN.mont = function(num) {\n return new Mont(num);\n };\n function Mont(m) {\n Red.call(this, m), this.shift = this.m.bitLength(), this.shift % 26 !== 0 && (this.shift += 26 - this.shift % 26), this.r = new BN(1).iushln(this.shift), this.r2 = this.imod(this.r.sqr()), this.rinv = this.r._invmp(this.m), this.minv = this.rinv.mul(this.r).isubn(1).div(this.m), this.minv = this.minv.umod(this.r), this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red), Mont.prototype.convertTo = function(num) {\n return this.imod(num.ushln(this.shift));\n }, Mont.prototype.convertFrom = function(num) {\n var r = this.imod(num.mul(this.rinv));\n return r.red = null, r;\n }, Mont.prototype.imul = function(a, b) {\n if (a.isZero() || b.isZero())\n return a.words[0] = 0, a.length = 1, a;\n var t = a.imul(b), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u = t.isub(c).iushrn(this.shift), res = u;\n return u.cmp(this.m) >= 0 \? res = u.isub(this.m) : u.cmpn(0) < 0 && (res = u.iadd(this.m)), res._forceRed(this);\n }, Mont.prototype.mul = function(a, b) {\n if (a.isZero() || b.isZero())\n return new BN(0)._forceRed(this);\n var t = a.mul(b), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u = t.isub(c).iushrn(this.shift), res = u;\n return u.cmp(this.m) >= 0 \? res = u.isub(this.m) : u.cmpn(0) < 0 && (res = u.iadd(this.m)), res._forceRed(this);\n }, Mont.prototype.invm = function(a) {\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n })(typeof module > \"u\" || module, exports);\n }\n}), require_bn2 = require_bn, require_brorand = __commonJS({\n \"node_modules/brorand/index.js\"(exports, module) {\n var r;\n module.exports = function(len) {\n return r || (r = new Rand(null)), r.generate(len);\n };\n function Rand(rand) {\n this.rand = rand;\n }\n Rand.prototype = {}, module.exports.Rand = Rand, Rand.prototype.generate = function(len) {\n return this._rand(len);\n }, Rand.prototype._rand = function(n) {\n var out = new Buffer(n);\n return crypto.getRandomValues(out), out;\n };\n }\n}), require_mr = __commonJS({\n \"node_modules/miller-rabin/lib/mr.js\"(exports, module) {\n var bn = require_bn2(), brorand = require_brorand();\n function MillerRabin(rand) {\n this.rand = rand || new brorand.Rand;\n }\n module.exports = MillerRabin, MillerRabin.create = function(rand) {\n return new MillerRabin(rand);\n }, MillerRabin.prototype = {}, MillerRabin.prototype._randbelow = function(n) {\n var len = n.bitLength(), min_bytes = Math.ceil(len / 8);\n do\n var a = new bn(this.rand.generate(min_bytes));\n while (a.cmp(n) >= 0);\n return a;\n }, MillerRabin.prototype._randrange = function(start, stop) {\n var size = stop.sub(start);\n return start.add(this._randbelow(size));\n }, MillerRabin.prototype.test = function(n, k, cb) {\n var len = n.bitLength(), red = bn.mont(n), rone = new bn(1).toRed(red);\n k || (k = Math.max(1, len / 48 | 0));\n for (var n1 = n.subn(1), s = 0;!n1.testn(s); s++)\n ;\n for (var d = n.shrn(s), rn1 = n1.toRed(red), prime = !0;k > 0; k--) {\n var a = this._randrange(new bn(2), n1);\n cb && cb(a);\n var x = a.toRed(red).redPow(d);\n if (!(x.cmp(rone) === 0 || x.cmp(rn1) === 0)) {\n for (var i = 1;i < s; i++) {\n if (x = x.redSqr(), x.cmp(rone) === 0)\n return !1;\n if (x.cmp(rn1) === 0)\n break;\n }\n if (i === s)\n return !1;\n }\n }\n return prime;\n }, MillerRabin.prototype.getDivisor = function(n, k) {\n var len = n.bitLength(), red = bn.mont(n), rone = new bn(1).toRed(red);\n k || (k = Math.max(1, len / 48 | 0));\n for (var n1 = n.subn(1), s = 0;!n1.testn(s); s++)\n ;\n for (var d = n.shrn(s), rn1 = n1.toRed(red);k > 0; k--) {\n var a = this._randrange(new bn(2), n1), g = n.gcd(a);\n if (g.cmpn(1) !== 0)\n return g;\n var x = a.toRed(red).redPow(d);\n if (!(x.cmp(rone) === 0 || x.cmp(rn1) === 0)) {\n for (var i = 1;i < s; i++) {\n if (x = x.redSqr(), x.cmp(rone) === 0)\n return x.fromRed().subn(1).gcd(n);\n if (x.cmp(rn1) === 0)\n break;\n }\n if (i === s)\n return x = x.redSqr(), x.fromRed().subn(1).gcd(n);\n }\n }\n return !1;\n };\n }\n}), require_generatePrime = __commonJS({\n \"node_modules/diffie-hellman/lib/generatePrime.js\"(exports, module) {\n var randomBytes = require_browser();\n module.exports = findPrime, findPrime.simpleSieve = simpleSieve, findPrime.fermatTest = fermatTest;\n var BN = require_bn(), TWENTYFOUR = new BN(24), MillerRabin = require_mr(), millerRabin = new MillerRabin, ONE = new BN(1), TWO = new BN(2), FIVE = new BN(5), SIXTEEN = new BN(16), EIGHT = new BN(8), TEN = new BN(10), THREE = new BN(3), SEVEN = new BN(7), ELEVEN = new BN(11), FOUR = new BN(4), TWELVE = new BN(12), primes = null;\n function _getPrimes() {\n if (primes !== null)\n return primes;\n var limit = 1048576, res = [];\n res[0] = 2;\n for (var i = 1, k = 3;k < limit; k += 2) {\n for (var sqrt = Math.ceil(Math.sqrt(k)), j = 0;j < i && res[j] <= sqrt && k % res[j] !== 0; j++)\n ;\n i !== j && res[j] <= sqrt || (res[i++] = k);\n }\n return primes = res, res;\n }\n function simpleSieve(p) {\n for (var primes2 = _getPrimes(), i = 0;i < primes2.length; i++)\n if (p.modn(primes2[i]) === 0)\n return p.cmpn(primes2[i]) === 0;\n return !0;\n }\n function fermatTest(p) {\n var red = BN.mont(p);\n return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;\n }\n function findPrime(bits, gen) {\n if (bits < 16)\n return gen === 2 || gen === 5 \? new BN([140, 123]) : new BN([140, 39]);\n gen = new BN(gen);\n for (var num, n2;; ) {\n for (num = new BN(randomBytes(Math.ceil(bits / 8)));num.bitLength() > bits; )\n num.ishrn(1);\n if (num.isEven() && num.iadd(ONE), num.testn(1) || num.iadd(TWO), gen.cmp(TWO)) {\n if (!gen.cmp(FIVE))\n for (;num.mod(TEN).cmp(THREE); )\n num.iadd(FOUR);\n } else\n for (;num.mod(TWENTYFOUR).cmp(ELEVEN); )\n num.iadd(FOUR);\n if (n2 = num.shrn(1), simpleSieve(n2) && simpleSieve(num) && fermatTest(n2) && fermatTest(num) && millerRabin.test(n2) && millerRabin.test(num))\n return num;\n }\n }\n }\n}), require_primes = __commonJS({\n \"node_modules/diffie-hellman/lib/primes.json\"(exports, module) {\n module.exports = {\n modp1: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff\"\n },\n modp2: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff\"\n },\n modp5: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff\"\n },\n modp14: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff\"\n },\n modp15: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff\"\n },\n modp16: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff\"\n },\n modp17: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff\"\n },\n modp18: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff\"\n }\n };\n }\n}), require_dh = __commonJS({\n \"node_modules/diffie-hellman/lib/dh.js\"(exports, module) {\n var BN = require_bn(), MillerRabin = require_mr(), millerRabin = new MillerRabin, TWENTYFOUR = new BN(24), ELEVEN = new BN(11), TEN = new BN(10), THREE = new BN(3), SEVEN = new BN(7), primes = require_generatePrime(), randomBytes = require_browser();\n module.exports = DH;\n function setPublicKey(pub, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(pub) || (pub = new Buffer(pub, enc)), this._pub = new BN(pub), this;\n }\n function setPrivateKey(priv, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(priv) || (priv = new Buffer(priv, enc)), this._priv = new BN(priv), this;\n }\n var primeCache = {};\n function checkPrime(prime, generator) {\n var gen = generator.toString(\"hex\"), hex = [gen, prime.toString(16)].join(\"_\");\n if (hex in primeCache)\n return primeCache[hex];\n var error = 0;\n if (prime.isEven() || !primes.simpleSieve || !primes.fermatTest(prime) || !millerRabin.test(prime))\n return error += 1, gen === \"02\" || gen === \"05\" \? error += 8 : error += 4, primeCache[hex] = error, error;\n millerRabin.test(prime.shrn(1)) || (error += 2);\n var rem;\n switch (gen) {\n case \"02\":\n prime.mod(TWENTYFOUR).cmp(ELEVEN) && (error += 8);\n break;\n case \"05\":\n rem = prime.mod(TEN), rem.cmp(THREE) && rem.cmp(SEVEN) && (error += 8);\n break;\n default:\n error += 4;\n }\n return primeCache[hex] = error, error;\n }\n function DH(prime, generator, malleable) {\n this.setGenerator(generator), this.__prime = new BN(prime), this._prime = BN.mont(this.__prime), this._primeLen = prime.length, this._pub = void 0, this._priv = void 0, this._primeCode = void 0, malleable \? (this.setPublicKey = setPublicKey, this.setPrivateKey = setPrivateKey) : this._primeCode = 8;\n }\n DH.prototype = {}, Object.defineProperty(DH.prototype, \"verifyError\", {\n enumerable: !0,\n get: function() {\n return typeof this._primeCode != \"number\" && (this._primeCode = checkPrime(this.__prime, this.__gen)), this._primeCode;\n }\n }), DH.prototype.generateKeys = function() {\n return this._priv || (this._priv = new BN(randomBytes(this._primeLen))), this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(), this.getPublicKey();\n }, DH.prototype.computeSecret = function(other) {\n other = new BN(other), other = other.toRed(this._prime);\n var secret = other.redPow(this._priv).fromRed(), out = new Buffer(secret.toArray()), prime = this.getPrime();\n if (out.length < prime.length) {\n var front = new Buffer(prime.length - out.length);\n front.fill(0), out = Buffer.concat([front, out]);\n }\n return out;\n }, DH.prototype.getPublicKey = function(enc) {\n return formatReturnValue(this._pub, enc);\n }, DH.prototype.getPrivateKey = function(enc) {\n return formatReturnValue(this._priv, enc);\n }, DH.prototype.getPrime = function(enc) {\n return formatReturnValue(this.__prime, enc);\n }, DH.prototype.getGenerator = function(enc) {\n return formatReturnValue(this._gen, enc);\n }, DH.prototype.setGenerator = function(gen, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(gen) || (gen = new Buffer(gen, enc)), this.__gen = gen, this._gen = new BN(gen), this;\n };\n function formatReturnValue(bn, enc) {\n var buf = new Buffer(bn.toArray());\n return enc \? buf.toString(enc) : buf;\n }\n }\n}), require_browser7 = __commonJS({\n \"node_modules/diffie-hellman/browser.js\"(exports) {\n var generatePrime = require_generatePrime(), primes = require_primes(), DH = require_dh();\n function getDiffieHellman(mod) {\n var prime = new Buffer(primes[mod].prime, \"hex\"), gen = new Buffer(primes[mod].gen, \"hex\");\n return new DH(prime, gen);\n }\n var ENCODINGS = {\n binary: !0,\n hex: !0,\n base64: !0\n };\n function createDiffieHellman(prime, enc, generator, genc) {\n return Buffer.isBuffer(enc) || ENCODINGS[enc] === void 0 \? createDiffieHellman(prime, \"binary\", enc, generator) : (enc = enc || \"binary\", genc = genc || \"binary\", generator = generator || new Buffer([2]), Buffer.isBuffer(generator) || (generator = new Buffer(generator, genc)), typeof prime == \"number\" \? new DH(generatePrime(prime, generator), generator, !0) : (Buffer.isBuffer(prime) || (prime = new Buffer(prime, enc)), new DH(prime, generator, !0)));\n }\n exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman, exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman;\n }\n}), require_bn3 = require_bn, require_browserify_rsa = __commonJS({\n \"node_modules/browserify-rsa/index.js\"(exports, module) {\n var BN = require_bn3(), randomBytes = require_browser();\n function blind(priv) {\n var r = getr(priv), blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed();\n return { blinder, unblinder: r.invm(priv.modulus) };\n }\n function getr(priv) {\n var len = priv.modulus.byteLength(), r;\n do\n r = new BN(randomBytes(len));\n while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2));\n return r;\n }\n function crt(msg, priv) {\n var blinds = blind(priv), len = priv.modulus.byteLength(), blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus), c1 = blinded.toRed(BN.mont(priv.prime1)), c2 = blinded.toRed(BN.mont(priv.prime2)), qinv = priv.coefficient, p = priv.prime1, q = priv.prime2, m1 = c1.redPow(priv.exponent1).fromRed(), m2 = c2.redPow(priv.exponent2).fromRed(), h = m1.isub(m2).imul(qinv).umod(p).imul(q);\n return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, \"be\", len);\n }\n crt.getr = getr, module.exports = crt;\n }\n}), require_package = __commonJS({\n \"node_modules/elliptic/package.json\"(exports, module) {\n module.exports = {\n name: \"elliptic\",\n version: \"6.5.4\",\n description: \"EC cryptography\",\n main: \"lib/elliptic.js\",\n files: [\"lib\"],\n scripts: {\n lint: \"eslint lib test\",\n \"lint:fix\": \"npm run lint -- --fix\",\n unit: \"istanbul test _mocha --reporter=spec test/index.js\",\n test: \"npm run lint && npm run unit\",\n version: \"grunt dist && git add dist/\"\n },\n repository: {\n type: \"git\",\n url: \"git@github.com:indutny/elliptic\"\n },\n keywords: [\"EC\", \"Elliptic\", \"curve\", \"Cryptography\"],\n author: \"Fedor Indutny <fedor@indutny.com>\",\n license: \"MIT\",\n bugs: {\n url: \"https://github.com/indutny/elliptic/issues\"\n },\n homepage: \"https://github.com/indutny/elliptic\",\n devDependencies: {\n brfs: \"^2.0.2\",\n coveralls: \"^3.1.0\",\n eslint: \"^7.6.0\",\n grunt: \"^1.2.1\",\n \"grunt-browserify\": \"^5.3.0\",\n \"grunt-cli\": \"^1.3.2\",\n \"grunt-contrib-connect\": \"^3.0.0\",\n \"grunt-contrib-copy\": \"^1.0.0\",\n \"grunt-contrib-uglify\": \"^5.0.0\",\n \"grunt-mocha-istanbul\": \"^5.0.2\",\n \"grunt-saucelabs\": \"^9.0.1\",\n istanbul: \"^0.4.5\",\n mocha: \"^8.0.1\"\n },\n dependencies: {\n \"bn.js\": \"^4.11.9\",\n brorand: \"^1.1.0\",\n \"hash.js\": \"^1.0.0\",\n \"hmac-drbg\": \"^1.0.1\",\n inherits: \"^2.0.4\",\n \"minimalistic-assert\": \"^1.0.1\",\n \"minimalistic-crypto-utils\": \"^1.0.1\"\n }\n };\n }\n}), require_bn4 = require_bn, require_utils2 = __commonJS({\n \"node_modules/minimalistic-crypto-utils/lib/utils.js\"(exports) {\n var utils = exports;\n function toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg != \"string\") {\n for (var i = 0;i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n if (enc === \"hex\") {\n msg = msg.replace(/[^a-z0-9]+/gi, \"\"), msg.length % 2 !== 0 && (msg = \"0\" + msg);\n for (var i = 0;i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else\n for (var i = 0;i < msg.length; i++) {\n var c = msg.charCodeAt(i), hi = c >> 8, lo = c & 255;\n hi \? res.push(hi, lo) : res.push(lo);\n }\n return res;\n }\n utils.toArray = toArray;\n function zero2(word) {\n return word.length === 1 \? \"0\" + word : word;\n }\n utils.zero2 = zero2;\n function toHex(msg) {\n for (var res = \"\", i = 0;i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n }\n utils.toHex = toHex, utils.encode = function(arr, enc) {\n return enc === \"hex\" \? toHex(arr) : arr;\n };\n }\n}), require_utils3 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/utils.js\"(exports) {\n var utils = exports, BN = require_bn4(), minAssert = require_minimalistic_assert(), minUtils = require_utils2();\n utils.assert = minAssert, utils.toArray = minUtils.toArray, utils.zero2 = minUtils.zero2, utils.toHex = minUtils.toHex, utils.encode = minUtils.encode;\n function getNAF(num, w, bits) {\n var naf = new Array(Math.max(num.bitLength(), bits) + 1);\n naf.fill(0);\n for (var ws = 1 << w + 1, k = num.clone(), i = 0;i < naf.length; i++) {\n var z, mod = k.andln(ws - 1);\n k.isOdd() \? (mod > (ws >> 1) - 1 \? z = (ws >> 1) - mod : z = mod, k.isubn(z)) : z = 0, naf[i] = z, k.iushrn(1);\n }\n return naf;\n }\n utils.getNAF = getNAF;\n function getJSF(k1, k2) {\n var jsf = [[], []];\n k1 = k1.clone(), k2 = k2.clone();\n for (var d1 = 0, d2 = 0, m8;k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0; ) {\n var m14 = k1.andln(3) + d1 & 3, m24 = k2.andln(3) + d2 & 3;\n m14 === 3 && (m14 = -1), m24 === 3 && (m24 = -1);\n var u1;\n (m14 & 1) === 0 \? u1 = 0 : (m8 = k1.andln(7) + d1 & 7, (m8 === 3 || m8 === 5) && m24 === 2 \? u1 = -m14 : u1 = m14), jsf[0].push(u1);\n var u2;\n (m24 & 1) === 0 \? u2 = 0 : (m8 = k2.andln(7) + d2 & 7, (m8 === 3 || m8 === 5) && m14 === 2 \? u2 = -m24 : u2 = m24), jsf[1].push(u2), 2 * d1 === u1 + 1 && (d1 = 1 - d1), 2 * d2 === u2 + 1 && (d2 = 1 - d2), k1.iushrn(1), k2.iushrn(1);\n }\n return jsf;\n }\n utils.getJSF = getJSF;\n function cachedProperty(obj, name, computer) {\n var key = \"_\" + name;\n obj.prototype[name] = function() {\n return this[key] !== void 0 \? this[key] : this[key] = computer.call(this);\n };\n }\n utils.cachedProperty = cachedProperty;\n function parseBytes(bytes) {\n return typeof bytes == \"string\" \? utils.toArray(bytes, \"hex\") : bytes;\n }\n utils.parseBytes = parseBytes;\n function intFromLE(bytes) {\n return new BN(bytes, \"hex\", \"le\");\n }\n utils.intFromLE = intFromLE;\n }\n}), require_base = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/base.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), getNAF = utils.getNAF, getJSF = utils.getJSF, assert = utils.assert;\n function BaseCurve(type, conf) {\n this.type = type, this.p = new BN(conf.p, 16), this.red = conf.prime \? BN.red(conf.prime) : BN.mont(this.p), this.zero = new BN(0).toRed(this.red), this.one = new BN(1).toRed(this.red), this.two = new BN(2).toRed(this.red), this.n = conf.n && new BN(conf.n, 16), this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed), this._wnafT1 = new Array(4), this._wnafT2 = new Array(4), this._wnafT3 = new Array(4), this._wnafT4 = new Array(4), this._bitLength = this.n \? this.n.bitLength() : 0;\n var adjustCount = this.n && this.p.div(this.n);\n !adjustCount || adjustCount.cmpn(100) > 0 \? this.redN = null : (this._maxwellTrick = !0, this.redN = this.n.toRed(this.red));\n }\n module.exports = BaseCurve, BaseCurve.prototype = {}, BaseCurve.prototype.point = function() {\n throw new Error(\"Not implemented\");\n }, BaseCurve.prototype.validate = function() {\n throw new Error(\"Not implemented\");\n }, BaseCurve.prototype._fixedNafMul = function(p, k) {\n assert(p.precomputed);\n var doubles = p._getDoubles(), naf = getNAF(k, 1, this._bitLength), I = (1 << doubles.step + 1) - (doubles.step % 2 === 0 \? 2 : 1);\n I /= 3;\n var repr = [], j, nafW;\n for (j = 0;j < naf.length; j += doubles.step) {\n nafW = 0;\n for (var l = j + doubles.step - 1;l >= j; l--)\n nafW = (nafW << 1) + naf[l];\n repr.push(nafW);\n }\n for (var a = this.jpoint(null, null, null), b = this.jpoint(null, null, null), i = I;i > 0; i--) {\n for (j = 0;j < repr.length; j++)\n nafW = repr[j], nafW === i \? b = b.mixedAdd(doubles.points[j]) : nafW === -i && (b = b.mixedAdd(doubles.points[j].neg()));\n a = a.add(b);\n }\n return a.toP();\n }, BaseCurve.prototype._wnafMul = function(p, k) {\n var w = 4, nafPoints = p._getNAFPoints(w);\n w = nafPoints.wnd;\n for (var wnd = nafPoints.points, naf = getNAF(k, w, this._bitLength), acc = this.jpoint(null, null, null), i = naf.length - 1;i >= 0; i--) {\n for (var l = 0;i >= 0 && naf[i] === 0; i--)\n l++;\n if (i >= 0 && l++, acc = acc.dblp(l), i < 0)\n break;\n var z = naf[i];\n assert(z !== 0), p.type === \"affine\" \? z > 0 \? acc = acc.mixedAdd(wnd[z - 1 >> 1]) : acc = acc.mixedAdd(wnd[-z - 1 >> 1].neg()) : z > 0 \? acc = acc.add(wnd[z - 1 >> 1]) : acc = acc.add(wnd[-z - 1 >> 1].neg());\n }\n return p.type === \"affine\" \? acc.toP() : acc;\n }, BaseCurve.prototype._wnafMulAdd = function(defW, points, coeffs, len, jacobianResult) {\n var wndWidth = this._wnafT1, wnd = this._wnafT2, naf = this._wnafT3, max = 0, i, j, p;\n for (i = 0;i < len; i++) {\n p = points[i];\n var nafPoints = p._getNAFPoints(defW);\n wndWidth[i] = nafPoints.wnd, wnd[i] = nafPoints.points;\n }\n for (i = len - 1;i >= 1; i -= 2) {\n var a = i - 1, b = i;\n if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength), naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength), max = Math.max(naf[a].length, max), max = Math.max(naf[b].length, max);\n continue;\n }\n var comb = [points[a], null, null, points[b]];\n points[a].y.cmp(points[b].y) === 0 \? (comb[1] = points[a].add(points[b]), comb[2] = points[a].toJ().mixedAdd(points[b].neg())) : points[a].y.cmp(points[b].y.redNeg()) === 0 \? (comb[1] = points[a].toJ().mixedAdd(points[b]), comb[2] = points[a].add(points[b].neg())) : (comb[1] = points[a].toJ().mixedAdd(points[b]), comb[2] = points[a].toJ().mixedAdd(points[b].neg()));\n var index = [-3, -1, -5, -7, 0, 7, 5, 1, 3], jsf = getJSF(coeffs[a], coeffs[b]);\n for (max = Math.max(jsf[0].length, max), naf[a] = new Array(max), naf[b] = new Array(max), j = 0;j < max; j++) {\n var ja = jsf[0][j] | 0, jb = jsf[1][j] | 0;\n naf[a][j] = index[(ja + 1) * 3 + (jb + 1)], naf[b][j] = 0, wnd[a] = comb;\n }\n }\n var acc = this.jpoint(null, null, null), tmp = this._wnafT4;\n for (i = max;i >= 0; i--) {\n for (var k = 0;i >= 0; ) {\n var zero = !0;\n for (j = 0;j < len; j++)\n tmp[j] = naf[j][i] | 0, tmp[j] !== 0 && (zero = !1);\n if (!zero)\n break;\n k++, i--;\n }\n if (i >= 0 && k++, acc = acc.dblp(k), i < 0)\n break;\n for (j = 0;j < len; j++) {\n var z = tmp[j];\n z !== 0 && (z > 0 \? p = wnd[j][z - 1 >> 1] : z < 0 && (p = wnd[j][-z - 1 >> 1].neg()), p.type === \"affine\" \? acc = acc.mixedAdd(p) : acc = acc.add(p));\n }\n }\n for (i = 0;i < len; i++)\n wnd[i] = null;\n return jacobianResult \? acc : acc.toP();\n };\n function BasePoint(curve, type) {\n this.curve = curve, this.type = type, this.precomputed = null;\n }\n BasePoint.prototype = {}, BaseCurve.BasePoint = BasePoint, BasePoint.prototype.eq = function() {\n throw new Error(\"Not implemented\");\n }, BasePoint.prototype.validate = function() {\n return this.curve.validate(this);\n }, BaseCurve.prototype.decodePoint = function(bytes, enc) {\n bytes = utils.toArray(bytes, enc);\n var len = this.p.byteLength();\n if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) {\n bytes[0] === 6 \? assert(bytes[bytes.length - 1] % 2 === 0) : bytes[0] === 7 && assert(bytes[bytes.length - 1] % 2 === 1);\n var res = this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len));\n return res;\n } else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len)\n return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3);\n throw new Error(\"Unknown point format\");\n }, BasePoint.prototype.encodeCompressed = function(enc) {\n return this.encode(enc, !0);\n }, BasePoint.prototype._encode = function(compact) {\n var len = this.curve.p.byteLength(), x = this.getX().toArray(\"be\", len);\n return compact \? [this.getY().isEven() \? 2 : 3].concat(x) : [4].concat(x, this.getY().toArray(\"be\", len));\n }, BasePoint.prototype.encode = function(enc, compact) {\n return utils.encode(this._encode(compact), enc);\n }, BasePoint.prototype.precompute = function(power) {\n if (this.precomputed)\n return this;\n var precomputed = {\n doubles: null,\n naf: null,\n beta: null\n };\n return precomputed.naf = this._getNAFPoints(8), precomputed.doubles = this._getDoubles(4, power), precomputed.beta = this._getBeta(), this.precomputed = precomputed, this;\n }, BasePoint.prototype._hasDoubles = function(k) {\n if (!this.precomputed)\n return !1;\n var doubles = this.precomputed.doubles;\n return doubles \? doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step) : !1;\n }, BasePoint.prototype._getDoubles = function(step, power) {\n if (this.precomputed && this.precomputed.doubles)\n return this.precomputed.doubles;\n for (var doubles = [this], acc = this, i = 0;i < power; i += step) {\n for (var j = 0;j < step; j++)\n acc = acc.dbl();\n doubles.push(acc);\n }\n return {\n step,\n points: doubles\n };\n }, BasePoint.prototype._getNAFPoints = function(wnd) {\n if (this.precomputed && this.precomputed.naf)\n return this.precomputed.naf;\n for (var res = [this], max = (1 << wnd) - 1, dbl = max === 1 \? null : this.dbl(), i = 1;i < max; i++)\n res[i] = res[i - 1].add(dbl);\n return {\n wnd,\n points: res\n };\n }, BasePoint.prototype._getBeta = function() {\n return null;\n }, BasePoint.prototype.dblp = function(k) {\n for (var r = this, i = 0;i < k; i++)\n r = r.dbl();\n return r;\n };\n }\n}), require_short = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/short.js\"(exports, module) {\n var utils = require_utils3(), BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), assert = utils.assert;\n function ShortCurve(conf) {\n Base.call(this, \"short\", conf), this.a = new BN(conf.a, 16).toRed(this.red), this.b = new BN(conf.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = this.a.fromRed().cmpn(0) === 0, this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0, this.endo = this._getEndomorphism(conf), this._endoWnafT1 = new Array(4), this._endoWnafT2 = new Array(4);\n }\n inherits(ShortCurve, Base), module.exports = ShortCurve, ShortCurve.prototype._getEndomorphism = function(conf) {\n if (!(!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)) {\n var beta, lambda;\n if (conf.beta)\n beta = new BN(conf.beta, 16).toRed(this.red);\n else {\n var betas = this._getEndoRoots(this.p);\n beta = betas[0].cmp(betas[1]) < 0 \? betas[0] : betas[1], beta = beta.toRed(this.red);\n }\n if (conf.lambda)\n lambda = new BN(conf.lambda, 16);\n else {\n var lambdas = this._getEndoRoots(this.n);\n this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0 \? lambda = lambdas[0] : (lambda = lambdas[1], assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0));\n }\n var basis;\n return conf.basis \? basis = conf.basis.map(function(vec) {\n return {\n a: new BN(vec.a, 16),\n b: new BN(vec.b, 16)\n };\n }) : basis = this._getEndoBasis(lambda), {\n beta,\n lambda,\n basis\n };\n }\n }, ShortCurve.prototype._getEndoRoots = function(num) {\n var red = num === this.p \? this.red : BN.mont(num), tinv = new BN(2).toRed(red).redInvm(), ntinv = tinv.redNeg(), s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv), l1 = ntinv.redAdd(s).fromRed(), l2 = ntinv.redSub(s).fromRed();\n return [l1, l2];\n }, ShortCurve.prototype._getEndoBasis = function(lambda) {\n for (var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), u = lambda, v = this.n.clone(), x1 = new BN(1), y1 = new BN(0), x2 = new BN(0), y2 = new BN(1), a0, b0, a1, b1, a2, b2, prevR, i = 0, r, x;u.cmpn(0) !== 0; ) {\n var q = v.div(u);\n r = v.sub(q.mul(u)), x = x2.sub(q.mul(x1));\n var y = y2.sub(q.mul(y1));\n if (!a1 && r.cmp(aprxSqrt) < 0)\n a0 = prevR.neg(), b0 = x1, a1 = r.neg(), b1 = x;\n else if (a1 && ++i === 2)\n break;\n prevR = r, v = u, u = r, x2 = x1, x1 = x, y2 = y1, y1 = y;\n }\n a2 = r.neg(), b2 = x;\n var len1 = a1.sqr().add(b1.sqr()), len2 = a2.sqr().add(b2.sqr());\n return len2.cmp(len1) >= 0 && (a2 = a0, b2 = b0), a1.negative && (a1 = a1.neg(), b1 = b1.neg()), a2.negative && (a2 = a2.neg(), b2 = b2.neg()), [\n { a: a1, b: b1 },\n { a: a2, b: b2 }\n ];\n }, ShortCurve.prototype._endoSplit = function(k) {\n var basis = this.endo.basis, v1 = basis[0], v2 = basis[1], c1 = v2.b.mul(k).divRound(this.n), c2 = v1.b.neg().mul(k).divRound(this.n), p1 = c1.mul(v1.a), p2 = c2.mul(v2.a), q1 = c1.mul(v1.b), q2 = c2.mul(v2.b), k1 = k.sub(p1).sub(p2), k2 = q1.add(q2).neg();\n return { k1, k2 };\n }, ShortCurve.prototype.pointFromX = function(x, odd) {\n x = new BN(x, 16), x.red || (x = x.toRed(this.red));\n var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b), y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n var isOdd = y.fromRed().isOdd();\n return (odd && !isOdd || !odd && isOdd) && (y = y.redNeg()), this.point(x, y);\n }, ShortCurve.prototype.validate = function(point) {\n if (point.inf)\n return !0;\n var { x, y } = point, ax = this.a.redMul(x), rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n return y.redSqr().redISub(rhs).cmpn(0) === 0;\n }, ShortCurve.prototype._endoWnafMulAdd = function(points, coeffs, jacobianResult) {\n for (var npoints = this._endoWnafT1, ncoeffs = this._endoWnafT2, i = 0;i < points.length; i++) {\n var split = this._endoSplit(coeffs[i]), p = points[i], beta = p._getBeta();\n split.k1.negative && (split.k1.ineg(), p = p.neg(!0)), split.k2.negative && (split.k2.ineg(), beta = beta.neg(!0)), npoints[i * 2] = p, npoints[i * 2 + 1] = beta, ncoeffs[i * 2] = split.k1, ncoeffs[i * 2 + 1] = split.k2;\n }\n for (var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult), j = 0;j < i * 2; j++)\n npoints[j] = null, ncoeffs[j] = null;\n return res;\n };\n function Point(curve, x, y, isRed) {\n Base.BasePoint.call(this, curve, \"affine\"), x === null && y === null \? (this.x = null, this.y = null, this.inf = !0) : (this.x = new BN(x, 16), this.y = new BN(y, 16), isRed && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = !1);\n }\n inherits(Point, Base.BasePoint), ShortCurve.prototype.point = function(x, y, isRed) {\n return new Point(this, x, y, isRed);\n }, ShortCurve.prototype.pointFromJSON = function(obj, red) {\n return Point.fromJSON(this, obj, red);\n }, Point.prototype._getBeta = function() {\n if (this.curve.endo) {\n var pre = this.precomputed;\n if (pre && pre.beta)\n return pre.beta;\n var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n if (pre) {\n var curve = this.curve, endoMul = function(p) {\n return curve.point(p.x.redMul(curve.endo.beta), p.y);\n };\n pre.beta = beta, beta.precomputed = {\n beta: null,\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(endoMul)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(endoMul)\n }\n };\n }\n return beta;\n }\n }, Point.prototype.toJSON = function() {\n return this.precomputed \? [\n this.x,\n this.y,\n this.precomputed && {\n doubles: this.precomputed.doubles && {\n step: this.precomputed.doubles.step,\n points: this.precomputed.doubles.points.slice(1)\n },\n naf: this.precomputed.naf && {\n wnd: this.precomputed.naf.wnd,\n points: this.precomputed.naf.points.slice(1)\n }\n }\n ] : [this.x, this.y];\n }, Point.fromJSON = function(curve, obj, red) {\n typeof obj == \"string\" && (obj = JSON.parse(obj));\n var res = curve.point(obj[0], obj[1], red);\n if (!obj[2])\n return res;\n function obj2point(obj2) {\n return curve.point(obj2[0], obj2[1], red);\n }\n var pre = obj[2];\n return res.precomputed = {\n beta: null,\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: [res].concat(pre.doubles.points.map(obj2point))\n },\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: [res].concat(pre.naf.points.map(obj2point))\n }\n }, res;\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" y: \" + this.y.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.inf;\n }, Point.prototype.add = function(p) {\n if (this.inf)\n return p;\n if (p.inf)\n return this;\n if (this.eq(p))\n return this.dbl();\n if (this.neg().eq(p))\n return this.curve.point(null, null);\n if (this.x.cmp(p.x) === 0)\n return this.curve.point(null, null);\n var c = this.y.redSub(p.y);\n c.cmpn(0) !== 0 && (c = c.redMul(this.x.redSub(p.x).redInvm()));\n var nx = c.redSqr().redISub(this.x).redISub(p.x), ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n }, Point.prototype.dbl = function() {\n if (this.inf)\n return this;\n var ys1 = this.y.redAdd(this.y);\n if (ys1.cmpn(0) === 0)\n return this.curve.point(null, null);\n var a = this.curve.a, x2 = this.x.redSqr(), dyinv = ys1.redInvm(), c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv), nx = c.redSqr().redISub(this.x.redAdd(this.x)), ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n }, Point.prototype.getX = function() {\n return this.x.fromRed();\n }, Point.prototype.getY = function() {\n return this.y.fromRed();\n }, Point.prototype.mul = function(k) {\n return k = new BN(k, 16), this.isInfinity() \? this : this._hasDoubles(k) \? this.curve._fixedNafMul(this, k) : this.curve.endo \? this.curve._endoWnafMulAdd([this], [k]) : this.curve._wnafMul(this, k);\n }, Point.prototype.mulAdd = function(k1, p2, k2) {\n var points = [this, p2], coeffs = [k1, k2];\n return this.curve.endo \? this.curve._endoWnafMulAdd(points, coeffs) : this.curve._wnafMulAdd(1, points, coeffs, 2);\n }, Point.prototype.jmulAdd = function(k1, p2, k2) {\n var points = [this, p2], coeffs = [k1, k2];\n return this.curve.endo \? this.curve._endoWnafMulAdd(points, coeffs, !0) : this.curve._wnafMulAdd(1, points, coeffs, 2, !0);\n }, Point.prototype.eq = function(p) {\n return this === p || this.inf === p.inf && (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n }, Point.prototype.neg = function(_precompute) {\n if (this.inf)\n return this;\n var res = this.curve.point(this.x, this.y.redNeg());\n if (_precompute && this.precomputed) {\n var pre = this.precomputed, negate = function(p) {\n return p.neg();\n };\n res.precomputed = {\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(negate)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(negate)\n }\n };\n }\n return res;\n }, Point.prototype.toJ = function() {\n if (this.inf)\n return this.curve.jpoint(null, null, null);\n var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n return res;\n };\n function JPoint(curve, x, y, z) {\n Base.BasePoint.call(this, curve, \"jacobian\"), x === null && y === null && z === null \? (this.x = this.curve.one, this.y = this.curve.one, this.z = new BN(0)) : (this.x = new BN(x, 16), this.y = new BN(y, 16), this.z = new BN(z, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one;\n }\n inherits(JPoint, Base.BasePoint), ShortCurve.prototype.jpoint = function(x, y, z) {\n return new JPoint(this, x, y, z);\n }, JPoint.prototype.toP = function() {\n if (this.isInfinity())\n return this.curve.point(null, null);\n var zinv = this.z.redInvm(), zinv2 = zinv.redSqr(), ax = this.x.redMul(zinv2), ay = this.y.redMul(zinv2).redMul(zinv);\n return this.curve.point(ax, ay);\n }, JPoint.prototype.neg = function() {\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n }, JPoint.prototype.add = function(p) {\n if (this.isInfinity())\n return p;\n if (p.isInfinity())\n return this;\n var pz2 = p.z.redSqr(), z2 = this.z.redSqr(), u1 = this.x.redMul(pz2), u2 = p.x.redMul(z2), s1 = this.y.redMul(pz2.redMul(p.z)), s2 = p.y.redMul(z2.redMul(this.z)), h = u1.redSub(u2), r = s1.redSub(s2);\n if (h.cmpn(0) === 0)\n return r.cmpn(0) !== 0 \? this.curve.jpoint(null, null, null) : this.dbl();\n var h2 = h.redSqr(), h3 = h2.redMul(h), v = u1.redMul(h2), nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v), ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)), nz = this.z.redMul(p.z).redMul(h);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.mixedAdd = function(p) {\n if (this.isInfinity())\n return p.toJ();\n if (p.isInfinity())\n return this;\n var z2 = this.z.redSqr(), u1 = this.x, u2 = p.x.redMul(z2), s1 = this.y, s2 = p.y.redMul(z2).redMul(this.z), h = u1.redSub(u2), r = s1.redSub(s2);\n if (h.cmpn(0) === 0)\n return r.cmpn(0) !== 0 \? this.curve.jpoint(null, null, null) : this.dbl();\n var h2 = h.redSqr(), h3 = h2.redMul(h), v = u1.redMul(h2), nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v), ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)), nz = this.z.redMul(h);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.dblp = function(pow) {\n if (pow === 0)\n return this;\n if (this.isInfinity())\n return this;\n if (!pow)\n return this.dbl();\n var i;\n if (this.curve.zeroA || this.curve.threeA) {\n var r = this;\n for (i = 0;i < pow; i++)\n r = r.dbl();\n return r;\n }\n var a = this.curve.a, tinv = this.curve.tinv, jx = this.x, jy = this.y, jz = this.z, jz4 = jz.redSqr().redSqr(), jyd = jy.redAdd(jy);\n for (i = 0;i < pow; i++) {\n var jx2 = jx.redSqr(), jyd2 = jyd.redSqr(), jyd4 = jyd2.redSqr(), c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)), t1 = jx.redMul(jyd2), nx = c.redSqr().redISub(t1.redAdd(t1)), t2 = t1.redISub(nx), dny = c.redMul(t2);\n dny = dny.redIAdd(dny).redISub(jyd4);\n var nz = jyd.redMul(jz);\n i + 1 < pow && (jz4 = jz4.redMul(jyd4)), jx = nx, jz = nz, jyd = dny;\n }\n return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n }, JPoint.prototype.dbl = function() {\n return this.isInfinity() \? this : this.curve.zeroA \? this._zeroDbl() : this.curve.threeA \? this._threeDbl() : this._dbl();\n }, JPoint.prototype._zeroDbl = function() {\n var nx, ny, nz;\n if (this.zOne) {\n var xx = this.x.redSqr(), yy = this.y.redSqr(), yyyy = yy.redSqr(), s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n var m = xx.redAdd(xx).redIAdd(xx), t = m.redSqr().redISub(s).redISub(s), yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8), yyyy8 = yyyy8.redIAdd(yyyy8), nx = t, ny = m.redMul(s.redISub(t)).redISub(yyyy8), nz = this.y.redAdd(this.y);\n } else {\n var a = this.x.redSqr(), b = this.y.redSqr(), c = b.redSqr(), d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n d = d.redIAdd(d);\n var e = a.redAdd(a).redIAdd(a), f = e.redSqr(), c8 = c.redIAdd(c);\n c8 = c8.redIAdd(c8), c8 = c8.redIAdd(c8), nx = f.redISub(d).redISub(d), ny = e.redMul(d.redISub(nx)).redISub(c8), nz = this.y.redMul(this.z), nz = nz.redIAdd(nz);\n }\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype._threeDbl = function() {\n var nx, ny, nz;\n if (this.zOne) {\n var xx = this.x.redSqr(), yy = this.y.redSqr(), yyyy = yy.redSqr(), s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a), t = m.redSqr().redISub(s).redISub(s);\n nx = t;\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8), yyyy8 = yyyy8.redIAdd(yyyy8), ny = m.redMul(s.redISub(t)).redISub(yyyy8), nz = this.y.redAdd(this.y);\n } else {\n var delta = this.z.redSqr(), gamma = this.y.redSqr(), beta = this.x.redMul(gamma), alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n alpha = alpha.redAdd(alpha).redIAdd(alpha);\n var beta4 = beta.redIAdd(beta);\n beta4 = beta4.redIAdd(beta4);\n var beta8 = beta4.redAdd(beta4);\n nx = alpha.redSqr().redISub(beta8), nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n var ggamma8 = gamma.redSqr();\n ggamma8 = ggamma8.redIAdd(ggamma8), ggamma8 = ggamma8.redIAdd(ggamma8), ggamma8 = ggamma8.redIAdd(ggamma8), ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n }\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype._dbl = function() {\n var a = this.curve.a, jx = this.x, jy = this.y, jz = this.z, jz4 = jz.redSqr().redSqr(), jx2 = jx.redSqr(), jy2 = jy.redSqr(), c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)), jxd4 = jx.redAdd(jx);\n jxd4 = jxd4.redIAdd(jxd4);\n var t1 = jxd4.redMul(jy2), nx = c.redSqr().redISub(t1.redAdd(t1)), t2 = t1.redISub(nx), jyd8 = jy2.redSqr();\n jyd8 = jyd8.redIAdd(jyd8), jyd8 = jyd8.redIAdd(jyd8), jyd8 = jyd8.redIAdd(jyd8);\n var ny = c.redMul(t2).redISub(jyd8), nz = jy.redAdd(jy).redMul(jz);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.trpl = function() {\n if (!this.curve.zeroA)\n return this.dbl().add(this);\n var xx = this.x.redSqr(), yy = this.y.redSqr(), zz = this.z.redSqr(), yyyy = yy.redSqr(), m = xx.redAdd(xx).redIAdd(xx), mm = m.redSqr(), e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n e = e.redIAdd(e), e = e.redAdd(e).redIAdd(e), e = e.redISub(mm);\n var ee = e.redSqr(), t = yyyy.redIAdd(yyyy);\n t = t.redIAdd(t), t = t.redIAdd(t), t = t.redIAdd(t);\n var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t), yyu4 = yy.redMul(u);\n yyu4 = yyu4.redIAdd(yyu4), yyu4 = yyu4.redIAdd(yyu4);\n var nx = this.x.redMul(ee).redISub(yyu4);\n nx = nx.redIAdd(nx), nx = nx.redIAdd(nx);\n var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n ny = ny.redIAdd(ny), ny = ny.redIAdd(ny), ny = ny.redIAdd(ny);\n var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.mul = function(k, kbase) {\n return k = new BN(k, kbase), this.curve._wnafMul(this, k);\n }, JPoint.prototype.eq = function(p) {\n if (p.type === \"affine\")\n return this.eq(p.toJ());\n if (this === p)\n return !0;\n var z2 = this.z.redSqr(), pz2 = p.z.redSqr();\n if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n return !1;\n var z3 = z2.redMul(this.z), pz3 = pz2.redMul(p.z);\n return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n }, JPoint.prototype.eqXToP = function(x) {\n var zs = this.z.redSqr(), rx = x.toRed(this.curve.red).redMul(zs);\n if (this.x.cmp(rx) === 0)\n return !0;\n for (var xc = x.clone(), t = this.curve.redN.redMul(zs);; ) {\n if (xc.iadd(this.curve.n), xc.cmp(this.curve.p) >= 0)\n return !1;\n if (rx.redIAdd(t), this.x.cmp(rx) === 0)\n return !0;\n }\n }, JPoint.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC JPoint Infinity>\" : \"<EC JPoint x: \" + this.x.toString(16, 2) + \" y: \" + this.y.toString(16, 2) + \" z: \" + this.z.toString(16, 2) + \">\";\n }, JPoint.prototype.isInfinity = function() {\n return this.z.cmpn(0) === 0;\n };\n }\n}), require_mont = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/mont.js\"(exports, module) {\n var BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), utils = require_utils3();\n function MontCurve(conf) {\n Base.call(this, \"mont\", conf), this.a = new BN(conf.a, 16).toRed(this.red), this.b = new BN(conf.b, 16).toRed(this.red), this.i4 = new BN(4).toRed(this.red).redInvm(), this.two = new BN(2).toRed(this.red), this.a24 = this.i4.redMul(this.a.redAdd(this.two));\n }\n inherits(MontCurve, Base), module.exports = MontCurve, MontCurve.prototype.validate = function(point) {\n var x = point.normalize().x, x2 = x.redSqr(), rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x), y = rhs.redSqrt();\n return y.redSqr().cmp(rhs) === 0;\n };\n function Point(curve, x, z) {\n Base.BasePoint.call(this, curve, \"projective\"), x === null && z === null \? (this.x = this.curve.one, this.z = this.curve.zero) : (this.x = new BN(x, 16), this.z = new BN(z, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)));\n }\n inherits(Point, Base.BasePoint), MontCurve.prototype.decodePoint = function(bytes, enc) {\n return this.point(utils.toArray(bytes, enc), 1);\n }, MontCurve.prototype.point = function(x, z) {\n return new Point(this, x, z);\n }, MontCurve.prototype.pointFromJSON = function(obj) {\n return Point.fromJSON(this, obj);\n }, Point.prototype.precompute = function() {\n }, Point.prototype._encode = function() {\n return this.getX().toArray(\"be\", this.curve.p.byteLength());\n }, Point.fromJSON = function(curve, obj) {\n return new Point(curve, obj[0], obj[1] || curve.one);\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" z: \" + this.z.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.z.cmpn(0) === 0;\n }, Point.prototype.dbl = function() {\n var a = this.x.redAdd(this.z), aa = a.redSqr(), b = this.x.redSub(this.z), bb = b.redSqr(), c = aa.redSub(bb), nx = aa.redMul(bb), nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\n return this.curve.point(nx, nz);\n }, Point.prototype.add = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.diffAdd = function(p, diff) {\n var a = this.x.redAdd(this.z), b = this.x.redSub(this.z), c = p.x.redAdd(p.z), d = p.x.redSub(p.z), da = d.redMul(a), cb = c.redMul(b), nx = diff.z.redMul(da.redAdd(cb).redSqr()), nz = diff.x.redMul(da.redISub(cb).redSqr());\n return this.curve.point(nx, nz);\n }, Point.prototype.mul = function(k) {\n for (var t = k.clone(), a = this, b = this.curve.point(null, null), c = this, bits = [];t.cmpn(0) !== 0; t.iushrn(1))\n bits.push(t.andln(1));\n for (var i = bits.length - 1;i >= 0; i--)\n bits[i] === 0 \? (a = a.diffAdd(b, c), b = b.dbl()) : (b = a.diffAdd(b, c), a = a.dbl());\n return b;\n }, Point.prototype.mulAdd = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.jumlAdd = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.eq = function(other) {\n return this.getX().cmp(other.getX()) === 0;\n }, Point.prototype.normalize = function() {\n return this.x = this.x.redMul(this.z.redInvm()), this.z = this.curve.one, this;\n }, Point.prototype.getX = function() {\n return this.normalize(), this.x.fromRed();\n };\n }\n}), require_edwards = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/edwards.js\"(exports, module) {\n var utils = require_utils3(), BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), assert = utils.assert;\n function EdwardsCurve(conf) {\n this.twisted = (conf.a | 0) !== 1, this.mOneA = this.twisted && (conf.a | 0) === -1, this.extended = this.mOneA, Base.call(this, \"edwards\", conf), this.a = new BN(conf.a, 16).umod(this.red.m), this.a = this.a.toRed(this.red), this.c = new BN(conf.c, 16).toRed(this.red), this.c2 = this.c.redSqr(), this.d = new BN(conf.d, 16).toRed(this.red), this.dd = this.d.redAdd(this.d), assert(!this.twisted || this.c.fromRed().cmpn(1) === 0), this.oneC = (conf.c | 0) === 1;\n }\n inherits(EdwardsCurve, Base), module.exports = EdwardsCurve, EdwardsCurve.prototype._mulA = function(num) {\n return this.mOneA \? num.redNeg() : this.a.redMul(num);\n }, EdwardsCurve.prototype._mulC = function(num) {\n return this.oneC \? num : this.c.redMul(num);\n }, EdwardsCurve.prototype.jpoint = function(x, y, z, t) {\n return this.point(x, y, z, t);\n }, EdwardsCurve.prototype.pointFromX = function(x, odd) {\n x = new BN(x, 16), x.red || (x = x.toRed(this.red));\n var x2 = x.redSqr(), rhs = this.c2.redSub(this.a.redMul(x2)), lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2)), y2 = rhs.redMul(lhs.redInvm()), y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n var isOdd = y.fromRed().isOdd();\n return (odd && !isOdd || !odd && isOdd) && (y = y.redNeg()), this.point(x, y);\n }, EdwardsCurve.prototype.pointFromY = function(y, odd) {\n y = new BN(y, 16), y.red || (y = y.toRed(this.red));\n var y2 = y.redSqr(), lhs = y2.redSub(this.c2), rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a), x2 = lhs.redMul(rhs.redInvm());\n if (x2.cmp(this.zero) === 0) {\n if (odd)\n throw new Error(\"invalid point\");\n return this.point(this.zero, y);\n }\n var x = x2.redSqrt();\n if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n return x.fromRed().isOdd() !== odd && (x = x.redNeg()), this.point(x, y);\n }, EdwardsCurve.prototype.validate = function(point) {\n if (point.isInfinity())\n return !0;\n point.normalize();\n var x2 = point.x.redSqr(), y2 = point.y.redSqr(), lhs = x2.redMul(this.a).redAdd(y2), rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\n return lhs.cmp(rhs) === 0;\n };\n function Point(curve, x, y, z, t) {\n Base.BasePoint.call(this, curve, \"projective\"), x === null && y === null && z === null \? (this.x = this.curve.zero, this.y = this.curve.one, this.z = this.curve.one, this.t = this.curve.zero, this.zOne = !0) : (this.x = new BN(x, 16), this.y = new BN(y, 16), this.z = z \? new BN(z, 16) : this.curve.one, this.t = t && new BN(t, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.t && !this.t.red && (this.t = this.t.toRed(this.curve.red)), this.zOne = this.z === this.curve.one, this.curve.extended && !this.t && (this.t = this.x.redMul(this.y), this.zOne || (this.t = this.t.redMul(this.z.redInvm()))));\n }\n inherits(Point, Base.BasePoint), EdwardsCurve.prototype.pointFromJSON = function(obj) {\n return Point.fromJSON(this, obj);\n }, EdwardsCurve.prototype.point = function(x, y, z, t) {\n return new Point(this, x, y, z, t);\n }, Point.fromJSON = function(curve, obj) {\n return new Point(curve, obj[0], obj[1], obj[2]);\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" y: \" + this.y.fromRed().toString(16, 2) + \" z: \" + this.z.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || this.zOne && this.y.cmp(this.curve.c) === 0);\n }, Point.prototype._extDbl = function() {\n var a = this.x.redSqr(), b = this.y.redSqr(), c = this.z.redSqr();\n c = c.redIAdd(c);\n var d = this.curve._mulA(a), e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b), g = d.redAdd(b), f = g.redSub(c), h = d.redSub(b), nx = e.redMul(f), ny = g.redMul(h), nt = e.redMul(h), nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n }, Point.prototype._projDbl = function() {\n var b = this.x.redAdd(this.y).redSqr(), c = this.x.redSqr(), d = this.y.redSqr(), nx, ny, nz, e, h, j;\n if (this.curve.twisted) {\n e = this.curve._mulA(c);\n var f = e.redAdd(d);\n this.zOne \? (nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)), ny = f.redMul(e.redSub(d)), nz = f.redSqr().redSub(f).redSub(f)) : (h = this.z.redSqr(), j = f.redSub(h).redISub(h), nx = b.redSub(c).redISub(d).redMul(j), ny = f.redMul(e.redSub(d)), nz = f.redMul(j));\n } else\n e = c.redAdd(d), h = this.curve._mulC(this.z).redSqr(), j = e.redSub(h).redSub(h), nx = this.curve._mulC(b.redISub(e)).redMul(j), ny = this.curve._mulC(e).redMul(c.redISub(d)), nz = e.redMul(j);\n return this.curve.point(nx, ny, nz);\n }, Point.prototype.dbl = function() {\n return this.isInfinity() \? this : this.curve.extended \? this._extDbl() : this._projDbl();\n }, Point.prototype._extAdd = function(p) {\n var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)), b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)), c = this.t.redMul(this.curve.dd).redMul(p.t), d = this.z.redMul(p.z.redAdd(p.z)), e = b.redSub(a), f = d.redSub(c), g = d.redAdd(c), h = b.redAdd(a), nx = e.redMul(f), ny = g.redMul(h), nt = e.redMul(h), nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n }, Point.prototype._projAdd = function(p) {\n var a = this.z.redMul(p.z), b = a.redSqr(), c = this.x.redMul(p.x), d = this.y.redMul(p.y), e = this.curve.d.redMul(c).redMul(d), f = b.redSub(e), g = b.redAdd(e), tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d), nx = a.redMul(f).redMul(tmp), ny, nz;\n return this.curve.twisted \? (ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))), nz = f.redMul(g)) : (ny = a.redMul(g).redMul(d.redSub(c)), nz = this.curve._mulC(f).redMul(g)), this.curve.point(nx, ny, nz);\n }, Point.prototype.add = function(p) {\n return this.isInfinity() \? p : p.isInfinity() \? this : this.curve.extended \? this._extAdd(p) : this._projAdd(p);\n }, Point.prototype.mul = function(k) {\n return this._hasDoubles(k) \? this.curve._fixedNafMul(this, k) : this.curve._wnafMul(this, k);\n }, Point.prototype.mulAdd = function(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, !1);\n }, Point.prototype.jmulAdd = function(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, !0);\n }, Point.prototype.normalize = function() {\n if (this.zOne)\n return this;\n var zi = this.z.redInvm();\n return this.x = this.x.redMul(zi), this.y = this.y.redMul(zi), this.t && (this.t = this.t.redMul(zi)), this.z = this.curve.one, this.zOne = !0, this;\n }, Point.prototype.neg = function() {\n return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg());\n }, Point.prototype.getX = function() {\n return this.normalize(), this.x.fromRed();\n }, Point.prototype.getY = function() {\n return this.normalize(), this.y.fromRed();\n }, Point.prototype.eq = function(other) {\n return this === other || this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0;\n }, Point.prototype.eqXToP = function(x) {\n var rx = x.toRed(this.curve.red).redMul(this.z);\n if (this.x.cmp(rx) === 0)\n return !0;\n for (var xc = x.clone(), t = this.curve.redN.redMul(this.z);; ) {\n if (xc.iadd(this.curve.n), xc.cmp(this.curve.p) >= 0)\n return !1;\n if (rx.redIAdd(t), this.x.cmp(rx) === 0)\n return !0;\n }\n }, Point.prototype.toP = Point.prototype.normalize, Point.prototype.mixedAdd = Point.prototype.add;\n }\n}), require_curve = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/index.js\"(exports) {\n var curve = exports;\n curve.base = require_base(), curve.short = require_short(), curve.mont = require_mont(), curve.edwards = require_edwards();\n }\n}), require_utils4 = __commonJS({\n \"node_modules/hash.js/lib/hash/utils.js\"(exports) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser();\n exports.inherits = inherits;\n function isSurrogatePair(msg, i) {\n return (msg.charCodeAt(i) & 64512) !== 55296 || i < 0 || i + 1 >= msg.length \? !1 : (msg.charCodeAt(i + 1) & 64512) === 56320;\n }\n function toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg == \"string\")\n if (enc) {\n if (enc === \"hex\")\n for (msg = msg.replace(/[^a-z0-9]+/gi, \"\"), msg.length % 2 !== 0 && (msg = \"0\" + msg), i = 0;i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else\n for (var p = 0, i = 0;i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n c < 128 \? res[p++] = c : c < 2048 \? (res[p++] = c >> 6 | 192, res[p++] = c & 63 | 128) : isSurrogatePair(msg, i) \? (c = 65536 + ((c & 1023) << 10) + (msg.charCodeAt(++i) & 1023), res[p++] = c >> 18 | 240, res[p++] = c >> 12 & 63 | 128, res[p++] = c >> 6 & 63 | 128, res[p++] = c & 63 | 128) : (res[p++] = c >> 12 | 224, res[p++] = c >> 6 & 63 | 128, res[p++] = c & 63 | 128);\n }\n else\n for (i = 0;i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n exports.toArray = toArray;\n function toHex(msg) {\n for (var res = \"\", i = 0;i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n }\n exports.toHex = toHex;\n function htonl(w) {\n var res = w >>> 24 | w >>> 8 & 65280 | w << 8 & 16711680 | (w & 255) << 24;\n return res >>> 0;\n }\n exports.htonl = htonl;\n function toHex32(msg, endian) {\n for (var res = \"\", i = 0;i < msg.length; i++) {\n var w = msg[i];\n endian === \"little\" && (w = htonl(w)), res += zero8(w.toString(16));\n }\n return res;\n }\n exports.toHex32 = toHex32;\n function zero2(word) {\n return word.length === 1 \? \"0\" + word : word;\n }\n exports.zero2 = zero2;\n function zero8(word) {\n return word.length === 7 \? \"0\" + word : word.length === 6 \? \"00\" + word : word.length === 5 \? \"000\" + word : word.length === 4 \? \"0000\" + word : word.length === 3 \? \"00000\" + word : word.length === 2 \? \"000000\" + word : word.length === 1 \? \"0000000\" + word : word;\n }\n exports.zero8 = zero8;\n function join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n for (var res = new Array(len / 4), i = 0, k = start;i < res.length; i++, k += 4) {\n var w;\n endian === \"big\" \? w = msg[k] << 24 | msg[k + 1] << 16 | msg[k + 2] << 8 | msg[k + 3] : w = msg[k + 3] << 24 | msg[k + 2] << 16 | msg[k + 1] << 8 | msg[k], res[i] = w >>> 0;\n }\n return res;\n }\n exports.join32 = join32;\n function split32(msg, endian) {\n for (var res = new Array(msg.length * 4), i = 0, k = 0;i < msg.length; i++, k += 4) {\n var m = msg[i];\n endian === \"big\" \? (res[k] = m >>> 24, res[k + 1] = m >>> 16 & 255, res[k + 2] = m >>> 8 & 255, res[k + 3] = m & 255) : (res[k + 3] = m >>> 24, res[k + 2] = m >>> 16 & 255, res[k + 1] = m >>> 8 & 255, res[k] = m & 255);\n }\n return res;\n }\n exports.split32 = split32;\n function rotr32(w, b) {\n return w >>> b | w << 32 - b;\n }\n exports.rotr32 = rotr32;\n function rotl32(w, b) {\n return w << b | w >>> 32 - b;\n }\n exports.rotl32 = rotl32;\n function sum32(a, b) {\n return a + b >>> 0;\n }\n exports.sum32 = sum32;\n function sum32_3(a, b, c) {\n return a + b + c >>> 0;\n }\n exports.sum32_3 = sum32_3;\n function sum32_4(a, b, c, d) {\n return a + b + c + d >>> 0;\n }\n exports.sum32_4 = sum32_4;\n function sum32_5(a, b, c, d, e) {\n return a + b + c + d + e >>> 0;\n }\n exports.sum32_5 = sum32_5;\n function sum64(buf, pos, ah, al) {\n var bh = buf[pos], bl = buf[pos + 1], lo = al + bl >>> 0, hi = (lo < al \? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0, buf[pos + 1] = lo;\n }\n exports.sum64 = sum64;\n function sum64_hi(ah, al, bh, bl) {\n var lo = al + bl >>> 0, hi = (lo < al \? 1 : 0) + ah + bh;\n return hi >>> 0;\n }\n exports.sum64_hi = sum64_hi;\n function sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n }\n exports.sum64_lo = sum64_lo;\n function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0, lo = al;\n lo = lo + bl >>> 0, carry += lo < al \? 1 : 0, lo = lo + cl >>> 0, carry += lo < cl \? 1 : 0, lo = lo + dl >>> 0, carry += lo < dl \? 1 : 0;\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n }\n exports.sum64_4_hi = sum64_4_hi;\n function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n }\n exports.sum64_4_lo = sum64_4_lo;\n function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0, lo = al;\n lo = lo + bl >>> 0, carry += lo < al \? 1 : 0, lo = lo + cl >>> 0, carry += lo < cl \? 1 : 0, lo = lo + dl >>> 0, carry += lo < dl \? 1 : 0, lo = lo + el >>> 0, carry += lo < el \? 1 : 0;\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n }\n exports.sum64_5_hi = sum64_5_hi;\n function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n return lo >>> 0;\n }\n exports.sum64_5_lo = sum64_5_lo;\n function rotr64_hi(ah, al, num) {\n var r = al << 32 - num | ah >>> num;\n return r >>> 0;\n }\n exports.rotr64_hi = rotr64_hi;\n function rotr64_lo(ah, al, num) {\n var r = ah << 32 - num | al >>> num;\n return r >>> 0;\n }\n exports.rotr64_lo = rotr64_lo;\n function shr64_hi(ah, al, num) {\n return ah >>> num;\n }\n exports.shr64_hi = shr64_hi;\n function shr64_lo(ah, al, num) {\n var r = ah << 32 - num | al >>> num;\n return r >>> 0;\n }\n exports.shr64_lo = shr64_lo;\n }\n}), require_common = __commonJS({\n \"node_modules/hash.js/lib/hash/common.js\"(exports) {\n var utils = require_utils4(), assert = require_minimalistic_assert();\n function BlockHash() {\n this.pending = null, this.pendingTotal = 0, this.blockSize = this.constructor.blockSize, this.outSize = this.constructor.outSize, this.hmacStrength = this.constructor.hmacStrength, this.padLength = this.constructor.padLength / 8, this.endian = \"big\", this._delta8 = this.blockSize / 8, this._delta32 = this.blockSize / 32;\n }\n BlockHash.prototype = {}, exports.BlockHash = BlockHash, BlockHash.prototype.update = function(msg, enc) {\n if (msg = utils.toArray(msg, enc), this.pending \? this.pending = this.pending.concat(msg) : this.pending = msg, this.pendingTotal += msg.length, this.pending.length >= this._delta8) {\n msg = this.pending;\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length), this.pending.length === 0 && (this.pending = null), msg = utils.join32(msg, 0, msg.length - r, this.endian);\n for (var i = 0;i < msg.length; i += this._delta32)\n this._update(msg, i, i + this._delta32);\n }\n return this;\n }, BlockHash.prototype.digest = function(enc) {\n return this.update(this._pad()), assert(this.pending === null), this._digest(enc);\n }, BlockHash.prototype._pad = function() {\n var len = this.pendingTotal, bytes = this._delta8, k = bytes - (len + this.padLength) % bytes, res = new Array(k + this.padLength);\n res[0] = 128;\n for (var i = 1;i < k; i++)\n res[i] = 0;\n if (len <<= 3, this.endian === \"big\") {\n for (var t = 8;t < this.padLength; t++)\n res[i++] = 0;\n res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = len >>> 24 & 255, res[i++] = len >>> 16 & 255, res[i++] = len >>> 8 & 255, res[i++] = len & 255;\n } else\n for (res[i++] = len & 255, res[i++] = len >>> 8 & 255, res[i++] = len >>> 16 & 255, res[i++] = len >>> 24 & 255, res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = 0, t = 8;t < this.padLength; t++)\n res[i++] = 0;\n return res;\n };\n }\n}), require_common2 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/common.js\"(exports) {\n var utils = require_utils4(), rotr32 = utils.rotr32;\n function ft_1(s, x, y, z) {\n if (s === 0)\n return ch32(x, y, z);\n if (s === 1 || s === 3)\n return p32(x, y, z);\n if (s === 2)\n return maj32(x, y, z);\n }\n exports.ft_1 = ft_1;\n function ch32(x, y, z) {\n return x & y ^ ~x & z;\n }\n exports.ch32 = ch32;\n function maj32(x, y, z) {\n return x & y ^ x & z ^ y & z;\n }\n exports.maj32 = maj32;\n function p32(x, y, z) {\n return x ^ y ^ z;\n }\n exports.p32 = p32;\n function s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n }\n exports.s0_256 = s0_256;\n function s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n }\n exports.s1_256 = s1_256;\n function g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ x >>> 3;\n }\n exports.g0_256 = g0_256;\n function g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ x >>> 10;\n }\n exports.g1_256 = g1_256;\n }\n}), require__ = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/1.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), shaCommon = require_common2(), rotl32 = utils.rotl32, sum32 = utils.sum32, sum32_5 = utils.sum32_5, ft_1 = shaCommon.ft_1, BlockHash = common.BlockHash, sha1_K = [1518500249, 1859775393, 2400959708, 3395469782];\n function SHA1() {\n if (!(this instanceof SHA1))\n return new SHA1;\n BlockHash.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.W = new Array(80);\n }\n utils.inherits(SHA1, BlockHash), module.exports = SHA1, SHA1.blockSize = 512, SHA1.outSize = 160, SHA1.hmacStrength = 80, SHA1.padLength = 64, SHA1.prototype._update = function(msg, start) {\n for (var W = this.W, i = 0;i < 16; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i++)\n W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n var a = this.h[0], b = this.h[1], c = this.h[2], d = this.h[3], e = this.h[4];\n for (i = 0;i < W.length; i++) {\n var s = ~~(i / 20), t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n e = d, d = c, c = rotl32(b, 30), b = a, a = t;\n }\n this.h[0] = sum32(this.h[0], a), this.h[1] = sum32(this.h[1], b), this.h[2] = sum32(this.h[2], c), this.h[3] = sum32(this.h[3], d), this.h[4] = sum32(this.h[4], e);\n }, SHA1.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n }\n}), require__2 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/256.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), shaCommon = require_common2(), assert = require_minimalistic_assert(), sum32 = utils.sum32, sum32_4 = utils.sum32_4, sum32_5 = utils.sum32_5, ch32 = shaCommon.ch32, maj32 = shaCommon.maj32, s0_256 = shaCommon.s0_256, s1_256 = shaCommon.s1_256, g0_256 = shaCommon.g0_256, g1_256 = shaCommon.g1_256, BlockHash = common.BlockHash, sha256_K = [\n 1116352408,\n 1899447441,\n 3049323471,\n 3921009573,\n 961987163,\n 1508970993,\n 2453635748,\n 2870763221,\n 3624381080,\n 310598401,\n 607225278,\n 1426881987,\n 1925078388,\n 2162078206,\n 2614888103,\n 3248222580,\n 3835390401,\n 4022224774,\n 264347078,\n 604807628,\n 770255983,\n 1249150122,\n 1555081692,\n 1996064986,\n 2554220882,\n 2821834349,\n 2952996808,\n 3210313671,\n 3336571891,\n 3584528711,\n 113926993,\n 338241895,\n 666307205,\n 773529912,\n 1294757372,\n 1396182291,\n 1695183700,\n 1986661051,\n 2177026350,\n 2456956037,\n 2730485921,\n 2820302411,\n 3259730800,\n 3345764771,\n 3516065817,\n 3600352804,\n 4094571909,\n 275423344,\n 430227734,\n 506948616,\n 659060556,\n 883997877,\n 958139571,\n 1322822218,\n 1537002063,\n 1747873779,\n 1955562222,\n 2024104815,\n 2227730452,\n 2361852424,\n 2428436474,\n 2756734187,\n 3204031479,\n 3329325298\n ];\n function SHA256() {\n if (!(this instanceof SHA256))\n return new SHA256;\n BlockHash.call(this), this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], this.k = sha256_K, this.W = new Array(64);\n }\n utils.inherits(SHA256, BlockHash), module.exports = SHA256, SHA256.blockSize = 512, SHA256.outSize = 256, SHA256.hmacStrength = 192, SHA256.padLength = 64, SHA256.prototype._update = function(msg, start) {\n for (var W = this.W, i = 0;i < 16; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i++)\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n var a = this.h[0], b = this.h[1], c = this.h[2], d = this.h[3], e = this.h[4], f = this.h[5], g = this.h[6], h = this.h[7];\n for (assert(this.k.length === W.length), i = 0;i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]), T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g, g = f, f = e, e = sum32(d, T1), d = c, c = b, b = a, a = sum32(T1, T2);\n }\n this.h[0] = sum32(this.h[0], a), this.h[1] = sum32(this.h[1], b), this.h[2] = sum32(this.h[2], c), this.h[3] = sum32(this.h[3], d), this.h[4] = sum32(this.h[4], e), this.h[5] = sum32(this.h[5], f), this.h[6] = sum32(this.h[6], g), this.h[7] = sum32(this.h[7], h);\n }, SHA256.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n }\n}), require__3 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/224.js\"(exports, module) {\n var utils = require_utils4(), SHA256 = require__2();\n function SHA224() {\n if (!(this instanceof SHA224))\n return new SHA224;\n SHA256.call(this), this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428];\n }\n utils.inherits(SHA224, SHA256), module.exports = SHA224, SHA224.blockSize = 512, SHA224.outSize = 224, SHA224.hmacStrength = 192, SHA224.padLength = 64, SHA224.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h.slice(0, 7), \"big\") : utils.split32(this.h.slice(0, 7), \"big\");\n };\n }\n}), require__4 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/512.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), assert = require_minimalistic_assert(), rotr64_hi = utils.rotr64_hi, rotr64_lo = utils.rotr64_lo, shr64_hi = utils.shr64_hi, shr64_lo = utils.shr64_lo, sum64 = utils.sum64, sum64_hi = utils.sum64_hi, sum64_lo = utils.sum64_lo, sum64_4_hi = utils.sum64_4_hi, sum64_4_lo = utils.sum64_4_lo, sum64_5_hi = utils.sum64_5_hi, sum64_5_lo = utils.sum64_5_lo, BlockHash = common.BlockHash, sha512_K = [\n 1116352408,\n 3609767458,\n 1899447441,\n 602891725,\n 3049323471,\n 3964484399,\n 3921009573,\n 2173295548,\n 961987163,\n 4081628472,\n 1508970993,\n 3053834265,\n 2453635748,\n 2937671579,\n 2870763221,\n 3664609560,\n 3624381080,\n 2734883394,\n 310598401,\n 1164996542,\n 607225278,\n 1323610764,\n 1426881987,\n 3590304994,\n 1925078388,\n 4068182383,\n 2162078206,\n 991336113,\n 2614888103,\n 633803317,\n 3248222580,\n 3479774868,\n 3835390401,\n 2666613458,\n 4022224774,\n 944711139,\n 264347078,\n 2341262773,\n 604807628,\n 2007800933,\n 770255983,\n 1495990901,\n 1249150122,\n 1856431235,\n 1555081692,\n 3175218132,\n 1996064986,\n 2198950837,\n 2554220882,\n 3999719339,\n 2821834349,\n 766784016,\n 2952996808,\n 2566594879,\n 3210313671,\n 3203337956,\n 3336571891,\n 1034457026,\n 3584528711,\n 2466948901,\n 113926993,\n 3758326383,\n 338241895,\n 168717936,\n 666307205,\n 1188179964,\n 773529912,\n 1546045734,\n 1294757372,\n 1522805485,\n 1396182291,\n 2643833823,\n 1695183700,\n 2343527390,\n 1986661051,\n 1014477480,\n 2177026350,\n 1206759142,\n 2456956037,\n 344077627,\n 2730485921,\n 1290863460,\n 2820302411,\n 3158454273,\n 3259730800,\n 3505952657,\n 3345764771,\n 106217008,\n 3516065817,\n 3606008344,\n 3600352804,\n 1432725776,\n 4094571909,\n 1467031594,\n 275423344,\n 851169720,\n 430227734,\n 3100823752,\n 506948616,\n 1363258195,\n 659060556,\n 3750685593,\n 883997877,\n 3785050280,\n 958139571,\n 3318307427,\n 1322822218,\n 3812723403,\n 1537002063,\n 2003034995,\n 1747873779,\n 3602036899,\n 1955562222,\n 1575990012,\n 2024104815,\n 1125592928,\n 2227730452,\n 2716904306,\n 2361852424,\n 442776044,\n 2428436474,\n 593698344,\n 2756734187,\n 3733110249,\n 3204031479,\n 2999351573,\n 3329325298,\n 3815920427,\n 3391569614,\n 3928383900,\n 3515267271,\n 566280711,\n 3940187606,\n 3454069534,\n 4118630271,\n 4000239992,\n 116418474,\n 1914138554,\n 174292421,\n 2731055270,\n 289380356,\n 3203993006,\n 460393269,\n 320620315,\n 685471733,\n 587496836,\n 852142971,\n 1086792851,\n 1017036298,\n 365543100,\n 1126000580,\n 2618297676,\n 1288033470,\n 3409855158,\n 1501505948,\n 4234509866,\n 1607167915,\n 987167468,\n 1816402316,\n 1246189591\n ];\n function SHA512() {\n if (!(this instanceof SHA512))\n return new SHA512;\n BlockHash.call(this), this.h = [\n 1779033703,\n 4089235720,\n 3144134277,\n 2227873595,\n 1013904242,\n 4271175723,\n 2773480762,\n 1595750129,\n 1359893119,\n 2917565137,\n 2600822924,\n 725511199,\n 528734635,\n 4215389547,\n 1541459225,\n 327033209\n ], this.k = sha512_K, this.W = new Array(160);\n }\n utils.inherits(SHA512, BlockHash), module.exports = SHA512, SHA512.blockSize = 1024, SHA512.outSize = 512, SHA512.hmacStrength = 192, SHA512.padLength = 128, SHA512.prototype._prepareBlock = function(msg, start) {\n for (var W = this.W, i = 0;i < 32; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i += 2) {\n var c0_hi = g1_512_hi(W[i - 4], W[i - 3]), c0_lo = g1_512_lo(W[i - 4], W[i - 3]), c1_hi = W[i - 14], c1_lo = W[i - 13], c2_hi = g0_512_hi(W[i - 30], W[i - 29]), c2_lo = g0_512_lo(W[i - 30], W[i - 29]), c3_hi = W[i - 32], c3_lo = W[i - 31];\n W[i] = sum64_4_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo), W[i + 1] = sum64_4_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo);\n }\n }, SHA512.prototype._update = function(msg, start) {\n this._prepareBlock(msg, start);\n var W = this.W, ah = this.h[0], al = this.h[1], bh = this.h[2], bl = this.h[3], ch = this.h[4], cl = this.h[5], dh = this.h[6], dl = this.h[7], eh = this.h[8], el = this.h[9], fh = this.h[10], fl = this.h[11], gh = this.h[12], gl = this.h[13], hh = this.h[14], hl = this.h[15];\n assert(this.k.length === W.length);\n for (var i = 0;i < W.length; i += 2) {\n var c0_hi = hh, c0_lo = hl, c1_hi = s1_512_hi(eh, el), c1_lo = s1_512_lo(eh, el), c2_hi = ch64_hi(eh, el, fh, fl, gh, gl), c2_lo = ch64_lo(eh, el, fh, fl, gh, gl), c3_hi = this.k[i], c3_lo = this.k[i + 1], c4_hi = W[i], c4_lo = W[i + 1], T1_hi = sum64_5_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo), T1_lo = sum64_5_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo);\n c0_hi = s0_512_hi(ah, al), c0_lo = s0_512_lo(ah, al), c1_hi = maj64_hi(ah, al, bh, bl, ch, cl), c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo), T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n hh = gh, hl = gl, gh = fh, gl = fl, fh = eh, fl = el, eh = sum64_hi(dh, dl, T1_hi, T1_lo), el = sum64_lo(dl, dl, T1_hi, T1_lo), dh = ch, dl = cl, ch = bh, cl = bl, bh = ah, bl = al, ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo), al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n }\n sum64(this.h, 0, ah, al), sum64(this.h, 2, bh, bl), sum64(this.h, 4, ch, cl), sum64(this.h, 6, dh, dl), sum64(this.h, 8, eh, el), sum64(this.h, 10, fh, fl), sum64(this.h, 12, gh, gl), sum64(this.h, 14, hh, hl);\n }, SHA512.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n function ch64_hi(xh, xl, yh, yl, zh) {\n var r = xh & yh ^ ~xh & zh;\n return r < 0 && (r += 4294967296), r;\n }\n function ch64_lo(xh, xl, yh, yl, zh, zl) {\n var r = xl & yl ^ ~xl & zl;\n return r < 0 && (r += 4294967296), r;\n }\n function maj64_hi(xh, xl, yh, yl, zh) {\n var r = xh & yh ^ xh & zh ^ yh & zh;\n return r < 0 && (r += 4294967296), r;\n }\n function maj64_lo(xh, xl, yh, yl, zh, zl) {\n var r = xl & yl ^ xl & zl ^ yl & zl;\n return r < 0 && (r += 4294967296), r;\n }\n function s0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 28), c1_hi = rotr64_hi(xl, xh, 2), c2_hi = rotr64_hi(xl, xh, 7), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function s0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 28), c1_lo = rotr64_lo(xl, xh, 2), c2_lo = rotr64_lo(xl, xh, 7), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function s1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 14), c1_hi = rotr64_hi(xh, xl, 18), c2_hi = rotr64_hi(xl, xh, 9), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function s1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 14), c1_lo = rotr64_lo(xh, xl, 18), c2_lo = rotr64_lo(xl, xh, 9), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function g0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 1), c1_hi = rotr64_hi(xh, xl, 8), c2_hi = shr64_hi(xh, xl, 7), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function g0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 1), c1_lo = rotr64_lo(xh, xl, 8), c2_lo = shr64_lo(xh, xl, 7), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function g1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 19), c1_hi = rotr64_hi(xl, xh, 29), c2_hi = shr64_hi(xh, xl, 6), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function g1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 19), c1_lo = rotr64_lo(xl, xh, 29), c2_lo = shr64_lo(xh, xl, 6), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n }\n}), require__5 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/384.js\"(exports, module) {\n var utils = require_utils4(), SHA512 = require__4();\n function SHA384() {\n if (!(this instanceof SHA384))\n return new SHA384;\n SHA512.call(this), this.h = [\n 3418070365,\n 3238371032,\n 1654270250,\n 914150663,\n 2438529370,\n 812702999,\n 355462360,\n 4144912697,\n 1731405415,\n 4290775857,\n 2394180231,\n 1750603025,\n 3675008525,\n 1694076839,\n 1203062813,\n 3204075428\n ];\n }\n utils.inherits(SHA384, SHA512), module.exports = SHA384, SHA384.blockSize = 1024, SHA384.outSize = 384, SHA384.hmacStrength = 192, SHA384.padLength = 128, SHA384.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h.slice(0, 12), \"big\") : utils.split32(this.h.slice(0, 12), \"big\");\n };\n }\n}), require_sha3 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha.js\"(exports) {\n exports.sha1 = require__(), exports.sha224 = require__3(), exports.sha256 = require__2(), exports.sha384 = require__5(), exports.sha512 = require__4();\n }\n}), require_ripemd = __commonJS({\n \"node_modules/hash.js/lib/hash/ripemd.js\"(exports) {\n var utils = require_utils4(), common = require_common(), rotl32 = utils.rotl32, sum32 = utils.sum32, sum32_3 = utils.sum32_3, sum32_4 = utils.sum32_4, BlockHash = common.BlockHash;\n function RIPEMD160() {\n if (!(this instanceof RIPEMD160))\n return new RIPEMD160;\n BlockHash.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = \"little\";\n }\n utils.inherits(RIPEMD160, BlockHash), exports.ripemd160 = RIPEMD160, RIPEMD160.blockSize = 512, RIPEMD160.outSize = 160, RIPEMD160.hmacStrength = 192, RIPEMD160.padLength = 64, RIPEMD160.prototype._update = function(msg, start) {\n for (var A = this.h[0], B = this.h[1], C = this.h[2], D = this.h[3], E = this.h[4], Ah = A, Bh = B, Ch = C, Dh = D, Eh = E, j = 0;j < 80; j++) {\n var T = sum32(rotl32(sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), s[j]), E);\n A = E, E = D, D = rotl32(C, 10), C = B, B = T, T = sum32(rotl32(sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), sh[j]), Eh), Ah = Eh, Eh = Dh, Dh = rotl32(Ch, 10), Ch = Bh, Bh = T;\n }\n T = sum32_3(this.h[1], C, Dh), this.h[1] = sum32_3(this.h[2], D, Eh), this.h[2] = sum32_3(this.h[3], E, Ah), this.h[3] = sum32_3(this.h[4], A, Bh), this.h[4] = sum32_3(this.h[0], B, Ch), this.h[0] = T;\n }, RIPEMD160.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"little\") : utils.split32(this.h, \"little\");\n };\n function f(j, x, y, z) {\n return j <= 15 \? x ^ y ^ z : j <= 31 \? x & y | ~x & z : j <= 47 \? (x | ~y) ^ z : j <= 63 \? x & z | y & ~z : x ^ (y | ~z);\n }\n function K(j) {\n return j <= 15 \? 0 : j <= 31 \? 1518500249 : j <= 47 \? 1859775393 : j <= 63 \? 2400959708 : 2840853838;\n }\n function Kh(j) {\n return j <= 15 \? 1352829926 : j <= 31 \? 1548603684 : j <= 47 \? 1836072691 : j <= 63 \? 2053994217 : 0;\n }\n var r = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 7,\n 4,\n 13,\n 1,\n 10,\n 6,\n 15,\n 3,\n 12,\n 0,\n 9,\n 5,\n 2,\n 14,\n 11,\n 8,\n 3,\n 10,\n 14,\n 4,\n 9,\n 15,\n 8,\n 1,\n 2,\n 7,\n 0,\n 6,\n 13,\n 11,\n 5,\n 12,\n 1,\n 9,\n 11,\n 10,\n 0,\n 8,\n 12,\n 4,\n 13,\n 3,\n 7,\n 15,\n 14,\n 5,\n 6,\n 2,\n 4,\n 0,\n 5,\n 9,\n 7,\n 12,\n 2,\n 10,\n 14,\n 1,\n 3,\n 8,\n 11,\n 6,\n 15,\n 13\n ], rh = [\n 5,\n 14,\n 7,\n 0,\n 9,\n 2,\n 11,\n 4,\n 13,\n 6,\n 15,\n 8,\n 1,\n 10,\n 3,\n 12,\n 6,\n 11,\n 3,\n 7,\n 0,\n 13,\n 5,\n 10,\n 14,\n 15,\n 8,\n 12,\n 4,\n 9,\n 1,\n 2,\n 15,\n 5,\n 1,\n 3,\n 7,\n 14,\n 6,\n 9,\n 11,\n 8,\n 12,\n 2,\n 10,\n 0,\n 4,\n 13,\n 8,\n 6,\n 4,\n 1,\n 3,\n 11,\n 15,\n 0,\n 5,\n 12,\n 2,\n 13,\n 9,\n 7,\n 10,\n 14,\n 12,\n 15,\n 10,\n 4,\n 1,\n 5,\n 8,\n 7,\n 6,\n 2,\n 13,\n 14,\n 0,\n 3,\n 9,\n 11\n ], s = [\n 11,\n 14,\n 15,\n 12,\n 5,\n 8,\n 7,\n 9,\n 11,\n 13,\n 14,\n 15,\n 6,\n 7,\n 9,\n 8,\n 7,\n 6,\n 8,\n 13,\n 11,\n 9,\n 7,\n 15,\n 7,\n 12,\n 15,\n 9,\n 11,\n 7,\n 13,\n 12,\n 11,\n 13,\n 6,\n 7,\n 14,\n 9,\n 13,\n 15,\n 14,\n 8,\n 13,\n 6,\n 5,\n 12,\n 7,\n 5,\n 11,\n 12,\n 14,\n 15,\n 14,\n 15,\n 9,\n 8,\n 9,\n 14,\n 5,\n 6,\n 8,\n 6,\n 5,\n 12,\n 9,\n 15,\n 5,\n 11,\n 6,\n 8,\n 13,\n 12,\n 5,\n 12,\n 13,\n 14,\n 11,\n 8,\n 5,\n 6\n ], sh = [\n 8,\n 9,\n 9,\n 11,\n 13,\n 15,\n 15,\n 5,\n 7,\n 7,\n 8,\n 11,\n 14,\n 14,\n 12,\n 6,\n 9,\n 13,\n 15,\n 7,\n 12,\n 8,\n 9,\n 11,\n 7,\n 7,\n 12,\n 7,\n 6,\n 15,\n 13,\n 11,\n 9,\n 7,\n 15,\n 11,\n 8,\n 6,\n 6,\n 14,\n 12,\n 13,\n 5,\n 14,\n 13,\n 13,\n 7,\n 5,\n 15,\n 5,\n 8,\n 11,\n 14,\n 14,\n 6,\n 14,\n 6,\n 9,\n 12,\n 9,\n 12,\n 5,\n 15,\n 8,\n 8,\n 5,\n 12,\n 9,\n 12,\n 5,\n 14,\n 6,\n 8,\n 13,\n 6,\n 5,\n 15,\n 13,\n 11,\n 11\n ];\n }\n}), require_hmac = __commonJS({\n \"node_modules/hash.js/lib/hash/hmac.js\"(exports, module) {\n var utils = require_utils4(), assert = require_minimalistic_assert();\n function Hmac(hash, key, enc) {\n if (!(this instanceof Hmac))\n return new Hmac(hash, key, enc);\n this.Hash = hash, this.blockSize = hash.blockSize / 8, this.outSize = hash.outSize / 8, this.inner = null, this.outer = null, this._init(utils.toArray(key, enc));\n }\n Hmac.prototype = {}, module.exports = Hmac, Hmac.prototype._init = function(key) {\n key.length > this.blockSize && (key = new this.Hash().update(key).digest()), assert(key.length <= this.blockSize);\n for (var i = key.length;i < this.blockSize; i++)\n key.push(0);\n for (i = 0;i < key.length; i++)\n key[i] ^= 54;\n for (this.inner = new this.Hash().update(key), i = 0;i < key.length; i++)\n key[i] ^= 106;\n this.outer = new this.Hash().update(key);\n }, Hmac.prototype.update = function(msg, enc) {\n return this.inner.update(msg, enc), this;\n }, Hmac.prototype.digest = function(enc) {\n return this.outer.update(this.inner.digest()), this.outer.digest(enc);\n };\n }\n}), require_hash2 = __commonJS({\n \"node_modules/hash.js/lib/hash.js\"(exports) {\n var hash = exports;\n hash.utils = require_utils4(), hash.common = require_common(), hash.sha = require_sha3(), hash.ripemd = require_ripemd(), hash.hmac = require_hmac(), hash.sha1 = hash.sha.sha1, hash.sha256 = hash.sha.sha256, hash.sha224 = hash.sha.sha224, hash.sha384 = hash.sha.sha384, hash.sha512 = hash.sha.sha512, hash.ripemd160 = hash.ripemd.ripemd160;\n }\n}), require_secp256k1 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js\"(exports, module) {\n module.exports = {\n doubles: {\n step: 4,\n points: [\n [\n \"e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a\",\n \"f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821\"\n ],\n [\n \"8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508\",\n \"11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf\"\n ],\n [\n \"175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739\",\n \"d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695\"\n ],\n [\n \"363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640\",\n \"4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9\"\n ],\n [\n \"8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c\",\n \"4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36\"\n ],\n [\n \"723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda\",\n \"96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f\"\n ],\n [\n \"eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa\",\n \"5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999\"\n ],\n [\n \"100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0\",\n \"cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09\"\n ],\n [\n \"e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d\",\n \"9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d\"\n ],\n [\n \"feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d\",\n \"e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088\"\n ],\n [\n \"da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1\",\n \"9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d\"\n ],\n [\n \"53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0\",\n \"5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8\"\n ],\n [\n \"8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047\",\n \"10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a\"\n ],\n [\n \"385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862\",\n \"283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453\"\n ],\n [\n \"6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7\",\n \"7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160\"\n ],\n [\n \"3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd\",\n \"56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0\"\n ],\n [\n \"85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83\",\n \"7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6\"\n ],\n [\n \"948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a\",\n \"53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589\"\n ],\n [\n \"6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8\",\n \"bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17\"\n ],\n [\n \"e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d\",\n \"4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda\"\n ],\n [\n \"e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725\",\n \"7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd\"\n ],\n [\n \"213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754\",\n \"4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2\"\n ],\n [\n \"4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c\",\n \"17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6\"\n ],\n [\n \"fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6\",\n \"6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f\"\n ],\n [\n \"76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39\",\n \"c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01\"\n ],\n [\n \"c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891\",\n \"893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3\"\n ],\n [\n \"d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b\",\n \"febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f\"\n ],\n [\n \"b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03\",\n \"2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7\"\n ],\n [\n \"e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d\",\n \"eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78\"\n ],\n [\n \"a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070\",\n \"7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1\"\n ],\n [\n \"90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4\",\n \"e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150\"\n ],\n [\n \"8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da\",\n \"662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82\"\n ],\n [\n \"e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11\",\n \"1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc\"\n ],\n [\n \"8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e\",\n \"efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b\"\n ],\n [\n \"e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41\",\n \"2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51\"\n ],\n [\n \"b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef\",\n \"67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45\"\n ],\n [\n \"d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8\",\n \"db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120\"\n ],\n [\n \"324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d\",\n \"648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84\"\n ],\n [\n \"4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96\",\n \"35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d\"\n ],\n [\n \"9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd\",\n \"ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d\"\n ],\n [\n \"6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5\",\n \"9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8\"\n ],\n [\n \"a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266\",\n \"40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8\"\n ],\n [\n \"7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71\",\n \"34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac\"\n ],\n [\n \"928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac\",\n \"c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f\"\n ],\n [\n \"85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751\",\n \"1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962\"\n ],\n [\n \"ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e\",\n \"493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907\"\n ],\n [\n \"827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241\",\n \"c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec\"\n ],\n [\n \"eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3\",\n \"be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d\"\n ],\n [\n \"e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f\",\n \"4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414\"\n ],\n [\n \"1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19\",\n \"aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd\"\n ],\n [\n \"146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be\",\n \"b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0\"\n ],\n [\n \"fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9\",\n \"6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811\"\n ],\n [\n \"da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2\",\n \"8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1\"\n ],\n [\n \"a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13\",\n \"7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c\"\n ],\n [\n \"174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c\",\n \"ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73\"\n ],\n [\n \"959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba\",\n \"2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd\"\n ],\n [\n \"d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151\",\n \"e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405\"\n ],\n [\n \"64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073\",\n \"d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589\"\n ],\n [\n \"8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458\",\n \"38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e\"\n ],\n [\n \"13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b\",\n \"69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27\"\n ],\n [\n \"bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366\",\n \"d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1\"\n ],\n [\n \"8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa\",\n \"40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482\"\n ],\n [\n \"8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0\",\n \"620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945\"\n ],\n [\n \"dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787\",\n \"7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573\"\n ],\n [\n \"f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e\",\n \"ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82\"\n ]\n ]\n },\n naf: {\n wnd: 7,\n points: [\n [\n \"f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9\",\n \"388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672\"\n ],\n [\n \"2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4\",\n \"d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6\"\n ],\n [\n \"5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc\",\n \"6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da\"\n ],\n [\n \"acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe\",\n \"cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37\"\n ],\n [\n \"774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb\",\n \"d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b\"\n ],\n [\n \"f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8\",\n \"ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81\"\n ],\n [\n \"d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e\",\n \"581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58\"\n ],\n [\n \"defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34\",\n \"4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77\"\n ],\n [\n \"2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c\",\n \"85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a\"\n ],\n [\n \"352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5\",\n \"321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c\"\n ],\n [\n \"2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f\",\n \"2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67\"\n ],\n [\n \"9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714\",\n \"73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402\"\n ],\n [\n \"daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729\",\n \"a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55\"\n ],\n [\n \"c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db\",\n \"2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482\"\n ],\n [\n \"6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4\",\n \"e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82\"\n ],\n [\n \"1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5\",\n \"b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396\"\n ],\n [\n \"605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479\",\n \"2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49\"\n ],\n [\n \"62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d\",\n \"80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf\"\n ],\n [\n \"80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f\",\n \"1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a\"\n ],\n [\n \"7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb\",\n \"d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7\"\n ],\n [\n \"d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9\",\n \"eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933\"\n ],\n [\n \"49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963\",\n \"758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a\"\n ],\n [\n \"77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74\",\n \"958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6\"\n ],\n [\n \"f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530\",\n \"e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37\"\n ],\n [\n \"463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b\",\n \"5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e\"\n ],\n [\n \"f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247\",\n \"cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6\"\n ],\n [\n \"caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1\",\n \"cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476\"\n ],\n [\n \"2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120\",\n \"4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40\"\n ],\n [\n \"7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435\",\n \"91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61\"\n ],\n [\n \"754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18\",\n \"673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683\"\n ],\n [\n \"e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8\",\n \"59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5\"\n ],\n [\n \"186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb\",\n \"3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b\"\n ],\n [\n \"df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f\",\n \"55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417\"\n ],\n [\n \"5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143\",\n \"efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868\"\n ],\n [\n \"290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba\",\n \"e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a\"\n ],\n [\n \"af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45\",\n \"f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6\"\n ],\n [\n \"766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a\",\n \"744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996\"\n ],\n [\n \"59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e\",\n \"c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e\"\n ],\n [\n \"f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8\",\n \"e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d\"\n ],\n [\n \"7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c\",\n \"30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2\"\n ],\n [\n \"948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519\",\n \"e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e\"\n ],\n [\n \"7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab\",\n \"100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437\"\n ],\n [\n \"3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca\",\n \"ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311\"\n ],\n [\n \"d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf\",\n \"8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4\"\n ],\n [\n \"1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610\",\n \"68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575\"\n ],\n [\n \"733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4\",\n \"f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d\"\n ],\n [\n \"15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c\",\n \"d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d\"\n ],\n [\n \"a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940\",\n \"edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629\"\n ],\n [\n \"e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980\",\n \"a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06\"\n ],\n [\n \"311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3\",\n \"66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374\"\n ],\n [\n \"34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf\",\n \"9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee\"\n ],\n [\n \"f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63\",\n \"4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1\"\n ],\n [\n \"d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448\",\n \"fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b\"\n ],\n [\n \"32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf\",\n \"5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661\"\n ],\n [\n \"7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5\",\n \"8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6\"\n ],\n [\n \"ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6\",\n \"8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e\"\n ],\n [\n \"16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5\",\n \"5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d\"\n ],\n [\n \"eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99\",\n \"f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc\"\n ],\n [\n \"78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51\",\n \"f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4\"\n ],\n [\n \"494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5\",\n \"42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c\"\n ],\n [\n \"a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5\",\n \"204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b\"\n ],\n [\n \"c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997\",\n \"4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913\"\n ],\n [\n \"841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881\",\n \"73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154\"\n ],\n [\n \"5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5\",\n \"39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865\"\n ],\n [\n \"36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66\",\n \"d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc\"\n ],\n [\n \"336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726\",\n \"ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224\"\n ],\n [\n \"8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede\",\n \"6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e\"\n ],\n [\n \"1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94\",\n \"60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6\"\n ],\n [\n \"85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31\",\n \"3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511\"\n ],\n [\n \"29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51\",\n \"b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b\"\n ],\n [\n \"a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252\",\n \"ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2\"\n ],\n [\n \"4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5\",\n \"cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c\"\n ],\n [\n \"d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b\",\n \"6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3\"\n ],\n [\n \"ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4\",\n \"322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d\"\n ],\n [\n \"af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f\",\n \"6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700\"\n ],\n [\n \"e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889\",\n \"2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4\"\n ],\n [\n \"591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246\",\n \"b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196\"\n ],\n [\n \"11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984\",\n \"998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4\"\n ],\n [\n \"3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a\",\n \"b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257\"\n ],\n [\n \"cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030\",\n \"bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13\"\n ],\n [\n \"c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197\",\n \"6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096\"\n ],\n [\n \"c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593\",\n \"c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38\"\n ],\n [\n \"a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef\",\n \"21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f\"\n ],\n [\n \"347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38\",\n \"60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448\"\n ],\n [\n \"da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a\",\n \"49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a\"\n ],\n [\n \"c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111\",\n \"5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4\"\n ],\n [\n \"4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502\",\n \"7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437\"\n ],\n [\n \"3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea\",\n \"be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7\"\n ],\n [\n \"cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26\",\n \"8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d\"\n ],\n [\n \"b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986\",\n \"39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a\"\n ],\n [\n \"d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e\",\n \"62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54\"\n ],\n [\n \"48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4\",\n \"25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77\"\n ],\n [\n \"dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda\",\n \"ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517\"\n ],\n [\n \"6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859\",\n \"cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10\"\n ],\n [\n \"e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f\",\n \"f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125\"\n ],\n [\n \"eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c\",\n \"6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e\"\n ],\n [\n \"13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942\",\n \"fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1\"\n ],\n [\n \"ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a\",\n \"1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2\"\n ],\n [\n \"b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80\",\n \"5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423\"\n ],\n [\n \"ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d\",\n \"438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8\"\n ],\n [\n \"8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1\",\n \"cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758\"\n ],\n [\n \"52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63\",\n \"c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375\"\n ],\n [\n \"e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352\",\n \"6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d\"\n ],\n [\n \"7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193\",\n \"ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec\"\n ],\n [\n \"5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00\",\n \"9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0\"\n ],\n [\n \"32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58\",\n \"ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c\"\n ],\n [\n \"e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7\",\n \"d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4\"\n ],\n [\n \"8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8\",\n \"c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f\"\n ],\n [\n \"4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e\",\n \"67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649\"\n ],\n [\n \"3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d\",\n \"cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826\"\n ],\n [\n \"674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b\",\n \"299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5\"\n ],\n [\n \"d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f\",\n \"f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87\"\n ],\n [\n \"30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6\",\n \"462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b\"\n ],\n [\n \"be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297\",\n \"62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc\"\n ],\n [\n \"93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a\",\n \"7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c\"\n ],\n [\n \"b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c\",\n \"ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f\"\n ],\n [\n \"d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52\",\n \"4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a\"\n ],\n [\n \"d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb\",\n \"bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46\"\n ],\n [\n \"463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065\",\n \"bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f\"\n ],\n [\n \"7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917\",\n \"603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03\"\n ],\n [\n \"74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9\",\n \"cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08\"\n ],\n [\n \"30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3\",\n \"553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8\"\n ],\n [\n \"9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57\",\n \"712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373\"\n ],\n [\n \"176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66\",\n \"ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3\"\n ],\n [\n \"75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8\",\n \"9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8\"\n ],\n [\n \"809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721\",\n \"9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1\"\n ],\n [\n \"1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180\",\n \"4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9\"\n ]\n ]\n }\n };\n }\n}), require_curves = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curves.js\"(exports) {\n var curves = exports, hash = require_hash2(), curve = require_curve(), utils = require_utils3(), assert = utils.assert;\n function PresetCurve(options) {\n options.type === \"short\" \? this.curve = new curve.short(options) : options.type === \"edwards\" \? this.curve = new curve.edwards(options) : this.curve = new curve.mont(options), this.g = this.curve.g, this.n = this.curve.n, this.hash = options.hash, assert(this.g.validate(), \"Invalid curve\"), assert(this.g.mul(this.n).isInfinity(), \"Invalid curve, G*N != O\");\n }\n PresetCurve.prototype = {}, curves.PresetCurve = PresetCurve;\n function defineCurve(name, options) {\n Object.defineProperty(curves, name, {\n configurable: !0,\n enumerable: !0,\n get: function() {\n var curve2 = new PresetCurve(options);\n return Object.defineProperty(curves, name, {\n configurable: !0,\n enumerable: !0,\n value: curve2\n }), curve2;\n }\n });\n }\n defineCurve(\"p192\", {\n type: \"short\",\n prime: \"p192\",\n p: \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\",\n a: \"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc\",\n b: \"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1\",\n n: \"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012\",\n \"07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811\"\n ]\n }), defineCurve(\"p224\", {\n type: \"short\",\n prime: \"p224\",\n p: \"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\",\n a: \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe\",\n b: \"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4\",\n n: \"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21\",\n \"bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34\"\n ]\n }), defineCurve(\"p256\", {\n type: \"short\",\n prime: null,\n p: \"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff\",\n a: \"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc\",\n b: \"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b\",\n n: \"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296\",\n \"4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5\"\n ]\n }), defineCurve(\"p384\", {\n type: \"short\",\n prime: null,\n p: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff\",\n a: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc\",\n b: \"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef\",\n n: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973\",\n hash: hash.sha384,\n gRed: !1,\n g: [\n \"aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7\",\n \"3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f\"\n ]\n }), defineCurve(\"p521\", {\n type: \"short\",\n prime: null,\n p: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff\",\n a: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc\",\n b: \"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00\",\n n: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409\",\n hash: hash.sha512,\n gRed: !1,\n g: [\n \"000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66\",\n \"00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650\"\n ]\n }), defineCurve(\"curve25519\", {\n type: \"mont\",\n prime: \"p25519\",\n p: \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",\n a: \"76d06\",\n b: \"1\",\n n: \"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",\n hash: hash.sha256,\n gRed: !1,\n g: [\"9\"]\n }), defineCurve(\"ed25519\", {\n type: \"edwards\",\n prime: \"p25519\",\n p: \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",\n a: \"-1\",\n c: \"1\",\n d: \"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3\",\n n: \"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a\",\n \"6666666666666666666666666666666666666666666666666666666666666658\"\n ]\n });\n var pre;\n try {\n pre = require_secp256k1();\n } catch {\n pre = void 0;\n }\n defineCurve(\"secp256k1\", {\n type: \"short\",\n prime: \"k256\",\n p: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\",\n a: \"0\",\n b: \"7\",\n n: \"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141\",\n h: \"1\",\n hash: hash.sha256,\n beta: \"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\",\n lambda: \"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72\",\n basis: [\n {\n a: \"3086d221a7d46bcde86c90e49284eb15\",\n b: \"-e4437ed6010e88286f547fa90abfe4c3\"\n },\n {\n a: \"114ca50f7a8e2f3f657c1108d9d44cfd8\",\n b: \"3086d221a7d46bcde86c90e49284eb15\"\n }\n ],\n gRed: !1,\n g: [\n \"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\",\n \"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n pre\n ]\n });\n }\n}), require_hmac_drbg = __commonJS({\n \"node_modules/hmac-drbg/lib/hmac-drbg.js\"(exports, module) {\n var hash = require_hash2(), utils = require_utils2(), assert = require_minimalistic_assert();\n function HmacDRBG(options) {\n if (!(this instanceof HmacDRBG))\n return new HmacDRBG(options);\n this.hash = options.hash, this.predResist = !!options.predResist, this.outLen = this.hash.outSize, this.minEntropy = options.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null;\n var entropy = utils.toArray(options.entropy, options.entropyEnc || \"hex\"), nonce = utils.toArray(options.nonce, options.nonceEnc || \"hex\"), pers = utils.toArray(options.pers, options.persEnc || \"hex\");\n assert(entropy.length >= this.minEntropy / 8, \"Not enough entropy. Minimum is: \" + this.minEntropy + \" bits\"), this._init(entropy, nonce, pers);\n }\n HmacDRBG.prototype = {}, module.exports = HmacDRBG, HmacDRBG.prototype._init = function(entropy, nonce, pers) {\n var seed = entropy.concat(nonce).concat(pers);\n this.K = new Array(this.outLen / 8), this.V = new Array(this.outLen / 8);\n for (var i = 0;i < this.V.length; i++)\n this.K[i] = 0, this.V[i] = 1;\n this._update(seed), this._reseed = 1, this.reseedInterval = 281474976710656;\n }, HmacDRBG.prototype._hmac = function() {\n return new hash.hmac(this.hash, this.K);\n }, HmacDRBG.prototype._update = function(seed) {\n var kmac = this._hmac().update(this.V).update([0]);\n seed && (kmac = kmac.update(seed)), this.K = kmac.digest(), this.V = this._hmac().update(this.V).digest(), seed && (this.K = this._hmac().update(this.V).update([1]).update(seed).digest(), this.V = this._hmac().update(this.V).digest());\n }, HmacDRBG.prototype.reseed = function(entropy, entropyEnc, add, addEnc) {\n typeof entropyEnc != \"string\" && (addEnc = add, add = entropyEnc, entropyEnc = null), entropy = utils.toArray(entropy, entropyEnc), add = utils.toArray(add, addEnc), assert(entropy.length >= this.minEntropy / 8, \"Not enough entropy. Minimum is: \" + this.minEntropy + \" bits\"), this._update(entropy.concat(add || [])), this._reseed = 1;\n }, HmacDRBG.prototype.generate = function(len, enc, add, addEnc) {\n if (this._reseed > this.reseedInterval)\n throw new Error(\"Reseed is required\");\n typeof enc != \"string\" && (addEnc = add, add = enc, enc = null), add && (add = utils.toArray(add, addEnc || \"hex\"), this._update(add));\n for (var temp = [];temp.length < len; )\n this.V = this._hmac().update(this.V).digest(), temp = temp.concat(this.V);\n var res = temp.slice(0, len);\n return this._update(add), this._reseed++, utils.encode(res, enc);\n };\n }\n}), require_key = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/key.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert;\n function KeyPair(ec, options) {\n this.ec = ec, this.priv = null, this.pub = null, options.priv && this._importPrivate(options.priv, options.privEnc), options.pub && this._importPublic(options.pub, options.pubEnc);\n }\n KeyPair.prototype = {}, module.exports = KeyPair, KeyPair.fromPublic = function(ec, pub, enc) {\n return pub instanceof KeyPair \? pub : new KeyPair(ec, {\n pub,\n pubEnc: enc\n });\n }, KeyPair.fromPrivate = function(ec, priv, enc) {\n return priv instanceof KeyPair \? priv : new KeyPair(ec, {\n priv,\n privEnc: enc\n });\n }, KeyPair.prototype.validate = function() {\n var pub = this.getPublic();\n return pub.isInfinity() \? { result: !1, reason: \"Invalid public key\" } : pub.validate() \? pub.mul(this.ec.curve.n).isInfinity() \? { result: !0, reason: null } : { result: !1, reason: \"Public key * N != O\" } : { result: !1, reason: \"Public key is not a point\" };\n }, KeyPair.prototype.getPublic = function(compact, enc) {\n return typeof compact == \"string\" && (enc = compact, compact = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), enc \? this.pub.encode(enc, compact) : this.pub;\n }, KeyPair.prototype.getPrivate = function(enc) {\n return enc === \"hex\" \? this.priv.toString(16, 2) : this.priv;\n }, KeyPair.prototype._importPrivate = function(key, enc) {\n this.priv = new BN(key, enc || 16), this.priv = this.priv.umod(this.ec.curve.n);\n }, KeyPair.prototype._importPublic = function(key, enc) {\n if (key.x || key.y) {\n this.ec.curve.type === \"mont\" \? assert(key.x, \"Need x coordinate\") : (this.ec.curve.type === \"short\" || this.ec.curve.type === \"edwards\") && assert(key.x && key.y, \"Need both x and y coordinate\"), this.pub = this.ec.curve.point(key.x, key.y);\n return;\n }\n this.pub = this.ec.curve.decodePoint(key, enc);\n }, KeyPair.prototype.derive = function(pub) {\n return pub.validate() || assert(pub.validate(), \"public point not validated\"), pub.mul(this.priv).getX();\n }, KeyPair.prototype.sign = function(msg, enc, options) {\n return this.ec.sign(msg, this, enc, options);\n }, KeyPair.prototype.verify = function(msg, signature) {\n return this.ec.verify(msg, signature, this);\n }, KeyPair.prototype.inspect = function() {\n return \"<Key priv: \" + (this.priv && this.priv.toString(16, 2)) + \" pub: \" + (this.pub && this.pub.inspect()) + \" >\";\n };\n }\n}), require_signature = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/signature.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert;\n function Signature(options, enc) {\n if (options instanceof Signature)\n return options;\n this._importDER(options, enc) || (assert(options.r && options.s, \"Signature without r or s\"), this.r = new BN(options.r, 16), this.s = new BN(options.s, 16), options.recoveryParam === void 0 \? this.recoveryParam = null : this.recoveryParam = options.recoveryParam);\n }\n Signature.prototype = {}, module.exports = Signature;\n function Position() {\n this.place = 0;\n }\n function getLength(buf, p) {\n var initial = buf[p.place++];\n if (!(initial & 128))\n return initial;\n var octetLen = initial & 15;\n if (octetLen === 0 || octetLen > 4)\n return !1;\n for (var val = 0, i = 0, off = p.place;i < octetLen; i++, off++)\n val <<= 8, val |= buf[off], val >>>= 0;\n return val <= 127 \? !1 : (p.place = off, val);\n }\n function rmPadding(buf) {\n for (var i = 0, len = buf.length - 1;!buf[i] && !(buf[i + 1] & 128) && i < len; )\n i++;\n return i === 0 \? buf : buf.slice(i);\n }\n Signature.prototype._importDER = function(data, enc) {\n data = utils.toArray(data, enc);\n var p = new Position;\n if (data[p.place++] !== 48)\n return !1;\n var len = getLength(data, p);\n if (len === !1 || len + p.place !== data.length || data[p.place++] !== 2)\n return !1;\n var rlen = getLength(data, p);\n if (rlen === !1)\n return !1;\n var r = data.slice(p.place, rlen + p.place);\n if (p.place += rlen, data[p.place++] !== 2)\n return !1;\n var slen = getLength(data, p);\n if (slen === !1 || data.length !== slen + p.place)\n return !1;\n var s = data.slice(p.place, slen + p.place);\n if (r[0] === 0)\n if (r[1] & 128)\n r = r.slice(1);\n else\n return !1;\n if (s[0] === 0)\n if (s[1] & 128)\n s = s.slice(1);\n else\n return !1;\n return this.r = new BN(r), this.s = new BN(s), this.recoveryParam = null, !0;\n };\n function constructLength(arr, len) {\n if (len < 128) {\n arr.push(len);\n return;\n }\n var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n for (arr.push(octets | 128);--octets; )\n arr.push(len >>> (octets << 3) & 255);\n arr.push(len);\n }\n Signature.prototype.toDER = function(enc) {\n var r = this.r.toArray(), s = this.s.toArray();\n for (r[0] & 128 && (r = [0].concat(r)), s[0] & 128 && (s = [0].concat(s)), r = rmPadding(r), s = rmPadding(s);!s[0] && !(s[1] & 128); )\n s = s.slice(1);\n var arr = [2];\n constructLength(arr, r.length), arr = arr.concat(r), arr.push(2), constructLength(arr, s.length);\n var backHalf = arr.concat(s), res = [48];\n return constructLength(res, backHalf.length), res = res.concat(backHalf), utils.encode(res, enc);\n };\n }\n}), require_ec = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/index.js\"(exports, module) {\n var BN = require_bn4(), HmacDRBG = require_hmac_drbg(), utils = require_utils3(), curves = require_curves(), rand = require_brorand(), assert = utils.assert, KeyPair = require_key(), Signature = require_signature();\n function EC(options) {\n if (!(this instanceof EC))\n return new EC(options);\n typeof options == \"string\" && (assert(Object.prototype.hasOwnProperty.call(curves, options), \"Unknown curve \" + options), options = curves[options]), options instanceof curves.PresetCurve && (options = { curve: options }), this.curve = options.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = options.curve.g, this.g.precompute(options.curve.n.bitLength() + 1), this.hash = options.hash || options.curve.hash;\n }\n EC.prototype = {}, module.exports = EC, EC.prototype.keyPair = function(options) {\n return new KeyPair(this, options);\n }, EC.prototype.keyFromPrivate = function(priv, enc) {\n return KeyPair.fromPrivate(this, priv, enc);\n }, EC.prototype.keyFromPublic = function(pub, enc) {\n return KeyPair.fromPublic(this, pub, enc);\n }, EC.prototype.genKeyPair = function(options) {\n options || (options = {});\n for (var drbg = new HmacDRBG({\n hash: this.hash,\n pers: options.pers,\n persEnc: options.persEnc || \"utf8\",\n entropy: options.entropy || rand(this.hash.hmacStrength),\n entropyEnc: options.entropy && options.entropyEnc || \"utf8\",\n nonce: this.n.toArray()\n }), bytes = this.n.byteLength(), ns2 = this.n.sub(new BN(2));; ) {\n var priv = new BN(drbg.generate(bytes));\n if (!(priv.cmp(ns2) > 0))\n return priv.iaddn(1), this.keyFromPrivate(priv);\n }\n }, EC.prototype._truncateToN = function(msg, truncOnly) {\n var delta = msg.byteLength() * 8 - this.n.bitLength();\n return delta > 0 && (msg = msg.ushrn(delta)), !truncOnly && msg.cmp(this.n) >= 0 \? msg.sub(this.n) : msg;\n }, EC.prototype.sign = function(msg, key, enc, options) {\n typeof enc == \"object\" && (options = enc, enc = null), options || (options = {}), key = this.keyFromPrivate(key, enc), msg = this._truncateToN(new BN(msg, 16));\n for (var bytes = this.n.byteLength(), bkey = key.getPrivate().toArray(\"be\", bytes), nonce = msg.toArray(\"be\", bytes), drbg = new HmacDRBG({\n hash: this.hash,\n entropy: bkey,\n nonce,\n pers: options.pers,\n persEnc: options.persEnc || \"utf8\"\n }), ns1 = this.n.sub(new BN(1)), iter = 0;; iter++) {\n var k = options.k \? options.k(iter) : new BN(drbg.generate(this.n.byteLength()));\n if (k = this._truncateToN(k, !0), !(k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)) {\n var kp = this.g.mul(k);\n if (!kp.isInfinity()) {\n var kpX = kp.getX(), r = kpX.umod(this.n);\n if (r.cmpn(0) !== 0) {\n var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));\n if (s = s.umod(this.n), s.cmpn(0) !== 0) {\n var recoveryParam = (kp.getY().isOdd() \? 1 : 0) | (kpX.cmp(r) !== 0 \? 2 : 0);\n return options.canonical && s.cmp(this.nh) > 0 && (s = this.n.sub(s), recoveryParam ^= 1), new Signature({ r, s, recoveryParam });\n }\n }\n }\n }\n }\n }, EC.prototype.verify = function(msg, signature, key, enc) {\n msg = this._truncateToN(new BN(msg, 16)), key = this.keyFromPublic(key, enc), signature = new Signature(signature, \"hex\");\n var { r, s } = signature;\n if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0 || s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n return !1;\n var sinv = s.invm(this.n), u1 = sinv.mul(msg).umod(this.n), u2 = sinv.mul(r).umod(this.n), p;\n return this.curve._maxwellTrick \? (p = this.g.jmulAdd(u1, key.getPublic(), u2), p.isInfinity() \? !1 : p.eqXToP(r)) : (p = this.g.mulAdd(u1, key.getPublic(), u2), p.isInfinity() \? !1 : p.getX().umod(this.n).cmp(r) === 0);\n }, EC.prototype.recoverPubKey = function(msg, signature, j, enc) {\n assert((3 & j) === j, \"The recovery param is more than two bits\"), signature = new Signature(signature, enc);\n var n = this.n, e = new BN(msg), r = signature.r, s = signature.s, isYOdd = j & 1, isSecondKey = j >> 1;\n if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n throw new Error(\"Unable to find sencond key candinate\");\n isSecondKey \? r = this.curve.pointFromX(r.add(this.curve.n), isYOdd) : r = this.curve.pointFromX(r, isYOdd);\n var rInv = signature.r.invm(n), s1 = n.sub(e).mul(rInv).umod(n), s2 = s.mul(rInv).umod(n);\n return this.g.mulAdd(s1, r, s2);\n }, EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {\n if (signature = new Signature(signature, enc), signature.recoveryParam !== null)\n return signature.recoveryParam;\n for (var i = 0;i < 4; i++) {\n var Qprime;\n try {\n Qprime = this.recoverPubKey(e, signature, i);\n } catch {\n continue;\n }\n if (Qprime.eq(Q))\n return i;\n }\n throw new Error(\"Unable to find valid recovery factor\");\n };\n }\n}), require_key2 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/key.js\"(exports, module) {\n var utils = require_utils3(), assert = utils.assert, parseBytes = utils.parseBytes, cachedProperty = utils.cachedProperty;\n function KeyPair(eddsa, params) {\n this.eddsa = eddsa, this._secret = parseBytes(params.secret), eddsa.isPoint(params.pub) \? this._pub = params.pub : this._pubBytes = parseBytes(params.pub);\n }\n KeyPair.prototype = {}, KeyPair.fromPublic = function(eddsa, pub) {\n return pub instanceof KeyPair \? pub : new KeyPair(eddsa, { pub });\n }, KeyPair.fromSecret = function(eddsa, secret) {\n return secret instanceof KeyPair \? secret : new KeyPair(eddsa, { secret });\n }, KeyPair.prototype.secret = function() {\n return this._secret;\n }, cachedProperty(KeyPair, \"pubBytes\", function() {\n return this.eddsa.encodePoint(this.pub());\n }), cachedProperty(KeyPair, \"pub\", function() {\n return this._pubBytes \? this.eddsa.decodePoint(this._pubBytes) : this.eddsa.g.mul(this.priv());\n }), cachedProperty(KeyPair, \"privBytes\", function() {\n var eddsa = this.eddsa, hash = this.hash(), lastIx = eddsa.encodingLength - 1, a = hash.slice(0, eddsa.encodingLength);\n return a[0] &= 248, a[lastIx] &= 127, a[lastIx] |= 64, a;\n }), cachedProperty(KeyPair, \"priv\", function() {\n return this.eddsa.decodeInt(this.privBytes());\n }), cachedProperty(KeyPair, \"hash\", function() {\n return this.eddsa.hash().update(this.secret()).digest();\n }), cachedProperty(KeyPair, \"messagePrefix\", function() {\n return this.hash().slice(this.eddsa.encodingLength);\n }), KeyPair.prototype.sign = function(message) {\n return assert(this._secret, \"KeyPair can only verify\"), this.eddsa.sign(message, this);\n }, KeyPair.prototype.verify = function(message, sig) {\n return this.eddsa.verify(message, sig, this);\n }, KeyPair.prototype.getSecret = function(enc) {\n return assert(this._secret, \"KeyPair is public only\"), utils.encode(this.secret(), enc);\n }, KeyPair.prototype.getPublic = function(enc) {\n return utils.encode(this.pubBytes(), enc);\n }, module.exports = KeyPair;\n }\n}), require_signature2 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/signature.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert, cachedProperty = utils.cachedProperty, parseBytes = utils.parseBytes;\n function Signature(eddsa, sig) {\n this.eddsa = eddsa, typeof sig != \"object\" && (sig = parseBytes(sig)), Array.isArray(sig) && (sig = {\n R: sig.slice(0, eddsa.encodingLength),\n S: sig.slice(eddsa.encodingLength)\n }), assert(sig.R && sig.S, \"Signature without R or S\"), eddsa.isPoint(sig.R) && (this._R = sig.R), sig.S instanceof BN && (this._S = sig.S), this._Rencoded = Array.isArray(sig.R) \? sig.R : sig.Rencoded, this._Sencoded = Array.isArray(sig.S) \? sig.S : sig.Sencoded;\n }\n Signature.prototype = {}, cachedProperty(Signature, \"S\", function() {\n return this.eddsa.decodeInt(this.Sencoded());\n }), cachedProperty(Signature, \"R\", function() {\n return this.eddsa.decodePoint(this.Rencoded());\n }), cachedProperty(Signature, \"Rencoded\", function() {\n return this.eddsa.encodePoint(this.R());\n }), cachedProperty(Signature, \"Sencoded\", function() {\n return this.eddsa.encodeInt(this.S());\n }), Signature.prototype.toBytes = function() {\n return this.Rencoded().concat(this.Sencoded());\n }, Signature.prototype.toHex = function() {\n return utils.encode(this.toBytes(), \"hex\").toUpperCase();\n }, module.exports = Signature;\n }\n}), require_eddsa = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/index.js\"(exports, module) {\n var hash = require_hash2(), curves = require_curves(), utils = require_utils3(), assert = utils.assert, parseBytes = utils.parseBytes, KeyPair = require_key2(), Signature = require_signature2();\n function EDDSA(curve) {\n if (assert(curve === \"ed25519\", \"only tested with ed25519 so far\"), !(this instanceof EDDSA))\n return new EDDSA(curve);\n curve = curves[curve].curve, this.curve = curve, this.g = curve.g, this.g.precompute(curve.n.bitLength() + 1), this.pointClass = curve.point().constructor, this.encodingLength = Math.ceil(curve.n.bitLength() / 8), this.hash = hash.sha512;\n }\n EDDSA.prototype = {}, module.exports = EDDSA, EDDSA.prototype.sign = function(message, secret) {\n message = parseBytes(message);\n var key = this.keyFromSecret(secret), r = this.hashInt(key.messagePrefix(), message), R = this.g.mul(r), Rencoded = this.encodePoint(R), s_ = this.hashInt(Rencoded, key.pubBytes(), message).mul(key.priv()), S = r.add(s_).umod(this.curve.n);\n return this.makeSignature({ R, S, Rencoded });\n }, EDDSA.prototype.verify = function(message, sig, pub) {\n message = parseBytes(message), sig = this.makeSignature(sig);\n var key = this.keyFromPublic(pub), h = this.hashInt(sig.Rencoded(), key.pubBytes(), message), SG = this.g.mul(sig.S()), RplusAh = sig.R().add(key.pub().mul(h));\n return RplusAh.eq(SG);\n }, EDDSA.prototype.hashInt = function() {\n for (var hash2 = this.hash(), i = 0;i < arguments.length; i++)\n hash2.update(arguments[i]);\n return utils.intFromLE(hash2.digest()).umod(this.curve.n);\n }, EDDSA.prototype.keyFromPublic = function(pub) {\n return KeyPair.fromPublic(this, pub);\n }, EDDSA.prototype.keyFromSecret = function(secret) {\n return KeyPair.fromSecret(this, secret);\n }, EDDSA.prototype.makeSignature = function(sig) {\n return sig instanceof Signature \? sig : new Signature(this, sig);\n }, EDDSA.prototype.encodePoint = function(point) {\n var enc = point.getY().toArray(\"le\", this.encodingLength);\n return enc[this.encodingLength - 1] |= point.getX().isOdd() \? 128 : 0, enc;\n }, EDDSA.prototype.decodePoint = function(bytes) {\n bytes = utils.parseBytes(bytes);\n var lastIx = bytes.length - 1, normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & -129), xIsOdd = (bytes[lastIx] & 128) !== 0, y = utils.intFromLE(normed);\n return this.curve.pointFromY(y, xIsOdd);\n }, EDDSA.prototype.encodeInt = function(num) {\n return num.toArray(\"le\", this.encodingLength);\n }, EDDSA.prototype.decodeInt = function(bytes) {\n return utils.intFromLE(bytes);\n }, EDDSA.prototype.isPoint = function(val) {\n return val instanceof this.pointClass;\n };\n }\n}), require_elliptic = __commonJS({\n \"node_modules/elliptic/lib/elliptic.js\"(exports) {\n var elliptic = exports;\n elliptic.version = require_package().version, elliptic.utils = require_utils3(), elliptic.rand = require_brorand(), elliptic.curve = require_curve(), elliptic.curves = require_curves(), elliptic.ec = require_ec(), elliptic.eddsa = require_eddsa();\n }\n}), require_bn5 = require_bn, require_safer = __commonJS({\n \"node_modules/safer-buffer/safer.js\"(exports, module) {\n var buffer = BufferModule, Buffer2 = Buffer, safer = {}, key;\n for (key in buffer)\n !buffer.hasOwnProperty(key) || key === \"SlowBuffer\" || key === \"Buffer\" || (safer[key] = buffer[key]);\n var Safer = safer.Buffer = {};\n for (key in Buffer2)\n !Buffer2.hasOwnProperty(key) || key === \"allocUnsafe\" || key === \"allocUnsafeSlow\" || (Safer[key] = Buffer2[key]);\n if (safer.Buffer.prototype = Buffer2.prototype, (!Safer.from || Safer.from === Uint8Array.from) && (Safer.from = function(value, encodingOrOffset, length) {\n if (typeof value == \"number\")\n @throwTypeError('The \"value\" argument must not be of type number. Received type ' + typeof value);\n if (value && typeof value.length > \"u\")\n @throwTypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \" + typeof value);\n return Buffer2(value, encodingOrOffset, length);\n }), Safer.alloc || (Safer.alloc = function(size, fill, encoding) {\n if (typeof size != \"number\")\n @throwTypeError('The \"size\" argument must be of type number. Received type ' + typeof size);\n if (size < 0 || size >= 2 * (1 << 30))\n @throwRangeError('The value \"' + size + '\" is invalid for option \"size\"');\n var buf = Buffer2(size);\n return !fill || fill.length === 0 \? buf.fill(0) : typeof encoding == \"string\" \? buf.fill(fill, encoding) : buf.fill(fill), buf;\n }), !safer.kStringMaxLength)\n try {\n safer.kStringMaxLength = MAX_STRING_LENGTH;\n } catch {\n }\n safer.constants || (safer.constants = {\n MAX_LENGTH: safer.kMaxLength\n }, safer.kStringMaxLength && (safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength)), module.exports = safer;\n }\n}), require_reporter = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/reporter.js\"(exports) {\n var inherits = require_inherits_browser();\n function Reporter(options) {\n this._reporterState = {\n obj: null,\n path: [],\n options: options || {},\n errors: []\n };\n }\n Reporter.prototype = {}, exports.Reporter = Reporter, Reporter.prototype.isError = function(obj) {\n return obj instanceof ReporterError;\n }, Reporter.prototype.save = function() {\n let state = this._reporterState;\n return { obj: state.obj, pathLen: state.path.length };\n }, Reporter.prototype.restore = function(data) {\n let state = this._reporterState;\n state.obj = data.obj, state.path = state.path.slice(0, data.pathLen);\n }, Reporter.prototype.enterKey = function(key) {\n return this._reporterState.path.push(key);\n }, Reporter.prototype.exitKey = function(index) {\n let state = this._reporterState;\n state.path = state.path.slice(0, index - 1);\n }, Reporter.prototype.leaveKey = function(index, key, value) {\n let state = this._reporterState;\n this.exitKey(index), state.obj !== null && (state.obj[key] = value);\n }, Reporter.prototype.path = function() {\n return this._reporterState.path.join(\"/\");\n }, Reporter.prototype.enterObject = function() {\n let state = this._reporterState, prev = state.obj;\n return state.obj = {}, prev;\n }, Reporter.prototype.leaveObject = function(prev) {\n let state = this._reporterState, now = state.obj;\n return state.obj = prev, now;\n }, Reporter.prototype.error = function(msg) {\n let err, state = this._reporterState, inherited = msg instanceof ReporterError;\n if (inherited \? err = msg : err = new ReporterError(state.path.map(function(elem) {\n return \"[\" + JSON.stringify(elem) + \"]\";\n }).join(\"\"), msg.message || msg, msg.stack), !state.options.partial)\n throw err;\n return inherited || state.errors.push(err), err;\n }, Reporter.prototype.wrapResult = function(result) {\n let state = this._reporterState;\n return state.options.partial \? {\n result: this.isError(result) \? null : result,\n errors: state.errors\n } : result;\n };\n function ReporterError(path, msg) {\n this.path = path, this.rethrow(msg);\n }\n inherits(ReporterError, Error), ReporterError.prototype.rethrow = function(msg) {\n if (this.message = msg + \" at: \" + (this.path || \"(shallow)\"), Error.captureStackTrace && Error.captureStackTrace(this, ReporterError), !this.stack)\n try {\n throw new Error(this.message);\n } catch (e) {\n this.stack = e.stack;\n }\n return this;\n };\n }\n}), require_buffer = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/buffer.js\"(exports) {\n var inherits = require_inherits_browser(), Reporter = require_reporter().Reporter, Buffer2 = require_safer().Buffer;\n function DecoderBuffer(base, options) {\n if (Reporter.call(this, options), !Buffer2.isBuffer(base)) {\n this.error(\"Input not Buffer\");\n return;\n }\n this.base = base, this.offset = 0, this.length = base.length;\n }\n inherits(DecoderBuffer, Reporter), exports.DecoderBuffer = DecoderBuffer, DecoderBuffer.isDecoderBuffer = function(data) {\n return data instanceof DecoderBuffer \? !0 : typeof data == \"object\" && Buffer2.isBuffer(data.base) && data.constructor.name === \"DecoderBuffer\" && typeof data.offset == \"number\" && typeof data.length == \"number\" && typeof data.save == \"function\" && typeof data.restore == \"function\" && typeof data.isEmpty == \"function\" && typeof data.readUInt8 == \"function\" && typeof data.skip == \"function\" && typeof data.raw == \"function\";\n }, DecoderBuffer.prototype.save = function() {\n return {\n offset: this.offset,\n reporter: Reporter.prototype.save.call(this)\n };\n }, DecoderBuffer.prototype.restore = function(save) {\n let res = new DecoderBuffer(this.base);\n return res.offset = save.offset, res.length = this.offset, this.offset = save.offset, Reporter.prototype.restore.call(this, save.reporter), res;\n }, DecoderBuffer.prototype.isEmpty = function() {\n return this.offset === this.length;\n }, DecoderBuffer.prototype.readUInt8 = function(fail) {\n return this.offset + 1 <= this.length \? this.base.readUInt8(this.offset++, !0) : this.error(fail || \"DecoderBuffer overrun\");\n }, DecoderBuffer.prototype.skip = function(bytes, fail) {\n if (!(this.offset + bytes <= this.length))\n return this.error(fail || \"DecoderBuffer overrun\");\n let res = new DecoderBuffer(this.base);\n return res._reporterState = this._reporterState, res.offset = this.offset, res.length = this.offset + bytes, this.offset += bytes, res;\n }, DecoderBuffer.prototype.raw = function(save) {\n return this.base.slice(save \? save.offset : this.offset, this.length);\n };\n function EncoderBuffer(value, reporter) {\n if (Array.isArray(value))\n this.length = 0, this.value = value.map(function(item) {\n return EncoderBuffer.isEncoderBuffer(item) || (item = new EncoderBuffer(item, reporter)), this.length += item.length, item;\n }, this);\n else if (typeof value == \"number\") {\n if (!(0 <= value && value <= 255))\n return reporter.error(\"non-byte EncoderBuffer value\");\n this.value = value, this.length = 1;\n } else if (typeof value == \"string\")\n this.value = value, this.length = Buffer2.byteLength(value);\n else if (Buffer2.isBuffer(value))\n this.value = value, this.length = value.length;\n else\n return reporter.error(\"Unsupported type: \" + typeof value);\n }\n EncoderBuffer.prototype = {}, exports.EncoderBuffer = EncoderBuffer, EncoderBuffer.isEncoderBuffer = function(data) {\n return data instanceof EncoderBuffer \? !0 : typeof data == \"object\" && data.constructor.name === \"EncoderBuffer\" && typeof data.length == \"number\" && typeof data.join == \"function\";\n }, EncoderBuffer.prototype.join = function(out, offset) {\n return out || (out = Buffer2.alloc(this.length)), offset || (offset = 0), this.length === 0 || (Array.isArray(this.value) \? this.value.forEach(function(item) {\n item.join(out, offset), offset += item.length;\n }) : (typeof this.value == \"number\" \? out[offset] = this.value : typeof this.value == \"string\" \? out.write(this.value, offset) : Buffer2.isBuffer(this.value) && this.value.copy(out, offset), offset += this.length)), out;\n };\n }\n}), require_node = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/node.js\"(exports, module) {\n var Reporter = require_reporter().Reporter, EncoderBuffer = require_buffer().EncoderBuffer, DecoderBuffer = require_buffer().DecoderBuffer, assert = require_minimalistic_assert(), tags = [\n \"seq\",\n \"seqof\",\n \"set\",\n \"setof\",\n \"objid\",\n \"bool\",\n \"gentime\",\n \"utctime\",\n \"null_\",\n \"enum\",\n \"int\",\n \"objDesc\",\n \"bitstr\",\n \"bmpstr\",\n \"charstr\",\n \"genstr\",\n \"graphstr\",\n \"ia5str\",\n \"iso646str\",\n \"numstr\",\n \"octstr\",\n \"printstr\",\n \"t61str\",\n \"unistr\",\n \"utf8str\",\n \"videostr\"\n ], methods = [\"key\", \"obj\", \"use\", \"optional\", \"explicit\", \"implicit\", \"def\", \"choice\", \"any\", \"contains\"].concat(tags), overrided = [\n \"_peekTag\",\n \"_decodeTag\",\n \"_use\",\n \"_decodeStr\",\n \"_decodeObjid\",\n \"_decodeTime\",\n \"_decodeNull\",\n \"_decodeInt\",\n \"_decodeBool\",\n \"_decodeList\",\n \"_encodeComposite\",\n \"_encodeStr\",\n \"_encodeObjid\",\n \"_encodeTime\",\n \"_encodeNull\",\n \"_encodeInt\",\n \"_encodeBool\"\n ];\n function Node(enc, parent, name) {\n let state = {};\n this._baseState = state, state.name = name, state.enc = enc, state.parent = parent || null, state.children = null, state.tag = null, state.args = null, state.reverseArgs = null, state.choice = null, state.optional = !1, state.any = !1, state.obj = !1, state.use = null, state.useDecoder = null, state.key = null, state.default = null, state.explicit = null, state.implicit = null, state.contains = null, state.parent || (state.children = [], this._wrap());\n }\n Node.prototype = {}, module.exports = Node;\n var stateProps = [\n \"enc\",\n \"parent\",\n \"children\",\n \"tag\",\n \"args\",\n \"reverseArgs\",\n \"choice\",\n \"optional\",\n \"any\",\n \"obj\",\n \"use\",\n \"alteredUse\",\n \"key\",\n \"default\",\n \"explicit\",\n \"implicit\",\n \"contains\"\n ];\n Node.prototype.clone = function() {\n let state = this._baseState, cstate = {};\n stateProps.forEach(function(prop) {\n cstate[prop] = state[prop];\n });\n let res = new this.constructor(cstate.parent);\n return res._baseState = cstate, res;\n }, Node.prototype._wrap = function() {\n let state = this._baseState;\n methods.forEach(function(method) {\n this[method] = function() {\n let clone = new this.constructor(this);\n return state.children.push(clone), clone[method].apply(clone, arguments);\n };\n }, this);\n }, Node.prototype._init = function(body) {\n let state = this._baseState;\n assert(state.parent === null), body.call(this), state.children = state.children.filter(function(child) {\n return child._baseState.parent === this;\n }, this), assert.equal(state.children.length, 1, \"Root node can have only one child\");\n }, Node.prototype._useArgs = function(args) {\n let state = this._baseState, children = args.filter(function(arg) {\n return arg instanceof this.constructor;\n }, this);\n args = args.filter(function(arg) {\n return !(arg instanceof this.constructor);\n }, this), children.length !== 0 && (assert(state.children === null), state.children = children, children.forEach(function(child) {\n child._baseState.parent = this;\n }, this)), args.length !== 0 && (assert(state.args === null), state.args = args, state.reverseArgs = args.map(function(arg) {\n if (typeof arg != \"object\" || arg.constructor !== Object)\n return arg;\n let res = {};\n return Object.keys(arg).forEach(function(key) {\n key == (key | 0) && (key |= 0);\n let value = arg[key];\n res[value] = key;\n }), res;\n }));\n }, overrided.forEach(function(method) {\n Node.prototype[method] = function() {\n let state = this._baseState;\n throw new Error(method + \" not implemented for encoding: \" + state.enc);\n };\n }), tags.forEach(function(tag) {\n Node.prototype[tag] = function() {\n let state = this._baseState, args = Array.prototype.slice.call(arguments);\n return assert(state.tag === null), state.tag = tag, this._useArgs(args), this;\n };\n }), Node.prototype.use = function(item) {\n assert(item);\n let state = this._baseState;\n return assert(state.use === null), state.use = item, this;\n }, Node.prototype.optional = function() {\n let state = this._baseState;\n return state.optional = !0, this;\n }, Node.prototype.def = function(val) {\n let state = this._baseState;\n return assert(state.default === null), state.default = val, state.optional = !0, this;\n }, Node.prototype.explicit = function(num) {\n let state = this._baseState;\n return assert(state.explicit === null && state.implicit === null), state.explicit = num, this;\n }, Node.prototype.implicit = function(num) {\n let state = this._baseState;\n return assert(state.explicit === null && state.implicit === null), state.implicit = num, this;\n }, Node.prototype.obj = function() {\n let state = this._baseState, args = Array.prototype.slice.call(arguments);\n return state.obj = !0, args.length !== 0 && this._useArgs(args), this;\n }, Node.prototype.key = function(newKey) {\n let state = this._baseState;\n return assert(state.key === null), state.key = newKey, this;\n }, Node.prototype.any = function() {\n let state = this._baseState;\n return state.any = !0, this;\n }, Node.prototype.choice = function(obj) {\n let state = this._baseState;\n return assert(state.choice === null), state.choice = obj, this._useArgs(Object.keys(obj).map(function(key) {\n return obj[key];\n })), this;\n }, Node.prototype.contains = function(item) {\n let state = this._baseState;\n return assert(state.use === null), state.contains = item, this;\n }, Node.prototype._decode = function(input, options) {\n let state = this._baseState;\n if (state.parent === null)\n return input.wrapResult(state.children[0]._decode(input, options));\n let result = state.default, present = !0, prevKey = null;\n if (state.key !== null && (prevKey = input.enterKey(state.key)), state.optional) {\n let tag = null;\n if (state.explicit !== null \? tag = state.explicit : state.implicit !== null \? tag = state.implicit : state.tag !== null && (tag = state.tag), tag === null && !state.any) {\n let save = input.save();\n try {\n state.choice === null \? this._decodeGeneric(state.tag, input, options) : this._decodeChoice(input, options), present = !0;\n } catch {\n present = !1;\n }\n input.restore(save);\n } else if (present = this._peekTag(input, tag, state.any), input.isError(present))\n return present;\n }\n let prevObj;\n if (state.obj && present && (prevObj = input.enterObject()), present) {\n if (state.explicit !== null) {\n let explicit = this._decodeTag(input, state.explicit);\n if (input.isError(explicit))\n return explicit;\n input = explicit;\n }\n let start = input.offset;\n if (state.use === null && state.choice === null) {\n let save;\n state.any && (save = input.save());\n let body = this._decodeTag(input, state.implicit !== null \? state.implicit : state.tag, state.any);\n if (input.isError(body))\n return body;\n state.any \? result = input.raw(save) : input = body;\n }\n if (options && options.track && state.tag !== null && options.track(input.path(), start, input.length, \"tagged\"), options && options.track && state.tag !== null && options.track(input.path(), input.offset, input.length, \"content\"), state.any || (state.choice === null \? result = this._decodeGeneric(state.tag, input, options) : result = this._decodeChoice(input, options)), input.isError(result))\n return result;\n if (!state.any && state.choice === null && state.children !== null && state.children.forEach(function(child) {\n child._decode(input, options);\n }), state.contains && (state.tag === \"octstr\" || state.tag === \"bitstr\")) {\n let data = new DecoderBuffer(result);\n result = this._getUse(state.contains, input._reporterState.obj)._decode(data, options);\n }\n }\n return state.obj && present && (result = input.leaveObject(prevObj)), state.key !== null && (result !== null || present === !0) \? input.leaveKey(prevKey, state.key, result) : prevKey !== null && input.exitKey(prevKey), result;\n }, Node.prototype._decodeGeneric = function(tag, input, options) {\n let state = this._baseState;\n return tag === \"seq\" || tag === \"set\" \? null : tag === \"seqof\" || tag === \"setof\" \? this._decodeList(input, tag, state.args[0], options) : /str$/.test(tag) \? this._decodeStr(input, tag, options) : tag === \"objid\" && state.args \? this._decodeObjid(input, state.args[0], state.args[1], options) : tag === \"objid\" \? this._decodeObjid(input, null, null, options) : tag === \"gentime\" || tag === \"utctime\" \? this._decodeTime(input, tag, options) : tag === \"null_\" \? this._decodeNull(input, options) : tag === \"bool\" \? this._decodeBool(input, options) : tag === \"objDesc\" \? this._decodeStr(input, tag, options) : tag === \"int\" || tag === \"enum\" \? this._decodeInt(input, state.args && state.args[0], options) : state.use !== null \? this._getUse(state.use, input._reporterState.obj)._decode(input, options) : input.error(\"unknown tag: \" + tag);\n }, Node.prototype._getUse = function(entity, obj) {\n let state = this._baseState;\n return state.useDecoder = this._use(entity, obj), assert(state.useDecoder._baseState.parent === null), state.useDecoder = state.useDecoder._baseState.children[0], state.implicit !== state.useDecoder._baseState.implicit && (state.useDecoder = state.useDecoder.clone(), state.useDecoder._baseState.implicit = state.implicit), state.useDecoder;\n }, Node.prototype._decodeChoice = function(input, options) {\n let state = this._baseState, result = null, match = !1;\n return Object.keys(state.choice).some(function(key) {\n let save = input.save(), node = state.choice[key];\n try {\n let value = node._decode(input, options);\n if (input.isError(value))\n return !1;\n result = { type: key, value }, match = !0;\n } catch {\n return input.restore(save), !1;\n }\n return !0;\n }, this), match \? result : input.error(\"Choice not matched\");\n }, Node.prototype._createEncoderBuffer = function(data) {\n return new EncoderBuffer(data, this.reporter);\n }, Node.prototype._encode = function(data, reporter, parent) {\n let state = this._baseState;\n if (state.default !== null && state.default === data)\n return;\n let result = this._encodeValue(data, reporter, parent);\n if (result !== void 0 && !this._skipDefault(result, reporter, parent))\n return result;\n }, Node.prototype._encodeValue = function(data, reporter, parent) {\n let state = this._baseState;\n if (state.parent === null)\n return state.children[0]._encode(data, reporter || new Reporter);\n let result = null;\n if (this.reporter = reporter, state.optional && data === void 0)\n if (state.default !== null)\n data = state.default;\n else\n return;\n let content = null, primitive = !1;\n if (state.any)\n result = this._createEncoderBuffer(data);\n else if (state.choice)\n result = this._encodeChoice(data, reporter);\n else if (state.contains)\n content = this._getUse(state.contains, parent)._encode(data, reporter), primitive = !0;\n else if (state.children)\n content = state.children.map(function(child) {\n if (child._baseState.tag === \"null_\")\n return child._encode(null, reporter, data);\n if (child._baseState.key === null)\n return reporter.error(\"Child should have a key\");\n let prevKey = reporter.enterKey(child._baseState.key);\n if (typeof data != \"object\")\n return reporter.error(\"Child expected, but input is not object\");\n let res = child._encode(data[child._baseState.key], reporter, data);\n return reporter.leaveKey(prevKey), res;\n }, this).filter(function(child) {\n return child;\n }), content = this._createEncoderBuffer(content);\n else if (state.tag === \"seqof\" || state.tag === \"setof\") {\n if (!(state.args && state.args.length === 1))\n return reporter.error(\"Too many args for : \" + state.tag);\n if (!Array.isArray(data))\n return reporter.error(\"seqof/setof, but data is not Array\");\n let child = this.clone();\n child._baseState.implicit = null, content = this._createEncoderBuffer(data.map(function(item) {\n let state2 = this._baseState;\n return this._getUse(state2.args[0], data)._encode(item, reporter);\n }, child));\n } else\n state.use !== null \? result = this._getUse(state.use, parent)._encode(data, reporter) : (content = this._encodePrimitive(state.tag, data), primitive = !0);\n if (!state.any && state.choice === null) {\n let tag = state.implicit !== null \? state.implicit : state.tag, cls = state.implicit === null \? \"universal\" : \"context\";\n tag === null \? state.use === null && reporter.error(\"Tag could be omitted only for .use()\") : state.use === null && (result = this._encodeComposite(tag, primitive, cls, content));\n }\n return state.explicit !== null && (result = this._encodeComposite(state.explicit, !1, \"context\", result)), result;\n }, Node.prototype._encodeChoice = function(data, reporter) {\n let state = this._baseState, node = state.choice[data.type];\n return node || assert(!1, data.type + \" not found in \" + JSON.stringify(Object.keys(state.choice))), node._encode(data.value, reporter);\n }, Node.prototype._encodePrimitive = function(tag, data) {\n let state = this._baseState;\n if (/str$/.test(tag))\n return this._encodeStr(data, tag);\n if (tag === \"objid\" && state.args)\n return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);\n if (tag === \"objid\")\n return this._encodeObjid(data, null, null);\n if (tag === \"gentime\" || tag === \"utctime\")\n return this._encodeTime(data, tag);\n if (tag === \"null_\")\n return this._encodeNull();\n if (tag === \"int\" || tag === \"enum\")\n return this._encodeInt(data, state.args && state.reverseArgs[0]);\n if (tag === \"bool\")\n return this._encodeBool(data);\n if (tag === \"objDesc\")\n return this._encodeStr(data, tag);\n throw new Error(\"Unsupported tag: \" + tag);\n }, Node.prototype._isNumstr = function(str) {\n return /^[0-9 ]*$/.test(str);\n }, Node.prototype._isPrintstr = function(str) {\n return /^[A-Za-z0-9 '()+,-./:=\?]*$/.test(str);\n };\n }\n}), require_der = __commonJS({\n \"node_modules/asn1.js/lib/asn1/constants/der.js\"(exports) {\n function reverse(map) {\n let res = {};\n return Object.keys(map).forEach(function(key) {\n (key | 0) == key && (key = key | 0);\n let value = map[key];\n res[value] = key;\n }), res;\n }\n exports.tagClass = {\n 0: \"universal\",\n 1: \"application\",\n 2: \"context\",\n 3: \"private\"\n }, exports.tagClassByName = reverse(exports.tagClass), exports.tag = {\n 0: \"end\",\n 1: \"bool\",\n 2: \"int\",\n 3: \"bitstr\",\n 4: \"octstr\",\n 5: \"null_\",\n 6: \"objid\",\n 7: \"objDesc\",\n 8: \"external\",\n 9: \"real\",\n 10: \"enum\",\n 11: \"embed\",\n 12: \"utf8str\",\n 13: \"relativeOid\",\n 16: \"seq\",\n 17: \"set\",\n 18: \"numstr\",\n 19: \"printstr\",\n 20: \"t61str\",\n 21: \"videostr\",\n 22: \"ia5str\",\n 23: \"utctime\",\n 24: \"gentime\",\n 25: \"graphstr\",\n 26: \"iso646str\",\n 27: \"genstr\",\n 28: \"unistr\",\n 29: \"charstr\",\n 30: \"bmpstr\"\n }, exports.tagByName = reverse(exports.tag);\n }\n}), require_der2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/der.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safer().Buffer, Node = require_node(), der = require_der();\n function DEREncoder(entity) {\n this.enc = \"der\", this.name = entity.name, this.entity = entity, this.tree = new DERNode, this.tree._init(entity.body);\n }\n DEREncoder.prototype = {}, module.exports = DEREncoder, DEREncoder.prototype.encode = function(data, reporter) {\n return this.tree._encode(data, reporter).join();\n };\n function DERNode(parent) {\n Node.call(this, \"der\", parent);\n }\n inherits(DERNode, Node), DERNode.prototype._encodeComposite = function(tag, primitive, cls, content) {\n let encodedTag = encodeTag(tag, primitive, cls, this.reporter);\n if (content.length < 128) {\n let header2 = Buffer2.alloc(2);\n return header2[0] = encodedTag, header2[1] = content.length, this._createEncoderBuffer([header2, content]);\n }\n let lenOctets = 1;\n for (let i = content.length;i >= 256; i >>= 8)\n lenOctets++;\n let header = Buffer2.alloc(2 + lenOctets);\n header[0] = encodedTag, header[1] = 128 | lenOctets;\n for (let i = 1 + lenOctets, j = content.length;j > 0; i--, j >>= 8)\n header[i] = j & 255;\n return this._createEncoderBuffer([header, content]);\n }, DERNode.prototype._encodeStr = function(str, tag) {\n if (tag === \"bitstr\")\n return this._createEncoderBuffer([str.unused | 0, str.data]);\n if (tag === \"bmpstr\") {\n let buf = Buffer2.alloc(str.length * 2);\n for (let i = 0;i < str.length; i++)\n buf.writeUInt16BE(str.charCodeAt(i), i * 2);\n return this._createEncoderBuffer(buf);\n } else\n return tag === \"numstr\" \? this._isNumstr(str) \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: numstr supports only digits and space\") : tag === \"printstr\" \? this._isPrintstr(str) \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark\") : /str$/.test(tag) \? this._createEncoderBuffer(str) : tag === \"objDesc\" \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: \" + tag + \" unsupported\");\n }, DERNode.prototype._encodeObjid = function(id, values, relative) {\n if (typeof id == \"string\") {\n if (!values)\n return this.reporter.error(\"string objid given, but no values map found\");\n if (!values.hasOwnProperty(id))\n return this.reporter.error(\"objid not found in values map\");\n id = values[id].split(/[\\s.]+/g);\n for (let i = 0;i < id.length; i++)\n id[i] |= 0;\n } else if (Array.isArray(id)) {\n id = id.slice();\n for (let i = 0;i < id.length; i++)\n id[i] |= 0;\n }\n if (!Array.isArray(id))\n return this.reporter.error(\"objid() should be either array or string, got: \" + JSON.stringify(id));\n if (!relative) {\n if (id[1] >= 40)\n return this.reporter.error(\"Second objid identifier OOB\");\n id.splice(0, 2, id[0] * 40 + id[1]);\n }\n let size = 0;\n for (let i = 0;i < id.length; i++) {\n let ident = id[i];\n for (size++;ident >= 128; ident >>= 7)\n size++;\n }\n let objid = Buffer2.alloc(size), offset = objid.length - 1;\n for (let i = id.length - 1;i >= 0; i--) {\n let ident = id[i];\n for (objid[offset--] = ident & 127;(ident >>= 7) > 0; )\n objid[offset--] = 128 | ident & 127;\n }\n return this._createEncoderBuffer(objid);\n };\n function two(num) {\n return num < 10 \? \"0\" + num : num;\n }\n DERNode.prototype._encodeTime = function(time, tag) {\n let str, date = new Date(time);\n return tag === \"gentime\" \? str = [\n two(date.getUTCFullYear()),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n \"Z\"\n ].join(\"\") : tag === \"utctime\" \? str = [\n two(date.getUTCFullYear() % 100),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n \"Z\"\n ].join(\"\") : this.reporter.error(\"Encoding \" + tag + \" time is not supported yet\"), this._encodeStr(str, \"octstr\");\n }, DERNode.prototype._encodeNull = function() {\n return this._createEncoderBuffer(\"\");\n }, DERNode.prototype._encodeInt = function(num, values) {\n if (typeof num == \"string\") {\n if (!values)\n return this.reporter.error(\"String int or enum given, but no values map\");\n if (!values.hasOwnProperty(num))\n return this.reporter.error(\"Values map doesn't contain: \" + JSON.stringify(num));\n num = values[num];\n }\n if (typeof num != \"number\" && !Buffer2.isBuffer(num)) {\n let numArray = num.toArray();\n !num.sign && numArray[0] & 128 && numArray.unshift(0), num = Buffer2.from(numArray);\n }\n if (Buffer2.isBuffer(num)) {\n let size2 = num.length;\n num.length === 0 && size2++;\n let out2 = Buffer2.alloc(size2);\n return num.copy(out2), num.length === 0 && (out2[0] = 0), this._createEncoderBuffer(out2);\n }\n if (num < 128)\n return this._createEncoderBuffer(num);\n if (num < 256)\n return this._createEncoderBuffer([0, num]);\n let size = 1;\n for (let i = num;i >= 256; i >>= 8)\n size++;\n let out = new Array(size);\n for (let i = out.length - 1;i >= 0; i--)\n out[i] = num & 255, num >>= 8;\n return out[0] & 128 && out.unshift(0), this._createEncoderBuffer(Buffer2.from(out));\n }, DERNode.prototype._encodeBool = function(value) {\n return this._createEncoderBuffer(value \? 255 : 0);\n }, DERNode.prototype._use = function(entity, obj) {\n return typeof entity == \"function\" && (entity = entity(obj)), entity._getEncoder(\"der\").tree;\n }, DERNode.prototype._skipDefault = function(dataBuffer, reporter, parent) {\n let state = this._baseState, i;\n if (state.default === null)\n return !1;\n let data = dataBuffer.join();\n if (state.defaultBuffer === void 0 && (state.defaultBuffer = this._encodeValue(state.default, reporter, parent).join()), data.length !== state.defaultBuffer.length)\n return !1;\n for (i = 0;i < data.length; i++)\n if (data[i] !== state.defaultBuffer[i])\n return !1;\n return !0;\n };\n function encodeTag(tag, primitive, cls, reporter) {\n let res;\n if (tag === \"seqof\" \? tag = \"seq\" : tag === \"setof\" && (tag = \"set\"), der.tagByName.hasOwnProperty(tag))\n res = der.tagByName[tag];\n else if (typeof tag == \"number\" && (tag | 0) === tag)\n res = tag;\n else\n return reporter.error(\"Unknown tag: \" + tag);\n return res >= 31 \? reporter.error(\"Multi-octet tag encoding unsupported\") : (primitive || (res |= 32), res |= der.tagClassByName[cls || \"universal\"] << 6, res);\n }\n }\n}), require_pem = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/pem.js\"(exports, module) {\n var inherits = require_inherits_browser(), DEREncoder = require_der2();\n function PEMEncoder(entity) {\n DEREncoder.call(this, entity), this.enc = \"pem\";\n }\n inherits(PEMEncoder, DEREncoder), module.exports = PEMEncoder, PEMEncoder.prototype.encode = function(data, options) {\n let p = DEREncoder.prototype.encode.call(this, data).toString(\"base64\"), out = [\"-----BEGIN \" + options.label + \"-----\"];\n for (let i = 0;i < p.length; i += 64)\n out.push(p.slice(i, i + 64));\n return out.push(\"-----END \" + options.label + \"-----\"), out.join(`\n`);\n };\n }\n}), require_encoders = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/index.js\"(exports) {\n var encoders = exports;\n encoders.der = require_der2(), encoders.pem = require_pem();\n }\n}), require_der3 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/der.js\"(exports, module) {\n var inherits = require_inherits_browser(), bignum = require_bn5(), DecoderBuffer = require_buffer().DecoderBuffer, Node = require_node(), der = require_der();\n function DERDecoder(entity) {\n this.enc = \"der\", this.name = entity.name, this.entity = entity, this.tree = new DERNode, this.tree._init(entity.body);\n }\n DERDecoder.prototype = {}, module.exports = DERDecoder, DERDecoder.prototype.decode = function(data, options) {\n return DecoderBuffer.isDecoderBuffer(data) || (data = new DecoderBuffer(data, options)), this.tree._decode(data, options);\n };\n function DERNode(parent) {\n Node.call(this, \"der\", parent);\n }\n inherits(DERNode, Node), DERNode.prototype._peekTag = function(buffer, tag, any) {\n if (buffer.isEmpty())\n return !1;\n let state = buffer.save(), decodedTag = derDecodeTag(buffer, 'Failed to peek tag: \"' + tag + '\"');\n return buffer.isError(decodedTag) \? decodedTag : (buffer.restore(state), decodedTag.tag === tag || decodedTag.tagStr === tag || decodedTag.tagStr + \"of\" === tag || any);\n }, DERNode.prototype._decodeTag = function(buffer, tag, any) {\n let decodedTag = derDecodeTag(buffer, 'Failed to decode tag of \"' + tag + '\"');\n if (buffer.isError(decodedTag))\n return decodedTag;\n let len = derDecodeLen(buffer, decodedTag.primitive, 'Failed to get length of \"' + tag + '\"');\n if (buffer.isError(len))\n return len;\n if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + \"of\" !== tag)\n return buffer.error('Failed to match tag: \"' + tag + '\"');\n if (decodedTag.primitive || len !== null)\n return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n let state = buffer.save(), res = this._skipUntilEnd(buffer, 'Failed to skip indefinite length body: \"' + this.tag + '\"');\n return buffer.isError(res) \? res : (len = buffer.offset - state.offset, buffer.restore(state), buffer.skip(len, 'Failed to match body of: \"' + tag + '\"'));\n }, DERNode.prototype._skipUntilEnd = function(buffer, fail) {\n for (;; ) {\n let tag = derDecodeTag(buffer, fail);\n if (buffer.isError(tag))\n return tag;\n let len = derDecodeLen(buffer, tag.primitive, fail);\n if (buffer.isError(len))\n return len;\n let res;\n if (tag.primitive || len !== null \? res = buffer.skip(len) : res = this._skipUntilEnd(buffer, fail), buffer.isError(res))\n return res;\n if (tag.tagStr === \"end\")\n break;\n }\n }, DERNode.prototype._decodeList = function(buffer, tag, decoder, options) {\n let result = [];\n for (;!buffer.isEmpty(); ) {\n let possibleEnd = this._peekTag(buffer, \"end\");\n if (buffer.isError(possibleEnd))\n return possibleEnd;\n let res = decoder.decode(buffer, \"der\", options);\n if (buffer.isError(res) && possibleEnd)\n break;\n result.push(res);\n }\n return result;\n }, DERNode.prototype._decodeStr = function(buffer, tag) {\n if (tag === \"bitstr\") {\n let unused = buffer.readUInt8();\n return buffer.isError(unused) \? unused : { unused, data: buffer.raw() };\n } else if (tag === \"bmpstr\") {\n let raw = buffer.raw();\n if (raw.length % 2 === 1)\n return buffer.error(\"Decoding of string type: bmpstr length mismatch\");\n let str = \"\";\n for (let i = 0;i < raw.length / 2; i++)\n str += String.fromCharCode(raw.readUInt16BE(i * 2));\n return str;\n } else if (tag === \"numstr\") {\n let numstr = buffer.raw().toString(\"ascii\");\n return this._isNumstr(numstr) \? numstr : buffer.error(\"Decoding of string type: numstr unsupported characters\");\n } else {\n if (tag === \"octstr\")\n return buffer.raw();\n if (tag === \"objDesc\")\n return buffer.raw();\n if (tag === \"printstr\") {\n let printstr = buffer.raw().toString(\"ascii\");\n return this._isPrintstr(printstr) \? printstr : buffer.error(\"Decoding of string type: printstr unsupported characters\");\n } else\n return /str$/.test(tag) \? buffer.raw().toString() : buffer.error(\"Decoding of string type: \" + tag + \" unsupported\");\n }\n }, DERNode.prototype._decodeObjid = function(buffer, values, relative) {\n let result, identifiers = [], ident = 0, subident = 0;\n for (;!buffer.isEmpty(); )\n subident = buffer.readUInt8(), ident <<= 7, ident |= subident & 127, (subident & 128) === 0 && (identifiers.push(ident), ident = 0);\n subident & 128 && identifiers.push(ident);\n let first = identifiers[0] / 40 | 0, second = identifiers[0] % 40;\n if (relative \? result = identifiers : result = [first, second].concat(identifiers.slice(1)), values) {\n let tmp = values[result.join(\" \")];\n tmp === void 0 && (tmp = values[result.join(\".\")]), tmp !== void 0 && (result = tmp);\n }\n return result;\n }, DERNode.prototype._decodeTime = function(buffer, tag) {\n let str = buffer.raw().toString(), year, mon, day, hour, min, sec;\n if (tag === \"gentime\")\n year = str.slice(0, 4) | 0, mon = str.slice(4, 6) | 0, day = str.slice(6, 8) | 0, hour = str.slice(8, 10) | 0, min = str.slice(10, 12) | 0, sec = str.slice(12, 14) | 0;\n else if (tag === \"utctime\")\n year = str.slice(0, 2) | 0, mon = str.slice(2, 4) | 0, day = str.slice(4, 6) | 0, hour = str.slice(6, 8) | 0, min = str.slice(8, 10) | 0, sec = str.slice(10, 12) | 0, year < 70 \? year = 2000 + year : year = 1900 + year;\n else\n return buffer.error(\"Decoding \" + tag + \" time is not supported yet\");\n return Date.UTC(year, mon - 1, day, hour, min, sec, 0);\n }, DERNode.prototype._decodeNull = function() {\n return null;\n }, DERNode.prototype._decodeBool = function(buffer) {\n let res = buffer.readUInt8();\n return buffer.isError(res) \? res : res !== 0;\n }, DERNode.prototype._decodeInt = function(buffer, values) {\n let raw = buffer.raw(), res = new bignum(raw);\n return values && (res = values[res.toString(10)] || res), res;\n }, DERNode.prototype._use = function(entity, obj) {\n return typeof entity == \"function\" && (entity = entity(obj)), entity._getDecoder(\"der\").tree;\n };\n function derDecodeTag(buf, fail) {\n let tag = buf.readUInt8(fail);\n if (buf.isError(tag))\n return tag;\n let cls = der.tagClass[tag >> 6], primitive = (tag & 32) === 0;\n if ((tag & 31) === 31) {\n let oct = tag;\n for (tag = 0;(oct & 128) === 128; ) {\n if (oct = buf.readUInt8(fail), buf.isError(oct))\n return oct;\n tag <<= 7, tag |= oct & 127;\n }\n } else\n tag &= 31;\n let tagStr = der.tag[tag];\n return {\n cls,\n primitive,\n tag,\n tagStr\n };\n }\n function derDecodeLen(buf, primitive, fail) {\n let len = buf.readUInt8(fail);\n if (buf.isError(len))\n return len;\n if (!primitive && len === 128)\n return null;\n if ((len & 128) === 0)\n return len;\n let num = len & 127;\n if (num > 4)\n return buf.error(\"length octect is too long\");\n len = 0;\n for (let i = 0;i < num; i++) {\n len <<= 8;\n let j = buf.readUInt8(fail);\n if (buf.isError(j))\n return j;\n len |= j;\n }\n return len;\n }\n }\n}), require_pem2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/pem.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safer().Buffer, DERDecoder = require_der3();\n function PEMDecoder(entity) {\n DERDecoder.call(this, entity), this.enc = \"pem\";\n }\n inherits(PEMDecoder, DERDecoder), module.exports = PEMDecoder, PEMDecoder.prototype.decode = function(data, options) {\n let lines = data.toString().split(/[\\r\\n]+/g), label = options.label.toUpperCase(), re = /^-----(BEGIN|END) ([^-]+)-----$/, start = -1, end = -1;\n for (let i = 0;i < lines.length; i++) {\n let match = lines[i].match(re);\n if (match !== null && match[2] === label)\n if (start === -1) {\n if (match[1] !== \"BEGIN\")\n break;\n start = i;\n } else {\n if (match[1] !== \"END\")\n break;\n end = i;\n break;\n }\n }\n if (start === -1 || end === -1)\n throw new Error(\"PEM section not found for: \" + label);\n let base64 = lines.slice(start + 1, end).join(\"\");\n base64.replace(/[^a-z0-9+/=]+/gi, \"\");\n let input = Buffer2.from(base64, \"base64\");\n return DERDecoder.prototype.decode.call(this, input, options);\n };\n }\n}), require_decoders = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/index.js\"(exports) {\n var decoders = exports;\n decoders.der = require_der3(), decoders.pem = require_pem2();\n }\n}), require_api = __commonJS({\n \"node_modules/asn1.js/lib/asn1/api.js\"(exports) {\n var encoders = require_encoders(), decoders = require_decoders(), inherits = require_inherits_browser(), api = exports;\n api.define = function(name, body) {\n return new Entity(name, body);\n };\n function Entity(name, body) {\n this.name = name, this.body = body, this.decoders = {}, this.encoders = {};\n }\n Entity.prototype = {}, Entity.prototype._createNamed = function(Base) {\n let name = this.name;\n function Generated(entity) {\n this._initNamed(entity, name);\n }\n return inherits(Generated, Base), Generated.prototype._initNamed = function(entity, name2) {\n Base.call(this, entity, name2);\n }, new Generated(this);\n }, Entity.prototype._getDecoder = function(enc) {\n return enc = enc || \"der\", this.decoders.hasOwnProperty(enc) || (this.decoders[enc] = this._createNamed(decoders[enc])), this.decoders[enc];\n }, Entity.prototype.decode = function(data, enc, options) {\n return this._getDecoder(enc).decode(data, options);\n }, Entity.prototype._getEncoder = function(enc) {\n return enc = enc || \"der\", this.encoders.hasOwnProperty(enc) || (this.encoders[enc] = this._createNamed(encoders[enc])), this.encoders[enc];\n }, Entity.prototype.encode = function(data, enc, reporter) {\n return this._getEncoder(enc).encode(data, reporter);\n };\n }\n}), require_base2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/index.js\"(exports) {\n var base = exports;\n base.Reporter = require_reporter().Reporter, base.DecoderBuffer = require_buffer().DecoderBuffer, base.EncoderBuffer = require_buffer().EncoderBuffer, base.Node = require_node();\n }\n}), require_constants = __commonJS({\n \"node_modules/asn1.js/lib/asn1/constants/index.js\"(exports) {\n var constants = exports;\n constants._reverse = function(map) {\n let res = {};\n return Object.keys(map).forEach(function(key) {\n (key | 0) == key && (key = key | 0);\n let value = map[key];\n res[value] = key;\n }), res;\n }, constants.der = require_der();\n }\n}), require_asn1 = __commonJS({\n \"node_modules/asn1.js/lib/asn1.js\"(exports) {\n var asn1 = exports;\n asn1.bignum = require_bn5(), asn1.define = require_api().define, asn1.base = require_base2(), asn1.constants = require_constants(), asn1.decoders = require_decoders(), asn1.encoders = require_encoders();\n }\n}), require_certificate = __commonJS({\n \"node_modules/parse-asn1/certificate.js\"(exports, module) {\n var asn = require_asn1(), Time = asn.define(\"Time\", function() {\n this.choice({\n utcTime: this.utctime(),\n generalTime: this.gentime()\n });\n }), AttributeTypeValue = asn.define(\"AttributeTypeValue\", function() {\n this.seq().obj(this.key(\"type\").objid(), this.key(\"value\").any());\n }), AlgorithmIdentifier = asn.define(\"AlgorithmIdentifier\", function() {\n this.seq().obj(this.key(\"algorithm\").objid(), this.key(\"parameters\").optional(), this.key(\"curve\").objid().optional());\n }), SubjectPublicKeyInfo = asn.define(\"SubjectPublicKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPublicKey\").bitstr());\n }), RelativeDistinguishedName = asn.define(\"RelativeDistinguishedName\", function() {\n this.setof(AttributeTypeValue);\n }), RDNSequence = asn.define(\"RDNSequence\", function() {\n this.seqof(RelativeDistinguishedName);\n }), Name = asn.define(\"Name\", function() {\n this.choice({\n rdnSequence: this.use(RDNSequence)\n });\n }), Validity = asn.define(\"Validity\", function() {\n this.seq().obj(this.key(\"notBefore\").use(Time), this.key(\"notAfter\").use(Time));\n }), Extension = asn.define(\"Extension\", function() {\n this.seq().obj(this.key(\"extnID\").objid(), this.key(\"critical\").bool().def(!1), this.key(\"extnValue\").octstr());\n }), TBSCertificate = asn.define(\"TBSCertificate\", function() {\n this.seq().obj(this.key(\"version\").explicit(0).int().optional(), this.key(\"serialNumber\").int(), this.key(\"signature\").use(AlgorithmIdentifier), this.key(\"issuer\").use(Name), this.key(\"validity\").use(Validity), this.key(\"subject\").use(Name), this.key(\"subjectPublicKeyInfo\").use(SubjectPublicKeyInfo), this.key(\"issuerUniqueID\").implicit(1).bitstr().optional(), this.key(\"subjectUniqueID\").implicit(2).bitstr().optional(), this.key(\"extensions\").explicit(3).seqof(Extension).optional());\n }), X509Certificate = asn.define(\"X509Certificate\", function() {\n this.seq().obj(this.key(\"tbsCertificate\").use(TBSCertificate), this.key(\"signatureAlgorithm\").use(AlgorithmIdentifier), this.key(\"signatureValue\").bitstr());\n });\n module.exports = X509Certificate;\n }\n}), require_asn12 = __commonJS({\n \"node_modules/parse-asn1/asn1.js\"(exports) {\n var asn1 = require_asn1();\n exports.certificate = require_certificate();\n var RSAPrivateKey = asn1.define(\"RSAPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"modulus\").int(), this.key(\"publicExponent\").int(), this.key(\"privateExponent\").int(), this.key(\"prime1\").int(), this.key(\"prime2\").int(), this.key(\"exponent1\").int(), this.key(\"exponent2\").int(), this.key(\"coefficient\").int());\n });\n exports.RSAPrivateKey = RSAPrivateKey;\n var RSAPublicKey = asn1.define(\"RSAPublicKey\", function() {\n this.seq().obj(this.key(\"modulus\").int(), this.key(\"publicExponent\").int());\n });\n exports.RSAPublicKey = RSAPublicKey;\n var PublicKey = asn1.define(\"SubjectPublicKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPublicKey\").bitstr());\n });\n exports.PublicKey = PublicKey;\n var AlgorithmIdentifier = asn1.define(\"AlgorithmIdentifier\", function() {\n this.seq().obj(this.key(\"algorithm\").objid(), this.key(\"none\").null_().optional(), this.key(\"curve\").objid().optional(), this.key(\"params\").seq().obj(this.key(\"p\").int(), this.key(\"q\").int(), this.key(\"g\").int()).optional());\n }), PrivateKeyInfo = asn1.define(\"PrivateKeyInfo\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPrivateKey\").octstr());\n });\n exports.PrivateKey = PrivateKeyInfo;\n var EncryptedPrivateKeyInfo = asn1.define(\"EncryptedPrivateKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").seq().obj(this.key(\"id\").objid(), this.key(\"decrypt\").seq().obj(this.key(\"kde\").seq().obj(this.key(\"id\").objid(), this.key(\"kdeparams\").seq().obj(this.key(\"salt\").octstr(), this.key(\"iters\").int())), this.key(\"cipher\").seq().obj(this.key(\"algo\").objid(), this.key(\"iv\").octstr()))), this.key(\"subjectPrivateKey\").octstr());\n });\n exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo;\n var DSAPrivateKey = asn1.define(\"DSAPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"p\").int(), this.key(\"q\").int(), this.key(\"g\").int(), this.key(\"pub_key\").int(), this.key(\"priv_key\").int());\n });\n exports.DSAPrivateKey = DSAPrivateKey, exports.DSAparam = asn1.define(\"DSAparam\", function() {\n this.int();\n });\n var ECPrivateKey = asn1.define(\"ECPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"privateKey\").octstr(), this.key(\"parameters\").optional().explicit(0).use(ECParameters), this.key(\"publicKey\").optional().explicit(1).bitstr());\n });\n exports.ECPrivateKey = ECPrivateKey;\n var ECParameters = asn1.define(\"ECParameters\", function() {\n this.choice({\n namedCurve: this.objid()\n });\n });\n exports.signature = asn1.define(\"signature\", function() {\n this.seq().obj(this.key(\"r\").int(), this.key(\"s\").int());\n });\n }\n}), require_aesid = __commonJS({\n \"node_modules/parse-asn1/aesid.json\"(exports, module) {\n module.exports = {\n \"2.16.840.1.101.3.4.1.1\": \"aes-128-ecb\",\n \"2.16.840.1.101.3.4.1.2\": \"aes-128-cbc\",\n \"2.16.840.1.101.3.4.1.3\": \"aes-128-ofb\",\n \"2.16.840.1.101.3.4.1.4\": \"aes-128-cfb\",\n \"2.16.840.1.101.3.4.1.21\": \"aes-192-ecb\",\n \"2.16.840.1.101.3.4.1.22\": \"aes-192-cbc\",\n \"2.16.840.1.101.3.4.1.23\": \"aes-192-ofb\",\n \"2.16.840.1.101.3.4.1.24\": \"aes-192-cfb\",\n \"2.16.840.1.101.3.4.1.41\": \"aes-256-ecb\",\n \"2.16.840.1.101.3.4.1.42\": \"aes-256-cbc\",\n \"2.16.840.1.101.3.4.1.43\": \"aes-256-ofb\",\n \"2.16.840.1.101.3.4.1.44\": \"aes-256-cfb\"\n };\n }\n}), require_fixProc = __commonJS({\n \"node_modules/parse-asn1/fixProc.js\"(exports, module) {\n var findProc = /Proc-Type: 4,ENCRYPTED[\\n\\r]+DEK-Info: AES-((\?:128)|(\?:192)|(\?:256))-CBC,([0-9A-H]+)[\\n\\r]+([0-9A-z\\n\\r+/=]+)[\\n\\r]+/m, startRegex = /^-----BEGIN ((\?:.*\? KEY)|CERTIFICATE)-----/m, fullRegex = /^-----BEGIN ((\?:.*\? KEY)|CERTIFICATE)-----([0-9A-z\\n\\r+/=]+)-----END \\1-----$/m, evp = require_evp_bytestokey(), ciphers = require_browser5(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(okey, password) {\n var key = okey.toString(), match = key.match(findProc), decrypted;\n if (match) {\n var suite = \"aes\" + match[1], iv = Buffer2.from(match[2], \"hex\"), cipherText = Buffer2.from(match[3].replace(/[\\r\\n]/g, \"\"), \"base64\"), cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key, out = [], cipher = ciphers.createDecipheriv(suite, cipherKey, iv);\n out.push(cipher.update(cipherText)), out.push(cipher.final()), decrypted = Buffer2.concat(out);\n } else {\n var match2 = key.match(fullRegex);\n decrypted = Buffer2.from(match2[2].replace(/[\\r\\n]/g, \"\"), \"base64\");\n }\n var tag = key.match(startRegex)[1];\n return {\n tag,\n data: decrypted\n };\n };\n }\n}), require_parse_asn1 = __commonJS({\n \"node_modules/parse-asn1/index.js\"(exports, module) {\n var asn1 = require_asn12(), aesid = require_aesid(), fixProc = require_fixProc(), ciphers = require_browser5(), compat = require_browser4(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = parseKeys;\n function parseKeys(buffer) {\n var password;\n typeof buffer == \"object\" && !Buffer2.isBuffer(buffer) && (password = buffer.passphrase, buffer = buffer.key), typeof buffer == \"string\" && (buffer = Buffer2.from(buffer));\n var stripped = fixProc(buffer, password), type = stripped.tag, data = stripped.data, subtype, ndata;\n switch (type) {\n case \"CERTIFICATE\":\n ndata = asn1.certificate.decode(data, \"der\").tbsCertificate.subjectPublicKeyInfo;\n case \"PUBLIC KEY\":\n switch (ndata || (ndata = asn1.PublicKey.decode(data, \"der\")), subtype = ndata.algorithm.algorithm.join(\".\"), subtype) {\n case \"1.2.840.113549.1.1.1\":\n return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, \"der\");\n case \"1.2.840.10045.2.1\":\n return ndata.subjectPrivateKey = ndata.subjectPublicKey, {\n type: \"ec\",\n data: ndata\n };\n case \"1.2.840.10040.4.1\":\n return ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, \"der\"), {\n type: \"dsa\",\n data: ndata.algorithm.params\n };\n default:\n throw new Error(\"unknown key id \" + subtype);\n }\n case \"ENCRYPTED PRIVATE KEY\":\n data = asn1.EncryptedPrivateKey.decode(data, \"der\"), data = decrypt(data, password);\n case \"PRIVATE KEY\":\n switch (ndata = asn1.PrivateKey.decode(data, \"der\"), subtype = ndata.algorithm.algorithm.join(\".\"), subtype) {\n case \"1.2.840.113549.1.1.1\":\n return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, \"der\");\n case \"1.2.840.10045.2.1\":\n return {\n curve: ndata.algorithm.curve,\n privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, \"der\").privateKey\n };\n case \"1.2.840.10040.4.1\":\n return ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, \"der\"), {\n type: \"dsa\",\n params: ndata.algorithm.params\n };\n default:\n throw new Error(\"unknown key id \" + subtype);\n }\n case \"RSA PUBLIC KEY\":\n return asn1.RSAPublicKey.decode(data, \"der\");\n case \"RSA PRIVATE KEY\":\n return asn1.RSAPrivateKey.decode(data, \"der\");\n case \"DSA PRIVATE KEY\":\n return {\n type: \"dsa\",\n params: asn1.DSAPrivateKey.decode(data, \"der\")\n };\n case \"EC PRIVATE KEY\":\n return data = asn1.ECPrivateKey.decode(data, \"der\"), {\n curve: data.parameters.value,\n privateKey: data.privateKey\n };\n default:\n throw new Error(\"unknown key type \" + type);\n }\n }\n parseKeys.signature = asn1.signature;\n function decrypt(data, password) {\n var salt = data.algorithm.decrypt.kde.kdeparams.salt, iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10), algo = aesid[data.algorithm.decrypt.cipher.algo.join(\".\")], iv = data.algorithm.decrypt.cipher.iv, cipherText = data.subjectPrivateKey, keylen = parseInt(algo.split(\"-\")[1], 10) / 8, key = compat.pbkdf2Sync(password, salt, iters, keylen, \"sha1\"), cipher = ciphers.createDecipheriv(algo, key, iv), out = [];\n return out.push(cipher.update(cipherText)), out.push(cipher.final()), Buffer2.concat(out);\n }\n }\n}), require_curves2 = __commonJS({\n \"node_modules/browserify-sign/browser/curves.json\"(exports, module) {\n module.exports = {\n \"1.3.132.0.10\": \"secp256k1\",\n \"1.3.132.0.33\": \"p224\",\n \"1.2.840.10045.3.1.1\": \"p192\",\n \"1.2.840.10045.3.1.7\": \"p256\",\n \"1.3.132.0.34\": \"p384\",\n \"1.3.132.0.35\": \"p521\"\n };\n }\n}), require_sign = __commonJS({\n \"node_modules/browserify-sign/browser/sign.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, createHmac = require_browser3(), crt = require_browserify_rsa(), EC = require_elliptic().ec, BN = require_bn3(), parseKeys = require_parse_asn1(), curves = require_curves2();\n function sign(hash, key, hashType, signType, tag) {\n var priv = parseKeys(key);\n if (priv.curve) {\n if (signType !== \"ecdsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong private key type\");\n return ecSign(hash, priv);\n } else if (priv.type === \"dsa\") {\n if (signType !== \"dsa\")\n throw new Error(\"wrong private key type\");\n return dsaSign(hash, priv, hashType);\n } else if (signType !== \"rsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong private key type\");\n hash = Buffer2.concat([tag, hash]);\n for (var len = priv.modulus.byteLength(), pad = [0, 1];hash.length + pad.length + 1 < len; )\n pad.push(255);\n pad.push(0);\n for (var i = -1;++i < hash.length; )\n pad.push(hash[i]);\n var out = crt(pad, priv);\n return out;\n }\n function ecSign(hash, priv) {\n var curveId = curves[priv.curve.join(\".\")];\n if (!curveId)\n throw new Error(\"unknown curve \" + priv.curve.join(\".\"));\n var curve = new EC(curveId), key = curve.keyFromPrivate(priv.privateKey), out = key.sign(hash);\n return Buffer2.from(out.toDER());\n }\n function dsaSign(hash, priv, algo) {\n for (var x = priv.params.priv_key, p = priv.params.p, q = priv.params.q, g = priv.params.g, r = new BN(0), k, H = bits2int(hash, q).mod(q), s = !1, kv = getKey(x, q, hash, algo);s === !1; )\n k = makeKey(q, kv, algo), r = makeR(g, k, p, q), s = k.invm(q).imul(H.add(x.mul(r))).mod(q), s.cmpn(0) === 0 && (s = !1, r = new BN(0));\n return toDER(r, s);\n }\n function toDER(r, s) {\n r = r.toArray(), s = s.toArray(), r[0] & 128 && (r = [0].concat(r)), s[0] & 128 && (s = [0].concat(s));\n var total = r.length + s.length + 4, res = [48, total, 2, r.length];\n return res = res.concat(r, [2, s.length], s), Buffer2.from(res);\n }\n function getKey(x, q, hash, algo) {\n if (x = Buffer2.from(x.toArray()), x.length < q.byteLength()) {\n var zeros = Buffer2.alloc(q.byteLength() - x.length);\n x = Buffer2.concat([zeros, x]);\n }\n var hlen = hash.length, hbits = bits2octets(hash, q), v = Buffer2.alloc(hlen);\n v.fill(1);\n var k = Buffer2.alloc(hlen);\n return k = createHmac(algo, k).update(v).update(Buffer2.from([0])).update(x).update(hbits).digest(), v = createHmac(algo, k).update(v).digest(), k = createHmac(algo, k).update(v).update(Buffer2.from([1])).update(x).update(hbits).digest(), v = createHmac(algo, k).update(v).digest(), { k, v };\n }\n function bits2int(obits, q) {\n var bits = new BN(obits), shift = (obits.length << 3) - q.bitLength();\n return shift > 0 && bits.ishrn(shift), bits;\n }\n function bits2octets(bits, q) {\n bits = bits2int(bits, q), bits = bits.mod(q);\n var out = Buffer2.from(bits.toArray());\n if (out.length < q.byteLength()) {\n var zeros = Buffer2.alloc(q.byteLength() - out.length);\n out = Buffer2.concat([zeros, out]);\n }\n return out;\n }\n function makeKey(q, kv, algo) {\n var t, k;\n do {\n for (t = Buffer2.alloc(0);t.length * 8 < q.bitLength(); )\n kv.v = createHmac(algo, kv.k).update(kv.v).digest(), t = Buffer2.concat([t, kv.v]);\n k = bits2int(t, q), kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer2.from([0])).digest(), kv.v = createHmac(algo, kv.k).update(kv.v).digest();\n } while (k.cmp(q) !== -1);\n return k;\n }\n function makeR(g, k, p, q) {\n return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q);\n }\n module.exports = sign, module.exports.getKey = getKey, module.exports.makeKey = makeKey;\n }\n}), require_verify = __commonJS({\n \"node_modules/browserify-sign/browser/verify.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, BN = require_bn3(), EC = require_elliptic().ec, parseKeys = require_parse_asn1(), curves = require_curves2();\n function verify(sig, hash, key, signType, tag) {\n var pub = parseKeys(key);\n if (pub.type === \"ec\") {\n if (signType !== \"ecdsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong public key type\");\n return ecVerify(sig, hash, pub);\n } else if (pub.type === \"dsa\") {\n if (signType !== \"dsa\")\n throw new Error(\"wrong public key type\");\n return dsaVerify(sig, hash, pub);\n } else if (signType !== \"rsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong public key type\");\n hash = Buffer2.concat([tag, hash]);\n for (var len = pub.modulus.byteLength(), pad = [1], padNum = 0;hash.length + pad.length + 2 < len; )\n pad.push(255), padNum++;\n pad.push(0);\n for (var i = -1;++i < hash.length; )\n pad.push(hash[i]);\n pad = Buffer2.from(pad);\n var red = BN.mont(pub.modulus);\n sig = new BN(sig).toRed(red), sig = sig.redPow(new BN(pub.publicExponent)), sig = Buffer2.from(sig.fromRed().toArray());\n var out = padNum < 8 \? 1 : 0;\n for (len = Math.min(sig.length, pad.length), sig.length !== pad.length && (out = 1), i = -1;++i < len; )\n out |= sig[i] ^ pad[i];\n return out === 0;\n }\n function ecVerify(sig, hash, pub) {\n var curveId = curves[pub.data.algorithm.curve.join(\".\")];\n if (!curveId)\n throw new Error(\"unknown curve \" + pub.data.algorithm.curve.join(\".\"));\n var curve = new EC(curveId), pubkey = pub.data.subjectPrivateKey.data;\n return curve.verify(hash, sig, pubkey);\n }\n function dsaVerify(sig, hash, pub) {\n var p = pub.data.p, q = pub.data.q, g = pub.data.g, y = pub.data.pub_key, unpacked = parseKeys.signature.decode(sig, \"der\"), s = unpacked.s, r = unpacked.r;\n checkValue(s, q), checkValue(r, q);\n var montp = BN.mont(p), w = s.invm(q), v = g.toRed(montp).redPow(new BN(hash).mul(w).mod(q)).fromRed().mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed()).mod(p).mod(q);\n return v.cmp(r) === 0;\n }\n function checkValue(b, q) {\n if (b.cmpn(0) <= 0)\n throw new Error(\"invalid sig\");\n if (b.cmp(q) >= q)\n throw new Error(\"invalid sig\");\n }\n module.exports = verify;\n }\n}), require_browser8 = __commonJS({\n \"node_modules/browserify-sign/browser/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, createHash = require_browser2(), inherits = require_inherits_browser(), sign = require_sign(), verify = require_verify(), algorithms = require_algorithms();\n Object.keys(algorithms).forEach(function(key) {\n algorithms[key].id = Buffer2.from(algorithms[key].id, \"hex\"), algorithms[key.toLowerCase()] = algorithms[key];\n });\n function Sign(algorithm) {\n StreamModule.Writable.call(this);\n var data = algorithms[algorithm];\n if (!data)\n throw new Error(\"Unknown message digest\");\n this._hashType = data.hash, this._hash = createHash(data.hash), this._tag = data.id, this._signType = data.sign;\n }\n inherits(Sign, StreamModule.Writable), Sign.prototype._write = function(data, _, done) {\n this._hash.update(data), done();\n }, Sign.prototype.update = function(data, enc) {\n return typeof data == \"string\" && (data = Buffer2.from(data, enc)), this._hash.update(data), this;\n }, Sign.prototype.sign = function(key, enc) {\n this.end();\n var hash = this._hash.digest(), sig = sign(hash, key, this._hashType, this._signType, this._tag);\n return enc \? sig.toString(enc) : sig;\n };\n function Verify(algorithm) {\n StreamModule.Writable.call(this);\n var data = algorithms[algorithm];\n if (!data)\n throw new Error(\"Unknown message digest\");\n this._hash = createHash(data.hash), this._tag = data.id, this._signType = data.sign;\n }\n inherits(Verify, StreamModule.Writable), Verify.prototype._write = function(data, _, done) {\n this._hash.update(data), done();\n }, Verify.prototype.update = function(data, enc) {\n return typeof data == \"string\" && (data = Buffer2.from(data, enc)), this._hash.update(data), this;\n }, Verify.prototype.verify = function(key, sig, enc) {\n typeof sig == \"string\" && (sig = Buffer2.from(sig, enc)), this.end();\n var hash = this._hash.digest();\n return verify(sig, hash, key, this._signType, this._tag);\n };\n function createSign(algorithm) {\n return new Sign(algorithm);\n }\n function createVerify(algorithm) {\n return new Verify(algorithm);\n }\n module.exports = {\n Sign: createSign,\n Verify: createVerify,\n createSign,\n createVerify\n };\n }\n}), require_bn6 = require_bn, require_browser9 = __commonJS({\n \"node_modules/create-ecdh/browser.js\"(exports, module) {\n var elliptic = require_elliptic(), BN = require_bn6();\n module.exports = function(curve) {\n return new ECDH(curve);\n };\n var aliases = {\n secp256k1: {\n name: \"secp256k1\",\n byteLength: 32\n },\n secp224r1: {\n name: \"p224\",\n byteLength: 28\n },\n prime256v1: {\n name: \"p256\",\n byteLength: 32\n },\n prime192v1: {\n name: \"p192\",\n byteLength: 24\n },\n ed25519: {\n name: \"ed25519\",\n byteLength: 32\n },\n secp384r1: {\n name: \"p384\",\n byteLength: 48\n },\n secp521r1: {\n name: \"p521\",\n byteLength: 66\n }\n };\n aliases.p224 = aliases.secp224r1, aliases.p256 = aliases.secp256r1 = aliases.prime256v1, aliases.p192 = aliases.secp192r1 = aliases.prime192v1, aliases.p384 = aliases.secp384r1, aliases.p521 = aliases.secp521r1;\n function ECDH(curve) {\n this.curveType = aliases[curve], this.curveType || (this.curveType = {\n name: curve\n }), this.curve = new elliptic.ec(this.curveType.name), this.keys = void 0;\n }\n ECDH.prototype = {}, ECDH.prototype.generateKeys = function(enc, format) {\n return this.keys = this.curve.genKeyPair(), this.getPublicKey(enc, format);\n }, ECDH.prototype.computeSecret = function(other, inenc, enc) {\n inenc = inenc || \"utf8\", Buffer.isBuffer(other) || (other = new Buffer(other, inenc));\n var otherPub = this.curve.keyFromPublic(other).getPublic(), out = otherPub.mul(this.keys.getPrivate()).getX();\n return formatReturnValue(out, enc, this.curveType.byteLength);\n }, ECDH.prototype.getPublicKey = function(enc, format) {\n var key = this.keys.getPublic(format === \"compressed\", !0);\n return format === \"hybrid\" && (key[key.length - 1] % 2 \? key[0] = 7 : key[0] = 6), formatReturnValue(key, enc);\n }, ECDH.prototype.getPrivateKey = function(enc) {\n return formatReturnValue(this.keys.getPrivate(), enc);\n }, ECDH.prototype.setPublicKey = function(pub, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(pub) || (pub = new Buffer(pub, enc)), this.keys._importPublic(pub), this;\n }, ECDH.prototype.setPrivateKey = function(priv, enc) {\n enc = enc || \"utf8\", Buffer.isBuffer(priv) || (priv = new Buffer(priv, enc));\n var _priv = new BN(priv);\n return _priv = _priv.toString(16), this.keys = this.curve.genKeyPair(), this.keys._importPrivate(_priv), this;\n };\n function formatReturnValue(bn, enc, len) {\n Array.isArray(bn) || (bn = bn.toArray());\n var buf = new Buffer(bn);\n if (len && buf.length < len) {\n var zeros = new Buffer(len - buf.length);\n zeros.fill(0), buf = Buffer.concat([zeros, buf]);\n }\n return enc \? buf.toString(enc) : buf;\n }\n }\n}), require_mgf = __commonJS({\n \"node_modules/public-encrypt/mgf.js\"(exports, module) {\n var createHash = require_browser2(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(seed, len) {\n for (var t = Buffer2.alloc(0), i = 0, c;t.length < len; )\n c = i2ops(i++), t = Buffer2.concat([t, createHash(\"sha1\").update(seed).update(c).digest()]);\n return t.slice(0, len);\n };\n function i2ops(c) {\n var out = Buffer2.allocUnsafe(4);\n return out.writeUInt32BE(c, 0), out;\n }\n }\n}), require_xor = __commonJS({\n \"node_modules/public-encrypt/xor.js\"(exports, module) {\n module.exports = function(a, b) {\n for (var len = a.length, i = -1;++i < len; )\n a[i] ^= b[i];\n return a;\n };\n }\n}), require_bn7 = require_bn, { CryptoHasher } = globalThis.Bun, require_withPublic = __commonJS({\n \"node_modules/public-encrypt/withPublic.js\"(exports, module) {\n var BN = require_bn7(), Buffer2 = require_safe_buffer().Buffer;\n function withPublic(paddedMsg, key) {\n return Buffer2.from(paddedMsg.toRed(BN.mont(key.modulus)).redPow(new BN(key.publicExponent)).fromRed().toArray());\n }\n module.exports = withPublic;\n }\n}), require_publicEncrypt = __commonJS({\n \"node_modules/public-encrypt/publicEncrypt.js\"(exports, module) {\n var parseKeys = require_parse_asn1(), randomBytes = require_browser(), createHash = require_browser2(), mgf = require_mgf(), xor = require_xor(), BN = require_bn7(), withPublic = require_withPublic(), crt = require_browserify_rsa(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(publicKey, msg, reverse) {\n var padding;\n publicKey.padding \? padding = publicKey.padding : reverse \? padding = 1 : padding = 4;\n var key = parseKeys(publicKey), paddedMsg;\n if (padding === 4)\n paddedMsg = oaep(key, msg);\n else if (padding === 1)\n paddedMsg = pkcs1(key, msg, reverse);\n else if (padding === 3) {\n if (paddedMsg = new BN(msg), paddedMsg.cmp(key.modulus) >= 0)\n throw new Error(\"data too long for modulus\");\n } else\n throw new Error(\"unknown padding\");\n return reverse \? crt(paddedMsg, key) : withPublic(paddedMsg, key);\n };\n function oaep(key, msg) {\n var k = key.modulus.byteLength(), mLen = msg.length, iHash = createHash(\"sha1\").update(Buffer2.alloc(0)).digest(), hLen = iHash.length, hLen2 = 2 * hLen;\n if (mLen > k - hLen2 - 2)\n throw new Error(\"message too long\");\n var ps = Buffer2.alloc(k - mLen - hLen2 - 2), dblen = k - hLen - 1, seed = randomBytes(hLen), maskedDb = xor(Buffer2.concat([iHash, ps, Buffer2.alloc(1, 1), msg], dblen), mgf(seed, dblen)), maskedSeed = xor(seed, mgf(maskedDb, hLen));\n return new BN(Buffer2.concat([Buffer2.alloc(1), maskedSeed, maskedDb], k));\n }\n function pkcs1(key, msg, reverse) {\n var mLen = msg.length, k = key.modulus.byteLength();\n if (mLen > k - 11)\n throw new Error(\"message too long\");\n var ps;\n return reverse \? ps = Buffer2.alloc(k - mLen - 3, 255) : ps = nonZero(k - mLen - 3), new BN(Buffer2.concat([Buffer2.from([0, reverse \? 1 : 2]), ps, Buffer2.alloc(1), msg], k));\n }\n function nonZero(len) {\n for (var out = Buffer2.allocUnsafe(len), i = 0, cache = randomBytes(len * 2), cur = 0, num;i < len; )\n cur === cache.length && (cache = randomBytes(len * 2), cur = 0), num = cache[cur++], num && (out[i++] = num);\n return out;\n }\n }\n}), require_privateDecrypt = __commonJS({\n \"node_modules/public-encrypt/privateDecrypt.js\"(exports, module) {\n var parseKeys = require_parse_asn1(), mgf = require_mgf(), xor = require_xor(), BN = require_bn7(), crt = require_browserify_rsa(), createHash = require_browser2(), withPublic = require_withPublic(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(privateKey, enc, reverse) {\n var padding;\n privateKey.padding \? padding = privateKey.padding : reverse \? padding = 1 : padding = 4;\n var key = parseKeys(privateKey), k = key.modulus.byteLength();\n if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0)\n throw new Error(\"decryption error\");\n var msg;\n reverse \? msg = withPublic(new BN(enc), key) : msg = crt(enc, key);\n var zBuffer = Buffer2.alloc(k - msg.length);\n if (msg = Buffer2.concat([zBuffer, msg], k), padding === 4)\n return oaep(key, msg);\n if (padding === 1)\n return pkcs1(key, msg, reverse);\n if (padding === 3)\n return msg;\n throw new Error(\"unknown padding\");\n };\n function oaep(key, msg) {\n var k = key.modulus.byteLength(), iHash = createHash(\"sha1\").update(Buffer2.alloc(0)).digest(), hLen = iHash.length;\n if (msg[0] !== 0)\n throw new Error(\"decryption error\");\n var maskedSeed = msg.slice(1, hLen + 1), maskedDb = msg.slice(hLen + 1), seed = xor(maskedSeed, mgf(maskedDb, hLen)), db = xor(maskedDb, mgf(seed, k - hLen - 1));\n if (compare(iHash, db.slice(0, hLen)))\n throw new Error(\"decryption error\");\n for (var i = hLen;db[i] === 0; )\n i++;\n if (db[i++] !== 1)\n throw new Error(\"decryption error\");\n return db.slice(i);\n }\n function pkcs1(key, msg, reverse) {\n for (var p1 = msg.slice(0, 2), i = 2, status = 0;msg[i++] !== 0; )\n if (i >= msg.length) {\n status++;\n break;\n }\n var ps = msg.slice(2, i - 1);\n if ((p1.toString(\"hex\") !== \"0002\" && !reverse || p1.toString(\"hex\") !== \"0001\" && reverse) && status++, ps.length < 8 && status++, status)\n throw new Error(\"decryption error\");\n return msg.slice(i);\n }\n function compare(a, b) {\n a = Buffer2.from(a), b = Buffer2.from(b);\n var dif = 0, len = a.length;\n a.length !== b.length && (dif++, len = Math.min(a.length, b.length));\n for (var i = -1;++i < len; )\n dif += a[i] ^ b[i];\n return dif;\n }\n }\n}), require_browser10 = __commonJS({\n \"node_modules/public-encrypt/browser.js\"(exports) {\n exports.publicEncrypt = require_publicEncrypt(), exports.privateDecrypt = require_privateDecrypt(), exports.privateEncrypt = function(key, buf) {\n return exports.publicEncrypt(key, buf, !0);\n }, exports.publicDecrypt = function(key, buf) {\n return exports.privateDecrypt(key, buf, !0);\n };\n }\n}), require_browser11 = __commonJS({\n \"node_modules/randomfill/browser.js\"(exports) {\n var safeBuffer = require_safe_buffer(), randombytes = require_browser(), Buffer2 = safeBuffer.Buffer, kBufferMaxLength = safeBuffer.kMaxLength, kMaxUint32 = Math.pow(2, 32) - 1;\n function assertOffset(offset, length) {\n if (typeof offset != \"number\" || offset !== offset)\n @throwTypeError(\"offset must be a number\");\n if (offset > kMaxUint32 || offset < 0)\n @throwTypeError(\"offset must be a uint32\");\n if (offset > kBufferMaxLength || offset > length)\n @throwRangeError(\"offset out of range\");\n }\n function assertSize(size, offset, length) {\n if (typeof size != \"number\" || size !== size)\n @throwTypeError(\"size must be a number\");\n if (size > kMaxUint32 || size < 0)\n @throwTypeError(\"size must be a uint32\");\n if (size + offset > length || size > kBufferMaxLength)\n @throwRangeError(\"buffer too small\");\n }\n exports.randomFill = randomFill, exports.randomFillSync = randomFillSync;\n function randomFill(buf, offset, size, cb) {\n if (!Buffer2.isBuffer(buf) && !(buf instanceof global.Uint8Array))\n @throwTypeError('\"buf\" argument must be a Buffer or Uint8Array');\n if (typeof offset == \"function\")\n cb = offset, offset = 0, size = buf.length;\n else if (typeof size == \"function\")\n cb = size, size = buf.length - offset;\n else if (typeof cb != \"function\")\n @throwTypeError('\"cb\" argument must be a function');\n return assertOffset(offset, buf.length), assertSize(size, offset, buf.length), actualFill(buf, offset, size, cb);\n }\n function actualFill(buf, offset, size, cb) {\n if (cb) {\n randombytes(size, function(err, bytes2) {\n if (err)\n return cb(err);\n bytes2.copy(buf, offset), cb(null, buf);\n });\n return;\n }\n var bytes = randombytes(size);\n return bytes.copy(buf, offset), buf;\n }\n function randomFillSync(buf, offset, size) {\n if (typeof offset > \"u\" && (offset = 0), !Buffer2.isBuffer(buf) && !(buf instanceof global.Uint8Array))\n @throwTypeError('\"buf\" argument must be a Buffer or Uint8Array');\n return assertOffset(offset, buf.length), size === void 0 && (size = buf.length - offset), assertSize(size, offset, buf.length), actualFill(buf, offset, size);\n }\n }\n}), require_crypto_browserify2 = __commonJS({\n \"node_modules/crypto-browserify/index.js\"(exports) {\n exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require_browser(), exports.createHash = require_browser2(), exports.Hash = exports.createHash.Hash, exports.createHmac = exports.Hmac = require_browser3();\n var algos = require_algos(), algoKeys = Object.keys(algos), hashes = [\"sha1\", \"sha224\", \"sha256\", \"sha384\", \"sha512\", \"md5\", \"rmd160\"].concat(algoKeys);\n exports.getHashes = function() {\n return hashes;\n };\n var p = require_browser4();\n exports.pbkdf2 = p.pbkdf2, exports.pbkdf2Sync = p.pbkdf2Sync;\n var aes = require_browser6();\n exports.Cipher = aes.Cipher, exports.createCipher = aes.createCipher, exports.Cipheriv = aes.Cipheriv, exports.createCipheriv = aes.createCipheriv, exports.Decipher = aes.Decipher, exports.createDecipher = aes.createDecipher, exports.Decipheriv = aes.Decipheriv, exports.createDecipheriv = aes.createDecipheriv, exports.getCiphers = aes.getCiphers, exports.listCiphers = aes.listCiphers;\n var dh = require_browser7();\n exports.DiffieHellmanGroup = dh.DiffieHellmanGroup, exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup, exports.getDiffieHellman = dh.getDiffieHellman, exports.createDiffieHellman = dh.createDiffieHellman, exports.DiffieHellman = dh.DiffieHellman;\n var sign = require_browser8();\n exports.createSign = sign.createSign, exports.Sign = sign.Sign, exports.createVerify = sign.createVerify, exports.Verify = sign.Verify, exports.createECDH = require_browser9();\n var publicEncrypt = require_browser10();\n exports.publicEncrypt = publicEncrypt.publicEncrypt, exports.privateEncrypt = publicEncrypt.privateEncrypt, exports.publicDecrypt = publicEncrypt.publicDecrypt, exports.privateDecrypt = publicEncrypt.privateDecrypt, exports.getRandomValues = (values) => crypto.getRandomValues(values);\n var rf = require_browser11();\n exports.randomFill = rf.randomFill, exports.randomFillSync = rf.randomFillSync, exports.createCredentials = function() {\n throw new Error([\n \"sorry, createCredentials is not implemented yet\",\n \"we accept pull requests\",\n \"https://github.com/crypto-browserify/crypto-browserify\"\n ].join(`\n`));\n }, exports.constants = @processBindingConstants.crypto;\n }\n}), crypto_exports = require_crypto_browserify2(), DEFAULT_ENCODING = \"buffer\", getRandomValues = (array) => crypto.getRandomValues(array), randomUUID = () => crypto.randomUUID(), randomInt = (...args) => crypto.randomInt(...args), timingSafeEqual = \"timingSafeEqual\" in crypto \? (a, b) => {\n let { byteLength: byteLengthA } = a, { byteLength: byteLengthB } = b;\n if (typeof byteLengthA != \"number\" || typeof byteLengthB != \"number\")\n @throwTypeError(\"Input must be an array buffer view\");\n if (byteLengthA !== byteLengthB)\n @throwRangeError(\"Input buffers must have the same length\");\n return crypto.timingSafeEqual(a, b);\n} : void 0, scryptSync = \"scryptSync\" in crypto \? (password, salt, keylen, options) => {\n let res = crypto.scryptSync(password, salt, keylen, options);\n return DEFAULT_ENCODING !== \"buffer\" \? new Buffer(res).toString(DEFAULT_ENCODING) : new Buffer(res);\n} : void 0, scrypt = \"scryptSync\" in crypto \? function(password, salt, keylen, options, callback) {\n if (typeof options == \"function\" && (callback = options, options = void 0), typeof callback != \"function\") {\n var err = @makeTypeError(\"callback must be a function\");\n throw err.code = \"ERR_INVALID_CALLBACK\", err;\n }\n try {\n let result = crypto.scryptSync(password, salt, keylen, options);\n process.nextTick(callback, null, DEFAULT_ENCODING !== \"buffer\" \? new Buffer(result).toString(DEFAULT_ENCODING) : new Buffer(result));\n } catch (err2) {\n throw err2;\n }\n} : void 0;\ntimingSafeEqual && (Object.defineProperty(timingSafeEqual, \"name\", {\n value: \"::bunternal::\"\n}), Object.defineProperty(scrypt, \"name\", {\n value: \"::bunternal::\"\n}), Object.defineProperty(scryptSync, \"name\", {\n value: \"::bunternal::\"\n}));\nvar harcoded_curves = [\n \"p192\",\n \"p224\",\n \"p256\",\n \"p384\",\n \"p521\",\n \"curve25519\",\n \"ed25519\",\n \"secp256k1\",\n \"secp224r1\",\n \"prime256v1\",\n \"prime192v1\",\n \"ed25519\",\n \"secp384r1\",\n \"secp521r1\"\n], webcrypto = crypto;\n__export(crypto_exports, {\n DEFAULT_ENCODING: () => DEFAULT_ENCODING,\n getRandomValues: () => getRandomValues,\n randomUUID: () => randomUUID,\n randomInt: () => randomInt,\n getCurves: () => getCurves,\n scrypt: () => scrypt,\n scryptSync: () => scryptSync,\n timingSafeEqual: () => timingSafeEqual,\n webcrypto: () => webcrypto,\n subtle: () => webcrypto.subtle\n});\n$ = crypto_exports;\n/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeClusterCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/cluster.ts\nvar EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6);\n\nclass Cluster extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n isWorker = !1;\n isPrimary = !0;\n isMaster = !0;\n workers = {};\n settings = {};\n SCHED_NONE = 1;\n SCHED_RR = 2;\n schedulingPolicy = 2;\n Worker = function Worker() {\n throwNotImplemented(\"node:cluster Worker\", 2428);\n };\n setupPrimary() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n setupMaster() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n fork() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n disconnect() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n}\nreturn new Cluster})\n");
//
//
-static constexpr ASCIILiteral NodeDgramCode = "(function (){\"use strict\";// src/js/out/tmp/node/dgram.ts\nvar createSocket = function() {\n throwNotImplemented(\"node:dgram createSocket\", 1630);\n}, Socket = function() {\n throwNotImplemented(\"node:dgram Socket\", 1630);\n}, _createSocketHandle = function() {\n throwNotImplemented(\"node:dgram _createSocketHandle\", 1630);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5);\n$ = {\n createSocket,\n Socket,\n _createSocketHandle\n};\nhideFromStack(createSocket, Socket, _createSocketHandle);\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeConsoleCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/console.ts\nreturn console})\n");
//
//
-static constexpr ASCIILiteral NodeDiagnosticsChannelCode = "(function (){\"use strict\";// src/js/out/tmp/node/diagnostics_channel.ts\nvar markActive = function(channel) {\n ObjectSetPrototypeOf(channel, ActiveChannel.prototype), channel._subscribers = [], channel._stores = new SafeMap;\n}, maybeMarkInactive = function(channel) {\n if (!channel._subscribers.length && !channel._stores.size)\n ObjectSetPrototypeOf(channel, Channel.prototype), channel._subscribers = void 0, channel._stores = void 0;\n}, defaultTransform = function(data) {\n return data;\n}, wrapStoreRun = function(store, data, next, transform = defaultTransform) {\n return () => {\n let context;\n try {\n context = transform(data);\n } catch (err) {\n return process.nextTick(() => reportError(err)), next();\n }\n return store.run(context, next);\n };\n}, channel = function(name) {\n const channel2 = channels.get(name);\n if (channel2)\n return channel2;\n if (typeof name !== \"string\" && typeof name !== \"symbol\")\n throw new ERR_INVALID_ARG_TYPE(\"channel\", [\"string\", \"symbol\"], name);\n return new Channel(name);\n}, subscribe = function(name, subscription) {\n return channel(name).subscribe(subscription);\n}, unsubscribe = function(name, subscription) {\n return channel(name).unsubscribe(subscription);\n}, hasSubscribers = function(name) {\n const channel2 = channels.get(name);\n if (!channel2)\n return !1;\n return channel2.hasSubscribers;\n}, assertChannel = function(value, name) {\n if (!(value instanceof Channel))\n throw new ERR_INVALID_ARG_TYPE(name, [\"Channel\"], value);\n}, tracingChannel = function(nameOrChannels) {\n return new TracingChannel(nameOrChannels);\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, $, SafeMap = Map, SafeFinalizationRegistry = FinalizationRegistry, ArrayPrototypeAt = (array, index) => array[index], ArrayPrototypeIndexOf = (array, value) => array.indexOf(value), ArrayPrototypePush = (array, value) => array.push(value), ArrayPrototypeSplice = (array, start, deleteCount) => array.splice(start, deleteCount), ObjectGetPrototypeOf = Object.getPrototypeOf, ObjectSetPrototypeOf = Object.setPrototypeOf, SymbolHasInstance = Symbol.hasInstance, ReflectApply = Reflect.apply, PromiseResolve = Promise.resolve, PromiseReject = Promise.reject, PromisePrototypeThen = (promise, onFulfilled, onRejected) => promise.then(onFulfilled, onRejected);\n\nclass WeakReference extends WeakRef {\n constructor() {\n super(...arguments);\n }\n #refs = 0;\n get() {\n return this.deref();\n }\n incRef() {\n return ++this.#refs;\n }\n decRef() {\n return --this.#refs;\n }\n}\n\nclass WeakRefMap extends SafeMap {\n constructor() {\n super(...arguments);\n }\n #finalizers = new SafeFinalizationRegistry((key) => {\n this.delete(key);\n });\n set(key, value) {\n return this.#finalizers.register(value, key), super.set(key, new WeakReference(value));\n }\n get(key) {\n return super.get(key)\?.get();\n }\n incRef(key) {\n return super.get(key)\?.incRef();\n }\n decRef(key) {\n return super.get(key)\?.decRef();\n }\n}\n\nclass ActiveChannel {\n subscribe(subscription) {\n validateFunction(subscription, \"subscription\"), ArrayPrototypePush(this._subscribers, subscription), channels.incRef(this.name);\n }\n unsubscribe(subscription) {\n const index = ArrayPrototypeIndexOf(this._subscribers, subscription);\n if (index === -1)\n return !1;\n return ArrayPrototypeSplice(this._subscribers, index, 1), channels.decRef(this.name), maybeMarkInactive(this), !0;\n }\n bindStore(store, transform) {\n if (!this._stores.has(store))\n channels.incRef(this.name);\n this._stores.set(store, transform);\n }\n unbindStore(store) {\n if (!this._stores.has(store))\n return !1;\n return this._stores.delete(store), channels.decRef(this.name), maybeMarkInactive(this), !0;\n }\n get hasSubscribers() {\n return !0;\n }\n publish(data) {\n for (let i = 0;i < (this._subscribers\?.length || 0); i++)\n try {\n const onMessage = this._subscribers[i];\n onMessage(data, this.name);\n } catch (err) {\n process.nextTick(() => reportError(err));\n }\n }\n runStores(data, fn, thisArg, ...args) {\n let run = () => {\n return this.publish(data), ReflectApply(fn, thisArg, args);\n };\n for (let entry of this._stores.entries()) {\n const store = entry[0], transform = entry[1];\n run = wrapStoreRun(store, data, run, transform);\n }\n return run();\n }\n}\n\nclass Channel {\n constructor(name) {\n this._subscribers = void 0, this._stores = void 0, this.name = name, channels.set(name, this);\n }\n static [SymbolHasInstance](instance) {\n const prototype = ObjectGetPrototypeOf(instance);\n return prototype === Channel.prototype || prototype === ActiveChannel.prototype;\n }\n subscribe(subscription) {\n markActive(this), this.subscribe(subscription);\n }\n unsubscribe() {\n return !1;\n }\n bindStore(store, transform) {\n markActive(this), this.bindStore(store, transform);\n }\n unbindStore() {\n return !1;\n }\n get hasSubscribers() {\n return !1;\n }\n publish() {\n }\n runStores(data, fn, thisArg, ...args) {\n return ReflectApply(fn, thisArg, args);\n }\n}\nvar channels = new WeakRefMap, traceEvents = [\"start\", \"end\", \"asyncStart\", \"asyncEnd\", \"error\"];\n\nclass TracingChannel {\n constructor(nameOrChannels) {\n if (typeof nameOrChannels === \"string\")\n this.start = channel(`tracing:${nameOrChannels}:start`), this.end = channel(`tracing:${nameOrChannels}:end`), this.asyncStart = channel(`tracing:${nameOrChannels}:asyncStart`), this.asyncEnd = channel(`tracing:${nameOrChannels}:asyncEnd`), this.error = channel(`tracing:${nameOrChannels}:error`);\n else if (typeof nameOrChannels === \"object\") {\n const { start, end, asyncStart, asyncEnd, error } = nameOrChannels;\n assertChannel(start, \"nameOrChannels.start\"), assertChannel(end, \"nameOrChannels.end\"), assertChannel(asyncStart, \"nameOrChannels.asyncStart\"), assertChannel(asyncEnd, \"nameOrChannels.asyncEnd\"), assertChannel(error, \"nameOrChannels.error\"), this.start = start, this.end = end, this.asyncStart = asyncStart, this.asyncEnd = asyncEnd, this.error = error;\n } else\n throw new ERR_INVALID_ARG_TYPE(\"nameOrChannels\", [\"string\", \"object\", \"Channel\"], nameOrChannels);\n }\n subscribe(handlers) {\n for (let name of traceEvents) {\n if (!handlers[name])\n continue;\n this[name]\?.subscribe(handlers[name]);\n }\n }\n unsubscribe(handlers) {\n let done = !0;\n for (let name of traceEvents) {\n if (!handlers[name])\n continue;\n if (!this[name]\?.unsubscribe(handlers[name]))\n done = !1;\n }\n return done;\n }\n traceSync(fn, context = {}, thisArg, ...args) {\n const { start, end, error } = this;\n return start.runStores(context, () => {\n try {\n const result = ReflectApply(fn, thisArg, args);\n return context.result = result, result;\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n tracePromise(fn, context = {}, thisArg, ...args) {\n const { start, end, asyncStart, asyncEnd, error } = this;\n function reject(err) {\n return context.error = err, error.publish(context), asyncStart.publish(context), asyncEnd.publish(context), PromiseReject(err);\n }\n function resolve(result) {\n return context.result = result, asyncStart.publish(context), asyncEnd.publish(context), result;\n }\n return start.runStores(context, () => {\n try {\n let promise = ReflectApply(fn, thisArg, args);\n if (!(promise instanceof Promise))\n promise = PromiseResolve(promise);\n return PromisePrototypeThen(promise, resolve, reject);\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n traceCallback(fn, position = -1, context = {}, thisArg, ...args) {\n const { start, end, asyncStart, asyncEnd, error } = this;\n function wrappedCallback(err, res) {\n if (err)\n context.error = err, error.publish(context);\n else\n context.result = res;\n asyncStart.runStores(context, () => {\n try {\n if (callback)\n return ReflectApply(callback, this, arguments);\n } finally {\n asyncEnd.publish(context);\n }\n });\n }\n const callback = ArrayPrototypeAt(args, position);\n if (typeof callback !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"callback\", [\"function\"], callback);\n return ArrayPrototypeSplice(args, position, 1, wrappedCallback), start.runStores(context, () => {\n try {\n return ReflectApply(fn, thisArg, args);\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n}\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\n$ = {\n channel,\n hasSubscribers,\n subscribe,\n tracingChannel,\n unsubscribe,\n Channel\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeCryptoCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/crypto.ts\nvar exportIfKeyObject = function(key2) {\n if (key2 instanceof KeyObject)\n key2 = key2.export();\n else if (key2 instanceof CryptoKey)\n key2 = KeyObject.from(key2).export();\n return key2;\n}, getKeyFrom = function(key2, type) {\n if (key2 instanceof KeyObject)\n key2 = key2.export();\n else if (key2 instanceof CryptoKey)\n key2 = KeyObject.from(key2).export();\n else if (!Buffer.isBuffer(key2) && typeof key2 === \"object\") {\n if ((typeof key2.format === \"string\" || typeof key2.passphrase === \"string\") && typeof key2.key !== \"undefined\")\n key2 = type === \"public\" \? _createPublicKey(key2).export() : _createPrivateKey(key2).export();\n } else if (typeof key2 === \"string\" && type === \"public\")\n key2.indexOf(\"PRIVATE KEY-----\") !== -1 && (key2 = _createPublicKey(key2).export());\n return key2;\n}, getArrayBufferOrView = function(buffer, name, encoding) {\n if (buffer instanceof KeyObject) {\n if (buffer.type !== \"secret\") {\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key.type}, expected secret`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n }\n buffer = buffer.export();\n }\n if (isAnyArrayBuffer(buffer))\n return buffer;\n if (typeof buffer === \"string\") {\n if (encoding === \"buffer\")\n encoding = \"utf8\";\n return Buffer.from(buffer, encoding);\n }\n if (!isArrayBufferView(buffer)) {\n var error = @makeTypeError(`ERR_INVALID_ARG_TYPE: The \"${name}\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, or DataView. Received ` + buffer);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n return buffer;\n}, getCurves = function() {\n return harcoded_curves;\n}, _generateKeyPairSync = function(algorithm, options) {\n const result = generateKeyPairSync(algorithm, options);\n if (result) {\n const publicKeyEncoding = options\?.publicKeyEncoding, privateKeyEncoding = options\?.privateKeyEncoding;\n result.publicKey = publicKeyEncoding \? KeyObject.from(result.publicKey).export(publicKeyEncoding) : KeyObject.from(result.publicKey), result.privateKey = privateKeyEncoding \? KeyObject.from(result.privateKey).export(privateKeyEncoding) : KeyObject.from(result.privateKey);\n }\n return result;\n}, _createPrivateKey = function(key2) {\n if (typeof key2 === \"string\")\n return key2 = Buffer.from(key2, \"utf8\"), KeyObject.from(createPrivateKey({ key: key2, format: \"pem\" }));\n else if (isAnyArrayBuffer(key2) || isArrayBufferView(key2))\n return KeyObject.from(createPrivateKey({ key: key2, format: \"pem\" }));\n else if (typeof key2 === \"object\")\n if (key2 instanceof KeyObject || key2 instanceof CryptoKey) {\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key2.type}`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n } else {\n let actual_key = key2.key;\n if (typeof actual_key === \"string\")\n actual_key = Buffer.from(actual_key, key2.encoding || \"utf8\"), key2.key = actual_key;\n else if (actual_key instanceof KeyObject || actual_key instanceof CryptoKey) {\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key2.type}`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n }\n if (!isAnyArrayBuffer(actual_key) && !isArrayBufferView(actual_key) && typeof actual_key !== \"object\") {\n var error = @makeTypeError('ERR_INVALID_ARG_TYPE: The \"key\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ' + actual_key);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n if (!key2.format)\n key2.format = \"pem\";\n return KeyObject.from(createPrivateKey(key2));\n }\n else {\n var error = @makeTypeError('ERR_INVALID_ARG_TYPE: The \"key\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ' + key2);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n}, _createPublicKey = function(key2) {\n if (typeof key2 === \"string\")\n return key2 = Buffer.from(key2, \"utf8\"), KeyObject.from(createPublicKey({ key: key2, format: \"pem\" }));\n else if (isAnyArrayBuffer(key2) || isArrayBufferView(key2))\n return KeyObject.from(createPublicKey({ key: key2, format: \"pem\" }));\n else if (typeof key2 === \"object\")\n if (key2 instanceof KeyObject || key2 instanceof CryptoKey) {\n if (key2.type === \"private\")\n return KeyObject.from(createPublicKey({ key: key2[kCryptoKey] || key2, format: \"\" }));\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key2.type}, expected private`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n } else {\n if (key2.passphrase) {\n let actual_key2 = key2.key;\n if (typeof actual_key2 === \"string\")\n actual_key2 = Buffer.from(actual_key2, key2.encoding || \"utf8\");\n return KeyObject.from(createPublicKey({\n key: createPrivateKey({ key: actual_key2, format: key2.format, passphrase: key2.passphrase }),\n format: \"\"\n }));\n }\n let actual_key = key2.key;\n if (typeof actual_key === \"string\")\n actual_key = Buffer.from(actual_key, key2.encoding || \"utf8\"), key2.key = actual_key;\n else if (actual_key instanceof KeyObject || actual_key instanceof CryptoKey) {\n if (actual_key.type === \"private\")\n return KeyObject.from(createPublicKey({ key: actual_key[kCryptoKey] || actual_key, format: \"\" }));\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${actual_key.type}, expected private`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n }\n if (!isAnyArrayBuffer(actual_key) && !isArrayBufferView(actual_key) && typeof actual_key !== \"object\") {\n var error = @makeTypeError('ERR_INVALID_ARG_TYPE: The \"key\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ' + key2);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n if (!key2.format)\n key2.format = \"pem\";\n return KeyObject.from(createPublicKey(key2));\n }\n else {\n var error = @makeTypeError('ERR_INVALID_ARG_TYPE: The \"key\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ' + key2);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n}, $, __defProp = Object.defineProperty, __getOwnPropNames = Object.getOwnPropertyNames, StreamModule = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), BufferModule = @requireNativeModule(\"buffer\"), StringDecoder = @requireNativeModule(\"string_decoder\").StringDecoder, MAX_STRING_LENGTH = 536870888, Buffer = globalThis.Buffer, EMPTY_BUFFER = Buffer.alloc(0), { isAnyArrayBuffer, isArrayBufferView } = @requireNativeModule(\"util/types\"), crypto = globalThis.crypto, globalCrypto = crypto, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: !0 });\n}, require_safe_buffer = __commonJS({\n \"node_modules/safe-buffer/index.js\"(exports, module) {\n var buffer = BufferModule, Buffer2 = buffer.Buffer;\n function copyProps(src, dst) {\n for (var key2 in src)\n dst[key2] = src[key2];\n }\n Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow \? module.exports = buffer : (copyProps(buffer, exports), exports.Buffer = SafeBuffer);\n function SafeBuffer(arg, encodingOrOffset, length) {\n return Buffer2(arg, encodingOrOffset, length);\n }\n SafeBuffer.prototype = Object.create(Buffer2.prototype), copyProps(Buffer2, SafeBuffer), SafeBuffer.from = function(arg, encodingOrOffset, length) {\n if (typeof arg == \"number\")\n @throwTypeError(\"Argument must not be a number\");\n return Buffer2(arg, encodingOrOffset, length);\n }, SafeBuffer.alloc = function(size, fill, encoding) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n var buf = Buffer2(size);\n return fill !== void 0 \? typeof encoding == \"string\" \? buf.fill(fill, encoding) : buf.fill(fill) : buf.fill(0), buf;\n }, SafeBuffer.allocUnsafe = function(size) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n return Buffer2(size);\n }, SafeBuffer.allocUnsafeSlow = function(size) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n return buffer.SlowBuffer(size);\n };\n }\n}), require_browser = __commonJS({\n \"node_modules/randombytes/browser.js\"(exports, module) {\n var MAX_BYTES = 65536, MAX_UINT32 = 4294967295;\n function oldBrowser() {\n throw new Error(`Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11`);\n }\n var Buffer2 = require_safe_buffer().Buffer, crypto2 = globalCrypto;\n crypto2 && crypto2.getRandomValues \? module.exports = randomBytes : module.exports = oldBrowser;\n function randomBytes(size, cb) {\n if (size > MAX_UINT32)\n @throwRangeError(\"requested too many random bytes\");\n var bytes = Buffer2.allocUnsafe(size);\n if (size > 0)\n if (size > MAX_BYTES)\n for (var generated = 0;generated < size; generated += MAX_BYTES)\n crypto2.getRandomValues(bytes.slice(generated, generated + MAX_BYTES));\n else\n crypto2.getRandomValues(bytes);\n return typeof cb == \"function\" \? process.nextTick(function() {\n cb(null, bytes);\n }) : bytes;\n }\n }\n}), require_inherits_browser = __commonJS({\n \"node_modules/inherits/inherits_browser.js\"(exports, module) {\n module.exports = function(ctor, superCtor) {\n superCtor && (ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }));\n };\n }\n}), require_hash_base = __commonJS({\n \"node_modules/hash-base/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, inherits = require_inherits_browser();\n function throwIfNotStringOrBuffer(val, prefix) {\n if (!Buffer2.isBuffer(val) && typeof val != \"string\")\n @throwTypeError(prefix + \" must be a string or a buffer\");\n }\n function HashBase(blockSize) {\n StreamModule.Transform.@call(this), this._block = Buffer2.allocUnsafe(blockSize), this._blockSize = blockSize, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = !1;\n }\n inherits(HashBase, StreamModule.Transform), HashBase.prototype._transform = function(chunk, encoding, callback) {\n var error = null;\n try {\n this.update(chunk, encoding);\n } catch (err) {\n error = err;\n }\n callback(error);\n }, HashBase.prototype._flush = function(callback) {\n var error = null;\n try {\n this.push(this.digest());\n } catch (err) {\n error = err;\n }\n callback(error);\n }, HashBase.prototype.update = function(data, encoding) {\n if (throwIfNotStringOrBuffer(data, \"Data\"), this._finalized)\n throw new Error(\"Digest already called\");\n Buffer2.isBuffer(data) || (data = Buffer2.from(data, encoding));\n for (var block = this._block, offset = 0;this._blockOffset + data.length - offset >= this._blockSize; ) {\n for (var i = this._blockOffset;i < this._blockSize; )\n block[i++] = data[offset++];\n this._update(), this._blockOffset = 0;\n }\n for (;offset < data.length; )\n block[this._blockOffset++] = data[offset++];\n for (var j = 0, carry = data.length * 8;carry > 0; ++j)\n this._length[j] += carry, carry = this._length[j] / 4294967296 | 0, carry > 0 && (this._length[j] -= 4294967296 * carry);\n return this;\n }, HashBase.prototype._update = function() {\n throw new Error(\"_update is not implemented\");\n }, HashBase.prototype.digest = function(encoding) {\n if (this._finalized)\n throw new Error(\"Digest already called\");\n this._finalized = !0;\n var digest = this._digest();\n encoding !== void 0 && (digest = digest.toString(encoding)), this._block.fill(0), this._blockOffset = 0;\n for (var i = 0;i < 4; ++i)\n this._length[i] = 0;\n return digest;\n }, HashBase.prototype._digest = function() {\n throw new Error(\"_digest is not implemented\");\n }, module.exports = HashBase;\n }\n}), require_md5 = __commonJS({\n \"node_modules/md5.js/index.js\"(exports, module) {\n var inherits = require_inherits_browser(), HashBase = require_hash_base(), Buffer2 = require_safe_buffer().Buffer, ARRAY16 = new @Array(16);\n function MD5() {\n HashBase.@call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878;\n }\n inherits(MD5, HashBase), MD5.prototype._update = function() {\n for (var M = ARRAY16, i = 0;i < 16; ++i)\n M[i] = this._block.readInt32LE(i * 4);\n var a = this._a, b = this._b, c = this._c, d = this._d;\n a = fnF(a, b, c, d, M[0], 3614090360, 7), d = fnF(d, a, b, c, M[1], 3905402710, 12), c = fnF(c, d, a, b, M[2], 606105819, 17), b = fnF(b, c, d, a, M[3], 3250441966, 22), a = fnF(a, b, c, d, M[4], 4118548399, 7), d = fnF(d, a, b, c, M[5], 1200080426, 12), c = fnF(c, d, a, b, M[6], 2821735955, 17), b = fnF(b, c, d, a, M[7], 4249261313, 22), a = fnF(a, b, c, d, M[8], 1770035416, 7), d = fnF(d, a, b, c, M[9], 2336552879, 12), c = fnF(c, d, a, b, M[10], 4294925233, 17), b = fnF(b, c, d, a, M[11], 2304563134, 22), a = fnF(a, b, c, d, M[12], 1804603682, 7), d = fnF(d, a, b, c, M[13], 4254626195, 12), c = fnF(c, d, a, b, M[14], 2792965006, 17), b = fnF(b, c, d, a, M[15], 1236535329, 22), a = fnG(a, b, c, d, M[1], 4129170786, 5), d = fnG(d, a, b, c, M[6], 3225465664, 9), c = fnG(c, d, a, b, M[11], 643717713, 14), b = fnG(b, c, d, a, M[0], 3921069994, 20), a = fnG(a, b, c, d, M[5], 3593408605, 5), d = fnG(d, a, b, c, M[10], 38016083, 9), c = fnG(c, d, a, b, M[15], 3634488961, 14), b = fnG(b, c, d, a, M[4], 3889429448, 20), a = fnG(a, b, c, d, M[9], 568446438, 5), d = fnG(d, a, b, c, M[14], 3275163606, 9), c = fnG(c, d, a, b, M[3], 4107603335, 14), b = fnG(b, c, d, a, M[8], 1163531501, 20), a = fnG(a, b, c, d, M[13], 2850285829, 5), d = fnG(d, a, b, c, M[2], 4243563512, 9), c = fnG(c, d, a, b, M[7], 1735328473, 14), b = fnG(b, c, d, a, M[12], 2368359562, 20), a = fnH(a, b, c, d, M[5], 4294588738, 4), d = fnH(d, a, b, c, M[8], 2272392833, 11), c = fnH(c, d, a, b, M[11], 1839030562, 16), b = fnH(b, c, d, a, M[14], 4259657740, 23), a = fnH(a, b, c, d, M[1], 2763975236, 4), d = fnH(d, a, b, c, M[4], 1272893353, 11), c = fnH(c, d, a, b, M[7], 4139469664, 16), b = fnH(b, c, d, a, M[10], 3200236656, 23), a = fnH(a, b, c, d, M[13], 681279174, 4), d = fnH(d, a, b, c, M[0], 3936430074, 11), c = fnH(c, d, a, b, M[3], 3572445317, 16), b = fnH(b, c, d, a, M[6], 76029189, 23), a = fnH(a, b, c, d, M[9], 3654602809, 4), d = fnH(d, a, b, c, M[12], 3873151461, 11), c = fnH(c, d, a, b, M[15], 530742520, 16), b = fnH(b, c, d, a, M[2], 3299628645, 23), a = fnI(a, b, c, d, M[0], 4096336452, 6), d = fnI(d, a, b, c, M[7], 1126891415, 10), c = fnI(c, d, a, b, M[14], 2878612391, 15), b = fnI(b, c, d, a, M[5], 4237533241, 21), a = fnI(a, b, c, d, M[12], 1700485571, 6), d = fnI(d, a, b, c, M[3], 2399980690, 10), c = fnI(c, d, a, b, M[10], 4293915773, 15), b = fnI(b, c, d, a, M[1], 2240044497, 21), a = fnI(a, b, c, d, M[8], 1873313359, 6), d = fnI(d, a, b, c, M[15], 4264355552, 10), c = fnI(c, d, a, b, M[6], 2734768916, 15), b = fnI(b, c, d, a, M[13], 1309151649, 21), a = fnI(a, b, c, d, M[4], 4149444226, 6), d = fnI(d, a, b, c, M[11], 3174756917, 10), c = fnI(c, d, a, b, M[2], 718787259, 15), b = fnI(b, c, d, a, M[9], 3951481745, 21), this._a = this._a + a | 0, this._b = this._b + b | 0, this._c = this._c + c | 0, this._d = this._d + d | 0;\n }, MD5.prototype._digest = function() {\n this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();\n var buffer = Buffer2.allocUnsafe(16);\n return buffer.writeInt32LE(this._a, 0), buffer.writeInt32LE(this._b, 4), buffer.writeInt32LE(this._c, 8), buffer.writeInt32LE(this._d, 12), buffer;\n };\n function rotl(x, n) {\n return x << n | x >>> 32 - n;\n }\n function fnF(a, b, c, d, m, k, s) {\n return rotl(a + (b & c | ~b & d) + m + k | 0, s) + b | 0;\n }\n function fnG(a, b, c, d, m, k, s) {\n return rotl(a + (b & d | c & ~d) + m + k | 0, s) + b | 0;\n }\n function fnH(a, b, c, d, m, k, s) {\n return rotl(a + (b ^ c ^ d) + m + k | 0, s) + b | 0;\n }\n function fnI(a, b, c, d, m, k, s) {\n return rotl(a + (c ^ (b | ~d)) + m + k | 0, s) + b | 0;\n }\n module.exports = MD5;\n }\n}), require_ripemd160 = __commonJS({\n \"node_modules/ripemd160/index.js\"(exports, module) {\n var Buffer2 = Buffer, inherits = require_inherits_browser(), HashBase = require_hash_base(), ARRAY16 = new @Array(16), zl = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 7,\n 4,\n 13,\n 1,\n 10,\n 6,\n 15,\n 3,\n 12,\n 0,\n 9,\n 5,\n 2,\n 14,\n 11,\n 8,\n 3,\n 10,\n 14,\n 4,\n 9,\n 15,\n 8,\n 1,\n 2,\n 7,\n 0,\n 6,\n 13,\n 11,\n 5,\n 12,\n 1,\n 9,\n 11,\n 10,\n 0,\n 8,\n 12,\n 4,\n 13,\n 3,\n 7,\n 15,\n 14,\n 5,\n 6,\n 2,\n 4,\n 0,\n 5,\n 9,\n 7,\n 12,\n 2,\n 10,\n 14,\n 1,\n 3,\n 8,\n 11,\n 6,\n 15,\n 13\n ], zr = [\n 5,\n 14,\n 7,\n 0,\n 9,\n 2,\n 11,\n 4,\n 13,\n 6,\n 15,\n 8,\n 1,\n 10,\n 3,\n 12,\n 6,\n 11,\n 3,\n 7,\n 0,\n 13,\n 5,\n 10,\n 14,\n 15,\n 8,\n 12,\n 4,\n 9,\n 1,\n 2,\n 15,\n 5,\n 1,\n 3,\n 7,\n 14,\n 6,\n 9,\n 11,\n 8,\n 12,\n 2,\n 10,\n 0,\n 4,\n 13,\n 8,\n 6,\n 4,\n 1,\n 3,\n 11,\n 15,\n 0,\n 5,\n 12,\n 2,\n 13,\n 9,\n 7,\n 10,\n 14,\n 12,\n 15,\n 10,\n 4,\n 1,\n 5,\n 8,\n 7,\n 6,\n 2,\n 13,\n 14,\n 0,\n 3,\n 9,\n 11\n ], sl = [\n 11,\n 14,\n 15,\n 12,\n 5,\n 8,\n 7,\n 9,\n 11,\n 13,\n 14,\n 15,\n 6,\n 7,\n 9,\n 8,\n 7,\n 6,\n 8,\n 13,\n 11,\n 9,\n 7,\n 15,\n 7,\n 12,\n 15,\n 9,\n 11,\n 7,\n 13,\n 12,\n 11,\n 13,\n 6,\n 7,\n 14,\n 9,\n 13,\n 15,\n 14,\n 8,\n 13,\n 6,\n 5,\n 12,\n 7,\n 5,\n 11,\n 12,\n 14,\n 15,\n 14,\n 15,\n 9,\n 8,\n 9,\n 14,\n 5,\n 6,\n 8,\n 6,\n 5,\n 12,\n 9,\n 15,\n 5,\n 11,\n 6,\n 8,\n 13,\n 12,\n 5,\n 12,\n 13,\n 14,\n 11,\n 8,\n 5,\n 6\n ], sr = [\n 8,\n 9,\n 9,\n 11,\n 13,\n 15,\n 15,\n 5,\n 7,\n 7,\n 8,\n 11,\n 14,\n 14,\n 12,\n 6,\n 9,\n 13,\n 15,\n 7,\n 12,\n 8,\n 9,\n 11,\n 7,\n 7,\n 12,\n 7,\n 6,\n 15,\n 13,\n 11,\n 9,\n 7,\n 15,\n 11,\n 8,\n 6,\n 6,\n 14,\n 12,\n 13,\n 5,\n 14,\n 13,\n 13,\n 7,\n 5,\n 15,\n 5,\n 8,\n 11,\n 14,\n 14,\n 6,\n 14,\n 6,\n 9,\n 12,\n 9,\n 12,\n 5,\n 15,\n 8,\n 8,\n 5,\n 12,\n 9,\n 12,\n 5,\n 14,\n 6,\n 8,\n 13,\n 6,\n 5,\n 15,\n 13,\n 11,\n 11\n ], hl = [0, 1518500249, 1859775393, 2400959708, 2840853838], hr = [1352829926, 1548603684, 1836072691, 2053994217, 0];\n function RIPEMD160() {\n HashBase.@call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520;\n }\n inherits(RIPEMD160, HashBase), RIPEMD160.prototype._update = function() {\n for (var words = ARRAY16, j = 0;j < 16; ++j)\n words[j] = this._block.readInt32LE(j * 4);\n for (var al = this._a | 0, bl = this._b | 0, cl = this._c | 0, dl = this._d | 0, el = this._e | 0, ar = this._a | 0, br = this._b | 0, cr = this._c | 0, dr = this._d | 0, er = this._e | 0, i = 0;i < 80; i += 1) {\n var tl, tr;\n i < 16 \? (tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i]), tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])) : i < 32 \? (tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i]), tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])) : i < 48 \? (tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i]), tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])) : i < 64 \? (tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i]), tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])) : (tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i]), tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])), al = el, el = dl, dl = rotl(cl, 10), cl = bl, bl = tl, ar = er, er = dr, dr = rotl(cr, 10), cr = br, br = tr;\n }\n var t = this._b + cl + dr | 0;\n this._b = this._c + dl + er | 0, this._c = this._d + el + ar | 0, this._d = this._e + al + br | 0, this._e = this._a + bl + cr | 0, this._a = t;\n }, RIPEMD160.prototype._digest = function() {\n this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();\n var buffer = Buffer2.alloc \? Buffer2.alloc(20) : new Buffer2(20);\n return buffer.writeInt32LE(this._a, 0), buffer.writeInt32LE(this._b, 4), buffer.writeInt32LE(this._c, 8), buffer.writeInt32LE(this._d, 12), buffer.writeInt32LE(this._e, 16), buffer;\n };\n function rotl(x, n) {\n return x << n | x >>> 32 - n;\n }\n function fn1(a, b, c, d, e, m, k, s) {\n return rotl(a + (b ^ c ^ d) + m + k | 0, s) + e | 0;\n }\n function fn2(a, b, c, d, e, m, k, s) {\n return rotl(a + (b & c | ~b & d) + m + k | 0, s) + e | 0;\n }\n function fn3(a, b, c, d, e, m, k, s) {\n return rotl(a + ((b | ~c) ^ d) + m + k | 0, s) + e | 0;\n }\n function fn4(a, b, c, d, e, m, k, s) {\n return rotl(a + (b & d | c & ~d) + m + k | 0, s) + e | 0;\n }\n function fn5(a, b, c, d, e, m, k, s) {\n return rotl(a + (b ^ (c | ~d)) + m + k | 0, s) + e | 0;\n }\n module.exports = RIPEMD160;\n }\n}), require_hash = __commonJS({\n \"node_modules/sha.js/hash.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n function Hash(blockSize, finalSize) {\n this._block = Buffer2.alloc(blockSize), this._finalSize = finalSize, this._blockSize = blockSize, this._len = 0;\n }\n Hash.prototype = {}, Hash.prototype.update = function(data, enc) {\n typeof data == \"string\" && (enc = enc || \"utf8\", data = Buffer2.from(data, enc));\n for (var block = this._block, blockSize = this._blockSize, length = data.length, accum = this._len, offset = 0;offset < length; ) {\n for (var assigned = accum % blockSize, remainder = Math.min(length - offset, blockSize - assigned), i = 0;i < remainder; i++)\n block[assigned + i] = data[offset + i];\n accum += remainder, offset += remainder, accum % blockSize === 0 && this._update(block);\n }\n return this._len += length, this;\n }, Hash.prototype.digest = function(enc) {\n var rem = this._len % this._blockSize;\n this._block[rem] = 128, this._block.fill(0, rem + 1), rem >= this._finalSize && (this._update(this._block), this._block.fill(0));\n var bits = this._len * 8;\n if (bits <= 4294967295)\n this._block.writeUInt32BE(bits, this._blockSize - 4);\n else {\n var lowBits = (bits & 4294967295) >>> 0, highBits = (bits - lowBits) / 4294967296;\n this._block.writeUInt32BE(highBits, this._blockSize - 8), this._block.writeUInt32BE(lowBits, this._blockSize - 4);\n }\n this._update(this._block);\n var hash = this._hash();\n return enc \? hash.toString(enc) : hash;\n }, Hash.prototype._update = function() {\n throw new Error(\"_update must be implemented by subclass\");\n }, module.exports = Hash;\n }\n}), require_sha = __commonJS({\n \"node_modules/sha.js/sha.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [1518500249, 1859775393, -1894007588, -899497514], W = new @Array(80);\n function Sha() {\n this.init(), this._w = W, Hash.@call(this, 64, 56);\n }\n inherits(Sha, Hash), Sha.prototype.init = function() {\n return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;\n };\n function rotl5(num) {\n return num << 5 | num >>> 27;\n }\n function rotl30(num) {\n return num << 30 | num >>> 2;\n }\n function ft(s, b, c, d) {\n return s === 0 \? b & c | ~b & d : s === 2 \? b & c | b & d | c & d : b ^ c ^ d;\n }\n Sha.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 80; ++i)\n W2[i] = W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16];\n for (var j = 0;j < 80; ++j) {\n var s = ~~(j / 20), t = rotl5(a) + ft(s, b, c, d) + e + W2[j] + K[s] | 0;\n e = d, d = c, c = rotl30(b), b = a, a = t;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0;\n }, Sha.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(20);\n return H.writeInt32BE(this._a | 0, 0), H.writeInt32BE(this._b | 0, 4), H.writeInt32BE(this._c | 0, 8), H.writeInt32BE(this._d | 0, 12), H.writeInt32BE(this._e | 0, 16), H;\n }, module.exports = Sha;\n }\n}), require_sha1 = __commonJS({\n \"node_modules/sha.js/sha1.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [1518500249, 1859775393, -1894007588, -899497514], W = new @Array(80);\n function Sha1() {\n this.init(), this._w = W, Hash.@call(this, 64, 56);\n }\n inherits(Sha1, Hash), Sha1.prototype.init = function() {\n return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;\n };\n function rotl1(num) {\n return num << 1 | num >>> 31;\n }\n function rotl5(num) {\n return num << 5 | num >>> 27;\n }\n function rotl30(num) {\n return num << 30 | num >>> 2;\n }\n function ft(s, b, c, d) {\n return s === 0 \? b & c | ~b & d : s === 2 \? b & c | b & d | c & d : b ^ c ^ d;\n }\n Sha1.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 80; ++i)\n W2[i] = rotl1(W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16]);\n for (var j = 0;j < 80; ++j) {\n var s = ~~(j / 20), t = rotl5(a) + ft(s, b, c, d) + e + W2[j] + K[s] | 0;\n e = d, d = c, c = rotl30(b), b = a, a = t;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0;\n }, Sha1.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(20);\n return H.writeInt32BE(this._a | 0, 0), H.writeInt32BE(this._b | 0, 4), H.writeInt32BE(this._c | 0, 8), H.writeInt32BE(this._d | 0, 12), H.writeInt32BE(this._e | 0, 16), H;\n }, module.exports = Sha1;\n }\n}), require_sha256 = __commonJS({\n \"node_modules/sha.js/sha256.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [\n 1116352408,\n 1899447441,\n 3049323471,\n 3921009573,\n 961987163,\n 1508970993,\n 2453635748,\n 2870763221,\n 3624381080,\n 310598401,\n 607225278,\n 1426881987,\n 1925078388,\n 2162078206,\n 2614888103,\n 3248222580,\n 3835390401,\n 4022224774,\n 264347078,\n 604807628,\n 770255983,\n 1249150122,\n 1555081692,\n 1996064986,\n 2554220882,\n 2821834349,\n 2952996808,\n 3210313671,\n 3336571891,\n 3584528711,\n 113926993,\n 338241895,\n 666307205,\n 773529912,\n 1294757372,\n 1396182291,\n 1695183700,\n 1986661051,\n 2177026350,\n 2456956037,\n 2730485921,\n 2820302411,\n 3259730800,\n 3345764771,\n 3516065817,\n 3600352804,\n 4094571909,\n 275423344,\n 430227734,\n 506948616,\n 659060556,\n 883997877,\n 958139571,\n 1322822218,\n 1537002063,\n 1747873779,\n 1955562222,\n 2024104815,\n 2227730452,\n 2361852424,\n 2428436474,\n 2756734187,\n 3204031479,\n 3329325298\n ], W = new @Array(64);\n function Sha256() {\n this.init(), this._w = W, Hash.@call(this, 64, 56);\n }\n inherits(Sha256, Hash), Sha256.prototype.init = function() {\n return this._a = 1779033703, this._b = 3144134277, this._c = 1013904242, this._d = 2773480762, this._e = 1359893119, this._f = 2600822924, this._g = 528734635, this._h = 1541459225, this;\n };\n function ch(x, y, z) {\n return z ^ x & (y ^ z);\n }\n function maj(x, y, z) {\n return x & y | z & (x | y);\n }\n function sigma0(x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10);\n }\n function sigma1(x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7);\n }\n function gamma0(x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ x >>> 3;\n }\n function gamma1(x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ x >>> 10;\n }\n Sha256.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, f = this._f | 0, g = this._g | 0, h = this._h | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 64; ++i)\n W2[i] = gamma1(W2[i - 2]) + W2[i - 7] + gamma0(W2[i - 15]) + W2[i - 16] | 0;\n for (var j = 0;j < 64; ++j) {\n var T1 = h + sigma1(e) + ch(e, f, g) + K[j] + W2[j] | 0, T2 = sigma0(a) + maj(a, b, c) | 0;\n h = g, g = f, f = e, e = d + T1 | 0, d = c, c = b, b = a, a = T1 + T2 | 0;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0, this._f = f + this._f | 0, this._g = g + this._g | 0, this._h = h + this._h | 0;\n }, Sha256.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(32);\n return H.writeInt32BE(this._a, 0), H.writeInt32BE(this._b, 4), H.writeInt32BE(this._c, 8), H.writeInt32BE(this._d, 12), H.writeInt32BE(this._e, 16), H.writeInt32BE(this._f, 20), H.writeInt32BE(this._g, 24), H.writeInt32BE(this._h, 28), H;\n }, module.exports = Sha256;\n }\n}), require_sha224 = __commonJS({\n \"node_modules/sha.js/sha224.js\"(exports, module) {\n var inherits = require_inherits_browser(), Sha256 = require_sha256(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, W = new @Array(64);\n function Sha224() {\n this.init(), this._w = W, Hash.@call(this, 64, 56);\n }\n inherits(Sha224, Sha256), Sha224.prototype.init = function() {\n return this._a = 3238371032, this._b = 914150663, this._c = 812702999, this._d = 4144912697, this._e = 4290775857, this._f = 1750603025, this._g = 1694076839, this._h = 3204075428, this;\n }, Sha224.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(28);\n return H.writeInt32BE(this._a, 0), H.writeInt32BE(this._b, 4), H.writeInt32BE(this._c, 8), H.writeInt32BE(this._d, 12), H.writeInt32BE(this._e, 16), H.writeInt32BE(this._f, 20), H.writeInt32BE(this._g, 24), H;\n }, module.exports = Sha224;\n }\n}), require_sha512 = __commonJS({\n \"node_modules/sha.js/sha512.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [\n 1116352408,\n 3609767458,\n 1899447441,\n 602891725,\n 3049323471,\n 3964484399,\n 3921009573,\n 2173295548,\n 961987163,\n 4081628472,\n 1508970993,\n 3053834265,\n 2453635748,\n 2937671579,\n 2870763221,\n 3664609560,\n 3624381080,\n 2734883394,\n 310598401,\n 1164996542,\n 607225278,\n 1323610764,\n 1426881987,\n 3590304994,\n 1925078388,\n 4068182383,\n 2162078206,\n 991336113,\n 2614888103,\n 633803317,\n 3248222580,\n 3479774868,\n 3835390401,\n 2666613458,\n 4022224774,\n 944711139,\n 264347078,\n 2341262773,\n 604807628,\n 2007800933,\n 770255983,\n 1495990901,\n 1249150122,\n 1856431235,\n 1555081692,\n 3175218132,\n 1996064986,\n 2198950837,\n 2554220882,\n 3999719339,\n 2821834349,\n 766784016,\n 2952996808,\n 2566594879,\n 3210313671,\n 3203337956,\n 3336571891,\n 1034457026,\n 3584528711,\n 2466948901,\n 113926993,\n 3758326383,\n 338241895,\n 168717936,\n 666307205,\n 1188179964,\n 773529912,\n 1546045734,\n 1294757372,\n 1522805485,\n 1396182291,\n 2643833823,\n 1695183700,\n 2343527390,\n 1986661051,\n 1014477480,\n 2177026350,\n 1206759142,\n 2456956037,\n 344077627,\n 2730485921,\n 1290863460,\n 2820302411,\n 3158454273,\n 3259730800,\n 3505952657,\n 3345764771,\n 106217008,\n 3516065817,\n 3606008344,\n 3600352804,\n 1432725776,\n 4094571909,\n 1467031594,\n 275423344,\n 851169720,\n 430227734,\n 3100823752,\n 506948616,\n 1363258195,\n 659060556,\n 3750685593,\n 883997877,\n 3785050280,\n 958139571,\n 3318307427,\n 1322822218,\n 3812723403,\n 1537002063,\n 2003034995,\n 1747873779,\n 3602036899,\n 1955562222,\n 1575990012,\n 2024104815,\n 1125592928,\n 2227730452,\n 2716904306,\n 2361852424,\n 442776044,\n 2428436474,\n 593698344,\n 2756734187,\n 3733110249,\n 3204031479,\n 2999351573,\n 3329325298,\n 3815920427,\n 3391569614,\n 3928383900,\n 3515267271,\n 566280711,\n 3940187606,\n 3454069534,\n 4118630271,\n 4000239992,\n 116418474,\n 1914138554,\n 174292421,\n 2731055270,\n 289380356,\n 3203993006,\n 460393269,\n 320620315,\n 685471733,\n 587496836,\n 852142971,\n 1086792851,\n 1017036298,\n 365543100,\n 1126000580,\n 2618297676,\n 1288033470,\n 3409855158,\n 1501505948,\n 4234509866,\n 1607167915,\n 987167468,\n 1816402316,\n 1246189591\n ], W = new @Array(160);\n function Sha512() {\n this.init(), this._w = W, Hash.@call(this, 128, 112);\n }\n inherits(Sha512, Hash), Sha512.prototype.init = function() {\n return this._ah = 1779033703, this._bh = 3144134277, this._ch = 1013904242, this._dh = 2773480762, this._eh = 1359893119, this._fh = 2600822924, this._gh = 528734635, this._hh = 1541459225, this._al = 4089235720, this._bl = 2227873595, this._cl = 4271175723, this._dl = 1595750129, this._el = 2917565137, this._fl = 725511199, this._gl = 4215389547, this._hl = 327033209, this;\n };\n function Ch(x, y, z) {\n return z ^ x & (y ^ z);\n }\n function maj(x, y, z) {\n return x & y | z & (x | y);\n }\n function sigma0(x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25);\n }\n function sigma1(x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23);\n }\n function Gamma0(x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ x >>> 7;\n }\n function Gamma0l(x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25);\n }\n function Gamma1(x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ x >>> 6;\n }\n function Gamma1l(x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26);\n }\n function getCarry(a, b) {\n return a >>> 0 < b >>> 0 \? 1 : 0;\n }\n Sha512.prototype._update = function(M) {\n for (var W2 = this._w, ah = this._ah | 0, bh = this._bh | 0, ch = this._ch | 0, dh = this._dh | 0, eh = this._eh | 0, fh = this._fh | 0, gh = this._gh | 0, hh = this._hh | 0, al = this._al | 0, bl = this._bl | 0, cl = this._cl | 0, dl = this._dl | 0, el = this._el | 0, fl = this._fl | 0, gl = this._gl | 0, hl = this._hl | 0, i = 0;i < 32; i += 2)\n W2[i] = M.readInt32BE(i * 4), W2[i + 1] = M.readInt32BE(i * 4 + 4);\n for (;i < 160; i += 2) {\n var xh = W2[i - 30], xl = W2[i - 30 + 1], gamma0 = Gamma0(xh, xl), gamma0l = Gamma0l(xl, xh);\n xh = W2[i - 4], xl = W2[i - 4 + 1];\n var gamma1 = Gamma1(xh, xl), gamma1l = Gamma1l(xl, xh), Wi7h = W2[i - 14], Wi7l = W2[i - 14 + 1], Wi16h = W2[i - 32], Wi16l = W2[i - 32 + 1], Wil = gamma0l + Wi7l | 0, Wih = gamma0 + Wi7h + getCarry(Wil, gamma0l) | 0;\n Wil = Wil + gamma1l | 0, Wih = Wih + gamma1 + getCarry(Wil, gamma1l) | 0, Wil = Wil + Wi16l | 0, Wih = Wih + Wi16h + getCarry(Wil, Wi16l) | 0, W2[i] = Wih, W2[i + 1] = Wil;\n }\n for (var j = 0;j < 160; j += 2) {\n Wih = W2[j], Wil = W2[j + 1];\n var majh = maj(ah, bh, ch), majl = maj(al, bl, cl), sigma0h = sigma0(ah, al), sigma0l = sigma0(al, ah), sigma1h = sigma1(eh, el), sigma1l = sigma1(el, eh), Kih = K[j], Kil = K[j + 1], chh = Ch(eh, fh, gh), chl = Ch(el, fl, gl), t1l = hl + sigma1l | 0, t1h = hh + sigma1h + getCarry(t1l, hl) | 0;\n t1l = t1l + chl | 0, t1h = t1h + chh + getCarry(t1l, chl) | 0, t1l = t1l + Kil | 0, t1h = t1h + Kih + getCarry(t1l, Kil) | 0, t1l = t1l + Wil | 0, t1h = t1h + Wih + getCarry(t1l, Wil) | 0;\n var t2l = sigma0l + majl | 0, t2h = sigma0h + majh + getCarry(t2l, sigma0l) | 0;\n hh = gh, hl = gl, gh = fh, gl = fl, fh = eh, fl = el, el = dl + t1l | 0, eh = dh + t1h + getCarry(el, dl) | 0, dh = ch, dl = cl, ch = bh, cl = bl, bh = ah, bl = al, al = t1l + t2l | 0, ah = t1h + t2h + getCarry(al, t1l) | 0;\n }\n this._al = this._al + al | 0, this._bl = this._bl + bl | 0, this._cl = this._cl + cl | 0, this._dl = this._dl + dl | 0, this._el = this._el + el | 0, this._fl = this._fl + fl | 0, this._gl = this._gl + gl | 0, this._hl = this._hl + hl | 0, this._ah = this._ah + ah + getCarry(this._al, al) | 0, this._bh = this._bh + bh + getCarry(this._bl, bl) | 0, this._ch = this._ch + ch + getCarry(this._cl, cl) | 0, this._dh = this._dh + dh + getCarry(this._dl, dl) | 0, this._eh = this._eh + eh + getCarry(this._el, el) | 0, this._fh = this._fh + fh + getCarry(this._fl, fl) | 0, this._gh = this._gh + gh + getCarry(this._gl, gl) | 0, this._hh = this._hh + hh + getCarry(this._hl, hl) | 0;\n }, Sha512.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(64);\n function writeInt64BE(h, l, offset) {\n H.writeInt32BE(h, offset), H.writeInt32BE(l, offset + 4);\n }\n return writeInt64BE(this._ah, this._al, 0), writeInt64BE(this._bh, this._bl, 8), writeInt64BE(this._ch, this._cl, 16), writeInt64BE(this._dh, this._dl, 24), writeInt64BE(this._eh, this._el, 32), writeInt64BE(this._fh, this._fl, 40), writeInt64BE(this._gh, this._gl, 48), writeInt64BE(this._hh, this._hl, 56), H;\n }, module.exports = Sha512;\n }\n}), require_sha384 = __commonJS({\n \"node_modules/sha.js/sha384.js\"(exports, module) {\n var inherits = require_inherits_browser(), SHA512 = require_sha512(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, W = new @Array(160);\n function Sha384() {\n this.init(), this._w = W, Hash.@call(this, 128, 112);\n }\n inherits(Sha384, SHA512), Sha384.prototype.init = function() {\n return this._ah = 3418070365, this._bh = 1654270250, this._ch = 2438529370, this._dh = 355462360, this._eh = 1731405415, this._fh = 2394180231, this._gh = 3675008525, this._hh = 1203062813, this._al = 3238371032, this._bl = 914150663, this._cl = 812702999, this._dl = 4144912697, this._el = 4290775857, this._fl = 1750603025, this._gl = 1694076839, this._hl = 3204075428, this;\n }, Sha384.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(48);\n function writeInt64BE(h, l, offset) {\n H.writeInt32BE(h, offset), H.writeInt32BE(l, offset + 4);\n }\n return writeInt64BE(this._ah, this._al, 0), writeInt64BE(this._bh, this._bl, 8), writeInt64BE(this._ch, this._cl, 16), writeInt64BE(this._dh, this._dl, 24), writeInt64BE(this._eh, this._el, 32), writeInt64BE(this._fh, this._fl, 40), H;\n }, module.exports = Sha384;\n }\n}), require_sha2 = __commonJS({\n \"node_modules/sha.js/index.js\"(exports, module) {\n var exports = module.exports = function(algorithm) {\n algorithm = algorithm.toLowerCase();\n var Algorithm = exports[algorithm];\n if (!Algorithm)\n throw new Error(algorithm + \" is not supported (we accept pull requests)\");\n return new Algorithm;\n };\n exports.sha = require_sha(), exports.sha1 = require_sha1(), exports.sha224 = require_sha224(), exports.sha256 = require_sha256(), exports.sha384 = require_sha384(), exports.sha512 = require_sha512();\n }\n}), require_cipher_base = __commonJS({\n \"node_modules/cipher-base/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, inherits = require_inherits_browser();\n function CipherBase(hashMode) {\n StreamModule.Transform.@call(this), this.hashMode = typeof hashMode == \"string\", this.hashMode \? this[hashMode] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null, this._finalized = !1;\n }\n inherits(CipherBase, StreamModule.Transform), CipherBase.prototype.update = function(data, inputEnc, outputEnc) {\n if (outputEnc === \"buffer\")\n outputEnc = @undefined;\n typeof data == \"string\" && (data = Buffer2.from(data, inputEnc));\n var outData = this._update(data);\n return this.hashMode \? this : (outputEnc && (outData = this._toString(outData, outputEnc)), outData);\n }, CipherBase.prototype.setAutoPadding = function() {\n }, CipherBase.prototype.getAuthTag = function() {\n throw new Error(\"trying to get auth tag in unsupported state\");\n }, CipherBase.prototype.setAuthTag = function() {\n throw new Error(\"trying to set auth tag in unsupported state\");\n }, CipherBase.prototype.setAAD = function() {\n throw new Error(\"trying to set aad in unsupported state\");\n }, CipherBase.prototype._transform = function(data, _, next) {\n var err;\n try {\n this.hashMode \? this._update(data) : this.push(this._update(data));\n } catch (e) {\n err = e;\n } finally {\n next(err);\n }\n }, CipherBase.prototype._flush = function(done) {\n var err;\n try {\n this.push(this.__final());\n } catch (e) {\n err = e;\n }\n done(err);\n }, CipherBase.prototype._finalOrDigest = function(outputEnc) {\n if (outputEnc === \"buffer\")\n outputEnc = @undefined;\n if (this._finalized) {\n if (!this._encoding)\n return Buffer2.alloc(0);\n return \"\";\n }\n this._finalized = !0;\n var outData = this.__final() || Buffer2.alloc(0);\n return outputEnc && (outData = this._toString(outData, outputEnc, !0)), outData;\n }, CipherBase.prototype._toString = function(value, enc, fin) {\n if (this._decoder || (this._decoder = new StringDecoder(enc), this._encoding = enc), this._encoding !== enc)\n throw new Error(\"can't switch encodings\");\n var out = this._decoder.write(value);\n return fin && (out += this._decoder.end()), out;\n }, module.exports = CipherBase;\n }\n}), require_browser2 = __commonJS({\n \"node_modules/create-hash/browser.js\"(exports, module) {\n const LazyHash = function Hash(algorithm, options) {\n this._options = options, this._hasher = new CryptoHasher(algorithm, options), this._finalized = !1;\n };\n LazyHash.prototype = Object.create(StreamModule.Transform.prototype), LazyHash.prototype.update = function update(data, encoding) {\n return this._checkFinalized(), this._hasher.update(data, encoding), this;\n }, LazyHash.prototype.digest = function update(data, encoding) {\n return this._checkFinalized(), this._finalized = !0, this._hasher.digest(data, encoding);\n }, LazyHash.prototype._checkFinalized = function _checkFinalized() {\n if (this._finalized) {\n var err = new Error(\"Digest already called\");\n throw err.code = \"ERR_CRYPTO_HASH_FINALIZED\", err;\n }\n }, LazyHash.prototype.copy = function copy() {\n const copy = Object.create(LazyHash.prototype);\n return copy._options = this._options, copy._hasher = this._hasher.copy(), copy._finalized = this._finalized, copy;\n };\n const lazyHashFullInitProto = {\n __proto__: StreamModule.Transform.prototype,\n ...LazyHash.prototype,\n _transform(data, encoding, callback) {\n this.update(data, encoding), callback && callback();\n },\n _flush(callback) {\n this.push(this.digest()), callback();\n }\n }, triggerMethods = [\n \"_events\",\n \"_eventsCount\",\n \"_final\",\n \"_maxListeners\",\n \"_maxListeners\",\n \"_read\",\n \"_undestroy\",\n \"_writableState\",\n \"_write\",\n \"_writev\",\n \"addListener\",\n \"asIndexedPairs\",\n \"closed\",\n \"compose\",\n \"constructor\",\n \"cork\",\n \"destroy\",\n \"destroyed\",\n \"drop\",\n \"emit\",\n \"end\",\n \"errored\",\n \"eventNames\",\n \"every\",\n \"filter\",\n \"find\",\n \"flatMap\",\n \"forEach\",\n \"getMaxListeners\",\n \"hasOwnProperty\",\n \"isPaused\",\n \"isPrototypeOf\",\n \"iterator\",\n \"listenerCount\",\n \"listeners\",\n \"map\",\n \"off\",\n \"on\",\n \"once\",\n \"pause\",\n \"pipe\",\n \"prependListener\",\n \"prependOnceListener\",\n \"propertyIsEnumerable\",\n \"push\",\n \"rawListeners\",\n \"read\",\n \"readable\",\n \"readableAborted\",\n \"readableBuffer\",\n \"readableDidRead\",\n \"readableEncoding\",\n \"readableEnded\",\n \"readableFlowing\",\n \"readableHighWaterMark\",\n \"readableLength\",\n \"readableObjectMode\",\n \"reduce\",\n \"removeAllListeners\",\n \"removeListener\",\n \"resume\",\n \"setDefaultEncoding\",\n \"setEncoding\",\n \"setMaxListeners\",\n \"some\",\n \"take\",\n \"toArray\",\n \"toLocaleString\",\n \"toString\",\n \"uncork\",\n \"unpipe\",\n \"unshift\",\n \"valueOf\",\n \"wrap\",\n \"writable\",\n \"writableBuffer\",\n \"writableCorked\",\n \"writableEnded\",\n \"writableFinished\",\n \"writableHighWaterMark\",\n \"writableLength\",\n \"writableNeedDrain\",\n \"writableObjectMode\",\n \"write\"\n ];\n for (let method of triggerMethods)\n Object.defineProperty(LazyHash.prototype, method, {\n get() {\n return Object.setPrototypeOf(this, lazyHashFullInitProto), StreamModule.Transform.@call(this, this._options), this[method];\n },\n enumerable: !1,\n configurable: !0\n });\n module.exports = function createHash(algorithm) {\n return new LazyHash(algorithm);\n }, module.exports.createHash = module.exports, module.exports.Hash = LazyHash;\n }\n}), require_legacy = __commonJS({\n \"node_modules/create-hmac/legacy.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safe_buffer().Buffer, Base = require_cipher_base(), ZEROS = Buffer2.alloc(128), blocksize = 64;\n function Hmac(alg, key2) {\n key2 = exportIfKeyObject(key2), Base.@call(this, \"digest\"), typeof key2 == \"string\" && (key2 = Buffer2.from(key2)), this._alg = alg, this._key = key2, key2.length > blocksize \? key2 = alg(key2) : key2.length < blocksize && (key2 = Buffer2.concat([key2, ZEROS], blocksize));\n for (var ipad = this._ipad = Buffer2.allocUnsafe(blocksize), opad = this._opad = Buffer2.allocUnsafe(blocksize), i = 0;i < blocksize; i++)\n ipad[i] = key2[i] ^ 54, opad[i] = key2[i] ^ 92;\n this._hash = [ipad];\n }\n Hmac.prototype = {}, inherits(Hmac, Base), Hmac.prototype._update = function(data) {\n this._hash.push(data);\n }, Hmac.prototype._final = function() {\n var h = this._alg(Buffer2.concat(this._hash));\n return this._alg(Buffer2.concat([this._opad, h]));\n }, module.exports = Hmac;\n }\n}), require_md52 = __commonJS({\n \"node_modules/create-hash/md5.js\"(exports, module) {\n var MD5 = require_md5();\n module.exports = function(buffer) {\n return new MD5().update(buffer).digest();\n };\n }\n}), require_browser3 = __commonJS({\n \"node_modules/create-hmac/browser.js\"(exports, module) {\n var inherits = require_inherits_browser(), Legacy = require_legacy(), Base = require_cipher_base(), Buffer2 = require_safe_buffer().Buffer, md5 = require_md52(), RIPEMD160 = require_ripemd160(), sha = require_sha2(), ZEROS = Buffer2.alloc(128);\n function Hmac(alg, key2) {\n key2 = exportIfKeyObject(key2), Base.@call(this, \"digest\"), typeof key2 == \"string\" && (key2 = Buffer2.from(key2));\n var blocksize = alg === \"sha512\" || alg === \"sha384\" \? 128 : 64;\n if (this._alg = alg, this._key = key2, key2.length > blocksize) {\n var hash = alg === \"rmd160\" \? new RIPEMD160 : sha(alg);\n key2 = hash.update(key2).digest();\n } else\n key2.length < blocksize && (key2 = Buffer2.concat([key2, ZEROS], blocksize));\n for (var ipad = this._ipad = Buffer2.allocUnsafe(blocksize), opad = this._opad = Buffer2.allocUnsafe(blocksize), i = 0;i < blocksize; i++)\n ipad[i] = key2[i] ^ 54, opad[i] = key2[i] ^ 92;\n this._hash = alg === \"rmd160\" \? new RIPEMD160 : sha(alg), this._hash.update(ipad);\n }\n inherits(Hmac, Base), Hmac.prototype._update = function(data) {\n this._hash.update(data);\n }, Hmac.prototype._final = function() {\n var h = this._hash.digest(), hash = this._alg === \"rmd160\" \? new RIPEMD160 : sha(this._alg);\n return hash.update(this._opad).update(h).digest();\n }, module.exports = function(alg, key2) {\n return key2 = exportIfKeyObject(key2), alg = alg.toLowerCase(), alg === \"rmd160\" || alg === \"ripemd160\" \? new Hmac(\"rmd160\", key2) : alg === \"md5\" \? new Legacy(md5, key2) : new Hmac(alg, key2);\n };\n }\n}), require_algorithms = __commonJS({\n \"node_modules/browserify-sign/browser/algorithms.json\"(exports, module) {\n module.exports = {\n sha224WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha224\",\n id: \"302d300d06096086480165030402040500041c\"\n },\n \"RSA-SHA224\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha224\",\n id: \"302d300d06096086480165030402040500041c\"\n },\n sha256WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha256\",\n id: \"3031300d060960864801650304020105000420\"\n },\n \"RSA-SHA256\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha256\",\n id: \"3031300d060960864801650304020105000420\"\n },\n sha384WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha384\",\n id: \"3041300d060960864801650304020205000430\"\n },\n \"RSA-SHA384\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha384\",\n id: \"3041300d060960864801650304020205000430\"\n },\n sha512WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha512\",\n id: \"3051300d060960864801650304020305000440\"\n },\n \"RSA-SHA512\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha512\",\n id: \"3051300d060960864801650304020305000440\"\n },\n \"RSA-SHA1\": {\n sign: \"rsa\",\n hash: \"sha1\",\n id: \"3021300906052b0e03021a05000414\"\n },\n \"ecdsa-with-SHA1\": {\n sign: \"ecdsa\",\n hash: \"sha1\",\n id: \"\"\n },\n sha1: {\n sign: \"ecdsa/rsa\",\n hash: \"sha1\",\n id: \"\"\n },\n sha256: {\n sign: \"ecdsa/rsa\",\n hash: \"sha256\",\n id: \"\"\n },\n sha224: {\n sign: \"ecdsa/rsa\",\n hash: \"sha224\",\n id: \"\"\n },\n sha384: {\n sign: \"ecdsa/rsa\",\n hash: \"sha384\",\n id: \"\"\n },\n sha512: {\n sign: \"ecdsa/rsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-SHA\": {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n \"DSA-SHA1\": {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n DSA: {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n \"DSA-WITH-SHA224\": {\n sign: \"dsa\",\n hash: \"sha224\",\n id: \"\"\n },\n \"DSA-SHA224\": {\n sign: \"dsa\",\n hash: \"sha224\",\n id: \"\"\n },\n \"DSA-WITH-SHA256\": {\n sign: \"dsa\",\n hash: \"sha256\",\n id: \"\"\n },\n \"DSA-SHA256\": {\n sign: \"dsa\",\n hash: \"sha256\",\n id: \"\"\n },\n \"DSA-WITH-SHA384\": {\n sign: \"dsa\",\n hash: \"sha384\",\n id: \"\"\n },\n \"DSA-SHA384\": {\n sign: \"dsa\",\n hash: \"sha384\",\n id: \"\"\n },\n \"DSA-WITH-SHA512\": {\n sign: \"dsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-SHA512\": {\n sign: \"dsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-RIPEMD160\": {\n sign: \"dsa\",\n hash: \"rmd160\",\n id: \"\"\n },\n ripemd160WithRSA: {\n sign: \"rsa\",\n hash: \"rmd160\",\n id: \"3021300906052b2403020105000414\"\n },\n \"RSA-RIPEMD160\": {\n sign: \"rsa\",\n hash: \"rmd160\",\n id: \"3021300906052b2403020105000414\"\n },\n md5WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"md5\",\n id: \"3020300c06082a864886f70d020505000410\"\n },\n \"RSA-MD5\": {\n sign: \"rsa\",\n hash: \"md5\",\n id: \"3020300c06082a864886f70d020505000410\"\n }\n };\n }\n}), require_algos = __commonJS({\n \"node_modules/browserify-sign/algos.js\"(exports, module) {\n module.exports = require_algorithms();\n }\n}), require_precondition = __commonJS({\n \"node_modules/pbkdf2/lib/precondition.js\"(exports, module) {\n var MAX_ALLOC = Math.pow(2, 30) - 1;\n module.exports = function(iterations, keylen) {\n if (typeof iterations != \"number\")\n @throwTypeError(\"Iterations not a number\");\n if (iterations < 0)\n @throwTypeError(\"Bad iterations\");\n if (typeof keylen != \"number\")\n @throwTypeError(\"Key length not a number\");\n if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen)\n @throwTypeError(\"Bad key length\");\n };\n }\n}), require_default_encoding = __commonJS({\n \"node_modules/pbkdf2/lib/default-encoding.js\"(exports, module) {\n var defaultEncoding;\n global.process && global.process.browser \? defaultEncoding = \"utf-8\" : global.process && global.process.version \? (pVersionMajor = parseInt(process.version.split(\".\")[0].slice(1), 10), defaultEncoding = pVersionMajor >= 6 \? \"utf-8\" : \"binary\") : defaultEncoding = \"utf-8\";\n var pVersionMajor;\n module.exports = defaultEncoding;\n }\n}), require_to_buffer = __commonJS({\n \"node_modules/pbkdf2/lib/to-buffer.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(thing, encoding, name) {\n if (Buffer2.isBuffer(thing))\n return thing;\n if (typeof thing == \"string\")\n return Buffer2.from(thing, encoding);\n if (@ArrayBuffer.isView(thing))\n return Buffer2.from(thing.buffer);\n @throwTypeError(name + \" must be a string, a Buffer, a typed array or a DataView\");\n };\n }\n}), require_sync_browser = __commonJS({\n \"node_modules/pbkdf2/lib/sync-browser.js\"(exports, module) {\n var md5 = require_md52(), RIPEMD160 = require_ripemd160(), sha = require_sha2(), Buffer2 = require_safe_buffer().Buffer, checkParameters = require_precondition(), defaultEncoding = require_default_encoding(), toBuffer = require_to_buffer(), ZEROS = Buffer2.alloc(128), sizes = {\n md5: 16,\n sha1: 20,\n sha224: 28,\n sha256: 32,\n sha384: 48,\n sha512: 64,\n rmd160: 20,\n ripemd160: 20\n };\n function Hmac(alg, key2, saltLen) {\n key2 = exportIfKeyObject(key2);\n var hash = getDigest(alg), blocksize = alg === \"sha512\" || alg === \"sha384\" \? 128 : 64;\n key2.length > blocksize \? key2 = hash(key2) : key2.length < blocksize && (key2 = Buffer2.concat([key2, ZEROS], blocksize));\n for (var ipad = Buffer2.allocUnsafe(blocksize + sizes[alg]), opad = Buffer2.allocUnsafe(blocksize + sizes[alg]), i = 0;i < blocksize; i++)\n ipad[i] = key2[i] ^ 54, opad[i] = key2[i] ^ 92;\n var ipad1 = Buffer2.allocUnsafe(blocksize + saltLen + 4);\n ipad.copy(ipad1, 0, 0, blocksize), this.ipad1 = ipad1, this.ipad2 = ipad, this.opad = opad, this.alg = alg, this.blocksize = blocksize, this.hash = hash, this.size = sizes[alg];\n }\n Hmac.prototype = {}, Hmac.prototype.run = function(data, ipad) {\n data.copy(ipad, this.blocksize);\n var h = this.hash(ipad);\n return h.copy(this.opad, this.blocksize), this.hash(this.opad);\n };\n function getDigest(alg) {\n function shaFunc(data) {\n return sha(alg).update(data).digest();\n }\n function rmd160Func(data) {\n return new RIPEMD160().update(data).digest();\n }\n return alg === \"rmd160\" || alg === \"ripemd160\" \? rmd160Func : alg === \"md5\" \? md5 : shaFunc;\n }\n function pbkdf2(password, salt, iterations, keylen, digest) {\n checkParameters(iterations, keylen), password = toBuffer(password, defaultEncoding, \"Password\"), salt = toBuffer(salt, defaultEncoding, \"Salt\"), digest = digest || \"sha1\";\n var hmac = new Hmac(digest, password, salt.length), DK = Buffer2.allocUnsafe(keylen), block1 = Buffer2.allocUnsafe(salt.length + 4);\n salt.copy(block1, 0, 0, salt.length);\n for (var destPos = 0, hLen = sizes[digest], l = Math.ceil(keylen / hLen), i = 1;i <= l; i++) {\n block1.writeUInt32BE(i, salt.length);\n for (var T = hmac.run(block1, hmac.ipad1), U = T, j = 1;j < iterations; j++) {\n U = hmac.run(U, hmac.ipad2);\n for (var k = 0;k < hLen; k++)\n T[k] ^= U[k];\n }\n T.copy(DK, destPos), destPos += hLen;\n }\n return DK;\n }\n module.exports = pbkdf2;\n }\n}), require_async = __commonJS({\n \"node_modules/pbkdf2/lib/async.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, checkParameters = require_precondition(), defaultEncoding = require_default_encoding(), sync = require_sync_browser(), toBuffer = require_to_buffer(), ZERO_BUF, subtle = globalCrypto.subtle, toBrowser = {\n sha: \"SHA-1\",\n \"sha-1\": \"SHA-1\",\n sha1: \"SHA-1\",\n sha256: \"SHA-256\",\n \"sha-256\": \"SHA-256\",\n sha384: \"SHA-384\",\n \"sha-384\": \"SHA-384\",\n \"sha-512\": \"SHA-512\",\n sha512: \"SHA-512\"\n }, checks = [];\n function checkNative(algo) {\n if (global.process && !global.process.browser || !subtle || !subtle.importKey || !subtle.deriveBits)\n return @Promise.resolve(!1);\n if (checks[algo] !== void 0)\n return checks[algo];\n ZERO_BUF = ZERO_BUF || Buffer2.alloc(8);\n var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo).then(function() {\n return !0;\n }).catch(function() {\n return !1;\n });\n return checks[algo] = prom, prom;\n }\n var nextTick;\n function getNextTick() {\n return nextTick || (global.process && global.process.nextTick \? nextTick = global.process.nextTick : global.queueMicrotask \? nextTick = global.queueMicrotask : global.setImmediate \? nextTick = global.setImmediate : nextTick = global.setTimeout, nextTick);\n }\n function browserPbkdf2(password, salt, iterations, length, algo) {\n return subtle.importKey(\"raw\", password, { name: \"PBKDF2\" }, !1, [\"deriveBits\"]).then(function(key2) {\n return subtle.deriveBits({\n name: \"PBKDF2\",\n salt,\n iterations,\n hash: {\n name: algo\n }\n }, key2, length << 3);\n }).then(function(res) {\n return Buffer2.from(res);\n });\n }\n function resolvePromise(promise, callback) {\n promise.then(function(out) {\n getNextTick()(function() {\n callback(null, out);\n });\n }, function(e) {\n getNextTick()(function() {\n callback(e);\n });\n });\n }\n module.exports = function(password, salt, iterations, keylen, digest, callback) {\n typeof digest == \"function\" && (callback = digest, digest = void 0), digest = digest || \"sha1\";\n var algo = toBrowser[digest.toLowerCase()];\n if (!algo || typeof global.Promise != \"function\") {\n getNextTick()(function() {\n var out;\n try {\n out = sync(password, salt, iterations, keylen, digest);\n } catch (e) {\n return callback(e);\n }\n callback(null, out);\n });\n return;\n }\n if (checkParameters(iterations, keylen), password = toBuffer(password, defaultEncoding, \"Password\"), salt = toBuffer(salt, defaultEncoding, \"Salt\"), typeof callback != \"function\")\n throw new Error(\"No callback provided to pbkdf2\");\n resolvePromise(checkNative(algo).then(function(resp) {\n return resp \? browserPbkdf2(password, salt, iterations, keylen, algo) : sync(password, salt, iterations, keylen, digest);\n }), callback);\n };\n }\n}), require_browser4 = __commonJS({\n \"node_modules/pbkdf2/browser.js\"(exports) {\n exports.pbkdf2 = require_async(), exports.pbkdf2Sync = require_sync_browser();\n }\n}), require_utils = __commonJS({\n \"node_modules/des.js/lib/des/utils.js\"(exports) {\n exports.readUInt32BE = function(bytes, off) {\n var res = bytes[0 + off] << 24 | bytes[1 + off] << 16 | bytes[2 + off] << 8 | bytes[3 + off];\n return res >>> 0;\n }, exports.writeUInt32BE = function(bytes, value, off) {\n bytes[0 + off] = value >>> 24, bytes[1 + off] = value >>> 16 & 255, bytes[2 + off] = value >>> 8 & 255, bytes[3 + off] = value & 255;\n }, exports.ip = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 6;i >= 0; i -= 2) {\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >>> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inL >>> j + i & 1;\n }\n for (var i = 6;i >= 0; i -= 2) {\n for (var j = 1;j <= 25; j += 8)\n outR <<= 1, outR |= inR >>> j + i & 1;\n for (var j = 1;j <= 25; j += 8)\n outR <<= 1, outR |= inL >>> j + i & 1;\n }\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.rip = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 0;i < 4; i++)\n for (var j = 24;j >= 0; j -= 8)\n outL <<= 1, outL |= inR >>> j + i & 1, outL <<= 1, outL |= inL >>> j + i & 1;\n for (var i = 4;i < 8; i++)\n for (var j = 24;j >= 0; j -= 8)\n outR <<= 1, outR |= inR >>> j + i & 1, outR <<= 1, outR |= inL >>> j + i & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.pc1 = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 7;i >= 5; i--) {\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inL >> j + i & 1;\n }\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >> j + i & 1;\n for (var i = 1;i <= 3; i++) {\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inR >> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inL >> j + i & 1;\n }\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inL >> j + i & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.r28shl = function(num, shift) {\n return num << shift & 268435455 | num >>> 28 - shift;\n };\n var pc2table = [\n 14,\n 11,\n 17,\n 4,\n 27,\n 23,\n 25,\n 0,\n 13,\n 22,\n 7,\n 18,\n 5,\n 9,\n 16,\n 24,\n 2,\n 20,\n 12,\n 21,\n 1,\n 8,\n 15,\n 26,\n 15,\n 4,\n 25,\n 19,\n 9,\n 1,\n 26,\n 16,\n 5,\n 11,\n 23,\n 8,\n 12,\n 7,\n 17,\n 0,\n 22,\n 3,\n 10,\n 14,\n 6,\n 20,\n 27,\n 24\n ];\n exports.pc2 = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, len = pc2table.length >>> 1, i = 0;i < len; i++)\n outL <<= 1, outL |= inL >>> pc2table[i] & 1;\n for (var i = len;i < pc2table.length; i++)\n outR <<= 1, outR |= inR >>> pc2table[i] & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.expand = function(r, out, off) {\n var outL = 0, outR = 0;\n outL = (r & 1) << 5 | r >>> 27;\n for (var i = 23;i >= 15; i -= 4)\n outL <<= 6, outL |= r >>> i & 63;\n for (var i = 11;i >= 3; i -= 4)\n outR |= r >>> i & 63, outR <<= 6;\n outR |= (r & 31) << 1 | r >>> 31, out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n };\n var sTable = [\n 14,\n 0,\n 4,\n 15,\n 13,\n 7,\n 1,\n 4,\n 2,\n 14,\n 15,\n 2,\n 11,\n 13,\n 8,\n 1,\n 3,\n 10,\n 10,\n 6,\n 6,\n 12,\n 12,\n 11,\n 5,\n 9,\n 9,\n 5,\n 0,\n 3,\n 7,\n 8,\n 4,\n 15,\n 1,\n 12,\n 14,\n 8,\n 8,\n 2,\n 13,\n 4,\n 6,\n 9,\n 2,\n 1,\n 11,\n 7,\n 15,\n 5,\n 12,\n 11,\n 9,\n 3,\n 7,\n 14,\n 3,\n 10,\n 10,\n 0,\n 5,\n 6,\n 0,\n 13,\n 15,\n 3,\n 1,\n 13,\n 8,\n 4,\n 14,\n 7,\n 6,\n 15,\n 11,\n 2,\n 3,\n 8,\n 4,\n 14,\n 9,\n 12,\n 7,\n 0,\n 2,\n 1,\n 13,\n 10,\n 12,\n 6,\n 0,\n 9,\n 5,\n 11,\n 10,\n 5,\n 0,\n 13,\n 14,\n 8,\n 7,\n 10,\n 11,\n 1,\n 10,\n 3,\n 4,\n 15,\n 13,\n 4,\n 1,\n 2,\n 5,\n 11,\n 8,\n 6,\n 12,\n 7,\n 6,\n 12,\n 9,\n 0,\n 3,\n 5,\n 2,\n 14,\n 15,\n 9,\n 10,\n 13,\n 0,\n 7,\n 9,\n 0,\n 14,\n 9,\n 6,\n 3,\n 3,\n 4,\n 15,\n 6,\n 5,\n 10,\n 1,\n 2,\n 13,\n 8,\n 12,\n 5,\n 7,\n 14,\n 11,\n 12,\n 4,\n 11,\n 2,\n 15,\n 8,\n 1,\n 13,\n 1,\n 6,\n 10,\n 4,\n 13,\n 9,\n 0,\n 8,\n 6,\n 15,\n 9,\n 3,\n 8,\n 0,\n 7,\n 11,\n 4,\n 1,\n 15,\n 2,\n 14,\n 12,\n 3,\n 5,\n 11,\n 10,\n 5,\n 14,\n 2,\n 7,\n 12,\n 7,\n 13,\n 13,\n 8,\n 14,\n 11,\n 3,\n 5,\n 0,\n 6,\n 6,\n 15,\n 9,\n 0,\n 10,\n 3,\n 1,\n 4,\n 2,\n 7,\n 8,\n 2,\n 5,\n 12,\n 11,\n 1,\n 12,\n 10,\n 4,\n 14,\n 15,\n 9,\n 10,\n 3,\n 6,\n 15,\n 9,\n 0,\n 0,\n 6,\n 12,\n 10,\n 11,\n 1,\n 7,\n 13,\n 13,\n 8,\n 15,\n 9,\n 1,\n 4,\n 3,\n 5,\n 14,\n 11,\n 5,\n 12,\n 2,\n 7,\n 8,\n 2,\n 4,\n 14,\n 2,\n 14,\n 12,\n 11,\n 4,\n 2,\n 1,\n 12,\n 7,\n 4,\n 10,\n 7,\n 11,\n 13,\n 6,\n 1,\n 8,\n 5,\n 5,\n 0,\n 3,\n 15,\n 15,\n 10,\n 13,\n 3,\n 0,\n 9,\n 14,\n 8,\n 9,\n 6,\n 4,\n 11,\n 2,\n 8,\n 1,\n 12,\n 11,\n 7,\n 10,\n 1,\n 13,\n 14,\n 7,\n 2,\n 8,\n 13,\n 15,\n 6,\n 9,\n 15,\n 12,\n 0,\n 5,\n 9,\n 6,\n 10,\n 3,\n 4,\n 0,\n 5,\n 14,\n 3,\n 12,\n 10,\n 1,\n 15,\n 10,\n 4,\n 15,\n 2,\n 9,\n 7,\n 2,\n 12,\n 6,\n 9,\n 8,\n 5,\n 0,\n 6,\n 13,\n 1,\n 3,\n 13,\n 4,\n 14,\n 14,\n 0,\n 7,\n 11,\n 5,\n 3,\n 11,\n 8,\n 9,\n 4,\n 14,\n 3,\n 15,\n 2,\n 5,\n 12,\n 2,\n 9,\n 8,\n 5,\n 12,\n 15,\n 3,\n 10,\n 7,\n 11,\n 0,\n 14,\n 4,\n 1,\n 10,\n 7,\n 1,\n 6,\n 13,\n 0,\n 11,\n 8,\n 6,\n 13,\n 4,\n 13,\n 11,\n 0,\n 2,\n 11,\n 14,\n 7,\n 15,\n 4,\n 0,\n 9,\n 8,\n 1,\n 13,\n 10,\n 3,\n 14,\n 12,\n 3,\n 9,\n 5,\n 7,\n 12,\n 5,\n 2,\n 10,\n 15,\n 6,\n 8,\n 1,\n 6,\n 1,\n 6,\n 4,\n 11,\n 11,\n 13,\n 13,\n 8,\n 12,\n 1,\n 3,\n 4,\n 7,\n 10,\n 14,\n 7,\n 10,\n 9,\n 15,\n 5,\n 6,\n 0,\n 8,\n 15,\n 0,\n 14,\n 5,\n 2,\n 9,\n 3,\n 2,\n 12,\n 13,\n 1,\n 2,\n 15,\n 8,\n 13,\n 4,\n 8,\n 6,\n 10,\n 15,\n 3,\n 11,\n 7,\n 1,\n 4,\n 10,\n 12,\n 9,\n 5,\n 3,\n 6,\n 14,\n 11,\n 5,\n 0,\n 0,\n 14,\n 12,\n 9,\n 7,\n 2,\n 7,\n 2,\n 11,\n 1,\n 4,\n 14,\n 1,\n 7,\n 9,\n 4,\n 12,\n 10,\n 14,\n 8,\n 2,\n 13,\n 0,\n 15,\n 6,\n 12,\n 10,\n 9,\n 13,\n 0,\n 15,\n 3,\n 3,\n 5,\n 5,\n 6,\n 8,\n 11\n ];\n exports.substitute = function(inL, inR) {\n for (var out = 0, i = 0;i < 4; i++) {\n var b = inL >>> 18 - i * 6 & 63, sb = sTable[i * 64 + b];\n out <<= 4, out |= sb;\n }\n for (var i = 0;i < 4; i++) {\n var b = inR >>> 18 - i * 6 & 63, sb = sTable[256 + i * 64 + b];\n out <<= 4, out |= sb;\n }\n return out >>> 0;\n };\n var permuteTable = [\n 16,\n 25,\n 12,\n 11,\n 3,\n 20,\n 4,\n 15,\n 31,\n 17,\n 9,\n 6,\n 27,\n 14,\n 1,\n 22,\n 30,\n 24,\n 8,\n 18,\n 0,\n 5,\n 29,\n 23,\n 13,\n 19,\n 2,\n 26,\n 10,\n 21,\n 28,\n 7\n ];\n exports.permute = function(num) {\n for (var out = 0, i = 0;i < permuteTable.length; i++)\n out <<= 1, out |= num >>> permuteTable[i] & 1;\n return out >>> 0;\n }, exports.padSplit = function(num, size, group) {\n for (var str = num.toString(2);str.length < size; )\n str = \"0\" + str;\n for (var out = [], i = 0;i < size; i += group)\n out.push(str.slice(i, i + group));\n return out.join(\" \");\n };\n }\n}), require_minimalistic_assert = __commonJS({\n \"node_modules/minimalistic-assert/index.js\"(exports, module) {\n module.exports = assert;\n function assert(val, msg) {\n if (!val)\n throw new Error(msg || \"Assertion failed\");\n }\n assert.equal = function(l, r, msg) {\n if (l != r)\n throw new Error(msg || \"Assertion failed: \" + l + \" != \" + r);\n };\n }\n}), require_cipher = __commonJS({\n \"node_modules/des.js/lib/des/cipher.js\"(exports, module) {\n var assert = require_minimalistic_assert();\n function Cipher(options) {\n this.options = options, this.type = this.options.type, this.blockSize = 8, this._init(), this.buffer = new @Array(this.blockSize), this.bufferOff = 0;\n }\n Cipher.prototype = {}, module.exports = Cipher, Cipher.prototype._init = function() {\n }, Cipher.prototype.update = function(data) {\n return data.length === 0 \? [] : this.type === \"decrypt\" \? this._updateDecrypt(data) : this._updateEncrypt(data);\n }, Cipher.prototype._buffer = function(data, off) {\n for (var min = Math.min(this.buffer.length - this.bufferOff, data.length - off), i = 0;i < min; i++)\n this.buffer[this.bufferOff + i] = data[off + i];\n return this.bufferOff += min, min;\n }, Cipher.prototype._flushBuffer = function(out, off) {\n return this._update(this.buffer, 0, out, off), this.bufferOff = 0, this.blockSize;\n }, Cipher.prototype._updateEncrypt = function(data) {\n var inputOff = 0, outputOff = 0, count = (this.bufferOff + data.length) / this.blockSize | 0, out = new @Array(count * this.blockSize);\n this.bufferOff !== 0 && (inputOff += this._buffer(data, inputOff), this.bufferOff === this.buffer.length && (outputOff += this._flushBuffer(out, outputOff)));\n for (var max = data.length - (data.length - inputOff) % this.blockSize;inputOff < max; inputOff += this.blockSize)\n this._update(data, inputOff, out, outputOff), outputOff += this.blockSize;\n for (;inputOff < data.length; inputOff++, this.bufferOff++)\n this.buffer[this.bufferOff] = data[inputOff];\n return out;\n }, Cipher.prototype._updateDecrypt = function(data) {\n for (var inputOff = 0, outputOff = 0, count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1, out = new @Array(count * this.blockSize);count > 0; count--)\n inputOff += this._buffer(data, inputOff), outputOff += this._flushBuffer(out, outputOff);\n return inputOff += this._buffer(data, inputOff), out;\n }, Cipher.prototype.final = function(buffer) {\n var first;\n buffer && (first = this.update(buffer));\n var last;\n return this.type === \"encrypt\" \? last = this._finalEncrypt() : last = this._finalDecrypt(), first \? first.concat(last) : last;\n }, Cipher.prototype._pad = function(buffer, off) {\n if (off === 0)\n return !1;\n for (;off < buffer.length; )\n buffer[off++] = 0;\n return !0;\n }, Cipher.prototype._finalEncrypt = function() {\n if (!this._pad(this.buffer, this.bufferOff))\n return [];\n var out = new @Array(this.blockSize);\n return this._update(this.buffer, 0, out, 0), out;\n }, Cipher.prototype._unpad = function(buffer) {\n return buffer;\n }, Cipher.prototype._finalDecrypt = function() {\n assert.equal(this.bufferOff, this.blockSize, \"Not enough data to decrypt\");\n var out = new @Array(this.blockSize);\n return this._flushBuffer(out, 0), this._unpad(out);\n };\n }\n}), require_des = __commonJS({\n \"node_modules/des.js/lib/des/des.js\"(exports, module) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), utils = require_utils(), Cipher = require_cipher();\n function DESState() {\n this.tmp = new @Array(2), this.keys = null;\n }\n function DES(options) {\n Cipher.@call(this, options);\n var state = new DESState;\n this._desState = state, this.deriveKeys(state, options.key);\n }\n inherits(DES, Cipher), module.exports = DES, DES.create = function(options) {\n return new DES(options);\n };\n var shiftTable = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1];\n DES.prototype.deriveKeys = function(state, key2) {\n state.keys = new @Array(32), assert.equal(key2.length, this.blockSize, \"Invalid key length\");\n var kL = utils.readUInt32BE(key2, 0), kR = utils.readUInt32BE(key2, 4);\n utils.pc1(kL, kR, state.tmp, 0), kL = state.tmp[0], kR = state.tmp[1];\n for (var i = 0;i < state.keys.length; i += 2) {\n var shift = shiftTable[i >>> 1];\n kL = utils.r28shl(kL, shift), kR = utils.r28shl(kR, shift), utils.pc2(kL, kR, state.keys, i);\n }\n }, DES.prototype._update = function(inp, inOff, out, outOff) {\n var state = this._desState, l = utils.readUInt32BE(inp, inOff), r = utils.readUInt32BE(inp, inOff + 4);\n utils.ip(l, r, state.tmp, 0), l = state.tmp[0], r = state.tmp[1], this.type === \"encrypt\" \? this._encrypt(state, l, r, state.tmp, 0) : this._decrypt(state, l, r, state.tmp, 0), l = state.tmp[0], r = state.tmp[1], utils.writeUInt32BE(out, l, outOff), utils.writeUInt32BE(out, r, outOff + 4);\n }, DES.prototype._pad = function(buffer, off) {\n for (var value = buffer.length - off, i = off;i < buffer.length; i++)\n buffer[i] = value;\n return !0;\n }, DES.prototype._unpad = function(buffer) {\n for (var pad = buffer[buffer.length - 1], i = buffer.length - pad;i < buffer.length; i++)\n assert.equal(buffer[i], pad);\n return buffer.slice(0, buffer.length - pad);\n }, DES.prototype._encrypt = function(state, lStart, rStart, out, off) {\n for (var l = lStart, r = rStart, i = 0;i < state.keys.length; i += 2) {\n var keyL = state.keys[i], keyR = state.keys[i + 1];\n utils.expand(r, state.tmp, 0), keyL ^= state.tmp[0], keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR), f = utils.permute(s), t = r;\n r = (l ^ f) >>> 0, l = t;\n }\n utils.rip(r, l, out, off);\n }, DES.prototype._decrypt = function(state, lStart, rStart, out, off) {\n for (var l = rStart, r = lStart, i = state.keys.length - 2;i >= 0; i -= 2) {\n var keyL = state.keys[i], keyR = state.keys[i + 1];\n utils.expand(l, state.tmp, 0), keyL ^= state.tmp[0], keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR), f = utils.permute(s), t = l;\n l = (r ^ f) >>> 0, r = t;\n }\n utils.rip(l, r, out, off);\n };\n }\n}), require_cbc = __commonJS({\n \"node_modules/des.js/lib/des/cbc.js\"(exports) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), proto = {};\n function CBCState(iv) {\n assert.equal(iv.length, 8, \"Invalid IV length\"), this.iv = new @Array(8);\n for (var i = 0;i < this.iv.length; i++)\n this.iv[i] = iv[i];\n }\n function instantiate(Base) {\n function CBC(options) {\n Base.@call(this, options), this._cbcInit();\n }\n inherits(CBC, Base);\n for (var keys = Object.keys(proto), i = 0;i < keys.length; i++) {\n var key2 = keys[i];\n CBC.prototype[key2] = proto[key2];\n }\n return CBC.create = function(options) {\n return new CBC(options);\n }, CBC;\n }\n exports.instantiate = instantiate, proto._cbcInit = function() {\n var state = new CBCState(this.options.iv);\n this._cbcState = state;\n }, proto._update = function(inp, inOff, out, outOff) {\n var state = this._cbcState, superProto = this.constructor.super_.prototype, iv = state.iv;\n if (this.type === \"encrypt\") {\n for (var i = 0;i < this.blockSize; i++)\n iv[i] ^= inp[inOff + i];\n superProto._update.@call(this, iv, 0, out, outOff);\n for (var i = 0;i < this.blockSize; i++)\n iv[i] = out[outOff + i];\n } else {\n superProto._update.@call(this, inp, inOff, out, outOff);\n for (var i = 0;i < this.blockSize; i++)\n out[outOff + i] ^= iv[i];\n for (var i = 0;i < this.blockSize; i++)\n iv[i] = inp[inOff + i];\n }\n };\n }\n}), require_ede = __commonJS({\n \"node_modules/des.js/lib/des/ede.js\"(exports, module) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), Cipher = require_cipher(), DES = require_des();\n function EDEState(type, key2) {\n assert.equal(key2.length, 24, \"Invalid key length\");\n var k1 = key2.slice(0, 8), k2 = key2.slice(8, 16), k3 = key2.slice(16, 24);\n type === \"encrypt\" \? this.ciphers = [\n DES.create({ type: \"encrypt\", key: k1 }),\n DES.create({ type: \"decrypt\", key: k2 }),\n DES.create({ type: \"encrypt\", key: k3 })\n ] : this.ciphers = [\n DES.create({ type: \"decrypt\", key: k3 }),\n DES.create({ type: \"encrypt\", key: k2 }),\n DES.create({ type: \"decrypt\", key: k1 })\n ];\n }\n function EDE(options) {\n Cipher.@call(this, options);\n var state = new EDEState(this.type, this.options.key);\n this._edeState = state;\n }\n inherits(EDE, Cipher), module.exports = EDE, EDE.create = function(options) {\n return new EDE(options);\n }, EDE.prototype._update = function(inp, inOff, out, outOff) {\n var state = this._edeState;\n state.ciphers[0]._update(inp, inOff, out, outOff), state.ciphers[1]._update(out, outOff, out, outOff), state.ciphers[2]._update(out, outOff, out, outOff);\n }, EDE.prototype._pad = DES.prototype._pad, EDE.prototype._unpad = DES.prototype._unpad;\n }\n}), require_des2 = __commonJS({\n \"node_modules/des.js/lib/des.js\"(exports) {\n exports.utils = require_utils(), exports.Cipher = require_cipher(), exports.DES = require_des(), exports.CBC = require_cbc(), exports.EDE = require_ede();\n }\n}), require_browserify_des = __commonJS({\n \"node_modules/browserify-des/index.js\"(exports, module) {\n var CipherBase = require_cipher_base(), des = require_des2(), inherits = require_inherits_browser(), Buffer2 = require_safe_buffer().Buffer, modes = {\n \"des-ede3-cbc\": des.CBC.instantiate(des.EDE),\n \"des-ede3\": des.EDE,\n \"des-ede-cbc\": des.CBC.instantiate(des.EDE),\n \"des-ede\": des.EDE,\n \"des-cbc\": des.CBC.instantiate(des.DES),\n \"des-ecb\": des.DES\n };\n modes.des = modes[\"des-cbc\"], modes.des3 = modes[\"des-ede3-cbc\"], module.exports = DES, inherits(DES, CipherBase);\n function DES(opts) {\n CipherBase.@call(this);\n var modeName = opts.mode.toLowerCase(), mode = modes[modeName], type;\n opts.decrypt \? type = \"decrypt\" : type = \"encrypt\";\n var key2 = opts.key;\n Buffer2.isBuffer(key2) || (key2 = Buffer2.from(key2)), (modeName === \"des-ede\" || modeName === \"des-ede-cbc\") && (key2 = Buffer2.concat([key2, key2.slice(0, 8)]));\n var iv = opts.iv;\n Buffer2.isBuffer(iv) || (iv = Buffer2.from(iv)), this._des = mode.create({\n key: key2,\n iv,\n type\n });\n }\n DES.prototype._update = function(data) {\n return Buffer2.from(this._des.update(data));\n }, DES.prototype._final = function() {\n return Buffer2.from(this._des.final());\n };\n }\n}), require_ecb = __commonJS({\n \"node_modules/browserify-aes/modes/ecb.js\"(exports) {\n exports.encrypt = function(self2, block) {\n return self2._cipher.encryptBlock(block);\n }, exports.decrypt = function(self2, block) {\n return self2._cipher.decryptBlock(block);\n };\n }\n}), require_buffer_xor = __commonJS({\n \"node_modules/buffer-xor/index.js\"(exports, module) {\n module.exports = function(a, b) {\n for (var length = Math.min(a.length, b.length), buffer = new Buffer(length), i = 0;i < length; ++i)\n buffer[i] = a[i] ^ b[i];\n return buffer;\n };\n }\n}), require_cbc2 = __commonJS({\n \"node_modules/browserify-aes/modes/cbc.js\"(exports) {\n var xor = require_buffer_xor();\n exports.encrypt = function(self2, block) {\n var data = xor(block, self2._prev);\n return self2._prev = self2._cipher.encryptBlock(data), self2._prev;\n }, exports.decrypt = function(self2, block) {\n var pad = self2._prev;\n self2._prev = block;\n var out = self2._cipher.decryptBlock(block);\n return xor(out, pad);\n };\n }\n}), require_cfb = __commonJS({\n \"node_modules/browserify-aes/modes/cfb.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer, xor = require_buffer_xor();\n function encryptStart(self2, data, decrypt) {\n var len = data.length, out = xor(data, self2._cache);\n return self2._cache = self2._cache.slice(len), self2._prev = Buffer2.concat([self2._prev, decrypt \? data : out]), out;\n }\n exports.encrypt = function(self2, data, decrypt) {\n for (var out = Buffer2.allocUnsafe(0), len;data.length; )\n if (self2._cache.length === 0 && (self2._cache = self2._cipher.encryptBlock(self2._prev), self2._prev = Buffer2.allocUnsafe(0)), self2._cache.length <= data.length)\n len = self2._cache.length, out = Buffer2.concat([out, encryptStart(self2, data.slice(0, len), decrypt)]), data = data.slice(len);\n else {\n out = Buffer2.concat([out, encryptStart(self2, data, decrypt)]);\n break;\n }\n return out;\n };\n }\n}), require_cfb8 = __commonJS({\n \"node_modules/browserify-aes/modes/cfb8.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer;\n function encryptByte(self2, byteParam, decrypt) {\n var pad = self2._cipher.encryptBlock(self2._prev), out = pad[0] ^ byteParam;\n return self2._prev = Buffer2.concat([self2._prev.slice(1), Buffer2.from([decrypt \? byteParam : out])]), out;\n }\n exports.encrypt = function(self2, chunk, decrypt) {\n for (var len = chunk.length, out = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n out[i] = encryptByte(self2, chunk[i], decrypt);\n return out;\n };\n }\n}), require_cfb1 = __commonJS({\n \"node_modules/browserify-aes/modes/cfb1.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer;\n function encryptByte(self2, byteParam, decrypt) {\n for (var pad, i = -1, len = 8, out = 0, bit, value;++i < len; )\n pad = self2._cipher.encryptBlock(self2._prev), bit = byteParam & 1 << 7 - i \? 128 : 0, value = pad[0] ^ bit, out += (value & 128) >> i % 8, self2._prev = shiftIn(self2._prev, decrypt \? bit : value);\n return out;\n }\n function shiftIn(buffer, value) {\n var len = buffer.length, i = -1, out = Buffer2.allocUnsafe(buffer.length);\n for (buffer = Buffer2.concat([buffer, Buffer2.from([value])]);++i < len; )\n out[i] = buffer[i] << 1 | buffer[i + 1] >> 7;\n return out;\n }\n exports.encrypt = function(self2, chunk, decrypt) {\n for (var len = chunk.length, out = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n out[i] = encryptByte(self2, chunk[i], decrypt);\n return out;\n };\n }\n}), require_ofb = __commonJS({\n \"node_modules/browserify-aes/modes/ofb.js\"(exports) {\n var xor = require_buffer_xor();\n function getBlock(self2) {\n return self2._prev = self2._cipher.encryptBlock(self2._prev), self2._prev;\n }\n exports.encrypt = function(self2, chunk) {\n for (;self2._cache.length < chunk.length; )\n self2._cache = Buffer.concat([self2._cache, getBlock(self2)]);\n var pad = self2._cache.slice(0, chunk.length);\n return self2._cache = self2._cache.slice(chunk.length), xor(chunk, pad);\n };\n }\n}), require_incr32 = __commonJS({\n \"node_modules/browserify-aes/incr32.js\"(exports, module) {\n function incr32(iv) {\n for (var len = iv.length, item;len--; )\n if (item = iv.readUInt8(len), item === 255)\n iv.writeUInt8(0, len);\n else {\n item++, iv.writeUInt8(item, len);\n break;\n }\n }\n module.exports = incr32;\n }\n}), require_ctr = __commonJS({\n \"node_modules/browserify-aes/modes/ctr.js\"(exports) {\n var xor = require_buffer_xor(), Buffer2 = require_safe_buffer().Buffer, incr32 = require_incr32();\n function getBlock(self2) {\n var out = self2._cipher.encryptBlockRaw(self2._prev);\n return incr32(self2._prev), out;\n }\n var blockSize = 16;\n exports.encrypt = function(self2, chunk) {\n var chunkNum = Math.ceil(chunk.length / blockSize), start = self2._cache.length;\n self2._cache = Buffer2.concat([self2._cache, Buffer2.allocUnsafe(chunkNum * blockSize)]);\n for (var i = 0;i < chunkNum; i++) {\n var out = getBlock(self2), offset = start + i * blockSize;\n self2._cache.writeUInt32BE(out[0], offset + 0), self2._cache.writeUInt32BE(out[1], offset + 4), self2._cache.writeUInt32BE(out[2], offset + 8), self2._cache.writeUInt32BE(out[3], offset + 12);\n }\n var pad = self2._cache.slice(0, chunk.length);\n return self2._cache = self2._cache.slice(chunk.length), xor(chunk, pad);\n };\n }\n}), require_list = __commonJS({\n \"node_modules/browserify-aes/modes/list.json\"(exports, module) {\n module.exports = {\n \"aes-128-ecb\": {\n cipher: \"AES\",\n key: 128,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-192-ecb\": {\n cipher: \"AES\",\n key: 192,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-256-ecb\": {\n cipher: \"AES\",\n key: 256,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-128-cbc\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-192-cbc\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-256-cbc\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes128: {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes192: {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes256: {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-128-cfb\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-192-cfb\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-256-cfb\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-128-cfb8\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-192-cfb8\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-256-cfb8\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-128-cfb1\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-192-cfb1\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-256-cfb1\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-128-ofb\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-192-ofb\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-256-ofb\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-128-ctr\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-192-ctr\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-256-ctr\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-128-gcm\": {\n cipher: \"AES\",\n key: 128,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n },\n \"aes-192-gcm\": {\n cipher: \"AES\",\n key: 192,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n },\n \"aes-256-gcm\": {\n cipher: \"AES\",\n key: 256,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n }\n };\n }\n}), require_modes = __commonJS({\n \"node_modules/browserify-aes/modes/index.js\"(exports, module) {\n var modeModules = {\n ECB: require_ecb(),\n CBC: require_cbc2(),\n CFB: require_cfb(),\n CFB8: require_cfb8(),\n CFB1: require_cfb1(),\n OFB: require_ofb(),\n CTR: require_ctr(),\n GCM: require_ctr()\n }, modes = require_list();\n for (key2 in modes)\n modes[key2].module = modeModules[modes[key2].mode];\n var key2;\n module.exports = modes;\n }\n}), require_aes = __commonJS({\n \"node_modules/browserify-aes/aes.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n function asUInt32Array(buf) {\n if (buf instanceof KeyObject)\n buf = buf.export();\n else if (buf instanceof CryptoKey)\n buf = KeyObject.from(buf).export();\n Buffer2.isBuffer(buf) || (buf = Buffer2.from(buf));\n for (var len = buf.length / 4 | 0, out = new @Array(len), i = 0;i < len; i++)\n out[i] = buf.readUInt32BE(i * 4);\n return out;\n }\n function scrubVec(v) {\n for (var i = 0;i < v.length; v++)\n v[i] = 0;\n }\n function cryptBlock(M, keySchedule, SUB_MIX, SBOX, nRounds) {\n for (var SUB_MIX0 = SUB_MIX[0], SUB_MIX1 = SUB_MIX[1], SUB_MIX2 = SUB_MIX[2], SUB_MIX3 = SUB_MIX[3], s0 = M[0] ^ keySchedule[0], s1 = M[1] ^ keySchedule[1], s2 = M[2] ^ keySchedule[2], s3 = M[3] ^ keySchedule[3], t0, t1, t2, t3, ksRow = 4, round = 1;round < nRounds; round++)\n t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[s1 >>> 16 & 255] ^ SUB_MIX2[s2 >>> 8 & 255] ^ SUB_MIX3[s3 & 255] ^ keySchedule[ksRow++], t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[s2 >>> 16 & 255] ^ SUB_MIX2[s3 >>> 8 & 255] ^ SUB_MIX3[s0 & 255] ^ keySchedule[ksRow++], t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[s3 >>> 16 & 255] ^ SUB_MIX2[s0 >>> 8 & 255] ^ SUB_MIX3[s1 & 255] ^ keySchedule[ksRow++], t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[s0 >>> 16 & 255] ^ SUB_MIX2[s1 >>> 8 & 255] ^ SUB_MIX3[s2 & 255] ^ keySchedule[ksRow++], s0 = t0, s1 = t1, s2 = t2, s3 = t3;\n return t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 255] << 16 | SBOX[s2 >>> 8 & 255] << 8 | SBOX[s3 & 255]) ^ keySchedule[ksRow++], t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 255] << 16 | SBOX[s3 >>> 8 & 255] << 8 | SBOX[s0 & 255]) ^ keySchedule[ksRow++], t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 255] << 16 | SBOX[s0 >>> 8 & 255] << 8 | SBOX[s1 & 255]) ^ keySchedule[ksRow++], t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 255] << 16 | SBOX[s1 >>> 8 & 255] << 8 | SBOX[s2 & 255]) ^ keySchedule[ksRow++], t0 = t0 >>> 0, t1 = t1 >>> 0, t2 = t2 >>> 0, t3 = t3 >>> 0, [t0, t1, t2, t3];\n }\n var RCON = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], G = function() {\n for (var d = new @Array(256), j = 0;j < 256; j++)\n j < 128 \? d[j] = j << 1 : d[j] = j << 1 ^ 283;\n for (var SBOX = [], INV_SBOX = [], SUB_MIX = [[], [], [], []], INV_SUB_MIX = [[], [], [], []], x = 0, xi = 0, i = 0;i < 256; ++i) {\n var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n sx = sx >>> 8 ^ sx & 255 ^ 99, SBOX[x] = sx, INV_SBOX[sx] = x;\n var x2 = d[x], x4 = d[x2], x8 = d[x4], t = d[sx] * 257 ^ sx * 16843008;\n SUB_MIX[0][x] = t << 24 | t >>> 8, SUB_MIX[1][x] = t << 16 | t >>> 16, SUB_MIX[2][x] = t << 8 | t >>> 24, SUB_MIX[3][x] = t, t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008, INV_SUB_MIX[0][sx] = t << 24 | t >>> 8, INV_SUB_MIX[1][sx] = t << 16 | t >>> 16, INV_SUB_MIX[2][sx] = t << 8 | t >>> 24, INV_SUB_MIX[3][sx] = t, x === 0 \? x = xi = 1 : (x = x2 ^ d[d[d[x8 ^ x2]]], xi ^= d[d[xi]]);\n }\n return {\n SBOX,\n INV_SBOX,\n SUB_MIX,\n INV_SUB_MIX\n };\n }();\n function AES(key2) {\n this._key = asUInt32Array(key2), this._reset();\n }\n AES.prototype = {}, AES.blockSize = 16, AES.keySize = 32, AES.prototype.blockSize = AES.blockSize, AES.prototype.keySize = AES.keySize, AES.prototype._reset = function() {\n for (var keyWords = this._key, keySize = keyWords.length, nRounds = keySize + 6, ksRows = (nRounds + 1) * 4, keySchedule = [], k = 0;k < keySize; k++)\n keySchedule[k] = keyWords[k];\n for (k = keySize;k < ksRows; k++) {\n var t = keySchedule[k - 1];\n k % keySize === 0 \? (t = t << 8 | t >>> 24, t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255], t ^= RCON[k / keySize | 0] << 24) : keySize > 6 && k % keySize === 4 && (t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255]), keySchedule[k] = keySchedule[k - keySize] ^ t;\n }\n for (var invKeySchedule = [], ik = 0;ik < ksRows; ik++) {\n var ksR = ksRows - ik, tt = keySchedule[ksR - (ik % 4 \? 0 : 4)];\n ik < 4 || ksR <= 4 \? invKeySchedule[ik] = tt : invKeySchedule[ik] = G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^ G.INV_SUB_MIX[1][G.SBOX[tt >>> 16 & 255]] ^ G.INV_SUB_MIX[2][G.SBOX[tt >>> 8 & 255]] ^ G.INV_SUB_MIX[3][G.SBOX[tt & 255]];\n }\n this._nRounds = nRounds, this._keySchedule = keySchedule, this._invKeySchedule = invKeySchedule;\n }, AES.prototype.encryptBlockRaw = function(M) {\n return M = asUInt32Array(M), cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds);\n }, AES.prototype.encryptBlock = function(M) {\n var out = this.encryptBlockRaw(M), buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0], 0), buf.writeUInt32BE(out[1], 4), buf.writeUInt32BE(out[2], 8), buf.writeUInt32BE(out[3], 12), buf;\n }, AES.prototype.decryptBlock = function(M) {\n M = asUInt32Array(M);\n var m1 = M[1];\n M[1] = M[3], M[3] = m1;\n var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds), buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0], 0), buf.writeUInt32BE(out[3], 4), buf.writeUInt32BE(out[2], 8), buf.writeUInt32BE(out[1], 12), buf;\n }, AES.prototype.scrub = function() {\n scrubVec(this._keySchedule), scrubVec(this._invKeySchedule), scrubVec(this._key);\n }, module.exports.AES = AES;\n }\n}), require_ghash = __commonJS({\n \"node_modules/browserify-aes/ghash.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, ZEROES = Buffer2.alloc(16, 0);\n function toArray(buf) {\n return [buf.readUInt32BE(0), buf.readUInt32BE(4), buf.readUInt32BE(8), buf.readUInt32BE(12)];\n }\n function fromArray(out) {\n var buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0] >>> 0, 0), buf.writeUInt32BE(out[1] >>> 0, 4), buf.writeUInt32BE(out[2] >>> 0, 8), buf.writeUInt32BE(out[3] >>> 0, 12), buf;\n }\n function GHASH(key2) {\n this.h = key2, this.state = Buffer2.alloc(16, 0), this.cache = Buffer2.allocUnsafe(0);\n }\n GHASH.prototype = {}, GHASH.prototype.ghash = function(block) {\n for (var i = -1;++i < block.length; )\n this.state[i] ^= block[i];\n this._multiply();\n }, GHASH.prototype._multiply = function() {\n for (var Vi = toArray(this.h), Zi = [0, 0, 0, 0], j, xi, lsbVi, i = -1;++i < 128; ) {\n for (xi = (this.state[~~(i / 8)] & 1 << 7 - i % 8) !== 0, xi && (Zi[0] ^= Vi[0], Zi[1] ^= Vi[1], Zi[2] ^= Vi[2], Zi[3] ^= Vi[3]), lsbVi = (Vi[3] & 1) !== 0, j = 3;j > 0; j--)\n Vi[j] = Vi[j] >>> 1 | (Vi[j - 1] & 1) << 31;\n Vi[0] = Vi[0] >>> 1, lsbVi && (Vi[0] = Vi[0] ^ 225 << 24);\n }\n this.state = fromArray(Zi);\n }, GHASH.prototype.update = function(buf) {\n this.cache = Buffer2.concat([this.cache, buf]);\n for (var chunk;this.cache.length >= 16; )\n chunk = this.cache.slice(0, 16), this.cache = this.cache.slice(16), this.ghash(chunk);\n }, GHASH.prototype.final = function(abl, bl) {\n return this.cache.length && this.ghash(Buffer2.concat([this.cache, ZEROES], 16)), this.ghash(fromArray([0, abl, 0, bl])), this.state;\n }, module.exports = GHASH;\n }\n}), require_authCipher = __commonJS({\n \"node_modules/browserify-aes/authCipher.js\"(exports, module) {\n var aes = require_aes(), Buffer2 = require_safe_buffer().Buffer, Transform = require_cipher_base(), inherits = require_inherits_browser(), GHASH = require_ghash(), xor = require_buffer_xor(), incr32 = require_incr32();\n function xorTest(a, b) {\n var out = 0;\n a.length !== b.length && out++;\n for (var len = Math.min(a.length, b.length), i = 0;i < len; ++i)\n out += a[i] ^ b[i];\n return out;\n }\n function calcIv(self2, iv, ck) {\n if (iv.length === 12)\n return self2._finID = Buffer2.concat([iv, Buffer2.from([0, 0, 0, 1])]), Buffer2.concat([iv, Buffer2.from([0, 0, 0, 2])]);\n var ghash = new GHASH(ck), len = iv.length, toPad = len % 16;\n ghash.update(iv), toPad && (toPad = 16 - toPad, ghash.update(Buffer2.alloc(toPad, 0))), ghash.update(Buffer2.alloc(8, 0));\n var ivBits = len * 8, tail = Buffer2.alloc(8);\n tail.writeUIntBE(ivBits, 0, 8), ghash.update(tail), self2._finID = ghash.state;\n var out = Buffer2.from(self2._finID);\n return incr32(out), out;\n }\n function StreamCipher(mode, key2, iv, decrypt) {\n Transform.@call(this);\n var h = Buffer2.alloc(4, 0);\n this._cipher = new aes.AES(key2);\n var ck = this._cipher.encryptBlock(h);\n this._ghash = new GHASH(ck), iv = calcIv(this, iv, ck), this._prev = Buffer2.from(iv), this._cache = Buffer2.allocUnsafe(0), this._secCache = Buffer2.allocUnsafe(0), this._decrypt = decrypt, this._alen = 0, this._len = 0, this._mode = mode, this._authTag = null, this._called = !1;\n }\n inherits(StreamCipher, Transform), StreamCipher.prototype._update = function(chunk) {\n if (!this._called && this._alen) {\n var rump = 16 - this._alen % 16;\n rump < 16 && (rump = Buffer2.alloc(rump, 0), this._ghash.update(rump));\n }\n this._called = !0;\n var out = this._mode.encrypt(this, chunk);\n return this._decrypt \? this._ghash.update(chunk) : this._ghash.update(out), this._len += chunk.length, out;\n }, StreamCipher.prototype._final = function() {\n if (this._decrypt && !this._authTag)\n throw new Error(\"Unsupported state or unable to authenticate data\");\n var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID));\n if (this._decrypt && xorTest(tag, this._authTag))\n throw new Error(\"Unsupported state or unable to authenticate data\");\n this._authTag = tag, this._cipher.scrub();\n }, StreamCipher.prototype.getAuthTag = function() {\n if (this._decrypt || !Buffer2.isBuffer(this._authTag))\n throw new Error(\"Attempting to get auth tag in unsupported state\");\n return this._authTag;\n }, StreamCipher.prototype.setAuthTag = function(tag) {\n if (!this._decrypt)\n throw new Error(\"Attempting to set auth tag in unsupported state\");\n this._authTag = tag;\n }, StreamCipher.prototype.setAAD = function(buf) {\n if (this._called)\n throw new Error(\"Attempting to set AAD in unsupported state\");\n this._ghash.update(buf), this._alen += buf.length;\n }, module.exports = StreamCipher;\n }\n}), require_streamCipher = __commonJS({\n \"node_modules/browserify-aes/streamCipher.js\"(exports, module) {\n var aes = require_aes(), Buffer2 = require_safe_buffer().Buffer, Transform = require_cipher_base(), inherits = require_inherits_browser();\n function StreamCipher(mode, key2, iv, decrypt) {\n Transform.@call(this), this._cipher = new aes.AES(key2), this._prev = Buffer2.from(iv), this._cache = Buffer2.allocUnsafe(0), this._secCache = Buffer2.allocUnsafe(0), this._decrypt = decrypt, this._mode = mode;\n }\n inherits(StreamCipher, Transform), StreamCipher.prototype._update = function(chunk) {\n return this._mode.encrypt(this, chunk, this._decrypt);\n }, StreamCipher.prototype._final = function() {\n this._cipher.scrub();\n }, module.exports = StreamCipher;\n }\n}), require_evp_bytestokey = __commonJS({\n \"node_modules/evp_bytestokey/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, MD5 = require_md5();\n function EVP_BytesToKey(password, salt, keyBits, ivLen) {\n if (Buffer2.isBuffer(password) || (password = Buffer2.from(password, \"binary\")), salt && (Buffer2.isBuffer(salt) || (salt = Buffer2.from(salt, \"binary\")), salt.length !== 8))\n @throwRangeError(\"salt should be Buffer with 8 byte length\");\n for (var keyLen = keyBits / 8, key2 = Buffer2.alloc(keyLen), iv = Buffer2.alloc(ivLen || 0), tmp = Buffer2.alloc(0);keyLen > 0 || ivLen > 0; ) {\n var hash = new MD5;\n hash.update(tmp), hash.update(password), salt && hash.update(salt), tmp = hash.digest();\n var used = 0;\n if (keyLen > 0) {\n var keyStart = key2.length - keyLen;\n used = Math.min(keyLen, tmp.length), tmp.copy(key2, keyStart, 0, used), keyLen -= used;\n }\n if (used < tmp.length && ivLen > 0) {\n var ivStart = iv.length - ivLen, length = Math.min(ivLen, tmp.length - used);\n tmp.copy(iv, ivStart, used, used + length), ivLen -= length;\n }\n }\n return tmp.fill(0), { key: key2, iv };\n }\n module.exports = EVP_BytesToKey;\n }\n}), require_encrypter = __commonJS({\n \"node_modules/browserify-aes/encrypter.js\"(exports) {\n var MODES = require_modes(), AuthCipher = require_authCipher(), Buffer2 = require_safe_buffer().Buffer, StreamCipher = require_streamCipher(), Transform = require_cipher_base(), aes = require_aes(), ebtk = require_evp_bytestokey(), inherits = require_inherits_browser();\n function Cipher(mode, key2, iv) {\n Transform.@call(this), this._cache = new Splitter, this._cipher = new aes.AES(key2), this._prev = Buffer2.from(iv), this._mode = mode, this._autopadding = !0;\n }\n inherits(Cipher, Transform), Cipher.prototype._update = function(data) {\n this._cache.add(data);\n for (var chunk, thing, out = [];chunk = this._cache.get(); )\n thing = this._mode.encrypt(this, chunk), out.push(thing);\n return Buffer2.concat(out);\n };\n var PADDING = Buffer2.alloc(16, 16);\n Cipher.prototype._final = function() {\n var chunk = this._cache.flush();\n if (this._autopadding)\n return chunk = this._mode.encrypt(this, chunk), this._cipher.scrub(), chunk;\n if (!chunk.equals(PADDING))\n throw this._cipher.scrub(), new Error(\"data not multiple of block length\");\n }, Cipher.prototype.setAutoPadding = function(setTo) {\n return this._autopadding = !!setTo, this;\n };\n function Splitter() {\n this.cache = Buffer2.allocUnsafe(0);\n }\n Splitter.prototype = {}, Splitter.prototype.add = function(data) {\n this.cache = Buffer2.concat([this.cache, data]);\n }, Splitter.prototype.get = function() {\n if (this.cache.length > 15) {\n var out = this.cache.slice(0, 16);\n return this.cache = this.cache.slice(16), out;\n }\n return null;\n }, Splitter.prototype.flush = function() {\n for (var len = 16 - this.cache.length, padBuff = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n padBuff.writeUInt8(len, i);\n return Buffer2.concat([this.cache, padBuff]);\n };\n function createCipheriv(suite, password, iv) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n password = getArrayBufferOrView(password, \"password\");\n const iv_length = iv\?.length || 0, required_iv_length = config.iv || 0;\n if (iv = iv === null \? EMPTY_BUFFER : getArrayBufferOrView(iv, \"iv\"), password\?.length !== config.key / 8) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n if (config.mode !== \"GCM\" && iv_length !== required_iv_length) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n return config.type === \"stream\" \? new StreamCipher(config.module, password, iv) : config.type === \"auth\" \? new AuthCipher(config.module, password, iv) : new Cipher(config.module, password, iv);\n }\n function createCipher(suite, password) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, config.key, config.iv);\n return createCipheriv(suite, keys.key, keys.iv);\n }\n exports.createCipheriv = createCipheriv, exports.createCipher = createCipher;\n }\n}), require_decrypter = __commonJS({\n \"node_modules/browserify-aes/decrypter.js\"(exports) {\n var AuthCipher = require_authCipher(), Buffer2 = require_safe_buffer().Buffer, MODES = require_modes(), StreamCipher = require_streamCipher(), Transform = require_cipher_base(), aes = require_aes(), ebtk = require_evp_bytestokey(), inherits = require_inherits_browser();\n function Decipher(mode, key2, iv) {\n Transform.@call(this), this._cache = new Splitter, this._last = void 0, this._cipher = new aes.AES(key2), this._prev = Buffer2.from(iv), this._mode = mode, this._autopadding = !0;\n }\n inherits(Decipher, Transform), Decipher.prototype._update = function(data) {\n this._cache.add(data);\n for (var chunk, thing, out = [];chunk = this._cache.get(this._autopadding); )\n thing = this._mode.decrypt(this, chunk), out.push(thing);\n return Buffer2.concat(out);\n }, Decipher.prototype._final = function() {\n var chunk = this._cache.flush();\n if (this._autopadding)\n return unpad(this._mode.decrypt(this, chunk));\n if (chunk)\n throw new Error(\"data not multiple of block length\");\n }, Decipher.prototype.setAutoPadding = function(setTo) {\n return this._autopadding = !!setTo, this;\n };\n function Splitter() {\n this.cache = Buffer2.allocUnsafe(0);\n }\n Splitter.prototype = {}, Splitter.prototype.add = function(data) {\n this.cache = Buffer2.concat([this.cache, data]);\n }, Splitter.prototype.get = function(autoPadding) {\n var out;\n if (autoPadding) {\n if (this.cache.length > 16)\n return out = this.cache.slice(0, 16), this.cache = this.cache.slice(16), out;\n } else if (this.cache.length >= 16)\n return out = this.cache.slice(0, 16), this.cache = this.cache.slice(16), out;\n return null;\n }, Splitter.prototype.flush = function() {\n if (this.cache.length)\n return this.cache;\n };\n function unpad(last) {\n var padded = last[15];\n if (padded < 1 || padded > 16)\n throw new Error(\"unable to decrypt data\");\n for (var i = -1;++i < padded; )\n if (last[i + (16 - padded)] !== padded)\n throw new Error(\"unable to decrypt data\");\n if (padded !== 16)\n return last.slice(0, 16 - padded);\n }\n function createDecipheriv(suite, password, iv) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n password = getArrayBufferOrView(password, \"password\");\n const iv_length = iv\?.length || 0, required_iv_length = config.iv || 0;\n if (iv = iv === null \? EMPTY_BUFFER : getArrayBufferOrView(iv, \"iv\"), config.mode !== \"GCM\" && iv_length !== required_iv_length) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n if (password.length !== config.key / 8) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n return config.type === \"stream\" \? new StreamCipher(config.module, password, iv, !0) : config.type === \"auth\" \? new AuthCipher(config.module, password, iv, !0) : new Decipher(config.module, password, iv);\n }\n function createDecipher(suite, password) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, config.key, config.iv);\n return createDecipheriv(suite, keys.key, keys.iv);\n }\n exports.createDecipher = createDecipher, exports.createDecipheriv = createDecipheriv;\n }\n}), require_browser5 = __commonJS({\n \"node_modules/browserify-aes/browser.js\"(exports) {\n var ciphers = require_encrypter(), deciphers = require_decrypter(), modes = require_list();\n function getCiphers() {\n return Object.keys(modes);\n }\n exports.createCipher = exports.Cipher = ciphers.createCipher, exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv, exports.createDecipher = exports.Decipher = deciphers.createDecipher, exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv, exports.listCiphers = exports.getCiphers = getCiphers;\n }\n}), require_modes2 = __commonJS({\n \"node_modules/browserify-des/modes.js\"(exports) {\n exports[\"des-ecb\"] = {\n key: 8,\n iv: 0\n }, exports[\"des-cbc\"] = exports.des = {\n key: 8,\n iv: 8\n }, exports[\"des-ede3-cbc\"] = exports.des3 = {\n key: 24,\n iv: 8\n }, exports[\"des-ede3\"] = {\n key: 24,\n iv: 0\n }, exports[\"des-ede-cbc\"] = {\n key: 16,\n iv: 8\n }, exports[\"des-ede\"] = {\n key: 16,\n iv: 0\n };\n }\n}), require_browser6 = __commonJS({\n \"node_modules/browserify-cipher/browser.js\"(exports) {\n var DES = require_browserify_des(), aes = require_browser5(), aesModes = require_modes(), desModes = require_modes2(), ebtk = require_evp_bytestokey();\n function createCipher(suite, password) {\n suite = suite.toLowerCase();\n var keyLen, ivLen;\n if (aesModes[suite])\n keyLen = aesModes[suite].key, ivLen = aesModes[suite].iv;\n else if (desModes[suite])\n keyLen = desModes[suite].key * 8, ivLen = desModes[suite].iv;\n else\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, keyLen, ivLen);\n return createCipheriv(suite, keys.key, keys.iv);\n }\n function createDecipher(suite, password) {\n suite = suite.toLowerCase();\n var keyLen, ivLen;\n if (aesModes[suite])\n keyLen = aesModes[suite].key, ivLen = aesModes[suite].iv;\n else if (desModes[suite])\n keyLen = desModes[suite].key * 8, ivLen = desModes[suite].iv;\n else\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, keyLen, ivLen);\n return createDecipheriv(suite, keys.key, keys.iv);\n }\n function createCipheriv(suite, key2, iv) {\n if (suite = suite.toLowerCase(), aesModes[suite])\n return aes.createCipheriv(suite, key2, iv);\n if (desModes[suite])\n return new DES({ key: key2, iv, mode: suite });\n @throwTypeError(\"invalid suite type\");\n }\n function createDecipheriv(suite, key2, iv) {\n if (suite = suite.toLowerCase(), aesModes[suite])\n return aes.createDecipheriv(suite, key2, iv);\n if (desModes[suite])\n return new DES({ key: key2, iv, mode: suite, decrypt: !0 });\n @throwTypeError(\"invalid suite type\");\n }\n function getCiphers() {\n return Object.keys(desModes).concat(aes.getCiphers());\n }\n exports.createCipher = exports.Cipher = createCipher, exports.createCipheriv = exports.Cipheriv = createCipheriv, exports.createDecipher = exports.Decipher = createDecipher, exports.createDecipheriv = exports.Decipheriv = createDecipheriv, exports.listCiphers = exports.getCiphers = getCiphers;\n }\n}), require_bn = __commonJS({\n \"node_modules/diffie-hellman/node_modules/bn.js/lib/bn.js\"(exports, module) {\n (function(module2, exports2) {\n function assert(val, msg) {\n if (!val)\n throw new Error(msg || \"Assertion failed\");\n }\n function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function() {\n };\n TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor, ctor.prototype.constructor = ctor;\n }\n function BN(number, base, endian) {\n if (BN.isBN(number))\n return number;\n this.negative = 0, this.words = null, this.length = 0, this.red = null, number !== null && ((base === \"le\" || base === \"be\") && (endian = base, base = 10), this._init(number || 0, base || 10, endian || \"be\"));\n }\n BN.prototype = {}, typeof module2 == \"object\" \? module2.exports = BN : exports2.BN = BN, BN.BN = BN, BN.wordSize = 26;\n var Buffer2 = Buffer;\n BN.isBN = function(num) {\n return num instanceof BN \? !0 : num !== null && typeof num == \"object\" && num.constructor.wordSize === BN.wordSize && @Array.isArray(num.words);\n }, BN.max = function(left, right) {\n return left.cmp(right) > 0 \? left : right;\n }, BN.min = function(left, right) {\n return left.cmp(right) < 0 \? left : right;\n }, BN.prototype._init = function(number, base, endian) {\n if (typeof number == \"number\")\n return this._initNumber(number, base, endian);\n if (typeof number == \"object\")\n return this._initArray(number, base, endian);\n base === \"hex\" && (base = 16), assert(base === (base | 0) && base >= 2 && base <= 36), number = number.toString().replace(/\\s+/g, \"\");\n var start = 0;\n number[0] === \"-\" && (start++, this.negative = 1), start < number.length && (base === 16 \? this._parseHex(number, start, endian) : (this._parseBase(number, base, start), endian === \"le\" && this._initArray(this.toArray(), base, endian)));\n }, BN.prototype._initNumber = function(number, base, endian) {\n number < 0 && (this.negative = 1, number = -number), number < 67108864 \? (this.words = [number & 67108863], this.length = 1) : number < 4503599627370496 \? (this.words = [number & 67108863, number / 67108864 & 67108863], this.length = 2) : (assert(number < 9007199254740992), this.words = [number & 67108863, number / 67108864 & 67108863, 1], this.length = 3), endian === \"le\" && this._initArray(this.toArray(), base, endian);\n }, BN.prototype._initArray = function(number, base, endian) {\n if (assert(typeof number.length == \"number\"), number.length <= 0)\n return this.words = [0], this.length = 1, this;\n this.length = Math.ceil(number.length / 3), this.words = new @Array(this.length);\n for (var i = 0;i < this.length; i++)\n this.words[i] = 0;\n var j, w, off = 0;\n if (endian === \"be\")\n for (i = number.length - 1, j = 0;i >= 0; i -= 3)\n w = number[i] | number[i - 1] << 8 | number[i - 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26 && (off -= 26, j++);\n else if (endian === \"le\")\n for (i = 0, j = 0;i < number.length; i += 3)\n w = number[i] | number[i + 1] << 8 | number[i + 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26 && (off -= 26, j++);\n return this.strip();\n };\n function parseHex4Bits(string, index) {\n var c = string.charCodeAt(index);\n return c >= 65 && c <= 70 \? c - 55 : c >= 97 && c <= 102 \? c - 87 : c - 48 & 15;\n }\n function parseHexByte(string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n return index - 1 >= lowerBound && (r |= parseHex4Bits(string, index - 1) << 4), r;\n }\n BN.prototype._parseHex = function(number, start, endian) {\n this.length = Math.ceil((number.length - start) / 6), this.words = new @Array(this.length);\n for (var i = 0;i < this.length; i++)\n this.words[i] = 0;\n var off = 0, j = 0, w;\n if (endian === \"be\")\n for (i = number.length - 1;i >= start; i -= 2)\n w = parseHexByte(number, start, i) << off, this.words[j] |= w & 67108863, off >= 18 \? (off -= 18, j += 1, this.words[j] |= w >>> 26) : off += 8;\n else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 \? start + 1 : start;i < number.length; i += 2)\n w = parseHexByte(number, start, i) << off, this.words[j] |= w & 67108863, off >= 18 \? (off -= 18, j += 1, this.words[j] |= w >>> 26) : off += 8;\n }\n this.strip();\n };\n function parseBase(str, start, end, mul) {\n for (var r = 0, len = Math.min(str.length, end), i = start;i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n r *= mul, c >= 49 \? r += c - 49 + 10 : c >= 17 \? r += c - 17 + 10 : r += c;\n }\n return r;\n }\n BN.prototype._parseBase = function(number, base, start) {\n this.words = [0], this.length = 1;\n for (var limbLen = 0, limbPow = 1;limbPow <= 67108863; limbPow *= base)\n limbLen++;\n limbLen--, limbPow = limbPow / base | 0;\n for (var total = number.length - start, mod = total % limbLen, end = Math.min(total, total - mod) + start, word = 0, i = start;i < end; i += limbLen)\n word = parseBase(number, i, i + limbLen, base), this.imuln(limbPow), this.words[0] + word < 67108864 \? this.words[0] += word : this._iaddn(word);\n if (mod !== 0) {\n var pow = 1;\n for (word = parseBase(number, i, number.length, base), i = 0;i < mod; i++)\n pow *= base;\n this.imuln(pow), this.words[0] + word < 67108864 \? this.words[0] += word : this._iaddn(word);\n }\n this.strip();\n }, BN.prototype.copy = function(dest) {\n dest.words = new @Array(this.length);\n for (var i = 0;i < this.length; i++)\n dest.words[i] = this.words[i];\n dest.length = this.length, dest.negative = this.negative, dest.red = this.red;\n }, BN.prototype.clone = function() {\n var r = new BN(null);\n return this.copy(r), r;\n }, BN.prototype._expand = function(size) {\n for (;this.length < size; )\n this.words[this.length++] = 0;\n return this;\n }, BN.prototype.strip = function() {\n for (;this.length > 1 && this.words[this.length - 1] === 0; )\n this.length--;\n return this._normSign();\n }, BN.prototype._normSign = function() {\n return this.length === 1 && this.words[0] === 0 && (this.negative = 0), this;\n }, BN.prototype.inspect = function() {\n return (this.red \? \"<BN-R: \" : \"<BN: \") + this.toString(16) + \">\";\n };\n var zeros = [\n \"\",\n \"0\",\n \"00\",\n \"000\",\n \"0000\",\n \"00000\",\n \"000000\",\n \"0000000\",\n \"00000000\",\n \"000000000\",\n \"0000000000\",\n \"00000000000\",\n \"000000000000\",\n \"0000000000000\",\n \"00000000000000\",\n \"000000000000000\",\n \"0000000000000000\",\n \"00000000000000000\",\n \"000000000000000000\",\n \"0000000000000000000\",\n \"00000000000000000000\",\n \"000000000000000000000\",\n \"0000000000000000000000\",\n \"00000000000000000000000\",\n \"000000000000000000000000\",\n \"0000000000000000000000000\"\n ], groupSizes = [\n 0,\n 0,\n 25,\n 16,\n 12,\n 11,\n 10,\n 9,\n 8,\n 8,\n 7,\n 7,\n 7,\n 7,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5\n ], groupBases = [\n 0,\n 0,\n 33554432,\n 43046721,\n 16777216,\n 48828125,\n 60466176,\n 40353607,\n 16777216,\n 43046721,\n 1e7,\n 19487171,\n 35831808,\n 62748517,\n 7529536,\n 11390625,\n 16777216,\n 24137569,\n 34012224,\n 47045881,\n 64000000,\n 4084101,\n 5153632,\n 6436343,\n 7962624,\n 9765625,\n 11881376,\n 14348907,\n 17210368,\n 20511149,\n 24300000,\n 28629151,\n 33554432,\n 39135393,\n 45435424,\n 52521875,\n 60466176\n ];\n BN.prototype.toString = function(base, padding) {\n base = base || 10, padding = padding | 0 || 1;\n var out;\n if (base === 16 || base === \"hex\") {\n out = \"\";\n for (var off = 0, carry = 0, i = 0;i < this.length; i++) {\n var w = this.words[i], word = ((w << off | carry) & 16777215).toString(16);\n carry = w >>> 24 - off & 16777215, carry !== 0 || i !== this.length - 1 \? out = zeros[6 - word.length] + word + out : out = word + out, off += 2, off >= 26 && (off -= 26, i--);\n }\n for (carry !== 0 && (out = carry.toString(16) + out);out.length % padding !== 0; )\n out = \"0\" + out;\n return this.negative !== 0 && (out = \"-\" + out), out;\n }\n if (base === (base | 0) && base >= 2 && base <= 36) {\n var groupSize = groupSizes[base], groupBase = groupBases[base];\n out = \"\";\n var c = this.clone();\n for (c.negative = 0;!c.isZero(); ) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase), c.isZero() \? out = r + out : out = zeros[groupSize - r.length] + r + out;\n }\n for (this.isZero() && (out = \"0\" + out);out.length % padding !== 0; )\n out = \"0\" + out;\n return this.negative !== 0 && (out = \"-\" + out), out;\n }\n assert(!1, \"Base should be between 2 and 36\");\n }, BN.prototype.toNumber = function() {\n var ret = this.words[0];\n return this.length === 2 \? ret += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 \? ret += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && assert(!1, \"Number can only safely store up to 53 bits\"), this.negative !== 0 \? -ret : ret;\n }, BN.prototype.toJSON = function() {\n return this.toString(16);\n }, BN.prototype.toBuffer = function(endian, length) {\n return assert(typeof Buffer2 < \"u\"), this.toArrayLike(Buffer2, endian, length);\n }, BN.prototype.toArray = function(endian, length) {\n return this.toArrayLike(@Array, endian, length);\n }, BN.prototype.toArrayLike = function(ArrayType, endian, length) {\n var byteLength = this.byteLength(), reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, \"byte array longer than desired length\"), assert(reqLength > 0, \"Requested array length <= 0\"), this.strip();\n var littleEndian = endian === \"le\", res = new ArrayType(reqLength), b, i, q = this.clone();\n if (littleEndian) {\n for (i = 0;!q.isZero(); i++)\n b = q.andln(255), q.iushrn(8), res[i] = b;\n for (;i < reqLength; i++)\n res[i] = 0;\n } else {\n for (i = 0;i < reqLength - byteLength; i++)\n res[i] = 0;\n for (i = 0;!q.isZero(); i++)\n b = q.andln(255), q.iushrn(8), res[reqLength - i - 1] = b;\n }\n return res;\n }, Math.clz32 \? BN.prototype._countBits = function(w) {\n return 32 - Math.clz32(w);\n } : BN.prototype._countBits = function(w) {\n var t = w, r = 0;\n return t >= 4096 && (r += 13, t >>>= 13), t >= 64 && (r += 7, t >>>= 7), t >= 8 && (r += 4, t >>>= 4), t >= 2 && (r += 2, t >>>= 2), r + t;\n }, BN.prototype._zeroBits = function(w) {\n if (w === 0)\n return 26;\n var t = w, r = 0;\n return (t & 8191) === 0 && (r += 13, t >>>= 13), (t & 127) === 0 && (r += 7, t >>>= 7), (t & 15) === 0 && (r += 4, t >>>= 4), (t & 3) === 0 && (r += 2, t >>>= 2), (t & 1) === 0 && r++, r;\n }, BN.prototype.bitLength = function() {\n var w = this.words[this.length - 1], hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n function toBitArray(num) {\n for (var w = new @Array(num.bitLength()), bit = 0;bit < w.length; bit++) {\n var off = bit / 26 | 0, wbit = bit % 26;\n w[bit] = (num.words[off] & 1 << wbit) >>> wbit;\n }\n return w;\n }\n BN.prototype.zeroBits = function() {\n if (this.isZero())\n return 0;\n for (var r = 0, i = 0;i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n if (r += b, b !== 26)\n break;\n }\n return r;\n }, BN.prototype.byteLength = function() {\n return Math.ceil(this.bitLength() / 8);\n }, BN.prototype.toTwos = function(width) {\n return this.negative !== 0 \? this.abs().inotn(width).iaddn(1) : this.clone();\n }, BN.prototype.fromTwos = function(width) {\n return this.testn(width - 1) \? this.notn(width).iaddn(1).ineg() : this.clone();\n }, BN.prototype.isNeg = function() {\n return this.negative !== 0;\n }, BN.prototype.neg = function() {\n return this.clone().ineg();\n }, BN.prototype.ineg = function() {\n return this.isZero() || (this.negative ^= 1), this;\n }, BN.prototype.iuor = function(num) {\n for (;this.length < num.length; )\n this.words[this.length++] = 0;\n for (var i = 0;i < num.length; i++)\n this.words[i] = this.words[i] | num.words[i];\n return this.strip();\n }, BN.prototype.ior = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuor(num);\n }, BN.prototype.or = function(num) {\n return this.length > num.length \? this.clone().ior(num) : num.clone().ior(this);\n }, BN.prototype.uor = function(num) {\n return this.length > num.length \? this.clone().iuor(num) : num.clone().iuor(this);\n }, BN.prototype.iuand = function(num) {\n var b;\n this.length > num.length \? b = num : b = this;\n for (var i = 0;i < b.length; i++)\n this.words[i] = this.words[i] & num.words[i];\n return this.length = b.length, this.strip();\n }, BN.prototype.iand = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuand(num);\n }, BN.prototype.and = function(num) {\n return this.length > num.length \? this.clone().iand(num) : num.clone().iand(this);\n }, BN.prototype.uand = function(num) {\n return this.length > num.length \? this.clone().iuand(num) : num.clone().iuand(this);\n }, BN.prototype.iuxor = function(num) {\n var a, b;\n this.length > num.length \? (a = this, b = num) : (a = num, b = this);\n for (var i = 0;i < b.length; i++)\n this.words[i] = a.words[i] ^ b.words[i];\n if (this !== a)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this.length = a.length, this.strip();\n }, BN.prototype.ixor = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuxor(num);\n }, BN.prototype.xor = function(num) {\n return this.length > num.length \? this.clone().ixor(num) : num.clone().ixor(this);\n }, BN.prototype.uxor = function(num) {\n return this.length > num.length \? this.clone().iuxor(num) : num.clone().iuxor(this);\n }, BN.prototype.inotn = function(width) {\n assert(typeof width == \"number\" && width >= 0);\n var bytesNeeded = Math.ceil(width / 26) | 0, bitsLeft = width % 26;\n this._expand(bytesNeeded), bitsLeft > 0 && bytesNeeded--;\n for (var i = 0;i < bytesNeeded; i++)\n this.words[i] = ~this.words[i] & 67108863;\n return bitsLeft > 0 && (this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft), this.strip();\n }, BN.prototype.notn = function(width) {\n return this.clone().inotn(width);\n }, BN.prototype.setn = function(bit, val) {\n assert(typeof bit == \"number\" && bit >= 0);\n var off = bit / 26 | 0, wbit = bit % 26;\n return this._expand(off + 1), val \? this.words[off] = this.words[off] | 1 << wbit : this.words[off] = this.words[off] & ~(1 << wbit), this.strip();\n }, BN.prototype.iadd = function(num) {\n var r;\n if (this.negative !== 0 && num.negative === 0)\n return this.negative = 0, r = this.isub(num), this.negative ^= 1, this._normSign();\n if (this.negative === 0 && num.negative !== 0)\n return num.negative = 0, r = this.isub(num), num.negative = 1, r._normSign();\n var a, b;\n this.length > num.length \? (a = this, b = num) : (a = num, b = this);\n for (var carry = 0, i = 0;i < b.length; i++)\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry, this.words[i] = r & 67108863, carry = r >>> 26;\n for (;carry !== 0 && i < a.length; i++)\n r = (a.words[i] | 0) + carry, this.words[i] = r & 67108863, carry = r >>> 26;\n if (this.length = a.length, carry !== 0)\n this.words[this.length] = carry, this.length++;\n else if (a !== this)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this;\n }, BN.prototype.add = function(num) {\n var res;\n return num.negative !== 0 && this.negative === 0 \? (num.negative = 0, res = this.sub(num), num.negative ^= 1, res) : num.negative === 0 && this.negative !== 0 \? (this.negative = 0, res = num.sub(this), this.negative = 1, res) : this.length > num.length \? this.clone().iadd(num) : num.clone().iadd(this);\n }, BN.prototype.isub = function(num) {\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n return num.negative = 1, r._normSign();\n } else if (this.negative !== 0)\n return this.negative = 0, this.iadd(num), this.negative = 1, this._normSign();\n var cmp = this.cmp(num);\n if (cmp === 0)\n return this.negative = 0, this.length = 1, this.words[0] = 0, this;\n var a, b;\n cmp > 0 \? (a = this, b = num) : (a = num, b = this);\n for (var carry = 0, i = 0;i < b.length; i++)\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry, carry = r >> 26, this.words[i] = r & 67108863;\n for (;carry !== 0 && i < a.length; i++)\n r = (a.words[i] | 0) + carry, carry = r >> 26, this.words[i] = r & 67108863;\n if (carry === 0 && i < a.length && a !== this)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this.length = Math.max(this.length, i), a !== this && (this.negative = 1), this.strip();\n }, BN.prototype.sub = function(num) {\n return this.clone().isub(num);\n };\n function smallMulTo(self2, num, out) {\n out.negative = num.negative ^ self2.negative;\n var len = self2.length + num.length | 0;\n out.length = len, len = len - 1 | 0;\n var a = self2.words[0] | 0, b = num.words[0] | 0, r = a * b, lo = r & 67108863, carry = r / 67108864 | 0;\n out.words[0] = lo;\n for (var k = 1;k < len; k++) {\n for (var ncarry = carry >>> 26, rword = carry & 67108863, maxJ = Math.min(k, num.length - 1), j = Math.max(0, k - self2.length + 1);j <= maxJ; j++) {\n var i = k - j | 0;\n a = self2.words[i] | 0, b = num.words[j] | 0, r = a * b + rword, ncarry += r / 67108864 | 0, rword = r & 67108863;\n }\n out.words[k] = rword | 0, carry = ncarry | 0;\n }\n return carry !== 0 \? out.words[k] = carry | 0 : out.length--, out.strip();\n }\n var comb10MulTo = function(self2, num, out) {\n var a = self2.words, b = num.words, o = out.words, c = 0, lo, mid, hi, a0 = a[0] | 0, al0 = a0 & 8191, ah0 = a0 >>> 13, a1 = a[1] | 0, al1 = a1 & 8191, ah1 = a1 >>> 13, a2 = a[2] | 0, al2 = a2 & 8191, ah2 = a2 >>> 13, a3 = a[3] | 0, al3 = a3 & 8191, ah3 = a3 >>> 13, a4 = a[4] | 0, al4 = a4 & 8191, ah4 = a4 >>> 13, a5 = a[5] | 0, al5 = a5 & 8191, ah5 = a5 >>> 13, a6 = a[6] | 0, al6 = a6 & 8191, ah6 = a6 >>> 13, a7 = a[7] | 0, al7 = a7 & 8191, ah7 = a7 >>> 13, a8 = a[8] | 0, al8 = a8 & 8191, ah8 = a8 >>> 13, a9 = a[9] | 0, al9 = a9 & 8191, ah9 = a9 >>> 13, b0 = b[0] | 0, bl0 = b0 & 8191, bh0 = b0 >>> 13, b1 = b[1] | 0, bl1 = b1 & 8191, bh1 = b1 >>> 13, b2 = b[2] | 0, bl2 = b2 & 8191, bh2 = b2 >>> 13, b3 = b[3] | 0, bl3 = b3 & 8191, bh3 = b3 >>> 13, b4 = b[4] | 0, bl4 = b4 & 8191, bh4 = b4 >>> 13, b5 = b[5] | 0, bl5 = b5 & 8191, bh5 = b5 >>> 13, b6 = b[6] | 0, bl6 = b6 & 8191, bh6 = b6 >>> 13, b7 = b[7] | 0, bl7 = b7 & 8191, bh7 = b7 >>> 13, b8 = b[8] | 0, bl8 = b8 & 8191, bh8 = b8 >>> 13, b9 = b[9] | 0, bl9 = b9 & 8191, bh9 = b9 >>> 13;\n out.negative = self2.negative ^ num.negative, out.length = 19, lo = Math.imul(al0, bl0), mid = Math.imul(al0, bh0), mid = mid + Math.imul(ah0, bl0) | 0, hi = Math.imul(ah0, bh0);\n var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0, w0 &= 67108863, lo = Math.imul(al1, bl0), mid = Math.imul(al1, bh0), mid = mid + Math.imul(ah1, bl0) | 0, hi = Math.imul(ah1, bh0), lo = lo + Math.imul(al0, bl1) | 0, mid = mid + Math.imul(al0, bh1) | 0, mid = mid + Math.imul(ah0, bl1) | 0, hi = hi + Math.imul(ah0, bh1) | 0;\n var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0, w1 &= 67108863, lo = Math.imul(al2, bl0), mid = Math.imul(al2, bh0), mid = mid + Math.imul(ah2, bl0) | 0, hi = Math.imul(ah2, bh0), lo = lo + Math.imul(al1, bl1) | 0, mid = mid + Math.imul(al1, bh1) | 0, mid = mid + Math.imul(ah1, bl1) | 0, hi = hi + Math.imul(ah1, bh1) | 0, lo = lo + Math.imul(al0, bl2) | 0, mid = mid + Math.imul(al0, bh2) | 0, mid = mid + Math.imul(ah0, bl2) | 0, hi = hi + Math.imul(ah0, bh2) | 0;\n var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0, w2 &= 67108863, lo = Math.imul(al3, bl0), mid = Math.imul(al3, bh0), mid = mid + Math.imul(ah3, bl0) | 0, hi = Math.imul(ah3, bh0), lo = lo + Math.imul(al2, bl1) | 0, mid = mid + Math.imul(al2, bh1) | 0, mid = mid + Math.imul(ah2, bl1) | 0, hi = hi + Math.imul(ah2, bh1) | 0, lo = lo + Math.imul(al1, bl2) | 0, mid = mid + Math.imul(al1, bh2) | 0, mid = mid + Math.imul(ah1, bl2) | 0, hi = hi + Math.imul(ah1, bh2) | 0, lo = lo + Math.imul(al0, bl3) | 0, mid = mid + Math.imul(al0, bh3) | 0, mid = mid + Math.imul(ah0, bl3) | 0, hi = hi + Math.imul(ah0, bh3) | 0;\n var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0, w3 &= 67108863, lo = Math.imul(al4, bl0), mid = Math.imul(al4, bh0), mid = mid + Math.imul(ah4, bl0) | 0, hi = Math.imul(ah4, bh0), lo = lo + Math.imul(al3, bl1) | 0, mid = mid + Math.imul(al3, bh1) | 0, mid = mid + Math.imul(ah3, bl1) | 0, hi = hi + Math.imul(ah3, bh1) | 0, lo = lo + Math.imul(al2, bl2) | 0, mid = mid + Math.imul(al2, bh2) | 0, mid = mid + Math.imul(ah2, bl2) | 0, hi = hi + Math.imul(ah2, bh2) | 0, lo = lo + Math.imul(al1, bl3) | 0, mid = mid + Math.imul(al1, bh3) | 0, mid = mid + Math.imul(ah1, bl3) | 0, hi = hi + Math.imul(ah1, bh3) | 0, lo = lo + Math.imul(al0, bl4) | 0, mid = mid + Math.imul(al0, bh4) | 0, mid = mid + Math.imul(ah0, bl4) | 0, hi = hi + Math.imul(ah0, bh4) | 0;\n var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0, w4 &= 67108863, lo = Math.imul(al5, bl0), mid = Math.imul(al5, bh0), mid = mid + Math.imul(ah5, bl0) | 0, hi = Math.imul(ah5, bh0), lo = lo + Math.imul(al4, bl1) | 0, mid = mid + Math.imul(al4, bh1) | 0, mid = mid + Math.imul(ah4, bl1) | 0, hi = hi + Math.imul(ah4, bh1) | 0, lo = lo + Math.imul(al3, bl2) | 0, mid = mid + Math.imul(al3, bh2) | 0, mid = mid + Math.imul(ah3, bl2) | 0, hi = hi + Math.imul(ah3, bh2) | 0, lo = lo + Math.imul(al2, bl3) | 0, mid = mid + Math.imul(al2, bh3) | 0, mid = mid + Math.imul(ah2, bl3) | 0, hi = hi + Math.imul(ah2, bh3) | 0, lo = lo + Math.imul(al1, bl4) | 0, mid = mid + Math.imul(al1, bh4) | 0, mid = mid + Math.imul(ah1, bl4) | 0, hi = hi + Math.imul(ah1, bh4) | 0, lo = lo + Math.imul(al0, bl5) | 0, mid = mid + Math.imul(al0, bh5) | 0, mid = mid + Math.imul(ah0, bl5) | 0, hi = hi + Math.imul(ah0, bh5) | 0;\n var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0, w5 &= 67108863, lo = Math.imul(al6, bl0), mid = Math.imul(al6, bh0), mid = mid + Math.imul(ah6, bl0) | 0, hi = Math.imul(ah6, bh0), lo = lo + Math.imul(al5, bl1) | 0, mid = mid + Math.imul(al5, bh1) | 0, mid = mid + Math.imul(ah5, bl1) | 0, hi = hi + Math.imul(ah5, bh1) | 0, lo = lo + Math.imul(al4, bl2) | 0, mid = mid + Math.imul(al4, bh2) | 0, mid = mid + Math.imul(ah4, bl2) | 0, hi = hi + Math.imul(ah4, bh2) | 0, lo = lo + Math.imul(al3, bl3) | 0, mid = mid + Math.imul(al3, bh3) | 0, mid = mid + Math.imul(ah3, bl3) | 0, hi = hi + Math.imul(ah3, bh3) | 0, lo = lo + Math.imul(al2, bl4) | 0, mid = mid + Math.imul(al2, bh4) | 0, mid = mid + Math.imul(ah2, bl4) | 0, hi = hi + Math.imul(ah2, bh4) | 0, lo = lo + Math.imul(al1, bl5) | 0, mid = mid + Math.imul(al1, bh5) | 0, mid = mid + Math.imul(ah1, bl5) | 0, hi = hi + Math.imul(ah1, bh5) | 0, lo = lo + Math.imul(al0, bl6) | 0, mid = mid + Math.imul(al0, bh6) | 0, mid = mid + Math.imul(ah0, bl6) | 0, hi = hi + Math.imul(ah0, bh6) | 0;\n var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0, w6 &= 67108863, lo = Math.imul(al7, bl0), mid = Math.imul(al7, bh0), mid = mid + Math.imul(ah7, bl0) | 0, hi = Math.imul(ah7, bh0), lo = lo + Math.imul(al6, bl1) | 0, mid = mid + Math.imul(al6, bh1) | 0, mid = mid + Math.imul(ah6, bl1) | 0, hi = hi + Math.imul(ah6, bh1) | 0, lo = lo + Math.imul(al5, bl2) | 0, mid = mid + Math.imul(al5, bh2) | 0, mid = mid + Math.imul(ah5, bl2) | 0, hi = hi + Math.imul(ah5, bh2) | 0, lo = lo + Math.imul(al4, bl3) | 0, mid = mid + Math.imul(al4, bh3) | 0, mid = mid + Math.imul(ah4, bl3) | 0, hi = hi + Math.imul(ah4, bh3) | 0, lo = lo + Math.imul(al3, bl4) | 0, mid = mid + Math.imul(al3, bh4) | 0, mid = mid + Math.imul(ah3, bl4) | 0, hi = hi + Math.imul(ah3, bh4) | 0, lo = lo + Math.imul(al2, bl5) | 0, mid = mid + Math.imul(al2, bh5) | 0, mid = mid + Math.imul(ah2, bl5) | 0, hi = hi + Math.imul(ah2, bh5) | 0, lo = lo + Math.imul(al1, bl6) | 0, mid = mid + Math.imul(al1, bh6) | 0, mid = mid + Math.imul(ah1, bl6) | 0, hi = hi + Math.imul(ah1, bh6) | 0, lo = lo + Math.imul(al0, bl7) | 0, mid = mid + Math.imul(al0, bh7) | 0, mid = mid + Math.imul(ah0, bl7) | 0, hi = hi + Math.imul(ah0, bh7) | 0;\n var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0, w7 &= 67108863, lo = Math.imul(al8, bl0), mid = Math.imul(al8, bh0), mid = mid + Math.imul(ah8, bl0) | 0, hi = Math.imul(ah8, bh0), lo = lo + Math.imul(al7, bl1) | 0, mid = mid + Math.imul(al7, bh1) | 0, mid = mid + Math.imul(ah7, bl1) | 0, hi = hi + Math.imul(ah7, bh1) | 0, lo = lo + Math.imul(al6, bl2) | 0, mid = mid + Math.imul(al6, bh2) | 0, mid = mid + Math.imul(ah6, bl2) | 0, hi = hi + Math.imul(ah6, bh2) | 0, lo = lo + Math.imul(al5, bl3) | 0, mid = mid + Math.imul(al5, bh3) | 0, mid = mid + Math.imul(ah5, bl3) | 0, hi = hi + Math.imul(ah5, bh3) | 0, lo = lo + Math.imul(al4, bl4) | 0, mid = mid + Math.imul(al4, bh4) | 0, mid = mid + Math.imul(ah4, bl4) | 0, hi = hi + Math.imul(ah4, bh4) | 0, lo = lo + Math.imul(al3, bl5) | 0, mid = mid + Math.imul(al3, bh5) | 0, mid = mid + Math.imul(ah3, bl5) | 0, hi = hi + Math.imul(ah3, bh5) | 0, lo = lo + Math.imul(al2, bl6) | 0, mid = mid + Math.imul(al2, bh6) | 0, mid = mid + Math.imul(ah2, bl6) | 0, hi = hi + Math.imul(ah2, bh6) | 0, lo = lo + Math.imul(al1, bl7) | 0, mid = mid + Math.imul(al1, bh7) | 0, mid = mid + Math.imul(ah1, bl7) | 0, hi = hi + Math.imul(ah1, bh7) | 0, lo = lo + Math.imul(al0, bl8) | 0, mid = mid + Math.imul(al0, bh8) | 0, mid = mid + Math.imul(ah0, bl8) | 0, hi = hi + Math.imul(ah0, bh8) | 0;\n var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0, w8 &= 67108863, lo = Math.imul(al9, bl0), mid = Math.imul(al9, bh0), mid = mid + Math.imul(ah9, bl0) | 0, hi = Math.imul(ah9, bh0), lo = lo + Math.imul(al8, bl1) | 0, mid = mid + Math.imul(al8, bh1) | 0, mid = mid + Math.imul(ah8, bl1) | 0, hi = hi + Math.imul(ah8, bh1) | 0, lo = lo + Math.imul(al7, bl2) | 0, mid = mid + Math.imul(al7, bh2) | 0, mid = mid + Math.imul(ah7, bl2) | 0, hi = hi + Math.imul(ah7, bh2) | 0, lo = lo + Math.imul(al6, bl3) | 0, mid = mid + Math.imul(al6, bh3) | 0, mid = mid + Math.imul(ah6, bl3) | 0, hi = hi + Math.imul(ah6, bh3) | 0, lo = lo + Math.imul(al5, bl4) | 0, mid = mid + Math.imul(al5, bh4) | 0, mid = mid + Math.imul(ah5, bl4) | 0, hi = hi + Math.imul(ah5, bh4) | 0, lo = lo + Math.imul(al4, bl5) | 0, mid = mid + Math.imul(al4, bh5) | 0, mid = mid + Math.imul(ah4, bl5) | 0, hi = hi + Math.imul(ah4, bh5) | 0, lo = lo + Math.imul(al3, bl6) | 0, mid = mid + Math.imul(al3, bh6) | 0, mid = mid + Math.imul(ah3, bl6) | 0, hi = hi + Math.imul(ah3, bh6) | 0, lo = lo + Math.imul(al2, bl7) | 0, mid = mid + Math.imul(al2, bh7) | 0, mid = mid + Math.imul(ah2, bl7) | 0, hi = hi + Math.imul(ah2, bh7) | 0, lo = lo + Math.imul(al1, bl8) | 0, mid = mid + Math.imul(al1, bh8) | 0, mid = mid + Math.imul(ah1, bl8) | 0, hi = hi + Math.imul(ah1, bh8) | 0, lo = lo + Math.imul(al0, bl9) | 0, mid = mid + Math.imul(al0, bh9) | 0, mid = mid + Math.imul(ah0, bl9) | 0, hi = hi + Math.imul(ah0, bh9) | 0;\n var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0, w9 &= 67108863, lo = Math.imul(al9, bl1), mid = Math.imul(al9, bh1), mid = mid + Math.imul(ah9, bl1) | 0, hi = Math.imul(ah9, bh1), lo = lo + Math.imul(al8, bl2) | 0, mid = mid + Math.imul(al8, bh2) | 0, mid = mid + Math.imul(ah8, bl2) | 0, hi = hi + Math.imul(ah8, bh2) | 0, lo = lo + Math.imul(al7, bl3) | 0, mid = mid + Math.imul(al7, bh3) | 0, mid = mid + Math.imul(ah7, bl3) | 0, hi = hi + Math.imul(ah7, bh3) | 0, lo = lo + Math.imul(al6, bl4) | 0, mid = mid + Math.imul(al6, bh4) | 0, mid = mid + Math.imul(ah6, bl4) | 0, hi = hi + Math.imul(ah6, bh4) | 0, lo = lo + Math.imul(al5, bl5) | 0, mid = mid + Math.imul(al5, bh5) | 0, mid = mid + Math.imul(ah5, bl5) | 0, hi = hi + Math.imul(ah5, bh5) | 0, lo = lo + Math.imul(al4, bl6) | 0, mid = mid + Math.imul(al4, bh6) | 0, mid = mid + Math.imul(ah4, bl6) | 0, hi = hi + Math.imul(ah4, bh6) | 0, lo = lo + Math.imul(al3, bl7) | 0, mid = mid + Math.imul(al3, bh7) | 0, mid = mid + Math.imul(ah3, bl7) | 0, hi = hi + Math.imul(ah3, bh7) | 0, lo = lo + Math.imul(al2, bl8) | 0, mid = mid + Math.imul(al2, bh8) | 0, mid = mid + Math.imul(ah2, bl8) | 0, hi = hi + Math.imul(ah2, bh8) | 0, lo = lo + Math.imul(al1, bl9) | 0, mid = mid + Math.imul(al1, bh9) | 0, mid = mid + Math.imul(ah1, bl9) | 0, hi = hi + Math.imul(ah1, bh9) | 0;\n var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0, w10 &= 67108863, lo = Math.imul(al9, bl2), mid = Math.imul(al9, bh2), mid = mid + Math.imul(ah9, bl2) | 0, hi = Math.imul(ah9, bh2), lo = lo + Math.imul(al8, bl3) | 0, mid = mid + Math.imul(al8, bh3) | 0, mid = mid + Math.imul(ah8, bl3) | 0, hi = hi + Math.imul(ah8, bh3) | 0, lo = lo + Math.imul(al7, bl4) | 0, mid = mid + Math.imul(al7, bh4) | 0, mid = mid + Math.imul(ah7, bl4) | 0, hi = hi + Math.imul(ah7, bh4) | 0, lo = lo + Math.imul(al6, bl5) | 0, mid = mid + Math.imul(al6, bh5) | 0, mid = mid + Math.imul(ah6, bl5) | 0, hi = hi + Math.imul(ah6, bh5) | 0, lo = lo + Math.imul(al5, bl6) | 0, mid = mid + Math.imul(al5, bh6) | 0, mid = mid + Math.imul(ah5, bl6) | 0, hi = hi + Math.imul(ah5, bh6) | 0, lo = lo + Math.imul(al4, bl7) | 0, mid = mid + Math.imul(al4, bh7) | 0, mid = mid + Math.imul(ah4, bl7) | 0, hi = hi + Math.imul(ah4, bh7) | 0, lo = lo + Math.imul(al3, bl8) | 0, mid = mid + Math.imul(al3, bh8) | 0, mid = mid + Math.imul(ah3, bl8) | 0, hi = hi + Math.imul(ah3, bh8) | 0, lo = lo + Math.imul(al2, bl9) | 0, mid = mid + Math.imul(al2, bh9) | 0, mid = mid + Math.imul(ah2, bl9) | 0, hi = hi + Math.imul(ah2, bh9) | 0;\n var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0, w11 &= 67108863, lo = Math.imul(al9, bl3), mid = Math.imul(al9, bh3), mid = mid + Math.imul(ah9, bl3) | 0, hi = Math.imul(ah9, bh3), lo = lo + Math.imul(al8, bl4) | 0, mid = mid + Math.imul(al8, bh4) | 0, mid = mid + Math.imul(ah8, bl4) | 0, hi = hi + Math.imul(ah8, bh4) | 0, lo = lo + Math.imul(al7, bl5) | 0, mid = mid + Math.imul(al7, bh5) | 0, mid = mid + Math.imul(ah7, bl5) | 0, hi = hi + Math.imul(ah7, bh5) | 0, lo = lo + Math.imul(al6, bl6) | 0, mid = mid + Math.imul(al6, bh6) | 0, mid = mid + Math.imul(ah6, bl6) | 0, hi = hi + Math.imul(ah6, bh6) | 0, lo = lo + Math.imul(al5, bl7) | 0, mid = mid + Math.imul(al5, bh7) | 0, mid = mid + Math.imul(ah5, bl7) | 0, hi = hi + Math.imul(ah5, bh7) | 0, lo = lo + Math.imul(al4, bl8) | 0, mid = mid + Math.imul(al4, bh8) | 0, mid = mid + Math.imul(ah4, bl8) | 0, hi = hi + Math.imul(ah4, bh8) | 0, lo = lo + Math.imul(al3, bl9) | 0, mid = mid + Math.imul(al3, bh9) | 0, mid = mid + Math.imul(ah3, bl9) | 0, hi = hi + Math.imul(ah3, bh9) | 0;\n var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0, w12 &= 67108863, lo = Math.imul(al9, bl4), mid = Math.imul(al9, bh4), mid = mid + Math.imul(ah9, bl4) | 0, hi = Math.imul(ah9, bh4), lo = lo + Math.imul(al8, bl5) | 0, mid = mid + Math.imul(al8, bh5) | 0, mid = mid + Math.imul(ah8, bl5) | 0, hi = hi + Math.imul(ah8, bh5) | 0, lo = lo + Math.imul(al7, bl6) | 0, mid = mid + Math.imul(al7, bh6) | 0, mid = mid + Math.imul(ah7, bl6) | 0, hi = hi + Math.imul(ah7, bh6) | 0, lo = lo + Math.imul(al6, bl7) | 0, mid = mid + Math.imul(al6, bh7) | 0, mid = mid + Math.imul(ah6, bl7) | 0, hi = hi + Math.imul(ah6, bh7) | 0, lo = lo + Math.imul(al5, bl8) | 0, mid = mid + Math.imul(al5, bh8) | 0, mid = mid + Math.imul(ah5, bl8) | 0, hi = hi + Math.imul(ah5, bh8) | 0, lo = lo + Math.imul(al4, bl9) | 0, mid = mid + Math.imul(al4, bh9) | 0, mid = mid + Math.imul(ah4, bl9) | 0, hi = hi + Math.imul(ah4, bh9) | 0;\n var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0, w13 &= 67108863, lo = Math.imul(al9, bl5), mid = Math.imul(al9, bh5), mid = mid + Math.imul(ah9, bl5) | 0, hi = Math.imul(ah9, bh5), lo = lo + Math.imul(al8, bl6) | 0, mid = mid + Math.imul(al8, bh6) | 0, mid = mid + Math.imul(ah8, bl6) | 0, hi = hi + Math.imul(ah8, bh6) | 0, lo = lo + Math.imul(al7, bl7) | 0, mid = mid + Math.imul(al7, bh7) | 0, mid = mid + Math.imul(ah7, bl7) | 0, hi = hi + Math.imul(ah7, bh7) | 0, lo = lo + Math.imul(al6, bl8) | 0, mid = mid + Math.imul(al6, bh8) | 0, mid = mid + Math.imul(ah6, bl8) | 0, hi = hi + Math.imul(ah6, bh8) | 0, lo = lo + Math.imul(al5, bl9) | 0, mid = mid + Math.imul(al5, bh9) | 0, mid = mid + Math.imul(ah5, bl9) | 0, hi = hi + Math.imul(ah5, bh9) | 0;\n var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0, w14 &= 67108863, lo = Math.imul(al9, bl6), mid = Math.imul(al9, bh6), mid = mid + Math.imul(ah9, bl6) | 0, hi = Math.imul(ah9, bh6), lo = lo + Math.imul(al8, bl7) | 0, mid = mid + Math.imul(al8, bh7) | 0, mid = mid + Math.imul(ah8, bl7) | 0, hi = hi + Math.imul(ah8, bh7) | 0, lo = lo + Math.imul(al7, bl8) | 0, mid = mid + Math.imul(al7, bh8) | 0, mid = mid + Math.imul(ah7, bl8) | 0, hi = hi + Math.imul(ah7, bh8) | 0, lo = lo + Math.imul(al6, bl9) | 0, mid = mid + Math.imul(al6, bh9) | 0, mid = mid + Math.imul(ah6, bl9) | 0, hi = hi + Math.imul(ah6, bh9) | 0;\n var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0, w15 &= 67108863, lo = Math.imul(al9, bl7), mid = Math.imul(al9, bh7), mid = mid + Math.imul(ah9, bl7) | 0, hi = Math.imul(ah9, bh7), lo = lo + Math.imul(al8, bl8) | 0, mid = mid + Math.imul(al8, bh8) | 0, mid = mid + Math.imul(ah8, bl8) | 0, hi = hi + Math.imul(ah8, bh8) | 0, lo = lo + Math.imul(al7, bl9) | 0, mid = mid + Math.imul(al7, bh9) | 0, mid = mid + Math.imul(ah7, bl9) | 0, hi = hi + Math.imul(ah7, bh9) | 0;\n var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0, w16 &= 67108863, lo = Math.imul(al9, bl8), mid = Math.imul(al9, bh8), mid = mid + Math.imul(ah9, bl8) | 0, hi = Math.imul(ah9, bh8), lo = lo + Math.imul(al8, bl9) | 0, mid = mid + Math.imul(al8, bh9) | 0, mid = mid + Math.imul(ah8, bl9) | 0, hi = hi + Math.imul(ah8, bh9) | 0;\n var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0, w17 &= 67108863, lo = Math.imul(al9, bl9), mid = Math.imul(al9, bh9), mid = mid + Math.imul(ah9, bl9) | 0, hi = Math.imul(ah9, bh9);\n var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n return c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0, w18 &= 67108863, o[0] = w0, o[1] = w1, o[2] = w2, o[3] = w3, o[4] = w4, o[5] = w5, o[6] = w6, o[7] = w7, o[8] = w8, o[9] = w9, o[10] = w10, o[11] = w11, o[12] = w12, o[13] = w13, o[14] = w14, o[15] = w15, o[16] = w16, o[17] = w17, o[18] = w18, c !== 0 && (o[19] = c, out.length++), out;\n };\n Math.imul || (comb10MulTo = smallMulTo);\n function bigMulTo(self2, num, out) {\n out.negative = num.negative ^ self2.negative, out.length = self2.length + num.length;\n for (var carry = 0, hncarry = 0, k = 0;k < out.length - 1; k++) {\n var ncarry = hncarry;\n hncarry = 0;\n for (var rword = carry & 67108863, maxJ = Math.min(k, num.length - 1), j = Math.max(0, k - self2.length + 1);j <= maxJ; j++) {\n var i = k - j, a = self2.words[i] | 0, b = num.words[j] | 0, r = a * b, lo = r & 67108863;\n ncarry = ncarry + (r / 67108864 | 0) | 0, lo = lo + rword | 0, rword = lo & 67108863, ncarry = ncarry + (lo >>> 26) | 0, hncarry += ncarry >>> 26, ncarry &= 67108863;\n }\n out.words[k] = rword, carry = ncarry, ncarry = hncarry;\n }\n return carry !== 0 \? out.words[k] = carry : out.length--, out.strip();\n }\n function jumboMulTo(self2, num, out) {\n var fftm = new FFTM;\n return fftm.mulp(self2, num, out);\n }\n BN.prototype.mulTo = function(num, out) {\n var res, len = this.length + num.length;\n return this.length === 10 && num.length === 10 \? res = comb10MulTo(this, num, out) : len < 63 \? res = smallMulTo(this, num, out) : len < 1024 \? res = bigMulTo(this, num, out) : res = jumboMulTo(this, num, out), res;\n };\n function FFTM(x, y) {\n this.x = x, this.y = y;\n }\n FFTM.prototype = {}, FFTM.prototype.makeRBT = function(N) {\n for (var t = new @Array(N), l = BN.prototype._countBits(N) - 1, i = 0;i < N; i++)\n t[i] = this.revBin(i, l, N);\n return t;\n }, FFTM.prototype.revBin = function(x, l, N) {\n if (x === 0 || x === N - 1)\n return x;\n for (var rb = 0, i = 0;i < l; i++)\n rb |= (x & 1) << l - i - 1, x >>= 1;\n return rb;\n }, FFTM.prototype.permute = function(rbt, rws, iws, rtws, itws, N) {\n for (var i = 0;i < N; i++)\n rtws[i] = rws[rbt[i]], itws[i] = iws[rbt[i]];\n }, FFTM.prototype.transform = function(rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n for (var s = 1;s < N; s <<= 1)\n for (var l = s << 1, rtwdf = Math.cos(2 * Math.PI / l), itwdf = Math.sin(2 * Math.PI / l), p = 0;p < N; p += l)\n for (var rtwdf_ = rtwdf, itwdf_ = itwdf, j = 0;j < s; j++) {\n var re = rtws[p + j], ie = itws[p + j], ro = rtws[p + j + s], io = itws[p + j + s], rx = rtwdf_ * ro - itwdf_ * io;\n io = rtwdf_ * io + itwdf_ * ro, ro = rx, rtws[p + j] = re + ro, itws[p + j] = ie + io, rtws[p + j + s] = re - ro, itws[p + j + s] = ie - io, j !== l && (rx = rtwdf * rtwdf_ - itwdf * itwdf_, itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_, rtwdf_ = rx);\n }\n }, FFTM.prototype.guessLen13b = function(n, m) {\n var N = Math.max(m, n) | 1, odd = N & 1, i = 0;\n for (N = N / 2 | 0;N; N = N >>> 1)\n i++;\n return 1 << i + 1 + odd;\n }, FFTM.prototype.conjugate = function(rws, iws, N) {\n if (!(N <= 1))\n for (var i = 0;i < N / 2; i++) {\n var t = rws[i];\n rws[i] = rws[N - i - 1], rws[N - i - 1] = t, t = iws[i], iws[i] = -iws[N - i - 1], iws[N - i - 1] = -t;\n }\n }, FFTM.prototype.normalize13b = function(ws, N) {\n for (var carry = 0, i = 0;i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;\n ws[i] = w & 67108863, w < 67108864 \? carry = 0 : carry = w / 67108864 | 0;\n }\n return ws;\n }, FFTM.prototype.convert13b = function(ws, len, rws, N) {\n for (var carry = 0, i = 0;i < len; i++)\n carry = carry + (ws[i] | 0), rws[2 * i] = carry & 8191, carry = carry >>> 13, rws[2 * i + 1] = carry & 8191, carry = carry >>> 13;\n for (i = 2 * len;i < N; ++i)\n rws[i] = 0;\n assert(carry === 0), assert((carry & -8192) === 0);\n }, FFTM.prototype.stub = function(N) {\n for (var ph = new @Array(N), i = 0;i < N; i++)\n ph[i] = 0;\n return ph;\n }, FFTM.prototype.mulp = function(x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length), rbt = this.makeRBT(N), _ = this.stub(N), rws = new @Array(N), rwst = new @Array(N), iwst = new @Array(N), nrws = new @Array(N), nrwst = new @Array(N), niwst = new @Array(N), rmws = out.words;\n rmws.length = N, this.convert13b(x.words, x.length, rws, N), this.convert13b(y.words, y.length, nrws, N), this.transform(rws, _, rwst, iwst, N, rbt), this.transform(nrws, _, nrwst, niwst, N, rbt);\n for (var i = 0;i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i], rwst[i] = rx;\n }\n return this.conjugate(rwst, iwst, N), this.transform(rwst, iwst, rmws, _, N, rbt), this.conjugate(rmws, _, N), this.normalize13b(rmws, N), out.negative = x.negative ^ y.negative, out.length = x.length + y.length, out.strip();\n }, BN.prototype.mul = function(num) {\n var out = new BN(null);\n return out.words = new @Array(this.length + num.length), this.mulTo(num, out);\n }, BN.prototype.mulf = function(num) {\n var out = new BN(null);\n return out.words = new @Array(this.length + num.length), jumboMulTo(this, num, out);\n }, BN.prototype.imul = function(num) {\n return this.clone().mulTo(num, this);\n }, BN.prototype.imuln = function(num) {\n assert(typeof num == \"number\"), assert(num < 67108864);\n for (var carry = 0, i = 0;i < this.length; i++) {\n var w = (this.words[i] | 0) * num, lo = (w & 67108863) + (carry & 67108863);\n carry >>= 26, carry += w / 67108864 | 0, carry += lo >>> 26, this.words[i] = lo & 67108863;\n }\n return carry !== 0 && (this.words[i] = carry, this.length++), this;\n }, BN.prototype.muln = function(num) {\n return this.clone().imuln(num);\n }, BN.prototype.sqr = function() {\n return this.mul(this);\n }, BN.prototype.isqr = function() {\n return this.imul(this.clone());\n }, BN.prototype.pow = function(num) {\n var w = toBitArray(num);\n if (w.length === 0)\n return new BN(1);\n for (var res = this, i = 0;i < w.length && w[i] === 0; i++, res = res.sqr())\n ;\n if (++i < w.length)\n for (var q = res.sqr();i < w.length; i++, q = q.sqr())\n w[i] !== 0 && (res = res.mul(q));\n return res;\n }, BN.prototype.iushln = function(bits) {\n assert(typeof bits == \"number\" && bits >= 0);\n var r = bits % 26, s = (bits - r) / 26, carryMask = 67108863 >>> 26 - r << 26 - r, i;\n if (r !== 0) {\n var carry = 0;\n for (i = 0;i < this.length; i++) {\n var newCarry = this.words[i] & carryMask, c = (this.words[i] | 0) - newCarry << r;\n this.words[i] = c | carry, carry = newCarry >>> 26 - r;\n }\n carry && (this.words[i] = carry, this.length++);\n }\n if (s !== 0) {\n for (i = this.length - 1;i >= 0; i--)\n this.words[i + s] = this.words[i];\n for (i = 0;i < s; i++)\n this.words[i] = 0;\n this.length += s;\n }\n return this.strip();\n }, BN.prototype.ishln = function(bits) {\n return assert(this.negative === 0), this.iushln(bits);\n }, BN.prototype.iushrn = function(bits, hint, extended) {\n assert(typeof bits == \"number\" && bits >= 0);\n var h;\n hint \? h = (hint - hint % 26) / 26 : h = 0;\n var r = bits % 26, s = Math.min((bits - r) / 26, this.length), mask = 67108863 ^ 67108863 >>> r << r, maskedWords = extended;\n if (h -= s, h = Math.max(0, h), maskedWords) {\n for (var i = 0;i < s; i++)\n maskedWords.words[i] = this.words[i];\n maskedWords.length = s;\n }\n if (s !== 0)\n if (this.length > s)\n for (this.length -= s, i = 0;i < this.length; i++)\n this.words[i] = this.words[i + s];\n else\n this.words[0] = 0, this.length = 1;\n var carry = 0;\n for (i = this.length - 1;i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = carry << 26 - r | word >>> r, carry = word & mask;\n }\n return maskedWords && carry !== 0 && (maskedWords.words[maskedWords.length++] = carry), this.length === 0 && (this.words[0] = 0, this.length = 1), this.strip();\n }, BN.prototype.ishrn = function(bits, hint, extended) {\n return assert(this.negative === 0), this.iushrn(bits, hint, extended);\n }, BN.prototype.shln = function(bits) {\n return this.clone().ishln(bits);\n }, BN.prototype.ushln = function(bits) {\n return this.clone().iushln(bits);\n }, BN.prototype.shrn = function(bits) {\n return this.clone().ishrn(bits);\n }, BN.prototype.ushrn = function(bits) {\n return this.clone().iushrn(bits);\n }, BN.prototype.testn = function(bit) {\n assert(typeof bit == \"number\" && bit >= 0);\n var r = bit % 26, s = (bit - r) / 26, q = 1 << r;\n if (this.length <= s)\n return !1;\n var w = this.words[s];\n return !!(w & q);\n }, BN.prototype.imaskn = function(bits) {\n assert(typeof bits == \"number\" && bits >= 0);\n var r = bits % 26, s = (bits - r) / 26;\n if (assert(this.negative === 0, \"imaskn works only with positive numbers\"), this.length <= s)\n return this;\n if (r !== 0 && s++, this.length = Math.min(s, this.length), r !== 0) {\n var mask = 67108863 ^ 67108863 >>> r << r;\n this.words[this.length - 1] &= mask;\n }\n return this.strip();\n }, BN.prototype.maskn = function(bits) {\n return this.clone().imaskn(bits);\n }, BN.prototype.iaddn = function(num) {\n return assert(typeof num == \"number\"), assert(num < 67108864), num < 0 \? this.isubn(-num) : this.negative !== 0 \? this.length === 1 && (this.words[0] | 0) < num \? (this.words[0] = num - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(num), this.negative = 1, this) : this._iaddn(num);\n }, BN.prototype._iaddn = function(num) {\n this.words[0] += num;\n for (var i = 0;i < this.length && this.words[i] >= 67108864; i++)\n this.words[i] -= 67108864, i === this.length - 1 \? this.words[i + 1] = 1 : this.words[i + 1]++;\n return this.length = Math.max(this.length, i + 1), this;\n }, BN.prototype.isubn = function(num) {\n if (assert(typeof num == \"number\"), assert(num < 67108864), num < 0)\n return this.iaddn(-num);\n if (this.negative !== 0)\n return this.negative = 0, this.iaddn(num), this.negative = 1, this;\n if (this.words[0] -= num, this.length === 1 && this.words[0] < 0)\n this.words[0] = -this.words[0], this.negative = 1;\n else\n for (var i = 0;i < this.length && this.words[i] < 0; i++)\n this.words[i] += 67108864, this.words[i + 1] -= 1;\n return this.strip();\n }, BN.prototype.addn = function(num) {\n return this.clone().iaddn(num);\n }, BN.prototype.subn = function(num) {\n return this.clone().isubn(num);\n }, BN.prototype.iabs = function() {\n return this.negative = 0, this;\n }, BN.prototype.abs = function() {\n return this.clone().iabs();\n }, BN.prototype._ishlnsubmul = function(num, mul, shift) {\n var len = num.length + shift, i;\n this._expand(len);\n var w, carry = 0;\n for (i = 0;i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 67108863, carry = (w >> 26) - (right / 67108864 | 0), this.words[i + shift] = w & 67108863;\n }\n for (;i < this.length - shift; i++)\n w = (this.words[i + shift] | 0) + carry, carry = w >> 26, this.words[i + shift] = w & 67108863;\n if (carry === 0)\n return this.strip();\n for (assert(carry === -1), carry = 0, i = 0;i < this.length; i++)\n w = -(this.words[i] | 0) + carry, carry = w >> 26, this.words[i] = w & 67108863;\n return this.negative = 1, this.strip();\n }, BN.prototype._wordDiv = function(num, mode) {\n var shift = this.length - num.length, a = this.clone(), b = num, bhi = b.words[b.length - 1] | 0, bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits, shift !== 0 && (b = b.ushln(shift), a.iushln(shift), bhi = b.words[b.length - 1] | 0);\n var m = a.length - b.length, q;\n if (mode !== \"mod\") {\n q = new BN(null), q.length = m + 1, q.words = new @Array(q.length);\n for (var i = 0;i < q.length; i++)\n q.words[i] = 0;\n }\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n diff.negative === 0 && (a = diff, q && (q.words[m] = 1));\n for (var j = m - 1;j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);\n for (qj = Math.min(qj / bhi | 0, 67108863), a._ishlnsubmul(b, qj, j);a.negative !== 0; )\n qj--, a.negative = 0, a._ishlnsubmul(b, 1, j), a.isZero() || (a.negative ^= 1);\n q && (q.words[j] = qj);\n }\n return q && q.strip(), a.strip(), mode !== \"div\" && shift !== 0 && a.iushrn(shift), {\n div: q || null,\n mod: a\n };\n }, BN.prototype.divmod = function(num, mode, positive) {\n if (assert(!num.isZero()), this.isZero())\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n var div, mod, res;\n return this.negative !== 0 && num.negative === 0 \? (res = this.neg().divmod(num, mode), mode !== \"mod\" && (div = res.div.neg()), mode !== \"div\" && (mod = res.mod.neg(), positive && mod.negative !== 0 && mod.iadd(num)), {\n div,\n mod\n }) : this.negative === 0 && num.negative !== 0 \? (res = this.divmod(num.neg(), mode), mode !== \"mod\" && (div = res.div.neg()), {\n div,\n mod: res.mod\n }) : (this.negative & num.negative) !== 0 \? (res = this.neg().divmod(num.neg(), mode), mode !== \"div\" && (mod = res.mod.neg(), positive && mod.negative !== 0 && mod.isub(num)), {\n div: res.div,\n mod\n }) : num.length > this.length || this.cmp(num) < 0 \? {\n div: new BN(0),\n mod: this\n } : num.length === 1 \? mode === \"div\" \? {\n div: this.divn(num.words[0]),\n mod: null\n } : mode === \"mod\" \? {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n } : {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n } : this._wordDiv(num, mode);\n }, BN.prototype.div = function(num) {\n return this.divmod(num, \"div\", !1).div;\n }, BN.prototype.mod = function(num) {\n return this.divmod(num, \"mod\", !1).mod;\n }, BN.prototype.umod = function(num) {\n return this.divmod(num, \"mod\", !0).mod;\n }, BN.prototype.divRound = function(num) {\n var dm = this.divmod(num);\n if (dm.mod.isZero())\n return dm.div;\n var mod = dm.div.negative !== 0 \? dm.mod.isub(num) : dm.mod, half = num.ushrn(1), r2 = num.andln(1), cmp = mod.cmp(half);\n return cmp < 0 || r2 === 1 && cmp === 0 \? dm.div : dm.div.negative !== 0 \? dm.div.isubn(1) : dm.div.iaddn(1);\n }, BN.prototype.modn = function(num) {\n assert(num <= 67108863);\n for (var p = (1 << 26) % num, acc = 0, i = this.length - 1;i >= 0; i--)\n acc = (p * acc + (this.words[i] | 0)) % num;\n return acc;\n }, BN.prototype.idivn = function(num) {\n assert(num <= 67108863);\n for (var carry = 0, i = this.length - 1;i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 67108864;\n this.words[i] = w / num | 0, carry = w % num;\n }\n return this.strip();\n }, BN.prototype.divn = function(num) {\n return this.clone().idivn(num);\n }, BN.prototype.egcd = function(p) {\n assert(p.negative === 0), assert(!p.isZero());\n var x = this, y = p.clone();\n x.negative !== 0 \? x = x.umod(p) : x = x.clone();\n for (var A = new BN(1), B = new BN(0), C = new BN(0), D = new BN(1), g = 0;x.isEven() && y.isEven(); )\n x.iushrn(1), y.iushrn(1), ++g;\n for (var yp = y.clone(), xp = x.clone();!x.isZero(); ) {\n for (var i = 0, im = 1;(x.words[0] & im) === 0 && i < 26; ++i, im <<= 1)\n ;\n if (i > 0)\n for (x.iushrn(i);i-- > 0; )\n (A.isOdd() || B.isOdd()) && (A.iadd(yp), B.isub(xp)), A.iushrn(1), B.iushrn(1);\n for (var j = 0, jm = 1;(y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1)\n ;\n if (j > 0)\n for (y.iushrn(j);j-- > 0; )\n (C.isOdd() || D.isOdd()) && (C.iadd(yp), D.isub(xp)), C.iushrn(1), D.iushrn(1);\n x.cmp(y) >= 0 \? (x.isub(y), A.isub(C), B.isub(D)) : (y.isub(x), C.isub(A), D.isub(B));\n }\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n }, BN.prototype._invmp = function(p) {\n assert(p.negative === 0), assert(!p.isZero());\n var a = this, b = p.clone();\n a.negative !== 0 \? a = a.umod(p) : a = a.clone();\n for (var x1 = new BN(1), x2 = new BN(0), delta = b.clone();a.cmpn(1) > 0 && b.cmpn(1) > 0; ) {\n for (var i = 0, im = 1;(a.words[0] & im) === 0 && i < 26; ++i, im <<= 1)\n ;\n if (i > 0)\n for (a.iushrn(i);i-- > 0; )\n x1.isOdd() && x1.iadd(delta), x1.iushrn(1);\n for (var j = 0, jm = 1;(b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1)\n ;\n if (j > 0)\n for (b.iushrn(j);j-- > 0; )\n x2.isOdd() && x2.iadd(delta), x2.iushrn(1);\n a.cmp(b) >= 0 \? (a.isub(b), x1.isub(x2)) : (b.isub(a), x2.isub(x1));\n }\n var res;\n return a.cmpn(1) === 0 \? res = x1 : res = x2, res.cmpn(0) < 0 && res.iadd(p), res;\n }, BN.prototype.gcd = function(num) {\n if (this.isZero())\n return num.abs();\n if (num.isZero())\n return this.abs();\n var a = this.clone(), b = num.clone();\n a.negative = 0, b.negative = 0;\n for (var shift = 0;a.isEven() && b.isEven(); shift++)\n a.iushrn(1), b.iushrn(1);\n do {\n for (;a.isEven(); )\n a.iushrn(1);\n for (;b.isEven(); )\n b.iushrn(1);\n var r = a.cmp(b);\n if (r < 0) {\n var t = a;\n a = b, b = t;\n } else if (r === 0 || b.cmpn(1) === 0)\n break;\n a.isub(b);\n } while (!0);\n return b.iushln(shift);\n }, BN.prototype.invm = function(num) {\n return this.egcd(num).a.umod(num);\n }, BN.prototype.isEven = function() {\n return (this.words[0] & 1) === 0;\n }, BN.prototype.isOdd = function() {\n return (this.words[0] & 1) === 1;\n }, BN.prototype.andln = function(num) {\n return this.words[0] & num;\n }, BN.prototype.bincn = function(bit) {\n assert(typeof bit == \"number\");\n var r = bit % 26, s = (bit - r) / 26, q = 1 << r;\n if (this.length <= s)\n return this._expand(s + 1), this.words[s] |= q, this;\n for (var carry = q, i = s;carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry, carry = w >>> 26, w &= 67108863, this.words[i] = w;\n }\n return carry !== 0 && (this.words[i] = carry, this.length++), this;\n }, BN.prototype.isZero = function() {\n return this.length === 1 && this.words[0] === 0;\n }, BN.prototype.cmpn = function(num) {\n var negative = num < 0;\n if (this.negative !== 0 && !negative)\n return -1;\n if (this.negative === 0 && negative)\n return 1;\n this.strip();\n var res;\n if (this.length > 1)\n res = 1;\n else {\n negative && (num = -num), assert(num <= 67108863, \"Number is too big\");\n var w = this.words[0] | 0;\n res = w === num \? 0 : w < num \? -1 : 1;\n }\n return this.negative !== 0 \? -res | 0 : res;\n }, BN.prototype.cmp = function(num) {\n if (this.negative !== 0 && num.negative === 0)\n return -1;\n if (this.negative === 0 && num.negative !== 0)\n return 1;\n var res = this.ucmp(num);\n return this.negative !== 0 \? -res | 0 : res;\n }, BN.prototype.ucmp = function(num) {\n if (this.length > num.length)\n return 1;\n if (this.length < num.length)\n return -1;\n for (var res = 0, i = this.length - 1;i >= 0; i--) {\n var a = this.words[i] | 0, b = num.words[i] | 0;\n if (a !== b) {\n a < b \? res = -1 : a > b && (res = 1);\n break;\n }\n }\n return res;\n }, BN.prototype.gtn = function(num) {\n return this.cmpn(num) === 1;\n }, BN.prototype.gt = function(num) {\n return this.cmp(num) === 1;\n }, BN.prototype.gten = function(num) {\n return this.cmpn(num) >= 0;\n }, BN.prototype.gte = function(num) {\n return this.cmp(num) >= 0;\n }, BN.prototype.ltn = function(num) {\n return this.cmpn(num) === -1;\n }, BN.prototype.lt = function(num) {\n return this.cmp(num) === -1;\n }, BN.prototype.lten = function(num) {\n return this.cmpn(num) <= 0;\n }, BN.prototype.lte = function(num) {\n return this.cmp(num) <= 0;\n }, BN.prototype.eqn = function(num) {\n return this.cmpn(num) === 0;\n }, BN.prototype.eq = function(num) {\n return this.cmp(num) === 0;\n }, BN.red = function(num) {\n return new Red(num);\n }, BN.prototype.toRed = function(ctx) {\n return assert(!this.red, \"Already a number in reduction context\"), assert(this.negative === 0, \"red works only with positives\"), ctx.convertTo(this)._forceRed(ctx);\n }, BN.prototype.fromRed = function() {\n return assert(this.red, \"fromRed works only with numbers in reduction context\"), this.red.convertFrom(this);\n }, BN.prototype._forceRed = function(ctx) {\n return this.red = ctx, this;\n }, BN.prototype.forceRed = function(ctx) {\n return assert(!this.red, \"Already a number in reduction context\"), this._forceRed(ctx);\n }, BN.prototype.redAdd = function(num) {\n return assert(this.red, \"redAdd works only with red numbers\"), this.red.add(this, num);\n }, BN.prototype.redIAdd = function(num) {\n return assert(this.red, \"redIAdd works only with red numbers\"), this.red.iadd(this, num);\n }, BN.prototype.redSub = function(num) {\n return assert(this.red, \"redSub works only with red numbers\"), this.red.sub(this, num);\n }, BN.prototype.redISub = function(num) {\n return assert(this.red, \"redISub works only with red numbers\"), this.red.isub(this, num);\n }, BN.prototype.redShl = function(num) {\n return assert(this.red, \"redShl works only with red numbers\"), this.red.shl(this, num);\n }, BN.prototype.redMul = function(num) {\n return assert(this.red, \"redMul works only with red numbers\"), this.red._verify2(this, num), this.red.mul(this, num);\n }, BN.prototype.redIMul = function(num) {\n return assert(this.red, \"redMul works only with red numbers\"), this.red._verify2(this, num), this.red.imul(this, num);\n }, BN.prototype.redSqr = function() {\n return assert(this.red, \"redSqr works only with red numbers\"), this.red._verify1(this), this.red.sqr(this);\n }, BN.prototype.redISqr = function() {\n return assert(this.red, \"redISqr works only with red numbers\"), this.red._verify1(this), this.red.isqr(this);\n }, BN.prototype.redSqrt = function() {\n return assert(this.red, \"redSqrt works only with red numbers\"), this.red._verify1(this), this.red.sqrt(this);\n }, BN.prototype.redInvm = function() {\n return assert(this.red, \"redInvm works only with red numbers\"), this.red._verify1(this), this.red.invm(this);\n }, BN.prototype.redNeg = function() {\n return assert(this.red, \"redNeg works only with red numbers\"), this.red._verify1(this), this.red.neg(this);\n }, BN.prototype.redPow = function(num) {\n return assert(this.red && !num.red, \"redPow(normalNum)\"), this.red._verify1(this), this.red.pow(this, num);\n };\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n function MPrime(name, p) {\n this.name = name, this.p = new BN(p, 16), this.n = this.p.bitLength(), this.k = new BN(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();\n }\n MPrime.prototype = {}, MPrime.prototype._tmp = function() {\n var tmp = new BN(null);\n return tmp.words = new @Array(Math.ceil(this.n / 13)), tmp;\n }, MPrime.prototype.ireduce = function(num) {\n var r = num, rlen;\n do\n this.split(r, this.tmp), r = this.imulK(r), r = r.iadd(this.tmp), rlen = r.bitLength();\n while (rlen > this.n);\n var cmp = rlen < this.n \? -1 : r.ucmp(this.p);\n return cmp === 0 \? (r.words[0] = 0, r.length = 1) : cmp > 0 \? r.isub(this.p) : r.strip !== void 0 \? r.strip() : r._strip(), r;\n }, MPrime.prototype.split = function(input, out) {\n input.iushrn(this.n, 0, out);\n }, MPrime.prototype.imulK = function(num) {\n return num.imul(this.k);\n };\n function K256() {\n MPrime.@call(this, \"k256\", \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\");\n }\n inherits(K256, MPrime), K256.prototype.split = function(input, output) {\n for (var mask = 4194303, outLen = Math.min(input.length, 9), i = 0;i < outLen; i++)\n output.words[i] = input.words[i];\n if (output.length = outLen, input.length <= 9) {\n input.words[0] = 0, input.length = 1;\n return;\n }\n var prev = input.words[9];\n for (output.words[output.length++] = prev & mask, i = 10;i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = (next & mask) << 4 | prev >>> 22, prev = next;\n }\n prev >>>= 22, input.words[i - 10] = prev, prev === 0 && input.length > 10 \? input.length -= 10 : input.length -= 9;\n }, K256.prototype.imulK = function(num) {\n num.words[num.length] = 0, num.words[num.length + 1] = 0, num.length += 2;\n for (var lo = 0, i = 0;i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 977, num.words[i] = lo & 67108863, lo = w * 64 + (lo / 67108864 | 0);\n }\n return num.words[num.length - 1] === 0 && (num.length--, num.words[num.length - 1] === 0 && num.length--), num;\n };\n function P224() {\n MPrime.@call(this, \"p224\", \"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\");\n }\n inherits(P224, MPrime);\n function P192() {\n MPrime.@call(this, \"p192\", \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\");\n }\n inherits(P192, MPrime);\n function P25519() {\n MPrime.@call(this, \"25519\", \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\");\n }\n inherits(P25519, MPrime), P25519.prototype.imulK = function(num) {\n for (var carry = 0, i = 0;i < num.length; i++) {\n var hi = (num.words[i] | 0) * 19 + carry, lo = hi & 67108863;\n hi >>>= 26, num.words[i] = lo, carry = hi;\n }\n return carry !== 0 && (num.words[num.length++] = carry), num;\n }, BN._prime = function(name) {\n if (primes[name])\n return primes[name];\n var prime2;\n if (name === \"k256\")\n prime2 = new K256;\n else if (name === \"p224\")\n prime2 = new P224;\n else if (name === \"p192\")\n prime2 = new P192;\n else if (name === \"p25519\")\n prime2 = new P25519;\n else\n throw new Error(\"Unknown prime \" + name);\n return primes[name] = prime2, prime2;\n };\n function Red(m) {\n if (typeof m == \"string\") {\n var prime = BN._prime(m);\n this.m = prime.p, this.prime = prime;\n } else\n assert(m.gtn(1), \"modulus must be greater than 1\"), this.m = m, this.prime = null;\n }\n Red.prototype = {}, Red.prototype._verify1 = function(a) {\n assert(a.negative === 0, \"red works only with positives\"), assert(a.red, \"red works only with red numbers\");\n }, Red.prototype._verify2 = function(a, b) {\n assert((a.negative | b.negative) === 0, \"red works only with positives\"), assert(a.red && a.red === b.red, \"red works only with red numbers\");\n }, Red.prototype.imod = function(a) {\n return this.prime \? this.prime.ireduce(a)._forceRed(this) : a.umod(this.m)._forceRed(this);\n }, Red.prototype.neg = function(a) {\n return a.isZero() \? a.clone() : this.m.sub(a)._forceRed(this);\n }, Red.prototype.add = function(a, b) {\n this._verify2(a, b);\n var res = a.add(b);\n return res.cmp(this.m) >= 0 && res.isub(this.m), res._forceRed(this);\n }, Red.prototype.iadd = function(a, b) {\n this._verify2(a, b);\n var res = a.iadd(b);\n return res.cmp(this.m) >= 0 && res.isub(this.m), res;\n }, Red.prototype.sub = function(a, b) {\n this._verify2(a, b);\n var res = a.sub(b);\n return res.cmpn(0) < 0 && res.iadd(this.m), res._forceRed(this);\n }, Red.prototype.isub = function(a, b) {\n this._verify2(a, b);\n var res = a.isub(b);\n return res.cmpn(0) < 0 && res.iadd(this.m), res;\n }, Red.prototype.shl = function(a, num) {\n return this._verify1(a), this.imod(a.ushln(num));\n }, Red.prototype.imul = function(a, b) {\n return this._verify2(a, b), this.imod(a.imul(b));\n }, Red.prototype.mul = function(a, b) {\n return this._verify2(a, b), this.imod(a.mul(b));\n }, Red.prototype.isqr = function(a) {\n return this.imul(a, a.clone());\n }, Red.prototype.sqr = function(a) {\n return this.mul(a, a);\n }, Red.prototype.sqrt = function(a) {\n if (a.isZero())\n return a.clone();\n var mod3 = this.m.andln(3);\n if (assert(mod3 % 2 === 1), mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n for (var q = this.m.subn(1), s = 0;!q.isZero() && q.andln(1) === 0; )\n s++, q.iushrn(1);\n assert(!q.isZero());\n var one = new BN(1).toRed(this), nOne = one.redNeg(), lpow = this.m.subn(1).iushrn(1), z = this.m.bitLength();\n for (z = new BN(2 * z * z).toRed(this);this.pow(z, lpow).cmp(nOne) !== 0; )\n z.redIAdd(nOne);\n for (var c = this.pow(z, q), r = this.pow(a, q.addn(1).iushrn(1)), t = this.pow(a, q), m = s;t.cmp(one) !== 0; ) {\n for (var tmp = t, i = 0;tmp.cmp(one) !== 0; i++)\n tmp = tmp.redSqr();\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n r = r.redMul(b), c = b.redSqr(), t = t.redMul(c), m = i;\n }\n return r;\n }, Red.prototype.invm = function(a) {\n var inv = a._invmp(this.m);\n return inv.negative !== 0 \? (inv.negative = 0, this.imod(inv).redNeg()) : this.imod(inv);\n }, Red.prototype.pow = function(a, num) {\n if (num.isZero())\n return new BN(1).toRed(this);\n if (num.cmpn(1) === 0)\n return a.clone();\n var windowSize = 4, wnd = new @Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this), wnd[1] = a;\n for (var i = 2;i < wnd.length; i++)\n wnd[i] = this.mul(wnd[i - 1], a);\n var res = wnd[0], current = 0, currentLen = 0, start = num.bitLength() % 26;\n for (start === 0 && (start = 26), i = num.length - 1;i >= 0; i--) {\n for (var word = num.words[i], j = start - 1;j >= 0; j--) {\n var bit = word >> j & 1;\n if (res !== wnd[0] && (res = this.sqr(res)), bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n current <<= 1, current |= bit, currentLen++, !(currentLen !== windowSize && (i !== 0 || j !== 0)) && (res = this.mul(res, wnd[current]), currentLen = 0, current = 0);\n }\n start = 26;\n }\n return res;\n }, Red.prototype.convertTo = function(num) {\n var r = num.umod(this.m);\n return r === num \? r.clone() : r;\n }, Red.prototype.convertFrom = function(num) {\n var res = num.clone();\n return res.red = null, res;\n }, BN.mont = function(num) {\n return new Mont(num);\n };\n function Mont(m) {\n Red.@call(this, m), this.shift = this.m.bitLength(), this.shift % 26 !== 0 && (this.shift += 26 - this.shift % 26), this.r = new BN(1).iushln(this.shift), this.r2 = this.imod(this.r.sqr()), this.rinv = this.r._invmp(this.m), this.minv = this.rinv.mul(this.r).isubn(1).div(this.m), this.minv = this.minv.umod(this.r), this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red), Mont.prototype.convertTo = function(num) {\n return this.imod(num.ushln(this.shift));\n }, Mont.prototype.convertFrom = function(num) {\n var r = this.imod(num.mul(this.rinv));\n return r.red = null, r;\n }, Mont.prototype.imul = function(a, b) {\n if (a.isZero() || b.isZero())\n return a.words[0] = 0, a.length = 1, a;\n var t = a.imul(b), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u = t.isub(c).iushrn(this.shift), res = u;\n return u.cmp(this.m) >= 0 \? res = u.isub(this.m) : u.cmpn(0) < 0 && (res = u.iadd(this.m)), res._forceRed(this);\n }, Mont.prototype.mul = function(a, b) {\n if (a.isZero() || b.isZero())\n return new BN(0)._forceRed(this);\n var t = a.mul(b), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u = t.isub(c).iushrn(this.shift), res = u;\n return u.cmp(this.m) >= 0 \? res = u.isub(this.m) : u.cmpn(0) < 0 && (res = u.iadd(this.m)), res._forceRed(this);\n }, Mont.prototype.invm = function(a) {\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n })(typeof module > \"u\" || module, exports);\n }\n}), require_bn2 = require_bn, require_brorand = __commonJS({\n \"node_modules/brorand/index.js\"(exports, module) {\n var r;\n module.exports = function(len) {\n return r || (r = new Rand(null)), r.generate(len);\n };\n function Rand(rand) {\n this.rand = rand;\n }\n Rand.prototype = {}, module.exports.Rand = Rand, Rand.prototype.generate = function(len) {\n return this._rand(len);\n }, Rand.prototype._rand = function(n) {\n var out = new Buffer(n);\n return crypto.getRandomValues(out), out;\n };\n }\n}), require_mr = __commonJS({\n \"node_modules/miller-rabin/lib/mr.js\"(exports, module) {\n var bn = require_bn2(), brorand = require_brorand();\n function MillerRabin(rand) {\n this.rand = rand || new brorand.Rand;\n }\n module.exports = MillerRabin, MillerRabin.create = function(rand) {\n return new MillerRabin(rand);\n }, MillerRabin.prototype = {}, MillerRabin.prototype._randbelow = function(n) {\n var len = n.bitLength(), min_bytes = Math.ceil(len / 8);\n do\n var a = new bn(this.rand.generate(min_bytes));\n while (a.cmp(n) >= 0);\n return a;\n }, MillerRabin.prototype._randrange = function(start, stop) {\n var size = stop.sub(start);\n return start.add(this._randbelow(size));\n }, MillerRabin.prototype.test = function(n, k, cb) {\n var len = n.bitLength(), red = bn.mont(n), rone = new bn(1).toRed(red);\n k || (k = Math.max(1, len / 48 | 0));\n for (var n1 = n.subn(1), s = 0;!n1.testn(s); s++)\n ;\n for (var d = n.shrn(s), rn1 = n1.toRed(red), prime = !0;k > 0; k--) {\n var a = this._randrange(new bn(2), n1);\n cb && cb(a);\n var x = a.toRed(red).redPow(d);\n if (!(x.cmp(rone) === 0 || x.cmp(rn1) === 0)) {\n for (var i = 1;i < s; i++) {\n if (x = x.redSqr(), x.cmp(rone) === 0)\n return !1;\n if (x.cmp(rn1) === 0)\n break;\n }\n if (i === s)\n return !1;\n }\n }\n return prime;\n }, MillerRabin.prototype.getDivisor = function(n, k) {\n var len = n.bitLength(), red = bn.mont(n), rone = new bn(1).toRed(red);\n k || (k = Math.max(1, len / 48 | 0));\n for (var n1 = n.subn(1), s = 0;!n1.testn(s); s++)\n ;\n for (var d = n.shrn(s), rn1 = n1.toRed(red);k > 0; k--) {\n var a = this._randrange(new bn(2), n1), g = n.gcd(a);\n if (g.cmpn(1) !== 0)\n return g;\n var x = a.toRed(red).redPow(d);\n if (!(x.cmp(rone) === 0 || x.cmp(rn1) === 0)) {\n for (var i = 1;i < s; i++) {\n if (x = x.redSqr(), x.cmp(rone) === 0)\n return x.fromRed().subn(1).gcd(n);\n if (x.cmp(rn1) === 0)\n break;\n }\n if (i === s)\n return x = x.redSqr(), x.fromRed().subn(1).gcd(n);\n }\n }\n return !1;\n };\n }\n}), require_generatePrime = __commonJS({\n \"node_modules/diffie-hellman/lib/generatePrime.js\"(exports, module) {\n var randomBytes = require_browser();\n module.exports = findPrime, findPrime.simpleSieve = simpleSieve, findPrime.fermatTest = fermatTest;\n var BN = require_bn(), TWENTYFOUR = new BN(24), MillerRabin = require_mr(), millerRabin = new MillerRabin, ONE = new BN(1), TWO = new BN(2), FIVE = new BN(5), SIXTEEN = new BN(16), EIGHT = new BN(8), TEN = new BN(10), THREE = new BN(3), SEVEN = new BN(7), ELEVEN = new BN(11), FOUR = new BN(4), TWELVE = new BN(12), primes = null;\n function _getPrimes() {\n if (primes !== null)\n return primes;\n var limit = 1048576, res = [];\n res[0] = 2;\n for (var i = 1, k = 3;k < limit; k += 2) {\n for (var sqrt = Math.ceil(Math.sqrt(k)), j = 0;j < i && res[j] <= sqrt && k % res[j] !== 0; j++)\n ;\n i !== j && res[j] <= sqrt || (res[i++] = k);\n }\n return primes = res, res;\n }\n function simpleSieve(p) {\n for (var primes2 = _getPrimes(), i = 0;i < primes2.length; i++)\n if (p.modn(primes2[i]) === 0)\n return p.cmpn(primes2[i]) === 0;\n return !0;\n }\n function fermatTest(p) {\n var red = BN.mont(p);\n return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;\n }\n function findPrime(bits, gen) {\n if (bits < 16)\n return gen === 2 || gen === 5 \? new BN([140, 123]) : new BN([140, 39]);\n gen = new BN(gen);\n for (var num, n2;; ) {\n for (num = new BN(randomBytes(Math.ceil(bits / 8)));num.bitLength() > bits; )\n num.ishrn(1);\n if (num.isEven() && num.iadd(ONE), num.testn(1) || num.iadd(TWO), gen.cmp(TWO)) {\n if (!gen.cmp(FIVE))\n for (;num.mod(TEN).cmp(THREE); )\n num.iadd(FOUR);\n } else\n for (;num.mod(TWENTYFOUR).cmp(ELEVEN); )\n num.iadd(FOUR);\n if (n2 = num.shrn(1), simpleSieve(n2) && simpleSieve(num) && fermatTest(n2) && fermatTest(num) && millerRabin.test(n2) && millerRabin.test(num))\n return num;\n }\n }\n }\n}), require_primes = __commonJS({\n \"node_modules/diffie-hellman/lib/primes.json\"(exports, module) {\n module.exports = {\n modp1: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff\"\n },\n modp2: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff\"\n },\n modp5: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff\"\n },\n modp14: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff\"\n },\n modp15: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff\"\n },\n modp16: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff\"\n },\n modp17: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff\"\n },\n modp18: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff\"\n }\n };\n }\n}), require_dh = __commonJS({\n \"node_modules/diffie-hellman/lib/dh.js\"(exports, module) {\n var BN = require_bn(), MillerRabin = require_mr(), millerRabin = new MillerRabin, TWENTYFOUR = new BN(24), ELEVEN = new BN(11), TEN = new BN(10), THREE = new BN(3), SEVEN = new BN(7), primes = require_generatePrime(), randomBytes = require_browser();\n module.exports = DH;\n function setPublicKey(pub, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(pub) || (pub = new Buffer(pub, enc)), this._pub = new BN(pub), this;\n }\n function setPrivateKey(priv, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(priv) || (priv = new Buffer(priv, enc)), this._priv = new BN(priv), this;\n }\n var primeCache = {};\n function checkPrime(prime, generator) {\n var gen = generator.toString(\"hex\"), hex = [gen, prime.toString(16)].join(\"_\");\n if (hex in primeCache)\n return primeCache[hex];\n var error = 0;\n if (prime.isEven() || !primes.simpleSieve || !primes.fermatTest(prime) || !millerRabin.test(prime))\n return error += 1, gen === \"02\" || gen === \"05\" \? error += 8 : error += 4, primeCache[hex] = error, error;\n millerRabin.test(prime.shrn(1)) || (error += 2);\n var rem;\n switch (gen) {\n case \"02\":\n prime.mod(TWENTYFOUR).cmp(ELEVEN) && (error += 8);\n break;\n case \"05\":\n rem = prime.mod(TEN), rem.cmp(THREE) && rem.cmp(SEVEN) && (error += 8);\n break;\n default:\n error += 4;\n }\n return primeCache[hex] = error, error;\n }\n function DH(prime, generator, malleable) {\n this.setGenerator(generator), this.__prime = new BN(prime), this._prime = BN.mont(this.__prime), this._primeLen = prime.length, this._pub = void 0, this._priv = void 0, this._primeCode = void 0, malleable \? (this.setPublicKey = setPublicKey, this.setPrivateKey = setPrivateKey) : this._primeCode = 8;\n }\n DH.prototype = {}, Object.defineProperty(DH.prototype, \"verifyError\", {\n enumerable: !0,\n get: function() {\n return typeof this._primeCode != \"number\" && (this._primeCode = checkPrime(this.__prime, this.__gen)), this._primeCode;\n }\n }), DH.prototype.generateKeys = function() {\n return this._priv || (this._priv = new BN(randomBytes(this._primeLen))), this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(), this.getPublicKey();\n }, DH.prototype.computeSecret = function(other) {\n other = new BN(other), other = other.toRed(this._prime);\n var secret = other.redPow(this._priv).fromRed(), out = new Buffer(secret.toArray()), prime = this.getPrime();\n if (out.length < prime.length) {\n var front = new Buffer(prime.length - out.length);\n front.fill(0), out = Buffer.concat([front, out]);\n }\n return out;\n }, DH.prototype.getPublicKey = function(enc) {\n return formatReturnValue(this._pub, enc);\n }, DH.prototype.getPrivateKey = function(enc) {\n return formatReturnValue(this._priv, enc);\n }, DH.prototype.getPrime = function(enc) {\n return formatReturnValue(this.__prime, enc);\n }, DH.prototype.getGenerator = function(enc) {\n return formatReturnValue(this._gen, enc);\n }, DH.prototype.setGenerator = function(gen, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(gen) || (gen = new Buffer(gen, enc)), this.__gen = gen, this._gen = new BN(gen), this;\n };\n function formatReturnValue(bn, enc) {\n var buf = new Buffer(bn.toArray());\n return enc \? buf.toString(enc) : buf;\n }\n }\n}), require_browser7 = __commonJS({\n \"node_modules/diffie-hellman/browser.js\"(exports) {\n var generatePrime = require_generatePrime(), primes = require_primes(), DH = require_dh();\n function getDiffieHellman(mod) {\n var prime = new Buffer(primes[mod].prime, \"hex\"), gen = new Buffer(primes[mod].gen, \"hex\");\n return new DH(prime, gen);\n }\n var ENCODINGS = {\n binary: !0,\n hex: !0,\n base64: !0\n };\n function createDiffieHellman(prime, enc, generator, genc) {\n return Buffer.isBuffer(enc) || ENCODINGS[enc] === void 0 \? createDiffieHellman(prime, \"binary\", enc, generator) : (enc = enc || \"binary\", genc = genc || \"binary\", generator = generator || new Buffer([2]), Buffer.isBuffer(generator) || (generator = new Buffer(generator, genc)), typeof prime == \"number\" \? new DH(generatePrime(prime, generator), generator, !0) : (Buffer.isBuffer(prime) || (prime = new Buffer(prime, enc)), new DH(prime, generator, !0)));\n }\n exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman, exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman;\n }\n}), require_bn3 = require_bn, require_browserify_rsa = __commonJS({\n \"node_modules/browserify-rsa/index.js\"(exports, module) {\n var BN = require_bn3(), randomBytes = require_browser();\n function blind(priv) {\n var r = getr(priv), blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed();\n return { blinder, unblinder: r.invm(priv.modulus) };\n }\n function getr(priv) {\n var len = priv.modulus.byteLength(), r;\n do\n r = new BN(randomBytes(len));\n while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2));\n return r;\n }\n function crt(msg, priv) {\n var blinds = blind(priv), len = priv.modulus.byteLength(), blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus), c1 = blinded.toRed(BN.mont(priv.prime1)), c2 = blinded.toRed(BN.mont(priv.prime2)), qinv = priv.coefficient, p = priv.prime1, q = priv.prime2, m1 = c1.redPow(priv.exponent1).fromRed(), m2 = c2.redPow(priv.exponent2).fromRed(), h = m1.isub(m2).imul(qinv).umod(p).imul(q);\n return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, \"be\", len);\n }\n crt.getr = getr, module.exports = crt;\n }\n}), require_package = __commonJS({\n \"node_modules/elliptic/package.json\"(exports, module) {\n module.exports = {\n name: \"elliptic\",\n version: \"6.5.4\",\n description: \"EC cryptography\",\n main: \"lib/elliptic.js\",\n files: [\"lib\"],\n scripts: {\n lint: \"eslint lib test\",\n \"lint:fix\": \"npm run lint -- --fix\",\n unit: \"istanbul test _mocha --reporter=spec test/index.js\",\n test: \"npm run lint && npm run unit\",\n version: \"grunt dist && git add dist/\"\n },\n repository: {\n type: \"git\",\n url: \"git@github.com:indutny/elliptic\"\n },\n keywords: [\"EC\", \"Elliptic\", \"curve\", \"Cryptography\"],\n author: \"Fedor Indutny <fedor@indutny.com>\",\n license: \"MIT\",\n bugs: {\n url: \"https://github.com/indutny/elliptic/issues\"\n },\n homepage: \"https://github.com/indutny/elliptic\",\n devDependencies: {\n brfs: \"^2.0.2\",\n coveralls: \"^3.1.0\",\n eslint: \"^7.6.0\",\n grunt: \"^1.2.1\",\n \"grunt-browserify\": \"^5.3.0\",\n \"grunt-cli\": \"^1.3.2\",\n \"grunt-contrib-connect\": \"^3.0.0\",\n \"grunt-contrib-copy\": \"^1.0.0\",\n \"grunt-contrib-uglify\": \"^5.0.0\",\n \"grunt-mocha-istanbul\": \"^5.0.2\",\n \"grunt-saucelabs\": \"^9.0.1\",\n istanbul: \"^0.4.5\",\n mocha: \"^8.0.1\"\n },\n dependencies: {\n \"bn.js\": \"^4.11.9\",\n brorand: \"^1.1.0\",\n \"hash.js\": \"^1.0.0\",\n \"hmac-drbg\": \"^1.0.1\",\n inherits: \"^2.0.4\",\n \"minimalistic-assert\": \"^1.0.1\",\n \"minimalistic-crypto-utils\": \"^1.0.1\"\n }\n };\n }\n}), require_bn4 = require_bn, require_utils2 = __commonJS({\n \"node_modules/minimalistic-crypto-utils/lib/utils.js\"(exports) {\n var utils = exports;\n function toArray(msg, enc) {\n if (@Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg != \"string\") {\n for (var i = 0;i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n if (enc === \"hex\") {\n msg = msg.replace(/[^a-z0-9]+/gi, \"\"), msg.length % 2 !== 0 && (msg = \"0\" + msg);\n for (var i = 0;i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else\n for (var i = 0;i < msg.length; i++) {\n var c = msg.charCodeAt(i), hi = c >> 8, lo = c & 255;\n hi \? res.push(hi, lo) : res.push(lo);\n }\n return res;\n }\n utils.toArray = toArray;\n function zero2(word) {\n return word.length === 1 \? \"0\" + word : word;\n }\n utils.zero2 = zero2;\n function toHex(msg) {\n for (var res = \"\", i = 0;i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n }\n utils.toHex = toHex, utils.encode = function(arr, enc) {\n return enc === \"hex\" \? toHex(arr) : arr;\n };\n }\n}), require_utils3 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/utils.js\"(exports) {\n var utils = exports, BN = require_bn4(), minAssert = require_minimalistic_assert(), minUtils = require_utils2();\n utils.assert = minAssert, utils.toArray = minUtils.toArray, utils.zero2 = minUtils.zero2, utils.toHex = minUtils.toHex, utils.encode = minUtils.encode;\n function getNAF(num, w, bits) {\n var naf = new @Array(Math.max(num.bitLength(), bits) + 1);\n naf.fill(0);\n for (var ws = 1 << w + 1, k = num.clone(), i = 0;i < naf.length; i++) {\n var z, mod = k.andln(ws - 1);\n k.isOdd() \? (mod > (ws >> 1) - 1 \? z = (ws >> 1) - mod : z = mod, k.isubn(z)) : z = 0, naf[i] = z, k.iushrn(1);\n }\n return naf;\n }\n utils.getNAF = getNAF;\n function getJSF(k1, k2) {\n var jsf = [[], []];\n k1 = k1.clone(), k2 = k2.clone();\n for (var d1 = 0, d2 = 0, m8;k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0; ) {\n var m14 = k1.andln(3) + d1 & 3, m24 = k2.andln(3) + d2 & 3;\n m14 === 3 && (m14 = -1), m24 === 3 && (m24 = -1);\n var u1;\n (m14 & 1) === 0 \? u1 = 0 : (m8 = k1.andln(7) + d1 & 7, (m8 === 3 || m8 === 5) && m24 === 2 \? u1 = -m14 : u1 = m14), jsf[0].push(u1);\n var u2;\n (m24 & 1) === 0 \? u2 = 0 : (m8 = k2.andln(7) + d2 & 7, (m8 === 3 || m8 === 5) && m14 === 2 \? u2 = -m24 : u2 = m24), jsf[1].push(u2), 2 * d1 === u1 + 1 && (d1 = 1 - d1), 2 * d2 === u2 + 1 && (d2 = 1 - d2), k1.iushrn(1), k2.iushrn(1);\n }\n return jsf;\n }\n utils.getJSF = getJSF;\n function cachedProperty(obj, name, computer) {\n var key2 = \"_\" + name;\n obj.prototype[name] = function() {\n return this[key2] !== void 0 \? this[key2] : this[key2] = computer.@call(this);\n };\n }\n utils.cachedProperty = cachedProperty;\n function parseBytes(bytes) {\n if (bytes instanceof KeyObject)\n bytes = bytes.export();\n else if (bytes instanceof CryptoKey)\n bytes = KeyObject.from(bytes).export();\n return typeof bytes == \"string\" \? utils.toArray(bytes, \"hex\") : bytes;\n }\n utils.parseBytes = parseBytes;\n function intFromLE(bytes) {\n return new BN(bytes, \"hex\", \"le\");\n }\n utils.intFromLE = intFromLE;\n }\n}), require_base = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/base.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), getNAF = utils.getNAF, getJSF = utils.getJSF, assert = utils.assert;\n function BaseCurve(type, conf) {\n this.type = type, this.p = new BN(conf.p, 16), this.red = conf.prime \? BN.red(conf.prime) : BN.mont(this.p), this.zero = new BN(0).toRed(this.red), this.one = new BN(1).toRed(this.red), this.two = new BN(2).toRed(this.red), this.n = conf.n && new BN(conf.n, 16), this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed), this._wnafT1 = new @Array(4), this._wnafT2 = new @Array(4), this._wnafT3 = new @Array(4), this._wnafT4 = new @Array(4), this._bitLength = this.n \? this.n.bitLength() : 0;\n var adjustCount = this.n && this.p.div(this.n);\n !adjustCount || adjustCount.cmpn(100) > 0 \? this.redN = null : (this._maxwellTrick = !0, this.redN = this.n.toRed(this.red));\n }\n module.exports = BaseCurve, BaseCurve.prototype = {}, BaseCurve.prototype.point = function() {\n throw new Error(\"Not implemented\");\n }, BaseCurve.prototype.validate = function() {\n throw new Error(\"Not implemented\");\n }, BaseCurve.prototype._fixedNafMul = function(p, k) {\n assert(p.precomputed);\n var doubles = p._getDoubles(), naf = getNAF(k, 1, this._bitLength), I = (1 << doubles.step + 1) - (doubles.step % 2 === 0 \? 2 : 1);\n I /= 3;\n var repr = [], j, nafW;\n for (j = 0;j < naf.length; j += doubles.step) {\n nafW = 0;\n for (var l = j + doubles.step - 1;l >= j; l--)\n nafW = (nafW << 1) + naf[l];\n repr.push(nafW);\n }\n for (var a = this.jpoint(null, null, null), b = this.jpoint(null, null, null), i = I;i > 0; i--) {\n for (j = 0;j < repr.length; j++)\n nafW = repr[j], nafW === i \? b = b.mixedAdd(doubles.points[j]) : nafW === -i && (b = b.mixedAdd(doubles.points[j].neg()));\n a = a.add(b);\n }\n return a.toP();\n }, BaseCurve.prototype._wnafMul = function(p, k) {\n var w = 4, nafPoints = p._getNAFPoints(w);\n w = nafPoints.wnd;\n for (var wnd = nafPoints.points, naf = getNAF(k, w, this._bitLength), acc = this.jpoint(null, null, null), i = naf.length - 1;i >= 0; i--) {\n for (var l = 0;i >= 0 && naf[i] === 0; i--)\n l++;\n if (i >= 0 && l++, acc = acc.dblp(l), i < 0)\n break;\n var z = naf[i];\n assert(z !== 0), p.type === \"affine\" \? z > 0 \? acc = acc.mixedAdd(wnd[z - 1 >> 1]) : acc = acc.mixedAdd(wnd[-z - 1 >> 1].neg()) : z > 0 \? acc = acc.add(wnd[z - 1 >> 1]) : acc = acc.add(wnd[-z - 1 >> 1].neg());\n }\n return p.type === \"affine\" \? acc.toP() : acc;\n }, BaseCurve.prototype._wnafMulAdd = function(defW, points, coeffs, len, jacobianResult) {\n var wndWidth = this._wnafT1, wnd = this._wnafT2, naf = this._wnafT3, max = 0, i, j, p;\n for (i = 0;i < len; i++) {\n p = points[i];\n var nafPoints = p._getNAFPoints(defW);\n wndWidth[i] = nafPoints.wnd, wnd[i] = nafPoints.points;\n }\n for (i = len - 1;i >= 1; i -= 2) {\n var a = i - 1, b = i;\n if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength), naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength), max = Math.max(naf[a].length, max), max = Math.max(naf[b].length, max);\n continue;\n }\n var comb = [points[a], null, null, points[b]];\n points[a].y.cmp(points[b].y) === 0 \? (comb[1] = points[a].add(points[b]), comb[2] = points[a].toJ().mixedAdd(points[b].neg())) : points[a].y.cmp(points[b].y.redNeg()) === 0 \? (comb[1] = points[a].toJ().mixedAdd(points[b]), comb[2] = points[a].add(points[b].neg())) : (comb[1] = points[a].toJ().mixedAdd(points[b]), comb[2] = points[a].toJ().mixedAdd(points[b].neg()));\n var index = [-3, -1, -5, -7, 0, 7, 5, 1, 3], jsf = getJSF(coeffs[a], coeffs[b]);\n for (max = Math.max(jsf[0].length, max), naf[a] = new @Array(max), naf[b] = new @Array(max), j = 0;j < max; j++) {\n var ja = jsf[0][j] | 0, jb = jsf[1][j] | 0;\n naf[a][j] = index[(ja + 1) * 3 + (jb + 1)], naf[b][j] = 0, wnd[a] = comb;\n }\n }\n var acc = this.jpoint(null, null, null), tmp = this._wnafT4;\n for (i = max;i >= 0; i--) {\n for (var k = 0;i >= 0; ) {\n var zero = !0;\n for (j = 0;j < len; j++)\n tmp[j] = naf[j][i] | 0, tmp[j] !== 0 && (zero = !1);\n if (!zero)\n break;\n k++, i--;\n }\n if (i >= 0 && k++, acc = acc.dblp(k), i < 0)\n break;\n for (j = 0;j < len; j++) {\n var z = tmp[j];\n z !== 0 && (z > 0 \? p = wnd[j][z - 1 >> 1] : z < 0 && (p = wnd[j][-z - 1 >> 1].neg()), p.type === \"affine\" \? acc = acc.mixedAdd(p) : acc = acc.add(p));\n }\n }\n for (i = 0;i < len; i++)\n wnd[i] = null;\n return jacobianResult \? acc : acc.toP();\n };\n function BasePoint(curve, type) {\n this.curve = curve, this.type = type, this.precomputed = null;\n }\n BasePoint.prototype = {}, BaseCurve.BasePoint = BasePoint, BasePoint.prototype.eq = function() {\n throw new Error(\"Not implemented\");\n }, BasePoint.prototype.validate = function() {\n return this.curve.validate(this);\n }, BaseCurve.prototype.decodePoint = function(bytes, enc) {\n bytes = utils.toArray(bytes, enc);\n var len = this.p.byteLength();\n if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) {\n bytes[0] === 6 \? assert(bytes[bytes.length - 1] % 2 === 0) : bytes[0] === 7 && assert(bytes[bytes.length - 1] % 2 === 1);\n var res = this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len));\n return res;\n } else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len)\n return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3);\n throw new Error(\"Unknown point format\");\n }, BasePoint.prototype.encodeCompressed = function(enc) {\n return this.encode(enc, !0);\n }, BasePoint.prototype._encode = function(compact) {\n var len = this.curve.p.byteLength(), x = this.getX().toArray(\"be\", len);\n return compact \? [this.getY().isEven() \? 2 : 3].concat(x) : [4].concat(x, this.getY().toArray(\"be\", len));\n }, BasePoint.prototype.encode = function(enc, compact) {\n return utils.encode(this._encode(compact), enc);\n }, BasePoint.prototype.precompute = function(power) {\n if (this.precomputed)\n return this;\n var precomputed = {\n doubles: null,\n naf: null,\n beta: null\n };\n return precomputed.naf = this._getNAFPoints(8), precomputed.doubles = this._getDoubles(4, power), precomputed.beta = this._getBeta(), this.precomputed = precomputed, this;\n }, BasePoint.prototype._hasDoubles = function(k) {\n if (!this.precomputed)\n return !1;\n var doubles = this.precomputed.doubles;\n return doubles \? doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step) : !1;\n }, BasePoint.prototype._getDoubles = function(step, power) {\n if (this.precomputed && this.precomputed.doubles)\n return this.precomputed.doubles;\n for (var doubles = [this], acc = this, i = 0;i < power; i += step) {\n for (var j = 0;j < step; j++)\n acc = acc.dbl();\n doubles.push(acc);\n }\n return {\n step,\n points: doubles\n };\n }, BasePoint.prototype._getNAFPoints = function(wnd) {\n if (this.precomputed && this.precomputed.naf)\n return this.precomputed.naf;\n for (var res = [this], max = (1 << wnd) - 1, dbl = max === 1 \? null : this.dbl(), i = 1;i < max; i++)\n res[i] = res[i - 1].add(dbl);\n return {\n wnd,\n points: res\n };\n }, BasePoint.prototype._getBeta = function() {\n return null;\n }, BasePoint.prototype.dblp = function(k) {\n for (var r = this, i = 0;i < k; i++)\n r = r.dbl();\n return r;\n };\n }\n}), require_short = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/short.js\"(exports, module) {\n var utils = require_utils3(), BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), assert = utils.assert;\n function ShortCurve(conf) {\n Base.@call(this, \"short\", conf), this.a = new BN(conf.a, 16).toRed(this.red), this.b = new BN(conf.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = this.a.fromRed().cmpn(0) === 0, this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0, this.endo = this._getEndomorphism(conf), this._endoWnafT1 = new @Array(4), this._endoWnafT2 = new @Array(4);\n }\n inherits(ShortCurve, Base), module.exports = ShortCurve, ShortCurve.prototype._getEndomorphism = function(conf) {\n if (!(!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)) {\n var beta, lambda;\n if (conf.beta)\n beta = new BN(conf.beta, 16).toRed(this.red);\n else {\n var betas = this._getEndoRoots(this.p);\n beta = betas[0].cmp(betas[1]) < 0 \? betas[0] : betas[1], beta = beta.toRed(this.red);\n }\n if (conf.lambda)\n lambda = new BN(conf.lambda, 16);\n else {\n var lambdas = this._getEndoRoots(this.n);\n this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0 \? lambda = lambdas[0] : (lambda = lambdas[1], assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0));\n }\n var basis;\n return conf.basis \? basis = conf.basis.map(function(vec) {\n return {\n a: new BN(vec.a, 16),\n b: new BN(vec.b, 16)\n };\n }) : basis = this._getEndoBasis(lambda), {\n beta,\n lambda,\n basis\n };\n }\n }, ShortCurve.prototype._getEndoRoots = function(num) {\n var red = num === this.p \? this.red : BN.mont(num), tinv = new BN(2).toRed(red).redInvm(), ntinv = tinv.redNeg(), s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv), l1 = ntinv.redAdd(s).fromRed(), l2 = ntinv.redSub(s).fromRed();\n return [l1, l2];\n }, ShortCurve.prototype._getEndoBasis = function(lambda) {\n for (var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), u = lambda, v = this.n.clone(), x1 = new BN(1), y1 = new BN(0), x2 = new BN(0), y2 = new BN(1), a0, b0, a1, b1, a2, b2, prevR, i = 0, r, x;u.cmpn(0) !== 0; ) {\n var q = v.div(u);\n r = v.sub(q.mul(u)), x = x2.sub(q.mul(x1));\n var y = y2.sub(q.mul(y1));\n if (!a1 && r.cmp(aprxSqrt) < 0)\n a0 = prevR.neg(), b0 = x1, a1 = r.neg(), b1 = x;\n else if (a1 && ++i === 2)\n break;\n prevR = r, v = u, u = r, x2 = x1, x1 = x, y2 = y1, y1 = y;\n }\n a2 = r.neg(), b2 = x;\n var len1 = a1.sqr().add(b1.sqr()), len2 = a2.sqr().add(b2.sqr());\n return len2.cmp(len1) >= 0 && (a2 = a0, b2 = b0), a1.negative && (a1 = a1.neg(), b1 = b1.neg()), a2.negative && (a2 = a2.neg(), b2 = b2.neg()), [\n { a: a1, b: b1 },\n { a: a2, b: b2 }\n ];\n }, ShortCurve.prototype._endoSplit = function(k) {\n var basis = this.endo.basis, v1 = basis[0], v2 = basis[1], c1 = v2.b.mul(k).divRound(this.n), c2 = v1.b.neg().mul(k).divRound(this.n), p1 = c1.mul(v1.a), p2 = c2.mul(v2.a), q1 = c1.mul(v1.b), q2 = c2.mul(v2.b), k1 = k.sub(p1).sub(p2), k2 = q1.add(q2).neg();\n return { k1, k2 };\n }, ShortCurve.prototype.pointFromX = function(x, odd) {\n x = new BN(x, 16), x.red || (x = x.toRed(this.red));\n var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b), y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n var isOdd = y.fromRed().isOdd();\n return (odd && !isOdd || !odd && isOdd) && (y = y.redNeg()), this.point(x, y);\n }, ShortCurve.prototype.validate = function(point) {\n if (point.inf)\n return !0;\n var { x, y } = point, ax = this.a.redMul(x), rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n return y.redSqr().redISub(rhs).cmpn(0) === 0;\n }, ShortCurve.prototype._endoWnafMulAdd = function(points, coeffs, jacobianResult) {\n for (var npoints = this._endoWnafT1, ncoeffs = this._endoWnafT2, i = 0;i < points.length; i++) {\n var split = this._endoSplit(coeffs[i]), p = points[i], beta = p._getBeta();\n split.k1.negative && (split.k1.ineg(), p = p.neg(!0)), split.k2.negative && (split.k2.ineg(), beta = beta.neg(!0)), npoints[i * 2] = p, npoints[i * 2 + 1] = beta, ncoeffs[i * 2] = split.k1, ncoeffs[i * 2 + 1] = split.k2;\n }\n for (var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult), j = 0;j < i * 2; j++)\n npoints[j] = null, ncoeffs[j] = null;\n return res;\n };\n function Point(curve, x, y, isRed) {\n Base.BasePoint.@call(this, curve, \"affine\"), x === null && y === null \? (this.x = null, this.y = null, this.inf = !0) : (this.x = new BN(x, 16), this.y = new BN(y, 16), isRed && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = !1);\n }\n inherits(Point, Base.BasePoint), ShortCurve.prototype.point = function(x, y, isRed) {\n return new Point(this, x, y, isRed);\n }, ShortCurve.prototype.pointFromJSON = function(obj, red) {\n return Point.fromJSON(this, obj, red);\n }, Point.prototype._getBeta = function() {\n if (this.curve.endo) {\n var pre = this.precomputed;\n if (pre && pre.beta)\n return pre.beta;\n var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n if (pre) {\n var curve = this.curve, endoMul = function(p) {\n return curve.point(p.x.redMul(curve.endo.beta), p.y);\n };\n pre.beta = beta, beta.precomputed = {\n beta: null,\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(endoMul)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(endoMul)\n }\n };\n }\n return beta;\n }\n }, Point.prototype.toJSON = function() {\n return this.precomputed \? [\n this.x,\n this.y,\n this.precomputed && {\n doubles: this.precomputed.doubles && {\n step: this.precomputed.doubles.step,\n points: this.precomputed.doubles.points.slice(1)\n },\n naf: this.precomputed.naf && {\n wnd: this.precomputed.naf.wnd,\n points: this.precomputed.naf.points.slice(1)\n }\n }\n ] : [this.x, this.y];\n }, Point.fromJSON = function(curve, obj, red) {\n typeof obj == \"string\" && (obj = JSON.parse(obj));\n var res = curve.point(obj[0], obj[1], red);\n if (!obj[2])\n return res;\n function obj2point(obj2) {\n return curve.point(obj2[0], obj2[1], red);\n }\n var pre = obj[2];\n return res.precomputed = {\n beta: null,\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: [res].concat(pre.doubles.points.map(obj2point))\n },\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: [res].concat(pre.naf.points.map(obj2point))\n }\n }, res;\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" y: \" + this.y.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.inf;\n }, Point.prototype.add = function(p) {\n if (this.inf)\n return p;\n if (p.inf)\n return this;\n if (this.eq(p))\n return this.dbl();\n if (this.neg().eq(p))\n return this.curve.point(null, null);\n if (this.x.cmp(p.x) === 0)\n return this.curve.point(null, null);\n var c = this.y.redSub(p.y);\n c.cmpn(0) !== 0 && (c = c.redMul(this.x.redSub(p.x).redInvm()));\n var nx = c.redSqr().redISub(this.x).redISub(p.x), ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n }, Point.prototype.dbl = function() {\n if (this.inf)\n return this;\n var ys1 = this.y.redAdd(this.y);\n if (ys1.cmpn(0) === 0)\n return this.curve.point(null, null);\n var a = this.curve.a, x2 = this.x.redSqr(), dyinv = ys1.redInvm(), c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv), nx = c.redSqr().redISub(this.x.redAdd(this.x)), ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n }, Point.prototype.getX = function() {\n return this.x.fromRed();\n }, Point.prototype.getY = function() {\n return this.y.fromRed();\n }, Point.prototype.mul = function(k) {\n return k = new BN(k, 16), this.isInfinity() \? this : this._hasDoubles(k) \? this.curve._fixedNafMul(this, k) : this.curve.endo \? this.curve._endoWnafMulAdd([this], [k]) : this.curve._wnafMul(this, k);\n }, Point.prototype.mulAdd = function(k1, p2, k2) {\n var points = [this, p2], coeffs = [k1, k2];\n return this.curve.endo \? this.curve._endoWnafMulAdd(points, coeffs) : this.curve._wnafMulAdd(1, points, coeffs, 2);\n }, Point.prototype.jmulAdd = function(k1, p2, k2) {\n var points = [this, p2], coeffs = [k1, k2];\n return this.curve.endo \? this.curve._endoWnafMulAdd(points, coeffs, !0) : this.curve._wnafMulAdd(1, points, coeffs, 2, !0);\n }, Point.prototype.eq = function(p) {\n return this === p || this.inf === p.inf && (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n }, Point.prototype.neg = function(_precompute) {\n if (this.inf)\n return this;\n var res = this.curve.point(this.x, this.y.redNeg());\n if (_precompute && this.precomputed) {\n var pre = this.precomputed, negate = function(p) {\n return p.neg();\n };\n res.precomputed = {\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(negate)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(negate)\n }\n };\n }\n return res;\n }, Point.prototype.toJ = function() {\n if (this.inf)\n return this.curve.jpoint(null, null, null);\n var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n return res;\n };\n function JPoint(curve, x, y, z) {\n Base.BasePoint.@call(this, curve, \"jacobian\"), x === null && y === null && z === null \? (this.x = this.curve.one, this.y = this.curve.one, this.z = new BN(0)) : (this.x = new BN(x, 16), this.y = new BN(y, 16), this.z = new BN(z, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one;\n }\n inherits(JPoint, Base.BasePoint), ShortCurve.prototype.jpoint = function(x, y, z) {\n return new JPoint(this, x, y, z);\n }, JPoint.prototype.toP = function() {\n if (this.isInfinity())\n return this.curve.point(null, null);\n var zinv = this.z.redInvm(), zinv2 = zinv.redSqr(), ax = this.x.redMul(zinv2), ay = this.y.redMul(zinv2).redMul(zinv);\n return this.curve.point(ax, ay);\n }, JPoint.prototype.neg = function() {\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n }, JPoint.prototype.add = function(p) {\n if (this.isInfinity())\n return p;\n if (p.isInfinity())\n return this;\n var pz2 = p.z.redSqr(), z2 = this.z.redSqr(), u1 = this.x.redMul(pz2), u2 = p.x.redMul(z2), s1 = this.y.redMul(pz2.redMul(p.z)), s2 = p.y.redMul(z2.redMul(this.z)), h = u1.redSub(u2), r = s1.redSub(s2);\n if (h.cmpn(0) === 0)\n return r.cmpn(0) !== 0 \? this.curve.jpoint(null, null, null) : this.dbl();\n var h2 = h.redSqr(), h3 = h2.redMul(h), v = u1.redMul(h2), nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v), ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)), nz = this.z.redMul(p.z).redMul(h);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.mixedAdd = function(p) {\n if (this.isInfinity())\n return p.toJ();\n if (p.isInfinity())\n return this;\n var z2 = this.z.redSqr(), u1 = this.x, u2 = p.x.redMul(z2), s1 = this.y, s2 = p.y.redMul(z2).redMul(this.z), h = u1.redSub(u2), r = s1.redSub(s2);\n if (h.cmpn(0) === 0)\n return r.cmpn(0) !== 0 \? this.curve.jpoint(null, null, null) : this.dbl();\n var h2 = h.redSqr(), h3 = h2.redMul(h), v = u1.redMul(h2), nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v), ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)), nz = this.z.redMul(h);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.dblp = function(pow) {\n if (pow === 0)\n return this;\n if (this.isInfinity())\n return this;\n if (!pow)\n return this.dbl();\n var i;\n if (this.curve.zeroA || this.curve.threeA) {\n var r = this;\n for (i = 0;i < pow; i++)\n r = r.dbl();\n return r;\n }\n var a = this.curve.a, tinv = this.curve.tinv, jx = this.x, jy = this.y, jz = this.z, jz4 = jz.redSqr().redSqr(), jyd = jy.redAdd(jy);\n for (i = 0;i < pow; i++) {\n var jx2 = jx.redSqr(), jyd2 = jyd.redSqr(), jyd4 = jyd2.redSqr(), c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)), t1 = jx.redMul(jyd2), nx = c.redSqr().redISub(t1.redAdd(t1)), t2 = t1.redISub(nx), dny = c.redMul(t2);\n dny = dny.redIAdd(dny).redISub(jyd4);\n var nz = jyd.redMul(jz);\n i + 1 < pow && (jz4 = jz4.redMul(jyd4)), jx = nx, jz = nz, jyd = dny;\n }\n return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n }, JPoint.prototype.dbl = function() {\n return this.isInfinity() \? this : this.curve.zeroA \? this._zeroDbl() : this.curve.threeA \? this._threeDbl() : this._dbl();\n }, JPoint.prototype._zeroDbl = function() {\n var nx, ny, nz;\n if (this.zOne) {\n var xx = this.x.redSqr(), yy = this.y.redSqr(), yyyy = yy.redSqr(), s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n var m = xx.redAdd(xx).redIAdd(xx), t = m.redSqr().redISub(s).redISub(s), yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8), yyyy8 = yyyy8.redIAdd(yyyy8), nx = t, ny = m.redMul(s.redISub(t)).redISub(yyyy8), nz = this.y.redAdd(this.y);\n } else {\n var a = this.x.redSqr(), b = this.y.redSqr(), c = b.redSqr(), d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n d = d.redIAdd(d);\n var e = a.redAdd(a).redIAdd(a), f = e.redSqr(), c8 = c.redIAdd(c);\n c8 = c8.redIAdd(c8), c8 = c8.redIAdd(c8), nx = f.redISub(d).redISub(d), ny = e.redMul(d.redISub(nx)).redISub(c8), nz = this.y.redMul(this.z), nz = nz.redIAdd(nz);\n }\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype._threeDbl = function() {\n var nx, ny, nz;\n if (this.zOne) {\n var xx = this.x.redSqr(), yy = this.y.redSqr(), yyyy = yy.redSqr(), s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a), t = m.redSqr().redISub(s).redISub(s);\n nx = t;\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8), yyyy8 = yyyy8.redIAdd(yyyy8), ny = m.redMul(s.redISub(t)).redISub(yyyy8), nz = this.y.redAdd(this.y);\n } else {\n var delta = this.z.redSqr(), gamma = this.y.redSqr(), beta = this.x.redMul(gamma), alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n alpha = alpha.redAdd(alpha).redIAdd(alpha);\n var beta4 = beta.redIAdd(beta);\n beta4 = beta4.redIAdd(beta4);\n var beta8 = beta4.redAdd(beta4);\n nx = alpha.redSqr().redISub(beta8), nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n var ggamma8 = gamma.redSqr();\n ggamma8 = ggamma8.redIAdd(ggamma8), ggamma8 = ggamma8.redIAdd(ggamma8), ggamma8 = ggamma8.redIAdd(ggamma8), ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n }\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype._dbl = function() {\n var a = this.curve.a, jx = this.x, jy = this.y, jz = this.z, jz4 = jz.redSqr().redSqr(), jx2 = jx.redSqr(), jy2 = jy.redSqr(), c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)), jxd4 = jx.redAdd(jx);\n jxd4 = jxd4.redIAdd(jxd4);\n var t1 = jxd4.redMul(jy2), nx = c.redSqr().redISub(t1.redAdd(t1)), t2 = t1.redISub(nx), jyd8 = jy2.redSqr();\n jyd8 = jyd8.redIAdd(jyd8), jyd8 = jyd8.redIAdd(jyd8), jyd8 = jyd8.redIAdd(jyd8);\n var ny = c.redMul(t2).redISub(jyd8), nz = jy.redAdd(jy).redMul(jz);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.trpl = function() {\n if (!this.curve.zeroA)\n return this.dbl().add(this);\n var xx = this.x.redSqr(), yy = this.y.redSqr(), zz = this.z.redSqr(), yyyy = yy.redSqr(), m = xx.redAdd(xx).redIAdd(xx), mm = m.redSqr(), e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n e = e.redIAdd(e), e = e.redAdd(e).redIAdd(e), e = e.redISub(mm);\n var ee = e.redSqr(), t = yyyy.redIAdd(yyyy);\n t = t.redIAdd(t), t = t.redIAdd(t), t = t.redIAdd(t);\n var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t), yyu4 = yy.redMul(u);\n yyu4 = yyu4.redIAdd(yyu4), yyu4 = yyu4.redIAdd(yyu4);\n var nx = this.x.redMul(ee).redISub(yyu4);\n nx = nx.redIAdd(nx), nx = nx.redIAdd(nx);\n var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n ny = ny.redIAdd(ny), ny = ny.redIAdd(ny), ny = ny.redIAdd(ny);\n var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.mul = function(k, kbase) {\n return k = new BN(k, kbase), this.curve._wnafMul(this, k);\n }, JPoint.prototype.eq = function(p) {\n if (p.type === \"affine\")\n return this.eq(p.toJ());\n if (this === p)\n return !0;\n var z2 = this.z.redSqr(), pz2 = p.z.redSqr();\n if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n return !1;\n var z3 = z2.redMul(this.z), pz3 = pz2.redMul(p.z);\n return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n }, JPoint.prototype.eqXToP = function(x) {\n var zs = this.z.redSqr(), rx = x.toRed(this.curve.red).redMul(zs);\n if (this.x.cmp(rx) === 0)\n return !0;\n for (var xc = x.clone(), t = this.curve.redN.redMul(zs);; ) {\n if (xc.iadd(this.curve.n), xc.cmp(this.curve.p) >= 0)\n return !1;\n if (rx.redIAdd(t), this.x.cmp(rx) === 0)\n return !0;\n }\n }, JPoint.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC JPoint Infinity>\" : \"<EC JPoint x: \" + this.x.toString(16, 2) + \" y: \" + this.y.toString(16, 2) + \" z: \" + this.z.toString(16, 2) + \">\";\n }, JPoint.prototype.isInfinity = function() {\n return this.z.cmpn(0) === 0;\n };\n }\n}), require_mont = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/mont.js\"(exports, module) {\n var BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), utils = require_utils3();\n function MontCurve(conf) {\n Base.@call(this, \"mont\", conf), this.a = new BN(conf.a, 16).toRed(this.red), this.b = new BN(conf.b, 16).toRed(this.red), this.i4 = new BN(4).toRed(this.red).redInvm(), this.two = new BN(2).toRed(this.red), this.a24 = this.i4.redMul(this.a.redAdd(this.two));\n }\n inherits(MontCurve, Base), module.exports = MontCurve, MontCurve.prototype.validate = function(point) {\n var x = point.normalize().x, x2 = x.redSqr(), rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x), y = rhs.redSqrt();\n return y.redSqr().cmp(rhs) === 0;\n };\n function Point(curve, x, z) {\n Base.BasePoint.@call(this, curve, \"projective\"), x === null && z === null \? (this.x = this.curve.one, this.z = this.curve.zero) : (this.x = new BN(x, 16), this.z = new BN(z, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)));\n }\n inherits(Point, Base.BasePoint), MontCurve.prototype.decodePoint = function(bytes, enc) {\n return this.point(utils.toArray(bytes, enc), 1);\n }, MontCurve.prototype.point = function(x, z) {\n return new Point(this, x, z);\n }, MontCurve.prototype.pointFromJSON = function(obj) {\n return Point.fromJSON(this, obj);\n }, Point.prototype.precompute = function() {\n }, Point.prototype._encode = function() {\n return this.getX().toArray(\"be\", this.curve.p.byteLength());\n }, Point.fromJSON = function(curve, obj) {\n return new Point(curve, obj[0], obj[1] || curve.one);\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" z: \" + this.z.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.z.cmpn(0) === 0;\n }, Point.prototype.dbl = function() {\n var a = this.x.redAdd(this.z), aa = a.redSqr(), b = this.x.redSub(this.z), bb = b.redSqr(), c = aa.redSub(bb), nx = aa.redMul(bb), nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\n return this.curve.point(nx, nz);\n }, Point.prototype.add = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.diffAdd = function(p, diff) {\n var a = this.x.redAdd(this.z), b = this.x.redSub(this.z), c = p.x.redAdd(p.z), d = p.x.redSub(p.z), da = d.redMul(a), cb = c.redMul(b), nx = diff.z.redMul(da.redAdd(cb).redSqr()), nz = diff.x.redMul(da.redISub(cb).redSqr());\n return this.curve.point(nx, nz);\n }, Point.prototype.mul = function(k) {\n for (var t = k.clone(), a = this, b = this.curve.point(null, null), c = this, bits = [];t.cmpn(0) !== 0; t.iushrn(1))\n bits.push(t.andln(1));\n for (var i = bits.length - 1;i >= 0; i--)\n bits[i] === 0 \? (a = a.diffAdd(b, c), b = b.dbl()) : (b = a.diffAdd(b, c), a = a.dbl());\n return b;\n }, Point.prototype.mulAdd = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.jumlAdd = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.eq = function(other) {\n return this.getX().cmp(other.getX()) === 0;\n }, Point.prototype.normalize = function() {\n return this.x = this.x.redMul(this.z.redInvm()), this.z = this.curve.one, this;\n }, Point.prototype.getX = function() {\n return this.normalize(), this.x.fromRed();\n };\n }\n}), require_edwards = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/edwards.js\"(exports, module) {\n var utils = require_utils3(), BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), assert = utils.assert;\n function EdwardsCurve(conf) {\n this.twisted = (conf.a | 0) !== 1, this.mOneA = this.twisted && (conf.a | 0) === -1, this.extended = this.mOneA, Base.@call(this, \"edwards\", conf), this.a = new BN(conf.a, 16).umod(this.red.m), this.a = this.a.toRed(this.red), this.c = new BN(conf.c, 16).toRed(this.red), this.c2 = this.c.redSqr(), this.d = new BN(conf.d, 16).toRed(this.red), this.dd = this.d.redAdd(this.d), assert(!this.twisted || this.c.fromRed().cmpn(1) === 0), this.oneC = (conf.c | 0) === 1;\n }\n inherits(EdwardsCurve, Base), module.exports = EdwardsCurve, EdwardsCurve.prototype._mulA = function(num) {\n return this.mOneA \? num.redNeg() : this.a.redMul(num);\n }, EdwardsCurve.prototype._mulC = function(num) {\n return this.oneC \? num : this.c.redMul(num);\n }, EdwardsCurve.prototype.jpoint = function(x, y, z, t) {\n return this.point(x, y, z, t);\n }, EdwardsCurve.prototype.pointFromX = function(x, odd) {\n x = new BN(x, 16), x.red || (x = x.toRed(this.red));\n var x2 = x.redSqr(), rhs = this.c2.redSub(this.a.redMul(x2)), lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2)), y2 = rhs.redMul(lhs.redInvm()), y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n var isOdd = y.fromRed().isOdd();\n return (odd && !isOdd || !odd && isOdd) && (y = y.redNeg()), this.point(x, y);\n }, EdwardsCurve.prototype.pointFromY = function(y, odd) {\n y = new BN(y, 16), y.red || (y = y.toRed(this.red));\n var y2 = y.redSqr(), lhs = y2.redSub(this.c2), rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a), x2 = lhs.redMul(rhs.redInvm());\n if (x2.cmp(this.zero) === 0) {\n if (odd)\n throw new Error(\"invalid point\");\n return this.point(this.zero, y);\n }\n var x = x2.redSqrt();\n if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n return x.fromRed().isOdd() !== odd && (x = x.redNeg()), this.point(x, y);\n }, EdwardsCurve.prototype.validate = function(point) {\n if (point.isInfinity())\n return !0;\n point.normalize();\n var x2 = point.x.redSqr(), y2 = point.y.redSqr(), lhs = x2.redMul(this.a).redAdd(y2), rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\n return lhs.cmp(rhs) === 0;\n };\n function Point(curve, x, y, z, t) {\n Base.BasePoint.@call(this, curve, \"projective\"), x === null && y === null && z === null \? (this.x = this.curve.zero, this.y = this.curve.one, this.z = this.curve.one, this.t = this.curve.zero, this.zOne = !0) : (this.x = new BN(x, 16), this.y = new BN(y, 16), this.z = z \? new BN(z, 16) : this.curve.one, this.t = t && new BN(t, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.t && !this.t.red && (this.t = this.t.toRed(this.curve.red)), this.zOne = this.z === this.curve.one, this.curve.extended && !this.t && (this.t = this.x.redMul(this.y), this.zOne || (this.t = this.t.redMul(this.z.redInvm()))));\n }\n inherits(Point, Base.BasePoint), EdwardsCurve.prototype.pointFromJSON = function(obj) {\n return Point.fromJSON(this, obj);\n }, EdwardsCurve.prototype.point = function(x, y, z, t) {\n return new Point(this, x, y, z, t);\n }, Point.fromJSON = function(curve, obj) {\n return new Point(curve, obj[0], obj[1], obj[2]);\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" y: \" + this.y.fromRed().toString(16, 2) + \" z: \" + this.z.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || this.zOne && this.y.cmp(this.curve.c) === 0);\n }, Point.prototype._extDbl = function() {\n var a = this.x.redSqr(), b = this.y.redSqr(), c = this.z.redSqr();\n c = c.redIAdd(c);\n var d = this.curve._mulA(a), e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b), g = d.redAdd(b), f = g.redSub(c), h = d.redSub(b), nx = e.redMul(f), ny = g.redMul(h), nt = e.redMul(h), nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n }, Point.prototype._projDbl = function() {\n var b = this.x.redAdd(this.y).redSqr(), c = this.x.redSqr(), d = this.y.redSqr(), nx, ny, nz, e, h, j;\n if (this.curve.twisted) {\n e = this.curve._mulA(c);\n var f = e.redAdd(d);\n this.zOne \? (nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)), ny = f.redMul(e.redSub(d)), nz = f.redSqr().redSub(f).redSub(f)) : (h = this.z.redSqr(), j = f.redSub(h).redISub(h), nx = b.redSub(c).redISub(d).redMul(j), ny = f.redMul(e.redSub(d)), nz = f.redMul(j));\n } else\n e = c.redAdd(d), h = this.curve._mulC(this.z).redSqr(), j = e.redSub(h).redSub(h), nx = this.curve._mulC(b.redISub(e)).redMul(j), ny = this.curve._mulC(e).redMul(c.redISub(d)), nz = e.redMul(j);\n return this.curve.point(nx, ny, nz);\n }, Point.prototype.dbl = function() {\n return this.isInfinity() \? this : this.curve.extended \? this._extDbl() : this._projDbl();\n }, Point.prototype._extAdd = function(p) {\n var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)), b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)), c = this.t.redMul(this.curve.dd).redMul(p.t), d = this.z.redMul(p.z.redAdd(p.z)), e = b.redSub(a), f = d.redSub(c), g = d.redAdd(c), h = b.redAdd(a), nx = e.redMul(f), ny = g.redMul(h), nt = e.redMul(h), nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n }, Point.prototype._projAdd = function(p) {\n var a = this.z.redMul(p.z), b = a.redSqr(), c = this.x.redMul(p.x), d = this.y.redMul(p.y), e = this.curve.d.redMul(c).redMul(d), f = b.redSub(e), g = b.redAdd(e), tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d), nx = a.redMul(f).redMul(tmp), ny, nz;\n return this.curve.twisted \? (ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))), nz = f.redMul(g)) : (ny = a.redMul(g).redMul(d.redSub(c)), nz = this.curve._mulC(f).redMul(g)), this.curve.point(nx, ny, nz);\n }, Point.prototype.add = function(p) {\n return this.isInfinity() \? p : p.isInfinity() \? this : this.curve.extended \? this._extAdd(p) : this._projAdd(p);\n }, Point.prototype.mul = function(k) {\n return this._hasDoubles(k) \? this.curve._fixedNafMul(this, k) : this.curve._wnafMul(this, k);\n }, Point.prototype.mulAdd = function(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, !1);\n }, Point.prototype.jmulAdd = function(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, !0);\n }, Point.prototype.normalize = function() {\n if (this.zOne)\n return this;\n var zi = this.z.redInvm();\n return this.x = this.x.redMul(zi), this.y = this.y.redMul(zi), this.t && (this.t = this.t.redMul(zi)), this.z = this.curve.one, this.zOne = !0, this;\n }, Point.prototype.neg = function() {\n return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg());\n }, Point.prototype.getX = function() {\n return this.normalize(), this.x.fromRed();\n }, Point.prototype.getY = function() {\n return this.normalize(), this.y.fromRed();\n }, Point.prototype.eq = function(other) {\n return this === other || this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0;\n }, Point.prototype.eqXToP = function(x) {\n var rx = x.toRed(this.curve.red).redMul(this.z);\n if (this.x.cmp(rx) === 0)\n return !0;\n for (var xc = x.clone(), t = this.curve.redN.redMul(this.z);; ) {\n if (xc.iadd(this.curve.n), xc.cmp(this.curve.p) >= 0)\n return !1;\n if (rx.redIAdd(t), this.x.cmp(rx) === 0)\n return !0;\n }\n }, Point.prototype.toP = Point.prototype.normalize, Point.prototype.mixedAdd = Point.prototype.add;\n }\n}), require_curve = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/index.js\"(exports) {\n var curve = exports;\n curve.base = require_base(), curve.short = require_short(), curve.mont = require_mont(), curve.edwards = require_edwards();\n }\n}), require_utils4 = __commonJS({\n \"node_modules/hash.js/lib/hash/utils.js\"(exports) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser();\n exports.inherits = inherits;\n function isSurrogatePair(msg, i) {\n return (msg.charCodeAt(i) & 64512) !== 55296 || i < 0 || i + 1 >= msg.length \? !1 : (msg.charCodeAt(i + 1) & 64512) === 56320;\n }\n function toArray(msg, enc) {\n if (@Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg == \"string\")\n if (enc) {\n if (enc === \"hex\")\n for (msg = msg.replace(/[^a-z0-9]+/gi, \"\"), msg.length % 2 !== 0 && (msg = \"0\" + msg), i = 0;i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else\n for (var p = 0, i = 0;i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n c < 128 \? res[p++] = c : c < 2048 \? (res[p++] = c >> 6 | 192, res[p++] = c & 63 | 128) : isSurrogatePair(msg, i) \? (c = 65536 + ((c & 1023) << 10) + (msg.charCodeAt(++i) & 1023), res[p++] = c >> 18 | 240, res[p++] = c >> 12 & 63 | 128, res[p++] = c >> 6 & 63 | 128, res[p++] = c & 63 | 128) : (res[p++] = c >> 12 | 224, res[p++] = c >> 6 & 63 | 128, res[p++] = c & 63 | 128);\n }\n else\n for (i = 0;i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n exports.toArray = toArray;\n function toHex(msg) {\n for (var res = \"\", i = 0;i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n }\n exports.toHex = toHex;\n function htonl(w) {\n var res = w >>> 24 | w >>> 8 & 65280 | w << 8 & 16711680 | (w & 255) << 24;\n return res >>> 0;\n }\n exports.htonl = htonl;\n function toHex32(msg, endian) {\n for (var res = \"\", i = 0;i < msg.length; i++) {\n var w = msg[i];\n endian === \"little\" && (w = htonl(w)), res += zero8(w.toString(16));\n }\n return res;\n }\n exports.toHex32 = toHex32;\n function zero2(word) {\n return word.length === 1 \? \"0\" + word : word;\n }\n exports.zero2 = zero2;\n function zero8(word) {\n return word.length === 7 \? \"0\" + word : word.length === 6 \? \"00\" + word : word.length === 5 \? \"000\" + word : word.length === 4 \? \"0000\" + word : word.length === 3 \? \"00000\" + word : word.length === 2 \? \"000000\" + word : word.length === 1 \? \"0000000\" + word : word;\n }\n exports.zero8 = zero8;\n function join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n for (var res = new @Array(len / 4), i = 0, k = start;i < res.length; i++, k += 4) {\n var w;\n endian === \"big\" \? w = msg[k] << 24 | msg[k + 1] << 16 | msg[k + 2] << 8 | msg[k + 3] : w = msg[k + 3] << 24 | msg[k + 2] << 16 | msg[k + 1] << 8 | msg[k], res[i] = w >>> 0;\n }\n return res;\n }\n exports.join32 = join32;\n function split32(msg, endian) {\n for (var res = new @Array(msg.length * 4), i = 0, k = 0;i < msg.length; i++, k += 4) {\n var m = msg[i];\n endian === \"big\" \? (res[k] = m >>> 24, res[k + 1] = m >>> 16 & 255, res[k + 2] = m >>> 8 & 255, res[k + 3] = m & 255) : (res[k + 3] = m >>> 24, res[k + 2] = m >>> 16 & 255, res[k + 1] = m >>> 8 & 255, res[k] = m & 255);\n }\n return res;\n }\n exports.split32 = split32;\n function rotr32(w, b) {\n return w >>> b | w << 32 - b;\n }\n exports.rotr32 = rotr32;\n function rotl32(w, b) {\n return w << b | w >>> 32 - b;\n }\n exports.rotl32 = rotl32;\n function sum32(a, b) {\n return a + b >>> 0;\n }\n exports.sum32 = sum32;\n function sum32_3(a, b, c) {\n return a + b + c >>> 0;\n }\n exports.sum32_3 = sum32_3;\n function sum32_4(a, b, c, d) {\n return a + b + c + d >>> 0;\n }\n exports.sum32_4 = sum32_4;\n function sum32_5(a, b, c, d, e) {\n return a + b + c + d + e >>> 0;\n }\n exports.sum32_5 = sum32_5;\n function sum64(buf, pos, ah, al) {\n var bh = buf[pos], bl = buf[pos + 1], lo = al + bl >>> 0, hi = (lo < al \? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0, buf[pos + 1] = lo;\n }\n exports.sum64 = sum64;\n function sum64_hi(ah, al, bh, bl) {\n var lo = al + bl >>> 0, hi = (lo < al \? 1 : 0) + ah + bh;\n return hi >>> 0;\n }\n exports.sum64_hi = sum64_hi;\n function sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n }\n exports.sum64_lo = sum64_lo;\n function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0, lo = al;\n lo = lo + bl >>> 0, carry += lo < al \? 1 : 0, lo = lo + cl >>> 0, carry += lo < cl \? 1 : 0, lo = lo + dl >>> 0, carry += lo < dl \? 1 : 0;\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n }\n exports.sum64_4_hi = sum64_4_hi;\n function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n }\n exports.sum64_4_lo = sum64_4_lo;\n function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0, lo = al;\n lo = lo + bl >>> 0, carry += lo < al \? 1 : 0, lo = lo + cl >>> 0, carry += lo < cl \? 1 : 0, lo = lo + dl >>> 0, carry += lo < dl \? 1 : 0, lo = lo + el >>> 0, carry += lo < el \? 1 : 0;\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n }\n exports.sum64_5_hi = sum64_5_hi;\n function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n return lo >>> 0;\n }\n exports.sum64_5_lo = sum64_5_lo;\n function rotr64_hi(ah, al, num) {\n var r = al << 32 - num | ah >>> num;\n return r >>> 0;\n }\n exports.rotr64_hi = rotr64_hi;\n function rotr64_lo(ah, al, num) {\n var r = ah << 32 - num | al >>> num;\n return r >>> 0;\n }\n exports.rotr64_lo = rotr64_lo;\n function shr64_hi(ah, al, num) {\n return ah >>> num;\n }\n exports.shr64_hi = shr64_hi;\n function shr64_lo(ah, al, num) {\n var r = ah << 32 - num | al >>> num;\n return r >>> 0;\n }\n exports.shr64_lo = shr64_lo;\n }\n}), require_common = __commonJS({\n \"node_modules/hash.js/lib/hash/common.js\"(exports) {\n var utils = require_utils4(), assert = require_minimalistic_assert();\n function BlockHash() {\n this.pending = null, this.pendingTotal = 0, this.blockSize = this.constructor.blockSize, this.outSize = this.constructor.outSize, this.hmacStrength = this.constructor.hmacStrength, this.padLength = this.constructor.padLength / 8, this.endian = \"big\", this._delta8 = this.blockSize / 8, this._delta32 = this.blockSize / 32;\n }\n BlockHash.prototype = {}, exports.BlockHash = BlockHash, BlockHash.prototype.update = function(msg, enc) {\n if (msg = utils.toArray(msg, enc), this.pending \? this.pending = this.pending.concat(msg) : this.pending = msg, this.pendingTotal += msg.length, this.pending.length >= this._delta8) {\n msg = this.pending;\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length), this.pending.length === 0 && (this.pending = null), msg = utils.join32(msg, 0, msg.length - r, this.endian);\n for (var i = 0;i < msg.length; i += this._delta32)\n this._update(msg, i, i + this._delta32);\n }\n return this;\n }, BlockHash.prototype.digest = function(enc) {\n return this.update(this._pad()), assert(this.pending === null), this._digest(enc);\n }, BlockHash.prototype._pad = function() {\n var len = this.pendingTotal, bytes = this._delta8, k = bytes - (len + this.padLength) % bytes, res = new @Array(k + this.padLength);\n res[0] = 128;\n for (var i = 1;i < k; i++)\n res[i] = 0;\n if (len <<= 3, this.endian === \"big\") {\n for (var t = 8;t < this.padLength; t++)\n res[i++] = 0;\n res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = len >>> 24 & 255, res[i++] = len >>> 16 & 255, res[i++] = len >>> 8 & 255, res[i++] = len & 255;\n } else\n for (res[i++] = len & 255, res[i++] = len >>> 8 & 255, res[i++] = len >>> 16 & 255, res[i++] = len >>> 24 & 255, res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = 0, t = 8;t < this.padLength; t++)\n res[i++] = 0;\n return res;\n };\n }\n}), require_common2 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/common.js\"(exports) {\n var utils = require_utils4(), rotr32 = utils.rotr32;\n function ft_1(s, x, y, z) {\n if (s === 0)\n return ch32(x, y, z);\n if (s === 1 || s === 3)\n return p32(x, y, z);\n if (s === 2)\n return maj32(x, y, z);\n }\n exports.ft_1 = ft_1;\n function ch32(x, y, z) {\n return x & y ^ ~x & z;\n }\n exports.ch32 = ch32;\n function maj32(x, y, z) {\n return x & y ^ x & z ^ y & z;\n }\n exports.maj32 = maj32;\n function p32(x, y, z) {\n return x ^ y ^ z;\n }\n exports.p32 = p32;\n function s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n }\n exports.s0_256 = s0_256;\n function s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n }\n exports.s1_256 = s1_256;\n function g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ x >>> 3;\n }\n exports.g0_256 = g0_256;\n function g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ x >>> 10;\n }\n exports.g1_256 = g1_256;\n }\n}), require__ = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/1.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), shaCommon = require_common2(), rotl32 = utils.rotl32, sum32 = utils.sum32, sum32_5 = utils.sum32_5, ft_1 = shaCommon.ft_1, BlockHash = common.BlockHash, sha1_K = [1518500249, 1859775393, 2400959708, 3395469782];\n function SHA1() {\n if (!(this instanceof SHA1))\n return new SHA1;\n BlockHash.@call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.W = new @Array(80);\n }\n utils.inherits(SHA1, BlockHash), module.exports = SHA1, SHA1.blockSize = 512, SHA1.outSize = 160, SHA1.hmacStrength = 80, SHA1.padLength = 64, SHA1.prototype._update = function(msg, start) {\n for (var W = this.W, i = 0;i < 16; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i++)\n W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n var a = this.h[0], b = this.h[1], c = this.h[2], d = this.h[3], e = this.h[4];\n for (i = 0;i < W.length; i++) {\n var s = ~~(i / 20), t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n e = d, d = c, c = rotl32(b, 30), b = a, a = t;\n }\n this.h[0] = sum32(this.h[0], a), this.h[1] = sum32(this.h[1], b), this.h[2] = sum32(this.h[2], c), this.h[3] = sum32(this.h[3], d), this.h[4] = sum32(this.h[4], e);\n }, SHA1.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n }\n}), require__2 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/256.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), shaCommon = require_common2(), assert = require_minimalistic_assert(), sum32 = utils.sum32, sum32_4 = utils.sum32_4, sum32_5 = utils.sum32_5, ch32 = shaCommon.ch32, maj32 = shaCommon.maj32, s0_256 = shaCommon.s0_256, s1_256 = shaCommon.s1_256, g0_256 = shaCommon.g0_256, g1_256 = shaCommon.g1_256, BlockHash = common.BlockHash, sha256_K = [\n 1116352408,\n 1899447441,\n 3049323471,\n 3921009573,\n 961987163,\n 1508970993,\n 2453635748,\n 2870763221,\n 3624381080,\n 310598401,\n 607225278,\n 1426881987,\n 1925078388,\n 2162078206,\n 2614888103,\n 3248222580,\n 3835390401,\n 4022224774,\n 264347078,\n 604807628,\n 770255983,\n 1249150122,\n 1555081692,\n 1996064986,\n 2554220882,\n 2821834349,\n 2952996808,\n 3210313671,\n 3336571891,\n 3584528711,\n 113926993,\n 338241895,\n 666307205,\n 773529912,\n 1294757372,\n 1396182291,\n 1695183700,\n 1986661051,\n 2177026350,\n 2456956037,\n 2730485921,\n 2820302411,\n 3259730800,\n 3345764771,\n 3516065817,\n 3600352804,\n 4094571909,\n 275423344,\n 430227734,\n 506948616,\n 659060556,\n 883997877,\n 958139571,\n 1322822218,\n 1537002063,\n 1747873779,\n 1955562222,\n 2024104815,\n 2227730452,\n 2361852424,\n 2428436474,\n 2756734187,\n 3204031479,\n 3329325298\n ];\n function SHA256() {\n if (!(this instanceof SHA256))\n return new SHA256;\n BlockHash.@call(this), this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], this.k = sha256_K, this.W = new @Array(64);\n }\n utils.inherits(SHA256, BlockHash), module.exports = SHA256, SHA256.blockSize = 512, SHA256.outSize = 256, SHA256.hmacStrength = 192, SHA256.padLength = 64, SHA256.prototype._update = function(msg, start) {\n for (var W = this.W, i = 0;i < 16; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i++)\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n var a = this.h[0], b = this.h[1], c = this.h[2], d = this.h[3], e = this.h[4], f = this.h[5], g = this.h[6], h = this.h[7];\n for (assert(this.k.length === W.length), i = 0;i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]), T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g, g = f, f = e, e = sum32(d, T1), d = c, c = b, b = a, a = sum32(T1, T2);\n }\n this.h[0] = sum32(this.h[0], a), this.h[1] = sum32(this.h[1], b), this.h[2] = sum32(this.h[2], c), this.h[3] = sum32(this.h[3], d), this.h[4] = sum32(this.h[4], e), this.h[5] = sum32(this.h[5], f), this.h[6] = sum32(this.h[6], g), this.h[7] = sum32(this.h[7], h);\n }, SHA256.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n }\n}), require__3 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/224.js\"(exports, module) {\n var utils = require_utils4(), SHA256 = require__2();\n function SHA224() {\n if (!(this instanceof SHA224))\n return new SHA224;\n SHA256.@call(this), this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428];\n }\n utils.inherits(SHA224, SHA256), module.exports = SHA224, SHA224.blockSize = 512, SHA224.outSize = 224, SHA224.hmacStrength = 192, SHA224.padLength = 64, SHA224.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h.slice(0, 7), \"big\") : utils.split32(this.h.slice(0, 7), \"big\");\n };\n }\n}), require__4 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/512.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), assert = require_minimalistic_assert(), rotr64_hi = utils.rotr64_hi, rotr64_lo = utils.rotr64_lo, shr64_hi = utils.shr64_hi, shr64_lo = utils.shr64_lo, sum64 = utils.sum64, sum64_hi = utils.sum64_hi, sum64_lo = utils.sum64_lo, sum64_4_hi = utils.sum64_4_hi, sum64_4_lo = utils.sum64_4_lo, sum64_5_hi = utils.sum64_5_hi, sum64_5_lo = utils.sum64_5_lo, BlockHash = common.BlockHash, sha512_K = [\n 1116352408,\n 3609767458,\n 1899447441,\n 602891725,\n 3049323471,\n 3964484399,\n 3921009573,\n 2173295548,\n 961987163,\n 4081628472,\n 1508970993,\n 3053834265,\n 2453635748,\n 2937671579,\n 2870763221,\n 3664609560,\n 3624381080,\n 2734883394,\n 310598401,\n 1164996542,\n 607225278,\n 1323610764,\n 1426881987,\n 3590304994,\n 1925078388,\n 4068182383,\n 2162078206,\n 991336113,\n 2614888103,\n 633803317,\n 3248222580,\n 3479774868,\n 3835390401,\n 2666613458,\n 4022224774,\n 944711139,\n 264347078,\n 2341262773,\n 604807628,\n 2007800933,\n 770255983,\n 1495990901,\n 1249150122,\n 1856431235,\n 1555081692,\n 3175218132,\n 1996064986,\n 2198950837,\n 2554220882,\n 3999719339,\n 2821834349,\n 766784016,\n 2952996808,\n 2566594879,\n 3210313671,\n 3203337956,\n 3336571891,\n 1034457026,\n 3584528711,\n 2466948901,\n 113926993,\n 3758326383,\n 338241895,\n 168717936,\n 666307205,\n 1188179964,\n 773529912,\n 1546045734,\n 1294757372,\n 1522805485,\n 1396182291,\n 2643833823,\n 1695183700,\n 2343527390,\n 1986661051,\n 1014477480,\n 2177026350,\n 1206759142,\n 2456956037,\n 344077627,\n 2730485921,\n 1290863460,\n 2820302411,\n 3158454273,\n 3259730800,\n 3505952657,\n 3345764771,\n 106217008,\n 3516065817,\n 3606008344,\n 3600352804,\n 1432725776,\n 4094571909,\n 1467031594,\n 275423344,\n 851169720,\n 430227734,\n 3100823752,\n 506948616,\n 1363258195,\n 659060556,\n 3750685593,\n 883997877,\n 3785050280,\n 958139571,\n 3318307427,\n 1322822218,\n 3812723403,\n 1537002063,\n 2003034995,\n 1747873779,\n 3602036899,\n 1955562222,\n 1575990012,\n 2024104815,\n 1125592928,\n 2227730452,\n 2716904306,\n 2361852424,\n 442776044,\n 2428436474,\n 593698344,\n 2756734187,\n 3733110249,\n 3204031479,\n 2999351573,\n 3329325298,\n 3815920427,\n 3391569614,\n 3928383900,\n 3515267271,\n 566280711,\n 3940187606,\n 3454069534,\n 4118630271,\n 4000239992,\n 116418474,\n 1914138554,\n 174292421,\n 2731055270,\n 289380356,\n 3203993006,\n 460393269,\n 320620315,\n 685471733,\n 587496836,\n 852142971,\n 1086792851,\n 1017036298,\n 365543100,\n 1126000580,\n 2618297676,\n 1288033470,\n 3409855158,\n 1501505948,\n 4234509866,\n 1607167915,\n 987167468,\n 1816402316,\n 1246189591\n ];\n function SHA512() {\n if (!(this instanceof SHA512))\n return new SHA512;\n BlockHash.@call(this), this.h = [\n 1779033703,\n 4089235720,\n 3144134277,\n 2227873595,\n 1013904242,\n 4271175723,\n 2773480762,\n 1595750129,\n 1359893119,\n 2917565137,\n 2600822924,\n 725511199,\n 528734635,\n 4215389547,\n 1541459225,\n 327033209\n ], this.k = sha512_K, this.W = new @Array(160);\n }\n utils.inherits(SHA512, BlockHash), module.exports = SHA512, SHA512.blockSize = 1024, SHA512.outSize = 512, SHA512.hmacStrength = 192, SHA512.padLength = 128, SHA512.prototype._prepareBlock = function(msg, start) {\n for (var W = this.W, i = 0;i < 32; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i += 2) {\n var c0_hi = g1_512_hi(W[i - 4], W[i - 3]), c0_lo = g1_512_lo(W[i - 4], W[i - 3]), c1_hi = W[i - 14], c1_lo = W[i - 13], c2_hi = g0_512_hi(W[i - 30], W[i - 29]), c2_lo = g0_512_lo(W[i - 30], W[i - 29]), c3_hi = W[i - 32], c3_lo = W[i - 31];\n W[i] = sum64_4_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo), W[i + 1] = sum64_4_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo);\n }\n }, SHA512.prototype._update = function(msg, start) {\n this._prepareBlock(msg, start);\n var W = this.W, ah = this.h[0], al = this.h[1], bh = this.h[2], bl = this.h[3], ch = this.h[4], cl = this.h[5], dh = this.h[6], dl = this.h[7], eh = this.h[8], el = this.h[9], fh = this.h[10], fl = this.h[11], gh = this.h[12], gl = this.h[13], hh = this.h[14], hl = this.h[15];\n assert(this.k.length === W.length);\n for (var i = 0;i < W.length; i += 2) {\n var c0_hi = hh, c0_lo = hl, c1_hi = s1_512_hi(eh, el), c1_lo = s1_512_lo(eh, el), c2_hi = ch64_hi(eh, el, fh, fl, gh, gl), c2_lo = ch64_lo(eh, el, fh, fl, gh, gl), c3_hi = this.k[i], c3_lo = this.k[i + 1], c4_hi = W[i], c4_lo = W[i + 1], T1_hi = sum64_5_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo), T1_lo = sum64_5_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo);\n c0_hi = s0_512_hi(ah, al), c0_lo = s0_512_lo(ah, al), c1_hi = maj64_hi(ah, al, bh, bl, ch, cl), c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo), T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n hh = gh, hl = gl, gh = fh, gl = fl, fh = eh, fl = el, eh = sum64_hi(dh, dl, T1_hi, T1_lo), el = sum64_lo(dl, dl, T1_hi, T1_lo), dh = ch, dl = cl, ch = bh, cl = bl, bh = ah, bl = al, ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo), al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n }\n sum64(this.h, 0, ah, al), sum64(this.h, 2, bh, bl), sum64(this.h, 4, ch, cl), sum64(this.h, 6, dh, dl), sum64(this.h, 8, eh, el), sum64(this.h, 10, fh, fl), sum64(this.h, 12, gh, gl), sum64(this.h, 14, hh, hl);\n }, SHA512.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n function ch64_hi(xh, xl, yh, yl, zh) {\n var r = xh & yh ^ ~xh & zh;\n return r < 0 && (r += 4294967296), r;\n }\n function ch64_lo(xh, xl, yh, yl, zh, zl) {\n var r = xl & yl ^ ~xl & zl;\n return r < 0 && (r += 4294967296), r;\n }\n function maj64_hi(xh, xl, yh, yl, zh) {\n var r = xh & yh ^ xh & zh ^ yh & zh;\n return r < 0 && (r += 4294967296), r;\n }\n function maj64_lo(xh, xl, yh, yl, zh, zl) {\n var r = xl & yl ^ xl & zl ^ yl & zl;\n return r < 0 && (r += 4294967296), r;\n }\n function s0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 28), c1_hi = rotr64_hi(xl, xh, 2), c2_hi = rotr64_hi(xl, xh, 7), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function s0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 28), c1_lo = rotr64_lo(xl, xh, 2), c2_lo = rotr64_lo(xl, xh, 7), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function s1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 14), c1_hi = rotr64_hi(xh, xl, 18), c2_hi = rotr64_hi(xl, xh, 9), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function s1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 14), c1_lo = rotr64_lo(xh, xl, 18), c2_lo = rotr64_lo(xl, xh, 9), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function g0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 1), c1_hi = rotr64_hi(xh, xl, 8), c2_hi = shr64_hi(xh, xl, 7), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function g0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 1), c1_lo = rotr64_lo(xh, xl, 8), c2_lo = shr64_lo(xh, xl, 7), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function g1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 19), c1_hi = rotr64_hi(xl, xh, 29), c2_hi = shr64_hi(xh, xl, 6), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function g1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 19), c1_lo = rotr64_lo(xl, xh, 29), c2_lo = shr64_lo(xh, xl, 6), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n }\n}), require__5 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/384.js\"(exports, module) {\n var utils = require_utils4(), SHA512 = require__4();\n function SHA384() {\n if (!(this instanceof SHA384))\n return new SHA384;\n SHA512.@call(this), this.h = [\n 3418070365,\n 3238371032,\n 1654270250,\n 914150663,\n 2438529370,\n 812702999,\n 355462360,\n 4144912697,\n 1731405415,\n 4290775857,\n 2394180231,\n 1750603025,\n 3675008525,\n 1694076839,\n 1203062813,\n 3204075428\n ];\n }\n utils.inherits(SHA384, SHA512), module.exports = SHA384, SHA384.blockSize = 1024, SHA384.outSize = 384, SHA384.hmacStrength = 192, SHA384.padLength = 128, SHA384.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h.slice(0, 12), \"big\") : utils.split32(this.h.slice(0, 12), \"big\");\n };\n }\n}), require_sha3 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha.js\"(exports) {\n exports.sha1 = require__(), exports.sha224 = require__3(), exports.sha256 = require__2(), exports.sha384 = require__5(), exports.sha512 = require__4();\n }\n}), require_ripemd = __commonJS({\n \"node_modules/hash.js/lib/hash/ripemd.js\"(exports) {\n var utils = require_utils4(), common = require_common(), rotl32 = utils.rotl32, sum32 = utils.sum32, sum32_3 = utils.sum32_3, sum32_4 = utils.sum32_4, BlockHash = common.BlockHash;\n function RIPEMD160() {\n if (!(this instanceof RIPEMD160))\n return new RIPEMD160;\n BlockHash.@call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = \"little\";\n }\n utils.inherits(RIPEMD160, BlockHash), exports.ripemd160 = RIPEMD160, RIPEMD160.blockSize = 512, RIPEMD160.outSize = 160, RIPEMD160.hmacStrength = 192, RIPEMD160.padLength = 64, RIPEMD160.prototype._update = function(msg, start) {\n for (var A = this.h[0], B = this.h[1], C = this.h[2], D = this.h[3], E = this.h[4], Ah = A, Bh = B, Ch = C, Dh = D, Eh = E, j = 0;j < 80; j++) {\n var T = sum32(rotl32(sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), s[j]), E);\n A = E, E = D, D = rotl32(C, 10), C = B, B = T, T = sum32(rotl32(sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), sh[j]), Eh), Ah = Eh, Eh = Dh, Dh = rotl32(Ch, 10), Ch = Bh, Bh = T;\n }\n T = sum32_3(this.h[1], C, Dh), this.h[1] = sum32_3(this.h[2], D, Eh), this.h[2] = sum32_3(this.h[3], E, Ah), this.h[3] = sum32_3(this.h[4], A, Bh), this.h[4] = sum32_3(this.h[0], B, Ch), this.h[0] = T;\n }, RIPEMD160.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"little\") : utils.split32(this.h, \"little\");\n };\n function f(j, x, y, z) {\n return j <= 15 \? x ^ y ^ z : j <= 31 \? x & y | ~x & z : j <= 47 \? (x | ~y) ^ z : j <= 63 \? x & z | y & ~z : x ^ (y | ~z);\n }\n function K(j) {\n return j <= 15 \? 0 : j <= 31 \? 1518500249 : j <= 47 \? 1859775393 : j <= 63 \? 2400959708 : 2840853838;\n }\n function Kh(j) {\n return j <= 15 \? 1352829926 : j <= 31 \? 1548603684 : j <= 47 \? 1836072691 : j <= 63 \? 2053994217 : 0;\n }\n var r = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 7,\n 4,\n 13,\n 1,\n 10,\n 6,\n 15,\n 3,\n 12,\n 0,\n 9,\n 5,\n 2,\n 14,\n 11,\n 8,\n 3,\n 10,\n 14,\n 4,\n 9,\n 15,\n 8,\n 1,\n 2,\n 7,\n 0,\n 6,\n 13,\n 11,\n 5,\n 12,\n 1,\n 9,\n 11,\n 10,\n 0,\n 8,\n 12,\n 4,\n 13,\n 3,\n 7,\n 15,\n 14,\n 5,\n 6,\n 2,\n 4,\n 0,\n 5,\n 9,\n 7,\n 12,\n 2,\n 10,\n 14,\n 1,\n 3,\n 8,\n 11,\n 6,\n 15,\n 13\n ], rh = [\n 5,\n 14,\n 7,\n 0,\n 9,\n 2,\n 11,\n 4,\n 13,\n 6,\n 15,\n 8,\n 1,\n 10,\n 3,\n 12,\n 6,\n 11,\n 3,\n 7,\n 0,\n 13,\n 5,\n 10,\n 14,\n 15,\n 8,\n 12,\n 4,\n 9,\n 1,\n 2,\n 15,\n 5,\n 1,\n 3,\n 7,\n 14,\n 6,\n 9,\n 11,\n 8,\n 12,\n 2,\n 10,\n 0,\n 4,\n 13,\n 8,\n 6,\n 4,\n 1,\n 3,\n 11,\n 15,\n 0,\n 5,\n 12,\n 2,\n 13,\n 9,\n 7,\n 10,\n 14,\n 12,\n 15,\n 10,\n 4,\n 1,\n 5,\n 8,\n 7,\n 6,\n 2,\n 13,\n 14,\n 0,\n 3,\n 9,\n 11\n ], s = [\n 11,\n 14,\n 15,\n 12,\n 5,\n 8,\n 7,\n 9,\n 11,\n 13,\n 14,\n 15,\n 6,\n 7,\n 9,\n 8,\n 7,\n 6,\n 8,\n 13,\n 11,\n 9,\n 7,\n 15,\n 7,\n 12,\n 15,\n 9,\n 11,\n 7,\n 13,\n 12,\n 11,\n 13,\n 6,\n 7,\n 14,\n 9,\n 13,\n 15,\n 14,\n 8,\n 13,\n 6,\n 5,\n 12,\n 7,\n 5,\n 11,\n 12,\n 14,\n 15,\n 14,\n 15,\n 9,\n 8,\n 9,\n 14,\n 5,\n 6,\n 8,\n 6,\n 5,\n 12,\n 9,\n 15,\n 5,\n 11,\n 6,\n 8,\n 13,\n 12,\n 5,\n 12,\n 13,\n 14,\n 11,\n 8,\n 5,\n 6\n ], sh = [\n 8,\n 9,\n 9,\n 11,\n 13,\n 15,\n 15,\n 5,\n 7,\n 7,\n 8,\n 11,\n 14,\n 14,\n 12,\n 6,\n 9,\n 13,\n 15,\n 7,\n 12,\n 8,\n 9,\n 11,\n 7,\n 7,\n 12,\n 7,\n 6,\n 15,\n 13,\n 11,\n 9,\n 7,\n 15,\n 11,\n 8,\n 6,\n 6,\n 14,\n 12,\n 13,\n 5,\n 14,\n 13,\n 13,\n 7,\n 5,\n 15,\n 5,\n 8,\n 11,\n 14,\n 14,\n 6,\n 14,\n 6,\n 9,\n 12,\n 9,\n 12,\n 5,\n 15,\n 8,\n 8,\n 5,\n 12,\n 9,\n 12,\n 5,\n 14,\n 6,\n 8,\n 13,\n 6,\n 5,\n 15,\n 13,\n 11,\n 11\n ];\n }\n}), require_hmac = __commonJS({\n \"node_modules/hash.js/lib/hash/hmac.js\"(exports, module) {\n var utils = require_utils4(), assert = require_minimalistic_assert();\n function Hmac(hash, key2, enc) {\n if (key2 = exportIfKeyObject(key2), !(this instanceof Hmac))\n return new Hmac(hash, key2, enc);\n this.Hash = hash, this.blockSize = hash.blockSize / 8, this.outSize = hash.outSize / 8, this.inner = null, this.outer = null, this._init(utils.toArray(key2, enc));\n }\n Hmac.prototype = {}, module.exports = Hmac, Hmac.prototype._init = function(key2) {\n key2.length > this.blockSize && (key2 = new this.Hash().update(key2).digest()), assert(key2.length <= this.blockSize);\n for (var i = key2.length;i < this.blockSize; i++)\n key2.push(0);\n for (i = 0;i < key2.length; i++)\n key2[i] ^= 54;\n for (this.inner = new this.Hash().update(key2), i = 0;i < key2.length; i++)\n key2[i] ^= 106;\n this.outer = new this.Hash().update(key2);\n }, Hmac.prototype.update = function(msg, enc) {\n return this.inner.update(msg, enc), this;\n }, Hmac.prototype.digest = function(enc) {\n return this.outer.update(this.inner.digest()), this.outer.digest(enc);\n };\n }\n}), require_hash2 = __commonJS({\n \"node_modules/hash.js/lib/hash.js\"(exports) {\n var hash = exports;\n hash.utils = require_utils4(), hash.common = require_common(), hash.sha = require_sha3(), hash.ripemd = require_ripemd(), hash.hmac = require_hmac(), hash.sha1 = hash.sha.sha1, hash.sha256 = hash.sha.sha256, hash.sha224 = hash.sha.sha224, hash.sha384 = hash.sha.sha384, hash.sha512 = hash.sha.sha512, hash.ripemd160 = hash.ripemd.ripemd160;\n }\n}), require_secp256k1 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js\"(exports, module) {\n module.exports = {\n doubles: {\n step: 4,\n points: [\n [\n \"e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a\",\n \"f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821\"\n ],\n [\n \"8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508\",\n \"11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf\"\n ],\n [\n \"175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739\",\n \"d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695\"\n ],\n [\n \"363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640\",\n \"4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9\"\n ],\n [\n \"8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c\",\n \"4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36\"\n ],\n [\n \"723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda\",\n \"96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f\"\n ],\n [\n \"eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa\",\n \"5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999\"\n ],\n [\n \"100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0\",\n \"cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09\"\n ],\n [\n \"e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d\",\n \"9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d\"\n ],\n [\n \"feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d\",\n \"e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088\"\n ],\n [\n \"da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1\",\n \"9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d\"\n ],\n [\n \"53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0\",\n \"5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8\"\n ],\n [\n \"8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047\",\n \"10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a\"\n ],\n [\n \"385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862\",\n \"283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453\"\n ],\n [\n \"6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7\",\n \"7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160\"\n ],\n [\n \"3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd\",\n \"56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0\"\n ],\n [\n \"85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83\",\n \"7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6\"\n ],\n [\n \"948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a\",\n \"53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589\"\n ],\n [\n \"6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8\",\n \"bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17\"\n ],\n [\n \"e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d\",\n \"4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda\"\n ],\n [\n \"e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725\",\n \"7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd\"\n ],\n [\n \"213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754\",\n \"4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2\"\n ],\n [\n \"4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c\",\n \"17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6\"\n ],\n [\n \"fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6\",\n \"6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f\"\n ],\n [\n \"76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39\",\n \"c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01\"\n ],\n [\n \"c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891\",\n \"893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3\"\n ],\n [\n \"d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b\",\n \"febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f\"\n ],\n [\n \"b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03\",\n \"2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7\"\n ],\n [\n \"e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d\",\n \"eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78\"\n ],\n [\n \"a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070\",\n \"7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1\"\n ],\n [\n \"90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4\",\n \"e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150\"\n ],\n [\n \"8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da\",\n \"662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82\"\n ],\n [\n \"e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11\",\n \"1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc\"\n ],\n [\n \"8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e\",\n \"efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b\"\n ],\n [\n \"e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41\",\n \"2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51\"\n ],\n [\n \"b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef\",\n \"67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45\"\n ],\n [\n \"d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8\",\n \"db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120\"\n ],\n [\n \"324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d\",\n \"648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84\"\n ],\n [\n \"4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96\",\n \"35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d\"\n ],\n [\n \"9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd\",\n \"ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d\"\n ],\n [\n \"6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5\",\n \"9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8\"\n ],\n [\n \"a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266\",\n \"40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8\"\n ],\n [\n \"7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71\",\n \"34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac\"\n ],\n [\n \"928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac\",\n \"c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f\"\n ],\n [\n \"85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751\",\n \"1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962\"\n ],\n [\n \"ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e\",\n \"493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907\"\n ],\n [\n \"827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241\",\n \"c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec\"\n ],\n [\n \"eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3\",\n \"be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d\"\n ],\n [\n \"e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f\",\n \"4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414\"\n ],\n [\n \"1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19\",\n \"aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd\"\n ],\n [\n \"146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be\",\n \"b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0\"\n ],\n [\n \"fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9\",\n \"6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811\"\n ],\n [\n \"da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2\",\n \"8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1\"\n ],\n [\n \"a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13\",\n \"7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c\"\n ],\n [\n \"174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c\",\n \"ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73\"\n ],\n [\n \"959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba\",\n \"2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd\"\n ],\n [\n \"d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151\",\n \"e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405\"\n ],\n [\n \"64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073\",\n \"d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589\"\n ],\n [\n \"8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458\",\n \"38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e\"\n ],\n [\n \"13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b\",\n \"69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27\"\n ],\n [\n \"bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366\",\n \"d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1\"\n ],\n [\n \"8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa\",\n \"40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482\"\n ],\n [\n \"8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0\",\n \"620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945\"\n ],\n [\n \"dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787\",\n \"7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573\"\n ],\n [\n \"f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e\",\n \"ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82\"\n ]\n ]\n },\n naf: {\n wnd: 7,\n points: [\n [\n \"f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9\",\n \"388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672\"\n ],\n [\n \"2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4\",\n \"d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6\"\n ],\n [\n \"5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc\",\n \"6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da\"\n ],\n [\n \"acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe\",\n \"cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37\"\n ],\n [\n \"774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb\",\n \"d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b\"\n ],\n [\n \"f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8\",\n \"ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81\"\n ],\n [\n \"d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e\",\n \"581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58\"\n ],\n [\n \"defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34\",\n \"4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77\"\n ],\n [\n \"2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c\",\n \"85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a\"\n ],\n [\n \"352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5\",\n \"321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c\"\n ],\n [\n \"2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f\",\n \"2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67\"\n ],\n [\n \"9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714\",\n \"73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402\"\n ],\n [\n \"daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729\",\n \"a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55\"\n ],\n [\n \"c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db\",\n \"2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482\"\n ],\n [\n \"6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4\",\n \"e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82\"\n ],\n [\n \"1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5\",\n \"b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396\"\n ],\n [\n \"605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479\",\n \"2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49\"\n ],\n [\n \"62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d\",\n \"80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf\"\n ],\n [\n \"80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f\",\n \"1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a\"\n ],\n [\n \"7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb\",\n \"d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7\"\n ],\n [\n \"d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9\",\n \"eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933\"\n ],\n [\n \"49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963\",\n \"758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a\"\n ],\n [\n \"77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74\",\n \"958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6\"\n ],\n [\n \"f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530\",\n \"e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37\"\n ],\n [\n \"463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b\",\n \"5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e\"\n ],\n [\n \"f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247\",\n \"cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6\"\n ],\n [\n \"caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1\",\n \"cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476\"\n ],\n [\n \"2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120\",\n \"4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40\"\n ],\n [\n \"7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435\",\n \"91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61\"\n ],\n [\n \"754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18\",\n \"673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683\"\n ],\n [\n \"e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8\",\n \"59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5\"\n ],\n [\n \"186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb\",\n \"3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b\"\n ],\n [\n \"df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f\",\n \"55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417\"\n ],\n [\n \"5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143\",\n \"efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868\"\n ],\n [\n \"290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba\",\n \"e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a\"\n ],\n [\n \"af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45\",\n \"f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6\"\n ],\n [\n \"766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a\",\n \"744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996\"\n ],\n [\n \"59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e\",\n \"c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e\"\n ],\n [\n \"f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8\",\n \"e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d\"\n ],\n [\n \"7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c\",\n \"30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2\"\n ],\n [\n \"948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519\",\n \"e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e\"\n ],\n [\n \"7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab\",\n \"100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437\"\n ],\n [\n \"3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca\",\n \"ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311\"\n ],\n [\n \"d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf\",\n \"8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4\"\n ],\n [\n \"1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610\",\n \"68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575\"\n ],\n [\n \"733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4\",\n \"f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d\"\n ],\n [\n \"15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c\",\n \"d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d\"\n ],\n [\n \"a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940\",\n \"edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629\"\n ],\n [\n \"e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980\",\n \"a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06\"\n ],\n [\n \"311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3\",\n \"66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374\"\n ],\n [\n \"34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf\",\n \"9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee\"\n ],\n [\n \"f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63\",\n \"4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1\"\n ],\n [\n \"d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448\",\n \"fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b\"\n ],\n [\n \"32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf\",\n \"5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661\"\n ],\n [\n \"7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5\",\n \"8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6\"\n ],\n [\n \"ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6\",\n \"8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e\"\n ],\n [\n \"16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5\",\n \"5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d\"\n ],\n [\n \"eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99\",\n \"f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc\"\n ],\n [\n \"78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51\",\n \"f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4\"\n ],\n [\n \"494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5\",\n \"42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c\"\n ],\n [\n \"a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5\",\n \"204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b\"\n ],\n [\n \"c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997\",\n \"4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913\"\n ],\n [\n \"841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881\",\n \"73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154\"\n ],\n [\n \"5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5\",\n \"39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865\"\n ],\n [\n \"36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66\",\n \"d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc\"\n ],\n [\n \"336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726\",\n \"ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224\"\n ],\n [\n \"8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede\",\n \"6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e\"\n ],\n [\n \"1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94\",\n \"60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6\"\n ],\n [\n \"85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31\",\n \"3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511\"\n ],\n [\n \"29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51\",\n \"b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b\"\n ],\n [\n \"a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252\",\n \"ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2\"\n ],\n [\n \"4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5\",\n \"cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c\"\n ],\n [\n \"d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b\",\n \"6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3\"\n ],\n [\n \"ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4\",\n \"322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d\"\n ],\n [\n \"af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f\",\n \"6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700\"\n ],\n [\n \"e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889\",\n \"2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4\"\n ],\n [\n \"591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246\",\n \"b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196\"\n ],\n [\n \"11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984\",\n \"998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4\"\n ],\n [\n \"3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a\",\n \"b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257\"\n ],\n [\n \"cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030\",\n \"bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13\"\n ],\n [\n \"c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197\",\n \"6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096\"\n ],\n [\n \"c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593\",\n \"c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38\"\n ],\n [\n \"a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef\",\n \"21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f\"\n ],\n [\n \"347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38\",\n \"60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448\"\n ],\n [\n \"da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a\",\n \"49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a\"\n ],\n [\n \"c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111\",\n \"5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4\"\n ],\n [\n \"4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502\",\n \"7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437\"\n ],\n [\n \"3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea\",\n \"be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7\"\n ],\n [\n \"cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26\",\n \"8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d\"\n ],\n [\n \"b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986\",\n \"39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a\"\n ],\n [\n \"d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e\",\n \"62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54\"\n ],\n [\n \"48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4\",\n \"25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77\"\n ],\n [\n \"dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda\",\n \"ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517\"\n ],\n [\n \"6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859\",\n \"cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10\"\n ],\n [\n \"e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f\",\n \"f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125\"\n ],\n [\n \"eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c\",\n \"6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e\"\n ],\n [\n \"13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942\",\n \"fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1\"\n ],\n [\n \"ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a\",\n \"1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2\"\n ],\n [\n \"b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80\",\n \"5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423\"\n ],\n [\n \"ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d\",\n \"438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8\"\n ],\n [\n \"8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1\",\n \"cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758\"\n ],\n [\n \"52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63\",\n \"c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375\"\n ],\n [\n \"e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352\",\n \"6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d\"\n ],\n [\n \"7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193\",\n \"ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec\"\n ],\n [\n \"5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00\",\n \"9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0\"\n ],\n [\n \"32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58\",\n \"ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c\"\n ],\n [\n \"e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7\",\n \"d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4\"\n ],\n [\n \"8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8\",\n \"c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f\"\n ],\n [\n \"4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e\",\n \"67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649\"\n ],\n [\n \"3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d\",\n \"cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826\"\n ],\n [\n \"674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b\",\n \"299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5\"\n ],\n [\n \"d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f\",\n \"f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87\"\n ],\n [\n \"30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6\",\n \"462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b\"\n ],\n [\n \"be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297\",\n \"62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc\"\n ],\n [\n \"93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a\",\n \"7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c\"\n ],\n [\n \"b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c\",\n \"ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f\"\n ],\n [\n \"d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52\",\n \"4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a\"\n ],\n [\n \"d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb\",\n \"bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46\"\n ],\n [\n \"463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065\",\n \"bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f\"\n ],\n [\n \"7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917\",\n \"603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03\"\n ],\n [\n \"74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9\",\n \"cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08\"\n ],\n [\n \"30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3\",\n \"553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8\"\n ],\n [\n \"9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57\",\n \"712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373\"\n ],\n [\n \"176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66\",\n \"ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3\"\n ],\n [\n \"75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8\",\n \"9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8\"\n ],\n [\n \"809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721\",\n \"9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1\"\n ],\n [\n \"1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180\",\n \"4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9\"\n ]\n ]\n }\n };\n }\n}), require_curves = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curves.js\"(exports) {\n var curves = exports, hash = require_hash2(), curve = require_curve(), utils = require_utils3(), assert = utils.assert;\n function PresetCurve(options) {\n options.type === \"short\" \? this.curve = new curve.short(options) : options.type === \"edwards\" \? this.curve = new curve.edwards(options) : this.curve = new curve.mont(options), this.g = this.curve.g, this.n = this.curve.n, this.hash = options.hash, assert(this.g.validate(), \"Invalid curve\"), assert(this.g.mul(this.n).isInfinity(), \"Invalid curve, G*N != O\");\n }\n PresetCurve.prototype = {}, curves.PresetCurve = PresetCurve;\n function defineCurve(name, options) {\n Object.defineProperty(curves, name, {\n configurable: !0,\n enumerable: !0,\n get: function() {\n var curve2 = new PresetCurve(options);\n return Object.defineProperty(curves, name, {\n configurable: !0,\n enumerable: !0,\n value: curve2\n }), curve2;\n }\n });\n }\n defineCurve(\"p192\", {\n type: \"short\",\n prime: \"p192\",\n p: \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\",\n a: \"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc\",\n b: \"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1\",\n n: \"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012\",\n \"07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811\"\n ]\n }), defineCurve(\"p224\", {\n type: \"short\",\n prime: \"p224\",\n p: \"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\",\n a: \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe\",\n b: \"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4\",\n n: \"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21\",\n \"bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34\"\n ]\n }), defineCurve(\"p256\", {\n type: \"short\",\n prime: null,\n p: \"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff\",\n a: \"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc\",\n b: \"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b\",\n n: \"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296\",\n \"4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5\"\n ]\n }), defineCurve(\"p384\", {\n type: \"short\",\n prime: null,\n p: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff\",\n a: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc\",\n b: \"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef\",\n n: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973\",\n hash: hash.sha384,\n gRed: !1,\n g: [\n \"aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7\",\n \"3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f\"\n ]\n }), defineCurve(\"p521\", {\n type: \"short\",\n prime: null,\n p: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff\",\n a: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc\",\n b: \"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00\",\n n: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409\",\n hash: hash.sha512,\n gRed: !1,\n g: [\n \"000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66\",\n \"00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650\"\n ]\n }), defineCurve(\"curve25519\", {\n type: \"mont\",\n prime: \"p25519\",\n p: \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",\n a: \"76d06\",\n b: \"1\",\n n: \"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",\n hash: hash.sha256,\n gRed: !1,\n g: [\"9\"]\n }), defineCurve(\"ed25519\", {\n type: \"edwards\",\n prime: \"p25519\",\n p: \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",\n a: \"-1\",\n c: \"1\",\n d: \"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3\",\n n: \"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a\",\n \"6666666666666666666666666666666666666666666666666666666666666658\"\n ]\n });\n var pre;\n try {\n pre = require_secp256k1();\n } catch {\n pre = void 0;\n }\n defineCurve(\"secp256k1\", {\n type: \"short\",\n prime: \"k256\",\n p: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\",\n a: \"0\",\n b: \"7\",\n n: \"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141\",\n h: \"1\",\n hash: hash.sha256,\n beta: \"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\",\n lambda: \"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72\",\n basis: [\n {\n a: \"3086d221a7d46bcde86c90e49284eb15\",\n b: \"-e4437ed6010e88286f547fa90abfe4c3\"\n },\n {\n a: \"114ca50f7a8e2f3f657c1108d9d44cfd8\",\n b: \"3086d221a7d46bcde86c90e49284eb15\"\n }\n ],\n gRed: !1,\n g: [\n \"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\",\n \"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n pre\n ]\n });\n }\n}), require_hmac_drbg = __commonJS({\n \"node_modules/hmac-drbg/lib/hmac-drbg.js\"(exports, module) {\n var hash = require_hash2(), utils = require_utils2(), assert = require_minimalistic_assert();\n function HmacDRBG(options) {\n if (!(this instanceof HmacDRBG))\n return new HmacDRBG(options);\n this.hash = options.hash, this.predResist = !!options.predResist, this.outLen = this.hash.outSize, this.minEntropy = options.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null;\n var entropy = utils.toArray(options.entropy, options.entropyEnc || \"hex\"), nonce = utils.toArray(options.nonce, options.nonceEnc || \"hex\"), pers = utils.toArray(options.pers, options.persEnc || \"hex\");\n assert(entropy.length >= this.minEntropy / 8, \"Not enough entropy. Minimum is: \" + this.minEntropy + \" bits\"), this._init(entropy, nonce, pers);\n }\n HmacDRBG.prototype = {}, module.exports = HmacDRBG, HmacDRBG.prototype._init = function(entropy, nonce, pers) {\n var seed = entropy.concat(nonce).concat(pers);\n this.K = new @Array(this.outLen / 8), this.V = new @Array(this.outLen / 8);\n for (var i = 0;i < this.V.length; i++)\n this.K[i] = 0, this.V[i] = 1;\n this._update(seed), this._reseed = 1, this.reseedInterval = 281474976710656;\n }, HmacDRBG.prototype._hmac = function() {\n return new hash.hmac(this.hash, this.K);\n }, HmacDRBG.prototype._update = function(seed) {\n var kmac = this._hmac().update(this.V).update([0]);\n seed && (kmac = kmac.update(seed)), this.K = kmac.digest(), this.V = this._hmac().update(this.V).digest(), seed && (this.K = this._hmac().update(this.V).update([1]).update(seed).digest(), this.V = this._hmac().update(this.V).digest());\n }, HmacDRBG.prototype.reseed = function(entropy, entropyEnc, add, addEnc) {\n typeof entropyEnc != \"string\" && (addEnc = add, add = entropyEnc, entropyEnc = null), entropy = utils.toArray(entropy, entropyEnc), add = utils.toArray(add, addEnc), assert(entropy.length >= this.minEntropy / 8, \"Not enough entropy. Minimum is: \" + this.minEntropy + \" bits\"), this._update(entropy.concat(add || [])), this._reseed = 1;\n }, HmacDRBG.prototype.generate = function(len, enc, add, addEnc) {\n if (this._reseed > this.reseedInterval)\n throw new Error(\"Reseed is required\");\n typeof enc != \"string\" && (addEnc = add, add = enc, enc = null), add && (add = utils.toArray(add, addEnc || \"hex\"), this._update(add));\n for (var temp = [];temp.length < len; )\n this.V = this._hmac().update(this.V).digest(), temp = temp.concat(this.V);\n var res = temp.slice(0, len);\n return this._update(add), this._reseed++, utils.encode(res, enc);\n };\n }\n}), require_key = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/key.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert;\n function KeyPair(ec, options) {\n this.ec = ec, this.priv = null, this.pub = null, options.priv && this._importPrivate(options.priv, options.privEnc), options.pub && this._importPublic(options.pub, options.pubEnc);\n }\n KeyPair.prototype = {}, module.exports = KeyPair, KeyPair.fromPublic = function(ec, pub, enc) {\n return pub instanceof KeyPair \? pub : new KeyPair(ec, {\n pub,\n pubEnc: enc\n });\n }, KeyPair.fromPrivate = function(ec, priv, enc) {\n return priv instanceof KeyPair \? priv : new KeyPair(ec, {\n priv,\n privEnc: enc\n });\n }, KeyPair.prototype.validate = function() {\n var pub = this.getPublic();\n return pub.isInfinity() \? { result: !1, reason: \"Invalid public key\" } : pub.validate() \? pub.mul(this.ec.curve.n).isInfinity() \? { result: !0, reason: null } : { result: !1, reason: \"Public key * N != O\" } : { result: !1, reason: \"Public key is not a point\" };\n }, KeyPair.prototype.getPublic = function(compact, enc) {\n return typeof compact == \"string\" && (enc = compact, compact = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), enc \? this.pub.encode(enc, compact) : this.pub;\n }, KeyPair.prototype.getPrivate = function(enc) {\n return enc === \"hex\" \? this.priv.toString(16, 2) : this.priv;\n }, KeyPair.prototype._importPrivate = function(key2, enc) {\n this.priv = new BN(key2, enc || 16), this.priv = this.priv.umod(this.ec.curve.n);\n }, KeyPair.prototype._importPublic = function(key2, enc) {\n if (key2.x || key2.y) {\n this.ec.curve.type === \"mont\" \? assert(key2.x, \"Need x coordinate\") : (this.ec.curve.type === \"short\" || this.ec.curve.type === \"edwards\") && assert(key2.x && key2.y, \"Need both x and y coordinate\"), this.pub = this.ec.curve.point(key2.x, key2.y);\n return;\n }\n this.pub = this.ec.curve.decodePoint(key2, enc);\n }, KeyPair.prototype.derive = function(pub) {\n return pub.validate() || assert(pub.validate(), \"public point not validated\"), pub.mul(this.priv).getX();\n }, KeyPair.prototype.sign = function(msg, enc, options) {\n return this.ec.sign(msg, this, enc, options);\n }, KeyPair.prototype.verify = function(msg, signature) {\n return this.ec.verify(msg, signature, this);\n }, KeyPair.prototype.inspect = function() {\n return \"<Key priv: \" + (this.priv && this.priv.toString(16, 2)) + \" pub: \" + (this.pub && this.pub.inspect()) + \" >\";\n };\n }\n}), require_signature = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/signature.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert;\n function Signature(options, enc) {\n if (options instanceof Signature)\n return options;\n this._importDER(options, enc) || (assert(options.r && options.s, \"Signature without r or s\"), this.r = new BN(options.r, 16), this.s = new BN(options.s, 16), options.recoveryParam === void 0 \? this.recoveryParam = null : this.recoveryParam = options.recoveryParam);\n }\n Signature.prototype = {}, module.exports = Signature;\n function Position() {\n this.place = 0;\n }\n function getLength(buf, p) {\n var initial = buf[p.place++];\n if (!(initial & 128))\n return initial;\n var octetLen = initial & 15;\n if (octetLen === 0 || octetLen > 4)\n return !1;\n for (var val = 0, i = 0, off = p.place;i < octetLen; i++, off++)\n val <<= 8, val |= buf[off], val >>>= 0;\n return val <= 127 \? !1 : (p.place = off, val);\n }\n function rmPadding(buf) {\n for (var i = 0, len = buf.length - 1;!buf[i] && !(buf[i + 1] & 128) && i < len; )\n i++;\n return i === 0 \? buf : buf.slice(i);\n }\n Signature.prototype._importDER = function(data, enc) {\n data = utils.toArray(data, enc);\n var p = new Position;\n if (data[p.place++] !== 48)\n return !1;\n var len = getLength(data, p);\n if (len === !1 || len + p.place !== data.length || data[p.place++] !== 2)\n return !1;\n var rlen = getLength(data, p);\n if (rlen === !1)\n return !1;\n var r = data.slice(p.place, rlen + p.place);\n if (p.place += rlen, data[p.place++] !== 2)\n return !1;\n var slen = getLength(data, p);\n if (slen === !1 || data.length !== slen + p.place)\n return !1;\n var s = data.slice(p.place, slen + p.place);\n if (r[0] === 0)\n if (r[1] & 128)\n r = r.slice(1);\n else\n return !1;\n if (s[0] === 0)\n if (s[1] & 128)\n s = s.slice(1);\n else\n return !1;\n return this.r = new BN(r), this.s = new BN(s), this.recoveryParam = null, !0;\n };\n function constructLength(arr, len) {\n if (len < 128) {\n arr.push(len);\n return;\n }\n var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n for (arr.push(octets | 128);--octets; )\n arr.push(len >>> (octets << 3) & 255);\n arr.push(len);\n }\n Signature.prototype.toDER = function(enc) {\n var r = this.r.toArray(), s = this.s.toArray();\n for (r[0] & 128 && (r = [0].concat(r)), s[0] & 128 && (s = [0].concat(s)), r = rmPadding(r), s = rmPadding(s);!s[0] && !(s[1] & 128); )\n s = s.slice(1);\n var arr = [2];\n constructLength(arr, r.length), arr = arr.concat(r), arr.push(2), constructLength(arr, s.length);\n var backHalf = arr.concat(s), res = [48];\n return constructLength(res, backHalf.length), res = res.concat(backHalf), utils.encode(res, enc);\n };\n }\n}), require_ec = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/index.js\"(exports, module) {\n var BN = require_bn4(), HmacDRBG = require_hmac_drbg(), utils = require_utils3(), curves = require_curves(), rand = require_brorand(), assert = utils.assert, KeyPair = require_key(), Signature = require_signature();\n function EC(options) {\n if (!(this instanceof EC))\n return new EC(options);\n typeof options == \"string\" && (assert(Object.prototype.hasOwnProperty.@call(curves, options), \"Unknown curve \" + options), options = curves[options]), options instanceof curves.PresetCurve && (options = { curve: options }), this.curve = options.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = options.curve.g, this.g.precompute(options.curve.n.bitLength() + 1), this.hash = options.hash || options.curve.hash;\n }\n EC.prototype = {}, module.exports = EC, EC.prototype.keyPair = function(options) {\n return new KeyPair(this, options);\n }, EC.prototype.keyFromPrivate = function(priv, enc) {\n return KeyPair.fromPrivate(this, priv, enc);\n }, EC.prototype.keyFromPublic = function(pub, enc) {\n return KeyPair.fromPublic(this, pub, enc);\n }, EC.prototype.genKeyPair = function(options) {\n options || (options = {});\n for (var drbg = new HmacDRBG({\n hash: this.hash,\n pers: options.pers,\n persEnc: options.persEnc || \"utf8\",\n entropy: options.entropy || rand(this.hash.hmacStrength),\n entropyEnc: options.entropy && options.entropyEnc || \"utf8\",\n nonce: this.n.toArray()\n }), bytes = this.n.byteLength(), ns2 = this.n.sub(new BN(2));; ) {\n var priv = new BN(drbg.generate(bytes));\n if (!(priv.cmp(ns2) > 0))\n return priv.iaddn(1), this.keyFromPrivate(priv);\n }\n }, EC.prototype._truncateToN = function(msg, truncOnly) {\n var delta = msg.byteLength() * 8 - this.n.bitLength();\n return delta > 0 && (msg = msg.ushrn(delta)), !truncOnly && msg.cmp(this.n) >= 0 \? msg.sub(this.n) : msg;\n }, EC.prototype.sign = function(msg, key2, enc, options) {\n typeof enc == \"object\" && (options = enc, enc = null), options || (options = {}), key2 = this.keyFromPrivate(key2, enc), msg = this._truncateToN(new BN(msg, 16));\n for (var bytes = this.n.byteLength(), bkey = key2.getPrivate().toArray(\"be\", bytes), nonce = msg.toArray(\"be\", bytes), drbg = new HmacDRBG({\n hash: this.hash,\n entropy: bkey,\n nonce,\n pers: options.pers,\n persEnc: options.persEnc || \"utf8\"\n }), ns1 = this.n.sub(new BN(1)), iter = 0;; iter++) {\n var k = options.k \? options.k(iter) : new BN(drbg.generate(this.n.byteLength()));\n if (k = this._truncateToN(k, !0), !(k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)) {\n var kp = this.g.mul(k);\n if (!kp.isInfinity()) {\n var kpX = kp.getX(), r = kpX.umod(this.n);\n if (r.cmpn(0) !== 0) {\n var s = k.invm(this.n).mul(r.mul(key2.getPrivate()).iadd(msg));\n if (s = s.umod(this.n), s.cmpn(0) !== 0) {\n var recoveryParam = (kp.getY().isOdd() \? 1 : 0) | (kpX.cmp(r) !== 0 \? 2 : 0);\n return options.canonical && s.cmp(this.nh) > 0 && (s = this.n.sub(s), recoveryParam ^= 1), new Signature({ r, s, recoveryParam });\n }\n }\n }\n }\n }\n }, EC.prototype.verify = function(msg, signature, key2, enc) {\n msg = this._truncateToN(new BN(msg, 16)), key2 = this.keyFromPublic(key2, enc), signature = new Signature(signature, \"hex\");\n var { r, s } = signature;\n if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0 || s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n return !1;\n var sinv = s.invm(this.n), u1 = sinv.mul(msg).umod(this.n), u2 = sinv.mul(r).umod(this.n), p;\n return this.curve._maxwellTrick \? (p = this.g.jmulAdd(u1, key2.getPublic(), u2), p.isInfinity() \? !1 : p.eqXToP(r)) : (p = this.g.mulAdd(u1, key2.getPublic(), u2), p.isInfinity() \? !1 : p.getX().umod(this.n).cmp(r) === 0);\n }, EC.prototype.recoverPubKey = function(msg, signature, j, enc) {\n assert((3 & j) === j, \"The recovery param is more than two bits\"), signature = new Signature(signature, enc);\n var n = this.n, e = new BN(msg), r = signature.r, s = signature.s, isYOdd = j & 1, isSecondKey = j >> 1;\n if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n throw new Error(\"Unable to find sencond key candinate\");\n isSecondKey \? r = this.curve.pointFromX(r.add(this.curve.n), isYOdd) : r = this.curve.pointFromX(r, isYOdd);\n var rInv = signature.r.invm(n), s1 = n.sub(e).mul(rInv).umod(n), s2 = s.mul(rInv).umod(n);\n return this.g.mulAdd(s1, r, s2);\n }, EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {\n if (signature = new Signature(signature, enc), signature.recoveryParam !== null)\n return signature.recoveryParam;\n for (var i = 0;i < 4; i++) {\n var Qprime;\n try {\n Qprime = this.recoverPubKey(e, signature, i);\n } catch {\n continue;\n }\n if (Qprime.eq(Q))\n return i;\n }\n throw new Error(\"Unable to find valid recovery factor\");\n };\n }\n}), require_key2 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/key.js\"(exports, module) {\n var utils = require_utils3(), assert = utils.assert, parseBytes = utils.parseBytes, cachedProperty = utils.cachedProperty;\n function KeyPair(eddsa, params) {\n this.eddsa = eddsa, this._secret = parseBytes(params.secret), eddsa.isPoint(params.pub) \? this._pub = params.pub : this._pubBytes = parseBytes(params.pub);\n }\n KeyPair.prototype = {}, KeyPair.fromPublic = function(eddsa, pub) {\n return pub instanceof KeyPair \? pub : new KeyPair(eddsa, { pub });\n }, KeyPair.fromSecret = function(eddsa, secret) {\n return secret instanceof KeyPair \? secret : new KeyPair(eddsa, { secret });\n }, KeyPair.prototype.secret = function() {\n return this._secret;\n }, cachedProperty(KeyPair, \"pubBytes\", function() {\n return this.eddsa.encodePoint(this.pub());\n }), cachedProperty(KeyPair, \"pub\", function() {\n return this._pubBytes \? this.eddsa.decodePoint(this._pubBytes) : this.eddsa.g.mul(this.priv());\n }), cachedProperty(KeyPair, \"privBytes\", function() {\n var eddsa = this.eddsa, hash = this.hash(), lastIx = eddsa.encodingLength - 1, a = hash.slice(0, eddsa.encodingLength);\n return a[0] &= 248, a[lastIx] &= 127, a[lastIx] |= 64, a;\n }), cachedProperty(KeyPair, \"priv\", function() {\n return this.eddsa.decodeInt(this.privBytes());\n }), cachedProperty(KeyPair, \"hash\", function() {\n return this.eddsa.hash().update(this.secret()).digest();\n }), cachedProperty(KeyPair, \"messagePrefix\", function() {\n return this.hash().slice(this.eddsa.encodingLength);\n }), KeyPair.prototype.sign = function(message) {\n return assert(this._secret, \"KeyPair can only verify\"), this.eddsa.sign(message, this);\n }, KeyPair.prototype.verify = function(message, sig) {\n return this.eddsa.verify(message, sig, this);\n }, KeyPair.prototype.getSecret = function(enc) {\n return assert(this._secret, \"KeyPair is public only\"), utils.encode(this.secret(), enc);\n }, KeyPair.prototype.getPublic = function(enc) {\n return utils.encode(this.pubBytes(), enc);\n }, module.exports = KeyPair;\n }\n}), require_signature2 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/signature.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert, cachedProperty = utils.cachedProperty, parseBytes = utils.parseBytes;\n function Signature(eddsa, sig) {\n this.eddsa = eddsa, typeof sig != \"object\" && (sig = parseBytes(sig)), @Array.isArray(sig) && (sig = {\n R: sig.slice(0, eddsa.encodingLength),\n S: sig.slice(eddsa.encodingLength)\n }), assert(sig.R && sig.S, \"Signature without R or S\"), eddsa.isPoint(sig.R) && (this._R = sig.R), sig.S instanceof BN && (this._S = sig.S), this._Rencoded = @Array.isArray(sig.R) \? sig.R : sig.Rencoded, this._Sencoded = @Array.isArray(sig.S) \? sig.S : sig.Sencoded;\n }\n Signature.prototype = {}, cachedProperty(Signature, \"S\", function() {\n return this.eddsa.decodeInt(this.Sencoded());\n }), cachedProperty(Signature, \"R\", function() {\n return this.eddsa.decodePoint(this.Rencoded());\n }), cachedProperty(Signature, \"Rencoded\", function() {\n return this.eddsa.encodePoint(this.R());\n }), cachedProperty(Signature, \"Sencoded\", function() {\n return this.eddsa.encodeInt(this.S());\n }), Signature.prototype.toBytes = function() {\n return this.Rencoded().concat(this.Sencoded());\n }, Signature.prototype.toHex = function() {\n return utils.encode(this.toBytes(), \"hex\").toUpperCase();\n }, module.exports = Signature;\n }\n}), require_eddsa = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/index.js\"(exports, module) {\n var hash = require_hash2(), curves = require_curves(), utils = require_utils3(), assert = utils.assert, parseBytes = utils.parseBytes, KeyPair = require_key2(), Signature = require_signature2();\n function EDDSA(curve) {\n if (assert(curve === \"ed25519\", \"only tested with ed25519 so far\"), !(this instanceof EDDSA))\n return new EDDSA(curve);\n curve = curves[curve].curve, this.curve = curve, this.g = curve.g, this.g.precompute(curve.n.bitLength() + 1), this.pointClass = curve.point().constructor, this.encodingLength = Math.ceil(curve.n.bitLength() / 8), this.hash = hash.sha512;\n }\n EDDSA.prototype = {}, module.exports = EDDSA, EDDSA.prototype.sign = function(message, secret) {\n message = parseBytes(message);\n var key2 = this.keyFromSecret(secret), r = this.hashInt(key2.messagePrefix(), message), R = this.g.mul(r), Rencoded = this.encodePoint(R), s_ = this.hashInt(Rencoded, key2.pubBytes(), message).mul(key2.priv()), S = r.add(s_).umod(this.curve.n);\n return this.makeSignature({ R, S, Rencoded });\n }, EDDSA.prototype.verify = function(message, sig, pub) {\n message = parseBytes(message), sig = this.makeSignature(sig);\n var key2 = this.keyFromPublic(pub), h = this.hashInt(sig.Rencoded(), key2.pubBytes(), message), SG = this.g.mul(sig.S()), RplusAh = sig.R().add(key2.pub().mul(h));\n return RplusAh.eq(SG);\n }, EDDSA.prototype.hashInt = function() {\n for (var hash2 = this.hash(), i = 0;i < arguments.length; i++)\n hash2.update(arguments[i]);\n return utils.intFromLE(hash2.digest()).umod(this.curve.n);\n }, EDDSA.prototype.keyFromPublic = function(pub) {\n return KeyPair.fromPublic(this, pub);\n }, EDDSA.prototype.keyFromSecret = function(secret) {\n return KeyPair.fromSecret(this, secret);\n }, EDDSA.prototype.makeSignature = function(sig) {\n return sig instanceof Signature \? sig : new Signature(this, sig);\n }, EDDSA.prototype.encodePoint = function(point) {\n var enc = point.getY().toArray(\"le\", this.encodingLength);\n return enc[this.encodingLength - 1] |= point.getX().isOdd() \? 128 : 0, enc;\n }, EDDSA.prototype.decodePoint = function(bytes) {\n bytes = utils.parseBytes(bytes);\n var lastIx = bytes.length - 1, normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & -129), xIsOdd = (bytes[lastIx] & 128) !== 0, y = utils.intFromLE(normed);\n return this.curve.pointFromY(y, xIsOdd);\n }, EDDSA.prototype.encodeInt = function(num) {\n return num.toArray(\"le\", this.encodingLength);\n }, EDDSA.prototype.decodeInt = function(bytes) {\n return utils.intFromLE(bytes);\n }, EDDSA.prototype.isPoint = function(val) {\n return val instanceof this.pointClass;\n };\n }\n}), require_elliptic = __commonJS({\n \"node_modules/elliptic/lib/elliptic.js\"(exports) {\n var elliptic = exports;\n elliptic.version = require_package().version, elliptic.utils = require_utils3(), elliptic.rand = require_brorand(), elliptic.curve = require_curve(), elliptic.curves = require_curves(), elliptic.ec = require_ec(), elliptic.eddsa = require_eddsa();\n }\n}), require_bn5 = require_bn, require_safer = __commonJS({\n \"node_modules/safer-buffer/safer.js\"(exports, module) {\n var buffer = BufferModule, Buffer2 = Buffer, safer = {}, key2;\n for (key2 in buffer)\n !buffer.hasOwnProperty(key2) || key2 === \"SlowBuffer\" || key2 === \"Buffer\" || (safer[key2] = buffer[key2]);\n var Safer = safer.Buffer = {};\n for (key2 in Buffer2)\n !Buffer2.hasOwnProperty(key2) || key2 === \"allocUnsafe\" || key2 === \"allocUnsafeSlow\" || (Safer[key2] = Buffer2[key2]);\n if (safer.Buffer.prototype = Buffer2.prototype, (!Safer.from || Safer.from === @Uint8Array.from) && (Safer.from = function(value, encodingOrOffset, length) {\n if (typeof value == \"number\")\n @throwTypeError('The \"value\" argument must not be of type number. Received type ' + typeof value);\n if (value && typeof value.length > \"u\")\n @throwTypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \" + typeof value);\n return Buffer2(value, encodingOrOffset, length);\n }), Safer.alloc || (Safer.alloc = function(size, fill, encoding) {\n if (typeof size != \"number\")\n @throwTypeError('The \"size\" argument must be of type number. Received type ' + typeof size);\n if (size < 0 || size >= 2 * (1 << 30))\n @throwRangeError('The value \"' + size + '\" is invalid for option \"size\"');\n var buf = Buffer2(size);\n return !fill || fill.length === 0 \? buf.fill(0) : typeof encoding == \"string\" \? buf.fill(fill, encoding) : buf.fill(fill), buf;\n }), !safer.kStringMaxLength)\n try {\n safer.kStringMaxLength = MAX_STRING_LENGTH;\n } catch {\n }\n safer.constants || (safer.constants = {\n MAX_LENGTH: safer.kMaxLength\n }, safer.kStringMaxLength && (safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength)), module.exports = safer;\n }\n}), require_reporter = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/reporter.js\"(exports) {\n var inherits = require_inherits_browser();\n function Reporter(options) {\n this._reporterState = {\n obj: null,\n path: [],\n options: options || {},\n errors: []\n };\n }\n Reporter.prototype = {}, exports.Reporter = Reporter, Reporter.prototype.isError = function(obj) {\n return obj instanceof ReporterError;\n }, Reporter.prototype.save = function() {\n let state = this._reporterState;\n return { obj: state.obj, pathLen: state.path.length };\n }, Reporter.prototype.restore = function(data) {\n let state = this._reporterState;\n state.obj = data.obj, state.path = state.path.slice(0, data.pathLen);\n }, Reporter.prototype.enterKey = function(key2) {\n return this._reporterState.path.push(key2);\n }, Reporter.prototype.exitKey = function(index) {\n let state = this._reporterState;\n state.path = state.path.slice(0, index - 1);\n }, Reporter.prototype.leaveKey = function(index, key2, value) {\n let state = this._reporterState;\n this.exitKey(index), state.obj !== null && (state.obj[key2] = value);\n }, Reporter.prototype.path = function() {\n return this._reporterState.path.join(\"/\");\n }, Reporter.prototype.enterObject = function() {\n let state = this._reporterState, prev = state.obj;\n return state.obj = {}, prev;\n }, Reporter.prototype.leaveObject = function(prev) {\n let state = this._reporterState, now = state.obj;\n return state.obj = prev, now;\n }, Reporter.prototype.error = function(msg) {\n let err, state = this._reporterState, inherited = msg instanceof ReporterError;\n if (inherited \? err = msg : err = new ReporterError(state.path.map(function(elem) {\n return \"[\" + JSON.stringify(elem) + \"]\";\n }).join(\"\"), msg.message || msg, msg.stack), !state.options.partial)\n throw err;\n return inherited || state.errors.push(err), err;\n }, Reporter.prototype.wrapResult = function(result) {\n let state = this._reporterState;\n return state.options.partial \? {\n result: this.isError(result) \? null : result,\n errors: state.errors\n } : result;\n };\n function ReporterError(path, msg) {\n this.path = path, this.rethrow(msg);\n }\n inherits(ReporterError, Error), ReporterError.prototype.rethrow = function(msg) {\n if (this.message = msg + \" at: \" + (this.path || \"(shallow)\"), Error.captureStackTrace && Error.captureStackTrace(this, ReporterError), !this.stack)\n try {\n throw new Error(this.message);\n } catch (e) {\n this.stack = e.stack;\n }\n return this;\n };\n }\n}), require_buffer = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/buffer.js\"(exports) {\n var inherits = require_inherits_browser(), Reporter = require_reporter().Reporter, Buffer2 = require_safer().Buffer;\n function DecoderBuffer(base, options) {\n if (Reporter.@call(this, options), !Buffer2.isBuffer(base)) {\n this.error(\"Input not Buffer\");\n return;\n }\n this.base = base, this.offset = 0, this.length = base.length;\n }\n inherits(DecoderBuffer, Reporter), exports.DecoderBuffer = DecoderBuffer, DecoderBuffer.isDecoderBuffer = function(data) {\n return data instanceof DecoderBuffer \? !0 : typeof data == \"object\" && Buffer2.isBuffer(data.base) && data.constructor.name === \"DecoderBuffer\" && typeof data.offset == \"number\" && typeof data.length == \"number\" && typeof data.save == \"function\" && typeof data.restore == \"function\" && typeof data.isEmpty == \"function\" && typeof data.readUInt8 == \"function\" && typeof data.skip == \"function\" && typeof data.raw == \"function\";\n }, DecoderBuffer.prototype.save = function() {\n return {\n offset: this.offset,\n reporter: Reporter.prototype.save.@call(this)\n };\n }, DecoderBuffer.prototype.restore = function(save) {\n let res = new DecoderBuffer(this.base);\n return res.offset = save.offset, res.length = this.offset, this.offset = save.offset, Reporter.prototype.restore.@call(this, save.reporter), res;\n }, DecoderBuffer.prototype.isEmpty = function() {\n return this.offset === this.length;\n }, DecoderBuffer.prototype.readUInt8 = function(fail) {\n return this.offset + 1 <= this.length \? this.base.readUInt8(this.offset++, !0) : this.error(fail || \"DecoderBuffer overrun\");\n }, DecoderBuffer.prototype.skip = function(bytes, fail) {\n if (!(this.offset + bytes <= this.length))\n return this.error(fail || \"DecoderBuffer overrun\");\n let res = new DecoderBuffer(this.base);\n return res._reporterState = this._reporterState, res.offset = this.offset, res.length = this.offset + bytes, this.offset += bytes, res;\n }, DecoderBuffer.prototype.raw = function(save) {\n return this.base.slice(save \? save.offset : this.offset, this.length);\n };\n function EncoderBuffer(value, reporter) {\n if (@Array.isArray(value))\n this.length = 0, this.value = value.map(function(item) {\n return EncoderBuffer.isEncoderBuffer(item) || (item = new EncoderBuffer(item, reporter)), this.length += item.length, item;\n }, this);\n else if (typeof value == \"number\") {\n if (!(0 <= value && value <= 255))\n return reporter.error(\"non-byte EncoderBuffer value\");\n this.value = value, this.length = 1;\n } else if (typeof value == \"string\")\n this.value = value, this.length = Buffer2.byteLength(value);\n else if (Buffer2.isBuffer(value))\n this.value = value, this.length = value.length;\n else\n return reporter.error(\"Unsupported type: \" + typeof value);\n }\n EncoderBuffer.prototype = {}, exports.EncoderBuffer = EncoderBuffer, EncoderBuffer.isEncoderBuffer = function(data) {\n return data instanceof EncoderBuffer \? !0 : typeof data == \"object\" && data.constructor.name === \"EncoderBuffer\" && typeof data.length == \"number\" && typeof data.join == \"function\";\n }, EncoderBuffer.prototype.join = function(out, offset) {\n return out || (out = Buffer2.alloc(this.length)), offset || (offset = 0), this.length === 0 || (@Array.isArray(this.value) \? this.value.forEach(function(item) {\n item.join(out, offset), offset += item.length;\n }) : (typeof this.value == \"number\" \? out[offset] = this.value : typeof this.value == \"string\" \? out.write(this.value, offset) : Buffer2.isBuffer(this.value) && this.value.copy(out, offset), offset += this.length)), out;\n };\n }\n}), require_node = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/node.js\"(exports, module) {\n var Reporter = require_reporter().Reporter, EncoderBuffer = require_buffer().EncoderBuffer, DecoderBuffer = require_buffer().DecoderBuffer, assert = require_minimalistic_assert(), tags = [\n \"seq\",\n \"seqof\",\n \"set\",\n \"setof\",\n \"objid\",\n \"bool\",\n \"gentime\",\n \"utctime\",\n \"null_\",\n \"enum\",\n \"int\",\n \"objDesc\",\n \"bitstr\",\n \"bmpstr\",\n \"charstr\",\n \"genstr\",\n \"graphstr\",\n \"ia5str\",\n \"iso646str\",\n \"numstr\",\n \"octstr\",\n \"printstr\",\n \"t61str\",\n \"unistr\",\n \"utf8str\",\n \"videostr\"\n ], methods = [\"key\", \"obj\", \"use\", \"optional\", \"explicit\", \"implicit\", \"def\", \"choice\", \"any\", \"contains\"].concat(tags), overrided = [\n \"_peekTag\",\n \"_decodeTag\",\n \"_use\",\n \"_decodeStr\",\n \"_decodeObjid\",\n \"_decodeTime\",\n \"_decodeNull\",\n \"_decodeInt\",\n \"_decodeBool\",\n \"_decodeList\",\n \"_encodeComposite\",\n \"_encodeStr\",\n \"_encodeObjid\",\n \"_encodeTime\",\n \"_encodeNull\",\n \"_encodeInt\",\n \"_encodeBool\"\n ];\n function Node(enc, parent, name) {\n let state = {};\n this._baseState = state, state.name = name, state.enc = enc, state.parent = parent || null, state.children = null, state.tag = null, state.args = null, state.reverseArgs = null, state.choice = null, state.optional = !1, state.any = !1, state.obj = !1, state.use = null, state.useDecoder = null, state.key = null, state.default = null, state.explicit = null, state.implicit = null, state.contains = null, state.parent || (state.children = [], this._wrap());\n }\n Node.prototype = {}, module.exports = Node;\n var stateProps = [\n \"enc\",\n \"parent\",\n \"children\",\n \"tag\",\n \"args\",\n \"reverseArgs\",\n \"choice\",\n \"optional\",\n \"any\",\n \"obj\",\n \"use\",\n \"alteredUse\",\n \"key\",\n \"default\",\n \"explicit\",\n \"implicit\",\n \"contains\"\n ];\n Node.prototype.clone = function() {\n let state = this._baseState, cstate = {};\n stateProps.forEach(function(prop) {\n cstate[prop] = state[prop];\n });\n let res = new this.constructor(cstate.parent);\n return res._baseState = cstate, res;\n }, Node.prototype._wrap = function() {\n let state = this._baseState;\n methods.forEach(function(method) {\n this[method] = function() {\n let clone = new this.constructor(this);\n return state.children.push(clone), clone[method].@apply(clone, arguments);\n };\n }, this);\n }, Node.prototype._init = function(body) {\n let state = this._baseState;\n assert(state.parent === null), body.@call(this), state.children = state.children.filter(function(child) {\n return child._baseState.parent === this;\n }, this), assert.equal(state.children.length, 1, \"Root node can have only one child\");\n }, Node.prototype._useArgs = function(args) {\n let state = this._baseState, children = args.filter(function(arg) {\n return arg instanceof this.constructor;\n }, this);\n args = args.filter(function(arg) {\n return !(arg instanceof this.constructor);\n }, this), children.length !== 0 && (assert(state.children === null), state.children = children, children.forEach(function(child) {\n child._baseState.parent = this;\n }, this)), args.length !== 0 && (assert(state.args === null), state.args = args, state.reverseArgs = args.map(function(arg) {\n if (typeof arg != \"object\" || arg.constructor !== Object)\n return arg;\n let res = {};\n return Object.keys(arg).forEach(function(key2) {\n key2 == (key2 | 0) && (key2 |= 0);\n let value = arg[key2];\n res[value] = key2;\n }), res;\n }));\n }, overrided.forEach(function(method) {\n Node.prototype[method] = function() {\n let state = this._baseState;\n throw new Error(method + \" not implemented for encoding: \" + state.enc);\n };\n }), tags.forEach(function(tag) {\n Node.prototype[tag] = function() {\n let state = this._baseState, args = @Array.prototype.slice.@call(arguments);\n return assert(state.tag === null), state.tag = tag, this._useArgs(args), this;\n };\n }), Node.prototype.use = function(item) {\n assert(item);\n let state = this._baseState;\n return assert(state.use === null), state.use = item, this;\n }, Node.prototype.optional = function() {\n let state = this._baseState;\n return state.optional = !0, this;\n }, Node.prototype.def = function(val) {\n let state = this._baseState;\n return assert(state.default === null), state.default = val, state.optional = !0, this;\n }, Node.prototype.explicit = function(num) {\n let state = this._baseState;\n return assert(state.explicit === null && state.implicit === null), state.explicit = num, this;\n }, Node.prototype.implicit = function(num) {\n let state = this._baseState;\n return assert(state.explicit === null && state.implicit === null), state.implicit = num, this;\n }, Node.prototype.obj = function() {\n let state = this._baseState, args = @Array.prototype.slice.@call(arguments);\n return state.obj = !0, args.length !== 0 && this._useArgs(args), this;\n }, Node.prototype.key = function(newKey) {\n let state = this._baseState;\n return assert(state.key === null), state.key = newKey, this;\n }, Node.prototype.any = function() {\n let state = this._baseState;\n return state.any = !0, this;\n }, Node.prototype.choice = function(obj) {\n let state = this._baseState;\n return assert(state.choice === null), state.choice = obj, this._useArgs(Object.keys(obj).map(function(key2) {\n return obj[key2];\n })), this;\n }, Node.prototype.contains = function(item) {\n let state = this._baseState;\n return assert(state.use === null), state.contains = item, this;\n }, Node.prototype._decode = function(input, options) {\n let state = this._baseState;\n if (state.parent === null)\n return input.wrapResult(state.children[0]._decode(input, options));\n let result = state.default, present = !0, prevKey = null;\n if (state.key !== null && (prevKey = input.enterKey(state.key)), state.optional) {\n let tag = null;\n if (state.explicit !== null \? tag = state.explicit : state.implicit !== null \? tag = state.implicit : state.tag !== null && (tag = state.tag), tag === null && !state.any) {\n let save = input.save();\n try {\n state.choice === null \? this._decodeGeneric(state.tag, input, options) : this._decodeChoice(input, options), present = !0;\n } catch {\n present = !1;\n }\n input.restore(save);\n } else if (present = this._peekTag(input, tag, state.any), input.isError(present))\n return present;\n }\n let prevObj;\n if (state.obj && present && (prevObj = input.enterObject()), present) {\n if (state.explicit !== null) {\n let explicit = this._decodeTag(input, state.explicit);\n if (input.isError(explicit))\n return explicit;\n input = explicit;\n }\n let start = input.offset;\n if (state.use === null && state.choice === null) {\n let save;\n state.any && (save = input.save());\n let body = this._decodeTag(input, state.implicit !== null \? state.implicit : state.tag, state.any);\n if (input.isError(body))\n return body;\n state.any \? result = input.raw(save) : input = body;\n }\n if (options && options.track && state.tag !== null && options.track(input.path(), start, input.length, \"tagged\"), options && options.track && state.tag !== null && options.track(input.path(), input.offset, input.length, \"content\"), state.any || (state.choice === null \? result = this._decodeGeneric(state.tag, input, options) : result = this._decodeChoice(input, options)), input.isError(result))\n return result;\n if (!state.any && state.choice === null && state.children !== null && state.children.forEach(function(child) {\n child._decode(input, options);\n }), state.contains && (state.tag === \"octstr\" || state.tag === \"bitstr\")) {\n let data = new DecoderBuffer(result);\n result = this._getUse(state.contains, input._reporterState.obj)._decode(data, options);\n }\n }\n return state.obj && present && (result = input.leaveObject(prevObj)), state.key !== null && (result !== null || present === !0) \? input.leaveKey(prevKey, state.key, result) : prevKey !== null && input.exitKey(prevKey), result;\n }, Node.prototype._decodeGeneric = function(tag, input, options) {\n let state = this._baseState;\n return tag === \"seq\" || tag === \"set\" \? null : tag === \"seqof\" || tag === \"setof\" \? this._decodeList(input, tag, state.args[0], options) : /str$/.test(tag) \? this._decodeStr(input, tag, options) : tag === \"objid\" && state.args \? this._decodeObjid(input, state.args[0], state.args[1], options) : tag === \"objid\" \? this._decodeObjid(input, null, null, options) : tag === \"gentime\" || tag === \"utctime\" \? this._decodeTime(input, tag, options) : tag === \"null_\" \? this._decodeNull(input, options) : tag === \"bool\" \? this._decodeBool(input, options) : tag === \"objDesc\" \? this._decodeStr(input, tag, options) : tag === \"int\" || tag === \"enum\" \? this._decodeInt(input, state.args && state.args[0], options) : state.use !== null \? this._getUse(state.use, input._reporterState.obj)._decode(input, options) : input.error(\"unknown tag: \" + tag);\n }, Node.prototype._getUse = function(entity, obj) {\n let state = this._baseState;\n return state.useDecoder = this._use(entity, obj), assert(state.useDecoder._baseState.parent === null), state.useDecoder = state.useDecoder._baseState.children[0], state.implicit !== state.useDecoder._baseState.implicit && (state.useDecoder = state.useDecoder.clone(), state.useDecoder._baseState.implicit = state.implicit), state.useDecoder;\n }, Node.prototype._decodeChoice = function(input, options) {\n let state = this._baseState, result = null, match = !1;\n return Object.keys(state.choice).some(function(key2) {\n let save = input.save(), node = state.choice[key2];\n try {\n let value = node._decode(input, options);\n if (input.isError(value))\n return !1;\n result = { type: key2, value }, match = !0;\n } catch {\n return input.restore(save), !1;\n }\n return !0;\n }, this), match \? result : input.error(\"Choice not matched\");\n }, Node.prototype._createEncoderBuffer = function(data) {\n return new EncoderBuffer(data, this.reporter);\n }, Node.prototype._encode = function(data, reporter, parent) {\n let state = this._baseState;\n if (state.default !== null && state.default === data)\n return;\n let result = this._encodeValue(data, reporter, parent);\n if (result !== void 0 && !this._skipDefault(result, reporter, parent))\n return result;\n }, Node.prototype._encodeValue = function(data, reporter, parent) {\n let state = this._baseState;\n if (state.parent === null)\n return state.children[0]._encode(data, reporter || new Reporter);\n let result = null;\n if (this.reporter = reporter, state.optional && data === void 0)\n if (state.default !== null)\n data = state.default;\n else\n return;\n let content = null, primitive = !1;\n if (state.any)\n result = this._createEncoderBuffer(data);\n else if (state.choice)\n result = this._encodeChoice(data, reporter);\n else if (state.contains)\n content = this._getUse(state.contains, parent)._encode(data, reporter), primitive = !0;\n else if (state.children)\n content = state.children.map(function(child) {\n if (child._baseState.tag === \"null_\")\n return child._encode(null, reporter, data);\n if (child._baseState.key === null)\n return reporter.error(\"Child should have a key\");\n let prevKey = reporter.enterKey(child._baseState.key);\n if (typeof data != \"object\")\n return reporter.error(\"Child expected, but input is not object\");\n let res = child._encode(data[child._baseState.key], reporter, data);\n return reporter.leaveKey(prevKey), res;\n }, this).filter(function(child) {\n return child;\n }), content = this._createEncoderBuffer(content);\n else if (state.tag === \"seqof\" || state.tag === \"setof\") {\n if (!(state.args && state.args.length === 1))\n return reporter.error(\"Too many args for : \" + state.tag);\n if (!@Array.isArray(data))\n return reporter.error(\"seqof/setof, but data is not Array\");\n let child = this.clone();\n child._baseState.implicit = null, content = this._createEncoderBuffer(data.map(function(item) {\n let state2 = this._baseState;\n return this._getUse(state2.args[0], data)._encode(item, reporter);\n }, child));\n } else\n state.use !== null \? result = this._getUse(state.use, parent)._encode(data, reporter) : (content = this._encodePrimitive(state.tag, data), primitive = !0);\n if (!state.any && state.choice === null) {\n let tag = state.implicit !== null \? state.implicit : state.tag, cls = state.implicit === null \? \"universal\" : \"context\";\n tag === null \? state.use === null && reporter.error(\"Tag could be omitted only for .use()\") : state.use === null && (result = this._encodeComposite(tag, primitive, cls, content));\n }\n return state.explicit !== null && (result = this._encodeComposite(state.explicit, !1, \"context\", result)), result;\n }, Node.prototype._encodeChoice = function(data, reporter) {\n let state = this._baseState, node = state.choice[data.type];\n return node || assert(!1, data.type + \" not found in \" + JSON.stringify(Object.keys(state.choice))), node._encode(data.value, reporter);\n }, Node.prototype._encodePrimitive = function(tag, data) {\n let state = this._baseState;\n if (/str$/.test(tag))\n return this._encodeStr(data, tag);\n if (tag === \"objid\" && state.args)\n return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);\n if (tag === \"objid\")\n return this._encodeObjid(data, null, null);\n if (tag === \"gentime\" || tag === \"utctime\")\n return this._encodeTime(data, tag);\n if (tag === \"null_\")\n return this._encodeNull();\n if (tag === \"int\" || tag === \"enum\")\n return this._encodeInt(data, state.args && state.reverseArgs[0]);\n if (tag === \"bool\")\n return this._encodeBool(data);\n if (tag === \"objDesc\")\n return this._encodeStr(data, tag);\n throw new Error(\"Unsupported tag: \" + tag);\n }, Node.prototype._isNumstr = function(str) {\n return /^[0-9 ]*$/.test(str);\n }, Node.prototype._isPrintstr = function(str) {\n return /^[A-Za-z0-9 '()+,-./:=\?]*$/.test(str);\n };\n }\n}), require_der = __commonJS({\n \"node_modules/asn1.js/lib/asn1/constants/der.js\"(exports) {\n function reverse(map) {\n let res = {};\n return Object.keys(map).forEach(function(key2) {\n (key2 | 0) == key2 && (key2 = key2 | 0);\n let value = map[key2];\n res[value] = key2;\n }), res;\n }\n exports.tagClass = {\n 0: \"universal\",\n 1: \"application\",\n 2: \"context\",\n 3: \"private\"\n }, exports.tagClassByName = reverse(exports.tagClass), exports.tag = {\n 0: \"end\",\n 1: \"bool\",\n 2: \"int\",\n 3: \"bitstr\",\n 4: \"octstr\",\n 5: \"null_\",\n 6: \"objid\",\n 7: \"objDesc\",\n 8: \"external\",\n 9: \"real\",\n 10: \"enum\",\n 11: \"embed\",\n 12: \"utf8str\",\n 13: \"relativeOid\",\n 16: \"seq\",\n 17: \"set\",\n 18: \"numstr\",\n 19: \"printstr\",\n 20: \"t61str\",\n 21: \"videostr\",\n 22: \"ia5str\",\n 23: \"utctime\",\n 24: \"gentime\",\n 25: \"graphstr\",\n 26: \"iso646str\",\n 27: \"genstr\",\n 28: \"unistr\",\n 29: \"charstr\",\n 30: \"bmpstr\"\n }, exports.tagByName = reverse(exports.tag);\n }\n}), require_der2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/der.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safer().Buffer, Node = require_node(), der = require_der();\n function DEREncoder(entity) {\n this.enc = \"der\", this.name = entity.name, this.entity = entity, this.tree = new DERNode, this.tree._init(entity.body);\n }\n DEREncoder.prototype = {}, module.exports = DEREncoder, DEREncoder.prototype.encode = function(data, reporter) {\n return this.tree._encode(data, reporter).join();\n };\n function DERNode(parent) {\n Node.@call(this, \"der\", parent);\n }\n inherits(DERNode, Node), DERNode.prototype._encodeComposite = function(tag, primitive, cls, content) {\n let encodedTag = encodeTag(tag, primitive, cls, this.reporter);\n if (content.length < 128) {\n let header2 = Buffer2.alloc(2);\n return header2[0] = encodedTag, header2[1] = content.length, this._createEncoderBuffer([header2, content]);\n }\n let lenOctets = 1;\n for (let i = content.length;i >= 256; i >>= 8)\n lenOctets++;\n let header = Buffer2.alloc(2 + lenOctets);\n header[0] = encodedTag, header[1] = 128 | lenOctets;\n for (let i = 1 + lenOctets, j = content.length;j > 0; i--, j >>= 8)\n header[i] = j & 255;\n return this._createEncoderBuffer([header, content]);\n }, DERNode.prototype._encodeStr = function(str, tag) {\n if (tag === \"bitstr\")\n return this._createEncoderBuffer([str.unused | 0, str.data]);\n if (tag === \"bmpstr\") {\n let buf = Buffer2.alloc(str.length * 2);\n for (let i = 0;i < str.length; i++)\n buf.writeUInt16BE(str.charCodeAt(i), i * 2);\n return this._createEncoderBuffer(buf);\n } else\n return tag === \"numstr\" \? this._isNumstr(str) \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: numstr supports only digits and space\") : tag === \"printstr\" \? this._isPrintstr(str) \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark\") : /str$/.test(tag) \? this._createEncoderBuffer(str) : tag === \"objDesc\" \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: \" + tag + \" unsupported\");\n }, DERNode.prototype._encodeObjid = function(id, values, relative) {\n if (typeof id == \"string\") {\n if (!values)\n return this.reporter.error(\"string objid given, but no values map found\");\n if (!values.hasOwnProperty(id))\n return this.reporter.error(\"objid not found in values map\");\n id = values[id].split(/[\\s.]+/g);\n for (let i = 0;i < id.length; i++)\n id[i] |= 0;\n } else if (@Array.isArray(id)) {\n id = id.slice();\n for (let i = 0;i < id.length; i++)\n id[i] |= 0;\n }\n if (!@Array.isArray(id))\n return this.reporter.error(\"objid() should be either array or string, got: \" + JSON.stringify(id));\n if (!relative) {\n if (id[1] >= 40)\n return this.reporter.error(\"Second objid identifier OOB\");\n id.splice(0, 2, id[0] * 40 + id[1]);\n }\n let size = 0;\n for (let i = 0;i < id.length; i++) {\n let ident = id[i];\n for (size++;ident >= 128; ident >>= 7)\n size++;\n }\n let objid = Buffer2.alloc(size), offset = objid.length - 1;\n for (let i = id.length - 1;i >= 0; i--) {\n let ident = id[i];\n for (objid[offset--] = ident & 127;(ident >>= 7) > 0; )\n objid[offset--] = 128 | ident & 127;\n }\n return this._createEncoderBuffer(objid);\n };\n function two(num) {\n return num < 10 \? \"0\" + num : num;\n }\n DERNode.prototype._encodeTime = function(time, tag) {\n let str, date = new Date(time);\n return tag === \"gentime\" \? str = [\n two(date.getUTCFullYear()),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n \"Z\"\n ].join(\"\") : tag === \"utctime\" \? str = [\n two(date.getUTCFullYear() % 100),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n \"Z\"\n ].join(\"\") : this.reporter.error(\"Encoding \" + tag + \" time is not supported yet\"), this._encodeStr(str, \"octstr\");\n }, DERNode.prototype._encodeNull = function() {\n return this._createEncoderBuffer(\"\");\n }, DERNode.prototype._encodeInt = function(num, values) {\n if (typeof num == \"string\") {\n if (!values)\n return this.reporter.error(\"String int or enum given, but no values map\");\n if (!values.hasOwnProperty(num))\n return this.reporter.error(\"Values map doesn't contain: \" + JSON.stringify(num));\n num = values[num];\n }\n if (typeof num != \"number\" && !Buffer2.isBuffer(num)) {\n let numArray = num.toArray();\n !num.sign && numArray[0] & 128 && numArray.unshift(0), num = Buffer2.from(numArray);\n }\n if (Buffer2.isBuffer(num)) {\n let size2 = num.length;\n num.length === 0 && size2++;\n let out2 = Buffer2.alloc(size2);\n return num.copy(out2), num.length === 0 && (out2[0] = 0), this._createEncoderBuffer(out2);\n }\n if (num < 128)\n return this._createEncoderBuffer(num);\n if (num < 256)\n return this._createEncoderBuffer([0, num]);\n let size = 1;\n for (let i = num;i >= 256; i >>= 8)\n size++;\n let out = new @Array(size);\n for (let i = out.length - 1;i >= 0; i--)\n out[i] = num & 255, num >>= 8;\n return out[0] & 128 && out.unshift(0), this._createEncoderBuffer(Buffer2.from(out));\n }, DERNode.prototype._encodeBool = function(value) {\n return this._createEncoderBuffer(value \? 255 : 0);\n }, DERNode.prototype._use = function(entity, obj) {\n return typeof entity == \"function\" && (entity = entity(obj)), entity._getEncoder(\"der\").tree;\n }, DERNode.prototype._skipDefault = function(dataBuffer, reporter, parent) {\n let state = this._baseState, i;\n if (state.default === null)\n return !1;\n let data = dataBuffer.join();\n if (state.defaultBuffer === void 0 && (state.defaultBuffer = this._encodeValue(state.default, reporter, parent).join()), data.length !== state.defaultBuffer.length)\n return !1;\n for (i = 0;i < data.length; i++)\n if (data[i] !== state.defaultBuffer[i])\n return !1;\n return !0;\n };\n function encodeTag(tag, primitive, cls, reporter) {\n let res;\n if (tag === \"seqof\" \? tag = \"seq\" : tag === \"setof\" && (tag = \"set\"), der.tagByName.hasOwnProperty(tag))\n res = der.tagByName[tag];\n else if (typeof tag == \"number\" && (tag | 0) === tag)\n res = tag;\n else\n return reporter.error(\"Unknown tag: \" + tag);\n return res >= 31 \? reporter.error(\"Multi-octet tag encoding unsupported\") : (primitive || (res |= 32), res |= der.tagClassByName[cls || \"universal\"] << 6, res);\n }\n }\n}), require_pem = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/pem.js\"(exports, module) {\n var inherits = require_inherits_browser(), DEREncoder = require_der2();\n function PEMEncoder(entity) {\n DEREncoder.@call(this, entity), this.enc = \"pem\";\n }\n inherits(PEMEncoder, DEREncoder), module.exports = PEMEncoder, PEMEncoder.prototype.encode = function(data, options) {\n let p = DEREncoder.prototype.encode.@call(this, data).toString(\"base64\"), out = [\"-----BEGIN \" + options.label + \"-----\"];\n for (let i = 0;i < p.length; i += 64)\n out.push(p.slice(i, i + 64));\n return out.push(\"-----END \" + options.label + \"-----\"), out.join(`\n`);\n };\n }\n}), require_encoders = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/index.js\"(exports) {\n var encoders = exports;\n encoders.der = require_der2(), encoders.pem = require_pem();\n }\n}), require_der3 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/der.js\"(exports, module) {\n var inherits = require_inherits_browser(), bignum = require_bn5(), DecoderBuffer = require_buffer().DecoderBuffer, Node = require_node(), der = require_der();\n function DERDecoder(entity) {\n this.enc = \"der\", this.name = entity.name, this.entity = entity, this.tree = new DERNode, this.tree._init(entity.body);\n }\n DERDecoder.prototype = {}, module.exports = DERDecoder, DERDecoder.prototype.decode = function(data, options) {\n return DecoderBuffer.isDecoderBuffer(data) || (data = new DecoderBuffer(data, options)), this.tree._decode(data, options);\n };\n function DERNode(parent) {\n Node.@call(this, \"der\", parent);\n }\n inherits(DERNode, Node), DERNode.prototype._peekTag = function(buffer, tag, any) {\n if (buffer.isEmpty())\n return !1;\n let state = buffer.save(), decodedTag = derDecodeTag(buffer, 'Failed to peek tag: \"' + tag + '\"');\n return buffer.isError(decodedTag) \? decodedTag : (buffer.restore(state), decodedTag.tag === tag || decodedTag.tagStr === tag || decodedTag.tagStr + \"of\" === tag || any);\n }, DERNode.prototype._decodeTag = function(buffer, tag, any) {\n let decodedTag = derDecodeTag(buffer, 'Failed to decode tag of \"' + tag + '\"');\n if (buffer.isError(decodedTag))\n return decodedTag;\n let len = derDecodeLen(buffer, decodedTag.primitive, 'Failed to get length of \"' + tag + '\"');\n if (buffer.isError(len))\n return len;\n if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + \"of\" !== tag)\n return buffer.error('Failed to match tag: \"' + tag + '\"');\n if (decodedTag.primitive || len !== null)\n return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n let state = buffer.save(), res = this._skipUntilEnd(buffer, 'Failed to skip indefinite length body: \"' + this.tag + '\"');\n return buffer.isError(res) \? res : (len = buffer.offset - state.offset, buffer.restore(state), buffer.skip(len, 'Failed to match body of: \"' + tag + '\"'));\n }, DERNode.prototype._skipUntilEnd = function(buffer, fail) {\n for (;; ) {\n let tag = derDecodeTag(buffer, fail);\n if (buffer.isError(tag))\n return tag;\n let len = derDecodeLen(buffer, tag.primitive, fail);\n if (buffer.isError(len))\n return len;\n let res;\n if (tag.primitive || len !== null \? res = buffer.skip(len) : res = this._skipUntilEnd(buffer, fail), buffer.isError(res))\n return res;\n if (tag.tagStr === \"end\")\n break;\n }\n }, DERNode.prototype._decodeList = function(buffer, tag, decoder, options) {\n let result = [];\n for (;!buffer.isEmpty(); ) {\n let possibleEnd = this._peekTag(buffer, \"end\");\n if (buffer.isError(possibleEnd))\n return possibleEnd;\n let res = decoder.decode(buffer, \"der\", options);\n if (buffer.isError(res) && possibleEnd)\n break;\n result.push(res);\n }\n return result;\n }, DERNode.prototype._decodeStr = function(buffer, tag) {\n if (tag === \"bitstr\") {\n let unused = buffer.readUInt8();\n return buffer.isError(unused) \? unused : { unused, data: buffer.raw() };\n } else if (tag === \"bmpstr\") {\n let raw = buffer.raw();\n if (raw.length % 2 === 1)\n return buffer.error(\"Decoding of string type: bmpstr length mismatch\");\n let str = \"\";\n for (let i = 0;i < raw.length / 2; i++)\n str += @String.fromCharCode(raw.readUInt16BE(i * 2));\n return str;\n } else if (tag === \"numstr\") {\n let numstr = buffer.raw().toString(\"ascii\");\n return this._isNumstr(numstr) \? numstr : buffer.error(\"Decoding of string type: numstr unsupported characters\");\n } else {\n if (tag === \"octstr\")\n return buffer.raw();\n if (tag === \"objDesc\")\n return buffer.raw();\n if (tag === \"printstr\") {\n let printstr = buffer.raw().toString(\"ascii\");\n return this._isPrintstr(printstr) \? printstr : buffer.error(\"Decoding of string type: printstr unsupported characters\");\n } else\n return /str$/.test(tag) \? buffer.raw().toString() : buffer.error(\"Decoding of string type: \" + tag + \" unsupported\");\n }\n }, DERNode.prototype._decodeObjid = function(buffer, values, relative) {\n let result, identifiers = [], ident = 0, subident = 0;\n for (;!buffer.isEmpty(); )\n subident = buffer.readUInt8(), ident <<= 7, ident |= subident & 127, (subident & 128) === 0 && (identifiers.push(ident), ident = 0);\n subident & 128 && identifiers.push(ident);\n let first = identifiers[0] / 40 | 0, second = identifiers[0] % 40;\n if (relative \? result = identifiers : result = [first, second].concat(identifiers.slice(1)), values) {\n let tmp = values[result.join(\" \")];\n tmp === void 0 && (tmp = values[result.join(\".\")]), tmp !== void 0 && (result = tmp);\n }\n return result;\n }, DERNode.prototype._decodeTime = function(buffer, tag) {\n let str = buffer.raw().toString(), year, mon, day, hour, min, sec;\n if (tag === \"gentime\")\n year = str.slice(0, 4) | 0, mon = str.slice(4, 6) | 0, day = str.slice(6, 8) | 0, hour = str.slice(8, 10) | 0, min = str.slice(10, 12) | 0, sec = str.slice(12, 14) | 0;\n else if (tag === \"utctime\")\n year = str.slice(0, 2) | 0, mon = str.slice(2, 4) | 0, day = str.slice(4, 6) | 0, hour = str.slice(6, 8) | 0, min = str.slice(8, 10) | 0, sec = str.slice(10, 12) | 0, year < 70 \? year = 2000 + year : year = 1900 + year;\n else\n return buffer.error(\"Decoding \" + tag + \" time is not supported yet\");\n return Date.UTC(year, mon - 1, day, hour, min, sec, 0);\n }, DERNode.prototype._decodeNull = function() {\n return null;\n }, DERNode.prototype._decodeBool = function(buffer) {\n let res = buffer.readUInt8();\n return buffer.isError(res) \? res : res !== 0;\n }, DERNode.prototype._decodeInt = function(buffer, values) {\n let raw = buffer.raw(), res = new bignum(raw);\n return values && (res = values[res.toString(10)] || res), res;\n }, DERNode.prototype._use = function(entity, obj) {\n return typeof entity == \"function\" && (entity = entity(obj)), entity._getDecoder(\"der\").tree;\n };\n function derDecodeTag(buf, fail) {\n let tag = buf.readUInt8(fail);\n if (buf.isError(tag))\n return tag;\n let cls = der.tagClass[tag >> 6], primitive = (tag & 32) === 0;\n if ((tag & 31) === 31) {\n let oct = tag;\n for (tag = 0;(oct & 128) === 128; ) {\n if (oct = buf.readUInt8(fail), buf.isError(oct))\n return oct;\n tag <<= 7, tag |= oct & 127;\n }\n } else\n tag &= 31;\n let tagStr = der.tag[tag];\n return {\n cls,\n primitive,\n tag,\n tagStr\n };\n }\n function derDecodeLen(buf, primitive, fail) {\n let len = buf.readUInt8(fail);\n if (buf.isError(len))\n return len;\n if (!primitive && len === 128)\n return null;\n if ((len & 128) === 0)\n return len;\n let num = len & 127;\n if (num > 4)\n return buf.error(\"length octect is too long\");\n len = 0;\n for (let i = 0;i < num; i++) {\n len <<= 8;\n let j = buf.readUInt8(fail);\n if (buf.isError(j))\n return j;\n len |= j;\n }\n return len;\n }\n }\n}), require_pem2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/pem.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safer().Buffer, DERDecoder = require_der3();\n function PEMDecoder(entity) {\n DERDecoder.@call(this, entity), this.enc = \"pem\";\n }\n inherits(PEMDecoder, DERDecoder), module.exports = PEMDecoder, PEMDecoder.prototype.decode = function(data, options) {\n let lines = data.toString().split(/[\\r\\n]+/g), label = options.label.toUpperCase(), re = /^-----(BEGIN|END) ([^-]+)-----$/, start = -1, end = -1;\n for (let i = 0;i < lines.length; i++) {\n let match = lines[i].match(re);\n if (match !== null && match[2] === label)\n if (start === -1) {\n if (match[1] !== \"BEGIN\")\n break;\n start = i;\n } else {\n if (match[1] !== \"END\")\n break;\n end = i;\n break;\n }\n }\n if (start === -1 || end === -1)\n throw new Error(\"PEM section not found for: \" + label);\n let base64 = lines.slice(start + 1, end).join(\"\");\n base64.replace(/[^a-z0-9+/=]+/gi, \"\");\n let input = Buffer2.from(base64, \"base64\");\n return DERDecoder.prototype.decode.@call(this, input, options);\n };\n }\n}), require_decoders = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/index.js\"(exports) {\n var decoders = exports;\n decoders.der = require_der3(), decoders.pem = require_pem2();\n }\n}), require_api = __commonJS({\n \"node_modules/asn1.js/lib/asn1/api.js\"(exports) {\n var encoders = require_encoders(), decoders = require_decoders(), inherits = require_inherits_browser(), api = exports;\n api.define = function(name, body) {\n return new Entity(name, body);\n };\n function Entity(name, body) {\n this.name = name, this.body = body, this.decoders = {}, this.encoders = {};\n }\n Entity.prototype = {}, Entity.prototype._createNamed = function(Base) {\n let name = this.name;\n function Generated(entity) {\n this._initNamed(entity, name);\n }\n return inherits(Generated, Base), Generated.prototype._initNamed = function(entity, name2) {\n Base.@call(this, entity, name2);\n }, new Generated(this);\n }, Entity.prototype._getDecoder = function(enc) {\n return enc = enc || \"der\", this.decoders.hasOwnProperty(enc) || (this.decoders[enc] = this._createNamed(decoders[enc])), this.decoders[enc];\n }, Entity.prototype.decode = function(data, enc, options) {\n return this._getDecoder(enc).decode(data, options);\n }, Entity.prototype._getEncoder = function(enc) {\n return enc = enc || \"der\", this.encoders.hasOwnProperty(enc) || (this.encoders[enc] = this._createNamed(encoders[enc])), this.encoders[enc];\n }, Entity.prototype.encode = function(data, enc, reporter) {\n return this._getEncoder(enc).encode(data, reporter);\n };\n }\n}), require_base2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/index.js\"(exports) {\n var base = exports;\n base.Reporter = require_reporter().Reporter, base.DecoderBuffer = require_buffer().DecoderBuffer, base.EncoderBuffer = require_buffer().EncoderBuffer, base.Node = require_node();\n }\n}), require_constants = __commonJS({\n \"node_modules/asn1.js/lib/asn1/constants/index.js\"(exports) {\n var constants = exports;\n constants._reverse = function(map) {\n let res = {};\n return Object.keys(map).forEach(function(key2) {\n (key2 | 0) == key2 && (key2 = key2 | 0);\n let value = map[key2];\n res[value] = key2;\n }), res;\n }, constants.der = require_der();\n }\n}), require_asn1 = __commonJS({\n \"node_modules/asn1.js/lib/asn1.js\"(exports) {\n var asn1 = exports;\n asn1.bignum = require_bn5(), asn1.define = require_api().define, asn1.base = require_base2(), asn1.constants = require_constants(), asn1.decoders = require_decoders(), asn1.encoders = require_encoders();\n }\n}), require_certificate = __commonJS({\n \"node_modules/parse-asn1/certificate.js\"(exports, module) {\n var asn = require_asn1(), Time = asn.define(\"Time\", function() {\n this.choice({\n utcTime: this.utctime(),\n generalTime: this.gentime()\n });\n }), AttributeTypeValue = asn.define(\"AttributeTypeValue\", function() {\n this.seq().obj(this.key(\"type\").objid(), this.key(\"value\").any());\n }), AlgorithmIdentifier = asn.define(\"AlgorithmIdentifier\", function() {\n this.seq().obj(this.key(\"algorithm\").objid(), this.key(\"parameters\").optional(), this.key(\"curve\").objid().optional());\n }), SubjectPublicKeyInfo = asn.define(\"SubjectPublicKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPublicKey\").bitstr());\n }), RelativeDistinguishedName = asn.define(\"RelativeDistinguishedName\", function() {\n this.setof(AttributeTypeValue);\n }), RDNSequence = asn.define(\"RDNSequence\", function() {\n this.seqof(RelativeDistinguishedName);\n }), Name = asn.define(\"Name\", function() {\n this.choice({\n rdnSequence: this.use(RDNSequence)\n });\n }), Validity = asn.define(\"Validity\", function() {\n this.seq().obj(this.key(\"notBefore\").use(Time), this.key(\"notAfter\").use(Time));\n }), Extension = asn.define(\"Extension\", function() {\n this.seq().obj(this.key(\"extnID\").objid(), this.key(\"critical\").bool().def(!1), this.key(\"extnValue\").octstr());\n }), TBSCertificate = asn.define(\"TBSCertificate\", function() {\n this.seq().obj(this.key(\"version\").explicit(0).int().optional(), this.key(\"serialNumber\").int(), this.key(\"signature\").use(AlgorithmIdentifier), this.key(\"issuer\").use(Name), this.key(\"validity\").use(Validity), this.key(\"subject\").use(Name), this.key(\"subjectPublicKeyInfo\").use(SubjectPublicKeyInfo), this.key(\"issuerUniqueID\").implicit(1).bitstr().optional(), this.key(\"subjectUniqueID\").implicit(2).bitstr().optional(), this.key(\"extensions\").explicit(3).seqof(Extension).optional());\n }), X509Certificate = asn.define(\"X509Certificate\", function() {\n this.seq().obj(this.key(\"tbsCertificate\").use(TBSCertificate), this.key(\"signatureAlgorithm\").use(AlgorithmIdentifier), this.key(\"signatureValue\").bitstr());\n });\n module.exports = X509Certificate;\n }\n}), require_asn12 = __commonJS({\n \"node_modules/parse-asn1/asn1.js\"(exports) {\n var asn1 = require_asn1();\n exports.certificate = require_certificate();\n var RSAPrivateKey = asn1.define(\"RSAPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"modulus\").int(), this.key(\"publicExponent\").int(), this.key(\"privateExponent\").int(), this.key(\"prime1\").int(), this.key(\"prime2\").int(), this.key(\"exponent1\").int(), this.key(\"exponent2\").int(), this.key(\"coefficient\").int());\n });\n exports.RSAPrivateKey = RSAPrivateKey;\n var RSAPublicKey = asn1.define(\"RSAPublicKey\", function() {\n this.seq().obj(this.key(\"modulus\").int(), this.key(\"publicExponent\").int());\n });\n exports.RSAPublicKey = RSAPublicKey;\n var PublicKey = asn1.define(\"SubjectPublicKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPublicKey\").bitstr());\n });\n exports.PublicKey = PublicKey;\n var AlgorithmIdentifier = asn1.define(\"AlgorithmIdentifier\", function() {\n this.seq().obj(this.key(\"algorithm\").objid(), this.key(\"none\").null_().optional(), this.key(\"curve\").objid().optional(), this.key(\"params\").seq().obj(this.key(\"p\").int(), this.key(\"q\").int(), this.key(\"g\").int()).optional());\n }), PrivateKeyInfo = asn1.define(\"PrivateKeyInfo\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPrivateKey\").octstr());\n });\n exports.PrivateKey = PrivateKeyInfo;\n var EncryptedPrivateKeyInfo = asn1.define(\"EncryptedPrivateKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").seq().obj(this.key(\"id\").objid(), this.key(\"decrypt\").seq().obj(this.key(\"kde\").seq().obj(this.key(\"id\").objid(), this.key(\"kdeparams\").seq().obj(this.key(\"salt\").octstr(), this.key(\"iters\").int())), this.key(\"cipher\").seq().obj(this.key(\"algo\").objid(), this.key(\"iv\").octstr()))), this.key(\"subjectPrivateKey\").octstr());\n });\n exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo;\n var DSAPrivateKey = asn1.define(\"DSAPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"p\").int(), this.key(\"q\").int(), this.key(\"g\").int(), this.key(\"pub_key\").int(), this.key(\"priv_key\").int());\n });\n exports.DSAPrivateKey = DSAPrivateKey, exports.DSAparam = asn1.define(\"DSAparam\", function() {\n this.int();\n });\n var ECPrivateKey = asn1.define(\"ECPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"privateKey\").octstr(), this.key(\"parameters\").optional().explicit(0).use(ECParameters), this.key(\"publicKey\").optional().explicit(1).bitstr());\n });\n exports.ECPrivateKey = ECPrivateKey;\n var ECParameters = asn1.define(\"ECParameters\", function() {\n this.choice({\n namedCurve: this.objid()\n });\n });\n exports.signature = asn1.define(\"signature\", function() {\n this.seq().obj(this.key(\"r\").int(), this.key(\"s\").int());\n });\n }\n}), require_aesid = __commonJS({\n \"node_modules/parse-asn1/aesid.json\"(exports, module) {\n module.exports = {\n \"2.16.840.1.101.3.4.1.1\": \"aes-128-ecb\",\n \"2.16.840.1.101.3.4.1.2\": \"aes-128-cbc\",\n \"2.16.840.1.101.3.4.1.3\": \"aes-128-ofb\",\n \"2.16.840.1.101.3.4.1.4\": \"aes-128-cfb\",\n \"2.16.840.1.101.3.4.1.21\": \"aes-192-ecb\",\n \"2.16.840.1.101.3.4.1.22\": \"aes-192-cbc\",\n \"2.16.840.1.101.3.4.1.23\": \"aes-192-ofb\",\n \"2.16.840.1.101.3.4.1.24\": \"aes-192-cfb\",\n \"2.16.840.1.101.3.4.1.41\": \"aes-256-ecb\",\n \"2.16.840.1.101.3.4.1.42\": \"aes-256-cbc\",\n \"2.16.840.1.101.3.4.1.43\": \"aes-256-ofb\",\n \"2.16.840.1.101.3.4.1.44\": \"aes-256-cfb\"\n };\n }\n}), require_fixProc = __commonJS({\n \"node_modules/parse-asn1/fixProc.js\"(exports, module) {\n var findProc = /Proc-Type: 4,ENCRYPTED[\\n\\r]+DEK-Info: AES-((\?:128)|(\?:192)|(\?:256))-CBC,([0-9A-H]+)[\\n\\r]+([0-9A-z\\n\\r+/=]+)[\\n\\r]+/m, startRegex = /^-----BEGIN ((\?:.*\? KEY)|CERTIFICATE)-----/m, fullRegex = /^-----BEGIN ((\?:.*\? KEY)|CERTIFICATE)-----([0-9A-z\\n\\r+/=]+)-----END \\1-----$/m, evp = require_evp_bytestokey(), ciphers = require_browser5(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(okey, password) {\n var key2 = okey.toString(), match = key2.match(findProc), decrypted;\n if (match) {\n var suite = \"aes\" + match[1], iv = Buffer2.from(match[2], \"hex\"), cipherText = Buffer2.from(match[3].replace(/[\\r\\n]/g, \"\"), \"base64\"), cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key, out = [], cipher = ciphers.createDecipheriv(suite, cipherKey, iv);\n out.push(cipher.update(cipherText)), out.push(cipher.final()), decrypted = Buffer2.concat(out);\n } else {\n var match2 = key2.match(fullRegex);\n decrypted = Buffer2.from(match2[2].replace(/[\\r\\n]/g, \"\"), \"base64\");\n }\n var tag = key2.match(startRegex)[1];\n return {\n tag,\n data: decrypted\n };\n };\n }\n}), require_parse_asn1 = __commonJS({\n \"node_modules/parse-asn1/index.js\"(exports, module) {\n var asn1 = require_asn12(), aesid = require_aesid(), fixProc = require_fixProc(), ciphers = require_browser5(), compat = require_browser4(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = parseKeys;\n function parseKeys(buffer) {\n var password;\n if (buffer instanceof KeyObject)\n buffer = buffer.export();\n else if (buffer instanceof CryptoKey)\n buffer = KeyObject.from(buffer).export();\n else if (typeof buffer == \"object\" && !Buffer2.isBuffer(buffer)) {\n if (password = buffer.passphrase, buffer = buffer.key, buffer instanceof KeyObject) {\n var options;\n switch (buffer.type) {\n case \"secret\":\n options = {\n format: \"buffer\"\n };\n break;\n case \"public\":\n options = {\n format: \"pem\",\n type: \"spki\",\n passphrase: password\n };\n break;\n case \"private\":\n options = {\n format: \"pem\",\n type: \"pkcs8\",\n passphrase: password\n };\n break;\n }\n buffer = buffer.export(options);\n } else if (buffer instanceof CryptoKey) {\n var options;\n switch (buffer.type) {\n case \"secret\":\n options = {\n format: \"buffer\"\n };\n break;\n case \"public\":\n options = {\n format: \"pem\",\n type: \"spki\",\n passphrase: password\n };\n break;\n case \"private\":\n options = {\n format: \"pem\",\n type: \"pkcs8\",\n passphrase: password\n };\n break;\n }\n buffer = KeyObject.from(buffer).export(options);\n }\n }\n typeof buffer == \"string\" && (buffer = Buffer2.from(buffer));\n var stripped = fixProc(buffer, password), type = stripped.tag, data = stripped.data, subtype, ndata;\n switch (type) {\n case \"CERTIFICATE\":\n ndata = asn1.certificate.decode(data, \"der\").tbsCertificate.subjectPublicKeyInfo;\n case \"PUBLIC KEY\":\n switch (ndata || (ndata = asn1.PublicKey.decode(data, \"der\")), subtype = ndata.algorithm.algorithm.join(\".\"), subtype) {\n case \"1.2.840.113549.1.1.1\":\n return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, \"der\");\n case \"1.2.840.10045.2.1\":\n return ndata.subjectPrivateKey = ndata.subjectPublicKey, {\n type: \"ec\",\n data: ndata\n };\n case \"1.2.840.10040.4.1\":\n return ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, \"der\"), {\n type: \"dsa\",\n data: ndata.algorithm.params\n };\n default:\n throw new Error(\"unknown key id \" + subtype);\n }\n case \"ENCRYPTED PRIVATE KEY\":\n data = asn1.EncryptedPrivateKey.decode(data, \"der\"), data = decrypt(data, password);\n case \"PRIVATE KEY\":\n switch (ndata = asn1.PrivateKey.decode(data, \"der\"), subtype = ndata.algorithm.algorithm.join(\".\"), subtype) {\n case \"1.2.840.113549.1.1.1\":\n return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, \"der\");\n case \"1.2.840.10045.2.1\":\n return {\n curve: ndata.algorithm.curve,\n privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, \"der\").privateKey\n };\n case \"1.2.840.10040.4.1\":\n return ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, \"der\"), {\n type: \"dsa\",\n params: ndata.algorithm.params\n };\n default:\n throw new Error(\"unknown key id \" + subtype);\n }\n case \"RSA PUBLIC KEY\":\n return asn1.RSAPublicKey.decode(data, \"der\");\n case \"RSA PRIVATE KEY\":\n return asn1.RSAPrivateKey.decode(data, \"der\");\n case \"DSA PRIVATE KEY\":\n return {\n type: \"dsa\",\n params: asn1.DSAPrivateKey.decode(data, \"der\")\n };\n case \"EC PRIVATE KEY\":\n return data = asn1.ECPrivateKey.decode(data, \"der\"), {\n curve: data.parameters.value,\n privateKey: data.privateKey\n };\n default:\n throw new Error(\"unknown key type \" + type);\n }\n }\n parseKeys.signature = asn1.signature;\n function decrypt(data, password) {\n var salt = data.algorithm.decrypt.kde.kdeparams.salt, iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10), algo = aesid[data.algorithm.decrypt.cipher.algo.join(\".\")], iv = data.algorithm.decrypt.cipher.iv, cipherText = data.subjectPrivateKey, keylen = parseInt(algo.split(\"-\")[1], 10) / 8, key2 = compat.pbkdf2Sync(password, salt, iters, keylen, \"sha1\"), cipher = ciphers.createDecipheriv(algo, key2, iv), out = [];\n return out.push(cipher.update(cipherText)), out.push(cipher.final()), Buffer2.concat(out);\n }\n }\n}), require_curves2 = __commonJS({\n \"node_modules/browserify-sign/browser/curves.json\"(exports, module) {\n module.exports = {\n \"1.3.132.0.10\": \"secp256k1\",\n \"1.3.132.0.33\": \"p224\",\n \"1.2.840.10045.3.1.1\": \"p192\",\n \"1.2.840.10045.3.1.7\": \"p256\",\n \"1.3.132.0.34\": \"p384\",\n \"1.3.132.0.35\": \"p521\"\n };\n }\n}), require_sign = __commonJS({\n \"node_modules/browserify-sign/browser/sign.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, createHmac = require_browser3(), crt = require_browserify_rsa(), EC = require_elliptic().ec, BN = require_bn3(), parseKeys = require_parse_asn1(), curves = require_curves2();\n function sign(hash, key2, hashType, signType, tag) {\n var priv = parseKeys(getKeyFrom(key2, \"private\"));\n if (priv.curve) {\n if (signType !== \"ecdsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong private key type\");\n return ecSign(hash, priv);\n } else if (priv.type === \"dsa\") {\n if (signType !== \"dsa\")\n throw new Error(\"wrong private key type\");\n return dsaSign(hash, priv, hashType);\n } else if (signType !== \"rsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong private key type\");\n hash = Buffer2.concat([tag, hash]);\n for (var len = priv.modulus.byteLength(), pad = [0, 1];hash.length + pad.length + 1 < len; )\n pad.push(255);\n pad.push(0);\n for (var i = -1;++i < hash.length; )\n pad.push(hash[i]);\n var out = crt(pad, priv);\n return out;\n }\n function ecSign(hash, priv) {\n var curveId = curves[priv.curve.join(\".\")];\n if (!curveId)\n throw new Error(\"unknown curve \" + priv.curve.join(\".\"));\n var curve = new EC(curveId), key2 = curve.keyFromPrivate(priv.privateKey), out = key2.sign(hash);\n return Buffer2.from(out.toDER());\n }\n function dsaSign(hash, priv, algo) {\n for (var x = priv.params.priv_key, p = priv.params.p, q = priv.params.q, g = priv.params.g, r = new BN(0), k, H = bits2int(hash, q).mod(q), s = !1, kv = getKey(x, q, hash, algo);s === !1; )\n k = makeKey(q, kv, algo), r = makeR(g, k, p, q), s = k.invm(q).imul(H.add(x.mul(r))).mod(q), s.cmpn(0) === 0 && (s = !1, r = new BN(0));\n return toDER(r, s);\n }\n function toDER(r, s) {\n r = r.toArray(), s = s.toArray(), r[0] & 128 && (r = [0].concat(r)), s[0] & 128 && (s = [0].concat(s));\n var total = r.length + s.length + 4, res = [48, total, 2, r.length];\n return res = res.concat(r, [2, s.length], s), Buffer2.from(res);\n }\n function getKey(x, q, hash, algo) {\n if (x = Buffer2.from(x.toArray()), x.length < q.byteLength()) {\n var zeros = Buffer2.alloc(q.byteLength() - x.length);\n x = Buffer2.concat([zeros, x]);\n }\n var hlen = hash.length, hbits = bits2octets(hash, q), v = Buffer2.alloc(hlen);\n v.fill(1);\n var k = Buffer2.alloc(hlen);\n return k = createHmac(algo, k).update(v).update(Buffer2.from([0])).update(x).update(hbits).digest(), v = createHmac(algo, k).update(v).digest(), k = createHmac(algo, k).update(v).update(Buffer2.from([1])).update(x).update(hbits).digest(), v = createHmac(algo, k).update(v).digest(), { k, v };\n }\n function bits2int(obits, q) {\n var bits = new BN(obits), shift = (obits.length << 3) - q.bitLength();\n return shift > 0 && bits.ishrn(shift), bits;\n }\n function bits2octets(bits, q) {\n bits = bits2int(bits, q), bits = bits.mod(q);\n var out = Buffer2.from(bits.toArray());\n if (out.length < q.byteLength()) {\n var zeros = Buffer2.alloc(q.byteLength() - out.length);\n out = Buffer2.concat([zeros, out]);\n }\n return out;\n }\n function makeKey(q, kv, algo) {\n var t, k;\n do {\n for (t = Buffer2.alloc(0);t.length * 8 < q.bitLength(); )\n kv.v = createHmac(algo, kv.k).update(kv.v).digest(), t = Buffer2.concat([t, kv.v]);\n k = bits2int(t, q), kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer2.from([0])).digest(), kv.v = createHmac(algo, kv.k).update(kv.v).digest();\n } while (k.cmp(q) !== -1);\n return k;\n }\n function makeR(g, k, p, q) {\n return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q);\n }\n module.exports = sign, module.exports.getKey = getKey, module.exports.makeKey = makeKey;\n }\n}), require_verify = __commonJS({\n \"node_modules/browserify-sign/browser/verify.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, BN = require_bn3(), EC = require_elliptic().ec, parseKeys = require_parse_asn1(), curves = require_curves2();\n function verify(sig, hash, key2, signType, tag) {\n var pub = parseKeys(getKeyFrom(key2, \"public\"));\n if (pub.type === \"ec\") {\n if (signType !== \"ecdsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong public key type\");\n return ecVerify(sig, hash, pub);\n } else if (pub.type === \"dsa\") {\n if (signType !== \"dsa\")\n throw new Error(\"wrong public key type\");\n return dsaVerify(sig, hash, pub);\n } else if (signType !== \"rsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong public key type\");\n hash = Buffer2.concat([tag, hash]);\n for (var len = pub.modulus.byteLength(), pad = [1], padNum = 0;hash.length + pad.length + 2 < len; )\n pad.push(255), padNum++;\n pad.push(0);\n for (var i = -1;++i < hash.length; )\n pad.push(hash[i]);\n pad = Buffer2.from(pad);\n var red = BN.mont(pub.modulus);\n sig = new BN(sig).toRed(red), sig = sig.redPow(new BN(pub.publicExponent)), sig = Buffer2.from(sig.fromRed().toArray());\n var out = padNum < 8 \? 1 : 0;\n for (len = Math.min(sig.length, pad.length), sig.length !== pad.length && (out = 1), i = -1;++i < len; )\n out |= sig[i] ^ pad[i];\n return out === 0;\n }\n function ecVerify(sig, hash, pub) {\n var curveId = curves[pub.data.algorithm.curve.join(\".\")];\n if (!curveId)\n throw new Error(\"unknown curve \" + pub.data.algorithm.curve.join(\".\"));\n var curve = new EC(curveId), pubkey = pub.data.subjectPrivateKey.data;\n return curve.verify(hash, sig, pubkey);\n }\n function dsaVerify(sig, hash, pub) {\n var p = pub.data.p, q = pub.data.q, g = pub.data.g, y = pub.data.pub_key, unpacked = parseKeys.signature.decode(sig, \"der\"), s = unpacked.s, r = unpacked.r;\n checkValue(s, q), checkValue(r, q);\n var montp = BN.mont(p), w = s.invm(q), v = g.toRed(montp).redPow(new BN(hash).mul(w).mod(q)).fromRed().mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed()).mod(p).mod(q);\n return v.cmp(r) === 0;\n }\n function checkValue(b, q) {\n if (b.cmpn(0) <= 0)\n throw new Error(\"invalid sig\");\n if (b.cmp(q) >= q)\n throw new Error(\"invalid sig\");\n }\n module.exports = verify;\n }\n}), require_browser8 = __commonJS({\n \"node_modules/browserify-sign/browser/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, createHash = require_browser2(), inherits = require_inherits_browser(), sign = require_sign(), verify = require_verify(), algorithms = require_algorithms();\n Object.keys(algorithms).forEach(function(key2) {\n algorithms[key2].id = Buffer2.from(algorithms[key2].id, \"hex\"), algorithms[key2.toLowerCase()] = algorithms[key2];\n });\n function Sign(algorithm) {\n if (typeof algorithm === \"string\")\n algorithm = algorithm.toLowerCase();\n StreamModule.Writable.@call(this);\n var data = algorithms[algorithm];\n if (!data)\n throw new Error(\"Unknown message digest\");\n this._hashType = data.hash, this._hash = createHash(data.hash), this._tag = data.id, this._signType = data.sign;\n }\n inherits(Sign, StreamModule.Writable), Sign.prototype._write = function(data, _, done) {\n this._hash.update(data), done();\n }, Sign.prototype.update = function(data, enc) {\n return typeof data == \"string\" && (data = Buffer2.from(data, enc)), this._hash.update(data), this;\n }, Sign.prototype.sign = function(key2, enc) {\n this.end();\n var hash = this._hash.digest(), sig = sign(hash, key2, this._hashType, this._signType, this._tag);\n return enc \? sig.toString(enc) : sig;\n };\n function Verify(algorithm) {\n if (StreamModule.Writable.@call(this), typeof algorithm === \"string\")\n algorithm = algorithm.toLowerCase();\n var data = algorithms[algorithm];\n if (!data)\n throw new Error(\"Unknown message digest\");\n this._hash = createHash(data.hash), this._tag = data.id, this._signType = data.sign;\n }\n inherits(Verify, StreamModule.Writable), Verify.prototype._write = function(data, _, done) {\n this._hash.update(data), done();\n }, Verify.prototype.update = function(data, enc) {\n return typeof data == \"string\" && (data = Buffer2.from(data, enc)), this._hash.update(data), this;\n }, Verify.prototype.verify = function(key2, sig, enc) {\n typeof sig == \"string\" && (sig = Buffer2.from(sig, enc)), this.end();\n var hash = this._hash.digest();\n return verify(sig, hash, key2, this._signType, this._tag);\n };\n function createSign(algorithm) {\n return new Sign(algorithm);\n }\n function createVerify(algorithm) {\n return new Verify(algorithm);\n }\n module.exports = {\n Sign: createSign,\n Verify: createVerify,\n createSign,\n createVerify\n };\n }\n}), require_bn6 = require_bn, require_browser9 = __commonJS({\n \"node_modules/create-ecdh/browser.js\"(exports, module) {\n var elliptic = require_elliptic(), BN = require_bn6();\n module.exports = function(curve) {\n return new ECDH(curve);\n };\n var aliases = {\n secp256k1: {\n name: \"secp256k1\",\n byteLength: 32\n },\n secp224r1: {\n name: \"p224\",\n byteLength: 28\n },\n prime256v1: {\n name: \"p256\",\n byteLength: 32\n },\n prime192v1: {\n name: \"p192\",\n byteLength: 24\n },\n ed25519: {\n name: \"ed25519\",\n byteLength: 32\n },\n secp384r1: {\n name: \"p384\",\n byteLength: 48\n },\n secp521r1: {\n name: \"p521\",\n byteLength: 66\n }\n };\n aliases.p224 = aliases.secp224r1, aliases.p256 = aliases.secp256r1 = aliases.prime256v1, aliases.p192 = aliases.secp192r1 = aliases.prime192v1, aliases.p384 = aliases.secp384r1, aliases.p521 = aliases.secp521r1;\n function ECDH(curve) {\n this.curveType = aliases[curve], this.curveType || (this.curveType = {\n name: curve\n }), this.curve = new elliptic.ec(this.curveType.name), this.keys = void 0;\n }\n ECDH.prototype = {}, ECDH.prototype.generateKeys = function(enc, format) {\n return this.keys = this.curve.genKeyPair(), this.getPublicKey(enc, format);\n }, ECDH.prototype.computeSecret = function(other, inenc, enc) {\n inenc = inenc || \"utf8\", Buffer.isBuffer(other) || (other = new Buffer(other, inenc));\n var otherPub = this.curve.keyFromPublic(other).getPublic(), out = otherPub.mul(this.keys.getPrivate()).getX();\n return formatReturnValue(out, enc, this.curveType.byteLength);\n }, ECDH.prototype.getPublicKey = function(enc, format) {\n var key2 = this.keys.getPublic(format === \"compressed\", !0);\n return format === \"hybrid\" && (key2[key2.length - 1] % 2 \? key2[0] = 7 : key2[0] = 6), formatReturnValue(key2, enc);\n }, ECDH.prototype.getPrivateKey = function(enc) {\n return formatReturnValue(this.keys.getPrivate(), enc);\n }, ECDH.prototype.setPublicKey = function(pub, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(pub) || (pub = new Buffer(pub, enc)), this.keys._importPublic(pub), this;\n }, ECDH.prototype.setPrivateKey = function(priv, enc) {\n enc = enc || \"utf8\", Buffer.isBuffer(priv) || (priv = new Buffer(priv, enc));\n var _priv = new BN(priv);\n return _priv = _priv.toString(16), this.keys = this.curve.genKeyPair(), this.keys._importPrivate(_priv), this;\n };\n function formatReturnValue(bn, enc, len) {\n @Array.isArray(bn) || (bn = bn.toArray());\n var buf = new Buffer(bn);\n if (len && buf.length < len) {\n var zeros = new Buffer(len - buf.length);\n zeros.fill(0), buf = Buffer.concat([zeros, buf]);\n }\n return enc \? buf.toString(enc) : buf;\n }\n }\n}), require_mgf = __commonJS({\n \"node_modules/public-encrypt/mgf.js\"(exports, module) {\n var createHash = require_browser2(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(seed, len) {\n for (var t = Buffer2.alloc(0), i = 0, c;t.length < len; )\n c = i2ops(i++), t = Buffer2.concat([t, createHash(\"sha1\").update(seed).update(c).digest()]);\n return t.slice(0, len);\n };\n function i2ops(c) {\n var out = Buffer2.allocUnsafe(4);\n return out.writeUInt32BE(c, 0), out;\n }\n }\n}), require_xor = __commonJS({\n \"node_modules/public-encrypt/xor.js\"(exports, module) {\n module.exports = function(a, b) {\n for (var len = a.length, i = -1;++i < len; )\n a[i] ^= b[i];\n return a;\n };\n }\n}), require_bn7 = require_bn, { CryptoHasher } = globalThis.Bun, require_withPublic = __commonJS({\n \"node_modules/public-encrypt/withPublic.js\"(exports, module) {\n var BN = require_bn7(), Buffer2 = require_safe_buffer().Buffer;\n function withPublic(paddedMsg, key2) {\n return Buffer2.from(paddedMsg.toRed(BN.mont(key2.modulus)).redPow(new BN(key2.publicExponent)).fromRed().toArray());\n }\n module.exports = withPublic;\n }\n}), require_publicEncrypt = __commonJS({\n \"node_modules/public-encrypt/publicEncrypt.js\"(exports, module) {\n var parseKeys = require_parse_asn1(), randomBytes = require_browser(), createHash = require_browser2(), mgf = require_mgf(), xor = require_xor(), BN = require_bn7(), withPublic = require_withPublic(), crt = require_browserify_rsa(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(publicKey, msg, reverse) {\n var padding;\n publicKey.padding \? padding = publicKey.padding : reverse \? padding = 1 : padding = 4;\n var key2 = parseKeys(publicKey), paddedMsg;\n if (padding === 4)\n paddedMsg = oaep(key2, msg);\n else if (padding === 1)\n paddedMsg = pkcs1(key2, msg, reverse);\n else if (padding === 3) {\n if (paddedMsg = new BN(msg), paddedMsg.cmp(key2.modulus) >= 0)\n throw new Error(\"data too long for modulus\");\n } else\n throw new Error(\"unknown padding\");\n return reverse \? crt(paddedMsg, key2) : withPublic(paddedMsg, key2);\n };\n function oaep(key2, msg) {\n var k = key2.modulus.byteLength(), mLen = msg.length, iHash = createHash(\"sha1\").update(Buffer2.alloc(0)).digest(), hLen = iHash.length, hLen2 = 2 * hLen;\n if (mLen > k - hLen2 - 2)\n throw new Error(\"message too long\");\n var ps = Buffer2.alloc(k - mLen - hLen2 - 2), dblen = k - hLen - 1, seed = randomBytes(hLen), maskedDb = xor(Buffer2.concat([iHash, ps, Buffer2.alloc(1, 1), msg], dblen), mgf(seed, dblen)), maskedSeed = xor(seed, mgf(maskedDb, hLen));\n return new BN(Buffer2.concat([Buffer2.alloc(1), maskedSeed, maskedDb], k));\n }\n function pkcs1(key2, msg, reverse) {\n var mLen = msg.length, k = key2.modulus.byteLength();\n if (mLen > k - 11)\n throw new Error(\"message too long\");\n var ps;\n return reverse \? ps = Buffer2.alloc(k - mLen - 3, 255) : ps = nonZero(k - mLen - 3), new BN(Buffer2.concat([Buffer2.from([0, reverse \? 1 : 2]), ps, Buffer2.alloc(1), msg], k));\n }\n function nonZero(len) {\n for (var out = Buffer2.allocUnsafe(len), i = 0, cache = randomBytes(len * 2), cur = 0, num;i < len; )\n cur === cache.length && (cache = randomBytes(len * 2), cur = 0), num = cache[cur++], num && (out[i++] = num);\n return out;\n }\n }\n}), require_privateDecrypt = __commonJS({\n \"node_modules/public-encrypt/privateDecrypt.js\"(exports, module) {\n var parseKeys = require_parse_asn1(), mgf = require_mgf(), xor = require_xor(), BN = require_bn7(), crt = require_browserify_rsa(), createHash = require_browser2(), withPublic = require_withPublic(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(privateKey, enc, reverse) {\n var padding;\n privateKey.padding \? padding = privateKey.padding : reverse \? padding = 1 : padding = 4;\n var key2 = parseKeys(privateKey), k = key2.modulus.byteLength();\n if (enc.length > k || new BN(enc).cmp(key2.modulus) >= 0)\n throw new Error(\"decryption error\");\n var msg;\n reverse \? msg = withPublic(new BN(enc), key2) : msg = crt(enc, key2);\n var zBuffer = Buffer2.alloc(k - msg.length);\n if (msg = Buffer2.concat([zBuffer, msg], k), padding === 4)\n return oaep(key2, msg);\n if (padding === 1)\n return pkcs1(key2, msg, reverse);\n if (padding === 3)\n return msg;\n throw new Error(\"unknown padding\");\n };\n function oaep(key2, msg) {\n var k = key2.modulus.byteLength(), iHash = createHash(\"sha1\").update(Buffer2.alloc(0)).digest(), hLen = iHash.length;\n if (msg[0] !== 0)\n throw new Error(\"decryption error\");\n var maskedSeed = msg.slice(1, hLen + 1), maskedDb = msg.slice(hLen + 1), seed = xor(maskedSeed, mgf(maskedDb, hLen)), db = xor(maskedDb, mgf(seed, k - hLen - 1));\n if (compare(iHash, db.slice(0, hLen)))\n throw new Error(\"decryption error\");\n for (var i = hLen;db[i] === 0; )\n i++;\n if (db[i++] !== 1)\n throw new Error(\"decryption error\");\n return db.slice(i);\n }\n function pkcs1(key2, msg, reverse) {\n for (var p1 = msg.slice(0, 2), i = 2, status = 0;msg[i++] !== 0; )\n if (i >= msg.length) {\n status++;\n break;\n }\n var ps = msg.slice(2, i - 1);\n if ((p1.toString(\"hex\") !== \"0002\" && !reverse || p1.toString(\"hex\") !== \"0001\" && reverse) && status++, ps.length < 8 && status++, status)\n throw new Error(\"decryption error\");\n return msg.slice(i);\n }\n function compare(a, b) {\n a = Buffer2.from(a), b = Buffer2.from(b);\n var dif = 0, len = a.length;\n a.length !== b.length && (dif++, len = Math.min(a.length, b.length));\n for (var i = -1;++i < len; )\n dif += a[i] ^ b[i];\n return dif;\n }\n }\n}), require_browser10 = __commonJS({\n \"node_modules/public-encrypt/browser.js\"(exports) {\n var publicEncrypt = require_publicEncrypt();\n exports.publicEncrypt = function(key2, buf, options) {\n return publicEncrypt(getKeyFrom(key2, \"public\"), buf, options);\n };\n var privateDecrypt = require_privateDecrypt();\n exports.privateDecrypt = function(key2, buf, options) {\n return privateDecrypt(getKeyFrom(key2, \"private\"), buf, options);\n }, exports.privateEncrypt = function(key2, buf) {\n return publicEncrypt(getKeyFrom(key2, \"private\"), buf, !0);\n }, exports.publicDecrypt = function(key2, buf) {\n return privateDecrypt(getKeyFrom(key2, \"public\"), buf, !0);\n };\n }\n}), require_browser11 = __commonJS({\n \"node_modules/randomfill/browser.js\"(exports) {\n var safeBuffer = require_safe_buffer(), randombytes = require_browser(), Buffer2 = safeBuffer.Buffer, kBufferMaxLength = safeBuffer.kMaxLength, kMaxUint32 = Math.pow(2, 32) - 1;\n function assertOffset(offset, length) {\n if (typeof offset != \"number\" || offset !== offset)\n @throwTypeError(\"offset must be a number\");\n if (offset > kMaxUint32 || offset < 0)\n @throwTypeError(\"offset must be a uint32\");\n if (offset > kBufferMaxLength || offset > length)\n @throwRangeError(\"offset out of range\");\n }\n function assertSize(size, offset, length) {\n if (typeof size != \"number\" || size !== size)\n @throwTypeError(\"size must be a number\");\n if (size > kMaxUint32 || size < 0)\n @throwTypeError(\"size must be a uint32\");\n if (size + offset > length || size > kBufferMaxLength)\n @throwRangeError(\"buffer too small\");\n }\n exports.randomFill = randomFill, exports.randomFillSync = randomFillSync;\n function randomFill(buf, offset, size, cb) {\n if (!Buffer2.isBuffer(buf) && !(buf instanceof global.Uint8Array))\n @throwTypeError('\"buf\" argument must be a Buffer or Uint8Array');\n if (typeof offset == \"function\")\n cb = offset, offset = 0, size = buf.length;\n else if (typeof size == \"function\")\n cb = size, size = buf.length - offset;\n else if (typeof cb != \"function\")\n @throwTypeError('\"cb\" argument must be a function');\n return assertOffset(offset, buf.length), assertSize(size, offset, buf.length), actualFill(buf, offset, size, cb);\n }\n function actualFill(buf, offset, size, cb) {\n if (cb) {\n randombytes(size, function(err, bytes2) {\n if (err)\n return cb(err);\n bytes2.copy(buf, offset), cb(null, buf);\n });\n return;\n }\n var bytes = randombytes(size);\n return bytes.copy(buf, offset), buf;\n }\n function randomFillSync(buf, offset, size) {\n if (typeof offset > \"u\" && (offset = 0), !Buffer2.isBuffer(buf) && !(buf instanceof global.Uint8Array))\n @throwTypeError('\"buf\" argument must be a Buffer or Uint8Array');\n return assertOffset(offset, buf.length), size === void 0 && (size = buf.length - offset), assertSize(size, offset, buf.length), actualFill(buf, offset, size);\n }\n }\n}), require_crypto_browserify2 = __commonJS({\n \"node_modules/crypto-browserify/index.js\"(exports) {\n exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require_browser(), exports.createHash = require_browser2(), exports.Hash = exports.createHash.Hash, exports.createHmac = exports.Hmac = require_browser3();\n var algos = require_algos(), algoKeys = Object.keys(algos), hashes = [\"sha1\", \"sha224\", \"sha256\", \"sha384\", \"sha512\", \"md5\", \"rmd160\"].concat(algoKeys);\n exports.getHashes = function() {\n return hashes;\n };\n var p = require_browser4();\n exports.pbkdf2 = p.pbkdf2, exports.pbkdf2Sync = p.pbkdf2Sync;\n var aes = require_browser6();\n exports.Cipher = aes.Cipher, exports.createCipher = aes.createCipher, exports.Cipheriv = aes.Cipheriv, exports.createCipheriv = aes.createCipheriv, exports.Decipher = aes.Decipher, exports.createDecipher = aes.createDecipher, exports.Decipheriv = aes.Decipheriv, exports.createDecipheriv = aes.createDecipheriv, exports.getCiphers = aes.getCiphers, exports.listCiphers = aes.listCiphers;\n var dh = require_browser7();\n exports.DiffieHellmanGroup = dh.DiffieHellmanGroup, exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup, exports.getDiffieHellman = dh.getDiffieHellman, exports.createDiffieHellman = dh.createDiffieHellman, exports.DiffieHellman = dh.DiffieHellman;\n var sign = require_browser8();\n exports.createSign = sign.createSign, exports.Sign = sign.Sign, exports.createVerify = sign.createVerify, exports.Verify = sign.Verify, exports.createECDH = require_browser9();\n var publicEncrypt = require_browser10();\n exports.publicEncrypt = publicEncrypt.publicEncrypt, exports.privateEncrypt = publicEncrypt.privateEncrypt, exports.publicDecrypt = publicEncrypt.publicDecrypt, exports.privateDecrypt = publicEncrypt.privateDecrypt, exports.getRandomValues = (values) => crypto.getRandomValues(values);\n var rf = require_browser11();\n exports.randomFill = rf.randomFill, exports.randomFillSync = rf.randomFillSync, exports.createCredentials = function() {\n throw new Error([\n \"sorry, createCredentials is not implemented yet\",\n \"we accept pull requests\",\n \"https://github.com/crypto-browserify/crypto-browserify\"\n ].join(`\n`));\n }, exports.constants = @processBindingConstants.crypto;\n }\n}), crypto_exports = require_crypto_browserify2(), DEFAULT_ENCODING = \"buffer\", getRandomValues = (array) => crypto.getRandomValues(array), randomUUID = () => crypto.randomUUID(), randomInt = (...args) => crypto.randomInt(...args), timingSafeEqual = \"timingSafeEqual\" in crypto \? (a, b) => {\n let { byteLength: byteLengthA } = a, { byteLength: byteLengthB } = b;\n if (typeof byteLengthA != \"number\" || typeof byteLengthB != \"number\")\n @throwTypeError(\"Input must be an array buffer view\");\n if (byteLengthA !== byteLengthB)\n @throwRangeError(\"Input buffers must have the same length\");\n return crypto.timingSafeEqual(a, b);\n} : void 0, scryptSync = \"scryptSync\" in crypto \? (password, salt, keylen, options) => {\n let res = crypto.scryptSync(password, salt, keylen, options);\n return DEFAULT_ENCODING !== \"buffer\" \? new Buffer(res).toString(DEFAULT_ENCODING) : new Buffer(res);\n} : void 0, scrypt = \"scryptSync\" in crypto \? function(password, salt, keylen, options, callback) {\n if (typeof options == \"function\" && (callback = options, options = void 0), typeof callback != \"function\") {\n var err = @makeTypeError(\"callback must be a function\");\n throw err.code = \"ERR_INVALID_CALLBACK\", err;\n }\n try {\n let result = crypto.scryptSync(password, salt, keylen, options);\n process.nextTick(callback, null, DEFAULT_ENCODING !== \"buffer\" \? new Buffer(result).toString(DEFAULT_ENCODING) : new Buffer(result));\n } catch (err2) {\n throw err2;\n }\n} : void 0;\ntimingSafeEqual && (Object.defineProperty(timingSafeEqual, \"name\", {\n value: \"::bunternal::\"\n}), Object.defineProperty(scrypt, \"name\", {\n value: \"::bunternal::\"\n}), Object.defineProperty(scryptSync, \"name\", {\n value: \"::bunternal::\"\n}));\nvar harcoded_curves = [\n \"p192\",\n \"p224\",\n \"p256\",\n \"p384\",\n \"p521\",\n \"curve25519\",\n \"ed25519\",\n \"secp256k1\",\n \"secp224r1\",\n \"prime256v1\",\n \"prime192v1\",\n \"ed25519\",\n \"secp384r1\",\n \"secp521r1\"\n], {\n symmetricKeySize,\n asymmetricKeyDetails,\n asymmetricKeyType,\n equals,\n exports,\n createSecretKey,\n createPublicKey,\n createPrivateKey,\n generateKeySync,\n generateKeyPairSync\n} = @lazy(\"internal/crypto\"), kCryptoKey = Symbol.for(\"::bunKeyObjectCryptoKey::\");\n\nclass KeyObject {\n [kCryptoKey];\n constructor(key2) {\n if (typeof key2 !== \"object\")\n @throwTypeError('The \"key\" argument must be an instance of CryptoKey.');\n this[kCryptoKey] = key2;\n }\n toString() {\n return \"[object KeyObject]\";\n }\n static from(key2) {\n if (key2 instanceof KeyObject)\n key2 = key2[kCryptoKey];\n return new KeyObject(key2);\n }\n get asymmetricKeyDetails() {\n return asymmetricKeyDetails(this[kCryptoKey]);\n }\n get symmetricKeySize() {\n return symmetricKeySize(this[kCryptoKey]);\n }\n get asymmetricKeyType() {\n return asymmetricKeyType(this[kCryptoKey]);\n }\n [\"export\"](options) {\n switch (arguments.length) {\n case 0:\n switch (this.type) {\n case \"secret\":\n options = {\n format: \"buffer\"\n };\n break;\n case \"public\":\n options = {\n format: \"pem\",\n type: \"spki\"\n };\n break;\n case \"private\":\n options = {\n format: \"pem\",\n type: \"pkcs8\"\n };\n break;\n }\n break;\n case 1:\n if (typeof options === \"object\" && !options.format)\n switch (this.type) {\n case \"secret\":\n options.format = \"buffer\";\n break;\n default:\n options.format = \"pem\";\n break;\n }\n }\n return exports(this[kCryptoKey], options);\n }\n equals(otherKey) {\n if (!(otherKey instanceof KeyObject))\n @throwTypeError(\"otherKey must be a KeyObject\");\n return equals(this[kCryptoKey], otherKey[kCryptoKey]);\n }\n get type() {\n return this[kCryptoKey].type;\n }\n}\ncrypto_exports.generateKeySync = function(algorithm, options) {\n return KeyObject.from(generateKeySync(algorithm, options\?.length));\n};\ncrypto_exports.generateKey = function(algorithm, options, callback) {\n try {\n const key2 = KeyObject.from(generateKeySync(algorithm, options\?.length));\n typeof callback === \"function\" && callback(null, KeyObject.from(key2));\n } catch (err) {\n typeof callback === \"function\" && callback(err);\n }\n};\ncrypto_exports.generateKeyPairSync = _generateKeyPairSync;\ncrypto_exports.generateKeyPair = function(algorithm, options, callback) {\n try {\n const result = _generateKeyPairSync(algorithm, options);\n typeof callback === \"function\" && callback(null, result.publicKey, result.privateKey);\n } catch (err) {\n typeof callback === \"function\" && callback(err);\n }\n};\ncrypto_exports.createSecretKey = function(key2, encoding) {\n if (key2 instanceof KeyObject || key2 instanceof CryptoKey) {\n if (key2.type !== \"secret\") {\n const error = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key2.type}, expected secret`);\n throw error.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error;\n }\n return KeyObject.from(key2);\n }\n const buffer = getArrayBufferOrView(key2, encoding || \"utf8\");\n return KeyObject.from(createSecretKey(buffer));\n};\ncrypto_exports.createPrivateKey = _createPrivateKey;\ncrypto_exports.createPublicKey = _createPublicKey;\ncrypto_exports.KeyObject = KeyObject;\nvar _createSign = crypto_exports.createSign;\ncrypto_exports.sign = function(algorithm, data, key2, encoding, callback) {\n if (typeof callback === \"function\")\n try {\n const result = _createSign(algorithm).update(data, encoding).sign(key2, encoding);\n callback(null, result);\n } catch (err) {\n callback(err);\n }\n else\n return _createSign(algorithm).update(data, encoding).sign(key2, encoding);\n};\nvar _createVerify = crypto_exports.createVerify;\ncrypto_exports.verify = function(algorithm, data, key2, signature, callback) {\n if (typeof callback === \"function\")\n try {\n const result = _createVerify(algorithm).update(data).verify(key2, signature);\n callback(null, result);\n } catch (err) {\n callback(err);\n }\n else\n return _createVerify(algorithm).update(data).verify(key2, signature);\n};\nvar webcrypto = crypto;\n__export(crypto_exports, {\n DEFAULT_ENCODING: () => DEFAULT_ENCODING,\n getRandomValues: () => getRandomValues,\n randomUUID: () => randomUUID,\n randomInt: () => randomInt,\n getCurves: () => getCurves,\n scrypt: () => scrypt,\n scryptSync: () => scryptSync,\n timingSafeEqual: () => timingSafeEqual,\n webcrypto: () => webcrypto,\n subtle: () => webcrypto.subtle\n});\n$ = crypto_exports;\n/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeDNSCode = "(function (){\"use strict\";// src/js/out/tmp/node/dns.ts\nvar getServers = function() {\n return dns.getServers();\n}, lookup = function(domain, options, callback) {\n if (typeof options == \"function\")\n callback = options;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n if (typeof options == \"number\")\n options = { family: options };\n dns.lookup(domain, options).then((res) => {\n if (res.sort((a, b) => a.family - b.family), options\?.all)\n callback(null, res.map(mapLookupAll));\n else {\n const [{ address, family }] = res;\n callback(null, address, family);\n }\n }, (error) => {\n callback(error);\n });\n}, resolveSrv = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveTxt = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveSoa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNaptr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveMx = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCaa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNs = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolvePtr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCname = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, lookupService = function(address, port, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n callback(null, address, port);\n}, reverse = function(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolve = function(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(({ address }) => address));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n}, Resolver = function(options) {\n return new InternalResolver(options);\n}, setDefaultResultOrder = function() {\n}, setServers = function() {\n}, $, dns = Bun.dns, InternalResolver = class Resolver2 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype, rrtype = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(mapResolveX));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n }\n resolve4(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 4 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(mapResolveX));\n }, (error) => {\n callback(error);\n });\n }\n resolve6(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 6 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(({ address }) => address));\n }, (error) => {\n callback(error);\n });\n }\n resolveAny(hostname, callback) {\n callback(null, []);\n }\n resolveCname(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveMx(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNaptr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNs(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolvePtr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSrv(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveCaa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveTxt(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSoa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n reverse(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n setServers(servers) {\n }\n};\nResolver.prototype = {};\nObject.setPrototypeOf(Resolver.prototype, InternalResolver.prototype);\nObject.setPrototypeOf(Resolver, InternalResolver);\nvar {\n resolve,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNaptr,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n reverse,\n resolveTxt\n} = InternalResolver.prototype, promisifyLookup = (res) => {\n res.sort((a, b) => a.family - b.family);\n const [{ address, family }] = res;\n return { address, family };\n}, mapLookupAll = (res) => {\n const { address, family } = res;\n return { address, family };\n}, promisifyLookupAll = (res) => {\n return res.sort((a, b) => a.family - b.family), res.map(mapLookupAll);\n}, mapResolveX = (a) => a.address, promisifyResolveX = (res) => {\n return res\?.map(mapResolveX);\n}, promises = {\n lookup(domain, options) {\n if (options\?.all)\n return dns.lookup(domain, options).then(promisifyLookupAll);\n return dns.lookup(domain, options).then(promisifyLookup);\n },\n lookupService(address, port) {\n return Promise.resolve([]);\n },\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n },\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n },\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n },\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n },\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n },\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n },\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n },\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n },\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n },\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n },\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n },\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n },\n reverse(ip) {\n return dns.reverse(ip);\n },\n Resolver: class Resolver3 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n }\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n }\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n }\n resolveAny(hostname) {\n return Promise.resolve([]);\n }\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n }\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n }\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n }\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n }\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n }\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n }\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n }\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n }\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n }\n reverse(ip) {\n return dns.reverse(ip);\n }\n setServers(servers) {\n }\n }\n};\nfor (let key of [\"resolveAny\"])\n promises[key] = () => Promise.resolve(void 0);\n$ = {\n ADDRCONFIG: 0,\n ALL: 1,\n V4MAPPED: 2,\n NODATA: \"DNS_ENODATA\",\n FORMERR: \"DNS_EFORMERR\",\n SERVFAIL: \"DNS_ESERVFAIL\",\n NOTFOUND: \"DNS_ENOTFOUND\",\n NOTIMP: \"DNS_ENOTIMP\",\n REFUSED: \"DNS_EREFUSED\",\n BADQUERY: \"DNS_EBADQUERY\",\n BADNAME: \"DNS_EBADNAME\",\n BADFAMILY: \"DNS_EBADFAMILY\",\n BADRESP: \"DNS_EBADRESP\",\n CONNREFUSED: \"DNS_ECONNREFUSED\",\n TIMEOUT: \"DNS_ETIMEOUT\",\n EOF: \"DNS_EEOF\",\n FILE: \"DNS_EFILE\",\n NOMEM: \"DNS_ENOMEM\",\n DESTRUCTION: \"DNS_EDESTRUCTION\",\n BADSTR: \"DNS_EBADSTR\",\n BADFLAGS: \"DNS_EBADFLAGS\",\n NONAME: \"DNS_ENONAME\",\n BADHINTS: \"DNS_EBADHINTS\",\n NOTINITIALIZED: \"DNS_ENOTINITIALIZED\",\n LOADIPHLPAPI: \"DNS_ELOADIPHLPAPI\",\n ADDRGETNETWORKPARAMS: \"DNS_EADDRGETNETWORKPARAMS\",\n CANCELLED: \"DNS_ECANCELLED\",\n lookup,\n lookupService,\n Resolver,\n setServers,\n setDefaultResultOrder,\n resolve,\n reverse,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n resolveTxt,\n resolveNaptr,\n promises,\n getServers\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeDgramCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/dgram.ts\nvar createSocket = function() {\n throwNotImplemented(\"node:dgram createSocket\", 1630);\n}, Socket = function() {\n throwNotImplemented(\"node:dgram Socket\", 1630);\n}, _createSocketHandle = function() {\n throwNotImplemented(\"node:dgram _createSocketHandle\", 1630);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6);\n$ = {\n createSocket,\n Socket,\n _createSocketHandle\n};\nhideFromStack(createSocket, Socket, _createSocketHandle);\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeDNSPromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/dns.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 15) || @createInternalModuleById(15)).promises})\n"_s;
+static constexpr ASCIILiteral NodeDiagnosticsChannelCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/diagnostics_channel.ts\nvar markActive = function(channel) {\n ObjectSetPrototypeOf(channel, ActiveChannel.prototype), channel._subscribers = [], channel._stores = new SafeMap;\n}, maybeMarkInactive = function(channel) {\n if (!channel._subscribers.length && !channel._stores.size)\n ObjectSetPrototypeOf(channel, Channel.prototype), channel._subscribers = @undefined, channel._stores = @undefined;\n}, defaultTransform = function(data) {\n return data;\n}, wrapStoreRun = function(store, data, next, transform = defaultTransform) {\n return () => {\n let context;\n try {\n context = transform(data);\n } catch (err) {\n return process.nextTick(() => reportError(err)), next();\n }\n return store.run(context, next);\n };\n}, channel = function(name) {\n const channel2 = channels.get(name);\n if (channel2)\n return channel2;\n if (typeof name !== \"string\" && typeof name !== \"symbol\")\n throw new ERR_INVALID_ARG_TYPE(\"channel\", [\"string\", \"symbol\"], name);\n return new Channel(name);\n}, subscribe = function(name, subscription) {\n return channel(name).subscribe(subscription);\n}, unsubscribe = function(name, subscription) {\n return channel(name).unsubscribe(subscription);\n}, hasSubscribers = function(name) {\n const channel2 = channels.get(name);\n if (!channel2)\n return !1;\n return channel2.hasSubscribers;\n}, assertChannel = function(value, name) {\n if (!(value instanceof Channel))\n throw new ERR_INVALID_ARG_TYPE(name, [\"Channel\"], value);\n}, tracingChannel = function(nameOrChannels) {\n return new TracingChannel(nameOrChannels);\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, $, SafeMap = Map, SafeFinalizationRegistry = FinalizationRegistry, ArrayPrototypeAt = (array, index) => array[index], ArrayPrototypeIndexOf = (array, value) => array.indexOf(value), ArrayPrototypePush = (array, value) => array.push(value), ArrayPrototypeSplice = (array, start, deleteCount) => array.splice(start, deleteCount), ObjectGetPrototypeOf = Object.getPrototypeOf, ObjectSetPrototypeOf = Object.setPrototypeOf, SymbolHasInstance = Symbol.hasInstance, ReflectApply = @getByIdDirect(Reflect, \"apply\"), PromiseResolve = @Promise.resolve, PromiseReject = @Promise.reject, PromisePrototypeThen = (promise, onFulfilled, onRejected) => promise.then(onFulfilled, onRejected);\n\nclass WeakReference extends WeakRef {\n constructor() {\n super(...arguments);\n }\n #refs = 0;\n get() {\n return this.deref();\n }\n incRef() {\n return ++this.#refs;\n }\n decRef() {\n return --this.#refs;\n }\n}\n\nclass WeakRefMap extends SafeMap {\n constructor() {\n super(...arguments);\n }\n #finalizers = new SafeFinalizationRegistry((key) => {\n this.delete(key);\n });\n set(key, value) {\n return this.#finalizers.register(value, key), super.set(key, new WeakReference(value));\n }\n get(key) {\n return super.get(key)\?.get();\n }\n incRef(key) {\n return super.get(key)\?.incRef();\n }\n decRef(key) {\n return super.get(key)\?.decRef();\n }\n}\n\nclass ActiveChannel {\n subscribe(subscription) {\n validateFunction(subscription, \"subscription\"), ArrayPrototypePush(this._subscribers, subscription), channels.incRef(this.name);\n }\n unsubscribe(subscription) {\n const index = ArrayPrototypeIndexOf(this._subscribers, subscription);\n if (index === -1)\n return !1;\n return ArrayPrototypeSplice(this._subscribers, index, 1), channels.decRef(this.name), maybeMarkInactive(this), !0;\n }\n bindStore(store, transform) {\n if (!this._stores.has(store))\n channels.incRef(this.name);\n this._stores.set(store, transform);\n }\n unbindStore(store) {\n if (!this._stores.has(store))\n return !1;\n return this._stores.delete(store), channels.decRef(this.name), maybeMarkInactive(this), !0;\n }\n get hasSubscribers() {\n return !0;\n }\n publish(data) {\n for (let i = 0;i < (this._subscribers\?.length || 0); i++)\n try {\n const onMessage = this._subscribers[i];\n onMessage(data, this.name);\n } catch (err) {\n process.nextTick(() => reportError(err));\n }\n }\n runStores(data, fn, thisArg, ...args) {\n let run = () => {\n return this.publish(data), ReflectApply(fn, thisArg, args);\n };\n for (let entry of this._stores.entries()) {\n const store = entry[0], transform = entry[1];\n run = wrapStoreRun(store, data, run, transform);\n }\n return run();\n }\n}\n\nclass Channel {\n constructor(name) {\n this._subscribers = @undefined, this._stores = @undefined, this.name = name, channels.set(name, this);\n }\n static [SymbolHasInstance](instance) {\n const prototype = ObjectGetPrototypeOf(instance);\n return prototype === Channel.prototype || prototype === ActiveChannel.prototype;\n }\n subscribe(subscription) {\n markActive(this), this.subscribe(subscription);\n }\n unsubscribe() {\n return !1;\n }\n bindStore(store, transform) {\n markActive(this), this.bindStore(store, transform);\n }\n unbindStore() {\n return !1;\n }\n get hasSubscribers() {\n return !1;\n }\n publish() {\n }\n runStores(data, fn, thisArg, ...args) {\n return ReflectApply(fn, thisArg, args);\n }\n}\nvar channels = new WeakRefMap, traceEvents = [\"start\", \"end\", \"asyncStart\", \"asyncEnd\", \"error\"];\n\nclass TracingChannel {\n constructor(nameOrChannels) {\n if (typeof nameOrChannels === \"string\")\n this.start = channel(`tracing:${nameOrChannels}:start`), this.end = channel(`tracing:${nameOrChannels}:end`), this.asyncStart = channel(`tracing:${nameOrChannels}:asyncStart`), this.asyncEnd = channel(`tracing:${nameOrChannels}:asyncEnd`), this.error = channel(`tracing:${nameOrChannels}:error`);\n else if (typeof nameOrChannels === \"object\") {\n const { start, end, asyncStart, asyncEnd, error } = nameOrChannels;\n assertChannel(start, \"nameOrChannels.start\"), assertChannel(end, \"nameOrChannels.end\"), assertChannel(asyncStart, \"nameOrChannels.asyncStart\"), assertChannel(asyncEnd, \"nameOrChannels.asyncEnd\"), assertChannel(error, \"nameOrChannels.error\"), this.start = start, this.end = end, this.asyncStart = asyncStart, this.asyncEnd = asyncEnd, this.error = error;\n } else\n throw new ERR_INVALID_ARG_TYPE(\"nameOrChannels\", [\"string\", \"object\", \"Channel\"], nameOrChannels);\n }\n subscribe(handlers) {\n for (let name of traceEvents) {\n if (!handlers[name])\n continue;\n this[name]\?.subscribe(handlers[name]);\n }\n }\n unsubscribe(handlers) {\n let done = !0;\n for (let name of traceEvents) {\n if (!handlers[name])\n continue;\n if (!this[name]\?.unsubscribe(handlers[name]))\n done = !1;\n }\n return done;\n }\n traceSync(fn, context = {}, thisArg, ...args) {\n const { start, end, error } = this;\n return start.runStores(context, () => {\n try {\n const result = ReflectApply(fn, thisArg, args);\n return context.result = result, result;\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n tracePromise(fn, context = {}, thisArg, ...args) {\n const { start, end, asyncStart, asyncEnd, error } = this;\n function reject(err) {\n return context.error = err, error.publish(context), asyncStart.publish(context), asyncEnd.publish(context), PromiseReject(err);\n }\n function resolve(result) {\n return context.result = result, asyncStart.publish(context), asyncEnd.publish(context), result;\n }\n return start.runStores(context, () => {\n try {\n let promise = ReflectApply(fn, thisArg, args);\n if (!(promise instanceof @Promise))\n promise = PromiseResolve(promise);\n return PromisePrototypeThen(promise, resolve, reject);\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n traceCallback(fn, position = -1, context = {}, thisArg, ...args) {\n const { start, end, asyncStart, asyncEnd, error } = this;\n function wrappedCallback(err, res) {\n if (err)\n context.error = err, error.publish(context);\n else\n context.result = res;\n asyncStart.runStores(context, () => {\n try {\n if (callback)\n return ReflectApply(callback, this, arguments);\n } finally {\n asyncEnd.publish(context);\n }\n });\n }\n const callback = ArrayPrototypeAt(args, position);\n if (typeof callback !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"callback\", [\"function\"], callback);\n return ArrayPrototypeSplice(args, position, 1, wrappedCallback), start.runStores(context, () => {\n try {\n return ReflectApply(fn, thisArg, args);\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n}\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\n$ = {\n channel,\n hasSubscribers,\n subscribe,\n tracingChannel,\n unsubscribe,\n Channel\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeDomainCode = "(function (){\"use strict\";// src/js/out/tmp/node/domain.ts\nvar EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), domain = {};\ndomain.createDomain = domain.create = function() {\n var d = new EventEmitter;\n function emitError(e) {\n d.emit(\"error\", e);\n }\n return d.add = function(emitter) {\n emitter.on(\"error\", emitError);\n }, d.remove = function(emitter) {\n emitter.removeListener(\"error\", emitError);\n }, d.bind = function(fn) {\n return function() {\n var args = Array.prototype.slice.call(arguments);\n try {\n fn.apply(null, args);\n } catch (err) {\n emitError(err);\n }\n };\n }, d.intercept = function(fn) {\n return function(err) {\n if (err)\n emitError(err);\n else {\n var args = Array.prototype.slice.call(arguments, 1);\n try {\n fn.apply(null, args);\n } catch (err2) {\n emitError(err2);\n }\n }\n };\n }, d.run = function(fn) {\n try {\n fn();\n } catch (err) {\n emitError(err);\n }\n return this;\n }, d.dispose = function() {\n return this.removeAllListeners(), this;\n }, d.enter = d.exit = function() {\n return this;\n }, d;\n};\nreturn domain})\n"_s;
+static constexpr ASCIILiteral NodeDNSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/dns.ts\nvar getServers = function() {\n return dns.getServers();\n}, lookup = function(domain, options, callback) {\n if (typeof options == \"function\")\n callback = options;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n if (typeof options == \"number\")\n options = { family: options };\n if (domain !== domain || typeof domain !== \"number\" && !domain) {\n console.warn(`DeprecationWarning: The provided hostname \"${@String(domain)}\" is not a valid hostname, and is supported in the dns module solely for compatibility.`), callback(null, null, 4);\n return;\n }\n dns.lookup(domain, options).then((res) => {\n if (res.sort((a, b) => a.family - b.family), options\?.all)\n callback(null, res.map(mapLookupAll));\n else {\n const [{ address, family }] = res;\n callback(null, address, family);\n }\n }, (error) => {\n callback(error);\n });\n}, resolveSrv = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveTxt = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveSoa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNaptr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveMx = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCaa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNs = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolvePtr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCname = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, lookupService = function(address, port, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookupService(address, port, callback).then((results) => {\n callback(null, ...results);\n }, (error) => {\n callback(error);\n });\n}, reverse = function(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolve = function(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(({ address }) => address));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n}, Resolver = function(options) {\n return new InternalResolver(options);\n}, setDefaultResultOrder = function() {\n}, setServers = function() {\n}, $, dns = Bun.dns, InternalResolver = class Resolver2 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype, rrtype = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(mapResolveX));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n }\n resolve4(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 4 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(mapResolveX));\n }, (error) => {\n callback(error);\n });\n }\n resolve6(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 6 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(({ address }) => address));\n }, (error) => {\n callback(error);\n });\n }\n resolveAny(hostname, callback) {\n callback(null, []);\n }\n resolveCname(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveMx(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNaptr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNs(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolvePtr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSrv(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveCaa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveTxt(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSoa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n reverse(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n setServers(servers) {\n }\n};\nResolver.prototype = {};\nObject.setPrototypeOf(Resolver.prototype, InternalResolver.prototype);\nObject.setPrototypeOf(Resolver, InternalResolver);\nvar {\n resolve,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNaptr,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n reverse,\n resolveTxt\n} = InternalResolver.prototype, promisifyLookup = (res) => {\n res.sort((a, b) => a.family - b.family);\n const [{ address, family }] = res;\n return { address, family };\n}, mapLookupAll = (res) => {\n const { address, family } = res;\n return { address, family };\n}, promisifyLookupAll = (res) => {\n return res.sort((a, b) => a.family - b.family), res.map(mapLookupAll);\n}, mapResolveX = (a) => a.address, promisifyResolveX = (res) => {\n return res\?.map(mapResolveX);\n}, promises = {\n lookup(domain, options) {\n if (options\?.all)\n return dns.lookup(domain, options).then(promisifyLookupAll);\n return dns.lookup(domain, options).then(promisifyLookup);\n },\n lookupService(address, port) {\n return dns.lookupService(address, port);\n },\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n },\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n },\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n },\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n },\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n },\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n },\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n },\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n },\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n },\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n },\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n },\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n },\n reverse(ip) {\n return dns.reverse(ip);\n },\n Resolver: class Resolver3 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n }\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n }\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n }\n resolveAny(hostname) {\n return @Promise.resolve([]);\n }\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n }\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n }\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n }\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n }\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n }\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n }\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n }\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n }\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n }\n reverse(ip) {\n return dns.reverse(ip);\n }\n setServers(servers) {\n }\n }\n};\nfor (let key of [\"resolveAny\"])\n promises[key] = () => @Promise.resolve(@undefined);\n$ = {\n ADDRCONFIG: 0,\n ALL: 1,\n V4MAPPED: 2,\n NODATA: \"DNS_ENODATA\",\n FORMERR: \"DNS_EFORMERR\",\n SERVFAIL: \"DNS_ESERVFAIL\",\n NOTFOUND: \"DNS_ENOTFOUND\",\n NOTIMP: \"DNS_ENOTIMP\",\n REFUSED: \"DNS_EREFUSED\",\n BADQUERY: \"DNS_EBADQUERY\",\n BADNAME: \"DNS_EBADNAME\",\n BADFAMILY: \"DNS_EBADFAMILY\",\n BADRESP: \"DNS_EBADRESP\",\n CONNREFUSED: \"DNS_ECONNREFUSED\",\n TIMEOUT: \"DNS_ETIMEOUT\",\n EOF: \"DNS_EEOF\",\n FILE: \"DNS_EFILE\",\n NOMEM: \"DNS_ENOMEM\",\n DESTRUCTION: \"DNS_EDESTRUCTION\",\n BADSTR: \"DNS_EBADSTR\",\n BADFLAGS: \"DNS_EBADFLAGS\",\n NONAME: \"DNS_ENONAME\",\n BADHINTS: \"DNS_EBADHINTS\",\n NOTINITIALIZED: \"DNS_ENOTINITIALIZED\",\n LOADIPHLPAPI: \"DNS_ELOADIPHLPAPI\",\n ADDRGETNETWORKPARAMS: \"DNS_EADDRGETNETWORKPARAMS\",\n CANCELLED: \"DNS_ECANCELLED\",\n lookup,\n lookupService,\n Resolver,\n setServers,\n setDefaultResultOrder,\n resolve,\n reverse,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n resolveTxt,\n resolveNaptr,\n promises,\n getServers\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeEventsCode = "(function (){\"use strict\";// src/js/out/tmp/node/events.ts\nvar emitError = function(emitter, args) {\n var { _events: events } = emitter;\n if (args[0] \?\?= new Error(\"Unhandled error.\"), !events)\n throw args[0];\n var errorMonitor = events[kErrorMonitor];\n if (errorMonitor)\n for (var handler of ArrayPrototypeSlice.call(errorMonitor))\n handler.apply(emitter, args);\n var handlers = events.error;\n if (!handlers)\n throw args[0];\n for (var handler of ArrayPrototypeSlice.call(handlers))\n handler.apply(emitter, args);\n return !0;\n}, addCatch = function(emitter, promise, type, args) {\n promise.then(void 0, function(err) {\n process.nextTick(emitUnhandledRejectionOrErr, emitter, err, type, args);\n });\n}, emitUnhandledRejectionOrErr = function(emitter, err, type, args) {\n if (typeof emitter[kRejection] === \"function\")\n emitter[kRejection](err, type, ...args);\n else\n try {\n emitter[kCapture] = !1, emitter.emit(\"error\", err);\n } finally {\n emitter[kCapture] = !0;\n }\n}, overflowWarning = function(emitter, type, handlers) {\n handlers.warned = !0;\n const warn = new Error(`Possible EventEmitter memory leak detected. ${handlers.length} ${String(type)} listeners ` + `added to [${emitter.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);\n warn.name = \"MaxListenersExceededWarning\", warn.emitter = emitter, warn.type = type, warn.count = handlers.length, process.emitWarning(warn);\n}, onceWrapper = function(type, listener, ...args) {\n this.removeListener(type, listener), listener.apply(this, args);\n}, once = function(emitter, type, options) {\n var signal = options\?.signal;\n if (validateAbortSignal(signal, \"options.signal\"), signal\?.aborted)\n throw new AbortError(void 0, { cause: signal\?.reason });\n return new Promise((resolve, reject) => {\n const errorListener = (err) => {\n if (emitter.removeListener(type, resolver), signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n reject(err);\n }, resolver = (...args) => {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(\"error\", errorListener);\n if (signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n resolve(args);\n };\n if (eventTargetAgnosticAddListener(emitter, type, resolver, { once: !0 }), type !== \"error\" && typeof emitter.once === \"function\")\n emitter.once(\"error\", errorListener);\n function abortListener() {\n eventTargetAgnosticRemoveListener(emitter, type, resolver), eventTargetAgnosticRemoveListener(emitter, \"error\", errorListener), reject(new AbortError(void 0, { cause: signal\?.reason }));\n }\n if (signal != null)\n eventTargetAgnosticAddListener(signal, \"abort\", abortListener, { once: !0 });\n });\n}, on = function(emitter, type, options) {\n var { signal, close, highWatermark = Number.MAX_SAFE_INTEGER, lowWatermark = 1 } = options || {};\n throwNotImplemented(\"events.on\", 2679);\n}, getEventListeners = function(emitter, type) {\n if (emitter instanceof EventTarget)\n throwNotImplemented(\"getEventListeners with an EventTarget\", 2678);\n return emitter.listeners(type);\n}, setMaxListeners = function(n, ...eventTargets) {\n validateNumber(n, \"setMaxListeners\", 0);\n var length;\n if (eventTargets && (length = eventTargets.length))\n for (let i = 0;i < length; i++)\n eventTargets[i].setMaxListeners(n);\n else\n defaultMaxListeners = n;\n}, listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n}, eventTargetAgnosticRemoveListener = function(emitter, name, listener, flags) {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(name, listener);\n else\n emitter.removeEventListener(name, listener, flags);\n}, eventTargetAgnosticAddListener = function(emitter, name, listener, flags) {\n if (typeof emitter.on === \"function\")\n if (flags.once)\n emitter.once(name, listener);\n else\n emitter.on(name, listener);\n else\n emitter.addEventListener(name, listener, flags);\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_OUT_OF_RANGE = function(name, range, value) {\n const err = new RangeError(`The \"${name}\" argument is out of range. It must be ${range}. Received ${value}`);\n return err.code = \"ERR_OUT_OF_RANGE\", err;\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateNumber = function(value, name, min = void 0, max) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (min != null && value < min || max != null && value > max || (min != null || max != null) && Number.isNaN(value))\n throw new ERR_OUT_OF_RANGE(name, `${min != null \? `>= ${min}` : \"\"}${min != null && max != null \? \" && \" : \"\"}${max != null \? `<= ${max}` : \"\"}`, value);\n}, checkListener = function(listener) {\n if (typeof listener !== \"function\")\n @throwTypeError(\"The listener must be a function\");\n}, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), SymbolFor = Symbol.for, kCapture = Symbol(\"kCapture\"), kErrorMonitor = SymbolFor(\"events.errorMonitor\"), kMaxEventTargetListeners = Symbol(\"events.maxEventTargetListeners\"), kMaxEventTargetListenersWarned = Symbol(\"events.maxEventTargetListenersWarned\"), kWatermarkData = SymbolFor(\"nodejs.watermarkData\"), kRejection = SymbolFor(\"nodejs.rejection\"), captureRejectionSymbol = SymbolFor(\"nodejs.rejection\"), ArrayPrototypeSlice = Array.prototype.slice, defaultMaxListeners = 10, EventEmitter = function EventEmitter2(opts) {\n if (this._events === void 0 || this._events === this.__proto__._events)\n this._events = { __proto__: null }, this._eventsCount = 0;\n if (this._maxListeners \?\?= void 0, this[kCapture] = opts\?.captureRejections \? Boolean(opts\?.captureRejections) : EventEmitterPrototype[kCapture])\n this.emit = emitWithRejectionCapture;\n}, EventEmitterPrototype = EventEmitter.prototype = {};\nEventEmitterPrototype._events = void 0;\nEventEmitterPrototype._eventsCount = 0;\nEventEmitterPrototype._maxListeners = void 0;\nEventEmitterPrototype.setMaxListeners = function setMaxListeners2(n) {\n return validateNumber(n, \"setMaxListeners\", 0), this._maxListeners = n, this;\n};\nEventEmitterPrototype.constructor = EventEmitter;\nEventEmitterPrototype.getMaxListeners = function getMaxListeners() {\n return this._maxListeners \?\? defaultMaxListeners;\n};\nvar emitWithoutRejectionCapture = function emit(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers])\n handler.apply(this, args);\n return !0;\n}, emitWithRejectionCapture = function emit2(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers]) {\n var result = handler.apply(this, args);\n if (result !== void 0 && @isPromise(result))\n addCatch(this, result, type, args);\n }\n return !0;\n};\nEventEmitterPrototype.emit = emitWithoutRejectionCapture;\nEventEmitterPrototype.addListener = function addListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.push(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.on = EventEmitterPrototype.addListener;\nEventEmitterPrototype.prependListener = function prependListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.unshift(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.once = function once2(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.addListener(type, bound), this;\n};\nEventEmitterPrototype.prependOnceListener = function prependOnceListener(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.prependListener(type, bound), this;\n};\nEventEmitterPrototype.removeListener = function removeListener(type, fn) {\n checkListener(fn);\n var { _events: events } = this;\n if (!events)\n return this;\n var handlers = events[type];\n if (!handlers)\n return this;\n var length = handlers.length;\n let position = -1;\n for (let i = length - 1;i >= 0; i--)\n if (handlers[i] === fn || handlers[i].listener === fn) {\n position = i;\n break;\n }\n if (position < 0)\n return this;\n if (position === 0)\n handlers.shift();\n else\n handlers.splice(position, 1);\n if (handlers.length === 0)\n delete events[type], this._eventsCount--;\n return this;\n};\nEventEmitterPrototype.off = EventEmitterPrototype.removeListener;\nEventEmitterPrototype.removeAllListeners = function removeAllListeners(type) {\n var { _events: events } = this;\n if (type && events) {\n if (events[type])\n delete events[type], this._eventsCount--;\n } else\n this._events = { __proto__: null };\n return this;\n};\nEventEmitterPrototype.listeners = function listeners(type) {\n var { _events: events } = this;\n if (!events)\n return [];\n var handlers = events[type];\n if (!handlers)\n return [];\n return handlers.map((x) => x.listener \?\? x);\n};\nEventEmitterPrototype.rawListeners = function rawListeners(type) {\n var { _events } = this;\n if (!_events)\n return [];\n var handlers = _events[type];\n if (!handlers)\n return [];\n return handlers.slice();\n};\nEventEmitterPrototype.listenerCount = function listenerCount2(type) {\n var { _events: events } = this;\n if (!events)\n return 0;\n return events[type]\?.length \?\? 0;\n};\nEventEmitterPrototype.eventNames = function eventNames() {\n return this._eventsCount > 0 \? Reflect.ownKeys(this._events) : [];\n};\nEventEmitterPrototype[kCapture] = !1;\n\nclass AbortError extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n}\nvar AsyncResource = null;\n\nclass EventEmitterAsyncResource extends EventEmitter {\n triggerAsyncId;\n asyncResource;\n constructor(options) {\n if (!AsyncResource)\n AsyncResource = (@getInternalField(@internalModuleRegistry, 8) || @createInternalModuleById(8)).AsyncResource;\n var { captureRejections = !1, triggerAsyncId, name = new.target.name, requireManualDestroy } = options || {};\n super({ captureRejections });\n this.triggerAsyncId = triggerAsyncId \?\? 0, this.asyncResource = new AsyncResource(name, { triggerAsyncId, requireManualDestroy });\n }\n emit(...args) {\n this.asyncResource.runInAsyncScope(() => super.emit(...args));\n }\n emitDestroy() {\n this.asyncResource.emitDestroy();\n }\n}\nObject.defineProperties(EventEmitter, {\n captureRejections: {\n get() {\n return EventEmitterPrototype[kCapture];\n },\n set(value) {\n validateBoolean(value, \"EventEmitter.captureRejections\"), EventEmitterPrototype[kCapture] = value;\n },\n enumerable: !0\n },\n defaultMaxListeners: {\n enumerable: !0,\n get: () => {\n return defaultMaxListeners;\n },\n set: (arg) => {\n validateNumber(arg, \"defaultMaxListeners\", 0), defaultMaxListeners = arg;\n }\n },\n kMaxEventTargetListeners: {\n value: kMaxEventTargetListeners,\n enumerable: !1,\n configurable: !1,\n writable: !1\n },\n kMaxEventTargetListenersWarned: {\n value: kMaxEventTargetListenersWarned,\n enumerable: !1,\n configurable: !1,\n writable: !1\n }\n});\nObject.assign(EventEmitter, {\n once,\n on,\n getEventListeners,\n setMaxListeners,\n EventEmitter,\n usingDomains: !1,\n captureRejectionSymbol,\n EventEmitterAsyncResource,\n errorMonitor: kErrorMonitor,\n setMaxListeners,\n init: EventEmitter,\n listenerCount\n});\nreturn EventEmitter})\n"_s;
+static constexpr ASCIILiteral NodeDNSPromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/dns.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).promises})\n");
//
//
-static constexpr ASCIILiteral NodeFSCode = "(function (){\"use strict\";// src/js/out/tmp/node/fs.ts\nvar getValidatedPath = function(p) {\n if (p instanceof URL)\n return Bun.fileURLToPath(p);\n if (typeof p !== \"string\")\n @throwTypeError(\"Path must be a string or URL.\");\n return (_pathModule \?\?= @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28)).resolve(p);\n}, watchFile = function(filename, options, listener) {\n if (filename = getValidatedPath(filename), typeof options === \"function\")\n listener = options, options = {};\n if (typeof listener !== \"function\")\n @throwTypeError(\"listener must be a function\");\n var stat = statWatchers.get(filename);\n if (!stat)\n stat = new StatWatcher(filename, options), statWatchers.set(filename, stat);\n return stat.addListener(\"change\", listener), stat;\n}, unwatchFile = function(filename, listener) {\n filename = getValidatedPath(filename);\n var stat = statWatchers.get(filename);\n if (!stat)\n return;\n if (listener) {\n if (stat.removeListener(\"change\", listener), stat.listenerCount(\"change\") !== 0)\n return;\n } else\n stat.removeAllListeners(\"change\");\n stat.stop(), statWatchers.delete(filename);\n}, callbackify = function(fsFunction, args) {\n try {\n const result = fsFunction.apply(fs, args.slice(0, args.length - 1)), callback = args[args.length - 1];\n if (typeof callback === \"function\")\n queueMicrotask(() => callback(null, result));\n } catch (e) {\n const callback = args[args.length - 1];\n if (typeof callback === \"function\")\n queueMicrotask(() => callback(e));\n }\n}, createReadStream = function(path, options) {\n return new ReadStream(path, options);\n}, WriteStream_handleWrite = function(er, bytes) {\n if (er)\n return WriteStream_errorOrDestroy.call(this, er);\n this.bytesWritten += bytes;\n}, WriteStream_internalClose = function(err, cb) {\n this[_writeStreamPathFastPathSymbol] = !1;\n var fd = this.fd;\n this[_fs].close(fd, (er) => {\n this.fd = null, cb(err || er);\n });\n}, WriteStream_errorOrDestroy = function(err) {\n var {\n _readableState: r = { destroyed: !1, autoDestroy: !1 },\n _writableState: w = { destroyed: !1, autoDestroy: !1 }\n } = this;\n if (w\?.destroyed || r\?.destroyed)\n return this;\n if (r\?.autoDestroy || w\?.autoDestroy)\n this.destroy(err);\n else if (err)\n this.emit(\"error\", err);\n}, createWriteStream = function(path, options) {\n return new WriteStream(path, options);\n}, cpSync = function(src, dest, options) {\n if (!options)\n return fs.cpSync(src, dest);\n if (typeof options !== \"object\")\n @throwTypeError(\"options must be an object\");\n if (options.dereference || options.filter || options.preserveTimestamps || options.verbatimSymlinks) {\n if (!lazy_cpSync)\n lazy_cpSync = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3);\n return lazy_cpSync(src, dest, options);\n }\n return fs.cpSync(src, dest, options.recursive, options.errorOnExist, options.force \?\? !0, options.mode);\n}, cp = function(src, dest, options, callback) {\n if (typeof options === \"function\")\n callback = options, options = void 0;\n promises.cp(src, dest, options).then(() => callback(), callback);\n}, _toUnixTimestamp = function(time, name = \"time\") {\n if (typeof time === \"string\" && +time == time)\n return +time;\n if (NumberIsFinite(time)) {\n if (time < 0)\n return DateNow() / 1000;\n return time;\n }\n if (isDate(time))\n return DatePrototypeGetTime(time) / 1000;\n @throwTypeError(`Expected ${name} to be a number or Date`);\n}, $, ReadStream, WriteStream, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), promises = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), Stream = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), { isArrayBufferView } = @requireNativeModule(\"util/types\"), _writeStreamPathFastPathSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPath\"), _fs = Symbol.for(\"#fs\"), constants = @processBindingConstants.fs, fs = Bun.fs();\n\nclass FSWatcher extends EventEmitter {\n #watcher;\n #listener;\n constructor(path, options, listener) {\n super();\n if (typeof options === \"function\")\n listener = options, options = {};\n else if (typeof options === \"string\")\n options = { encoding: options };\n if (typeof listener !== \"function\")\n listener = () => {\n };\n this.#listener = listener;\n try {\n this.#watcher = fs.watch(path, options || {}, this.#onEvent.bind(this));\n } catch (e) {\n if (!e.message\?.startsWith(\"FileNotFound\"))\n throw e;\n const notFound = new Error(`ENOENT: no such file or directory, watch '${path}'`);\n throw notFound.code = \"ENOENT\", notFound.errno = -2, notFound.path = path, notFound.syscall = \"watch\", notFound.filename = path, notFound;\n }\n }\n #onEvent(eventType, filenameOrError) {\n if (eventType === \"error\" || eventType === \"close\")\n this.emit(eventType, filenameOrError);\n else\n this.emit(\"change\", eventType, filenameOrError), this.#listener(eventType, filenameOrError);\n }\n close() {\n this.#watcher\?.close(), this.#watcher = null;\n }\n ref() {\n this.#watcher\?.ref();\n }\n unref() {\n this.#watcher\?.unref();\n }\n start() {\n }\n}\n\nclass StatWatcher extends EventEmitter {\n constructor(path, options) {\n super();\n this._handle = fs.watchFile(path, options, this.#onChange.bind(this));\n }\n #onChange(curr, prev) {\n this.emit(\"change\", curr, prev);\n }\n start() {\n }\n stop() {\n this._handle\?.close(), this._handle = null;\n }\n ref() {\n this._handle\?.ref();\n }\n unref() {\n this._handle\?.unref();\n }\n}\nvar access = function access2(...args) {\n callbackify(fs.accessSync, args);\n}, appendFile = function appendFile2(...args) {\n callbackify(fs.appendFileSync, args);\n}, close = function close2(...args) {\n callbackify(fs.closeSync, args);\n}, rm = function rm2(...args) {\n callbackify(fs.rmSync, args);\n}, rmdir = function rmdir2(...args) {\n callbackify(fs.rmdirSync, args);\n}, copyFile = function copyFile2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.copyFile(...args).then((result) => callback(null, result), callback);\n}, exists = function exists2(...args) {\n callbackify(fs.existsSync, args);\n}, chown = function chown2(...args) {\n callbackify(fs.chownSync, args);\n}, chmod = function chmod2(...args) {\n callbackify(fs.chmodSync, args);\n}, fchmod = function fchmod2(...args) {\n callbackify(fs.fchmodSync, args);\n}, fchown = function fchown2(...args) {\n callbackify(fs.fchownSync, args);\n}, fstat = function fstat2(...args) {\n callbackify(fs.fstatSync, args);\n}, fsync = function fsync2(...args) {\n callbackify(fs.fsyncSync, args);\n}, ftruncate = function ftruncate2(...args) {\n callbackify(fs.ftruncateSync, args);\n}, futimes = function futimes2(...args) {\n callbackify(fs.futimesSync, args);\n}, lchmod = function lchmod2(...args) {\n callbackify(fs.lchmodSync, args);\n}, lchown = function lchown2(...args) {\n callbackify(fs.lchownSync, args);\n}, link = function link2(...args) {\n callbackify(fs.linkSync, args);\n}, mkdir = function mkdir2(...args) {\n callbackify(fs.mkdirSync, args);\n}, mkdtemp = function mkdtemp2(...args) {\n callbackify(fs.mkdtempSync, args);\n}, open = function open2(...args) {\n callbackify(fs.openSync, args);\n}, read = function read2(fd, buffer, offsetOrOptions, length, position, callback) {\n let offset = offsetOrOptions, params = null;\n if (arguments.length <= 4) {\n if (arguments.length === 4)\n callback = length, params = offsetOrOptions;\n else if (arguments.length === 3) {\n if (!isArrayBufferView(buffer))\n params = buffer, { buffer = Buffer.alloc(16384) } = params \?\? {};\n callback = offsetOrOptions;\n } else\n callback = buffer, buffer = Buffer.alloc(16384);\n ({ offset = 0, length = buffer\?.byteLength - offset, position = null } = params \?\? {});\n }\n queueMicrotask(() => {\n try {\n var bytesRead = fs.readSync(fd, buffer, offset, length, position);\n } catch (e) {\n callback(e);\n }\n callback(null, bytesRead, buffer);\n });\n}, write = function write2(...args) {\n callbackify(fs.writeSync, args);\n}, readdir = function readdir2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.readdir(...args).then((result) => callback(null, result), callback);\n}, readFile = function readFile2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.readFile(...args).then((result) => callback(null, result), callback);\n}, writeFile = function writeFile2(...args) {\n callbackify(fs.writeFileSync, args);\n}, readlink = function readlink2(...args) {\n callbackify(fs.readlinkSync, args);\n}, realpath = function realpath2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.realpath(...args).then((result) => callback(null, result), callback);\n}, rename = function rename2(...args) {\n callbackify(fs.renameSync, args);\n}, lstat = function lstat2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.lstat(...args).then((result) => callback(null, result), callback);\n}, stat = function stat2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.stat(...args).then((result) => callback(null, result), callback);\n}, symlink = function symlink2(...args) {\n callbackify(fs.symlinkSync, args);\n}, truncate = function truncate2(...args) {\n callbackify(fs.truncateSync, args);\n}, unlink = function unlink2(...args) {\n callbackify(fs.unlinkSync, args);\n}, utimes = function utimes2(...args) {\n callbackify(fs.utimesSync, args);\n}, lutimes = function lutimes2(...args) {\n callbackify(fs.lutimesSync, args);\n}, accessSync = fs.accessSync.bind(fs), appendFileSync = fs.appendFileSync.bind(fs), closeSync = fs.closeSync.bind(fs), copyFileSync = fs.copyFileSync.bind(fs), existsSync = fs.existsSync.bind(fs), chownSync = fs.chownSync.bind(fs), chmodSync = fs.chmodSync.bind(fs), fchmodSync = fs.fchmodSync.bind(fs), fchownSync = fs.fchownSync.bind(fs), fstatSync = fs.fstatSync.bind(fs), fsyncSync = fs.fsyncSync.bind(fs), ftruncateSync = fs.ftruncateSync.bind(fs), futimesSync = fs.futimesSync.bind(fs), lchmodSync = fs.lchmodSync.bind(fs), lchownSync = fs.lchownSync.bind(fs), linkSync = fs.linkSync.bind(fs), lstatSync = fs.lstatSync.bind(fs), mkdirSync = fs.mkdirSync.bind(fs), mkdtempSync = fs.mkdtempSync.bind(fs), openSync = fs.openSync.bind(fs), readSync = fs.readSync.bind(fs), writeSync = fs.writeSync.bind(fs), readdirSync = fs.readdirSync.bind(fs), readFileSync = fs.readFileSync.bind(fs), writeFileSync = fs.writeFileSync.bind(fs), readlinkSync = fs.readlinkSync.bind(fs), realpathSync = fs.realpathSync.bind(fs), renameSync = fs.renameSync.bind(fs), statSync = fs.statSync.bind(fs), symlinkSync = fs.symlinkSync.bind(fs), truncateSync = fs.truncateSync.bind(fs), unlinkSync = fs.unlinkSync.bind(fs), utimesSync = fs.utimesSync.bind(fs), lutimesSync = fs.lutimesSync.bind(fs), rmSync = fs.rmSync.bind(fs), rmdirSync = fs.rmdirSync.bind(fs), writev = (fd, buffers, position, callback) => {\n if (typeof position === \"function\")\n callback = position, position = null;\n queueMicrotask(() => {\n try {\n var written = fs.writevSync(fd, buffers, position);\n } catch (e) {\n callback(e);\n }\n callback(null, written, buffers);\n });\n}, writevSync = fs.writevSync.bind(fs), readv = (fd, buffers, position, callback) => {\n if (typeof position === \"function\")\n callback = position, position = null;\n queueMicrotask(() => {\n try {\n var written = fs.readvSync(fd, buffers, position);\n } catch (e) {\n callback(e);\n }\n callback(null, written, buffers);\n });\n}, readvSync = fs.readvSync.bind(fs), Dirent = fs.Dirent, Stats = fs.Stats, watch = function watch2(path, options, listener) {\n return new FSWatcher(path, options, listener);\n}, statWatchers = new Map, _pathModule, readStreamPathFastPathSymbol = Symbol.for(\"Bun.Node.readStreamPathFastPath\"), readStreamSymbol = Symbol.for(\"Bun.NodeReadStream\"), readStreamPathOrFdSymbol = Symbol.for(\"Bun.NodeReadStreamPathOrFd\"), writeStreamSymbol = Symbol.for(\"Bun.NodeWriteStream\"), writeStreamPathFastPathSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPath\"), writeStreamPathFastPathCallSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPathCall\"), kIoDone = Symbol.for(\"kIoDone\"), defaultReadStreamOptions = {\n file: void 0,\n fd: null,\n flags: \"r\",\n encoding: void 0,\n mode: 438,\n autoClose: !0,\n emitClose: !0,\n start: 0,\n end: Infinity,\n highWaterMark: 65536,\n fs: {\n read,\n open: (path, flags, mode, cb) => {\n var fd;\n try {\n fd = openSync(path, flags, mode);\n } catch (e) {\n cb(e);\n return;\n }\n cb(null, fd);\n },\n openSync,\n close\n },\n autoDestroy: !0\n}, ReadStreamClass;\nReadStream = function(InternalReadStream) {\n ReadStreamClass = InternalReadStream, Object.defineProperty(ReadStreamClass.prototype, Symbol.toStringTag, {\n value: \"ReadStream\",\n enumerable: !1\n });\n function ReadStream3(path, options) {\n return new InternalReadStream(path, options);\n }\n return ReadStream3.prototype = InternalReadStream.prototype, Object.defineProperty(ReadStream3, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalReadStream;\n }\n });\n}(class ReadStream2 extends Stream._getNativeReadableStreamPrototype(2, Stream.Readable) {\n constructor(pathOrFd, options = defaultReadStreamOptions) {\n if (typeof options !== \"object\" || !options)\n @throwTypeError(\"Expected options to be an object\");\n var {\n flags = defaultReadStreamOptions.flags,\n encoding = defaultReadStreamOptions.encoding,\n mode = defaultReadStreamOptions.mode,\n autoClose = defaultReadStreamOptions.autoClose,\n emitClose = defaultReadStreamOptions.emitClose,\n start = defaultReadStreamOptions.start,\n end = defaultReadStreamOptions.end,\n autoDestroy = defaultReadStreamOptions.autoClose,\n fs: fs2 = defaultReadStreamOptions.fs,\n highWaterMark = defaultReadStreamOptions.highWaterMark,\n fd = defaultReadStreamOptions.fd\n } = options;\n if (pathOrFd\?.constructor\?.name === \"URL\")\n pathOrFd = Bun.fileURLToPath(pathOrFd);\n var tempThis = {};\n if (fd != null) {\n if (typeof fd !== \"number\")\n @throwTypeError(\"Expected options.fd to be a number\");\n tempThis.fd = tempThis[readStreamPathOrFdSymbol] = fd, tempThis.autoClose = !1;\n } else if (typeof pathOrFd === \"string\") {\n if (pathOrFd.startsWith(\"file://\"))\n pathOrFd = Bun.fileURLToPath(pathOrFd);\n if (pathOrFd.length === 0)\n @throwTypeError(\"Expected path to be a non-empty string\");\n tempThis.path = tempThis.file = tempThis[readStreamPathOrFdSymbol] = pathOrFd;\n } else if (typeof pathOrFd === \"number\") {\n if (pathOrFd |= 0, pathOrFd < 0)\n @throwTypeError(\"Expected fd to be a positive integer\");\n tempThis.fd = tempThis[readStreamPathOrFdSymbol] = pathOrFd, tempThis.autoClose = !1;\n } else\n @throwTypeError(\"Expected a path or file descriptor\");\n if (tempThis.fd === void 0)\n tempThis.fd = fs2.openSync(pathOrFd, flags, mode);\n var fileRef = Bun.file(tempThis.fd), stream = fileRef.stream(), native = @direct(stream);\n if (!native)\n throw new Error(\"no native readable stream\");\n var { stream: ptr } = native;\n super(ptr, {\n ...options,\n encoding,\n autoDestroy,\n autoClose,\n emitClose,\n highWaterMark\n });\n if (Object.assign(this, tempThis), this.#fileRef = fileRef, this.end = end, this._read = this.#internalRead, this.start = start, this.flags = flags, this.mode = mode, this.emitClose = emitClose, this[readStreamPathFastPathSymbol] = start === 0 && end === Infinity && autoClose && fs2 === defaultReadStreamOptions.fs && (encoding === \"buffer\" || encoding === \"binary\" || encoding == null || encoding === \"utf-8\" || encoding === \"utf8\"), this._readableState.autoClose = autoDestroy = autoClose, this._readableState.highWaterMark = highWaterMark, start !== void 0)\n this.pos = start;\n }\n #fileRef;\n #fs;\n file;\n path;\n fd = null;\n flags;\n mode;\n start;\n end;\n pos;\n bytesRead = 0;\n #fileSize = -1;\n _read;\n [readStreamSymbol] = !0;\n [readStreamPathOrFdSymbol];\n [readStreamPathFastPathSymbol];\n _construct(callback) {\n if (super._construct)\n super._construct(callback);\n else\n callback();\n this.emit(\"open\", this.fd), this.emit(\"ready\");\n }\n _destroy(err, cb) {\n super._destroy(err, cb);\n try {\n var fd = this.fd;\n if (this[readStreamPathFastPathSymbol] = !1, !fd)\n cb(err);\n else\n this.#fs.close(fd, (er) => {\n cb(er || err);\n }), this.fd = null;\n } catch (e) {\n throw e;\n }\n }\n close(cb) {\n if (typeof cb === \"function\")\n Stream.eos(this, cb);\n this.destroy();\n }\n push(chunk) {\n var bytesRead = chunk\?.length \?\? 0;\n if (bytesRead > 0) {\n this.bytesRead += bytesRead;\n var currPos = this.pos;\n if (currPos !== void 0) {\n if (this.bytesRead < currPos)\n return !0;\n if (currPos === this.start) {\n var n = this.bytesRead - currPos;\n chunk = chunk.slice(-n);\n var [_, ...rest] = arguments;\n if (this.pos = this.bytesRead, this.end !== void 0 && this.bytesRead > this.end)\n chunk = chunk.slice(0, this.end - this.start + 1);\n return super.push(chunk, ...rest);\n }\n var end = this.end;\n if (end !== void 0 && this.bytesRead > end) {\n chunk = chunk.slice(0, end - currPos + 1);\n var [_, ...rest] = arguments;\n return this.pos = this.bytesRead, super.push(chunk, ...rest);\n }\n this.pos = this.bytesRead;\n }\n }\n return super.push(...arguments);\n }\n #internalRead(n) {\n var { pos, end, bytesRead, fd, encoding } = this;\n if (n = pos !== void 0 \? Math.min(end - pos + 1, n) : Math.min(end - bytesRead + 1, n), n <= 0) {\n this.push(null);\n return;\n }\n if (this.#fileSize === -1 && bytesRead === 0 && pos === void 0) {\n var stat3 = fstatSync(fd);\n if (this.#fileSize = stat3.size, this.#fileSize > 0 && n > this.#fileSize)\n n = this.#fileSize + 1;\n }\n this[kIoDone] = !1;\n var res = super._read(n);\n if (@isPromise(res)) {\n var then = res\?.then;\n if (then && @isCallable(then))\n res.then(() => {\n if (this[kIoDone] = !0, this.destroyed)\n this.emit(kIoDone);\n }, (er) => {\n this[kIoDone] = !0, this.#errorOrDestroy(er);\n });\n } else if (this[kIoDone] = !0, this.destroyed)\n this.emit(kIoDone), this.#errorOrDestroy(new Error(\"ERR_STREAM_PREMATURE_CLOSE\"));\n }\n #errorOrDestroy(err, sync = null) {\n var {\n _readableState: r = { destroyed: !1, autoDestroy: !1 },\n _writableState: w = { destroyed: !1, autoDestroy: !1 }\n } = this;\n if (w\?.destroyed || r\?.destroyed)\n return this;\n if (r\?.autoDestroy || w\?.autoDestroy)\n this.destroy(err);\n else if (err)\n this.emit(\"error\", err);\n }\n pause() {\n return this[readStreamPathFastPathSymbol] = !1, super.pause();\n }\n resume() {\n return this[readStreamPathFastPathSymbol] = !1, super.resume();\n }\n unshift(...args) {\n return this[readStreamPathFastPathSymbol] = !1, super.unshift(...args);\n }\n pipe(dest, pipeOpts) {\n if (this[readStreamPathFastPathSymbol] && (pipeOpts\?.end \?\? !0) && this._readableState\?.pipes\?.length === 0) {\n if ((writeStreamPathFastPathSymbol in dest) && dest[writeStreamPathFastPathSymbol]) {\n if (dest[writeStreamPathFastPathCallSymbol](this, pipeOpts))\n return this;\n }\n }\n return this[readStreamPathFastPathSymbol] = !1, super.pipe(dest, pipeOpts);\n }\n});\nvar defaultWriteStreamOptions = {\n fd: null,\n start: void 0,\n pos: void 0,\n encoding: void 0,\n flags: \"w\",\n mode: 438,\n fs: {\n write,\n close,\n open,\n openSync\n }\n}, WriteStreamClass = WriteStream = function WriteStream2(path, options = defaultWriteStreamOptions) {\n if (!(this instanceof WriteStream2))\n return new WriteStream2(path, options);\n if (!options)\n @throwTypeError(\"Expected options to be an object\");\n var {\n fs: fs2 = defaultWriteStreamOptions.fs,\n start = defaultWriteStreamOptions.start,\n flags = defaultWriteStreamOptions.flags,\n mode = defaultWriteStreamOptions.mode,\n autoClose = !0,\n emitClose = !1,\n autoDestroy = autoClose,\n encoding = defaultWriteStreamOptions.encoding,\n fd = defaultWriteStreamOptions.fd,\n pos = defaultWriteStreamOptions.pos\n } = options, tempThis = {};\n if (fd != null) {\n if (typeof fd !== \"number\")\n throw new Error(\"Expected options.fd to be a number\");\n tempThis.fd = fd, tempThis[_writeStreamPathFastPathSymbol] = !1;\n } else if (typeof path === \"string\") {\n if (path.length === 0)\n @throwTypeError(\"Expected a non-empty path\");\n if (path.startsWith(\"file:\"))\n path = Bun.fileURLToPath(path);\n tempThis.path = path, tempThis.fd = null, tempThis[_writeStreamPathFastPathSymbol] = autoClose && (start === void 0 || start === 0) && fs2.write === defaultWriteStreamOptions.fs.write && fs2.close === defaultWriteStreamOptions.fs.close;\n }\n if (tempThis.fd == null)\n tempThis.fd = fs2.openSync(path, flags, mode);\n if (NativeWritable.call(this, tempThis.fd, {\n ...options,\n decodeStrings: !1,\n autoDestroy,\n emitClose,\n fd: tempThis\n }), Object.assign(this, tempThis), typeof fs2\?.write !== \"function\")\n @throwTypeError(\"Expected fs.write to be a function\");\n if (typeof fs2\?.close !== \"function\")\n @throwTypeError(\"Expected fs.close to be a function\");\n if (typeof fs2\?.open !== \"function\")\n @throwTypeError(\"Expected fs.open to be a function\");\n if (typeof path === \"object\" && path) {\n if (path instanceof URL)\n path = Bun.fileURLToPath(path);\n }\n if (typeof path !== \"string\" && typeof fd !== \"number\")\n @throwTypeError(\"Expected a path or file descriptor\");\n if (this.start = start, this[_fs] = fs2, this.flags = flags, this.mode = mode, this.bytesWritten = 0, this[writeStreamSymbol] = !0, this[kIoDone] = !1, this.start !== void 0)\n this.pos = this.start;\n if (encoding !== defaultWriteStreamOptions.encoding) {\n if (this.setDefaultEncoding(encoding), encoding !== \"buffer\" && encoding !== \"utf8\" && encoding !== \"utf-8\" && encoding !== \"binary\")\n this[_writeStreamPathFastPathSymbol] = !1;\n }\n return this;\n}, NativeWritable = Stream.NativeWritable, WriteStreamPrototype = WriteStream.prototype = Object.create(NativeWritable.prototype);\nObject.defineProperties(WriteStreamPrototype, {\n autoClose: {\n get() {\n return this._writableState.autoDestroy;\n },\n set(val) {\n this._writableState.autoDestroy = val;\n }\n },\n pending: {\n get() {\n return this.fd === null;\n }\n }\n});\nWriteStreamPrototype.destroySoon = WriteStreamPrototype.end;\nWriteStreamPrototype.open = function open3() {\n};\nWriteStreamPrototype[writeStreamPathFastPathCallSymbol] = function WriteStreamPathFastPathCallSymbol(readStream, pipeOpts) {\n if (!this[_writeStreamPathFastPathSymbol])\n return !1;\n if (this.fd !== null)\n return this[_writeStreamPathFastPathSymbol] = !1, !1;\n return this[kIoDone] = !1, readStream[kIoDone] = !1, Bun.write(this[_writeStreamPathFastPathSymbol], readStream[readStreamPathOrFdSymbol]).then((bytesWritten) => {\n readStream[kIoDone] = this[kIoDone] = !0, this.bytesWritten += bytesWritten, readStream.bytesRead += bytesWritten, this.end(), readStream.close();\n }, (err) => {\n readStream[kIoDone] = this[kIoDone] = !0, WriteStream_errorOrDestroy.call(this, err), readStream.emit(\"error\", err);\n });\n};\nWriteStreamPrototype.isBunFastPathEnabled = function isBunFastPathEnabled() {\n return this[_writeStreamPathFastPathSymbol];\n};\nWriteStreamPrototype.disableBunFastPath = function disableBunFastPath() {\n this[_writeStreamPathFastPathSymbol] = !1;\n};\nWriteStreamPrototype._construct = function _construct(callback) {\n if (typeof this.fd === \"number\") {\n callback();\n return;\n }\n callback(), this.emit(\"open\", this.fd), this.emit(\"ready\");\n};\nWriteStreamPrototype._destroy = function _destroy(err, cb) {\n if (this.fd === null)\n return cb(err);\n if (this[kIoDone]) {\n this.once(kIoDone, () => WriteStream_internalClose.call(this, err, cb));\n return;\n }\n WriteStream_internalClose.call(this, err, cb);\n};\nWriteStreamPrototype.close = function close3(cb) {\n if (cb) {\n if (this.closed) {\n process.nextTick(cb);\n return;\n }\n this.on(\"close\", cb);\n }\n if (!this.autoClose)\n this.on(\"finish\", this.destroy);\n this.end();\n};\nWriteStreamPrototype.write = function write3(chunk, encoding, cb) {\n if (encoding \?\?= this._writableState\?.defaultEncoding, this[_writeStreamPathFastPathSymbol] = !1, typeof chunk === \"string\")\n chunk = Buffer.from(chunk, encoding);\n var native = this.pos === void 0;\n const callback = native \? (err, bytes) => {\n if (this[kIoDone] = !1, WriteStream_handleWrite.call(this, err, bytes), this.emit(kIoDone), cb)\n !err \? cb() : cb(err);\n } : () => {\n };\n if (this[kIoDone] = !0, this._write)\n return this._write(chunk, encoding, callback);\n else\n return NativeWritable.prototype.write.call(this, chunk, encoding, callback, native);\n};\nWriteStreamPrototype._write = void 0;\nWriteStreamPrototype._writev = void 0;\nWriteStreamPrototype.end = function end(chunk, encoding, cb) {\n var native = this.pos === void 0;\n return NativeWritable.prototype.end.call(this, chunk, encoding, cb, native);\n};\nWriteStreamPrototype._destroy = function _destroy2(err, cb) {\n this.close(err, cb);\n};\nObject.defineProperties(fs, {\n createReadStream: {\n value: createReadStream\n },\n createWriteStream: {\n value: createWriteStream\n },\n ReadStream: {\n value: ReadStream\n },\n WriteStream: {\n value: WriteStream\n }\n});\nrealpath.native = realpath;\nrealpathSync.native = realpathSync;\nvar lazy_cpSync = null;\n$ = {\n Dirent,\n FSWatcher,\n ReadStream,\n Stats,\n WriteStream,\n _toUnixTimestamp,\n access,\n accessSync,\n appendFile,\n appendFileSync,\n chmod,\n chmodSync,\n chown,\n chownSync,\n close,\n closeSync,\n constants,\n copyFile,\n copyFileSync,\n cp,\n cpSync,\n createReadStream,\n createWriteStream,\n exists,\n existsSync,\n fchmod,\n fchmodSync,\n fchown,\n fchownSync,\n fstat,\n fstatSync,\n fsync,\n fsyncSync,\n ftruncate,\n ftruncateSync,\n futimes,\n futimesSync,\n lchmod,\n lchmodSync,\n lchown,\n lchownSync,\n link,\n linkSync,\n lstat,\n lstatSync,\n lutimes,\n lutimesSync,\n mkdir,\n mkdirSync,\n mkdtemp,\n mkdtempSync,\n open,\n openSync,\n promises,\n read,\n readFile,\n readFileSync,\n readSync,\n readdir,\n readdirSync,\n readlink,\n readlinkSync,\n readv,\n readvSync,\n realpath,\n realpathSync,\n rename,\n renameSync,\n rm,\n rmSync,\n rmdir,\n rmdirSync,\n stat,\n statSync,\n symlink,\n symlinkSync,\n truncate,\n truncateSync,\n unlink,\n unlinkSync,\n unwatchFile,\n utimes,\n utimesSync,\n watch,\n watchFile,\n write,\n writeFile,\n writeFileSync,\n writeSync,\n writev,\n writevSync,\n [Symbol.for(\"::bunternal::\")]: {\n ReadStreamClass,\n WriteStreamClass\n }\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeDomainCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/domain.ts\nvar EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), domain = {};\ndomain.createDomain = domain.create = function() {\n var d = new EventEmitter;\n function emitError(e) {\n d.emit(\"error\", e);\n }\n return d.add = function(emitter) {\n emitter.on(\"error\", emitError);\n }, d.remove = function(emitter) {\n emitter.removeListener(\"error\", emitError);\n }, d.bind = function(fn) {\n return function() {\n var args = @Array.prototype.slice.@call(arguments);\n try {\n fn.@apply(null, args);\n } catch (err) {\n emitError(err);\n }\n };\n }, d.intercept = function(fn) {\n return function(err) {\n if (err)\n emitError(err);\n else {\n var args = @Array.prototype.slice.@call(arguments, 1);\n try {\n fn.@apply(null, args);\n } catch (err2) {\n emitError(err2);\n }\n }\n };\n }, d.run = function(fn) {\n try {\n fn();\n } catch (err) {\n emitError(err);\n }\n return this;\n }, d.dispose = function() {\n return this.removeAllListeners(), this;\n }, d.enter = d.exit = function() {\n return this;\n }, d;\n};\nreturn domain})\n");
//
//
-static constexpr ASCIILiteral NodeFSPromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/fs.promises.ts\nvar watch = function(filename, options = {}) {\n if (filename instanceof URL)\n @throwTypeError(\"Watch URLs are not supported yet\");\n else if (Buffer.isBuffer(filename))\n filename = filename.toString();\n else if (typeof filename !== \"string\")\n @throwTypeError(\"Expected path to be a string or Buffer\");\n let nextEventResolve = null;\n if (typeof options === \"string\")\n options = { encoding: options };\n const queue = @createFIFO(), watcher = fs.watch(filename, options || {}, (eventType, filename2) => {\n if (queue.push({ eventType, filename: filename2 }), nextEventResolve) {\n const resolve = nextEventResolve;\n nextEventResolve = null, resolve();\n }\n });\n return {\n [Symbol.asyncIterator]() {\n let closed = !1;\n return {\n async next() {\n while (!closed) {\n let event;\n while (event = queue.shift()) {\n if (event.eventType === \"close\")\n return closed = !0, { value: void 0, done: !0 };\n if (event.eventType === \"error\")\n throw closed = !0, event.filename;\n return { value: event, done: !1 };\n }\n const { promise, resolve } = Promise.withResolvers();\n nextEventResolve = resolve, await promise;\n }\n return { value: void 0, done: !0 };\n },\n return() {\n if (!closed) {\n if (watcher.close(), closed = !0, nextEventResolve) {\n const resolve = nextEventResolve;\n nextEventResolve = null, resolve();\n }\n }\n return { value: void 0, done: !0 };\n }\n };\n }\n };\n}, cp = function(src, dest, options) {\n if (!options)\n return fs.cp(src, dest);\n if (typeof options !== \"object\")\n @throwTypeError(\"options must be an object\");\n if (options.dereference || options.filter || options.preserveTimestamps || options.verbatimSymlinks) {\n if (!lazy_cp)\n lazy_cp = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3);\n return lazy_cp(src, dest, options);\n }\n return fs.cp(src, dest, options.recursive, options.errorOnExist, options.force \?\? !0, options.mode);\n};\nasync function opendir(dir) {\n const entries = await fs.readdir(dir, { withFileTypes: !0 });\n return new Dir(entries);\n}\nvar $, constants = @processBindingConstants.fs, fs = Bun.fs(), notrace = \"::bunternal::\", promisify = {\n [notrace]: (fsFunction) => {\n return async function(...args) {\n return await 1, fsFunction.apply(fs, args);\n };\n }\n}[notrace], lazy_cp = null;\n\nclass Dir {\n #entries;\n constructor(e) {\n this.#entries = e;\n }\n readSync() {\n return this.#entries.shift() \?\? null;\n }\n read(c) {\n if (c)\n process.nextTick(c, null, this.readSync());\n return Promise.resolve(this.readSync());\n }\n closeSync() {\n }\n close(c) {\n if (c)\n process.nextTick(c);\n return Promise.resolve();\n }\n *[Symbol.asyncIterator]() {\n var next;\n while (next = this.readSync())\n yield next;\n }\n}\n$ = {\n access: promisify(fs.accessSync),\n appendFile: promisify(fs.appendFileSync),\n close: promisify(fs.closeSync),\n copyFile: fs.copyFile.bind(fs),\n cp,\n exists: promisify(fs.existsSync),\n chown: promisify(fs.chownSync),\n chmod: promisify(fs.chmodSync),\n fchmod: promisify(fs.fchmodSync),\n fchown: promisify(fs.fchownSync),\n fstat: promisify(fs.fstatSync),\n fsync: promisify(fs.fsyncSync),\n ftruncate: promisify(fs.ftruncateSync),\n futimes: promisify(fs.futimesSync),\n lchmod: promisify(fs.lchmodSync),\n lchown: promisify(fs.lchownSync),\n link: promisify(fs.linkSync),\n lstat: fs.lstat.bind(fs),\n mkdir: promisify(fs.mkdirSync),\n mkdtemp: promisify(fs.mkdtempSync),\n open: promisify(fs.openSync),\n read: promisify(fs.readSync),\n write: promisify(fs.writeSync),\n readdir: fs.readdir.bind(fs),\n readFile: fs.readFile.bind(fs),\n writeFile: promisify(fs.writeFileSync),\n readlink: promisify(fs.readlinkSync),\n realpath: fs.realpath.bind(fs),\n rename: promisify(fs.renameSync),\n stat: fs.stat.bind(fs),\n symlink: promisify(fs.symlinkSync),\n truncate: promisify(fs.truncateSync),\n unlink: promisify(fs.unlinkSync),\n utimes: promisify(fs.utimesSync),\n lutimes: promisify(fs.lutimesSync),\n rm: promisify(fs.rmSync),\n rmdir: promisify(fs.rmdirSync),\n writev: (fd, buffers, position) => {\n return new Promise((resolve, reject) => {\n try {\n var bytesWritten = fs.writevSync(fd, buffers, position);\n } catch (err) {\n reject(err);\n return;\n }\n resolve({\n bytesWritten,\n buffers\n });\n });\n },\n readv: (fd, buffers, position) => {\n return new Promise((resolve, reject) => {\n try {\n var bytesRead = fs.readvSync(fd, buffers, position);\n } catch (err) {\n reject(err);\n return;\n }\n resolve({\n bytesRead,\n buffers\n });\n });\n },\n constants,\n watch,\n opendir\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeEventsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/events.ts\nvar emitError = function(emitter, args) {\n var { _events: events } = emitter;\n if (args[0] \?\?= new Error(\"Unhandled error.\"), !events)\n throw args[0];\n var errorMonitor = events[kErrorMonitor];\n if (errorMonitor)\n for (var handler of ArrayPrototypeSlice.@call(errorMonitor))\n handler.@apply(emitter, args);\n var handlers = events.error;\n if (!handlers)\n throw args[0];\n for (var handler of ArrayPrototypeSlice.@call(handlers))\n handler.@apply(emitter, args);\n return !0;\n}, addCatch = function(emitter, promise, type, args) {\n promise.then(@undefined, function(err) {\n process.nextTick(emitUnhandledRejectionOrErr, emitter, err, type, args);\n });\n}, emitUnhandledRejectionOrErr = function(emitter, err, type, args) {\n if (typeof emitter[kRejection] === \"function\")\n emitter[kRejection](err, type, ...args);\n else\n try {\n emitter[kCapture] = !1, emitter.emit(\"error\", err);\n } finally {\n emitter[kCapture] = !0;\n }\n}, overflowWarning = function(emitter, type, handlers) {\n handlers.warned = !0;\n const warn = new Error(`Possible EventEmitter memory leak detected. ${handlers.length} ${@String(type)} listeners ` + `added to [${emitter.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);\n warn.name = \"MaxListenersExceededWarning\", warn.emitter = emitter, warn.type = type, warn.count = handlers.length, process.emitWarning(warn);\n}, onceWrapper = function(type, listener, ...args) {\n this.removeListener(type, listener), listener.@apply(this, args);\n}, once = function(emitter, type, options) {\n var signal = options\?.signal;\n if (validateAbortSignal(signal, \"options.signal\"), signal\?.aborted)\n throw new AbortError(@undefined, { cause: signal\?.reason });\n return new @Promise((resolve, reject) => {\n const errorListener = (err) => {\n if (emitter.removeListener(type, resolver), signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n reject(err);\n }, resolver = (...args) => {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(\"error\", errorListener);\n if (signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n resolve(args);\n };\n if (eventTargetAgnosticAddListener(emitter, type, resolver, { once: !0 }), type !== \"error\" && typeof emitter.once === \"function\")\n emitter.once(\"error\", errorListener);\n function abortListener() {\n eventTargetAgnosticRemoveListener(emitter, type, resolver), eventTargetAgnosticRemoveListener(emitter, \"error\", errorListener), reject(new AbortError(@undefined, { cause: signal\?.reason }));\n }\n if (signal != null)\n eventTargetAgnosticAddListener(signal, \"abort\", abortListener, { once: !0 });\n });\n}, on = function(emitter, type, options) {\n var { signal, close, highWatermark = Number.MAX_SAFE_INTEGER, lowWatermark = 1 } = options || {};\n throwNotImplemented(\"events.on\", 2679);\n}, getEventListeners = function(emitter, type) {\n if (emitter instanceof EventTarget)\n throwNotImplemented(\"getEventListeners with an EventTarget\", 2678);\n return emitter.listeners(type);\n}, setMaxListeners = function(n, ...eventTargets) {\n validateNumber(n, \"setMaxListeners\", 0);\n var length;\n if (eventTargets && (length = eventTargets.length))\n for (let i = 0;i < length; i++)\n eventTargets[i].setMaxListeners(n);\n else\n defaultMaxListeners = n;\n}, listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n}, eventTargetAgnosticRemoveListener = function(emitter, name, listener, flags) {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(name, listener);\n else\n emitter.removeEventListener(name, listener, flags);\n}, eventTargetAgnosticAddListener = function(emitter, name, listener, flags) {\n if (typeof emitter.on === \"function\")\n if (flags.once)\n emitter.once(name, listener);\n else\n emitter.on(name, listener);\n else\n emitter.addEventListener(name, listener, flags);\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_OUT_OF_RANGE = function(name, range, value) {\n const err = new RangeError(`The \"${name}\" argument is out of range. It must be ${range}. Received ${value}`);\n return err.code = \"ERR_OUT_OF_RANGE\", err;\n}, validateAbortSignal = function(signal, name) {\n if (signal !== @undefined && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateNumber = function(value, name, min = @undefined, max) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (min != null && value < min || max != null && value > max || (min != null || max != null) && Number.isNaN(value))\n throw new ERR_OUT_OF_RANGE(name, `${min != null \? `>= ${min}` : \"\"}${min != null && max != null \? \" && \" : \"\"}${max != null \? `<= ${max}` : \"\"}`, value);\n}, checkListener = function(listener) {\n if (typeof listener !== \"function\")\n @throwTypeError(\"The listener must be a function\");\n}, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), SymbolFor = Symbol.for, kCapture = Symbol(\"kCapture\"), kErrorMonitor = SymbolFor(\"events.errorMonitor\"), kMaxEventTargetListeners = Symbol(\"events.maxEventTargetListeners\"), kMaxEventTargetListenersWarned = Symbol(\"events.maxEventTargetListenersWarned\"), kWatermarkData = SymbolFor(\"nodejs.watermarkData\"), kRejection = SymbolFor(\"nodejs.rejection\"), captureRejectionSymbol = SymbolFor(\"nodejs.rejection\"), ArrayPrototypeSlice = @Array.prototype.slice, defaultMaxListeners = 10, EventEmitter = function EventEmitter2(opts) {\n if (this._events === @undefined || this._events === this.__proto__._events)\n this._events = { __proto__: null }, this._eventsCount = 0;\n if (this._maxListeners \?\?= @undefined, this[kCapture] = opts\?.captureRejections \? Boolean(opts\?.captureRejections) : EventEmitterPrototype[kCapture])\n this.emit = emitWithRejectionCapture;\n}, EventEmitterPrototype = EventEmitter.prototype = {};\nEventEmitterPrototype._events = @undefined;\nEventEmitterPrototype._eventsCount = 0;\nEventEmitterPrototype._maxListeners = @undefined;\nEventEmitterPrototype.setMaxListeners = function setMaxListeners2(n) {\n return validateNumber(n, \"setMaxListeners\", 0), this._maxListeners = n, this;\n};\nEventEmitterPrototype.constructor = EventEmitter;\nEventEmitterPrototype.getMaxListeners = function getMaxListeners() {\n return this._maxListeners \?\? defaultMaxListeners;\n};\nvar emitWithoutRejectionCapture = function emit(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === @undefined)\n return !1;\n var handlers = events[type];\n if (handlers === @undefined)\n return !1;\n const maybeClonedHandlers = handlers.length > 1 \? handlers.slice() : handlers;\n for (let i = 0, { length } = maybeClonedHandlers;i < length; i++) {\n const handler = maybeClonedHandlers[i];\n switch (args.length) {\n case 0:\n handler.@call(this);\n break;\n case 1:\n handler.@call(this, args[0]);\n break;\n case 2:\n handler.@call(this, args[0], args[1]);\n break;\n case 3:\n handler.@call(this, args[0], args[1], args[2]);\n break;\n default:\n handler.@apply(this, args);\n break;\n }\n }\n return !0;\n}, emitWithRejectionCapture = function emit2(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === @undefined)\n return !1;\n var handlers = events[type];\n if (handlers === @undefined)\n return !1;\n const maybeClonedHandlers = handlers.length > 1 \? handlers.slice() : handlers;\n for (let i = 0, { length } = maybeClonedHandlers;i < length; i++) {\n const handler = maybeClonedHandlers[i];\n let result;\n switch (args.length) {\n case 0:\n result = handler.@call(this);\n break;\n case 1:\n result = handler.@call(this, args[0]);\n break;\n case 2:\n result = handler.@call(this, args[0], args[1]);\n break;\n case 3:\n result = handler.@call(this, args[0], args[1], args[2]);\n break;\n default:\n result = handler.@apply(this, args);\n break;\n }\n if (result !== @undefined && @isPromise(result))\n addCatch(this, result, type, args);\n }\n return !0;\n};\nEventEmitterPrototype.emit = emitWithoutRejectionCapture;\nEventEmitterPrototype.addListener = function addListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.push(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.on = EventEmitterPrototype.addListener;\nEventEmitterPrototype.prependListener = function prependListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.unshift(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.once = function once2(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.addListener(type, bound), this;\n};\nEventEmitterPrototype.prependOnceListener = function prependOnceListener(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.prependListener(type, bound), this;\n};\nEventEmitterPrototype.removeListener = function removeListener(type, fn) {\n checkListener(fn);\n var { _events: events } = this;\n if (!events)\n return this;\n var handlers = events[type];\n if (!handlers)\n return this;\n var length = handlers.length;\n let position = -1;\n for (let i = length - 1;i >= 0; i--)\n if (handlers[i] === fn || handlers[i].listener === fn) {\n position = i;\n break;\n }\n if (position < 0)\n return this;\n if (position === 0)\n handlers.shift();\n else\n handlers.splice(position, 1);\n if (handlers.length === 0)\n delete events[type], this._eventsCount--;\n return this;\n};\nEventEmitterPrototype.off = EventEmitterPrototype.removeListener;\nEventEmitterPrototype.removeAllListeners = function removeAllListeners(type) {\n var { _events: events } = this;\n if (type && events) {\n if (events[type])\n delete events[type], this._eventsCount--;\n } else\n this._events = { __proto__: null };\n return this;\n};\nEventEmitterPrototype.listeners = function listeners(type) {\n var { _events: events } = this;\n if (!events)\n return [];\n var handlers = events[type];\n if (!handlers)\n return [];\n return handlers.map((x) => x.listener \?\? x);\n};\nEventEmitterPrototype.rawListeners = function rawListeners(type) {\n var { _events } = this;\n if (!_events)\n return [];\n var handlers = _events[type];\n if (!handlers)\n return [];\n return handlers.slice();\n};\nEventEmitterPrototype.listenerCount = function listenerCount2(type) {\n var { _events: events } = this;\n if (!events)\n return 0;\n return events[type]\?.length \?\? 0;\n};\nEventEmitterPrototype.eventNames = function eventNames() {\n return this._eventsCount > 0 \? Reflect.ownKeys(this._events) : [];\n};\nEventEmitterPrototype[kCapture] = !1;\n\nclass AbortError extends Error {\n constructor(message = \"The operation was aborted\", options = @undefined) {\n if (options !== @undefined && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n}\nvar AsyncResource = null;\n\nclass EventEmitterAsyncResource extends EventEmitter {\n triggerAsyncId;\n asyncResource;\n constructor(options) {\n if (!AsyncResource)\n AsyncResource = (@getInternalField(@internalModuleRegistry, 10) || @createInternalModuleById(10)).AsyncResource;\n var { captureRejections = !1, triggerAsyncId, name = new.target.name, requireManualDestroy } = options || {};\n super({ captureRejections });\n this.triggerAsyncId = triggerAsyncId \?\? 0, this.asyncResource = new AsyncResource(name, { triggerAsyncId, requireManualDestroy });\n }\n emit(...args) {\n this.asyncResource.runInAsyncScope(() => super.emit(...args));\n }\n emitDestroy() {\n this.asyncResource.emitDestroy();\n }\n}\nObject.defineProperties(EventEmitter, {\n captureRejections: {\n get() {\n return EventEmitterPrototype[kCapture];\n },\n set(value) {\n validateBoolean(value, \"EventEmitter.captureRejections\"), EventEmitterPrototype[kCapture] = value;\n },\n enumerable: !0\n },\n defaultMaxListeners: {\n enumerable: !0,\n get: () => {\n return defaultMaxListeners;\n },\n set: (arg) => {\n validateNumber(arg, \"defaultMaxListeners\", 0), defaultMaxListeners = arg;\n }\n },\n kMaxEventTargetListeners: {\n value: kMaxEventTargetListeners,\n enumerable: !1,\n configurable: !1,\n writable: !1\n },\n kMaxEventTargetListenersWarned: {\n value: kMaxEventTargetListenersWarned,\n enumerable: !1,\n configurable: !1,\n writable: !1\n }\n});\nObject.assign(EventEmitter, {\n once,\n on,\n getEventListeners,\n setMaxListeners,\n EventEmitter,\n usingDomains: !1,\n captureRejectionSymbol,\n EventEmitterAsyncResource,\n errorMonitor: kErrorMonitor,\n setMaxListeners,\n init: EventEmitter,\n listenerCount\n});\nreturn EventEmitter})\n");
//
//
-static constexpr ASCIILiteral NodeHttpCode = "(function (){\"use strict\";// src/js/out/tmp/node/http.ts\nvar checkInvalidHeaderChar = function(val) {\n return RegExpPrototypeExec.call(headerCharRegex, val) !== null;\n}, isIPv6 = function(input) {\n return new RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\").test(input);\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof ArrayBuffer || obj instanceof Blob)\n return !0;\n if (Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, validateMsecs = function(numberlike, field) {\n if (typeof numberlike !== \"number\" || numberlike < 0)\n throw new ERR_INVALID_ARG_TYPE(field, \"number\", numberlike);\n return numberlike;\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, getHeader = function(headers, name) {\n if (!headers)\n return;\n const result = headers.get(name);\n return result == null \? void 0 : result;\n}, createServer = function(options, callback) {\n return new Server(options, callback);\n}, emitListeningNextTick = function(self, onListen, err, hostname, port) {\n if (typeof onListen === \"function\")\n try {\n onListen(err, hostname, port);\n } catch (err2) {\n self.emit(\"error\", err2);\n }\n if (self.listening = !err, err)\n self.emit(\"error\", err);\n else\n self.emit(\"listening\", hostname, port);\n}, assignHeaders = function(object, req) {\n var headers = req.headers.toJSON();\n const rawHeaders = @newArrayWithSize(req.headers.count * 2);\n var i = 0;\n for (let key in headers)\n rawHeaders[i++] = key, rawHeaders[i++] = headers[key];\n object.headers = headers, object.rawHeaders = rawHeaders;\n};\nvar getDefaultHTTPSAgent = function() {\n return _defaultHTTPSAgent \?\?= new Agent({ defaultPort: 443, protocol: \"https:\" });\n};\nvar urlToHttpOptions = function(url) {\n var { protocol, hostname, hash, search, pathname, href, port, username, password } = url;\n return {\n protocol,\n hostname: typeof hostname === \"string\" && StringPrototypeStartsWith.call(hostname, \"[\") \? StringPrototypeSlice.call(hostname, 1, -1) : hostname,\n hash,\n search,\n pathname,\n path: `${pathname || \"\"}${search || \"\"}`,\n href,\n port: port \? Number(port) : protocol === \"https:\" \? 443 : protocol === \"http:\" \? 80 : void 0,\n auth: username || password \? `${decodeURIComponent(username)}:${decodeURIComponent(password)}` : void 0\n };\n}, validateHost = function(host, name) {\n if (host !== null && host !== void 0 && typeof host !== \"string\")\n throw new Error(\"Invalid arg type in options\");\n return host;\n}, checkIsHttpToken = function(val) {\n return RegExpPrototypeExec.call(tokenRegExp, val) !== null;\n};\nvar _writeHead = function(statusCode, reason, obj, response) {\n if (statusCode |= 0, statusCode < 100 || statusCode > 999)\n throw new Error(\"status code must be between 100 and 999\");\n if (typeof reason === \"string\")\n response.statusMessage = reason;\n else {\n if (!response.statusMessage)\n response.statusMessage = STATUS_CODES[statusCode] || \"unknown\";\n obj = reason;\n }\n response.statusCode = statusCode;\n {\n let k;\n if (Array.isArray(obj)) {\n if (obj.length % 2 !== 0)\n throw new Error(\"raw headers must have an even number of elements\");\n for (let n = 0;n < obj.length; n += 2)\n if (k = obj[n + 0], k)\n response.setHeader(k, obj[n + 1]);\n } else if (obj) {\n const keys = Object.keys(obj);\n for (let i = 0;i < keys.length; i++)\n if (k = keys[i], k)\n response.setHeader(k, obj[k]);\n }\n }\n if (statusCode === 204 || statusCode === 304 || statusCode >= 100 && statusCode <= 199)\n response._hasBody = !1;\n}, request = function(url, options, cb) {\n return new ClientRequest(url, options, cb);\n}, get = function(url, options, cb) {\n const req = request(url, options, cb);\n return req.end(), req;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { isTypedArray } = @requireNativeModule(\"util/types\"), { Duplex, Readable, Writable } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/, validateHeaderName = (name, label) => {\n if (typeof name !== \"string\" || !name || !checkIsHttpToken(name))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN\");\n}, validateHeaderValue = (name, value) => {\n if (value === void 0)\n throw new Error(\"ERR_HTTP_INVALID_HEADER_VALUE\");\n if (checkInvalidHeaderChar(value))\n throw new Error(\"ERR_INVALID_CHAR\");\n}, { URL } = globalThis, globalReportError = globalThis.reportError, setTimeout = globalThis.setTimeout, fetch = Bun.fetch;\nvar kEmptyObject = Object.freeze(Object.create(null)), kOutHeaders = Symbol.for(\"kOutHeaders\"), kEndCalled = Symbol.for(\"kEndCalled\"), kAbortController = Symbol.for(\"kAbortController\"), kClearTimeout = Symbol(\"kClearTimeout\"), kCorked = Symbol.for(\"kCorked\"), searchParamsSymbol = Symbol.for(\"query\"), StringPrototypeSlice = String.prototype.slice, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeToUpperCase = String.prototype.toUpperCase, StringPrototypeIncludes = String.prototype.includes, StringPrototypeCharCodeAt = String.prototype.charCodeAt, StringPrototypeIndexOf = String.prototype.indexOf, ArrayIsArray = Array.isArray, RegExpPrototypeExec = RegExp.prototype.exec, ObjectAssign = Object.assign;\nvar INVALID_PATH_REGEX = /[^\\u0021-\\u00ff]/;\nvar _defaultHTTPSAgent, kInternalRequest = Symbol(\"kInternalRequest\"), kInternalSocketData = Symbol.for(\"::bunternal::\"), kEmptyBuffer = Buffer.alloc(0);\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\nvar FakeSocket = class Socket extends Duplex {\n [kInternalSocketData];\n bytesRead = 0;\n bytesWritten = 0;\n connecting = !1;\n remoteAddress = null;\n remotePort;\n timeout = 0;\n isServer = !1;\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n connect(port, host, connectListener) {\n return this;\n }\n _destroy(err, callback) {\n }\n _final(callback) {\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return 80;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n return this;\n }\n unref() {\n }\n _write(chunk, encoding, callback) {\n }\n};\n\nclass Agent extends EventEmitter {\n defaultPort = 80;\n protocol = \"http:\";\n options;\n requests;\n sockets;\n freeSockets;\n keepAliveMsecs;\n keepAlive;\n maxSockets;\n maxFreeSockets;\n scheduling;\n maxTotalSockets;\n totalSocketCount;\n #fakeSocket;\n static get globalAgent() {\n return globalAgent;\n }\n static get defaultMaxSockets() {\n return Infinity;\n }\n constructor(options = kEmptyObject) {\n super();\n if (this.options = options = { ...options, path: null }, options.noDelay === void 0)\n options.noDelay = !0;\n this.requests = kEmptyObject, this.sockets = kEmptyObject, this.freeSockets = kEmptyObject, this.keepAliveMsecs = options.keepAliveMsecs || 1000, this.keepAlive = options.keepAlive || !1, this.maxSockets = options.maxSockets || Agent.defaultMaxSockets, this.maxFreeSockets = options.maxFreeSockets || 256, this.scheduling = options.scheduling || \"lifo\", this.maxTotalSockets = options.maxTotalSockets, this.totalSocketCount = 0, this.defaultPort = options.defaultPort || 80, this.protocol = options.protocol || \"http:\";\n }\n createConnection() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n getName(options = kEmptyObject) {\n let name = `http:${options.host || \"localhost\"}:`;\n if (options.port)\n name += options.port;\n if (name += \":\", options.localAddress)\n name += options.localAddress;\n if (options.family === 4 || options.family === 6)\n name += `:${options.family}`;\n if (options.socketPath)\n name += `:${options.socketPath}`;\n return name;\n }\n addRequest() {\n }\n createSocket(req, options, cb) {\n cb(null, this.#fakeSocket \?\?= new FakeSocket);\n }\n removeSocket() {\n }\n keepSocketAlive() {\n return !0;\n }\n reuseSocket() {\n }\n destroy() {\n }\n}\n\nclass Server extends EventEmitter {\n #server;\n #options;\n #tls;\n #is_tls = !1;\n listening = !1;\n serverName;\n constructor(options, callback) {\n super();\n if (typeof options === \"function\")\n callback = options, options = {};\n else if (options == null || typeof options === \"object\") {\n options = { ...options }, this.#tls = null;\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n let serverName = options.servername;\n if (serverName && typeof serverName !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n if (this.#is_tls)\n this.#tls = {\n serverName,\n key,\n cert,\n ca,\n passphrase,\n secureOptions\n };\n else\n this.#tls = null;\n } else\n throw new Error(\"bun-http-polyfill: invalid arguments\");\n if (this.#options = options, callback)\n this.on(\"request\", callback);\n }\n closeAllConnections() {\n const server = this.#server;\n if (!server)\n return;\n this.#server = void 0, server.stop(!0), this.emit(\"close\");\n }\n closeIdleConnections() {\n }\n close(optionalCallback) {\n const server = this.#server;\n if (!server) {\n if (typeof optionalCallback === \"function\")\n process.nextTick(optionalCallback, new Error(\"Server is not running\"));\n return;\n }\n if (this.#server = void 0, typeof optionalCallback === \"function\")\n this.once(\"close\", optionalCallback);\n server.stop(), this.emit(\"close\");\n }\n address() {\n if (!this.#server)\n return null;\n const address = this.#server.hostname;\n return {\n address,\n family: isIPv6(address) \? \"IPv6\" : \"IPv4\",\n port: this.#server.port\n };\n }\n listen(port, host, backlog, onListen) {\n const server = this;\n let socketPath;\n if (typeof port == \"string\" && !Number.isSafeInteger(Number(port)))\n socketPath = port;\n if (typeof host === \"function\")\n onListen = host, host = void 0;\n if (typeof port === \"function\")\n onListen = port;\n else if (typeof port === \"object\") {\n if (port\?.signal\?.addEventListener(\"abort\", () => {\n this.close();\n }), host = port\?.host, port = port\?.port, typeof port\?.callback === \"function\")\n onListen = port\?.callback;\n }\n if (typeof backlog === \"function\")\n onListen = backlog;\n const ResponseClass = this.#options.ServerResponse || ServerResponse, RequestClass = this.#options.IncomingMessage || IncomingMessage;\n try {\n const tls = this.#tls;\n if (tls)\n this.serverName = tls.serverName || host || \"localhost\";\n this.#server = Bun.serve({\n tls,\n port,\n hostname: host,\n unix: socketPath,\n websocket: {\n open(ws) {\n ws.data.open(ws);\n },\n message(ws, message) {\n ws.data.message(ws, message);\n },\n close(ws, code, reason) {\n ws.data.close(ws, code, reason);\n },\n drain(ws) {\n ws.data.drain(ws);\n }\n },\n fetch(req, _server) {\n var pendingResponse, pendingError, rejectFunction, resolveFunction, reject = (err) => {\n if (pendingError)\n return;\n if (pendingError = err, rejectFunction)\n rejectFunction(err);\n }, reply = function(resp) {\n if (pendingResponse)\n return;\n if (pendingResponse = resp, resolveFunction)\n resolveFunction(resp);\n };\n const http_req = new RequestClass(req), http_res = new ResponseClass({ reply, req: http_req });\n if (http_req.once(\"error\", (err) => reject(err)), http_res.once(\"error\", (err) => reject(err)), req.headers.get(\"upgrade\")) {\n const socket = http_req.socket;\n socket[kInternalSocketData] = [_server, http_res, req], server.emit(\"upgrade\", http_req, socket, kEmptyBuffer);\n } else\n server.emit(\"request\", http_req, http_res);\n if (pendingError)\n throw pendingError;\n if (pendingResponse)\n return pendingResponse;\n return new Promise((resolve, reject2) => {\n resolveFunction = resolve, rejectFunction = reject2;\n });\n }\n }), setTimeout(emitListeningNextTick, 1, this, onListen, null, this.#server.hostname, this.#server.port);\n } catch (err) {\n setTimeout(emitListeningNextTick, 1, this, onListen, err);\n }\n return this;\n }\n setTimeout(msecs, callback) {\n }\n}\nclass IncomingMessage extends Readable {\n method;\n complete;\n constructor(req, defaultIncomingOpts) {\n const method = req.method;\n super();\n const url = new URL(req.url);\n var { type = \"request\", [kInternalRequest]: nodeReq } = defaultIncomingOpts || {};\n this.#noBody = type === \"request\" \? method === \"GET\" || method === \"HEAD\" || method === \"TRACE\" || method === \"CONNECT\" || method === \"OPTIONS\" || (parseInt(req.headers.get(\"Content-Length\") || \"\") || 0) === 0 : !1, this.#req = req, this.method = method, this.#type = type, this.complete = !!this.#noBody, this.#bodyStream = void 0;\n const socket = new FakeSocket;\n socket.remoteAddress = url.hostname, socket.remotePort = url.port, this.#fakeSocket = socket, this.url = url.pathname + url.search, this.#nodeReq = this.req = nodeReq, assignHeaders(this, req);\n }\n headers;\n rawHeaders;\n _consuming = !1;\n _dumped = !1;\n #bodyStream;\n #fakeSocket;\n #noBody = !1;\n #aborted = !1;\n #req;\n url;\n #type;\n #nodeReq;\n _construct(callback) {\n if (this.#type === \"response\" || this.#noBody) {\n callback();\n return;\n }\n const contentLength = this.#req.headers.get(\"content-length\");\n if ((contentLength \? parseInt(contentLength, 10) : 0) === 0) {\n this.#noBody = !0, callback();\n return;\n }\n callback();\n }\n async#consumeStream(reader) {\n while (!0) {\n var { done, value } = await reader.readMany();\n if (this.#aborted)\n return;\n if (done) {\n this.push(null), this.destroy();\n break;\n }\n for (var v of value)\n this.push(v);\n }\n }\n _read(size) {\n if (this.#noBody)\n this.push(null), this.complete = !0;\n else if (this.#bodyStream == null) {\n const reader = this.#req.body\?.getReader();\n if (!reader) {\n this.push(null);\n return;\n }\n this.#bodyStream = reader, this.#consumeStream(reader);\n }\n }\n get aborted() {\n return this.#aborted;\n }\n #abort() {\n if (this.#aborted)\n return;\n this.#aborted = !0;\n var bodyStream = this.#bodyStream;\n if (!bodyStream)\n return;\n bodyStream.cancel(), this.complete = !0, this.#bodyStream = void 0, this.push(null);\n }\n get connection() {\n return this.#fakeSocket;\n }\n get statusCode() {\n return this.#req.status;\n }\n get statusMessage() {\n return STATUS_CODES[this.#req.status];\n }\n get httpVersion() {\n return \"1.1\";\n }\n get rawTrailers() {\n return [];\n }\n get httpVersionMajor() {\n return 1;\n }\n get httpVersionMinor() {\n return 1;\n }\n get trailers() {\n return kEmptyObject;\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n}\n\nclass OutgoingMessage extends Writable {\n constructor() {\n super(...arguments);\n }\n #headers;\n headersSent = !1;\n sendDate = !0;\n req;\n timeout;\n #finished = !1;\n [kEndCalled] = !1;\n #fakeSocket;\n #timeoutTimer;\n [kAbortController] = null;\n _implicitHeader() {\n }\n get headers() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n get connection() {\n return this.socket;\n }\n get finished() {\n return this.#finished;\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.removeAllListeners(\"timeout\"), this.#timeoutTimer = void 0;\n }\n #onTimeout() {\n this.#timeoutTimer = void 0, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = void 0;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== void 0)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar OriginalWriteHeadFn, OriginalImplicitHeadFn;\n\nclass ServerResponse extends Writable {\n constructor({ req, reply }) {\n super();\n if (this.req = req, this._reply = reply, this.sendDate = !0, this.statusCode = 200, this.headersSent = !1, this.statusMessage = void 0, this.#controller = void 0, this.#firstWrite = void 0, this._writableState.decodeStrings = !1, this.#deferred = void 0, req.method === \"HEAD\")\n this._hasBody = !1;\n }\n req;\n _reply;\n sendDate;\n statusCode;\n #headers;\n headersSent = !1;\n statusMessage;\n #controller;\n #firstWrite;\n _sent100 = !1;\n _defaultKeepAlive = !1;\n _removedConnection = !1;\n _removedContLen = !1;\n _hasBody = !0;\n #deferred = void 0;\n #finished = !1;\n _implicitHeader() {\n this.writeHead(this.statusCode);\n }\n _write(chunk, encoding, callback) {\n if (!this.#firstWrite && !this.headersSent) {\n this.#firstWrite = chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n controller.write(chunk), callback();\n });\n }\n _writev(chunks, callback) {\n if (chunks.length === 1 && !this.headersSent && !this.#firstWrite) {\n this.#firstWrite = chunks[0].chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n for (let chunk of chunks)\n controller.write(chunk.chunk);\n callback();\n });\n }\n #ensureReadableStreamController(run) {\n var thisController = this.#controller;\n if (thisController)\n return run(thisController);\n this.headersSent = !0;\n var firstWrite = this.#firstWrite;\n this.#firstWrite = void 0, this._reply(new Response(new ReadableStream({\n type: \"direct\",\n pull: (controller) => {\n if (this.#controller = controller, firstWrite)\n controller.write(firstWrite);\n if (firstWrite = void 0, run(controller), !this.#finished)\n return new Promise((resolve) => {\n this.#deferred = resolve;\n });\n }\n }), {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n }));\n }\n #drainHeadersIfObservable() {\n if (this._implicitHeader === OriginalImplicitHeadFn && this.writeHead === OriginalWriteHeadFn)\n return;\n this._implicitHeader();\n }\n _final(callback) {\n if (!this.headersSent) {\n var data = this.#firstWrite || \"\";\n this.#firstWrite = void 0, this.#finished = !0, this.#drainHeadersIfObservable(), this._reply(new Response(data, {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n })), callback && callback();\n return;\n }\n this.#finished = !0, this.#ensureReadableStreamController((controller) => {\n controller.end(), callback();\n var deferred = this.#deferred;\n if (deferred)\n this.#deferred = void 0, deferred();\n });\n }\n writeProcessing() {\n throw new Error(\"not implemented\");\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n assignSocket(socket) {\n throw new Error(\"not implemented\");\n }\n detachSocket(socket) {\n throw new Error(\"not implemented\");\n }\n writeContinue(callback) {\n throw new Error(\"not implemented\");\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n var headers = this.#headers;\n if (!headers)\n return kEmptyObject;\n return headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n writeHead(statusCode, statusMessage, headers) {\n return _writeHead(statusCode, statusMessage, headers, this), this;\n }\n}\nOriginalWriteHeadFn = ServerResponse.prototype.writeHead;\nOriginalImplicitHeadFn = ServerResponse.prototype._implicitHeader;\n\nclass ClientRequest extends OutgoingMessage {\n #timeout;\n #res = null;\n #upgradeOrConnect = !1;\n #parser = null;\n #maxHeadersCount = null;\n #reusedSocket = !1;\n #host;\n #protocol;\n #method;\n #port;\n #useDefaultPort;\n #joinDuplicateHeaders;\n #maxHeaderSize;\n #agent = globalAgent;\n #path;\n #socketPath;\n #bodyChunks = null;\n #fetchRequest;\n #signal = null;\n [kAbortController] = null;\n #timeoutTimer = void 0;\n #options;\n #finished;\n get path() {\n return this.#path;\n }\n get port() {\n return this.#port;\n }\n get method() {\n return this.#method;\n }\n get host() {\n return this.#host;\n }\n get protocol() {\n return this.#protocol;\n }\n _write(chunk, encoding, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = [chunk], callback();\n return;\n }\n this.#bodyChunks.push(chunk), callback();\n }\n _writev(chunks, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = chunks, callback();\n return;\n }\n this.#bodyChunks.push(...chunks), callback();\n }\n _final(callback) {\n if (this.#finished = !0, this[kAbortController] = new AbortController, this[kAbortController].signal.addEventListener(\"abort\", () => {\n this[kClearTimeout]();\n }), this.#signal\?.aborted)\n this[kAbortController].abort();\n var method = this.#method, body = this.#bodyChunks\?.length === 1 \? this.#bodyChunks[0] : Buffer.concat(this.#bodyChunks || []);\n let url, proxy;\n if (this.#path.startsWith(\"http://\") || this.#path.startsWith(\"https://\"))\n url = this.#path, proxy = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}`;\n else\n url = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}${this.#path}`;\n try {\n this.#fetchRequest = fetch(url, {\n method,\n headers: this.getHeaders(),\n body: body && method !== \"GET\" && method !== \"HEAD\" && method !== \"OPTIONS\" \? body : void 0,\n redirect: \"manual\",\n verbose: !1,\n signal: this[kAbortController].signal,\n proxy,\n timeout: !1,\n decompress: !1\n }).then((response) => {\n var res = this.#res = new IncomingMessage(response, {\n type: \"response\",\n [kInternalRequest]: this\n });\n this.emit(\"response\", res);\n }).catch((err) => {\n this.emit(\"error\", err);\n }).finally(() => {\n this.#fetchRequest = null, this[kClearTimeout]();\n });\n } catch (err) {\n this.emit(\"error\", err);\n } finally {\n callback();\n }\n }\n get aborted() {\n return this.#signal\?.aborted || !!this[kAbortController]\?.signal.aborted;\n }\n abort() {\n if (this.aborted)\n return;\n this[kAbortController].abort();\n }\n constructor(input, options, cb) {\n super();\n if (typeof input === \"string\") {\n const urlStr = input;\n try {\n var urlObject = new URL(urlStr);\n } catch (e) {\n @throwTypeError(`Invalid URL: ${urlStr}`);\n }\n input = urlToHttpOptions(urlObject);\n } else if (input && typeof input === \"object\" && input instanceof URL)\n input = urlToHttpOptions(input);\n else\n cb = options, options = input, input = null;\n if (typeof options === \"function\")\n cb = options, options = input || kEmptyObject;\n else\n options = ObjectAssign(input || {}, options);\n var defaultAgent = options._defaultAgent || Agent.globalAgent;\n let protocol = options.protocol;\n if (!protocol)\n if (options.port === 443)\n protocol = \"https:\";\n else\n protocol = defaultAgent.protocol || \"http:\";\n switch (this.#protocol = protocol, this.#agent\?.protocol) {\n case void 0:\n break;\n case \"http:\":\n if (protocol === \"https:\") {\n defaultAgent = this.#agent = getDefaultHTTPSAgent();\n break;\n }\n case \"https:\":\n if (protocol === \"https\") {\n defaultAgent = this.#agent = Agent.globalAgent;\n break;\n }\n default:\n break;\n }\n if (options.path) {\n const path = String(options.path);\n if (RegExpPrototypeExec.call(INVALID_PATH_REGEX, path) !== null)\n throw new Error(\"Path contains unescaped characters\");\n }\n if (protocol !== \"http:\" && protocol !== \"https:\" && protocol) {\n const expectedProtocol = defaultAgent\?.protocol \?\? \"http:\";\n throw new Error(`Protocol mismatch. Expected: ${expectedProtocol}. Got: ${protocol}`);\n }\n const defaultPort = protocol === \"https:\" \? 443 : 80;\n this.#port = options.port || options.defaultPort || this.#agent\?.defaultPort || defaultPort, this.#useDefaultPort = this.#port === defaultPort;\n const host = this.#host = options.host = validateHost(options.hostname, \"hostname\") || validateHost(options.host, \"host\") || \"localhost\";\n this.#socketPath = options.socketPath;\n const signal = options.signal;\n if (signal)\n signal.addEventListener(\"abort\", () => {\n this[kAbortController]\?.abort();\n }), this.#signal = signal;\n let method = options.method;\n const methodIsString = typeof method === \"string\";\n if (method !== null && method !== void 0 && !methodIsString)\n throw new Error(\"ERR_INVALID_ARG_TYPE: options.method\");\n if (methodIsString && method) {\n if (!checkIsHttpToken(method))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN: Method\");\n method = this.#method = StringPrototypeToUpperCase.call(method);\n } else\n method = this.#method = \"GET\";\n const _maxHeaderSize = options.maxHeaderSize;\n this.#maxHeaderSize = _maxHeaderSize;\n var _joinDuplicateHeaders = options.joinDuplicateHeaders;\n if (this.#joinDuplicateHeaders = _joinDuplicateHeaders, this.#path = options.path || \"/\", cb)\n this.once(\"response\", cb);\n this.#finished = !1, this.#res = null, this.#upgradeOrConnect = !1, this.#parser = null, this.#maxHeadersCount = null, this.#reusedSocket = !1, this.#host = host, this.#protocol = protocol;\n var timeout = options.timeout;\n if (timeout !== void 0 && timeout !== 0)\n this.setTimeout(timeout, void 0);\n if (!ArrayIsArray(headers)) {\n var headers = options.headers;\n if (headers)\n for (let key in headers)\n this.setHeader(key, headers[key]);\n var auth = options.auth;\n if (auth && !this.getHeader(\"Authorization\"))\n this.setHeader(\"Authorization\", \"Basic \" + Buffer.from(auth).toString(\"base64\"));\n }\n var { signal: _signal, ...optsWithoutSignal } = options;\n this.#options = optsWithoutSignal;\n }\n setSocketKeepAlive(enable = !0, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.#timeoutTimer = void 0, this.removeAllListeners(\"timeout\");\n }\n #onTimeout() {\n this.#timeoutTimer = void 0, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = void 0;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== void 0)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/, METHODS = [\n \"ACL\",\n \"BIND\",\n \"CHECKOUT\",\n \"CONNECT\",\n \"COPY\",\n \"DELETE\",\n \"GET\",\n \"HEAD\",\n \"LINK\",\n \"LOCK\",\n \"M-SEARCH\",\n \"MERGE\",\n \"MKACTIVITY\",\n \"MKCALENDAR\",\n \"MKCOL\",\n \"MOVE\",\n \"NOTIFY\",\n \"OPTIONS\",\n \"PATCH\",\n \"POST\",\n \"PROPFIND\",\n \"PROPPATCH\",\n \"PURGE\",\n \"PUT\",\n \"REBIND\",\n \"REPORT\",\n \"SEARCH\",\n \"SOURCE\",\n \"SUBSCRIBE\",\n \"TRACE\",\n \"UNBIND\",\n \"UNLINK\",\n \"UNLOCK\",\n \"UNSUBSCRIBE\"\n], STATUS_CODES = {\n 100: \"Continue\",\n 101: \"Switching Protocols\",\n 102: \"Processing\",\n 103: \"Early Hints\",\n 200: \"OK\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"Non-Authoritative Information\",\n 204: \"No Content\",\n 205: \"Reset Content\",\n 206: \"Partial Content\",\n 207: \"Multi-Status\",\n 208: \"Already Reported\",\n 226: \"IM Used\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Found\",\n 303: \"See Other\",\n 304: \"Not Modified\",\n 305: \"Use Proxy\",\n 307: \"Temporary Redirect\",\n 308: \"Permanent Redirect\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a Teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 425: \"Too Early\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Request Header Fields Too Large\",\n 451: \"Unavailable For Legal Reasons\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 509: \"Bandwidth Limit Exceeded\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\"\n}, globalAgent = new Agent;\n$ = {\n Agent,\n Server,\n METHODS,\n STATUS_CODES,\n createServer,\n ServerResponse,\n IncomingMessage,\n request,\n get,\n maxHeaderSize: 16384,\n validateHeaderName,\n validateHeaderValue,\n setMaxIdleHTTPParsers(max) {\n },\n globalAgent,\n ClientRequest,\n OutgoingMessage\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeFSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/fs.ts\nvar getValidatedPath = function(p) {\n if (p instanceof URL)\n return Bun.fileURLToPath(p);\n if (typeof p !== \"string\")\n @throwTypeError(\"Path must be a string or URL.\");\n return (_pathModule \?\?= @getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30)).resolve(p);\n}, watchFile = function(filename, options, listener) {\n if (filename = getValidatedPath(filename), typeof options === \"function\")\n listener = options, options = {};\n if (typeof listener !== \"function\")\n @throwTypeError(\"listener must be a function\");\n var stat = statWatchers.get(filename);\n if (!stat)\n stat = new StatWatcher(filename, options), statWatchers.set(filename, stat);\n return stat.addListener(\"change\", listener), stat;\n}, unwatchFile = function(filename, listener) {\n filename = getValidatedPath(filename);\n var stat = statWatchers.get(filename);\n if (!stat)\n return;\n if (listener) {\n if (stat.removeListener(\"change\", listener), stat.listenerCount(\"change\") !== 0)\n return;\n } else\n stat.removeAllListeners(\"change\");\n stat.stop(), statWatchers.delete(filename);\n}, callbackify = function(fsFunction, args) {\n const callback = args[args.length - 1];\n try {\n var result = fsFunction.@apply(fs, args.slice(0, args.length - 1));\n result.then((...args2) => callback(null, ...args2), (err) => callback(err));\n } catch (e) {\n if (typeof callback === \"function\")\n callback(e);\n else\n throw e;\n }\n}, createReadStream = function(path, options) {\n return new ReadStream(path, options);\n}, WriteStream_handleWrite = function(er, bytes) {\n if (er)\n return WriteStream_errorOrDestroy.@call(this, er);\n this.bytesWritten += bytes;\n}, WriteStream_internalClose = function(err, cb) {\n this[_writeStreamPathFastPathSymbol] = !1;\n var fd = this.fd;\n this[_fs].close(fd, (er) => {\n this.fd = null, cb(err || er);\n });\n}, WriteStream_errorOrDestroy = function(err) {\n var {\n _readableState: r = { destroyed: !1, autoDestroy: !1 },\n _writableState: w = { destroyed: !1, autoDestroy: !1 }\n } = this;\n if (w\?.destroyed || r\?.destroyed)\n return this;\n if (r\?.autoDestroy || w\?.autoDestroy)\n this.destroy(err);\n else if (err)\n this.emit(\"error\", err);\n}, createWriteStream = function(path, options) {\n return new WriteStream(path, options);\n}, cpSync = function(src, dest, options) {\n if (!options)\n return fs.cpSync(src, dest);\n if (typeof options !== \"object\")\n @throwTypeError(\"options must be an object\");\n if (options.dereference || options.filter || options.preserveTimestamps || options.verbatimSymlinks) {\n if (!lazy_cpSync)\n lazy_cpSync = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3);\n return lazy_cpSync(src, dest, options);\n }\n return fs.cpSync(src, dest, options.recursive, options.errorOnExist, options.force \?\? !0, options.mode);\n}, cp = function(src, dest, options, callback) {\n if (typeof options === \"function\")\n callback = options, options = @undefined;\n promises.cp(src, dest, options).then(() => callback(), callback);\n}, _toUnixTimestamp = function(time, name = \"time\") {\n if (typeof time === \"string\" && +time == time)\n return +time;\n if (NumberIsFinite(time)) {\n if (time < 0)\n return DateNow() / 1000;\n return time;\n }\n if (isDate(time))\n return DatePrototypeGetTime(time) / 1000;\n @throwTypeError(`Expected ${name} to be a number or Date`);\n}, $, ReadStream, WriteStream, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), promises = @getInternalField(@internalModuleRegistry, 22) || @createInternalModuleById(22), Stream = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), { isArrayBufferView } = @requireNativeModule(\"util/types\"), _writeStreamPathFastPathSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPath\"), _fs = Symbol.for(\"#fs\"), constants = @processBindingConstants.fs, fs = Bun.fs();\n\nclass FSWatcher extends EventEmitter {\n #watcher;\n #listener;\n constructor(path, options, listener) {\n super();\n if (typeof options === \"function\")\n listener = options, options = {};\n else if (typeof options === \"string\")\n options = { encoding: options };\n if (typeof listener !== \"function\")\n listener = () => {\n };\n this.#listener = listener;\n try {\n this.#watcher = fs.watch(path, options || {}, this.#onEvent.bind(this));\n } catch (e) {\n if (!e.message\?.startsWith(\"FileNotFound\"))\n throw e;\n const notFound = new Error(`ENOENT: no such file or directory, watch '${path}'`);\n throw notFound.code = \"ENOENT\", notFound.errno = -2, notFound.path = path, notFound.syscall = \"watch\", notFound.filename = path, notFound;\n }\n }\n #onEvent(eventType, filenameOrError) {\n if (eventType === \"error\" || eventType === \"close\")\n this.emit(eventType, filenameOrError);\n else\n this.emit(\"change\", eventType, filenameOrError), this.#listener(eventType, filenameOrError);\n }\n close() {\n this.#watcher\?.close(), this.#watcher = null;\n }\n ref() {\n this.#watcher\?.ref();\n }\n unref() {\n this.#watcher\?.unref();\n }\n start() {\n }\n}\n\nclass StatWatcher extends EventEmitter {\n constructor(path, options) {\n super();\n this._handle = fs.watchFile(path, options, this.#onChange.bind(this));\n }\n #onChange(curr, prev) {\n this.emit(\"change\", curr, prev);\n }\n start() {\n }\n stop() {\n this._handle\?.close(), this._handle = null;\n }\n ref() {\n this._handle\?.ref();\n }\n unref() {\n this._handle\?.unref();\n }\n}\nvar access = function access2(...args) {\n callbackify(fs.access, args);\n}, appendFile = function appendFile2(...args) {\n callbackify(fs.appendFile, args);\n}, close = function close2(...args) {\n callbackify(fs.close, args);\n}, rm = function rm2(...args) {\n callbackify(fs.rm, args);\n}, rmdir = function rmdir2(...args) {\n callbackify(fs.rmdir, args);\n}, copyFile = function copyFile2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\") {\n const err = @makeTypeError(\"Callback must be a function\");\n throw err.code = \"ERR_INVALID_ARG_TYPE\", err;\n }\n fs.copyFile(...args).then((result) => callback(null, result), callback);\n}, exists = function exists2(path, callback) {\n if (typeof callback !== \"function\") {\n const err = @makeTypeError(\"Callback must be a function\");\n throw err.code = \"ERR_INVALID_ARG_TYPE\", err;\n }\n try {\n fs.exists.@apply(fs, [path]).then((existed) => callback(existed), (_) => callback(!1));\n } catch (e) {\n callback(!1);\n }\n}, chown = function chown2(...args) {\n callbackify(fs.chown, args);\n}, chmod = function chmod2(...args) {\n callbackify(fs.chmod, args);\n}, fchmod = function fchmod2(...args) {\n callbackify(fs.fchmod, args);\n}, fchown = function fchown2(...args) {\n callbackify(fs.fchown, args);\n}, fstat = function fstat2(...args) {\n callbackify(fs.fstat, args);\n}, fsync = function fsync2(...args) {\n callbackify(fs.fsync, args);\n}, ftruncate = function ftruncate2(...args) {\n callbackify(fs.ftruncate, args);\n}, futimes = function futimes2(...args) {\n callbackify(fs.futimes, args);\n}, lchmod = function lchmod2(...args) {\n callbackify(fs.lchmod, args);\n}, lchown = function lchown2(...args) {\n callbackify(fs.lchown, args);\n}, link = function link2(...args) {\n callbackify(fs.link, args);\n}, mkdir = function mkdir2(...args) {\n callbackify(fs.mkdir, args);\n}, mkdtemp = function mkdtemp2(...args) {\n callbackify(fs.mkdtemp, args);\n}, open = function open2(...args) {\n callbackify(fs.open, args);\n}, read = function read2(fd, buffer, offsetOrOptions, length, position, callback) {\n let offset = offsetOrOptions, params = null;\n if (arguments.length <= 4) {\n if (arguments.length === 4)\n callback = length, params = offsetOrOptions;\n else if (arguments.length === 3) {\n if (!isArrayBufferView(buffer))\n params = buffer, { buffer = @Buffer.alloc(16384) } = params \?\? {};\n callback = offsetOrOptions;\n } else\n callback = buffer, buffer = @Buffer.alloc(16384);\n ({ offset = 0, length = buffer\?.byteLength - offset, position = null } = params \?\? {});\n }\n queueMicrotask(() => {\n try {\n var bytesRead = fs.readSync(fd, buffer, offset, length, position);\n } catch (e) {\n callback(e);\n }\n callback(null, bytesRead, buffer);\n });\n}, write = function write2(...args) {\n callbackify(fs.write, args);\n}, readdir = function readdir2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.readdir(...args).then((result) => callback(null, result), callback);\n}, readFile = function readFile2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.readFile(...args).then((result) => callback(null, result), callback);\n}, writeFile = function writeFile2(...args) {\n callbackify(fs.writeFile, args);\n}, readlink = function readlink2(...args) {\n callbackify(fs.readlink, args);\n}, realpath = function realpath2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.realpath(...args).then((result) => callback(null, result), callback);\n}, rename = function rename2(...args) {\n callbackify(fs.rename, args);\n}, lstat = function lstat2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.lstat(...args).then((result) => callback(null, result), callback);\n}, stat = function stat2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.stat(...args).then((result) => callback(null, result), callback);\n}, symlink = function symlink2(...args) {\n callbackify(fs.symlink, args);\n}, truncate = function truncate2(...args) {\n callbackify(fs.truncate, args);\n}, unlink = function unlink2(...args) {\n callbackify(fs.unlink, args);\n}, utimes = function utimes2(...args) {\n callbackify(fs.utimes, args);\n}, lutimes = function lutimes2(...args) {\n callbackify(fs.lutimes, args);\n}, accessSync = fs.accessSync.bind(fs), appendFileSync = fs.appendFileSync.bind(fs), closeSync = fs.closeSync.bind(fs), copyFileSync = fs.copyFileSync.bind(fs), existsSync = fs.existsSync.bind(fs), chownSync = fs.chownSync.bind(fs), chmodSync = fs.chmodSync.bind(fs), fchmodSync = fs.fchmodSync.bind(fs), fchownSync = fs.fchownSync.bind(fs), fstatSync = fs.fstatSync.bind(fs), fsyncSync = fs.fsyncSync.bind(fs), ftruncateSync = fs.ftruncateSync.bind(fs), futimesSync = fs.futimesSync.bind(fs), lchmodSync = fs.lchmodSync.bind(fs), lchownSync = fs.lchownSync.bind(fs), linkSync = fs.linkSync.bind(fs), lstatSync = fs.lstatSync.bind(fs), mkdirSync = fs.mkdirSync.bind(fs), mkdtempSync = fs.mkdtempSync.bind(fs), openSync = fs.openSync.bind(fs), readSync = fs.readSync.bind(fs), writeSync = fs.writeSync.bind(fs), readdirSync = fs.readdirSync.bind(fs), readFileSync = fs.readFileSync.bind(fs), writeFileSync = fs.writeFileSync.bind(fs), readlinkSync = fs.readlinkSync.bind(fs), realpathSync = fs.realpathSync.bind(fs), renameSync = fs.renameSync.bind(fs), statSync = fs.statSync.bind(fs), symlinkSync = fs.symlinkSync.bind(fs), truncateSync = fs.truncateSync.bind(fs), unlinkSync = fs.unlinkSync.bind(fs), utimesSync = fs.utimesSync.bind(fs), lutimesSync = fs.lutimesSync.bind(fs), rmSync = fs.rmSync.bind(fs), rmdirSync = fs.rmdirSync.bind(fs), writev = (fd, buffers, position, callback) => {\n if (typeof position === \"function\")\n callback = position, position = null;\n queueMicrotask(() => {\n try {\n var written = fs.writevSync(fd, buffers, position);\n } catch (e) {\n callback(e);\n }\n callback(null, written, buffers);\n });\n}, writevSync = fs.writevSync.bind(fs), readv = (fd, buffers, position, callback) => {\n if (typeof position === \"function\")\n callback = position, position = null;\n queueMicrotask(() => {\n try {\n var written = fs.readvSync(fd, buffers, position);\n } catch (e) {\n callback(e);\n }\n callback(null, written, buffers);\n });\n}, readvSync = fs.readvSync.bind(fs), Dirent = fs.Dirent, Stats = fs.Stats, watch = function watch2(path, options, listener) {\n return new FSWatcher(path, options, listener);\n}, statWatchers = new Map, _pathModule, readStreamPathFastPathSymbol = Symbol.for(\"Bun.Node.readStreamPathFastPath\"), readStreamSymbol = Symbol.for(\"Bun.NodeReadStream\"), readStreamPathOrFdSymbol = Symbol.for(\"Bun.NodeReadStreamPathOrFd\"), writeStreamSymbol = Symbol.for(\"Bun.NodeWriteStream\"), writeStreamPathFastPathSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPath\"), writeStreamPathFastPathCallSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPathCall\"), kIoDone = Symbol.for(\"kIoDone\"), defaultReadStreamOptions = {\n file: @undefined,\n fd: null,\n flags: \"r\",\n encoding: @undefined,\n mode: 438,\n autoClose: !0,\n emitClose: !0,\n start: 0,\n end: @Infinity,\n highWaterMark: 65536,\n fs: {\n read,\n open: (path, flags, mode, cb) => {\n var fd;\n try {\n fd = openSync(path, flags, mode);\n } catch (e) {\n cb(e);\n return;\n }\n cb(null, fd);\n },\n openSync,\n close\n },\n autoDestroy: !0\n}, ReadStreamClass;\nReadStream = function(InternalReadStream) {\n ReadStreamClass = InternalReadStream, Object.defineProperty(ReadStreamClass.prototype, Symbol.toStringTag, {\n value: \"ReadStream\",\n enumerable: !1\n });\n function ReadStream3(path, options) {\n return new InternalReadStream(path, options);\n }\n return ReadStream3.prototype = InternalReadStream.prototype, Object.defineProperty(ReadStream3, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalReadStream;\n }\n });\n}(class ReadStream2 extends Stream._getNativeReadableStreamPrototype(2, Stream.Readable) {\n constructor(pathOrFd, options = defaultReadStreamOptions) {\n if (typeof options !== \"object\" || !options)\n @throwTypeError(\"Expected options to be an object\");\n var {\n flags = defaultReadStreamOptions.flags,\n encoding = defaultReadStreamOptions.encoding,\n mode = defaultReadStreamOptions.mode,\n autoClose = defaultReadStreamOptions.autoClose,\n emitClose = defaultReadStreamOptions.emitClose,\n start = defaultReadStreamOptions.start,\n end = defaultReadStreamOptions.end,\n autoDestroy = defaultReadStreamOptions.autoClose,\n fs: fs2 = defaultReadStreamOptions.fs,\n highWaterMark = defaultReadStreamOptions.highWaterMark,\n fd = defaultReadStreamOptions.fd\n } = options;\n if (pathOrFd\?.constructor\?.name === \"URL\")\n pathOrFd = Bun.fileURLToPath(pathOrFd);\n var tempThis = {};\n if (fd != null) {\n if (typeof fd !== \"number\")\n @throwTypeError(\"Expected options.fd to be a number\");\n tempThis.fd = tempThis[readStreamPathOrFdSymbol] = fd, tempThis.autoClose = !1;\n } else if (typeof pathOrFd === \"string\") {\n if (pathOrFd.startsWith(\"file://\"))\n pathOrFd = Bun.fileURLToPath(pathOrFd);\n if (pathOrFd.length === 0)\n @throwTypeError(\"Expected path to be a non-empty string\");\n tempThis.path = tempThis.file = tempThis[readStreamPathOrFdSymbol] = pathOrFd;\n } else if (typeof pathOrFd === \"number\") {\n if (pathOrFd |= 0, pathOrFd < 0)\n @throwTypeError(\"Expected fd to be a positive integer\");\n tempThis.fd = tempThis[readStreamPathOrFdSymbol] = pathOrFd, tempThis.autoClose = !1;\n } else\n @throwTypeError(\"Expected a path or file descriptor\");\n if (tempThis.fd === @undefined)\n tempThis.fd = fs2.openSync(pathOrFd, flags, mode);\n var fileRef = Bun.file(tempThis.fd), stream = fileRef.stream(), native = @direct(stream);\n if (!native)\n throw new Error(\"no native readable stream\");\n var { stream: ptr } = native;\n super(ptr, {\n ...options,\n encoding,\n autoDestroy,\n autoClose,\n emitClose,\n highWaterMark\n });\n if (Object.assign(this, tempThis), this.#fileRef = fileRef, this.end = end, this._read = this.#internalRead, this.start = start, this.flags = flags, this.mode = mode, this.emitClose = emitClose, this[readStreamPathFastPathSymbol] = start === 0 && end === @Infinity && autoClose && fs2 === defaultReadStreamOptions.fs && (encoding === \"buffer\" || encoding === \"binary\" || encoding == null || encoding === \"utf-8\" || encoding === \"utf8\"), this._readableState.autoClose = autoDestroy = autoClose, this._readableState.highWaterMark = highWaterMark, start !== @undefined)\n this.pos = start;\n }\n #fileRef;\n #fs;\n file;\n path;\n fd = null;\n flags;\n mode;\n start;\n end;\n pos;\n bytesRead = 0;\n #fileSize = -1;\n _read;\n [readStreamSymbol] = !0;\n [readStreamPathOrFdSymbol];\n [readStreamPathFastPathSymbol];\n _construct(callback) {\n if (super._construct)\n super._construct(callback);\n else\n callback();\n this.emit(\"open\", this.fd), this.emit(\"ready\");\n }\n _destroy(err, cb) {\n super._destroy(err, cb);\n try {\n var fd = this.fd;\n if (this[readStreamPathFastPathSymbol] = !1, !fd)\n cb(err);\n else\n this.#fs.close(fd, (er) => {\n cb(er || err);\n }), this.fd = null;\n } catch (e) {\n throw e;\n }\n }\n close(cb) {\n if (typeof cb === \"function\")\n Stream.eos(this, cb);\n this.destroy();\n }\n push(chunk) {\n var bytesRead = chunk\?.length \?\? 0;\n if (bytesRead > 0) {\n this.bytesRead += bytesRead;\n var currPos = this.pos;\n if (currPos !== @undefined) {\n if (this.bytesRead < currPos)\n return !0;\n if (currPos === this.start) {\n var n = this.bytesRead - currPos;\n chunk = chunk.slice(-n);\n var [_, ...rest] = arguments;\n if (this.pos = this.bytesRead, this.end !== @undefined && this.bytesRead > this.end)\n chunk = chunk.slice(0, this.end - this.start + 1);\n return super.push(chunk, ...rest);\n }\n var end = this.end;\n if (end !== @undefined && this.bytesRead > end) {\n chunk = chunk.slice(0, end - currPos + 1);\n var [_, ...rest] = arguments;\n return this.pos = this.bytesRead, super.push(chunk, ...rest);\n }\n this.pos = this.bytesRead;\n }\n }\n return super.push(...arguments);\n }\n #internalRead(n) {\n var { pos, end, bytesRead, fd, encoding } = this;\n if (n = pos !== @undefined \? Math.min(end - pos + 1, n) : Math.min(end - bytesRead + 1, n), n <= 0) {\n this.push(null);\n return;\n }\n if (this.#fileSize === -1 && bytesRead === 0 && pos === @undefined) {\n var stat3 = fstatSync(fd);\n if (this.#fileSize = stat3.size, this.#fileSize > 0 && n > this.#fileSize)\n n = this.#fileSize + 1;\n }\n this[kIoDone] = !1;\n var res = super._read(n);\n if (@isPromise(res)) {\n var then = res\?.then;\n if (then && @isCallable(then))\n res.then(() => {\n if (this[kIoDone] = !0, this.destroyed)\n this.emit(kIoDone);\n }, (er) => {\n this[kIoDone] = !0, this.#errorOrDestroy(er);\n });\n } else if (this[kIoDone] = !0, this.destroyed)\n this.emit(kIoDone), this.#errorOrDestroy(new Error(\"ERR_STREAM_PREMATURE_CLOSE\"));\n }\n #errorOrDestroy(err, sync = null) {\n var {\n _readableState: r = { destroyed: !1, autoDestroy: !1 },\n _writableState: w = { destroyed: !1, autoDestroy: !1 }\n } = this;\n if (w\?.destroyed || r\?.destroyed)\n return this;\n if (r\?.autoDestroy || w\?.autoDestroy)\n this.destroy(err);\n else if (err)\n this.emit(\"error\", err);\n }\n pause() {\n return this[readStreamPathFastPathSymbol] = !1, super.pause();\n }\n resume() {\n return this[readStreamPathFastPathSymbol] = !1, super.resume();\n }\n unshift(...args) {\n return this[readStreamPathFastPathSymbol] = !1, super.unshift(...args);\n }\n pipe(dest, pipeOpts) {\n if (this[readStreamPathFastPathSymbol] && (pipeOpts\?.end \?\? !0) && this._readableState\?.pipes\?.length === 0) {\n if ((writeStreamPathFastPathSymbol in dest) && dest[writeStreamPathFastPathSymbol]) {\n if (dest[writeStreamPathFastPathCallSymbol](this, pipeOpts))\n return this;\n }\n }\n return this[readStreamPathFastPathSymbol] = !1, super.pipe(dest, pipeOpts);\n }\n});\nvar defaultWriteStreamOptions = {\n fd: null,\n start: @undefined,\n pos: @undefined,\n encoding: @undefined,\n flags: \"w\",\n mode: 438,\n fs: {\n write,\n close,\n open,\n openSync\n }\n}, WriteStreamClass = WriteStream = function WriteStream2(path, options = defaultWriteStreamOptions) {\n if (!(this instanceof WriteStream2))\n return new WriteStream2(path, options);\n if (!options)\n @throwTypeError(\"Expected options to be an object\");\n var {\n fs: fs2 = defaultWriteStreamOptions.fs,\n start = defaultWriteStreamOptions.start,\n flags = defaultWriteStreamOptions.flags,\n mode = defaultWriteStreamOptions.mode,\n autoClose = !0,\n emitClose = !1,\n autoDestroy = autoClose,\n encoding = defaultWriteStreamOptions.encoding,\n fd = defaultWriteStreamOptions.fd,\n pos = defaultWriteStreamOptions.pos\n } = options, tempThis = {};\n if (fd != null) {\n if (typeof fd !== \"number\")\n throw new Error(\"Expected options.fd to be a number\");\n tempThis.fd = fd, tempThis[_writeStreamPathFastPathSymbol] = !1;\n } else if (typeof path === \"string\") {\n if (path.length === 0)\n @throwTypeError(\"Expected a non-empty path\");\n if (path.startsWith(\"file:\"))\n path = Bun.fileURLToPath(path);\n tempThis.path = path, tempThis.fd = null, tempThis[_writeStreamPathFastPathSymbol] = autoClose && (start === @undefined || start === 0) && fs2.write === defaultWriteStreamOptions.fs.write && fs2.close === defaultWriteStreamOptions.fs.close;\n }\n if (tempThis.fd == null)\n tempThis.fd = fs2.openSync(path, flags, mode);\n if (NativeWritable.@call(this, tempThis.fd, {\n ...options,\n decodeStrings: !1,\n autoDestroy,\n emitClose,\n fd: tempThis\n }), Object.assign(this, tempThis), typeof fs2\?.write !== \"function\")\n @throwTypeError(\"Expected fs.write to be a function\");\n if (typeof fs2\?.close !== \"function\")\n @throwTypeError(\"Expected fs.close to be a function\");\n if (typeof fs2\?.open !== \"function\")\n @throwTypeError(\"Expected fs.open to be a function\");\n if (typeof path === \"object\" && path) {\n if (path instanceof URL)\n path = Bun.fileURLToPath(path);\n }\n if (typeof path !== \"string\" && typeof fd !== \"number\")\n @throwTypeError(\"Expected a path or file descriptor\");\n if (this.start = start, this[_fs] = fs2, this.flags = flags, this.mode = mode, this.bytesWritten = 0, this[writeStreamSymbol] = !0, this[kIoDone] = !1, this.start !== @undefined)\n this.pos = this.start;\n if (encoding !== defaultWriteStreamOptions.encoding) {\n if (this.setDefaultEncoding(encoding), encoding !== \"buffer\" && encoding !== \"utf8\" && encoding !== \"utf-8\" && encoding !== \"binary\")\n this[_writeStreamPathFastPathSymbol] = !1;\n }\n return this;\n}, NativeWritable = Stream.NativeWritable, WriteStreamPrototype = WriteStream.prototype = Object.create(NativeWritable.prototype);\nObject.defineProperties(WriteStreamPrototype, {\n autoClose: {\n get() {\n return this._writableState.autoDestroy;\n },\n set(val) {\n this._writableState.autoDestroy = val;\n }\n },\n pending: {\n get() {\n return this.fd === null;\n }\n }\n});\nWriteStreamPrototype.destroySoon = WriteStreamPrototype.end;\nWriteStreamPrototype.open = function open3() {\n};\nWriteStreamPrototype[writeStreamPathFastPathCallSymbol] = function WriteStreamPathFastPathCallSymbol(readStream, pipeOpts) {\n if (!this[_writeStreamPathFastPathSymbol])\n return !1;\n if (this.fd !== null)\n return this[_writeStreamPathFastPathSymbol] = !1, !1;\n return this[kIoDone] = !1, readStream[kIoDone] = !1, Bun.write(this[_writeStreamPathFastPathSymbol], readStream[readStreamPathOrFdSymbol]).then((bytesWritten) => {\n readStream[kIoDone] = this[kIoDone] = !0, this.bytesWritten += bytesWritten, readStream.bytesRead += bytesWritten, this.end(), readStream.close();\n }, (err) => {\n readStream[kIoDone] = this[kIoDone] = !0, WriteStream_errorOrDestroy.@call(this, err), readStream.emit(\"error\", err);\n });\n};\nWriteStreamPrototype.isBunFastPathEnabled = function isBunFastPathEnabled() {\n return this[_writeStreamPathFastPathSymbol];\n};\nWriteStreamPrototype.disableBunFastPath = function disableBunFastPath() {\n this[_writeStreamPathFastPathSymbol] = !1;\n};\nWriteStreamPrototype._construct = function _construct(callback) {\n if (typeof this.fd === \"number\") {\n callback();\n return;\n }\n callback(), this.emit(\"open\", this.fd), this.emit(\"ready\");\n};\nWriteStreamPrototype._destroy = function _destroy(err, cb) {\n if (this.fd === null)\n return cb(err);\n if (this[kIoDone]) {\n this.once(kIoDone, () => WriteStream_internalClose.@call(this, err, cb));\n return;\n }\n WriteStream_internalClose.@call(this, err, cb);\n};\nWriteStreamPrototype.close = function close3(cb) {\n if (cb) {\n if (this.closed) {\n process.nextTick(cb);\n return;\n }\n this.on(\"close\", cb);\n }\n if (!this.autoClose)\n this.on(\"finish\", this.destroy);\n this.end();\n};\nWriteStreamPrototype.write = function write3(chunk, encoding, cb) {\n if (encoding \?\?= this._writableState\?.defaultEncoding, this[_writeStreamPathFastPathSymbol] = !1, typeof chunk === \"string\")\n chunk = @Buffer.from(chunk, encoding);\n var native = this.pos === @undefined;\n const callback = native \? (err, bytes) => {\n if (this[kIoDone] = !1, WriteStream_handleWrite.@call(this, err, bytes), this.emit(kIoDone), cb)\n !err \? cb() : cb(err);\n } : () => {\n };\n if (this[kIoDone] = !0, this._write)\n return this._write(chunk, encoding, callback);\n else\n return NativeWritable.prototype.write.@call(this, chunk, encoding, callback, native);\n};\nWriteStreamPrototype._write = @undefined;\nWriteStreamPrototype._writev = @undefined;\nWriteStreamPrototype.end = function end(chunk, encoding, cb) {\n var native = this.pos === @undefined;\n return NativeWritable.prototype.end.@call(this, chunk, encoding, cb, native);\n};\nWriteStreamPrototype._destroy = function _destroy2(err, cb) {\n this.close(err, cb);\n};\nObject.defineProperties(fs, {\n createReadStream: {\n value: createReadStream\n },\n createWriteStream: {\n value: createWriteStream\n },\n ReadStream: {\n value: ReadStream\n },\n WriteStream: {\n value: WriteStream\n }\n});\nrealpath.native = realpath;\nrealpathSync.native = realpathSync;\nvar lazy_cpSync = null;\n$ = {\n Dirent,\n FSWatcher,\n ReadStream,\n Stats,\n WriteStream,\n _toUnixTimestamp,\n access,\n accessSync,\n appendFile,\n appendFileSync,\n chmod,\n chmodSync,\n chown,\n chownSync,\n close,\n closeSync,\n constants,\n copyFile,\n copyFileSync,\n cp,\n cpSync,\n createReadStream,\n createWriteStream,\n exists,\n existsSync,\n fchmod,\n fchmodSync,\n fchown,\n fchownSync,\n fstat,\n fstatSync,\n fsync,\n fsyncSync,\n ftruncate,\n ftruncateSync,\n futimes,\n futimesSync,\n lchmod,\n lchmodSync,\n lchown,\n lchownSync,\n link,\n linkSync,\n lstat,\n lstatSync,\n lutimes,\n lutimesSync,\n mkdir,\n mkdirSync,\n mkdtemp,\n mkdtempSync,\n open,\n openSync,\n promises,\n read,\n readFile,\n readFileSync,\n readSync,\n readdir,\n readdirSync,\n readlink,\n readlinkSync,\n readv,\n readvSync,\n realpath,\n realpathSync,\n rename,\n renameSync,\n rm,\n rmSync,\n rmdir,\n rmdirSync,\n stat,\n statSync,\n symlink,\n symlinkSync,\n truncate,\n truncateSync,\n unlink,\n unlinkSync,\n unwatchFile,\n utimes,\n utimesSync,\n watch,\n watchFile,\n write,\n writeFile,\n writeFileSync,\n writeSync,\n writev,\n writevSync,\n [Symbol.for(\"::bunternal::\")]: {\n ReadStreamClass,\n WriteStreamClass\n }\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeHttp2Code = "(function (){\"use strict\";// src/js/out/tmp/node/http2.ts\nvar connect = function() {\n throwNotImplemented(\"node:http2 connect\", 887);\n}, createServer = function() {\n throwNotImplemented(\"node:http2 createServer\", 887);\n}, createSecureServer = function() {\n throwNotImplemented(\"node:http2 createSecureServer\", 887);\n}, getDefaultSettings = function() {\n return {\n headerTableSize: 4096,\n enablePush: !0,\n initialWindowSize: 65535,\n maxFrameSize: 16384,\n maxConcurrentStreams: 4294967295,\n maxHeaderSize: 65535,\n maxHeaderListSize: 65535,\n enableConnectProtocol: !1\n };\n}, getPackedSettings = function() {\n return Buffer.alloc(0);\n}, getUnpackedSettings = function() {\n return Buffer.alloc(0);\n}, Http2ServerRequest = function() {\n throwNotImplemented(\"node:http2 Http2ServerRequest\", 887);\n}, Http2ServerResponse = function() {\n throwNotImplemented(\"node:http2 Http2ServerResponse\", 887);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), constants = {\n NGHTTP2_ERR_FRAME_SIZE_ERROR: -522,\n NGHTTP2_SESSION_SERVER: 0,\n NGHTTP2_SESSION_CLIENT: 1,\n NGHTTP2_STREAM_STATE_IDLE: 1,\n NGHTTP2_STREAM_STATE_OPEN: 2,\n NGHTTP2_STREAM_STATE_RESERVED_LOCAL: 3,\n NGHTTP2_STREAM_STATE_RESERVED_REMOTE: 4,\n NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: 5,\n NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: 6,\n NGHTTP2_STREAM_STATE_CLOSED: 7,\n NGHTTP2_FLAG_NONE: 0,\n NGHTTP2_FLAG_END_STREAM: 1,\n NGHTTP2_FLAG_END_HEADERS: 4,\n NGHTTP2_FLAG_ACK: 1,\n NGHTTP2_FLAG_PADDED: 8,\n NGHTTP2_FLAG_PRIORITY: 32,\n DEFAULT_SETTINGS_HEADER_TABLE_SIZE: 4096,\n DEFAULT_SETTINGS_ENABLE_PUSH: 1,\n DEFAULT_SETTINGS_MAX_CONCURRENT_STREAMS: 4294967295,\n DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: 65535,\n DEFAULT_SETTINGS_MAX_FRAME_SIZE: 16384,\n DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE: 65535,\n DEFAULT_SETTINGS_ENABLE_CONNECT_PROTOCOL: 0,\n MAX_MAX_FRAME_SIZE: 16777215,\n MIN_MAX_FRAME_SIZE: 16384,\n MAX_INITIAL_WINDOW_SIZE: 2147483647,\n NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: 1,\n NGHTTP2_SETTINGS_ENABLE_PUSH: 2,\n NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: 3,\n NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: 4,\n NGHTTP2_SETTINGS_MAX_FRAME_SIZE: 5,\n NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: 6,\n NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL: 8,\n PADDING_STRATEGY_NONE: 0,\n PADDING_STRATEGY_ALIGNED: 1,\n PADDING_STRATEGY_MAX: 2,\n PADDING_STRATEGY_CALLBACK: 1,\n NGHTTP2_NO_ERROR: 0,\n NGHTTP2_PROTOCOL_ERROR: 1,\n NGHTTP2_INTERNAL_ERROR: 2,\n NGHTTP2_FLOW_CONTROL_ERROR: 3,\n NGHTTP2_SETTINGS_TIMEOUT: 4,\n NGHTTP2_STREAM_CLOSED: 5,\n NGHTTP2_FRAME_SIZE_ERROR: 6,\n NGHTTP2_REFUSED_STREAM: 7,\n NGHTTP2_CANCEL: 8,\n NGHTTP2_COMPRESSION_ERROR: 9,\n NGHTTP2_CONNECT_ERROR: 10,\n NGHTTP2_ENHANCE_YOUR_CALM: 11,\n NGHTTP2_INADEQUATE_SECURITY: 12,\n NGHTTP2_HTTP_1_1_REQUIRED: 13,\n NGHTTP2_DEFAULT_WEIGHT: 16,\n HTTP2_HEADER_STATUS: \":status\",\n HTTP2_HEADER_METHOD: \":method\",\n HTTP2_HEADER_AUTHORITY: \":authority\",\n HTTP2_HEADER_SCHEME: \":scheme\",\n HTTP2_HEADER_PATH: \":path\",\n HTTP2_HEADER_PROTOCOL: \":protocol\",\n HTTP2_HEADER_ACCEPT_ENCODING: \"accept-encoding\",\n HTTP2_HEADER_ACCEPT_LANGUAGE: \"accept-language\",\n HTTP2_HEADER_ACCEPT_RANGES: \"accept-ranges\",\n HTTP2_HEADER_ACCEPT: \"accept\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS: \"access-control-allow-credentials\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_HEADERS: \"access-control-allow-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_METHODS: \"access-control-allow-methods\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: \"access-control-allow-origin\",\n HTTP2_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS: \"access-control-expose-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_REQUEST_HEADERS: \"access-control-request-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_REQUEST_METHOD: \"access-control-request-method\",\n HTTP2_HEADER_AGE: \"age\",\n HTTP2_HEADER_AUTHORIZATION: \"authorization\",\n HTTP2_HEADER_CACHE_CONTROL: \"cache-control\",\n HTTP2_HEADER_CONNECTION: \"connection\",\n HTTP2_HEADER_CONTENT_DISPOSITION: \"content-disposition\",\n HTTP2_HEADER_CONTENT_ENCODING: \"content-encoding\",\n HTTP2_HEADER_CONTENT_LENGTH: \"content-length\",\n HTTP2_HEADER_CONTENT_TYPE: \"content-type\",\n HTTP2_HEADER_COOKIE: \"cookie\",\n HTTP2_HEADER_DATE: \"date\",\n HTTP2_HEADER_ETAG: \"etag\",\n HTTP2_HEADER_FORWARDED: \"forwarded\",\n HTTP2_HEADER_HOST: \"host\",\n HTTP2_HEADER_IF_MODIFIED_SINCE: \"if-modified-since\",\n HTTP2_HEADER_IF_NONE_MATCH: \"if-none-match\",\n HTTP2_HEADER_IF_RANGE: \"if-range\",\n HTTP2_HEADER_LAST_MODIFIED: \"last-modified\",\n HTTP2_HEADER_LINK: \"link\",\n HTTP2_HEADER_LOCATION: \"location\",\n HTTP2_HEADER_RANGE: \"range\",\n HTTP2_HEADER_REFERER: \"referer\",\n HTTP2_HEADER_SERVER: \"server\",\n HTTP2_HEADER_SET_COOKIE: \"set-cookie\",\n HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: \"strict-transport-security\",\n HTTP2_HEADER_TRANSFER_ENCODING: \"transfer-encoding\",\n HTTP2_HEADER_TE: \"te\",\n HTTP2_HEADER_UPGRADE_INSECURE_REQUESTS: \"upgrade-insecure-requests\",\n HTTP2_HEADER_UPGRADE: \"upgrade\",\n HTTP2_HEADER_USER_AGENT: \"user-agent\",\n HTTP2_HEADER_VARY: \"vary\",\n HTTP2_HEADER_X_CONTENT_TYPE_OPTIONS: \"x-content-type-options\",\n HTTP2_HEADER_X_FRAME_OPTIONS: \"x-frame-options\",\n HTTP2_HEADER_KEEP_ALIVE: \"keep-alive\",\n HTTP2_HEADER_PROXY_CONNECTION: \"proxy-connection\",\n HTTP2_HEADER_X_XSS_PROTECTION: \"x-xss-protection\",\n HTTP2_HEADER_ALT_SVC: \"alt-svc\",\n HTTP2_HEADER_CONTENT_SECURITY_POLICY: \"content-security-policy\",\n HTTP2_HEADER_EARLY_DATA: \"early-data\",\n HTTP2_HEADER_EXPECT_CT: \"expect-ct\",\n HTTP2_HEADER_ORIGIN: \"origin\",\n HTTP2_HEADER_PURPOSE: \"purpose\",\n HTTP2_HEADER_TIMING_ALLOW_ORIGIN: \"timing-allow-origin\",\n HTTP2_HEADER_X_FORWARDED_FOR: \"x-forwarded-for\",\n HTTP2_HEADER_PRIORITY: \"priority\",\n HTTP2_HEADER_ACCEPT_CHARSET: \"accept-charset\",\n HTTP2_HEADER_ACCESS_CONTROL_MAX_AGE: \"access-control-max-age\",\n HTTP2_HEADER_ALLOW: \"allow\",\n HTTP2_HEADER_CONTENT_LANGUAGE: \"content-language\",\n HTTP2_HEADER_CONTENT_LOCATION: \"content-location\",\n HTTP2_HEADER_CONTENT_MD5: \"content-md5\",\n HTTP2_HEADER_CONTENT_RANGE: \"content-range\",\n HTTP2_HEADER_DNT: \"dnt\",\n HTTP2_HEADER_EXPECT: \"expect\",\n HTTP2_HEADER_EXPIRES: \"expires\",\n HTTP2_HEADER_FROM: \"from\",\n HTTP2_HEADER_IF_MATCH: \"if-match\",\n HTTP2_HEADER_IF_UNMODIFIED_SINCE: \"if-unmodified-since\",\n HTTP2_HEADER_MAX_FORWARDS: \"max-forwards\",\n HTTP2_HEADER_PREFER: \"prefer\",\n HTTP2_HEADER_PROXY_AUTHENTICATE: \"proxy-authenticate\",\n HTTP2_HEADER_PROXY_AUTHORIZATION: \"proxy-authorization\",\n HTTP2_HEADER_REFRESH: \"refresh\",\n HTTP2_HEADER_RETRY_AFTER: \"retry-after\",\n HTTP2_HEADER_TRAILER: \"trailer\",\n HTTP2_HEADER_TK: \"tk\",\n HTTP2_HEADER_VIA: \"via\",\n HTTP2_HEADER_WARNING: \"warning\",\n HTTP2_HEADER_WWW_AUTHENTICATE: \"www-authenticate\",\n HTTP2_HEADER_HTTP2_SETTINGS: \"http2-settings\",\n HTTP2_METHOD_ACL: \"ACL\",\n HTTP2_METHOD_BASELINE_CONTROL: \"BASELINE-CONTROL\",\n HTTP2_METHOD_BIND: \"BIND\",\n HTTP2_METHOD_CHECKIN: \"CHECKIN\",\n HTTP2_METHOD_CHECKOUT: \"CHECKOUT\",\n HTTP2_METHOD_CONNECT: \"CONNECT\",\n HTTP2_METHOD_COPY: \"COPY\",\n HTTP2_METHOD_DELETE: \"DELETE\",\n HTTP2_METHOD_GET: \"GET\",\n HTTP2_METHOD_HEAD: \"HEAD\",\n HTTP2_METHOD_LABEL: \"LABEL\",\n HTTP2_METHOD_LINK: \"LINK\",\n HTTP2_METHOD_LOCK: \"LOCK\",\n HTTP2_METHOD_MERGE: \"MERGE\",\n HTTP2_METHOD_MKACTIVITY: \"MKACTIVITY\",\n HTTP2_METHOD_MKCALENDAR: \"MKCALENDAR\",\n HTTP2_METHOD_MKCOL: \"MKCOL\",\n HTTP2_METHOD_MKREDIRECTREF: \"MKREDIRECTREF\",\n HTTP2_METHOD_MKWORKSPACE: \"MKWORKSPACE\",\n HTTP2_METHOD_MOVE: \"MOVE\",\n HTTP2_METHOD_OPTIONS: \"OPTIONS\",\n HTTP2_METHOD_ORDERPATCH: \"ORDERPATCH\",\n HTTP2_METHOD_PATCH: \"PATCH\",\n HTTP2_METHOD_POST: \"POST\",\n HTTP2_METHOD_PRI: \"PRI\",\n HTTP2_METHOD_PROPFIND: \"PROPFIND\",\n HTTP2_METHOD_PROPPATCH: \"PROPPATCH\",\n HTTP2_METHOD_PUT: \"PUT\",\n HTTP2_METHOD_REBIND: \"REBIND\",\n HTTP2_METHOD_REPORT: \"REPORT\",\n HTTP2_METHOD_SEARCH: \"SEARCH\",\n HTTP2_METHOD_TRACE: \"TRACE\",\n HTTP2_METHOD_UNBIND: \"UNBIND\",\n HTTP2_METHOD_UNCHECKOUT: \"UNCHECKOUT\",\n HTTP2_METHOD_UNLINK: \"UNLINK\",\n HTTP2_METHOD_UNLOCK: \"UNLOCK\",\n HTTP2_METHOD_UPDATE: \"UPDATE\",\n HTTP2_METHOD_UPDATEREDIRECTREF: \"UPDATEREDIRECTREF\",\n HTTP2_METHOD_VERSION_CONTROL: \"VERSION-CONTROL\",\n HTTP_STATUS_CONTINUE: 100,\n HTTP_STATUS_SWITCHING_PROTOCOLS: 101,\n HTTP_STATUS_PROCESSING: 102,\n HTTP_STATUS_EARLY_HINTS: 103,\n HTTP_STATUS_OK: 200,\n HTTP_STATUS_CREATED: 201,\n HTTP_STATUS_ACCEPTED: 202,\n HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: 203,\n HTTP_STATUS_NO_CONTENT: 204,\n HTTP_STATUS_RESET_CONTENT: 205,\n HTTP_STATUS_PARTIAL_CONTENT: 206,\n HTTP_STATUS_MULTI_STATUS: 207,\n HTTP_STATUS_ALREADY_REPORTED: 208,\n HTTP_STATUS_IM_USED: 226,\n HTTP_STATUS_MULTIPLE_CHOICES: 300,\n HTTP_STATUS_MOVED_PERMANENTLY: 301,\n HTTP_STATUS_FOUND: 302,\n HTTP_STATUS_SEE_OTHER: 303,\n HTTP_STATUS_NOT_MODIFIED: 304,\n HTTP_STATUS_USE_PROXY: 305,\n HTTP_STATUS_TEMPORARY_REDIRECT: 307,\n HTTP_STATUS_PERMANENT_REDIRECT: 308,\n HTTP_STATUS_BAD_REQUEST: 400,\n HTTP_STATUS_UNAUTHORIZED: 401,\n HTTP_STATUS_PAYMENT_REQUIRED: 402,\n HTTP_STATUS_FORBIDDEN: 403,\n HTTP_STATUS_NOT_FOUND: 404,\n HTTP_STATUS_METHOD_NOT_ALLOWED: 405,\n HTTP_STATUS_NOT_ACCEPTABLE: 406,\n HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: 407,\n HTTP_STATUS_REQUEST_TIMEOUT: 408,\n HTTP_STATUS_CONFLICT: 409,\n HTTP_STATUS_GONE: 410,\n HTTP_STATUS_LENGTH_REQUIRED: 411,\n HTTP_STATUS_PRECONDITION_FAILED: 412,\n HTTP_STATUS_PAYLOAD_TOO_LARGE: 413,\n HTTP_STATUS_URI_TOO_LONG: 414,\n HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: 415,\n HTTP_STATUS_RANGE_NOT_SATISFIABLE: 416,\n HTTP_STATUS_EXPECTATION_FAILED: 417,\n HTTP_STATUS_TEAPOT: 418,\n HTTP_STATUS_MISDIRECTED_REQUEST: 421,\n HTTP_STATUS_UNPROCESSABLE_ENTITY: 422,\n HTTP_STATUS_LOCKED: 423,\n HTTP_STATUS_FAILED_DEPENDENCY: 424,\n HTTP_STATUS_TOO_EARLY: 425,\n HTTP_STATUS_UPGRADE_REQUIRED: 426,\n HTTP_STATUS_PRECONDITION_REQUIRED: 428,\n HTTP_STATUS_TOO_MANY_REQUESTS: 429,\n HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: 431,\n HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: 451,\n HTTP_STATUS_INTERNAL_SERVER_ERROR: 500,\n HTTP_STATUS_NOT_IMPLEMENTED: 501,\n HTTP_STATUS_BAD_GATEWAY: 502,\n HTTP_STATUS_SERVICE_UNAVAILABLE: 503,\n HTTP_STATUS_GATEWAY_TIMEOUT: 504,\n HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: 505,\n HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: 506,\n HTTP_STATUS_INSUFFICIENT_STORAGE: 507,\n HTTP_STATUS_LOOP_DETECTED: 508,\n HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: 509,\n HTTP_STATUS_NOT_EXTENDED: 510,\n HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: 511\n}, sensitiveHeaders = Symbol.for(\"nodejs.http2.sensitiveHeaders\");\nHttp2ServerRequest.prototype = {};\nHttp2ServerResponse.prototype = {};\n$ = {\n constants,\n createServer,\n createSecureServer,\n getDefaultSettings,\n getPackedSettings,\n getUnpackedSettings,\n sensitiveHeaders,\n Http2ServerRequest,\n Http2ServerResponse,\n connect\n};\nhideFromStack([\n Http2ServerRequest,\n Http2ServerResponse,\n connect,\n createServer,\n createSecureServer,\n getDefaultSettings,\n getPackedSettings,\n getUnpackedSettings\n]);\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeFSPromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/fs.promises.ts\nvar watch = function(filename, options = {}) {\n if (filename instanceof URL)\n @throwTypeError(\"Watch URLs are not supported yet\");\n else if (@Buffer.isBuffer(filename))\n filename = filename.toString();\n else if (typeof filename !== \"string\")\n @throwTypeError(\"Expected path to be a string or Buffer\");\n let nextEventResolve = null;\n if (typeof options === \"string\")\n options = { encoding: options };\n const queue = @createFIFO(), watcher = fs.watch(filename, options || {}, (eventType, filename2) => {\n if (queue.push({ eventType, filename: filename2 }), nextEventResolve) {\n const resolve = nextEventResolve;\n nextEventResolve = null, resolve();\n }\n });\n return {\n [Symbol.asyncIterator]() {\n let closed = !1;\n return {\n async next() {\n while (!closed) {\n let event;\n while (event = queue.shift()) {\n if (event.eventType === \"close\")\n return closed = !0, { value: @undefined, done: !0 };\n if (event.eventType === \"error\")\n throw closed = !0, event.filename;\n return { value: event, done: !1 };\n }\n const { promise, resolve } = @Promise.withResolvers();\n nextEventResolve = resolve, await promise;\n }\n return { value: @undefined, done: !0 };\n },\n return() {\n if (!closed) {\n if (watcher.close(), closed = !0, nextEventResolve) {\n const resolve = nextEventResolve;\n nextEventResolve = null, resolve();\n }\n }\n return { value: @undefined, done: !0 };\n }\n };\n }\n };\n}, cp = function(src, dest, options) {\n if (!options)\n return fs.cp(src, dest);\n if (typeof options !== \"object\")\n @throwTypeError(\"options must be an object\");\n if (options.dereference || options.filter || options.preserveTimestamps || options.verbatimSymlinks) {\n if (!lazy_cp)\n lazy_cp = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3);\n return lazy_cp(src, dest, options);\n }\n return fs.cp(src, dest, options.recursive, options.errorOnExist, options.force \?\? !0, options.mode);\n};\nasync function opendir(dir) {\n const entries = await fs.readdir(dir, { withFileTypes: !0 });\n return new Dir(entries);\n}\nvar $, constants = @processBindingConstants.fs, fs = Bun.fs();\nvar lazy_cp = null;\n\nclass Dir {\n #entries;\n constructor(e) {\n this.#entries = e;\n }\n readSync() {\n return this.#entries.shift() \?\? null;\n }\n read(c) {\n if (c)\n process.nextTick(c, null, this.readSync());\n return @Promise.resolve(this.readSync());\n }\n closeSync() {\n }\n close(c) {\n if (c)\n process.nextTick(c);\n return @Promise.resolve();\n }\n *[Symbol.asyncIterator]() {\n var next;\n while (next = this.readSync())\n yield next;\n }\n}\n$ = {\n access: fs.access.bind(fs),\n appendFile: fs.appendFile.bind(fs),\n close: fs.close.bind(fs),\n copyFile: fs.copyFile.bind(fs),\n cp,\n exists: fs.exists.bind(fs),\n chown: fs.chown.bind(fs),\n chmod: fs.chmod.bind(fs),\n fchmod: fs.fchmod.bind(fs),\n fchown: fs.fchown.bind(fs),\n fstat: fs.fstat.bind(fs),\n fsync: fs.fsync.bind(fs),\n ftruncate: fs.ftruncate.bind(fs),\n futimes: fs.futimes.bind(fs),\n lchmod: fs.lchmod.bind(fs),\n lchown: fs.lchown.bind(fs),\n link: fs.link.bind(fs),\n lstat: fs.lstat.bind(fs),\n mkdir: fs.mkdir.bind(fs),\n mkdtemp: fs.mkdtemp.bind(fs),\n open: fs.open.bind(fs),\n read: fs.read.bind(fs),\n write: fs.write.bind(fs),\n readdir: fs.readdir.bind(fs),\n readFile: fs.readFile.bind(fs),\n writeFile: fs.writeFile.bind(fs),\n readlink: fs.readlink.bind(fs),\n realpath: fs.realpath.bind(fs),\n rename: fs.rename.bind(fs),\n stat: fs.stat.bind(fs),\n symlink: fs.symlink.bind(fs),\n truncate: fs.truncate.bind(fs),\n unlink: fs.unlink.bind(fs),\n utimes: fs.utimes.bind(fs),\n lutimes: fs.lutimes.bind(fs),\n rm: fs.rm.bind(fs),\n rmdir: fs.rmdir.bind(fs),\n writev: async (fd, buffers, position) => {\n var bytesWritten = await fs.writev(fd, buffers, position);\n return {\n bytesWritten,\n buffers\n };\n },\n readv: async (fd, buffers, position) => {\n var bytesRead = await fs.readv(fd, buffers, position);\n return {\n bytesRead,\n buffers\n };\n },\n constants,\n watch,\n opendir\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeHttpsCode = "(function (){\"use strict\";// src/js/out/tmp/node/https.ts\nvar request = function(input, options, cb) {\n if (input && typeof input === \"object\" && !(input instanceof URL))\n input.protocol \?\?= \"https:\";\n else if (typeof options === \"object\")\n options.protocol \?\?= \"https:\";\n return http.request(input, options, cb);\n}, get = function(input, options, cb) {\n const req = request(input, options, cb);\n return req.end(), req;\n}, $, http = @getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21);\n$ = {\n ...http,\n get,\n request\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeHttpCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/http.ts\nvar checkInvalidHeaderChar = function(val) {\n return RegExpPrototypeExec.@call(headerCharRegex, val) !== null;\n};\nvar isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof @ArrayBuffer || obj instanceof Blob)\n return !0;\n if (@Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof @ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, validateMsecs = function(numberlike, field) {\n if (typeof numberlike !== \"number\" || numberlike < 0)\n throw new ERR_INVALID_ARG_TYPE(field, \"number\", numberlike);\n return numberlike;\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, createServer = function(options, callback) {\n return new Server(options, callback);\n}, emitListeningNextTick = function(self, onListen, err, hostname, port) {\n if (typeof onListen === \"function\")\n try {\n onListen(err, hostname, port);\n } catch (err2) {\n self.emit(\"error\", err2);\n }\n if (self.listening = !err, err)\n self.emit(\"error\", err);\n else\n self.emit(\"listening\", hostname, port);\n}, assignHeaders = function(object, req) {\n var headers = req.headers.toJSON();\n const rawHeaders = @newArrayWithSize(req.headers.count * 2);\n var i = 0;\n for (let key in headers)\n rawHeaders[i++] = key, rawHeaders[i++] = headers[key];\n object.headers = headers, object.rawHeaders = rawHeaders;\n}, destroyBodyStreamNT = function(bodyStream) {\n bodyStream.destroy();\n}, getDefaultHTTPSAgent = function() {\n return _defaultHTTPSAgent \?\?= new Agent({ defaultPort: 443, protocol: \"https:\" });\n};\nvar urlToHttpOptions = function(url) {\n var { protocol, hostname, hash, search, pathname, href, port, username, password } = url;\n return {\n protocol,\n hostname: typeof hostname === \"string\" && StringPrototypeStartsWith.@call(hostname, \"[\") \? StringPrototypeSlice.@call(hostname, 1, -1) : hostname,\n hash,\n search,\n pathname,\n path: `${pathname || \"\"}${search || \"\"}`,\n href,\n port: port \? Number(port) : protocol === \"https:\" \? 443 : protocol === \"http:\" \? 80 : @undefined,\n auth: username || password \? `${decodeURIComponent(username)}:${decodeURIComponent(password)}` : @undefined\n };\n}, validateHost = function(host, name) {\n if (host !== null && host !== @undefined && typeof host !== \"string\")\n throw new Error(\"Invalid arg type in options\");\n return host;\n}, checkIsHttpToken = function(val) {\n return RegExpPrototypeExec.@call(tokenRegExp, val) !== null;\n};\nvar _writeHead = function(statusCode, reason, obj, response) {\n if (statusCode |= 0, statusCode < 100 || statusCode > 999)\n throw new Error(\"status code must be between 100 and 999\");\n if (typeof reason === \"string\")\n response.statusMessage = reason;\n else {\n if (!response.statusMessage)\n response.statusMessage = STATUS_CODES[statusCode] || \"unknown\";\n obj = reason;\n }\n response.statusCode = statusCode;\n {\n let k;\n if (@Array.isArray(obj)) {\n if (obj.length % 2 !== 0)\n throw new Error(\"raw headers must have an even number of elements\");\n for (let n = 0;n < obj.length; n += 2)\n if (k = obj[n + 0], k)\n response.setHeader(k, obj[n + 1]);\n } else if (obj) {\n const keys = Object.keys(obj);\n for (let i = 0;i < keys.length; i++)\n if (k = keys[i], k)\n response.setHeader(k, obj[k]);\n }\n }\n if (statusCode === 204 || statusCode === 304 || statusCode >= 100 && statusCode <= 199)\n response._hasBody = !1;\n}, request = function(url, options, cb) {\n return new ClientRequest(url, options, cb);\n}, get = function(url, options, cb) {\n const req = request(url, options, cb);\n return req.end(), req;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { isTypedArray } = @requireNativeModule(\"util/types\"), { Duplex, Readable, Writable } = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), { getHeader, setHeader } = @lazy(\"http\"), headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/, validateHeaderName = (name, label) => {\n if (typeof name !== \"string\" || !name || !checkIsHttpToken(name))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN\");\n}, validateHeaderValue = (name, value) => {\n if (value === @undefined)\n throw new Error(\"ERR_HTTP_INVALID_HEADER_VALUE\");\n if (checkInvalidHeaderChar(value))\n throw new Error(\"ERR_INVALID_CHAR\");\n}, { URL } = globalThis, globalReportError = globalThis.reportError, setTimeout = globalThis.setTimeout, fetch = Bun.fetch;\nvar kEmptyObject = Object.freeze(Object.create(null)), kOutHeaders = Symbol.for(\"kOutHeaders\"), kEndCalled = Symbol.for(\"kEndCalled\"), kAbortController = Symbol.for(\"kAbortController\"), kClearTimeout = Symbol(\"kClearTimeout\"), kCorked = Symbol.for(\"kCorked\"), searchParamsSymbol = Symbol.for(\"query\"), StringPrototypeSlice = @String.prototype.slice, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeToUpperCase = @String.prototype.toUpperCase, ArrayIsArray = @Array.isArray, RegExpPrototypeExec = @RegExp.prototype.exec, ObjectAssign = Object.assign, INVALID_PATH_REGEX = /[^\\u0021-\\u00ff]/;\nvar _defaultHTTPSAgent, kInternalRequest = Symbol(\"kInternalRequest\"), kInternalSocketData = Symbol.for(\"::bunternal::\"), kEmptyBuffer = @Buffer.alloc(0);\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\nvar FakeSocket = class Socket extends Duplex {\n [kInternalSocketData];\n bytesRead = 0;\n bytesWritten = 0;\n connecting = !1;\n timeout = 0;\n isServer = !1;\n #address;\n address() {\n var internalData;\n return this.#address \?\?= (internalData = this[kInternalSocketData])\?.[0]\?.requestIP(internalData[2]) \?\? {};\n }\n get bufferSize() {\n return this.writableLength;\n }\n connect(port, host, connectListener) {\n return this;\n }\n _destroy(err, callback) {\n }\n _final(callback) {\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return 80;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n }\n get remoteAddress() {\n return this.address()\?.address;\n }\n set remoteAddress(val) {\n this.address().address = val;\n }\n get remotePort() {\n return this.address()\?.port;\n }\n set remotePort(val) {\n this.address().port = val;\n }\n get remoteFamily() {\n return this.address()\?.family;\n }\n set remoteFamily(val) {\n this.address().family = val;\n }\n resetAndDestroy() {\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n return this;\n }\n unref() {\n }\n _write(chunk, encoding, callback) {\n }\n};\n\nclass Agent extends EventEmitter {\n defaultPort = 80;\n protocol = \"http:\";\n options;\n requests;\n sockets;\n freeSockets;\n keepAliveMsecs;\n keepAlive;\n maxSockets;\n maxFreeSockets;\n scheduling;\n maxTotalSockets;\n totalSocketCount;\n #fakeSocket;\n static get globalAgent() {\n return globalAgent;\n }\n static get defaultMaxSockets() {\n return @Infinity;\n }\n constructor(options = kEmptyObject) {\n super();\n if (this.options = options = { ...options, path: null }, options.noDelay === @undefined)\n options.noDelay = !0;\n this.requests = kEmptyObject, this.sockets = kEmptyObject, this.freeSockets = kEmptyObject, this.keepAliveMsecs = options.keepAliveMsecs || 1000, this.keepAlive = options.keepAlive || !1, this.maxSockets = options.maxSockets || Agent.defaultMaxSockets, this.maxFreeSockets = options.maxFreeSockets || 256, this.scheduling = options.scheduling || \"lifo\", this.maxTotalSockets = options.maxTotalSockets, this.totalSocketCount = 0, this.defaultPort = options.defaultPort || 80, this.protocol = options.protocol || \"http:\";\n }\n createConnection() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n getName(options = kEmptyObject) {\n let name = `http:${options.host || \"localhost\"}:`;\n if (options.port)\n name += options.port;\n if (name += \":\", options.localAddress)\n name += options.localAddress;\n if (options.family === 4 || options.family === 6)\n name += `:${options.family}`;\n if (options.socketPath)\n name += `:${options.socketPath}`;\n return name;\n }\n addRequest() {\n }\n createSocket(req, options, cb) {\n cb(null, this.#fakeSocket \?\?= new FakeSocket);\n }\n removeSocket() {\n }\n keepSocketAlive() {\n return !0;\n }\n reuseSocket() {\n }\n destroy() {\n }\n}\n\nclass Server extends EventEmitter {\n #server;\n #options;\n #tls;\n #is_tls = !1;\n listening = !1;\n serverName;\n constructor(options, callback) {\n super();\n if (typeof options === \"function\")\n callback = options, options = {};\n else if (options == null || typeof options === \"object\") {\n options = { ...options }, this.#tls = null;\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n let serverName = options.servername;\n if (serverName && typeof serverName !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n if (this.#is_tls)\n this.#tls = {\n serverName,\n key,\n cert,\n ca,\n passphrase,\n secureOptions\n };\n else\n this.#tls = null;\n } else\n throw new Error(\"bun-http-polyfill: invalid arguments\");\n if (this.#options = options, callback)\n this.on(\"request\", callback);\n }\n closeAllConnections() {\n const server = this.#server;\n if (!server)\n return;\n this.#server = @undefined, server.stop(!0), this.emit(\"close\");\n }\n closeIdleConnections() {\n }\n close(optionalCallback) {\n const server = this.#server;\n if (!server) {\n if (typeof optionalCallback === \"function\")\n process.nextTick(optionalCallback, new Error(\"Server is not running\"));\n return;\n }\n if (this.#server = @undefined, typeof optionalCallback === \"function\")\n this.once(\"close\", optionalCallback);\n server.stop(), this.emit(\"close\");\n }\n address() {\n if (!this.#server)\n return null;\n return this.#server.address;\n }\n listen(port, host, backlog, onListen) {\n const server = this;\n let socketPath;\n if (typeof port == \"string\" && !Number.isSafeInteger(Number(port)))\n socketPath = port;\n if (typeof host === \"function\")\n onListen = host, host = @undefined;\n if (typeof port === \"function\")\n onListen = port;\n else if (typeof port === \"object\") {\n if (port\?.signal\?.addEventListener(\"abort\", () => {\n this.close();\n }), host = port\?.host, port = port\?.port, typeof port\?.callback === \"function\")\n onListen = port\?.callback;\n }\n if (typeof backlog === \"function\")\n onListen = backlog;\n const ResponseClass = this.#options.ServerResponse || ServerResponse, RequestClass = this.#options.IncomingMessage || IncomingMessage;\n try {\n const tls = this.#tls;\n if (tls)\n this.serverName = tls.serverName || host || \"localhost\";\n this.#server = Bun.serve({\n tls,\n port,\n hostname: host,\n unix: socketPath,\n websocket: {\n open(ws) {\n ws.data.open(ws);\n },\n message(ws, message) {\n ws.data.message(ws, message);\n },\n close(ws, code, reason) {\n ws.data.close(ws, code, reason);\n },\n drain(ws) {\n ws.data.drain(ws);\n }\n },\n fetch(req, _server) {\n var pendingResponse, pendingError, rejectFunction, resolveFunction, reject = (err) => {\n if (pendingError)\n return;\n if (pendingError = err, rejectFunction)\n rejectFunction(err);\n }, reply = function(resp) {\n if (pendingResponse)\n return;\n if (pendingResponse = resp, resolveFunction)\n resolveFunction(resp);\n };\n const http_req = new RequestClass(req), http_res = new ResponseClass({ reply, req: http_req });\n if (http_req.socket[kInternalSocketData] = [_server, http_res, req], http_req.once(\"error\", (err) => reject(err)), http_res.once(\"error\", (err) => reject(err)), req.headers.get(\"upgrade\"))\n server.emit(\"upgrade\", http_req, http_req.socket, kEmptyBuffer);\n else\n server.emit(\"request\", http_req, http_res);\n if (pendingError)\n throw pendingError;\n if (pendingResponse)\n return pendingResponse;\n return new @Promise((resolve, reject2) => {\n resolveFunction = resolve, rejectFunction = reject2;\n });\n }\n }), setTimeout(emitListeningNextTick, 1, this, onListen, null, this.#server.hostname, this.#server.port);\n } catch (err) {\n server.emit(\"error\", err);\n }\n return this;\n }\n setTimeout(msecs, callback) {\n }\n}\nclass IncomingMessage extends Readable {\n method;\n complete;\n constructor(req, defaultIncomingOpts) {\n const method = req.method;\n super();\n const url = new URL(req.url);\n var { type = \"request\", [kInternalRequest]: nodeReq } = defaultIncomingOpts || {};\n this.#noBody = type === \"request\" \? method === \"GET\" || method === \"HEAD\" || method === \"TRACE\" || method === \"CONNECT\" || method === \"OPTIONS\" || (parseInt(req.headers.get(\"Content-Length\") || \"\") || 0) === 0 : !1, this.#req = req, this.method = method, this.#type = type, this.complete = !!this.#noBody, this.#bodyStream = @undefined;\n const socket = new FakeSocket;\n if (url.protocol === \"https:\")\n socket.encrypted = !0;\n this.#fakeSocket = socket, this.url = url.pathname + url.search, this.req = nodeReq, assignHeaders(this, req);\n }\n headers;\n rawHeaders;\n _consuming = !1;\n _dumped = !1;\n #bodyStream;\n #fakeSocket;\n #noBody = !1;\n #aborted = !1;\n #req;\n url;\n #type;\n _construct(callback) {\n if (this.#type === \"response\" || this.#noBody) {\n callback();\n return;\n }\n const contentLength = this.#req.headers.get(\"content-length\");\n if ((contentLength \? parseInt(contentLength, 10) : 0) === 0) {\n this.#noBody = !0, callback();\n return;\n }\n callback();\n }\n async#consumeStream(reader) {\n while (!0) {\n var { done, value } = await reader.readMany();\n if (this.#aborted)\n return;\n if (done) {\n this.push(null), process.nextTick(destroyBodyStreamNT, this);\n break;\n }\n for (var v of value)\n this.push(v);\n }\n }\n _read(size) {\n if (this.#noBody)\n this.push(null), this.complete = !0;\n else if (this.#bodyStream == null) {\n const reader = this.#req.body\?.getReader();\n if (!reader) {\n this.push(null);\n return;\n }\n this.#bodyStream = reader, this.#consumeStream(reader);\n }\n }\n get aborted() {\n return this.#aborted;\n }\n #abort() {\n if (this.#aborted)\n return;\n this.#aborted = !0;\n var bodyStream = this.#bodyStream;\n if (!bodyStream)\n return;\n bodyStream.cancel(), this.complete = !0, this.#bodyStream = @undefined, this.push(null);\n }\n get connection() {\n return this.#fakeSocket;\n }\n get statusCode() {\n return this.#req.status;\n }\n get statusMessage() {\n return STATUS_CODES[this.#req.status];\n }\n get httpVersion() {\n return \"1.1\";\n }\n get rawTrailers() {\n return [];\n }\n get httpVersionMajor() {\n return 1;\n }\n get httpVersionMinor() {\n return 1;\n }\n get trailers() {\n return kEmptyObject;\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n}\n\nclass OutgoingMessage extends Writable {\n constructor() {\n super(...arguments);\n }\n #headers;\n headersSent = !1;\n sendDate = !0;\n req;\n timeout;\n #finished = !1;\n [kEndCalled] = !1;\n #fakeSocket;\n #timeoutTimer;\n [kAbortController] = null;\n _implicitHeader() {\n }\n get headers() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n get connection() {\n return this.socket;\n }\n get finished() {\n return this.#finished;\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.removeAllListeners(\"timeout\"), this.#timeoutTimer = @undefined;\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar OriginalWriteHeadFn, OriginalImplicitHeadFn;\n\nclass ServerResponse extends Writable {\n constructor(c) {\n super();\n if (!c)\n c = {};\n var req = c.req || {}, reply = c.reply;\n if (this.req = req, this._reply = reply, this.sendDate = !0, this.statusCode = 200, this.headersSent = !1, this.statusMessage = @undefined, this.#controller = @undefined, this.#firstWrite = @undefined, this._writableState.decodeStrings = !1, this.#deferred = @undefined, req.method === \"HEAD\")\n this._hasBody = !1;\n }\n req;\n _reply;\n sendDate;\n statusCode;\n #headers;\n headersSent = !1;\n statusMessage;\n #controller;\n #firstWrite;\n _sent100 = !1;\n _defaultKeepAlive = !1;\n _removedConnection = !1;\n _removedContLen = !1;\n _hasBody = !0;\n #deferred = @undefined;\n #finished = !1;\n _implicitHeader() {\n this.writeHead(this.statusCode);\n }\n _write(chunk, encoding, callback) {\n if (!this.#firstWrite && !this.headersSent) {\n this.#firstWrite = chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n controller.write(chunk), callback();\n });\n }\n _writev(chunks, callback) {\n if (chunks.length === 1 && !this.headersSent && !this.#firstWrite) {\n this.#firstWrite = chunks[0].chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n for (let chunk of chunks)\n controller.write(chunk.chunk);\n callback();\n });\n }\n #ensureReadableStreamController(run) {\n var thisController = this.#controller;\n if (thisController)\n return run(thisController);\n this.headersSent = !0;\n var firstWrite = this.#firstWrite;\n this.#firstWrite = @undefined, this._reply(new Response(new @ReadableStream({\n type: \"direct\",\n pull: (controller) => {\n if (this.#controller = controller, firstWrite)\n controller.write(firstWrite);\n if (firstWrite = @undefined, run(controller), !this.#finished)\n return new @Promise((resolve) => {\n this.#deferred = resolve;\n });\n }\n }), {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n }));\n }\n #drainHeadersIfObservable() {\n if (this._implicitHeader === OriginalImplicitHeadFn && this.writeHead === OriginalWriteHeadFn)\n return;\n this._implicitHeader();\n }\n _final(callback) {\n if (!this.headersSent) {\n var data = this.#firstWrite || \"\";\n this.#firstWrite = @undefined, this.#finished = !0, this.#drainHeadersIfObservable(), this._reply(new Response(data, {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n })), callback && callback();\n return;\n }\n this.#finished = !0, this.#ensureReadableStreamController((controller) => {\n controller.end(), callback();\n var deferred = this.#deferred;\n if (deferred)\n this.#deferred = @undefined, deferred();\n });\n }\n writeProcessing() {\n throw new Error(\"not implemented\");\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n assignSocket(socket) {\n throw new Error(\"not implemented\");\n }\n detachSocket(socket) {\n throw new Error(\"not implemented\");\n }\n writeContinue(callback) {\n throw new Error(\"not implemented\");\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n var headers = this.#headers;\n if (!headers)\n return kEmptyObject;\n return headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return setHeader(headers, name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n writeHead(statusCode, statusMessage, headers) {\n return _writeHead(statusCode, statusMessage, headers, this), this;\n }\n}\nOriginalWriteHeadFn = ServerResponse.prototype.writeHead;\nOriginalImplicitHeadFn = ServerResponse.prototype._implicitHeader;\n\nclass ClientRequest extends OutgoingMessage {\n #timeout;\n #res = null;\n #upgradeOrConnect = !1;\n #parser = null;\n #maxHeadersCount = null;\n #reusedSocket = !1;\n #host;\n #protocol;\n #method;\n #port;\n #useDefaultPort;\n #joinDuplicateHeaders;\n #maxHeaderSize;\n #agent = globalAgent;\n #path;\n #socketPath;\n #bodyChunks = null;\n #fetchRequest;\n #signal = null;\n [kAbortController] = null;\n #timeoutTimer = @undefined;\n #options;\n #finished;\n get path() {\n return this.#path;\n }\n get port() {\n return this.#port;\n }\n get method() {\n return this.#method;\n }\n get host() {\n return this.#host;\n }\n get protocol() {\n return this.#protocol;\n }\n _write(chunk, encoding, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = [chunk], callback();\n return;\n }\n this.#bodyChunks.push(chunk), callback();\n }\n _writev(chunks, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = chunks, callback();\n return;\n }\n this.#bodyChunks.push(...chunks), callback();\n }\n _final(callback) {\n if (this.#finished = !0, this[kAbortController] = new AbortController, this[kAbortController].signal.addEventListener(\"abort\", () => {\n this[kClearTimeout]();\n }), this.#signal\?.aborted)\n this[kAbortController].abort();\n var method = this.#method, body = this.#bodyChunks\?.length === 1 \? this.#bodyChunks[0] : @Buffer.concat(this.#bodyChunks || []);\n let url, proxy;\n if (this.#path.startsWith(\"http://\") || this.#path.startsWith(\"https://\"))\n url = this.#path, proxy = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}`;\n else\n url = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}${this.#path}`;\n try {\n this.#fetchRequest = fetch(url, {\n method,\n headers: this.getHeaders(),\n body: body && method !== \"GET\" && method !== \"HEAD\" && method !== \"OPTIONS\" \? body : @undefined,\n redirect: \"manual\",\n verbose: !1,\n signal: this[kAbortController].signal,\n proxy,\n timeout: !1,\n decompress: !1\n }).then((response) => {\n var res = this.#res = new IncomingMessage(response, {\n type: \"response\",\n [kInternalRequest]: this\n });\n this.emit(\"response\", res);\n }).catch((err) => {\n this.emit(\"error\", err);\n }).finally(() => {\n this.#fetchRequest = null, this[kClearTimeout]();\n });\n } catch (err) {\n this.emit(\"error\", err);\n } finally {\n callback();\n }\n }\n get aborted() {\n return this.#signal\?.aborted || !!this[kAbortController]\?.signal.aborted;\n }\n abort() {\n if (this.aborted)\n return;\n this[kAbortController].abort();\n }\n constructor(input, options, cb) {\n super();\n if (typeof input === \"string\") {\n const urlStr = input;\n try {\n var urlObject = new URL(urlStr);\n } catch (e) {\n @throwTypeError(`Invalid URL: ${urlStr}`);\n }\n input = urlToHttpOptions(urlObject);\n } else if (input && typeof input === \"object\" && input instanceof URL)\n input = urlToHttpOptions(input);\n else\n cb = options, options = input, input = null;\n if (typeof options === \"function\")\n cb = options, options = input || kEmptyObject;\n else\n options = ObjectAssign(input || {}, options);\n var defaultAgent = options._defaultAgent || Agent.globalAgent;\n let protocol = options.protocol;\n if (!protocol)\n if (options.port === 443)\n protocol = \"https:\";\n else\n protocol = defaultAgent.protocol || \"http:\";\n switch (this.#protocol = protocol, this.#agent\?.protocol) {\n case @undefined:\n break;\n case \"http:\":\n if (protocol === \"https:\") {\n defaultAgent = this.#agent = getDefaultHTTPSAgent();\n break;\n }\n case \"https:\":\n if (protocol === \"https\") {\n defaultAgent = this.#agent = Agent.globalAgent;\n break;\n }\n default:\n break;\n }\n if (options.path) {\n const path = @String(options.path);\n if (RegExpPrototypeExec.@call(INVALID_PATH_REGEX, path) !== null)\n throw new Error(\"Path contains unescaped characters\");\n }\n if (protocol !== \"http:\" && protocol !== \"https:\" && protocol) {\n const expectedProtocol = defaultAgent\?.protocol \?\? \"http:\";\n throw new Error(`Protocol mismatch. Expected: ${expectedProtocol}. Got: ${protocol}`);\n }\n const defaultPort = protocol === \"https:\" \? 443 : 80;\n this.#port = options.port || options.defaultPort || this.#agent\?.defaultPort || defaultPort, this.#useDefaultPort = this.#port === defaultPort;\n const host = this.#host = options.host = validateHost(options.hostname, \"hostname\") || validateHost(options.host, \"host\") || \"localhost\";\n this.#socketPath = options.socketPath;\n const signal = options.signal;\n if (signal)\n signal.addEventListener(\"abort\", () => {\n this[kAbortController]\?.abort();\n }), this.#signal = signal;\n let method = options.method;\n const methodIsString = typeof method === \"string\";\n if (method !== null && method !== @undefined && !methodIsString)\n throw new Error(\"ERR_INVALID_ARG_TYPE: options.method\");\n if (methodIsString && method) {\n if (!checkIsHttpToken(method))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN: Method\");\n method = this.#method = StringPrototypeToUpperCase.@call(method);\n } else\n method = this.#method = \"GET\";\n const _maxHeaderSize = options.maxHeaderSize;\n this.#maxHeaderSize = _maxHeaderSize;\n var _joinDuplicateHeaders = options.joinDuplicateHeaders;\n if (this.#joinDuplicateHeaders = _joinDuplicateHeaders, this.#path = options.path || \"/\", cb)\n this.once(\"response\", cb);\n this.#finished = !1, this.#res = null, this.#upgradeOrConnect = !1, this.#parser = null, this.#maxHeadersCount = null, this.#reusedSocket = !1, this.#host = host, this.#protocol = protocol;\n var timeout = options.timeout;\n if (timeout !== @undefined && timeout !== 0)\n this.setTimeout(timeout, @undefined);\n if (!ArrayIsArray(headers)) {\n var headers = options.headers;\n if (headers)\n for (let key in headers)\n this.setHeader(key, headers[key]);\n var auth = options.auth;\n if (auth && !this.getHeader(\"Authorization\"))\n this.setHeader(\"Authorization\", \"Basic \" + @Buffer.from(auth).toString(\"base64\"));\n }\n var { signal: _signal, ...optsWithoutSignal } = options;\n this.#options = optsWithoutSignal;\n }\n setSocketKeepAlive(enable = !0, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.#timeoutTimer = @undefined, this.removeAllListeners(\"timeout\");\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/, METHODS = [\n \"ACL\",\n \"BIND\",\n \"CHECKOUT\",\n \"CONNECT\",\n \"COPY\",\n \"DELETE\",\n \"GET\",\n \"HEAD\",\n \"LINK\",\n \"LOCK\",\n \"M-SEARCH\",\n \"MERGE\",\n \"MKACTIVITY\",\n \"MKCALENDAR\",\n \"MKCOL\",\n \"MOVE\",\n \"NOTIFY\",\n \"OPTIONS\",\n \"PATCH\",\n \"POST\",\n \"PROPFIND\",\n \"PROPPATCH\",\n \"PURGE\",\n \"PUT\",\n \"REBIND\",\n \"REPORT\",\n \"SEARCH\",\n \"SOURCE\",\n \"SUBSCRIBE\",\n \"TRACE\",\n \"UNBIND\",\n \"UNLINK\",\n \"UNLOCK\",\n \"UNSUBSCRIBE\"\n], STATUS_CODES = {\n 100: \"Continue\",\n 101: \"Switching Protocols\",\n 102: \"Processing\",\n 103: \"Early Hints\",\n 200: \"OK\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"Non-Authoritative Information\",\n 204: \"No Content\",\n 205: \"Reset Content\",\n 206: \"Partial Content\",\n 207: \"Multi-Status\",\n 208: \"Already Reported\",\n 226: \"IM Used\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Found\",\n 303: \"See Other\",\n 304: \"Not Modified\",\n 305: \"Use Proxy\",\n 307: \"Temporary Redirect\",\n 308: \"Permanent Redirect\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a Teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 425: \"Too Early\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Request Header Fields Too Large\",\n 451: \"Unavailable For Legal Reasons\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 509: \"Bandwidth Limit Exceeded\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\"\n}, globalAgent = new Agent;\n$ = {\n Agent,\n Server,\n METHODS,\n STATUS_CODES,\n createServer,\n ServerResponse,\n IncomingMessage,\n request,\n get,\n maxHeaderSize: 16384,\n validateHeaderName,\n validateHeaderValue,\n setMaxIdleHTTPParsers(max) {\n },\n globalAgent,\n ClientRequest,\n OutgoingMessage\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeInspectorCode = "(function (){\"use strict\";// src/js/out/tmp/node/inspector.ts\nvar open = function() {\n throwNotImplemented(\"node:inspector open\", 2445);\n}, close = function() {\n throwNotImplemented(\"node:inspector close\", 2445);\n}, url = function() {\n throwNotImplemented(\"node:inspector url\", 2445);\n}, waitForDebugger = function() {\n throwNotImplemented(\"node:inspector waitForDebugger\", 2445);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18);\n\nclass Session extends EventEmitter {\n constructor() {\n super();\n throwNotImplemented(\"node:inspector Session\", 2445);\n }\n}\nvar console = {\n ...globalThis.console,\n context: {\n console: globalThis.console\n }\n};\n$ = {\n console,\n open,\n close,\n url,\n waitForDebugger,\n Session\n};\nhideFromStack(open, close, url, waitForDebugger, Session.prototype.constructor);\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeHttp2Code = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/http2.ts\nvar connect = function() {\n throwNotImplemented(\"node:http2 connect\", 887);\n}, createServer = function() {\n throwNotImplemented(\"node:http2 createServer\", 887);\n}, createSecureServer = function() {\n throwNotImplemented(\"node:http2 createSecureServer\", 887);\n}, getDefaultSettings = function() {\n return {\n headerTableSize: 4096,\n enablePush: !0,\n initialWindowSize: 65535,\n maxFrameSize: 16384,\n maxConcurrentStreams: 4294967295,\n maxHeaderSize: 65535,\n maxHeaderListSize: 65535,\n enableConnectProtocol: !1\n };\n}, getPackedSettings = function() {\n return @Buffer.alloc(0);\n}, getUnpackedSettings = function() {\n return @Buffer.alloc(0);\n}, Http2ServerRequest = function() {\n throwNotImplemented(\"node:http2 Http2ServerRequest\", 887);\n}, Http2ServerResponse = function() {\n throwNotImplemented(\"node:http2 Http2ServerResponse\", 887);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), constants = {\n NGHTTP2_ERR_FRAME_SIZE_ERROR: -522,\n NGHTTP2_SESSION_SERVER: 0,\n NGHTTP2_SESSION_CLIENT: 1,\n NGHTTP2_STREAM_STATE_IDLE: 1,\n NGHTTP2_STREAM_STATE_OPEN: 2,\n NGHTTP2_STREAM_STATE_RESERVED_LOCAL: 3,\n NGHTTP2_STREAM_STATE_RESERVED_REMOTE: 4,\n NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: 5,\n NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: 6,\n NGHTTP2_STREAM_STATE_CLOSED: 7,\n NGHTTP2_FLAG_NONE: 0,\n NGHTTP2_FLAG_END_STREAM: 1,\n NGHTTP2_FLAG_END_HEADERS: 4,\n NGHTTP2_FLAG_ACK: 1,\n NGHTTP2_FLAG_PADDED: 8,\n NGHTTP2_FLAG_PRIORITY: 32,\n DEFAULT_SETTINGS_HEADER_TABLE_SIZE: 4096,\n DEFAULT_SETTINGS_ENABLE_PUSH: 1,\n DEFAULT_SETTINGS_MAX_CONCURRENT_STREAMS: 4294967295,\n DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: 65535,\n DEFAULT_SETTINGS_MAX_FRAME_SIZE: 16384,\n DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE: 65535,\n DEFAULT_SETTINGS_ENABLE_CONNECT_PROTOCOL: 0,\n MAX_MAX_FRAME_SIZE: 16777215,\n MIN_MAX_FRAME_SIZE: 16384,\n MAX_INITIAL_WINDOW_SIZE: 2147483647,\n NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: 1,\n NGHTTP2_SETTINGS_ENABLE_PUSH: 2,\n NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: 3,\n NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: 4,\n NGHTTP2_SETTINGS_MAX_FRAME_SIZE: 5,\n NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: 6,\n NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL: 8,\n PADDING_STRATEGY_NONE: 0,\n PADDING_STRATEGY_ALIGNED: 1,\n PADDING_STRATEGY_MAX: 2,\n PADDING_STRATEGY_CALLBACK: 1,\n NGHTTP2_NO_ERROR: 0,\n NGHTTP2_PROTOCOL_ERROR: 1,\n NGHTTP2_INTERNAL_ERROR: 2,\n NGHTTP2_FLOW_CONTROL_ERROR: 3,\n NGHTTP2_SETTINGS_TIMEOUT: 4,\n NGHTTP2_STREAM_CLOSED: 5,\n NGHTTP2_FRAME_SIZE_ERROR: 6,\n NGHTTP2_REFUSED_STREAM: 7,\n NGHTTP2_CANCEL: 8,\n NGHTTP2_COMPRESSION_ERROR: 9,\n NGHTTP2_CONNECT_ERROR: 10,\n NGHTTP2_ENHANCE_YOUR_CALM: 11,\n NGHTTP2_INADEQUATE_SECURITY: 12,\n NGHTTP2_HTTP_1_1_REQUIRED: 13,\n NGHTTP2_DEFAULT_WEIGHT: 16,\n HTTP2_HEADER_STATUS: \":status\",\n HTTP2_HEADER_METHOD: \":method\",\n HTTP2_HEADER_AUTHORITY: \":authority\",\n HTTP2_HEADER_SCHEME: \":scheme\",\n HTTP2_HEADER_PATH: \":path\",\n HTTP2_HEADER_PROTOCOL: \":protocol\",\n HTTP2_HEADER_ACCEPT_ENCODING: \"accept-encoding\",\n HTTP2_HEADER_ACCEPT_LANGUAGE: \"accept-language\",\n HTTP2_HEADER_ACCEPT_RANGES: \"accept-ranges\",\n HTTP2_HEADER_ACCEPT: \"accept\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS: \"access-control-allow-credentials\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_HEADERS: \"access-control-allow-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_METHODS: \"access-control-allow-methods\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: \"access-control-allow-origin\",\n HTTP2_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS: \"access-control-expose-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_REQUEST_HEADERS: \"access-control-request-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_REQUEST_METHOD: \"access-control-request-method\",\n HTTP2_HEADER_AGE: \"age\",\n HTTP2_HEADER_AUTHORIZATION: \"authorization\",\n HTTP2_HEADER_CACHE_CONTROL: \"cache-control\",\n HTTP2_HEADER_CONNECTION: \"connection\",\n HTTP2_HEADER_CONTENT_DISPOSITION: \"content-disposition\",\n HTTP2_HEADER_CONTENT_ENCODING: \"content-encoding\",\n HTTP2_HEADER_CONTENT_LENGTH: \"content-length\",\n HTTP2_HEADER_CONTENT_TYPE: \"content-type\",\n HTTP2_HEADER_COOKIE: \"cookie\",\n HTTP2_HEADER_DATE: \"date\",\n HTTP2_HEADER_ETAG: \"etag\",\n HTTP2_HEADER_FORWARDED: \"forwarded\",\n HTTP2_HEADER_HOST: \"host\",\n HTTP2_HEADER_IF_MODIFIED_SINCE: \"if-modified-since\",\n HTTP2_HEADER_IF_NONE_MATCH: \"if-none-match\",\n HTTP2_HEADER_IF_RANGE: \"if-range\",\n HTTP2_HEADER_LAST_MODIFIED: \"last-modified\",\n HTTP2_HEADER_LINK: \"link\",\n HTTP2_HEADER_LOCATION: \"location\",\n HTTP2_HEADER_RANGE: \"range\",\n HTTP2_HEADER_REFERER: \"referer\",\n HTTP2_HEADER_SERVER: \"server\",\n HTTP2_HEADER_SET_COOKIE: \"set-cookie\",\n HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: \"strict-transport-security\",\n HTTP2_HEADER_TRANSFER_ENCODING: \"transfer-encoding\",\n HTTP2_HEADER_TE: \"te\",\n HTTP2_HEADER_UPGRADE_INSECURE_REQUESTS: \"upgrade-insecure-requests\",\n HTTP2_HEADER_UPGRADE: \"upgrade\",\n HTTP2_HEADER_USER_AGENT: \"user-agent\",\n HTTP2_HEADER_VARY: \"vary\",\n HTTP2_HEADER_X_CONTENT_TYPE_OPTIONS: \"x-content-type-options\",\n HTTP2_HEADER_X_FRAME_OPTIONS: \"x-frame-options\",\n HTTP2_HEADER_KEEP_ALIVE: \"keep-alive\",\n HTTP2_HEADER_PROXY_CONNECTION: \"proxy-connection\",\n HTTP2_HEADER_X_XSS_PROTECTION: \"x-xss-protection\",\n HTTP2_HEADER_ALT_SVC: \"alt-svc\",\n HTTP2_HEADER_CONTENT_SECURITY_POLICY: \"content-security-policy\",\n HTTP2_HEADER_EARLY_DATA: \"early-data\",\n HTTP2_HEADER_EXPECT_CT: \"expect-ct\",\n HTTP2_HEADER_ORIGIN: \"origin\",\n HTTP2_HEADER_PURPOSE: \"purpose\",\n HTTP2_HEADER_TIMING_ALLOW_ORIGIN: \"timing-allow-origin\",\n HTTP2_HEADER_X_FORWARDED_FOR: \"x-forwarded-for\",\n HTTP2_HEADER_PRIORITY: \"priority\",\n HTTP2_HEADER_ACCEPT_CHARSET: \"accept-charset\",\n HTTP2_HEADER_ACCESS_CONTROL_MAX_AGE: \"access-control-max-age\",\n HTTP2_HEADER_ALLOW: \"allow\",\n HTTP2_HEADER_CONTENT_LANGUAGE: \"content-language\",\n HTTP2_HEADER_CONTENT_LOCATION: \"content-location\",\n HTTP2_HEADER_CONTENT_MD5: \"content-md5\",\n HTTP2_HEADER_CONTENT_RANGE: \"content-range\",\n HTTP2_HEADER_DNT: \"dnt\",\n HTTP2_HEADER_EXPECT: \"expect\",\n HTTP2_HEADER_EXPIRES: \"expires\",\n HTTP2_HEADER_FROM: \"from\",\n HTTP2_HEADER_IF_MATCH: \"if-match\",\n HTTP2_HEADER_IF_UNMODIFIED_SINCE: \"if-unmodified-since\",\n HTTP2_HEADER_MAX_FORWARDS: \"max-forwards\",\n HTTP2_HEADER_PREFER: \"prefer\",\n HTTP2_HEADER_PROXY_AUTHENTICATE: \"proxy-authenticate\",\n HTTP2_HEADER_PROXY_AUTHORIZATION: \"proxy-authorization\",\n HTTP2_HEADER_REFRESH: \"refresh\",\n HTTP2_HEADER_RETRY_AFTER: \"retry-after\",\n HTTP2_HEADER_TRAILER: \"trailer\",\n HTTP2_HEADER_TK: \"tk\",\n HTTP2_HEADER_VIA: \"via\",\n HTTP2_HEADER_WARNING: \"warning\",\n HTTP2_HEADER_WWW_AUTHENTICATE: \"www-authenticate\",\n HTTP2_HEADER_HTTP2_SETTINGS: \"http2-settings\",\n HTTP2_METHOD_ACL: \"ACL\",\n HTTP2_METHOD_BASELINE_CONTROL: \"BASELINE-CONTROL\",\n HTTP2_METHOD_BIND: \"BIND\",\n HTTP2_METHOD_CHECKIN: \"CHECKIN\",\n HTTP2_METHOD_CHECKOUT: \"CHECKOUT\",\n HTTP2_METHOD_CONNECT: \"CONNECT\",\n HTTP2_METHOD_COPY: \"COPY\",\n HTTP2_METHOD_DELETE: \"DELETE\",\n HTTP2_METHOD_GET: \"GET\",\n HTTP2_METHOD_HEAD: \"HEAD\",\n HTTP2_METHOD_LABEL: \"LABEL\",\n HTTP2_METHOD_LINK: \"LINK\",\n HTTP2_METHOD_LOCK: \"LOCK\",\n HTTP2_METHOD_MERGE: \"MERGE\",\n HTTP2_METHOD_MKACTIVITY: \"MKACTIVITY\",\n HTTP2_METHOD_MKCALENDAR: \"MKCALENDAR\",\n HTTP2_METHOD_MKCOL: \"MKCOL\",\n HTTP2_METHOD_MKREDIRECTREF: \"MKREDIRECTREF\",\n HTTP2_METHOD_MKWORKSPACE: \"MKWORKSPACE\",\n HTTP2_METHOD_MOVE: \"MOVE\",\n HTTP2_METHOD_OPTIONS: \"OPTIONS\",\n HTTP2_METHOD_ORDERPATCH: \"ORDERPATCH\",\n HTTP2_METHOD_PATCH: \"PATCH\",\n HTTP2_METHOD_POST: \"POST\",\n HTTP2_METHOD_PRI: \"PRI\",\n HTTP2_METHOD_PROPFIND: \"PROPFIND\",\n HTTP2_METHOD_PROPPATCH: \"PROPPATCH\",\n HTTP2_METHOD_PUT: \"PUT\",\n HTTP2_METHOD_REBIND: \"REBIND\",\n HTTP2_METHOD_REPORT: \"REPORT\",\n HTTP2_METHOD_SEARCH: \"SEARCH\",\n HTTP2_METHOD_TRACE: \"TRACE\",\n HTTP2_METHOD_UNBIND: \"UNBIND\",\n HTTP2_METHOD_UNCHECKOUT: \"UNCHECKOUT\",\n HTTP2_METHOD_UNLINK: \"UNLINK\",\n HTTP2_METHOD_UNLOCK: \"UNLOCK\",\n HTTP2_METHOD_UPDATE: \"UPDATE\",\n HTTP2_METHOD_UPDATEREDIRECTREF: \"UPDATEREDIRECTREF\",\n HTTP2_METHOD_VERSION_CONTROL: \"VERSION-CONTROL\",\n HTTP_STATUS_CONTINUE: 100,\n HTTP_STATUS_SWITCHING_PROTOCOLS: 101,\n HTTP_STATUS_PROCESSING: 102,\n HTTP_STATUS_EARLY_HINTS: 103,\n HTTP_STATUS_OK: 200,\n HTTP_STATUS_CREATED: 201,\n HTTP_STATUS_ACCEPTED: 202,\n HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: 203,\n HTTP_STATUS_NO_CONTENT: 204,\n HTTP_STATUS_RESET_CONTENT: 205,\n HTTP_STATUS_PARTIAL_CONTENT: 206,\n HTTP_STATUS_MULTI_STATUS: 207,\n HTTP_STATUS_ALREADY_REPORTED: 208,\n HTTP_STATUS_IM_USED: 226,\n HTTP_STATUS_MULTIPLE_CHOICES: 300,\n HTTP_STATUS_MOVED_PERMANENTLY: 301,\n HTTP_STATUS_FOUND: 302,\n HTTP_STATUS_SEE_OTHER: 303,\n HTTP_STATUS_NOT_MODIFIED: 304,\n HTTP_STATUS_USE_PROXY: 305,\n HTTP_STATUS_TEMPORARY_REDIRECT: 307,\n HTTP_STATUS_PERMANENT_REDIRECT: 308,\n HTTP_STATUS_BAD_REQUEST: 400,\n HTTP_STATUS_UNAUTHORIZED: 401,\n HTTP_STATUS_PAYMENT_REQUIRED: 402,\n HTTP_STATUS_FORBIDDEN: 403,\n HTTP_STATUS_NOT_FOUND: 404,\n HTTP_STATUS_METHOD_NOT_ALLOWED: 405,\n HTTP_STATUS_NOT_ACCEPTABLE: 406,\n HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: 407,\n HTTP_STATUS_REQUEST_TIMEOUT: 408,\n HTTP_STATUS_CONFLICT: 409,\n HTTP_STATUS_GONE: 410,\n HTTP_STATUS_LENGTH_REQUIRED: 411,\n HTTP_STATUS_PRECONDITION_FAILED: 412,\n HTTP_STATUS_PAYLOAD_TOO_LARGE: 413,\n HTTP_STATUS_URI_TOO_LONG: 414,\n HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: 415,\n HTTP_STATUS_RANGE_NOT_SATISFIABLE: 416,\n HTTP_STATUS_EXPECTATION_FAILED: 417,\n HTTP_STATUS_TEAPOT: 418,\n HTTP_STATUS_MISDIRECTED_REQUEST: 421,\n HTTP_STATUS_UNPROCESSABLE_ENTITY: 422,\n HTTP_STATUS_LOCKED: 423,\n HTTP_STATUS_FAILED_DEPENDENCY: 424,\n HTTP_STATUS_TOO_EARLY: 425,\n HTTP_STATUS_UPGRADE_REQUIRED: 426,\n HTTP_STATUS_PRECONDITION_REQUIRED: 428,\n HTTP_STATUS_TOO_MANY_REQUESTS: 429,\n HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: 431,\n HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: 451,\n HTTP_STATUS_INTERNAL_SERVER_ERROR: 500,\n HTTP_STATUS_NOT_IMPLEMENTED: 501,\n HTTP_STATUS_BAD_GATEWAY: 502,\n HTTP_STATUS_SERVICE_UNAVAILABLE: 503,\n HTTP_STATUS_GATEWAY_TIMEOUT: 504,\n HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: 505,\n HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: 506,\n HTTP_STATUS_INSUFFICIENT_STORAGE: 507,\n HTTP_STATUS_LOOP_DETECTED: 508,\n HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: 509,\n HTTP_STATUS_NOT_EXTENDED: 510,\n HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: 511\n}, sensitiveHeaders = Symbol.for(\"nodejs.http2.sensitiveHeaders\");\nHttp2ServerRequest.prototype = {};\nHttp2ServerResponse.prototype = {};\n$ = {\n constants,\n createServer,\n createSecureServer,\n getDefaultSettings,\n getPackedSettings,\n getUnpackedSettings,\n sensitiveHeaders,\n Http2ServerRequest,\n Http2ServerResponse,\n connect\n};\nhideFromStack([\n Http2ServerRequest,\n Http2ServerResponse,\n connect,\n createServer,\n createSecureServer,\n getDefaultSettings,\n getPackedSettings,\n getUnpackedSettings\n]);\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeNetCode = "(function (){\"use strict\";// src/js/out/tmp/node/net.ts\nvar isIPv4 = function(s) {\n return IPv4Reg.test(s);\n}, isIPv6 = function(s) {\n return IPv6Reg.test(s);\n}, isIP = function(s) {\n if (isIPv4(s))\n return 4;\n if (isIPv6(s))\n return 6;\n return 0;\n}, createConnection = function(port, host, connectListener) {\n if (typeof port === \"object\")\n return new Socket(port).connect(port, host, connectListener);\n return new Socket().connect(port, host, connectListener);\n}, emitErrorNextTick = function(self, error) {\n self.emit(\"error\", error);\n}, emitListeningNextTick = function(self, onListen) {\n if (typeof onListen === \"function\")\n try {\n onListen();\n } catch (err) {\n self.emit(\"error\", err);\n }\n self.emit(\"listening\");\n}, createServer = function(options, connectionListener) {\n return new Server(options, connectionListener);\n}, $, { Duplex } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18);\nvar IPv4Reg = new RegExp(\"^((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$\");\nvar IPv6Reg = new RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\"), { connect: bunConnect } = Bun, { setTimeout } = globalThis, bunTlsSymbol = Symbol.for(\"::buntls::\"), bunSocketServerHandlers = Symbol.for(\"::bunsocket_serverhandlers::\"), bunSocketServerConnections = Symbol.for(\"::bunnetserverconnections::\"), bunSocketServerOptions = Symbol.for(\"::bunnetserveroptions::\"), bunSocketInternal = Symbol.for(\"::bunnetsocketinternal::\"), bunTLSConnectOptions = Symbol.for(\"::buntlsconnectoptions::\"), SocketClass, Socket = function(InternalSocket) {\n return SocketClass = InternalSocket, Object.defineProperty(SocketClass.prototype, Symbol.toStringTag, {\n value: \"Socket\",\n enumerable: !1\n }), Object.defineProperty(function Socket(options) {\n return new InternalSocket(options);\n }, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalSocket;\n }\n });\n}(class Socket2 extends Duplex {\n static #Handlers = {\n close: Socket2.#Close,\n data({ data: self }, buffer) {\n self.bytesRead += buffer.length;\n const queue = self.#readQueue;\n if (queue.isEmpty()) {\n if (self.push(buffer))\n return;\n }\n queue.push(buffer);\n },\n drain: Socket2.#Drain,\n end: Socket2.#Close,\n error(socket, error) {\n const self = socket.data, callback = self.#writeCallback;\n if (callback)\n self.#writeCallback = null, callback(error);\n self.emit(\"error\", error);\n },\n open(socket) {\n const self = socket.data;\n socket.timeout(self.timeout), socket.ref(), self[bunSocketInternal] = socket, self.connecting = !1;\n const options = self[bunTLSConnectOptions];\n if (options) {\n const { session } = options;\n if (session)\n self.setSession(session);\n }\n if (!self.#upgraded)\n self.emit(\"connect\", self);\n Socket2.#Drain(socket);\n },\n handshake(socket, success, verifyError) {\n const { data: self } = socket;\n self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self.emit(\"secure\", self);\n const { checkServerIdentity } = self[bunTLSConnectOptions];\n if (!verifyError && typeof checkServerIdentity === \"function\" && self.servername) {\n const cert = self.getPeerCertificate(!0);\n verifyError = checkServerIdentity(self.servername, cert);\n }\n if (self._requestCert || self._rejectUnauthorized) {\n if (verifyError) {\n if (self.authorized = !1, self.authorizationError = verifyError.code || verifyError.message, self._rejectUnauthorized) {\n self.destroy(verifyError);\n return;\n }\n }\n } else\n self.authorized = !0;\n self.emit(\"secureConnect\", verifyError);\n },\n timeout(socket) {\n const self = socket.data;\n self.emit(\"timeout\", self);\n },\n binaryType: \"buffer\"\n };\n static #Close(socket) {\n const self = socket.data;\n if (self.#closed)\n return;\n self.#closed = !0, self[bunSocketInternal] = null;\n const queue = self.#readQueue;\n if (queue.isEmpty()) {\n if (self.push(null))\n return;\n }\n queue.push(null);\n }\n static #Drain(socket) {\n const self = socket.data, callback = self.#writeCallback;\n if (callback) {\n const chunk = self.#writeChunk, written = socket.write(chunk);\n if (self.bytesWritten += written, written < chunk.length)\n self.#writeChunk = chunk.slice(written);\n else\n self.#writeCallback = null, self.#writeChunk = null, callback(null);\n }\n }\n static [bunSocketServerHandlers] = {\n data: Socket2.#Handlers.data,\n close(socket) {\n Socket2.#Handlers.close(socket), this.data[bunSocketServerConnections]--;\n },\n end(socket) {\n Socket2.#Handlers.end(socket), this.data[bunSocketServerConnections]--;\n },\n open(socket) {\n const self = this.data, options = self[bunSocketServerOptions], { pauseOnConnect, connectionListener, InternalSocketClass, requestCert, rejectUnauthorized } = options, _socket = new InternalSocketClass({});\n if (_socket.isServer = !0, _socket._requestCert = requestCert, _socket._rejectUnauthorized = rejectUnauthorized, _socket.#attach(this.localPort, socket), self.maxConnections && self[bunSocketServerConnections] >= self.maxConnections) {\n const data = {\n localAddress: _socket.localAddress,\n localPort: _socket.localPort,\n localFamily: _socket.localFamily,\n remoteAddress: _socket.remoteAddress,\n remotePort: _socket.remotePort,\n remoteFamily: _socket.remoteFamily || \"IPv4\"\n };\n socket.end(), self.emit(\"drop\", data);\n return;\n }\n if (!pauseOnConnect)\n _socket.resume();\n if (self[bunSocketServerConnections]++, typeof connectionListener == \"function\")\n if (InternalSocketClass.name === \"TLSSocket\")\n self.once(\"secureConnection\", () => connectionListener(_socket));\n else\n connectionListener(_socket);\n self.emit(\"connection\", _socket);\n },\n handshake(socket, success, verifyError) {\n const { data: self } = socket;\n if (self.emit(\"secure\", self), self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self._requestCert || self._rejectUnauthorized) {\n if (verifyError) {\n if (self.authorized = !1, self.authorizationError = verifyError.code || verifyError.message, self._rejectUnauthorized) {\n self.destroy(verifyError);\n return;\n }\n }\n } else\n self.authorized = !0;\n self.emit(\"secureConnection\", verifyError);\n },\n error(socket, error) {\n Socket2.#Handlers.error(socket, error), this.data.emit(\"error\", error);\n },\n timeout: Socket2.#Handlers.timeout,\n connectError: Socket2.#Handlers.connectError,\n drain: Socket2.#Handlers.drain,\n binaryType: \"buffer\"\n };\n bytesRead = 0;\n bytesWritten = 0;\n #closed = !1;\n connecting = !1;\n localAddress = \"127.0.0.1\";\n #readQueue = @createFIFO();\n remotePort;\n [bunSocketInternal] = null;\n [bunTLSConnectOptions] = null;\n timeout = 0;\n #writeCallback;\n #writeChunk;\n #pendingRead;\n isServer = !1;\n _handle;\n _parent;\n _parentWrap;\n #socket;\n #upgraded;\n constructor(options) {\n const { socket, signal, write, read, allowHalfOpen = !1, ...opts } = options || {};\n super({\n ...opts,\n allowHalfOpen,\n readable: !0,\n writable: !0\n });\n if (this._handle = this, this._parent = this, this._parentWrap = this, this.#pendingRead = void 0, this.#upgraded = !1, socket instanceof Socket2)\n this.#socket = socket;\n signal\?.once(\"abort\", () => this.destroy()), this.once(\"connect\", () => this.emit(\"ready\"));\n }\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n #attach(port, socket) {\n if (this.remotePort = port, socket.data = this, socket.timeout(this.timeout), socket.ref(), this[bunSocketInternal] = socket, this.connecting = !1, !this.#upgraded)\n this.emit(\"connect\", this);\n Socket2.#Drain(socket);\n }\n connect(port, host, connectListener) {\n var path, connection = this.#socket, _checkServerIdentity = void 0;\n if (typeof port === \"string\") {\n if (path = port, port = void 0, typeof host === \"function\")\n connectListener = host, host = void 0;\n } else if (typeof host == \"function\") {\n if (typeof port === \"string\")\n path = port, port = void 0;\n connectListener = host, host = void 0;\n }\n if (typeof port == \"object\") {\n var {\n port,\n host,\n path,\n socket,\n localAddress,\n localPort,\n family,\n hints,\n lookup,\n noDelay,\n keepAlive,\n keepAliveInitialDelay,\n requestCert,\n rejectUnauthorized,\n pauseOnConnect,\n servername,\n checkServerIdentity,\n session\n } = port;\n if (_checkServerIdentity = checkServerIdentity, this.servername = servername, socket)\n connection = socket;\n }\n if (!pauseOnConnect)\n this.resume();\n this.connecting = !0, this.remotePort = port;\n const bunTLS = this[bunTlsSymbol];\n var tls = void 0;\n if (typeof bunTLS === \"function\") {\n if (tls = bunTLS.call(this, port, host, !0), this._requestCert = !0, this._rejectUnauthorized = rejectUnauthorized, tls) {\n if (tls.rejectUnauthorized = rejectUnauthorized, tls.requestCert = !0, tls.session = session || tls.session, this.servername = tls.servername, tls.checkServerIdentity = _checkServerIdentity || tls.checkServerIdentity, this[bunTLSConnectOptions] = tls, !connection && tls.socket)\n connection = tls.socket;\n }\n if (connection) {\n if (typeof connection !== \"object\" || !(connection instanceof Socket2) || typeof connection[bunTlsSymbol] === \"function\")\n @throwTypeError(\"socket must be an instance of net.Socket\");\n }\n if (this.authorized = !1, this.secureConnecting = !0, this._secureEstablished = !1, this._securePending = !0, connectListener)\n this.on(\"secureConnect\", connectListener);\n } else if (connectListener)\n this.on(\"connect\", connectListener);\n if (connection) {\n const socket2 = connection[bunSocketInternal];\n if (socket2) {\n this.connecting = !0, this.#upgraded = !0;\n const result = socket2.upgradeTLS({\n data: this,\n tls,\n socket: Socket2.#Handlers\n });\n if (result) {\n const [raw, tls2] = result;\n connection[bunSocketInternal] = raw, raw.timeout(raw.timeout), raw.connecting = !1, this[bunSocketInternal] = tls2;\n } else\n throw this[bunSocketInternal] = null, new Error(\"Invalid socket\");\n } else\n connection.once(\"connect\", () => {\n const socket3 = connection[bunSocketInternal];\n if (!socket3)\n return;\n this.connecting = !0, this.#upgraded = !0;\n const result = socket3.upgradeTLS({\n data: this,\n tls,\n socket: Socket2.#Handlers\n });\n if (result) {\n const [raw, tls2] = result;\n connection[bunSocketInternal] = raw, raw.timeout(raw.timeout), raw.connecting = !1, this[bunSocketInternal] = tls2;\n } else\n throw this[bunSocketInternal] = null, new Error(\"Invalid socket\");\n });\n } else if (path)\n bunConnect({\n data: this,\n unix: path,\n socket: Socket2.#Handlers,\n tls\n }).catch((error) => {\n this.emit(\"error\", error), this.emit(\"close\");\n });\n else\n bunConnect({\n data: this,\n hostname: host || \"localhost\",\n port,\n socket: Socket2.#Handlers,\n tls\n }).catch((error) => {\n this.emit(\"error\", error), this.emit(\"close\");\n });\n return this;\n }\n _destroy(err, callback) {\n this[bunSocketInternal]\?.end(), callback(err);\n }\n _final(callback) {\n this[bunSocketInternal]\?.end(), callback();\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return this[bunSocketInternal]\?.localPort;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n const queue = this.#readQueue;\n let chunk;\n while (chunk = queue.peek()) {\n if (!this.push(chunk))\n return;\n queue.shift();\n }\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n this[bunSocketInternal]\?.ref();\n }\n get remoteAddress() {\n return this[bunSocketInternal]\?.remoteAddress;\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n this[bunSocketInternal]\?.end();\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n return this;\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n if (this[bunSocketInternal]\?.timeout(timeout), this.timeout = timeout, callback)\n this.once(\"timeout\", callback);\n return this;\n }\n unref() {\n this[bunSocketInternal]\?.unref();\n }\n _write(chunk, encoding, callback) {\n if (typeof chunk == \"string\" && encoding !== \"ascii\")\n chunk = Buffer.from(chunk, encoding);\n var written = this[bunSocketInternal]\?.write(chunk);\n if (written == chunk.length)\n callback();\n else if (this.#writeCallback)\n callback(new Error(\"overlapping _write()\"));\n else {\n if (written > 0)\n if (typeof chunk == \"string\")\n chunk = chunk.slice(written);\n else\n chunk = chunk.subarray(written);\n this.#writeCallback = callback, this.#writeChunk = chunk;\n }\n }\n}), connect = createConnection;\n\nclass Server extends EventEmitter {\n #server;\n #listening = !1;\n [bunSocketServerConnections] = 0;\n [bunSocketServerOptions];\n maxConnections = 0;\n constructor(options, connectionListener) {\n super();\n if (typeof options === \"function\")\n connectionListener = options, options = {};\n else if (options == null || typeof options === \"object\")\n options = { ...options };\n else\n throw new Error(\"bun-net-polyfill: invalid arguments\");\n const { maxConnections } = options;\n this.maxConnections = Number.isSafeInteger(maxConnections) && maxConnections > 0 \? maxConnections : 0, options.connectionListener = connectionListener, this[bunSocketServerOptions] = options;\n }\n ref() {\n return this.#server\?.ref(), this;\n }\n unref() {\n return this.#server\?.unref(), this;\n }\n close(callback) {\n if (this.#server) {\n if (this.#server.stop(!0), this.#server = null, this.#listening = !1, this[bunSocketServerConnections] = 0, this.emit(\"close\"), typeof callback === \"function\")\n callback();\n return this;\n }\n if (typeof callback === \"function\") {\n const error = new Error(\"Server is not running\");\n error.code = \"ERR_SERVER_NOT_RUNNING\", callback(error);\n }\n return this;\n }\n address() {\n const server = this.#server;\n if (server) {\n const unix = server.unix;\n if (unix)\n return unix;\n let address = server.hostname;\n const type = isIP(address), port = server.port;\n if (typeof port === \"number\")\n return {\n port,\n address,\n family: type \? `IPv${type}` : void 0\n };\n if (type)\n return {\n address,\n family: type \? `IPv${type}` : void 0\n };\n return address;\n }\n return null;\n }\n getConnections(callback) {\n if (typeof callback === \"function\")\n callback(null, this.#server \? this[bunSocketServerConnections] : 0);\n return this;\n }\n listen(port, hostname, onListen) {\n let backlog, path, exclusive = !1;\n if (typeof port === \"string\") {\n if (Number.isSafeInteger(hostname)) {\n if (hostname > 0)\n backlog = hostname;\n } else if (typeof hostname === \"function\")\n onListen = hostname;\n path = port, hostname = void 0, port = void 0;\n } else {\n if (typeof hostname === \"function\")\n onListen = hostname, hostname = void 0;\n if (typeof port === \"function\")\n onListen = port, port = 0;\n else if (typeof port === \"object\") {\n const options = port;\n options.signal\?.addEventListener(\"abort\", () => this.close()), hostname = options.host, exclusive = options.exclusive === !0;\n const path2 = options.path;\n if (port = options.port, !Number.isSafeInteger(port) || port < 0)\n if (path2)\n hostname = path2, port = void 0;\n else {\n let message = 'The argument \\'options\\' must have the property \"port\" or \"path\"';\n try {\n message = `${message}. Received ${JSON.stringify(options)}`;\n } catch {\n }\n const error = @makeTypeError(message);\n throw error.code = \"ERR_INVALID_ARG_VALUE\", error;\n }\n else if (!Number.isSafeInteger(port) || port < 0)\n port = 0;\n if (typeof port.callback === \"function\")\n onListen = port\?.callback;\n } else if (!Number.isSafeInteger(port) || port < 0)\n port = 0;\n hostname = hostname || \"::\";\n }\n try {\n var tls = void 0, TLSSocketClass = void 0;\n const bunTLS = this[bunTlsSymbol], options = this[bunSocketServerOptions];\n if (typeof bunTLS === \"function\")\n [tls, TLSSocketClass] = bunTLS.call(this, port, hostname, !1), options.servername = tls.serverName, options.InternalSocketClass = TLSSocketClass;\n else\n options.InternalSocketClass = SocketClass;\n this.#server = Bun.listen(path \? {\n exclusive,\n unix: path,\n tls,\n socket: SocketClass[bunSocketServerHandlers]\n } : {\n exclusive,\n port,\n hostname,\n tls,\n socket: SocketClass[bunSocketServerHandlers]\n }), this.#server.data = this, this.#listening = !0, setTimeout(emitListeningNextTick, 1, this, onListen);\n } catch (err) {\n this.#listening = !1, setTimeout(emitErrorNextTick, 1, this, err);\n }\n return this;\n }\n}\n$ = {\n createServer,\n Server,\n createConnection,\n connect,\n isIP,\n isIPv4,\n isIPv6,\n Socket,\n [Symbol.for(\"::bunternal::\")]: SocketClass\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeHttpsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/https.ts\nvar request = function(input, options, cb) {\n if (input && typeof input === \"object\" && !(input instanceof URL))\n input.protocol \?\?= \"https:\";\n else if (typeof options === \"object\")\n options.protocol \?\?= \"https:\";\n return http.request(input, options, cb);\n}, get = function(input, options, cb) {\n const req = request(input, options, cb);\n return req.end(), req;\n}, $, http = @getInternalField(@internalModuleRegistry, 23) || @createInternalModuleById(23);\n$ = {\n ...http,\n get,\n request\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeOSCode = "(function (){\"use strict\";// src/js/out/tmp/node/os.ts\nvar lazyCpus = function({ cpus }) {\n return () => {\n const array = new Array(navigator.hardwareConcurrency);\n function populate() {\n const results = cpus(), length = results.length;\n array.length = length;\n for (let i = 0;i < length; i++)\n array[i] = results[i];\n }\n for (let i = 0;i < array.length; i++) {\n const instance = {\n get model() {\n if (array[i] === instance)\n populate();\n return array[i].model;\n },\n set model(value) {\n if (array[i] === instance)\n populate();\n array[i].model = value;\n },\n get speed() {\n if (array[i] === instance)\n populate();\n return array[i].speed;\n },\n set speed(value) {\n if (array[i] === instance)\n populate();\n array[i].speed = value;\n },\n get times() {\n if (array[i] === instance)\n populate();\n return array[i].times;\n },\n set times(value) {\n if (array[i] === instance)\n populate();\n array[i].times = value;\n },\n toJSON() {\n if (array[i] === instance)\n populate();\n return array[i];\n }\n };\n array[i] = instance;\n }\n return array;\n };\n}, bound = function(obj) {\n return {\n arch: obj.arch.bind(obj),\n cpus: lazyCpus(obj),\n endianness: obj.endianness.bind(obj),\n freemem: obj.freemem.bind(obj),\n getPriority: obj.getPriority.bind(obj),\n homedir: obj.homedir.bind(obj),\n hostname: obj.hostname.bind(obj),\n loadavg: obj.loadavg.bind(obj),\n networkInterfaces: obj.networkInterfaces.bind(obj),\n platform: obj.platform.bind(obj),\n release: obj.release.bind(obj),\n setPriority: obj.setPriority.bind(obj),\n get tmpdir() {\n return tmpdir;\n },\n totalmem: obj.totalmem.bind(obj),\n type: obj.type.bind(obj),\n uptime: obj.uptime.bind(obj),\n userInfo: obj.userInfo.bind(obj),\n version: obj.version.bind(obj),\n machine: obj.machine.bind(obj),\n devNull: obj.devNull,\n EOL: obj.EOL,\n constants: @processBindingConstants.os\n };\n}, tmpdir = function() {\n var env = Bun.env;\n return tmpdir = function() {\n var path = env.TMPDIR || env.TMP || env.TEMP || \"/tmp\";\n const length = path.length;\n if (length > 1 && path[length - 1] === \"/\")\n path = path.slice(0, -1);\n return path;\n }, tmpdir();\n};\nreturn bound(Bun._Os())})\n"_s;
+static constexpr ASCIILiteral NodeInspectorCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/inspector.ts\nvar open = function() {\n throwNotImplemented(\"node:inspector open\", 2445);\n}, close = function() {\n throwNotImplemented(\"node:inspector close\", 2445);\n}, url = function() {\n throwNotImplemented(\"node:inspector url\", 2445);\n}, waitForDebugger = function() {\n throwNotImplemented(\"node:inspector waitForDebugger\", 2445);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20);\n\nclass Session extends EventEmitter {\n constructor() {\n super();\n throwNotImplemented(\"node:inspector Session\", 2445);\n }\n}\nvar console = {\n ...globalThis.console,\n context: {\n console: globalThis.console\n }\n};\n$ = {\n console,\n open,\n close,\n url,\n waitForDebugger,\n Session\n};\nhideFromStack(open, close, url, waitForDebugger, Session.prototype.constructor);\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodePathPosixCode = "(function (){\"use strict\";// src/js/out/tmp/node/path.posix.ts\nreturn (@getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28)).posix})\n"_s;
+static constexpr ASCIILiteral NodeNetCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/net.ts\nvar isIPv4 = function(s) {\n return IPv4Reg.test(s);\n}, isIPv6 = function(s) {\n return IPv6Reg.test(s);\n}, isIP = function(s) {\n if (isIPv4(s))\n return 4;\n if (isIPv6(s))\n return 6;\n return 0;\n}, closeNT = function(self) {\n self.emit(\"close\");\n}, endNT = function(socket, callback, err) {\n socket.end(), callback(err);\n}, createConnection = function(port, host, connectListener) {\n if (typeof port === \"object\")\n return new Socket(port).connect(port, host, connectListener);\n return new Socket().connect(port, host, connectListener);\n}, emitErrorNextTick = function(self, error) {\n self.emit(\"error\", error);\n}, emitErrorAndCloseNextTick = function(self, error) {\n self.emit(\"error\", error), self.emit(\"close\");\n}, emitListeningNextTick = function(self, onListen) {\n if (typeof onListen === \"function\")\n try {\n onListen();\n } catch (err) {\n self.emit(\"error\", err);\n }\n self.emit(\"listening\");\n}, createServer = function(options, connectionListener) {\n return new Server(options, connectionListener);\n}, $, { Duplex } = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20);\nvar IPv4Reg = new @RegExp(\"^((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$\");\nvar IPv6Reg = new @RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\"), { connect: bunConnect } = Bun, { setTimeout } = globalThis, bunTlsSymbol = Symbol.for(\"::buntls::\"), bunSocketServerHandlers = Symbol.for(\"::bunsocket_serverhandlers::\"), bunSocketServerConnections = Symbol.for(\"::bunnetserverconnections::\"), bunSocketServerOptions = Symbol.for(\"::bunnetserveroptions::\"), bunSocketInternal = Symbol.for(\"::bunnetsocketinternal::\"), bunTLSConnectOptions = Symbol.for(\"::buntlsconnectoptions::\"), SocketClass, Socket = function(InternalSocket) {\n SocketClass = InternalSocket, Object.defineProperty(SocketClass.prototype, Symbol.toStringTag, {\n value: \"Socket\",\n enumerable: !1\n });\n function Socket3(options) {\n return new InternalSocket(options);\n }\n return Socket3.prototype = InternalSocket.prototype, Object.defineProperty(Socket3, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalSocket;\n }\n });\n}(class Socket2 extends Duplex {\n static #Handlers = {\n close: Socket2.#Close,\n data({ data: self }, buffer) {\n self.bytesRead += buffer.length;\n const queue = self.#readQueue;\n if (queue.isEmpty()) {\n if (self.push(buffer))\n return;\n }\n queue.push(buffer);\n },\n drain: Socket2.#Drain,\n end: Socket2.#Close,\n error(socket, error) {\n const self = socket.data, callback = self.#writeCallback;\n if (callback)\n self.#writeCallback = null, callback(error);\n self.emit(\"error\", error);\n },\n open(socket) {\n const self = socket.data;\n socket.timeout(self.timeout), socket.ref(), self[bunSocketInternal] = socket, self.connecting = !1;\n const options = self[bunTLSConnectOptions];\n if (options) {\n const { session } = options;\n if (session)\n self.setSession(session);\n }\n if (!self.#upgraded)\n self.emit(\"connect\", self);\n Socket2.#Drain(socket);\n },\n handshake(socket, success, verifyError) {\n const { data: self } = socket;\n self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self.emit(\"secure\", self);\n const { checkServerIdentity } = self[bunTLSConnectOptions];\n if (!verifyError && typeof checkServerIdentity === \"function\" && self.servername) {\n const cert = self.getPeerCertificate(!0);\n verifyError = checkServerIdentity(self.servername, cert);\n }\n if (self._requestCert || self._rejectUnauthorized) {\n if (verifyError) {\n if (self.authorized = !1, self.authorizationError = verifyError.code || verifyError.message, self._rejectUnauthorized) {\n self.destroy(verifyError);\n return;\n }\n }\n } else\n self.authorized = !0;\n self.emit(\"secureConnect\", verifyError);\n },\n timeout(socket) {\n const self = socket.data;\n self.emit(\"timeout\", self);\n },\n binaryType: \"buffer\"\n };\n static #Close(socket) {\n const self = socket.data;\n if (self.#closed)\n return;\n self.#closed = !0, self[bunSocketInternal] = null;\n const queue = self.#readQueue;\n if (queue.isEmpty()) {\n if (self.push(null))\n return;\n }\n queue.push(null);\n }\n static #Drain(socket) {\n const self = socket.data, callback = self.#writeCallback;\n if (callback) {\n const chunk = self.#writeChunk, written = socket.write(chunk);\n if (self.bytesWritten += written, written < chunk.length)\n self.#writeChunk = chunk.slice(written);\n else\n self.#writeCallback = null, self.#writeChunk = null, callback(null);\n }\n }\n static [bunSocketServerHandlers] = {\n data: Socket2.#Handlers.data,\n close(socket) {\n Socket2.#Handlers.close(socket), this.data[bunSocketServerConnections]--;\n },\n end(socket) {\n Socket2.#Handlers.end(socket), this.data[bunSocketServerConnections]--;\n },\n open(socket) {\n const self = this.data, options = self[bunSocketServerOptions], { pauseOnConnect, connectionListener, InternalSocketClass, requestCert, rejectUnauthorized } = options, _socket = new InternalSocketClass({});\n if (_socket.isServer = !0, _socket._requestCert = requestCert, _socket._rejectUnauthorized = rejectUnauthorized, _socket.#attach(this.localPort, socket), self.maxConnections && self[bunSocketServerConnections] >= self.maxConnections) {\n const data = {\n localAddress: _socket.localAddress,\n localPort: _socket.localPort,\n localFamily: _socket.localFamily,\n remoteAddress: _socket.remoteAddress,\n remotePort: _socket.remotePort,\n remoteFamily: _socket.remoteFamily || \"IPv4\"\n };\n socket.end(), self.emit(\"drop\", data);\n return;\n }\n if (!pauseOnConnect)\n _socket.resume();\n if (self[bunSocketServerConnections]++, typeof connectionListener == \"function\")\n if (InternalSocketClass.name === \"TLSSocket\")\n self.once(\"secureConnection\", () => connectionListener(_socket));\n else\n connectionListener(_socket);\n self.emit(\"connection\", _socket);\n },\n handshake(socket, success, verifyError) {\n const { data: self } = socket;\n if (self.emit(\"secure\", self), self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self._requestCert || self._rejectUnauthorized) {\n if (verifyError) {\n if (self.authorized = !1, self.authorizationError = verifyError.code || verifyError.message, self._rejectUnauthorized) {\n self.destroy(verifyError);\n return;\n }\n }\n } else\n self.authorized = !0;\n self.emit(\"secureConnection\", verifyError);\n },\n error(socket, error) {\n Socket2.#Handlers.error(socket, error), this.data.emit(\"error\", error);\n },\n timeout: Socket2.#Handlers.timeout,\n connectError: Socket2.#Handlers.connectError,\n drain: Socket2.#Handlers.drain,\n binaryType: \"buffer\"\n };\n bytesRead = 0;\n bytesWritten = 0;\n #closed = !1;\n connecting = !1;\n localAddress = \"127.0.0.1\";\n #readQueue = @createFIFO();\n remotePort;\n [bunSocketInternal] = null;\n [bunTLSConnectOptions] = null;\n timeout = 0;\n #writeCallback;\n #writeChunk;\n #pendingRead;\n isServer = !1;\n _handle;\n _parent;\n _parentWrap;\n #socket;\n #upgraded;\n constructor(options) {\n const { socket, signal, write, read, allowHalfOpen = !1, ...opts } = options || {};\n super({\n ...opts,\n allowHalfOpen,\n readable: !0,\n writable: !0\n });\n if (this._handle = this, this._parent = this, this._parentWrap = this, this.#pendingRead = @undefined, this.#upgraded = null, socket instanceof Socket2)\n this.#socket = socket;\n signal\?.once(\"abort\", () => this.destroy()), this.once(\"connect\", () => this.emit(\"ready\"));\n }\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n #attach(port, socket) {\n if (this.remotePort = port, socket.data = this, socket.timeout(this.timeout), socket.ref(), this[bunSocketInternal] = socket, this.connecting = !1, !this.#upgraded)\n this.emit(\"connect\", this);\n Socket2.#Drain(socket);\n }\n #closeRawConnection() {\n const connection = this.#upgraded;\n connection[bunSocketInternal] = null, connection.unref(), connection.destroy(), process.nextTick(closeNT, connection);\n }\n connect(port, host, connectListener) {\n var path, connection = this.#socket, _checkServerIdentity = @undefined;\n if (typeof port === \"string\") {\n if (path = port, port = @undefined, typeof host === \"function\")\n connectListener = host, host = @undefined;\n } else if (typeof host == \"function\") {\n if (typeof port === \"string\")\n path = port, port = @undefined;\n connectListener = host, host = @undefined;\n }\n if (typeof port == \"object\") {\n var {\n port,\n host,\n path,\n socket,\n localAddress,\n localPort,\n family,\n hints,\n lookup,\n noDelay,\n keepAlive,\n keepAliveInitialDelay,\n requestCert,\n rejectUnauthorized,\n pauseOnConnect,\n servername,\n checkServerIdentity,\n session\n } = port;\n if (_checkServerIdentity = checkServerIdentity, this.servername = servername, socket)\n connection = socket;\n }\n if (!pauseOnConnect)\n this.resume();\n this.connecting = !0, this.remotePort = port;\n const bunTLS = this[bunTlsSymbol];\n var tls = @undefined;\n if (typeof bunTLS === \"function\") {\n if (tls = bunTLS.@call(this, port, host, !0), this._requestCert = !0, this._rejectUnauthorized = rejectUnauthorized, tls) {\n if (tls.rejectUnauthorized = rejectUnauthorized, tls.requestCert = !0, tls.session = session || tls.session, this.servername = tls.servername, tls.checkServerIdentity = _checkServerIdentity || tls.checkServerIdentity, this[bunTLSConnectOptions] = tls, !connection && tls.socket)\n connection = tls.socket;\n }\n if (connection) {\n if (typeof connection !== \"object\" || !(connection instanceof Socket2) || typeof connection[bunTlsSymbol] === \"function\")\n @throwTypeError(\"socket must be an instance of net.Socket\");\n }\n if (this.authorized = !1, this.secureConnecting = !0, this._secureEstablished = !1, this._securePending = !0, connectListener)\n this.on(\"secureConnect\", connectListener);\n } else if (connectListener)\n this.on(\"connect\", connectListener);\n try {\n if (connection) {\n const socket2 = connection[bunSocketInternal];\n if (socket2) {\n this.connecting = !0, this.#upgraded = connection;\n const result = socket2.upgradeTLS({\n data: this,\n tls,\n socket: Socket2.#Handlers\n });\n if (result) {\n const [raw, tls2] = result;\n connection[bunSocketInternal] = raw, raw.timeout(raw.timeout), this.once(\"end\", this.#closeRawConnection), raw.connecting = !1, this[bunSocketInternal] = tls2;\n } else\n throw this[bunSocketInternal] = null, new Error(\"Invalid socket\");\n } else\n connection.once(\"connect\", () => {\n const socket3 = connection[bunSocketInternal];\n if (!socket3)\n return;\n this.connecting = !0, this.#upgraded = connection;\n const result = socket3.upgradeTLS({\n data: this,\n tls,\n socket: Socket2.#Handlers\n });\n if (result) {\n const [raw, tls2] = result;\n connection[bunSocketInternal] = raw, raw.timeout(raw.timeout), this.once(\"end\", this.#closeRawConnection), raw.connecting = !1, this[bunSocketInternal] = tls2;\n } else\n throw this[bunSocketInternal] = null, new Error(\"Invalid socket\");\n });\n } else if (path)\n bunConnect({\n data: this,\n unix: path,\n socket: Socket2.#Handlers,\n tls\n }).catch((error) => {\n this.emit(\"error\", error), this.emit(\"close\");\n });\n else\n bunConnect({\n data: this,\n hostname: host || \"localhost\",\n port,\n socket: Socket2.#Handlers,\n tls\n }).catch((error) => {\n this.emit(\"error\", error), this.emit(\"close\");\n });\n } catch (error) {\n process.nextTick(emitErrorAndCloseNextTick, this, error);\n }\n return this;\n }\n _destroy(err, callback) {\n const socket = this[bunSocketInternal];\n socket && process.nextTick(endNT, socket, callback, err);\n }\n _final(callback) {\n this[bunSocketInternal]\?.end(), callback(), process.nextTick(closeNT, this);\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return this[bunSocketInternal]\?.localPort;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n const queue = this.#readQueue;\n let chunk;\n while (chunk = queue.peek()) {\n const can_continue = !this.push(chunk);\n if (queue.shift(), !can_continue)\n break;\n }\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n this[bunSocketInternal]\?.ref();\n }\n get remoteAddress() {\n return this[bunSocketInternal]\?.remoteAddress;\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n this[bunSocketInternal]\?.end();\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n return this;\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n if (this[bunSocketInternal]\?.timeout(timeout), this.timeout = timeout, callback)\n this.once(\"timeout\", callback);\n return this;\n }\n unref() {\n this[bunSocketInternal]\?.unref();\n }\n _write(chunk, encoding, callback) {\n if (typeof chunk == \"string\" && encoding !== \"ascii\")\n chunk = @Buffer.from(chunk, encoding);\n var written = this[bunSocketInternal]\?.write(chunk);\n if (written == chunk.length)\n callback();\n else if (this.#writeCallback)\n callback(new Error(\"overlapping _write()\"));\n else {\n if (written > 0)\n if (typeof chunk == \"string\")\n chunk = chunk.slice(written);\n else\n chunk = chunk.subarray(written);\n this.#writeCallback = callback, this.#writeChunk = chunk;\n }\n }\n}), connect = createConnection;\n\nclass Server extends EventEmitter {\n #server;\n #listening = !1;\n [bunSocketServerConnections] = 0;\n [bunSocketServerOptions];\n maxConnections = 0;\n constructor(options, connectionListener) {\n super();\n if (typeof options === \"function\")\n connectionListener = options, options = {};\n else if (options == null || typeof options === \"object\")\n options = { ...options };\n else\n throw new Error(\"bun-net-polyfill: invalid arguments\");\n const { maxConnections } = options;\n this.maxConnections = Number.isSafeInteger(maxConnections) && maxConnections > 0 \? maxConnections : 0, options.connectionListener = connectionListener, this[bunSocketServerOptions] = options;\n }\n ref() {\n return this.#server\?.ref(), this;\n }\n unref() {\n return this.#server\?.unref(), this;\n }\n close(callback) {\n if (this.#server) {\n if (this.#server.stop(!0), this.#server = null, this.#listening = !1, this[bunSocketServerConnections] = 0, this.emit(\"close\"), typeof callback === \"function\")\n callback();\n return this;\n }\n if (typeof callback === \"function\") {\n const error = new Error(\"Server is not running\");\n error.code = \"ERR_SERVER_NOT_RUNNING\", callback(error);\n }\n return this;\n }\n address() {\n const server = this.#server;\n if (server) {\n const unix = server.unix;\n if (unix)\n return unix;\n let address = server.hostname;\n const type = isIP(address), port = server.port;\n if (typeof port === \"number\")\n return {\n port,\n address,\n family: type \? `IPv${type}` : @undefined\n };\n if (type)\n return {\n address,\n family: type \? `IPv${type}` : @undefined\n };\n return address;\n }\n return null;\n }\n getConnections(callback) {\n if (typeof callback === \"function\")\n callback(null, this.#server \? this[bunSocketServerConnections] : 0);\n return this;\n }\n listen(port, hostname, onListen) {\n let backlog, path, exclusive = !1;\n if (typeof port === \"string\") {\n if (Number.isSafeInteger(hostname)) {\n if (hostname > 0)\n backlog = hostname;\n } else if (typeof hostname === \"function\")\n onListen = hostname;\n path = port, hostname = @undefined, port = @undefined;\n } else {\n if (typeof hostname === \"function\")\n onListen = hostname, hostname = @undefined;\n if (typeof port === \"function\")\n onListen = port, port = 0;\n else if (typeof port === \"object\") {\n const options = port;\n options.signal\?.addEventListener(\"abort\", () => this.close()), hostname = options.host, exclusive = options.exclusive === !0;\n const path2 = options.path;\n if (port = options.port, !Number.isSafeInteger(port) || port < 0)\n if (path2)\n hostname = path2, port = @undefined;\n else {\n let message = 'The argument \\'options\\' must have the property \"port\" or \"path\"';\n try {\n message = `${message}. Received ${JSON.stringify(options)}`;\n } catch {\n }\n const error = @makeTypeError(message);\n throw error.code = \"ERR_INVALID_ARG_VALUE\", error;\n }\n else if (!Number.isSafeInteger(port) || port < 0)\n port = 0;\n if (typeof port.callback === \"function\")\n onListen = port\?.callback;\n } else if (!Number.isSafeInteger(port) || port < 0)\n port = 0;\n hostname = hostname || \"::\";\n }\n try {\n var tls = @undefined, TLSSocketClass = @undefined;\n const bunTLS = this[bunTlsSymbol], options = this[bunSocketServerOptions];\n if (typeof bunTLS === \"function\")\n [tls, TLSSocketClass] = bunTLS.@call(this, port, hostname, !1), options.servername = tls.serverName, options.InternalSocketClass = TLSSocketClass;\n else\n options.InternalSocketClass = SocketClass;\n this.#server = Bun.listen(path \? {\n exclusive,\n unix: path,\n tls,\n socket: SocketClass[bunSocketServerHandlers]\n } : {\n exclusive,\n port,\n hostname,\n tls,\n socket: SocketClass[bunSocketServerHandlers]\n }), this.#server.data = this, this.#listening = !0, setTimeout(emitListeningNextTick, 1, this, onListen);\n } catch (err) {\n this.#listening = !1, setTimeout(emitErrorNextTick, 1, this, err);\n }\n return this;\n }\n}\n$ = {\n createServer,\n Server,\n createConnection,\n connect,\n isIP,\n isIPv4,\n isIPv6,\n Socket,\n [Symbol.for(\"::bunternal::\")]: SocketClass\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodePathCode = "(function (){\"use strict\";// src/js/out/tmp/node/path.ts\nvar bound = function(obj) {\n const toNamespacedPath = obj.toNamespacedPath.bind(obj);\n return {\n resolve: obj.resolve.bind(obj),\n normalize: obj.normalize.bind(obj),\n isAbsolute: obj.isAbsolute.bind(obj),\n join: obj.join.bind(obj),\n relative: obj.relative.bind(obj),\n toNamespacedPath,\n dirname: obj.dirname.bind(obj),\n basename: obj.basename.bind(obj),\n extname: obj.extname.bind(obj),\n format: obj.format.bind(obj),\n parse: obj.parse.bind(obj),\n sep: obj.sep,\n delimiter: obj.delimiter,\n win32: void 0,\n posix: void 0,\n _makeLong: toNamespacedPath\n };\n}, posix = bound(Bun._Path(!1)), win32 = bound(Bun._Path(!0));\nposix.win32 = win32.win32 = win32;\nposix.posix = win32.posix = posix;\nreturn posix})\n"_s;
+static constexpr ASCIILiteral NodeOSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/os.ts\nvar lazyCpus = function({ cpus }) {\n return () => {\n const array = new @Array(navigator.hardwareConcurrency);\n function populate() {\n const results = cpus(), length = results.length;\n array.length = length;\n for (let i = 0;i < length; i++)\n array[i] = results[i];\n }\n for (let i = 0;i < array.length; i++) {\n const instance = {\n get model() {\n if (array[i] === instance)\n populate();\n return array[i].model;\n },\n set model(value) {\n if (array[i] === instance)\n populate();\n array[i].model = value;\n },\n get speed() {\n if (array[i] === instance)\n populate();\n return array[i].speed;\n },\n set speed(value) {\n if (array[i] === instance)\n populate();\n array[i].speed = value;\n },\n get times() {\n if (array[i] === instance)\n populate();\n return array[i].times;\n },\n set times(value) {\n if (array[i] === instance)\n populate();\n array[i].times = value;\n },\n toJSON() {\n if (array[i] === instance)\n populate();\n return array[i];\n }\n };\n array[i] = instance;\n }\n return array;\n };\n}, bound = function(obj) {\n return {\n availableParallelism: () => {\n return navigator.hardwareConcurrency;\n },\n arch: obj.arch.bind(obj),\n cpus: lazyCpus(obj),\n endianness: obj.endianness.bind(obj),\n freemem: obj.freemem.bind(obj),\n getPriority: obj.getPriority.bind(obj),\n homedir: obj.homedir.bind(obj),\n hostname: obj.hostname.bind(obj),\n loadavg: obj.loadavg.bind(obj),\n networkInterfaces: obj.networkInterfaces.bind(obj),\n platform: obj.platform.bind(obj),\n release: obj.release.bind(obj),\n setPriority: obj.setPriority.bind(obj),\n get tmpdir() {\n return tmpdir;\n },\n totalmem: obj.totalmem.bind(obj),\n type: obj.type.bind(obj),\n uptime: obj.uptime.bind(obj),\n userInfo: obj.userInfo.bind(obj),\n version: obj.version.bind(obj),\n machine: obj.machine.bind(obj),\n devNull: obj.devNull,\n EOL: obj.EOL,\n constants: @processBindingConstants.os\n };\n}, tmpdir = function() {\n var env = Bun.env;\n return tmpdir = function() {\n var path = env.TMPDIR || env.TMP || env.TEMP || \"/tmp\";\n const length = path.length;\n if (length > 1 && path[length - 1] === \"/\")\n path = path.slice(0, -1);\n return path;\n }, tmpdir();\n};\nreturn bound(Bun._Os())})\n");
//
//
-static constexpr ASCIILiteral NodePathWin32Code = "(function (){\"use strict\";// src/js/out/tmp/node/path.win32.ts\nreturn (@getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28)).win32})\n"_s;
+static constexpr ASCIILiteral NodePathPosixCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/path.posix.ts\nreturn (@getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30)).posix})\n");
//
//
-static constexpr ASCIILiteral NodePerfHooksCode = "(function (){\"use strict\";// src/js/out/tmp/node/perf_hooks.ts\nvar $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), constants = {\n NODE_PERFORMANCE_GC_MAJOR: 4,\n NODE_PERFORMANCE_GC_MINOR: 1,\n NODE_PERFORMANCE_GC_INCREMENTAL: 8,\n NODE_PERFORMANCE_GC_WEAKCB: 16,\n NODE_PERFORMANCE_GC_FLAGS_NO: 0,\n NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: 2,\n NODE_PERFORMANCE_GC_FLAGS_FORCED: 4,\n NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: 8,\n NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: 16,\n NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: 32,\n NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: 64\n}, performance = globalThis.performance;\n\nclass PerformanceObserver {\n constructor() {\n throwNotImplemented(\"PerformanceObserver\");\n }\n}\n\nclass PerformanceEntry {\n constructor() {\n throwNotImplemented(\"PerformanceEntry\");\n }\n}\n$ = {\n performance,\n constants,\n PerformanceEntry,\n PerformanceObserver\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodePathCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/path.ts\nvar bound = function(obj) {\n const toNamespacedPath = obj.toNamespacedPath.bind(obj);\n return {\n resolve: obj.resolve.bind(obj),\n normalize: obj.normalize.bind(obj),\n isAbsolute: obj.isAbsolute.bind(obj),\n join: obj.join.bind(obj),\n relative: obj.relative.bind(obj),\n toNamespacedPath,\n dirname: obj.dirname.bind(obj),\n basename: obj.basename.bind(obj),\n extname: obj.extname.bind(obj),\n format: obj.format.bind(obj),\n parse: obj.parse.bind(obj),\n sep: obj.sep,\n delimiter: obj.delimiter,\n win32: @undefined,\n posix: @undefined,\n _makeLong: toNamespacedPath\n };\n}, posix = bound(Bun._Path(!1)), win32 = bound(Bun._Path(!0));\nposix.win32 = win32.win32 = win32;\nposix.posix = win32.posix = posix;\nreturn posix})\n");
//
//
-static constexpr ASCIILiteral NodePunycodeCode = "(function (){\"use strict\";// src/js/out/tmp/node/punycode.ts\nvar error = function(type) {\n @throwRangeError(errors[type]);\n}, map = function(array, callback) {\n const result = [];\n let length = array.length;\n while (length--)\n result[length] = callback(array[length]);\n return result;\n}, mapDomain = function(domain, callback) {\n const parts = domain.split(\"@\");\n let result = \"\";\n if (parts.length > 1)\n result = parts[0] + \"@\", domain = parts[1];\n domain = domain.replace(regexSeparators, \".\");\n const labels = domain.split(\".\"), encoded = map(labels, callback).join(\".\");\n return result + encoded;\n}, ucs2decode = function(string) {\n const output = [];\n let counter = 0;\n const length = string.length;\n while (counter < length) {\n const value = string.charCodeAt(counter++);\n if (value >= 55296 && value <= 56319 && counter < length) {\n const extra = string.charCodeAt(counter++);\n if ((extra & 64512) == 56320)\n output.push(((value & 1023) << 10) + (extra & 1023) + 65536);\n else\n output.push(value), counter--;\n } else\n output.push(value);\n }\n return output;\n}, $, maxInt = 2147483647, base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, delimiter = \"-\", regexPunycode = /^xn--/, regexNonASCII = /[^\\0-\\x7F]/, regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, errors = {\n overflow: \"Overflow: input needs wider integers to process\",\n \"not-basic\": \"Illegal input >= 0x80 (not a basic code point)\",\n \"invalid-input\": \"Invalid input\"\n}, baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, ucs2encode = (codePoints) => String.fromCodePoint(...codePoints), basicToDigit = function(codePoint) {\n if (codePoint >= 48 && codePoint < 58)\n return 26 + (codePoint - 48);\n if (codePoint >= 65 && codePoint < 91)\n return codePoint - 65;\n if (codePoint >= 97 && codePoint < 123)\n return codePoint - 97;\n return base;\n}, digitToBasic = function(digit, flag) {\n return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n}, adapt = function(delta, numPoints, firstTime) {\n let k = 0;\n delta = firstTime \? floor(delta / damp) : delta >> 1, delta += floor(delta / numPoints);\n for (;delta > baseMinusTMin * tMax >> 1; k += base)\n delta = floor(delta / baseMinusTMin);\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n}, decode = function(input) {\n const output = [], inputLength = input.length;\n let i = 0, n = initialN, bias = initialBias, basic = input.lastIndexOf(delimiter);\n if (basic < 0)\n basic = 0;\n for (let j = 0;j < basic; ++j) {\n if (input.charCodeAt(j) >= 128)\n error(\"not-basic\");\n output.push(input.charCodeAt(j));\n }\n for (let index = basic > 0 \? basic + 1 : 0;index < inputLength; ) {\n const oldi = i;\n for (let w = 1, k = base;; k += base) {\n if (index >= inputLength)\n error(\"invalid-input\");\n const digit = basicToDigit(input.charCodeAt(index++));\n if (digit >= base)\n error(\"invalid-input\");\n if (digit > floor((maxInt - i) / w))\n error(\"overflow\");\n i += digit * w;\n const t = k <= bias \? tMin : k >= bias + tMax \? tMax : k - bias;\n if (digit < t)\n break;\n const baseMinusT = base - t;\n if (w > floor(maxInt / baseMinusT))\n error(\"overflow\");\n w *= baseMinusT;\n }\n const out = output.length + 1;\n if (bias = adapt(i - oldi, out, oldi == 0), floor(i / out) > maxInt - n)\n error(\"overflow\");\n n += floor(i / out), i %= out, output.splice(i++, 0, n);\n }\n return String.fromCodePoint(...output);\n}, encode = function(input) {\n const output = [];\n input = ucs2decode(input);\n const inputLength = input.length;\n let n = initialN, delta = 0, bias = initialBias;\n for (let currentValue of input)\n if (currentValue < 128)\n output.push(stringFromCharCode(currentValue));\n const basicLength = output.length;\n let handledCPCount = basicLength;\n if (basicLength)\n output.push(delimiter);\n while (handledCPCount < inputLength) {\n let m = maxInt;\n for (let currentValue of input)\n if (currentValue >= n && currentValue < m)\n m = currentValue;\n const handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne))\n error(\"overflow\");\n delta += (m - n) * handledCPCountPlusOne, n = m;\n for (let currentValue of input) {\n if (currentValue < n && ++delta > maxInt)\n error(\"overflow\");\n if (currentValue === n) {\n let q = delta;\n for (let k = base;; k += base) {\n const t = k <= bias \? tMin : k >= bias + tMax \? tMax : k - bias;\n if (q < t)\n break;\n const qMinusT = q - t, baseMinusT = base - t;\n output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))), q = floor(qMinusT / baseMinusT);\n }\n output.push(stringFromCharCode(digitToBasic(q, 0))), bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength), delta = 0, ++handledCPCount;\n }\n }\n ++delta, ++n;\n }\n return output.join(\"\");\n}, toUnicode = function(input) {\n return mapDomain(input, function(string) {\n return regexPunycode.test(string) \? decode(string.slice(4).toLowerCase()) : string;\n });\n}, toASCII = function(input) {\n return mapDomain(input, function(string) {\n return regexNonASCII.test(string) \? \"xn--\" + encode(string) : string;\n });\n};\n$ = {\n version: \"2.1.0\",\n ucs2: {\n decode: ucs2decode,\n encode: ucs2encode\n },\n decode,\n encode,\n toASCII,\n toUnicode\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodePathWin32Code = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/path.win32.ts\nreturn (@getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30)).win32})\n");
//
//
-static constexpr ASCIILiteral NodeQuerystringCode = "(function (){\"use strict\";// src/js/out/tmp/node/querystring.ts\nvar __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports), Buffer = @requireNativeModule(\"buffer\").Buffer, require_object_keys = __commonJS((exports, module) => {\n var objectKeys = Object.keys || function() {\n var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !{ toString: null }.propertyIsEnumerable(\"toString\"), dontEnums = [\n \"toString\",\n \"toLocaleString\",\n \"valueOf\",\n \"hasOwnProperty\",\n \"isPrototypeOf\",\n \"propertyIsEnumerable\",\n \"constructor\"\n ], dontEnumsLength = dontEnums.length;\n return function(obj) {\n if (typeof obj !== \"function\" && (typeof obj !== \"object\" || obj === null))\n @throwTypeError(\"Object.keys called on non-object\");\n var result = [], prop, i;\n for (prop in obj)\n if (hasOwnProperty.call(obj, prop))\n result.push(prop);\n if (hasDontEnumBug) {\n for (i = 0;i < dontEnumsLength; i++)\n if (hasOwnProperty.call(obj, dontEnums[i]))\n result.push(dontEnums[i]);\n }\n return result;\n };\n }();\n module.exports = objectKeys;\n}), require_src = __commonJS((exports, module) => {\n var ParsedQueryString = function() {\n }, unescapeBuffer = function(s, decodeSpaces) {\n var out = Buffer.allocUnsafe(s.length), state = 0, n, m, hexchar, c;\n for (var inIndex = 0, outIndex = 0;; inIndex++) {\n if (inIndex < s.length)\n c = s.charCodeAt(inIndex);\n else {\n if (state > 0) {\n if (out[outIndex++] = 37, state === 2)\n out[outIndex++] = hexchar;\n }\n break;\n }\n switch (state) {\n case 0:\n switch (c) {\n case 37:\n n = 0, m = 0, state = 1;\n break;\n case 43:\n if (decodeSpaces)\n c = 32;\n default:\n out[outIndex++] = c;\n break;\n }\n break;\n case 1:\n if (hexchar = c, n = unhexTable[c], !(n >= 0)) {\n out[outIndex++] = 37, out[outIndex++] = c, state = 0;\n break;\n }\n state = 2;\n break;\n case 2:\n if (state = 0, m = unhexTable[c], !(m >= 0)) {\n out[outIndex++] = 37, out[outIndex++] = hexchar, out[outIndex++] = c;\n break;\n }\n out[outIndex++] = 16 * n + m;\n break;\n }\n }\n return out.slice(0, outIndex);\n }, qsUnescape = function(s, decodeSpaces) {\n try {\n return decodeURIComponent(s);\n } catch (e) {\n return QueryString.unescapeBuffer(s, decodeSpaces).toString();\n }\n }, qsEscape = function(str) {\n if (typeof str !== \"string\")\n if (typeof str === \"object\")\n str = String(str);\n else\n str += \"\";\n var out = \"\", lastPos = 0;\n for (var i2 = 0;i2 < str.length; ++i2) {\n var c = str.charCodeAt(i2);\n if (c < 128) {\n if (noEscape[c] === 1)\n continue;\n if (lastPos < i2)\n out += str.slice(lastPos, i2);\n lastPos = i2 + 1, out += hexTable[c];\n continue;\n }\n if (lastPos < i2)\n out += str.slice(lastPos, i2);\n if (c < 2048) {\n lastPos = i2 + 1, out += hexTable[192 | c >> 6] + hexTable[128 | c & 63];\n continue;\n }\n if (c < 55296 || c >= 57344) {\n lastPos = i2 + 1, out += hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];\n continue;\n }\n ++i2;\n var c2;\n if (i2 < str.length)\n c2 = str.charCodeAt(i2) & 1023;\n else\n throw new URIError(\"URI malformed\");\n lastPos = i2 + 1, c = 65536 + ((c & 1023) << 10 | c2), out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];\n }\n if (lastPos === 0)\n return str;\n if (lastPos < str.length)\n return out + str.slice(lastPos);\n return out;\n }, stringifyPrimitive = function(v) {\n if (typeof v === \"string\")\n return v;\n if (typeof v === \"number\" && isFinite(v))\n return \"\" + v;\n if (typeof v === \"boolean\")\n return v \? \"true\" : \"false\";\n return \"\";\n }, stringify = function(obj, sep, eq, options) {\n sep = sep || \"&\", eq = eq || \"=\";\n var encode = QueryString.escape;\n if (options && typeof options.encodeURIComponent === \"function\")\n encode = options.encodeURIComponent;\n if (obj !== null && typeof obj === \"object\") {\n var keys = objectKeys(obj), len = keys.length, flast = len - 1, fields = \"\";\n for (var i2 = 0;i2 < len; ++i2) {\n var k = keys[i2], v = obj[k], ks = encode(stringifyPrimitive(k)) + eq;\n if (isArray(v)) {\n var vlen = v.length, vlast = vlen - 1;\n for (var j = 0;j < vlen; ++j)\n if (fields += ks + encode(stringifyPrimitive(v[j])), j < vlast)\n fields += sep;\n if (vlen && i2 < flast)\n fields += sep;\n } else if (fields += ks + encode(stringifyPrimitive(v)), i2 < flast)\n fields += sep;\n }\n return fields;\n }\n return \"\";\n }, charCodes = function(str) {\n if (str.length === 0)\n return [];\n if (str.length === 1)\n return [str.charCodeAt(0)];\n const ret = [];\n for (var i2 = 0;i2 < str.length; ++i2)\n ret[ret.length] = str.charCodeAt(i2);\n return ret;\n }, parse = function(qs, sep, eq, options) {\n const obj = new ParsedQueryString;\n if (typeof qs !== \"string\" || qs.length === 0)\n return obj;\n var sepCodes = !sep \? defSepCodes : charCodes(sep + \"\"), eqCodes = !eq \? defEqCodes : charCodes(eq + \"\");\n const sepLen = sepCodes.length, eqLen = eqCodes.length;\n var pairs = 1000;\n if (options && typeof options.maxKeys === \"number\")\n pairs = options.maxKeys > 0 \? options.maxKeys : -1;\n var decode = QueryString.unescape;\n if (options && typeof options.decodeURIComponent === \"function\")\n decode = options.decodeURIComponent;\n const customDecode = decode !== qsUnescape, keys = [];\n var posIdx = 0, lastPos = 0, sepIdx = 0, eqIdx = 0, key = \"\", value = \"\", keyEncoded = customDecode, valEncoded = customDecode, encodeCheck = 0;\n for (var i2 = 0;i2 < qs.length; ++i2) {\n const code = qs.charCodeAt(i2);\n if (code === sepCodes[sepIdx]) {\n if (++sepIdx === sepLen) {\n const end = i2 - sepIdx + 1;\n if (eqIdx < eqLen) {\n if (lastPos < end)\n key += qs.slice(lastPos, end);\n } else if (lastPos < end)\n value += qs.slice(lastPos, end);\n if (keyEncoded)\n key = decodeStr(key, decode);\n if (valEncoded)\n value = decodeStr(value, decode);\n if (key || value || lastPos - posIdx > sepLen || i2 === 0)\n if (indexOf(keys, key) === -1)\n obj[key] = value, keys[keys.length] = key;\n else {\n const curValue = obj[key] || \"\";\n if (curValue.pop)\n curValue[curValue.length] = value;\n else if (curValue)\n obj[key] = [curValue, value];\n }\n else if (i2 === 1)\n delete obj[key];\n if (--pairs === 0)\n break;\n keyEncoded = valEncoded = customDecode, encodeCheck = 0, key = value = \"\", posIdx = lastPos, lastPos = i2 + 1, sepIdx = eqIdx = 0;\n }\n continue;\n } else if (sepIdx = 0, !valEncoded)\n if (code === 37)\n encodeCheck = 1;\n else if (encodeCheck > 0 && (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {\n if (++encodeCheck === 3)\n valEncoded = !0;\n } else\n encodeCheck = 0;\n if (eqIdx < eqLen) {\n if (code === eqCodes[eqIdx]) {\n if (++eqIdx === eqLen) {\n const end = i2 - eqIdx + 1;\n if (lastPos < end)\n key += qs.slice(lastPos, end);\n encodeCheck = 0, lastPos = i2 + 1;\n }\n continue;\n } else if (eqIdx = 0, !keyEncoded)\n if (code === 37)\n encodeCheck = 1;\n else if (encodeCheck > 0 && (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {\n if (++encodeCheck === 3)\n keyEncoded = !0;\n } else\n encodeCheck = 0;\n }\n if (code === 43) {\n if (eqIdx < eqLen) {\n if (lastPos < i2)\n key += qs.slice(lastPos, i2);\n key += \"%20\", keyEncoded = !0;\n } else {\n if (lastPos < i2)\n value += qs.slice(lastPos, i2);\n value += \"%20\", valEncoded = !0;\n }\n lastPos = i2 + 1;\n }\n }\n if (pairs !== 0 && (lastPos < qs.length || eqIdx > 0)) {\n if (lastPos < qs.length) {\n if (eqIdx < eqLen)\n key += qs.slice(lastPos);\n else if (sepIdx < sepLen)\n value += qs.slice(lastPos);\n }\n if (keyEncoded)\n key = decodeStr(key, decode);\n if (valEncoded)\n value = decodeStr(value, decode);\n if (indexOf(keys, key) === -1)\n obj[key] = value, keys[keys.length] = key;\n else {\n const curValue = obj[key];\n if (curValue.pop)\n curValue[curValue.length] = value;\n else\n obj[key] = [curValue, value];\n }\n }\n return obj;\n }, decodeStr = function(s, decoder) {\n try {\n return decoder(s);\n } catch (e) {\n return QueryString.unescape(s, !0);\n }\n }, QueryString = module.exports = {\n unescapeBuffer,\n unescape: qsUnescape,\n escape: qsEscape,\n stringify,\n encode: stringify,\n parse,\n decode: parse\n }, objectKeys = require_object_keys(), isArray = (arg) => Object.prototype.toString.call(arg) === \"[object Array]\", indexOf = (arr, searchElement, fromIndex) => {\n var k;\n if (arr == null)\n @throwTypeError('\"arr\" is null or not defined');\n var o = Object(arr), len = o.length >>> 0;\n if (len === 0)\n return -1;\n var n = fromIndex | 0;\n if (n >= len)\n return -1;\n k = Math.max(n >= 0 \? n : len - Math.abs(n), 0);\n while (k < len) {\n if ((k in o) && o[k] === searchElement)\n return k;\n k++;\n }\n return -1;\n };\n ParsedQueryString.prototype = Object.create \? Object.create(null) : {};\n var unhexTable = [\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1\n ], hexTable = [];\n for (i = 0;i < 256; ++i)\n hexTable[i] = \"%\" + ((i < 16 \? \"0\" : \"\") + i.toString(16)).toUpperCase();\n var i, noEscape = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 1,\n 0\n ], defSepCodes = [38], defEqCodes = [61];\n});\nreturn require_src()})\n"_s;
+static constexpr ASCIILiteral NodePerfHooksCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/perf_hooks.ts\nvar $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), constants = {\n NODE_PERFORMANCE_GC_MAJOR: 4,\n NODE_PERFORMANCE_GC_MINOR: 1,\n NODE_PERFORMANCE_GC_INCREMENTAL: 8,\n NODE_PERFORMANCE_GC_WEAKCB: 16,\n NODE_PERFORMANCE_GC_FLAGS_NO: 0,\n NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: 2,\n NODE_PERFORMANCE_GC_FLAGS_FORCED: 4,\n NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: 8,\n NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: 16,\n NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: 32,\n NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: 64\n}, performance = globalThis.performance;\n\nclass PerformanceObserver {\n constructor() {\n throwNotImplemented(\"PerformanceObserver\");\n }\n}\n\nclass PerformanceEntry {\n constructor() {\n throwNotImplemented(\"PerformanceEntry\");\n }\n}\n$ = {\n performance,\n constants,\n PerformanceEntry,\n PerformanceObserver\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeReadlineCode = "(function (){\"use strict\";// src/js/out/tmp/node/readline.ts\nvar stripVTControlCharacters = function(str) {\n return validateString(str, \"str\"), RegExpPrototypeSymbolReplace.call(ansi, str, \"\");\n}, promisify = function(original) {\n if (validateFunction(original, \"original\"), original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n return validateFunction(fn, \"util.promisify.custom\"), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n }\n var argumentNames = original[kCustomPromisifyArgsSymbol];\n function fn(...args) {\n return new Promise((resolve, reject) => {\n ArrayPrototypePush.call(args, (err, ...values) => {\n if (err)\n return reject(err);\n if (argumentNames !== void 0 && values.length > 1) {\n var obj = {};\n for (var i2 = 0;i2 < argumentNames.length; i2++)\n obj[argumentNames[i2]] = values[i2];\n resolve(obj);\n } else\n resolve(values[0]);\n }), ReflectApply(original, this, args);\n });\n }\n ObjectSetPrototypeOf(fn, ObjectGetPrototypeOf(original)), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n var descriptors = ObjectGetOwnPropertyDescriptors(original), propertiesValues = ObjectValues(descriptors);\n for (var i = 0;i < propertiesValues.length; i++)\n ObjectSetPrototypeOf(propertiesValues[i], null);\n return ObjectDefineProperties(fn, descriptors);\n}, getNodeErrorByName = function(typeName) {\n var base = errorBases[typeName];\n if (base)\n return base;\n if (!ObjectKeys(VALID_NODE_ERROR_BASES).includes(typeName))\n throw new Error(\"Invalid NodeError type\");\n var Base = VALID_NODE_ERROR_BASES[typeName];\n\n class NodeError extends Base {\n [kIsNodeError] = !0;\n code;\n constructor(msg, opts) {\n super(msg, opts);\n this.code = opts\?.code || \"ERR_GENERIC\";\n }\n toString() {\n return `${this.name} [${this.code}]: ${this.message}`;\n }\n }\n return errorBases[typeName] = NodeError, NodeError;\n}, validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateArray = function(value, name, minLength = 0) {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n var reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar validateInteger = function(value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, validateUint32 = function(value, name, positive = !1) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n var min = positive \? 1 : 0, max = 4294967295;\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, CSI = function(strings, ...args) {\n var ret = `${kEscape}[`;\n for (var n = 0;n < strings.length; n++)\n if (ret += strings[n], n < args.length)\n ret += args[n];\n return ret;\n}, charLengthLeft = function(str, i) {\n if (i <= 0)\n return 0;\n if (i > 1 && StringPrototypeCodePointAt.call(str, i - 2) >= kUTF16SurrogateThreshold || StringPrototypeCodePointAt.call(str, i - 1) >= kUTF16SurrogateThreshold)\n return 2;\n return 1;\n}, charLengthAt = function(str, i) {\n if (str.length <= i)\n return 1;\n return StringPrototypeCodePointAt.call(str, i) >= kUTF16SurrogateThreshold \? 2 : 1;\n};\nfunction* emitKeys(stream) {\n while (!0) {\n var ch = yield, s = ch, escaped = !1, keySeq = null, keyName, keyCtrl2 = !1, keyMeta = !1, keyShift = !1;\n if (ch === kEscape) {\n if (escaped = !0, s += ch = yield, ch === kEscape)\n s += ch = yield;\n }\n if (escaped && (ch === \"O\" || ch === \"[\")) {\n var code = ch, modifier = 0;\n if (ch === \"O\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n modifier = (ch >> 0) - 1, s += ch = yield;\n code += ch;\n } else if (ch === \"[\") {\n if (s += ch = yield, ch === \"[\")\n code += ch, s += ch = yield;\n var cmdStart = s.length - 1;\n if (ch >= \"0\" && ch <= \"9\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += ch = yield;\n }\n if (ch === \";\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += yield;\n }\n var cmd = StringPrototypeSlice.call(s, cmdStart), match;\n if (match = RegExpPrototypeExec.call(/^(\\d\\d\?)(;(\\d))\?([~^$])$/, cmd))\n code += match[1] + match[4], modifier = (match[3] || 1) - 1;\n else if (match = RegExpPrototypeExec.call(/^((\\d;)\?(\\d))\?([A-Za-z])$/, cmd))\n code += match[4], modifier = (match[3] || 1) - 1;\n else\n code += cmd;\n }\n switch (keyCtrl2 = !!(modifier & 4), keyMeta = !!(modifier & 10), keyShift = !!(modifier & 1), code) {\n case \"[P\":\n keyName = \"f1\";\n break;\n case \"[Q\":\n keyName = \"f2\";\n break;\n case \"[R\":\n keyName = \"f3\";\n break;\n case \"[S\":\n keyName = \"f4\";\n break;\n case \"OP\":\n keyName = \"f1\";\n break;\n case \"OQ\":\n keyName = \"f2\";\n break;\n case \"OR\":\n keyName = \"f3\";\n break;\n case \"OS\":\n keyName = \"f4\";\n break;\n case \"[11~\":\n keyName = \"f1\";\n break;\n case \"[12~\":\n keyName = \"f2\";\n break;\n case \"[13~\":\n keyName = \"f3\";\n break;\n case \"[14~\":\n keyName = \"f4\";\n break;\n case \"[[A\":\n keyName = \"f1\";\n break;\n case \"[[B\":\n keyName = \"f2\";\n break;\n case \"[[C\":\n keyName = \"f3\";\n break;\n case \"[[D\":\n keyName = \"f4\";\n break;\n case \"[[E\":\n keyName = \"f5\";\n break;\n case \"[15~\":\n keyName = \"f5\";\n break;\n case \"[17~\":\n keyName = \"f6\";\n break;\n case \"[18~\":\n keyName = \"f7\";\n break;\n case \"[19~\":\n keyName = \"f8\";\n break;\n case \"[20~\":\n keyName = \"f9\";\n break;\n case \"[21~\":\n keyName = \"f10\";\n break;\n case \"[23~\":\n keyName = \"f11\";\n break;\n case \"[24~\":\n keyName = \"f12\";\n break;\n case \"[A\":\n keyName = \"up\";\n break;\n case \"[B\":\n keyName = \"down\";\n break;\n case \"[C\":\n keyName = \"right\";\n break;\n case \"[D\":\n keyName = \"left\";\n break;\n case \"[E\":\n keyName = \"clear\";\n break;\n case \"[F\":\n keyName = \"end\";\n break;\n case \"[H\":\n keyName = \"home\";\n break;\n case \"OA\":\n keyName = \"up\";\n break;\n case \"OB\":\n keyName = \"down\";\n break;\n case \"OC\":\n keyName = \"right\";\n break;\n case \"OD\":\n keyName = \"left\";\n break;\n case \"OE\":\n keyName = \"clear\";\n break;\n case \"OF\":\n keyName = \"end\";\n break;\n case \"OH\":\n keyName = \"home\";\n break;\n case \"[1~\":\n keyName = \"home\";\n break;\n case \"[2~\":\n keyName = \"insert\";\n break;\n case \"[3~\":\n keyName = \"delete\";\n break;\n case \"[4~\":\n keyName = \"end\";\n break;\n case \"[5~\":\n keyName = \"pageup\";\n break;\n case \"[6~\":\n keyName = \"pagedown\";\n break;\n case \"[[5~\":\n keyName = \"pageup\";\n break;\n case \"[[6~\":\n keyName = \"pagedown\";\n break;\n case \"[7~\":\n keyName = \"home\";\n break;\n case \"[8~\":\n keyName = \"end\";\n break;\n case \"[a\":\n keyName = \"up\", keyShift = !0;\n break;\n case \"[b\":\n keyName = \"down\", keyShift = !0;\n break;\n case \"[c\":\n keyName = \"right\", keyShift = !0;\n break;\n case \"[d\":\n keyName = \"left\", keyShift = !0;\n break;\n case \"[e\":\n keyName = \"clear\", keyShift = !0;\n break;\n case \"[2$\":\n keyName = \"insert\", keyShift = !0;\n break;\n case \"[3$\":\n keyName = \"delete\", keyShift = !0;\n break;\n case \"[5$\":\n keyName = \"pageup\", keyShift = !0;\n break;\n case \"[6$\":\n keyName = \"pagedown\", keyShift = !0;\n break;\n case \"[7$\":\n keyName = \"home\", keyShift = !0;\n break;\n case \"[8$\":\n keyName = \"end\", keyShift = !0;\n break;\n case \"Oa\":\n keyName = \"up\", keyCtrl2 = !0;\n break;\n case \"Ob\":\n keyName = \"down\", keyCtrl2 = !0;\n break;\n case \"Oc\":\n keyName = \"right\", keyCtrl2 = !0;\n break;\n case \"Od\":\n keyName = \"left\", keyCtrl2 = !0;\n break;\n case \"Oe\":\n keyName = \"clear\", keyCtrl2 = !0;\n break;\n case \"[2^\":\n keyName = \"insert\", keyCtrl2 = !0;\n break;\n case \"[3^\":\n keyName = \"delete\", keyCtrl2 = !0;\n break;\n case \"[5^\":\n keyName = \"pageup\", keyCtrl2 = !0;\n break;\n case \"[6^\":\n keyName = \"pagedown\", keyCtrl2 = !0;\n break;\n case \"[7^\":\n keyName = \"home\", keyCtrl2 = !0;\n break;\n case \"[8^\":\n keyName = \"end\", keyCtrl2 = !0;\n break;\n case \"[Z\":\n keyName = \"tab\", keyShift = !0;\n break;\n default:\n keyName = \"undefined\";\n break;\n }\n } else if (ch === \"\\r\")\n keyName = \"return\", keyMeta = escaped;\n else if (ch === \"\\n\")\n keyName = \"enter\", keyMeta = escaped;\n else if (ch === \"\\t\")\n keyName = \"tab\", keyMeta = escaped;\n else if (ch === \"\\b\" || ch === \"\\x7F\")\n keyName = \"backspace\", keyMeta = escaped;\n else if (ch === kEscape)\n keyName = \"escape\", keyMeta = escaped;\n else if (ch === \" \")\n keyName = \"space\", keyMeta = escaped;\n else if (!escaped && ch <= \"\\x1A\")\n keyName = StringFromCharCode(StringPrototypeCharCodeAt.call(ch) + StringPrototypeCharCodeAt.call(\"a\") - 1), keyCtrl2 = !0;\n else if (RegExpPrototypeExec.call(/^[0-9A-Za-z]$/, ch) !== null)\n keyName = StringPrototypeToLowerCase.call(ch), keyShift = RegExpPrototypeExec.call(/^[A-Z]$/, ch) !== null, keyMeta = escaped;\n else if (escaped)\n keyName = ch.length \? void 0 : \"escape\", keyMeta = !0;\n else\n keyName = void 0;\n if (keySeq = s, s.length !== 0 && (keyName !== void 0 || escaped))\n stream.emit(\"keypress\", escaped \? void 0 : s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n else if (charLengthAt(s, 0) === s.length)\n stream.emit(\"keypress\", s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n }\n}\nvar commonPrefix = function(strings) {\n if (strings.length === 0)\n return \"\";\n if (strings.length === 1)\n return strings[0];\n var sorted = ArrayPrototypeSort.call(ArrayPrototypeSlice.call(strings)), min = sorted[0], max = sorted[sorted.length - 1];\n for (var i = 0;i < min.length; i++)\n if (min[i] !== max[i])\n return StringPrototypeSlice.call(min, 0, i);\n return min;\n}, cursorTo = function(stream, x, y, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (typeof y === \"function\")\n callback = y, y = void 0;\n if (NumberIsNaN(x))\n throw new ERR_INVALID_ARG_VALUE(\"x\", x);\n if (NumberIsNaN(y))\n throw new ERR_INVALID_ARG_VALUE(\"y\", y);\n if (stream == null || typeof x !== \"number\" && typeof y !== \"number\") {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n if (typeof x !== \"number\")\n throw new ERR_INVALID_CURSOR_POS;\n var data = typeof y !== \"number\" \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n return stream.write(data, callback);\n}, moveCursor = function(stream, dx, dy, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream == null || !(dx || dy)) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n return stream.write(data, callback);\n}, clearLine = function(stream, dir, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var type = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n return stream.write(type, callback);\n}, clearScreenDown = function(stream, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n return stream.write(kClearScreenDown, callback);\n}, emitKeypressEvents = function(stream, iface = {}) {\n if (stream[KEYPRESS_DECODER])\n return;\n stream[KEYPRESS_DECODER] = new StringDecoder(\"utf8\"), stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next();\n var triggerEscape = () => stream[ESCAPE_DECODER].next(\"\"), { escapeCodeTimeout = ESCAPE_CODE_TIMEOUT } = iface, timeoutId;\n function onData(input) {\n if (stream.listenerCount(\"keypress\") > 0) {\n var string = stream[KEYPRESS_DECODER].write(input);\n if (string) {\n clearTimeout(timeoutId), iface[kSawKeyPress] = charLengthAt(string, 0) === string.length, iface.isCompletionEnabled = !1;\n var length = 0;\n for (var character of new SafeStringIterator(string)) {\n if (length += character.length, length === string.length)\n iface.isCompletionEnabled = !0;\n try {\n if (stream[ESCAPE_DECODER].next(character), length === string.length && character === kEscape)\n timeoutId = setTimeout(triggerEscape, escapeCodeTimeout);\n } catch (err) {\n throw stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next(), err;\n }\n }\n }\n } else\n stream.removeListener(\"data\", onData), stream.on(\"newListener\", onNewListener);\n }\n function onNewListener(event) {\n if (event === \"keypress\")\n stream.on(\"data\", onData), stream.removeListener(\"newListener\", onNewListener);\n }\n if (stream.listenerCount(\"keypress\") > 0)\n stream.on(\"data\", onData);\n else\n stream.on(\"newListener\", onNewListener);\n}, onSelfCloseWithTerminal = function() {\n var input = this.input, output = this.output;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n if (input.removeListener(\"keypress\", this[kOnKeyPress]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnTermEnd]), output !== null && output !== void 0)\n output.removeListener(\"resize\", this[kOnResize]);\n}, onSelfCloseWithoutTerminal = function() {\n var input = this.input;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n input.removeListener(\"data\", this[kOnData]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnEnd]);\n}, onError = function(err) {\n this.emit(\"error\", err);\n}, onData = function(data) {\n debug(\"onData\"), this[kNormalWrite](data);\n}, onEnd = function() {\n if (debug(\"onEnd\"), typeof this[kLine_buffer] === \"string\" && this[kLine_buffer].length > 0)\n this.emit(\"line\", this[kLine_buffer]);\n this.close();\n}, onTermEnd = function() {\n if (debug(\"onTermEnd\"), typeof this.line === \"string\" && this.line.length > 0)\n this.emit(\"line\", this.line);\n this.close();\n}, onKeyPress = function(s, key) {\n if (this[kTtyWrite](s, key), key && key.sequence) {\n var ch = StringPrototypeCodePointAt.call(key.sequence, 0);\n if (ch >= 55296 && ch <= 57343)\n this[kRefreshLine]();\n }\n}, onResize = function() {\n this[kRefreshLine]();\n}, InterfaceConstructor = function(input, output, completer, terminal) {\n if (!(this instanceof InterfaceConstructor))\n return new InterfaceConstructor(input, output, completer, terminal);\n EventEmitter.call(this), this[kOnSelfCloseWithoutTerminal] = onSelfCloseWithoutTerminal.bind(this), this[kOnSelfCloseWithTerminal] = onSelfCloseWithTerminal.bind(this), this[kOnError] = onError.bind(this), this[kOnData] = onData.bind(this), this[kOnEnd] = onEnd.bind(this), this[kOnTermEnd] = onTermEnd.bind(this), this[kOnKeyPress] = onKeyPress.bind(this), this[kOnResize] = onResize.bind(this), this[kSawReturnAt] = 0, this.isCompletionEnabled = !0, this[kSawKeyPress] = !1, this[kPreviousKey] = null, this.escapeCodeTimeout = ESCAPE_CODE_TIMEOUT, this.tabSize = 8;\n var history, historySize, removeHistoryDuplicates = !1, crlfDelay, prompt = \"> \", signal;\n if (input\?.input) {\n output = input.output, completer = input.completer, terminal = input.terminal, history = input.history, historySize = input.historySize, signal = input.signal;\n var tabSize = input.tabSize;\n if (tabSize !== void 0)\n validateUint32(tabSize, \"tabSize\", !0), this.tabSize = tabSize;\n removeHistoryDuplicates = input.removeHistoryDuplicates;\n var inputPrompt = input.prompt;\n if (inputPrompt !== void 0)\n prompt = inputPrompt;\n var inputEscapeCodeTimeout = input.escapeCodeTimeout;\n if (inputEscapeCodeTimeout !== void 0)\n if (NumberIsFinite(inputEscapeCodeTimeout))\n this.escapeCodeTimeout = inputEscapeCodeTimeout;\n else\n throw new ERR_INVALID_ARG_VALUE(\"input.escapeCodeTimeout\", this.escapeCodeTimeout);\n if (signal)\n validateAbortSignal(signal, \"options.signal\");\n crlfDelay = input.crlfDelay, input = input.input;\n }\n if (completer !== void 0 && typeof completer !== \"function\")\n throw new ERR_INVALID_ARG_VALUE(\"completer\", completer);\n if (history === void 0)\n history = [];\n else\n validateArray(history, \"history\");\n if (historySize === void 0)\n historySize = kHistorySize;\n if (typeof historySize !== \"number\" || NumberIsNaN(historySize) || historySize < 0)\n throw new ERR_INVALID_ARG_VALUE(\"historySize\", historySize);\n if (terminal === void 0 && !(output === null || output === void 0))\n terminal = !!output.isTTY;\n if (this.line = \"\", this[kSubstringSearch] = null, this.output = output, this.input = input, this[kUndoStack] = [], this[kRedoStack] = [], this.history = history, this.historySize = historySize, this[kKillRing] = [], this[kKillRingCursor] = 0, this.removeHistoryDuplicates = !!removeHistoryDuplicates, this.crlfDelay = crlfDelay \? MathMax(kMincrlfDelay, crlfDelay) : kMincrlfDelay, this.completer = completer, this.setPrompt(prompt), this.terminal = !!terminal, this[kLineObjectStream] = void 0, input.on(\"error\", this[kOnError]), !this.terminal)\n input.on(\"data\", this[kOnData]), input.on(\"end\", this[kOnEnd]), this.once(\"close\", this[kOnSelfCloseWithoutTerminal]), this[kDecoder] = new StringDecoder(\"utf8\");\n else {\n if (emitKeypressEvents(input, this), input.on(\"keypress\", this[kOnKeyPress]), input.on(\"end\", this[kOnTermEnd]), this[kSetRawMode](!0), this.terminal = !0, this.cursor = 0, this.historyIndex = -1, output !== null && output !== void 0)\n output.on(\"resize\", this[kOnResize]);\n this.once(\"close\", this[kOnSelfCloseWithTerminal]);\n }\n if (signal) {\n var onAborted = (() => this.close()).bind(this);\n if (signal.aborted)\n process.nextTick(onAborted);\n else\n signal.addEventListener(\"abort\", onAborted, { once: !0 }), this.once(\"close\", () => signal.removeEventListener(\"abort\", onAborted));\n }\n this.line = \"\", input.resume();\n}, Interface = function(input, output, completer, terminal) {\n if (!(this instanceof Interface))\n return new Interface(input, output, completer, terminal);\n if (input\?.input && typeof input.completer === \"function\" && input.completer.length !== 2) {\n var { completer } = input;\n input.completer = (v, cb) => cb(null, completer(v));\n } else if (typeof completer === \"function\" && completer.length !== 2) {\n var realCompleter = completer;\n completer = (v, cb) => cb(null, realCompleter(v));\n }\n InterfaceConstructor.call(this, input, output, completer, terminal);\n}, createInterface = function(input, output, completer, terminal) {\n return new Interface(input, output, completer, terminal);\n};\nvar $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { StringDecoder } = @requireNativeModule(\"string_decoder\"), isWritable, { inspect } = Bun, debug = process.env.BUN_JS_DEBUG \? console.log : () => {\n}, SymbolAsyncIterator = Symbol.asyncIterator, SymbolIterator = Symbol.iterator, SymbolFor = Symbol.for, SymbolReplace = Symbol.replace, ArrayFrom = Array.from, ArrayIsArray = Array.isArray, ArrayPrototypeFilter = Array.prototype.filter, ArrayPrototypeSort = Array.prototype.sort, ArrayPrototypeIndexOf = Array.prototype.indexOf, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypePop = Array.prototype.pop, ArrayPrototypePush = Array.prototype.push, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeSplice = Array.prototype.splice, ArrayPrototypeReverse = Array.prototype.reverse, ArrayPrototypeShift = Array.prototype.shift, ArrayPrototypeUnshift = Array.prototype.unshift, RegExpPrototypeExec = RegExp.prototype.exec, RegExpPrototypeSymbolReplace = RegExp.prototype[SymbolReplace], StringFromCharCode = String.fromCharCode, StringPrototypeCharCodeAt = String.prototype.charCodeAt, StringPrototypeCodePointAt = String.prototype.codePointAt, StringPrototypeSlice = String.prototype.slice, StringPrototypeToLowerCase = String.prototype.toLowerCase, StringPrototypeEndsWith = String.prototype.endsWith, StringPrototypeRepeat = String.prototype.repeat, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeTrim = String.prototype.trim, StringPrototypeNormalize = String.prototype.normalize, NumberIsNaN = Number.isNaN, NumberIsFinite = Number.isFinite, NumberIsInteger = Number.isInteger, NumberMAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER, NumberMIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER, MathCeil = Math.ceil, MathFloor = Math.floor, MathMax = Math.max, MathMaxApply = Math.max.apply, DateNow = Date.now, FunctionPrototype = Function.prototype, StringPrototype = String.prototype, StringPrototypeSymbolIterator = StringPrototype[SymbolIterator], StringIteratorPrototypeNext = StringPrototypeSymbolIterator.call(\"\").next, ObjectSetPrototypeOf = Object.setPrototypeOf, ObjectDefineProperty = Object.defineProperty, ObjectDefineProperties = Object.defineProperties, ObjectFreeze = Object.freeze;\nvar { create: ObjectCreate, keys: ObjectKeys } = Object;\nvar createSafeIterator = (factory, next) => {\n class SafeIterator {\n #iterator;\n constructor(iterable) {\n this.#iterator = factory.call(iterable);\n }\n next() {\n return next.call(this.#iterator);\n }\n [SymbolIterator]() {\n return this;\n }\n }\n return ObjectSetPrototypeOf(SafeIterator.prototype, null), ObjectFreeze(SafeIterator.prototype), ObjectFreeze(SafeIterator), SafeIterator;\n}, SafeStringIterator = createSafeIterator(StringPrototypeSymbolIterator, StringIteratorPrototypeNext), isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n}, isZeroWidthCodePoint = (code) => {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, getStringWidth = function getStringWidth2(str, removeControlChars = !0) {\n var width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize.call(str, \"NFC\");\n for (var char of new SafeStringIterator(str)) {\n var code = StringPrototypeCodePointAt.call(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n}, ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new RegExp(ansiPattern, \"g\"), kCustomPromisifiedSymbol = SymbolFor(\"nodejs.util.promisify.custom\"), kCustomPromisifyArgsSymbol = Symbol(\"customPromisifyArgs\");\npromisify.custom = kCustomPromisifiedSymbol;\nvar kUTF16SurrogateThreshold = 65536, kEscape = \"\\x1B\", kSubstringSearch = Symbol(\"kSubstringSearch\"), kIsNodeError = Symbol(\"kIsNodeError\"), errorBases = {}, VALID_NODE_ERROR_BASES = {\n TypeError,\n RangeError,\n Error\n}, NodeError = getNodeErrorByName(\"Error\"), NodeTypeError = getNodeErrorByName(\"TypeError\"), NodeRangeError = getNodeErrorByName(\"RangeError\");\n\nclass ERR_INVALID_ARG_TYPE extends NodeTypeError {\n constructor(name, type, value) {\n super(`The \"${name}\" argument must be of type ${type}. Received type ${typeof value}`, {\n code: \"ERR_INVALID_ARG_TYPE\"\n });\n }\n}\n\nclass ERR_INVALID_ARG_VALUE extends NodeTypeError {\n constructor(name, value, reason = \"not specified\") {\n super(`The value \"${String(value)}\" is invalid for argument '${name}'. Reason: ${reason}`, {\n code: \"ERR_INVALID_ARG_VALUE\"\n });\n }\n}\n\nclass ERR_INVALID_CURSOR_POS extends NodeTypeError {\n constructor() {\n super(\"Cannot set cursor row without setting its column\", {\n code: \"ERR_INVALID_CURSOR_POS\"\n });\n }\n}\n\nclass ERR_OUT_OF_RANGE extends NodeRangeError {\n constructor(name, range, received) {\n super(`The value of \"${name}\" is out of range. It must be ${range}. Received ${received}`, {\n code: \"ERR_OUT_OF_RANGE\"\n });\n }\n}\n\nclass ERR_USE_AFTER_CLOSE extends NodeError {\n constructor() {\n super(\"This socket has been ended by the other party\", {\n code: \"ERR_USE_AFTER_CLOSE\"\n });\n }\n}\n\nclass AbortError extends Error {\n code;\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\nvar kClearLine, kClearScreenDown, kClearToLineBeginning, kClearToLineEnd;\nCSI.kEscape = kEscape;\nCSI.kClearLine = kClearLine = CSI`2K`;\nCSI.kClearScreenDown = kClearScreenDown = CSI`0J`;\nCSI.kClearToLineBeginning = kClearToLineBeginning = CSI`1K`;\nCSI.kClearToLineEnd = kClearToLineEnd = CSI`0K`;\nvar KEYPRESS_DECODER = Symbol(\"keypress-decoder\"), ESCAPE_DECODER = Symbol(\"escape-decoder\"), ESCAPE_CODE_TIMEOUT = 500, kEmptyObject = ObjectFreeze(ObjectCreate(null)), kHistorySize = 30, kMaxUndoRedoStackSize = 2048, kMincrlfDelay = 100, lineEnding = /\\r\?\\n|\\r(\?!\\n)/g, kMaxLengthOfKillRing = 32, kLineObjectStream = Symbol(\"line object stream\"), kQuestionCancel = Symbol(\"kQuestionCancel\"), kQuestion = Symbol(\"kQuestion\"), kAddHistory = Symbol(\"_addHistory\"), kBeforeEdit = Symbol(\"_beforeEdit\"), kDecoder = Symbol(\"_decoder\"), kDeleteLeft = Symbol(\"_deleteLeft\"), kDeleteLineLeft = Symbol(\"_deleteLineLeft\"), kDeleteLineRight = Symbol(\"_deleteLineRight\"), kDeleteRight = Symbol(\"_deleteRight\"), kDeleteWordLeft = Symbol(\"_deleteWordLeft\"), kDeleteWordRight = Symbol(\"_deleteWordRight\"), kGetDisplayPos = Symbol(\"_getDisplayPos\"), kHistoryNext = Symbol(\"_historyNext\"), kHistoryPrev = Symbol(\"_historyPrev\"), kInsertString = Symbol(\"_insertString\"), kLine = Symbol(\"_line\"), kLine_buffer = Symbol(\"_line_buffer\"), kKillRing = Symbol(\"_killRing\"), kKillRingCursor = Symbol(\"_killRingCursor\"), kMoveCursor = Symbol(\"_moveCursor\"), kNormalWrite = Symbol(\"_normalWrite\"), kOldPrompt = Symbol(\"_oldPrompt\"), kOnLine = Symbol(\"_onLine\"), kPreviousKey = Symbol(\"_previousKey\"), kPrompt = Symbol(\"_prompt\"), kPushToKillRing = Symbol(\"_pushToKillRing\"), kPushToUndoStack = Symbol(\"_pushToUndoStack\"), kQuestionCallback = Symbol(\"_questionCallback\"), kRedo = Symbol(\"_redo\"), kRedoStack = Symbol(\"_redoStack\"), kRefreshLine = Symbol(\"_refreshLine\"), kSawKeyPress = Symbol(\"_sawKeyPress\"), kSawReturnAt = Symbol(\"_sawReturnAt\"), kSetRawMode = Symbol(\"_setRawMode\"), kTabComplete = Symbol(\"_tabComplete\"), kTabCompleter = Symbol(\"_tabCompleter\"), kTtyWrite = Symbol(\"_ttyWrite\"), kUndo = Symbol(\"_undo\"), kUndoStack = Symbol(\"_undoStack\"), kWordLeft = Symbol(\"_wordLeft\"), kWordRight = Symbol(\"_wordRight\"), kWriteToOutput = Symbol(\"_writeToOutput\"), kYank = Symbol(\"_yank\"), kYanking = Symbol(\"_yanking\"), kYankPop = Symbol(\"_yankPop\"), kFirstEventParam = Symbol(\"nodejs.kFirstEventParam\"), kOnSelfCloseWithTerminal = Symbol(\"_onSelfCloseWithTerminal\"), kOnSelfCloseWithoutTerminal = Symbol(\"_onSelfCloseWithoutTerminal\"), kOnKeyPress = Symbol(\"_onKeyPress\"), kOnError = Symbol(\"_onError\"), kOnData = Symbol(\"_onData\"), kOnEnd = Symbol(\"_onEnd\"), kOnTermEnd = Symbol(\"_onTermEnd\"), kOnResize = Symbol(\"_onResize\");\nInterfaceConstructor.prototype = {};\nObjectSetPrototypeOf(InterfaceConstructor.prototype, EventEmitter.prototype);\nvar _Interface = class Interface2 extends InterfaceConstructor {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n get columns() {\n var output = this.output;\n if (output && output.columns)\n return output.columns;\n return Infinity;\n }\n setPrompt(prompt) {\n this[kPrompt] = prompt;\n }\n getPrompt() {\n return this[kPrompt];\n }\n [kSetRawMode](flag) {\n const mode = flag + 0, wasInRawMode = this.input.isRaw;\n var setRawMode = this.input.setRawMode;\n if (typeof setRawMode === \"function\")\n setRawMode.call(this.input, mode);\n return wasInRawMode;\n }\n prompt(preserveCursor) {\n if (this.paused)\n this.resume();\n if (this.terminal) {\n if (!preserveCursor)\n this.cursor = 0;\n this[kRefreshLine]();\n } else\n this[kWriteToOutput](this[kPrompt]);\n }\n [kQuestion](query, cb) {\n if (this.closed)\n throw new ERR_USE_AFTER_CLOSE(\"readline\");\n if (this[kQuestionCallback])\n this.prompt();\n else\n this[kOldPrompt] = this[kPrompt], this.setPrompt(query), this[kQuestionCallback] = cb, this.prompt();\n }\n [kOnLine](line) {\n if (this[kQuestionCallback]) {\n var cb = this[kQuestionCallback];\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), cb(line);\n } else\n this.emit(\"line\", line);\n }\n [kBeforeEdit](oldText, oldCursor) {\n this[kPushToUndoStack](oldText, oldCursor);\n }\n [kQuestionCancel]() {\n if (this[kQuestionCallback])\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), this.clearLine();\n }\n [kWriteToOutput](stringToWrite) {\n if (validateString(stringToWrite, \"stringToWrite\"), this.output !== null && this.output !== void 0)\n this.output.write(stringToWrite);\n }\n [kAddHistory]() {\n if (this.line.length === 0)\n return \"\";\n if (this.historySize === 0)\n return this.line;\n if (StringPrototypeTrim.call(this.line).length === 0)\n return this.line;\n if (this.history.length === 0 || this.history[0] !== this.line) {\n if (this.removeHistoryDuplicates) {\n var dupIndex = ArrayPrototypeIndexOf.call(this.history, this.line);\n if (dupIndex !== -1)\n ArrayPrototypeSplice.call(this.history, dupIndex, 1);\n }\n if (ArrayPrototypeUnshift.call(this.history, this.line), this.history.length > this.historySize)\n ArrayPrototypePop.call(this.history);\n }\n this.historyIndex = -1;\n var line = this.history[0];\n return this.emit(\"history\", this.history), line;\n }\n [kRefreshLine]() {\n var line = this[kPrompt] + this.line, dispPos = this[kGetDisplayPos](line), lineCols = dispPos.cols, lineRows = dispPos.rows, cursorPos = this.getCursorPos(), prevRows = this.prevRows || 0;\n if (prevRows > 0)\n moveCursor(this.output, 0, -prevRows);\n if (cursorTo(this.output, 0), clearScreenDown(this.output), this[kWriteToOutput](line), lineCols === 0)\n this[kWriteToOutput](\" \");\n cursorTo(this.output, cursorPos.cols);\n var diff = lineRows - cursorPos.rows;\n if (diff > 0)\n moveCursor(this.output, 0, -diff);\n this.prevRows = cursorPos.rows;\n }\n close() {\n if (this.closed)\n return;\n if (this.pause(), this.terminal)\n this[kSetRawMode](!1);\n this.closed = !0, this.emit(\"close\");\n }\n pause() {\n if (this.paused)\n return;\n return this.input.pause(), this.paused = !0, this.emit(\"pause\"), this;\n }\n resume() {\n if (!this.paused)\n return;\n return this.input.resume(), this.paused = !1, this.emit(\"resume\"), this;\n }\n write(d, key) {\n if (this.paused)\n this.resume();\n if (this.terminal)\n this[kTtyWrite](d, key);\n else\n this[kNormalWrite](d);\n }\n [kNormalWrite](b) {\n if (b === void 0)\n return;\n var string = this[kDecoder].write(b);\n if (this[kSawReturnAt] && DateNow() - this[kSawReturnAt] <= this.crlfDelay) {\n if (StringPrototypeCodePointAt.call(string) === 10)\n string = StringPrototypeSlice.call(string, 1);\n this[kSawReturnAt] = 0;\n }\n var newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n if (newPartContainsEnding !== null) {\n if (this[kLine_buffer])\n string = this[kLine_buffer] + string, this[kLine_buffer] = null, newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n this[kSawReturnAt] = StringPrototypeEndsWith.call(string, \"\\r\") \? DateNow() : 0;\n var indexes = [0, newPartContainsEnding.index, lineEnding.lastIndex], nextMatch;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, string)) !== null)\n ArrayPrototypePush.call(indexes, nextMatch.index, lineEnding.lastIndex);\n var lastIndex = indexes.length - 1;\n this[kLine_buffer] = StringPrototypeSlice.call(string, indexes[lastIndex]);\n for (var i = 1;i < lastIndex; i += 2)\n this[kOnLine](StringPrototypeSlice.call(string, indexes[i - 1], indexes[i]));\n } else if (string)\n if (this[kLine_buffer])\n this[kLine_buffer] += string;\n else\n this[kLine_buffer] = string;\n }\n [kInsertString](c) {\n if (this[kBeforeEdit](this.line, this.cursor), this.cursor < this.line.length) {\n var beg = StringPrototypeSlice.call(this.line, 0, this.cursor), end = StringPrototypeSlice.call(this.line, this.cursor, this.line.length);\n this.line = beg + c + end, this.cursor += c.length, this[kRefreshLine]();\n } else {\n var oldPos = this.getCursorPos();\n this.line += c, this.cursor += c.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows < newPos.rows)\n this[kRefreshLine]();\n else\n this[kWriteToOutput](c);\n }\n }\n async[kTabComplete](lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor), value;\n try {\n value = await this.completer(string);\n } catch (err) {\n this[kWriteToOutput](`Tab completion error: ${inspect(err)}`);\n return;\n } finally {\n this.resume();\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n }\n [kTabCompleter](lastKeypressWasTab, { 0: completions, 1: completeOn }) {\n if (!completions || completions.length === 0)\n return;\n var prefix = commonPrefix(ArrayPrototypeFilter.call(completions, (e) => e !== \"\"));\n if (StringPrototypeStartsWith.call(prefix, completeOn) && prefix.length > completeOn.length) {\n this[kInsertString](StringPrototypeSlice.call(prefix, completeOn.length));\n return;\n } else if (!StringPrototypeStartsWith.call(completeOn, prefix)) {\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - completeOn.length) + prefix + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = this.cursor - completeOn.length + prefix.length, this._refreshLine();\n return;\n }\n if (!lastKeypressWasTab)\n return;\n this[kBeforeEdit](this.line, this.cursor);\n var completionsWidth = ArrayPrototypeMap.call(completions, (e) => getStringWidth(e)), width = MathMaxApply(completionsWidth) + 2, maxColumns = MathFloor(this.columns / width) || 1;\n if (maxColumns === Infinity)\n maxColumns = 1;\n var output = \"\\r\\n\", lineIndex = 0, whitespace = 0;\n for (var i = 0;i < completions.length; i++) {\n var completion = completions[i];\n if (completion === \"\" || lineIndex === maxColumns)\n output += \"\\r\\n\", lineIndex = 0, whitespace = 0;\n else\n output += StringPrototypeRepeat.call(\" \", whitespace);\n if (completion !== \"\")\n output += completion, whitespace = width - completionsWidth[i], lineIndex++;\n else\n output += \"\\r\\n\";\n }\n if (lineIndex !== 0)\n output += \"\\r\\n\\r\\n\";\n this[kWriteToOutput](output), this[kRefreshLine]();\n }\n [kWordLeft]() {\n if (this.cursor > 0) {\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n this[kMoveCursor](-match[0].length);\n }\n }\n [kWordRight]() {\n if (this.cursor < this.line.length) {\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|[^\\w\\s]+|\\w+)\\s*/, trailing);\n this[kMoveCursor](match[0].length);\n }\n }\n [kDeleteLeft]() {\n if (this.cursor > 0 && this.line.length > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthLeft(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - charSize) + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor -= charSize, this[kRefreshLine]();\n }\n }\n [kDeleteRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthAt(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(this.line, this.cursor + charSize, this.line.length), this[kRefreshLine]();\n }\n }\n [kDeleteWordLeft]() {\n if (this.cursor > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n leading = StringPrototypeSlice.call(leading, 0, leading.length - match[0].length), this.line = leading + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = leading.length, this[kRefreshLine]();\n }\n }\n [kDeleteWordRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|\\W+|\\w+)\\s*/, trailing);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(trailing, match[0].length), this[kRefreshLine]();\n }\n }\n [kDeleteLineLeft]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, this.cursor), this.cursor = 0, this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kDeleteLineRight]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor), this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kPushToKillRing](del) {\n if (!del || del === this[kKillRing][0])\n return;\n ArrayPrototypeUnshift.call(this[kKillRing], del), this[kKillRingCursor] = 0;\n while (this[kKillRing].length > kMaxLengthOfKillRing)\n ArrayPrototypePop.call(this[kKillRing]);\n }\n [kYank]() {\n if (this[kKillRing].length > 0)\n this[kYanking] = !0, this[kInsertString](this[kKillRing][this[kKillRingCursor]]);\n }\n [kYankPop]() {\n if (!this[kYanking])\n return;\n if (this[kKillRing].length > 1) {\n var lastYank = this[kKillRing][this[kKillRingCursor]];\n if (this[kKillRingCursor]++, this[kKillRingCursor] >= this[kKillRing].length)\n this[kKillRingCursor] = 0;\n var currentYank = this[kKillRing][this[kKillRingCursor]], head = StringPrototypeSlice.call(this.line, 0, this.cursor - lastYank.length), tail = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = head + currentYank + tail, this.cursor = head.length + currentYank.length, this[kRefreshLine]();\n }\n }\n clearLine() {\n this[kMoveCursor](Infinity), this[kWriteToOutput](\"\\r\\n\"), this.line = \"\", this.cursor = 0, this.prevRows = 0;\n }\n [kLine]() {\n var line = this[kAddHistory]();\n this[kUndoStack] = [], this[kRedoStack] = [], this.clearLine(), this[kOnLine](line);\n }\n [kPushToUndoStack](text, cursor) {\n if (ArrayPrototypePush.call(this[kUndoStack], { text, cursor }) > kMaxUndoRedoStackSize)\n ArrayPrototypeShift.call(this[kUndoStack]);\n }\n [kUndo]() {\n if (this[kUndoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kRedoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kUndoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kRedo]() {\n if (this[kRedoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kUndoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kRedoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kHistoryNext]() {\n if (this.historyIndex >= 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex - 1;\n while (index >= 0 && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index--;\n if (index === -1)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kHistoryPrev]() {\n if (this.historyIndex < this.history.length && this.history.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex + 1;\n while (index < this.history.length && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index++;\n if (index === this.history.length)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kGetDisplayPos](str) {\n var offset = 0, col = this.columns, rows = 0;\n str = stripVTControlCharacters(str);\n for (var char of new SafeStringIterator(str)) {\n if (char === \"\\n\") {\n rows += MathCeil(offset / col) || 1, offset = 0;\n continue;\n }\n if (char === \"\\t\") {\n offset += this.tabSize - offset % this.tabSize;\n continue;\n }\n var width = getStringWidth(char, !1);\n if (width === 0 || width === 1)\n offset += width;\n else {\n if ((offset + 1) % col === 0)\n offset++;\n offset += 2;\n }\n }\n var cols = offset % col;\n return rows += (offset - cols) / col, { cols, rows };\n }\n getCursorPos() {\n var strBeforeCursor = this[kPrompt] + StringPrototypeSlice.call(this.line, 0, this.cursor);\n return this[kGetDisplayPos](strBeforeCursor);\n }\n [kMoveCursor](dx) {\n if (dx === 0)\n return;\n var oldPos = this.getCursorPos();\n if (this.cursor += dx, this.cursor < 0)\n this.cursor = 0;\n else if (this.cursor > this.line.length)\n this.cursor = this.line.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows === newPos.rows) {\n var diffWidth = newPos.cols - oldPos.cols;\n moveCursor(this.output, diffWidth, 0);\n } else\n this[kRefreshLine]();\n }\n [kTtyWrite](s, key) {\n var previousKey = this[kPreviousKey];\n key = key || kEmptyObject, this[kPreviousKey] = key;\n var { name: keyName, meta: keyMeta, ctrl: keyCtrl2, shift: keyShift, sequence: keySeq } = key;\n if (!keyMeta || keyName !== \"y\")\n this[kYanking] = !1;\n if ((keyName === \"up\" || keyName === \"down\") && !keyCtrl2 && !keyMeta && !keyShift) {\n if (this[kSubstringSearch] === null)\n this[kSubstringSearch] = StringPrototypeSlice.call(this.line, 0, this.cursor);\n } else if (this[kSubstringSearch] !== null) {\n if (this[kSubstringSearch] = null, this.history.length === this.historyIndex)\n this.historyIndex = -1;\n }\n if (typeof keySeq === \"string\")\n switch (StringPrototypeCodePointAt.call(keySeq, 0)) {\n case 31:\n this[kUndo]();\n return;\n case 30:\n this[kRedo]();\n return;\n default:\n break;\n }\n if (keyName === \"escape\")\n return;\n if (keyCtrl2 && keyShift)\n switch (keyName) {\n case \"backspace\":\n this[kDeleteLineLeft]();\n break;\n case \"delete\":\n this[kDeleteLineRight]();\n break;\n }\n else if (keyCtrl2)\n switch (keyName) {\n case \"c\":\n if (this.listenerCount(\"SIGINT\") > 0)\n this.emit(\"SIGINT\");\n else\n this.close();\n break;\n case \"h\":\n this[kDeleteLeft]();\n break;\n case \"d\":\n if (this.cursor === 0 && this.line.length === 0)\n this.close();\n else if (this.cursor < this.line.length)\n this[kDeleteRight]();\n break;\n case \"u\":\n this[kDeleteLineLeft]();\n break;\n case \"k\":\n this[kDeleteLineRight]();\n break;\n case \"a\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"e\":\n this[kMoveCursor](Infinity);\n break;\n case \"b\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"f\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"l\":\n cursorTo(this.output, 0, 0), clearScreenDown(this.output), this[kRefreshLine]();\n break;\n case \"n\":\n this[kHistoryNext]();\n break;\n case \"p\":\n this[kHistoryPrev]();\n break;\n case \"y\":\n this[kYank]();\n break;\n case \"z\":\n if (this.listenerCount(\"SIGTSTP\") > 0)\n this.emit(\"SIGTSTP\");\n else\n process.once(\"SIGCONT\", () => {\n if (!this.paused)\n this.pause(), this.emit(\"SIGCONT\");\n this[kSetRawMode](!0), this[kRefreshLine]();\n }), this[kSetRawMode](!1), process.kill(process.pid, \"SIGTSTP\");\n break;\n case \"w\":\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"left\":\n this[kWordLeft]();\n break;\n case \"right\":\n this[kWordRight]();\n break;\n }\n else if (keyMeta)\n switch (keyName) {\n case \"b\":\n this[kWordLeft]();\n break;\n case \"f\":\n this[kWordRight]();\n break;\n case \"d\":\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"y\":\n this[kYankPop]();\n break;\n }\n else {\n if (this[kSawReturnAt] && keyName !== \"enter\")\n this[kSawReturnAt] = 0;\n switch (keyName) {\n case \"return\":\n this[kSawReturnAt] = DateNow(), this[kLine]();\n break;\n case \"enter\":\n if (this[kSawReturnAt] === 0 || DateNow() - this[kSawReturnAt] > this.crlfDelay)\n this[kLine]();\n this[kSawReturnAt] = 0;\n break;\n case \"backspace\":\n this[kDeleteLeft]();\n break;\n case \"delete\":\n this[kDeleteRight]();\n break;\n case \"left\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"right\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"home\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"end\":\n this[kMoveCursor](Infinity);\n break;\n case \"up\":\n this[kHistoryPrev]();\n break;\n case \"down\":\n this[kHistoryNext]();\n break;\n case \"tab\":\n if (typeof this.completer === \"function\" && this.isCompletionEnabled) {\n var lastKeypressWasTab = previousKey && previousKey.name === \"tab\";\n this[kTabComplete](lastKeypressWasTab);\n break;\n }\n default:\n if (typeof s === \"string\" && s) {\n var nextMatch = RegExpPrototypeExec.call(lineEnding, s);\n if (nextMatch !== null) {\n this[kInsertString](StringPrototypeSlice.call(s, 0, nextMatch.index));\n var { lastIndex } = lineEnding;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, s)) !== null)\n this[kLine](), this[kInsertString](StringPrototypeSlice.call(s, lastIndex, nextMatch.index)), { lastIndex } = lineEnding;\n if (lastIndex === s.length)\n this[kLine]();\n } else\n this[kInsertString](s);\n }\n }\n }\n }\n [SymbolAsyncIterator]() {\n if (this[kLineObjectStream] === void 0)\n this[kLineObjectStream] = EventEmitter.on(this, \"line\", {\n close: [\"close\"],\n highWatermark: 1024,\n [kFirstEventParam]: !0\n });\n return this[kLineObjectStream];\n }\n};\nInterface.prototype = {};\nObjectSetPrototypeOf(Interface.prototype, _Interface.prototype);\nObjectSetPrototypeOf(Interface, _Interface);\nInterface.prototype.question = function question(query, options, cb) {\n if (cb = typeof options === \"function\" \? options : cb, options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return;\n var onAbort = () => {\n this[kQuestionCancel]();\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 });\n var cleanup = () => {\n signal.removeEventListener(\"abort\", onAbort);\n }, originalCb = cb;\n cb = typeof cb === \"function\" \? (answer) => {\n return cleanup(), originalCb(answer);\n } : cleanup;\n }\n if (typeof cb === \"function\")\n this[kQuestion](query, cb);\n};\nInterface.prototype.question[promisify.custom] = function question2(query, options) {\n if (options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal && signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (signal) {\n var onAbort = () => {\n reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this.question(query, options, cb);\n });\n};\nObjectDefineProperties(Interface.prototype, {\n [kSetRawMode]: {\n __proto__: null,\n get() {\n return this._setRawMode;\n }\n },\n [kOnLine]: {\n __proto__: null,\n get() {\n return this._onLine;\n }\n },\n [kWriteToOutput]: {\n __proto__: null,\n get() {\n return this._writeToOutput;\n }\n },\n [kAddHistory]: {\n __proto__: null,\n get() {\n return this._addHistory;\n }\n },\n [kRefreshLine]: {\n __proto__: null,\n get() {\n return this._refreshLine;\n }\n },\n [kNormalWrite]: {\n __proto__: null,\n get() {\n return this._normalWrite;\n }\n },\n [kInsertString]: {\n __proto__: null,\n get() {\n return this._insertString;\n }\n },\n [kTabComplete]: {\n __proto__: null,\n get() {\n return this._tabComplete;\n }\n },\n [kWordLeft]: {\n __proto__: null,\n get() {\n return this._wordLeft;\n }\n },\n [kWordRight]: {\n __proto__: null,\n get() {\n return this._wordRight;\n }\n },\n [kDeleteLeft]: {\n __proto__: null,\n get() {\n return this._deleteLeft;\n }\n },\n [kDeleteRight]: {\n __proto__: null,\n get() {\n return this._deleteRight;\n }\n },\n [kDeleteWordLeft]: {\n __proto__: null,\n get() {\n return this._deleteWordLeft;\n }\n },\n [kDeleteWordRight]: {\n __proto__: null,\n get() {\n return this._deleteWordRight;\n }\n },\n [kDeleteLineLeft]: {\n __proto__: null,\n get() {\n return this._deleteLineLeft;\n }\n },\n [kDeleteLineRight]: {\n __proto__: null,\n get() {\n return this._deleteLineRight;\n }\n },\n [kLine]: {\n __proto__: null,\n get() {\n return this._line;\n }\n },\n [kHistoryNext]: {\n __proto__: null,\n get() {\n return this._historyNext;\n }\n },\n [kHistoryPrev]: {\n __proto__: null,\n get() {\n return this._historyPrev;\n }\n },\n [kGetDisplayPos]: {\n __proto__: null,\n get() {\n return this._getDisplayPos;\n }\n },\n [kMoveCursor]: {\n __proto__: null,\n get() {\n return this._moveCursor;\n }\n },\n [kTtyWrite]: {\n __proto__: null,\n get() {\n return this._ttyWrite;\n }\n },\n _decoder: {\n __proto__: null,\n get() {\n return this[kDecoder];\n },\n set(value) {\n this[kDecoder] = value;\n }\n },\n _line_buffer: {\n __proto__: null,\n get() {\n return this[kLine_buffer];\n },\n set(value) {\n this[kLine_buffer] = value;\n }\n },\n _oldPrompt: {\n __proto__: null,\n get() {\n return this[kOldPrompt];\n },\n set(value) {\n this[kOldPrompt] = value;\n }\n },\n _previousKey: {\n __proto__: null,\n get() {\n return this[kPreviousKey];\n },\n set(value) {\n this[kPreviousKey] = value;\n }\n },\n _prompt: {\n __proto__: null,\n get() {\n return this[kPrompt];\n },\n set(value) {\n this[kPrompt] = value;\n }\n },\n _questionCallback: {\n __proto__: null,\n get() {\n return this[kQuestionCallback];\n },\n set(value) {\n this[kQuestionCallback] = value;\n }\n },\n _sawKeyPress: {\n __proto__: null,\n get() {\n return this[kSawKeyPress];\n },\n set(value) {\n this[kSawKeyPress] = value;\n }\n },\n _sawReturnAt: {\n __proto__: null,\n get() {\n return this[kSawReturnAt];\n },\n set(value) {\n this[kSawReturnAt] = value;\n }\n }\n});\nInterface.prototype._setRawMode = _Interface.prototype[kSetRawMode];\nInterface.prototype._onLine = _Interface.prototype[kOnLine];\nInterface.prototype._writeToOutput = _Interface.prototype[kWriteToOutput];\nInterface.prototype._addHistory = _Interface.prototype[kAddHistory];\nInterface.prototype._refreshLine = _Interface.prototype[kRefreshLine];\nInterface.prototype._normalWrite = _Interface.prototype[kNormalWrite];\nInterface.prototype._insertString = _Interface.prototype[kInsertString];\nInterface.prototype._tabComplete = function(lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.completer(string, (err, value) => {\n if (this.resume(), err) {\n this._writeToOutput(`Tab completion error: ${inspect(err)}`);\n return;\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n });\n};\nInterface.prototype._wordLeft = _Interface.prototype[kWordLeft];\nInterface.prototype._wordRight = _Interface.prototype[kWordRight];\nInterface.prototype._deleteLeft = _Interface.prototype[kDeleteLeft];\nInterface.prototype._deleteRight = _Interface.prototype[kDeleteRight];\nInterface.prototype._deleteWordLeft = _Interface.prototype[kDeleteWordLeft];\nInterface.prototype._deleteWordRight = _Interface.prototype[kDeleteWordRight];\nInterface.prototype._deleteLineLeft = _Interface.prototype[kDeleteLineLeft];\nInterface.prototype._deleteLineRight = _Interface.prototype[kDeleteLineRight];\nInterface.prototype._line = _Interface.prototype[kLine];\nInterface.prototype._historyNext = _Interface.prototype[kHistoryNext];\nInterface.prototype._historyPrev = _Interface.prototype[kHistoryPrev];\nInterface.prototype._getDisplayPos = _Interface.prototype[kGetDisplayPos];\nInterface.prototype._getCursorPos = _Interface.prototype.getCursorPos;\nInterface.prototype._moveCursor = _Interface.prototype[kMoveCursor];\nInterface.prototype._ttyWrite = _Interface.prototype[kTtyWrite];\n\nclass Readline {\n #autoCommit = !1;\n #stream;\n #todo = [];\n constructor(stream, options = void 0) {\n if (isWritable \?\?= (@getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37)).isWritable, !isWritable(stream))\n throw new ERR_INVALID_ARG_TYPE(\"stream\", \"Writable\", stream);\n if (this.#stream = stream, options\?.autoCommit != null)\n validateBoolean(options.autoCommit, \"options.autoCommit\"), this.#autoCommit = options.autoCommit;\n }\n cursorTo(x, y = void 0) {\n if (validateInteger(x, \"x\"), y != null)\n validateInteger(y, \"y\");\n var data = y == null \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n moveCursor(dx, dy) {\n if (dx || dy) {\n validateInteger(dx, \"dx\"), validateInteger(dy, \"dy\");\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n }\n return this;\n }\n clearLine(dir) {\n validateInteger(dir, \"dir\", -1, 1);\n var data = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n clearScreenDown() {\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(kClearScreenDown));\n else\n ArrayPrototypePush.call(this.#todo, kClearScreenDown);\n return this;\n }\n commit() {\n return new Promise((resolve) => {\n this.#stream.write(ArrayPrototypeJoin.call(this.#todo, \"\"), resolve), this.#todo = [];\n });\n }\n rollback() {\n return this.#todo = [], this;\n }\n}\nvar PromisesInterface = class Interface3 extends _Interface {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n question(query, options = kEmptyObject) {\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n }\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (options\?.signal) {\n var onAbort = () => {\n this[kQuestionCancel](), reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this[kQuestion](query, cb);\n });\n }\n};\n$ = {\n Interface,\n clearLine,\n clearScreenDown,\n createInterface,\n cursorTo,\n emitKeypressEvents,\n moveCursor,\n promises: {\n Readline,\n Interface: PromisesInterface,\n createInterface(input, output, completer, terminal) {\n return new PromisesInterface(input, output, completer, terminal);\n }\n },\n [SymbolFor(\"__BUN_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__\")]: {\n CSI,\n utils: {\n getStringWidth,\n stripVTControlCharacters\n }\n }\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodePunycodeCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/punycode.ts\nvar error = function(type) {\n @throwRangeError(errors[type]);\n}, map = function(array, callback) {\n const result = [];\n let length = array.length;\n while (length--)\n result[length] = callback(array[length]);\n return result;\n}, mapDomain = function(domain, callback) {\n const parts = domain.split(\"@\");\n let result = \"\";\n if (parts.length > 1)\n result = parts[0] + \"@\", domain = parts[1];\n domain = domain.replace(regexSeparators, \".\");\n const labels = domain.split(\".\"), encoded = map(labels, callback).join(\".\");\n return result + encoded;\n}, ucs2decode = function(string) {\n const output = [];\n let counter = 0;\n const length = string.length;\n while (counter < length) {\n const value = string.charCodeAt(counter++);\n if (value >= 55296 && value <= 56319 && counter < length) {\n const extra = string.charCodeAt(counter++);\n if ((extra & 64512) == 56320)\n output.push(((value & 1023) << 10) + (extra & 1023) + 65536);\n else\n output.push(value), counter--;\n } else\n output.push(value);\n }\n return output;\n}, $, maxInt = 2147483647, base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, delimiter = \"-\", regexPunycode = /^xn--/, regexNonASCII = /[^\\0-\\x7F]/, regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, errors = {\n overflow: \"Overflow: input needs wider integers to process\",\n \"not-basic\": \"Illegal input >= 0x80 (not a basic code point)\",\n \"invalid-input\": \"Invalid input\"\n}, baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = @String.fromCharCode, ucs2encode = (codePoints) => @String.fromCodePoint(...codePoints), basicToDigit = function(codePoint) {\n if (codePoint >= 48 && codePoint < 58)\n return 26 + (codePoint - 48);\n if (codePoint >= 65 && codePoint < 91)\n return codePoint - 65;\n if (codePoint >= 97 && codePoint < 123)\n return codePoint - 97;\n return base;\n}, digitToBasic = function(digit, flag) {\n return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n}, adapt = function(delta, numPoints, firstTime) {\n let k = 0;\n delta = firstTime \? floor(delta / damp) : delta >> 1, delta += floor(delta / numPoints);\n for (;delta > baseMinusTMin * tMax >> 1; k += base)\n delta = floor(delta / baseMinusTMin);\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n}, decode = function(input) {\n const output = [], inputLength = input.length;\n let i = 0, n = initialN, bias = initialBias, basic = input.lastIndexOf(delimiter);\n if (basic < 0)\n basic = 0;\n for (let j = 0;j < basic; ++j) {\n if (input.charCodeAt(j) >= 128)\n error(\"not-basic\");\n output.push(input.charCodeAt(j));\n }\n for (let index = basic > 0 \? basic + 1 : 0;index < inputLength; ) {\n const oldi = i;\n for (let w = 1, k = base;; k += base) {\n if (index >= inputLength)\n error(\"invalid-input\");\n const digit = basicToDigit(input.charCodeAt(index++));\n if (digit >= base)\n error(\"invalid-input\");\n if (digit > floor((maxInt - i) / w))\n error(\"overflow\");\n i += digit * w;\n const t = k <= bias \? tMin : k >= bias + tMax \? tMax : k - bias;\n if (digit < t)\n break;\n const baseMinusT = base - t;\n if (w > floor(maxInt / baseMinusT))\n error(\"overflow\");\n w *= baseMinusT;\n }\n const out = output.length + 1;\n if (bias = adapt(i - oldi, out, oldi == 0), floor(i / out) > maxInt - n)\n error(\"overflow\");\n n += floor(i / out), i %= out, output.splice(i++, 0, n);\n }\n return @String.fromCodePoint(...output);\n}, encode = function(input) {\n const output = [];\n input = ucs2decode(input);\n const inputLength = input.length;\n let n = initialN, delta = 0, bias = initialBias;\n for (let currentValue of input)\n if (currentValue < 128)\n output.push(stringFromCharCode(currentValue));\n const basicLength = output.length;\n let handledCPCount = basicLength;\n if (basicLength)\n output.push(delimiter);\n while (handledCPCount < inputLength) {\n let m = maxInt;\n for (let currentValue of input)\n if (currentValue >= n && currentValue < m)\n m = currentValue;\n const handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne))\n error(\"overflow\");\n delta += (m - n) * handledCPCountPlusOne, n = m;\n for (let currentValue of input) {\n if (currentValue < n && ++delta > maxInt)\n error(\"overflow\");\n if (currentValue === n) {\n let q = delta;\n for (let k = base;; k += base) {\n const t = k <= bias \? tMin : k >= bias + tMax \? tMax : k - bias;\n if (q < t)\n break;\n const qMinusT = q - t, baseMinusT = base - t;\n output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))), q = floor(qMinusT / baseMinusT);\n }\n output.push(stringFromCharCode(digitToBasic(q, 0))), bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength), delta = 0, ++handledCPCount;\n }\n }\n ++delta, ++n;\n }\n return output.join(\"\");\n}, toUnicode = function(input) {\n return mapDomain(input, function(string) {\n return regexPunycode.test(string) \? decode(string.slice(4).toLowerCase()) : string;\n });\n}, toASCII = function(input) {\n return mapDomain(input, function(string) {\n return regexNonASCII.test(string) \? \"xn--\" + encode(string) : string;\n });\n};\n$ = {\n version: \"2.1.0\",\n ucs2: {\n decode: ucs2decode,\n encode: ucs2encode\n },\n decode,\n encode,\n toASCII,\n toUnicode\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeReadlinePromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/readline.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).promises})\n"_s;
+static constexpr ASCIILiteral NodeQuerystringCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/querystring.ts\nvar __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports), Buffer = @requireNativeModule(\"buffer\").Buffer, require_object_keys = __commonJS((exports, module) => {\n var objectKeys = Object.keys || function() {\n var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !{ toString: null }.propertyIsEnumerable(\"toString\"), dontEnums = [\n \"toString\",\n \"toLocaleString\",\n \"valueOf\",\n \"hasOwnProperty\",\n \"isPrototypeOf\",\n \"propertyIsEnumerable\",\n \"constructor\"\n ], dontEnumsLength = dontEnums.length;\n return function(obj) {\n if (typeof obj !== \"function\" && (typeof obj !== \"object\" || obj === null))\n @throwTypeError(\"Object.keys called on non-object\");\n var result = [], prop, i;\n for (prop in obj)\n if (hasOwnProperty.@call(obj, prop))\n result.push(prop);\n if (hasDontEnumBug) {\n for (i = 0;i < dontEnumsLength; i++)\n if (hasOwnProperty.@call(obj, dontEnums[i]))\n result.push(dontEnums[i]);\n }\n return result;\n };\n }();\n module.exports = objectKeys;\n}), require_src = __commonJS((exports, module) => {\n var ParsedQueryString = function() {\n }, unescapeBuffer = function(s, decodeSpaces) {\n var out = Buffer.allocUnsafe(s.length), state = 0, n, m, hexchar, c;\n for (var inIndex = 0, outIndex = 0;; inIndex++) {\n if (inIndex < s.length)\n c = s.charCodeAt(inIndex);\n else {\n if (state > 0) {\n if (out[outIndex++] = 37, state === 2)\n out[outIndex++] = hexchar;\n }\n break;\n }\n switch (state) {\n case 0:\n switch (c) {\n case 37:\n n = 0, m = 0, state = 1;\n break;\n case 43:\n if (decodeSpaces)\n c = 32;\n default:\n out[outIndex++] = c;\n break;\n }\n break;\n case 1:\n if (hexchar = c, n = unhexTable[c], !(n >= 0)) {\n out[outIndex++] = 37, out[outIndex++] = c, state = 0;\n break;\n }\n state = 2;\n break;\n case 2:\n if (state = 0, m = unhexTable[c], !(m >= 0)) {\n out[outIndex++] = 37, out[outIndex++] = hexchar, out[outIndex++] = c;\n break;\n }\n out[outIndex++] = 16 * n + m;\n break;\n }\n }\n return out.slice(0, outIndex);\n }, qsUnescape = function(s, decodeSpaces) {\n try {\n return decodeURIComponent(s);\n } catch (e) {\n return QueryString.unescapeBuffer(s, decodeSpaces).toString();\n }\n }, qsEscape = function(str) {\n if (typeof str !== \"string\")\n if (typeof str === \"object\")\n str = @String(str);\n else\n str += \"\";\n var out = \"\", lastPos = 0;\n for (var i2 = 0;i2 < str.length; ++i2) {\n var c = str.charCodeAt(i2);\n if (c < 128) {\n if (noEscape[c] === 1)\n continue;\n if (lastPos < i2)\n out += str.slice(lastPos, i2);\n lastPos = i2 + 1, out += hexTable[c];\n continue;\n }\n if (lastPos < i2)\n out += str.slice(lastPos, i2);\n if (c < 2048) {\n lastPos = i2 + 1, out += hexTable[192 | c >> 6] + hexTable[128 | c & 63];\n continue;\n }\n if (c < 55296 || c >= 57344) {\n lastPos = i2 + 1, out += hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];\n continue;\n }\n ++i2;\n var c2;\n if (i2 < str.length)\n c2 = str.charCodeAt(i2) & 1023;\n else\n throw new URIError(\"URI malformed\");\n lastPos = i2 + 1, c = 65536 + ((c & 1023) << 10 | c2), out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];\n }\n if (lastPos === 0)\n return str;\n if (lastPos < str.length)\n return out + str.slice(lastPos);\n return out;\n }, stringifyPrimitive = function(v) {\n if (typeof v === \"string\")\n return v;\n if (typeof v === \"number\" && @isFinite(v))\n return \"\" + v;\n if (typeof v === \"boolean\")\n return v \? \"true\" : \"false\";\n return \"\";\n }, stringify = function(obj, sep, eq, options) {\n sep = sep || \"&\", eq = eq || \"=\";\n var encode = QueryString.escape;\n if (options && typeof options.encodeURIComponent === \"function\")\n encode = options.encodeURIComponent;\n if (obj !== null && typeof obj === \"object\") {\n var keys = objectKeys(obj), len = keys.length, flast = len - 1, fields = \"\";\n for (var i2 = 0;i2 < len; ++i2) {\n var k = keys[i2], v = obj[k], ks = encode(stringifyPrimitive(k)) + eq;\n if (isArray(v)) {\n var vlen = v.length, vlast = vlen - 1;\n for (var j = 0;j < vlen; ++j)\n if (fields += ks + encode(stringifyPrimitive(v[j])), j < vlast)\n fields += sep;\n if (vlen && i2 < flast)\n fields += sep;\n } else if (fields += ks + encode(stringifyPrimitive(v)), i2 < flast)\n fields += sep;\n }\n return fields;\n }\n return \"\";\n }, charCodes = function(str) {\n if (str.length === 0)\n return [];\n if (str.length === 1)\n return [str.charCodeAt(0)];\n const ret = [];\n for (var i2 = 0;i2 < str.length; ++i2)\n ret[ret.length] = str.charCodeAt(i2);\n return ret;\n }, parse = function(qs, sep, eq, options) {\n const obj = new ParsedQueryString;\n if (typeof qs !== \"string\" || qs.length === 0)\n return obj;\n var sepCodes = !sep \? defSepCodes : charCodes(sep + \"\"), eqCodes = !eq \? defEqCodes : charCodes(eq + \"\");\n const sepLen = sepCodes.length, eqLen = eqCodes.length;\n var pairs = 1000;\n if (options && typeof options.maxKeys === \"number\")\n pairs = options.maxKeys > 0 \? options.maxKeys : -1;\n var decode = QueryString.unescape;\n if (options && typeof options.decodeURIComponent === \"function\")\n decode = options.decodeURIComponent;\n const customDecode = decode !== qsUnescape, keys = [];\n var posIdx = 0, lastPos = 0, sepIdx = 0, eqIdx = 0, key = \"\", value = \"\", keyEncoded = customDecode, valEncoded = customDecode, encodeCheck = 0;\n for (var i2 = 0;i2 < qs.length; ++i2) {\n const code = qs.charCodeAt(i2);\n if (code === sepCodes[sepIdx]) {\n if (++sepIdx === sepLen) {\n const end = i2 - sepIdx + 1;\n if (eqIdx < eqLen) {\n if (lastPos < end)\n key += qs.slice(lastPos, end);\n } else if (lastPos < end)\n value += qs.slice(lastPos, end);\n if (keyEncoded)\n key = decodeStr(key, decode);\n if (valEncoded)\n value = decodeStr(value, decode);\n if (key || value || lastPos - posIdx > sepLen || i2 === 0)\n if (indexOf(keys, key) === -1)\n obj[key] = value, keys[keys.length] = key;\n else {\n const curValue = obj[key] || \"\";\n if (curValue.pop)\n curValue[curValue.length] = value;\n else if (curValue)\n obj[key] = [curValue, value];\n }\n else if (i2 === 1)\n delete obj[key];\n if (--pairs === 0)\n break;\n keyEncoded = valEncoded = customDecode, encodeCheck = 0, key = value = \"\", posIdx = lastPos, lastPos = i2 + 1, sepIdx = eqIdx = 0;\n }\n continue;\n } else if (sepIdx = 0, !valEncoded)\n if (code === 37)\n encodeCheck = 1;\n else if (encodeCheck > 0 && (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {\n if (++encodeCheck === 3)\n valEncoded = !0;\n } else\n encodeCheck = 0;\n if (eqIdx < eqLen) {\n if (code === eqCodes[eqIdx]) {\n if (++eqIdx === eqLen) {\n const end = i2 - eqIdx + 1;\n if (lastPos < end)\n key += qs.slice(lastPos, end);\n encodeCheck = 0, lastPos = i2 + 1;\n }\n continue;\n } else if (eqIdx = 0, !keyEncoded)\n if (code === 37)\n encodeCheck = 1;\n else if (encodeCheck > 0 && (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {\n if (++encodeCheck === 3)\n keyEncoded = !0;\n } else\n encodeCheck = 0;\n }\n if (code === 43) {\n if (eqIdx < eqLen) {\n if (lastPos < i2)\n key += qs.slice(lastPos, i2);\n key += \"%20\", keyEncoded = !0;\n } else {\n if (lastPos < i2)\n value += qs.slice(lastPos, i2);\n value += \"%20\", valEncoded = !0;\n }\n lastPos = i2 + 1;\n }\n }\n if (pairs !== 0 && (lastPos < qs.length || eqIdx > 0)) {\n if (lastPos < qs.length) {\n if (eqIdx < eqLen)\n key += qs.slice(lastPos);\n else if (sepIdx < sepLen)\n value += qs.slice(lastPos);\n }\n if (keyEncoded)\n key = decodeStr(key, decode);\n if (valEncoded)\n value = decodeStr(value, decode);\n if (indexOf(keys, key) === -1)\n obj[key] = value, keys[keys.length] = key;\n else {\n const curValue = obj[key];\n if (curValue.pop)\n curValue[curValue.length] = value;\n else\n obj[key] = [curValue, value];\n }\n }\n return obj;\n }, decodeStr = function(s, decoder) {\n try {\n return decoder(s);\n } catch (e) {\n return QueryString.unescape(s, !0);\n }\n }, QueryString = module.exports = {\n unescapeBuffer,\n unescape: qsUnescape,\n escape: qsEscape,\n stringify,\n encode: stringify,\n parse,\n decode: parse\n }, objectKeys = require_object_keys(), isArray = (arg) => Object.prototype.toString.@call(arg) === \"[object Array]\", indexOf = (arr, searchElement, fromIndex) => {\n var k;\n if (arr == null)\n @throwTypeError('\"arr\" is null or not defined');\n var o = Object(arr), len = o.length >>> 0;\n if (len === 0)\n return -1;\n var n = fromIndex | 0;\n if (n >= len)\n return -1;\n k = Math.max(n >= 0 \? n : len - Math.abs(n), 0);\n while (k < len) {\n if ((k in o) && o[k] === searchElement)\n return k;\n k++;\n }\n return -1;\n };\n ParsedQueryString.prototype = Object.create \? Object.create(null) : {};\n var unhexTable = [\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1\n ], hexTable = [];\n for (i = 0;i < 256; ++i)\n hexTable[i] = \"%\" + ((i < 16 \? \"0\" : \"\") + i.toString(16)).toUpperCase();\n var i, noEscape = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 1,\n 0\n ], defSepCodes = [38], defEqCodes = [61];\n});\nreturn require_src()})\n");
//
//
-static constexpr ASCIILiteral NodeReplCode = "(function (){\"use strict\";// src/js/out/tmp/node/repl.ts\nvar $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5);\n$ = {\n lines: [],\n context: globalThis,\n historyIndex: -1,\n cursor: 0,\n historySize: 1000,\n removeHistoryDuplicates: !1,\n crlfDelay: 100,\n completer: () => {\n throwNotImplemented(\"node:repl\");\n },\n history: [],\n _initialPrompt: \"> \",\n terminal: !0,\n input: new Proxy({}, {\n get() {\n throwNotImplemented(\"node:repl\");\n },\n has: () => !1,\n ownKeys: () => [],\n getOwnPropertyDescriptor: () => {\n return;\n },\n set() {\n throwNotImplemented(\"node:repl\");\n }\n }),\n line: \"\",\n eval: () => {\n throwNotImplemented(\"node:repl\");\n },\n isCompletionEnabled: !0,\n escapeCodeTimeout: 500,\n tabSize: 8,\n breakEvalOnSigint: !0,\n useGlobal: !0,\n underscoreAssigned: !1,\n last: void 0,\n _domain: void 0,\n allowBlockingCompletions: !1,\n useColors: !0,\n output: new Proxy({}, {\n get() {\n throwNotImplemented(\"node:repl\");\n },\n has: () => !1,\n ownKeys: () => [],\n getOwnPropertyDescriptor: () => {\n return;\n },\n set() {\n throwNotImplemented(\"node:repl\");\n }\n }),\n _builtinLibs: [\n \"bun\",\n \"ffi\",\n \"assert\",\n \"assert/strict\",\n \"async_hooks\",\n \"buffer\",\n \"child_process\",\n \"cluster\",\n \"console\",\n \"constants\",\n \"crypto\",\n \"dgram\",\n \"diagnostics_channel\",\n \"dns\",\n \"dns/promises\",\n \"domain\",\n \"events\",\n \"fs\",\n \"fs/promises\",\n \"http\",\n \"http2\",\n \"https\",\n \"inspector\",\n \"inspector/promises\",\n \"module\",\n \"net\",\n \"os\",\n \"path\",\n \"path/posix\",\n \"path/win32\",\n \"perf_hooks\",\n \"process\",\n \"punycode\",\n \"querystring\",\n \"readline\",\n \"readline/promises\",\n \"repl\",\n \"stream\",\n \"stream/consumers\",\n \"stream/promises\",\n \"stream/web\",\n \"string_decoder\",\n \"sys\",\n \"timers\",\n \"timers/promises\",\n \"tls\",\n \"trace_events\",\n \"tty\",\n \"url\",\n \"util\",\n \"util/types\",\n \"v8\",\n \"vm\",\n \"wasi\",\n \"worker_threads\",\n \"zlib\"\n ]\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeReadlineCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/readline.ts\nvar stripVTControlCharacters = function(str) {\n return validateString(str, \"str\"), RegExpPrototypeSymbolReplace.@call(ansi, str, \"\");\n}, promisify = function(original) {\n if (validateFunction(original, \"original\"), original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n return validateFunction(fn, \"util.promisify.custom\"), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n }\n var argumentNames = original[kCustomPromisifyArgsSymbol];\n function fn(...args) {\n return new @Promise((resolve, reject) => {\n ArrayPrototypePush.@call(args, (err, ...values) => {\n if (err)\n return reject(err);\n if (argumentNames !== @undefined && values.length > 1) {\n var obj = {};\n for (var i2 = 0;i2 < argumentNames.length; i2++)\n obj[argumentNames[i2]] = values[i2];\n resolve(obj);\n } else\n resolve(values[0]);\n }), ReflectApply(original, this, args);\n });\n }\n ObjectSetPrototypeOf(fn, ObjectGetPrototypeOf(original)), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n var descriptors = ObjectGetOwnPropertyDescriptors(original), propertiesValues = ObjectValues(descriptors);\n for (var i = 0;i < propertiesValues.length; i++)\n ObjectSetPrototypeOf(propertiesValues[i], null);\n return ObjectDefineProperties(fn, descriptors);\n}, getNodeErrorByName = function(typeName) {\n var base = errorBases[typeName];\n if (base)\n return base;\n if (!ObjectKeys(VALID_NODE_ERROR_BASES).includes(typeName))\n throw new Error(\"Invalid NodeError type\");\n var Base = VALID_NODE_ERROR_BASES[typeName];\n\n class NodeError extends Base {\n [kIsNodeError] = !0;\n code;\n constructor(msg, opts) {\n super(msg, opts);\n this.code = opts\?.code || \"ERR_GENERIC\";\n }\n toString() {\n return `${this.name} [${this.code}]: ${this.message}`;\n }\n }\n return errorBases[typeName] = NodeError, NodeError;\n}, validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateAbortSignal = function(signal, name) {\n if (signal !== @undefined && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateArray = function(value, name, minLength = 0) {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n var reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar validateInteger = function(value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, validateUint32 = function(value, name, positive = !1) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n var min = positive \? 1 : 0, max = 4294967295;\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, CSI = function(strings, ...args) {\n var ret = `${kEscape}[`;\n for (var n = 0;n < strings.length; n++)\n if (ret += strings[n], n < args.length)\n ret += args[n];\n return ret;\n}, charLengthLeft = function(str, i) {\n if (i <= 0)\n return 0;\n if (i > 1 && StringPrototypeCodePointAt.@call(str, i - 2) >= kUTF16SurrogateThreshold || StringPrototypeCodePointAt.@call(str, i - 1) >= kUTF16SurrogateThreshold)\n return 2;\n return 1;\n}, charLengthAt = function(str, i) {\n if (str.length <= i)\n return 1;\n return StringPrototypeCodePointAt.@call(str, i) >= kUTF16SurrogateThreshold \? 2 : 1;\n};\nfunction* emitKeys(stream) {\n while (!0) {\n var ch = yield, s = ch, escaped = !1, keySeq = null, keyName, keyCtrl2 = !1, keyMeta = !1, keyShift = !1;\n if (ch === kEscape) {\n if (escaped = !0, s += ch = yield, ch === kEscape)\n s += ch = yield;\n }\n if (escaped && (ch === \"O\" || ch === \"[\")) {\n var code = ch, modifier = 0;\n if (ch === \"O\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n modifier = (ch >> 0) - 1, s += ch = yield;\n code += ch;\n } else if (ch === \"[\") {\n if (s += ch = yield, ch === \"[\")\n code += ch, s += ch = yield;\n var cmdStart = s.length - 1;\n if (ch >= \"0\" && ch <= \"9\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += ch = yield;\n }\n if (ch === \";\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += yield;\n }\n var cmd = StringPrototypeSlice.@call(s, cmdStart), match;\n if (match = RegExpPrototypeExec.@call(/^(\\d\\d\?)(;(\\d))\?([~^$])$/, cmd))\n code += match[1] + match[4], modifier = (match[3] || 1) - 1;\n else if (match = RegExpPrototypeExec.@call(/^((\\d;)\?(\\d))\?([A-Za-z])$/, cmd))\n code += match[4], modifier = (match[3] || 1) - 1;\n else\n code += cmd;\n }\n switch (keyCtrl2 = !!(modifier & 4), keyMeta = !!(modifier & 10), keyShift = !!(modifier & 1), code) {\n case \"[P\":\n keyName = \"f1\";\n break;\n case \"[Q\":\n keyName = \"f2\";\n break;\n case \"[R\":\n keyName = \"f3\";\n break;\n case \"[S\":\n keyName = \"f4\";\n break;\n case \"OP\":\n keyName = \"f1\";\n break;\n case \"OQ\":\n keyName = \"f2\";\n break;\n case \"OR\":\n keyName = \"f3\";\n break;\n case \"OS\":\n keyName = \"f4\";\n break;\n case \"[11~\":\n keyName = \"f1\";\n break;\n case \"[12~\":\n keyName = \"f2\";\n break;\n case \"[13~\":\n keyName = \"f3\";\n break;\n case \"[14~\":\n keyName = \"f4\";\n break;\n case \"[[A\":\n keyName = \"f1\";\n break;\n case \"[[B\":\n keyName = \"f2\";\n break;\n case \"[[C\":\n keyName = \"f3\";\n break;\n case \"[[D\":\n keyName = \"f4\";\n break;\n case \"[[E\":\n keyName = \"f5\";\n break;\n case \"[15~\":\n keyName = \"f5\";\n break;\n case \"[17~\":\n keyName = \"f6\";\n break;\n case \"[18~\":\n keyName = \"f7\";\n break;\n case \"[19~\":\n keyName = \"f8\";\n break;\n case \"[20~\":\n keyName = \"f9\";\n break;\n case \"[21~\":\n keyName = \"f10\";\n break;\n case \"[23~\":\n keyName = \"f11\";\n break;\n case \"[24~\":\n keyName = \"f12\";\n break;\n case \"[A\":\n keyName = \"up\";\n break;\n case \"[B\":\n keyName = \"down\";\n break;\n case \"[C\":\n keyName = \"right\";\n break;\n case \"[D\":\n keyName = \"left\";\n break;\n case \"[E\":\n keyName = \"clear\";\n break;\n case \"[F\":\n keyName = \"end\";\n break;\n case \"[H\":\n keyName = \"home\";\n break;\n case \"OA\":\n keyName = \"up\";\n break;\n case \"OB\":\n keyName = \"down\";\n break;\n case \"OC\":\n keyName = \"right\";\n break;\n case \"OD\":\n keyName = \"left\";\n break;\n case \"OE\":\n keyName = \"clear\";\n break;\n case \"OF\":\n keyName = \"end\";\n break;\n case \"OH\":\n keyName = \"home\";\n break;\n case \"[1~\":\n keyName = \"home\";\n break;\n case \"[2~\":\n keyName = \"insert\";\n break;\n case \"[3~\":\n keyName = \"delete\";\n break;\n case \"[4~\":\n keyName = \"end\";\n break;\n case \"[5~\":\n keyName = \"pageup\";\n break;\n case \"[6~\":\n keyName = \"pagedown\";\n break;\n case \"[[5~\":\n keyName = \"pageup\";\n break;\n case \"[[6~\":\n keyName = \"pagedown\";\n break;\n case \"[7~\":\n keyName = \"home\";\n break;\n case \"[8~\":\n keyName = \"end\";\n break;\n case \"[a\":\n keyName = \"up\", keyShift = !0;\n break;\n case \"[b\":\n keyName = \"down\", keyShift = !0;\n break;\n case \"[c\":\n keyName = \"right\", keyShift = !0;\n break;\n case \"[d\":\n keyName = \"left\", keyShift = !0;\n break;\n case \"[e\":\n keyName = \"clear\", keyShift = !0;\n break;\n case \"[2$\":\n keyName = \"insert\", keyShift = !0;\n break;\n case \"[3$\":\n keyName = \"delete\", keyShift = !0;\n break;\n case \"[5$\":\n keyName = \"pageup\", keyShift = !0;\n break;\n case \"[6$\":\n keyName = \"pagedown\", keyShift = !0;\n break;\n case \"[7$\":\n keyName = \"home\", keyShift = !0;\n break;\n case \"[8$\":\n keyName = \"end\", keyShift = !0;\n break;\n case \"Oa\":\n keyName = \"up\", keyCtrl2 = !0;\n break;\n case \"Ob\":\n keyName = \"down\", keyCtrl2 = !0;\n break;\n case \"Oc\":\n keyName = \"right\", keyCtrl2 = !0;\n break;\n case \"Od\":\n keyName = \"left\", keyCtrl2 = !0;\n break;\n case \"Oe\":\n keyName = \"clear\", keyCtrl2 = !0;\n break;\n case \"[2^\":\n keyName = \"insert\", keyCtrl2 = !0;\n break;\n case \"[3^\":\n keyName = \"delete\", keyCtrl2 = !0;\n break;\n case \"[5^\":\n keyName = \"pageup\", keyCtrl2 = !0;\n break;\n case \"[6^\":\n keyName = \"pagedown\", keyCtrl2 = !0;\n break;\n case \"[7^\":\n keyName = \"home\", keyCtrl2 = !0;\n break;\n case \"[8^\":\n keyName = \"end\", keyCtrl2 = !0;\n break;\n case \"[Z\":\n keyName = \"tab\", keyShift = !0;\n break;\n default:\n keyName = \"undefined\";\n break;\n }\n } else if (ch === \"\\r\")\n keyName = \"return\", keyMeta = escaped;\n else if (ch === \"\\n\")\n keyName = \"enter\", keyMeta = escaped;\n else if (ch === \"\\t\")\n keyName = \"tab\", keyMeta = escaped;\n else if (ch === \"\\b\" || ch === \"\\x7F\")\n keyName = \"backspace\", keyMeta = escaped;\n else if (ch === kEscape)\n keyName = \"escape\", keyMeta = escaped;\n else if (ch === \" \")\n keyName = \"space\", keyMeta = escaped;\n else if (!escaped && ch <= \"\\x1A\")\n keyName = StringFromCharCode(StringPrototypeCharCodeAt.@call(ch) + StringPrototypeCharCodeAt.@call(\"a\") - 1), keyCtrl2 = !0;\n else if (RegExpPrototypeExec.@call(/^[0-9A-Za-z]$/, ch) !== null)\n keyName = StringPrototypeToLowerCase.@call(ch), keyShift = RegExpPrototypeExec.@call(/^[A-Z]$/, ch) !== null, keyMeta = escaped;\n else if (escaped)\n keyName = ch.length \? @undefined : \"escape\", keyMeta = !0;\n else\n keyName = @undefined;\n if (keySeq = s, s.length !== 0 && (keyName !== @undefined || escaped))\n stream.emit(\"keypress\", escaped \? @undefined : s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n else if (charLengthAt(s, 0) === s.length)\n stream.emit(\"keypress\", s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n }\n}\nvar commonPrefix = function(strings) {\n if (strings.length === 0)\n return \"\";\n if (strings.length === 1)\n return strings[0];\n var sorted = ArrayPrototypeSort.@call(ArrayPrototypeSlice.@call(strings)), min = sorted[0], max = sorted[sorted.length - 1];\n for (var i = 0;i < min.length; i++)\n if (min[i] !== max[i])\n return StringPrototypeSlice.@call(min, 0, i);\n return min;\n}, cursorTo = function(stream, x, y, callback) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\");\n if (typeof y === \"function\")\n callback = y, y = @undefined;\n if (NumberIsNaN(x))\n throw new ERR_INVALID_ARG_VALUE(\"x\", x);\n if (NumberIsNaN(y))\n throw new ERR_INVALID_ARG_VALUE(\"y\", y);\n if (stream == null || typeof x !== \"number\" && typeof y !== \"number\") {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n if (typeof x !== \"number\")\n throw new ERR_INVALID_CURSOR_POS;\n var data = typeof y !== \"number\" \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n return stream.write(data, callback);\n}, moveCursor = function(stream, dx, dy, callback) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\");\n if (stream == null || !(dx || dy)) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n return stream.write(data, callback);\n}, clearLine = function(stream, dir, callback) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === @undefined) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var type = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n return stream.write(type, callback);\n}, clearScreenDown = function(stream, callback) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === @undefined) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n return stream.write(kClearScreenDown, callback);\n}, emitKeypressEvents = function(stream, iface = {}) {\n if (stream[KEYPRESS_DECODER])\n return;\n stream[KEYPRESS_DECODER] = new StringDecoder(\"utf8\"), stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next();\n var triggerEscape = () => stream[ESCAPE_DECODER].next(\"\"), { escapeCodeTimeout = ESCAPE_CODE_TIMEOUT } = iface, timeoutId;\n function onData(input) {\n if (stream.listenerCount(\"keypress\") > 0) {\n var string = stream[KEYPRESS_DECODER].write(input);\n if (string) {\n clearTimeout(timeoutId), iface[kSawKeyPress] = charLengthAt(string, 0) === string.length, iface.isCompletionEnabled = !1;\n var length = 0;\n for (var character of new SafeStringIterator(string)) {\n if (length += character.length, length === string.length)\n iface.isCompletionEnabled = !0;\n try {\n if (stream[ESCAPE_DECODER].next(character), length === string.length && character === kEscape)\n timeoutId = setTimeout(triggerEscape, escapeCodeTimeout);\n } catch (err) {\n throw stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next(), err;\n }\n }\n }\n } else\n stream.removeListener(\"data\", onData), stream.on(\"newListener\", onNewListener);\n }\n function onNewListener(event) {\n if (event === \"keypress\")\n stream.on(\"data\", onData), stream.removeListener(\"newListener\", onNewListener);\n }\n if (stream.listenerCount(\"keypress\") > 0)\n stream.on(\"data\", onData);\n else\n stream.on(\"newListener\", onNewListener);\n}, onSelfCloseWithTerminal = function() {\n var input = this.input, output = this.output;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n if (input.removeListener(\"keypress\", this[kOnKeyPress]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnTermEnd]), output !== null && output !== @undefined)\n output.removeListener(\"resize\", this[kOnResize]);\n}, onSelfCloseWithoutTerminal = function() {\n var input = this.input;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n input.removeListener(\"data\", this[kOnData]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnEnd]);\n}, onError = function(err) {\n this.emit(\"error\", err);\n}, onData = function(data) {\n debug(\"onData\"), this[kNormalWrite](data);\n}, onEnd = function() {\n if (debug(\"onEnd\"), typeof this[kLine_buffer] === \"string\" && this[kLine_buffer].length > 0)\n this.emit(\"line\", this[kLine_buffer]);\n this.close();\n}, onTermEnd = function() {\n if (debug(\"onTermEnd\"), typeof this.line === \"string\" && this.line.length > 0)\n this.emit(\"line\", this.line);\n this.close();\n}, onKeyPress = function(s, key) {\n if (this[kTtyWrite](s, key), key && key.sequence) {\n var ch = StringPrototypeCodePointAt.@call(key.sequence, 0);\n if (ch >= 55296 && ch <= 57343)\n this[kRefreshLine]();\n }\n}, onResize = function() {\n this[kRefreshLine]();\n}, InterfaceConstructor = function(input, output, completer, terminal) {\n if (!(this instanceof InterfaceConstructor))\n return new InterfaceConstructor(input, output, completer, terminal);\n EventEmitter.@call(this), this[kOnSelfCloseWithoutTerminal] = onSelfCloseWithoutTerminal.bind(this), this[kOnSelfCloseWithTerminal] = onSelfCloseWithTerminal.bind(this), this[kOnError] = onError.bind(this), this[kOnData] = onData.bind(this), this[kOnEnd] = onEnd.bind(this), this[kOnTermEnd] = onTermEnd.bind(this), this[kOnKeyPress] = onKeyPress.bind(this), this[kOnResize] = onResize.bind(this), this[kSawReturnAt] = 0, this.isCompletionEnabled = !0, this[kSawKeyPress] = !1, this[kPreviousKey] = null, this.escapeCodeTimeout = ESCAPE_CODE_TIMEOUT, this.tabSize = 8;\n var history, historySize, removeHistoryDuplicates = !1, crlfDelay, prompt = \"> \", signal;\n if (input\?.input) {\n output = input.output, completer = input.completer, terminal = input.terminal, history = input.history, historySize = input.historySize, signal = input.signal;\n var tabSize = input.tabSize;\n if (tabSize !== @undefined)\n validateUint32(tabSize, \"tabSize\", !0), this.tabSize = tabSize;\n removeHistoryDuplicates = input.removeHistoryDuplicates;\n var inputPrompt = input.prompt;\n if (inputPrompt !== @undefined)\n prompt = inputPrompt;\n var inputEscapeCodeTimeout = input.escapeCodeTimeout;\n if (inputEscapeCodeTimeout !== @undefined)\n if (NumberIsFinite(inputEscapeCodeTimeout))\n this.escapeCodeTimeout = inputEscapeCodeTimeout;\n else\n throw new ERR_INVALID_ARG_VALUE(\"input.escapeCodeTimeout\", this.escapeCodeTimeout);\n if (signal)\n validateAbortSignal(signal, \"options.signal\");\n crlfDelay = input.crlfDelay, input = input.input;\n }\n if (completer !== @undefined && typeof completer !== \"function\")\n throw new ERR_INVALID_ARG_VALUE(\"completer\", completer);\n if (history === @undefined)\n history = [];\n else\n validateArray(history, \"history\");\n if (historySize === @undefined)\n historySize = kHistorySize;\n if (typeof historySize !== \"number\" || NumberIsNaN(historySize) || historySize < 0)\n throw new ERR_INVALID_ARG_VALUE(\"historySize\", historySize);\n if (terminal === @undefined && !(output === null || output === @undefined))\n terminal = !!output.isTTY;\n if (this.line = \"\", this[kSubstringSearch] = null, this.output = output, this.input = input, this[kUndoStack] = [], this[kRedoStack] = [], this.history = history, this.historySize = historySize, this[kKillRing] = [], this[kKillRingCursor] = 0, this.removeHistoryDuplicates = !!removeHistoryDuplicates, this.crlfDelay = crlfDelay \? MathMax(kMincrlfDelay, crlfDelay) : kMincrlfDelay, this.completer = completer, this.setPrompt(prompt), this.terminal = !!terminal, this[kLineObjectStream] = @undefined, input.on(\"error\", this[kOnError]), !this.terminal)\n input.on(\"data\", this[kOnData]), input.on(\"end\", this[kOnEnd]), this.once(\"close\", this[kOnSelfCloseWithoutTerminal]), this[kDecoder] = new StringDecoder(\"utf8\");\n else {\n if (emitKeypressEvents(input, this), input.on(\"keypress\", this[kOnKeyPress]), input.on(\"end\", this[kOnTermEnd]), this[kSetRawMode](!0), this.terminal = !0, this.cursor = 0, this.historyIndex = -1, output !== null && output !== @undefined)\n output.on(\"resize\", this[kOnResize]);\n this.once(\"close\", this[kOnSelfCloseWithTerminal]);\n }\n if (signal) {\n var onAborted = (() => this.close()).bind(this);\n if (signal.aborted)\n process.nextTick(onAborted);\n else\n signal.addEventListener(\"abort\", onAborted, { once: !0 }), this.once(\"close\", () => signal.removeEventListener(\"abort\", onAborted));\n }\n this.line = \"\", input.resume();\n}, Interface = function(input, output, completer, terminal) {\n if (!(this instanceof Interface))\n return new Interface(input, output, completer, terminal);\n if (input\?.input && typeof input.completer === \"function\" && input.completer.length !== 2) {\n var { completer } = input;\n input.completer = (v, cb) => cb(null, completer(v));\n } else if (typeof completer === \"function\" && completer.length !== 2) {\n var realCompleter = completer;\n completer = (v, cb) => cb(null, realCompleter(v));\n }\n InterfaceConstructor.@call(this, input, output, completer, terminal);\n}, createInterface = function(input, output, completer, terminal) {\n return new Interface(input, output, completer, terminal);\n};\nvar $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { StringDecoder } = @requireNativeModule(\"string_decoder\"), isWritable, { inspect } = Bun, debug = process.env.BUN_JS_DEBUG \? console.log : () => {\n}, SymbolAsyncIterator = Symbol.asyncIterator, SymbolIterator = Symbol.iterator, SymbolFor = Symbol.for, SymbolReplace = Symbol.replace, ArrayFrom = @Array.from, ArrayIsArray = @Array.isArray, ArrayPrototypeFilter = @Array.prototype.filter, ArrayPrototypeSort = @Array.prototype.sort, ArrayPrototypeIndexOf = @Array.prototype.indexOf, ArrayPrototypeJoin = @Array.prototype.join, ArrayPrototypeMap = @Array.prototype.map, ArrayPrototypePop = @Array.prototype.pop, ArrayPrototypePush = @Array.prototype.push, ArrayPrototypeSlice = @Array.prototype.slice, ArrayPrototypeSplice = @Array.prototype.splice, ArrayPrototypeReverse = @Array.prototype.reverse, ArrayPrototypeShift = @Array.prototype.shift, ArrayPrototypeUnshift = @Array.prototype.unshift, RegExpPrototypeExec = @RegExp.prototype.exec, RegExpPrototypeSymbolReplace = @RegExp.prototype[SymbolReplace], StringFromCharCode = @String.fromCharCode, StringPrototypeCharCodeAt = @String.prototype.charCodeAt, StringPrototypeCodePointAt = @String.prototype.codePointAt, StringPrototypeSlice = @String.prototype.slice, StringPrototypeToLowerCase = @String.prototype.toLowerCase, StringPrototypeEndsWith = @String.prototype.endsWith, StringPrototypeRepeat = @String.prototype.repeat, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeTrim = @String.prototype.trim, StringPrototypeNormalize = @String.prototype.normalize, NumberIsNaN = Number.isNaN, NumberIsFinite = Number.isFinite, NumberIsInteger = Number.isInteger, NumberMAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER, NumberMIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER, MathCeil = Math.ceil, MathFloor = Math.floor, MathMax = Math.max, DateNow = Date.now, FunctionPrototype = Function.prototype, StringPrototype = @String.prototype, StringPrototypeSymbolIterator = StringPrototype[SymbolIterator], StringIteratorPrototypeNext = StringPrototypeSymbolIterator.@call(\"\").next, ObjectSetPrototypeOf = Object.setPrototypeOf, ObjectDefineProperty = Object.defineProperty, ObjectDefineProperties = Object.defineProperties, ObjectFreeze = Object.freeze;\nvar { create: ObjectCreate, keys: ObjectKeys } = Object;\nvar createSafeIterator = (factory, next) => {\n class SafeIterator {\n #iterator;\n constructor(iterable) {\n this.#iterator = factory.@call(iterable);\n }\n next() {\n return next.@call(this.#iterator);\n }\n [SymbolIterator]() {\n return this;\n }\n }\n return ObjectSetPrototypeOf(SafeIterator.prototype, null), ObjectFreeze(SafeIterator.prototype), ObjectFreeze(SafeIterator), SafeIterator;\n}, SafeStringIterator = createSafeIterator(StringPrototypeSymbolIterator, StringIteratorPrototypeNext), isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n}, isZeroWidthCodePoint = (code) => {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, getStringWidth = function getStringWidth2(str, removeControlChars = !0) {\n var width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize.@call(str, \"NFC\");\n for (var char of new SafeStringIterator(str)) {\n var code = StringPrototypeCodePointAt.@call(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n}, ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new @RegExp(ansiPattern, \"g\"), kCustomPromisifiedSymbol = SymbolFor(\"nodejs.util.promisify.custom\"), kCustomPromisifyArgsSymbol = Symbol(\"customPromisifyArgs\");\npromisify.custom = kCustomPromisifiedSymbol;\nvar kUTF16SurrogateThreshold = 65536, kEscape = \"\\x1B\", kSubstringSearch = Symbol(\"kSubstringSearch\"), kIsNodeError = Symbol(\"kIsNodeError\"), errorBases = {}, VALID_NODE_ERROR_BASES = {\n TypeError,\n RangeError,\n Error\n}, NodeError = getNodeErrorByName(\"Error\"), NodeTypeError = getNodeErrorByName(\"TypeError\"), NodeRangeError = getNodeErrorByName(\"RangeError\");\n\nclass ERR_INVALID_ARG_TYPE extends NodeTypeError {\n constructor(name, type, value) {\n super(`The \"${name}\" argument must be of type ${type}. Received type ${typeof value}`, {\n code: \"ERR_INVALID_ARG_TYPE\"\n });\n }\n}\n\nclass ERR_INVALID_ARG_VALUE extends NodeTypeError {\n constructor(name, value, reason = \"not specified\") {\n super(`The value \"${@String(value)}\" is invalid for argument '${name}'. Reason: ${reason}`, {\n code: \"ERR_INVALID_ARG_VALUE\"\n });\n }\n}\n\nclass ERR_INVALID_CURSOR_POS extends NodeTypeError {\n constructor() {\n super(\"Cannot set cursor row without setting its column\", {\n code: \"ERR_INVALID_CURSOR_POS\"\n });\n }\n}\n\nclass ERR_OUT_OF_RANGE extends NodeRangeError {\n constructor(name, range, received) {\n super(`The value of \"${name}\" is out of range. It must be ${range}. Received ${received}`, {\n code: \"ERR_OUT_OF_RANGE\"\n });\n }\n}\n\nclass ERR_USE_AFTER_CLOSE extends NodeError {\n constructor() {\n super(\"This socket has been ended by the other party\", {\n code: \"ERR_USE_AFTER_CLOSE\"\n });\n }\n}\n\nclass AbortError extends Error {\n code;\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\nvar kClearLine, kClearScreenDown, kClearToLineBeginning, kClearToLineEnd;\nCSI.kEscape = kEscape;\nCSI.kClearLine = kClearLine = CSI`2K`;\nCSI.kClearScreenDown = kClearScreenDown = CSI`0J`;\nCSI.kClearToLineBeginning = kClearToLineBeginning = CSI`1K`;\nCSI.kClearToLineEnd = kClearToLineEnd = CSI`0K`;\nvar KEYPRESS_DECODER = Symbol(\"keypress-decoder\"), ESCAPE_DECODER = Symbol(\"escape-decoder\"), ESCAPE_CODE_TIMEOUT = 500, kEmptyObject = ObjectFreeze(ObjectCreate(null)), kHistorySize = 30, kMaxUndoRedoStackSize = 2048, kMincrlfDelay = 100, lineEnding = /\\r\?\\n|\\r(\?!\\n)/g, kMaxLengthOfKillRing = 32, kLineObjectStream = Symbol(\"line object stream\"), kQuestionCancel = Symbol(\"kQuestionCancel\"), kQuestion = Symbol(\"kQuestion\"), kAddHistory = Symbol(\"_addHistory\"), kBeforeEdit = Symbol(\"_beforeEdit\"), kDecoder = Symbol(\"_decoder\"), kDeleteLeft = Symbol(\"_deleteLeft\"), kDeleteLineLeft = Symbol(\"_deleteLineLeft\"), kDeleteLineRight = Symbol(\"_deleteLineRight\"), kDeleteRight = Symbol(\"_deleteRight\"), kDeleteWordLeft = Symbol(\"_deleteWordLeft\"), kDeleteWordRight = Symbol(\"_deleteWordRight\"), kGetDisplayPos = Symbol(\"_getDisplayPos\"), kHistoryNext = Symbol(\"_historyNext\"), kHistoryPrev = Symbol(\"_historyPrev\"), kInsertString = Symbol(\"_insertString\"), kLine = Symbol(\"_line\"), kLine_buffer = Symbol(\"_line_buffer\"), kKillRing = Symbol(\"_killRing\"), kKillRingCursor = Symbol(\"_killRingCursor\"), kMoveCursor = Symbol(\"_moveCursor\"), kNormalWrite = Symbol(\"_normalWrite\"), kOldPrompt = Symbol(\"_oldPrompt\"), kOnLine = Symbol(\"_onLine\"), kPreviousKey = Symbol(\"_previousKey\"), kPrompt = Symbol(\"_prompt\"), kPushToKillRing = Symbol(\"_pushToKillRing\"), kPushToUndoStack = Symbol(\"_pushToUndoStack\"), kQuestionCallback = Symbol(\"_questionCallback\"), kRedo = Symbol(\"_redo\"), kRedoStack = Symbol(\"_redoStack\"), kRefreshLine = Symbol(\"_refreshLine\"), kSawKeyPress = Symbol(\"_sawKeyPress\"), kSawReturnAt = Symbol(\"_sawReturnAt\"), kSetRawMode = Symbol(\"_setRawMode\"), kTabComplete = Symbol(\"_tabComplete\"), kTabCompleter = Symbol(\"_tabCompleter\"), kTtyWrite = Symbol(\"_ttyWrite\"), kUndo = Symbol(\"_undo\"), kUndoStack = Symbol(\"_undoStack\"), kWordLeft = Symbol(\"_wordLeft\"), kWordRight = Symbol(\"_wordRight\"), kWriteToOutput = Symbol(\"_writeToOutput\"), kYank = Symbol(\"_yank\"), kYanking = Symbol(\"_yanking\"), kYankPop = Symbol(\"_yankPop\"), kFirstEventParam = Symbol(\"nodejs.kFirstEventParam\"), kOnSelfCloseWithTerminal = Symbol(\"_onSelfCloseWithTerminal\"), kOnSelfCloseWithoutTerminal = Symbol(\"_onSelfCloseWithoutTerminal\"), kOnKeyPress = Symbol(\"_onKeyPress\"), kOnError = Symbol(\"_onError\"), kOnData = Symbol(\"_onData\"), kOnEnd = Symbol(\"_onEnd\"), kOnTermEnd = Symbol(\"_onTermEnd\"), kOnResize = Symbol(\"_onResize\");\nInterfaceConstructor.prototype = {};\nObjectSetPrototypeOf(InterfaceConstructor.prototype, EventEmitter.prototype);\nvar _Interface = class Interface2 extends InterfaceConstructor {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n get columns() {\n var output = this.output;\n if (output && output.columns)\n return output.columns;\n return @Infinity;\n }\n setPrompt(prompt) {\n this[kPrompt] = prompt;\n }\n getPrompt() {\n return this[kPrompt];\n }\n [kSetRawMode](flag) {\n const mode = flag + 0, wasInRawMode = this.input.isRaw;\n var setRawMode = this.input.setRawMode;\n if (typeof setRawMode === \"function\")\n setRawMode.@call(this.input, mode);\n return wasInRawMode;\n }\n prompt(preserveCursor) {\n if (this.paused)\n this.resume();\n if (this.terminal) {\n if (!preserveCursor)\n this.cursor = 0;\n this[kRefreshLine]();\n } else\n this[kWriteToOutput](this[kPrompt]);\n }\n [kQuestion](query, cb) {\n if (this.closed)\n throw new ERR_USE_AFTER_CLOSE(\"readline\");\n if (this[kQuestionCallback])\n this.prompt();\n else\n this[kOldPrompt] = this[kPrompt], this.setPrompt(query), this[kQuestionCallback] = cb, this.prompt();\n }\n [kOnLine](line) {\n if (this[kQuestionCallback]) {\n var cb = this[kQuestionCallback];\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), cb(line);\n } else\n this.emit(\"line\", line);\n }\n [kBeforeEdit](oldText, oldCursor) {\n this[kPushToUndoStack](oldText, oldCursor);\n }\n [kQuestionCancel]() {\n if (this[kQuestionCallback])\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), this.clearLine();\n }\n [kWriteToOutput](stringToWrite) {\n if (validateString(stringToWrite, \"stringToWrite\"), this.output !== null && this.output !== @undefined)\n this.output.write(stringToWrite);\n }\n [kAddHistory]() {\n if (this.line.length === 0)\n return \"\";\n if (this.historySize === 0)\n return this.line;\n if (StringPrototypeTrim.@call(this.line).length === 0)\n return this.line;\n if (this.history.length === 0 || this.history[0] !== this.line) {\n if (this.removeHistoryDuplicates) {\n var dupIndex = ArrayPrototypeIndexOf.@call(this.history, this.line);\n if (dupIndex !== -1)\n ArrayPrototypeSplice.@call(this.history, dupIndex, 1);\n }\n if (ArrayPrototypeUnshift.@call(this.history, this.line), this.history.length > this.historySize)\n ArrayPrototypePop.@call(this.history);\n }\n this.historyIndex = -1;\n var line = this.history[0];\n return this.emit(\"history\", this.history), line;\n }\n [kRefreshLine]() {\n var line = this[kPrompt] + this.line, dispPos = this[kGetDisplayPos](line), lineCols = dispPos.cols, lineRows = dispPos.rows, cursorPos = this.getCursorPos(), prevRows = this.prevRows || 0;\n if (prevRows > 0)\n moveCursor(this.output, 0, -prevRows);\n if (cursorTo(this.output, 0), clearScreenDown(this.output), this[kWriteToOutput](line), lineCols === 0)\n this[kWriteToOutput](\" \");\n cursorTo(this.output, cursorPos.cols);\n var diff = lineRows - cursorPos.rows;\n if (diff > 0)\n moveCursor(this.output, 0, -diff);\n this.prevRows = cursorPos.rows;\n }\n close() {\n if (this.closed)\n return;\n if (this.pause(), this.terminal)\n this[kSetRawMode](!1);\n this.closed = !0, this.emit(\"close\");\n }\n pause() {\n if (this.paused)\n return;\n return this.input.pause(), this.paused = !0, this.emit(\"pause\"), this;\n }\n resume() {\n if (!this.paused)\n return;\n return this.input.resume(), this.paused = !1, this.emit(\"resume\"), this;\n }\n write(d, key) {\n if (this.paused)\n this.resume();\n if (this.terminal)\n this[kTtyWrite](d, key);\n else\n this[kNormalWrite](d);\n }\n [kNormalWrite](b) {\n if (b === @undefined)\n return;\n var string = this[kDecoder].write(b);\n if (this[kSawReturnAt] && DateNow() - this[kSawReturnAt] <= this.crlfDelay) {\n if (StringPrototypeCodePointAt.@call(string) === 10)\n string = StringPrototypeSlice.@call(string, 1);\n this[kSawReturnAt] = 0;\n }\n var newPartContainsEnding = RegExpPrototypeExec.@call(lineEnding, string);\n if (newPartContainsEnding !== null) {\n if (this[kLine_buffer])\n string = this[kLine_buffer] + string, this[kLine_buffer] = null, newPartContainsEnding = RegExpPrototypeExec.@call(lineEnding, string);\n this[kSawReturnAt] = StringPrototypeEndsWith.@call(string, \"\\r\") \? DateNow() : 0;\n var indexes = [0, newPartContainsEnding.index, lineEnding.lastIndex], nextMatch;\n while ((nextMatch = RegExpPrototypeExec.@call(lineEnding, string)) !== null)\n ArrayPrototypePush.@call(indexes, nextMatch.index, lineEnding.lastIndex);\n var lastIndex = indexes.length - 1;\n this[kLine_buffer] = StringPrototypeSlice.@call(string, indexes[lastIndex]);\n for (var i = 1;i < lastIndex; i += 2)\n this[kOnLine](StringPrototypeSlice.@call(string, indexes[i - 1], indexes[i]));\n } else if (string)\n if (this[kLine_buffer])\n this[kLine_buffer] += string;\n else\n this[kLine_buffer] = string;\n }\n [kInsertString](c) {\n if (this[kBeforeEdit](this.line, this.cursor), this.cursor < this.line.length) {\n var beg = StringPrototypeSlice.@call(this.line, 0, this.cursor), end = StringPrototypeSlice.@call(this.line, this.cursor, this.line.length);\n this.line = beg + c + end, this.cursor += c.length, this[kRefreshLine]();\n } else {\n var oldPos = this.getCursorPos();\n this.line += c, this.cursor += c.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows < newPos.rows)\n this[kRefreshLine]();\n else\n this[kWriteToOutput](c);\n }\n }\n async[kTabComplete](lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.@call(this.line, 0, this.cursor), value;\n try {\n value = await this.completer(string);\n } catch (err) {\n this[kWriteToOutput](`Tab completion error: ${inspect(err)}`);\n return;\n } finally {\n this.resume();\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n }\n [kTabCompleter](lastKeypressWasTab, { 0: completions, 1: completeOn }) {\n if (!completions || completions.length === 0)\n return;\n var prefix = commonPrefix(ArrayPrototypeFilter.@call(completions, (e) => e !== \"\"));\n if (StringPrototypeStartsWith.@call(prefix, completeOn) && prefix.length > completeOn.length) {\n this[kInsertString](StringPrototypeSlice.@call(prefix, completeOn.length));\n return;\n } else if (!StringPrototypeStartsWith.@call(completeOn, prefix)) {\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor - completeOn.length) + prefix + StringPrototypeSlice.@call(this.line, this.cursor, this.line.length), this.cursor = this.cursor - completeOn.length + prefix.length, this._refreshLine();\n return;\n }\n if (!lastKeypressWasTab)\n return;\n this[kBeforeEdit](this.line, this.cursor);\n var completionsWidth = ArrayPrototypeMap.@call(completions, (e) => getStringWidth(e)), width = MathMax.@apply(completionsWidth) + 2, maxColumns = MathFloor(this.columns / width) || 1;\n if (maxColumns === @Infinity)\n maxColumns = 1;\n var output = \"\\r\\n\", lineIndex = 0, whitespace = 0;\n for (var i = 0;i < completions.length; i++) {\n var completion = completions[i];\n if (completion === \"\" || lineIndex === maxColumns)\n output += \"\\r\\n\", lineIndex = 0, whitespace = 0;\n else\n output += StringPrototypeRepeat.@call(\" \", whitespace);\n if (completion !== \"\")\n output += completion, whitespace = width - completionsWidth[i], lineIndex++;\n else\n output += \"\\r\\n\";\n }\n if (lineIndex !== 0)\n output += \"\\r\\n\\r\\n\";\n this[kWriteToOutput](output), this[kRefreshLine]();\n }\n [kWordLeft]() {\n if (this.cursor > 0) {\n var leading = StringPrototypeSlice.@call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.@call(ArrayPrototypeReverse.@call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.@call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n this[kMoveCursor](-match[0].length);\n }\n }\n [kWordRight]() {\n if (this.cursor < this.line.length) {\n var trailing = StringPrototypeSlice.@call(this.line, this.cursor), match = RegExpPrototypeExec.@call(/^(\?:\\s+|[^\\w\\s]+|\\w+)\\s*/, trailing);\n this[kMoveCursor](match[0].length);\n }\n }\n [kDeleteLeft]() {\n if (this.cursor > 0 && this.line.length > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthLeft(this.line, this.cursor);\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor - charSize) + StringPrototypeSlice.@call(this.line, this.cursor, this.line.length), this.cursor -= charSize, this[kRefreshLine]();\n }\n }\n [kDeleteRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthAt(this.line, this.cursor);\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor) + StringPrototypeSlice.@call(this.line, this.cursor + charSize, this.line.length), this[kRefreshLine]();\n }\n }\n [kDeleteWordLeft]() {\n if (this.cursor > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var leading = StringPrototypeSlice.@call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.@call(ArrayPrototypeReverse.@call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.@call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n leading = StringPrototypeSlice.@call(leading, 0, leading.length - match[0].length), this.line = leading + StringPrototypeSlice.@call(this.line, this.cursor, this.line.length), this.cursor = leading.length, this[kRefreshLine]();\n }\n }\n [kDeleteWordRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var trailing = StringPrototypeSlice.@call(this.line, this.cursor), match = RegExpPrototypeExec.@call(/^(\?:\\s+|\\W+|\\w+)\\s*/, trailing);\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor) + StringPrototypeSlice.@call(trailing, match[0].length), this[kRefreshLine]();\n }\n }\n [kDeleteLineLeft]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.@call(this.line, 0, this.cursor);\n this.line = StringPrototypeSlice.@call(this.line, this.cursor), this.cursor = 0, this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kDeleteLineRight]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.@call(this.line, this.cursor);\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor), this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kPushToKillRing](del) {\n if (!del || del === this[kKillRing][0])\n return;\n ArrayPrototypeUnshift.@call(this[kKillRing], del), this[kKillRingCursor] = 0;\n while (this[kKillRing].length > kMaxLengthOfKillRing)\n ArrayPrototypePop.@call(this[kKillRing]);\n }\n [kYank]() {\n if (this[kKillRing].length > 0)\n this[kYanking] = !0, this[kInsertString](this[kKillRing][this[kKillRingCursor]]);\n }\n [kYankPop]() {\n if (!this[kYanking])\n return;\n if (this[kKillRing].length > 1) {\n var lastYank = this[kKillRing][this[kKillRingCursor]];\n if (this[kKillRingCursor]++, this[kKillRingCursor] >= this[kKillRing].length)\n this[kKillRingCursor] = 0;\n var currentYank = this[kKillRing][this[kKillRingCursor]], head = StringPrototypeSlice.@call(this.line, 0, this.cursor - lastYank.length), tail = StringPrototypeSlice.@call(this.line, this.cursor);\n this.line = head + currentYank + tail, this.cursor = head.length + currentYank.length, this[kRefreshLine]();\n }\n }\n clearLine() {\n this[kMoveCursor](+@Infinity), this[kWriteToOutput](\"\\r\\n\"), this.line = \"\", this.cursor = 0, this.prevRows = 0;\n }\n [kLine]() {\n var line = this[kAddHistory]();\n this[kUndoStack] = [], this[kRedoStack] = [], this.clearLine(), this[kOnLine](line);\n }\n [kPushToUndoStack](text, cursor) {\n if (ArrayPrototypePush.@call(this[kUndoStack], { text, cursor }) > kMaxUndoRedoStackSize)\n ArrayPrototypeShift.@call(this[kUndoStack]);\n }\n [kUndo]() {\n if (this[kUndoStack].length <= 0)\n return;\n ArrayPrototypePush.@call(this[kRedoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.@call(this[kUndoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kRedo]() {\n if (this[kRedoStack].length <= 0)\n return;\n ArrayPrototypePush.@call(this[kUndoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.@call(this[kRedoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kHistoryNext]() {\n if (this.historyIndex >= 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex - 1;\n while (index >= 0 && (!StringPrototypeStartsWith.@call(this.history[index], search) || this.line === this.history[index]))\n index--;\n if (index === -1)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kHistoryPrev]() {\n if (this.historyIndex < this.history.length && this.history.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex + 1;\n while (index < this.history.length && (!StringPrototypeStartsWith.@call(this.history[index], search) || this.line === this.history[index]))\n index++;\n if (index === this.history.length)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kGetDisplayPos](str) {\n var offset = 0, col = this.columns, rows = 0;\n str = stripVTControlCharacters(str);\n for (var char of new SafeStringIterator(str)) {\n if (char === \"\\n\") {\n rows += MathCeil(offset / col) || 1, offset = 0;\n continue;\n }\n if (char === \"\\t\") {\n offset += this.tabSize - offset % this.tabSize;\n continue;\n }\n var width = getStringWidth(char, !1);\n if (width === 0 || width === 1)\n offset += width;\n else {\n if ((offset + 1) % col === 0)\n offset++;\n offset += 2;\n }\n }\n var cols = offset % col;\n return rows += (offset - cols) / col, { cols, rows };\n }\n getCursorPos() {\n var strBeforeCursor = this[kPrompt] + StringPrototypeSlice.@call(this.line, 0, this.cursor);\n return this[kGetDisplayPos](strBeforeCursor);\n }\n [kMoveCursor](dx) {\n if (dx === 0)\n return;\n var oldPos = this.getCursorPos();\n if (this.cursor += dx, this.cursor < 0)\n this.cursor = 0;\n else if (this.cursor > this.line.length)\n this.cursor = this.line.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows === newPos.rows) {\n var diffWidth = newPos.cols - oldPos.cols;\n moveCursor(this.output, diffWidth, 0);\n } else\n this[kRefreshLine]();\n }\n [kTtyWrite](s, key) {\n var previousKey = this[kPreviousKey];\n key = key || kEmptyObject, this[kPreviousKey] = key;\n var { name: keyName, meta: keyMeta, ctrl: keyCtrl2, shift: keyShift, sequence: keySeq } = key;\n if (!keyMeta || keyName !== \"y\")\n this[kYanking] = !1;\n if ((keyName === \"up\" || keyName === \"down\") && !keyCtrl2 && !keyMeta && !keyShift) {\n if (this[kSubstringSearch] === null)\n this[kSubstringSearch] = StringPrototypeSlice.@call(this.line, 0, this.cursor);\n } else if (this[kSubstringSearch] !== null) {\n if (this[kSubstringSearch] = null, this.history.length === this.historyIndex)\n this.historyIndex = -1;\n }\n if (typeof keySeq === \"string\")\n switch (StringPrototypeCodePointAt.@call(keySeq, 0)) {\n case 31:\n this[kUndo]();\n return;\n case 30:\n this[kRedo]();\n return;\n default:\n break;\n }\n if (keyName === \"escape\")\n return;\n if (keyCtrl2 && keyShift)\n switch (keyName) {\n case \"backspace\":\n this[kDeleteLineLeft]();\n break;\n case \"delete\":\n this[kDeleteLineRight]();\n break;\n }\n else if (keyCtrl2)\n switch (keyName) {\n case \"c\":\n if (this.listenerCount(\"SIGINT\") > 0)\n this.emit(\"SIGINT\");\n else\n this.close();\n break;\n case \"h\":\n this[kDeleteLeft]();\n break;\n case \"d\":\n if (this.cursor === 0 && this.line.length === 0)\n this.close();\n else if (this.cursor < this.line.length)\n this[kDeleteRight]();\n break;\n case \"u\":\n this[kDeleteLineLeft]();\n break;\n case \"k\":\n this[kDeleteLineRight]();\n break;\n case \"a\":\n this[kMoveCursor](-@Infinity);\n break;\n case \"e\":\n this[kMoveCursor](+@Infinity);\n break;\n case \"b\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"f\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"l\":\n cursorTo(this.output, 0, 0), clearScreenDown(this.output), this[kRefreshLine]();\n break;\n case \"n\":\n this[kHistoryNext]();\n break;\n case \"p\":\n this[kHistoryPrev]();\n break;\n case \"y\":\n this[kYank]();\n break;\n case \"z\":\n if (this.listenerCount(\"SIGTSTP\") > 0)\n this.emit(\"SIGTSTP\");\n else\n process.once(\"SIGCONT\", () => {\n if (!this.paused)\n this.pause(), this.emit(\"SIGCONT\");\n this[kSetRawMode](!0), this[kRefreshLine]();\n }), this[kSetRawMode](!1), process.kill(process.pid, \"SIGTSTP\");\n break;\n case \"w\":\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"left\":\n this[kWordLeft]();\n break;\n case \"right\":\n this[kWordRight]();\n break;\n }\n else if (keyMeta)\n switch (keyName) {\n case \"b\":\n this[kWordLeft]();\n break;\n case \"f\":\n this[kWordRight]();\n break;\n case \"d\":\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"y\":\n this[kYankPop]();\n break;\n }\n else {\n if (this[kSawReturnAt] && keyName !== \"enter\")\n this[kSawReturnAt] = 0;\n switch (keyName) {\n case \"return\":\n this[kSawReturnAt] = DateNow(), this[kLine]();\n break;\n case \"enter\":\n if (this[kSawReturnAt] === 0 || DateNow() - this[kSawReturnAt] > this.crlfDelay)\n this[kLine]();\n this[kSawReturnAt] = 0;\n break;\n case \"backspace\":\n this[kDeleteLeft]();\n break;\n case \"delete\":\n this[kDeleteRight]();\n break;\n case \"left\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"right\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"home\":\n this[kMoveCursor](-@Infinity);\n break;\n case \"end\":\n this[kMoveCursor](+@Infinity);\n break;\n case \"up\":\n this[kHistoryPrev]();\n break;\n case \"down\":\n this[kHistoryNext]();\n break;\n case \"tab\":\n if (typeof this.completer === \"function\" && this.isCompletionEnabled) {\n var lastKeypressWasTab = previousKey && previousKey.name === \"tab\";\n this[kTabComplete](lastKeypressWasTab);\n break;\n }\n default:\n if (typeof s === \"string\" && s) {\n var nextMatch = RegExpPrototypeExec.@call(lineEnding, s);\n if (nextMatch !== null) {\n this[kInsertString](StringPrototypeSlice.@call(s, 0, nextMatch.index));\n var { lastIndex } = lineEnding;\n while ((nextMatch = RegExpPrototypeExec.@call(lineEnding, s)) !== null)\n this[kLine](), this[kInsertString](StringPrototypeSlice.@call(s, lastIndex, nextMatch.index)), { lastIndex } = lineEnding;\n if (lastIndex === s.length)\n this[kLine]();\n } else\n this[kInsertString](s);\n }\n }\n }\n }\n [SymbolAsyncIterator]() {\n if (this[kLineObjectStream] === @undefined)\n this[kLineObjectStream] = EventEmitter.on(this, \"line\", {\n close: [\"close\"],\n highWatermark: 1024,\n [kFirstEventParam]: !0\n });\n return this[kLineObjectStream];\n }\n};\nInterface.prototype = {};\nObjectSetPrototypeOf(Interface.prototype, _Interface.prototype);\nObjectSetPrototypeOf(Interface, _Interface);\nInterface.prototype.question = function question(query, options, cb) {\n if (cb = typeof options === \"function\" \? options : cb, options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return;\n var onAbort = () => {\n this[kQuestionCancel]();\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 });\n var cleanup = () => {\n signal.removeEventListener(\"abort\", onAbort);\n }, originalCb = cb;\n cb = typeof cb === \"function\" \? (answer) => {\n return cleanup(), originalCb(answer);\n } : cleanup;\n }\n if (typeof cb === \"function\")\n this[kQuestion](query, cb);\n};\nInterface.prototype.question[promisify.custom] = function question2(query, options) {\n if (options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal && signal.aborted)\n return PromiseReject(new AbortError(@undefined, { cause: signal.reason }));\n return new @Promise((resolve, reject) => {\n var cb = resolve;\n if (signal) {\n var onAbort = () => {\n reject(new AbortError(@undefined, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this.question(query, options, cb);\n });\n};\nObjectDefineProperties(Interface.prototype, {\n [kSetRawMode]: {\n __proto__: null,\n get() {\n return this._setRawMode;\n }\n },\n [kOnLine]: {\n __proto__: null,\n get() {\n return this._onLine;\n }\n },\n [kWriteToOutput]: {\n __proto__: null,\n get() {\n return this._writeToOutput;\n }\n },\n [kAddHistory]: {\n __proto__: null,\n get() {\n return this._addHistory;\n }\n },\n [kRefreshLine]: {\n __proto__: null,\n get() {\n return this._refreshLine;\n }\n },\n [kNormalWrite]: {\n __proto__: null,\n get() {\n return this._normalWrite;\n }\n },\n [kInsertString]: {\n __proto__: null,\n get() {\n return this._insertString;\n }\n },\n [kTabComplete]: {\n __proto__: null,\n get() {\n return this._tabComplete;\n }\n },\n [kWordLeft]: {\n __proto__: null,\n get() {\n return this._wordLeft;\n }\n },\n [kWordRight]: {\n __proto__: null,\n get() {\n return this._wordRight;\n }\n },\n [kDeleteLeft]: {\n __proto__: null,\n get() {\n return this._deleteLeft;\n }\n },\n [kDeleteRight]: {\n __proto__: null,\n get() {\n return this._deleteRight;\n }\n },\n [kDeleteWordLeft]: {\n __proto__: null,\n get() {\n return this._deleteWordLeft;\n }\n },\n [kDeleteWordRight]: {\n __proto__: null,\n get() {\n return this._deleteWordRight;\n }\n },\n [kDeleteLineLeft]: {\n __proto__: null,\n get() {\n return this._deleteLineLeft;\n }\n },\n [kDeleteLineRight]: {\n __proto__: null,\n get() {\n return this._deleteLineRight;\n }\n },\n [kLine]: {\n __proto__: null,\n get() {\n return this._line;\n }\n },\n [kHistoryNext]: {\n __proto__: null,\n get() {\n return this._historyNext;\n }\n },\n [kHistoryPrev]: {\n __proto__: null,\n get() {\n return this._historyPrev;\n }\n },\n [kGetDisplayPos]: {\n __proto__: null,\n get() {\n return this._getDisplayPos;\n }\n },\n [kMoveCursor]: {\n __proto__: null,\n get() {\n return this._moveCursor;\n }\n },\n [kTtyWrite]: {\n __proto__: null,\n get() {\n return this._ttyWrite;\n }\n },\n _decoder: {\n __proto__: null,\n get() {\n return this[kDecoder];\n },\n set(value) {\n this[kDecoder] = value;\n }\n },\n _line_buffer: {\n __proto__: null,\n get() {\n return this[kLine_buffer];\n },\n set(value) {\n this[kLine_buffer] = value;\n }\n },\n _oldPrompt: {\n __proto__: null,\n get() {\n return this[kOldPrompt];\n },\n set(value) {\n this[kOldPrompt] = value;\n }\n },\n _previousKey: {\n __proto__: null,\n get() {\n return this[kPreviousKey];\n },\n set(value) {\n this[kPreviousKey] = value;\n }\n },\n _prompt: {\n __proto__: null,\n get() {\n return this[kPrompt];\n },\n set(value) {\n this[kPrompt] = value;\n }\n },\n _questionCallback: {\n __proto__: null,\n get() {\n return this[kQuestionCallback];\n },\n set(value) {\n this[kQuestionCallback] = value;\n }\n },\n _sawKeyPress: {\n __proto__: null,\n get() {\n return this[kSawKeyPress];\n },\n set(value) {\n this[kSawKeyPress] = value;\n }\n },\n _sawReturnAt: {\n __proto__: null,\n get() {\n return this[kSawReturnAt];\n },\n set(value) {\n this[kSawReturnAt] = value;\n }\n }\n});\nInterface.prototype._setRawMode = _Interface.prototype[kSetRawMode];\nInterface.prototype._onLine = _Interface.prototype[kOnLine];\nInterface.prototype._writeToOutput = _Interface.prototype[kWriteToOutput];\nInterface.prototype._addHistory = _Interface.prototype[kAddHistory];\nInterface.prototype._refreshLine = _Interface.prototype[kRefreshLine];\nInterface.prototype._normalWrite = _Interface.prototype[kNormalWrite];\nInterface.prototype._insertString = _Interface.prototype[kInsertString];\nInterface.prototype._tabComplete = function(lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.@call(this.line, 0, this.cursor);\n this.completer(string, (err, value) => {\n if (this.resume(), err) {\n this._writeToOutput(`Tab completion error: ${inspect(err)}`);\n return;\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n });\n};\nInterface.prototype._wordLeft = _Interface.prototype[kWordLeft];\nInterface.prototype._wordRight = _Interface.prototype[kWordRight];\nInterface.prototype._deleteLeft = _Interface.prototype[kDeleteLeft];\nInterface.prototype._deleteRight = _Interface.prototype[kDeleteRight];\nInterface.prototype._deleteWordLeft = _Interface.prototype[kDeleteWordLeft];\nInterface.prototype._deleteWordRight = _Interface.prototype[kDeleteWordRight];\nInterface.prototype._deleteLineLeft = _Interface.prototype[kDeleteLineLeft];\nInterface.prototype._deleteLineRight = _Interface.prototype[kDeleteLineRight];\nInterface.prototype._line = _Interface.prototype[kLine];\nInterface.prototype._historyNext = _Interface.prototype[kHistoryNext];\nInterface.prototype._historyPrev = _Interface.prototype[kHistoryPrev];\nInterface.prototype._getDisplayPos = _Interface.prototype[kGetDisplayPos];\nInterface.prototype._getCursorPos = _Interface.prototype.getCursorPos;\nInterface.prototype._moveCursor = _Interface.prototype[kMoveCursor];\nInterface.prototype._ttyWrite = _Interface.prototype[kTtyWrite];\n\nclass Readline {\n #autoCommit = !1;\n #stream;\n #todo = [];\n constructor(stream, options = @undefined) {\n if (isWritable \?\?= (@getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39)).isWritable, !isWritable(stream))\n throw new ERR_INVALID_ARG_TYPE(\"stream\", \"Writable\", stream);\n if (this.#stream = stream, options\?.autoCommit != null)\n validateBoolean(options.autoCommit, \"options.autoCommit\"), this.#autoCommit = options.autoCommit;\n }\n cursorTo(x, y = @undefined) {\n if (validateInteger(x, \"x\"), y != null)\n validateInteger(y, \"y\");\n var data = y == null \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.@call(this.#todo, data);\n return this;\n }\n moveCursor(dx, dy) {\n if (dx || dy) {\n validateInteger(dx, \"dx\"), validateInteger(dy, \"dy\");\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.@call(this.#todo, data);\n }\n return this;\n }\n clearLine(dir) {\n validateInteger(dir, \"dir\", -1, 1);\n var data = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.@call(this.#todo, data);\n return this;\n }\n clearScreenDown() {\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(kClearScreenDown));\n else\n ArrayPrototypePush.@call(this.#todo, kClearScreenDown);\n return this;\n }\n commit() {\n return new @Promise((resolve) => {\n this.#stream.write(ArrayPrototypeJoin.@call(this.#todo, \"\"), resolve), this.#todo = [];\n });\n }\n rollback() {\n return this.#todo = [], this;\n }\n}\nvar PromisesInterface = class Interface3 extends _Interface {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n question(query, options = kEmptyObject) {\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return PromiseReject(new AbortError(@undefined, { cause: signal.reason }));\n }\n return new @Promise((resolve, reject) => {\n var cb = resolve;\n if (options\?.signal) {\n var onAbort = () => {\n this[kQuestionCancel](), reject(new AbortError(@undefined, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this[kQuestion](query, cb);\n });\n }\n};\n$ = {\n Interface,\n clearLine,\n clearScreenDown,\n createInterface,\n cursorTo,\n emitKeypressEvents,\n moveCursor,\n promises: {\n Readline,\n Interface: PromisesInterface,\n createInterface(input, output, completer, terminal) {\n return new PromisesInterface(input, output, completer, terminal);\n }\n },\n [SymbolFor(\"__BUN_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__\")]: {\n CSI,\n utils: {\n getStringWidth,\n stripVTControlCharacters\n }\n }\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeStreamConsumersCode = "(function (){\"use strict\";// src/js/out/tmp/node/stream.consumers.ts\nvar $, arrayBuffer = Bun.readableStreamToArrayBuffer, text = Bun.readableStreamToText, json = (stream) => Bun.readableStreamToText(stream).then(JSON.parse), buffer = async (readableStream) => {\n return new Buffer(await arrayBuffer(readableStream));\n}, blob = Bun.readableStreamToBlob;\n$ = {\n arrayBuffer,\n text,\n json,\n buffer,\n blob\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeReadlinePromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/readline.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).promises})\n");
//
//
-static constexpr ASCIILiteral NodeStreamCode = "(function (){\"use strict\";// src/js/out/tmp/node/stream.ts\nvar isReadableStream = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof ReadableStream;\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar ERR_INVALID_ARG_TYPE = function(name, type, value) {\n return new Error(`The argument '${name}' is invalid. Received '${value}' for type '${type}'`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value '${value}' is invalid for argument '${name}'. Reason: ${reason}`);\n}, createNativeStreamReadable = function(nativeType, Readable) {\n var [pull, start, cancel, setClose, deinit, updateRef, drainFn] = globalThis[globalThis.Symbol.for('Bun.lazy')](nativeType), closer = [!1], handleNumberResult = function(nativeReadable, result, view, isClosed) {\n if (result > 0) {\n const slice = view.subarray(0, result), remainder = view.subarray(result);\n if (slice.byteLength > 0)\n nativeReadable.push(slice);\n if (isClosed)\n nativeReadable.push(null);\n return remainder.byteLength > 0 \? remainder : void 0;\n }\n if (isClosed)\n nativeReadable.push(null);\n return view;\n }, handleArrayBufferViewResult = function(nativeReadable, result, view, isClosed) {\n if (result.byteLength > 0)\n nativeReadable.push(result);\n if (isClosed)\n nativeReadable.push(null);\n return view;\n }, DYNAMICALLY_ADJUST_CHUNK_SIZE = process.env.BUN_DISABLE_DYNAMIC_CHUNK_SIZE !== \"1\";\n const finalizer = new FinalizationRegistry((ptr) => ptr && deinit(ptr)), MIN_BUFFER_SIZE = 512;\n var NativeReadable = class NativeReadable2 extends Readable {\n #bunNativePtr;\n #refCount = 1;\n #constructed = !1;\n #remainingChunk = void 0;\n #highWaterMark;\n #pendingRead = !1;\n #hasResized = !DYNAMICALLY_ADJUST_CHUNK_SIZE;\n #unregisterToken;\n constructor(ptr, options = {}) {\n super(options);\n if (typeof options.highWaterMark === \"number\")\n this.#highWaterMark = options.highWaterMark;\n else\n this.#highWaterMark = 262144;\n this.#bunNativePtr = ptr, this.#constructed = !1, this.#remainingChunk = void 0, this.#pendingRead = !1, this.#unregisterToken = {}, finalizer.register(this, this.#bunNativePtr, this.#unregisterToken);\n }\n _read(maxToRead) {\n if (this.#pendingRead)\n return;\n var ptr = this.#bunNativePtr;\n if (ptr === 0) {\n this.push(null);\n return;\n }\n if (!this.#constructed)\n this.#internalConstruct(ptr);\n return this.#internalRead(this.#getRemainingChunk(maxToRead), ptr);\n }\n #internalConstruct(ptr) {\n this.#constructed = !0;\n const result = start(ptr, this.#highWaterMark);\n if (typeof result === \"number\" && result > 1)\n this.#hasResized = !0, this.#highWaterMark = Math.min(this.#highWaterMark, result);\n if (drainFn) {\n const drainResult = drainFn(ptr);\n if ((drainResult\?.byteLength \?\? 0) > 0)\n this.push(drainResult);\n }\n }\n #getRemainingChunk(maxToRead = this.#highWaterMark) {\n var chunk = this.#remainingChunk;\n if (chunk\?.byteLength \?\? 0 < MIN_BUFFER_SIZE) {\n var size = maxToRead > MIN_BUFFER_SIZE \? maxToRead : MIN_BUFFER_SIZE;\n this.#remainingChunk = chunk = new Buffer(size);\n }\n return chunk;\n }\n #handleResult(result, view, isClosed) {\n if (typeof result === \"number\") {\n if (result >= this.#highWaterMark && !this.#hasResized && !isClosed)\n this.#highWaterMark *= 2, this.#hasResized = !0;\n return handleNumberResult(this, result, view, isClosed);\n } else if (typeof result === \"boolean\")\n return process.nextTick(() => {\n this.push(null);\n }), view\?.byteLength \?\? 0 > 0 \? view : void 0;\n else if (ArrayBuffer.isView(result)) {\n if (result.byteLength >= this.#highWaterMark && !this.#hasResized && !isClosed)\n this.#highWaterMark *= 2, this.#hasResized = !0;\n return handleArrayBufferViewResult(this, result, view, isClosed);\n } else\n throw new Error(\"Invalid result from pull\");\n }\n #internalRead(view, ptr) {\n closer[0] = !1;\n var result = pull(ptr, view, closer);\n if (@isPromise(result))\n return this.#pendingRead = !0, result.then((result2) => {\n this.#pendingRead = !1, this.#remainingChunk = this.#handleResult(result2, view, closer[0]);\n }, (reason) => {\n errorOrDestroy(this, reason);\n });\n else\n this.#remainingChunk = this.#handleResult(result, view, closer[0]);\n }\n _destroy(error, callback) {\n var ptr = this.#bunNativePtr;\n if (ptr === 0) {\n callback(error);\n return;\n }\n if (finalizer.unregister(this.#unregisterToken), this.#bunNativePtr = 0, updateRef)\n updateRef(ptr, !1);\n cancel(ptr, error), callback(error);\n }\n ref() {\n var ptr = this.#bunNativePtr;\n if (ptr === 0)\n return;\n if (this.#refCount++ === 0)\n updateRef(ptr, !0);\n }\n unref() {\n var ptr = this.#bunNativePtr;\n if (ptr === 0)\n return;\n if (this.#refCount-- === 1)\n updateRef(ptr, !1);\n }\n };\n if (!updateRef)\n NativeReadable.prototype.ref = void 0, NativeReadable.prototype.unref = void 0;\n return NativeReadable;\n}, getNativeReadableStreamPrototype = function(nativeType, Readable) {\n return nativeReadableStreamPrototypes[nativeType] ||= createNativeStreamReadable(nativeType, Readable);\n}, getNativeReadableStream = function(Readable, stream, options) {\n if (!(stream && typeof stream === \"object\" && stream instanceof ReadableStream))\n return;\n const native = @direct(stream);\n if (!native)\n return;\n const { stream: ptr, data: type } = native;\n return new (getNativeReadableStreamPrototype(type, Readable))(ptr, options);\n}, NativeWritable = function(pathOrFdOrSink, options = {}) {\n Writable.call(this, options), this[_native] = !0, this._construct = NativeWritable_internalConstruct, this._destroy = NativeWritable_internalDestroy, this._final = NativeWritable_internalFinal, this[_pathOrFdOrSink] = pathOrFdOrSink;\n}, NativeWritable_internalConstruct = function(cb) {\n if (this._writableState.constructed = !0, this.constructed = !0, typeof cb === \"function\")\n cb();\n process.nextTick(() => {\n this.emit(\"open\", this.fd), this.emit(\"ready\");\n });\n}, NativeWritable_lazyConstruct = function(stream) {\n var sink = stream[_pathOrFdOrSink];\n if (typeof sink === \"object\")\n if (typeof sink.write === \"function\")\n return stream[_fileSink] = sink;\n else\n throw new Error(\"Invalid FileSink\");\n else\n return stream[_fileSink] = Bun.file(sink).writer();\n}, NativeWritable_internalDestroy = function(error, cb) {\n const w = this._writableState, r = this._readableState;\n if (w)\n w.destroyed = !0, w.closeEmitted = !0;\n if (r)\n r.destroyed = !0, r.closeEmitted = !0;\n if (typeof cb === \"function\")\n cb(error);\n if (w\?.closeEmitted || r\?.closeEmitted)\n this.emit(\"close\");\n}, NativeWritable_internalFinal = function(cb) {\n var sink = this[_fileSink];\n if (sink)\n sink.end();\n if (cb)\n cb();\n}, EE = globalThis[globalThis.Symbol.for('Bun.lazy')](\"events\"), StringDecoder = @requireNativeModule(\"string_decoder\").StringDecoder, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, runOnNextTick = process.nextTick;\nvar ArrayIsArray = Array.isArray, require_primordials = __commonJS({\n \"node_modules/readable-stream/lib/ours/primordials.js\"(exports, module) {\n module.exports = {\n ArrayIsArray(self) {\n return Array.isArray(self);\n },\n ArrayPrototypeIncludes(self, el) {\n return self.includes(el);\n },\n ArrayPrototypeIndexOf(self, el) {\n return self.indexOf(el);\n },\n ArrayPrototypeJoin(self, sep) {\n return self.join(sep);\n },\n ArrayPrototypeMap(self, fn) {\n return self.map(fn);\n },\n ArrayPrototypePop(self, el) {\n return self.pop(el);\n },\n ArrayPrototypePush(self, el) {\n return self.push(el);\n },\n ArrayPrototypeSlice(self, start, end) {\n return self.slice(start, end);\n },\n Error,\n FunctionPrototypeCall(fn, thisArgs, ...args) {\n return fn.call(thisArgs, ...args);\n },\n FunctionPrototypeSymbolHasInstance(self, instance) {\n return Function.prototype[Symbol.hasInstance].call(self, instance);\n },\n MathFloor: Math.floor,\n Number,\n NumberIsInteger: Number.isInteger,\n NumberIsNaN: Number.isNaN,\n NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,\n NumberParseInt: Number.parseInt,\n ObjectDefineProperties(self, props) {\n return Object.defineProperties(self, props);\n },\n ObjectDefineProperty(self, name, prop) {\n return Object.defineProperty(self, name, prop);\n },\n ObjectGetOwnPropertyDescriptor(self, name) {\n return Object.getOwnPropertyDescriptor(self, name);\n },\n ObjectKeys(obj) {\n return Object.keys(obj);\n },\n ObjectSetPrototypeOf(target, proto) {\n return Object.setPrototypeOf(target, proto);\n },\n Promise,\n PromisePrototypeCatch(self, fn) {\n return self.catch(fn);\n },\n PromisePrototypeThen(self, thenFn, catchFn) {\n return self.then(thenFn, catchFn);\n },\n PromiseReject(err) {\n return Promise.reject(err);\n },\n ReflectApply: Reflect.apply,\n RegExpPrototypeTest(self, value) {\n return self.test(value);\n },\n SafeSet: Set,\n String,\n StringPrototypeSlice(self, start, end) {\n return self.slice(start, end);\n },\n StringPrototypeToLowerCase(self) {\n return self.toLowerCase();\n },\n StringPrototypeToUpperCase(self) {\n return self.toUpperCase();\n },\n StringPrototypeTrim(self) {\n return self.trim();\n },\n Symbol,\n SymbolAsyncIterator: Symbol.asyncIterator,\n SymbolHasInstance: Symbol.hasInstance,\n SymbolIterator: Symbol.iterator,\n TypedArrayPrototypeSet(self, buf, len) {\n return self.set(buf, len);\n },\n Uint8Array\n };\n }\n}), require_util = __commonJS({\n \"node_modules/readable-stream/lib/ours/util.js\"(exports, module) {\n var AsyncFunction = Object.getPrototypeOf(async function() {\n }).constructor, isBlob = typeof Blob !== \"undefined\" \? function isBlob2(b) {\n return b instanceof Blob;\n } : function isBlob2(b) {\n return !1;\n }, AggregateError = class extends Error {\n constructor(errors) {\n if (!Array.isArray(errors))\n @throwTypeError(`Expected input to be an Array, got ${typeof errors}`);\n let message = \"\";\n for (let i = 0;i < errors.length; i++)\n message += ` ${errors[i].stack}\n`;\n super(message);\n this.name = \"AggregateError\", this.errors = errors;\n }\n };\n module.exports = {\n AggregateError,\n once(callback) {\n let called = !1;\n return function(...args) {\n if (called)\n return;\n called = !0, callback.apply(this, args);\n };\n },\n createDeferredPromise: function() {\n let resolve, reject;\n return {\n promise: new Promise((res, rej) => {\n resolve = res, reject = rej;\n }),\n resolve,\n reject\n };\n },\n promisify(fn) {\n return new Promise((resolve, reject) => {\n fn((err, ...args) => {\n if (err)\n return reject(err);\n return resolve(...args);\n });\n });\n },\n debuglog() {\n return function() {\n };\n },\n format(format, ...args) {\n return format.replace(/%([sdifj])/g, function(...[_unused, type]) {\n const replacement = args.shift();\n if (type === \"f\")\n return replacement.toFixed(6);\n else if (type === \"j\")\n return JSON.stringify(replacement);\n else if (type === \"s\" && typeof replacement === \"object\")\n return `${replacement.constructor !== Object \? replacement.constructor.name : \"\"} {}`.trim();\n else\n return replacement.toString();\n });\n },\n inspect(value) {\n switch (typeof value) {\n case \"string\":\n if (value.includes(\"'\")) {\n if (!value.includes('\"'))\n return `\"${value}\"`;\n else if (!value.includes(\"`\") && !value.includes(\"${\"))\n return `\\`${value}\\``;\n }\n return `'${value}'`;\n case \"number\":\n if (isNaN(value))\n return \"NaN\";\n else if (Object.is(value, -0))\n return String(value);\n return value;\n case \"bigint\":\n return `${String(value)}n`;\n case \"boolean\":\n case \"undefined\":\n return String(value);\n case \"object\":\n return \"{}\";\n }\n },\n types: {\n isAsyncFunction(fn) {\n return fn instanceof AsyncFunction;\n },\n isArrayBufferView(arr) {\n return ArrayBuffer.isView(arr);\n }\n },\n isBlob\n }, module.exports.promisify.custom = Symbol.for(\"nodejs.util.promisify.custom\");\n }\n}), require_errors = __commonJS({\n \"node_modules/readable-stream/lib/ours/errors.js\"(exports, module) {\n var { format, inspect, AggregateError: CustomAggregateError } = require_util(), AggregateError = globalThis.AggregateError || CustomAggregateError, kIsNodeError = Symbol(\"kIsNodeError\"), kTypes = [\"string\", \"function\", \"number\", \"object\", \"Function\", \"Object\", \"boolean\", \"bigint\", \"symbol\"], classRegExp = /^([A-Z][a-z0-9]*)+$/, nodeInternalPrefix = \"__node_internal_\", codes = {};\n function assert(value, message) {\n if (!value)\n throw new codes.ERR_INTERNAL_ASSERTION(message);\n }\n function addNumericalSeparator(val) {\n let res = \"\", i = val.length;\n const start = val[0] === \"-\" \? 1 : 0;\n for (;i >= start + 4; i -= 3)\n res = `_${val.slice(i - 3, i)}${res}`;\n return `${val.slice(0, i)}${res}`;\n }\n function getMessage(key, msg, args) {\n if (typeof msg === \"function\")\n return assert(msg.length <= args.length, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`), msg(...args);\n const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length;\n if (assert(expectedLength === args.length, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`), args.length === 0)\n return msg;\n return format(msg, ...args);\n }\n function E(code, message, Base) {\n if (!Base)\n Base = Error;\n\n class NodeError extends Base {\n constructor(...args) {\n super(getMessage(code, message, args));\n }\n toString() {\n return `${this.name} [${code}]: ${this.message}`;\n }\n }\n Object.defineProperties(NodeError.prototype, {\n name: {\n value: Base.name,\n writable: !0,\n enumerable: !1,\n configurable: !0\n },\n toString: {\n value() {\n return `${this.name} [${code}]: ${this.message}`;\n },\n writable: !0,\n enumerable: !1,\n configurable: !0\n }\n }), NodeError.prototype.code = code, NodeError.prototype[kIsNodeError] = !0, codes[code] = NodeError;\n }\n function hideStackFrames(fn) {\n const hidden = nodeInternalPrefix + fn.name;\n return Object.defineProperty(fn, \"name\", {\n value: hidden\n }), fn;\n }\n function aggregateTwoErrors(innerError, outerError) {\n if (innerError && outerError && innerError !== outerError) {\n if (Array.isArray(outerError.errors))\n return outerError.errors.push(innerError), outerError;\n const err = new AggregateError([outerError, innerError], outerError.message);\n return err.code = outerError.code, err;\n }\n return innerError || outerError;\n }\n var AbortError2 = class extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n };\n E(\"ERR_ASSERTION\", \"%s\", Error), E(\"ERR_INVALID_ARG_TYPE\", (name, expected, actual) => {\n if (assert(typeof name === \"string\", \"'name' must be a string\"), !Array.isArray(expected))\n expected = [expected];\n let msg = \"The \";\n if (name.endsWith(\" argument\"))\n msg += `${name} `;\n else\n msg += `\"${name}\" ${name.includes(\".\") \? \"property\" : \"argument\"} `;\n msg += \"must be \";\n const types = [], instances = [], other = [];\n for (let value of expected)\n if (assert(typeof value === \"string\", \"All expected entries have to be of type string\"), kTypes.includes(value))\n types.push(value.toLowerCase());\n else if (classRegExp.test(value))\n instances.push(value);\n else\n assert(value !== \"object\", 'The value \"object\" should be written as \"Object\"'), other.push(value);\n if (instances.length > 0) {\n const pos = types.indexOf(\"object\");\n if (pos !== -1)\n types.splice(types, pos, 1), instances.push(\"Object\");\n }\n if (types.length > 0) {\n switch (types.length) {\n case 1:\n msg += `of type ${types[0]}`;\n break;\n case 2:\n msg += `one of type ${types[0]} or ${types[1]}`;\n break;\n default: {\n const last = types.pop();\n msg += `one of type ${types.join(\", \")}, or ${last}`;\n }\n }\n if (instances.length > 0 || other.length > 0)\n msg += \" or \";\n }\n if (instances.length > 0) {\n switch (instances.length) {\n case 1:\n msg += `an instance of ${instances[0]}`;\n break;\n case 2:\n msg += `an instance of ${instances[0]} or ${instances[1]}`;\n break;\n default: {\n const last = instances.pop();\n msg += `an instance of ${instances.join(\", \")}, or ${last}`;\n }\n }\n if (other.length > 0)\n msg += \" or \";\n }\n switch (other.length) {\n case 0:\n break;\n case 1:\n if (other[0].toLowerCase() !== other[0])\n msg += \"an \";\n msg += `${other[0]}`;\n break;\n case 2:\n msg += `one of ${other[0]} or ${other[1]}`;\n break;\n default: {\n const last = other.pop();\n msg += `one of ${other.join(\", \")}, or ${last}`;\n }\n }\n if (actual == null)\n msg += `. Received ${actual}`;\n else if (typeof actual === \"function\" && actual.name)\n msg += `. Received function ${actual.name}`;\n else if (typeof actual === \"object\") {\n var _actual$constructor;\n if ((_actual$constructor = actual.constructor) !== null && _actual$constructor !== void 0 && _actual$constructor.name)\n msg += `. Received an instance of ${actual.constructor.name}`;\n else {\n const inspected = inspect(actual, {\n depth: -1\n });\n msg += `. Received ${inspected}`;\n }\n } else {\n let inspected = inspect(actual, {\n colors: !1\n });\n if (inspected.length > 25)\n inspected = `${inspected.slice(0, 25)}...`;\n msg += `. Received type ${typeof actual} (${inspected})`;\n }\n return msg;\n }, TypeError), E(\"ERR_INVALID_ARG_VALUE\", (name, value, reason = \"is invalid\") => {\n let inspected = inspect(value);\n if (inspected.length > 128)\n inspected = inspected.slice(0, 128) + \"...\";\n return `The ${name.includes(\".\") \? \"property\" : \"argument\"} '${name}' ${reason}. Received ${inspected}`;\n }, TypeError), E(\"ERR_INVALID_RETURN_VALUE\", (input, name, value) => {\n var _value$constructor;\n const type = value !== null && value !== void 0 && (_value$constructor = value.constructor) !== null && _value$constructor !== void 0 && _value$constructor.name \? `instance of ${value.constructor.name}` : `type ${typeof value}`;\n return `Expected ${input} to be returned from the \"${name}\" function but got ${type}.`;\n }, TypeError), E(\"ERR_MISSING_ARGS\", (...args) => {\n assert(args.length > 0, \"At least one arg needs to be specified\");\n let msg;\n const len = args.length;\n switch (args = (Array.isArray(args) \? args : [args]).map((a) => `\"${a}\"`).join(\" or \"), len) {\n case 1:\n msg += `The ${args[0]} argument`;\n break;\n case 2:\n msg += `The ${args[0]} and ${args[1]} arguments`;\n break;\n default:\n {\n const last = args.pop();\n msg += `The ${args.join(\", \")}, and ${last} arguments`;\n }\n break;\n }\n return `${msg} must be specified`;\n }, TypeError), E(\"ERR_OUT_OF_RANGE\", (str, range, input) => {\n assert(range, 'Missing \"range\" argument');\n let received;\n if (Number.isInteger(input) && Math.abs(input) > 4294967296)\n received = addNumericalSeparator(String(input));\n else if (typeof input === \"bigint\") {\n if (received = String(input), input > 2n ** 32n || input < -(2n ** 32n))\n received = addNumericalSeparator(received);\n received += \"n\";\n } else\n received = inspect(input);\n return `The value of \"${str}\" is out of range. It must be ${range}. Received ${received}`;\n }, RangeError), E(\"ERR_MULTIPLE_CALLBACK\", \"Callback called multiple times\", Error), E(\"ERR_METHOD_NOT_IMPLEMENTED\", \"The %s method is not implemented\", Error), E(\"ERR_STREAM_ALREADY_FINISHED\", \"Cannot call %s after a stream was finished\", Error), E(\"ERR_STREAM_CANNOT_PIPE\", \"Cannot pipe, not readable\", Error), E(\"ERR_STREAM_DESTROYED\", \"Cannot call %s after a stream was destroyed\", Error), E(\"ERR_STREAM_NULL_VALUES\", \"May not write null values to stream\", TypeError), E(\"ERR_STREAM_PREMATURE_CLOSE\", \"Premature close\", Error), E(\"ERR_STREAM_PUSH_AFTER_EOF\", \"stream.push() after EOF\", Error), E(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\", \"stream.unshift() after end event\", Error), E(\"ERR_STREAM_WRITE_AFTER_END\", \"write after end\", Error), E(\"ERR_UNKNOWN_ENCODING\", \"Unknown encoding: %s\", TypeError), module.exports = {\n AbortError: AbortError2,\n aggregateTwoErrors: hideStackFrames(aggregateTwoErrors),\n hideStackFrames,\n codes\n };\n }\n}), require_validators = __commonJS({\n \"node_modules/readable-stream/lib/internal/validators.js\"(exports, module) {\n var {\n ArrayIsArray: ArrayIsArray2,\n ArrayPrototypeIncludes,\n ArrayPrototypeJoin,\n ArrayPrototypeMap,\n NumberIsInteger,\n NumberMAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER,\n NumberParseInt,\n RegExpPrototypeTest,\n String: String2,\n StringPrototypeToUpperCase,\n StringPrototypeTrim\n } = require_primordials(), {\n hideStackFrames,\n codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL }\n } = require_errors(), { normalizeEncoding } = require_util(), { isAsyncFunction, isArrayBufferView } = require_util().types, signals = {};\n function isInt32(value) {\n return value === (value | 0);\n }\n function isUint32(value) {\n return value === value >>> 0;\n }\n var octalReg = /^[0-7]+$/, modeDesc = \"must be a 32-bit unsigned integer or an octal string\";\n function parseFileMode(value, name, def) {\n if (typeof value === \"undefined\")\n value = def;\n if (typeof value === \"string\") {\n if (!RegExpPrototypeTest(octalReg, value))\n throw new ERR_INVALID_ARG_VALUE2(name, value, modeDesc);\n value = NumberParseInt(value, 8);\n }\n return validateInt32(value, name, 0, 4294967295), value;\n }\n var validateInteger = hideStackFrames((value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }), validateInt32 = hideStackFrames((value, name, min = -2147483648, max = 2147483647) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!isInt32(value)) {\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }), validateUint32 = hideStackFrames((value, name, positive) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!isUint32(value)) {\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n throw new ERR_OUT_OF_RANGE(name, `>= ${positive \? 1 : 0} && < 4294967296`, value);\n }\n if (positive && value === 0)\n throw new ERR_OUT_OF_RANGE(name, \">= 1 && < 4294967296\", value);\n });\n function validateString(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"string\", value);\n }\n function validateNumber(value, name) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n }\n var validateOneOf = hideStackFrames((value, name, oneOf) => {\n if (!ArrayPrototypeIncludes(oneOf, value)) {\n const reason = \"must be one of: \" + ArrayPrototypeJoin(ArrayPrototypeMap(oneOf, (v) => typeof v === \"string\" \? `'${v}'` : String2(v)), \", \");\n throw new ERR_INVALID_ARG_VALUE2(name, value, reason);\n }\n });\n function validateBoolean2(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"boolean\", value);\n }\n var validateObject = hideStackFrames((value, name, options) => {\n const useDefaultOptions = options == null, allowArray = useDefaultOptions \? !1 : options.allowArray, allowFunction = useDefaultOptions \? !1 : options.allowFunction;\n if (!(useDefaultOptions \? !1 : options.nullable) && value === null || !allowArray && ArrayIsArray2(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Object\", value);\n }), validateArray = hideStackFrames((value, name, minLength = 0) => {\n if (!ArrayIsArray2(value))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE2(name, value, reason);\n }\n });\n function validateSignalName(signal, name = \"signal\") {\n if (validateString(signal, name), signals[signal] === void 0) {\n if (signals[StringPrototypeToUpperCase(signal)] !== void 0)\n throw new ERR_UNKNOWN_SIGNAL(signal + \" (signals must use all capital letters)\");\n throw new ERR_UNKNOWN_SIGNAL(signal);\n }\n }\n var validateBuffer = hideStackFrames((buffer, name = \"buffer\") => {\n if (!isArrayBufferView(buffer))\n throw new ERR_INVALID_ARG_TYPE2(name, [\"Buffer\", \"TypedArray\", \"DataView\"], buffer);\n });\n function validateEncoding(data, encoding) {\n const normalizedEncoding = normalizeEncoding(encoding), length = data.length;\n if (normalizedEncoding === \"hex\" && length % 2 !== 0)\n throw new ERR_INVALID_ARG_VALUE2(\"encoding\", encoding, `is invalid for data of length ${length}`);\n }\n function validatePort(port, name = \"Port\", allowZero = !0) {\n if (typeof port !== \"number\" && typeof port !== \"string\" || typeof port === \"string\" && StringPrototypeTrim(port).length === 0 || +port !== +port >>> 0 || port > 65535 || port === 0 && !allowZero)\n throw new ERR_SOCKET_BAD_PORT(name, port, allowZero);\n return port | 0;\n }\n var validateAbortSignal = hideStackFrames((signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE2(name, \"AbortSignal\", signal);\n }), validateFunction = hideStackFrames((value, name) => {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"Function\", value);\n }), validatePlainFunction = hideStackFrames((value, name) => {\n if (typeof value !== \"function\" || isAsyncFunction(value))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Function\", value);\n }), validateUndefined = hideStackFrames((value, name) => {\n if (value !== void 0)\n throw new ERR_INVALID_ARG_TYPE2(name, \"undefined\", value);\n });\n module.exports = {\n isInt32,\n isUint32,\n parseFileMode,\n validateArray,\n validateBoolean: validateBoolean2,\n validateBuffer,\n validateEncoding,\n validateFunction,\n validateInt32,\n validateInteger,\n validateNumber,\n validateObject,\n validateOneOf,\n validatePlainFunction,\n validatePort,\n validateSignalName,\n validateString,\n validateUint32,\n validateUndefined,\n validateAbortSignal\n };\n }\n}), require_utils = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/utils.js\"(exports, module) {\n var { Symbol: Symbol2, SymbolAsyncIterator, SymbolIterator } = require_primordials(), kDestroyed = Symbol2(\"kDestroyed\"), kIsErrored = Symbol2(\"kIsErrored\"), kIsReadable = Symbol2(\"kIsReadable\"), kIsDisturbed = Symbol2(\"kIsDisturbed\");\n function isReadableNodeStream(obj, strict = !1) {\n var _obj$_readableState;\n return !!(obj && typeof obj.pipe === \"function\" && typeof obj.on === \"function\" && (!strict || typeof obj.pause === \"function\" && typeof obj.resume === \"function\") && (!obj._writableState || ((_obj$_readableState = obj._readableState) === null || _obj$_readableState === void 0 \? void 0 : _obj$_readableState.readable) !== !1) && (!obj._writableState || obj._readableState));\n }\n function isWritableNodeStream(obj) {\n var _obj$_writableState;\n return !!(obj && typeof obj.write === \"function\" && typeof obj.on === \"function\" && (!obj._readableState || ((_obj$_writableState = obj._writableState) === null || _obj$_writableState === void 0 \? void 0 : _obj$_writableState.writable) !== !1));\n }\n function isDuplexNodeStream(obj) {\n return !!(obj && typeof obj.pipe === \"function\" && obj._readableState && typeof obj.on === \"function\" && typeof obj.write === \"function\");\n }\n function isNodeStream(obj) {\n return obj && (obj._readableState || obj._writableState || typeof obj.write === \"function\" && typeof obj.on === \"function\" || typeof obj.pipe === \"function\" && typeof obj.on === \"function\");\n }\n function isIterable(obj, isAsync) {\n if (obj == null)\n return !1;\n if (isAsync === !0)\n return typeof obj[SymbolAsyncIterator] === \"function\";\n if (isAsync === !1)\n return typeof obj[SymbolIterator] === \"function\";\n return typeof obj[SymbolAsyncIterator] === \"function\" || typeof obj[SymbolIterator] === \"function\";\n }\n function isDestroyed(stream) {\n if (!isNodeStream(stream))\n return null;\n const { _writableState: wState, _readableState: rState } = stream, state = wState || rState;\n return !!(stream.destroyed || stream[kDestroyed] || state !== null && state !== void 0 && state.destroyed);\n }\n function isWritableEnded(stream) {\n if (!isWritableNodeStream(stream))\n return null;\n if (stream.writableEnded === !0)\n return !0;\n const wState = stream._writableState;\n if (wState !== null && wState !== void 0 && wState.errored)\n return !1;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.ended) !== \"boolean\")\n return null;\n return wState.ended;\n }\n function isWritableFinished(stream, strict) {\n if (!isWritableNodeStream(stream))\n return null;\n if (stream.writableFinished === !0)\n return !0;\n const wState = stream._writableState;\n if (wState !== null && wState !== void 0 && wState.errored)\n return !1;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.finished) !== \"boolean\")\n return null;\n return !!(wState.finished || strict === !1 && wState.ended === !0 && wState.length === 0);\n }\n function isReadableEnded(stream) {\n if (!isReadableNodeStream(stream))\n return null;\n if (stream.readableEnded === !0)\n return !0;\n const rState = stream._readableState;\n if (!rState || rState.errored)\n return !1;\n if (typeof (rState === null || rState === void 0 \? void 0 : rState.ended) !== \"boolean\")\n return null;\n return rState.ended;\n }\n function isReadableFinished(stream, strict) {\n if (!isReadableNodeStream(stream))\n return null;\n const rState = stream._readableState;\n if (rState !== null && rState !== void 0 && rState.errored)\n return !1;\n if (typeof (rState === null || rState === void 0 \? void 0 : rState.endEmitted) !== \"boolean\")\n return null;\n return !!(rState.endEmitted || strict === !1 && rState.ended === !0 && rState.length === 0);\n }\n function isReadable(stream) {\n if (stream && stream[kIsReadable] != null)\n return stream[kIsReadable];\n if (typeof (stream === null || stream === void 0 \? void 0 : stream.readable) !== \"boolean\")\n return null;\n if (isDestroyed(stream))\n return !1;\n return isReadableNodeStream(stream) && stream.readable && !isReadableFinished(stream);\n }\n function isWritable(stream) {\n if (typeof (stream === null || stream === void 0 \? void 0 : stream.writable) !== \"boolean\")\n return null;\n if (isDestroyed(stream))\n return !1;\n return isWritableNodeStream(stream) && stream.writable && !isWritableEnded(stream);\n }\n function isFinished(stream, opts) {\n if (!isNodeStream(stream))\n return null;\n if (isDestroyed(stream))\n return !0;\n if ((opts === null || opts === void 0 \? void 0 : opts.readable) !== !1 && isReadable(stream))\n return !1;\n if ((opts === null || opts === void 0 \? void 0 : opts.writable) !== !1 && isWritable(stream))\n return !1;\n return !0;\n }\n function isWritableErrored(stream) {\n var _stream$_writableStat, _stream$_writableStat2;\n if (!isNodeStream(stream))\n return null;\n if (stream.writableErrored)\n return stream.writableErrored;\n return (_stream$_writableStat = (_stream$_writableStat2 = stream._writableState) === null || _stream$_writableStat2 === void 0 \? void 0 : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== void 0 \? _stream$_writableStat : null;\n }\n function isReadableErrored(stream) {\n var _stream$_readableStat, _stream$_readableStat2;\n if (!isNodeStream(stream))\n return null;\n if (stream.readableErrored)\n return stream.readableErrored;\n return (_stream$_readableStat = (_stream$_readableStat2 = stream._readableState) === null || _stream$_readableStat2 === void 0 \? void 0 : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== void 0 \? _stream$_readableStat : null;\n }\n function isClosed(stream) {\n if (!isNodeStream(stream))\n return null;\n if (typeof stream.closed === \"boolean\")\n return stream.closed;\n const { _writableState: wState, _readableState: rState } = stream;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.closed) === \"boolean\" || typeof (rState === null || rState === void 0 \? void 0 : rState.closed) === \"boolean\")\n return (wState === null || wState === void 0 \? void 0 : wState.closed) || (rState === null || rState === void 0 \? void 0 : rState.closed);\n if (typeof stream._closed === \"boolean\" && isOutgoingMessage(stream))\n return stream._closed;\n return null;\n }\n function isOutgoingMessage(stream) {\n return typeof stream._closed === \"boolean\" && typeof stream._defaultKeepAlive === \"boolean\" && typeof stream._removedConnection === \"boolean\" && typeof stream._removedContLen === \"boolean\";\n }\n function isServerResponse(stream) {\n return typeof stream._sent100 === \"boolean\" && isOutgoingMessage(stream);\n }\n function isServerRequest(stream) {\n var _stream$req;\n return typeof stream._consuming === \"boolean\" && typeof stream._dumped === \"boolean\" && ((_stream$req = stream.req) === null || _stream$req === void 0 \? void 0 : _stream$req.upgradeOrConnect) === void 0;\n }\n function willEmitClose(stream) {\n if (!isNodeStream(stream))\n return null;\n const { _writableState: wState, _readableState: rState } = stream, state = wState || rState;\n return !state && isServerResponse(stream) || !!(state && state.autoDestroy && state.emitClose && state.closed === !1);\n }\n function isDisturbed(stream) {\n var _stream$kIsDisturbed;\n return !!(stream && ((_stream$kIsDisturbed = stream[kIsDisturbed]) !== null && _stream$kIsDisturbed !== void 0 \? _stream$kIsDisturbed : stream.readableDidRead || stream.readableAborted));\n }\n function isErrored(stream) {\n var _ref, _ref2, _ref3, _ref4, _ref5, _stream$kIsErrored, _stream$_readableStat3, _stream$_writableStat3, _stream$_readableStat4, _stream$_writableStat4;\n return !!(stream && ((_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_stream$kIsErrored = stream[kIsErrored]) !== null && _stream$kIsErrored !== void 0 \? _stream$kIsErrored : stream.readableErrored) !== null && _ref5 !== void 0 \? _ref5 : stream.writableErrored) !== null && _ref4 !== void 0 \? _ref4 : (_stream$_readableStat3 = stream._readableState) === null || _stream$_readableStat3 === void 0 \? void 0 : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== void 0 \? _ref3 : (_stream$_writableStat3 = stream._writableState) === null || _stream$_writableStat3 === void 0 \? void 0 : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== void 0 \? _ref2 : (_stream$_readableStat4 = stream._readableState) === null || _stream$_readableStat4 === void 0 \? void 0 : _stream$_readableStat4.errored) !== null && _ref !== void 0 \? _ref : (_stream$_writableStat4 = stream._writableState) === null || _stream$_writableStat4 === void 0 \? void 0 : _stream$_writableStat4.errored));\n }\n module.exports = {\n kDestroyed,\n isDisturbed,\n kIsDisturbed,\n isErrored,\n kIsErrored,\n isReadable,\n kIsReadable,\n isClosed,\n isDestroyed,\n isDuplexNodeStream,\n isFinished,\n isIterable,\n isReadableNodeStream,\n isReadableEnded,\n isReadableFinished,\n isReadableErrored,\n isNodeStream,\n isWritable,\n isWritableNodeStream,\n isWritableEnded,\n isWritableFinished,\n isWritableErrored,\n isServerRequest,\n isServerResponse,\n willEmitClose\n };\n }\n}), require_end_of_stream = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/end-of-stream.js\"(exports, module) {\n var { AbortError: AbortError2, codes } = require_errors(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_PREMATURE_CLOSE } = codes, { once } = require_util(), { validateAbortSignal, validateFunction, validateObject } = require_validators(), { Promise: Promise2 } = require_primordials(), {\n isClosed,\n isReadable,\n isReadableNodeStream,\n isReadableFinished,\n isReadableErrored,\n isWritable,\n isWritableNodeStream,\n isWritableFinished,\n isWritableErrored,\n isNodeStream,\n willEmitClose: _willEmitClose\n } = require_utils();\n function isRequest(stream) {\n return stream.setHeader && typeof stream.abort === \"function\";\n }\n var nop = () => {\n };\n function eos(stream, options, callback) {\n var _options$readable, _options$writable;\n if (arguments.length === 2)\n callback = options, options = {};\n else if (options == null)\n options = {};\n else\n validateObject(options, \"options\");\n validateFunction(callback, \"callback\"), validateAbortSignal(options.signal, \"options.signal\"), callback = once(callback);\n const readable = (_options$readable = options.readable) !== null && _options$readable !== void 0 \? _options$readable : isReadableNodeStream(stream), writable = (_options$writable = options.writable) !== null && _options$writable !== void 0 \? _options$writable : isWritableNodeStream(stream);\n if (!isNodeStream(stream))\n throw new ERR_INVALID_ARG_TYPE2(\"stream\", \"Stream\", stream);\n const { _writableState: wState, _readableState: rState } = stream, onlegacyfinish = () => {\n if (!stream.writable)\n onfinish();\n };\n let willEmitClose = _willEmitClose(stream) && isReadableNodeStream(stream) === readable && isWritableNodeStream(stream) === writable, writableFinished = isWritableFinished(stream, !1);\n const onfinish = () => {\n if (writableFinished = !0, stream.destroyed)\n willEmitClose = !1;\n if (willEmitClose && (!stream.readable || readable))\n return;\n if (!readable || readableFinished)\n callback.call(stream);\n };\n let readableFinished = isReadableFinished(stream, !1);\n const onend = () => {\n if (readableFinished = !0, stream.destroyed)\n willEmitClose = !1;\n if (willEmitClose && (!stream.writable || writable))\n return;\n if (!writable || writableFinished)\n callback.call(stream);\n }, onerror = (err) => {\n callback.call(stream, err);\n };\n let closed = isClosed(stream);\n const onclose = () => {\n closed = !0;\n const errored = isWritableErrored(stream) || isReadableErrored(stream);\n if (errored && typeof errored !== \"boolean\")\n return callback.call(stream, errored);\n if (readable && !readableFinished && isReadableNodeStream(stream, !0)) {\n if (!isReadableFinished(stream, !1))\n return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE);\n }\n if (writable && !writableFinished) {\n if (!isWritableFinished(stream, !1))\n return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE);\n }\n callback.call(stream);\n }, onrequest = () => {\n stream.req.on(\"finish\", onfinish);\n };\n if (isRequest(stream)) {\n if (stream.on(\"complete\", onfinish), !willEmitClose)\n stream.on(\"abort\", onclose);\n if (stream.req)\n onrequest();\n else\n stream.on(\"request\", onrequest);\n } else if (writable && !wState)\n stream.on(\"end\", onlegacyfinish), stream.on(\"close\", onlegacyfinish);\n if (!willEmitClose && typeof stream.aborted === \"boolean\")\n stream.on(\"aborted\", onclose);\n if (stream.on(\"end\", onend), stream.on(\"finish\", onfinish), options.error !== !1)\n stream.on(\"error\", onerror);\n if (stream.on(\"close\", onclose), closed)\n runOnNextTick(onclose);\n else if (wState !== null && wState !== void 0 && wState.errorEmitted || rState !== null && rState !== void 0 && rState.errorEmitted) {\n if (!willEmitClose)\n runOnNextTick(onclose);\n } else if (!readable && (!willEmitClose || isReadable(stream)) && (writableFinished || isWritable(stream) === !1))\n runOnNextTick(onclose);\n else if (!writable && (!willEmitClose || isWritable(stream)) && (readableFinished || isReadable(stream) === !1))\n runOnNextTick(onclose);\n else if (rState && stream.req && stream.aborted)\n runOnNextTick(onclose);\n const cleanup = () => {\n if (callback = nop, stream.removeListener(\"aborted\", onclose), stream.removeListener(\"complete\", onfinish), stream.removeListener(\"abort\", onclose), stream.removeListener(\"request\", onrequest), stream.req)\n stream.req.removeListener(\"finish\", onfinish);\n stream.removeListener(\"end\", onlegacyfinish), stream.removeListener(\"close\", onlegacyfinish), stream.removeListener(\"finish\", onfinish), stream.removeListener(\"end\", onend), stream.removeListener(\"error\", onerror), stream.removeListener(\"close\", onclose);\n };\n if (options.signal && !closed) {\n const abort = () => {\n const endCallback = callback;\n cleanup(), endCallback.call(stream, new AbortError2(void 0, {\n cause: options.signal.reason\n }));\n };\n if (options.signal.aborted)\n runOnNextTick(abort);\n else {\n const originalCallback = callback;\n callback = once((...args) => {\n options.signal.removeEventListener(\"abort\", abort), originalCallback.apply(stream, args);\n }), options.signal.addEventListener(\"abort\", abort);\n }\n }\n return cleanup;\n }\n function finished(stream, opts) {\n return new Promise2((resolve, reject) => {\n eos(stream, opts, (err) => {\n if (err)\n reject(err);\n else\n resolve();\n });\n });\n }\n module.exports = eos, module.exports.finished = finished;\n }\n}), require_operators = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/operators.js\"(exports, module) {\n var {\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_MISSING_ARGS, ERR_OUT_OF_RANGE },\n AbortError: AbortError2\n } = require_errors(), { validateAbortSignal, validateInteger, validateObject } = require_validators(), kWeakHandler = require_primordials().Symbol(\"kWeak\"), { finished } = require_end_of_stream(), {\n ArrayPrototypePush,\n MathFloor,\n Number: Number2,\n NumberIsNaN,\n Promise: Promise2,\n PromiseReject,\n PromisePrototypeCatch,\n Symbol: Symbol2\n } = require_primordials(), kEmpty = Symbol2(\"kEmpty\"), kEof = Symbol2(\"kEof\");\n function map(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n let concurrency = 1;\n if ((options === null || options === void 0 \? void 0 : options.concurrency) != null)\n concurrency = MathFloor(options.concurrency);\n return validateInteger(concurrency, \"concurrency\", 1), async function* map2() {\n var _options$signal, _options$signal2;\n const ac = new AbortController, stream = this, queue = [], signal = ac.signal, signalOpt = {\n signal\n }, abort = () => ac.abort();\n if (options !== null && options !== void 0 && (_options$signal = options.signal) !== null && _options$signal !== void 0 && _options$signal.aborted)\n abort();\n options === null || options === void 0 || (_options$signal2 = options.signal) === null || _options$signal2 === void 0 || _options$signal2.addEventListener(\"abort\", abort);\n let next, resume, done = !1;\n function onDone() {\n done = !0;\n }\n async function pump() {\n try {\n for await (let val of stream) {\n var _val;\n if (done)\n return;\n if (signal.aborted)\n throw new AbortError2;\n try {\n val = fn(val, signalOpt);\n } catch (err) {\n val = PromiseReject(err);\n }\n if (val === kEmpty)\n continue;\n if (typeof ((_val = val) === null || _val === void 0 \? void 0 : _val.catch) === \"function\")\n val.catch(onDone);\n if (queue.push(val), next)\n next(), next = null;\n if (!done && queue.length && queue.length >= concurrency)\n await new Promise2((resolve) => {\n resume = resolve;\n });\n }\n queue.push(kEof);\n } catch (err) {\n const val = PromiseReject(err);\n PromisePrototypeCatch(val, onDone), queue.push(val);\n } finally {\n var _options$signal3;\n if (done = !0, next)\n next(), next = null;\n options === null || options === void 0 || (_options$signal3 = options.signal) === null || _options$signal3 === void 0 || _options$signal3.removeEventListener(\"abort\", abort);\n }\n }\n pump();\n try {\n while (!0) {\n while (queue.length > 0) {\n const val = await queue[0];\n if (val === kEof)\n return;\n if (signal.aborted)\n throw new AbortError2;\n if (val !== kEmpty)\n yield val;\n if (queue.shift(), resume)\n resume(), resume = null;\n }\n await new Promise2((resolve) => {\n next = resolve;\n });\n }\n } finally {\n if (ac.abort(), done = !0, resume)\n resume(), resume = null;\n }\n }.call(this);\n }\n function asIndexedPairs(options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return async function* asIndexedPairs2() {\n let index = 0;\n for await (let val of this) {\n var _options$signal4;\n if (options !== null && options !== void 0 && (_options$signal4 = options.signal) !== null && _options$signal4 !== void 0 && _options$signal4.aborted)\n throw new AbortError2({\n cause: options.signal.reason\n });\n yield [index++, val];\n }\n }.call(this);\n }\n async function some(fn, options = void 0) {\n for await (let unused of filter.call(this, fn, options))\n return !0;\n return !1;\n }\n async function every(fn, options = void 0) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n return !await some.call(this, async (...args) => {\n return !await fn(...args);\n }, options);\n }\n async function find(fn, options) {\n for await (let result of filter.call(this, fn, options))\n return result;\n return;\n }\n async function forEach(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n async function forEachFn(value, options2) {\n return await fn(value, options2), kEmpty;\n }\n for await (let unused of map.call(this, forEachFn, options))\n ;\n }\n function filter(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n async function filterFn(value, options2) {\n if (await fn(value, options2))\n return value;\n return kEmpty;\n }\n return map.call(this, filterFn, options);\n }\n var ReduceAwareErrMissingArgs = class extends ERR_MISSING_ARGS {\n constructor() {\n super(\"reduce\");\n this.message = \"Reduce of an empty stream requires an initial value\";\n }\n };\n async function reduce(reducer, initialValue, options) {\n var _options$signal5;\n if (typeof reducer !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"reducer\", [\"Function\", \"AsyncFunction\"], reducer);\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n let hasInitialValue = arguments.length > 1;\n if (options !== null && options !== void 0 && (_options$signal5 = options.signal) !== null && _options$signal5 !== void 0 && _options$signal5.aborted) {\n const err = new AbortError2(void 0, {\n cause: options.signal.reason\n });\n throw this.once(\"error\", () => {\n }), await finished(this.destroy(err)), err;\n }\n const ac = new AbortController, signal = ac.signal;\n if (options !== null && options !== void 0 && options.signal) {\n const opts = {\n once: !0,\n [kWeakHandler]: this\n };\n options.signal.addEventListener(\"abort\", () => ac.abort(), opts);\n }\n let gotAnyItemFromStream = !1;\n try {\n for await (let value of this) {\n var _options$signal6;\n if (gotAnyItemFromStream = !0, options !== null && options !== void 0 && (_options$signal6 = options.signal) !== null && _options$signal6 !== void 0 && _options$signal6.aborted)\n throw new AbortError2;\n if (!hasInitialValue)\n initialValue = value, hasInitialValue = !0;\n else\n initialValue = await reducer(initialValue, value, {\n signal\n });\n }\n if (!gotAnyItemFromStream && !hasInitialValue)\n throw new ReduceAwareErrMissingArgs;\n } finally {\n ac.abort();\n }\n return initialValue;\n }\n async function toArray(options) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n const result = [];\n for await (let val of this) {\n var _options$signal7;\n if (options !== null && options !== void 0 && (_options$signal7 = options.signal) !== null && _options$signal7 !== void 0 && _options$signal7.aborted)\n throw new AbortError2(void 0, {\n cause: options.signal.reason\n });\n ArrayPrototypePush(result, val);\n }\n return result;\n }\n function flatMap(fn, options) {\n const values = map.call(this, fn, options);\n return async function* flatMap2() {\n for await (let val of values)\n yield* val;\n }.call(this);\n }\n function toIntegerOrInfinity(number) {\n if (number = Number2(number), NumberIsNaN(number))\n return 0;\n if (number < 0)\n throw new ERR_OUT_OF_RANGE(\"number\", \">= 0\", number);\n return number;\n }\n function drop(number, options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return number = toIntegerOrInfinity(number), async function* drop2() {\n var _options$signal8;\n if (options !== null && options !== void 0 && (_options$signal8 = options.signal) !== null && _options$signal8 !== void 0 && _options$signal8.aborted)\n throw new AbortError2;\n for await (let val of this) {\n var _options$signal9;\n if (options !== null && options !== void 0 && (_options$signal9 = options.signal) !== null && _options$signal9 !== void 0 && _options$signal9.aborted)\n throw new AbortError2;\n if (number-- <= 0)\n yield val;\n }\n }.call(this);\n }\n function take(number, options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return number = toIntegerOrInfinity(number), async function* take2() {\n var _options$signal10;\n if (options !== null && options !== void 0 && (_options$signal10 = options.signal) !== null && _options$signal10 !== void 0 && _options$signal10.aborted)\n throw new AbortError2;\n for await (let val of this) {\n var _options$signal11;\n if (options !== null && options !== void 0 && (_options$signal11 = options.signal) !== null && _options$signal11 !== void 0 && _options$signal11.aborted)\n throw new AbortError2;\n if (number-- > 0)\n yield val;\n else\n return;\n }\n }.call(this);\n }\n module.exports.streamReturningOperators = {\n asIndexedPairs,\n drop,\n filter,\n flatMap,\n map,\n take\n }, module.exports.promiseReturningOperators = {\n every,\n forEach,\n reduce,\n toArray,\n some,\n find\n };\n }\n}), require_destroy = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/destroy.js\"(exports, module) {\n var {\n aggregateTwoErrors,\n codes: { ERR_MULTIPLE_CALLBACK },\n AbortError: AbortError2\n } = require_errors(), { Symbol: Symbol2 } = require_primordials(), { kDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils(), kDestroy = \"#kDestroy\", kConstruct = \"#kConstruct\";\n function checkError(err, w, r) {\n if (err) {\n if (err.stack, w && !w.errored)\n w.errored = err;\n if (r && !r.errored)\n r.errored = err;\n }\n }\n function destroy2(err, cb) {\n const r = this._readableState, w = this._writableState, s = w || r;\n if (w && w.destroyed || r && r.destroyed) {\n if (typeof cb === \"function\")\n cb();\n return this;\n }\n if (checkError(err, w, r), w)\n w.destroyed = !0;\n if (r)\n r.destroyed = !0;\n if (!s.constructed)\n this.once(kDestroy, (er) => {\n _destroy(this, aggregateTwoErrors(er, err), cb);\n });\n else\n _destroy(this, err, cb);\n return this;\n }\n function _destroy(self, err, cb) {\n let called = !1;\n function onDestroy(err2) {\n if (called)\n return;\n called = !0;\n const { _readableState: r, _writableState: w } = self;\n if (checkError(err2, w, r), w)\n w.closed = !0;\n if (r)\n r.closed = !0;\n if (typeof cb === \"function\")\n cb(err2);\n if (err2)\n runOnNextTick(emitErrorCloseNT, self, err2);\n else\n runOnNextTick(emitCloseNT, self);\n }\n try {\n self._destroy(err || null, onDestroy);\n } catch (err2) {\n onDestroy(err2);\n }\n }\n function emitErrorCloseNT(self, err) {\n emitErrorNT(self, err), emitCloseNT(self);\n }\n function emitCloseNT(self) {\n const { _readableState: r, _writableState: w } = self;\n if (w)\n w.closeEmitted = !0;\n if (r)\n r.closeEmitted = !0;\n if (w && w.emitClose || r && r.emitClose)\n self.emit(\"close\");\n }\n function emitErrorNT(self, err) {\n const r = self\?._readableState, w = self\?._writableState;\n if (w\?.errorEmitted || r\?.errorEmitted)\n return;\n if (w)\n w.errorEmitted = !0;\n if (r)\n r.errorEmitted = !0;\n self\?.emit\?.(\"error\", err);\n }\n function undestroy() {\n const r = this._readableState, w = this._writableState;\n if (r)\n r.constructed = !0, r.closed = !1, r.closeEmitted = !1, r.destroyed = !1, r.errored = null, r.errorEmitted = !1, r.reading = !1, r.ended = r.readable === !1, r.endEmitted = r.readable === !1;\n if (w)\n w.constructed = !0, w.destroyed = !1, w.closed = !1, w.closeEmitted = !1, w.errored = null, w.errorEmitted = !1, w.finalCalled = !1, w.prefinished = !1, w.ended = w.writable === !1, w.ending = w.writable === !1, w.finished = w.writable === !1;\n }\n function errorOrDestroy2(stream, err, sync) {\n const r = stream\?._readableState, w = stream\?._writableState;\n if (w && w.destroyed || r && r.destroyed)\n return this;\n if (r && r.autoDestroy || w && w.autoDestroy)\n stream.destroy(err);\n else if (err) {\n if (Error.captureStackTrace(err), w && !w.errored)\n w.errored = err;\n if (r && !r.errored)\n r.errored = err;\n if (sync)\n runOnNextTick(emitErrorNT, stream, err);\n else\n emitErrorNT(stream, err);\n }\n }\n function construct(stream, cb) {\n if (typeof stream._construct !== \"function\")\n return;\n const { _readableState: r, _writableState: w } = stream;\n if (r)\n r.constructed = !1;\n if (w)\n w.constructed = !1;\n if (stream.once(kConstruct, cb), stream.listenerCount(kConstruct) > 1)\n return;\n runOnNextTick(constructNT, stream);\n }\n function constructNT(stream) {\n let called = !1;\n function onConstruct(err) {\n if (called) {\n errorOrDestroy2(stream, err !== null && err !== void 0 \? err : new ERR_MULTIPLE_CALLBACK);\n return;\n }\n called = !0;\n const { _readableState: r, _writableState: w } = stream, s = w || r;\n if (r)\n r.constructed = !0;\n if (w)\n w.constructed = !0;\n if (s.destroyed)\n stream.emit(kDestroy, err);\n else if (err)\n errorOrDestroy2(stream, err, !0);\n else\n runOnNextTick(emitConstructNT, stream);\n }\n try {\n stream._construct(onConstruct);\n } catch (err) {\n onConstruct(err);\n }\n }\n function emitConstructNT(stream) {\n stream.emit(kConstruct);\n }\n function isRequest(stream) {\n return stream && stream.setHeader && typeof stream.abort === \"function\";\n }\n function emitCloseLegacy(stream) {\n stream.emit(\"close\");\n }\n function emitErrorCloseLegacy(stream, err) {\n stream.emit(\"error\", err), runOnNextTick(emitCloseLegacy, stream);\n }\n function destroyer(stream, err) {\n if (!stream || isDestroyed(stream))\n return;\n if (!err && !isFinished(stream))\n err = new AbortError2;\n if (isServerRequest(stream))\n stream.socket = null, stream.destroy(err);\n else if (isRequest(stream))\n stream.abort();\n else if (isRequest(stream.req))\n stream.req.abort();\n else if (typeof stream.destroy === \"function\")\n stream.destroy(err);\n else if (typeof stream.close === \"function\")\n stream.close();\n else if (err)\n runOnNextTick(emitErrorCloseLegacy, stream);\n else\n runOnNextTick(emitCloseLegacy, stream);\n if (!stream.destroyed)\n stream[kDestroyed] = !0;\n }\n module.exports = {\n construct,\n destroyer,\n destroy: destroy2,\n undestroy,\n errorOrDestroy: errorOrDestroy2\n };\n }\n}), require_legacy = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/legacy.js\"(exports, module) {\n var { ArrayIsArray: ArrayIsArray2, ObjectSetPrototypeOf } = require_primordials();\n function Stream(options) {\n if (!(this instanceof Stream))\n return new Stream(options);\n EE.call(this, options);\n }\n Stream.prototype = {}, ObjectSetPrototypeOf(Stream.prototype, EE.prototype), ObjectSetPrototypeOf(Stream, EE), Stream.prototype.pipe = function(dest, options) {\n const source = this;\n function ondata(chunk) {\n if (dest.writable && dest.write(chunk) === !1 && source.pause)\n source.pause();\n }\n source.on(\"data\", ondata);\n function ondrain() {\n if (source.readable && source.resume)\n source.resume();\n }\n if (dest.on(\"drain\", ondrain), !dest._isStdio && (!options || options.end !== !1))\n source.on(\"end\", onend), source.on(\"close\", onclose);\n let didOnEnd = !1;\n function onend() {\n if (didOnEnd)\n return;\n didOnEnd = !0, dest.end();\n }\n function onclose() {\n if (didOnEnd)\n return;\n if (didOnEnd = !0, typeof dest.destroy === \"function\")\n dest.destroy();\n }\n function onerror(er) {\n if (cleanup(), EE.listenerCount(this, \"error\") === 0)\n this.emit(\"error\", er);\n }\n prependListener(source, \"error\", onerror), prependListener(dest, \"error\", onerror);\n function cleanup() {\n source.removeListener(\"data\", ondata), dest.removeListener(\"drain\", ondrain), source.removeListener(\"end\", onend), source.removeListener(\"close\", onclose), source.removeListener(\"error\", onerror), dest.removeListener(\"error\", onerror), source.removeListener(\"end\", cleanup), source.removeListener(\"close\", cleanup), dest.removeListener(\"close\", cleanup);\n }\n return source.on(\"end\", cleanup), source.on(\"close\", cleanup), dest.on(\"close\", cleanup), dest.emit(\"pipe\", source), dest;\n };\n function prependListener(emitter, event, fn) {\n if (typeof emitter.prependListener === \"function\")\n return emitter.prependListener(event, fn);\n if (!emitter._events || !emitter._events[event])\n emitter.on(event, fn);\n else if (ArrayIsArray2(emitter._events[event]))\n emitter._events[event].unshift(fn);\n else\n emitter._events[event] = [fn, emitter._events[event]];\n }\n module.exports = {\n Stream,\n prependListener\n };\n }\n}), require_add_abort_signal = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/add-abort-signal.js\"(exports, module) {\n var { AbortError: AbortError2, codes } = require_errors(), eos = require_end_of_stream(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2 } = codes, validateAbortSignal = (signal, name) => {\n if (typeof signal !== \"object\" || !(\"aborted\" in signal))\n throw new ERR_INVALID_ARG_TYPE2(name, \"AbortSignal\", signal);\n };\n function isNodeStream(obj) {\n return !!(obj && typeof obj.pipe === \"function\");\n }\n module.exports.addAbortSignal = function addAbortSignal(signal, stream) {\n if (validateAbortSignal(signal, \"signal\"), !isNodeStream(stream))\n throw new ERR_INVALID_ARG_TYPE2(\"stream\", \"stream.Stream\", stream);\n return module.exports.addAbortSignalNoValidate(signal, stream);\n }, module.exports.addAbortSignalNoValidate = function(signal, stream) {\n if (typeof signal !== \"object\" || !(\"aborted\" in signal))\n return stream;\n const onAbort = () => {\n stream.destroy(new AbortError2(void 0, {\n cause: signal.reason\n }));\n };\n if (signal.aborted)\n onAbort();\n else\n signal.addEventListener(\"abort\", onAbort), eos(stream, () => signal.removeEventListener(\"abort\", onAbort));\n return stream;\n };\n }\n}), require_state = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/state.js\"(exports, module) {\n var { MathFloor, NumberIsInteger } = require_primordials(), { ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2 } = require_errors().codes;\n function highWaterMarkFrom(options, isDuplex, duplexKey) {\n return options.highWaterMark != null \? options.highWaterMark : isDuplex \? options[duplexKey] : null;\n }\n function getDefaultHighWaterMark(objectMode) {\n return objectMode \? 16 : 16384;\n }\n function getHighWaterMark(state, options, duplexKey, isDuplex) {\n const hwm = highWaterMarkFrom(options, isDuplex, duplexKey);\n if (hwm != null) {\n if (!NumberIsInteger(hwm) || hwm < 0) {\n const name = isDuplex \? `options.${duplexKey}` : \"options.highWaterMark\";\n throw new ERR_INVALID_ARG_VALUE2(name, hwm);\n }\n return MathFloor(hwm);\n }\n return getDefaultHighWaterMark(state.objectMode);\n }\n module.exports = {\n getHighWaterMark,\n getDefaultHighWaterMark\n };\n }\n}), require_from = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/from.js\"(exports, module) {\n var { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_NULL_VALUES } = require_errors().codes;\n function from(Readable, iterable, opts) {\n let iterator;\n if (typeof iterable === \"string\" || iterable instanceof Buffer)\n return new Readable({\n objectMode: !0,\n ...opts,\n read() {\n this.push(iterable), this.push(null);\n }\n });\n let isAsync;\n if (iterable && iterable[SymbolAsyncIterator])\n isAsync = !0, iterator = iterable[SymbolAsyncIterator]();\n else if (iterable && iterable[SymbolIterator])\n isAsync = !1, iterator = iterable[SymbolIterator]();\n else\n throw new ERR_INVALID_ARG_TYPE2(\"iterable\", [\"Iterable\"], iterable);\n const readable = new Readable({\n objectMode: !0,\n highWaterMark: 1,\n ...opts\n });\n let reading = !1;\n readable._read = function() {\n if (!reading)\n reading = !0, next();\n }, readable._destroy = function(error, cb) {\n PromisePrototypeThen(close(error), () => runOnNextTick(cb, error), (e) => runOnNextTick(cb, e || error));\n };\n async function close(error) {\n const hadError = error !== void 0 && error !== null, hasThrow = typeof iterator.throw === \"function\";\n if (hadError && hasThrow) {\n const { value, done } = await iterator.throw(error);\n if (await value, done)\n return;\n }\n if (typeof iterator.return === \"function\") {\n const { value } = await iterator.return();\n await value;\n }\n }\n async function next() {\n for (;; ) {\n try {\n const { value, done } = isAsync \? await iterator.next() : iterator.next();\n if (done)\n readable.push(null);\n else {\n const res = value && typeof value.then === \"function\" \? await value : value;\n if (res === null)\n throw reading = !1, new ERR_STREAM_NULL_VALUES;\n else if (readable.push(res))\n continue;\n else\n reading = !1;\n }\n } catch (err) {\n readable.destroy(err);\n }\n break;\n }\n }\n return readable;\n }\n module.exports = from;\n }\n}), _ReadableFromWeb, _ReadableFromWebForUndici, require_readable = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/readable.js\"(exports, module) {\n var {\n ArrayPrototypeIndexOf,\n NumberIsInteger,\n NumberIsNaN,\n NumberParseInt,\n ObjectDefineProperties,\n ObjectKeys,\n ObjectSetPrototypeOf,\n Promise: Promise2,\n SafeSet,\n SymbolAsyncIterator,\n Symbol: Symbol2\n } = require_primordials(), ReadableState = globalThis[globalThis.Symbol.for('Bun.lazy')](\"bun:stream\").ReadableState, { Stream, prependListener } = require_legacy();\n function Readable(options) {\n if (!(this instanceof Readable))\n return new Readable(options);\n const isDuplex = this instanceof require_duplex();\n if (this._readableState = new ReadableState(options, this, isDuplex), options) {\n const { read, destroy: destroy2, construct, signal } = options;\n if (typeof read === \"function\")\n this._read = read;\n if (typeof destroy2 === \"function\")\n this._destroy = destroy2;\n if (typeof construct === \"function\")\n this._construct = construct;\n if (signal && !isDuplex)\n addAbortSignal(signal, this);\n }\n Stream.call(this, options), destroyImpl.construct(this, () => {\n if (this._readableState.needReadable)\n maybeReadMore(this, this._readableState);\n });\n }\n Readable.prototype = {}, ObjectSetPrototypeOf(Readable.prototype, Stream.prototype), ObjectSetPrototypeOf(Readable, Stream), Readable.prototype.on = function(ev, fn) {\n const res = Stream.prototype.on.call(this, ev, fn), state = this._readableState;\n if (ev === \"data\") {\n if (state.readableListening = this.listenerCount(\"readable\") > 0, state.flowing !== !1)\n this.resume();\n } else if (ev === \"readable\") {\n if (!state.endEmitted && !state.readableListening) {\n if (state.readableListening = state.needReadable = !0, state.flowing = !1, state.emittedReadable = !1, state.length)\n emitReadable(this, state);\n else if (!state.reading)\n runOnNextTick(nReadingNextTick, this);\n } else if (state.endEmitted)\n ;\n }\n return res;\n };\n\n class ReadableFromWeb extends Readable {\n #reader;\n #closed;\n #pendingChunks;\n #stream;\n constructor(options, stream) {\n const { objectMode, highWaterMark, encoding, signal } = options;\n super({\n objectMode,\n highWaterMark,\n encoding,\n signal\n });\n this.#pendingChunks = [], this.#reader = void 0, this.#stream = stream, this.#closed = !1;\n }\n #drainPending() {\n var pendingChunks = this.#pendingChunks, pendingChunksI = 0, pendingChunksCount = pendingChunks.length;\n for (;pendingChunksI < pendingChunksCount; pendingChunksI++) {\n const chunk = pendingChunks[pendingChunksI];\n if (pendingChunks[pendingChunksI] = void 0, !this.push(chunk, void 0))\n return this.#pendingChunks = pendingChunks.slice(pendingChunksI + 1), !0;\n }\n if (pendingChunksCount > 0)\n this.#pendingChunks = [];\n return !1;\n }\n #handleDone(reader) {\n reader.releaseLock(), this.#reader = void 0, this.#closed = !0, this.push(null);\n return;\n }\n async _read() {\n var stream = this.#stream, reader = this.#reader;\n if (stream)\n reader = this.#reader = stream.getReader(), this.#stream = void 0;\n else if (this.#drainPending())\n return;\n var deferredError;\n try {\n do {\n var done = !1, value;\n const firstResult = reader.readMany();\n if (@isPromise(firstResult)) {\n if ({ done, value } = await firstResult, this.#closed) {\n this.#pendingChunks.push(...value);\n return;\n }\n } else\n ({ done, value } = firstResult);\n if (done) {\n this.#handleDone(reader);\n return;\n }\n if (!this.push(value[0])) {\n this.#pendingChunks = value.slice(1);\n return;\n }\n for (let i = 1, count = value.length;i < count; i++)\n if (!this.push(value[i])) {\n this.#pendingChunks = value.slice(i + 1);\n return;\n }\n } while (!this.#closed);\n } catch (e) {\n deferredError = e;\n } finally {\n if (deferredError)\n throw deferredError;\n }\n }\n _destroy(error, callback) {\n if (!this.#closed) {\n var reader = this.#reader;\n if (reader)\n this.#reader = void 0, reader.cancel(error).finally(() => {\n this.#closed = !0, callback(error);\n });\n return;\n }\n try {\n callback(error);\n } catch (error2) {\n globalThis.reportError(error2);\n }\n }\n }\n _ReadableFromWebForUndici = ReadableFromWeb;\n function newStreamReadableFromReadableStream(readableStream, options = {}) {\n if (!isReadableStream(readableStream))\n throw new ERR_INVALID_ARG_TYPE2(\"readableStream\", \"ReadableStream\", readableStream);\n validateObject(options, \"options\");\n const {\n highWaterMark,\n encoding,\n objectMode = !1,\n signal\n } = options;\n if (encoding !== void 0 && !Buffer.isEncoding(encoding))\n throw new ERR_INVALID_ARG_VALUE(encoding, \"options.encoding\");\n return validateBoolean(objectMode, \"options.objectMode\"), getNativeReadableStream(Readable, readableStream, options) || new ReadableFromWeb({\n highWaterMark,\n encoding,\n objectMode,\n signal\n }, readableStream);\n }\n module.exports = Readable, _ReadableFromWeb = newStreamReadableFromReadableStream;\n var { addAbortSignal } = require_add_abort_signal(), eos = require_end_of_stream();\n const { maybeReadMore: _maybeReadMore, resume, emitReadable: _emitReadable, onEofChunk } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"bun:stream\");\n function maybeReadMore(stream, state) {\n process.nextTick(_maybeReadMore, stream, state);\n }\n function emitReadable(stream, state) {\n _emitReadable(stream, state);\n }\n var destroyImpl = require_destroy(), {\n aggregateTwoErrors,\n codes: {\n ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_OUT_OF_RANGE,\n ERR_STREAM_PUSH_AFTER_EOF,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT\n }\n } = require_errors(), { validateObject } = require_validators(), from = require_from(), nop = () => {\n }, { errorOrDestroy: errorOrDestroy2 } = destroyImpl;\n Readable.prototype.destroy = destroyImpl.destroy, Readable.prototype._undestroy = destroyImpl.undestroy, Readable.prototype._destroy = function(err, cb) {\n cb(err);\n }, Readable.prototype[EE.captureRejectionSymbol] = function(err) {\n this.destroy(err);\n }, Readable.prototype.push = function(chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, !1);\n }, Readable.prototype.unshift = function(chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, !0);\n };\n function readableAddChunk(stream, chunk, encoding, addToFront) {\n const state = stream._readableState;\n let err;\n if (!state.objectMode) {\n if (typeof chunk === \"string\") {\n if (encoding = encoding || state.defaultEncoding, state.encoding !== encoding)\n if (addToFront && state.encoding)\n chunk = Buffer.from(chunk, encoding).toString(state.encoding);\n else\n chunk = Buffer.from(chunk, encoding), encoding = \"\";\n } else if (chunk instanceof Buffer)\n encoding = \"\";\n else if (Stream._isUint8Array(chunk)) {\n if (addToFront || !state.decoder)\n chunk = Stream._uint8ArrayToBuffer(chunk);\n encoding = \"\";\n } else if (chunk != null)\n err = new ERR_INVALID_ARG_TYPE2(\"chunk\", [\"string\", \"Buffer\", \"Uint8Array\"], chunk);\n }\n if (err)\n errorOrDestroy2(stream, err);\n else if (chunk === null)\n state.reading = !1, onEofChunk(stream, state);\n else if (state.objectMode || chunk && chunk.length > 0)\n if (addToFront)\n if (state.endEmitted)\n errorOrDestroy2(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT);\n else if (state.destroyed || state.errored)\n return !1;\n else\n addChunk(stream, state, chunk, !0);\n else if (state.ended)\n errorOrDestroy2(stream, new ERR_STREAM_PUSH_AFTER_EOF);\n else if (state.destroyed || state.errored)\n return !1;\n else if (state.reading = !1, state.decoder && !encoding)\n if (chunk = state.decoder.write(chunk), state.objectMode || chunk.length !== 0)\n addChunk(stream, state, chunk, !1);\n else\n maybeReadMore(stream, state);\n else\n addChunk(stream, state, chunk, !1);\n else if (!addToFront)\n state.reading = !1, maybeReadMore(stream, state);\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n }\n function addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync && stream.listenerCount(\"data\") > 0) {\n if (state.multiAwaitDrain)\n state.awaitDrainWriters.clear();\n else\n state.awaitDrainWriters = null;\n state.dataEmitted = !0, stream.emit(\"data\", chunk);\n } else {\n if (state.length += state.objectMode \? 1 : chunk.length, addToFront)\n state.buffer.unshift(chunk);\n else\n state.buffer.push(chunk);\n if (state.needReadable)\n emitReadable(stream, state);\n }\n maybeReadMore(stream, state);\n }\n Readable.prototype.isPaused = function() {\n const state = this._readableState;\n return state.paused === !0 || state.flowing === !1;\n }, Readable.prototype.setEncoding = function(enc) {\n const decoder = new StringDecoder(enc);\n this._readableState.decoder = decoder, this._readableState.encoding = this._readableState.decoder.encoding;\n const buffer = this._readableState.buffer;\n let content = \"\";\n for (let i = buffer.length;i > 0; i--)\n content += decoder.write(buffer.shift());\n if (content !== \"\")\n buffer.push(content);\n return this._readableState.length = content.length, this;\n };\n var MAX_HWM = 1073741824;\n function computeNewHighWaterMark(n) {\n if (n > MAX_HWM)\n throw new ERR_OUT_OF_RANGE(\"size\", \"<= 1GiB\", n);\n else\n n--, n |= n >>> 1, n |= n >>> 2, n |= n >>> 4, n |= n >>> 8, n |= n >>> 16, n++;\n return n;\n }\n function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended)\n return 0;\n if (state.objectMode)\n return 1;\n if (NumberIsNaN(n)) {\n if (state.flowing && state.length)\n return state.buffer.first().length;\n return state.length;\n }\n if (n <= state.length)\n return n;\n return state.ended \? state.length : 0;\n }\n Readable.prototype.read = function(n) {\n if (!NumberIsInteger(n))\n n = NumberParseInt(n, 10);\n const state = this._readableState, nOrig = n;\n if (n > state.highWaterMark)\n state.highWaterMark = computeNewHighWaterMark(n);\n if (n !== 0)\n state.emittedReadable = !1;\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 \? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n if (state.length === 0 && state.ended)\n endReadable(this);\n else\n emitReadable(this, state);\n return null;\n }\n if (n = howMuchToRead(n, state), n === 0 && state.ended) {\n if (state.length === 0)\n endReadable(this);\n return null;\n }\n let doRead = state.needReadable;\n if (state.length === 0 || state.length - n < state.highWaterMark)\n doRead = !0;\n if (state.ended || state.reading || state.destroyed || state.errored || !state.constructed)\n doRead = !1;\n else if (doRead) {\n if (state.reading = !0, state.sync = !0, state.length === 0)\n state.needReadable = !0;\n try {\n var result = this._read(state.highWaterMark);\n if (@isPromise(result)) {\n const peeked = Bun.peek(result);\n if (peeked !== result)\n result = peeked;\n }\n if (@isPromise(result) && result\?.then && @isCallable(result.then))\n result.then(nop, function(err) {\n errorOrDestroy2(this, err);\n });\n } catch (err) {\n errorOrDestroy2(this, err);\n }\n if (state.sync = !1, !state.reading)\n n = howMuchToRead(nOrig, state);\n }\n let ret;\n if (n > 0)\n ret = fromList(n, state);\n else\n ret = null;\n if (ret === null)\n state.needReadable = state.length <= state.highWaterMark, n = 0;\n else if (state.length -= n, state.multiAwaitDrain)\n state.awaitDrainWriters.clear();\n else\n state.awaitDrainWriters = null;\n if (state.length === 0) {\n if (!state.ended)\n state.needReadable = !0;\n if (nOrig !== n && state.ended)\n endReadable(this);\n }\n if (ret !== null && !state.errorEmitted && !state.closeEmitted)\n state.dataEmitted = !0, this.emit(\"data\", ret);\n return ret;\n }, Readable.prototype._read = function(n) {\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_read()\");\n }, Readable.prototype.pipe = function(dest, pipeOpts) {\n const src = this, state = this._readableState;\n if (state.pipes.length === 1) {\n if (!state.multiAwaitDrain)\n state.multiAwaitDrain = !0, state.awaitDrainWriters = new SafeSet(state.awaitDrainWriters \? [state.awaitDrainWriters] : []);\n }\n state.pipes.push(dest);\n const endFn = (!pipeOpts || pipeOpts.end !== !1) && dest !== process.stdout && dest !== process.stderr \? onend : unpipe;\n if (state.endEmitted)\n runOnNextTick(endFn);\n else\n src.once(\"end\", endFn);\n dest.on(\"unpipe\", onunpipe);\n function onunpipe(readable, unpipeInfo) {\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === !1)\n unpipeInfo.hasUnpiped = !0, cleanup();\n }\n }\n function onend() {\n dest.end();\n }\n let ondrain, cleanedUp = !1;\n function cleanup() {\n if (dest.removeListener(\"close\", onclose), dest.removeListener(\"finish\", onfinish), ondrain)\n dest.removeListener(\"drain\", ondrain);\n if (dest.removeListener(\"error\", onerror), dest.removeListener(\"unpipe\", onunpipe), src.removeListener(\"end\", onend), src.removeListener(\"end\", unpipe), src.removeListener(\"data\", ondata), cleanedUp = !0, ondrain && state.awaitDrainWriters && (!dest._writableState || dest._writableState.needDrain))\n ondrain();\n }\n function pause() {\n if (!cleanedUp) {\n if (state.pipes.length === 1 && state.pipes[0] === dest)\n state.awaitDrainWriters = dest, state.multiAwaitDrain = !1;\n else if (state.pipes.length > 1 && state.pipes.includes(dest))\n state.awaitDrainWriters.add(dest);\n src.pause();\n }\n if (!ondrain)\n ondrain = pipeOnDrain(src, dest), dest.on(\"drain\", ondrain);\n }\n src.on(\"data\", ondata);\n function ondata(chunk) {\n if (dest.write(chunk) === !1)\n pause();\n }\n function onerror(er) {\n if (unpipe(), dest.removeListener(\"error\", onerror), dest.listenerCount(\"error\") === 0) {\n const s = dest._writableState || dest._readableState;\n if (s && !s.errorEmitted)\n errorOrDestroy2(dest, er);\n else\n dest.emit(\"error\", er);\n }\n }\n prependListener(dest, \"error\", onerror);\n function onclose() {\n dest.removeListener(\"finish\", onfinish), unpipe();\n }\n dest.once(\"close\", onclose);\n function onfinish() {\n dest.removeListener(\"close\", onclose), unpipe();\n }\n dest.once(\"finish\", onfinish);\n function unpipe() {\n src.unpipe(dest);\n }\n if (dest.emit(\"pipe\", src), dest.writableNeedDrain === !0) {\n if (state.flowing)\n pause();\n } else if (!state.flowing)\n src.resume();\n return dest;\n };\n function pipeOnDrain(src, dest) {\n return function pipeOnDrainFunctionResult() {\n const state = src._readableState;\n if (state.awaitDrainWriters === dest)\n state.awaitDrainWriters = null;\n else if (state.multiAwaitDrain)\n state.awaitDrainWriters.delete(dest);\n if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && src.listenerCount(\"data\"))\n src.resume();\n };\n }\n Readable.prototype.unpipe = function(dest) {\n const state = this._readableState, unpipeInfo = {\n hasUnpiped: !1\n };\n if (state.pipes.length === 0)\n return this;\n if (!dest) {\n const dests = state.pipes;\n state.pipes = [], this.pause();\n for (let i = 0;i < dests.length; i++)\n dests[i].emit(\"unpipe\", this, {\n hasUnpiped: !1\n });\n return this;\n }\n const index = ArrayPrototypeIndexOf(state.pipes, dest);\n if (index === -1)\n return this;\n if (state.pipes.splice(index, 1), state.pipes.length === 0)\n this.pause();\n return dest.emit(\"unpipe\", this, unpipeInfo), this;\n }, Readable.prototype.addListener = Readable.prototype.on, Readable.prototype.removeListener = function(ev, fn) {\n const res = Stream.prototype.removeListener.call(this, ev, fn);\n if (ev === \"readable\")\n runOnNextTick(updateReadableListening, this);\n return res;\n }, Readable.prototype.off = Readable.prototype.removeListener, Readable.prototype.removeAllListeners = function(ev) {\n const res = Stream.prototype.removeAllListeners.apply(this, arguments);\n if (ev === \"readable\" || ev === void 0)\n runOnNextTick(updateReadableListening, this);\n return res;\n };\n function updateReadableListening(self) {\n const state = self._readableState;\n if (state.readableListening = self.listenerCount(\"readable\") > 0, state.resumeScheduled && state.paused === !1)\n state.flowing = !0;\n else if (self.listenerCount(\"data\") > 0)\n self.resume();\n else if (!state.readableListening)\n state.flowing = null;\n }\n function nReadingNextTick(self) {\n self.read(0);\n }\n Readable.prototype.resume = function() {\n const state = this._readableState;\n if (!state.flowing)\n state.flowing = !state.readableListening, resume(this, state);\n return state.paused = !1, this;\n }, Readable.prototype.pause = function() {\n if (this._readableState.flowing !== !1)\n this._readableState.flowing = !1, this.emit(\"pause\");\n return this._readableState.paused = !0, this;\n }, Readable.prototype.wrap = function(stream) {\n let paused = !1;\n stream.on(\"data\", (chunk) => {\n if (!this.push(chunk) && stream.pause)\n paused = !0, stream.pause();\n }), stream.on(\"end\", () => {\n this.push(null);\n }), stream.on(\"error\", (err) => {\n errorOrDestroy2(this, err);\n }), stream.on(\"close\", () => {\n this.destroy();\n }), stream.on(\"destroy\", () => {\n this.destroy();\n }), this._read = () => {\n if (paused && stream.resume)\n paused = !1, stream.resume();\n };\n const streamKeys = ObjectKeys(stream);\n for (let j = 1;j < streamKeys.length; j++) {\n const i = streamKeys[j];\n if (this[i] === void 0 && typeof stream[i] === \"function\")\n this[i] = stream[i].bind(stream);\n }\n return this;\n }, Readable.prototype[SymbolAsyncIterator] = function() {\n return streamToAsyncIterator(this);\n }, Readable.prototype.iterator = function(options) {\n if (options !== void 0)\n validateObject(options, \"options\");\n return streamToAsyncIterator(this, options);\n };\n function streamToAsyncIterator(stream, options) {\n if (typeof stream.read !== \"function\")\n stream = Readable.wrap(stream, {\n objectMode: !0\n });\n const iter = createAsyncIterator(stream, options);\n return iter.stream = stream, iter;\n }\n async function* createAsyncIterator(stream, options) {\n let callback = nop;\n function next(resolve) {\n if (this === stream)\n callback(), callback = nop;\n else\n callback = resolve;\n }\n stream.on(\"readable\", next);\n let error;\n const cleanup = eos(stream, {\n writable: !1\n }, (err) => {\n error = err \? aggregateTwoErrors(error, err) : null, callback(), callback = nop;\n });\n try {\n while (!0) {\n const chunk = stream.destroyed \? null : stream.read();\n if (chunk !== null)\n yield chunk;\n else if (error)\n throw error;\n else if (error === null)\n return;\n else\n await new Promise2(next);\n }\n } catch (err) {\n throw error = aggregateTwoErrors(error, err), error;\n } finally {\n if ((error || (options === null || options === void 0 \? void 0 : options.destroyOnReturn) !== !1) && (error === void 0 || stream._readableState.autoDestroy))\n destroyImpl.destroyer(stream, null);\n else\n stream.off(\"readable\", next), cleanup();\n }\n }\n ObjectDefineProperties(Readable.prototype, {\n readable: {\n get() {\n const r = this._readableState;\n return !!r && r.readable !== !1 && !r.destroyed && !r.errorEmitted && !r.endEmitted;\n },\n set(val) {\n if (this._readableState)\n this._readableState.readable = !!val;\n }\n },\n readableDidRead: {\n enumerable: !1,\n get: function() {\n return this._readableState.dataEmitted;\n }\n },\n readableAborted: {\n enumerable: !1,\n get: function() {\n return !!(this._readableState.readable !== !1 && (this._readableState.destroyed || this._readableState.errored) && !this._readableState.endEmitted);\n }\n },\n readableHighWaterMark: {\n enumerable: !1,\n get: function() {\n return this._readableState.highWaterMark;\n }\n },\n readableBuffer: {\n enumerable: !1,\n get: function() {\n return this._readableState && this._readableState.buffer;\n }\n },\n readableFlowing: {\n enumerable: !1,\n get: function() {\n return this._readableState.flowing;\n },\n set: function(state) {\n if (this._readableState)\n this._readableState.flowing = state;\n }\n },\n readableLength: {\n enumerable: !1,\n get() {\n return this._readableState.length;\n }\n },\n readableObjectMode: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.objectMode : !1;\n }\n },\n readableEncoding: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.encoding : null;\n }\n },\n errored: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.errored : null;\n }\n },\n closed: {\n get() {\n return this._readableState \? this._readableState.closed : !1;\n }\n },\n destroyed: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.destroyed : !1;\n },\n set(value) {\n if (!this._readableState)\n return;\n this._readableState.destroyed = value;\n }\n },\n readableEnded: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.endEmitted : !1;\n }\n }\n }), Readable._fromList = fromList;\n function fromList(n, state) {\n if (state.length === 0)\n return null;\n let ret;\n if (state.objectMode)\n ret = state.buffer.shift();\n else if (!n || n >= state.length) {\n if (state.decoder)\n ret = state.buffer.join(\"\");\n else if (state.buffer.length === 1)\n ret = state.buffer.first();\n else\n ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else\n ret = state.buffer.consume(n, state.decoder);\n return ret;\n }\n function endReadable(stream) {\n const state = stream._readableState;\n if (!state.endEmitted)\n state.ended = !0, runOnNextTick(endReadableNT, state, stream);\n }\n function endReadableNT(state, stream) {\n if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) {\n if (state.endEmitted = !0, stream.emit(\"end\"), stream.writable && stream.allowHalfOpen === !1)\n runOnNextTick(endWritableNT, stream);\n else if (state.autoDestroy) {\n const wState = stream._writableState;\n if (!wState || wState.autoDestroy && (wState.finished || wState.writable === !1))\n stream.destroy();\n }\n }\n }\n function endWritableNT(stream) {\n if (stream.writable && !stream.writableEnded && !stream.destroyed)\n stream.end();\n }\n Readable.from = function(iterable, opts) {\n return from(Readable, iterable, opts);\n };\n var webStreamsAdapters = {\n newStreamReadableFromReadableStream,\n newReadableStreamFromStreamReadable(streamReadable, options = {}) {\n if (typeof streamReadable\?._readableState !== \"object\")\n throw new ERR_INVALID_ARG_TYPE2(\"streamReadable\", \"stream.Readable\", streamReadable);\n var { isDestroyed, isReadable } = require_utils();\n if (isDestroyed(streamReadable) || !isReadable(streamReadable)) {\n const readable = new ReadableStream;\n return readable.cancel(), readable;\n }\n const { readableObjectMode: objectMode, readableHighWaterMark: highWaterMark } = streamReadable, strategy = ((strategy2) => {\n if (strategy2)\n return strategy2;\n if (objectMode)\n return new CountQueuingStrategy({ highWaterMark });\n return { highWaterMark };\n })(options\?.strategy);\n let controller;\n function onData(chunk) {\n if (controller.enqueue(chunk), controller.desiredSize <= 0)\n streamReadable.pause();\n }\n streamReadable.pause();\n const cleanup = eos(streamReadable, (error) => {\n if (error\?.code === \"ERR_STREAM_PREMATURE_CLOSE\")\n error = new AbortError(void 0, { cause: error });\n if (cleanup(), streamReadable.on(\"error\", () => {\n }), error)\n return controller.error(error);\n controller.close();\n });\n return streamReadable.on(\"data\", onData), new ReadableStream({\n start(c) {\n controller = c;\n },\n pull() {\n streamReadable.resume();\n },\n cancel(reason) {\n destroy(streamReadable, reason);\n }\n }, strategy);\n }\n };\n Readable.fromWeb = function(readableStream, options) {\n return webStreamsAdapters.newStreamReadableFromReadableStream(readableStream, options);\n }, Readable.toWeb = function(streamReadable, options) {\n return webStreamsAdapters.newReadableStreamFromStreamReadable(streamReadable, options);\n }, Readable.wrap = function(src, options) {\n var _ref, _src$readableObjectMo;\n return new Readable({\n objectMode: (_ref = (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== void 0 \? _src$readableObjectMo : src.objectMode) !== null && _ref !== void 0 \? _ref : !0,\n ...options,\n destroy(err, callback) {\n destroyImpl.destroyer(src, err), callback(err);\n }\n }).wrap(src);\n };\n }\n}), require_writable = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/writable.js\"(exports, module) {\n var {\n ArrayPrototypeSlice,\n Error: Error2,\n FunctionPrototypeSymbolHasInstance,\n ObjectDefineProperty,\n ObjectDefineProperties,\n ObjectSetPrototypeOf,\n StringPrototypeToLowerCase,\n Symbol: Symbol2,\n SymbolHasInstance\n } = require_primordials(), Stream = require_legacy().Stream, destroyImpl = require_destroy(), { addAbortSignal } = require_add_abort_signal(), { getHighWaterMark, getDefaultHighWaterMark } = require_state(), {\n ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK,\n ERR_STREAM_CANNOT_PIPE,\n ERR_STREAM_DESTROYED,\n ERR_STREAM_ALREADY_FINISHED,\n ERR_STREAM_NULL_VALUES,\n ERR_STREAM_WRITE_AFTER_END,\n ERR_UNKNOWN_ENCODING\n } = require_errors().codes, { errorOrDestroy: errorOrDestroy2 } = destroyImpl;\n function Writable(options = {}) {\n const isDuplex = this instanceof require_duplex();\n if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable, this))\n return new Writable(options);\n if (this._writableState = new WritableState(options, this, isDuplex), options) {\n if (typeof options.write === \"function\")\n this._write = options.write;\n if (typeof options.writev === \"function\")\n this._writev = options.writev;\n if (typeof options.destroy === \"function\")\n this._destroy = options.destroy;\n if (typeof options.final === \"function\")\n this._final = options.final;\n if (typeof options.construct === \"function\")\n this._construct = options.construct;\n if (options.signal)\n addAbortSignal(options.signal, this);\n }\n Stream.call(this, options), destroyImpl.construct(this, () => {\n const state = this._writableState;\n if (!state.writing)\n clearBuffer(this, state);\n finishMaybe(this, state);\n });\n }\n Writable.prototype = {}, ObjectSetPrototypeOf(Writable.prototype, Stream.prototype), ObjectSetPrototypeOf(Writable, Stream), module.exports = Writable;\n function nop() {\n }\n var kOnFinished = Symbol2(\"kOnFinished\");\n function WritableState(options, stream, isDuplex) {\n if (typeof isDuplex !== \"boolean\")\n isDuplex = stream instanceof require_duplex();\n if (this.objectMode = !!(options && options.objectMode), isDuplex)\n this.objectMode = this.objectMode || !!(options && options.writableObjectMode);\n this.highWaterMark = options \? getHighWaterMark(this, options, \"writableHighWaterMark\", isDuplex) : getDefaultHighWaterMark(!1), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;\n const noDecode = !!(options && options.decodeStrings === !1);\n this.decodeStrings = !noDecode, this.defaultEncoding = options && options.defaultEncoding || \"utf8\", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = onwrite.bind(void 0, stream), this.writecb = null, this.writelen = 0, this.afterWriteTickInfo = null, resetBuffer(this), this.pendingcb = 0, this.constructed = !0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = !options || options.emitClose !== !1, this.autoDestroy = !options || options.autoDestroy !== !1, this.errored = null, this.closed = !1, this.closeEmitted = !1, this[kOnFinished] = [];\n }\n WritableState.prototype = {};\n function resetBuffer(state) {\n state.buffered = [], state.bufferedIndex = 0, state.allBuffers = !0, state.allNoop = !0;\n }\n WritableState.prototype.getBuffer = function getBuffer() {\n return ArrayPrototypeSlice(this.buffered, this.bufferedIndex);\n }, ObjectDefineProperty(WritableState.prototype, \"bufferedRequestCount\", {\n get() {\n return this.buffered.length - this.bufferedIndex;\n }\n }), ObjectDefineProperty(Writable, SymbolHasInstance, {\n value: function(object) {\n if (FunctionPrototypeSymbolHasInstance(this, object))\n return !0;\n if (this !== Writable)\n return !1;\n return object && object._writableState instanceof WritableState;\n }\n }), Writable.prototype.pipe = function() {\n errorOrDestroy2(this, new ERR_STREAM_CANNOT_PIPE);\n };\n function _write(stream, chunk, encoding, cb) {\n const state = stream._writableState;\n if (typeof encoding === \"function\")\n cb = encoding, encoding = state.defaultEncoding;\n else {\n if (!encoding)\n encoding = state.defaultEncoding;\n else if (encoding !== \"buffer\" && !Buffer.isEncoding(encoding))\n throw new ERR_UNKNOWN_ENCODING(encoding);\n if (typeof cb !== \"function\")\n cb = nop;\n }\n if (chunk === null)\n throw new ERR_STREAM_NULL_VALUES;\n else if (!state.objectMode)\n if (typeof chunk === \"string\") {\n if (state.decodeStrings !== !1)\n chunk = Buffer.from(chunk, encoding), encoding = \"buffer\";\n } else if (chunk instanceof Buffer)\n encoding = \"buffer\";\n else if (Stream._isUint8Array(chunk))\n chunk = Stream._uint8ArrayToBuffer(chunk), encoding = \"buffer\";\n else\n throw new ERR_INVALID_ARG_TYPE2(\"chunk\", [\"string\", \"Buffer\", \"Uint8Array\"], chunk);\n let err;\n if (state.ending)\n err = new ERR_STREAM_WRITE_AFTER_END;\n else if (state.destroyed)\n err = new ERR_STREAM_DESTROYED(\"write\");\n if (err)\n return runOnNextTick(cb, err), errorOrDestroy2(stream, err, !0), err;\n return state.pendingcb++, writeOrBuffer(stream, state, chunk, encoding, cb);\n }\n Writable.prototype.write = function(chunk, encoding, cb) {\n return _write(this, chunk, encoding, cb) === !0;\n }, Writable.prototype.cork = function() {\n this._writableState.corked++;\n }, Writable.prototype.uncork = function() {\n const state = this._writableState;\n if (state.corked) {\n if (state.corked--, !state.writing)\n clearBuffer(this, state);\n }\n }, Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n if (typeof encoding === \"string\")\n encoding = StringPrototypeToLowerCase(encoding);\n if (!Buffer.isEncoding(encoding))\n throw new ERR_UNKNOWN_ENCODING(encoding);\n return this._writableState.defaultEncoding = encoding, this;\n };\n function writeOrBuffer(stream, state, chunk, encoding, callback) {\n const len = state.objectMode \? 1 : chunk.length;\n state.length += len;\n const ret = state.length < state.highWaterMark;\n if (!ret)\n state.needDrain = !0;\n if (state.writing || state.corked || state.errored || !state.constructed) {\n if (state.buffered.push({\n chunk,\n encoding,\n callback\n }), state.allBuffers && encoding !== \"buffer\")\n state.allBuffers = !1;\n if (state.allNoop && callback !== nop)\n state.allNoop = !1;\n } else\n state.writelen = len, state.writecb = callback, state.writing = !0, state.sync = !0, stream._write(chunk, encoding, state.onwrite), state.sync = !1;\n return ret && !state.errored && !state.destroyed;\n }\n function doWrite(stream, state, writev, len, chunk, encoding, cb) {\n if (state.writelen = len, state.writecb = cb, state.writing = !0, state.sync = !0, state.destroyed)\n state.onwrite(new ERR_STREAM_DESTROYED(\"write\"));\n else if (writev)\n stream._writev(chunk, state.onwrite);\n else\n stream._write(chunk, encoding, state.onwrite);\n state.sync = !1;\n }\n function onwriteError(stream, state, er, cb) {\n --state.pendingcb, cb(er), errorBuffer(state), errorOrDestroy2(stream, er);\n }\n function onwrite(stream, er) {\n const state = stream._writableState, sync = state.sync, cb = state.writecb;\n if (typeof cb !== \"function\") {\n errorOrDestroy2(stream, new ERR_MULTIPLE_CALLBACK);\n return;\n }\n if (state.writing = !1, state.writecb = null, state.length -= state.writelen, state.writelen = 0, er) {\n if (Error.captureStackTrace(er), !state.errored)\n state.errored = er;\n if (stream._readableState && !stream._readableState.errored)\n stream._readableState.errored = er;\n if (sync)\n runOnNextTick(onwriteError, stream, state, er, cb);\n else\n onwriteError(stream, state, er, cb);\n } else {\n if (state.buffered.length > state.bufferedIndex)\n clearBuffer(stream, state);\n if (sync)\n if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb)\n state.afterWriteTickInfo.count++;\n else\n state.afterWriteTickInfo = {\n count: 1,\n cb,\n stream,\n state\n }, runOnNextTick(afterWriteTick, state.afterWriteTickInfo);\n else\n afterWrite(stream, state, 1, cb);\n }\n }\n function afterWriteTick({ stream, state, count, cb }) {\n return state.afterWriteTickInfo = null, afterWrite(stream, state, count, cb);\n }\n function afterWrite(stream, state, count, cb) {\n if (!state.ending && !stream.destroyed && state.length === 0 && state.needDrain)\n state.needDrain = !1, stream.emit(\"drain\");\n while (count-- > 0)\n state.pendingcb--, cb();\n if (state.destroyed)\n errorBuffer(state);\n finishMaybe(stream, state);\n }\n function errorBuffer(state) {\n if (state.writing)\n return;\n for (let n = state.bufferedIndex;n < state.buffered.length; ++n) {\n var _state$errored;\n const { chunk, callback } = state.buffered[n], len = state.objectMode \? 1 : chunk.length;\n state.length -= len, callback((_state$errored = state.errored) !== null && _state$errored !== void 0 \? _state$errored : new ERR_STREAM_DESTROYED(\"write\"));\n }\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++) {\n var _state$errored2;\n onfinishCallbacks[i]((_state$errored2 = state.errored) !== null && _state$errored2 !== void 0 \? _state$errored2 : new ERR_STREAM_DESTROYED(\"end\"));\n }\n resetBuffer(state);\n }\n function clearBuffer(stream, state) {\n if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed)\n return;\n const { buffered, bufferedIndex, objectMode } = state, bufferedLength = buffered.length - bufferedIndex;\n if (!bufferedLength)\n return;\n let i = bufferedIndex;\n if (state.bufferProcessing = !0, bufferedLength > 1 && stream._writev) {\n state.pendingcb -= bufferedLength - 1;\n const callback = state.allNoop \? nop : (err) => {\n for (let n = i;n < buffered.length; ++n)\n buffered[n].callback(err);\n }, chunks = state.allNoop && i === 0 \? buffered : ArrayPrototypeSlice(buffered, i);\n chunks.allBuffers = state.allBuffers, doWrite(stream, state, !0, state.length, chunks, \"\", callback), resetBuffer(state);\n } else {\n do {\n const { chunk, encoding, callback } = buffered[i];\n buffered[i++] = null;\n const len = objectMode \? 1 : chunk.length;\n doWrite(stream, state, !1, len, chunk, encoding, callback);\n } while (i < buffered.length && !state.writing);\n if (i === buffered.length)\n resetBuffer(state);\n else if (i > 256)\n buffered.splice(0, i), state.bufferedIndex = 0;\n else\n state.bufferedIndex = i;\n }\n state.bufferProcessing = !1;\n }\n Writable.prototype._write = function(chunk, encoding, cb) {\n if (this._writev)\n this._writev([\n {\n chunk,\n encoding\n }\n ], cb);\n else\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_write()\");\n }, Writable.prototype._writev = null, Writable.prototype.end = function(chunk, encoding, cb, native = !1) {\n const state = this._writableState;\n if (typeof chunk === \"function\")\n cb = chunk, chunk = null, encoding = null;\n else if (typeof encoding === \"function\")\n cb = encoding, encoding = null;\n let err;\n if (chunk !== null && chunk !== void 0) {\n let ret;\n if (!native)\n ret = _write(this, chunk, encoding);\n else\n ret = this.write(chunk, encoding);\n if (ret instanceof Error2)\n err = ret;\n }\n if (state.corked)\n state.corked = 1, this.uncork();\n if (err)\n this.emit(\"error\", err);\n else if (!state.errored && !state.ending)\n state.ending = !0, finishMaybe(this, state, !0), state.ended = !0;\n else if (state.finished)\n err = new ERR_STREAM_ALREADY_FINISHED(\"end\");\n else if (state.destroyed)\n err = new ERR_STREAM_DESTROYED(\"end\");\n if (typeof cb === \"function\")\n if (err || state.finished)\n runOnNextTick(cb, err);\n else\n state[kOnFinished].push(cb);\n return this;\n };\n function needFinish(state, tag) {\n var needFinish2 = state.ending && !state.destroyed && state.constructed && state.length === 0 && !state.errored && state.buffered.length === 0 && !state.finished && !state.writing && !state.errorEmitted && !state.closeEmitted;\n return needFinish2;\n }\n function callFinal(stream, state) {\n let called = !1;\n function onFinish(err) {\n if (called) {\n errorOrDestroy2(stream, err !== null && err !== void 0 \? err : ERR_MULTIPLE_CALLBACK());\n return;\n }\n if (called = !0, state.pendingcb--, err) {\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++)\n onfinishCallbacks[i](err);\n errorOrDestroy2(stream, err, state.sync);\n } else if (needFinish(state))\n state.prefinished = !0, stream.emit(\"prefinish\"), state.pendingcb++, runOnNextTick(finish, stream, state);\n }\n state.sync = !0, state.pendingcb++;\n try {\n stream._final(onFinish);\n } catch (err) {\n onFinish(err);\n }\n state.sync = !1;\n }\n function prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled)\n if (typeof stream._final === \"function\" && !state.destroyed)\n state.finalCalled = !0, callFinal(stream, state);\n else\n state.prefinished = !0, stream.emit(\"prefinish\");\n }\n function finishMaybe(stream, state, sync) {\n if (!needFinish(state, stream.__id))\n return;\n if (prefinish(stream, state), state.pendingcb === 0) {\n if (sync)\n state.pendingcb++, runOnNextTick((stream2, state2) => {\n if (needFinish(state2))\n finish(stream2, state2);\n else\n state2.pendingcb--;\n }, stream, state);\n else if (needFinish(state))\n state.pendingcb++, finish(stream, state);\n }\n }\n function finish(stream, state) {\n state.pendingcb--, state.finished = !0;\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++)\n onfinishCallbacks[i]();\n if (stream.emit(\"finish\"), state.autoDestroy) {\n const rState = stream._readableState;\n if (!rState || rState.autoDestroy && (rState.endEmitted || rState.readable === !1))\n stream.destroy();\n }\n }\n ObjectDefineProperties(Writable.prototype, {\n closed: {\n get() {\n return this._writableState \? this._writableState.closed : !1;\n }\n },\n destroyed: {\n get() {\n return this._writableState \? this._writableState.destroyed : !1;\n },\n set(value) {\n if (this._writableState)\n this._writableState.destroyed = value;\n }\n },\n writable: {\n get() {\n const w = this._writableState;\n return !!w && w.writable !== !1 && !w.destroyed && !w.errored && !w.ending && !w.ended;\n },\n set(val) {\n if (this._writableState)\n this._writableState.writable = !!val;\n }\n },\n writableFinished: {\n get() {\n return this._writableState \? this._writableState.finished : !1;\n }\n },\n writableObjectMode: {\n get() {\n return this._writableState \? this._writableState.objectMode : !1;\n }\n },\n writableBuffer: {\n get() {\n return this._writableState && this._writableState.getBuffer();\n }\n },\n writableEnded: {\n get() {\n return this._writableState \? this._writableState.ending : !1;\n }\n },\n writableNeedDrain: {\n get() {\n const wState = this._writableState;\n if (!wState)\n return !1;\n return !wState.destroyed && !wState.ending && wState.needDrain;\n }\n },\n writableHighWaterMark: {\n get() {\n return this._writableState && this._writableState.highWaterMark;\n }\n },\n writableCorked: {\n get() {\n return this._writableState \? this._writableState.corked : 0;\n }\n },\n writableLength: {\n get() {\n return this._writableState && this._writableState.length;\n }\n },\n errored: {\n enumerable: !1,\n get() {\n return this._writableState \? this._writableState.errored : null;\n }\n },\n writableAborted: {\n enumerable: !1,\n get: function() {\n return !!(this._writableState.writable !== !1 && (this._writableState.destroyed || this._writableState.errored) && !this._writableState.finished);\n }\n }\n });\n var destroy2 = destroyImpl.destroy;\n Writable.prototype.destroy = function(err, cb) {\n const state = this._writableState;\n if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length))\n runOnNextTick(errorBuffer, state);\n return destroy2.call(this, err, cb), this;\n }, Writable.prototype._undestroy = destroyImpl.undestroy, Writable.prototype._destroy = function(err, cb) {\n cb(err);\n }, Writable.prototype[EE.captureRejectionSymbol] = function(err) {\n this.destroy(err);\n };\n var webStreamsAdapters;\n function lazyWebStreams() {\n if (webStreamsAdapters === void 0)\n webStreamsAdapters = {};\n return webStreamsAdapters;\n }\n Writable.fromWeb = function(writableStream, options) {\n return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options);\n }, Writable.toWeb = function(streamWritable) {\n return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable);\n };\n }\n}), require_duplexify = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/duplexify.js\"(exports, module) {\n var {\n isReadable,\n isWritable,\n isIterable,\n isNodeStream,\n isReadableNodeStream,\n isWritableNodeStream,\n isDuplexNodeStream\n } = require_utils(), eos = require_end_of_stream(), {\n AbortError: AbortError2,\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_RETURN_VALUE }\n } = require_errors(), { destroyer } = require_destroy(), Duplex = require_duplex(), Readable = require_readable(), { createDeferredPromise } = require_util(), from = require_from(), isBlob = typeof Blob !== \"undefined\" \? function isBlob2(b) {\n return b instanceof Blob;\n } : function isBlob2(b) {\n return !1;\n }, { FunctionPrototypeCall } = require_primordials();\n\n class Duplexify extends Duplex {\n constructor(options) {\n super(options);\n if ((options === null || options === void 0 \? void 0 : options.readable) === !1)\n this._readableState.readable = !1, this._readableState.ended = !0, this._readableState.endEmitted = !0;\n if ((options === null || options === void 0 \? void 0 : options.writable) === !1)\n this._writableState.writable = !1, this._writableState.ending = !0, this._writableState.ended = !0, this._writableState.finished = !0;\n }\n }\n module.exports = function duplexify(body, name) {\n if (isDuplexNodeStream(body))\n return body;\n if (isReadableNodeStream(body))\n return _duplexify({\n readable: body\n });\n if (isWritableNodeStream(body))\n return _duplexify({\n writable: body\n });\n if (isNodeStream(body))\n return _duplexify({\n writable: !1,\n readable: !1\n });\n if (typeof body === \"function\") {\n const { value, write, final, destroy: destroy2 } = fromAsyncGen(body);\n if (isIterable(value))\n return from(Duplexify, value, {\n objectMode: !0,\n write,\n final,\n destroy: destroy2\n });\n const then2 = value === null || value === void 0 \? void 0 : value.then;\n if (typeof then2 === \"function\") {\n let d;\n const promise = FunctionPrototypeCall(then2, value, (val) => {\n if (val != null)\n throw new ERR_INVALID_RETURN_VALUE(\"nully\", \"body\", val);\n }, (err) => {\n destroyer(d, err);\n });\n return d = new Duplexify({\n objectMode: !0,\n readable: !1,\n write,\n final(cb) {\n final(async () => {\n try {\n await promise, runOnNextTick(cb, null);\n } catch (err) {\n runOnNextTick(cb, err);\n }\n });\n },\n destroy: destroy2\n });\n }\n throw new ERR_INVALID_RETURN_VALUE(\"Iterable, AsyncIterable or AsyncFunction\", name, value);\n }\n if (isBlob(body))\n return duplexify(body.arrayBuffer());\n if (isIterable(body))\n return from(Duplexify, body, {\n objectMode: !0,\n writable: !1\n });\n if (typeof (body === null || body === void 0 \? void 0 : body.writable) === \"object\" || typeof (body === null || body === void 0 \? void 0 : body.readable) === \"object\") {\n const readable = body !== null && body !== void 0 && body.readable \? isReadableNodeStream(body === null || body === void 0 \? void 0 : body.readable) \? body === null || body === void 0 \? void 0 : body.readable : duplexify(body.readable) : void 0, writable = body !== null && body !== void 0 && body.writable \? isWritableNodeStream(body === null || body === void 0 \? void 0 : body.writable) \? body === null || body === void 0 \? void 0 : body.writable : duplexify(body.writable) : void 0;\n return _duplexify({\n readable,\n writable\n });\n }\n const then = body === null || body === void 0 \? void 0 : body.then;\n if (typeof then === \"function\") {\n let d;\n return FunctionPrototypeCall(then, body, (val) => {\n if (val != null)\n d.push(val);\n d.push(null);\n }, (err) => {\n destroyer(d, err);\n }), d = new Duplexify({\n objectMode: !0,\n writable: !1,\n read() {\n }\n });\n }\n throw new ERR_INVALID_ARG_TYPE2(name, [\n \"Blob\",\n \"ReadableStream\",\n \"WritableStream\",\n \"Stream\",\n \"Iterable\",\n \"AsyncIterable\",\n \"Function\",\n \"{ readable, writable } pair\",\n \"Promise\"\n ], body);\n };\n function fromAsyncGen(fn) {\n let { promise, resolve } = createDeferredPromise();\n const ac = new AbortController, signal = ac.signal;\n return {\n value: fn(async function* () {\n while (!0) {\n const _promise = promise;\n promise = null;\n const { chunk, done, cb } = await _promise;\n if (runOnNextTick(cb), done)\n return;\n if (signal.aborted)\n throw new AbortError2(void 0, {\n cause: signal.reason\n });\n ({ promise, resolve } = createDeferredPromise()), yield chunk;\n }\n }(), {\n signal\n }),\n write(chunk, encoding, cb) {\n const _resolve = resolve;\n resolve = null, _resolve({\n chunk,\n done: !1,\n cb\n });\n },\n final(cb) {\n const _resolve = resolve;\n resolve = null, _resolve({\n done: !0,\n cb\n });\n },\n destroy(err, cb) {\n ac.abort(), cb(err);\n }\n };\n }\n function _duplexify(pair) {\n const r = pair.readable && typeof pair.readable.read !== \"function\" \? Readable.wrap(pair.readable) : pair.readable, w = pair.writable;\n let readable = !!isReadable(r), writable = !!isWritable(w), ondrain, onfinish, onreadable, onclose, d;\n function onfinished(err) {\n const cb = onclose;\n if (onclose = null, cb)\n cb(err);\n else if (err)\n d.destroy(err);\n else if (!readable && !writable)\n d.destroy();\n }\n if (d = new Duplexify({\n readableObjectMode: !!(r !== null && r !== void 0 && r.readableObjectMode),\n writableObjectMode: !!(w !== null && w !== void 0 && w.writableObjectMode),\n readable,\n writable\n }), writable)\n eos(w, (err) => {\n if (writable = !1, err)\n destroyer(r, err);\n onfinished(err);\n }), d._write = function(chunk, encoding, callback) {\n if (w.write(chunk, encoding))\n callback();\n else\n ondrain = callback;\n }, d._final = function(callback) {\n w.end(), onfinish = callback;\n }, w.on(\"drain\", function() {\n if (ondrain) {\n const cb = ondrain;\n ondrain = null, cb();\n }\n }), w.on(\"finish\", function() {\n if (onfinish) {\n const cb = onfinish;\n onfinish = null, cb();\n }\n });\n if (readable)\n eos(r, (err) => {\n if (readable = !1, err)\n destroyer(r, err);\n onfinished(err);\n }), r.on(\"readable\", function() {\n if (onreadable) {\n const cb = onreadable;\n onreadable = null, cb();\n }\n }), r.on(\"end\", function() {\n d.push(null);\n }), d._read = function() {\n while (!0) {\n const buf = r.read();\n if (buf === null) {\n onreadable = d._read;\n return;\n }\n if (!d.push(buf))\n return;\n }\n };\n return d._destroy = function(err, callback) {\n if (!err && onclose !== null)\n err = new AbortError2;\n if (onreadable = null, ondrain = null, onfinish = null, onclose === null)\n callback(err);\n else\n onclose = callback, destroyer(w, err), destroyer(r, err);\n }, d;\n }\n }\n}), require_duplex = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/duplex.js\"(exports, module) {\n var { ObjectDefineProperties, ObjectGetOwnPropertyDescriptor, ObjectKeys, ObjectSetPrototypeOf } = require_primordials(), Readable = require_readable();\n function Duplex(options) {\n if (!(this instanceof Duplex))\n return new Duplex(options);\n if (Readable.call(this, options), Writable.call(this, options), options) {\n if (this.allowHalfOpen = options.allowHalfOpen !== !1, options.readable === !1)\n this._readableState.readable = !1, this._readableState.ended = !0, this._readableState.endEmitted = !0;\n if (options.writable === !1)\n this._writableState.writable = !1, this._writableState.ending = !0, this._writableState.ended = !0, this._writableState.finished = !0;\n } else\n this.allowHalfOpen = !0;\n }\n Duplex.prototype = {}, module.exports = Duplex, ObjectSetPrototypeOf(Duplex.prototype, Readable.prototype), ObjectSetPrototypeOf(Duplex, Readable);\n for (var method in Writable.prototype)\n if (!Duplex.prototype[method])\n Duplex.prototype[method] = Writable.prototype[method];\n ObjectDefineProperties(Duplex.prototype, {\n writable: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writable\"),\n writableHighWaterMark: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableHighWaterMark\"),\n writableObjectMode: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableObjectMode\"),\n writableBuffer: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableBuffer\"),\n writableLength: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableLength\"),\n writableFinished: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableFinished\"),\n writableCorked: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableCorked\"),\n writableEnded: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableEnded\"),\n writableNeedDrain: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableNeedDrain\"),\n destroyed: {\n get() {\n if (this._readableState === void 0 || this._writableState === void 0)\n return !1;\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set(value) {\n if (this._readableState && this._writableState)\n this._readableState.destroyed = value, this._writableState.destroyed = value;\n }\n }\n });\n var webStreamsAdapters;\n function lazyWebStreams() {\n if (webStreamsAdapters === void 0)\n webStreamsAdapters = {};\n return webStreamsAdapters;\n }\n Duplex.fromWeb = function(pair, options) {\n return lazyWebStreams().newStreamDuplexFromReadableWritablePair(pair, options);\n }, Duplex.toWeb = function(duplex) {\n return lazyWebStreams().newReadableWritablePairFromDuplex(duplex);\n };\n var duplexify;\n Duplex.from = function(body) {\n if (!duplexify)\n duplexify = require_duplexify();\n return duplexify(body, \"body\");\n };\n }\n}), require_transform = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/transform.js\"(exports, module) {\n var { ObjectSetPrototypeOf, Symbol: Symbol2 } = require_primordials(), { ERR_METHOD_NOT_IMPLEMENTED } = require_errors().codes, Duplex = require_duplex();\n function Transform(options) {\n if (!(this instanceof Transform))\n return new Transform(options);\n if (Duplex.call(this, options), this._readableState.sync = !1, this[kCallback] = null, options) {\n if (typeof options.transform === \"function\")\n this._transform = options.transform;\n if (typeof options.flush === \"function\")\n this._flush = options.flush;\n }\n this.on(\"prefinish\", prefinish.bind(this));\n }\n Transform.prototype = {}, ObjectSetPrototypeOf(Transform.prototype, Duplex.prototype), ObjectSetPrototypeOf(Transform, Duplex), module.exports = Transform;\n var kCallback = Symbol2(\"kCallback\");\n function final(cb) {\n if (typeof this._flush === \"function\" && !this.destroyed)\n this._flush((er, data) => {\n if (er) {\n if (cb)\n cb(er);\n else\n this.destroy(er);\n return;\n }\n if (data != null)\n this.push(data);\n if (this.push(null), cb)\n cb();\n });\n else if (this.push(null), cb)\n cb();\n }\n function prefinish() {\n if (this._final !== final)\n final.call(this);\n }\n Transform.prototype._final = final, Transform.prototype._transform = function(chunk, encoding, callback) {\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_transform()\");\n }, Transform.prototype._write = function(chunk, encoding, callback) {\n const rState = this._readableState, wState = this._writableState, length = rState.length;\n this._transform(chunk, encoding, (err, val) => {\n if (err) {\n callback(err);\n return;\n }\n if (val != null)\n this.push(val);\n if (wState.ended || length === rState.length || rState.length < rState.highWaterMark || rState.highWaterMark === 0 || rState.length === 0)\n callback();\n else\n this[kCallback] = callback;\n });\n }, Transform.prototype._read = function() {\n if (this[kCallback]) {\n const callback = this[kCallback];\n this[kCallback] = null, callback();\n }\n };\n }\n}), require_passthrough = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/passthrough.js\"(exports, module) {\n var { ObjectSetPrototypeOf } = require_primordials(), Transform = require_transform();\n function PassThrough(options) {\n if (!(this instanceof PassThrough))\n return new PassThrough(options);\n Transform.call(this, options);\n }\n PassThrough.prototype = {}, ObjectSetPrototypeOf(PassThrough.prototype, Transform.prototype), ObjectSetPrototypeOf(PassThrough, Transform), PassThrough.prototype._transform = function(chunk, encoding, cb) {\n cb(null, chunk);\n }, module.exports = PassThrough;\n }\n}), require_pipeline = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/pipeline.js\"(exports, module) {\n var { ArrayIsArray: ArrayIsArray2, Promise: Promise2, SymbolAsyncIterator } = require_primordials(), eos = require_end_of_stream(), { once } = require_util(), destroyImpl = require_destroy(), Duplex = require_duplex(), {\n aggregateTwoErrors,\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS, ERR_STREAM_DESTROYED },\n AbortError: AbortError2\n } = require_errors(), { validateFunction, validateAbortSignal } = require_validators(), { isIterable, isReadable, isReadableNodeStream, isNodeStream } = require_utils(), PassThrough, Readable;\n function destroyer(stream, reading, writing) {\n let finished = !1;\n stream.on(\"close\", () => {\n finished = !0;\n });\n const cleanup = eos(stream, {\n readable: reading,\n writable: writing\n }, (err) => {\n finished = !err;\n });\n return {\n destroy: (err) => {\n if (finished)\n return;\n finished = !0, destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED(\"pipe\"));\n },\n cleanup\n };\n }\n function popCallback(streams) {\n return validateFunction(streams[streams.length - 1], \"streams[stream.length - 1]\"), streams.pop();\n }\n function makeAsyncIterable(val) {\n if (isIterable(val))\n return val;\n else if (isReadableNodeStream(val))\n return fromReadable(val);\n throw new ERR_INVALID_ARG_TYPE2(\"val\", [\"Readable\", \"Iterable\", \"AsyncIterable\"], val);\n }\n async function* fromReadable(val) {\n if (!Readable)\n Readable = require_readable();\n yield* Readable.prototype[SymbolAsyncIterator].call(val);\n }\n async function pump(iterable, writable, finish, { end }) {\n let error, onresolve = null;\n const resume = (err) => {\n if (err)\n error = err;\n if (onresolve) {\n const callback = onresolve;\n onresolve = null, callback();\n }\n }, wait = () => new Promise2((resolve, reject) => {\n if (error)\n reject(error);\n else\n onresolve = () => {\n if (error)\n reject(error);\n else\n resolve();\n };\n });\n writable.on(\"drain\", resume);\n const cleanup = eos(writable, {\n readable: !1\n }, resume);\n try {\n if (writable.writableNeedDrain)\n await wait();\n for await (let chunk of iterable)\n if (!writable.write(chunk))\n await wait();\n if (end)\n writable.end();\n await wait(), finish();\n } catch (err) {\n finish(error !== err \? aggregateTwoErrors(error, err) : err);\n } finally {\n cleanup(), writable.off(\"drain\", resume);\n }\n }\n function pipeline(...streams) {\n return pipelineImpl(streams, once(popCallback(streams)));\n }\n function pipelineImpl(streams, callback, opts) {\n if (streams.length === 1 && ArrayIsArray2(streams[0]))\n streams = streams[0];\n if (streams.length < 2)\n throw new ERR_MISSING_ARGS(\"streams\");\n const ac = new AbortController, signal = ac.signal, outerSignal = opts === null || opts === void 0 \? void 0 : opts.signal, lastStreamCleanup = [];\n validateAbortSignal(outerSignal, \"options.signal\");\n function abort() {\n finishImpl(new AbortError2);\n }\n outerSignal === null || outerSignal === void 0 || outerSignal.addEventListener(\"abort\", abort);\n let error, value;\n const destroys = [];\n let finishCount = 0;\n function finish(err) {\n finishImpl(err, --finishCount === 0);\n }\n function finishImpl(err, final) {\n if (err && (!error || error.code === \"ERR_STREAM_PREMATURE_CLOSE\"))\n error = err;\n if (!error && !final)\n return;\n while (destroys.length)\n destroys.shift()(error);\n if (outerSignal === null || outerSignal === void 0 || outerSignal.removeEventListener(\"abort\", abort), ac.abort(), final) {\n if (!error)\n lastStreamCleanup.forEach((fn) => fn());\n runOnNextTick(callback, error, value);\n }\n }\n let ret;\n for (let i = 0;i < streams.length; i++) {\n const stream = streams[i], reading = i < streams.length - 1, writing = i > 0, end = reading || (opts === null || opts === void 0 \? void 0 : opts.end) !== !1, isLastStream = i === streams.length - 1;\n if (isNodeStream(stream)) {\n let onError = function(err) {\n if (err && err.name !== \"AbortError\" && err.code !== \"ERR_STREAM_PREMATURE_CLOSE\")\n finish(err);\n };\n if (end) {\n const { destroy: destroy2, cleanup } = destroyer(stream, reading, writing);\n if (destroys.push(destroy2), isReadable(stream) && isLastStream)\n lastStreamCleanup.push(cleanup);\n }\n if (stream.on(\"error\", onError), isReadable(stream) && isLastStream)\n lastStreamCleanup.push(() => {\n stream.removeListener(\"error\", onError);\n });\n }\n if (i === 0)\n if (typeof stream === \"function\") {\n if (ret = stream({\n signal\n }), !isIterable(ret))\n throw new ERR_INVALID_RETURN_VALUE(\"Iterable, AsyncIterable or Stream\", \"source\", ret);\n } else if (isIterable(stream) || isReadableNodeStream(stream))\n ret = stream;\n else\n ret = Duplex.from(stream);\n else if (typeof stream === \"function\")\n if (ret = makeAsyncIterable(ret), ret = stream(ret, {\n signal\n }), reading) {\n if (!isIterable(ret, !0))\n throw new ERR_INVALID_RETURN_VALUE(\"AsyncIterable\", `transform[${i - 1}]`, ret);\n } else {\n var _ret;\n if (!PassThrough)\n PassThrough = require_passthrough();\n const pt = new PassThrough({\n objectMode: !0\n }), then = (_ret = ret) === null || _ret === void 0 \? void 0 : _ret.then;\n if (typeof then === \"function\")\n finishCount++, then.call(ret, (val) => {\n if (value = val, val != null)\n pt.write(val);\n if (end)\n pt.end();\n runOnNextTick(finish);\n }, (err) => {\n pt.destroy(err), runOnNextTick(finish, err);\n });\n else if (isIterable(ret, !0))\n finishCount++, pump(ret, pt, finish, {\n end\n });\n else\n throw new ERR_INVALID_RETURN_VALUE(\"AsyncIterable or Promise\", \"destination\", ret);\n ret = pt;\n const { destroy: destroy2, cleanup } = destroyer(ret, !1, !0);\n if (destroys.push(destroy2), isLastStream)\n lastStreamCleanup.push(cleanup);\n }\n else if (isNodeStream(stream)) {\n if (isReadableNodeStream(ret)) {\n finishCount += 2;\n const cleanup = pipe(ret, stream, finish, {\n end\n });\n if (isReadable(stream) && isLastStream)\n lastStreamCleanup.push(cleanup);\n } else if (isIterable(ret))\n finishCount++, pump(ret, stream, finish, {\n end\n });\n else\n throw new ERR_INVALID_ARG_TYPE2(\"val\", [\"Readable\", \"Iterable\", \"AsyncIterable\"], ret);\n ret = stream;\n } else\n ret = Duplex.from(stream);\n }\n if (signal !== null && signal !== void 0 && signal.aborted || outerSignal !== null && outerSignal !== void 0 && outerSignal.aborted)\n runOnNextTick(abort);\n return ret;\n }\n function pipe(src, dst, finish, { end }) {\n if (src.pipe(dst, {\n end\n }), end)\n src.once(\"end\", () => dst.end());\n else\n finish();\n return eos(src, {\n readable: !0,\n writable: !1\n }, (err) => {\n const rState = src._readableState;\n if (err && err.code === \"ERR_STREAM_PREMATURE_CLOSE\" && rState && rState.ended && !rState.errored && !rState.errorEmitted)\n src.once(\"end\", finish).once(\"error\", finish);\n else\n finish(err);\n }), eos(dst, {\n readable: !1,\n writable: !0\n }, finish);\n }\n module.exports = {\n pipelineImpl,\n pipeline\n };\n }\n}), require_compose = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/compose.js\"(exports, module) {\n var { pipeline } = require_pipeline(), Duplex = require_duplex(), { destroyer } = require_destroy(), { isNodeStream, isReadable, isWritable } = require_utils(), {\n AbortError: AbortError2,\n codes: { ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, ERR_MISSING_ARGS }\n } = require_errors();\n module.exports = function compose(...streams) {\n if (streams.length === 0)\n throw new ERR_MISSING_ARGS(\"streams\");\n if (streams.length === 1)\n return Duplex.from(streams[0]);\n const orgStreams = [...streams];\n if (typeof streams[0] === \"function\")\n streams[0] = Duplex.from(streams[0]);\n if (typeof streams[streams.length - 1] === \"function\") {\n const idx = streams.length - 1;\n streams[idx] = Duplex.from(streams[idx]);\n }\n for (let n = 0;n < streams.length; ++n) {\n if (!isNodeStream(streams[n]))\n continue;\n if (n < streams.length - 1 && !isReadable(streams[n]))\n throw new ERR_INVALID_ARG_VALUE2(`streams[${n}]`, orgStreams[n], \"must be readable\");\n if (n > 0 && !isWritable(streams[n]))\n throw new ERR_INVALID_ARG_VALUE2(`streams[${n}]`, orgStreams[n], \"must be writable\");\n }\n let ondrain, onfinish, onreadable, onclose, d;\n function onfinished(err) {\n const cb = onclose;\n if (onclose = null, cb)\n cb(err);\n else if (err)\n d.destroy(err);\n else if (!readable && !writable)\n d.destroy();\n }\n const head = streams[0], tail = pipeline(streams, onfinished), writable = !!isWritable(head), readable = !!isReadable(tail);\n if (d = new Duplex({\n writableObjectMode: !!(head !== null && head !== void 0 && head.writableObjectMode),\n readableObjectMode: !!(tail !== null && tail !== void 0 && tail.writableObjectMode),\n writable,\n readable\n }), writable)\n d._write = function(chunk, encoding, callback) {\n if (head.write(chunk, encoding))\n callback();\n else\n ondrain = callback;\n }, d._final = function(callback) {\n head.end(), onfinish = callback;\n }, head.on(\"drain\", function() {\n if (ondrain) {\n const cb = ondrain;\n ondrain = null, cb();\n }\n }), tail.on(\"finish\", function() {\n if (onfinish) {\n const cb = onfinish;\n onfinish = null, cb();\n }\n });\n if (readable)\n tail.on(\"readable\", function() {\n if (onreadable) {\n const cb = onreadable;\n onreadable = null, cb();\n }\n }), tail.on(\"end\", function() {\n d.push(null);\n }), d._read = function() {\n while (!0) {\n const buf = tail.read();\n if (buf === null) {\n onreadable = d._read;\n return;\n }\n if (!d.push(buf))\n return;\n }\n };\n return d._destroy = function(err, callback) {\n if (!err && onclose !== null)\n err = new AbortError2;\n if (onreadable = null, ondrain = null, onfinish = null, onclose === null)\n callback(err);\n else\n onclose = callback, destroyer(tail, err);\n }, d;\n };\n }\n}), require_promises = __commonJS({\n \"node_modules/readable-stream/lib/stream/promises.js\"(exports, module) {\n var { ArrayPrototypePop, Promise: Promise2 } = require_primordials(), { isIterable, isNodeStream } = require_utils(), { pipelineImpl: pl } = require_pipeline(), { finished } = require_end_of_stream();\n function pipeline(...streams) {\n return new Promise2((resolve, reject) => {\n let signal, end;\n const lastArg = streams[streams.length - 1];\n if (lastArg && typeof lastArg === \"object\" && !isNodeStream(lastArg) && !isIterable(lastArg)) {\n const options = ArrayPrototypePop(streams);\n signal = options.signal, end = options.end;\n }\n pl(streams, (err, value) => {\n if (err)\n reject(err);\n else\n resolve(value);\n }, {\n signal,\n end\n });\n });\n }\n module.exports = {\n finished,\n pipeline\n };\n }\n}), require_stream = __commonJS({\n \"node_modules/readable-stream/lib/stream.js\"(exports, module) {\n var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials(), {\n promisify: { custom: customPromisify }\n } = require_util(), { streamReturningOperators, promiseReturningOperators } = require_operators(), {\n codes: { ERR_ILLEGAL_CONSTRUCTOR }\n } = require_errors(), compose = require_compose(), { pipeline } = require_pipeline(), { destroyer } = require_destroy(), eos = require_end_of_stream(), promises = require_promises(), utils = require_utils(), Stream = module.exports = require_legacy().Stream;\n Stream.isDisturbed = utils.isDisturbed, Stream.isErrored = utils.isErrored, Stream.isWritable = utils.isWritable, Stream.isReadable = utils.isReadable, Stream.Readable = require_readable();\n for (let key of ObjectKeys(streamReturningOperators)) {\n let fn = function(...args) {\n if (new.target)\n throw ERR_ILLEGAL_CONSTRUCTOR();\n return Stream.Readable.from(ReflectApply(op, this, args));\n };\n const op = streamReturningOperators[key];\n ObjectDefineProperty(fn, \"name\", {\n value: op.name\n }), ObjectDefineProperty(fn, \"length\", {\n value: op.length\n }), ObjectDefineProperty(Stream.Readable.prototype, key, {\n value: fn,\n enumerable: !1,\n configurable: !0,\n writable: !0\n });\n }\n for (let key of ObjectKeys(promiseReturningOperators)) {\n let fn = function(...args) {\n if (new.target)\n throw ERR_ILLEGAL_CONSTRUCTOR();\n return ReflectApply(op, this, args);\n };\n const op = promiseReturningOperators[key];\n ObjectDefineProperty(fn, \"name\", {\n value: op.name\n }), ObjectDefineProperty(fn, \"length\", {\n value: op.length\n }), ObjectDefineProperty(Stream.Readable.prototype, key, {\n value: fn,\n enumerable: !1,\n configurable: !0,\n writable: !0\n });\n }\n Stream.Writable = require_writable(), Stream.Duplex = require_duplex(), Stream.Transform = require_transform(), Stream.PassThrough = require_passthrough(), Stream.pipeline = pipeline;\n var { addAbortSignal } = require_add_abort_signal();\n Stream.addAbortSignal = addAbortSignal, Stream.finished = eos, Stream.destroy = destroyer, Stream.compose = compose, ObjectDefineProperty(Stream, \"promises\", {\n configurable: !0,\n enumerable: !0,\n get() {\n return promises;\n }\n }), ObjectDefineProperty(pipeline, customPromisify, {\n enumerable: !0,\n get() {\n return promises.pipeline;\n }\n }), ObjectDefineProperty(eos, customPromisify, {\n enumerable: !0,\n get() {\n return promises.finished;\n }\n }), Stream.Stream = Stream, Stream._isUint8Array = function isUint8Array(value) {\n return value instanceof Uint8Array;\n }, Stream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) {\n return new Buffer(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n };\n }\n}), nativeReadableStreamPrototypes = {\n 0: void 0,\n 1: void 0,\n 2: void 0,\n 3: void 0,\n 4: void 0,\n 5: void 0\n}, Writable = require_writable(), _pathOrFdOrSink = Symbol(\"pathOrFdOrSink\"), _fileSink = Symbol(\"fileSink\"), _native = Symbol(\"native\");\nNativeWritable.prototype = Object.create(Writable.prototype);\nvar WritablePrototypeWrite = Writable.prototype.write;\nNativeWritable.prototype.write = function NativeWritablePrototypeWrite(chunk, encoding, cb, native) {\n if (!(native \?\? this[_native]))\n return this[_native] = !1, WritablePrototypeWrite.call(this, chunk, encoding, cb);\n var fileSink = this[_fileSink] \?\? NativeWritable_lazyConstruct(this), result = fileSink.write(chunk);\n if (@isPromise(result))\n return result.then(() => {\n this.emit(\"drain\"), fileSink.flush(!0);\n }), !1;\n if (fileSink.flush(!0), cb)\n cb(null, chunk.byteLength);\n return !0;\n};\nvar WritablePrototypeEnd = Writable.prototype.end;\nNativeWritable.prototype.end = function end(chunk, encoding, cb, native) {\n return WritablePrototypeEnd.call(this, chunk, encoding, cb, native \?\? this[_native]);\n};\nNativeWritable.prototype.ref = function ref() {\n var sink = this[_fileSink];\n if (!sink)\n this.NativeWritable_lazyConstruct();\n sink.ref();\n};\nNativeWritable.prototype.unref = function unref() {\n this[_fileSink]\?.unref();\n};\nvar exports = require_stream(), promises = require_promises();\nexports._getNativeReadableStreamPrototype = getNativeReadableStreamPrototype;\nexports.NativeWritable = NativeWritable;\nObject.defineProperty(exports, \"promises\", {\n configurable: !0,\n enumerable: !0,\n get() {\n return promises;\n }\n});\nexports[Symbol.for(\"::bunternal::\")] = { _ReadableFromWeb, _ReadableFromWebForUndici };\nexports.eos = require_end_of_stream();\nexports.EventEmitter = EE;\nreturn exports})\n"_s;
+static constexpr ASCIILiteral NodeReplCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/repl.ts\nvar $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6);\n$ = {\n lines: [],\n context: globalThis,\n historyIndex: -1,\n cursor: 0,\n historySize: 1000,\n removeHistoryDuplicates: !1,\n crlfDelay: 100,\n completer: () => {\n throwNotImplemented(\"node:repl\");\n },\n history: [],\n _initialPrompt: \"> \",\n terminal: !0,\n input: new Proxy({}, {\n get() {\n throwNotImplemented(\"node:repl\");\n },\n has: () => !1,\n ownKeys: () => [],\n getOwnPropertyDescriptor: () => @undefined,\n set() {\n throwNotImplemented(\"node:repl\");\n }\n }),\n line: \"\",\n eval: () => {\n throwNotImplemented(\"node:repl\");\n },\n isCompletionEnabled: !0,\n escapeCodeTimeout: 500,\n tabSize: 8,\n breakEvalOnSigint: !0,\n useGlobal: !0,\n underscoreAssigned: !1,\n last: @undefined,\n _domain: @undefined,\n allowBlockingCompletions: !1,\n useColors: !0,\n output: new Proxy({}, {\n get() {\n throwNotImplemented(\"node:repl\");\n },\n has: () => !1,\n ownKeys: () => [],\n getOwnPropertyDescriptor: () => @undefined,\n set() {\n throwNotImplemented(\"node:repl\");\n }\n }),\n _builtinLibs: [\n \"bun\",\n \"ffi\",\n \"assert\",\n \"assert/strict\",\n \"async_hooks\",\n \"buffer\",\n \"child_process\",\n \"cluster\",\n \"console\",\n \"constants\",\n \"crypto\",\n \"dgram\",\n \"diagnostics_channel\",\n \"dns\",\n \"dns/promises\",\n \"domain\",\n \"events\",\n \"fs\",\n \"fs/promises\",\n \"http\",\n \"http2\",\n \"https\",\n \"inspector\",\n \"inspector/promises\",\n \"module\",\n \"net\",\n \"os\",\n \"path\",\n \"path/posix\",\n \"path/win32\",\n \"perf_hooks\",\n \"process\",\n \"punycode\",\n \"querystring\",\n \"readline\",\n \"readline/promises\",\n \"repl\",\n \"stream\",\n \"stream/consumers\",\n \"stream/promises\",\n \"stream/web\",\n \"string_decoder\",\n \"sys\",\n \"timers\",\n \"timers/promises\",\n \"tls\",\n \"trace_events\",\n \"tty\",\n \"url\",\n \"util\",\n \"util/types\",\n \"v8\",\n \"vm\",\n \"wasi\",\n \"worker_threads\",\n \"zlib\"\n ]\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeStreamPromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/stream.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37)).promises})\n"_s;
+static constexpr ASCIILiteral NodeStreamConsumersCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/stream.consumers.ts\nvar $, arrayBuffer = Bun.readableStreamToArrayBuffer, text = Bun.readableStreamToText, json = (stream) => Bun.readableStreamToText(stream).then(JSON.parse), buffer = async (readableStream) => {\n return new @Buffer(await arrayBuffer(readableStream));\n}, blob = Bun.readableStreamToBlob;\n$ = {\n arrayBuffer,\n text,\n json,\n buffer,\n blob\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeStreamWebCode = "(function (){\"use strict\";// src/js/out/tmp/node/stream.web.ts\nvar $;\n$ = {\n ReadableStream,\n ReadableStreamDefaultReader,\n ReadableStreamBYOBReader,\n ReadableStreamBYOBRequest,\n ReadableByteStreamController,\n ReadableStreamDefaultController,\n TransformStream,\n TransformStreamDefaultController,\n WritableStream,\n WritableStreamDefaultWriter,\n WritableStreamDefaultController,\n ByteLengthQueuingStrategy,\n CountQueuingStrategy,\n TextEncoderStream: void 0,\n TextDecoderStream: void 0,\n CompressionStream: void 0,\n DecompressionStream: void 0\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeStreamCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/stream.ts\nvar isReadableStream = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof @ReadableStream;\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar ERR_INVALID_ARG_TYPE = function(name, type, value) {\n return new Error(`The argument '${name}' is invalid. Received '${value}' for type '${type}'`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value '${value}' is invalid for argument '${name}'. Reason: ${reason}`);\n}, createNativeStreamReadable = function(nativeType, Readable) {\n var [pull, start, cancel, setClose, deinit, updateRef, drainFn] = @lazy(nativeType), closer = [!1], handleNumberResult = function(nativeReadable, result, view, isClosed) {\n if (result > 0) {\n const slice = view.subarray(0, result), remainder = view.subarray(result);\n if (slice.byteLength > 0)\n nativeReadable.push(slice);\n if (isClosed)\n nativeReadable.push(null);\n return remainder.byteLength > 0 \? remainder : @undefined;\n }\n if (isClosed)\n nativeReadable.push(null);\n return view;\n }, handleArrayBufferViewResult = function(nativeReadable, result, view, isClosed) {\n if (result.byteLength > 0)\n nativeReadable.push(result);\n if (isClosed)\n nativeReadable.push(null);\n return view;\n }, DYNAMICALLY_ADJUST_CHUNK_SIZE = process.env.BUN_DISABLE_DYNAMIC_CHUNK_SIZE !== \"1\";\n const finalizer = new FinalizationRegistry((ptr) => ptr && deinit(ptr)), MIN_BUFFER_SIZE = 512;\n var NativeReadable = class NativeReadable2 extends Readable {\n #bunNativePtr;\n #refCount = 1;\n #constructed = !1;\n #remainingChunk = @undefined;\n #highWaterMark;\n #pendingRead = !1;\n #hasResized = !DYNAMICALLY_ADJUST_CHUNK_SIZE;\n #unregisterToken;\n constructor(ptr, options = {}) {\n super(options);\n if (typeof options.highWaterMark === \"number\")\n this.#highWaterMark = options.highWaterMark;\n else\n this.#highWaterMark = 262144;\n this.#bunNativePtr = ptr, this.#constructed = !1, this.#remainingChunk = @undefined, this.#pendingRead = !1, this.#unregisterToken = {}, finalizer.register(this, this.#bunNativePtr, this.#unregisterToken);\n }\n _read(maxToRead) {\n if (this.#pendingRead)\n return;\n var ptr = this.#bunNativePtr;\n if (ptr === 0) {\n this.push(null);\n return;\n }\n if (!this.#constructed)\n this.#internalConstruct(ptr);\n return this.#internalRead(this.#getRemainingChunk(maxToRead), ptr);\n }\n #internalConstruct(ptr) {\n this.#constructed = !0;\n const result = start(ptr, this.#highWaterMark);\n if (typeof result === \"number\" && result > 1)\n this.#hasResized = !0, this.#highWaterMark = Math.min(this.#highWaterMark, result);\n if (drainFn) {\n const drainResult = drainFn(ptr);\n if ((drainResult\?.byteLength \?\? 0) > 0)\n this.push(drainResult);\n }\n }\n #getRemainingChunk(maxToRead = this.#highWaterMark) {\n var chunk = this.#remainingChunk;\n if (chunk\?.byteLength \?\? 0 < MIN_BUFFER_SIZE) {\n var size = maxToRead > MIN_BUFFER_SIZE \? maxToRead : MIN_BUFFER_SIZE;\n this.#remainingChunk = chunk = new @Buffer(size);\n }\n return chunk;\n }\n #handleResult(result, view, isClosed) {\n if (typeof result === \"number\") {\n if (result >= this.#highWaterMark && !this.#hasResized && !isClosed)\n this.#highWaterMark *= 2, this.#hasResized = !0;\n return handleNumberResult(this, result, view, isClosed);\n } else if (typeof result === \"boolean\")\n return process.nextTick(() => {\n this.push(null);\n }), view\?.byteLength \?\? 0 > 0 \? view : @undefined;\n else if (@ArrayBuffer.isView(result)) {\n if (result.byteLength >= this.#highWaterMark && !this.#hasResized && !isClosed)\n this.#highWaterMark *= 2, this.#hasResized = !0;\n return handleArrayBufferViewResult(this, result, view, isClosed);\n } else\n throw new Error(\"Invalid result from pull\");\n }\n #internalRead(view, ptr) {\n closer[0] = !1;\n var result = pull(ptr, view, closer);\n if (@isPromise(result))\n return this.#pendingRead = !0, result.then((result2) => {\n this.#pendingRead = !1, this.#remainingChunk = this.#handleResult(result2, view, closer[0]);\n }, (reason) => {\n errorOrDestroy(this, reason);\n });\n else\n this.#remainingChunk = this.#handleResult(result, view, closer[0]);\n }\n _destroy(error, callback) {\n var ptr = this.#bunNativePtr;\n if (ptr === 0) {\n callback(error);\n return;\n }\n if (finalizer.unregister(this.#unregisterToken), this.#bunNativePtr = 0, updateRef)\n updateRef(ptr, !1);\n cancel(ptr, error), callback(error);\n }\n ref() {\n var ptr = this.#bunNativePtr;\n if (ptr === 0)\n return;\n if (this.#refCount++ === 0)\n updateRef(ptr, !0);\n }\n unref() {\n var ptr = this.#bunNativePtr;\n if (ptr === 0)\n return;\n if (this.#refCount-- === 1)\n updateRef(ptr, !1);\n }\n };\n if (!updateRef)\n NativeReadable.prototype.ref = @undefined, NativeReadable.prototype.unref = @undefined;\n return NativeReadable;\n}, getNativeReadableStreamPrototype = function(nativeType, Readable) {\n return nativeReadableStreamPrototypes[nativeType] ||= createNativeStreamReadable(nativeType, Readable);\n}, getNativeReadableStream = function(Readable, stream, options) {\n if (!(stream && typeof stream === \"object\" && stream instanceof @ReadableStream))\n return @undefined;\n const native = @direct(stream);\n if (!native)\n return @undefined;\n const { stream: ptr, data: type } = native;\n return new (getNativeReadableStreamPrototype(type, Readable))(ptr, options);\n}, NativeWritable = function(pathOrFdOrSink, options = {}) {\n Writable.@call(this, options), this[_native] = !0, this._construct = NativeWritable_internalConstruct, this._destroy = NativeWritable_internalDestroy, this._final = NativeWritable_internalFinal, this[_pathOrFdOrSink] = pathOrFdOrSink;\n}, NativeWritable_internalConstruct = function(cb) {\n if (this._writableState.constructed = !0, this.constructed = !0, typeof cb === \"function\")\n cb();\n process.nextTick(() => {\n this.emit(\"open\", this.fd), this.emit(\"ready\");\n });\n}, NativeWritable_lazyConstruct = function(stream) {\n var sink = stream[_pathOrFdOrSink];\n if (typeof sink === \"object\")\n if (typeof sink.write === \"function\")\n return stream[_fileSink] = sink;\n else\n throw new Error(\"Invalid FileSink\");\n else\n return stream[_fileSink] = Bun.file(sink).writer();\n}, NativeWritable_internalDestroy = function(error, cb) {\n const w = this._writableState, r = this._readableState;\n if (w)\n w.destroyed = !0, w.closeEmitted = !0;\n if (r)\n r.destroyed = !0, r.closeEmitted = !0;\n if (typeof cb === \"function\")\n cb(error);\n if (w\?.closeEmitted || r\?.closeEmitted)\n this.emit(\"close\");\n}, NativeWritable_internalFinal = function(cb) {\n var sink = this[_fileSink];\n if (sink)\n sink.end();\n if (cb)\n cb();\n}, EE = @lazy(\"events\"), StringDecoder = @requireNativeModule(\"string_decoder\").StringDecoder, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, runOnNextTick = process.nextTick;\nvar ArrayIsArray = @Array.isArray, require_primordials = __commonJS({\n \"node_modules/readable-stream/lib/ours/primordials.js\"(exports, module) {\n module.exports = {\n ArrayIsArray(self) {\n return @Array.isArray(self);\n },\n ArrayPrototypeIncludes(self, el) {\n return self.includes(el);\n },\n ArrayPrototypeIndexOf(self, el) {\n return self.indexOf(el);\n },\n ArrayPrototypeJoin(self, sep) {\n return self.join(sep);\n },\n ArrayPrototypeMap(self, fn) {\n return self.map(fn);\n },\n ArrayPrototypePop(self, el) {\n return self.pop(el);\n },\n ArrayPrototypePush(self, el) {\n return self.push(el);\n },\n ArrayPrototypeSlice(self, start, end) {\n return self.slice(start, end);\n },\n Error,\n FunctionPrototypeCall(fn, thisArgs, ...args) {\n return fn.@call(thisArgs, ...args);\n },\n FunctionPrototypeSymbolHasInstance(self, instance) {\n return Function.prototype[Symbol.hasInstance].@call(self, instance);\n },\n MathFloor: Math.floor,\n Number,\n NumberIsInteger: Number.isInteger,\n NumberIsNaN: Number.isNaN,\n NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,\n NumberParseInt: Number.parseInt,\n ObjectDefineProperties(self, props) {\n return Object.defineProperties(self, props);\n },\n ObjectDefineProperty(self, name, prop) {\n return Object.defineProperty(self, name, prop);\n },\n ObjectGetOwnPropertyDescriptor(self, name) {\n return Object.getOwnPropertyDescriptor(self, name);\n },\n ObjectKeys(obj) {\n return Object.keys(obj);\n },\n ObjectSetPrototypeOf(target, proto) {\n return Object.setPrototypeOf(target, proto);\n },\n Promise: @Promise,\n PromisePrototypeCatch(self, fn) {\n return self.catch(fn);\n },\n PromisePrototypeThen(self, thenFn, catchFn) {\n return self.then(thenFn, catchFn);\n },\n PromiseReject(err) {\n return @Promise.reject(err);\n },\n ReflectApply: @getByIdDirect(Reflect, \"apply\"),\n RegExpPrototypeTest(self, value) {\n return self.test(value);\n },\n SafeSet: Set,\n String: @String,\n StringPrototypeSlice(self, start, end) {\n return self.slice(start, end);\n },\n StringPrototypeToLowerCase(self) {\n return self.toLowerCase();\n },\n StringPrototypeToUpperCase(self) {\n return self.toUpperCase();\n },\n StringPrototypeTrim(self) {\n return self.trim();\n },\n Symbol,\n SymbolAsyncIterator: Symbol.asyncIterator,\n SymbolHasInstance: Symbol.hasInstance,\n SymbolIterator: Symbol.iterator,\n TypedArrayPrototypeSet(self, buf, len) {\n return self.set(buf, len);\n },\n Uint8Array: @Uint8Array\n };\n }\n}), require_util = __commonJS({\n \"node_modules/readable-stream/lib/ours/util.js\"(exports, module) {\n var AsyncFunction = Object.getPrototypeOf(async function() {\n }).constructor, isBlob = typeof Blob !== \"undefined\" \? function isBlob2(b) {\n return b instanceof Blob;\n } : function isBlob2(b) {\n return !1;\n }, AggregateError = class extends Error {\n constructor(errors) {\n if (!@Array.isArray(errors))\n @throwTypeError(`Expected input to be an Array, got ${typeof errors}`);\n let message = \"\";\n for (let i = 0;i < errors.length; i++)\n message += ` ${errors[i].stack}\n`;\n super(message);\n this.name = \"AggregateError\", this.errors = errors;\n }\n };\n module.exports = {\n AggregateError,\n once(callback) {\n let called = !1;\n return function(...args) {\n if (called)\n return;\n called = !0, callback.@apply(this, args);\n };\n },\n createDeferredPromise: function() {\n let resolve, reject;\n return {\n promise: new @Promise((res, rej) => {\n resolve = res, reject = rej;\n }),\n resolve,\n reject\n };\n },\n promisify(fn) {\n return new @Promise((resolve, reject) => {\n fn((err, ...args) => {\n if (err)\n return reject(err);\n return resolve(...args);\n });\n });\n },\n debuglog() {\n return function() {\n };\n },\n format(format, ...args) {\n return format.replace(/%([sdifj])/g, function(...[_unused, type]) {\n const replacement = args.shift();\n if (type === \"f\")\n return replacement.toFixed(6);\n else if (type === \"j\")\n return JSON.stringify(replacement);\n else if (type === \"s\" && typeof replacement === \"object\")\n return `${replacement.constructor !== Object \? replacement.constructor.name : \"\"} {}`.trim();\n else\n return replacement.toString();\n });\n },\n inspect(value) {\n switch (typeof value) {\n case \"string\":\n if (value.includes(\"'\")) {\n if (!value.includes('\"'))\n return `\"${value}\"`;\n else if (!value.includes(\"`\") && !value.includes(\"${\"))\n return `\\`${value}\\``;\n }\n return `'${value}'`;\n case \"number\":\n if (isNaN(value))\n return \"NaN\";\n else if (Object.is(value, -0))\n return @String(value);\n return value;\n case \"bigint\":\n return `${@String(value)}n`;\n case \"boolean\":\n case \"undefined\":\n return @String(value);\n case \"object\":\n return \"{}\";\n }\n },\n types: {\n isAsyncFunction(fn) {\n return fn instanceof AsyncFunction;\n },\n isArrayBufferView(arr) {\n return @ArrayBuffer.isView(arr);\n }\n },\n isBlob\n }, module.exports.promisify.custom = Symbol.for(\"nodejs.util.promisify.custom\");\n }\n}), require_errors = __commonJS({\n \"node_modules/readable-stream/lib/ours/errors.js\"(exports, module) {\n var { format, inspect, AggregateError: CustomAggregateError } = require_util(), AggregateError = globalThis.AggregateError || CustomAggregateError, kIsNodeError = Symbol(\"kIsNodeError\"), kTypes = [\"string\", \"function\", \"number\", \"object\", \"Function\", \"Object\", \"boolean\", \"bigint\", \"symbol\"], classRegExp = /^([A-Z][a-z0-9]*)+$/, nodeInternalPrefix = \"__node_internal_\", codes = {};\n function assert(value, message) {\n if (!value)\n throw new codes.ERR_INTERNAL_ASSERTION(message);\n }\n function addNumericalSeparator(val) {\n let res = \"\", i = val.length;\n const start = val[0] === \"-\" \? 1 : 0;\n for (;i >= start + 4; i -= 3)\n res = `_${val.slice(i - 3, i)}${res}`;\n return `${val.slice(0, i)}${res}`;\n }\n function getMessage(key, msg, args) {\n if (typeof msg === \"function\")\n return assert(msg.length <= args.length, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`), msg(...args);\n const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length;\n if (assert(expectedLength === args.length, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`), args.length === 0)\n return msg;\n return format(msg, ...args);\n }\n function E(code, message, Base) {\n if (!Base)\n Base = Error;\n\n class NodeError extends Base {\n constructor(...args) {\n super(getMessage(code, message, args));\n }\n toString() {\n return `${this.name} [${code}]: ${this.message}`;\n }\n }\n Object.defineProperties(NodeError.prototype, {\n name: {\n value: Base.name,\n writable: !0,\n enumerable: !1,\n configurable: !0\n },\n toString: {\n value() {\n return `${this.name} [${code}]: ${this.message}`;\n },\n writable: !0,\n enumerable: !1,\n configurable: !0\n }\n }), NodeError.prototype.code = code, NodeError.prototype[kIsNodeError] = !0, codes[code] = NodeError;\n }\n function hideStackFrames(fn) {\n const hidden = nodeInternalPrefix + fn.name;\n return Object.defineProperty(fn, \"name\", {\n value: hidden\n }), fn;\n }\n function aggregateTwoErrors(innerError, outerError) {\n if (innerError && outerError && innerError !== outerError) {\n if (@Array.isArray(outerError.errors))\n return outerError.errors.push(innerError), outerError;\n const err = new AggregateError([outerError, innerError], outerError.message);\n return err.code = outerError.code, err;\n }\n return innerError || outerError;\n }\n var AbortError2 = class extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n };\n E(\"ERR_ASSERTION\", \"%s\", Error), E(\"ERR_INVALID_ARG_TYPE\", (name, expected, actual) => {\n if (assert(typeof name === \"string\", \"'name' must be a string\"), !@Array.isArray(expected))\n expected = [expected];\n let msg = \"The \";\n if (name.endsWith(\" argument\"))\n msg += `${name} `;\n else\n msg += `\"${name}\" ${name.includes(\".\") \? \"property\" : \"argument\"} `;\n msg += \"must be \";\n const types = [], instances = [], other = [];\n for (let value of expected)\n if (assert(typeof value === \"string\", \"All expected entries have to be of type string\"), kTypes.includes(value))\n types.push(value.toLowerCase());\n else if (classRegExp.test(value))\n instances.push(value);\n else\n assert(value !== \"object\", 'The value \"object\" should be written as \"Object\"'), other.push(value);\n if (instances.length > 0) {\n const pos = types.indexOf(\"object\");\n if (pos !== -1)\n types.splice(types, pos, 1), instances.push(\"Object\");\n }\n if (types.length > 0) {\n switch (types.length) {\n case 1:\n msg += `of type ${types[0]}`;\n break;\n case 2:\n msg += `one of type ${types[0]} or ${types[1]}`;\n break;\n default: {\n const last = types.pop();\n msg += `one of type ${types.join(\", \")}, or ${last}`;\n }\n }\n if (instances.length > 0 || other.length > 0)\n msg += \" or \";\n }\n if (instances.length > 0) {\n switch (instances.length) {\n case 1:\n msg += `an instance of ${instances[0]}`;\n break;\n case 2:\n msg += `an instance of ${instances[0]} or ${instances[1]}`;\n break;\n default: {\n const last = instances.pop();\n msg += `an instance of ${instances.join(\", \")}, or ${last}`;\n }\n }\n if (other.length > 0)\n msg += \" or \";\n }\n switch (other.length) {\n case 0:\n break;\n case 1:\n if (other[0].toLowerCase() !== other[0])\n msg += \"an \";\n msg += `${other[0]}`;\n break;\n case 2:\n msg += `one of ${other[0]} or ${other[1]}`;\n break;\n default: {\n const last = other.pop();\n msg += `one of ${other.join(\", \")}, or ${last}`;\n }\n }\n if (actual == null)\n msg += `. Received ${actual}`;\n else if (typeof actual === \"function\" && actual.name)\n msg += `. Received function ${actual.name}`;\n else if (typeof actual === \"object\") {\n var _actual$constructor;\n if ((_actual$constructor = actual.constructor) !== null && _actual$constructor !== void 0 && _actual$constructor.name)\n msg += `. Received an instance of ${actual.constructor.name}`;\n else {\n const inspected = inspect(actual, {\n depth: -1\n });\n msg += `. Received ${inspected}`;\n }\n } else {\n let inspected = inspect(actual, {\n colors: !1\n });\n if (inspected.length > 25)\n inspected = `${inspected.slice(0, 25)}...`;\n msg += `. Received type ${typeof actual} (${inspected})`;\n }\n return msg;\n }, TypeError), E(\"ERR_INVALID_ARG_VALUE\", (name, value, reason = \"is invalid\") => {\n let inspected = inspect(value);\n if (inspected.length > 128)\n inspected = inspected.slice(0, 128) + \"...\";\n return `The ${name.includes(\".\") \? \"property\" : \"argument\"} '${name}' ${reason}. Received ${inspected}`;\n }, TypeError), E(\"ERR_INVALID_RETURN_VALUE\", (input, name, value) => {\n var _value$constructor;\n const type = value !== null && value !== void 0 && (_value$constructor = value.constructor) !== null && _value$constructor !== void 0 && _value$constructor.name \? `instance of ${value.constructor.name}` : `type ${typeof value}`;\n return `Expected ${input} to be returned from the \"${name}\" function but got ${type}.`;\n }, TypeError), E(\"ERR_MISSING_ARGS\", (...args) => {\n assert(args.length > 0, \"At least one arg needs to be specified\");\n let msg;\n const len = args.length;\n switch (args = (@Array.isArray(args) \? args : [args]).map((a) => `\"${a}\"`).join(\" or \"), len) {\n case 1:\n msg += `The ${args[0]} argument`;\n break;\n case 2:\n msg += `The ${args[0]} and ${args[1]} arguments`;\n break;\n default:\n {\n const last = args.pop();\n msg += `The ${args.join(\", \")}, and ${last} arguments`;\n }\n break;\n }\n return `${msg} must be specified`;\n }, TypeError), E(\"ERR_OUT_OF_RANGE\", (str, range, input) => {\n assert(range, 'Missing \"range\" argument');\n let received;\n if (Number.isInteger(input) && Math.abs(input) > 4294967296)\n received = addNumericalSeparator(@String(input));\n else if (typeof input === \"bigint\") {\n if (received = @String(input), input > 2n ** 32n || input < -(2n ** 32n))\n received = addNumericalSeparator(received);\n received += \"n\";\n } else\n received = inspect(input);\n return `The value of \"${str}\" is out of range. It must be ${range}. Received ${received}`;\n }, RangeError), E(\"ERR_MULTIPLE_CALLBACK\", \"Callback called multiple times\", Error), E(\"ERR_METHOD_NOT_IMPLEMENTED\", \"The %s method is not implemented\", Error), E(\"ERR_STREAM_ALREADY_FINISHED\", \"Cannot call %s after a stream was finished\", Error), E(\"ERR_STREAM_CANNOT_PIPE\", \"Cannot pipe, not readable\", Error), E(\"ERR_STREAM_DESTROYED\", \"Cannot call %s after a stream was destroyed\", Error), E(\"ERR_STREAM_NULL_VALUES\", \"May not write null values to stream\", TypeError), E(\"ERR_STREAM_PREMATURE_CLOSE\", \"Premature close\", Error), E(\"ERR_STREAM_PUSH_AFTER_EOF\", \"stream.push() after EOF\", Error), E(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\", \"stream.unshift() after end event\", Error), E(\"ERR_STREAM_WRITE_AFTER_END\", \"write after end\", Error), E(\"ERR_UNKNOWN_ENCODING\", \"Unknown encoding: %s\", TypeError), module.exports = {\n AbortError: AbortError2,\n aggregateTwoErrors: hideStackFrames(aggregateTwoErrors),\n hideStackFrames,\n codes\n };\n }\n}), require_validators = __commonJS({\n \"node_modules/readable-stream/lib/internal/validators.js\"(exports, module) {\n var {\n ArrayIsArray: ArrayIsArray2,\n ArrayPrototypeIncludes,\n ArrayPrototypeJoin,\n ArrayPrototypeMap,\n NumberIsInteger,\n NumberMAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER,\n NumberParseInt,\n RegExpPrototypeTest,\n String: String2,\n StringPrototypeToUpperCase,\n StringPrototypeTrim\n } = require_primordials(), {\n hideStackFrames,\n codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL }\n } = require_errors(), { normalizeEncoding } = require_util(), { isAsyncFunction, isArrayBufferView } = require_util().types, signals = {};\n function isInt32(value) {\n return value === (value | 0);\n }\n function isUint32(value) {\n return value === value >>> 0;\n }\n var octalReg = /^[0-7]+$/, modeDesc = \"must be a 32-bit unsigned integer or an octal string\";\n function parseFileMode(value, name, def) {\n if (typeof value === \"undefined\")\n value = def;\n if (typeof value === \"string\") {\n if (!RegExpPrototypeTest(octalReg, value))\n throw new ERR_INVALID_ARG_VALUE2(name, value, modeDesc);\n value = NumberParseInt(value, 8);\n }\n return validateInt32(value, name, 0, 4294967295), value;\n }\n var validateInteger = hideStackFrames((value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }), validateInt32 = hideStackFrames((value, name, min = -2147483648, max = 2147483647) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!isInt32(value)) {\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }), validateUint32 = hideStackFrames((value, name, positive) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!isUint32(value)) {\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n throw new ERR_OUT_OF_RANGE(name, `>= ${positive \? 1 : 0} && < 4294967296`, value);\n }\n if (positive && value === 0)\n throw new ERR_OUT_OF_RANGE(name, \">= 1 && < 4294967296\", value);\n });\n function validateString(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"string\", value);\n }\n function validateNumber(value, name) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n }\n var validateOneOf = hideStackFrames((value, name, oneOf) => {\n if (!ArrayPrototypeIncludes(oneOf, value)) {\n const reason = \"must be one of: \" + ArrayPrototypeJoin(ArrayPrototypeMap(oneOf, (v) => typeof v === \"string\" \? `'${v}'` : String2(v)), \", \");\n throw new ERR_INVALID_ARG_VALUE2(name, value, reason);\n }\n });\n function validateBoolean2(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"boolean\", value);\n }\n var validateObject = hideStackFrames((value, name, options) => {\n const useDefaultOptions = options == null, allowArray = useDefaultOptions \? !1 : options.allowArray, allowFunction = useDefaultOptions \? !1 : options.allowFunction;\n if (!(useDefaultOptions \? !1 : options.nullable) && value === null || !allowArray && ArrayIsArray2(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Object\", value);\n }), validateArray = hideStackFrames((value, name, minLength = 0) => {\n if (!ArrayIsArray2(value))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE2(name, value, reason);\n }\n });\n function validateSignalName(signal, name = \"signal\") {\n if (validateString(signal, name), signals[signal] === void 0) {\n if (signals[StringPrototypeToUpperCase(signal)] !== void 0)\n throw new ERR_UNKNOWN_SIGNAL(signal + \" (signals must use all capital letters)\");\n throw new ERR_UNKNOWN_SIGNAL(signal);\n }\n }\n var validateBuffer = hideStackFrames((buffer, name = \"buffer\") => {\n if (!isArrayBufferView(buffer))\n throw new ERR_INVALID_ARG_TYPE2(name, [\"Buffer\", \"TypedArray\", \"DataView\"], buffer);\n });\n function validateEncoding(data, encoding) {\n const normalizedEncoding = normalizeEncoding(encoding), length = data.length;\n if (normalizedEncoding === \"hex\" && length % 2 !== 0)\n throw new ERR_INVALID_ARG_VALUE2(\"encoding\", encoding, `is invalid for data of length ${length}`);\n }\n function validatePort(port, name = \"Port\", allowZero = !0) {\n if (typeof port !== \"number\" && typeof port !== \"string\" || typeof port === \"string\" && StringPrototypeTrim(port).length === 0 || +port !== +port >>> 0 || port > 65535 || port === 0 && !allowZero)\n throw new ERR_SOCKET_BAD_PORT(name, port, allowZero);\n return port | 0;\n }\n var validateAbortSignal = hideStackFrames((signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE2(name, \"AbortSignal\", signal);\n }), validateFunction = hideStackFrames((value, name) => {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"Function\", value);\n }), validatePlainFunction = hideStackFrames((value, name) => {\n if (typeof value !== \"function\" || isAsyncFunction(value))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Function\", value);\n }), validateUndefined = hideStackFrames((value, name) => {\n if (value !== void 0)\n throw new ERR_INVALID_ARG_TYPE2(name, \"undefined\", value);\n });\n module.exports = {\n isInt32,\n isUint32,\n parseFileMode,\n validateArray,\n validateBoolean: validateBoolean2,\n validateBuffer,\n validateEncoding,\n validateFunction,\n validateInt32,\n validateInteger,\n validateNumber,\n validateObject,\n validateOneOf,\n validatePlainFunction,\n validatePort,\n validateSignalName,\n validateString,\n validateUint32,\n validateUndefined,\n validateAbortSignal\n };\n }\n}), require_utils = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/utils.js\"(exports, module) {\n var { Symbol: Symbol2, SymbolAsyncIterator, SymbolIterator } = require_primordials(), kDestroyed = Symbol2(\"kDestroyed\"), kIsErrored = Symbol2(\"kIsErrored\"), kIsReadable = Symbol2(\"kIsReadable\"), kIsDisturbed = Symbol2(\"kIsDisturbed\");\n function isReadableNodeStream(obj, strict = !1) {\n var _obj$_readableState;\n return !!(obj && typeof obj.pipe === \"function\" && typeof obj.on === \"function\" && (!strict || typeof obj.pause === \"function\" && typeof obj.resume === \"function\") && (!obj._writableState || ((_obj$_readableState = obj._readableState) === null || _obj$_readableState === void 0 \? void 0 : _obj$_readableState.readable) !== !1) && (!obj._writableState || obj._readableState));\n }\n function isWritableNodeStream(obj) {\n var _obj$_writableState;\n return !!(obj && typeof obj.write === \"function\" && typeof obj.on === \"function\" && (!obj._readableState || ((_obj$_writableState = obj._writableState) === null || _obj$_writableState === void 0 \? void 0 : _obj$_writableState.writable) !== !1));\n }\n function isDuplexNodeStream(obj) {\n return !!(obj && typeof obj.pipe === \"function\" && obj._readableState && typeof obj.on === \"function\" && typeof obj.write === \"function\");\n }\n function isNodeStream(obj) {\n return obj && (obj._readableState || obj._writableState || typeof obj.write === \"function\" && typeof obj.on === \"function\" || typeof obj.pipe === \"function\" && typeof obj.on === \"function\");\n }\n function isIterable(obj, isAsync) {\n if (obj == null)\n return !1;\n if (isAsync === !0)\n return typeof obj[SymbolAsyncIterator] === \"function\";\n if (isAsync === !1)\n return typeof obj[SymbolIterator] === \"function\";\n return typeof obj[SymbolAsyncIterator] === \"function\" || typeof obj[SymbolIterator] === \"function\";\n }\n function isDestroyed(stream) {\n if (!isNodeStream(stream))\n return null;\n const { _writableState: wState, _readableState: rState } = stream, state = wState || rState;\n return !!(stream.destroyed || stream[kDestroyed] || state !== null && state !== void 0 && state.destroyed);\n }\n function isWritableEnded(stream) {\n if (!isWritableNodeStream(stream))\n return null;\n if (stream.writableEnded === !0)\n return !0;\n const wState = stream._writableState;\n if (wState !== null && wState !== void 0 && wState.errored)\n return !1;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.ended) !== \"boolean\")\n return null;\n return wState.ended;\n }\n function isWritableFinished(stream, strict) {\n if (!isWritableNodeStream(stream))\n return null;\n if (stream.writableFinished === !0)\n return !0;\n const wState = stream._writableState;\n if (wState !== null && wState !== void 0 && wState.errored)\n return !1;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.finished) !== \"boolean\")\n return null;\n return !!(wState.finished || strict === !1 && wState.ended === !0 && wState.length === 0);\n }\n function isReadableEnded(stream) {\n if (!isReadableNodeStream(stream))\n return null;\n if (stream.readableEnded === !0)\n return !0;\n const rState = stream._readableState;\n if (!rState || rState.errored)\n return !1;\n if (typeof (rState === null || rState === void 0 \? void 0 : rState.ended) !== \"boolean\")\n return null;\n return rState.ended;\n }\n function isReadableFinished(stream, strict) {\n if (!isReadableNodeStream(stream))\n return null;\n const rState = stream._readableState;\n if (rState !== null && rState !== void 0 && rState.errored)\n return !1;\n if (typeof (rState === null || rState === void 0 \? void 0 : rState.endEmitted) !== \"boolean\")\n return null;\n return !!(rState.endEmitted || strict === !1 && rState.ended === !0 && rState.length === 0);\n }\n function isReadable(stream) {\n if (stream && stream[kIsReadable] != null)\n return stream[kIsReadable];\n if (typeof (stream === null || stream === void 0 \? void 0 : stream.readable) !== \"boolean\")\n return null;\n if (isDestroyed(stream))\n return !1;\n return isReadableNodeStream(stream) && stream.readable && !isReadableFinished(stream);\n }\n function isWritable(stream) {\n if (typeof (stream === null || stream === void 0 \? void 0 : stream.writable) !== \"boolean\")\n return null;\n if (isDestroyed(stream))\n return !1;\n return isWritableNodeStream(stream) && stream.writable && !isWritableEnded(stream);\n }\n function isFinished(stream, opts) {\n if (!isNodeStream(stream))\n return null;\n if (isDestroyed(stream))\n return !0;\n if ((opts === null || opts === void 0 \? void 0 : opts.readable) !== !1 && isReadable(stream))\n return !1;\n if ((opts === null || opts === void 0 \? void 0 : opts.writable) !== !1 && isWritable(stream))\n return !1;\n return !0;\n }\n function isWritableErrored(stream) {\n var _stream$_writableStat, _stream$_writableStat2;\n if (!isNodeStream(stream))\n return null;\n if (stream.writableErrored)\n return stream.writableErrored;\n return (_stream$_writableStat = (_stream$_writableStat2 = stream._writableState) === null || _stream$_writableStat2 === void 0 \? void 0 : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== void 0 \? _stream$_writableStat : null;\n }\n function isReadableErrored(stream) {\n var _stream$_readableStat, _stream$_readableStat2;\n if (!isNodeStream(stream))\n return null;\n if (stream.readableErrored)\n return stream.readableErrored;\n return (_stream$_readableStat = (_stream$_readableStat2 = stream._readableState) === null || _stream$_readableStat2 === void 0 \? void 0 : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== void 0 \? _stream$_readableStat : null;\n }\n function isClosed(stream) {\n if (!isNodeStream(stream))\n return null;\n if (typeof stream.closed === \"boolean\")\n return stream.closed;\n const { _writableState: wState, _readableState: rState } = stream;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.closed) === \"boolean\" || typeof (rState === null || rState === void 0 \? void 0 : rState.closed) === \"boolean\")\n return (wState === null || wState === void 0 \? void 0 : wState.closed) || (rState === null || rState === void 0 \? void 0 : rState.closed);\n if (typeof stream._closed === \"boolean\" && isOutgoingMessage(stream))\n return stream._closed;\n return null;\n }\n function isOutgoingMessage(stream) {\n return typeof stream._closed === \"boolean\" && typeof stream._defaultKeepAlive === \"boolean\" && typeof stream._removedConnection === \"boolean\" && typeof stream._removedContLen === \"boolean\";\n }\n function isServerResponse(stream) {\n return typeof stream._sent100 === \"boolean\" && isOutgoingMessage(stream);\n }\n function isServerRequest(stream) {\n var _stream$req;\n return typeof stream._consuming === \"boolean\" && typeof stream._dumped === \"boolean\" && ((_stream$req = stream.req) === null || _stream$req === void 0 \? void 0 : _stream$req.upgradeOrConnect) === void 0;\n }\n function willEmitClose(stream) {\n if (!isNodeStream(stream))\n return null;\n const { _writableState: wState, _readableState: rState } = stream, state = wState || rState;\n return !state && isServerResponse(stream) || !!(state && state.autoDestroy && state.emitClose && state.closed === !1);\n }\n function isDisturbed(stream) {\n var _stream$kIsDisturbed;\n return !!(stream && ((_stream$kIsDisturbed = stream[kIsDisturbed]) !== null && _stream$kIsDisturbed !== void 0 \? _stream$kIsDisturbed : stream.readableDidRead || stream.readableAborted));\n }\n function isErrored(stream) {\n var _ref, _ref2, _ref3, _ref4, _ref5, _stream$kIsErrored, _stream$_readableStat3, _stream$_writableStat3, _stream$_readableStat4, _stream$_writableStat4;\n return !!(stream && ((_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_stream$kIsErrored = stream[kIsErrored]) !== null && _stream$kIsErrored !== void 0 \? _stream$kIsErrored : stream.readableErrored) !== null && _ref5 !== void 0 \? _ref5 : stream.writableErrored) !== null && _ref4 !== void 0 \? _ref4 : (_stream$_readableStat3 = stream._readableState) === null || _stream$_readableStat3 === void 0 \? void 0 : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== void 0 \? _ref3 : (_stream$_writableStat3 = stream._writableState) === null || _stream$_writableStat3 === void 0 \? void 0 : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== void 0 \? _ref2 : (_stream$_readableStat4 = stream._readableState) === null || _stream$_readableStat4 === void 0 \? void 0 : _stream$_readableStat4.errored) !== null && _ref !== void 0 \? _ref : (_stream$_writableStat4 = stream._writableState) === null || _stream$_writableStat4 === void 0 \? void 0 : _stream$_writableStat4.errored));\n }\n module.exports = {\n kDestroyed,\n isDisturbed,\n kIsDisturbed,\n isErrored,\n kIsErrored,\n isReadable,\n kIsReadable,\n isClosed,\n isDestroyed,\n isDuplexNodeStream,\n isFinished,\n isIterable,\n isReadableNodeStream,\n isReadableEnded,\n isReadableFinished,\n isReadableErrored,\n isNodeStream,\n isWritable,\n isWritableNodeStream,\n isWritableEnded,\n isWritableFinished,\n isWritableErrored,\n isServerRequest,\n isServerResponse,\n willEmitClose\n };\n }\n}), require_end_of_stream = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/end-of-stream.js\"(exports, module) {\n var { AbortError: AbortError2, codes } = require_errors(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_PREMATURE_CLOSE } = codes, { once } = require_util(), { validateAbortSignal, validateFunction, validateObject } = require_validators(), { Promise: Promise2 } = require_primordials(), {\n isClosed,\n isReadable,\n isReadableNodeStream,\n isReadableFinished,\n isReadableErrored,\n isWritable,\n isWritableNodeStream,\n isWritableFinished,\n isWritableErrored,\n isNodeStream,\n willEmitClose: _willEmitClose\n } = require_utils();\n function isRequest(stream) {\n return stream.setHeader && typeof stream.abort === \"function\";\n }\n var nop = () => {\n };\n function eos(stream, options, callback) {\n var _options$readable, _options$writable;\n if (arguments.length === 2)\n callback = options, options = {};\n else if (options == null)\n options = {};\n else\n validateObject(options, \"options\");\n validateFunction(callback, \"callback\"), validateAbortSignal(options.signal, \"options.signal\"), callback = once(callback);\n const readable = (_options$readable = options.readable) !== null && _options$readable !== void 0 \? _options$readable : isReadableNodeStream(stream), writable = (_options$writable = options.writable) !== null && _options$writable !== void 0 \? _options$writable : isWritableNodeStream(stream);\n if (!isNodeStream(stream))\n throw new ERR_INVALID_ARG_TYPE2(\"stream\", \"Stream\", stream);\n const { _writableState: wState, _readableState: rState } = stream, onlegacyfinish = () => {\n if (!stream.writable)\n onfinish();\n };\n let willEmitClose = _willEmitClose(stream) && isReadableNodeStream(stream) === readable && isWritableNodeStream(stream) === writable, writableFinished = isWritableFinished(stream, !1);\n const onfinish = () => {\n if (writableFinished = !0, stream.destroyed)\n willEmitClose = !1;\n if (willEmitClose && (!stream.readable || readable))\n return;\n if (!readable || readableFinished)\n callback.@call(stream);\n };\n let readableFinished = isReadableFinished(stream, !1);\n const onend = () => {\n if (readableFinished = !0, stream.destroyed)\n willEmitClose = !1;\n if (willEmitClose && (!stream.writable || writable))\n return;\n if (!writable || writableFinished)\n callback.@call(stream);\n }, onerror = (err) => {\n callback.@call(stream, err);\n };\n let closed = isClosed(stream);\n const onclose = () => {\n closed = !0;\n const errored = isWritableErrored(stream) || isReadableErrored(stream);\n if (errored && typeof errored !== \"boolean\")\n return callback.@call(stream, errored);\n if (readable && !readableFinished && isReadableNodeStream(stream, !0)) {\n if (!isReadableFinished(stream, !1))\n return callback.@call(stream, new ERR_STREAM_PREMATURE_CLOSE);\n }\n if (writable && !writableFinished) {\n if (!isWritableFinished(stream, !1))\n return callback.@call(stream, new ERR_STREAM_PREMATURE_CLOSE);\n }\n callback.@call(stream);\n }, onrequest = () => {\n stream.req.on(\"finish\", onfinish);\n };\n if (isRequest(stream)) {\n if (stream.on(\"complete\", onfinish), !willEmitClose)\n stream.on(\"abort\", onclose);\n if (stream.req)\n onrequest();\n else\n stream.on(\"request\", onrequest);\n } else if (writable && !wState)\n stream.on(\"end\", onlegacyfinish), stream.on(\"close\", onlegacyfinish);\n if (!willEmitClose && typeof stream.aborted === \"boolean\")\n stream.on(\"aborted\", onclose);\n if (stream.on(\"end\", onend), stream.on(\"finish\", onfinish), options.error !== !1)\n stream.on(\"error\", onerror);\n if (stream.on(\"close\", onclose), closed)\n runOnNextTick(onclose);\n else if (wState !== null && wState !== void 0 && wState.errorEmitted || rState !== null && rState !== void 0 && rState.errorEmitted) {\n if (!willEmitClose)\n runOnNextTick(onclose);\n } else if (!readable && (!willEmitClose || isReadable(stream)) && (writableFinished || isWritable(stream) === !1))\n runOnNextTick(onclose);\n else if (!writable && (!willEmitClose || isWritable(stream)) && (readableFinished || isReadable(stream) === !1))\n runOnNextTick(onclose);\n else if (rState && stream.req && stream.aborted)\n runOnNextTick(onclose);\n const cleanup = () => {\n if (callback = nop, stream.removeListener(\"aborted\", onclose), stream.removeListener(\"complete\", onfinish), stream.removeListener(\"abort\", onclose), stream.removeListener(\"request\", onrequest), stream.req)\n stream.req.removeListener(\"finish\", onfinish);\n stream.removeListener(\"end\", onlegacyfinish), stream.removeListener(\"close\", onlegacyfinish), stream.removeListener(\"finish\", onfinish), stream.removeListener(\"end\", onend), stream.removeListener(\"error\", onerror), stream.removeListener(\"close\", onclose);\n };\n if (options.signal && !closed) {\n const abort = () => {\n const endCallback = callback;\n cleanup(), endCallback.@call(stream, new AbortError2(void 0, {\n cause: options.signal.reason\n }));\n };\n if (options.signal.aborted)\n runOnNextTick(abort);\n else {\n const originalCallback = callback;\n callback = once((...args) => {\n options.signal.removeEventListener(\"abort\", abort), originalCallback.@apply(stream, args);\n }), options.signal.addEventListener(\"abort\", abort);\n }\n }\n return cleanup;\n }\n function finished(stream, opts) {\n return new Promise2((resolve, reject) => {\n eos(stream, opts, (err) => {\n if (err)\n reject(err);\n else\n resolve();\n });\n });\n }\n module.exports = eos, module.exports.finished = finished;\n }\n}), require_operators = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/operators.js\"(exports, module) {\n var {\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_MISSING_ARGS, ERR_OUT_OF_RANGE },\n AbortError: AbortError2\n } = require_errors(), { validateAbortSignal, validateInteger, validateObject } = require_validators(), kWeakHandler = require_primordials().Symbol(\"kWeak\"), { finished } = require_end_of_stream(), {\n ArrayPrototypePush,\n MathFloor,\n Number: Number2,\n NumberIsNaN,\n Promise: Promise2,\n PromiseReject,\n PromisePrototypeCatch,\n Symbol: Symbol2\n } = require_primordials(), kEmpty = Symbol2(\"kEmpty\"), kEof = Symbol2(\"kEof\");\n function map(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n let concurrency = 1;\n if ((options === null || options === void 0 \? void 0 : options.concurrency) != null)\n concurrency = MathFloor(options.concurrency);\n return validateInteger(concurrency, \"concurrency\", 1), async function* map2() {\n var _options$signal, _options$signal2;\n const ac = new AbortController, stream = this, queue = [], signal = ac.signal, signalOpt = {\n signal\n }, abort = () => ac.abort();\n if (options !== null && options !== void 0 && (_options$signal = options.signal) !== null && _options$signal !== void 0 && _options$signal.aborted)\n abort();\n options === null || options === void 0 || (_options$signal2 = options.signal) === null || _options$signal2 === void 0 || _options$signal2.addEventListener(\"abort\", abort);\n let next, resume, done = !1;\n function onDone() {\n done = !0;\n }\n async function pump() {\n try {\n for await (let val of stream) {\n var _val;\n if (done)\n return;\n if (signal.aborted)\n throw new AbortError2;\n try {\n val = fn(val, signalOpt);\n } catch (err) {\n val = PromiseReject(err);\n }\n if (val === kEmpty)\n continue;\n if (typeof ((_val = val) === null || _val === void 0 \? void 0 : _val.catch) === \"function\")\n val.catch(onDone);\n if (queue.push(val), next)\n next(), next = null;\n if (!done && queue.length && queue.length >= concurrency)\n await new Promise2((resolve) => {\n resume = resolve;\n });\n }\n queue.push(kEof);\n } catch (err) {\n const val = PromiseReject(err);\n PromisePrototypeCatch(val, onDone), queue.push(val);\n } finally {\n var _options$signal3;\n if (done = !0, next)\n next(), next = null;\n options === null || options === void 0 || (_options$signal3 = options.signal) === null || _options$signal3 === void 0 || _options$signal3.removeEventListener(\"abort\", abort);\n }\n }\n pump();\n try {\n while (!0) {\n while (queue.length > 0) {\n const val = await queue[0];\n if (val === kEof)\n return;\n if (signal.aborted)\n throw new AbortError2;\n if (val !== kEmpty)\n yield val;\n if (queue.shift(), resume)\n resume(), resume = null;\n }\n await new Promise2((resolve) => {\n next = resolve;\n });\n }\n } finally {\n if (ac.abort(), done = !0, resume)\n resume(), resume = null;\n }\n }.@call(this);\n }\n function asIndexedPairs(options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return async function* asIndexedPairs2() {\n let index = 0;\n for await (let val of this) {\n var _options$signal4;\n if (options !== null && options !== void 0 && (_options$signal4 = options.signal) !== null && _options$signal4 !== void 0 && _options$signal4.aborted)\n throw new AbortError2({\n cause: options.signal.reason\n });\n yield [index++, val];\n }\n }.@call(this);\n }\n async function some(fn, options = void 0) {\n for await (let unused of filter.@call(this, fn, options))\n return !0;\n return !1;\n }\n async function every(fn, options = void 0) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n return !await some.@call(this, async (...args) => {\n return !await fn(...args);\n }, options);\n }\n async function find(fn, options) {\n for await (let result of filter.@call(this, fn, options))\n return result;\n return;\n }\n async function forEach(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n async function forEachFn(value, options2) {\n return await fn(value, options2), kEmpty;\n }\n for await (let unused of map.@call(this, forEachFn, options))\n ;\n }\n function filter(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n async function filterFn(value, options2) {\n if (await fn(value, options2))\n return value;\n return kEmpty;\n }\n return map.@call(this, filterFn, options);\n }\n var ReduceAwareErrMissingArgs = class extends ERR_MISSING_ARGS {\n constructor() {\n super(\"reduce\");\n this.message = \"Reduce of an empty stream requires an initial value\";\n }\n };\n async function reduce(reducer, initialValue, options) {\n var _options$signal5;\n if (typeof reducer !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"reducer\", [\"Function\", \"AsyncFunction\"], reducer);\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n let hasInitialValue = arguments.length > 1;\n if (options !== null && options !== void 0 && (_options$signal5 = options.signal) !== null && _options$signal5 !== void 0 && _options$signal5.aborted) {\n const err = new AbortError2(void 0, {\n cause: options.signal.reason\n });\n throw this.once(\"error\", () => {\n }), await finished(this.destroy(err)), err;\n }\n const ac = new AbortController, signal = ac.signal;\n if (options !== null && options !== void 0 && options.signal) {\n const opts = {\n once: !0,\n [kWeakHandler]: this\n };\n options.signal.addEventListener(\"abort\", () => ac.abort(), opts);\n }\n let gotAnyItemFromStream = !1;\n try {\n for await (let value of this) {\n var _options$signal6;\n if (gotAnyItemFromStream = !0, options !== null && options !== void 0 && (_options$signal6 = options.signal) !== null && _options$signal6 !== void 0 && _options$signal6.aborted)\n throw new AbortError2;\n if (!hasInitialValue)\n initialValue = value, hasInitialValue = !0;\n else\n initialValue = await reducer(initialValue, value, {\n signal\n });\n }\n if (!gotAnyItemFromStream && !hasInitialValue)\n throw new ReduceAwareErrMissingArgs;\n } finally {\n ac.abort();\n }\n return initialValue;\n }\n async function toArray(options) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n const result = [];\n for await (let val of this) {\n var _options$signal7;\n if (options !== null && options !== void 0 && (_options$signal7 = options.signal) !== null && _options$signal7 !== void 0 && _options$signal7.aborted)\n throw new AbortError2(void 0, {\n cause: options.signal.reason\n });\n ArrayPrototypePush(result, val);\n }\n return result;\n }\n function flatMap(fn, options) {\n const values = map.@call(this, fn, options);\n return async function* flatMap2() {\n for await (let val of values)\n yield* val;\n }.@call(this);\n }\n function toIntegerOrInfinity(number) {\n if (number = Number2(number), NumberIsNaN(number))\n return 0;\n if (number < 0)\n throw new ERR_OUT_OF_RANGE(\"number\", \">= 0\", number);\n return number;\n }\n function drop(number, options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return number = toIntegerOrInfinity(number), async function* drop2() {\n var _options$signal8;\n if (options !== null && options !== void 0 && (_options$signal8 = options.signal) !== null && _options$signal8 !== void 0 && _options$signal8.aborted)\n throw new AbortError2;\n for await (let val of this) {\n var _options$signal9;\n if (options !== null && options !== void 0 && (_options$signal9 = options.signal) !== null && _options$signal9 !== void 0 && _options$signal9.aborted)\n throw new AbortError2;\n if (number-- <= 0)\n yield val;\n }\n }.@call(this);\n }\n function take(number, options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return number = toIntegerOrInfinity(number), async function* take2() {\n var _options$signal10;\n if (options !== null && options !== void 0 && (_options$signal10 = options.signal) !== null && _options$signal10 !== void 0 && _options$signal10.aborted)\n throw new AbortError2;\n for await (let val of this) {\n var _options$signal11;\n if (options !== null && options !== void 0 && (_options$signal11 = options.signal) !== null && _options$signal11 !== void 0 && _options$signal11.aborted)\n throw new AbortError2;\n if (number-- > 0)\n yield val;\n else\n return;\n }\n }.@call(this);\n }\n module.exports.streamReturningOperators = {\n asIndexedPairs,\n drop,\n filter,\n flatMap,\n map,\n take\n }, module.exports.promiseReturningOperators = {\n every,\n forEach,\n reduce,\n toArray,\n some,\n find\n };\n }\n}), require_destroy = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/destroy.js\"(exports, module) {\n var {\n aggregateTwoErrors,\n codes: { ERR_MULTIPLE_CALLBACK },\n AbortError: AbortError2\n } = require_errors(), { Symbol: Symbol2 } = require_primordials(), { kDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils(), kDestroy = \"#kDestroy\", kConstruct = \"#kConstruct\";\n function checkError(err, w, r) {\n if (err) {\n if (err.stack, w && !w.errored)\n w.errored = err;\n if (r && !r.errored)\n r.errored = err;\n }\n }\n function destroy2(err, cb) {\n const r = this._readableState, w = this._writableState, s = w || r;\n if (w && w.destroyed || r && r.destroyed) {\n if (typeof cb === \"function\")\n cb();\n return this;\n }\n if (checkError(err, w, r), w)\n w.destroyed = !0;\n if (r)\n r.destroyed = !0;\n if (!s.constructed)\n this.once(kDestroy, (er) => {\n _destroy(this, aggregateTwoErrors(er, err), cb);\n });\n else\n _destroy(this, err, cb);\n return this;\n }\n function _destroy(self, err, cb) {\n let called = !1;\n function onDestroy(err2) {\n if (called)\n return;\n called = !0;\n const { _readableState: r, _writableState: w } = self;\n if (checkError(err2, w, r), w)\n w.closed = !0;\n if (r)\n r.closed = !0;\n if (typeof cb === \"function\")\n cb(err2);\n if (err2)\n runOnNextTick(emitErrorCloseNT, self, err2);\n else\n runOnNextTick(emitCloseNT, self);\n }\n try {\n self._destroy(err || null, onDestroy);\n } catch (err2) {\n onDestroy(err2);\n }\n }\n function emitErrorCloseNT(self, err) {\n emitErrorNT(self, err), emitCloseNT(self);\n }\n function emitCloseNT(self) {\n const { _readableState: r, _writableState: w } = self;\n if (w)\n w.closeEmitted = !0;\n if (r)\n r.closeEmitted = !0;\n if (w && w.emitClose || r && r.emitClose)\n self.emit(\"close\");\n }\n function emitErrorNT(self, err) {\n const r = self\?._readableState, w = self\?._writableState;\n if (w\?.errorEmitted || r\?.errorEmitted)\n return;\n if (w)\n w.errorEmitted = !0;\n if (r)\n r.errorEmitted = !0;\n self\?.emit\?.(\"error\", err);\n }\n function undestroy() {\n const r = this._readableState, w = this._writableState;\n if (r)\n r.constructed = !0, r.closed = !1, r.closeEmitted = !1, r.destroyed = !1, r.errored = null, r.errorEmitted = !1, r.reading = !1, r.ended = r.readable === !1, r.endEmitted = r.readable === !1;\n if (w)\n w.constructed = !0, w.destroyed = !1, w.closed = !1, w.closeEmitted = !1, w.errored = null, w.errorEmitted = !1, w.finalCalled = !1, w.prefinished = !1, w.ended = w.writable === !1, w.ending = w.writable === !1, w.finished = w.writable === !1;\n }\n function errorOrDestroy2(stream, err, sync) {\n const r = stream\?._readableState, w = stream\?._writableState;\n if (w && w.destroyed || r && r.destroyed)\n return this;\n if (r && r.autoDestroy || w && w.autoDestroy)\n stream.destroy(err);\n else if (err) {\n if (Error.captureStackTrace(err), w && !w.errored)\n w.errored = err;\n if (r && !r.errored)\n r.errored = err;\n if (sync)\n runOnNextTick(emitErrorNT, stream, err);\n else\n emitErrorNT(stream, err);\n }\n }\n function construct(stream, cb) {\n if (typeof stream._construct !== \"function\")\n return;\n const { _readableState: r, _writableState: w } = stream;\n if (r)\n r.constructed = !1;\n if (w)\n w.constructed = !1;\n if (stream.once(kConstruct, cb), stream.listenerCount(kConstruct) > 1)\n return;\n runOnNextTick(constructNT, stream);\n }\n function constructNT(stream) {\n let called = !1;\n function onConstruct(err) {\n if (called) {\n errorOrDestroy2(stream, err !== null && err !== void 0 \? err : new ERR_MULTIPLE_CALLBACK);\n return;\n }\n called = !0;\n const { _readableState: r, _writableState: w } = stream, s = w || r;\n if (r)\n r.constructed = !0;\n if (w)\n w.constructed = !0;\n if (s.destroyed)\n stream.emit(kDestroy, err);\n else if (err)\n errorOrDestroy2(stream, err, !0);\n else\n runOnNextTick(emitConstructNT, stream);\n }\n try {\n stream._construct(onConstruct);\n } catch (err) {\n onConstruct(err);\n }\n }\n function emitConstructNT(stream) {\n stream.emit(kConstruct);\n }\n function isRequest(stream) {\n return stream && stream.setHeader && typeof stream.abort === \"function\";\n }\n function emitCloseLegacy(stream) {\n stream.emit(\"close\");\n }\n function emitErrorCloseLegacy(stream, err) {\n stream.emit(\"error\", err), runOnNextTick(emitCloseLegacy, stream);\n }\n function destroyer(stream, err) {\n if (!stream || isDestroyed(stream))\n return;\n if (!err && !isFinished(stream))\n err = new AbortError2;\n if (isServerRequest(stream))\n stream.socket = null, stream.destroy(err);\n else if (isRequest(stream))\n stream.abort();\n else if (isRequest(stream.req))\n stream.req.abort();\n else if (typeof stream.destroy === \"function\")\n stream.destroy(err);\n else if (typeof stream.close === \"function\")\n stream.close();\n else if (err)\n runOnNextTick(emitErrorCloseLegacy, stream);\n else\n runOnNextTick(emitCloseLegacy, stream);\n if (!stream.destroyed)\n stream[kDestroyed] = !0;\n }\n module.exports = {\n construct,\n destroyer,\n destroy: destroy2,\n undestroy,\n errorOrDestroy: errorOrDestroy2\n };\n }\n}), require_legacy = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/legacy.js\"(exports, module) {\n var { ArrayIsArray: ArrayIsArray2, ObjectSetPrototypeOf } = require_primordials();\n function Stream(options) {\n if (!(this instanceof Stream))\n return new Stream(options);\n EE.@call(this, options);\n }\n Stream.prototype = {}, ObjectSetPrototypeOf(Stream.prototype, EE.prototype), ObjectSetPrototypeOf(Stream, EE), Stream.prototype.pipe = function(dest, options) {\n const source = this;\n function ondata(chunk) {\n if (dest.writable && dest.write(chunk) === !1 && source.pause)\n source.pause();\n }\n source.on(\"data\", ondata);\n function ondrain() {\n if (source.readable && source.resume)\n source.resume();\n }\n if (dest.on(\"drain\", ondrain), !dest._isStdio && (!options || options.end !== !1))\n source.on(\"end\", onend), source.on(\"close\", onclose);\n let didOnEnd = !1;\n function onend() {\n if (didOnEnd)\n return;\n didOnEnd = !0, dest.end();\n }\n function onclose() {\n if (didOnEnd)\n return;\n if (didOnEnd = !0, typeof dest.destroy === \"function\")\n dest.destroy();\n }\n function onerror(er) {\n if (cleanup(), EE.listenerCount(this, \"error\") === 0)\n this.emit(\"error\", er);\n }\n prependListener(source, \"error\", onerror), prependListener(dest, \"error\", onerror);\n function cleanup() {\n source.removeListener(\"data\", ondata), dest.removeListener(\"drain\", ondrain), source.removeListener(\"end\", onend), source.removeListener(\"close\", onclose), source.removeListener(\"error\", onerror), dest.removeListener(\"error\", onerror), source.removeListener(\"end\", cleanup), source.removeListener(\"close\", cleanup), dest.removeListener(\"close\", cleanup);\n }\n return source.on(\"end\", cleanup), source.on(\"close\", cleanup), dest.on(\"close\", cleanup), dest.emit(\"pipe\", source), dest;\n };\n function prependListener(emitter, event, fn) {\n if (typeof emitter.prependListener === \"function\")\n return emitter.prependListener(event, fn);\n if (!emitter._events || !emitter._events[event])\n emitter.on(event, fn);\n else if (ArrayIsArray2(emitter._events[event]))\n emitter._events[event].unshift(fn);\n else\n emitter._events[event] = [fn, emitter._events[event]];\n }\n module.exports = {\n Stream,\n prependListener\n };\n }\n}), require_add_abort_signal = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/add-abort-signal.js\"(exports, module) {\n var { AbortError: AbortError2, codes } = require_errors(), eos = require_end_of_stream(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2 } = codes, validateAbortSignal = (signal, name) => {\n if (typeof signal !== \"object\" || !(\"aborted\" in signal))\n throw new ERR_INVALID_ARG_TYPE2(name, \"AbortSignal\", signal);\n };\n function isNodeStream(obj) {\n return !!(obj && typeof obj.pipe === \"function\");\n }\n module.exports.addAbortSignal = function addAbortSignal(signal, stream) {\n if (validateAbortSignal(signal, \"signal\"), !isNodeStream(stream))\n throw new ERR_INVALID_ARG_TYPE2(\"stream\", \"stream.Stream\", stream);\n return module.exports.addAbortSignalNoValidate(signal, stream);\n }, module.exports.addAbortSignalNoValidate = function(signal, stream) {\n if (typeof signal !== \"object\" || !(\"aborted\" in signal))\n return stream;\n const onAbort = () => {\n stream.destroy(new AbortError2(void 0, {\n cause: signal.reason\n }));\n };\n if (signal.aborted)\n onAbort();\n else\n signal.addEventListener(\"abort\", onAbort), eos(stream, () => signal.removeEventListener(\"abort\", onAbort));\n return stream;\n };\n }\n}), require_state = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/state.js\"(exports, module) {\n var { MathFloor, NumberIsInteger } = require_primordials(), { ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2 } = require_errors().codes;\n function highWaterMarkFrom(options, isDuplex, duplexKey) {\n return options.highWaterMark != null \? options.highWaterMark : isDuplex \? options[duplexKey] : null;\n }\n function getDefaultHighWaterMark(objectMode) {\n return objectMode \? 16 : 16384;\n }\n function getHighWaterMark(state, options, duplexKey, isDuplex) {\n const hwm = highWaterMarkFrom(options, isDuplex, duplexKey);\n if (hwm != null) {\n if (!NumberIsInteger(hwm) || hwm < 0) {\n const name = isDuplex \? `options.${duplexKey}` : \"options.highWaterMark\";\n throw new ERR_INVALID_ARG_VALUE2(name, hwm);\n }\n return MathFloor(hwm);\n }\n return getDefaultHighWaterMark(state.objectMode);\n }\n module.exports = {\n getHighWaterMark,\n getDefaultHighWaterMark\n };\n }\n}), require_from = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/from.js\"(exports, module) {\n var { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_NULL_VALUES } = require_errors().codes;\n function from(Readable, iterable, opts) {\n let iterator;\n if (typeof iterable === \"string\" || iterable instanceof @Buffer)\n return new Readable({\n objectMode: !0,\n ...opts,\n read() {\n this.push(iterable), this.push(null);\n }\n });\n let isAsync;\n if (iterable && iterable[SymbolAsyncIterator])\n isAsync = !0, iterator = iterable[SymbolAsyncIterator]();\n else if (iterable && iterable[SymbolIterator])\n isAsync = !1, iterator = iterable[SymbolIterator]();\n else\n throw new ERR_INVALID_ARG_TYPE2(\"iterable\", [\"Iterable\"], iterable);\n const readable = new Readable({\n objectMode: !0,\n highWaterMark: 1,\n ...opts\n });\n let reading = !1;\n readable._read = function() {\n if (!reading)\n reading = !0, next();\n }, readable._destroy = function(error, cb) {\n PromisePrototypeThen(close(error), () => runOnNextTick(cb, error), (e) => runOnNextTick(cb, e || error));\n };\n async function close(error) {\n const hadError = error !== void 0 && error !== null, hasThrow = typeof iterator.throw === \"function\";\n if (hadError && hasThrow) {\n const { value, done } = await iterator.throw(error);\n if (await value, done)\n return;\n }\n if (typeof iterator.return === \"function\") {\n const { value } = await iterator.return();\n await value;\n }\n }\n async function next() {\n for (;; ) {\n try {\n const { value, done } = isAsync \? await iterator.next() : iterator.next();\n if (done)\n readable.push(null);\n else {\n const res = value && typeof value.then === \"function\" \? await value : value;\n if (res === null)\n throw reading = !1, new ERR_STREAM_NULL_VALUES;\n else if (readable.push(res))\n continue;\n else\n reading = !1;\n }\n } catch (err) {\n readable.destroy(err);\n }\n break;\n }\n }\n return readable;\n }\n module.exports = from;\n }\n}), _ReadableFromWeb, _ReadableFromWebForUndici, require_readable = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/readable.js\"(exports, module) {\n var {\n ArrayPrototypeIndexOf,\n NumberIsInteger,\n NumberIsNaN,\n NumberParseInt,\n ObjectDefineProperties,\n ObjectKeys,\n ObjectSetPrototypeOf,\n Promise: Promise2,\n SafeSet,\n SymbolAsyncIterator,\n Symbol: Symbol2\n } = require_primordials(), ReadableState = @lazy(\"bun:stream\").ReadableState, { Stream, prependListener } = require_legacy();\n function Readable(options) {\n if (!(this instanceof Readable))\n return new Readable(options);\n const isDuplex = this instanceof require_duplex();\n if (this._readableState = new ReadableState(options, this, isDuplex), options) {\n const { read, destroy: destroy2, construct, signal } = options;\n if (typeof read === \"function\")\n this._read = read;\n if (typeof destroy2 === \"function\")\n this._destroy = destroy2;\n if (typeof construct === \"function\")\n this._construct = construct;\n if (signal && !isDuplex)\n addAbortSignal(signal, this);\n }\n Stream.@call(this, options), destroyImpl.construct(this, () => {\n if (this._readableState.needReadable)\n maybeReadMore(this, this._readableState);\n });\n }\n Readable.prototype = {}, ObjectSetPrototypeOf(Readable.prototype, Stream.prototype), ObjectSetPrototypeOf(Readable, Stream), Readable.prototype.on = function(ev, fn) {\n const res = Stream.prototype.on.@call(this, ev, fn), state = this._readableState;\n if (ev === \"data\") {\n if (state.readableListening = this.listenerCount(\"readable\") > 0, state.flowing !== !1)\n this.resume();\n } else if (ev === \"readable\") {\n if (!state.endEmitted && !state.readableListening) {\n if (state.readableListening = state.needReadable = !0, state.flowing = !1, state.emittedReadable = !1, state.length)\n emitReadable(this, state);\n else if (!state.reading)\n runOnNextTick(nReadingNextTick, this);\n } else if (state.endEmitted)\n ;\n }\n return res;\n };\n\n class ReadableFromWeb extends Readable {\n #reader;\n #closed;\n #pendingChunks;\n #stream;\n constructor(options, stream) {\n const { objectMode, highWaterMark, encoding, signal } = options;\n super({\n objectMode,\n highWaterMark,\n encoding,\n signal\n });\n this.#pendingChunks = [], this.#reader = @undefined, this.#stream = stream, this.#closed = !1;\n }\n #drainPending() {\n var pendingChunks = this.#pendingChunks, pendingChunksI = 0, pendingChunksCount = pendingChunks.length;\n for (;pendingChunksI < pendingChunksCount; pendingChunksI++) {\n const chunk = pendingChunks[pendingChunksI];\n if (pendingChunks[pendingChunksI] = @undefined, !this.push(chunk, @undefined))\n return this.#pendingChunks = pendingChunks.slice(pendingChunksI + 1), !0;\n }\n if (pendingChunksCount > 0)\n this.#pendingChunks = [];\n return !1;\n }\n #handleDone(reader) {\n reader.releaseLock(), this.#reader = @undefined, this.#closed = !0, this.push(null);\n return;\n }\n async _read() {\n var stream = this.#stream, reader = this.#reader;\n if (stream)\n reader = this.#reader = stream.getReader(), this.#stream = @undefined;\n else if (this.#drainPending())\n return;\n var deferredError;\n try {\n do {\n var done = !1, value;\n const firstResult = reader.readMany();\n if (@isPromise(firstResult)) {\n if ({ done, value } = await firstResult, this.#closed) {\n this.#pendingChunks.push(...value);\n return;\n }\n } else\n ({ done, value } = firstResult);\n if (done) {\n this.#handleDone(reader);\n return;\n }\n if (!this.push(value[0])) {\n this.#pendingChunks = value.slice(1);\n return;\n }\n for (let i = 1, count = value.length;i < count; i++)\n if (!this.push(value[i])) {\n this.#pendingChunks = value.slice(i + 1);\n return;\n }\n } while (!this.#closed);\n } catch (e) {\n deferredError = e;\n } finally {\n if (deferredError)\n throw deferredError;\n }\n }\n _destroy(error, callback) {\n if (!this.#closed) {\n var reader = this.#reader;\n if (reader)\n this.#reader = @undefined, reader.cancel(error).finally(() => {\n this.#closed = !0, callback(error);\n });\n return;\n }\n try {\n callback(error);\n } catch (error2) {\n globalThis.reportError(error2);\n }\n }\n }\n _ReadableFromWebForUndici = ReadableFromWeb;\n function newStreamReadableFromReadableStream(readableStream, options = {}) {\n if (!isReadableStream(readableStream))\n throw new ERR_INVALID_ARG_TYPE2(\"readableStream\", \"ReadableStream\", readableStream);\n validateObject(options, \"options\");\n const {\n highWaterMark,\n encoding,\n objectMode = !1,\n signal\n } = options;\n if (encoding !== @undefined && !@Buffer.isEncoding(encoding))\n throw new ERR_INVALID_ARG_VALUE(encoding, \"options.encoding\");\n return validateBoolean(objectMode, \"options.objectMode\"), getNativeReadableStream(Readable, readableStream, options) || new ReadableFromWeb({\n highWaterMark,\n encoding,\n objectMode,\n signal\n }, readableStream);\n }\n module.exports = Readable, _ReadableFromWeb = newStreamReadableFromReadableStream;\n var { addAbortSignal } = require_add_abort_signal(), eos = require_end_of_stream();\n const { maybeReadMore: _maybeReadMore, resume, emitReadable: _emitReadable, onEofChunk } = @lazy(\"bun:stream\");\n function maybeReadMore(stream, state) {\n process.nextTick(_maybeReadMore, stream, state);\n }\n function emitReadable(stream, state) {\n _emitReadable(stream, state);\n }\n var destroyImpl = require_destroy(), {\n aggregateTwoErrors,\n codes: {\n ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_OUT_OF_RANGE,\n ERR_STREAM_PUSH_AFTER_EOF,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT\n }\n } = require_errors(), { validateObject } = require_validators(), from = require_from(), nop = () => {\n }, { errorOrDestroy: errorOrDestroy2 } = destroyImpl;\n Readable.prototype.destroy = destroyImpl.destroy, Readable.prototype._undestroy = destroyImpl.undestroy, Readable.prototype._destroy = function(err, cb) {\n cb(err);\n }, Readable.prototype[EE.captureRejectionSymbol] = function(err) {\n this.destroy(err);\n }, Readable.prototype.push = function(chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, !1);\n }, Readable.prototype.unshift = function(chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, !0);\n };\n function readableAddChunk(stream, chunk, encoding, addToFront) {\n const state = stream._readableState;\n let err;\n if (!state.objectMode) {\n if (typeof chunk === \"string\") {\n if (encoding = encoding || state.defaultEncoding, state.encoding !== encoding)\n if (addToFront && state.encoding)\n chunk = @Buffer.from(chunk, encoding).toString(state.encoding);\n else\n chunk = @Buffer.from(chunk, encoding), encoding = \"\";\n } else if (chunk instanceof @Buffer)\n encoding = \"\";\n else if (Stream._isUint8Array(chunk)) {\n if (addToFront || !state.decoder)\n chunk = Stream._uint8ArrayToBuffer(chunk);\n encoding = \"\";\n } else if (chunk != null)\n err = new ERR_INVALID_ARG_TYPE2(\"chunk\", [\"string\", \"Buffer\", \"Uint8Array\"], chunk);\n }\n if (err)\n errorOrDestroy2(stream, err);\n else if (chunk === null)\n state.reading = !1, onEofChunk(stream, state);\n else if (state.objectMode || chunk && chunk.length > 0)\n if (addToFront)\n if (state.endEmitted)\n errorOrDestroy2(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT);\n else if (state.destroyed || state.errored)\n return !1;\n else\n addChunk(stream, state, chunk, !0);\n else if (state.ended)\n errorOrDestroy2(stream, new ERR_STREAM_PUSH_AFTER_EOF);\n else if (state.destroyed || state.errored)\n return !1;\n else if (state.reading = !1, state.decoder && !encoding)\n if (chunk = state.decoder.write(chunk), state.objectMode || chunk.length !== 0)\n addChunk(stream, state, chunk, !1);\n else\n maybeReadMore(stream, state);\n else\n addChunk(stream, state, chunk, !1);\n else if (!addToFront)\n state.reading = !1, maybeReadMore(stream, state);\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n }\n function addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync && stream.listenerCount(\"data\") > 0) {\n if (state.multiAwaitDrain)\n state.awaitDrainWriters.clear();\n else\n state.awaitDrainWriters = null;\n state.dataEmitted = !0, stream.emit(\"data\", chunk);\n } else {\n if (state.length += state.objectMode \? 1 : chunk.length, addToFront)\n state.buffer.unshift(chunk);\n else\n state.buffer.push(chunk);\n if (state.needReadable)\n emitReadable(stream, state);\n }\n maybeReadMore(stream, state);\n }\n Readable.prototype.isPaused = function() {\n const state = this._readableState;\n return state.paused === !0 || state.flowing === !1;\n }, Readable.prototype.setEncoding = function(enc) {\n const decoder = new StringDecoder(enc);\n this._readableState.decoder = decoder, this._readableState.encoding = this._readableState.decoder.encoding;\n const buffer = this._readableState.buffer;\n let content = \"\";\n for (let i = buffer.length;i > 0; i--)\n content += decoder.write(buffer.shift());\n if (content !== \"\")\n buffer.push(content);\n return this._readableState.length = content.length, this;\n };\n var MAX_HWM = 1073741824;\n function computeNewHighWaterMark(n) {\n if (n > MAX_HWM)\n throw new ERR_OUT_OF_RANGE(\"size\", \"<= 1GiB\", n);\n else\n n--, n |= n >>> 1, n |= n >>> 2, n |= n >>> 4, n |= n >>> 8, n |= n >>> 16, n++;\n return n;\n }\n function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended)\n return 0;\n if (state.objectMode)\n return 1;\n if (NumberIsNaN(n)) {\n if (state.flowing && state.length)\n return state.buffer.first().length;\n return state.length;\n }\n if (n <= state.length)\n return n;\n return state.ended \? state.length : 0;\n }\n Readable.prototype.read = function(n) {\n if (!NumberIsInteger(n))\n n = NumberParseInt(n, 10);\n const state = this._readableState, nOrig = n;\n if (n > state.highWaterMark)\n state.highWaterMark = computeNewHighWaterMark(n);\n if (n !== 0)\n state.emittedReadable = !1;\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 \? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n if (state.length === 0 && state.ended)\n endReadable(this);\n else\n emitReadable(this, state);\n return null;\n }\n if (n = howMuchToRead(n, state), n === 0 && state.ended) {\n if (state.length === 0)\n endReadable(this);\n return null;\n }\n let doRead = state.needReadable;\n if (state.length === 0 || state.length - n < state.highWaterMark)\n doRead = !0;\n if (state.ended || state.reading || state.destroyed || state.errored || !state.constructed)\n doRead = !1;\n else if (doRead) {\n if (state.reading = !0, state.sync = !0, state.length === 0)\n state.needReadable = !0;\n try {\n var result = this._read(state.highWaterMark);\n if (@isPromise(result)) {\n const peeked = Bun.peek(result);\n if (peeked !== result)\n result = peeked;\n }\n if (@isPromise(result) && result\?.then && @isCallable(result.then))\n result.then(nop, function(err) {\n errorOrDestroy2(this, err);\n });\n } catch (err) {\n errorOrDestroy2(this, err);\n }\n if (state.sync = !1, !state.reading)\n n = howMuchToRead(nOrig, state);\n }\n let ret;\n if (n > 0)\n ret = fromList(n, state);\n else\n ret = null;\n if (ret === null)\n state.needReadable = state.length <= state.highWaterMark, n = 0;\n else if (state.length -= n, state.multiAwaitDrain)\n state.awaitDrainWriters.clear();\n else\n state.awaitDrainWriters = null;\n if (state.length === 0) {\n if (!state.ended)\n state.needReadable = !0;\n if (nOrig !== n && state.ended)\n endReadable(this);\n }\n if (ret !== null && !state.errorEmitted && !state.closeEmitted)\n state.dataEmitted = !0, this.emit(\"data\", ret);\n return ret;\n }, Readable.prototype._read = function(n) {\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_read()\");\n }, Readable.prototype.pipe = function(dest, pipeOpts) {\n const src = this, state = this._readableState;\n if (state.pipes.length === 1) {\n if (!state.multiAwaitDrain)\n state.multiAwaitDrain = !0, state.awaitDrainWriters = new SafeSet(state.awaitDrainWriters \? [state.awaitDrainWriters] : []);\n }\n state.pipes.push(dest);\n const endFn = (!pipeOpts || pipeOpts.end !== !1) && dest !== process.stdout && dest !== process.stderr \? onend : unpipe;\n if (state.endEmitted)\n runOnNextTick(endFn);\n else\n src.once(\"end\", endFn);\n dest.on(\"unpipe\", onunpipe);\n function onunpipe(readable, unpipeInfo) {\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === !1)\n unpipeInfo.hasUnpiped = !0, cleanup();\n }\n }\n function onend() {\n dest.end();\n }\n let ondrain, cleanedUp = !1;\n function cleanup() {\n if (dest.removeListener(\"close\", onclose), dest.removeListener(\"finish\", onfinish), ondrain)\n dest.removeListener(\"drain\", ondrain);\n if (dest.removeListener(\"error\", onerror), dest.removeListener(\"unpipe\", onunpipe), src.removeListener(\"end\", onend), src.removeListener(\"end\", unpipe), src.removeListener(\"data\", ondata), cleanedUp = !0, ondrain && state.awaitDrainWriters && (!dest._writableState || dest._writableState.needDrain))\n ondrain();\n }\n function pause() {\n if (!cleanedUp) {\n if (state.pipes.length === 1 && state.pipes[0] === dest)\n state.awaitDrainWriters = dest, state.multiAwaitDrain = !1;\n else if (state.pipes.length > 1 && state.pipes.includes(dest))\n state.awaitDrainWriters.add(dest);\n src.pause();\n }\n if (!ondrain)\n ondrain = pipeOnDrain(src, dest), dest.on(\"drain\", ondrain);\n }\n src.on(\"data\", ondata);\n function ondata(chunk) {\n if (dest.write(chunk) === !1)\n pause();\n }\n function onerror(er) {\n if (unpipe(), dest.removeListener(\"error\", onerror), dest.listenerCount(\"error\") === 0) {\n const s = dest._writableState || dest._readableState;\n if (s && !s.errorEmitted)\n errorOrDestroy2(dest, er);\n else\n dest.emit(\"error\", er);\n }\n }\n prependListener(dest, \"error\", onerror);\n function onclose() {\n dest.removeListener(\"finish\", onfinish), unpipe();\n }\n dest.once(\"close\", onclose);\n function onfinish() {\n dest.removeListener(\"close\", onclose), unpipe();\n }\n dest.once(\"finish\", onfinish);\n function unpipe() {\n src.unpipe(dest);\n }\n if (dest.emit(\"pipe\", src), dest.writableNeedDrain === !0) {\n if (state.flowing)\n pause();\n } else if (!state.flowing)\n src.resume();\n return dest;\n };\n function pipeOnDrain(src, dest) {\n return function pipeOnDrainFunctionResult() {\n const state = src._readableState;\n if (state.awaitDrainWriters === dest)\n state.awaitDrainWriters = null;\n else if (state.multiAwaitDrain)\n state.awaitDrainWriters.delete(dest);\n if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && src.listenerCount(\"data\"))\n src.resume();\n };\n }\n Readable.prototype.unpipe = function(dest) {\n const state = this._readableState, unpipeInfo = {\n hasUnpiped: !1\n };\n if (state.pipes.length === 0)\n return this;\n if (!dest) {\n const dests = state.pipes;\n state.pipes = [], this.pause();\n for (let i = 0;i < dests.length; i++)\n dests[i].emit(\"unpipe\", this, {\n hasUnpiped: !1\n });\n return this;\n }\n const index = ArrayPrototypeIndexOf(state.pipes, dest);\n if (index === -1)\n return this;\n if (state.pipes.splice(index, 1), state.pipes.length === 0)\n this.pause();\n return dest.emit(\"unpipe\", this, unpipeInfo), this;\n }, Readable.prototype.addListener = Readable.prototype.on, Readable.prototype.removeListener = function(ev, fn) {\n const res = Stream.prototype.removeListener.@call(this, ev, fn);\n if (ev === \"readable\")\n runOnNextTick(updateReadableListening, this);\n return res;\n }, Readable.prototype.off = Readable.prototype.removeListener, Readable.prototype.removeAllListeners = function(ev) {\n const res = Stream.prototype.removeAllListeners.@apply(this, arguments);\n if (ev === \"readable\" || ev === void 0)\n runOnNextTick(updateReadableListening, this);\n return res;\n };\n function updateReadableListening(self) {\n const state = self._readableState;\n if (state.readableListening = self.listenerCount(\"readable\") > 0, state.resumeScheduled && state.paused === !1)\n state.flowing = !0;\n else if (self.listenerCount(\"data\") > 0)\n self.resume();\n else if (!state.readableListening)\n state.flowing = null;\n }\n function nReadingNextTick(self) {\n self.read(0);\n }\n Readable.prototype.resume = function() {\n const state = this._readableState;\n if (!state.flowing)\n state.flowing = !state.readableListening, resume(this, state);\n return state.paused = !1, this;\n }, Readable.prototype.pause = function() {\n if (this._readableState.flowing !== !1)\n this._readableState.flowing = !1, this.emit(\"pause\");\n return this._readableState.paused = !0, this;\n }, Readable.prototype.wrap = function(stream) {\n let paused = !1;\n stream.on(\"data\", (chunk) => {\n if (!this.push(chunk) && stream.pause)\n paused = !0, stream.pause();\n }), stream.on(\"end\", () => {\n this.push(null);\n }), stream.on(\"error\", (err) => {\n errorOrDestroy2(this, err);\n }), stream.on(\"close\", () => {\n this.destroy();\n }), stream.on(\"destroy\", () => {\n this.destroy();\n }), this._read = () => {\n if (paused && stream.resume)\n paused = !1, stream.resume();\n };\n const streamKeys = ObjectKeys(stream);\n for (let j = 1;j < streamKeys.length; j++) {\n const i = streamKeys[j];\n if (this[i] === void 0 && typeof stream[i] === \"function\")\n this[i] = stream[i].bind(stream);\n }\n return this;\n }, Readable.prototype[SymbolAsyncIterator] = function() {\n return streamToAsyncIterator(this);\n }, Readable.prototype.iterator = function(options) {\n if (options !== void 0)\n validateObject(options, \"options\");\n return streamToAsyncIterator(this, options);\n };\n function streamToAsyncIterator(stream, options) {\n if (typeof stream.read !== \"function\")\n stream = Readable.wrap(stream, {\n objectMode: !0\n });\n const iter = createAsyncIterator(stream, options);\n return iter.stream = stream, iter;\n }\n async function* createAsyncIterator(stream, options) {\n let callback = nop;\n function next(resolve) {\n if (this === stream)\n callback(), callback = nop;\n else\n callback = resolve;\n }\n stream.on(\"readable\", next);\n let error;\n const cleanup = eos(stream, {\n writable: !1\n }, (err) => {\n error = err \? aggregateTwoErrors(error, err) : null, callback(), callback = nop;\n });\n try {\n while (!0) {\n const chunk = stream.destroyed \? null : stream.read();\n if (chunk !== null)\n yield chunk;\n else if (error)\n throw error;\n else if (error === null)\n return;\n else\n await new Promise2(next);\n }\n } catch (err) {\n throw error = aggregateTwoErrors(error, err), error;\n } finally {\n if ((error || (options === null || options === void 0 \? void 0 : options.destroyOnReturn) !== !1) && (error === void 0 || stream._readableState.autoDestroy))\n destroyImpl.destroyer(stream, null);\n else\n stream.off(\"readable\", next), cleanup();\n }\n }\n ObjectDefineProperties(Readable.prototype, {\n readable: {\n get() {\n const r = this._readableState;\n return !!r && r.readable !== !1 && !r.destroyed && !r.errorEmitted && !r.endEmitted;\n },\n set(val) {\n if (this._readableState)\n this._readableState.readable = !!val;\n }\n },\n readableDidRead: {\n enumerable: !1,\n get: function() {\n return this._readableState.dataEmitted;\n }\n },\n readableAborted: {\n enumerable: !1,\n get: function() {\n return !!(this._readableState.readable !== !1 && (this._readableState.destroyed || this._readableState.errored) && !this._readableState.endEmitted);\n }\n },\n readableHighWaterMark: {\n enumerable: !1,\n get: function() {\n return this._readableState.highWaterMark;\n }\n },\n readableBuffer: {\n enumerable: !1,\n get: function() {\n return this._readableState && this._readableState.buffer;\n }\n },\n readableFlowing: {\n enumerable: !1,\n get: function() {\n return this._readableState.flowing;\n },\n set: function(state) {\n if (this._readableState)\n this._readableState.flowing = state;\n }\n },\n readableLength: {\n enumerable: !1,\n get() {\n return this._readableState.length;\n }\n },\n readableObjectMode: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.objectMode : !1;\n }\n },\n readableEncoding: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.encoding : null;\n }\n },\n errored: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.errored : null;\n }\n },\n closed: {\n get() {\n return this._readableState \? this._readableState.closed : !1;\n }\n },\n destroyed: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.destroyed : !1;\n },\n set(value) {\n if (!this._readableState)\n return;\n this._readableState.destroyed = value;\n }\n },\n readableEnded: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.endEmitted : !1;\n }\n }\n }), Readable._fromList = fromList;\n function fromList(n, state) {\n if (state.length === 0)\n return null;\n let ret;\n if (state.objectMode)\n ret = state.buffer.shift();\n else if (!n || n >= state.length) {\n if (state.decoder)\n ret = state.buffer.join(\"\");\n else if (state.buffer.length === 1)\n ret = state.buffer.first();\n else\n ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else\n ret = state.buffer.consume(n, state.decoder);\n return ret;\n }\n function endReadable(stream) {\n const state = stream._readableState;\n if (!state.endEmitted)\n state.ended = !0, runOnNextTick(endReadableNT, state, stream);\n }\n function endReadableNT(state, stream) {\n if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) {\n if (state.endEmitted = !0, stream.emit(\"end\"), stream.writable && stream.allowHalfOpen === !1)\n runOnNextTick(endWritableNT, stream);\n else if (state.autoDestroy) {\n const wState = stream._writableState;\n if (!wState || wState.autoDestroy && (wState.finished || wState.writable === !1))\n stream.destroy();\n }\n }\n }\n function endWritableNT(stream) {\n if (stream.writable && !stream.writableEnded && !stream.destroyed)\n stream.end();\n }\n Readable.from = function(iterable, opts) {\n return from(Readable, iterable, opts);\n };\n var webStreamsAdapters = {\n newStreamReadableFromReadableStream,\n newReadableStreamFromStreamReadable(streamReadable, options = {}) {\n if (typeof streamReadable\?._readableState !== \"object\")\n throw new ERR_INVALID_ARG_TYPE2(\"streamReadable\", \"stream.Readable\", streamReadable);\n var { isDestroyed, isReadable } = require_utils();\n if (isDestroyed(streamReadable) || !isReadable(streamReadable)) {\n const readable = new @ReadableStream;\n return readable.cancel(), readable;\n }\n const { readableObjectMode: objectMode, readableHighWaterMark: highWaterMark } = streamReadable, strategy = ((strategy2) => {\n if (strategy2)\n return strategy2;\n if (objectMode)\n return new CountQueuingStrategy({ highWaterMark });\n return { highWaterMark };\n })(options\?.strategy);\n let controller;\n function onData(chunk) {\n if (controller.enqueue(chunk), controller.desiredSize <= 0)\n streamReadable.pause();\n }\n streamReadable.pause();\n const cleanup = eos(streamReadable, (error) => {\n if (error\?.code === \"ERR_STREAM_PREMATURE_CLOSE\")\n error = new AbortError(@undefined, { cause: error });\n if (cleanup(), streamReadable.on(\"error\", () => {\n }), error)\n return controller.error(error);\n controller.close();\n });\n return streamReadable.on(\"data\", onData), new @ReadableStream({\n start(c) {\n controller = c;\n },\n pull() {\n streamReadable.resume();\n },\n cancel(reason) {\n destroy(streamReadable, reason);\n }\n }, strategy);\n }\n };\n Readable.fromWeb = function(readableStream, options) {\n return webStreamsAdapters.newStreamReadableFromReadableStream(readableStream, options);\n }, Readable.toWeb = function(streamReadable, options) {\n return webStreamsAdapters.newReadableStreamFromStreamReadable(streamReadable, options);\n }, Readable.wrap = function(src, options) {\n var _ref, _src$readableObjectMo;\n return new Readable({\n objectMode: (_ref = (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== void 0 \? _src$readableObjectMo : src.objectMode) !== null && _ref !== void 0 \? _ref : !0,\n ...options,\n destroy(err, callback) {\n destroyImpl.destroyer(src, err), callback(err);\n }\n }).wrap(src);\n };\n }\n}), require_writable = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/writable.js\"(exports, module) {\n var {\n ArrayPrototypeSlice,\n Error: Error2,\n FunctionPrototypeSymbolHasInstance,\n ObjectDefineProperty,\n ObjectDefineProperties,\n ObjectSetPrototypeOf,\n StringPrototypeToLowerCase,\n Symbol: Symbol2,\n SymbolHasInstance\n } = require_primordials(), Stream = require_legacy().Stream, destroyImpl = require_destroy(), { addAbortSignal } = require_add_abort_signal(), { getHighWaterMark, getDefaultHighWaterMark } = require_state(), {\n ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK,\n ERR_STREAM_CANNOT_PIPE,\n ERR_STREAM_DESTROYED,\n ERR_STREAM_ALREADY_FINISHED,\n ERR_STREAM_NULL_VALUES,\n ERR_STREAM_WRITE_AFTER_END,\n ERR_UNKNOWN_ENCODING\n } = require_errors().codes, { errorOrDestroy: errorOrDestroy2 } = destroyImpl;\n function Writable(options = {}) {\n const isDuplex = this instanceof require_duplex();\n if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable, this))\n return new Writable(options);\n if (this._writableState = new WritableState(options, this, isDuplex), options) {\n if (typeof options.write === \"function\")\n this._write = options.write;\n if (typeof options.writev === \"function\")\n this._writev = options.writev;\n if (typeof options.destroy === \"function\")\n this._destroy = options.destroy;\n if (typeof options.final === \"function\")\n this._final = options.final;\n if (typeof options.construct === \"function\")\n this._construct = options.construct;\n if (options.signal)\n addAbortSignal(options.signal, this);\n }\n Stream.@call(this, options), destroyImpl.construct(this, () => {\n const state = this._writableState;\n if (!state.writing)\n clearBuffer(this, state);\n finishMaybe(this, state);\n });\n }\n Writable.prototype = {}, ObjectSetPrototypeOf(Writable.prototype, Stream.prototype), ObjectSetPrototypeOf(Writable, Stream), module.exports = Writable;\n function nop() {\n }\n var kOnFinished = Symbol2(\"kOnFinished\");\n function WritableState(options, stream, isDuplex) {\n if (typeof isDuplex !== \"boolean\")\n isDuplex = stream instanceof require_duplex();\n if (this.objectMode = !!(options && options.objectMode), isDuplex)\n this.objectMode = this.objectMode || !!(options && options.writableObjectMode);\n this.highWaterMark = options \? getHighWaterMark(this, options, \"writableHighWaterMark\", isDuplex) : getDefaultHighWaterMark(!1), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;\n const noDecode = !!(options && options.decodeStrings === !1);\n this.decodeStrings = !noDecode, this.defaultEncoding = options && options.defaultEncoding || \"utf8\", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = onwrite.bind(void 0, stream), this.writecb = null, this.writelen = 0, this.afterWriteTickInfo = null, resetBuffer(this), this.pendingcb = 0, this.constructed = !0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = !options || options.emitClose !== !1, this.autoDestroy = !options || options.autoDestroy !== !1, this.errored = null, this.closed = !1, this.closeEmitted = !1, this[kOnFinished] = [];\n }\n WritableState.prototype = {};\n function resetBuffer(state) {\n state.buffered = [], state.bufferedIndex = 0, state.allBuffers = !0, state.allNoop = !0;\n }\n WritableState.prototype.getBuffer = function getBuffer() {\n return ArrayPrototypeSlice(this.buffered, this.bufferedIndex);\n }, ObjectDefineProperty(WritableState.prototype, \"bufferedRequestCount\", {\n get() {\n return this.buffered.length - this.bufferedIndex;\n }\n }), ObjectDefineProperty(Writable, SymbolHasInstance, {\n value: function(object) {\n if (FunctionPrototypeSymbolHasInstance(this, object))\n return !0;\n if (this !== Writable)\n return !1;\n return object && object._writableState instanceof WritableState;\n }\n }), Writable.prototype.pipe = function() {\n errorOrDestroy2(this, new ERR_STREAM_CANNOT_PIPE);\n };\n function _write(stream, chunk, encoding, cb) {\n const state = stream._writableState;\n if (typeof encoding === \"function\")\n cb = encoding, encoding = state.defaultEncoding;\n else {\n if (!encoding)\n encoding = state.defaultEncoding;\n else if (encoding !== \"buffer\" && !@Buffer.isEncoding(encoding))\n throw new ERR_UNKNOWN_ENCODING(encoding);\n if (typeof cb !== \"function\")\n cb = nop;\n }\n if (chunk === null)\n throw new ERR_STREAM_NULL_VALUES;\n else if (!state.objectMode)\n if (typeof chunk === \"string\") {\n if (state.decodeStrings !== !1)\n chunk = @Buffer.from(chunk, encoding), encoding = \"buffer\";\n } else if (chunk instanceof @Buffer)\n encoding = \"buffer\";\n else if (Stream._isUint8Array(chunk))\n chunk = Stream._uint8ArrayToBuffer(chunk), encoding = \"buffer\";\n else\n throw new ERR_INVALID_ARG_TYPE2(\"chunk\", [\"string\", \"Buffer\", \"Uint8Array\"], chunk);\n let err;\n if (state.ending)\n err = new ERR_STREAM_WRITE_AFTER_END;\n else if (state.destroyed)\n err = new ERR_STREAM_DESTROYED(\"write\");\n if (err)\n return runOnNextTick(cb, err), errorOrDestroy2(stream, err, !0), err;\n return state.pendingcb++, writeOrBuffer(stream, state, chunk, encoding, cb);\n }\n Writable.prototype.write = function(chunk, encoding, cb) {\n return _write(this, chunk, encoding, cb) === !0;\n }, Writable.prototype.cork = function() {\n this._writableState.corked++;\n }, Writable.prototype.uncork = function() {\n const state = this._writableState;\n if (state.corked) {\n if (state.corked--, !state.writing)\n clearBuffer(this, state);\n }\n }, Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n if (typeof encoding === \"string\")\n encoding = StringPrototypeToLowerCase(encoding);\n if (!@Buffer.isEncoding(encoding))\n throw new ERR_UNKNOWN_ENCODING(encoding);\n return this._writableState.defaultEncoding = encoding, this;\n };\n function writeOrBuffer(stream, state, chunk, encoding, callback) {\n const len = state.objectMode \? 1 : chunk.length;\n state.length += len;\n const ret = state.length < state.highWaterMark;\n if (!ret)\n state.needDrain = !0;\n if (state.writing || state.corked || state.errored || !state.constructed) {\n if (state.buffered.push({\n chunk,\n encoding,\n callback\n }), state.allBuffers && encoding !== \"buffer\")\n state.allBuffers = !1;\n if (state.allNoop && callback !== nop)\n state.allNoop = !1;\n } else\n state.writelen = len, state.writecb = callback, state.writing = !0, state.sync = !0, stream._write(chunk, encoding, state.onwrite), state.sync = !1;\n return ret && !state.errored && !state.destroyed;\n }\n function doWrite(stream, state, writev, len, chunk, encoding, cb) {\n if (state.writelen = len, state.writecb = cb, state.writing = !0, state.sync = !0, state.destroyed)\n state.onwrite(new ERR_STREAM_DESTROYED(\"write\"));\n else if (writev)\n stream._writev(chunk, state.onwrite);\n else\n stream._write(chunk, encoding, state.onwrite);\n state.sync = !1;\n }\n function onwriteError(stream, state, er, cb) {\n --state.pendingcb, cb(er), errorBuffer(state), errorOrDestroy2(stream, er);\n }\n function onwrite(stream, er) {\n const state = stream._writableState, sync = state.sync, cb = state.writecb;\n if (typeof cb !== \"function\") {\n errorOrDestroy2(stream, new ERR_MULTIPLE_CALLBACK);\n return;\n }\n if (state.writing = !1, state.writecb = null, state.length -= state.writelen, state.writelen = 0, er) {\n if (Error.captureStackTrace(er), !state.errored)\n state.errored = er;\n if (stream._readableState && !stream._readableState.errored)\n stream._readableState.errored = er;\n if (sync)\n runOnNextTick(onwriteError, stream, state, er, cb);\n else\n onwriteError(stream, state, er, cb);\n } else {\n if (state.buffered.length > state.bufferedIndex)\n clearBuffer(stream, state);\n if (sync)\n if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb)\n state.afterWriteTickInfo.count++;\n else\n state.afterWriteTickInfo = {\n count: 1,\n cb,\n stream,\n state\n }, runOnNextTick(afterWriteTick, state.afterWriteTickInfo);\n else\n afterWrite(stream, state, 1, cb);\n }\n }\n function afterWriteTick({ stream, state, count, cb }) {\n return state.afterWriteTickInfo = null, afterWrite(stream, state, count, cb);\n }\n function afterWrite(stream, state, count, cb) {\n if (!state.ending && !stream.destroyed && state.length === 0 && state.needDrain)\n state.needDrain = !1, stream.emit(\"drain\");\n while (count-- > 0)\n state.pendingcb--, cb();\n if (state.destroyed)\n errorBuffer(state);\n finishMaybe(stream, state);\n }\n function errorBuffer(state) {\n if (state.writing)\n return;\n for (let n = state.bufferedIndex;n < state.buffered.length; ++n) {\n var _state$errored;\n const { chunk, callback } = state.buffered[n], len = state.objectMode \? 1 : chunk.length;\n state.length -= len, callback((_state$errored = state.errored) !== null && _state$errored !== void 0 \? _state$errored : new ERR_STREAM_DESTROYED(\"write\"));\n }\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++) {\n var _state$errored2;\n onfinishCallbacks[i]((_state$errored2 = state.errored) !== null && _state$errored2 !== void 0 \? _state$errored2 : new ERR_STREAM_DESTROYED(\"end\"));\n }\n resetBuffer(state);\n }\n function clearBuffer(stream, state) {\n if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed)\n return;\n const { buffered, bufferedIndex, objectMode } = state, bufferedLength = buffered.length - bufferedIndex;\n if (!bufferedLength)\n return;\n let i = bufferedIndex;\n if (state.bufferProcessing = !0, bufferedLength > 1 && stream._writev) {\n state.pendingcb -= bufferedLength - 1;\n const callback = state.allNoop \? nop : (err) => {\n for (let n = i;n < buffered.length; ++n)\n buffered[n].callback(err);\n }, chunks = state.allNoop && i === 0 \? buffered : ArrayPrototypeSlice(buffered, i);\n chunks.allBuffers = state.allBuffers, doWrite(stream, state, !0, state.length, chunks, \"\", callback), resetBuffer(state);\n } else {\n do {\n const { chunk, encoding, callback } = buffered[i];\n buffered[i++] = null;\n const len = objectMode \? 1 : chunk.length;\n doWrite(stream, state, !1, len, chunk, encoding, callback);\n } while (i < buffered.length && !state.writing);\n if (i === buffered.length)\n resetBuffer(state);\n else if (i > 256)\n buffered.splice(0, i), state.bufferedIndex = 0;\n else\n state.bufferedIndex = i;\n }\n state.bufferProcessing = !1;\n }\n Writable.prototype._write = function(chunk, encoding, cb) {\n if (this._writev)\n this._writev([\n {\n chunk,\n encoding\n }\n ], cb);\n else\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_write()\");\n }, Writable.prototype._writev = null, Writable.prototype.end = function(chunk, encoding, cb, native = !1) {\n const state = this._writableState;\n if (typeof chunk === \"function\")\n cb = chunk, chunk = null, encoding = null;\n else if (typeof encoding === \"function\")\n cb = encoding, encoding = null;\n let err;\n if (chunk !== null && chunk !== void 0) {\n let ret;\n if (!native)\n ret = _write(this, chunk, encoding);\n else\n ret = this.write(chunk, encoding);\n if (ret instanceof Error2)\n err = ret;\n }\n if (state.corked)\n state.corked = 1, this.uncork();\n if (err)\n this.emit(\"error\", err);\n else if (!state.errored && !state.ending)\n state.ending = !0, finishMaybe(this, state, !0), state.ended = !0;\n else if (state.finished)\n err = new ERR_STREAM_ALREADY_FINISHED(\"end\");\n else if (state.destroyed)\n err = new ERR_STREAM_DESTROYED(\"end\");\n if (typeof cb === \"function\")\n if (err || state.finished)\n runOnNextTick(cb, err);\n else\n state[kOnFinished].push(cb);\n return this;\n };\n function needFinish(state, tag) {\n var needFinish2 = state.ending && !state.destroyed && state.constructed && state.length === 0 && !state.errored && state.buffered.length === 0 && !state.finished && !state.writing && !state.errorEmitted && !state.closeEmitted;\n return needFinish2;\n }\n function callFinal(stream, state) {\n let called = !1;\n function onFinish(err) {\n if (called) {\n errorOrDestroy2(stream, err !== null && err !== void 0 \? err : ERR_MULTIPLE_CALLBACK());\n return;\n }\n if (called = !0, state.pendingcb--, err) {\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++)\n onfinishCallbacks[i](err);\n errorOrDestroy2(stream, err, state.sync);\n } else if (needFinish(state))\n state.prefinished = !0, stream.emit(\"prefinish\"), state.pendingcb++, runOnNextTick(finish, stream, state);\n }\n state.sync = !0, state.pendingcb++;\n try {\n stream._final(onFinish);\n } catch (err) {\n onFinish(err);\n }\n state.sync = !1;\n }\n function prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled)\n if (typeof stream._final === \"function\" && !state.destroyed)\n state.finalCalled = !0, callFinal(stream, state);\n else\n state.prefinished = !0, stream.emit(\"prefinish\");\n }\n function finishMaybe(stream, state, sync) {\n if (!needFinish(state, stream.__id))\n return;\n if (prefinish(stream, state), state.pendingcb === 0) {\n if (sync)\n state.pendingcb++, runOnNextTick((stream2, state2) => {\n if (needFinish(state2))\n finish(stream2, state2);\n else\n state2.pendingcb--;\n }, stream, state);\n else if (needFinish(state))\n state.pendingcb++, finish(stream, state);\n }\n }\n function finish(stream, state) {\n state.pendingcb--, state.finished = !0;\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++)\n onfinishCallbacks[i]();\n if (stream.emit(\"finish\"), state.autoDestroy) {\n const rState = stream._readableState;\n if (!rState || rState.autoDestroy && (rState.endEmitted || rState.readable === !1))\n stream.destroy();\n }\n }\n ObjectDefineProperties(Writable.prototype, {\n closed: {\n get() {\n return this._writableState \? this._writableState.closed : !1;\n }\n },\n destroyed: {\n get() {\n return this._writableState \? this._writableState.destroyed : !1;\n },\n set(value) {\n if (this._writableState)\n this._writableState.destroyed = value;\n }\n },\n writable: {\n get() {\n const w = this._writableState;\n return !!w && w.writable !== !1 && !w.destroyed && !w.errored && !w.ending && !w.ended;\n },\n set(val) {\n if (this._writableState)\n this._writableState.writable = !!val;\n }\n },\n writableFinished: {\n get() {\n return this._writableState \? this._writableState.finished : !1;\n }\n },\n writableObjectMode: {\n get() {\n return this._writableState \? this._writableState.objectMode : !1;\n }\n },\n writableBuffer: {\n get() {\n return this._writableState && this._writableState.getBuffer();\n }\n },\n writableEnded: {\n get() {\n return this._writableState \? this._writableState.ending : !1;\n }\n },\n writableNeedDrain: {\n get() {\n const wState = this._writableState;\n if (!wState)\n return !1;\n return !wState.destroyed && !wState.ending && wState.needDrain;\n }\n },\n writableHighWaterMark: {\n get() {\n return this._writableState && this._writableState.highWaterMark;\n }\n },\n writableCorked: {\n get() {\n return this._writableState \? this._writableState.corked : 0;\n }\n },\n writableLength: {\n get() {\n return this._writableState && this._writableState.length;\n }\n },\n errored: {\n enumerable: !1,\n get() {\n return this._writableState \? this._writableState.errored : null;\n }\n },\n writableAborted: {\n enumerable: !1,\n get: function() {\n return !!(this._writableState.writable !== !1 && (this._writableState.destroyed || this._writableState.errored) && !this._writableState.finished);\n }\n }\n });\n var destroy2 = destroyImpl.destroy;\n Writable.prototype.destroy = function(err, cb) {\n const state = this._writableState;\n if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length))\n runOnNextTick(errorBuffer, state);\n return destroy2.@call(this, err, cb), this;\n }, Writable.prototype._undestroy = destroyImpl.undestroy, Writable.prototype._destroy = function(err, cb) {\n cb(err);\n }, Writable.prototype[EE.captureRejectionSymbol] = function(err) {\n this.destroy(err);\n };\n var webStreamsAdapters;\n function lazyWebStreams() {\n if (webStreamsAdapters === void 0)\n webStreamsAdapters = {};\n return webStreamsAdapters;\n }\n Writable.fromWeb = function(writableStream, options) {\n return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options);\n }, Writable.toWeb = function(streamWritable) {\n return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable);\n };\n }\n}), require_duplexify = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/duplexify.js\"(exports, module) {\n var {\n isReadable,\n isWritable,\n isIterable,\n isNodeStream,\n isReadableNodeStream,\n isWritableNodeStream,\n isDuplexNodeStream\n } = require_utils(), eos = require_end_of_stream(), {\n AbortError: AbortError2,\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_RETURN_VALUE }\n } = require_errors(), { destroyer } = require_destroy(), Duplex = require_duplex(), Readable = require_readable(), { createDeferredPromise } = require_util(), from = require_from(), isBlob = typeof Blob !== \"undefined\" \? function isBlob2(b) {\n return b instanceof Blob;\n } : function isBlob2(b) {\n return !1;\n }, { FunctionPrototypeCall } = require_primordials();\n\n class Duplexify extends Duplex {\n constructor(options) {\n super(options);\n if ((options === null || options === @undefined \? @undefined : options.readable) === !1)\n this._readableState.readable = !1, this._readableState.ended = !0, this._readableState.endEmitted = !0;\n if ((options === null || options === @undefined \? @undefined : options.writable) === !1)\n this._writableState.writable = !1, this._writableState.ending = !0, this._writableState.ended = !0, this._writableState.finished = !0;\n }\n }\n module.exports = function duplexify(body, name) {\n if (isDuplexNodeStream(body))\n return body;\n if (isReadableNodeStream(body))\n return _duplexify({\n readable: body\n });\n if (isWritableNodeStream(body))\n return _duplexify({\n writable: body\n });\n if (isNodeStream(body))\n return _duplexify({\n writable: !1,\n readable: !1\n });\n if (typeof body === \"function\") {\n const { value, write, final, destroy: destroy2 } = fromAsyncGen(body);\n if (isIterable(value))\n return from(Duplexify, value, {\n objectMode: !0,\n write,\n final,\n destroy: destroy2\n });\n const then2 = value === null || value === void 0 \? void 0 : value.then;\n if (typeof then2 === \"function\") {\n let d;\n const promise = FunctionPrototypeCall(then2, value, (val) => {\n if (val != null)\n throw new ERR_INVALID_RETURN_VALUE(\"nully\", \"body\", val);\n }, (err) => {\n destroyer(d, err);\n });\n return d = new Duplexify({\n objectMode: !0,\n readable: !1,\n write,\n final(cb) {\n final(async () => {\n try {\n await promise, runOnNextTick(cb, null);\n } catch (err) {\n runOnNextTick(cb, err);\n }\n });\n },\n destroy: destroy2\n });\n }\n throw new ERR_INVALID_RETURN_VALUE(\"Iterable, AsyncIterable or AsyncFunction\", name, value);\n }\n if (isBlob(body))\n return duplexify(body.arrayBuffer());\n if (isIterable(body))\n return from(Duplexify, body, {\n objectMode: !0,\n writable: !1\n });\n if (typeof (body === null || body === void 0 \? void 0 : body.writable) === \"object\" || typeof (body === null || body === void 0 \? void 0 : body.readable) === \"object\") {\n const readable = body !== null && body !== void 0 && body.readable \? isReadableNodeStream(body === null || body === void 0 \? void 0 : body.readable) \? body === null || body === void 0 \? void 0 : body.readable : duplexify(body.readable) : void 0, writable = body !== null && body !== void 0 && body.writable \? isWritableNodeStream(body === null || body === void 0 \? void 0 : body.writable) \? body === null || body === void 0 \? void 0 : body.writable : duplexify(body.writable) : void 0;\n return _duplexify({\n readable,\n writable\n });\n }\n const then = body === null || body === void 0 \? void 0 : body.then;\n if (typeof then === \"function\") {\n let d;\n return FunctionPrototypeCall(then, body, (val) => {\n if (val != null)\n d.push(val);\n d.push(null);\n }, (err) => {\n destroyer(d, err);\n }), d = new Duplexify({\n objectMode: !0,\n writable: !1,\n read() {\n }\n });\n }\n throw new ERR_INVALID_ARG_TYPE2(name, [\n \"Blob\",\n \"ReadableStream\",\n \"WritableStream\",\n \"Stream\",\n \"Iterable\",\n \"AsyncIterable\",\n \"Function\",\n \"{ readable, writable } pair\",\n \"Promise\"\n ], body);\n };\n function fromAsyncGen(fn) {\n let { promise, resolve } = createDeferredPromise();\n const ac = new AbortController, signal = ac.signal;\n return {\n value: fn(async function* () {\n while (!0) {\n const _promise = promise;\n promise = null;\n const { chunk, done, cb } = await _promise;\n if (runOnNextTick(cb), done)\n return;\n if (signal.aborted)\n throw new AbortError2(void 0, {\n cause: signal.reason\n });\n ({ promise, resolve } = createDeferredPromise()), yield chunk;\n }\n }(), {\n signal\n }),\n write(chunk, encoding, cb) {\n const _resolve = resolve;\n resolve = null, _resolve({\n chunk,\n done: !1,\n cb\n });\n },\n final(cb) {\n const _resolve = resolve;\n resolve = null, _resolve({\n done: !0,\n cb\n });\n },\n destroy(err, cb) {\n ac.abort(), cb(err);\n }\n };\n }\n function _duplexify(pair) {\n const r = pair.readable && typeof pair.readable.read !== \"function\" \? Readable.wrap(pair.readable) : pair.readable, w = pair.writable;\n let readable = !!isReadable(r), writable = !!isWritable(w), ondrain, onfinish, onreadable, onclose, d;\n function onfinished(err) {\n const cb = onclose;\n if (onclose = null, cb)\n cb(err);\n else if (err)\n d.destroy(err);\n else if (!readable && !writable)\n d.destroy();\n }\n if (d = new Duplexify({\n readableObjectMode: !!(r !== null && r !== void 0 && r.readableObjectMode),\n writableObjectMode: !!(w !== null && w !== void 0 && w.writableObjectMode),\n readable,\n writable\n }), writable)\n eos(w, (err) => {\n if (writable = !1, err)\n destroyer(r, err);\n onfinished(err);\n }), d._write = function(chunk, encoding, callback) {\n if (w.write(chunk, encoding))\n callback();\n else\n ondrain = callback;\n }, d._final = function(callback) {\n w.end(), onfinish = callback;\n }, w.on(\"drain\", function() {\n if (ondrain) {\n const cb = ondrain;\n ondrain = null, cb();\n }\n }), w.on(\"finish\", function() {\n if (onfinish) {\n const cb = onfinish;\n onfinish = null, cb();\n }\n });\n if (readable)\n eos(r, (err) => {\n if (readable = !1, err)\n destroyer(r, err);\n onfinished(err);\n }), r.on(\"readable\", function() {\n if (onreadable) {\n const cb = onreadable;\n onreadable = null, cb();\n }\n }), r.on(\"end\", function() {\n d.push(null);\n }), d._read = function() {\n while (!0) {\n const buf = r.read();\n if (buf === null) {\n onreadable = d._read;\n return;\n }\n if (!d.push(buf))\n return;\n }\n };\n return d._destroy = function(err, callback) {\n if (!err && onclose !== null)\n err = new AbortError2;\n if (onreadable = null, ondrain = null, onfinish = null, onclose === null)\n callback(err);\n else\n onclose = callback, destroyer(w, err), destroyer(r, err);\n }, d;\n }\n }\n}), require_duplex = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/duplex.js\"(exports, module) {\n var { ObjectDefineProperties, ObjectGetOwnPropertyDescriptor, ObjectKeys, ObjectSetPrototypeOf } = require_primordials(), Readable = require_readable();\n function Duplex(options) {\n if (!(this instanceof Duplex))\n return new Duplex(options);\n if (Readable.@call(this, options), Writable.@call(this, options), options) {\n if (this.allowHalfOpen = options.allowHalfOpen !== !1, options.readable === !1)\n this._readableState.readable = !1, this._readableState.ended = !0, this._readableState.endEmitted = !0;\n if (options.writable === !1)\n this._writableState.writable = !1, this._writableState.ending = !0, this._writableState.ended = !0, this._writableState.finished = !0;\n } else\n this.allowHalfOpen = !0;\n }\n Duplex.prototype = {}, module.exports = Duplex, ObjectSetPrototypeOf(Duplex.prototype, Readable.prototype), ObjectSetPrototypeOf(Duplex, Readable);\n for (var method in Writable.prototype)\n if (!Duplex.prototype[method])\n Duplex.prototype[method] = Writable.prototype[method];\n ObjectDefineProperties(Duplex.prototype, {\n writable: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writable\"),\n writableHighWaterMark: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableHighWaterMark\"),\n writableObjectMode: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableObjectMode\"),\n writableBuffer: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableBuffer\"),\n writableLength: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableLength\"),\n writableFinished: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableFinished\"),\n writableCorked: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableCorked\"),\n writableEnded: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableEnded\"),\n writableNeedDrain: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableNeedDrain\"),\n destroyed: {\n get() {\n if (this._readableState === void 0 || this._writableState === void 0)\n return !1;\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set(value) {\n if (this._readableState && this._writableState)\n this._readableState.destroyed = value, this._writableState.destroyed = value;\n }\n }\n });\n var webStreamsAdapters;\n function lazyWebStreams() {\n if (webStreamsAdapters === void 0)\n webStreamsAdapters = {};\n return webStreamsAdapters;\n }\n Duplex.fromWeb = function(pair, options) {\n return lazyWebStreams().newStreamDuplexFromReadableWritablePair(pair, options);\n }, Duplex.toWeb = function(duplex) {\n return lazyWebStreams().newReadableWritablePairFromDuplex(duplex);\n };\n var duplexify;\n Duplex.from = function(body) {\n if (!duplexify)\n duplexify = require_duplexify();\n return duplexify(body, \"body\");\n };\n }\n}), require_transform = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/transform.js\"(exports, module) {\n var { ObjectSetPrototypeOf, Symbol: Symbol2 } = require_primordials(), { ERR_METHOD_NOT_IMPLEMENTED } = require_errors().codes, Duplex = require_duplex();\n function Transform(options) {\n if (!(this instanceof Transform))\n return new Transform(options);\n if (Duplex.@call(this, options), this._readableState.sync = !1, this[kCallback] = null, options) {\n if (typeof options.transform === \"function\")\n this._transform = options.transform;\n if (typeof options.flush === \"function\")\n this._flush = options.flush;\n }\n this.on(\"prefinish\", prefinish.bind(this));\n }\n Transform.prototype = {}, ObjectSetPrototypeOf(Transform.prototype, Duplex.prototype), ObjectSetPrototypeOf(Transform, Duplex), module.exports = Transform;\n var kCallback = Symbol2(\"kCallback\");\n function final(cb) {\n if (typeof this._flush === \"function\" && !this.destroyed)\n this._flush((er, data) => {\n if (er) {\n if (cb)\n cb(er);\n else\n this.destroy(er);\n return;\n }\n if (data != null)\n this.push(data);\n if (this.push(null), cb)\n cb();\n });\n else if (this.push(null), cb)\n cb();\n }\n function prefinish() {\n if (this._final !== final)\n final.@call(this);\n }\n Transform.prototype._final = final, Transform.prototype._transform = function(chunk, encoding, callback) {\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_transform()\");\n }, Transform.prototype._write = function(chunk, encoding, callback) {\n const rState = this._readableState, wState = this._writableState, length = rState.length;\n this._transform(chunk, encoding, (err, val) => {\n if (err) {\n callback(err);\n return;\n }\n if (val != null)\n this.push(val);\n if (wState.ended || length === rState.length || rState.length < rState.highWaterMark || rState.highWaterMark === 0 || rState.length === 0)\n callback();\n else\n this[kCallback] = callback;\n });\n }, Transform.prototype._read = function() {\n if (this[kCallback]) {\n const callback = this[kCallback];\n this[kCallback] = null, callback();\n }\n };\n }\n}), require_passthrough = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/passthrough.js\"(exports, module) {\n var { ObjectSetPrototypeOf } = require_primordials(), Transform = require_transform();\n function PassThrough(options) {\n if (!(this instanceof PassThrough))\n return new PassThrough(options);\n Transform.@call(this, options);\n }\n PassThrough.prototype = {}, ObjectSetPrototypeOf(PassThrough.prototype, Transform.prototype), ObjectSetPrototypeOf(PassThrough, Transform), PassThrough.prototype._transform = function(chunk, encoding, cb) {\n cb(null, chunk);\n }, module.exports = PassThrough;\n }\n}), require_pipeline = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/pipeline.js\"(exports, module) {\n var { ArrayIsArray: ArrayIsArray2, Promise: Promise2, SymbolAsyncIterator } = require_primordials(), eos = require_end_of_stream(), { once } = require_util(), destroyImpl = require_destroy(), Duplex = require_duplex(), {\n aggregateTwoErrors,\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS, ERR_STREAM_DESTROYED },\n AbortError: AbortError2\n } = require_errors(), { validateFunction, validateAbortSignal } = require_validators(), { isIterable, isReadable, isReadableNodeStream, isNodeStream } = require_utils(), PassThrough, Readable;\n function destroyer(stream, reading, writing) {\n let finished = !1;\n stream.on(\"close\", () => {\n finished = !0;\n });\n const cleanup = eos(stream, {\n readable: reading,\n writable: writing\n }, (err) => {\n finished = !err;\n });\n return {\n destroy: (err) => {\n if (finished)\n return;\n finished = !0, destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED(\"pipe\"));\n },\n cleanup\n };\n }\n function popCallback(streams) {\n return validateFunction(streams[streams.length - 1], \"streams[stream.length - 1]\"), streams.pop();\n }\n function makeAsyncIterable(val) {\n if (isIterable(val))\n return val;\n else if (isReadableNodeStream(val))\n return fromReadable(val);\n throw new ERR_INVALID_ARG_TYPE2(\"val\", [\"Readable\", \"Iterable\", \"AsyncIterable\"], val);\n }\n async function* fromReadable(val) {\n if (!Readable)\n Readable = require_readable();\n yield* Readable.prototype[SymbolAsyncIterator].@call(val);\n }\n async function pump(iterable, writable, finish, { end }) {\n let error, onresolve = null;\n const resume = (err) => {\n if (err)\n error = err;\n if (onresolve) {\n const callback = onresolve;\n onresolve = null, callback();\n }\n }, wait = () => new Promise2((resolve, reject) => {\n if (error)\n reject(error);\n else\n onresolve = () => {\n if (error)\n reject(error);\n else\n resolve();\n };\n });\n writable.on(\"drain\", resume);\n const cleanup = eos(writable, {\n readable: !1\n }, resume);\n try {\n if (writable.writableNeedDrain)\n await wait();\n for await (let chunk of iterable)\n if (!writable.write(chunk))\n await wait();\n if (end)\n writable.end();\n await wait(), finish();\n } catch (err) {\n finish(error !== err \? aggregateTwoErrors(error, err) : err);\n } finally {\n cleanup(), writable.off(\"drain\", resume);\n }\n }\n function pipeline(...streams) {\n return pipelineImpl(streams, once(popCallback(streams)));\n }\n function pipelineImpl(streams, callback, opts) {\n if (streams.length === 1 && ArrayIsArray2(streams[0]))\n streams = streams[0];\n if (streams.length < 2)\n throw new ERR_MISSING_ARGS(\"streams\");\n const ac = new AbortController, signal = ac.signal, outerSignal = opts === null || opts === void 0 \? void 0 : opts.signal, lastStreamCleanup = [];\n validateAbortSignal(outerSignal, \"options.signal\");\n function abort() {\n finishImpl(new AbortError2);\n }\n outerSignal === null || outerSignal === void 0 || outerSignal.addEventListener(\"abort\", abort);\n let error, value;\n const destroys = [];\n let finishCount = 0;\n function finish(err) {\n finishImpl(err, --finishCount === 0);\n }\n function finishImpl(err, final) {\n if (err && (!error || error.code === \"ERR_STREAM_PREMATURE_CLOSE\"))\n error = err;\n if (!error && !final)\n return;\n while (destroys.length)\n destroys.shift()(error);\n if (outerSignal === null || outerSignal === void 0 || outerSignal.removeEventListener(\"abort\", abort), ac.abort(), final) {\n if (!error)\n lastStreamCleanup.forEach((fn) => fn());\n runOnNextTick(callback, error, value);\n }\n }\n let ret;\n for (let i = 0;i < streams.length; i++) {\n const stream = streams[i], reading = i < streams.length - 1, writing = i > 0, end = reading || (opts === null || opts === void 0 \? void 0 : opts.end) !== !1, isLastStream = i === streams.length - 1;\n if (isNodeStream(stream)) {\n let onError = function(err) {\n if (err && err.name !== \"AbortError\" && err.code !== \"ERR_STREAM_PREMATURE_CLOSE\")\n finish(err);\n };\n if (end) {\n const { destroy: destroy2, cleanup } = destroyer(stream, reading, writing);\n if (destroys.push(destroy2), isReadable(stream) && isLastStream)\n lastStreamCleanup.push(cleanup);\n }\n if (stream.on(\"error\", onError), isReadable(stream) && isLastStream)\n lastStreamCleanup.push(() => {\n stream.removeListener(\"error\", onError);\n });\n }\n if (i === 0)\n if (typeof stream === \"function\") {\n if (ret = stream({\n signal\n }), !isIterable(ret))\n throw new ERR_INVALID_RETURN_VALUE(\"Iterable, AsyncIterable or Stream\", \"source\", ret);\n } else if (isIterable(stream) || isReadableNodeStream(stream))\n ret = stream;\n else\n ret = Duplex.from(stream);\n else if (typeof stream === \"function\")\n if (ret = makeAsyncIterable(ret), ret = stream(ret, {\n signal\n }), reading) {\n if (!isIterable(ret, !0))\n throw new ERR_INVALID_RETURN_VALUE(\"AsyncIterable\", `transform[${i - 1}]`, ret);\n } else {\n var _ret;\n if (!PassThrough)\n PassThrough = require_passthrough();\n const pt = new PassThrough({\n objectMode: !0\n }), then = (_ret = ret) === null || _ret === void 0 \? void 0 : _ret.then;\n if (typeof then === \"function\")\n finishCount++, then.@call(ret, (val) => {\n if (value = val, val != null)\n pt.write(val);\n if (end)\n pt.end();\n runOnNextTick(finish);\n }, (err) => {\n pt.destroy(err), runOnNextTick(finish, err);\n });\n else if (isIterable(ret, !0))\n finishCount++, pump(ret, pt, finish, {\n end\n });\n else\n throw new ERR_INVALID_RETURN_VALUE(\"AsyncIterable or Promise\", \"destination\", ret);\n ret = pt;\n const { destroy: destroy2, cleanup } = destroyer(ret, !1, !0);\n if (destroys.push(destroy2), isLastStream)\n lastStreamCleanup.push(cleanup);\n }\n else if (isNodeStream(stream)) {\n if (isReadableNodeStream(ret)) {\n finishCount += 2;\n const cleanup = pipe(ret, stream, finish, {\n end\n });\n if (isReadable(stream) && isLastStream)\n lastStreamCleanup.push(cleanup);\n } else if (isIterable(ret))\n finishCount++, pump(ret, stream, finish, {\n end\n });\n else\n throw new ERR_INVALID_ARG_TYPE2(\"val\", [\"Readable\", \"Iterable\", \"AsyncIterable\"], ret);\n ret = stream;\n } else\n ret = Duplex.from(stream);\n }\n if (signal !== null && signal !== void 0 && signal.aborted || outerSignal !== null && outerSignal !== void 0 && outerSignal.aborted)\n runOnNextTick(abort);\n return ret;\n }\n function pipe(src, dst, finish, { end }) {\n if (src.pipe(dst, {\n end\n }), end)\n src.once(\"end\", () => dst.end());\n else\n finish();\n return eos(src, {\n readable: !0,\n writable: !1\n }, (err) => {\n const rState = src._readableState;\n if (err && err.code === \"ERR_STREAM_PREMATURE_CLOSE\" && rState && rState.ended && !rState.errored && !rState.errorEmitted)\n src.once(\"end\", finish).once(\"error\", finish);\n else\n finish(err);\n }), eos(dst, {\n readable: !1,\n writable: !0\n }, finish);\n }\n module.exports = {\n pipelineImpl,\n pipeline\n };\n }\n}), require_compose = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/compose.js\"(exports, module) {\n var { pipeline } = require_pipeline(), Duplex = require_duplex(), { destroyer } = require_destroy(), { isNodeStream, isReadable, isWritable } = require_utils(), {\n AbortError: AbortError2,\n codes: { ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, ERR_MISSING_ARGS }\n } = require_errors();\n module.exports = function compose(...streams) {\n if (streams.length === 0)\n throw new ERR_MISSING_ARGS(\"streams\");\n if (streams.length === 1)\n return Duplex.from(streams[0]);\n const orgStreams = [...streams];\n if (typeof streams[0] === \"function\")\n streams[0] = Duplex.from(streams[0]);\n if (typeof streams[streams.length - 1] === \"function\") {\n const idx = streams.length - 1;\n streams[idx] = Duplex.from(streams[idx]);\n }\n for (let n = 0;n < streams.length; ++n) {\n if (!isNodeStream(streams[n]))\n continue;\n if (n < streams.length - 1 && !isReadable(streams[n]))\n throw new ERR_INVALID_ARG_VALUE2(`streams[${n}]`, orgStreams[n], \"must be readable\");\n if (n > 0 && !isWritable(streams[n]))\n throw new ERR_INVALID_ARG_VALUE2(`streams[${n}]`, orgStreams[n], \"must be writable\");\n }\n let ondrain, onfinish, onreadable, onclose, d;\n function onfinished(err) {\n const cb = onclose;\n if (onclose = null, cb)\n cb(err);\n else if (err)\n d.destroy(err);\n else if (!readable && !writable)\n d.destroy();\n }\n const head = streams[0], tail = pipeline(streams, onfinished), writable = !!isWritable(head), readable = !!isReadable(tail);\n if (d = new Duplex({\n writableObjectMode: !!(head !== null && head !== void 0 && head.writableObjectMode),\n readableObjectMode: !!(tail !== null && tail !== void 0 && tail.writableObjectMode),\n writable,\n readable\n }), writable)\n d._write = function(chunk, encoding, callback) {\n if (head.write(chunk, encoding))\n callback();\n else\n ondrain = callback;\n }, d._final = function(callback) {\n head.end(), onfinish = callback;\n }, head.on(\"drain\", function() {\n if (ondrain) {\n const cb = ondrain;\n ondrain = null, cb();\n }\n }), tail.on(\"finish\", function() {\n if (onfinish) {\n const cb = onfinish;\n onfinish = null, cb();\n }\n });\n if (readable)\n tail.on(\"readable\", function() {\n if (onreadable) {\n const cb = onreadable;\n onreadable = null, cb();\n }\n }), tail.on(\"end\", function() {\n d.push(null);\n }), d._read = function() {\n while (!0) {\n const buf = tail.read();\n if (buf === null) {\n onreadable = d._read;\n return;\n }\n if (!d.push(buf))\n return;\n }\n };\n return d._destroy = function(err, callback) {\n if (!err && onclose !== null)\n err = new AbortError2;\n if (onreadable = null, ondrain = null, onfinish = null, onclose === null)\n callback(err);\n else\n onclose = callback, destroyer(tail, err);\n }, d;\n };\n }\n}), require_promises = __commonJS({\n \"node_modules/readable-stream/lib/stream/promises.js\"(exports, module) {\n var { ArrayPrototypePop, Promise: Promise2 } = require_primordials(), { isIterable, isNodeStream } = require_utils(), { pipelineImpl: pl } = require_pipeline(), { finished } = require_end_of_stream();\n function pipeline(...streams) {\n return new Promise2((resolve, reject) => {\n let signal, end;\n const lastArg = streams[streams.length - 1];\n if (lastArg && typeof lastArg === \"object\" && !isNodeStream(lastArg) && !isIterable(lastArg)) {\n const options = ArrayPrototypePop(streams);\n signal = options.signal, end = options.end;\n }\n pl(streams, (err, value) => {\n if (err)\n reject(err);\n else\n resolve(value);\n }, {\n signal,\n end\n });\n });\n }\n module.exports = {\n finished,\n pipeline\n };\n }\n}), require_stream = __commonJS({\n \"node_modules/readable-stream/lib/stream.js\"(exports, module) {\n var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials(), {\n promisify: { custom: customPromisify }\n } = require_util(), { streamReturningOperators, promiseReturningOperators } = require_operators(), {\n codes: { ERR_ILLEGAL_CONSTRUCTOR }\n } = require_errors(), compose = require_compose(), { pipeline } = require_pipeline(), { destroyer } = require_destroy(), eos = require_end_of_stream(), promises = require_promises(), utils = require_utils(), Stream = module.exports = require_legacy().Stream;\n Stream.isDisturbed = utils.isDisturbed, Stream.isErrored = utils.isErrored, Stream.isWritable = utils.isWritable, Stream.isReadable = utils.isReadable, Stream.Readable = require_readable();\n for (let key of ObjectKeys(streamReturningOperators)) {\n let fn = function(...args) {\n if (new.target)\n throw ERR_ILLEGAL_CONSTRUCTOR();\n return Stream.Readable.from(ReflectApply(op, this, args));\n };\n const op = streamReturningOperators[key];\n ObjectDefineProperty(fn, \"name\", {\n value: op.name\n }), ObjectDefineProperty(fn, \"length\", {\n value: op.length\n }), ObjectDefineProperty(Stream.Readable.prototype, key, {\n value: fn,\n enumerable: !1,\n configurable: !0,\n writable: !0\n });\n }\n for (let key of ObjectKeys(promiseReturningOperators)) {\n let fn = function(...args) {\n if (new.target)\n throw ERR_ILLEGAL_CONSTRUCTOR();\n return ReflectApply(op, this, args);\n };\n const op = promiseReturningOperators[key];\n ObjectDefineProperty(fn, \"name\", {\n value: op.name\n }), ObjectDefineProperty(fn, \"length\", {\n value: op.length\n }), ObjectDefineProperty(Stream.Readable.prototype, key, {\n value: fn,\n enumerable: !1,\n configurable: !0,\n writable: !0\n });\n }\n Stream.Writable = require_writable(), Stream.Duplex = require_duplex(), Stream.Transform = require_transform(), Stream.PassThrough = require_passthrough(), Stream.pipeline = pipeline;\n var { addAbortSignal } = require_add_abort_signal();\n Stream.addAbortSignal = addAbortSignal, Stream.finished = eos, Stream.destroy = destroyer, Stream.compose = compose, ObjectDefineProperty(Stream, \"promises\", {\n configurable: !0,\n enumerable: !0,\n get() {\n return promises;\n }\n }), ObjectDefineProperty(pipeline, customPromisify, {\n enumerable: !0,\n get() {\n return promises.pipeline;\n }\n }), ObjectDefineProperty(eos, customPromisify, {\n enumerable: !0,\n get() {\n return promises.finished;\n }\n }), Stream.Stream = Stream, Stream._isUint8Array = function isUint8Array(value) {\n return value instanceof @Uint8Array;\n }, Stream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) {\n return new @Buffer(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n };\n }\n}), nativeReadableStreamPrototypes = {\n 0: @undefined,\n 1: @undefined,\n 2: @undefined,\n 3: @undefined,\n 4: @undefined,\n 5: @undefined\n}, Writable = require_writable(), _pathOrFdOrSink = Symbol(\"pathOrFdOrSink\"), _fileSink = Symbol(\"fileSink\"), _native = Symbol(\"native\");\nNativeWritable.prototype = Object.create(Writable.prototype);\nvar WritablePrototypeWrite = Writable.prototype.write;\nNativeWritable.prototype.write = function NativeWritablePrototypeWrite(chunk, encoding, cb, native) {\n if (!(native \?\? this[_native]))\n return this[_native] = !1, WritablePrototypeWrite.@call(this, chunk, encoding, cb);\n var fileSink = this[_fileSink] \?\? NativeWritable_lazyConstruct(this), result = fileSink.write(chunk);\n if (@isPromise(result))\n return result.then(() => {\n this.emit(\"drain\"), fileSink.flush(!0);\n }), !1;\n if (fileSink.flush(!0), typeof encoding === \"function\")\n cb = encoding;\n if (cb)\n cb(null, chunk.byteLength);\n return !0;\n};\nvar WritablePrototypeEnd = Writable.prototype.end;\nNativeWritable.prototype.end = function end(chunk, encoding, cb, native) {\n return WritablePrototypeEnd.@call(this, chunk, encoding, cb, native \?\? this[_native]);\n};\nNativeWritable.prototype.ref = function ref() {\n var sink = this[_fileSink];\n if (!sink)\n this.NativeWritable_lazyConstruct();\n sink.ref();\n};\nNativeWritable.prototype.unref = function unref() {\n this[_fileSink]\?.unref();\n};\nvar exports = require_stream(), promises = require_promises();\nexports._getNativeReadableStreamPrototype = getNativeReadableStreamPrototype;\nexports.NativeWritable = NativeWritable;\nObject.defineProperty(exports, \"promises\", {\n configurable: !0,\n enumerable: !0,\n get() {\n return promises;\n }\n});\nexports[Symbol.for(\"::bunternal::\")] = { _ReadableFromWeb, _ReadableFromWebForUndici };\nexports.eos = require_end_of_stream();\nexports.EventEmitter = EE;\nreturn exports})\n");
//
//
-static constexpr ASCIILiteral NodeTimersCode = "(function (){\"use strict\";// src/js/out/tmp/node/timers.ts\nvar $;\n$ = {\n setTimeout,\n clearTimeout,\n setInterval,\n setImmediate,\n clearInterval,\n clearImmediate\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeStreamPromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/stream.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39)).promises})\n");
//
//
-static constexpr ASCIILiteral NodeTimersPromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/timers.promises.ts\nvar validateObject = function(object, name) {\n if (object === null || typeof object !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Object\", object);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n}, validateAbortSignal = function(signal, name) {\n if (typeof signal !== \"undefined\" && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, asyncIterator = function({ next: nextFunction, return: returnFunction }) {\n const result = {};\n if (typeof nextFunction === \"function\")\n result.next = nextFunction;\n if (typeof returnFunction === \"function\")\n result.return = returnFunction;\n return result[symbolAsyncIterator] = function() {\n return this;\n }, result;\n}, setTimeoutPromise = function(after = 1, value, options = {}) {\n const arguments_ = [].concat(value \?\? []);\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return Promise.reject(error);\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return Promise.reject(error);\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return Promise.reject(error);\n }\n if (signal\?.aborted)\n return Promise.reject(new AbortError);\n let onCancel;\n const returnValue = new Promise((resolve, reject) => {\n const timeout = setTimeout(() => resolve(value), after, ...arguments_);\n if (!reference)\n timeout\?.unref\?.();\n if (signal)\n onCancel = () => {\n clearTimeout(timeout), reject(new AbortError);\n }, signal.addEventListener(\"abort\", onCancel);\n });\n if (typeof onCancel !== \"undefined\")\n returnValue.finally(() => signal.removeEventListener(\"abort\", onCancel));\n return returnValue;\n}, setImmediatePromise = function(value, options = {}) {\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return Promise.reject(error);\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return Promise.reject(error);\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return Promise.reject(error);\n }\n if (signal\?.aborted)\n return Promise.reject(new AbortError);\n let onCancel;\n const returnValue = new Promise((resolve, reject) => {\n const immediate = setImmediate(() => resolve(value));\n if (!reference)\n immediate\?.unref\?.();\n if (signal)\n onCancel = () => {\n clearImmediate(immediate), reject(new AbortError);\n }, signal.addEventListener(\"abort\", onCancel);\n });\n if (typeof onCancel !== \"undefined\")\n returnValue.finally(() => signal.removeEventListener(\"abort\", onCancel));\n return returnValue;\n}, setIntervalPromise = function(after = 1, value, options = {}) {\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return Promise.reject(error);\n }\n });\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return Promise.reject(error);\n }\n });\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return Promise.reject(error);\n }\n });\n }\n if (signal\?.aborted)\n return asyncIterator({\n next: function() {\n return Promise.reject(new AbortError);\n }\n });\n let onCancel, interval;\n try {\n let notYielded = 0, callback;\n if (interval = setInterval(() => {\n if (notYielded++, callback)\n callback(), callback = void 0;\n }, after), !reference)\n interval\?.unref\?.();\n if (signal)\n onCancel = () => {\n if (clearInterval(interval), callback)\n callback(), callback = void 0;\n }, signal.addEventListener(\"abort\", onCancel);\n return asyncIterator({\n next: function() {\n return new Promise((resolve, reject) => {\n if (!signal\?.aborted)\n if (notYielded === 0)\n callback = resolve;\n else\n resolve();\n else if (notYielded === 0)\n reject(new AbortError);\n else\n resolve();\n }).then(() => {\n if (notYielded > 0)\n return notYielded = notYielded - 1, { done: !1, value };\n return { done: !0 };\n });\n },\n return: function() {\n return clearInterval(interval), signal\?.removeEventListener(\"abort\", onCancel), Promise.resolve({});\n }\n });\n } catch (error) {\n return asyncIterator({\n next: function() {\n clearInterval(interval), signal\?.removeEventListener(\"abort\", onCancel);\n }\n });\n }\n}, $, symbolAsyncIterator = Symbol.asyncIterator;\n\nclass ERR_INVALID_ARG_TYPE extends Error {\n constructor(name, expected, actual) {\n super(`${name} must be ${expected}, ${typeof actual} given`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\n\nclass AbortError extends Error {\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\n$ = {\n setTimeout: setTimeoutPromise,\n setImmediate: setImmediatePromise,\n setInterval: setIntervalPromise,\n scheduler: {\n wait: (delay, options) => setTimeoutPromise(delay, void 0, options),\n yield: setImmediatePromise\n }\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeStreamWebCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/stream.web.ts\nvar $;\n$ = {\n ReadableStream: @ReadableStream,\n ReadableStreamDefaultReader: @ReadableStreamDefaultReader,\n ReadableStreamBYOBReader: @ReadableStreamBYOBReader,\n ReadableStreamBYOBRequest: @ReadableStreamBYOBRequest,\n ReadableByteStreamController: @ReadableByteStreamController,\n ReadableStreamDefaultController: @ReadableStreamDefaultController,\n TransformStream: @TransformStream,\n TransformStreamDefaultController: @TransformStreamDefaultController,\n WritableStream: @WritableStream,\n WritableStreamDefaultWriter: @WritableStreamDefaultWriter,\n WritableStreamDefaultController: @WritableStreamDefaultController,\n ByteLengthQueuingStrategy,\n CountQueuingStrategy,\n TextEncoderStream: @undefined,\n TextDecoderStream: @undefined,\n CompressionStream: @undefined,\n DecompressionStream: @undefined\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeTLSCode = "(function (){\"use strict\";// src/js/out/tmp/node/tls.ts\nvar parseCertString = function() {\n throwNotImplemented(\"Not implemented\");\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof ArrayBuffer || obj instanceof Blob)\n return !0;\n if (Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, unfqdn = function(host) {\n return RegExpPrototypeSymbolReplace.call(/[.]$/, host, \"\");\n}, toLowerCase = function(c) {\n return StringFromCharCode.call(32 + StringPrototypeCharCodeAt.call(c, 0));\n}, splitHost = function(host) {\n return StringPrototypeSplit.call(RegExpPrototypeSymbolReplace.call(/[A-Z]/g, unfqdn(host), toLowerCase), \".\");\n}, check = function(hostParts, pattern, wildcards) {\n if (!pattern)\n return !1;\n const patternParts = splitHost(pattern);\n if (hostParts.length !== patternParts.length)\n return !1;\n if (ArrayPrototypeIncludes.call(patternParts, \"\"))\n return !1;\n const isBad = (s) => RegExpPrototypeExec.call(/[^\\u0021-\\u007F]/u, s) !== null;\n if (ArrayPrototypeSome.call(patternParts, isBad))\n return !1;\n for (let i = hostParts.length - 1;i > 0; i -= 1)\n if (hostParts[i] !== patternParts[i])\n return !1;\n const hostSubdomain = hostParts[0], patternSubdomain = patternParts[0], patternSubdomainParts = StringPrototypeSplit.call(patternSubdomain, \"*\");\n if (patternSubdomainParts.length === 1 || StringPrototypeIncludes.call(patternSubdomain, \"xn--\"))\n return hostSubdomain === patternSubdomain;\n if (!wildcards)\n return !1;\n if (patternSubdomainParts.length > 2)\n return !1;\n if (patternParts.length <= 2)\n return !1;\n const { 0: prefix, 1: suffix } = patternSubdomainParts;\n if (prefix.length + suffix.length > hostSubdomain.length)\n return !1;\n if (!StringPrototypeStartsWith.call(hostSubdomain, prefix))\n return !1;\n if (!StringPrototypeEndsWith.call(hostSubdomain, suffix))\n return !1;\n return !0;\n}, splitEscapedAltNames = function(altNames) {\n const result = [];\n let currentToken = \"\", offset = 0;\n while (offset !== altNames.length) {\n const nextSep = StringPrototypeIndexOf.call(altNames, \", \", offset), nextQuote = StringPrototypeIndexOf.call(altNames, '\"', offset);\n if (nextQuote !== -1 && (nextSep === -1 || nextQuote < nextSep)) {\n currentToken += StringPrototypeSubstring.call(altNames, offset, nextQuote);\n const match = RegExpPrototypeExec.call(jsonStringPattern, StringPrototypeSubstring.call(altNames, nextQuote));\n if (!match) {\n let error = new SyntaxError(\"ERR_TLS_CERT_ALTNAME_FORMAT: Invalid subject alternative name string\");\n throw error.name = ERR_TLS_CERT_ALTNAME_FORMAT, error;\n }\n currentToken += JSON.parse(match[0]), offset = nextQuote + match[0].length;\n } else if (nextSep !== -1)\n currentToken += StringPrototypeSubstring.call(altNames, offset, nextSep), ArrayPrototypePush.call(result, currentToken), currentToken = \"\", offset = nextSep + 2;\n else\n currentToken += StringPrototypeSubstring.call(altNames, offset), offset = altNames.length;\n }\n return ArrayPrototypePush.call(result, currentToken), result;\n}, checkServerIdentity = function(hostname, cert) {\n const { subject, subjectaltname: altNames } = cert, dnsNames = [], ips = [];\n if (hostname = \"\" + hostname, altNames) {\n const splitAltNames = StringPrototypeIncludes.call(altNames, '\"') \? splitEscapedAltNames(altNames) : StringPrototypeSplit.call(altNames, \", \");\n ArrayPrototypeForEach.call(splitAltNames, (name) => {\n if (StringPrototypeStartsWith.call(name, \"DNS:\"))\n ArrayPrototypePush.call(dnsNames, StringPrototypeSlice.call(name, 4));\n else if (StringPrototypeStartsWith.call(name, \"IP Address:\"))\n ArrayPrototypePush.call(ips, canonicalizeIP(StringPrototypeSlice.call(name, 11)));\n });\n }\n let valid = !1, reason = \"Unknown reason\";\n if (hostname = unfqdn(hostname), net.isIP(hostname)) {\n if (valid = ArrayPrototypeIncludes.call(ips, canonicalizeIP(hostname)), !valid)\n reason = `IP: ${hostname} is not in the cert's list: ` + ArrayPrototypeJoin.call(ips, \", \");\n } else if (dnsNames.length > 0 || subject\?.CN) {\n const hostParts = splitHost(hostname), wildcard = (pattern) => check(hostParts, pattern, !0);\n if (dnsNames.length > 0) {\n if (valid = ArrayPrototypeSome.call(dnsNames, wildcard), !valid)\n reason = `Host: ${hostname}. is not in the cert's altnames: ${altNames}`;\n } else {\n const cn = subject.CN;\n if (Array.isArray(cn))\n valid = ArrayPrototypeSome.call(cn, wildcard);\n else if (cn)\n valid = wildcard(cn);\n if (!valid)\n reason = `Host: ${hostname}. is not cert's CN: ${cn}`;\n }\n } else\n reason = \"Cert does not contain a DNS name\";\n if (!valid) {\n let error = new Error(`ERR_TLS_CERT_ALTNAME_INVALID: Hostname/IP does not match certificate's altnames: ${reason}`);\n return error.name = \"ERR_TLS_CERT_ALTNAME_INVALID\", error.reason = reason, error.host = hostname, error.cert = cert, error;\n }\n}, SecureContext = function(options) {\n return new InternalSecureContext(options);\n}, createSecureContext = function(options) {\n return new SecureContext(options);\n}, translatePeerCertificate = function(c) {\n if (!c)\n return null;\n if (c.issuerCertificate != null && c.issuerCertificate !== c)\n c.issuerCertificate = translatePeerCertificate(c.issuerCertificate);\n if (c.infoAccess != null) {\n const info = c.infoAccess;\n c.infoAccess = { __proto__: null }, RegExpPrototypeSymbolReplace.call(/([^\\n:]*):([^\\n]*)(\?:\\n|$)/g, info, (all, key, val) => {\n if (val.charCodeAt(0) === 34)\n val = JSONParse(val);\n if (key in c.infoAccess)\n ArrayPrototypePush.call(c.infoAccess[key], val);\n else\n c.infoAccess[key] = [val];\n });\n }\n return c;\n}, createServer = function(options, connectionListener) {\n return new Server(options, connectionListener);\n}, getCiphers = function() {\n return DEFAULT_CIPHERS.split(\":\");\n}, convertProtocols = function(protocols) {\n const lens = new Array(protocols.length), buff = Buffer.allocUnsafe(ArrayPrototypeReduce.call(protocols, (p, c, i) => {\n const len = Buffer.byteLength(c);\n if (len > 255)\n @throwRangeError(\"The byte length of the protocol at index \" + `${i} exceeds the maximum length.`, \"<= 255\", len, !0);\n return lens[i] = len, p + 1 + len;\n }, 0));\n let offset = 0;\n for (let i = 0, c = protocols.length;i < c; i++)\n buff[offset++] = lens[i], buff.write(protocols[i], offset), offset += lens[i];\n return buff;\n}, convertALPNProtocols = function(protocols, out) {\n if (Array.isArray(protocols))\n out.ALPNProtocols = convertProtocols(protocols);\n else if (isTypedArray(protocols))\n out.ALPNProtocols = Buffer.from(protocols);\n else if (isArrayBufferView(protocols))\n out.ALPNProtocols = Buffer.from(protocols.buffer.slice(protocols.byteOffset, protocols.byteOffset + protocols.byteLength));\n else if (Buffer.isBuffer(protocols))\n out.ALPNProtocols = protocols;\n}, $, { isArrayBufferView, isTypedArray } = @requireNativeModule(\"util/types\"), net = @getInternalField(@internalModuleRegistry, 25) || @createInternalModuleById(25), { Server: NetServer, [Symbol.for(\"::bunternal::\")]: InternalTCPSocket } = net, bunSocketInternal = Symbol.for(\"::bunnetsocketinternal::\"), { rootCertificates, canonicalizeIP } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"internal/tls\"), SymbolReplace = Symbol.replace, RegExpPrototypeSymbolReplace = RegExp.prototype[SymbolReplace], RegExpPrototypeExec = RegExp.prototype.exec, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeSlice = String.prototype.slice, StringPrototypeIncludes = String.prototype.includes, StringPrototypeSplit = String.prototype.split, StringPrototypeIndexOf = String.prototype.indexOf, StringPrototypeSubstring = String.prototype.substring, StringPrototypeEndsWith = String.prototype.endsWith, StringFromCharCode = String.fromCharCode, StringPrototypeCharCodeAt = String.prototype.charCodeAt, ArrayPrototypeIncludes = Array.prototype.includes, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeForEach = Array.prototype.forEach, ArrayPrototypePush = Array.prototype.push, ArrayPrototypeSome = Array.prototype.some, ArrayPrototypeReduce = Array.prototype.reduce, jsonStringPattern = /^\"(\?:[^\"\\\\\\u0000-\\u001f]|\\\\(\?:[\"\\\\/bfnrt]|u[0-9a-fA-F]{4}))*\"/, InternalSecureContext = class SecureContext2 {\n context;\n constructor(options) {\n const context = {};\n if (options) {\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.key = key;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.cert = cert;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.ca = ca;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n this.passphrase = passphrase;\n let servername = options.servername;\n if (servername && typeof servername !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n this.servername = servername;\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n this.secureOptions = secureOptions;\n }\n this.context = context;\n }\n}, buntls = Symbol.for(\"::buntls::\"), SocketClass, TLSSocket = function(InternalTLSSocket) {\n return SocketClass = InternalTLSSocket, Object.defineProperty(SocketClass.prototype, Symbol.toStringTag, {\n value: \"TLSSocket\",\n enumerable: !1\n }), Object.defineProperty(function Socket(options) {\n return new InternalTLSSocket(options);\n }, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalTLSSocket;\n }\n });\n}(class TLSSocket2 extends InternalTCPSocket {\n #secureContext;\n ALPNProtocols;\n #socket;\n #checkServerIdentity;\n #session;\n constructor(socket, options) {\n super(socket instanceof InternalTCPSocket \? options : options || socket);\n if (options = options || socket || {}, typeof options === \"object\") {\n const { ALPNProtocols } = options;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, this);\n if (socket instanceof InternalTCPSocket)\n this.#socket = socket;\n }\n this.#secureContext = options.secureContext || createSecureContext(options), this.authorized = !1, this.secureConnecting = !0, this._secureEstablished = !1, this._securePending = !0, this.#checkServerIdentity = options.checkServerIdentity || checkServerIdentity, this.#session = options.session || null;\n }\n _secureEstablished = !1;\n _securePending = !0;\n _newSessionPending;\n _controlReleased;\n secureConnecting = !1;\n _SNICallback;\n servername;\n authorized = !1;\n authorizationError;\n #renegotiationDisabled = !1;\n encrypted = !0;\n _start() {\n this.connect();\n }\n getSession() {\n return this[bunSocketInternal]\?.getSession();\n }\n getEphemeralKeyInfo() {\n return this[bunSocketInternal]\?.getEphemeralKeyInfo();\n }\n getCipher() {\n return this[bunSocketInternal]\?.getCipher();\n }\n getSharedSigalgs() {\n return this[bunSocketInternal]\?.getSharedSigalgs();\n }\n getProtocol() {\n return this[bunSocketInternal]\?.getTLSVersion();\n }\n getFinished() {\n return this[bunSocketInternal]\?.getTLSFinishedMessage() || void 0;\n }\n getPeerFinished() {\n return this[bunSocketInternal]\?.getTLSPeerFinishedMessage() || void 0;\n }\n isSessionReused() {\n return !!this.#session;\n }\n renegotiate() {\n if (this.#renegotiationDisabled) {\n const error = new Error(\"ERR_TLS_RENEGOTIATION_DISABLED: TLS session renegotiation disabled for this socket\");\n throw error.name = \"ERR_TLS_RENEGOTIATION_DISABLED\", error;\n }\n throw Error(\"Not implented in Bun yet\");\n }\n disableRenegotiation() {\n this.#renegotiationDisabled = !0;\n }\n getTLSTicket() {\n return this[bunSocketInternal]\?.getTLSTicket();\n }\n exportKeyingMaterial(length, label, context) {\n if (context)\n return this[bunSocketInternal]\?.exportKeyingMaterial(length, label, context);\n return this[bunSocketInternal]\?.exportKeyingMaterial(length, label);\n }\n setMaxSendFragment(size) {\n return this[bunSocketInternal]\?.setMaxSendFragment(size) || !1;\n }\n enableTrace() {\n }\n setServername(name) {\n if (this.isServer) {\n let error = new Error(\"ERR_TLS_SNI_FROM_SERVER: Cannot issue SNI from a TLS server-side socket\");\n throw error.name = \"ERR_TLS_SNI_FROM_SERVER\", error;\n }\n this.servername = name, this[bunSocketInternal]\?.setServername(name);\n }\n setSession(session) {\n if (this.#session = session, typeof session === \"string\")\n session = Buffer.from(session, \"latin1\");\n return this[bunSocketInternal]\?.setSession(session);\n }\n getPeerCertificate(abbreviated) {\n const cert = arguments.length < 1 \? this[bunSocketInternal]\?.getPeerCertificate() : this[bunSocketInternal]\?.getPeerCertificate(abbreviated);\n if (cert)\n return translatePeerCertificate(cert);\n }\n getCertificate() {\n const cert = this[bunSocketInternal]\?.getCertificate();\n if (cert)\n return translatePeerCertificate(cert);\n }\n getPeerX509Certificate() {\n throw Error(\"Not implented in Bun yet\");\n }\n getX509Certificate() {\n throw Error(\"Not implented in Bun yet\");\n }\n get alpnProtocol() {\n return this[bunSocketInternal]\?.alpnProtocol;\n }\n [buntls](port, host) {\n return {\n socket: this.#socket,\n ALPNProtocols: this.ALPNProtocols,\n serverName: this.servername || host || \"localhost\",\n checkServerIdentity: this.#checkServerIdentity,\n session: this.#session,\n ...this.#secureContext\n };\n }\n});\n\nclass Server extends NetServer {\n key;\n cert;\n ca;\n passphrase;\n secureOptions;\n _rejectUnauthorized;\n _requestCert;\n servername;\n ALPNProtocols;\n constructor(options, secureConnectionListener) {\n super(options, secureConnectionListener);\n this.setSecureContext(options);\n }\n setSecureContext(options) {\n if (options instanceof InternalSecureContext)\n options = options.context;\n if (options) {\n const { ALPNProtocols } = options;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, this);\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.key = key;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.cert = cert;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.ca = ca;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n this.passphrase = passphrase;\n let servername = options.servername;\n if (servername && typeof servername !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n this.servername = servername;\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n this.secureOptions = secureOptions;\n const requestCert = options.requestCert || !1;\n if (requestCert)\n this._requestCert = requestCert;\n else\n this._requestCert = void 0;\n const rejectUnauthorized = options.rejectUnauthorized || !1;\n if (rejectUnauthorized)\n this._rejectUnauthorized = rejectUnauthorized;\n else\n this._rejectUnauthorized = void 0;\n }\n }\n getTicketKeys() {\n throw Error(\"Not implented in Bun yet\");\n }\n setTicketKeys() {\n throw Error(\"Not implented in Bun yet\");\n }\n [buntls](port, host, isClient) {\n return [\n {\n serverName: this.servername || host || \"localhost\",\n key: this.key,\n cert: this.cert,\n ca: this.ca,\n passphrase: this.passphrase,\n secureOptions: this.secureOptions,\n rejectUnauthorized: isClient \? !1 : this._rejectUnauthorized,\n requestCert: isClient \? !1 : this._requestCert,\n ALPNProtocols: this.ALPNProtocols\n },\n SocketClass\n ];\n }\n}\nvar CLIENT_RENEG_LIMIT = 3, CLIENT_RENEG_WINDOW = 600, DEFAULT_ECDH_CURVE = \"auto\", DEFAULT_CIPHERS = \"DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256\", DEFAULT_MIN_VERSION = \"TLSv1.2\", DEFAULT_MAX_VERSION = \"TLSv1.3\", createConnection = (port, host, connectListener) => {\n if (typeof port === \"object\") {\n port.checkServerIdentity;\n const { ALPNProtocols } = port;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, port);\n return new TLSSocket(port).connect(port, host, connectListener);\n }\n return new TLSSocket().connect(port, host, connectListener);\n}, connect = createConnection;\n$ = {\n CLIENT_RENEG_LIMIT,\n CLIENT_RENEG_WINDOW,\n connect,\n convertALPNProtocols,\n createConnection,\n createSecureContext,\n createServer,\n DEFAULT_CIPHERS,\n DEFAULT_ECDH_CURVE,\n DEFAULT_MAX_VERSION,\n DEFAULT_MIN_VERSION,\n getCiphers,\n parseCertString,\n SecureContext,\n Server,\n TLSSocket,\n checkServerIdentity,\n rootCertificates\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeTimersCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/timers.ts\nvar $;\n$ = {\n setTimeout,\n clearTimeout,\n setInterval,\n setImmediate,\n clearInterval,\n clearImmediate\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeTraceEventsCode = "(function (){\"use strict\";// src/js/out/tmp/node/trace_events.ts\nvar ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, createTracing = function(opts) {\n if (typeof opts !== \"object\" || opts == null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", opts);\n return new Tracing(opts);\n}, getEnabledCategories = function() {\n return \"\";\n}, $;\n\nclass Tracing {\n enabled = !1;\n categories = \"\";\n}\n$ = {\n createTracing,\n getEnabledCategories\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeTimersPromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/timers.promises.ts\nvar validateObject = function(object, name) {\n if (object === null || typeof object !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Object\", object);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n}, validateAbortSignal = function(signal, name) {\n if (typeof signal !== \"undefined\" && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, asyncIterator = function({ next: nextFunction, return: returnFunction }) {\n const result = {};\n if (typeof nextFunction === \"function\")\n result.next = nextFunction;\n if (typeof returnFunction === \"function\")\n result.return = returnFunction;\n return result[symbolAsyncIterator] = function() {\n return this;\n }, result;\n}, setTimeoutPromise = function(after = 1, value, options = {}) {\n const arguments_ = [].concat(value \?\? []);\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return @Promise.reject(error);\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return @Promise.reject(error);\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return @Promise.reject(error);\n }\n if (signal\?.aborted)\n return @Promise.reject(new AbortError);\n let onCancel;\n const returnValue = new @Promise((resolve, reject) => {\n const timeout = setTimeout(() => resolve(value), after, ...arguments_);\n if (!reference)\n timeout\?.unref\?.();\n if (signal)\n onCancel = () => {\n clearTimeout(timeout), reject(new AbortError);\n }, signal.addEventListener(\"abort\", onCancel);\n });\n if (typeof onCancel !== \"undefined\")\n returnValue.finally(() => signal.removeEventListener(\"abort\", onCancel));\n return returnValue;\n}, setImmediatePromise = function(value, options = {}) {\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return @Promise.reject(error);\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return @Promise.reject(error);\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return @Promise.reject(error);\n }\n if (signal\?.aborted)\n return @Promise.reject(new AbortError);\n let onCancel;\n const returnValue = new @Promise((resolve, reject) => {\n const immediate = setImmediate(() => resolve(value));\n if (!reference)\n immediate\?.unref\?.();\n if (signal)\n onCancel = () => {\n clearImmediate(immediate), reject(new AbortError);\n }, signal.addEventListener(\"abort\", onCancel);\n });\n if (typeof onCancel !== \"undefined\")\n returnValue.finally(() => signal.removeEventListener(\"abort\", onCancel));\n return returnValue;\n}, setIntervalPromise = function(after = 1, value, options = {}) {\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return @Promise.reject(error);\n }\n });\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return @Promise.reject(error);\n }\n });\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return @Promise.reject(error);\n }\n });\n }\n if (signal\?.aborted)\n return asyncIterator({\n next: function() {\n return @Promise.reject(new AbortError);\n }\n });\n let onCancel, interval;\n try {\n let notYielded = 0, callback;\n if (interval = setInterval(() => {\n if (notYielded++, callback)\n callback(), callback = @undefined;\n }, after), !reference)\n interval\?.unref\?.();\n if (signal)\n onCancel = () => {\n if (clearInterval(interval), callback)\n callback(), callback = @undefined;\n }, signal.addEventListener(\"abort\", onCancel);\n return asyncIterator({\n next: function() {\n return new @Promise((resolve, reject) => {\n if (!signal\?.aborted)\n if (notYielded === 0)\n callback = resolve;\n else\n resolve();\n else if (notYielded === 0)\n reject(new AbortError);\n else\n resolve();\n }).then(() => {\n if (notYielded > 0)\n return notYielded = notYielded - 1, { done: !1, value };\n return { done: !0 };\n });\n },\n return: function() {\n return clearInterval(interval), signal\?.removeEventListener(\"abort\", onCancel), @Promise.resolve({});\n }\n });\n } catch (error) {\n return asyncIterator({\n next: function() {\n clearInterval(interval), signal\?.removeEventListener(\"abort\", onCancel);\n }\n });\n }\n}, $, symbolAsyncIterator = Symbol.asyncIterator;\n\nclass ERR_INVALID_ARG_TYPE extends Error {\n constructor(name, expected, actual) {\n super(`${name} must be ${expected}, ${typeof actual} given`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\n\nclass AbortError extends Error {\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\n$ = {\n setTimeout: setTimeoutPromise,\n setImmediate: setImmediatePromise,\n setInterval: setIntervalPromise,\n scheduler: {\n wait: (delay, options) => setTimeoutPromise(delay, @undefined, options),\n yield: setImmediatePromise\n }\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeTtyCode = "(function (){\"use strict\";// src/js/out/tmp/node/tty.ts\nvar ReadStream = function(fd) {\n if (!(this instanceof ReadStream))\n return new ReadStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19)).ReadStream.call(this, \"\", {\n fd\n });\n return stream.isRaw = !1, stream.isTTY = isatty(stream.fd), stream;\n}, warnOnDeactivatedColors = function(env) {\n if (warned)\n return;\n let name = \"\";\n if (env.NODE_DISABLE_COLORS !== void 0)\n name = \"NODE_DISABLE_COLORS\";\n if (env.NO_COLOR !== void 0) {\n if (name !== \"\")\n name += \"' and '\";\n name += \"NO_COLOR\";\n }\n if (name !== \"\")\n process.emitWarning(`The '${name}' env is ignored due to the 'FORCE_COLOR' env being set.`, \"Warning\"), warned = !0;\n}, WriteStream = function(fd) {\n if (!(this instanceof WriteStream))\n return new WriteStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19)).WriteStream.call(this, \"\", {\n fd\n });\n if (stream.columns = void 0, stream.rows = void 0, stream.isTTY = isatty(stream.fd), stream.isTTY) {\n const windowSizeArray = [0, 0];\n if (_getWindowSize(fd, windowSizeArray) === !0)\n stream.columns = windowSizeArray[0], stream.rows = windowSizeArray[1];\n }\n return stream;\n}, { ttySetMode, isatty, getWindowSize: _getWindowSize } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"tty\");\nObject.defineProperty(ReadStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19)).ReadStream.prototype;\n return Object.defineProperty(ReadStream, \"prototype\", { value: Real }), ReadStream.prototype.setRawMode = function(flag) {\n const mode = flag \? 1 : 0, err = ttySetMode(this.fd, mode);\n if (err)\n return this.emit(\"error\", new Error(\"setRawMode failed with errno:\", err)), this;\n return this.isRaw = flag, this;\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar COLORS_2 = 1, COLORS_16 = 4, COLORS_256 = 8, COLORS_16m = 24, TERM_ENVS = {\n eterm: COLORS_16,\n cons25: COLORS_16,\n console: COLORS_16,\n cygwin: COLORS_16,\n dtterm: COLORS_16,\n gnome: COLORS_16,\n hurd: COLORS_16,\n jfbterm: COLORS_16,\n konsole: COLORS_16,\n kterm: COLORS_16,\n mlterm: COLORS_16,\n mosh: COLORS_16m,\n putty: COLORS_16,\n st: COLORS_16,\n \"rxvt-unicode-24bit\": COLORS_16m,\n terminator: COLORS_16m\n}, TERM_ENVS_REG_EXP = [/ansi/, /color/, /linux/, /^con[0-9]*x[0-9]/, /^rxvt/, /^screen/, /^xterm/, /^vt100/], warned = !1;\nObject.defineProperty(WriteStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19)).WriteStream.prototype;\n Object.defineProperty(WriteStream, \"prototype\", { value: Real }), WriteStream.prototype._refreshSize = function() {\n const oldCols = this.columns, oldRows = this.rows, windowSizeArray = [0, 0];\n if (_getWindowSize(this.fd, windowSizeArray) === !0) {\n if (oldCols !== windowSizeArray[0] || oldRows !== windowSizeArray[1])\n this.columns = windowSizeArray[0], this.rows = windowSizeArray[1], this.emit(\"resize\");\n }\n };\n var readline = void 0;\n return WriteStream.prototype.clearLine = function(dir, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).clearLine(this, dir, cb);\n }, WriteStream.prototype.clearScreenDown = function(cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).clearScreenDown(this, cb);\n }, WriteStream.prototype.cursorTo = function(x, y, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).cursorTo(this, x, y, cb);\n }, WriteStream.prototype.getColorDepth = function(env = process.env) {\n if (env.FORCE_COLOR !== void 0)\n switch (env.FORCE_COLOR) {\n case \"\":\n case \"1\":\n case \"true\":\n return warnOnDeactivatedColors(env), COLORS_16;\n case \"2\":\n return warnOnDeactivatedColors(env), COLORS_256;\n case \"3\":\n return warnOnDeactivatedColors(env), COLORS_16m;\n default:\n return COLORS_2;\n }\n if (env.NODE_DISABLE_COLORS !== void 0 || env.NO_COLOR !== void 0 || env.TERM === \"dumb\")\n return COLORS_2;\n if (env.TMUX)\n return COLORS_256;\n if (env.CI) {\n if ([\"APPVEYOR\", \"BUILDKITE\", \"CIRCLECI\", \"DRONE\", \"GITHUB_ACTIONS\", \"GITLAB_CI\", \"TRAVIS\"].some((sign) => (sign in env)) || env.CI_NAME === \"codeship\")\n return COLORS_256;\n return COLORS_2;\n }\n if (\"TEAMCITY_VERSION\" in env)\n return RegExpPrototypeExec(/^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/, env.TEAMCITY_VERSION) !== null \? COLORS_16 : COLORS_2;\n switch (env.TERM_PROGRAM) {\n case \"iTerm.app\":\n if (!env.TERM_PROGRAM_VERSION || RegExpPrototypeExec(/^[0-2]\\./, env.TERM_PROGRAM_VERSION) !== null)\n return COLORS_256;\n return COLORS_16m;\n case \"HyperTerm\":\n case \"MacTerm\":\n return COLORS_16m;\n case \"Apple_Terminal\":\n return COLORS_256;\n }\n if (env.COLORTERM === \"truecolor\" || env.COLORTERM === \"24bit\")\n return COLORS_16m;\n if (env.TERM) {\n if (RegExpPrototypeExec(/^xterm-256/, env.TERM) !== null)\n return COLORS_256;\n const termEnv = StringPrototypeToLowerCase(env.TERM);\n if (TERM_ENVS[termEnv])\n return TERM_ENVS[termEnv];\n if (ArrayPrototypeSome(TERM_ENVS_REG_EXP, (term) => RegExpPrototypeExec(term, termEnv) !== null))\n return COLORS_16;\n }\n if (env.COLORTERM)\n return COLORS_16;\n return COLORS_2;\n }, WriteStream.prototype.getWindowSize = function() {\n return [this.columns, this.rows];\n }, WriteStream.prototype.hasColors = function(count, env) {\n if (env === void 0 && (count === void 0 || typeof count === \"object\" && count !== null))\n env = count, count = 16;\n else\n validateInteger(count, \"count\", 2);\n return count <= 2 ** this.getColorDepth(env);\n }, WriteStream.prototype.moveCursor = function(dx, dy, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).moveCursor(this, dx, dy, cb);\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar validateInteger = (value, name, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!Number.isInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n};\nreturn { ReadStream, WriteStream, isatty }})\n"_s;
+static constexpr ASCIILiteral NodeTLSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/tls.ts\nvar parseCertString = function() {\n throwNotImplemented(\"Not implemented\");\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof @ArrayBuffer || obj instanceof Blob)\n return !0;\n if (@Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof @ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, unfqdn = function(host) {\n return RegExpPrototypeSymbolReplace.@call(/[.]$/, host, \"\");\n}, toLowerCase = function(c) {\n return StringFromCharCode.@call(32 + StringPrototypeCharCodeAt.@call(c, 0));\n}, splitHost = function(host) {\n return StringPrototypeSplit.@call(RegExpPrototypeSymbolReplace.@call(/[A-Z]/g, unfqdn(host), toLowerCase), \".\");\n}, check = function(hostParts, pattern, wildcards) {\n if (!pattern)\n return !1;\n const patternParts = splitHost(pattern);\n if (hostParts.length !== patternParts.length)\n return !1;\n if (ArrayPrototypeIncludes.@call(patternParts, \"\"))\n return !1;\n const isBad = (s) => RegExpPrototypeExec.@call(/[^\\u0021-\\u007F]/u, s) !== null;\n if (ArrayPrototypeSome.@call(patternParts, isBad))\n return !1;\n for (let i = hostParts.length - 1;i > 0; i -= 1)\n if (hostParts[i] !== patternParts[i])\n return !1;\n const hostSubdomain = hostParts[0], patternSubdomain = patternParts[0], patternSubdomainParts = StringPrototypeSplit.@call(patternSubdomain, \"*\");\n if (patternSubdomainParts.length === 1 || StringPrototypeIncludes.@call(patternSubdomain, \"xn--\"))\n return hostSubdomain === patternSubdomain;\n if (!wildcards)\n return !1;\n if (patternSubdomainParts.length > 2)\n return !1;\n if (patternParts.length <= 2)\n return !1;\n const { 0: prefix, 1: suffix } = patternSubdomainParts;\n if (prefix.length + suffix.length > hostSubdomain.length)\n return !1;\n if (!StringPrototypeStartsWith.@call(hostSubdomain, prefix))\n return !1;\n if (!StringPrototypeEndsWith.@call(hostSubdomain, suffix))\n return !1;\n return !0;\n}, splitEscapedAltNames = function(altNames) {\n const result = [];\n let currentToken = \"\", offset = 0;\n while (offset !== altNames.length) {\n const nextSep = StringPrototypeIndexOf.@call(altNames, \", \", offset), nextQuote = StringPrototypeIndexOf.@call(altNames, '\"', offset);\n if (nextQuote !== -1 && (nextSep === -1 || nextQuote < nextSep)) {\n currentToken += StringPrototypeSubstring.@call(altNames, offset, nextQuote);\n const match = RegExpPrototypeExec.@call(jsonStringPattern, StringPrototypeSubstring.@call(altNames, nextQuote));\n if (!match) {\n let error = new SyntaxError(\"ERR_TLS_CERT_ALTNAME_FORMAT: Invalid subject alternative name string\");\n throw error.name = ERR_TLS_CERT_ALTNAME_FORMAT, error;\n }\n currentToken += JSON.parse(match[0]), offset = nextQuote + match[0].length;\n } else if (nextSep !== -1)\n currentToken += StringPrototypeSubstring.@call(altNames, offset, nextSep), ArrayPrototypePush.@call(result, currentToken), currentToken = \"\", offset = nextSep + 2;\n else\n currentToken += StringPrototypeSubstring.@call(altNames, offset), offset = altNames.length;\n }\n return ArrayPrototypePush.@call(result, currentToken), result;\n}, checkServerIdentity = function(hostname, cert) {\n const { subject, subjectaltname: altNames } = cert, dnsNames = [], ips = [];\n if (hostname = \"\" + hostname, altNames) {\n const splitAltNames = StringPrototypeIncludes.@call(altNames, '\"') \? splitEscapedAltNames(altNames) : StringPrototypeSplit.@call(altNames, \", \");\n ArrayPrototypeForEach.@call(splitAltNames, (name) => {\n if (StringPrototypeStartsWith.@call(name, \"DNS:\"))\n ArrayPrototypePush.@call(dnsNames, StringPrototypeSlice.@call(name, 4));\n else if (StringPrototypeStartsWith.@call(name, \"IP Address:\"))\n ArrayPrototypePush.@call(ips, canonicalizeIP(StringPrototypeSlice.@call(name, 11)));\n });\n }\n let valid = !1, reason = \"Unknown reason\";\n if (hostname = unfqdn(hostname), net.isIP(hostname)) {\n if (valid = ArrayPrototypeIncludes.@call(ips, canonicalizeIP(hostname)), !valid)\n reason = `IP: ${hostname} is not in the cert's list: ` + ArrayPrototypeJoin.@call(ips, \", \");\n } else if (dnsNames.length > 0 || subject\?.CN) {\n const hostParts = splitHost(hostname), wildcard = (pattern) => check(hostParts, pattern, !0);\n if (dnsNames.length > 0) {\n if (valid = ArrayPrototypeSome.@call(dnsNames, wildcard), !valid)\n reason = `Host: ${hostname}. is not in the cert's altnames: ${altNames}`;\n } else {\n const cn = subject.CN;\n if (@Array.isArray(cn))\n valid = ArrayPrototypeSome.@call(cn, wildcard);\n else if (cn)\n valid = wildcard(cn);\n if (!valid)\n reason = `Host: ${hostname}. is not cert's CN: ${cn}`;\n }\n } else\n reason = \"Cert does not contain a DNS name\";\n if (!valid) {\n let error = new Error(`ERR_TLS_CERT_ALTNAME_INVALID: Hostname/IP does not match certificate's altnames: ${reason}`);\n return error.name = \"ERR_TLS_CERT_ALTNAME_INVALID\", error.reason = reason, error.host = hostname, error.cert = cert, error;\n }\n}, SecureContext = function(options) {\n return new InternalSecureContext(options);\n}, createSecureContext = function(options) {\n return new SecureContext(options);\n}, translatePeerCertificate = function(c) {\n if (!c)\n return null;\n if (c.issuerCertificate != null && c.issuerCertificate !== c)\n c.issuerCertificate = translatePeerCertificate(c.issuerCertificate);\n if (c.infoAccess != null) {\n const info = c.infoAccess;\n c.infoAccess = { __proto__: null }, RegExpPrototypeSymbolReplace.@call(/([^\\n:]*):([^\\n]*)(\?:\\n|$)/g, info, (all, key, val) => {\n if (val.charCodeAt(0) === 34)\n val = JSONParse(val);\n if (key in c.infoAccess)\n ArrayPrototypePush.@call(c.infoAccess[key], val);\n else\n c.infoAccess[key] = [val];\n });\n }\n return c;\n}, createServer = function(options, connectionListener) {\n return new Server(options, connectionListener);\n}, getCiphers = function() {\n return DEFAULT_CIPHERS.split(\":\");\n}, convertProtocols = function(protocols) {\n const lens = new @Array(protocols.length), buff = @Buffer.allocUnsafe(ArrayPrototypeReduce.@call(protocols, (p, c, i) => {\n const len = @Buffer.byteLength(c);\n if (len > 255)\n @throwRangeError(\"The byte length of the protocol at index \" + `${i} exceeds the maximum length.`, \"<= 255\", len, !0);\n return lens[i] = len, p + 1 + len;\n }, 0));\n let offset = 0;\n for (let i = 0, c = protocols.length;i < c; i++)\n buff[offset++] = lens[i], buff.write(protocols[i], offset), offset += lens[i];\n return buff;\n}, convertALPNProtocols = function(protocols, out) {\n if (@Array.isArray(protocols))\n out.ALPNProtocols = convertProtocols(protocols);\n else if (isTypedArray(protocols))\n out.ALPNProtocols = @Buffer.from(protocols);\n else if (isArrayBufferView(protocols))\n out.ALPNProtocols = @Buffer.from(protocols.buffer.slice(protocols.byteOffset, protocols.byteOffset + protocols.byteLength));\n else if (@Buffer.isBuffer(protocols))\n out.ALPNProtocols = protocols;\n}, $, { isArrayBufferView, isTypedArray } = @requireNativeModule(\"util/types\"), net = @getInternalField(@internalModuleRegistry, 27) || @createInternalModuleById(27), { Server: NetServer, [Symbol.for(\"::bunternal::\")]: InternalTCPSocket } = net, bunSocketInternal = Symbol.for(\"::bunnetsocketinternal::\"), { rootCertificates, canonicalizeIP } = @lazy(\"internal/tls\"), SymbolReplace = Symbol.replace, RegExpPrototypeSymbolReplace = @RegExp.prototype[SymbolReplace], RegExpPrototypeExec = @RegExp.prototype.exec, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeSlice = @String.prototype.slice, StringPrototypeIncludes = @String.prototype.includes, StringPrototypeSplit = @String.prototype.split, StringPrototypeIndexOf = @String.prototype.indexOf, StringPrototypeSubstring = @String.prototype.substring, StringPrototypeEndsWith = @String.prototype.endsWith, StringFromCharCode = @String.fromCharCode, StringPrototypeCharCodeAt = @String.prototype.charCodeAt, ArrayPrototypeIncludes = @Array.prototype.includes, ArrayPrototypeJoin = @Array.prototype.join, ArrayPrototypeForEach = @Array.prototype.forEach, ArrayPrototypePush = @Array.prototype.push, ArrayPrototypeSome = @Array.prototype.some, ArrayPrototypeReduce = @Array.prototype.reduce, jsonStringPattern = /^\"(\?:[^\"\\\\\\u0000-\\u001f]|\\\\(\?:[\"\\\\/bfnrt]|u[0-9a-fA-F]{4}))*\"/, InternalSecureContext = class SecureContext2 {\n context;\n constructor(options) {\n const context = {};\n if (options) {\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.key = key;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.cert = cert;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.ca = ca;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n this.passphrase = passphrase;\n let servername = options.servername;\n if (servername && typeof servername !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n this.servername = servername;\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n this.secureOptions = secureOptions;\n }\n this.context = context;\n }\n}, buntls = Symbol.for(\"::buntls::\"), SocketClass, TLSSocket = function(InternalTLSSocket) {\n SocketClass = InternalTLSSocket, Object.defineProperty(SocketClass.prototype, Symbol.toStringTag, {\n value: \"TLSSocket\",\n enumerable: !1\n });\n function Socket(options) {\n return new InternalTLSSocket(options);\n }\n return Socket.prototype = InternalTLSSocket.prototype, Object.defineProperty(Socket, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalTLSSocket;\n }\n });\n}(class TLSSocket2 extends InternalTCPSocket {\n #secureContext;\n ALPNProtocols;\n #socket;\n #checkServerIdentity;\n #session;\n constructor(socket, options) {\n super(socket instanceof InternalTCPSocket \? options : options || socket);\n if (options = options || socket || {}, typeof options === \"object\") {\n const { ALPNProtocols } = options;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, this);\n if (socket instanceof InternalTCPSocket)\n this.#socket = socket;\n }\n this.#secureContext = options.secureContext || createSecureContext(options), this.authorized = !1, this.secureConnecting = !0, this._secureEstablished = !1, this._securePending = !0, this.#checkServerIdentity = options.checkServerIdentity || checkServerIdentity, this.#session = options.session || null;\n }\n _secureEstablished = !1;\n _securePending = !0;\n _newSessionPending;\n _controlReleased;\n secureConnecting = !1;\n _SNICallback;\n servername;\n authorized = !1;\n authorizationError;\n #renegotiationDisabled = !1;\n encrypted = !0;\n _start() {\n this.connect();\n }\n getSession() {\n return this[bunSocketInternal]\?.getSession();\n }\n getEphemeralKeyInfo() {\n return this[bunSocketInternal]\?.getEphemeralKeyInfo();\n }\n getCipher() {\n return this[bunSocketInternal]\?.getCipher();\n }\n getSharedSigalgs() {\n return this[bunSocketInternal]\?.getSharedSigalgs();\n }\n getProtocol() {\n return this[bunSocketInternal]\?.getTLSVersion();\n }\n getFinished() {\n return this[bunSocketInternal]\?.getTLSFinishedMessage() || @undefined;\n }\n getPeerFinished() {\n return this[bunSocketInternal]\?.getTLSPeerFinishedMessage() || @undefined;\n }\n isSessionReused() {\n return !!this.#session;\n }\n renegotiate() {\n if (this.#renegotiationDisabled) {\n const error = new Error(\"ERR_TLS_RENEGOTIATION_DISABLED: TLS session renegotiation disabled for this socket\");\n throw error.name = \"ERR_TLS_RENEGOTIATION_DISABLED\", error;\n }\n throw Error(\"Not implented in Bun yet\");\n }\n disableRenegotiation() {\n this.#renegotiationDisabled = !0;\n }\n getTLSTicket() {\n return this[bunSocketInternal]\?.getTLSTicket();\n }\n exportKeyingMaterial(length, label, context) {\n if (context)\n return this[bunSocketInternal]\?.exportKeyingMaterial(length, label, context);\n return this[bunSocketInternal]\?.exportKeyingMaterial(length, label);\n }\n setMaxSendFragment(size) {\n return this[bunSocketInternal]\?.setMaxSendFragment(size) || !1;\n }\n enableTrace() {\n }\n setServername(name) {\n if (this.isServer) {\n let error = new Error(\"ERR_TLS_SNI_FROM_SERVER: Cannot issue SNI from a TLS server-side socket\");\n throw error.name = \"ERR_TLS_SNI_FROM_SERVER\", error;\n }\n this.servername = name, this[bunSocketInternal]\?.setServername(name);\n }\n setSession(session) {\n if (this.#session = session, typeof session === \"string\")\n session = @Buffer.from(session, \"latin1\");\n return this[bunSocketInternal]\?.setSession(session);\n }\n getPeerCertificate(abbreviated) {\n const cert = arguments.length < 1 \? this[bunSocketInternal]\?.getPeerCertificate() : this[bunSocketInternal]\?.getPeerCertificate(abbreviated);\n if (cert)\n return translatePeerCertificate(cert);\n }\n getCertificate() {\n const cert = this[bunSocketInternal]\?.getCertificate();\n if (cert)\n return translatePeerCertificate(cert);\n }\n getPeerX509Certificate() {\n throw Error(\"Not implented in Bun yet\");\n }\n getX509Certificate() {\n throw Error(\"Not implented in Bun yet\");\n }\n get alpnProtocol() {\n return this[bunSocketInternal]\?.alpnProtocol;\n }\n [buntls](port, host) {\n return {\n socket: this.#socket,\n ALPNProtocols: this.ALPNProtocols,\n serverName: this.servername || host || \"localhost\",\n checkServerIdentity: this.#checkServerIdentity,\n session: this.#session,\n ...this.#secureContext\n };\n }\n});\n\nclass Server extends NetServer {\n key;\n cert;\n ca;\n passphrase;\n secureOptions;\n _rejectUnauthorized;\n _requestCert;\n servername;\n ALPNProtocols;\n constructor(options, secureConnectionListener) {\n super(options, secureConnectionListener);\n this.setSecureContext(options);\n }\n setSecureContext(options) {\n if (options instanceof InternalSecureContext)\n options = options.context;\n if (options) {\n const { ALPNProtocols } = options;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, this);\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.key = key;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.cert = cert;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.ca = ca;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n this.passphrase = passphrase;\n let servername = options.servername;\n if (servername && typeof servername !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n this.servername = servername;\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n this.secureOptions = secureOptions;\n const requestCert = options.requestCert || !1;\n if (requestCert)\n this._requestCert = requestCert;\n else\n this._requestCert = @undefined;\n const rejectUnauthorized = options.rejectUnauthorized || !1;\n if (rejectUnauthorized)\n this._rejectUnauthorized = rejectUnauthorized;\n else\n this._rejectUnauthorized = @undefined;\n }\n }\n getTicketKeys() {\n throw Error(\"Not implented in Bun yet\");\n }\n setTicketKeys() {\n throw Error(\"Not implented in Bun yet\");\n }\n [buntls](port, host, isClient) {\n return [\n {\n serverName: this.servername || host || \"localhost\",\n key: this.key,\n cert: this.cert,\n ca: this.ca,\n passphrase: this.passphrase,\n secureOptions: this.secureOptions,\n rejectUnauthorized: isClient \? !1 : this._rejectUnauthorized,\n requestCert: isClient \? !1 : this._requestCert,\n ALPNProtocols: this.ALPNProtocols\n },\n SocketClass\n ];\n }\n}\nvar CLIENT_RENEG_LIMIT = 3, CLIENT_RENEG_WINDOW = 600, DEFAULT_ECDH_CURVE = \"auto\", DEFAULT_CIPHERS = \"DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256\", DEFAULT_MIN_VERSION = \"TLSv1.2\", DEFAULT_MAX_VERSION = \"TLSv1.3\", createConnection = (port, host, connectListener) => {\n if (typeof port === \"object\") {\n port.checkServerIdentity;\n const { ALPNProtocols } = port;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, port);\n return new TLSSocket(port).connect(port, host, connectListener);\n }\n return new TLSSocket().connect(port, host, connectListener);\n}, connect = createConnection;\n$ = {\n CLIENT_RENEG_LIMIT,\n CLIENT_RENEG_WINDOW,\n connect,\n convertALPNProtocols,\n createConnection,\n createSecureContext,\n createServer,\n DEFAULT_CIPHERS,\n DEFAULT_ECDH_CURVE,\n DEFAULT_MAX_VERSION,\n DEFAULT_MIN_VERSION,\n getCiphers,\n parseCertString,\n SecureContext,\n Server,\n TLSSocket,\n checkServerIdentity,\n rootCertificates\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeUrlCode = "(function (){\"use strict\";// src/js/out/tmp/node/url.ts\nvar Url = function() {\n this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;\n}, urlParse = function(url, parseQueryString, slashesDenoteHost) {\n if (url && typeof url === \"object\" && url instanceof Url)\n return url;\n var u = new Url;\n return u.parse(url, parseQueryString, slashesDenoteHost), u;\n}, urlFormat = function(obj) {\n if (typeof obj === \"string\")\n obj = urlParse(obj);\n if (!(obj instanceof Url))\n return Url.prototype.format.call(obj);\n return obj.format();\n}, urlResolve = function(source, relative) {\n return urlParse(source, !1, !0).resolve(relative);\n}, urlResolveObject = function(source, relative) {\n if (!source)\n return relative;\n return urlParse(source, !1, !0).resolveObject(relative);\n}, urlToHttpOptions = function(url) {\n const options = {\n protocol: url.protocol,\n hostname: typeof url.hostname === \"string\" && url.hostname.startsWith(\"[\") \? url.hostname.slice(1, -1) : url.hostname,\n hash: url.hash,\n search: url.search,\n pathname: url.pathname,\n path: `${url.pathname || \"\"}${url.search || \"\"}`,\n href: url.href\n };\n if (url.port !== \"\")\n options.port = Number(url.port);\n if (url.username || url.password)\n options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;\n return options;\n}, $, { URL, URLSearchParams } = globalThis;\nUrl.prototype = {};\nvar protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, simplePathPattern = /^(\\/\\/\?(\?!\\/)[^\?\\s]*)(\\\?[^\\s]*)\?$/, delims = [\"<\", \">\", '\"', \"`\", \" \", \"\\r\", \"\\n\", \"\\t\"], unwise = [\"{\", \"}\", \"|\", \"\\\\\", \"^\", \"`\"].concat(delims), autoEscape = [\"'\"].concat(unwise), nonHostChars = [\"%\", \"/\", \"\?\", \";\", \"#\"].concat(autoEscape), hostEndingChars = [\"/\", \"\?\", \"#\"], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, unsafeProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, hostlessProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, slashedProtocol = {\n http: !0,\n https: !0,\n ftp: !0,\n gopher: !0,\n file: !0,\n \"http:\": !0,\n \"https:\": !0,\n \"ftp:\": !0,\n \"gopher:\": !0,\n \"file:\": !0\n};\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (typeof url !== \"string\")\n @throwTypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n var queryIndex = url.indexOf(\"\?\"), splitter = queryIndex !== -1 && queryIndex < url.indexOf(\"#\") \? \"\?\" : \"#\", uSplit = url.split(splitter), slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, \"/\"), url = uSplit.join(splitter);\n var rest = url;\n if (rest = rest.trim(), !slashesDenoteHost && url.split(\"#\").length === 1) {\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n if (this.path = rest, this.href = rest, this.pathname = simplePath[1], simplePath[2])\n if (this.search = simplePath[2], parseQueryString)\n this.query = new URLSearchParams(this.search.substr(1)).toJSON();\n else\n this.query = this.search.substr(1);\n else if (parseQueryString)\n this.search = \"\", this.query = {};\n return this;\n }\n }\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto, rest = rest.substr(proto.length);\n }\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@/]+@[^@/]+/)) {\n var slashes = rest.substr(0, 2) === \"//\";\n if (slashes && !(proto && hostlessProtocol[proto]))\n rest = rest.substr(2), this.slashes = !0;\n }\n if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {\n var hostEnd = -1;\n for (var i = 0;i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n var auth, atSign;\n if (hostEnd === -1)\n atSign = rest.lastIndexOf(\"@\");\n else\n atSign = rest.lastIndexOf(\"@\", hostEnd);\n if (atSign !== -1)\n auth = rest.slice(0, atSign), rest = rest.slice(atSign + 1), this.auth = decodeURIComponent(auth);\n hostEnd = -1;\n for (var i = 0;i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n if (hostEnd === -1)\n hostEnd = rest.length;\n this.host = rest.slice(0, hostEnd), rest = rest.slice(hostEnd), this.parseHost(), this.hostname = this.hostname || \"\";\n var ipv6Hostname = this.hostname[0] === \"[\" && this.hostname[this.hostname.length - 1] === \"]\";\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length;i < l; i++) {\n var part = hostparts[i];\n if (!part)\n continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = \"\";\n for (var j = 0, k = part.length;j < k; j++)\n if (part.charCodeAt(j) > 127)\n newpart += \"x\";\n else\n newpart += part[j];\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i), notHost = hostparts.slice(i + 1), bit = part.match(hostnamePartStart);\n if (bit)\n validParts.push(bit[1]), notHost.unshift(bit[2]);\n if (notHost.length)\n rest = \"/\" + notHost.join(\".\") + rest;\n this.hostname = validParts.join(\".\");\n break;\n }\n }\n }\n }\n if (this.hostname.length > hostnameMaxLen)\n this.hostname = \"\";\n else\n this.hostname = this.hostname.toLowerCase();\n if (!ipv6Hostname)\n this.hostname = new URL(\"http://\" + this.hostname).hostname;\n var p = this.port \? \":\" + this.port : \"\", h = this.hostname || \"\";\n if (this.host = h + p, this.href += this.host, ipv6Hostname) {\n if (this.hostname = this.hostname.substr(1, this.hostname.length - 2), rest[0] !== \"/\")\n rest = \"/\" + rest;\n }\n }\n if (!unsafeProtocol[lowerProto])\n for (var i = 0, l = autoEscape.length;i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae)\n esc = escape(ae);\n rest = rest.split(ae).join(esc);\n }\n var hash = rest.indexOf(\"#\");\n if (hash !== -1)\n this.hash = rest.substr(hash), rest = rest.slice(0, hash);\n var qm = rest.indexOf(\"\?\");\n if (qm !== -1) {\n if (this.search = rest.substr(qm), this.query = rest.substr(qm + 1), parseQueryString)\n this.query = new URLSearchParams(this.query);\n rest = rest.slice(0, qm);\n } else if (parseQueryString)\n this.search = \"\", this.query = {};\n if (rest)\n this.pathname = rest;\n if (slashedProtocol[lowerProto] && this.hostname && !this.pathname)\n this.pathname = \"/\";\n if (this.pathname || this.search) {\n var p = this.pathname || \"\", s = this.search || \"\";\n this.path = p + s;\n }\n return this.href = this.format(), this;\n};\nUrl.prototype.format = function() {\n var auth = this.auth || \"\";\n if (auth)\n auth = encodeURIComponent(auth), auth = auth.replace(/%3A/i, \":\"), auth += \"@\";\n var protocol = this.protocol || \"\", pathname = this.pathname || \"\", hash = this.hash || \"\", host = !1, query = \"\";\n if (this.host)\n host = auth + this.host;\n else if (this.hostname) {\n if (host = auth + (this.hostname.indexOf(\":\") === -1 \? this.hostname : \"[\" + this.hostname + \"]\"), this.port)\n host += \":\" + this.port;\n }\n if (this.query && typeof this.query === \"object\" && Object.keys(this.query).length)\n query = new URLSearchParams(this.query).toString();\n var search = this.search || query && \"\?\" + query || \"\";\n if (protocol && protocol.substr(-1) !== \":\")\n protocol += \":\";\n if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== !1) {\n if (host = \"//\" + (host || \"\"), pathname && pathname.charAt(0) !== \"/\")\n pathname = \"/\" + pathname;\n } else if (!host)\n host = \"\";\n if (hash && hash.charAt(0) !== \"#\")\n hash = \"#\" + hash;\n if (search && search.charAt(0) !== \"\?\")\n search = \"\?\" + search;\n return pathname = pathname.replace(/[\?#]/g, function(match) {\n return encodeURIComponent(match);\n }), search = search.replace(\"#\", \"%23\"), protocol + host + pathname + search + hash;\n};\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, !1, !0)).format();\n};\nUrl.prototype.resolveObject = function(relative) {\n if (typeof relative === \"string\") {\n var rel = new Url;\n rel.parse(relative, !1, !0), relative = rel;\n }\n var result = new Url, tkeys = Object.keys(this);\n for (var tk = 0;tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n if (result.hash = relative.hash, relative.href === \"\")\n return result.href = result.format(), result;\n if (relative.slashes && !relative.protocol) {\n var rkeys = Object.keys(relative);\n for (var rk = 0;rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== \"protocol\")\n result[rkey] = relative[rkey];\n }\n if (slashedProtocol[result.protocol] && result.hostname && !result.pathname)\n result.pathname = \"/\", result.path = result.pathname;\n return result.href = result.format(), result;\n }\n if (relative.protocol && relative.protocol !== result.protocol) {\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0;v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n return result.href = result.format(), result;\n }\n if (result.protocol = relative.protocol, !relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || \"\").split(\"/\");\n while (relPath.length && !(relative.host = relPath.shift()))\n ;\n if (!relative.host)\n relative.host = \"\";\n if (!relative.hostname)\n relative.hostname = \"\";\n if (relPath[0] !== \"\")\n relPath.unshift(\"\");\n if (relPath.length < 2)\n relPath.unshift(\"\");\n result.pathname = relPath.join(\"/\");\n } else\n result.pathname = relative.pathname;\n if (result.search = relative.search, result.query = relative.query, result.host = relative.host || \"\", result.auth = relative.auth, result.hostname = relative.hostname || relative.host, result.port = relative.port, result.pathname || result.search) {\n var p = result.pathname || \"\", s = result.search || \"\";\n result.path = p + s;\n }\n return result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n }\n var isSourceAbs = result.pathname && result.pathname.charAt(0) === \"/\", isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === \"/\", mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split(\"/\") || [], relPath = relative.pathname && relative.pathname.split(\"/\") || [], psychotic = result.protocol && !slashedProtocol[result.protocol];\n if (psychotic) {\n if (result.hostname = \"\", result.port = null, result.host)\n if (srcPath[0] === \"\")\n srcPath[0] = result.host;\n else\n srcPath.unshift(result.host);\n if (result.host = \"\", relative.protocol) {\n if (relative.hostname = null, relative.port = null, relative.host)\n if (relPath[0] === \"\")\n relPath[0] = relative.host;\n else\n relPath.unshift(relative.host);\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === \"\" || srcPath[0] === \"\");\n }\n if (isRelAbs)\n result.host = relative.host || relative.host === \"\" \? relative.host : result.host, result.hostname = relative.hostname || relative.hostname === \"\" \? relative.hostname : result.hostname, result.search = relative.search, result.query = relative.query, srcPath = relPath;\n else if (relPath.length) {\n if (!srcPath)\n srcPath = [];\n srcPath.pop(), srcPath = srcPath.concat(relPath), result.search = relative.search, result.query = relative.query;\n } else if (relative.search != null) {\n if (psychotic) {\n result.host = srcPath.shift(), result.hostname = result.host;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (result.search = relative.search, result.query = relative.query, result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.href = result.format(), result;\n }\n if (!srcPath.length) {\n if (result.pathname = null, result.search)\n result.path = \"/\" + result.search;\n else\n result.path = null;\n return result.href = result.format(), result;\n }\n var last = srcPath.slice(-1)[0], hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === \".\" || last === \"..\") || last === \"\", up = 0;\n for (var i = srcPath.length;i >= 0; i--)\n if (last = srcPath[i], last === \".\")\n srcPath.splice(i, 1);\n else if (last === \"..\")\n srcPath.splice(i, 1), up++;\n else if (up)\n srcPath.splice(i, 1), up--;\n if (!mustEndAbs && !removeAllDots)\n for (;up--; up)\n srcPath.unshift(\"..\");\n if (mustEndAbs && srcPath[0] !== \"\" && (!srcPath[0] || srcPath[0].charAt(0) !== \"/\"))\n srcPath.unshift(\"\");\n if (hasTrailingSlash && srcPath.join(\"/\").substr(-1) !== \"/\")\n srcPath.push(\"\");\n var isAbsolute = srcPath[0] === \"\" || srcPath[0] && srcPath[0].charAt(0) === \"/\";\n if (psychotic) {\n result.hostname = isAbsolute \? \"\" : srcPath.length \? srcPath.shift() : \"\", result.host = result.hostname;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (mustEndAbs = mustEndAbs || result.host && srcPath.length, mustEndAbs && !isAbsolute)\n srcPath.unshift(\"\");\n if (srcPath.length > 0)\n result.pathname = srcPath.join(\"/\");\n else\n result.pathname = null, result.path = null;\n if (result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.auth = relative.auth || result.auth, result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n};\nUrl.prototype.parseHost = function() {\n var host = this.host, port = portPattern.exec(host);\n if (port) {\n if (port = port[0], port !== \":\")\n this.port = port.substr(1);\n host = host.substr(0, host.length - port.length);\n }\n if (host)\n this.hostname = host;\n};\nvar pathToFileURL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"pathToFileURL\"), fileURLToPath = globalThis[globalThis.Symbol.for('Bun.lazy')](\"fileURLToPath\");\n$ = {\n parse: urlParse,\n resolve: urlResolve,\n resolveObject: urlResolveObject,\n format: urlFormat,\n Url,\n URLSearchParams,\n URL,\n pathToFileURL,\n fileURLToPath,\n urlToHttpOptions\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeTraceEventsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/trace_events.ts\nvar ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, createTracing = function(opts) {\n if (typeof opts !== \"object\" || opts == null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", opts);\n return new Tracing(opts);\n}, getEnabledCategories = function() {\n return \"\";\n}, $;\n\nclass Tracing {\n enabled = !1;\n categories = \"\";\n}\n$ = {\n createTracing,\n getEnabledCategories\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeUtilCode = "(function (){\"use strict\";// src/js/out/tmp/node/util.ts\nvar isBufferInterface = function({ copy, fill, readUint8 }) {\n return typeof copy === \"function\" && typeof fill === \"function\" && typeof readUint8 === \"function\";\n}, isBuffer = function(value) {\n return Buffer.isBuffer(value) || typeof value === \"object\" && isBufferInterface(value || {});\n}, isFunction = function(value) {\n return typeof value === \"function\";\n}, formatWithOptions = function(inspectOptions, f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0;i < arguments.length; i++)\n objects.push(inspect(arguments[i], inspectOptions));\n return objects.join(\" \");\n }\n var i = 2, args = arguments, len = args.length, str = String(f).replace(formatRegExp, function(x2) {\n if (x2 === \"%%\")\n return \"%\";\n if (i >= len)\n return x2;\n switch (x2) {\n case \"%s\":\n return String(args[i++]);\n case \"%f\":\n return Number(args[i++]);\n case \"%d\":\n return Math.round(Number(args[i++]));\n case \"%j\":\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return \"[Circular]\";\n }\n case \"%o\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n case \"%O\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n default:\n return x2;\n }\n });\n for (var x = args[i];i < len; x = args[++i])\n if (isNull(x) || !isObject(x))\n str += \" \" + x;\n else\n str += \" \" + inspect(x, inspectOptions);\n return str;\n}, format = function(...args) {\n return formatWithOptions({}, ...args);\n}, deprecate = function(fn, msg, code) {\n if (process.noDeprecation === !0)\n return fn;\n var warned = !1;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n var err = new Error(msg);\n if (code)\n err.code = code;\n throw err;\n } else if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n warned = !0;\n }\n return fn.apply(this, arguments);\n }\n return deprecated;\n}, debuglog = function(set) {\n if (set = set.toUpperCase(), !debugs[set])\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = format.apply(cjs_exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else\n debugs[set] = function() {\n };\n return debugs[set];\n}, inspect = function(obj, opts) {\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n if (arguments.length >= 3)\n ctx.depth = arguments[2];\n if (arguments.length >= 4)\n ctx.colors = arguments[3];\n if (isBoolean(opts))\n ctx.showHidden = opts;\n else if (opts)\n _extend(ctx, opts);\n if (isUndefined(ctx.showHidden))\n ctx.showHidden = !1;\n if (isUndefined(ctx.depth))\n ctx.depth = 2;\n if (isUndefined(ctx.colors))\n ctx.colors = !1;\n if (isUndefined(ctx.customInspect))\n ctx.customInspect = !0;\n if (ctx.colors)\n ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}, stylizeWithColor = function(str, styleType) {\n const style = inspect.styles[styleType];\n if (style !== void 0) {\n const color = inspect.colors[style];\n if (color !== void 0)\n return `\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`;\n }\n return str;\n}, stylizeNoColor = function(str, styleType) {\n return str;\n}, arrayToHash = function(array) {\n var hash = {};\n return array.forEach(function(val, idx) {\n hash[val] = !0;\n }), hash;\n}, formatValue = function(ctx, value, recurseTimes) {\n if (ctx.customInspect && value) {\n const customInspect = value[kInspectCustom];\n if (isFunction(customInspect)) {\n var ret = customInspect.call(value, recurseTimes, ctx, inspect);\n if (!isString(ret))\n ret = formatValue(ctx, ret, recurseTimes);\n return ret;\n }\n }\n var primitive = formatPrimitive(ctx, value);\n if (primitive)\n return primitive;\n var keys = Object.keys(value).concat(Object.getOwnPropertySymbols(value)), visibleKeys = arrayToHash(keys);\n if (ctx.showHidden)\n keys = Object.getOwnPropertyNames(value);\n if (isError(value) && (keys.indexOf(\"message\") >= 0 || keys.indexOf(\"description\") >= 0))\n return formatError(value);\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name \? \": \" + value.name : \"\";\n return ctx.stylize(\"[Function\" + name + \"]\", \"special\");\n }\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n if (isDate(value))\n return ctx.stylize(Date.prototype.toString.call(value), \"date\");\n if (isError(value))\n return formatError(value);\n }\n var base = \"\", array = !1, braces = [\"{\", \"}\"];\n if (@isArray(value))\n array = !0, braces = [\"[\", \"]\"];\n if (isFunction(value)) {\n var n = value.name \? \": \" + value.name : \"\";\n base = \" [Function\" + n + \"]\";\n }\n if (isRegExp(value))\n base = \" \" + RegExp.prototype.toString.call(value);\n if (isDate(value))\n base = \" \" + Date.prototype.toUTCString.call(value);\n if (isError(value))\n base = \" \" + formatError(value);\n if (keys.length === 0 && (!array || value.length == 0))\n return braces[0] + base + braces[1];\n if (recurseTimes < 0)\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n else\n return ctx.stylize(\"[Object]\", \"special\");\n ctx.seen.push(value);\n var output;\n if (array)\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n else\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n return ctx.seen.pop(), reduceToSingleString(output, base, braces);\n}, formatPrimitive = function(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize(\"undefined\", \"undefined\");\n if (isString(value)) {\n var simple = \"'\" + JSON.stringify(value).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return ctx.stylize(simple, \"string\");\n }\n if (isNumber(value))\n return ctx.stylize(\"\" + value, \"number\");\n if (isBoolean(value))\n return ctx.stylize(\"\" + value, \"boolean\");\n if (isNull(value))\n return ctx.stylize(\"null\", \"null\");\n}, formatError = function(value) {\n return \"[\" + Error.prototype.toString.call(value) + \"]\";\n}, formatArray = function(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length;i < l; ++i)\n if (hasOwnProperty(value, String(i)))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), !0));\n else\n output.push(\"\");\n return keys.forEach(function(key) {\n if (!key.match(/^\\d+$/))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, !0));\n }), output;\n}, formatProperty = function(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n if (desc = Object.getOwnPropertyDescriptor(value, key) || {\n value: value[key]\n }, desc.get)\n if (desc.set)\n str = ctx.stylize(\"[Getter/Setter]\", \"special\");\n else\n str = ctx.stylize(\"[Getter]\", \"special\");\n else if (desc.set)\n str = ctx.stylize(\"[Setter]\", \"special\");\n if (!hasOwnProperty(visibleKeys, key))\n name = \"[\" + (typeof key === \"symbol\" \? key.description : key) + \"]\";\n if (typeof key === \"symbol\")\n name = \"[\" + ctx.stylize(`Symbol(${key.description})`, \"string\") + \"]\";\n if (!str)\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes))\n str = formatValue(ctx, desc.value, null);\n else\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n if (str.indexOf(\"\\n\") > -1)\n if (array)\n str = str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\").substr(2);\n else\n str = \"\\n\" + str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\");\n } else\n str = ctx.stylize(\"[Circular]\", \"special\");\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/))\n return str;\n if (name = JSON.stringify(\"\" + key), name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/))\n name = name.substr(1, name.length - 2), name = ctx.stylize(name, \"name\");\n else\n name = name.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\"), name = ctx.stylize(name, \"string\");\n }\n return name + \": \" + str;\n}, reduceToSingleString = function(output, base, braces) {\n var numLinesEst = 0, length = output.reduce(function(prev, cur) {\n if (numLinesEst++, cur.indexOf(\"\\n\") >= 0)\n numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d\?m/g, \"\").length + 1;\n }, 0);\n if (length > 60)\n return braces[0] + (base === \"\" \? \"\" : base + \"\\n \") + \" \" + output.join(\",\\n \") + \" \" + braces[1];\n return braces[0] + base + \" \" + output.join(\", \") + \" \" + braces[1];\n}, isBoolean = function(arg) {\n return typeof arg === \"boolean\";\n}, isNull = function(arg) {\n return arg === null;\n}, isNullOrUndefined = function(arg) {\n return arg == null;\n}, isNumber = function(arg) {\n return typeof arg === \"number\";\n}, isString = function(arg) {\n return typeof arg === \"string\";\n}, isSymbol = function(arg) {\n return typeof arg === \"symbol\";\n}, isUndefined = function(arg) {\n return arg === void 0;\n}, isObject = function(arg) {\n return typeof arg === \"object\" && arg !== null;\n}, isPrimitive = function(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || typeof arg === \"undefined\";\n}, pad = function(n) {\n return n < 10 \? \"0\" + n.toString(10) : n.toString(10);\n}, timestamp = function() {\n var d = new Date, time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(\":\");\n return [d.getDate(), months[d.getMonth()], time].join(\" \");\n}, hasOwnProperty = function(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}, callbackifyOnRejected = function(reason, cb) {\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason, newReason.code = \"ERR_FALSY_VALUE_REJECTION\", reason = newReason;\n }\n return cb(reason);\n}, callbackify = function(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n function callbackified() {\n var args = Array.prototype.slice.call(arguments), maybeCb = args.pop();\n if (typeof maybeCb !== \"function\")\n @throwTypeError(\"The last argument must be of type Function\");\n var self = this, cb = function() {\n return maybeCb.apply(self, arguments);\n };\n original.apply(this, args).then(function(ret) {\n process.nextTick(cb, null, ret);\n }, function(rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }\n return Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)), Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)), callbackified;\n}, $, types = @requireNativeModule(\"util/types\"), cjs_exports = {}, deepEquals = Bun.deepEquals, isDeepStrictEqual = (a, b) => deepEquals(a, b, !0), getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors, formatRegExp = /%[sdjfoc%]/g, debugs = {}, debugEnvRegex = /^$/;\nif (process.env.NODE_DEBUG)\n debugEnv = process.env.NODE_DEBUG, debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+\?.]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/,/g, \"$|^\").toUpperCase(), debugEnvRegex = new RegExp(\"^\" + debugEnv + \"$\", \"i\");\nvar debugEnv, kInspectCustom = Symbol.for(\"nodejs.util.inspect.custom\");\ninspect.colors = {\n bold: [1, 22],\n italic: [3, 23],\n underline: [4, 24],\n inverse: [7, 27],\n white: [37, 39],\n grey: [90, 39],\n black: [30, 39],\n blue: [34, 39],\n cyan: [36, 39],\n green: [32, 39],\n magenta: [35, 39],\n red: [31, 39],\n yellow: [33, 39]\n};\ninspect.styles = {\n special: \"cyan\",\n number: \"yellow\",\n boolean: \"yellow\",\n undefined: \"grey\",\n null: \"bold\",\n string: \"green\",\n date: \"magenta\",\n regexp: \"red\"\n};\ninspect.custom = kInspectCustom;\ninspect.defaultOptions = {\n showHidden: !1,\n depth: 2,\n colors: !1,\n customInspect: !0,\n showProxy: !1,\n maxArrayLength: 100,\n maxStringLength: 1e4,\n breakLength: 80,\n compact: 3,\n sorted: !1,\n getters: !1,\n numericSeparator: !1\n};\nvar { isRegExp, isDate, isNativeError: isError } = types, months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], log = function log2() {\n console.log(\"%s - %s\", timestamp(), format.apply(cjs_exports, arguments));\n}, inherits = function inherits2(ctor, superCtor) {\n ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n });\n}, _extend = function(origin, add) {\n if (!add || !isObject(add))\n return origin;\n var keys = Object.keys(add), i = keys.length;\n while (i--)\n origin[keys[i]] = add[keys[i]];\n return origin;\n}, kCustomPromisifiedSymbol = Symbol.for(\"util.promisify.custom\"), promisify = function promisify2(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\")\n @throwTypeError('The \"util.promisify.custom\" argument must be of type Function');\n return Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n }), fn;\n }\n function fn() {\n var promiseResolve, promiseReject, promise = new Promise(function(resolve, reject) {\n promiseResolve = resolve, promiseReject = reject;\n }), args = [];\n for (var i = 0;i < arguments.length; i++)\n args.push(arguments[i]);\n args.push(function(err, value) {\n if (err)\n promiseReject(err);\n else\n promiseResolve(value);\n });\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n if (Object.setPrototypeOf(fn, Object.getPrototypeOf(original)), kCustomPromisifiedSymbol)\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n return Object.defineProperties(fn, getOwnPropertyDescriptors(original));\n};\npromisify.custom = kCustomPromisifiedSymbol;\nvar toUSVString = (input) => {\n return (input + \"\").toWellFormed();\n};\n$ = Object.assign(cjs_exports, {\n format,\n formatWithOptions,\n deprecate,\n debuglog,\n _extend,\n inspect,\n types,\n isArray: @isArray,\n isBoolean,\n isNull,\n isNullOrUndefined,\n isNumber,\n isString,\n isSymbol,\n isUndefined,\n isRegExp,\n isObject,\n isDate,\n isFunction,\n isError,\n isPrimitive,\n isBuffer,\n log,\n inherits,\n toUSVString,\n promisify,\n callbackify,\n isDeepStrictEqual,\n TextDecoder,\n TextEncoder\n});\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeTtyCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/tty.ts\nvar ReadStream = function(fd) {\n if (!(this instanceof ReadStream))\n return new ReadStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21)).ReadStream.@call(this, \"\", {\n fd\n });\n return Object.setPrototypeOf(stream, ReadStream.prototype), stream.isRaw = !1, stream.isTTY = !0, stream;\n}, warnOnDeactivatedColors = function(env) {\n if (warned)\n return;\n let name = \"\";\n if (env.NODE_DISABLE_COLORS !== @undefined)\n name = \"NODE_DISABLE_COLORS\";\n if (env.NO_COLOR !== @undefined) {\n if (name !== \"\")\n name += \"' and '\";\n name += \"NO_COLOR\";\n }\n if (name !== \"\")\n process.emitWarning(`The '${name}' env is ignored due to the 'FORCE_COLOR' env being set.`, \"Warning\"), warned = !0;\n}, WriteStream = function(fd) {\n if (!(this instanceof WriteStream))\n return new WriteStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21)).WriteStream.@call(this, \"\", {\n fd\n });\n if (stream.columns = @undefined, stream.rows = @undefined, stream.isTTY = isatty(stream.fd), stream.isTTY) {\n const windowSizeArray = [0, 0];\n if (_getWindowSize(fd, windowSizeArray) === !0)\n stream.columns = windowSizeArray[0], stream.rows = windowSizeArray[1];\n }\n return stream;\n}, { ttySetMode, isatty, getWindowSize: _getWindowSize } = @lazy(\"tty\"), NumberIsInteger = Number.isInteger;\nObject.defineProperty(ReadStream, \"prototype\", {\n get() {\n const Prototype = Object.create((@getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21)).ReadStream.prototype);\n return Prototype.setRawMode = function(flag) {\n const mode = flag \? 1 : 0, err = ttySetMode(this.fd, mode);\n if (err)\n return this.emit(\"error\", new Error(\"setRawMode failed with errno: \" + err)), this;\n return this.isRaw = flag, this;\n }, Object.defineProperty(ReadStream, \"prototype\", { value: Prototype }), Prototype;\n },\n enumerable: !0,\n configurable: !0\n});\nvar COLORS_2 = 1, COLORS_16 = 4, COLORS_256 = 8, COLORS_16m = 24, TERM_ENVS = {\n eterm: COLORS_16,\n cons25: COLORS_16,\n console: COLORS_16,\n cygwin: COLORS_16,\n dtterm: COLORS_16,\n gnome: COLORS_16,\n hurd: COLORS_16,\n jfbterm: COLORS_16,\n konsole: COLORS_16,\n kterm: COLORS_16,\n mlterm: COLORS_16,\n mosh: COLORS_16m,\n putty: COLORS_16,\n st: COLORS_16,\n \"rxvt-unicode-24bit\": COLORS_16m,\n terminator: COLORS_16m\n}, TERM_ENVS_REG_EXP = [/ansi/, /color/, /linux/, /^con[0-9]*x[0-9]/, /^rxvt/, /^screen/, /^xterm/, /^vt100/], warned = !1;\nObject.defineProperty(WriteStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21)).WriteStream.prototype;\n Object.defineProperty(WriteStream, \"prototype\", { value: Real }), WriteStream.prototype._refreshSize = function() {\n const oldCols = this.columns, oldRows = this.rows, windowSizeArray = [0, 0];\n if (_getWindowSize(this.fd, windowSizeArray) === !0) {\n if (oldCols !== windowSizeArray[0] || oldRows !== windowSizeArray[1])\n this.columns = windowSizeArray[0], this.rows = windowSizeArray[1], this.emit(\"resize\");\n }\n };\n var readline = @undefined;\n return WriteStream.prototype.clearLine = function(dir, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).clearLine(this, dir, cb);\n }, WriteStream.prototype.clearScreenDown = function(cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).clearScreenDown(this, cb);\n }, WriteStream.prototype.cursorTo = function(x, y, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).cursorTo(this, x, y, cb);\n }, WriteStream.prototype.getColorDepth = function(env = process.env) {\n if (env.FORCE_COLOR !== @undefined)\n switch (env.FORCE_COLOR) {\n case \"\":\n case \"1\":\n case \"true\":\n return warnOnDeactivatedColors(env), COLORS_16;\n case \"2\":\n return warnOnDeactivatedColors(env), COLORS_256;\n case \"3\":\n return warnOnDeactivatedColors(env), COLORS_16m;\n default:\n return COLORS_2;\n }\n if (env.NODE_DISABLE_COLORS !== @undefined || env.NO_COLOR !== @undefined || env.TERM === \"dumb\")\n return COLORS_2;\n if (env.TMUX)\n return COLORS_256;\n if (env.CI) {\n if ([\"APPVEYOR\", \"BUILDKITE\", \"CIRCLECI\", \"DRONE\", \"GITHUB_ACTIONS\", \"GITLAB_CI\", \"TRAVIS\"].some((sign) => (sign in env)) || env.CI_NAME === \"codeship\")\n return COLORS_256;\n return COLORS_2;\n }\n if (\"TEAMCITY_VERSION\" in env)\n return /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) \? COLORS_16 : COLORS_2;\n switch (env.TERM_PROGRAM) {\n case \"iTerm.app\":\n if (!env.TERM_PROGRAM_VERSION || /^[0-2]\\./.test(env.TERM_PROGRAM_VERSION))\n return COLORS_256;\n return COLORS_16m;\n case \"HyperTerm\":\n case \"MacTerm\":\n return COLORS_16m;\n case \"Apple_Terminal\":\n return COLORS_256;\n }\n if (env.COLORTERM === \"truecolor\" || env.COLORTERM === \"24bit\")\n return COLORS_16m;\n if (env.TERM) {\n if (/^xterm-256/.test(env.TERM) !== null)\n return COLORS_256;\n const termEnv = env.TERM.toLowerCase();\n if (TERM_ENVS[termEnv])\n return TERM_ENVS[termEnv];\n if (TERM_ENVS_REG_EXP.some((term) => term.test(termEnv)))\n return COLORS_16;\n }\n if (env.COLORTERM)\n return COLORS_16;\n return COLORS_2;\n }, WriteStream.prototype.getWindowSize = function() {\n return [this.columns, this.rows];\n }, WriteStream.prototype.hasColors = function(count, env) {\n if (env === @undefined && (count === @undefined || typeof count === \"object\" && count !== null))\n env = count, count = 16;\n else\n validateInteger(count, \"count\", 2);\n return count <= 2 ** this.getColorDepth(env);\n }, WriteStream.prototype.moveCursor = function(dx, dy, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).moveCursor(this, dx, dy, cb);\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar validateInteger = (value, name, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n};\nreturn { ReadStream, WriteStream, isatty }})\n");
//
//
-static constexpr ASCIILiteral NodeV8Code = "(function (){\"use strict\";// src/js/out/tmp/node/v8.ts\nvar notimpl = function(message) {\n throwNotImplemented(\"node:v8 \" + message);\n}, cachedDataVersionTag = function() {\n notimpl(\"cachedDataVersionTag\");\n}, getHeapSnapshot = function() {\n notimpl(\"getHeapSnapshot\");\n}, getHeapStatistics = function() {\n const stats = jsc.heapStats();\n return {\n total_heap_size: stats.heapCapacity,\n total_heap_size_executable: 0,\n total_physical_size: stats.heapSize,\n total_available_size: Infinity,\n used_heap_size: stats.heapSize,\n heap_size_limit: Infinity,\n malloced_memory: stats.heapSize,\n peak_malloced_memory: Infinity,\n does_zap_garbage: 0,\n number_of_native_contexts: Infinity,\n number_of_detached_contexts: Infinity,\n total_global_handles_size: Infinity,\n used_global_handles_size: Infinity,\n external_memory: Infinity\n };\n}, getHeapSpaceStatistics = function() {\n notimpl(\"getHeapSpaceStatistics\");\n}, getHeapCodeStatistics = function() {\n notimpl(\"getHeapCodeStatistics\");\n}, setFlagsFromString = function() {\n notimpl(\"setFlagsFromString\");\n}, deserialize = function(value) {\n return jsc.deserialize(value);\n}, takeCoverage = function() {\n notimpl(\"takeCoverage\");\n}, stopCoverage = function() {\n notimpl(\"stopCoverage\");\n}, serialize = function(arg1) {\n return jsc.serialize(arg1, { binaryType: \"nodebuffer\" });\n}, writeHeapSnapshot = function() {\n notimpl(\"writeHeapSnapshot\");\n}, setHeapSnapshotNearHeapLimit = function() {\n notimpl(\"setHeapSnapshotNearHeapLimit\");\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), jsc = @requireNativeModule(\"bun:jsc\");\n\nclass Deserializer {\n constructor() {\n notimpl(\"Deserializer\");\n }\n}\n\nclass Serializer {\n constructor() {\n notimpl(\"Serializer\");\n }\n}\n\nclass DefaultDeserializer extends Deserializer {\n constructor() {\n super(...arguments);\n }\n}\n\nclass DefaultSerializer extends Serializer {\n constructor() {\n super(...arguments);\n }\n}\n\nclass GCProfiler {\n constructor() {\n notimpl(\"GCProfiler\");\n }\n}\nvar promiseHooks = {\n createHook: () => {\n notimpl(\"createHook\");\n },\n onInit: () => {\n notimpl(\"onInit\");\n },\n onBefore: () => {\n notimpl(\"onBefore\");\n },\n onAfter: () => {\n notimpl(\"onAfter\");\n },\n onSettled: () => {\n notimpl(\"onSettled\");\n }\n}, startupSnapshot = {\n addDeserializeCallback: () => notimpl(\"addDeserializeCallback\"),\n addSerializeCallback: () => notimpl(\"addSerializeCallback\"),\n setDeserializeMainFunction: () => notimpl(\"setDeserializeMainFunction\"),\n isBuildingSnapshot: () => notimpl(\"isBuildingSnapshot\")\n};\n$ = {\n cachedDataVersionTag,\n getHeapSnapshot,\n getHeapStatistics,\n getHeapSpaceStatistics,\n getHeapCodeStatistics,\n setFlagsFromString,\n deserialize,\n takeCoverage,\n stopCoverage,\n serialize,\n writeHeapSnapshot,\n setHeapSnapshotNearHeapLimit,\n promiseHooks,\n startupSnapshot,\n Deserializer,\n Serializer\n};\nhideFromStack(notimpl, cachedDataVersionTag, getHeapSnapshot, getHeapStatistics, getHeapSpaceStatistics, getHeapCodeStatistics, setFlagsFromString, deserialize, takeCoverage, stopCoverage, serialize, writeHeapSnapshot, setHeapSnapshotNearHeapLimit, Deserializer, Serializer, DefaultDeserializer, DefaultSerializer, GCProfiler);\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeUrlCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/url.ts\nvar Url = function() {\n this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;\n}, urlParse = function(url, parseQueryString, slashesDenoteHost) {\n if (url && typeof url === \"object\" && url instanceof Url)\n return url;\n var u = new Url;\n return u.parse(url, parseQueryString, slashesDenoteHost), u;\n}, urlFormat = function(obj) {\n if (typeof obj === \"string\")\n obj = urlParse(obj);\n if (!(obj instanceof Url))\n return Url.prototype.format.@call(obj);\n return obj.format();\n}, urlResolve = function(source, relative) {\n return urlParse(source, !1, !0).resolve(relative);\n}, urlResolveObject = function(source, relative) {\n if (!source)\n return relative;\n return urlParse(source, !1, !0).resolveObject(relative);\n}, urlToHttpOptions = function(url) {\n const options = {\n protocol: url.protocol,\n hostname: typeof url.hostname === \"string\" && url.hostname.startsWith(\"[\") \? url.hostname.slice(1, -1) : url.hostname,\n hash: url.hash,\n search: url.search,\n pathname: url.pathname,\n path: `${url.pathname || \"\"}${url.search || \"\"}`,\n href: url.href\n };\n if (url.port !== \"\")\n options.port = Number(url.port);\n if (url.username || url.password)\n options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;\n return options;\n}, $, { URL, URLSearchParams } = globalThis;\nUrl.prototype = {};\nvar protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, simplePathPattern = /^(\\/\\/\?(\?!\\/)[^\?\\s]*)(\\\?[^\\s]*)\?$/, delims = [\"<\", \">\", '\"', \"`\", \" \", \"\\r\", \"\\n\", \"\\t\"], unwise = [\"{\", \"}\", \"|\", \"\\\\\", \"^\", \"`\"].concat(delims), autoEscape = [\"'\"].concat(unwise), nonHostChars = [\"%\", \"/\", \"\?\", \";\", \"#\"].concat(autoEscape), hostEndingChars = [\"/\", \"\?\", \"#\"], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, unsafeProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, hostlessProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, slashedProtocol = {\n http: !0,\n https: !0,\n ftp: !0,\n gopher: !0,\n file: !0,\n \"http:\": !0,\n \"https:\": !0,\n \"ftp:\": !0,\n \"gopher:\": !0,\n \"file:\": !0\n};\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (typeof url !== \"string\")\n @throwTypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n var queryIndex = url.indexOf(\"\?\"), splitter = queryIndex !== -1 && queryIndex < url.indexOf(\"#\") \? \"\?\" : \"#\", uSplit = url.split(splitter), slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, \"/\"), url = uSplit.join(splitter);\n var rest = url;\n if (rest = rest.trim(), !slashesDenoteHost && url.split(\"#\").length === 1) {\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n if (this.path = rest, this.href = rest, this.pathname = simplePath[1], simplePath[2])\n if (this.search = simplePath[2], parseQueryString)\n this.query = new URLSearchParams(this.search.substr(1)).toJSON();\n else\n this.query = this.search.substr(1);\n else if (parseQueryString)\n this.search = \"\", this.query = {};\n return this;\n }\n }\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto, rest = rest.substr(proto.length);\n }\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@/]+@[^@/]+/)) {\n var slashes = rest.substr(0, 2) === \"//\";\n if (slashes && !(proto && hostlessProtocol[proto]))\n rest = rest.substr(2), this.slashes = !0;\n }\n if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {\n var hostEnd = -1;\n for (var i = 0;i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n var auth, atSign;\n if (hostEnd === -1)\n atSign = rest.lastIndexOf(\"@\");\n else\n atSign = rest.lastIndexOf(\"@\", hostEnd);\n if (atSign !== -1)\n auth = rest.slice(0, atSign), rest = rest.slice(atSign + 1), this.auth = decodeURIComponent(auth);\n hostEnd = -1;\n for (var i = 0;i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n if (hostEnd === -1)\n hostEnd = rest.length;\n this.host = rest.slice(0, hostEnd), rest = rest.slice(hostEnd), this.parseHost(), this.hostname = this.hostname || \"\";\n var ipv6Hostname = this.hostname[0] === \"[\" && this.hostname[this.hostname.length - 1] === \"]\";\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length;i < l; i++) {\n var part = hostparts[i];\n if (!part)\n continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = \"\";\n for (var j = 0, k = part.length;j < k; j++)\n if (part.charCodeAt(j) > 127)\n newpart += \"x\";\n else\n newpart += part[j];\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i), notHost = hostparts.slice(i + 1), bit = part.match(hostnamePartStart);\n if (bit)\n validParts.push(bit[1]), notHost.unshift(bit[2]);\n if (notHost.length)\n rest = \"/\" + notHost.join(\".\") + rest;\n this.hostname = validParts.join(\".\");\n break;\n }\n }\n }\n }\n if (this.hostname.length > hostnameMaxLen)\n this.hostname = \"\";\n else\n this.hostname = this.hostname.toLowerCase();\n if (!ipv6Hostname)\n this.hostname = new URL(\"http://\" + this.hostname).hostname;\n var p = this.port \? \":\" + this.port : \"\", h = this.hostname || \"\";\n if (this.host = h + p, this.href += this.host, ipv6Hostname) {\n if (this.hostname = this.hostname.substr(1, this.hostname.length - 2), rest[0] !== \"/\")\n rest = \"/\" + rest;\n }\n }\n if (!unsafeProtocol[lowerProto])\n for (var i = 0, l = autoEscape.length;i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae)\n esc = escape(ae);\n rest = rest.split(ae).join(esc);\n }\n var hash = rest.indexOf(\"#\");\n if (hash !== -1)\n this.hash = rest.substr(hash), rest = rest.slice(0, hash);\n var qm = rest.indexOf(\"\?\");\n if (qm !== -1) {\n if (this.search = rest.substr(qm), this.query = rest.substr(qm + 1), parseQueryString) {\n const query = this.query;\n this.query = new URLSearchParams(query).toJSON();\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString)\n this.search = \"\", this.query = {};\n if (rest)\n this.pathname = rest;\n if (slashedProtocol[lowerProto] && this.hostname && !this.pathname)\n this.pathname = \"/\";\n if (this.pathname || this.search) {\n var p = this.pathname || \"\", s = this.search || \"\";\n this.path = p + s;\n }\n return this.href = this.format(), this;\n};\nUrl.prototype.format = function() {\n var auth = this.auth || \"\";\n if (auth)\n auth = encodeURIComponent(auth), auth = auth.replace(/%3A/i, \":\"), auth += \"@\";\n var protocol = this.protocol || \"\", pathname = this.pathname || \"\", hash = this.hash || \"\", host = !1, query = \"\";\n if (this.host)\n host = auth + this.host;\n else if (this.hostname) {\n if (host = auth + (this.hostname.indexOf(\":\") === -1 \? this.hostname : \"[\" + this.hostname + \"]\"), this.port)\n host += \":\" + this.port;\n }\n if (this.query && typeof this.query === \"object\" && Object.keys(this.query).length)\n query = new URLSearchParams(this.query).toString();\n var search = this.search || query && \"\?\" + query || \"\";\n if (protocol && protocol.substr(-1) !== \":\")\n protocol += \":\";\n if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== !1) {\n if (host = \"//\" + (host || \"\"), pathname && pathname.charAt(0) !== \"/\")\n pathname = \"/\" + pathname;\n } else if (!host)\n host = \"\";\n if (hash && hash.charAt(0) !== \"#\")\n hash = \"#\" + hash;\n if (search && search.charAt(0) !== \"\?\")\n search = \"\?\" + search;\n return pathname = pathname.replace(/[\?#]/g, function(match) {\n return encodeURIComponent(match);\n }), search = search.replace(\"#\", \"%23\"), protocol + host + pathname + search + hash;\n};\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, !1, !0)).format();\n};\nUrl.prototype.resolveObject = function(relative) {\n if (typeof relative === \"string\") {\n var rel = new Url;\n rel.parse(relative, !1, !0), relative = rel;\n }\n var result = new Url, tkeys = Object.keys(this);\n for (var tk = 0;tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n if (result.hash = relative.hash, relative.href === \"\")\n return result.href = result.format(), result;\n if (relative.slashes && !relative.protocol) {\n var rkeys = Object.keys(relative);\n for (var rk = 0;rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== \"protocol\")\n result[rkey] = relative[rkey];\n }\n if (slashedProtocol[result.protocol] && result.hostname && !result.pathname)\n result.pathname = \"/\", result.path = result.pathname;\n return result.href = result.format(), result;\n }\n if (relative.protocol && relative.protocol !== result.protocol) {\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0;v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n return result.href = result.format(), result;\n }\n if (result.protocol = relative.protocol, !relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || \"\").split(\"/\");\n while (relPath.length && !(relative.host = relPath.shift()))\n ;\n if (!relative.host)\n relative.host = \"\";\n if (!relative.hostname)\n relative.hostname = \"\";\n if (relPath[0] !== \"\")\n relPath.unshift(\"\");\n if (relPath.length < 2)\n relPath.unshift(\"\");\n result.pathname = relPath.join(\"/\");\n } else\n result.pathname = relative.pathname;\n if (result.search = relative.search, result.query = relative.query, result.host = relative.host || \"\", result.auth = relative.auth, result.hostname = relative.hostname || relative.host, result.port = relative.port, result.pathname || result.search) {\n var p = result.pathname || \"\", s = result.search || \"\";\n result.path = p + s;\n }\n return result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n }\n var isSourceAbs = result.pathname && result.pathname.charAt(0) === \"/\", isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === \"/\", mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split(\"/\") || [], relPath = relative.pathname && relative.pathname.split(\"/\") || [], psychotic = result.protocol && !slashedProtocol[result.protocol];\n if (psychotic) {\n if (result.hostname = \"\", result.port = null, result.host)\n if (srcPath[0] === \"\")\n srcPath[0] = result.host;\n else\n srcPath.unshift(result.host);\n if (result.host = \"\", relative.protocol) {\n if (relative.hostname = null, relative.port = null, relative.host)\n if (relPath[0] === \"\")\n relPath[0] = relative.host;\n else\n relPath.unshift(relative.host);\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === \"\" || srcPath[0] === \"\");\n }\n if (isRelAbs)\n result.host = relative.host || relative.host === \"\" \? relative.host : result.host, result.hostname = relative.hostname || relative.hostname === \"\" \? relative.hostname : result.hostname, result.search = relative.search, result.query = relative.query, srcPath = relPath;\n else if (relPath.length) {\n if (!srcPath)\n srcPath = [];\n srcPath.pop(), srcPath = srcPath.concat(relPath), result.search = relative.search, result.query = relative.query;\n } else if (relative.search != null) {\n if (psychotic) {\n result.host = srcPath.shift(), result.hostname = result.host;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (result.search = relative.search, result.query = relative.query, result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.href = result.format(), result;\n }\n if (!srcPath.length) {\n if (result.pathname = null, result.search)\n result.path = \"/\" + result.search;\n else\n result.path = null;\n return result.href = result.format(), result;\n }\n var last = srcPath.slice(-1)[0], hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === \".\" || last === \"..\") || last === \"\", up = 0;\n for (var i = srcPath.length;i >= 0; i--)\n if (last = srcPath[i], last === \".\")\n srcPath.splice(i, 1);\n else if (last === \"..\")\n srcPath.splice(i, 1), up++;\n else if (up)\n srcPath.splice(i, 1), up--;\n if (!mustEndAbs && !removeAllDots)\n for (;up--; up)\n srcPath.unshift(\"..\");\n if (mustEndAbs && srcPath[0] !== \"\" && (!srcPath[0] || srcPath[0].charAt(0) !== \"/\"))\n srcPath.unshift(\"\");\n if (hasTrailingSlash && srcPath.join(\"/\").substr(-1) !== \"/\")\n srcPath.push(\"\");\n var isAbsolute = srcPath[0] === \"\" || srcPath[0] && srcPath[0].charAt(0) === \"/\";\n if (psychotic) {\n result.hostname = isAbsolute \? \"\" : srcPath.length \? srcPath.shift() : \"\", result.host = result.hostname;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (mustEndAbs = mustEndAbs || result.host && srcPath.length, mustEndAbs && !isAbsolute)\n srcPath.unshift(\"\");\n if (srcPath.length > 0)\n result.pathname = srcPath.join(\"/\");\n else\n result.pathname = null, result.path = null;\n if (result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.auth = relative.auth || result.auth, result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n};\nUrl.prototype.parseHost = function() {\n var host = this.host, port = portPattern.exec(host);\n if (port) {\n if (port = port[0], port !== \":\")\n this.port = port.substr(1);\n host = host.substr(0, host.length - port.length);\n }\n if (host)\n this.hostname = host;\n};\nvar pathToFileURL = @lazy(\"pathToFileURL\"), fileURLToPath = @lazy(\"fileURLToPath\");\n$ = {\n parse: urlParse,\n resolve: urlResolve,\n resolveObject: urlResolveObject,\n format: urlFormat,\n Url,\n URLSearchParams,\n URL,\n pathToFileURL,\n fileURLToPath,\n urlToHttpOptions\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeVMCode = "(function (){\"use strict\";// src/js/out/tmp/node/vm.ts\nvar runInContext = function(code, context, options) {\n return new Script(code, options).runInContext(context);\n}, compileFunction = function() {\n throwNotImplemented(\"node:vm compileFunction\");\n}, measureMemory = function() {\n throwNotImplemented(\"node:vm measureMemory\");\n}, $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), vm = globalThis[globalThis.Symbol.for('Bun.lazy')](\"vm\"), { createContext, isContext, Script, runInNewContext, runInThisContext } = vm;\n\nclass Module {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n\nclass SourceTextModule {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n\nclass SyntheticModule {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n$ = {\n createContext,\n runInContext,\n runInNewContext,\n runInThisContext,\n isContext,\n compileFunction,\n measureMemory,\n Script,\n Module,\n SourceTextModule,\n SyntheticModule\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeUtilCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/util.ts\nvar isBuffer = function(value) {\n return @Buffer.isBuffer(value);\n}, isFunction = function(value) {\n return typeof value === \"function\";\n}, deprecate = function(fn, msg, code) {\n if (process.noDeprecation === !0)\n return fn;\n var warned = !1;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n var err = new Error(msg);\n if (code)\n err.code = code;\n throw err;\n } else if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n warned = !0;\n }\n return fn.@apply(this, arguments);\n }\n return deprecated;\n}, debuglog = function(set) {\n if (set = set.toUpperCase(), !debugs[set])\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = format.@apply(cjs_exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else\n debugs[set] = function() {\n };\n return debugs[set];\n}, isBoolean = function(arg) {\n return typeof arg === \"boolean\";\n}, isNull = function(arg) {\n return arg === null;\n}, isNullOrUndefined = function(arg) {\n return arg == null;\n}, isNumber = function(arg) {\n return typeof arg === \"number\";\n}, isString = function(arg) {\n return typeof arg === \"string\";\n}, isSymbol = function(arg) {\n return typeof arg === \"symbol\";\n}, isUndefined = function(arg) {\n return arg === void 0;\n}, isObject = function(arg) {\n return typeof arg === \"object\" && arg !== null;\n}, isPrimitive = function(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || typeof arg === \"undefined\";\n}, pad = function(n) {\n return n < 10 \? \"0\" + n.toString(10) : n.toString(10);\n}, timestamp = function() {\n var d = new Date, time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(\":\");\n return [d.getDate(), months[d.getMonth()], time].join(\" \");\n}, callbackifyOnRejected = function(reason, cb) {\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason, newReason.code = \"ERR_FALSY_VALUE_REJECTION\", reason = newReason;\n }\n return cb(reason);\n}, callbackify = function(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n function callbackified() {\n var args = @Array.prototype.slice.@call(arguments), maybeCb = args.pop();\n if (typeof maybeCb !== \"function\")\n @throwTypeError(\"The last argument must be of type Function\");\n var self = this, cb = function() {\n return maybeCb.@apply(self, arguments);\n };\n original.@apply(this, args).then(function(ret) {\n process.nextTick(cb, null, ret);\n }, function(rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }\n return Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)), Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)), callbackified;\n}, $, types = @requireNativeModule(\"util/types\"), utl = @getInternalField(@internalModuleRegistry, 7) || @createInternalModuleById(7), cjs_exports = {}, deepEquals = Bun.deepEquals, isDeepStrictEqual = (a, b) => deepEquals(a, b, !0), getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors, inspect = utl.inspect, formatWithOptions = utl.formatWithOptions, format = utl.format, stripVTControlCharacters = utl.stripVTControlCharacters, debugs = {}, debugEnvRegex = /^$/;\nif (process.env.NODE_DEBUG)\n debugEnv = process.env.NODE_DEBUG, debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+\?.]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/,/g, \"$|^\").toUpperCase(), debugEnvRegex = new @RegExp(\"^\" + debugEnv + \"$\", \"i\");\nvar debugEnv, isRegExp = types.isRegExp, isDate = types.isDate, isError = types.isNativeError, months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], log = function log2() {\n console.log(\"%s - %s\", timestamp(), format.@apply(cjs_exports, arguments));\n}, inherits = function inherits2(ctor, superCtor) {\n ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n });\n}, _extend = function(origin, add) {\n if (!add || !isObject(add))\n return origin;\n var keys = Object.keys(add), i = keys.length;\n while (i--)\n origin[keys[i]] = add[keys[i]];\n return origin;\n}, kCustomPromisifiedSymbol = Symbol.for(\"util.promisify.custom\"), promisify = function promisify2(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\")\n @throwTypeError('The \"util.promisify.custom\" argument must be of type Function');\n return Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n }), fn;\n }\n function fn() {\n var promiseResolve, promiseReject, promise = new @Promise(function(resolve, reject) {\n promiseResolve = resolve, promiseReject = reject;\n }), args = [];\n for (var i = 0;i < arguments.length; i++)\n args.push(arguments[i]);\n args.push(function(err, value) {\n if (err)\n promiseReject(err);\n else\n promiseResolve(value);\n });\n try {\n original.@apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n if (Object.setPrototypeOf(fn, Object.getPrototypeOf(original)), kCustomPromisifiedSymbol)\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n return Object.defineProperties(fn, getOwnPropertyDescriptors(original));\n};\npromisify.custom = kCustomPromisifiedSymbol;\nvar toUSVString = (input) => {\n return (input + \"\").toWellFormed();\n};\n$ = Object.assign(cjs_exports, {\n format,\n formatWithOptions,\n stripVTControlCharacters,\n deprecate,\n debuglog,\n _extend,\n inspect,\n types,\n isArray: @isArray,\n isBoolean,\n isNull,\n isNullOrUndefined,\n isNumber,\n isString,\n isSymbol,\n isUndefined,\n isRegExp,\n isObject,\n isDate,\n isFunction,\n isError,\n isPrimitive,\n isBuffer,\n log,\n inherits,\n toUSVString,\n promisify,\n callbackify,\n isDeepStrictEqual,\n TextDecoder,\n TextEncoder\n});\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeWasiCode = "(function (){\"use strict\";// src/js/out/tmp/node/wasi.ts\nvar nodeFsConstants = @processBindingConstants.fs, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_types = __commonJS({\n \"node_modules/wasi-js/dist/types.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASIKillError = exports.WASIExitError = exports.WASIError = void 0;\n var WASIError = class extends Error {\n constructor(errno) {\n super();\n this.errno = errno, Object.setPrototypeOf(this, WASIError.prototype);\n }\n };\n exports.WASIError = WASIError;\n var WASIExitError = class extends Error {\n constructor(code) {\n super(`WASI Exit error: ${code}`);\n this.code = code, Object.setPrototypeOf(this, WASIExitError.prototype);\n }\n };\n exports.WASIExitError = WASIExitError;\n var WASIKillError = class extends Error {\n constructor(signal) {\n super(`WASI Kill signal: ${signal}`);\n this.signal = signal, Object.setPrototypeOf(this, WASIKillError.prototype);\n }\n };\n exports.WASIKillError = WASIKillError;\n }\n}), require_constants = __commonJS({\n \"node_modules/wasi-js/dist/constants.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASI_ENOMSG = exports.WASI_ENOMEM = exports.WASI_ENOLINK = exports.WASI_ENOLCK = exports.WASI_ENOEXEC = exports.WASI_ENOENT = exports.WASI_ENODEV = exports.WASI_ENOBUFS = exports.WASI_ENFILE = exports.WASI_ENETUNREACH = exports.WASI_ENETRESET = exports.WASI_ENETDOWN = exports.WASI_ENAMETOOLONG = exports.WASI_EMULTIHOP = exports.WASI_EMSGSIZE = exports.WASI_EMLINK = exports.WASI_EMFILE = exports.WASI_ELOOP = exports.WASI_EISDIR = exports.WASI_EISCONN = exports.WASI_EIO = exports.WASI_EINVAL = exports.WASI_EINTR = exports.WASI_EINPROGRESS = exports.WASI_EILSEQ = exports.WASI_EIDRM = exports.WASI_EHOSTUNREACH = exports.WASI_EFBIG = exports.WASI_EFAULT = exports.WASI_EEXIST = exports.WASI_EDQUOT = exports.WASI_EDOM = exports.WASI_EDESTADDRREQ = exports.WASI_EDEADLK = exports.WASI_ECONNRESET = exports.WASI_ECONNREFUSED = exports.WASI_ECONNABORTED = exports.WASI_ECHILD = exports.WASI_ECANCELED = exports.WASI_EBUSY = exports.WASI_EBADMSG = exports.WASI_EBADF = exports.WASI_EALREADY = exports.WASI_EAGAIN = exports.WASI_EAFNOSUPPORT = exports.WASI_EADDRNOTAVAIL = exports.WASI_EADDRINUSE = exports.WASI_EACCES = exports.WASI_E2BIG = exports.WASI_ESUCCESS = void 0, exports.WASI_SIGVTALRM = exports.WASI_SIGUSR2 = exports.WASI_SIGUSR1 = exports.WASI_SIGURG = exports.WASI_SIGTTOU = exports.WASI_SIGTTIN = exports.WASI_SIGTSTP = exports.WASI_SIGTRAP = exports.WASI_SIGTERM = exports.WASI_SIGSTOP = exports.WASI_SIGSEGV = exports.WASI_SIGQUIT = exports.WASI_SIGPIPE = exports.WASI_SIGKILL = exports.WASI_SIGINT = exports.WASI_SIGILL = exports.WASI_SIGHUP = exports.WASI_SIGFPE = exports.WASI_SIGCONT = exports.WASI_SIGCHLD = exports.WASI_SIGBUS = exports.WASI_SIGALRM = exports.WASI_SIGABRT = exports.WASI_ENOTCAPABLE = exports.WASI_EXDEV = exports.WASI_ETXTBSY = exports.WASI_ETIMEDOUT = exports.WASI_ESTALE = exports.WASI_ESRCH = exports.WASI_ESPIPE = exports.WASI_EROFS = exports.WASI_ERANGE = exports.WASI_EPROTOTYPE = exports.WASI_EPROTONOSUPPORT = exports.WASI_EPROTO = exports.WASI_EPIPE = exports.WASI_EPERM = exports.WASI_EOWNERDEAD = exports.WASI_EOVERFLOW = exports.WASI_ENXIO = exports.WASI_ENOTTY = exports.WASI_ENOTSUP = exports.WASI_ENOTSOCK = exports.WASI_ENOTRECOVERABLE = exports.WASI_ENOTEMPTY = exports.WASI_ENOTDIR = exports.WASI_ENOTCONN = exports.WASI_ENOSYS = exports.WASI_ENOSPC = exports.WASI_ENOPROTOOPT = void 0, exports.RIGHTS_REGULAR_FILE_BASE = exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL = exports.WASI_RIGHT_SOCK_SHUTDOWN = exports.WASI_RIGHT_POLL_FD_READWRITE = exports.WASI_RIGHT_PATH_UNLINK_FILE = exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = exports.WASI_RIGHT_PATH_SYMLINK = exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = exports.WASI_RIGHT_FD_FILESTAT_GET = exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = exports.WASI_RIGHT_PATH_FILESTAT_GET = exports.WASI_RIGHT_PATH_RENAME_TARGET = exports.WASI_RIGHT_PATH_RENAME_SOURCE = exports.WASI_RIGHT_PATH_READLINK = exports.WASI_RIGHT_FD_READDIR = exports.WASI_RIGHT_PATH_OPEN = exports.WASI_RIGHT_PATH_LINK_TARGET = exports.WASI_RIGHT_PATH_LINK_SOURCE = exports.WASI_RIGHT_PATH_CREATE_FILE = exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = exports.WASI_RIGHT_FD_ALLOCATE = exports.WASI_RIGHT_FD_ADVISE = exports.WASI_RIGHT_FD_WRITE = exports.WASI_RIGHT_FD_TELL = exports.WASI_RIGHT_FD_SYNC = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = exports.WASI_RIGHT_FD_SEEK = exports.WASI_RIGHT_FD_READ = exports.WASI_RIGHT_FD_DATASYNC = exports.WASI_FDFLAG_SYNC = exports.WASI_FDFLAG_RSYNC = exports.WASI_FDFLAG_NONBLOCK = exports.WASI_FDFLAG_DSYNC = exports.WASI_FDFLAG_APPEND = exports.WASI_FILETYPE_SYMBOLIC_LINK = exports.WASI_FILETYPE_SOCKET_STREAM = exports.WASI_FILETYPE_SOCKET_DGRAM = exports.WASI_FILETYPE_REGULAR_FILE = exports.WASI_FILETYPE_DIRECTORY = exports.WASI_FILETYPE_CHARACTER_DEVICE = exports.WASI_FILETYPE_BLOCK_DEVICE = exports.WASI_FILETYPE_UNKNOWN = exports.WASI_SIGXFSZ = exports.WASI_SIGXCPU = void 0, exports.SIGNAL_MAP = exports.ERROR_MAP = exports.WASI_WHENCE_END = exports.WASI_WHENCE_CUR = exports.WASI_WHENCE_SET = exports.WASI_STDERR_FILENO = exports.WASI_STDOUT_FILENO = exports.WASI_STDIN_FILENO = exports.WASI_DIRCOOKIE_START = exports.WASI_PREOPENTYPE_DIR = exports.WASI_O_TRUNC = exports.WASI_O_EXCL = exports.WASI_O_DIRECTORY = exports.WASI_O_CREAT = exports.WASI_FILESTAT_SET_MTIM_NOW = exports.WASI_FILESTAT_SET_MTIM = exports.WASI_FILESTAT_SET_ATIM_NOW = exports.WASI_FILESTAT_SET_ATIM = exports.WASI_EVENTTYPE_FD_WRITE = exports.WASI_EVENTTYPE_FD_READ = exports.WASI_EVENTTYPE_CLOCK = exports.WASI_CLOCK_THREAD_CPUTIME_ID = exports.WASI_CLOCK_PROCESS_CPUTIME_ID = exports.WASI_CLOCK_MONOTONIC = exports.WASI_CLOCK_REALTIME = exports.RIGHTS_TTY_INHERITING = exports.RIGHTS_TTY_BASE = exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_SOCKET_BASE = exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE = exports.RIGHTS_REGULAR_FILE_INHERITING = void 0, exports.WASI_ESUCCESS = 0, exports.WASI_E2BIG = 1, exports.WASI_EACCES = 2, exports.WASI_EADDRINUSE = 3, exports.WASI_EADDRNOTAVAIL = 4, exports.WASI_EAFNOSUPPORT = 5, exports.WASI_EAGAIN = 6, exports.WASI_EALREADY = 7, exports.WASI_EBADF = 8, exports.WASI_EBADMSG = 9, exports.WASI_EBUSY = 10, exports.WASI_ECANCELED = 11, exports.WASI_ECHILD = 12, exports.WASI_ECONNABORTED = 13, exports.WASI_ECONNREFUSED = 14, exports.WASI_ECONNRESET = 15, exports.WASI_EDEADLK = 16, exports.WASI_EDESTADDRREQ = 17, exports.WASI_EDOM = 18, exports.WASI_EDQUOT = 19, exports.WASI_EEXIST = 20, exports.WASI_EFAULT = 21, exports.WASI_EFBIG = 22, exports.WASI_EHOSTUNREACH = 23, exports.WASI_EIDRM = 24, exports.WASI_EILSEQ = 25, exports.WASI_EINPROGRESS = 26, exports.WASI_EINTR = 27, exports.WASI_EINVAL = 28, exports.WASI_EIO = 29, exports.WASI_EISCONN = 30, exports.WASI_EISDIR = 31, exports.WASI_ELOOP = 32, exports.WASI_EMFILE = 33, exports.WASI_EMLINK = 34, exports.WASI_EMSGSIZE = 35, exports.WASI_EMULTIHOP = 36, exports.WASI_ENAMETOOLONG = 37, exports.WASI_ENETDOWN = 38, exports.WASI_ENETRESET = 39, exports.WASI_ENETUNREACH = 40, exports.WASI_ENFILE = 41, exports.WASI_ENOBUFS = 42, exports.WASI_ENODEV = 43, exports.WASI_ENOENT = 44, exports.WASI_ENOEXEC = 45, exports.WASI_ENOLCK = 46, exports.WASI_ENOLINK = 47, exports.WASI_ENOMEM = 48, exports.WASI_ENOMSG = 49, exports.WASI_ENOPROTOOPT = 50, exports.WASI_ENOSPC = 51, exports.WASI_ENOSYS = 52, exports.WASI_ENOTCONN = 53, exports.WASI_ENOTDIR = 54, exports.WASI_ENOTEMPTY = 55, exports.WASI_ENOTRECOVERABLE = 56, exports.WASI_ENOTSOCK = 57, exports.WASI_ENOTSUP = 58, exports.WASI_ENOTTY = 59, exports.WASI_ENXIO = 60, exports.WASI_EOVERFLOW = 61, exports.WASI_EOWNERDEAD = 62, exports.WASI_EPERM = 63, exports.WASI_EPIPE = 64, exports.WASI_EPROTO = 65, exports.WASI_EPROTONOSUPPORT = 66, exports.WASI_EPROTOTYPE = 67, exports.WASI_ERANGE = 68, exports.WASI_EROFS = 69, exports.WASI_ESPIPE = 70, exports.WASI_ESRCH = 71, exports.WASI_ESTALE = 72, exports.WASI_ETIMEDOUT = 73, exports.WASI_ETXTBSY = 74, exports.WASI_EXDEV = 75, exports.WASI_ENOTCAPABLE = 76, exports.WASI_SIGABRT = 0, exports.WASI_SIGALRM = 1, exports.WASI_SIGBUS = 2, exports.WASI_SIGCHLD = 3, exports.WASI_SIGCONT = 4, exports.WASI_SIGFPE = 5, exports.WASI_SIGHUP = 6, exports.WASI_SIGILL = 7, exports.WASI_SIGINT = 8, exports.WASI_SIGKILL = 9, exports.WASI_SIGPIPE = 10, exports.WASI_SIGQUIT = 11, exports.WASI_SIGSEGV = 12, exports.WASI_SIGSTOP = 13, exports.WASI_SIGTERM = 14, exports.WASI_SIGTRAP = 15, exports.WASI_SIGTSTP = 16, exports.WASI_SIGTTIN = 17, exports.WASI_SIGTTOU = 18, exports.WASI_SIGURG = 19, exports.WASI_SIGUSR1 = 20, exports.WASI_SIGUSR2 = 21, exports.WASI_SIGVTALRM = 22, exports.WASI_SIGXCPU = 23, exports.WASI_SIGXFSZ = 24, exports.WASI_FILETYPE_UNKNOWN = 0, exports.WASI_FILETYPE_BLOCK_DEVICE = 1, exports.WASI_FILETYPE_CHARACTER_DEVICE = 2, exports.WASI_FILETYPE_DIRECTORY = 3, exports.WASI_FILETYPE_REGULAR_FILE = 4, exports.WASI_FILETYPE_SOCKET_DGRAM = 5, exports.WASI_FILETYPE_SOCKET_STREAM = 6, exports.WASI_FILETYPE_SYMBOLIC_LINK = 7, exports.WASI_FDFLAG_APPEND = 1, exports.WASI_FDFLAG_DSYNC = 2, exports.WASI_FDFLAG_NONBLOCK = 4, exports.WASI_FDFLAG_RSYNC = 8, exports.WASI_FDFLAG_SYNC = 16, exports.WASI_RIGHT_FD_DATASYNC = BigInt(1), exports.WASI_RIGHT_FD_READ = BigInt(2), exports.WASI_RIGHT_FD_SEEK = BigInt(4), exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = BigInt(8), exports.WASI_RIGHT_FD_SYNC = BigInt(16), exports.WASI_RIGHT_FD_TELL = BigInt(32), exports.WASI_RIGHT_FD_WRITE = BigInt(64), exports.WASI_RIGHT_FD_ADVISE = BigInt(128), exports.WASI_RIGHT_FD_ALLOCATE = BigInt(256), exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = BigInt(512), exports.WASI_RIGHT_PATH_CREATE_FILE = BigInt(1024), exports.WASI_RIGHT_PATH_LINK_SOURCE = BigInt(2048), exports.WASI_RIGHT_PATH_LINK_TARGET = BigInt(4096), exports.WASI_RIGHT_PATH_OPEN = BigInt(8192), exports.WASI_RIGHT_FD_READDIR = BigInt(16384), exports.WASI_RIGHT_PATH_READLINK = BigInt(32768), exports.WASI_RIGHT_PATH_RENAME_SOURCE = BigInt(65536), exports.WASI_RIGHT_PATH_RENAME_TARGET = BigInt(131072), exports.WASI_RIGHT_PATH_FILESTAT_GET = BigInt(262144), exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = BigInt(524288), exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = BigInt(1048576), exports.WASI_RIGHT_FD_FILESTAT_GET = BigInt(2097152), exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = BigInt(4194304), exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = BigInt(8388608), exports.WASI_RIGHT_PATH_SYMLINK = BigInt(16777216), exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = BigInt(33554432), exports.WASI_RIGHT_PATH_UNLINK_FILE = BigInt(67108864), exports.WASI_RIGHT_POLL_FD_READWRITE = BigInt(134217728), exports.WASI_RIGHT_SOCK_SHUTDOWN = BigInt(268435456), exports.RIGHTS_ALL = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_REGULAR_FILE_BASE = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_REGULAR_FILE_INHERITING = BigInt(0), exports.RIGHTS_DIRECTORY_BASE = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE | exports.RIGHTS_REGULAR_FILE_BASE, exports.RIGHTS_SOCKET_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_TTY_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_TTY_INHERITING = BigInt(0), exports.WASI_CLOCK_REALTIME = 0, exports.WASI_CLOCK_MONOTONIC = 1, exports.WASI_CLOCK_PROCESS_CPUTIME_ID = 2, exports.WASI_CLOCK_THREAD_CPUTIME_ID = 3, exports.WASI_EVENTTYPE_CLOCK = 0, exports.WASI_EVENTTYPE_FD_READ = 1, exports.WASI_EVENTTYPE_FD_WRITE = 2, exports.WASI_FILESTAT_SET_ATIM = 1 << 0, exports.WASI_FILESTAT_SET_ATIM_NOW = 1 << 1, exports.WASI_FILESTAT_SET_MTIM = 1 << 2, exports.WASI_FILESTAT_SET_MTIM_NOW = 1 << 3, exports.WASI_O_CREAT = 1 << 0, exports.WASI_O_DIRECTORY = 1 << 1, exports.WASI_O_EXCL = 1 << 2, exports.WASI_O_TRUNC = 1 << 3, exports.WASI_PREOPENTYPE_DIR = 0, exports.WASI_DIRCOOKIE_START = 0, exports.WASI_STDIN_FILENO = 0, exports.WASI_STDOUT_FILENO = 1, exports.WASI_STDERR_FILENO = 2, exports.WASI_WHENCE_SET = 0, exports.WASI_WHENCE_CUR = 1, exports.WASI_WHENCE_END = 2, exports.ERROR_MAP = {\n E2BIG: exports.WASI_E2BIG,\n EACCES: exports.WASI_EACCES,\n EADDRINUSE: exports.WASI_EADDRINUSE,\n EADDRNOTAVAIL: exports.WASI_EADDRNOTAVAIL,\n EAFNOSUPPORT: exports.WASI_EAFNOSUPPORT,\n EALREADY: exports.WASI_EALREADY,\n EAGAIN: exports.WASI_EAGAIN,\n EBADF: exports.WASI_EBADF,\n EBADMSG: exports.WASI_EBADMSG,\n EBUSY: exports.WASI_EBUSY,\n ECANCELED: exports.WASI_ECANCELED,\n ECHILD: exports.WASI_ECHILD,\n ECONNABORTED: exports.WASI_ECONNABORTED,\n ECONNREFUSED: exports.WASI_ECONNREFUSED,\n ECONNRESET: exports.WASI_ECONNRESET,\n EDEADLOCK: exports.WASI_EDEADLK,\n EDESTADDRREQ: exports.WASI_EDESTADDRREQ,\n EDOM: exports.WASI_EDOM,\n EDQUOT: exports.WASI_EDQUOT,\n EEXIST: exports.WASI_EEXIST,\n EFAULT: exports.WASI_EFAULT,\n EFBIG: exports.WASI_EFBIG,\n EHOSTDOWN: exports.WASI_EHOSTUNREACH,\n EHOSTUNREACH: exports.WASI_EHOSTUNREACH,\n EIDRM: exports.WASI_EIDRM,\n EILSEQ: exports.WASI_EILSEQ,\n EINPROGRESS: exports.WASI_EINPROGRESS,\n EINTR: exports.WASI_EINTR,\n EINVAL: exports.WASI_EINVAL,\n EIO: exports.WASI_EIO,\n EISCONN: exports.WASI_EISCONN,\n EISDIR: exports.WASI_EISDIR,\n ELOOP: exports.WASI_ELOOP,\n EMFILE: exports.WASI_EMFILE,\n EMLINK: exports.WASI_EMLINK,\n EMSGSIZE: exports.WASI_EMSGSIZE,\n EMULTIHOP: exports.WASI_EMULTIHOP,\n ENAMETOOLONG: exports.WASI_ENAMETOOLONG,\n ENETDOWN: exports.WASI_ENETDOWN,\n ENETRESET: exports.WASI_ENETRESET,\n ENETUNREACH: exports.WASI_ENETUNREACH,\n ENFILE: exports.WASI_ENFILE,\n ENOBUFS: exports.WASI_ENOBUFS,\n ENODEV: exports.WASI_ENODEV,\n ENOENT: exports.WASI_ENOENT,\n ENOEXEC: exports.WASI_ENOEXEC,\n ENOLCK: exports.WASI_ENOLCK,\n ENOLINK: exports.WASI_ENOLINK,\n ENOMEM: exports.WASI_ENOMEM,\n ENOMSG: exports.WASI_ENOMSG,\n ENOPROTOOPT: exports.WASI_ENOPROTOOPT,\n ENOSPC: exports.WASI_ENOSPC,\n ENOSYS: exports.WASI_ENOSYS,\n ENOTCONN: exports.WASI_ENOTCONN,\n ENOTDIR: exports.WASI_ENOTDIR,\n ENOTEMPTY: exports.WASI_ENOTEMPTY,\n ENOTRECOVERABLE: exports.WASI_ENOTRECOVERABLE,\n ENOTSOCK: exports.WASI_ENOTSOCK,\n ENOTTY: exports.WASI_ENOTTY,\n ENXIO: exports.WASI_ENXIO,\n EOVERFLOW: exports.WASI_EOVERFLOW,\n EOWNERDEAD: exports.WASI_EOWNERDEAD,\n EPERM: exports.WASI_EPERM,\n EPIPE: exports.WASI_EPIPE,\n EPROTO: exports.WASI_EPROTO,\n EPROTONOSUPPORT: exports.WASI_EPROTONOSUPPORT,\n EPROTOTYPE: exports.WASI_EPROTOTYPE,\n ERANGE: exports.WASI_ERANGE,\n EROFS: exports.WASI_EROFS,\n ESPIPE: exports.WASI_ESPIPE,\n ESRCH: exports.WASI_ESRCH,\n ESTALE: exports.WASI_ESTALE,\n ETIMEDOUT: exports.WASI_ETIMEDOUT,\n ETXTBSY: exports.WASI_ETXTBSY,\n EXDEV: exports.WASI_EXDEV\n }, exports.SIGNAL_MAP = {\n [exports.WASI_SIGHUP]: \"SIGHUP\",\n [exports.WASI_SIGINT]: \"SIGINT\",\n [exports.WASI_SIGQUIT]: \"SIGQUIT\",\n [exports.WASI_SIGILL]: \"SIGILL\",\n [exports.WASI_SIGTRAP]: \"SIGTRAP\",\n [exports.WASI_SIGABRT]: \"SIGABRT\",\n [exports.WASI_SIGBUS]: \"SIGBUS\",\n [exports.WASI_SIGFPE]: \"SIGFPE\",\n [exports.WASI_SIGKILL]: \"SIGKILL\",\n [exports.WASI_SIGUSR1]: \"SIGUSR1\",\n [exports.WASI_SIGSEGV]: \"SIGSEGV\",\n [exports.WASI_SIGUSR2]: \"SIGUSR2\",\n [exports.WASI_SIGPIPE]: \"SIGPIPE\",\n [exports.WASI_SIGALRM]: \"SIGALRM\",\n [exports.WASI_SIGTERM]: \"SIGTERM\",\n [exports.WASI_SIGCHLD]: \"SIGCHLD\",\n [exports.WASI_SIGCONT]: \"SIGCONT\",\n [exports.WASI_SIGSTOP]: \"SIGSTOP\",\n [exports.WASI_SIGTSTP]: \"SIGTSTP\",\n [exports.WASI_SIGTTIN]: \"SIGTTIN\",\n [exports.WASI_SIGTTOU]: \"SIGTTOU\",\n [exports.WASI_SIGURG]: \"SIGURG\",\n [exports.WASI_SIGXCPU]: \"SIGXCPU\",\n [exports.WASI_SIGXFSZ]: \"SIGXFSZ\",\n [exports.WASI_SIGVTALRM]: \"SIGVTALRM\"\n };\n }\n}), require_wasi = __commonJS({\n \"node_modules/wasi-js/dist/wasi.js\"(exports) {\n var __importDefault = exports && exports.__importDefault || function(mod) {\n return mod && mod.__esModule \? mod : { default: mod };\n };\n let fs;\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.SOCKET_DEFAULT_RIGHTS = void 0;\n var log = () => {\n }, logOpen = () => {\n }, SC_OPEN_MAX = 32768, types_1 = require_types(), constants_1 = require_constants(), STDIN_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDOUT_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDERR_DEFAULT_RIGHTS = STDOUT_DEFAULT_RIGHTS;\n exports.SOCKET_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE | constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS;\n var msToNs = (ms) => {\n const msInt = Math.trunc(ms), decimal = BigInt(Math.round((ms - msInt) * 1e6));\n return BigInt(msInt) * BigInt(1e6) + decimal;\n }, nsToMs = (ns) => {\n if (typeof ns === \"number\")\n ns = Math.trunc(ns);\n const nsInt = BigInt(ns);\n return Number(nsInt / BigInt(1e6));\n }, wrap = (f) => (...args) => {\n try {\n return f(...args);\n } catch (err) {\n let e = err;\n while (e.prev != null)\n e = e.prev;\n if (e\?.code && typeof e\?.code === \"string\")\n return constants_1.ERROR_MAP[e.code] || constants_1.WASI_EINVAL;\n if (e instanceof types_1.WASIError)\n return e.errno;\n throw e;\n }\n }, stat = (wasi, fd) => {\n const entry = wasi.FD_MAP.get(fd);\n if (!entry)\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n if (entry.filetype === void 0) {\n const stats = wasi.fstatSync(entry.real), { filetype, rightsBase, rightsInheriting } = translateFileAttributes(wasi, fd, stats);\n if (entry.filetype = filetype, !entry.rights)\n entry.rights = {\n base: rightsBase,\n inheriting: rightsInheriting\n };\n }\n return entry;\n }, translateFileAttributes = (wasi, fd, stats) => {\n switch (!0) {\n case stats.isBlockDevice():\n return {\n filetype: constants_1.WASI_FILETYPE_BLOCK_DEVICE,\n rightsBase: constants_1.RIGHTS_BLOCK_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_BLOCK_DEVICE_INHERITING\n };\n case stats.isCharacterDevice(): {\n const filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n if (fd !== void 0 && wasi.bindings.isTTY(fd))\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_TTY_BASE,\n rightsInheriting: constants_1.RIGHTS_TTY_INHERITING\n };\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_CHARACTER_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_CHARACTER_DEVICE_INHERITING\n };\n }\n case stats.isDirectory():\n return {\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rightsBase: constants_1.RIGHTS_DIRECTORY_BASE,\n rightsInheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n };\n case stats.isFIFO():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isFile():\n return {\n filetype: constants_1.WASI_FILETYPE_REGULAR_FILE,\n rightsBase: constants_1.RIGHTS_REGULAR_FILE_BASE,\n rightsInheriting: constants_1.RIGHTS_REGULAR_FILE_INHERITING\n };\n case stats.isSocket():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isSymbolicLink():\n return {\n filetype: constants_1.WASI_FILETYPE_SYMBOLIC_LINK,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n default:\n return {\n filetype: constants_1.WASI_FILETYPE_UNKNOWN,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n }\n }, warnedAboutSleep = !1, defaultConfig;\n function getDefaults() {\n if (defaultConfig)\n return defaultConfig;\n const defaultBindings = {\n hrtime: () => process.hrtime.bigint(),\n exit: (code) => {\n process.exit(code);\n },\n kill: (signal) => {\n process.kill(process.pid, signal);\n },\n randomFillSync: (array) => crypto.getRandomValues(array),\n isTTY: (fd) => (@getInternalField(@internalModuleRegistry, 44) || @createInternalModuleById(44)).isatty(fd),\n fs: Bun.fs(),\n path: @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28)\n };\n return defaultConfig = {\n args: [],\n env: {},\n preopens: {},\n bindings: defaultBindings,\n sleep: (ms) => {\n Bun.sleepSync(ms);\n }\n };\n }\n var WASI = class WASI2 {\n constructor(wasiConfig = {}) {\n const defaultConfig2 = getDefaults();\n this.lastStdin = 0, this.sleep = wasiConfig.sleep || defaultConfig2.sleep, this.getStdin = wasiConfig.getStdin, this.sendStdout = wasiConfig.sendStdout, this.sendStderr = wasiConfig.sendStderr;\n let preopens = wasiConfig.preopens \?\? defaultConfig2.preopens;\n this.env = wasiConfig.env \?\? defaultConfig2.env;\n const args = wasiConfig.args \?\? defaultConfig2.args;\n this.memory = void 0, this.view = void 0, this.bindings = wasiConfig.bindings || defaultConfig2.bindings;\n const bindings2 = this.bindings;\n fs = bindings2.fs, this.FD_MAP = new Map([\n [\n constants_1.WASI_STDIN_FILENO,\n {\n real: 0,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdin\"\n }\n ],\n [\n constants_1.WASI_STDOUT_FILENO,\n {\n real: 1,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDOUT_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdout\"\n }\n ],\n [\n constants_1.WASI_STDERR_FILENO,\n {\n real: 2,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDERR_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stderr\"\n }\n ]\n ]);\n const path = bindings2.path;\n for (let [k, v] of Object.entries(preopens)) {\n const real = fs.openSync(v, nodeFsConstants.O_RDONLY), newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real,\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rights: {\n base: constants_1.RIGHTS_DIRECTORY_BASE,\n inheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n },\n fakePath: k,\n path: v\n });\n }\n const getiovs = (iovs, iovsLen) => {\n this.refreshMemory();\n const { view, memory } = this, { buffer } = memory, { byteLength } = buffer;\n if (iovsLen === 1) {\n const ptr = iovs, buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n return [new Uint8Array(buffer, buf, bufLen)];\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n const buffers = [];\n buffers.length = iovsLen;\n for (let i = 0, ptr = iovs;i < iovsLen; i++, ptr += 8) {\n const buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n buffers[i] = new Uint8Array(buffer, buf, bufLen);\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n return buffers;\n }, CHECK_FD = (fd, rights) => {\n const stats = stat(this, fd);\n if (rights !== BigInt(0) && (stats.rights.base & rights) === BigInt(0))\n throw new types_1.WASIError(constants_1.WASI_EPERM);\n return stats;\n }, CPUTIME_START = Bun.nanoseconds(), timeOrigin = Math.trunc(performance.timeOrigin * 1e6), now = (clockId) => {\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n return Bun.nanoseconds();\n case constants_1.WASI_CLOCK_REALTIME:\n return Bun.nanoseconds() + timeOrigin;\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID:\n return Bun.nanoseconds() - CPUTIME_START;\n default:\n return null;\n }\n };\n if (this.wasiImport = {\n args_get: (argv, argvBuf) => {\n this.refreshMemory();\n let coffset = argv, offset = argvBuf;\n return args.forEach((a) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${a}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n args_sizes_get: (argc, argvBufSize) => {\n this.refreshMemory(), this.view.setUint32(argc, args.length, !0);\n const size = args.reduce((acc, a) => acc + Buffer.byteLength(a) + 1, 0);\n return this.view.setUint32(argvBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n environ_get: (environ, environBuf) => {\n this.refreshMemory();\n let coffset = environ, offset = environBuf;\n return Object.entries(this.env).forEach(([key, value]) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${key}=${value}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n environ_sizes_get: (environCount, environBufSize) => {\n this.refreshMemory();\n const envProcessed = Object.entries(this.env).map(([key, value]) => `${key}=${value}\\0`), size = envProcessed.reduce((acc, e) => acc + Buffer.byteLength(e), 0);\n return this.view.setUint32(environCount, envProcessed.length, !0), this.view.setUint32(environBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n clock_res_get: (clockId, resolution) => {\n let res;\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID: {\n res = BigInt(1);\n break;\n }\n case constants_1.WASI_CLOCK_REALTIME: {\n res = BigInt(1000);\n break;\n }\n }\n if (!res)\n throw Error(\"invalid clockId\");\n return this.view.setBigUint64(resolution, res), constants_1.WASI_ESUCCESS;\n },\n clock_time_get: (clockId, _precision, time) => {\n this.refreshMemory();\n const n = now(clockId);\n if (n === null)\n return constants_1.WASI_EINVAL;\n return this.view.setBigUint64(time, BigInt(n), !0), constants_1.WASI_ESUCCESS;\n },\n fd_advise: wrap((fd, _offset, _len, _advice) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ADVISE), constants_1.WASI_ENOSYS;\n }),\n fd_allocate: wrap((fd, _offset, _len) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ALLOCATE), constants_1.WASI_ENOSYS;\n }),\n fd_close: wrap((fd) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return fs.closeSync(stats.real), this.FD_MAP.delete(fd), constants_1.WASI_ESUCCESS;\n }),\n fd_datasync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_DATASYNC);\n return fs.fdatasyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if (this.refreshMemory(), stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), this.view.setUint16(bufPtr + 2, 0, !0), this.view.setUint16(bufPtr + 4, 0, !0), this.view.setBigUint64(bufPtr + 8, BigInt(stats.rights.base), !0), this.view.setBigUint64(bufPtr + 8 + 8, BigInt(stats.rights.inheriting), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_set_flags: wrap((fd, flags) => {\n if (CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS), this.wasiImport.sock_fcntlSetFlags(fd, flags) == 0)\n return constants_1.WASI_ESUCCESS;\n return constants_1.WASI_ENOSYS;\n }),\n fd_fdstat_set_rights: wrap((fd, fsRightsBase, fsRightsInheriting) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if ((stats.rights.base | fsRightsBase) > stats.rights.base)\n return constants_1.WASI_EPERM;\n if ((stats.rights.inheriting | fsRightsInheriting) > stats.rights.inheriting)\n return constants_1.WASI_EPERM;\n return stats.rights.base = fsRightsBase, stats.rights.inheriting = fsRightsInheriting, constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_GET), rstats = this.fstatSync(stats.real);\n if (this.refreshMemory(), this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.atimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.mtimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.ctimeMs), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_size: wrap((fd, stSize) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE);\n return fs.ftruncateSync(stats.real, Number(stSize)), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_times: wrap((fd, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_TIMES), rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n return fs.futimesSync(stats.real, new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), this.view.setUint8(bufPtr, constants_1.WASI_PREOPENTYPE_DIR), this.view.setUint32(bufPtr + 4, Buffer.byteLength(stats.fakePath \?\? stats.path \?\? \"\"), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_dir_name: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), Buffer.from(this.memory.buffer).write(stats.fakePath \?\? stats.path \?\? \"\", pathPtr, pathLen, \"utf8\"), constants_1.WASI_ESUCCESS;\n }),\n fd_pwrite: wrap((fd, iovs, iovsLen, offset, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SEEK);\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n let w = 0;\n while (w < iov.byteLength)\n w += fs.writeSync(stats.real, iov, w, iov.byteLength - w, Number(offset) + written + w);\n written += w;\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_write: wrap((fd, iovs, iovsLen, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE), IS_STDOUT = fd == constants_1.WASI_STDOUT_FILENO, IS_STDERR = fd == constants_1.WASI_STDERR_FILENO;\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n if (iov.byteLength == 0)\n return;\n if (IS_STDOUT && this.sendStdout != null)\n this.sendStdout(iov), written += iov.byteLength;\n else if (IS_STDERR && this.sendStderr != null)\n this.sendStderr(iov), written += iov.byteLength;\n else {\n let w = 0;\n while (w < iov.byteLength) {\n const i = fs.writeSync(stats.real, iov, w, iov.byteLength - w, stats.offset \? Number(stats.offset) : null);\n if (stats.offset)\n stats.offset += BigInt(i);\n w += i;\n }\n written += w;\n }\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_pread: wrap((fd, iovs, iovsLen, offset, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SEEK);\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n const length = iov.byteLength - r, rr = fs.readSync(stats.real, iov, r, iov.byteLength - r, Number(offset) + read + r);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n read += r;\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_read: wrap((fd, iovs, iovsLen, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ), IS_STDIN = fd == constants_1.WASI_STDIN_FILENO;\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n let length = iov.byteLength - r, position = IS_STDIN || stats.offset === void 0 \? null : Number(stats.offset), rr = 0;\n if (IS_STDIN)\n if (this.getStdin != null) {\n if (this.stdinBuffer == null)\n this.stdinBuffer = this.getStdin();\n if (this.stdinBuffer != null) {\n if (rr = this.stdinBuffer.copy(iov), rr == this.stdinBuffer.length)\n this.stdinBuffer = void 0;\n else\n this.stdinBuffer = this.stdinBuffer.slice(rr);\n if (rr > 0)\n this.lastStdin = (new Date()).valueOf();\n }\n } else {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(cpu waiting for stdin: please define a way to sleep!) \");\n try {\n rr = fs.readSync(stats.real, iov, r, length, position);\n } catch (_err) {\n }\n if (rr == 0)\n this.shortPause();\n else\n this.lastStdin = (new Date()).valueOf();\n }\n else\n rr = fs.readSync(stats.real, iov, r, length, position);\n if (stats.filetype == constants_1.WASI_FILETYPE_REGULAR_FILE)\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(rr);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_readdir: wrap((fd, bufPtr, bufLen, cookie, bufusedPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READDIR);\n this.refreshMemory();\n const entries = fs.readdirSync(stats.path, { withFileTypes: !0 }), startPtr = bufPtr;\n for (let i = Number(cookie);i < entries.length; i += 1) {\n const entry = entries[i];\n let nameLength = Buffer.byteLength(entry.name);\n if (bufPtr - startPtr > bufLen)\n break;\n if (this.view.setBigUint64(bufPtr, BigInt(i + 1), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n const rstats = fs.lstatSync(path.resolve(stats.path, entry.name));\n if (this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n if (this.view.setUint32(bufPtr, nameLength, !0), bufPtr += 4, bufPtr - startPtr > bufLen)\n break;\n let filetype;\n switch (!0) {\n case rstats.isBlockDevice():\n filetype = constants_1.WASI_FILETYPE_BLOCK_DEVICE;\n break;\n case rstats.isCharacterDevice():\n filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n break;\n case rstats.isDirectory():\n filetype = constants_1.WASI_FILETYPE_DIRECTORY;\n break;\n case rstats.isFIFO():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isFile():\n filetype = constants_1.WASI_FILETYPE_REGULAR_FILE;\n break;\n case rstats.isSocket():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isSymbolicLink():\n filetype = constants_1.WASI_FILETYPE_SYMBOLIC_LINK;\n break;\n default:\n filetype = constants_1.WASI_FILETYPE_UNKNOWN;\n break;\n }\n if (this.view.setUint8(bufPtr, filetype), bufPtr += 1, bufPtr += 3, bufPtr + nameLength >= startPtr + bufLen)\n break;\n Buffer.from(this.memory.buffer).write(entry.name, bufPtr), bufPtr += nameLength;\n }\n const bufused = bufPtr - startPtr;\n return this.view.setUint32(bufusedPtr, Math.min(bufused, bufLen), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_renumber: wrap((from, to) => {\n return CHECK_FD(from, BigInt(0)), CHECK_FD(to, BigInt(0)), fs.closeSync(this.FD_MAP.get(from).real), this.FD_MAP.set(from, this.FD_MAP.get(to)), this.FD_MAP.delete(to), constants_1.WASI_ESUCCESS;\n }),\n fd_seek: wrap((fd, offset, whence, newOffsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SEEK);\n switch (this.refreshMemory(), whence) {\n case constants_1.WASI_WHENCE_CUR:\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_END:\n const { size } = this.fstatSync(stats.real);\n stats.offset = BigInt(size) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_SET:\n stats.offset = BigInt(offset);\n break;\n }\n if (stats.offset == null)\n throw Error(\"stats.offset must be defined\");\n return this.view.setBigUint64(newOffsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_tell: wrap((fd, offsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_TELL);\n if (this.refreshMemory(), !stats.offset)\n stats.offset = BigInt(0);\n return this.view.setBigUint64(offsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_sync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SYNC);\n return fs.fsyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n path_create_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_CREATE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.mkdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_get: wrap((fd, flags, pathPtr, pathLen, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_GET);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n let rstats;\n if (flags)\n rstats = fs.statSync(path.resolve(stats.path, p));\n else\n rstats = fs.lstatSync(path.resolve(stats.path, p));\n return this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, this.view.setUint8(bufPtr, translateFileAttributes(this, void 0, rstats).filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.atime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.mtime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ctime.getTime() * 1e6), !0), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_set_times: wrap((fd, _dirflags, pathPtr, pathLen, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.utimesSync(path.resolve(stats.path, p), new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n path_link: wrap((oldFd, _oldFlags, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_LINK_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_LINK_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.linkSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_open: wrap((dirfd, _dirflags, pathPtr, pathLen, oflags, fsRightsBase, fsRightsInheriting, fsFlags, fdPtr) => {\n try {\n const stats = CHECK_FD(dirfd, constants_1.WASI_RIGHT_PATH_OPEN);\n fsRightsBase = BigInt(fsRightsBase), fsRightsInheriting = BigInt(fsRightsInheriting);\n const read = (fsRightsBase & (constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_READDIR)) !== BigInt(0), write = (fsRightsBase & (constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ALLOCATE | constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE)) !== BigInt(0);\n let noflags;\n if (write && read)\n noflags = nodeFsConstants.O_RDWR;\n else if (read)\n noflags = nodeFsConstants.O_RDONLY;\n else if (write)\n noflags = nodeFsConstants.O_WRONLY;\n let neededBase = fsRightsBase | constants_1.WASI_RIGHT_PATH_OPEN, neededInheriting = fsRightsBase | fsRightsInheriting;\n if ((oflags & constants_1.WASI_O_CREAT) !== 0)\n noflags |= nodeFsConstants.O_CREAT, neededBase |= constants_1.WASI_RIGHT_PATH_CREATE_FILE;\n if ((oflags & constants_1.WASI_O_DIRECTORY) !== 0)\n noflags |= nodeFsConstants.O_DIRECTORY;\n if ((oflags & constants_1.WASI_O_EXCL) !== 0)\n noflags |= nodeFsConstants.O_EXCL;\n if ((oflags & constants_1.WASI_O_TRUNC) !== 0)\n noflags |= nodeFsConstants.O_TRUNC, neededBase |= constants_1.WASI_RIGHT_PATH_FILESTAT_SET_SIZE;\n if ((fsFlags & constants_1.WASI_FDFLAG_APPEND) !== 0)\n noflags |= nodeFsConstants.O_APPEND;\n if ((fsFlags & constants_1.WASI_FDFLAG_DSYNC) !== 0) {\n if (nodeFsConstants.O_DSYNC)\n noflags |= nodeFsConstants.O_DSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_DATASYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_NONBLOCK) !== 0)\n noflags |= nodeFsConstants.O_NONBLOCK;\n if ((fsFlags & constants_1.WASI_FDFLAG_RSYNC) !== 0) {\n if (nodeFsConstants.O_RSYNC)\n noflags |= nodeFsConstants.O_RSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_SYNC) !== 0)\n noflags |= nodeFsConstants.O_SYNC, neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n if (write && (noflags & (nodeFsConstants.O_APPEND | nodeFsConstants.O_TRUNC)) === 0)\n neededInheriting |= constants_1.WASI_RIGHT_FD_SEEK;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n if (p == \"dev/tty\")\n return this.view.setUint32(fdPtr, constants_1.WASI_STDIN_FILENO, !0), constants_1.WASI_ESUCCESS;\n if (logOpen(\"path_open\", p), p.startsWith(\"proc/\"))\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n const fullUnresolved = path.resolve(p);\n let full;\n try {\n full = fs.realpathSync(fullUnresolved);\n } catch (e) {\n if (e\?.code === \"ENOENT\")\n full = fullUnresolved;\n else\n throw e;\n }\n let isDirectory;\n if (write)\n try {\n isDirectory = fs.statSync(full).isDirectory();\n } catch (_err) {\n }\n let realfd;\n if (!write && isDirectory)\n realfd = fs.openSync(full, nodeFsConstants.O_RDONLY);\n else\n realfd = fs.openSync(full, noflags);\n const newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real: realfd,\n filetype: void 0,\n rights: {\n base: neededBase,\n inheriting: neededInheriting\n },\n path: full\n }), stat(this, newfd), this.view.setUint32(fdPtr, newfd, !0);\n } catch (e) {\n console.error(e);\n }\n return constants_1.WASI_ESUCCESS;\n }),\n path_readlink: wrap((fd, pathPtr, pathLen, buf, bufLen, bufused) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_READLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString(), full = path.resolve(stats.path, p), r = fs.readlinkSync(full), used = Buffer.from(this.memory.buffer).write(r, buf, bufLen);\n return this.view.setUint32(bufused, used, !0), constants_1.WASI_ESUCCESS;\n }),\n path_remove_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_REMOVE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.rmdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_rename: wrap((oldFd, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_RENAME_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_RENAME_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.renameSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_symlink: wrap((oldPath, oldPathLen, fd, newPath, newPathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_SYMLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.symlinkSync(op, path.resolve(stats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_unlink_file: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_UNLINK_FILE);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.unlinkSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n poll_oneoff: (sin, sout, nsubscriptions, neventsPtr) => {\n let nevents = 0, name = \"\", waitTimeNs = BigInt(0), fd = -1, fd_type = \"read\", fd_timeout_ms = 0;\n const startNs = BigInt(bindings2.hrtime());\n this.refreshMemory();\n let last_sin = sin;\n for (let i = 0;i < nsubscriptions; i += 1) {\n const userdata = this.view.getBigUint64(sin, !0);\n sin += 8;\n const type = this.view.getUint8(sin);\n if (sin += 1, sin += 7, log.enabled) {\n if (type == constants_1.WASI_EVENTTYPE_CLOCK)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_CLOCK): \";\n else if (type == constants_1.WASI_EVENTTYPE_FD_READ)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_READ): \";\n else\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_WRITE): \";\n log(name);\n }\n switch (type) {\n case constants_1.WASI_EVENTTYPE_CLOCK: {\n const clockid = this.view.getUint32(sin, !0);\n sin += 4, sin += 4;\n const timeout = this.view.getBigUint64(sin, !0);\n sin += 8, sin += 8;\n const subclockflags = this.view.getUint16(sin, !0);\n sin += 2, sin += 6;\n const absolute = subclockflags === 1;\n if (log.enabled)\n log(name, { clockid, timeout, absolute });\n if (!absolute)\n fd_timeout_ms = timeout / BigInt(1e6);\n let e = constants_1.WASI_ESUCCESS;\n const t = now(clockid);\n if (t == null)\n e = constants_1.WASI_EINVAL;\n else {\n const tNS = BigInt(t), waitNs = (absolute \? timeout : tNS + timeout) - tNS;\n if (waitNs > waitTimeNs)\n waitTimeNs = waitNs;\n }\n this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, e, !0), sout += 2, this.view.setUint8(sout, constants_1.WASI_EVENTTYPE_CLOCK), sout += 1, sout += 5, nevents += 1;\n break;\n }\n case constants_1.WASI_EVENTTYPE_FD_READ:\n case constants_1.WASI_EVENTTYPE_FD_WRITE: {\n if (fd = this.view.getUint32(sin, !0), fd_type = type == constants_1.WASI_EVENTTYPE_FD_READ \? \"read\" : \"write\", sin += 4, log(name, \"fd =\", fd), sin += 28, this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, constants_1.WASI_ENOSYS, !0), sout += 2, this.view.setUint8(sout, type), sout += 1, sout += 5, nevents += 1, fd == constants_1.WASI_STDIN_FILENO && constants_1.WASI_EVENTTYPE_FD_READ == type)\n this.shortPause();\n break;\n }\n default:\n return constants_1.WASI_EINVAL;\n }\n if (sin - last_sin != 48)\n console.warn(\"*** BUG in wasi-js in poll_oneoff \", {\n i,\n sin,\n last_sin,\n diff: sin - last_sin\n });\n last_sin = sin;\n }\n if (this.view.setUint32(neventsPtr, nevents, !0), nevents == 2 && fd >= 0) {\n const r = this.wasiImport.sock_pollSocket(fd, fd_type, fd_timeout_ms);\n if (r != constants_1.WASI_ENOSYS)\n return r;\n }\n if (waitTimeNs > 0) {\n if (waitTimeNs -= Bun.nanoseconds() - timeOrigin, waitTimeNs >= 1e6) {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(100% cpu burning waiting for stdin: please define a way to sleep!) \");\n if (this.sleep != null) {\n const ms = nsToMs(waitTimeNs);\n this.sleep(ms);\n } else {\n const end = BigInt(bindings2.hrtime()) + waitTimeNs;\n while (BigInt(bindings2.hrtime()) < end)\n ;\n }\n }\n }\n return constants_1.WASI_ESUCCESS;\n },\n proc_exit: (rval) => {\n return bindings2.exit(rval), constants_1.WASI_ESUCCESS;\n },\n proc_raise: (sig) => {\n if (!(sig in constants_1.SIGNAL_MAP))\n return constants_1.WASI_EINVAL;\n return bindings2.kill(constants_1.SIGNAL_MAP[sig]), constants_1.WASI_ESUCCESS;\n },\n random_get: (bufPtr, bufLen) => {\n return this.refreshMemory(), crypto.getRandomValues(this.memory.buffer, bufPtr, bufLen), bufLen;\n },\n sched_yield() {\n return constants_1.WASI_ESUCCESS;\n },\n sock_recv() {\n return constants_1.WASI_ENOSYS;\n },\n sock_send() {\n return constants_1.WASI_ENOSYS;\n },\n sock_shutdown() {\n return constants_1.WASI_ENOSYS;\n },\n sock_fcntlSetFlags(_fd, _flags) {\n return constants_1.WASI_ENOSYS;\n },\n sock_pollSocket(_fd, _eventtype, _timeout_ms) {\n return constants_1.WASI_ENOSYS;\n }\n }, log.enabled)\n Object.keys(this.wasiImport).forEach((key) => {\n const prevImport = this.wasiImport[key];\n this.wasiImport[key] = function(...args2) {\n log(key, args2);\n try {\n let result = prevImport(...args2);\n return log(\"result\", result), result;\n } catch (e) {\n throw log(\"error: \", e), e;\n }\n };\n });\n }\n getState() {\n return { env: this.env, FD_MAP: this.FD_MAP, bindings };\n }\n setState(state) {\n this.env = state.env, this.FD_MAP = state.FD_MAP, bindings = state.bindings;\n }\n fstatSync(real_fd) {\n if (real_fd <= 2)\n try {\n return fs.fstatSync(real_fd);\n } catch (_) {\n const now = new Date;\n return {\n dev: 0,\n mode: 8592,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n blksize: 65536,\n ino: 0,\n size: 0,\n blocks: 0,\n atimeMs: now.valueOf(),\n mtimeMs: now.valueOf(),\n ctimeMs: now.valueOf(),\n birthtimeMs: 0,\n atime: new Date,\n mtime: new Date,\n ctime: new Date,\n birthtime: new Date(0)\n };\n }\n return fs.fstatSync(real_fd);\n }\n shortPause() {\n if (this.sleep == null)\n return;\n if ((new Date()).valueOf() - this.lastStdin > 2000)\n this.sleep(50);\n }\n getUnusedFileDescriptor(start = 3) {\n let fd = start;\n while (this.FD_MAP.has(fd))\n fd += 1;\n if (fd > SC_OPEN_MAX)\n throw Error(\"no available file descriptors\");\n return fd;\n }\n refreshMemory() {\n if (!this.view || this.view.buffer.byteLength === 0)\n this.view = new DataView(this.memory.buffer);\n }\n setMemory(memory) {\n this.memory = memory;\n }\n start(instance, memory) {\n const exports2 = instance.exports;\n if (exports2 === null || typeof exports2 !== \"object\")\n throw new Error(`instance.exports must be an Object. Received ${exports2}.`);\n if (memory == null) {\n if (memory = exports2.memory, !(memory instanceof WebAssembly.Memory))\n throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${memory}.`);\n }\n if (this.setMemory(memory), exports2._start)\n exports2._start();\n }\n getImports(module2) {\n let namespace = null;\n const imports = WebAssembly.Module.imports(module2);\n for (let imp of imports) {\n if (imp.kind !== \"function\")\n continue;\n if (!imp.module.startsWith(\"wasi_\"))\n continue;\n namespace = imp.module;\n break;\n }\n switch (namespace) {\n case \"wasi_unstable\":\n return {\n wasi_unstable: this.wasiImport\n };\n case \"wasi_snapshot_preview1\":\n return {\n wasi_snapshot_preview1: this.wasiImport\n };\n default:\n throw new Error(\"No WASI namespace found. Only wasi_unstable and wasi_snapshot_preview1 are supported.\\n\\nList of imports:\\n\\n\" + imports.map(({ name, kind, module }) => `${module}:${name} (${kind})`).join(\"\\n\") + \"\\n\");\n }\n }\n initWasiFdInfo() {\n if (this.env.WASI_FD_INFO != null) {\n const fdInfo = JSON.parse(this.env.WASI_FD_INFO);\n for (let wasi_fd in fdInfo) {\n console.log(wasi_fd);\n const fd = parseInt(wasi_fd);\n if (this.FD_MAP.has(fd))\n continue;\n const real = fdInfo[wasi_fd];\n try {\n this.fstatSync(real);\n } catch (_err) {\n console.log(\"discarding \", { wasi_fd, real });\n continue;\n }\n const file = {\n real,\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n }\n };\n this.FD_MAP.set(fd, file);\n }\n console.log(\"after initWasiFdInfo: \", this.FD_MAP), console.log(\"fdInfo = \", fdInfo);\n } else\n console.log(\"no WASI_FD_INFO\");\n }\n };\n exports.default = WASI;\n }\n});\nreturn { WASI: require_wasi().default }})\n"_s;
+static constexpr ASCIILiteral NodeV8Code = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/v8.ts\nvar notimpl = function(message) {\n throwNotImplemented(\"node:v8 \" + message);\n}, cachedDataVersionTag = function() {\n notimpl(\"cachedDataVersionTag\");\n}, getHeapSnapshot = function() {\n notimpl(\"getHeapSnapshot\");\n}, getHeapStatistics = function() {\n const stats = jsc.heapStats();\n return {\n total_heap_size: stats.heapCapacity,\n total_heap_size_executable: 0,\n total_physical_size: stats.heapSize,\n total_available_size: @Infinity,\n used_heap_size: stats.heapSize,\n heap_size_limit: @Infinity,\n malloced_memory: stats.heapSize,\n peak_malloced_memory: @Infinity,\n does_zap_garbage: 0,\n number_of_native_contexts: @Infinity,\n number_of_detached_contexts: @Infinity,\n total_global_handles_size: @Infinity,\n used_global_handles_size: @Infinity,\n external_memory: @Infinity\n };\n}, getHeapSpaceStatistics = function() {\n notimpl(\"getHeapSpaceStatistics\");\n}, getHeapCodeStatistics = function() {\n notimpl(\"getHeapCodeStatistics\");\n}, setFlagsFromString = function() {\n notimpl(\"setFlagsFromString\");\n}, deserialize = function(value) {\n return jsc.deserialize(value);\n}, takeCoverage = function() {\n notimpl(\"takeCoverage\");\n}, stopCoverage = function() {\n notimpl(\"stopCoverage\");\n}, serialize = function(arg1) {\n return jsc.serialize(arg1, { binaryType: \"nodebuffer\" });\n}, writeHeapSnapshot = function() {\n notimpl(\"writeHeapSnapshot\");\n}, setHeapSnapshotNearHeapLimit = function() {\n notimpl(\"setHeapSnapshotNearHeapLimit\");\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), jsc = @requireNativeModule(\"bun:jsc\");\n\nclass Deserializer {\n constructor() {\n notimpl(\"Deserializer\");\n }\n}\n\nclass Serializer {\n constructor() {\n notimpl(\"Serializer\");\n }\n}\n\nclass DefaultDeserializer extends Deserializer {\n constructor() {\n super(...arguments);\n }\n}\n\nclass DefaultSerializer extends Serializer {\n constructor() {\n super(...arguments);\n }\n}\n\nclass GCProfiler {\n constructor() {\n notimpl(\"GCProfiler\");\n }\n}\nvar promiseHooks = {\n createHook: () => {\n notimpl(\"createHook\");\n },\n onInit: () => {\n notimpl(\"onInit\");\n },\n onBefore: () => {\n notimpl(\"onBefore\");\n },\n onAfter: () => {\n notimpl(\"onAfter\");\n },\n onSettled: () => {\n notimpl(\"onSettled\");\n }\n}, startupSnapshot = {\n addDeserializeCallback: () => notimpl(\"addDeserializeCallback\"),\n addSerializeCallback: () => notimpl(\"addSerializeCallback\"),\n setDeserializeMainFunction: () => notimpl(\"setDeserializeMainFunction\"),\n isBuildingSnapshot: () => notimpl(\"isBuildingSnapshot\")\n};\n$ = {\n cachedDataVersionTag,\n getHeapSnapshot,\n getHeapStatistics,\n getHeapSpaceStatistics,\n getHeapCodeStatistics,\n setFlagsFromString,\n deserialize,\n takeCoverage,\n stopCoverage,\n serialize,\n writeHeapSnapshot,\n setHeapSnapshotNearHeapLimit,\n promiseHooks,\n startupSnapshot,\n Deserializer,\n Serializer\n};\nhideFromStack(notimpl, cachedDataVersionTag, getHeapSnapshot, getHeapStatistics, getHeapSpaceStatistics, getHeapCodeStatistics, setFlagsFromString, deserialize, takeCoverage, stopCoverage, serialize, writeHeapSnapshot, setHeapSnapshotNearHeapLimit, Deserializer, Serializer, DefaultDeserializer, DefaultSerializer, GCProfiler);\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeWorkerThreadsCode = "(function (){\"use strict\";// src/js/out/tmp/node/worker_threads.ts\nvar emitWarning = function(type, message) {\n if (emittedWarnings.has(type))\n return;\n emittedWarnings.add(type), console.warn(\"[bun] Warning:\", message);\n}, injectFakeEmitter = function(Class) {\n function messageEventHandler(event) {\n return event.data;\n }\n function errorEventHandler(event) {\n return event.error;\n }\n const wrappedListener = Symbol(\"wrappedListener\");\n function wrapped(run, listener) {\n const callback = function(event) {\n return listener(run(event));\n };\n return listener[wrappedListener] = callback, callback;\n }\n function functionForEventType(event, listener) {\n switch (event) {\n case \"error\":\n case \"messageerror\":\n return wrapped(errorEventHandler, listener);\n default:\n return wrapped(messageEventHandler, listener);\n }\n }\n Class.prototype.on = function(event, listener) {\n return this.addEventListener(event, functionForEventType(event, listener)), this;\n }, Class.prototype.off = function(event, listener) {\n if (listener)\n this.removeEventListener(event, listener[wrappedListener] || listener);\n else\n this.removeEventListener(event);\n return this;\n }, Class.prototype.once = function(event, listener) {\n return this.addEventListener(event, functionForEventType(event, listener), { once: !0 }), this;\n };\n function EventClass(eventName) {\n if (eventName === \"error\" || eventName === \"messageerror\")\n return ErrorEvent;\n return MessageEvent;\n }\n Class.prototype.emit = function(event, ...args) {\n return this.dispatchEvent(new (EventClass(event))(event, ...args)), this;\n }, Class.prototype.prependListener = Class.prototype.on, Class.prototype.prependOnceListener = Class.prototype.once;\n}, receiveMessageOnPort = function(port) {\n let res = _receiveMessageOnPort(port);\n if (!res)\n return;\n return {\n message: res\n };\n}, fakeParentPort = function() {\n const fake = Object.create(MessagePort.prototype);\n return Object.defineProperty(fake, \"onmessage\", {\n get() {\n return self.onmessage;\n },\n set(value) {\n self.onmessage = value;\n }\n }), Object.defineProperty(fake, \"onmessageerror\", {\n get() {\n return self.onmessageerror;\n },\n set(value) {\n }\n }), Object.defineProperty(fake, \"postMessage\", {\n value(...args) {\n return self.postMessage(...args);\n }\n }), Object.defineProperty(fake, \"close\", {\n value() {\n return process.exit(0);\n }\n }), Object.defineProperty(fake, \"start\", {\n value() {\n }\n }), Object.defineProperty(fake, \"unref\", {\n value() {\n }\n }), Object.defineProperty(fake, \"ref\", {\n value() {\n }\n }), Object.defineProperty(fake, \"hasRef\", {\n value() {\n return !1;\n }\n }), Object.defineProperty(fake, \"setEncoding\", {\n value() {\n }\n }), Object.defineProperty(fake, \"addEventListener\", {\n value: self.addEventListener.bind(self)\n }), Object.defineProperty(fake, \"removeEventListener\", {\n value: self.removeEventListener.bind(self)\n }), fake;\n}, getEnvironmentData = function() {\n return process.env;\n}, setEnvironmentData = function(env) {\n process.env = env;\n}, markAsUntransferable = function() {\n throwNotImplemented(\"worker_threads.markAsUntransferable\");\n}, moveMessagePortToContext = function() {\n throwNotImplemented(\"worker_threads.moveMessagePortToContext\");\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), { MessageChannel, BroadcastChannel, Worker: WebWorker } = globalThis, SHARE_ENV = Symbol(\"nodejs.worker_threads.SHARE_ENV\"), isMainThread = Bun.isMainThread, [_workerData, _threadId, _receiveMessageOnPort] = globalThis[globalThis.Symbol.for('Bun.lazy')](\"worker_threads\"), emittedWarnings = new Set, _MessagePort = globalThis.MessagePort;\ninjectFakeEmitter(_MessagePort);\nvar MessagePort = _MessagePort, resourceLimits = {}, workerData = _workerData, threadId = _threadId, parentPort = isMainThread \? null : fakeParentPort(), unsupportedOptions = [\n \"eval\",\n \"argv\",\n \"execArgv\",\n \"stdin\",\n \"stdout\",\n \"stderr\",\n \"trackedUnmanagedFds\",\n \"resourceLimits\"\n];\n\nclass Worker extends EventEmitter {\n #worker;\n #performance;\n #onExitPromise = void 0;\n constructor(filename, options = {}) {\n super();\n for (let key of unsupportedOptions)\n if (key in options)\n emitWarning(\"option.\" + key, `worker_threads.Worker option \"${key}\" is not implemented.`);\n this.#worker = new WebWorker(filename, options), this.#worker.addEventListener(\"close\", this.#onClose.bind(this)), this.#worker.addEventListener(\"error\", this.#onError.bind(this)), this.#worker.addEventListener(\"message\", this.#onMessage.bind(this)), this.#worker.addEventListener(\"messageerror\", this.#onMessageError.bind(this)), this.#worker.addEventListener(\"open\", this.#onOpen.bind(this));\n }\n ref() {\n this.#worker.ref();\n }\n unref() {\n this.#worker.unref();\n }\n get stdin() {\n return null;\n }\n get stdout() {\n return null;\n }\n get stderr() {\n return null;\n }\n get performance() {\n return this.#performance \?\?= {\n eventLoopUtilization() {\n return emitWarning(\"performance\", \"worker_threads.Worker.performance is not implemented.\"), {\n idle: 0,\n active: 0,\n utilization: 0\n };\n }\n };\n }\n terminate() {\n var onExitPromise = this.#onExitPromise;\n if (onExitPromise)\n return @isPromise(onExitPromise) \? onExitPromise : Promise.resolve(onExitPromise);\n const { resolve, promise } = Promise.withResolvers();\n return this.#worker.addEventListener(\"close\", (event) => {\n resolve(event.code);\n }, { once: !0 }), this.#worker.terminate(), this.#onExitPromise = promise;\n }\n postMessage(...args) {\n return this.#worker.postMessage(...args);\n }\n #onClose(e) {\n this.#onExitPromise = e.code, this.emit(\"exit\", e.code);\n }\n #onError(error) {\n this.emit(\"error\", error);\n }\n #onMessage(event) {\n this.emit(\"message\", event.data);\n }\n #onMessageError(event) {\n this.emit(\"messageerror\", event.error \?\? event.data \?\? event);\n }\n #onOpen() {\n this.emit(\"online\");\n }\n async getHeapSnapshot() {\n throwNotImplemented(\"worker_threads.Worker.getHeapSnapshot\");\n }\n}\n$ = {\n Worker,\n workerData,\n parentPort,\n resourceLimits,\n isMainThread,\n MessageChannel,\n BroadcastChannel,\n MessagePort,\n getEnvironmentData,\n setEnvironmentData,\n getHeapSnapshot() {\n return {};\n },\n markAsUntransferable,\n moveMessagePortToContext,\n receiveMessageOnPort,\n SHARE_ENV,\n threadId\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeVMCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/vm.ts\nvar runInContext = function(code, context, options) {\n return new Script(code, options).runInContext(context);\n}, compileFunction = function() {\n throwNotImplemented(\"node:vm compileFunction\");\n}, measureMemory = function() {\n throwNotImplemented(\"node:vm measureMemory\");\n}, $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), vm = @lazy(\"vm\"), { createContext, isContext, Script, runInNewContext, runInThisContext } = vm;\n\nclass Module {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n\nclass SourceTextModule {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n\nclass SyntheticModule {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n$ = {\n createContext,\n runInContext,\n runInNewContext,\n runInThisContext,\n isContext,\n compileFunction,\n measureMemory,\n Script,\n Module,\n SourceTextModule,\n SyntheticModule\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeZlibCode = "(function (){\"use strict\";// src/js/out/tmp/node/zlib.ts\nvar assert = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), BufferModule = @requireNativeModule(\"buffer\"), StreamModule = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), Util = @getInternalField(@internalModuleRegistry, 46) || @createInternalModuleById(46), __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_zstream = __commonJS({\n \"node_modules/pako/lib/zlib/zstream.js\"(exports, module2) {\n function ZStream() {\n this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = \"\", this.state = null, this.data_type = 2, this.adler = 0;\n }\n module2.exports = ZStream;\n }\n}), require_common = __commonJS({\n \"node_modules/pako/lib/utils/common.js\"(exports) {\n var TYPED_OK = typeof Uint8Array !== \"undefined\" && typeof Uint16Array !== \"undefined\" && typeof Int32Array !== \"undefined\";\n function _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n }\n exports.assign = function(obj) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source)\n continue;\n if (typeof source !== \"object\")\n @throwTypeError(source + \"must be non-object\");\n for (var p in source)\n if (_has(source, p))\n obj[p] = source[p];\n }\n return obj;\n }, exports.shrinkBuf = function(buf, size) {\n if (buf.length === size)\n return buf;\n if (buf.subarray)\n return buf.subarray(0, size);\n return buf.length = size, buf;\n };\n var fnTyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n var i, l, len, pos, chunk, result;\n len = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n len += chunks[i].length;\n result = new Uint8Array(len), pos = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n chunk = chunks[i], result.set(chunk, pos), pos += chunk.length;\n return result;\n }\n }, fnUntyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n return [].concat.apply([], chunks);\n }\n };\n exports.setTyped = function(on) {\n if (on)\n exports.Buf8 = Uint8Array, exports.Buf16 = Uint16Array, exports.Buf32 = Int32Array, exports.assign(exports, fnTyped);\n else\n exports.Buf8 = Array, exports.Buf16 = Array, exports.Buf32 = Array, exports.assign(exports, fnUntyped);\n }, exports.setTyped(TYPED_OK);\n }\n}), require_trees = __commonJS({\n \"node_modules/pako/lib/zlib/trees.js\"(exports) {\n var utils = require_common(), Z_FIXED = 4, Z_BINARY = 0, Z_TEXT = 1, Z_UNKNOWN = 2;\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n var STORED_BLOCK = 0, STATIC_TREES = 1, DYN_TREES = 2, MIN_MATCH = 3, MAX_MATCH = 258, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, Buf_size = 16, MAX_BL_BITS = 7, END_BLOCK = 256, REP_3_6 = 16, REPZ_3_10 = 17, REPZ_11_138 = 18, extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], extra_dbits = [\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 4,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 8,\n 8,\n 9,\n 9,\n 10,\n 10,\n 11,\n 11,\n 12,\n 12,\n 13,\n 13\n ], extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], DIST_CODE_LEN = 512, static_ltree = new Array((L_CODES + 2) * 2);\n zero(static_ltree);\n var static_dtree = new Array(D_CODES * 2);\n zero(static_dtree);\n var _dist_code = new Array(DIST_CODE_LEN);\n zero(_dist_code);\n var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\n zero(_length_code);\n var base_length = new Array(LENGTH_CODES);\n zero(base_length);\n var base_dist = new Array(D_CODES);\n zero(base_dist);\n function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree, this.extra_bits = extra_bits, this.extra_base = extra_base, this.elems = elems, this.max_length = max_length, this.has_stree = static_tree && static_tree.length;\n }\n var static_l_desc, static_d_desc, static_bl_desc;\n function TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree, this.max_code = 0, this.stat_desc = stat_desc;\n }\n function d_code(dist) {\n return dist < 256 \? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n }\n function put_short(s, w) {\n s.pending_buf[s.pending++] = w & 255, s.pending_buf[s.pending++] = w >>> 8 & 255;\n }\n function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length)\n s.bi_buf |= value << s.bi_valid & 65535, put_short(s, s.bi_buf), s.bi_buf = value >> Buf_size - s.bi_valid, s.bi_valid += length - Buf_size;\n else\n s.bi_buf |= value << s.bi_valid & 65535, s.bi_valid += length;\n }\n function send_code(s, c, tree) {\n send_bits(s, tree[c * 2], tree[c * 2 + 1]);\n }\n function bi_reverse(code, len) {\n var res = 0;\n do\n res |= code & 1, code >>>= 1, res <<= 1;\n while (--len > 0);\n return res >>> 1;\n }\n function bi_flush(s) {\n if (s.bi_valid === 16)\n put_short(s, s.bi_buf), s.bi_buf = 0, s.bi_valid = 0;\n else if (s.bi_valid >= 8)\n s.pending_buf[s.pending++] = s.bi_buf & 255, s.bi_buf >>= 8, s.bi_valid -= 8;\n }\n function gen_bitlen(s, desc) {\n var { dyn_tree: tree, max_code } = desc, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, extra = desc.stat_desc.extra_bits, base = desc.stat_desc.extra_base, max_length = desc.stat_desc.max_length, h, n, m, bits, xbits, f, overflow = 0;\n for (bits = 0;bits <= MAX_BITS; bits++)\n s.bl_count[bits] = 0;\n tree[s.heap[s.heap_max] * 2 + 1] = 0;\n for (h = s.heap_max + 1;h < HEAP_SIZE; h++) {\n if (n = s.heap[h], bits = tree[tree[n * 2 + 1] * 2 + 1] + 1, bits > max_length)\n bits = max_length, overflow++;\n if (tree[n * 2 + 1] = bits, n > max_code)\n continue;\n if (s.bl_count[bits]++, xbits = 0, n >= base)\n xbits = extra[n - base];\n if (f = tree[n * 2], s.opt_len += f * (bits + xbits), has_stree)\n s.static_len += f * (stree[n * 2 + 1] + xbits);\n }\n if (overflow === 0)\n return;\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0)\n bits--;\n s.bl_count[bits]--, s.bl_count[bits + 1] += 2, s.bl_count[max_length]--, overflow -= 2;\n } while (overflow > 0);\n for (bits = max_length;bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n if (m = s.heap[--h], m > max_code)\n continue;\n if (tree[m * 2 + 1] !== bits)\n s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2], tree[m * 2 + 1] = bits;\n n--;\n }\n }\n }\n function gen_codes(tree, max_code, bl_count) {\n var next_code = new Array(MAX_BITS + 1), code = 0, bits, n;\n for (bits = 1;bits <= MAX_BITS; bits++)\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n for (n = 0;n <= max_code; n++) {\n var len = tree[n * 2 + 1];\n if (len === 0)\n continue;\n tree[n * 2] = bi_reverse(next_code[len]++, len);\n }\n }\n function tr_static_init() {\n var n, bits, length, code, dist, bl_count = new Array(MAX_BITS + 1);\n length = 0;\n for (code = 0;code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0;n < 1 << extra_lbits[code]; n++)\n _length_code[length++] = code;\n }\n _length_code[length - 1] = code, dist = 0;\n for (code = 0;code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0;n < 1 << extra_dbits[code]; n++)\n _dist_code[dist++] = code;\n }\n dist >>= 7;\n for (;code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0;n < 1 << extra_dbits[code] - 7; n++)\n _dist_code[256 + dist++] = code;\n }\n for (bits = 0;bits <= MAX_BITS; bits++)\n bl_count[bits] = 0;\n n = 0;\n while (n <= 143)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n while (n <= 255)\n static_ltree[n * 2 + 1] = 9, n++, bl_count[9]++;\n while (n <= 279)\n static_ltree[n * 2 + 1] = 7, n++, bl_count[7]++;\n while (n <= 287)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n for (n = 0;n < D_CODES; n++)\n static_dtree[n * 2 + 1] = 5, static_dtree[n * 2] = bi_reverse(n, 5);\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS), static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS), static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n }\n function init_block(s) {\n var n;\n for (n = 0;n < L_CODES; n++)\n s.dyn_ltree[n * 2] = 0;\n for (n = 0;n < D_CODES; n++)\n s.dyn_dtree[n * 2] = 0;\n for (n = 0;n < BL_CODES; n++)\n s.bl_tree[n * 2] = 0;\n s.dyn_ltree[END_BLOCK * 2] = 1, s.opt_len = s.static_len = 0, s.last_lit = s.matches = 0;\n }\n function bi_windup(s) {\n if (s.bi_valid > 8)\n put_short(s, s.bi_buf);\n else if (s.bi_valid > 0)\n s.pending_buf[s.pending++] = s.bi_buf;\n s.bi_buf = 0, s.bi_valid = 0;\n }\n function copy_block(s, buf, len, header) {\n if (bi_windup(s), header)\n put_short(s, len), put_short(s, ~len);\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending), s.pending += len;\n }\n function smaller(tree, n, m, depth) {\n var _n2 = n * 2, _m2 = m * 2;\n return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];\n }\n function pqdownheap(s, tree, k) {\n var v = s.heap[k], j = k << 1;\n while (j <= s.heap_len) {\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth))\n j++;\n if (smaller(tree, v, s.heap[j], s.depth))\n break;\n s.heap[k] = s.heap[j], k = j, j <<= 1;\n }\n s.heap[k] = v;\n }\n function compress_block(s, ltree, dtree) {\n var dist, lc, lx = 0, code, extra;\n if (s.last_lit !== 0)\n do\n if (dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1], lc = s.pending_buf[s.l_buf + lx], lx++, dist === 0)\n send_code(s, lc, ltree);\n else {\n if (code = _length_code[lc], send_code(s, code + LITERALS + 1, ltree), extra = extra_lbits[code], extra !== 0)\n lc -= base_length[code], send_bits(s, lc, extra);\n if (dist--, code = d_code(dist), send_code(s, code, dtree), extra = extra_dbits[code], extra !== 0)\n dist -= base_dist[code], send_bits(s, dist, extra);\n }\n while (lx < s.last_lit);\n send_code(s, END_BLOCK, ltree);\n }\n function build_tree(s, desc) {\n var tree = desc.dyn_tree, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, elems = desc.stat_desc.elems, n, m, max_code = -1, node;\n s.heap_len = 0, s.heap_max = HEAP_SIZE;\n for (n = 0;n < elems; n++)\n if (tree[n * 2] !== 0)\n s.heap[++s.heap_len] = max_code = n, s.depth[n] = 0;\n else\n tree[n * 2 + 1] = 0;\n while (s.heap_len < 2)\n if (node = s.heap[++s.heap_len] = max_code < 2 \? ++max_code : 0, tree[node * 2] = 1, s.depth[node] = 0, s.opt_len--, has_stree)\n s.static_len -= stree[node * 2 + 1];\n desc.max_code = max_code;\n for (n = s.heap_len >> 1;n >= 1; n--)\n pqdownheap(s, tree, n);\n node = elems;\n do\n n = s.heap[1], s.heap[1] = s.heap[s.heap_len--], pqdownheap(s, tree, 1), m = s.heap[1], s.heap[--s.heap_max] = n, s.heap[--s.heap_max] = m, tree[node * 2] = tree[n * 2] + tree[m * 2], s.depth[node] = (s.depth[n] >= s.depth[m] \? s.depth[n] : s.depth[m]) + 1, tree[n * 2 + 1] = tree[m * 2 + 1] = node, s.heap[1] = node++, pqdownheap(s, tree, 1);\n while (s.heap_len >= 2);\n s.heap[--s.heap_max] = s.heap[1], gen_bitlen(s, desc), gen_codes(tree, max_code, s.bl_count);\n }\n function scan_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n tree[(max_code + 1) * 2 + 1] = 65535;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n s.bl_tree[curlen * 2] += count;\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n s.bl_tree[curlen * 2]++;\n s.bl_tree[REP_3_6 * 2]++;\n } else if (count <= 10)\n s.bl_tree[REPZ_3_10 * 2]++;\n else\n s.bl_tree[REPZ_11_138 * 2]++;\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function send_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n do\n send_code(s, curlen, s.bl_tree);\n while (--count !== 0);\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n send_code(s, curlen, s.bl_tree), count--;\n send_code(s, REP_3_6, s.bl_tree), send_bits(s, count - 3, 2);\n } else if (count <= 10)\n send_code(s, REPZ_3_10, s.bl_tree), send_bits(s, count - 3, 3);\n else\n send_code(s, REPZ_11_138, s.bl_tree), send_bits(s, count - 11, 7);\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function build_bl_tree(s) {\n var max_blindex;\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code), scan_tree(s, s.dyn_dtree, s.d_desc.max_code), build_tree(s, s.bl_desc);\n for (max_blindex = BL_CODES - 1;max_blindex >= 3; max_blindex--)\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0)\n break;\n return s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4, max_blindex;\n }\n function send_all_trees(s, lcodes, dcodes, blcodes) {\n var rank;\n send_bits(s, lcodes - 257, 5), send_bits(s, dcodes - 1, 5), send_bits(s, blcodes - 4, 4);\n for (rank = 0;rank < blcodes; rank++)\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);\n send_tree(s, s.dyn_ltree, lcodes - 1), send_tree(s, s.dyn_dtree, dcodes - 1);\n }\n function detect_data_type(s) {\n var black_mask = 4093624447, n;\n for (n = 0;n <= 31; n++, black_mask >>>= 1)\n if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0)\n return Z_BINARY;\n if (s.dyn_ltree[18] !== 0 || s.dyn_ltree[20] !== 0 || s.dyn_ltree[26] !== 0)\n return Z_TEXT;\n for (n = 32;n < LITERALS; n++)\n if (s.dyn_ltree[n * 2] !== 0)\n return Z_TEXT;\n return Z_BINARY;\n }\n var static_init_done = !1;\n function _tr_init(s) {\n if (!static_init_done)\n tr_static_init(), static_init_done = !0;\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc), s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc), s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc), s.bi_buf = 0, s.bi_valid = 0, init_block(s);\n }\n function _tr_stored_block(s, buf, stored_len, last) {\n send_bits(s, (STORED_BLOCK << 1) + (last \? 1 : 0), 3), copy_block(s, buf, stored_len, !0);\n }\n function _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3), send_code(s, END_BLOCK, static_ltree), bi_flush(s);\n }\n function _tr_flush_block(s, buf, stored_len, last) {\n var opt_lenb, static_lenb, max_blindex = 0;\n if (s.level > 0) {\n if (s.strm.data_type === Z_UNKNOWN)\n s.strm.data_type = detect_data_type(s);\n if (build_tree(s, s.l_desc), build_tree(s, s.d_desc), max_blindex = build_bl_tree(s), opt_lenb = s.opt_len + 3 + 7 >>> 3, static_lenb = s.static_len + 3 + 7 >>> 3, static_lenb <= opt_lenb)\n opt_lenb = static_lenb;\n } else\n opt_lenb = static_lenb = stored_len + 5;\n if (stored_len + 4 <= opt_lenb && buf !== -1)\n _tr_stored_block(s, buf, stored_len, last);\n else if (s.strategy === Z_FIXED || static_lenb === opt_lenb)\n send_bits(s, (STATIC_TREES << 1) + (last \? 1 : 0), 3), compress_block(s, static_ltree, static_dtree);\n else\n send_bits(s, (DYN_TREES << 1) + (last \? 1 : 0), 3), send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1), compress_block(s, s.dyn_ltree, s.dyn_dtree);\n if (init_block(s), last)\n bi_windup(s);\n }\n function _tr_tally(s, dist, lc) {\n if (s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255, s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255, s.pending_buf[s.l_buf + s.last_lit] = lc & 255, s.last_lit++, dist === 0)\n s.dyn_ltree[lc * 2]++;\n else\n s.matches++, dist--, s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++, s.dyn_dtree[d_code(dist) * 2]++;\n return s.last_lit === s.lit_bufsize - 1;\n }\n exports._tr_init = _tr_init, exports._tr_stored_block = _tr_stored_block, exports._tr_flush_block = _tr_flush_block, exports._tr_tally = _tr_tally, exports._tr_align = _tr_align;\n }\n}), require_adler32 = __commonJS({\n \"node_modules/pako/lib/zlib/adler32.js\"(exports, module2) {\n function adler32(adler, buf, len, pos) {\n var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;\n while (len !== 0) {\n n = len > 2000 \? 2000 : len, len -= n;\n do\n s1 = s1 + buf[pos++] | 0, s2 = s2 + s1 | 0;\n while (--n);\n s1 %= 65521, s2 %= 65521;\n }\n return s1 | s2 << 16 | 0;\n }\n module2.exports = adler32;\n }\n}), require_crc32 = __commonJS({\n \"node_modules/pako/lib/zlib/crc32.js\"(exports, module2) {\n function makeTable() {\n var c, table = [];\n for (var n = 0;n < 256; n++) {\n c = n;\n for (var k = 0;k < 8; k++)\n c = c & 1 \? 3988292384 ^ c >>> 1 : c >>> 1;\n table[n] = c;\n }\n return table;\n }\n var crcTable = makeTable();\n function crc32(crc, buf, len, pos) {\n var t = crcTable, end = pos + len;\n crc ^= -1;\n for (var i = pos;i < end; i++)\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];\n return crc ^ -1;\n }\n module2.exports = crc32;\n }\n}), require_messages = __commonJS({\n \"node_modules/pako/lib/zlib/messages.js\"(exports, module2) {\n module2.exports = {\n 2: \"need dictionary\",\n 1: \"stream end\",\n 0: \"\",\n \"-1\": \"file error\",\n \"-2\": \"stream error\",\n \"-3\": \"data error\",\n \"-4\": \"insufficient memory\",\n \"-5\": \"buffer error\",\n \"-6\": \"incompatible version\"\n };\n }\n}), require_deflate = __commonJS({\n \"node_modules/pako/lib/zlib/deflate.js\"(exports) {\n var utils = require_common(), trees = require_trees(), adler32 = require_adler32(), crc32 = require_crc32(), msg = require_messages(), Z_NO_FLUSH = 0, Z_PARTIAL_FLUSH = 1, Z_FULL_FLUSH = 3, Z_FINISH = 4, Z_BLOCK = 5, Z_OK = 0, Z_STREAM_END = 1, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_BUF_ERROR = -5, Z_DEFAULT_COMPRESSION = -1, Z_FILTERED = 1, Z_HUFFMAN_ONLY = 2, Z_RLE = 3, Z_FIXED = 4, Z_DEFAULT_STRATEGY = 0, Z_UNKNOWN = 2, Z_DEFLATED = 8, MAX_MEM_LEVEL = 9, MAX_WBITS = 15, DEF_MEM_LEVEL = 8, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, MIN_MATCH = 3, MAX_MATCH = 258, MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, PRESET_DICT = 32, INIT_STATE = 42, EXTRA_STATE = 69, NAME_STATE = 73, COMMENT_STATE = 91, HCRC_STATE = 103, BUSY_STATE = 113, FINISH_STATE = 666, BS_NEED_MORE = 1, BS_BLOCK_DONE = 2, BS_FINISH_STARTED = 3, BS_FINISH_DONE = 4, OS_CODE = 3;\n function err(strm, errorCode) {\n return strm.msg = msg[errorCode], errorCode;\n }\n function rank(f) {\n return (f << 1) - (f > 4 \? 9 : 0);\n }\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n function flush_pending(strm) {\n var s = strm.state, len = s.pending;\n if (len > strm.avail_out)\n len = strm.avail_out;\n if (len === 0)\n return;\n if (utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out), strm.next_out += len, s.pending_out += len, strm.total_out += len, strm.avail_out -= len, s.pending -= len, s.pending === 0)\n s.pending_out = 0;\n }\n function flush_block_only(s, last) {\n trees._tr_flush_block(s, s.block_start >= 0 \? s.block_start : -1, s.strstart - s.block_start, last), s.block_start = s.strstart, flush_pending(s.strm);\n }\n function put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n }\n function putShortMSB(s, b) {\n s.pending_buf[s.pending++] = b >>> 8 & 255, s.pending_buf[s.pending++] = b & 255;\n }\n function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n if (len > size)\n len = size;\n if (len === 0)\n return 0;\n if (strm.avail_in -= len, utils.arraySet(buf, strm.input, strm.next_in, len, start), strm.state.wrap === 1)\n strm.adler = adler32(strm.adler, buf, len, start);\n else if (strm.state.wrap === 2)\n strm.adler = crc32(strm.adler, buf, len, start);\n return strm.next_in += len, strm.total_in += len, len;\n }\n function longest_match(s, cur_match) {\n var { max_chain_length: chain_length, strstart: scan } = s, match, len, best_len = s.prev_length, nice_match = s.nice_match, limit = s.strstart > s.w_size - MIN_LOOKAHEAD \? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0, _win = s.window, wmask = s.w_mask, prev = s.prev, strend = s.strstart + MAX_MATCH, scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n if (s.prev_length >= s.good_match)\n chain_length >>= 2;\n if (nice_match > s.lookahead)\n nice_match = s.lookahead;\n do {\n if (match = cur_match, _win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1])\n continue;\n scan += 2, match++;\n do\n ;\n while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);\n if (len = MAX_MATCH - (strend - scan), scan = strend - MAX_MATCH, len > best_len) {\n if (s.match_start = cur_match, best_len = len, len >= nice_match)\n break;\n scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n if (best_len <= s.lookahead)\n return best_len;\n return s.lookahead;\n }\n function fill_window(s) {\n var _w_size = s.w_size, p, n, m, more, str;\n do {\n if (more = s.window_size - s.lookahead - s.strstart, s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0), s.match_start -= _w_size, s.strstart -= _w_size, s.block_start -= _w_size, n = s.hash_size, p = n;\n do\n m = s.head[--p], s.head[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n n = _w_size, p = n;\n do\n m = s.prev[--p], s.prev[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n more += _w_size;\n }\n if (s.strm.avail_in === 0)\n break;\n if (n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more), s.lookahead += n, s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert, s.ins_h = s.window[str], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;\n while (s.insert)\n if (s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++, s.insert--, s.lookahead + s.insert < MIN_MATCH)\n break;\n }\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n }\n function deflate_stored(s, flush) {\n var max_block_size = 65535;\n if (max_block_size > s.pending_buf_size - 5)\n max_block_size = s.pending_buf_size - 5;\n for (;; ) {\n if (s.lookahead <= 1) {\n if (fill_window(s), s.lookahead === 0 && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n s.strstart += s.lookahead, s.lookahead = 0;\n var max_start = s.block_start + max_block_size;\n if (s.strstart === 0 || s.strstart >= max_start) {\n if (s.lookahead = s.strstart - max_start, s.strstart = max_start, flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.strstart > s.block_start) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_NEED_MORE;\n }\n function deflate_fast(s, flush) {\n var hash_head, bflush;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD)\n s.match_length = longest_match(s, hash_head);\n if (s.match_length >= MIN_MATCH)\n if (bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n do\n s.strstart++, s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.match_length !== 0);\n s.strstart++;\n } else\n s.strstart += s.match_length, s.match_length = 0, s.ins_h = s.window[s.strstart], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_slow(s, flush) {\n var hash_head, bflush, max_insert;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (s.prev_length = s.match_length, s.prev_match = s.match_start, s.match_length = MIN_MATCH - 1, hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n if (s.match_length = longest_match(s, hash_head), s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096))\n s.match_length = MIN_MATCH - 1;\n }\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH, bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH), s.lookahead -= s.prev_length - 1, s.prev_length -= 2;\n do\n if (++s.strstart <= max_insert)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.prev_length !== 0);\n if (s.match_available = 0, s.match_length = MIN_MATCH - 1, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n } else if (s.match_available) {\n if (bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), bflush)\n flush_block_only(s, !1);\n if (s.strstart++, s.lookahead--, s.strm.avail_out === 0)\n return BS_NEED_MORE;\n } else\n s.match_available = 1, s.strstart++, s.lookahead--;\n }\n if (s.match_available)\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), s.match_available = 0;\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_rle(s, flush) {\n var bflush, prev, scan, strend, _win = s.window;\n for (;; ) {\n if (s.lookahead <= MAX_MATCH) {\n if (fill_window(s), s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (s.match_length = 0, s.lookahead >= MIN_MATCH && s.strstart > 0) {\n if (scan = s.strstart - 1, prev = _win[scan], prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do\n ;\n while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n if (s.match_length = MAX_MATCH - (strend - scan), s.match_length > s.lookahead)\n s.match_length = s.lookahead;\n }\n }\n if (s.match_length >= MIN_MATCH)\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.strstart += s.match_length, s.match_length = 0;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_huff(s, flush) {\n var bflush;\n for (;; ) {\n if (s.lookahead === 0) {\n if (fill_window(s), s.lookahead === 0) {\n if (flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n break;\n }\n }\n if (s.match_length = 0, bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length, this.max_lazy = max_lazy, this.nice_length = nice_length, this.max_chain = max_chain, this.func = func;\n }\n var configuration_table = [\n new Config(0, 0, 0, 0, deflate_stored),\n new Config(4, 4, 8, 4, deflate_fast),\n new Config(4, 5, 16, 8, deflate_fast),\n new Config(4, 6, 32, 32, deflate_fast),\n new Config(4, 4, 16, 16, deflate_slow),\n new Config(8, 16, 32, 32, deflate_slow),\n new Config(8, 16, 128, 128, deflate_slow),\n new Config(8, 32, 128, 256, deflate_slow),\n new Config(32, 128, 258, 1024, deflate_slow),\n new Config(32, 258, 258, 4096, deflate_slow)\n ];\n function lm_init(s) {\n s.window_size = 2 * s.w_size, zero(s.head), s.max_lazy_match = configuration_table[s.level].max_lazy, s.good_match = configuration_table[s.level].good_length, s.nice_match = configuration_table[s.level].nice_length, s.max_chain_length = configuration_table[s.level].max_chain, s.strstart = 0, s.block_start = 0, s.lookahead = 0, s.insert = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, s.ins_h = 0;\n }\n function DeflateState() {\n this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Z_DEFLATED, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2), this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2), this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2), zero(this.dyn_ltree), zero(this.dyn_dtree), zero(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new utils.Buf16(MAX_BITS + 1), this.heap = new utils.Buf16(2 * L_CODES + 1), zero(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new utils.Buf16(2 * L_CODES + 1), zero(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;\n }\n function deflateResetKeep(strm) {\n var s;\n if (!strm || !strm.state)\n return err(strm, Z_STREAM_ERROR);\n if (strm.total_in = strm.total_out = 0, strm.data_type = Z_UNKNOWN, s = strm.state, s.pending = 0, s.pending_out = 0, s.wrap < 0)\n s.wrap = -s.wrap;\n return s.status = s.wrap \? INIT_STATE : BUSY_STATE, strm.adler = s.wrap === 2 \? 0 : 1, s.last_flush = Z_NO_FLUSH, trees._tr_init(s), Z_OK;\n }\n function deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK)\n lm_init(strm.state);\n return ret;\n }\n function deflateSetHeader(strm, head) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (strm.state.wrap !== 2)\n return Z_STREAM_ERROR;\n return strm.state.gzhead = head, Z_OK;\n }\n function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm)\n return Z_STREAM_ERROR;\n var wrap = 1;\n if (level === Z_DEFAULT_COMPRESSION)\n level = 6;\n if (windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (windowBits > 15)\n wrap = 2, windowBits -= 16;\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED)\n return err(strm, Z_STREAM_ERROR);\n if (windowBits === 8)\n windowBits = 9;\n var s = new DeflateState;\n return strm.state = s, s.strm = strm, s.wrap = wrap, s.gzhead = null, s.w_bits = windowBits, s.w_size = 1 << s.w_bits, s.w_mask = s.w_size - 1, s.hash_bits = memLevel + 7, s.hash_size = 1 << s.hash_bits, s.hash_mask = s.hash_size - 1, s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH), s.window = new utils.Buf8(s.w_size * 2), s.head = new utils.Buf16(s.hash_size), s.prev = new utils.Buf16(s.w_size), s.lit_bufsize = 1 << memLevel + 6, s.pending_buf_size = s.lit_bufsize * 4, s.pending_buf = new utils.Buf8(s.pending_buf_size), s.d_buf = 1 * s.lit_bufsize, s.l_buf = 3 * s.lit_bufsize, s.level = level, s.strategy = strategy, s.method = method, deflateReset(strm);\n }\n function deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n }\n function deflate(strm, flush) {\n var old_flush, s, beg, val;\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0)\n return strm \? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n if (s = strm.state, !strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH)\n return err(strm, strm.avail_out === 0 \? Z_BUF_ERROR : Z_STREAM_ERROR);\n if (s.strm = strm, old_flush = s.last_flush, s.last_flush = flush, s.status === INIT_STATE)\n if (s.wrap === 2)\n if (strm.adler = 0, put_byte(s, 31), put_byte(s, 139), put_byte(s, 8), !s.gzhead)\n put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, OS_CODE), s.status = BUSY_STATE;\n else {\n if (put_byte(s, (s.gzhead.text \? 1 : 0) + (s.gzhead.hcrc \? 2 : 0) + (!s.gzhead.extra \? 0 : 4) + (!s.gzhead.name \? 0 : 8) + (!s.gzhead.comment \? 0 : 16)), put_byte(s, s.gzhead.time & 255), put_byte(s, s.gzhead.time >> 8 & 255), put_byte(s, s.gzhead.time >> 16 & 255), put_byte(s, s.gzhead.time >> 24 & 255), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length)\n put_byte(s, s.gzhead.extra.length & 255), put_byte(s, s.gzhead.extra.length >> 8 & 255);\n if (s.gzhead.hcrc)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n s.gzindex = 0, s.status = EXTRA_STATE;\n }\n else {\n var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8, level_flags = -1;\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2)\n level_flags = 0;\n else if (s.level < 6)\n level_flags = 1;\n else if (s.level === 6)\n level_flags = 2;\n else\n level_flags = 3;\n if (header |= level_flags << 6, s.strstart !== 0)\n header |= PRESET_DICT;\n if (header += 31 - header % 31, s.status = BUSY_STATE, putShortMSB(s, header), s.strstart !== 0)\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n strm.adler = 1;\n }\n if (s.status === EXTRA_STATE)\n if (s.gzhead.extra) {\n beg = s.pending;\n while (s.gzindex < (s.gzhead.extra.length & 65535)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size)\n break;\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 255), s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (s.gzindex === s.gzhead.extra.length)\n s.gzindex = 0, s.status = NAME_STATE;\n } else\n s.status = NAME_STATE;\n if (s.status === NAME_STATE)\n if (s.gzhead.name) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.name.length)\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.gzindex = 0, s.status = COMMENT_STATE;\n } else\n s.status = COMMENT_STATE;\n if (s.status === COMMENT_STATE)\n if (s.gzhead.comment) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.comment.length)\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.status = HCRC_STATE;\n } else\n s.status = HCRC_STATE;\n if (s.status === HCRC_STATE)\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size)\n flush_pending(strm);\n if (s.pending + 2 <= s.pending_buf_size)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), strm.adler = 0, s.status = BUSY_STATE;\n } else\n s.status = BUSY_STATE;\n if (s.pending !== 0) {\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH)\n return err(strm, Z_BUF_ERROR);\n if (s.status === FINISH_STATE && strm.avail_in !== 0)\n return err(strm, Z_BUF_ERROR);\n if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY \? deflate_huff(s, flush) : s.strategy === Z_RLE \? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE)\n s.status = FINISH_STATE;\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0)\n s.last_flush = -1;\n return Z_OK;\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH)\n trees._tr_align(s);\n else if (flush !== Z_BLOCK) {\n if (trees._tr_stored_block(s, 0, 0, !1), flush === Z_FULL_FLUSH) {\n if (zero(s.head), s.lookahead === 0)\n s.strstart = 0, s.block_start = 0, s.insert = 0;\n }\n }\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n }\n }\n if (flush !== Z_FINISH)\n return Z_OK;\n if (s.wrap <= 0)\n return Z_STREAM_END;\n if (s.wrap === 2)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), put_byte(s, strm.adler >> 16 & 255), put_byte(s, strm.adler >> 24 & 255), put_byte(s, strm.total_in & 255), put_byte(s, strm.total_in >> 8 & 255), put_byte(s, strm.total_in >> 16 & 255), put_byte(s, strm.total_in >> 24 & 255);\n else\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n if (flush_pending(strm), s.wrap > 0)\n s.wrap = -s.wrap;\n return s.pending !== 0 \? Z_OK : Z_STREAM_END;\n }\n function deflateEnd(strm) {\n var status;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (status = strm.state.status, status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE)\n return err(strm, Z_STREAM_ERROR);\n return strm.state = null, status === BUSY_STATE \? err(strm, Z_DATA_ERROR) : Z_OK;\n }\n function deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, s, str, n, wrap, avail, next, input, tmpDict;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (s = strm.state, wrap = s.wrap, wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead)\n return Z_STREAM_ERROR;\n if (wrap === 1)\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n if (s.wrap = 0, dictLength >= s.w_size) {\n if (wrap === 0)\n zero(s.head), s.strstart = 0, s.block_start = 0, s.insert = 0;\n tmpDict = new utils.Buf8(s.w_size), utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0), dictionary = tmpDict, dictLength = s.w_size;\n }\n avail = strm.avail_in, next = strm.next_in, input = strm.input, strm.avail_in = dictLength, strm.next_in = 0, strm.input = dictionary, fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart, n = s.lookahead - (MIN_MATCH - 1);\n do\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++;\n while (--n);\n s.strstart = str, s.lookahead = MIN_MATCH - 1, fill_window(s);\n }\n return s.strstart += s.lookahead, s.block_start = s.strstart, s.insert = s.lookahead, s.lookahead = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, strm.next_in = next, strm.input = input, strm.avail_in = avail, s.wrap = wrap, Z_OK;\n }\n exports.deflateInit = deflateInit, exports.deflateInit2 = deflateInit2, exports.deflateReset = deflateReset, exports.deflateResetKeep = deflateResetKeep, exports.deflateSetHeader = deflateSetHeader, exports.deflate = deflate, exports.deflateEnd = deflateEnd, exports.deflateSetDictionary = deflateSetDictionary, exports.deflateInfo = \"pako deflate (from Nodeca project)\";\n }\n}), require_inffast = __commonJS({\n \"node_modules/pako/lib/zlib/inffast.js\"(exports, module2) {\n var BAD = 30, TYPE = 12;\n module2.exports = function inflate_fast(strm, start) {\n var state, _in, last, _out, beg, end, dmax, wsize, whave, wnext, s_window, hold, bits, lcode, dcode, lmask, dmask, here, op, len, dist, from, from_source, input, output;\n state = strm.state, _in = strm.next_in, input = strm.input, last = _in + (strm.avail_in - 5), _out = strm.next_out, output = strm.output, beg = _out - (start - strm.avail_out), end = _out + (strm.avail_out - 257), dmax = state.dmax, wsize = state.wsize, whave = state.whave, wnext = state.wnext, s_window = state.window, hold = state.hold, bits = state.bits, lcode = state.lencode, dcode = state.distcode, lmask = (1 << state.lenbits) - 1, dmask = (1 << state.distbits) - 1;\n top:\n do {\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = lcode[hold & lmask];\n dolen:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op === 0)\n output[_out++] = here & 65535;\n else if (op & 16) {\n if (len = here & 65535, op &= 15, op) {\n if (bits < op)\n hold += input[_in++] << bits, bits += 8;\n len += hold & (1 << op) - 1, hold >>>= op, bits -= op;\n }\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = dcode[hold & dmask];\n dodist:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op & 16) {\n if (dist = here & 65535, op &= 15, bits < op) {\n if (hold += input[_in++] << bits, bits += 8, bits < op)\n hold += input[_in++] << bits, bits += 8;\n }\n if (dist += hold & (1 << op) - 1, dist > dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n if (hold >>>= op, bits -= op, op = _out - beg, dist > op) {\n if (op = dist - op, op > whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n }\n if (from = 0, from_source = s_window, wnext === 0) {\n if (from += wsize - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n } else if (wnext < op) {\n if (from += wsize + wnext - op, op -= wnext, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n if (from = 0, wnext < len) {\n op = wnext, len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n }\n } else if (from += wnext - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n while (len > 2)\n output[_out++] = from_source[from++], output[_out++] = from_source[from++], output[_out++] = from_source[from++], len -= 3;\n if (len) {\n if (output[_out++] = from_source[from++], len > 1)\n output[_out++] = from_source[from++];\n }\n } else {\n from = _out - dist;\n do\n output[_out++] = output[from++], output[_out++] = output[from++], output[_out++] = output[from++], len -= 3;\n while (len > 2);\n if (len) {\n if (output[_out++] = output[from++], len > 1)\n output[_out++] = output[from++];\n }\n }\n } else if ((op & 64) === 0) {\n here = dcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } else if ((op & 64) === 0) {\n here = lcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) {\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } while (_in < last && _out < end);\n len = bits >> 3, _in -= len, bits -= len << 3, hold &= (1 << bits) - 1, strm.next_in = _in, strm.next_out = _out, strm.avail_in = _in < last \? 5 + (last - _in) : 5 - (_in - last), strm.avail_out = _out < end \? 257 + (end - _out) : 257 - (_out - end), state.hold = hold, state.bits = bits;\n return;\n };\n }\n}), require_inftrees = __commonJS({\n \"node_modules/pako/lib/zlib/inftrees.js\"(exports, module2) {\n var utils = require_common(), MAXBITS = 15, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, CODES = 0, LENS = 1, DISTS = 2, lbase = [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 13,\n 15,\n 17,\n 19,\n 23,\n 27,\n 31,\n 35,\n 43,\n 51,\n 59,\n 67,\n 83,\n 99,\n 115,\n 131,\n 163,\n 195,\n 227,\n 258,\n 0,\n 0\n ], lext = [\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 17,\n 17,\n 18,\n 18,\n 18,\n 18,\n 19,\n 19,\n 19,\n 19,\n 20,\n 20,\n 20,\n 20,\n 21,\n 21,\n 21,\n 21,\n 16,\n 72,\n 78\n ], dbase = [\n 1,\n 2,\n 3,\n 4,\n 5,\n 7,\n 9,\n 13,\n 17,\n 25,\n 33,\n 49,\n 65,\n 97,\n 129,\n 193,\n 257,\n 385,\n 513,\n 769,\n 1025,\n 1537,\n 2049,\n 3073,\n 4097,\n 6145,\n 8193,\n 12289,\n 16385,\n 24577,\n 0,\n 0\n ], dext = [\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 18,\n 18,\n 19,\n 19,\n 20,\n 20,\n 21,\n 21,\n 22,\n 22,\n 23,\n 23,\n 24,\n 24,\n 25,\n 25,\n 26,\n 26,\n 27,\n 27,\n 28,\n 28,\n 29,\n 29,\n 64,\n 64\n ];\n module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n var bits = opts.bits, len = 0, sym = 0, min = 0, max = 0, root = 0, curr = 0, drop = 0, left = 0, used = 0, huff = 0, incr, fill, low, mask, next, base = null, base_index = 0, end, count = new utils.Buf16(MAXBITS + 1), offs = new utils.Buf16(MAXBITS + 1), extra = null, extra_index = 0, here_bits, here_op, here_val;\n for (len = 0;len <= MAXBITS; len++)\n count[len] = 0;\n for (sym = 0;sym < codes; sym++)\n count[lens[lens_index + sym]]++;\n root = bits;\n for (max = MAXBITS;max >= 1; max--)\n if (count[max] !== 0)\n break;\n if (root > max)\n root = max;\n if (max === 0)\n return table[table_index++] = 1 << 24 | 64 << 16 | 0, table[table_index++] = 1 << 24 | 64 << 16 | 0, opts.bits = 1, 0;\n for (min = 1;min < max; min++)\n if (count[min] !== 0)\n break;\n if (root < min)\n root = min;\n left = 1;\n for (len = 1;len <= MAXBITS; len++)\n if (left <<= 1, left -= count[len], left < 0)\n return -1;\n if (left > 0 && (type === CODES || max !== 1))\n return -1;\n offs[1] = 0;\n for (len = 1;len < MAXBITS; len++)\n offs[len + 1] = offs[len] + count[len];\n for (sym = 0;sym < codes; sym++)\n if (lens[lens_index + sym] !== 0)\n work[offs[lens[lens_index + sym]]++] = sym;\n if (type === CODES)\n base = extra = work, end = 19;\n else if (type === LENS)\n base = lbase, base_index -= 257, extra = lext, extra_index -= 257, end = 256;\n else\n base = dbase, extra = dext, end = -1;\n if (huff = 0, sym = 0, len = min, next = table_index, curr = root, drop = 0, low = -1, used = 1 << root, mask = used - 1, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n for (;; ) {\n if (here_bits = len - drop, work[sym] < end)\n here_op = 0, here_val = work[sym];\n else if (work[sym] > end)\n here_op = extra[extra_index + work[sym]], here_val = base[base_index + work[sym]];\n else\n here_op = 96, here_val = 0;\n incr = 1 << len - drop, fill = 1 << curr, min = fill;\n do\n fill -= incr, table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;\n while (fill !== 0);\n incr = 1 << len - 1;\n while (huff & incr)\n incr >>= 1;\n if (incr !== 0)\n huff &= incr - 1, huff += incr;\n else\n huff = 0;\n if (sym++, --count[len] === 0) {\n if (len === max)\n break;\n len = lens[lens_index + work[sym]];\n }\n if (len > root && (huff & mask) !== low) {\n if (drop === 0)\n drop = root;\n next += min, curr = len - drop, left = 1 << curr;\n while (curr + drop < max) {\n if (left -= count[curr + drop], left <= 0)\n break;\n curr++, left <<= 1;\n }\n if (used += 1 << curr, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n low = huff & mask, table[low] = root << 24 | curr << 16 | next - table_index | 0;\n }\n }\n if (huff !== 0)\n table[next + huff] = len - drop << 24 | 64 << 16 | 0;\n return opts.bits = root, 0;\n };\n }\n}), require_inflate = __commonJS({\n \"node_modules/pako/lib/zlib/inflate.js\"(exports) {\n var utils = require_common(), adler32 = require_adler32(), crc32 = require_crc32(), inflate_fast = require_inffast(), inflate_table = require_inftrees(), CODES = 0, LENS = 1, DISTS = 2, Z_FINISH = 4, Z_BLOCK = 5, Z_TREES = 6, Z_OK = 0, Z_STREAM_END = 1, Z_NEED_DICT = 2, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_MEM_ERROR = -4, Z_BUF_ERROR = -5, Z_DEFLATED = 8, HEAD = 1, FLAGS = 2, TIME = 3, OS = 4, EXLEN = 5, EXTRA = 6, NAME = 7, COMMENT = 8, HCRC = 9, DICTID = 10, DICT = 11, TYPE = 12, TYPEDO = 13, STORED = 14, COPY_ = 15, COPY = 16, TABLE = 17, LENLENS = 18, CODELENS = 19, LEN_ = 20, LEN = 21, LENEXT = 22, DIST = 23, DISTEXT = 24, MATCH = 25, LIT = 26, CHECK = 27, LENGTH = 28, DONE = 29, BAD = 30, MEM = 31, SYNC = 32, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, MAX_WBITS = 15, DEF_WBITS = MAX_WBITS;\n function zswap32(q) {\n return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);\n }\n function InflateState() {\n this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new utils.Buf16(320), this.work = new utils.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;\n }\n function inflateResetKeep(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, strm.total_in = strm.total_out = state.total = 0, strm.msg = \"\", state.wrap)\n strm.adler = state.wrap & 1;\n return state.mode = HEAD, state.last = 0, state.havedict = 0, state.dmax = 32768, state.head = null, state.hold = 0, state.bits = 0, state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS), state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS), state.sane = 1, state.back = -1, Z_OK;\n }\n function inflateReset(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n return state = strm.state, state.wsize = 0, state.whave = 0, state.wnext = 0, inflateResetKeep(strm);\n }\n function inflateReset2(strm, windowBits) {\n var wrap, state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (wrap = (windowBits >> 4) + 1, windowBits < 48)\n windowBits &= 15;\n if (windowBits && (windowBits < 8 || windowBits > 15))\n return Z_STREAM_ERROR;\n if (state.window !== null && state.wbits !== windowBits)\n state.window = null;\n return state.wrap = wrap, state.wbits = windowBits, inflateReset(strm);\n }\n function inflateInit2(strm, windowBits) {\n var ret, state;\n if (!strm)\n return Z_STREAM_ERROR;\n if (state = new InflateState, strm.state = state, state.window = null, ret = inflateReset2(strm, windowBits), ret !== Z_OK)\n strm.state = null;\n return ret;\n }\n function inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n }\n var virgin = !0, lenfix, distfix;\n function fixedtables(state) {\n if (virgin) {\n var sym;\n lenfix = new utils.Buf32(512), distfix = new utils.Buf32(32), sym = 0;\n while (sym < 144)\n state.lens[sym++] = 8;\n while (sym < 256)\n state.lens[sym++] = 9;\n while (sym < 280)\n state.lens[sym++] = 7;\n while (sym < 288)\n state.lens[sym++] = 8;\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {\n bits: 9\n }), sym = 0;\n while (sym < 32)\n state.lens[sym++] = 5;\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {\n bits: 5\n }), virgin = !1;\n }\n state.lencode = lenfix, state.lenbits = 9, state.distcode = distfix, state.distbits = 5;\n }\n function updatewindow(strm, src, end, copy) {\n var dist, state = strm.state;\n if (state.window === null)\n state.wsize = 1 << state.wbits, state.wnext = 0, state.whave = 0, state.window = new utils.Buf8(state.wsize);\n if (copy >= state.wsize)\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0), state.wnext = 0, state.whave = state.wsize;\n else {\n if (dist = state.wsize - state.wnext, dist > copy)\n dist = copy;\n if (utils.arraySet(state.window, src, end - copy, dist, state.wnext), copy -= dist, copy)\n utils.arraySet(state.window, src, end - copy, copy, 0), state.wnext = copy, state.whave = state.wsize;\n else {\n if (state.wnext += dist, state.wnext === state.wsize)\n state.wnext = 0;\n if (state.whave < state.wsize)\n state.whave += dist;\n }\n }\n return 0;\n }\n function inflate(strm, flush) {\n var state, input, output, next, put, have, left, hold, bits, _in, _out, copy, from, from_source, here = 0, here_bits, here_op, here_val, last_bits, last_op, last_val, len, ret, hbuf = new utils.Buf8(4), opts, n, order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.mode === TYPE)\n state.mode = TYPEDO;\n put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, _in = have, _out = left, ret = Z_OK;\n inf_leave:\n for (;; )\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.wrap & 2 && hold === 35615) {\n state.check = 0, hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0), hold = 0, bits = 0, state.mode = FLAGS;\n break;\n }\n if (state.flags = 0, state.head)\n state.head.done = !1;\n if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {\n strm.msg = \"incorrect header check\", state.mode = BAD;\n break;\n }\n if ((hold & 15) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (hold >>>= 4, bits -= 4, len = (hold & 15) + 8, state.wbits === 0)\n state.wbits = len;\n else if (len > state.wbits) {\n strm.msg = \"invalid window size\", state.mode = BAD;\n break;\n }\n state.dmax = 1 << len, strm.adler = state.check = 1, state.mode = hold & 512 \? DICTID : TYPE, hold = 0, bits = 0;\n break;\n case FLAGS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.flags = hold, (state.flags & 255) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (state.flags & 57344) {\n strm.msg = \"unknown header flags set\", state.mode = BAD;\n break;\n }\n if (state.head)\n state.head.text = hold >> 8 & 1;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = TIME;\n case TIME:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.time = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, hbuf[2] = hold >>> 16 & 255, hbuf[3] = hold >>> 24 & 255, state.check = crc32(state.check, hbuf, 4, 0);\n hold = 0, bits = 0, state.mode = OS;\n case OS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.xflags = hold & 255, state.head.os = hold >> 8;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = EXLEN;\n case EXLEN:\n if (state.flags & 1024) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.length = hold, state.head)\n state.head.extra_len = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0;\n } else if (state.head)\n state.head.extra = null;\n state.mode = EXTRA;\n case EXTRA:\n if (state.flags & 1024) {\n if (copy = state.length, copy > have)\n copy = have;\n if (copy) {\n if (state.head) {\n if (len = state.head.extra_len - state.length, !state.head.extra)\n state.head.extra = new Array(state.head.extra_len);\n utils.arraySet(state.head.extra, input, next, copy, len);\n }\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n have -= copy, next += copy, state.length -= copy;\n }\n if (state.length)\n break inf_leave;\n }\n state.length = 0, state.mode = NAME;\n case NAME:\n if (state.flags & 2048) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.name += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.name = null;\n state.length = 0, state.mode = COMMENT;\n case COMMENT:\n if (state.flags & 4096) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.comment += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.comment = null;\n state.mode = HCRC;\n case HCRC:\n if (state.flags & 512) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.check & 65535)) {\n strm.msg = \"header crc mismatch\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n if (state.head)\n state.head.hcrc = state.flags >> 9 & 1, state.head.done = !0;\n strm.adler = state.check = 0, state.mode = TYPE;\n break;\n case DICTID:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n strm.adler = state.check = zswap32(hold), hold = 0, bits = 0, state.mode = DICT;\n case DICT:\n if (state.havedict === 0)\n return strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, Z_NEED_DICT;\n strm.adler = state.check = 1, state.mode = TYPE;\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES)\n break inf_leave;\n case TYPEDO:\n if (state.last) {\n hold >>>= bits & 7, bits -= bits & 7, state.mode = CHECK;\n break;\n }\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n switch (state.last = hold & 1, hold >>>= 1, bits -= 1, hold & 3) {\n case 0:\n state.mode = STORED;\n break;\n case 1:\n if (fixedtables(state), state.mode = LEN_, flush === Z_TREES) {\n hold >>>= 2, bits -= 2;\n break inf_leave;\n }\n break;\n case 2:\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = \"invalid block type\", state.mode = BAD;\n }\n hold >>>= 2, bits -= 2;\n break;\n case STORED:\n hold >>>= bits & 7, bits -= bits & 7;\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {\n strm.msg = \"invalid stored block lengths\", state.mode = BAD;\n break;\n }\n if (state.length = hold & 65535, hold = 0, bits = 0, state.mode = COPY_, flush === Z_TREES)\n break inf_leave;\n case COPY_:\n state.mode = COPY;\n case COPY:\n if (copy = state.length, copy) {\n if (copy > have)\n copy = have;\n if (copy > left)\n copy = left;\n if (copy === 0)\n break inf_leave;\n utils.arraySet(output, input, next, copy, put), have -= copy, next += copy, left -= copy, put += copy, state.length -= copy;\n break;\n }\n state.mode = TYPE;\n break;\n case TABLE:\n while (bits < 14) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.nlen = (hold & 31) + 257, hold >>>= 5, bits -= 5, state.ndist = (hold & 31) + 1, hold >>>= 5, bits -= 5, state.ncode = (hold & 15) + 4, hold >>>= 4, bits -= 4, state.nlen > 286 || state.ndist > 30) {\n strm.msg = \"too many length or distance symbols\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = LENLENS;\n case LENLENS:\n while (state.have < state.ncode) {\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.lens[order[state.have++]] = hold & 7, hold >>>= 3, bits -= 3;\n }\n while (state.have < 19)\n state.lens[order[state.have++]] = 0;\n if (state.lencode = state.lendyn, state.lenbits = 7, opts = { bits: state.lenbits }, ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid code lengths set\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = CODELENS;\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_val < 16)\n hold >>>= here_bits, bits -= here_bits, state.lens[state.have++] = here_val;\n else {\n if (here_val === 16) {\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.have === 0) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1], copy = 3 + (hold & 3), hold >>>= 2, bits -= 2;\n } else if (here_val === 17) {\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 3 + (hold & 7), hold >>>= 3, bits -= 3;\n } else {\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 11 + (hold & 127), hold >>>= 7, bits -= 7;\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n while (copy--)\n state.lens[state.have++] = len;\n }\n }\n if (state.mode === BAD)\n break;\n if (state.lens[256] === 0) {\n strm.msg = \"invalid code -- missing end-of-block\", state.mode = BAD;\n break;\n }\n if (state.lenbits = 9, opts = { bits: state.lenbits }, ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid literal/lengths set\", state.mode = BAD;\n break;\n }\n if (state.distbits = 6, state.distcode = state.distdyn, opts = { bits: state.distbits }, ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts), state.distbits = opts.bits, ret) {\n strm.msg = \"invalid distances set\", state.mode = BAD;\n break;\n }\n if (state.mode = LEN_, flush === Z_TREES)\n break inf_leave;\n case LEN_:\n state.mode = LEN;\n case LEN:\n if (have >= 6 && left >= 258) {\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, inflate_fast(strm, _out), put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, state.mode === TYPE)\n state.back = -1;\n break;\n }\n state.back = 0;\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_op && (here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, state.length = here_val, here_op === 0) {\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n state.back = -1, state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break;\n }\n state.extra = here_op & 15, state.mode = LENEXT;\n case LENEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.length += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n state.was = state.length, state.mode = DIST;\n case DIST:\n for (;; ) {\n if (here = state.distcode[hold & (1 << state.distbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, here_op & 64) {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break;\n }\n state.offset = here_val, state.extra = here_op & 15, state.mode = DISTEXT;\n case DISTEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.offset += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n if (state.offset > state.dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n state.mode = MATCH;\n case MATCH:\n if (left === 0)\n break inf_leave;\n if (copy = _out - left, state.offset > copy) {\n if (copy = state.offset - copy, copy > state.whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n }\n if (copy > state.wnext)\n copy -= state.wnext, from = state.wsize - copy;\n else\n from = state.wnext - copy;\n if (copy > state.length)\n copy = state.length;\n from_source = state.window;\n } else\n from_source = output, from = put - state.offset, copy = state.length;\n if (copy > left)\n copy = left;\n left -= copy, state.length -= copy;\n do\n output[put++] = from_source[from++];\n while (--copy);\n if (state.length === 0)\n state.mode = LEN;\n break;\n case LIT:\n if (left === 0)\n break inf_leave;\n output[put++] = state.length, left--, state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold |= input[next++] << bits, bits += 8;\n }\n if (_out -= left, strm.total_out += _out, state.total += _out, _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);\n if (_out = left, (state.flags \? hold : zswap32(hold)) !== state.check) {\n strm.msg = \"incorrect data check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = LENGTH;\n case LENGTH:\n if (state.wrap && state.flags) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.total & 4294967295)) {\n strm.msg = \"incorrect length check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = DONE;\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n default:\n return Z_STREAM_ERROR;\n }\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out))\n return state.mode = MEM, Z_MEM_ERROR;\n }\n if (_in -= strm.avail_in, _out -= strm.avail_out, strm.total_in += _in, strm.total_out += _out, state.total += _out, state.wrap && _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);\n if (strm.data_type = state.bits + (state.last \? 64 : 0) + (state.mode === TYPE \? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ \? 256 : 0), (_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK)\n ret = Z_BUF_ERROR;\n return ret;\n }\n function inflateEnd(strm) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n var state = strm.state;\n if (state.window)\n state.window = null;\n return strm.state = null, Z_OK;\n }\n function inflateGetHeader(strm, head) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, (state.wrap & 2) === 0)\n return Z_STREAM_ERROR;\n return state.head = head, head.done = !1, Z_OK;\n }\n function inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, state, dictid, ret;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.wrap !== 0 && state.mode !== DICT)\n return Z_STREAM_ERROR;\n if (state.mode === DICT) {\n if (dictid = 1, dictid = adler32(dictid, dictionary, dictLength, 0), dictid !== state.check)\n return Z_DATA_ERROR;\n }\n if (ret = updatewindow(strm, dictionary, dictLength, dictLength), ret)\n return state.mode = MEM, Z_MEM_ERROR;\n return state.havedict = 1, Z_OK;\n }\n exports.inflateReset = inflateReset, exports.inflateReset2 = inflateReset2, exports.inflateResetKeep = inflateResetKeep, exports.inflateInit = inflateInit, exports.inflateInit2 = inflateInit2, exports.inflate = inflate, exports.inflateEnd = inflateEnd, exports.inflateGetHeader = inflateGetHeader, exports.inflateSetDictionary = inflateSetDictionary, exports.inflateInfo = \"pako inflate (from Nodeca project)\";\n }\n}), require_constants = __commonJS({\n \"node_modules/pako/lib/zlib/constants.js\"(exports, module2) {\n module2.exports = {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_BUF_ERROR: -5,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n Z_BINARY: 0,\n Z_TEXT: 1,\n Z_UNKNOWN: 2,\n Z_DEFLATED: 8\n };\n }\n}), require_binding = __commonJS({\n \"node_modules/browserify-zlib/lib/binding.js\"(exports) {\n var Zstream = require_zstream(), zlib_deflate = require_deflate(), zlib_inflate = require_inflate(), constants = require_constants();\n for (key in constants)\n exports[key] = constants[key];\n var key;\n exports.NONE = 0, exports.DEFLATE = 1, exports.INFLATE = 2, exports.GZIP = 3, exports.GUNZIP = 4, exports.DEFLATERAW = 5, exports.INFLATERAW = 6, exports.UNZIP = 7;\n var GZIP_HEADER_ID1 = 31, GZIP_HEADER_ID2 = 139;\n function Zlib(mode) {\n if (typeof mode !== \"number\" || mode < exports.DEFLATE || mode > exports.UNZIP)\n @throwTypeError(\"Bad argument\");\n this.dictionary = null, this.err = 0, this.flush = 0, this.init_done = !1, this.level = 0, this.memLevel = 0, this.mode = mode, this.strategy = 0, this.windowBits = 0, this.write_in_progress = !1, this.pending_close = !1, this.gzip_id_bytes_read = 0;\n }\n Zlib.prototype = {}, Zlib.prototype.close = function() {\n if (this.write_in_progress) {\n this.pending_close = !0;\n return;\n }\n if (this.pending_close = !1, assert(this.init_done, \"close before init\"), assert(this.mode <= exports.UNZIP), this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW)\n zlib_deflate.deflateEnd(this.strm);\n else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP)\n zlib_inflate.inflateEnd(this.strm);\n this.mode = exports.NONE, this.dictionary = null;\n }, Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!0, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!1, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype._write = function(async, flush, input, in_off, in_len, out, out_off, out_len) {\n if (assert.equal(arguments.length, 8), assert(this.init_done, \"write before init\"), assert(this.mode !== exports.NONE, \"already finalized\"), assert.equal(!1, this.write_in_progress, \"write already in progress\"), assert.equal(!1, this.pending_close, \"close is pending\"), this.write_in_progress = !0, assert.equal(!1, flush === void 0, \"must provide flush value\"), this.write_in_progress = !0, flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK)\n throw new Error(\"Invalid flush value\");\n if (input == null)\n input = Buffer.alloc(0), in_len = 0, in_off = 0;\n if (this.strm.avail_in = in_len, this.strm.input = input, this.strm.next_in = in_off, this.strm.avail_out = out_len, this.strm.output = out, this.strm.next_out = out_off, this.flush = flush, !async) {\n if (this._process(), this._checkError())\n return this._afterSync();\n return;\n }\n var self = this;\n return process.nextTick(function() {\n self._process(), self._after();\n }), this;\n }, Zlib.prototype._afterSync = function() {\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n return this.write_in_progress = !1, [avail_in, avail_out];\n }, Zlib.prototype._process = function() {\n var next_expected_header_byte = null;\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n case exports.UNZIP:\n if (this.strm.avail_in > 0)\n next_expected_header_byte = this.strm.next_in;\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n if (this.gzip_id_bytes_read = 1, next_expected_header_byte++, this.strm.avail_in === 1)\n break;\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n case 1:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2)\n this.gzip_id_bytes_read = 2, this.mode = exports.GUNZIP;\n else\n this.mode = exports.INFLATE;\n break;\n default:\n throw new Error(\"invalid number of gzip magic number bytes read\");\n }\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n if (this.err = zlib_inflate.inflate(this.strm, this.flush), this.err === exports.Z_NEED_DICT && this.dictionary) {\n if (this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary), this.err === exports.Z_OK)\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n else if (this.err === exports.Z_DATA_ERROR)\n this.err = exports.Z_NEED_DICT;\n }\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0)\n this.reset(), this.err = zlib_inflate.inflate(this.strm, this.flush);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n }, Zlib.prototype._checkError = function() {\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH)\n return this._error(\"unexpected end of file\"), !1;\n break;\n case exports.Z_STREAM_END:\n break;\n case exports.Z_NEED_DICT:\n if (this.dictionary == null)\n this._error(\"Missing dictionary\");\n else\n this._error(\"Bad dictionary\");\n return !1;\n default:\n return this._error(\"Zlib error\"), !1;\n }\n return !0;\n }, Zlib.prototype._after = function() {\n if (!this._checkError())\n return;\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n if (this.write_in_progress = !1, this.callback(avail_in, avail_out), this.pending_close)\n this.close();\n }, Zlib.prototype._error = function(message) {\n if (this.strm.msg)\n message = this.strm.msg;\n if (this.onerror(message, this.err), this.write_in_progress = !1, this.pending_close)\n this.close();\n }, Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, \"init(windowBits, level, memLevel, strategy, [dictionary])\"), assert(windowBits >= 8 && windowBits <= 15, \"invalid windowBits\"), assert(level >= -1 && level <= 9, \"invalid compression level\"), assert(memLevel >= 1 && memLevel <= 9, \"invalid memlevel\"), assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, \"invalid strategy\"), this._init(level, windowBits, memLevel, strategy, dictionary), this._setDictionary();\n }, Zlib.prototype.params = function() {\n throw new Error(\"deflateParams Not supported\");\n }, Zlib.prototype.reset = function() {\n this._reset(), this._setDictionary();\n }, Zlib.prototype._init = function(level, windowBits, memLevel, strategy, dictionary) {\n if (this.level = level, this.windowBits = windowBits, this.memLevel = memLevel, this.strategy = strategy, this.flush = exports.Z_NO_FLUSH, this.err = exports.Z_OK, this.mode === exports.GZIP || this.mode === exports.GUNZIP)\n this.windowBits += 16;\n if (this.mode === exports.UNZIP)\n this.windowBits += 32;\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW)\n this.windowBits = -1 * this.windowBits;\n switch (this.strm = new Zstream, this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Init error\");\n this.dictionary = dictionary, this.write_in_progress = !1, this.init_done = !0;\n }, Zlib.prototype._setDictionary = function() {\n if (this.dictionary == null)\n return;\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to set dictionary\");\n }, Zlib.prototype._reset = function() {\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to reset stream\");\n }, exports.Zlib = Zlib;\n }\n}), require_lib = __commonJS({\n \"node_modules/browserify-zlib/lib/index.js\"(exports) {\n var Buffer2 = BufferModule.Buffer, Transform = StreamModule.Transform, binding = require_binding(), util = Util, kMaxLength = BufferModule.kMaxLength, kRangeErrorMessage = \"Cannot create final Buffer. It would be larger than 0x\" + kMaxLength.toString(16) + \" bytes\";\n binding.Z_MIN_WINDOWBITS = 8, binding.Z_MAX_WINDOWBITS = 15, binding.Z_DEFAULT_WINDOWBITS = 15, binding.Z_MIN_CHUNK = 64, binding.Z_MAX_CHUNK = Infinity, binding.Z_DEFAULT_CHUNK = 16384, binding.Z_MIN_MEMLEVEL = 1, binding.Z_MAX_MEMLEVEL = 9, binding.Z_DEFAULT_MEMLEVEL = 8, binding.Z_MIN_LEVEL = -1, binding.Z_MAX_LEVEL = 9, binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;\n var bkeys = Object.keys(binding);\n for (bk = 0;bk < bkeys.length; bk++)\n if (bkey = bkeys[bk], bkey.match(/^Z/))\n Object.defineProperty(exports, bkey, {\n enumerable: !0,\n value: binding[bkey],\n writable: !1\n });\n var bkey, bk, codes = {\n Z_OK: binding.Z_OK,\n Z_STREAM_END: binding.Z_STREAM_END,\n Z_NEED_DICT: binding.Z_NEED_DICT,\n Z_ERRNO: binding.Z_ERRNO,\n Z_STREAM_ERROR: binding.Z_STREAM_ERROR,\n Z_DATA_ERROR: binding.Z_DATA_ERROR,\n Z_MEM_ERROR: binding.Z_MEM_ERROR,\n Z_BUF_ERROR: binding.Z_BUF_ERROR,\n Z_VERSION_ERROR: binding.Z_VERSION_ERROR\n }, ckeys = Object.keys(codes);\n for (ck = 0;ck < ckeys.length; ck++)\n ckey = ckeys[ck], codes[codes[ckey]] = ckey;\n var ckey, ck;\n Object.defineProperty(exports, \"codes\", {\n enumerable: !0,\n value: Object.freeze(codes),\n writable: !1\n }), exports.constants = require_constants(), exports.Deflate = Deflate, exports.Inflate = Inflate, exports.Gzip = Gzip, exports.Gunzip = Gunzip, exports.DeflateRaw = DeflateRaw, exports.InflateRaw = InflateRaw, exports.Unzip = Unzip, exports.createDeflate = function(o) {\n return new Deflate(o);\n }, exports.createInflate = function(o) {\n return new Inflate(o);\n }, exports.createDeflateRaw = function(o) {\n return new DeflateRaw(o);\n }, exports.createInflateRaw = function(o) {\n return new InflateRaw(o);\n }, exports.createGzip = function(o) {\n return new Gzip(o);\n }, exports.createGunzip = function(o) {\n return new Gunzip(o);\n }, exports.createUnzip = function(o) {\n return new Unzip(o);\n }, exports.deflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Deflate(opts), buffer, callback);\n }, exports.deflateSync = function(buffer, opts) {\n return zlibBufferSync(new Deflate(opts), buffer);\n }, exports.gzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gzip(opts), buffer, callback);\n }, exports.gzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gzip(opts), buffer);\n }, exports.deflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new DeflateRaw(opts), buffer, callback);\n }, exports.deflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new DeflateRaw(opts), buffer);\n }, exports.unzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Unzip(opts), buffer, callback);\n }, exports.unzipSync = function(buffer, opts) {\n return zlibBufferSync(new Unzip(opts), buffer);\n }, exports.inflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Inflate(opts), buffer, callback);\n }, exports.inflateSync = function(buffer, opts) {\n return zlibBufferSync(new Inflate(opts), buffer);\n }, exports.gunzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gunzip(opts), buffer, callback);\n }, exports.gunzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gunzip(opts), buffer);\n }, exports.inflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new InflateRaw(opts), buffer, callback);\n }, exports.inflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new InflateRaw(opts), buffer);\n }, exports.brotliCompress = function(buffer, opts, callback) {\n throw new Error(\"zlib.brotliCompress is not implemented\");\n };\n function zlibBuffer(engine, buffer, callback) {\n var buffers = [], nread = 0;\n engine.on(\"error\", onError), engine.on(\"end\", onEnd), engine.end(buffer), flow();\n function flow() {\n var chunk;\n while ((chunk = engine.read()) !== null)\n buffers.push(chunk), nread += chunk.length;\n engine.once(\"readable\", flow);\n }\n function onError(err) {\n engine.removeListener(\"end\", onEnd), engine.removeListener(\"readable\", flow), callback(err);\n }\n function onEnd() {\n var buf, err = null;\n if (nread >= kMaxLength)\n err = new RangeError(kRangeErrorMessage);\n else\n buf = Buffer2.concat(buffers, nread);\n buffers = [], engine.close(), callback(err, buf);\n }\n }\n function zlibBufferSync(engine, buffer) {\n if (typeof buffer === \"string\")\n buffer = Buffer2.from(buffer);\n if (!Buffer2.isBuffer(buffer))\n @throwTypeError(\"Not a string or buffer\");\n var flushFlag = engine._finishFlushFlag;\n return engine._processChunk(buffer, flushFlag);\n }\n function Deflate(opts) {\n if (!(this instanceof Deflate))\n return new Deflate(opts);\n Zlib.call(this, opts, binding.DEFLATE);\n }\n function Inflate(opts) {\n if (!(this instanceof Inflate))\n return new Inflate(opts);\n Zlib.call(this, opts, binding.INFLATE);\n }\n function Gzip(opts) {\n if (!(this instanceof Gzip))\n return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n }\n function Gunzip(opts) {\n if (!(this instanceof Gunzip))\n return new Gunzip(opts);\n Zlib.call(this, opts, binding.GUNZIP);\n }\n function DeflateRaw(opts) {\n if (!(this instanceof DeflateRaw))\n return new DeflateRaw(opts);\n Zlib.call(this, opts, binding.DEFLATERAW);\n }\n function InflateRaw(opts) {\n if (!(this instanceof InflateRaw))\n return new InflateRaw(opts);\n Zlib.call(this, opts, binding.INFLATERAW);\n }\n function Unzip(opts) {\n if (!(this instanceof Unzip))\n return new Unzip(opts);\n Zlib.call(this, opts, binding.UNZIP);\n }\n function isValidFlushFlag(flag) {\n return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;\n }\n function Zlib(opts, mode) {\n var _this = this;\n if (this._opts = opts = opts || {}, this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK, Transform.call(this, opts), opts.flush && !isValidFlushFlag(opts.flush))\n throw new Error(\"Invalid flush flag: \" + opts.flush);\n if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush))\n throw new Error(\"Invalid flush flag: \" + opts.finishFlush);\n if (this._flushFlag = opts.flush || binding.Z_NO_FLUSH, this._finishFlushFlag = typeof opts.finishFlush !== \"undefined\" \? opts.finishFlush : binding.Z_FINISH, opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK)\n throw new Error(\"Invalid chunk size: \" + opts.chunkSize);\n }\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS)\n throw new Error(\"Invalid windowBits: \" + opts.windowBits);\n }\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL)\n throw new Error(\"Invalid compression level: \" + opts.level);\n }\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL)\n throw new Error(\"Invalid memLevel: \" + opts.memLevel);\n }\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY)\n throw new Error(\"Invalid strategy: \" + opts.strategy);\n }\n if (opts.dictionary) {\n if (!Buffer2.isBuffer(opts.dictionary))\n throw new Error(\"Invalid dictionary: it should be a Buffer instance\");\n }\n this._handle = new binding.Zlib(mode);\n var self = this;\n this._hadError = !1, this._handle.onerror = function(message, errno) {\n _close(self), self._hadError = !0;\n var error = new Error(message);\n error.errno = errno, error.code = exports.codes[errno], self.emit(\"error\", error);\n };\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === \"number\")\n level = opts.level;\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === \"number\")\n strategy = opts.strategy;\n this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary), this._buffer = Buffer2.allocUnsafe(this._chunkSize), this._offset = 0, this._level = level, this._strategy = strategy, this.once(\"end\", this.close), Object.defineProperty(this, \"_closed\", {\n get: function() {\n return !_this._handle;\n },\n configurable: !0,\n enumerable: !0\n });\n }\n util.inherits(Zlib, Transform), Zlib.prototype.params = function(level, strategy, callback) {\n if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL)\n @throwRangeError(\"Invalid compression level: \" + level);\n if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY)\n @throwTypeError(\"Invalid strategy: \" + strategy);\n if (this._level !== level || this._strategy !== strategy) {\n var self = this;\n this.flush(binding.Z_SYNC_FLUSH, function() {\n if (assert(self._handle, \"zlib binding closed\"), self._handle.params(level, strategy), !self._hadError) {\n if (self._level = level, self._strategy = strategy, callback)\n callback();\n }\n });\n } else\n process.nextTick(callback);\n }, Zlib.prototype.reset = function() {\n return assert(this._handle, \"zlib binding closed\"), this._handle.reset();\n }, Zlib.prototype._flush = function(callback) {\n this._transform(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.flush = function(kind, callback) {\n var _this2 = this, ws = this._writableState;\n if (typeof kind === \"function\" || kind === void 0 && !callback)\n callback = kind, kind = binding.Z_FULL_FLUSH;\n if (ws.ended) {\n if (callback)\n process.nextTick(callback);\n } else if (ws.ending) {\n if (callback)\n this.once(\"end\", callback);\n } else if (ws.needDrain) {\n if (callback)\n this.once(\"drain\", function() {\n return _this2.flush(kind, callback);\n });\n } else\n this._flushFlag = kind, this.write(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.close = function(callback) {\n _close(this, callback), process.nextTick(emitCloseNT, this);\n };\n function _close(engine, callback) {\n if (callback)\n process.nextTick(callback);\n if (!engine._handle)\n return;\n engine._handle.close(), engine._handle = null;\n }\n function emitCloseNT(self) {\n self.emit(\"close\");\n }\n Zlib.prototype._transform = function(chunk, encoding, cb) {\n var flushFlag, ws = this._writableState, ending = ws.ending || ws.ended, last = ending && (!chunk || ws.length === chunk.length);\n if (chunk !== null && !Buffer2.isBuffer(chunk))\n return cb(new Error(\"invalid input\"));\n if (!this._handle)\n return cb(new Error(\"zlib binding closed\"));\n if (last)\n flushFlag = this._finishFlushFlag;\n else if (flushFlag = this._flushFlag, chunk.length >= ws.length)\n this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;\n this._processChunk(chunk, flushFlag, cb);\n }, Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {\n var availInBefore = chunk && chunk.length, availOutBefore = this._chunkSize - this._offset, inOff = 0, self = this, async = typeof cb === \"function\";\n if (!async) {\n var buffers = [], nread = 0, error;\n this.on(\"error\", function(er) {\n error = er;\n }), assert(this._handle, \"zlib binding closed\");\n do\n var res = this._handle.writeSync(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n while (!this._hadError && callback(res[0], res[1]));\n if (this._hadError)\n throw error;\n if (nread >= kMaxLength)\n _close(this), @throwRangeError(kRangeErrorMessage);\n var buf = Buffer2.concat(buffers, nread);\n return _close(this), buf;\n }\n assert(this._handle, \"zlib binding closed\");\n var req = this._handle.write(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n req.buffer = chunk, req.callback = callback;\n function callback(availInAfter, availOutAfter) {\n if (this)\n this.buffer = null, this.callback = null;\n if (self._hadError)\n return;\n var have = availOutBefore - availOutAfter;\n if (assert(have >= 0, \"have should not go down\"), have > 0) {\n var out = self._buffer.slice(self._offset, self._offset + have);\n if (self._offset += have, async)\n self.push(out);\n else\n buffers.push(out), nread += out.length;\n }\n if (availOutAfter === 0 || self._offset >= self._chunkSize)\n availOutBefore = self._chunkSize, self._offset = 0, self._buffer = Buffer2.allocUnsafe(self._chunkSize);\n if (availOutAfter === 0) {\n if (inOff += availInBefore - availInAfter, availInBefore = availInAfter, !async)\n return !0;\n var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);\n newReq.callback = callback, newReq.buffer = chunk;\n return;\n }\n if (!async)\n return !1;\n cb();\n }\n }, util.inherits(Deflate, Zlib), util.inherits(Inflate, Zlib), util.inherits(Gzip, Zlib), util.inherits(Gunzip, Zlib), util.inherits(DeflateRaw, Zlib), util.inherits(InflateRaw, Zlib), util.inherits(Unzip, Zlib);\n }\n});\nreturn require_lib()})\n"_s;
+static constexpr ASCIILiteral NodeWasiCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/wasi.ts\nvar nodeFsConstants = @processBindingConstants.fs, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_types = __commonJS({\n \"node_modules/wasi-js/dist/types.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASIKillError = exports.WASIExitError = exports.WASIError = void 0;\n var WASIError = class extends Error {\n constructor(errno) {\n super();\n this.errno = errno, Object.setPrototypeOf(this, WASIError.prototype);\n }\n };\n exports.WASIError = WASIError;\n var WASIExitError = class extends Error {\n constructor(code) {\n super(`WASI Exit error: ${code}`);\n this.code = code, Object.setPrototypeOf(this, WASIExitError.prototype);\n }\n };\n exports.WASIExitError = WASIExitError;\n var WASIKillError = class extends Error {\n constructor(signal) {\n super(`WASI Kill signal: ${signal}`);\n this.signal = signal, Object.setPrototypeOf(this, WASIKillError.prototype);\n }\n };\n exports.WASIKillError = WASIKillError;\n }\n}), require_constants = __commonJS({\n \"node_modules/wasi-js/dist/constants.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASI_ENOMSG = exports.WASI_ENOMEM = exports.WASI_ENOLINK = exports.WASI_ENOLCK = exports.WASI_ENOEXEC = exports.WASI_ENOENT = exports.WASI_ENODEV = exports.WASI_ENOBUFS = exports.WASI_ENFILE = exports.WASI_ENETUNREACH = exports.WASI_ENETRESET = exports.WASI_ENETDOWN = exports.WASI_ENAMETOOLONG = exports.WASI_EMULTIHOP = exports.WASI_EMSGSIZE = exports.WASI_EMLINK = exports.WASI_EMFILE = exports.WASI_ELOOP = exports.WASI_EISDIR = exports.WASI_EISCONN = exports.WASI_EIO = exports.WASI_EINVAL = exports.WASI_EINTR = exports.WASI_EINPROGRESS = exports.WASI_EILSEQ = exports.WASI_EIDRM = exports.WASI_EHOSTUNREACH = exports.WASI_EFBIG = exports.WASI_EFAULT = exports.WASI_EEXIST = exports.WASI_EDQUOT = exports.WASI_EDOM = exports.WASI_EDESTADDRREQ = exports.WASI_EDEADLK = exports.WASI_ECONNRESET = exports.WASI_ECONNREFUSED = exports.WASI_ECONNABORTED = exports.WASI_ECHILD = exports.WASI_ECANCELED = exports.WASI_EBUSY = exports.WASI_EBADMSG = exports.WASI_EBADF = exports.WASI_EALREADY = exports.WASI_EAGAIN = exports.WASI_EAFNOSUPPORT = exports.WASI_EADDRNOTAVAIL = exports.WASI_EADDRINUSE = exports.WASI_EACCES = exports.WASI_E2BIG = exports.WASI_ESUCCESS = void 0, exports.WASI_SIGVTALRM = exports.WASI_SIGUSR2 = exports.WASI_SIGUSR1 = exports.WASI_SIGURG = exports.WASI_SIGTTOU = exports.WASI_SIGTTIN = exports.WASI_SIGTSTP = exports.WASI_SIGTRAP = exports.WASI_SIGTERM = exports.WASI_SIGSTOP = exports.WASI_SIGSEGV = exports.WASI_SIGQUIT = exports.WASI_SIGPIPE = exports.WASI_SIGKILL = exports.WASI_SIGINT = exports.WASI_SIGILL = exports.WASI_SIGHUP = exports.WASI_SIGFPE = exports.WASI_SIGCONT = exports.WASI_SIGCHLD = exports.WASI_SIGBUS = exports.WASI_SIGALRM = exports.WASI_SIGABRT = exports.WASI_ENOTCAPABLE = exports.WASI_EXDEV = exports.WASI_ETXTBSY = exports.WASI_ETIMEDOUT = exports.WASI_ESTALE = exports.WASI_ESRCH = exports.WASI_ESPIPE = exports.WASI_EROFS = exports.WASI_ERANGE = exports.WASI_EPROTOTYPE = exports.WASI_EPROTONOSUPPORT = exports.WASI_EPROTO = exports.WASI_EPIPE = exports.WASI_EPERM = exports.WASI_EOWNERDEAD = exports.WASI_EOVERFLOW = exports.WASI_ENXIO = exports.WASI_ENOTTY = exports.WASI_ENOTSUP = exports.WASI_ENOTSOCK = exports.WASI_ENOTRECOVERABLE = exports.WASI_ENOTEMPTY = exports.WASI_ENOTDIR = exports.WASI_ENOTCONN = exports.WASI_ENOSYS = exports.WASI_ENOSPC = exports.WASI_ENOPROTOOPT = void 0, exports.RIGHTS_REGULAR_FILE_BASE = exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL = exports.WASI_RIGHT_SOCK_SHUTDOWN = exports.WASI_RIGHT_POLL_FD_READWRITE = exports.WASI_RIGHT_PATH_UNLINK_FILE = exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = exports.WASI_RIGHT_PATH_SYMLINK = exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = exports.WASI_RIGHT_FD_FILESTAT_GET = exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = exports.WASI_RIGHT_PATH_FILESTAT_GET = exports.WASI_RIGHT_PATH_RENAME_TARGET = exports.WASI_RIGHT_PATH_RENAME_SOURCE = exports.WASI_RIGHT_PATH_READLINK = exports.WASI_RIGHT_FD_READDIR = exports.WASI_RIGHT_PATH_OPEN = exports.WASI_RIGHT_PATH_LINK_TARGET = exports.WASI_RIGHT_PATH_LINK_SOURCE = exports.WASI_RIGHT_PATH_CREATE_FILE = exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = exports.WASI_RIGHT_FD_ALLOCATE = exports.WASI_RIGHT_FD_ADVISE = exports.WASI_RIGHT_FD_WRITE = exports.WASI_RIGHT_FD_TELL = exports.WASI_RIGHT_FD_SYNC = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = exports.WASI_RIGHT_FD_SEEK = exports.WASI_RIGHT_FD_READ = exports.WASI_RIGHT_FD_DATASYNC = exports.WASI_FDFLAG_SYNC = exports.WASI_FDFLAG_RSYNC = exports.WASI_FDFLAG_NONBLOCK = exports.WASI_FDFLAG_DSYNC = exports.WASI_FDFLAG_APPEND = exports.WASI_FILETYPE_SYMBOLIC_LINK = exports.WASI_FILETYPE_SOCKET_STREAM = exports.WASI_FILETYPE_SOCKET_DGRAM = exports.WASI_FILETYPE_REGULAR_FILE = exports.WASI_FILETYPE_DIRECTORY = exports.WASI_FILETYPE_CHARACTER_DEVICE = exports.WASI_FILETYPE_BLOCK_DEVICE = exports.WASI_FILETYPE_UNKNOWN = exports.WASI_SIGXFSZ = exports.WASI_SIGXCPU = void 0, exports.SIGNAL_MAP = exports.ERROR_MAP = exports.WASI_WHENCE_END = exports.WASI_WHENCE_CUR = exports.WASI_WHENCE_SET = exports.WASI_STDERR_FILENO = exports.WASI_STDOUT_FILENO = exports.WASI_STDIN_FILENO = exports.WASI_DIRCOOKIE_START = exports.WASI_PREOPENTYPE_DIR = exports.WASI_O_TRUNC = exports.WASI_O_EXCL = exports.WASI_O_DIRECTORY = exports.WASI_O_CREAT = exports.WASI_FILESTAT_SET_MTIM_NOW = exports.WASI_FILESTAT_SET_MTIM = exports.WASI_FILESTAT_SET_ATIM_NOW = exports.WASI_FILESTAT_SET_ATIM = exports.WASI_EVENTTYPE_FD_WRITE = exports.WASI_EVENTTYPE_FD_READ = exports.WASI_EVENTTYPE_CLOCK = exports.WASI_CLOCK_THREAD_CPUTIME_ID = exports.WASI_CLOCK_PROCESS_CPUTIME_ID = exports.WASI_CLOCK_MONOTONIC = exports.WASI_CLOCK_REALTIME = exports.RIGHTS_TTY_INHERITING = exports.RIGHTS_TTY_BASE = exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_SOCKET_BASE = exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE = exports.RIGHTS_REGULAR_FILE_INHERITING = void 0, exports.WASI_ESUCCESS = 0, exports.WASI_E2BIG = 1, exports.WASI_EACCES = 2, exports.WASI_EADDRINUSE = 3, exports.WASI_EADDRNOTAVAIL = 4, exports.WASI_EAFNOSUPPORT = 5, exports.WASI_EAGAIN = 6, exports.WASI_EALREADY = 7, exports.WASI_EBADF = 8, exports.WASI_EBADMSG = 9, exports.WASI_EBUSY = 10, exports.WASI_ECANCELED = 11, exports.WASI_ECHILD = 12, exports.WASI_ECONNABORTED = 13, exports.WASI_ECONNREFUSED = 14, exports.WASI_ECONNRESET = 15, exports.WASI_EDEADLK = 16, exports.WASI_EDESTADDRREQ = 17, exports.WASI_EDOM = 18, exports.WASI_EDQUOT = 19, exports.WASI_EEXIST = 20, exports.WASI_EFAULT = 21, exports.WASI_EFBIG = 22, exports.WASI_EHOSTUNREACH = 23, exports.WASI_EIDRM = 24, exports.WASI_EILSEQ = 25, exports.WASI_EINPROGRESS = 26, exports.WASI_EINTR = 27, exports.WASI_EINVAL = 28, exports.WASI_EIO = 29, exports.WASI_EISCONN = 30, exports.WASI_EISDIR = 31, exports.WASI_ELOOP = 32, exports.WASI_EMFILE = 33, exports.WASI_EMLINK = 34, exports.WASI_EMSGSIZE = 35, exports.WASI_EMULTIHOP = 36, exports.WASI_ENAMETOOLONG = 37, exports.WASI_ENETDOWN = 38, exports.WASI_ENETRESET = 39, exports.WASI_ENETUNREACH = 40, exports.WASI_ENFILE = 41, exports.WASI_ENOBUFS = 42, exports.WASI_ENODEV = 43, exports.WASI_ENOENT = 44, exports.WASI_ENOEXEC = 45, exports.WASI_ENOLCK = 46, exports.WASI_ENOLINK = 47, exports.WASI_ENOMEM = 48, exports.WASI_ENOMSG = 49, exports.WASI_ENOPROTOOPT = 50, exports.WASI_ENOSPC = 51, exports.WASI_ENOSYS = 52, exports.WASI_ENOTCONN = 53, exports.WASI_ENOTDIR = 54, exports.WASI_ENOTEMPTY = 55, exports.WASI_ENOTRECOVERABLE = 56, exports.WASI_ENOTSOCK = 57, exports.WASI_ENOTSUP = 58, exports.WASI_ENOTTY = 59, exports.WASI_ENXIO = 60, exports.WASI_EOVERFLOW = 61, exports.WASI_EOWNERDEAD = 62, exports.WASI_EPERM = 63, exports.WASI_EPIPE = 64, exports.WASI_EPROTO = 65, exports.WASI_EPROTONOSUPPORT = 66, exports.WASI_EPROTOTYPE = 67, exports.WASI_ERANGE = 68, exports.WASI_EROFS = 69, exports.WASI_ESPIPE = 70, exports.WASI_ESRCH = 71, exports.WASI_ESTALE = 72, exports.WASI_ETIMEDOUT = 73, exports.WASI_ETXTBSY = 74, exports.WASI_EXDEV = 75, exports.WASI_ENOTCAPABLE = 76, exports.WASI_SIGABRT = 0, exports.WASI_SIGALRM = 1, exports.WASI_SIGBUS = 2, exports.WASI_SIGCHLD = 3, exports.WASI_SIGCONT = 4, exports.WASI_SIGFPE = 5, exports.WASI_SIGHUP = 6, exports.WASI_SIGILL = 7, exports.WASI_SIGINT = 8, exports.WASI_SIGKILL = 9, exports.WASI_SIGPIPE = 10, exports.WASI_SIGQUIT = 11, exports.WASI_SIGSEGV = 12, exports.WASI_SIGSTOP = 13, exports.WASI_SIGTERM = 14, exports.WASI_SIGTRAP = 15, exports.WASI_SIGTSTP = 16, exports.WASI_SIGTTIN = 17, exports.WASI_SIGTTOU = 18, exports.WASI_SIGURG = 19, exports.WASI_SIGUSR1 = 20, exports.WASI_SIGUSR2 = 21, exports.WASI_SIGVTALRM = 22, exports.WASI_SIGXCPU = 23, exports.WASI_SIGXFSZ = 24, exports.WASI_FILETYPE_UNKNOWN = 0, exports.WASI_FILETYPE_BLOCK_DEVICE = 1, exports.WASI_FILETYPE_CHARACTER_DEVICE = 2, exports.WASI_FILETYPE_DIRECTORY = 3, exports.WASI_FILETYPE_REGULAR_FILE = 4, exports.WASI_FILETYPE_SOCKET_DGRAM = 5, exports.WASI_FILETYPE_SOCKET_STREAM = 6, exports.WASI_FILETYPE_SYMBOLIC_LINK = 7, exports.WASI_FDFLAG_APPEND = 1, exports.WASI_FDFLAG_DSYNC = 2, exports.WASI_FDFLAG_NONBLOCK = 4, exports.WASI_FDFLAG_RSYNC = 8, exports.WASI_FDFLAG_SYNC = 16, exports.WASI_RIGHT_FD_DATASYNC = BigInt(1), exports.WASI_RIGHT_FD_READ = BigInt(2), exports.WASI_RIGHT_FD_SEEK = BigInt(4), exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = BigInt(8), exports.WASI_RIGHT_FD_SYNC = BigInt(16), exports.WASI_RIGHT_FD_TELL = BigInt(32), exports.WASI_RIGHT_FD_WRITE = BigInt(64), exports.WASI_RIGHT_FD_ADVISE = BigInt(128), exports.WASI_RIGHT_FD_ALLOCATE = BigInt(256), exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = BigInt(512), exports.WASI_RIGHT_PATH_CREATE_FILE = BigInt(1024), exports.WASI_RIGHT_PATH_LINK_SOURCE = BigInt(2048), exports.WASI_RIGHT_PATH_LINK_TARGET = BigInt(4096), exports.WASI_RIGHT_PATH_OPEN = BigInt(8192), exports.WASI_RIGHT_FD_READDIR = BigInt(16384), exports.WASI_RIGHT_PATH_READLINK = BigInt(32768), exports.WASI_RIGHT_PATH_RENAME_SOURCE = BigInt(65536), exports.WASI_RIGHT_PATH_RENAME_TARGET = BigInt(131072), exports.WASI_RIGHT_PATH_FILESTAT_GET = BigInt(262144), exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = BigInt(524288), exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = BigInt(1048576), exports.WASI_RIGHT_FD_FILESTAT_GET = BigInt(2097152), exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = BigInt(4194304), exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = BigInt(8388608), exports.WASI_RIGHT_PATH_SYMLINK = BigInt(16777216), exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = BigInt(33554432), exports.WASI_RIGHT_PATH_UNLINK_FILE = BigInt(67108864), exports.WASI_RIGHT_POLL_FD_READWRITE = BigInt(134217728), exports.WASI_RIGHT_SOCK_SHUTDOWN = BigInt(268435456), exports.RIGHTS_ALL = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_REGULAR_FILE_BASE = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_REGULAR_FILE_INHERITING = BigInt(0), exports.RIGHTS_DIRECTORY_BASE = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE | exports.RIGHTS_REGULAR_FILE_BASE, exports.RIGHTS_SOCKET_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_TTY_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_TTY_INHERITING = BigInt(0), exports.WASI_CLOCK_REALTIME = 0, exports.WASI_CLOCK_MONOTONIC = 1, exports.WASI_CLOCK_PROCESS_CPUTIME_ID = 2, exports.WASI_CLOCK_THREAD_CPUTIME_ID = 3, exports.WASI_EVENTTYPE_CLOCK = 0, exports.WASI_EVENTTYPE_FD_READ = 1, exports.WASI_EVENTTYPE_FD_WRITE = 2, exports.WASI_FILESTAT_SET_ATIM = 1 << 0, exports.WASI_FILESTAT_SET_ATIM_NOW = 1 << 1, exports.WASI_FILESTAT_SET_MTIM = 1 << 2, exports.WASI_FILESTAT_SET_MTIM_NOW = 1 << 3, exports.WASI_O_CREAT = 1 << 0, exports.WASI_O_DIRECTORY = 1 << 1, exports.WASI_O_EXCL = 1 << 2, exports.WASI_O_TRUNC = 1 << 3, exports.WASI_PREOPENTYPE_DIR = 0, exports.WASI_DIRCOOKIE_START = 0, exports.WASI_STDIN_FILENO = 0, exports.WASI_STDOUT_FILENO = 1, exports.WASI_STDERR_FILENO = 2, exports.WASI_WHENCE_SET = 0, exports.WASI_WHENCE_CUR = 1, exports.WASI_WHENCE_END = 2, exports.ERROR_MAP = {\n E2BIG: exports.WASI_E2BIG,\n EACCES: exports.WASI_EACCES,\n EADDRINUSE: exports.WASI_EADDRINUSE,\n EADDRNOTAVAIL: exports.WASI_EADDRNOTAVAIL,\n EAFNOSUPPORT: exports.WASI_EAFNOSUPPORT,\n EALREADY: exports.WASI_EALREADY,\n EAGAIN: exports.WASI_EAGAIN,\n EBADF: exports.WASI_EBADF,\n EBADMSG: exports.WASI_EBADMSG,\n EBUSY: exports.WASI_EBUSY,\n ECANCELED: exports.WASI_ECANCELED,\n ECHILD: exports.WASI_ECHILD,\n ECONNABORTED: exports.WASI_ECONNABORTED,\n ECONNREFUSED: exports.WASI_ECONNREFUSED,\n ECONNRESET: exports.WASI_ECONNRESET,\n EDEADLOCK: exports.WASI_EDEADLK,\n EDESTADDRREQ: exports.WASI_EDESTADDRREQ,\n EDOM: exports.WASI_EDOM,\n EDQUOT: exports.WASI_EDQUOT,\n EEXIST: exports.WASI_EEXIST,\n EFAULT: exports.WASI_EFAULT,\n EFBIG: exports.WASI_EFBIG,\n EHOSTDOWN: exports.WASI_EHOSTUNREACH,\n EHOSTUNREACH: exports.WASI_EHOSTUNREACH,\n EIDRM: exports.WASI_EIDRM,\n EILSEQ: exports.WASI_EILSEQ,\n EINPROGRESS: exports.WASI_EINPROGRESS,\n EINTR: exports.WASI_EINTR,\n EINVAL: exports.WASI_EINVAL,\n EIO: exports.WASI_EIO,\n EISCONN: exports.WASI_EISCONN,\n EISDIR: exports.WASI_EISDIR,\n ELOOP: exports.WASI_ELOOP,\n EMFILE: exports.WASI_EMFILE,\n EMLINK: exports.WASI_EMLINK,\n EMSGSIZE: exports.WASI_EMSGSIZE,\n EMULTIHOP: exports.WASI_EMULTIHOP,\n ENAMETOOLONG: exports.WASI_ENAMETOOLONG,\n ENETDOWN: exports.WASI_ENETDOWN,\n ENETRESET: exports.WASI_ENETRESET,\n ENETUNREACH: exports.WASI_ENETUNREACH,\n ENFILE: exports.WASI_ENFILE,\n ENOBUFS: exports.WASI_ENOBUFS,\n ENODEV: exports.WASI_ENODEV,\n ENOENT: exports.WASI_ENOENT,\n ENOEXEC: exports.WASI_ENOEXEC,\n ENOLCK: exports.WASI_ENOLCK,\n ENOLINK: exports.WASI_ENOLINK,\n ENOMEM: exports.WASI_ENOMEM,\n ENOMSG: exports.WASI_ENOMSG,\n ENOPROTOOPT: exports.WASI_ENOPROTOOPT,\n ENOSPC: exports.WASI_ENOSPC,\n ENOSYS: exports.WASI_ENOSYS,\n ENOTCONN: exports.WASI_ENOTCONN,\n ENOTDIR: exports.WASI_ENOTDIR,\n ENOTEMPTY: exports.WASI_ENOTEMPTY,\n ENOTRECOVERABLE: exports.WASI_ENOTRECOVERABLE,\n ENOTSOCK: exports.WASI_ENOTSOCK,\n ENOTTY: exports.WASI_ENOTTY,\n ENXIO: exports.WASI_ENXIO,\n EOVERFLOW: exports.WASI_EOVERFLOW,\n EOWNERDEAD: exports.WASI_EOWNERDEAD,\n EPERM: exports.WASI_EPERM,\n EPIPE: exports.WASI_EPIPE,\n EPROTO: exports.WASI_EPROTO,\n EPROTONOSUPPORT: exports.WASI_EPROTONOSUPPORT,\n EPROTOTYPE: exports.WASI_EPROTOTYPE,\n ERANGE: exports.WASI_ERANGE,\n EROFS: exports.WASI_EROFS,\n ESPIPE: exports.WASI_ESPIPE,\n ESRCH: exports.WASI_ESRCH,\n ESTALE: exports.WASI_ESTALE,\n ETIMEDOUT: exports.WASI_ETIMEDOUT,\n ETXTBSY: exports.WASI_ETXTBSY,\n EXDEV: exports.WASI_EXDEV\n }, exports.SIGNAL_MAP = {\n [exports.WASI_SIGHUP]: \"SIGHUP\",\n [exports.WASI_SIGINT]: \"SIGINT\",\n [exports.WASI_SIGQUIT]: \"SIGQUIT\",\n [exports.WASI_SIGILL]: \"SIGILL\",\n [exports.WASI_SIGTRAP]: \"SIGTRAP\",\n [exports.WASI_SIGABRT]: \"SIGABRT\",\n [exports.WASI_SIGBUS]: \"SIGBUS\",\n [exports.WASI_SIGFPE]: \"SIGFPE\",\n [exports.WASI_SIGKILL]: \"SIGKILL\",\n [exports.WASI_SIGUSR1]: \"SIGUSR1\",\n [exports.WASI_SIGSEGV]: \"SIGSEGV\",\n [exports.WASI_SIGUSR2]: \"SIGUSR2\",\n [exports.WASI_SIGPIPE]: \"SIGPIPE\",\n [exports.WASI_SIGALRM]: \"SIGALRM\",\n [exports.WASI_SIGTERM]: \"SIGTERM\",\n [exports.WASI_SIGCHLD]: \"SIGCHLD\",\n [exports.WASI_SIGCONT]: \"SIGCONT\",\n [exports.WASI_SIGSTOP]: \"SIGSTOP\",\n [exports.WASI_SIGTSTP]: \"SIGTSTP\",\n [exports.WASI_SIGTTIN]: \"SIGTTIN\",\n [exports.WASI_SIGTTOU]: \"SIGTTOU\",\n [exports.WASI_SIGURG]: \"SIGURG\",\n [exports.WASI_SIGXCPU]: \"SIGXCPU\",\n [exports.WASI_SIGXFSZ]: \"SIGXFSZ\",\n [exports.WASI_SIGVTALRM]: \"SIGVTALRM\"\n };\n }\n}), require_wasi = __commonJS({\n \"node_modules/wasi-js/dist/wasi.js\"(exports) {\n var __importDefault = exports && exports.__importDefault || function(mod) {\n return mod && mod.__esModule \? mod : { default: mod };\n };\n let fs;\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.SOCKET_DEFAULT_RIGHTS = void 0;\n var log = () => {\n }, logOpen = () => {\n }, SC_OPEN_MAX = 32768, types_1 = require_types(), constants_1 = require_constants(), STDIN_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDOUT_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDERR_DEFAULT_RIGHTS = STDOUT_DEFAULT_RIGHTS;\n exports.SOCKET_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE | constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS;\n var msToNs = (ms) => {\n const msInt = Math.trunc(ms), decimal = BigInt(Math.round((ms - msInt) * 1e6));\n return BigInt(msInt) * BigInt(1e6) + decimal;\n }, nsToMs = (ns) => {\n if (typeof ns === \"number\")\n ns = Math.trunc(ns);\n const nsInt = BigInt(ns);\n return Number(nsInt / BigInt(1e6));\n }, wrap = (f) => (...args) => {\n try {\n return f(...args);\n } catch (err) {\n let e = err;\n while (e.prev != null)\n e = e.prev;\n if (e\?.code && typeof e\?.code === \"string\")\n return constants_1.ERROR_MAP[e.code] || constants_1.WASI_EINVAL;\n if (e instanceof types_1.WASIError)\n return e.errno;\n throw e;\n }\n }, stat = (wasi, fd) => {\n const entry = wasi.FD_MAP.get(fd);\n if (!entry)\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n if (entry.filetype === void 0) {\n const stats = wasi.fstatSync(entry.real), { filetype, rightsBase, rightsInheriting } = translateFileAttributes(wasi, fd, stats);\n if (entry.filetype = filetype, !entry.rights)\n entry.rights = {\n base: rightsBase,\n inheriting: rightsInheriting\n };\n }\n return entry;\n }, translateFileAttributes = (wasi, fd, stats) => {\n switch (!0) {\n case stats.isBlockDevice():\n return {\n filetype: constants_1.WASI_FILETYPE_BLOCK_DEVICE,\n rightsBase: constants_1.RIGHTS_BLOCK_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_BLOCK_DEVICE_INHERITING\n };\n case stats.isCharacterDevice(): {\n const filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n if (fd !== void 0 && wasi.bindings.isTTY(fd))\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_TTY_BASE,\n rightsInheriting: constants_1.RIGHTS_TTY_INHERITING\n };\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_CHARACTER_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_CHARACTER_DEVICE_INHERITING\n };\n }\n case stats.isDirectory():\n return {\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rightsBase: constants_1.RIGHTS_DIRECTORY_BASE,\n rightsInheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n };\n case stats.isFIFO():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isFile():\n return {\n filetype: constants_1.WASI_FILETYPE_REGULAR_FILE,\n rightsBase: constants_1.RIGHTS_REGULAR_FILE_BASE,\n rightsInheriting: constants_1.RIGHTS_REGULAR_FILE_INHERITING\n };\n case stats.isSocket():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isSymbolicLink():\n return {\n filetype: constants_1.WASI_FILETYPE_SYMBOLIC_LINK,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n default:\n return {\n filetype: constants_1.WASI_FILETYPE_UNKNOWN,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n }\n }, warnedAboutSleep = !1, defaultConfig;\n function getDefaults() {\n if (defaultConfig)\n return defaultConfig;\n const defaultBindings = {\n hrtime: () => process.hrtime.bigint(),\n exit: (code) => {\n process.exit(code);\n },\n kill: (signal) => {\n process.kill(process.pid, signal);\n },\n randomFillSync: (array) => crypto.getRandomValues(array),\n isTTY: (fd) => (@getInternalField(@internalModuleRegistry, 46) || @createInternalModuleById(46)).isatty(fd),\n fs: Bun.fs(),\n path: @getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30)\n };\n return defaultConfig = {\n args: [],\n env: {},\n preopens: {},\n bindings: defaultBindings,\n sleep: (ms) => {\n Bun.sleepSync(ms);\n }\n };\n }\n var WASI = class WASI2 {\n constructor(wasiConfig = {}) {\n const defaultConfig2 = getDefaults();\n this.lastStdin = 0, this.sleep = wasiConfig.sleep || defaultConfig2.sleep, this.getStdin = wasiConfig.getStdin, this.sendStdout = wasiConfig.sendStdout, this.sendStderr = wasiConfig.sendStderr;\n let preopens = wasiConfig.preopens \?\? defaultConfig2.preopens;\n this.env = wasiConfig.env \?\? defaultConfig2.env;\n const args = wasiConfig.args \?\? defaultConfig2.args;\n this.memory = void 0, this.view = void 0, this.bindings = wasiConfig.bindings || defaultConfig2.bindings;\n const bindings2 = this.bindings;\n fs = bindings2.fs, this.FD_MAP = new Map([\n [\n constants_1.WASI_STDIN_FILENO,\n {\n real: 0,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdin\"\n }\n ],\n [\n constants_1.WASI_STDOUT_FILENO,\n {\n real: 1,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDOUT_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdout\"\n }\n ],\n [\n constants_1.WASI_STDERR_FILENO,\n {\n real: 2,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDERR_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stderr\"\n }\n ]\n ]);\n const path = bindings2.path;\n for (let [k, v] of Object.entries(preopens)) {\n const real = fs.openSync(v, nodeFsConstants.O_RDONLY), newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real,\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rights: {\n base: constants_1.RIGHTS_DIRECTORY_BASE,\n inheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n },\n fakePath: k,\n path: v\n });\n }\n const getiovs = (iovs, iovsLen) => {\n this.refreshMemory();\n const { view, memory } = this, { buffer } = memory, { byteLength } = buffer;\n if (iovsLen === 1) {\n const ptr = iovs, buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n return [new @Uint8Array(buffer, buf, bufLen)];\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n const buffers = [];\n buffers.length = iovsLen;\n for (let i = 0, ptr = iovs;i < iovsLen; i++, ptr += 8) {\n const buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n buffers[i] = new @Uint8Array(buffer, buf, bufLen);\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n return buffers;\n }, CHECK_FD = (fd, rights) => {\n const stats = stat(this, fd);\n if (rights !== BigInt(0) && (stats.rights.base & rights) === BigInt(0))\n throw new types_1.WASIError(constants_1.WASI_EPERM);\n return stats;\n }, CPUTIME_START = Bun.nanoseconds(), timeOrigin = Math.trunc(performance.timeOrigin * 1e6), now = (clockId) => {\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n return Bun.nanoseconds();\n case constants_1.WASI_CLOCK_REALTIME:\n return Bun.nanoseconds() + timeOrigin;\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID:\n return Bun.nanoseconds() - CPUTIME_START;\n default:\n return null;\n }\n };\n if (this.wasiImport = {\n args_get: (argv, argvBuf) => {\n this.refreshMemory();\n let coffset = argv, offset = argvBuf;\n return args.forEach((a) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += @Buffer.from(this.memory.buffer).write(`${a}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n args_sizes_get: (argc, argvBufSize) => {\n this.refreshMemory(), this.view.setUint32(argc, args.length, !0);\n const size = args.reduce((acc, a) => acc + @Buffer.byteLength(a) + 1, 0);\n return this.view.setUint32(argvBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n environ_get: (environ, environBuf) => {\n this.refreshMemory();\n let coffset = environ, offset = environBuf;\n return Object.entries(this.env).forEach(([key, value]) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += @Buffer.from(this.memory.buffer).write(`${key}=${value}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n environ_sizes_get: (environCount, environBufSize) => {\n this.refreshMemory();\n const envProcessed = Object.entries(this.env).map(([key, value]) => `${key}=${value}\\0`), size = envProcessed.reduce((acc, e) => acc + @Buffer.byteLength(e), 0);\n return this.view.setUint32(environCount, envProcessed.length, !0), this.view.setUint32(environBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n clock_res_get: (clockId, resolution) => {\n let res;\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID: {\n res = BigInt(1);\n break;\n }\n case constants_1.WASI_CLOCK_REALTIME: {\n res = BigInt(1000);\n break;\n }\n }\n if (!res)\n throw Error(\"invalid clockId\");\n return this.view.setBigUint64(resolution, res), constants_1.WASI_ESUCCESS;\n },\n clock_time_get: (clockId, _precision, time) => {\n this.refreshMemory();\n const n = now(clockId);\n if (n === null)\n return constants_1.WASI_EINVAL;\n return this.view.setBigUint64(time, BigInt(n), !0), constants_1.WASI_ESUCCESS;\n },\n fd_advise: wrap((fd, _offset, _len, _advice) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ADVISE), constants_1.WASI_ENOSYS;\n }),\n fd_allocate: wrap((fd, _offset, _len) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ALLOCATE), constants_1.WASI_ENOSYS;\n }),\n fd_close: wrap((fd) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return fs.closeSync(stats.real), this.FD_MAP.delete(fd), constants_1.WASI_ESUCCESS;\n }),\n fd_datasync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_DATASYNC);\n return fs.fdatasyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if (this.refreshMemory(), stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), this.view.setUint16(bufPtr + 2, 0, !0), this.view.setUint16(bufPtr + 4, 0, !0), this.view.setBigUint64(bufPtr + 8, BigInt(stats.rights.base), !0), this.view.setBigUint64(bufPtr + 8 + 8, BigInt(stats.rights.inheriting), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_set_flags: wrap((fd, flags) => {\n if (CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS), this.wasiImport.sock_fcntlSetFlags(fd, flags) == 0)\n return constants_1.WASI_ESUCCESS;\n return constants_1.WASI_ENOSYS;\n }),\n fd_fdstat_set_rights: wrap((fd, fsRightsBase, fsRightsInheriting) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if ((stats.rights.base | fsRightsBase) > stats.rights.base)\n return constants_1.WASI_EPERM;\n if ((stats.rights.inheriting | fsRightsInheriting) > stats.rights.inheriting)\n return constants_1.WASI_EPERM;\n return stats.rights.base = fsRightsBase, stats.rights.inheriting = fsRightsInheriting, constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_GET), rstats = this.fstatSync(stats.real);\n if (this.refreshMemory(), this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.atimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.mtimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.ctimeMs), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_size: wrap((fd, stSize) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE);\n return fs.ftruncateSync(stats.real, Number(stSize)), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_times: wrap((fd, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_TIMES), rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n return fs.futimesSync(stats.real, new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), this.view.setUint8(bufPtr, constants_1.WASI_PREOPENTYPE_DIR), this.view.setUint32(bufPtr + 4, @Buffer.byteLength(stats.fakePath \?\? stats.path \?\? \"\"), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_dir_name: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), @Buffer.from(this.memory.buffer).write(stats.fakePath \?\? stats.path \?\? \"\", pathPtr, pathLen, \"utf8\"), constants_1.WASI_ESUCCESS;\n }),\n fd_pwrite: wrap((fd, iovs, iovsLen, offset, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SEEK);\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n let w = 0;\n while (w < iov.byteLength)\n w += fs.writeSync(stats.real, iov, w, iov.byteLength - w, Number(offset) + written + w);\n written += w;\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_write: wrap((fd, iovs, iovsLen, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE), IS_STDOUT = fd == constants_1.WASI_STDOUT_FILENO, IS_STDERR = fd == constants_1.WASI_STDERR_FILENO;\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n if (iov.byteLength == 0)\n return;\n if (IS_STDOUT && this.sendStdout != null)\n this.sendStdout(iov), written += iov.byteLength;\n else if (IS_STDERR && this.sendStderr != null)\n this.sendStderr(iov), written += iov.byteLength;\n else {\n let w = 0;\n while (w < iov.byteLength) {\n const i = fs.writeSync(stats.real, iov, w, iov.byteLength - w, stats.offset \? Number(stats.offset) : null);\n if (stats.offset)\n stats.offset += BigInt(i);\n w += i;\n }\n written += w;\n }\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_pread: wrap((fd, iovs, iovsLen, offset, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SEEK);\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n const length = iov.byteLength - r, rr = fs.readSync(stats.real, iov, r, iov.byteLength - r, Number(offset) + read + r);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n read += r;\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_read: wrap((fd, iovs, iovsLen, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ), IS_STDIN = fd == constants_1.WASI_STDIN_FILENO;\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n let length = iov.byteLength - r, position = IS_STDIN || stats.offset === void 0 \? null : Number(stats.offset), rr = 0;\n if (IS_STDIN)\n if (this.getStdin != null) {\n if (this.stdinBuffer == null)\n this.stdinBuffer = this.getStdin();\n if (this.stdinBuffer != null) {\n if (rr = this.stdinBuffer.copy(iov), rr == this.stdinBuffer.length)\n this.stdinBuffer = void 0;\n else\n this.stdinBuffer = this.stdinBuffer.slice(rr);\n if (rr > 0)\n this.lastStdin = (new Date()).valueOf();\n }\n } else {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(cpu waiting for stdin: please define a way to sleep!) \");\n try {\n rr = fs.readSync(stats.real, iov, r, length, position);\n } catch (_err) {\n }\n if (rr == 0)\n this.shortPause();\n else\n this.lastStdin = (new Date()).valueOf();\n }\n else\n rr = fs.readSync(stats.real, iov, r, length, position);\n if (stats.filetype == constants_1.WASI_FILETYPE_REGULAR_FILE)\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(rr);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_readdir: wrap((fd, bufPtr, bufLen, cookie, bufusedPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READDIR);\n this.refreshMemory();\n const entries = fs.readdirSync(stats.path, { withFileTypes: !0 }), startPtr = bufPtr;\n for (let i = Number(cookie);i < entries.length; i += 1) {\n const entry = entries[i];\n let nameLength = @Buffer.byteLength(entry.name);\n if (bufPtr - startPtr > bufLen)\n break;\n if (this.view.setBigUint64(bufPtr, BigInt(i + 1), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n const rstats = fs.lstatSync(path.resolve(stats.path, entry.name));\n if (this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n if (this.view.setUint32(bufPtr, nameLength, !0), bufPtr += 4, bufPtr - startPtr > bufLen)\n break;\n let filetype;\n switch (!0) {\n case rstats.isBlockDevice():\n filetype = constants_1.WASI_FILETYPE_BLOCK_DEVICE;\n break;\n case rstats.isCharacterDevice():\n filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n break;\n case rstats.isDirectory():\n filetype = constants_1.WASI_FILETYPE_DIRECTORY;\n break;\n case rstats.isFIFO():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isFile():\n filetype = constants_1.WASI_FILETYPE_REGULAR_FILE;\n break;\n case rstats.isSocket():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isSymbolicLink():\n filetype = constants_1.WASI_FILETYPE_SYMBOLIC_LINK;\n break;\n default:\n filetype = constants_1.WASI_FILETYPE_UNKNOWN;\n break;\n }\n if (this.view.setUint8(bufPtr, filetype), bufPtr += 1, bufPtr += 3, bufPtr + nameLength >= startPtr + bufLen)\n break;\n @Buffer.from(this.memory.buffer).write(entry.name, bufPtr), bufPtr += nameLength;\n }\n const bufused = bufPtr - startPtr;\n return this.view.setUint32(bufusedPtr, Math.min(bufused, bufLen), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_renumber: wrap((from, to) => {\n return CHECK_FD(from, BigInt(0)), CHECK_FD(to, BigInt(0)), fs.closeSync(this.FD_MAP.get(from).real), this.FD_MAP.set(from, this.FD_MAP.get(to)), this.FD_MAP.delete(to), constants_1.WASI_ESUCCESS;\n }),\n fd_seek: wrap((fd, offset, whence, newOffsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SEEK);\n switch (this.refreshMemory(), whence) {\n case constants_1.WASI_WHENCE_CUR:\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_END:\n const { size } = this.fstatSync(stats.real);\n stats.offset = BigInt(size) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_SET:\n stats.offset = BigInt(offset);\n break;\n }\n if (stats.offset == null)\n throw Error(\"stats.offset must be defined\");\n return this.view.setBigUint64(newOffsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_tell: wrap((fd, offsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_TELL);\n if (this.refreshMemory(), !stats.offset)\n stats.offset = BigInt(0);\n return this.view.setBigUint64(offsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_sync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SYNC);\n return fs.fsyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n path_create_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_CREATE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.mkdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_get: wrap((fd, flags, pathPtr, pathLen, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_GET);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n let rstats;\n if (flags)\n rstats = fs.statSync(path.resolve(stats.path, p));\n else\n rstats = fs.lstatSync(path.resolve(stats.path, p));\n return this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, this.view.setUint8(bufPtr, translateFileAttributes(this, void 0, rstats).filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.atime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.mtime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ctime.getTime() * 1e6), !0), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_set_times: wrap((fd, _dirflags, pathPtr, pathLen, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.utimesSync(path.resolve(stats.path, p), new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n path_link: wrap((oldFd, _oldFlags, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_LINK_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_LINK_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = @Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = @Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.linkSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_open: wrap((dirfd, _dirflags, pathPtr, pathLen, oflags, fsRightsBase, fsRightsInheriting, fsFlags, fdPtr) => {\n try {\n const stats = CHECK_FD(dirfd, constants_1.WASI_RIGHT_PATH_OPEN);\n fsRightsBase = BigInt(fsRightsBase), fsRightsInheriting = BigInt(fsRightsInheriting);\n const read = (fsRightsBase & (constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_READDIR)) !== BigInt(0), write = (fsRightsBase & (constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ALLOCATE | constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE)) !== BigInt(0);\n let noflags;\n if (write && read)\n noflags = nodeFsConstants.O_RDWR;\n else if (read)\n noflags = nodeFsConstants.O_RDONLY;\n else if (write)\n noflags = nodeFsConstants.O_WRONLY;\n let neededBase = fsRightsBase | constants_1.WASI_RIGHT_PATH_OPEN, neededInheriting = fsRightsBase | fsRightsInheriting;\n if ((oflags & constants_1.WASI_O_CREAT) !== 0)\n noflags |= nodeFsConstants.O_CREAT, neededBase |= constants_1.WASI_RIGHT_PATH_CREATE_FILE;\n if ((oflags & constants_1.WASI_O_DIRECTORY) !== 0)\n noflags |= nodeFsConstants.O_DIRECTORY;\n if ((oflags & constants_1.WASI_O_EXCL) !== 0)\n noflags |= nodeFsConstants.O_EXCL;\n if ((oflags & constants_1.WASI_O_TRUNC) !== 0)\n noflags |= nodeFsConstants.O_TRUNC, neededBase |= constants_1.WASI_RIGHT_PATH_FILESTAT_SET_SIZE;\n if ((fsFlags & constants_1.WASI_FDFLAG_APPEND) !== 0)\n noflags |= nodeFsConstants.O_APPEND;\n if ((fsFlags & constants_1.WASI_FDFLAG_DSYNC) !== 0) {\n if (nodeFsConstants.O_DSYNC)\n noflags |= nodeFsConstants.O_DSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_DATASYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_NONBLOCK) !== 0)\n noflags |= nodeFsConstants.O_NONBLOCK;\n if ((fsFlags & constants_1.WASI_FDFLAG_RSYNC) !== 0) {\n if (nodeFsConstants.O_RSYNC)\n noflags |= nodeFsConstants.O_RSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_SYNC) !== 0)\n noflags |= nodeFsConstants.O_SYNC, neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n if (write && (noflags & (nodeFsConstants.O_APPEND | nodeFsConstants.O_TRUNC)) === 0)\n neededInheriting |= constants_1.WASI_RIGHT_FD_SEEK;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n if (p == \"dev/tty\")\n return this.view.setUint32(fdPtr, constants_1.WASI_STDIN_FILENO, !0), constants_1.WASI_ESUCCESS;\n if (logOpen(\"path_open\", p), p.startsWith(\"proc/\"))\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n const fullUnresolved = path.resolve(p);\n let full;\n try {\n full = fs.realpathSync(fullUnresolved);\n } catch (e) {\n if (e\?.code === \"ENOENT\")\n full = fullUnresolved;\n else\n throw e;\n }\n let isDirectory;\n if (write)\n try {\n isDirectory = fs.statSync(full).isDirectory();\n } catch (_err) {\n }\n let realfd;\n if (!write && isDirectory)\n realfd = fs.openSync(full, nodeFsConstants.O_RDONLY);\n else\n realfd = fs.openSync(full, noflags);\n const newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real: realfd,\n filetype: void 0,\n rights: {\n base: neededBase,\n inheriting: neededInheriting\n },\n path: full\n }), stat(this, newfd), this.view.setUint32(fdPtr, newfd, !0);\n } catch (e) {\n console.error(e);\n }\n return constants_1.WASI_ESUCCESS;\n }),\n path_readlink: wrap((fd, pathPtr, pathLen, buf, bufLen, bufused) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_READLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString(), full = path.resolve(stats.path, p), r = fs.readlinkSync(full), used = @Buffer.from(this.memory.buffer).write(r, buf, bufLen);\n return this.view.setUint32(bufused, used, !0), constants_1.WASI_ESUCCESS;\n }),\n path_remove_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_REMOVE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.rmdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_rename: wrap((oldFd, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_RENAME_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_RENAME_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = @Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = @Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.renameSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_symlink: wrap((oldPath, oldPathLen, fd, newPath, newPathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_SYMLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = @Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = @Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.symlinkSync(op, path.resolve(stats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_unlink_file: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_UNLINK_FILE);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.unlinkSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n poll_oneoff: (sin, sout, nsubscriptions, neventsPtr) => {\n let nevents = 0, name = \"\", waitTimeNs = BigInt(0), fd = -1, fd_type = \"read\", fd_timeout_ms = 0;\n const startNs = BigInt(bindings2.hrtime());\n this.refreshMemory();\n let last_sin = sin;\n for (let i = 0;i < nsubscriptions; i += 1) {\n const userdata = this.view.getBigUint64(sin, !0);\n sin += 8;\n const type = this.view.getUint8(sin);\n if (sin += 1, sin += 7, log.enabled) {\n if (type == constants_1.WASI_EVENTTYPE_CLOCK)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_CLOCK): \";\n else if (type == constants_1.WASI_EVENTTYPE_FD_READ)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_READ): \";\n else\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_WRITE): \";\n log(name);\n }\n switch (type) {\n case constants_1.WASI_EVENTTYPE_CLOCK: {\n const clockid = this.view.getUint32(sin, !0);\n sin += 4, sin += 4;\n const timeout = this.view.getBigUint64(sin, !0);\n sin += 8, sin += 8;\n const subclockflags = this.view.getUint16(sin, !0);\n sin += 2, sin += 6;\n const absolute = subclockflags === 1;\n if (log.enabled)\n log(name, { clockid, timeout, absolute });\n if (!absolute)\n fd_timeout_ms = timeout / BigInt(1e6);\n let e = constants_1.WASI_ESUCCESS;\n const t = now(clockid);\n if (t == null)\n e = constants_1.WASI_EINVAL;\n else {\n const tNS = BigInt(t), waitNs = (absolute \? timeout : tNS + timeout) - tNS;\n if (waitNs > waitTimeNs)\n waitTimeNs = waitNs;\n }\n this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, e, !0), sout += 2, this.view.setUint8(sout, constants_1.WASI_EVENTTYPE_CLOCK), sout += 1, sout += 5, nevents += 1;\n break;\n }\n case constants_1.WASI_EVENTTYPE_FD_READ:\n case constants_1.WASI_EVENTTYPE_FD_WRITE: {\n if (fd = this.view.getUint32(sin, !0), fd_type = type == constants_1.WASI_EVENTTYPE_FD_READ \? \"read\" : \"write\", sin += 4, log(name, \"fd =\", fd), sin += 28, this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, constants_1.WASI_ENOSYS, !0), sout += 2, this.view.setUint8(sout, type), sout += 1, sout += 5, nevents += 1, fd == constants_1.WASI_STDIN_FILENO && constants_1.WASI_EVENTTYPE_FD_READ == type)\n this.shortPause();\n break;\n }\n default:\n return constants_1.WASI_EINVAL;\n }\n if (sin - last_sin != 48)\n console.warn(\"*** BUG in wasi-js in poll_oneoff \", {\n i,\n sin,\n last_sin,\n diff: sin - last_sin\n });\n last_sin = sin;\n }\n if (this.view.setUint32(neventsPtr, nevents, !0), nevents == 2 && fd >= 0) {\n const r = this.wasiImport.sock_pollSocket(fd, fd_type, fd_timeout_ms);\n if (r != constants_1.WASI_ENOSYS)\n return r;\n }\n if (waitTimeNs > 0) {\n if (waitTimeNs -= Bun.nanoseconds() - timeOrigin, waitTimeNs >= 1e6) {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(100% cpu burning waiting for stdin: please define a way to sleep!) \");\n if (this.sleep != null) {\n const ms = nsToMs(waitTimeNs);\n this.sleep(ms);\n } else {\n const end = BigInt(bindings2.hrtime()) + waitTimeNs;\n while (BigInt(bindings2.hrtime()) < end)\n ;\n }\n }\n }\n return constants_1.WASI_ESUCCESS;\n },\n proc_exit: (rval) => {\n return bindings2.exit(rval), constants_1.WASI_ESUCCESS;\n },\n proc_raise: (sig) => {\n if (!(sig in constants_1.SIGNAL_MAP))\n return constants_1.WASI_EINVAL;\n return bindings2.kill(constants_1.SIGNAL_MAP[sig]), constants_1.WASI_ESUCCESS;\n },\n random_get: (bufPtr, bufLen) => {\n return this.refreshMemory(), crypto.getRandomValues(this.memory.buffer, bufPtr, bufLen), bufLen;\n },\n sched_yield() {\n return constants_1.WASI_ESUCCESS;\n },\n sock_recv() {\n return constants_1.WASI_ENOSYS;\n },\n sock_send() {\n return constants_1.WASI_ENOSYS;\n },\n sock_shutdown() {\n return constants_1.WASI_ENOSYS;\n },\n sock_fcntlSetFlags(_fd, _flags) {\n return constants_1.WASI_ENOSYS;\n },\n sock_pollSocket(_fd, _eventtype, _timeout_ms) {\n return constants_1.WASI_ENOSYS;\n }\n }, log.enabled)\n Object.keys(this.wasiImport).forEach((key) => {\n const prevImport = this.wasiImport[key];\n this.wasiImport[key] = function(...args2) {\n log(key, args2);\n try {\n let result = prevImport(...args2);\n return log(\"result\", result), result;\n } catch (e) {\n throw log(\"error: \", e), e;\n }\n };\n });\n }\n getState() {\n return { env: this.env, FD_MAP: this.FD_MAP, bindings };\n }\n setState(state) {\n this.env = state.env, this.FD_MAP = state.FD_MAP, bindings = state.bindings;\n }\n fstatSync(real_fd) {\n if (real_fd <= 2)\n try {\n return fs.fstatSync(real_fd);\n } catch (_) {\n const now = new Date;\n return {\n dev: 0,\n mode: 8592,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n blksize: 65536,\n ino: 0,\n size: 0,\n blocks: 0,\n atimeMs: now.valueOf(),\n mtimeMs: now.valueOf(),\n ctimeMs: now.valueOf(),\n birthtimeMs: 0,\n atime: new Date,\n mtime: new Date,\n ctime: new Date,\n birthtime: new Date(0)\n };\n }\n return fs.fstatSync(real_fd);\n }\n shortPause() {\n if (this.sleep == null)\n return;\n if ((new Date()).valueOf() - this.lastStdin > 2000)\n this.sleep(50);\n }\n getUnusedFileDescriptor(start = 3) {\n let fd = start;\n while (this.FD_MAP.has(fd))\n fd += 1;\n if (fd > SC_OPEN_MAX)\n throw Error(\"no available file descriptors\");\n return fd;\n }\n refreshMemory() {\n if (!this.view || this.view.buffer.byteLength === 0)\n this.view = new DataView(this.memory.buffer);\n }\n setMemory(memory) {\n this.memory = memory;\n }\n start(instance, memory) {\n const exports2 = instance.exports;\n if (exports2 === null || typeof exports2 !== \"object\")\n throw new Error(`instance.exports must be an Object. Received ${exports2}.`);\n if (memory == null) {\n if (memory = exports2.memory, !(memory instanceof WebAssembly.Memory))\n throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${memory}.`);\n }\n if (this.setMemory(memory), exports2._start)\n exports2._start();\n }\n getImports(module2) {\n let namespace = null;\n const imports = WebAssembly.Module.imports(module2);\n for (let imp of imports) {\n if (imp.kind !== \"function\")\n continue;\n if (!imp.module.startsWith(\"wasi_\"))\n continue;\n namespace = imp.module;\n break;\n }\n switch (namespace) {\n case \"wasi_unstable\":\n return {\n wasi_unstable: this.wasiImport\n };\n case \"wasi_snapshot_preview1\":\n return {\n wasi_snapshot_preview1: this.wasiImport\n };\n default:\n throw new Error(\"No WASI namespace found. Only wasi_unstable and wasi_snapshot_preview1 are supported.\\n\\nList of imports:\\n\\n\" + imports.map(({ name, kind, module }) => `${module}:${name} (${kind})`).join(\"\\n\") + \"\\n\");\n }\n }\n initWasiFdInfo() {\n if (this.env.WASI_FD_INFO != null) {\n const fdInfo = JSON.parse(this.env.WASI_FD_INFO);\n for (let wasi_fd in fdInfo) {\n console.log(wasi_fd);\n const fd = parseInt(wasi_fd);\n if (this.FD_MAP.has(fd))\n continue;\n const real = fdInfo[wasi_fd];\n try {\n this.fstatSync(real);\n } catch (_err) {\n console.log(\"discarding \", { wasi_fd, real });\n continue;\n }\n const file = {\n real,\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n }\n };\n this.FD_MAP.set(fd, file);\n }\n console.log(\"after initWasiFdInfo: \", this.FD_MAP), console.log(\"fdInfo = \", fdInfo);\n } else\n console.log(\"no WASI_FD_INFO\");\n }\n };\n exports.default = WASI;\n }\n});\nreturn { WASI: require_wasi().default }})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyDepdCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/depd.ts\nvar wrapfunction = function(fn, message) {\n if (typeof fn !== \"function\")\n @throwTypeError(\"argument fn must be a function\");\n return fn;\n}, wrapproperty = function(obj, prop, message) {\n if (!obj || typeof obj !== \"object\" && typeof obj !== \"function\")\n @throwTypeError(\"argument obj must be object\");\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n if (!descriptor)\n @throwTypeError(\"must call property on owner object\");\n if (!descriptor.configurable)\n @throwTypeError(\"property must be configurable\");\n}, $;\n$ = function depd(namespace) {\n if (!namespace)\n @throwTypeError(\"argument namespace is required\");\n function deprecate(message) {\n }\n return deprecate._file = void 0, deprecate._ignored = !0, deprecate._namespace = namespace, deprecate._traced = !1, deprecate._warned = Object.create(null), deprecate.function = wrapfunction, deprecate.property = wrapproperty, deprecate;\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeWorkerThreadsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/worker_threads.ts\nvar emitWarning = function(type, message) {\n if (emittedWarnings.has(type))\n return;\n emittedWarnings.add(type), console.warn(\"[bun] Warning:\", message);\n}, injectFakeEmitter = function(Class) {\n function messageEventHandler(event) {\n return event.data;\n }\n function errorEventHandler(event) {\n return event.error;\n }\n const wrappedListener = Symbol(\"wrappedListener\");\n function wrapped(run, listener) {\n const callback = function(event) {\n return listener(run(event));\n };\n return listener[wrappedListener] = callback, callback;\n }\n function functionForEventType(event, listener) {\n switch (event) {\n case \"error\":\n case \"messageerror\":\n return wrapped(errorEventHandler, listener);\n default:\n return wrapped(messageEventHandler, listener);\n }\n }\n Class.prototype.on = function(event, listener) {\n return this.addEventListener(event, functionForEventType(event, listener)), this;\n }, Class.prototype.off = function(event, listener) {\n if (listener)\n this.removeEventListener(event, listener[wrappedListener] || listener);\n else\n this.removeEventListener(event);\n return this;\n }, Class.prototype.once = function(event, listener) {\n return this.addEventListener(event, functionForEventType(event, listener), { once: !0 }), this;\n };\n function EventClass(eventName) {\n if (eventName === \"error\" || eventName === \"messageerror\")\n return ErrorEvent;\n return MessageEvent;\n }\n Class.prototype.emit = function(event, ...args) {\n return this.dispatchEvent(new (EventClass(event))(event, ...args)), this;\n }, Class.prototype.prependListener = Class.prototype.on, Class.prototype.prependOnceListener = Class.prototype.once;\n}, receiveMessageOnPort = function(port) {\n let res = _receiveMessageOnPort(port);\n if (!res)\n return @undefined;\n return {\n message: res\n };\n}, fakeParentPort = function() {\n const fake = Object.create(MessagePort.prototype);\n return Object.defineProperty(fake, \"onmessage\", {\n get() {\n return self.onmessage;\n },\n set(value) {\n self.onmessage = value;\n }\n }), Object.defineProperty(fake, \"onmessageerror\", {\n get() {\n return self.onmessageerror;\n },\n set(value) {\n }\n }), Object.defineProperty(fake, \"postMessage\", {\n value(...args) {\n return self.postMessage(...args);\n }\n }), Object.defineProperty(fake, \"close\", {\n value() {\n return process.exit(0);\n }\n }), Object.defineProperty(fake, \"start\", {\n value() {\n }\n }), Object.defineProperty(fake, \"unref\", {\n value() {\n }\n }), Object.defineProperty(fake, \"ref\", {\n value() {\n }\n }), Object.defineProperty(fake, \"hasRef\", {\n value() {\n return !1;\n }\n }), Object.defineProperty(fake, \"setEncoding\", {\n value() {\n }\n }), Object.defineProperty(fake, \"addEventListener\", {\n value: self.addEventListener.bind(self)\n }), Object.defineProperty(fake, \"removeEventListener\", {\n value: self.removeEventListener.bind(self)\n }), fake;\n}, getEnvironmentData = function() {\n return process.env;\n}, setEnvironmentData = function(env) {\n process.env = env;\n}, markAsUntransferable = function() {\n throwNotImplemented(\"worker_threads.markAsUntransferable\");\n}, moveMessagePortToContext = function() {\n throwNotImplemented(\"worker_threads.moveMessagePortToContext\");\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), { MessageChannel, BroadcastChannel, Worker: WebWorker } = globalThis, SHARE_ENV = Symbol(\"nodejs.worker_threads.SHARE_ENV\"), isMainThread = Bun.isMainThread, [_workerData, _threadId, _receiveMessageOnPort] = @lazy(\"worker_threads\"), emittedWarnings = new Set, _MessagePort = globalThis.MessagePort;\ninjectFakeEmitter(_MessagePort);\nvar MessagePort = _MessagePort, resourceLimits = {}, workerData = _workerData, threadId = _threadId, parentPort = isMainThread \? null : fakeParentPort(), unsupportedOptions = [\n \"eval\",\n \"argv\",\n \"execArgv\",\n \"stdin\",\n \"stdout\",\n \"stderr\",\n \"trackedUnmanagedFds\",\n \"resourceLimits\"\n];\n\nclass Worker extends EventEmitter {\n #worker;\n #performance;\n #onExitPromise = @undefined;\n constructor(filename, options = {}) {\n super();\n for (let key of unsupportedOptions)\n if (key in options)\n emitWarning(\"option.\" + key, `worker_threads.Worker option \"${key}\" is not implemented.`);\n this.#worker = new WebWorker(filename, options), this.#worker.addEventListener(\"close\", this.#onClose.bind(this)), this.#worker.addEventListener(\"error\", this.#onError.bind(this)), this.#worker.addEventListener(\"message\", this.#onMessage.bind(this)), this.#worker.addEventListener(\"messageerror\", this.#onMessageError.bind(this)), this.#worker.addEventListener(\"open\", this.#onOpen.bind(this));\n }\n get threadId() {\n return this.#worker.threadId;\n }\n ref() {\n this.#worker.ref();\n }\n unref() {\n this.#worker.unref();\n }\n get stdin() {\n return null;\n }\n get stdout() {\n return null;\n }\n get stderr() {\n return null;\n }\n get performance() {\n return this.#performance \?\?= {\n eventLoopUtilization() {\n return emitWarning(\"performance\", \"worker_threads.Worker.performance is not implemented.\"), {\n idle: 0,\n active: 0,\n utilization: 0\n };\n }\n };\n }\n terminate() {\n const onExitPromise = this.#onExitPromise;\n if (onExitPromise)\n return @isPromise(onExitPromise) \? onExitPromise : @Promise.resolve(onExitPromise);\n const { resolve, promise } = @Promise.withResolvers();\n return this.#worker.addEventListener(\"close\", (event) => {\n resolve(event.code);\n }, { once: !0 }), this.#worker.terminate(), this.#onExitPromise = promise;\n }\n postMessage(...args) {\n return this.#worker.postMessage(...args);\n }\n #onClose(e) {\n this.#onExitPromise = e.code, this.emit(\"exit\", e.code);\n }\n #onError(error) {\n this.emit(\"error\", error);\n }\n #onMessage(event) {\n this.emit(\"message\", event.data);\n }\n #onMessageError(event) {\n this.emit(\"messageerror\", event.error \?\? event.data \?\? event);\n }\n #onOpen() {\n this.emit(\"online\");\n }\n async getHeapSnapshot() {\n throwNotImplemented(\"worker_threads.Worker.getHeapSnapshot\");\n }\n}\n$ = {\n Worker,\n workerData,\n parentPort,\n resourceLimits,\n isMainThread,\n MessageChannel,\n BroadcastChannel,\n MessagePort,\n getEnvironmentData,\n setEnvironmentData,\n getHeapSnapshot() {\n return {};\n },\n markAsUntransferable,\n moveMessagePortToContext,\n receiveMessageOnPort,\n SHARE_ENV,\n threadId\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyDetectLibcCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/detect-libc.ts\nvar family = function() {\n return Promise.resolve(familySync());\n}, familySync = function() {\n return null;\n}, version = function() {\n return Promise.resolve(versionSync());\n}, versionSync = function() {\n return null;\n}, isNonGlibcLinuxSync = function() {\n return !1;\n}, isNonGlibcLinux = function() {\n return Promise.resolve(isNonGlibcLinuxSync());\n}, $, GLIBC = \"glibc\", MUSL = \"musl\";\n$ = {\n GLIBC,\n MUSL,\n family,\n familySync,\n isNonGlibcLinux,\n isNonGlibcLinuxSync,\n version,\n versionSync\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeZlibCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/zlib.ts\nvar assert = @getInternalField(@internalModuleRegistry, 8) || @createInternalModuleById(8), BufferModule = @requireNativeModule(\"buffer\"), StreamModule = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), Util = @getInternalField(@internalModuleRegistry, 48) || @createInternalModuleById(48), __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_zstream = __commonJS({\n \"node_modules/pako/lib/zlib/zstream.js\"(exports, module2) {\n function ZStream() {\n this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = \"\", this.state = null, this.data_type = 2, this.adler = 0;\n }\n module2.exports = ZStream;\n }\n}), require_common = __commonJS({\n \"node_modules/pako/lib/utils/common.js\"(exports) {\n var TYPED_OK = typeof @Uint8Array !== \"undefined\" && typeof Uint16Array !== \"undefined\" && typeof Int32Array !== \"undefined\";\n function _has(obj, key) {\n return Object.prototype.hasOwnProperty.@call(obj, key);\n }\n exports.assign = function(obj) {\n var sources = @Array.prototype.slice.@call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source)\n continue;\n if (typeof source !== \"object\")\n @throwTypeError(source + \"must be non-object\");\n for (var p in source)\n if (_has(source, p))\n obj[p] = source[p];\n }\n return obj;\n }, exports.shrinkBuf = function(buf, size) {\n if (buf.length === size)\n return buf;\n if (buf.subarray)\n return buf.subarray(0, size);\n return buf.length = size, buf;\n };\n var fnTyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n var i, l, len, pos, chunk, result;\n len = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n len += chunks[i].length;\n result = new @Uint8Array(len), pos = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n chunk = chunks[i], result.set(chunk, pos), pos += chunk.length;\n return result;\n }\n }, fnUntyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n return [].concat.@apply([], chunks);\n }\n };\n exports.setTyped = function(on) {\n if (on)\n exports.Buf8 = @Uint8Array, exports.Buf16 = Uint16Array, exports.Buf32 = Int32Array, exports.assign(exports, fnTyped);\n else\n exports.Buf8 = @Array, exports.Buf16 = @Array, exports.Buf32 = @Array, exports.assign(exports, fnUntyped);\n }, exports.setTyped(TYPED_OK);\n }\n}), require_trees = __commonJS({\n \"node_modules/pako/lib/zlib/trees.js\"(exports) {\n var utils = require_common(), Z_FIXED = 4, Z_BINARY = 0, Z_TEXT = 1, Z_UNKNOWN = 2;\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n var STORED_BLOCK = 0, STATIC_TREES = 1, DYN_TREES = 2, MIN_MATCH = 3, MAX_MATCH = 258, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, Buf_size = 16, MAX_BL_BITS = 7, END_BLOCK = 256, REP_3_6 = 16, REPZ_3_10 = 17, REPZ_11_138 = 18, extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], extra_dbits = [\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 4,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 8,\n 8,\n 9,\n 9,\n 10,\n 10,\n 11,\n 11,\n 12,\n 12,\n 13,\n 13\n ], extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], DIST_CODE_LEN = 512, static_ltree = new @Array((L_CODES + 2) * 2);\n zero(static_ltree);\n var static_dtree = new @Array(D_CODES * 2);\n zero(static_dtree);\n var _dist_code = new @Array(DIST_CODE_LEN);\n zero(_dist_code);\n var _length_code = new @Array(MAX_MATCH - MIN_MATCH + 1);\n zero(_length_code);\n var base_length = new @Array(LENGTH_CODES);\n zero(base_length);\n var base_dist = new @Array(D_CODES);\n zero(base_dist);\n function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree, this.extra_bits = extra_bits, this.extra_base = extra_base, this.elems = elems, this.max_length = max_length, this.has_stree = static_tree && static_tree.length;\n }\n var static_l_desc, static_d_desc, static_bl_desc;\n function TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree, this.max_code = 0, this.stat_desc = stat_desc;\n }\n function d_code(dist) {\n return dist < 256 \? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n }\n function put_short(s, w) {\n s.pending_buf[s.pending++] = w & 255, s.pending_buf[s.pending++] = w >>> 8 & 255;\n }\n function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length)\n s.bi_buf |= value << s.bi_valid & 65535, put_short(s, s.bi_buf), s.bi_buf = value >> Buf_size - s.bi_valid, s.bi_valid += length - Buf_size;\n else\n s.bi_buf |= value << s.bi_valid & 65535, s.bi_valid += length;\n }\n function send_code(s, c, tree) {\n send_bits(s, tree[c * 2], tree[c * 2 + 1]);\n }\n function bi_reverse(code, len) {\n var res = 0;\n do\n res |= code & 1, code >>>= 1, res <<= 1;\n while (--len > 0);\n return res >>> 1;\n }\n function bi_flush(s) {\n if (s.bi_valid === 16)\n put_short(s, s.bi_buf), s.bi_buf = 0, s.bi_valid = 0;\n else if (s.bi_valid >= 8)\n s.pending_buf[s.pending++] = s.bi_buf & 255, s.bi_buf >>= 8, s.bi_valid -= 8;\n }\n function gen_bitlen(s, desc) {\n var { dyn_tree: tree, max_code } = desc, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, extra = desc.stat_desc.extra_bits, base = desc.stat_desc.extra_base, max_length = desc.stat_desc.max_length, h, n, m, bits, xbits, f, overflow = 0;\n for (bits = 0;bits <= MAX_BITS; bits++)\n s.bl_count[bits] = 0;\n tree[s.heap[s.heap_max] * 2 + 1] = 0;\n for (h = s.heap_max + 1;h < HEAP_SIZE; h++) {\n if (n = s.heap[h], bits = tree[tree[n * 2 + 1] * 2 + 1] + 1, bits > max_length)\n bits = max_length, overflow++;\n if (tree[n * 2 + 1] = bits, n > max_code)\n continue;\n if (s.bl_count[bits]++, xbits = 0, n >= base)\n xbits = extra[n - base];\n if (f = tree[n * 2], s.opt_len += f * (bits + xbits), has_stree)\n s.static_len += f * (stree[n * 2 + 1] + xbits);\n }\n if (overflow === 0)\n return;\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0)\n bits--;\n s.bl_count[bits]--, s.bl_count[bits + 1] += 2, s.bl_count[max_length]--, overflow -= 2;\n } while (overflow > 0);\n for (bits = max_length;bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n if (m = s.heap[--h], m > max_code)\n continue;\n if (tree[m * 2 + 1] !== bits)\n s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2], tree[m * 2 + 1] = bits;\n n--;\n }\n }\n }\n function gen_codes(tree, max_code, bl_count) {\n var next_code = new @Array(MAX_BITS + 1), code = 0, bits, n;\n for (bits = 1;bits <= MAX_BITS; bits++)\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n for (n = 0;n <= max_code; n++) {\n var len = tree[n * 2 + 1];\n if (len === 0)\n continue;\n tree[n * 2] = bi_reverse(next_code[len]++, len);\n }\n }\n function tr_static_init() {\n var n, bits, length, code, dist, bl_count = new @Array(MAX_BITS + 1);\n length = 0;\n for (code = 0;code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0;n < 1 << extra_lbits[code]; n++)\n _length_code[length++] = code;\n }\n _length_code[length - 1] = code, dist = 0;\n for (code = 0;code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0;n < 1 << extra_dbits[code]; n++)\n _dist_code[dist++] = code;\n }\n dist >>= 7;\n for (;code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0;n < 1 << extra_dbits[code] - 7; n++)\n _dist_code[256 + dist++] = code;\n }\n for (bits = 0;bits <= MAX_BITS; bits++)\n bl_count[bits] = 0;\n n = 0;\n while (n <= 143)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n while (n <= 255)\n static_ltree[n * 2 + 1] = 9, n++, bl_count[9]++;\n while (n <= 279)\n static_ltree[n * 2 + 1] = 7, n++, bl_count[7]++;\n while (n <= 287)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n for (n = 0;n < D_CODES; n++)\n static_dtree[n * 2 + 1] = 5, static_dtree[n * 2] = bi_reverse(n, 5);\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS), static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS), static_bl_desc = new StaticTreeDesc(new @Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n }\n function init_block(s) {\n var n;\n for (n = 0;n < L_CODES; n++)\n s.dyn_ltree[n * 2] = 0;\n for (n = 0;n < D_CODES; n++)\n s.dyn_dtree[n * 2] = 0;\n for (n = 0;n < BL_CODES; n++)\n s.bl_tree[n * 2] = 0;\n s.dyn_ltree[END_BLOCK * 2] = 1, s.opt_len = s.static_len = 0, s.last_lit = s.matches = 0;\n }\n function bi_windup(s) {\n if (s.bi_valid > 8)\n put_short(s, s.bi_buf);\n else if (s.bi_valid > 0)\n s.pending_buf[s.pending++] = s.bi_buf;\n s.bi_buf = 0, s.bi_valid = 0;\n }\n function copy_block(s, buf, len, header) {\n if (bi_windup(s), header)\n put_short(s, len), put_short(s, ~len);\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending), s.pending += len;\n }\n function smaller(tree, n, m, depth) {\n var _n2 = n * 2, _m2 = m * 2;\n return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];\n }\n function pqdownheap(s, tree, k) {\n var v = s.heap[k], j = k << 1;\n while (j <= s.heap_len) {\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth))\n j++;\n if (smaller(tree, v, s.heap[j], s.depth))\n break;\n s.heap[k] = s.heap[j], k = j, j <<= 1;\n }\n s.heap[k] = v;\n }\n function compress_block(s, ltree, dtree) {\n var dist, lc, lx = 0, code, extra;\n if (s.last_lit !== 0)\n do\n if (dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1], lc = s.pending_buf[s.l_buf + lx], lx++, dist === 0)\n send_code(s, lc, ltree);\n else {\n if (code = _length_code[lc], send_code(s, code + LITERALS + 1, ltree), extra = extra_lbits[code], extra !== 0)\n lc -= base_length[code], send_bits(s, lc, extra);\n if (dist--, code = d_code(dist), send_code(s, code, dtree), extra = extra_dbits[code], extra !== 0)\n dist -= base_dist[code], send_bits(s, dist, extra);\n }\n while (lx < s.last_lit);\n send_code(s, END_BLOCK, ltree);\n }\n function build_tree(s, desc) {\n var tree = desc.dyn_tree, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, elems = desc.stat_desc.elems, n, m, max_code = -1, node;\n s.heap_len = 0, s.heap_max = HEAP_SIZE;\n for (n = 0;n < elems; n++)\n if (tree[n * 2] !== 0)\n s.heap[++s.heap_len] = max_code = n, s.depth[n] = 0;\n else\n tree[n * 2 + 1] = 0;\n while (s.heap_len < 2)\n if (node = s.heap[++s.heap_len] = max_code < 2 \? ++max_code : 0, tree[node * 2] = 1, s.depth[node] = 0, s.opt_len--, has_stree)\n s.static_len -= stree[node * 2 + 1];\n desc.max_code = max_code;\n for (n = s.heap_len >> 1;n >= 1; n--)\n pqdownheap(s, tree, n);\n node = elems;\n do\n n = s.heap[1], s.heap[1] = s.heap[s.heap_len--], pqdownheap(s, tree, 1), m = s.heap[1], s.heap[--s.heap_max] = n, s.heap[--s.heap_max] = m, tree[node * 2] = tree[n * 2] + tree[m * 2], s.depth[node] = (s.depth[n] >= s.depth[m] \? s.depth[n] : s.depth[m]) + 1, tree[n * 2 + 1] = tree[m * 2 + 1] = node, s.heap[1] = node++, pqdownheap(s, tree, 1);\n while (s.heap_len >= 2);\n s.heap[--s.heap_max] = s.heap[1], gen_bitlen(s, desc), gen_codes(tree, max_code, s.bl_count);\n }\n function scan_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n tree[(max_code + 1) * 2 + 1] = 65535;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n s.bl_tree[curlen * 2] += count;\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n s.bl_tree[curlen * 2]++;\n s.bl_tree[REP_3_6 * 2]++;\n } else if (count <= 10)\n s.bl_tree[REPZ_3_10 * 2]++;\n else\n s.bl_tree[REPZ_11_138 * 2]++;\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function send_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n do\n send_code(s, curlen, s.bl_tree);\n while (--count !== 0);\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n send_code(s, curlen, s.bl_tree), count--;\n send_code(s, REP_3_6, s.bl_tree), send_bits(s, count - 3, 2);\n } else if (count <= 10)\n send_code(s, REPZ_3_10, s.bl_tree), send_bits(s, count - 3, 3);\n else\n send_code(s, REPZ_11_138, s.bl_tree), send_bits(s, count - 11, 7);\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function build_bl_tree(s) {\n var max_blindex;\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code), scan_tree(s, s.dyn_dtree, s.d_desc.max_code), build_tree(s, s.bl_desc);\n for (max_blindex = BL_CODES - 1;max_blindex >= 3; max_blindex--)\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0)\n break;\n return s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4, max_blindex;\n }\n function send_all_trees(s, lcodes, dcodes, blcodes) {\n var rank;\n send_bits(s, lcodes - 257, 5), send_bits(s, dcodes - 1, 5), send_bits(s, blcodes - 4, 4);\n for (rank = 0;rank < blcodes; rank++)\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);\n send_tree(s, s.dyn_ltree, lcodes - 1), send_tree(s, s.dyn_dtree, dcodes - 1);\n }\n function detect_data_type(s) {\n var black_mask = 4093624447, n;\n for (n = 0;n <= 31; n++, black_mask >>>= 1)\n if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0)\n return Z_BINARY;\n if (s.dyn_ltree[18] !== 0 || s.dyn_ltree[20] !== 0 || s.dyn_ltree[26] !== 0)\n return Z_TEXT;\n for (n = 32;n < LITERALS; n++)\n if (s.dyn_ltree[n * 2] !== 0)\n return Z_TEXT;\n return Z_BINARY;\n }\n var static_init_done = !1;\n function _tr_init(s) {\n if (!static_init_done)\n tr_static_init(), static_init_done = !0;\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc), s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc), s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc), s.bi_buf = 0, s.bi_valid = 0, init_block(s);\n }\n function _tr_stored_block(s, buf, stored_len, last) {\n send_bits(s, (STORED_BLOCK << 1) + (last \? 1 : 0), 3), copy_block(s, buf, stored_len, !0);\n }\n function _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3), send_code(s, END_BLOCK, static_ltree), bi_flush(s);\n }\n function _tr_flush_block(s, buf, stored_len, last) {\n var opt_lenb, static_lenb, max_blindex = 0;\n if (s.level > 0) {\n if (s.strm.data_type === Z_UNKNOWN)\n s.strm.data_type = detect_data_type(s);\n if (build_tree(s, s.l_desc), build_tree(s, s.d_desc), max_blindex = build_bl_tree(s), opt_lenb = s.opt_len + 3 + 7 >>> 3, static_lenb = s.static_len + 3 + 7 >>> 3, static_lenb <= opt_lenb)\n opt_lenb = static_lenb;\n } else\n opt_lenb = static_lenb = stored_len + 5;\n if (stored_len + 4 <= opt_lenb && buf !== -1)\n _tr_stored_block(s, buf, stored_len, last);\n else if (s.strategy === Z_FIXED || static_lenb === opt_lenb)\n send_bits(s, (STATIC_TREES << 1) + (last \? 1 : 0), 3), compress_block(s, static_ltree, static_dtree);\n else\n send_bits(s, (DYN_TREES << 1) + (last \? 1 : 0), 3), send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1), compress_block(s, s.dyn_ltree, s.dyn_dtree);\n if (init_block(s), last)\n bi_windup(s);\n }\n function _tr_tally(s, dist, lc) {\n if (s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255, s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255, s.pending_buf[s.l_buf + s.last_lit] = lc & 255, s.last_lit++, dist === 0)\n s.dyn_ltree[lc * 2]++;\n else\n s.matches++, dist--, s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++, s.dyn_dtree[d_code(dist) * 2]++;\n return s.last_lit === s.lit_bufsize - 1;\n }\n exports._tr_init = _tr_init, exports._tr_stored_block = _tr_stored_block, exports._tr_flush_block = _tr_flush_block, exports._tr_tally = _tr_tally, exports._tr_align = _tr_align;\n }\n}), require_adler32 = __commonJS({\n \"node_modules/pako/lib/zlib/adler32.js\"(exports, module2) {\n function adler32(adler, buf, len, pos) {\n var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;\n while (len !== 0) {\n n = len > 2000 \? 2000 : len, len -= n;\n do\n s1 = s1 + buf[pos++] | 0, s2 = s2 + s1 | 0;\n while (--n);\n s1 %= 65521, s2 %= 65521;\n }\n return s1 | s2 << 16 | 0;\n }\n module2.exports = adler32;\n }\n}), require_crc32 = __commonJS({\n \"node_modules/pako/lib/zlib/crc32.js\"(exports, module2) {\n function makeTable() {\n var c, table = [];\n for (var n = 0;n < 256; n++) {\n c = n;\n for (var k = 0;k < 8; k++)\n c = c & 1 \? 3988292384 ^ c >>> 1 : c >>> 1;\n table[n] = c;\n }\n return table;\n }\n var crcTable = makeTable();\n function crc32(crc, buf, len, pos) {\n var t = crcTable, end = pos + len;\n crc ^= -1;\n for (var i = pos;i < end; i++)\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];\n return crc ^ -1;\n }\n module2.exports = crc32;\n }\n}), require_messages = __commonJS({\n \"node_modules/pako/lib/zlib/messages.js\"(exports, module2) {\n module2.exports = {\n 2: \"need dictionary\",\n 1: \"stream end\",\n 0: \"\",\n \"-1\": \"file error\",\n \"-2\": \"stream error\",\n \"-3\": \"data error\",\n \"-4\": \"insufficient memory\",\n \"-5\": \"buffer error\",\n \"-6\": \"incompatible version\"\n };\n }\n}), require_deflate = __commonJS({\n \"node_modules/pako/lib/zlib/deflate.js\"(exports) {\n var utils = require_common(), trees = require_trees(), adler32 = require_adler32(), crc32 = require_crc32(), msg = require_messages(), Z_NO_FLUSH = 0, Z_PARTIAL_FLUSH = 1, Z_FULL_FLUSH = 3, Z_FINISH = 4, Z_BLOCK = 5, Z_OK = 0, Z_STREAM_END = 1, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_BUF_ERROR = -5, Z_DEFAULT_COMPRESSION = -1, Z_FILTERED = 1, Z_HUFFMAN_ONLY = 2, Z_RLE = 3, Z_FIXED = 4, Z_DEFAULT_STRATEGY = 0, Z_UNKNOWN = 2, Z_DEFLATED = 8, MAX_MEM_LEVEL = 9, MAX_WBITS = 15, DEF_MEM_LEVEL = 8, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, MIN_MATCH = 3, MAX_MATCH = 258, MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, PRESET_DICT = 32, INIT_STATE = 42, EXTRA_STATE = 69, NAME_STATE = 73, COMMENT_STATE = 91, HCRC_STATE = 103, BUSY_STATE = 113, FINISH_STATE = 666, BS_NEED_MORE = 1, BS_BLOCK_DONE = 2, BS_FINISH_STARTED = 3, BS_FINISH_DONE = 4, OS_CODE = 3;\n function err(strm, errorCode) {\n return strm.msg = msg[errorCode], errorCode;\n }\n function rank(f) {\n return (f << 1) - (f > 4 \? 9 : 0);\n }\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n function flush_pending(strm) {\n var s = strm.state, len = s.pending;\n if (len > strm.avail_out)\n len = strm.avail_out;\n if (len === 0)\n return;\n if (utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out), strm.next_out += len, s.pending_out += len, strm.total_out += len, strm.avail_out -= len, s.pending -= len, s.pending === 0)\n s.pending_out = 0;\n }\n function flush_block_only(s, last) {\n trees._tr_flush_block(s, s.block_start >= 0 \? s.block_start : -1, s.strstart - s.block_start, last), s.block_start = s.strstart, flush_pending(s.strm);\n }\n function put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n }\n function putShortMSB(s, b) {\n s.pending_buf[s.pending++] = b >>> 8 & 255, s.pending_buf[s.pending++] = b & 255;\n }\n function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n if (len > size)\n len = size;\n if (len === 0)\n return 0;\n if (strm.avail_in -= len, utils.arraySet(buf, strm.input, strm.next_in, len, start), strm.state.wrap === 1)\n strm.adler = adler32(strm.adler, buf, len, start);\n else if (strm.state.wrap === 2)\n strm.adler = crc32(strm.adler, buf, len, start);\n return strm.next_in += len, strm.total_in += len, len;\n }\n function longest_match(s, cur_match) {\n var { max_chain_length: chain_length, strstart: scan } = s, match, len, best_len = s.prev_length, nice_match = s.nice_match, limit = s.strstart > s.w_size - MIN_LOOKAHEAD \? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0, _win = s.window, wmask = s.w_mask, prev = s.prev, strend = s.strstart + MAX_MATCH, scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n if (s.prev_length >= s.good_match)\n chain_length >>= 2;\n if (nice_match > s.lookahead)\n nice_match = s.lookahead;\n do {\n if (match = cur_match, _win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1])\n continue;\n scan += 2, match++;\n do\n ;\n while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);\n if (len = MAX_MATCH - (strend - scan), scan = strend - MAX_MATCH, len > best_len) {\n if (s.match_start = cur_match, best_len = len, len >= nice_match)\n break;\n scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n if (best_len <= s.lookahead)\n return best_len;\n return s.lookahead;\n }\n function fill_window(s) {\n var _w_size = s.w_size, p, n, m, more, str;\n do {\n if (more = s.window_size - s.lookahead - s.strstart, s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0), s.match_start -= _w_size, s.strstart -= _w_size, s.block_start -= _w_size, n = s.hash_size, p = n;\n do\n m = s.head[--p], s.head[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n n = _w_size, p = n;\n do\n m = s.prev[--p], s.prev[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n more += _w_size;\n }\n if (s.strm.avail_in === 0)\n break;\n if (n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more), s.lookahead += n, s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert, s.ins_h = s.window[str], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;\n while (s.insert)\n if (s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++, s.insert--, s.lookahead + s.insert < MIN_MATCH)\n break;\n }\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n }\n function deflate_stored(s, flush) {\n var max_block_size = 65535;\n if (max_block_size > s.pending_buf_size - 5)\n max_block_size = s.pending_buf_size - 5;\n for (;; ) {\n if (s.lookahead <= 1) {\n if (fill_window(s), s.lookahead === 0 && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n s.strstart += s.lookahead, s.lookahead = 0;\n var max_start = s.block_start + max_block_size;\n if (s.strstart === 0 || s.strstart >= max_start) {\n if (s.lookahead = s.strstart - max_start, s.strstart = max_start, flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.strstart > s.block_start) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_NEED_MORE;\n }\n function deflate_fast(s, flush) {\n var hash_head, bflush;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD)\n s.match_length = longest_match(s, hash_head);\n if (s.match_length >= MIN_MATCH)\n if (bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n do\n s.strstart++, s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.match_length !== 0);\n s.strstart++;\n } else\n s.strstart += s.match_length, s.match_length = 0, s.ins_h = s.window[s.strstart], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_slow(s, flush) {\n var hash_head, bflush, max_insert;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (s.prev_length = s.match_length, s.prev_match = s.match_start, s.match_length = MIN_MATCH - 1, hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n if (s.match_length = longest_match(s, hash_head), s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096))\n s.match_length = MIN_MATCH - 1;\n }\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH, bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH), s.lookahead -= s.prev_length - 1, s.prev_length -= 2;\n do\n if (++s.strstart <= max_insert)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.prev_length !== 0);\n if (s.match_available = 0, s.match_length = MIN_MATCH - 1, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n } else if (s.match_available) {\n if (bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), bflush)\n flush_block_only(s, !1);\n if (s.strstart++, s.lookahead--, s.strm.avail_out === 0)\n return BS_NEED_MORE;\n } else\n s.match_available = 1, s.strstart++, s.lookahead--;\n }\n if (s.match_available)\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), s.match_available = 0;\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_rle(s, flush) {\n var bflush, prev, scan, strend, _win = s.window;\n for (;; ) {\n if (s.lookahead <= MAX_MATCH) {\n if (fill_window(s), s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (s.match_length = 0, s.lookahead >= MIN_MATCH && s.strstart > 0) {\n if (scan = s.strstart - 1, prev = _win[scan], prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do\n ;\n while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n if (s.match_length = MAX_MATCH - (strend - scan), s.match_length > s.lookahead)\n s.match_length = s.lookahead;\n }\n }\n if (s.match_length >= MIN_MATCH)\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.strstart += s.match_length, s.match_length = 0;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_huff(s, flush) {\n var bflush;\n for (;; ) {\n if (s.lookahead === 0) {\n if (fill_window(s), s.lookahead === 0) {\n if (flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n break;\n }\n }\n if (s.match_length = 0, bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length, this.max_lazy = max_lazy, this.nice_length = nice_length, this.max_chain = max_chain, this.func = func;\n }\n var configuration_table = [\n new Config(0, 0, 0, 0, deflate_stored),\n new Config(4, 4, 8, 4, deflate_fast),\n new Config(4, 5, 16, 8, deflate_fast),\n new Config(4, 6, 32, 32, deflate_fast),\n new Config(4, 4, 16, 16, deflate_slow),\n new Config(8, 16, 32, 32, deflate_slow),\n new Config(8, 16, 128, 128, deflate_slow),\n new Config(8, 32, 128, 256, deflate_slow),\n new Config(32, 128, 258, 1024, deflate_slow),\n new Config(32, 258, 258, 4096, deflate_slow)\n ];\n function lm_init(s) {\n s.window_size = 2 * s.w_size, zero(s.head), s.max_lazy_match = configuration_table[s.level].max_lazy, s.good_match = configuration_table[s.level].good_length, s.nice_match = configuration_table[s.level].nice_length, s.max_chain_length = configuration_table[s.level].max_chain, s.strstart = 0, s.block_start = 0, s.lookahead = 0, s.insert = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, s.ins_h = 0;\n }\n function DeflateState() {\n this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Z_DEFLATED, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2), this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2), this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2), zero(this.dyn_ltree), zero(this.dyn_dtree), zero(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new utils.Buf16(MAX_BITS + 1), this.heap = new utils.Buf16(2 * L_CODES + 1), zero(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new utils.Buf16(2 * L_CODES + 1), zero(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;\n }\n function deflateResetKeep(strm) {\n var s;\n if (!strm || !strm.state)\n return err(strm, Z_STREAM_ERROR);\n if (strm.total_in = strm.total_out = 0, strm.data_type = Z_UNKNOWN, s = strm.state, s.pending = 0, s.pending_out = 0, s.wrap < 0)\n s.wrap = -s.wrap;\n return s.status = s.wrap \? INIT_STATE : BUSY_STATE, strm.adler = s.wrap === 2 \? 0 : 1, s.last_flush = Z_NO_FLUSH, trees._tr_init(s), Z_OK;\n }\n function deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK)\n lm_init(strm.state);\n return ret;\n }\n function deflateSetHeader(strm, head) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (strm.state.wrap !== 2)\n return Z_STREAM_ERROR;\n return strm.state.gzhead = head, Z_OK;\n }\n function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm)\n return Z_STREAM_ERROR;\n var wrap = 1;\n if (level === Z_DEFAULT_COMPRESSION)\n level = 6;\n if (windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (windowBits > 15)\n wrap = 2, windowBits -= 16;\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED)\n return err(strm, Z_STREAM_ERROR);\n if (windowBits === 8)\n windowBits = 9;\n var s = new DeflateState;\n return strm.state = s, s.strm = strm, s.wrap = wrap, s.gzhead = null, s.w_bits = windowBits, s.w_size = 1 << s.w_bits, s.w_mask = s.w_size - 1, s.hash_bits = memLevel + 7, s.hash_size = 1 << s.hash_bits, s.hash_mask = s.hash_size - 1, s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH), s.window = new utils.Buf8(s.w_size * 2), s.head = new utils.Buf16(s.hash_size), s.prev = new utils.Buf16(s.w_size), s.lit_bufsize = 1 << memLevel + 6, s.pending_buf_size = s.lit_bufsize * 4, s.pending_buf = new utils.Buf8(s.pending_buf_size), s.d_buf = 1 * s.lit_bufsize, s.l_buf = 3 * s.lit_bufsize, s.level = level, s.strategy = strategy, s.method = method, deflateReset(strm);\n }\n function deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n }\n function deflate(strm, flush) {\n var old_flush, s, beg, val;\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0)\n return strm \? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n if (s = strm.state, !strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH)\n return err(strm, strm.avail_out === 0 \? Z_BUF_ERROR : Z_STREAM_ERROR);\n if (s.strm = strm, old_flush = s.last_flush, s.last_flush = flush, s.status === INIT_STATE)\n if (s.wrap === 2)\n if (strm.adler = 0, put_byte(s, 31), put_byte(s, 139), put_byte(s, 8), !s.gzhead)\n put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, OS_CODE), s.status = BUSY_STATE;\n else {\n if (put_byte(s, (s.gzhead.text \? 1 : 0) + (s.gzhead.hcrc \? 2 : 0) + (!s.gzhead.extra \? 0 : 4) + (!s.gzhead.name \? 0 : 8) + (!s.gzhead.comment \? 0 : 16)), put_byte(s, s.gzhead.time & 255), put_byte(s, s.gzhead.time >> 8 & 255), put_byte(s, s.gzhead.time >> 16 & 255), put_byte(s, s.gzhead.time >> 24 & 255), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length)\n put_byte(s, s.gzhead.extra.length & 255), put_byte(s, s.gzhead.extra.length >> 8 & 255);\n if (s.gzhead.hcrc)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n s.gzindex = 0, s.status = EXTRA_STATE;\n }\n else {\n var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8, level_flags = -1;\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2)\n level_flags = 0;\n else if (s.level < 6)\n level_flags = 1;\n else if (s.level === 6)\n level_flags = 2;\n else\n level_flags = 3;\n if (header |= level_flags << 6, s.strstart !== 0)\n header |= PRESET_DICT;\n if (header += 31 - header % 31, s.status = BUSY_STATE, putShortMSB(s, header), s.strstart !== 0)\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n strm.adler = 1;\n }\n if (s.status === EXTRA_STATE)\n if (s.gzhead.extra) {\n beg = s.pending;\n while (s.gzindex < (s.gzhead.extra.length & 65535)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size)\n break;\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 255), s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (s.gzindex === s.gzhead.extra.length)\n s.gzindex = 0, s.status = NAME_STATE;\n } else\n s.status = NAME_STATE;\n if (s.status === NAME_STATE)\n if (s.gzhead.name) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.name.length)\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.gzindex = 0, s.status = COMMENT_STATE;\n } else\n s.status = COMMENT_STATE;\n if (s.status === COMMENT_STATE)\n if (s.gzhead.comment) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.comment.length)\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.status = HCRC_STATE;\n } else\n s.status = HCRC_STATE;\n if (s.status === HCRC_STATE)\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size)\n flush_pending(strm);\n if (s.pending + 2 <= s.pending_buf_size)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), strm.adler = 0, s.status = BUSY_STATE;\n } else\n s.status = BUSY_STATE;\n if (s.pending !== 0) {\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH)\n return err(strm, Z_BUF_ERROR);\n if (s.status === FINISH_STATE && strm.avail_in !== 0)\n return err(strm, Z_BUF_ERROR);\n if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY \? deflate_huff(s, flush) : s.strategy === Z_RLE \? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE)\n s.status = FINISH_STATE;\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0)\n s.last_flush = -1;\n return Z_OK;\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH)\n trees._tr_align(s);\n else if (flush !== Z_BLOCK) {\n if (trees._tr_stored_block(s, 0, 0, !1), flush === Z_FULL_FLUSH) {\n if (zero(s.head), s.lookahead === 0)\n s.strstart = 0, s.block_start = 0, s.insert = 0;\n }\n }\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n }\n }\n if (flush !== Z_FINISH)\n return Z_OK;\n if (s.wrap <= 0)\n return Z_STREAM_END;\n if (s.wrap === 2)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), put_byte(s, strm.adler >> 16 & 255), put_byte(s, strm.adler >> 24 & 255), put_byte(s, strm.total_in & 255), put_byte(s, strm.total_in >> 8 & 255), put_byte(s, strm.total_in >> 16 & 255), put_byte(s, strm.total_in >> 24 & 255);\n else\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n if (flush_pending(strm), s.wrap > 0)\n s.wrap = -s.wrap;\n return s.pending !== 0 \? Z_OK : Z_STREAM_END;\n }\n function deflateEnd(strm) {\n var status;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (status = strm.state.status, status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE)\n return err(strm, Z_STREAM_ERROR);\n return strm.state = null, status === BUSY_STATE \? err(strm, Z_DATA_ERROR) : Z_OK;\n }\n function deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, s, str, n, wrap, avail, next, input, tmpDict;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (s = strm.state, wrap = s.wrap, wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead)\n return Z_STREAM_ERROR;\n if (wrap === 1)\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n if (s.wrap = 0, dictLength >= s.w_size) {\n if (wrap === 0)\n zero(s.head), s.strstart = 0, s.block_start = 0, s.insert = 0;\n tmpDict = new utils.Buf8(s.w_size), utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0), dictionary = tmpDict, dictLength = s.w_size;\n }\n avail = strm.avail_in, next = strm.next_in, input = strm.input, strm.avail_in = dictLength, strm.next_in = 0, strm.input = dictionary, fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart, n = s.lookahead - (MIN_MATCH - 1);\n do\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++;\n while (--n);\n s.strstart = str, s.lookahead = MIN_MATCH - 1, fill_window(s);\n }\n return s.strstart += s.lookahead, s.block_start = s.strstart, s.insert = s.lookahead, s.lookahead = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, strm.next_in = next, strm.input = input, strm.avail_in = avail, s.wrap = wrap, Z_OK;\n }\n exports.deflateInit = deflateInit, exports.deflateInit2 = deflateInit2, exports.deflateReset = deflateReset, exports.deflateResetKeep = deflateResetKeep, exports.deflateSetHeader = deflateSetHeader, exports.deflate = deflate, exports.deflateEnd = deflateEnd, exports.deflateSetDictionary = deflateSetDictionary, exports.deflateInfo = \"pako deflate (from Nodeca project)\";\n }\n}), require_inffast = __commonJS({\n \"node_modules/pako/lib/zlib/inffast.js\"(exports, module2) {\n var BAD = 30, TYPE = 12;\n module2.exports = function inflate_fast(strm, start) {\n var state, _in, last, _out, beg, end, dmax, wsize, whave, wnext, s_window, hold, bits, lcode, dcode, lmask, dmask, here, op, len, dist, from, from_source, input, output;\n state = strm.state, _in = strm.next_in, input = strm.input, last = _in + (strm.avail_in - 5), _out = strm.next_out, output = strm.output, beg = _out - (start - strm.avail_out), end = _out + (strm.avail_out - 257), dmax = state.dmax, wsize = state.wsize, whave = state.whave, wnext = state.wnext, s_window = state.window, hold = state.hold, bits = state.bits, lcode = state.lencode, dcode = state.distcode, lmask = (1 << state.lenbits) - 1, dmask = (1 << state.distbits) - 1;\n top:\n do {\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = lcode[hold & lmask];\n dolen:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op === 0)\n output[_out++] = here & 65535;\n else if (op & 16) {\n if (len = here & 65535, op &= 15, op) {\n if (bits < op)\n hold += input[_in++] << bits, bits += 8;\n len += hold & (1 << op) - 1, hold >>>= op, bits -= op;\n }\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = dcode[hold & dmask];\n dodist:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op & 16) {\n if (dist = here & 65535, op &= 15, bits < op) {\n if (hold += input[_in++] << bits, bits += 8, bits < op)\n hold += input[_in++] << bits, bits += 8;\n }\n if (dist += hold & (1 << op) - 1, dist > dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n if (hold >>>= op, bits -= op, op = _out - beg, dist > op) {\n if (op = dist - op, op > whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n }\n if (from = 0, from_source = s_window, wnext === 0) {\n if (from += wsize - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n } else if (wnext < op) {\n if (from += wsize + wnext - op, op -= wnext, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n if (from = 0, wnext < len) {\n op = wnext, len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n }\n } else if (from += wnext - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n while (len > 2)\n output[_out++] = from_source[from++], output[_out++] = from_source[from++], output[_out++] = from_source[from++], len -= 3;\n if (len) {\n if (output[_out++] = from_source[from++], len > 1)\n output[_out++] = from_source[from++];\n }\n } else {\n from = _out - dist;\n do\n output[_out++] = output[from++], output[_out++] = output[from++], output[_out++] = output[from++], len -= 3;\n while (len > 2);\n if (len) {\n if (output[_out++] = output[from++], len > 1)\n output[_out++] = output[from++];\n }\n }\n } else if ((op & 64) === 0) {\n here = dcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } else if ((op & 64) === 0) {\n here = lcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) {\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } while (_in < last && _out < end);\n len = bits >> 3, _in -= len, bits -= len << 3, hold &= (1 << bits) - 1, strm.next_in = _in, strm.next_out = _out, strm.avail_in = _in < last \? 5 + (last - _in) : 5 - (_in - last), strm.avail_out = _out < end \? 257 + (end - _out) : 257 - (_out - end), state.hold = hold, state.bits = bits;\n return;\n };\n }\n}), require_inftrees = __commonJS({\n \"node_modules/pako/lib/zlib/inftrees.js\"(exports, module2) {\n var utils = require_common(), MAXBITS = 15, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, CODES = 0, LENS = 1, DISTS = 2, lbase = [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 13,\n 15,\n 17,\n 19,\n 23,\n 27,\n 31,\n 35,\n 43,\n 51,\n 59,\n 67,\n 83,\n 99,\n 115,\n 131,\n 163,\n 195,\n 227,\n 258,\n 0,\n 0\n ], lext = [\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 17,\n 17,\n 18,\n 18,\n 18,\n 18,\n 19,\n 19,\n 19,\n 19,\n 20,\n 20,\n 20,\n 20,\n 21,\n 21,\n 21,\n 21,\n 16,\n 72,\n 78\n ], dbase = [\n 1,\n 2,\n 3,\n 4,\n 5,\n 7,\n 9,\n 13,\n 17,\n 25,\n 33,\n 49,\n 65,\n 97,\n 129,\n 193,\n 257,\n 385,\n 513,\n 769,\n 1025,\n 1537,\n 2049,\n 3073,\n 4097,\n 6145,\n 8193,\n 12289,\n 16385,\n 24577,\n 0,\n 0\n ], dext = [\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 18,\n 18,\n 19,\n 19,\n 20,\n 20,\n 21,\n 21,\n 22,\n 22,\n 23,\n 23,\n 24,\n 24,\n 25,\n 25,\n 26,\n 26,\n 27,\n 27,\n 28,\n 28,\n 29,\n 29,\n 64,\n 64\n ];\n module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n var bits = opts.bits, len = 0, sym = 0, min = 0, max = 0, root = 0, curr = 0, drop = 0, left = 0, used = 0, huff = 0, incr, fill, low, mask, next, base = null, base_index = 0, end, count = new utils.Buf16(MAXBITS + 1), offs = new utils.Buf16(MAXBITS + 1), extra = null, extra_index = 0, here_bits, here_op, here_val;\n for (len = 0;len <= MAXBITS; len++)\n count[len] = 0;\n for (sym = 0;sym < codes; sym++)\n count[lens[lens_index + sym]]++;\n root = bits;\n for (max = MAXBITS;max >= 1; max--)\n if (count[max] !== 0)\n break;\n if (root > max)\n root = max;\n if (max === 0)\n return table[table_index++] = 1 << 24 | 64 << 16 | 0, table[table_index++] = 1 << 24 | 64 << 16 | 0, opts.bits = 1, 0;\n for (min = 1;min < max; min++)\n if (count[min] !== 0)\n break;\n if (root < min)\n root = min;\n left = 1;\n for (len = 1;len <= MAXBITS; len++)\n if (left <<= 1, left -= count[len], left < 0)\n return -1;\n if (left > 0 && (type === CODES || max !== 1))\n return -1;\n offs[1] = 0;\n for (len = 1;len < MAXBITS; len++)\n offs[len + 1] = offs[len] + count[len];\n for (sym = 0;sym < codes; sym++)\n if (lens[lens_index + sym] !== 0)\n work[offs[lens[lens_index + sym]]++] = sym;\n if (type === CODES)\n base = extra = work, end = 19;\n else if (type === LENS)\n base = lbase, base_index -= 257, extra = lext, extra_index -= 257, end = 256;\n else\n base = dbase, extra = dext, end = -1;\n if (huff = 0, sym = 0, len = min, next = table_index, curr = root, drop = 0, low = -1, used = 1 << root, mask = used - 1, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n for (;; ) {\n if (here_bits = len - drop, work[sym] < end)\n here_op = 0, here_val = work[sym];\n else if (work[sym] > end)\n here_op = extra[extra_index + work[sym]], here_val = base[base_index + work[sym]];\n else\n here_op = 96, here_val = 0;\n incr = 1 << len - drop, fill = 1 << curr, min = fill;\n do\n fill -= incr, table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;\n while (fill !== 0);\n incr = 1 << len - 1;\n while (huff & incr)\n incr >>= 1;\n if (incr !== 0)\n huff &= incr - 1, huff += incr;\n else\n huff = 0;\n if (sym++, --count[len] === 0) {\n if (len === max)\n break;\n len = lens[lens_index + work[sym]];\n }\n if (len > root && (huff & mask) !== low) {\n if (drop === 0)\n drop = root;\n next += min, curr = len - drop, left = 1 << curr;\n while (curr + drop < max) {\n if (left -= count[curr + drop], left <= 0)\n break;\n curr++, left <<= 1;\n }\n if (used += 1 << curr, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n low = huff & mask, table[low] = root << 24 | curr << 16 | next - table_index | 0;\n }\n }\n if (huff !== 0)\n table[next + huff] = len - drop << 24 | 64 << 16 | 0;\n return opts.bits = root, 0;\n };\n }\n}), require_inflate = __commonJS({\n \"node_modules/pako/lib/zlib/inflate.js\"(exports) {\n var utils = require_common(), adler32 = require_adler32(), crc32 = require_crc32(), inflate_fast = require_inffast(), inflate_table = require_inftrees(), CODES = 0, LENS = 1, DISTS = 2, Z_FINISH = 4, Z_BLOCK = 5, Z_TREES = 6, Z_OK = 0, Z_STREAM_END = 1, Z_NEED_DICT = 2, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_MEM_ERROR = -4, Z_BUF_ERROR = -5, Z_DEFLATED = 8, HEAD = 1, FLAGS = 2, TIME = 3, OS = 4, EXLEN = 5, EXTRA = 6, NAME = 7, COMMENT = 8, HCRC = 9, DICTID = 10, DICT = 11, TYPE = 12, TYPEDO = 13, STORED = 14, COPY_ = 15, COPY = 16, TABLE = 17, LENLENS = 18, CODELENS = 19, LEN_ = 20, LEN = 21, LENEXT = 22, DIST = 23, DISTEXT = 24, MATCH = 25, LIT = 26, CHECK = 27, LENGTH = 28, DONE = 29, BAD = 30, MEM = 31, SYNC = 32, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, MAX_WBITS = 15, DEF_WBITS = MAX_WBITS;\n function zswap32(q) {\n return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);\n }\n function InflateState() {\n this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new utils.Buf16(320), this.work = new utils.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;\n }\n function inflateResetKeep(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, strm.total_in = strm.total_out = state.total = 0, strm.msg = \"\", state.wrap)\n strm.adler = state.wrap & 1;\n return state.mode = HEAD, state.last = 0, state.havedict = 0, state.dmax = 32768, state.head = null, state.hold = 0, state.bits = 0, state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS), state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS), state.sane = 1, state.back = -1, Z_OK;\n }\n function inflateReset(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n return state = strm.state, state.wsize = 0, state.whave = 0, state.wnext = 0, inflateResetKeep(strm);\n }\n function inflateReset2(strm, windowBits) {\n var wrap, state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (wrap = (windowBits >> 4) + 1, windowBits < 48)\n windowBits &= 15;\n if (windowBits && (windowBits < 8 || windowBits > 15))\n return Z_STREAM_ERROR;\n if (state.window !== null && state.wbits !== windowBits)\n state.window = null;\n return state.wrap = wrap, state.wbits = windowBits, inflateReset(strm);\n }\n function inflateInit2(strm, windowBits) {\n var ret, state;\n if (!strm)\n return Z_STREAM_ERROR;\n if (state = new InflateState, strm.state = state, state.window = null, ret = inflateReset2(strm, windowBits), ret !== Z_OK)\n strm.state = null;\n return ret;\n }\n function inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n }\n var virgin = !0, lenfix, distfix;\n function fixedtables(state) {\n if (virgin) {\n var sym;\n lenfix = new utils.Buf32(512), distfix = new utils.Buf32(32), sym = 0;\n while (sym < 144)\n state.lens[sym++] = 8;\n while (sym < 256)\n state.lens[sym++] = 9;\n while (sym < 280)\n state.lens[sym++] = 7;\n while (sym < 288)\n state.lens[sym++] = 8;\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {\n bits: 9\n }), sym = 0;\n while (sym < 32)\n state.lens[sym++] = 5;\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {\n bits: 5\n }), virgin = !1;\n }\n state.lencode = lenfix, state.lenbits = 9, state.distcode = distfix, state.distbits = 5;\n }\n function updatewindow(strm, src, end, copy) {\n var dist, state = strm.state;\n if (state.window === null)\n state.wsize = 1 << state.wbits, state.wnext = 0, state.whave = 0, state.window = new utils.Buf8(state.wsize);\n if (copy >= state.wsize)\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0), state.wnext = 0, state.whave = state.wsize;\n else {\n if (dist = state.wsize - state.wnext, dist > copy)\n dist = copy;\n if (utils.arraySet(state.window, src, end - copy, dist, state.wnext), copy -= dist, copy)\n utils.arraySet(state.window, src, end - copy, copy, 0), state.wnext = copy, state.whave = state.wsize;\n else {\n if (state.wnext += dist, state.wnext === state.wsize)\n state.wnext = 0;\n if (state.whave < state.wsize)\n state.whave += dist;\n }\n }\n return 0;\n }\n function inflate(strm, flush) {\n var state, input, output, next, put, have, left, hold, bits, _in, _out, copy, from, from_source, here = 0, here_bits, here_op, here_val, last_bits, last_op, last_val, len, ret, hbuf = new utils.Buf8(4), opts, n, order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.mode === TYPE)\n state.mode = TYPEDO;\n put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, _in = have, _out = left, ret = Z_OK;\n inf_leave:\n for (;; )\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.wrap & 2 && hold === 35615) {\n state.check = 0, hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0), hold = 0, bits = 0, state.mode = FLAGS;\n break;\n }\n if (state.flags = 0, state.head)\n state.head.done = !1;\n if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {\n strm.msg = \"incorrect header check\", state.mode = BAD;\n break;\n }\n if ((hold & 15) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (hold >>>= 4, bits -= 4, len = (hold & 15) + 8, state.wbits === 0)\n state.wbits = len;\n else if (len > state.wbits) {\n strm.msg = \"invalid window size\", state.mode = BAD;\n break;\n }\n state.dmax = 1 << len, strm.adler = state.check = 1, state.mode = hold & 512 \? DICTID : TYPE, hold = 0, bits = 0;\n break;\n case FLAGS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.flags = hold, (state.flags & 255) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (state.flags & 57344) {\n strm.msg = \"unknown header flags set\", state.mode = BAD;\n break;\n }\n if (state.head)\n state.head.text = hold >> 8 & 1;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = TIME;\n case TIME:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.time = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, hbuf[2] = hold >>> 16 & 255, hbuf[3] = hold >>> 24 & 255, state.check = crc32(state.check, hbuf, 4, 0);\n hold = 0, bits = 0, state.mode = OS;\n case OS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.xflags = hold & 255, state.head.os = hold >> 8;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = EXLEN;\n case EXLEN:\n if (state.flags & 1024) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.length = hold, state.head)\n state.head.extra_len = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0;\n } else if (state.head)\n state.head.extra = null;\n state.mode = EXTRA;\n case EXTRA:\n if (state.flags & 1024) {\n if (copy = state.length, copy > have)\n copy = have;\n if (copy) {\n if (state.head) {\n if (len = state.head.extra_len - state.length, !state.head.extra)\n state.head.extra = new @Array(state.head.extra_len);\n utils.arraySet(state.head.extra, input, next, copy, len);\n }\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n have -= copy, next += copy, state.length -= copy;\n }\n if (state.length)\n break inf_leave;\n }\n state.length = 0, state.mode = NAME;\n case NAME:\n if (state.flags & 2048) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.name += @String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.name = null;\n state.length = 0, state.mode = COMMENT;\n case COMMENT:\n if (state.flags & 4096) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.comment += @String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.comment = null;\n state.mode = HCRC;\n case HCRC:\n if (state.flags & 512) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.check & 65535)) {\n strm.msg = \"header crc mismatch\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n if (state.head)\n state.head.hcrc = state.flags >> 9 & 1, state.head.done = !0;\n strm.adler = state.check = 0, state.mode = TYPE;\n break;\n case DICTID:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n strm.adler = state.check = zswap32(hold), hold = 0, bits = 0, state.mode = DICT;\n case DICT:\n if (state.havedict === 0)\n return strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, Z_NEED_DICT;\n strm.adler = state.check = 1, state.mode = TYPE;\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES)\n break inf_leave;\n case TYPEDO:\n if (state.last) {\n hold >>>= bits & 7, bits -= bits & 7, state.mode = CHECK;\n break;\n }\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n switch (state.last = hold & 1, hold >>>= 1, bits -= 1, hold & 3) {\n case 0:\n state.mode = STORED;\n break;\n case 1:\n if (fixedtables(state), state.mode = LEN_, flush === Z_TREES) {\n hold >>>= 2, bits -= 2;\n break inf_leave;\n }\n break;\n case 2:\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = \"invalid block type\", state.mode = BAD;\n }\n hold >>>= 2, bits -= 2;\n break;\n case STORED:\n hold >>>= bits & 7, bits -= bits & 7;\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {\n strm.msg = \"invalid stored block lengths\", state.mode = BAD;\n break;\n }\n if (state.length = hold & 65535, hold = 0, bits = 0, state.mode = COPY_, flush === Z_TREES)\n break inf_leave;\n case COPY_:\n state.mode = COPY;\n case COPY:\n if (copy = state.length, copy) {\n if (copy > have)\n copy = have;\n if (copy > left)\n copy = left;\n if (copy === 0)\n break inf_leave;\n utils.arraySet(output, input, next, copy, put), have -= copy, next += copy, left -= copy, put += copy, state.length -= copy;\n break;\n }\n state.mode = TYPE;\n break;\n case TABLE:\n while (bits < 14) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.nlen = (hold & 31) + 257, hold >>>= 5, bits -= 5, state.ndist = (hold & 31) + 1, hold >>>= 5, bits -= 5, state.ncode = (hold & 15) + 4, hold >>>= 4, bits -= 4, state.nlen > 286 || state.ndist > 30) {\n strm.msg = \"too many length or distance symbols\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = LENLENS;\n case LENLENS:\n while (state.have < state.ncode) {\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.lens[order[state.have++]] = hold & 7, hold >>>= 3, bits -= 3;\n }\n while (state.have < 19)\n state.lens[order[state.have++]] = 0;\n if (state.lencode = state.lendyn, state.lenbits = 7, opts = { bits: state.lenbits }, ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid code lengths set\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = CODELENS;\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_val < 16)\n hold >>>= here_bits, bits -= here_bits, state.lens[state.have++] = here_val;\n else {\n if (here_val === 16) {\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.have === 0) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1], copy = 3 + (hold & 3), hold >>>= 2, bits -= 2;\n } else if (here_val === 17) {\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 3 + (hold & 7), hold >>>= 3, bits -= 3;\n } else {\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 11 + (hold & 127), hold >>>= 7, bits -= 7;\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n while (copy--)\n state.lens[state.have++] = len;\n }\n }\n if (state.mode === BAD)\n break;\n if (state.lens[256] === 0) {\n strm.msg = \"invalid code -- missing end-of-block\", state.mode = BAD;\n break;\n }\n if (state.lenbits = 9, opts = { bits: state.lenbits }, ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid literal/lengths set\", state.mode = BAD;\n break;\n }\n if (state.distbits = 6, state.distcode = state.distdyn, opts = { bits: state.distbits }, ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts), state.distbits = opts.bits, ret) {\n strm.msg = \"invalid distances set\", state.mode = BAD;\n break;\n }\n if (state.mode = LEN_, flush === Z_TREES)\n break inf_leave;\n case LEN_:\n state.mode = LEN;\n case LEN:\n if (have >= 6 && left >= 258) {\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, inflate_fast(strm, _out), put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, state.mode === TYPE)\n state.back = -1;\n break;\n }\n state.back = 0;\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_op && (here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, state.length = here_val, here_op === 0) {\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n state.back = -1, state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break;\n }\n state.extra = here_op & 15, state.mode = LENEXT;\n case LENEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.length += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n state.was = state.length, state.mode = DIST;\n case DIST:\n for (;; ) {\n if (here = state.distcode[hold & (1 << state.distbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, here_op & 64) {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break;\n }\n state.offset = here_val, state.extra = here_op & 15, state.mode = DISTEXT;\n case DISTEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.offset += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n if (state.offset > state.dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n state.mode = MATCH;\n case MATCH:\n if (left === 0)\n break inf_leave;\n if (copy = _out - left, state.offset > copy) {\n if (copy = state.offset - copy, copy > state.whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n }\n if (copy > state.wnext)\n copy -= state.wnext, from = state.wsize - copy;\n else\n from = state.wnext - copy;\n if (copy > state.length)\n copy = state.length;\n from_source = state.window;\n } else\n from_source = output, from = put - state.offset, copy = state.length;\n if (copy > left)\n copy = left;\n left -= copy, state.length -= copy;\n do\n output[put++] = from_source[from++];\n while (--copy);\n if (state.length === 0)\n state.mode = LEN;\n break;\n case LIT:\n if (left === 0)\n break inf_leave;\n output[put++] = state.length, left--, state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold |= input[next++] << bits, bits += 8;\n }\n if (_out -= left, strm.total_out += _out, state.total += _out, _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);\n if (_out = left, (state.flags \? hold : zswap32(hold)) !== state.check) {\n strm.msg = \"incorrect data check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = LENGTH;\n case LENGTH:\n if (state.wrap && state.flags) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.total & 4294967295)) {\n strm.msg = \"incorrect length check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = DONE;\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n default:\n return Z_STREAM_ERROR;\n }\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out))\n return state.mode = MEM, Z_MEM_ERROR;\n }\n if (_in -= strm.avail_in, _out -= strm.avail_out, strm.total_in += _in, strm.total_out += _out, state.total += _out, state.wrap && _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);\n if (strm.data_type = state.bits + (state.last \? 64 : 0) + (state.mode === TYPE \? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ \? 256 : 0), (_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK)\n ret = Z_BUF_ERROR;\n return ret;\n }\n function inflateEnd(strm) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n var state = strm.state;\n if (state.window)\n state.window = null;\n return strm.state = null, Z_OK;\n }\n function inflateGetHeader(strm, head) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, (state.wrap & 2) === 0)\n return Z_STREAM_ERROR;\n return state.head = head, head.done = !1, Z_OK;\n }\n function inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, state, dictid, ret;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.wrap !== 0 && state.mode !== DICT)\n return Z_STREAM_ERROR;\n if (state.mode === DICT) {\n if (dictid = 1, dictid = adler32(dictid, dictionary, dictLength, 0), dictid !== state.check)\n return Z_DATA_ERROR;\n }\n if (ret = updatewindow(strm, dictionary, dictLength, dictLength), ret)\n return state.mode = MEM, Z_MEM_ERROR;\n return state.havedict = 1, Z_OK;\n }\n exports.inflateReset = inflateReset, exports.inflateReset2 = inflateReset2, exports.inflateResetKeep = inflateResetKeep, exports.inflateInit = inflateInit, exports.inflateInit2 = inflateInit2, exports.inflate = inflate, exports.inflateEnd = inflateEnd, exports.inflateGetHeader = inflateGetHeader, exports.inflateSetDictionary = inflateSetDictionary, exports.inflateInfo = \"pako inflate (from Nodeca project)\";\n }\n}), require_constants = __commonJS({\n \"node_modules/pako/lib/zlib/constants.js\"(exports, module2) {\n module2.exports = {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_BUF_ERROR: -5,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n Z_BINARY: 0,\n Z_TEXT: 1,\n Z_UNKNOWN: 2,\n Z_DEFLATED: 8\n };\n }\n}), require_binding = __commonJS({\n \"node_modules/browserify-zlib/lib/binding.js\"(exports) {\n var Zstream = require_zstream(), zlib_deflate = require_deflate(), zlib_inflate = require_inflate(), constants = require_constants();\n for (key in constants)\n exports[key] = constants[key];\n var key;\n exports.NONE = 0, exports.DEFLATE = 1, exports.INFLATE = 2, exports.GZIP = 3, exports.GUNZIP = 4, exports.DEFLATERAW = 5, exports.INFLATERAW = 6, exports.UNZIP = 7;\n var GZIP_HEADER_ID1 = 31, GZIP_HEADER_ID2 = 139;\n function Zlib(mode) {\n if (typeof mode !== \"number\" || mode < exports.DEFLATE || mode > exports.UNZIP)\n @throwTypeError(\"Bad argument\");\n this.dictionary = null, this.err = 0, this.flush = 0, this.init_done = !1, this.level = 0, this.memLevel = 0, this.mode = mode, this.strategy = 0, this.windowBits = 0, this.write_in_progress = !1, this.pending_close = !1, this.gzip_id_bytes_read = 0;\n }\n Zlib.prototype = {}, Zlib.prototype.close = function() {\n if (this.write_in_progress) {\n this.pending_close = !0;\n return;\n }\n if (this.pending_close = !1, assert(this.init_done, \"close before init\"), assert(this.mode <= exports.UNZIP), this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW)\n zlib_deflate.deflateEnd(this.strm);\n else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP)\n zlib_inflate.inflateEnd(this.strm);\n this.mode = exports.NONE, this.dictionary = null;\n }, Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!0, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!1, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype._write = function(async, flush, input, in_off, in_len, out, out_off, out_len) {\n if (assert.equal(arguments.length, 8), assert(this.init_done, \"write before init\"), assert(this.mode !== exports.NONE, \"already finalized\"), assert.equal(!1, this.write_in_progress, \"write already in progress\"), assert.equal(!1, this.pending_close, \"close is pending\"), this.write_in_progress = !0, assert.equal(!1, flush === void 0, \"must provide flush value\"), this.write_in_progress = !0, flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK)\n throw new Error(\"Invalid flush value\");\n if (input == null)\n input = @Buffer.alloc(0), in_len = 0, in_off = 0;\n if (this.strm.avail_in = in_len, this.strm.input = input, this.strm.next_in = in_off, this.strm.avail_out = out_len, this.strm.output = out, this.strm.next_out = out_off, this.flush = flush, !async) {\n if (this._process(), this._checkError())\n return this._afterSync();\n return;\n }\n var self = this;\n return process.nextTick(function() {\n self._process(), self._after();\n }), this;\n }, Zlib.prototype._afterSync = function() {\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n return this.write_in_progress = !1, [avail_in, avail_out];\n }, Zlib.prototype._process = function() {\n var next_expected_header_byte = null;\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n case exports.UNZIP:\n if (this.strm.avail_in > 0)\n next_expected_header_byte = this.strm.next_in;\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n if (this.gzip_id_bytes_read = 1, next_expected_header_byte++, this.strm.avail_in === 1)\n break;\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n case 1:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2)\n this.gzip_id_bytes_read = 2, this.mode = exports.GUNZIP;\n else\n this.mode = exports.INFLATE;\n break;\n default:\n throw new Error(\"invalid number of gzip magic number bytes read\");\n }\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n if (this.err = zlib_inflate.inflate(this.strm, this.flush), this.err === exports.Z_NEED_DICT && this.dictionary) {\n if (this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary), this.err === exports.Z_OK)\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n else if (this.err === exports.Z_DATA_ERROR)\n this.err = exports.Z_NEED_DICT;\n }\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0)\n this.reset(), this.err = zlib_inflate.inflate(this.strm, this.flush);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n }, Zlib.prototype._checkError = function() {\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH)\n return this._error(\"unexpected end of file\"), !1;\n break;\n case exports.Z_STREAM_END:\n break;\n case exports.Z_NEED_DICT:\n if (this.dictionary == null)\n this._error(\"Missing dictionary\");\n else\n this._error(\"Bad dictionary\");\n return !1;\n default:\n return this._error(\"Zlib error\"), !1;\n }\n return !0;\n }, Zlib.prototype._after = function() {\n if (!this._checkError())\n return;\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n if (this.write_in_progress = !1, this.callback(avail_in, avail_out), this.pending_close)\n this.close();\n }, Zlib.prototype._error = function(message) {\n if (this.strm.msg)\n message = this.strm.msg;\n if (this.onerror(message, this.err), this.write_in_progress = !1, this.pending_close)\n this.close();\n }, Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, \"init(windowBits, level, memLevel, strategy, [dictionary])\"), assert(windowBits >= 8 && windowBits <= 15, \"invalid windowBits\"), assert(level >= -1 && level <= 9, \"invalid compression level\"), assert(memLevel >= 1 && memLevel <= 9, \"invalid memlevel\"), assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, \"invalid strategy\"), this._init(level, windowBits, memLevel, strategy, dictionary), this._setDictionary();\n }, Zlib.prototype.params = function() {\n throw new Error(\"deflateParams Not supported\");\n }, Zlib.prototype.reset = function() {\n this._reset(), this._setDictionary();\n }, Zlib.prototype._init = function(level, windowBits, memLevel, strategy, dictionary) {\n if (this.level = level, this.windowBits = windowBits, this.memLevel = memLevel, this.strategy = strategy, this.flush = exports.Z_NO_FLUSH, this.err = exports.Z_OK, this.mode === exports.GZIP || this.mode === exports.GUNZIP)\n this.windowBits += 16;\n if (this.mode === exports.UNZIP)\n this.windowBits += 32;\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW)\n this.windowBits = -1 * this.windowBits;\n switch (this.strm = new Zstream, this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Init error\");\n this.dictionary = dictionary, this.write_in_progress = !1, this.init_done = !0;\n }, Zlib.prototype._setDictionary = function() {\n if (this.dictionary == null)\n return;\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to set dictionary\");\n }, Zlib.prototype._reset = function() {\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to reset stream\");\n }, exports.Zlib = Zlib;\n }\n}), require_lib = __commonJS({\n \"node_modules/browserify-zlib/lib/index.js\"(exports) {\n var Buffer2 = BufferModule.Buffer, Transform = StreamModule.Transform, binding = require_binding(), util = Util, kMaxLength = BufferModule.kMaxLength, kRangeErrorMessage = \"Cannot create final Buffer. It would be larger than 0x\" + kMaxLength.toString(16) + \" bytes\";\n binding.Z_MIN_WINDOWBITS = 8, binding.Z_MAX_WINDOWBITS = 15, binding.Z_DEFAULT_WINDOWBITS = 15, binding.Z_MIN_CHUNK = 64, binding.Z_MAX_CHUNK = @Infinity, binding.Z_DEFAULT_CHUNK = 16384, binding.Z_MIN_MEMLEVEL = 1, binding.Z_MAX_MEMLEVEL = 9, binding.Z_DEFAULT_MEMLEVEL = 8, binding.Z_MIN_LEVEL = -1, binding.Z_MAX_LEVEL = 9, binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;\n var bkeys = Object.keys(binding);\n for (bk = 0;bk < bkeys.length; bk++)\n if (bkey = bkeys[bk], bkey.match(/^Z/))\n Object.defineProperty(exports, bkey, {\n enumerable: !0,\n value: binding[bkey],\n writable: !1\n });\n var bkey, bk, codes = {\n Z_OK: binding.Z_OK,\n Z_STREAM_END: binding.Z_STREAM_END,\n Z_NEED_DICT: binding.Z_NEED_DICT,\n Z_ERRNO: binding.Z_ERRNO,\n Z_STREAM_ERROR: binding.Z_STREAM_ERROR,\n Z_DATA_ERROR: binding.Z_DATA_ERROR,\n Z_MEM_ERROR: binding.Z_MEM_ERROR,\n Z_BUF_ERROR: binding.Z_BUF_ERROR,\n Z_VERSION_ERROR: binding.Z_VERSION_ERROR\n }, ckeys = Object.keys(codes);\n for (ck = 0;ck < ckeys.length; ck++)\n ckey = ckeys[ck], codes[codes[ckey]] = ckey;\n var ckey, ck;\n Object.defineProperty(exports, \"codes\", {\n enumerable: !0,\n value: Object.freeze(codes),\n writable: !1\n }), exports.constants = require_constants(), exports.Deflate = Deflate, exports.Inflate = Inflate, exports.Gzip = Gzip, exports.Gunzip = Gunzip, exports.DeflateRaw = DeflateRaw, exports.InflateRaw = InflateRaw, exports.Unzip = Unzip, exports.createDeflate = function(o) {\n return new Deflate(o);\n }, exports.createInflate = function(o) {\n return new Inflate(o);\n }, exports.createDeflateRaw = function(o) {\n return new DeflateRaw(o);\n }, exports.createInflateRaw = function(o) {\n return new InflateRaw(o);\n }, exports.createGzip = function(o) {\n return new Gzip(o);\n }, exports.createGunzip = function(o) {\n return new Gunzip(o);\n }, exports.createUnzip = function(o) {\n return new Unzip(o);\n }, exports.deflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Deflate(opts), buffer, callback);\n }, exports.deflateSync = function(buffer, opts) {\n return zlibBufferSync(new Deflate(opts), buffer);\n }, exports.gzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gzip(opts), buffer, callback);\n }, exports.gzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gzip(opts), buffer);\n }, exports.deflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new DeflateRaw(opts), buffer, callback);\n }, exports.deflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new DeflateRaw(opts), buffer);\n }, exports.unzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Unzip(opts), buffer, callback);\n }, exports.unzipSync = function(buffer, opts) {\n return zlibBufferSync(new Unzip(opts), buffer);\n }, exports.inflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Inflate(opts), buffer, callback);\n }, exports.inflateSync = function(buffer, opts) {\n return zlibBufferSync(new Inflate(opts), buffer);\n }, exports.gunzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gunzip(opts), buffer, callback);\n }, exports.gunzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gunzip(opts), buffer);\n }, exports.inflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new InflateRaw(opts), buffer, callback);\n }, exports.inflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new InflateRaw(opts), buffer);\n }, exports.brotliCompress = function(buffer, opts, callback) {\n throw new Error(\"zlib.brotliCompress is not implemented\");\n };\n function zlibBuffer(engine, buffer, callback) {\n var buffers = [], nread = 0;\n engine.on(\"error\", onError), engine.on(\"end\", onEnd), engine.end(buffer), flow();\n function flow() {\n var chunk;\n while ((chunk = engine.read()) !== null)\n buffers.push(chunk), nread += chunk.length;\n engine.once(\"readable\", flow);\n }\n function onError(err) {\n engine.removeListener(\"end\", onEnd), engine.removeListener(\"readable\", flow), callback(err);\n }\n function onEnd() {\n var buf, err = null;\n if (nread >= kMaxLength)\n err = new RangeError(kRangeErrorMessage);\n else\n buf = Buffer2.concat(buffers, nread);\n buffers = [], engine.close(), callback(err, buf);\n }\n }\n function zlibBufferSync(engine, buffer) {\n if (typeof buffer === \"string\")\n buffer = Buffer2.from(buffer);\n if (!Buffer2.isBuffer(buffer))\n @throwTypeError(\"Not a string or buffer\");\n var flushFlag = engine._finishFlushFlag;\n return engine._processChunk(buffer, flushFlag);\n }\n function Deflate(opts) {\n if (!(this instanceof Deflate))\n return new Deflate(opts);\n Zlib.@call(this, opts, binding.DEFLATE);\n }\n function Inflate(opts) {\n if (!(this instanceof Inflate))\n return new Inflate(opts);\n Zlib.@call(this, opts, binding.INFLATE);\n }\n function Gzip(opts) {\n if (!(this instanceof Gzip))\n return new Gzip(opts);\n Zlib.@call(this, opts, binding.GZIP);\n }\n function Gunzip(opts) {\n if (!(this instanceof Gunzip))\n return new Gunzip(opts);\n Zlib.@call(this, opts, binding.GUNZIP);\n }\n function DeflateRaw(opts) {\n if (!(this instanceof DeflateRaw))\n return new DeflateRaw(opts);\n Zlib.@call(this, opts, binding.DEFLATERAW);\n }\n function InflateRaw(opts) {\n if (!(this instanceof InflateRaw))\n return new InflateRaw(opts);\n Zlib.@call(this, opts, binding.INFLATERAW);\n }\n function Unzip(opts) {\n if (!(this instanceof Unzip))\n return new Unzip(opts);\n Zlib.@call(this, opts, binding.UNZIP);\n }\n function isValidFlushFlag(flag) {\n return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;\n }\n function Zlib(opts, mode) {\n var _this = this;\n if (this._opts = opts = opts || {}, this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK, Transform.@call(this, opts), opts.flush && !isValidFlushFlag(opts.flush))\n throw new Error(\"Invalid flush flag: \" + opts.flush);\n if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush))\n throw new Error(\"Invalid flush flag: \" + opts.finishFlush);\n if (this._flushFlag = opts.flush || binding.Z_NO_FLUSH, this._finishFlushFlag = typeof opts.finishFlush !== \"undefined\" \? opts.finishFlush : binding.Z_FINISH, opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK)\n throw new Error(\"Invalid chunk size: \" + opts.chunkSize);\n }\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS)\n throw new Error(\"Invalid windowBits: \" + opts.windowBits);\n }\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL)\n throw new Error(\"Invalid compression level: \" + opts.level);\n }\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL)\n throw new Error(\"Invalid memLevel: \" + opts.memLevel);\n }\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY)\n throw new Error(\"Invalid strategy: \" + opts.strategy);\n }\n if (opts.dictionary) {\n if (!Buffer2.isBuffer(opts.dictionary))\n throw new Error(\"Invalid dictionary: it should be a Buffer instance\");\n }\n this._handle = new binding.Zlib(mode);\n var self = this;\n this._hadError = !1, this._handle.onerror = function(message, errno) {\n _close(self), self._hadError = !0;\n var error = new Error(message);\n error.errno = errno, error.code = exports.codes[errno], self.emit(\"error\", error);\n };\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === \"number\")\n level = opts.level;\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === \"number\")\n strategy = opts.strategy;\n this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary), this._buffer = Buffer2.allocUnsafe(this._chunkSize), this._offset = 0, this._level = level, this._strategy = strategy, this.once(\"end\", this.close), Object.defineProperty(this, \"_closed\", {\n get: function() {\n return !_this._handle;\n },\n configurable: !0,\n enumerable: !0\n });\n }\n util.inherits(Zlib, Transform), Zlib.prototype.params = function(level, strategy, callback) {\n if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL)\n @throwRangeError(\"Invalid compression level: \" + level);\n if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY)\n @throwTypeError(\"Invalid strategy: \" + strategy);\n if (this._level !== level || this._strategy !== strategy) {\n var self = this;\n this.flush(binding.Z_SYNC_FLUSH, function() {\n if (assert(self._handle, \"zlib binding closed\"), self._handle.params(level, strategy), !self._hadError) {\n if (self._level = level, self._strategy = strategy, callback)\n callback();\n }\n });\n } else\n process.nextTick(callback);\n }, Zlib.prototype.reset = function() {\n return assert(this._handle, \"zlib binding closed\"), this._handle.reset();\n }, Zlib.prototype._flush = function(callback) {\n this._transform(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.flush = function(kind, callback) {\n var _this2 = this, ws = this._writableState;\n if (typeof kind === \"function\" || kind === void 0 && !callback)\n callback = kind, kind = binding.Z_FULL_FLUSH;\n if (ws.ended) {\n if (callback)\n process.nextTick(callback);\n } else if (ws.ending) {\n if (callback)\n this.once(\"end\", callback);\n } else if (ws.needDrain) {\n if (callback)\n this.once(\"drain\", function() {\n return _this2.flush(kind, callback);\n });\n } else\n this._flushFlag = kind, this.write(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.close = function(callback) {\n _close(this, callback), process.nextTick(emitCloseNT, this);\n };\n function _close(engine, callback) {\n if (callback)\n process.nextTick(callback);\n if (!engine._handle)\n return;\n engine._handle.close(), engine._handle = null;\n }\n function emitCloseNT(self) {\n self.emit(\"close\");\n }\n Zlib.prototype._transform = function(chunk, encoding, cb) {\n var flushFlag, ws = this._writableState, ending = ws.ending || ws.ended, last = ending && (!chunk || ws.length === chunk.length);\n if (chunk !== null && !Buffer2.isBuffer(chunk))\n return cb(new Error(\"invalid input\"));\n if (!this._handle)\n return cb(new Error(\"zlib binding closed\"));\n if (last)\n flushFlag = this._finishFlushFlag;\n else if (flushFlag = this._flushFlag, chunk.length >= ws.length)\n this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;\n this._processChunk(chunk, flushFlag, cb);\n }, Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {\n var availInBefore = chunk && chunk.length, availOutBefore = this._chunkSize - this._offset, inOff = 0, self = this, async = typeof cb === \"function\";\n if (!async) {\n var buffers = [], nread = 0, error;\n this.on(\"error\", function(er) {\n error = er;\n }), assert(this._handle, \"zlib binding closed\");\n do\n var res = this._handle.writeSync(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n while (!this._hadError && callback(res[0], res[1]));\n if (this._hadError)\n throw error;\n if (nread >= kMaxLength)\n _close(this), @throwRangeError(kRangeErrorMessage);\n var buf = Buffer2.concat(buffers, nread);\n return _close(this), buf;\n }\n assert(this._handle, \"zlib binding closed\");\n var req = this._handle.write(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n req.buffer = chunk, req.callback = callback;\n function callback(availInAfter, availOutAfter) {\n if (this)\n this.buffer = null, this.callback = null;\n if (self._hadError)\n return;\n var have = availOutBefore - availOutAfter;\n if (assert(have >= 0, \"have should not go down\"), have > 0) {\n var out = self._buffer.slice(self._offset, self._offset + have);\n if (self._offset += have, async)\n self.push(out);\n else\n buffers.push(out), nread += out.length;\n }\n if (availOutAfter === 0 || self._offset >= self._chunkSize)\n availOutBefore = self._chunkSize, self._offset = 0, self._buffer = Buffer2.allocUnsafe(self._chunkSize);\n if (availOutAfter === 0) {\n if (inOff += availInBefore - availInAfter, availInBefore = availInAfter, !async)\n return !0;\n var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);\n newReq.callback = callback, newReq.buffer = chunk;\n return;\n }\n if (!async)\n return !1;\n cb();\n }\n }, util.inherits(Deflate, Zlib), util.inherits(Inflate, Zlib), util.inherits(Gzip, Zlib), util.inherits(Gunzip, Zlib), util.inherits(DeflateRaw, Zlib), util.inherits(InflateRaw, Zlib), util.inherits(Unzip, Zlib);\n }\n});\nreturn require_lib()})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyDetectLibcLinuxCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/detect-libc.linux.ts\nvar family = function() {\n return Promise.resolve(familySync());\n}, familySync = function() {\n return GLIBC;\n}, version = function() {\n return Promise.resolve(versionSync());\n}, versionSync = function() {\n return \"2.29\";\n}, isNonGlibcLinuxSync = function() {\n return !1;\n}, isNonGlibcLinux = function() {\n return Promise.resolve(isNonGlibcLinuxSync());\n}, $, GLIBC = \"glibc\", MUSL = \"musl\";\n$ = {\n GLIBC,\n MUSL,\n family,\n familySync,\n isNonGlibcLinux,\n isNonGlibcLinuxSync,\n version,\n versionSync\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyDepdCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/depd.ts\nvar wrapfunction = function(fn, message) {\n if (typeof fn !== \"function\")\n @throwTypeError(\"argument fn must be a function\");\n return fn;\n}, wrapproperty = function(obj, prop, message) {\n if (!obj || typeof obj !== \"object\" && typeof obj !== \"function\")\n @throwTypeError(\"argument obj must be object\");\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n if (!descriptor)\n @throwTypeError(\"must call property on owner object\");\n if (!descriptor.configurable)\n @throwTypeError(\"property must be configurable\");\n}, $;\n$ = function depd(namespace) {\n if (!namespace)\n @throwTypeError(\"argument namespace is required\");\n function deprecate(message) {\n }\n return deprecate._file = void 0, deprecate._ignored = !0, deprecate._namespace = namespace, deprecate._traced = !1, deprecate._warned = Object.create(null), deprecate.function = wrapfunction, deprecate.property = wrapproperty, deprecate;\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyIsomorphicFetchCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/isomorphic-fetch.ts\nvar bunFetch = Bun.fetch, fetch = (...args) => bunFetch(...args);\nfetch.default = fetch;\nfetch.fetch = fetch;\nreturn fetch})\n"_s;
+static constexpr ASCIILiteral ThirdpartyDetectLibcCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/detect-libc.ts\nvar family = function() {\n return @Promise.resolve(familySync());\n}, familySync = function() {\n return null;\n}, version = function() {\n return @Promise.resolve(versionSync());\n}, versionSync = function() {\n return null;\n}, isNonGlibcLinuxSync = function() {\n return !1;\n}, isNonGlibcLinux = function() {\n return @Promise.resolve(isNonGlibcLinuxSync());\n}, $, GLIBC = \"glibc\", MUSL = \"musl\";\n$ = {\n GLIBC,\n MUSL,\n family,\n familySync,\n isNonGlibcLinux,\n isNonGlibcLinuxSync,\n version,\n versionSync\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyNodeFetchCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/node-fetch.ts\nasync function fetch(url, init) {\n let body = init\?.body;\n if (body) {\n const chunks = [];\n if (body instanceof Readable) {\n for await (let chunk of body)\n chunks.push(chunk);\n init = { ...init, body: new Blob(chunks) };\n }\n }\n const response = await nativeFetch(url, init);\n return Object.setPrototypeOf(response, Response.prototype), response;\n}\nvar blobFrom = function(path, options) {\n return Promise.resolve(Bun.file(path, options));\n}, blobFromSync = function(path, options) {\n return Bun.file(path, options);\n}, isRedirect = function(code) {\n return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n}, $, { Headers, Request, Response: WebResponse, Blob, File = Blob, FormData } = globalThis, nativeFetch = Bun.fetch, { Readable } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37);\n\nclass Response extends WebResponse {\n constructor() {\n super(...arguments);\n }\n _body;\n get body() {\n return this._body \?\? (this._body = Readable.fromWeb(super.body));\n }\n}\n\nclass AbortError extends DOMException {\n constructor(message) {\n super(message, \"AbortError\");\n }\n}\n\nclass FetchBaseError extends Error {\n type;\n constructor(message, type) {\n super(message);\n this.type = type;\n }\n}\n\nclass FetchError extends FetchBaseError {\n constructor(message, type, systemError) {\n super(message, type);\n this.code = systemError\?.code;\n }\n}\nvar fileFrom = blobFrom, fileFromSync = blobFromSync;\n$ = Object.assign(fetch, {\n AbortError,\n Blob,\n FetchBaseError,\n FetchError,\n File,\n FormData,\n Headers,\n Request,\n Response,\n blobFrom,\n blobFromSync,\n fileFrom,\n fileFromSync,\n isRedirect,\n fetch,\n default: fetch\n});\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyDetectLibcLinuxCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/detect-libc.linux.ts\nvar family = function() {\n return @Promise.resolve(familySync());\n}, familySync = function() {\n return GLIBC;\n}, version = function() {\n return @Promise.resolve(versionSync());\n}, versionSync = function() {\n return \"2.29\";\n}, isNonGlibcLinuxSync = function() {\n return !1;\n}, isNonGlibcLinux = function() {\n return @Promise.resolve(isNonGlibcLinuxSync());\n}, $, GLIBC = \"glibc\", MUSL = \"musl\";\n$ = {\n GLIBC,\n MUSL,\n family,\n familySync,\n isNonGlibcLinux,\n isNonGlibcLinuxSync,\n version,\n versionSync\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyUndiciCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/undici.ts\nvar notImplemented = function() {\n throw new Error(\"Not implemented in bun\");\n};\nasync function request(url, options = {\n method: \"GET\",\n signal: null,\n headers: null,\n query: null,\n reset: !1,\n throwOnError: !1,\n body: null\n}) {\n let {\n method = \"GET\",\n headers: inputHeaders,\n query,\n signal,\n reset = !1,\n throwOnError = !1,\n body: inputBody,\n maxRedirections\n } = options;\n if (typeof url === \"string\") {\n if (query)\n url = new URL(url);\n } else if (typeof url === \"object\" && url !== null) {\n if (!(url instanceof URL))\n throw new Error(\"not implemented\");\n } else\n @throwTypeError(\"url must be a string, URL, or UrlObject\");\n if (typeof url === \"string\" && query)\n url = new URL(url);\n if (typeof url === \"object\" && url !== null && query) {\n if (query)\n url.search = new URLSearchParams(query).toString();\n }\n if (method = method && typeof method === \"string\" \? method.toUpperCase() : null, inputBody && (method === \"GET\" || method === \"HEAD\"))\n throw new Error(\"Body not allowed for GET or HEAD requests\");\n if (inputBody && inputBody.read && inputBody instanceof Readable) {\n let data = \"\";\n inputBody.setEncoding(\"utf8\");\n for await (let chunk of stream)\n data += chunk;\n inputBody = (new TextEncoder()).encode(data);\n }\n if (maxRedirections !== void 0 && Number.isNaN(maxRedirections))\n throw new Error(\"maxRedirections must be a number if defined\");\n if (signal && !(signal instanceof AbortSignal))\n throw new Error(\"signal must be an instance of AbortSignal\");\n let resp;\n const {\n status: statusCode,\n headers,\n trailers\n } = resp = await fetch(url, {\n signal,\n mode: \"cors\",\n method,\n headers: inputHeaders || kEmptyObject,\n body: inputBody,\n redirect: maxRedirections === \"undefined\" || maxRedirections > 0 \? \"follow\" : \"manual\",\n keepalive: !reset\n });\n if (throwOnError && statusCode >= 400 && statusCode < 600)\n throw new Error(`Request failed with status code ${statusCode}`);\n const body = resp.body \? new BodyReadable(resp) : null;\n return { statusCode, headers: headers.toJSON(), body, trailers, opaque: kEmptyObject, context: kEmptyObject };\n}\nvar stream = function() {\n throw new Error(\"Not implemented in bun\");\n}, pipeline = function() {\n throw new Error(\"Not implemented in bun\");\n}, connect = function() {\n throw new Error(\"Not implemented in bun\");\n}, upgrade = function() {\n throw new Error(\"Not implemented in bun\");\n}, mockErrors = function() {\n throw new Error(\"Not implemented in bun\");\n}, Undici = function() {\n throw new Error(\"Not implemented in bun\");\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), StreamModule = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), { Readable } = StreamModule, { _ReadableFromWebForUndici: ReadableFromWeb } = StreamModule[Symbol.for(\"::bunternal::\")], ObjectCreate = Object.create, kEmptyObject = ObjectCreate(null), fetch = Bun.fetch, Response = globalThis.Response, Headers = globalThis.Headers, Request = globalThis.Request, URLSearchParams = globalThis.URLSearchParams, URL = globalThis.URL;\n\nclass File extends Blob {\n constructor() {\n super(...arguments);\n }\n}\n\nclass FileReader extends EventTarget {\n constructor() {\n throw new Error(\"Not implemented yet!\");\n }\n}\nvar FormData = globalThis.FormData;\n\nclass BodyReadable extends ReadableFromWeb {\n #response;\n #bodyUsed;\n constructor(response, options = {}) {\n var { body } = response;\n if (!body)\n throw new Error(\"Response body is null\");\n super(options, body);\n this.#response = response, this.#bodyUsed = response.bodyUsed;\n }\n get bodyUsed() {\n return this.#bodyUsed;\n }\n #consume() {\n if (this.#bodyUsed)\n @throwTypeError(\"unusable\");\n this.#bodyUsed = !0;\n }\n async arrayBuffer() {\n return this.#consume(), await this.#response.arrayBuffer();\n }\n async blob() {\n return this.#consume(), await this.#response.blob();\n }\n async formData() {\n return this.#consume(), await this.#response.formData();\n }\n async json() {\n return this.#consume(), await this.#response.json();\n }\n async text() {\n return this.#consume(), await this.#response.text();\n }\n}\n\nclass MockClient {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass MockPool {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass MockAgent {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass Dispatcher extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Agent extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Pool extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n request() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass BalancedPool extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Client extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n request() {\n throw new Error(\"Not implemented in bun\");\n }\n}\nUndici.Dispatcher = Dispatcher;\nUndici.Pool = Pool;\nUndici.BalancedPool = BalancedPool;\nUndici.Client = Client;\nUndici.Agent = Agent;\nUndici.buildConnector = Undici.errors = Undici.setGlobalDispatcher = Undici.getGlobalDispatcher = Undici.request = Undici.stream = Undici.pipeline = Undici.connect = Undici.upgrade = Undici.MockClient = Undici.MockPool = Undici.MockAgent = Undici.mockErrors = notImplemented;\nUndici.fetch = fetch;\n$ = {\n fetch,\n Response,\n Headers,\n Request,\n URLSearchParams,\n URL,\n File,\n FileReader,\n FormData,\n request,\n stream,\n pipeline,\n connect,\n upgrade,\n MockClient,\n MockPool,\n MockAgent,\n mockErrors,\n Dispatcher,\n Pool,\n BalancedPool,\n Client,\n Agent,\n Undici\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyIsomorphicFetchCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/isomorphic-fetch.ts\nvar bunFetch = Bun.fetch, fetch = (...args) => bunFetch(...args);\nfetch.default = fetch;\nfetch.fetch = fetch;\nreturn fetch})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyVercelFetchCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/vercel_fetch.ts\nvar $;\n$ = (wrapper = Bun.fetch) => {\n async function vercelFetch(url, opts = {}) {\n if (opts.body && typeof opts.body === \"object\" && (!(\"buffer\" in opts.body) || typeof opts.body.buffer !== \"object\" || !(opts.body.buffer instanceof ArrayBuffer))) {\n if (opts.body = JSON.stringify(opts.body), !opts.headers)\n opts.headers = new Headers;\n opts.headers.set(\"Content-Type\", \"application/json\");\n }\n try {\n return await wrapper(url, opts);\n } catch (err) {\n if (typeof err === \"string\")\n err = new Error(err);\n throw err.url = url, err.opts = opts, err;\n }\n }\n return vercelFetch.default = vercelFetch, vercelFetch;\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyNodeFetchCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/node-fetch.ts\nasync function fetch(url, init) {\n let body = init\?.body;\n if (body) {\n const chunks = [];\n if (body instanceof Readable) {\n for await (let chunk of body)\n chunks.push(chunk);\n init = { ...init, body: new Blob(chunks) };\n }\n }\n const response = await nativeFetch(url, init);\n return Object.setPrototypeOf(response, Response.prototype), response;\n}\nvar blobFrom = function(path, options) {\n return @Promise.resolve(Bun.file(path, options));\n}, blobFromSync = function(path, options) {\n return Bun.file(path, options);\n}, isRedirect = function(code) {\n return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n}, $, { Headers, Request, Response: WebResponse, Blob, File = Blob, FormData } = globalThis, nativeFetch = Bun.fetch, { Readable } = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39);\n\nclass Response extends WebResponse {\n constructor() {\n super(...arguments);\n }\n _body;\n get body() {\n return this._body \?\? (this._body = Readable.fromWeb(super.body));\n }\n}\n\nclass AbortError extends DOMException {\n constructor(message) {\n super(message, \"AbortError\");\n }\n}\n\nclass FetchBaseError extends Error {\n type;\n constructor(message, type) {\n super(message);\n this.type = type;\n }\n}\n\nclass FetchError extends FetchBaseError {\n constructor(message, type, systemError) {\n super(message, type);\n this.code = systemError\?.code;\n }\n}\nvar fileFrom = blobFrom, fileFromSync = blobFromSync;\n$ = Object.assign(fetch, {\n AbortError,\n Blob,\n FetchBaseError,\n FetchError,\n File,\n FormData,\n Headers,\n Request,\n Response,\n blobFrom,\n blobFromSync,\n fileFrom,\n fileFromSync,\n isRedirect,\n fetch,\n default: fetch\n});\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyWSCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/ws.ts\nvar emitWarning = function(type, message) {\n if (emittedWarnings.has(type))\n return;\n emittedWarnings.add(type), console.warn(\"[bun] Warning:\", message);\n}, subprotocolParse = function(header) {\n const protocols = new Set;\n let start = -1, end = -1, i = 0;\n for (i;i < header.length; i++) {\n const code = header.charCodeAt(i);\n if (end === -1 && wsTokenChars[code] === 1) {\n if (start === -1)\n start = i;\n } else if (i !== 0 && (code === 32 || code === 9)) {\n if (end === -1 && start !== -1)\n end = i;\n } else if (code === 44) {\n if (start === -1)\n throw new SyntaxError(`Unexpected character at index ${i}`);\n if (end === -1)\n end = i;\n const protocol2 = header.slice(start, end);\n if (protocols.has(protocol2))\n throw new SyntaxError(`The \"${protocol2}\" subprotocol is duplicated`);\n protocols.add(protocol2), start = end = -1;\n } else\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n if (start === -1 || end !== -1)\n throw new SyntaxError(\"Unexpected end of input\");\n const protocol = header.slice(start, i);\n if (protocols.has(protocol))\n throw new SyntaxError(`The \"${protocol}\" subprotocol is duplicated`);\n return protocols.add(protocol), protocols;\n}, wsEmitClose = function(server) {\n server._state = CLOSED, server.emit(\"close\");\n}, abortHandshake = function(response, code, message, headers) {\n message = message || http.STATUS_CODES[code], headers = {\n Connection: \"close\",\n \"Content-Type\": \"text/html\",\n \"Content-Length\": Buffer.byteLength(message),\n ...headers\n }, response.writeHead(code, headers), response.write(message), response.end();\n}, abortHandshakeOrEmitwsClientError = function(server, req, response, socket, code, message) {\n if (server.listenerCount(\"wsClientError\")) {\n const err = new Error(message);\n Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError), server.emit(\"wsClientError\", err, socket, req);\n } else\n abortHandshake(response, code, message);\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), http = @getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21), kBunInternals = Symbol.for(\"::bunternal::\"), readyStates = [\"CONNECTING\", \"OPEN\", \"CLOSING\", \"CLOSED\"], encoder = new TextEncoder, eventIds = {\n open: 1,\n close: 2,\n message: 3,\n error: 4,\n ping: 5,\n pong: 6\n}, emittedWarnings = new Set;\n\nclass BunWebSocket extends EventEmitter {\n static CONNECTING = 0;\n static OPEN = 1;\n static CLOSING = 2;\n static CLOSED = 3;\n #ws;\n #paused = !1;\n #fragments = !1;\n #binaryType = \"nodebuffer\";\n #eventId = 0;\n constructor(url, protocols, options) {\n super();\n let ws = this.#ws = new WebSocket(url, protocols);\n ws.binaryType = \"nodebuffer\";\n }\n on(event, listener) {\n if (event === \"unexpected-response\" || event === \"upgrade\" || event === \"redirect\")\n emitWarning(event, \"ws.WebSocket '\" + event + \"' event is not implemented in bun\");\n const mask = 1 << eventIds[event];\n if (mask && (this.#eventId & mask) !== mask) {\n if (this.#eventId |= mask, event === \"open\")\n this.#ws.addEventListener(\"open\", () => {\n this.emit(\"open\");\n });\n else if (event === \"close\")\n this.#ws.addEventListener(\"close\", ({ code, reason, wasClean }) => {\n this.emit(\"close\", code, reason, wasClean);\n });\n else if (event === \"message\")\n this.#ws.addEventListener(\"message\", ({ data }) => {\n const isBinary = typeof data !== \"string\";\n if (isBinary)\n this.emit(\"message\", this.#fragments \? [data] : data, isBinary);\n else {\n let encoded = encoder.encode(data);\n if (this.#binaryType !== \"arraybuffer\")\n encoded = Buffer.from(encoded.buffer, encoded.byteOffset, encoded.byteLength);\n this.emit(\"message\", this.#fragments \? [encoded] : encoded, isBinary);\n }\n });\n else if (event === \"error\")\n this.#ws.addEventListener(\"error\", (err) => {\n this.emit(\"error\", err);\n });\n else if (event === \"ping\")\n this.#ws.addEventListener(\"ping\", ({ data }) => {\n this.emit(\"ping\", data);\n });\n else if (event === \"pong\")\n this.#ws.addEventListener(\"pong\", ({ data }) => {\n this.emit(\"pong\", data);\n });\n }\n return super.on(event, listener);\n }\n send(data, opts, cb) {\n try {\n this.#ws.send(data, opts\?.compress);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n close(code, reason) {\n this.#ws.close(code, reason);\n }\n terminate() {\n this.#ws.terminate();\n }\n get url() {\n return this.#ws.url;\n }\n get readyState() {\n return this.#ws.readyState;\n }\n get binaryType() {\n return this.#binaryType;\n }\n set binaryType(value) {\n if (value === \"nodebuffer\" || value === \"arraybuffer\")\n this.#ws.binaryType = this.#binaryType = value, this.#fragments = !1;\n else if (value === \"fragments\")\n this.#ws.binaryType = \"nodebuffer\", this.#binaryType = \"fragments\", this.#fragments = !0;\n else\n throw new Error(`Invalid binaryType: ${value}`);\n }\n get protocol() {\n return this.#ws.protocol;\n }\n get extensions() {\n return this.#ws.extensions;\n }\n addEventListener(type, listener, options) {\n this.#ws.addEventListener(type, listener, options);\n }\n removeEventListener(type, listener) {\n this.#ws.removeEventListener(type, listener);\n }\n get onopen() {\n return this.#ws.onopen;\n }\n set onopen(value) {\n this.#ws.onopen = value;\n }\n get onerror() {\n return this.#ws.onerror;\n }\n set onerror(value) {\n this.#ws.onerror = value;\n }\n get onclose() {\n return this.#ws.onclose;\n }\n set onclose(value) {\n this.#ws.onclose = value;\n }\n get onmessage() {\n return this.#ws.onmessage;\n }\n set onmessage(value) {\n this.#ws.onmessage = value;\n }\n get bufferedAmount() {\n return this.#ws.bufferedAmount;\n }\n get isPaused() {\n return this.#paused;\n }\n ping(data, mask, cb) {\n if (typeof data === \"function\")\n cb = data, data = mask = void 0;\n else if (typeof mask === \"function\")\n cb = mask, mask = void 0;\n if (typeof data === \"number\")\n data = data.toString();\n try {\n this.#ws.ping(data);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n pong(data, mask, cb) {\n if (typeof data === \"function\")\n cb = data, data = mask = void 0;\n else if (typeof mask === \"function\")\n cb = mask, mask = void 0;\n if (typeof data === \"number\")\n data = data.toString();\n try {\n this.#ws.pong(data);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n pause() {\n switch (this.readyState) {\n case WebSocket.CONNECTING:\n case WebSocket.CLOSED:\n return;\n }\n this.#paused = !0, emitWarning(\"pause()\", \"ws.WebSocket.pause() is not implemented in bun\");\n }\n resume() {\n switch (this.readyState) {\n case WebSocket.CONNECTING:\n case WebSocket.CLOSED:\n return;\n }\n this.#paused = !1, emitWarning(\"resume()\", \"ws.WebSocket.resume() is not implemented in bun\");\n }\n}\nObject.defineProperty(BunWebSocket, \"name\", { value: \"WebSocket\" });\nvar wsKeyRegex = /^[+/0-9A-Za-z]{22}==$/, wsTokenChars = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 1,\n 0,\n 1,\n 0\n], RUNNING = 0, CLOSING = 1, CLOSED = 2;\n\nclass BunWebSocketMocked extends EventEmitter {\n #ws;\n #state;\n #enquedMessages = [];\n #url;\n #protocol;\n #extensions;\n #bufferedAmount = 0;\n #binaryType = \"arraybuffer\";\n #onclose;\n #onerror;\n #onmessage;\n #onopen;\n constructor(url, protocol, extensions, binaryType) {\n super();\n if (this.#ws = null, this.#state = 0, this.#url = url, this.#bufferedAmount = 0, binaryType = binaryType || \"arraybuffer\", binaryType !== \"nodebuffer\" && binaryType !== \"blob\" && binaryType !== \"arraybuffer\")\n @throwTypeError(\"binaryType must be either 'blob', 'arraybuffer' or 'nodebuffer'\");\n this.#binaryType = binaryType, this.#protocol = protocol, this.#extensions = extensions;\n const message = this.#message.bind(this), open = this.#open.bind(this), close = this.#close.bind(this), drain = this.#drain.bind(this);\n this[kBunInternals] = {\n message,\n open,\n close,\n drain\n };\n }\n #message(ws, message) {\n if (this.#ws = ws, typeof message === \"string\")\n if (this.#binaryType === \"arraybuffer\")\n message = encoder.encode(message).buffer;\n else if (this.#binaryType === \"blob\")\n message = new Blob([message], { type: \"text/plain\" });\n else\n message = Buffer.from(message);\n else if (this.#binaryType !== \"nodebuffer\") {\n if (this.#binaryType === \"arraybuffer\")\n message = new Uint8Array(message);\n else if (this.#binaryType === \"blob\")\n message = new Blob([message]);\n }\n this.emit(\"message\", message);\n }\n #open(ws) {\n this.#ws = ws, this.#state = 1, this.emit(\"open\", this), this.#drain(ws);\n }\n #close(ws, code, reason) {\n this.#state = 3, this.#ws = null, this.emit(\"close\", code, reason);\n }\n #drain(ws) {\n const chunk = this.#enquedMessages[0];\n if (chunk) {\n const [data, compress, cb] = chunk;\n if (ws.send(data, compress) == -1)\n return;\n typeof cb === \"function\" && cb(), this.#bufferedAmount -= chunk.length, this.#enquedMessages.shift();\n }\n }\n send(data, opts, cb) {\n if (this.#state === 1) {\n const compress = opts\?.compress;\n if (this.#ws.send(data, compress) == -1) {\n this.#enquedMessages.push([data, compress, cb]), this.#bufferedAmount += data.length;\n return;\n }\n typeof cb === \"function\" && cb();\n } else if (this.#state === 0)\n this.#enquedMessages.push([data, opts\?.compress, cb]), this.#bufferedAmount += data.length;\n }\n close(code, reason) {\n if (this.#state === 1)\n this.#state = 2, this.#ws.close(code, reason);\n }\n get binaryType() {\n return this.#binaryType;\n }\n set binaryType(type) {\n if (type !== \"nodebuffer\" && type !== \"blob\" && type !== \"arraybuffer\")\n @throwTypeError(\"binaryType must be either 'blob', 'arraybuffer' or 'nodebuffer'\");\n this.#binaryType = type;\n }\n get readyState() {\n return this.#state;\n }\n get url() {\n return this.#url;\n }\n get protocol() {\n return this.#protocol;\n }\n get extensions() {\n return this.#extensions;\n }\n get bufferedAmount() {\n return this.#bufferedAmount \?\? 0;\n }\n setSocket(socket, head, options) {\n throw new Error(\"Not implemented\");\n }\n set onclose(cb) {\n if (this.#onclose)\n this.removeListener(\"close\", this.#onclose);\n this.on(\"close\", cb), this.#onclose = cb;\n }\n set onerror(cb) {\n if (this.#onerror)\n this.removeListener(\"error\", this.#onerror);\n this.on(\"error\", cb), this.#onerror = cb;\n }\n set onmessage(cb) {\n if (this.#onmessage)\n this.removeListener(\"message\", this.#onmessage);\n this.on(\"message\", cb), this.#onmessage = cb;\n }\n set onopen(cb) {\n if (this.#onopen)\n this.removeListener(\"open\", this.#onopen);\n this.on(\"open\", cb), this.#onopen = cb;\n }\n get onclose() {\n return this.#onclose;\n }\n get onerror() {\n return this.#onerror;\n }\n get onmessage() {\n return this.#onmessage;\n }\n get onopen() {\n return this.#onopen;\n }\n addEventListener(type, listener, options) {\n if (type === \"message\") {\n const l = (data) => listener({ data });\n l.listener = listener, this.on(type, l);\n return;\n }\n this.on(type, listener);\n }\n removeEventListener(type, listener) {\n this.off(type, listener);\n }\n}\n\nclass WebSocketServer extends EventEmitter {\n _server;\n options;\n clients;\n _shouldEmitClose;\n _state;\n _removeListeners;\n constructor(options, callback) {\n super();\n if (options = {\n maxPayload: 104857600,\n skipUTF8Validation: !1,\n perMessageDeflate: !1,\n handleProtocols: null,\n clientTracking: !0,\n verifyClient: null,\n noServer: !1,\n backlog: null,\n server: null,\n host: null,\n path: null,\n port: null,\n ...options\n }, options.port == null && !options.server && !options.noServer || options.port != null && (options.server || options.noServer) || options.server && options.noServer)\n @throwTypeError('One and only one of the \"port\", \"server\", or \"noServer\" options must be specified');\n if (options.port != null)\n this._server = http.createServer((req, res) => {\n const body = http.STATUS_CODES[426];\n res.writeHead(426, {\n \"Content-Length\": body.length,\n \"Content-Type\": \"text/plain\"\n }), res.end(body);\n }), this._server.listen(options.port, options.host, options.backlog, callback);\n else if (options.server)\n this._server = options.server;\n if (this._server) {\n const emitConnection = this.emit.bind(this, \"connection\"), emitListening = this.emit.bind(this, \"listening\"), emitError = this.emit.bind(this, \"error\"), doUpgrade = (req, socket, head) => {\n this.handleUpgrade(req, socket, head, emitConnection);\n };\n this._server.on(\"listening\", emitListening), this._server.on(\"error\", emitError), this._server.on(\"upgrade\", doUpgrade), this._removeListeners = () => {\n this._server.removeListener(\"upgrade\", doUpgrade), this._server.removeListener(\"listening\", emitListening), this._server.removeListener(\"error\", emitError);\n };\n }\n if (options.perMessageDeflate === !0)\n options.perMessageDeflate = {};\n if (options.clientTracking)\n this.clients = new Set, this._shouldEmitClose = !1;\n this.options = options, this._state = RUNNING;\n }\n address() {\n if (this.options.noServer)\n throw new Error('The server is operating in \"noServer\" mode');\n if (!this._server)\n return null;\n return this._server.address();\n }\n close(cb) {\n if (this._state === CLOSED) {\n if (cb)\n this.once(\"close\", () => {\n cb(new Error(\"The server is not running\"));\n });\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n return;\n }\n if (cb)\n this.once(\"close\", cb);\n if (this._state === CLOSING)\n return;\n if (this._state = CLOSING, this.options.noServer || this.options.server) {\n if (this._server)\n this._removeListeners(), this._removeListeners = this._server = null;\n if (this.clients)\n if (!this.clients.size)\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n else\n this._shouldEmitClose = !0;\n else\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n } else {\n const server = this._server;\n this._removeListeners(), this._removeListeners = this._server = null, server.close(() => {\n this._state = CLOSED, this.emit(\"close\");\n });\n }\n }\n shouldHandle(req) {\n if (this.options.path) {\n const index = req.url.indexOf(\"\?\");\n if ((index !== -1 \? req.url.slice(0, index) : req.url) !== this.options.path)\n return !1;\n }\n return !0;\n }\n completeUpgrade(extensions, key, protocols, request, socket, head, cb) {\n const [server, response, req] = socket[kBunInternals];\n if (this._state > RUNNING)\n return abortHandshake(response, 503);\n let protocol = \"\";\n if (protocols.size)\n protocol = this.options.handleProtocols \? this.options.handleProtocols(protocols, request) : protocols.values().next().value;\n const ws = new BunWebSocketMocked(request.url, protocol, extensions, \"nodebuffer\"), headers = [\"HTTP/1.1 101 Switching Protocols\", \"Upgrade: websocket\", \"Connection: Upgrade\"];\n if (this.emit(\"headers\", headers, request), server.upgrade(req, {\n data: ws[kBunInternals]\n })) {\n if (response._reply(void 0), this.clients)\n this.clients.add(ws), ws.on(\"close\", () => {\n if (this.clients.delete(ws), this._shouldEmitClose && !this.clients.size)\n process.nextTick(wsEmitClose, this);\n });\n cb(ws, request);\n } else\n abortHandshake(response, 500);\n }\n handleUpgrade(req, socket, head, cb) {\n const [_, response] = socket[kBunInternals], key = req.headers[\"sec-websocket-key\"], version = +req.headers[\"sec-websocket-version\"];\n if (req.method !== \"GET\") {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 405, \"Invalid HTTP method\");\n return;\n }\n if (req.headers.upgrade.toLowerCase() !== \"websocket\") {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Invalid Upgrade header\");\n return;\n }\n if (!key || !wsKeyRegex.test(key)) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Missing or invalid Sec-WebSocket-Key header\");\n return;\n }\n if (version !== 8 && version !== 13) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Missing or invalid Sec-WebSocket-Version header\");\n return;\n }\n if (!this.shouldHandle(req)) {\n abortHandshake(response, 400);\n return;\n }\n const secWebSocketProtocol = req.headers[\"sec-websocket-protocol\"];\n let protocols = new Set;\n if (secWebSocketProtocol !== void 0)\n try {\n protocols = subprotocolParse(secWebSocketProtocol);\n } catch (err) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Invalid Sec-WebSocket-Protocol header\");\n return;\n }\n const extensions = {};\n if (this.options.verifyClient) {\n const info = {\n origin: req.headers[`${version === 8 \? \"sec-websocket-origin\" : \"origin\"}`],\n secure: !!(req.socket.authorized || req.socket.encrypted),\n req\n };\n if (this.options.verifyClient.length === 2) {\n this.options.verifyClient(info, (verified, code, message, headers) => {\n if (!verified)\n return abortHandshake(response, code || 401, message, headers);\n this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);\n });\n return;\n }\n if (!this.options.verifyClient(info))\n return abortHandshake(response, 401);\n }\n this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);\n }\n}\nObject.defineProperty(BunWebSocket, \"CONNECTING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CONNECTING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(BunWebSocket, \"OPEN\", {\n enumerable: !0,\n value: readyStates.indexOf(\"OPEN\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"OPEN\", {\n enumerable: !0,\n value: readyStates.indexOf(\"OPEN\")\n});\nObject.defineProperty(BunWebSocket, \"CLOSING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSING\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CLOSING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSING\")\n});\nObject.defineProperty(BunWebSocket, \"CLOSED\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSED\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CLOSED\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSED\")\n});\n\nclass Sender {\n constructor() {\n throw new Error(\"Not supported yet in Bun\");\n }\n}\n\nclass Receiver {\n constructor() {\n throw new Error(\"Not supported yet in Bun\");\n }\n}\nvar createWebSocketStream = (ws) => {\n throw new Error(\"Not supported yet in Bun\");\n};\n$ = Object.assign(BunWebSocket, {\n createWebSocketStream,\n Receiver,\n Sender,\n WebSocket: BunWebSocket,\n Server: WebSocketServer,\n WebSocketServer\n});\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyUndiciCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/undici.ts\nvar notImplemented = function() {\n throw new Error(\"Not implemented in bun\");\n};\nasync function request(url, options = {\n method: \"GET\",\n signal: null,\n headers: null,\n query: null,\n reset: !1,\n throwOnError: !1,\n body: null\n}) {\n let {\n method = \"GET\",\n headers: inputHeaders,\n query,\n signal,\n reset = !1,\n throwOnError = !1,\n body: inputBody,\n maxRedirections\n } = options;\n if (typeof url === \"string\") {\n if (query)\n url = new URL(url);\n } else if (typeof url === \"object\" && url !== null) {\n if (!(url instanceof URL))\n throw new Error(\"not implemented\");\n } else\n @throwTypeError(\"url must be a string, URL, or UrlObject\");\n if (typeof url === \"string\" && query)\n url = new URL(url);\n if (typeof url === \"object\" && url !== null && query) {\n if (query)\n url.search = new URLSearchParams(query).toString();\n }\n if (method = method && typeof method === \"string\" \? method.toUpperCase() : null, inputBody && (method === \"GET\" || method === \"HEAD\"))\n throw new Error(\"Body not allowed for GET or HEAD requests\");\n if (inputBody && inputBody.read && inputBody instanceof Readable) {\n let data = \"\";\n inputBody.setEncoding(\"utf8\");\n for await (let chunk of stream)\n data += chunk;\n inputBody = (new TextEncoder()).encode(data);\n }\n if (maxRedirections !== @undefined && Number.isNaN(maxRedirections))\n throw new Error(\"maxRedirections must be a number if defined\");\n if (signal && !(signal instanceof @AbortSignal))\n throw new Error(\"signal must be an instance of AbortSignal\");\n let resp;\n const {\n status: statusCode,\n headers,\n trailers\n } = resp = await fetch(url, {\n signal,\n mode: \"cors\",\n method,\n headers: inputHeaders || kEmptyObject,\n body: inputBody,\n redirect: maxRedirections === \"undefined\" || maxRedirections > 0 \? \"follow\" : \"manual\",\n keepalive: !reset\n });\n if (throwOnError && statusCode >= 400 && statusCode < 600)\n throw new Error(`Request failed with status code ${statusCode}`);\n const body = resp.body \? new BodyReadable(resp) : null;\n return { statusCode, headers: headers.toJSON(), body, trailers, opaque: kEmptyObject, context: kEmptyObject };\n}\nvar stream = function() {\n throw new Error(\"Not implemented in bun\");\n}, pipeline = function() {\n throw new Error(\"Not implemented in bun\");\n}, connect = function() {\n throw new Error(\"Not implemented in bun\");\n}, upgrade = function() {\n throw new Error(\"Not implemented in bun\");\n}, mockErrors = function() {\n throw new Error(\"Not implemented in bun\");\n}, Undici = function() {\n throw new Error(\"Not implemented in bun\");\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), StreamModule = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), { Readable } = StreamModule, { _ReadableFromWebForUndici: ReadableFromWeb } = StreamModule[Symbol.for(\"::bunternal::\")], ObjectCreate = Object.create, kEmptyObject = ObjectCreate(null), fetch = Bun.fetch, Response = globalThis.Response, Headers = globalThis.Headers, Request = globalThis.Request, URLSearchParams = globalThis.URLSearchParams, URL = globalThis.URL;\n\nclass File extends Blob {\n constructor() {\n super(...arguments);\n }\n}\n\nclass FileReader extends EventTarget {\n constructor() {\n throw new Error(\"Not implemented yet!\");\n }\n}\nvar FormData = globalThis.FormData;\n\nclass BodyReadable extends ReadableFromWeb {\n #response;\n #bodyUsed;\n constructor(response, options = {}) {\n var { body } = response;\n if (!body)\n throw new Error(\"Response body is null\");\n super(options, body);\n this.#response = response, this.#bodyUsed = response.bodyUsed;\n }\n get bodyUsed() {\n return this.#bodyUsed;\n }\n #consume() {\n if (this.#bodyUsed)\n @throwTypeError(\"unusable\");\n this.#bodyUsed = !0;\n }\n async arrayBuffer() {\n return this.#consume(), await this.#response.arrayBuffer();\n }\n async blob() {\n return this.#consume(), await this.#response.blob();\n }\n async formData() {\n return this.#consume(), await this.#response.formData();\n }\n async json() {\n return this.#consume(), await this.#response.json();\n }\n async text() {\n return this.#consume(), await this.#response.text();\n }\n}\n\nclass MockClient {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass MockPool {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass MockAgent {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass Dispatcher extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Agent extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Pool extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n request() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass BalancedPool extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Client extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n request() {\n throw new Error(\"Not implemented in bun\");\n }\n}\nUndici.Dispatcher = Dispatcher;\nUndici.Pool = Pool;\nUndici.BalancedPool = BalancedPool;\nUndici.Client = Client;\nUndici.Agent = Agent;\nUndici.buildConnector = Undici.errors = Undici.setGlobalDispatcher = Undici.getGlobalDispatcher = Undici.request = Undici.stream = Undici.pipeline = Undici.connect = Undici.upgrade = Undici.MockClient = Undici.MockPool = Undici.MockAgent = Undici.mockErrors = notImplemented;\nUndici.fetch = fetch;\n$ = {\n fetch,\n Response,\n Headers,\n Request,\n URLSearchParams,\n URL,\n File,\n FileReader,\n FormData,\n request,\n stream,\n pipeline,\n connect,\n upgrade,\n MockClient,\n MockPool,\n MockAgent,\n mockErrors,\n Dispatcher,\n Pool,\n BalancedPool,\n Client,\n Agent,\n Undici\n};\nreturn $})\n");
+//
+
+//
+static constexpr ASCIILiteral ThirdpartyVercelFetchCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/vercel_fetch.ts\nvar $;\n$ = (wrapper = Bun.fetch) => {\n async function vercelFetch(url, opts = {}) {\n if (opts.body && typeof opts.body === \"object\" && (!(\"buffer\" in opts.body) || typeof opts.body.buffer !== \"object\" || !(opts.body.buffer instanceof @ArrayBuffer))) {\n if (opts.body = JSON.stringify(opts.body), !opts.headers)\n opts.headers = new Headers;\n opts.headers.set(\"Content-Type\", \"application/json\");\n }\n try {\n return await wrapper(url, opts);\n } catch (err) {\n if (typeof err === \"string\")\n err = new Error(err);\n throw err.url = url, err.opts = opts, err;\n }\n }\n return vercelFetch.default = vercelFetch, vercelFetch;\n};\nreturn $})\n");
+//
+
+//
+static constexpr ASCIILiteral ThirdpartyWSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/ws.ts\nvar emitWarning = function(type, message) {\n if (emittedWarnings.has(type))\n return;\n emittedWarnings.add(type), console.warn(\"[bun] Warning:\", message);\n}, subprotocolParse = function(header) {\n const protocols = new Set;\n let start = -1, end = -1, i = 0;\n for (i;i < header.length; i++) {\n const code = header.charCodeAt(i);\n if (end === -1 && wsTokenChars[code] === 1) {\n if (start === -1)\n start = i;\n } else if (i !== 0 && (code === 32 || code === 9)) {\n if (end === -1 && start !== -1)\n end = i;\n } else if (code === 44) {\n if (start === -1)\n throw new SyntaxError(`Unexpected character at index ${i}`);\n if (end === -1)\n end = i;\n const protocol2 = header.slice(start, end);\n if (protocols.has(protocol2))\n throw new SyntaxError(`The \"${protocol2}\" subprotocol is duplicated`);\n protocols.add(protocol2), start = end = -1;\n } else\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n if (start === -1 || end !== -1)\n throw new SyntaxError(\"Unexpected end of input\");\n const protocol = header.slice(start, i);\n if (protocols.has(protocol))\n throw new SyntaxError(`The \"${protocol}\" subprotocol is duplicated`);\n return protocols.add(protocol), protocols;\n}, wsEmitClose = function(server) {\n server._state = CLOSED, server.emit(\"close\");\n}, abortHandshake = function(response, code, message, headers) {\n message = message || http.STATUS_CODES[code], headers = {\n Connection: \"close\",\n \"Content-Type\": \"text/html\",\n \"Content-Length\": @Buffer.byteLength(message),\n ...headers\n }, response.writeHead(code, headers), response.write(message), response.end();\n}, abortHandshakeOrEmitwsClientError = function(server, req, response, socket, code, message) {\n if (server.listenerCount(\"wsClientError\")) {\n const err = new Error(message);\n Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError), server.emit(\"wsClientError\", err, socket, req);\n } else\n abortHandshake(response, code, message);\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), http = @getInternalField(@internalModuleRegistry, 23) || @createInternalModuleById(23), kBunInternals = Symbol.for(\"::bunternal::\"), readyStates = [\"CONNECTING\", \"OPEN\", \"CLOSING\", \"CLOSED\"], encoder = new TextEncoder, eventIds = {\n open: 1,\n close: 2,\n message: 3,\n error: 4,\n ping: 5,\n pong: 6\n}, emittedWarnings = new Set;\n\nclass BunWebSocket extends EventEmitter {\n static CONNECTING = 0;\n static OPEN = 1;\n static CLOSING = 2;\n static CLOSED = 3;\n #ws;\n #paused = !1;\n #fragments = !1;\n #binaryType = \"nodebuffer\";\n #eventId = 0;\n constructor(url, protocols, options) {\n super();\n let ws = this.#ws = new WebSocket(url, protocols);\n ws.binaryType = \"nodebuffer\";\n }\n on(event, listener) {\n if (event === \"unexpected-response\" || event === \"upgrade\" || event === \"redirect\")\n emitWarning(event, \"ws.WebSocket '\" + event + \"' event is not implemented in bun\");\n const mask = 1 << eventIds[event];\n if (mask && (this.#eventId & mask) !== mask) {\n if (this.#eventId |= mask, event === \"open\")\n this.#ws.addEventListener(\"open\", () => {\n this.emit(\"open\");\n });\n else if (event === \"close\")\n this.#ws.addEventListener(\"close\", ({ code, reason, wasClean }) => {\n this.emit(\"close\", code, reason, wasClean);\n });\n else if (event === \"message\")\n this.#ws.addEventListener(\"message\", ({ data }) => {\n const isBinary = typeof data !== \"string\";\n if (isBinary)\n this.emit(\"message\", this.#fragments \? [data] : data, isBinary);\n else {\n let encoded = encoder.encode(data);\n if (this.#binaryType !== \"arraybuffer\")\n encoded = @Buffer.from(encoded.buffer, encoded.byteOffset, encoded.byteLength);\n this.emit(\"message\", this.#fragments \? [encoded] : encoded, isBinary);\n }\n });\n else if (event === \"error\")\n this.#ws.addEventListener(\"error\", (err) => {\n this.emit(\"error\", err);\n });\n else if (event === \"ping\")\n this.#ws.addEventListener(\"ping\", ({ data }) => {\n this.emit(\"ping\", data);\n });\n else if (event === \"pong\")\n this.#ws.addEventListener(\"pong\", ({ data }) => {\n this.emit(\"pong\", data);\n });\n }\n return super.on(event, listener);\n }\n send(data, opts, cb) {\n try {\n this.#ws.send(data, opts\?.compress);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n close(code, reason) {\n this.#ws.close(code, reason);\n }\n terminate() {\n this.#ws.terminate();\n }\n get url() {\n return this.#ws.url;\n }\n get readyState() {\n return this.#ws.readyState;\n }\n get binaryType() {\n return this.#binaryType;\n }\n set binaryType(value) {\n if (value === \"nodebuffer\" || value === \"arraybuffer\")\n this.#ws.binaryType = this.#binaryType = value, this.#fragments = !1;\n else if (value === \"fragments\")\n this.#ws.binaryType = \"nodebuffer\", this.#binaryType = \"fragments\", this.#fragments = !0;\n else\n throw new Error(`Invalid binaryType: ${value}`);\n }\n get protocol() {\n return this.#ws.protocol;\n }\n get extensions() {\n return this.#ws.extensions;\n }\n addEventListener(type, listener, options) {\n this.#ws.addEventListener(type, listener, options);\n }\n removeEventListener(type, listener) {\n this.#ws.removeEventListener(type, listener);\n }\n get onopen() {\n return this.#ws.onopen;\n }\n set onopen(value) {\n this.#ws.onopen = value;\n }\n get onerror() {\n return this.#ws.onerror;\n }\n set onerror(value) {\n this.#ws.onerror = value;\n }\n get onclose() {\n return this.#ws.onclose;\n }\n set onclose(value) {\n this.#ws.onclose = value;\n }\n get onmessage() {\n return this.#ws.onmessage;\n }\n set onmessage(value) {\n this.#ws.onmessage = value;\n }\n get bufferedAmount() {\n return this.#ws.bufferedAmount;\n }\n get isPaused() {\n return this.#paused;\n }\n ping(data, mask, cb) {\n if (typeof data === \"function\")\n cb = data, data = mask = @undefined;\n else if (typeof mask === \"function\")\n cb = mask, mask = @undefined;\n if (typeof data === \"number\")\n data = data.toString();\n try {\n this.#ws.ping(data);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n pong(data, mask, cb) {\n if (typeof data === \"function\")\n cb = data, data = mask = @undefined;\n else if (typeof mask === \"function\")\n cb = mask, mask = @undefined;\n if (typeof data === \"number\")\n data = data.toString();\n try {\n this.#ws.pong(data);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n pause() {\n switch (this.readyState) {\n case WebSocket.CONNECTING:\n case WebSocket.CLOSED:\n return;\n }\n this.#paused = !0, emitWarning(\"pause()\", \"ws.WebSocket.pause() is not implemented in bun\");\n }\n resume() {\n switch (this.readyState) {\n case WebSocket.CONNECTING:\n case WebSocket.CLOSED:\n return;\n }\n this.#paused = !1, emitWarning(\"resume()\", \"ws.WebSocket.resume() is not implemented in bun\");\n }\n}\nObject.defineProperty(BunWebSocket, \"name\", { value: \"WebSocket\" });\nvar wsKeyRegex = /^[+/0-9A-Za-z]{22}==$/, wsTokenChars = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 1,\n 0,\n 1,\n 0\n], RUNNING = 0, CLOSING = 1, CLOSED = 2;\n\nclass BunWebSocketMocked extends EventEmitter {\n #ws;\n #state;\n #enquedMessages = [];\n #url;\n #protocol;\n #extensions;\n #bufferedAmount = 0;\n #binaryType = \"arraybuffer\";\n #onclose;\n #onerror;\n #onmessage;\n #onopen;\n constructor(url, protocol, extensions, binaryType) {\n super();\n if (this.#ws = null, this.#state = 0, this.#url = url, this.#bufferedAmount = 0, binaryType = binaryType || \"arraybuffer\", binaryType !== \"nodebuffer\" && binaryType !== \"blob\" && binaryType !== \"arraybuffer\")\n @throwTypeError(\"binaryType must be either 'blob', 'arraybuffer' or 'nodebuffer'\");\n this.#binaryType = binaryType, this.#protocol = protocol, this.#extensions = extensions;\n const message = this.#message.bind(this), open = this.#open.bind(this), close = this.#close.bind(this), drain = this.#drain.bind(this);\n this[kBunInternals] = {\n message,\n open,\n close,\n drain\n };\n }\n #message(ws, message) {\n this.#ws = ws;\n let isBinary = !1;\n if (typeof message === \"string\")\n if (this.#binaryType === \"arraybuffer\")\n message = encoder.encode(message).buffer;\n else if (this.#binaryType === \"blob\")\n message = new Blob([message], { type: \"text/plain\" });\n else\n message = @Buffer.from(message);\n else if (isBinary = !0, this.#binaryType !== \"nodebuffer\") {\n if (this.#binaryType === \"arraybuffer\")\n message = new @Uint8Array(message);\n else if (this.#binaryType === \"blob\")\n message = new Blob([message]);\n }\n this.emit(\"message\", message, isBinary);\n }\n #open(ws) {\n this.#ws = ws, this.#state = 1, this.emit(\"open\", this), this.#drain(ws);\n }\n #close(ws, code, reason) {\n this.#state = 3, this.#ws = null, this.emit(\"close\", code, reason);\n }\n #drain(ws) {\n const chunk = this.#enquedMessages[0];\n if (chunk) {\n const [data, compress, cb] = chunk;\n if (ws.send(data, compress) == -1)\n return;\n typeof cb === \"function\" && cb(), this.#bufferedAmount -= chunk.length, this.#enquedMessages.shift();\n }\n }\n send(data, opts, cb) {\n if (this.#state === 1) {\n const compress = opts\?.compress;\n if (this.#ws.send(data, compress) == -1) {\n this.#enquedMessages.push([data, compress, cb]), this.#bufferedAmount += data.length;\n return;\n }\n typeof cb === \"function\" && cb();\n } else if (this.#state === 0)\n this.#enquedMessages.push([data, opts\?.compress, cb]), this.#bufferedAmount += data.length;\n }\n close(code, reason) {\n if (this.#state === 1)\n this.#state = 2, this.#ws.close(code, reason);\n }\n get binaryType() {\n return this.#binaryType;\n }\n set binaryType(type) {\n if (type !== \"nodebuffer\" && type !== \"blob\" && type !== \"arraybuffer\")\n @throwTypeError(\"binaryType must be either 'blob', 'arraybuffer' or 'nodebuffer'\");\n this.#binaryType = type;\n }\n get readyState() {\n return this.#state;\n }\n get url() {\n return this.#url;\n }\n get protocol() {\n return this.#protocol;\n }\n get extensions() {\n return this.#extensions;\n }\n get bufferedAmount() {\n return this.#bufferedAmount \?\? 0;\n }\n setSocket(socket, head, options) {\n throw new Error(\"Not implemented\");\n }\n set onclose(cb) {\n if (this.#onclose)\n this.removeListener(\"close\", this.#onclose);\n this.on(\"close\", cb), this.#onclose = cb;\n }\n set onerror(cb) {\n if (this.#onerror)\n this.removeListener(\"error\", this.#onerror);\n this.on(\"error\", cb), this.#onerror = cb;\n }\n set onmessage(cb) {\n if (this.#onmessage)\n this.removeListener(\"message\", this.#onmessage);\n this.on(\"message\", cb), this.#onmessage = cb;\n }\n set onopen(cb) {\n if (this.#onopen)\n this.removeListener(\"open\", this.#onopen);\n this.on(\"open\", cb), this.#onopen = cb;\n }\n get onclose() {\n return this.#onclose;\n }\n get onerror() {\n return this.#onerror;\n }\n get onmessage() {\n return this.#onmessage;\n }\n get onopen() {\n return this.#onopen;\n }\n addEventListener(type, listener, options) {\n if (type === \"message\") {\n const l = (data) => listener({ data });\n l.listener = listener, this.on(type, l);\n return;\n }\n this.on(type, listener);\n }\n removeEventListener(type, listener) {\n this.off(type, listener);\n }\n}\n\nclass WebSocketServer extends EventEmitter {\n _server;\n options;\n clients;\n _shouldEmitClose;\n _state;\n _removeListeners;\n constructor(options, callback) {\n super();\n if (options = {\n maxPayload: 104857600,\n skipUTF8Validation: !1,\n perMessageDeflate: !1,\n handleProtocols: null,\n clientTracking: !0,\n verifyClient: null,\n noServer: !1,\n backlog: null,\n server: null,\n host: null,\n path: null,\n port: null,\n ...options\n }, options.port == null && !options.server && !options.noServer || options.port != null && (options.server || options.noServer) || options.server && options.noServer)\n @throwTypeError('One and only one of the \"port\", \"server\", or \"noServer\" options must be specified');\n if (options.port != null)\n this._server = http.createServer((req, res) => {\n const body = http.STATUS_CODES[426];\n res.writeHead(426, {\n \"Content-Length\": body.length,\n \"Content-Type\": \"text/plain\"\n }), res.end(body);\n }), this._server.listen(options.port, options.host, options.backlog, callback);\n else if (options.server)\n this._server = options.server;\n if (this._server) {\n const emitConnection = this.emit.bind(this, \"connection\"), emitListening = this.emit.bind(this, \"listening\"), emitError = this.emit.bind(this, \"error\"), doUpgrade = (req, socket, head) => {\n this.handleUpgrade(req, socket, head, emitConnection);\n };\n this._server.on(\"listening\", emitListening), this._server.on(\"error\", emitError), this._server.on(\"upgrade\", doUpgrade), this._removeListeners = () => {\n this._server.removeListener(\"upgrade\", doUpgrade), this._server.removeListener(\"listening\", emitListening), this._server.removeListener(\"error\", emitError);\n };\n }\n if (options.perMessageDeflate === !0)\n options.perMessageDeflate = {};\n if (options.clientTracking)\n this.clients = new Set, this._shouldEmitClose = !1;\n this.options = options, this._state = RUNNING;\n }\n address() {\n if (this.options.noServer)\n throw new Error('The server is operating in \"noServer\" mode');\n if (!this._server)\n return null;\n return this._server.address();\n }\n close(cb) {\n if (this._state === CLOSED) {\n if (cb)\n this.once(\"close\", () => {\n cb(new Error(\"The server is not running\"));\n });\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n return;\n }\n if (cb)\n this.once(\"close\", cb);\n if (this._state === CLOSING)\n return;\n if (this._state = CLOSING, this.options.noServer || this.options.server) {\n if (this._server)\n this._removeListeners(), this._removeListeners = this._server = null;\n if (this.clients)\n if (!this.clients.size)\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n else\n this._shouldEmitClose = !0;\n else\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n } else {\n const server = this._server;\n this._removeListeners(), this._removeListeners = this._server = null, server.close(() => {\n this._state = CLOSED, this.emit(\"close\");\n });\n }\n }\n shouldHandle(req) {\n if (this.options.path) {\n const index = req.url.indexOf(\"\?\");\n if ((index !== -1 \? req.url.slice(0, index) : req.url) !== this.options.path)\n return !1;\n }\n return !0;\n }\n completeUpgrade(extensions, key, protocols, request, socket, head, cb) {\n const [server, response, req] = socket[kBunInternals];\n if (this._state > RUNNING)\n return abortHandshake(response, 503);\n let protocol = \"\";\n if (protocols.size)\n protocol = this.options.handleProtocols \? this.options.handleProtocols(protocols, request) : protocols.values().next().value;\n const ws = new BunWebSocketMocked(request.url, protocol, extensions, \"nodebuffer\"), headers = [\"HTTP/1.1 101 Switching Protocols\", \"Upgrade: websocket\", \"Connection: Upgrade\"];\n if (this.emit(\"headers\", headers, request), server.upgrade(req, {\n data: ws[kBunInternals]\n })) {\n if (response._reply(@undefined), this.clients)\n this.clients.add(ws), ws.on(\"close\", () => {\n if (this.clients.delete(ws), this._shouldEmitClose && !this.clients.size)\n process.nextTick(wsEmitClose, this);\n });\n cb(ws, request);\n } else\n abortHandshake(response, 500);\n }\n handleUpgrade(req, socket, head, cb) {\n const [_, response] = socket[kBunInternals], key = req.headers[\"sec-websocket-key\"], version = +req.headers[\"sec-websocket-version\"];\n if (req.method !== \"GET\") {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 405, \"Invalid HTTP method\");\n return;\n }\n if (req.headers.upgrade.toLowerCase() !== \"websocket\") {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Invalid Upgrade header\");\n return;\n }\n if (!key || !wsKeyRegex.test(key)) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Missing or invalid Sec-WebSocket-Key header\");\n return;\n }\n if (version !== 8 && version !== 13) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Missing or invalid Sec-WebSocket-Version header\");\n return;\n }\n if (!this.shouldHandle(req)) {\n abortHandshake(response, 400);\n return;\n }\n const secWebSocketProtocol = req.headers[\"sec-websocket-protocol\"];\n let protocols = new Set;\n if (secWebSocketProtocol !== @undefined)\n try {\n protocols = subprotocolParse(secWebSocketProtocol);\n } catch (err) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Invalid Sec-WebSocket-Protocol header\");\n return;\n }\n const extensions = {};\n if (this.options.verifyClient) {\n const info = {\n origin: req.headers[`${version === 8 \? \"sec-websocket-origin\" : \"origin\"}`],\n secure: !!(req.socket.authorized || req.socket.encrypted),\n req\n };\n if (this.options.verifyClient.length === 2) {\n this.options.verifyClient(info, (verified, code, message, headers) => {\n if (!verified)\n return abortHandshake(response, code || 401, message, headers);\n this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);\n });\n return;\n }\n if (!this.options.verifyClient(info))\n return abortHandshake(response, 401);\n }\n this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);\n }\n}\nObject.defineProperty(BunWebSocket, \"CONNECTING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CONNECTING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(BunWebSocket, \"OPEN\", {\n enumerable: !0,\n value: readyStates.indexOf(\"OPEN\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"OPEN\", {\n enumerable: !0,\n value: readyStates.indexOf(\"OPEN\")\n});\nObject.defineProperty(BunWebSocket, \"CLOSING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSING\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CLOSING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSING\")\n});\nObject.defineProperty(BunWebSocket, \"CLOSED\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSED\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CLOSED\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSED\")\n});\n\nclass Sender {\n constructor() {\n throw new Error(\"Not supported yet in Bun\");\n }\n}\n\nclass Receiver {\n constructor() {\n throw new Error(\"Not supported yet in Bun\");\n }\n}\nvar createWebSocketStream = (ws) => {\n throw new Error(\"Not supported yet in Bun\");\n};\n$ = Object.assign(BunWebSocket, {\n createWebSocketStream,\n Receiver,\n Sender,\n WebSocket: BunWebSocket,\n Server: WebSocketServer,\n WebSocketServer\n});\nreturn $})\n");
//
#elif _WIN32
//
-static constexpr ASCIILiteral BunFFICode = "(function (){\"use strict\";// src/js/out/tmp/bun/ffi.ts\nvar FFIBuilder = function(params, returnType, functionToCall, name) {\n const hasReturnType = typeof FFIType[returnType] === \"number\" && FFIType[returnType] !== FFIType.void;\n var paramNames = new Array(params.length), args = new Array(params.length);\n for (let i = 0;i < params.length; i++) {\n paramNames[i] = `p${i}`;\n const wrapper = ffiWrappers[FFIType[params[i]]];\n if (wrapper)\n args[i] = `(val=>${wrapper})(p${i})`;\n else\n @throwTypeError(`Unsupported type ${params[i]}. Must be one of: ${Object.keys(FFIType).sort().join(\", \")}`);\n }\n var code = `functionToCall(${args.join(\", \")})`;\n if (hasReturnType)\n if (FFIType[returnType] === FFIType.cstring)\n code = `return new __GlobalBunCString(${code})`;\n else\n code = `return ${code}`;\n var func = new Function(\"functionToCall\", ...paramNames, code);\n Object.defineProperty(func, \"name\", {\n value: name\n });\n var wrap;\n switch (paramNames.length) {\n case 0:\n wrap = () => func(functionToCall);\n break;\n case 1:\n wrap = (arg1) => func(functionToCall, arg1);\n break;\n case 2:\n wrap = (arg1, arg2) => func(functionToCall, arg1, arg2);\n break;\n case 3:\n wrap = (arg1, arg2, arg3) => func(functionToCall, arg1, arg2, arg3);\n break;\n case 4:\n wrap = (arg1, arg2, arg3, arg4) => func(functionToCall, arg1, arg2, arg3, arg4);\n break;\n case 5:\n wrap = (arg1, arg2, arg3, arg4, arg5) => func(functionToCall, arg1, arg2, arg3, arg4, arg5);\n break;\n case 6:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6);\n break;\n case 7:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7);\n break;\n case 8:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);\n break;\n case 9:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);\n break;\n default: {\n wrap = (...args2) => func(functionToCall, ...args2);\n break;\n }\n }\n return wrap.native = functionToCall, wrap.ptr = functionToCall.ptr, wrap;\n}, dlopen = function(path, options) {\n const result = nativeDLOpen(path, options);\n for (let key in result.symbols) {\n var symbol = result.symbols[key];\n if (options[key]\?.args\?.length || FFIType[options[key]\?.returns] === FFIType.cstring)\n result.symbols[key] = FFIBuilder(options[key].args \?\? [], options[key].returns \?\? FFIType.void, symbol, path.includes(\"/\") \? `${key} (${path.split(\"/\").pop()})` : `${key} (${path})`);\n else\n result.symbols[key].native = result.symbols[key];\n }\n return result.close = result.close.bind(result), result;\n}, linkSymbols = function(options) {\n const result = nativeLinkSymbols(options);\n for (let key in result.symbols) {\n var symbol = result.symbols[key];\n if (options[key]\?.args\?.length || FFIType[options[key]\?.returns] === FFIType.cstring)\n result.symbols[key] = FFIBuilder(options[key].args \?\? [], options[key].returns \?\? FFIType.void, symbol, key);\n else\n result.symbols[key].native = result.symbols[key];\n }\n return result;\n}, onCloseCFunction = function(close) {\n close();\n}, CFunction = function(options) {\n const identifier = `CFunction${cFunctionI++}`;\n var result = linkSymbols({\n [identifier]: options\n }), hasClosed = !1, close = result.close.bind(result);\n return result.symbols[identifier].close = () => {\n if (hasClosed || !close)\n return;\n hasClosed = !0, close(), close = void 0;\n }, cFunctionRegistry ||= new FinalizationRegistry(onCloseCFunction), cFunctionRegistry.register(result.symbols[identifier], result.symbols[identifier].close), result.symbols[identifier];\n}, $, FFIType = {\n \"0\": 0,\n \"1\": 1,\n \"2\": 2,\n \"3\": 3,\n \"4\": 4,\n \"5\": 5,\n \"6\": 6,\n \"7\": 7,\n \"8\": 8,\n \"9\": 9,\n \"10\": 10,\n \"11\": 11,\n \"12\": 12,\n \"13\": 13,\n \"14\": 14,\n \"15\": 15,\n \"16\": 16,\n \"17\": 17,\n bool: 11,\n c_int: 5,\n c_uint: 6,\n char: 0,\n \"char*\": 12,\n double: 9,\n f32: 10,\n f64: 9,\n float: 10,\n i16: 3,\n i32: 5,\n i64: 7,\n i8: 1,\n int: 5,\n int16_t: 3,\n int32_t: 5,\n int64_t: 7,\n int8_t: 1,\n isize: 7,\n u16: 4,\n u32: 6,\n u64: 8,\n u8: 2,\n uint16_t: 4,\n uint32_t: 6,\n uint64_t: 8,\n uint8_t: 2,\n usize: 8,\n \"void*\": 12,\n ptr: 12,\n pointer: 12,\n void: 13,\n cstring: 14,\n i64_fast: 15,\n u64_fast: 16,\n function: 17,\n callback: 17,\n fn: 17\n};\nvar ffi = globalThis.Bun.FFI, ptr = (arg1, arg2) => typeof arg2 === \"undefined\" \? ffi.ptr(arg1) : ffi.ptr(arg1, arg2), toBuffer = ffi.toBuffer, toArrayBuffer = ffi.toArrayBuffer, viewSource = ffi.viewSource, BunCString = ffi.CString, nativeLinkSymbols = ffi.linkSymbols, nativeDLOpen = ffi.dlopen, nativeCallback = ffi.callback, closeCallback = ffi.closeCallback;\ndelete ffi.callback;\ndelete ffi.closeCallback;\n\nclass JSCallback {\n constructor(cb, options) {\n const { ctx, ptr: ptr2 } = nativeCallback(options, cb);\n this.#ctx = ctx, this.ptr = ptr2, this.#threadsafe = !!options\?.threadsafe;\n }\n ptr;\n #ctx;\n #threadsafe;\n get threadsafe() {\n return this.#threadsafe;\n }\n [Symbol.toPrimitive]() {\n const { ptr: ptr2 } = this;\n return typeof ptr2 === \"number\" \? ptr2 : 0;\n }\n close() {\n const ctx = this.#ctx;\n if (this.ptr = null, this.#ctx = null, ctx)\n closeCallback(ctx);\n }\n}\n\nclass CString extends String {\n constructor(ptr2, byteOffset, byteLength) {\n super(ptr2 \? typeof byteLength === \"number\" && Number.isSafeInteger(byteLength) \? BunCString(ptr2, byteOffset || 0, byteLength) : BunCString(ptr2) : \"\");\n if (this.ptr = typeof ptr2 === \"number\" \? ptr2 : 0, typeof byteOffset !== \"undefined\")\n this.byteOffset = byteOffset;\n if (typeof byteLength !== \"undefined\")\n this.byteLength = byteLength;\n }\n ptr;\n byteOffset;\n byteLength;\n #cachedArrayBuffer;\n get arrayBuffer() {\n if (this.#cachedArrayBuffer)\n return this.#cachedArrayBuffer;\n if (!this.ptr)\n return this.#cachedArrayBuffer = new ArrayBuffer(0);\n return this.#cachedArrayBuffer = toArrayBuffer(this.ptr, this.byteOffset, this.byteLength);\n }\n}\nObject.defineProperty(globalThis, \"__GlobalBunCString\", {\n value: CString,\n enumerable: !1,\n configurable: !1\n});\nvar ffiWrappers = new Array(18), char = \"val|0\";\nffiWrappers.fill(char);\nffiWrappers[FFIType.uint8_t] = \"val<0\?0:val>=255\?255:val|0\";\nffiWrappers[FFIType.int16_t] = \"val<=-32768\?-32768:val>=32768\?32768:val|0\";\nffiWrappers[FFIType.uint16_t] = \"val<=0\?0:val>=65536\?65536:val|0\";\nffiWrappers[FFIType.int32_t] = \"val|0\";\nffiWrappers[FFIType.uint32_t] = \"val<=0\?0:val>=0xffffffff\?0xffffffff:+val||0\";\nffiWrappers[FFIType.i64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(-Number.MAX_SAFE_INTEGER)) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.i64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(-Number.MAX_SAFE_INTEGER)) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.u64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= 0) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.int64_t] = `{\n if (typeof val === \"bigint\") {\n return val;\n }\n\n if (typeof val === \"number\") {\n return BigInt(val || 0);\n }\n\n return BigInt(+val || 0);\n}`;\nffiWrappers[FFIType.uint64_t] = `{\n if (typeof val === \"bigint\") {\n return val;\n }\n\n if (typeof val === \"number\") {\n return val <= 0 \? BigInt(0) : BigInt(val || 0);\n }\n\n return BigInt(+val || 0);\n}`;\nffiWrappers[FFIType.u64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(0)) return Number(val);\n return val;\n }\n\n return typeof val === \"number\" \? (val <= 0 \? 0 : +val || 0) : +val || 0;\n}`;\nffiWrappers[FFIType.uint16_t] = `{\n const ret = (typeof val === \"bigint\" \? Number(val) : val) | 0;\n return ret <= 0 \? 0 : ret > 0xffff \? 0xffff : ret;\n}`;\nffiWrappers[FFIType.double] = `{\n if (typeof val === \"bigint\") {\n if (val.valueOf() < BigInt(Number.MAX_VALUE)) {\n return Math.abs(Number(val).valueOf()) + 0.00000000000001 - 0.00000000000001;\n }\n }\n\n if (!val) {\n return 0 + 0.00000000000001 - 0.00000000000001;\n }\n\n return val + 0.00000000000001 - 0.00000000000001;\n}`;\nffiWrappers[FFIType.float] = ffiWrappers[10] = `{\n return Math.fround(val);\n}`;\nffiWrappers[FFIType.bool] = `{\n return !!val;\n}`;\nObject.defineProperty(globalThis, \"__GlobalBunFFIPtrFunctionForWrapper\", {\n value: ptr,\n enumerable: !1,\n configurable: !0\n});\nffiWrappers[FFIType.cstring] = ffiWrappers[FFIType.pointer] = `{\n if (typeof val === \"number\") return val;\n if (!val) {\n return null;\n }\n\n if (ArrayBuffer.isView(val) || val instanceof ArrayBuffer) {\n return __GlobalBunFFIPtrFunctionForWrapper(val);\n }\n\n if (typeof val === \"string\") {\n throw new TypeError(\"To convert a string to a pointer, encode it as a buffer\");\n }\n\n throw new TypeError(\\`Unable to convert \\${ val } to a pointer\\`);\n}`;\nffiWrappers[FFIType.function] = `{\n if (typeof val === \"number\") {\n return val;\n }\n\n if (typeof val === \"bigint\") {\n return Number(val);\n }\n\n var ptr = val && val.ptr;\n\n if (!ptr) {\n throw new TypeError(\"Expected function to be a JSCallback or a number\");\n }\n\n return ptr;\n}`;\nvar native = {\n dlopen: nativeDLOpen,\n callback: () => {\n throw new Error(\"Deprecated. Use new JSCallback(options, fn) instead\");\n }\n}, cFunctionI = 0, cFunctionRegistry, read = ffi.read;\n$ = {\n CFunction,\n CString,\n FFIType,\n JSCallback,\n dlopen,\n linkSymbols,\n native,\n ptr,\n read,\n suffix: \"dll\",\n toArrayBuffer,\n toBuffer,\n viewSource\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral BunFFICode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/bun/ffi.ts\nvar FFIBuilder = function(params, returnType, functionToCall, name) {\n const hasReturnType = typeof FFIType[returnType] === \"number\" && FFIType[returnType] !== FFIType.void;\n var paramNames = new @Array(params.length), args = new @Array(params.length);\n for (let i = 0;i < params.length; i++) {\n paramNames[i] = `p${i}`;\n const wrapper = ffiWrappers[FFIType[params[i]]];\n if (wrapper)\n args[i] = `(val=>${wrapper})(p${i})`;\n else\n @throwTypeError(`Unsupported type ${params[i]}. Must be one of: ${Object.keys(FFIType).sort().join(\", \")}`);\n }\n var code = `functionToCall(${args.join(\", \")})`;\n if (hasReturnType)\n if (FFIType[returnType] === FFIType.cstring)\n code = `return new __GlobalBunCString(${code})`;\n else\n code = `return ${code}`;\n var func = new Function(\"functionToCall\", ...paramNames, code);\n Object.defineProperty(func, \"name\", {\n value: name\n });\n var wrap;\n switch (paramNames.length) {\n case 0:\n wrap = () => func(functionToCall);\n break;\n case 1:\n wrap = (arg1) => func(functionToCall, arg1);\n break;\n case 2:\n wrap = (arg1, arg2) => func(functionToCall, arg1, arg2);\n break;\n case 3:\n wrap = (arg1, arg2, arg3) => func(functionToCall, arg1, arg2, arg3);\n break;\n case 4:\n wrap = (arg1, arg2, arg3, arg4) => func(functionToCall, arg1, arg2, arg3, arg4);\n break;\n case 5:\n wrap = (arg1, arg2, arg3, arg4, arg5) => func(functionToCall, arg1, arg2, arg3, arg4, arg5);\n break;\n case 6:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6);\n break;\n case 7:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7);\n break;\n case 8:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);\n break;\n case 9:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);\n break;\n default: {\n wrap = (...args2) => func(functionToCall, ...args2);\n break;\n }\n }\n return wrap.native = functionToCall, wrap.ptr = functionToCall.ptr, wrap;\n}, dlopen = function(path, options) {\n const result = nativeDLOpen(path, options);\n if (result instanceof Error)\n throw result;\n for (let key in result.symbols) {\n var symbol = result.symbols[key];\n if (options[key]\?.args\?.length || FFIType[options[key]\?.returns] === FFIType.cstring)\n result.symbols[key] = FFIBuilder(options[key].args \?\? [], options[key].returns \?\? FFIType.void, symbol, path.includes(\"/\") \? `${key} (${path.split(\"/\").pop()})` : `${key} (${path})`);\n else\n result.symbols[key].native = result.symbols[key];\n }\n return result.close = result.close.bind(result), result;\n}, linkSymbols = function(options) {\n const result = nativeLinkSymbols(options);\n for (let key in result.symbols) {\n var symbol = result.symbols[key];\n if (options[key]\?.args\?.length || FFIType[options[key]\?.returns] === FFIType.cstring)\n result.symbols[key] = FFIBuilder(options[key].args \?\? [], options[key].returns \?\? FFIType.void, symbol, key);\n else\n result.symbols[key].native = result.symbols[key];\n }\n return result;\n}, onCloseCFunction = function(close) {\n close();\n}, CFunction = function(options) {\n const identifier = `CFunction${cFunctionI++}`;\n var result = linkSymbols({\n [identifier]: options\n }), hasClosed = !1, close = result.close.bind(result);\n return result.symbols[identifier].close = () => {\n if (hasClosed || !close)\n return;\n hasClosed = !0, close(), close = @undefined;\n }, cFunctionRegistry ||= new FinalizationRegistry(onCloseCFunction), cFunctionRegistry.register(result.symbols[identifier], result.symbols[identifier].close), result.symbols[identifier];\n}, $, FFIType = {\n \"0\": 0,\n \"1\": 1,\n \"2\": 2,\n \"3\": 3,\n \"4\": 4,\n \"5\": 5,\n \"6\": 6,\n \"7\": 7,\n \"8\": 8,\n \"9\": 9,\n \"10\": 10,\n \"11\": 11,\n \"12\": 12,\n \"13\": 13,\n \"14\": 14,\n \"15\": 15,\n \"16\": 16,\n \"17\": 17,\n bool: 11,\n c_int: 5,\n c_uint: 6,\n char: 0,\n \"char*\": 12,\n double: 9,\n f32: 10,\n f64: 9,\n float: 10,\n i16: 3,\n i32: 5,\n i64: 7,\n i8: 1,\n int: 5,\n int16_t: 3,\n int32_t: 5,\n int64_t: 7,\n int8_t: 1,\n isize: 7,\n u16: 4,\n u32: 6,\n u64: 8,\n u8: 2,\n uint16_t: 4,\n uint32_t: 6,\n uint64_t: 8,\n uint8_t: 2,\n usize: 8,\n \"void*\": 12,\n ptr: 12,\n pointer: 12,\n void: 13,\n cstring: 14,\n i64_fast: 15,\n u64_fast: 16,\n function: 17,\n callback: 17,\n fn: 17\n};\nvar ffi = globalThis.Bun.FFI, ptr = (arg1, arg2) => typeof arg2 === \"undefined\" \? ffi.ptr(arg1) : ffi.ptr(arg1, arg2), toBuffer = ffi.toBuffer, toArrayBuffer = ffi.toArrayBuffer, viewSource = ffi.viewSource, BunCString = ffi.CString, nativeLinkSymbols = ffi.linkSymbols, nativeDLOpen = ffi.dlopen, nativeCallback = ffi.callback, closeCallback = ffi.closeCallback;\ndelete ffi.callback;\ndelete ffi.closeCallback;\n\nclass JSCallback {\n constructor(cb, options) {\n const { ctx, ptr: ptr2 } = nativeCallback(options, cb);\n this.#ctx = ctx, this.ptr = ptr2, this.#threadsafe = !!options\?.threadsafe;\n }\n ptr;\n #ctx;\n #threadsafe;\n get threadsafe() {\n return this.#threadsafe;\n }\n [Symbol.toPrimitive]() {\n const { ptr: ptr2 } = this;\n return typeof ptr2 === \"number\" \? ptr2 : 0;\n }\n close() {\n const ctx = this.#ctx;\n if (this.ptr = null, this.#ctx = null, ctx)\n closeCallback(ctx);\n }\n}\n\nclass CString extends @String {\n constructor(ptr2, byteOffset, byteLength) {\n super(ptr2 \? typeof byteLength === \"number\" && Number.isSafeInteger(byteLength) \? BunCString(ptr2, byteOffset || 0, byteLength) : BunCString(ptr2) : \"\");\n if (this.ptr = typeof ptr2 === \"number\" \? ptr2 : 0, typeof byteOffset !== \"undefined\")\n this.byteOffset = byteOffset;\n if (typeof byteLength !== \"undefined\")\n this.byteLength = byteLength;\n }\n ptr;\n byteOffset;\n byteLength;\n #cachedArrayBuffer;\n get arrayBuffer() {\n if (this.#cachedArrayBuffer)\n return this.#cachedArrayBuffer;\n if (!this.ptr)\n return this.#cachedArrayBuffer = new @ArrayBuffer(0);\n return this.#cachedArrayBuffer = toArrayBuffer(this.ptr, this.byteOffset, this.byteLength);\n }\n}\nObject.defineProperty(globalThis, \"__GlobalBunCString\", {\n value: CString,\n enumerable: !1,\n configurable: !1\n});\nvar ffiWrappers = new @Array(18), char = \"val|0\";\nffiWrappers.fill(char);\nffiWrappers[FFIType.uint8_t] = \"val<0\?0:val>=255\?255:val|0\";\nffiWrappers[FFIType.int16_t] = \"val<=-32768\?-32768:val>=32768\?32768:val|0\";\nffiWrappers[FFIType.uint16_t] = \"val<=0\?0:val>=65536\?65536:val|0\";\nffiWrappers[FFIType.int32_t] = \"val|0\";\nffiWrappers[FFIType.uint32_t] = \"val<=0\?0:val>=0xffffffff\?0xffffffff:+val||0\";\nffiWrappers[FFIType.i64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(-Number.MAX_SAFE_INTEGER)) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.i64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(-Number.MAX_SAFE_INTEGER)) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.u64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= 0) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.int64_t] = `{\n if (typeof val === \"bigint\") {\n return val;\n }\n\n if (typeof val === \"number\") {\n return BigInt(val || 0);\n }\n\n return BigInt(+val || 0);\n}`;\nffiWrappers[FFIType.uint64_t] = `{\n if (typeof val === \"bigint\") {\n return val;\n }\n\n if (typeof val === \"number\") {\n return val <= 0 \? BigInt(0) : BigInt(val || 0);\n }\n\n return BigInt(+val || 0);\n}`;\nffiWrappers[FFIType.u64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(0)) return Number(val);\n return val;\n }\n\n return typeof val === \"number\" \? (val <= 0 \? 0 : +val || 0) : +val || 0;\n}`;\nffiWrappers[FFIType.uint16_t] = `{\n const ret = (typeof val === \"bigint\" \? Number(val) : val) | 0;\n return ret <= 0 \? 0 : ret > 0xffff \? 0xffff : ret;\n}`;\nffiWrappers[FFIType.double] = `{\n if (typeof val === \"bigint\") {\n if (val.valueOf() < BigInt(Number.MAX_VALUE)) {\n return Math.abs(Number(val).valueOf()) + 0.00000000000001 - 0.00000000000001;\n }\n }\n\n if (!val) {\n return 0 + 0.00000000000001 - 0.00000000000001;\n }\n\n return val + 0.00000000000001 - 0.00000000000001;\n}`;\nffiWrappers[FFIType.float] = ffiWrappers[10] = `{\n return Math.fround(val);\n}`;\nffiWrappers[FFIType.bool] = `{\n return !!val;\n}`;\nObject.defineProperty(globalThis, \"__GlobalBunFFIPtrFunctionForWrapper\", {\n value: ptr,\n enumerable: !1,\n configurable: !0\n});\nffiWrappers[FFIType.cstring] = ffiWrappers[FFIType.pointer] = `{\n if (typeof val === \"number\") return val;\n if (!val) {\n return null;\n }\n\n if (ArrayBuffer.isView(val) || val instanceof ArrayBuffer) {\n return __GlobalBunFFIPtrFunctionForWrapper(val);\n }\n\n if (typeof val === \"string\") {\n throw new TypeError(\"To convert a string to a pointer, encode it as a buffer\");\n }\n\n throw new TypeError(\\`Unable to convert \\${ val } to a pointer\\`);\n}`;\nffiWrappers[FFIType.function] = `{\n if (typeof val === \"number\") {\n return val;\n }\n\n if (typeof val === \"bigint\") {\n return Number(val);\n }\n\n var ptr = val && val.ptr;\n\n if (!ptr) {\n throw new TypeError(\"Expected function to be a JSCallback or a number\");\n }\n\n return ptr;\n}`;\nvar native = {\n dlopen: nativeDLOpen,\n callback: () => {\n throw new Error(\"Deprecated. Use new JSCallback(options, fn) instead\");\n }\n}, cFunctionI = 0, cFunctionRegistry, read = ffi.read;\n$ = {\n CFunction,\n CString,\n FFIType,\n JSCallback,\n dlopen,\n linkSymbols,\n native,\n ptr,\n read,\n suffix: \"dll\",\n toArrayBuffer,\n toBuffer,\n viewSource\n};\nreturn $})\n");
+//
+
+//
+static constexpr ASCIILiteral BunSqliteCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/bun/sqlite.ts\nvar $, defineProperties = Object.defineProperties, toStringTag = Symbol.toStringTag, isArray = @Array.isArray, isTypedArray = @ArrayBuffer.isView, constants = {\n SQLITE_OPEN_READONLY: 1,\n SQLITE_OPEN_READWRITE: 2,\n SQLITE_OPEN_CREATE: 4,\n SQLITE_OPEN_DELETEONCLOSE: 8,\n SQLITE_OPEN_EXCLUSIVE: 16,\n SQLITE_OPEN_AUTOPROXY: 32,\n SQLITE_OPEN_URI: 64,\n SQLITE_OPEN_MEMORY: 128,\n SQLITE_OPEN_MAIN_DB: 256,\n SQLITE_OPEN_TEMP_DB: 512,\n SQLITE_OPEN_TRANSIENT_DB: 1024,\n SQLITE_OPEN_MAIN_JOURNAL: 2048,\n SQLITE_OPEN_TEMP_JOURNAL: 4096,\n SQLITE_OPEN_SUBJOURNAL: 8192,\n SQLITE_OPEN_SUPER_JOURNAL: 16384,\n SQLITE_OPEN_NOMUTEX: 32768,\n SQLITE_OPEN_FULLMUTEX: 65536,\n SQLITE_OPEN_SHAREDCACHE: 131072,\n SQLITE_OPEN_PRIVATECACHE: 262144,\n SQLITE_OPEN_WAL: 524288,\n SQLITE_OPEN_NOFOLLOW: 16777216,\n SQLITE_OPEN_EXRESCODE: 33554432,\n SQLITE_PREPARE_PERSISTENT: 1,\n SQLITE_PREPARE_NORMALIZE: 2,\n SQLITE_PREPARE_NO_VTAB: 4\n}, SQL, controllers;\n\nclass Statement {\n constructor(raw) {\n switch (this.#raw = raw, raw.paramsCount) {\n case 0: {\n this.get = this.#getNoArgs, this.all = this.#allNoArgs, this.values = this.#valuesNoArgs, this.run = this.#runNoArgs;\n break;\n }\n default: {\n this.get = this.#get, this.all = this.#all, this.values = this.#values, this.run = this.#run;\n break;\n }\n }\n }\n #raw;\n get;\n all;\n values;\n run;\n isFinalized = !1;\n toJSON() {\n return {\n sql: this.native.toString(),\n isFinalized: this.isFinalized,\n paramsCount: this.paramsCount,\n columnNames: this.columnNames\n };\n }\n get [toStringTag]() {\n return `\"${this.native.toString()}\"`;\n }\n toString() {\n return this.native.toString();\n }\n get native() {\n return this.#raw;\n }\n #getNoArgs() {\n return this.#raw.get();\n }\n #allNoArgs() {\n return this.#raw.all();\n }\n #valuesNoArgs() {\n return this.#raw.values();\n }\n #runNoArgs() {\n this.#raw.run();\n }\n #get(...args) {\n if (args.length === 0)\n return this.#getNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.get(args) : this.#raw.get(...args);\n }\n #all(...args) {\n if (args.length === 0)\n return this.#allNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.all(args) : this.#raw.all(...args);\n }\n #values(...args) {\n if (args.length === 0)\n return this.#valuesNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.values(args) : this.#raw.values(...args);\n }\n #run(...args) {\n if (args.length === 0)\n return this.#runNoArgs();\n var arg0 = args[0];\n !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.run(args) : this.#raw.run(...args);\n }\n get columnNames() {\n return this.#raw.columns;\n }\n get paramsCount() {\n return this.#raw.paramsCount;\n }\n finalize(...args) {\n return this.isFinalized = !0, this.#raw.finalize(...args);\n }\n}\nvar cachedCount = Symbol.for(\"Bun.Database.cache.count\");\n\nclass Database {\n constructor(filenameGiven, options) {\n if (typeof filenameGiven === \"undefined\")\n ;\n else if (typeof filenameGiven !== \"string\") {\n if (isTypedArray(filenameGiven)) {\n this.#handle = Database.#deserialize(filenameGiven, typeof options === \"object\" && options \? !!options.readonly : ((options | 0) & constants.SQLITE_OPEN_READONLY) != 0), this.filename = \":memory:\";\n return;\n }\n @throwTypeError(`Expected 'filename' to be a string, got '${typeof filenameGiven}'`);\n }\n var filename = typeof filenameGiven === \"string\" \? filenameGiven.trim() : \":memory:\", flags = constants.SQLITE_OPEN_READWRITE | constants.SQLITE_OPEN_CREATE;\n if (typeof options === \"object\" && options) {\n if (flags = 0, options.readonly)\n flags = constants.SQLITE_OPEN_READONLY;\n if (\"readOnly\" in options)\n @throwTypeError('Misspelled option \"readOnly\" should be \"readonly\"');\n if (options.create)\n flags = constants.SQLITE_OPEN_READWRITE | constants.SQLITE_OPEN_CREATE;\n if (options.readwrite)\n flags |= constants.SQLITE_OPEN_READWRITE;\n } else if (typeof options === \"number\")\n flags = options;\n const anonymous = filename === \"\" || filename === \":memory:\";\n if (anonymous && (flags & constants.SQLITE_OPEN_READONLY) !== 0)\n throw new Error(\"Cannot open an anonymous database in read-only mode.\");\n if (!SQL)\n SQL = @lazy(\"sqlite\");\n this.#handle = SQL.open(anonymous \? \":memory:\" : filename, flags), this.filename = filename;\n }\n #handle;\n #cachedQueriesKeys = [];\n #cachedQueriesLengths = [];\n #cachedQueriesValues = [];\n filename;\n get handle() {\n return this.#handle;\n }\n get inTransaction() {\n return SQL.isInTransaction(this.#handle);\n }\n static open(filename, options) {\n return new Database(filename, options);\n }\n loadExtension(name, entryPoint) {\n return SQL.loadExtension(this.#handle, name, entryPoint);\n }\n serialize(optionalName) {\n return SQL.serialize(this.#handle, optionalName || \"main\");\n }\n static #deserialize(serialized, isReadOnly = !1) {\n if (!SQL)\n SQL = @lazy(\"sqlite\");\n return SQL.deserialize(serialized, isReadOnly);\n }\n static deserialize(serialized, isReadOnly = !1) {\n return new Database(serialized, isReadOnly \? constants.SQLITE_OPEN_READONLY : 0);\n }\n static setCustomSQLite(path) {\n if (!SQL)\n SQL = @lazy(\"sqlite\");\n return SQL.setCustomSQLite(path);\n }\n close() {\n return this.clearQueryCache(), SQL.close(this.#handle);\n }\n clearQueryCache() {\n for (let item of this.#cachedQueriesValues)\n item.finalize();\n this.#cachedQueriesKeys.length = 0, this.#cachedQueriesValues.length = 0, this.#cachedQueriesLengths.length = 0;\n }\n run(query, ...params) {\n if (params.length === 0) {\n SQL.run(this.#handle, query);\n return;\n }\n var arg0 = params[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? SQL.run(this.#handle, query, params) : SQL.run(this.#handle, query, ...params);\n }\n prepare(query, params, flags) {\n return new Statement(SQL.prepare(this.#handle, query, params, flags || 0));\n }\n static MAX_QUERY_CACHE_SIZE = 20;\n get [cachedCount]() {\n return this.#cachedQueriesKeys.length;\n }\n query(query) {\n if (typeof query !== \"string\")\n @throwTypeError(`Expected 'query' to be a string, got '${typeof query}'`);\n if (query.length === 0)\n throw new Error(\"SQL query cannot be empty.\");\n const willCache = this.#cachedQueriesKeys.length < Database.MAX_QUERY_CACHE_SIZE;\n var index = this.#cachedQueriesLengths.indexOf(query.length);\n while (index !== -1) {\n if (this.#cachedQueriesKeys[index] !== query) {\n index = this.#cachedQueriesLengths.indexOf(query.length, index + 1);\n continue;\n }\n var stmt = this.#cachedQueriesValues[index];\n if (stmt.isFinalized)\n return this.#cachedQueriesValues[index] = this.prepare(query, @undefined, willCache \? constants.SQLITE_PREPARE_PERSISTENT : 0);\n return stmt;\n }\n var stmt = this.prepare(query, @undefined, willCache \? constants.SQLITE_PREPARE_PERSISTENT : 0);\n if (willCache)\n this.#cachedQueriesKeys.push(query), this.#cachedQueriesLengths.push(query.length), this.#cachedQueriesValues.push(stmt);\n return stmt;\n }\n transaction(fn, self) {\n if (typeof fn !== \"function\")\n @throwTypeError(\"Expected first argument to be a function\");\n const db = this, controller = getController(db, self), properties = {\n default: { value: wrapTransaction(fn, db, controller.default) },\n deferred: { value: wrapTransaction(fn, db, controller.deferred) },\n immediate: {\n value: wrapTransaction(fn, db, controller.immediate)\n },\n exclusive: {\n value: wrapTransaction(fn, db, controller.exclusive)\n },\n database: { value: this, enumerable: !0 }\n };\n return defineProperties(properties.default.value, properties), defineProperties(properties.deferred.value, properties), defineProperties(properties.immediate.value, properties), defineProperties(properties.exclusive.value, properties), properties.default.value;\n }\n}\nDatabase.prototype.exec = Database.prototype.run;\nvar getController = (db, self) => {\n let controller = (controllers ||= new WeakMap).get(db);\n if (!controller) {\n const shared = {\n commit: db.prepare(\"COMMIT\", @undefined, 0),\n rollback: db.prepare(\"ROLLBACK\", @undefined, 0),\n savepoint: db.prepare(\"SAVEPOINT `\\t_bs3.\\t`\", @undefined, 0),\n release: db.prepare(\"RELEASE `\\t_bs3.\\t`\", @undefined, 0),\n rollbackTo: db.prepare(\"ROLLBACK TO `\\t_bs3.\\t`\", @undefined, 0)\n };\n controllers.set(db, controller = {\n default: Object.assign({ begin: db.prepare(\"BEGIN\", @undefined, 0) }, shared),\n deferred: Object.assign({ begin: db.prepare(\"BEGIN DEFERRED\", @undefined, 0) }, shared),\n immediate: Object.assign({ begin: db.prepare(\"BEGIN IMMEDIATE\", @undefined, 0) }, shared),\n exclusive: Object.assign({ begin: db.prepare(\"BEGIN EXCLUSIVE\", @undefined, 0) }, shared)\n });\n }\n return controller;\n}, wrapTransaction = (fn, db, { begin, commit, rollback, savepoint, release, rollbackTo }) => function transaction(...args) {\n let before, after, undo;\n if (db.inTransaction)\n before = savepoint, after = release, undo = rollbackTo;\n else\n before = begin, after = commit, undo = rollback;\n try {\n before.run();\n const result = fn.@apply(this, args);\n return after.run(), result;\n } catch (ex) {\n if (db.inTransaction) {\n if (undo.run(), undo !== rollback)\n after.run();\n }\n throw ex;\n }\n};\n$ = {\n __esModule: !0,\n Database,\n Statement,\n constants,\n default: Database\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral BunSqliteCode = "(function (){\"use strict\";// src/js/out/tmp/bun/sqlite.ts\nvar $, defineProperties = Object.defineProperties, toStringTag = Symbol.toStringTag, isArray = Array.isArray, isTypedArray = ArrayBuffer.isView, constants = {\n SQLITE_OPEN_READONLY: 1,\n SQLITE_OPEN_READWRITE: 2,\n SQLITE_OPEN_CREATE: 4,\n SQLITE_OPEN_DELETEONCLOSE: 8,\n SQLITE_OPEN_EXCLUSIVE: 16,\n SQLITE_OPEN_AUTOPROXY: 32,\n SQLITE_OPEN_URI: 64,\n SQLITE_OPEN_MEMORY: 128,\n SQLITE_OPEN_MAIN_DB: 256,\n SQLITE_OPEN_TEMP_DB: 512,\n SQLITE_OPEN_TRANSIENT_DB: 1024,\n SQLITE_OPEN_MAIN_JOURNAL: 2048,\n SQLITE_OPEN_TEMP_JOURNAL: 4096,\n SQLITE_OPEN_SUBJOURNAL: 8192,\n SQLITE_OPEN_SUPER_JOURNAL: 16384,\n SQLITE_OPEN_NOMUTEX: 32768,\n SQLITE_OPEN_FULLMUTEX: 65536,\n SQLITE_OPEN_SHAREDCACHE: 131072,\n SQLITE_OPEN_PRIVATECACHE: 262144,\n SQLITE_OPEN_WAL: 524288,\n SQLITE_OPEN_NOFOLLOW: 16777216,\n SQLITE_OPEN_EXRESCODE: 33554432,\n SQLITE_PREPARE_PERSISTENT: 1,\n SQLITE_PREPARE_NORMALIZE: 2,\n SQLITE_PREPARE_NO_VTAB: 4\n}, SQL, controllers;\n\nclass Statement {\n constructor(raw) {\n switch (this.#raw = raw, raw.paramsCount) {\n case 0: {\n this.get = this.#getNoArgs, this.all = this.#allNoArgs, this.values = this.#valuesNoArgs, this.run = this.#runNoArgs;\n break;\n }\n default: {\n this.get = this.#get, this.all = this.#all, this.values = this.#values, this.run = this.#run;\n break;\n }\n }\n }\n #raw;\n get;\n all;\n values;\n run;\n isFinalized = !1;\n toJSON() {\n return {\n sql: this.native.toString(),\n isFinalized: this.isFinalized,\n paramsCount: this.paramsCount,\n columnNames: this.columnNames\n };\n }\n get [toStringTag]() {\n return `\"${this.native.toString()}\"`;\n }\n toString() {\n return this.native.toString();\n }\n get native() {\n return this.#raw;\n }\n #getNoArgs() {\n return this.#raw.get();\n }\n #allNoArgs() {\n return this.#raw.all();\n }\n #valuesNoArgs() {\n return this.#raw.values();\n }\n #runNoArgs() {\n this.#raw.run();\n }\n #get(...args) {\n if (args.length === 0)\n return this.#getNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.get(args) : this.#raw.get(...args);\n }\n #all(...args) {\n if (args.length === 0)\n return this.#allNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.all(args) : this.#raw.all(...args);\n }\n #values(...args) {\n if (args.length === 0)\n return this.#valuesNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.values(args) : this.#raw.values(...args);\n }\n #run(...args) {\n if (args.length === 0)\n return this.#runNoArgs();\n var arg0 = args[0];\n !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.run(args) : this.#raw.run(...args);\n }\n get columnNames() {\n return this.#raw.columns;\n }\n get paramsCount() {\n return this.#raw.paramsCount;\n }\n finalize(...args) {\n return this.isFinalized = !0, this.#raw.finalize(...args);\n }\n}\nvar cachedCount = Symbol.for(\"Bun.Database.cache.count\");\n\nclass Database {\n constructor(filenameGiven, options) {\n if (typeof filenameGiven === \"undefined\")\n ;\n else if (typeof filenameGiven !== \"string\") {\n if (isTypedArray(filenameGiven)) {\n this.#handle = Database.deserialize(filenameGiven, typeof options === \"object\" && options \? !!options.readonly : ((options | 0) & constants.SQLITE_OPEN_READONLY) != 0), this.filename = \":memory:\";\n return;\n }\n @throwTypeError(`Expected 'filename' to be a string, got '${typeof filenameGiven}'`);\n }\n var filename = typeof filenameGiven === \"string\" \? filenameGiven.trim() : \":memory:\", flags = constants.SQLITE_OPEN_READWRITE | constants.SQLITE_OPEN_CREATE;\n if (typeof options === \"object\" && options) {\n if (flags = 0, options.readonly)\n flags = constants.SQLITE_OPEN_READONLY;\n if (\"readOnly\" in options)\n @throwTypeError('Misspelled option \"readOnly\" should be \"readonly\"');\n if (options.create)\n flags = constants.SQLITE_OPEN_READWRITE | constants.SQLITE_OPEN_CREATE;\n if (options.readwrite)\n flags |= constants.SQLITE_OPEN_READWRITE;\n } else if (typeof options === \"number\")\n flags = options;\n const anonymous = filename === \"\" || filename === \":memory:\";\n if (anonymous && (flags & constants.SQLITE_OPEN_READONLY) !== 0)\n throw new Error(\"Cannot open an anonymous database in read-only mode.\");\n if (!SQL)\n SQL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"sqlite\");\n this.#handle = SQL.open(anonymous \? \":memory:\" : filename, flags), this.filename = filename;\n }\n #handle;\n #cachedQueriesKeys = [];\n #cachedQueriesLengths = [];\n #cachedQueriesValues = [];\n filename;\n get handle() {\n return this.#handle;\n }\n get inTransaction() {\n return SQL.isInTransaction(this.#handle);\n }\n static open(filename, options) {\n return new Database(filename, options);\n }\n loadExtension(name, entryPoint) {\n return SQL.loadExtension(this.#handle, name, entryPoint);\n }\n serialize(optionalName) {\n return SQL.serialize(this.#handle, optionalName || \"main\");\n }\n static deserialize(serialized, isReadOnly = !1) {\n if (!SQL)\n SQL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"sqlite\");\n return SQL.deserialize(serialized, isReadOnly);\n }\n static setCustomSQLite(path) {\n if (!SQL)\n SQL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"sqlite\");\n return SQL.setCustomSQLite(path);\n }\n close() {\n return this.clearQueryCache(), SQL.close(this.#handle);\n }\n clearQueryCache() {\n for (let item of this.#cachedQueriesValues)\n item.finalize();\n this.#cachedQueriesKeys.length = 0, this.#cachedQueriesValues.length = 0, this.#cachedQueriesLengths.length = 0;\n }\n run(query, ...params) {\n if (params.length === 0) {\n SQL.run(this.#handle, query);\n return;\n }\n var arg0 = params[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? SQL.run(this.#handle, query, params) : SQL.run(this.#handle, query, ...params);\n }\n prepare(query, params, flags) {\n return new Statement(SQL.prepare(this.#handle, query, params, flags || 0));\n }\n static MAX_QUERY_CACHE_SIZE = 20;\n get [cachedCount]() {\n return this.#cachedQueriesKeys.length;\n }\n query(query) {\n if (typeof query !== \"string\")\n @throwTypeError(`Expected 'query' to be a string, got '${typeof query}'`);\n if (query.length === 0)\n throw new Error(\"SQL query cannot be empty.\");\n var index = this.#cachedQueriesLengths.indexOf(query.length);\n while (index !== -1) {\n if (this.#cachedQueriesKeys[index] !== query) {\n index = this.#cachedQueriesLengths.indexOf(query.length, index + 1);\n continue;\n }\n var stmt = this.#cachedQueriesValues[index];\n if (stmt.isFinalized)\n return this.#cachedQueriesValues[index] = this.prepare(query, void 0, willCache \? constants.SQLITE_PREPARE_PERSISTENT : 0);\n return stmt;\n }\n const willCache = this.#cachedQueriesKeys.length < Database.MAX_QUERY_CACHE_SIZE;\n var stmt = this.prepare(query, void 0, willCache \? constants.SQLITE_PREPARE_PERSISTENT : 0);\n if (willCache)\n this.#cachedQueriesKeys.push(query), this.#cachedQueriesLengths.push(query.length), this.#cachedQueriesValues.push(stmt);\n return stmt;\n }\n transaction(fn, self) {\n if (typeof fn !== \"function\")\n @throwTypeError(\"Expected first argument to be a function\");\n const db = this, controller = getController(db, self), properties = {\n default: { value: wrapTransaction(fn, db, controller.default) },\n deferred: { value: wrapTransaction(fn, db, controller.deferred) },\n immediate: {\n value: wrapTransaction(fn, db, controller.immediate)\n },\n exclusive: {\n value: wrapTransaction(fn, db, controller.exclusive)\n },\n database: { value: this, enumerable: !0 }\n };\n return defineProperties(properties.default.value, properties), defineProperties(properties.deferred.value, properties), defineProperties(properties.immediate.value, properties), defineProperties(properties.exclusive.value, properties), properties.default.value;\n }\n}\nDatabase.prototype.exec = Database.prototype.run;\nvar getController = (db, self) => {\n let controller = (controllers ||= new WeakMap).get(db);\n if (!controller) {\n const shared = {\n commit: db.prepare(\"COMMIT\", void 0, 0),\n rollback: db.prepare(\"ROLLBACK\", void 0, 0),\n savepoint: db.prepare(\"SAVEPOINT `\\t_bs3.\\t`\", void 0, 0),\n release: db.prepare(\"RELEASE `\\t_bs3.\\t`\", void 0, 0),\n rollbackTo: db.prepare(\"ROLLBACK TO `\\t_bs3.\\t`\", void 0, 0)\n };\n controllers.set(db, controller = {\n default: Object.assign({ begin: db.prepare(\"BEGIN\", void 0, 0) }, shared),\n deferred: Object.assign({ begin: db.prepare(\"BEGIN DEFERRED\", void 0, 0) }, shared),\n immediate: Object.assign({ begin: db.prepare(\"BEGIN IMMEDIATE\", void 0, 0) }, shared),\n exclusive: Object.assign({ begin: db.prepare(\"BEGIN EXCLUSIVE\", void 0, 0) }, shared)\n });\n }\n return controller;\n}, wrapTransaction = (fn, db, { begin, commit, rollback, savepoint, release, rollbackTo }) => function transaction(...args) {\n let before, after, undo;\n if (db.inTransaction)\n before = savepoint, after = release, undo = rollbackTo;\n else\n before = begin, after = commit, undo = rollback;\n try {\n before.run();\n const result = fn.apply(this, args);\n return after.run(), result;\n } catch (ex) {\n if (db.inTransaction) {\n if (undo.run(), undo !== rollback)\n after.run();\n }\n throw ex;\n }\n};\n$ = {\n __esModule: !0,\n Database,\n Statement,\n constants,\n default: Database\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral InternalDebuggerCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/debugger.ts\nvar versionInfo = function() {\n return {\n \"Protocol-Version\": \"1.3\",\n Browser: \"Bun\",\n \"User-Agent\": navigator.userAgent,\n \"WebKit-Version\": process.versions.webkit,\n \"Bun-Version\": Bun.version,\n \"Bun-Revision\": Bun.revision\n };\n}, webSocketWriter = function(ws) {\n return {\n write: (message) => !!ws.sendText(message),\n close: () => ws.close()\n };\n}, socketWriter = function(socket) {\n return {\n write: (message) => !!socket.write(message),\n close: () => socket.end()\n };\n}, bufferedWriter = function(writer) {\n let draining = !1, pendingMessages = [];\n return {\n write: (message) => {\n if (draining || !writer.write(message))\n pendingMessages.push(message);\n return !0;\n },\n drain: () => {\n draining = !0;\n try {\n for (let i = 0;i < pendingMessages.length; i++)\n if (!writer.write(pendingMessages[i])) {\n pendingMessages = pendingMessages.slice(i);\n return;\n }\n } finally {\n draining = !1;\n }\n },\n close: () => {\n writer.close(), pendingMessages.length = 0;\n }\n };\n}, parseUrl = function(url) {\n try {\n if (!url)\n return new URL(randomId(), `ws://${defaultHostname}:${defaultPort}/`);\n else if (url.startsWith(\"/\"))\n return new URL(url, `ws://${defaultHostname}:${defaultPort}/`);\n else if (/^[a-z+]+:\\/\\//i.test(url))\n return new URL(url);\n else if (/^\\d+$/.test(url))\n return new URL(randomId(), `ws://${defaultHostname}:${url}/`);\n else if (!url.includes(\"/\") && url.includes(\":\"))\n return new URL(randomId(), `ws://${url}/`);\n else if (!url.includes(\":\")) {\n const [hostname, pathname] = url.split(\"/\", 2);\n return new URL(`ws://${hostname}:${defaultPort}/${pathname}`);\n } else\n return new URL(randomId(), `ws://${url}`);\n } catch {\n @throwTypeError(`Invalid hostname or URL: '${url}'`);\n }\n}, randomId = function() {\n return Math.random().toString(36).slice(2);\n}, dim = function(string) {\n if (enableANSIColors)\n return `\\x1B[2m${string}\\x1B[22m`;\n return string;\n}, link = function(url) {\n if (enableANSIColors)\n return `\\x1B[1m\\x1B]8;;${url}\\x1B\\\\${url}\\x1B]8;;\\x1B\\\\\\x1B[22m`;\n return url;\n}, reset = function() {\n if (enableANSIColors)\n return \"\\x1B[49m\";\n return \"\";\n}, notify = function(unix) {\n Bun.connect({\n unix,\n socket: {\n open: (socket) => {\n socket.end(\"1\");\n },\n data: () => {\n }\n }\n }).finally(() => {\n });\n}, exit = function(...args) {\n console.error(...args), process.exit(1);\n}, $;\n$ = function(executionContextId, url, createBackend, send, close) {\n let debug;\n try {\n debug = new Debugger(executionContextId, url, createBackend, send, close);\n } catch (error) {\n exit(\"Failed to start inspector:\\n\", error);\n }\n const { protocol, href, host, pathname } = debug.url;\n if (!protocol.includes(\"unix\")) {\n if (console.log(dim(\"--------------------- Bun Inspector ---------------------\"), reset()), console.log(`Listening:\\n ${dim(href)}`), protocol.includes(\"ws\"))\n console.log(`Inspect in browser:\\n ${link(`https://debug.bun.sh/#${host}${pathname}`)}`);\n console.log(dim(\"--------------------- Bun Inspector ---------------------\"), reset());\n }\n const unix = process.env.BUN_INSPECT_NOTIFY;\n if (unix) {\n const { protocol: protocol2, pathname: pathname2 } = parseUrl(unix);\n if (protocol2 === \"unix:\")\n notify(pathname2);\n }\n};\n\nclass Debugger {\n #url;\n #createBackend;\n constructor(executionContextId, url, createBackend, send, close) {\n this.#url = parseUrl(url), this.#createBackend = (refEventLoop, receive) => {\n const backend = createBackend(executionContextId, refEventLoop, receive);\n return {\n write: (message) => {\n return send.@call(backend, message), !0;\n },\n close: () => close.@call(backend)\n };\n }, this.#listen();\n }\n get url() {\n return this.#url;\n }\n #listen() {\n const { protocol, hostname, port, pathname } = this.#url;\n if (protocol === \"ws:\" || protocol === \"ws+tcp:\") {\n const server = Bun.serve({\n hostname,\n port,\n fetch: this.#fetch.bind(this),\n websocket: this.#websocket\n });\n this.#url.hostname = server.hostname, this.#url.port = `${server.port}`;\n return;\n }\n if (protocol === \"ws+unix:\") {\n Bun.serve({\n unix: pathname,\n fetch: this.#fetch.bind(this),\n websocket: this.#websocket\n });\n return;\n }\n @throwTypeError(`Unsupported protocol: '${protocol}' (expected 'ws:', 'ws+unix:', or 'unix:')`);\n }\n get #websocket() {\n return {\n idleTimeout: 0,\n closeOnBackpressureLimit: !1,\n open: (ws) => this.#open(ws, webSocketWriter(ws)),\n message: (ws, message) => {\n if (typeof message === \"string\")\n this.#message(ws, message);\n else\n this.#error(ws, new Error(`Unexpected binary message: ${message.toString()}`));\n },\n drain: (ws) => this.#drain(ws),\n close: (ws) => this.#close(ws)\n };\n }\n #fetch(request, server) {\n const { method, url, headers } = request, { pathname } = new URL(url);\n if (method !== \"GET\")\n return new Response(null, {\n status: 405\n });\n switch (pathname) {\n case \"/json/version\":\n return Response.json(versionInfo());\n case \"/json\":\n case \"/json/list\":\n }\n if (!this.#url.protocol.includes(\"unix\") && this.#url.pathname !== pathname)\n return new Response(null, {\n status: 404\n });\n const data = {\n refEventLoop: headers.get(\"Ref-Event-Loop\") === \"0\"\n };\n if (!server.upgrade(request, { data }))\n return new Response(null, {\n status: 426,\n headers: {\n Upgrade: \"websocket\"\n }\n });\n }\n get #socket() {\n return {\n open: (socket) => this.#open(socket, socketWriter(socket)),\n data: (socket, message) => this.#message(socket, message.toString()),\n drain: (socket) => this.#drain(socket),\n close: (socket) => this.#close(socket),\n error: (socket, error) => this.#error(socket, error),\n connectError: (_, error) => exit(\"Failed to start inspector:\\n\", error)\n };\n }\n #open(connection, writer) {\n const { data } = connection, { refEventLoop } = data, client = bufferedWriter(writer), backend = this.#createBackend(refEventLoop, (...messages) => {\n for (let message of messages)\n client.write(message);\n });\n data.client = client, data.backend = backend;\n }\n #message(connection, message) {\n const { data } = connection, { backend } = data;\n backend\?.write(message);\n }\n #drain(connection) {\n const { data } = connection, { client } = data;\n client\?.drain\?.();\n }\n #close(connection) {\n const { data } = connection, { backend } = data;\n backend\?.close();\n }\n #error(connection, error) {\n const { data } = connection, { backend } = data;\n console.error(error), backend\?.close();\n }\n}\nvar defaultHostname = \"localhost\", defaultPort = 6499, { enableANSIColors } = Bun;\nreturn $})\n");
//
//
-static constexpr ASCIILiteral InternalDebuggerCode = "(function (){\"use strict\";// src/js/out/tmp/internal/debugger.ts\nvar versionInfo = function() {\n return {\n \"Protocol-Version\": \"1.3\",\n Browser: \"Bun\",\n \"User-Agent\": navigator.userAgent,\n \"WebKit-Version\": process.versions.webkit,\n \"Bun-Version\": Bun.version,\n \"Bun-Revision\": Bun.revision\n };\n}, webSocketWriter = function(ws) {\n return {\n write: (message) => !!ws.sendText(message),\n close: () => ws.close()\n };\n}, socketWriter = function(socket) {\n return {\n write: (message) => !!socket.write(message),\n close: () => socket.end()\n };\n}, bufferedWriter = function(writer) {\n let draining = !1, pendingMessages = [];\n return {\n write: (message) => {\n if (draining || !writer.write(message))\n pendingMessages.push(message);\n return !0;\n },\n drain: () => {\n draining = !0;\n try {\n for (let i = 0;i < pendingMessages.length; i++)\n if (!writer.write(pendingMessages[i])) {\n pendingMessages = pendingMessages.slice(i);\n return;\n }\n } finally {\n draining = !1;\n }\n },\n close: () => {\n writer.close(), pendingMessages.length = 0;\n }\n };\n}, parseUrl = function(url) {\n try {\n if (!url)\n return new URL(randomId(), `ws://${defaultHostname}:${defaultPort}/`);\n else if (url.startsWith(\"/\"))\n return new URL(url, `ws://${defaultHostname}:${defaultPort}/`);\n else if (/^[a-z+]+:\\/\\//i.test(url))\n return new URL(url);\n else if (/^\\d+$/.test(url))\n return new URL(randomId(), `ws://${defaultHostname}:${url}/`);\n else if (!url.includes(\"/\") && url.includes(\":\"))\n return new URL(randomId(), `ws://${url}/`);\n else if (!url.includes(\":\")) {\n const [hostname, pathname] = url.split(\"/\", 2);\n return new URL(`ws://${hostname}:${defaultPort}/${pathname}`);\n } else\n return new URL(randomId(), `ws://${url}`);\n } catch {\n @throwTypeError(`Invalid hostname or URL: '${url}'`);\n }\n}, randomId = function() {\n return Math.random().toString(36).slice(2);\n}, dim = function(string) {\n if (enableANSIColors)\n return `\\x1B[2m${string}\\x1B[22m`;\n return string;\n}, link = function(url) {\n if (enableANSIColors)\n return `\\x1B[1m\\x1B]8;;${url}\\x1B\\\\${url}\\x1B]8;;\\x1B\\\\\\x1B[22m`;\n return url;\n}, reset = function() {\n if (enableANSIColors)\n return \"\\x1B[49m\";\n return \"\";\n}, notify = function(unix) {\n Bun.connect({\n unix,\n socket: {\n open: (socket) => {\n socket.end(\"1\");\n },\n data: () => {\n }\n }\n }).finally(() => {\n });\n}, exit = function(...args) {\n console.error(...args), process.exit(1);\n}, $;\n$ = function(executionContextId, url, createBackend, send, close) {\n let debug;\n try {\n debug = new Debugger(executionContextId, url, createBackend, send, close);\n } catch (error) {\n exit(\"Failed to start inspector:\\n\", error);\n }\n const { protocol, href, host, pathname } = debug.url;\n if (!protocol.includes(\"unix\")) {\n if (console.log(dim(\"--------------------- Bun Inspector ---------------------\"), reset()), console.log(`Listening:\\n ${dim(href)}`), protocol.includes(\"ws\"))\n console.log(`Inspect in browser:\\n ${link(`https://debug.bun.sh/#${host}${pathname}`)}`);\n console.log(dim(\"--------------------- Bun Inspector ---------------------\"), reset());\n }\n const unix = process.env.BUN_INSPECT_NOTIFY;\n if (unix) {\n const { protocol: protocol2, pathname: pathname2 } = parseUrl(unix);\n if (protocol2 === \"unix:\")\n notify(pathname2);\n }\n};\n\nclass Debugger {\n #url;\n #createBackend;\n constructor(executionContextId, url, createBackend, send, close) {\n this.#url = parseUrl(url), this.#createBackend = (refEventLoop, receive) => {\n const backend = createBackend(executionContextId, refEventLoop, receive);\n return {\n write: (message) => {\n return send.call(backend, message), !0;\n },\n close: () => close.call(backend)\n };\n }, this.#listen();\n }\n get url() {\n return this.#url;\n }\n #listen() {\n const { protocol, hostname, port, pathname } = this.#url;\n if (protocol === \"ws:\" || protocol === \"ws+tcp:\") {\n const server = Bun.serve({\n hostname,\n port,\n fetch: this.#fetch.bind(this),\n websocket: this.#websocket\n });\n this.#url.hostname = server.hostname, this.#url.port = `${server.port}`;\n return;\n }\n if (protocol === \"ws+unix:\") {\n Bun.serve({\n unix: pathname,\n fetch: this.#fetch.bind(this),\n websocket: this.#websocket\n });\n return;\n }\n @throwTypeError(`Unsupported protocol: '${protocol}' (expected 'ws:', 'ws+unix:', or 'unix:')`);\n }\n get #websocket() {\n return {\n idleTimeout: 0,\n closeOnBackpressureLimit: !1,\n open: (ws) => this.#open(ws, webSocketWriter(ws)),\n message: (ws, message) => {\n if (typeof message === \"string\")\n this.#message(ws, message);\n else\n this.#error(ws, new Error(`Unexpected binary message: ${message.toString()}`));\n },\n drain: (ws) => this.#drain(ws),\n close: (ws) => this.#close(ws)\n };\n }\n #fetch(request, server) {\n const { method, url, headers } = request, { pathname } = new URL(url);\n if (method !== \"GET\")\n return new Response(null, {\n status: 405\n });\n switch (pathname) {\n case \"/json/version\":\n return Response.json(versionInfo());\n case \"/json\":\n case \"/json/list\":\n }\n if (!this.#url.protocol.includes(\"unix\") && this.#url.pathname !== pathname)\n return new Response(null, {\n status: 404\n });\n const data = {\n refEventLoop: headers.get(\"Ref-Event-Loop\") === \"0\"\n };\n if (!server.upgrade(request, { data }))\n return new Response(null, {\n status: 426,\n headers: {\n Upgrade: \"websocket\"\n }\n });\n }\n get #socket() {\n return {\n open: (socket) => this.#open(socket, socketWriter(socket)),\n data: (socket, message) => this.#message(socket, message.toString()),\n drain: (socket) => this.#drain(socket),\n close: (socket) => this.#close(socket),\n error: (socket, error) => this.#error(socket, error),\n connectError: (_, error) => exit(\"Failed to start inspector:\\n\", error)\n };\n }\n #open(connection, writer) {\n const { data } = connection, { refEventLoop } = data, client = bufferedWriter(writer), backend = this.#createBackend(refEventLoop, (...messages) => {\n for (let message of messages)\n client.write(message);\n });\n data.client = client, data.backend = backend;\n }\n #message(connection, message) {\n const { data } = connection, { backend } = data;\n backend\?.write(message);\n }\n #drain(connection) {\n const { data } = connection, { client } = data;\n client\?.drain\?.();\n }\n #close(connection) {\n const { data } = connection, { backend } = data;\n backend\?.close();\n }\n #error(connection, error) {\n const { data } = connection, { backend } = data;\n console.error(error), backend\?.close();\n }\n}\nvar defaultHostname = \"localhost\", defaultPort = 6499, { enableANSIColors } = Bun;\nreturn $})\n"_s;
+static constexpr ASCIILiteral InternalFSCpSyncCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/fs/cp-sync.ts\nvar areIdentical = function(srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;\n}, isSrcSubdir = function(src, dest) {\n const srcArr = normalizePathToArray(src), destArr = normalizePathToArray(dest);\n return ArrayPrototypeEvery.@call(srcArr, (cur, i) => destArr[i] === cur);\n}, cpSyncFn = function(src, dest, opts) {\n const { srcStat, destStat, skipped } = checkPathsSync(src, dest, opts);\n if (skipped)\n return;\n return checkParentPathsSync(src, srcStat, dest), checkParentDir(destStat, src, dest, opts);\n}, checkPathsSync = function(src, dest, opts) {\n if (opts.filter) {\n const shouldCopy = opts.filter(src, dest);\n if (isPromise(shouldCopy))\n throw new Error(\"Expected a boolean from the filter function, but got a promise. Use `fs.promises.cp` instead.\");\n if (!shouldCopy)\n return { __proto__: null, skipped: !0 };\n }\n const { srcStat, destStat } = getStatsSync(src, dest, opts);\n if (destStat) {\n if (areIdentical(srcStat, destStat))\n throw new Error(\"src and dest cannot be the same\");\n if (srcStat.isDirectory() && !destStat.isDirectory())\n throw new Error(`cannot overwrite directory ${src} with non-directory ${dest}`);\n if (!srcStat.isDirectory() && destStat.isDirectory())\n throw new Error(`cannot overwrite non-directory ${src} with directory ${dest}`);\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return { __proto__: null, srcStat, destStat, skipped: !1 };\n}, getStatsSync = function(src, dest, opts) {\n let destStat;\n const statFunc = opts.dereference \? (file) => statSync(file, { bigint: !0 }) : (file) => lstatSync(file, { bigint: !0 }), srcStat = statFunc(src);\n try {\n destStat = statFunc(dest);\n } catch (err) {\n if (err.code === \"ENOENT\")\n return { srcStat, destStat: null };\n throw err;\n }\n return { srcStat, destStat };\n}, checkParentPathsSync = function(src, srcStat, dest) {\n const srcParent = resolve(dirname(src)), destParent = resolve(dirname(dest));\n if (destParent === srcParent || destParent === parse(destParent).root)\n return;\n let destStat;\n try {\n destStat = statSync(destParent, { bigint: !0 });\n } catch (err) {\n if (err.code === \"ENOENT\")\n return;\n throw err;\n }\n if (areIdentical(srcStat, destStat))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return checkParentPathsSync(src, srcStat, destParent);\n}, checkParentDir = function(destStat, src, dest, opts) {\n const destParent = dirname(dest);\n if (!existsSync(destParent))\n mkdirSync(destParent, { recursive: !0 });\n return getStats(destStat, src, dest, opts);\n}, getStats = function(destStat, src, dest, opts) {\n const srcStat = (opts.dereference \? statSync : lstatSync)(src);\n if (srcStat.isDirectory() && opts.recursive)\n return onDir(srcStat, destStat, src, dest, opts);\n else if (srcStat.isDirectory())\n throw new Error(`${src} is a directory (not copied)`);\n else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())\n return onFile(srcStat, destStat, src, dest, opts);\n else if (srcStat.isSymbolicLink())\n return onLink(destStat, src, dest, opts);\n else if (srcStat.isSocket())\n throw new Error(`cannot copy a socket file: ${dest}`);\n else if (srcStat.isFIFO())\n throw new Error(`cannot copy a FIFO pipe: ${dest}`);\n throw new Error(`cannot copy an unknown file type: ${dest}`);\n}, onFile = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return copyFile(srcStat, src, dest, opts);\n return mayCopyFile(srcStat, src, dest, opts);\n}, mayCopyFile = function(srcStat, src, dest, opts) {\n if (opts.force)\n return unlinkSync(dest), copyFile(srcStat, src, dest, opts);\n else if (opts.errorOnExist)\n throw new Error(`${dest} already exists`);\n}, copyFile = function(srcStat, src, dest, opts) {\n if (copyFileSync(src, dest, opts.mode), opts.preserveTimestamps)\n handleTimestamps(srcStat.mode, src, dest);\n return setDestMode(dest, srcStat.mode);\n}, handleTimestamps = function(srcMode, src, dest) {\n if (fileIsNotWritable(srcMode))\n makeFileWritable(dest, srcMode);\n return setDestTimestamps(src, dest);\n}, fileIsNotWritable = function(srcMode) {\n return (srcMode & 128) === 0;\n}, makeFileWritable = function(dest, srcMode) {\n return setDestMode(dest, srcMode | 128);\n}, setDestMode = function(dest, srcMode) {\n return chmodSync(dest, srcMode);\n}, setDestTimestamps = function(src, dest) {\n const updatedSrcStat = statSync(src);\n return utimesSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\n}, onDir = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return mkDirAndCopy(srcStat.mode, src, dest, opts);\n return copyDir(src, dest, opts);\n}, mkDirAndCopy = function(srcMode, src, dest, opts) {\n return mkdirSync(dest), copyDir(src, dest, opts), setDestMode(dest, srcMode);\n}, copyDir = function(src, dest, opts) {\n for (let dirent of readdirSync(src, { withFileTypes: !0 })) {\n const { name } = dirent, srcItem = join(src, name), destItem = join(dest, name), { destStat, skipped } = checkPathsSync(srcItem, destItem, opts);\n if (!skipped)\n getStats(destStat, srcItem, destItem, opts);\n }\n}, onLink = function(destStat, src, dest, opts) {\n let resolvedSrc = readlinkSync(src);\n if (!opts.verbatimSymlinks && !isAbsolute(resolvedSrc))\n resolvedSrc = resolve(dirname(src), resolvedSrc);\n if (!destStat)\n return symlinkSync(resolvedSrc, dest);\n let resolvedDest;\n try {\n resolvedDest = readlinkSync(dest);\n } catch (err) {\n if (err.code === \"EINVAL\" || err.code === \"UNKNOWN\")\n return symlinkSync(resolvedSrc, dest);\n throw err;\n }\n if (!isAbsolute(resolvedDest))\n resolvedDest = resolve(dirname(dest), resolvedDest);\n if (isSrcSubdir(resolvedSrc, resolvedDest))\n throw new Error(`cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`);\n if (statSync(dest).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc))\n throw new Error(`cannot overwrite ${resolvedDest} with ${resolvedSrc}`);\n return copyLink(resolvedSrc, dest);\n}, copyLink = function(resolvedSrc, dest) {\n return unlinkSync(dest), symlinkSync(resolvedSrc, dest);\n}, ArrayPrototypeEvery = @Array.prototype.every, ArrayPrototypeFilter = @Array.prototype.filter, StringPrototypeSplit = @String.prototype.split, normalizePathToArray = (path) => ArrayPrototypeFilter.@call(StringPrototypeSplit.@call(resolve(path), sep), Boolean), {\n chmodSync,\n copyFileSync,\n existsSync,\n lstatSync,\n mkdirSync,\n readdirSync,\n readlinkSync,\n statSync,\n symlinkSync,\n unlinkSync,\n utimesSync\n} = @getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21), { dirname, isAbsolute, join, parse, resolve, sep } = @getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30), { isPromise } = @requireNativeModule(\"util/types\");\nreturn cpSyncFn})\n");
//
//
-static constexpr ASCIILiteral InternalFSCpSyncCode = "(function (){\"use strict\";// src/js/out/tmp/internal/fs/cp-sync.ts\nvar areIdentical = function(srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;\n}, isSrcSubdir = function(src, dest) {\n const srcArr = normalizePathToArray(src), destArr = normalizePathToArray(dest);\n return ArrayPrototypeEvery.@call(srcArr, (cur, i) => destArr[i] === cur);\n}, cpSyncFn = function(src, dest, opts) {\n const { srcStat, destStat, skipped } = checkPathsSync(src, dest, opts);\n if (skipped)\n return;\n return checkParentPathsSync(src, srcStat, dest), checkParentDir(destStat, src, dest, opts);\n}, checkPathsSync = function(src, dest, opts) {\n if (opts.filter) {\n const shouldCopy = opts.filter(src, dest);\n if (isPromise(shouldCopy))\n throw new Error(\"Expected a boolean from the filter function, but got a promise. Use `fs.promises.cp` instead.\");\n if (!shouldCopy)\n return { __proto__: null, skipped: !0 };\n }\n const { srcStat, destStat } = getStatsSync(src, dest, opts);\n if (destStat) {\n if (areIdentical(srcStat, destStat))\n throw new Error(\"src and dest cannot be the same\");\n if (srcStat.isDirectory() && !destStat.isDirectory())\n throw new Error(`cannot overwrite directory ${src} with non-directory ${dest}`);\n if (!srcStat.isDirectory() && destStat.isDirectory())\n throw new Error(`cannot overwrite non-directory ${src} with directory ${dest}`);\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return { __proto__: null, srcStat, destStat, skipped: !1 };\n}, getStatsSync = function(src, dest, opts) {\n let destStat;\n const statFunc = opts.dereference \? (file) => statSync(file, { bigint: !0 }) : (file) => lstatSync(file, { bigint: !0 }), srcStat = statFunc(src);\n try {\n destStat = statFunc(dest);\n } catch (err) {\n if (err.code === \"ENOENT\")\n return { srcStat, destStat: null };\n throw err;\n }\n return { srcStat, destStat };\n}, checkParentPathsSync = function(src, srcStat, dest) {\n const srcParent = resolve(dirname(src)), destParent = resolve(dirname(dest));\n if (destParent === srcParent || destParent === parse(destParent).root)\n return;\n let destStat;\n try {\n destStat = statSync(destParent, { bigint: !0 });\n } catch (err) {\n if (err.code === \"ENOENT\")\n return;\n throw err;\n }\n if (areIdentical(srcStat, destStat))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return checkParentPathsSync(src, srcStat, destParent);\n}, checkParentDir = function(destStat, src, dest, opts) {\n const destParent = dirname(dest);\n if (!existsSync(destParent))\n mkdirSync(destParent, { recursive: !0 });\n return getStats(destStat, src, dest, opts);\n}, getStats = function(destStat, src, dest, opts) {\n const srcStat = (opts.dereference \? statSync : lstatSync)(src);\n if (srcStat.isDirectory() && opts.recursive)\n return onDir(srcStat, destStat, src, dest, opts);\n else if (srcStat.isDirectory())\n throw new Error(`${src} is a directory (not copied)`);\n else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())\n return onFile(srcStat, destStat, src, dest, opts);\n else if (srcStat.isSymbolicLink())\n return onLink(destStat, src, dest, opts);\n else if (srcStat.isSocket())\n throw new Error(`cannot copy a socket file: ${dest}`);\n else if (srcStat.isFIFO())\n throw new Error(`cannot copy a FIFO pipe: ${dest}`);\n throw new Error(`cannot copy an unknown file type: ${dest}`);\n}, onFile = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return copyFile(srcStat, src, dest, opts);\n return mayCopyFile(srcStat, src, dest, opts);\n}, mayCopyFile = function(srcStat, src, dest, opts) {\n if (opts.force)\n return unlinkSync(dest), copyFile(srcStat, src, dest, opts);\n else if (opts.errorOnExist)\n throw new Error(`${dest} already exists`);\n}, copyFile = function(srcStat, src, dest, opts) {\n if (copyFileSync(src, dest, opts.mode), opts.preserveTimestamps)\n handleTimestamps(srcStat.mode, src, dest);\n return setDestMode(dest, srcStat.mode);\n}, handleTimestamps = function(srcMode, src, dest) {\n if (fileIsNotWritable(srcMode))\n makeFileWritable(dest, srcMode);\n return setDestTimestamps(src, dest);\n}, fileIsNotWritable = function(srcMode) {\n return (srcMode & 128) === 0;\n}, makeFileWritable = function(dest, srcMode) {\n return setDestMode(dest, srcMode | 128);\n}, setDestMode = function(dest, srcMode) {\n return chmodSync(dest, srcMode);\n}, setDestTimestamps = function(src, dest) {\n const updatedSrcStat = statSync(src);\n return utimesSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\n}, onDir = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return mkDirAndCopy(srcStat.mode, src, dest, opts);\n return copyDir(src, dest, opts);\n}, mkDirAndCopy = function(srcMode, src, dest, opts) {\n return mkdirSync(dest), copyDir(src, dest, opts), setDestMode(dest, srcMode);\n}, copyDir = function(src, dest, opts) {\n for (let dirent of readdirSync(src, { withFileTypes: !0 })) {\n const { name } = dirent, srcItem = join(src, name), destItem = join(dest, name), { destStat, skipped } = checkPathsSync(srcItem, destItem, opts);\n if (!skipped)\n getStats(destStat, srcItem, destItem, opts);\n }\n}, onLink = function(destStat, src, dest, opts) {\n let resolvedSrc = readlinkSync(src);\n if (!opts.verbatimSymlinks && !isAbsolute(resolvedSrc))\n resolvedSrc = resolve(dirname(src), resolvedSrc);\n if (!destStat)\n return symlinkSync(resolvedSrc, dest);\n let resolvedDest;\n try {\n resolvedDest = readlinkSync(dest);\n } catch (err) {\n if (err.code === \"EINVAL\" || err.code === \"UNKNOWN\")\n return symlinkSync(resolvedSrc, dest);\n throw err;\n }\n if (!isAbsolute(resolvedDest))\n resolvedDest = resolve(dirname(dest), resolvedDest);\n if (isSrcSubdir(resolvedSrc, resolvedDest))\n throw new Error(`cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`);\n if (statSync(dest).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc))\n throw new Error(`cannot overwrite ${resolvedDest} with ${resolvedSrc}`);\n return copyLink(resolvedSrc, dest);\n}, copyLink = function(resolvedSrc, dest) {\n return unlinkSync(dest), symlinkSync(resolvedSrc, dest);\n}, ArrayPrototypeEvery = Array.prototype.every, ArrayPrototypeFilter = Array.prototype.filter, StringPrototypeSplit = String.prototype.split, normalizePathToArray = (path) => ArrayPrototypeFilter.@call(StringPrototypeSplit.@call(resolve(path), sep), Boolean), {\n chmodSync,\n copyFileSync,\n existsSync,\n lstatSync,\n mkdirSync,\n readdirSync,\n readlinkSync,\n statSync,\n symlinkSync,\n unlinkSync,\n utimesSync\n} = @getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19), { dirname, isAbsolute, join, parse, resolve, sep } = @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28), { isPromise } = @requireNativeModule(\"util/types\");\nreturn cpSyncFn})\n"_s;
+static constexpr ASCIILiteral InternalFSCpCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/fs/cp.ts\nasync function cpFn(src, dest, opts) {\n const stats = await checkPaths(src, dest, opts), { srcStat, destStat, skipped } = stats;\n if (skipped)\n return;\n return await checkParentPaths(src, srcStat, dest), checkParentDir(destStat, src, dest, opts);\n}\nasync function checkPaths(src, dest, opts) {\n if (opts.filter && !await opts.filter(src, dest))\n return { __proto__: null, skipped: !0 };\n const { 0: srcStat, 1: destStat } = await getStats(src, dest, opts);\n if (destStat) {\n if (areIdentical(srcStat, destStat))\n throw new Error(\"Source and destination must not be the same.\");\n if (srcStat.isDirectory() && !destStat.isDirectory())\n throw new Error(`cannot overwrite directory ${src} with non-directory ${dest}`);\n if (!srcStat.isDirectory() && destStat.isDirectory())\n throw new Error(`cannot overwrite non-directory ${src} with directory ${dest}`);\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return { __proto__: null, srcStat, destStat, skipped: !1 };\n}\nvar areIdentical = function(srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;\n}, getStats = function(src, dest, opts) {\n const statFunc = opts.dereference \? (file) => stat(file, { bigint: !0 }) : (file) => lstat(file, { bigint: !0 });\n return SafePromiseAll([\n statFunc(src),\n PromisePrototypeThen.@call(statFunc(dest), @undefined, (err) => {\n if (err.code === \"ENOENT\")\n return null;\n throw err;\n })\n ]);\n};\nasync function checkParentDir(destStat, src, dest, opts) {\n const destParent = dirname(dest);\n if (await pathExists(destParent))\n return getStatsForCopy(destStat, src, dest, opts);\n return await mkdir(destParent, { recursive: !0 }), getStatsForCopy(destStat, src, dest, opts);\n}\nvar pathExists = function(dest) {\n return PromisePrototypeThen(stat(dest), () => !0, (err) => err.code === \"ENOENT\" \? !1 : PromiseReject(err));\n};\nasync function checkParentPaths(src, srcStat, dest) {\n const srcParent = resolve(dirname(src)), destParent = resolve(dirname(dest));\n if (destParent === srcParent || destParent === parse(destParent).root)\n return;\n let destStat;\n try {\n destStat = await stat(destParent, { bigint: !0 });\n } catch (err) {\n if (err.code === \"ENOENT\")\n return;\n throw err;\n }\n if (areIdentical(srcStat, destStat))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return checkParentPaths(src, srcStat, destParent);\n}\nvar isSrcSubdir = function(src, dest) {\n const srcArr = normalizePathToArray(src), destArr = normalizePathToArray(dest);\n return ArrayPrototypeEvery.@call(srcArr, (cur, i) => destArr[i] === cur);\n};\nasync function getStatsForCopy(destStat, src, dest, opts) {\n const srcStat = await (opts.dereference \? stat : lstat)(src);\n if (srcStat.isDirectory() && opts.recursive)\n return onDir(srcStat, destStat, src, dest, opts);\n else if (srcStat.isDirectory())\n throw new Error(`${src} is a directory (not copied)`);\n else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())\n return onFile(srcStat, destStat, src, dest, opts);\n else if (srcStat.isSymbolicLink())\n return onLink(destStat, src, dest, opts);\n else if (srcStat.isSocket())\n throw new Error(`cannot copy a socket file: ${dest}`);\n else if (srcStat.isFIFO())\n throw new Error(`cannot copy a FIFO pipe: ${dest}`);\n throw new Error(`cannot copy an unknown file type: ${dest}`);\n}\nvar onFile = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return _copyFile(srcStat, src, dest, opts);\n return mayCopyFile(srcStat, src, dest, opts);\n};\nasync function mayCopyFile(srcStat, src, dest, opts) {\n if (opts.force)\n return await unlink(dest), _copyFile(srcStat, src, dest, opts);\n else if (opts.errorOnExist)\n throw new Error(`${dest} already exists`);\n}\nasync function _copyFile(srcStat, src, dest, opts) {\n if (await copyFile(src, dest, opts.mode), opts.preserveTimestamps)\n return handleTimestampsAndMode(srcStat.mode, src, dest);\n return setDestMode(dest, srcStat.mode);\n}\nasync function handleTimestampsAndMode(srcMode, src, dest) {\n if (fileIsNotWritable(srcMode))\n return await makeFileWritable(dest, srcMode), setDestTimestampsAndMode(srcMode, src, dest);\n return setDestTimestampsAndMode(srcMode, src, dest);\n}\nvar fileIsNotWritable = function(srcMode) {\n return (srcMode & 128) === 0;\n}, makeFileWritable = function(dest, srcMode) {\n return setDestMode(dest, srcMode | 128);\n};\nasync function setDestTimestampsAndMode(srcMode, src, dest) {\n return await setDestTimestamps(src, dest), setDestMode(dest, srcMode);\n}\nvar setDestMode = function(dest, srcMode) {\n return chmod(dest, srcMode);\n};\nasync function setDestTimestamps(src, dest) {\n const updatedSrcStat = await stat(src);\n return utimes(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\n}\nvar onDir = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return mkDirAndCopy(srcStat.mode, src, dest, opts);\n return copyDir(src, dest, opts);\n};\nasync function mkDirAndCopy(srcMode, src, dest, opts) {\n return await mkdir(dest), await copyDir(src, dest, opts), setDestMode(dest, srcMode);\n}\nasync function copyDir(src, dest, opts) {\n const dir = await opendir(src);\n for await (let { name } of dir) {\n const srcItem = join(src, name), destItem = join(dest, name), { destStat, skipped } = await checkPaths(srcItem, destItem, opts);\n if (!skipped)\n await getStatsForCopy(destStat, srcItem, destItem, opts);\n }\n}\nasync function onLink(destStat, src, dest, opts) {\n let resolvedSrc = await readlink(src);\n if (!opts.verbatimSymlinks && !isAbsolute(resolvedSrc))\n resolvedSrc = resolve(dirname(src), resolvedSrc);\n if (!destStat)\n return symlink(resolvedSrc, dest);\n let resolvedDest;\n try {\n resolvedDest = await readlink(dest);\n } catch (err) {\n if (err.code === \"EINVAL\" || err.code === \"UNKNOWN\")\n return symlink(resolvedSrc, dest);\n throw err;\n }\n if (!isAbsolute(resolvedDest))\n resolvedDest = resolve(dirname(dest), resolvedDest);\n if (isSrcSubdir(resolvedSrc, resolvedDest))\n throw new Error(`cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`);\n if ((await stat(src)).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc))\n throw new Error(`cannot overwrite ${resolvedDest} with ${resolvedSrc}`);\n return copyLink(resolvedSrc, dest);\n}\nasync function copyLink(resolvedSrc, dest) {\n return await unlink(dest), symlink(resolvedSrc, dest);\n}\nvar { chmod, copyFile, lstat, mkdir, opendir, readlink, stat, symlink, unlink, utimes } = @getInternalField(@internalModuleRegistry, 22) || @createInternalModuleById(22), { dirname, isAbsolute, join, parse, resolve, sep } = @getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30), SafePromiseAll = @Promise.all, PromisePrototypeThen = @Promise.prototype.then, PromiseReject = @Promise.reject, ArrayPrototypeFilter = @Array.prototype.filter, StringPrototypeSplit = @String.prototype.split, ArrayPrototypeEvery = @Array.prototype.every, normalizePathToArray = (path) => ArrayPrototypeFilter.@call(StringPrototypeSplit(resolve(path), sep), Boolean);\nreturn cpFn})\n");
//
//
-static constexpr ASCIILiteral InternalFSCpCode = "(function (){\"use strict\";// src/js/out/tmp/internal/fs/cp.ts\nasync function cpFn(src, dest, opts) {\n const stats = await checkPaths(src, dest, opts), { srcStat, destStat, skipped } = stats;\n if (skipped)\n return;\n return await checkParentPaths(src, srcStat, dest), checkParentDir(destStat, src, dest, opts);\n}\nasync function checkPaths(src, dest, opts) {\n if (opts.filter && !await opts.filter(src, dest))\n return { __proto__: null, skipped: !0 };\n const { 0: srcStat, 1: destStat } = await getStats(src, dest, opts);\n if (destStat) {\n if (areIdentical(srcStat, destStat))\n throw new Error(\"Source and destination must not be the same.\");\n if (srcStat.isDirectory() && !destStat.isDirectory())\n throw new Error(`cannot overwrite directory ${src} with non-directory ${dest}`);\n if (!srcStat.isDirectory() && destStat.isDirectory())\n throw new Error(`cannot overwrite non-directory ${src} with directory ${dest}`);\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return { __proto__: null, srcStat, destStat, skipped: !1 };\n}\nvar areIdentical = function(srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;\n}, getStats = function(src, dest, opts) {\n const statFunc = opts.dereference \? (file) => stat(file, { bigint: !0 }) : (file) => lstat(file, { bigint: !0 });\n return SafePromiseAll([\n statFunc(src),\n PromisePrototypeThen.@call(statFunc(dest), void 0, (err) => {\n if (err.code === \"ENOENT\")\n return null;\n throw err;\n })\n ]);\n};\nasync function checkParentDir(destStat, src, dest, opts) {\n const destParent = dirname(dest);\n if (await pathExists(destParent))\n return getStatsForCopy(destStat, src, dest, opts);\n return await mkdir(destParent, { recursive: !0 }), getStatsForCopy(destStat, src, dest, opts);\n}\nvar pathExists = function(dest) {\n return PromisePrototypeThen(stat(dest), () => !0, (err) => err.code === \"ENOENT\" \? !1 : PromiseReject(err));\n};\nasync function checkParentPaths(src, srcStat, dest) {\n const srcParent = resolve(dirname(src)), destParent = resolve(dirname(dest));\n if (destParent === srcParent || destParent === parse(destParent).root)\n return;\n let destStat;\n try {\n destStat = await stat(destParent, { bigint: !0 });\n } catch (err) {\n if (err.code === \"ENOENT\")\n return;\n throw err;\n }\n if (areIdentical(srcStat, destStat))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return checkParentPaths(src, srcStat, destParent);\n}\nvar isSrcSubdir = function(src, dest) {\n const srcArr = normalizePathToArray(src), destArr = normalizePathToArray(dest);\n return ArrayPrototypeEvery.@call(srcArr, (cur, i) => destArr[i] === cur);\n};\nasync function getStatsForCopy(destStat, src, dest, opts) {\n const srcStat = await (opts.dereference \? stat : lstat)(src);\n if (srcStat.isDirectory() && opts.recursive)\n return onDir(srcStat, destStat, src, dest, opts);\n else if (srcStat.isDirectory())\n throw new Error(`${src} is a directory (not copied)`);\n else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())\n return onFile(srcStat, destStat, src, dest, opts);\n else if (srcStat.isSymbolicLink())\n return onLink(destStat, src, dest, opts);\n else if (srcStat.isSocket())\n throw new Error(`cannot copy a socket file: ${dest}`);\n else if (srcStat.isFIFO())\n throw new Error(`cannot copy a FIFO pipe: ${dest}`);\n throw new Error(`cannot copy an unknown file type: ${dest}`);\n}\nvar onFile = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return _copyFile(srcStat, src, dest, opts);\n return mayCopyFile(srcStat, src, dest, opts);\n};\nasync function mayCopyFile(srcStat, src, dest, opts) {\n if (opts.force)\n return await unlink(dest), _copyFile(srcStat, src, dest, opts);\n else if (opts.errorOnExist)\n throw new Error(`${dest} already exists`);\n}\nasync function _copyFile(srcStat, src, dest, opts) {\n if (await copyFile(src, dest, opts.mode), opts.preserveTimestamps)\n return handleTimestampsAndMode(srcStat.mode, src, dest);\n return setDestMode(dest, srcStat.mode);\n}\nasync function handleTimestampsAndMode(srcMode, src, dest) {\n if (fileIsNotWritable(srcMode))\n return await makeFileWritable(dest, srcMode), setDestTimestampsAndMode(srcMode, src, dest);\n return setDestTimestampsAndMode(srcMode, src, dest);\n}\nvar fileIsNotWritable = function(srcMode) {\n return (srcMode & 128) === 0;\n}, makeFileWritable = function(dest, srcMode) {\n return setDestMode(dest, srcMode | 128);\n};\nasync function setDestTimestampsAndMode(srcMode, src, dest) {\n return await setDestTimestamps(src, dest), setDestMode(dest, srcMode);\n}\nvar setDestMode = function(dest, srcMode) {\n return chmod(dest, srcMode);\n};\nasync function setDestTimestamps(src, dest) {\n const updatedSrcStat = await stat(src);\n return utimes(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\n}\nvar onDir = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return mkDirAndCopy(srcStat.mode, src, dest, opts);\n return copyDir(src, dest, opts);\n};\nasync function mkDirAndCopy(srcMode, src, dest, opts) {\n return await mkdir(dest), await copyDir(src, dest, opts), setDestMode(dest, srcMode);\n}\nasync function copyDir(src, dest, opts) {\n const dir = await opendir(src);\n for await (let { name } of dir) {\n const srcItem = join(src, name), destItem = join(dest, name), { destStat, skipped } = await checkPaths(srcItem, destItem, opts);\n if (!skipped)\n await getStatsForCopy(destStat, srcItem, destItem, opts);\n }\n}\nasync function onLink(destStat, src, dest, opts) {\n let resolvedSrc = await readlink(src);\n if (!opts.verbatimSymlinks && !isAbsolute(resolvedSrc))\n resolvedSrc = resolve(dirname(src), resolvedSrc);\n if (!destStat)\n return symlink(resolvedSrc, dest);\n let resolvedDest;\n try {\n resolvedDest = await readlink(dest);\n } catch (err) {\n if (err.code === \"EINVAL\" || err.code === \"UNKNOWN\")\n return symlink(resolvedSrc, dest);\n throw err;\n }\n if (!isAbsolute(resolvedDest))\n resolvedDest = resolve(dirname(dest), resolvedDest);\n if (isSrcSubdir(resolvedSrc, resolvedDest))\n throw new Error(`cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`);\n if ((await stat(src)).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc))\n throw new Error(`cannot overwrite ${resolvedDest} with ${resolvedSrc}`);\n return copyLink(resolvedSrc, dest);\n}\nasync function copyLink(resolvedSrc, dest) {\n return await unlink(dest), symlink(resolvedSrc, dest);\n}\nvar { chmod, copyFile, lstat, mkdir, opendir, readlink, stat, symlink, unlink, utimes } = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { dirname, isAbsolute, join, parse, resolve, sep } = @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28), SafePromiseAll = Promise.all, PromisePrototypeThen = Promise.prototype.then, PromiseReject = Promise.reject, ArrayPrototypeFilter = Array.prototype.filter, StringPrototypeSplit = String.prototype.split, ArrayPrototypeEvery = Array.prototype.every, normalizePathToArray = (path) => ArrayPrototypeFilter.@call(StringPrototypeSplit(resolve(path), sep), Boolean);\nreturn cpFn})\n"_s;
+static constexpr ASCIILiteral InternalPrimordialsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/primordials.ts\nvar getGetter = function(cls, getter) {\n return FunctionPrototypeCall.bind(cls.prototype.__lookupGetter__(getter));\n}, uncurryThis = function(func) {\n return FunctionPrototypeCall.bind(func);\n}, ErrorCaptureStackTrace = function(targetObject) {\n const stack = new Error().stack;\n targetObject.stack = stack.replace(/.*\\n.*/, \"$1\");\n}, $, createSafeIterator = (factory, next) => {\n\n class SafeIterator {\n constructor(iterable) {\n this._iterator = factory(iterable);\n }\n next() {\n return next(this._iterator);\n }\n [Symbol.iterator]() {\n return this;\n }\n }\n return Object.setPrototypeOf(SafeIterator.prototype, null), Object.freeze(SafeIterator.prototype), Object.freeze(SafeIterator), SafeIterator;\n}, FunctionPrototypeCall = @getByIdDirect(Function.prototype, \"call\"), copyProps = (src, dest) => {\n ArrayPrototypeForEach(Reflect.ownKeys(src), (key) => {\n if (!Reflect.getOwnPropertyDescriptor(dest, key))\n Reflect.defineProperty(dest, key, Reflect.getOwnPropertyDescriptor(src, key));\n });\n}, makeSafe = (unsafe, safe) => {\n if (Symbol.iterator in unsafe.prototype) {\n const dummy = new unsafe;\n let next;\n ArrayPrototypeForEach(Reflect.ownKeys(unsafe.prototype), (key) => {\n if (!Reflect.getOwnPropertyDescriptor(safe.prototype, key)) {\n const desc = Reflect.getOwnPropertyDescriptor(unsafe.prototype, key);\n if (typeof desc.value === \"function\" && desc.value.length === 0 && (Symbol.iterator in (desc.value.@call(dummy) || {}))) {\n const createIterator = uncurryThis(desc.value);\n next \?\?= uncurryThis(createIterator(dummy).next);\n const SafeIterator = createSafeIterator(createIterator, next);\n desc.value = function() {\n return new SafeIterator(this);\n };\n }\n Reflect.defineProperty(safe.prototype, key, desc);\n }\n });\n } else\n copyProps(unsafe.prototype, safe.prototype);\n return copyProps(unsafe, safe), Object.setPrototypeOf(safe.prototype, null), Object.freeze(safe.prototype), Object.freeze(safe), safe;\n}, StringIterator = uncurryThis(@String.prototype[Symbol.iterator]), StringIteratorPrototype = Reflect.getPrototypeOf(StringIterator(\"\")), ArrayPrototypeForEach = uncurryThis(@Array.prototype.forEach), arrayProtoPush = @Array.prototype.push;\n$ = {\n makeSafe,\n Array: @Array,\n ArrayFrom: @Array.from,\n ArrayIsArray: @Array.isArray,\n ArrayPrototypeFlat: uncurryThis(@Array.prototype.flat),\n ArrayPrototypeFilter: uncurryThis(@Array.prototype.filter),\n ArrayPrototypeForEach,\n ArrayPrototypeIncludes: uncurryThis(@Array.prototype.includes),\n ArrayPrototypeIndexOf: uncurryThis(@Array.prototype.indexOf),\n ArrayPrototypeJoin: uncurryThis(@Array.prototype.join),\n ArrayPrototypeMap: uncurryThis(@Array.prototype.map),\n ArrayPrototypePop: uncurryThis(@Array.prototype.pop),\n ArrayPrototypePush: uncurryThis(arrayProtoPush),\n ArrayPrototypePushApply: (a, b) => arrayProtoPush.@apply(a, b),\n ArrayPrototypeSlice: uncurryThis(@Array.prototype.slice),\n ArrayPrototypeSort: uncurryThis(@Array.prototype.sort),\n ArrayPrototypeSplice: uncurryThis(@Array.prototype.splice),\n ArrayPrototypeUnshift: uncurryThis(@Array.prototype.unshift),\n BigIntPrototypeValueOf: uncurryThis(BigInt.prototype.valueOf),\n BooleanPrototypeValueOf: uncurryThis(Boolean.prototype.valueOf),\n DatePrototypeGetTime: uncurryThis(Date.prototype.getTime),\n DatePrototypeToISOString: uncurryThis(Date.prototype.toISOString),\n DatePrototypeToString: uncurryThis(Date.prototype.toString),\n ErrorCaptureStackTrace,\n ErrorPrototypeToString: uncurryThis(Error.prototype.toString),\n FunctionPrototypeToString: uncurryThis(Function.prototype.toString),\n JSONStringify: JSON.stringify,\n MapPrototypeGetSize: getGetter(Map, \"size\"),\n MapPrototypeEntries: uncurryThis(Map.prototype.entries),\n MapPrototypeValues: uncurryThis(Map.prototype.values),\n MapPrototypeKeys: uncurryThis(Map.prototype.keys),\n MathFloor: Math.floor,\n MathMax: Math.max,\n MathMin: Math.min,\n MathRound: Math.round,\n MathSqrt: Math.sqrt,\n MathTrunc: Math.trunc,\n Number,\n NumberIsFinite: Number.isFinite,\n NumberIsNaN: Number.isNaN,\n NumberParseFloat: Number.parseFloat,\n NumberParseInt: Number.parseInt,\n NumberPrototypeToString: uncurryThis(Number.prototype.toString),\n NumberPrototypeValueOf: uncurryThis(Number.prototype.valueOf),\n Object,\n ObjectAssign: Object.assign,\n ObjectCreate: Object.create,\n ObjectDefineProperty: Object.defineProperty,\n ObjectEntries: Object.entries,\n ObjectGetOwnPropertyDescriptor: Object.getOwnPropertyDescriptor,\n ObjectGetOwnPropertyDescriptors: Object.getOwnPropertyDescriptors,\n ObjectGetOwnPropertyNames: Object.getOwnPropertyNames,\n ObjectGetOwnPropertySymbols: Object.getOwnPropertySymbols,\n ObjectGetPrototypeOf: Object.getPrototypeOf,\n ObjectIs: Object.is,\n ObjectKeys: Object.keys,\n ObjectPrototypeHasOwnProperty: uncurryThis(Object.prototype.hasOwnProperty),\n ObjectPrototypePropertyIsEnumerable: uncurryThis(Object.prototype.propertyIsEnumerable),\n ObjectPrototypeToString: uncurryThis(Object.prototype.toString),\n ObjectSeal: Object.seal,\n ObjectSetPrototypeOf: Object.setPrototypeOf,\n ReflectApply: @getByIdDirect(Reflect, \"apply\"),\n ReflectOwnKeys: Reflect.ownKeys,\n RegExp: @RegExp,\n RegExpPrototypeExec: uncurryThis(@RegExp.prototype.exec),\n RegExpPrototypeSymbolReplace: uncurryThis(@RegExp.prototype[Symbol.replace]),\n RegExpPrototypeSymbolSplit: uncurryThis(@RegExp.prototype[Symbol.split]),\n RegExpPrototypeTest: uncurryThis(@RegExp.prototype.test),\n RegExpPrototypeToString: uncurryThis(@RegExp.prototype.toString),\n SafeStringIterator: createSafeIterator(StringIterator, uncurryThis(StringIteratorPrototype.next)),\n SafeMap: makeSafe(Map, class SafeMap extends Map {\n constructor(i) {\n super(i);\n }\n }),\n SafeSet: makeSafe(Set, class SafeSet extends Set {\n constructor(i) {\n super(i);\n }\n }),\n SetPrototypeGetSize: getGetter(Set, \"size\"),\n SetPrototypeEntries: uncurryThis(Set.prototype.entries),\n SetPrototypeValues: uncurryThis(Set.prototype.values),\n String: @String,\n StringPrototypeCharCodeAt: uncurryThis(@String.prototype.charCodeAt),\n StringPrototypeCodePointAt: uncurryThis(@String.prototype.codePointAt),\n StringPrototypeEndsWith: uncurryThis(@String.prototype.endsWith),\n StringPrototypeIncludes: uncurryThis(@String.prototype.includes),\n StringPrototypeIndexOf: uncurryThis(@String.prototype.indexOf),\n StringPrototypeLastIndexOf: uncurryThis(@String.prototype.lastIndexOf),\n StringPrototypeMatch: uncurryThis(@String.prototype.match),\n StringPrototypeNormalize: uncurryThis(@String.prototype.normalize),\n StringPrototypePadEnd: uncurryThis(@String.prototype.padEnd),\n StringPrototypePadStart: uncurryThis(@String.prototype.padStart),\n StringPrototypeRepeat: uncurryThis(@String.prototype.repeat),\n StringPrototypeReplace: uncurryThis(@String.prototype.replace),\n StringPrototypeReplaceAll: uncurryThis(@String.prototype.replaceAll),\n StringPrototypeSlice: uncurryThis(@String.prototype.slice),\n StringPrototypeSplit: uncurryThis(@String.prototype.split),\n StringPrototypeStartsWith: uncurryThis(@String.prototype.startsWith),\n StringPrototypeToLowerCase: uncurryThis(@String.prototype.toLowerCase),\n StringPrototypeTrim: uncurryThis(@String.prototype.trim),\n StringPrototypeValueOf: uncurryThis(@String.prototype.valueOf),\n SymbolPrototypeToString: uncurryThis(Symbol.prototype.toString),\n SymbolPrototypeValueOf: uncurryThis(Symbol.prototype.valueOf),\n FunctionPrototypeToString: uncurryThis(Function.prototype.toString),\n FunctionPrototypeBind: uncurryThis(Function.prototype.bind),\n SymbolIterator: Symbol.iterator,\n SymbolFor: Symbol.for,\n SymbolToStringTag: Symbol.toStringTag,\n TypedArrayPrototypeGetLength: getGetter(@Uint8Array, \"length\"),\n TypedArrayPrototypeGetSymbolToStringTag: getGetter(@Uint8Array, Symbol.toStringTag),\n Uint8ClampedArray,\n Uint8Array: @Uint8Array,\n Uint16Array,\n Uint32Array,\n Int8Array,\n Int16Array,\n Int32Array,\n Float32Array,\n Float64Array,\n BigUint64Array,\n BigInt64Array,\n uncurryThis\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral InternalSharedCode = "(function (){\"use strict\";// src/js/out/tmp/internal/shared.ts\nvar throwNotImplemented = function(feature, issue) {\n throw hideFromStack(throwNotImplemented), new NotImplementedError(feature, issue);\n}, hideFromStack = function(...fns) {\n for (let fn of fns)\n Object.defineProperty(fn, \"name\", {\n value: \"::bunternal::\"\n });\n}, $;\n\nclass NotImplementedError extends Error {\n code;\n constructor(feature, issue) {\n super(feature + \" is not yet implemented in Bun.\" + (issue \? \" Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/\" + issue : \"\"));\n this.name = \"NotImplementedError\", this.code = \"ERR_NOT_IMPLEMENTED\", hideFromStack(NotImplementedError);\n }\n}\n$ = {\n NotImplementedError,\n throwNotImplemented,\n hideFromStack\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral InternalSharedCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/shared.ts\nvar throwNotImplemented = function(feature, issue) {\n throw hideFromStack(throwNotImplemented), new NotImplementedError(feature, issue);\n}, hideFromStack = function(...fns) {\n for (let fn of fns)\n Object.defineProperty(fn, \"name\", {\n value: \"::bunternal::\"\n });\n}, $;\n\nclass NotImplementedError extends Error {\n code;\n constructor(feature, issue) {\n super(feature + \" is not yet implemented in Bun.\" + (issue \? \" Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/\" + issue : \"\"));\n this.name = \"NotImplementedError\", this.code = \"ERR_NOT_IMPLEMENTED\", hideFromStack(NotImplementedError);\n }\n}\n$ = {\n NotImplementedError,\n throwNotImplemented,\n hideFromStack\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeAssertCode = "(function (){\"use strict\";// src/js/out/tmp/node/assert.ts\nvar CallTracker = function() {\n throw new Error(\"CallTracker is not supported yet\");\n}, util = @getInternalField(@internalModuleRegistry, 46) || @createInternalModuleById(46), isDeepEqual = Bun.deepEquals, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_errors = __commonJS({\n \"assert/build/internal/errors.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n var codes = {}, assert, util2;\n function createErrorType(code, message, Base) {\n Base || (Base = Error);\n function getMessage(arg1, arg2, arg3) {\n return typeof message == \"string\" \? message : message(arg1, arg2, arg3);\n }\n var NodeError = function(_Base) {\n _inherits(NodeError2, _Base);\n function NodeError2(arg1, arg2, arg3) {\n var _this;\n return _classCallCheck(this, NodeError2), _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError2).call(this, getMessage(arg1, arg2, arg3))), _this.code = code, _this;\n }\n return NodeError2;\n }(Base);\n codes[code] = NodeError;\n }\n function oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n return expected = expected.map(function(i) {\n return String(i);\n }), len > 2 \? \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1] : len === 2 \? \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]) : \"of \".concat(thing, \" \").concat(expected[0]);\n } else\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n function startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 \? 0 : +pos, search.length) === search;\n }\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function includes(str, search, start) {\n return typeof start != \"number\" && (start = 0), start + search.length > str.length \? !1 : str.indexOf(search, start) !== -1;\n }\n createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError), createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n assert === void 0 && (assert = require_assert()), assert(typeof name == \"string\", \"'name' must be a string\");\n var determiner;\n typeof expected == \"string\" && startsWith(expected, \"not \") \? (determiner = \"must not be\", expected = expected.replace(/^not /, \"\")) : determiner = \"must be\";\n var msg;\n if (endsWith(name, \" argument\"))\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n else {\n var type = includes(name, \".\") \? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n }\n return msg += \". Received type \".concat(_typeof(actual)), msg;\n }, TypeError), createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== void 0 \? arguments[2] : \"is invalid\", inspected = util2.inspect(value);\n return inspected.length > 128 && (inspected = \"\".concat(inspected.slice(0, 128), \"...\")), \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n }, TypeError, RangeError), createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n return value && value.constructor && value.constructor.name \? type = \"instance of \".concat(value.constructor.name) : type = \"type \".concat(_typeof(value)), \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n }, TypeError), createErrorType(\"ERR_MISSING_ARGS\", function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n assert === void 0 && (assert = require_assert()), assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \", len = args.length;\n switch (args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n }), len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \"), msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n }, TypeError), module2.exports.codes = codes;\n }\n}), require_assertion_error = __commonJS({\n \"assert/build/internal/assert/assertion_error.js\"(exports, module2) {\n function _objectSpread(target) {\n for (var i = 1;i < arguments.length; i++) {\n var source = arguments[i] != null \? arguments[i] : {}, ownKeys = Object.keys(source);\n typeof Object.getOwnPropertySymbols == \"function\" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }))), ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n }\n function _defineProperty(obj, key, value) {\n return (key in obj) \? Object.defineProperty(obj, key, {\n value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : obj[key] = value, obj;\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _defineProperties(target, props) {\n for (var i = 0;i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, (\"value\" in descriptor) && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map == \"function\" \? new Map : void 0;\n return _wrapNativeSuper = function(Class2) {\n if (Class2 === null || !_isNativeFunction(Class2))\n return Class2;\n if (typeof Class2 != \"function\")\n @throwTypeError(\"Super expression must either be null or a function\");\n if (typeof _cache != \"undefined\") {\n if (_cache.has(Class2))\n return _cache.get(Class2);\n _cache.set(Class2, Wrapper);\n }\n function Wrapper() {\n return _construct(Class2, arguments, _getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(Class2.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), _setPrototypeOf(Wrapper, Class2);\n }, _wrapNativeSuper(Class);\n }\n function isNativeReflectConstruct() {\n if (typeof Reflect == \"undefined\" || !Reflect.construct || Reflect.construct.sham)\n return !1;\n if (typeof Proxy == \"function\")\n return !0;\n try {\n return Date.prototype.toString.call(Reflect.construct(Date, [], function() {\n })), !0;\n } catch {\n return !1;\n }\n }\n function _construct(Parent, args, Class) {\n return isNativeReflectConstruct() \? _construct = Reflect.construct : _construct = function(Parent2, args2, Class2) {\n var a = [null];\n a.push.apply(a, args2);\n var Constructor = Function.bind.apply(Parent2, a), instance = new Constructor;\n return Class2 && _setPrototypeOf(instance, Class2.prototype), instance;\n }, _construct.apply(null, arguments);\n }\n function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n var inspect = util.inspect, _require2 = require_errors(), ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function repeat(str, count) {\n if (count = Math.floor(count), str.length == 0 || count == 0)\n return \"\";\n var maxCount = str.length * count;\n for (count = Math.floor(Math.log(count) / Math.log(2));count; )\n str += str, count--;\n return str += str.substring(0, maxCount - str.length), str;\n }\n var blue = \"\", green = \"\", red = \"\", white = \"\", kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n }, kMaxShortLength = 10;\n function copyError(source) {\n var keys = Object.keys(source), target = Object.create(Object.getPrototypeOf(source));\n return keys.forEach(function(key) {\n target[key] = source[key];\n }), Object.defineProperty(target, \"message\", {\n value: source.message\n }), target;\n }\n function inspectValue(val) {\n return inspect(val, {\n compact: !1,\n customInspect: !1,\n depth: 1000,\n maxArrayLength: Infinity,\n showHidden: !1,\n breakLength: Infinity,\n showProxy: !1,\n sorted: !0,\n getters: !0\n });\n }\n function createErrDiff(actual, expected, operator) {\n var other = \"\", res = \"\", lastPos = 0, end = \"\", skipped = !1, actualInspected = inspectValue(actual), actualLines = actualInspected.split(`\n`), expectedLines = inspectValue(expected).split(`\n`), i = 0, indicator = \"\";\n if (operator === \"strictEqual\" && _typeof(actual) === \"object\" && _typeof(expected) === \"object\" && actual !== null && expected !== null && (operator = \"strictEqualObject\"), actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== \"object\" || actual === null) && (_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0))\n return \"\".concat(kReadableOperator[operator], `\n\n`) + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], `\n`);\n } else if (operator !== \"strictEqualObject\") {\n var maxLength = process.stderr && process.stderr.isTTY \? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n for (;actualLines[0][i] === expectedLines[0][i]; )\n i++;\n i > 2 && (indicator = `\n `.concat(repeat(\" \", i), \"^\"), i = 0);\n }\n }\n }\n for (var a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];a === b && (i++ < 2 \? end = `\n `.concat(a).concat(end) : other = a, actualLines.pop(), expectedLines.pop(), !(actualLines.length === 0 || expectedLines.length === 0)); )\n a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n if (maxLines === 0) {\n var _actualLines = actualInspected.split(`\n`);\n if (_actualLines.length > 30)\n for (_actualLines[26] = \"\".concat(blue, \"...\").concat(white);_actualLines.length > 27; )\n _actualLines.pop();\n return \"\".concat(kReadableOperator.notIdentical, `\n\n`).concat(_actualLines.join(`\n`), `\n`);\n }\n i > 3 && (end = `\n`.concat(blue, \"...\").concat(white).concat(end), skipped = !0), other !== \"\" && (end = `\n `.concat(other).concat(end), other = \"\");\n var printedLines = 0, msg = kReadableOperator[operator] + `\n`.concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white), skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0;i < maxLines; i++) {\n var cur = i - lastPos;\n if (actualLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(expectedLines[i - 2]), printedLines++), res += `\n `.concat(expectedLines[i - 1]), printedLines++), lastPos = i, other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]), printedLines++;\n else if (expectedLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLines[i]), printedLines++;\n else {\n var expectedLine = expectedLines[i], actualLine = actualLines[i], divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n divergingLines && endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine && (divergingLines = !1, actualLine += \",\"), divergingLines \? (cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLine), other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLine), printedLines += 2) : (res += other, other = \"\", (cur === 1 || i === 0) && (res += `\n `.concat(actualLine), printedLines++));\n }\n if (printedLines > 20 && i < maxLines - 2)\n return \"\".concat(msg).concat(skippedMsg, `\n`).concat(res, `\n`).concat(blue, \"...\").concat(white).concat(other, `\n`) + \"\".concat(blue, \"...\").concat(white);\n }\n return \"\".concat(msg).concat(skipped \? skippedMsg : \"\", `\n`).concat(res).concat(other).concat(end).concat(indicator);\n }\n var AssertionError = function(_Error) {\n function AssertionError2(options) {\n var _this;\n if (_classCallCheck(this, AssertionError2), _typeof(options) !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var { message, operator, stackStartFn, actual, expected } = options, limit = Error.stackTraceLimit;\n if (Error.stackTraceLimit = 0, message != null)\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, String(message)));\n else if (process.stderr && process.stderr.isTTY && (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1 \? (blue = \"\", green = \"\", white = \"\", red = \"\") : (blue = \"\", green = \"\", white = \"\", red = \"\")), _typeof(actual) === \"object\" && actual !== null && _typeof(expected) === \"object\" && expected !== null && (\"stack\" in actual) && actual instanceof Error && (\"stack\" in expected) && expected instanceof Error && (actual = copyError(actual), expected = copyError(expected)), operator === \"deepStrictEqual\" || operator === \"strictEqual\")\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, createErrDiff(actual, expected, operator)));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n var base = kReadableOperator[operator], res = inspectValue(actual).split(`\n`);\n if (operator === \"notStrictEqual\" && _typeof(actual) === \"object\" && actual !== null && (base = kReadableOperator.notStrictEqualObject), res.length > 30)\n for (res[26] = \"\".concat(blue, \"...\").concat(white);res.length > 27; )\n res.pop();\n res.length === 1 \? _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, \" \").concat(res[0]))) : _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, `\n\n`).concat(res.join(`\n`), `\n`)));\n } else {\n var _res = inspectValue(actual), other = \"\", knownOperators = kReadableOperator[operator];\n operator === \"notDeepEqual\" || operator === \"notEqual\" \? (_res = \"\".concat(kReadableOperator[operator], `\n\n`).concat(_res), _res.length > 1024 && (_res = \"\".concat(_res.slice(0, 1021), \"...\"))) : (other = \"\".concat(inspectValue(expected)), _res.length > 512 && (_res = \"\".concat(_res.slice(0, 509), \"...\")), other.length > 512 && (other = \"\".concat(other.slice(0, 509), \"...\")), operator === \"deepEqual\" || operator === \"equal\" \? _res = \"\".concat(knownOperators, `\n\n`).concat(_res, `\n\nshould equal\n\n`) : other = \" \".concat(operator, \" \").concat(other)), _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(_res).concat(other)));\n }\n return Error.stackTraceLimit = limit, _this.generatedMessage = !message, Object.defineProperty(_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: !1,\n writable: !0,\n configurable: !0\n }), _this.code = \"ERR_ASSERTION\", _this.actual = actual, _this.expected = expected, _this.operator = operator, Error.captureStackTrace && Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn), _this.stack, _this.name = \"AssertionError\", _possibleConstructorReturn(_this);\n }\n return AssertionError2.prototype = {}, _inherits(AssertionError2, _Error), _createClass(AssertionError2, [\n {\n key: \"toString\",\n value: function() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: inspect.custom,\n value: function(recurseTimes, ctx) {\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: !1,\n depth: 0\n }));\n }\n }\n ]), AssertionError2;\n }(_wrapNativeSuper(Error));\n module2.exports = AssertionError;\n }\n}), require_assert = __commonJS({\n \"assert/build/assert.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n var _require = require_errors(), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, AssertionError = require_assertion_error(), _require2 = util, inspect = _require2.inspect, _require$types = util.types, isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp, objectAssign = Object.assign, objectIs = Object.is, errorCache = new Map, warned = !1, assert = module2.exports = ok, NO_EXCEPTION_SENTINEL = {};\n function innerFail(obj) {\n throw obj.message instanceof Error \? obj.message : new AssertionError(obj);\n }\n function fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length, internalMessage;\n if (argsLen === 0)\n internalMessage = \"Failed\";\n else if (argsLen === 1)\n message = actual, actual = void 0;\n else {\n if (warned === !1) {\n warned = !0;\n var warn = process.emitWarning \? process.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n argsLen === 2 && (operator = \"!=\");\n }\n if (message instanceof Error)\n throw message;\n var errArgs = {\n actual,\n expected,\n operator: operator === void 0 \? \"fail\" : operator,\n stackStartFn: stackStartFn || fail\n };\n message !== void 0 && (errArgs.message = message);\n var err = new AssertionError(errArgs);\n throw internalMessage && (err.message = internalMessage, err.generatedMessage = !0), err;\n }\n assert.fail = fail, assert.AssertionError = AssertionError;\n function innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = !1;\n if (argLen === 0)\n generatedMessage = !0, message = \"No value argument passed to `assert.ok()`\";\n else if (message instanceof Error)\n throw message;\n var err = new AssertionError({\n actual: value,\n expected: !0,\n message,\n operator: \"==\",\n stackStartFn: fn\n });\n throw err.generatedMessage = generatedMessage, err;\n }\n }\n function ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n innerOk.apply(void 0, [ok, args.length].concat(args));\n }\n assert.ok = ok, assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual != expected && innerFail({\n actual,\n expected,\n message,\n operator: \"==\",\n stackStartFn: equal\n });\n }, assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual == expected && innerFail({\n actual,\n expected,\n message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n }, assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n }, assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n }, assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n }, assert.notDeepStrictEqual = notDeepStrictEqual;\n function notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: notDeepStrictEqual\n });\n }\n assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) || innerFail({\n actual,\n expected,\n message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n }, assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) && innerFail({\n actual,\n expected,\n message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n }, assert.match = function match(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!isRegExp(expected))\n throw new ERR_INVALID_ARG_TYPE(\"expected\", \"RegExp\", expected);\n expected.test(actual) || innerFail({\n actual,\n expected,\n message,\n operator: \"match\",\n stackStartFn: match\n });\n };\n var Comparison = function Comparison2(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison2), keys.forEach(function(key) {\n (key in obj) && (actual !== void 0 && typeof actual[key] == \"string\" && isRegExp(obj[key]) && obj[key].test(actual[key]) \? _this[key] = actual[key] : _this[key] = obj[key]);\n });\n };\n function compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepEqual(actual[key], expected[key], !0)) {\n if (!message) {\n var a = new Comparison(actual, keys), b = new Comparison(expected, keys, actual), err = new AssertionError({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.actual = actual, err.expected = expected, err.operator = fn.name, err;\n }\n innerFail({\n actual,\n expected,\n message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n }\n function expectedException(actual, expected, msg, fn) {\n if (typeof expected != \"function\") {\n if (isRegExp(expected))\n return expected.test(actual);\n if (arguments.length === 2)\n throw new ERR_INVALID_ARG_TYPE(\"expected\", [\"Function\", \"RegExp\"], expected);\n if (_typeof(actual) !== \"object\" || actual === null) {\n var err = new AssertionError({\n actual,\n expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.operator = fn.name, err;\n }\n var keys = Object.keys(expected);\n if (expected instanceof Error)\n keys.push(\"name\", \"message\");\n else if (keys.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n return keys.forEach(function(key) {\n return typeof actual[key] == \"string\" && isRegExp(expected[key]) && expected[key].test(actual[key]) || compareExceptionKey(actual, expected, key, msg, keys, fn);\n }), !0;\n }\n return expected.prototype !== void 0 && actual instanceof expected \? !0 : Error.isPrototypeOf(expected) \? !1 : expected.call({}, actual) === !0;\n }\n function getActual(fn) {\n if (typeof fn != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n }\n function checkIsPromise(obj) {\n return isPromise(obj) || obj !== null && _typeof(obj) === \"object\" && typeof obj.then == \"function\" && typeof obj.catch == \"function\";\n }\n function waitForActual(promiseFn) {\n return Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn == \"function\") {\n if (resultPromise = promiseFn(), !checkIsPromise(resultPromise))\n throw new ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if (checkIsPromise(promiseFn))\n resultPromise = promiseFn;\n else\n throw new ERR_INVALID_ARG_TYPE(\"promiseFn\", [\"Function\", \"Promise\"], promiseFn);\n return Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n }\n function expectsError(stackStartFn, actual, error, message) {\n if (typeof error == \"string\") {\n if (arguments.length === 4)\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error, error = void 0;\n } else if (error != null && _typeof(error) !== \"object\" && typeof error != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n error && error.name && (details += \" (\".concat(error.name, \")\")), details += message \? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" \? \"rejection\" : \"exception\";\n innerFail({\n actual: void 0,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn))\n throw actual;\n }\n function expectsNoError(stackStartFn, actual, error, message) {\n if (actual !== NO_EXCEPTION_SENTINEL) {\n if (typeof error == \"string\" && (message = error, error = void 0), !error || expectedException(actual, error)) {\n var details = message \? \": \".concat(message) : \".\", fnType = stackStartFn.name === \"doesNotReject\" \? \"rejection\" : \"exception\";\n innerFail({\n actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, `\n`) + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn\n });\n }\n throw actual;\n }\n }\n assert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 \? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++)\n args[_key2 - 1] = arguments[_key2];\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n }, assert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 \? _len3 - 1 : 0), _key3 = 1;_key3 < _len3; _key3++)\n args[_key3 - 1] = arguments[_key3];\n return waitForActual(promiseFn).then(function(result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n }, assert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 \? _len4 - 1 : 0), _key4 = 1;_key4 < _len4; _key4++)\n args[_key4 - 1] = arguments[_key4];\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n }, assert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 \? _len5 - 1 : 0), _key5 = 1;_key5 < _len5; _key5++)\n args[_key5 - 1] = arguments[_key5];\n return waitForActual(fn).then(function(result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n }, assert.ifError = function ifError(err) {\n if (err != null) {\n var message = \"ifError got unwanted exception: \";\n _typeof(err) === \"object\" && typeof err.message == \"string\" \? err.message.length === 0 && err.constructor \? message += err.constructor.name : message += err.message : message += inspect(err);\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message,\n stackStartFn: ifError\n }), origStack = err.stack;\n if (typeof origStack == \"string\") {\n var tmp2 = origStack.split(`\n`);\n tmp2.shift();\n for (var tmp1 = newErr.stack.split(`\n`), i = 0;i < tmp2.length; i++) {\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(`\n`), `\n`).concat(tmp2.join(`\n`));\n }\n throw newErr;\n }\n };\n function strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0;_key6 < _len6; _key6++)\n args[_key6] = arguments[_key6];\n innerOk.apply(void 0, [strict, args.length].concat(args));\n }\n assert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n }), assert.strict.strict = assert.strict;\n }\n}), assert_module = require_assert();\nassert_module.CallTracker = CallTracker;\nreturn assert_module})\n"_s;
+static constexpr ASCIILiteral InternalUtilInspectCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/util/inspect.ts\nvar vmSafeInstanceof = function(val, ctor) {\n if (val instanceof ctor)\n return !0;\n while (val) {\n if (typeof val !== \"object\")\n return !1;\n if (ctor.name === internalGetConstructorName(val))\n return !0;\n val = ObjectGetPrototypeOf(val);\n }\n return !1;\n}, checkBox = function(ctor) {\n return (val) => {\n if (!vmSafeInstanceof(val, ctor))\n return !1;\n try {\n ctor.prototype.valueOf.@call(val);\n } catch {\n return !1;\n }\n return !0;\n };\n}, assert = function(p, message) {\n if (!p)\n throw new AssertionError(message);\n}, getUserOptions = function(ctx, isCrossContext) {\n const ret = {\n stylize: ctx.stylize,\n showHidden: ctx.showHidden,\n depth: ctx.depth,\n colors: ctx.colors,\n customInspect: ctx.customInspect,\n showProxy: ctx.showProxy,\n maxArrayLength: ctx.maxArrayLength,\n maxStringLength: ctx.maxStringLength,\n breakLength: ctx.breakLength,\n compact: ctx.compact,\n sorted: ctx.sorted,\n getters: ctx.getters,\n numericSeparator: ctx.numericSeparator,\n ...ctx.userOptions\n };\n if (isCrossContext) {\n ObjectSetPrototypeOf(ret, null);\n for (let key of ObjectKeys(ret))\n if ((typeof ret[key] === \"object\" || typeof ret[key] === \"function\") && ret[key] !== null)\n delete ret[key];\n ret.stylize = ObjectSetPrototypeOf((value, flavour) => {\n let stylized;\n try {\n stylized = `${ctx.stylize(value, flavour)}`;\n } catch {\n }\n if (typeof stylized !== \"string\")\n return value;\n return stylized;\n }, null);\n }\n return ret;\n}, inspect = function(value, opts) {\n const ctx = {\n budget: {},\n indentationLvl: 0,\n seen: [],\n currentDepth: 0,\n stylize: stylizeNoColor,\n showHidden: inspectDefaultOptions.showHidden,\n depth: inspectDefaultOptions.depth,\n colors: inspectDefaultOptions.colors,\n customInspect: inspectDefaultOptions.customInspect,\n showProxy: inspectDefaultOptions.showProxy,\n maxArrayLength: inspectDefaultOptions.maxArrayLength,\n maxStringLength: inspectDefaultOptions.maxStringLength,\n breakLength: inspectDefaultOptions.breakLength,\n compact: inspectDefaultOptions.compact,\n sorted: inspectDefaultOptions.sorted,\n getters: inspectDefaultOptions.getters,\n numericSeparator: inspectDefaultOptions.numericSeparator\n };\n if (arguments.length > 1) {\n if (arguments.length > 2) {\n if (arguments[2] !== @undefined)\n ctx.depth = arguments[2];\n if (arguments.length > 3 && arguments[3] !== @undefined)\n ctx.colors = arguments[3];\n }\n if (typeof opts === \"boolean\")\n ctx.showHidden = opts;\n else if (opts) {\n const optKeys = ObjectKeys(opts);\n for (let i = 0;i < optKeys.length; ++i) {\n const key = optKeys[i];\n if (ObjectPrototypeHasOwnProperty(inspectDefaultOptions, key) || key === \"stylize\")\n ctx[key] = opts[key];\n else if (ctx.userOptions === @undefined)\n ctx.userOptions = opts;\n }\n }\n }\n if (ctx.colors)\n ctx.stylize = stylizeWithColor;\n if (ctx.maxArrayLength === null)\n ctx.maxArrayLength = @Infinity;\n if (ctx.maxStringLength === null)\n ctx.maxStringLength = @Infinity;\n return formatValue(ctx, value, 0);\n}, defineColorAlias = function(target, alias) {\n ObjectDefineProperty(inspect.colors, alias, {\n __proto__: null,\n get() {\n return this[target];\n },\n set(value) {\n this[target] = value;\n },\n configurable: !0,\n enumerable: !1\n });\n}, addQuotes = function(str, quotes) {\n if (quotes === -1)\n return `\"${str}\"`;\n if (quotes === -2)\n return `\\`${str}\\``;\n return `'${str}'`;\n}, escapeFn = function(str) {\n const charCode = StringPrototypeCharCodeAt(str);\n return meta.length > charCode \? meta[charCode] : `\\\\u${NumberPrototypeToString(charCode, 16)}`;\n}, strEscape = function(str) {\n let escapeTest = strEscapeSequencesRegExp, escapeReplace = strEscapeSequencesReplacer, singleQuote = 39;\n if (StringPrototypeIncludes(str, \"'\")) {\n if (!StringPrototypeIncludes(str, '\"'))\n singleQuote = -1;\n else if (!StringPrototypeIncludes(str, \"`\") && !StringPrototypeIncludes(str, \"${\"))\n singleQuote = -2;\n if (singleQuote !== 39)\n escapeTest = strEscapeSequencesRegExpSingle, escapeReplace = strEscapeSequencesReplacerSingle;\n }\n if (str.length < 5000 && RegExpPrototypeExec(escapeTest, str) === null)\n return addQuotes(str, singleQuote);\n if (str.length > 100)\n return str = RegExpPrototypeSymbolReplace(escapeReplace, str, escapeFn), addQuotes(str, singleQuote);\n let result = \"\", last = 0;\n for (let i = 0;i < str.length; i++) {\n const point = StringPrototypeCharCodeAt(str, i);\n if (point === singleQuote || point === 92 || point < 32 || point > 126 && point < 160) {\n if (last === i)\n result += meta[point];\n else\n result += `${StringPrototypeSlice(str, last, i)}${meta[point]}`;\n last = i + 1;\n } else if (point >= 55296 && point <= 57343) {\n if (point <= 56319 && i + 1 < str.length) {\n const point2 = StringPrototypeCharCodeAt(str, i + 1);\n if (point2 >= 56320 && point2 <= 57343) {\n i++;\n continue;\n }\n }\n result += `${StringPrototypeSlice(str, last, i)}\\\\u${NumberPrototypeToString(point, 16)}`, last = i + 1;\n }\n }\n if (last !== str.length)\n result += StringPrototypeSlice(str, last);\n return addQuotes(result, singleQuote);\n}, stylizeWithColor = function(str, styleType) {\n const style = inspect.styles[styleType];\n if (style !== @undefined) {\n const color = inspect.colors[style];\n if (color !== @undefined)\n return `\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`;\n }\n return str;\n}, stylizeNoColor = function(str) {\n return str;\n}, getEmptyFormatArray = function() {\n return [];\n}, isInstanceof = function(object, proto) {\n try {\n return object instanceof proto;\n } catch {\n return !1;\n }\n}, getConstructorName = function(obj, ctx, recurseTimes, protoProps) {\n let firstProto;\n const tmp = obj;\n while (obj || isUndetectableObject(obj)) {\n const descriptor = ObjectGetOwnPropertyDescriptor(obj, \"constructor\");\n if (descriptor !== @undefined && typeof descriptor.value === \"function\" && descriptor.value.name !== \"\" && isInstanceof(tmp, descriptor.value)) {\n if (protoProps !== @undefined && (firstProto !== obj || !builtInObjects.has(descriptor.value.name)))\n addPrototypeProperties(ctx, tmp, firstProto || tmp, recurseTimes, protoProps);\n return String(descriptor.value.name);\n }\n if (obj = ObjectGetPrototypeOf(obj), firstProto === @undefined)\n firstProto = obj;\n }\n if (firstProto === null)\n return null;\n const res = internalGetConstructorName(tmp);\n if (recurseTimes > ctx.depth && ctx.depth !== null)\n return `${res} <Complex prototype>`;\n const protoConstr = getConstructorName(firstProto, ctx, recurseTimes + 1, protoProps);\n if (protoConstr === null)\n return `${res} <${inspect(firstProto, {\n ...ctx,\n customInspect: !1,\n depth: -1\n })}>`;\n return `${res} <${protoConstr}>`;\n}, addPrototypeProperties = function(ctx, main, obj, recurseTimes, output) {\n let depth = 0, keys, keySet;\n do {\n if (depth !== 0 || main === obj) {\n if (obj = ObjectGetPrototypeOf(obj), obj === null)\n return;\n const descriptor = ObjectGetOwnPropertyDescriptor(obj, \"constructor\");\n if (descriptor !== @undefined && typeof descriptor.value === \"function\" && builtInObjects.has(descriptor.value.name))\n return;\n }\n if (depth === 0)\n keySet = new SafeSet;\n else\n ArrayPrototypeForEach(keys, (key) => keySet.add(key));\n keys = ReflectOwnKeys(obj), ArrayPrototypePush(ctx.seen, main);\n for (let key of keys) {\n if (key === \"constructor\" || ObjectPrototypeHasOwnProperty(main, key) || depth !== 0 && keySet.has(key))\n continue;\n const desc = ObjectGetOwnPropertyDescriptor(obj, key);\n if (typeof desc.value === \"function\")\n continue;\n const value = formatProperty(ctx, obj, recurseTimes, key, kObjectType, desc, main);\n if (ctx.colors)\n ArrayPrototypePush(output, `\\x1B[2m${value}\\x1B[22m`);\n else\n ArrayPrototypePush(output, value);\n }\n ArrayPrototypePop(ctx.seen);\n } while (++depth !== 3);\n}, getPrefix = function(constructor, tag, fallback, size = \"\") {\n if (constructor === null) {\n if (tag !== \"\" && fallback !== tag)\n return `[${fallback}${size}: null prototype] [${tag}] `;\n return `[${fallback}${size}: null prototype] `;\n }\n if (tag !== \"\" && constructor !== tag)\n return `${constructor}${size} [${tag}] `;\n return `${constructor}${size} `;\n}, getKeys = function(value, showHidden) {\n let keys;\n const symbols = ObjectGetOwnPropertySymbols(value);\n if (showHidden) {\n if (keys = ObjectGetOwnPropertyNames(value), symbols.length !== 0)\n ArrayPrototypePushApply(keys, symbols);\n } else {\n try {\n keys = ObjectKeys(value);\n } catch (err) {\n assert(isNativeError(err) && err.name === \"ReferenceError\" && isModuleNamespaceObject(value)), keys = ObjectGetOwnPropertyNames(value);\n }\n if (symbols.length !== 0)\n ArrayPrototypePushApply(keys, ArrayPrototypeFilter(symbols, (key) => ObjectPrototypePropertyIsEnumerable(value, key)));\n }\n return keys;\n}, getCtxStyle = function(value, constructor, tag) {\n let fallback = \"\";\n if (constructor === null) {\n if (fallback = internalGetConstructorName(value), fallback === tag)\n fallback = \"Object\";\n }\n return getPrefix(constructor, tag, fallback);\n}, formatProxy = function(ctx, proxy, recurseTimes) {\n if (recurseTimes > ctx.depth && ctx.depth !== null)\n return ctx.stylize(\"Proxy [Array]\", \"special\");\n recurseTimes += 1, ctx.indentationLvl += 2;\n const res = [formatValue(ctx, proxy[0], recurseTimes), formatValue(ctx, proxy[1], recurseTimes)];\n return ctx.indentationLvl -= 2, reduceToSingleString(ctx, res, \"\", [\"Proxy [\", \"]\"], kArrayExtrasType, recurseTimes);\n}, formatValue = function(ctx, value, recurseTimes, typedArray) {\n if (typeof value !== \"object\" && typeof value !== \"function\" && !isUndetectableObject(value))\n return formatPrimitive(ctx.stylize, value, ctx);\n if (value === null)\n return ctx.stylize(\"null\", \"null\");\n const context = value, proxy = getProxyDetails(value, !!ctx.showProxy);\n if (proxy !== @undefined) {\n if (proxy === null || proxy[0] === null)\n return ctx.stylize(\"<Revoked Proxy>\", \"special\");\n if (ctx.showProxy)\n return formatProxy(ctx, proxy, recurseTimes);\n value = proxy;\n }\n if (ctx.customInspect) {\n const maybeCustom = value[customInspectSymbol];\n if (typeof maybeCustom === \"function\" && maybeCustom !== inspect && !(value.constructor && value.constructor.prototype === value)) {\n const depth = ctx.depth === null \? null : ctx.depth - recurseTimes, isCrossContext = proxy !== @undefined || !(context instanceof Object), ret = maybeCustom.@call(context, depth, getUserOptions(ctx, isCrossContext), inspect);\n if (ret !== context) {\n if (typeof ret !== \"string\")\n return formatValue(ctx, ret, recurseTimes);\n return StringPrototypeReplaceAll(ret, \"\\n\", `\\n${StringPrototypeRepeat(\" \", ctx.indentationLvl)}`);\n }\n }\n }\n if (ctx.seen.includes(value)) {\n let index = 1;\n if (ctx.circular === @undefined)\n ctx.circular = new SafeMap, ctx.circular.set(value, index);\n else if (index = ctx.circular.get(value), index === @undefined)\n index = ctx.circular.size + 1, ctx.circular.set(value, index);\n return ctx.stylize(`[Circular *${index}]`, \"special\");\n }\n return formatRaw(ctx, value, recurseTimes, typedArray);\n}, formatRaw = function(ctx, value, recurseTimes, typedArray) {\n let keys, protoProps;\n if (ctx.showHidden && (recurseTimes <= ctx.depth || ctx.depth === null))\n protoProps = [];\n const constructor = getConstructorName(value, ctx, recurseTimes, protoProps);\n if (protoProps !== @undefined && protoProps.length === 0)\n protoProps = @undefined;\n let tag = value[SymbolToStringTag];\n if (typeof tag !== \"string\" || tag !== \"\" && (ctx.showHidden \? ObjectPrototypeHasOwnProperty : ObjectPrototypePropertyIsEnumerable)(value, SymbolToStringTag))\n tag = \"\";\n let base = \"\", formatter = getEmptyFormatArray, braces, noIterator = !0, i = 0;\n const filter = ctx.showHidden \? 0 : 2;\n let extrasType = kObjectType;\n if ((SymbolIterator in value) || constructor === null)\n if (noIterator = !1, ArrayIsArray(value)) {\n const prefix = constructor !== \"Array\" || tag !== \"\" \? getPrefix(constructor, tag, \"Array\", `(${value.length})`) : \"\";\n if (keys = getOwnNonIndexProperties(value, filter), braces = [`${prefix}[`, \"]\"], value.length === 0 && keys.length === 0 && protoProps === @undefined)\n return `${braces[0]}]`;\n extrasType = kArrayExtrasType, formatter = formatArray;\n } else if (isSet(value)) {\n const size = SetPrototypeGetSize(value), prefix = getPrefix(constructor, tag, \"Set\", `(${size})`);\n if (keys = getKeys(value, ctx.showHidden), formatter = constructor !== null \? FunctionPrototypeBind(formatSet, null, value) : FunctionPrototypeBind(formatSet, null, SetPrototypeValues(value)), size === 0 && keys.length === 0 && protoProps === @undefined)\n return `${prefix}{}`;\n braces = [`${prefix}{`, \"}\"];\n } else if (isMap(value)) {\n const size = MapPrototypeGetSize(value), prefix = getPrefix(constructor, tag, \"Map\", `(${size})`);\n if (keys = getKeys(value, ctx.showHidden), formatter = constructor !== null \? FunctionPrototypeBind(formatMap, null, value) : FunctionPrototypeBind(formatMap, null, MapPrototypeEntries(value)), size === 0 && keys.length === 0 && protoProps === @undefined)\n return `${prefix}{}`;\n braces = [`${prefix}{`, \"}\"];\n } else if (isTypedArray(value)) {\n keys = getOwnNonIndexProperties(value, filter);\n let bound = value, fallback = \"\";\n if (constructor === null)\n fallback = TypedArrayPrototypeGetSymbolToStringTag(value), bound = new primordials[fallback](value);\n const size = TypedArrayPrototypeGetLength(value);\n if (braces = [`${getPrefix(constructor, tag, fallback, `(${size})`)}[`, \"]\"], value.length === 0 && keys.length === 0 && !ctx.showHidden)\n return `${braces[0]}]`;\n formatter = FunctionPrototypeBind(formatTypedArray, null, bound, size), extrasType = kArrayExtrasType;\n } else if (isMapIterator(value))\n keys = getKeys(value, ctx.showHidden), braces = getIteratorBraces(\"Map\", tag), formatter = FunctionPrototypeBind(formatIterator, null, braces);\n else if (isSetIterator(value))\n keys = getKeys(value, ctx.showHidden), braces = getIteratorBraces(\"Set\", tag), formatter = FunctionPrototypeBind(formatIterator, null, braces);\n else\n noIterator = !0;\n if (noIterator)\n if (keys = getKeys(value, ctx.showHidden), braces = [\"{\", \"}\"], constructor === \"Object\") {\n if (isArgumentsObject(value))\n braces[0] = \"[Arguments] {\";\n else if (tag !== \"\")\n braces[0] = `${getPrefix(constructor, tag, \"Object\")}{`;\n if (keys.length === 0 && protoProps === @undefined)\n return `${braces[0]}}`;\n } else if (typeof value === \"function\") {\n if (base = getFunctionBase(value, constructor, tag), keys.length === 0 && protoProps === @undefined)\n return ctx.stylize(base, \"special\");\n } else if (isRegExp(value)) {\n base = RegExpPrototypeToString(constructor !== null \? value : new RegExp(value));\n const prefix = getPrefix(constructor, tag, \"RegExp\");\n if (prefix !== \"RegExp \")\n base = `${prefix}${base}`;\n if (keys.length === 0 && protoProps === @undefined || recurseTimes > ctx.depth && ctx.depth !== null)\n return ctx.stylize(base, \"regexp\");\n } else if (isDate(value)) {\n base = NumberIsNaN(DatePrototypeGetTime(value)) \? DatePrototypeToString(value) : DatePrototypeToISOString(value);\n const prefix = getPrefix(constructor, tag, \"Date\");\n if (prefix !== \"Date \")\n base = `${prefix}${base}`;\n if (keys.length === 0 && protoProps === @undefined)\n return ctx.stylize(base, \"date\");\n } else if (value instanceof Error) {\n if (base = formatError(value, constructor, tag, ctx, keys), keys.length === 0 && protoProps === @undefined)\n return base;\n } else if (isAnyArrayBuffer(value)) {\n const arrayType = isArrayBuffer(value) \? \"ArrayBuffer\" : \"SharedArrayBuffer\", prefix = getPrefix(constructor, tag, arrayType);\n if (typedArray === @undefined)\n formatter = formatArrayBuffer;\n else if (keys.length === 0 && protoProps === @undefined)\n return prefix + `{ byteLength: ${formatNumber(ctx.stylize, value.byteLength, !1)} }`;\n braces[0] = `${prefix}{`, ArrayPrototypeUnshift(keys, \"byteLength\");\n } else if (isDataView(value))\n braces[0] = `${getPrefix(constructor, tag, \"DataView\")}{`, ArrayPrototypeUnshift(keys, \"byteLength\", \"byteOffset\", \"buffer\");\n else if (isPromise(value))\n braces[0] = `${getPrefix(constructor, tag, \"Promise\")}{`, formatter = formatPromise;\n else if (isWeakSet(value))\n braces[0] = `${getPrefix(constructor, tag, \"WeakSet\")}{`, formatter = ctx.showHidden \? formatWeakSet : formatWeakCollection;\n else if (isWeakMap(value))\n braces[0] = `${getPrefix(constructor, tag, \"WeakMap\")}{`, formatter = ctx.showHidden \? formatWeakMap : formatWeakCollection;\n else if (isModuleNamespaceObject(value))\n braces[0] = `${getPrefix(constructor, tag, \"Module\")}{`, formatter = formatNamespaceObject.bind(null, keys);\n else if (isBoxedPrimitive(value)) {\n if (base = getBoxedBase(value, ctx, keys, constructor, tag), keys.length === 0 && protoProps === @undefined)\n return base;\n } else {\n if (keys.length === 0 && protoProps === @undefined) {\n if (isExternal(value))\n return ctx.stylize(\"[External: 0]\", \"special\");\n return `${getCtxStyle(value, constructor, tag)}{}`;\n }\n braces[0] = `${getCtxStyle(value, constructor, tag)}{`;\n }\n if (recurseTimes > ctx.depth && ctx.depth !== null) {\n let constructorName = StringPrototypeSlice(getCtxStyle(value, constructor, tag), 0, -1);\n if (constructor !== null)\n constructorName = `[${constructorName}]`;\n return ctx.stylize(constructorName, \"special\");\n }\n recurseTimes += 1, ctx.seen.push(value), ctx.currentDepth = recurseTimes;\n let output;\n const indentationLvl = ctx.indentationLvl;\n try {\n if (ctx.currentDepth > 1000)\n @throwRangeError(ERROR_STACK_OVERFLOW_MSG);\n output = formatter(ctx, value, recurseTimes);\n for (i = 0;i < keys.length; i++)\n ArrayPrototypePush(output, formatProperty(ctx, value, recurseTimes, keys[i], extrasType));\n if (protoProps !== @undefined)\n ArrayPrototypePushApply(output, protoProps);\n } catch (err) {\n if (err instanceof RangeError && err.message === ERROR_STACK_OVERFLOW_MSG) {\n const constructorName = StringPrototypeSlice(getCtxStyle(value, constructor, tag), 0, -1);\n return ctx.seen.pop(), ctx.indentationLvl = indentationLvl, ctx.stylize(`[${constructorName}: Inspection interrupted prematurely. Maximum call stack size exceeded.]`, \"special\");\n }\n throw new AssertionError(\"handleMaxCallStackSize assertion failed: \" + String(err), !0);\n }\n if (ctx.circular !== @undefined) {\n const index = ctx.circular.get(value);\n if (index !== @undefined)\n if (ctx.seenRefs \?\?= new Set, !ctx.seenRefs.has(index)) {\n ctx.seenRefs.add(index);\n const reference = ctx.stylize(`<ref *${index}>`, \"special\");\n if (ctx.compact !== !0)\n base = base === \"\" \? reference : `${reference} ${base}`;\n else\n braces[0] = `${reference} ${braces[0]}`;\n } else {\n //! this is a non-standard behavior compared to Node's implementation\n return ctx.stylize(`[Circular *${index}]`, \"special\");\n }\n }\n if (ctx.seen.pop(), ctx.sorted) {\n const comparator = ctx.sorted === !0 \? @undefined : ctx.sorted;\n if (extrasType === kObjectType)\n ArrayPrototypeSort(output, comparator);\n else if (keys.length > 1) {\n const sorted = ArrayPrototypeSort(ArrayPrototypeSlice(output, output.length - keys.length), comparator);\n ArrayPrototypeUnshift(sorted, output, output.length - keys.length, keys.length), ReflectApply(ArrayPrototypeSplice, null, sorted);\n }\n }\n const res = reduceToSingleString(ctx, output, base, braces, extrasType, recurseTimes, value), newLength = (ctx.budget[ctx.indentationLvl] || 0) + res.length;\n if (ctx.budget[ctx.indentationLvl] = newLength, newLength > 134217728)\n ctx.depth = -1;\n return res;\n}, getIteratorBraces = function(type, tag) {\n if (tag !== `${type} Iterator`) {\n if (tag !== \"\")\n tag += \"] [\";\n tag += `${type} Iterator`;\n }\n return [`[${tag}] {`, \"}\"];\n}, getBoxedBase = function(value, ctx, keys, constructor, tag) {\n let fn, type;\n if (isNumberObject(value))\n fn = NumberPrototypeValueOf, type = \"Number\";\n else if (isStringObject(value))\n fn = StringPrototypeValueOf, type = \"String\", keys.splice(0, value.length);\n else if (isBooleanObject(value))\n fn = BooleanPrototypeValueOf, type = \"Boolean\";\n else if (isBigIntObject(value))\n fn = BigIntPrototypeValueOf, type = \"BigInt\";\n else\n fn = SymbolPrototypeValueOf, type = \"Symbol\";\n let base = `[${type}`;\n if (type !== constructor)\n if (constructor === null)\n base += \" (null prototype)\";\n else\n base += ` (${constructor})`;\n if (base += `: ${formatPrimitive(stylizeNoColor, fn(value), ctx)}]`, tag !== \"\" && tag !== constructor)\n base += ` [${tag}]`;\n if (keys.length !== 0 || ctx.stylize === stylizeNoColor)\n return base;\n return ctx.stylize(base, StringPrototypeToLowerCase(type));\n}, getClassBase = function(value, constructor, tag) {\n let base = `class ${ObjectPrototypeHasOwnProperty(value, \"name\") && value.name || \"(anonymous)\"}`;\n if (constructor !== \"Function\" && constructor !== null)\n base += ` [${constructor}]`;\n if (tag !== \"\" && constructor !== tag)\n base += ` [${tag}]`;\n if (constructor !== null) {\n const superName = ObjectGetPrototypeOf(value).name;\n if (superName)\n base += ` extends ${superName}`;\n } else\n base += \" extends [null prototype]\";\n return `[${base}]`;\n}, getFunctionBase = function(value, constructor, tag) {\n const stringified = FunctionPrototypeToString(value);\n if (StringPrototypeStartsWith(stringified, \"class\") && StringPrototypeEndsWith(stringified, \"}\")) {\n const slice = StringPrototypeSlice(stringified, 5, -1), bracketIndex = StringPrototypeIndexOf(slice, \"{\");\n if (bracketIndex !== -1 && (!StringPrototypeIncludes(StringPrototypeSlice(slice, 0, bracketIndex), \"(\") || RegExpPrototypeExec(classRegExp, RegExpPrototypeSymbolReplace(stripCommentsRegExp, slice)) !== null))\n return getClassBase(value, constructor, tag);\n }\n let type = \"Function\";\n if (isGeneratorFunction(value))\n type = `Generator${type}`;\n if (isAsyncFunction(value))\n type = `Async${type}`;\n let base = `[${type}`;\n if (constructor === null)\n base += \" (null prototype)\";\n if (value.name === \"\")\n base += \" (anonymous)\";\n else\n base += `: ${value.name}`;\n if (base += \"]\", constructor !== type && constructor !== null)\n base += ` ${constructor}`;\n if (tag !== \"\" && constructor !== tag)\n base += ` [${tag}]`;\n return base;\n}, identicalSequenceRange = function(a, b) {\n for (let i = 0;i < a.length - 3; i++) {\n const pos = b.indexOf(a[i]);\n if (pos !== -1) {\n const rest = b.length - pos;\n if (rest > 3) {\n let len = 1;\n const maxLen = MathMin(a.length - i, rest);\n while (maxLen > len && a[i + len] === b[pos + len])\n len++;\n if (len > 3)\n return { len, offset: i };\n }\n }\n }\n return { len: 0, offset: 0 };\n}, getStackString = function(error) {\n return error.stack \? String(error.stack) : ErrorPrototypeToString(error);\n}, getStackFrames = function(ctx, err, stack) {\n const frames = StringPrototypeSplit(stack, \"\\n\");\n let cause;\n try {\n ({ cause } = err);\n } catch {\n }\n if (cause != null && cause instanceof Error) {\n const causeStack = getStackString(cause), causeStackStart = StringPrototypeIndexOf(causeStack, \"\\n at\");\n if (causeStackStart !== -1) {\n const causeFrames = StringPrototypeSplit(StringPrototypeSlice(causeStack, causeStackStart + 1), \"\\n\"), { len, offset } = identicalSequenceRange(frames, causeFrames);\n if (len > 0) {\n const skipped = len - 2, msg = ` ... ${skipped} lines matching cause stack trace ...`;\n frames.splice(offset + 1, skipped, ctx.stylize(msg, \"undefined\"));\n }\n }\n }\n return frames;\n}, improveStack = function(stack, constructor, name, tag) {\n let len = name.length;\n if (constructor === null || StringPrototypeEndsWith(name, \"Error\") && StringPrototypeStartsWith(stack, name) && (stack.length === len || stack[len] === \":\" || stack[len] === \"\\n\")) {\n let fallback = \"Error\";\n if (constructor === null) {\n const start = RegExpPrototypeExec(/^([A-Z][a-z_ A-Z0-9[\\]()-]+)(\?::|\\n {4}at)/, stack) || RegExpPrototypeExec(/^([a-z_A-Z0-9-]*Error)$/, stack);\n fallback = start && start[1] || \"\", len = fallback.length, fallback = fallback || \"Error\";\n }\n const prefix = StringPrototypeSlice(getPrefix(constructor, tag, fallback), 0, -1);\n if (name !== prefix)\n if (StringPrototypeIncludes(prefix, name))\n if (len === 0)\n stack = `${prefix}: ${stack}`;\n else\n stack = `${prefix}${StringPrototypeSlice(stack, len)}`;\n else\n stack = `${prefix} [${name}]${StringPrototypeSlice(stack, len)}`;\n }\n return stack;\n}, removeDuplicateErrorKeys = function(ctx, keys, err, stack) {\n if (!ctx.showHidden && keys.length !== 0)\n for (let name of [\"name\", \"message\", \"stack\"]) {\n const index = ArrayPrototypeIndexOf(keys, name);\n if (index !== -1 && StringPrototypeIncludes(stack, err[name]))\n ArrayPrototypeSplice(keys, index, 1);\n }\n}, markNodeModules = function(ctx, line) {\n let tempLine = \"\", nodeModule, pos = 0;\n while ((nodeModule = nodeModulesRegExp.exec(line)) !== null)\n tempLine += StringPrototypeSlice(line, pos, nodeModule.index + 14), tempLine += ctx.stylize(nodeModule[1], \"module\"), pos = nodeModule.index + nodeModule[0].length;\n if (pos !== 0)\n line = tempLine + StringPrototypeSlice(line, pos);\n return line;\n}, markCwd = function(ctx, line, workingDirectory) {\n let cwdStartPos = StringPrototypeIndexOf(line, workingDirectory), tempLine = \"\", cwdLength = workingDirectory.length;\n if (cwdStartPos !== -1) {\n if (StringPrototypeSlice(line, cwdStartPos - 7, cwdStartPos) === \"file://\")\n cwdLength += 7, cwdStartPos -= 7;\n const start = line[cwdStartPos - 1] === \"(\" \? cwdStartPos - 1 : cwdStartPos, end = start !== cwdStartPos && StringPrototypeEndsWith(line, \")\") \? -1 : line.length, workingDirectoryEndPos = cwdStartPos + cwdLength + 1, cwdSlice = StringPrototypeSlice(line, start, workingDirectoryEndPos);\n if (tempLine += StringPrototypeSlice(line, 0, start), tempLine += ctx.stylize(cwdSlice, \"undefined\"), tempLine += StringPrototypeSlice(line, workingDirectoryEndPos, end), end === -1)\n tempLine += ctx.stylize(\")\", \"undefined\");\n } else\n tempLine += line;\n return tempLine;\n}, safeGetCWD = function() {\n let workingDirectory;\n try {\n workingDirectory = process.cwd();\n } catch {\n return;\n }\n return workingDirectory;\n}, formatError = function(err, constructor, tag, ctx, keys) {\n const name = err.name != null \? String(err.name) : \"Error\";\n let stack = getStackString(err);\n //! temp fix for Bun losing the error name from inherited errors + extraneous \": \" with no message\n if (stack = stack.replace(/^Error: /, `${name}${err.message \? \": \" : \"\"}`), removeDuplicateErrorKeys(ctx, keys, err, stack), (\"cause\" in err) && (keys.length === 0 || !ArrayPrototypeIncludes(keys, \"cause\")))\n ArrayPrototypePush(keys, \"cause\");\n if (ArrayIsArray(err.errors) && (keys.length === 0 || !ArrayPrototypeIncludes(keys, \"errors\")))\n ArrayPrototypePush(keys, \"errors\");\n stack = improveStack(stack, constructor, name, tag);\n let pos = err.message && StringPrototypeIndexOf(stack, err.message) || -1;\n if (pos !== -1)\n pos += err.message.length;\n const stackStart = StringPrototypeIndexOf(stack, \"\\n at\", pos);\n if (stackStart === -1)\n stack = `[${stack}]`;\n else {\n let newStack = StringPrototypeSlice(stack, 0, stackStart);\n const stackFramePart = StringPrototypeSlice(stack, stackStart + 1), lines = getStackFrames(ctx, err, stackFramePart);\n if (ctx.colors) {\n const workingDirectory = safeGetCWD();\n let esmWorkingDirectory;\n for (let line of lines) {\n const core = RegExpPrototypeExec(coreModuleRegExp, line);\n if (core !== null && (StringPrototypeStartsWith(core[1], \"internal/\") || ArrayPrototypeIncludes(@requireNativeModule(\"module\").builtinModules, core[1])))\n newStack += `\\n${ctx.stylize(line, \"undefined\")}`;\n else {\n if (newStack += \"\\n\", line = markNodeModules(ctx, line), workingDirectory !== @undefined) {\n let newLine = markCwd(ctx, line, workingDirectory);\n if (newLine === line)\n esmWorkingDirectory \?\?= pathToFileURL(workingDirectory), newLine = markCwd(ctx, line, esmWorkingDirectory);\n line = newLine;\n }\n newStack += line;\n }\n }\n } else\n newStack += `\\n${ArrayPrototypeJoin(lines, \"\\n\")}`;\n stack = newStack;\n }\n if (ctx.indentationLvl !== 0) {\n const indentation = StringPrototypeRepeat(\" \", ctx.indentationLvl);\n stack = StringPrototypeReplaceAll(stack, \"\\n\", `\\n${indentation}`);\n }\n return stack;\n}, groupArrayElements = function(ctx, output, value) {\n let totalLength = 0, maxLength = 0, i = 0, outputLength = output.length;\n if (ctx.maxArrayLength < output.length)\n outputLength--;\n const separatorSpace = 2, dataLen = new Array(outputLength);\n for (;i < outputLength; i++) {\n const len = getStringWidth(output[i], ctx.colors);\n if (dataLen[i] = len, totalLength += len + separatorSpace, maxLength < len)\n maxLength = len;\n }\n const actualMax = maxLength + separatorSpace;\n if (actualMax * 3 + ctx.indentationLvl < ctx.breakLength && (totalLength / actualMax > 5 || maxLength <= 6)) {\n const averageBias = MathSqrt(actualMax - totalLength / output.length), biasedMax = MathMax(actualMax - 3 - averageBias, 1), columns = MathMin(MathRound(MathSqrt(2.5 * biasedMax * outputLength) / biasedMax), MathFloor((ctx.breakLength - ctx.indentationLvl) / actualMax), ctx.compact * 4, 15);\n if (columns <= 1)\n return output;\n const tmp = [], maxLineLength = [];\n for (let i2 = 0;i2 < columns; i2++) {\n let lineMaxLength = 0;\n for (let j = i2;j < output.length; j += columns)\n if (dataLen[j] > lineMaxLength)\n lineMaxLength = dataLen[j];\n lineMaxLength += separatorSpace, maxLineLength[i2] = lineMaxLength;\n }\n let order = StringPrototypePadStart;\n if (value !== @undefined) {\n for (let i2 = 0;i2 < output.length; i2++)\n if (typeof value[i2] !== \"number\" && typeof value[i2] !== \"bigint\") {\n order = StringPrototypePadEnd;\n break;\n }\n }\n for (let i2 = 0;i2 < outputLength; i2 += columns) {\n const max = MathMin(i2 + columns, outputLength);\n let str = \"\", j = i2;\n for (;j < max - 1; j++) {\n const padding = maxLineLength[j - i2] + output[j].length - dataLen[j];\n str += order(`${output[j]}, `, padding, \" \");\n }\n if (order === StringPrototypePadStart) {\n const padding = maxLineLength[j - i2] + output[j].length - dataLen[j] - separatorSpace;\n str += StringPrototypePadStart(output[j], padding, \" \");\n } else\n str += output[j];\n ArrayPrototypePush(tmp, str);\n }\n if (ctx.maxArrayLength < output.length)\n ArrayPrototypePush(tmp, output[outputLength]);\n output = tmp;\n }\n return output;\n}, addNumericSeparator = function(integerString) {\n let result = \"\", i = integerString.length;\n const start = StringPrototypeStartsWith(integerString, \"-\") \? 1 : 0;\n for (;i >= start + 4; i -= 3)\n result = `_${StringPrototypeSlice(integerString, i - 3, i)}${result}`;\n return i === integerString.length \? integerString : `${StringPrototypeSlice(integerString, 0, i)}${result}`;\n}, addNumericSeparatorEnd = function(integerString) {\n let result = \"\", i = 0;\n for (;i < integerString.length - 3; i += 3)\n result += `${StringPrototypeSlice(integerString, i, i + 3)}_`;\n return i === 0 \? integerString : `${result}${StringPrototypeSlice(integerString, i)}`;\n}, formatNumber = function(fn, number, numericSeparator) {\n if (!numericSeparator) {\n if (ObjectIs(number, -0))\n return fn(\"-0\", \"number\");\n return fn(`${number}`, \"number\");\n }\n const integer = MathTrunc(number), string = String(integer);\n if (integer === number) {\n if (!NumberIsFinite(number) || StringPrototypeIncludes(string, \"e\"))\n return fn(string, \"number\");\n return fn(`${addNumericSeparator(string)}`, \"number\");\n }\n if (NumberIsNaN(number))\n return fn(string, \"number\");\n return fn(`${addNumericSeparator(string)}.${addNumericSeparatorEnd(StringPrototypeSlice(String(number), string.length + 1))}`, \"number\");\n}, formatBigInt = function(fn, bigint, numericSeparator) {\n const string = String(bigint);\n if (!numericSeparator)\n return fn(`${string}n`, \"bigint\");\n return fn(`${addNumericSeparator(string)}n`, \"bigint\");\n}, formatPrimitive = function(fn, value, ctx) {\n if (typeof value === \"string\") {\n let trailer = \"\";\n if (value.length > ctx.maxStringLength) {\n const remaining = value.length - ctx.maxStringLength;\n value = StringPrototypeSlice(value, 0, ctx.maxStringLength), trailer = `... ${remaining} more character${remaining > 1 \? \"s\" : \"\"}`;\n }\n if (ctx.compact !== !0 && value.length > kMinLineLength && value.length > ctx.breakLength - ctx.indentationLvl - 4)\n return ArrayPrototypeJoin(ArrayPrototypeMap(extractedSplitNewLines(value), (line) => fn(strEscape(line), \"string\")), ` +\\n${StringPrototypeRepeat(\" \", ctx.indentationLvl + 2)}`) + trailer;\n return fn(strEscape(value), \"string\") + trailer;\n }\n if (typeof value === \"number\")\n return formatNumber(fn, value, ctx.numericSeparator);\n if (typeof value === \"bigint\")\n return formatBigInt(fn, value, ctx.numericSeparator);\n if (typeof value === \"boolean\")\n return fn(`${value}`, \"boolean\");\n if (typeof value === \"undefined\")\n return fn(\"undefined\", \"undefined\");\n return fn(SymbolPrototypeToString(value), \"symbol\");\n}, formatNamespaceObject = function(keys, ctx, value, recurseTimes) {\n const output = new Array(keys.length);\n for (let i = 0;i < keys.length; i++)\n try {\n output[i] = formatProperty(ctx, value, recurseTimes, keys[i], kObjectType);\n } catch (err) {\n assert(isNativeError(err) && err.name === \"ReferenceError\");\n const tmp = { [keys[i]]: \"\" };\n output[i] = formatProperty(ctx, tmp, recurseTimes, keys[i], kObjectType);\n const pos = StringPrototypeLastIndexOf(output[i], \" \");\n output[i] = StringPrototypeSlice(output[i], 0, pos + 1) + ctx.stylize(\"<uninitialized>\", \"special\");\n }\n return keys.length = 0, output;\n}, formatSpecialArray = function(ctx, value, recurseTimes, maxLength, output, i) {\n const keys = ObjectKeys(value);\n let index = i;\n for (;i < keys.length && output.length < maxLength; i++) {\n const key = keys[i], tmp = +key;\n if (tmp > 4294967294)\n break;\n if (`${index}` !== key) {\n if (RegExpPrototypeExec(numberRegExp, key) === null)\n break;\n const emptyItems = tmp - index, ending = emptyItems > 1 \? \"s\" : \"\", message = `<${emptyItems} empty item${ending}>`;\n if (ArrayPrototypePush(output, ctx.stylize(message, \"undefined\")), index = tmp, output.length === maxLength)\n break;\n }\n ArrayPrototypePush(output, formatProperty(ctx, value, recurseTimes, key, kArrayType)), index++;\n }\n const remaining = value.length - index;\n if (output.length !== maxLength) {\n if (remaining > 0) {\n const ending = remaining > 1 \? \"s\" : \"\", message = `<${remaining} empty item${ending}>`;\n ArrayPrototypePush(output, ctx.stylize(message, \"undefined\"));\n }\n } else if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return output;\n}, hexSlice = function(buf, start = 0, end) {\n return ArrayPrototypeJoin(ArrayPrototypeMap(buf.slice(start, end), (x) => (\"00\" + x.toString(16)).slice(-2)), \"\");\n}, formatArrayBuffer = function(ctx, value) {\n let buffer;\n try {\n buffer = new Uint8Array(value);\n } catch {\n return [ctx.stylize(\"(detached)\", \"special\")];\n }\n let str = StringPrototypeTrim(RegExpPrototypeSymbolReplace(/(.{2})/g, hexSlice(buffer, 0, MathMin(ctx.maxArrayLength, buffer.length)), \"$1 \"));\n const remaining = buffer.length - ctx.maxArrayLength;\n if (remaining > 0)\n str += ` ... ${remaining} more byte${remaining > 1 \? \"s\" : \"\"}`;\n return [`${ctx.stylize(\"[Uint8Contents]\", \"special\")}: <${str}>`];\n}, formatArray = function(ctx, value, recurseTimes) {\n const valLen = value.length, len = MathMin(MathMax(0, ctx.maxArrayLength), valLen), remaining = valLen - len, output = [];\n for (let i = 0;i < len; i++) {\n if (!ObjectPrototypeHasOwnProperty(value, i))\n return formatSpecialArray(ctx, value, recurseTimes, len, output, i);\n ArrayPrototypePush(output, formatProperty(ctx, value, recurseTimes, i, kArrayType));\n }\n if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return output;\n}, formatTypedArray = function(value, length, ctx, ignored, recurseTimes) {\n const maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length), remaining = value.length - maxLength, output = new Array(maxLength), elementFormatter = value.length > 0 && typeof value[0] === \"number\" \? formatNumber : formatBigInt;\n for (let i = 0;i < maxLength; ++i)\n output[i] = elementFormatter(ctx.stylize, value[i], ctx.numericSeparator);\n if (remaining > 0)\n output[maxLength] = remainingText(remaining);\n if (ctx.showHidden) {\n ctx.indentationLvl += 2;\n for (let key of [\"BYTES_PER_ELEMENT\", \"length\", \"byteLength\", \"byteOffset\", \"buffer\"]) {\n const str = formatValue(ctx, value[key], recurseTimes, !0);\n ArrayPrototypePush(output, `[${key}]: ${str}`);\n }\n ctx.indentationLvl -= 2;\n }\n return output;\n}, formatSet = function(value, ctx, ignored, recurseTimes) {\n const length = value.size, maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length), remaining = length - maxLength, output = [];\n ctx.indentationLvl += 2;\n let i = 0;\n for (let v of value) {\n if (i >= maxLength)\n break;\n ArrayPrototypePush(output, formatValue(ctx, v, recurseTimes)), i++;\n }\n if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return ctx.indentationLvl -= 2, output;\n}, formatMap = function(value, ctx, ignored, recurseTimes) {\n const length = value.size, maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length), remaining = length - maxLength, output = [];\n ctx.indentationLvl += 2;\n let i = 0;\n for (let { 0: k, 1: v } of value) {\n if (i >= maxLength)\n break;\n ArrayPrototypePush(output, `${formatValue(ctx, k, recurseTimes)} => ${formatValue(ctx, v, recurseTimes)}`), i++;\n }\n if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return ctx.indentationLvl -= 2, output;\n}, formatSetIterInner = function(ctx, recurseTimes, entries, state) {\n const maxArrayLength = MathMax(ctx.maxArrayLength, 0), maxLength = MathMin(maxArrayLength, entries.length), output = new Array(maxLength);\n ctx.indentationLvl += 2;\n for (let i = 0;i < maxLength; i++)\n output[i] = formatValue(ctx, entries[i], recurseTimes);\n if (ctx.indentationLvl -= 2, state === kWeak && !ctx.sorted)\n ArrayPrototypeSort(output);\n const remaining = entries.length - maxLength;\n if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return output;\n}, formatMapIterInner = function(ctx, recurseTimes, entries, state) {\n const maxArrayLength = MathMax(ctx.maxArrayLength, 0), len = entries.length / 2, remaining = len - maxArrayLength, maxLength = MathMin(maxArrayLength, len), output = new Array(maxLength);\n let i = 0;\n if (ctx.indentationLvl += 2, state === kWeak) {\n for (;i < maxLength; i++) {\n const pos = i * 2;\n output[i] = `${formatValue(ctx, entries[pos], recurseTimes)} => ${formatValue(ctx, entries[pos + 1], recurseTimes)}`;\n }\n if (!ctx.sorted)\n ArrayPrototypeSort(output);\n } else\n for (;i < maxLength; i++) {\n const pos = i * 2, res = [formatValue(ctx, entries[pos], recurseTimes), formatValue(ctx, entries[pos + 1], recurseTimes)];\n output[i] = reduceToSingleString(ctx, res, \"\", [\"[\", \"]\"], kArrayExtrasType, recurseTimes);\n }\n if (ctx.indentationLvl -= 2, remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return output;\n}, formatWeakCollection = function(ctx) {\n return [ctx.stylize(\"<items unknown>\", \"special\")];\n}, formatWeakSet = function(ctx, value, recurseTimes) {\n const entries = previewEntries(value);\n return formatSetIterInner(ctx, recurseTimes, entries, kWeak);\n}, formatWeakMap = function(ctx, value, recurseTimes) {\n const entries = previewEntries(value);\n return formatMapIterInner(ctx, recurseTimes, entries, kWeak);\n}, formatIterator = function(braces, ctx, value, recurseTimes) {\n const { 0: entries, 1: isKeyValue } = previewEntries(value, !0);\n if (isKeyValue)\n return braces[0] = RegExpPrototypeSymbolReplace(/ Iterator] {$/, braces[0], \" Entries] {\"), formatMapIterInner(ctx, recurseTimes, entries, kMapEntries);\n return formatSetIterInner(ctx, recurseTimes, entries, kIterator);\n}, formatPromise = function(ctx, value, recurseTimes) {\n let output;\n const { 0: state, 1: result } = getPromiseDetails(value);\n if (state === kPending)\n output = [ctx.stylize(\"<pending>\", \"special\")];\n else {\n ctx.indentationLvl += 2;\n const str = formatValue(ctx, result, recurseTimes);\n ctx.indentationLvl -= 2, output = [state === kRejected \? `${ctx.stylize(\"<rejected>\", \"special\")} ${str}` : str];\n }\n return output;\n}, formatProperty = function(ctx, value, recurseTimes, key, type, desc, original = value) {\n let name, str, extra = \" \";\n if (desc ||= ObjectGetOwnPropertyDescriptor(value, key) || { value: value[key], enumerable: !0 }, desc.value !== @undefined) {\n const diff = ctx.compact !== !0 || type !== kObjectType \? 2 : 3;\n if (ctx.indentationLvl += diff, str = formatValue(ctx, desc.value, recurseTimes), diff === 3 && ctx.breakLength < getStringWidth(str, ctx.colors))\n extra = `\\n${StringPrototypeRepeat(\" \", ctx.indentationLvl)}`;\n ctx.indentationLvl -= diff;\n } else if (desc.get !== @undefined) {\n const label = desc.set !== @undefined \? \"Getter/Setter\" : \"Getter\", s = ctx.stylize;\n if (ctx.getters && (ctx.getters === !0 || ctx.getters === \"get\" && desc.set === @undefined || ctx.getters === \"set\" && desc.set !== @undefined))\n try {\n const tmp = desc.get.@call(original);\n if (ctx.indentationLvl += 2, tmp === null)\n str = `${s(`[${label}:`, \"special\")} ${s(\"null\", \"null\")}${s(\"]\", \"special\")}`;\n else if (typeof tmp === \"object\")\n str = `${s(`[${label}]`, \"special\")} ${formatValue(ctx, tmp, recurseTimes)}`;\n else {\n const primitive = formatPrimitive(s, tmp, ctx);\n str = `${s(`[${label}:`, \"special\")} ${primitive}${s(\"]\", \"special\")}`;\n }\n ctx.indentationLvl -= 2;\n } catch (err) {\n const message = `<Inspection threw (${err.message})>`;\n str = `${s(`[${label}:`, \"special\")} ${message}${s(\"]\", \"special\")}`;\n }\n else\n str = ctx.stylize(`[${label}]`, \"special\");\n } else if (desc.set !== @undefined)\n str = ctx.stylize(\"[Setter]\", \"special\");\n else\n str = ctx.stylize(\"undefined\", \"undefined\");\n if (type === kArrayType)\n return str;\n if (typeof key === \"symbol\") {\n const tmp = RegExpPrototypeSymbolReplace(strEscapeSequencesReplacer, SymbolPrototypeToString(key), escapeFn);\n name = `[${ctx.stylize(tmp, \"symbol\")}]`;\n } else if (key === \"__proto__\")\n name = \"['__proto__']\";\n else if (desc.enumerable === !1)\n name = `[${RegExpPrototypeSymbolReplace(strEscapeSequencesReplacer, key, escapeFn)}]`;\n else if (RegExpPrototypeExec(keyStrRegExp, key) !== null)\n name = ctx.stylize(key, \"name\");\n else\n name = ctx.stylize(strEscape(key), \"string\");\n return `${name}:${extra}${str}`;\n}, isBelowBreakLength = function(ctx, output, start, base) {\n let totalLength = output.length + start;\n if (totalLength + output.length > ctx.breakLength)\n return !1;\n for (let i = 0;i < output.length; i++) {\n if (ctx.colors)\n totalLength += StringPrototypeReplaceAll(output[i], /\\u001B\\[\\d\\d\?m/g, \"\").length;\n else\n totalLength += output[i].length;\n if (totalLength > ctx.breakLength)\n return !1;\n }\n return base === \"\" || !StringPrototypeIncludes(base, \"\\n\");\n}, reduceToSingleString = function(ctx, output, base, braces, extrasType, recurseTimes, value) {\n if (ctx.compact !== !0) {\n if (typeof ctx.compact === \"number\" && ctx.compact >= 1) {\n const entries = output.length;\n if (extrasType === kArrayExtrasType && entries > 6)\n output = groupArrayElements(ctx, output, value);\n if (ctx.currentDepth - recurseTimes < ctx.compact && entries === output.length) {\n const start = output.length + ctx.indentationLvl + braces[0].length + base.length + 10;\n if (isBelowBreakLength(ctx, output, start, base)) {\n const joinedOutput = ArrayPrototypeJoin(output, \", \");\n if (!StringPrototypeIncludes(joinedOutput, \"\\n\"))\n return `${base \? `${base} ` : \"\"}${braces[0]} ${joinedOutput}` + ` ${braces[1]}`;\n }\n }\n }\n const indentation2 = `\\n${StringPrototypeRepeat(\" \", ctx.indentationLvl)}`;\n return `${base \? `${base} ` : \"\"}${braces[0]}${indentation2} ` + `${ArrayPrototypeJoin(output, `,${indentation2} `)}${indentation2}${braces[1]}`;\n }\n if (isBelowBreakLength(ctx, output, 0, base))\n return `${braces[0]}${base \? ` ${base}` : \"\"} ${ArrayPrototypeJoin(output, \", \")} ` + braces[1];\n const indentation = StringPrototypeRepeat(\" \", ctx.indentationLvl), ln = base === \"\" && braces[0].length === 1 \? \" \" : `${base \? ` ${base}` : \"\"}\\n${indentation} `;\n return `${braces[0]}${ln}${ArrayPrototypeJoin(output, `,\\n${indentation} `)} ${braces[1]}`;\n}, hasBuiltInToString = function(value) {\n const proxyTarget = getProxyDetails(value, !1);\n if (proxyTarget !== @undefined) {\n if (proxyTarget === null)\n return !0;\n value = proxyTarget;\n }\n if (typeof value.toString !== \"function\")\n return !0;\n if (ObjectPrototypeHasOwnProperty(value, \"toString\"))\n return !1;\n let pointer = value;\n do\n pointer = ObjectGetPrototypeOf(pointer);\n while (!ObjectPrototypeHasOwnProperty(pointer, \"toString\"));\n const descriptor = ObjectGetOwnPropertyDescriptor(pointer, \"constructor\");\n return descriptor !== @undefined && typeof descriptor.value === \"function\" && builtInObjects.has(descriptor.value.name);\n}, tryStringify = function(arg) {\n try {\n return JSONStringify(arg);\n } catch (err) {\n if (!CIRCULAR_ERROR_MESSAGE)\n try {\n const a = {};\n a.a = a, JSONStringify(a);\n } catch (circularError) {\n CIRCULAR_ERROR_MESSAGE = firstErrorLine(circularError);\n }\n if (err.name === \"TypeError\" && firstErrorLine(err) === CIRCULAR_ERROR_MESSAGE)\n return \"[Circular]\";\n throw err;\n }\n}, format = function(...args) {\n return formatWithOptionsInternal(@undefined, args);\n}, formatWithOptions = function(inspectOptions, ...args) {\n return validateObject(inspectOptions, \"inspectOptions\", { allowArray: !0 }), formatWithOptionsInternal(inspectOptions, args);\n}, formatNumberNoColor = function(number, options) {\n return formatNumber(stylizeNoColor, number, options\?.numericSeparator \?\? inspectDefaultOptions.numericSeparator);\n}, formatBigIntNoColor = function(bigint, options) {\n return formatBigInt(stylizeNoColor, bigint, options\?.numericSeparator \?\? inspectDefaultOptions.numericSeparator);\n}, formatWithOptionsInternal = function(inspectOptions, args) {\n const first = args[0];\n let a = 0, str = \"\", join = \"\";\n if (typeof first === \"string\") {\n if (args.length === 1)\n return first;\n let tempStr, lastPos = 0;\n for (let i = 0;i < first.length - 1; i++)\n if (StringPrototypeCharCodeAt(first, i) === 37) {\n const nextChar = StringPrototypeCharCodeAt(first, ++i);\n if (a + 1 !== args.length) {\n switch (nextChar) {\n case 115: {\n const tempArg = args[++a];\n if (typeof tempArg === \"number\")\n tempStr = formatNumberNoColor(tempArg, inspectOptions);\n else if (typeof tempArg === \"bigint\")\n tempStr = formatBigIntNoColor(tempArg, inspectOptions);\n else if (typeof tempArg !== \"object\" || tempArg === null || !hasBuiltInToString(tempArg))\n tempStr = String(tempArg);\n else\n tempStr = inspect(tempArg, {\n ...inspectOptions,\n compact: 3,\n colors: !1,\n depth: 0\n });\n break;\n }\n case 106:\n tempStr = tryStringify(args[++a]);\n break;\n case 100: {\n const tempNum = args[++a];\n if (typeof tempNum === \"bigint\")\n tempStr = formatBigIntNoColor(tempNum, inspectOptions);\n else if (typeof tempNum === \"symbol\")\n tempStr = \"NaN\";\n else\n tempStr = formatNumberNoColor(Number(tempNum), inspectOptions);\n break;\n }\n case 79:\n tempStr = inspect(args[++a], inspectOptions);\n break;\n case 111:\n tempStr = inspect(args[++a], {\n ...inspectOptions,\n showHidden: !0,\n showProxy: !0,\n depth: 4\n });\n break;\n case 105: {\n const tempInteger = args[++a];\n if (typeof tempInteger === \"bigint\")\n tempStr = formatBigIntNoColor(tempInteger, inspectOptions);\n else if (typeof tempInteger === \"symbol\")\n tempStr = \"NaN\";\n else\n tempStr = formatNumberNoColor(NumberParseInt(tempInteger), inspectOptions);\n break;\n }\n case 102: {\n const tempFloat = args[++a];\n if (typeof tempFloat === \"symbol\")\n tempStr = \"NaN\";\n else\n tempStr = formatNumberNoColor(NumberParseFloat(tempFloat), inspectOptions);\n break;\n }\n case 99:\n a += 1, tempStr = \"\";\n break;\n case 37:\n str += StringPrototypeSlice(first, lastPos, i), lastPos = i + 1;\n continue;\n default:\n continue;\n }\n if (lastPos !== i - 1)\n str += StringPrototypeSlice(first, lastPos, i - 1);\n str += tempStr, lastPos = i + 1;\n } else if (nextChar === 37)\n str += StringPrototypeSlice(first, lastPos, i), lastPos = i + 1;\n }\n if (lastPos !== 0) {\n if (a++, join = \" \", lastPos < first.length)\n str += StringPrototypeSlice(first, lastPos);\n }\n }\n while (a < args.length) {\n const value = args[a];\n str += join, str += typeof value !== \"string\" \? inspect(value, inspectOptions) : value, join = \" \", a++;\n }\n return str;\n}, isZeroWidthCodePoint = function(code) {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, stripVTControlCharacters = function(str) {\n if (typeof str !== \"string\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"str\", \"string\", str);\n return RegExpPrototypeSymbolReplace(ansi, str, \"\");\n}, getOwnNonIndexProperties = function(a, filter = 2) {\n const desc = ObjectGetOwnPropertyDescriptors(a), ret = [];\n for (let [k, v] of ObjectEntries(desc))\n if (!RegExpPrototypeTest(/^(0|[1-9][0-9]*)$/, k) || NumberParseInt(k, 10) >= 4294967295)\n if (filter === 2 && !v.enumerable)\n continue;\n else\n ArrayPrototypePush(ret, k);\n for (let s of ObjectGetOwnPropertySymbols(a)) {\n const v = ObjectGetOwnPropertyDescriptor(a, s);\n if (filter === 2 && !v.enumerable)\n continue;\n ArrayPrototypePush(ret, s);\n }\n return ret;\n}, getPromiseDetails = function(promise) {\n const state = @getPromiseInternalField(promise, @promiseFieldFlags) & @promiseStateMask;\n if (state !== @promiseStatePending)\n return [\n state === @promiseStateRejected \? kRejected : kFulfilled,\n @getPromiseInternalField(promise, @promiseFieldReactionsOrResult)\n ];\n return [kPending, @undefined];\n}, getProxyDetails = function(proxy, withHandler = !0) {\n if (!@isProxyObject(proxy))\n return @undefined;\n const handler = @getProxyInternalField(proxy, @proxyFieldHandler), target = handler === null \? null : @getProxyInternalField(proxy, @proxyFieldTarget);\n if (withHandler)\n return [target, handler];\n else\n return target;\n}, previewEntries = function(val, isIterator = !1) {\n if (isIterator) {\n const iteratedObject = @getInternalField(val, 1), kind = @getInternalField(val, 2), isEntries = kind === 2;\n if (@isMap(iteratedObject))\n if (isEntries)\n return [ArrayPrototypeFlat(ArrayFrom(iteratedObject)), !0];\n else if (kind === 1)\n return [ArrayFrom(MapPrototypeValues(iteratedObject)), !1];\n else\n return [ArrayFrom(MapPrototypeKeys(iteratedObject)), !1];\n else if (@isSet(iteratedObject))\n if (isEntries)\n return [ArrayPrototypeFlat(ArrayFrom(SetPrototypeEntries(iteratedObject))), !0];\n else\n return [ArrayFrom(iteratedObject), !1];\n else\n throw new Error(\"previewEntries(): Invalid iterator received\");\n }\n if (isWeakMap(val))\n return [];\n if (isWeakSet(val))\n return [];\n else\n throw new Error(\"previewEntries(): Invalid object received\");\n}, internalGetConstructorName = function(val) {\n if (!val || typeof val !== \"object\")\n throw new Error(\"Invalid object\");\n if (val.constructor\?.name)\n return val.constructor.name;\n const str = ObjectPrototypeToString(val), m = StringPrototypeMatch(str, /^\\[object ([^\\]]+)\\]/);\n return m \? m[1] : \"Object\";\n}, $, { pathToFileURL } = @getInternalField(@internalModuleRegistry, 47) || @createInternalModuleById(47), primordials = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), {\n Array,\n ArrayFrom,\n ArrayIsArray,\n ArrayPrototypeFilter,\n ArrayPrototypeFlat,\n ArrayPrototypeForEach,\n ArrayPrototypeIncludes,\n ArrayPrototypeIndexOf,\n ArrayPrototypeJoin,\n ArrayPrototypeMap,\n ArrayPrototypePop,\n ArrayPrototypePush,\n ArrayPrototypePushApply,\n ArrayPrototypeSlice,\n ArrayPrototypeSplice,\n ArrayPrototypeSort,\n ArrayPrototypeUnshift,\n BigIntPrototypeValueOf,\n BooleanPrototypeValueOf,\n DatePrototypeGetTime,\n DatePrototypeToISOString,\n DatePrototypeToString,\n ErrorCaptureStackTrace,\n ErrorPrototypeToString,\n FunctionPrototypeBind,\n FunctionPrototypeToString,\n JSONStringify,\n MapPrototypeGetSize,\n MapPrototypeEntries,\n MapPrototypeValues,\n MapPrototypeKeys,\n MathFloor,\n MathMax,\n MathMin,\n MathRound,\n MathSqrt,\n MathTrunc,\n Number,\n NumberIsFinite,\n NumberIsNaN,\n NumberParseFloat,\n NumberParseInt,\n NumberPrototypeToString,\n NumberPrototypeValueOf,\n Object,\n ObjectAssign,\n ObjectDefineProperty,\n ObjectEntries,\n ObjectGetOwnPropertyDescriptor,\n ObjectGetOwnPropertyDescriptors,\n ObjectGetOwnPropertyNames,\n ObjectGetOwnPropertySymbols,\n ObjectGetPrototypeOf,\n ObjectIs,\n ObjectKeys,\n ObjectPrototypeHasOwnProperty,\n ObjectPrototypePropertyIsEnumerable,\n ObjectPrototypeToString,\n ObjectSeal,\n ObjectSetPrototypeOf,\n ReflectApply,\n ReflectOwnKeys,\n RegExp,\n RegExpPrototypeExec,\n RegExpPrototypeSymbolReplace,\n RegExpPrototypeSymbolSplit,\n RegExpPrototypeTest,\n RegExpPrototypeToString,\n SafeStringIterator,\n SafeMap,\n SafeSet,\n SetPrototypeEntries,\n SetPrototypeGetSize,\n SetPrototypeValues,\n String,\n StringPrototypeCharCodeAt,\n StringPrototypeCodePointAt,\n StringPrototypeIncludes,\n StringPrototypeIndexOf,\n StringPrototypeLastIndexOf,\n StringPrototypeMatch,\n StringPrototypeNormalize,\n StringPrototypePadEnd,\n StringPrototypePadStart,\n StringPrototypeRepeat,\n StringPrototypeReplaceAll,\n StringPrototypeSlice,\n StringPrototypeSplit,\n StringPrototypeEndsWith,\n StringPrototypeStartsWith,\n StringPrototypeToLowerCase,\n StringPrototypeTrim,\n StringPrototypeValueOf,\n SymbolPrototypeToString,\n SymbolPrototypeValueOf,\n SymbolIterator,\n SymbolToStringTag,\n TypedArrayPrototypeGetLength,\n TypedArrayPrototypeGetSymbolToStringTag,\n Uint8Array\n} = primordials, customInspectSymbol = Symbol.for(\"nodejs.util.inspect.custom\"), kPending = Symbol(\"kPending\"), kFulfilled = Symbol(\"kFulfilled\"), kRejected = Symbol(\"kRejected\");\nvar isAsyncFunction = (v) => typeof v === \"function\" && StringPrototypeStartsWith(FunctionPrototypeToString(v), \"async\"), isGeneratorFunction = (v) => typeof v === \"function\" && StringPrototypeMatch(FunctionPrototypeToString(v), /^(async\\s+)\?function *\\*/), isBigIntObject = checkBox(BigInt), isSymbolObject = checkBox(Symbol), {\n isAnyArrayBuffer,\n isArrayBuffer,\n isArgumentsObject,\n isBoxedPrimitive: _native_isBoxedPrimitive,\n isDataView,\n isExternal,\n isMap,\n isMapIterator,\n isModuleNamespaceObject,\n isNativeError,\n isPromise,\n isSet,\n isSetIterator,\n isWeakMap,\n isWeakSet,\n isRegExp,\n isDate,\n isTypedArray,\n isStringObject,\n isNumberObject,\n isBooleanObject\n} = @requireNativeModule(\"util/types\");\n//! The native versions of the commented out functions are currently buggy, so we use the polyfills above for now.\n//! temp workaround to apply is{BigInt,Symbol}Object fix\nvar isBoxedPrimitive = (val) => isBigIntObject(val) || isSymbolObject(val) || _native_isBoxedPrimitive(val);\n\nclass AssertionError extends Error {\n constructor(message, isForced = !1) {\n super(message);\n this.name = \"AssertionError\", this.code = \"ERR_ASSERTION\", this.operator = \"==\", this.generatedMessage = !isForced, this.actual = isForced && @undefined, this.expected = !isForced || @undefined;\n }\n}\nvar codes = {};\n{\n const kTypes = [\n \"string\",\n \"function\",\n \"number\",\n \"object\",\n \"Function\",\n \"Object\",\n \"boolean\",\n \"bigint\",\n \"symbol\"\n ], classRegExp = /^([A-Z][a-z0-9]*)+$/, messages = new SafeMap;\n messages.set(\"ERR_INVALID_ARG_TYPE\", (name, expected, actual) => {\n if (assert(typeof name === \"string\", \"'name' must be a string\"), !ArrayIsArray(expected))\n expected = [expected];\n let msg = \"The \";\n if (StringPrototypeEndsWith(name, \" argument\"))\n msg += `${name} `;\n else\n msg += `\"${name}\" ${StringPrototypeIncludes(name, \".\") \? \"property\" : \"argument\"} `;\n msg += \"must be \";\n const types = [], instances = [], other = [];\n for (let value of expected)\n if (assert(typeof value === \"string\", \"All expected entries have to be of type string\"), ArrayPrototypeIncludes(kTypes, value))\n ArrayPrototypePush(types, StringPrototypeToLowerCase(value));\n else if (RegExpPrototypeTest(classRegExp, value))\n ArrayPrototypePush(instances, value);\n else\n assert(value !== \"object\", 'The value \"object\" should be written as \"Object\"'), ArrayPrototypePush(other, value);\n if (instances.length > 0) {\n const pos = ArrayPrototypeIndexOf(types, \"object\");\n if (pos !== -1)\n ArrayPrototypeSplice(types, pos, 1), ArrayPrototypePush(instances, \"Object\");\n }\n if (types.length > 0) {\n if (types.length > 2)\n msg += `one of type ${ArrayPrototypeJoin(types, \", \")}, or ${ArrayPrototypePop(types)}`;\n else if (types.length === 2)\n msg += `one of type ${types[0]} or ${types[1]}`;\n else\n msg += `of type ${types[0]}`;\n if (instances.length > 0 || other.length > 0)\n msg += \" or \";\n }\n if (instances.length > 0) {\n if (instances.length > 2)\n msg += `an instance of ${ArrayPrototypeJoin(instances, \", \")}, or ${ArrayPrototypePop(instances)}`;\n else\n msg += `an instance of ${instances[0]}` + (instances.length === 2 \? ` or ${instances[1]}` : \"\");\n if (other.length > 0)\n msg += \" or \";\n }\n if (other.length > 0)\n if (other.length > 2) {\n const last = ArrayPrototypePop(other);\n msg += `one of ${ArrayPrototypeJoin(other, \", \")}, or ${last}`;\n } else if (other.length === 2)\n msg += `one of ${other[0]} or ${other[1]}`;\n else {\n if (StringPrototypeToLowerCase(other[0]) !== other[0])\n msg += \"an \";\n msg += `${other[0]}`;\n }\n if (actual == null)\n msg += `. Received ${actual}`;\n else if (typeof actual === \"function\" && actual.name)\n msg += `. Received function ${actual.name}`;\n else if (typeof actual === \"object\")\n if (actual.constructor && actual.constructor.name)\n msg += `. Received an instance of ${actual.constructor.name}`;\n else\n msg += `. Received ${inspect(actual, { depth: -1 })}`;\n else {\n let inspected = inspect(actual, { colors: !1 });\n if (inspected.length > 25)\n inspected = `${StringPrototypeSlice(inspected, 0, 25)}...`;\n msg += `. Received type ${typeof actual} (${inspected})`;\n }\n return msg;\n }), codes[\"ERR_INVALID_ARG_TYPE\"] = function NodeError(...args) {\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n const error = @makeTypeError();\n Error.stackTraceLimit = limit;\n const msg = messages.get(\"ERR_INVALID_ARG_TYPE\");\n assert(typeof msg === \"function\"), assert(msg.length <= args.length, `Code: ERR_INVALID_ARG_TYPE; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`);\n const message = ReflectApply(msg, error, args);\n ObjectDefineProperty(error, \"message\", { value: message, enumerable: !1, writable: !0, configurable: !0 }), ObjectDefineProperty(error, \"toString\", {\n value() {\n return `${this.name} [ERR_INVALID_ARG_TYPE]: ${this.message}`;\n },\n enumerable: !1,\n writable: !0,\n configurable: !0\n });\n let err = error;\n const userStackTraceLimit = Error.stackTraceLimit;\n return Error.stackTraceLimit = @Infinity, ErrorCaptureStackTrace(err), Error.stackTraceLimit = userStackTraceLimit, err.name = `${TypeError.name} [ERR_INVALID_ARG_TYPE]`, err.stack, delete err.name, error.code = \"ERR_INVALID_ARG_TYPE\", error;\n };\n}\nvar validateObject = (value, name, allowArray = !1) => {\n if (value === null || !allowArray && ArrayIsArray(value) || typeof value !== \"object\" && typeof value !== \"function\")\n throw new codes.ERR_INVALID_ARG_TYPE(name, \"Object\", value);\n}, builtInObjects = new SafeSet(ArrayPrototypeFilter(ObjectGetOwnPropertyNames(globalThis), (e) => RegExpPrototypeExec(/^[A-Z][a-zA-Z0-9]+$/, e) !== null)), isUndetectableObject = (v) => typeof v === \"undefined\" && v !== @undefined, ERROR_STACK_OVERFLOW_MSG = \"Maximum call stack size exceeded.\", inspectDefaultOptions = ObjectSeal({\n showHidden: !1,\n depth: 2,\n colors: !1,\n customInspect: !0,\n showProxy: !1,\n maxArrayLength: 100,\n maxStringLength: 1e4,\n breakLength: 80,\n compact: 3,\n sorted: !1,\n getters: !1,\n numericSeparator: !1\n}), inspectReplDefaults = ObjectSeal({\n ...inspectDefaultOptions,\n colors: Bun.enableANSIColors,\n showProxy: !0\n}), kObjectType = 0, kArrayType = 1, kArrayExtrasType = 2, strEscapeSequencesRegExp, strEscapeSequencesReplacer, strEscapeSequencesRegExpSingle, strEscapeSequencesReplacerSingle, extractedSplitNewLines;\ntry {\n strEscapeSequencesRegExp = new RegExp(\"[\\\\x00-\\\\x1f\\\\x27\\\\x5c\\\\x7f-\\\\x9f]|[\\\\ud800-\\\\udbff](\?![\\\\udc00-\\\\udfff])|(\?<![\\\\ud800-\\\\udbff])[\\\\udc00-\\\\udfff]\"), strEscapeSequencesReplacer = new RegExp(\"[\\0-\\\\x1f\\\\x27\\\\x5c\\\\x7f-\\\\x9f]|[\\\\ud800-\\\\udbff](\?![\\\\udc00-\\\\udfff])|(\?<![\\\\ud800-\\\\udbff])[\\\\udc00-\\\\udfff]\", \"g\"), strEscapeSequencesRegExpSingle = new RegExp(\"[\\\\x00-\\\\x1f\\\\x5c\\\\x7f-\\\\x9f]|[\\\\ud800-\\\\udbff](\?![\\\\udc00-\\\\udfff])|(\?<![\\\\ud800-\\\\udbff])[\\\\udc00-\\\\udfff]\"), strEscapeSequencesReplacerSingle = new RegExp(\"[\\\\x00-\\\\x1f\\\\x5c\\\\x7f-\\\\x9f]|[\\\\ud800-\\\\udbff](\?![\\\\udc00-\\\\udfff])|(\?<![\\\\ud800-\\\\udbff])[\\\\udc00-\\\\udfff]\", \"g\");\n const extractedNewLineRe = new RegExp(\"(\?<=\\\\n)\");\n extractedSplitNewLines = (value) => RegExpPrototypeSymbolSplit(extractedNewLineRe, value);\n} catch {\n strEscapeSequencesRegExp = /[\\x00-\\x1f\\x27\\x5c\\x7f-\\x9f]/, strEscapeSequencesReplacer = /[\\x00-\\x1f\\x27\\x5c\\x7f-\\x9f]/g, strEscapeSequencesRegExpSingle = /[\\x00-\\x1f\\x5c\\x7f-\\x9f]/, strEscapeSequencesReplacerSingle = /[\\x00-\\x1f\\x5c\\x7f-\\x9f]/g, extractedSplitNewLines = (value) => {\n const lines = RegExpPrototypeSymbolSplit(/\\n/, value), last = ArrayPrototypePop(lines), nlLines = ArrayPrototypeMap(lines, (line) => line + \"\\n\");\n if (last !== \"\")\n nlLines.push(last);\n return nlLines;\n };\n}\nvar keyStrRegExp = /^[a-zA-Z_][a-zA-Z_0-9]*$/, numberRegExp = /^(0|[1-9][0-9]*)$/, coreModuleRegExp = /^ {4}at (\?:[^/\\\\(]+ \\(|)node:(.+):\\d+:\\d+\\)\?$/, nodeModulesRegExp = /[/\\\\]node_modules[/\\\\](.+\?)(\?=[/\\\\])/g, classRegExp = /^(\\s+[^(]*\?)\\s*{/, stripCommentsRegExp = /(\\/\\/.*\?\\n)|(\\/\\*(.|\\n)*\?\\*\\/)/g, kMinLineLength = 16, kWeak = 0, kIterator = 1, kMapEntries = 2, meta = [\n \"\\\\x00\",\n \"\\\\x01\",\n \"\\\\x02\",\n \"\\\\x03\",\n \"\\\\x04\",\n \"\\\\x05\",\n \"\\\\x06\",\n \"\\\\x07\",\n \"\\\\b\",\n \"\\\\t\",\n \"\\\\n\",\n \"\\\\x0B\",\n \"\\\\f\",\n \"\\\\r\",\n \"\\\\x0E\",\n \"\\\\x0F\",\n \"\\\\x10\",\n \"\\\\x11\",\n \"\\\\x12\",\n \"\\\\x13\",\n \"\\\\x14\",\n \"\\\\x15\",\n \"\\\\x16\",\n \"\\\\x17\",\n \"\\\\x18\",\n \"\\\\x19\",\n \"\\\\x1A\",\n \"\\\\x1B\",\n \"\\\\x1C\",\n \"\\\\x1D\",\n \"\\\\x1E\",\n \"\\\\x1F\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\\\\'\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\\\\\\\\\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\\\\x7F\",\n \"\\\\x80\",\n \"\\\\x81\",\n \"\\\\x82\",\n \"\\\\x83\",\n \"\\\\x84\",\n \"\\\\x85\",\n \"\\\\x86\",\n \"\\\\x87\",\n \"\\\\x88\",\n \"\\\\x89\",\n \"\\\\x8A\",\n \"\\\\x8B\",\n \"\\\\x8C\",\n \"\\\\x8D\",\n \"\\\\x8E\",\n \"\\\\x8F\",\n \"\\\\x90\",\n \"\\\\x91\",\n \"\\\\x92\",\n \"\\\\x93\",\n \"\\\\x94\",\n \"\\\\x95\",\n \"\\\\x96\",\n \"\\\\x97\",\n \"\\\\x98\",\n \"\\\\x99\",\n \"\\\\x9A\",\n \"\\\\x9B\",\n \"\\\\x9C\",\n \"\\\\x9D\",\n \"\\\\x9E\",\n \"\\\\x9F\"\n], getStringWidth;\ninspect.custom = customInspectSymbol;\nObjectDefineProperty(inspect, \"defaultOptions\", {\n __proto__: null,\n get() {\n return inspectDefaultOptions;\n },\n set(options) {\n return validateObject(options, \"options\"), ObjectAssign(inspectDefaultOptions, options);\n }\n});\nObjectDefineProperty(inspect, \"replDefaults\", {\n __proto__: null,\n get() {\n return inspectReplDefaults;\n },\n set(options) {\n return validateObject(options, \"options\"), ObjectAssign(inspectReplDefaults, options);\n }\n});\nvar defaultFG = 39, defaultBG = 49;\ninspect.colors = {\n __proto__: null,\n reset: [0, 0],\n bold: [1, 22],\n dim: [2, 22],\n italic: [3, 23],\n underline: [4, 24],\n blink: [5, 25],\n inverse: [7, 27],\n hidden: [8, 28],\n strikethrough: [9, 29],\n doubleunderline: [21, 24],\n black: [30, defaultFG],\n red: [31, defaultFG],\n green: [32, defaultFG],\n yellow: [33, defaultFG],\n blue: [34, defaultFG],\n magenta: [35, defaultFG],\n cyan: [36, defaultFG],\n white: [37, defaultFG],\n bgBlack: [40, defaultBG],\n bgRed: [41, defaultBG],\n bgGreen: [42, defaultBG],\n bgYellow: [43, defaultBG],\n bgBlue: [44, defaultBG],\n bgMagenta: [45, defaultBG],\n bgCyan: [46, defaultBG],\n bgWhite: [47, defaultBG],\n framed: [51, 54],\n overlined: [53, 55],\n gray: [90, defaultFG],\n redBright: [91, defaultFG],\n greenBright: [92, defaultFG],\n yellowBright: [93, defaultFG],\n blueBright: [94, defaultFG],\n magentaBright: [95, defaultFG],\n cyanBright: [96, defaultFG],\n whiteBright: [97, defaultFG],\n bgGray: [100, defaultBG],\n bgRedBright: [101, defaultBG],\n bgGreenBright: [102, defaultBG],\n bgYellowBright: [103, defaultBG],\n bgBlueBright: [104, defaultBG],\n bgMagentaBright: [105, defaultBG],\n bgCyanBright: [106, defaultBG],\n bgWhiteBright: [107, defaultBG]\n};\ndefineColorAlias(\"gray\", \"grey\");\ndefineColorAlias(\"gray\", \"blackBright\");\ndefineColorAlias(\"bgGray\", \"bgGrey\");\ndefineColorAlias(\"bgGray\", \"bgBlackBright\");\ndefineColorAlias(\"dim\", \"faint\");\ndefineColorAlias(\"strikethrough\", \"crossedout\");\ndefineColorAlias(\"strikethrough\", \"strikeThrough\");\ndefineColorAlias(\"strikethrough\", \"crossedOut\");\ndefineColorAlias(\"hidden\", \"conceal\");\ndefineColorAlias(\"inverse\", \"swapColors\");\ndefineColorAlias(\"inverse\", \"swapcolors\");\ndefineColorAlias(\"doubleunderline\", \"doubleUnderline\");\ninspect.styles = {\n __proto__: null,\n special: \"cyan\",\n number: \"yellow\",\n bigint: \"yellow\",\n boolean: \"yellow\",\n undefined: \"grey\",\n null: \"bold\",\n string: \"green\",\n symbol: \"green\",\n date: \"magenta\",\n regexp: \"red\",\n module: \"underline\"\n};\nvar remainingText = (remaining) => `... ${remaining} more item${remaining > 1 \? \"s\" : \"\"}`, firstErrorLine = (error) => StringPrototypeSplit(error.message, \"\\n\", 1)[0], CIRCULAR_ERROR_MESSAGE;\n{\n getStringWidth = function getStringWidth(str, removeControlChars = !0) {\n let width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize(str, \"NFC\");\n for (let char of new SafeStringIterator(str)) {\n const code = StringPrototypeCodePointAt(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n };\n const isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n };\n}\nvar ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new RegExp(ansiPattern, \"g\");\n$ = {\n inspect,\n format,\n formatWithOptions,\n stripVTControlCharacters\n};\n//! non-standard properties, should these be kept\? (not currently exposed)\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeAssertStrictCode = "(function (){\"use strict\";// src/js/out/tmp/node/assert.strict.ts\nreturn (@getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6)).strict})\n"_s;
+static constexpr ASCIILiteral NodeAssertCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/assert.ts\nvar CallTracker = function() {\n throw new Error(\"CallTracker is not supported yet\");\n}, util = @getInternalField(@internalModuleRegistry, 48) || @createInternalModuleById(48), isDeepEqual = Bun.deepEquals, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_errors = __commonJS({\n \"assert/build/internal/errors.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n var codes = {}, assert, util2;\n function createErrorType(code, message, Base) {\n Base || (Base = Error);\n function getMessage(arg1, arg2, arg3) {\n return typeof message == \"string\" \? message : message(arg1, arg2, arg3);\n }\n var NodeError = function(_Base) {\n _inherits(NodeError2, _Base);\n function NodeError2(arg1, arg2, arg3) {\n var _this;\n return _classCallCheck(this, NodeError2), _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError2).@call(this, getMessage(arg1, arg2, arg3))), _this.code = code, _this;\n }\n return NodeError2;\n }(Base);\n codes[code] = NodeError;\n }\n function oneOf(expected, thing) {\n if (@Array.isArray(expected)) {\n var len = expected.length;\n return expected = expected.map(function(i) {\n return @String(i);\n }), len > 2 \? \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1] : len === 2 \? \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]) : \"of \".concat(thing, \" \").concat(expected[0]);\n } else\n return \"of \".concat(thing, \" \").concat(@String(expected));\n }\n function startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 \? 0 : +pos, search.length) === search;\n }\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function includes(str, search, start) {\n return typeof start != \"number\" && (start = 0), start + search.length > str.length \? !1 : str.indexOf(search, start) !== -1;\n }\n createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError), createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n assert === void 0 && (assert = require_assert()), assert(typeof name == \"string\", \"'name' must be a string\");\n var determiner;\n typeof expected == \"string\" && startsWith(expected, \"not \") \? (determiner = \"must not be\", expected = expected.replace(/^not /, \"\")) : determiner = \"must be\";\n var msg;\n if (endsWith(name, \" argument\"))\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n else {\n var type = includes(name, \".\") \? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n }\n return msg += \". Received type \".concat(_typeof(actual)), msg;\n }, TypeError), createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== void 0 \? arguments[2] : \"is invalid\", inspected = util2.inspect(value);\n return inspected.length > 128 && (inspected = \"\".concat(inspected.slice(0, 128), \"...\")), \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n }, TypeError, RangeError), createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n return value && value.constructor && value.constructor.name \? type = \"instance of \".concat(value.constructor.name) : type = \"type \".concat(_typeof(value)), \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n }, TypeError), createErrorType(\"ERR_MISSING_ARGS\", function() {\n for (var _len = arguments.length, args = new @Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n assert === void 0 && (assert = require_assert()), assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \", len = args.length;\n switch (args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n }), len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \"), msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n }, TypeError), module2.exports.codes = codes;\n }\n}), require_assertion_error = __commonJS({\n \"assert/build/internal/assert/assertion_error.js\"(exports, module2) {\n function _objectSpread(target) {\n for (var i = 1;i < arguments.length; i++) {\n var source = arguments[i] != null \? arguments[i] : {}, ownKeys = Object.keys(source);\n typeof Object.getOwnPropertySymbols == \"function\" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }))), ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n }\n function _defineProperty(obj, key, value) {\n return (key in obj) \? Object.defineProperty(obj, key, {\n value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : obj[key] = value, obj;\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _defineProperties(target, props) {\n for (var i = 0;i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, (\"value\" in descriptor) && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map == \"function\" \? new Map : void 0;\n return _wrapNativeSuper = function(Class2) {\n if (Class2 === null || !_isNativeFunction(Class2))\n return Class2;\n if (typeof Class2 != \"function\")\n @throwTypeError(\"Super expression must either be null or a function\");\n if (typeof _cache != \"undefined\") {\n if (_cache.has(Class2))\n return _cache.get(Class2);\n _cache.set(Class2, Wrapper);\n }\n function Wrapper() {\n return _construct(Class2, arguments, _getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(Class2.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), _setPrototypeOf(Wrapper, Class2);\n }, _wrapNativeSuper(Class);\n }\n function isNativeReflectConstruct() {\n if (typeof Reflect == \"undefined\" || !Reflect.construct || Reflect.construct.sham)\n return !1;\n if (typeof Proxy == \"function\")\n return !0;\n try {\n return Date.prototype.toString.@call(Reflect.construct(Date, [], function() {\n })), !0;\n } catch {\n return !1;\n }\n }\n function _construct(Parent, args, Class) {\n return isNativeReflectConstruct() \? _construct = Reflect.construct : _construct = function(Parent2, args2, Class2) {\n var a = [null];\n a.push.@apply(a, args2);\n var Constructor = Function.bind.@apply(Parent2, a), instance = new Constructor;\n return Class2 && _setPrototypeOf(instance, Class2.prototype), instance;\n }, _construct.@apply(null, arguments);\n }\n function _isNativeFunction(fn) {\n return Function.toString.@call(fn).indexOf(\"[native code]\") !== -1;\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n var inspect = util.inspect, _require2 = require_errors(), ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function repeat(str, count) {\n if (count = Math.floor(count), str.length == 0 || count == 0)\n return \"\";\n var maxCount = str.length * count;\n for (count = Math.floor(Math.log(count) / Math.log(2));count; )\n str += str, count--;\n return str += str.substring(0, maxCount - str.length), str;\n }\n var blue = \"\", green = \"\", red = \"\", white = \"\", kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n }, kMaxShortLength = 10;\n function copyError(source) {\n var keys = Object.keys(source), target = Object.create(Object.getPrototypeOf(source));\n return keys.forEach(function(key) {\n target[key] = source[key];\n }), Object.defineProperty(target, \"message\", {\n value: source.message\n }), target;\n }\n function inspectValue(val) {\n return inspect(val, {\n compact: !1,\n customInspect: !1,\n depth: 1000,\n maxArrayLength: Infinity,\n showHidden: !1,\n breakLength: Infinity,\n showProxy: !1,\n sorted: !0,\n getters: !0\n });\n }\n function createErrDiff(actual, expected, operator) {\n var other = \"\", res = \"\", lastPos = 0, end = \"\", skipped = !1, actualInspected = inspectValue(actual), actualLines = actualInspected.split(`\n`), expectedLines = inspectValue(expected).split(`\n`), i = 0, indicator = \"\";\n if (operator === \"strictEqual\" && _typeof(actual) === \"object\" && _typeof(expected) === \"object\" && actual !== null && expected !== null && (operator = \"strictEqualObject\"), actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== \"object\" || actual === null) && (_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0))\n return \"\".concat(kReadableOperator[operator], `\n\n`) + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], `\n`);\n } else if (operator !== \"strictEqualObject\") {\n var maxLength = process.stderr && process.stderr.isTTY \? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n for (;actualLines[0][i] === expectedLines[0][i]; )\n i++;\n i > 2 && (indicator = `\n `.concat(repeat(\" \", i), \"^\"), i = 0);\n }\n }\n }\n for (var a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];a === b && (i++ < 2 \? end = `\n `.concat(a).concat(end) : other = a, actualLines.pop(), expectedLines.pop(), !(actualLines.length === 0 || expectedLines.length === 0)); )\n a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n if (maxLines === 0) {\n var _actualLines = actualInspected.split(`\n`);\n if (_actualLines.length > 30)\n for (_actualLines[26] = \"\".concat(blue, \"...\").concat(white);_actualLines.length > 27; )\n _actualLines.pop();\n return \"\".concat(kReadableOperator.notIdentical, `\n\n`).concat(_actualLines.join(`\n`), `\n`);\n }\n i > 3 && (end = `\n`.concat(blue, \"...\").concat(white).concat(end), skipped = !0), other !== \"\" && (end = `\n `.concat(other).concat(end), other = \"\");\n var printedLines = 0, msg = kReadableOperator[operator] + `\n`.concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white), skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0;i < maxLines; i++) {\n var cur = i - lastPos;\n if (actualLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(expectedLines[i - 2]), printedLines++), res += `\n `.concat(expectedLines[i - 1]), printedLines++), lastPos = i, other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]), printedLines++;\n else if (expectedLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLines[i]), printedLines++;\n else {\n var expectedLine = expectedLines[i], actualLine = actualLines[i], divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n divergingLines && endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine && (divergingLines = !1, actualLine += \",\"), divergingLines \? (cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLine), other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLine), printedLines += 2) : (res += other, other = \"\", (cur === 1 || i === 0) && (res += `\n `.concat(actualLine), printedLines++));\n }\n if (printedLines > 20 && i < maxLines - 2)\n return \"\".concat(msg).concat(skippedMsg, `\n`).concat(res, `\n`).concat(blue, \"...\").concat(white).concat(other, `\n`) + \"\".concat(blue, \"...\").concat(white);\n }\n return \"\".concat(msg).concat(skipped \? skippedMsg : \"\", `\n`).concat(res).concat(other).concat(end).concat(indicator);\n }\n var AssertionError = function(_Error) {\n function AssertionError2(options) {\n var _this;\n if (_classCallCheck(this, AssertionError2), _typeof(options) !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var { message, operator, stackStartFn, actual, expected } = options, limit = Error.stackTraceLimit;\n if (Error.stackTraceLimit = 0, message != null)\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, @String(message)));\n else if (process.stderr && process.stderr.isTTY && (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1 \? (blue = \"\", green = \"\", white = \"\", red = \"\") : (blue = \"\", green = \"\", white = \"\", red = \"\")), _typeof(actual) === \"object\" && actual !== null && _typeof(expected) === \"object\" && expected !== null && (\"stack\" in actual) && actual instanceof Error && (\"stack\" in expected) && expected instanceof Error && (actual = copyError(actual), expected = copyError(expected)), operator === \"deepStrictEqual\" || operator === \"strictEqual\")\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, createErrDiff(actual, expected, operator)));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n var base = kReadableOperator[operator], res = inspectValue(actual).split(`\n`);\n if (operator === \"notStrictEqual\" && _typeof(actual) === \"object\" && actual !== null && (base = kReadableOperator.notStrictEqualObject), res.length > 30)\n for (res[26] = \"\".concat(blue, \"...\").concat(white);res.length > 27; )\n res.pop();\n res.length === 1 \? _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, \"\".concat(base, \" \").concat(res[0]))) : _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, \"\".concat(base, `\n\n`).concat(res.join(`\n`), `\n`)));\n } else {\n var _res = inspectValue(actual), other = \"\", knownOperators = kReadableOperator[operator];\n operator === \"notDeepEqual\" || operator === \"notEqual\" \? (_res = \"\".concat(kReadableOperator[operator], `\n\n`).concat(_res), _res.length > 1024 && (_res = \"\".concat(_res.slice(0, 1021), \"...\"))) : (other = \"\".concat(inspectValue(expected)), _res.length > 512 && (_res = \"\".concat(_res.slice(0, 509), \"...\")), other.length > 512 && (other = \"\".concat(other.slice(0, 509), \"...\")), operator === \"deepEqual\" || operator === \"equal\" \? _res = \"\".concat(knownOperators, `\n\n`).concat(_res, `\n\nshould equal\n\n`) : other = \" \".concat(operator, \" \").concat(other)), _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, \"\".concat(_res).concat(other)));\n }\n return Error.stackTraceLimit = limit, _this.generatedMessage = !message, Object.defineProperty(_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: !1,\n writable: !0,\n configurable: !0\n }), _this.code = \"ERR_ASSERTION\", _this.actual = actual, _this.expected = expected, _this.operator = operator, Error.captureStackTrace && Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn), _this.stack, _this.name = \"AssertionError\", _possibleConstructorReturn(_this);\n }\n return AssertionError2.prototype = {}, _inherits(AssertionError2, _Error), _createClass(AssertionError2, [\n {\n key: \"toString\",\n value: function() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: inspect.custom,\n value: function(recurseTimes, ctx) {\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: !1,\n depth: 0\n }));\n }\n }\n ]), AssertionError2;\n }(_wrapNativeSuper(Error));\n module2.exports = AssertionError;\n }\n}), require_assert = __commonJS({\n \"assert/build/assert.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n var _require = require_errors(), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, AssertionError = require_assertion_error(), _require2 = util, inspect = _require2.inspect, _require$types = util.types, isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp, objectAssign = Object.assign, objectIs = Object.is, errorCache = new Map, warned = !1, assert = module2.exports = ok, NO_EXCEPTION_SENTINEL = {};\n function innerFail(obj) {\n throw obj.message instanceof Error \? obj.message : new AssertionError(obj);\n }\n function fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length, internalMessage;\n if (argsLen === 0)\n internalMessage = \"Failed\";\n else if (argsLen === 1)\n message = actual, actual = void 0;\n else {\n if (warned === !1) {\n warned = !0;\n var warn = process.emitWarning \? process.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n argsLen === 2 && (operator = \"!=\");\n }\n if (message instanceof Error)\n throw message;\n var errArgs = {\n actual,\n expected,\n operator: operator === void 0 \? \"fail\" : operator,\n stackStartFn: stackStartFn || fail\n };\n message !== void 0 && (errArgs.message = message);\n var err = new AssertionError(errArgs);\n throw internalMessage && (err.message = internalMessage, err.generatedMessage = !0), err;\n }\n assert.fail = fail, assert.AssertionError = AssertionError;\n function innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = !1;\n if (argLen === 0)\n generatedMessage = !0, message = \"No value argument passed to `assert.ok()`\";\n else if (message instanceof Error)\n throw message;\n var err = new AssertionError({\n actual: value,\n expected: !0,\n message,\n operator: \"==\",\n stackStartFn: fn\n });\n throw err.generatedMessage = generatedMessage, err;\n }\n }\n function ok() {\n for (var _len = arguments.length, args = new @Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n innerOk.@apply(void 0, [ok, args.length].concat(args));\n }\n assert.ok = ok, assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual != expected && innerFail({\n actual,\n expected,\n message,\n operator: \"==\",\n stackStartFn: equal\n });\n }, assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual == expected && innerFail({\n actual,\n expected,\n message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n }, assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n }, assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n }, assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n }, assert.notDeepStrictEqual = notDeepStrictEqual;\n function notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: notDeepStrictEqual\n });\n }\n assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) || innerFail({\n actual,\n expected,\n message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n }, assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) && innerFail({\n actual,\n expected,\n message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n }, assert.match = function match(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!isRegExp(expected))\n throw new ERR_INVALID_ARG_TYPE(\"expected\", \"RegExp\", expected);\n expected.test(actual) || innerFail({\n actual,\n expected,\n message,\n operator: \"match\",\n stackStartFn: match\n });\n };\n var Comparison = function Comparison2(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison2), keys.forEach(function(key) {\n (key in obj) && (actual !== void 0 && typeof actual[key] == \"string\" && isRegExp(obj[key]) && obj[key].test(actual[key]) \? _this[key] = actual[key] : _this[key] = obj[key]);\n });\n };\n function compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepEqual(actual[key], expected[key], !0)) {\n if (!message) {\n var a = new Comparison(actual, keys), b = new Comparison(expected, keys, actual), err = new AssertionError({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.actual = actual, err.expected = expected, err.operator = fn.name, err;\n }\n innerFail({\n actual,\n expected,\n message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n }\n function expectedException(actual, expected, msg, fn) {\n if (typeof expected != \"function\") {\n if (isRegExp(expected))\n return expected.test(actual);\n if (arguments.length === 2)\n throw new ERR_INVALID_ARG_TYPE(\"expected\", [\"Function\", \"RegExp\"], expected);\n if (_typeof(actual) !== \"object\" || actual === null) {\n var err = new AssertionError({\n actual,\n expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.operator = fn.name, err;\n }\n var keys = Object.keys(expected);\n if (expected instanceof Error)\n keys.push(\"name\", \"message\");\n else if (keys.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n return keys.forEach(function(key) {\n return typeof actual[key] == \"string\" && isRegExp(expected[key]) && expected[key].test(actual[key]) || compareExceptionKey(actual, expected, key, msg, keys, fn);\n }), !0;\n }\n return expected.prototype !== void 0 && actual instanceof expected \? !0 : Error.isPrototypeOf(expected) \? !1 : expected.@call({}, actual) === !0;\n }\n function getActual(fn) {\n if (typeof fn != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n }\n function checkIsPromise(obj) {\n return isPromise(obj) || obj !== null && _typeof(obj) === \"object\" && typeof obj.then == \"function\" && typeof obj.catch == \"function\";\n }\n function waitForActual(promiseFn) {\n return @Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn == \"function\") {\n if (resultPromise = promiseFn(), !checkIsPromise(resultPromise))\n throw new ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if (checkIsPromise(promiseFn))\n resultPromise = promiseFn;\n else\n throw new ERR_INVALID_ARG_TYPE(\"promiseFn\", [\"Function\", \"Promise\"], promiseFn);\n return @Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n }\n function expectsError(stackStartFn, actual, error, message) {\n if (typeof error == \"string\") {\n if (arguments.length === 4)\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error, error = void 0;\n } else if (error != null && _typeof(error) !== \"object\" && typeof error != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n error && error.name && (details += \" (\".concat(error.name, \")\")), details += message \? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" \? \"rejection\" : \"exception\";\n innerFail({\n actual: void 0,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn))\n throw actual;\n }\n function expectsNoError(stackStartFn, actual, error, message) {\n if (actual !== NO_EXCEPTION_SENTINEL) {\n if (typeof error == \"string\" && (message = error, error = void 0), !error || expectedException(actual, error)) {\n var details = message \? \": \".concat(message) : \".\", fnType = stackStartFn.name === \"doesNotReject\" \? \"rejection\" : \"exception\";\n innerFail({\n actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, `\n`) + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn\n });\n }\n throw actual;\n }\n }\n assert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new @Array(_len2 > 1 \? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++)\n args[_key2 - 1] = arguments[_key2];\n expectsError.@apply(void 0, [throws, getActual(promiseFn)].concat(args));\n }, assert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new @Array(_len3 > 1 \? _len3 - 1 : 0), _key3 = 1;_key3 < _len3; _key3++)\n args[_key3 - 1] = arguments[_key3];\n return waitForActual(promiseFn).then(function(result) {\n return expectsError.@apply(void 0, [rejects, result].concat(args));\n });\n }, assert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new @Array(_len4 > 1 \? _len4 - 1 : 0), _key4 = 1;_key4 < _len4; _key4++)\n args[_key4 - 1] = arguments[_key4];\n expectsNoError.@apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n }, assert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new @Array(_len5 > 1 \? _len5 - 1 : 0), _key5 = 1;_key5 < _len5; _key5++)\n args[_key5 - 1] = arguments[_key5];\n return waitForActual(fn).then(function(result) {\n return expectsNoError.@apply(void 0, [doesNotReject, result].concat(args));\n });\n }, assert.ifError = function ifError(err) {\n if (err != null) {\n var message = \"ifError got unwanted exception: \";\n _typeof(err) === \"object\" && typeof err.message == \"string\" \? err.message.length === 0 && err.constructor \? message += err.constructor.name : message += err.message : message += inspect(err);\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message,\n stackStartFn: ifError\n }), origStack = err.stack;\n if (typeof origStack == \"string\") {\n var tmp2 = origStack.split(`\n`);\n tmp2.shift();\n for (var tmp1 = newErr.stack.split(`\n`), i = 0;i < tmp2.length; i++) {\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(`\n`), `\n`).concat(tmp2.join(`\n`));\n }\n throw newErr;\n }\n };\n function strict() {\n for (var _len6 = arguments.length, args = new @Array(_len6), _key6 = 0;_key6 < _len6; _key6++)\n args[_key6] = arguments[_key6];\n innerOk.@apply(void 0, [strict, args.length].concat(args));\n }\n assert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n }), assert.strict.strict = assert.strict;\n }\n}), assert_module = require_assert();\nassert_module.CallTracker = CallTracker;\nreturn assert_module})\n");
//
//
-static constexpr ASCIILiteral NodeAsyncHooksCode = "(function (){\"use strict\";// src/js/out/tmp/node/async_hooks.ts\nvar get = function() {\n return @getInternalField(@asyncContext, 0);\n}, set = function(contextValue) {\n return @putInternalField(@asyncContext, 0, contextValue);\n}, createWarning = function(message) {\n let warned = !1;\n var wrapped = function() {\n if (warned)\n return;\n if (new Error().stack.includes(\"zx/build/core.js\"))\n return;\n warned = !0, console.warn(\"[bun] Warning:\", message);\n };\n return wrapped;\n}, createHook = function(callbacks) {\n return {\n enable: createHookNotImpl,\n disable: createHookNotImpl\n };\n}, executionAsyncId = function() {\n return executionAsyncIdNotImpl(), 0;\n}, triggerAsyncId = function() {\n return 0;\n}, executionAsyncResource = function() {\n return executionAsyncResourceWarning(), process.stdin;\n}, $, { cleanupLater, setAsyncHooksEnabled } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"async_hooks\");\n\nclass AsyncLocalStorage {\n #disableCalled = !1;\n constructor() {\n setAsyncHooksEnabled(!0);\n }\n static bind(fn, ...args) {\n return this.snapshot().bind(null, fn, ...args);\n }\n static snapshot() {\n var context = get();\n return (fn, ...args) => {\n var prev = get();\n set(context);\n try {\n return fn(...args);\n } catch (error) {\n throw error;\n } finally {\n set(prev);\n }\n };\n }\n enterWith(store) {\n cleanupLater();\n var context = get();\n if (!context) {\n set([this, store]);\n return;\n }\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this) {\n const clone = context.slice();\n clone[i + 1] = store, set(clone);\n return;\n }\n set(context.concat(this, store));\n }\n exit(cb, ...args) {\n return this.run(void 0, cb, ...args);\n }\n run(store, callback, ...args) {\n var context = get(), hasPrevious = !1, previous, i = 0, contextWasInit = !context;\n if (contextWasInit)\n set(context = [this, store]);\n else {\n if (context = context.slice(), i = context.indexOf(this), i > -1)\n hasPrevious = !0, previous = context[i + 1], context[i + 1] = store;\n else\n context.push(this, store);\n set(context);\n }\n try {\n return callback(...args);\n } catch (e) {\n throw e;\n } finally {\n if (!this.#disableCalled) {\n var context2 = get();\n if (context2 === context && contextWasInit)\n set(void 0);\n else if (context2 = context2.slice(), hasPrevious)\n context2[i + 1] = previous, set(context2);\n else\n context2.splice(i, 2), set(context2.length \? context2 : void 0);\n }\n }\n }\n disable() {\n if (!this.#disableCalled) {\n var context = get();\n if (context) {\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this) {\n context.splice(i, 2), set(context.length \? context : void 0);\n break;\n }\n }\n this.#disableCalled = !0;\n }\n }\n getStore() {\n var context = get();\n if (!context)\n return;\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this)\n return context[i + 1];\n }\n}\n\nclass AsyncResource {\n type;\n #snapshot;\n constructor(type, options) {\n if (typeof type !== \"string\")\n @throwTypeError('The \"type\" argument must be of type string. Received type ' + typeof type);\n setAsyncHooksEnabled(!0), this.type = type, this.#snapshot = get();\n }\n emitBefore() {\n return !0;\n }\n emitAfter() {\n return !0;\n }\n asyncId() {\n return 0;\n }\n triggerAsyncId() {\n return 0;\n }\n emitDestroy() {\n }\n runInAsyncScope(fn, thisArg, ...args) {\n var prev = get();\n set(this.#snapshot);\n try {\n return fn.apply(thisArg, args);\n } catch (error) {\n throw error;\n } finally {\n set(prev);\n }\n }\n}\nvar createHookNotImpl = createWarning(\"async_hooks.createHook is not implemented in Bun. Hooks can still be created but will never be called.\"), executionAsyncIdNotImpl = createWarning(\"async_hooks.executionAsyncId/triggerAsyncId are not implemented in Bun. It will return 0 every time.\"), executionAsyncResourceWarning = createWarning(\"async_hooks.executionAsyncResource is not implemented in Bun. It returns a reference to process.stdin every time.\"), asyncWrapProviders = {\n NONE: 0,\n DIRHANDLE: 1,\n DNSCHANNEL: 2,\n ELDHISTOGRAM: 3,\n FILEHANDLE: 4,\n FILEHANDLECLOSEREQ: 5,\n FIXEDSIZEBLOBCOPY: 6,\n FSEVENTWRAP: 7,\n FSREQCALLBACK: 8,\n FSREQPROMISE: 9,\n GETADDRINFOREQWRAP: 10,\n GETNAMEINFOREQWRAP: 11,\n HEAPSNAPSHOT: 12,\n HTTP2SESSION: 13,\n HTTP2STREAM: 14,\n HTTP2PING: 15,\n HTTP2SETTINGS: 16,\n HTTPINCOMINGMESSAGE: 17,\n HTTPCLIENTREQUEST: 18,\n JSSTREAM: 19,\n JSUDPWRAP: 20,\n MESSAGEPORT: 21,\n PIPECONNECTWRAP: 22,\n PIPESERVERWRAP: 23,\n PIPEWRAP: 24,\n PROCESSWRAP: 25,\n PROMISE: 26,\n QUERYWRAP: 27,\n SHUTDOWNWRAP: 28,\n SIGNALWRAP: 29,\n STATWATCHER: 30,\n STREAMPIPE: 31,\n TCPCONNECTWRAP: 32,\n TCPSERVERWRAP: 33,\n TCPWRAP: 34,\n TTYWRAP: 35,\n UDPSENDWRAP: 36,\n UDPWRAP: 37,\n SIGINTWATCHDOG: 38,\n WORKER: 39,\n WORKERHEAPSNAPSHOT: 40,\n WRITEWRAP: 41,\n ZLIB: 42,\n CHECKPRIMEREQUEST: 43,\n PBKDF2REQUEST: 44,\n KEYPAIRGENREQUEST: 45,\n KEYGENREQUEST: 46,\n KEYEXPORTREQUEST: 47,\n CIPHERREQUEST: 48,\n DERIVEBITSREQUEST: 49,\n HASHREQUEST: 50,\n RANDOMBYTESREQUEST: 51,\n RANDOMPRIMEREQUEST: 52,\n SCRYPTREQUEST: 53,\n SIGNREQUEST: 54,\n TLSWRAP: 55,\n VERIFYREQUEST: 56,\n INSPECTORJSBINDING: 57\n};\n$ = {\n AsyncLocalStorage,\n createHook,\n executionAsyncId,\n triggerAsyncId,\n executionAsyncResource,\n asyncWrapProviders,\n AsyncResource\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeAssertStrictCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/assert.strict.ts\nreturn (@getInternalField(@internalModuleRegistry, 8) || @createInternalModuleById(8)).strict})\n");
//
//
-static constexpr ASCIILiteral NodeChildProcessCode = "(function (){\"use strict\";// src/js/out/tmp/node/child_process.ts\nvar spawn = function(file, args, options) {\n options = normalizeSpawnArguments(file, args, options), validateTimeout(options.timeout), validateAbortSignal(options.signal, \"options.signal\");\n const killSignal2 = sanitizeKillSignal(options.killSignal), child = new ChildProcess;\n if (child.spawn(options), options.timeout > 0) {\n let timeoutId = setTimeout(() => {\n if (timeoutId) {\n try {\n child.kill(killSignal2);\n } catch (err) {\n child.emit(\"error\", err);\n }\n timeoutId = null;\n }\n });\n child.once(\"exit\", () => {\n if (timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n });\n }\n if (options.signal) {\n let onAbortListener2 = function() {\n abortChildProcess(child, killSignal2, options.signal.reason);\n };\n var onAbortListener = onAbortListener2;\n const signal = options.signal;\n if (signal.aborted)\n process.nextTick(onAbortListener2);\n else\n signal.addEventListener(\"abort\", onAbortListener2, { once: !0 }), child.once(\"exit\", () => signal.removeEventListener(\"abort\", onAbortListener2));\n }\n return child;\n}, execFile = function(file, args, options, callback) {\n ({ file, args, options, callback } = normalizeExecFileArgs(file, args, options, callback)), options = {\n encoding: \"utf8\",\n timeout: 0,\n maxBuffer: MAX_BUFFER,\n killSignal: \"SIGTERM\",\n cwd: null,\n env: null,\n shell: !1,\n ...options\n };\n const maxBuffer = options.maxBuffer;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const child = spawn(file, args, {\n cwd: options.cwd,\n env: options.env,\n shell: options.shell,\n signal: options.signal\n });\n let encoding;\n const _stdout = [], _stderr = [];\n if (options.encoding !== \"buffer\" && BufferIsEncoding(options.encoding))\n encoding = options.encoding;\n else\n encoding = null;\n let stdoutLen = 0, stderrLen = 0, killed = !1, exited = !1, timeoutId, encodedStdoutLen, encodedStderrLen, ex = null, cmd = file;\n function exitHandler(code, signal) {\n if (exited)\n return;\n if (exited = !0, timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n if (!callback)\n return;\n const readableEncoding = child\?.stdout\?.readableEncoding;\n let stdout, stderr;\n if (encoding || child.stdout && readableEncoding)\n stdout = ArrayPrototypeJoin.call(_stdout, \"\");\n else\n stdout = BufferConcat(_stdout);\n if (encoding || child.stderr && readableEncoding)\n stderr = ArrayPrototypeJoin.call(_stderr, \"\");\n else\n stderr = BufferConcat(_stderr);\n if (!ex && code === 0 && signal === null) {\n callback(null, stdout, stderr);\n return;\n }\n if (args\?.length)\n cmd += ` ${ArrayPrototypeJoin.call(args, \" \")}`;\n if (!ex) {\n let message = `Command failed: ${cmd}`;\n if (stderr)\n message += `\\n${stderr}`;\n ex = genericNodeError(message, {\n code,\n killed: child.killed || killed,\n signal\n });\n }\n ex.cmd = cmd, callback(ex, stdout, stderr);\n }\n function errorHandler(e) {\n if (ex = e, child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n exitHandler();\n }\n function kill() {\n if (child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n killed = !0;\n try {\n child.kill(options.killSignal);\n } catch (e) {\n ex = e, exitHandler();\n }\n }\n if (options.timeout > 0)\n timeoutId = setTimeout(function delayedKill() {\n kill(), timeoutId = null;\n }, options.timeout);\n if (child.stdout) {\n if (encoding)\n child.stdout.setEncoding(encoding);\n child.stdout.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stdout, chunk);\n } : encoding \? function onChildStdoutEncoded(chunk) {\n if (stdoutLen += chunk.length, stdoutLen * 4 > maxBuffer) {\n const encoding2 = child.stdout.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStdoutLen === void 0)\n for (let i = 0;i < _stdout.length; i++)\n encodedStdoutLen += Buffer.byteLength(_stdout[i], encoding2);\n else\n encodedStdoutLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStdoutLen - actualLen);\n ArrayPrototypePush.call(_stdout, StringPrototypeSlice.apply(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n } : function onChildStdoutRaw(chunk) {\n if (stdoutLen += chunk.length, stdoutLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stdoutLen - chunk.length);\n ArrayPrototypePush.call(_stdout, chunk.slice(0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n });\n }\n if (child.stderr) {\n if (encoding)\n child.stderr.setEncoding(encoding);\n child.stderr.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stderr, chunk);\n } : encoding \? function onChildStderrEncoded(chunk) {\n if (stderrLen += chunk.length, stderrLen * 4 > maxBuffer) {\n const encoding2 = child.stderr.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStderrLen === void 0)\n for (let i = 0;i < _stderr.length; i++)\n encodedStderrLen += Buffer.byteLength(_stderr[i], encoding2);\n else\n encodedStderrLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStderrLen - actualLen);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n } : function onChildStderrRaw(chunk) {\n if (stderrLen += chunk.length, stderrLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stderrLen - chunk.length);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n });\n }\n return child.addListener(\"close\", exitHandler), child.addListener(\"error\", errorHandler), child;\n}, exec = function(command, options, callback) {\n const opts = normalizeExecArgs(command, options, callback);\n return execFile(opts.file, opts.options, opts.callback);\n}, spawnSync = function(file, args, options) {\n options = {\n maxBuffer: MAX_BUFFER,\n ...normalizeSpawnArguments(file, args, options)\n };\n const { maxBuffer, encoding } = options;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const stdio = options.stdio || \"pipe\", bunStdio = getBunStdioFromOptions(stdio);\n var { input } = options;\n if (input)\n if (ArrayBufferIsView(input))\n bunStdio[0] = input;\n else if (typeof input === \"string\")\n bunStdio[0] = Buffer.from(input, encoding || \"utf8\");\n else\n throw new ERR_INVALID_ARG_TYPE(\"options.stdio[0]\", [\"Buffer\", \"TypedArray\", \"DataView\", \"string\"], input);\n const { stdout, stderr, success, exitCode } = Bun.spawnSync({\n cmd: options.args,\n env: options.env || void 0,\n cwd: options.cwd || void 0,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2]\n }), result = {\n signal: null,\n status: exitCode,\n output: [null, stdout, stderr]\n };\n if (stdout && encoding && encoding !== \"buffer\")\n result.output[1] = result.output[1]\?.toString(encoding);\n if (stderr && encoding && encoding !== \"buffer\")\n result.output[2] = result.output[2]\?.toString(encoding);\n if (result.stdout = result.output[1], result.stderr = result.output[2], !success)\n result.error = new SystemError(result.output[2], options.file, \"spawnSync\", -1, result.status), result.error.spawnargs = ArrayPrototypeSlice.call(options.args, 1);\n return result;\n}, execFileSync = function(file, args, options) {\n ({ file, args, options } = normalizeExecFileArgs(file, args, options));\n const ret = spawnSync(file, args, options), errArgs = [options.argv0 || file];\n ArrayPrototypePush.apply(errArgs, args);\n const err = checkExecSyncError(ret, errArgs);\n if (err)\n throw err;\n return ret.stdout;\n}, execSync = function(command, options) {\n const opts = normalizeExecArgs(command, options, null), ret = spawnSync(opts.file, opts.options), err = checkExecSyncError(ret, void 0, command);\n if (err)\n throw err;\n return ret.stdout;\n}, stdioStringToArray = function(stdio, channel) {\n const options = [];\n switch (stdio) {\n case \"ignore\":\n case \"overlapped\":\n case \"pipe\":\n ArrayPrototypePush.call(options, stdio, stdio, stdio);\n break;\n case \"inherit\":\n ArrayPrototypePush.call(options, 0, 1, 2);\n break;\n default:\n throw new ERR_INVALID_ARG_VALUE(\"stdio\", stdio);\n }\n if (channel)\n ArrayPrototypePush.call(options, channel);\n return options;\n}, fork = function(modulePath, args = [], options) {\n modulePath = getValidatedPath(modulePath, \"modulePath\");\n let execArgv;\n if (args == null)\n args = [];\n else if (typeof args === \"object\" && !ArrayIsArray(args))\n options = args, args = [];\n else\n validateArray(args, \"args\");\n if (options != null)\n validateObject(options, \"options\");\n if (options = { __proto__: null, ...options, shell: !1 }, options.execPath = options.execPath || process.execPath, validateArgumentNullCheck(options.execPath, \"options.execPath\"), execArgv = options.execArgv || process.execArgv, validateArgumentsNullCheck(execArgv, \"options.execArgv\"), execArgv === process.execArgv && process._eval != null) {\n const index = ArrayPrototypeLastIndexOf.call(execArgv, process._eval);\n if (index > 0)\n execArgv = ArrayPrototypeSlice.call(execArgv), ArrayPrototypeSplice.call(execArgv, index - 1, 2);\n }\n if (args = [...execArgv, modulePath, ...args], typeof options.stdio === \"string\")\n options.stdio = stdioStringToArray(options.stdio, \"ipc\");\n else if (!ArrayIsArray(options.stdio))\n options.stdio = stdioStringToArray(options.silent \? \"pipe\" : \"inherit\", \"ipc\");\n else if (!ArrayPrototypeIncludes.call(options.stdio, \"ipc\"))\n throw new ERR_CHILD_PROCESS_IPC_REQUIRED(\"options.stdio\");\n return spawn(options.execPath, args, options);\n}, convertToValidSignal = function(signal) {\n if (typeof signal === \"number\" && getSignalsToNamesMapping()[signal])\n return signal;\n if (typeof signal === \"string\") {\n const signalName = signals[StringPrototypeToUpperCase.call(signal)];\n if (signalName)\n return signalName;\n }\n throw new ERR_UNKNOWN_SIGNAL(signal);\n}, sanitizeKillSignal = function(killSignal2) {\n if (typeof killSignal2 === \"string\" || typeof killSignal2 === \"number\")\n return convertToValidSignal(killSignal2);\n else if (killSignal2 != null)\n throw new ERR_INVALID_ARG_TYPE(\"options.killSignal\", [\"string\", \"number\"], killSignal2);\n}, getSignalsToNamesMapping = function() {\n if (signalsToNamesMapping !== void 0)\n return signalsToNamesMapping;\n signalsToNamesMapping = ObjectCreate(null);\n for (let key in signals)\n signalsToNamesMapping[signals[key]] = key;\n return signalsToNamesMapping;\n}, normalizeExecFileArgs = function(file, args, options, callback) {\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args != null && typeof args === \"object\")\n callback = options, options = args, args = null;\n else if (typeof args === \"function\")\n callback = args, options = null, args = null;\n if (args == null)\n args = [];\n if (typeof options === \"function\")\n callback = options;\n else if (options != null)\n validateObject(options, \"options\");\n if (options == null)\n options = kEmptyObject;\n if (callback != null)\n validateFunction(callback, \"callback\");\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n return { file, args, options, callback };\n}, normalizeExecArgs = function(command, options, callback) {\n if (validateString(command, \"command\"), validateArgumentNullCheck(command, \"command\"), typeof options === \"function\")\n callback = options, options = void 0;\n return options = { ...options }, options.shell = typeof options.shell === \"string\" \? options.shell : !0, {\n file: command,\n options,\n callback\n };\n}, normalizeSpawnArguments = function(file, args, options) {\n if (validateString(file, \"file\"), validateArgumentNullCheck(file, \"file\"), file.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"file\", file, \"cannot be empty\");\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args == null)\n args = [];\n else if (typeof args !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"args\", \"object\", args);\n else\n options = args, args = [];\n if (validateArgumentsNullCheck(args, \"args\"), options === void 0)\n options = {};\n else\n validateObject(options, \"options\");\n let cwd = options.cwd;\n if (cwd != null)\n cwd = getValidatedPath(cwd, \"options.cwd\");\n var detached = !1;\n const { detached: detachedOption } = options;\n if (detachedOption != null)\n detached = !!detachedOption;\n if (options.shell != null && typeof options.shell !== \"boolean\" && typeof options.shell !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(\"options.shell\", [\"boolean\", \"string\"], options.shell);\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n if (options.shell) {\n validateArgumentNullCheck(options.shell, \"options.shell\");\n const command = ArrayPrototypeJoin.call([file, ...args], \" \");\n if (typeof options.shell === \"string\")\n file = options.shell;\n else\n file = \"sh\";\n args = [\"-c\", command];\n }\n if (typeof options.argv0 === \"string\")\n ArrayPrototypeUnshift.call(args, options.argv0);\n else\n ArrayPrototypeUnshift.call(args, file);\n const envPairs = options.env || process.env;\n return { ...options, detached, file, args, cwd, envPairs };\n}, checkExecSyncError = function(ret, args, cmd) {\n let err;\n if (ret.error)\n err = ret.error, ObjectAssign(err, ret);\n else if (ret.status !== 0) {\n let msg = \"Command failed: \";\n if (msg += cmd || ArrayPrototypeJoin.call(args, \" \"), ret.stderr && ret.stderr.length > 0)\n msg += `\\n${ret.stderr.toString()}`;\n err = genericNodeError(msg, ret);\n }\n return err;\n}, nodeToBun = function(item) {\n if (typeof item === \"number\")\n return item;\n else {\n const result = nodeToBunLookup[item];\n if (result === void 0)\n throw new Error(\"Invalid stdio option\");\n return result;\n }\n}, fdToStdioName = function(fd) {\n switch (fd) {\n case 0:\n return \"stdin\";\n case 1:\n return \"stdout\";\n case 2:\n return \"stderr\";\n default:\n return null;\n }\n}, getBunStdioFromOptions = function(stdio) {\n return normalizeStdio(stdio).map((item) => nodeToBun(item));\n}, normalizeStdio = function(stdio) {\n if (typeof stdio === \"string\")\n switch (stdio) {\n case \"ignore\":\n return [\"ignore\", \"ignore\", \"ignore\"];\n case \"pipe\":\n return [\"pipe\", \"pipe\", \"pipe\"];\n case \"inherit\":\n return [\"inherit\", \"inherit\", \"inherit\"];\n default:\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n }\n else if (ArrayIsArray(stdio)) {\n let processedStdio;\n if (stdio.length === 0)\n processedStdio = [\"pipe\", \"pipe\", \"pipe\"];\n else if (stdio.length === 1)\n processedStdio = [stdio[0], \"pipe\", \"pipe\"];\n else if (stdio.length === 2)\n processedStdio = [stdio[0], stdio[1], \"pipe\"];\n else if (stdio.length >= 3)\n processedStdio = [stdio[0], stdio[1], stdio[2]];\n return processedStdio.map((item) => !item \? \"pipe\" : item);\n } else\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n}, flushStdio = function(subprocess) {\n const stdio = subprocess.stdio;\n if (stdio == null)\n return;\n for (let i = 0;i < stdio.length; i++) {\n const stream = stdio[i];\n if (!stream || !stream.readable)\n continue;\n stream.resume();\n }\n}, onSpawnNT = function(self) {\n self.emit(\"spawn\");\n}, abortChildProcess = function(child, killSignal2, reason) {\n if (!child)\n return;\n try {\n if (child.kill(killSignal2))\n child.emit(\"error\", new AbortError(void 0, { cause: reason }));\n } catch (err) {\n child.emit(\"error\", err);\n }\n}, validateMaxBuffer = function(maxBuffer) {\n if (maxBuffer != null && !(typeof maxBuffer === \"number\" && maxBuffer >= 0))\n throw new ERR_OUT_OF_RANGE(\"options.maxBuffer\", \"a positive number\", maxBuffer);\n}, validateArgumentNullCheck = function(arg, propName) {\n if (typeof arg === \"string\" && StringPrototypeIncludes.call(arg, \"\\0\"))\n throw new ERR_INVALID_ARG_VALUE(propName, arg, \"must be a string without null bytes\");\n}, validateArgumentsNullCheck = function(args, propName) {\n for (let i = 0;i < args.length; ++i)\n validateArgumentNullCheck(args[i], `${propName}[${i}]`);\n}, validateTimeout = function(timeout) {\n if (timeout != null && !(NumberIsInteger(timeout) && timeout >= 0))\n throw new ERR_OUT_OF_RANGE(\"timeout\", \"an unsigned integer\", timeout);\n};\nvar validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, nullCheck = function(path, propName, throwError = !0) {\n const pathIsString = typeof path === \"string\", pathIsUint8Array = isUint8Array(path);\n if (!pathIsString && !pathIsUint8Array || pathIsString && !StringPrototypeIncludes.call(path, \"\\0\") || pathIsUint8Array && !Uint8ArrayPrototypeIncludes.call(path, 0))\n return;\n const err = new ERR_INVALID_ARG_VALUE(propName, path, \"must be a string or Uint8Array without null bytes\");\n if (throwError)\n throw err;\n return err;\n}, validatePath = function(path, propName = \"path\") {\n if (typeof path !== \"string\" && !isUint8Array(path))\n throw new ERR_INVALID_ARG_TYPE(propName, [\"string\", \"Buffer\", \"URL\"], path);\n const err = nullCheck(path, propName, !1);\n if (err !== void 0)\n throw err;\n}, getValidatedPath = function(fileURLOrPath, propName = \"path\") {\n const path = toPathIfFileURL(fileURLOrPath);\n return validatePath(path, propName), path;\n}, isUint8Array = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof Uint8Array;\n}, isURLInstance = function(fileURLOrPath) {\n return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin;\n}, toPathIfFileURL = function(fileURLOrPath) {\n if (!isURLInstance(fileURLOrPath))\n return fileURLOrPath;\n return Bun.fileURLToPath(fileURLOrPath);\n}, genericNodeError = function(message, options) {\n const err = new Error(message);\n return err.code = options.code, err.killed = options.killed, err.signal = options.signal, err;\n}, ERR_OUT_OF_RANGE = function(str, range, input, replaceDefaultBoolean = !1) {\n return new RangeError(`The value of ${str} is out of range. It must be ${range}. Received ${input}`);\n}, ERR_CHILD_PROCESS_STDIO_MAXBUFFER = function(stdio) {\n return Error(`${stdio} maxBuffer length exceeded`);\n}, ERR_UNKNOWN_SIGNAL = function(name) {\n const err = @makeTypeError(`Unknown signal: ${name}`);\n return err.code = \"ERR_UNKNOWN_SIGNAL\", err;\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value\?.toString()}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_INVALID_OPT_VALUE = function(name, value) {\n return @makeTypeError(`The value \"${value}\" is invalid for option \"${name}\"`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value \"${value}\" is invalid for argument '${name}'. Reason: ${reason}`);\n}, ERR_CHILD_PROCESS_IPC_REQUIRED = function(name) {\n const err = @makeTypeError(`Forked processes must have an IPC channel, missing value 'ipc' in ${name}`);\n return err.code = \"ERR_CHILD_PROCESS_IPC_REQUIRED\", err;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), StreamModule = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), {\n constants: { signals }\n} = @getInternalField(@internalModuleRegistry, 26) || @createInternalModuleById(26), { promisify } = @getInternalField(@internalModuleRegistry, 46) || @createInternalModuleById(46), ObjectCreate = Object.create, ObjectAssign = Object.assign, ObjectDefineProperty = Object.defineProperty, BufferConcat = Buffer.concat, BufferIsEncoding = Buffer.isEncoding, kEmptyObject = ObjectCreate(null), ArrayPrototypePush = Array.prototype.push, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypeIncludes = Array.prototype.includes, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeUnshift = Array.prototype.unshift, ArrayPrototypeLastIndexOf = Array.prototype.lastIndexOf, ArrayPrototypeSplice = Array.prototype.splice, ArrayIsArray = Array.isArray, ArrayBufferIsView = ArrayBuffer.isView, NumberIsInteger = Number.isInteger;\nvar StringPrototypeToUpperCase = String.prototype.toUpperCase, StringPrototypeIncludes = String.prototype.includes, StringPrototypeSlice = String.prototype.slice, Uint8ArrayPrototypeIncludes = Uint8Array.prototype.includes, MAX_BUFFER = 1048576, NativeWritable, ReadableFromWeb, customPromiseExecFunction = (orig) => {\n return (...args) => {\n let resolve, reject;\n const promise = new Promise((res, rej) => {\n resolve = res, reject = rej;\n });\n return promise.child = orig(...args, (err, stdout, stderr) => {\n if (err !== null)\n err.stdout = stdout, err.stderr = stderr, reject(err);\n else\n resolve({ stdout, stderr });\n }), promise;\n };\n};\nObjectDefineProperty(exec, promisify.custom, {\n __proto__: null,\n enumerable: !1,\n value: customPromiseExecFunction(exec)\n});\nvar signalsToNamesMapping;\n\nclass ChildProcess extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n #handle;\n #exited = !1;\n #closesNeeded = 1;\n #closesGot = 0;\n connected = !1;\n signalCode = null;\n exitCode = null;\n spawnfile;\n spawnargs;\n pid;\n channel;\n get killed() {\n if (this.#handle == null)\n return !1;\n }\n #handleOnExit(exitCode, signalCode, err) {\n if (this.#exited)\n return;\n if (signalCode)\n this.signalCode = signalCode;\n else\n this.exitCode = exitCode;\n if (this.#stdin)\n this.#stdin.destroy();\n if (this.#handle)\n this.#handle = null;\n if (exitCode < 0) {\n const err2 = new SystemError(`Spawned process exited with error code: ${exitCode}`, void 0, \"spawn\", \"EUNKNOWN\", \"ERR_CHILD_PROCESS_UNKNOWN_ERROR\");\n if (this.spawnfile)\n err2.path = this.spawnfile;\n err2.spawnargs = ArrayPrototypeSlice.call(this.spawnargs, 1), this.emit(\"error\", err2);\n } else\n this.emit(\"exit\", this.exitCode, this.signalCode);\n process.nextTick(flushStdio, this), this.#maybeClose(), this.#exited = !0, this.#stdioOptions = [\"destroyed\", \"destroyed\", \"destroyed\"];\n }\n #getBunSpawnIo(i, encoding) {\n NativeWritable ||= StreamModule.NativeWritable, ReadableFromWeb ||= StreamModule.Readable.fromWeb;\n const io = this.#stdioOptions[i];\n switch (i) {\n case 0:\n switch (io) {\n case \"pipe\":\n return new NativeWritable(this.#handle.stdin);\n case \"inherit\":\n return process.stdin || null;\n case \"destroyed\":\n return new ShimmedStdin;\n default:\n return null;\n }\n case 2:\n case 1:\n switch (io) {\n case \"pipe\":\n return ReadableFromWeb(this.#handle[fdToStdioName(i)], { encoding });\n case \"inherit\":\n return process[fdToStdioName(i)] || null;\n case \"destroyed\":\n return new ShimmedStdioOutStream;\n default:\n return null;\n }\n }\n }\n #stdin;\n #stdout;\n #stderr;\n #stdioObject;\n #encoding;\n #stdioOptions;\n #createStdioObject() {\n return Object.create(null, {\n 0: {\n get: () => this.stdin\n },\n 1: {\n get: () => this.stdout\n },\n 2: {\n get: () => this.stderr\n }\n });\n }\n get stdin() {\n return this.#stdin \?\?= this.#getBunSpawnIo(0, this.#encoding);\n }\n get stdout() {\n return this.#stdout \?\?= this.#getBunSpawnIo(1, this.#encoding);\n }\n get stderr() {\n return this.#stderr \?\?= this.#getBunSpawnIo(2, this.#encoding);\n }\n get stdio() {\n return this.#stdioObject \?\?= this.#createStdioObject();\n }\n spawn(options) {\n validateObject(options, \"options\"), validateString(options.file, \"options.file\");\n var file = this.spawnfile = options.file, spawnargs;\n if (options.args == null)\n spawnargs = this.spawnargs = [];\n else\n validateArray(options.args, \"options.args\"), spawnargs = this.spawnargs = options.args;\n const stdio = options.stdio || [\"pipe\", \"pipe\", \"pipe\"], bunStdio = getBunStdioFromOptions(stdio), ipc = @isArray(stdio) && stdio[3] === \"ipc\";\n var env = options.envPairs || void 0;\n const detachedOption = options.detached;\n if (this.#encoding = options.encoding || void 0, this.#stdioOptions = bunStdio, this.#handle = Bun.spawn({\n cmd: spawnargs,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2],\n cwd: options.cwd || void 0,\n env: env || process.env,\n detached: typeof detachedOption !== \"undefined\" \? !!detachedOption : !1,\n onExit: (handle, exitCode, signalCode, err) => {\n this.#handle = handle, this.pid = this.#handle.pid, process.nextTick((exitCode2, signalCode2, err2) => this.#handleOnExit(exitCode2, signalCode2, err2), exitCode, signalCode, err);\n },\n lazy: !0,\n ipc: ipc \? this.#emitIpcMessage.bind(this) : void 0\n }), this.pid = this.#handle.pid, onSpawnNT(this), ipc)\n this.send = this.#send, this.disconnect = this.#disconnect;\n }\n #emitIpcMessage(message) {\n this.emit(\"message\", message);\n }\n #send(message, handle, options, callback) {\n if (typeof handle === \"function\")\n callback = handle, handle = void 0, options = void 0;\n else if (typeof options === \"function\")\n callback = options, options = void 0;\n else if (options !== void 0) {\n if (typeof options !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n }\n if (!this.#handle) {\n if (callback)\n process.nextTick(callback, @makeTypeError(\"Process was closed while trying to send message\"));\n else\n this.emit(\"error\", @makeTypeError(\"Process was closed while trying to send message\"));\n return !1;\n }\n try {\n if (this.#handle.send(message), callback)\n process.nextTick(callback);\n return !0;\n } catch (error) {\n if (callback)\n process.nextTick(callback, error);\n else\n this.emit(\"error\", error);\n return !1;\n }\n }\n #disconnect() {\n if (!this.connected) {\n this.emit(\"error\", @makeTypeError(\"Process was closed while trying to send message\"));\n return;\n }\n this.connected = !1, this.#handle.disconnect();\n }\n kill(sig) {\n const signal = sig === 0 \? sig : convertToValidSignal(sig === void 0 \? \"SIGTERM\" : sig);\n if (this.#handle)\n this.#handle.kill(signal);\n return this.#maybeClose(), !0;\n }\n #maybeClose() {\n if (this.#closesGot++, this.#closesGot === this.#closesNeeded)\n this.emit(\"close\", this.exitCode, this.signalCode);\n }\n ref() {\n if (this.#handle)\n this.#handle.ref();\n }\n unref() {\n if (this.#handle)\n this.#handle.unref();\n }\n}\nvar nodeToBunLookup = {\n ignore: null,\n pipe: \"pipe\",\n overlapped: \"pipe\",\n inherit: \"inherit\"\n};\n\nclass ShimmedStdin extends EventEmitter {\n constructor() {\n super();\n }\n write() {\n return !1;\n }\n destroy() {\n }\n end() {\n }\n pipe() {\n }\n}\n\nclass ShimmedStdioOutStream extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n pipe() {\n }\n}\nvar validateAbortSignal = (signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n};\nvar validateObject = (value, name, options = null) => {\n const allowArray = options\?.allowArray \?\? !1, allowFunction = options\?.allowFunction \?\? !1;\n if (!(options\?.nullable \?\? !1) && value === null || !allowArray && ArrayIsArray.call(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE(name, \"object\", value);\n}, validateArray = (value, name, minLength = 0) => {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, Error = globalThis.Error, TypeError = globalThis.TypeError, RangeError = globalThis.RangeError;\n\nclass AbortError extends Error {\n code = \"ABORT_ERR\";\n name = \"AbortError\";\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n }\n}\n\nclass SystemError extends Error {\n path;\n syscall;\n errno;\n code;\n constructor(message, path, syscall, errno, code) {\n super(message);\n this.path = path, this.syscall = syscall, this.errno = errno, this.code = code;\n }\n get name() {\n return \"SystemError\";\n }\n}\n$ = {\n ChildProcess,\n spawn,\n execFile,\n exec,\n fork,\n spawnSync,\n execFileSync,\n execSync\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeAsyncHooksCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/async_hooks.ts\nvar get = function() {\n return @getInternalField(@asyncContext, 0);\n}, set = function(contextValue) {\n return @putInternalField(@asyncContext, 0, contextValue);\n}, createWarning = function(message) {\n let warned = !1;\n var wrapped = function() {\n if (warned)\n return;\n if (new Error().stack.includes(\"zx/build/core.js\"))\n return;\n warned = !0, console.warn(\"[bun] Warning:\", message);\n };\n return wrapped;\n}, createHook = function(callbacks) {\n return {\n enable: createHookNotImpl,\n disable: createHookNotImpl\n };\n}, executionAsyncId = function() {\n return executionAsyncIdNotImpl(), 0;\n}, triggerAsyncId = function() {\n return 0;\n}, executionAsyncResource = function() {\n return executionAsyncResourceWarning(), process.stdin;\n}, $, { cleanupLater, setAsyncHooksEnabled } = @lazy(\"async_hooks\");\n\nclass AsyncLocalStorage {\n #disableCalled = !1;\n constructor() {\n setAsyncHooksEnabled(!0);\n }\n static bind(fn, ...args) {\n return this.snapshot().bind(null, fn, ...args);\n }\n static snapshot() {\n var context = get();\n return (fn, ...args) => {\n var prev = get();\n set(context);\n try {\n return fn(...args);\n } catch (error) {\n throw error;\n } finally {\n set(prev);\n }\n };\n }\n enterWith(store) {\n cleanupLater();\n var context = get();\n if (!context) {\n set([this, store]);\n return;\n }\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this) {\n const clone = context.slice();\n clone[i + 1] = store, set(clone);\n return;\n }\n set(context.concat(this, store));\n }\n exit(cb, ...args) {\n return this.run(@undefined, cb, ...args);\n }\n run(store_value, callback, ...args) {\n var context = get(), hasPrevious = !1, previous_value, i = 0, contextWasAlreadyInit = !context;\n if (contextWasAlreadyInit)\n set(context = [this, store_value]);\n else {\n if (context = context.slice(), i = context.indexOf(this), i > -1)\n hasPrevious = !0, previous_value = context[i + 1], context[i + 1] = store_value;\n else\n i = context.length, context.push(this, store_value);\n set(context);\n }\n try {\n return callback(...args);\n } catch (e) {\n throw e;\n } finally {\n if (!this.#disableCalled) {\n var context2 = get();\n if (context2 === context && contextWasAlreadyInit)\n set(@undefined);\n else if (context2 = context2.slice(), hasPrevious)\n context2[i + 1] = previous_value, set(context2);\n else\n context2.splice(i, 2), set(context2.length \? context2 : @undefined);\n }\n }\n }\n disable() {\n if (!this.#disableCalled) {\n var context = get();\n if (context) {\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this) {\n context.splice(i, 2), set(context.length \? context : @undefined);\n break;\n }\n }\n this.#disableCalled = !0;\n }\n }\n getStore() {\n var context = get();\n if (!context)\n return;\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this)\n return context[i + 1];\n }\n}\n\nclass AsyncResource {\n type;\n #snapshot;\n constructor(type, options) {\n if (typeof type !== \"string\")\n @throwTypeError('The \"type\" argument must be of type string. Received type ' + typeof type);\n setAsyncHooksEnabled(!0), this.type = type, this.#snapshot = get();\n }\n emitBefore() {\n return !0;\n }\n emitAfter() {\n return !0;\n }\n asyncId() {\n return 0;\n }\n triggerAsyncId() {\n return 0;\n }\n emitDestroy() {\n }\n runInAsyncScope(fn, thisArg, ...args) {\n var prev = get();\n set(this.#snapshot);\n try {\n return fn.@apply(thisArg, args);\n } catch (error) {\n throw error;\n } finally {\n set(prev);\n }\n }\n bind(fn, thisArg) {\n return this.runInAsyncScope.bind(this, fn, thisArg \?\? this);\n }\n static bind(fn, type, thisArg) {\n return type = type || fn.name, new AsyncResource(type || \"bound-anonymous-fn\").bind(fn, thisArg);\n }\n}\nvar createHookNotImpl = createWarning(\"async_hooks.createHook is not implemented in Bun. Hooks can still be created but will never be called.\"), executionAsyncIdNotImpl = createWarning(\"async_hooks.executionAsyncId/triggerAsyncId are not implemented in Bun. It will return 0 every time.\"), executionAsyncResourceWarning = createWarning(\"async_hooks.executionAsyncResource is not implemented in Bun. It returns a reference to process.stdin every time.\"), asyncWrapProviders = {\n NONE: 0,\n DIRHANDLE: 1,\n DNSCHANNEL: 2,\n ELDHISTOGRAM: 3,\n FILEHANDLE: 4,\n FILEHANDLECLOSEREQ: 5,\n FIXEDSIZEBLOBCOPY: 6,\n FSEVENTWRAP: 7,\n FSREQCALLBACK: 8,\n FSREQPROMISE: 9,\n GETADDRINFOREQWRAP: 10,\n GETNAMEINFOREQWRAP: 11,\n HEAPSNAPSHOT: 12,\n HTTP2SESSION: 13,\n HTTP2STREAM: 14,\n HTTP2PING: 15,\n HTTP2SETTINGS: 16,\n HTTPINCOMINGMESSAGE: 17,\n HTTPCLIENTREQUEST: 18,\n JSSTREAM: 19,\n JSUDPWRAP: 20,\n MESSAGEPORT: 21,\n PIPECONNECTWRAP: 22,\n PIPESERVERWRAP: 23,\n PIPEWRAP: 24,\n PROCESSWRAP: 25,\n PROMISE: 26,\n QUERYWRAP: 27,\n SHUTDOWNWRAP: 28,\n SIGNALWRAP: 29,\n STATWATCHER: 30,\n STREAMPIPE: 31,\n TCPCONNECTWRAP: 32,\n TCPSERVERWRAP: 33,\n TCPWRAP: 34,\n TTYWRAP: 35,\n UDPSENDWRAP: 36,\n UDPWRAP: 37,\n SIGINTWATCHDOG: 38,\n WORKER: 39,\n WORKERHEAPSNAPSHOT: 40,\n WRITEWRAP: 41,\n ZLIB: 42,\n CHECKPRIMEREQUEST: 43,\n PBKDF2REQUEST: 44,\n KEYPAIRGENREQUEST: 45,\n KEYGENREQUEST: 46,\n KEYEXPORTREQUEST: 47,\n CIPHERREQUEST: 48,\n DERIVEBITSREQUEST: 49,\n HASHREQUEST: 50,\n RANDOMBYTESREQUEST: 51,\n RANDOMPRIMEREQUEST: 52,\n SCRYPTREQUEST: 53,\n SIGNREQUEST: 54,\n TLSWRAP: 55,\n VERIFYREQUEST: 56,\n INSPECTORJSBINDING: 57\n};\n$ = {\n AsyncLocalStorage,\n createHook,\n executionAsyncId,\n triggerAsyncId,\n executionAsyncResource,\n asyncWrapProviders,\n AsyncResource\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeClusterCode = "(function (){\"use strict\";// src/js/out/tmp/node/cluster.ts\nvar EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5);\n\nclass Cluster extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n isWorker = !1;\n isPrimary = !0;\n isMaster = !0;\n workers = {};\n settings = {};\n SCHED_NONE = 1;\n SCHED_RR = 2;\n schedulingPolicy = 2;\n Worker = function Worker() {\n throwNotImplemented(\"node:cluster Worker\", 2428);\n };\n setupPrimary() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n setupMaster() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n fork() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n disconnect() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n}\nreturn new Cluster})\n"_s;
+static constexpr ASCIILiteral NodeChildProcessCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/child_process.ts\nvar spawn = function(file, args, options) {\n options = normalizeSpawnArguments(file, args, options), validateTimeout(options.timeout), validateAbortSignal(options.signal, \"options.signal\");\n const killSignal2 = sanitizeKillSignal(options.killSignal), child = new ChildProcess;\n if (child.spawn(options), options.timeout > 0) {\n let timeoutId = setTimeout(() => {\n if (timeoutId) {\n try {\n child.kill(killSignal2);\n } catch (err) {\n child.emit(\"error\", err);\n }\n timeoutId = null;\n }\n });\n child.once(\"exit\", () => {\n if (timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n });\n }\n if (options.signal) {\n let onAbortListener2 = function() {\n abortChildProcess(child, killSignal2, options.signal.reason);\n };\n var onAbortListener = onAbortListener2;\n const signal = options.signal;\n if (signal.aborted)\n process.nextTick(onAbortListener2);\n else\n signal.addEventListener(\"abort\", onAbortListener2, { once: !0 }), child.once(\"exit\", () => signal.removeEventListener(\"abort\", onAbortListener2));\n }\n return child;\n}, execFile = function(file, args, options, callback) {\n ({ file, args, options, callback } = normalizeExecFileArgs(file, args, options, callback)), options = {\n encoding: \"utf8\",\n timeout: 0,\n maxBuffer: MAX_BUFFER,\n killSignal: \"SIGTERM\",\n cwd: null,\n env: null,\n shell: !1,\n ...options\n };\n const maxBuffer = options.maxBuffer;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const child = spawn(file, args, {\n cwd: options.cwd,\n env: options.env,\n shell: options.shell,\n signal: options.signal\n });\n let encoding;\n const _stdout = [], _stderr = [];\n if (options.encoding !== \"buffer\" && BufferIsEncoding(options.encoding))\n encoding = options.encoding;\n else\n encoding = null;\n let stdoutLen = 0, stderrLen = 0, killed = !1, exited = !1, timeoutId, encodedStdoutLen, encodedStderrLen, ex = null, cmd = file;\n function exitHandler(code, signal) {\n if (exited)\n return;\n if (exited = !0, timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n if (!callback)\n return;\n const readableEncoding = child\?.stdout\?.readableEncoding;\n let stdout, stderr;\n if (encoding || child.stdout && readableEncoding)\n stdout = ArrayPrototypeJoin.@call(_stdout, \"\");\n else\n stdout = BufferConcat(_stdout);\n if (encoding || child.stderr && readableEncoding)\n stderr = ArrayPrototypeJoin.@call(_stderr, \"\");\n else\n stderr = BufferConcat(_stderr);\n if (!ex && code === 0 && signal === null) {\n callback(null, stdout, stderr);\n return;\n }\n if (args\?.length)\n cmd += ` ${ArrayPrototypeJoin.@call(args, \" \")}`;\n if (!ex) {\n let message = `Command failed: ${cmd}`;\n if (stderr)\n message += `\\n${stderr}`;\n ex = genericNodeError(message, {\n code,\n killed: child.killed || killed,\n signal\n });\n }\n ex.cmd = cmd, callback(ex, stdout, stderr);\n }\n function errorHandler(e) {\n if (ex = e, child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n exitHandler();\n }\n function kill() {\n if (child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n killed = !0;\n try {\n child.kill(options.killSignal);\n } catch (e) {\n ex = e, exitHandler();\n }\n }\n if (options.timeout > 0)\n timeoutId = setTimeout(function delayedKill() {\n kill(), timeoutId = null;\n }, options.timeout);\n if (child.stdout) {\n if (encoding)\n child.stdout.setEncoding(encoding);\n child.stdout.on(\"data\", maxBuffer === @Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.@call(_stdout, chunk);\n } : encoding \? function onChildStdoutEncoded(chunk) {\n if (stdoutLen += chunk.length, stdoutLen * 4 > maxBuffer) {\n const encoding2 = child.stdout.readableEncoding, actualLen = @Buffer.byteLength(chunk, encoding2);\n if (encodedStdoutLen === @undefined)\n for (let i = 0;i < _stdout.length; i++)\n encodedStdoutLen += @Buffer.byteLength(_stdout[i], encoding2);\n else\n encodedStdoutLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStdoutLen - actualLen);\n ArrayPrototypePush.@call(_stdout, StringPrototypeSlice.@apply(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.@call(_stdout, chunk);\n } : function onChildStdoutRaw(chunk) {\n if (stdoutLen += chunk.length, stdoutLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stdoutLen - chunk.length);\n ArrayPrototypePush.@call(_stdout, chunk.slice(0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.@call(_stdout, chunk);\n });\n }\n if (child.stderr) {\n if (encoding)\n child.stderr.setEncoding(encoding);\n child.stderr.on(\"data\", maxBuffer === @Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.@call(_stderr, chunk);\n } : encoding \? function onChildStderrEncoded(chunk) {\n if (stderrLen += chunk.length, stderrLen * 4 > maxBuffer) {\n const encoding2 = child.stderr.readableEncoding, actualLen = @Buffer.byteLength(chunk, encoding2);\n if (encodedStderrLen === @undefined)\n for (let i = 0;i < _stderr.length; i++)\n encodedStderrLen += @Buffer.byteLength(_stderr[i], encoding2);\n else\n encodedStderrLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStderrLen - actualLen);\n ArrayPrototypePush.@call(_stderr, StringPrototypeSlice.@call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.@call(_stderr, chunk);\n } : function onChildStderrRaw(chunk) {\n if (stderrLen += chunk.length, stderrLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stderrLen - chunk.length);\n ArrayPrototypePush.@call(_stderr, StringPrototypeSlice.@call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.@call(_stderr, chunk);\n });\n }\n return child.addListener(\"close\", exitHandler), child.addListener(\"error\", errorHandler), child;\n}, exec = function(command, options, callback) {\n const opts = normalizeExecArgs(command, options, callback);\n return execFile(opts.file, opts.options, opts.callback);\n}, spawnSync = function(file, args, options) {\n options = {\n maxBuffer: MAX_BUFFER,\n ...normalizeSpawnArguments(file, args, options)\n };\n const { maxBuffer, encoding } = options;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const stdio = options.stdio || \"pipe\", bunStdio = getBunStdioFromOptions(stdio);\n var { input } = options;\n if (input)\n if (ArrayBufferIsView(input))\n bunStdio[0] = input;\n else if (typeof input === \"string\")\n bunStdio[0] = @Buffer.from(input, encoding || \"utf8\");\n else\n throw new ERR_INVALID_ARG_TYPE(\"options.stdio[0]\", [\"Buffer\", \"TypedArray\", \"DataView\", \"string\"], input);\n const { stdout, stderr, success, exitCode } = Bun.spawnSync({\n cmd: options.args,\n env: options.env || @undefined,\n cwd: options.cwd || @undefined,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2]\n }), result = {\n signal: null,\n status: exitCode,\n output: [null, stdout, stderr]\n };\n if (stdout && encoding && encoding !== \"buffer\")\n result.output[1] = result.output[1]\?.toString(encoding);\n if (stderr && encoding && encoding !== \"buffer\")\n result.output[2] = result.output[2]\?.toString(encoding);\n if (result.stdout = result.output[1], result.stderr = result.output[2], !success)\n result.error = new SystemError(result.output[2], options.file, \"spawnSync\", -1, result.status), result.error.spawnargs = ArrayPrototypeSlice.@call(options.args, 1);\n return result;\n}, execFileSync = function(file, args, options) {\n ({ file, args, options } = normalizeExecFileArgs(file, args, options));\n const ret = spawnSync(file, args, options), errArgs = [options.argv0 || file];\n ArrayPrototypePush.@apply(errArgs, args);\n const err = checkExecSyncError(ret, errArgs);\n if (err)\n throw err;\n return ret.stdout;\n}, execSync = function(command, options) {\n const opts = normalizeExecArgs(command, options, null), ret = spawnSync(opts.file, opts.options), err = checkExecSyncError(ret, @undefined, command);\n if (err)\n throw err;\n return ret.stdout;\n}, stdioStringToArray = function(stdio, channel) {\n const options = [];\n switch (stdio) {\n case \"ignore\":\n case \"overlapped\":\n case \"pipe\":\n ArrayPrototypePush.@call(options, stdio, stdio, stdio);\n break;\n case \"inherit\":\n ArrayPrototypePush.@call(options, 0, 1, 2);\n break;\n default:\n throw new ERR_INVALID_ARG_VALUE(\"stdio\", stdio);\n }\n if (channel)\n ArrayPrototypePush.@call(options, channel);\n return options;\n}, fork = function(modulePath, args = [], options) {\n modulePath = getValidatedPath(modulePath, \"modulePath\");\n let execArgv;\n if (args == null)\n args = [];\n else if (typeof args === \"object\" && !ArrayIsArray(args))\n options = args, args = [];\n else\n validateArray(args, \"args\");\n if (options != null)\n validateObject(options, \"options\");\n if (options = { __proto__: null, ...options, shell: !1 }, options.execPath = options.execPath || process.execPath, validateArgumentNullCheck(options.execPath, \"options.execPath\"), args = [modulePath, ...args], typeof options.stdio === \"string\")\n options.stdio = stdioStringToArray(options.stdio, \"ipc\");\n else if (!ArrayIsArray(options.stdio))\n options.stdio = stdioStringToArray(options.silent \? \"pipe\" : \"inherit\", \"ipc\");\n else if (!ArrayPrototypeIncludes.@call(options.stdio, \"ipc\"))\n throw new ERR_CHILD_PROCESS_IPC_REQUIRED(\"options.stdio\");\n return spawn(options.execPath, args, options);\n}, convertToValidSignal = function(signal) {\n if (typeof signal === \"number\" && getSignalsToNamesMapping()[signal])\n return signal;\n if (typeof signal === \"string\") {\n const signalName = signals[StringPrototypeToUpperCase.@call(signal)];\n if (signalName)\n return signalName;\n }\n throw new ERR_UNKNOWN_SIGNAL(signal);\n}, sanitizeKillSignal = function(killSignal2) {\n if (typeof killSignal2 === \"string\" || typeof killSignal2 === \"number\")\n return convertToValidSignal(killSignal2);\n else if (killSignal2 != null)\n throw new ERR_INVALID_ARG_TYPE(\"options.killSignal\", [\"string\", \"number\"], killSignal2);\n}, getSignalsToNamesMapping = function() {\n if (signalsToNamesMapping !== @undefined)\n return signalsToNamesMapping;\n signalsToNamesMapping = ObjectCreate(null);\n for (let key in signals)\n signalsToNamesMapping[signals[key]] = key;\n return signalsToNamesMapping;\n}, normalizeExecFileArgs = function(file, args, options, callback) {\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.@call(args);\n else if (args != null && typeof args === \"object\")\n callback = options, options = args, args = null;\n else if (typeof args === \"function\")\n callback = args, options = null, args = null;\n if (args == null)\n args = [];\n if (typeof options === \"function\")\n callback = options;\n else if (options != null)\n validateObject(options, \"options\");\n if (options == null)\n options = kEmptyObject;\n if (callback != null)\n validateFunction(callback, \"callback\");\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n return { file, args, options, callback };\n}, normalizeExecArgs = function(command, options, callback) {\n if (validateString(command, \"command\"), validateArgumentNullCheck(command, \"command\"), typeof options === \"function\")\n callback = options, options = @undefined;\n return options = { ...options }, options.shell = typeof options.shell === \"string\" \? options.shell : !0, {\n file: command,\n options,\n callback\n };\n}, normalizeSpawnArguments = function(file, args, options) {\n if (validateString(file, \"file\"), validateArgumentNullCheck(file, \"file\"), file.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"file\", file, \"cannot be empty\");\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.@call(args);\n else if (args == null)\n args = [];\n else if (typeof args !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"args\", \"object\", args);\n else\n options = args, args = [];\n if (validateArgumentsNullCheck(args, \"args\"), options === @undefined)\n options = {};\n else\n validateObject(options, \"options\");\n let cwd = options.cwd;\n if (cwd != null)\n cwd = getValidatedPath(cwd, \"options.cwd\");\n var detached = !1;\n const { detached: detachedOption } = options;\n if (detachedOption != null)\n detached = !!detachedOption;\n if (options.shell != null && typeof options.shell !== \"boolean\" && typeof options.shell !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(\"options.shell\", [\"boolean\", \"string\"], options.shell);\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n if (options.shell) {\n validateArgumentNullCheck(options.shell, \"options.shell\");\n const command = ArrayPrototypeJoin.@call([file, ...args], \" \");\n if (typeof options.shell === \"string\")\n file = options.shell;\n else\n file = \"sh\";\n args = [\"-c\", command];\n }\n if (typeof options.argv0 === \"string\")\n ArrayPrototypeUnshift.@call(args, options.argv0);\n else\n ArrayPrototypeUnshift.@call(args, file);\n const envPairs = options.env || process.env;\n return { ...options, detached, file, args, cwd, envPairs };\n}, checkExecSyncError = function(ret, args, cmd) {\n let err;\n if (ret.error)\n err = ret.error, ObjectAssign(err, ret);\n else if (ret.status !== 0) {\n let msg = \"Command failed: \";\n if (msg += cmd || ArrayPrototypeJoin.@call(args, \" \"), ret.stderr && ret.stderr.length > 0)\n msg += `\\n${ret.stderr.toString()}`;\n err = genericNodeError(msg, ret);\n }\n return err;\n}, nodeToBun = function(item) {\n if (typeof item === \"number\")\n return item;\n else {\n const result = nodeToBunLookup[item];\n if (result === @undefined)\n throw new Error(`Invalid stdio option \"${item}\"`);\n return result;\n }\n}, fdToStdioName = function(fd) {\n switch (fd) {\n case 0:\n return \"stdin\";\n case 1:\n return \"stdout\";\n case 2:\n return \"stderr\";\n default:\n return null;\n }\n}, getBunStdioFromOptions = function(stdio) {\n return normalizeStdio(stdio).map((item) => nodeToBun(item));\n}, normalizeStdio = function(stdio) {\n if (typeof stdio === \"string\")\n switch (stdio) {\n case \"ignore\":\n return [\"ignore\", \"ignore\", \"ignore\"];\n case \"pipe\":\n return [\"pipe\", \"pipe\", \"pipe\"];\n case \"inherit\":\n return [\"inherit\", \"inherit\", \"inherit\"];\n default:\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n }\n else if (ArrayIsArray(stdio)) {\n let processedStdio;\n if (stdio.length === 0)\n processedStdio = [\"pipe\", \"pipe\", \"pipe\"];\n else if (stdio.length === 1)\n processedStdio = [stdio[0], \"pipe\", \"pipe\"];\n else if (stdio.length === 2)\n processedStdio = [stdio[0], stdio[1], \"pipe\"];\n else if (stdio.length >= 3)\n processedStdio = [stdio[0], stdio[1], stdio[2]];\n return processedStdio.map((item) => !item \? \"pipe\" : item);\n } else\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n}, flushStdio = function(subprocess) {\n const stdio = subprocess.stdio;\n if (stdio == null)\n return;\n for (let i = 0;i < stdio.length; i++) {\n const stream = stdio[i];\n if (!stream || !stream.readable)\n continue;\n stream.resume();\n }\n}, onSpawnNT = function(self) {\n self.emit(\"spawn\");\n}, abortChildProcess = function(child, killSignal2, reason) {\n if (!child)\n return;\n try {\n if (child.kill(killSignal2))\n child.emit(\"error\", new AbortError(@undefined, { cause: reason }));\n } catch (err) {\n child.emit(\"error\", err);\n }\n}, validateMaxBuffer = function(maxBuffer) {\n if (maxBuffer != null && !(typeof maxBuffer === \"number\" && maxBuffer >= 0))\n throw new ERR_OUT_OF_RANGE(\"options.maxBuffer\", \"a positive number\", maxBuffer);\n}, validateArgumentNullCheck = function(arg, propName) {\n if (typeof arg === \"string\" && StringPrototypeIncludes.@call(arg, \"\\0\"))\n throw new ERR_INVALID_ARG_VALUE(propName, arg, \"must be a string without null bytes\");\n}, validateArgumentsNullCheck = function(args, propName) {\n for (let i = 0;i < args.length; ++i)\n validateArgumentNullCheck(args[i], `${propName}[${i}]`);\n}, validateTimeout = function(timeout) {\n if (timeout != null && !(NumberIsInteger(timeout) && timeout >= 0))\n throw new ERR_OUT_OF_RANGE(\"timeout\", \"an unsigned integer\", timeout);\n};\nvar validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, nullCheck = function(path, propName, throwError = !0) {\n const pathIsString = typeof path === \"string\", pathIsUint8Array = isUint8Array(path);\n if (!pathIsString && !pathIsUint8Array || pathIsString && !StringPrototypeIncludes.@call(path, \"\\0\") || pathIsUint8Array && !Uint8ArrayPrototypeIncludes.@call(path, 0))\n return;\n const err = new ERR_INVALID_ARG_VALUE(propName, path, \"must be a string or Uint8Array without null bytes\");\n if (throwError)\n throw err;\n return err;\n}, validatePath = function(path, propName = \"path\") {\n if (typeof path !== \"string\" && !isUint8Array(path))\n throw new ERR_INVALID_ARG_TYPE(propName, [\"string\", \"Buffer\", \"URL\"], path);\n const err = nullCheck(path, propName, !1);\n if (err !== @undefined)\n throw err;\n}, getValidatedPath = function(fileURLOrPath, propName = \"path\") {\n const path = toPathIfFileURL(fileURLOrPath);\n return validatePath(path, propName), path;\n}, isUint8Array = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof @Uint8Array;\n}, isURLInstance = function(fileURLOrPath) {\n return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin;\n}, toPathIfFileURL = function(fileURLOrPath) {\n if (!isURLInstance(fileURLOrPath))\n return fileURLOrPath;\n return Bun.fileURLToPath(fileURLOrPath);\n}, genericNodeError = function(message, options) {\n const err = new Error(message);\n return err.code = options.code, err.killed = options.killed, err.signal = options.signal, err;\n}, ERR_OUT_OF_RANGE = function(str, range, input, replaceDefaultBoolean = !1) {\n return new RangeError(`The value of ${str} is out of range. It must be ${range}. Received ${input}`);\n}, ERR_CHILD_PROCESS_STDIO_MAXBUFFER = function(stdio) {\n return Error(`${stdio} maxBuffer length exceeded`);\n}, ERR_UNKNOWN_SIGNAL = function(name) {\n const err = @makeTypeError(`Unknown signal: ${name}`);\n return err.code = \"ERR_UNKNOWN_SIGNAL\", err;\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value\?.toString()}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_INVALID_OPT_VALUE = function(name, value) {\n return @makeTypeError(`The value \"${value}\" is invalid for option \"${name}\"`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value \"${value}\" is invalid for argument '${name}'. Reason: ${reason}`);\n}, ERR_CHILD_PROCESS_IPC_REQUIRED = function(name) {\n const err = @makeTypeError(`Forked processes must have an IPC channel, missing value 'ipc' in ${name}`);\n return err.code = \"ERR_CHILD_PROCESS_IPC_REQUIRED\", err;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), StreamModule = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), {\n constants: { signals }\n} = @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28), { promisify } = @getInternalField(@internalModuleRegistry, 48) || @createInternalModuleById(48), ObjectCreate = Object.create, ObjectAssign = Object.assign, ObjectDefineProperty = Object.defineProperty, BufferConcat = @Buffer.concat, BufferIsEncoding = @Buffer.isEncoding, kEmptyObject = ObjectCreate(null), ArrayPrototypePush = @Array.prototype.push, ArrayPrototypeJoin = @Array.prototype.join, ArrayPrototypeMap = @Array.prototype.map, ArrayPrototypeIncludes = @Array.prototype.includes, ArrayPrototypeSlice = @Array.prototype.slice, ArrayPrototypeUnshift = @Array.prototype.unshift, ArrayPrototypeLastIndexOf = @Array.prototype.lastIndexOf, ArrayPrototypeSplice = @Array.prototype.splice, ArrayIsArray = @Array.isArray, ArrayBufferIsView = @ArrayBuffer.isView, NumberIsInteger = Number.isInteger;\nvar StringPrototypeToUpperCase = @String.prototype.toUpperCase, StringPrototypeIncludes = @String.prototype.includes, StringPrototypeSlice = @String.prototype.slice, Uint8ArrayPrototypeIncludes = @Uint8Array.prototype.includes, MAX_BUFFER = 1048576, NativeWritable, ReadableFromWeb, customPromiseExecFunction = (orig) => {\n return (...args) => {\n let resolve, reject;\n const promise = new @Promise((res, rej) => {\n resolve = res, reject = rej;\n });\n return promise.child = orig(...args, (err, stdout, stderr) => {\n if (err !== null)\n err.stdout = stdout, err.stderr = stderr, reject(err);\n else\n resolve({ stdout, stderr });\n }), promise;\n };\n};\nObjectDefineProperty(exec, promisify.custom, {\n __proto__: null,\n enumerable: !1,\n value: customPromiseExecFunction(exec)\n});\nvar signalsToNamesMapping;\n\nclass ChildProcess extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n #handle;\n #exited = !1;\n #closesNeeded = 1;\n #closesGot = 0;\n connected = !1;\n signalCode = null;\n exitCode = null;\n spawnfile;\n spawnargs;\n pid;\n channel;\n get killed() {\n if (this.#handle == null)\n return !1;\n }\n #handleOnExit(exitCode, signalCode, err) {\n if (this.#exited)\n return;\n if (signalCode)\n this.signalCode = signalCode;\n else\n this.exitCode = exitCode;\n if (this.#stdin)\n this.#stdin.destroy();\n if (this.#handle)\n this.#handle = null;\n if (exitCode < 0) {\n const err2 = new SystemError(`Spawned process exited with error code: ${exitCode}`, @undefined, \"spawn\", \"EUNKNOWN\", \"ERR_CHILD_PROCESS_UNKNOWN_ERROR\");\n if (this.spawnfile)\n err2.path = this.spawnfile;\n err2.spawnargs = ArrayPrototypeSlice.@call(this.spawnargs, 1), this.emit(\"error\", err2);\n } else\n this.emit(\"exit\", this.exitCode, this.signalCode);\n process.nextTick(flushStdio, this), this.#maybeClose(), this.#exited = !0, this.#stdioOptions = [\"destroyed\", \"destroyed\", \"destroyed\"];\n }\n #getBunSpawnIo(i, encoding) {\n NativeWritable ||= StreamModule.NativeWritable, ReadableFromWeb ||= StreamModule.Readable.fromWeb;\n const io = this.#stdioOptions[i];\n switch (i) {\n case 0:\n switch (io) {\n case \"pipe\":\n return new NativeWritable(this.#handle.stdin);\n case \"inherit\":\n return process.stdin || null;\n case \"destroyed\":\n return new ShimmedStdin;\n default:\n return null;\n }\n case 2:\n case 1:\n switch (io) {\n case \"pipe\":\n return ReadableFromWeb(this.#handle[fdToStdioName(i)], { encoding });\n case \"inherit\":\n return process[fdToStdioName(i)] || null;\n case \"destroyed\":\n return new ShimmedStdioOutStream;\n default:\n return null;\n }\n }\n }\n #stdin;\n #stdout;\n #stderr;\n #stdioObject;\n #encoding;\n #stdioOptions;\n #createStdioObject() {\n return Object.create(null, {\n 0: {\n get: () => this.stdin\n },\n 1: {\n get: () => this.stdout\n },\n 2: {\n get: () => this.stderr\n }\n });\n }\n get stdin() {\n return this.#stdin \?\?= this.#getBunSpawnIo(0, this.#encoding);\n }\n get stdout() {\n return this.#stdout \?\?= this.#getBunSpawnIo(1, this.#encoding);\n }\n get stderr() {\n return this.#stderr \?\?= this.#getBunSpawnIo(2, this.#encoding);\n }\n get stdio() {\n return this.#stdioObject \?\?= this.#createStdioObject();\n }\n spawn(options) {\n validateObject(options, \"options\"), validateString(options.file, \"options.file\");\n var file = this.spawnfile = options.file, spawnargs;\n if (options.args == null)\n spawnargs = this.spawnargs = [];\n else\n validateArray(options.args, \"options.args\"), spawnargs = this.spawnargs = options.args;\n const stdio = options.stdio || [\"pipe\", \"pipe\", \"pipe\"], bunStdio = getBunStdioFromOptions(stdio), ipc = @isArray(stdio) && stdio[3] === \"ipc\";\n var env = options.envPairs || @undefined;\n const detachedOption = options.detached;\n if (this.#encoding = options.encoding || @undefined, this.#stdioOptions = bunStdio, this.#handle = Bun.spawn({\n cmd: spawnargs,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2],\n cwd: options.cwd || @undefined,\n env: env || process.env,\n detached: typeof detachedOption !== \"undefined\" \? !!detachedOption : !1,\n onExit: (handle, exitCode, signalCode, err) => {\n this.#handle = handle, this.pid = this.#handle.pid, process.nextTick((exitCode2, signalCode2, err2) => this.#handleOnExit(exitCode2, signalCode2, err2), exitCode, signalCode, err);\n },\n lazy: !0,\n ipc: ipc \? this.#emitIpcMessage.bind(this) : @undefined\n }), this.pid = this.#handle.pid, onSpawnNT(this), ipc)\n this.send = this.#send, this.disconnect = this.#disconnect;\n }\n #emitIpcMessage(message) {\n this.emit(\"message\", message);\n }\n #send(message, handle, options, callback) {\n if (typeof handle === \"function\")\n callback = handle, handle = @undefined, options = @undefined;\n else if (typeof options === \"function\")\n callback = options, options = @undefined;\n else if (options !== @undefined) {\n if (typeof options !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n }\n if (!this.#handle) {\n if (callback)\n process.nextTick(callback, @makeTypeError(\"Process was closed while trying to send message\"));\n else\n this.emit(\"error\", @makeTypeError(\"Process was closed while trying to send message\"));\n return !1;\n }\n try {\n if (this.#handle.send(message), callback)\n process.nextTick(callback);\n return !0;\n } catch (error) {\n if (callback)\n process.nextTick(callback, error);\n else\n this.emit(\"error\", error);\n return !1;\n }\n }\n #disconnect() {\n if (!this.connected) {\n this.emit(\"error\", @makeTypeError(\"Process was closed while trying to send message\"));\n return;\n }\n this.connected = !1, this.#handle.disconnect();\n }\n kill(sig) {\n const signal = sig === 0 \? sig : convertToValidSignal(sig === @undefined \? \"SIGTERM\" : sig);\n if (this.#handle)\n this.#handle.kill(signal);\n return this.#maybeClose(), !0;\n }\n #maybeClose() {\n if (this.#closesGot++, this.#closesGot === this.#closesNeeded)\n this.emit(\"close\", this.exitCode, this.signalCode);\n }\n ref() {\n if (this.#handle)\n this.#handle.ref();\n }\n unref() {\n if (this.#handle)\n this.#handle.unref();\n }\n}\nvar nodeToBunLookup = {\n ignore: null,\n pipe: \"pipe\",\n overlapped: \"pipe\",\n inherit: \"inherit\"\n};\n\nclass ShimmedStdin extends EventEmitter {\n constructor() {\n super();\n }\n write() {\n return !1;\n }\n destroy() {\n }\n end() {\n }\n pipe() {\n }\n}\n\nclass ShimmedStdioOutStream extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n pipe() {\n }\n}\nvar validateAbortSignal = (signal, name) => {\n if (signal !== @undefined && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n};\nvar validateObject = (value, name, options = null) => {\n const allowArray = options\?.allowArray \?\? !1, allowFunction = options\?.allowFunction \?\? !1;\n if (!(options\?.nullable \?\? !1) && value === null || !allowArray && ArrayIsArray.@call(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE(name, \"object\", value);\n}, validateArray = (value, name, minLength = 0) => {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, Error = globalThis.Error, TypeError = globalThis.TypeError, RangeError = globalThis.RangeError;\n\nclass AbortError extends Error {\n code = \"ABORT_ERR\";\n name = \"AbortError\";\n constructor(message = \"The operation was aborted\", options = @undefined) {\n if (options !== @undefined && typeof options !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n }\n}\n\nclass SystemError extends Error {\n path;\n syscall;\n errno;\n code;\n constructor(message, path, syscall, errno, code) {\n super(message);\n this.path = path, this.syscall = syscall, this.errno = errno, this.code = code;\n }\n get name() {\n return \"SystemError\";\n }\n}\n$ = {\n ChildProcess,\n spawn,\n execFile,\n exec,\n fork,\n spawnSync,\n execFileSync,\n execSync\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeConsoleCode = "(function (){\"use strict\";// src/js/out/tmp/node/console.ts\nreturn console})\n"_s;
+static constexpr ASCIILiteral NodeClusterCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/cluster.ts\nvar EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6);\n\nclass Cluster extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n isWorker = !1;\n isPrimary = !0;\n isMaster = !0;\n workers = {};\n settings = {};\n SCHED_NONE = 1;\n SCHED_RR = 2;\n schedulingPolicy = 2;\n Worker = function Worker() {\n throwNotImplemented(\"node:cluster Worker\", 2428);\n };\n setupPrimary() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n setupMaster() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n fork() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n disconnect() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n}\nreturn new Cluster})\n");
//
//
-static constexpr ASCIILiteral NodeCryptoCode = "(function (){\"use strict\";// src/js/out/tmp/node/crypto.ts\nvar getArrayBufferOrView = function(buffer, name, encoding) {\n if (isAnyArrayBuffer(buffer))\n return buffer;\n if (typeof buffer === \"string\") {\n if (encoding === \"buffer\")\n encoding = \"utf8\";\n return Buffer.from(buffer, encoding);\n }\n if (!isArrayBufferView(buffer)) {\n var error = @makeTypeError(`ERR_INVALID_ARG_TYPE: The \"${name}\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, or DataView. Received ` + buffer);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n return buffer;\n}, getCurves = function() {\n return harcoded_curves;\n}, $, __defProp = Object.defineProperty, __getOwnPropNames = Object.getOwnPropertyNames, StreamModule = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), BufferModule = @requireNativeModule(\"buffer\"), StringDecoder = @requireNativeModule(\"string_decoder\").StringDecoder, MAX_STRING_LENGTH = 536870888, Buffer = globalThis.Buffer, EMPTY_BUFFER = Buffer.alloc(0), { isAnyArrayBuffer, isArrayBufferView } = @requireNativeModule(\"util/types\"), crypto = globalThis.crypto, globalCrypto = crypto, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: !0 });\n}, require_safe_buffer = __commonJS({\n \"node_modules/safe-buffer/index.js\"(exports, module) {\n var buffer = BufferModule, Buffer2 = buffer.Buffer;\n function copyProps(src, dst) {\n for (var key in src)\n dst[key] = src[key];\n }\n Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow \? module.exports = buffer : (copyProps(buffer, exports), exports.Buffer = SafeBuffer);\n function SafeBuffer(arg, encodingOrOffset, length) {\n return Buffer2(arg, encodingOrOffset, length);\n }\n SafeBuffer.prototype = Object.create(Buffer2.prototype), copyProps(Buffer2, SafeBuffer), SafeBuffer.from = function(arg, encodingOrOffset, length) {\n if (typeof arg == \"number\")\n @throwTypeError(\"Argument must not be a number\");\n return Buffer2(arg, encodingOrOffset, length);\n }, SafeBuffer.alloc = function(size, fill, encoding) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n var buf = Buffer2(size);\n return fill !== void 0 \? typeof encoding == \"string\" \? buf.fill(fill, encoding) : buf.fill(fill) : buf.fill(0), buf;\n }, SafeBuffer.allocUnsafe = function(size) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n return Buffer2(size);\n }, SafeBuffer.allocUnsafeSlow = function(size) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n return buffer.SlowBuffer(size);\n };\n }\n}), require_browser = __commonJS({\n \"node_modules/randombytes/browser.js\"(exports, module) {\n var MAX_BYTES = 65536, MAX_UINT32 = 4294967295;\n function oldBrowser() {\n throw new Error(`Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11`);\n }\n var Buffer2 = require_safe_buffer().Buffer, crypto2 = globalCrypto;\n crypto2 && crypto2.getRandomValues \? module.exports = randomBytes : module.exports = oldBrowser;\n function randomBytes(size, cb) {\n if (size > MAX_UINT32)\n @throwRangeError(\"requested too many random bytes\");\n var bytes = Buffer2.allocUnsafe(size);\n if (size > 0)\n if (size > MAX_BYTES)\n for (var generated = 0;generated < size; generated += MAX_BYTES)\n crypto2.getRandomValues(bytes.slice(generated, generated + MAX_BYTES));\n else\n crypto2.getRandomValues(bytes);\n return typeof cb == \"function\" \? process.nextTick(function() {\n cb(null, bytes);\n }) : bytes;\n }\n }\n}), require_inherits_browser = __commonJS({\n \"node_modules/inherits/inherits_browser.js\"(exports, module) {\n module.exports = function(ctor, superCtor) {\n superCtor && (ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }));\n };\n }\n}), require_hash_base = __commonJS({\n \"node_modules/hash-base/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, inherits = require_inherits_browser();\n function throwIfNotStringOrBuffer(val, prefix) {\n if (!Buffer2.isBuffer(val) && typeof val != \"string\")\n @throwTypeError(prefix + \" must be a string or a buffer\");\n }\n function HashBase(blockSize) {\n StreamModule.Transform.call(this), this._block = Buffer2.allocUnsafe(blockSize), this._blockSize = blockSize, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = !1;\n }\n inherits(HashBase, StreamModule.Transform), HashBase.prototype._transform = function(chunk, encoding, callback) {\n var error = null;\n try {\n this.update(chunk, encoding);\n } catch (err) {\n error = err;\n }\n callback(error);\n }, HashBase.prototype._flush = function(callback) {\n var error = null;\n try {\n this.push(this.digest());\n } catch (err) {\n error = err;\n }\n callback(error);\n }, HashBase.prototype.update = function(data, encoding) {\n if (throwIfNotStringOrBuffer(data, \"Data\"), this._finalized)\n throw new Error(\"Digest already called\");\n Buffer2.isBuffer(data) || (data = Buffer2.from(data, encoding));\n for (var block = this._block, offset = 0;this._blockOffset + data.length - offset >= this._blockSize; ) {\n for (var i = this._blockOffset;i < this._blockSize; )\n block[i++] = data[offset++];\n this._update(), this._blockOffset = 0;\n }\n for (;offset < data.length; )\n block[this._blockOffset++] = data[offset++];\n for (var j = 0, carry = data.length * 8;carry > 0; ++j)\n this._length[j] += carry, carry = this._length[j] / 4294967296 | 0, carry > 0 && (this._length[j] -= 4294967296 * carry);\n return this;\n }, HashBase.prototype._update = function() {\n throw new Error(\"_update is not implemented\");\n }, HashBase.prototype.digest = function(encoding) {\n if (this._finalized)\n throw new Error(\"Digest already called\");\n this._finalized = !0;\n var digest = this._digest();\n encoding !== void 0 && (digest = digest.toString(encoding)), this._block.fill(0), this._blockOffset = 0;\n for (var i = 0;i < 4; ++i)\n this._length[i] = 0;\n return digest;\n }, HashBase.prototype._digest = function() {\n throw new Error(\"_digest is not implemented\");\n }, module.exports = HashBase;\n }\n}), require_md5 = __commonJS({\n \"node_modules/md5.js/index.js\"(exports, module) {\n var inherits = require_inherits_browser(), HashBase = require_hash_base(), Buffer2 = require_safe_buffer().Buffer, ARRAY16 = new Array(16);\n function MD5() {\n HashBase.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878;\n }\n inherits(MD5, HashBase), MD5.prototype._update = function() {\n for (var M = ARRAY16, i = 0;i < 16; ++i)\n M[i] = this._block.readInt32LE(i * 4);\n var a = this._a, b = this._b, c = this._c, d = this._d;\n a = fnF(a, b, c, d, M[0], 3614090360, 7), d = fnF(d, a, b, c, M[1], 3905402710, 12), c = fnF(c, d, a, b, M[2], 606105819, 17), b = fnF(b, c, d, a, M[3], 3250441966, 22), a = fnF(a, b, c, d, M[4], 4118548399, 7), d = fnF(d, a, b, c, M[5], 1200080426, 12), c = fnF(c, d, a, b, M[6], 2821735955, 17), b = fnF(b, c, d, a, M[7], 4249261313, 22), a = fnF(a, b, c, d, M[8], 1770035416, 7), d = fnF(d, a, b, c, M[9], 2336552879, 12), c = fnF(c, d, a, b, M[10], 4294925233, 17), b = fnF(b, c, d, a, M[11], 2304563134, 22), a = fnF(a, b, c, d, M[12], 1804603682, 7), d = fnF(d, a, b, c, M[13], 4254626195, 12), c = fnF(c, d, a, b, M[14], 2792965006, 17), b = fnF(b, c, d, a, M[15], 1236535329, 22), a = fnG(a, b, c, d, M[1], 4129170786, 5), d = fnG(d, a, b, c, M[6], 3225465664, 9), c = fnG(c, d, a, b, M[11], 643717713, 14), b = fnG(b, c, d, a, M[0], 3921069994, 20), a = fnG(a, b, c, d, M[5], 3593408605, 5), d = fnG(d, a, b, c, M[10], 38016083, 9), c = fnG(c, d, a, b, M[15], 3634488961, 14), b = fnG(b, c, d, a, M[4], 3889429448, 20), a = fnG(a, b, c, d, M[9], 568446438, 5), d = fnG(d, a, b, c, M[14], 3275163606, 9), c = fnG(c, d, a, b, M[3], 4107603335, 14), b = fnG(b, c, d, a, M[8], 1163531501, 20), a = fnG(a, b, c, d, M[13], 2850285829, 5), d = fnG(d, a, b, c, M[2], 4243563512, 9), c = fnG(c, d, a, b, M[7], 1735328473, 14), b = fnG(b, c, d, a, M[12], 2368359562, 20), a = fnH(a, b, c, d, M[5], 4294588738, 4), d = fnH(d, a, b, c, M[8], 2272392833, 11), c = fnH(c, d, a, b, M[11], 1839030562, 16), b = fnH(b, c, d, a, M[14], 4259657740, 23), a = fnH(a, b, c, d, M[1], 2763975236, 4), d = fnH(d, a, b, c, M[4], 1272893353, 11), c = fnH(c, d, a, b, M[7], 4139469664, 16), b = fnH(b, c, d, a, M[10], 3200236656, 23), a = fnH(a, b, c, d, M[13], 681279174, 4), d = fnH(d, a, b, c, M[0], 3936430074, 11), c = fnH(c, d, a, b, M[3], 3572445317, 16), b = fnH(b, c, d, a, M[6], 76029189, 23), a = fnH(a, b, c, d, M[9], 3654602809, 4), d = fnH(d, a, b, c, M[12], 3873151461, 11), c = fnH(c, d, a, b, M[15], 530742520, 16), b = fnH(b, c, d, a, M[2], 3299628645, 23), a = fnI(a, b, c, d, M[0], 4096336452, 6), d = fnI(d, a, b, c, M[7], 1126891415, 10), c = fnI(c, d, a, b, M[14], 2878612391, 15), b = fnI(b, c, d, a, M[5], 4237533241, 21), a = fnI(a, b, c, d, M[12], 1700485571, 6), d = fnI(d, a, b, c, M[3], 2399980690, 10), c = fnI(c, d, a, b, M[10], 4293915773, 15), b = fnI(b, c, d, a, M[1], 2240044497, 21), a = fnI(a, b, c, d, M[8], 1873313359, 6), d = fnI(d, a, b, c, M[15], 4264355552, 10), c = fnI(c, d, a, b, M[6], 2734768916, 15), b = fnI(b, c, d, a, M[13], 1309151649, 21), a = fnI(a, b, c, d, M[4], 4149444226, 6), d = fnI(d, a, b, c, M[11], 3174756917, 10), c = fnI(c, d, a, b, M[2], 718787259, 15), b = fnI(b, c, d, a, M[9], 3951481745, 21), this._a = this._a + a | 0, this._b = this._b + b | 0, this._c = this._c + c | 0, this._d = this._d + d | 0;\n }, MD5.prototype._digest = function() {\n this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();\n var buffer = Buffer2.allocUnsafe(16);\n return buffer.writeInt32LE(this._a, 0), buffer.writeInt32LE(this._b, 4), buffer.writeInt32LE(this._c, 8), buffer.writeInt32LE(this._d, 12), buffer;\n };\n function rotl(x, n) {\n return x << n | x >>> 32 - n;\n }\n function fnF(a, b, c, d, m, k, s) {\n return rotl(a + (b & c | ~b & d) + m + k | 0, s) + b | 0;\n }\n function fnG(a, b, c, d, m, k, s) {\n return rotl(a + (b & d | c & ~d) + m + k | 0, s) + b | 0;\n }\n function fnH(a, b, c, d, m, k, s) {\n return rotl(a + (b ^ c ^ d) + m + k | 0, s) + b | 0;\n }\n function fnI(a, b, c, d, m, k, s) {\n return rotl(a + (c ^ (b | ~d)) + m + k | 0, s) + b | 0;\n }\n module.exports = MD5;\n }\n}), require_ripemd160 = __commonJS({\n \"node_modules/ripemd160/index.js\"(exports, module) {\n var Buffer2 = Buffer, inherits = require_inherits_browser(), HashBase = require_hash_base(), ARRAY16 = new Array(16), zl = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 7,\n 4,\n 13,\n 1,\n 10,\n 6,\n 15,\n 3,\n 12,\n 0,\n 9,\n 5,\n 2,\n 14,\n 11,\n 8,\n 3,\n 10,\n 14,\n 4,\n 9,\n 15,\n 8,\n 1,\n 2,\n 7,\n 0,\n 6,\n 13,\n 11,\n 5,\n 12,\n 1,\n 9,\n 11,\n 10,\n 0,\n 8,\n 12,\n 4,\n 13,\n 3,\n 7,\n 15,\n 14,\n 5,\n 6,\n 2,\n 4,\n 0,\n 5,\n 9,\n 7,\n 12,\n 2,\n 10,\n 14,\n 1,\n 3,\n 8,\n 11,\n 6,\n 15,\n 13\n ], zr = [\n 5,\n 14,\n 7,\n 0,\n 9,\n 2,\n 11,\n 4,\n 13,\n 6,\n 15,\n 8,\n 1,\n 10,\n 3,\n 12,\n 6,\n 11,\n 3,\n 7,\n 0,\n 13,\n 5,\n 10,\n 14,\n 15,\n 8,\n 12,\n 4,\n 9,\n 1,\n 2,\n 15,\n 5,\n 1,\n 3,\n 7,\n 14,\n 6,\n 9,\n 11,\n 8,\n 12,\n 2,\n 10,\n 0,\n 4,\n 13,\n 8,\n 6,\n 4,\n 1,\n 3,\n 11,\n 15,\n 0,\n 5,\n 12,\n 2,\n 13,\n 9,\n 7,\n 10,\n 14,\n 12,\n 15,\n 10,\n 4,\n 1,\n 5,\n 8,\n 7,\n 6,\n 2,\n 13,\n 14,\n 0,\n 3,\n 9,\n 11\n ], sl = [\n 11,\n 14,\n 15,\n 12,\n 5,\n 8,\n 7,\n 9,\n 11,\n 13,\n 14,\n 15,\n 6,\n 7,\n 9,\n 8,\n 7,\n 6,\n 8,\n 13,\n 11,\n 9,\n 7,\n 15,\n 7,\n 12,\n 15,\n 9,\n 11,\n 7,\n 13,\n 12,\n 11,\n 13,\n 6,\n 7,\n 14,\n 9,\n 13,\n 15,\n 14,\n 8,\n 13,\n 6,\n 5,\n 12,\n 7,\n 5,\n 11,\n 12,\n 14,\n 15,\n 14,\n 15,\n 9,\n 8,\n 9,\n 14,\n 5,\n 6,\n 8,\n 6,\n 5,\n 12,\n 9,\n 15,\n 5,\n 11,\n 6,\n 8,\n 13,\n 12,\n 5,\n 12,\n 13,\n 14,\n 11,\n 8,\n 5,\n 6\n ], sr = [\n 8,\n 9,\n 9,\n 11,\n 13,\n 15,\n 15,\n 5,\n 7,\n 7,\n 8,\n 11,\n 14,\n 14,\n 12,\n 6,\n 9,\n 13,\n 15,\n 7,\n 12,\n 8,\n 9,\n 11,\n 7,\n 7,\n 12,\n 7,\n 6,\n 15,\n 13,\n 11,\n 9,\n 7,\n 15,\n 11,\n 8,\n 6,\n 6,\n 14,\n 12,\n 13,\n 5,\n 14,\n 13,\n 13,\n 7,\n 5,\n 15,\n 5,\n 8,\n 11,\n 14,\n 14,\n 6,\n 14,\n 6,\n 9,\n 12,\n 9,\n 12,\n 5,\n 15,\n 8,\n 8,\n 5,\n 12,\n 9,\n 12,\n 5,\n 14,\n 6,\n 8,\n 13,\n 6,\n 5,\n 15,\n 13,\n 11,\n 11\n ], hl = [0, 1518500249, 1859775393, 2400959708, 2840853838], hr = [1352829926, 1548603684, 1836072691, 2053994217, 0];\n function RIPEMD160() {\n HashBase.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520;\n }\n inherits(RIPEMD160, HashBase), RIPEMD160.prototype._update = function() {\n for (var words = ARRAY16, j = 0;j < 16; ++j)\n words[j] = this._block.readInt32LE(j * 4);\n for (var al = this._a | 0, bl = this._b | 0, cl = this._c | 0, dl = this._d | 0, el = this._e | 0, ar = this._a | 0, br = this._b | 0, cr = this._c | 0, dr = this._d | 0, er = this._e | 0, i = 0;i < 80; i += 1) {\n var tl, tr;\n i < 16 \? (tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i]), tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])) : i < 32 \? (tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i]), tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])) : i < 48 \? (tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i]), tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])) : i < 64 \? (tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i]), tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])) : (tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i]), tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])), al = el, el = dl, dl = rotl(cl, 10), cl = bl, bl = tl, ar = er, er = dr, dr = rotl(cr, 10), cr = br, br = tr;\n }\n var t = this._b + cl + dr | 0;\n this._b = this._c + dl + er | 0, this._c = this._d + el + ar | 0, this._d = this._e + al + br | 0, this._e = this._a + bl + cr | 0, this._a = t;\n }, RIPEMD160.prototype._digest = function() {\n this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();\n var buffer = Buffer2.alloc \? Buffer2.alloc(20) : new Buffer2(20);\n return buffer.writeInt32LE(this._a, 0), buffer.writeInt32LE(this._b, 4), buffer.writeInt32LE(this._c, 8), buffer.writeInt32LE(this._d, 12), buffer.writeInt32LE(this._e, 16), buffer;\n };\n function rotl(x, n) {\n return x << n | x >>> 32 - n;\n }\n function fn1(a, b, c, d, e, m, k, s) {\n return rotl(a + (b ^ c ^ d) + m + k | 0, s) + e | 0;\n }\n function fn2(a, b, c, d, e, m, k, s) {\n return rotl(a + (b & c | ~b & d) + m + k | 0, s) + e | 0;\n }\n function fn3(a, b, c, d, e, m, k, s) {\n return rotl(a + ((b | ~c) ^ d) + m + k | 0, s) + e | 0;\n }\n function fn4(a, b, c, d, e, m, k, s) {\n return rotl(a + (b & d | c & ~d) + m + k | 0, s) + e | 0;\n }\n function fn5(a, b, c, d, e, m, k, s) {\n return rotl(a + (b ^ (c | ~d)) + m + k | 0, s) + e | 0;\n }\n module.exports = RIPEMD160;\n }\n}), require_hash = __commonJS({\n \"node_modules/sha.js/hash.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n function Hash(blockSize, finalSize) {\n this._block = Buffer2.alloc(blockSize), this._finalSize = finalSize, this._blockSize = blockSize, this._len = 0;\n }\n Hash.prototype = {}, Hash.prototype.update = function(data, enc) {\n typeof data == \"string\" && (enc = enc || \"utf8\", data = Buffer2.from(data, enc));\n for (var block = this._block, blockSize = this._blockSize, length = data.length, accum = this._len, offset = 0;offset < length; ) {\n for (var assigned = accum % blockSize, remainder = Math.min(length - offset, blockSize - assigned), i = 0;i < remainder; i++)\n block[assigned + i] = data[offset + i];\n accum += remainder, offset += remainder, accum % blockSize === 0 && this._update(block);\n }\n return this._len += length, this;\n }, Hash.prototype.digest = function(enc) {\n var rem = this._len % this._blockSize;\n this._block[rem] = 128, this._block.fill(0, rem + 1), rem >= this._finalSize && (this._update(this._block), this._block.fill(0));\n var bits = this._len * 8;\n if (bits <= 4294967295)\n this._block.writeUInt32BE(bits, this._blockSize - 4);\n else {\n var lowBits = (bits & 4294967295) >>> 0, highBits = (bits - lowBits) / 4294967296;\n this._block.writeUInt32BE(highBits, this._blockSize - 8), this._block.writeUInt32BE(lowBits, this._blockSize - 4);\n }\n this._update(this._block);\n var hash = this._hash();\n return enc \? hash.toString(enc) : hash;\n }, Hash.prototype._update = function() {\n throw new Error(\"_update must be implemented by subclass\");\n }, module.exports = Hash;\n }\n}), require_sha = __commonJS({\n \"node_modules/sha.js/sha.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [1518500249, 1859775393, -1894007588, -899497514], W = new Array(80);\n function Sha() {\n this.init(), this._w = W, Hash.call(this, 64, 56);\n }\n inherits(Sha, Hash), Sha.prototype.init = function() {\n return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;\n };\n function rotl5(num) {\n return num << 5 | num >>> 27;\n }\n function rotl30(num) {\n return num << 30 | num >>> 2;\n }\n function ft(s, b, c, d) {\n return s === 0 \? b & c | ~b & d : s === 2 \? b & c | b & d | c & d : b ^ c ^ d;\n }\n Sha.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 80; ++i)\n W2[i] = W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16];\n for (var j = 0;j < 80; ++j) {\n var s = ~~(j / 20), t = rotl5(a) + ft(s, b, c, d) + e + W2[j] + K[s] | 0;\n e = d, d = c, c = rotl30(b), b = a, a = t;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0;\n }, Sha.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(20);\n return H.writeInt32BE(this._a | 0, 0), H.writeInt32BE(this._b | 0, 4), H.writeInt32BE(this._c | 0, 8), H.writeInt32BE(this._d | 0, 12), H.writeInt32BE(this._e | 0, 16), H;\n }, module.exports = Sha;\n }\n}), require_sha1 = __commonJS({\n \"node_modules/sha.js/sha1.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [1518500249, 1859775393, -1894007588, -899497514], W = new Array(80);\n function Sha1() {\n this.init(), this._w = W, Hash.call(this, 64, 56);\n }\n inherits(Sha1, Hash), Sha1.prototype.init = function() {\n return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;\n };\n function rotl1(num) {\n return num << 1 | num >>> 31;\n }\n function rotl5(num) {\n return num << 5 | num >>> 27;\n }\n function rotl30(num) {\n return num << 30 | num >>> 2;\n }\n function ft(s, b, c, d) {\n return s === 0 \? b & c | ~b & d : s === 2 \? b & c | b & d | c & d : b ^ c ^ d;\n }\n Sha1.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 80; ++i)\n W2[i] = rotl1(W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16]);\n for (var j = 0;j < 80; ++j) {\n var s = ~~(j / 20), t = rotl5(a) + ft(s, b, c, d) + e + W2[j] + K[s] | 0;\n e = d, d = c, c = rotl30(b), b = a, a = t;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0;\n }, Sha1.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(20);\n return H.writeInt32BE(this._a | 0, 0), H.writeInt32BE(this._b | 0, 4), H.writeInt32BE(this._c | 0, 8), H.writeInt32BE(this._d | 0, 12), H.writeInt32BE(this._e | 0, 16), H;\n }, module.exports = Sha1;\n }\n}), require_sha256 = __commonJS({\n \"node_modules/sha.js/sha256.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [\n 1116352408,\n 1899447441,\n 3049323471,\n 3921009573,\n 961987163,\n 1508970993,\n 2453635748,\n 2870763221,\n 3624381080,\n 310598401,\n 607225278,\n 1426881987,\n 1925078388,\n 2162078206,\n 2614888103,\n 3248222580,\n 3835390401,\n 4022224774,\n 264347078,\n 604807628,\n 770255983,\n 1249150122,\n 1555081692,\n 1996064986,\n 2554220882,\n 2821834349,\n 2952996808,\n 3210313671,\n 3336571891,\n 3584528711,\n 113926993,\n 338241895,\n 666307205,\n 773529912,\n 1294757372,\n 1396182291,\n 1695183700,\n 1986661051,\n 2177026350,\n 2456956037,\n 2730485921,\n 2820302411,\n 3259730800,\n 3345764771,\n 3516065817,\n 3600352804,\n 4094571909,\n 275423344,\n 430227734,\n 506948616,\n 659060556,\n 883997877,\n 958139571,\n 1322822218,\n 1537002063,\n 1747873779,\n 1955562222,\n 2024104815,\n 2227730452,\n 2361852424,\n 2428436474,\n 2756734187,\n 3204031479,\n 3329325298\n ], W = new Array(64);\n function Sha256() {\n this.init(), this._w = W, Hash.call(this, 64, 56);\n }\n inherits(Sha256, Hash), Sha256.prototype.init = function() {\n return this._a = 1779033703, this._b = 3144134277, this._c = 1013904242, this._d = 2773480762, this._e = 1359893119, this._f = 2600822924, this._g = 528734635, this._h = 1541459225, this;\n };\n function ch(x, y, z) {\n return z ^ x & (y ^ z);\n }\n function maj(x, y, z) {\n return x & y | z & (x | y);\n }\n function sigma0(x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10);\n }\n function sigma1(x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7);\n }\n function gamma0(x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ x >>> 3;\n }\n function gamma1(x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ x >>> 10;\n }\n Sha256.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, f = this._f | 0, g = this._g | 0, h = this._h | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 64; ++i)\n W2[i] = gamma1(W2[i - 2]) + W2[i - 7] + gamma0(W2[i - 15]) + W2[i - 16] | 0;\n for (var j = 0;j < 64; ++j) {\n var T1 = h + sigma1(e) + ch(e, f, g) + K[j] + W2[j] | 0, T2 = sigma0(a) + maj(a, b, c) | 0;\n h = g, g = f, f = e, e = d + T1 | 0, d = c, c = b, b = a, a = T1 + T2 | 0;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0, this._f = f + this._f | 0, this._g = g + this._g | 0, this._h = h + this._h | 0;\n }, Sha256.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(32);\n return H.writeInt32BE(this._a, 0), H.writeInt32BE(this._b, 4), H.writeInt32BE(this._c, 8), H.writeInt32BE(this._d, 12), H.writeInt32BE(this._e, 16), H.writeInt32BE(this._f, 20), H.writeInt32BE(this._g, 24), H.writeInt32BE(this._h, 28), H;\n }, module.exports = Sha256;\n }\n}), require_sha224 = __commonJS({\n \"node_modules/sha.js/sha224.js\"(exports, module) {\n var inherits = require_inherits_browser(), Sha256 = require_sha256(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, W = new Array(64);\n function Sha224() {\n this.init(), this._w = W, Hash.call(this, 64, 56);\n }\n inherits(Sha224, Sha256), Sha224.prototype.init = function() {\n return this._a = 3238371032, this._b = 914150663, this._c = 812702999, this._d = 4144912697, this._e = 4290775857, this._f = 1750603025, this._g = 1694076839, this._h = 3204075428, this;\n }, Sha224.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(28);\n return H.writeInt32BE(this._a, 0), H.writeInt32BE(this._b, 4), H.writeInt32BE(this._c, 8), H.writeInt32BE(this._d, 12), H.writeInt32BE(this._e, 16), H.writeInt32BE(this._f, 20), H.writeInt32BE(this._g, 24), H;\n }, module.exports = Sha224;\n }\n}), require_sha512 = __commonJS({\n \"node_modules/sha.js/sha512.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [\n 1116352408,\n 3609767458,\n 1899447441,\n 602891725,\n 3049323471,\n 3964484399,\n 3921009573,\n 2173295548,\n 961987163,\n 4081628472,\n 1508970993,\n 3053834265,\n 2453635748,\n 2937671579,\n 2870763221,\n 3664609560,\n 3624381080,\n 2734883394,\n 310598401,\n 1164996542,\n 607225278,\n 1323610764,\n 1426881987,\n 3590304994,\n 1925078388,\n 4068182383,\n 2162078206,\n 991336113,\n 2614888103,\n 633803317,\n 3248222580,\n 3479774868,\n 3835390401,\n 2666613458,\n 4022224774,\n 944711139,\n 264347078,\n 2341262773,\n 604807628,\n 2007800933,\n 770255983,\n 1495990901,\n 1249150122,\n 1856431235,\n 1555081692,\n 3175218132,\n 1996064986,\n 2198950837,\n 2554220882,\n 3999719339,\n 2821834349,\n 766784016,\n 2952996808,\n 2566594879,\n 3210313671,\n 3203337956,\n 3336571891,\n 1034457026,\n 3584528711,\n 2466948901,\n 113926993,\n 3758326383,\n 338241895,\n 168717936,\n 666307205,\n 1188179964,\n 773529912,\n 1546045734,\n 1294757372,\n 1522805485,\n 1396182291,\n 2643833823,\n 1695183700,\n 2343527390,\n 1986661051,\n 1014477480,\n 2177026350,\n 1206759142,\n 2456956037,\n 344077627,\n 2730485921,\n 1290863460,\n 2820302411,\n 3158454273,\n 3259730800,\n 3505952657,\n 3345764771,\n 106217008,\n 3516065817,\n 3606008344,\n 3600352804,\n 1432725776,\n 4094571909,\n 1467031594,\n 275423344,\n 851169720,\n 430227734,\n 3100823752,\n 506948616,\n 1363258195,\n 659060556,\n 3750685593,\n 883997877,\n 3785050280,\n 958139571,\n 3318307427,\n 1322822218,\n 3812723403,\n 1537002063,\n 2003034995,\n 1747873779,\n 3602036899,\n 1955562222,\n 1575990012,\n 2024104815,\n 1125592928,\n 2227730452,\n 2716904306,\n 2361852424,\n 442776044,\n 2428436474,\n 593698344,\n 2756734187,\n 3733110249,\n 3204031479,\n 2999351573,\n 3329325298,\n 3815920427,\n 3391569614,\n 3928383900,\n 3515267271,\n 566280711,\n 3940187606,\n 3454069534,\n 4118630271,\n 4000239992,\n 116418474,\n 1914138554,\n 174292421,\n 2731055270,\n 289380356,\n 3203993006,\n 460393269,\n 320620315,\n 685471733,\n 587496836,\n 852142971,\n 1086792851,\n 1017036298,\n 365543100,\n 1126000580,\n 2618297676,\n 1288033470,\n 3409855158,\n 1501505948,\n 4234509866,\n 1607167915,\n 987167468,\n 1816402316,\n 1246189591\n ], W = new Array(160);\n function Sha512() {\n this.init(), this._w = W, Hash.call(this, 128, 112);\n }\n inherits(Sha512, Hash), Sha512.prototype.init = function() {\n return this._ah = 1779033703, this._bh = 3144134277, this._ch = 1013904242, this._dh = 2773480762, this._eh = 1359893119, this._fh = 2600822924, this._gh = 528734635, this._hh = 1541459225, this._al = 4089235720, this._bl = 2227873595, this._cl = 4271175723, this._dl = 1595750129, this._el = 2917565137, this._fl = 725511199, this._gl = 4215389547, this._hl = 327033209, this;\n };\n function Ch(x, y, z) {\n return z ^ x & (y ^ z);\n }\n function maj(x, y, z) {\n return x & y | z & (x | y);\n }\n function sigma0(x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25);\n }\n function sigma1(x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23);\n }\n function Gamma0(x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ x >>> 7;\n }\n function Gamma0l(x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25);\n }\n function Gamma1(x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ x >>> 6;\n }\n function Gamma1l(x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26);\n }\n function getCarry(a, b) {\n return a >>> 0 < b >>> 0 \? 1 : 0;\n }\n Sha512.prototype._update = function(M) {\n for (var W2 = this._w, ah = this._ah | 0, bh = this._bh | 0, ch = this._ch | 0, dh = this._dh | 0, eh = this._eh | 0, fh = this._fh | 0, gh = this._gh | 0, hh = this._hh | 0, al = this._al | 0, bl = this._bl | 0, cl = this._cl | 0, dl = this._dl | 0, el = this._el | 0, fl = this._fl | 0, gl = this._gl | 0, hl = this._hl | 0, i = 0;i < 32; i += 2)\n W2[i] = M.readInt32BE(i * 4), W2[i + 1] = M.readInt32BE(i * 4 + 4);\n for (;i < 160; i += 2) {\n var xh = W2[i - 30], xl = W2[i - 30 + 1], gamma0 = Gamma0(xh, xl), gamma0l = Gamma0l(xl, xh);\n xh = W2[i - 4], xl = W2[i - 4 + 1];\n var gamma1 = Gamma1(xh, xl), gamma1l = Gamma1l(xl, xh), Wi7h = W2[i - 14], Wi7l = W2[i - 14 + 1], Wi16h = W2[i - 32], Wi16l = W2[i - 32 + 1], Wil = gamma0l + Wi7l | 0, Wih = gamma0 + Wi7h + getCarry(Wil, gamma0l) | 0;\n Wil = Wil + gamma1l | 0, Wih = Wih + gamma1 + getCarry(Wil, gamma1l) | 0, Wil = Wil + Wi16l | 0, Wih = Wih + Wi16h + getCarry(Wil, Wi16l) | 0, W2[i] = Wih, W2[i + 1] = Wil;\n }\n for (var j = 0;j < 160; j += 2) {\n Wih = W2[j], Wil = W2[j + 1];\n var majh = maj(ah, bh, ch), majl = maj(al, bl, cl), sigma0h = sigma0(ah, al), sigma0l = sigma0(al, ah), sigma1h = sigma1(eh, el), sigma1l = sigma1(el, eh), Kih = K[j], Kil = K[j + 1], chh = Ch(eh, fh, gh), chl = Ch(el, fl, gl), t1l = hl + sigma1l | 0, t1h = hh + sigma1h + getCarry(t1l, hl) | 0;\n t1l = t1l + chl | 0, t1h = t1h + chh + getCarry(t1l, chl) | 0, t1l = t1l + Kil | 0, t1h = t1h + Kih + getCarry(t1l, Kil) | 0, t1l = t1l + Wil | 0, t1h = t1h + Wih + getCarry(t1l, Wil) | 0;\n var t2l = sigma0l + majl | 0, t2h = sigma0h + majh + getCarry(t2l, sigma0l) | 0;\n hh = gh, hl = gl, gh = fh, gl = fl, fh = eh, fl = el, el = dl + t1l | 0, eh = dh + t1h + getCarry(el, dl) | 0, dh = ch, dl = cl, ch = bh, cl = bl, bh = ah, bl = al, al = t1l + t2l | 0, ah = t1h + t2h + getCarry(al, t1l) | 0;\n }\n this._al = this._al + al | 0, this._bl = this._bl + bl | 0, this._cl = this._cl + cl | 0, this._dl = this._dl + dl | 0, this._el = this._el + el | 0, this._fl = this._fl + fl | 0, this._gl = this._gl + gl | 0, this._hl = this._hl + hl | 0, this._ah = this._ah + ah + getCarry(this._al, al) | 0, this._bh = this._bh + bh + getCarry(this._bl, bl) | 0, this._ch = this._ch + ch + getCarry(this._cl, cl) | 0, this._dh = this._dh + dh + getCarry(this._dl, dl) | 0, this._eh = this._eh + eh + getCarry(this._el, el) | 0, this._fh = this._fh + fh + getCarry(this._fl, fl) | 0, this._gh = this._gh + gh + getCarry(this._gl, gl) | 0, this._hh = this._hh + hh + getCarry(this._hl, hl) | 0;\n }, Sha512.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(64);\n function writeInt64BE(h, l, offset) {\n H.writeInt32BE(h, offset), H.writeInt32BE(l, offset + 4);\n }\n return writeInt64BE(this._ah, this._al, 0), writeInt64BE(this._bh, this._bl, 8), writeInt64BE(this._ch, this._cl, 16), writeInt64BE(this._dh, this._dl, 24), writeInt64BE(this._eh, this._el, 32), writeInt64BE(this._fh, this._fl, 40), writeInt64BE(this._gh, this._gl, 48), writeInt64BE(this._hh, this._hl, 56), H;\n }, module.exports = Sha512;\n }\n}), require_sha384 = __commonJS({\n \"node_modules/sha.js/sha384.js\"(exports, module) {\n var inherits = require_inherits_browser(), SHA512 = require_sha512(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, W = new Array(160);\n function Sha384() {\n this.init(), this._w = W, Hash.call(this, 128, 112);\n }\n inherits(Sha384, SHA512), Sha384.prototype.init = function() {\n return this._ah = 3418070365, this._bh = 1654270250, this._ch = 2438529370, this._dh = 355462360, this._eh = 1731405415, this._fh = 2394180231, this._gh = 3675008525, this._hh = 1203062813, this._al = 3238371032, this._bl = 914150663, this._cl = 812702999, this._dl = 4144912697, this._el = 4290775857, this._fl = 1750603025, this._gl = 1694076839, this._hl = 3204075428, this;\n }, Sha384.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(48);\n function writeInt64BE(h, l, offset) {\n H.writeInt32BE(h, offset), H.writeInt32BE(l, offset + 4);\n }\n return writeInt64BE(this._ah, this._al, 0), writeInt64BE(this._bh, this._bl, 8), writeInt64BE(this._ch, this._cl, 16), writeInt64BE(this._dh, this._dl, 24), writeInt64BE(this._eh, this._el, 32), writeInt64BE(this._fh, this._fl, 40), H;\n }, module.exports = Sha384;\n }\n}), require_sha2 = __commonJS({\n \"node_modules/sha.js/index.js\"(exports, module) {\n var exports = module.exports = function(algorithm) {\n algorithm = algorithm.toLowerCase();\n var Algorithm = exports[algorithm];\n if (!Algorithm)\n throw new Error(algorithm + \" is not supported (we accept pull requests)\");\n return new Algorithm;\n };\n exports.sha = require_sha(), exports.sha1 = require_sha1(), exports.sha224 = require_sha224(), exports.sha256 = require_sha256(), exports.sha384 = require_sha384(), exports.sha512 = require_sha512();\n }\n}), require_cipher_base = __commonJS({\n \"node_modules/cipher-base/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, inherits = require_inherits_browser();\n function CipherBase(hashMode) {\n StreamModule.Transform.call(this), this.hashMode = typeof hashMode == \"string\", this.hashMode \? this[hashMode] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null;\n }\n inherits(CipherBase, StreamModule.Transform), CipherBase.prototype.update = function(data, inputEnc, outputEnc) {\n typeof data == \"string\" && (data = Buffer2.from(data, inputEnc));\n var outData = this._update(data);\n return this.hashMode \? this : (outputEnc && (outData = this._toString(outData, outputEnc)), outData);\n }, CipherBase.prototype.setAutoPadding = function() {\n }, CipherBase.prototype.getAuthTag = function() {\n throw new Error(\"trying to get auth tag in unsupported state\");\n }, CipherBase.prototype.setAuthTag = function() {\n throw new Error(\"trying to set auth tag in unsupported state\");\n }, CipherBase.prototype.setAAD = function() {\n throw new Error(\"trying to set aad in unsupported state\");\n }, CipherBase.prototype._transform = function(data, _, next) {\n var err;\n try {\n this.hashMode \? this._update(data) : this.push(this._update(data));\n } catch (e) {\n err = e;\n } finally {\n next(err);\n }\n }, CipherBase.prototype._flush = function(done) {\n var err;\n try {\n this.push(this.__final());\n } catch (e) {\n err = e;\n }\n done(err);\n }, CipherBase.prototype._finalOrDigest = function(outputEnc) {\n var outData = this.__final() || Buffer2.alloc(0);\n return outputEnc && (outData = this._toString(outData, outputEnc, !0)), outData;\n }, CipherBase.prototype._toString = function(value, enc, fin) {\n if (this._decoder || (this._decoder = new StringDecoder(enc), this._encoding = enc), this._encoding !== enc)\n throw new Error(\"can't switch encodings\");\n var out = this._decoder.write(value);\n return fin && (out += this._decoder.end()), out;\n }, module.exports = CipherBase;\n }\n}), require_browser2 = __commonJS({\n \"node_modules/create-hash/browser.js\"(exports, module) {\n const LazyHash = function Hash(algorithm, options) {\n this._options = options, this._hasher = new CryptoHasher(algorithm, options), this._finalized = !1;\n };\n LazyHash.prototype = Object.create(StreamModule.Transform.prototype), LazyHash.prototype.update = function update(data, encoding) {\n return this._checkFinalized(), this._hasher.update(data, encoding), this;\n }, LazyHash.prototype.digest = function update(data, encoding) {\n return this._checkFinalized(), this._finalized = !0, this._hasher.digest(data, encoding);\n }, LazyHash.prototype._checkFinalized = function _checkFinalized() {\n if (this._finalized) {\n var err = new Error(\"Digest already called\");\n throw err.code = \"ERR_CRYPTO_HASH_FINALIZED\", err;\n }\n }, LazyHash.prototype.copy = function copy() {\n const copy = Object.create(LazyHash.prototype);\n return copy._options = this._options, copy._hasher = this._hasher.copy(), copy._finalized = this._finalized, copy;\n };\n const lazyHashFullInitProto = {\n __proto__: StreamModule.Transform.prototype,\n ...LazyHash.prototype,\n _transform(data, encoding, callback) {\n this.update(data, encoding), callback && callback();\n },\n _flush(callback) {\n this.push(this.digest()), callback();\n }\n }, triggerMethods = [\n \"_events\",\n \"_eventsCount\",\n \"_final\",\n \"_maxListeners\",\n \"_maxListeners\",\n \"_read\",\n \"_undestroy\",\n \"_writableState\",\n \"_write\",\n \"_writev\",\n \"addListener\",\n \"asIndexedPairs\",\n \"closed\",\n \"compose\",\n \"constructor\",\n \"cork\",\n \"destroy\",\n \"destroyed\",\n \"drop\",\n \"emit\",\n \"end\",\n \"errored\",\n \"eventNames\",\n \"every\",\n \"filter\",\n \"find\",\n \"flatMap\",\n \"forEach\",\n \"getMaxListeners\",\n \"hasOwnProperty\",\n \"isPaused\",\n \"isPrototypeOf\",\n \"iterator\",\n \"listenerCount\",\n \"listeners\",\n \"map\",\n \"off\",\n \"on\",\n \"once\",\n \"pause\",\n \"pipe\",\n \"prependListener\",\n \"prependOnceListener\",\n \"propertyIsEnumerable\",\n \"push\",\n \"rawListeners\",\n \"read\",\n \"readable\",\n \"readableAborted\",\n \"readableBuffer\",\n \"readableDidRead\",\n \"readableEncoding\",\n \"readableEnded\",\n \"readableFlowing\",\n \"readableHighWaterMark\",\n \"readableLength\",\n \"readableObjectMode\",\n \"reduce\",\n \"removeAllListeners\",\n \"removeListener\",\n \"resume\",\n \"setDefaultEncoding\",\n \"setEncoding\",\n \"setMaxListeners\",\n \"some\",\n \"take\",\n \"toArray\",\n \"toLocaleString\",\n \"toString\",\n \"uncork\",\n \"unpipe\",\n \"unshift\",\n \"valueOf\",\n \"wrap\",\n \"writable\",\n \"writableBuffer\",\n \"writableCorked\",\n \"writableEnded\",\n \"writableFinished\",\n \"writableHighWaterMark\",\n \"writableLength\",\n \"writableNeedDrain\",\n \"writableObjectMode\",\n \"write\"\n ];\n for (let method of triggerMethods)\n Object.defineProperty(LazyHash.prototype, method, {\n get() {\n return Object.setPrototypeOf(this, lazyHashFullInitProto), StreamModule.Transform.call(this, this._options), this[method];\n },\n enumerable: !1,\n configurable: !0\n });\n module.exports = function createHash(algorithm) {\n return new LazyHash(algorithm);\n }, module.exports.createHash = module.exports, module.exports.Hash = LazyHash;\n }\n}), require_legacy = __commonJS({\n \"node_modules/create-hmac/legacy.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safe_buffer().Buffer, Base = require_cipher_base(), ZEROS = Buffer2.alloc(128), blocksize = 64;\n function Hmac(alg, key) {\n Base.call(this, \"digest\"), typeof key == \"string\" && (key = Buffer2.from(key)), this._alg = alg, this._key = key, key.length > blocksize \? key = alg(key) : key.length < blocksize && (key = Buffer2.concat([key, ZEROS], blocksize));\n for (var ipad = this._ipad = Buffer2.allocUnsafe(blocksize), opad = this._opad = Buffer2.allocUnsafe(blocksize), i = 0;i < blocksize; i++)\n ipad[i] = key[i] ^ 54, opad[i] = key[i] ^ 92;\n this._hash = [ipad];\n }\n Hmac.prototype = {}, inherits(Hmac, Base), Hmac.prototype._update = function(data) {\n this._hash.push(data);\n }, Hmac.prototype._final = function() {\n var h = this._alg(Buffer2.concat(this._hash));\n return this._alg(Buffer2.concat([this._opad, h]));\n }, module.exports = Hmac;\n }\n}), require_md52 = __commonJS({\n \"node_modules/create-hash/md5.js\"(exports, module) {\n var MD5 = require_md5();\n module.exports = function(buffer) {\n return new MD5().update(buffer).digest();\n };\n }\n}), require_browser3 = __commonJS({\n \"node_modules/create-hmac/browser.js\"(exports, module) {\n var inherits = require_inherits_browser(), Legacy = require_legacy(), Base = require_cipher_base(), Buffer2 = require_safe_buffer().Buffer, md5 = require_md52(), RIPEMD160 = require_ripemd160(), sha = require_sha2(), ZEROS = Buffer2.alloc(128);\n function Hmac(alg, key) {\n Base.call(this, \"digest\"), typeof key == \"string\" && (key = Buffer2.from(key));\n var blocksize = alg === \"sha512\" || alg === \"sha384\" \? 128 : 64;\n if (this._alg = alg, this._key = key, key.length > blocksize) {\n var hash = alg === \"rmd160\" \? new RIPEMD160 : sha(alg);\n key = hash.update(key).digest();\n } else\n key.length < blocksize && (key = Buffer2.concat([key, ZEROS], blocksize));\n for (var ipad = this._ipad = Buffer2.allocUnsafe(blocksize), opad = this._opad = Buffer2.allocUnsafe(blocksize), i = 0;i < blocksize; i++)\n ipad[i] = key[i] ^ 54, opad[i] = key[i] ^ 92;\n this._hash = alg === \"rmd160\" \? new RIPEMD160 : sha(alg), this._hash.update(ipad);\n }\n inherits(Hmac, Base), Hmac.prototype._update = function(data) {\n this._hash.update(data);\n }, Hmac.prototype._final = function() {\n var h = this._hash.digest(), hash = this._alg === \"rmd160\" \? new RIPEMD160 : sha(this._alg);\n return hash.update(this._opad).update(h).digest();\n }, module.exports = function(alg, key) {\n return alg = alg.toLowerCase(), alg === \"rmd160\" || alg === \"ripemd160\" \? new Hmac(\"rmd160\", key) : alg === \"md5\" \? new Legacy(md5, key) : new Hmac(alg, key);\n };\n }\n}), require_algorithms = __commonJS({\n \"node_modules/browserify-sign/browser/algorithms.json\"(exports, module) {\n module.exports = {\n sha224WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha224\",\n id: \"302d300d06096086480165030402040500041c\"\n },\n \"RSA-SHA224\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha224\",\n id: \"302d300d06096086480165030402040500041c\"\n },\n sha256WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha256\",\n id: \"3031300d060960864801650304020105000420\"\n },\n \"RSA-SHA256\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha256\",\n id: \"3031300d060960864801650304020105000420\"\n },\n sha384WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha384\",\n id: \"3041300d060960864801650304020205000430\"\n },\n \"RSA-SHA384\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha384\",\n id: \"3041300d060960864801650304020205000430\"\n },\n sha512WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha512\",\n id: \"3051300d060960864801650304020305000440\"\n },\n \"RSA-SHA512\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha512\",\n id: \"3051300d060960864801650304020305000440\"\n },\n \"RSA-SHA1\": {\n sign: \"rsa\",\n hash: \"sha1\",\n id: \"3021300906052b0e03021a05000414\"\n },\n \"ecdsa-with-SHA1\": {\n sign: \"ecdsa\",\n hash: \"sha1\",\n id: \"\"\n },\n sha256: {\n sign: \"ecdsa\",\n hash: \"sha256\",\n id: \"\"\n },\n sha224: {\n sign: \"ecdsa\",\n hash: \"sha224\",\n id: \"\"\n },\n sha384: {\n sign: \"ecdsa\",\n hash: \"sha384\",\n id: \"\"\n },\n sha512: {\n sign: \"ecdsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-SHA\": {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n \"DSA-SHA1\": {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n DSA: {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n \"DSA-WITH-SHA224\": {\n sign: \"dsa\",\n hash: \"sha224\",\n id: \"\"\n },\n \"DSA-SHA224\": {\n sign: \"dsa\",\n hash: \"sha224\",\n id: \"\"\n },\n \"DSA-WITH-SHA256\": {\n sign: \"dsa\",\n hash: \"sha256\",\n id: \"\"\n },\n \"DSA-SHA256\": {\n sign: \"dsa\",\n hash: \"sha256\",\n id: \"\"\n },\n \"DSA-WITH-SHA384\": {\n sign: \"dsa\",\n hash: \"sha384\",\n id: \"\"\n },\n \"DSA-SHA384\": {\n sign: \"dsa\",\n hash: \"sha384\",\n id: \"\"\n },\n \"DSA-WITH-SHA512\": {\n sign: \"dsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-SHA512\": {\n sign: \"dsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-RIPEMD160\": {\n sign: \"dsa\",\n hash: \"rmd160\",\n id: \"\"\n },\n ripemd160WithRSA: {\n sign: \"rsa\",\n hash: \"rmd160\",\n id: \"3021300906052b2403020105000414\"\n },\n \"RSA-RIPEMD160\": {\n sign: \"rsa\",\n hash: \"rmd160\",\n id: \"3021300906052b2403020105000414\"\n },\n md5WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"md5\",\n id: \"3020300c06082a864886f70d020505000410\"\n },\n \"RSA-MD5\": {\n sign: \"rsa\",\n hash: \"md5\",\n id: \"3020300c06082a864886f70d020505000410\"\n }\n };\n }\n}), require_algos = __commonJS({\n \"node_modules/browserify-sign/algos.js\"(exports, module) {\n module.exports = require_algorithms();\n }\n}), require_precondition = __commonJS({\n \"node_modules/pbkdf2/lib/precondition.js\"(exports, module) {\n var MAX_ALLOC = Math.pow(2, 30) - 1;\n module.exports = function(iterations, keylen) {\n if (typeof iterations != \"number\")\n @throwTypeError(\"Iterations not a number\");\n if (iterations < 0)\n @throwTypeError(\"Bad iterations\");\n if (typeof keylen != \"number\")\n @throwTypeError(\"Key length not a number\");\n if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen)\n @throwTypeError(\"Bad key length\");\n };\n }\n}), require_default_encoding = __commonJS({\n \"node_modules/pbkdf2/lib/default-encoding.js\"(exports, module) {\n var defaultEncoding;\n global.process && global.process.browser \? defaultEncoding = \"utf-8\" : global.process && global.process.version \? (pVersionMajor = parseInt(process.version.split(\".\")[0].slice(1), 10), defaultEncoding = pVersionMajor >= 6 \? \"utf-8\" : \"binary\") : defaultEncoding = \"utf-8\";\n var pVersionMajor;\n module.exports = defaultEncoding;\n }\n}), require_to_buffer = __commonJS({\n \"node_modules/pbkdf2/lib/to-buffer.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(thing, encoding, name) {\n if (Buffer2.isBuffer(thing))\n return thing;\n if (typeof thing == \"string\")\n return Buffer2.from(thing, encoding);\n if (ArrayBuffer.isView(thing))\n return Buffer2.from(thing.buffer);\n @throwTypeError(name + \" must be a string, a Buffer, a typed array or a DataView\");\n };\n }\n}), require_sync_browser = __commonJS({\n \"node_modules/pbkdf2/lib/sync-browser.js\"(exports, module) {\n var md5 = require_md52(), RIPEMD160 = require_ripemd160(), sha = require_sha2(), Buffer2 = require_safe_buffer().Buffer, checkParameters = require_precondition(), defaultEncoding = require_default_encoding(), toBuffer = require_to_buffer(), ZEROS = Buffer2.alloc(128), sizes = {\n md5: 16,\n sha1: 20,\n sha224: 28,\n sha256: 32,\n sha384: 48,\n sha512: 64,\n rmd160: 20,\n ripemd160: 20\n };\n function Hmac(alg, key, saltLen) {\n var hash = getDigest(alg), blocksize = alg === \"sha512\" || alg === \"sha384\" \? 128 : 64;\n key.length > blocksize \? key = hash(key) : key.length < blocksize && (key = Buffer2.concat([key, ZEROS], blocksize));\n for (var ipad = Buffer2.allocUnsafe(blocksize + sizes[alg]), opad = Buffer2.allocUnsafe(blocksize + sizes[alg]), i = 0;i < blocksize; i++)\n ipad[i] = key[i] ^ 54, opad[i] = key[i] ^ 92;\n var ipad1 = Buffer2.allocUnsafe(blocksize + saltLen + 4);\n ipad.copy(ipad1, 0, 0, blocksize), this.ipad1 = ipad1, this.ipad2 = ipad, this.opad = opad, this.alg = alg, this.blocksize = blocksize, this.hash = hash, this.size = sizes[alg];\n }\n Hmac.prototype = {}, Hmac.prototype.run = function(data, ipad) {\n data.copy(ipad, this.blocksize);\n var h = this.hash(ipad);\n return h.copy(this.opad, this.blocksize), this.hash(this.opad);\n };\n function getDigest(alg) {\n function shaFunc(data) {\n return sha(alg).update(data).digest();\n }\n function rmd160Func(data) {\n return new RIPEMD160().update(data).digest();\n }\n return alg === \"rmd160\" || alg === \"ripemd160\" \? rmd160Func : alg === \"md5\" \? md5 : shaFunc;\n }\n function pbkdf2(password, salt, iterations, keylen, digest) {\n checkParameters(iterations, keylen), password = toBuffer(password, defaultEncoding, \"Password\"), salt = toBuffer(salt, defaultEncoding, \"Salt\"), digest = digest || \"sha1\";\n var hmac = new Hmac(digest, password, salt.length), DK = Buffer2.allocUnsafe(keylen), block1 = Buffer2.allocUnsafe(salt.length + 4);\n salt.copy(block1, 0, 0, salt.length);\n for (var destPos = 0, hLen = sizes[digest], l = Math.ceil(keylen / hLen), i = 1;i <= l; i++) {\n block1.writeUInt32BE(i, salt.length);\n for (var T = hmac.run(block1, hmac.ipad1), U = T, j = 1;j < iterations; j++) {\n U = hmac.run(U, hmac.ipad2);\n for (var k = 0;k < hLen; k++)\n T[k] ^= U[k];\n }\n T.copy(DK, destPos), destPos += hLen;\n }\n return DK;\n }\n module.exports = pbkdf2;\n }\n}), require_async = __commonJS({\n \"node_modules/pbkdf2/lib/async.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, checkParameters = require_precondition(), defaultEncoding = require_default_encoding(), sync = require_sync_browser(), toBuffer = require_to_buffer(), ZERO_BUF, subtle = globalCrypto.subtle, toBrowser = {\n sha: \"SHA-1\",\n \"sha-1\": \"SHA-1\",\n sha1: \"SHA-1\",\n sha256: \"SHA-256\",\n \"sha-256\": \"SHA-256\",\n sha384: \"SHA-384\",\n \"sha-384\": \"SHA-384\",\n \"sha-512\": \"SHA-512\",\n sha512: \"SHA-512\"\n }, checks = [];\n function checkNative(algo) {\n if (global.process && !global.process.browser || !subtle || !subtle.importKey || !subtle.deriveBits)\n return Promise.resolve(!1);\n if (checks[algo] !== void 0)\n return checks[algo];\n ZERO_BUF = ZERO_BUF || Buffer2.alloc(8);\n var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo).then(function() {\n return !0;\n }).catch(function() {\n return !1;\n });\n return checks[algo] = prom, prom;\n }\n var nextTick;\n function getNextTick() {\n return nextTick || (global.process && global.process.nextTick \? nextTick = global.process.nextTick : global.queueMicrotask \? nextTick = global.queueMicrotask : global.setImmediate \? nextTick = global.setImmediate : nextTick = global.setTimeout, nextTick);\n }\n function browserPbkdf2(password, salt, iterations, length, algo) {\n return subtle.importKey(\"raw\", password, { name: \"PBKDF2\" }, !1, [\"deriveBits\"]).then(function(key) {\n return subtle.deriveBits({\n name: \"PBKDF2\",\n salt,\n iterations,\n hash: {\n name: algo\n }\n }, key, length << 3);\n }).then(function(res) {\n return Buffer2.from(res);\n });\n }\n function resolvePromise(promise, callback) {\n promise.then(function(out) {\n getNextTick()(function() {\n callback(null, out);\n });\n }, function(e) {\n getNextTick()(function() {\n callback(e);\n });\n });\n }\n module.exports = function(password, salt, iterations, keylen, digest, callback) {\n typeof digest == \"function\" && (callback = digest, digest = void 0), digest = digest || \"sha1\";\n var algo = toBrowser[digest.toLowerCase()];\n if (!algo || typeof global.Promise != \"function\") {\n getNextTick()(function() {\n var out;\n try {\n out = sync(password, salt, iterations, keylen, digest);\n } catch (e) {\n return callback(e);\n }\n callback(null, out);\n });\n return;\n }\n if (checkParameters(iterations, keylen), password = toBuffer(password, defaultEncoding, \"Password\"), salt = toBuffer(salt, defaultEncoding, \"Salt\"), typeof callback != \"function\")\n throw new Error(\"No callback provided to pbkdf2\");\n resolvePromise(checkNative(algo).then(function(resp) {\n return resp \? browserPbkdf2(password, salt, iterations, keylen, algo) : sync(password, salt, iterations, keylen, digest);\n }), callback);\n };\n }\n}), require_browser4 = __commonJS({\n \"node_modules/pbkdf2/browser.js\"(exports) {\n exports.pbkdf2 = require_async(), exports.pbkdf2Sync = require_sync_browser();\n }\n}), require_utils = __commonJS({\n \"node_modules/des.js/lib/des/utils.js\"(exports) {\n exports.readUInt32BE = function(bytes, off) {\n var res = bytes[0 + off] << 24 | bytes[1 + off] << 16 | bytes[2 + off] << 8 | bytes[3 + off];\n return res >>> 0;\n }, exports.writeUInt32BE = function(bytes, value, off) {\n bytes[0 + off] = value >>> 24, bytes[1 + off] = value >>> 16 & 255, bytes[2 + off] = value >>> 8 & 255, bytes[3 + off] = value & 255;\n }, exports.ip = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 6;i >= 0; i -= 2) {\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >>> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inL >>> j + i & 1;\n }\n for (var i = 6;i >= 0; i -= 2) {\n for (var j = 1;j <= 25; j += 8)\n outR <<= 1, outR |= inR >>> j + i & 1;\n for (var j = 1;j <= 25; j += 8)\n outR <<= 1, outR |= inL >>> j + i & 1;\n }\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.rip = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 0;i < 4; i++)\n for (var j = 24;j >= 0; j -= 8)\n outL <<= 1, outL |= inR >>> j + i & 1, outL <<= 1, outL |= inL >>> j + i & 1;\n for (var i = 4;i < 8; i++)\n for (var j = 24;j >= 0; j -= 8)\n outR <<= 1, outR |= inR >>> j + i & 1, outR <<= 1, outR |= inL >>> j + i & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.pc1 = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 7;i >= 5; i--) {\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inL >> j + i & 1;\n }\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >> j + i & 1;\n for (var i = 1;i <= 3; i++) {\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inR >> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inL >> j + i & 1;\n }\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inL >> j + i & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.r28shl = function(num, shift) {\n return num << shift & 268435455 | num >>> 28 - shift;\n };\n var pc2table = [\n 14,\n 11,\n 17,\n 4,\n 27,\n 23,\n 25,\n 0,\n 13,\n 22,\n 7,\n 18,\n 5,\n 9,\n 16,\n 24,\n 2,\n 20,\n 12,\n 21,\n 1,\n 8,\n 15,\n 26,\n 15,\n 4,\n 25,\n 19,\n 9,\n 1,\n 26,\n 16,\n 5,\n 11,\n 23,\n 8,\n 12,\n 7,\n 17,\n 0,\n 22,\n 3,\n 10,\n 14,\n 6,\n 20,\n 27,\n 24\n ];\n exports.pc2 = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, len = pc2table.length >>> 1, i = 0;i < len; i++)\n outL <<= 1, outL |= inL >>> pc2table[i] & 1;\n for (var i = len;i < pc2table.length; i++)\n outR <<= 1, outR |= inR >>> pc2table[i] & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.expand = function(r, out, off) {\n var outL = 0, outR = 0;\n outL = (r & 1) << 5 | r >>> 27;\n for (var i = 23;i >= 15; i -= 4)\n outL <<= 6, outL |= r >>> i & 63;\n for (var i = 11;i >= 3; i -= 4)\n outR |= r >>> i & 63, outR <<= 6;\n outR |= (r & 31) << 1 | r >>> 31, out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n };\n var sTable = [\n 14,\n 0,\n 4,\n 15,\n 13,\n 7,\n 1,\n 4,\n 2,\n 14,\n 15,\n 2,\n 11,\n 13,\n 8,\n 1,\n 3,\n 10,\n 10,\n 6,\n 6,\n 12,\n 12,\n 11,\n 5,\n 9,\n 9,\n 5,\n 0,\n 3,\n 7,\n 8,\n 4,\n 15,\n 1,\n 12,\n 14,\n 8,\n 8,\n 2,\n 13,\n 4,\n 6,\n 9,\n 2,\n 1,\n 11,\n 7,\n 15,\n 5,\n 12,\n 11,\n 9,\n 3,\n 7,\n 14,\n 3,\n 10,\n 10,\n 0,\n 5,\n 6,\n 0,\n 13,\n 15,\n 3,\n 1,\n 13,\n 8,\n 4,\n 14,\n 7,\n 6,\n 15,\n 11,\n 2,\n 3,\n 8,\n 4,\n 14,\n 9,\n 12,\n 7,\n 0,\n 2,\n 1,\n 13,\n 10,\n 12,\n 6,\n 0,\n 9,\n 5,\n 11,\n 10,\n 5,\n 0,\n 13,\n 14,\n 8,\n 7,\n 10,\n 11,\n 1,\n 10,\n 3,\n 4,\n 15,\n 13,\n 4,\n 1,\n 2,\n 5,\n 11,\n 8,\n 6,\n 12,\n 7,\n 6,\n 12,\n 9,\n 0,\n 3,\n 5,\n 2,\n 14,\n 15,\n 9,\n 10,\n 13,\n 0,\n 7,\n 9,\n 0,\n 14,\n 9,\n 6,\n 3,\n 3,\n 4,\n 15,\n 6,\n 5,\n 10,\n 1,\n 2,\n 13,\n 8,\n 12,\n 5,\n 7,\n 14,\n 11,\n 12,\n 4,\n 11,\n 2,\n 15,\n 8,\n 1,\n 13,\n 1,\n 6,\n 10,\n 4,\n 13,\n 9,\n 0,\n 8,\n 6,\n 15,\n 9,\n 3,\n 8,\n 0,\n 7,\n 11,\n 4,\n 1,\n 15,\n 2,\n 14,\n 12,\n 3,\n 5,\n 11,\n 10,\n 5,\n 14,\n 2,\n 7,\n 12,\n 7,\n 13,\n 13,\n 8,\n 14,\n 11,\n 3,\n 5,\n 0,\n 6,\n 6,\n 15,\n 9,\n 0,\n 10,\n 3,\n 1,\n 4,\n 2,\n 7,\n 8,\n 2,\n 5,\n 12,\n 11,\n 1,\n 12,\n 10,\n 4,\n 14,\n 15,\n 9,\n 10,\n 3,\n 6,\n 15,\n 9,\n 0,\n 0,\n 6,\n 12,\n 10,\n 11,\n 1,\n 7,\n 13,\n 13,\n 8,\n 15,\n 9,\n 1,\n 4,\n 3,\n 5,\n 14,\n 11,\n 5,\n 12,\n 2,\n 7,\n 8,\n 2,\n 4,\n 14,\n 2,\n 14,\n 12,\n 11,\n 4,\n 2,\n 1,\n 12,\n 7,\n 4,\n 10,\n 7,\n 11,\n 13,\n 6,\n 1,\n 8,\n 5,\n 5,\n 0,\n 3,\n 15,\n 15,\n 10,\n 13,\n 3,\n 0,\n 9,\n 14,\n 8,\n 9,\n 6,\n 4,\n 11,\n 2,\n 8,\n 1,\n 12,\n 11,\n 7,\n 10,\n 1,\n 13,\n 14,\n 7,\n 2,\n 8,\n 13,\n 15,\n 6,\n 9,\n 15,\n 12,\n 0,\n 5,\n 9,\n 6,\n 10,\n 3,\n 4,\n 0,\n 5,\n 14,\n 3,\n 12,\n 10,\n 1,\n 15,\n 10,\n 4,\n 15,\n 2,\n 9,\n 7,\n 2,\n 12,\n 6,\n 9,\n 8,\n 5,\n 0,\n 6,\n 13,\n 1,\n 3,\n 13,\n 4,\n 14,\n 14,\n 0,\n 7,\n 11,\n 5,\n 3,\n 11,\n 8,\n 9,\n 4,\n 14,\n 3,\n 15,\n 2,\n 5,\n 12,\n 2,\n 9,\n 8,\n 5,\n 12,\n 15,\n 3,\n 10,\n 7,\n 11,\n 0,\n 14,\n 4,\n 1,\n 10,\n 7,\n 1,\n 6,\n 13,\n 0,\n 11,\n 8,\n 6,\n 13,\n 4,\n 13,\n 11,\n 0,\n 2,\n 11,\n 14,\n 7,\n 15,\n 4,\n 0,\n 9,\n 8,\n 1,\n 13,\n 10,\n 3,\n 14,\n 12,\n 3,\n 9,\n 5,\n 7,\n 12,\n 5,\n 2,\n 10,\n 15,\n 6,\n 8,\n 1,\n 6,\n 1,\n 6,\n 4,\n 11,\n 11,\n 13,\n 13,\n 8,\n 12,\n 1,\n 3,\n 4,\n 7,\n 10,\n 14,\n 7,\n 10,\n 9,\n 15,\n 5,\n 6,\n 0,\n 8,\n 15,\n 0,\n 14,\n 5,\n 2,\n 9,\n 3,\n 2,\n 12,\n 13,\n 1,\n 2,\n 15,\n 8,\n 13,\n 4,\n 8,\n 6,\n 10,\n 15,\n 3,\n 11,\n 7,\n 1,\n 4,\n 10,\n 12,\n 9,\n 5,\n 3,\n 6,\n 14,\n 11,\n 5,\n 0,\n 0,\n 14,\n 12,\n 9,\n 7,\n 2,\n 7,\n 2,\n 11,\n 1,\n 4,\n 14,\n 1,\n 7,\n 9,\n 4,\n 12,\n 10,\n 14,\n 8,\n 2,\n 13,\n 0,\n 15,\n 6,\n 12,\n 10,\n 9,\n 13,\n 0,\n 15,\n 3,\n 3,\n 5,\n 5,\n 6,\n 8,\n 11\n ];\n exports.substitute = function(inL, inR) {\n for (var out = 0, i = 0;i < 4; i++) {\n var b = inL >>> 18 - i * 6 & 63, sb = sTable[i * 64 + b];\n out <<= 4, out |= sb;\n }\n for (var i = 0;i < 4; i++) {\n var b = inR >>> 18 - i * 6 & 63, sb = sTable[256 + i * 64 + b];\n out <<= 4, out |= sb;\n }\n return out >>> 0;\n };\n var permuteTable = [\n 16,\n 25,\n 12,\n 11,\n 3,\n 20,\n 4,\n 15,\n 31,\n 17,\n 9,\n 6,\n 27,\n 14,\n 1,\n 22,\n 30,\n 24,\n 8,\n 18,\n 0,\n 5,\n 29,\n 23,\n 13,\n 19,\n 2,\n 26,\n 10,\n 21,\n 28,\n 7\n ];\n exports.permute = function(num) {\n for (var out = 0, i = 0;i < permuteTable.length; i++)\n out <<= 1, out |= num >>> permuteTable[i] & 1;\n return out >>> 0;\n }, exports.padSplit = function(num, size, group) {\n for (var str = num.toString(2);str.length < size; )\n str = \"0\" + str;\n for (var out = [], i = 0;i < size; i += group)\n out.push(str.slice(i, i + group));\n return out.join(\" \");\n };\n }\n}), require_minimalistic_assert = __commonJS({\n \"node_modules/minimalistic-assert/index.js\"(exports, module) {\n module.exports = assert;\n function assert(val, msg) {\n if (!val)\n throw new Error(msg || \"Assertion failed\");\n }\n assert.equal = function(l, r, msg) {\n if (l != r)\n throw new Error(msg || \"Assertion failed: \" + l + \" != \" + r);\n };\n }\n}), require_cipher = __commonJS({\n \"node_modules/des.js/lib/des/cipher.js\"(exports, module) {\n var assert = require_minimalistic_assert();\n function Cipher(options) {\n this.options = options, this.type = this.options.type, this.blockSize = 8, this._init(), this.buffer = new Array(this.blockSize), this.bufferOff = 0;\n }\n Cipher.prototype = {}, module.exports = Cipher, Cipher.prototype._init = function() {\n }, Cipher.prototype.update = function(data) {\n return data.length === 0 \? [] : this.type === \"decrypt\" \? this._updateDecrypt(data) : this._updateEncrypt(data);\n }, Cipher.prototype._buffer = function(data, off) {\n for (var min = Math.min(this.buffer.length - this.bufferOff, data.length - off), i = 0;i < min; i++)\n this.buffer[this.bufferOff + i] = data[off + i];\n return this.bufferOff += min, min;\n }, Cipher.prototype._flushBuffer = function(out, off) {\n return this._update(this.buffer, 0, out, off), this.bufferOff = 0, this.blockSize;\n }, Cipher.prototype._updateEncrypt = function(data) {\n var inputOff = 0, outputOff = 0, count = (this.bufferOff + data.length) / this.blockSize | 0, out = new Array(count * this.blockSize);\n this.bufferOff !== 0 && (inputOff += this._buffer(data, inputOff), this.bufferOff === this.buffer.length && (outputOff += this._flushBuffer(out, outputOff)));\n for (var max = data.length - (data.length - inputOff) % this.blockSize;inputOff < max; inputOff += this.blockSize)\n this._update(data, inputOff, out, outputOff), outputOff += this.blockSize;\n for (;inputOff < data.length; inputOff++, this.bufferOff++)\n this.buffer[this.bufferOff] = data[inputOff];\n return out;\n }, Cipher.prototype._updateDecrypt = function(data) {\n for (var inputOff = 0, outputOff = 0, count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1, out = new Array(count * this.blockSize);count > 0; count--)\n inputOff += this._buffer(data, inputOff), outputOff += this._flushBuffer(out, outputOff);\n return inputOff += this._buffer(data, inputOff), out;\n }, Cipher.prototype.final = function(buffer) {\n var first;\n buffer && (first = this.update(buffer));\n var last;\n return this.type === \"encrypt\" \? last = this._finalEncrypt() : last = this._finalDecrypt(), first \? first.concat(last) : last;\n }, Cipher.prototype._pad = function(buffer, off) {\n if (off === 0)\n return !1;\n for (;off < buffer.length; )\n buffer[off++] = 0;\n return !0;\n }, Cipher.prototype._finalEncrypt = function() {\n if (!this._pad(this.buffer, this.bufferOff))\n return [];\n var out = new Array(this.blockSize);\n return this._update(this.buffer, 0, out, 0), out;\n }, Cipher.prototype._unpad = function(buffer) {\n return buffer;\n }, Cipher.prototype._finalDecrypt = function() {\n assert.equal(this.bufferOff, this.blockSize, \"Not enough data to decrypt\");\n var out = new Array(this.blockSize);\n return this._flushBuffer(out, 0), this._unpad(out);\n };\n }\n}), require_des = __commonJS({\n \"node_modules/des.js/lib/des/des.js\"(exports, module) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), utils = require_utils(), Cipher = require_cipher();\n function DESState() {\n this.tmp = new Array(2), this.keys = null;\n }\n function DES(options) {\n Cipher.call(this, options);\n var state = new DESState;\n this._desState = state, this.deriveKeys(state, options.key);\n }\n inherits(DES, Cipher), module.exports = DES, DES.create = function(options) {\n return new DES(options);\n };\n var shiftTable = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1];\n DES.prototype.deriveKeys = function(state, key) {\n state.keys = new Array(32), assert.equal(key.length, this.blockSize, \"Invalid key length\");\n var kL = utils.readUInt32BE(key, 0), kR = utils.readUInt32BE(key, 4);\n utils.pc1(kL, kR, state.tmp, 0), kL = state.tmp[0], kR = state.tmp[1];\n for (var i = 0;i < state.keys.length; i += 2) {\n var shift = shiftTable[i >>> 1];\n kL = utils.r28shl(kL, shift), kR = utils.r28shl(kR, shift), utils.pc2(kL, kR, state.keys, i);\n }\n }, DES.prototype._update = function(inp, inOff, out, outOff) {\n var state = this._desState, l = utils.readUInt32BE(inp, inOff), r = utils.readUInt32BE(inp, inOff + 4);\n utils.ip(l, r, state.tmp, 0), l = state.tmp[0], r = state.tmp[1], this.type === \"encrypt\" \? this._encrypt(state, l, r, state.tmp, 0) : this._decrypt(state, l, r, state.tmp, 0), l = state.tmp[0], r = state.tmp[1], utils.writeUInt32BE(out, l, outOff), utils.writeUInt32BE(out, r, outOff + 4);\n }, DES.prototype._pad = function(buffer, off) {\n for (var value = buffer.length - off, i = off;i < buffer.length; i++)\n buffer[i] = value;\n return !0;\n }, DES.prototype._unpad = function(buffer) {\n for (var pad = buffer[buffer.length - 1], i = buffer.length - pad;i < buffer.length; i++)\n assert.equal(buffer[i], pad);\n return buffer.slice(0, buffer.length - pad);\n }, DES.prototype._encrypt = function(state, lStart, rStart, out, off) {\n for (var l = lStart, r = rStart, i = 0;i < state.keys.length; i += 2) {\n var keyL = state.keys[i], keyR = state.keys[i + 1];\n utils.expand(r, state.tmp, 0), keyL ^= state.tmp[0], keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR), f = utils.permute(s), t = r;\n r = (l ^ f) >>> 0, l = t;\n }\n utils.rip(r, l, out, off);\n }, DES.prototype._decrypt = function(state, lStart, rStart, out, off) {\n for (var l = rStart, r = lStart, i = state.keys.length - 2;i >= 0; i -= 2) {\n var keyL = state.keys[i], keyR = state.keys[i + 1];\n utils.expand(l, state.tmp, 0), keyL ^= state.tmp[0], keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR), f = utils.permute(s), t = l;\n l = (r ^ f) >>> 0, r = t;\n }\n utils.rip(l, r, out, off);\n };\n }\n}), require_cbc = __commonJS({\n \"node_modules/des.js/lib/des/cbc.js\"(exports) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), proto = {};\n function CBCState(iv) {\n assert.equal(iv.length, 8, \"Invalid IV length\"), this.iv = new Array(8);\n for (var i = 0;i < this.iv.length; i++)\n this.iv[i] = iv[i];\n }\n function instantiate(Base) {\n function CBC(options) {\n Base.call(this, options), this._cbcInit();\n }\n inherits(CBC, Base);\n for (var keys = Object.keys(proto), i = 0;i < keys.length; i++) {\n var key = keys[i];\n CBC.prototype[key] = proto[key];\n }\n return CBC.create = function(options) {\n return new CBC(options);\n }, CBC;\n }\n exports.instantiate = instantiate, proto._cbcInit = function() {\n var state = new CBCState(this.options.iv);\n this._cbcState = state;\n }, proto._update = function(inp, inOff, out, outOff) {\n var state = this._cbcState, superProto = this.constructor.super_.prototype, iv = state.iv;\n if (this.type === \"encrypt\") {\n for (var i = 0;i < this.blockSize; i++)\n iv[i] ^= inp[inOff + i];\n superProto._update.call(this, iv, 0, out, outOff);\n for (var i = 0;i < this.blockSize; i++)\n iv[i] = out[outOff + i];\n } else {\n superProto._update.call(this, inp, inOff, out, outOff);\n for (var i = 0;i < this.blockSize; i++)\n out[outOff + i] ^= iv[i];\n for (var i = 0;i < this.blockSize; i++)\n iv[i] = inp[inOff + i];\n }\n };\n }\n}), require_ede = __commonJS({\n \"node_modules/des.js/lib/des/ede.js\"(exports, module) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), Cipher = require_cipher(), DES = require_des();\n function EDEState(type, key) {\n assert.equal(key.length, 24, \"Invalid key length\");\n var k1 = key.slice(0, 8), k2 = key.slice(8, 16), k3 = key.slice(16, 24);\n type === \"encrypt\" \? this.ciphers = [\n DES.create({ type: \"encrypt\", key: k1 }),\n DES.create({ type: \"decrypt\", key: k2 }),\n DES.create({ type: \"encrypt\", key: k3 })\n ] : this.ciphers = [\n DES.create({ type: \"decrypt\", key: k3 }),\n DES.create({ type: \"encrypt\", key: k2 }),\n DES.create({ type: \"decrypt\", key: k1 })\n ];\n }\n function EDE(options) {\n Cipher.call(this, options);\n var state = new EDEState(this.type, this.options.key);\n this._edeState = state;\n }\n inherits(EDE, Cipher), module.exports = EDE, EDE.create = function(options) {\n return new EDE(options);\n }, EDE.prototype._update = function(inp, inOff, out, outOff) {\n var state = this._edeState;\n state.ciphers[0]._update(inp, inOff, out, outOff), state.ciphers[1]._update(out, outOff, out, outOff), state.ciphers[2]._update(out, outOff, out, outOff);\n }, EDE.prototype._pad = DES.prototype._pad, EDE.prototype._unpad = DES.prototype._unpad;\n }\n}), require_des2 = __commonJS({\n \"node_modules/des.js/lib/des.js\"(exports) {\n exports.utils = require_utils(), exports.Cipher = require_cipher(), exports.DES = require_des(), exports.CBC = require_cbc(), exports.EDE = require_ede();\n }\n}), require_browserify_des = __commonJS({\n \"node_modules/browserify-des/index.js\"(exports, module) {\n var CipherBase = require_cipher_base(), des = require_des2(), inherits = require_inherits_browser(), Buffer2 = require_safe_buffer().Buffer, modes = {\n \"des-ede3-cbc\": des.CBC.instantiate(des.EDE),\n \"des-ede3\": des.EDE,\n \"des-ede-cbc\": des.CBC.instantiate(des.EDE),\n \"des-ede\": des.EDE,\n \"des-cbc\": des.CBC.instantiate(des.DES),\n \"des-ecb\": des.DES\n };\n modes.des = modes[\"des-cbc\"], modes.des3 = modes[\"des-ede3-cbc\"], module.exports = DES, inherits(DES, CipherBase);\n function DES(opts) {\n CipherBase.call(this);\n var modeName = opts.mode.toLowerCase(), mode = modes[modeName], type;\n opts.decrypt \? type = \"decrypt\" : type = \"encrypt\";\n var key = opts.key;\n Buffer2.isBuffer(key) || (key = Buffer2.from(key)), (modeName === \"des-ede\" || modeName === \"des-ede-cbc\") && (key = Buffer2.concat([key, key.slice(0, 8)]));\n var iv = opts.iv;\n Buffer2.isBuffer(iv) || (iv = Buffer2.from(iv)), this._des = mode.create({\n key,\n iv,\n type\n });\n }\n DES.prototype._update = function(data) {\n return Buffer2.from(this._des.update(data));\n }, DES.prototype._final = function() {\n return Buffer2.from(this._des.final());\n };\n }\n}), require_ecb = __commonJS({\n \"node_modules/browserify-aes/modes/ecb.js\"(exports) {\n exports.encrypt = function(self2, block) {\n return self2._cipher.encryptBlock(block);\n }, exports.decrypt = function(self2, block) {\n return self2._cipher.decryptBlock(block);\n };\n }\n}), require_buffer_xor = __commonJS({\n \"node_modules/buffer-xor/index.js\"(exports, module) {\n module.exports = function(a, b) {\n for (var length = Math.min(a.length, b.length), buffer = new Buffer(length), i = 0;i < length; ++i)\n buffer[i] = a[i] ^ b[i];\n return buffer;\n };\n }\n}), require_cbc2 = __commonJS({\n \"node_modules/browserify-aes/modes/cbc.js\"(exports) {\n var xor = require_buffer_xor();\n exports.encrypt = function(self2, block) {\n var data = xor(block, self2._prev);\n return self2._prev = self2._cipher.encryptBlock(data), self2._prev;\n }, exports.decrypt = function(self2, block) {\n var pad = self2._prev;\n self2._prev = block;\n var out = self2._cipher.decryptBlock(block);\n return xor(out, pad);\n };\n }\n}), require_cfb = __commonJS({\n \"node_modules/browserify-aes/modes/cfb.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer, xor = require_buffer_xor();\n function encryptStart(self2, data, decrypt) {\n var len = data.length, out = xor(data, self2._cache);\n return self2._cache = self2._cache.slice(len), self2._prev = Buffer2.concat([self2._prev, decrypt \? data : out]), out;\n }\n exports.encrypt = function(self2, data, decrypt) {\n for (var out = Buffer2.allocUnsafe(0), len;data.length; )\n if (self2._cache.length === 0 && (self2._cache = self2._cipher.encryptBlock(self2._prev), self2._prev = Buffer2.allocUnsafe(0)), self2._cache.length <= data.length)\n len = self2._cache.length, out = Buffer2.concat([out, encryptStart(self2, data.slice(0, len), decrypt)]), data = data.slice(len);\n else {\n out = Buffer2.concat([out, encryptStart(self2, data, decrypt)]);\n break;\n }\n return out;\n };\n }\n}), require_cfb8 = __commonJS({\n \"node_modules/browserify-aes/modes/cfb8.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer;\n function encryptByte(self2, byteParam, decrypt) {\n var pad = self2._cipher.encryptBlock(self2._prev), out = pad[0] ^ byteParam;\n return self2._prev = Buffer2.concat([self2._prev.slice(1), Buffer2.from([decrypt \? byteParam : out])]), out;\n }\n exports.encrypt = function(self2, chunk, decrypt) {\n for (var len = chunk.length, out = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n out[i] = encryptByte(self2, chunk[i], decrypt);\n return out;\n };\n }\n}), require_cfb1 = __commonJS({\n \"node_modules/browserify-aes/modes/cfb1.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer;\n function encryptByte(self2, byteParam, decrypt) {\n for (var pad, i = -1, len = 8, out = 0, bit, value;++i < len; )\n pad = self2._cipher.encryptBlock(self2._prev), bit = byteParam & 1 << 7 - i \? 128 : 0, value = pad[0] ^ bit, out += (value & 128) >> i % 8, self2._prev = shiftIn(self2._prev, decrypt \? bit : value);\n return out;\n }\n function shiftIn(buffer, value) {\n var len = buffer.length, i = -1, out = Buffer2.allocUnsafe(buffer.length);\n for (buffer = Buffer2.concat([buffer, Buffer2.from([value])]);++i < len; )\n out[i] = buffer[i] << 1 | buffer[i + 1] >> 7;\n return out;\n }\n exports.encrypt = function(self2, chunk, decrypt) {\n for (var len = chunk.length, out = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n out[i] = encryptByte(self2, chunk[i], decrypt);\n return out;\n };\n }\n}), require_ofb = __commonJS({\n \"node_modules/browserify-aes/modes/ofb.js\"(exports) {\n var xor = require_buffer_xor();\n function getBlock(self2) {\n return self2._prev = self2._cipher.encryptBlock(self2._prev), self2._prev;\n }\n exports.encrypt = function(self2, chunk) {\n for (;self2._cache.length < chunk.length; )\n self2._cache = Buffer.concat([self2._cache, getBlock(self2)]);\n var pad = self2._cache.slice(0, chunk.length);\n return self2._cache = self2._cache.slice(chunk.length), xor(chunk, pad);\n };\n }\n}), require_incr32 = __commonJS({\n \"node_modules/browserify-aes/incr32.js\"(exports, module) {\n function incr32(iv) {\n for (var len = iv.length, item;len--; )\n if (item = iv.readUInt8(len), item === 255)\n iv.writeUInt8(0, len);\n else {\n item++, iv.writeUInt8(item, len);\n break;\n }\n }\n module.exports = incr32;\n }\n}), require_ctr = __commonJS({\n \"node_modules/browserify-aes/modes/ctr.js\"(exports) {\n var xor = require_buffer_xor(), Buffer2 = require_safe_buffer().Buffer, incr32 = require_incr32();\n function getBlock(self2) {\n var out = self2._cipher.encryptBlockRaw(self2._prev);\n return incr32(self2._prev), out;\n }\n var blockSize = 16;\n exports.encrypt = function(self2, chunk) {\n var chunkNum = Math.ceil(chunk.length / blockSize), start = self2._cache.length;\n self2._cache = Buffer2.concat([self2._cache, Buffer2.allocUnsafe(chunkNum * blockSize)]);\n for (var i = 0;i < chunkNum; i++) {\n var out = getBlock(self2), offset = start + i * blockSize;\n self2._cache.writeUInt32BE(out[0], offset + 0), self2._cache.writeUInt32BE(out[1], offset + 4), self2._cache.writeUInt32BE(out[2], offset + 8), self2._cache.writeUInt32BE(out[3], offset + 12);\n }\n var pad = self2._cache.slice(0, chunk.length);\n return self2._cache = self2._cache.slice(chunk.length), xor(chunk, pad);\n };\n }\n}), require_list = __commonJS({\n \"node_modules/browserify-aes/modes/list.json\"(exports, module) {\n module.exports = {\n \"aes-128-ecb\": {\n cipher: \"AES\",\n key: 128,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-192-ecb\": {\n cipher: \"AES\",\n key: 192,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-256-ecb\": {\n cipher: \"AES\",\n key: 256,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-128-cbc\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-192-cbc\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-256-cbc\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes128: {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes192: {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes256: {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-128-cfb\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-192-cfb\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-256-cfb\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-128-cfb8\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-192-cfb8\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-256-cfb8\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-128-cfb1\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-192-cfb1\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-256-cfb1\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-128-ofb\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-192-ofb\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-256-ofb\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-128-ctr\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-192-ctr\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-256-ctr\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-128-gcm\": {\n cipher: \"AES\",\n key: 128,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n },\n \"aes-192-gcm\": {\n cipher: \"AES\",\n key: 192,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n },\n \"aes-256-gcm\": {\n cipher: \"AES\",\n key: 256,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n }\n };\n }\n}), require_modes = __commonJS({\n \"node_modules/browserify-aes/modes/index.js\"(exports, module) {\n var modeModules = {\n ECB: require_ecb(),\n CBC: require_cbc2(),\n CFB: require_cfb(),\n CFB8: require_cfb8(),\n CFB1: require_cfb1(),\n OFB: require_ofb(),\n CTR: require_ctr(),\n GCM: require_ctr()\n }, modes = require_list();\n for (key in modes)\n modes[key].module = modeModules[modes[key].mode];\n var key;\n module.exports = modes;\n }\n}), require_aes = __commonJS({\n \"node_modules/browserify-aes/aes.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n function asUInt32Array(buf) {\n Buffer2.isBuffer(buf) || (buf = Buffer2.from(buf));\n for (var len = buf.length / 4 | 0, out = new Array(len), i = 0;i < len; i++)\n out[i] = buf.readUInt32BE(i * 4);\n return out;\n }\n function scrubVec(v) {\n for (var i = 0;i < v.length; v++)\n v[i] = 0;\n }\n function cryptBlock(M, keySchedule, SUB_MIX, SBOX, nRounds) {\n for (var SUB_MIX0 = SUB_MIX[0], SUB_MIX1 = SUB_MIX[1], SUB_MIX2 = SUB_MIX[2], SUB_MIX3 = SUB_MIX[3], s0 = M[0] ^ keySchedule[0], s1 = M[1] ^ keySchedule[1], s2 = M[2] ^ keySchedule[2], s3 = M[3] ^ keySchedule[3], t0, t1, t2, t3, ksRow = 4, round = 1;round < nRounds; round++)\n t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[s1 >>> 16 & 255] ^ SUB_MIX2[s2 >>> 8 & 255] ^ SUB_MIX3[s3 & 255] ^ keySchedule[ksRow++], t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[s2 >>> 16 & 255] ^ SUB_MIX2[s3 >>> 8 & 255] ^ SUB_MIX3[s0 & 255] ^ keySchedule[ksRow++], t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[s3 >>> 16 & 255] ^ SUB_MIX2[s0 >>> 8 & 255] ^ SUB_MIX3[s1 & 255] ^ keySchedule[ksRow++], t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[s0 >>> 16 & 255] ^ SUB_MIX2[s1 >>> 8 & 255] ^ SUB_MIX3[s2 & 255] ^ keySchedule[ksRow++], s0 = t0, s1 = t1, s2 = t2, s3 = t3;\n return t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 255] << 16 | SBOX[s2 >>> 8 & 255] << 8 | SBOX[s3 & 255]) ^ keySchedule[ksRow++], t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 255] << 16 | SBOX[s3 >>> 8 & 255] << 8 | SBOX[s0 & 255]) ^ keySchedule[ksRow++], t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 255] << 16 | SBOX[s0 >>> 8 & 255] << 8 | SBOX[s1 & 255]) ^ keySchedule[ksRow++], t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 255] << 16 | SBOX[s1 >>> 8 & 255] << 8 | SBOX[s2 & 255]) ^ keySchedule[ksRow++], t0 = t0 >>> 0, t1 = t1 >>> 0, t2 = t2 >>> 0, t3 = t3 >>> 0, [t0, t1, t2, t3];\n }\n var RCON = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], G = function() {\n for (var d = new Array(256), j = 0;j < 256; j++)\n j < 128 \? d[j] = j << 1 : d[j] = j << 1 ^ 283;\n for (var SBOX = [], INV_SBOX = [], SUB_MIX = [[], [], [], []], INV_SUB_MIX = [[], [], [], []], x = 0, xi = 0, i = 0;i < 256; ++i) {\n var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n sx = sx >>> 8 ^ sx & 255 ^ 99, SBOX[x] = sx, INV_SBOX[sx] = x;\n var x2 = d[x], x4 = d[x2], x8 = d[x4], t = d[sx] * 257 ^ sx * 16843008;\n SUB_MIX[0][x] = t << 24 | t >>> 8, SUB_MIX[1][x] = t << 16 | t >>> 16, SUB_MIX[2][x] = t << 8 | t >>> 24, SUB_MIX[3][x] = t, t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008, INV_SUB_MIX[0][sx] = t << 24 | t >>> 8, INV_SUB_MIX[1][sx] = t << 16 | t >>> 16, INV_SUB_MIX[2][sx] = t << 8 | t >>> 24, INV_SUB_MIX[3][sx] = t, x === 0 \? x = xi = 1 : (x = x2 ^ d[d[d[x8 ^ x2]]], xi ^= d[d[xi]]);\n }\n return {\n SBOX,\n INV_SBOX,\n SUB_MIX,\n INV_SUB_MIX\n };\n }();\n function AES(key) {\n this._key = asUInt32Array(key), this._reset();\n }\n AES.prototype = {}, AES.blockSize = 16, AES.keySize = 32, AES.prototype.blockSize = AES.blockSize, AES.prototype.keySize = AES.keySize, AES.prototype._reset = function() {\n for (var keyWords = this._key, keySize = keyWords.length, nRounds = keySize + 6, ksRows = (nRounds + 1) * 4, keySchedule = [], k = 0;k < keySize; k++)\n keySchedule[k] = keyWords[k];\n for (k = keySize;k < ksRows; k++) {\n var t = keySchedule[k - 1];\n k % keySize === 0 \? (t = t << 8 | t >>> 24, t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255], t ^= RCON[k / keySize | 0] << 24) : keySize > 6 && k % keySize === 4 && (t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255]), keySchedule[k] = keySchedule[k - keySize] ^ t;\n }\n for (var invKeySchedule = [], ik = 0;ik < ksRows; ik++) {\n var ksR = ksRows - ik, tt = keySchedule[ksR - (ik % 4 \? 0 : 4)];\n ik < 4 || ksR <= 4 \? invKeySchedule[ik] = tt : invKeySchedule[ik] = G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^ G.INV_SUB_MIX[1][G.SBOX[tt >>> 16 & 255]] ^ G.INV_SUB_MIX[2][G.SBOX[tt >>> 8 & 255]] ^ G.INV_SUB_MIX[3][G.SBOX[tt & 255]];\n }\n this._nRounds = nRounds, this._keySchedule = keySchedule, this._invKeySchedule = invKeySchedule;\n }, AES.prototype.encryptBlockRaw = function(M) {\n return M = asUInt32Array(M), cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds);\n }, AES.prototype.encryptBlock = function(M) {\n var out = this.encryptBlockRaw(M), buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0], 0), buf.writeUInt32BE(out[1], 4), buf.writeUInt32BE(out[2], 8), buf.writeUInt32BE(out[3], 12), buf;\n }, AES.prototype.decryptBlock = function(M) {\n M = asUInt32Array(M);\n var m1 = M[1];\n M[1] = M[3], M[3] = m1;\n var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds), buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0], 0), buf.writeUInt32BE(out[3], 4), buf.writeUInt32BE(out[2], 8), buf.writeUInt32BE(out[1], 12), buf;\n }, AES.prototype.scrub = function() {\n scrubVec(this._keySchedule), scrubVec(this._invKeySchedule), scrubVec(this._key);\n }, module.exports.AES = AES;\n }\n}), require_ghash = __commonJS({\n \"node_modules/browserify-aes/ghash.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, ZEROES = Buffer2.alloc(16, 0);\n function toArray(buf) {\n return [buf.readUInt32BE(0), buf.readUInt32BE(4), buf.readUInt32BE(8), buf.readUInt32BE(12)];\n }\n function fromArray(out) {\n var buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0] >>> 0, 0), buf.writeUInt32BE(out[1] >>> 0, 4), buf.writeUInt32BE(out[2] >>> 0, 8), buf.writeUInt32BE(out[3] >>> 0, 12), buf;\n }\n function GHASH(key) {\n this.h = key, this.state = Buffer2.alloc(16, 0), this.cache = Buffer2.allocUnsafe(0);\n }\n GHASH.prototype = {}, GHASH.prototype.ghash = function(block) {\n for (var i = -1;++i < block.length; )\n this.state[i] ^= block[i];\n this._multiply();\n }, GHASH.prototype._multiply = function() {\n for (var Vi = toArray(this.h), Zi = [0, 0, 0, 0], j, xi, lsbVi, i = -1;++i < 128; ) {\n for (xi = (this.state[~~(i / 8)] & 1 << 7 - i % 8) !== 0, xi && (Zi[0] ^= Vi[0], Zi[1] ^= Vi[1], Zi[2] ^= Vi[2], Zi[3] ^= Vi[3]), lsbVi = (Vi[3] & 1) !== 0, j = 3;j > 0; j--)\n Vi[j] = Vi[j] >>> 1 | (Vi[j - 1] & 1) << 31;\n Vi[0] = Vi[0] >>> 1, lsbVi && (Vi[0] = Vi[0] ^ 225 << 24);\n }\n this.state = fromArray(Zi);\n }, GHASH.prototype.update = function(buf) {\n this.cache = Buffer2.concat([this.cache, buf]);\n for (var chunk;this.cache.length >= 16; )\n chunk = this.cache.slice(0, 16), this.cache = this.cache.slice(16), this.ghash(chunk);\n }, GHASH.prototype.final = function(abl, bl) {\n return this.cache.length && this.ghash(Buffer2.concat([this.cache, ZEROES], 16)), this.ghash(fromArray([0, abl, 0, bl])), this.state;\n }, module.exports = GHASH;\n }\n}), require_authCipher = __commonJS({\n \"node_modules/browserify-aes/authCipher.js\"(exports, module) {\n var aes = require_aes(), Buffer2 = require_safe_buffer().Buffer, Transform = require_cipher_base(), inherits = require_inherits_browser(), GHASH = require_ghash(), xor = require_buffer_xor(), incr32 = require_incr32();\n function xorTest(a, b) {\n var out = 0;\n a.length !== b.length && out++;\n for (var len = Math.min(a.length, b.length), i = 0;i < len; ++i)\n out += a[i] ^ b[i];\n return out;\n }\n function calcIv(self2, iv, ck) {\n if (iv.length === 12)\n return self2._finID = Buffer2.concat([iv, Buffer2.from([0, 0, 0, 1])]), Buffer2.concat([iv, Buffer2.from([0, 0, 0, 2])]);\n var ghash = new GHASH(ck), len = iv.length, toPad = len % 16;\n ghash.update(iv), toPad && (toPad = 16 - toPad, ghash.update(Buffer2.alloc(toPad, 0))), ghash.update(Buffer2.alloc(8, 0));\n var ivBits = len * 8, tail = Buffer2.alloc(8);\n tail.writeUIntBE(ivBits, 0, 8), ghash.update(tail), self2._finID = ghash.state;\n var out = Buffer2.from(self2._finID);\n return incr32(out), out;\n }\n function StreamCipher(mode, key, iv, decrypt) {\n Transform.call(this);\n var h = Buffer2.alloc(4, 0);\n this._cipher = new aes.AES(key);\n var ck = this._cipher.encryptBlock(h);\n this._ghash = new GHASH(ck), iv = calcIv(this, iv, ck), this._prev = Buffer2.from(iv), this._cache = Buffer2.allocUnsafe(0), this._secCache = Buffer2.allocUnsafe(0), this._decrypt = decrypt, this._alen = 0, this._len = 0, this._mode = mode, this._authTag = null, this._called = !1;\n }\n inherits(StreamCipher, Transform), StreamCipher.prototype._update = function(chunk) {\n if (!this._called && this._alen) {\n var rump = 16 - this._alen % 16;\n rump < 16 && (rump = Buffer2.alloc(rump, 0), this._ghash.update(rump));\n }\n this._called = !0;\n var out = this._mode.encrypt(this, chunk);\n return this._decrypt \? this._ghash.update(chunk) : this._ghash.update(out), this._len += chunk.length, out;\n }, StreamCipher.prototype._final = function() {\n if (this._decrypt && !this._authTag)\n throw new Error(\"Unsupported state or unable to authenticate data\");\n var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID));\n if (this._decrypt && xorTest(tag, this._authTag))\n throw new Error(\"Unsupported state or unable to authenticate data\");\n this._authTag = tag, this._cipher.scrub();\n }, StreamCipher.prototype.getAuthTag = function() {\n if (this._decrypt || !Buffer2.isBuffer(this._authTag))\n throw new Error(\"Attempting to get auth tag in unsupported state\");\n return this._authTag;\n }, StreamCipher.prototype.setAuthTag = function(tag) {\n if (!this._decrypt)\n throw new Error(\"Attempting to set auth tag in unsupported state\");\n this._authTag = tag;\n }, StreamCipher.prototype.setAAD = function(buf) {\n if (this._called)\n throw new Error(\"Attempting to set AAD in unsupported state\");\n this._ghash.update(buf), this._alen += buf.length;\n }, module.exports = StreamCipher;\n }\n}), require_streamCipher = __commonJS({\n \"node_modules/browserify-aes/streamCipher.js\"(exports, module) {\n var aes = require_aes(), Buffer2 = require_safe_buffer().Buffer, Transform = require_cipher_base(), inherits = require_inherits_browser();\n function StreamCipher(mode, key, iv, decrypt) {\n Transform.call(this), this._cipher = new aes.AES(key), this._prev = Buffer2.from(iv), this._cache = Buffer2.allocUnsafe(0), this._secCache = Buffer2.allocUnsafe(0), this._decrypt = decrypt, this._mode = mode;\n }\n inherits(StreamCipher, Transform), StreamCipher.prototype._update = function(chunk) {\n return this._mode.encrypt(this, chunk, this._decrypt);\n }, StreamCipher.prototype._final = function() {\n this._cipher.scrub();\n }, module.exports = StreamCipher;\n }\n}), require_evp_bytestokey = __commonJS({\n \"node_modules/evp_bytestokey/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, MD5 = require_md5();\n function EVP_BytesToKey(password, salt, keyBits, ivLen) {\n if (Buffer2.isBuffer(password) || (password = Buffer2.from(password, \"binary\")), salt && (Buffer2.isBuffer(salt) || (salt = Buffer2.from(salt, \"binary\")), salt.length !== 8))\n @throwRangeError(\"salt should be Buffer with 8 byte length\");\n for (var keyLen = keyBits / 8, key = Buffer2.alloc(keyLen), iv = Buffer2.alloc(ivLen || 0), tmp = Buffer2.alloc(0);keyLen > 0 || ivLen > 0; ) {\n var hash = new MD5;\n hash.update(tmp), hash.update(password), salt && hash.update(salt), tmp = hash.digest();\n var used = 0;\n if (keyLen > 0) {\n var keyStart = key.length - keyLen;\n used = Math.min(keyLen, tmp.length), tmp.copy(key, keyStart, 0, used), keyLen -= used;\n }\n if (used < tmp.length && ivLen > 0) {\n var ivStart = iv.length - ivLen, length = Math.min(ivLen, tmp.length - used);\n tmp.copy(iv, ivStart, used, used + length), ivLen -= length;\n }\n }\n return tmp.fill(0), { key, iv };\n }\n module.exports = EVP_BytesToKey;\n }\n}), require_encrypter = __commonJS({\n \"node_modules/browserify-aes/encrypter.js\"(exports) {\n var MODES = require_modes(), AuthCipher = require_authCipher(), Buffer2 = require_safe_buffer().Buffer, StreamCipher = require_streamCipher(), Transform = require_cipher_base(), aes = require_aes(), ebtk = require_evp_bytestokey(), inherits = require_inherits_browser();\n function Cipher(mode, key, iv) {\n Transform.call(this), this._cache = new Splitter, this._cipher = new aes.AES(key), this._prev = Buffer2.from(iv), this._mode = mode, this._autopadding = !0;\n }\n inherits(Cipher, Transform), Cipher.prototype._update = function(data) {\n this._cache.add(data);\n for (var chunk, thing, out = [];chunk = this._cache.get(); )\n thing = this._mode.encrypt(this, chunk), out.push(thing);\n return Buffer2.concat(out);\n };\n var PADDING = Buffer2.alloc(16, 16);\n Cipher.prototype._final = function() {\n var chunk = this._cache.flush();\n if (this._autopadding)\n return chunk = this._mode.encrypt(this, chunk), this._cipher.scrub(), chunk;\n if (!chunk.equals(PADDING))\n throw this._cipher.scrub(), new Error(\"data not multiple of block length\");\n }, Cipher.prototype.setAutoPadding = function(setTo) {\n return this._autopadding = !!setTo, this;\n };\n function Splitter() {\n this.cache = Buffer2.allocUnsafe(0);\n }\n Splitter.prototype = {}, Splitter.prototype.add = function(data) {\n this.cache = Buffer2.concat([this.cache, data]);\n }, Splitter.prototype.get = function() {\n if (this.cache.length > 15) {\n var out = this.cache.slice(0, 16);\n return this.cache = this.cache.slice(16), out;\n }\n return null;\n }, Splitter.prototype.flush = function() {\n for (var len = 16 - this.cache.length, padBuff = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n padBuff.writeUInt8(len, i);\n return Buffer2.concat([this.cache, padBuff]);\n };\n function createCipheriv(suite, password, iv) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n password = getArrayBufferOrView(password, \"password\");\n const iv_length = iv\?.length || 0, required_iv_length = config.iv || 0;\n if (iv = iv === null \? EMPTY_BUFFER : getArrayBufferOrView(iv, \"iv\"), password\?.length !== config.key / 8) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n if (config.mode !== \"GCM\" && iv_length !== required_iv_length) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n return config.type === \"stream\" \? new StreamCipher(config.module, password, iv) : config.type === \"auth\" \? new AuthCipher(config.module, password, iv) : new Cipher(config.module, password, iv);\n }\n function createCipher(suite, password) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, config.key, config.iv);\n return createCipheriv(suite, keys.key, keys.iv);\n }\n exports.createCipheriv = createCipheriv, exports.createCipher = createCipher;\n }\n}), require_decrypter = __commonJS({\n \"node_modules/browserify-aes/decrypter.js\"(exports) {\n var AuthCipher = require_authCipher(), Buffer2 = require_safe_buffer().Buffer, MODES = require_modes(), StreamCipher = require_streamCipher(), Transform = require_cipher_base(), aes = require_aes(), ebtk = require_evp_bytestokey(), inherits = require_inherits_browser();\n function Decipher(mode, key, iv) {\n Transform.call(this), this._cache = new Splitter, this._last = void 0, this._cipher = new aes.AES(key), this._prev = Buffer2.from(iv), this._mode = mode, this._autopadding = !0;\n }\n inherits(Decipher, Transform), Decipher.prototype._update = function(data) {\n this._cache.add(data);\n for (var chunk, thing, out = [];chunk = this._cache.get(this._autopadding); )\n thing = this._mode.decrypt(this, chunk), out.push(thing);\n return Buffer2.concat(out);\n }, Decipher.prototype._final = function() {\n var chunk = this._cache.flush();\n if (this._autopadding)\n return unpad(this._mode.decrypt(this, chunk));\n if (chunk)\n throw new Error(\"data not multiple of block length\");\n }, Decipher.prototype.setAutoPadding = function(setTo) {\n return this._autopadding = !!setTo, this;\n };\n function Splitter() {\n this.cache = Buffer2.allocUnsafe(0);\n }\n Splitter.prototype = {}, Splitter.prototype.add = function(data) {\n this.cache = Buffer2.concat([this.cache, data]);\n }, Splitter.prototype.get = function(autoPadding) {\n var out;\n if (autoPadding) {\n if (this.cache.length > 16)\n return out = this.cache.slice(0, 16), this.cache = this.cache.slice(16), out;\n } else if (this.cache.length >= 16)\n return out = this.cache.slice(0, 16), this.cache = this.cache.slice(16), out;\n return null;\n }, Splitter.prototype.flush = function() {\n if (this.cache.length)\n return this.cache;\n };\n function unpad(last) {\n var padded = last[15];\n if (padded < 1 || padded > 16)\n throw new Error(\"unable to decrypt data\");\n for (var i = -1;++i < padded; )\n if (last[i + (16 - padded)] !== padded)\n throw new Error(\"unable to decrypt data\");\n if (padded !== 16)\n return last.slice(0, 16 - padded);\n }\n function createDecipheriv(suite, password, iv) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n password = getArrayBufferOrView(password, \"password\");\n const iv_length = iv\?.length || 0, required_iv_length = config.iv || 0;\n if (iv = iv === null \? EMPTY_BUFFER : getArrayBufferOrView(iv, \"iv\"), config.mode !== \"GCM\" && iv_length !== required_iv_length) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n if (password.length !== config.key / 8) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n return config.type === \"stream\" \? new StreamCipher(config.module, password, iv, !0) : config.type === \"auth\" \? new AuthCipher(config.module, password, iv, !0) : new Decipher(config.module, password, iv);\n }\n function createDecipher(suite, password) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, config.key, config.iv);\n return createDecipheriv(suite, keys.key, keys.iv);\n }\n exports.createDecipher = createDecipher, exports.createDecipheriv = createDecipheriv;\n }\n}), require_browser5 = __commonJS({\n \"node_modules/browserify-aes/browser.js\"(exports) {\n var ciphers = require_encrypter(), deciphers = require_decrypter(), modes = require_list();\n function getCiphers() {\n return Object.keys(modes);\n }\n exports.createCipher = exports.Cipher = ciphers.createCipher, exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv, exports.createDecipher = exports.Decipher = deciphers.createDecipher, exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv, exports.listCiphers = exports.getCiphers = getCiphers;\n }\n}), require_modes2 = __commonJS({\n \"node_modules/browserify-des/modes.js\"(exports) {\n exports[\"des-ecb\"] = {\n key: 8,\n iv: 0\n }, exports[\"des-cbc\"] = exports.des = {\n key: 8,\n iv: 8\n }, exports[\"des-ede3-cbc\"] = exports.des3 = {\n key: 24,\n iv: 8\n }, exports[\"des-ede3\"] = {\n key: 24,\n iv: 0\n }, exports[\"des-ede-cbc\"] = {\n key: 16,\n iv: 8\n }, exports[\"des-ede\"] = {\n key: 16,\n iv: 0\n };\n }\n}), require_browser6 = __commonJS({\n \"node_modules/browserify-cipher/browser.js\"(exports) {\n var DES = require_browserify_des(), aes = require_browser5(), aesModes = require_modes(), desModes = require_modes2(), ebtk = require_evp_bytestokey();\n function createCipher(suite, password) {\n suite = suite.toLowerCase();\n var keyLen, ivLen;\n if (aesModes[suite])\n keyLen = aesModes[suite].key, ivLen = aesModes[suite].iv;\n else if (desModes[suite])\n keyLen = desModes[suite].key * 8, ivLen = desModes[suite].iv;\n else\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, keyLen, ivLen);\n return createCipheriv(suite, keys.key, keys.iv);\n }\n function createDecipher(suite, password) {\n suite = suite.toLowerCase();\n var keyLen, ivLen;\n if (aesModes[suite])\n keyLen = aesModes[suite].key, ivLen = aesModes[suite].iv;\n else if (desModes[suite])\n keyLen = desModes[suite].key * 8, ivLen = desModes[suite].iv;\n else\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, keyLen, ivLen);\n return createDecipheriv(suite, keys.key, keys.iv);\n }\n function createCipheriv(suite, key, iv) {\n if (suite = suite.toLowerCase(), aesModes[suite])\n return aes.createCipheriv(suite, key, iv);\n if (desModes[suite])\n return new DES({ key, iv, mode: suite });\n @throwTypeError(\"invalid suite type\");\n }\n function createDecipheriv(suite, key, iv) {\n if (suite = suite.toLowerCase(), aesModes[suite])\n return aes.createDecipheriv(suite, key, iv);\n if (desModes[suite])\n return new DES({ key, iv, mode: suite, decrypt: !0 });\n @throwTypeError(\"invalid suite type\");\n }\n function getCiphers() {\n return Object.keys(desModes).concat(aes.getCiphers());\n }\n exports.createCipher = exports.Cipher = createCipher, exports.createCipheriv = exports.Cipheriv = createCipheriv, exports.createDecipher = exports.Decipher = createDecipher, exports.createDecipheriv = exports.Decipheriv = createDecipheriv, exports.listCiphers = exports.getCiphers = getCiphers;\n }\n}), require_bn = __commonJS({\n \"node_modules/diffie-hellman/node_modules/bn.js/lib/bn.js\"(exports, module) {\n (function(module2, exports2) {\n function assert(val, msg) {\n if (!val)\n throw new Error(msg || \"Assertion failed\");\n }\n function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function() {\n };\n TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor, ctor.prototype.constructor = ctor;\n }\n function BN(number, base, endian) {\n if (BN.isBN(number))\n return number;\n this.negative = 0, this.words = null, this.length = 0, this.red = null, number !== null && ((base === \"le\" || base === \"be\") && (endian = base, base = 10), this._init(number || 0, base || 10, endian || \"be\"));\n }\n BN.prototype = {}, typeof module2 == \"object\" \? module2.exports = BN : exports2.BN = BN, BN.BN = BN, BN.wordSize = 26;\n var Buffer2 = Buffer;\n BN.isBN = function(num) {\n return num instanceof BN \? !0 : num !== null && typeof num == \"object\" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n }, BN.max = function(left, right) {\n return left.cmp(right) > 0 \? left : right;\n }, BN.min = function(left, right) {\n return left.cmp(right) < 0 \? left : right;\n }, BN.prototype._init = function(number, base, endian) {\n if (typeof number == \"number\")\n return this._initNumber(number, base, endian);\n if (typeof number == \"object\")\n return this._initArray(number, base, endian);\n base === \"hex\" && (base = 16), assert(base === (base | 0) && base >= 2 && base <= 36), number = number.toString().replace(/\\s+/g, \"\");\n var start = 0;\n number[0] === \"-\" && (start++, this.negative = 1), start < number.length && (base === 16 \? this._parseHex(number, start, endian) : (this._parseBase(number, base, start), endian === \"le\" && this._initArray(this.toArray(), base, endian)));\n }, BN.prototype._initNumber = function(number, base, endian) {\n number < 0 && (this.negative = 1, number = -number), number < 67108864 \? (this.words = [number & 67108863], this.length = 1) : number < 4503599627370496 \? (this.words = [number & 67108863, number / 67108864 & 67108863], this.length = 2) : (assert(number < 9007199254740992), this.words = [number & 67108863, number / 67108864 & 67108863, 1], this.length = 3), endian === \"le\" && this._initArray(this.toArray(), base, endian);\n }, BN.prototype._initArray = function(number, base, endian) {\n if (assert(typeof number.length == \"number\"), number.length <= 0)\n return this.words = [0], this.length = 1, this;\n this.length = Math.ceil(number.length / 3), this.words = new Array(this.length);\n for (var i = 0;i < this.length; i++)\n this.words[i] = 0;\n var j, w, off = 0;\n if (endian === \"be\")\n for (i = number.length - 1, j = 0;i >= 0; i -= 3)\n w = number[i] | number[i - 1] << 8 | number[i - 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26 && (off -= 26, j++);\n else if (endian === \"le\")\n for (i = 0, j = 0;i < number.length; i += 3)\n w = number[i] | number[i + 1] << 8 | number[i + 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26 && (off -= 26, j++);\n return this.strip();\n };\n function parseHex4Bits(string, index) {\n var c = string.charCodeAt(index);\n return c >= 65 && c <= 70 \? c - 55 : c >= 97 && c <= 102 \? c - 87 : c - 48 & 15;\n }\n function parseHexByte(string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n return index - 1 >= lowerBound && (r |= parseHex4Bits(string, index - 1) << 4), r;\n }\n BN.prototype._parseHex = function(number, start, endian) {\n this.length = Math.ceil((number.length - start) / 6), this.words = new Array(this.length);\n for (var i = 0;i < this.length; i++)\n this.words[i] = 0;\n var off = 0, j = 0, w;\n if (endian === \"be\")\n for (i = number.length - 1;i >= start; i -= 2)\n w = parseHexByte(number, start, i) << off, this.words[j] |= w & 67108863, off >= 18 \? (off -= 18, j += 1, this.words[j] |= w >>> 26) : off += 8;\n else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 \? start + 1 : start;i < number.length; i += 2)\n w = parseHexByte(number, start, i) << off, this.words[j] |= w & 67108863, off >= 18 \? (off -= 18, j += 1, this.words[j] |= w >>> 26) : off += 8;\n }\n this.strip();\n };\n function parseBase(str, start, end, mul) {\n for (var r = 0, len = Math.min(str.length, end), i = start;i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n r *= mul, c >= 49 \? r += c - 49 + 10 : c >= 17 \? r += c - 17 + 10 : r += c;\n }\n return r;\n }\n BN.prototype._parseBase = function(number, base, start) {\n this.words = [0], this.length = 1;\n for (var limbLen = 0, limbPow = 1;limbPow <= 67108863; limbPow *= base)\n limbLen++;\n limbLen--, limbPow = limbPow / base | 0;\n for (var total = number.length - start, mod = total % limbLen, end = Math.min(total, total - mod) + start, word = 0, i = start;i < end; i += limbLen)\n word = parseBase(number, i, i + limbLen, base), this.imuln(limbPow), this.words[0] + word < 67108864 \? this.words[0] += word : this._iaddn(word);\n if (mod !== 0) {\n var pow = 1;\n for (word = parseBase(number, i, number.length, base), i = 0;i < mod; i++)\n pow *= base;\n this.imuln(pow), this.words[0] + word < 67108864 \? this.words[0] += word : this._iaddn(word);\n }\n this.strip();\n }, BN.prototype.copy = function(dest) {\n dest.words = new Array(this.length);\n for (var i = 0;i < this.length; i++)\n dest.words[i] = this.words[i];\n dest.length = this.length, dest.negative = this.negative, dest.red = this.red;\n }, BN.prototype.clone = function() {\n var r = new BN(null);\n return this.copy(r), r;\n }, BN.prototype._expand = function(size) {\n for (;this.length < size; )\n this.words[this.length++] = 0;\n return this;\n }, BN.prototype.strip = function() {\n for (;this.length > 1 && this.words[this.length - 1] === 0; )\n this.length--;\n return this._normSign();\n }, BN.prototype._normSign = function() {\n return this.length === 1 && this.words[0] === 0 && (this.negative = 0), this;\n }, BN.prototype.inspect = function() {\n return (this.red \? \"<BN-R: \" : \"<BN: \") + this.toString(16) + \">\";\n };\n var zeros = [\n \"\",\n \"0\",\n \"00\",\n \"000\",\n \"0000\",\n \"00000\",\n \"000000\",\n \"0000000\",\n \"00000000\",\n \"000000000\",\n \"0000000000\",\n \"00000000000\",\n \"000000000000\",\n \"0000000000000\",\n \"00000000000000\",\n \"000000000000000\",\n \"0000000000000000\",\n \"00000000000000000\",\n \"000000000000000000\",\n \"0000000000000000000\",\n \"00000000000000000000\",\n \"000000000000000000000\",\n \"0000000000000000000000\",\n \"00000000000000000000000\",\n \"000000000000000000000000\",\n \"0000000000000000000000000\"\n ], groupSizes = [\n 0,\n 0,\n 25,\n 16,\n 12,\n 11,\n 10,\n 9,\n 8,\n 8,\n 7,\n 7,\n 7,\n 7,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5\n ], groupBases = [\n 0,\n 0,\n 33554432,\n 43046721,\n 16777216,\n 48828125,\n 60466176,\n 40353607,\n 16777216,\n 43046721,\n 1e7,\n 19487171,\n 35831808,\n 62748517,\n 7529536,\n 11390625,\n 16777216,\n 24137569,\n 34012224,\n 47045881,\n 64000000,\n 4084101,\n 5153632,\n 6436343,\n 7962624,\n 9765625,\n 11881376,\n 14348907,\n 17210368,\n 20511149,\n 24300000,\n 28629151,\n 33554432,\n 39135393,\n 45435424,\n 52521875,\n 60466176\n ];\n BN.prototype.toString = function(base, padding) {\n base = base || 10, padding = padding | 0 || 1;\n var out;\n if (base === 16 || base === \"hex\") {\n out = \"\";\n for (var off = 0, carry = 0, i = 0;i < this.length; i++) {\n var w = this.words[i], word = ((w << off | carry) & 16777215).toString(16);\n carry = w >>> 24 - off & 16777215, carry !== 0 || i !== this.length - 1 \? out = zeros[6 - word.length] + word + out : out = word + out, off += 2, off >= 26 && (off -= 26, i--);\n }\n for (carry !== 0 && (out = carry.toString(16) + out);out.length % padding !== 0; )\n out = \"0\" + out;\n return this.negative !== 0 && (out = \"-\" + out), out;\n }\n if (base === (base | 0) && base >= 2 && base <= 36) {\n var groupSize = groupSizes[base], groupBase = groupBases[base];\n out = \"\";\n var c = this.clone();\n for (c.negative = 0;!c.isZero(); ) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase), c.isZero() \? out = r + out : out = zeros[groupSize - r.length] + r + out;\n }\n for (this.isZero() && (out = \"0\" + out);out.length % padding !== 0; )\n out = \"0\" + out;\n return this.negative !== 0 && (out = \"-\" + out), out;\n }\n assert(!1, \"Base should be between 2 and 36\");\n }, BN.prototype.toNumber = function() {\n var ret = this.words[0];\n return this.length === 2 \? ret += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 \? ret += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && assert(!1, \"Number can only safely store up to 53 bits\"), this.negative !== 0 \? -ret : ret;\n }, BN.prototype.toJSON = function() {\n return this.toString(16);\n }, BN.prototype.toBuffer = function(endian, length) {\n return assert(typeof Buffer2 < \"u\"), this.toArrayLike(Buffer2, endian, length);\n }, BN.prototype.toArray = function(endian, length) {\n return this.toArrayLike(Array, endian, length);\n }, BN.prototype.toArrayLike = function(ArrayType, endian, length) {\n var byteLength = this.byteLength(), reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, \"byte array longer than desired length\"), assert(reqLength > 0, \"Requested array length <= 0\"), this.strip();\n var littleEndian = endian === \"le\", res = new ArrayType(reqLength), b, i, q = this.clone();\n if (littleEndian) {\n for (i = 0;!q.isZero(); i++)\n b = q.andln(255), q.iushrn(8), res[i] = b;\n for (;i < reqLength; i++)\n res[i] = 0;\n } else {\n for (i = 0;i < reqLength - byteLength; i++)\n res[i] = 0;\n for (i = 0;!q.isZero(); i++)\n b = q.andln(255), q.iushrn(8), res[reqLength - i - 1] = b;\n }\n return res;\n }, Math.clz32 \? BN.prototype._countBits = function(w) {\n return 32 - Math.clz32(w);\n } : BN.prototype._countBits = function(w) {\n var t = w, r = 0;\n return t >= 4096 && (r += 13, t >>>= 13), t >= 64 && (r += 7, t >>>= 7), t >= 8 && (r += 4, t >>>= 4), t >= 2 && (r += 2, t >>>= 2), r + t;\n }, BN.prototype._zeroBits = function(w) {\n if (w === 0)\n return 26;\n var t = w, r = 0;\n return (t & 8191) === 0 && (r += 13, t >>>= 13), (t & 127) === 0 && (r += 7, t >>>= 7), (t & 15) === 0 && (r += 4, t >>>= 4), (t & 3) === 0 && (r += 2, t >>>= 2), (t & 1) === 0 && r++, r;\n }, BN.prototype.bitLength = function() {\n var w = this.words[this.length - 1], hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n function toBitArray(num) {\n for (var w = new Array(num.bitLength()), bit = 0;bit < w.length; bit++) {\n var off = bit / 26 | 0, wbit = bit % 26;\n w[bit] = (num.words[off] & 1 << wbit) >>> wbit;\n }\n return w;\n }\n BN.prototype.zeroBits = function() {\n if (this.isZero())\n return 0;\n for (var r = 0, i = 0;i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n if (r += b, b !== 26)\n break;\n }\n return r;\n }, BN.prototype.byteLength = function() {\n return Math.ceil(this.bitLength() / 8);\n }, BN.prototype.toTwos = function(width) {\n return this.negative !== 0 \? this.abs().inotn(width).iaddn(1) : this.clone();\n }, BN.prototype.fromTwos = function(width) {\n return this.testn(width - 1) \? this.notn(width).iaddn(1).ineg() : this.clone();\n }, BN.prototype.isNeg = function() {\n return this.negative !== 0;\n }, BN.prototype.neg = function() {\n return this.clone().ineg();\n }, BN.prototype.ineg = function() {\n return this.isZero() || (this.negative ^= 1), this;\n }, BN.prototype.iuor = function(num) {\n for (;this.length < num.length; )\n this.words[this.length++] = 0;\n for (var i = 0;i < num.length; i++)\n this.words[i] = this.words[i] | num.words[i];\n return this.strip();\n }, BN.prototype.ior = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuor(num);\n }, BN.prototype.or = function(num) {\n return this.length > num.length \? this.clone().ior(num) : num.clone().ior(this);\n }, BN.prototype.uor = function(num) {\n return this.length > num.length \? this.clone().iuor(num) : num.clone().iuor(this);\n }, BN.prototype.iuand = function(num) {\n var b;\n this.length > num.length \? b = num : b = this;\n for (var i = 0;i < b.length; i++)\n this.words[i] = this.words[i] & num.words[i];\n return this.length = b.length, this.strip();\n }, BN.prototype.iand = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuand(num);\n }, BN.prototype.and = function(num) {\n return this.length > num.length \? this.clone().iand(num) : num.clone().iand(this);\n }, BN.prototype.uand = function(num) {\n return this.length > num.length \? this.clone().iuand(num) : num.clone().iuand(this);\n }, BN.prototype.iuxor = function(num) {\n var a, b;\n this.length > num.length \? (a = this, b = num) : (a = num, b = this);\n for (var i = 0;i < b.length; i++)\n this.words[i] = a.words[i] ^ b.words[i];\n if (this !== a)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this.length = a.length, this.strip();\n }, BN.prototype.ixor = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuxor(num);\n }, BN.prototype.xor = function(num) {\n return this.length > num.length \? this.clone().ixor(num) : num.clone().ixor(this);\n }, BN.prototype.uxor = function(num) {\n return this.length > num.length \? this.clone().iuxor(num) : num.clone().iuxor(this);\n }, BN.prototype.inotn = function(width) {\n assert(typeof width == \"number\" && width >= 0);\n var bytesNeeded = Math.ceil(width / 26) | 0, bitsLeft = width % 26;\n this._expand(bytesNeeded), bitsLeft > 0 && bytesNeeded--;\n for (var i = 0;i < bytesNeeded; i++)\n this.words[i] = ~this.words[i] & 67108863;\n return bitsLeft > 0 && (this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft), this.strip();\n }, BN.prototype.notn = function(width) {\n return this.clone().inotn(width);\n }, BN.prototype.setn = function(bit, val) {\n assert(typeof bit == \"number\" && bit >= 0);\n var off = bit / 26 | 0, wbit = bit % 26;\n return this._expand(off + 1), val \? this.words[off] = this.words[off] | 1 << wbit : this.words[off] = this.words[off] & ~(1 << wbit), this.strip();\n }, BN.prototype.iadd = function(num) {\n var r;\n if (this.negative !== 0 && num.negative === 0)\n return this.negative = 0, r = this.isub(num), this.negative ^= 1, this._normSign();\n if (this.negative === 0 && num.negative !== 0)\n return num.negative = 0, r = this.isub(num), num.negative = 1, r._normSign();\n var a, b;\n this.length > num.length \? (a = this, b = num) : (a = num, b = this);\n for (var carry = 0, i = 0;i < b.length; i++)\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry, this.words[i] = r & 67108863, carry = r >>> 26;\n for (;carry !== 0 && i < a.length; i++)\n r = (a.words[i] | 0) + carry, this.words[i] = r & 67108863, carry = r >>> 26;\n if (this.length = a.length, carry !== 0)\n this.words[this.length] = carry, this.length++;\n else if (a !== this)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this;\n }, BN.prototype.add = function(num) {\n var res;\n return num.negative !== 0 && this.negative === 0 \? (num.negative = 0, res = this.sub(num), num.negative ^= 1, res) : num.negative === 0 && this.negative !== 0 \? (this.negative = 0, res = num.sub(this), this.negative = 1, res) : this.length > num.length \? this.clone().iadd(num) : num.clone().iadd(this);\n }, BN.prototype.isub = function(num) {\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n return num.negative = 1, r._normSign();\n } else if (this.negative !== 0)\n return this.negative = 0, this.iadd(num), this.negative = 1, this._normSign();\n var cmp = this.cmp(num);\n if (cmp === 0)\n return this.negative = 0, this.length = 1, this.words[0] = 0, this;\n var a, b;\n cmp > 0 \? (a = this, b = num) : (a = num, b = this);\n for (var carry = 0, i = 0;i < b.length; i++)\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry, carry = r >> 26, this.words[i] = r & 67108863;\n for (;carry !== 0 && i < a.length; i++)\n r = (a.words[i] | 0) + carry, carry = r >> 26, this.words[i] = r & 67108863;\n if (carry === 0 && i < a.length && a !== this)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this.length = Math.max(this.length, i), a !== this && (this.negative = 1), this.strip();\n }, BN.prototype.sub = function(num) {\n return this.clone().isub(num);\n };\n function smallMulTo(self2, num, out) {\n out.negative = num.negative ^ self2.negative;\n var len = self2.length + num.length | 0;\n out.length = len, len = len - 1 | 0;\n var a = self2.words[0] | 0, b = num.words[0] | 0, r = a * b, lo = r & 67108863, carry = r / 67108864 | 0;\n out.words[0] = lo;\n for (var k = 1;k < len; k++) {\n for (var ncarry = carry >>> 26, rword = carry & 67108863, maxJ = Math.min(k, num.length - 1), j = Math.max(0, k - self2.length + 1);j <= maxJ; j++) {\n var i = k - j | 0;\n a = self2.words[i] | 0, b = num.words[j] | 0, r = a * b + rword, ncarry += r / 67108864 | 0, rword = r & 67108863;\n }\n out.words[k] = rword | 0, carry = ncarry | 0;\n }\n return carry !== 0 \? out.words[k] = carry | 0 : out.length--, out.strip();\n }\n var comb10MulTo = function(self2, num, out) {\n var a = self2.words, b = num.words, o = out.words, c = 0, lo, mid, hi, a0 = a[0] | 0, al0 = a0 & 8191, ah0 = a0 >>> 13, a1 = a[1] | 0, al1 = a1 & 8191, ah1 = a1 >>> 13, a2 = a[2] | 0, al2 = a2 & 8191, ah2 = a2 >>> 13, a3 = a[3] | 0, al3 = a3 & 8191, ah3 = a3 >>> 13, a4 = a[4] | 0, al4 = a4 & 8191, ah4 = a4 >>> 13, a5 = a[5] | 0, al5 = a5 & 8191, ah5 = a5 >>> 13, a6 = a[6] | 0, al6 = a6 & 8191, ah6 = a6 >>> 13, a7 = a[7] | 0, al7 = a7 & 8191, ah7 = a7 >>> 13, a8 = a[8] | 0, al8 = a8 & 8191, ah8 = a8 >>> 13, a9 = a[9] | 0, al9 = a9 & 8191, ah9 = a9 >>> 13, b0 = b[0] | 0, bl0 = b0 & 8191, bh0 = b0 >>> 13, b1 = b[1] | 0, bl1 = b1 & 8191, bh1 = b1 >>> 13, b2 = b[2] | 0, bl2 = b2 & 8191, bh2 = b2 >>> 13, b3 = b[3] | 0, bl3 = b3 & 8191, bh3 = b3 >>> 13, b4 = b[4] | 0, bl4 = b4 & 8191, bh4 = b4 >>> 13, b5 = b[5] | 0, bl5 = b5 & 8191, bh5 = b5 >>> 13, b6 = b[6] | 0, bl6 = b6 & 8191, bh6 = b6 >>> 13, b7 = b[7] | 0, bl7 = b7 & 8191, bh7 = b7 >>> 13, b8 = b[8] | 0, bl8 = b8 & 8191, bh8 = b8 >>> 13, b9 = b[9] | 0, bl9 = b9 & 8191, bh9 = b9 >>> 13;\n out.negative = self2.negative ^ num.negative, out.length = 19, lo = Math.imul(al0, bl0), mid = Math.imul(al0, bh0), mid = mid + Math.imul(ah0, bl0) | 0, hi = Math.imul(ah0, bh0);\n var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0, w0 &= 67108863, lo = Math.imul(al1, bl0), mid = Math.imul(al1, bh0), mid = mid + Math.imul(ah1, bl0) | 0, hi = Math.imul(ah1, bh0), lo = lo + Math.imul(al0, bl1) | 0, mid = mid + Math.imul(al0, bh1) | 0, mid = mid + Math.imul(ah0, bl1) | 0, hi = hi + Math.imul(ah0, bh1) | 0;\n var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0, w1 &= 67108863, lo = Math.imul(al2, bl0), mid = Math.imul(al2, bh0), mid = mid + Math.imul(ah2, bl0) | 0, hi = Math.imul(ah2, bh0), lo = lo + Math.imul(al1, bl1) | 0, mid = mid + Math.imul(al1, bh1) | 0, mid = mid + Math.imul(ah1, bl1) | 0, hi = hi + Math.imul(ah1, bh1) | 0, lo = lo + Math.imul(al0, bl2) | 0, mid = mid + Math.imul(al0, bh2) | 0, mid = mid + Math.imul(ah0, bl2) | 0, hi = hi + Math.imul(ah0, bh2) | 0;\n var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0, w2 &= 67108863, lo = Math.imul(al3, bl0), mid = Math.imul(al3, bh0), mid = mid + Math.imul(ah3, bl0) | 0, hi = Math.imul(ah3, bh0), lo = lo + Math.imul(al2, bl1) | 0, mid = mid + Math.imul(al2, bh1) | 0, mid = mid + Math.imul(ah2, bl1) | 0, hi = hi + Math.imul(ah2, bh1) | 0, lo = lo + Math.imul(al1, bl2) | 0, mid = mid + Math.imul(al1, bh2) | 0, mid = mid + Math.imul(ah1, bl2) | 0, hi = hi + Math.imul(ah1, bh2) | 0, lo = lo + Math.imul(al0, bl3) | 0, mid = mid + Math.imul(al0, bh3) | 0, mid = mid + Math.imul(ah0, bl3) | 0, hi = hi + Math.imul(ah0, bh3) | 0;\n var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0, w3 &= 67108863, lo = Math.imul(al4, bl0), mid = Math.imul(al4, bh0), mid = mid + Math.imul(ah4, bl0) | 0, hi = Math.imul(ah4, bh0), lo = lo + Math.imul(al3, bl1) | 0, mid = mid + Math.imul(al3, bh1) | 0, mid = mid + Math.imul(ah3, bl1) | 0, hi = hi + Math.imul(ah3, bh1) | 0, lo = lo + Math.imul(al2, bl2) | 0, mid = mid + Math.imul(al2, bh2) | 0, mid = mid + Math.imul(ah2, bl2) | 0, hi = hi + Math.imul(ah2, bh2) | 0, lo = lo + Math.imul(al1, bl3) | 0, mid = mid + Math.imul(al1, bh3) | 0, mid = mid + Math.imul(ah1, bl3) | 0, hi = hi + Math.imul(ah1, bh3) | 0, lo = lo + Math.imul(al0, bl4) | 0, mid = mid + Math.imul(al0, bh4) | 0, mid = mid + Math.imul(ah0, bl4) | 0, hi = hi + Math.imul(ah0, bh4) | 0;\n var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0, w4 &= 67108863, lo = Math.imul(al5, bl0), mid = Math.imul(al5, bh0), mid = mid + Math.imul(ah5, bl0) | 0, hi = Math.imul(ah5, bh0), lo = lo + Math.imul(al4, bl1) | 0, mid = mid + Math.imul(al4, bh1) | 0, mid = mid + Math.imul(ah4, bl1) | 0, hi = hi + Math.imul(ah4, bh1) | 0, lo = lo + Math.imul(al3, bl2) | 0, mid = mid + Math.imul(al3, bh2) | 0, mid = mid + Math.imul(ah3, bl2) | 0, hi = hi + Math.imul(ah3, bh2) | 0, lo = lo + Math.imul(al2, bl3) | 0, mid = mid + Math.imul(al2, bh3) | 0, mid = mid + Math.imul(ah2, bl3) | 0, hi = hi + Math.imul(ah2, bh3) | 0, lo = lo + Math.imul(al1, bl4) | 0, mid = mid + Math.imul(al1, bh4) | 0, mid = mid + Math.imul(ah1, bl4) | 0, hi = hi + Math.imul(ah1, bh4) | 0, lo = lo + Math.imul(al0, bl5) | 0, mid = mid + Math.imul(al0, bh5) | 0, mid = mid + Math.imul(ah0, bl5) | 0, hi = hi + Math.imul(ah0, bh5) | 0;\n var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0, w5 &= 67108863, lo = Math.imul(al6, bl0), mid = Math.imul(al6, bh0), mid = mid + Math.imul(ah6, bl0) | 0, hi = Math.imul(ah6, bh0), lo = lo + Math.imul(al5, bl1) | 0, mid = mid + Math.imul(al5, bh1) | 0, mid = mid + Math.imul(ah5, bl1) | 0, hi = hi + Math.imul(ah5, bh1) | 0, lo = lo + Math.imul(al4, bl2) | 0, mid = mid + Math.imul(al4, bh2) | 0, mid = mid + Math.imul(ah4, bl2) | 0, hi = hi + Math.imul(ah4, bh2) | 0, lo = lo + Math.imul(al3, bl3) | 0, mid = mid + Math.imul(al3, bh3) | 0, mid = mid + Math.imul(ah3, bl3) | 0, hi = hi + Math.imul(ah3, bh3) | 0, lo = lo + Math.imul(al2, bl4) | 0, mid = mid + Math.imul(al2, bh4) | 0, mid = mid + Math.imul(ah2, bl4) | 0, hi = hi + Math.imul(ah2, bh4) | 0, lo = lo + Math.imul(al1, bl5) | 0, mid = mid + Math.imul(al1, bh5) | 0, mid = mid + Math.imul(ah1, bl5) | 0, hi = hi + Math.imul(ah1, bh5) | 0, lo = lo + Math.imul(al0, bl6) | 0, mid = mid + Math.imul(al0, bh6) | 0, mid = mid + Math.imul(ah0, bl6) | 0, hi = hi + Math.imul(ah0, bh6) | 0;\n var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0, w6 &= 67108863, lo = Math.imul(al7, bl0), mid = Math.imul(al7, bh0), mid = mid + Math.imul(ah7, bl0) | 0, hi = Math.imul(ah7, bh0), lo = lo + Math.imul(al6, bl1) | 0, mid = mid + Math.imul(al6, bh1) | 0, mid = mid + Math.imul(ah6, bl1) | 0, hi = hi + Math.imul(ah6, bh1) | 0, lo = lo + Math.imul(al5, bl2) | 0, mid = mid + Math.imul(al5, bh2) | 0, mid = mid + Math.imul(ah5, bl2) | 0, hi = hi + Math.imul(ah5, bh2) | 0, lo = lo + Math.imul(al4, bl3) | 0, mid = mid + Math.imul(al4, bh3) | 0, mid = mid + Math.imul(ah4, bl3) | 0, hi = hi + Math.imul(ah4, bh3) | 0, lo = lo + Math.imul(al3, bl4) | 0, mid = mid + Math.imul(al3, bh4) | 0, mid = mid + Math.imul(ah3, bl4) | 0, hi = hi + Math.imul(ah3, bh4) | 0, lo = lo + Math.imul(al2, bl5) | 0, mid = mid + Math.imul(al2, bh5) | 0, mid = mid + Math.imul(ah2, bl5) | 0, hi = hi + Math.imul(ah2, bh5) | 0, lo = lo + Math.imul(al1, bl6) | 0, mid = mid + Math.imul(al1, bh6) | 0, mid = mid + Math.imul(ah1, bl6) | 0, hi = hi + Math.imul(ah1, bh6) | 0, lo = lo + Math.imul(al0, bl7) | 0, mid = mid + Math.imul(al0, bh7) | 0, mid = mid + Math.imul(ah0, bl7) | 0, hi = hi + Math.imul(ah0, bh7) | 0;\n var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0, w7 &= 67108863, lo = Math.imul(al8, bl0), mid = Math.imul(al8, bh0), mid = mid + Math.imul(ah8, bl0) | 0, hi = Math.imul(ah8, bh0), lo = lo + Math.imul(al7, bl1) | 0, mid = mid + Math.imul(al7, bh1) | 0, mid = mid + Math.imul(ah7, bl1) | 0, hi = hi + Math.imul(ah7, bh1) | 0, lo = lo + Math.imul(al6, bl2) | 0, mid = mid + Math.imul(al6, bh2) | 0, mid = mid + Math.imul(ah6, bl2) | 0, hi = hi + Math.imul(ah6, bh2) | 0, lo = lo + Math.imul(al5, bl3) | 0, mid = mid + Math.imul(al5, bh3) | 0, mid = mid + Math.imul(ah5, bl3) | 0, hi = hi + Math.imul(ah5, bh3) | 0, lo = lo + Math.imul(al4, bl4) | 0, mid = mid + Math.imul(al4, bh4) | 0, mid = mid + Math.imul(ah4, bl4) | 0, hi = hi + Math.imul(ah4, bh4) | 0, lo = lo + Math.imul(al3, bl5) | 0, mid = mid + Math.imul(al3, bh5) | 0, mid = mid + Math.imul(ah3, bl5) | 0, hi = hi + Math.imul(ah3, bh5) | 0, lo = lo + Math.imul(al2, bl6) | 0, mid = mid + Math.imul(al2, bh6) | 0, mid = mid + Math.imul(ah2, bl6) | 0, hi = hi + Math.imul(ah2, bh6) | 0, lo = lo + Math.imul(al1, bl7) | 0, mid = mid + Math.imul(al1, bh7) | 0, mid = mid + Math.imul(ah1, bl7) | 0, hi = hi + Math.imul(ah1, bh7) | 0, lo = lo + Math.imul(al0, bl8) | 0, mid = mid + Math.imul(al0, bh8) | 0, mid = mid + Math.imul(ah0, bl8) | 0, hi = hi + Math.imul(ah0, bh8) | 0;\n var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0, w8 &= 67108863, lo = Math.imul(al9, bl0), mid = Math.imul(al9, bh0), mid = mid + Math.imul(ah9, bl0) | 0, hi = Math.imul(ah9, bh0), lo = lo + Math.imul(al8, bl1) | 0, mid = mid + Math.imul(al8, bh1) | 0, mid = mid + Math.imul(ah8, bl1) | 0, hi = hi + Math.imul(ah8, bh1) | 0, lo = lo + Math.imul(al7, bl2) | 0, mid = mid + Math.imul(al7, bh2) | 0, mid = mid + Math.imul(ah7, bl2) | 0, hi = hi + Math.imul(ah7, bh2) | 0, lo = lo + Math.imul(al6, bl3) | 0, mid = mid + Math.imul(al6, bh3) | 0, mid = mid + Math.imul(ah6, bl3) | 0, hi = hi + Math.imul(ah6, bh3) | 0, lo = lo + Math.imul(al5, bl4) | 0, mid = mid + Math.imul(al5, bh4) | 0, mid = mid + Math.imul(ah5, bl4) | 0, hi = hi + Math.imul(ah5, bh4) | 0, lo = lo + Math.imul(al4, bl5) | 0, mid = mid + Math.imul(al4, bh5) | 0, mid = mid + Math.imul(ah4, bl5) | 0, hi = hi + Math.imul(ah4, bh5) | 0, lo = lo + Math.imul(al3, bl6) | 0, mid = mid + Math.imul(al3, bh6) | 0, mid = mid + Math.imul(ah3, bl6) | 0, hi = hi + Math.imul(ah3, bh6) | 0, lo = lo + Math.imul(al2, bl7) | 0, mid = mid + Math.imul(al2, bh7) | 0, mid = mid + Math.imul(ah2, bl7) | 0, hi = hi + Math.imul(ah2, bh7) | 0, lo = lo + Math.imul(al1, bl8) | 0, mid = mid + Math.imul(al1, bh8) | 0, mid = mid + Math.imul(ah1, bl8) | 0, hi = hi + Math.imul(ah1, bh8) | 0, lo = lo + Math.imul(al0, bl9) | 0, mid = mid + Math.imul(al0, bh9) | 0, mid = mid + Math.imul(ah0, bl9) | 0, hi = hi + Math.imul(ah0, bh9) | 0;\n var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0, w9 &= 67108863, lo = Math.imul(al9, bl1), mid = Math.imul(al9, bh1), mid = mid + Math.imul(ah9, bl1) | 0, hi = Math.imul(ah9, bh1), lo = lo + Math.imul(al8, bl2) | 0, mid = mid + Math.imul(al8, bh2) | 0, mid = mid + Math.imul(ah8, bl2) | 0, hi = hi + Math.imul(ah8, bh2) | 0, lo = lo + Math.imul(al7, bl3) | 0, mid = mid + Math.imul(al7, bh3) | 0, mid = mid + Math.imul(ah7, bl3) | 0, hi = hi + Math.imul(ah7, bh3) | 0, lo = lo + Math.imul(al6, bl4) | 0, mid = mid + Math.imul(al6, bh4) | 0, mid = mid + Math.imul(ah6, bl4) | 0, hi = hi + Math.imul(ah6, bh4) | 0, lo = lo + Math.imul(al5, bl5) | 0, mid = mid + Math.imul(al5, bh5) | 0, mid = mid + Math.imul(ah5, bl5) | 0, hi = hi + Math.imul(ah5, bh5) | 0, lo = lo + Math.imul(al4, bl6) | 0, mid = mid + Math.imul(al4, bh6) | 0, mid = mid + Math.imul(ah4, bl6) | 0, hi = hi + Math.imul(ah4, bh6) | 0, lo = lo + Math.imul(al3, bl7) | 0, mid = mid + Math.imul(al3, bh7) | 0, mid = mid + Math.imul(ah3, bl7) | 0, hi = hi + Math.imul(ah3, bh7) | 0, lo = lo + Math.imul(al2, bl8) | 0, mid = mid + Math.imul(al2, bh8) | 0, mid = mid + Math.imul(ah2, bl8) | 0, hi = hi + Math.imul(ah2, bh8) | 0, lo = lo + Math.imul(al1, bl9) | 0, mid = mid + Math.imul(al1, bh9) | 0, mid = mid + Math.imul(ah1, bl9) | 0, hi = hi + Math.imul(ah1, bh9) | 0;\n var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0, w10 &= 67108863, lo = Math.imul(al9, bl2), mid = Math.imul(al9, bh2), mid = mid + Math.imul(ah9, bl2) | 0, hi = Math.imul(ah9, bh2), lo = lo + Math.imul(al8, bl3) | 0, mid = mid + Math.imul(al8, bh3) | 0, mid = mid + Math.imul(ah8, bl3) | 0, hi = hi + Math.imul(ah8, bh3) | 0, lo = lo + Math.imul(al7, bl4) | 0, mid = mid + Math.imul(al7, bh4) | 0, mid = mid + Math.imul(ah7, bl4) | 0, hi = hi + Math.imul(ah7, bh4) | 0, lo = lo + Math.imul(al6, bl5) | 0, mid = mid + Math.imul(al6, bh5) | 0, mid = mid + Math.imul(ah6, bl5) | 0, hi = hi + Math.imul(ah6, bh5) | 0, lo = lo + Math.imul(al5, bl6) | 0, mid = mid + Math.imul(al5, bh6) | 0, mid = mid + Math.imul(ah5, bl6) | 0, hi = hi + Math.imul(ah5, bh6) | 0, lo = lo + Math.imul(al4, bl7) | 0, mid = mid + Math.imul(al4, bh7) | 0, mid = mid + Math.imul(ah4, bl7) | 0, hi = hi + Math.imul(ah4, bh7) | 0, lo = lo + Math.imul(al3, bl8) | 0, mid = mid + Math.imul(al3, bh8) | 0, mid = mid + Math.imul(ah3, bl8) | 0, hi = hi + Math.imul(ah3, bh8) | 0, lo = lo + Math.imul(al2, bl9) | 0, mid = mid + Math.imul(al2, bh9) | 0, mid = mid + Math.imul(ah2, bl9) | 0, hi = hi + Math.imul(ah2, bh9) | 0;\n var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0, w11 &= 67108863, lo = Math.imul(al9, bl3), mid = Math.imul(al9, bh3), mid = mid + Math.imul(ah9, bl3) | 0, hi = Math.imul(ah9, bh3), lo = lo + Math.imul(al8, bl4) | 0, mid = mid + Math.imul(al8, bh4) | 0, mid = mid + Math.imul(ah8, bl4) | 0, hi = hi + Math.imul(ah8, bh4) | 0, lo = lo + Math.imul(al7, bl5) | 0, mid = mid + Math.imul(al7, bh5) | 0, mid = mid + Math.imul(ah7, bl5) | 0, hi = hi + Math.imul(ah7, bh5) | 0, lo = lo + Math.imul(al6, bl6) | 0, mid = mid + Math.imul(al6, bh6) | 0, mid = mid + Math.imul(ah6, bl6) | 0, hi = hi + Math.imul(ah6, bh6) | 0, lo = lo + Math.imul(al5, bl7) | 0, mid = mid + Math.imul(al5, bh7) | 0, mid = mid + Math.imul(ah5, bl7) | 0, hi = hi + Math.imul(ah5, bh7) | 0, lo = lo + Math.imul(al4, bl8) | 0, mid = mid + Math.imul(al4, bh8) | 0, mid = mid + Math.imul(ah4, bl8) | 0, hi = hi + Math.imul(ah4, bh8) | 0, lo = lo + Math.imul(al3, bl9) | 0, mid = mid + Math.imul(al3, bh9) | 0, mid = mid + Math.imul(ah3, bl9) | 0, hi = hi + Math.imul(ah3, bh9) | 0;\n var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0, w12 &= 67108863, lo = Math.imul(al9, bl4), mid = Math.imul(al9, bh4), mid = mid + Math.imul(ah9, bl4) | 0, hi = Math.imul(ah9, bh4), lo = lo + Math.imul(al8, bl5) | 0, mid = mid + Math.imul(al8, bh5) | 0, mid = mid + Math.imul(ah8, bl5) | 0, hi = hi + Math.imul(ah8, bh5) | 0, lo = lo + Math.imul(al7, bl6) | 0, mid = mid + Math.imul(al7, bh6) | 0, mid = mid + Math.imul(ah7, bl6) | 0, hi = hi + Math.imul(ah7, bh6) | 0, lo = lo + Math.imul(al6, bl7) | 0, mid = mid + Math.imul(al6, bh7) | 0, mid = mid + Math.imul(ah6, bl7) | 0, hi = hi + Math.imul(ah6, bh7) | 0, lo = lo + Math.imul(al5, bl8) | 0, mid = mid + Math.imul(al5, bh8) | 0, mid = mid + Math.imul(ah5, bl8) | 0, hi = hi + Math.imul(ah5, bh8) | 0, lo = lo + Math.imul(al4, bl9) | 0, mid = mid + Math.imul(al4, bh9) | 0, mid = mid + Math.imul(ah4, bl9) | 0, hi = hi + Math.imul(ah4, bh9) | 0;\n var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0, w13 &= 67108863, lo = Math.imul(al9, bl5), mid = Math.imul(al9, bh5), mid = mid + Math.imul(ah9, bl5) | 0, hi = Math.imul(ah9, bh5), lo = lo + Math.imul(al8, bl6) | 0, mid = mid + Math.imul(al8, bh6) | 0, mid = mid + Math.imul(ah8, bl6) | 0, hi = hi + Math.imul(ah8, bh6) | 0, lo = lo + Math.imul(al7, bl7) | 0, mid = mid + Math.imul(al7, bh7) | 0, mid = mid + Math.imul(ah7, bl7) | 0, hi = hi + Math.imul(ah7, bh7) | 0, lo = lo + Math.imul(al6, bl8) | 0, mid = mid + Math.imul(al6, bh8) | 0, mid = mid + Math.imul(ah6, bl8) | 0, hi = hi + Math.imul(ah6, bh8) | 0, lo = lo + Math.imul(al5, bl9) | 0, mid = mid + Math.imul(al5, bh9) | 0, mid = mid + Math.imul(ah5, bl9) | 0, hi = hi + Math.imul(ah5, bh9) | 0;\n var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0, w14 &= 67108863, lo = Math.imul(al9, bl6), mid = Math.imul(al9, bh6), mid = mid + Math.imul(ah9, bl6) | 0, hi = Math.imul(ah9, bh6), lo = lo + Math.imul(al8, bl7) | 0, mid = mid + Math.imul(al8, bh7) | 0, mid = mid + Math.imul(ah8, bl7) | 0, hi = hi + Math.imul(ah8, bh7) | 0, lo = lo + Math.imul(al7, bl8) | 0, mid = mid + Math.imul(al7, bh8) | 0, mid = mid + Math.imul(ah7, bl8) | 0, hi = hi + Math.imul(ah7, bh8) | 0, lo = lo + Math.imul(al6, bl9) | 0, mid = mid + Math.imul(al6, bh9) | 0, mid = mid + Math.imul(ah6, bl9) | 0, hi = hi + Math.imul(ah6, bh9) | 0;\n var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0, w15 &= 67108863, lo = Math.imul(al9, bl7), mid = Math.imul(al9, bh7), mid = mid + Math.imul(ah9, bl7) | 0, hi = Math.imul(ah9, bh7), lo = lo + Math.imul(al8, bl8) | 0, mid = mid + Math.imul(al8, bh8) | 0, mid = mid + Math.imul(ah8, bl8) | 0, hi = hi + Math.imul(ah8, bh8) | 0, lo = lo + Math.imul(al7, bl9) | 0, mid = mid + Math.imul(al7, bh9) | 0, mid = mid + Math.imul(ah7, bl9) | 0, hi = hi + Math.imul(ah7, bh9) | 0;\n var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0, w16 &= 67108863, lo = Math.imul(al9, bl8), mid = Math.imul(al9, bh8), mid = mid + Math.imul(ah9, bl8) | 0, hi = Math.imul(ah9, bh8), lo = lo + Math.imul(al8, bl9) | 0, mid = mid + Math.imul(al8, bh9) | 0, mid = mid + Math.imul(ah8, bl9) | 0, hi = hi + Math.imul(ah8, bh9) | 0;\n var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0, w17 &= 67108863, lo = Math.imul(al9, bl9), mid = Math.imul(al9, bh9), mid = mid + Math.imul(ah9, bl9) | 0, hi = Math.imul(ah9, bh9);\n var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n return c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0, w18 &= 67108863, o[0] = w0, o[1] = w1, o[2] = w2, o[3] = w3, o[4] = w4, o[5] = w5, o[6] = w6, o[7] = w7, o[8] = w8, o[9] = w9, o[10] = w10, o[11] = w11, o[12] = w12, o[13] = w13, o[14] = w14, o[15] = w15, o[16] = w16, o[17] = w17, o[18] = w18, c !== 0 && (o[19] = c, out.length++), out;\n };\n Math.imul || (comb10MulTo = smallMulTo);\n function bigMulTo(self2, num, out) {\n out.negative = num.negative ^ self2.negative, out.length = self2.length + num.length;\n for (var carry = 0, hncarry = 0, k = 0;k < out.length - 1; k++) {\n var ncarry = hncarry;\n hncarry = 0;\n for (var rword = carry & 67108863, maxJ = Math.min(k, num.length - 1), j = Math.max(0, k - self2.length + 1);j <= maxJ; j++) {\n var i = k - j, a = self2.words[i] | 0, b = num.words[j] | 0, r = a * b, lo = r & 67108863;\n ncarry = ncarry + (r / 67108864 | 0) | 0, lo = lo + rword | 0, rword = lo & 67108863, ncarry = ncarry + (lo >>> 26) | 0, hncarry += ncarry >>> 26, ncarry &= 67108863;\n }\n out.words[k] = rword, carry = ncarry, ncarry = hncarry;\n }\n return carry !== 0 \? out.words[k] = carry : out.length--, out.strip();\n }\n function jumboMulTo(self2, num, out) {\n var fftm = new FFTM;\n return fftm.mulp(self2, num, out);\n }\n BN.prototype.mulTo = function(num, out) {\n var res, len = this.length + num.length;\n return this.length === 10 && num.length === 10 \? res = comb10MulTo(this, num, out) : len < 63 \? res = smallMulTo(this, num, out) : len < 1024 \? res = bigMulTo(this, num, out) : res = jumboMulTo(this, num, out), res;\n };\n function FFTM(x, y) {\n this.x = x, this.y = y;\n }\n FFTM.prototype = {}, FFTM.prototype.makeRBT = function(N) {\n for (var t = new Array(N), l = BN.prototype._countBits(N) - 1, i = 0;i < N; i++)\n t[i] = this.revBin(i, l, N);\n return t;\n }, FFTM.prototype.revBin = function(x, l, N) {\n if (x === 0 || x === N - 1)\n return x;\n for (var rb = 0, i = 0;i < l; i++)\n rb |= (x & 1) << l - i - 1, x >>= 1;\n return rb;\n }, FFTM.prototype.permute = function(rbt, rws, iws, rtws, itws, N) {\n for (var i = 0;i < N; i++)\n rtws[i] = rws[rbt[i]], itws[i] = iws[rbt[i]];\n }, FFTM.prototype.transform = function(rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n for (var s = 1;s < N; s <<= 1)\n for (var l = s << 1, rtwdf = Math.cos(2 * Math.PI / l), itwdf = Math.sin(2 * Math.PI / l), p = 0;p < N; p += l)\n for (var rtwdf_ = rtwdf, itwdf_ = itwdf, j = 0;j < s; j++) {\n var re = rtws[p + j], ie = itws[p + j], ro = rtws[p + j + s], io = itws[p + j + s], rx = rtwdf_ * ro - itwdf_ * io;\n io = rtwdf_ * io + itwdf_ * ro, ro = rx, rtws[p + j] = re + ro, itws[p + j] = ie + io, rtws[p + j + s] = re - ro, itws[p + j + s] = ie - io, j !== l && (rx = rtwdf * rtwdf_ - itwdf * itwdf_, itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_, rtwdf_ = rx);\n }\n }, FFTM.prototype.guessLen13b = function(n, m) {\n var N = Math.max(m, n) | 1, odd = N & 1, i = 0;\n for (N = N / 2 | 0;N; N = N >>> 1)\n i++;\n return 1 << i + 1 + odd;\n }, FFTM.prototype.conjugate = function(rws, iws, N) {\n if (!(N <= 1))\n for (var i = 0;i < N / 2; i++) {\n var t = rws[i];\n rws[i] = rws[N - i - 1], rws[N - i - 1] = t, t = iws[i], iws[i] = -iws[N - i - 1], iws[N - i - 1] = -t;\n }\n }, FFTM.prototype.normalize13b = function(ws, N) {\n for (var carry = 0, i = 0;i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;\n ws[i] = w & 67108863, w < 67108864 \? carry = 0 : carry = w / 67108864 | 0;\n }\n return ws;\n }, FFTM.prototype.convert13b = function(ws, len, rws, N) {\n for (var carry = 0, i = 0;i < len; i++)\n carry = carry + (ws[i] | 0), rws[2 * i] = carry & 8191, carry = carry >>> 13, rws[2 * i + 1] = carry & 8191, carry = carry >>> 13;\n for (i = 2 * len;i < N; ++i)\n rws[i] = 0;\n assert(carry === 0), assert((carry & -8192) === 0);\n }, FFTM.prototype.stub = function(N) {\n for (var ph = new Array(N), i = 0;i < N; i++)\n ph[i] = 0;\n return ph;\n }, FFTM.prototype.mulp = function(x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length), rbt = this.makeRBT(N), _ = this.stub(N), rws = new Array(N), rwst = new Array(N), iwst = new Array(N), nrws = new Array(N), nrwst = new Array(N), niwst = new Array(N), rmws = out.words;\n rmws.length = N, this.convert13b(x.words, x.length, rws, N), this.convert13b(y.words, y.length, nrws, N), this.transform(rws, _, rwst, iwst, N, rbt), this.transform(nrws, _, nrwst, niwst, N, rbt);\n for (var i = 0;i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i], rwst[i] = rx;\n }\n return this.conjugate(rwst, iwst, N), this.transform(rwst, iwst, rmws, _, N, rbt), this.conjugate(rmws, _, N), this.normalize13b(rmws, N), out.negative = x.negative ^ y.negative, out.length = x.length + y.length, out.strip();\n }, BN.prototype.mul = function(num) {\n var out = new BN(null);\n return out.words = new Array(this.length + num.length), this.mulTo(num, out);\n }, BN.prototype.mulf = function(num) {\n var out = new BN(null);\n return out.words = new Array(this.length + num.length), jumboMulTo(this, num, out);\n }, BN.prototype.imul = function(num) {\n return this.clone().mulTo(num, this);\n }, BN.prototype.imuln = function(num) {\n assert(typeof num == \"number\"), assert(num < 67108864);\n for (var carry = 0, i = 0;i < this.length; i++) {\n var w = (this.words[i] | 0) * num, lo = (w & 67108863) + (carry & 67108863);\n carry >>= 26, carry += w / 67108864 | 0, carry += lo >>> 26, this.words[i] = lo & 67108863;\n }\n return carry !== 0 && (this.words[i] = carry, this.length++), this;\n }, BN.prototype.muln = function(num) {\n return this.clone().imuln(num);\n }, BN.prototype.sqr = function() {\n return this.mul(this);\n }, BN.prototype.isqr = function() {\n return this.imul(this.clone());\n }, BN.prototype.pow = function(num) {\n var w = toBitArray(num);\n if (w.length === 0)\n return new BN(1);\n for (var res = this, i = 0;i < w.length && w[i] === 0; i++, res = res.sqr())\n ;\n if (++i < w.length)\n for (var q = res.sqr();i < w.length; i++, q = q.sqr())\n w[i] !== 0 && (res = res.mul(q));\n return res;\n }, BN.prototype.iushln = function(bits) {\n assert(typeof bits == \"number\" && bits >= 0);\n var r = bits % 26, s = (bits - r) / 26, carryMask = 67108863 >>> 26 - r << 26 - r, i;\n if (r !== 0) {\n var carry = 0;\n for (i = 0;i < this.length; i++) {\n var newCarry = this.words[i] & carryMask, c = (this.words[i] | 0) - newCarry << r;\n this.words[i] = c | carry, carry = newCarry >>> 26 - r;\n }\n carry && (this.words[i] = carry, this.length++);\n }\n if (s !== 0) {\n for (i = this.length - 1;i >= 0; i--)\n this.words[i + s] = this.words[i];\n for (i = 0;i < s; i++)\n this.words[i] = 0;\n this.length += s;\n }\n return this.strip();\n }, BN.prototype.ishln = function(bits) {\n return assert(this.negative === 0), this.iushln(bits);\n }, BN.prototype.iushrn = function(bits, hint, extended) {\n assert(typeof bits == \"number\" && bits >= 0);\n var h;\n hint \? h = (hint - hint % 26) / 26 : h = 0;\n var r = bits % 26, s = Math.min((bits - r) / 26, this.length), mask = 67108863 ^ 67108863 >>> r << r, maskedWords = extended;\n if (h -= s, h = Math.max(0, h), maskedWords) {\n for (var i = 0;i < s; i++)\n maskedWords.words[i] = this.words[i];\n maskedWords.length = s;\n }\n if (s !== 0)\n if (this.length > s)\n for (this.length -= s, i = 0;i < this.length; i++)\n this.words[i] = this.words[i + s];\n else\n this.words[0] = 0, this.length = 1;\n var carry = 0;\n for (i = this.length - 1;i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = carry << 26 - r | word >>> r, carry = word & mask;\n }\n return maskedWords && carry !== 0 && (maskedWords.words[maskedWords.length++] = carry), this.length === 0 && (this.words[0] = 0, this.length = 1), this.strip();\n }, BN.prototype.ishrn = function(bits, hint, extended) {\n return assert(this.negative === 0), this.iushrn(bits, hint, extended);\n }, BN.prototype.shln = function(bits) {\n return this.clone().ishln(bits);\n }, BN.prototype.ushln = function(bits) {\n return this.clone().iushln(bits);\n }, BN.prototype.shrn = function(bits) {\n return this.clone().ishrn(bits);\n }, BN.prototype.ushrn = function(bits) {\n return this.clone().iushrn(bits);\n }, BN.prototype.testn = function(bit) {\n assert(typeof bit == \"number\" && bit >= 0);\n var r = bit % 26, s = (bit - r) / 26, q = 1 << r;\n if (this.length <= s)\n return !1;\n var w = this.words[s];\n return !!(w & q);\n }, BN.prototype.imaskn = function(bits) {\n assert(typeof bits == \"number\" && bits >= 0);\n var r = bits % 26, s = (bits - r) / 26;\n if (assert(this.negative === 0, \"imaskn works only with positive numbers\"), this.length <= s)\n return this;\n if (r !== 0 && s++, this.length = Math.min(s, this.length), r !== 0) {\n var mask = 67108863 ^ 67108863 >>> r << r;\n this.words[this.length - 1] &= mask;\n }\n return this.strip();\n }, BN.prototype.maskn = function(bits) {\n return this.clone().imaskn(bits);\n }, BN.prototype.iaddn = function(num) {\n return assert(typeof num == \"number\"), assert(num < 67108864), num < 0 \? this.isubn(-num) : this.negative !== 0 \? this.length === 1 && (this.words[0] | 0) < num \? (this.words[0] = num - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(num), this.negative = 1, this) : this._iaddn(num);\n }, BN.prototype._iaddn = function(num) {\n this.words[0] += num;\n for (var i = 0;i < this.length && this.words[i] >= 67108864; i++)\n this.words[i] -= 67108864, i === this.length - 1 \? this.words[i + 1] = 1 : this.words[i + 1]++;\n return this.length = Math.max(this.length, i + 1), this;\n }, BN.prototype.isubn = function(num) {\n if (assert(typeof num == \"number\"), assert(num < 67108864), num < 0)\n return this.iaddn(-num);\n if (this.negative !== 0)\n return this.negative = 0, this.iaddn(num), this.negative = 1, this;\n if (this.words[0] -= num, this.length === 1 && this.words[0] < 0)\n this.words[0] = -this.words[0], this.negative = 1;\n else\n for (var i = 0;i < this.length && this.words[i] < 0; i++)\n this.words[i] += 67108864, this.words[i + 1] -= 1;\n return this.strip();\n }, BN.prototype.addn = function(num) {\n return this.clone().iaddn(num);\n }, BN.prototype.subn = function(num) {\n return this.clone().isubn(num);\n }, BN.prototype.iabs = function() {\n return this.negative = 0, this;\n }, BN.prototype.abs = function() {\n return this.clone().iabs();\n }, BN.prototype._ishlnsubmul = function(num, mul, shift) {\n var len = num.length + shift, i;\n this._expand(len);\n var w, carry = 0;\n for (i = 0;i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 67108863, carry = (w >> 26) - (right / 67108864 | 0), this.words[i + shift] = w & 67108863;\n }\n for (;i < this.length - shift; i++)\n w = (this.words[i + shift] | 0) + carry, carry = w >> 26, this.words[i + shift] = w & 67108863;\n if (carry === 0)\n return this.strip();\n for (assert(carry === -1), carry = 0, i = 0;i < this.length; i++)\n w = -(this.words[i] | 0) + carry, carry = w >> 26, this.words[i] = w & 67108863;\n return this.negative = 1, this.strip();\n }, BN.prototype._wordDiv = function(num, mode) {\n var shift = this.length - num.length, a = this.clone(), b = num, bhi = b.words[b.length - 1] | 0, bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits, shift !== 0 && (b = b.ushln(shift), a.iushln(shift), bhi = b.words[b.length - 1] | 0);\n var m = a.length - b.length, q;\n if (mode !== \"mod\") {\n q = new BN(null), q.length = m + 1, q.words = new Array(q.length);\n for (var i = 0;i < q.length; i++)\n q.words[i] = 0;\n }\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n diff.negative === 0 && (a = diff, q && (q.words[m] = 1));\n for (var j = m - 1;j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);\n for (qj = Math.min(qj / bhi | 0, 67108863), a._ishlnsubmul(b, qj, j);a.negative !== 0; )\n qj--, a.negative = 0, a._ishlnsubmul(b, 1, j), a.isZero() || (a.negative ^= 1);\n q && (q.words[j] = qj);\n }\n return q && q.strip(), a.strip(), mode !== \"div\" && shift !== 0 && a.iushrn(shift), {\n div: q || null,\n mod: a\n };\n }, BN.prototype.divmod = function(num, mode, positive) {\n if (assert(!num.isZero()), this.isZero())\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n var div, mod, res;\n return this.negative !== 0 && num.negative === 0 \? (res = this.neg().divmod(num, mode), mode !== \"mod\" && (div = res.div.neg()), mode !== \"div\" && (mod = res.mod.neg(), positive && mod.negative !== 0 && mod.iadd(num)), {\n div,\n mod\n }) : this.negative === 0 && num.negative !== 0 \? (res = this.divmod(num.neg(), mode), mode !== \"mod\" && (div = res.div.neg()), {\n div,\n mod: res.mod\n }) : (this.negative & num.negative) !== 0 \? (res = this.neg().divmod(num.neg(), mode), mode !== \"div\" && (mod = res.mod.neg(), positive && mod.negative !== 0 && mod.isub(num)), {\n div: res.div,\n mod\n }) : num.length > this.length || this.cmp(num) < 0 \? {\n div: new BN(0),\n mod: this\n } : num.length === 1 \? mode === \"div\" \? {\n div: this.divn(num.words[0]),\n mod: null\n } : mode === \"mod\" \? {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n } : {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n } : this._wordDiv(num, mode);\n }, BN.prototype.div = function(num) {\n return this.divmod(num, \"div\", !1).div;\n }, BN.prototype.mod = function(num) {\n return this.divmod(num, \"mod\", !1).mod;\n }, BN.prototype.umod = function(num) {\n return this.divmod(num, \"mod\", !0).mod;\n }, BN.prototype.divRound = function(num) {\n var dm = this.divmod(num);\n if (dm.mod.isZero())\n return dm.div;\n var mod = dm.div.negative !== 0 \? dm.mod.isub(num) : dm.mod, half = num.ushrn(1), r2 = num.andln(1), cmp = mod.cmp(half);\n return cmp < 0 || r2 === 1 && cmp === 0 \? dm.div : dm.div.negative !== 0 \? dm.div.isubn(1) : dm.div.iaddn(1);\n }, BN.prototype.modn = function(num) {\n assert(num <= 67108863);\n for (var p = (1 << 26) % num, acc = 0, i = this.length - 1;i >= 0; i--)\n acc = (p * acc + (this.words[i] | 0)) % num;\n return acc;\n }, BN.prototype.idivn = function(num) {\n assert(num <= 67108863);\n for (var carry = 0, i = this.length - 1;i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 67108864;\n this.words[i] = w / num | 0, carry = w % num;\n }\n return this.strip();\n }, BN.prototype.divn = function(num) {\n return this.clone().idivn(num);\n }, BN.prototype.egcd = function(p) {\n assert(p.negative === 0), assert(!p.isZero());\n var x = this, y = p.clone();\n x.negative !== 0 \? x = x.umod(p) : x = x.clone();\n for (var A = new BN(1), B = new BN(0), C = new BN(0), D = new BN(1), g = 0;x.isEven() && y.isEven(); )\n x.iushrn(1), y.iushrn(1), ++g;\n for (var yp = y.clone(), xp = x.clone();!x.isZero(); ) {\n for (var i = 0, im = 1;(x.words[0] & im) === 0 && i < 26; ++i, im <<= 1)\n ;\n if (i > 0)\n for (x.iushrn(i);i-- > 0; )\n (A.isOdd() || B.isOdd()) && (A.iadd(yp), B.isub(xp)), A.iushrn(1), B.iushrn(1);\n for (var j = 0, jm = 1;(y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1)\n ;\n if (j > 0)\n for (y.iushrn(j);j-- > 0; )\n (C.isOdd() || D.isOdd()) && (C.iadd(yp), D.isub(xp)), C.iushrn(1), D.iushrn(1);\n x.cmp(y) >= 0 \? (x.isub(y), A.isub(C), B.isub(D)) : (y.isub(x), C.isub(A), D.isub(B));\n }\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n }, BN.prototype._invmp = function(p) {\n assert(p.negative === 0), assert(!p.isZero());\n var a = this, b = p.clone();\n a.negative !== 0 \? a = a.umod(p) : a = a.clone();\n for (var x1 = new BN(1), x2 = new BN(0), delta = b.clone();a.cmpn(1) > 0 && b.cmpn(1) > 0; ) {\n for (var i = 0, im = 1;(a.words[0] & im) === 0 && i < 26; ++i, im <<= 1)\n ;\n if (i > 0)\n for (a.iushrn(i);i-- > 0; )\n x1.isOdd() && x1.iadd(delta), x1.iushrn(1);\n for (var j = 0, jm = 1;(b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1)\n ;\n if (j > 0)\n for (b.iushrn(j);j-- > 0; )\n x2.isOdd() && x2.iadd(delta), x2.iushrn(1);\n a.cmp(b) >= 0 \? (a.isub(b), x1.isub(x2)) : (b.isub(a), x2.isub(x1));\n }\n var res;\n return a.cmpn(1) === 0 \? res = x1 : res = x2, res.cmpn(0) < 0 && res.iadd(p), res;\n }, BN.prototype.gcd = function(num) {\n if (this.isZero())\n return num.abs();\n if (num.isZero())\n return this.abs();\n var a = this.clone(), b = num.clone();\n a.negative = 0, b.negative = 0;\n for (var shift = 0;a.isEven() && b.isEven(); shift++)\n a.iushrn(1), b.iushrn(1);\n do {\n for (;a.isEven(); )\n a.iushrn(1);\n for (;b.isEven(); )\n b.iushrn(1);\n var r = a.cmp(b);\n if (r < 0) {\n var t = a;\n a = b, b = t;\n } else if (r === 0 || b.cmpn(1) === 0)\n break;\n a.isub(b);\n } while (!0);\n return b.iushln(shift);\n }, BN.prototype.invm = function(num) {\n return this.egcd(num).a.umod(num);\n }, BN.prototype.isEven = function() {\n return (this.words[0] & 1) === 0;\n }, BN.prototype.isOdd = function() {\n return (this.words[0] & 1) === 1;\n }, BN.prototype.andln = function(num) {\n return this.words[0] & num;\n }, BN.prototype.bincn = function(bit) {\n assert(typeof bit == \"number\");\n var r = bit % 26, s = (bit - r) / 26, q = 1 << r;\n if (this.length <= s)\n return this._expand(s + 1), this.words[s] |= q, this;\n for (var carry = q, i = s;carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry, carry = w >>> 26, w &= 67108863, this.words[i] = w;\n }\n return carry !== 0 && (this.words[i] = carry, this.length++), this;\n }, BN.prototype.isZero = function() {\n return this.length === 1 && this.words[0] === 0;\n }, BN.prototype.cmpn = function(num) {\n var negative = num < 0;\n if (this.negative !== 0 && !negative)\n return -1;\n if (this.negative === 0 && negative)\n return 1;\n this.strip();\n var res;\n if (this.length > 1)\n res = 1;\n else {\n negative && (num = -num), assert(num <= 67108863, \"Number is too big\");\n var w = this.words[0] | 0;\n res = w === num \? 0 : w < num \? -1 : 1;\n }\n return this.negative !== 0 \? -res | 0 : res;\n }, BN.prototype.cmp = function(num) {\n if (this.negative !== 0 && num.negative === 0)\n return -1;\n if (this.negative === 0 && num.negative !== 0)\n return 1;\n var res = this.ucmp(num);\n return this.negative !== 0 \? -res | 0 : res;\n }, BN.prototype.ucmp = function(num) {\n if (this.length > num.length)\n return 1;\n if (this.length < num.length)\n return -1;\n for (var res = 0, i = this.length - 1;i >= 0; i--) {\n var a = this.words[i] | 0, b = num.words[i] | 0;\n if (a !== b) {\n a < b \? res = -1 : a > b && (res = 1);\n break;\n }\n }\n return res;\n }, BN.prototype.gtn = function(num) {\n return this.cmpn(num) === 1;\n }, BN.prototype.gt = function(num) {\n return this.cmp(num) === 1;\n }, BN.prototype.gten = function(num) {\n return this.cmpn(num) >= 0;\n }, BN.prototype.gte = function(num) {\n return this.cmp(num) >= 0;\n }, BN.prototype.ltn = function(num) {\n return this.cmpn(num) === -1;\n }, BN.prototype.lt = function(num) {\n return this.cmp(num) === -1;\n }, BN.prototype.lten = function(num) {\n return this.cmpn(num) <= 0;\n }, BN.prototype.lte = function(num) {\n return this.cmp(num) <= 0;\n }, BN.prototype.eqn = function(num) {\n return this.cmpn(num) === 0;\n }, BN.prototype.eq = function(num) {\n return this.cmp(num) === 0;\n }, BN.red = function(num) {\n return new Red(num);\n }, BN.prototype.toRed = function(ctx) {\n return assert(!this.red, \"Already a number in reduction context\"), assert(this.negative === 0, \"red works only with positives\"), ctx.convertTo(this)._forceRed(ctx);\n }, BN.prototype.fromRed = function() {\n return assert(this.red, \"fromRed works only with numbers in reduction context\"), this.red.convertFrom(this);\n }, BN.prototype._forceRed = function(ctx) {\n return this.red = ctx, this;\n }, BN.prototype.forceRed = function(ctx) {\n return assert(!this.red, \"Already a number in reduction context\"), this._forceRed(ctx);\n }, BN.prototype.redAdd = function(num) {\n return assert(this.red, \"redAdd works only with red numbers\"), this.red.add(this, num);\n }, BN.prototype.redIAdd = function(num) {\n return assert(this.red, \"redIAdd works only with red numbers\"), this.red.iadd(this, num);\n }, BN.prototype.redSub = function(num) {\n return assert(this.red, \"redSub works only with red numbers\"), this.red.sub(this, num);\n }, BN.prototype.redISub = function(num) {\n return assert(this.red, \"redISub works only with red numbers\"), this.red.isub(this, num);\n }, BN.prototype.redShl = function(num) {\n return assert(this.red, \"redShl works only with red numbers\"), this.red.shl(this, num);\n }, BN.prototype.redMul = function(num) {\n return assert(this.red, \"redMul works only with red numbers\"), this.red._verify2(this, num), this.red.mul(this, num);\n }, BN.prototype.redIMul = function(num) {\n return assert(this.red, \"redMul works only with red numbers\"), this.red._verify2(this, num), this.red.imul(this, num);\n }, BN.prototype.redSqr = function() {\n return assert(this.red, \"redSqr works only with red numbers\"), this.red._verify1(this), this.red.sqr(this);\n }, BN.prototype.redISqr = function() {\n return assert(this.red, \"redISqr works only with red numbers\"), this.red._verify1(this), this.red.isqr(this);\n }, BN.prototype.redSqrt = function() {\n return assert(this.red, \"redSqrt works only with red numbers\"), this.red._verify1(this), this.red.sqrt(this);\n }, BN.prototype.redInvm = function() {\n return assert(this.red, \"redInvm works only with red numbers\"), this.red._verify1(this), this.red.invm(this);\n }, BN.prototype.redNeg = function() {\n return assert(this.red, \"redNeg works only with red numbers\"), this.red._verify1(this), this.red.neg(this);\n }, BN.prototype.redPow = function(num) {\n return assert(this.red && !num.red, \"redPow(normalNum)\"), this.red._verify1(this), this.red.pow(this, num);\n };\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n function MPrime(name, p) {\n this.name = name, this.p = new BN(p, 16), this.n = this.p.bitLength(), this.k = new BN(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();\n }\n MPrime.prototype = {}, MPrime.prototype._tmp = function() {\n var tmp = new BN(null);\n return tmp.words = new Array(Math.ceil(this.n / 13)), tmp;\n }, MPrime.prototype.ireduce = function(num) {\n var r = num, rlen;\n do\n this.split(r, this.tmp), r = this.imulK(r), r = r.iadd(this.tmp), rlen = r.bitLength();\n while (rlen > this.n);\n var cmp = rlen < this.n \? -1 : r.ucmp(this.p);\n return cmp === 0 \? (r.words[0] = 0, r.length = 1) : cmp > 0 \? r.isub(this.p) : r.strip !== void 0 \? r.strip() : r._strip(), r;\n }, MPrime.prototype.split = function(input, out) {\n input.iushrn(this.n, 0, out);\n }, MPrime.prototype.imulK = function(num) {\n return num.imul(this.k);\n };\n function K256() {\n MPrime.call(this, \"k256\", \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\");\n }\n inherits(K256, MPrime), K256.prototype.split = function(input, output) {\n for (var mask = 4194303, outLen = Math.min(input.length, 9), i = 0;i < outLen; i++)\n output.words[i] = input.words[i];\n if (output.length = outLen, input.length <= 9) {\n input.words[0] = 0, input.length = 1;\n return;\n }\n var prev = input.words[9];\n for (output.words[output.length++] = prev & mask, i = 10;i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = (next & mask) << 4 | prev >>> 22, prev = next;\n }\n prev >>>= 22, input.words[i - 10] = prev, prev === 0 && input.length > 10 \? input.length -= 10 : input.length -= 9;\n }, K256.prototype.imulK = function(num) {\n num.words[num.length] = 0, num.words[num.length + 1] = 0, num.length += 2;\n for (var lo = 0, i = 0;i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 977, num.words[i] = lo & 67108863, lo = w * 64 + (lo / 67108864 | 0);\n }\n return num.words[num.length - 1] === 0 && (num.length--, num.words[num.length - 1] === 0 && num.length--), num;\n };\n function P224() {\n MPrime.call(this, \"p224\", \"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\");\n }\n inherits(P224, MPrime);\n function P192() {\n MPrime.call(this, \"p192\", \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\");\n }\n inherits(P192, MPrime);\n function P25519() {\n MPrime.call(this, \"25519\", \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\");\n }\n inherits(P25519, MPrime), P25519.prototype.imulK = function(num) {\n for (var carry = 0, i = 0;i < num.length; i++) {\n var hi = (num.words[i] | 0) * 19 + carry, lo = hi & 67108863;\n hi >>>= 26, num.words[i] = lo, carry = hi;\n }\n return carry !== 0 && (num.words[num.length++] = carry), num;\n }, BN._prime = function(name) {\n if (primes[name])\n return primes[name];\n var prime2;\n if (name === \"k256\")\n prime2 = new K256;\n else if (name === \"p224\")\n prime2 = new P224;\n else if (name === \"p192\")\n prime2 = new P192;\n else if (name === \"p25519\")\n prime2 = new P25519;\n else\n throw new Error(\"Unknown prime \" + name);\n return primes[name] = prime2, prime2;\n };\n function Red(m) {\n if (typeof m == \"string\") {\n var prime = BN._prime(m);\n this.m = prime.p, this.prime = prime;\n } else\n assert(m.gtn(1), \"modulus must be greater than 1\"), this.m = m, this.prime = null;\n }\n Red.prototype = {}, Red.prototype._verify1 = function(a) {\n assert(a.negative === 0, \"red works only with positives\"), assert(a.red, \"red works only with red numbers\");\n }, Red.prototype._verify2 = function(a, b) {\n assert((a.negative | b.negative) === 0, \"red works only with positives\"), assert(a.red && a.red === b.red, \"red works only with red numbers\");\n }, Red.prototype.imod = function(a) {\n return this.prime \? this.prime.ireduce(a)._forceRed(this) : a.umod(this.m)._forceRed(this);\n }, Red.prototype.neg = function(a) {\n return a.isZero() \? a.clone() : this.m.sub(a)._forceRed(this);\n }, Red.prototype.add = function(a, b) {\n this._verify2(a, b);\n var res = a.add(b);\n return res.cmp(this.m) >= 0 && res.isub(this.m), res._forceRed(this);\n }, Red.prototype.iadd = function(a, b) {\n this._verify2(a, b);\n var res = a.iadd(b);\n return res.cmp(this.m) >= 0 && res.isub(this.m), res;\n }, Red.prototype.sub = function(a, b) {\n this._verify2(a, b);\n var res = a.sub(b);\n return res.cmpn(0) < 0 && res.iadd(this.m), res._forceRed(this);\n }, Red.prototype.isub = function(a, b) {\n this._verify2(a, b);\n var res = a.isub(b);\n return res.cmpn(0) < 0 && res.iadd(this.m), res;\n }, Red.prototype.shl = function(a, num) {\n return this._verify1(a), this.imod(a.ushln(num));\n }, Red.prototype.imul = function(a, b) {\n return this._verify2(a, b), this.imod(a.imul(b));\n }, Red.prototype.mul = function(a, b) {\n return this._verify2(a, b), this.imod(a.mul(b));\n }, Red.prototype.isqr = function(a) {\n return this.imul(a, a.clone());\n }, Red.prototype.sqr = function(a) {\n return this.mul(a, a);\n }, Red.prototype.sqrt = function(a) {\n if (a.isZero())\n return a.clone();\n var mod3 = this.m.andln(3);\n if (assert(mod3 % 2 === 1), mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n for (var q = this.m.subn(1), s = 0;!q.isZero() && q.andln(1) === 0; )\n s++, q.iushrn(1);\n assert(!q.isZero());\n var one = new BN(1).toRed(this), nOne = one.redNeg(), lpow = this.m.subn(1).iushrn(1), z = this.m.bitLength();\n for (z = new BN(2 * z * z).toRed(this);this.pow(z, lpow).cmp(nOne) !== 0; )\n z.redIAdd(nOne);\n for (var c = this.pow(z, q), r = this.pow(a, q.addn(1).iushrn(1)), t = this.pow(a, q), m = s;t.cmp(one) !== 0; ) {\n for (var tmp = t, i = 0;tmp.cmp(one) !== 0; i++)\n tmp = tmp.redSqr();\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n r = r.redMul(b), c = b.redSqr(), t = t.redMul(c), m = i;\n }\n return r;\n }, Red.prototype.invm = function(a) {\n var inv = a._invmp(this.m);\n return inv.negative !== 0 \? (inv.negative = 0, this.imod(inv).redNeg()) : this.imod(inv);\n }, Red.prototype.pow = function(a, num) {\n if (num.isZero())\n return new BN(1).toRed(this);\n if (num.cmpn(1) === 0)\n return a.clone();\n var windowSize = 4, wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this), wnd[1] = a;\n for (var i = 2;i < wnd.length; i++)\n wnd[i] = this.mul(wnd[i - 1], a);\n var res = wnd[0], current = 0, currentLen = 0, start = num.bitLength() % 26;\n for (start === 0 && (start = 26), i = num.length - 1;i >= 0; i--) {\n for (var word = num.words[i], j = start - 1;j >= 0; j--) {\n var bit = word >> j & 1;\n if (res !== wnd[0] && (res = this.sqr(res)), bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n current <<= 1, current |= bit, currentLen++, !(currentLen !== windowSize && (i !== 0 || j !== 0)) && (res = this.mul(res, wnd[current]), currentLen = 0, current = 0);\n }\n start = 26;\n }\n return res;\n }, Red.prototype.convertTo = function(num) {\n var r = num.umod(this.m);\n return r === num \? r.clone() : r;\n }, Red.prototype.convertFrom = function(num) {\n var res = num.clone();\n return res.red = null, res;\n }, BN.mont = function(num) {\n return new Mont(num);\n };\n function Mont(m) {\n Red.call(this, m), this.shift = this.m.bitLength(), this.shift % 26 !== 0 && (this.shift += 26 - this.shift % 26), this.r = new BN(1).iushln(this.shift), this.r2 = this.imod(this.r.sqr()), this.rinv = this.r._invmp(this.m), this.minv = this.rinv.mul(this.r).isubn(1).div(this.m), this.minv = this.minv.umod(this.r), this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red), Mont.prototype.convertTo = function(num) {\n return this.imod(num.ushln(this.shift));\n }, Mont.prototype.convertFrom = function(num) {\n var r = this.imod(num.mul(this.rinv));\n return r.red = null, r;\n }, Mont.prototype.imul = function(a, b) {\n if (a.isZero() || b.isZero())\n return a.words[0] = 0, a.length = 1, a;\n var t = a.imul(b), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u = t.isub(c).iushrn(this.shift), res = u;\n return u.cmp(this.m) >= 0 \? res = u.isub(this.m) : u.cmpn(0) < 0 && (res = u.iadd(this.m)), res._forceRed(this);\n }, Mont.prototype.mul = function(a, b) {\n if (a.isZero() || b.isZero())\n return new BN(0)._forceRed(this);\n var t = a.mul(b), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u = t.isub(c).iushrn(this.shift), res = u;\n return u.cmp(this.m) >= 0 \? res = u.isub(this.m) : u.cmpn(0) < 0 && (res = u.iadd(this.m)), res._forceRed(this);\n }, Mont.prototype.invm = function(a) {\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n })(typeof module > \"u\" || module, exports);\n }\n}), require_bn2 = require_bn, require_brorand = __commonJS({\n \"node_modules/brorand/index.js\"(exports, module) {\n var r;\n module.exports = function(len) {\n return r || (r = new Rand(null)), r.generate(len);\n };\n function Rand(rand) {\n this.rand = rand;\n }\n Rand.prototype = {}, module.exports.Rand = Rand, Rand.prototype.generate = function(len) {\n return this._rand(len);\n }, Rand.prototype._rand = function(n) {\n var out = new Buffer(n);\n return crypto.getRandomValues(out), out;\n };\n }\n}), require_mr = __commonJS({\n \"node_modules/miller-rabin/lib/mr.js\"(exports, module) {\n var bn = require_bn2(), brorand = require_brorand();\n function MillerRabin(rand) {\n this.rand = rand || new brorand.Rand;\n }\n module.exports = MillerRabin, MillerRabin.create = function(rand) {\n return new MillerRabin(rand);\n }, MillerRabin.prototype = {}, MillerRabin.prototype._randbelow = function(n) {\n var len = n.bitLength(), min_bytes = Math.ceil(len / 8);\n do\n var a = new bn(this.rand.generate(min_bytes));\n while (a.cmp(n) >= 0);\n return a;\n }, MillerRabin.prototype._randrange = function(start, stop) {\n var size = stop.sub(start);\n return start.add(this._randbelow(size));\n }, MillerRabin.prototype.test = function(n, k, cb) {\n var len = n.bitLength(), red = bn.mont(n), rone = new bn(1).toRed(red);\n k || (k = Math.max(1, len / 48 | 0));\n for (var n1 = n.subn(1), s = 0;!n1.testn(s); s++)\n ;\n for (var d = n.shrn(s), rn1 = n1.toRed(red), prime = !0;k > 0; k--) {\n var a = this._randrange(new bn(2), n1);\n cb && cb(a);\n var x = a.toRed(red).redPow(d);\n if (!(x.cmp(rone) === 0 || x.cmp(rn1) === 0)) {\n for (var i = 1;i < s; i++) {\n if (x = x.redSqr(), x.cmp(rone) === 0)\n return !1;\n if (x.cmp(rn1) === 0)\n break;\n }\n if (i === s)\n return !1;\n }\n }\n return prime;\n }, MillerRabin.prototype.getDivisor = function(n, k) {\n var len = n.bitLength(), red = bn.mont(n), rone = new bn(1).toRed(red);\n k || (k = Math.max(1, len / 48 | 0));\n for (var n1 = n.subn(1), s = 0;!n1.testn(s); s++)\n ;\n for (var d = n.shrn(s), rn1 = n1.toRed(red);k > 0; k--) {\n var a = this._randrange(new bn(2), n1), g = n.gcd(a);\n if (g.cmpn(1) !== 0)\n return g;\n var x = a.toRed(red).redPow(d);\n if (!(x.cmp(rone) === 0 || x.cmp(rn1) === 0)) {\n for (var i = 1;i < s; i++) {\n if (x = x.redSqr(), x.cmp(rone) === 0)\n return x.fromRed().subn(1).gcd(n);\n if (x.cmp(rn1) === 0)\n break;\n }\n if (i === s)\n return x = x.redSqr(), x.fromRed().subn(1).gcd(n);\n }\n }\n return !1;\n };\n }\n}), require_generatePrime = __commonJS({\n \"node_modules/diffie-hellman/lib/generatePrime.js\"(exports, module) {\n var randomBytes = require_browser();\n module.exports = findPrime, findPrime.simpleSieve = simpleSieve, findPrime.fermatTest = fermatTest;\n var BN = require_bn(), TWENTYFOUR = new BN(24), MillerRabin = require_mr(), millerRabin = new MillerRabin, ONE = new BN(1), TWO = new BN(2), FIVE = new BN(5), SIXTEEN = new BN(16), EIGHT = new BN(8), TEN = new BN(10), THREE = new BN(3), SEVEN = new BN(7), ELEVEN = new BN(11), FOUR = new BN(4), TWELVE = new BN(12), primes = null;\n function _getPrimes() {\n if (primes !== null)\n return primes;\n var limit = 1048576, res = [];\n res[0] = 2;\n for (var i = 1, k = 3;k < limit; k += 2) {\n for (var sqrt = Math.ceil(Math.sqrt(k)), j = 0;j < i && res[j] <= sqrt && k % res[j] !== 0; j++)\n ;\n i !== j && res[j] <= sqrt || (res[i++] = k);\n }\n return primes = res, res;\n }\n function simpleSieve(p) {\n for (var primes2 = _getPrimes(), i = 0;i < primes2.length; i++)\n if (p.modn(primes2[i]) === 0)\n return p.cmpn(primes2[i]) === 0;\n return !0;\n }\n function fermatTest(p) {\n var red = BN.mont(p);\n return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;\n }\n function findPrime(bits, gen) {\n if (bits < 16)\n return gen === 2 || gen === 5 \? new BN([140, 123]) : new BN([140, 39]);\n gen = new BN(gen);\n for (var num, n2;; ) {\n for (num = new BN(randomBytes(Math.ceil(bits / 8)));num.bitLength() > bits; )\n num.ishrn(1);\n if (num.isEven() && num.iadd(ONE), num.testn(1) || num.iadd(TWO), gen.cmp(TWO)) {\n if (!gen.cmp(FIVE))\n for (;num.mod(TEN).cmp(THREE); )\n num.iadd(FOUR);\n } else\n for (;num.mod(TWENTYFOUR).cmp(ELEVEN); )\n num.iadd(FOUR);\n if (n2 = num.shrn(1), simpleSieve(n2) && simpleSieve(num) && fermatTest(n2) && fermatTest(num) && millerRabin.test(n2) && millerRabin.test(num))\n return num;\n }\n }\n }\n}), require_primes = __commonJS({\n \"node_modules/diffie-hellman/lib/primes.json\"(exports, module) {\n module.exports = {\n modp1: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff\"\n },\n modp2: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff\"\n },\n modp5: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff\"\n },\n modp14: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff\"\n },\n modp15: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff\"\n },\n modp16: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff\"\n },\n modp17: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff\"\n },\n modp18: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff\"\n }\n };\n }\n}), require_dh = __commonJS({\n \"node_modules/diffie-hellman/lib/dh.js\"(exports, module) {\n var BN = require_bn(), MillerRabin = require_mr(), millerRabin = new MillerRabin, TWENTYFOUR = new BN(24), ELEVEN = new BN(11), TEN = new BN(10), THREE = new BN(3), SEVEN = new BN(7), primes = require_generatePrime(), randomBytes = require_browser();\n module.exports = DH;\n function setPublicKey(pub, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(pub) || (pub = new Buffer(pub, enc)), this._pub = new BN(pub), this;\n }\n function setPrivateKey(priv, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(priv) || (priv = new Buffer(priv, enc)), this._priv = new BN(priv), this;\n }\n var primeCache = {};\n function checkPrime(prime, generator) {\n var gen = generator.toString(\"hex\"), hex = [gen, prime.toString(16)].join(\"_\");\n if (hex in primeCache)\n return primeCache[hex];\n var error = 0;\n if (prime.isEven() || !primes.simpleSieve || !primes.fermatTest(prime) || !millerRabin.test(prime))\n return error += 1, gen === \"02\" || gen === \"05\" \? error += 8 : error += 4, primeCache[hex] = error, error;\n millerRabin.test(prime.shrn(1)) || (error += 2);\n var rem;\n switch (gen) {\n case \"02\":\n prime.mod(TWENTYFOUR).cmp(ELEVEN) && (error += 8);\n break;\n case \"05\":\n rem = prime.mod(TEN), rem.cmp(THREE) && rem.cmp(SEVEN) && (error += 8);\n break;\n default:\n error += 4;\n }\n return primeCache[hex] = error, error;\n }\n function DH(prime, generator, malleable) {\n this.setGenerator(generator), this.__prime = new BN(prime), this._prime = BN.mont(this.__prime), this._primeLen = prime.length, this._pub = void 0, this._priv = void 0, this._primeCode = void 0, malleable \? (this.setPublicKey = setPublicKey, this.setPrivateKey = setPrivateKey) : this._primeCode = 8;\n }\n DH.prototype = {}, Object.defineProperty(DH.prototype, \"verifyError\", {\n enumerable: !0,\n get: function() {\n return typeof this._primeCode != \"number\" && (this._primeCode = checkPrime(this.__prime, this.__gen)), this._primeCode;\n }\n }), DH.prototype.generateKeys = function() {\n return this._priv || (this._priv = new BN(randomBytes(this._primeLen))), this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(), this.getPublicKey();\n }, DH.prototype.computeSecret = function(other) {\n other = new BN(other), other = other.toRed(this._prime);\n var secret = other.redPow(this._priv).fromRed(), out = new Buffer(secret.toArray()), prime = this.getPrime();\n if (out.length < prime.length) {\n var front = new Buffer(prime.length - out.length);\n front.fill(0), out = Buffer.concat([front, out]);\n }\n return out;\n }, DH.prototype.getPublicKey = function(enc) {\n return formatReturnValue(this._pub, enc);\n }, DH.prototype.getPrivateKey = function(enc) {\n return formatReturnValue(this._priv, enc);\n }, DH.prototype.getPrime = function(enc) {\n return formatReturnValue(this.__prime, enc);\n }, DH.prototype.getGenerator = function(enc) {\n return formatReturnValue(this._gen, enc);\n }, DH.prototype.setGenerator = function(gen, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(gen) || (gen = new Buffer(gen, enc)), this.__gen = gen, this._gen = new BN(gen), this;\n };\n function formatReturnValue(bn, enc) {\n var buf = new Buffer(bn.toArray());\n return enc \? buf.toString(enc) : buf;\n }\n }\n}), require_browser7 = __commonJS({\n \"node_modules/diffie-hellman/browser.js\"(exports) {\n var generatePrime = require_generatePrime(), primes = require_primes(), DH = require_dh();\n function getDiffieHellman(mod) {\n var prime = new Buffer(primes[mod].prime, \"hex\"), gen = new Buffer(primes[mod].gen, \"hex\");\n return new DH(prime, gen);\n }\n var ENCODINGS = {\n binary: !0,\n hex: !0,\n base64: !0\n };\n function createDiffieHellman(prime, enc, generator, genc) {\n return Buffer.isBuffer(enc) || ENCODINGS[enc] === void 0 \? createDiffieHellman(prime, \"binary\", enc, generator) : (enc = enc || \"binary\", genc = genc || \"binary\", generator = generator || new Buffer([2]), Buffer.isBuffer(generator) || (generator = new Buffer(generator, genc)), typeof prime == \"number\" \? new DH(generatePrime(prime, generator), generator, !0) : (Buffer.isBuffer(prime) || (prime = new Buffer(prime, enc)), new DH(prime, generator, !0)));\n }\n exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman, exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman;\n }\n}), require_bn3 = require_bn, require_browserify_rsa = __commonJS({\n \"node_modules/browserify-rsa/index.js\"(exports, module) {\n var BN = require_bn3(), randomBytes = require_browser();\n function blind(priv) {\n var r = getr(priv), blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed();\n return { blinder, unblinder: r.invm(priv.modulus) };\n }\n function getr(priv) {\n var len = priv.modulus.byteLength(), r;\n do\n r = new BN(randomBytes(len));\n while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2));\n return r;\n }\n function crt(msg, priv) {\n var blinds = blind(priv), len = priv.modulus.byteLength(), blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus), c1 = blinded.toRed(BN.mont(priv.prime1)), c2 = blinded.toRed(BN.mont(priv.prime2)), qinv = priv.coefficient, p = priv.prime1, q = priv.prime2, m1 = c1.redPow(priv.exponent1).fromRed(), m2 = c2.redPow(priv.exponent2).fromRed(), h = m1.isub(m2).imul(qinv).umod(p).imul(q);\n return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, \"be\", len);\n }\n crt.getr = getr, module.exports = crt;\n }\n}), require_package = __commonJS({\n \"node_modules/elliptic/package.json\"(exports, module) {\n module.exports = {\n name: \"elliptic\",\n version: \"6.5.4\",\n description: \"EC cryptography\",\n main: \"lib/elliptic.js\",\n files: [\"lib\"],\n scripts: {\n lint: \"eslint lib test\",\n \"lint:fix\": \"npm run lint -- --fix\",\n unit: \"istanbul test _mocha --reporter=spec test/index.js\",\n test: \"npm run lint && npm run unit\",\n version: \"grunt dist && git add dist/\"\n },\n repository: {\n type: \"git\",\n url: \"git@github.com:indutny/elliptic\"\n },\n keywords: [\"EC\", \"Elliptic\", \"curve\", \"Cryptography\"],\n author: \"Fedor Indutny <fedor@indutny.com>\",\n license: \"MIT\",\n bugs: {\n url: \"https://github.com/indutny/elliptic/issues\"\n },\n homepage: \"https://github.com/indutny/elliptic\",\n devDependencies: {\n brfs: \"^2.0.2\",\n coveralls: \"^3.1.0\",\n eslint: \"^7.6.0\",\n grunt: \"^1.2.1\",\n \"grunt-browserify\": \"^5.3.0\",\n \"grunt-cli\": \"^1.3.2\",\n \"grunt-contrib-connect\": \"^3.0.0\",\n \"grunt-contrib-copy\": \"^1.0.0\",\n \"grunt-contrib-uglify\": \"^5.0.0\",\n \"grunt-mocha-istanbul\": \"^5.0.2\",\n \"grunt-saucelabs\": \"^9.0.1\",\n istanbul: \"^0.4.5\",\n mocha: \"^8.0.1\"\n },\n dependencies: {\n \"bn.js\": \"^4.11.9\",\n brorand: \"^1.1.0\",\n \"hash.js\": \"^1.0.0\",\n \"hmac-drbg\": \"^1.0.1\",\n inherits: \"^2.0.4\",\n \"minimalistic-assert\": \"^1.0.1\",\n \"minimalistic-crypto-utils\": \"^1.0.1\"\n }\n };\n }\n}), require_bn4 = require_bn, require_utils2 = __commonJS({\n \"node_modules/minimalistic-crypto-utils/lib/utils.js\"(exports) {\n var utils = exports;\n function toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg != \"string\") {\n for (var i = 0;i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n if (enc === \"hex\") {\n msg = msg.replace(/[^a-z0-9]+/gi, \"\"), msg.length % 2 !== 0 && (msg = \"0\" + msg);\n for (var i = 0;i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else\n for (var i = 0;i < msg.length; i++) {\n var c = msg.charCodeAt(i), hi = c >> 8, lo = c & 255;\n hi \? res.push(hi, lo) : res.push(lo);\n }\n return res;\n }\n utils.toArray = toArray;\n function zero2(word) {\n return word.length === 1 \? \"0\" + word : word;\n }\n utils.zero2 = zero2;\n function toHex(msg) {\n for (var res = \"\", i = 0;i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n }\n utils.toHex = toHex, utils.encode = function(arr, enc) {\n return enc === \"hex\" \? toHex(arr) : arr;\n };\n }\n}), require_utils3 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/utils.js\"(exports) {\n var utils = exports, BN = require_bn4(), minAssert = require_minimalistic_assert(), minUtils = require_utils2();\n utils.assert = minAssert, utils.toArray = minUtils.toArray, utils.zero2 = minUtils.zero2, utils.toHex = minUtils.toHex, utils.encode = minUtils.encode;\n function getNAF(num, w, bits) {\n var naf = new Array(Math.max(num.bitLength(), bits) + 1);\n naf.fill(0);\n for (var ws = 1 << w + 1, k = num.clone(), i = 0;i < naf.length; i++) {\n var z, mod = k.andln(ws - 1);\n k.isOdd() \? (mod > (ws >> 1) - 1 \? z = (ws >> 1) - mod : z = mod, k.isubn(z)) : z = 0, naf[i] = z, k.iushrn(1);\n }\n return naf;\n }\n utils.getNAF = getNAF;\n function getJSF(k1, k2) {\n var jsf = [[], []];\n k1 = k1.clone(), k2 = k2.clone();\n for (var d1 = 0, d2 = 0, m8;k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0; ) {\n var m14 = k1.andln(3) + d1 & 3, m24 = k2.andln(3) + d2 & 3;\n m14 === 3 && (m14 = -1), m24 === 3 && (m24 = -1);\n var u1;\n (m14 & 1) === 0 \? u1 = 0 : (m8 = k1.andln(7) + d1 & 7, (m8 === 3 || m8 === 5) && m24 === 2 \? u1 = -m14 : u1 = m14), jsf[0].push(u1);\n var u2;\n (m24 & 1) === 0 \? u2 = 0 : (m8 = k2.andln(7) + d2 & 7, (m8 === 3 || m8 === 5) && m14 === 2 \? u2 = -m24 : u2 = m24), jsf[1].push(u2), 2 * d1 === u1 + 1 && (d1 = 1 - d1), 2 * d2 === u2 + 1 && (d2 = 1 - d2), k1.iushrn(1), k2.iushrn(1);\n }\n return jsf;\n }\n utils.getJSF = getJSF;\n function cachedProperty(obj, name, computer) {\n var key = \"_\" + name;\n obj.prototype[name] = function() {\n return this[key] !== void 0 \? this[key] : this[key] = computer.call(this);\n };\n }\n utils.cachedProperty = cachedProperty;\n function parseBytes(bytes) {\n return typeof bytes == \"string\" \? utils.toArray(bytes, \"hex\") : bytes;\n }\n utils.parseBytes = parseBytes;\n function intFromLE(bytes) {\n return new BN(bytes, \"hex\", \"le\");\n }\n utils.intFromLE = intFromLE;\n }\n}), require_base = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/base.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), getNAF = utils.getNAF, getJSF = utils.getJSF, assert = utils.assert;\n function BaseCurve(type, conf) {\n this.type = type, this.p = new BN(conf.p, 16), this.red = conf.prime \? BN.red(conf.prime) : BN.mont(this.p), this.zero = new BN(0).toRed(this.red), this.one = new BN(1).toRed(this.red), this.two = new BN(2).toRed(this.red), this.n = conf.n && new BN(conf.n, 16), this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed), this._wnafT1 = new Array(4), this._wnafT2 = new Array(4), this._wnafT3 = new Array(4), this._wnafT4 = new Array(4), this._bitLength = this.n \? this.n.bitLength() : 0;\n var adjustCount = this.n && this.p.div(this.n);\n !adjustCount || adjustCount.cmpn(100) > 0 \? this.redN = null : (this._maxwellTrick = !0, this.redN = this.n.toRed(this.red));\n }\n module.exports = BaseCurve, BaseCurve.prototype = {}, BaseCurve.prototype.point = function() {\n throw new Error(\"Not implemented\");\n }, BaseCurve.prototype.validate = function() {\n throw new Error(\"Not implemented\");\n }, BaseCurve.prototype._fixedNafMul = function(p, k) {\n assert(p.precomputed);\n var doubles = p._getDoubles(), naf = getNAF(k, 1, this._bitLength), I = (1 << doubles.step + 1) - (doubles.step % 2 === 0 \? 2 : 1);\n I /= 3;\n var repr = [], j, nafW;\n for (j = 0;j < naf.length; j += doubles.step) {\n nafW = 0;\n for (var l = j + doubles.step - 1;l >= j; l--)\n nafW = (nafW << 1) + naf[l];\n repr.push(nafW);\n }\n for (var a = this.jpoint(null, null, null), b = this.jpoint(null, null, null), i = I;i > 0; i--) {\n for (j = 0;j < repr.length; j++)\n nafW = repr[j], nafW === i \? b = b.mixedAdd(doubles.points[j]) : nafW === -i && (b = b.mixedAdd(doubles.points[j].neg()));\n a = a.add(b);\n }\n return a.toP();\n }, BaseCurve.prototype._wnafMul = function(p, k) {\n var w = 4, nafPoints = p._getNAFPoints(w);\n w = nafPoints.wnd;\n for (var wnd = nafPoints.points, naf = getNAF(k, w, this._bitLength), acc = this.jpoint(null, null, null), i = naf.length - 1;i >= 0; i--) {\n for (var l = 0;i >= 0 && naf[i] === 0; i--)\n l++;\n if (i >= 0 && l++, acc = acc.dblp(l), i < 0)\n break;\n var z = naf[i];\n assert(z !== 0), p.type === \"affine\" \? z > 0 \? acc = acc.mixedAdd(wnd[z - 1 >> 1]) : acc = acc.mixedAdd(wnd[-z - 1 >> 1].neg()) : z > 0 \? acc = acc.add(wnd[z - 1 >> 1]) : acc = acc.add(wnd[-z - 1 >> 1].neg());\n }\n return p.type === \"affine\" \? acc.toP() : acc;\n }, BaseCurve.prototype._wnafMulAdd = function(defW, points, coeffs, len, jacobianResult) {\n var wndWidth = this._wnafT1, wnd = this._wnafT2, naf = this._wnafT3, max = 0, i, j, p;\n for (i = 0;i < len; i++) {\n p = points[i];\n var nafPoints = p._getNAFPoints(defW);\n wndWidth[i] = nafPoints.wnd, wnd[i] = nafPoints.points;\n }\n for (i = len - 1;i >= 1; i -= 2) {\n var a = i - 1, b = i;\n if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength), naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength), max = Math.max(naf[a].length, max), max = Math.max(naf[b].length, max);\n continue;\n }\n var comb = [points[a], null, null, points[b]];\n points[a].y.cmp(points[b].y) === 0 \? (comb[1] = points[a].add(points[b]), comb[2] = points[a].toJ().mixedAdd(points[b].neg())) : points[a].y.cmp(points[b].y.redNeg()) === 0 \? (comb[1] = points[a].toJ().mixedAdd(points[b]), comb[2] = points[a].add(points[b].neg())) : (comb[1] = points[a].toJ().mixedAdd(points[b]), comb[2] = points[a].toJ().mixedAdd(points[b].neg()));\n var index = [-3, -1, -5, -7, 0, 7, 5, 1, 3], jsf = getJSF(coeffs[a], coeffs[b]);\n for (max = Math.max(jsf[0].length, max), naf[a] = new Array(max), naf[b] = new Array(max), j = 0;j < max; j++) {\n var ja = jsf[0][j] | 0, jb = jsf[1][j] | 0;\n naf[a][j] = index[(ja + 1) * 3 + (jb + 1)], naf[b][j] = 0, wnd[a] = comb;\n }\n }\n var acc = this.jpoint(null, null, null), tmp = this._wnafT4;\n for (i = max;i >= 0; i--) {\n for (var k = 0;i >= 0; ) {\n var zero = !0;\n for (j = 0;j < len; j++)\n tmp[j] = naf[j][i] | 0, tmp[j] !== 0 && (zero = !1);\n if (!zero)\n break;\n k++, i--;\n }\n if (i >= 0 && k++, acc = acc.dblp(k), i < 0)\n break;\n for (j = 0;j < len; j++) {\n var z = tmp[j];\n z !== 0 && (z > 0 \? p = wnd[j][z - 1 >> 1] : z < 0 && (p = wnd[j][-z - 1 >> 1].neg()), p.type === \"affine\" \? acc = acc.mixedAdd(p) : acc = acc.add(p));\n }\n }\n for (i = 0;i < len; i++)\n wnd[i] = null;\n return jacobianResult \? acc : acc.toP();\n };\n function BasePoint(curve, type) {\n this.curve = curve, this.type = type, this.precomputed = null;\n }\n BasePoint.prototype = {}, BaseCurve.BasePoint = BasePoint, BasePoint.prototype.eq = function() {\n throw new Error(\"Not implemented\");\n }, BasePoint.prototype.validate = function() {\n return this.curve.validate(this);\n }, BaseCurve.prototype.decodePoint = function(bytes, enc) {\n bytes = utils.toArray(bytes, enc);\n var len = this.p.byteLength();\n if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) {\n bytes[0] === 6 \? assert(bytes[bytes.length - 1] % 2 === 0) : bytes[0] === 7 && assert(bytes[bytes.length - 1] % 2 === 1);\n var res = this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len));\n return res;\n } else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len)\n return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3);\n throw new Error(\"Unknown point format\");\n }, BasePoint.prototype.encodeCompressed = function(enc) {\n return this.encode(enc, !0);\n }, BasePoint.prototype._encode = function(compact) {\n var len = this.curve.p.byteLength(), x = this.getX().toArray(\"be\", len);\n return compact \? [this.getY().isEven() \? 2 : 3].concat(x) : [4].concat(x, this.getY().toArray(\"be\", len));\n }, BasePoint.prototype.encode = function(enc, compact) {\n return utils.encode(this._encode(compact), enc);\n }, BasePoint.prototype.precompute = function(power) {\n if (this.precomputed)\n return this;\n var precomputed = {\n doubles: null,\n naf: null,\n beta: null\n };\n return precomputed.naf = this._getNAFPoints(8), precomputed.doubles = this._getDoubles(4, power), precomputed.beta = this._getBeta(), this.precomputed = precomputed, this;\n }, BasePoint.prototype._hasDoubles = function(k) {\n if (!this.precomputed)\n return !1;\n var doubles = this.precomputed.doubles;\n return doubles \? doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step) : !1;\n }, BasePoint.prototype._getDoubles = function(step, power) {\n if (this.precomputed && this.precomputed.doubles)\n return this.precomputed.doubles;\n for (var doubles = [this], acc = this, i = 0;i < power; i += step) {\n for (var j = 0;j < step; j++)\n acc = acc.dbl();\n doubles.push(acc);\n }\n return {\n step,\n points: doubles\n };\n }, BasePoint.prototype._getNAFPoints = function(wnd) {\n if (this.precomputed && this.precomputed.naf)\n return this.precomputed.naf;\n for (var res = [this], max = (1 << wnd) - 1, dbl = max === 1 \? null : this.dbl(), i = 1;i < max; i++)\n res[i] = res[i - 1].add(dbl);\n return {\n wnd,\n points: res\n };\n }, BasePoint.prototype._getBeta = function() {\n return null;\n }, BasePoint.prototype.dblp = function(k) {\n for (var r = this, i = 0;i < k; i++)\n r = r.dbl();\n return r;\n };\n }\n}), require_short = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/short.js\"(exports, module) {\n var utils = require_utils3(), BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), assert = utils.assert;\n function ShortCurve(conf) {\n Base.call(this, \"short\", conf), this.a = new BN(conf.a, 16).toRed(this.red), this.b = new BN(conf.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = this.a.fromRed().cmpn(0) === 0, this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0, this.endo = this._getEndomorphism(conf), this._endoWnafT1 = new Array(4), this._endoWnafT2 = new Array(4);\n }\n inherits(ShortCurve, Base), module.exports = ShortCurve, ShortCurve.prototype._getEndomorphism = function(conf) {\n if (!(!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)) {\n var beta, lambda;\n if (conf.beta)\n beta = new BN(conf.beta, 16).toRed(this.red);\n else {\n var betas = this._getEndoRoots(this.p);\n beta = betas[0].cmp(betas[1]) < 0 \? betas[0] : betas[1], beta = beta.toRed(this.red);\n }\n if (conf.lambda)\n lambda = new BN(conf.lambda, 16);\n else {\n var lambdas = this._getEndoRoots(this.n);\n this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0 \? lambda = lambdas[0] : (lambda = lambdas[1], assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0));\n }\n var basis;\n return conf.basis \? basis = conf.basis.map(function(vec) {\n return {\n a: new BN(vec.a, 16),\n b: new BN(vec.b, 16)\n };\n }) : basis = this._getEndoBasis(lambda), {\n beta,\n lambda,\n basis\n };\n }\n }, ShortCurve.prototype._getEndoRoots = function(num) {\n var red = num === this.p \? this.red : BN.mont(num), tinv = new BN(2).toRed(red).redInvm(), ntinv = tinv.redNeg(), s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv), l1 = ntinv.redAdd(s).fromRed(), l2 = ntinv.redSub(s).fromRed();\n return [l1, l2];\n }, ShortCurve.prototype._getEndoBasis = function(lambda) {\n for (var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), u = lambda, v = this.n.clone(), x1 = new BN(1), y1 = new BN(0), x2 = new BN(0), y2 = new BN(1), a0, b0, a1, b1, a2, b2, prevR, i = 0, r, x;u.cmpn(0) !== 0; ) {\n var q = v.div(u);\n r = v.sub(q.mul(u)), x = x2.sub(q.mul(x1));\n var y = y2.sub(q.mul(y1));\n if (!a1 && r.cmp(aprxSqrt) < 0)\n a0 = prevR.neg(), b0 = x1, a1 = r.neg(), b1 = x;\n else if (a1 && ++i === 2)\n break;\n prevR = r, v = u, u = r, x2 = x1, x1 = x, y2 = y1, y1 = y;\n }\n a2 = r.neg(), b2 = x;\n var len1 = a1.sqr().add(b1.sqr()), len2 = a2.sqr().add(b2.sqr());\n return len2.cmp(len1) >= 0 && (a2 = a0, b2 = b0), a1.negative && (a1 = a1.neg(), b1 = b1.neg()), a2.negative && (a2 = a2.neg(), b2 = b2.neg()), [\n { a: a1, b: b1 },\n { a: a2, b: b2 }\n ];\n }, ShortCurve.prototype._endoSplit = function(k) {\n var basis = this.endo.basis, v1 = basis[0], v2 = basis[1], c1 = v2.b.mul(k).divRound(this.n), c2 = v1.b.neg().mul(k).divRound(this.n), p1 = c1.mul(v1.a), p2 = c2.mul(v2.a), q1 = c1.mul(v1.b), q2 = c2.mul(v2.b), k1 = k.sub(p1).sub(p2), k2 = q1.add(q2).neg();\n return { k1, k2 };\n }, ShortCurve.prototype.pointFromX = function(x, odd) {\n x = new BN(x, 16), x.red || (x = x.toRed(this.red));\n var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b), y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n var isOdd = y.fromRed().isOdd();\n return (odd && !isOdd || !odd && isOdd) && (y = y.redNeg()), this.point(x, y);\n }, ShortCurve.prototype.validate = function(point) {\n if (point.inf)\n return !0;\n var { x, y } = point, ax = this.a.redMul(x), rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n return y.redSqr().redISub(rhs).cmpn(0) === 0;\n }, ShortCurve.prototype._endoWnafMulAdd = function(points, coeffs, jacobianResult) {\n for (var npoints = this._endoWnafT1, ncoeffs = this._endoWnafT2, i = 0;i < points.length; i++) {\n var split = this._endoSplit(coeffs[i]), p = points[i], beta = p._getBeta();\n split.k1.negative && (split.k1.ineg(), p = p.neg(!0)), split.k2.negative && (split.k2.ineg(), beta = beta.neg(!0)), npoints[i * 2] = p, npoints[i * 2 + 1] = beta, ncoeffs[i * 2] = split.k1, ncoeffs[i * 2 + 1] = split.k2;\n }\n for (var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult), j = 0;j < i * 2; j++)\n npoints[j] = null, ncoeffs[j] = null;\n return res;\n };\n function Point(curve, x, y, isRed) {\n Base.BasePoint.call(this, curve, \"affine\"), x === null && y === null \? (this.x = null, this.y = null, this.inf = !0) : (this.x = new BN(x, 16), this.y = new BN(y, 16), isRed && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = !1);\n }\n inherits(Point, Base.BasePoint), ShortCurve.prototype.point = function(x, y, isRed) {\n return new Point(this, x, y, isRed);\n }, ShortCurve.prototype.pointFromJSON = function(obj, red) {\n return Point.fromJSON(this, obj, red);\n }, Point.prototype._getBeta = function() {\n if (this.curve.endo) {\n var pre = this.precomputed;\n if (pre && pre.beta)\n return pre.beta;\n var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n if (pre) {\n var curve = this.curve, endoMul = function(p) {\n return curve.point(p.x.redMul(curve.endo.beta), p.y);\n };\n pre.beta = beta, beta.precomputed = {\n beta: null,\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(endoMul)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(endoMul)\n }\n };\n }\n return beta;\n }\n }, Point.prototype.toJSON = function() {\n return this.precomputed \? [\n this.x,\n this.y,\n this.precomputed && {\n doubles: this.precomputed.doubles && {\n step: this.precomputed.doubles.step,\n points: this.precomputed.doubles.points.slice(1)\n },\n naf: this.precomputed.naf && {\n wnd: this.precomputed.naf.wnd,\n points: this.precomputed.naf.points.slice(1)\n }\n }\n ] : [this.x, this.y];\n }, Point.fromJSON = function(curve, obj, red) {\n typeof obj == \"string\" && (obj = JSON.parse(obj));\n var res = curve.point(obj[0], obj[1], red);\n if (!obj[2])\n return res;\n function obj2point(obj2) {\n return curve.point(obj2[0], obj2[1], red);\n }\n var pre = obj[2];\n return res.precomputed = {\n beta: null,\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: [res].concat(pre.doubles.points.map(obj2point))\n },\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: [res].concat(pre.naf.points.map(obj2point))\n }\n }, res;\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" y: \" + this.y.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.inf;\n }, Point.prototype.add = function(p) {\n if (this.inf)\n return p;\n if (p.inf)\n return this;\n if (this.eq(p))\n return this.dbl();\n if (this.neg().eq(p))\n return this.curve.point(null, null);\n if (this.x.cmp(p.x) === 0)\n return this.curve.point(null, null);\n var c = this.y.redSub(p.y);\n c.cmpn(0) !== 0 && (c = c.redMul(this.x.redSub(p.x).redInvm()));\n var nx = c.redSqr().redISub(this.x).redISub(p.x), ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n }, Point.prototype.dbl = function() {\n if (this.inf)\n return this;\n var ys1 = this.y.redAdd(this.y);\n if (ys1.cmpn(0) === 0)\n return this.curve.point(null, null);\n var a = this.curve.a, x2 = this.x.redSqr(), dyinv = ys1.redInvm(), c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv), nx = c.redSqr().redISub(this.x.redAdd(this.x)), ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n }, Point.prototype.getX = function() {\n return this.x.fromRed();\n }, Point.prototype.getY = function() {\n return this.y.fromRed();\n }, Point.prototype.mul = function(k) {\n return k = new BN(k, 16), this.isInfinity() \? this : this._hasDoubles(k) \? this.curve._fixedNafMul(this, k) : this.curve.endo \? this.curve._endoWnafMulAdd([this], [k]) : this.curve._wnafMul(this, k);\n }, Point.prototype.mulAdd = function(k1, p2, k2) {\n var points = [this, p2], coeffs = [k1, k2];\n return this.curve.endo \? this.curve._endoWnafMulAdd(points, coeffs) : this.curve._wnafMulAdd(1, points, coeffs, 2);\n }, Point.prototype.jmulAdd = function(k1, p2, k2) {\n var points = [this, p2], coeffs = [k1, k2];\n return this.curve.endo \? this.curve._endoWnafMulAdd(points, coeffs, !0) : this.curve._wnafMulAdd(1, points, coeffs, 2, !0);\n }, Point.prototype.eq = function(p) {\n return this === p || this.inf === p.inf && (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n }, Point.prototype.neg = function(_precompute) {\n if (this.inf)\n return this;\n var res = this.curve.point(this.x, this.y.redNeg());\n if (_precompute && this.precomputed) {\n var pre = this.precomputed, negate = function(p) {\n return p.neg();\n };\n res.precomputed = {\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(negate)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(negate)\n }\n };\n }\n return res;\n }, Point.prototype.toJ = function() {\n if (this.inf)\n return this.curve.jpoint(null, null, null);\n var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n return res;\n };\n function JPoint(curve, x, y, z) {\n Base.BasePoint.call(this, curve, \"jacobian\"), x === null && y === null && z === null \? (this.x = this.curve.one, this.y = this.curve.one, this.z = new BN(0)) : (this.x = new BN(x, 16), this.y = new BN(y, 16), this.z = new BN(z, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one;\n }\n inherits(JPoint, Base.BasePoint), ShortCurve.prototype.jpoint = function(x, y, z) {\n return new JPoint(this, x, y, z);\n }, JPoint.prototype.toP = function() {\n if (this.isInfinity())\n return this.curve.point(null, null);\n var zinv = this.z.redInvm(), zinv2 = zinv.redSqr(), ax = this.x.redMul(zinv2), ay = this.y.redMul(zinv2).redMul(zinv);\n return this.curve.point(ax, ay);\n }, JPoint.prototype.neg = function() {\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n }, JPoint.prototype.add = function(p) {\n if (this.isInfinity())\n return p;\n if (p.isInfinity())\n return this;\n var pz2 = p.z.redSqr(), z2 = this.z.redSqr(), u1 = this.x.redMul(pz2), u2 = p.x.redMul(z2), s1 = this.y.redMul(pz2.redMul(p.z)), s2 = p.y.redMul(z2.redMul(this.z)), h = u1.redSub(u2), r = s1.redSub(s2);\n if (h.cmpn(0) === 0)\n return r.cmpn(0) !== 0 \? this.curve.jpoint(null, null, null) : this.dbl();\n var h2 = h.redSqr(), h3 = h2.redMul(h), v = u1.redMul(h2), nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v), ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)), nz = this.z.redMul(p.z).redMul(h);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.mixedAdd = function(p) {\n if (this.isInfinity())\n return p.toJ();\n if (p.isInfinity())\n return this;\n var z2 = this.z.redSqr(), u1 = this.x, u2 = p.x.redMul(z2), s1 = this.y, s2 = p.y.redMul(z2).redMul(this.z), h = u1.redSub(u2), r = s1.redSub(s2);\n if (h.cmpn(0) === 0)\n return r.cmpn(0) !== 0 \? this.curve.jpoint(null, null, null) : this.dbl();\n var h2 = h.redSqr(), h3 = h2.redMul(h), v = u1.redMul(h2), nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v), ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)), nz = this.z.redMul(h);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.dblp = function(pow) {\n if (pow === 0)\n return this;\n if (this.isInfinity())\n return this;\n if (!pow)\n return this.dbl();\n var i;\n if (this.curve.zeroA || this.curve.threeA) {\n var r = this;\n for (i = 0;i < pow; i++)\n r = r.dbl();\n return r;\n }\n var a = this.curve.a, tinv = this.curve.tinv, jx = this.x, jy = this.y, jz = this.z, jz4 = jz.redSqr().redSqr(), jyd = jy.redAdd(jy);\n for (i = 0;i < pow; i++) {\n var jx2 = jx.redSqr(), jyd2 = jyd.redSqr(), jyd4 = jyd2.redSqr(), c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)), t1 = jx.redMul(jyd2), nx = c.redSqr().redISub(t1.redAdd(t1)), t2 = t1.redISub(nx), dny = c.redMul(t2);\n dny = dny.redIAdd(dny).redISub(jyd4);\n var nz = jyd.redMul(jz);\n i + 1 < pow && (jz4 = jz4.redMul(jyd4)), jx = nx, jz = nz, jyd = dny;\n }\n return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n }, JPoint.prototype.dbl = function() {\n return this.isInfinity() \? this : this.curve.zeroA \? this._zeroDbl() : this.curve.threeA \? this._threeDbl() : this._dbl();\n }, JPoint.prototype._zeroDbl = function() {\n var nx, ny, nz;\n if (this.zOne) {\n var xx = this.x.redSqr(), yy = this.y.redSqr(), yyyy = yy.redSqr(), s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n var m = xx.redAdd(xx).redIAdd(xx), t = m.redSqr().redISub(s).redISub(s), yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8), yyyy8 = yyyy8.redIAdd(yyyy8), nx = t, ny = m.redMul(s.redISub(t)).redISub(yyyy8), nz = this.y.redAdd(this.y);\n } else {\n var a = this.x.redSqr(), b = this.y.redSqr(), c = b.redSqr(), d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n d = d.redIAdd(d);\n var e = a.redAdd(a).redIAdd(a), f = e.redSqr(), c8 = c.redIAdd(c);\n c8 = c8.redIAdd(c8), c8 = c8.redIAdd(c8), nx = f.redISub(d).redISub(d), ny = e.redMul(d.redISub(nx)).redISub(c8), nz = this.y.redMul(this.z), nz = nz.redIAdd(nz);\n }\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype._threeDbl = function() {\n var nx, ny, nz;\n if (this.zOne) {\n var xx = this.x.redSqr(), yy = this.y.redSqr(), yyyy = yy.redSqr(), s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a), t = m.redSqr().redISub(s).redISub(s);\n nx = t;\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8), yyyy8 = yyyy8.redIAdd(yyyy8), ny = m.redMul(s.redISub(t)).redISub(yyyy8), nz = this.y.redAdd(this.y);\n } else {\n var delta = this.z.redSqr(), gamma = this.y.redSqr(), beta = this.x.redMul(gamma), alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n alpha = alpha.redAdd(alpha).redIAdd(alpha);\n var beta4 = beta.redIAdd(beta);\n beta4 = beta4.redIAdd(beta4);\n var beta8 = beta4.redAdd(beta4);\n nx = alpha.redSqr().redISub(beta8), nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n var ggamma8 = gamma.redSqr();\n ggamma8 = ggamma8.redIAdd(ggamma8), ggamma8 = ggamma8.redIAdd(ggamma8), ggamma8 = ggamma8.redIAdd(ggamma8), ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n }\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype._dbl = function() {\n var a = this.curve.a, jx = this.x, jy = this.y, jz = this.z, jz4 = jz.redSqr().redSqr(), jx2 = jx.redSqr(), jy2 = jy.redSqr(), c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)), jxd4 = jx.redAdd(jx);\n jxd4 = jxd4.redIAdd(jxd4);\n var t1 = jxd4.redMul(jy2), nx = c.redSqr().redISub(t1.redAdd(t1)), t2 = t1.redISub(nx), jyd8 = jy2.redSqr();\n jyd8 = jyd8.redIAdd(jyd8), jyd8 = jyd8.redIAdd(jyd8), jyd8 = jyd8.redIAdd(jyd8);\n var ny = c.redMul(t2).redISub(jyd8), nz = jy.redAdd(jy).redMul(jz);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.trpl = function() {\n if (!this.curve.zeroA)\n return this.dbl().add(this);\n var xx = this.x.redSqr(), yy = this.y.redSqr(), zz = this.z.redSqr(), yyyy = yy.redSqr(), m = xx.redAdd(xx).redIAdd(xx), mm = m.redSqr(), e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n e = e.redIAdd(e), e = e.redAdd(e).redIAdd(e), e = e.redISub(mm);\n var ee = e.redSqr(), t = yyyy.redIAdd(yyyy);\n t = t.redIAdd(t), t = t.redIAdd(t), t = t.redIAdd(t);\n var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t), yyu4 = yy.redMul(u);\n yyu4 = yyu4.redIAdd(yyu4), yyu4 = yyu4.redIAdd(yyu4);\n var nx = this.x.redMul(ee).redISub(yyu4);\n nx = nx.redIAdd(nx), nx = nx.redIAdd(nx);\n var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n ny = ny.redIAdd(ny), ny = ny.redIAdd(ny), ny = ny.redIAdd(ny);\n var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.mul = function(k, kbase) {\n return k = new BN(k, kbase), this.curve._wnafMul(this, k);\n }, JPoint.prototype.eq = function(p) {\n if (p.type === \"affine\")\n return this.eq(p.toJ());\n if (this === p)\n return !0;\n var z2 = this.z.redSqr(), pz2 = p.z.redSqr();\n if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n return !1;\n var z3 = z2.redMul(this.z), pz3 = pz2.redMul(p.z);\n return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n }, JPoint.prototype.eqXToP = function(x) {\n var zs = this.z.redSqr(), rx = x.toRed(this.curve.red).redMul(zs);\n if (this.x.cmp(rx) === 0)\n return !0;\n for (var xc = x.clone(), t = this.curve.redN.redMul(zs);; ) {\n if (xc.iadd(this.curve.n), xc.cmp(this.curve.p) >= 0)\n return !1;\n if (rx.redIAdd(t), this.x.cmp(rx) === 0)\n return !0;\n }\n }, JPoint.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC JPoint Infinity>\" : \"<EC JPoint x: \" + this.x.toString(16, 2) + \" y: \" + this.y.toString(16, 2) + \" z: \" + this.z.toString(16, 2) + \">\";\n }, JPoint.prototype.isInfinity = function() {\n return this.z.cmpn(0) === 0;\n };\n }\n}), require_mont = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/mont.js\"(exports, module) {\n var BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), utils = require_utils3();\n function MontCurve(conf) {\n Base.call(this, \"mont\", conf), this.a = new BN(conf.a, 16).toRed(this.red), this.b = new BN(conf.b, 16).toRed(this.red), this.i4 = new BN(4).toRed(this.red).redInvm(), this.two = new BN(2).toRed(this.red), this.a24 = this.i4.redMul(this.a.redAdd(this.two));\n }\n inherits(MontCurve, Base), module.exports = MontCurve, MontCurve.prototype.validate = function(point) {\n var x = point.normalize().x, x2 = x.redSqr(), rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x), y = rhs.redSqrt();\n return y.redSqr().cmp(rhs) === 0;\n };\n function Point(curve, x, z) {\n Base.BasePoint.call(this, curve, \"projective\"), x === null && z === null \? (this.x = this.curve.one, this.z = this.curve.zero) : (this.x = new BN(x, 16), this.z = new BN(z, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)));\n }\n inherits(Point, Base.BasePoint), MontCurve.prototype.decodePoint = function(bytes, enc) {\n return this.point(utils.toArray(bytes, enc), 1);\n }, MontCurve.prototype.point = function(x, z) {\n return new Point(this, x, z);\n }, MontCurve.prototype.pointFromJSON = function(obj) {\n return Point.fromJSON(this, obj);\n }, Point.prototype.precompute = function() {\n }, Point.prototype._encode = function() {\n return this.getX().toArray(\"be\", this.curve.p.byteLength());\n }, Point.fromJSON = function(curve, obj) {\n return new Point(curve, obj[0], obj[1] || curve.one);\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" z: \" + this.z.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.z.cmpn(0) === 0;\n }, Point.prototype.dbl = function() {\n var a = this.x.redAdd(this.z), aa = a.redSqr(), b = this.x.redSub(this.z), bb = b.redSqr(), c = aa.redSub(bb), nx = aa.redMul(bb), nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\n return this.curve.point(nx, nz);\n }, Point.prototype.add = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.diffAdd = function(p, diff) {\n var a = this.x.redAdd(this.z), b = this.x.redSub(this.z), c = p.x.redAdd(p.z), d = p.x.redSub(p.z), da = d.redMul(a), cb = c.redMul(b), nx = diff.z.redMul(da.redAdd(cb).redSqr()), nz = diff.x.redMul(da.redISub(cb).redSqr());\n return this.curve.point(nx, nz);\n }, Point.prototype.mul = function(k) {\n for (var t = k.clone(), a = this, b = this.curve.point(null, null), c = this, bits = [];t.cmpn(0) !== 0; t.iushrn(1))\n bits.push(t.andln(1));\n for (var i = bits.length - 1;i >= 0; i--)\n bits[i] === 0 \? (a = a.diffAdd(b, c), b = b.dbl()) : (b = a.diffAdd(b, c), a = a.dbl());\n return b;\n }, Point.prototype.mulAdd = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.jumlAdd = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.eq = function(other) {\n return this.getX().cmp(other.getX()) === 0;\n }, Point.prototype.normalize = function() {\n return this.x = this.x.redMul(this.z.redInvm()), this.z = this.curve.one, this;\n }, Point.prototype.getX = function() {\n return this.normalize(), this.x.fromRed();\n };\n }\n}), require_edwards = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/edwards.js\"(exports, module) {\n var utils = require_utils3(), BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), assert = utils.assert;\n function EdwardsCurve(conf) {\n this.twisted = (conf.a | 0) !== 1, this.mOneA = this.twisted && (conf.a | 0) === -1, this.extended = this.mOneA, Base.call(this, \"edwards\", conf), this.a = new BN(conf.a, 16).umod(this.red.m), this.a = this.a.toRed(this.red), this.c = new BN(conf.c, 16).toRed(this.red), this.c2 = this.c.redSqr(), this.d = new BN(conf.d, 16).toRed(this.red), this.dd = this.d.redAdd(this.d), assert(!this.twisted || this.c.fromRed().cmpn(1) === 0), this.oneC = (conf.c | 0) === 1;\n }\n inherits(EdwardsCurve, Base), module.exports = EdwardsCurve, EdwardsCurve.prototype._mulA = function(num) {\n return this.mOneA \? num.redNeg() : this.a.redMul(num);\n }, EdwardsCurve.prototype._mulC = function(num) {\n return this.oneC \? num : this.c.redMul(num);\n }, EdwardsCurve.prototype.jpoint = function(x, y, z, t) {\n return this.point(x, y, z, t);\n }, EdwardsCurve.prototype.pointFromX = function(x, odd) {\n x = new BN(x, 16), x.red || (x = x.toRed(this.red));\n var x2 = x.redSqr(), rhs = this.c2.redSub(this.a.redMul(x2)), lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2)), y2 = rhs.redMul(lhs.redInvm()), y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n var isOdd = y.fromRed().isOdd();\n return (odd && !isOdd || !odd && isOdd) && (y = y.redNeg()), this.point(x, y);\n }, EdwardsCurve.prototype.pointFromY = function(y, odd) {\n y = new BN(y, 16), y.red || (y = y.toRed(this.red));\n var y2 = y.redSqr(), lhs = y2.redSub(this.c2), rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a), x2 = lhs.redMul(rhs.redInvm());\n if (x2.cmp(this.zero) === 0) {\n if (odd)\n throw new Error(\"invalid point\");\n return this.point(this.zero, y);\n }\n var x = x2.redSqrt();\n if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n return x.fromRed().isOdd() !== odd && (x = x.redNeg()), this.point(x, y);\n }, EdwardsCurve.prototype.validate = function(point) {\n if (point.isInfinity())\n return !0;\n point.normalize();\n var x2 = point.x.redSqr(), y2 = point.y.redSqr(), lhs = x2.redMul(this.a).redAdd(y2), rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\n return lhs.cmp(rhs) === 0;\n };\n function Point(curve, x, y, z, t) {\n Base.BasePoint.call(this, curve, \"projective\"), x === null && y === null && z === null \? (this.x = this.curve.zero, this.y = this.curve.one, this.z = this.curve.one, this.t = this.curve.zero, this.zOne = !0) : (this.x = new BN(x, 16), this.y = new BN(y, 16), this.z = z \? new BN(z, 16) : this.curve.one, this.t = t && new BN(t, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.t && !this.t.red && (this.t = this.t.toRed(this.curve.red)), this.zOne = this.z === this.curve.one, this.curve.extended && !this.t && (this.t = this.x.redMul(this.y), this.zOne || (this.t = this.t.redMul(this.z.redInvm()))));\n }\n inherits(Point, Base.BasePoint), EdwardsCurve.prototype.pointFromJSON = function(obj) {\n return Point.fromJSON(this, obj);\n }, EdwardsCurve.prototype.point = function(x, y, z, t) {\n return new Point(this, x, y, z, t);\n }, Point.fromJSON = function(curve, obj) {\n return new Point(curve, obj[0], obj[1], obj[2]);\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" y: \" + this.y.fromRed().toString(16, 2) + \" z: \" + this.z.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || this.zOne && this.y.cmp(this.curve.c) === 0);\n }, Point.prototype._extDbl = function() {\n var a = this.x.redSqr(), b = this.y.redSqr(), c = this.z.redSqr();\n c = c.redIAdd(c);\n var d = this.curve._mulA(a), e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b), g = d.redAdd(b), f = g.redSub(c), h = d.redSub(b), nx = e.redMul(f), ny = g.redMul(h), nt = e.redMul(h), nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n }, Point.prototype._projDbl = function() {\n var b = this.x.redAdd(this.y).redSqr(), c = this.x.redSqr(), d = this.y.redSqr(), nx, ny, nz, e, h, j;\n if (this.curve.twisted) {\n e = this.curve._mulA(c);\n var f = e.redAdd(d);\n this.zOne \? (nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)), ny = f.redMul(e.redSub(d)), nz = f.redSqr().redSub(f).redSub(f)) : (h = this.z.redSqr(), j = f.redSub(h).redISub(h), nx = b.redSub(c).redISub(d).redMul(j), ny = f.redMul(e.redSub(d)), nz = f.redMul(j));\n } else\n e = c.redAdd(d), h = this.curve._mulC(this.z).redSqr(), j = e.redSub(h).redSub(h), nx = this.curve._mulC(b.redISub(e)).redMul(j), ny = this.curve._mulC(e).redMul(c.redISub(d)), nz = e.redMul(j);\n return this.curve.point(nx, ny, nz);\n }, Point.prototype.dbl = function() {\n return this.isInfinity() \? this : this.curve.extended \? this._extDbl() : this._projDbl();\n }, Point.prototype._extAdd = function(p) {\n var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)), b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)), c = this.t.redMul(this.curve.dd).redMul(p.t), d = this.z.redMul(p.z.redAdd(p.z)), e = b.redSub(a), f = d.redSub(c), g = d.redAdd(c), h = b.redAdd(a), nx = e.redMul(f), ny = g.redMul(h), nt = e.redMul(h), nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n }, Point.prototype._projAdd = function(p) {\n var a = this.z.redMul(p.z), b = a.redSqr(), c = this.x.redMul(p.x), d = this.y.redMul(p.y), e = this.curve.d.redMul(c).redMul(d), f = b.redSub(e), g = b.redAdd(e), tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d), nx = a.redMul(f).redMul(tmp), ny, nz;\n return this.curve.twisted \? (ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))), nz = f.redMul(g)) : (ny = a.redMul(g).redMul(d.redSub(c)), nz = this.curve._mulC(f).redMul(g)), this.curve.point(nx, ny, nz);\n }, Point.prototype.add = function(p) {\n return this.isInfinity() \? p : p.isInfinity() \? this : this.curve.extended \? this._extAdd(p) : this._projAdd(p);\n }, Point.prototype.mul = function(k) {\n return this._hasDoubles(k) \? this.curve._fixedNafMul(this, k) : this.curve._wnafMul(this, k);\n }, Point.prototype.mulAdd = function(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, !1);\n }, Point.prototype.jmulAdd = function(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, !0);\n }, Point.prototype.normalize = function() {\n if (this.zOne)\n return this;\n var zi = this.z.redInvm();\n return this.x = this.x.redMul(zi), this.y = this.y.redMul(zi), this.t && (this.t = this.t.redMul(zi)), this.z = this.curve.one, this.zOne = !0, this;\n }, Point.prototype.neg = function() {\n return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg());\n }, Point.prototype.getX = function() {\n return this.normalize(), this.x.fromRed();\n }, Point.prototype.getY = function() {\n return this.normalize(), this.y.fromRed();\n }, Point.prototype.eq = function(other) {\n return this === other || this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0;\n }, Point.prototype.eqXToP = function(x) {\n var rx = x.toRed(this.curve.red).redMul(this.z);\n if (this.x.cmp(rx) === 0)\n return !0;\n for (var xc = x.clone(), t = this.curve.redN.redMul(this.z);; ) {\n if (xc.iadd(this.curve.n), xc.cmp(this.curve.p) >= 0)\n return !1;\n if (rx.redIAdd(t), this.x.cmp(rx) === 0)\n return !0;\n }\n }, Point.prototype.toP = Point.prototype.normalize, Point.prototype.mixedAdd = Point.prototype.add;\n }\n}), require_curve = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/index.js\"(exports) {\n var curve = exports;\n curve.base = require_base(), curve.short = require_short(), curve.mont = require_mont(), curve.edwards = require_edwards();\n }\n}), require_utils4 = __commonJS({\n \"node_modules/hash.js/lib/hash/utils.js\"(exports) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser();\n exports.inherits = inherits;\n function isSurrogatePair(msg, i) {\n return (msg.charCodeAt(i) & 64512) !== 55296 || i < 0 || i + 1 >= msg.length \? !1 : (msg.charCodeAt(i + 1) & 64512) === 56320;\n }\n function toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg == \"string\")\n if (enc) {\n if (enc === \"hex\")\n for (msg = msg.replace(/[^a-z0-9]+/gi, \"\"), msg.length % 2 !== 0 && (msg = \"0\" + msg), i = 0;i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else\n for (var p = 0, i = 0;i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n c < 128 \? res[p++] = c : c < 2048 \? (res[p++] = c >> 6 | 192, res[p++] = c & 63 | 128) : isSurrogatePair(msg, i) \? (c = 65536 + ((c & 1023) << 10) + (msg.charCodeAt(++i) & 1023), res[p++] = c >> 18 | 240, res[p++] = c >> 12 & 63 | 128, res[p++] = c >> 6 & 63 | 128, res[p++] = c & 63 | 128) : (res[p++] = c >> 12 | 224, res[p++] = c >> 6 & 63 | 128, res[p++] = c & 63 | 128);\n }\n else\n for (i = 0;i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n exports.toArray = toArray;\n function toHex(msg) {\n for (var res = \"\", i = 0;i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n }\n exports.toHex = toHex;\n function htonl(w) {\n var res = w >>> 24 | w >>> 8 & 65280 | w << 8 & 16711680 | (w & 255) << 24;\n return res >>> 0;\n }\n exports.htonl = htonl;\n function toHex32(msg, endian) {\n for (var res = \"\", i = 0;i < msg.length; i++) {\n var w = msg[i];\n endian === \"little\" && (w = htonl(w)), res += zero8(w.toString(16));\n }\n return res;\n }\n exports.toHex32 = toHex32;\n function zero2(word) {\n return word.length === 1 \? \"0\" + word : word;\n }\n exports.zero2 = zero2;\n function zero8(word) {\n return word.length === 7 \? \"0\" + word : word.length === 6 \? \"00\" + word : word.length === 5 \? \"000\" + word : word.length === 4 \? \"0000\" + word : word.length === 3 \? \"00000\" + word : word.length === 2 \? \"000000\" + word : word.length === 1 \? \"0000000\" + word : word;\n }\n exports.zero8 = zero8;\n function join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n for (var res = new Array(len / 4), i = 0, k = start;i < res.length; i++, k += 4) {\n var w;\n endian === \"big\" \? w = msg[k] << 24 | msg[k + 1] << 16 | msg[k + 2] << 8 | msg[k + 3] : w = msg[k + 3] << 24 | msg[k + 2] << 16 | msg[k + 1] << 8 | msg[k], res[i] = w >>> 0;\n }\n return res;\n }\n exports.join32 = join32;\n function split32(msg, endian) {\n for (var res = new Array(msg.length * 4), i = 0, k = 0;i < msg.length; i++, k += 4) {\n var m = msg[i];\n endian === \"big\" \? (res[k] = m >>> 24, res[k + 1] = m >>> 16 & 255, res[k + 2] = m >>> 8 & 255, res[k + 3] = m & 255) : (res[k + 3] = m >>> 24, res[k + 2] = m >>> 16 & 255, res[k + 1] = m >>> 8 & 255, res[k] = m & 255);\n }\n return res;\n }\n exports.split32 = split32;\n function rotr32(w, b) {\n return w >>> b | w << 32 - b;\n }\n exports.rotr32 = rotr32;\n function rotl32(w, b) {\n return w << b | w >>> 32 - b;\n }\n exports.rotl32 = rotl32;\n function sum32(a, b) {\n return a + b >>> 0;\n }\n exports.sum32 = sum32;\n function sum32_3(a, b, c) {\n return a + b + c >>> 0;\n }\n exports.sum32_3 = sum32_3;\n function sum32_4(a, b, c, d) {\n return a + b + c + d >>> 0;\n }\n exports.sum32_4 = sum32_4;\n function sum32_5(a, b, c, d, e) {\n return a + b + c + d + e >>> 0;\n }\n exports.sum32_5 = sum32_5;\n function sum64(buf, pos, ah, al) {\n var bh = buf[pos], bl = buf[pos + 1], lo = al + bl >>> 0, hi = (lo < al \? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0, buf[pos + 1] = lo;\n }\n exports.sum64 = sum64;\n function sum64_hi(ah, al, bh, bl) {\n var lo = al + bl >>> 0, hi = (lo < al \? 1 : 0) + ah + bh;\n return hi >>> 0;\n }\n exports.sum64_hi = sum64_hi;\n function sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n }\n exports.sum64_lo = sum64_lo;\n function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0, lo = al;\n lo = lo + bl >>> 0, carry += lo < al \? 1 : 0, lo = lo + cl >>> 0, carry += lo < cl \? 1 : 0, lo = lo + dl >>> 0, carry += lo < dl \? 1 : 0;\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n }\n exports.sum64_4_hi = sum64_4_hi;\n function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n }\n exports.sum64_4_lo = sum64_4_lo;\n function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0, lo = al;\n lo = lo + bl >>> 0, carry += lo < al \? 1 : 0, lo = lo + cl >>> 0, carry += lo < cl \? 1 : 0, lo = lo + dl >>> 0, carry += lo < dl \? 1 : 0, lo = lo + el >>> 0, carry += lo < el \? 1 : 0;\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n }\n exports.sum64_5_hi = sum64_5_hi;\n function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n return lo >>> 0;\n }\n exports.sum64_5_lo = sum64_5_lo;\n function rotr64_hi(ah, al, num) {\n var r = al << 32 - num | ah >>> num;\n return r >>> 0;\n }\n exports.rotr64_hi = rotr64_hi;\n function rotr64_lo(ah, al, num) {\n var r = ah << 32 - num | al >>> num;\n return r >>> 0;\n }\n exports.rotr64_lo = rotr64_lo;\n function shr64_hi(ah, al, num) {\n return ah >>> num;\n }\n exports.shr64_hi = shr64_hi;\n function shr64_lo(ah, al, num) {\n var r = ah << 32 - num | al >>> num;\n return r >>> 0;\n }\n exports.shr64_lo = shr64_lo;\n }\n}), require_common = __commonJS({\n \"node_modules/hash.js/lib/hash/common.js\"(exports) {\n var utils = require_utils4(), assert = require_minimalistic_assert();\n function BlockHash() {\n this.pending = null, this.pendingTotal = 0, this.blockSize = this.constructor.blockSize, this.outSize = this.constructor.outSize, this.hmacStrength = this.constructor.hmacStrength, this.padLength = this.constructor.padLength / 8, this.endian = \"big\", this._delta8 = this.blockSize / 8, this._delta32 = this.blockSize / 32;\n }\n BlockHash.prototype = {}, exports.BlockHash = BlockHash, BlockHash.prototype.update = function(msg, enc) {\n if (msg = utils.toArray(msg, enc), this.pending \? this.pending = this.pending.concat(msg) : this.pending = msg, this.pendingTotal += msg.length, this.pending.length >= this._delta8) {\n msg = this.pending;\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length), this.pending.length === 0 && (this.pending = null), msg = utils.join32(msg, 0, msg.length - r, this.endian);\n for (var i = 0;i < msg.length; i += this._delta32)\n this._update(msg, i, i + this._delta32);\n }\n return this;\n }, BlockHash.prototype.digest = function(enc) {\n return this.update(this._pad()), assert(this.pending === null), this._digest(enc);\n }, BlockHash.prototype._pad = function() {\n var len = this.pendingTotal, bytes = this._delta8, k = bytes - (len + this.padLength) % bytes, res = new Array(k + this.padLength);\n res[0] = 128;\n for (var i = 1;i < k; i++)\n res[i] = 0;\n if (len <<= 3, this.endian === \"big\") {\n for (var t = 8;t < this.padLength; t++)\n res[i++] = 0;\n res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = len >>> 24 & 255, res[i++] = len >>> 16 & 255, res[i++] = len >>> 8 & 255, res[i++] = len & 255;\n } else\n for (res[i++] = len & 255, res[i++] = len >>> 8 & 255, res[i++] = len >>> 16 & 255, res[i++] = len >>> 24 & 255, res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = 0, t = 8;t < this.padLength; t++)\n res[i++] = 0;\n return res;\n };\n }\n}), require_common2 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/common.js\"(exports) {\n var utils = require_utils4(), rotr32 = utils.rotr32;\n function ft_1(s, x, y, z) {\n if (s === 0)\n return ch32(x, y, z);\n if (s === 1 || s === 3)\n return p32(x, y, z);\n if (s === 2)\n return maj32(x, y, z);\n }\n exports.ft_1 = ft_1;\n function ch32(x, y, z) {\n return x & y ^ ~x & z;\n }\n exports.ch32 = ch32;\n function maj32(x, y, z) {\n return x & y ^ x & z ^ y & z;\n }\n exports.maj32 = maj32;\n function p32(x, y, z) {\n return x ^ y ^ z;\n }\n exports.p32 = p32;\n function s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n }\n exports.s0_256 = s0_256;\n function s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n }\n exports.s1_256 = s1_256;\n function g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ x >>> 3;\n }\n exports.g0_256 = g0_256;\n function g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ x >>> 10;\n }\n exports.g1_256 = g1_256;\n }\n}), require__ = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/1.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), shaCommon = require_common2(), rotl32 = utils.rotl32, sum32 = utils.sum32, sum32_5 = utils.sum32_5, ft_1 = shaCommon.ft_1, BlockHash = common.BlockHash, sha1_K = [1518500249, 1859775393, 2400959708, 3395469782];\n function SHA1() {\n if (!(this instanceof SHA1))\n return new SHA1;\n BlockHash.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.W = new Array(80);\n }\n utils.inherits(SHA1, BlockHash), module.exports = SHA1, SHA1.blockSize = 512, SHA1.outSize = 160, SHA1.hmacStrength = 80, SHA1.padLength = 64, SHA1.prototype._update = function(msg, start) {\n for (var W = this.W, i = 0;i < 16; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i++)\n W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n var a = this.h[0], b = this.h[1], c = this.h[2], d = this.h[3], e = this.h[4];\n for (i = 0;i < W.length; i++) {\n var s = ~~(i / 20), t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n e = d, d = c, c = rotl32(b, 30), b = a, a = t;\n }\n this.h[0] = sum32(this.h[0], a), this.h[1] = sum32(this.h[1], b), this.h[2] = sum32(this.h[2], c), this.h[3] = sum32(this.h[3], d), this.h[4] = sum32(this.h[4], e);\n }, SHA1.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n }\n}), require__2 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/256.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), shaCommon = require_common2(), assert = require_minimalistic_assert(), sum32 = utils.sum32, sum32_4 = utils.sum32_4, sum32_5 = utils.sum32_5, ch32 = shaCommon.ch32, maj32 = shaCommon.maj32, s0_256 = shaCommon.s0_256, s1_256 = shaCommon.s1_256, g0_256 = shaCommon.g0_256, g1_256 = shaCommon.g1_256, BlockHash = common.BlockHash, sha256_K = [\n 1116352408,\n 1899447441,\n 3049323471,\n 3921009573,\n 961987163,\n 1508970993,\n 2453635748,\n 2870763221,\n 3624381080,\n 310598401,\n 607225278,\n 1426881987,\n 1925078388,\n 2162078206,\n 2614888103,\n 3248222580,\n 3835390401,\n 4022224774,\n 264347078,\n 604807628,\n 770255983,\n 1249150122,\n 1555081692,\n 1996064986,\n 2554220882,\n 2821834349,\n 2952996808,\n 3210313671,\n 3336571891,\n 3584528711,\n 113926993,\n 338241895,\n 666307205,\n 773529912,\n 1294757372,\n 1396182291,\n 1695183700,\n 1986661051,\n 2177026350,\n 2456956037,\n 2730485921,\n 2820302411,\n 3259730800,\n 3345764771,\n 3516065817,\n 3600352804,\n 4094571909,\n 275423344,\n 430227734,\n 506948616,\n 659060556,\n 883997877,\n 958139571,\n 1322822218,\n 1537002063,\n 1747873779,\n 1955562222,\n 2024104815,\n 2227730452,\n 2361852424,\n 2428436474,\n 2756734187,\n 3204031479,\n 3329325298\n ];\n function SHA256() {\n if (!(this instanceof SHA256))\n return new SHA256;\n BlockHash.call(this), this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], this.k = sha256_K, this.W = new Array(64);\n }\n utils.inherits(SHA256, BlockHash), module.exports = SHA256, SHA256.blockSize = 512, SHA256.outSize = 256, SHA256.hmacStrength = 192, SHA256.padLength = 64, SHA256.prototype._update = function(msg, start) {\n for (var W = this.W, i = 0;i < 16; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i++)\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n var a = this.h[0], b = this.h[1], c = this.h[2], d = this.h[3], e = this.h[4], f = this.h[5], g = this.h[6], h = this.h[7];\n for (assert(this.k.length === W.length), i = 0;i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]), T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g, g = f, f = e, e = sum32(d, T1), d = c, c = b, b = a, a = sum32(T1, T2);\n }\n this.h[0] = sum32(this.h[0], a), this.h[1] = sum32(this.h[1], b), this.h[2] = sum32(this.h[2], c), this.h[3] = sum32(this.h[3], d), this.h[4] = sum32(this.h[4], e), this.h[5] = sum32(this.h[5], f), this.h[6] = sum32(this.h[6], g), this.h[7] = sum32(this.h[7], h);\n }, SHA256.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n }\n}), require__3 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/224.js\"(exports, module) {\n var utils = require_utils4(), SHA256 = require__2();\n function SHA224() {\n if (!(this instanceof SHA224))\n return new SHA224;\n SHA256.call(this), this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428];\n }\n utils.inherits(SHA224, SHA256), module.exports = SHA224, SHA224.blockSize = 512, SHA224.outSize = 224, SHA224.hmacStrength = 192, SHA224.padLength = 64, SHA224.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h.slice(0, 7), \"big\") : utils.split32(this.h.slice(0, 7), \"big\");\n };\n }\n}), require__4 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/512.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), assert = require_minimalistic_assert(), rotr64_hi = utils.rotr64_hi, rotr64_lo = utils.rotr64_lo, shr64_hi = utils.shr64_hi, shr64_lo = utils.shr64_lo, sum64 = utils.sum64, sum64_hi = utils.sum64_hi, sum64_lo = utils.sum64_lo, sum64_4_hi = utils.sum64_4_hi, sum64_4_lo = utils.sum64_4_lo, sum64_5_hi = utils.sum64_5_hi, sum64_5_lo = utils.sum64_5_lo, BlockHash = common.BlockHash, sha512_K = [\n 1116352408,\n 3609767458,\n 1899447441,\n 602891725,\n 3049323471,\n 3964484399,\n 3921009573,\n 2173295548,\n 961987163,\n 4081628472,\n 1508970993,\n 3053834265,\n 2453635748,\n 2937671579,\n 2870763221,\n 3664609560,\n 3624381080,\n 2734883394,\n 310598401,\n 1164996542,\n 607225278,\n 1323610764,\n 1426881987,\n 3590304994,\n 1925078388,\n 4068182383,\n 2162078206,\n 991336113,\n 2614888103,\n 633803317,\n 3248222580,\n 3479774868,\n 3835390401,\n 2666613458,\n 4022224774,\n 944711139,\n 264347078,\n 2341262773,\n 604807628,\n 2007800933,\n 770255983,\n 1495990901,\n 1249150122,\n 1856431235,\n 1555081692,\n 3175218132,\n 1996064986,\n 2198950837,\n 2554220882,\n 3999719339,\n 2821834349,\n 766784016,\n 2952996808,\n 2566594879,\n 3210313671,\n 3203337956,\n 3336571891,\n 1034457026,\n 3584528711,\n 2466948901,\n 113926993,\n 3758326383,\n 338241895,\n 168717936,\n 666307205,\n 1188179964,\n 773529912,\n 1546045734,\n 1294757372,\n 1522805485,\n 1396182291,\n 2643833823,\n 1695183700,\n 2343527390,\n 1986661051,\n 1014477480,\n 2177026350,\n 1206759142,\n 2456956037,\n 344077627,\n 2730485921,\n 1290863460,\n 2820302411,\n 3158454273,\n 3259730800,\n 3505952657,\n 3345764771,\n 106217008,\n 3516065817,\n 3606008344,\n 3600352804,\n 1432725776,\n 4094571909,\n 1467031594,\n 275423344,\n 851169720,\n 430227734,\n 3100823752,\n 506948616,\n 1363258195,\n 659060556,\n 3750685593,\n 883997877,\n 3785050280,\n 958139571,\n 3318307427,\n 1322822218,\n 3812723403,\n 1537002063,\n 2003034995,\n 1747873779,\n 3602036899,\n 1955562222,\n 1575990012,\n 2024104815,\n 1125592928,\n 2227730452,\n 2716904306,\n 2361852424,\n 442776044,\n 2428436474,\n 593698344,\n 2756734187,\n 3733110249,\n 3204031479,\n 2999351573,\n 3329325298,\n 3815920427,\n 3391569614,\n 3928383900,\n 3515267271,\n 566280711,\n 3940187606,\n 3454069534,\n 4118630271,\n 4000239992,\n 116418474,\n 1914138554,\n 174292421,\n 2731055270,\n 289380356,\n 3203993006,\n 460393269,\n 320620315,\n 685471733,\n 587496836,\n 852142971,\n 1086792851,\n 1017036298,\n 365543100,\n 1126000580,\n 2618297676,\n 1288033470,\n 3409855158,\n 1501505948,\n 4234509866,\n 1607167915,\n 987167468,\n 1816402316,\n 1246189591\n ];\n function SHA512() {\n if (!(this instanceof SHA512))\n return new SHA512;\n BlockHash.call(this), this.h = [\n 1779033703,\n 4089235720,\n 3144134277,\n 2227873595,\n 1013904242,\n 4271175723,\n 2773480762,\n 1595750129,\n 1359893119,\n 2917565137,\n 2600822924,\n 725511199,\n 528734635,\n 4215389547,\n 1541459225,\n 327033209\n ], this.k = sha512_K, this.W = new Array(160);\n }\n utils.inherits(SHA512, BlockHash), module.exports = SHA512, SHA512.blockSize = 1024, SHA512.outSize = 512, SHA512.hmacStrength = 192, SHA512.padLength = 128, SHA512.prototype._prepareBlock = function(msg, start) {\n for (var W = this.W, i = 0;i < 32; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i += 2) {\n var c0_hi = g1_512_hi(W[i - 4], W[i - 3]), c0_lo = g1_512_lo(W[i - 4], W[i - 3]), c1_hi = W[i - 14], c1_lo = W[i - 13], c2_hi = g0_512_hi(W[i - 30], W[i - 29]), c2_lo = g0_512_lo(W[i - 30], W[i - 29]), c3_hi = W[i - 32], c3_lo = W[i - 31];\n W[i] = sum64_4_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo), W[i + 1] = sum64_4_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo);\n }\n }, SHA512.prototype._update = function(msg, start) {\n this._prepareBlock(msg, start);\n var W = this.W, ah = this.h[0], al = this.h[1], bh = this.h[2], bl = this.h[3], ch = this.h[4], cl = this.h[5], dh = this.h[6], dl = this.h[7], eh = this.h[8], el = this.h[9], fh = this.h[10], fl = this.h[11], gh = this.h[12], gl = this.h[13], hh = this.h[14], hl = this.h[15];\n assert(this.k.length === W.length);\n for (var i = 0;i < W.length; i += 2) {\n var c0_hi = hh, c0_lo = hl, c1_hi = s1_512_hi(eh, el), c1_lo = s1_512_lo(eh, el), c2_hi = ch64_hi(eh, el, fh, fl, gh, gl), c2_lo = ch64_lo(eh, el, fh, fl, gh, gl), c3_hi = this.k[i], c3_lo = this.k[i + 1], c4_hi = W[i], c4_lo = W[i + 1], T1_hi = sum64_5_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo), T1_lo = sum64_5_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo);\n c0_hi = s0_512_hi(ah, al), c0_lo = s0_512_lo(ah, al), c1_hi = maj64_hi(ah, al, bh, bl, ch, cl), c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo), T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n hh = gh, hl = gl, gh = fh, gl = fl, fh = eh, fl = el, eh = sum64_hi(dh, dl, T1_hi, T1_lo), el = sum64_lo(dl, dl, T1_hi, T1_lo), dh = ch, dl = cl, ch = bh, cl = bl, bh = ah, bl = al, ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo), al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n }\n sum64(this.h, 0, ah, al), sum64(this.h, 2, bh, bl), sum64(this.h, 4, ch, cl), sum64(this.h, 6, dh, dl), sum64(this.h, 8, eh, el), sum64(this.h, 10, fh, fl), sum64(this.h, 12, gh, gl), sum64(this.h, 14, hh, hl);\n }, SHA512.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n function ch64_hi(xh, xl, yh, yl, zh) {\n var r = xh & yh ^ ~xh & zh;\n return r < 0 && (r += 4294967296), r;\n }\n function ch64_lo(xh, xl, yh, yl, zh, zl) {\n var r = xl & yl ^ ~xl & zl;\n return r < 0 && (r += 4294967296), r;\n }\n function maj64_hi(xh, xl, yh, yl, zh) {\n var r = xh & yh ^ xh & zh ^ yh & zh;\n return r < 0 && (r += 4294967296), r;\n }\n function maj64_lo(xh, xl, yh, yl, zh, zl) {\n var r = xl & yl ^ xl & zl ^ yl & zl;\n return r < 0 && (r += 4294967296), r;\n }\n function s0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 28), c1_hi = rotr64_hi(xl, xh, 2), c2_hi = rotr64_hi(xl, xh, 7), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function s0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 28), c1_lo = rotr64_lo(xl, xh, 2), c2_lo = rotr64_lo(xl, xh, 7), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function s1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 14), c1_hi = rotr64_hi(xh, xl, 18), c2_hi = rotr64_hi(xl, xh, 9), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function s1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 14), c1_lo = rotr64_lo(xh, xl, 18), c2_lo = rotr64_lo(xl, xh, 9), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function g0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 1), c1_hi = rotr64_hi(xh, xl, 8), c2_hi = shr64_hi(xh, xl, 7), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function g0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 1), c1_lo = rotr64_lo(xh, xl, 8), c2_lo = shr64_lo(xh, xl, 7), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function g1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 19), c1_hi = rotr64_hi(xl, xh, 29), c2_hi = shr64_hi(xh, xl, 6), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function g1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 19), c1_lo = rotr64_lo(xl, xh, 29), c2_lo = shr64_lo(xh, xl, 6), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n }\n}), require__5 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/384.js\"(exports, module) {\n var utils = require_utils4(), SHA512 = require__4();\n function SHA384() {\n if (!(this instanceof SHA384))\n return new SHA384;\n SHA512.call(this), this.h = [\n 3418070365,\n 3238371032,\n 1654270250,\n 914150663,\n 2438529370,\n 812702999,\n 355462360,\n 4144912697,\n 1731405415,\n 4290775857,\n 2394180231,\n 1750603025,\n 3675008525,\n 1694076839,\n 1203062813,\n 3204075428\n ];\n }\n utils.inherits(SHA384, SHA512), module.exports = SHA384, SHA384.blockSize = 1024, SHA384.outSize = 384, SHA384.hmacStrength = 192, SHA384.padLength = 128, SHA384.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h.slice(0, 12), \"big\") : utils.split32(this.h.slice(0, 12), \"big\");\n };\n }\n}), require_sha3 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha.js\"(exports) {\n exports.sha1 = require__(), exports.sha224 = require__3(), exports.sha256 = require__2(), exports.sha384 = require__5(), exports.sha512 = require__4();\n }\n}), require_ripemd = __commonJS({\n \"node_modules/hash.js/lib/hash/ripemd.js\"(exports) {\n var utils = require_utils4(), common = require_common(), rotl32 = utils.rotl32, sum32 = utils.sum32, sum32_3 = utils.sum32_3, sum32_4 = utils.sum32_4, BlockHash = common.BlockHash;\n function RIPEMD160() {\n if (!(this instanceof RIPEMD160))\n return new RIPEMD160;\n BlockHash.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = \"little\";\n }\n utils.inherits(RIPEMD160, BlockHash), exports.ripemd160 = RIPEMD160, RIPEMD160.blockSize = 512, RIPEMD160.outSize = 160, RIPEMD160.hmacStrength = 192, RIPEMD160.padLength = 64, RIPEMD160.prototype._update = function(msg, start) {\n for (var A = this.h[0], B = this.h[1], C = this.h[2], D = this.h[3], E = this.h[4], Ah = A, Bh = B, Ch = C, Dh = D, Eh = E, j = 0;j < 80; j++) {\n var T = sum32(rotl32(sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), s[j]), E);\n A = E, E = D, D = rotl32(C, 10), C = B, B = T, T = sum32(rotl32(sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), sh[j]), Eh), Ah = Eh, Eh = Dh, Dh = rotl32(Ch, 10), Ch = Bh, Bh = T;\n }\n T = sum32_3(this.h[1], C, Dh), this.h[1] = sum32_3(this.h[2], D, Eh), this.h[2] = sum32_3(this.h[3], E, Ah), this.h[3] = sum32_3(this.h[4], A, Bh), this.h[4] = sum32_3(this.h[0], B, Ch), this.h[0] = T;\n }, RIPEMD160.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"little\") : utils.split32(this.h, \"little\");\n };\n function f(j, x, y, z) {\n return j <= 15 \? x ^ y ^ z : j <= 31 \? x & y | ~x & z : j <= 47 \? (x | ~y) ^ z : j <= 63 \? x & z | y & ~z : x ^ (y | ~z);\n }\n function K(j) {\n return j <= 15 \? 0 : j <= 31 \? 1518500249 : j <= 47 \? 1859775393 : j <= 63 \? 2400959708 : 2840853838;\n }\n function Kh(j) {\n return j <= 15 \? 1352829926 : j <= 31 \? 1548603684 : j <= 47 \? 1836072691 : j <= 63 \? 2053994217 : 0;\n }\n var r = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 7,\n 4,\n 13,\n 1,\n 10,\n 6,\n 15,\n 3,\n 12,\n 0,\n 9,\n 5,\n 2,\n 14,\n 11,\n 8,\n 3,\n 10,\n 14,\n 4,\n 9,\n 15,\n 8,\n 1,\n 2,\n 7,\n 0,\n 6,\n 13,\n 11,\n 5,\n 12,\n 1,\n 9,\n 11,\n 10,\n 0,\n 8,\n 12,\n 4,\n 13,\n 3,\n 7,\n 15,\n 14,\n 5,\n 6,\n 2,\n 4,\n 0,\n 5,\n 9,\n 7,\n 12,\n 2,\n 10,\n 14,\n 1,\n 3,\n 8,\n 11,\n 6,\n 15,\n 13\n ], rh = [\n 5,\n 14,\n 7,\n 0,\n 9,\n 2,\n 11,\n 4,\n 13,\n 6,\n 15,\n 8,\n 1,\n 10,\n 3,\n 12,\n 6,\n 11,\n 3,\n 7,\n 0,\n 13,\n 5,\n 10,\n 14,\n 15,\n 8,\n 12,\n 4,\n 9,\n 1,\n 2,\n 15,\n 5,\n 1,\n 3,\n 7,\n 14,\n 6,\n 9,\n 11,\n 8,\n 12,\n 2,\n 10,\n 0,\n 4,\n 13,\n 8,\n 6,\n 4,\n 1,\n 3,\n 11,\n 15,\n 0,\n 5,\n 12,\n 2,\n 13,\n 9,\n 7,\n 10,\n 14,\n 12,\n 15,\n 10,\n 4,\n 1,\n 5,\n 8,\n 7,\n 6,\n 2,\n 13,\n 14,\n 0,\n 3,\n 9,\n 11\n ], s = [\n 11,\n 14,\n 15,\n 12,\n 5,\n 8,\n 7,\n 9,\n 11,\n 13,\n 14,\n 15,\n 6,\n 7,\n 9,\n 8,\n 7,\n 6,\n 8,\n 13,\n 11,\n 9,\n 7,\n 15,\n 7,\n 12,\n 15,\n 9,\n 11,\n 7,\n 13,\n 12,\n 11,\n 13,\n 6,\n 7,\n 14,\n 9,\n 13,\n 15,\n 14,\n 8,\n 13,\n 6,\n 5,\n 12,\n 7,\n 5,\n 11,\n 12,\n 14,\n 15,\n 14,\n 15,\n 9,\n 8,\n 9,\n 14,\n 5,\n 6,\n 8,\n 6,\n 5,\n 12,\n 9,\n 15,\n 5,\n 11,\n 6,\n 8,\n 13,\n 12,\n 5,\n 12,\n 13,\n 14,\n 11,\n 8,\n 5,\n 6\n ], sh = [\n 8,\n 9,\n 9,\n 11,\n 13,\n 15,\n 15,\n 5,\n 7,\n 7,\n 8,\n 11,\n 14,\n 14,\n 12,\n 6,\n 9,\n 13,\n 15,\n 7,\n 12,\n 8,\n 9,\n 11,\n 7,\n 7,\n 12,\n 7,\n 6,\n 15,\n 13,\n 11,\n 9,\n 7,\n 15,\n 11,\n 8,\n 6,\n 6,\n 14,\n 12,\n 13,\n 5,\n 14,\n 13,\n 13,\n 7,\n 5,\n 15,\n 5,\n 8,\n 11,\n 14,\n 14,\n 6,\n 14,\n 6,\n 9,\n 12,\n 9,\n 12,\n 5,\n 15,\n 8,\n 8,\n 5,\n 12,\n 9,\n 12,\n 5,\n 14,\n 6,\n 8,\n 13,\n 6,\n 5,\n 15,\n 13,\n 11,\n 11\n ];\n }\n}), require_hmac = __commonJS({\n \"node_modules/hash.js/lib/hash/hmac.js\"(exports, module) {\n var utils = require_utils4(), assert = require_minimalistic_assert();\n function Hmac(hash, key, enc) {\n if (!(this instanceof Hmac))\n return new Hmac(hash, key, enc);\n this.Hash = hash, this.blockSize = hash.blockSize / 8, this.outSize = hash.outSize / 8, this.inner = null, this.outer = null, this._init(utils.toArray(key, enc));\n }\n Hmac.prototype = {}, module.exports = Hmac, Hmac.prototype._init = function(key) {\n key.length > this.blockSize && (key = new this.Hash().update(key).digest()), assert(key.length <= this.blockSize);\n for (var i = key.length;i < this.blockSize; i++)\n key.push(0);\n for (i = 0;i < key.length; i++)\n key[i] ^= 54;\n for (this.inner = new this.Hash().update(key), i = 0;i < key.length; i++)\n key[i] ^= 106;\n this.outer = new this.Hash().update(key);\n }, Hmac.prototype.update = function(msg, enc) {\n return this.inner.update(msg, enc), this;\n }, Hmac.prototype.digest = function(enc) {\n return this.outer.update(this.inner.digest()), this.outer.digest(enc);\n };\n }\n}), require_hash2 = __commonJS({\n \"node_modules/hash.js/lib/hash.js\"(exports) {\n var hash = exports;\n hash.utils = require_utils4(), hash.common = require_common(), hash.sha = require_sha3(), hash.ripemd = require_ripemd(), hash.hmac = require_hmac(), hash.sha1 = hash.sha.sha1, hash.sha256 = hash.sha.sha256, hash.sha224 = hash.sha.sha224, hash.sha384 = hash.sha.sha384, hash.sha512 = hash.sha.sha512, hash.ripemd160 = hash.ripemd.ripemd160;\n }\n}), require_secp256k1 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js\"(exports, module) {\n module.exports = {\n doubles: {\n step: 4,\n points: [\n [\n \"e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a\",\n \"f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821\"\n ],\n [\n \"8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508\",\n \"11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf\"\n ],\n [\n \"175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739\",\n \"d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695\"\n ],\n [\n \"363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640\",\n \"4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9\"\n ],\n [\n \"8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c\",\n \"4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36\"\n ],\n [\n \"723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda\",\n \"96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f\"\n ],\n [\n \"eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa\",\n \"5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999\"\n ],\n [\n \"100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0\",\n \"cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09\"\n ],\n [\n \"e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d\",\n \"9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d\"\n ],\n [\n \"feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d\",\n \"e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088\"\n ],\n [\n \"da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1\",\n \"9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d\"\n ],\n [\n \"53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0\",\n \"5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8\"\n ],\n [\n \"8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047\",\n \"10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a\"\n ],\n [\n \"385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862\",\n \"283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453\"\n ],\n [\n \"6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7\",\n \"7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160\"\n ],\n [\n \"3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd\",\n \"56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0\"\n ],\n [\n \"85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83\",\n \"7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6\"\n ],\n [\n \"948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a\",\n \"53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589\"\n ],\n [\n \"6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8\",\n \"bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17\"\n ],\n [\n \"e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d\",\n \"4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda\"\n ],\n [\n \"e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725\",\n \"7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd\"\n ],\n [\n \"213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754\",\n \"4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2\"\n ],\n [\n \"4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c\",\n \"17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6\"\n ],\n [\n \"fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6\",\n \"6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f\"\n ],\n [\n \"76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39\",\n \"c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01\"\n ],\n [\n \"c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891\",\n \"893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3\"\n ],\n [\n \"d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b\",\n \"febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f\"\n ],\n [\n \"b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03\",\n \"2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7\"\n ],\n [\n \"e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d\",\n \"eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78\"\n ],\n [\n \"a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070\",\n \"7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1\"\n ],\n [\n \"90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4\",\n \"e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150\"\n ],\n [\n \"8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da\",\n \"662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82\"\n ],\n [\n \"e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11\",\n \"1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc\"\n ],\n [\n \"8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e\",\n \"efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b\"\n ],\n [\n \"e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41\",\n \"2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51\"\n ],\n [\n \"b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef\",\n \"67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45\"\n ],\n [\n \"d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8\",\n \"db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120\"\n ],\n [\n \"324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d\",\n \"648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84\"\n ],\n [\n \"4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96\",\n \"35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d\"\n ],\n [\n \"9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd\",\n \"ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d\"\n ],\n [\n \"6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5\",\n \"9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8\"\n ],\n [\n \"a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266\",\n \"40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8\"\n ],\n [\n \"7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71\",\n \"34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac\"\n ],\n [\n \"928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac\",\n \"c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f\"\n ],\n [\n \"85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751\",\n \"1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962\"\n ],\n [\n \"ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e\",\n \"493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907\"\n ],\n [\n \"827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241\",\n \"c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec\"\n ],\n [\n \"eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3\",\n \"be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d\"\n ],\n [\n \"e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f\",\n \"4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414\"\n ],\n [\n \"1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19\",\n \"aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd\"\n ],\n [\n \"146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be\",\n \"b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0\"\n ],\n [\n \"fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9\",\n \"6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811\"\n ],\n [\n \"da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2\",\n \"8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1\"\n ],\n [\n \"a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13\",\n \"7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c\"\n ],\n [\n \"174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c\",\n \"ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73\"\n ],\n [\n \"959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba\",\n \"2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd\"\n ],\n [\n \"d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151\",\n \"e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405\"\n ],\n [\n \"64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073\",\n \"d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589\"\n ],\n [\n \"8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458\",\n \"38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e\"\n ],\n [\n \"13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b\",\n \"69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27\"\n ],\n [\n \"bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366\",\n \"d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1\"\n ],\n [\n \"8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa\",\n \"40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482\"\n ],\n [\n \"8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0\",\n \"620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945\"\n ],\n [\n \"dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787\",\n \"7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573\"\n ],\n [\n \"f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e\",\n \"ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82\"\n ]\n ]\n },\n naf: {\n wnd: 7,\n points: [\n [\n \"f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9\",\n \"388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672\"\n ],\n [\n \"2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4\",\n \"d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6\"\n ],\n [\n \"5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc\",\n \"6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da\"\n ],\n [\n \"acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe\",\n \"cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37\"\n ],\n [\n \"774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb\",\n \"d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b\"\n ],\n [\n \"f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8\",\n \"ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81\"\n ],\n [\n \"d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e\",\n \"581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58\"\n ],\n [\n \"defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34\",\n \"4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77\"\n ],\n [\n \"2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c\",\n \"85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a\"\n ],\n [\n \"352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5\",\n \"321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c\"\n ],\n [\n \"2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f\",\n \"2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67\"\n ],\n [\n \"9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714\",\n \"73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402\"\n ],\n [\n \"daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729\",\n \"a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55\"\n ],\n [\n \"c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db\",\n \"2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482\"\n ],\n [\n \"6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4\",\n \"e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82\"\n ],\n [\n \"1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5\",\n \"b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396\"\n ],\n [\n \"605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479\",\n \"2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49\"\n ],\n [\n \"62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d\",\n \"80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf\"\n ],\n [\n \"80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f\",\n \"1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a\"\n ],\n [\n \"7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb\",\n \"d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7\"\n ],\n [\n \"d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9\",\n \"eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933\"\n ],\n [\n \"49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963\",\n \"758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a\"\n ],\n [\n \"77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74\",\n \"958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6\"\n ],\n [\n \"f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530\",\n \"e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37\"\n ],\n [\n \"463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b\",\n \"5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e\"\n ],\n [\n \"f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247\",\n \"cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6\"\n ],\n [\n \"caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1\",\n \"cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476\"\n ],\n [\n \"2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120\",\n \"4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40\"\n ],\n [\n \"7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435\",\n \"91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61\"\n ],\n [\n \"754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18\",\n \"673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683\"\n ],\n [\n \"e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8\",\n \"59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5\"\n ],\n [\n \"186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb\",\n \"3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b\"\n ],\n [\n \"df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f\",\n \"55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417\"\n ],\n [\n \"5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143\",\n \"efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868\"\n ],\n [\n \"290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba\",\n \"e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a\"\n ],\n [\n \"af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45\",\n \"f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6\"\n ],\n [\n \"766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a\",\n \"744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996\"\n ],\n [\n \"59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e\",\n \"c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e\"\n ],\n [\n \"f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8\",\n \"e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d\"\n ],\n [\n \"7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c\",\n \"30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2\"\n ],\n [\n \"948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519\",\n \"e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e\"\n ],\n [\n \"7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab\",\n \"100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437\"\n ],\n [\n \"3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca\",\n \"ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311\"\n ],\n [\n \"d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf\",\n \"8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4\"\n ],\n [\n \"1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610\",\n \"68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575\"\n ],\n [\n \"733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4\",\n \"f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d\"\n ],\n [\n \"15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c\",\n \"d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d\"\n ],\n [\n \"a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940\",\n \"edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629\"\n ],\n [\n \"e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980\",\n \"a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06\"\n ],\n [\n \"311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3\",\n \"66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374\"\n ],\n [\n \"34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf\",\n \"9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee\"\n ],\n [\n \"f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63\",\n \"4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1\"\n ],\n [\n \"d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448\",\n \"fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b\"\n ],\n [\n \"32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf\",\n \"5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661\"\n ],\n [\n \"7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5\",\n \"8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6\"\n ],\n [\n \"ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6\",\n \"8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e\"\n ],\n [\n \"16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5\",\n \"5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d\"\n ],\n [\n \"eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99\",\n \"f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc\"\n ],\n [\n \"78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51\",\n \"f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4\"\n ],\n [\n \"494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5\",\n \"42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c\"\n ],\n [\n \"a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5\",\n \"204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b\"\n ],\n [\n \"c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997\",\n \"4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913\"\n ],\n [\n \"841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881\",\n \"73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154\"\n ],\n [\n \"5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5\",\n \"39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865\"\n ],\n [\n \"36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66\",\n \"d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc\"\n ],\n [\n \"336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726\",\n \"ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224\"\n ],\n [\n \"8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede\",\n \"6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e\"\n ],\n [\n \"1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94\",\n \"60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6\"\n ],\n [\n \"85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31\",\n \"3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511\"\n ],\n [\n \"29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51\",\n \"b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b\"\n ],\n [\n \"a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252\",\n \"ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2\"\n ],\n [\n \"4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5\",\n \"cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c\"\n ],\n [\n \"d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b\",\n \"6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3\"\n ],\n [\n \"ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4\",\n \"322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d\"\n ],\n [\n \"af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f\",\n \"6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700\"\n ],\n [\n \"e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889\",\n \"2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4\"\n ],\n [\n \"591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246\",\n \"b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196\"\n ],\n [\n \"11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984\",\n \"998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4\"\n ],\n [\n \"3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a\",\n \"b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257\"\n ],\n [\n \"cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030\",\n \"bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13\"\n ],\n [\n \"c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197\",\n \"6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096\"\n ],\n [\n \"c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593\",\n \"c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38\"\n ],\n [\n \"a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef\",\n \"21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f\"\n ],\n [\n \"347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38\",\n \"60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448\"\n ],\n [\n \"da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a\",\n \"49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a\"\n ],\n [\n \"c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111\",\n \"5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4\"\n ],\n [\n \"4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502\",\n \"7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437\"\n ],\n [\n \"3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea\",\n \"be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7\"\n ],\n [\n \"cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26\",\n \"8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d\"\n ],\n [\n \"b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986\",\n \"39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a\"\n ],\n [\n \"d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e\",\n \"62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54\"\n ],\n [\n \"48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4\",\n \"25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77\"\n ],\n [\n \"dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda\",\n \"ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517\"\n ],\n [\n \"6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859\",\n \"cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10\"\n ],\n [\n \"e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f\",\n \"f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125\"\n ],\n [\n \"eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c\",\n \"6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e\"\n ],\n [\n \"13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942\",\n \"fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1\"\n ],\n [\n \"ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a\",\n \"1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2\"\n ],\n [\n \"b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80\",\n \"5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423\"\n ],\n [\n \"ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d\",\n \"438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8\"\n ],\n [\n \"8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1\",\n \"cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758\"\n ],\n [\n \"52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63\",\n \"c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375\"\n ],\n [\n \"e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352\",\n \"6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d\"\n ],\n [\n \"7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193\",\n \"ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec\"\n ],\n [\n \"5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00\",\n \"9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0\"\n ],\n [\n \"32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58\",\n \"ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c\"\n ],\n [\n \"e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7\",\n \"d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4\"\n ],\n [\n \"8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8\",\n \"c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f\"\n ],\n [\n \"4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e\",\n \"67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649\"\n ],\n [\n \"3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d\",\n \"cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826\"\n ],\n [\n \"674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b\",\n \"299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5\"\n ],\n [\n \"d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f\",\n \"f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87\"\n ],\n [\n \"30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6\",\n \"462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b\"\n ],\n [\n \"be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297\",\n \"62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc\"\n ],\n [\n \"93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a\",\n \"7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c\"\n ],\n [\n \"b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c\",\n \"ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f\"\n ],\n [\n \"d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52\",\n \"4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a\"\n ],\n [\n \"d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb\",\n \"bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46\"\n ],\n [\n \"463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065\",\n \"bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f\"\n ],\n [\n \"7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917\",\n \"603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03\"\n ],\n [\n \"74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9\",\n \"cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08\"\n ],\n [\n \"30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3\",\n \"553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8\"\n ],\n [\n \"9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57\",\n \"712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373\"\n ],\n [\n \"176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66\",\n \"ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3\"\n ],\n [\n \"75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8\",\n \"9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8\"\n ],\n [\n \"809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721\",\n \"9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1\"\n ],\n [\n \"1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180\",\n \"4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9\"\n ]\n ]\n }\n };\n }\n}), require_curves = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curves.js\"(exports) {\n var curves = exports, hash = require_hash2(), curve = require_curve(), utils = require_utils3(), assert = utils.assert;\n function PresetCurve(options) {\n options.type === \"short\" \? this.curve = new curve.short(options) : options.type === \"edwards\" \? this.curve = new curve.edwards(options) : this.curve = new curve.mont(options), this.g = this.curve.g, this.n = this.curve.n, this.hash = options.hash, assert(this.g.validate(), \"Invalid curve\"), assert(this.g.mul(this.n).isInfinity(), \"Invalid curve, G*N != O\");\n }\n PresetCurve.prototype = {}, curves.PresetCurve = PresetCurve;\n function defineCurve(name, options) {\n Object.defineProperty(curves, name, {\n configurable: !0,\n enumerable: !0,\n get: function() {\n var curve2 = new PresetCurve(options);\n return Object.defineProperty(curves, name, {\n configurable: !0,\n enumerable: !0,\n value: curve2\n }), curve2;\n }\n });\n }\n defineCurve(\"p192\", {\n type: \"short\",\n prime: \"p192\",\n p: \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\",\n a: \"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc\",\n b: \"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1\",\n n: \"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012\",\n \"07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811\"\n ]\n }), defineCurve(\"p224\", {\n type: \"short\",\n prime: \"p224\",\n p: \"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\",\n a: \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe\",\n b: \"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4\",\n n: \"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21\",\n \"bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34\"\n ]\n }), defineCurve(\"p256\", {\n type: \"short\",\n prime: null,\n p: \"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff\",\n a: \"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc\",\n b: \"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b\",\n n: \"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296\",\n \"4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5\"\n ]\n }), defineCurve(\"p384\", {\n type: \"short\",\n prime: null,\n p: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff\",\n a: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc\",\n b: \"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef\",\n n: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973\",\n hash: hash.sha384,\n gRed: !1,\n g: [\n \"aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7\",\n \"3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f\"\n ]\n }), defineCurve(\"p521\", {\n type: \"short\",\n prime: null,\n p: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff\",\n a: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc\",\n b: \"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00\",\n n: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409\",\n hash: hash.sha512,\n gRed: !1,\n g: [\n \"000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66\",\n \"00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650\"\n ]\n }), defineCurve(\"curve25519\", {\n type: \"mont\",\n prime: \"p25519\",\n p: \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",\n a: \"76d06\",\n b: \"1\",\n n: \"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",\n hash: hash.sha256,\n gRed: !1,\n g: [\"9\"]\n }), defineCurve(\"ed25519\", {\n type: \"edwards\",\n prime: \"p25519\",\n p: \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",\n a: \"-1\",\n c: \"1\",\n d: \"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3\",\n n: \"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a\",\n \"6666666666666666666666666666666666666666666666666666666666666658\"\n ]\n });\n var pre;\n try {\n pre = require_secp256k1();\n } catch {\n pre = void 0;\n }\n defineCurve(\"secp256k1\", {\n type: \"short\",\n prime: \"k256\",\n p: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\",\n a: \"0\",\n b: \"7\",\n n: \"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141\",\n h: \"1\",\n hash: hash.sha256,\n beta: \"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\",\n lambda: \"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72\",\n basis: [\n {\n a: \"3086d221a7d46bcde86c90e49284eb15\",\n b: \"-e4437ed6010e88286f547fa90abfe4c3\"\n },\n {\n a: \"114ca50f7a8e2f3f657c1108d9d44cfd8\",\n b: \"3086d221a7d46bcde86c90e49284eb15\"\n }\n ],\n gRed: !1,\n g: [\n \"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\",\n \"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n pre\n ]\n });\n }\n}), require_hmac_drbg = __commonJS({\n \"node_modules/hmac-drbg/lib/hmac-drbg.js\"(exports, module) {\n var hash = require_hash2(), utils = require_utils2(), assert = require_minimalistic_assert();\n function HmacDRBG(options) {\n if (!(this instanceof HmacDRBG))\n return new HmacDRBG(options);\n this.hash = options.hash, this.predResist = !!options.predResist, this.outLen = this.hash.outSize, this.minEntropy = options.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null;\n var entropy = utils.toArray(options.entropy, options.entropyEnc || \"hex\"), nonce = utils.toArray(options.nonce, options.nonceEnc || \"hex\"), pers = utils.toArray(options.pers, options.persEnc || \"hex\");\n assert(entropy.length >= this.minEntropy / 8, \"Not enough entropy. Minimum is: \" + this.minEntropy + \" bits\"), this._init(entropy, nonce, pers);\n }\n HmacDRBG.prototype = {}, module.exports = HmacDRBG, HmacDRBG.prototype._init = function(entropy, nonce, pers) {\n var seed = entropy.concat(nonce).concat(pers);\n this.K = new Array(this.outLen / 8), this.V = new Array(this.outLen / 8);\n for (var i = 0;i < this.V.length; i++)\n this.K[i] = 0, this.V[i] = 1;\n this._update(seed), this._reseed = 1, this.reseedInterval = 281474976710656;\n }, HmacDRBG.prototype._hmac = function() {\n return new hash.hmac(this.hash, this.K);\n }, HmacDRBG.prototype._update = function(seed) {\n var kmac = this._hmac().update(this.V).update([0]);\n seed && (kmac = kmac.update(seed)), this.K = kmac.digest(), this.V = this._hmac().update(this.V).digest(), seed && (this.K = this._hmac().update(this.V).update([1]).update(seed).digest(), this.V = this._hmac().update(this.V).digest());\n }, HmacDRBG.prototype.reseed = function(entropy, entropyEnc, add, addEnc) {\n typeof entropyEnc != \"string\" && (addEnc = add, add = entropyEnc, entropyEnc = null), entropy = utils.toArray(entropy, entropyEnc), add = utils.toArray(add, addEnc), assert(entropy.length >= this.minEntropy / 8, \"Not enough entropy. Minimum is: \" + this.minEntropy + \" bits\"), this._update(entropy.concat(add || [])), this._reseed = 1;\n }, HmacDRBG.prototype.generate = function(len, enc, add, addEnc) {\n if (this._reseed > this.reseedInterval)\n throw new Error(\"Reseed is required\");\n typeof enc != \"string\" && (addEnc = add, add = enc, enc = null), add && (add = utils.toArray(add, addEnc || \"hex\"), this._update(add));\n for (var temp = [];temp.length < len; )\n this.V = this._hmac().update(this.V).digest(), temp = temp.concat(this.V);\n var res = temp.slice(0, len);\n return this._update(add), this._reseed++, utils.encode(res, enc);\n };\n }\n}), require_key = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/key.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert;\n function KeyPair(ec, options) {\n this.ec = ec, this.priv = null, this.pub = null, options.priv && this._importPrivate(options.priv, options.privEnc), options.pub && this._importPublic(options.pub, options.pubEnc);\n }\n KeyPair.prototype = {}, module.exports = KeyPair, KeyPair.fromPublic = function(ec, pub, enc) {\n return pub instanceof KeyPair \? pub : new KeyPair(ec, {\n pub,\n pubEnc: enc\n });\n }, KeyPair.fromPrivate = function(ec, priv, enc) {\n return priv instanceof KeyPair \? priv : new KeyPair(ec, {\n priv,\n privEnc: enc\n });\n }, KeyPair.prototype.validate = function() {\n var pub = this.getPublic();\n return pub.isInfinity() \? { result: !1, reason: \"Invalid public key\" } : pub.validate() \? pub.mul(this.ec.curve.n).isInfinity() \? { result: !0, reason: null } : { result: !1, reason: \"Public key * N != O\" } : { result: !1, reason: \"Public key is not a point\" };\n }, KeyPair.prototype.getPublic = function(compact, enc) {\n return typeof compact == \"string\" && (enc = compact, compact = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), enc \? this.pub.encode(enc, compact) : this.pub;\n }, KeyPair.prototype.getPrivate = function(enc) {\n return enc === \"hex\" \? this.priv.toString(16, 2) : this.priv;\n }, KeyPair.prototype._importPrivate = function(key, enc) {\n this.priv = new BN(key, enc || 16), this.priv = this.priv.umod(this.ec.curve.n);\n }, KeyPair.prototype._importPublic = function(key, enc) {\n if (key.x || key.y) {\n this.ec.curve.type === \"mont\" \? assert(key.x, \"Need x coordinate\") : (this.ec.curve.type === \"short\" || this.ec.curve.type === \"edwards\") && assert(key.x && key.y, \"Need both x and y coordinate\"), this.pub = this.ec.curve.point(key.x, key.y);\n return;\n }\n this.pub = this.ec.curve.decodePoint(key, enc);\n }, KeyPair.prototype.derive = function(pub) {\n return pub.validate() || assert(pub.validate(), \"public point not validated\"), pub.mul(this.priv).getX();\n }, KeyPair.prototype.sign = function(msg, enc, options) {\n return this.ec.sign(msg, this, enc, options);\n }, KeyPair.prototype.verify = function(msg, signature) {\n return this.ec.verify(msg, signature, this);\n }, KeyPair.prototype.inspect = function() {\n return \"<Key priv: \" + (this.priv && this.priv.toString(16, 2)) + \" pub: \" + (this.pub && this.pub.inspect()) + \" >\";\n };\n }\n}), require_signature = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/signature.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert;\n function Signature(options, enc) {\n if (options instanceof Signature)\n return options;\n this._importDER(options, enc) || (assert(options.r && options.s, \"Signature without r or s\"), this.r = new BN(options.r, 16), this.s = new BN(options.s, 16), options.recoveryParam === void 0 \? this.recoveryParam = null : this.recoveryParam = options.recoveryParam);\n }\n Signature.prototype = {}, module.exports = Signature;\n function Position() {\n this.place = 0;\n }\n function getLength(buf, p) {\n var initial = buf[p.place++];\n if (!(initial & 128))\n return initial;\n var octetLen = initial & 15;\n if (octetLen === 0 || octetLen > 4)\n return !1;\n for (var val = 0, i = 0, off = p.place;i < octetLen; i++, off++)\n val <<= 8, val |= buf[off], val >>>= 0;\n return val <= 127 \? !1 : (p.place = off, val);\n }\n function rmPadding(buf) {\n for (var i = 0, len = buf.length - 1;!buf[i] && !(buf[i + 1] & 128) && i < len; )\n i++;\n return i === 0 \? buf : buf.slice(i);\n }\n Signature.prototype._importDER = function(data, enc) {\n data = utils.toArray(data, enc);\n var p = new Position;\n if (data[p.place++] !== 48)\n return !1;\n var len = getLength(data, p);\n if (len === !1 || len + p.place !== data.length || data[p.place++] !== 2)\n return !1;\n var rlen = getLength(data, p);\n if (rlen === !1)\n return !1;\n var r = data.slice(p.place, rlen + p.place);\n if (p.place += rlen, data[p.place++] !== 2)\n return !1;\n var slen = getLength(data, p);\n if (slen === !1 || data.length !== slen + p.place)\n return !1;\n var s = data.slice(p.place, slen + p.place);\n if (r[0] === 0)\n if (r[1] & 128)\n r = r.slice(1);\n else\n return !1;\n if (s[0] === 0)\n if (s[1] & 128)\n s = s.slice(1);\n else\n return !1;\n return this.r = new BN(r), this.s = new BN(s), this.recoveryParam = null, !0;\n };\n function constructLength(arr, len) {\n if (len < 128) {\n arr.push(len);\n return;\n }\n var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n for (arr.push(octets | 128);--octets; )\n arr.push(len >>> (octets << 3) & 255);\n arr.push(len);\n }\n Signature.prototype.toDER = function(enc) {\n var r = this.r.toArray(), s = this.s.toArray();\n for (r[0] & 128 && (r = [0].concat(r)), s[0] & 128 && (s = [0].concat(s)), r = rmPadding(r), s = rmPadding(s);!s[0] && !(s[1] & 128); )\n s = s.slice(1);\n var arr = [2];\n constructLength(arr, r.length), arr = arr.concat(r), arr.push(2), constructLength(arr, s.length);\n var backHalf = arr.concat(s), res = [48];\n return constructLength(res, backHalf.length), res = res.concat(backHalf), utils.encode(res, enc);\n };\n }\n}), require_ec = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/index.js\"(exports, module) {\n var BN = require_bn4(), HmacDRBG = require_hmac_drbg(), utils = require_utils3(), curves = require_curves(), rand = require_brorand(), assert = utils.assert, KeyPair = require_key(), Signature = require_signature();\n function EC(options) {\n if (!(this instanceof EC))\n return new EC(options);\n typeof options == \"string\" && (assert(Object.prototype.hasOwnProperty.call(curves, options), \"Unknown curve \" + options), options = curves[options]), options instanceof curves.PresetCurve && (options = { curve: options }), this.curve = options.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = options.curve.g, this.g.precompute(options.curve.n.bitLength() + 1), this.hash = options.hash || options.curve.hash;\n }\n EC.prototype = {}, module.exports = EC, EC.prototype.keyPair = function(options) {\n return new KeyPair(this, options);\n }, EC.prototype.keyFromPrivate = function(priv, enc) {\n return KeyPair.fromPrivate(this, priv, enc);\n }, EC.prototype.keyFromPublic = function(pub, enc) {\n return KeyPair.fromPublic(this, pub, enc);\n }, EC.prototype.genKeyPair = function(options) {\n options || (options = {});\n for (var drbg = new HmacDRBG({\n hash: this.hash,\n pers: options.pers,\n persEnc: options.persEnc || \"utf8\",\n entropy: options.entropy || rand(this.hash.hmacStrength),\n entropyEnc: options.entropy && options.entropyEnc || \"utf8\",\n nonce: this.n.toArray()\n }), bytes = this.n.byteLength(), ns2 = this.n.sub(new BN(2));; ) {\n var priv = new BN(drbg.generate(bytes));\n if (!(priv.cmp(ns2) > 0))\n return priv.iaddn(1), this.keyFromPrivate(priv);\n }\n }, EC.prototype._truncateToN = function(msg, truncOnly) {\n var delta = msg.byteLength() * 8 - this.n.bitLength();\n return delta > 0 && (msg = msg.ushrn(delta)), !truncOnly && msg.cmp(this.n) >= 0 \? msg.sub(this.n) : msg;\n }, EC.prototype.sign = function(msg, key, enc, options) {\n typeof enc == \"object\" && (options = enc, enc = null), options || (options = {}), key = this.keyFromPrivate(key, enc), msg = this._truncateToN(new BN(msg, 16));\n for (var bytes = this.n.byteLength(), bkey = key.getPrivate().toArray(\"be\", bytes), nonce = msg.toArray(\"be\", bytes), drbg = new HmacDRBG({\n hash: this.hash,\n entropy: bkey,\n nonce,\n pers: options.pers,\n persEnc: options.persEnc || \"utf8\"\n }), ns1 = this.n.sub(new BN(1)), iter = 0;; iter++) {\n var k = options.k \? options.k(iter) : new BN(drbg.generate(this.n.byteLength()));\n if (k = this._truncateToN(k, !0), !(k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)) {\n var kp = this.g.mul(k);\n if (!kp.isInfinity()) {\n var kpX = kp.getX(), r = kpX.umod(this.n);\n if (r.cmpn(0) !== 0) {\n var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));\n if (s = s.umod(this.n), s.cmpn(0) !== 0) {\n var recoveryParam = (kp.getY().isOdd() \? 1 : 0) | (kpX.cmp(r) !== 0 \? 2 : 0);\n return options.canonical && s.cmp(this.nh) > 0 && (s = this.n.sub(s), recoveryParam ^= 1), new Signature({ r, s, recoveryParam });\n }\n }\n }\n }\n }\n }, EC.prototype.verify = function(msg, signature, key, enc) {\n msg = this._truncateToN(new BN(msg, 16)), key = this.keyFromPublic(key, enc), signature = new Signature(signature, \"hex\");\n var { r, s } = signature;\n if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0 || s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n return !1;\n var sinv = s.invm(this.n), u1 = sinv.mul(msg).umod(this.n), u2 = sinv.mul(r).umod(this.n), p;\n return this.curve._maxwellTrick \? (p = this.g.jmulAdd(u1, key.getPublic(), u2), p.isInfinity() \? !1 : p.eqXToP(r)) : (p = this.g.mulAdd(u1, key.getPublic(), u2), p.isInfinity() \? !1 : p.getX().umod(this.n).cmp(r) === 0);\n }, EC.prototype.recoverPubKey = function(msg, signature, j, enc) {\n assert((3 & j) === j, \"The recovery param is more than two bits\"), signature = new Signature(signature, enc);\n var n = this.n, e = new BN(msg), r = signature.r, s = signature.s, isYOdd = j & 1, isSecondKey = j >> 1;\n if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n throw new Error(\"Unable to find sencond key candinate\");\n isSecondKey \? r = this.curve.pointFromX(r.add(this.curve.n), isYOdd) : r = this.curve.pointFromX(r, isYOdd);\n var rInv = signature.r.invm(n), s1 = n.sub(e).mul(rInv).umod(n), s2 = s.mul(rInv).umod(n);\n return this.g.mulAdd(s1, r, s2);\n }, EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {\n if (signature = new Signature(signature, enc), signature.recoveryParam !== null)\n return signature.recoveryParam;\n for (var i = 0;i < 4; i++) {\n var Qprime;\n try {\n Qprime = this.recoverPubKey(e, signature, i);\n } catch {\n continue;\n }\n if (Qprime.eq(Q))\n return i;\n }\n throw new Error(\"Unable to find valid recovery factor\");\n };\n }\n}), require_key2 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/key.js\"(exports, module) {\n var utils = require_utils3(), assert = utils.assert, parseBytes = utils.parseBytes, cachedProperty = utils.cachedProperty;\n function KeyPair(eddsa, params) {\n this.eddsa = eddsa, this._secret = parseBytes(params.secret), eddsa.isPoint(params.pub) \? this._pub = params.pub : this._pubBytes = parseBytes(params.pub);\n }\n KeyPair.prototype = {}, KeyPair.fromPublic = function(eddsa, pub) {\n return pub instanceof KeyPair \? pub : new KeyPair(eddsa, { pub });\n }, KeyPair.fromSecret = function(eddsa, secret) {\n return secret instanceof KeyPair \? secret : new KeyPair(eddsa, { secret });\n }, KeyPair.prototype.secret = function() {\n return this._secret;\n }, cachedProperty(KeyPair, \"pubBytes\", function() {\n return this.eddsa.encodePoint(this.pub());\n }), cachedProperty(KeyPair, \"pub\", function() {\n return this._pubBytes \? this.eddsa.decodePoint(this._pubBytes) : this.eddsa.g.mul(this.priv());\n }), cachedProperty(KeyPair, \"privBytes\", function() {\n var eddsa = this.eddsa, hash = this.hash(), lastIx = eddsa.encodingLength - 1, a = hash.slice(0, eddsa.encodingLength);\n return a[0] &= 248, a[lastIx] &= 127, a[lastIx] |= 64, a;\n }), cachedProperty(KeyPair, \"priv\", function() {\n return this.eddsa.decodeInt(this.privBytes());\n }), cachedProperty(KeyPair, \"hash\", function() {\n return this.eddsa.hash().update(this.secret()).digest();\n }), cachedProperty(KeyPair, \"messagePrefix\", function() {\n return this.hash().slice(this.eddsa.encodingLength);\n }), KeyPair.prototype.sign = function(message) {\n return assert(this._secret, \"KeyPair can only verify\"), this.eddsa.sign(message, this);\n }, KeyPair.prototype.verify = function(message, sig) {\n return this.eddsa.verify(message, sig, this);\n }, KeyPair.prototype.getSecret = function(enc) {\n return assert(this._secret, \"KeyPair is public only\"), utils.encode(this.secret(), enc);\n }, KeyPair.prototype.getPublic = function(enc) {\n return utils.encode(this.pubBytes(), enc);\n }, module.exports = KeyPair;\n }\n}), require_signature2 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/signature.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert, cachedProperty = utils.cachedProperty, parseBytes = utils.parseBytes;\n function Signature(eddsa, sig) {\n this.eddsa = eddsa, typeof sig != \"object\" && (sig = parseBytes(sig)), Array.isArray(sig) && (sig = {\n R: sig.slice(0, eddsa.encodingLength),\n S: sig.slice(eddsa.encodingLength)\n }), assert(sig.R && sig.S, \"Signature without R or S\"), eddsa.isPoint(sig.R) && (this._R = sig.R), sig.S instanceof BN && (this._S = sig.S), this._Rencoded = Array.isArray(sig.R) \? sig.R : sig.Rencoded, this._Sencoded = Array.isArray(sig.S) \? sig.S : sig.Sencoded;\n }\n Signature.prototype = {}, cachedProperty(Signature, \"S\", function() {\n return this.eddsa.decodeInt(this.Sencoded());\n }), cachedProperty(Signature, \"R\", function() {\n return this.eddsa.decodePoint(this.Rencoded());\n }), cachedProperty(Signature, \"Rencoded\", function() {\n return this.eddsa.encodePoint(this.R());\n }), cachedProperty(Signature, \"Sencoded\", function() {\n return this.eddsa.encodeInt(this.S());\n }), Signature.prototype.toBytes = function() {\n return this.Rencoded().concat(this.Sencoded());\n }, Signature.prototype.toHex = function() {\n return utils.encode(this.toBytes(), \"hex\").toUpperCase();\n }, module.exports = Signature;\n }\n}), require_eddsa = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/index.js\"(exports, module) {\n var hash = require_hash2(), curves = require_curves(), utils = require_utils3(), assert = utils.assert, parseBytes = utils.parseBytes, KeyPair = require_key2(), Signature = require_signature2();\n function EDDSA(curve) {\n if (assert(curve === \"ed25519\", \"only tested with ed25519 so far\"), !(this instanceof EDDSA))\n return new EDDSA(curve);\n curve = curves[curve].curve, this.curve = curve, this.g = curve.g, this.g.precompute(curve.n.bitLength() + 1), this.pointClass = curve.point().constructor, this.encodingLength = Math.ceil(curve.n.bitLength() / 8), this.hash = hash.sha512;\n }\n EDDSA.prototype = {}, module.exports = EDDSA, EDDSA.prototype.sign = function(message, secret) {\n message = parseBytes(message);\n var key = this.keyFromSecret(secret), r = this.hashInt(key.messagePrefix(), message), R = this.g.mul(r), Rencoded = this.encodePoint(R), s_ = this.hashInt(Rencoded, key.pubBytes(), message).mul(key.priv()), S = r.add(s_).umod(this.curve.n);\n return this.makeSignature({ R, S, Rencoded });\n }, EDDSA.prototype.verify = function(message, sig, pub) {\n message = parseBytes(message), sig = this.makeSignature(sig);\n var key = this.keyFromPublic(pub), h = this.hashInt(sig.Rencoded(), key.pubBytes(), message), SG = this.g.mul(sig.S()), RplusAh = sig.R().add(key.pub().mul(h));\n return RplusAh.eq(SG);\n }, EDDSA.prototype.hashInt = function() {\n for (var hash2 = this.hash(), i = 0;i < arguments.length; i++)\n hash2.update(arguments[i]);\n return utils.intFromLE(hash2.digest()).umod(this.curve.n);\n }, EDDSA.prototype.keyFromPublic = function(pub) {\n return KeyPair.fromPublic(this, pub);\n }, EDDSA.prototype.keyFromSecret = function(secret) {\n return KeyPair.fromSecret(this, secret);\n }, EDDSA.prototype.makeSignature = function(sig) {\n return sig instanceof Signature \? sig : new Signature(this, sig);\n }, EDDSA.prototype.encodePoint = function(point) {\n var enc = point.getY().toArray(\"le\", this.encodingLength);\n return enc[this.encodingLength - 1] |= point.getX().isOdd() \? 128 : 0, enc;\n }, EDDSA.prototype.decodePoint = function(bytes) {\n bytes = utils.parseBytes(bytes);\n var lastIx = bytes.length - 1, normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & -129), xIsOdd = (bytes[lastIx] & 128) !== 0, y = utils.intFromLE(normed);\n return this.curve.pointFromY(y, xIsOdd);\n }, EDDSA.prototype.encodeInt = function(num) {\n return num.toArray(\"le\", this.encodingLength);\n }, EDDSA.prototype.decodeInt = function(bytes) {\n return utils.intFromLE(bytes);\n }, EDDSA.prototype.isPoint = function(val) {\n return val instanceof this.pointClass;\n };\n }\n}), require_elliptic = __commonJS({\n \"node_modules/elliptic/lib/elliptic.js\"(exports) {\n var elliptic = exports;\n elliptic.version = require_package().version, elliptic.utils = require_utils3(), elliptic.rand = require_brorand(), elliptic.curve = require_curve(), elliptic.curves = require_curves(), elliptic.ec = require_ec(), elliptic.eddsa = require_eddsa();\n }\n}), require_bn5 = require_bn, require_safer = __commonJS({\n \"node_modules/safer-buffer/safer.js\"(exports, module) {\n var buffer = BufferModule, Buffer2 = Buffer, safer = {}, key;\n for (key in buffer)\n !buffer.hasOwnProperty(key) || key === \"SlowBuffer\" || key === \"Buffer\" || (safer[key] = buffer[key]);\n var Safer = safer.Buffer = {};\n for (key in Buffer2)\n !Buffer2.hasOwnProperty(key) || key === \"allocUnsafe\" || key === \"allocUnsafeSlow\" || (Safer[key] = Buffer2[key]);\n if (safer.Buffer.prototype = Buffer2.prototype, (!Safer.from || Safer.from === Uint8Array.from) && (Safer.from = function(value, encodingOrOffset, length) {\n if (typeof value == \"number\")\n @throwTypeError('The \"value\" argument must not be of type number. Received type ' + typeof value);\n if (value && typeof value.length > \"u\")\n @throwTypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \" + typeof value);\n return Buffer2(value, encodingOrOffset, length);\n }), Safer.alloc || (Safer.alloc = function(size, fill, encoding) {\n if (typeof size != \"number\")\n @throwTypeError('The \"size\" argument must be of type number. Received type ' + typeof size);\n if (size < 0 || size >= 2 * (1 << 30))\n @throwRangeError('The value \"' + size + '\" is invalid for option \"size\"');\n var buf = Buffer2(size);\n return !fill || fill.length === 0 \? buf.fill(0) : typeof encoding == \"string\" \? buf.fill(fill, encoding) : buf.fill(fill), buf;\n }), !safer.kStringMaxLength)\n try {\n safer.kStringMaxLength = MAX_STRING_LENGTH;\n } catch {\n }\n safer.constants || (safer.constants = {\n MAX_LENGTH: safer.kMaxLength\n }, safer.kStringMaxLength && (safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength)), module.exports = safer;\n }\n}), require_reporter = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/reporter.js\"(exports) {\n var inherits = require_inherits_browser();\n function Reporter(options) {\n this._reporterState = {\n obj: null,\n path: [],\n options: options || {},\n errors: []\n };\n }\n Reporter.prototype = {}, exports.Reporter = Reporter, Reporter.prototype.isError = function(obj) {\n return obj instanceof ReporterError;\n }, Reporter.prototype.save = function() {\n let state = this._reporterState;\n return { obj: state.obj, pathLen: state.path.length };\n }, Reporter.prototype.restore = function(data) {\n let state = this._reporterState;\n state.obj = data.obj, state.path = state.path.slice(0, data.pathLen);\n }, Reporter.prototype.enterKey = function(key) {\n return this._reporterState.path.push(key);\n }, Reporter.prototype.exitKey = function(index) {\n let state = this._reporterState;\n state.path = state.path.slice(0, index - 1);\n }, Reporter.prototype.leaveKey = function(index, key, value) {\n let state = this._reporterState;\n this.exitKey(index), state.obj !== null && (state.obj[key] = value);\n }, Reporter.prototype.path = function() {\n return this._reporterState.path.join(\"/\");\n }, Reporter.prototype.enterObject = function() {\n let state = this._reporterState, prev = state.obj;\n return state.obj = {}, prev;\n }, Reporter.prototype.leaveObject = function(prev) {\n let state = this._reporterState, now = state.obj;\n return state.obj = prev, now;\n }, Reporter.prototype.error = function(msg) {\n let err, state = this._reporterState, inherited = msg instanceof ReporterError;\n if (inherited \? err = msg : err = new ReporterError(state.path.map(function(elem) {\n return \"[\" + JSON.stringify(elem) + \"]\";\n }).join(\"\"), msg.message || msg, msg.stack), !state.options.partial)\n throw err;\n return inherited || state.errors.push(err), err;\n }, Reporter.prototype.wrapResult = function(result) {\n let state = this._reporterState;\n return state.options.partial \? {\n result: this.isError(result) \? null : result,\n errors: state.errors\n } : result;\n };\n function ReporterError(path, msg) {\n this.path = path, this.rethrow(msg);\n }\n inherits(ReporterError, Error), ReporterError.prototype.rethrow = function(msg) {\n if (this.message = msg + \" at: \" + (this.path || \"(shallow)\"), Error.captureStackTrace && Error.captureStackTrace(this, ReporterError), !this.stack)\n try {\n throw new Error(this.message);\n } catch (e) {\n this.stack = e.stack;\n }\n return this;\n };\n }\n}), require_buffer = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/buffer.js\"(exports) {\n var inherits = require_inherits_browser(), Reporter = require_reporter().Reporter, Buffer2 = require_safer().Buffer;\n function DecoderBuffer(base, options) {\n if (Reporter.call(this, options), !Buffer2.isBuffer(base)) {\n this.error(\"Input not Buffer\");\n return;\n }\n this.base = base, this.offset = 0, this.length = base.length;\n }\n inherits(DecoderBuffer, Reporter), exports.DecoderBuffer = DecoderBuffer, DecoderBuffer.isDecoderBuffer = function(data) {\n return data instanceof DecoderBuffer \? !0 : typeof data == \"object\" && Buffer2.isBuffer(data.base) && data.constructor.name === \"DecoderBuffer\" && typeof data.offset == \"number\" && typeof data.length == \"number\" && typeof data.save == \"function\" && typeof data.restore == \"function\" && typeof data.isEmpty == \"function\" && typeof data.readUInt8 == \"function\" && typeof data.skip == \"function\" && typeof data.raw == \"function\";\n }, DecoderBuffer.prototype.save = function() {\n return {\n offset: this.offset,\n reporter: Reporter.prototype.save.call(this)\n };\n }, DecoderBuffer.prototype.restore = function(save) {\n let res = new DecoderBuffer(this.base);\n return res.offset = save.offset, res.length = this.offset, this.offset = save.offset, Reporter.prototype.restore.call(this, save.reporter), res;\n }, DecoderBuffer.prototype.isEmpty = function() {\n return this.offset === this.length;\n }, DecoderBuffer.prototype.readUInt8 = function(fail) {\n return this.offset + 1 <= this.length \? this.base.readUInt8(this.offset++, !0) : this.error(fail || \"DecoderBuffer overrun\");\n }, DecoderBuffer.prototype.skip = function(bytes, fail) {\n if (!(this.offset + bytes <= this.length))\n return this.error(fail || \"DecoderBuffer overrun\");\n let res = new DecoderBuffer(this.base);\n return res._reporterState = this._reporterState, res.offset = this.offset, res.length = this.offset + bytes, this.offset += bytes, res;\n }, DecoderBuffer.prototype.raw = function(save) {\n return this.base.slice(save \? save.offset : this.offset, this.length);\n };\n function EncoderBuffer(value, reporter) {\n if (Array.isArray(value))\n this.length = 0, this.value = value.map(function(item) {\n return EncoderBuffer.isEncoderBuffer(item) || (item = new EncoderBuffer(item, reporter)), this.length += item.length, item;\n }, this);\n else if (typeof value == \"number\") {\n if (!(0 <= value && value <= 255))\n return reporter.error(\"non-byte EncoderBuffer value\");\n this.value = value, this.length = 1;\n } else if (typeof value == \"string\")\n this.value = value, this.length = Buffer2.byteLength(value);\n else if (Buffer2.isBuffer(value))\n this.value = value, this.length = value.length;\n else\n return reporter.error(\"Unsupported type: \" + typeof value);\n }\n EncoderBuffer.prototype = {}, exports.EncoderBuffer = EncoderBuffer, EncoderBuffer.isEncoderBuffer = function(data) {\n return data instanceof EncoderBuffer \? !0 : typeof data == \"object\" && data.constructor.name === \"EncoderBuffer\" && typeof data.length == \"number\" && typeof data.join == \"function\";\n }, EncoderBuffer.prototype.join = function(out, offset) {\n return out || (out = Buffer2.alloc(this.length)), offset || (offset = 0), this.length === 0 || (Array.isArray(this.value) \? this.value.forEach(function(item) {\n item.join(out, offset), offset += item.length;\n }) : (typeof this.value == \"number\" \? out[offset] = this.value : typeof this.value == \"string\" \? out.write(this.value, offset) : Buffer2.isBuffer(this.value) && this.value.copy(out, offset), offset += this.length)), out;\n };\n }\n}), require_node = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/node.js\"(exports, module) {\n var Reporter = require_reporter().Reporter, EncoderBuffer = require_buffer().EncoderBuffer, DecoderBuffer = require_buffer().DecoderBuffer, assert = require_minimalistic_assert(), tags = [\n \"seq\",\n \"seqof\",\n \"set\",\n \"setof\",\n \"objid\",\n \"bool\",\n \"gentime\",\n \"utctime\",\n \"null_\",\n \"enum\",\n \"int\",\n \"objDesc\",\n \"bitstr\",\n \"bmpstr\",\n \"charstr\",\n \"genstr\",\n \"graphstr\",\n \"ia5str\",\n \"iso646str\",\n \"numstr\",\n \"octstr\",\n \"printstr\",\n \"t61str\",\n \"unistr\",\n \"utf8str\",\n \"videostr\"\n ], methods = [\"key\", \"obj\", \"use\", \"optional\", \"explicit\", \"implicit\", \"def\", \"choice\", \"any\", \"contains\"].concat(tags), overrided = [\n \"_peekTag\",\n \"_decodeTag\",\n \"_use\",\n \"_decodeStr\",\n \"_decodeObjid\",\n \"_decodeTime\",\n \"_decodeNull\",\n \"_decodeInt\",\n \"_decodeBool\",\n \"_decodeList\",\n \"_encodeComposite\",\n \"_encodeStr\",\n \"_encodeObjid\",\n \"_encodeTime\",\n \"_encodeNull\",\n \"_encodeInt\",\n \"_encodeBool\"\n ];\n function Node(enc, parent, name) {\n let state = {};\n this._baseState = state, state.name = name, state.enc = enc, state.parent = parent || null, state.children = null, state.tag = null, state.args = null, state.reverseArgs = null, state.choice = null, state.optional = !1, state.any = !1, state.obj = !1, state.use = null, state.useDecoder = null, state.key = null, state.default = null, state.explicit = null, state.implicit = null, state.contains = null, state.parent || (state.children = [], this._wrap());\n }\n Node.prototype = {}, module.exports = Node;\n var stateProps = [\n \"enc\",\n \"parent\",\n \"children\",\n \"tag\",\n \"args\",\n \"reverseArgs\",\n \"choice\",\n \"optional\",\n \"any\",\n \"obj\",\n \"use\",\n \"alteredUse\",\n \"key\",\n \"default\",\n \"explicit\",\n \"implicit\",\n \"contains\"\n ];\n Node.prototype.clone = function() {\n let state = this._baseState, cstate = {};\n stateProps.forEach(function(prop) {\n cstate[prop] = state[prop];\n });\n let res = new this.constructor(cstate.parent);\n return res._baseState = cstate, res;\n }, Node.prototype._wrap = function() {\n let state = this._baseState;\n methods.forEach(function(method) {\n this[method] = function() {\n let clone = new this.constructor(this);\n return state.children.push(clone), clone[method].apply(clone, arguments);\n };\n }, this);\n }, Node.prototype._init = function(body) {\n let state = this._baseState;\n assert(state.parent === null), body.call(this), state.children = state.children.filter(function(child) {\n return child._baseState.parent === this;\n }, this), assert.equal(state.children.length, 1, \"Root node can have only one child\");\n }, Node.prototype._useArgs = function(args) {\n let state = this._baseState, children = args.filter(function(arg) {\n return arg instanceof this.constructor;\n }, this);\n args = args.filter(function(arg) {\n return !(arg instanceof this.constructor);\n }, this), children.length !== 0 && (assert(state.children === null), state.children = children, children.forEach(function(child) {\n child._baseState.parent = this;\n }, this)), args.length !== 0 && (assert(state.args === null), state.args = args, state.reverseArgs = args.map(function(arg) {\n if (typeof arg != \"object\" || arg.constructor !== Object)\n return arg;\n let res = {};\n return Object.keys(arg).forEach(function(key) {\n key == (key | 0) && (key |= 0);\n let value = arg[key];\n res[value] = key;\n }), res;\n }));\n }, overrided.forEach(function(method) {\n Node.prototype[method] = function() {\n let state = this._baseState;\n throw new Error(method + \" not implemented for encoding: \" + state.enc);\n };\n }), tags.forEach(function(tag) {\n Node.prototype[tag] = function() {\n let state = this._baseState, args = Array.prototype.slice.call(arguments);\n return assert(state.tag === null), state.tag = tag, this._useArgs(args), this;\n };\n }), Node.prototype.use = function(item) {\n assert(item);\n let state = this._baseState;\n return assert(state.use === null), state.use = item, this;\n }, Node.prototype.optional = function() {\n let state = this._baseState;\n return state.optional = !0, this;\n }, Node.prototype.def = function(val) {\n let state = this._baseState;\n return assert(state.default === null), state.default = val, state.optional = !0, this;\n }, Node.prototype.explicit = function(num) {\n let state = this._baseState;\n return assert(state.explicit === null && state.implicit === null), state.explicit = num, this;\n }, Node.prototype.implicit = function(num) {\n let state = this._baseState;\n return assert(state.explicit === null && state.implicit === null), state.implicit = num, this;\n }, Node.prototype.obj = function() {\n let state = this._baseState, args = Array.prototype.slice.call(arguments);\n return state.obj = !0, args.length !== 0 && this._useArgs(args), this;\n }, Node.prototype.key = function(newKey) {\n let state = this._baseState;\n return assert(state.key === null), state.key = newKey, this;\n }, Node.prototype.any = function() {\n let state = this._baseState;\n return state.any = !0, this;\n }, Node.prototype.choice = function(obj) {\n let state = this._baseState;\n return assert(state.choice === null), state.choice = obj, this._useArgs(Object.keys(obj).map(function(key) {\n return obj[key];\n })), this;\n }, Node.prototype.contains = function(item) {\n let state = this._baseState;\n return assert(state.use === null), state.contains = item, this;\n }, Node.prototype._decode = function(input, options) {\n let state = this._baseState;\n if (state.parent === null)\n return input.wrapResult(state.children[0]._decode(input, options));\n let result = state.default, present = !0, prevKey = null;\n if (state.key !== null && (prevKey = input.enterKey(state.key)), state.optional) {\n let tag = null;\n if (state.explicit !== null \? tag = state.explicit : state.implicit !== null \? tag = state.implicit : state.tag !== null && (tag = state.tag), tag === null && !state.any) {\n let save = input.save();\n try {\n state.choice === null \? this._decodeGeneric(state.tag, input, options) : this._decodeChoice(input, options), present = !0;\n } catch {\n present = !1;\n }\n input.restore(save);\n } else if (present = this._peekTag(input, tag, state.any), input.isError(present))\n return present;\n }\n let prevObj;\n if (state.obj && present && (prevObj = input.enterObject()), present) {\n if (state.explicit !== null) {\n let explicit = this._decodeTag(input, state.explicit);\n if (input.isError(explicit))\n return explicit;\n input = explicit;\n }\n let start = input.offset;\n if (state.use === null && state.choice === null) {\n let save;\n state.any && (save = input.save());\n let body = this._decodeTag(input, state.implicit !== null \? state.implicit : state.tag, state.any);\n if (input.isError(body))\n return body;\n state.any \? result = input.raw(save) : input = body;\n }\n if (options && options.track && state.tag !== null && options.track(input.path(), start, input.length, \"tagged\"), options && options.track && state.tag !== null && options.track(input.path(), input.offset, input.length, \"content\"), state.any || (state.choice === null \? result = this._decodeGeneric(state.tag, input, options) : result = this._decodeChoice(input, options)), input.isError(result))\n return result;\n if (!state.any && state.choice === null && state.children !== null && state.children.forEach(function(child) {\n child._decode(input, options);\n }), state.contains && (state.tag === \"octstr\" || state.tag === \"bitstr\")) {\n let data = new DecoderBuffer(result);\n result = this._getUse(state.contains, input._reporterState.obj)._decode(data, options);\n }\n }\n return state.obj && present && (result = input.leaveObject(prevObj)), state.key !== null && (result !== null || present === !0) \? input.leaveKey(prevKey, state.key, result) : prevKey !== null && input.exitKey(prevKey), result;\n }, Node.prototype._decodeGeneric = function(tag, input, options) {\n let state = this._baseState;\n return tag === \"seq\" || tag === \"set\" \? null : tag === \"seqof\" || tag === \"setof\" \? this._decodeList(input, tag, state.args[0], options) : /str$/.test(tag) \? this._decodeStr(input, tag, options) : tag === \"objid\" && state.args \? this._decodeObjid(input, state.args[0], state.args[1], options) : tag === \"objid\" \? this._decodeObjid(input, null, null, options) : tag === \"gentime\" || tag === \"utctime\" \? this._decodeTime(input, tag, options) : tag === \"null_\" \? this._decodeNull(input, options) : tag === \"bool\" \? this._decodeBool(input, options) : tag === \"objDesc\" \? this._decodeStr(input, tag, options) : tag === \"int\" || tag === \"enum\" \? this._decodeInt(input, state.args && state.args[0], options) : state.use !== null \? this._getUse(state.use, input._reporterState.obj)._decode(input, options) : input.error(\"unknown tag: \" + tag);\n }, Node.prototype._getUse = function(entity, obj) {\n let state = this._baseState;\n return state.useDecoder = this._use(entity, obj), assert(state.useDecoder._baseState.parent === null), state.useDecoder = state.useDecoder._baseState.children[0], state.implicit !== state.useDecoder._baseState.implicit && (state.useDecoder = state.useDecoder.clone(), state.useDecoder._baseState.implicit = state.implicit), state.useDecoder;\n }, Node.prototype._decodeChoice = function(input, options) {\n let state = this._baseState, result = null, match = !1;\n return Object.keys(state.choice).some(function(key) {\n let save = input.save(), node = state.choice[key];\n try {\n let value = node._decode(input, options);\n if (input.isError(value))\n return !1;\n result = { type: key, value }, match = !0;\n } catch {\n return input.restore(save), !1;\n }\n return !0;\n }, this), match \? result : input.error(\"Choice not matched\");\n }, Node.prototype._createEncoderBuffer = function(data) {\n return new EncoderBuffer(data, this.reporter);\n }, Node.prototype._encode = function(data, reporter, parent) {\n let state = this._baseState;\n if (state.default !== null && state.default === data)\n return;\n let result = this._encodeValue(data, reporter, parent);\n if (result !== void 0 && !this._skipDefault(result, reporter, parent))\n return result;\n }, Node.prototype._encodeValue = function(data, reporter, parent) {\n let state = this._baseState;\n if (state.parent === null)\n return state.children[0]._encode(data, reporter || new Reporter);\n let result = null;\n if (this.reporter = reporter, state.optional && data === void 0)\n if (state.default !== null)\n data = state.default;\n else\n return;\n let content = null, primitive = !1;\n if (state.any)\n result = this._createEncoderBuffer(data);\n else if (state.choice)\n result = this._encodeChoice(data, reporter);\n else if (state.contains)\n content = this._getUse(state.contains, parent)._encode(data, reporter), primitive = !0;\n else if (state.children)\n content = state.children.map(function(child) {\n if (child._baseState.tag === \"null_\")\n return child._encode(null, reporter, data);\n if (child._baseState.key === null)\n return reporter.error(\"Child should have a key\");\n let prevKey = reporter.enterKey(child._baseState.key);\n if (typeof data != \"object\")\n return reporter.error(\"Child expected, but input is not object\");\n let res = child._encode(data[child._baseState.key], reporter, data);\n return reporter.leaveKey(prevKey), res;\n }, this).filter(function(child) {\n return child;\n }), content = this._createEncoderBuffer(content);\n else if (state.tag === \"seqof\" || state.tag === \"setof\") {\n if (!(state.args && state.args.length === 1))\n return reporter.error(\"Too many args for : \" + state.tag);\n if (!Array.isArray(data))\n return reporter.error(\"seqof/setof, but data is not Array\");\n let child = this.clone();\n child._baseState.implicit = null, content = this._createEncoderBuffer(data.map(function(item) {\n let state2 = this._baseState;\n return this._getUse(state2.args[0], data)._encode(item, reporter);\n }, child));\n } else\n state.use !== null \? result = this._getUse(state.use, parent)._encode(data, reporter) : (content = this._encodePrimitive(state.tag, data), primitive = !0);\n if (!state.any && state.choice === null) {\n let tag = state.implicit !== null \? state.implicit : state.tag, cls = state.implicit === null \? \"universal\" : \"context\";\n tag === null \? state.use === null && reporter.error(\"Tag could be omitted only for .use()\") : state.use === null && (result = this._encodeComposite(tag, primitive, cls, content));\n }\n return state.explicit !== null && (result = this._encodeComposite(state.explicit, !1, \"context\", result)), result;\n }, Node.prototype._encodeChoice = function(data, reporter) {\n let state = this._baseState, node = state.choice[data.type];\n return node || assert(!1, data.type + \" not found in \" + JSON.stringify(Object.keys(state.choice))), node._encode(data.value, reporter);\n }, Node.prototype._encodePrimitive = function(tag, data) {\n let state = this._baseState;\n if (/str$/.test(tag))\n return this._encodeStr(data, tag);\n if (tag === \"objid\" && state.args)\n return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);\n if (tag === \"objid\")\n return this._encodeObjid(data, null, null);\n if (tag === \"gentime\" || tag === \"utctime\")\n return this._encodeTime(data, tag);\n if (tag === \"null_\")\n return this._encodeNull();\n if (tag === \"int\" || tag === \"enum\")\n return this._encodeInt(data, state.args && state.reverseArgs[0]);\n if (tag === \"bool\")\n return this._encodeBool(data);\n if (tag === \"objDesc\")\n return this._encodeStr(data, tag);\n throw new Error(\"Unsupported tag: \" + tag);\n }, Node.prototype._isNumstr = function(str) {\n return /^[0-9 ]*$/.test(str);\n }, Node.prototype._isPrintstr = function(str) {\n return /^[A-Za-z0-9 '()+,-./:=\?]*$/.test(str);\n };\n }\n}), require_der = __commonJS({\n \"node_modules/asn1.js/lib/asn1/constants/der.js\"(exports) {\n function reverse(map) {\n let res = {};\n return Object.keys(map).forEach(function(key) {\n (key | 0) == key && (key = key | 0);\n let value = map[key];\n res[value] = key;\n }), res;\n }\n exports.tagClass = {\n 0: \"universal\",\n 1: \"application\",\n 2: \"context\",\n 3: \"private\"\n }, exports.tagClassByName = reverse(exports.tagClass), exports.tag = {\n 0: \"end\",\n 1: \"bool\",\n 2: \"int\",\n 3: \"bitstr\",\n 4: \"octstr\",\n 5: \"null_\",\n 6: \"objid\",\n 7: \"objDesc\",\n 8: \"external\",\n 9: \"real\",\n 10: \"enum\",\n 11: \"embed\",\n 12: \"utf8str\",\n 13: \"relativeOid\",\n 16: \"seq\",\n 17: \"set\",\n 18: \"numstr\",\n 19: \"printstr\",\n 20: \"t61str\",\n 21: \"videostr\",\n 22: \"ia5str\",\n 23: \"utctime\",\n 24: \"gentime\",\n 25: \"graphstr\",\n 26: \"iso646str\",\n 27: \"genstr\",\n 28: \"unistr\",\n 29: \"charstr\",\n 30: \"bmpstr\"\n }, exports.tagByName = reverse(exports.tag);\n }\n}), require_der2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/der.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safer().Buffer, Node = require_node(), der = require_der();\n function DEREncoder(entity) {\n this.enc = \"der\", this.name = entity.name, this.entity = entity, this.tree = new DERNode, this.tree._init(entity.body);\n }\n DEREncoder.prototype = {}, module.exports = DEREncoder, DEREncoder.prototype.encode = function(data, reporter) {\n return this.tree._encode(data, reporter).join();\n };\n function DERNode(parent) {\n Node.call(this, \"der\", parent);\n }\n inherits(DERNode, Node), DERNode.prototype._encodeComposite = function(tag, primitive, cls, content) {\n let encodedTag = encodeTag(tag, primitive, cls, this.reporter);\n if (content.length < 128) {\n let header2 = Buffer2.alloc(2);\n return header2[0] = encodedTag, header2[1] = content.length, this._createEncoderBuffer([header2, content]);\n }\n let lenOctets = 1;\n for (let i = content.length;i >= 256; i >>= 8)\n lenOctets++;\n let header = Buffer2.alloc(2 + lenOctets);\n header[0] = encodedTag, header[1] = 128 | lenOctets;\n for (let i = 1 + lenOctets, j = content.length;j > 0; i--, j >>= 8)\n header[i] = j & 255;\n return this._createEncoderBuffer([header, content]);\n }, DERNode.prototype._encodeStr = function(str, tag) {\n if (tag === \"bitstr\")\n return this._createEncoderBuffer([str.unused | 0, str.data]);\n if (tag === \"bmpstr\") {\n let buf = Buffer2.alloc(str.length * 2);\n for (let i = 0;i < str.length; i++)\n buf.writeUInt16BE(str.charCodeAt(i), i * 2);\n return this._createEncoderBuffer(buf);\n } else\n return tag === \"numstr\" \? this._isNumstr(str) \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: numstr supports only digits and space\") : tag === \"printstr\" \? this._isPrintstr(str) \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark\") : /str$/.test(tag) \? this._createEncoderBuffer(str) : tag === \"objDesc\" \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: \" + tag + \" unsupported\");\n }, DERNode.prototype._encodeObjid = function(id, values, relative) {\n if (typeof id == \"string\") {\n if (!values)\n return this.reporter.error(\"string objid given, but no values map found\");\n if (!values.hasOwnProperty(id))\n return this.reporter.error(\"objid not found in values map\");\n id = values[id].split(/[\\s.]+/g);\n for (let i = 0;i < id.length; i++)\n id[i] |= 0;\n } else if (Array.isArray(id)) {\n id = id.slice();\n for (let i = 0;i < id.length; i++)\n id[i] |= 0;\n }\n if (!Array.isArray(id))\n return this.reporter.error(\"objid() should be either array or string, got: \" + JSON.stringify(id));\n if (!relative) {\n if (id[1] >= 40)\n return this.reporter.error(\"Second objid identifier OOB\");\n id.splice(0, 2, id[0] * 40 + id[1]);\n }\n let size = 0;\n for (let i = 0;i < id.length; i++) {\n let ident = id[i];\n for (size++;ident >= 128; ident >>= 7)\n size++;\n }\n let objid = Buffer2.alloc(size), offset = objid.length - 1;\n for (let i = id.length - 1;i >= 0; i--) {\n let ident = id[i];\n for (objid[offset--] = ident & 127;(ident >>= 7) > 0; )\n objid[offset--] = 128 | ident & 127;\n }\n return this._createEncoderBuffer(objid);\n };\n function two(num) {\n return num < 10 \? \"0\" + num : num;\n }\n DERNode.prototype._encodeTime = function(time, tag) {\n let str, date = new Date(time);\n return tag === \"gentime\" \? str = [\n two(date.getUTCFullYear()),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n \"Z\"\n ].join(\"\") : tag === \"utctime\" \? str = [\n two(date.getUTCFullYear() % 100),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n \"Z\"\n ].join(\"\") : this.reporter.error(\"Encoding \" + tag + \" time is not supported yet\"), this._encodeStr(str, \"octstr\");\n }, DERNode.prototype._encodeNull = function() {\n return this._createEncoderBuffer(\"\");\n }, DERNode.prototype._encodeInt = function(num, values) {\n if (typeof num == \"string\") {\n if (!values)\n return this.reporter.error(\"String int or enum given, but no values map\");\n if (!values.hasOwnProperty(num))\n return this.reporter.error(\"Values map doesn't contain: \" + JSON.stringify(num));\n num = values[num];\n }\n if (typeof num != \"number\" && !Buffer2.isBuffer(num)) {\n let numArray = num.toArray();\n !num.sign && numArray[0] & 128 && numArray.unshift(0), num = Buffer2.from(numArray);\n }\n if (Buffer2.isBuffer(num)) {\n let size2 = num.length;\n num.length === 0 && size2++;\n let out2 = Buffer2.alloc(size2);\n return num.copy(out2), num.length === 0 && (out2[0] = 0), this._createEncoderBuffer(out2);\n }\n if (num < 128)\n return this._createEncoderBuffer(num);\n if (num < 256)\n return this._createEncoderBuffer([0, num]);\n let size = 1;\n for (let i = num;i >= 256; i >>= 8)\n size++;\n let out = new Array(size);\n for (let i = out.length - 1;i >= 0; i--)\n out[i] = num & 255, num >>= 8;\n return out[0] & 128 && out.unshift(0), this._createEncoderBuffer(Buffer2.from(out));\n }, DERNode.prototype._encodeBool = function(value) {\n return this._createEncoderBuffer(value \? 255 : 0);\n }, DERNode.prototype._use = function(entity, obj) {\n return typeof entity == \"function\" && (entity = entity(obj)), entity._getEncoder(\"der\").tree;\n }, DERNode.prototype._skipDefault = function(dataBuffer, reporter, parent) {\n let state = this._baseState, i;\n if (state.default === null)\n return !1;\n let data = dataBuffer.join();\n if (state.defaultBuffer === void 0 && (state.defaultBuffer = this._encodeValue(state.default, reporter, parent).join()), data.length !== state.defaultBuffer.length)\n return !1;\n for (i = 0;i < data.length; i++)\n if (data[i] !== state.defaultBuffer[i])\n return !1;\n return !0;\n };\n function encodeTag(tag, primitive, cls, reporter) {\n let res;\n if (tag === \"seqof\" \? tag = \"seq\" : tag === \"setof\" && (tag = \"set\"), der.tagByName.hasOwnProperty(tag))\n res = der.tagByName[tag];\n else if (typeof tag == \"number\" && (tag | 0) === tag)\n res = tag;\n else\n return reporter.error(\"Unknown tag: \" + tag);\n return res >= 31 \? reporter.error(\"Multi-octet tag encoding unsupported\") : (primitive || (res |= 32), res |= der.tagClassByName[cls || \"universal\"] << 6, res);\n }\n }\n}), require_pem = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/pem.js\"(exports, module) {\n var inherits = require_inherits_browser(), DEREncoder = require_der2();\n function PEMEncoder(entity) {\n DEREncoder.call(this, entity), this.enc = \"pem\";\n }\n inherits(PEMEncoder, DEREncoder), module.exports = PEMEncoder, PEMEncoder.prototype.encode = function(data, options) {\n let p = DEREncoder.prototype.encode.call(this, data).toString(\"base64\"), out = [\"-----BEGIN \" + options.label + \"-----\"];\n for (let i = 0;i < p.length; i += 64)\n out.push(p.slice(i, i + 64));\n return out.push(\"-----END \" + options.label + \"-----\"), out.join(`\n`);\n };\n }\n}), require_encoders = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/index.js\"(exports) {\n var encoders = exports;\n encoders.der = require_der2(), encoders.pem = require_pem();\n }\n}), require_der3 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/der.js\"(exports, module) {\n var inherits = require_inherits_browser(), bignum = require_bn5(), DecoderBuffer = require_buffer().DecoderBuffer, Node = require_node(), der = require_der();\n function DERDecoder(entity) {\n this.enc = \"der\", this.name = entity.name, this.entity = entity, this.tree = new DERNode, this.tree._init(entity.body);\n }\n DERDecoder.prototype = {}, module.exports = DERDecoder, DERDecoder.prototype.decode = function(data, options) {\n return DecoderBuffer.isDecoderBuffer(data) || (data = new DecoderBuffer(data, options)), this.tree._decode(data, options);\n };\n function DERNode(parent) {\n Node.call(this, \"der\", parent);\n }\n inherits(DERNode, Node), DERNode.prototype._peekTag = function(buffer, tag, any) {\n if (buffer.isEmpty())\n return !1;\n let state = buffer.save(), decodedTag = derDecodeTag(buffer, 'Failed to peek tag: \"' + tag + '\"');\n return buffer.isError(decodedTag) \? decodedTag : (buffer.restore(state), decodedTag.tag === tag || decodedTag.tagStr === tag || decodedTag.tagStr + \"of\" === tag || any);\n }, DERNode.prototype._decodeTag = function(buffer, tag, any) {\n let decodedTag = derDecodeTag(buffer, 'Failed to decode tag of \"' + tag + '\"');\n if (buffer.isError(decodedTag))\n return decodedTag;\n let len = derDecodeLen(buffer, decodedTag.primitive, 'Failed to get length of \"' + tag + '\"');\n if (buffer.isError(len))\n return len;\n if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + \"of\" !== tag)\n return buffer.error('Failed to match tag: \"' + tag + '\"');\n if (decodedTag.primitive || len !== null)\n return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n let state = buffer.save(), res = this._skipUntilEnd(buffer, 'Failed to skip indefinite length body: \"' + this.tag + '\"');\n return buffer.isError(res) \? res : (len = buffer.offset - state.offset, buffer.restore(state), buffer.skip(len, 'Failed to match body of: \"' + tag + '\"'));\n }, DERNode.prototype._skipUntilEnd = function(buffer, fail) {\n for (;; ) {\n let tag = derDecodeTag(buffer, fail);\n if (buffer.isError(tag))\n return tag;\n let len = derDecodeLen(buffer, tag.primitive, fail);\n if (buffer.isError(len))\n return len;\n let res;\n if (tag.primitive || len !== null \? res = buffer.skip(len) : res = this._skipUntilEnd(buffer, fail), buffer.isError(res))\n return res;\n if (tag.tagStr === \"end\")\n break;\n }\n }, DERNode.prototype._decodeList = function(buffer, tag, decoder, options) {\n let result = [];\n for (;!buffer.isEmpty(); ) {\n let possibleEnd = this._peekTag(buffer, \"end\");\n if (buffer.isError(possibleEnd))\n return possibleEnd;\n let res = decoder.decode(buffer, \"der\", options);\n if (buffer.isError(res) && possibleEnd)\n break;\n result.push(res);\n }\n return result;\n }, DERNode.prototype._decodeStr = function(buffer, tag) {\n if (tag === \"bitstr\") {\n let unused = buffer.readUInt8();\n return buffer.isError(unused) \? unused : { unused, data: buffer.raw() };\n } else if (tag === \"bmpstr\") {\n let raw = buffer.raw();\n if (raw.length % 2 === 1)\n return buffer.error(\"Decoding of string type: bmpstr length mismatch\");\n let str = \"\";\n for (let i = 0;i < raw.length / 2; i++)\n str += String.fromCharCode(raw.readUInt16BE(i * 2));\n return str;\n } else if (tag === \"numstr\") {\n let numstr = buffer.raw().toString(\"ascii\");\n return this._isNumstr(numstr) \? numstr : buffer.error(\"Decoding of string type: numstr unsupported characters\");\n } else {\n if (tag === \"octstr\")\n return buffer.raw();\n if (tag === \"objDesc\")\n return buffer.raw();\n if (tag === \"printstr\") {\n let printstr = buffer.raw().toString(\"ascii\");\n return this._isPrintstr(printstr) \? printstr : buffer.error(\"Decoding of string type: printstr unsupported characters\");\n } else\n return /str$/.test(tag) \? buffer.raw().toString() : buffer.error(\"Decoding of string type: \" + tag + \" unsupported\");\n }\n }, DERNode.prototype._decodeObjid = function(buffer, values, relative) {\n let result, identifiers = [], ident = 0, subident = 0;\n for (;!buffer.isEmpty(); )\n subident = buffer.readUInt8(), ident <<= 7, ident |= subident & 127, (subident & 128) === 0 && (identifiers.push(ident), ident = 0);\n subident & 128 && identifiers.push(ident);\n let first = identifiers[0] / 40 | 0, second = identifiers[0] % 40;\n if (relative \? result = identifiers : result = [first, second].concat(identifiers.slice(1)), values) {\n let tmp = values[result.join(\" \")];\n tmp === void 0 && (tmp = values[result.join(\".\")]), tmp !== void 0 && (result = tmp);\n }\n return result;\n }, DERNode.prototype._decodeTime = function(buffer, tag) {\n let str = buffer.raw().toString(), year, mon, day, hour, min, sec;\n if (tag === \"gentime\")\n year = str.slice(0, 4) | 0, mon = str.slice(4, 6) | 0, day = str.slice(6, 8) | 0, hour = str.slice(8, 10) | 0, min = str.slice(10, 12) | 0, sec = str.slice(12, 14) | 0;\n else if (tag === \"utctime\")\n year = str.slice(0, 2) | 0, mon = str.slice(2, 4) | 0, day = str.slice(4, 6) | 0, hour = str.slice(6, 8) | 0, min = str.slice(8, 10) | 0, sec = str.slice(10, 12) | 0, year < 70 \? year = 2000 + year : year = 1900 + year;\n else\n return buffer.error(\"Decoding \" + tag + \" time is not supported yet\");\n return Date.UTC(year, mon - 1, day, hour, min, sec, 0);\n }, DERNode.prototype._decodeNull = function() {\n return null;\n }, DERNode.prototype._decodeBool = function(buffer) {\n let res = buffer.readUInt8();\n return buffer.isError(res) \? res : res !== 0;\n }, DERNode.prototype._decodeInt = function(buffer, values) {\n let raw = buffer.raw(), res = new bignum(raw);\n return values && (res = values[res.toString(10)] || res), res;\n }, DERNode.prototype._use = function(entity, obj) {\n return typeof entity == \"function\" && (entity = entity(obj)), entity._getDecoder(\"der\").tree;\n };\n function derDecodeTag(buf, fail) {\n let tag = buf.readUInt8(fail);\n if (buf.isError(tag))\n return tag;\n let cls = der.tagClass[tag >> 6], primitive = (tag & 32) === 0;\n if ((tag & 31) === 31) {\n let oct = tag;\n for (tag = 0;(oct & 128) === 128; ) {\n if (oct = buf.readUInt8(fail), buf.isError(oct))\n return oct;\n tag <<= 7, tag |= oct & 127;\n }\n } else\n tag &= 31;\n let tagStr = der.tag[tag];\n return {\n cls,\n primitive,\n tag,\n tagStr\n };\n }\n function derDecodeLen(buf, primitive, fail) {\n let len = buf.readUInt8(fail);\n if (buf.isError(len))\n return len;\n if (!primitive && len === 128)\n return null;\n if ((len & 128) === 0)\n return len;\n let num = len & 127;\n if (num > 4)\n return buf.error(\"length octect is too long\");\n len = 0;\n for (let i = 0;i < num; i++) {\n len <<= 8;\n let j = buf.readUInt8(fail);\n if (buf.isError(j))\n return j;\n len |= j;\n }\n return len;\n }\n }\n}), require_pem2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/pem.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safer().Buffer, DERDecoder = require_der3();\n function PEMDecoder(entity) {\n DERDecoder.call(this, entity), this.enc = \"pem\";\n }\n inherits(PEMDecoder, DERDecoder), module.exports = PEMDecoder, PEMDecoder.prototype.decode = function(data, options) {\n let lines = data.toString().split(/[\\r\\n]+/g), label = options.label.toUpperCase(), re = /^-----(BEGIN|END) ([^-]+)-----$/, start = -1, end = -1;\n for (let i = 0;i < lines.length; i++) {\n let match = lines[i].match(re);\n if (match !== null && match[2] === label)\n if (start === -1) {\n if (match[1] !== \"BEGIN\")\n break;\n start = i;\n } else {\n if (match[1] !== \"END\")\n break;\n end = i;\n break;\n }\n }\n if (start === -1 || end === -1)\n throw new Error(\"PEM section not found for: \" + label);\n let base64 = lines.slice(start + 1, end).join(\"\");\n base64.replace(/[^a-z0-9+/=]+/gi, \"\");\n let input = Buffer2.from(base64, \"base64\");\n return DERDecoder.prototype.decode.call(this, input, options);\n };\n }\n}), require_decoders = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/index.js\"(exports) {\n var decoders = exports;\n decoders.der = require_der3(), decoders.pem = require_pem2();\n }\n}), require_api = __commonJS({\n \"node_modules/asn1.js/lib/asn1/api.js\"(exports) {\n var encoders = require_encoders(), decoders = require_decoders(), inherits = require_inherits_browser(), api = exports;\n api.define = function(name, body) {\n return new Entity(name, body);\n };\n function Entity(name, body) {\n this.name = name, this.body = body, this.decoders = {}, this.encoders = {};\n }\n Entity.prototype = {}, Entity.prototype._createNamed = function(Base) {\n let name = this.name;\n function Generated(entity) {\n this._initNamed(entity, name);\n }\n return inherits(Generated, Base), Generated.prototype._initNamed = function(entity, name2) {\n Base.call(this, entity, name2);\n }, new Generated(this);\n }, Entity.prototype._getDecoder = function(enc) {\n return enc = enc || \"der\", this.decoders.hasOwnProperty(enc) || (this.decoders[enc] = this._createNamed(decoders[enc])), this.decoders[enc];\n }, Entity.prototype.decode = function(data, enc, options) {\n return this._getDecoder(enc).decode(data, options);\n }, Entity.prototype._getEncoder = function(enc) {\n return enc = enc || \"der\", this.encoders.hasOwnProperty(enc) || (this.encoders[enc] = this._createNamed(encoders[enc])), this.encoders[enc];\n }, Entity.prototype.encode = function(data, enc, reporter) {\n return this._getEncoder(enc).encode(data, reporter);\n };\n }\n}), require_base2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/index.js\"(exports) {\n var base = exports;\n base.Reporter = require_reporter().Reporter, base.DecoderBuffer = require_buffer().DecoderBuffer, base.EncoderBuffer = require_buffer().EncoderBuffer, base.Node = require_node();\n }\n}), require_constants = __commonJS({\n \"node_modules/asn1.js/lib/asn1/constants/index.js\"(exports) {\n var constants = exports;\n constants._reverse = function(map) {\n let res = {};\n return Object.keys(map).forEach(function(key) {\n (key | 0) == key && (key = key | 0);\n let value = map[key];\n res[value] = key;\n }), res;\n }, constants.der = require_der();\n }\n}), require_asn1 = __commonJS({\n \"node_modules/asn1.js/lib/asn1.js\"(exports) {\n var asn1 = exports;\n asn1.bignum = require_bn5(), asn1.define = require_api().define, asn1.base = require_base2(), asn1.constants = require_constants(), asn1.decoders = require_decoders(), asn1.encoders = require_encoders();\n }\n}), require_certificate = __commonJS({\n \"node_modules/parse-asn1/certificate.js\"(exports, module) {\n var asn = require_asn1(), Time = asn.define(\"Time\", function() {\n this.choice({\n utcTime: this.utctime(),\n generalTime: this.gentime()\n });\n }), AttributeTypeValue = asn.define(\"AttributeTypeValue\", function() {\n this.seq().obj(this.key(\"type\").objid(), this.key(\"value\").any());\n }), AlgorithmIdentifier = asn.define(\"AlgorithmIdentifier\", function() {\n this.seq().obj(this.key(\"algorithm\").objid(), this.key(\"parameters\").optional(), this.key(\"curve\").objid().optional());\n }), SubjectPublicKeyInfo = asn.define(\"SubjectPublicKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPublicKey\").bitstr());\n }), RelativeDistinguishedName = asn.define(\"RelativeDistinguishedName\", function() {\n this.setof(AttributeTypeValue);\n }), RDNSequence = asn.define(\"RDNSequence\", function() {\n this.seqof(RelativeDistinguishedName);\n }), Name = asn.define(\"Name\", function() {\n this.choice({\n rdnSequence: this.use(RDNSequence)\n });\n }), Validity = asn.define(\"Validity\", function() {\n this.seq().obj(this.key(\"notBefore\").use(Time), this.key(\"notAfter\").use(Time));\n }), Extension = asn.define(\"Extension\", function() {\n this.seq().obj(this.key(\"extnID\").objid(), this.key(\"critical\").bool().def(!1), this.key(\"extnValue\").octstr());\n }), TBSCertificate = asn.define(\"TBSCertificate\", function() {\n this.seq().obj(this.key(\"version\").explicit(0).int().optional(), this.key(\"serialNumber\").int(), this.key(\"signature\").use(AlgorithmIdentifier), this.key(\"issuer\").use(Name), this.key(\"validity\").use(Validity), this.key(\"subject\").use(Name), this.key(\"subjectPublicKeyInfo\").use(SubjectPublicKeyInfo), this.key(\"issuerUniqueID\").implicit(1).bitstr().optional(), this.key(\"subjectUniqueID\").implicit(2).bitstr().optional(), this.key(\"extensions\").explicit(3).seqof(Extension).optional());\n }), X509Certificate = asn.define(\"X509Certificate\", function() {\n this.seq().obj(this.key(\"tbsCertificate\").use(TBSCertificate), this.key(\"signatureAlgorithm\").use(AlgorithmIdentifier), this.key(\"signatureValue\").bitstr());\n });\n module.exports = X509Certificate;\n }\n}), require_asn12 = __commonJS({\n \"node_modules/parse-asn1/asn1.js\"(exports) {\n var asn1 = require_asn1();\n exports.certificate = require_certificate();\n var RSAPrivateKey = asn1.define(\"RSAPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"modulus\").int(), this.key(\"publicExponent\").int(), this.key(\"privateExponent\").int(), this.key(\"prime1\").int(), this.key(\"prime2\").int(), this.key(\"exponent1\").int(), this.key(\"exponent2\").int(), this.key(\"coefficient\").int());\n });\n exports.RSAPrivateKey = RSAPrivateKey;\n var RSAPublicKey = asn1.define(\"RSAPublicKey\", function() {\n this.seq().obj(this.key(\"modulus\").int(), this.key(\"publicExponent\").int());\n });\n exports.RSAPublicKey = RSAPublicKey;\n var PublicKey = asn1.define(\"SubjectPublicKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPublicKey\").bitstr());\n });\n exports.PublicKey = PublicKey;\n var AlgorithmIdentifier = asn1.define(\"AlgorithmIdentifier\", function() {\n this.seq().obj(this.key(\"algorithm\").objid(), this.key(\"none\").null_().optional(), this.key(\"curve\").objid().optional(), this.key(\"params\").seq().obj(this.key(\"p\").int(), this.key(\"q\").int(), this.key(\"g\").int()).optional());\n }), PrivateKeyInfo = asn1.define(\"PrivateKeyInfo\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPrivateKey\").octstr());\n });\n exports.PrivateKey = PrivateKeyInfo;\n var EncryptedPrivateKeyInfo = asn1.define(\"EncryptedPrivateKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").seq().obj(this.key(\"id\").objid(), this.key(\"decrypt\").seq().obj(this.key(\"kde\").seq().obj(this.key(\"id\").objid(), this.key(\"kdeparams\").seq().obj(this.key(\"salt\").octstr(), this.key(\"iters\").int())), this.key(\"cipher\").seq().obj(this.key(\"algo\").objid(), this.key(\"iv\").octstr()))), this.key(\"subjectPrivateKey\").octstr());\n });\n exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo;\n var DSAPrivateKey = asn1.define(\"DSAPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"p\").int(), this.key(\"q\").int(), this.key(\"g\").int(), this.key(\"pub_key\").int(), this.key(\"priv_key\").int());\n });\n exports.DSAPrivateKey = DSAPrivateKey, exports.DSAparam = asn1.define(\"DSAparam\", function() {\n this.int();\n });\n var ECPrivateKey = asn1.define(\"ECPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"privateKey\").octstr(), this.key(\"parameters\").optional().explicit(0).use(ECParameters), this.key(\"publicKey\").optional().explicit(1).bitstr());\n });\n exports.ECPrivateKey = ECPrivateKey;\n var ECParameters = asn1.define(\"ECParameters\", function() {\n this.choice({\n namedCurve: this.objid()\n });\n });\n exports.signature = asn1.define(\"signature\", function() {\n this.seq().obj(this.key(\"r\").int(), this.key(\"s\").int());\n });\n }\n}), require_aesid = __commonJS({\n \"node_modules/parse-asn1/aesid.json\"(exports, module) {\n module.exports = {\n \"2.16.840.1.101.3.4.1.1\": \"aes-128-ecb\",\n \"2.16.840.1.101.3.4.1.2\": \"aes-128-cbc\",\n \"2.16.840.1.101.3.4.1.3\": \"aes-128-ofb\",\n \"2.16.840.1.101.3.4.1.4\": \"aes-128-cfb\",\n \"2.16.840.1.101.3.4.1.21\": \"aes-192-ecb\",\n \"2.16.840.1.101.3.4.1.22\": \"aes-192-cbc\",\n \"2.16.840.1.101.3.4.1.23\": \"aes-192-ofb\",\n \"2.16.840.1.101.3.4.1.24\": \"aes-192-cfb\",\n \"2.16.840.1.101.3.4.1.41\": \"aes-256-ecb\",\n \"2.16.840.1.101.3.4.1.42\": \"aes-256-cbc\",\n \"2.16.840.1.101.3.4.1.43\": \"aes-256-ofb\",\n \"2.16.840.1.101.3.4.1.44\": \"aes-256-cfb\"\n };\n }\n}), require_fixProc = __commonJS({\n \"node_modules/parse-asn1/fixProc.js\"(exports, module) {\n var findProc = /Proc-Type: 4,ENCRYPTED[\\n\\r]+DEK-Info: AES-((\?:128)|(\?:192)|(\?:256))-CBC,([0-9A-H]+)[\\n\\r]+([0-9A-z\\n\\r+/=]+)[\\n\\r]+/m, startRegex = /^-----BEGIN ((\?:.*\? KEY)|CERTIFICATE)-----/m, fullRegex = /^-----BEGIN ((\?:.*\? KEY)|CERTIFICATE)-----([0-9A-z\\n\\r+/=]+)-----END \\1-----$/m, evp = require_evp_bytestokey(), ciphers = require_browser5(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(okey, password) {\n var key = okey.toString(), match = key.match(findProc), decrypted;\n if (match) {\n var suite = \"aes\" + match[1], iv = Buffer2.from(match[2], \"hex\"), cipherText = Buffer2.from(match[3].replace(/[\\r\\n]/g, \"\"), \"base64\"), cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key, out = [], cipher = ciphers.createDecipheriv(suite, cipherKey, iv);\n out.push(cipher.update(cipherText)), out.push(cipher.final()), decrypted = Buffer2.concat(out);\n } else {\n var match2 = key.match(fullRegex);\n decrypted = Buffer2.from(match2[2].replace(/[\\r\\n]/g, \"\"), \"base64\");\n }\n var tag = key.match(startRegex)[1];\n return {\n tag,\n data: decrypted\n };\n };\n }\n}), require_parse_asn1 = __commonJS({\n \"node_modules/parse-asn1/index.js\"(exports, module) {\n var asn1 = require_asn12(), aesid = require_aesid(), fixProc = require_fixProc(), ciphers = require_browser5(), compat = require_browser4(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = parseKeys;\n function parseKeys(buffer) {\n var password;\n typeof buffer == \"object\" && !Buffer2.isBuffer(buffer) && (password = buffer.passphrase, buffer = buffer.key), typeof buffer == \"string\" && (buffer = Buffer2.from(buffer));\n var stripped = fixProc(buffer, password), type = stripped.tag, data = stripped.data, subtype, ndata;\n switch (type) {\n case \"CERTIFICATE\":\n ndata = asn1.certificate.decode(data, \"der\").tbsCertificate.subjectPublicKeyInfo;\n case \"PUBLIC KEY\":\n switch (ndata || (ndata = asn1.PublicKey.decode(data, \"der\")), subtype = ndata.algorithm.algorithm.join(\".\"), subtype) {\n case \"1.2.840.113549.1.1.1\":\n return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, \"der\");\n case \"1.2.840.10045.2.1\":\n return ndata.subjectPrivateKey = ndata.subjectPublicKey, {\n type: \"ec\",\n data: ndata\n };\n case \"1.2.840.10040.4.1\":\n return ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, \"der\"), {\n type: \"dsa\",\n data: ndata.algorithm.params\n };\n default:\n throw new Error(\"unknown key id \" + subtype);\n }\n case \"ENCRYPTED PRIVATE KEY\":\n data = asn1.EncryptedPrivateKey.decode(data, \"der\"), data = decrypt(data, password);\n case \"PRIVATE KEY\":\n switch (ndata = asn1.PrivateKey.decode(data, \"der\"), subtype = ndata.algorithm.algorithm.join(\".\"), subtype) {\n case \"1.2.840.113549.1.1.1\":\n return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, \"der\");\n case \"1.2.840.10045.2.1\":\n return {\n curve: ndata.algorithm.curve,\n privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, \"der\").privateKey\n };\n case \"1.2.840.10040.4.1\":\n return ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, \"der\"), {\n type: \"dsa\",\n params: ndata.algorithm.params\n };\n default:\n throw new Error(\"unknown key id \" + subtype);\n }\n case \"RSA PUBLIC KEY\":\n return asn1.RSAPublicKey.decode(data, \"der\");\n case \"RSA PRIVATE KEY\":\n return asn1.RSAPrivateKey.decode(data, \"der\");\n case \"DSA PRIVATE KEY\":\n return {\n type: \"dsa\",\n params: asn1.DSAPrivateKey.decode(data, \"der\")\n };\n case \"EC PRIVATE KEY\":\n return data = asn1.ECPrivateKey.decode(data, \"der\"), {\n curve: data.parameters.value,\n privateKey: data.privateKey\n };\n default:\n throw new Error(\"unknown key type \" + type);\n }\n }\n parseKeys.signature = asn1.signature;\n function decrypt(data, password) {\n var salt = data.algorithm.decrypt.kde.kdeparams.salt, iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10), algo = aesid[data.algorithm.decrypt.cipher.algo.join(\".\")], iv = data.algorithm.decrypt.cipher.iv, cipherText = data.subjectPrivateKey, keylen = parseInt(algo.split(\"-\")[1], 10) / 8, key = compat.pbkdf2Sync(password, salt, iters, keylen, \"sha1\"), cipher = ciphers.createDecipheriv(algo, key, iv), out = [];\n return out.push(cipher.update(cipherText)), out.push(cipher.final()), Buffer2.concat(out);\n }\n }\n}), require_curves2 = __commonJS({\n \"node_modules/browserify-sign/browser/curves.json\"(exports, module) {\n module.exports = {\n \"1.3.132.0.10\": \"secp256k1\",\n \"1.3.132.0.33\": \"p224\",\n \"1.2.840.10045.3.1.1\": \"p192\",\n \"1.2.840.10045.3.1.7\": \"p256\",\n \"1.3.132.0.34\": \"p384\",\n \"1.3.132.0.35\": \"p521\"\n };\n }\n}), require_sign = __commonJS({\n \"node_modules/browserify-sign/browser/sign.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, createHmac = require_browser3(), crt = require_browserify_rsa(), EC = require_elliptic().ec, BN = require_bn3(), parseKeys = require_parse_asn1(), curves = require_curves2();\n function sign(hash, key, hashType, signType, tag) {\n var priv = parseKeys(key);\n if (priv.curve) {\n if (signType !== \"ecdsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong private key type\");\n return ecSign(hash, priv);\n } else if (priv.type === \"dsa\") {\n if (signType !== \"dsa\")\n throw new Error(\"wrong private key type\");\n return dsaSign(hash, priv, hashType);\n } else if (signType !== \"rsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong private key type\");\n hash = Buffer2.concat([tag, hash]);\n for (var len = priv.modulus.byteLength(), pad = [0, 1];hash.length + pad.length + 1 < len; )\n pad.push(255);\n pad.push(0);\n for (var i = -1;++i < hash.length; )\n pad.push(hash[i]);\n var out = crt(pad, priv);\n return out;\n }\n function ecSign(hash, priv) {\n var curveId = curves[priv.curve.join(\".\")];\n if (!curveId)\n throw new Error(\"unknown curve \" + priv.curve.join(\".\"));\n var curve = new EC(curveId), key = curve.keyFromPrivate(priv.privateKey), out = key.sign(hash);\n return Buffer2.from(out.toDER());\n }\n function dsaSign(hash, priv, algo) {\n for (var x = priv.params.priv_key, p = priv.params.p, q = priv.params.q, g = priv.params.g, r = new BN(0), k, H = bits2int(hash, q).mod(q), s = !1, kv = getKey(x, q, hash, algo);s === !1; )\n k = makeKey(q, kv, algo), r = makeR(g, k, p, q), s = k.invm(q).imul(H.add(x.mul(r))).mod(q), s.cmpn(0) === 0 && (s = !1, r = new BN(0));\n return toDER(r, s);\n }\n function toDER(r, s) {\n r = r.toArray(), s = s.toArray(), r[0] & 128 && (r = [0].concat(r)), s[0] & 128 && (s = [0].concat(s));\n var total = r.length + s.length + 4, res = [48, total, 2, r.length];\n return res = res.concat(r, [2, s.length], s), Buffer2.from(res);\n }\n function getKey(x, q, hash, algo) {\n if (x = Buffer2.from(x.toArray()), x.length < q.byteLength()) {\n var zeros = Buffer2.alloc(q.byteLength() - x.length);\n x = Buffer2.concat([zeros, x]);\n }\n var hlen = hash.length, hbits = bits2octets(hash, q), v = Buffer2.alloc(hlen);\n v.fill(1);\n var k = Buffer2.alloc(hlen);\n return k = createHmac(algo, k).update(v).update(Buffer2.from([0])).update(x).update(hbits).digest(), v = createHmac(algo, k).update(v).digest(), k = createHmac(algo, k).update(v).update(Buffer2.from([1])).update(x).update(hbits).digest(), v = createHmac(algo, k).update(v).digest(), { k, v };\n }\n function bits2int(obits, q) {\n var bits = new BN(obits), shift = (obits.length << 3) - q.bitLength();\n return shift > 0 && bits.ishrn(shift), bits;\n }\n function bits2octets(bits, q) {\n bits = bits2int(bits, q), bits = bits.mod(q);\n var out = Buffer2.from(bits.toArray());\n if (out.length < q.byteLength()) {\n var zeros = Buffer2.alloc(q.byteLength() - out.length);\n out = Buffer2.concat([zeros, out]);\n }\n return out;\n }\n function makeKey(q, kv, algo) {\n var t, k;\n do {\n for (t = Buffer2.alloc(0);t.length * 8 < q.bitLength(); )\n kv.v = createHmac(algo, kv.k).update(kv.v).digest(), t = Buffer2.concat([t, kv.v]);\n k = bits2int(t, q), kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer2.from([0])).digest(), kv.v = createHmac(algo, kv.k).update(kv.v).digest();\n } while (k.cmp(q) !== -1);\n return k;\n }\n function makeR(g, k, p, q) {\n return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q);\n }\n module.exports = sign, module.exports.getKey = getKey, module.exports.makeKey = makeKey;\n }\n}), require_verify = __commonJS({\n \"node_modules/browserify-sign/browser/verify.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, BN = require_bn3(), EC = require_elliptic().ec, parseKeys = require_parse_asn1(), curves = require_curves2();\n function verify(sig, hash, key, signType, tag) {\n var pub = parseKeys(key);\n if (pub.type === \"ec\") {\n if (signType !== \"ecdsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong public key type\");\n return ecVerify(sig, hash, pub);\n } else if (pub.type === \"dsa\") {\n if (signType !== \"dsa\")\n throw new Error(\"wrong public key type\");\n return dsaVerify(sig, hash, pub);\n } else if (signType !== \"rsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong public key type\");\n hash = Buffer2.concat([tag, hash]);\n for (var len = pub.modulus.byteLength(), pad = [1], padNum = 0;hash.length + pad.length + 2 < len; )\n pad.push(255), padNum++;\n pad.push(0);\n for (var i = -1;++i < hash.length; )\n pad.push(hash[i]);\n pad = Buffer2.from(pad);\n var red = BN.mont(pub.modulus);\n sig = new BN(sig).toRed(red), sig = sig.redPow(new BN(pub.publicExponent)), sig = Buffer2.from(sig.fromRed().toArray());\n var out = padNum < 8 \? 1 : 0;\n for (len = Math.min(sig.length, pad.length), sig.length !== pad.length && (out = 1), i = -1;++i < len; )\n out |= sig[i] ^ pad[i];\n return out === 0;\n }\n function ecVerify(sig, hash, pub) {\n var curveId = curves[pub.data.algorithm.curve.join(\".\")];\n if (!curveId)\n throw new Error(\"unknown curve \" + pub.data.algorithm.curve.join(\".\"));\n var curve = new EC(curveId), pubkey = pub.data.subjectPrivateKey.data;\n return curve.verify(hash, sig, pubkey);\n }\n function dsaVerify(sig, hash, pub) {\n var p = pub.data.p, q = pub.data.q, g = pub.data.g, y = pub.data.pub_key, unpacked = parseKeys.signature.decode(sig, \"der\"), s = unpacked.s, r = unpacked.r;\n checkValue(s, q), checkValue(r, q);\n var montp = BN.mont(p), w = s.invm(q), v = g.toRed(montp).redPow(new BN(hash).mul(w).mod(q)).fromRed().mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed()).mod(p).mod(q);\n return v.cmp(r) === 0;\n }\n function checkValue(b, q) {\n if (b.cmpn(0) <= 0)\n throw new Error(\"invalid sig\");\n if (b.cmp(q) >= q)\n throw new Error(\"invalid sig\");\n }\n module.exports = verify;\n }\n}), require_browser8 = __commonJS({\n \"node_modules/browserify-sign/browser/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, createHash = require_browser2(), inherits = require_inherits_browser(), sign = require_sign(), verify = require_verify(), algorithms = require_algorithms();\n Object.keys(algorithms).forEach(function(key) {\n algorithms[key].id = Buffer2.from(algorithms[key].id, \"hex\"), algorithms[key.toLowerCase()] = algorithms[key];\n });\n function Sign(algorithm) {\n StreamModule.Writable.call(this);\n var data = algorithms[algorithm];\n if (!data)\n throw new Error(\"Unknown message digest\");\n this._hashType = data.hash, this._hash = createHash(data.hash), this._tag = data.id, this._signType = data.sign;\n }\n inherits(Sign, StreamModule.Writable), Sign.prototype._write = function(data, _, done) {\n this._hash.update(data), done();\n }, Sign.prototype.update = function(data, enc) {\n return typeof data == \"string\" && (data = Buffer2.from(data, enc)), this._hash.update(data), this;\n }, Sign.prototype.sign = function(key, enc) {\n this.end();\n var hash = this._hash.digest(), sig = sign(hash, key, this._hashType, this._signType, this._tag);\n return enc \? sig.toString(enc) : sig;\n };\n function Verify(algorithm) {\n StreamModule.Writable.call(this);\n var data = algorithms[algorithm];\n if (!data)\n throw new Error(\"Unknown message digest\");\n this._hash = createHash(data.hash), this._tag = data.id, this._signType = data.sign;\n }\n inherits(Verify, StreamModule.Writable), Verify.prototype._write = function(data, _, done) {\n this._hash.update(data), done();\n }, Verify.prototype.update = function(data, enc) {\n return typeof data == \"string\" && (data = Buffer2.from(data, enc)), this._hash.update(data), this;\n }, Verify.prototype.verify = function(key, sig, enc) {\n typeof sig == \"string\" && (sig = Buffer2.from(sig, enc)), this.end();\n var hash = this._hash.digest();\n return verify(sig, hash, key, this._signType, this._tag);\n };\n function createSign(algorithm) {\n return new Sign(algorithm);\n }\n function createVerify(algorithm) {\n return new Verify(algorithm);\n }\n module.exports = {\n Sign: createSign,\n Verify: createVerify,\n createSign,\n createVerify\n };\n }\n}), require_bn6 = require_bn, require_browser9 = __commonJS({\n \"node_modules/create-ecdh/browser.js\"(exports, module) {\n var elliptic = require_elliptic(), BN = require_bn6();\n module.exports = function(curve) {\n return new ECDH(curve);\n };\n var aliases = {\n secp256k1: {\n name: \"secp256k1\",\n byteLength: 32\n },\n secp224r1: {\n name: \"p224\",\n byteLength: 28\n },\n prime256v1: {\n name: \"p256\",\n byteLength: 32\n },\n prime192v1: {\n name: \"p192\",\n byteLength: 24\n },\n ed25519: {\n name: \"ed25519\",\n byteLength: 32\n },\n secp384r1: {\n name: \"p384\",\n byteLength: 48\n },\n secp521r1: {\n name: \"p521\",\n byteLength: 66\n }\n };\n aliases.p224 = aliases.secp224r1, aliases.p256 = aliases.secp256r1 = aliases.prime256v1, aliases.p192 = aliases.secp192r1 = aliases.prime192v1, aliases.p384 = aliases.secp384r1, aliases.p521 = aliases.secp521r1;\n function ECDH(curve) {\n this.curveType = aliases[curve], this.curveType || (this.curveType = {\n name: curve\n }), this.curve = new elliptic.ec(this.curveType.name), this.keys = void 0;\n }\n ECDH.prototype = {}, ECDH.prototype.generateKeys = function(enc, format) {\n return this.keys = this.curve.genKeyPair(), this.getPublicKey(enc, format);\n }, ECDH.prototype.computeSecret = function(other, inenc, enc) {\n inenc = inenc || \"utf8\", Buffer.isBuffer(other) || (other = new Buffer(other, inenc));\n var otherPub = this.curve.keyFromPublic(other).getPublic(), out = otherPub.mul(this.keys.getPrivate()).getX();\n return formatReturnValue(out, enc, this.curveType.byteLength);\n }, ECDH.prototype.getPublicKey = function(enc, format) {\n var key = this.keys.getPublic(format === \"compressed\", !0);\n return format === \"hybrid\" && (key[key.length - 1] % 2 \? key[0] = 7 : key[0] = 6), formatReturnValue(key, enc);\n }, ECDH.prototype.getPrivateKey = function(enc) {\n return formatReturnValue(this.keys.getPrivate(), enc);\n }, ECDH.prototype.setPublicKey = function(pub, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(pub) || (pub = new Buffer(pub, enc)), this.keys._importPublic(pub), this;\n }, ECDH.prototype.setPrivateKey = function(priv, enc) {\n enc = enc || \"utf8\", Buffer.isBuffer(priv) || (priv = new Buffer(priv, enc));\n var _priv = new BN(priv);\n return _priv = _priv.toString(16), this.keys = this.curve.genKeyPair(), this.keys._importPrivate(_priv), this;\n };\n function formatReturnValue(bn, enc, len) {\n Array.isArray(bn) || (bn = bn.toArray());\n var buf = new Buffer(bn);\n if (len && buf.length < len) {\n var zeros = new Buffer(len - buf.length);\n zeros.fill(0), buf = Buffer.concat([zeros, buf]);\n }\n return enc \? buf.toString(enc) : buf;\n }\n }\n}), require_mgf = __commonJS({\n \"node_modules/public-encrypt/mgf.js\"(exports, module) {\n var createHash = require_browser2(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(seed, len) {\n for (var t = Buffer2.alloc(0), i = 0, c;t.length < len; )\n c = i2ops(i++), t = Buffer2.concat([t, createHash(\"sha1\").update(seed).update(c).digest()]);\n return t.slice(0, len);\n };\n function i2ops(c) {\n var out = Buffer2.allocUnsafe(4);\n return out.writeUInt32BE(c, 0), out;\n }\n }\n}), require_xor = __commonJS({\n \"node_modules/public-encrypt/xor.js\"(exports, module) {\n module.exports = function(a, b) {\n for (var len = a.length, i = -1;++i < len; )\n a[i] ^= b[i];\n return a;\n };\n }\n}), require_bn7 = require_bn, { CryptoHasher } = globalThis.Bun, require_withPublic = __commonJS({\n \"node_modules/public-encrypt/withPublic.js\"(exports, module) {\n var BN = require_bn7(), Buffer2 = require_safe_buffer().Buffer;\n function withPublic(paddedMsg, key) {\n return Buffer2.from(paddedMsg.toRed(BN.mont(key.modulus)).redPow(new BN(key.publicExponent)).fromRed().toArray());\n }\n module.exports = withPublic;\n }\n}), require_publicEncrypt = __commonJS({\n \"node_modules/public-encrypt/publicEncrypt.js\"(exports, module) {\n var parseKeys = require_parse_asn1(), randomBytes = require_browser(), createHash = require_browser2(), mgf = require_mgf(), xor = require_xor(), BN = require_bn7(), withPublic = require_withPublic(), crt = require_browserify_rsa(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(publicKey, msg, reverse) {\n var padding;\n publicKey.padding \? padding = publicKey.padding : reverse \? padding = 1 : padding = 4;\n var key = parseKeys(publicKey), paddedMsg;\n if (padding === 4)\n paddedMsg = oaep(key, msg);\n else if (padding === 1)\n paddedMsg = pkcs1(key, msg, reverse);\n else if (padding === 3) {\n if (paddedMsg = new BN(msg), paddedMsg.cmp(key.modulus) >= 0)\n throw new Error(\"data too long for modulus\");\n } else\n throw new Error(\"unknown padding\");\n return reverse \? crt(paddedMsg, key) : withPublic(paddedMsg, key);\n };\n function oaep(key, msg) {\n var k = key.modulus.byteLength(), mLen = msg.length, iHash = createHash(\"sha1\").update(Buffer2.alloc(0)).digest(), hLen = iHash.length, hLen2 = 2 * hLen;\n if (mLen > k - hLen2 - 2)\n throw new Error(\"message too long\");\n var ps = Buffer2.alloc(k - mLen - hLen2 - 2), dblen = k - hLen - 1, seed = randomBytes(hLen), maskedDb = xor(Buffer2.concat([iHash, ps, Buffer2.alloc(1, 1), msg], dblen), mgf(seed, dblen)), maskedSeed = xor(seed, mgf(maskedDb, hLen));\n return new BN(Buffer2.concat([Buffer2.alloc(1), maskedSeed, maskedDb], k));\n }\n function pkcs1(key, msg, reverse) {\n var mLen = msg.length, k = key.modulus.byteLength();\n if (mLen > k - 11)\n throw new Error(\"message too long\");\n var ps;\n return reverse \? ps = Buffer2.alloc(k - mLen - 3, 255) : ps = nonZero(k - mLen - 3), new BN(Buffer2.concat([Buffer2.from([0, reverse \? 1 : 2]), ps, Buffer2.alloc(1), msg], k));\n }\n function nonZero(len) {\n for (var out = Buffer2.allocUnsafe(len), i = 0, cache = randomBytes(len * 2), cur = 0, num;i < len; )\n cur === cache.length && (cache = randomBytes(len * 2), cur = 0), num = cache[cur++], num && (out[i++] = num);\n return out;\n }\n }\n}), require_privateDecrypt = __commonJS({\n \"node_modules/public-encrypt/privateDecrypt.js\"(exports, module) {\n var parseKeys = require_parse_asn1(), mgf = require_mgf(), xor = require_xor(), BN = require_bn7(), crt = require_browserify_rsa(), createHash = require_browser2(), withPublic = require_withPublic(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(privateKey, enc, reverse) {\n var padding;\n privateKey.padding \? padding = privateKey.padding : reverse \? padding = 1 : padding = 4;\n var key = parseKeys(privateKey), k = key.modulus.byteLength();\n if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0)\n throw new Error(\"decryption error\");\n var msg;\n reverse \? msg = withPublic(new BN(enc), key) : msg = crt(enc, key);\n var zBuffer = Buffer2.alloc(k - msg.length);\n if (msg = Buffer2.concat([zBuffer, msg], k), padding === 4)\n return oaep(key, msg);\n if (padding === 1)\n return pkcs1(key, msg, reverse);\n if (padding === 3)\n return msg;\n throw new Error(\"unknown padding\");\n };\n function oaep(key, msg) {\n var k = key.modulus.byteLength(), iHash = createHash(\"sha1\").update(Buffer2.alloc(0)).digest(), hLen = iHash.length;\n if (msg[0] !== 0)\n throw new Error(\"decryption error\");\n var maskedSeed = msg.slice(1, hLen + 1), maskedDb = msg.slice(hLen + 1), seed = xor(maskedSeed, mgf(maskedDb, hLen)), db = xor(maskedDb, mgf(seed, k - hLen - 1));\n if (compare(iHash, db.slice(0, hLen)))\n throw new Error(\"decryption error\");\n for (var i = hLen;db[i] === 0; )\n i++;\n if (db[i++] !== 1)\n throw new Error(\"decryption error\");\n return db.slice(i);\n }\n function pkcs1(key, msg, reverse) {\n for (var p1 = msg.slice(0, 2), i = 2, status = 0;msg[i++] !== 0; )\n if (i >= msg.length) {\n status++;\n break;\n }\n var ps = msg.slice(2, i - 1);\n if ((p1.toString(\"hex\") !== \"0002\" && !reverse || p1.toString(\"hex\") !== \"0001\" && reverse) && status++, ps.length < 8 && status++, status)\n throw new Error(\"decryption error\");\n return msg.slice(i);\n }\n function compare(a, b) {\n a = Buffer2.from(a), b = Buffer2.from(b);\n var dif = 0, len = a.length;\n a.length !== b.length && (dif++, len = Math.min(a.length, b.length));\n for (var i = -1;++i < len; )\n dif += a[i] ^ b[i];\n return dif;\n }\n }\n}), require_browser10 = __commonJS({\n \"node_modules/public-encrypt/browser.js\"(exports) {\n exports.publicEncrypt = require_publicEncrypt(), exports.privateDecrypt = require_privateDecrypt(), exports.privateEncrypt = function(key, buf) {\n return exports.publicEncrypt(key, buf, !0);\n }, exports.publicDecrypt = function(key, buf) {\n return exports.privateDecrypt(key, buf, !0);\n };\n }\n}), require_browser11 = __commonJS({\n \"node_modules/randomfill/browser.js\"(exports) {\n var safeBuffer = require_safe_buffer(), randombytes = require_browser(), Buffer2 = safeBuffer.Buffer, kBufferMaxLength = safeBuffer.kMaxLength, kMaxUint32 = Math.pow(2, 32) - 1;\n function assertOffset(offset, length) {\n if (typeof offset != \"number\" || offset !== offset)\n @throwTypeError(\"offset must be a number\");\n if (offset > kMaxUint32 || offset < 0)\n @throwTypeError(\"offset must be a uint32\");\n if (offset > kBufferMaxLength || offset > length)\n @throwRangeError(\"offset out of range\");\n }\n function assertSize(size, offset, length) {\n if (typeof size != \"number\" || size !== size)\n @throwTypeError(\"size must be a number\");\n if (size > kMaxUint32 || size < 0)\n @throwTypeError(\"size must be a uint32\");\n if (size + offset > length || size > kBufferMaxLength)\n @throwRangeError(\"buffer too small\");\n }\n exports.randomFill = randomFill, exports.randomFillSync = randomFillSync;\n function randomFill(buf, offset, size, cb) {\n if (!Buffer2.isBuffer(buf) && !(buf instanceof global.Uint8Array))\n @throwTypeError('\"buf\" argument must be a Buffer or Uint8Array');\n if (typeof offset == \"function\")\n cb = offset, offset = 0, size = buf.length;\n else if (typeof size == \"function\")\n cb = size, size = buf.length - offset;\n else if (typeof cb != \"function\")\n @throwTypeError('\"cb\" argument must be a function');\n return assertOffset(offset, buf.length), assertSize(size, offset, buf.length), actualFill(buf, offset, size, cb);\n }\n function actualFill(buf, offset, size, cb) {\n if (cb) {\n randombytes(size, function(err, bytes2) {\n if (err)\n return cb(err);\n bytes2.copy(buf, offset), cb(null, buf);\n });\n return;\n }\n var bytes = randombytes(size);\n return bytes.copy(buf, offset), buf;\n }\n function randomFillSync(buf, offset, size) {\n if (typeof offset > \"u\" && (offset = 0), !Buffer2.isBuffer(buf) && !(buf instanceof global.Uint8Array))\n @throwTypeError('\"buf\" argument must be a Buffer or Uint8Array');\n return assertOffset(offset, buf.length), size === void 0 && (size = buf.length - offset), assertSize(size, offset, buf.length), actualFill(buf, offset, size);\n }\n }\n}), require_crypto_browserify2 = __commonJS({\n \"node_modules/crypto-browserify/index.js\"(exports) {\n exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require_browser(), exports.createHash = require_browser2(), exports.Hash = exports.createHash.Hash, exports.createHmac = exports.Hmac = require_browser3();\n var algos = require_algos(), algoKeys = Object.keys(algos), hashes = [\"sha1\", \"sha224\", \"sha256\", \"sha384\", \"sha512\", \"md5\", \"rmd160\"].concat(algoKeys);\n exports.getHashes = function() {\n return hashes;\n };\n var p = require_browser4();\n exports.pbkdf2 = p.pbkdf2, exports.pbkdf2Sync = p.pbkdf2Sync;\n var aes = require_browser6();\n exports.Cipher = aes.Cipher, exports.createCipher = aes.createCipher, exports.Cipheriv = aes.Cipheriv, exports.createCipheriv = aes.createCipheriv, exports.Decipher = aes.Decipher, exports.createDecipher = aes.createDecipher, exports.Decipheriv = aes.Decipheriv, exports.createDecipheriv = aes.createDecipheriv, exports.getCiphers = aes.getCiphers, exports.listCiphers = aes.listCiphers;\n var dh = require_browser7();\n exports.DiffieHellmanGroup = dh.DiffieHellmanGroup, exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup, exports.getDiffieHellman = dh.getDiffieHellman, exports.createDiffieHellman = dh.createDiffieHellman, exports.DiffieHellman = dh.DiffieHellman;\n var sign = require_browser8();\n exports.createSign = sign.createSign, exports.Sign = sign.Sign, exports.createVerify = sign.createVerify, exports.Verify = sign.Verify, exports.createECDH = require_browser9();\n var publicEncrypt = require_browser10();\n exports.publicEncrypt = publicEncrypt.publicEncrypt, exports.privateEncrypt = publicEncrypt.privateEncrypt, exports.publicDecrypt = publicEncrypt.publicDecrypt, exports.privateDecrypt = publicEncrypt.privateDecrypt, exports.getRandomValues = (values) => crypto.getRandomValues(values);\n var rf = require_browser11();\n exports.randomFill = rf.randomFill, exports.randomFillSync = rf.randomFillSync, exports.createCredentials = function() {\n throw new Error([\n \"sorry, createCredentials is not implemented yet\",\n \"we accept pull requests\",\n \"https://github.com/crypto-browserify/crypto-browserify\"\n ].join(`\n`));\n }, exports.constants = @processBindingConstants.crypto;\n }\n}), crypto_exports = require_crypto_browserify2(), DEFAULT_ENCODING = \"buffer\", getRandomValues = (array) => crypto.getRandomValues(array), randomUUID = () => crypto.randomUUID(), randomInt = (...args) => crypto.randomInt(...args), timingSafeEqual = \"timingSafeEqual\" in crypto \? (a, b) => {\n let { byteLength: byteLengthA } = a, { byteLength: byteLengthB } = b;\n if (typeof byteLengthA != \"number\" || typeof byteLengthB != \"number\")\n @throwTypeError(\"Input must be an array buffer view\");\n if (byteLengthA !== byteLengthB)\n @throwRangeError(\"Input buffers must have the same length\");\n return crypto.timingSafeEqual(a, b);\n} : void 0, scryptSync = \"scryptSync\" in crypto \? (password, salt, keylen, options) => {\n let res = crypto.scryptSync(password, salt, keylen, options);\n return DEFAULT_ENCODING !== \"buffer\" \? new Buffer(res).toString(DEFAULT_ENCODING) : new Buffer(res);\n} : void 0, scrypt = \"scryptSync\" in crypto \? function(password, salt, keylen, options, callback) {\n if (typeof options == \"function\" && (callback = options, options = void 0), typeof callback != \"function\") {\n var err = @makeTypeError(\"callback must be a function\");\n throw err.code = \"ERR_INVALID_CALLBACK\", err;\n }\n try {\n let result = crypto.scryptSync(password, salt, keylen, options);\n process.nextTick(callback, null, DEFAULT_ENCODING !== \"buffer\" \? new Buffer(result).toString(DEFAULT_ENCODING) : new Buffer(result));\n } catch (err2) {\n throw err2;\n }\n} : void 0;\ntimingSafeEqual && (Object.defineProperty(timingSafeEqual, \"name\", {\n value: \"::bunternal::\"\n}), Object.defineProperty(scrypt, \"name\", {\n value: \"::bunternal::\"\n}), Object.defineProperty(scryptSync, \"name\", {\n value: \"::bunternal::\"\n}));\nvar harcoded_curves = [\n \"p192\",\n \"p224\",\n \"p256\",\n \"p384\",\n \"p521\",\n \"curve25519\",\n \"ed25519\",\n \"secp256k1\",\n \"secp224r1\",\n \"prime256v1\",\n \"prime192v1\",\n \"ed25519\",\n \"secp384r1\",\n \"secp521r1\"\n], webcrypto = crypto;\n__export(crypto_exports, {\n DEFAULT_ENCODING: () => DEFAULT_ENCODING,\n getRandomValues: () => getRandomValues,\n randomUUID: () => randomUUID,\n randomInt: () => randomInt,\n getCurves: () => getCurves,\n scrypt: () => scrypt,\n scryptSync: () => scryptSync,\n timingSafeEqual: () => timingSafeEqual,\n webcrypto: () => webcrypto,\n subtle: () => webcrypto.subtle\n});\n$ = crypto_exports;\n/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeConsoleCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/console.ts\nreturn console})\n");
//
//
-static constexpr ASCIILiteral NodeDgramCode = "(function (){\"use strict\";// src/js/out/tmp/node/dgram.ts\nvar createSocket = function() {\n throwNotImplemented(\"node:dgram createSocket\", 1630);\n}, Socket = function() {\n throwNotImplemented(\"node:dgram Socket\", 1630);\n}, _createSocketHandle = function() {\n throwNotImplemented(\"node:dgram _createSocketHandle\", 1630);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5);\n$ = {\n createSocket,\n Socket,\n _createSocketHandle\n};\nhideFromStack(createSocket, Socket, _createSocketHandle);\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeCryptoCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/crypto.ts\nvar exportIfKeyObject = function(key2) {\n if (key2 instanceof KeyObject)\n key2 = key2.export();\n else if (key2 instanceof CryptoKey)\n key2 = KeyObject.from(key2).export();\n return key2;\n}, getKeyFrom = function(key2, type) {\n if (key2 instanceof KeyObject)\n key2 = key2.export();\n else if (key2 instanceof CryptoKey)\n key2 = KeyObject.from(key2).export();\n else if (!Buffer.isBuffer(key2) && typeof key2 === \"object\") {\n if ((typeof key2.format === \"string\" || typeof key2.passphrase === \"string\") && typeof key2.key !== \"undefined\")\n key2 = type === \"public\" \? _createPublicKey(key2).export() : _createPrivateKey(key2).export();\n } else if (typeof key2 === \"string\" && type === \"public\")\n key2.indexOf(\"PRIVATE KEY-----\") !== -1 && (key2 = _createPublicKey(key2).export());\n return key2;\n}, getArrayBufferOrView = function(buffer, name, encoding) {\n if (buffer instanceof KeyObject) {\n if (buffer.type !== \"secret\") {\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key.type}, expected secret`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n }\n buffer = buffer.export();\n }\n if (isAnyArrayBuffer(buffer))\n return buffer;\n if (typeof buffer === \"string\") {\n if (encoding === \"buffer\")\n encoding = \"utf8\";\n return Buffer.from(buffer, encoding);\n }\n if (!isArrayBufferView(buffer)) {\n var error = @makeTypeError(`ERR_INVALID_ARG_TYPE: The \"${name}\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, or DataView. Received ` + buffer);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n return buffer;\n}, getCurves = function() {\n return harcoded_curves;\n}, _generateKeyPairSync = function(algorithm, options) {\n const result = generateKeyPairSync(algorithm, options);\n if (result) {\n const publicKeyEncoding = options\?.publicKeyEncoding, privateKeyEncoding = options\?.privateKeyEncoding;\n result.publicKey = publicKeyEncoding \? KeyObject.from(result.publicKey).export(publicKeyEncoding) : KeyObject.from(result.publicKey), result.privateKey = privateKeyEncoding \? KeyObject.from(result.privateKey).export(privateKeyEncoding) : KeyObject.from(result.privateKey);\n }\n return result;\n}, _createPrivateKey = function(key2) {\n if (typeof key2 === \"string\")\n return key2 = Buffer.from(key2, \"utf8\"), KeyObject.from(createPrivateKey({ key: key2, format: \"pem\" }));\n else if (isAnyArrayBuffer(key2) || isArrayBufferView(key2))\n return KeyObject.from(createPrivateKey({ key: key2, format: \"pem\" }));\n else if (typeof key2 === \"object\")\n if (key2 instanceof KeyObject || key2 instanceof CryptoKey) {\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key2.type}`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n } else {\n let actual_key = key2.key;\n if (typeof actual_key === \"string\")\n actual_key = Buffer.from(actual_key, key2.encoding || \"utf8\"), key2.key = actual_key;\n else if (actual_key instanceof KeyObject || actual_key instanceof CryptoKey) {\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key2.type}`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n }\n if (!isAnyArrayBuffer(actual_key) && !isArrayBufferView(actual_key) && typeof actual_key !== \"object\") {\n var error = @makeTypeError('ERR_INVALID_ARG_TYPE: The \"key\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ' + actual_key);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n if (!key2.format)\n key2.format = \"pem\";\n return KeyObject.from(createPrivateKey(key2));\n }\n else {\n var error = @makeTypeError('ERR_INVALID_ARG_TYPE: The \"key\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ' + key2);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n}, _createPublicKey = function(key2) {\n if (typeof key2 === \"string\")\n return key2 = Buffer.from(key2, \"utf8\"), KeyObject.from(createPublicKey({ key: key2, format: \"pem\" }));\n else if (isAnyArrayBuffer(key2) || isArrayBufferView(key2))\n return KeyObject.from(createPublicKey({ key: key2, format: \"pem\" }));\n else if (typeof key2 === \"object\")\n if (key2 instanceof KeyObject || key2 instanceof CryptoKey) {\n if (key2.type === \"private\")\n return KeyObject.from(createPublicKey({ key: key2[kCryptoKey] || key2, format: \"\" }));\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key2.type}, expected private`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n } else {\n if (key2.passphrase) {\n let actual_key2 = key2.key;\n if (typeof actual_key2 === \"string\")\n actual_key2 = Buffer.from(actual_key2, key2.encoding || \"utf8\");\n return KeyObject.from(createPublicKey({\n key: createPrivateKey({ key: actual_key2, format: key2.format, passphrase: key2.passphrase }),\n format: \"\"\n }));\n }\n let actual_key = key2.key;\n if (typeof actual_key === \"string\")\n actual_key = Buffer.from(actual_key, key2.encoding || \"utf8\"), key2.key = actual_key;\n else if (actual_key instanceof KeyObject || actual_key instanceof CryptoKey) {\n if (actual_key.type === \"private\")\n return KeyObject.from(createPublicKey({ key: actual_key[kCryptoKey] || actual_key, format: \"\" }));\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${actual_key.type}, expected private`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n }\n if (!isAnyArrayBuffer(actual_key) && !isArrayBufferView(actual_key) && typeof actual_key !== \"object\") {\n var error = @makeTypeError('ERR_INVALID_ARG_TYPE: The \"key\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ' + key2);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n if (!key2.format)\n key2.format = \"pem\";\n return KeyObject.from(createPublicKey(key2));\n }\n else {\n var error = @makeTypeError('ERR_INVALID_ARG_TYPE: The \"key\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ' + key2);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n}, $, __defProp = Object.defineProperty, __getOwnPropNames = Object.getOwnPropertyNames, StreamModule = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), BufferModule = @requireNativeModule(\"buffer\"), StringDecoder = @requireNativeModule(\"string_decoder\").StringDecoder, MAX_STRING_LENGTH = 536870888, Buffer = globalThis.Buffer, EMPTY_BUFFER = Buffer.alloc(0), { isAnyArrayBuffer, isArrayBufferView } = @requireNativeModule(\"util/types\"), crypto = globalThis.crypto, globalCrypto = crypto, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: !0 });\n}, require_safe_buffer = __commonJS({\n \"node_modules/safe-buffer/index.js\"(exports, module) {\n var buffer = BufferModule, Buffer2 = buffer.Buffer;\n function copyProps(src, dst) {\n for (var key2 in src)\n dst[key2] = src[key2];\n }\n Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow \? module.exports = buffer : (copyProps(buffer, exports), exports.Buffer = SafeBuffer);\n function SafeBuffer(arg, encodingOrOffset, length) {\n return Buffer2(arg, encodingOrOffset, length);\n }\n SafeBuffer.prototype = Object.create(Buffer2.prototype), copyProps(Buffer2, SafeBuffer), SafeBuffer.from = function(arg, encodingOrOffset, length) {\n if (typeof arg == \"number\")\n @throwTypeError(\"Argument must not be a number\");\n return Buffer2(arg, encodingOrOffset, length);\n }, SafeBuffer.alloc = function(size, fill, encoding) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n var buf = Buffer2(size);\n return fill !== void 0 \? typeof encoding == \"string\" \? buf.fill(fill, encoding) : buf.fill(fill) : buf.fill(0), buf;\n }, SafeBuffer.allocUnsafe = function(size) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n return Buffer2(size);\n }, SafeBuffer.allocUnsafeSlow = function(size) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n return buffer.SlowBuffer(size);\n };\n }\n}), require_browser = __commonJS({\n \"node_modules/randombytes/browser.js\"(exports, module) {\n var MAX_BYTES = 65536, MAX_UINT32 = 4294967295;\n function oldBrowser() {\n throw new Error(`Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11`);\n }\n var Buffer2 = require_safe_buffer().Buffer, crypto2 = globalCrypto;\n crypto2 && crypto2.getRandomValues \? module.exports = randomBytes : module.exports = oldBrowser;\n function randomBytes(size, cb) {\n if (size > MAX_UINT32)\n @throwRangeError(\"requested too many random bytes\");\n var bytes = Buffer2.allocUnsafe(size);\n if (size > 0)\n if (size > MAX_BYTES)\n for (var generated = 0;generated < size; generated += MAX_BYTES)\n crypto2.getRandomValues(bytes.slice(generated, generated + MAX_BYTES));\n else\n crypto2.getRandomValues(bytes);\n return typeof cb == \"function\" \? process.nextTick(function() {\n cb(null, bytes);\n }) : bytes;\n }\n }\n}), require_inherits_browser = __commonJS({\n \"node_modules/inherits/inherits_browser.js\"(exports, module) {\n module.exports = function(ctor, superCtor) {\n superCtor && (ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }));\n };\n }\n}), require_hash_base = __commonJS({\n \"node_modules/hash-base/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, inherits = require_inherits_browser();\n function throwIfNotStringOrBuffer(val, prefix) {\n if (!Buffer2.isBuffer(val) && typeof val != \"string\")\n @throwTypeError(prefix + \" must be a string or a buffer\");\n }\n function HashBase(blockSize) {\n StreamModule.Transform.@call(this), this._block = Buffer2.allocUnsafe(blockSize), this._blockSize = blockSize, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = !1;\n }\n inherits(HashBase, StreamModule.Transform), HashBase.prototype._transform = function(chunk, encoding, callback) {\n var error = null;\n try {\n this.update(chunk, encoding);\n } catch (err) {\n error = err;\n }\n callback(error);\n }, HashBase.prototype._flush = function(callback) {\n var error = null;\n try {\n this.push(this.digest());\n } catch (err) {\n error = err;\n }\n callback(error);\n }, HashBase.prototype.update = function(data, encoding) {\n if (throwIfNotStringOrBuffer(data, \"Data\"), this._finalized)\n throw new Error(\"Digest already called\");\n Buffer2.isBuffer(data) || (data = Buffer2.from(data, encoding));\n for (var block = this._block, offset = 0;this._blockOffset + data.length - offset >= this._blockSize; ) {\n for (var i = this._blockOffset;i < this._blockSize; )\n block[i++] = data[offset++];\n this._update(), this._blockOffset = 0;\n }\n for (;offset < data.length; )\n block[this._blockOffset++] = data[offset++];\n for (var j = 0, carry = data.length * 8;carry > 0; ++j)\n this._length[j] += carry, carry = this._length[j] / 4294967296 | 0, carry > 0 && (this._length[j] -= 4294967296 * carry);\n return this;\n }, HashBase.prototype._update = function() {\n throw new Error(\"_update is not implemented\");\n }, HashBase.prototype.digest = function(encoding) {\n if (this._finalized)\n throw new Error(\"Digest already called\");\n this._finalized = !0;\n var digest = this._digest();\n encoding !== void 0 && (digest = digest.toString(encoding)), this._block.fill(0), this._blockOffset = 0;\n for (var i = 0;i < 4; ++i)\n this._length[i] = 0;\n return digest;\n }, HashBase.prototype._digest = function() {\n throw new Error(\"_digest is not implemented\");\n }, module.exports = HashBase;\n }\n}), require_md5 = __commonJS({\n \"node_modules/md5.js/index.js\"(exports, module) {\n var inherits = require_inherits_browser(), HashBase = require_hash_base(), Buffer2 = require_safe_buffer().Buffer, ARRAY16 = new @Array(16);\n function MD5() {\n HashBase.@call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878;\n }\n inherits(MD5, HashBase), MD5.prototype._update = function() {\n for (var M = ARRAY16, i = 0;i < 16; ++i)\n M[i] = this._block.readInt32LE(i * 4);\n var a = this._a, b = this._b, c = this._c, d = this._d;\n a = fnF(a, b, c, d, M[0], 3614090360, 7), d = fnF(d, a, b, c, M[1], 3905402710, 12), c = fnF(c, d, a, b, M[2], 606105819, 17), b = fnF(b, c, d, a, M[3], 3250441966, 22), a = fnF(a, b, c, d, M[4], 4118548399, 7), d = fnF(d, a, b, c, M[5], 1200080426, 12), c = fnF(c, d, a, b, M[6], 2821735955, 17), b = fnF(b, c, d, a, M[7], 4249261313, 22), a = fnF(a, b, c, d, M[8], 1770035416, 7), d = fnF(d, a, b, c, M[9], 2336552879, 12), c = fnF(c, d, a, b, M[10], 4294925233, 17), b = fnF(b, c, d, a, M[11], 2304563134, 22), a = fnF(a, b, c, d, M[12], 1804603682, 7), d = fnF(d, a, b, c, M[13], 4254626195, 12), c = fnF(c, d, a, b, M[14], 2792965006, 17), b = fnF(b, c, d, a, M[15], 1236535329, 22), a = fnG(a, b, c, d, M[1], 4129170786, 5), d = fnG(d, a, b, c, M[6], 3225465664, 9), c = fnG(c, d, a, b, M[11], 643717713, 14), b = fnG(b, c, d, a, M[0], 3921069994, 20), a = fnG(a, b, c, d, M[5], 3593408605, 5), d = fnG(d, a, b, c, M[10], 38016083, 9), c = fnG(c, d, a, b, M[15], 3634488961, 14), b = fnG(b, c, d, a, M[4], 3889429448, 20), a = fnG(a, b, c, d, M[9], 568446438, 5), d = fnG(d, a, b, c, M[14], 3275163606, 9), c = fnG(c, d, a, b, M[3], 4107603335, 14), b = fnG(b, c, d, a, M[8], 1163531501, 20), a = fnG(a, b, c, d, M[13], 2850285829, 5), d = fnG(d, a, b, c, M[2], 4243563512, 9), c = fnG(c, d, a, b, M[7], 1735328473, 14), b = fnG(b, c, d, a, M[12], 2368359562, 20), a = fnH(a, b, c, d, M[5], 4294588738, 4), d = fnH(d, a, b, c, M[8], 2272392833, 11), c = fnH(c, d, a, b, M[11], 1839030562, 16), b = fnH(b, c, d, a, M[14], 4259657740, 23), a = fnH(a, b, c, d, M[1], 2763975236, 4), d = fnH(d, a, b, c, M[4], 1272893353, 11), c = fnH(c, d, a, b, M[7], 4139469664, 16), b = fnH(b, c, d, a, M[10], 3200236656, 23), a = fnH(a, b, c, d, M[13], 681279174, 4), d = fnH(d, a, b, c, M[0], 3936430074, 11), c = fnH(c, d, a, b, M[3], 3572445317, 16), b = fnH(b, c, d, a, M[6], 76029189, 23), a = fnH(a, b, c, d, M[9], 3654602809, 4), d = fnH(d, a, b, c, M[12], 3873151461, 11), c = fnH(c, d, a, b, M[15], 530742520, 16), b = fnH(b, c, d, a, M[2], 3299628645, 23), a = fnI(a, b, c, d, M[0], 4096336452, 6), d = fnI(d, a, b, c, M[7], 1126891415, 10), c = fnI(c, d, a, b, M[14], 2878612391, 15), b = fnI(b, c, d, a, M[5], 4237533241, 21), a = fnI(a, b, c, d, M[12], 1700485571, 6), d = fnI(d, a, b, c, M[3], 2399980690, 10), c = fnI(c, d, a, b, M[10], 4293915773, 15), b = fnI(b, c, d, a, M[1], 2240044497, 21), a = fnI(a, b, c, d, M[8], 1873313359, 6), d = fnI(d, a, b, c, M[15], 4264355552, 10), c = fnI(c, d, a, b, M[6], 2734768916, 15), b = fnI(b, c, d, a, M[13], 1309151649, 21), a = fnI(a, b, c, d, M[4], 4149444226, 6), d = fnI(d, a, b, c, M[11], 3174756917, 10), c = fnI(c, d, a, b, M[2], 718787259, 15), b = fnI(b, c, d, a, M[9], 3951481745, 21), this._a = this._a + a | 0, this._b = this._b + b | 0, this._c = this._c + c | 0, this._d = this._d + d | 0;\n }, MD5.prototype._digest = function() {\n this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();\n var buffer = Buffer2.allocUnsafe(16);\n return buffer.writeInt32LE(this._a, 0), buffer.writeInt32LE(this._b, 4), buffer.writeInt32LE(this._c, 8), buffer.writeInt32LE(this._d, 12), buffer;\n };\n function rotl(x, n) {\n return x << n | x >>> 32 - n;\n }\n function fnF(a, b, c, d, m, k, s) {\n return rotl(a + (b & c | ~b & d) + m + k | 0, s) + b | 0;\n }\n function fnG(a, b, c, d, m, k, s) {\n return rotl(a + (b & d | c & ~d) + m + k | 0, s) + b | 0;\n }\n function fnH(a, b, c, d, m, k, s) {\n return rotl(a + (b ^ c ^ d) + m + k | 0, s) + b | 0;\n }\n function fnI(a, b, c, d, m, k, s) {\n return rotl(a + (c ^ (b | ~d)) + m + k | 0, s) + b | 0;\n }\n module.exports = MD5;\n }\n}), require_ripemd160 = __commonJS({\n \"node_modules/ripemd160/index.js\"(exports, module) {\n var Buffer2 = Buffer, inherits = require_inherits_browser(), HashBase = require_hash_base(), ARRAY16 = new @Array(16), zl = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 7,\n 4,\n 13,\n 1,\n 10,\n 6,\n 15,\n 3,\n 12,\n 0,\n 9,\n 5,\n 2,\n 14,\n 11,\n 8,\n 3,\n 10,\n 14,\n 4,\n 9,\n 15,\n 8,\n 1,\n 2,\n 7,\n 0,\n 6,\n 13,\n 11,\n 5,\n 12,\n 1,\n 9,\n 11,\n 10,\n 0,\n 8,\n 12,\n 4,\n 13,\n 3,\n 7,\n 15,\n 14,\n 5,\n 6,\n 2,\n 4,\n 0,\n 5,\n 9,\n 7,\n 12,\n 2,\n 10,\n 14,\n 1,\n 3,\n 8,\n 11,\n 6,\n 15,\n 13\n ], zr = [\n 5,\n 14,\n 7,\n 0,\n 9,\n 2,\n 11,\n 4,\n 13,\n 6,\n 15,\n 8,\n 1,\n 10,\n 3,\n 12,\n 6,\n 11,\n 3,\n 7,\n 0,\n 13,\n 5,\n 10,\n 14,\n 15,\n 8,\n 12,\n 4,\n 9,\n 1,\n 2,\n 15,\n 5,\n 1,\n 3,\n 7,\n 14,\n 6,\n 9,\n 11,\n 8,\n 12,\n 2,\n 10,\n 0,\n 4,\n 13,\n 8,\n 6,\n 4,\n 1,\n 3,\n 11,\n 15,\n 0,\n 5,\n 12,\n 2,\n 13,\n 9,\n 7,\n 10,\n 14,\n 12,\n 15,\n 10,\n 4,\n 1,\n 5,\n 8,\n 7,\n 6,\n 2,\n 13,\n 14,\n 0,\n 3,\n 9,\n 11\n ], sl = [\n 11,\n 14,\n 15,\n 12,\n 5,\n 8,\n 7,\n 9,\n 11,\n 13,\n 14,\n 15,\n 6,\n 7,\n 9,\n 8,\n 7,\n 6,\n 8,\n 13,\n 11,\n 9,\n 7,\n 15,\n 7,\n 12,\n 15,\n 9,\n 11,\n 7,\n 13,\n 12,\n 11,\n 13,\n 6,\n 7,\n 14,\n 9,\n 13,\n 15,\n 14,\n 8,\n 13,\n 6,\n 5,\n 12,\n 7,\n 5,\n 11,\n 12,\n 14,\n 15,\n 14,\n 15,\n 9,\n 8,\n 9,\n 14,\n 5,\n 6,\n 8,\n 6,\n 5,\n 12,\n 9,\n 15,\n 5,\n 11,\n 6,\n 8,\n 13,\n 12,\n 5,\n 12,\n 13,\n 14,\n 11,\n 8,\n 5,\n 6\n ], sr = [\n 8,\n 9,\n 9,\n 11,\n 13,\n 15,\n 15,\n 5,\n 7,\n 7,\n 8,\n 11,\n 14,\n 14,\n 12,\n 6,\n 9,\n 13,\n 15,\n 7,\n 12,\n 8,\n 9,\n 11,\n 7,\n 7,\n 12,\n 7,\n 6,\n 15,\n 13,\n 11,\n 9,\n 7,\n 15,\n 11,\n 8,\n 6,\n 6,\n 14,\n 12,\n 13,\n 5,\n 14,\n 13,\n 13,\n 7,\n 5,\n 15,\n 5,\n 8,\n 11,\n 14,\n 14,\n 6,\n 14,\n 6,\n 9,\n 12,\n 9,\n 12,\n 5,\n 15,\n 8,\n 8,\n 5,\n 12,\n 9,\n 12,\n 5,\n 14,\n 6,\n 8,\n 13,\n 6,\n 5,\n 15,\n 13,\n 11,\n 11\n ], hl = [0, 1518500249, 1859775393, 2400959708, 2840853838], hr = [1352829926, 1548603684, 1836072691, 2053994217, 0];\n function RIPEMD160() {\n HashBase.@call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520;\n }\n inherits(RIPEMD160, HashBase), RIPEMD160.prototype._update = function() {\n for (var words = ARRAY16, j = 0;j < 16; ++j)\n words[j] = this._block.readInt32LE(j * 4);\n for (var al = this._a | 0, bl = this._b | 0, cl = this._c | 0, dl = this._d | 0, el = this._e | 0, ar = this._a | 0, br = this._b | 0, cr = this._c | 0, dr = this._d | 0, er = this._e | 0, i = 0;i < 80; i += 1) {\n var tl, tr;\n i < 16 \? (tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i]), tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])) : i < 32 \? (tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i]), tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])) : i < 48 \? (tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i]), tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])) : i < 64 \? (tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i]), tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])) : (tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i]), tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])), al = el, el = dl, dl = rotl(cl, 10), cl = bl, bl = tl, ar = er, er = dr, dr = rotl(cr, 10), cr = br, br = tr;\n }\n var t = this._b + cl + dr | 0;\n this._b = this._c + dl + er | 0, this._c = this._d + el + ar | 0, this._d = this._e + al + br | 0, this._e = this._a + bl + cr | 0, this._a = t;\n }, RIPEMD160.prototype._digest = function() {\n this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();\n var buffer = Buffer2.alloc \? Buffer2.alloc(20) : new Buffer2(20);\n return buffer.writeInt32LE(this._a, 0), buffer.writeInt32LE(this._b, 4), buffer.writeInt32LE(this._c, 8), buffer.writeInt32LE(this._d, 12), buffer.writeInt32LE(this._e, 16), buffer;\n };\n function rotl(x, n) {\n return x << n | x >>> 32 - n;\n }\n function fn1(a, b, c, d, e, m, k, s) {\n return rotl(a + (b ^ c ^ d) + m + k | 0, s) + e | 0;\n }\n function fn2(a, b, c, d, e, m, k, s) {\n return rotl(a + (b & c | ~b & d) + m + k | 0, s) + e | 0;\n }\n function fn3(a, b, c, d, e, m, k, s) {\n return rotl(a + ((b | ~c) ^ d) + m + k | 0, s) + e | 0;\n }\n function fn4(a, b, c, d, e, m, k, s) {\n return rotl(a + (b & d | c & ~d) + m + k | 0, s) + e | 0;\n }\n function fn5(a, b, c, d, e, m, k, s) {\n return rotl(a + (b ^ (c | ~d)) + m + k | 0, s) + e | 0;\n }\n module.exports = RIPEMD160;\n }\n}), require_hash = __commonJS({\n \"node_modules/sha.js/hash.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n function Hash(blockSize, finalSize) {\n this._block = Buffer2.alloc(blockSize), this._finalSize = finalSize, this._blockSize = blockSize, this._len = 0;\n }\n Hash.prototype = {}, Hash.prototype.update = function(data, enc) {\n typeof data == \"string\" && (enc = enc || \"utf8\", data = Buffer2.from(data, enc));\n for (var block = this._block, blockSize = this._blockSize, length = data.length, accum = this._len, offset = 0;offset < length; ) {\n for (var assigned = accum % blockSize, remainder = Math.min(length - offset, blockSize - assigned), i = 0;i < remainder; i++)\n block[assigned + i] = data[offset + i];\n accum += remainder, offset += remainder, accum % blockSize === 0 && this._update(block);\n }\n return this._len += length, this;\n }, Hash.prototype.digest = function(enc) {\n var rem = this._len % this._blockSize;\n this._block[rem] = 128, this._block.fill(0, rem + 1), rem >= this._finalSize && (this._update(this._block), this._block.fill(0));\n var bits = this._len * 8;\n if (bits <= 4294967295)\n this._block.writeUInt32BE(bits, this._blockSize - 4);\n else {\n var lowBits = (bits & 4294967295) >>> 0, highBits = (bits - lowBits) / 4294967296;\n this._block.writeUInt32BE(highBits, this._blockSize - 8), this._block.writeUInt32BE(lowBits, this._blockSize - 4);\n }\n this._update(this._block);\n var hash = this._hash();\n return enc \? hash.toString(enc) : hash;\n }, Hash.prototype._update = function() {\n throw new Error(\"_update must be implemented by subclass\");\n }, module.exports = Hash;\n }\n}), require_sha = __commonJS({\n \"node_modules/sha.js/sha.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [1518500249, 1859775393, -1894007588, -899497514], W = new @Array(80);\n function Sha() {\n this.init(), this._w = W, Hash.@call(this, 64, 56);\n }\n inherits(Sha, Hash), Sha.prototype.init = function() {\n return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;\n };\n function rotl5(num) {\n return num << 5 | num >>> 27;\n }\n function rotl30(num) {\n return num << 30 | num >>> 2;\n }\n function ft(s, b, c, d) {\n return s === 0 \? b & c | ~b & d : s === 2 \? b & c | b & d | c & d : b ^ c ^ d;\n }\n Sha.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 80; ++i)\n W2[i] = W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16];\n for (var j = 0;j < 80; ++j) {\n var s = ~~(j / 20), t = rotl5(a) + ft(s, b, c, d) + e + W2[j] + K[s] | 0;\n e = d, d = c, c = rotl30(b), b = a, a = t;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0;\n }, Sha.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(20);\n return H.writeInt32BE(this._a | 0, 0), H.writeInt32BE(this._b | 0, 4), H.writeInt32BE(this._c | 0, 8), H.writeInt32BE(this._d | 0, 12), H.writeInt32BE(this._e | 0, 16), H;\n }, module.exports = Sha;\n }\n}), require_sha1 = __commonJS({\n \"node_modules/sha.js/sha1.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [1518500249, 1859775393, -1894007588, -899497514], W = new @Array(80);\n function Sha1() {\n this.init(), this._w = W, Hash.@call(this, 64, 56);\n }\n inherits(Sha1, Hash), Sha1.prototype.init = function() {\n return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;\n };\n function rotl1(num) {\n return num << 1 | num >>> 31;\n }\n function rotl5(num) {\n return num << 5 | num >>> 27;\n }\n function rotl30(num) {\n return num << 30 | num >>> 2;\n }\n function ft(s, b, c, d) {\n return s === 0 \? b & c | ~b & d : s === 2 \? b & c | b & d | c & d : b ^ c ^ d;\n }\n Sha1.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 80; ++i)\n W2[i] = rotl1(W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16]);\n for (var j = 0;j < 80; ++j) {\n var s = ~~(j / 20), t = rotl5(a) + ft(s, b, c, d) + e + W2[j] + K[s] | 0;\n e = d, d = c, c = rotl30(b), b = a, a = t;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0;\n }, Sha1.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(20);\n return H.writeInt32BE(this._a | 0, 0), H.writeInt32BE(this._b | 0, 4), H.writeInt32BE(this._c | 0, 8), H.writeInt32BE(this._d | 0, 12), H.writeInt32BE(this._e | 0, 16), H;\n }, module.exports = Sha1;\n }\n}), require_sha256 = __commonJS({\n \"node_modules/sha.js/sha256.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [\n 1116352408,\n 1899447441,\n 3049323471,\n 3921009573,\n 961987163,\n 1508970993,\n 2453635748,\n 2870763221,\n 3624381080,\n 310598401,\n 607225278,\n 1426881987,\n 1925078388,\n 2162078206,\n 2614888103,\n 3248222580,\n 3835390401,\n 4022224774,\n 264347078,\n 604807628,\n 770255983,\n 1249150122,\n 1555081692,\n 1996064986,\n 2554220882,\n 2821834349,\n 2952996808,\n 3210313671,\n 3336571891,\n 3584528711,\n 113926993,\n 338241895,\n 666307205,\n 773529912,\n 1294757372,\n 1396182291,\n 1695183700,\n 1986661051,\n 2177026350,\n 2456956037,\n 2730485921,\n 2820302411,\n 3259730800,\n 3345764771,\n 3516065817,\n 3600352804,\n 4094571909,\n 275423344,\n 430227734,\n 506948616,\n 659060556,\n 883997877,\n 958139571,\n 1322822218,\n 1537002063,\n 1747873779,\n 1955562222,\n 2024104815,\n 2227730452,\n 2361852424,\n 2428436474,\n 2756734187,\n 3204031479,\n 3329325298\n ], W = new @Array(64);\n function Sha256() {\n this.init(), this._w = W, Hash.@call(this, 64, 56);\n }\n inherits(Sha256, Hash), Sha256.prototype.init = function() {\n return this._a = 1779033703, this._b = 3144134277, this._c = 1013904242, this._d = 2773480762, this._e = 1359893119, this._f = 2600822924, this._g = 528734635, this._h = 1541459225, this;\n };\n function ch(x, y, z) {\n return z ^ x & (y ^ z);\n }\n function maj(x, y, z) {\n return x & y | z & (x | y);\n }\n function sigma0(x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10);\n }\n function sigma1(x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7);\n }\n function gamma0(x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ x >>> 3;\n }\n function gamma1(x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ x >>> 10;\n }\n Sha256.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, f = this._f | 0, g = this._g | 0, h = this._h | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 64; ++i)\n W2[i] = gamma1(W2[i - 2]) + W2[i - 7] + gamma0(W2[i - 15]) + W2[i - 16] | 0;\n for (var j = 0;j < 64; ++j) {\n var T1 = h + sigma1(e) + ch(e, f, g) + K[j] + W2[j] | 0, T2 = sigma0(a) + maj(a, b, c) | 0;\n h = g, g = f, f = e, e = d + T1 | 0, d = c, c = b, b = a, a = T1 + T2 | 0;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0, this._f = f + this._f | 0, this._g = g + this._g | 0, this._h = h + this._h | 0;\n }, Sha256.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(32);\n return H.writeInt32BE(this._a, 0), H.writeInt32BE(this._b, 4), H.writeInt32BE(this._c, 8), H.writeInt32BE(this._d, 12), H.writeInt32BE(this._e, 16), H.writeInt32BE(this._f, 20), H.writeInt32BE(this._g, 24), H.writeInt32BE(this._h, 28), H;\n }, module.exports = Sha256;\n }\n}), require_sha224 = __commonJS({\n \"node_modules/sha.js/sha224.js\"(exports, module) {\n var inherits = require_inherits_browser(), Sha256 = require_sha256(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, W = new @Array(64);\n function Sha224() {\n this.init(), this._w = W, Hash.@call(this, 64, 56);\n }\n inherits(Sha224, Sha256), Sha224.prototype.init = function() {\n return this._a = 3238371032, this._b = 914150663, this._c = 812702999, this._d = 4144912697, this._e = 4290775857, this._f = 1750603025, this._g = 1694076839, this._h = 3204075428, this;\n }, Sha224.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(28);\n return H.writeInt32BE(this._a, 0), H.writeInt32BE(this._b, 4), H.writeInt32BE(this._c, 8), H.writeInt32BE(this._d, 12), H.writeInt32BE(this._e, 16), H.writeInt32BE(this._f, 20), H.writeInt32BE(this._g, 24), H;\n }, module.exports = Sha224;\n }\n}), require_sha512 = __commonJS({\n \"node_modules/sha.js/sha512.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [\n 1116352408,\n 3609767458,\n 1899447441,\n 602891725,\n 3049323471,\n 3964484399,\n 3921009573,\n 2173295548,\n 961987163,\n 4081628472,\n 1508970993,\n 3053834265,\n 2453635748,\n 2937671579,\n 2870763221,\n 3664609560,\n 3624381080,\n 2734883394,\n 310598401,\n 1164996542,\n 607225278,\n 1323610764,\n 1426881987,\n 3590304994,\n 1925078388,\n 4068182383,\n 2162078206,\n 991336113,\n 2614888103,\n 633803317,\n 3248222580,\n 3479774868,\n 3835390401,\n 2666613458,\n 4022224774,\n 944711139,\n 264347078,\n 2341262773,\n 604807628,\n 2007800933,\n 770255983,\n 1495990901,\n 1249150122,\n 1856431235,\n 1555081692,\n 3175218132,\n 1996064986,\n 2198950837,\n 2554220882,\n 3999719339,\n 2821834349,\n 766784016,\n 2952996808,\n 2566594879,\n 3210313671,\n 3203337956,\n 3336571891,\n 1034457026,\n 3584528711,\n 2466948901,\n 113926993,\n 3758326383,\n 338241895,\n 168717936,\n 666307205,\n 1188179964,\n 773529912,\n 1546045734,\n 1294757372,\n 1522805485,\n 1396182291,\n 2643833823,\n 1695183700,\n 2343527390,\n 1986661051,\n 1014477480,\n 2177026350,\n 1206759142,\n 2456956037,\n 344077627,\n 2730485921,\n 1290863460,\n 2820302411,\n 3158454273,\n 3259730800,\n 3505952657,\n 3345764771,\n 106217008,\n 3516065817,\n 3606008344,\n 3600352804,\n 1432725776,\n 4094571909,\n 1467031594,\n 275423344,\n 851169720,\n 430227734,\n 3100823752,\n 506948616,\n 1363258195,\n 659060556,\n 3750685593,\n 883997877,\n 3785050280,\n 958139571,\n 3318307427,\n 1322822218,\n 3812723403,\n 1537002063,\n 2003034995,\n 1747873779,\n 3602036899,\n 1955562222,\n 1575990012,\n 2024104815,\n 1125592928,\n 2227730452,\n 2716904306,\n 2361852424,\n 442776044,\n 2428436474,\n 593698344,\n 2756734187,\n 3733110249,\n 3204031479,\n 2999351573,\n 3329325298,\n 3815920427,\n 3391569614,\n 3928383900,\n 3515267271,\n 566280711,\n 3940187606,\n 3454069534,\n 4118630271,\n 4000239992,\n 116418474,\n 1914138554,\n 174292421,\n 2731055270,\n 289380356,\n 3203993006,\n 460393269,\n 320620315,\n 685471733,\n 587496836,\n 852142971,\n 1086792851,\n 1017036298,\n 365543100,\n 1126000580,\n 2618297676,\n 1288033470,\n 3409855158,\n 1501505948,\n 4234509866,\n 1607167915,\n 987167468,\n 1816402316,\n 1246189591\n ], W = new @Array(160);\n function Sha512() {\n this.init(), this._w = W, Hash.@call(this, 128, 112);\n }\n inherits(Sha512, Hash), Sha512.prototype.init = function() {\n return this._ah = 1779033703, this._bh = 3144134277, this._ch = 1013904242, this._dh = 2773480762, this._eh = 1359893119, this._fh = 2600822924, this._gh = 528734635, this._hh = 1541459225, this._al = 4089235720, this._bl = 2227873595, this._cl = 4271175723, this._dl = 1595750129, this._el = 2917565137, this._fl = 725511199, this._gl = 4215389547, this._hl = 327033209, this;\n };\n function Ch(x, y, z) {\n return z ^ x & (y ^ z);\n }\n function maj(x, y, z) {\n return x & y | z & (x | y);\n }\n function sigma0(x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25);\n }\n function sigma1(x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23);\n }\n function Gamma0(x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ x >>> 7;\n }\n function Gamma0l(x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25);\n }\n function Gamma1(x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ x >>> 6;\n }\n function Gamma1l(x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26);\n }\n function getCarry(a, b) {\n return a >>> 0 < b >>> 0 \? 1 : 0;\n }\n Sha512.prototype._update = function(M) {\n for (var W2 = this._w, ah = this._ah | 0, bh = this._bh | 0, ch = this._ch | 0, dh = this._dh | 0, eh = this._eh | 0, fh = this._fh | 0, gh = this._gh | 0, hh = this._hh | 0, al = this._al | 0, bl = this._bl | 0, cl = this._cl | 0, dl = this._dl | 0, el = this._el | 0, fl = this._fl | 0, gl = this._gl | 0, hl = this._hl | 0, i = 0;i < 32; i += 2)\n W2[i] = M.readInt32BE(i * 4), W2[i + 1] = M.readInt32BE(i * 4 + 4);\n for (;i < 160; i += 2) {\n var xh = W2[i - 30], xl = W2[i - 30 + 1], gamma0 = Gamma0(xh, xl), gamma0l = Gamma0l(xl, xh);\n xh = W2[i - 4], xl = W2[i - 4 + 1];\n var gamma1 = Gamma1(xh, xl), gamma1l = Gamma1l(xl, xh), Wi7h = W2[i - 14], Wi7l = W2[i - 14 + 1], Wi16h = W2[i - 32], Wi16l = W2[i - 32 + 1], Wil = gamma0l + Wi7l | 0, Wih = gamma0 + Wi7h + getCarry(Wil, gamma0l) | 0;\n Wil = Wil + gamma1l | 0, Wih = Wih + gamma1 + getCarry(Wil, gamma1l) | 0, Wil = Wil + Wi16l | 0, Wih = Wih + Wi16h + getCarry(Wil, Wi16l) | 0, W2[i] = Wih, W2[i + 1] = Wil;\n }\n for (var j = 0;j < 160; j += 2) {\n Wih = W2[j], Wil = W2[j + 1];\n var majh = maj(ah, bh, ch), majl = maj(al, bl, cl), sigma0h = sigma0(ah, al), sigma0l = sigma0(al, ah), sigma1h = sigma1(eh, el), sigma1l = sigma1(el, eh), Kih = K[j], Kil = K[j + 1], chh = Ch(eh, fh, gh), chl = Ch(el, fl, gl), t1l = hl + sigma1l | 0, t1h = hh + sigma1h + getCarry(t1l, hl) | 0;\n t1l = t1l + chl | 0, t1h = t1h + chh + getCarry(t1l, chl) | 0, t1l = t1l + Kil | 0, t1h = t1h + Kih + getCarry(t1l, Kil) | 0, t1l = t1l + Wil | 0, t1h = t1h + Wih + getCarry(t1l, Wil) | 0;\n var t2l = sigma0l + majl | 0, t2h = sigma0h + majh + getCarry(t2l, sigma0l) | 0;\n hh = gh, hl = gl, gh = fh, gl = fl, fh = eh, fl = el, el = dl + t1l | 0, eh = dh + t1h + getCarry(el, dl) | 0, dh = ch, dl = cl, ch = bh, cl = bl, bh = ah, bl = al, al = t1l + t2l | 0, ah = t1h + t2h + getCarry(al, t1l) | 0;\n }\n this._al = this._al + al | 0, this._bl = this._bl + bl | 0, this._cl = this._cl + cl | 0, this._dl = this._dl + dl | 0, this._el = this._el + el | 0, this._fl = this._fl + fl | 0, this._gl = this._gl + gl | 0, this._hl = this._hl + hl | 0, this._ah = this._ah + ah + getCarry(this._al, al) | 0, this._bh = this._bh + bh + getCarry(this._bl, bl) | 0, this._ch = this._ch + ch + getCarry(this._cl, cl) | 0, this._dh = this._dh + dh + getCarry(this._dl, dl) | 0, this._eh = this._eh + eh + getCarry(this._el, el) | 0, this._fh = this._fh + fh + getCarry(this._fl, fl) | 0, this._gh = this._gh + gh + getCarry(this._gl, gl) | 0, this._hh = this._hh + hh + getCarry(this._hl, hl) | 0;\n }, Sha512.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(64);\n function writeInt64BE(h, l, offset) {\n H.writeInt32BE(h, offset), H.writeInt32BE(l, offset + 4);\n }\n return writeInt64BE(this._ah, this._al, 0), writeInt64BE(this._bh, this._bl, 8), writeInt64BE(this._ch, this._cl, 16), writeInt64BE(this._dh, this._dl, 24), writeInt64BE(this._eh, this._el, 32), writeInt64BE(this._fh, this._fl, 40), writeInt64BE(this._gh, this._gl, 48), writeInt64BE(this._hh, this._hl, 56), H;\n }, module.exports = Sha512;\n }\n}), require_sha384 = __commonJS({\n \"node_modules/sha.js/sha384.js\"(exports, module) {\n var inherits = require_inherits_browser(), SHA512 = require_sha512(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, W = new @Array(160);\n function Sha384() {\n this.init(), this._w = W, Hash.@call(this, 128, 112);\n }\n inherits(Sha384, SHA512), Sha384.prototype.init = function() {\n return this._ah = 3418070365, this._bh = 1654270250, this._ch = 2438529370, this._dh = 355462360, this._eh = 1731405415, this._fh = 2394180231, this._gh = 3675008525, this._hh = 1203062813, this._al = 3238371032, this._bl = 914150663, this._cl = 812702999, this._dl = 4144912697, this._el = 4290775857, this._fl = 1750603025, this._gl = 1694076839, this._hl = 3204075428, this;\n }, Sha384.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(48);\n function writeInt64BE(h, l, offset) {\n H.writeInt32BE(h, offset), H.writeInt32BE(l, offset + 4);\n }\n return writeInt64BE(this._ah, this._al, 0), writeInt64BE(this._bh, this._bl, 8), writeInt64BE(this._ch, this._cl, 16), writeInt64BE(this._dh, this._dl, 24), writeInt64BE(this._eh, this._el, 32), writeInt64BE(this._fh, this._fl, 40), H;\n }, module.exports = Sha384;\n }\n}), require_sha2 = __commonJS({\n \"node_modules/sha.js/index.js\"(exports, module) {\n var exports = module.exports = function(algorithm) {\n algorithm = algorithm.toLowerCase();\n var Algorithm = exports[algorithm];\n if (!Algorithm)\n throw new Error(algorithm + \" is not supported (we accept pull requests)\");\n return new Algorithm;\n };\n exports.sha = require_sha(), exports.sha1 = require_sha1(), exports.sha224 = require_sha224(), exports.sha256 = require_sha256(), exports.sha384 = require_sha384(), exports.sha512 = require_sha512();\n }\n}), require_cipher_base = __commonJS({\n \"node_modules/cipher-base/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, inherits = require_inherits_browser();\n function CipherBase(hashMode) {\n StreamModule.Transform.@call(this), this.hashMode = typeof hashMode == \"string\", this.hashMode \? this[hashMode] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null, this._finalized = !1;\n }\n inherits(CipherBase, StreamModule.Transform), CipherBase.prototype.update = function(data, inputEnc, outputEnc) {\n if (outputEnc === \"buffer\")\n outputEnc = @undefined;\n typeof data == \"string\" && (data = Buffer2.from(data, inputEnc));\n var outData = this._update(data);\n return this.hashMode \? this : (outputEnc && (outData = this._toString(outData, outputEnc)), outData);\n }, CipherBase.prototype.setAutoPadding = function() {\n }, CipherBase.prototype.getAuthTag = function() {\n throw new Error(\"trying to get auth tag in unsupported state\");\n }, CipherBase.prototype.setAuthTag = function() {\n throw new Error(\"trying to set auth tag in unsupported state\");\n }, CipherBase.prototype.setAAD = function() {\n throw new Error(\"trying to set aad in unsupported state\");\n }, CipherBase.prototype._transform = function(data, _, next) {\n var err;\n try {\n this.hashMode \? this._update(data) : this.push(this._update(data));\n } catch (e) {\n err = e;\n } finally {\n next(err);\n }\n }, CipherBase.prototype._flush = function(done) {\n var err;\n try {\n this.push(this.__final());\n } catch (e) {\n err = e;\n }\n done(err);\n }, CipherBase.prototype._finalOrDigest = function(outputEnc) {\n if (outputEnc === \"buffer\")\n outputEnc = @undefined;\n if (this._finalized) {\n if (!this._encoding)\n return Buffer2.alloc(0);\n return \"\";\n }\n this._finalized = !0;\n var outData = this.__final() || Buffer2.alloc(0);\n return outputEnc && (outData = this._toString(outData, outputEnc, !0)), outData;\n }, CipherBase.prototype._toString = function(value, enc, fin) {\n if (this._decoder || (this._decoder = new StringDecoder(enc), this._encoding = enc), this._encoding !== enc)\n throw new Error(\"can't switch encodings\");\n var out = this._decoder.write(value);\n return fin && (out += this._decoder.end()), out;\n }, module.exports = CipherBase;\n }\n}), require_browser2 = __commonJS({\n \"node_modules/create-hash/browser.js\"(exports, module) {\n const LazyHash = function Hash(algorithm, options) {\n this._options = options, this._hasher = new CryptoHasher(algorithm, options), this._finalized = !1;\n };\n LazyHash.prototype = Object.create(StreamModule.Transform.prototype), LazyHash.prototype.update = function update(data, encoding) {\n return this._checkFinalized(), this._hasher.update(data, encoding), this;\n }, LazyHash.prototype.digest = function update(data, encoding) {\n return this._checkFinalized(), this._finalized = !0, this._hasher.digest(data, encoding);\n }, LazyHash.prototype._checkFinalized = function _checkFinalized() {\n if (this._finalized) {\n var err = new Error(\"Digest already called\");\n throw err.code = \"ERR_CRYPTO_HASH_FINALIZED\", err;\n }\n }, LazyHash.prototype.copy = function copy() {\n const copy = Object.create(LazyHash.prototype);\n return copy._options = this._options, copy._hasher = this._hasher.copy(), copy._finalized = this._finalized, copy;\n };\n const lazyHashFullInitProto = {\n __proto__: StreamModule.Transform.prototype,\n ...LazyHash.prototype,\n _transform(data, encoding, callback) {\n this.update(data, encoding), callback && callback();\n },\n _flush(callback) {\n this.push(this.digest()), callback();\n }\n }, triggerMethods = [\n \"_events\",\n \"_eventsCount\",\n \"_final\",\n \"_maxListeners\",\n \"_maxListeners\",\n \"_read\",\n \"_undestroy\",\n \"_writableState\",\n \"_write\",\n \"_writev\",\n \"addListener\",\n \"asIndexedPairs\",\n \"closed\",\n \"compose\",\n \"constructor\",\n \"cork\",\n \"destroy\",\n \"destroyed\",\n \"drop\",\n \"emit\",\n \"end\",\n \"errored\",\n \"eventNames\",\n \"every\",\n \"filter\",\n \"find\",\n \"flatMap\",\n \"forEach\",\n \"getMaxListeners\",\n \"hasOwnProperty\",\n \"isPaused\",\n \"isPrototypeOf\",\n \"iterator\",\n \"listenerCount\",\n \"listeners\",\n \"map\",\n \"off\",\n \"on\",\n \"once\",\n \"pause\",\n \"pipe\",\n \"prependListener\",\n \"prependOnceListener\",\n \"propertyIsEnumerable\",\n \"push\",\n \"rawListeners\",\n \"read\",\n \"readable\",\n \"readableAborted\",\n \"readableBuffer\",\n \"readableDidRead\",\n \"readableEncoding\",\n \"readableEnded\",\n \"readableFlowing\",\n \"readableHighWaterMark\",\n \"readableLength\",\n \"readableObjectMode\",\n \"reduce\",\n \"removeAllListeners\",\n \"removeListener\",\n \"resume\",\n \"setDefaultEncoding\",\n \"setEncoding\",\n \"setMaxListeners\",\n \"some\",\n \"take\",\n \"toArray\",\n \"toLocaleString\",\n \"toString\",\n \"uncork\",\n \"unpipe\",\n \"unshift\",\n \"valueOf\",\n \"wrap\",\n \"writable\",\n \"writableBuffer\",\n \"writableCorked\",\n \"writableEnded\",\n \"writableFinished\",\n \"writableHighWaterMark\",\n \"writableLength\",\n \"writableNeedDrain\",\n \"writableObjectMode\",\n \"write\"\n ];\n for (let method of triggerMethods)\n Object.defineProperty(LazyHash.prototype, method, {\n get() {\n return Object.setPrototypeOf(this, lazyHashFullInitProto), StreamModule.Transform.@call(this, this._options), this[method];\n },\n enumerable: !1,\n configurable: !0\n });\n module.exports = function createHash(algorithm) {\n return new LazyHash(algorithm);\n }, module.exports.createHash = module.exports, module.exports.Hash = LazyHash;\n }\n}), require_legacy = __commonJS({\n \"node_modules/create-hmac/legacy.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safe_buffer().Buffer, Base = require_cipher_base(), ZEROS = Buffer2.alloc(128), blocksize = 64;\n function Hmac(alg, key2) {\n key2 = exportIfKeyObject(key2), Base.@call(this, \"digest\"), typeof key2 == \"string\" && (key2 = Buffer2.from(key2)), this._alg = alg, this._key = key2, key2.length > blocksize \? key2 = alg(key2) : key2.length < blocksize && (key2 = Buffer2.concat([key2, ZEROS], blocksize));\n for (var ipad = this._ipad = Buffer2.allocUnsafe(blocksize), opad = this._opad = Buffer2.allocUnsafe(blocksize), i = 0;i < blocksize; i++)\n ipad[i] = key2[i] ^ 54, opad[i] = key2[i] ^ 92;\n this._hash = [ipad];\n }\n Hmac.prototype = {}, inherits(Hmac, Base), Hmac.prototype._update = function(data) {\n this._hash.push(data);\n }, Hmac.prototype._final = function() {\n var h = this._alg(Buffer2.concat(this._hash));\n return this._alg(Buffer2.concat([this._opad, h]));\n }, module.exports = Hmac;\n }\n}), require_md52 = __commonJS({\n \"node_modules/create-hash/md5.js\"(exports, module) {\n var MD5 = require_md5();\n module.exports = function(buffer) {\n return new MD5().update(buffer).digest();\n };\n }\n}), require_browser3 = __commonJS({\n \"node_modules/create-hmac/browser.js\"(exports, module) {\n var inherits = require_inherits_browser(), Legacy = require_legacy(), Base = require_cipher_base(), Buffer2 = require_safe_buffer().Buffer, md5 = require_md52(), RIPEMD160 = require_ripemd160(), sha = require_sha2(), ZEROS = Buffer2.alloc(128);\n function Hmac(alg, key2) {\n key2 = exportIfKeyObject(key2), Base.@call(this, \"digest\"), typeof key2 == \"string\" && (key2 = Buffer2.from(key2));\n var blocksize = alg === \"sha512\" || alg === \"sha384\" \? 128 : 64;\n if (this._alg = alg, this._key = key2, key2.length > blocksize) {\n var hash = alg === \"rmd160\" \? new RIPEMD160 : sha(alg);\n key2 = hash.update(key2).digest();\n } else\n key2.length < blocksize && (key2 = Buffer2.concat([key2, ZEROS], blocksize));\n for (var ipad = this._ipad = Buffer2.allocUnsafe(blocksize), opad = this._opad = Buffer2.allocUnsafe(blocksize), i = 0;i < blocksize; i++)\n ipad[i] = key2[i] ^ 54, opad[i] = key2[i] ^ 92;\n this._hash = alg === \"rmd160\" \? new RIPEMD160 : sha(alg), this._hash.update(ipad);\n }\n inherits(Hmac, Base), Hmac.prototype._update = function(data) {\n this._hash.update(data);\n }, Hmac.prototype._final = function() {\n var h = this._hash.digest(), hash = this._alg === \"rmd160\" \? new RIPEMD160 : sha(this._alg);\n return hash.update(this._opad).update(h).digest();\n }, module.exports = function(alg, key2) {\n return key2 = exportIfKeyObject(key2), alg = alg.toLowerCase(), alg === \"rmd160\" || alg === \"ripemd160\" \? new Hmac(\"rmd160\", key2) : alg === \"md5\" \? new Legacy(md5, key2) : new Hmac(alg, key2);\n };\n }\n}), require_algorithms = __commonJS({\n \"node_modules/browserify-sign/browser/algorithms.json\"(exports, module) {\n module.exports = {\n sha224WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha224\",\n id: \"302d300d06096086480165030402040500041c\"\n },\n \"RSA-SHA224\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha224\",\n id: \"302d300d06096086480165030402040500041c\"\n },\n sha256WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha256\",\n id: \"3031300d060960864801650304020105000420\"\n },\n \"RSA-SHA256\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha256\",\n id: \"3031300d060960864801650304020105000420\"\n },\n sha384WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha384\",\n id: \"3041300d060960864801650304020205000430\"\n },\n \"RSA-SHA384\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha384\",\n id: \"3041300d060960864801650304020205000430\"\n },\n sha512WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha512\",\n id: \"3051300d060960864801650304020305000440\"\n },\n \"RSA-SHA512\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha512\",\n id: \"3051300d060960864801650304020305000440\"\n },\n \"RSA-SHA1\": {\n sign: \"rsa\",\n hash: \"sha1\",\n id: \"3021300906052b0e03021a05000414\"\n },\n \"ecdsa-with-SHA1\": {\n sign: \"ecdsa\",\n hash: \"sha1\",\n id: \"\"\n },\n sha1: {\n sign: \"ecdsa/rsa\",\n hash: \"sha1\",\n id: \"\"\n },\n sha256: {\n sign: \"ecdsa/rsa\",\n hash: \"sha256\",\n id: \"\"\n },\n sha224: {\n sign: \"ecdsa/rsa\",\n hash: \"sha224\",\n id: \"\"\n },\n sha384: {\n sign: \"ecdsa/rsa\",\n hash: \"sha384\",\n id: \"\"\n },\n sha512: {\n sign: \"ecdsa/rsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-SHA\": {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n \"DSA-SHA1\": {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n DSA: {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n \"DSA-WITH-SHA224\": {\n sign: \"dsa\",\n hash: \"sha224\",\n id: \"\"\n },\n \"DSA-SHA224\": {\n sign: \"dsa\",\n hash: \"sha224\",\n id: \"\"\n },\n \"DSA-WITH-SHA256\": {\n sign: \"dsa\",\n hash: \"sha256\",\n id: \"\"\n },\n \"DSA-SHA256\": {\n sign: \"dsa\",\n hash: \"sha256\",\n id: \"\"\n },\n \"DSA-WITH-SHA384\": {\n sign: \"dsa\",\n hash: \"sha384\",\n id: \"\"\n },\n \"DSA-SHA384\": {\n sign: \"dsa\",\n hash: \"sha384\",\n id: \"\"\n },\n \"DSA-WITH-SHA512\": {\n sign: \"dsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-SHA512\": {\n sign: \"dsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-RIPEMD160\": {\n sign: \"dsa\",\n hash: \"rmd160\",\n id: \"\"\n },\n ripemd160WithRSA: {\n sign: \"rsa\",\n hash: \"rmd160\",\n id: \"3021300906052b2403020105000414\"\n },\n \"RSA-RIPEMD160\": {\n sign: \"rsa\",\n hash: \"rmd160\",\n id: \"3021300906052b2403020105000414\"\n },\n md5WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"md5\",\n id: \"3020300c06082a864886f70d020505000410\"\n },\n \"RSA-MD5\": {\n sign: \"rsa\",\n hash: \"md5\",\n id: \"3020300c06082a864886f70d020505000410\"\n }\n };\n }\n}), require_algos = __commonJS({\n \"node_modules/browserify-sign/algos.js\"(exports, module) {\n module.exports = require_algorithms();\n }\n}), require_precondition = __commonJS({\n \"node_modules/pbkdf2/lib/precondition.js\"(exports, module) {\n var MAX_ALLOC = Math.pow(2, 30) - 1;\n module.exports = function(iterations, keylen) {\n if (typeof iterations != \"number\")\n @throwTypeError(\"Iterations not a number\");\n if (iterations < 0)\n @throwTypeError(\"Bad iterations\");\n if (typeof keylen != \"number\")\n @throwTypeError(\"Key length not a number\");\n if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen)\n @throwTypeError(\"Bad key length\");\n };\n }\n}), require_default_encoding = __commonJS({\n \"node_modules/pbkdf2/lib/default-encoding.js\"(exports, module) {\n var defaultEncoding;\n global.process && global.process.browser \? defaultEncoding = \"utf-8\" : global.process && global.process.version \? (pVersionMajor = parseInt(process.version.split(\".\")[0].slice(1), 10), defaultEncoding = pVersionMajor >= 6 \? \"utf-8\" : \"binary\") : defaultEncoding = \"utf-8\";\n var pVersionMajor;\n module.exports = defaultEncoding;\n }\n}), require_to_buffer = __commonJS({\n \"node_modules/pbkdf2/lib/to-buffer.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(thing, encoding, name) {\n if (Buffer2.isBuffer(thing))\n return thing;\n if (typeof thing == \"string\")\n return Buffer2.from(thing, encoding);\n if (@ArrayBuffer.isView(thing))\n return Buffer2.from(thing.buffer);\n @throwTypeError(name + \" must be a string, a Buffer, a typed array or a DataView\");\n };\n }\n}), require_sync_browser = __commonJS({\n \"node_modules/pbkdf2/lib/sync-browser.js\"(exports, module) {\n var md5 = require_md52(), RIPEMD160 = require_ripemd160(), sha = require_sha2(), Buffer2 = require_safe_buffer().Buffer, checkParameters = require_precondition(), defaultEncoding = require_default_encoding(), toBuffer = require_to_buffer(), ZEROS = Buffer2.alloc(128), sizes = {\n md5: 16,\n sha1: 20,\n sha224: 28,\n sha256: 32,\n sha384: 48,\n sha512: 64,\n rmd160: 20,\n ripemd160: 20\n };\n function Hmac(alg, key2, saltLen) {\n key2 = exportIfKeyObject(key2);\n var hash = getDigest(alg), blocksize = alg === \"sha512\" || alg === \"sha384\" \? 128 : 64;\n key2.length > blocksize \? key2 = hash(key2) : key2.length < blocksize && (key2 = Buffer2.concat([key2, ZEROS], blocksize));\n for (var ipad = Buffer2.allocUnsafe(blocksize + sizes[alg]), opad = Buffer2.allocUnsafe(blocksize + sizes[alg]), i = 0;i < blocksize; i++)\n ipad[i] = key2[i] ^ 54, opad[i] = key2[i] ^ 92;\n var ipad1 = Buffer2.allocUnsafe(blocksize + saltLen + 4);\n ipad.copy(ipad1, 0, 0, blocksize), this.ipad1 = ipad1, this.ipad2 = ipad, this.opad = opad, this.alg = alg, this.blocksize = blocksize, this.hash = hash, this.size = sizes[alg];\n }\n Hmac.prototype = {}, Hmac.prototype.run = function(data, ipad) {\n data.copy(ipad, this.blocksize);\n var h = this.hash(ipad);\n return h.copy(this.opad, this.blocksize), this.hash(this.opad);\n };\n function getDigest(alg) {\n function shaFunc(data) {\n return sha(alg).update(data).digest();\n }\n function rmd160Func(data) {\n return new RIPEMD160().update(data).digest();\n }\n return alg === \"rmd160\" || alg === \"ripemd160\" \? rmd160Func : alg === \"md5\" \? md5 : shaFunc;\n }\n function pbkdf2(password, salt, iterations, keylen, digest) {\n checkParameters(iterations, keylen), password = toBuffer(password, defaultEncoding, \"Password\"), salt = toBuffer(salt, defaultEncoding, \"Salt\"), digest = digest || \"sha1\";\n var hmac = new Hmac(digest, password, salt.length), DK = Buffer2.allocUnsafe(keylen), block1 = Buffer2.allocUnsafe(salt.length + 4);\n salt.copy(block1, 0, 0, salt.length);\n for (var destPos = 0, hLen = sizes[digest], l = Math.ceil(keylen / hLen), i = 1;i <= l; i++) {\n block1.writeUInt32BE(i, salt.length);\n for (var T = hmac.run(block1, hmac.ipad1), U = T, j = 1;j < iterations; j++) {\n U = hmac.run(U, hmac.ipad2);\n for (var k = 0;k < hLen; k++)\n T[k] ^= U[k];\n }\n T.copy(DK, destPos), destPos += hLen;\n }\n return DK;\n }\n module.exports = pbkdf2;\n }\n}), require_async = __commonJS({\n \"node_modules/pbkdf2/lib/async.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, checkParameters = require_precondition(), defaultEncoding = require_default_encoding(), sync = require_sync_browser(), toBuffer = require_to_buffer(), ZERO_BUF, subtle = globalCrypto.subtle, toBrowser = {\n sha: \"SHA-1\",\n \"sha-1\": \"SHA-1\",\n sha1: \"SHA-1\",\n sha256: \"SHA-256\",\n \"sha-256\": \"SHA-256\",\n sha384: \"SHA-384\",\n \"sha-384\": \"SHA-384\",\n \"sha-512\": \"SHA-512\",\n sha512: \"SHA-512\"\n }, checks = [];\n function checkNative(algo) {\n if (global.process && !global.process.browser || !subtle || !subtle.importKey || !subtle.deriveBits)\n return @Promise.resolve(!1);\n if (checks[algo] !== void 0)\n return checks[algo];\n ZERO_BUF = ZERO_BUF || Buffer2.alloc(8);\n var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo).then(function() {\n return !0;\n }).catch(function() {\n return !1;\n });\n return checks[algo] = prom, prom;\n }\n var nextTick;\n function getNextTick() {\n return nextTick || (global.process && global.process.nextTick \? nextTick = global.process.nextTick : global.queueMicrotask \? nextTick = global.queueMicrotask : global.setImmediate \? nextTick = global.setImmediate : nextTick = global.setTimeout, nextTick);\n }\n function browserPbkdf2(password, salt, iterations, length, algo) {\n return subtle.importKey(\"raw\", password, { name: \"PBKDF2\" }, !1, [\"deriveBits\"]).then(function(key2) {\n return subtle.deriveBits({\n name: \"PBKDF2\",\n salt,\n iterations,\n hash: {\n name: algo\n }\n }, key2, length << 3);\n }).then(function(res) {\n return Buffer2.from(res);\n });\n }\n function resolvePromise(promise, callback) {\n promise.then(function(out) {\n getNextTick()(function() {\n callback(null, out);\n });\n }, function(e) {\n getNextTick()(function() {\n callback(e);\n });\n });\n }\n module.exports = function(password, salt, iterations, keylen, digest, callback) {\n typeof digest == \"function\" && (callback = digest, digest = void 0), digest = digest || \"sha1\";\n var algo = toBrowser[digest.toLowerCase()];\n if (!algo || typeof global.Promise != \"function\") {\n getNextTick()(function() {\n var out;\n try {\n out = sync(password, salt, iterations, keylen, digest);\n } catch (e) {\n return callback(e);\n }\n callback(null, out);\n });\n return;\n }\n if (checkParameters(iterations, keylen), password = toBuffer(password, defaultEncoding, \"Password\"), salt = toBuffer(salt, defaultEncoding, \"Salt\"), typeof callback != \"function\")\n throw new Error(\"No callback provided to pbkdf2\");\n resolvePromise(checkNative(algo).then(function(resp) {\n return resp \? browserPbkdf2(password, salt, iterations, keylen, algo) : sync(password, salt, iterations, keylen, digest);\n }), callback);\n };\n }\n}), require_browser4 = __commonJS({\n \"node_modules/pbkdf2/browser.js\"(exports) {\n exports.pbkdf2 = require_async(), exports.pbkdf2Sync = require_sync_browser();\n }\n}), require_utils = __commonJS({\n \"node_modules/des.js/lib/des/utils.js\"(exports) {\n exports.readUInt32BE = function(bytes, off) {\n var res = bytes[0 + off] << 24 | bytes[1 + off] << 16 | bytes[2 + off] << 8 | bytes[3 + off];\n return res >>> 0;\n }, exports.writeUInt32BE = function(bytes, value, off) {\n bytes[0 + off] = value >>> 24, bytes[1 + off] = value >>> 16 & 255, bytes[2 + off] = value >>> 8 & 255, bytes[3 + off] = value & 255;\n }, exports.ip = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 6;i >= 0; i -= 2) {\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >>> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inL >>> j + i & 1;\n }\n for (var i = 6;i >= 0; i -= 2) {\n for (var j = 1;j <= 25; j += 8)\n outR <<= 1, outR |= inR >>> j + i & 1;\n for (var j = 1;j <= 25; j += 8)\n outR <<= 1, outR |= inL >>> j + i & 1;\n }\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.rip = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 0;i < 4; i++)\n for (var j = 24;j >= 0; j -= 8)\n outL <<= 1, outL |= inR >>> j + i & 1, outL <<= 1, outL |= inL >>> j + i & 1;\n for (var i = 4;i < 8; i++)\n for (var j = 24;j >= 0; j -= 8)\n outR <<= 1, outR |= inR >>> j + i & 1, outR <<= 1, outR |= inL >>> j + i & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.pc1 = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 7;i >= 5; i--) {\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inL >> j + i & 1;\n }\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >> j + i & 1;\n for (var i = 1;i <= 3; i++) {\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inR >> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inL >> j + i & 1;\n }\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inL >> j + i & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.r28shl = function(num, shift) {\n return num << shift & 268435455 | num >>> 28 - shift;\n };\n var pc2table = [\n 14,\n 11,\n 17,\n 4,\n 27,\n 23,\n 25,\n 0,\n 13,\n 22,\n 7,\n 18,\n 5,\n 9,\n 16,\n 24,\n 2,\n 20,\n 12,\n 21,\n 1,\n 8,\n 15,\n 26,\n 15,\n 4,\n 25,\n 19,\n 9,\n 1,\n 26,\n 16,\n 5,\n 11,\n 23,\n 8,\n 12,\n 7,\n 17,\n 0,\n 22,\n 3,\n 10,\n 14,\n 6,\n 20,\n 27,\n 24\n ];\n exports.pc2 = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, len = pc2table.length >>> 1, i = 0;i < len; i++)\n outL <<= 1, outL |= inL >>> pc2table[i] & 1;\n for (var i = len;i < pc2table.length; i++)\n outR <<= 1, outR |= inR >>> pc2table[i] & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.expand = function(r, out, off) {\n var outL = 0, outR = 0;\n outL = (r & 1) << 5 | r >>> 27;\n for (var i = 23;i >= 15; i -= 4)\n outL <<= 6, outL |= r >>> i & 63;\n for (var i = 11;i >= 3; i -= 4)\n outR |= r >>> i & 63, outR <<= 6;\n outR |= (r & 31) << 1 | r >>> 31, out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n };\n var sTable = [\n 14,\n 0,\n 4,\n 15,\n 13,\n 7,\n 1,\n 4,\n 2,\n 14,\n 15,\n 2,\n 11,\n 13,\n 8,\n 1,\n 3,\n 10,\n 10,\n 6,\n 6,\n 12,\n 12,\n 11,\n 5,\n 9,\n 9,\n 5,\n 0,\n 3,\n 7,\n 8,\n 4,\n 15,\n 1,\n 12,\n 14,\n 8,\n 8,\n 2,\n 13,\n 4,\n 6,\n 9,\n 2,\n 1,\n 11,\n 7,\n 15,\n 5,\n 12,\n 11,\n 9,\n 3,\n 7,\n 14,\n 3,\n 10,\n 10,\n 0,\n 5,\n 6,\n 0,\n 13,\n 15,\n 3,\n 1,\n 13,\n 8,\n 4,\n 14,\n 7,\n 6,\n 15,\n 11,\n 2,\n 3,\n 8,\n 4,\n 14,\n 9,\n 12,\n 7,\n 0,\n 2,\n 1,\n 13,\n 10,\n 12,\n 6,\n 0,\n 9,\n 5,\n 11,\n 10,\n 5,\n 0,\n 13,\n 14,\n 8,\n 7,\n 10,\n 11,\n 1,\n 10,\n 3,\n 4,\n 15,\n 13,\n 4,\n 1,\n 2,\n 5,\n 11,\n 8,\n 6,\n 12,\n 7,\n 6,\n 12,\n 9,\n 0,\n 3,\n 5,\n 2,\n 14,\n 15,\n 9,\n 10,\n 13,\n 0,\n 7,\n 9,\n 0,\n 14,\n 9,\n 6,\n 3,\n 3,\n 4,\n 15,\n 6,\n 5,\n 10,\n 1,\n 2,\n 13,\n 8,\n 12,\n 5,\n 7,\n 14,\n 11,\n 12,\n 4,\n 11,\n 2,\n 15,\n 8,\n 1,\n 13,\n 1,\n 6,\n 10,\n 4,\n 13,\n 9,\n 0,\n 8,\n 6,\n 15,\n 9,\n 3,\n 8,\n 0,\n 7,\n 11,\n 4,\n 1,\n 15,\n 2,\n 14,\n 12,\n 3,\n 5,\n 11,\n 10,\n 5,\n 14,\n 2,\n 7,\n 12,\n 7,\n 13,\n 13,\n 8,\n 14,\n 11,\n 3,\n 5,\n 0,\n 6,\n 6,\n 15,\n 9,\n 0,\n 10,\n 3,\n 1,\n 4,\n 2,\n 7,\n 8,\n 2,\n 5,\n 12,\n 11,\n 1,\n 12,\n 10,\n 4,\n 14,\n 15,\n 9,\n 10,\n 3,\n 6,\n 15,\n 9,\n 0,\n 0,\n 6,\n 12,\n 10,\n 11,\n 1,\n 7,\n 13,\n 13,\n 8,\n 15,\n 9,\n 1,\n 4,\n 3,\n 5,\n 14,\n 11,\n 5,\n 12,\n 2,\n 7,\n 8,\n 2,\n 4,\n 14,\n 2,\n 14,\n 12,\n 11,\n 4,\n 2,\n 1,\n 12,\n 7,\n 4,\n 10,\n 7,\n 11,\n 13,\n 6,\n 1,\n 8,\n 5,\n 5,\n 0,\n 3,\n 15,\n 15,\n 10,\n 13,\n 3,\n 0,\n 9,\n 14,\n 8,\n 9,\n 6,\n 4,\n 11,\n 2,\n 8,\n 1,\n 12,\n 11,\n 7,\n 10,\n 1,\n 13,\n 14,\n 7,\n 2,\n 8,\n 13,\n 15,\n 6,\n 9,\n 15,\n 12,\n 0,\n 5,\n 9,\n 6,\n 10,\n 3,\n 4,\n 0,\n 5,\n 14,\n 3,\n 12,\n 10,\n 1,\n 15,\n 10,\n 4,\n 15,\n 2,\n 9,\n 7,\n 2,\n 12,\n 6,\n 9,\n 8,\n 5,\n 0,\n 6,\n 13,\n 1,\n 3,\n 13,\n 4,\n 14,\n 14,\n 0,\n 7,\n 11,\n 5,\n 3,\n 11,\n 8,\n 9,\n 4,\n 14,\n 3,\n 15,\n 2,\n 5,\n 12,\n 2,\n 9,\n 8,\n 5,\n 12,\n 15,\n 3,\n 10,\n 7,\n 11,\n 0,\n 14,\n 4,\n 1,\n 10,\n 7,\n 1,\n 6,\n 13,\n 0,\n 11,\n 8,\n 6,\n 13,\n 4,\n 13,\n 11,\n 0,\n 2,\n 11,\n 14,\n 7,\n 15,\n 4,\n 0,\n 9,\n 8,\n 1,\n 13,\n 10,\n 3,\n 14,\n 12,\n 3,\n 9,\n 5,\n 7,\n 12,\n 5,\n 2,\n 10,\n 15,\n 6,\n 8,\n 1,\n 6,\n 1,\n 6,\n 4,\n 11,\n 11,\n 13,\n 13,\n 8,\n 12,\n 1,\n 3,\n 4,\n 7,\n 10,\n 14,\n 7,\n 10,\n 9,\n 15,\n 5,\n 6,\n 0,\n 8,\n 15,\n 0,\n 14,\n 5,\n 2,\n 9,\n 3,\n 2,\n 12,\n 13,\n 1,\n 2,\n 15,\n 8,\n 13,\n 4,\n 8,\n 6,\n 10,\n 15,\n 3,\n 11,\n 7,\n 1,\n 4,\n 10,\n 12,\n 9,\n 5,\n 3,\n 6,\n 14,\n 11,\n 5,\n 0,\n 0,\n 14,\n 12,\n 9,\n 7,\n 2,\n 7,\n 2,\n 11,\n 1,\n 4,\n 14,\n 1,\n 7,\n 9,\n 4,\n 12,\n 10,\n 14,\n 8,\n 2,\n 13,\n 0,\n 15,\n 6,\n 12,\n 10,\n 9,\n 13,\n 0,\n 15,\n 3,\n 3,\n 5,\n 5,\n 6,\n 8,\n 11\n ];\n exports.substitute = function(inL, inR) {\n for (var out = 0, i = 0;i < 4; i++) {\n var b = inL >>> 18 - i * 6 & 63, sb = sTable[i * 64 + b];\n out <<= 4, out |= sb;\n }\n for (var i = 0;i < 4; i++) {\n var b = inR >>> 18 - i * 6 & 63, sb = sTable[256 + i * 64 + b];\n out <<= 4, out |= sb;\n }\n return out >>> 0;\n };\n var permuteTable = [\n 16,\n 25,\n 12,\n 11,\n 3,\n 20,\n 4,\n 15,\n 31,\n 17,\n 9,\n 6,\n 27,\n 14,\n 1,\n 22,\n 30,\n 24,\n 8,\n 18,\n 0,\n 5,\n 29,\n 23,\n 13,\n 19,\n 2,\n 26,\n 10,\n 21,\n 28,\n 7\n ];\n exports.permute = function(num) {\n for (var out = 0, i = 0;i < permuteTable.length; i++)\n out <<= 1, out |= num >>> permuteTable[i] & 1;\n return out >>> 0;\n }, exports.padSplit = function(num, size, group) {\n for (var str = num.toString(2);str.length < size; )\n str = \"0\" + str;\n for (var out = [], i = 0;i < size; i += group)\n out.push(str.slice(i, i + group));\n return out.join(\" \");\n };\n }\n}), require_minimalistic_assert = __commonJS({\n \"node_modules/minimalistic-assert/index.js\"(exports, module) {\n module.exports = assert;\n function assert(val, msg) {\n if (!val)\n throw new Error(msg || \"Assertion failed\");\n }\n assert.equal = function(l, r, msg) {\n if (l != r)\n throw new Error(msg || \"Assertion failed: \" + l + \" != \" + r);\n };\n }\n}), require_cipher = __commonJS({\n \"node_modules/des.js/lib/des/cipher.js\"(exports, module) {\n var assert = require_minimalistic_assert();\n function Cipher(options) {\n this.options = options, this.type = this.options.type, this.blockSize = 8, this._init(), this.buffer = new @Array(this.blockSize), this.bufferOff = 0;\n }\n Cipher.prototype = {}, module.exports = Cipher, Cipher.prototype._init = function() {\n }, Cipher.prototype.update = function(data) {\n return data.length === 0 \? [] : this.type === \"decrypt\" \? this._updateDecrypt(data) : this._updateEncrypt(data);\n }, Cipher.prototype._buffer = function(data, off) {\n for (var min = Math.min(this.buffer.length - this.bufferOff, data.length - off), i = 0;i < min; i++)\n this.buffer[this.bufferOff + i] = data[off + i];\n return this.bufferOff += min, min;\n }, Cipher.prototype._flushBuffer = function(out, off) {\n return this._update(this.buffer, 0, out, off), this.bufferOff = 0, this.blockSize;\n }, Cipher.prototype._updateEncrypt = function(data) {\n var inputOff = 0, outputOff = 0, count = (this.bufferOff + data.length) / this.blockSize | 0, out = new @Array(count * this.blockSize);\n this.bufferOff !== 0 && (inputOff += this._buffer(data, inputOff), this.bufferOff === this.buffer.length && (outputOff += this._flushBuffer(out, outputOff)));\n for (var max = data.length - (data.length - inputOff) % this.blockSize;inputOff < max; inputOff += this.blockSize)\n this._update(data, inputOff, out, outputOff), outputOff += this.blockSize;\n for (;inputOff < data.length; inputOff++, this.bufferOff++)\n this.buffer[this.bufferOff] = data[inputOff];\n return out;\n }, Cipher.prototype._updateDecrypt = function(data) {\n for (var inputOff = 0, outputOff = 0, count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1, out = new @Array(count * this.blockSize);count > 0; count--)\n inputOff += this._buffer(data, inputOff), outputOff += this._flushBuffer(out, outputOff);\n return inputOff += this._buffer(data, inputOff), out;\n }, Cipher.prototype.final = function(buffer) {\n var first;\n buffer && (first = this.update(buffer));\n var last;\n return this.type === \"encrypt\" \? last = this._finalEncrypt() : last = this._finalDecrypt(), first \? first.concat(last) : last;\n }, Cipher.prototype._pad = function(buffer, off) {\n if (off === 0)\n return !1;\n for (;off < buffer.length; )\n buffer[off++] = 0;\n return !0;\n }, Cipher.prototype._finalEncrypt = function() {\n if (!this._pad(this.buffer, this.bufferOff))\n return [];\n var out = new @Array(this.blockSize);\n return this._update(this.buffer, 0, out, 0), out;\n }, Cipher.prototype._unpad = function(buffer) {\n return buffer;\n }, Cipher.prototype._finalDecrypt = function() {\n assert.equal(this.bufferOff, this.blockSize, \"Not enough data to decrypt\");\n var out = new @Array(this.blockSize);\n return this._flushBuffer(out, 0), this._unpad(out);\n };\n }\n}), require_des = __commonJS({\n \"node_modules/des.js/lib/des/des.js\"(exports, module) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), utils = require_utils(), Cipher = require_cipher();\n function DESState() {\n this.tmp = new @Array(2), this.keys = null;\n }\n function DES(options) {\n Cipher.@call(this, options);\n var state = new DESState;\n this._desState = state, this.deriveKeys(state, options.key);\n }\n inherits(DES, Cipher), module.exports = DES, DES.create = function(options) {\n return new DES(options);\n };\n var shiftTable = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1];\n DES.prototype.deriveKeys = function(state, key2) {\n state.keys = new @Array(32), assert.equal(key2.length, this.blockSize, \"Invalid key length\");\n var kL = utils.readUInt32BE(key2, 0), kR = utils.readUInt32BE(key2, 4);\n utils.pc1(kL, kR, state.tmp, 0), kL = state.tmp[0], kR = state.tmp[1];\n for (var i = 0;i < state.keys.length; i += 2) {\n var shift = shiftTable[i >>> 1];\n kL = utils.r28shl(kL, shift), kR = utils.r28shl(kR, shift), utils.pc2(kL, kR, state.keys, i);\n }\n }, DES.prototype._update = function(inp, inOff, out, outOff) {\n var state = this._desState, l = utils.readUInt32BE(inp, inOff), r = utils.readUInt32BE(inp, inOff + 4);\n utils.ip(l, r, state.tmp, 0), l = state.tmp[0], r = state.tmp[1], this.type === \"encrypt\" \? this._encrypt(state, l, r, state.tmp, 0) : this._decrypt(state, l, r, state.tmp, 0), l = state.tmp[0], r = state.tmp[1], utils.writeUInt32BE(out, l, outOff), utils.writeUInt32BE(out, r, outOff + 4);\n }, DES.prototype._pad = function(buffer, off) {\n for (var value = buffer.length - off, i = off;i < buffer.length; i++)\n buffer[i] = value;\n return !0;\n }, DES.prototype._unpad = function(buffer) {\n for (var pad = buffer[buffer.length - 1], i = buffer.length - pad;i < buffer.length; i++)\n assert.equal(buffer[i], pad);\n return buffer.slice(0, buffer.length - pad);\n }, DES.prototype._encrypt = function(state, lStart, rStart, out, off) {\n for (var l = lStart, r = rStart, i = 0;i < state.keys.length; i += 2) {\n var keyL = state.keys[i], keyR = state.keys[i + 1];\n utils.expand(r, state.tmp, 0), keyL ^= state.tmp[0], keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR), f = utils.permute(s), t = r;\n r = (l ^ f) >>> 0, l = t;\n }\n utils.rip(r, l, out, off);\n }, DES.prototype._decrypt = function(state, lStart, rStart, out, off) {\n for (var l = rStart, r = lStart, i = state.keys.length - 2;i >= 0; i -= 2) {\n var keyL = state.keys[i], keyR = state.keys[i + 1];\n utils.expand(l, state.tmp, 0), keyL ^= state.tmp[0], keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR), f = utils.permute(s), t = l;\n l = (r ^ f) >>> 0, r = t;\n }\n utils.rip(l, r, out, off);\n };\n }\n}), require_cbc = __commonJS({\n \"node_modules/des.js/lib/des/cbc.js\"(exports) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), proto = {};\n function CBCState(iv) {\n assert.equal(iv.length, 8, \"Invalid IV length\"), this.iv = new @Array(8);\n for (var i = 0;i < this.iv.length; i++)\n this.iv[i] = iv[i];\n }\n function instantiate(Base) {\n function CBC(options) {\n Base.@call(this, options), this._cbcInit();\n }\n inherits(CBC, Base);\n for (var keys = Object.keys(proto), i = 0;i < keys.length; i++) {\n var key2 = keys[i];\n CBC.prototype[key2] = proto[key2];\n }\n return CBC.create = function(options) {\n return new CBC(options);\n }, CBC;\n }\n exports.instantiate = instantiate, proto._cbcInit = function() {\n var state = new CBCState(this.options.iv);\n this._cbcState = state;\n }, proto._update = function(inp, inOff, out, outOff) {\n var state = this._cbcState, superProto = this.constructor.super_.prototype, iv = state.iv;\n if (this.type === \"encrypt\") {\n for (var i = 0;i < this.blockSize; i++)\n iv[i] ^= inp[inOff + i];\n superProto._update.@call(this, iv, 0, out, outOff);\n for (var i = 0;i < this.blockSize; i++)\n iv[i] = out[outOff + i];\n } else {\n superProto._update.@call(this, inp, inOff, out, outOff);\n for (var i = 0;i < this.blockSize; i++)\n out[outOff + i] ^= iv[i];\n for (var i = 0;i < this.blockSize; i++)\n iv[i] = inp[inOff + i];\n }\n };\n }\n}), require_ede = __commonJS({\n \"node_modules/des.js/lib/des/ede.js\"(exports, module) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), Cipher = require_cipher(), DES = require_des();\n function EDEState(type, key2) {\n assert.equal(key2.length, 24, \"Invalid key length\");\n var k1 = key2.slice(0, 8), k2 = key2.slice(8, 16), k3 = key2.slice(16, 24);\n type === \"encrypt\" \? this.ciphers = [\n DES.create({ type: \"encrypt\", key: k1 }),\n DES.create({ type: \"decrypt\", key: k2 }),\n DES.create({ type: \"encrypt\", key: k3 })\n ] : this.ciphers = [\n DES.create({ type: \"decrypt\", key: k3 }),\n DES.create({ type: \"encrypt\", key: k2 }),\n DES.create({ type: \"decrypt\", key: k1 })\n ];\n }\n function EDE(options) {\n Cipher.@call(this, options);\n var state = new EDEState(this.type, this.options.key);\n this._edeState = state;\n }\n inherits(EDE, Cipher), module.exports = EDE, EDE.create = function(options) {\n return new EDE(options);\n }, EDE.prototype._update = function(inp, inOff, out, outOff) {\n var state = this._edeState;\n state.ciphers[0]._update(inp, inOff, out, outOff), state.ciphers[1]._update(out, outOff, out, outOff), state.ciphers[2]._update(out, outOff, out, outOff);\n }, EDE.prototype._pad = DES.prototype._pad, EDE.prototype._unpad = DES.prototype._unpad;\n }\n}), require_des2 = __commonJS({\n \"node_modules/des.js/lib/des.js\"(exports) {\n exports.utils = require_utils(), exports.Cipher = require_cipher(), exports.DES = require_des(), exports.CBC = require_cbc(), exports.EDE = require_ede();\n }\n}), require_browserify_des = __commonJS({\n \"node_modules/browserify-des/index.js\"(exports, module) {\n var CipherBase = require_cipher_base(), des = require_des2(), inherits = require_inherits_browser(), Buffer2 = require_safe_buffer().Buffer, modes = {\n \"des-ede3-cbc\": des.CBC.instantiate(des.EDE),\n \"des-ede3\": des.EDE,\n \"des-ede-cbc\": des.CBC.instantiate(des.EDE),\n \"des-ede\": des.EDE,\n \"des-cbc\": des.CBC.instantiate(des.DES),\n \"des-ecb\": des.DES\n };\n modes.des = modes[\"des-cbc\"], modes.des3 = modes[\"des-ede3-cbc\"], module.exports = DES, inherits(DES, CipherBase);\n function DES(opts) {\n CipherBase.@call(this);\n var modeName = opts.mode.toLowerCase(), mode = modes[modeName], type;\n opts.decrypt \? type = \"decrypt\" : type = \"encrypt\";\n var key2 = opts.key;\n Buffer2.isBuffer(key2) || (key2 = Buffer2.from(key2)), (modeName === \"des-ede\" || modeName === \"des-ede-cbc\") && (key2 = Buffer2.concat([key2, key2.slice(0, 8)]));\n var iv = opts.iv;\n Buffer2.isBuffer(iv) || (iv = Buffer2.from(iv)), this._des = mode.create({\n key: key2,\n iv,\n type\n });\n }\n DES.prototype._update = function(data) {\n return Buffer2.from(this._des.update(data));\n }, DES.prototype._final = function() {\n return Buffer2.from(this._des.final());\n };\n }\n}), require_ecb = __commonJS({\n \"node_modules/browserify-aes/modes/ecb.js\"(exports) {\n exports.encrypt = function(self2, block) {\n return self2._cipher.encryptBlock(block);\n }, exports.decrypt = function(self2, block) {\n return self2._cipher.decryptBlock(block);\n };\n }\n}), require_buffer_xor = __commonJS({\n \"node_modules/buffer-xor/index.js\"(exports, module) {\n module.exports = function(a, b) {\n for (var length = Math.min(a.length, b.length), buffer = new Buffer(length), i = 0;i < length; ++i)\n buffer[i] = a[i] ^ b[i];\n return buffer;\n };\n }\n}), require_cbc2 = __commonJS({\n \"node_modules/browserify-aes/modes/cbc.js\"(exports) {\n var xor = require_buffer_xor();\n exports.encrypt = function(self2, block) {\n var data = xor(block, self2._prev);\n return self2._prev = self2._cipher.encryptBlock(data), self2._prev;\n }, exports.decrypt = function(self2, block) {\n var pad = self2._prev;\n self2._prev = block;\n var out = self2._cipher.decryptBlock(block);\n return xor(out, pad);\n };\n }\n}), require_cfb = __commonJS({\n \"node_modules/browserify-aes/modes/cfb.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer, xor = require_buffer_xor();\n function encryptStart(self2, data, decrypt) {\n var len = data.length, out = xor(data, self2._cache);\n return self2._cache = self2._cache.slice(len), self2._prev = Buffer2.concat([self2._prev, decrypt \? data : out]), out;\n }\n exports.encrypt = function(self2, data, decrypt) {\n for (var out = Buffer2.allocUnsafe(0), len;data.length; )\n if (self2._cache.length === 0 && (self2._cache = self2._cipher.encryptBlock(self2._prev), self2._prev = Buffer2.allocUnsafe(0)), self2._cache.length <= data.length)\n len = self2._cache.length, out = Buffer2.concat([out, encryptStart(self2, data.slice(0, len), decrypt)]), data = data.slice(len);\n else {\n out = Buffer2.concat([out, encryptStart(self2, data, decrypt)]);\n break;\n }\n return out;\n };\n }\n}), require_cfb8 = __commonJS({\n \"node_modules/browserify-aes/modes/cfb8.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer;\n function encryptByte(self2, byteParam, decrypt) {\n var pad = self2._cipher.encryptBlock(self2._prev), out = pad[0] ^ byteParam;\n return self2._prev = Buffer2.concat([self2._prev.slice(1), Buffer2.from([decrypt \? byteParam : out])]), out;\n }\n exports.encrypt = function(self2, chunk, decrypt) {\n for (var len = chunk.length, out = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n out[i] = encryptByte(self2, chunk[i], decrypt);\n return out;\n };\n }\n}), require_cfb1 = __commonJS({\n \"node_modules/browserify-aes/modes/cfb1.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer;\n function encryptByte(self2, byteParam, decrypt) {\n for (var pad, i = -1, len = 8, out = 0, bit, value;++i < len; )\n pad = self2._cipher.encryptBlock(self2._prev), bit = byteParam & 1 << 7 - i \? 128 : 0, value = pad[0] ^ bit, out += (value & 128) >> i % 8, self2._prev = shiftIn(self2._prev, decrypt \? bit : value);\n return out;\n }\n function shiftIn(buffer, value) {\n var len = buffer.length, i = -1, out = Buffer2.allocUnsafe(buffer.length);\n for (buffer = Buffer2.concat([buffer, Buffer2.from([value])]);++i < len; )\n out[i] = buffer[i] << 1 | buffer[i + 1] >> 7;\n return out;\n }\n exports.encrypt = function(self2, chunk, decrypt) {\n for (var len = chunk.length, out = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n out[i] = encryptByte(self2, chunk[i], decrypt);\n return out;\n };\n }\n}), require_ofb = __commonJS({\n \"node_modules/browserify-aes/modes/ofb.js\"(exports) {\n var xor = require_buffer_xor();\n function getBlock(self2) {\n return self2._prev = self2._cipher.encryptBlock(self2._prev), self2._prev;\n }\n exports.encrypt = function(self2, chunk) {\n for (;self2._cache.length < chunk.length; )\n self2._cache = Buffer.concat([self2._cache, getBlock(self2)]);\n var pad = self2._cache.slice(0, chunk.length);\n return self2._cache = self2._cache.slice(chunk.length), xor(chunk, pad);\n };\n }\n}), require_incr32 = __commonJS({\n \"node_modules/browserify-aes/incr32.js\"(exports, module) {\n function incr32(iv) {\n for (var len = iv.length, item;len--; )\n if (item = iv.readUInt8(len), item === 255)\n iv.writeUInt8(0, len);\n else {\n item++, iv.writeUInt8(item, len);\n break;\n }\n }\n module.exports = incr32;\n }\n}), require_ctr = __commonJS({\n \"node_modules/browserify-aes/modes/ctr.js\"(exports) {\n var xor = require_buffer_xor(), Buffer2 = require_safe_buffer().Buffer, incr32 = require_incr32();\n function getBlock(self2) {\n var out = self2._cipher.encryptBlockRaw(self2._prev);\n return incr32(self2._prev), out;\n }\n var blockSize = 16;\n exports.encrypt = function(self2, chunk) {\n var chunkNum = Math.ceil(chunk.length / blockSize), start = self2._cache.length;\n self2._cache = Buffer2.concat([self2._cache, Buffer2.allocUnsafe(chunkNum * blockSize)]);\n for (var i = 0;i < chunkNum; i++) {\n var out = getBlock(self2), offset = start + i * blockSize;\n self2._cache.writeUInt32BE(out[0], offset + 0), self2._cache.writeUInt32BE(out[1], offset + 4), self2._cache.writeUInt32BE(out[2], offset + 8), self2._cache.writeUInt32BE(out[3], offset + 12);\n }\n var pad = self2._cache.slice(0, chunk.length);\n return self2._cache = self2._cache.slice(chunk.length), xor(chunk, pad);\n };\n }\n}), require_list = __commonJS({\n \"node_modules/browserify-aes/modes/list.json\"(exports, module) {\n module.exports = {\n \"aes-128-ecb\": {\n cipher: \"AES\",\n key: 128,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-192-ecb\": {\n cipher: \"AES\",\n key: 192,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-256-ecb\": {\n cipher: \"AES\",\n key: 256,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-128-cbc\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-192-cbc\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-256-cbc\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes128: {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes192: {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes256: {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-128-cfb\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-192-cfb\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-256-cfb\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-128-cfb8\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-192-cfb8\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-256-cfb8\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-128-cfb1\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-192-cfb1\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-256-cfb1\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-128-ofb\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-192-ofb\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-256-ofb\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-128-ctr\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-192-ctr\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-256-ctr\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-128-gcm\": {\n cipher: \"AES\",\n key: 128,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n },\n \"aes-192-gcm\": {\n cipher: \"AES\",\n key: 192,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n },\n \"aes-256-gcm\": {\n cipher: \"AES\",\n key: 256,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n }\n };\n }\n}), require_modes = __commonJS({\n \"node_modules/browserify-aes/modes/index.js\"(exports, module) {\n var modeModules = {\n ECB: require_ecb(),\n CBC: require_cbc2(),\n CFB: require_cfb(),\n CFB8: require_cfb8(),\n CFB1: require_cfb1(),\n OFB: require_ofb(),\n CTR: require_ctr(),\n GCM: require_ctr()\n }, modes = require_list();\n for (key2 in modes)\n modes[key2].module = modeModules[modes[key2].mode];\n var key2;\n module.exports = modes;\n }\n}), require_aes = __commonJS({\n \"node_modules/browserify-aes/aes.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n function asUInt32Array(buf) {\n if (buf instanceof KeyObject)\n buf = buf.export();\n else if (buf instanceof CryptoKey)\n buf = KeyObject.from(buf).export();\n Buffer2.isBuffer(buf) || (buf = Buffer2.from(buf));\n for (var len = buf.length / 4 | 0, out = new @Array(len), i = 0;i < len; i++)\n out[i] = buf.readUInt32BE(i * 4);\n return out;\n }\n function scrubVec(v) {\n for (var i = 0;i < v.length; v++)\n v[i] = 0;\n }\n function cryptBlock(M, keySchedule, SUB_MIX, SBOX, nRounds) {\n for (var SUB_MIX0 = SUB_MIX[0], SUB_MIX1 = SUB_MIX[1], SUB_MIX2 = SUB_MIX[2], SUB_MIX3 = SUB_MIX[3], s0 = M[0] ^ keySchedule[0], s1 = M[1] ^ keySchedule[1], s2 = M[2] ^ keySchedule[2], s3 = M[3] ^ keySchedule[3], t0, t1, t2, t3, ksRow = 4, round = 1;round < nRounds; round++)\n t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[s1 >>> 16 & 255] ^ SUB_MIX2[s2 >>> 8 & 255] ^ SUB_MIX3[s3 & 255] ^ keySchedule[ksRow++], t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[s2 >>> 16 & 255] ^ SUB_MIX2[s3 >>> 8 & 255] ^ SUB_MIX3[s0 & 255] ^ keySchedule[ksRow++], t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[s3 >>> 16 & 255] ^ SUB_MIX2[s0 >>> 8 & 255] ^ SUB_MIX3[s1 & 255] ^ keySchedule[ksRow++], t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[s0 >>> 16 & 255] ^ SUB_MIX2[s1 >>> 8 & 255] ^ SUB_MIX3[s2 & 255] ^ keySchedule[ksRow++], s0 = t0, s1 = t1, s2 = t2, s3 = t3;\n return t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 255] << 16 | SBOX[s2 >>> 8 & 255] << 8 | SBOX[s3 & 255]) ^ keySchedule[ksRow++], t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 255] << 16 | SBOX[s3 >>> 8 & 255] << 8 | SBOX[s0 & 255]) ^ keySchedule[ksRow++], t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 255] << 16 | SBOX[s0 >>> 8 & 255] << 8 | SBOX[s1 & 255]) ^ keySchedule[ksRow++], t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 255] << 16 | SBOX[s1 >>> 8 & 255] << 8 | SBOX[s2 & 255]) ^ keySchedule[ksRow++], t0 = t0 >>> 0, t1 = t1 >>> 0, t2 = t2 >>> 0, t3 = t3 >>> 0, [t0, t1, t2, t3];\n }\n var RCON = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], G = function() {\n for (var d = new @Array(256), j = 0;j < 256; j++)\n j < 128 \? d[j] = j << 1 : d[j] = j << 1 ^ 283;\n for (var SBOX = [], INV_SBOX = [], SUB_MIX = [[], [], [], []], INV_SUB_MIX = [[], [], [], []], x = 0, xi = 0, i = 0;i < 256; ++i) {\n var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n sx = sx >>> 8 ^ sx & 255 ^ 99, SBOX[x] = sx, INV_SBOX[sx] = x;\n var x2 = d[x], x4 = d[x2], x8 = d[x4], t = d[sx] * 257 ^ sx * 16843008;\n SUB_MIX[0][x] = t << 24 | t >>> 8, SUB_MIX[1][x] = t << 16 | t >>> 16, SUB_MIX[2][x] = t << 8 | t >>> 24, SUB_MIX[3][x] = t, t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008, INV_SUB_MIX[0][sx] = t << 24 | t >>> 8, INV_SUB_MIX[1][sx] = t << 16 | t >>> 16, INV_SUB_MIX[2][sx] = t << 8 | t >>> 24, INV_SUB_MIX[3][sx] = t, x === 0 \? x = xi = 1 : (x = x2 ^ d[d[d[x8 ^ x2]]], xi ^= d[d[xi]]);\n }\n return {\n SBOX,\n INV_SBOX,\n SUB_MIX,\n INV_SUB_MIX\n };\n }();\n function AES(key2) {\n this._key = asUInt32Array(key2), this._reset();\n }\n AES.prototype = {}, AES.blockSize = 16, AES.keySize = 32, AES.prototype.blockSize = AES.blockSize, AES.prototype.keySize = AES.keySize, AES.prototype._reset = function() {\n for (var keyWords = this._key, keySize = keyWords.length, nRounds = keySize + 6, ksRows = (nRounds + 1) * 4, keySchedule = [], k = 0;k < keySize; k++)\n keySchedule[k] = keyWords[k];\n for (k = keySize;k < ksRows; k++) {\n var t = keySchedule[k - 1];\n k % keySize === 0 \? (t = t << 8 | t >>> 24, t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255], t ^= RCON[k / keySize | 0] << 24) : keySize > 6 && k % keySize === 4 && (t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255]), keySchedule[k] = keySchedule[k - keySize] ^ t;\n }\n for (var invKeySchedule = [], ik = 0;ik < ksRows; ik++) {\n var ksR = ksRows - ik, tt = keySchedule[ksR - (ik % 4 \? 0 : 4)];\n ik < 4 || ksR <= 4 \? invKeySchedule[ik] = tt : invKeySchedule[ik] = G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^ G.INV_SUB_MIX[1][G.SBOX[tt >>> 16 & 255]] ^ G.INV_SUB_MIX[2][G.SBOX[tt >>> 8 & 255]] ^ G.INV_SUB_MIX[3][G.SBOX[tt & 255]];\n }\n this._nRounds = nRounds, this._keySchedule = keySchedule, this._invKeySchedule = invKeySchedule;\n }, AES.prototype.encryptBlockRaw = function(M) {\n return M = asUInt32Array(M), cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds);\n }, AES.prototype.encryptBlock = function(M) {\n var out = this.encryptBlockRaw(M), buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0], 0), buf.writeUInt32BE(out[1], 4), buf.writeUInt32BE(out[2], 8), buf.writeUInt32BE(out[3], 12), buf;\n }, AES.prototype.decryptBlock = function(M) {\n M = asUInt32Array(M);\n var m1 = M[1];\n M[1] = M[3], M[3] = m1;\n var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds), buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0], 0), buf.writeUInt32BE(out[3], 4), buf.writeUInt32BE(out[2], 8), buf.writeUInt32BE(out[1], 12), buf;\n }, AES.prototype.scrub = function() {\n scrubVec(this._keySchedule), scrubVec(this._invKeySchedule), scrubVec(this._key);\n }, module.exports.AES = AES;\n }\n}), require_ghash = __commonJS({\n \"node_modules/browserify-aes/ghash.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, ZEROES = Buffer2.alloc(16, 0);\n function toArray(buf) {\n return [buf.readUInt32BE(0), buf.readUInt32BE(4), buf.readUInt32BE(8), buf.readUInt32BE(12)];\n }\n function fromArray(out) {\n var buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0] >>> 0, 0), buf.writeUInt32BE(out[1] >>> 0, 4), buf.writeUInt32BE(out[2] >>> 0, 8), buf.writeUInt32BE(out[3] >>> 0, 12), buf;\n }\n function GHASH(key2) {\n this.h = key2, this.state = Buffer2.alloc(16, 0), this.cache = Buffer2.allocUnsafe(0);\n }\n GHASH.prototype = {}, GHASH.prototype.ghash = function(block) {\n for (var i = -1;++i < block.length; )\n this.state[i] ^= block[i];\n this._multiply();\n }, GHASH.prototype._multiply = function() {\n for (var Vi = toArray(this.h), Zi = [0, 0, 0, 0], j, xi, lsbVi, i = -1;++i < 128; ) {\n for (xi = (this.state[~~(i / 8)] & 1 << 7 - i % 8) !== 0, xi && (Zi[0] ^= Vi[0], Zi[1] ^= Vi[1], Zi[2] ^= Vi[2], Zi[3] ^= Vi[3]), lsbVi = (Vi[3] & 1) !== 0, j = 3;j > 0; j--)\n Vi[j] = Vi[j] >>> 1 | (Vi[j - 1] & 1) << 31;\n Vi[0] = Vi[0] >>> 1, lsbVi && (Vi[0] = Vi[0] ^ 225 << 24);\n }\n this.state = fromArray(Zi);\n }, GHASH.prototype.update = function(buf) {\n this.cache = Buffer2.concat([this.cache, buf]);\n for (var chunk;this.cache.length >= 16; )\n chunk = this.cache.slice(0, 16), this.cache = this.cache.slice(16), this.ghash(chunk);\n }, GHASH.prototype.final = function(abl, bl) {\n return this.cache.length && this.ghash(Buffer2.concat([this.cache, ZEROES], 16)), this.ghash(fromArray([0, abl, 0, bl])), this.state;\n }, module.exports = GHASH;\n }\n}), require_authCipher = __commonJS({\n \"node_modules/browserify-aes/authCipher.js\"(exports, module) {\n var aes = require_aes(), Buffer2 = require_safe_buffer().Buffer, Transform = require_cipher_base(), inherits = require_inherits_browser(), GHASH = require_ghash(), xor = require_buffer_xor(), incr32 = require_incr32();\n function xorTest(a, b) {\n var out = 0;\n a.length !== b.length && out++;\n for (var len = Math.min(a.length, b.length), i = 0;i < len; ++i)\n out += a[i] ^ b[i];\n return out;\n }\n function calcIv(self2, iv, ck) {\n if (iv.length === 12)\n return self2._finID = Buffer2.concat([iv, Buffer2.from([0, 0, 0, 1])]), Buffer2.concat([iv, Buffer2.from([0, 0, 0, 2])]);\n var ghash = new GHASH(ck), len = iv.length, toPad = len % 16;\n ghash.update(iv), toPad && (toPad = 16 - toPad, ghash.update(Buffer2.alloc(toPad, 0))), ghash.update(Buffer2.alloc(8, 0));\n var ivBits = len * 8, tail = Buffer2.alloc(8);\n tail.writeUIntBE(ivBits, 0, 8), ghash.update(tail), self2._finID = ghash.state;\n var out = Buffer2.from(self2._finID);\n return incr32(out), out;\n }\n function StreamCipher(mode, key2, iv, decrypt) {\n Transform.@call(this);\n var h = Buffer2.alloc(4, 0);\n this._cipher = new aes.AES(key2);\n var ck = this._cipher.encryptBlock(h);\n this._ghash = new GHASH(ck), iv = calcIv(this, iv, ck), this._prev = Buffer2.from(iv), this._cache = Buffer2.allocUnsafe(0), this._secCache = Buffer2.allocUnsafe(0), this._decrypt = decrypt, this._alen = 0, this._len = 0, this._mode = mode, this._authTag = null, this._called = !1;\n }\n inherits(StreamCipher, Transform), StreamCipher.prototype._update = function(chunk) {\n if (!this._called && this._alen) {\n var rump = 16 - this._alen % 16;\n rump < 16 && (rump = Buffer2.alloc(rump, 0), this._ghash.update(rump));\n }\n this._called = !0;\n var out = this._mode.encrypt(this, chunk);\n return this._decrypt \? this._ghash.update(chunk) : this._ghash.update(out), this._len += chunk.length, out;\n }, StreamCipher.prototype._final = function() {\n if (this._decrypt && !this._authTag)\n throw new Error(\"Unsupported state or unable to authenticate data\");\n var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID));\n if (this._decrypt && xorTest(tag, this._authTag))\n throw new Error(\"Unsupported state or unable to authenticate data\");\n this._authTag = tag, this._cipher.scrub();\n }, StreamCipher.prototype.getAuthTag = function() {\n if (this._decrypt || !Buffer2.isBuffer(this._authTag))\n throw new Error(\"Attempting to get auth tag in unsupported state\");\n return this._authTag;\n }, StreamCipher.prototype.setAuthTag = function(tag) {\n if (!this._decrypt)\n throw new Error(\"Attempting to set auth tag in unsupported state\");\n this._authTag = tag;\n }, StreamCipher.prototype.setAAD = function(buf) {\n if (this._called)\n throw new Error(\"Attempting to set AAD in unsupported state\");\n this._ghash.update(buf), this._alen += buf.length;\n }, module.exports = StreamCipher;\n }\n}), require_streamCipher = __commonJS({\n \"node_modules/browserify-aes/streamCipher.js\"(exports, module) {\n var aes = require_aes(), Buffer2 = require_safe_buffer().Buffer, Transform = require_cipher_base(), inherits = require_inherits_browser();\n function StreamCipher(mode, key2, iv, decrypt) {\n Transform.@call(this), this._cipher = new aes.AES(key2), this._prev = Buffer2.from(iv), this._cache = Buffer2.allocUnsafe(0), this._secCache = Buffer2.allocUnsafe(0), this._decrypt = decrypt, this._mode = mode;\n }\n inherits(StreamCipher, Transform), StreamCipher.prototype._update = function(chunk) {\n return this._mode.encrypt(this, chunk, this._decrypt);\n }, StreamCipher.prototype._final = function() {\n this._cipher.scrub();\n }, module.exports = StreamCipher;\n }\n}), require_evp_bytestokey = __commonJS({\n \"node_modules/evp_bytestokey/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, MD5 = require_md5();\n function EVP_BytesToKey(password, salt, keyBits, ivLen) {\n if (Buffer2.isBuffer(password) || (password = Buffer2.from(password, \"binary\")), salt && (Buffer2.isBuffer(salt) || (salt = Buffer2.from(salt, \"binary\")), salt.length !== 8))\n @throwRangeError(\"salt should be Buffer with 8 byte length\");\n for (var keyLen = keyBits / 8, key2 = Buffer2.alloc(keyLen), iv = Buffer2.alloc(ivLen || 0), tmp = Buffer2.alloc(0);keyLen > 0 || ivLen > 0; ) {\n var hash = new MD5;\n hash.update(tmp), hash.update(password), salt && hash.update(salt), tmp = hash.digest();\n var used = 0;\n if (keyLen > 0) {\n var keyStart = key2.length - keyLen;\n used = Math.min(keyLen, tmp.length), tmp.copy(key2, keyStart, 0, used), keyLen -= used;\n }\n if (used < tmp.length && ivLen > 0) {\n var ivStart = iv.length - ivLen, length = Math.min(ivLen, tmp.length - used);\n tmp.copy(iv, ivStart, used, used + length), ivLen -= length;\n }\n }\n return tmp.fill(0), { key: key2, iv };\n }\n module.exports = EVP_BytesToKey;\n }\n}), require_encrypter = __commonJS({\n \"node_modules/browserify-aes/encrypter.js\"(exports) {\n var MODES = require_modes(), AuthCipher = require_authCipher(), Buffer2 = require_safe_buffer().Buffer, StreamCipher = require_streamCipher(), Transform = require_cipher_base(), aes = require_aes(), ebtk = require_evp_bytestokey(), inherits = require_inherits_browser();\n function Cipher(mode, key2, iv) {\n Transform.@call(this), this._cache = new Splitter, this._cipher = new aes.AES(key2), this._prev = Buffer2.from(iv), this._mode = mode, this._autopadding = !0;\n }\n inherits(Cipher, Transform), Cipher.prototype._update = function(data) {\n this._cache.add(data);\n for (var chunk, thing, out = [];chunk = this._cache.get(); )\n thing = this._mode.encrypt(this, chunk), out.push(thing);\n return Buffer2.concat(out);\n };\n var PADDING = Buffer2.alloc(16, 16);\n Cipher.prototype._final = function() {\n var chunk = this._cache.flush();\n if (this._autopadding)\n return chunk = this._mode.encrypt(this, chunk), this._cipher.scrub(), chunk;\n if (!chunk.equals(PADDING))\n throw this._cipher.scrub(), new Error(\"data not multiple of block length\");\n }, Cipher.prototype.setAutoPadding = function(setTo) {\n return this._autopadding = !!setTo, this;\n };\n function Splitter() {\n this.cache = Buffer2.allocUnsafe(0);\n }\n Splitter.prototype = {}, Splitter.prototype.add = function(data) {\n this.cache = Buffer2.concat([this.cache, data]);\n }, Splitter.prototype.get = function() {\n if (this.cache.length > 15) {\n var out = this.cache.slice(0, 16);\n return this.cache = this.cache.slice(16), out;\n }\n return null;\n }, Splitter.prototype.flush = function() {\n for (var len = 16 - this.cache.length, padBuff = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n padBuff.writeUInt8(len, i);\n return Buffer2.concat([this.cache, padBuff]);\n };\n function createCipheriv(suite, password, iv) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n password = getArrayBufferOrView(password, \"password\");\n const iv_length = iv\?.length || 0, required_iv_length = config.iv || 0;\n if (iv = iv === null \? EMPTY_BUFFER : getArrayBufferOrView(iv, \"iv\"), password\?.length !== config.key / 8) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n if (config.mode !== \"GCM\" && iv_length !== required_iv_length) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n return config.type === \"stream\" \? new StreamCipher(config.module, password, iv) : config.type === \"auth\" \? new AuthCipher(config.module, password, iv) : new Cipher(config.module, password, iv);\n }\n function createCipher(suite, password) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, config.key, config.iv);\n return createCipheriv(suite, keys.key, keys.iv);\n }\n exports.createCipheriv = createCipheriv, exports.createCipher = createCipher;\n }\n}), require_decrypter = __commonJS({\n \"node_modules/browserify-aes/decrypter.js\"(exports) {\n var AuthCipher = require_authCipher(), Buffer2 = require_safe_buffer().Buffer, MODES = require_modes(), StreamCipher = require_streamCipher(), Transform = require_cipher_base(), aes = require_aes(), ebtk = require_evp_bytestokey(), inherits = require_inherits_browser();\n function Decipher(mode, key2, iv) {\n Transform.@call(this), this._cache = new Splitter, this._last = void 0, this._cipher = new aes.AES(key2), this._prev = Buffer2.from(iv), this._mode = mode, this._autopadding = !0;\n }\n inherits(Decipher, Transform), Decipher.prototype._update = function(data) {\n this._cache.add(data);\n for (var chunk, thing, out = [];chunk = this._cache.get(this._autopadding); )\n thing = this._mode.decrypt(this, chunk), out.push(thing);\n return Buffer2.concat(out);\n }, Decipher.prototype._final = function() {\n var chunk = this._cache.flush();\n if (this._autopadding)\n return unpad(this._mode.decrypt(this, chunk));\n if (chunk)\n throw new Error(\"data not multiple of block length\");\n }, Decipher.prototype.setAutoPadding = function(setTo) {\n return this._autopadding = !!setTo, this;\n };\n function Splitter() {\n this.cache = Buffer2.allocUnsafe(0);\n }\n Splitter.prototype = {}, Splitter.prototype.add = function(data) {\n this.cache = Buffer2.concat([this.cache, data]);\n }, Splitter.prototype.get = function(autoPadding) {\n var out;\n if (autoPadding) {\n if (this.cache.length > 16)\n return out = this.cache.slice(0, 16), this.cache = this.cache.slice(16), out;\n } else if (this.cache.length >= 16)\n return out = this.cache.slice(0, 16), this.cache = this.cache.slice(16), out;\n return null;\n }, Splitter.prototype.flush = function() {\n if (this.cache.length)\n return this.cache;\n };\n function unpad(last) {\n var padded = last[15];\n if (padded < 1 || padded > 16)\n throw new Error(\"unable to decrypt data\");\n for (var i = -1;++i < padded; )\n if (last[i + (16 - padded)] !== padded)\n throw new Error(\"unable to decrypt data\");\n if (padded !== 16)\n return last.slice(0, 16 - padded);\n }\n function createDecipheriv(suite, password, iv) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n password = getArrayBufferOrView(password, \"password\");\n const iv_length = iv\?.length || 0, required_iv_length = config.iv || 0;\n if (iv = iv === null \? EMPTY_BUFFER : getArrayBufferOrView(iv, \"iv\"), config.mode !== \"GCM\" && iv_length !== required_iv_length) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n if (password.length !== config.key / 8) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n return config.type === \"stream\" \? new StreamCipher(config.module, password, iv, !0) : config.type === \"auth\" \? new AuthCipher(config.module, password, iv, !0) : new Decipher(config.module, password, iv);\n }\n function createDecipher(suite, password) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, config.key, config.iv);\n return createDecipheriv(suite, keys.key, keys.iv);\n }\n exports.createDecipher = createDecipher, exports.createDecipheriv = createDecipheriv;\n }\n}), require_browser5 = __commonJS({\n \"node_modules/browserify-aes/browser.js\"(exports) {\n var ciphers = require_encrypter(), deciphers = require_decrypter(), modes = require_list();\n function getCiphers() {\n return Object.keys(modes);\n }\n exports.createCipher = exports.Cipher = ciphers.createCipher, exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv, exports.createDecipher = exports.Decipher = deciphers.createDecipher, exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv, exports.listCiphers = exports.getCiphers = getCiphers;\n }\n}), require_modes2 = __commonJS({\n \"node_modules/browserify-des/modes.js\"(exports) {\n exports[\"des-ecb\"] = {\n key: 8,\n iv: 0\n }, exports[\"des-cbc\"] = exports.des = {\n key: 8,\n iv: 8\n }, exports[\"des-ede3-cbc\"] = exports.des3 = {\n key: 24,\n iv: 8\n }, exports[\"des-ede3\"] = {\n key: 24,\n iv: 0\n }, exports[\"des-ede-cbc\"] = {\n key: 16,\n iv: 8\n }, exports[\"des-ede\"] = {\n key: 16,\n iv: 0\n };\n }\n}), require_browser6 = __commonJS({\n \"node_modules/browserify-cipher/browser.js\"(exports) {\n var DES = require_browserify_des(), aes = require_browser5(), aesModes = require_modes(), desModes = require_modes2(), ebtk = require_evp_bytestokey();\n function createCipher(suite, password) {\n suite = suite.toLowerCase();\n var keyLen, ivLen;\n if (aesModes[suite])\n keyLen = aesModes[suite].key, ivLen = aesModes[suite].iv;\n else if (desModes[suite])\n keyLen = desModes[suite].key * 8, ivLen = desModes[suite].iv;\n else\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, keyLen, ivLen);\n return createCipheriv(suite, keys.key, keys.iv);\n }\n function createDecipher(suite, password) {\n suite = suite.toLowerCase();\n var keyLen, ivLen;\n if (aesModes[suite])\n keyLen = aesModes[suite].key, ivLen = aesModes[suite].iv;\n else if (desModes[suite])\n keyLen = desModes[suite].key * 8, ivLen = desModes[suite].iv;\n else\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, keyLen, ivLen);\n return createDecipheriv(suite, keys.key, keys.iv);\n }\n function createCipheriv(suite, key2, iv) {\n if (suite = suite.toLowerCase(), aesModes[suite])\n return aes.createCipheriv(suite, key2, iv);\n if (desModes[suite])\n return new DES({ key: key2, iv, mode: suite });\n @throwTypeError(\"invalid suite type\");\n }\n function createDecipheriv(suite, key2, iv) {\n if (suite = suite.toLowerCase(), aesModes[suite])\n return aes.createDecipheriv(suite, key2, iv);\n if (desModes[suite])\n return new DES({ key: key2, iv, mode: suite, decrypt: !0 });\n @throwTypeError(\"invalid suite type\");\n }\n function getCiphers() {\n return Object.keys(desModes).concat(aes.getCiphers());\n }\n exports.createCipher = exports.Cipher = createCipher, exports.createCipheriv = exports.Cipheriv = createCipheriv, exports.createDecipher = exports.Decipher = createDecipher, exports.createDecipheriv = exports.Decipheriv = createDecipheriv, exports.listCiphers = exports.getCiphers = getCiphers;\n }\n}), require_bn = __commonJS({\n \"node_modules/diffie-hellman/node_modules/bn.js/lib/bn.js\"(exports, module) {\n (function(module2, exports2) {\n function assert(val, msg) {\n if (!val)\n throw new Error(msg || \"Assertion failed\");\n }\n function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function() {\n };\n TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor, ctor.prototype.constructor = ctor;\n }\n function BN(number, base, endian) {\n if (BN.isBN(number))\n return number;\n this.negative = 0, this.words = null, this.length = 0, this.red = null, number !== null && ((base === \"le\" || base === \"be\") && (endian = base, base = 10), this._init(number || 0, base || 10, endian || \"be\"));\n }\n BN.prototype = {}, typeof module2 == \"object\" \? module2.exports = BN : exports2.BN = BN, BN.BN = BN, BN.wordSize = 26;\n var Buffer2 = Buffer;\n BN.isBN = function(num) {\n return num instanceof BN \? !0 : num !== null && typeof num == \"object\" && num.constructor.wordSize === BN.wordSize && @Array.isArray(num.words);\n }, BN.max = function(left, right) {\n return left.cmp(right) > 0 \? left : right;\n }, BN.min = function(left, right) {\n return left.cmp(right) < 0 \? left : right;\n }, BN.prototype._init = function(number, base, endian) {\n if (typeof number == \"number\")\n return this._initNumber(number, base, endian);\n if (typeof number == \"object\")\n return this._initArray(number, base, endian);\n base === \"hex\" && (base = 16), assert(base === (base | 0) && base >= 2 && base <= 36), number = number.toString().replace(/\\s+/g, \"\");\n var start = 0;\n number[0] === \"-\" && (start++, this.negative = 1), start < number.length && (base === 16 \? this._parseHex(number, start, endian) : (this._parseBase(number, base, start), endian === \"le\" && this._initArray(this.toArray(), base, endian)));\n }, BN.prototype._initNumber = function(number, base, endian) {\n number < 0 && (this.negative = 1, number = -number), number < 67108864 \? (this.words = [number & 67108863], this.length = 1) : number < 4503599627370496 \? (this.words = [number & 67108863, number / 67108864 & 67108863], this.length = 2) : (assert(number < 9007199254740992), this.words = [number & 67108863, number / 67108864 & 67108863, 1], this.length = 3), endian === \"le\" && this._initArray(this.toArray(), base, endian);\n }, BN.prototype._initArray = function(number, base, endian) {\n if (assert(typeof number.length == \"number\"), number.length <= 0)\n return this.words = [0], this.length = 1, this;\n this.length = Math.ceil(number.length / 3), this.words = new @Array(this.length);\n for (var i = 0;i < this.length; i++)\n this.words[i] = 0;\n var j, w, off = 0;\n if (endian === \"be\")\n for (i = number.length - 1, j = 0;i >= 0; i -= 3)\n w = number[i] | number[i - 1] << 8 | number[i - 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26 && (off -= 26, j++);\n else if (endian === \"le\")\n for (i = 0, j = 0;i < number.length; i += 3)\n w = number[i] | number[i + 1] << 8 | number[i + 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26 && (off -= 26, j++);\n return this.strip();\n };\n function parseHex4Bits(string, index) {\n var c = string.charCodeAt(index);\n return c >= 65 && c <= 70 \? c - 55 : c >= 97 && c <= 102 \? c - 87 : c - 48 & 15;\n }\n function parseHexByte(string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n return index - 1 >= lowerBound && (r |= parseHex4Bits(string, index - 1) << 4), r;\n }\n BN.prototype._parseHex = function(number, start, endian) {\n this.length = Math.ceil((number.length - start) / 6), this.words = new @Array(this.length);\n for (var i = 0;i < this.length; i++)\n this.words[i] = 0;\n var off = 0, j = 0, w;\n if (endian === \"be\")\n for (i = number.length - 1;i >= start; i -= 2)\n w = parseHexByte(number, start, i) << off, this.words[j] |= w & 67108863, off >= 18 \? (off -= 18, j += 1, this.words[j] |= w >>> 26) : off += 8;\n else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 \? start + 1 : start;i < number.length; i += 2)\n w = parseHexByte(number, start, i) << off, this.words[j] |= w & 67108863, off >= 18 \? (off -= 18, j += 1, this.words[j] |= w >>> 26) : off += 8;\n }\n this.strip();\n };\n function parseBase(str, start, end, mul) {\n for (var r = 0, len = Math.min(str.length, end), i = start;i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n r *= mul, c >= 49 \? r += c - 49 + 10 : c >= 17 \? r += c - 17 + 10 : r += c;\n }\n return r;\n }\n BN.prototype._parseBase = function(number, base, start) {\n this.words = [0], this.length = 1;\n for (var limbLen = 0, limbPow = 1;limbPow <= 67108863; limbPow *= base)\n limbLen++;\n limbLen--, limbPow = limbPow / base | 0;\n for (var total = number.length - start, mod = total % limbLen, end = Math.min(total, total - mod) + start, word = 0, i = start;i < end; i += limbLen)\n word = parseBase(number, i, i + limbLen, base), this.imuln(limbPow), this.words[0] + word < 67108864 \? this.words[0] += word : this._iaddn(word);\n if (mod !== 0) {\n var pow = 1;\n for (word = parseBase(number, i, number.length, base), i = 0;i < mod; i++)\n pow *= base;\n this.imuln(pow), this.words[0] + word < 67108864 \? this.words[0] += word : this._iaddn(word);\n }\n this.strip();\n }, BN.prototype.copy = function(dest) {\n dest.words = new @Array(this.length);\n for (var i = 0;i < this.length; i++)\n dest.words[i] = this.words[i];\n dest.length = this.length, dest.negative = this.negative, dest.red = this.red;\n }, BN.prototype.clone = function() {\n var r = new BN(null);\n return this.copy(r), r;\n }, BN.prototype._expand = function(size) {\n for (;this.length < size; )\n this.words[this.length++] = 0;\n return this;\n }, BN.prototype.strip = function() {\n for (;this.length > 1 && this.words[this.length - 1] === 0; )\n this.length--;\n return this._normSign();\n }, BN.prototype._normSign = function() {\n return this.length === 1 && this.words[0] === 0 && (this.negative = 0), this;\n }, BN.prototype.inspect = function() {\n return (this.red \? \"<BN-R: \" : \"<BN: \") + this.toString(16) + \">\";\n };\n var zeros = [\n \"\",\n \"0\",\n \"00\",\n \"000\",\n \"0000\",\n \"00000\",\n \"000000\",\n \"0000000\",\n \"00000000\",\n \"000000000\",\n \"0000000000\",\n \"00000000000\",\n \"000000000000\",\n \"0000000000000\",\n \"00000000000000\",\n \"000000000000000\",\n \"0000000000000000\",\n \"00000000000000000\",\n \"000000000000000000\",\n \"0000000000000000000\",\n \"00000000000000000000\",\n \"000000000000000000000\",\n \"0000000000000000000000\",\n \"00000000000000000000000\",\n \"000000000000000000000000\",\n \"0000000000000000000000000\"\n ], groupSizes = [\n 0,\n 0,\n 25,\n 16,\n 12,\n 11,\n 10,\n 9,\n 8,\n 8,\n 7,\n 7,\n 7,\n 7,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5\n ], groupBases = [\n 0,\n 0,\n 33554432,\n 43046721,\n 16777216,\n 48828125,\n 60466176,\n 40353607,\n 16777216,\n 43046721,\n 1e7,\n 19487171,\n 35831808,\n 62748517,\n 7529536,\n 11390625,\n 16777216,\n 24137569,\n 34012224,\n 47045881,\n 64000000,\n 4084101,\n 5153632,\n 6436343,\n 7962624,\n 9765625,\n 11881376,\n 14348907,\n 17210368,\n 20511149,\n 24300000,\n 28629151,\n 33554432,\n 39135393,\n 45435424,\n 52521875,\n 60466176\n ];\n BN.prototype.toString = function(base, padding) {\n base = base || 10, padding = padding | 0 || 1;\n var out;\n if (base === 16 || base === \"hex\") {\n out = \"\";\n for (var off = 0, carry = 0, i = 0;i < this.length; i++) {\n var w = this.words[i], word = ((w << off | carry) & 16777215).toString(16);\n carry = w >>> 24 - off & 16777215, carry !== 0 || i !== this.length - 1 \? out = zeros[6 - word.length] + word + out : out = word + out, off += 2, off >= 26 && (off -= 26, i--);\n }\n for (carry !== 0 && (out = carry.toString(16) + out);out.length % padding !== 0; )\n out = \"0\" + out;\n return this.negative !== 0 && (out = \"-\" + out), out;\n }\n if (base === (base | 0) && base >= 2 && base <= 36) {\n var groupSize = groupSizes[base], groupBase = groupBases[base];\n out = \"\";\n var c = this.clone();\n for (c.negative = 0;!c.isZero(); ) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase), c.isZero() \? out = r + out : out = zeros[groupSize - r.length] + r + out;\n }\n for (this.isZero() && (out = \"0\" + out);out.length % padding !== 0; )\n out = \"0\" + out;\n return this.negative !== 0 && (out = \"-\" + out), out;\n }\n assert(!1, \"Base should be between 2 and 36\");\n }, BN.prototype.toNumber = function() {\n var ret = this.words[0];\n return this.length === 2 \? ret += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 \? ret += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && assert(!1, \"Number can only safely store up to 53 bits\"), this.negative !== 0 \? -ret : ret;\n }, BN.prototype.toJSON = function() {\n return this.toString(16);\n }, BN.prototype.toBuffer = function(endian, length) {\n return assert(typeof Buffer2 < \"u\"), this.toArrayLike(Buffer2, endian, length);\n }, BN.prototype.toArray = function(endian, length) {\n return this.toArrayLike(@Array, endian, length);\n }, BN.prototype.toArrayLike = function(ArrayType, endian, length) {\n var byteLength = this.byteLength(), reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, \"byte array longer than desired length\"), assert(reqLength > 0, \"Requested array length <= 0\"), this.strip();\n var littleEndian = endian === \"le\", res = new ArrayType(reqLength), b, i, q = this.clone();\n if (littleEndian) {\n for (i = 0;!q.isZero(); i++)\n b = q.andln(255), q.iushrn(8), res[i] = b;\n for (;i < reqLength; i++)\n res[i] = 0;\n } else {\n for (i = 0;i < reqLength - byteLength; i++)\n res[i] = 0;\n for (i = 0;!q.isZero(); i++)\n b = q.andln(255), q.iushrn(8), res[reqLength - i - 1] = b;\n }\n return res;\n }, Math.clz32 \? BN.prototype._countBits = function(w) {\n return 32 - Math.clz32(w);\n } : BN.prototype._countBits = function(w) {\n var t = w, r = 0;\n return t >= 4096 && (r += 13, t >>>= 13), t >= 64 && (r += 7, t >>>= 7), t >= 8 && (r += 4, t >>>= 4), t >= 2 && (r += 2, t >>>= 2), r + t;\n }, BN.prototype._zeroBits = function(w) {\n if (w === 0)\n return 26;\n var t = w, r = 0;\n return (t & 8191) === 0 && (r += 13, t >>>= 13), (t & 127) === 0 && (r += 7, t >>>= 7), (t & 15) === 0 && (r += 4, t >>>= 4), (t & 3) === 0 && (r += 2, t >>>= 2), (t & 1) === 0 && r++, r;\n }, BN.prototype.bitLength = function() {\n var w = this.words[this.length - 1], hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n function toBitArray(num) {\n for (var w = new @Array(num.bitLength()), bit = 0;bit < w.length; bit++) {\n var off = bit / 26 | 0, wbit = bit % 26;\n w[bit] = (num.words[off] & 1 << wbit) >>> wbit;\n }\n return w;\n }\n BN.prototype.zeroBits = function() {\n if (this.isZero())\n return 0;\n for (var r = 0, i = 0;i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n if (r += b, b !== 26)\n break;\n }\n return r;\n }, BN.prototype.byteLength = function() {\n return Math.ceil(this.bitLength() / 8);\n }, BN.prototype.toTwos = function(width) {\n return this.negative !== 0 \? this.abs().inotn(width).iaddn(1) : this.clone();\n }, BN.prototype.fromTwos = function(width) {\n return this.testn(width - 1) \? this.notn(width).iaddn(1).ineg() : this.clone();\n }, BN.prototype.isNeg = function() {\n return this.negative !== 0;\n }, BN.prototype.neg = function() {\n return this.clone().ineg();\n }, BN.prototype.ineg = function() {\n return this.isZero() || (this.negative ^= 1), this;\n }, BN.prototype.iuor = function(num) {\n for (;this.length < num.length; )\n this.words[this.length++] = 0;\n for (var i = 0;i < num.length; i++)\n this.words[i] = this.words[i] | num.words[i];\n return this.strip();\n }, BN.prototype.ior = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuor(num);\n }, BN.prototype.or = function(num) {\n return this.length > num.length \? this.clone().ior(num) : num.clone().ior(this);\n }, BN.prototype.uor = function(num) {\n return this.length > num.length \? this.clone().iuor(num) : num.clone().iuor(this);\n }, BN.prototype.iuand = function(num) {\n var b;\n this.length > num.length \? b = num : b = this;\n for (var i = 0;i < b.length; i++)\n this.words[i] = this.words[i] & num.words[i];\n return this.length = b.length, this.strip();\n }, BN.prototype.iand = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuand(num);\n }, BN.prototype.and = function(num) {\n return this.length > num.length \? this.clone().iand(num) : num.clone().iand(this);\n }, BN.prototype.uand = function(num) {\n return this.length > num.length \? this.clone().iuand(num) : num.clone().iuand(this);\n }, BN.prototype.iuxor = function(num) {\n var a, b;\n this.length > num.length \? (a = this, b = num) : (a = num, b = this);\n for (var i = 0;i < b.length; i++)\n this.words[i] = a.words[i] ^ b.words[i];\n if (this !== a)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this.length = a.length, this.strip();\n }, BN.prototype.ixor = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuxor(num);\n }, BN.prototype.xor = function(num) {\n return this.length > num.length \? this.clone().ixor(num) : num.clone().ixor(this);\n }, BN.prototype.uxor = function(num) {\n return this.length > num.length \? this.clone().iuxor(num) : num.clone().iuxor(this);\n }, BN.prototype.inotn = function(width) {\n assert(typeof width == \"number\" && width >= 0);\n var bytesNeeded = Math.ceil(width / 26) | 0, bitsLeft = width % 26;\n this._expand(bytesNeeded), bitsLeft > 0 && bytesNeeded--;\n for (var i = 0;i < bytesNeeded; i++)\n this.words[i] = ~this.words[i] & 67108863;\n return bitsLeft > 0 && (this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft), this.strip();\n }, BN.prototype.notn = function(width) {\n return this.clone().inotn(width);\n }, BN.prototype.setn = function(bit, val) {\n assert(typeof bit == \"number\" && bit >= 0);\n var off = bit / 26 | 0, wbit = bit % 26;\n return this._expand(off + 1), val \? this.words[off] = this.words[off] | 1 << wbit : this.words[off] = this.words[off] & ~(1 << wbit), this.strip();\n }, BN.prototype.iadd = function(num) {\n var r;\n if (this.negative !== 0 && num.negative === 0)\n return this.negative = 0, r = this.isub(num), this.negative ^= 1, this._normSign();\n if (this.negative === 0 && num.negative !== 0)\n return num.negative = 0, r = this.isub(num), num.negative = 1, r._normSign();\n var a, b;\n this.length > num.length \? (a = this, b = num) : (a = num, b = this);\n for (var carry = 0, i = 0;i < b.length; i++)\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry, this.words[i] = r & 67108863, carry = r >>> 26;\n for (;carry !== 0 && i < a.length; i++)\n r = (a.words[i] | 0) + carry, this.words[i] = r & 67108863, carry = r >>> 26;\n if (this.length = a.length, carry !== 0)\n this.words[this.length] = carry, this.length++;\n else if (a !== this)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this;\n }, BN.prototype.add = function(num) {\n var res;\n return num.negative !== 0 && this.negative === 0 \? (num.negative = 0, res = this.sub(num), num.negative ^= 1, res) : num.negative === 0 && this.negative !== 0 \? (this.negative = 0, res = num.sub(this), this.negative = 1, res) : this.length > num.length \? this.clone().iadd(num) : num.clone().iadd(this);\n }, BN.prototype.isub = function(num) {\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n return num.negative = 1, r._normSign();\n } else if (this.negative !== 0)\n return this.negative = 0, this.iadd(num), this.negative = 1, this._normSign();\n var cmp = this.cmp(num);\n if (cmp === 0)\n return this.negative = 0, this.length = 1, this.words[0] = 0, this;\n var a, b;\n cmp > 0 \? (a = this, b = num) : (a = num, b = this);\n for (var carry = 0, i = 0;i < b.length; i++)\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry, carry = r >> 26, this.words[i] = r & 67108863;\n for (;carry !== 0 && i < a.length; i++)\n r = (a.words[i] | 0) + carry, carry = r >> 26, this.words[i] = r & 67108863;\n if (carry === 0 && i < a.length && a !== this)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this.length = Math.max(this.length, i), a !== this && (this.negative = 1), this.strip();\n }, BN.prototype.sub = function(num) {\n return this.clone().isub(num);\n };\n function smallMulTo(self2, num, out) {\n out.negative = num.negative ^ self2.negative;\n var len = self2.length + num.length | 0;\n out.length = len, len = len - 1 | 0;\n var a = self2.words[0] | 0, b = num.words[0] | 0, r = a * b, lo = r & 67108863, carry = r / 67108864 | 0;\n out.words[0] = lo;\n for (var k = 1;k < len; k++) {\n for (var ncarry = carry >>> 26, rword = carry & 67108863, maxJ = Math.min(k, num.length - 1), j = Math.max(0, k - self2.length + 1);j <= maxJ; j++) {\n var i = k - j | 0;\n a = self2.words[i] | 0, b = num.words[j] | 0, r = a * b + rword, ncarry += r / 67108864 | 0, rword = r & 67108863;\n }\n out.words[k] = rword | 0, carry = ncarry | 0;\n }\n return carry !== 0 \? out.words[k] = carry | 0 : out.length--, out.strip();\n }\n var comb10MulTo = function(self2, num, out) {\n var a = self2.words, b = num.words, o = out.words, c = 0, lo, mid, hi, a0 = a[0] | 0, al0 = a0 & 8191, ah0 = a0 >>> 13, a1 = a[1] | 0, al1 = a1 & 8191, ah1 = a1 >>> 13, a2 = a[2] | 0, al2 = a2 & 8191, ah2 = a2 >>> 13, a3 = a[3] | 0, al3 = a3 & 8191, ah3 = a3 >>> 13, a4 = a[4] | 0, al4 = a4 & 8191, ah4 = a4 >>> 13, a5 = a[5] | 0, al5 = a5 & 8191, ah5 = a5 >>> 13, a6 = a[6] | 0, al6 = a6 & 8191, ah6 = a6 >>> 13, a7 = a[7] | 0, al7 = a7 & 8191, ah7 = a7 >>> 13, a8 = a[8] | 0, al8 = a8 & 8191, ah8 = a8 >>> 13, a9 = a[9] | 0, al9 = a9 & 8191, ah9 = a9 >>> 13, b0 = b[0] | 0, bl0 = b0 & 8191, bh0 = b0 >>> 13, b1 = b[1] | 0, bl1 = b1 & 8191, bh1 = b1 >>> 13, b2 = b[2] | 0, bl2 = b2 & 8191, bh2 = b2 >>> 13, b3 = b[3] | 0, bl3 = b3 & 8191, bh3 = b3 >>> 13, b4 = b[4] | 0, bl4 = b4 & 8191, bh4 = b4 >>> 13, b5 = b[5] | 0, bl5 = b5 & 8191, bh5 = b5 >>> 13, b6 = b[6] | 0, bl6 = b6 & 8191, bh6 = b6 >>> 13, b7 = b[7] | 0, bl7 = b7 & 8191, bh7 = b7 >>> 13, b8 = b[8] | 0, bl8 = b8 & 8191, bh8 = b8 >>> 13, b9 = b[9] | 0, bl9 = b9 & 8191, bh9 = b9 >>> 13;\n out.negative = self2.negative ^ num.negative, out.length = 19, lo = Math.imul(al0, bl0), mid = Math.imul(al0, bh0), mid = mid + Math.imul(ah0, bl0) | 0, hi = Math.imul(ah0, bh0);\n var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0, w0 &= 67108863, lo = Math.imul(al1, bl0), mid = Math.imul(al1, bh0), mid = mid + Math.imul(ah1, bl0) | 0, hi = Math.imul(ah1, bh0), lo = lo + Math.imul(al0, bl1) | 0, mid = mid + Math.imul(al0, bh1) | 0, mid = mid + Math.imul(ah0, bl1) | 0, hi = hi + Math.imul(ah0, bh1) | 0;\n var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0, w1 &= 67108863, lo = Math.imul(al2, bl0), mid = Math.imul(al2, bh0), mid = mid + Math.imul(ah2, bl0) | 0, hi = Math.imul(ah2, bh0), lo = lo + Math.imul(al1, bl1) | 0, mid = mid + Math.imul(al1, bh1) | 0, mid = mid + Math.imul(ah1, bl1) | 0, hi = hi + Math.imul(ah1, bh1) | 0, lo = lo + Math.imul(al0, bl2) | 0, mid = mid + Math.imul(al0, bh2) | 0, mid = mid + Math.imul(ah0, bl2) | 0, hi = hi + Math.imul(ah0, bh2) | 0;\n var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0, w2 &= 67108863, lo = Math.imul(al3, bl0), mid = Math.imul(al3, bh0), mid = mid + Math.imul(ah3, bl0) | 0, hi = Math.imul(ah3, bh0), lo = lo + Math.imul(al2, bl1) | 0, mid = mid + Math.imul(al2, bh1) | 0, mid = mid + Math.imul(ah2, bl1) | 0, hi = hi + Math.imul(ah2, bh1) | 0, lo = lo + Math.imul(al1, bl2) | 0, mid = mid + Math.imul(al1, bh2) | 0, mid = mid + Math.imul(ah1, bl2) | 0, hi = hi + Math.imul(ah1, bh2) | 0, lo = lo + Math.imul(al0, bl3) | 0, mid = mid + Math.imul(al0, bh3) | 0, mid = mid + Math.imul(ah0, bl3) | 0, hi = hi + Math.imul(ah0, bh3) | 0;\n var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0, w3 &= 67108863, lo = Math.imul(al4, bl0), mid = Math.imul(al4, bh0), mid = mid + Math.imul(ah4, bl0) | 0, hi = Math.imul(ah4, bh0), lo = lo + Math.imul(al3, bl1) | 0, mid = mid + Math.imul(al3, bh1) | 0, mid = mid + Math.imul(ah3, bl1) | 0, hi = hi + Math.imul(ah3, bh1) | 0, lo = lo + Math.imul(al2, bl2) | 0, mid = mid + Math.imul(al2, bh2) | 0, mid = mid + Math.imul(ah2, bl2) | 0, hi = hi + Math.imul(ah2, bh2) | 0, lo = lo + Math.imul(al1, bl3) | 0, mid = mid + Math.imul(al1, bh3) | 0, mid = mid + Math.imul(ah1, bl3) | 0, hi = hi + Math.imul(ah1, bh3) | 0, lo = lo + Math.imul(al0, bl4) | 0, mid = mid + Math.imul(al0, bh4) | 0, mid = mid + Math.imul(ah0, bl4) | 0, hi = hi + Math.imul(ah0, bh4) | 0;\n var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0, w4 &= 67108863, lo = Math.imul(al5, bl0), mid = Math.imul(al5, bh0), mid = mid + Math.imul(ah5, bl0) | 0, hi = Math.imul(ah5, bh0), lo = lo + Math.imul(al4, bl1) | 0, mid = mid + Math.imul(al4, bh1) | 0, mid = mid + Math.imul(ah4, bl1) | 0, hi = hi + Math.imul(ah4, bh1) | 0, lo = lo + Math.imul(al3, bl2) | 0, mid = mid + Math.imul(al3, bh2) | 0, mid = mid + Math.imul(ah3, bl2) | 0, hi = hi + Math.imul(ah3, bh2) | 0, lo = lo + Math.imul(al2, bl3) | 0, mid = mid + Math.imul(al2, bh3) | 0, mid = mid + Math.imul(ah2, bl3) | 0, hi = hi + Math.imul(ah2, bh3) | 0, lo = lo + Math.imul(al1, bl4) | 0, mid = mid + Math.imul(al1, bh4) | 0, mid = mid + Math.imul(ah1, bl4) | 0, hi = hi + Math.imul(ah1, bh4) | 0, lo = lo + Math.imul(al0, bl5) | 0, mid = mid + Math.imul(al0, bh5) | 0, mid = mid + Math.imul(ah0, bl5) | 0, hi = hi + Math.imul(ah0, bh5) | 0;\n var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0, w5 &= 67108863, lo = Math.imul(al6, bl0), mid = Math.imul(al6, bh0), mid = mid + Math.imul(ah6, bl0) | 0, hi = Math.imul(ah6, bh0), lo = lo + Math.imul(al5, bl1) | 0, mid = mid + Math.imul(al5, bh1) | 0, mid = mid + Math.imul(ah5, bl1) | 0, hi = hi + Math.imul(ah5, bh1) | 0, lo = lo + Math.imul(al4, bl2) | 0, mid = mid + Math.imul(al4, bh2) | 0, mid = mid + Math.imul(ah4, bl2) | 0, hi = hi + Math.imul(ah4, bh2) | 0, lo = lo + Math.imul(al3, bl3) | 0, mid = mid + Math.imul(al3, bh3) | 0, mid = mid + Math.imul(ah3, bl3) | 0, hi = hi + Math.imul(ah3, bh3) | 0, lo = lo + Math.imul(al2, bl4) | 0, mid = mid + Math.imul(al2, bh4) | 0, mid = mid + Math.imul(ah2, bl4) | 0, hi = hi + Math.imul(ah2, bh4) | 0, lo = lo + Math.imul(al1, bl5) | 0, mid = mid + Math.imul(al1, bh5) | 0, mid = mid + Math.imul(ah1, bl5) | 0, hi = hi + Math.imul(ah1, bh5) | 0, lo = lo + Math.imul(al0, bl6) | 0, mid = mid + Math.imul(al0, bh6) | 0, mid = mid + Math.imul(ah0, bl6) | 0, hi = hi + Math.imul(ah0, bh6) | 0;\n var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0, w6 &= 67108863, lo = Math.imul(al7, bl0), mid = Math.imul(al7, bh0), mid = mid + Math.imul(ah7, bl0) | 0, hi = Math.imul(ah7, bh0), lo = lo + Math.imul(al6, bl1) | 0, mid = mid + Math.imul(al6, bh1) | 0, mid = mid + Math.imul(ah6, bl1) | 0, hi = hi + Math.imul(ah6, bh1) | 0, lo = lo + Math.imul(al5, bl2) | 0, mid = mid + Math.imul(al5, bh2) | 0, mid = mid + Math.imul(ah5, bl2) | 0, hi = hi + Math.imul(ah5, bh2) | 0, lo = lo + Math.imul(al4, bl3) | 0, mid = mid + Math.imul(al4, bh3) | 0, mid = mid + Math.imul(ah4, bl3) | 0, hi = hi + Math.imul(ah4, bh3) | 0, lo = lo + Math.imul(al3, bl4) | 0, mid = mid + Math.imul(al3, bh4) | 0, mid = mid + Math.imul(ah3, bl4) | 0, hi = hi + Math.imul(ah3, bh4) | 0, lo = lo + Math.imul(al2, bl5) | 0, mid = mid + Math.imul(al2, bh5) | 0, mid = mid + Math.imul(ah2, bl5) | 0, hi = hi + Math.imul(ah2, bh5) | 0, lo = lo + Math.imul(al1, bl6) | 0, mid = mid + Math.imul(al1, bh6) | 0, mid = mid + Math.imul(ah1, bl6) | 0, hi = hi + Math.imul(ah1, bh6) | 0, lo = lo + Math.imul(al0, bl7) | 0, mid = mid + Math.imul(al0, bh7) | 0, mid = mid + Math.imul(ah0, bl7) | 0, hi = hi + Math.imul(ah0, bh7) | 0;\n var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0, w7 &= 67108863, lo = Math.imul(al8, bl0), mid = Math.imul(al8, bh0), mid = mid + Math.imul(ah8, bl0) | 0, hi = Math.imul(ah8, bh0), lo = lo + Math.imul(al7, bl1) | 0, mid = mid + Math.imul(al7, bh1) | 0, mid = mid + Math.imul(ah7, bl1) | 0, hi = hi + Math.imul(ah7, bh1) | 0, lo = lo + Math.imul(al6, bl2) | 0, mid = mid + Math.imul(al6, bh2) | 0, mid = mid + Math.imul(ah6, bl2) | 0, hi = hi + Math.imul(ah6, bh2) | 0, lo = lo + Math.imul(al5, bl3) | 0, mid = mid + Math.imul(al5, bh3) | 0, mid = mid + Math.imul(ah5, bl3) | 0, hi = hi + Math.imul(ah5, bh3) | 0, lo = lo + Math.imul(al4, bl4) | 0, mid = mid + Math.imul(al4, bh4) | 0, mid = mid + Math.imul(ah4, bl4) | 0, hi = hi + Math.imul(ah4, bh4) | 0, lo = lo + Math.imul(al3, bl5) | 0, mid = mid + Math.imul(al3, bh5) | 0, mid = mid + Math.imul(ah3, bl5) | 0, hi = hi + Math.imul(ah3, bh5) | 0, lo = lo + Math.imul(al2, bl6) | 0, mid = mid + Math.imul(al2, bh6) | 0, mid = mid + Math.imul(ah2, bl6) | 0, hi = hi + Math.imul(ah2, bh6) | 0, lo = lo + Math.imul(al1, bl7) | 0, mid = mid + Math.imul(al1, bh7) | 0, mid = mid + Math.imul(ah1, bl7) | 0, hi = hi + Math.imul(ah1, bh7) | 0, lo = lo + Math.imul(al0, bl8) | 0, mid = mid + Math.imul(al0, bh8) | 0, mid = mid + Math.imul(ah0, bl8) | 0, hi = hi + Math.imul(ah0, bh8) | 0;\n var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0, w8 &= 67108863, lo = Math.imul(al9, bl0), mid = Math.imul(al9, bh0), mid = mid + Math.imul(ah9, bl0) | 0, hi = Math.imul(ah9, bh0), lo = lo + Math.imul(al8, bl1) | 0, mid = mid + Math.imul(al8, bh1) | 0, mid = mid + Math.imul(ah8, bl1) | 0, hi = hi + Math.imul(ah8, bh1) | 0, lo = lo + Math.imul(al7, bl2) | 0, mid = mid + Math.imul(al7, bh2) | 0, mid = mid + Math.imul(ah7, bl2) | 0, hi = hi + Math.imul(ah7, bh2) | 0, lo = lo + Math.imul(al6, bl3) | 0, mid = mid + Math.imul(al6, bh3) | 0, mid = mid + Math.imul(ah6, bl3) | 0, hi = hi + Math.imul(ah6, bh3) | 0, lo = lo + Math.imul(al5, bl4) | 0, mid = mid + Math.imul(al5, bh4) | 0, mid = mid + Math.imul(ah5, bl4) | 0, hi = hi + Math.imul(ah5, bh4) | 0, lo = lo + Math.imul(al4, bl5) | 0, mid = mid + Math.imul(al4, bh5) | 0, mid = mid + Math.imul(ah4, bl5) | 0, hi = hi + Math.imul(ah4, bh5) | 0, lo = lo + Math.imul(al3, bl6) | 0, mid = mid + Math.imul(al3, bh6) | 0, mid = mid + Math.imul(ah3, bl6) | 0, hi = hi + Math.imul(ah3, bh6) | 0, lo = lo + Math.imul(al2, bl7) | 0, mid = mid + Math.imul(al2, bh7) | 0, mid = mid + Math.imul(ah2, bl7) | 0, hi = hi + Math.imul(ah2, bh7) | 0, lo = lo + Math.imul(al1, bl8) | 0, mid = mid + Math.imul(al1, bh8) | 0, mid = mid + Math.imul(ah1, bl8) | 0, hi = hi + Math.imul(ah1, bh8) | 0, lo = lo + Math.imul(al0, bl9) | 0, mid = mid + Math.imul(al0, bh9) | 0, mid = mid + Math.imul(ah0, bl9) | 0, hi = hi + Math.imul(ah0, bh9) | 0;\n var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0, w9 &= 67108863, lo = Math.imul(al9, bl1), mid = Math.imul(al9, bh1), mid = mid + Math.imul(ah9, bl1) | 0, hi = Math.imul(ah9, bh1), lo = lo + Math.imul(al8, bl2) | 0, mid = mid + Math.imul(al8, bh2) | 0, mid = mid + Math.imul(ah8, bl2) | 0, hi = hi + Math.imul(ah8, bh2) | 0, lo = lo + Math.imul(al7, bl3) | 0, mid = mid + Math.imul(al7, bh3) | 0, mid = mid + Math.imul(ah7, bl3) | 0, hi = hi + Math.imul(ah7, bh3) | 0, lo = lo + Math.imul(al6, bl4) | 0, mid = mid + Math.imul(al6, bh4) | 0, mid = mid + Math.imul(ah6, bl4) | 0, hi = hi + Math.imul(ah6, bh4) | 0, lo = lo + Math.imul(al5, bl5) | 0, mid = mid + Math.imul(al5, bh5) | 0, mid = mid + Math.imul(ah5, bl5) | 0, hi = hi + Math.imul(ah5, bh5) | 0, lo = lo + Math.imul(al4, bl6) | 0, mid = mid + Math.imul(al4, bh6) | 0, mid = mid + Math.imul(ah4, bl6) | 0, hi = hi + Math.imul(ah4, bh6) | 0, lo = lo + Math.imul(al3, bl7) | 0, mid = mid + Math.imul(al3, bh7) | 0, mid = mid + Math.imul(ah3, bl7) | 0, hi = hi + Math.imul(ah3, bh7) | 0, lo = lo + Math.imul(al2, bl8) | 0, mid = mid + Math.imul(al2, bh8) | 0, mid = mid + Math.imul(ah2, bl8) | 0, hi = hi + Math.imul(ah2, bh8) | 0, lo = lo + Math.imul(al1, bl9) | 0, mid = mid + Math.imul(al1, bh9) | 0, mid = mid + Math.imul(ah1, bl9) | 0, hi = hi + Math.imul(ah1, bh9) | 0;\n var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0, w10 &= 67108863, lo = Math.imul(al9, bl2), mid = Math.imul(al9, bh2), mid = mid + Math.imul(ah9, bl2) | 0, hi = Math.imul(ah9, bh2), lo = lo + Math.imul(al8, bl3) | 0, mid = mid + Math.imul(al8, bh3) | 0, mid = mid + Math.imul(ah8, bl3) | 0, hi = hi + Math.imul(ah8, bh3) | 0, lo = lo + Math.imul(al7, bl4) | 0, mid = mid + Math.imul(al7, bh4) | 0, mid = mid + Math.imul(ah7, bl4) | 0, hi = hi + Math.imul(ah7, bh4) | 0, lo = lo + Math.imul(al6, bl5) | 0, mid = mid + Math.imul(al6, bh5) | 0, mid = mid + Math.imul(ah6, bl5) | 0, hi = hi + Math.imul(ah6, bh5) | 0, lo = lo + Math.imul(al5, bl6) | 0, mid = mid + Math.imul(al5, bh6) | 0, mid = mid + Math.imul(ah5, bl6) | 0, hi = hi + Math.imul(ah5, bh6) | 0, lo = lo + Math.imul(al4, bl7) | 0, mid = mid + Math.imul(al4, bh7) | 0, mid = mid + Math.imul(ah4, bl7) | 0, hi = hi + Math.imul(ah4, bh7) | 0, lo = lo + Math.imul(al3, bl8) | 0, mid = mid + Math.imul(al3, bh8) | 0, mid = mid + Math.imul(ah3, bl8) | 0, hi = hi + Math.imul(ah3, bh8) | 0, lo = lo + Math.imul(al2, bl9) | 0, mid = mid + Math.imul(al2, bh9) | 0, mid = mid + Math.imul(ah2, bl9) | 0, hi = hi + Math.imul(ah2, bh9) | 0;\n var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0, w11 &= 67108863, lo = Math.imul(al9, bl3), mid = Math.imul(al9, bh3), mid = mid + Math.imul(ah9, bl3) | 0, hi = Math.imul(ah9, bh3), lo = lo + Math.imul(al8, bl4) | 0, mid = mid + Math.imul(al8, bh4) | 0, mid = mid + Math.imul(ah8, bl4) | 0, hi = hi + Math.imul(ah8, bh4) | 0, lo = lo + Math.imul(al7, bl5) | 0, mid = mid + Math.imul(al7, bh5) | 0, mid = mid + Math.imul(ah7, bl5) | 0, hi = hi + Math.imul(ah7, bh5) | 0, lo = lo + Math.imul(al6, bl6) | 0, mid = mid + Math.imul(al6, bh6) | 0, mid = mid + Math.imul(ah6, bl6) | 0, hi = hi + Math.imul(ah6, bh6) | 0, lo = lo + Math.imul(al5, bl7) | 0, mid = mid + Math.imul(al5, bh7) | 0, mid = mid + Math.imul(ah5, bl7) | 0, hi = hi + Math.imul(ah5, bh7) | 0, lo = lo + Math.imul(al4, bl8) | 0, mid = mid + Math.imul(al4, bh8) | 0, mid = mid + Math.imul(ah4, bl8) | 0, hi = hi + Math.imul(ah4, bh8) | 0, lo = lo + Math.imul(al3, bl9) | 0, mid = mid + Math.imul(al3, bh9) | 0, mid = mid + Math.imul(ah3, bl9) | 0, hi = hi + Math.imul(ah3, bh9) | 0;\n var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0, w12 &= 67108863, lo = Math.imul(al9, bl4), mid = Math.imul(al9, bh4), mid = mid + Math.imul(ah9, bl4) | 0, hi = Math.imul(ah9, bh4), lo = lo + Math.imul(al8, bl5) | 0, mid = mid + Math.imul(al8, bh5) | 0, mid = mid + Math.imul(ah8, bl5) | 0, hi = hi + Math.imul(ah8, bh5) | 0, lo = lo + Math.imul(al7, bl6) | 0, mid = mid + Math.imul(al7, bh6) | 0, mid = mid + Math.imul(ah7, bl6) | 0, hi = hi + Math.imul(ah7, bh6) | 0, lo = lo + Math.imul(al6, bl7) | 0, mid = mid + Math.imul(al6, bh7) | 0, mid = mid + Math.imul(ah6, bl7) | 0, hi = hi + Math.imul(ah6, bh7) | 0, lo = lo + Math.imul(al5, bl8) | 0, mid = mid + Math.imul(al5, bh8) | 0, mid = mid + Math.imul(ah5, bl8) | 0, hi = hi + Math.imul(ah5, bh8) | 0, lo = lo + Math.imul(al4, bl9) | 0, mid = mid + Math.imul(al4, bh9) | 0, mid = mid + Math.imul(ah4, bl9) | 0, hi = hi + Math.imul(ah4, bh9) | 0;\n var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0, w13 &= 67108863, lo = Math.imul(al9, bl5), mid = Math.imul(al9, bh5), mid = mid + Math.imul(ah9, bl5) | 0, hi = Math.imul(ah9, bh5), lo = lo + Math.imul(al8, bl6) | 0, mid = mid + Math.imul(al8, bh6) | 0, mid = mid + Math.imul(ah8, bl6) | 0, hi = hi + Math.imul(ah8, bh6) | 0, lo = lo + Math.imul(al7, bl7) | 0, mid = mid + Math.imul(al7, bh7) | 0, mid = mid + Math.imul(ah7, bl7) | 0, hi = hi + Math.imul(ah7, bh7) | 0, lo = lo + Math.imul(al6, bl8) | 0, mid = mid + Math.imul(al6, bh8) | 0, mid = mid + Math.imul(ah6, bl8) | 0, hi = hi + Math.imul(ah6, bh8) | 0, lo = lo + Math.imul(al5, bl9) | 0, mid = mid + Math.imul(al5, bh9) | 0, mid = mid + Math.imul(ah5, bl9) | 0, hi = hi + Math.imul(ah5, bh9) | 0;\n var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0, w14 &= 67108863, lo = Math.imul(al9, bl6), mid = Math.imul(al9, bh6), mid = mid + Math.imul(ah9, bl6) | 0, hi = Math.imul(ah9, bh6), lo = lo + Math.imul(al8, bl7) | 0, mid = mid + Math.imul(al8, bh7) | 0, mid = mid + Math.imul(ah8, bl7) | 0, hi = hi + Math.imul(ah8, bh7) | 0, lo = lo + Math.imul(al7, bl8) | 0, mid = mid + Math.imul(al7, bh8) | 0, mid = mid + Math.imul(ah7, bl8) | 0, hi = hi + Math.imul(ah7, bh8) | 0, lo = lo + Math.imul(al6, bl9) | 0, mid = mid + Math.imul(al6, bh9) | 0, mid = mid + Math.imul(ah6, bl9) | 0, hi = hi + Math.imul(ah6, bh9) | 0;\n var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0, w15 &= 67108863, lo = Math.imul(al9, bl7), mid = Math.imul(al9, bh7), mid = mid + Math.imul(ah9, bl7) | 0, hi = Math.imul(ah9, bh7), lo = lo + Math.imul(al8, bl8) | 0, mid = mid + Math.imul(al8, bh8) | 0, mid = mid + Math.imul(ah8, bl8) | 0, hi = hi + Math.imul(ah8, bh8) | 0, lo = lo + Math.imul(al7, bl9) | 0, mid = mid + Math.imul(al7, bh9) | 0, mid = mid + Math.imul(ah7, bl9) | 0, hi = hi + Math.imul(ah7, bh9) | 0;\n var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0, w16 &= 67108863, lo = Math.imul(al9, bl8), mid = Math.imul(al9, bh8), mid = mid + Math.imul(ah9, bl8) | 0, hi = Math.imul(ah9, bh8), lo = lo + Math.imul(al8, bl9) | 0, mid = mid + Math.imul(al8, bh9) | 0, mid = mid + Math.imul(ah8, bl9) | 0, hi = hi + Math.imul(ah8, bh9) | 0;\n var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0, w17 &= 67108863, lo = Math.imul(al9, bl9), mid = Math.imul(al9, bh9), mid = mid + Math.imul(ah9, bl9) | 0, hi = Math.imul(ah9, bh9);\n var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n return c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0, w18 &= 67108863, o[0] = w0, o[1] = w1, o[2] = w2, o[3] = w3, o[4] = w4, o[5] = w5, o[6] = w6, o[7] = w7, o[8] = w8, o[9] = w9, o[10] = w10, o[11] = w11, o[12] = w12, o[13] = w13, o[14] = w14, o[15] = w15, o[16] = w16, o[17] = w17, o[18] = w18, c !== 0 && (o[19] = c, out.length++), out;\n };\n Math.imul || (comb10MulTo = smallMulTo);\n function bigMulTo(self2, num, out) {\n out.negative = num.negative ^ self2.negative, out.length = self2.length + num.length;\n for (var carry = 0, hncarry = 0, k = 0;k < out.length - 1; k++) {\n var ncarry = hncarry;\n hncarry = 0;\n for (var rword = carry & 67108863, maxJ = Math.min(k, num.length - 1), j = Math.max(0, k - self2.length + 1);j <= maxJ; j++) {\n var i = k - j, a = self2.words[i] | 0, b = num.words[j] | 0, r = a * b, lo = r & 67108863;\n ncarry = ncarry + (r / 67108864 | 0) | 0, lo = lo + rword | 0, rword = lo & 67108863, ncarry = ncarry + (lo >>> 26) | 0, hncarry += ncarry >>> 26, ncarry &= 67108863;\n }\n out.words[k] = rword, carry = ncarry, ncarry = hncarry;\n }\n return carry !== 0 \? out.words[k] = carry : out.length--, out.strip();\n }\n function jumboMulTo(self2, num, out) {\n var fftm = new FFTM;\n return fftm.mulp(self2, num, out);\n }\n BN.prototype.mulTo = function(num, out) {\n var res, len = this.length + num.length;\n return this.length === 10 && num.length === 10 \? res = comb10MulTo(this, num, out) : len < 63 \? res = smallMulTo(this, num, out) : len < 1024 \? res = bigMulTo(this, num, out) : res = jumboMulTo(this, num, out), res;\n };\n function FFTM(x, y) {\n this.x = x, this.y = y;\n }\n FFTM.prototype = {}, FFTM.prototype.makeRBT = function(N) {\n for (var t = new @Array(N), l = BN.prototype._countBits(N) - 1, i = 0;i < N; i++)\n t[i] = this.revBin(i, l, N);\n return t;\n }, FFTM.prototype.revBin = function(x, l, N) {\n if (x === 0 || x === N - 1)\n return x;\n for (var rb = 0, i = 0;i < l; i++)\n rb |= (x & 1) << l - i - 1, x >>= 1;\n return rb;\n }, FFTM.prototype.permute = function(rbt, rws, iws, rtws, itws, N) {\n for (var i = 0;i < N; i++)\n rtws[i] = rws[rbt[i]], itws[i] = iws[rbt[i]];\n }, FFTM.prototype.transform = function(rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n for (var s = 1;s < N; s <<= 1)\n for (var l = s << 1, rtwdf = Math.cos(2 * Math.PI / l), itwdf = Math.sin(2 * Math.PI / l), p = 0;p < N; p += l)\n for (var rtwdf_ = rtwdf, itwdf_ = itwdf, j = 0;j < s; j++) {\n var re = rtws[p + j], ie = itws[p + j], ro = rtws[p + j + s], io = itws[p + j + s], rx = rtwdf_ * ro - itwdf_ * io;\n io = rtwdf_ * io + itwdf_ * ro, ro = rx, rtws[p + j] = re + ro, itws[p + j] = ie + io, rtws[p + j + s] = re - ro, itws[p + j + s] = ie - io, j !== l && (rx = rtwdf * rtwdf_ - itwdf * itwdf_, itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_, rtwdf_ = rx);\n }\n }, FFTM.prototype.guessLen13b = function(n, m) {\n var N = Math.max(m, n) | 1, odd = N & 1, i = 0;\n for (N = N / 2 | 0;N; N = N >>> 1)\n i++;\n return 1 << i + 1 + odd;\n }, FFTM.prototype.conjugate = function(rws, iws, N) {\n if (!(N <= 1))\n for (var i = 0;i < N / 2; i++) {\n var t = rws[i];\n rws[i] = rws[N - i - 1], rws[N - i - 1] = t, t = iws[i], iws[i] = -iws[N - i - 1], iws[N - i - 1] = -t;\n }\n }, FFTM.prototype.normalize13b = function(ws, N) {\n for (var carry = 0, i = 0;i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;\n ws[i] = w & 67108863, w < 67108864 \? carry = 0 : carry = w / 67108864 | 0;\n }\n return ws;\n }, FFTM.prototype.convert13b = function(ws, len, rws, N) {\n for (var carry = 0, i = 0;i < len; i++)\n carry = carry + (ws[i] | 0), rws[2 * i] = carry & 8191, carry = carry >>> 13, rws[2 * i + 1] = carry & 8191, carry = carry >>> 13;\n for (i = 2 * len;i < N; ++i)\n rws[i] = 0;\n assert(carry === 0), assert((carry & -8192) === 0);\n }, FFTM.prototype.stub = function(N) {\n for (var ph = new @Array(N), i = 0;i < N; i++)\n ph[i] = 0;\n return ph;\n }, FFTM.prototype.mulp = function(x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length), rbt = this.makeRBT(N), _ = this.stub(N), rws = new @Array(N), rwst = new @Array(N), iwst = new @Array(N), nrws = new @Array(N), nrwst = new @Array(N), niwst = new @Array(N), rmws = out.words;\n rmws.length = N, this.convert13b(x.words, x.length, rws, N), this.convert13b(y.words, y.length, nrws, N), this.transform(rws, _, rwst, iwst, N, rbt), this.transform(nrws, _, nrwst, niwst, N, rbt);\n for (var i = 0;i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i], rwst[i] = rx;\n }\n return this.conjugate(rwst, iwst, N), this.transform(rwst, iwst, rmws, _, N, rbt), this.conjugate(rmws, _, N), this.normalize13b(rmws, N), out.negative = x.negative ^ y.negative, out.length = x.length + y.length, out.strip();\n }, BN.prototype.mul = function(num) {\n var out = new BN(null);\n return out.words = new @Array(this.length + num.length), this.mulTo(num, out);\n }, BN.prototype.mulf = function(num) {\n var out = new BN(null);\n return out.words = new @Array(this.length + num.length), jumboMulTo(this, num, out);\n }, BN.prototype.imul = function(num) {\n return this.clone().mulTo(num, this);\n }, BN.prototype.imuln = function(num) {\n assert(typeof num == \"number\"), assert(num < 67108864);\n for (var carry = 0, i = 0;i < this.length; i++) {\n var w = (this.words[i] | 0) * num, lo = (w & 67108863) + (carry & 67108863);\n carry >>= 26, carry += w / 67108864 | 0, carry += lo >>> 26, this.words[i] = lo & 67108863;\n }\n return carry !== 0 && (this.words[i] = carry, this.length++), this;\n }, BN.prototype.muln = function(num) {\n return this.clone().imuln(num);\n }, BN.prototype.sqr = function() {\n return this.mul(this);\n }, BN.prototype.isqr = function() {\n return this.imul(this.clone());\n }, BN.prototype.pow = function(num) {\n var w = toBitArray(num);\n if (w.length === 0)\n return new BN(1);\n for (var res = this, i = 0;i < w.length && w[i] === 0; i++, res = res.sqr())\n ;\n if (++i < w.length)\n for (var q = res.sqr();i < w.length; i++, q = q.sqr())\n w[i] !== 0 && (res = res.mul(q));\n return res;\n }, BN.prototype.iushln = function(bits) {\n assert(typeof bits == \"number\" && bits >= 0);\n var r = bits % 26, s = (bits - r) / 26, carryMask = 67108863 >>> 26 - r << 26 - r, i;\n if (r !== 0) {\n var carry = 0;\n for (i = 0;i < this.length; i++) {\n var newCarry = this.words[i] & carryMask, c = (this.words[i] | 0) - newCarry << r;\n this.words[i] = c | carry, carry = newCarry >>> 26 - r;\n }\n carry && (this.words[i] = carry, this.length++);\n }\n if (s !== 0) {\n for (i = this.length - 1;i >= 0; i--)\n this.words[i + s] = this.words[i];\n for (i = 0;i < s; i++)\n this.words[i] = 0;\n this.length += s;\n }\n return this.strip();\n }, BN.prototype.ishln = function(bits) {\n return assert(this.negative === 0), this.iushln(bits);\n }, BN.prototype.iushrn = function(bits, hint, extended) {\n assert(typeof bits == \"number\" && bits >= 0);\n var h;\n hint \? h = (hint - hint % 26) / 26 : h = 0;\n var r = bits % 26, s = Math.min((bits - r) / 26, this.length), mask = 67108863 ^ 67108863 >>> r << r, maskedWords = extended;\n if (h -= s, h = Math.max(0, h), maskedWords) {\n for (var i = 0;i < s; i++)\n maskedWords.words[i] = this.words[i];\n maskedWords.length = s;\n }\n if (s !== 0)\n if (this.length > s)\n for (this.length -= s, i = 0;i < this.length; i++)\n this.words[i] = this.words[i + s];\n else\n this.words[0] = 0, this.length = 1;\n var carry = 0;\n for (i = this.length - 1;i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = carry << 26 - r | word >>> r, carry = word & mask;\n }\n return maskedWords && carry !== 0 && (maskedWords.words[maskedWords.length++] = carry), this.length === 0 && (this.words[0] = 0, this.length = 1), this.strip();\n }, BN.prototype.ishrn = function(bits, hint, extended) {\n return assert(this.negative === 0), this.iushrn(bits, hint, extended);\n }, BN.prototype.shln = function(bits) {\n return this.clone().ishln(bits);\n }, BN.prototype.ushln = function(bits) {\n return this.clone().iushln(bits);\n }, BN.prototype.shrn = function(bits) {\n return this.clone().ishrn(bits);\n }, BN.prototype.ushrn = function(bits) {\n return this.clone().iushrn(bits);\n }, BN.prototype.testn = function(bit) {\n assert(typeof bit == \"number\" && bit >= 0);\n var r = bit % 26, s = (bit - r) / 26, q = 1 << r;\n if (this.length <= s)\n return !1;\n var w = this.words[s];\n return !!(w & q);\n }, BN.prototype.imaskn = function(bits) {\n assert(typeof bits == \"number\" && bits >= 0);\n var r = bits % 26, s = (bits - r) / 26;\n if (assert(this.negative === 0, \"imaskn works only with positive numbers\"), this.length <= s)\n return this;\n if (r !== 0 && s++, this.length = Math.min(s, this.length), r !== 0) {\n var mask = 67108863 ^ 67108863 >>> r << r;\n this.words[this.length - 1] &= mask;\n }\n return this.strip();\n }, BN.prototype.maskn = function(bits) {\n return this.clone().imaskn(bits);\n }, BN.prototype.iaddn = function(num) {\n return assert(typeof num == \"number\"), assert(num < 67108864), num < 0 \? this.isubn(-num) : this.negative !== 0 \? this.length === 1 && (this.words[0] | 0) < num \? (this.words[0] = num - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(num), this.negative = 1, this) : this._iaddn(num);\n }, BN.prototype._iaddn = function(num) {\n this.words[0] += num;\n for (var i = 0;i < this.length && this.words[i] >= 67108864; i++)\n this.words[i] -= 67108864, i === this.length - 1 \? this.words[i + 1] = 1 : this.words[i + 1]++;\n return this.length = Math.max(this.length, i + 1), this;\n }, BN.prototype.isubn = function(num) {\n if (assert(typeof num == \"number\"), assert(num < 67108864), num < 0)\n return this.iaddn(-num);\n if (this.negative !== 0)\n return this.negative = 0, this.iaddn(num), this.negative = 1, this;\n if (this.words[0] -= num, this.length === 1 && this.words[0] < 0)\n this.words[0] = -this.words[0], this.negative = 1;\n else\n for (var i = 0;i < this.length && this.words[i] < 0; i++)\n this.words[i] += 67108864, this.words[i + 1] -= 1;\n return this.strip();\n }, BN.prototype.addn = function(num) {\n return this.clone().iaddn(num);\n }, BN.prototype.subn = function(num) {\n return this.clone().isubn(num);\n }, BN.prototype.iabs = function() {\n return this.negative = 0, this;\n }, BN.prototype.abs = function() {\n return this.clone().iabs();\n }, BN.prototype._ishlnsubmul = function(num, mul, shift) {\n var len = num.length + shift, i;\n this._expand(len);\n var w, carry = 0;\n for (i = 0;i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 67108863, carry = (w >> 26) - (right / 67108864 | 0), this.words[i + shift] = w & 67108863;\n }\n for (;i < this.length - shift; i++)\n w = (this.words[i + shift] | 0) + carry, carry = w >> 26, this.words[i + shift] = w & 67108863;\n if (carry === 0)\n return this.strip();\n for (assert(carry === -1), carry = 0, i = 0;i < this.length; i++)\n w = -(this.words[i] | 0) + carry, carry = w >> 26, this.words[i] = w & 67108863;\n return this.negative = 1, this.strip();\n }, BN.prototype._wordDiv = function(num, mode) {\n var shift = this.length - num.length, a = this.clone(), b = num, bhi = b.words[b.length - 1] | 0, bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits, shift !== 0 && (b = b.ushln(shift), a.iushln(shift), bhi = b.words[b.length - 1] | 0);\n var m = a.length - b.length, q;\n if (mode !== \"mod\") {\n q = new BN(null), q.length = m + 1, q.words = new @Array(q.length);\n for (var i = 0;i < q.length; i++)\n q.words[i] = 0;\n }\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n diff.negative === 0 && (a = diff, q && (q.words[m] = 1));\n for (var j = m - 1;j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);\n for (qj = Math.min(qj / bhi | 0, 67108863), a._ishlnsubmul(b, qj, j);a.negative !== 0; )\n qj--, a.negative = 0, a._ishlnsubmul(b, 1, j), a.isZero() || (a.negative ^= 1);\n q && (q.words[j] = qj);\n }\n return q && q.strip(), a.strip(), mode !== \"div\" && shift !== 0 && a.iushrn(shift), {\n div: q || null,\n mod: a\n };\n }, BN.prototype.divmod = function(num, mode, positive) {\n if (assert(!num.isZero()), this.isZero())\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n var div, mod, res;\n return this.negative !== 0 && num.negative === 0 \? (res = this.neg().divmod(num, mode), mode !== \"mod\" && (div = res.div.neg()), mode !== \"div\" && (mod = res.mod.neg(), positive && mod.negative !== 0 && mod.iadd(num)), {\n div,\n mod\n }) : this.negative === 0 && num.negative !== 0 \? (res = this.divmod(num.neg(), mode), mode !== \"mod\" && (div = res.div.neg()), {\n div,\n mod: res.mod\n }) : (this.negative & num.negative) !== 0 \? (res = this.neg().divmod(num.neg(), mode), mode !== \"div\" && (mod = res.mod.neg(), positive && mod.negative !== 0 && mod.isub(num)), {\n div: res.div,\n mod\n }) : num.length > this.length || this.cmp(num) < 0 \? {\n div: new BN(0),\n mod: this\n } : num.length === 1 \? mode === \"div\" \? {\n div: this.divn(num.words[0]),\n mod: null\n } : mode === \"mod\" \? {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n } : {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n } : this._wordDiv(num, mode);\n }, BN.prototype.div = function(num) {\n return this.divmod(num, \"div\", !1).div;\n }, BN.prototype.mod = function(num) {\n return this.divmod(num, \"mod\", !1).mod;\n }, BN.prototype.umod = function(num) {\n return this.divmod(num, \"mod\", !0).mod;\n }, BN.prototype.divRound = function(num) {\n var dm = this.divmod(num);\n if (dm.mod.isZero())\n return dm.div;\n var mod = dm.div.negative !== 0 \? dm.mod.isub(num) : dm.mod, half = num.ushrn(1), r2 = num.andln(1), cmp = mod.cmp(half);\n return cmp < 0 || r2 === 1 && cmp === 0 \? dm.div : dm.div.negative !== 0 \? dm.div.isubn(1) : dm.div.iaddn(1);\n }, BN.prototype.modn = function(num) {\n assert(num <= 67108863);\n for (var p = (1 << 26) % num, acc = 0, i = this.length - 1;i >= 0; i--)\n acc = (p * acc + (this.words[i] | 0)) % num;\n return acc;\n }, BN.prototype.idivn = function(num) {\n assert(num <= 67108863);\n for (var carry = 0, i = this.length - 1;i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 67108864;\n this.words[i] = w / num | 0, carry = w % num;\n }\n return this.strip();\n }, BN.prototype.divn = function(num) {\n return this.clone().idivn(num);\n }, BN.prototype.egcd = function(p) {\n assert(p.negative === 0), assert(!p.isZero());\n var x = this, y = p.clone();\n x.negative !== 0 \? x = x.umod(p) : x = x.clone();\n for (var A = new BN(1), B = new BN(0), C = new BN(0), D = new BN(1), g = 0;x.isEven() && y.isEven(); )\n x.iushrn(1), y.iushrn(1), ++g;\n for (var yp = y.clone(), xp = x.clone();!x.isZero(); ) {\n for (var i = 0, im = 1;(x.words[0] & im) === 0 && i < 26; ++i, im <<= 1)\n ;\n if (i > 0)\n for (x.iushrn(i);i-- > 0; )\n (A.isOdd() || B.isOdd()) && (A.iadd(yp), B.isub(xp)), A.iushrn(1), B.iushrn(1);\n for (var j = 0, jm = 1;(y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1)\n ;\n if (j > 0)\n for (y.iushrn(j);j-- > 0; )\n (C.isOdd() || D.isOdd()) && (C.iadd(yp), D.isub(xp)), C.iushrn(1), D.iushrn(1);\n x.cmp(y) >= 0 \? (x.isub(y), A.isub(C), B.isub(D)) : (y.isub(x), C.isub(A), D.isub(B));\n }\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n }, BN.prototype._invmp = function(p) {\n assert(p.negative === 0), assert(!p.isZero());\n var a = this, b = p.clone();\n a.negative !== 0 \? a = a.umod(p) : a = a.clone();\n for (var x1 = new BN(1), x2 = new BN(0), delta = b.clone();a.cmpn(1) > 0 && b.cmpn(1) > 0; ) {\n for (var i = 0, im = 1;(a.words[0] & im) === 0 && i < 26; ++i, im <<= 1)\n ;\n if (i > 0)\n for (a.iushrn(i);i-- > 0; )\n x1.isOdd() && x1.iadd(delta), x1.iushrn(1);\n for (var j = 0, jm = 1;(b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1)\n ;\n if (j > 0)\n for (b.iushrn(j);j-- > 0; )\n x2.isOdd() && x2.iadd(delta), x2.iushrn(1);\n a.cmp(b) >= 0 \? (a.isub(b), x1.isub(x2)) : (b.isub(a), x2.isub(x1));\n }\n var res;\n return a.cmpn(1) === 0 \? res = x1 : res = x2, res.cmpn(0) < 0 && res.iadd(p), res;\n }, BN.prototype.gcd = function(num) {\n if (this.isZero())\n return num.abs();\n if (num.isZero())\n return this.abs();\n var a = this.clone(), b = num.clone();\n a.negative = 0, b.negative = 0;\n for (var shift = 0;a.isEven() && b.isEven(); shift++)\n a.iushrn(1), b.iushrn(1);\n do {\n for (;a.isEven(); )\n a.iushrn(1);\n for (;b.isEven(); )\n b.iushrn(1);\n var r = a.cmp(b);\n if (r < 0) {\n var t = a;\n a = b, b = t;\n } else if (r === 0 || b.cmpn(1) === 0)\n break;\n a.isub(b);\n } while (!0);\n return b.iushln(shift);\n }, BN.prototype.invm = function(num) {\n return this.egcd(num).a.umod(num);\n }, BN.prototype.isEven = function() {\n return (this.words[0] & 1) === 0;\n }, BN.prototype.isOdd = function() {\n return (this.words[0] & 1) === 1;\n }, BN.prototype.andln = function(num) {\n return this.words[0] & num;\n }, BN.prototype.bincn = function(bit) {\n assert(typeof bit == \"number\");\n var r = bit % 26, s = (bit - r) / 26, q = 1 << r;\n if (this.length <= s)\n return this._expand(s + 1), this.words[s] |= q, this;\n for (var carry = q, i = s;carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry, carry = w >>> 26, w &= 67108863, this.words[i] = w;\n }\n return carry !== 0 && (this.words[i] = carry, this.length++), this;\n }, BN.prototype.isZero = function() {\n return this.length === 1 && this.words[0] === 0;\n }, BN.prototype.cmpn = function(num) {\n var negative = num < 0;\n if (this.negative !== 0 && !negative)\n return -1;\n if (this.negative === 0 && negative)\n return 1;\n this.strip();\n var res;\n if (this.length > 1)\n res = 1;\n else {\n negative && (num = -num), assert(num <= 67108863, \"Number is too big\");\n var w = this.words[0] | 0;\n res = w === num \? 0 : w < num \? -1 : 1;\n }\n return this.negative !== 0 \? -res | 0 : res;\n }, BN.prototype.cmp = function(num) {\n if (this.negative !== 0 && num.negative === 0)\n return -1;\n if (this.negative === 0 && num.negative !== 0)\n return 1;\n var res = this.ucmp(num);\n return this.negative !== 0 \? -res | 0 : res;\n }, BN.prototype.ucmp = function(num) {\n if (this.length > num.length)\n return 1;\n if (this.length < num.length)\n return -1;\n for (var res = 0, i = this.length - 1;i >= 0; i--) {\n var a = this.words[i] | 0, b = num.words[i] | 0;\n if (a !== b) {\n a < b \? res = -1 : a > b && (res = 1);\n break;\n }\n }\n return res;\n }, BN.prototype.gtn = function(num) {\n return this.cmpn(num) === 1;\n }, BN.prototype.gt = function(num) {\n return this.cmp(num) === 1;\n }, BN.prototype.gten = function(num) {\n return this.cmpn(num) >= 0;\n }, BN.prototype.gte = function(num) {\n return this.cmp(num) >= 0;\n }, BN.prototype.ltn = function(num) {\n return this.cmpn(num) === -1;\n }, BN.prototype.lt = function(num) {\n return this.cmp(num) === -1;\n }, BN.prototype.lten = function(num) {\n return this.cmpn(num) <= 0;\n }, BN.prototype.lte = function(num) {\n return this.cmp(num) <= 0;\n }, BN.prototype.eqn = function(num) {\n return this.cmpn(num) === 0;\n }, BN.prototype.eq = function(num) {\n return this.cmp(num) === 0;\n }, BN.red = function(num) {\n return new Red(num);\n }, BN.prototype.toRed = function(ctx) {\n return assert(!this.red, \"Already a number in reduction context\"), assert(this.negative === 0, \"red works only with positives\"), ctx.convertTo(this)._forceRed(ctx);\n }, BN.prototype.fromRed = function() {\n return assert(this.red, \"fromRed works only with numbers in reduction context\"), this.red.convertFrom(this);\n }, BN.prototype._forceRed = function(ctx) {\n return this.red = ctx, this;\n }, BN.prototype.forceRed = function(ctx) {\n return assert(!this.red, \"Already a number in reduction context\"), this._forceRed(ctx);\n }, BN.prototype.redAdd = function(num) {\n return assert(this.red, \"redAdd works only with red numbers\"), this.red.add(this, num);\n }, BN.prototype.redIAdd = function(num) {\n return assert(this.red, \"redIAdd works only with red numbers\"), this.red.iadd(this, num);\n }, BN.prototype.redSub = function(num) {\n return assert(this.red, \"redSub works only with red numbers\"), this.red.sub(this, num);\n }, BN.prototype.redISub = function(num) {\n return assert(this.red, \"redISub works only with red numbers\"), this.red.isub(this, num);\n }, BN.prototype.redShl = function(num) {\n return assert(this.red, \"redShl works only with red numbers\"), this.red.shl(this, num);\n }, BN.prototype.redMul = function(num) {\n return assert(this.red, \"redMul works only with red numbers\"), this.red._verify2(this, num), this.red.mul(this, num);\n }, BN.prototype.redIMul = function(num) {\n return assert(this.red, \"redMul works only with red numbers\"), this.red._verify2(this, num), this.red.imul(this, num);\n }, BN.prototype.redSqr = function() {\n return assert(this.red, \"redSqr works only with red numbers\"), this.red._verify1(this), this.red.sqr(this);\n }, BN.prototype.redISqr = function() {\n return assert(this.red, \"redISqr works only with red numbers\"), this.red._verify1(this), this.red.isqr(this);\n }, BN.prototype.redSqrt = function() {\n return assert(this.red, \"redSqrt works only with red numbers\"), this.red._verify1(this), this.red.sqrt(this);\n }, BN.prototype.redInvm = function() {\n return assert(this.red, \"redInvm works only with red numbers\"), this.red._verify1(this), this.red.invm(this);\n }, BN.prototype.redNeg = function() {\n return assert(this.red, \"redNeg works only with red numbers\"), this.red._verify1(this), this.red.neg(this);\n }, BN.prototype.redPow = function(num) {\n return assert(this.red && !num.red, \"redPow(normalNum)\"), this.red._verify1(this), this.red.pow(this, num);\n };\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n function MPrime(name, p) {\n this.name = name, this.p = new BN(p, 16), this.n = this.p.bitLength(), this.k = new BN(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();\n }\n MPrime.prototype = {}, MPrime.prototype._tmp = function() {\n var tmp = new BN(null);\n return tmp.words = new @Array(Math.ceil(this.n / 13)), tmp;\n }, MPrime.prototype.ireduce = function(num) {\n var r = num, rlen;\n do\n this.split(r, this.tmp), r = this.imulK(r), r = r.iadd(this.tmp), rlen = r.bitLength();\n while (rlen > this.n);\n var cmp = rlen < this.n \? -1 : r.ucmp(this.p);\n return cmp === 0 \? (r.words[0] = 0, r.length = 1) : cmp > 0 \? r.isub(this.p) : r.strip !== void 0 \? r.strip() : r._strip(), r;\n }, MPrime.prototype.split = function(input, out) {\n input.iushrn(this.n, 0, out);\n }, MPrime.prototype.imulK = function(num) {\n return num.imul(this.k);\n };\n function K256() {\n MPrime.@call(this, \"k256\", \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\");\n }\n inherits(K256, MPrime), K256.prototype.split = function(input, output) {\n for (var mask = 4194303, outLen = Math.min(input.length, 9), i = 0;i < outLen; i++)\n output.words[i] = input.words[i];\n if (output.length = outLen, input.length <= 9) {\n input.words[0] = 0, input.length = 1;\n return;\n }\n var prev = input.words[9];\n for (output.words[output.length++] = prev & mask, i = 10;i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = (next & mask) << 4 | prev >>> 22, prev = next;\n }\n prev >>>= 22, input.words[i - 10] = prev, prev === 0 && input.length > 10 \? input.length -= 10 : input.length -= 9;\n }, K256.prototype.imulK = function(num) {\n num.words[num.length] = 0, num.words[num.length + 1] = 0, num.length += 2;\n for (var lo = 0, i = 0;i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 977, num.words[i] = lo & 67108863, lo = w * 64 + (lo / 67108864 | 0);\n }\n return num.words[num.length - 1] === 0 && (num.length--, num.words[num.length - 1] === 0 && num.length--), num;\n };\n function P224() {\n MPrime.@call(this, \"p224\", \"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\");\n }\n inherits(P224, MPrime);\n function P192() {\n MPrime.@call(this, \"p192\", \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\");\n }\n inherits(P192, MPrime);\n function P25519() {\n MPrime.@call(this, \"25519\", \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\");\n }\n inherits(P25519, MPrime), P25519.prototype.imulK = function(num) {\n for (var carry = 0, i = 0;i < num.length; i++) {\n var hi = (num.words[i] | 0) * 19 + carry, lo = hi & 67108863;\n hi >>>= 26, num.words[i] = lo, carry = hi;\n }\n return carry !== 0 && (num.words[num.length++] = carry), num;\n }, BN._prime = function(name) {\n if (primes[name])\n return primes[name];\n var prime2;\n if (name === \"k256\")\n prime2 = new K256;\n else if (name === \"p224\")\n prime2 = new P224;\n else if (name === \"p192\")\n prime2 = new P192;\n else if (name === \"p25519\")\n prime2 = new P25519;\n else\n throw new Error(\"Unknown prime \" + name);\n return primes[name] = prime2, prime2;\n };\n function Red(m) {\n if (typeof m == \"string\") {\n var prime = BN._prime(m);\n this.m = prime.p, this.prime = prime;\n } else\n assert(m.gtn(1), \"modulus must be greater than 1\"), this.m = m, this.prime = null;\n }\n Red.prototype = {}, Red.prototype._verify1 = function(a) {\n assert(a.negative === 0, \"red works only with positives\"), assert(a.red, \"red works only with red numbers\");\n }, Red.prototype._verify2 = function(a, b) {\n assert((a.negative | b.negative) === 0, \"red works only with positives\"), assert(a.red && a.red === b.red, \"red works only with red numbers\");\n }, Red.prototype.imod = function(a) {\n return this.prime \? this.prime.ireduce(a)._forceRed(this) : a.umod(this.m)._forceRed(this);\n }, Red.prototype.neg = function(a) {\n return a.isZero() \? a.clone() : this.m.sub(a)._forceRed(this);\n }, Red.prototype.add = function(a, b) {\n this._verify2(a, b);\n var res = a.add(b);\n return res.cmp(this.m) >= 0 && res.isub(this.m), res._forceRed(this);\n }, Red.prototype.iadd = function(a, b) {\n this._verify2(a, b);\n var res = a.iadd(b);\n return res.cmp(this.m) >= 0 && res.isub(this.m), res;\n }, Red.prototype.sub = function(a, b) {\n this._verify2(a, b);\n var res = a.sub(b);\n return res.cmpn(0) < 0 && res.iadd(this.m), res._forceRed(this);\n }, Red.prototype.isub = function(a, b) {\n this._verify2(a, b);\n var res = a.isub(b);\n return res.cmpn(0) < 0 && res.iadd(this.m), res;\n }, Red.prototype.shl = function(a, num) {\n return this._verify1(a), this.imod(a.ushln(num));\n }, Red.prototype.imul = function(a, b) {\n return this._verify2(a, b), this.imod(a.imul(b));\n }, Red.prototype.mul = function(a, b) {\n return this._verify2(a, b), this.imod(a.mul(b));\n }, Red.prototype.isqr = function(a) {\n return this.imul(a, a.clone());\n }, Red.prototype.sqr = function(a) {\n return this.mul(a, a);\n }, Red.prototype.sqrt = function(a) {\n if (a.isZero())\n return a.clone();\n var mod3 = this.m.andln(3);\n if (assert(mod3 % 2 === 1), mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n for (var q = this.m.subn(1), s = 0;!q.isZero() && q.andln(1) === 0; )\n s++, q.iushrn(1);\n assert(!q.isZero());\n var one = new BN(1).toRed(this), nOne = one.redNeg(), lpow = this.m.subn(1).iushrn(1), z = this.m.bitLength();\n for (z = new BN(2 * z * z).toRed(this);this.pow(z, lpow).cmp(nOne) !== 0; )\n z.redIAdd(nOne);\n for (var c = this.pow(z, q), r = this.pow(a, q.addn(1).iushrn(1)), t = this.pow(a, q), m = s;t.cmp(one) !== 0; ) {\n for (var tmp = t, i = 0;tmp.cmp(one) !== 0; i++)\n tmp = tmp.redSqr();\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n r = r.redMul(b), c = b.redSqr(), t = t.redMul(c), m = i;\n }\n return r;\n }, Red.prototype.invm = function(a) {\n var inv = a._invmp(this.m);\n return inv.negative !== 0 \? (inv.negative = 0, this.imod(inv).redNeg()) : this.imod(inv);\n }, Red.prototype.pow = function(a, num) {\n if (num.isZero())\n return new BN(1).toRed(this);\n if (num.cmpn(1) === 0)\n return a.clone();\n var windowSize = 4, wnd = new @Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this), wnd[1] = a;\n for (var i = 2;i < wnd.length; i++)\n wnd[i] = this.mul(wnd[i - 1], a);\n var res = wnd[0], current = 0, currentLen = 0, start = num.bitLength() % 26;\n for (start === 0 && (start = 26), i = num.length - 1;i >= 0; i--) {\n for (var word = num.words[i], j = start - 1;j >= 0; j--) {\n var bit = word >> j & 1;\n if (res !== wnd[0] && (res = this.sqr(res)), bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n current <<= 1, current |= bit, currentLen++, !(currentLen !== windowSize && (i !== 0 || j !== 0)) && (res = this.mul(res, wnd[current]), currentLen = 0, current = 0);\n }\n start = 26;\n }\n return res;\n }, Red.prototype.convertTo = function(num) {\n var r = num.umod(this.m);\n return r === num \? r.clone() : r;\n }, Red.prototype.convertFrom = function(num) {\n var res = num.clone();\n return res.red = null, res;\n }, BN.mont = function(num) {\n return new Mont(num);\n };\n function Mont(m) {\n Red.@call(this, m), this.shift = this.m.bitLength(), this.shift % 26 !== 0 && (this.shift += 26 - this.shift % 26), this.r = new BN(1).iushln(this.shift), this.r2 = this.imod(this.r.sqr()), this.rinv = this.r._invmp(this.m), this.minv = this.rinv.mul(this.r).isubn(1).div(this.m), this.minv = this.minv.umod(this.r), this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red), Mont.prototype.convertTo = function(num) {\n return this.imod(num.ushln(this.shift));\n }, Mont.prototype.convertFrom = function(num) {\n var r = this.imod(num.mul(this.rinv));\n return r.red = null, r;\n }, Mont.prototype.imul = function(a, b) {\n if (a.isZero() || b.isZero())\n return a.words[0] = 0, a.length = 1, a;\n var t = a.imul(b), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u = t.isub(c).iushrn(this.shift), res = u;\n return u.cmp(this.m) >= 0 \? res = u.isub(this.m) : u.cmpn(0) < 0 && (res = u.iadd(this.m)), res._forceRed(this);\n }, Mont.prototype.mul = function(a, b) {\n if (a.isZero() || b.isZero())\n return new BN(0)._forceRed(this);\n var t = a.mul(b), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u = t.isub(c).iushrn(this.shift), res = u;\n return u.cmp(this.m) >= 0 \? res = u.isub(this.m) : u.cmpn(0) < 0 && (res = u.iadd(this.m)), res._forceRed(this);\n }, Mont.prototype.invm = function(a) {\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n })(typeof module > \"u\" || module, exports);\n }\n}), require_bn2 = require_bn, require_brorand = __commonJS({\n \"node_modules/brorand/index.js\"(exports, module) {\n var r;\n module.exports = function(len) {\n return r || (r = new Rand(null)), r.generate(len);\n };\n function Rand(rand) {\n this.rand = rand;\n }\n Rand.prototype = {}, module.exports.Rand = Rand, Rand.prototype.generate = function(len) {\n return this._rand(len);\n }, Rand.prototype._rand = function(n) {\n var out = new Buffer(n);\n return crypto.getRandomValues(out), out;\n };\n }\n}), require_mr = __commonJS({\n \"node_modules/miller-rabin/lib/mr.js\"(exports, module) {\n var bn = require_bn2(), brorand = require_brorand();\n function MillerRabin(rand) {\n this.rand = rand || new brorand.Rand;\n }\n module.exports = MillerRabin, MillerRabin.create = function(rand) {\n return new MillerRabin(rand);\n }, MillerRabin.prototype = {}, MillerRabin.prototype._randbelow = function(n) {\n var len = n.bitLength(), min_bytes = Math.ceil(len / 8);\n do\n var a = new bn(this.rand.generate(min_bytes));\n while (a.cmp(n) >= 0);\n return a;\n }, MillerRabin.prototype._randrange = function(start, stop) {\n var size = stop.sub(start);\n return start.add(this._randbelow(size));\n }, MillerRabin.prototype.test = function(n, k, cb) {\n var len = n.bitLength(), red = bn.mont(n), rone = new bn(1).toRed(red);\n k || (k = Math.max(1, len / 48 | 0));\n for (var n1 = n.subn(1), s = 0;!n1.testn(s); s++)\n ;\n for (var d = n.shrn(s), rn1 = n1.toRed(red), prime = !0;k > 0; k--) {\n var a = this._randrange(new bn(2), n1);\n cb && cb(a);\n var x = a.toRed(red).redPow(d);\n if (!(x.cmp(rone) === 0 || x.cmp(rn1) === 0)) {\n for (var i = 1;i < s; i++) {\n if (x = x.redSqr(), x.cmp(rone) === 0)\n return !1;\n if (x.cmp(rn1) === 0)\n break;\n }\n if (i === s)\n return !1;\n }\n }\n return prime;\n }, MillerRabin.prototype.getDivisor = function(n, k) {\n var len = n.bitLength(), red = bn.mont(n), rone = new bn(1).toRed(red);\n k || (k = Math.max(1, len / 48 | 0));\n for (var n1 = n.subn(1), s = 0;!n1.testn(s); s++)\n ;\n for (var d = n.shrn(s), rn1 = n1.toRed(red);k > 0; k--) {\n var a = this._randrange(new bn(2), n1), g = n.gcd(a);\n if (g.cmpn(1) !== 0)\n return g;\n var x = a.toRed(red).redPow(d);\n if (!(x.cmp(rone) === 0 || x.cmp(rn1) === 0)) {\n for (var i = 1;i < s; i++) {\n if (x = x.redSqr(), x.cmp(rone) === 0)\n return x.fromRed().subn(1).gcd(n);\n if (x.cmp(rn1) === 0)\n break;\n }\n if (i === s)\n return x = x.redSqr(), x.fromRed().subn(1).gcd(n);\n }\n }\n return !1;\n };\n }\n}), require_generatePrime = __commonJS({\n \"node_modules/diffie-hellman/lib/generatePrime.js\"(exports, module) {\n var randomBytes = require_browser();\n module.exports = findPrime, findPrime.simpleSieve = simpleSieve, findPrime.fermatTest = fermatTest;\n var BN = require_bn(), TWENTYFOUR = new BN(24), MillerRabin = require_mr(), millerRabin = new MillerRabin, ONE = new BN(1), TWO = new BN(2), FIVE = new BN(5), SIXTEEN = new BN(16), EIGHT = new BN(8), TEN = new BN(10), THREE = new BN(3), SEVEN = new BN(7), ELEVEN = new BN(11), FOUR = new BN(4), TWELVE = new BN(12), primes = null;\n function _getPrimes() {\n if (primes !== null)\n return primes;\n var limit = 1048576, res = [];\n res[0] = 2;\n for (var i = 1, k = 3;k < limit; k += 2) {\n for (var sqrt = Math.ceil(Math.sqrt(k)), j = 0;j < i && res[j] <= sqrt && k % res[j] !== 0; j++)\n ;\n i !== j && res[j] <= sqrt || (res[i++] = k);\n }\n return primes = res, res;\n }\n function simpleSieve(p) {\n for (var primes2 = _getPrimes(), i = 0;i < primes2.length; i++)\n if (p.modn(primes2[i]) === 0)\n return p.cmpn(primes2[i]) === 0;\n return !0;\n }\n function fermatTest(p) {\n var red = BN.mont(p);\n return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;\n }\n function findPrime(bits, gen) {\n if (bits < 16)\n return gen === 2 || gen === 5 \? new BN([140, 123]) : new BN([140, 39]);\n gen = new BN(gen);\n for (var num, n2;; ) {\n for (num = new BN(randomBytes(Math.ceil(bits / 8)));num.bitLength() > bits; )\n num.ishrn(1);\n if (num.isEven() && num.iadd(ONE), num.testn(1) || num.iadd(TWO), gen.cmp(TWO)) {\n if (!gen.cmp(FIVE))\n for (;num.mod(TEN).cmp(THREE); )\n num.iadd(FOUR);\n } else\n for (;num.mod(TWENTYFOUR).cmp(ELEVEN); )\n num.iadd(FOUR);\n if (n2 = num.shrn(1), simpleSieve(n2) && simpleSieve(num) && fermatTest(n2) && fermatTest(num) && millerRabin.test(n2) && millerRabin.test(num))\n return num;\n }\n }\n }\n}), require_primes = __commonJS({\n \"node_modules/diffie-hellman/lib/primes.json\"(exports, module) {\n module.exports = {\n modp1: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff\"\n },\n modp2: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff\"\n },\n modp5: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff\"\n },\n modp14: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff\"\n },\n modp15: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff\"\n },\n modp16: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff\"\n },\n modp17: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff\"\n },\n modp18: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff\"\n }\n };\n }\n}), require_dh = __commonJS({\n \"node_modules/diffie-hellman/lib/dh.js\"(exports, module) {\n var BN = require_bn(), MillerRabin = require_mr(), millerRabin = new MillerRabin, TWENTYFOUR = new BN(24), ELEVEN = new BN(11), TEN = new BN(10), THREE = new BN(3), SEVEN = new BN(7), primes = require_generatePrime(), randomBytes = require_browser();\n module.exports = DH;\n function setPublicKey(pub, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(pub) || (pub = new Buffer(pub, enc)), this._pub = new BN(pub), this;\n }\n function setPrivateKey(priv, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(priv) || (priv = new Buffer(priv, enc)), this._priv = new BN(priv), this;\n }\n var primeCache = {};\n function checkPrime(prime, generator) {\n var gen = generator.toString(\"hex\"), hex = [gen, prime.toString(16)].join(\"_\");\n if (hex in primeCache)\n return primeCache[hex];\n var error = 0;\n if (prime.isEven() || !primes.simpleSieve || !primes.fermatTest(prime) || !millerRabin.test(prime))\n return error += 1, gen === \"02\" || gen === \"05\" \? error += 8 : error += 4, primeCache[hex] = error, error;\n millerRabin.test(prime.shrn(1)) || (error += 2);\n var rem;\n switch (gen) {\n case \"02\":\n prime.mod(TWENTYFOUR).cmp(ELEVEN) && (error += 8);\n break;\n case \"05\":\n rem = prime.mod(TEN), rem.cmp(THREE) && rem.cmp(SEVEN) && (error += 8);\n break;\n default:\n error += 4;\n }\n return primeCache[hex] = error, error;\n }\n function DH(prime, generator, malleable) {\n this.setGenerator(generator), this.__prime = new BN(prime), this._prime = BN.mont(this.__prime), this._primeLen = prime.length, this._pub = void 0, this._priv = void 0, this._primeCode = void 0, malleable \? (this.setPublicKey = setPublicKey, this.setPrivateKey = setPrivateKey) : this._primeCode = 8;\n }\n DH.prototype = {}, Object.defineProperty(DH.prototype, \"verifyError\", {\n enumerable: !0,\n get: function() {\n return typeof this._primeCode != \"number\" && (this._primeCode = checkPrime(this.__prime, this.__gen)), this._primeCode;\n }\n }), DH.prototype.generateKeys = function() {\n return this._priv || (this._priv = new BN(randomBytes(this._primeLen))), this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(), this.getPublicKey();\n }, DH.prototype.computeSecret = function(other) {\n other = new BN(other), other = other.toRed(this._prime);\n var secret = other.redPow(this._priv).fromRed(), out = new Buffer(secret.toArray()), prime = this.getPrime();\n if (out.length < prime.length) {\n var front = new Buffer(prime.length - out.length);\n front.fill(0), out = Buffer.concat([front, out]);\n }\n return out;\n }, DH.prototype.getPublicKey = function(enc) {\n return formatReturnValue(this._pub, enc);\n }, DH.prototype.getPrivateKey = function(enc) {\n return formatReturnValue(this._priv, enc);\n }, DH.prototype.getPrime = function(enc) {\n return formatReturnValue(this.__prime, enc);\n }, DH.prototype.getGenerator = function(enc) {\n return formatReturnValue(this._gen, enc);\n }, DH.prototype.setGenerator = function(gen, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(gen) || (gen = new Buffer(gen, enc)), this.__gen = gen, this._gen = new BN(gen), this;\n };\n function formatReturnValue(bn, enc) {\n var buf = new Buffer(bn.toArray());\n return enc \? buf.toString(enc) : buf;\n }\n }\n}), require_browser7 = __commonJS({\n \"node_modules/diffie-hellman/browser.js\"(exports) {\n var generatePrime = require_generatePrime(), primes = require_primes(), DH = require_dh();\n function getDiffieHellman(mod) {\n var prime = new Buffer(primes[mod].prime, \"hex\"), gen = new Buffer(primes[mod].gen, \"hex\");\n return new DH(prime, gen);\n }\n var ENCODINGS = {\n binary: !0,\n hex: !0,\n base64: !0\n };\n function createDiffieHellman(prime, enc, generator, genc) {\n return Buffer.isBuffer(enc) || ENCODINGS[enc] === void 0 \? createDiffieHellman(prime, \"binary\", enc, generator) : (enc = enc || \"binary\", genc = genc || \"binary\", generator = generator || new Buffer([2]), Buffer.isBuffer(generator) || (generator = new Buffer(generator, genc)), typeof prime == \"number\" \? new DH(generatePrime(prime, generator), generator, !0) : (Buffer.isBuffer(prime) || (prime = new Buffer(prime, enc)), new DH(prime, generator, !0)));\n }\n exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman, exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman;\n }\n}), require_bn3 = require_bn, require_browserify_rsa = __commonJS({\n \"node_modules/browserify-rsa/index.js\"(exports, module) {\n var BN = require_bn3(), randomBytes = require_browser();\n function blind(priv) {\n var r = getr(priv), blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed();\n return { blinder, unblinder: r.invm(priv.modulus) };\n }\n function getr(priv) {\n var len = priv.modulus.byteLength(), r;\n do\n r = new BN(randomBytes(len));\n while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2));\n return r;\n }\n function crt(msg, priv) {\n var blinds = blind(priv), len = priv.modulus.byteLength(), blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus), c1 = blinded.toRed(BN.mont(priv.prime1)), c2 = blinded.toRed(BN.mont(priv.prime2)), qinv = priv.coefficient, p = priv.prime1, q = priv.prime2, m1 = c1.redPow(priv.exponent1).fromRed(), m2 = c2.redPow(priv.exponent2).fromRed(), h = m1.isub(m2).imul(qinv).umod(p).imul(q);\n return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, \"be\", len);\n }\n crt.getr = getr, module.exports = crt;\n }\n}), require_package = __commonJS({\n \"node_modules/elliptic/package.json\"(exports, module) {\n module.exports = {\n name: \"elliptic\",\n version: \"6.5.4\",\n description: \"EC cryptography\",\n main: \"lib/elliptic.js\",\n files: [\"lib\"],\n scripts: {\n lint: \"eslint lib test\",\n \"lint:fix\": \"npm run lint -- --fix\",\n unit: \"istanbul test _mocha --reporter=spec test/index.js\",\n test: \"npm run lint && npm run unit\",\n version: \"grunt dist && git add dist/\"\n },\n repository: {\n type: \"git\",\n url: \"git@github.com:indutny/elliptic\"\n },\n keywords: [\"EC\", \"Elliptic\", \"curve\", \"Cryptography\"],\n author: \"Fedor Indutny <fedor@indutny.com>\",\n license: \"MIT\",\n bugs: {\n url: \"https://github.com/indutny/elliptic/issues\"\n },\n homepage: \"https://github.com/indutny/elliptic\",\n devDependencies: {\n brfs: \"^2.0.2\",\n coveralls: \"^3.1.0\",\n eslint: \"^7.6.0\",\n grunt: \"^1.2.1\",\n \"grunt-browserify\": \"^5.3.0\",\n \"grunt-cli\": \"^1.3.2\",\n \"grunt-contrib-connect\": \"^3.0.0\",\n \"grunt-contrib-copy\": \"^1.0.0\",\n \"grunt-contrib-uglify\": \"^5.0.0\",\n \"grunt-mocha-istanbul\": \"^5.0.2\",\n \"grunt-saucelabs\": \"^9.0.1\",\n istanbul: \"^0.4.5\",\n mocha: \"^8.0.1\"\n },\n dependencies: {\n \"bn.js\": \"^4.11.9\",\n brorand: \"^1.1.0\",\n \"hash.js\": \"^1.0.0\",\n \"hmac-drbg\": \"^1.0.1\",\n inherits: \"^2.0.4\",\n \"minimalistic-assert\": \"^1.0.1\",\n \"minimalistic-crypto-utils\": \"^1.0.1\"\n }\n };\n }\n}), require_bn4 = require_bn, require_utils2 = __commonJS({\n \"node_modules/minimalistic-crypto-utils/lib/utils.js\"(exports) {\n var utils = exports;\n function toArray(msg, enc) {\n if (@Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg != \"string\") {\n for (var i = 0;i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n if (enc === \"hex\") {\n msg = msg.replace(/[^a-z0-9]+/gi, \"\"), msg.length % 2 !== 0 && (msg = \"0\" + msg);\n for (var i = 0;i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else\n for (var i = 0;i < msg.length; i++) {\n var c = msg.charCodeAt(i), hi = c >> 8, lo = c & 255;\n hi \? res.push(hi, lo) : res.push(lo);\n }\n return res;\n }\n utils.toArray = toArray;\n function zero2(word) {\n return word.length === 1 \? \"0\" + word : word;\n }\n utils.zero2 = zero2;\n function toHex(msg) {\n for (var res = \"\", i = 0;i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n }\n utils.toHex = toHex, utils.encode = function(arr, enc) {\n return enc === \"hex\" \? toHex(arr) : arr;\n };\n }\n}), require_utils3 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/utils.js\"(exports) {\n var utils = exports, BN = require_bn4(), minAssert = require_minimalistic_assert(), minUtils = require_utils2();\n utils.assert = minAssert, utils.toArray = minUtils.toArray, utils.zero2 = minUtils.zero2, utils.toHex = minUtils.toHex, utils.encode = minUtils.encode;\n function getNAF(num, w, bits) {\n var naf = new @Array(Math.max(num.bitLength(), bits) + 1);\n naf.fill(0);\n for (var ws = 1 << w + 1, k = num.clone(), i = 0;i < naf.length; i++) {\n var z, mod = k.andln(ws - 1);\n k.isOdd() \? (mod > (ws >> 1) - 1 \? z = (ws >> 1) - mod : z = mod, k.isubn(z)) : z = 0, naf[i] = z, k.iushrn(1);\n }\n return naf;\n }\n utils.getNAF = getNAF;\n function getJSF(k1, k2) {\n var jsf = [[], []];\n k1 = k1.clone(), k2 = k2.clone();\n for (var d1 = 0, d2 = 0, m8;k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0; ) {\n var m14 = k1.andln(3) + d1 & 3, m24 = k2.andln(3) + d2 & 3;\n m14 === 3 && (m14 = -1), m24 === 3 && (m24 = -1);\n var u1;\n (m14 & 1) === 0 \? u1 = 0 : (m8 = k1.andln(7) + d1 & 7, (m8 === 3 || m8 === 5) && m24 === 2 \? u1 = -m14 : u1 = m14), jsf[0].push(u1);\n var u2;\n (m24 & 1) === 0 \? u2 = 0 : (m8 = k2.andln(7) + d2 & 7, (m8 === 3 || m8 === 5) && m14 === 2 \? u2 = -m24 : u2 = m24), jsf[1].push(u2), 2 * d1 === u1 + 1 && (d1 = 1 - d1), 2 * d2 === u2 + 1 && (d2 = 1 - d2), k1.iushrn(1), k2.iushrn(1);\n }\n return jsf;\n }\n utils.getJSF = getJSF;\n function cachedProperty(obj, name, computer) {\n var key2 = \"_\" + name;\n obj.prototype[name] = function() {\n return this[key2] !== void 0 \? this[key2] : this[key2] = computer.@call(this);\n };\n }\n utils.cachedProperty = cachedProperty;\n function parseBytes(bytes) {\n if (bytes instanceof KeyObject)\n bytes = bytes.export();\n else if (bytes instanceof CryptoKey)\n bytes = KeyObject.from(bytes).export();\n return typeof bytes == \"string\" \? utils.toArray(bytes, \"hex\") : bytes;\n }\n utils.parseBytes = parseBytes;\n function intFromLE(bytes) {\n return new BN(bytes, \"hex\", \"le\");\n }\n utils.intFromLE = intFromLE;\n }\n}), require_base = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/base.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), getNAF = utils.getNAF, getJSF = utils.getJSF, assert = utils.assert;\n function BaseCurve(type, conf) {\n this.type = type, this.p = new BN(conf.p, 16), this.red = conf.prime \? BN.red(conf.prime) : BN.mont(this.p), this.zero = new BN(0).toRed(this.red), this.one = new BN(1).toRed(this.red), this.two = new BN(2).toRed(this.red), this.n = conf.n && new BN(conf.n, 16), this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed), this._wnafT1 = new @Array(4), this._wnafT2 = new @Array(4), this._wnafT3 = new @Array(4), this._wnafT4 = new @Array(4), this._bitLength = this.n \? this.n.bitLength() : 0;\n var adjustCount = this.n && this.p.div(this.n);\n !adjustCount || adjustCount.cmpn(100) > 0 \? this.redN = null : (this._maxwellTrick = !0, this.redN = this.n.toRed(this.red));\n }\n module.exports = BaseCurve, BaseCurve.prototype = {}, BaseCurve.prototype.point = function() {\n throw new Error(\"Not implemented\");\n }, BaseCurve.prototype.validate = function() {\n throw new Error(\"Not implemented\");\n }, BaseCurve.prototype._fixedNafMul = function(p, k) {\n assert(p.precomputed);\n var doubles = p._getDoubles(), naf = getNAF(k, 1, this._bitLength), I = (1 << doubles.step + 1) - (doubles.step % 2 === 0 \? 2 : 1);\n I /= 3;\n var repr = [], j, nafW;\n for (j = 0;j < naf.length; j += doubles.step) {\n nafW = 0;\n for (var l = j + doubles.step - 1;l >= j; l--)\n nafW = (nafW << 1) + naf[l];\n repr.push(nafW);\n }\n for (var a = this.jpoint(null, null, null), b = this.jpoint(null, null, null), i = I;i > 0; i--) {\n for (j = 0;j < repr.length; j++)\n nafW = repr[j], nafW === i \? b = b.mixedAdd(doubles.points[j]) : nafW === -i && (b = b.mixedAdd(doubles.points[j].neg()));\n a = a.add(b);\n }\n return a.toP();\n }, BaseCurve.prototype._wnafMul = function(p, k) {\n var w = 4, nafPoints = p._getNAFPoints(w);\n w = nafPoints.wnd;\n for (var wnd = nafPoints.points, naf = getNAF(k, w, this._bitLength), acc = this.jpoint(null, null, null), i = naf.length - 1;i >= 0; i--) {\n for (var l = 0;i >= 0 && naf[i] === 0; i--)\n l++;\n if (i >= 0 && l++, acc = acc.dblp(l), i < 0)\n break;\n var z = naf[i];\n assert(z !== 0), p.type === \"affine\" \? z > 0 \? acc = acc.mixedAdd(wnd[z - 1 >> 1]) : acc = acc.mixedAdd(wnd[-z - 1 >> 1].neg()) : z > 0 \? acc = acc.add(wnd[z - 1 >> 1]) : acc = acc.add(wnd[-z - 1 >> 1].neg());\n }\n return p.type === \"affine\" \? acc.toP() : acc;\n }, BaseCurve.prototype._wnafMulAdd = function(defW, points, coeffs, len, jacobianResult) {\n var wndWidth = this._wnafT1, wnd = this._wnafT2, naf = this._wnafT3, max = 0, i, j, p;\n for (i = 0;i < len; i++) {\n p = points[i];\n var nafPoints = p._getNAFPoints(defW);\n wndWidth[i] = nafPoints.wnd, wnd[i] = nafPoints.points;\n }\n for (i = len - 1;i >= 1; i -= 2) {\n var a = i - 1, b = i;\n if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength), naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength), max = Math.max(naf[a].length, max), max = Math.max(naf[b].length, max);\n continue;\n }\n var comb = [points[a], null, null, points[b]];\n points[a].y.cmp(points[b].y) === 0 \? (comb[1] = points[a].add(points[b]), comb[2] = points[a].toJ().mixedAdd(points[b].neg())) : points[a].y.cmp(points[b].y.redNeg()) === 0 \? (comb[1] = points[a].toJ().mixedAdd(points[b]), comb[2] = points[a].add(points[b].neg())) : (comb[1] = points[a].toJ().mixedAdd(points[b]), comb[2] = points[a].toJ().mixedAdd(points[b].neg()));\n var index = [-3, -1, -5, -7, 0, 7, 5, 1, 3], jsf = getJSF(coeffs[a], coeffs[b]);\n for (max = Math.max(jsf[0].length, max), naf[a] = new @Array(max), naf[b] = new @Array(max), j = 0;j < max; j++) {\n var ja = jsf[0][j] | 0, jb = jsf[1][j] | 0;\n naf[a][j] = index[(ja + 1) * 3 + (jb + 1)], naf[b][j] = 0, wnd[a] = comb;\n }\n }\n var acc = this.jpoint(null, null, null), tmp = this._wnafT4;\n for (i = max;i >= 0; i--) {\n for (var k = 0;i >= 0; ) {\n var zero = !0;\n for (j = 0;j < len; j++)\n tmp[j] = naf[j][i] | 0, tmp[j] !== 0 && (zero = !1);\n if (!zero)\n break;\n k++, i--;\n }\n if (i >= 0 && k++, acc = acc.dblp(k), i < 0)\n break;\n for (j = 0;j < len; j++) {\n var z = tmp[j];\n z !== 0 && (z > 0 \? p = wnd[j][z - 1 >> 1] : z < 0 && (p = wnd[j][-z - 1 >> 1].neg()), p.type === \"affine\" \? acc = acc.mixedAdd(p) : acc = acc.add(p));\n }\n }\n for (i = 0;i < len; i++)\n wnd[i] = null;\n return jacobianResult \? acc : acc.toP();\n };\n function BasePoint(curve, type) {\n this.curve = curve, this.type = type, this.precomputed = null;\n }\n BasePoint.prototype = {}, BaseCurve.BasePoint = BasePoint, BasePoint.prototype.eq = function() {\n throw new Error(\"Not implemented\");\n }, BasePoint.prototype.validate = function() {\n return this.curve.validate(this);\n }, BaseCurve.prototype.decodePoint = function(bytes, enc) {\n bytes = utils.toArray(bytes, enc);\n var len = this.p.byteLength();\n if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) {\n bytes[0] === 6 \? assert(bytes[bytes.length - 1] % 2 === 0) : bytes[0] === 7 && assert(bytes[bytes.length - 1] % 2 === 1);\n var res = this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len));\n return res;\n } else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len)\n return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3);\n throw new Error(\"Unknown point format\");\n }, BasePoint.prototype.encodeCompressed = function(enc) {\n return this.encode(enc, !0);\n }, BasePoint.prototype._encode = function(compact) {\n var len = this.curve.p.byteLength(), x = this.getX().toArray(\"be\", len);\n return compact \? [this.getY().isEven() \? 2 : 3].concat(x) : [4].concat(x, this.getY().toArray(\"be\", len));\n }, BasePoint.prototype.encode = function(enc, compact) {\n return utils.encode(this._encode(compact), enc);\n }, BasePoint.prototype.precompute = function(power) {\n if (this.precomputed)\n return this;\n var precomputed = {\n doubles: null,\n naf: null,\n beta: null\n };\n return precomputed.naf = this._getNAFPoints(8), precomputed.doubles = this._getDoubles(4, power), precomputed.beta = this._getBeta(), this.precomputed = precomputed, this;\n }, BasePoint.prototype._hasDoubles = function(k) {\n if (!this.precomputed)\n return !1;\n var doubles = this.precomputed.doubles;\n return doubles \? doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step) : !1;\n }, BasePoint.prototype._getDoubles = function(step, power) {\n if (this.precomputed && this.precomputed.doubles)\n return this.precomputed.doubles;\n for (var doubles = [this], acc = this, i = 0;i < power; i += step) {\n for (var j = 0;j < step; j++)\n acc = acc.dbl();\n doubles.push(acc);\n }\n return {\n step,\n points: doubles\n };\n }, BasePoint.prototype._getNAFPoints = function(wnd) {\n if (this.precomputed && this.precomputed.naf)\n return this.precomputed.naf;\n for (var res = [this], max = (1 << wnd) - 1, dbl = max === 1 \? null : this.dbl(), i = 1;i < max; i++)\n res[i] = res[i - 1].add(dbl);\n return {\n wnd,\n points: res\n };\n }, BasePoint.prototype._getBeta = function() {\n return null;\n }, BasePoint.prototype.dblp = function(k) {\n for (var r = this, i = 0;i < k; i++)\n r = r.dbl();\n return r;\n };\n }\n}), require_short = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/short.js\"(exports, module) {\n var utils = require_utils3(), BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), assert = utils.assert;\n function ShortCurve(conf) {\n Base.@call(this, \"short\", conf), this.a = new BN(conf.a, 16).toRed(this.red), this.b = new BN(conf.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = this.a.fromRed().cmpn(0) === 0, this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0, this.endo = this._getEndomorphism(conf), this._endoWnafT1 = new @Array(4), this._endoWnafT2 = new @Array(4);\n }\n inherits(ShortCurve, Base), module.exports = ShortCurve, ShortCurve.prototype._getEndomorphism = function(conf) {\n if (!(!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)) {\n var beta, lambda;\n if (conf.beta)\n beta = new BN(conf.beta, 16).toRed(this.red);\n else {\n var betas = this._getEndoRoots(this.p);\n beta = betas[0].cmp(betas[1]) < 0 \? betas[0] : betas[1], beta = beta.toRed(this.red);\n }\n if (conf.lambda)\n lambda = new BN(conf.lambda, 16);\n else {\n var lambdas = this._getEndoRoots(this.n);\n this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0 \? lambda = lambdas[0] : (lambda = lambdas[1], assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0));\n }\n var basis;\n return conf.basis \? basis = conf.basis.map(function(vec) {\n return {\n a: new BN(vec.a, 16),\n b: new BN(vec.b, 16)\n };\n }) : basis = this._getEndoBasis(lambda), {\n beta,\n lambda,\n basis\n };\n }\n }, ShortCurve.prototype._getEndoRoots = function(num) {\n var red = num === this.p \? this.red : BN.mont(num), tinv = new BN(2).toRed(red).redInvm(), ntinv = tinv.redNeg(), s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv), l1 = ntinv.redAdd(s).fromRed(), l2 = ntinv.redSub(s).fromRed();\n return [l1, l2];\n }, ShortCurve.prototype._getEndoBasis = function(lambda) {\n for (var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), u = lambda, v = this.n.clone(), x1 = new BN(1), y1 = new BN(0), x2 = new BN(0), y2 = new BN(1), a0, b0, a1, b1, a2, b2, prevR, i = 0, r, x;u.cmpn(0) !== 0; ) {\n var q = v.div(u);\n r = v.sub(q.mul(u)), x = x2.sub(q.mul(x1));\n var y = y2.sub(q.mul(y1));\n if (!a1 && r.cmp(aprxSqrt) < 0)\n a0 = prevR.neg(), b0 = x1, a1 = r.neg(), b1 = x;\n else if (a1 && ++i === 2)\n break;\n prevR = r, v = u, u = r, x2 = x1, x1 = x, y2 = y1, y1 = y;\n }\n a2 = r.neg(), b2 = x;\n var len1 = a1.sqr().add(b1.sqr()), len2 = a2.sqr().add(b2.sqr());\n return len2.cmp(len1) >= 0 && (a2 = a0, b2 = b0), a1.negative && (a1 = a1.neg(), b1 = b1.neg()), a2.negative && (a2 = a2.neg(), b2 = b2.neg()), [\n { a: a1, b: b1 },\n { a: a2, b: b2 }\n ];\n }, ShortCurve.prototype._endoSplit = function(k) {\n var basis = this.endo.basis, v1 = basis[0], v2 = basis[1], c1 = v2.b.mul(k).divRound(this.n), c2 = v1.b.neg().mul(k).divRound(this.n), p1 = c1.mul(v1.a), p2 = c2.mul(v2.a), q1 = c1.mul(v1.b), q2 = c2.mul(v2.b), k1 = k.sub(p1).sub(p2), k2 = q1.add(q2).neg();\n return { k1, k2 };\n }, ShortCurve.prototype.pointFromX = function(x, odd) {\n x = new BN(x, 16), x.red || (x = x.toRed(this.red));\n var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b), y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n var isOdd = y.fromRed().isOdd();\n return (odd && !isOdd || !odd && isOdd) && (y = y.redNeg()), this.point(x, y);\n }, ShortCurve.prototype.validate = function(point) {\n if (point.inf)\n return !0;\n var { x, y } = point, ax = this.a.redMul(x), rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n return y.redSqr().redISub(rhs).cmpn(0) === 0;\n }, ShortCurve.prototype._endoWnafMulAdd = function(points, coeffs, jacobianResult) {\n for (var npoints = this._endoWnafT1, ncoeffs = this._endoWnafT2, i = 0;i < points.length; i++) {\n var split = this._endoSplit(coeffs[i]), p = points[i], beta = p._getBeta();\n split.k1.negative && (split.k1.ineg(), p = p.neg(!0)), split.k2.negative && (split.k2.ineg(), beta = beta.neg(!0)), npoints[i * 2] = p, npoints[i * 2 + 1] = beta, ncoeffs[i * 2] = split.k1, ncoeffs[i * 2 + 1] = split.k2;\n }\n for (var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult), j = 0;j < i * 2; j++)\n npoints[j] = null, ncoeffs[j] = null;\n return res;\n };\n function Point(curve, x, y, isRed) {\n Base.BasePoint.@call(this, curve, \"affine\"), x === null && y === null \? (this.x = null, this.y = null, this.inf = !0) : (this.x = new BN(x, 16), this.y = new BN(y, 16), isRed && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = !1);\n }\n inherits(Point, Base.BasePoint), ShortCurve.prototype.point = function(x, y, isRed) {\n return new Point(this, x, y, isRed);\n }, ShortCurve.prototype.pointFromJSON = function(obj, red) {\n return Point.fromJSON(this, obj, red);\n }, Point.prototype._getBeta = function() {\n if (this.curve.endo) {\n var pre = this.precomputed;\n if (pre && pre.beta)\n return pre.beta;\n var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n if (pre) {\n var curve = this.curve, endoMul = function(p) {\n return curve.point(p.x.redMul(curve.endo.beta), p.y);\n };\n pre.beta = beta, beta.precomputed = {\n beta: null,\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(endoMul)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(endoMul)\n }\n };\n }\n return beta;\n }\n }, Point.prototype.toJSON = function() {\n return this.precomputed \? [\n this.x,\n this.y,\n this.precomputed && {\n doubles: this.precomputed.doubles && {\n step: this.precomputed.doubles.step,\n points: this.precomputed.doubles.points.slice(1)\n },\n naf: this.precomputed.naf && {\n wnd: this.precomputed.naf.wnd,\n points: this.precomputed.naf.points.slice(1)\n }\n }\n ] : [this.x, this.y];\n }, Point.fromJSON = function(curve, obj, red) {\n typeof obj == \"string\" && (obj = JSON.parse(obj));\n var res = curve.point(obj[0], obj[1], red);\n if (!obj[2])\n return res;\n function obj2point(obj2) {\n return curve.point(obj2[0], obj2[1], red);\n }\n var pre = obj[2];\n return res.precomputed = {\n beta: null,\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: [res].concat(pre.doubles.points.map(obj2point))\n },\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: [res].concat(pre.naf.points.map(obj2point))\n }\n }, res;\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" y: \" + this.y.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.inf;\n }, Point.prototype.add = function(p) {\n if (this.inf)\n return p;\n if (p.inf)\n return this;\n if (this.eq(p))\n return this.dbl();\n if (this.neg().eq(p))\n return this.curve.point(null, null);\n if (this.x.cmp(p.x) === 0)\n return this.curve.point(null, null);\n var c = this.y.redSub(p.y);\n c.cmpn(0) !== 0 && (c = c.redMul(this.x.redSub(p.x).redInvm()));\n var nx = c.redSqr().redISub(this.x).redISub(p.x), ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n }, Point.prototype.dbl = function() {\n if (this.inf)\n return this;\n var ys1 = this.y.redAdd(this.y);\n if (ys1.cmpn(0) === 0)\n return this.curve.point(null, null);\n var a = this.curve.a, x2 = this.x.redSqr(), dyinv = ys1.redInvm(), c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv), nx = c.redSqr().redISub(this.x.redAdd(this.x)), ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n }, Point.prototype.getX = function() {\n return this.x.fromRed();\n }, Point.prototype.getY = function() {\n return this.y.fromRed();\n }, Point.prototype.mul = function(k) {\n return k = new BN(k, 16), this.isInfinity() \? this : this._hasDoubles(k) \? this.curve._fixedNafMul(this, k) : this.curve.endo \? this.curve._endoWnafMulAdd([this], [k]) : this.curve._wnafMul(this, k);\n }, Point.prototype.mulAdd = function(k1, p2, k2) {\n var points = [this, p2], coeffs = [k1, k2];\n return this.curve.endo \? this.curve._endoWnafMulAdd(points, coeffs) : this.curve._wnafMulAdd(1, points, coeffs, 2);\n }, Point.prototype.jmulAdd = function(k1, p2, k2) {\n var points = [this, p2], coeffs = [k1, k2];\n return this.curve.endo \? this.curve._endoWnafMulAdd(points, coeffs, !0) : this.curve._wnafMulAdd(1, points, coeffs, 2, !0);\n }, Point.prototype.eq = function(p) {\n return this === p || this.inf === p.inf && (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n }, Point.prototype.neg = function(_precompute) {\n if (this.inf)\n return this;\n var res = this.curve.point(this.x, this.y.redNeg());\n if (_precompute && this.precomputed) {\n var pre = this.precomputed, negate = function(p) {\n return p.neg();\n };\n res.precomputed = {\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(negate)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(negate)\n }\n };\n }\n return res;\n }, Point.prototype.toJ = function() {\n if (this.inf)\n return this.curve.jpoint(null, null, null);\n var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n return res;\n };\n function JPoint(curve, x, y, z) {\n Base.BasePoint.@call(this, curve, \"jacobian\"), x === null && y === null && z === null \? (this.x = this.curve.one, this.y = this.curve.one, this.z = new BN(0)) : (this.x = new BN(x, 16), this.y = new BN(y, 16), this.z = new BN(z, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one;\n }\n inherits(JPoint, Base.BasePoint), ShortCurve.prototype.jpoint = function(x, y, z) {\n return new JPoint(this, x, y, z);\n }, JPoint.prototype.toP = function() {\n if (this.isInfinity())\n return this.curve.point(null, null);\n var zinv = this.z.redInvm(), zinv2 = zinv.redSqr(), ax = this.x.redMul(zinv2), ay = this.y.redMul(zinv2).redMul(zinv);\n return this.curve.point(ax, ay);\n }, JPoint.prototype.neg = function() {\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n }, JPoint.prototype.add = function(p) {\n if (this.isInfinity())\n return p;\n if (p.isInfinity())\n return this;\n var pz2 = p.z.redSqr(), z2 = this.z.redSqr(), u1 = this.x.redMul(pz2), u2 = p.x.redMul(z2), s1 = this.y.redMul(pz2.redMul(p.z)), s2 = p.y.redMul(z2.redMul(this.z)), h = u1.redSub(u2), r = s1.redSub(s2);\n if (h.cmpn(0) === 0)\n return r.cmpn(0) !== 0 \? this.curve.jpoint(null, null, null) : this.dbl();\n var h2 = h.redSqr(), h3 = h2.redMul(h), v = u1.redMul(h2), nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v), ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)), nz = this.z.redMul(p.z).redMul(h);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.mixedAdd = function(p) {\n if (this.isInfinity())\n return p.toJ();\n if (p.isInfinity())\n return this;\n var z2 = this.z.redSqr(), u1 = this.x, u2 = p.x.redMul(z2), s1 = this.y, s2 = p.y.redMul(z2).redMul(this.z), h = u1.redSub(u2), r = s1.redSub(s2);\n if (h.cmpn(0) === 0)\n return r.cmpn(0) !== 0 \? this.curve.jpoint(null, null, null) : this.dbl();\n var h2 = h.redSqr(), h3 = h2.redMul(h), v = u1.redMul(h2), nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v), ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)), nz = this.z.redMul(h);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.dblp = function(pow) {\n if (pow === 0)\n return this;\n if (this.isInfinity())\n return this;\n if (!pow)\n return this.dbl();\n var i;\n if (this.curve.zeroA || this.curve.threeA) {\n var r = this;\n for (i = 0;i < pow; i++)\n r = r.dbl();\n return r;\n }\n var a = this.curve.a, tinv = this.curve.tinv, jx = this.x, jy = this.y, jz = this.z, jz4 = jz.redSqr().redSqr(), jyd = jy.redAdd(jy);\n for (i = 0;i < pow; i++) {\n var jx2 = jx.redSqr(), jyd2 = jyd.redSqr(), jyd4 = jyd2.redSqr(), c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)), t1 = jx.redMul(jyd2), nx = c.redSqr().redISub(t1.redAdd(t1)), t2 = t1.redISub(nx), dny = c.redMul(t2);\n dny = dny.redIAdd(dny).redISub(jyd4);\n var nz = jyd.redMul(jz);\n i + 1 < pow && (jz4 = jz4.redMul(jyd4)), jx = nx, jz = nz, jyd = dny;\n }\n return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n }, JPoint.prototype.dbl = function() {\n return this.isInfinity() \? this : this.curve.zeroA \? this._zeroDbl() : this.curve.threeA \? this._threeDbl() : this._dbl();\n }, JPoint.prototype._zeroDbl = function() {\n var nx, ny, nz;\n if (this.zOne) {\n var xx = this.x.redSqr(), yy = this.y.redSqr(), yyyy = yy.redSqr(), s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n var m = xx.redAdd(xx).redIAdd(xx), t = m.redSqr().redISub(s).redISub(s), yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8), yyyy8 = yyyy8.redIAdd(yyyy8), nx = t, ny = m.redMul(s.redISub(t)).redISub(yyyy8), nz = this.y.redAdd(this.y);\n } else {\n var a = this.x.redSqr(), b = this.y.redSqr(), c = b.redSqr(), d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n d = d.redIAdd(d);\n var e = a.redAdd(a).redIAdd(a), f = e.redSqr(), c8 = c.redIAdd(c);\n c8 = c8.redIAdd(c8), c8 = c8.redIAdd(c8), nx = f.redISub(d).redISub(d), ny = e.redMul(d.redISub(nx)).redISub(c8), nz = this.y.redMul(this.z), nz = nz.redIAdd(nz);\n }\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype._threeDbl = function() {\n var nx, ny, nz;\n if (this.zOne) {\n var xx = this.x.redSqr(), yy = this.y.redSqr(), yyyy = yy.redSqr(), s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a), t = m.redSqr().redISub(s).redISub(s);\n nx = t;\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8), yyyy8 = yyyy8.redIAdd(yyyy8), ny = m.redMul(s.redISub(t)).redISub(yyyy8), nz = this.y.redAdd(this.y);\n } else {\n var delta = this.z.redSqr(), gamma = this.y.redSqr(), beta = this.x.redMul(gamma), alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n alpha = alpha.redAdd(alpha).redIAdd(alpha);\n var beta4 = beta.redIAdd(beta);\n beta4 = beta4.redIAdd(beta4);\n var beta8 = beta4.redAdd(beta4);\n nx = alpha.redSqr().redISub(beta8), nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n var ggamma8 = gamma.redSqr();\n ggamma8 = ggamma8.redIAdd(ggamma8), ggamma8 = ggamma8.redIAdd(ggamma8), ggamma8 = ggamma8.redIAdd(ggamma8), ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n }\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype._dbl = function() {\n var a = this.curve.a, jx = this.x, jy = this.y, jz = this.z, jz4 = jz.redSqr().redSqr(), jx2 = jx.redSqr(), jy2 = jy.redSqr(), c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)), jxd4 = jx.redAdd(jx);\n jxd4 = jxd4.redIAdd(jxd4);\n var t1 = jxd4.redMul(jy2), nx = c.redSqr().redISub(t1.redAdd(t1)), t2 = t1.redISub(nx), jyd8 = jy2.redSqr();\n jyd8 = jyd8.redIAdd(jyd8), jyd8 = jyd8.redIAdd(jyd8), jyd8 = jyd8.redIAdd(jyd8);\n var ny = c.redMul(t2).redISub(jyd8), nz = jy.redAdd(jy).redMul(jz);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.trpl = function() {\n if (!this.curve.zeroA)\n return this.dbl().add(this);\n var xx = this.x.redSqr(), yy = this.y.redSqr(), zz = this.z.redSqr(), yyyy = yy.redSqr(), m = xx.redAdd(xx).redIAdd(xx), mm = m.redSqr(), e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n e = e.redIAdd(e), e = e.redAdd(e).redIAdd(e), e = e.redISub(mm);\n var ee = e.redSqr(), t = yyyy.redIAdd(yyyy);\n t = t.redIAdd(t), t = t.redIAdd(t), t = t.redIAdd(t);\n var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t), yyu4 = yy.redMul(u);\n yyu4 = yyu4.redIAdd(yyu4), yyu4 = yyu4.redIAdd(yyu4);\n var nx = this.x.redMul(ee).redISub(yyu4);\n nx = nx.redIAdd(nx), nx = nx.redIAdd(nx);\n var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n ny = ny.redIAdd(ny), ny = ny.redIAdd(ny), ny = ny.redIAdd(ny);\n var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.mul = function(k, kbase) {\n return k = new BN(k, kbase), this.curve._wnafMul(this, k);\n }, JPoint.prototype.eq = function(p) {\n if (p.type === \"affine\")\n return this.eq(p.toJ());\n if (this === p)\n return !0;\n var z2 = this.z.redSqr(), pz2 = p.z.redSqr();\n if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n return !1;\n var z3 = z2.redMul(this.z), pz3 = pz2.redMul(p.z);\n return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n }, JPoint.prototype.eqXToP = function(x) {\n var zs = this.z.redSqr(), rx = x.toRed(this.curve.red).redMul(zs);\n if (this.x.cmp(rx) === 0)\n return !0;\n for (var xc = x.clone(), t = this.curve.redN.redMul(zs);; ) {\n if (xc.iadd(this.curve.n), xc.cmp(this.curve.p) >= 0)\n return !1;\n if (rx.redIAdd(t), this.x.cmp(rx) === 0)\n return !0;\n }\n }, JPoint.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC JPoint Infinity>\" : \"<EC JPoint x: \" + this.x.toString(16, 2) + \" y: \" + this.y.toString(16, 2) + \" z: \" + this.z.toString(16, 2) + \">\";\n }, JPoint.prototype.isInfinity = function() {\n return this.z.cmpn(0) === 0;\n };\n }\n}), require_mont = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/mont.js\"(exports, module) {\n var BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), utils = require_utils3();\n function MontCurve(conf) {\n Base.@call(this, \"mont\", conf), this.a = new BN(conf.a, 16).toRed(this.red), this.b = new BN(conf.b, 16).toRed(this.red), this.i4 = new BN(4).toRed(this.red).redInvm(), this.two = new BN(2).toRed(this.red), this.a24 = this.i4.redMul(this.a.redAdd(this.two));\n }\n inherits(MontCurve, Base), module.exports = MontCurve, MontCurve.prototype.validate = function(point) {\n var x = point.normalize().x, x2 = x.redSqr(), rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x), y = rhs.redSqrt();\n return y.redSqr().cmp(rhs) === 0;\n };\n function Point(curve, x, z) {\n Base.BasePoint.@call(this, curve, \"projective\"), x === null && z === null \? (this.x = this.curve.one, this.z = this.curve.zero) : (this.x = new BN(x, 16), this.z = new BN(z, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)));\n }\n inherits(Point, Base.BasePoint), MontCurve.prototype.decodePoint = function(bytes, enc) {\n return this.point(utils.toArray(bytes, enc), 1);\n }, MontCurve.prototype.point = function(x, z) {\n return new Point(this, x, z);\n }, MontCurve.prototype.pointFromJSON = function(obj) {\n return Point.fromJSON(this, obj);\n }, Point.prototype.precompute = function() {\n }, Point.prototype._encode = function() {\n return this.getX().toArray(\"be\", this.curve.p.byteLength());\n }, Point.fromJSON = function(curve, obj) {\n return new Point(curve, obj[0], obj[1] || curve.one);\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" z: \" + this.z.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.z.cmpn(0) === 0;\n }, Point.prototype.dbl = function() {\n var a = this.x.redAdd(this.z), aa = a.redSqr(), b = this.x.redSub(this.z), bb = b.redSqr(), c = aa.redSub(bb), nx = aa.redMul(bb), nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\n return this.curve.point(nx, nz);\n }, Point.prototype.add = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.diffAdd = function(p, diff) {\n var a = this.x.redAdd(this.z), b = this.x.redSub(this.z), c = p.x.redAdd(p.z), d = p.x.redSub(p.z), da = d.redMul(a), cb = c.redMul(b), nx = diff.z.redMul(da.redAdd(cb).redSqr()), nz = diff.x.redMul(da.redISub(cb).redSqr());\n return this.curve.point(nx, nz);\n }, Point.prototype.mul = function(k) {\n for (var t = k.clone(), a = this, b = this.curve.point(null, null), c = this, bits = [];t.cmpn(0) !== 0; t.iushrn(1))\n bits.push(t.andln(1));\n for (var i = bits.length - 1;i >= 0; i--)\n bits[i] === 0 \? (a = a.diffAdd(b, c), b = b.dbl()) : (b = a.diffAdd(b, c), a = a.dbl());\n return b;\n }, Point.prototype.mulAdd = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.jumlAdd = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.eq = function(other) {\n return this.getX().cmp(other.getX()) === 0;\n }, Point.prototype.normalize = function() {\n return this.x = this.x.redMul(this.z.redInvm()), this.z = this.curve.one, this;\n }, Point.prototype.getX = function() {\n return this.normalize(), this.x.fromRed();\n };\n }\n}), require_edwards = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/edwards.js\"(exports, module) {\n var utils = require_utils3(), BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), assert = utils.assert;\n function EdwardsCurve(conf) {\n this.twisted = (conf.a | 0) !== 1, this.mOneA = this.twisted && (conf.a | 0) === -1, this.extended = this.mOneA, Base.@call(this, \"edwards\", conf), this.a = new BN(conf.a, 16).umod(this.red.m), this.a = this.a.toRed(this.red), this.c = new BN(conf.c, 16).toRed(this.red), this.c2 = this.c.redSqr(), this.d = new BN(conf.d, 16).toRed(this.red), this.dd = this.d.redAdd(this.d), assert(!this.twisted || this.c.fromRed().cmpn(1) === 0), this.oneC = (conf.c | 0) === 1;\n }\n inherits(EdwardsCurve, Base), module.exports = EdwardsCurve, EdwardsCurve.prototype._mulA = function(num) {\n return this.mOneA \? num.redNeg() : this.a.redMul(num);\n }, EdwardsCurve.prototype._mulC = function(num) {\n return this.oneC \? num : this.c.redMul(num);\n }, EdwardsCurve.prototype.jpoint = function(x, y, z, t) {\n return this.point(x, y, z, t);\n }, EdwardsCurve.prototype.pointFromX = function(x, odd) {\n x = new BN(x, 16), x.red || (x = x.toRed(this.red));\n var x2 = x.redSqr(), rhs = this.c2.redSub(this.a.redMul(x2)), lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2)), y2 = rhs.redMul(lhs.redInvm()), y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n var isOdd = y.fromRed().isOdd();\n return (odd && !isOdd || !odd && isOdd) && (y = y.redNeg()), this.point(x, y);\n }, EdwardsCurve.prototype.pointFromY = function(y, odd) {\n y = new BN(y, 16), y.red || (y = y.toRed(this.red));\n var y2 = y.redSqr(), lhs = y2.redSub(this.c2), rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a), x2 = lhs.redMul(rhs.redInvm());\n if (x2.cmp(this.zero) === 0) {\n if (odd)\n throw new Error(\"invalid point\");\n return this.point(this.zero, y);\n }\n var x = x2.redSqrt();\n if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n return x.fromRed().isOdd() !== odd && (x = x.redNeg()), this.point(x, y);\n }, EdwardsCurve.prototype.validate = function(point) {\n if (point.isInfinity())\n return !0;\n point.normalize();\n var x2 = point.x.redSqr(), y2 = point.y.redSqr(), lhs = x2.redMul(this.a).redAdd(y2), rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\n return lhs.cmp(rhs) === 0;\n };\n function Point(curve, x, y, z, t) {\n Base.BasePoint.@call(this, curve, \"projective\"), x === null && y === null && z === null \? (this.x = this.curve.zero, this.y = this.curve.one, this.z = this.curve.one, this.t = this.curve.zero, this.zOne = !0) : (this.x = new BN(x, 16), this.y = new BN(y, 16), this.z = z \? new BN(z, 16) : this.curve.one, this.t = t && new BN(t, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.t && !this.t.red && (this.t = this.t.toRed(this.curve.red)), this.zOne = this.z === this.curve.one, this.curve.extended && !this.t && (this.t = this.x.redMul(this.y), this.zOne || (this.t = this.t.redMul(this.z.redInvm()))));\n }\n inherits(Point, Base.BasePoint), EdwardsCurve.prototype.pointFromJSON = function(obj) {\n return Point.fromJSON(this, obj);\n }, EdwardsCurve.prototype.point = function(x, y, z, t) {\n return new Point(this, x, y, z, t);\n }, Point.fromJSON = function(curve, obj) {\n return new Point(curve, obj[0], obj[1], obj[2]);\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" y: \" + this.y.fromRed().toString(16, 2) + \" z: \" + this.z.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || this.zOne && this.y.cmp(this.curve.c) === 0);\n }, Point.prototype._extDbl = function() {\n var a = this.x.redSqr(), b = this.y.redSqr(), c = this.z.redSqr();\n c = c.redIAdd(c);\n var d = this.curve._mulA(a), e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b), g = d.redAdd(b), f = g.redSub(c), h = d.redSub(b), nx = e.redMul(f), ny = g.redMul(h), nt = e.redMul(h), nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n }, Point.prototype._projDbl = function() {\n var b = this.x.redAdd(this.y).redSqr(), c = this.x.redSqr(), d = this.y.redSqr(), nx, ny, nz, e, h, j;\n if (this.curve.twisted) {\n e = this.curve._mulA(c);\n var f = e.redAdd(d);\n this.zOne \? (nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)), ny = f.redMul(e.redSub(d)), nz = f.redSqr().redSub(f).redSub(f)) : (h = this.z.redSqr(), j = f.redSub(h).redISub(h), nx = b.redSub(c).redISub(d).redMul(j), ny = f.redMul(e.redSub(d)), nz = f.redMul(j));\n } else\n e = c.redAdd(d), h = this.curve._mulC(this.z).redSqr(), j = e.redSub(h).redSub(h), nx = this.curve._mulC(b.redISub(e)).redMul(j), ny = this.curve._mulC(e).redMul(c.redISub(d)), nz = e.redMul(j);\n return this.curve.point(nx, ny, nz);\n }, Point.prototype.dbl = function() {\n return this.isInfinity() \? this : this.curve.extended \? this._extDbl() : this._projDbl();\n }, Point.prototype._extAdd = function(p) {\n var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)), b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)), c = this.t.redMul(this.curve.dd).redMul(p.t), d = this.z.redMul(p.z.redAdd(p.z)), e = b.redSub(a), f = d.redSub(c), g = d.redAdd(c), h = b.redAdd(a), nx = e.redMul(f), ny = g.redMul(h), nt = e.redMul(h), nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n }, Point.prototype._projAdd = function(p) {\n var a = this.z.redMul(p.z), b = a.redSqr(), c = this.x.redMul(p.x), d = this.y.redMul(p.y), e = this.curve.d.redMul(c).redMul(d), f = b.redSub(e), g = b.redAdd(e), tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d), nx = a.redMul(f).redMul(tmp), ny, nz;\n return this.curve.twisted \? (ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))), nz = f.redMul(g)) : (ny = a.redMul(g).redMul(d.redSub(c)), nz = this.curve._mulC(f).redMul(g)), this.curve.point(nx, ny, nz);\n }, Point.prototype.add = function(p) {\n return this.isInfinity() \? p : p.isInfinity() \? this : this.curve.extended \? this._extAdd(p) : this._projAdd(p);\n }, Point.prototype.mul = function(k) {\n return this._hasDoubles(k) \? this.curve._fixedNafMul(this, k) : this.curve._wnafMul(this, k);\n }, Point.prototype.mulAdd = function(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, !1);\n }, Point.prototype.jmulAdd = function(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, !0);\n }, Point.prototype.normalize = function() {\n if (this.zOne)\n return this;\n var zi = this.z.redInvm();\n return this.x = this.x.redMul(zi), this.y = this.y.redMul(zi), this.t && (this.t = this.t.redMul(zi)), this.z = this.curve.one, this.zOne = !0, this;\n }, Point.prototype.neg = function() {\n return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg());\n }, Point.prototype.getX = function() {\n return this.normalize(), this.x.fromRed();\n }, Point.prototype.getY = function() {\n return this.normalize(), this.y.fromRed();\n }, Point.prototype.eq = function(other) {\n return this === other || this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0;\n }, Point.prototype.eqXToP = function(x) {\n var rx = x.toRed(this.curve.red).redMul(this.z);\n if (this.x.cmp(rx) === 0)\n return !0;\n for (var xc = x.clone(), t = this.curve.redN.redMul(this.z);; ) {\n if (xc.iadd(this.curve.n), xc.cmp(this.curve.p) >= 0)\n return !1;\n if (rx.redIAdd(t), this.x.cmp(rx) === 0)\n return !0;\n }\n }, Point.prototype.toP = Point.prototype.normalize, Point.prototype.mixedAdd = Point.prototype.add;\n }\n}), require_curve = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/index.js\"(exports) {\n var curve = exports;\n curve.base = require_base(), curve.short = require_short(), curve.mont = require_mont(), curve.edwards = require_edwards();\n }\n}), require_utils4 = __commonJS({\n \"node_modules/hash.js/lib/hash/utils.js\"(exports) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser();\n exports.inherits = inherits;\n function isSurrogatePair(msg, i) {\n return (msg.charCodeAt(i) & 64512) !== 55296 || i < 0 || i + 1 >= msg.length \? !1 : (msg.charCodeAt(i + 1) & 64512) === 56320;\n }\n function toArray(msg, enc) {\n if (@Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg == \"string\")\n if (enc) {\n if (enc === \"hex\")\n for (msg = msg.replace(/[^a-z0-9]+/gi, \"\"), msg.length % 2 !== 0 && (msg = \"0\" + msg), i = 0;i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else\n for (var p = 0, i = 0;i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n c < 128 \? res[p++] = c : c < 2048 \? (res[p++] = c >> 6 | 192, res[p++] = c & 63 | 128) : isSurrogatePair(msg, i) \? (c = 65536 + ((c & 1023) << 10) + (msg.charCodeAt(++i) & 1023), res[p++] = c >> 18 | 240, res[p++] = c >> 12 & 63 | 128, res[p++] = c >> 6 & 63 | 128, res[p++] = c & 63 | 128) : (res[p++] = c >> 12 | 224, res[p++] = c >> 6 & 63 | 128, res[p++] = c & 63 | 128);\n }\n else\n for (i = 0;i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n exports.toArray = toArray;\n function toHex(msg) {\n for (var res = \"\", i = 0;i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n }\n exports.toHex = toHex;\n function htonl(w) {\n var res = w >>> 24 | w >>> 8 & 65280 | w << 8 & 16711680 | (w & 255) << 24;\n return res >>> 0;\n }\n exports.htonl = htonl;\n function toHex32(msg, endian) {\n for (var res = \"\", i = 0;i < msg.length; i++) {\n var w = msg[i];\n endian === \"little\" && (w = htonl(w)), res += zero8(w.toString(16));\n }\n return res;\n }\n exports.toHex32 = toHex32;\n function zero2(word) {\n return word.length === 1 \? \"0\" + word : word;\n }\n exports.zero2 = zero2;\n function zero8(word) {\n return word.length === 7 \? \"0\" + word : word.length === 6 \? \"00\" + word : word.length === 5 \? \"000\" + word : word.length === 4 \? \"0000\" + word : word.length === 3 \? \"00000\" + word : word.length === 2 \? \"000000\" + word : word.length === 1 \? \"0000000\" + word : word;\n }\n exports.zero8 = zero8;\n function join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n for (var res = new @Array(len / 4), i = 0, k = start;i < res.length; i++, k += 4) {\n var w;\n endian === \"big\" \? w = msg[k] << 24 | msg[k + 1] << 16 | msg[k + 2] << 8 | msg[k + 3] : w = msg[k + 3] << 24 | msg[k + 2] << 16 | msg[k + 1] << 8 | msg[k], res[i] = w >>> 0;\n }\n return res;\n }\n exports.join32 = join32;\n function split32(msg, endian) {\n for (var res = new @Array(msg.length * 4), i = 0, k = 0;i < msg.length; i++, k += 4) {\n var m = msg[i];\n endian === \"big\" \? (res[k] = m >>> 24, res[k + 1] = m >>> 16 & 255, res[k + 2] = m >>> 8 & 255, res[k + 3] = m & 255) : (res[k + 3] = m >>> 24, res[k + 2] = m >>> 16 & 255, res[k + 1] = m >>> 8 & 255, res[k] = m & 255);\n }\n return res;\n }\n exports.split32 = split32;\n function rotr32(w, b) {\n return w >>> b | w << 32 - b;\n }\n exports.rotr32 = rotr32;\n function rotl32(w, b) {\n return w << b | w >>> 32 - b;\n }\n exports.rotl32 = rotl32;\n function sum32(a, b) {\n return a + b >>> 0;\n }\n exports.sum32 = sum32;\n function sum32_3(a, b, c) {\n return a + b + c >>> 0;\n }\n exports.sum32_3 = sum32_3;\n function sum32_4(a, b, c, d) {\n return a + b + c + d >>> 0;\n }\n exports.sum32_4 = sum32_4;\n function sum32_5(a, b, c, d, e) {\n return a + b + c + d + e >>> 0;\n }\n exports.sum32_5 = sum32_5;\n function sum64(buf, pos, ah, al) {\n var bh = buf[pos], bl = buf[pos + 1], lo = al + bl >>> 0, hi = (lo < al \? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0, buf[pos + 1] = lo;\n }\n exports.sum64 = sum64;\n function sum64_hi(ah, al, bh, bl) {\n var lo = al + bl >>> 0, hi = (lo < al \? 1 : 0) + ah + bh;\n return hi >>> 0;\n }\n exports.sum64_hi = sum64_hi;\n function sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n }\n exports.sum64_lo = sum64_lo;\n function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0, lo = al;\n lo = lo + bl >>> 0, carry += lo < al \? 1 : 0, lo = lo + cl >>> 0, carry += lo < cl \? 1 : 0, lo = lo + dl >>> 0, carry += lo < dl \? 1 : 0;\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n }\n exports.sum64_4_hi = sum64_4_hi;\n function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n }\n exports.sum64_4_lo = sum64_4_lo;\n function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0, lo = al;\n lo = lo + bl >>> 0, carry += lo < al \? 1 : 0, lo = lo + cl >>> 0, carry += lo < cl \? 1 : 0, lo = lo + dl >>> 0, carry += lo < dl \? 1 : 0, lo = lo + el >>> 0, carry += lo < el \? 1 : 0;\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n }\n exports.sum64_5_hi = sum64_5_hi;\n function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n return lo >>> 0;\n }\n exports.sum64_5_lo = sum64_5_lo;\n function rotr64_hi(ah, al, num) {\n var r = al << 32 - num | ah >>> num;\n return r >>> 0;\n }\n exports.rotr64_hi = rotr64_hi;\n function rotr64_lo(ah, al, num) {\n var r = ah << 32 - num | al >>> num;\n return r >>> 0;\n }\n exports.rotr64_lo = rotr64_lo;\n function shr64_hi(ah, al, num) {\n return ah >>> num;\n }\n exports.shr64_hi = shr64_hi;\n function shr64_lo(ah, al, num) {\n var r = ah << 32 - num | al >>> num;\n return r >>> 0;\n }\n exports.shr64_lo = shr64_lo;\n }\n}), require_common = __commonJS({\n \"node_modules/hash.js/lib/hash/common.js\"(exports) {\n var utils = require_utils4(), assert = require_minimalistic_assert();\n function BlockHash() {\n this.pending = null, this.pendingTotal = 0, this.blockSize = this.constructor.blockSize, this.outSize = this.constructor.outSize, this.hmacStrength = this.constructor.hmacStrength, this.padLength = this.constructor.padLength / 8, this.endian = \"big\", this._delta8 = this.blockSize / 8, this._delta32 = this.blockSize / 32;\n }\n BlockHash.prototype = {}, exports.BlockHash = BlockHash, BlockHash.prototype.update = function(msg, enc) {\n if (msg = utils.toArray(msg, enc), this.pending \? this.pending = this.pending.concat(msg) : this.pending = msg, this.pendingTotal += msg.length, this.pending.length >= this._delta8) {\n msg = this.pending;\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length), this.pending.length === 0 && (this.pending = null), msg = utils.join32(msg, 0, msg.length - r, this.endian);\n for (var i = 0;i < msg.length; i += this._delta32)\n this._update(msg, i, i + this._delta32);\n }\n return this;\n }, BlockHash.prototype.digest = function(enc) {\n return this.update(this._pad()), assert(this.pending === null), this._digest(enc);\n }, BlockHash.prototype._pad = function() {\n var len = this.pendingTotal, bytes = this._delta8, k = bytes - (len + this.padLength) % bytes, res = new @Array(k + this.padLength);\n res[0] = 128;\n for (var i = 1;i < k; i++)\n res[i] = 0;\n if (len <<= 3, this.endian === \"big\") {\n for (var t = 8;t < this.padLength; t++)\n res[i++] = 0;\n res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = len >>> 24 & 255, res[i++] = len >>> 16 & 255, res[i++] = len >>> 8 & 255, res[i++] = len & 255;\n } else\n for (res[i++] = len & 255, res[i++] = len >>> 8 & 255, res[i++] = len >>> 16 & 255, res[i++] = len >>> 24 & 255, res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = 0, t = 8;t < this.padLength; t++)\n res[i++] = 0;\n return res;\n };\n }\n}), require_common2 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/common.js\"(exports) {\n var utils = require_utils4(), rotr32 = utils.rotr32;\n function ft_1(s, x, y, z) {\n if (s === 0)\n return ch32(x, y, z);\n if (s === 1 || s === 3)\n return p32(x, y, z);\n if (s === 2)\n return maj32(x, y, z);\n }\n exports.ft_1 = ft_1;\n function ch32(x, y, z) {\n return x & y ^ ~x & z;\n }\n exports.ch32 = ch32;\n function maj32(x, y, z) {\n return x & y ^ x & z ^ y & z;\n }\n exports.maj32 = maj32;\n function p32(x, y, z) {\n return x ^ y ^ z;\n }\n exports.p32 = p32;\n function s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n }\n exports.s0_256 = s0_256;\n function s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n }\n exports.s1_256 = s1_256;\n function g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ x >>> 3;\n }\n exports.g0_256 = g0_256;\n function g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ x >>> 10;\n }\n exports.g1_256 = g1_256;\n }\n}), require__ = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/1.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), shaCommon = require_common2(), rotl32 = utils.rotl32, sum32 = utils.sum32, sum32_5 = utils.sum32_5, ft_1 = shaCommon.ft_1, BlockHash = common.BlockHash, sha1_K = [1518500249, 1859775393, 2400959708, 3395469782];\n function SHA1() {\n if (!(this instanceof SHA1))\n return new SHA1;\n BlockHash.@call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.W = new @Array(80);\n }\n utils.inherits(SHA1, BlockHash), module.exports = SHA1, SHA1.blockSize = 512, SHA1.outSize = 160, SHA1.hmacStrength = 80, SHA1.padLength = 64, SHA1.prototype._update = function(msg, start) {\n for (var W = this.W, i = 0;i < 16; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i++)\n W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n var a = this.h[0], b = this.h[1], c = this.h[2], d = this.h[3], e = this.h[4];\n for (i = 0;i < W.length; i++) {\n var s = ~~(i / 20), t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n e = d, d = c, c = rotl32(b, 30), b = a, a = t;\n }\n this.h[0] = sum32(this.h[0], a), this.h[1] = sum32(this.h[1], b), this.h[2] = sum32(this.h[2], c), this.h[3] = sum32(this.h[3], d), this.h[4] = sum32(this.h[4], e);\n }, SHA1.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n }\n}), require__2 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/256.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), shaCommon = require_common2(), assert = require_minimalistic_assert(), sum32 = utils.sum32, sum32_4 = utils.sum32_4, sum32_5 = utils.sum32_5, ch32 = shaCommon.ch32, maj32 = shaCommon.maj32, s0_256 = shaCommon.s0_256, s1_256 = shaCommon.s1_256, g0_256 = shaCommon.g0_256, g1_256 = shaCommon.g1_256, BlockHash = common.BlockHash, sha256_K = [\n 1116352408,\n 1899447441,\n 3049323471,\n 3921009573,\n 961987163,\n 1508970993,\n 2453635748,\n 2870763221,\n 3624381080,\n 310598401,\n 607225278,\n 1426881987,\n 1925078388,\n 2162078206,\n 2614888103,\n 3248222580,\n 3835390401,\n 4022224774,\n 264347078,\n 604807628,\n 770255983,\n 1249150122,\n 1555081692,\n 1996064986,\n 2554220882,\n 2821834349,\n 2952996808,\n 3210313671,\n 3336571891,\n 3584528711,\n 113926993,\n 338241895,\n 666307205,\n 773529912,\n 1294757372,\n 1396182291,\n 1695183700,\n 1986661051,\n 2177026350,\n 2456956037,\n 2730485921,\n 2820302411,\n 3259730800,\n 3345764771,\n 3516065817,\n 3600352804,\n 4094571909,\n 275423344,\n 430227734,\n 506948616,\n 659060556,\n 883997877,\n 958139571,\n 1322822218,\n 1537002063,\n 1747873779,\n 1955562222,\n 2024104815,\n 2227730452,\n 2361852424,\n 2428436474,\n 2756734187,\n 3204031479,\n 3329325298\n ];\n function SHA256() {\n if (!(this instanceof SHA256))\n return new SHA256;\n BlockHash.@call(this), this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], this.k = sha256_K, this.W = new @Array(64);\n }\n utils.inherits(SHA256, BlockHash), module.exports = SHA256, SHA256.blockSize = 512, SHA256.outSize = 256, SHA256.hmacStrength = 192, SHA256.padLength = 64, SHA256.prototype._update = function(msg, start) {\n for (var W = this.W, i = 0;i < 16; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i++)\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n var a = this.h[0], b = this.h[1], c = this.h[2], d = this.h[3], e = this.h[4], f = this.h[5], g = this.h[6], h = this.h[7];\n for (assert(this.k.length === W.length), i = 0;i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]), T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g, g = f, f = e, e = sum32(d, T1), d = c, c = b, b = a, a = sum32(T1, T2);\n }\n this.h[0] = sum32(this.h[0], a), this.h[1] = sum32(this.h[1], b), this.h[2] = sum32(this.h[2], c), this.h[3] = sum32(this.h[3], d), this.h[4] = sum32(this.h[4], e), this.h[5] = sum32(this.h[5], f), this.h[6] = sum32(this.h[6], g), this.h[7] = sum32(this.h[7], h);\n }, SHA256.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n }\n}), require__3 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/224.js\"(exports, module) {\n var utils = require_utils4(), SHA256 = require__2();\n function SHA224() {\n if (!(this instanceof SHA224))\n return new SHA224;\n SHA256.@call(this), this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428];\n }\n utils.inherits(SHA224, SHA256), module.exports = SHA224, SHA224.blockSize = 512, SHA224.outSize = 224, SHA224.hmacStrength = 192, SHA224.padLength = 64, SHA224.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h.slice(0, 7), \"big\") : utils.split32(this.h.slice(0, 7), \"big\");\n };\n }\n}), require__4 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/512.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), assert = require_minimalistic_assert(), rotr64_hi = utils.rotr64_hi, rotr64_lo = utils.rotr64_lo, shr64_hi = utils.shr64_hi, shr64_lo = utils.shr64_lo, sum64 = utils.sum64, sum64_hi = utils.sum64_hi, sum64_lo = utils.sum64_lo, sum64_4_hi = utils.sum64_4_hi, sum64_4_lo = utils.sum64_4_lo, sum64_5_hi = utils.sum64_5_hi, sum64_5_lo = utils.sum64_5_lo, BlockHash = common.BlockHash, sha512_K = [\n 1116352408,\n 3609767458,\n 1899447441,\n 602891725,\n 3049323471,\n 3964484399,\n 3921009573,\n 2173295548,\n 961987163,\n 4081628472,\n 1508970993,\n 3053834265,\n 2453635748,\n 2937671579,\n 2870763221,\n 3664609560,\n 3624381080,\n 2734883394,\n 310598401,\n 1164996542,\n 607225278,\n 1323610764,\n 1426881987,\n 3590304994,\n 1925078388,\n 4068182383,\n 2162078206,\n 991336113,\n 2614888103,\n 633803317,\n 3248222580,\n 3479774868,\n 3835390401,\n 2666613458,\n 4022224774,\n 944711139,\n 264347078,\n 2341262773,\n 604807628,\n 2007800933,\n 770255983,\n 1495990901,\n 1249150122,\n 1856431235,\n 1555081692,\n 3175218132,\n 1996064986,\n 2198950837,\n 2554220882,\n 3999719339,\n 2821834349,\n 766784016,\n 2952996808,\n 2566594879,\n 3210313671,\n 3203337956,\n 3336571891,\n 1034457026,\n 3584528711,\n 2466948901,\n 113926993,\n 3758326383,\n 338241895,\n 168717936,\n 666307205,\n 1188179964,\n 773529912,\n 1546045734,\n 1294757372,\n 1522805485,\n 1396182291,\n 2643833823,\n 1695183700,\n 2343527390,\n 1986661051,\n 1014477480,\n 2177026350,\n 1206759142,\n 2456956037,\n 344077627,\n 2730485921,\n 1290863460,\n 2820302411,\n 3158454273,\n 3259730800,\n 3505952657,\n 3345764771,\n 106217008,\n 3516065817,\n 3606008344,\n 3600352804,\n 1432725776,\n 4094571909,\n 1467031594,\n 275423344,\n 851169720,\n 430227734,\n 3100823752,\n 506948616,\n 1363258195,\n 659060556,\n 3750685593,\n 883997877,\n 3785050280,\n 958139571,\n 3318307427,\n 1322822218,\n 3812723403,\n 1537002063,\n 2003034995,\n 1747873779,\n 3602036899,\n 1955562222,\n 1575990012,\n 2024104815,\n 1125592928,\n 2227730452,\n 2716904306,\n 2361852424,\n 442776044,\n 2428436474,\n 593698344,\n 2756734187,\n 3733110249,\n 3204031479,\n 2999351573,\n 3329325298,\n 3815920427,\n 3391569614,\n 3928383900,\n 3515267271,\n 566280711,\n 3940187606,\n 3454069534,\n 4118630271,\n 4000239992,\n 116418474,\n 1914138554,\n 174292421,\n 2731055270,\n 289380356,\n 3203993006,\n 460393269,\n 320620315,\n 685471733,\n 587496836,\n 852142971,\n 1086792851,\n 1017036298,\n 365543100,\n 1126000580,\n 2618297676,\n 1288033470,\n 3409855158,\n 1501505948,\n 4234509866,\n 1607167915,\n 987167468,\n 1816402316,\n 1246189591\n ];\n function SHA512() {\n if (!(this instanceof SHA512))\n return new SHA512;\n BlockHash.@call(this), this.h = [\n 1779033703,\n 4089235720,\n 3144134277,\n 2227873595,\n 1013904242,\n 4271175723,\n 2773480762,\n 1595750129,\n 1359893119,\n 2917565137,\n 2600822924,\n 725511199,\n 528734635,\n 4215389547,\n 1541459225,\n 327033209\n ], this.k = sha512_K, this.W = new @Array(160);\n }\n utils.inherits(SHA512, BlockHash), module.exports = SHA512, SHA512.blockSize = 1024, SHA512.outSize = 512, SHA512.hmacStrength = 192, SHA512.padLength = 128, SHA512.prototype._prepareBlock = function(msg, start) {\n for (var W = this.W, i = 0;i < 32; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i += 2) {\n var c0_hi = g1_512_hi(W[i - 4], W[i - 3]), c0_lo = g1_512_lo(W[i - 4], W[i - 3]), c1_hi = W[i - 14], c1_lo = W[i - 13], c2_hi = g0_512_hi(W[i - 30], W[i - 29]), c2_lo = g0_512_lo(W[i - 30], W[i - 29]), c3_hi = W[i - 32], c3_lo = W[i - 31];\n W[i] = sum64_4_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo), W[i + 1] = sum64_4_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo);\n }\n }, SHA512.prototype._update = function(msg, start) {\n this._prepareBlock(msg, start);\n var W = this.W, ah = this.h[0], al = this.h[1], bh = this.h[2], bl = this.h[3], ch = this.h[4], cl = this.h[5], dh = this.h[6], dl = this.h[7], eh = this.h[8], el = this.h[9], fh = this.h[10], fl = this.h[11], gh = this.h[12], gl = this.h[13], hh = this.h[14], hl = this.h[15];\n assert(this.k.length === W.length);\n for (var i = 0;i < W.length; i += 2) {\n var c0_hi = hh, c0_lo = hl, c1_hi = s1_512_hi(eh, el), c1_lo = s1_512_lo(eh, el), c2_hi = ch64_hi(eh, el, fh, fl, gh, gl), c2_lo = ch64_lo(eh, el, fh, fl, gh, gl), c3_hi = this.k[i], c3_lo = this.k[i + 1], c4_hi = W[i], c4_lo = W[i + 1], T1_hi = sum64_5_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo), T1_lo = sum64_5_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo);\n c0_hi = s0_512_hi(ah, al), c0_lo = s0_512_lo(ah, al), c1_hi = maj64_hi(ah, al, bh, bl, ch, cl), c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo), T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n hh = gh, hl = gl, gh = fh, gl = fl, fh = eh, fl = el, eh = sum64_hi(dh, dl, T1_hi, T1_lo), el = sum64_lo(dl, dl, T1_hi, T1_lo), dh = ch, dl = cl, ch = bh, cl = bl, bh = ah, bl = al, ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo), al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n }\n sum64(this.h, 0, ah, al), sum64(this.h, 2, bh, bl), sum64(this.h, 4, ch, cl), sum64(this.h, 6, dh, dl), sum64(this.h, 8, eh, el), sum64(this.h, 10, fh, fl), sum64(this.h, 12, gh, gl), sum64(this.h, 14, hh, hl);\n }, SHA512.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n function ch64_hi(xh, xl, yh, yl, zh) {\n var r = xh & yh ^ ~xh & zh;\n return r < 0 && (r += 4294967296), r;\n }\n function ch64_lo(xh, xl, yh, yl, zh, zl) {\n var r = xl & yl ^ ~xl & zl;\n return r < 0 && (r += 4294967296), r;\n }\n function maj64_hi(xh, xl, yh, yl, zh) {\n var r = xh & yh ^ xh & zh ^ yh & zh;\n return r < 0 && (r += 4294967296), r;\n }\n function maj64_lo(xh, xl, yh, yl, zh, zl) {\n var r = xl & yl ^ xl & zl ^ yl & zl;\n return r < 0 && (r += 4294967296), r;\n }\n function s0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 28), c1_hi = rotr64_hi(xl, xh, 2), c2_hi = rotr64_hi(xl, xh, 7), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function s0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 28), c1_lo = rotr64_lo(xl, xh, 2), c2_lo = rotr64_lo(xl, xh, 7), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function s1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 14), c1_hi = rotr64_hi(xh, xl, 18), c2_hi = rotr64_hi(xl, xh, 9), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function s1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 14), c1_lo = rotr64_lo(xh, xl, 18), c2_lo = rotr64_lo(xl, xh, 9), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function g0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 1), c1_hi = rotr64_hi(xh, xl, 8), c2_hi = shr64_hi(xh, xl, 7), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function g0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 1), c1_lo = rotr64_lo(xh, xl, 8), c2_lo = shr64_lo(xh, xl, 7), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function g1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 19), c1_hi = rotr64_hi(xl, xh, 29), c2_hi = shr64_hi(xh, xl, 6), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function g1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 19), c1_lo = rotr64_lo(xl, xh, 29), c2_lo = shr64_lo(xh, xl, 6), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n }\n}), require__5 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/384.js\"(exports, module) {\n var utils = require_utils4(), SHA512 = require__4();\n function SHA384() {\n if (!(this instanceof SHA384))\n return new SHA384;\n SHA512.@call(this), this.h = [\n 3418070365,\n 3238371032,\n 1654270250,\n 914150663,\n 2438529370,\n 812702999,\n 355462360,\n 4144912697,\n 1731405415,\n 4290775857,\n 2394180231,\n 1750603025,\n 3675008525,\n 1694076839,\n 1203062813,\n 3204075428\n ];\n }\n utils.inherits(SHA384, SHA512), module.exports = SHA384, SHA384.blockSize = 1024, SHA384.outSize = 384, SHA384.hmacStrength = 192, SHA384.padLength = 128, SHA384.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h.slice(0, 12), \"big\") : utils.split32(this.h.slice(0, 12), \"big\");\n };\n }\n}), require_sha3 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha.js\"(exports) {\n exports.sha1 = require__(), exports.sha224 = require__3(), exports.sha256 = require__2(), exports.sha384 = require__5(), exports.sha512 = require__4();\n }\n}), require_ripemd = __commonJS({\n \"node_modules/hash.js/lib/hash/ripemd.js\"(exports) {\n var utils = require_utils4(), common = require_common(), rotl32 = utils.rotl32, sum32 = utils.sum32, sum32_3 = utils.sum32_3, sum32_4 = utils.sum32_4, BlockHash = common.BlockHash;\n function RIPEMD160() {\n if (!(this instanceof RIPEMD160))\n return new RIPEMD160;\n BlockHash.@call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = \"little\";\n }\n utils.inherits(RIPEMD160, BlockHash), exports.ripemd160 = RIPEMD160, RIPEMD160.blockSize = 512, RIPEMD160.outSize = 160, RIPEMD160.hmacStrength = 192, RIPEMD160.padLength = 64, RIPEMD160.prototype._update = function(msg, start) {\n for (var A = this.h[0], B = this.h[1], C = this.h[2], D = this.h[3], E = this.h[4], Ah = A, Bh = B, Ch = C, Dh = D, Eh = E, j = 0;j < 80; j++) {\n var T = sum32(rotl32(sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), s[j]), E);\n A = E, E = D, D = rotl32(C, 10), C = B, B = T, T = sum32(rotl32(sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), sh[j]), Eh), Ah = Eh, Eh = Dh, Dh = rotl32(Ch, 10), Ch = Bh, Bh = T;\n }\n T = sum32_3(this.h[1], C, Dh), this.h[1] = sum32_3(this.h[2], D, Eh), this.h[2] = sum32_3(this.h[3], E, Ah), this.h[3] = sum32_3(this.h[4], A, Bh), this.h[4] = sum32_3(this.h[0], B, Ch), this.h[0] = T;\n }, RIPEMD160.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"little\") : utils.split32(this.h, \"little\");\n };\n function f(j, x, y, z) {\n return j <= 15 \? x ^ y ^ z : j <= 31 \? x & y | ~x & z : j <= 47 \? (x | ~y) ^ z : j <= 63 \? x & z | y & ~z : x ^ (y | ~z);\n }\n function K(j) {\n return j <= 15 \? 0 : j <= 31 \? 1518500249 : j <= 47 \? 1859775393 : j <= 63 \? 2400959708 : 2840853838;\n }\n function Kh(j) {\n return j <= 15 \? 1352829926 : j <= 31 \? 1548603684 : j <= 47 \? 1836072691 : j <= 63 \? 2053994217 : 0;\n }\n var r = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 7,\n 4,\n 13,\n 1,\n 10,\n 6,\n 15,\n 3,\n 12,\n 0,\n 9,\n 5,\n 2,\n 14,\n 11,\n 8,\n 3,\n 10,\n 14,\n 4,\n 9,\n 15,\n 8,\n 1,\n 2,\n 7,\n 0,\n 6,\n 13,\n 11,\n 5,\n 12,\n 1,\n 9,\n 11,\n 10,\n 0,\n 8,\n 12,\n 4,\n 13,\n 3,\n 7,\n 15,\n 14,\n 5,\n 6,\n 2,\n 4,\n 0,\n 5,\n 9,\n 7,\n 12,\n 2,\n 10,\n 14,\n 1,\n 3,\n 8,\n 11,\n 6,\n 15,\n 13\n ], rh = [\n 5,\n 14,\n 7,\n 0,\n 9,\n 2,\n 11,\n 4,\n 13,\n 6,\n 15,\n 8,\n 1,\n 10,\n 3,\n 12,\n 6,\n 11,\n 3,\n 7,\n 0,\n 13,\n 5,\n 10,\n 14,\n 15,\n 8,\n 12,\n 4,\n 9,\n 1,\n 2,\n 15,\n 5,\n 1,\n 3,\n 7,\n 14,\n 6,\n 9,\n 11,\n 8,\n 12,\n 2,\n 10,\n 0,\n 4,\n 13,\n 8,\n 6,\n 4,\n 1,\n 3,\n 11,\n 15,\n 0,\n 5,\n 12,\n 2,\n 13,\n 9,\n 7,\n 10,\n 14,\n 12,\n 15,\n 10,\n 4,\n 1,\n 5,\n 8,\n 7,\n 6,\n 2,\n 13,\n 14,\n 0,\n 3,\n 9,\n 11\n ], s = [\n 11,\n 14,\n 15,\n 12,\n 5,\n 8,\n 7,\n 9,\n 11,\n 13,\n 14,\n 15,\n 6,\n 7,\n 9,\n 8,\n 7,\n 6,\n 8,\n 13,\n 11,\n 9,\n 7,\n 15,\n 7,\n 12,\n 15,\n 9,\n 11,\n 7,\n 13,\n 12,\n 11,\n 13,\n 6,\n 7,\n 14,\n 9,\n 13,\n 15,\n 14,\n 8,\n 13,\n 6,\n 5,\n 12,\n 7,\n 5,\n 11,\n 12,\n 14,\n 15,\n 14,\n 15,\n 9,\n 8,\n 9,\n 14,\n 5,\n 6,\n 8,\n 6,\n 5,\n 12,\n 9,\n 15,\n 5,\n 11,\n 6,\n 8,\n 13,\n 12,\n 5,\n 12,\n 13,\n 14,\n 11,\n 8,\n 5,\n 6\n ], sh = [\n 8,\n 9,\n 9,\n 11,\n 13,\n 15,\n 15,\n 5,\n 7,\n 7,\n 8,\n 11,\n 14,\n 14,\n 12,\n 6,\n 9,\n 13,\n 15,\n 7,\n 12,\n 8,\n 9,\n 11,\n 7,\n 7,\n 12,\n 7,\n 6,\n 15,\n 13,\n 11,\n 9,\n 7,\n 15,\n 11,\n 8,\n 6,\n 6,\n 14,\n 12,\n 13,\n 5,\n 14,\n 13,\n 13,\n 7,\n 5,\n 15,\n 5,\n 8,\n 11,\n 14,\n 14,\n 6,\n 14,\n 6,\n 9,\n 12,\n 9,\n 12,\n 5,\n 15,\n 8,\n 8,\n 5,\n 12,\n 9,\n 12,\n 5,\n 14,\n 6,\n 8,\n 13,\n 6,\n 5,\n 15,\n 13,\n 11,\n 11\n ];\n }\n}), require_hmac = __commonJS({\n \"node_modules/hash.js/lib/hash/hmac.js\"(exports, module) {\n var utils = require_utils4(), assert = require_minimalistic_assert();\n function Hmac(hash, key2, enc) {\n if (key2 = exportIfKeyObject(key2), !(this instanceof Hmac))\n return new Hmac(hash, key2, enc);\n this.Hash = hash, this.blockSize = hash.blockSize / 8, this.outSize = hash.outSize / 8, this.inner = null, this.outer = null, this._init(utils.toArray(key2, enc));\n }\n Hmac.prototype = {}, module.exports = Hmac, Hmac.prototype._init = function(key2) {\n key2.length > this.blockSize && (key2 = new this.Hash().update(key2).digest()), assert(key2.length <= this.blockSize);\n for (var i = key2.length;i < this.blockSize; i++)\n key2.push(0);\n for (i = 0;i < key2.length; i++)\n key2[i] ^= 54;\n for (this.inner = new this.Hash().update(key2), i = 0;i < key2.length; i++)\n key2[i] ^= 106;\n this.outer = new this.Hash().update(key2);\n }, Hmac.prototype.update = function(msg, enc) {\n return this.inner.update(msg, enc), this;\n }, Hmac.prototype.digest = function(enc) {\n return this.outer.update(this.inner.digest()), this.outer.digest(enc);\n };\n }\n}), require_hash2 = __commonJS({\n \"node_modules/hash.js/lib/hash.js\"(exports) {\n var hash = exports;\n hash.utils = require_utils4(), hash.common = require_common(), hash.sha = require_sha3(), hash.ripemd = require_ripemd(), hash.hmac = require_hmac(), hash.sha1 = hash.sha.sha1, hash.sha256 = hash.sha.sha256, hash.sha224 = hash.sha.sha224, hash.sha384 = hash.sha.sha384, hash.sha512 = hash.sha.sha512, hash.ripemd160 = hash.ripemd.ripemd160;\n }\n}), require_secp256k1 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js\"(exports, module) {\n module.exports = {\n doubles: {\n step: 4,\n points: [\n [\n \"e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a\",\n \"f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821\"\n ],\n [\n \"8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508\",\n \"11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf\"\n ],\n [\n \"175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739\",\n \"d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695\"\n ],\n [\n \"363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640\",\n \"4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9\"\n ],\n [\n \"8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c\",\n \"4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36\"\n ],\n [\n \"723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda\",\n \"96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f\"\n ],\n [\n \"eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa\",\n \"5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999\"\n ],\n [\n \"100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0\",\n \"cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09\"\n ],\n [\n \"e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d\",\n \"9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d\"\n ],\n [\n \"feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d\",\n \"e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088\"\n ],\n [\n \"da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1\",\n \"9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d\"\n ],\n [\n \"53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0\",\n \"5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8\"\n ],\n [\n \"8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047\",\n \"10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a\"\n ],\n [\n \"385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862\",\n \"283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453\"\n ],\n [\n \"6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7\",\n \"7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160\"\n ],\n [\n \"3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd\",\n \"56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0\"\n ],\n [\n \"85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83\",\n \"7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6\"\n ],\n [\n \"948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a\",\n \"53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589\"\n ],\n [\n \"6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8\",\n \"bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17\"\n ],\n [\n \"e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d\",\n \"4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda\"\n ],\n [\n \"e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725\",\n \"7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd\"\n ],\n [\n \"213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754\",\n \"4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2\"\n ],\n [\n \"4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c\",\n \"17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6\"\n ],\n [\n \"fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6\",\n \"6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f\"\n ],\n [\n \"76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39\",\n \"c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01\"\n ],\n [\n \"c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891\",\n \"893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3\"\n ],\n [\n \"d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b\",\n \"febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f\"\n ],\n [\n \"b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03\",\n \"2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7\"\n ],\n [\n \"e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d\",\n \"eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78\"\n ],\n [\n \"a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070\",\n \"7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1\"\n ],\n [\n \"90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4\",\n \"e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150\"\n ],\n [\n \"8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da\",\n \"662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82\"\n ],\n [\n \"e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11\",\n \"1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc\"\n ],\n [\n \"8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e\",\n \"efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b\"\n ],\n [\n \"e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41\",\n \"2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51\"\n ],\n [\n \"b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef\",\n \"67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45\"\n ],\n [\n \"d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8\",\n \"db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120\"\n ],\n [\n \"324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d\",\n \"648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84\"\n ],\n [\n \"4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96\",\n \"35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d\"\n ],\n [\n \"9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd\",\n \"ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d\"\n ],\n [\n \"6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5\",\n \"9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8\"\n ],\n [\n \"a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266\",\n \"40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8\"\n ],\n [\n \"7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71\",\n \"34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac\"\n ],\n [\n \"928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac\",\n \"c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f\"\n ],\n [\n \"85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751\",\n \"1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962\"\n ],\n [\n \"ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e\",\n \"493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907\"\n ],\n [\n \"827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241\",\n \"c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec\"\n ],\n [\n \"eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3\",\n \"be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d\"\n ],\n [\n \"e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f\",\n \"4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414\"\n ],\n [\n \"1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19\",\n \"aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd\"\n ],\n [\n \"146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be\",\n \"b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0\"\n ],\n [\n \"fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9\",\n \"6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811\"\n ],\n [\n \"da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2\",\n \"8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1\"\n ],\n [\n \"a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13\",\n \"7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c\"\n ],\n [\n \"174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c\",\n \"ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73\"\n ],\n [\n \"959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba\",\n \"2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd\"\n ],\n [\n \"d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151\",\n \"e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405\"\n ],\n [\n \"64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073\",\n \"d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589\"\n ],\n [\n \"8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458\",\n \"38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e\"\n ],\n [\n \"13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b\",\n \"69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27\"\n ],\n [\n \"bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366\",\n \"d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1\"\n ],\n [\n \"8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa\",\n \"40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482\"\n ],\n [\n \"8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0\",\n \"620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945\"\n ],\n [\n \"dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787\",\n \"7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573\"\n ],\n [\n \"f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e\",\n \"ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82\"\n ]\n ]\n },\n naf: {\n wnd: 7,\n points: [\n [\n \"f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9\",\n \"388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672\"\n ],\n [\n \"2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4\",\n \"d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6\"\n ],\n [\n \"5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc\",\n \"6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da\"\n ],\n [\n \"acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe\",\n \"cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37\"\n ],\n [\n \"774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb\",\n \"d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b\"\n ],\n [\n \"f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8\",\n \"ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81\"\n ],\n [\n \"d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e\",\n \"581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58\"\n ],\n [\n \"defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34\",\n \"4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77\"\n ],\n [\n \"2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c\",\n \"85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a\"\n ],\n [\n \"352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5\",\n \"321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c\"\n ],\n [\n \"2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f\",\n \"2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67\"\n ],\n [\n \"9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714\",\n \"73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402\"\n ],\n [\n \"daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729\",\n \"a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55\"\n ],\n [\n \"c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db\",\n \"2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482\"\n ],\n [\n \"6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4\",\n \"e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82\"\n ],\n [\n \"1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5\",\n \"b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396\"\n ],\n [\n \"605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479\",\n \"2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49\"\n ],\n [\n \"62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d\",\n \"80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf\"\n ],\n [\n \"80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f\",\n \"1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a\"\n ],\n [\n \"7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb\",\n \"d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7\"\n ],\n [\n \"d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9\",\n \"eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933\"\n ],\n [\n \"49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963\",\n \"758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a\"\n ],\n [\n \"77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74\",\n \"958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6\"\n ],\n [\n \"f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530\",\n \"e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37\"\n ],\n [\n \"463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b\",\n \"5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e\"\n ],\n [\n \"f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247\",\n \"cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6\"\n ],\n [\n \"caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1\",\n \"cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476\"\n ],\n [\n \"2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120\",\n \"4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40\"\n ],\n [\n \"7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435\",\n \"91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61\"\n ],\n [\n \"754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18\",\n \"673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683\"\n ],\n [\n \"e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8\",\n \"59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5\"\n ],\n [\n \"186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb\",\n \"3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b\"\n ],\n [\n \"df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f\",\n \"55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417\"\n ],\n [\n \"5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143\",\n \"efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868\"\n ],\n [\n \"290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba\",\n \"e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a\"\n ],\n [\n \"af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45\",\n \"f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6\"\n ],\n [\n \"766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a\",\n \"744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996\"\n ],\n [\n \"59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e\",\n \"c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e\"\n ],\n [\n \"f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8\",\n \"e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d\"\n ],\n [\n \"7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c\",\n \"30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2\"\n ],\n [\n \"948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519\",\n \"e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e\"\n ],\n [\n \"7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab\",\n \"100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437\"\n ],\n [\n \"3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca\",\n \"ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311\"\n ],\n [\n \"d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf\",\n \"8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4\"\n ],\n [\n \"1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610\",\n \"68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575\"\n ],\n [\n \"733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4\",\n \"f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d\"\n ],\n [\n \"15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c\",\n \"d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d\"\n ],\n [\n \"a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940\",\n \"edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629\"\n ],\n [\n \"e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980\",\n \"a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06\"\n ],\n [\n \"311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3\",\n \"66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374\"\n ],\n [\n \"34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf\",\n \"9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee\"\n ],\n [\n \"f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63\",\n \"4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1\"\n ],\n [\n \"d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448\",\n \"fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b\"\n ],\n [\n \"32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf\",\n \"5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661\"\n ],\n [\n \"7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5\",\n \"8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6\"\n ],\n [\n \"ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6\",\n \"8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e\"\n ],\n [\n \"16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5\",\n \"5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d\"\n ],\n [\n \"eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99\",\n \"f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc\"\n ],\n [\n \"78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51\",\n \"f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4\"\n ],\n [\n \"494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5\",\n \"42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c\"\n ],\n [\n \"a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5\",\n \"204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b\"\n ],\n [\n \"c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997\",\n \"4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913\"\n ],\n [\n \"841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881\",\n \"73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154\"\n ],\n [\n \"5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5\",\n \"39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865\"\n ],\n [\n \"36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66\",\n \"d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc\"\n ],\n [\n \"336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726\",\n \"ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224\"\n ],\n [\n \"8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede\",\n \"6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e\"\n ],\n [\n \"1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94\",\n \"60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6\"\n ],\n [\n \"85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31\",\n \"3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511\"\n ],\n [\n \"29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51\",\n \"b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b\"\n ],\n [\n \"a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252\",\n \"ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2\"\n ],\n [\n \"4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5\",\n \"cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c\"\n ],\n [\n \"d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b\",\n \"6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3\"\n ],\n [\n \"ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4\",\n \"322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d\"\n ],\n [\n \"af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f\",\n \"6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700\"\n ],\n [\n \"e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889\",\n \"2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4\"\n ],\n [\n \"591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246\",\n \"b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196\"\n ],\n [\n \"11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984\",\n \"998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4\"\n ],\n [\n \"3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a\",\n \"b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257\"\n ],\n [\n \"cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030\",\n \"bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13\"\n ],\n [\n \"c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197\",\n \"6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096\"\n ],\n [\n \"c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593\",\n \"c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38\"\n ],\n [\n \"a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef\",\n \"21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f\"\n ],\n [\n \"347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38\",\n \"60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448\"\n ],\n [\n \"da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a\",\n \"49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a\"\n ],\n [\n \"c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111\",\n \"5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4\"\n ],\n [\n \"4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502\",\n \"7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437\"\n ],\n [\n \"3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea\",\n \"be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7\"\n ],\n [\n \"cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26\",\n \"8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d\"\n ],\n [\n \"b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986\",\n \"39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a\"\n ],\n [\n \"d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e\",\n \"62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54\"\n ],\n [\n \"48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4\",\n \"25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77\"\n ],\n [\n \"dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda\",\n \"ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517\"\n ],\n [\n \"6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859\",\n \"cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10\"\n ],\n [\n \"e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f\",\n \"f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125\"\n ],\n [\n \"eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c\",\n \"6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e\"\n ],\n [\n \"13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942\",\n \"fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1\"\n ],\n [\n \"ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a\",\n \"1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2\"\n ],\n [\n \"b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80\",\n \"5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423\"\n ],\n [\n \"ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d\",\n \"438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8\"\n ],\n [\n \"8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1\",\n \"cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758\"\n ],\n [\n \"52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63\",\n \"c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375\"\n ],\n [\n \"e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352\",\n \"6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d\"\n ],\n [\n \"7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193\",\n \"ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec\"\n ],\n [\n \"5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00\",\n \"9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0\"\n ],\n [\n \"32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58\",\n \"ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c\"\n ],\n [\n \"e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7\",\n \"d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4\"\n ],\n [\n \"8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8\",\n \"c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f\"\n ],\n [\n \"4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e\",\n \"67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649\"\n ],\n [\n \"3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d\",\n \"cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826\"\n ],\n [\n \"674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b\",\n \"299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5\"\n ],\n [\n \"d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f\",\n \"f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87\"\n ],\n [\n \"30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6\",\n \"462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b\"\n ],\n [\n \"be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297\",\n \"62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc\"\n ],\n [\n \"93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a\",\n \"7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c\"\n ],\n [\n \"b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c\",\n \"ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f\"\n ],\n [\n \"d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52\",\n \"4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a\"\n ],\n [\n \"d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb\",\n \"bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46\"\n ],\n [\n \"463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065\",\n \"bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f\"\n ],\n [\n \"7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917\",\n \"603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03\"\n ],\n [\n \"74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9\",\n \"cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08\"\n ],\n [\n \"30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3\",\n \"553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8\"\n ],\n [\n \"9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57\",\n \"712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373\"\n ],\n [\n \"176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66\",\n \"ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3\"\n ],\n [\n \"75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8\",\n \"9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8\"\n ],\n [\n \"809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721\",\n \"9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1\"\n ],\n [\n \"1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180\",\n \"4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9\"\n ]\n ]\n }\n };\n }\n}), require_curves = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curves.js\"(exports) {\n var curves = exports, hash = require_hash2(), curve = require_curve(), utils = require_utils3(), assert = utils.assert;\n function PresetCurve(options) {\n options.type === \"short\" \? this.curve = new curve.short(options) : options.type === \"edwards\" \? this.curve = new curve.edwards(options) : this.curve = new curve.mont(options), this.g = this.curve.g, this.n = this.curve.n, this.hash = options.hash, assert(this.g.validate(), \"Invalid curve\"), assert(this.g.mul(this.n).isInfinity(), \"Invalid curve, G*N != O\");\n }\n PresetCurve.prototype = {}, curves.PresetCurve = PresetCurve;\n function defineCurve(name, options) {\n Object.defineProperty(curves, name, {\n configurable: !0,\n enumerable: !0,\n get: function() {\n var curve2 = new PresetCurve(options);\n return Object.defineProperty(curves, name, {\n configurable: !0,\n enumerable: !0,\n value: curve2\n }), curve2;\n }\n });\n }\n defineCurve(\"p192\", {\n type: \"short\",\n prime: \"p192\",\n p: \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\",\n a: \"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc\",\n b: \"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1\",\n n: \"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012\",\n \"07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811\"\n ]\n }), defineCurve(\"p224\", {\n type: \"short\",\n prime: \"p224\",\n p: \"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\",\n a: \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe\",\n b: \"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4\",\n n: \"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21\",\n \"bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34\"\n ]\n }), defineCurve(\"p256\", {\n type: \"short\",\n prime: null,\n p: \"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff\",\n a: \"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc\",\n b: \"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b\",\n n: \"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296\",\n \"4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5\"\n ]\n }), defineCurve(\"p384\", {\n type: \"short\",\n prime: null,\n p: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff\",\n a: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc\",\n b: \"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef\",\n n: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973\",\n hash: hash.sha384,\n gRed: !1,\n g: [\n \"aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7\",\n \"3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f\"\n ]\n }), defineCurve(\"p521\", {\n type: \"short\",\n prime: null,\n p: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff\",\n a: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc\",\n b: \"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00\",\n n: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409\",\n hash: hash.sha512,\n gRed: !1,\n g: [\n \"000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66\",\n \"00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650\"\n ]\n }), defineCurve(\"curve25519\", {\n type: \"mont\",\n prime: \"p25519\",\n p: \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",\n a: \"76d06\",\n b: \"1\",\n n: \"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",\n hash: hash.sha256,\n gRed: !1,\n g: [\"9\"]\n }), defineCurve(\"ed25519\", {\n type: \"edwards\",\n prime: \"p25519\",\n p: \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",\n a: \"-1\",\n c: \"1\",\n d: \"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3\",\n n: \"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a\",\n \"6666666666666666666666666666666666666666666666666666666666666658\"\n ]\n });\n var pre;\n try {\n pre = require_secp256k1();\n } catch {\n pre = void 0;\n }\n defineCurve(\"secp256k1\", {\n type: \"short\",\n prime: \"k256\",\n p: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\",\n a: \"0\",\n b: \"7\",\n n: \"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141\",\n h: \"1\",\n hash: hash.sha256,\n beta: \"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\",\n lambda: \"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72\",\n basis: [\n {\n a: \"3086d221a7d46bcde86c90e49284eb15\",\n b: \"-e4437ed6010e88286f547fa90abfe4c3\"\n },\n {\n a: \"114ca50f7a8e2f3f657c1108d9d44cfd8\",\n b: \"3086d221a7d46bcde86c90e49284eb15\"\n }\n ],\n gRed: !1,\n g: [\n \"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\",\n \"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n pre\n ]\n });\n }\n}), require_hmac_drbg = __commonJS({\n \"node_modules/hmac-drbg/lib/hmac-drbg.js\"(exports, module) {\n var hash = require_hash2(), utils = require_utils2(), assert = require_minimalistic_assert();\n function HmacDRBG(options) {\n if (!(this instanceof HmacDRBG))\n return new HmacDRBG(options);\n this.hash = options.hash, this.predResist = !!options.predResist, this.outLen = this.hash.outSize, this.minEntropy = options.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null;\n var entropy = utils.toArray(options.entropy, options.entropyEnc || \"hex\"), nonce = utils.toArray(options.nonce, options.nonceEnc || \"hex\"), pers = utils.toArray(options.pers, options.persEnc || \"hex\");\n assert(entropy.length >= this.minEntropy / 8, \"Not enough entropy. Minimum is: \" + this.minEntropy + \" bits\"), this._init(entropy, nonce, pers);\n }\n HmacDRBG.prototype = {}, module.exports = HmacDRBG, HmacDRBG.prototype._init = function(entropy, nonce, pers) {\n var seed = entropy.concat(nonce).concat(pers);\n this.K = new @Array(this.outLen / 8), this.V = new @Array(this.outLen / 8);\n for (var i = 0;i < this.V.length; i++)\n this.K[i] = 0, this.V[i] = 1;\n this._update(seed), this._reseed = 1, this.reseedInterval = 281474976710656;\n }, HmacDRBG.prototype._hmac = function() {\n return new hash.hmac(this.hash, this.K);\n }, HmacDRBG.prototype._update = function(seed) {\n var kmac = this._hmac().update(this.V).update([0]);\n seed && (kmac = kmac.update(seed)), this.K = kmac.digest(), this.V = this._hmac().update(this.V).digest(), seed && (this.K = this._hmac().update(this.V).update([1]).update(seed).digest(), this.V = this._hmac().update(this.V).digest());\n }, HmacDRBG.prototype.reseed = function(entropy, entropyEnc, add, addEnc) {\n typeof entropyEnc != \"string\" && (addEnc = add, add = entropyEnc, entropyEnc = null), entropy = utils.toArray(entropy, entropyEnc), add = utils.toArray(add, addEnc), assert(entropy.length >= this.minEntropy / 8, \"Not enough entropy. Minimum is: \" + this.minEntropy + \" bits\"), this._update(entropy.concat(add || [])), this._reseed = 1;\n }, HmacDRBG.prototype.generate = function(len, enc, add, addEnc) {\n if (this._reseed > this.reseedInterval)\n throw new Error(\"Reseed is required\");\n typeof enc != \"string\" && (addEnc = add, add = enc, enc = null), add && (add = utils.toArray(add, addEnc || \"hex\"), this._update(add));\n for (var temp = [];temp.length < len; )\n this.V = this._hmac().update(this.V).digest(), temp = temp.concat(this.V);\n var res = temp.slice(0, len);\n return this._update(add), this._reseed++, utils.encode(res, enc);\n };\n }\n}), require_key = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/key.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert;\n function KeyPair(ec, options) {\n this.ec = ec, this.priv = null, this.pub = null, options.priv && this._importPrivate(options.priv, options.privEnc), options.pub && this._importPublic(options.pub, options.pubEnc);\n }\n KeyPair.prototype = {}, module.exports = KeyPair, KeyPair.fromPublic = function(ec, pub, enc) {\n return pub instanceof KeyPair \? pub : new KeyPair(ec, {\n pub,\n pubEnc: enc\n });\n }, KeyPair.fromPrivate = function(ec, priv, enc) {\n return priv instanceof KeyPair \? priv : new KeyPair(ec, {\n priv,\n privEnc: enc\n });\n }, KeyPair.prototype.validate = function() {\n var pub = this.getPublic();\n return pub.isInfinity() \? { result: !1, reason: \"Invalid public key\" } : pub.validate() \? pub.mul(this.ec.curve.n).isInfinity() \? { result: !0, reason: null } : { result: !1, reason: \"Public key * N != O\" } : { result: !1, reason: \"Public key is not a point\" };\n }, KeyPair.prototype.getPublic = function(compact, enc) {\n return typeof compact == \"string\" && (enc = compact, compact = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), enc \? this.pub.encode(enc, compact) : this.pub;\n }, KeyPair.prototype.getPrivate = function(enc) {\n return enc === \"hex\" \? this.priv.toString(16, 2) : this.priv;\n }, KeyPair.prototype._importPrivate = function(key2, enc) {\n this.priv = new BN(key2, enc || 16), this.priv = this.priv.umod(this.ec.curve.n);\n }, KeyPair.prototype._importPublic = function(key2, enc) {\n if (key2.x || key2.y) {\n this.ec.curve.type === \"mont\" \? assert(key2.x, \"Need x coordinate\") : (this.ec.curve.type === \"short\" || this.ec.curve.type === \"edwards\") && assert(key2.x && key2.y, \"Need both x and y coordinate\"), this.pub = this.ec.curve.point(key2.x, key2.y);\n return;\n }\n this.pub = this.ec.curve.decodePoint(key2, enc);\n }, KeyPair.prototype.derive = function(pub) {\n return pub.validate() || assert(pub.validate(), \"public point not validated\"), pub.mul(this.priv).getX();\n }, KeyPair.prototype.sign = function(msg, enc, options) {\n return this.ec.sign(msg, this, enc, options);\n }, KeyPair.prototype.verify = function(msg, signature) {\n return this.ec.verify(msg, signature, this);\n }, KeyPair.prototype.inspect = function() {\n return \"<Key priv: \" + (this.priv && this.priv.toString(16, 2)) + \" pub: \" + (this.pub && this.pub.inspect()) + \" >\";\n };\n }\n}), require_signature = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/signature.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert;\n function Signature(options, enc) {\n if (options instanceof Signature)\n return options;\n this._importDER(options, enc) || (assert(options.r && options.s, \"Signature without r or s\"), this.r = new BN(options.r, 16), this.s = new BN(options.s, 16), options.recoveryParam === void 0 \? this.recoveryParam = null : this.recoveryParam = options.recoveryParam);\n }\n Signature.prototype = {}, module.exports = Signature;\n function Position() {\n this.place = 0;\n }\n function getLength(buf, p) {\n var initial = buf[p.place++];\n if (!(initial & 128))\n return initial;\n var octetLen = initial & 15;\n if (octetLen === 0 || octetLen > 4)\n return !1;\n for (var val = 0, i = 0, off = p.place;i < octetLen; i++, off++)\n val <<= 8, val |= buf[off], val >>>= 0;\n return val <= 127 \? !1 : (p.place = off, val);\n }\n function rmPadding(buf) {\n for (var i = 0, len = buf.length - 1;!buf[i] && !(buf[i + 1] & 128) && i < len; )\n i++;\n return i === 0 \? buf : buf.slice(i);\n }\n Signature.prototype._importDER = function(data, enc) {\n data = utils.toArray(data, enc);\n var p = new Position;\n if (data[p.place++] !== 48)\n return !1;\n var len = getLength(data, p);\n if (len === !1 || len + p.place !== data.length || data[p.place++] !== 2)\n return !1;\n var rlen = getLength(data, p);\n if (rlen === !1)\n return !1;\n var r = data.slice(p.place, rlen + p.place);\n if (p.place += rlen, data[p.place++] !== 2)\n return !1;\n var slen = getLength(data, p);\n if (slen === !1 || data.length !== slen + p.place)\n return !1;\n var s = data.slice(p.place, slen + p.place);\n if (r[0] === 0)\n if (r[1] & 128)\n r = r.slice(1);\n else\n return !1;\n if (s[0] === 0)\n if (s[1] & 128)\n s = s.slice(1);\n else\n return !1;\n return this.r = new BN(r), this.s = new BN(s), this.recoveryParam = null, !0;\n };\n function constructLength(arr, len) {\n if (len < 128) {\n arr.push(len);\n return;\n }\n var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n for (arr.push(octets | 128);--octets; )\n arr.push(len >>> (octets << 3) & 255);\n arr.push(len);\n }\n Signature.prototype.toDER = function(enc) {\n var r = this.r.toArray(), s = this.s.toArray();\n for (r[0] & 128 && (r = [0].concat(r)), s[0] & 128 && (s = [0].concat(s)), r = rmPadding(r), s = rmPadding(s);!s[0] && !(s[1] & 128); )\n s = s.slice(1);\n var arr = [2];\n constructLength(arr, r.length), arr = arr.concat(r), arr.push(2), constructLength(arr, s.length);\n var backHalf = arr.concat(s), res = [48];\n return constructLength(res, backHalf.length), res = res.concat(backHalf), utils.encode(res, enc);\n };\n }\n}), require_ec = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/index.js\"(exports, module) {\n var BN = require_bn4(), HmacDRBG = require_hmac_drbg(), utils = require_utils3(), curves = require_curves(), rand = require_brorand(), assert = utils.assert, KeyPair = require_key(), Signature = require_signature();\n function EC(options) {\n if (!(this instanceof EC))\n return new EC(options);\n typeof options == \"string\" && (assert(Object.prototype.hasOwnProperty.@call(curves, options), \"Unknown curve \" + options), options = curves[options]), options instanceof curves.PresetCurve && (options = { curve: options }), this.curve = options.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = options.curve.g, this.g.precompute(options.curve.n.bitLength() + 1), this.hash = options.hash || options.curve.hash;\n }\n EC.prototype = {}, module.exports = EC, EC.prototype.keyPair = function(options) {\n return new KeyPair(this, options);\n }, EC.prototype.keyFromPrivate = function(priv, enc) {\n return KeyPair.fromPrivate(this, priv, enc);\n }, EC.prototype.keyFromPublic = function(pub, enc) {\n return KeyPair.fromPublic(this, pub, enc);\n }, EC.prototype.genKeyPair = function(options) {\n options || (options = {});\n for (var drbg = new HmacDRBG({\n hash: this.hash,\n pers: options.pers,\n persEnc: options.persEnc || \"utf8\",\n entropy: options.entropy || rand(this.hash.hmacStrength),\n entropyEnc: options.entropy && options.entropyEnc || \"utf8\",\n nonce: this.n.toArray()\n }), bytes = this.n.byteLength(), ns2 = this.n.sub(new BN(2));; ) {\n var priv = new BN(drbg.generate(bytes));\n if (!(priv.cmp(ns2) > 0))\n return priv.iaddn(1), this.keyFromPrivate(priv);\n }\n }, EC.prototype._truncateToN = function(msg, truncOnly) {\n var delta = msg.byteLength() * 8 - this.n.bitLength();\n return delta > 0 && (msg = msg.ushrn(delta)), !truncOnly && msg.cmp(this.n) >= 0 \? msg.sub(this.n) : msg;\n }, EC.prototype.sign = function(msg, key2, enc, options) {\n typeof enc == \"object\" && (options = enc, enc = null), options || (options = {}), key2 = this.keyFromPrivate(key2, enc), msg = this._truncateToN(new BN(msg, 16));\n for (var bytes = this.n.byteLength(), bkey = key2.getPrivate().toArray(\"be\", bytes), nonce = msg.toArray(\"be\", bytes), drbg = new HmacDRBG({\n hash: this.hash,\n entropy: bkey,\n nonce,\n pers: options.pers,\n persEnc: options.persEnc || \"utf8\"\n }), ns1 = this.n.sub(new BN(1)), iter = 0;; iter++) {\n var k = options.k \? options.k(iter) : new BN(drbg.generate(this.n.byteLength()));\n if (k = this._truncateToN(k, !0), !(k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)) {\n var kp = this.g.mul(k);\n if (!kp.isInfinity()) {\n var kpX = kp.getX(), r = kpX.umod(this.n);\n if (r.cmpn(0) !== 0) {\n var s = k.invm(this.n).mul(r.mul(key2.getPrivate()).iadd(msg));\n if (s = s.umod(this.n), s.cmpn(0) !== 0) {\n var recoveryParam = (kp.getY().isOdd() \? 1 : 0) | (kpX.cmp(r) !== 0 \? 2 : 0);\n return options.canonical && s.cmp(this.nh) > 0 && (s = this.n.sub(s), recoveryParam ^= 1), new Signature({ r, s, recoveryParam });\n }\n }\n }\n }\n }\n }, EC.prototype.verify = function(msg, signature, key2, enc) {\n msg = this._truncateToN(new BN(msg, 16)), key2 = this.keyFromPublic(key2, enc), signature = new Signature(signature, \"hex\");\n var { r, s } = signature;\n if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0 || s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n return !1;\n var sinv = s.invm(this.n), u1 = sinv.mul(msg).umod(this.n), u2 = sinv.mul(r).umod(this.n), p;\n return this.curve._maxwellTrick \? (p = this.g.jmulAdd(u1, key2.getPublic(), u2), p.isInfinity() \? !1 : p.eqXToP(r)) : (p = this.g.mulAdd(u1, key2.getPublic(), u2), p.isInfinity() \? !1 : p.getX().umod(this.n).cmp(r) === 0);\n }, EC.prototype.recoverPubKey = function(msg, signature, j, enc) {\n assert((3 & j) === j, \"The recovery param is more than two bits\"), signature = new Signature(signature, enc);\n var n = this.n, e = new BN(msg), r = signature.r, s = signature.s, isYOdd = j & 1, isSecondKey = j >> 1;\n if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n throw new Error(\"Unable to find sencond key candinate\");\n isSecondKey \? r = this.curve.pointFromX(r.add(this.curve.n), isYOdd) : r = this.curve.pointFromX(r, isYOdd);\n var rInv = signature.r.invm(n), s1 = n.sub(e).mul(rInv).umod(n), s2 = s.mul(rInv).umod(n);\n return this.g.mulAdd(s1, r, s2);\n }, EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {\n if (signature = new Signature(signature, enc), signature.recoveryParam !== null)\n return signature.recoveryParam;\n for (var i = 0;i < 4; i++) {\n var Qprime;\n try {\n Qprime = this.recoverPubKey(e, signature, i);\n } catch {\n continue;\n }\n if (Qprime.eq(Q))\n return i;\n }\n throw new Error(\"Unable to find valid recovery factor\");\n };\n }\n}), require_key2 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/key.js\"(exports, module) {\n var utils = require_utils3(), assert = utils.assert, parseBytes = utils.parseBytes, cachedProperty = utils.cachedProperty;\n function KeyPair(eddsa, params) {\n this.eddsa = eddsa, this._secret = parseBytes(params.secret), eddsa.isPoint(params.pub) \? this._pub = params.pub : this._pubBytes = parseBytes(params.pub);\n }\n KeyPair.prototype = {}, KeyPair.fromPublic = function(eddsa, pub) {\n return pub instanceof KeyPair \? pub : new KeyPair(eddsa, { pub });\n }, KeyPair.fromSecret = function(eddsa, secret) {\n return secret instanceof KeyPair \? secret : new KeyPair(eddsa, { secret });\n }, KeyPair.prototype.secret = function() {\n return this._secret;\n }, cachedProperty(KeyPair, \"pubBytes\", function() {\n return this.eddsa.encodePoint(this.pub());\n }), cachedProperty(KeyPair, \"pub\", function() {\n return this._pubBytes \? this.eddsa.decodePoint(this._pubBytes) : this.eddsa.g.mul(this.priv());\n }), cachedProperty(KeyPair, \"privBytes\", function() {\n var eddsa = this.eddsa, hash = this.hash(), lastIx = eddsa.encodingLength - 1, a = hash.slice(0, eddsa.encodingLength);\n return a[0] &= 248, a[lastIx] &= 127, a[lastIx] |= 64, a;\n }), cachedProperty(KeyPair, \"priv\", function() {\n return this.eddsa.decodeInt(this.privBytes());\n }), cachedProperty(KeyPair, \"hash\", function() {\n return this.eddsa.hash().update(this.secret()).digest();\n }), cachedProperty(KeyPair, \"messagePrefix\", function() {\n return this.hash().slice(this.eddsa.encodingLength);\n }), KeyPair.prototype.sign = function(message) {\n return assert(this._secret, \"KeyPair can only verify\"), this.eddsa.sign(message, this);\n }, KeyPair.prototype.verify = function(message, sig) {\n return this.eddsa.verify(message, sig, this);\n }, KeyPair.prototype.getSecret = function(enc) {\n return assert(this._secret, \"KeyPair is public only\"), utils.encode(this.secret(), enc);\n }, KeyPair.prototype.getPublic = function(enc) {\n return utils.encode(this.pubBytes(), enc);\n }, module.exports = KeyPair;\n }\n}), require_signature2 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/signature.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert, cachedProperty = utils.cachedProperty, parseBytes = utils.parseBytes;\n function Signature(eddsa, sig) {\n this.eddsa = eddsa, typeof sig != \"object\" && (sig = parseBytes(sig)), @Array.isArray(sig) && (sig = {\n R: sig.slice(0, eddsa.encodingLength),\n S: sig.slice(eddsa.encodingLength)\n }), assert(sig.R && sig.S, \"Signature without R or S\"), eddsa.isPoint(sig.R) && (this._R = sig.R), sig.S instanceof BN && (this._S = sig.S), this._Rencoded = @Array.isArray(sig.R) \? sig.R : sig.Rencoded, this._Sencoded = @Array.isArray(sig.S) \? sig.S : sig.Sencoded;\n }\n Signature.prototype = {}, cachedProperty(Signature, \"S\", function() {\n return this.eddsa.decodeInt(this.Sencoded());\n }), cachedProperty(Signature, \"R\", function() {\n return this.eddsa.decodePoint(this.Rencoded());\n }), cachedProperty(Signature, \"Rencoded\", function() {\n return this.eddsa.encodePoint(this.R());\n }), cachedProperty(Signature, \"Sencoded\", function() {\n return this.eddsa.encodeInt(this.S());\n }), Signature.prototype.toBytes = function() {\n return this.Rencoded().concat(this.Sencoded());\n }, Signature.prototype.toHex = function() {\n return utils.encode(this.toBytes(), \"hex\").toUpperCase();\n }, module.exports = Signature;\n }\n}), require_eddsa = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/index.js\"(exports, module) {\n var hash = require_hash2(), curves = require_curves(), utils = require_utils3(), assert = utils.assert, parseBytes = utils.parseBytes, KeyPair = require_key2(), Signature = require_signature2();\n function EDDSA(curve) {\n if (assert(curve === \"ed25519\", \"only tested with ed25519 so far\"), !(this instanceof EDDSA))\n return new EDDSA(curve);\n curve = curves[curve].curve, this.curve = curve, this.g = curve.g, this.g.precompute(curve.n.bitLength() + 1), this.pointClass = curve.point().constructor, this.encodingLength = Math.ceil(curve.n.bitLength() / 8), this.hash = hash.sha512;\n }\n EDDSA.prototype = {}, module.exports = EDDSA, EDDSA.prototype.sign = function(message, secret) {\n message = parseBytes(message);\n var key2 = this.keyFromSecret(secret), r = this.hashInt(key2.messagePrefix(), message), R = this.g.mul(r), Rencoded = this.encodePoint(R), s_ = this.hashInt(Rencoded, key2.pubBytes(), message).mul(key2.priv()), S = r.add(s_).umod(this.curve.n);\n return this.makeSignature({ R, S, Rencoded });\n }, EDDSA.prototype.verify = function(message, sig, pub) {\n message = parseBytes(message), sig = this.makeSignature(sig);\n var key2 = this.keyFromPublic(pub), h = this.hashInt(sig.Rencoded(), key2.pubBytes(), message), SG = this.g.mul(sig.S()), RplusAh = sig.R().add(key2.pub().mul(h));\n return RplusAh.eq(SG);\n }, EDDSA.prototype.hashInt = function() {\n for (var hash2 = this.hash(), i = 0;i < arguments.length; i++)\n hash2.update(arguments[i]);\n return utils.intFromLE(hash2.digest()).umod(this.curve.n);\n }, EDDSA.prototype.keyFromPublic = function(pub) {\n return KeyPair.fromPublic(this, pub);\n }, EDDSA.prototype.keyFromSecret = function(secret) {\n return KeyPair.fromSecret(this, secret);\n }, EDDSA.prototype.makeSignature = function(sig) {\n return sig instanceof Signature \? sig : new Signature(this, sig);\n }, EDDSA.prototype.encodePoint = function(point) {\n var enc = point.getY().toArray(\"le\", this.encodingLength);\n return enc[this.encodingLength - 1] |= point.getX().isOdd() \? 128 : 0, enc;\n }, EDDSA.prototype.decodePoint = function(bytes) {\n bytes = utils.parseBytes(bytes);\n var lastIx = bytes.length - 1, normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & -129), xIsOdd = (bytes[lastIx] & 128) !== 0, y = utils.intFromLE(normed);\n return this.curve.pointFromY(y, xIsOdd);\n }, EDDSA.prototype.encodeInt = function(num) {\n return num.toArray(\"le\", this.encodingLength);\n }, EDDSA.prototype.decodeInt = function(bytes) {\n return utils.intFromLE(bytes);\n }, EDDSA.prototype.isPoint = function(val) {\n return val instanceof this.pointClass;\n };\n }\n}), require_elliptic = __commonJS({\n \"node_modules/elliptic/lib/elliptic.js\"(exports) {\n var elliptic = exports;\n elliptic.version = require_package().version, elliptic.utils = require_utils3(), elliptic.rand = require_brorand(), elliptic.curve = require_curve(), elliptic.curves = require_curves(), elliptic.ec = require_ec(), elliptic.eddsa = require_eddsa();\n }\n}), require_bn5 = require_bn, require_safer = __commonJS({\n \"node_modules/safer-buffer/safer.js\"(exports, module) {\n var buffer = BufferModule, Buffer2 = Buffer, safer = {}, key2;\n for (key2 in buffer)\n !buffer.hasOwnProperty(key2) || key2 === \"SlowBuffer\" || key2 === \"Buffer\" || (safer[key2] = buffer[key2]);\n var Safer = safer.Buffer = {};\n for (key2 in Buffer2)\n !Buffer2.hasOwnProperty(key2) || key2 === \"allocUnsafe\" || key2 === \"allocUnsafeSlow\" || (Safer[key2] = Buffer2[key2]);\n if (safer.Buffer.prototype = Buffer2.prototype, (!Safer.from || Safer.from === @Uint8Array.from) && (Safer.from = function(value, encodingOrOffset, length) {\n if (typeof value == \"number\")\n @throwTypeError('The \"value\" argument must not be of type number. Received type ' + typeof value);\n if (value && typeof value.length > \"u\")\n @throwTypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \" + typeof value);\n return Buffer2(value, encodingOrOffset, length);\n }), Safer.alloc || (Safer.alloc = function(size, fill, encoding) {\n if (typeof size != \"number\")\n @throwTypeError('The \"size\" argument must be of type number. Received type ' + typeof size);\n if (size < 0 || size >= 2 * (1 << 30))\n @throwRangeError('The value \"' + size + '\" is invalid for option \"size\"');\n var buf = Buffer2(size);\n return !fill || fill.length === 0 \? buf.fill(0) : typeof encoding == \"string\" \? buf.fill(fill, encoding) : buf.fill(fill), buf;\n }), !safer.kStringMaxLength)\n try {\n safer.kStringMaxLength = MAX_STRING_LENGTH;\n } catch {\n }\n safer.constants || (safer.constants = {\n MAX_LENGTH: safer.kMaxLength\n }, safer.kStringMaxLength && (safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength)), module.exports = safer;\n }\n}), require_reporter = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/reporter.js\"(exports) {\n var inherits = require_inherits_browser();\n function Reporter(options) {\n this._reporterState = {\n obj: null,\n path: [],\n options: options || {},\n errors: []\n };\n }\n Reporter.prototype = {}, exports.Reporter = Reporter, Reporter.prototype.isError = function(obj) {\n return obj instanceof ReporterError;\n }, Reporter.prototype.save = function() {\n let state = this._reporterState;\n return { obj: state.obj, pathLen: state.path.length };\n }, Reporter.prototype.restore = function(data) {\n let state = this._reporterState;\n state.obj = data.obj, state.path = state.path.slice(0, data.pathLen);\n }, Reporter.prototype.enterKey = function(key2) {\n return this._reporterState.path.push(key2);\n }, Reporter.prototype.exitKey = function(index) {\n let state = this._reporterState;\n state.path = state.path.slice(0, index - 1);\n }, Reporter.prototype.leaveKey = function(index, key2, value) {\n let state = this._reporterState;\n this.exitKey(index), state.obj !== null && (state.obj[key2] = value);\n }, Reporter.prototype.path = function() {\n return this._reporterState.path.join(\"/\");\n }, Reporter.prototype.enterObject = function() {\n let state = this._reporterState, prev = state.obj;\n return state.obj = {}, prev;\n }, Reporter.prototype.leaveObject = function(prev) {\n let state = this._reporterState, now = state.obj;\n return state.obj = prev, now;\n }, Reporter.prototype.error = function(msg) {\n let err, state = this._reporterState, inherited = msg instanceof ReporterError;\n if (inherited \? err = msg : err = new ReporterError(state.path.map(function(elem) {\n return \"[\" + JSON.stringify(elem) + \"]\";\n }).join(\"\"), msg.message || msg, msg.stack), !state.options.partial)\n throw err;\n return inherited || state.errors.push(err), err;\n }, Reporter.prototype.wrapResult = function(result) {\n let state = this._reporterState;\n return state.options.partial \? {\n result: this.isError(result) \? null : result,\n errors: state.errors\n } : result;\n };\n function ReporterError(path, msg) {\n this.path = path, this.rethrow(msg);\n }\n inherits(ReporterError, Error), ReporterError.prototype.rethrow = function(msg) {\n if (this.message = msg + \" at: \" + (this.path || \"(shallow)\"), Error.captureStackTrace && Error.captureStackTrace(this, ReporterError), !this.stack)\n try {\n throw new Error(this.message);\n } catch (e) {\n this.stack = e.stack;\n }\n return this;\n };\n }\n}), require_buffer = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/buffer.js\"(exports) {\n var inherits = require_inherits_browser(), Reporter = require_reporter().Reporter, Buffer2 = require_safer().Buffer;\n function DecoderBuffer(base, options) {\n if (Reporter.@call(this, options), !Buffer2.isBuffer(base)) {\n this.error(\"Input not Buffer\");\n return;\n }\n this.base = base, this.offset = 0, this.length = base.length;\n }\n inherits(DecoderBuffer, Reporter), exports.DecoderBuffer = DecoderBuffer, DecoderBuffer.isDecoderBuffer = function(data) {\n return data instanceof DecoderBuffer \? !0 : typeof data == \"object\" && Buffer2.isBuffer(data.base) && data.constructor.name === \"DecoderBuffer\" && typeof data.offset == \"number\" && typeof data.length == \"number\" && typeof data.save == \"function\" && typeof data.restore == \"function\" && typeof data.isEmpty == \"function\" && typeof data.readUInt8 == \"function\" && typeof data.skip == \"function\" && typeof data.raw == \"function\";\n }, DecoderBuffer.prototype.save = function() {\n return {\n offset: this.offset,\n reporter: Reporter.prototype.save.@call(this)\n };\n }, DecoderBuffer.prototype.restore = function(save) {\n let res = new DecoderBuffer(this.base);\n return res.offset = save.offset, res.length = this.offset, this.offset = save.offset, Reporter.prototype.restore.@call(this, save.reporter), res;\n }, DecoderBuffer.prototype.isEmpty = function() {\n return this.offset === this.length;\n }, DecoderBuffer.prototype.readUInt8 = function(fail) {\n return this.offset + 1 <= this.length \? this.base.readUInt8(this.offset++, !0) : this.error(fail || \"DecoderBuffer overrun\");\n }, DecoderBuffer.prototype.skip = function(bytes, fail) {\n if (!(this.offset + bytes <= this.length))\n return this.error(fail || \"DecoderBuffer overrun\");\n let res = new DecoderBuffer(this.base);\n return res._reporterState = this._reporterState, res.offset = this.offset, res.length = this.offset + bytes, this.offset += bytes, res;\n }, DecoderBuffer.prototype.raw = function(save) {\n return this.base.slice(save \? save.offset : this.offset, this.length);\n };\n function EncoderBuffer(value, reporter) {\n if (@Array.isArray(value))\n this.length = 0, this.value = value.map(function(item) {\n return EncoderBuffer.isEncoderBuffer(item) || (item = new EncoderBuffer(item, reporter)), this.length += item.length, item;\n }, this);\n else if (typeof value == \"number\") {\n if (!(0 <= value && value <= 255))\n return reporter.error(\"non-byte EncoderBuffer value\");\n this.value = value, this.length = 1;\n } else if (typeof value == \"string\")\n this.value = value, this.length = Buffer2.byteLength(value);\n else if (Buffer2.isBuffer(value))\n this.value = value, this.length = value.length;\n else\n return reporter.error(\"Unsupported type: \" + typeof value);\n }\n EncoderBuffer.prototype = {}, exports.EncoderBuffer = EncoderBuffer, EncoderBuffer.isEncoderBuffer = function(data) {\n return data instanceof EncoderBuffer \? !0 : typeof data == \"object\" && data.constructor.name === \"EncoderBuffer\" && typeof data.length == \"number\" && typeof data.join == \"function\";\n }, EncoderBuffer.prototype.join = function(out, offset) {\n return out || (out = Buffer2.alloc(this.length)), offset || (offset = 0), this.length === 0 || (@Array.isArray(this.value) \? this.value.forEach(function(item) {\n item.join(out, offset), offset += item.length;\n }) : (typeof this.value == \"number\" \? out[offset] = this.value : typeof this.value == \"string\" \? out.write(this.value, offset) : Buffer2.isBuffer(this.value) && this.value.copy(out, offset), offset += this.length)), out;\n };\n }\n}), require_node = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/node.js\"(exports, module) {\n var Reporter = require_reporter().Reporter, EncoderBuffer = require_buffer().EncoderBuffer, DecoderBuffer = require_buffer().DecoderBuffer, assert = require_minimalistic_assert(), tags = [\n \"seq\",\n \"seqof\",\n \"set\",\n \"setof\",\n \"objid\",\n \"bool\",\n \"gentime\",\n \"utctime\",\n \"null_\",\n \"enum\",\n \"int\",\n \"objDesc\",\n \"bitstr\",\n \"bmpstr\",\n \"charstr\",\n \"genstr\",\n \"graphstr\",\n \"ia5str\",\n \"iso646str\",\n \"numstr\",\n \"octstr\",\n \"printstr\",\n \"t61str\",\n \"unistr\",\n \"utf8str\",\n \"videostr\"\n ], methods = [\"key\", \"obj\", \"use\", \"optional\", \"explicit\", \"implicit\", \"def\", \"choice\", \"any\", \"contains\"].concat(tags), overrided = [\n \"_peekTag\",\n \"_decodeTag\",\n \"_use\",\n \"_decodeStr\",\n \"_decodeObjid\",\n \"_decodeTime\",\n \"_decodeNull\",\n \"_decodeInt\",\n \"_decodeBool\",\n \"_decodeList\",\n \"_encodeComposite\",\n \"_encodeStr\",\n \"_encodeObjid\",\n \"_encodeTime\",\n \"_encodeNull\",\n \"_encodeInt\",\n \"_encodeBool\"\n ];\n function Node(enc, parent, name) {\n let state = {};\n this._baseState = state, state.name = name, state.enc = enc, state.parent = parent || null, state.children = null, state.tag = null, state.args = null, state.reverseArgs = null, state.choice = null, state.optional = !1, state.any = !1, state.obj = !1, state.use = null, state.useDecoder = null, state.key = null, state.default = null, state.explicit = null, state.implicit = null, state.contains = null, state.parent || (state.children = [], this._wrap());\n }\n Node.prototype = {}, module.exports = Node;\n var stateProps = [\n \"enc\",\n \"parent\",\n \"children\",\n \"tag\",\n \"args\",\n \"reverseArgs\",\n \"choice\",\n \"optional\",\n \"any\",\n \"obj\",\n \"use\",\n \"alteredUse\",\n \"key\",\n \"default\",\n \"explicit\",\n \"implicit\",\n \"contains\"\n ];\n Node.prototype.clone = function() {\n let state = this._baseState, cstate = {};\n stateProps.forEach(function(prop) {\n cstate[prop] = state[prop];\n });\n let res = new this.constructor(cstate.parent);\n return res._baseState = cstate, res;\n }, Node.prototype._wrap = function() {\n let state = this._baseState;\n methods.forEach(function(method) {\n this[method] = function() {\n let clone = new this.constructor(this);\n return state.children.push(clone), clone[method].@apply(clone, arguments);\n };\n }, this);\n }, Node.prototype._init = function(body) {\n let state = this._baseState;\n assert(state.parent === null), body.@call(this), state.children = state.children.filter(function(child) {\n return child._baseState.parent === this;\n }, this), assert.equal(state.children.length, 1, \"Root node can have only one child\");\n }, Node.prototype._useArgs = function(args) {\n let state = this._baseState, children = args.filter(function(arg) {\n return arg instanceof this.constructor;\n }, this);\n args = args.filter(function(arg) {\n return !(arg instanceof this.constructor);\n }, this), children.length !== 0 && (assert(state.children === null), state.children = children, children.forEach(function(child) {\n child._baseState.parent = this;\n }, this)), args.length !== 0 && (assert(state.args === null), state.args = args, state.reverseArgs = args.map(function(arg) {\n if (typeof arg != \"object\" || arg.constructor !== Object)\n return arg;\n let res = {};\n return Object.keys(arg).forEach(function(key2) {\n key2 == (key2 | 0) && (key2 |= 0);\n let value = arg[key2];\n res[value] = key2;\n }), res;\n }));\n }, overrided.forEach(function(method) {\n Node.prototype[method] = function() {\n let state = this._baseState;\n throw new Error(method + \" not implemented for encoding: \" + state.enc);\n };\n }), tags.forEach(function(tag) {\n Node.prototype[tag] = function() {\n let state = this._baseState, args = @Array.prototype.slice.@call(arguments);\n return assert(state.tag === null), state.tag = tag, this._useArgs(args), this;\n };\n }), Node.prototype.use = function(item) {\n assert(item);\n let state = this._baseState;\n return assert(state.use === null), state.use = item, this;\n }, Node.prototype.optional = function() {\n let state = this._baseState;\n return state.optional = !0, this;\n }, Node.prototype.def = function(val) {\n let state = this._baseState;\n return assert(state.default === null), state.default = val, state.optional = !0, this;\n }, Node.prototype.explicit = function(num) {\n let state = this._baseState;\n return assert(state.explicit === null && state.implicit === null), state.explicit = num, this;\n }, Node.prototype.implicit = function(num) {\n let state = this._baseState;\n return assert(state.explicit === null && state.implicit === null), state.implicit = num, this;\n }, Node.prototype.obj = function() {\n let state = this._baseState, args = @Array.prototype.slice.@call(arguments);\n return state.obj = !0, args.length !== 0 && this._useArgs(args), this;\n }, Node.prototype.key = function(newKey) {\n let state = this._baseState;\n return assert(state.key === null), state.key = newKey, this;\n }, Node.prototype.any = function() {\n let state = this._baseState;\n return state.any = !0, this;\n }, Node.prototype.choice = function(obj) {\n let state = this._baseState;\n return assert(state.choice === null), state.choice = obj, this._useArgs(Object.keys(obj).map(function(key2) {\n return obj[key2];\n })), this;\n }, Node.prototype.contains = function(item) {\n let state = this._baseState;\n return assert(state.use === null), state.contains = item, this;\n }, Node.prototype._decode = function(input, options) {\n let state = this._baseState;\n if (state.parent === null)\n return input.wrapResult(state.children[0]._decode(input, options));\n let result = state.default, present = !0, prevKey = null;\n if (state.key !== null && (prevKey = input.enterKey(state.key)), state.optional) {\n let tag = null;\n if (state.explicit !== null \? tag = state.explicit : state.implicit !== null \? tag = state.implicit : state.tag !== null && (tag = state.tag), tag === null && !state.any) {\n let save = input.save();\n try {\n state.choice === null \? this._decodeGeneric(state.tag, input, options) : this._decodeChoice(input, options), present = !0;\n } catch {\n present = !1;\n }\n input.restore(save);\n } else if (present = this._peekTag(input, tag, state.any), input.isError(present))\n return present;\n }\n let prevObj;\n if (state.obj && present && (prevObj = input.enterObject()), present) {\n if (state.explicit !== null) {\n let explicit = this._decodeTag(input, state.explicit);\n if (input.isError(explicit))\n return explicit;\n input = explicit;\n }\n let start = input.offset;\n if (state.use === null && state.choice === null) {\n let save;\n state.any && (save = input.save());\n let body = this._decodeTag(input, state.implicit !== null \? state.implicit : state.tag, state.any);\n if (input.isError(body))\n return body;\n state.any \? result = input.raw(save) : input = body;\n }\n if (options && options.track && state.tag !== null && options.track(input.path(), start, input.length, \"tagged\"), options && options.track && state.tag !== null && options.track(input.path(), input.offset, input.length, \"content\"), state.any || (state.choice === null \? result = this._decodeGeneric(state.tag, input, options) : result = this._decodeChoice(input, options)), input.isError(result))\n return result;\n if (!state.any && state.choice === null && state.children !== null && state.children.forEach(function(child) {\n child._decode(input, options);\n }), state.contains && (state.tag === \"octstr\" || state.tag === \"bitstr\")) {\n let data = new DecoderBuffer(result);\n result = this._getUse(state.contains, input._reporterState.obj)._decode(data, options);\n }\n }\n return state.obj && present && (result = input.leaveObject(prevObj)), state.key !== null && (result !== null || present === !0) \? input.leaveKey(prevKey, state.key, result) : prevKey !== null && input.exitKey(prevKey), result;\n }, Node.prototype._decodeGeneric = function(tag, input, options) {\n let state = this._baseState;\n return tag === \"seq\" || tag === \"set\" \? null : tag === \"seqof\" || tag === \"setof\" \? this._decodeList(input, tag, state.args[0], options) : /str$/.test(tag) \? this._decodeStr(input, tag, options) : tag === \"objid\" && state.args \? this._decodeObjid(input, state.args[0], state.args[1], options) : tag === \"objid\" \? this._decodeObjid(input, null, null, options) : tag === \"gentime\" || tag === \"utctime\" \? this._decodeTime(input, tag, options) : tag === \"null_\" \? this._decodeNull(input, options) : tag === \"bool\" \? this._decodeBool(input, options) : tag === \"objDesc\" \? this._decodeStr(input, tag, options) : tag === \"int\" || tag === \"enum\" \? this._decodeInt(input, state.args && state.args[0], options) : state.use !== null \? this._getUse(state.use, input._reporterState.obj)._decode(input, options) : input.error(\"unknown tag: \" + tag);\n }, Node.prototype._getUse = function(entity, obj) {\n let state = this._baseState;\n return state.useDecoder = this._use(entity, obj), assert(state.useDecoder._baseState.parent === null), state.useDecoder = state.useDecoder._baseState.children[0], state.implicit !== state.useDecoder._baseState.implicit && (state.useDecoder = state.useDecoder.clone(), state.useDecoder._baseState.implicit = state.implicit), state.useDecoder;\n }, Node.prototype._decodeChoice = function(input, options) {\n let state = this._baseState, result = null, match = !1;\n return Object.keys(state.choice).some(function(key2) {\n let save = input.save(), node = state.choice[key2];\n try {\n let value = node._decode(input, options);\n if (input.isError(value))\n return !1;\n result = { type: key2, value }, match = !0;\n } catch {\n return input.restore(save), !1;\n }\n return !0;\n }, this), match \? result : input.error(\"Choice not matched\");\n }, Node.prototype._createEncoderBuffer = function(data) {\n return new EncoderBuffer(data, this.reporter);\n }, Node.prototype._encode = function(data, reporter, parent) {\n let state = this._baseState;\n if (state.default !== null && state.default === data)\n return;\n let result = this._encodeValue(data, reporter, parent);\n if (result !== void 0 && !this._skipDefault(result, reporter, parent))\n return result;\n }, Node.prototype._encodeValue = function(data, reporter, parent) {\n let state = this._baseState;\n if (state.parent === null)\n return state.children[0]._encode(data, reporter || new Reporter);\n let result = null;\n if (this.reporter = reporter, state.optional && data === void 0)\n if (state.default !== null)\n data = state.default;\n else\n return;\n let content = null, primitive = !1;\n if (state.any)\n result = this._createEncoderBuffer(data);\n else if (state.choice)\n result = this._encodeChoice(data, reporter);\n else if (state.contains)\n content = this._getUse(state.contains, parent)._encode(data, reporter), primitive = !0;\n else if (state.children)\n content = state.children.map(function(child) {\n if (child._baseState.tag === \"null_\")\n return child._encode(null, reporter, data);\n if (child._baseState.key === null)\n return reporter.error(\"Child should have a key\");\n let prevKey = reporter.enterKey(child._baseState.key);\n if (typeof data != \"object\")\n return reporter.error(\"Child expected, but input is not object\");\n let res = child._encode(data[child._baseState.key], reporter, data);\n return reporter.leaveKey(prevKey), res;\n }, this).filter(function(child) {\n return child;\n }), content = this._createEncoderBuffer(content);\n else if (state.tag === \"seqof\" || state.tag === \"setof\") {\n if (!(state.args && state.args.length === 1))\n return reporter.error(\"Too many args for : \" + state.tag);\n if (!@Array.isArray(data))\n return reporter.error(\"seqof/setof, but data is not Array\");\n let child = this.clone();\n child._baseState.implicit = null, content = this._createEncoderBuffer(data.map(function(item) {\n let state2 = this._baseState;\n return this._getUse(state2.args[0], data)._encode(item, reporter);\n }, child));\n } else\n state.use !== null \? result = this._getUse(state.use, parent)._encode(data, reporter) : (content = this._encodePrimitive(state.tag, data), primitive = !0);\n if (!state.any && state.choice === null) {\n let tag = state.implicit !== null \? state.implicit : state.tag, cls = state.implicit === null \? \"universal\" : \"context\";\n tag === null \? state.use === null && reporter.error(\"Tag could be omitted only for .use()\") : state.use === null && (result = this._encodeComposite(tag, primitive, cls, content));\n }\n return state.explicit !== null && (result = this._encodeComposite(state.explicit, !1, \"context\", result)), result;\n }, Node.prototype._encodeChoice = function(data, reporter) {\n let state = this._baseState, node = state.choice[data.type];\n return node || assert(!1, data.type + \" not found in \" + JSON.stringify(Object.keys(state.choice))), node._encode(data.value, reporter);\n }, Node.prototype._encodePrimitive = function(tag, data) {\n let state = this._baseState;\n if (/str$/.test(tag))\n return this._encodeStr(data, tag);\n if (tag === \"objid\" && state.args)\n return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);\n if (tag === \"objid\")\n return this._encodeObjid(data, null, null);\n if (tag === \"gentime\" || tag === \"utctime\")\n return this._encodeTime(data, tag);\n if (tag === \"null_\")\n return this._encodeNull();\n if (tag === \"int\" || tag === \"enum\")\n return this._encodeInt(data, state.args && state.reverseArgs[0]);\n if (tag === \"bool\")\n return this._encodeBool(data);\n if (tag === \"objDesc\")\n return this._encodeStr(data, tag);\n throw new Error(\"Unsupported tag: \" + tag);\n }, Node.prototype._isNumstr = function(str) {\n return /^[0-9 ]*$/.test(str);\n }, Node.prototype._isPrintstr = function(str) {\n return /^[A-Za-z0-9 '()+,-./:=\?]*$/.test(str);\n };\n }\n}), require_der = __commonJS({\n \"node_modules/asn1.js/lib/asn1/constants/der.js\"(exports) {\n function reverse(map) {\n let res = {};\n return Object.keys(map).forEach(function(key2) {\n (key2 | 0) == key2 && (key2 = key2 | 0);\n let value = map[key2];\n res[value] = key2;\n }), res;\n }\n exports.tagClass = {\n 0: \"universal\",\n 1: \"application\",\n 2: \"context\",\n 3: \"private\"\n }, exports.tagClassByName = reverse(exports.tagClass), exports.tag = {\n 0: \"end\",\n 1: \"bool\",\n 2: \"int\",\n 3: \"bitstr\",\n 4: \"octstr\",\n 5: \"null_\",\n 6: \"objid\",\n 7: \"objDesc\",\n 8: \"external\",\n 9: \"real\",\n 10: \"enum\",\n 11: \"embed\",\n 12: \"utf8str\",\n 13: \"relativeOid\",\n 16: \"seq\",\n 17: \"set\",\n 18: \"numstr\",\n 19: \"printstr\",\n 20: \"t61str\",\n 21: \"videostr\",\n 22: \"ia5str\",\n 23: \"utctime\",\n 24: \"gentime\",\n 25: \"graphstr\",\n 26: \"iso646str\",\n 27: \"genstr\",\n 28: \"unistr\",\n 29: \"charstr\",\n 30: \"bmpstr\"\n }, exports.tagByName = reverse(exports.tag);\n }\n}), require_der2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/der.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safer().Buffer, Node = require_node(), der = require_der();\n function DEREncoder(entity) {\n this.enc = \"der\", this.name = entity.name, this.entity = entity, this.tree = new DERNode, this.tree._init(entity.body);\n }\n DEREncoder.prototype = {}, module.exports = DEREncoder, DEREncoder.prototype.encode = function(data, reporter) {\n return this.tree._encode(data, reporter).join();\n };\n function DERNode(parent) {\n Node.@call(this, \"der\", parent);\n }\n inherits(DERNode, Node), DERNode.prototype._encodeComposite = function(tag, primitive, cls, content) {\n let encodedTag = encodeTag(tag, primitive, cls, this.reporter);\n if (content.length < 128) {\n let header2 = Buffer2.alloc(2);\n return header2[0] = encodedTag, header2[1] = content.length, this._createEncoderBuffer([header2, content]);\n }\n let lenOctets = 1;\n for (let i = content.length;i >= 256; i >>= 8)\n lenOctets++;\n let header = Buffer2.alloc(2 + lenOctets);\n header[0] = encodedTag, header[1] = 128 | lenOctets;\n for (let i = 1 + lenOctets, j = content.length;j > 0; i--, j >>= 8)\n header[i] = j & 255;\n return this._createEncoderBuffer([header, content]);\n }, DERNode.prototype._encodeStr = function(str, tag) {\n if (tag === \"bitstr\")\n return this._createEncoderBuffer([str.unused | 0, str.data]);\n if (tag === \"bmpstr\") {\n let buf = Buffer2.alloc(str.length * 2);\n for (let i = 0;i < str.length; i++)\n buf.writeUInt16BE(str.charCodeAt(i), i * 2);\n return this._createEncoderBuffer(buf);\n } else\n return tag === \"numstr\" \? this._isNumstr(str) \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: numstr supports only digits and space\") : tag === \"printstr\" \? this._isPrintstr(str) \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark\") : /str$/.test(tag) \? this._createEncoderBuffer(str) : tag === \"objDesc\" \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: \" + tag + \" unsupported\");\n }, DERNode.prototype._encodeObjid = function(id, values, relative) {\n if (typeof id == \"string\") {\n if (!values)\n return this.reporter.error(\"string objid given, but no values map found\");\n if (!values.hasOwnProperty(id))\n return this.reporter.error(\"objid not found in values map\");\n id = values[id].split(/[\\s.]+/g);\n for (let i = 0;i < id.length; i++)\n id[i] |= 0;\n } else if (@Array.isArray(id)) {\n id = id.slice();\n for (let i = 0;i < id.length; i++)\n id[i] |= 0;\n }\n if (!@Array.isArray(id))\n return this.reporter.error(\"objid() should be either array or string, got: \" + JSON.stringify(id));\n if (!relative) {\n if (id[1] >= 40)\n return this.reporter.error(\"Second objid identifier OOB\");\n id.splice(0, 2, id[0] * 40 + id[1]);\n }\n let size = 0;\n for (let i = 0;i < id.length; i++) {\n let ident = id[i];\n for (size++;ident >= 128; ident >>= 7)\n size++;\n }\n let objid = Buffer2.alloc(size), offset = objid.length - 1;\n for (let i = id.length - 1;i >= 0; i--) {\n let ident = id[i];\n for (objid[offset--] = ident & 127;(ident >>= 7) > 0; )\n objid[offset--] = 128 | ident & 127;\n }\n return this._createEncoderBuffer(objid);\n };\n function two(num) {\n return num < 10 \? \"0\" + num : num;\n }\n DERNode.prototype._encodeTime = function(time, tag) {\n let str, date = new Date(time);\n return tag === \"gentime\" \? str = [\n two(date.getUTCFullYear()),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n \"Z\"\n ].join(\"\") : tag === \"utctime\" \? str = [\n two(date.getUTCFullYear() % 100),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n \"Z\"\n ].join(\"\") : this.reporter.error(\"Encoding \" + tag + \" time is not supported yet\"), this._encodeStr(str, \"octstr\");\n }, DERNode.prototype._encodeNull = function() {\n return this._createEncoderBuffer(\"\");\n }, DERNode.prototype._encodeInt = function(num, values) {\n if (typeof num == \"string\") {\n if (!values)\n return this.reporter.error(\"String int or enum given, but no values map\");\n if (!values.hasOwnProperty(num))\n return this.reporter.error(\"Values map doesn't contain: \" + JSON.stringify(num));\n num = values[num];\n }\n if (typeof num != \"number\" && !Buffer2.isBuffer(num)) {\n let numArray = num.toArray();\n !num.sign && numArray[0] & 128 && numArray.unshift(0), num = Buffer2.from(numArray);\n }\n if (Buffer2.isBuffer(num)) {\n let size2 = num.length;\n num.length === 0 && size2++;\n let out2 = Buffer2.alloc(size2);\n return num.copy(out2), num.length === 0 && (out2[0] = 0), this._createEncoderBuffer(out2);\n }\n if (num < 128)\n return this._createEncoderBuffer(num);\n if (num < 256)\n return this._createEncoderBuffer([0, num]);\n let size = 1;\n for (let i = num;i >= 256; i >>= 8)\n size++;\n let out = new @Array(size);\n for (let i = out.length - 1;i >= 0; i--)\n out[i] = num & 255, num >>= 8;\n return out[0] & 128 && out.unshift(0), this._createEncoderBuffer(Buffer2.from(out));\n }, DERNode.prototype._encodeBool = function(value) {\n return this._createEncoderBuffer(value \? 255 : 0);\n }, DERNode.prototype._use = function(entity, obj) {\n return typeof entity == \"function\" && (entity = entity(obj)), entity._getEncoder(\"der\").tree;\n }, DERNode.prototype._skipDefault = function(dataBuffer, reporter, parent) {\n let state = this._baseState, i;\n if (state.default === null)\n return !1;\n let data = dataBuffer.join();\n if (state.defaultBuffer === void 0 && (state.defaultBuffer = this._encodeValue(state.default, reporter, parent).join()), data.length !== state.defaultBuffer.length)\n return !1;\n for (i = 0;i < data.length; i++)\n if (data[i] !== state.defaultBuffer[i])\n return !1;\n return !0;\n };\n function encodeTag(tag, primitive, cls, reporter) {\n let res;\n if (tag === \"seqof\" \? tag = \"seq\" : tag === \"setof\" && (tag = \"set\"), der.tagByName.hasOwnProperty(tag))\n res = der.tagByName[tag];\n else if (typeof tag == \"number\" && (tag | 0) === tag)\n res = tag;\n else\n return reporter.error(\"Unknown tag: \" + tag);\n return res >= 31 \? reporter.error(\"Multi-octet tag encoding unsupported\") : (primitive || (res |= 32), res |= der.tagClassByName[cls || \"universal\"] << 6, res);\n }\n }\n}), require_pem = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/pem.js\"(exports, module) {\n var inherits = require_inherits_browser(), DEREncoder = require_der2();\n function PEMEncoder(entity) {\n DEREncoder.@call(this, entity), this.enc = \"pem\";\n }\n inherits(PEMEncoder, DEREncoder), module.exports = PEMEncoder, PEMEncoder.prototype.encode = function(data, options) {\n let p = DEREncoder.prototype.encode.@call(this, data).toString(\"base64\"), out = [\"-----BEGIN \" + options.label + \"-----\"];\n for (let i = 0;i < p.length; i += 64)\n out.push(p.slice(i, i + 64));\n return out.push(\"-----END \" + options.label + \"-----\"), out.join(`\n`);\n };\n }\n}), require_encoders = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/index.js\"(exports) {\n var encoders = exports;\n encoders.der = require_der2(), encoders.pem = require_pem();\n }\n}), require_der3 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/der.js\"(exports, module) {\n var inherits = require_inherits_browser(), bignum = require_bn5(), DecoderBuffer = require_buffer().DecoderBuffer, Node = require_node(), der = require_der();\n function DERDecoder(entity) {\n this.enc = \"der\", this.name = entity.name, this.entity = entity, this.tree = new DERNode, this.tree._init(entity.body);\n }\n DERDecoder.prototype = {}, module.exports = DERDecoder, DERDecoder.prototype.decode = function(data, options) {\n return DecoderBuffer.isDecoderBuffer(data) || (data = new DecoderBuffer(data, options)), this.tree._decode(data, options);\n };\n function DERNode(parent) {\n Node.@call(this, \"der\", parent);\n }\n inherits(DERNode, Node), DERNode.prototype._peekTag = function(buffer, tag, any) {\n if (buffer.isEmpty())\n return !1;\n let state = buffer.save(), decodedTag = derDecodeTag(buffer, 'Failed to peek tag: \"' + tag + '\"');\n return buffer.isError(decodedTag) \? decodedTag : (buffer.restore(state), decodedTag.tag === tag || decodedTag.tagStr === tag || decodedTag.tagStr + \"of\" === tag || any);\n }, DERNode.prototype._decodeTag = function(buffer, tag, any) {\n let decodedTag = derDecodeTag(buffer, 'Failed to decode tag of \"' + tag + '\"');\n if (buffer.isError(decodedTag))\n return decodedTag;\n let len = derDecodeLen(buffer, decodedTag.primitive, 'Failed to get length of \"' + tag + '\"');\n if (buffer.isError(len))\n return len;\n if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + \"of\" !== tag)\n return buffer.error('Failed to match tag: \"' + tag + '\"');\n if (decodedTag.primitive || len !== null)\n return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n let state = buffer.save(), res = this._skipUntilEnd(buffer, 'Failed to skip indefinite length body: \"' + this.tag + '\"');\n return buffer.isError(res) \? res : (len = buffer.offset - state.offset, buffer.restore(state), buffer.skip(len, 'Failed to match body of: \"' + tag + '\"'));\n }, DERNode.prototype._skipUntilEnd = function(buffer, fail) {\n for (;; ) {\n let tag = derDecodeTag(buffer, fail);\n if (buffer.isError(tag))\n return tag;\n let len = derDecodeLen(buffer, tag.primitive, fail);\n if (buffer.isError(len))\n return len;\n let res;\n if (tag.primitive || len !== null \? res = buffer.skip(len) : res = this._skipUntilEnd(buffer, fail), buffer.isError(res))\n return res;\n if (tag.tagStr === \"end\")\n break;\n }\n }, DERNode.prototype._decodeList = function(buffer, tag, decoder, options) {\n let result = [];\n for (;!buffer.isEmpty(); ) {\n let possibleEnd = this._peekTag(buffer, \"end\");\n if (buffer.isError(possibleEnd))\n return possibleEnd;\n let res = decoder.decode(buffer, \"der\", options);\n if (buffer.isError(res) && possibleEnd)\n break;\n result.push(res);\n }\n return result;\n }, DERNode.prototype._decodeStr = function(buffer, tag) {\n if (tag === \"bitstr\") {\n let unused = buffer.readUInt8();\n return buffer.isError(unused) \? unused : { unused, data: buffer.raw() };\n } else if (tag === \"bmpstr\") {\n let raw = buffer.raw();\n if (raw.length % 2 === 1)\n return buffer.error(\"Decoding of string type: bmpstr length mismatch\");\n let str = \"\";\n for (let i = 0;i < raw.length / 2; i++)\n str += @String.fromCharCode(raw.readUInt16BE(i * 2));\n return str;\n } else if (tag === \"numstr\") {\n let numstr = buffer.raw().toString(\"ascii\");\n return this._isNumstr(numstr) \? numstr : buffer.error(\"Decoding of string type: numstr unsupported characters\");\n } else {\n if (tag === \"octstr\")\n return buffer.raw();\n if (tag === \"objDesc\")\n return buffer.raw();\n if (tag === \"printstr\") {\n let printstr = buffer.raw().toString(\"ascii\");\n return this._isPrintstr(printstr) \? printstr : buffer.error(\"Decoding of string type: printstr unsupported characters\");\n } else\n return /str$/.test(tag) \? buffer.raw().toString() : buffer.error(\"Decoding of string type: \" + tag + \" unsupported\");\n }\n }, DERNode.prototype._decodeObjid = function(buffer, values, relative) {\n let result, identifiers = [], ident = 0, subident = 0;\n for (;!buffer.isEmpty(); )\n subident = buffer.readUInt8(), ident <<= 7, ident |= subident & 127, (subident & 128) === 0 && (identifiers.push(ident), ident = 0);\n subident & 128 && identifiers.push(ident);\n let first = identifiers[0] / 40 | 0, second = identifiers[0] % 40;\n if (relative \? result = identifiers : result = [first, second].concat(identifiers.slice(1)), values) {\n let tmp = values[result.join(\" \")];\n tmp === void 0 && (tmp = values[result.join(\".\")]), tmp !== void 0 && (result = tmp);\n }\n return result;\n }, DERNode.prototype._decodeTime = function(buffer, tag) {\n let str = buffer.raw().toString(), year, mon, day, hour, min, sec;\n if (tag === \"gentime\")\n year = str.slice(0, 4) | 0, mon = str.slice(4, 6) | 0, day = str.slice(6, 8) | 0, hour = str.slice(8, 10) | 0, min = str.slice(10, 12) | 0, sec = str.slice(12, 14) | 0;\n else if (tag === \"utctime\")\n year = str.slice(0, 2) | 0, mon = str.slice(2, 4) | 0, day = str.slice(4, 6) | 0, hour = str.slice(6, 8) | 0, min = str.slice(8, 10) | 0, sec = str.slice(10, 12) | 0, year < 70 \? year = 2000 + year : year = 1900 + year;\n else\n return buffer.error(\"Decoding \" + tag + \" time is not supported yet\");\n return Date.UTC(year, mon - 1, day, hour, min, sec, 0);\n }, DERNode.prototype._decodeNull = function() {\n return null;\n }, DERNode.prototype._decodeBool = function(buffer) {\n let res = buffer.readUInt8();\n return buffer.isError(res) \? res : res !== 0;\n }, DERNode.prototype._decodeInt = function(buffer, values) {\n let raw = buffer.raw(), res = new bignum(raw);\n return values && (res = values[res.toString(10)] || res), res;\n }, DERNode.prototype._use = function(entity, obj) {\n return typeof entity == \"function\" && (entity = entity(obj)), entity._getDecoder(\"der\").tree;\n };\n function derDecodeTag(buf, fail) {\n let tag = buf.readUInt8(fail);\n if (buf.isError(tag))\n return tag;\n let cls = der.tagClass[tag >> 6], primitive = (tag & 32) === 0;\n if ((tag & 31) === 31) {\n let oct = tag;\n for (tag = 0;(oct & 128) === 128; ) {\n if (oct = buf.readUInt8(fail), buf.isError(oct))\n return oct;\n tag <<= 7, tag |= oct & 127;\n }\n } else\n tag &= 31;\n let tagStr = der.tag[tag];\n return {\n cls,\n primitive,\n tag,\n tagStr\n };\n }\n function derDecodeLen(buf, primitive, fail) {\n let len = buf.readUInt8(fail);\n if (buf.isError(len))\n return len;\n if (!primitive && len === 128)\n return null;\n if ((len & 128) === 0)\n return len;\n let num = len & 127;\n if (num > 4)\n return buf.error(\"length octect is too long\");\n len = 0;\n for (let i = 0;i < num; i++) {\n len <<= 8;\n let j = buf.readUInt8(fail);\n if (buf.isError(j))\n return j;\n len |= j;\n }\n return len;\n }\n }\n}), require_pem2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/pem.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safer().Buffer, DERDecoder = require_der3();\n function PEMDecoder(entity) {\n DERDecoder.@call(this, entity), this.enc = \"pem\";\n }\n inherits(PEMDecoder, DERDecoder), module.exports = PEMDecoder, PEMDecoder.prototype.decode = function(data, options) {\n let lines = data.toString().split(/[\\r\\n]+/g), label = options.label.toUpperCase(), re = /^-----(BEGIN|END) ([^-]+)-----$/, start = -1, end = -1;\n for (let i = 0;i < lines.length; i++) {\n let match = lines[i].match(re);\n if (match !== null && match[2] === label)\n if (start === -1) {\n if (match[1] !== \"BEGIN\")\n break;\n start = i;\n } else {\n if (match[1] !== \"END\")\n break;\n end = i;\n break;\n }\n }\n if (start === -1 || end === -1)\n throw new Error(\"PEM section not found for: \" + label);\n let base64 = lines.slice(start + 1, end).join(\"\");\n base64.replace(/[^a-z0-9+/=]+/gi, \"\");\n let input = Buffer2.from(base64, \"base64\");\n return DERDecoder.prototype.decode.@call(this, input, options);\n };\n }\n}), require_decoders = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/index.js\"(exports) {\n var decoders = exports;\n decoders.der = require_der3(), decoders.pem = require_pem2();\n }\n}), require_api = __commonJS({\n \"node_modules/asn1.js/lib/asn1/api.js\"(exports) {\n var encoders = require_encoders(), decoders = require_decoders(), inherits = require_inherits_browser(), api = exports;\n api.define = function(name, body) {\n return new Entity(name, body);\n };\n function Entity(name, body) {\n this.name = name, this.body = body, this.decoders = {}, this.encoders = {};\n }\n Entity.prototype = {}, Entity.prototype._createNamed = function(Base) {\n let name = this.name;\n function Generated(entity) {\n this._initNamed(entity, name);\n }\n return inherits(Generated, Base), Generated.prototype._initNamed = function(entity, name2) {\n Base.@call(this, entity, name2);\n }, new Generated(this);\n }, Entity.prototype._getDecoder = function(enc) {\n return enc = enc || \"der\", this.decoders.hasOwnProperty(enc) || (this.decoders[enc] = this._createNamed(decoders[enc])), this.decoders[enc];\n }, Entity.prototype.decode = function(data, enc, options) {\n return this._getDecoder(enc).decode(data, options);\n }, Entity.prototype._getEncoder = function(enc) {\n return enc = enc || \"der\", this.encoders.hasOwnProperty(enc) || (this.encoders[enc] = this._createNamed(encoders[enc])), this.encoders[enc];\n }, Entity.prototype.encode = function(data, enc, reporter) {\n return this._getEncoder(enc).encode(data, reporter);\n };\n }\n}), require_base2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/index.js\"(exports) {\n var base = exports;\n base.Reporter = require_reporter().Reporter, base.DecoderBuffer = require_buffer().DecoderBuffer, base.EncoderBuffer = require_buffer().EncoderBuffer, base.Node = require_node();\n }\n}), require_constants = __commonJS({\n \"node_modules/asn1.js/lib/asn1/constants/index.js\"(exports) {\n var constants = exports;\n constants._reverse = function(map) {\n let res = {};\n return Object.keys(map).forEach(function(key2) {\n (key2 | 0) == key2 && (key2 = key2 | 0);\n let value = map[key2];\n res[value] = key2;\n }), res;\n }, constants.der = require_der();\n }\n}), require_asn1 = __commonJS({\n \"node_modules/asn1.js/lib/asn1.js\"(exports) {\n var asn1 = exports;\n asn1.bignum = require_bn5(), asn1.define = require_api().define, asn1.base = require_base2(), asn1.constants = require_constants(), asn1.decoders = require_decoders(), asn1.encoders = require_encoders();\n }\n}), require_certificate = __commonJS({\n \"node_modules/parse-asn1/certificate.js\"(exports, module) {\n var asn = require_asn1(), Time = asn.define(\"Time\", function() {\n this.choice({\n utcTime: this.utctime(),\n generalTime: this.gentime()\n });\n }), AttributeTypeValue = asn.define(\"AttributeTypeValue\", function() {\n this.seq().obj(this.key(\"type\").objid(), this.key(\"value\").any());\n }), AlgorithmIdentifier = asn.define(\"AlgorithmIdentifier\", function() {\n this.seq().obj(this.key(\"algorithm\").objid(), this.key(\"parameters\").optional(), this.key(\"curve\").objid().optional());\n }), SubjectPublicKeyInfo = asn.define(\"SubjectPublicKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPublicKey\").bitstr());\n }), RelativeDistinguishedName = asn.define(\"RelativeDistinguishedName\", function() {\n this.setof(AttributeTypeValue);\n }), RDNSequence = asn.define(\"RDNSequence\", function() {\n this.seqof(RelativeDistinguishedName);\n }), Name = asn.define(\"Name\", function() {\n this.choice({\n rdnSequence: this.use(RDNSequence)\n });\n }), Validity = asn.define(\"Validity\", function() {\n this.seq().obj(this.key(\"notBefore\").use(Time), this.key(\"notAfter\").use(Time));\n }), Extension = asn.define(\"Extension\", function() {\n this.seq().obj(this.key(\"extnID\").objid(), this.key(\"critical\").bool().def(!1), this.key(\"extnValue\").octstr());\n }), TBSCertificate = asn.define(\"TBSCertificate\", function() {\n this.seq().obj(this.key(\"version\").explicit(0).int().optional(), this.key(\"serialNumber\").int(), this.key(\"signature\").use(AlgorithmIdentifier), this.key(\"issuer\").use(Name), this.key(\"validity\").use(Validity), this.key(\"subject\").use(Name), this.key(\"subjectPublicKeyInfo\").use(SubjectPublicKeyInfo), this.key(\"issuerUniqueID\").implicit(1).bitstr().optional(), this.key(\"subjectUniqueID\").implicit(2).bitstr().optional(), this.key(\"extensions\").explicit(3).seqof(Extension).optional());\n }), X509Certificate = asn.define(\"X509Certificate\", function() {\n this.seq().obj(this.key(\"tbsCertificate\").use(TBSCertificate), this.key(\"signatureAlgorithm\").use(AlgorithmIdentifier), this.key(\"signatureValue\").bitstr());\n });\n module.exports = X509Certificate;\n }\n}), require_asn12 = __commonJS({\n \"node_modules/parse-asn1/asn1.js\"(exports) {\n var asn1 = require_asn1();\n exports.certificate = require_certificate();\n var RSAPrivateKey = asn1.define(\"RSAPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"modulus\").int(), this.key(\"publicExponent\").int(), this.key(\"privateExponent\").int(), this.key(\"prime1\").int(), this.key(\"prime2\").int(), this.key(\"exponent1\").int(), this.key(\"exponent2\").int(), this.key(\"coefficient\").int());\n });\n exports.RSAPrivateKey = RSAPrivateKey;\n var RSAPublicKey = asn1.define(\"RSAPublicKey\", function() {\n this.seq().obj(this.key(\"modulus\").int(), this.key(\"publicExponent\").int());\n });\n exports.RSAPublicKey = RSAPublicKey;\n var PublicKey = asn1.define(\"SubjectPublicKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPublicKey\").bitstr());\n });\n exports.PublicKey = PublicKey;\n var AlgorithmIdentifier = asn1.define(\"AlgorithmIdentifier\", function() {\n this.seq().obj(this.key(\"algorithm\").objid(), this.key(\"none\").null_().optional(), this.key(\"curve\").objid().optional(), this.key(\"params\").seq().obj(this.key(\"p\").int(), this.key(\"q\").int(), this.key(\"g\").int()).optional());\n }), PrivateKeyInfo = asn1.define(\"PrivateKeyInfo\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPrivateKey\").octstr());\n });\n exports.PrivateKey = PrivateKeyInfo;\n var EncryptedPrivateKeyInfo = asn1.define(\"EncryptedPrivateKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").seq().obj(this.key(\"id\").objid(), this.key(\"decrypt\").seq().obj(this.key(\"kde\").seq().obj(this.key(\"id\").objid(), this.key(\"kdeparams\").seq().obj(this.key(\"salt\").octstr(), this.key(\"iters\").int())), this.key(\"cipher\").seq().obj(this.key(\"algo\").objid(), this.key(\"iv\").octstr()))), this.key(\"subjectPrivateKey\").octstr());\n });\n exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo;\n var DSAPrivateKey = asn1.define(\"DSAPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"p\").int(), this.key(\"q\").int(), this.key(\"g\").int(), this.key(\"pub_key\").int(), this.key(\"priv_key\").int());\n });\n exports.DSAPrivateKey = DSAPrivateKey, exports.DSAparam = asn1.define(\"DSAparam\", function() {\n this.int();\n });\n var ECPrivateKey = asn1.define(\"ECPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"privateKey\").octstr(), this.key(\"parameters\").optional().explicit(0).use(ECParameters), this.key(\"publicKey\").optional().explicit(1).bitstr());\n });\n exports.ECPrivateKey = ECPrivateKey;\n var ECParameters = asn1.define(\"ECParameters\", function() {\n this.choice({\n namedCurve: this.objid()\n });\n });\n exports.signature = asn1.define(\"signature\", function() {\n this.seq().obj(this.key(\"r\").int(), this.key(\"s\").int());\n });\n }\n}), require_aesid = __commonJS({\n \"node_modules/parse-asn1/aesid.json\"(exports, module) {\n module.exports = {\n \"2.16.840.1.101.3.4.1.1\": \"aes-128-ecb\",\n \"2.16.840.1.101.3.4.1.2\": \"aes-128-cbc\",\n \"2.16.840.1.101.3.4.1.3\": \"aes-128-ofb\",\n \"2.16.840.1.101.3.4.1.4\": \"aes-128-cfb\",\n \"2.16.840.1.101.3.4.1.21\": \"aes-192-ecb\",\n \"2.16.840.1.101.3.4.1.22\": \"aes-192-cbc\",\n \"2.16.840.1.101.3.4.1.23\": \"aes-192-ofb\",\n \"2.16.840.1.101.3.4.1.24\": \"aes-192-cfb\",\n \"2.16.840.1.101.3.4.1.41\": \"aes-256-ecb\",\n \"2.16.840.1.101.3.4.1.42\": \"aes-256-cbc\",\n \"2.16.840.1.101.3.4.1.43\": \"aes-256-ofb\",\n \"2.16.840.1.101.3.4.1.44\": \"aes-256-cfb\"\n };\n }\n}), require_fixProc = __commonJS({\n \"node_modules/parse-asn1/fixProc.js\"(exports, module) {\n var findProc = /Proc-Type: 4,ENCRYPTED[\\n\\r]+DEK-Info: AES-((\?:128)|(\?:192)|(\?:256))-CBC,([0-9A-H]+)[\\n\\r]+([0-9A-z\\n\\r+/=]+)[\\n\\r]+/m, startRegex = /^-----BEGIN ((\?:.*\? KEY)|CERTIFICATE)-----/m, fullRegex = /^-----BEGIN ((\?:.*\? KEY)|CERTIFICATE)-----([0-9A-z\\n\\r+/=]+)-----END \\1-----$/m, evp = require_evp_bytestokey(), ciphers = require_browser5(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(okey, password) {\n var key2 = okey.toString(), match = key2.match(findProc), decrypted;\n if (match) {\n var suite = \"aes\" + match[1], iv = Buffer2.from(match[2], \"hex\"), cipherText = Buffer2.from(match[3].replace(/[\\r\\n]/g, \"\"), \"base64\"), cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key, out = [], cipher = ciphers.createDecipheriv(suite, cipherKey, iv);\n out.push(cipher.update(cipherText)), out.push(cipher.final()), decrypted = Buffer2.concat(out);\n } else {\n var match2 = key2.match(fullRegex);\n decrypted = Buffer2.from(match2[2].replace(/[\\r\\n]/g, \"\"), \"base64\");\n }\n var tag = key2.match(startRegex)[1];\n return {\n tag,\n data: decrypted\n };\n };\n }\n}), require_parse_asn1 = __commonJS({\n \"node_modules/parse-asn1/index.js\"(exports, module) {\n var asn1 = require_asn12(), aesid = require_aesid(), fixProc = require_fixProc(), ciphers = require_browser5(), compat = require_browser4(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = parseKeys;\n function parseKeys(buffer) {\n var password;\n if (buffer instanceof KeyObject)\n buffer = buffer.export();\n else if (buffer instanceof CryptoKey)\n buffer = KeyObject.from(buffer).export();\n else if (typeof buffer == \"object\" && !Buffer2.isBuffer(buffer)) {\n if (password = buffer.passphrase, buffer = buffer.key, buffer instanceof KeyObject) {\n var options;\n switch (buffer.type) {\n case \"secret\":\n options = {\n format: \"buffer\"\n };\n break;\n case \"public\":\n options = {\n format: \"pem\",\n type: \"spki\",\n passphrase: password\n };\n break;\n case \"private\":\n options = {\n format: \"pem\",\n type: \"pkcs8\",\n passphrase: password\n };\n break;\n }\n buffer = buffer.export(options);\n } else if (buffer instanceof CryptoKey) {\n var options;\n switch (buffer.type) {\n case \"secret\":\n options = {\n format: \"buffer\"\n };\n break;\n case \"public\":\n options = {\n format: \"pem\",\n type: \"spki\",\n passphrase: password\n };\n break;\n case \"private\":\n options = {\n format: \"pem\",\n type: \"pkcs8\",\n passphrase: password\n };\n break;\n }\n buffer = KeyObject.from(buffer).export(options);\n }\n }\n typeof buffer == \"string\" && (buffer = Buffer2.from(buffer));\n var stripped = fixProc(buffer, password), type = stripped.tag, data = stripped.data, subtype, ndata;\n switch (type) {\n case \"CERTIFICATE\":\n ndata = asn1.certificate.decode(data, \"der\").tbsCertificate.subjectPublicKeyInfo;\n case \"PUBLIC KEY\":\n switch (ndata || (ndata = asn1.PublicKey.decode(data, \"der\")), subtype = ndata.algorithm.algorithm.join(\".\"), subtype) {\n case \"1.2.840.113549.1.1.1\":\n return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, \"der\");\n case \"1.2.840.10045.2.1\":\n return ndata.subjectPrivateKey = ndata.subjectPublicKey, {\n type: \"ec\",\n data: ndata\n };\n case \"1.2.840.10040.4.1\":\n return ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, \"der\"), {\n type: \"dsa\",\n data: ndata.algorithm.params\n };\n default:\n throw new Error(\"unknown key id \" + subtype);\n }\n case \"ENCRYPTED PRIVATE KEY\":\n data = asn1.EncryptedPrivateKey.decode(data, \"der\"), data = decrypt(data, password);\n case \"PRIVATE KEY\":\n switch (ndata = asn1.PrivateKey.decode(data, \"der\"), subtype = ndata.algorithm.algorithm.join(\".\"), subtype) {\n case \"1.2.840.113549.1.1.1\":\n return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, \"der\");\n case \"1.2.840.10045.2.1\":\n return {\n curve: ndata.algorithm.curve,\n privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, \"der\").privateKey\n };\n case \"1.2.840.10040.4.1\":\n return ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, \"der\"), {\n type: \"dsa\",\n params: ndata.algorithm.params\n };\n default:\n throw new Error(\"unknown key id \" + subtype);\n }\n case \"RSA PUBLIC KEY\":\n return asn1.RSAPublicKey.decode(data, \"der\");\n case \"RSA PRIVATE KEY\":\n return asn1.RSAPrivateKey.decode(data, \"der\");\n case \"DSA PRIVATE KEY\":\n return {\n type: \"dsa\",\n params: asn1.DSAPrivateKey.decode(data, \"der\")\n };\n case \"EC PRIVATE KEY\":\n return data = asn1.ECPrivateKey.decode(data, \"der\"), {\n curve: data.parameters.value,\n privateKey: data.privateKey\n };\n default:\n throw new Error(\"unknown key type \" + type);\n }\n }\n parseKeys.signature = asn1.signature;\n function decrypt(data, password) {\n var salt = data.algorithm.decrypt.kde.kdeparams.salt, iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10), algo = aesid[data.algorithm.decrypt.cipher.algo.join(\".\")], iv = data.algorithm.decrypt.cipher.iv, cipherText = data.subjectPrivateKey, keylen = parseInt(algo.split(\"-\")[1], 10) / 8, key2 = compat.pbkdf2Sync(password, salt, iters, keylen, \"sha1\"), cipher = ciphers.createDecipheriv(algo, key2, iv), out = [];\n return out.push(cipher.update(cipherText)), out.push(cipher.final()), Buffer2.concat(out);\n }\n }\n}), require_curves2 = __commonJS({\n \"node_modules/browserify-sign/browser/curves.json\"(exports, module) {\n module.exports = {\n \"1.3.132.0.10\": \"secp256k1\",\n \"1.3.132.0.33\": \"p224\",\n \"1.2.840.10045.3.1.1\": \"p192\",\n \"1.2.840.10045.3.1.7\": \"p256\",\n \"1.3.132.0.34\": \"p384\",\n \"1.3.132.0.35\": \"p521\"\n };\n }\n}), require_sign = __commonJS({\n \"node_modules/browserify-sign/browser/sign.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, createHmac = require_browser3(), crt = require_browserify_rsa(), EC = require_elliptic().ec, BN = require_bn3(), parseKeys = require_parse_asn1(), curves = require_curves2();\n function sign(hash, key2, hashType, signType, tag) {\n var priv = parseKeys(getKeyFrom(key2, \"private\"));\n if (priv.curve) {\n if (signType !== \"ecdsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong private key type\");\n return ecSign(hash, priv);\n } else if (priv.type === \"dsa\") {\n if (signType !== \"dsa\")\n throw new Error(\"wrong private key type\");\n return dsaSign(hash, priv, hashType);\n } else if (signType !== \"rsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong private key type\");\n hash = Buffer2.concat([tag, hash]);\n for (var len = priv.modulus.byteLength(), pad = [0, 1];hash.length + pad.length + 1 < len; )\n pad.push(255);\n pad.push(0);\n for (var i = -1;++i < hash.length; )\n pad.push(hash[i]);\n var out = crt(pad, priv);\n return out;\n }\n function ecSign(hash, priv) {\n var curveId = curves[priv.curve.join(\".\")];\n if (!curveId)\n throw new Error(\"unknown curve \" + priv.curve.join(\".\"));\n var curve = new EC(curveId), key2 = curve.keyFromPrivate(priv.privateKey), out = key2.sign(hash);\n return Buffer2.from(out.toDER());\n }\n function dsaSign(hash, priv, algo) {\n for (var x = priv.params.priv_key, p = priv.params.p, q = priv.params.q, g = priv.params.g, r = new BN(0), k, H = bits2int(hash, q).mod(q), s = !1, kv = getKey(x, q, hash, algo);s === !1; )\n k = makeKey(q, kv, algo), r = makeR(g, k, p, q), s = k.invm(q).imul(H.add(x.mul(r))).mod(q), s.cmpn(0) === 0 && (s = !1, r = new BN(0));\n return toDER(r, s);\n }\n function toDER(r, s) {\n r = r.toArray(), s = s.toArray(), r[0] & 128 && (r = [0].concat(r)), s[0] & 128 && (s = [0].concat(s));\n var total = r.length + s.length + 4, res = [48, total, 2, r.length];\n return res = res.concat(r, [2, s.length], s), Buffer2.from(res);\n }\n function getKey(x, q, hash, algo) {\n if (x = Buffer2.from(x.toArray()), x.length < q.byteLength()) {\n var zeros = Buffer2.alloc(q.byteLength() - x.length);\n x = Buffer2.concat([zeros, x]);\n }\n var hlen = hash.length, hbits = bits2octets(hash, q), v = Buffer2.alloc(hlen);\n v.fill(1);\n var k = Buffer2.alloc(hlen);\n return k = createHmac(algo, k).update(v).update(Buffer2.from([0])).update(x).update(hbits).digest(), v = createHmac(algo, k).update(v).digest(), k = createHmac(algo, k).update(v).update(Buffer2.from([1])).update(x).update(hbits).digest(), v = createHmac(algo, k).update(v).digest(), { k, v };\n }\n function bits2int(obits, q) {\n var bits = new BN(obits), shift = (obits.length << 3) - q.bitLength();\n return shift > 0 && bits.ishrn(shift), bits;\n }\n function bits2octets(bits, q) {\n bits = bits2int(bits, q), bits = bits.mod(q);\n var out = Buffer2.from(bits.toArray());\n if (out.length < q.byteLength()) {\n var zeros = Buffer2.alloc(q.byteLength() - out.length);\n out = Buffer2.concat([zeros, out]);\n }\n return out;\n }\n function makeKey(q, kv, algo) {\n var t, k;\n do {\n for (t = Buffer2.alloc(0);t.length * 8 < q.bitLength(); )\n kv.v = createHmac(algo, kv.k).update(kv.v).digest(), t = Buffer2.concat([t, kv.v]);\n k = bits2int(t, q), kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer2.from([0])).digest(), kv.v = createHmac(algo, kv.k).update(kv.v).digest();\n } while (k.cmp(q) !== -1);\n return k;\n }\n function makeR(g, k, p, q) {\n return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q);\n }\n module.exports = sign, module.exports.getKey = getKey, module.exports.makeKey = makeKey;\n }\n}), require_verify = __commonJS({\n \"node_modules/browserify-sign/browser/verify.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, BN = require_bn3(), EC = require_elliptic().ec, parseKeys = require_parse_asn1(), curves = require_curves2();\n function verify(sig, hash, key2, signType, tag) {\n var pub = parseKeys(getKeyFrom(key2, \"public\"));\n if (pub.type === \"ec\") {\n if (signType !== \"ecdsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong public key type\");\n return ecVerify(sig, hash, pub);\n } else if (pub.type === \"dsa\") {\n if (signType !== \"dsa\")\n throw new Error(\"wrong public key type\");\n return dsaVerify(sig, hash, pub);\n } else if (signType !== \"rsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong public key type\");\n hash = Buffer2.concat([tag, hash]);\n for (var len = pub.modulus.byteLength(), pad = [1], padNum = 0;hash.length + pad.length + 2 < len; )\n pad.push(255), padNum++;\n pad.push(0);\n for (var i = -1;++i < hash.length; )\n pad.push(hash[i]);\n pad = Buffer2.from(pad);\n var red = BN.mont(pub.modulus);\n sig = new BN(sig).toRed(red), sig = sig.redPow(new BN(pub.publicExponent)), sig = Buffer2.from(sig.fromRed().toArray());\n var out = padNum < 8 \? 1 : 0;\n for (len = Math.min(sig.length, pad.length), sig.length !== pad.length && (out = 1), i = -1;++i < len; )\n out |= sig[i] ^ pad[i];\n return out === 0;\n }\n function ecVerify(sig, hash, pub) {\n var curveId = curves[pub.data.algorithm.curve.join(\".\")];\n if (!curveId)\n throw new Error(\"unknown curve \" + pub.data.algorithm.curve.join(\".\"));\n var curve = new EC(curveId), pubkey = pub.data.subjectPrivateKey.data;\n return curve.verify(hash, sig, pubkey);\n }\n function dsaVerify(sig, hash, pub) {\n var p = pub.data.p, q = pub.data.q, g = pub.data.g, y = pub.data.pub_key, unpacked = parseKeys.signature.decode(sig, \"der\"), s = unpacked.s, r = unpacked.r;\n checkValue(s, q), checkValue(r, q);\n var montp = BN.mont(p), w = s.invm(q), v = g.toRed(montp).redPow(new BN(hash).mul(w).mod(q)).fromRed().mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed()).mod(p).mod(q);\n return v.cmp(r) === 0;\n }\n function checkValue(b, q) {\n if (b.cmpn(0) <= 0)\n throw new Error(\"invalid sig\");\n if (b.cmp(q) >= q)\n throw new Error(\"invalid sig\");\n }\n module.exports = verify;\n }\n}), require_browser8 = __commonJS({\n \"node_modules/browserify-sign/browser/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, createHash = require_browser2(), inherits = require_inherits_browser(), sign = require_sign(), verify = require_verify(), algorithms = require_algorithms();\n Object.keys(algorithms).forEach(function(key2) {\n algorithms[key2].id = Buffer2.from(algorithms[key2].id, \"hex\"), algorithms[key2.toLowerCase()] = algorithms[key2];\n });\n function Sign(algorithm) {\n if (typeof algorithm === \"string\")\n algorithm = algorithm.toLowerCase();\n StreamModule.Writable.@call(this);\n var data = algorithms[algorithm];\n if (!data)\n throw new Error(\"Unknown message digest\");\n this._hashType = data.hash, this._hash = createHash(data.hash), this._tag = data.id, this._signType = data.sign;\n }\n inherits(Sign, StreamModule.Writable), Sign.prototype._write = function(data, _, done) {\n this._hash.update(data), done();\n }, Sign.prototype.update = function(data, enc) {\n return typeof data == \"string\" && (data = Buffer2.from(data, enc)), this._hash.update(data), this;\n }, Sign.prototype.sign = function(key2, enc) {\n this.end();\n var hash = this._hash.digest(), sig = sign(hash, key2, this._hashType, this._signType, this._tag);\n return enc \? sig.toString(enc) : sig;\n };\n function Verify(algorithm) {\n if (StreamModule.Writable.@call(this), typeof algorithm === \"string\")\n algorithm = algorithm.toLowerCase();\n var data = algorithms[algorithm];\n if (!data)\n throw new Error(\"Unknown message digest\");\n this._hash = createHash(data.hash), this._tag = data.id, this._signType = data.sign;\n }\n inherits(Verify, StreamModule.Writable), Verify.prototype._write = function(data, _, done) {\n this._hash.update(data), done();\n }, Verify.prototype.update = function(data, enc) {\n return typeof data == \"string\" && (data = Buffer2.from(data, enc)), this._hash.update(data), this;\n }, Verify.prototype.verify = function(key2, sig, enc) {\n typeof sig == \"string\" && (sig = Buffer2.from(sig, enc)), this.end();\n var hash = this._hash.digest();\n return verify(sig, hash, key2, this._signType, this._tag);\n };\n function createSign(algorithm) {\n return new Sign(algorithm);\n }\n function createVerify(algorithm) {\n return new Verify(algorithm);\n }\n module.exports = {\n Sign: createSign,\n Verify: createVerify,\n createSign,\n createVerify\n };\n }\n}), require_bn6 = require_bn, require_browser9 = __commonJS({\n \"node_modules/create-ecdh/browser.js\"(exports, module) {\n var elliptic = require_elliptic(), BN = require_bn6();\n module.exports = function(curve) {\n return new ECDH(curve);\n };\n var aliases = {\n secp256k1: {\n name: \"secp256k1\",\n byteLength: 32\n },\n secp224r1: {\n name: \"p224\",\n byteLength: 28\n },\n prime256v1: {\n name: \"p256\",\n byteLength: 32\n },\n prime192v1: {\n name: \"p192\",\n byteLength: 24\n },\n ed25519: {\n name: \"ed25519\",\n byteLength: 32\n },\n secp384r1: {\n name: \"p384\",\n byteLength: 48\n },\n secp521r1: {\n name: \"p521\",\n byteLength: 66\n }\n };\n aliases.p224 = aliases.secp224r1, aliases.p256 = aliases.secp256r1 = aliases.prime256v1, aliases.p192 = aliases.secp192r1 = aliases.prime192v1, aliases.p384 = aliases.secp384r1, aliases.p521 = aliases.secp521r1;\n function ECDH(curve) {\n this.curveType = aliases[curve], this.curveType || (this.curveType = {\n name: curve\n }), this.curve = new elliptic.ec(this.curveType.name), this.keys = void 0;\n }\n ECDH.prototype = {}, ECDH.prototype.generateKeys = function(enc, format) {\n return this.keys = this.curve.genKeyPair(), this.getPublicKey(enc, format);\n }, ECDH.prototype.computeSecret = function(other, inenc, enc) {\n inenc = inenc || \"utf8\", Buffer.isBuffer(other) || (other = new Buffer(other, inenc));\n var otherPub = this.curve.keyFromPublic(other).getPublic(), out = otherPub.mul(this.keys.getPrivate()).getX();\n return formatReturnValue(out, enc, this.curveType.byteLength);\n }, ECDH.prototype.getPublicKey = function(enc, format) {\n var key2 = this.keys.getPublic(format === \"compressed\", !0);\n return format === \"hybrid\" && (key2[key2.length - 1] % 2 \? key2[0] = 7 : key2[0] = 6), formatReturnValue(key2, enc);\n }, ECDH.prototype.getPrivateKey = function(enc) {\n return formatReturnValue(this.keys.getPrivate(), enc);\n }, ECDH.prototype.setPublicKey = function(pub, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(pub) || (pub = new Buffer(pub, enc)), this.keys._importPublic(pub), this;\n }, ECDH.prototype.setPrivateKey = function(priv, enc) {\n enc = enc || \"utf8\", Buffer.isBuffer(priv) || (priv = new Buffer(priv, enc));\n var _priv = new BN(priv);\n return _priv = _priv.toString(16), this.keys = this.curve.genKeyPair(), this.keys._importPrivate(_priv), this;\n };\n function formatReturnValue(bn, enc, len) {\n @Array.isArray(bn) || (bn = bn.toArray());\n var buf = new Buffer(bn);\n if (len && buf.length < len) {\n var zeros = new Buffer(len - buf.length);\n zeros.fill(0), buf = Buffer.concat([zeros, buf]);\n }\n return enc \? buf.toString(enc) : buf;\n }\n }\n}), require_mgf = __commonJS({\n \"node_modules/public-encrypt/mgf.js\"(exports, module) {\n var createHash = require_browser2(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(seed, len) {\n for (var t = Buffer2.alloc(0), i = 0, c;t.length < len; )\n c = i2ops(i++), t = Buffer2.concat([t, createHash(\"sha1\").update(seed).update(c).digest()]);\n return t.slice(0, len);\n };\n function i2ops(c) {\n var out = Buffer2.allocUnsafe(4);\n return out.writeUInt32BE(c, 0), out;\n }\n }\n}), require_xor = __commonJS({\n \"node_modules/public-encrypt/xor.js\"(exports, module) {\n module.exports = function(a, b) {\n for (var len = a.length, i = -1;++i < len; )\n a[i] ^= b[i];\n return a;\n };\n }\n}), require_bn7 = require_bn, { CryptoHasher } = globalThis.Bun, require_withPublic = __commonJS({\n \"node_modules/public-encrypt/withPublic.js\"(exports, module) {\n var BN = require_bn7(), Buffer2 = require_safe_buffer().Buffer;\n function withPublic(paddedMsg, key2) {\n return Buffer2.from(paddedMsg.toRed(BN.mont(key2.modulus)).redPow(new BN(key2.publicExponent)).fromRed().toArray());\n }\n module.exports = withPublic;\n }\n}), require_publicEncrypt = __commonJS({\n \"node_modules/public-encrypt/publicEncrypt.js\"(exports, module) {\n var parseKeys = require_parse_asn1(), randomBytes = require_browser(), createHash = require_browser2(), mgf = require_mgf(), xor = require_xor(), BN = require_bn7(), withPublic = require_withPublic(), crt = require_browserify_rsa(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(publicKey, msg, reverse) {\n var padding;\n publicKey.padding \? padding = publicKey.padding : reverse \? padding = 1 : padding = 4;\n var key2 = parseKeys(publicKey), paddedMsg;\n if (padding === 4)\n paddedMsg = oaep(key2, msg);\n else if (padding === 1)\n paddedMsg = pkcs1(key2, msg, reverse);\n else if (padding === 3) {\n if (paddedMsg = new BN(msg), paddedMsg.cmp(key2.modulus) >= 0)\n throw new Error(\"data too long for modulus\");\n } else\n throw new Error(\"unknown padding\");\n return reverse \? crt(paddedMsg, key2) : withPublic(paddedMsg, key2);\n };\n function oaep(key2, msg) {\n var k = key2.modulus.byteLength(), mLen = msg.length, iHash = createHash(\"sha1\").update(Buffer2.alloc(0)).digest(), hLen = iHash.length, hLen2 = 2 * hLen;\n if (mLen > k - hLen2 - 2)\n throw new Error(\"message too long\");\n var ps = Buffer2.alloc(k - mLen - hLen2 - 2), dblen = k - hLen - 1, seed = randomBytes(hLen), maskedDb = xor(Buffer2.concat([iHash, ps, Buffer2.alloc(1, 1), msg], dblen), mgf(seed, dblen)), maskedSeed = xor(seed, mgf(maskedDb, hLen));\n return new BN(Buffer2.concat([Buffer2.alloc(1), maskedSeed, maskedDb], k));\n }\n function pkcs1(key2, msg, reverse) {\n var mLen = msg.length, k = key2.modulus.byteLength();\n if (mLen > k - 11)\n throw new Error(\"message too long\");\n var ps;\n return reverse \? ps = Buffer2.alloc(k - mLen - 3, 255) : ps = nonZero(k - mLen - 3), new BN(Buffer2.concat([Buffer2.from([0, reverse \? 1 : 2]), ps, Buffer2.alloc(1), msg], k));\n }\n function nonZero(len) {\n for (var out = Buffer2.allocUnsafe(len), i = 0, cache = randomBytes(len * 2), cur = 0, num;i < len; )\n cur === cache.length && (cache = randomBytes(len * 2), cur = 0), num = cache[cur++], num && (out[i++] = num);\n return out;\n }\n }\n}), require_privateDecrypt = __commonJS({\n \"node_modules/public-encrypt/privateDecrypt.js\"(exports, module) {\n var parseKeys = require_parse_asn1(), mgf = require_mgf(), xor = require_xor(), BN = require_bn7(), crt = require_browserify_rsa(), createHash = require_browser2(), withPublic = require_withPublic(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(privateKey, enc, reverse) {\n var padding;\n privateKey.padding \? padding = privateKey.padding : reverse \? padding = 1 : padding = 4;\n var key2 = parseKeys(privateKey), k = key2.modulus.byteLength();\n if (enc.length > k || new BN(enc).cmp(key2.modulus) >= 0)\n throw new Error(\"decryption error\");\n var msg;\n reverse \? msg = withPublic(new BN(enc), key2) : msg = crt(enc, key2);\n var zBuffer = Buffer2.alloc(k - msg.length);\n if (msg = Buffer2.concat([zBuffer, msg], k), padding === 4)\n return oaep(key2, msg);\n if (padding === 1)\n return pkcs1(key2, msg, reverse);\n if (padding === 3)\n return msg;\n throw new Error(\"unknown padding\");\n };\n function oaep(key2, msg) {\n var k = key2.modulus.byteLength(), iHash = createHash(\"sha1\").update(Buffer2.alloc(0)).digest(), hLen = iHash.length;\n if (msg[0] !== 0)\n throw new Error(\"decryption error\");\n var maskedSeed = msg.slice(1, hLen + 1), maskedDb = msg.slice(hLen + 1), seed = xor(maskedSeed, mgf(maskedDb, hLen)), db = xor(maskedDb, mgf(seed, k - hLen - 1));\n if (compare(iHash, db.slice(0, hLen)))\n throw new Error(\"decryption error\");\n for (var i = hLen;db[i] === 0; )\n i++;\n if (db[i++] !== 1)\n throw new Error(\"decryption error\");\n return db.slice(i);\n }\n function pkcs1(key2, msg, reverse) {\n for (var p1 = msg.slice(0, 2), i = 2, status = 0;msg[i++] !== 0; )\n if (i >= msg.length) {\n status++;\n break;\n }\n var ps = msg.slice(2, i - 1);\n if ((p1.toString(\"hex\") !== \"0002\" && !reverse || p1.toString(\"hex\") !== \"0001\" && reverse) && status++, ps.length < 8 && status++, status)\n throw new Error(\"decryption error\");\n return msg.slice(i);\n }\n function compare(a, b) {\n a = Buffer2.from(a), b = Buffer2.from(b);\n var dif = 0, len = a.length;\n a.length !== b.length && (dif++, len = Math.min(a.length, b.length));\n for (var i = -1;++i < len; )\n dif += a[i] ^ b[i];\n return dif;\n }\n }\n}), require_browser10 = __commonJS({\n \"node_modules/public-encrypt/browser.js\"(exports) {\n var publicEncrypt = require_publicEncrypt();\n exports.publicEncrypt = function(key2, buf, options) {\n return publicEncrypt(getKeyFrom(key2, \"public\"), buf, options);\n };\n var privateDecrypt = require_privateDecrypt();\n exports.privateDecrypt = function(key2, buf, options) {\n return privateDecrypt(getKeyFrom(key2, \"private\"), buf, options);\n }, exports.privateEncrypt = function(key2, buf) {\n return publicEncrypt(getKeyFrom(key2, \"private\"), buf, !0);\n }, exports.publicDecrypt = function(key2, buf) {\n return privateDecrypt(getKeyFrom(key2, \"public\"), buf, !0);\n };\n }\n}), require_browser11 = __commonJS({\n \"node_modules/randomfill/browser.js\"(exports) {\n var safeBuffer = require_safe_buffer(), randombytes = require_browser(), Buffer2 = safeBuffer.Buffer, kBufferMaxLength = safeBuffer.kMaxLength, kMaxUint32 = Math.pow(2, 32) - 1;\n function assertOffset(offset, length) {\n if (typeof offset != \"number\" || offset !== offset)\n @throwTypeError(\"offset must be a number\");\n if (offset > kMaxUint32 || offset < 0)\n @throwTypeError(\"offset must be a uint32\");\n if (offset > kBufferMaxLength || offset > length)\n @throwRangeError(\"offset out of range\");\n }\n function assertSize(size, offset, length) {\n if (typeof size != \"number\" || size !== size)\n @throwTypeError(\"size must be a number\");\n if (size > kMaxUint32 || size < 0)\n @throwTypeError(\"size must be a uint32\");\n if (size + offset > length || size > kBufferMaxLength)\n @throwRangeError(\"buffer too small\");\n }\n exports.randomFill = randomFill, exports.randomFillSync = randomFillSync;\n function randomFill(buf, offset, size, cb) {\n if (!Buffer2.isBuffer(buf) && !(buf instanceof global.Uint8Array))\n @throwTypeError('\"buf\" argument must be a Buffer or Uint8Array');\n if (typeof offset == \"function\")\n cb = offset, offset = 0, size = buf.length;\n else if (typeof size == \"function\")\n cb = size, size = buf.length - offset;\n else if (typeof cb != \"function\")\n @throwTypeError('\"cb\" argument must be a function');\n return assertOffset(offset, buf.length), assertSize(size, offset, buf.length), actualFill(buf, offset, size, cb);\n }\n function actualFill(buf, offset, size, cb) {\n if (cb) {\n randombytes(size, function(err, bytes2) {\n if (err)\n return cb(err);\n bytes2.copy(buf, offset), cb(null, buf);\n });\n return;\n }\n var bytes = randombytes(size);\n return bytes.copy(buf, offset), buf;\n }\n function randomFillSync(buf, offset, size) {\n if (typeof offset > \"u\" && (offset = 0), !Buffer2.isBuffer(buf) && !(buf instanceof global.Uint8Array))\n @throwTypeError('\"buf\" argument must be a Buffer or Uint8Array');\n return assertOffset(offset, buf.length), size === void 0 && (size = buf.length - offset), assertSize(size, offset, buf.length), actualFill(buf, offset, size);\n }\n }\n}), require_crypto_browserify2 = __commonJS({\n \"node_modules/crypto-browserify/index.js\"(exports) {\n exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require_browser(), exports.createHash = require_browser2(), exports.Hash = exports.createHash.Hash, exports.createHmac = exports.Hmac = require_browser3();\n var algos = require_algos(), algoKeys = Object.keys(algos), hashes = [\"sha1\", \"sha224\", \"sha256\", \"sha384\", \"sha512\", \"md5\", \"rmd160\"].concat(algoKeys);\n exports.getHashes = function() {\n return hashes;\n };\n var p = require_browser4();\n exports.pbkdf2 = p.pbkdf2, exports.pbkdf2Sync = p.pbkdf2Sync;\n var aes = require_browser6();\n exports.Cipher = aes.Cipher, exports.createCipher = aes.createCipher, exports.Cipheriv = aes.Cipheriv, exports.createCipheriv = aes.createCipheriv, exports.Decipher = aes.Decipher, exports.createDecipher = aes.createDecipher, exports.Decipheriv = aes.Decipheriv, exports.createDecipheriv = aes.createDecipheriv, exports.getCiphers = aes.getCiphers, exports.listCiphers = aes.listCiphers;\n var dh = require_browser7();\n exports.DiffieHellmanGroup = dh.DiffieHellmanGroup, exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup, exports.getDiffieHellman = dh.getDiffieHellman, exports.createDiffieHellman = dh.createDiffieHellman, exports.DiffieHellman = dh.DiffieHellman;\n var sign = require_browser8();\n exports.createSign = sign.createSign, exports.Sign = sign.Sign, exports.createVerify = sign.createVerify, exports.Verify = sign.Verify, exports.createECDH = require_browser9();\n var publicEncrypt = require_browser10();\n exports.publicEncrypt = publicEncrypt.publicEncrypt, exports.privateEncrypt = publicEncrypt.privateEncrypt, exports.publicDecrypt = publicEncrypt.publicDecrypt, exports.privateDecrypt = publicEncrypt.privateDecrypt, exports.getRandomValues = (values) => crypto.getRandomValues(values);\n var rf = require_browser11();\n exports.randomFill = rf.randomFill, exports.randomFillSync = rf.randomFillSync, exports.createCredentials = function() {\n throw new Error([\n \"sorry, createCredentials is not implemented yet\",\n \"we accept pull requests\",\n \"https://github.com/crypto-browserify/crypto-browserify\"\n ].join(`\n`));\n }, exports.constants = @processBindingConstants.crypto;\n }\n}), crypto_exports = require_crypto_browserify2(), DEFAULT_ENCODING = \"buffer\", getRandomValues = (array) => crypto.getRandomValues(array), randomUUID = () => crypto.randomUUID(), randomInt = (...args) => crypto.randomInt(...args), timingSafeEqual = \"timingSafeEqual\" in crypto \? (a, b) => {\n let { byteLength: byteLengthA } = a, { byteLength: byteLengthB } = b;\n if (typeof byteLengthA != \"number\" || typeof byteLengthB != \"number\")\n @throwTypeError(\"Input must be an array buffer view\");\n if (byteLengthA !== byteLengthB)\n @throwRangeError(\"Input buffers must have the same length\");\n return crypto.timingSafeEqual(a, b);\n} : void 0, scryptSync = \"scryptSync\" in crypto \? (password, salt, keylen, options) => {\n let res = crypto.scryptSync(password, salt, keylen, options);\n return DEFAULT_ENCODING !== \"buffer\" \? new Buffer(res).toString(DEFAULT_ENCODING) : new Buffer(res);\n} : void 0, scrypt = \"scryptSync\" in crypto \? function(password, salt, keylen, options, callback) {\n if (typeof options == \"function\" && (callback = options, options = void 0), typeof callback != \"function\") {\n var err = @makeTypeError(\"callback must be a function\");\n throw err.code = \"ERR_INVALID_CALLBACK\", err;\n }\n try {\n let result = crypto.scryptSync(password, salt, keylen, options);\n process.nextTick(callback, null, DEFAULT_ENCODING !== \"buffer\" \? new Buffer(result).toString(DEFAULT_ENCODING) : new Buffer(result));\n } catch (err2) {\n throw err2;\n }\n} : void 0;\ntimingSafeEqual && (Object.defineProperty(timingSafeEqual, \"name\", {\n value: \"::bunternal::\"\n}), Object.defineProperty(scrypt, \"name\", {\n value: \"::bunternal::\"\n}), Object.defineProperty(scryptSync, \"name\", {\n value: \"::bunternal::\"\n}));\nvar harcoded_curves = [\n \"p192\",\n \"p224\",\n \"p256\",\n \"p384\",\n \"p521\",\n \"curve25519\",\n \"ed25519\",\n \"secp256k1\",\n \"secp224r1\",\n \"prime256v1\",\n \"prime192v1\",\n \"ed25519\",\n \"secp384r1\",\n \"secp521r1\"\n], {\n symmetricKeySize,\n asymmetricKeyDetails,\n asymmetricKeyType,\n equals,\n exports,\n createSecretKey,\n createPublicKey,\n createPrivateKey,\n generateKeySync,\n generateKeyPairSync\n} = @lazy(\"internal/crypto\"), kCryptoKey = Symbol.for(\"::bunKeyObjectCryptoKey::\");\n\nclass KeyObject {\n [kCryptoKey];\n constructor(key2) {\n if (typeof key2 !== \"object\")\n @throwTypeError('The \"key\" argument must be an instance of CryptoKey.');\n this[kCryptoKey] = key2;\n }\n toString() {\n return \"[object KeyObject]\";\n }\n static from(key2) {\n if (key2 instanceof KeyObject)\n key2 = key2[kCryptoKey];\n return new KeyObject(key2);\n }\n get asymmetricKeyDetails() {\n return asymmetricKeyDetails(this[kCryptoKey]);\n }\n get symmetricKeySize() {\n return symmetricKeySize(this[kCryptoKey]);\n }\n get asymmetricKeyType() {\n return asymmetricKeyType(this[kCryptoKey]);\n }\n [\"export\"](options) {\n switch (arguments.length) {\n case 0:\n switch (this.type) {\n case \"secret\":\n options = {\n format: \"buffer\"\n };\n break;\n case \"public\":\n options = {\n format: \"pem\",\n type: \"spki\"\n };\n break;\n case \"private\":\n options = {\n format: \"pem\",\n type: \"pkcs8\"\n };\n break;\n }\n break;\n case 1:\n if (typeof options === \"object\" && !options.format)\n switch (this.type) {\n case \"secret\":\n options.format = \"buffer\";\n break;\n default:\n options.format = \"pem\";\n break;\n }\n }\n return exports(this[kCryptoKey], options);\n }\n equals(otherKey) {\n if (!(otherKey instanceof KeyObject))\n @throwTypeError(\"otherKey must be a KeyObject\");\n return equals(this[kCryptoKey], otherKey[kCryptoKey]);\n }\n get type() {\n return this[kCryptoKey].type;\n }\n}\ncrypto_exports.generateKeySync = function(algorithm, options) {\n return KeyObject.from(generateKeySync(algorithm, options\?.length));\n};\ncrypto_exports.generateKey = function(algorithm, options, callback) {\n try {\n const key2 = KeyObject.from(generateKeySync(algorithm, options\?.length));\n typeof callback === \"function\" && callback(null, KeyObject.from(key2));\n } catch (err) {\n typeof callback === \"function\" && callback(err);\n }\n};\ncrypto_exports.generateKeyPairSync = _generateKeyPairSync;\ncrypto_exports.generateKeyPair = function(algorithm, options, callback) {\n try {\n const result = _generateKeyPairSync(algorithm, options);\n typeof callback === \"function\" && callback(null, result.publicKey, result.privateKey);\n } catch (err) {\n typeof callback === \"function\" && callback(err);\n }\n};\ncrypto_exports.createSecretKey = function(key2, encoding) {\n if (key2 instanceof KeyObject || key2 instanceof CryptoKey) {\n if (key2.type !== \"secret\") {\n const error = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key2.type}, expected secret`);\n throw error.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error;\n }\n return KeyObject.from(key2);\n }\n const buffer = getArrayBufferOrView(key2, encoding || \"utf8\");\n return KeyObject.from(createSecretKey(buffer));\n};\ncrypto_exports.createPrivateKey = _createPrivateKey;\ncrypto_exports.createPublicKey = _createPublicKey;\ncrypto_exports.KeyObject = KeyObject;\nvar _createSign = crypto_exports.createSign;\ncrypto_exports.sign = function(algorithm, data, key2, encoding, callback) {\n if (typeof callback === \"function\")\n try {\n const result = _createSign(algorithm).update(data, encoding).sign(key2, encoding);\n callback(null, result);\n } catch (err) {\n callback(err);\n }\n else\n return _createSign(algorithm).update(data, encoding).sign(key2, encoding);\n};\nvar _createVerify = crypto_exports.createVerify;\ncrypto_exports.verify = function(algorithm, data, key2, signature, callback) {\n if (typeof callback === \"function\")\n try {\n const result = _createVerify(algorithm).update(data).verify(key2, signature);\n callback(null, result);\n } catch (err) {\n callback(err);\n }\n else\n return _createVerify(algorithm).update(data).verify(key2, signature);\n};\nvar webcrypto = crypto;\n__export(crypto_exports, {\n DEFAULT_ENCODING: () => DEFAULT_ENCODING,\n getRandomValues: () => getRandomValues,\n randomUUID: () => randomUUID,\n randomInt: () => randomInt,\n getCurves: () => getCurves,\n scrypt: () => scrypt,\n scryptSync: () => scryptSync,\n timingSafeEqual: () => timingSafeEqual,\n webcrypto: () => webcrypto,\n subtle: () => webcrypto.subtle\n});\n$ = crypto_exports;\n/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeDiagnosticsChannelCode = "(function (){\"use strict\";// src/js/out/tmp/node/diagnostics_channel.ts\nvar markActive = function(channel) {\n ObjectSetPrototypeOf(channel, ActiveChannel.prototype), channel._subscribers = [], channel._stores = new SafeMap;\n}, maybeMarkInactive = function(channel) {\n if (!channel._subscribers.length && !channel._stores.size)\n ObjectSetPrototypeOf(channel, Channel.prototype), channel._subscribers = void 0, channel._stores = void 0;\n}, defaultTransform = function(data) {\n return data;\n}, wrapStoreRun = function(store, data, next, transform = defaultTransform) {\n return () => {\n let context;\n try {\n context = transform(data);\n } catch (err) {\n return process.nextTick(() => reportError(err)), next();\n }\n return store.run(context, next);\n };\n}, channel = function(name) {\n const channel2 = channels.get(name);\n if (channel2)\n return channel2;\n if (typeof name !== \"string\" && typeof name !== \"symbol\")\n throw new ERR_INVALID_ARG_TYPE(\"channel\", [\"string\", \"symbol\"], name);\n return new Channel(name);\n}, subscribe = function(name, subscription) {\n return channel(name).subscribe(subscription);\n}, unsubscribe = function(name, subscription) {\n return channel(name).unsubscribe(subscription);\n}, hasSubscribers = function(name) {\n const channel2 = channels.get(name);\n if (!channel2)\n return !1;\n return channel2.hasSubscribers;\n}, assertChannel = function(value, name) {\n if (!(value instanceof Channel))\n throw new ERR_INVALID_ARG_TYPE(name, [\"Channel\"], value);\n}, tracingChannel = function(nameOrChannels) {\n return new TracingChannel(nameOrChannels);\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, $, SafeMap = Map, SafeFinalizationRegistry = FinalizationRegistry, ArrayPrototypeAt = (array, index) => array[index], ArrayPrototypeIndexOf = (array, value) => array.indexOf(value), ArrayPrototypePush = (array, value) => array.push(value), ArrayPrototypeSplice = (array, start, deleteCount) => array.splice(start, deleteCount), ObjectGetPrototypeOf = Object.getPrototypeOf, ObjectSetPrototypeOf = Object.setPrototypeOf, SymbolHasInstance = Symbol.hasInstance, ReflectApply = Reflect.apply, PromiseResolve = Promise.resolve, PromiseReject = Promise.reject, PromisePrototypeThen = (promise, onFulfilled, onRejected) => promise.then(onFulfilled, onRejected);\n\nclass WeakReference extends WeakRef {\n constructor() {\n super(...arguments);\n }\n #refs = 0;\n get() {\n return this.deref();\n }\n incRef() {\n return ++this.#refs;\n }\n decRef() {\n return --this.#refs;\n }\n}\n\nclass WeakRefMap extends SafeMap {\n constructor() {\n super(...arguments);\n }\n #finalizers = new SafeFinalizationRegistry((key) => {\n this.delete(key);\n });\n set(key, value) {\n return this.#finalizers.register(value, key), super.set(key, new WeakReference(value));\n }\n get(key) {\n return super.get(key)\?.get();\n }\n incRef(key) {\n return super.get(key)\?.incRef();\n }\n decRef(key) {\n return super.get(key)\?.decRef();\n }\n}\n\nclass ActiveChannel {\n subscribe(subscription) {\n validateFunction(subscription, \"subscription\"), ArrayPrototypePush(this._subscribers, subscription), channels.incRef(this.name);\n }\n unsubscribe(subscription) {\n const index = ArrayPrototypeIndexOf(this._subscribers, subscription);\n if (index === -1)\n return !1;\n return ArrayPrototypeSplice(this._subscribers, index, 1), channels.decRef(this.name), maybeMarkInactive(this), !0;\n }\n bindStore(store, transform) {\n if (!this._stores.has(store))\n channels.incRef(this.name);\n this._stores.set(store, transform);\n }\n unbindStore(store) {\n if (!this._stores.has(store))\n return !1;\n return this._stores.delete(store), channels.decRef(this.name), maybeMarkInactive(this), !0;\n }\n get hasSubscribers() {\n return !0;\n }\n publish(data) {\n for (let i = 0;i < (this._subscribers\?.length || 0); i++)\n try {\n const onMessage = this._subscribers[i];\n onMessage(data, this.name);\n } catch (err) {\n process.nextTick(() => reportError(err));\n }\n }\n runStores(data, fn, thisArg, ...args) {\n let run = () => {\n return this.publish(data), ReflectApply(fn, thisArg, args);\n };\n for (let entry of this._stores.entries()) {\n const store = entry[0], transform = entry[1];\n run = wrapStoreRun(store, data, run, transform);\n }\n return run();\n }\n}\n\nclass Channel {\n constructor(name) {\n this._subscribers = void 0, this._stores = void 0, this.name = name, channels.set(name, this);\n }\n static [SymbolHasInstance](instance) {\n const prototype = ObjectGetPrototypeOf(instance);\n return prototype === Channel.prototype || prototype === ActiveChannel.prototype;\n }\n subscribe(subscription) {\n markActive(this), this.subscribe(subscription);\n }\n unsubscribe() {\n return !1;\n }\n bindStore(store, transform) {\n markActive(this), this.bindStore(store, transform);\n }\n unbindStore() {\n return !1;\n }\n get hasSubscribers() {\n return !1;\n }\n publish() {\n }\n runStores(data, fn, thisArg, ...args) {\n return ReflectApply(fn, thisArg, args);\n }\n}\nvar channels = new WeakRefMap, traceEvents = [\"start\", \"end\", \"asyncStart\", \"asyncEnd\", \"error\"];\n\nclass TracingChannel {\n constructor(nameOrChannels) {\n if (typeof nameOrChannels === \"string\")\n this.start = channel(`tracing:${nameOrChannels}:start`), this.end = channel(`tracing:${nameOrChannels}:end`), this.asyncStart = channel(`tracing:${nameOrChannels}:asyncStart`), this.asyncEnd = channel(`tracing:${nameOrChannels}:asyncEnd`), this.error = channel(`tracing:${nameOrChannels}:error`);\n else if (typeof nameOrChannels === \"object\") {\n const { start, end, asyncStart, asyncEnd, error } = nameOrChannels;\n assertChannel(start, \"nameOrChannels.start\"), assertChannel(end, \"nameOrChannels.end\"), assertChannel(asyncStart, \"nameOrChannels.asyncStart\"), assertChannel(asyncEnd, \"nameOrChannels.asyncEnd\"), assertChannel(error, \"nameOrChannels.error\"), this.start = start, this.end = end, this.asyncStart = asyncStart, this.asyncEnd = asyncEnd, this.error = error;\n } else\n throw new ERR_INVALID_ARG_TYPE(\"nameOrChannels\", [\"string\", \"object\", \"Channel\"], nameOrChannels);\n }\n subscribe(handlers) {\n for (let name of traceEvents) {\n if (!handlers[name])\n continue;\n this[name]\?.subscribe(handlers[name]);\n }\n }\n unsubscribe(handlers) {\n let done = !0;\n for (let name of traceEvents) {\n if (!handlers[name])\n continue;\n if (!this[name]\?.unsubscribe(handlers[name]))\n done = !1;\n }\n return done;\n }\n traceSync(fn, context = {}, thisArg, ...args) {\n const { start, end, error } = this;\n return start.runStores(context, () => {\n try {\n const result = ReflectApply(fn, thisArg, args);\n return context.result = result, result;\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n tracePromise(fn, context = {}, thisArg, ...args) {\n const { start, end, asyncStart, asyncEnd, error } = this;\n function reject(err) {\n return context.error = err, error.publish(context), asyncStart.publish(context), asyncEnd.publish(context), PromiseReject(err);\n }\n function resolve(result) {\n return context.result = result, asyncStart.publish(context), asyncEnd.publish(context), result;\n }\n return start.runStores(context, () => {\n try {\n let promise = ReflectApply(fn, thisArg, args);\n if (!(promise instanceof Promise))\n promise = PromiseResolve(promise);\n return PromisePrototypeThen(promise, resolve, reject);\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n traceCallback(fn, position = -1, context = {}, thisArg, ...args) {\n const { start, end, asyncStart, asyncEnd, error } = this;\n function wrappedCallback(err, res) {\n if (err)\n context.error = err, error.publish(context);\n else\n context.result = res;\n asyncStart.runStores(context, () => {\n try {\n if (callback)\n return ReflectApply(callback, this, arguments);\n } finally {\n asyncEnd.publish(context);\n }\n });\n }\n const callback = ArrayPrototypeAt(args, position);\n if (typeof callback !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"callback\", [\"function\"], callback);\n return ArrayPrototypeSplice(args, position, 1, wrappedCallback), start.runStores(context, () => {\n try {\n return ReflectApply(fn, thisArg, args);\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n}\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\n$ = {\n channel,\n hasSubscribers,\n subscribe,\n tracingChannel,\n unsubscribe,\n Channel\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeDgramCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/dgram.ts\nvar createSocket = function() {\n throwNotImplemented(\"node:dgram createSocket\", 1630);\n}, Socket = function() {\n throwNotImplemented(\"node:dgram Socket\", 1630);\n}, _createSocketHandle = function() {\n throwNotImplemented(\"node:dgram _createSocketHandle\", 1630);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6);\n$ = {\n createSocket,\n Socket,\n _createSocketHandle\n};\nhideFromStack(createSocket, Socket, _createSocketHandle);\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeDNSCode = "(function (){\"use strict\";// src/js/out/tmp/node/dns.ts\nvar getServers = function() {\n return dns.getServers();\n}, lookup = function(domain, options, callback) {\n if (typeof options == \"function\")\n callback = options;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n if (typeof options == \"number\")\n options = { family: options };\n dns.lookup(domain, options).then((res) => {\n if (res.sort((a, b) => a.family - b.family), options\?.all)\n callback(null, res.map(mapLookupAll));\n else {\n const [{ address, family }] = res;\n callback(null, address, family);\n }\n }, (error) => {\n callback(error);\n });\n}, resolveSrv = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveTxt = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveSoa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNaptr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveMx = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCaa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNs = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolvePtr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCname = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, lookupService = function(address, port, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n callback(null, address, port);\n}, reverse = function(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolve = function(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(({ address }) => address));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n}, Resolver = function(options) {\n return new InternalResolver(options);\n}, setDefaultResultOrder = function() {\n}, setServers = function() {\n}, $, dns = Bun.dns, InternalResolver = class Resolver2 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype, rrtype = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(mapResolveX));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n }\n resolve4(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 4 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(mapResolveX));\n }, (error) => {\n callback(error);\n });\n }\n resolve6(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 6 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(({ address }) => address));\n }, (error) => {\n callback(error);\n });\n }\n resolveAny(hostname, callback) {\n callback(null, []);\n }\n resolveCname(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveMx(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNaptr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNs(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolvePtr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSrv(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveCaa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveTxt(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSoa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n reverse(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n setServers(servers) {\n }\n};\nResolver.prototype = {};\nObject.setPrototypeOf(Resolver.prototype, InternalResolver.prototype);\nObject.setPrototypeOf(Resolver, InternalResolver);\nvar {\n resolve,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNaptr,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n reverse,\n resolveTxt\n} = InternalResolver.prototype, promisifyLookup = (res) => {\n res.sort((a, b) => a.family - b.family);\n const [{ address, family }] = res;\n return { address, family };\n}, mapLookupAll = (res) => {\n const { address, family } = res;\n return { address, family };\n}, promisifyLookupAll = (res) => {\n return res.sort((a, b) => a.family - b.family), res.map(mapLookupAll);\n}, mapResolveX = (a) => a.address, promisifyResolveX = (res) => {\n return res\?.map(mapResolveX);\n}, promises = {\n lookup(domain, options) {\n if (options\?.all)\n return dns.lookup(domain, options).then(promisifyLookupAll);\n return dns.lookup(domain, options).then(promisifyLookup);\n },\n lookupService(address, port) {\n return Promise.resolve([]);\n },\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n },\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n },\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n },\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n },\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n },\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n },\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n },\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n },\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n },\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n },\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n },\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n },\n reverse(ip) {\n return dns.reverse(ip);\n },\n Resolver: class Resolver3 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n }\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n }\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n }\n resolveAny(hostname) {\n return Promise.resolve([]);\n }\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n }\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n }\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n }\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n }\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n }\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n }\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n }\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n }\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n }\n reverse(ip) {\n return dns.reverse(ip);\n }\n setServers(servers) {\n }\n }\n};\nfor (let key of [\"resolveAny\"])\n promises[key] = () => Promise.resolve(void 0);\n$ = {\n ADDRCONFIG: 0,\n ALL: 1,\n V4MAPPED: 2,\n NODATA: \"DNS_ENODATA\",\n FORMERR: \"DNS_EFORMERR\",\n SERVFAIL: \"DNS_ESERVFAIL\",\n NOTFOUND: \"DNS_ENOTFOUND\",\n NOTIMP: \"DNS_ENOTIMP\",\n REFUSED: \"DNS_EREFUSED\",\n BADQUERY: \"DNS_EBADQUERY\",\n BADNAME: \"DNS_EBADNAME\",\n BADFAMILY: \"DNS_EBADFAMILY\",\n BADRESP: \"DNS_EBADRESP\",\n CONNREFUSED: \"DNS_ECONNREFUSED\",\n TIMEOUT: \"DNS_ETIMEOUT\",\n EOF: \"DNS_EEOF\",\n FILE: \"DNS_EFILE\",\n NOMEM: \"DNS_ENOMEM\",\n DESTRUCTION: \"DNS_EDESTRUCTION\",\n BADSTR: \"DNS_EBADSTR\",\n BADFLAGS: \"DNS_EBADFLAGS\",\n NONAME: \"DNS_ENONAME\",\n BADHINTS: \"DNS_EBADHINTS\",\n NOTINITIALIZED: \"DNS_ENOTINITIALIZED\",\n LOADIPHLPAPI: \"DNS_ELOADIPHLPAPI\",\n ADDRGETNETWORKPARAMS: \"DNS_EADDRGETNETWORKPARAMS\",\n CANCELLED: \"DNS_ECANCELLED\",\n lookup,\n lookupService,\n Resolver,\n setServers,\n setDefaultResultOrder,\n resolve,\n reverse,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n resolveTxt,\n resolveNaptr,\n promises,\n getServers\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeDiagnosticsChannelCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/diagnostics_channel.ts\nvar markActive = function(channel) {\n ObjectSetPrototypeOf(channel, ActiveChannel.prototype), channel._subscribers = [], channel._stores = new SafeMap;\n}, maybeMarkInactive = function(channel) {\n if (!channel._subscribers.length && !channel._stores.size)\n ObjectSetPrototypeOf(channel, Channel.prototype), channel._subscribers = @undefined, channel._stores = @undefined;\n}, defaultTransform = function(data) {\n return data;\n}, wrapStoreRun = function(store, data, next, transform = defaultTransform) {\n return () => {\n let context;\n try {\n context = transform(data);\n } catch (err) {\n return process.nextTick(() => reportError(err)), next();\n }\n return store.run(context, next);\n };\n}, channel = function(name) {\n const channel2 = channels.get(name);\n if (channel2)\n return channel2;\n if (typeof name !== \"string\" && typeof name !== \"symbol\")\n throw new ERR_INVALID_ARG_TYPE(\"channel\", [\"string\", \"symbol\"], name);\n return new Channel(name);\n}, subscribe = function(name, subscription) {\n return channel(name).subscribe(subscription);\n}, unsubscribe = function(name, subscription) {\n return channel(name).unsubscribe(subscription);\n}, hasSubscribers = function(name) {\n const channel2 = channels.get(name);\n if (!channel2)\n return !1;\n return channel2.hasSubscribers;\n}, assertChannel = function(value, name) {\n if (!(value instanceof Channel))\n throw new ERR_INVALID_ARG_TYPE(name, [\"Channel\"], value);\n}, tracingChannel = function(nameOrChannels) {\n return new TracingChannel(nameOrChannels);\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, $, SafeMap = Map, SafeFinalizationRegistry = FinalizationRegistry, ArrayPrototypeAt = (array, index) => array[index], ArrayPrototypeIndexOf = (array, value) => array.indexOf(value), ArrayPrototypePush = (array, value) => array.push(value), ArrayPrototypeSplice = (array, start, deleteCount) => array.splice(start, deleteCount), ObjectGetPrototypeOf = Object.getPrototypeOf, ObjectSetPrototypeOf = Object.setPrototypeOf, SymbolHasInstance = Symbol.hasInstance, ReflectApply = @getByIdDirect(Reflect, \"apply\"), PromiseResolve = @Promise.resolve, PromiseReject = @Promise.reject, PromisePrototypeThen = (promise, onFulfilled, onRejected) => promise.then(onFulfilled, onRejected);\n\nclass WeakReference extends WeakRef {\n constructor() {\n super(...arguments);\n }\n #refs = 0;\n get() {\n return this.deref();\n }\n incRef() {\n return ++this.#refs;\n }\n decRef() {\n return --this.#refs;\n }\n}\n\nclass WeakRefMap extends SafeMap {\n constructor() {\n super(...arguments);\n }\n #finalizers = new SafeFinalizationRegistry((key) => {\n this.delete(key);\n });\n set(key, value) {\n return this.#finalizers.register(value, key), super.set(key, new WeakReference(value));\n }\n get(key) {\n return super.get(key)\?.get();\n }\n incRef(key) {\n return super.get(key)\?.incRef();\n }\n decRef(key) {\n return super.get(key)\?.decRef();\n }\n}\n\nclass ActiveChannel {\n subscribe(subscription) {\n validateFunction(subscription, \"subscription\"), ArrayPrototypePush(this._subscribers, subscription), channels.incRef(this.name);\n }\n unsubscribe(subscription) {\n const index = ArrayPrototypeIndexOf(this._subscribers, subscription);\n if (index === -1)\n return !1;\n return ArrayPrototypeSplice(this._subscribers, index, 1), channels.decRef(this.name), maybeMarkInactive(this), !0;\n }\n bindStore(store, transform) {\n if (!this._stores.has(store))\n channels.incRef(this.name);\n this._stores.set(store, transform);\n }\n unbindStore(store) {\n if (!this._stores.has(store))\n return !1;\n return this._stores.delete(store), channels.decRef(this.name), maybeMarkInactive(this), !0;\n }\n get hasSubscribers() {\n return !0;\n }\n publish(data) {\n for (let i = 0;i < (this._subscribers\?.length || 0); i++)\n try {\n const onMessage = this._subscribers[i];\n onMessage(data, this.name);\n } catch (err) {\n process.nextTick(() => reportError(err));\n }\n }\n runStores(data, fn, thisArg, ...args) {\n let run = () => {\n return this.publish(data), ReflectApply(fn, thisArg, args);\n };\n for (let entry of this._stores.entries()) {\n const store = entry[0], transform = entry[1];\n run = wrapStoreRun(store, data, run, transform);\n }\n return run();\n }\n}\n\nclass Channel {\n constructor(name) {\n this._subscribers = @undefined, this._stores = @undefined, this.name = name, channels.set(name, this);\n }\n static [SymbolHasInstance](instance) {\n const prototype = ObjectGetPrototypeOf(instance);\n return prototype === Channel.prototype || prototype === ActiveChannel.prototype;\n }\n subscribe(subscription) {\n markActive(this), this.subscribe(subscription);\n }\n unsubscribe() {\n return !1;\n }\n bindStore(store, transform) {\n markActive(this), this.bindStore(store, transform);\n }\n unbindStore() {\n return !1;\n }\n get hasSubscribers() {\n return !1;\n }\n publish() {\n }\n runStores(data, fn, thisArg, ...args) {\n return ReflectApply(fn, thisArg, args);\n }\n}\nvar channels = new WeakRefMap, traceEvents = [\"start\", \"end\", \"asyncStart\", \"asyncEnd\", \"error\"];\n\nclass TracingChannel {\n constructor(nameOrChannels) {\n if (typeof nameOrChannels === \"string\")\n this.start = channel(`tracing:${nameOrChannels}:start`), this.end = channel(`tracing:${nameOrChannels}:end`), this.asyncStart = channel(`tracing:${nameOrChannels}:asyncStart`), this.asyncEnd = channel(`tracing:${nameOrChannels}:asyncEnd`), this.error = channel(`tracing:${nameOrChannels}:error`);\n else if (typeof nameOrChannels === \"object\") {\n const { start, end, asyncStart, asyncEnd, error } = nameOrChannels;\n assertChannel(start, \"nameOrChannels.start\"), assertChannel(end, \"nameOrChannels.end\"), assertChannel(asyncStart, \"nameOrChannels.asyncStart\"), assertChannel(asyncEnd, \"nameOrChannels.asyncEnd\"), assertChannel(error, \"nameOrChannels.error\"), this.start = start, this.end = end, this.asyncStart = asyncStart, this.asyncEnd = asyncEnd, this.error = error;\n } else\n throw new ERR_INVALID_ARG_TYPE(\"nameOrChannels\", [\"string\", \"object\", \"Channel\"], nameOrChannels);\n }\n subscribe(handlers) {\n for (let name of traceEvents) {\n if (!handlers[name])\n continue;\n this[name]\?.subscribe(handlers[name]);\n }\n }\n unsubscribe(handlers) {\n let done = !0;\n for (let name of traceEvents) {\n if (!handlers[name])\n continue;\n if (!this[name]\?.unsubscribe(handlers[name]))\n done = !1;\n }\n return done;\n }\n traceSync(fn, context = {}, thisArg, ...args) {\n const { start, end, error } = this;\n return start.runStores(context, () => {\n try {\n const result = ReflectApply(fn, thisArg, args);\n return context.result = result, result;\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n tracePromise(fn, context = {}, thisArg, ...args) {\n const { start, end, asyncStart, asyncEnd, error } = this;\n function reject(err) {\n return context.error = err, error.publish(context), asyncStart.publish(context), asyncEnd.publish(context), PromiseReject(err);\n }\n function resolve(result) {\n return context.result = result, asyncStart.publish(context), asyncEnd.publish(context), result;\n }\n return start.runStores(context, () => {\n try {\n let promise = ReflectApply(fn, thisArg, args);\n if (!(promise instanceof @Promise))\n promise = PromiseResolve(promise);\n return PromisePrototypeThen(promise, resolve, reject);\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n traceCallback(fn, position = -1, context = {}, thisArg, ...args) {\n const { start, end, asyncStart, asyncEnd, error } = this;\n function wrappedCallback(err, res) {\n if (err)\n context.error = err, error.publish(context);\n else\n context.result = res;\n asyncStart.runStores(context, () => {\n try {\n if (callback)\n return ReflectApply(callback, this, arguments);\n } finally {\n asyncEnd.publish(context);\n }\n });\n }\n const callback = ArrayPrototypeAt(args, position);\n if (typeof callback !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"callback\", [\"function\"], callback);\n return ArrayPrototypeSplice(args, position, 1, wrappedCallback), start.runStores(context, () => {\n try {\n return ReflectApply(fn, thisArg, args);\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n}\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\n$ = {\n channel,\n hasSubscribers,\n subscribe,\n tracingChannel,\n unsubscribe,\n Channel\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeDNSPromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/dns.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 15) || @createInternalModuleById(15)).promises})\n"_s;
+static constexpr ASCIILiteral NodeDNSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/dns.ts\nvar getServers = function() {\n return dns.getServers();\n}, lookup = function(domain, options, callback) {\n if (typeof options == \"function\")\n callback = options;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n if (typeof options == \"number\")\n options = { family: options };\n if (domain !== domain || typeof domain !== \"number\" && !domain) {\n console.warn(`DeprecationWarning: The provided hostname \"${@String(domain)}\" is not a valid hostname, and is supported in the dns module solely for compatibility.`), callback(null, null, 4);\n return;\n }\n dns.lookup(domain, options).then((res) => {\n if (res.sort((a, b) => a.family - b.family), options\?.all)\n callback(null, res.map(mapLookupAll));\n else {\n const [{ address, family }] = res;\n callback(null, address, family);\n }\n }, (error) => {\n callback(error);\n });\n}, resolveSrv = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveTxt = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveSoa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNaptr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveMx = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCaa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNs = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolvePtr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCname = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, lookupService = function(address, port, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookupService(address, port, callback).then((results) => {\n callback(null, ...results);\n }, (error) => {\n callback(error);\n });\n}, reverse = function(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolve = function(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(({ address }) => address));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n}, Resolver = function(options) {\n return new InternalResolver(options);\n}, setDefaultResultOrder = function() {\n}, setServers = function() {\n}, $, dns = Bun.dns, InternalResolver = class Resolver2 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype, rrtype = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(mapResolveX));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n }\n resolve4(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 4 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(mapResolveX));\n }, (error) => {\n callback(error);\n });\n }\n resolve6(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 6 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(({ address }) => address));\n }, (error) => {\n callback(error);\n });\n }\n resolveAny(hostname, callback) {\n callback(null, []);\n }\n resolveCname(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveMx(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNaptr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNs(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolvePtr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSrv(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveCaa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveTxt(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSoa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n reverse(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n setServers(servers) {\n }\n};\nResolver.prototype = {};\nObject.setPrototypeOf(Resolver.prototype, InternalResolver.prototype);\nObject.setPrototypeOf(Resolver, InternalResolver);\nvar {\n resolve,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNaptr,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n reverse,\n resolveTxt\n} = InternalResolver.prototype, promisifyLookup = (res) => {\n res.sort((a, b) => a.family - b.family);\n const [{ address, family }] = res;\n return { address, family };\n}, mapLookupAll = (res) => {\n const { address, family } = res;\n return { address, family };\n}, promisifyLookupAll = (res) => {\n return res.sort((a, b) => a.family - b.family), res.map(mapLookupAll);\n}, mapResolveX = (a) => a.address, promisifyResolveX = (res) => {\n return res\?.map(mapResolveX);\n}, promises = {\n lookup(domain, options) {\n if (options\?.all)\n return dns.lookup(domain, options).then(promisifyLookupAll);\n return dns.lookup(domain, options).then(promisifyLookup);\n },\n lookupService(address, port) {\n return dns.lookupService(address, port);\n },\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n },\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n },\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n },\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n },\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n },\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n },\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n },\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n },\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n },\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n },\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n },\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n },\n reverse(ip) {\n return dns.reverse(ip);\n },\n Resolver: class Resolver3 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n }\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n }\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n }\n resolveAny(hostname) {\n return @Promise.resolve([]);\n }\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n }\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n }\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n }\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n }\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n }\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n }\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n }\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n }\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n }\n reverse(ip) {\n return dns.reverse(ip);\n }\n setServers(servers) {\n }\n }\n};\nfor (let key of [\"resolveAny\"])\n promises[key] = () => @Promise.resolve(@undefined);\n$ = {\n ADDRCONFIG: 0,\n ALL: 1,\n V4MAPPED: 2,\n NODATA: \"DNS_ENODATA\",\n FORMERR: \"DNS_EFORMERR\",\n SERVFAIL: \"DNS_ESERVFAIL\",\n NOTFOUND: \"DNS_ENOTFOUND\",\n NOTIMP: \"DNS_ENOTIMP\",\n REFUSED: \"DNS_EREFUSED\",\n BADQUERY: \"DNS_EBADQUERY\",\n BADNAME: \"DNS_EBADNAME\",\n BADFAMILY: \"DNS_EBADFAMILY\",\n BADRESP: \"DNS_EBADRESP\",\n CONNREFUSED: \"DNS_ECONNREFUSED\",\n TIMEOUT: \"DNS_ETIMEOUT\",\n EOF: \"DNS_EEOF\",\n FILE: \"DNS_EFILE\",\n NOMEM: \"DNS_ENOMEM\",\n DESTRUCTION: \"DNS_EDESTRUCTION\",\n BADSTR: \"DNS_EBADSTR\",\n BADFLAGS: \"DNS_EBADFLAGS\",\n NONAME: \"DNS_ENONAME\",\n BADHINTS: \"DNS_EBADHINTS\",\n NOTINITIALIZED: \"DNS_ENOTINITIALIZED\",\n LOADIPHLPAPI: \"DNS_ELOADIPHLPAPI\",\n ADDRGETNETWORKPARAMS: \"DNS_EADDRGETNETWORKPARAMS\",\n CANCELLED: \"DNS_ECANCELLED\",\n lookup,\n lookupService,\n Resolver,\n setServers,\n setDefaultResultOrder,\n resolve,\n reverse,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n resolveTxt,\n resolveNaptr,\n promises,\n getServers\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeDomainCode = "(function (){\"use strict\";// src/js/out/tmp/node/domain.ts\nvar EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), domain = {};\ndomain.createDomain = domain.create = function() {\n var d = new EventEmitter;\n function emitError(e) {\n d.emit(\"error\", e);\n }\n return d.add = function(emitter) {\n emitter.on(\"error\", emitError);\n }, d.remove = function(emitter) {\n emitter.removeListener(\"error\", emitError);\n }, d.bind = function(fn) {\n return function() {\n var args = Array.prototype.slice.call(arguments);\n try {\n fn.apply(null, args);\n } catch (err) {\n emitError(err);\n }\n };\n }, d.intercept = function(fn) {\n return function(err) {\n if (err)\n emitError(err);\n else {\n var args = Array.prototype.slice.call(arguments, 1);\n try {\n fn.apply(null, args);\n } catch (err2) {\n emitError(err2);\n }\n }\n };\n }, d.run = function(fn) {\n try {\n fn();\n } catch (err) {\n emitError(err);\n }\n return this;\n }, d.dispose = function() {\n return this.removeAllListeners(), this;\n }, d.enter = d.exit = function() {\n return this;\n }, d;\n};\nreturn domain})\n"_s;
+static constexpr ASCIILiteral NodeDNSPromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/dns.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).promises})\n");
//
//
-static constexpr ASCIILiteral NodeEventsCode = "(function (){\"use strict\";// src/js/out/tmp/node/events.ts\nvar emitError = function(emitter, args) {\n var { _events: events } = emitter;\n if (args[0] \?\?= new Error(\"Unhandled error.\"), !events)\n throw args[0];\n var errorMonitor = events[kErrorMonitor];\n if (errorMonitor)\n for (var handler of ArrayPrototypeSlice.call(errorMonitor))\n handler.apply(emitter, args);\n var handlers = events.error;\n if (!handlers)\n throw args[0];\n for (var handler of ArrayPrototypeSlice.call(handlers))\n handler.apply(emitter, args);\n return !0;\n}, addCatch = function(emitter, promise, type, args) {\n promise.then(void 0, function(err) {\n process.nextTick(emitUnhandledRejectionOrErr, emitter, err, type, args);\n });\n}, emitUnhandledRejectionOrErr = function(emitter, err, type, args) {\n if (typeof emitter[kRejection] === \"function\")\n emitter[kRejection](err, type, ...args);\n else\n try {\n emitter[kCapture] = !1, emitter.emit(\"error\", err);\n } finally {\n emitter[kCapture] = !0;\n }\n}, overflowWarning = function(emitter, type, handlers) {\n handlers.warned = !0;\n const warn = new Error(`Possible EventEmitter memory leak detected. ${handlers.length} ${String(type)} listeners ` + `added to [${emitter.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);\n warn.name = \"MaxListenersExceededWarning\", warn.emitter = emitter, warn.type = type, warn.count = handlers.length, process.emitWarning(warn);\n}, onceWrapper = function(type, listener, ...args) {\n this.removeListener(type, listener), listener.apply(this, args);\n}, once = function(emitter, type, options) {\n var signal = options\?.signal;\n if (validateAbortSignal(signal, \"options.signal\"), signal\?.aborted)\n throw new AbortError(void 0, { cause: signal\?.reason });\n return new Promise((resolve, reject) => {\n const errorListener = (err) => {\n if (emitter.removeListener(type, resolver), signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n reject(err);\n }, resolver = (...args) => {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(\"error\", errorListener);\n if (signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n resolve(args);\n };\n if (eventTargetAgnosticAddListener(emitter, type, resolver, { once: !0 }), type !== \"error\" && typeof emitter.once === \"function\")\n emitter.once(\"error\", errorListener);\n function abortListener() {\n eventTargetAgnosticRemoveListener(emitter, type, resolver), eventTargetAgnosticRemoveListener(emitter, \"error\", errorListener), reject(new AbortError(void 0, { cause: signal\?.reason }));\n }\n if (signal != null)\n eventTargetAgnosticAddListener(signal, \"abort\", abortListener, { once: !0 });\n });\n}, on = function(emitter, type, options) {\n var { signal, close, highWatermark = Number.MAX_SAFE_INTEGER, lowWatermark = 1 } = options || {};\n throwNotImplemented(\"events.on\", 2679);\n}, getEventListeners = function(emitter, type) {\n if (emitter instanceof EventTarget)\n throwNotImplemented(\"getEventListeners with an EventTarget\", 2678);\n return emitter.listeners(type);\n}, setMaxListeners = function(n, ...eventTargets) {\n validateNumber(n, \"setMaxListeners\", 0);\n var length;\n if (eventTargets && (length = eventTargets.length))\n for (let i = 0;i < length; i++)\n eventTargets[i].setMaxListeners(n);\n else\n defaultMaxListeners = n;\n}, listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n}, eventTargetAgnosticRemoveListener = function(emitter, name, listener, flags) {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(name, listener);\n else\n emitter.removeEventListener(name, listener, flags);\n}, eventTargetAgnosticAddListener = function(emitter, name, listener, flags) {\n if (typeof emitter.on === \"function\")\n if (flags.once)\n emitter.once(name, listener);\n else\n emitter.on(name, listener);\n else\n emitter.addEventListener(name, listener, flags);\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_OUT_OF_RANGE = function(name, range, value) {\n const err = new RangeError(`The \"${name}\" argument is out of range. It must be ${range}. Received ${value}`);\n return err.code = \"ERR_OUT_OF_RANGE\", err;\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateNumber = function(value, name, min = void 0, max) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (min != null && value < min || max != null && value > max || (min != null || max != null) && Number.isNaN(value))\n throw new ERR_OUT_OF_RANGE(name, `${min != null \? `>= ${min}` : \"\"}${min != null && max != null \? \" && \" : \"\"}${max != null \? `<= ${max}` : \"\"}`, value);\n}, checkListener = function(listener) {\n if (typeof listener !== \"function\")\n @throwTypeError(\"The listener must be a function\");\n}, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), SymbolFor = Symbol.for, kCapture = Symbol(\"kCapture\"), kErrorMonitor = SymbolFor(\"events.errorMonitor\"), kMaxEventTargetListeners = Symbol(\"events.maxEventTargetListeners\"), kMaxEventTargetListenersWarned = Symbol(\"events.maxEventTargetListenersWarned\"), kWatermarkData = SymbolFor(\"nodejs.watermarkData\"), kRejection = SymbolFor(\"nodejs.rejection\"), captureRejectionSymbol = SymbolFor(\"nodejs.rejection\"), ArrayPrototypeSlice = Array.prototype.slice, defaultMaxListeners = 10, EventEmitter = function EventEmitter2(opts) {\n if (this._events === void 0 || this._events === this.__proto__._events)\n this._events = { __proto__: null }, this._eventsCount = 0;\n if (this._maxListeners \?\?= void 0, this[kCapture] = opts\?.captureRejections \? Boolean(opts\?.captureRejections) : EventEmitterPrototype[kCapture])\n this.emit = emitWithRejectionCapture;\n}, EventEmitterPrototype = EventEmitter.prototype = {};\nEventEmitterPrototype._events = void 0;\nEventEmitterPrototype._eventsCount = 0;\nEventEmitterPrototype._maxListeners = void 0;\nEventEmitterPrototype.setMaxListeners = function setMaxListeners2(n) {\n return validateNumber(n, \"setMaxListeners\", 0), this._maxListeners = n, this;\n};\nEventEmitterPrototype.constructor = EventEmitter;\nEventEmitterPrototype.getMaxListeners = function getMaxListeners() {\n return this._maxListeners \?\? defaultMaxListeners;\n};\nvar emitWithoutRejectionCapture = function emit(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers])\n handler.apply(this, args);\n return !0;\n}, emitWithRejectionCapture = function emit2(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers]) {\n var result = handler.apply(this, args);\n if (result !== void 0 && @isPromise(result))\n addCatch(this, result, type, args);\n }\n return !0;\n};\nEventEmitterPrototype.emit = emitWithoutRejectionCapture;\nEventEmitterPrototype.addListener = function addListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.push(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.on = EventEmitterPrototype.addListener;\nEventEmitterPrototype.prependListener = function prependListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.unshift(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.once = function once2(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.addListener(type, bound), this;\n};\nEventEmitterPrototype.prependOnceListener = function prependOnceListener(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.prependListener(type, bound), this;\n};\nEventEmitterPrototype.removeListener = function removeListener(type, fn) {\n checkListener(fn);\n var { _events: events } = this;\n if (!events)\n return this;\n var handlers = events[type];\n if (!handlers)\n return this;\n var length = handlers.length;\n let position = -1;\n for (let i = length - 1;i >= 0; i--)\n if (handlers[i] === fn || handlers[i].listener === fn) {\n position = i;\n break;\n }\n if (position < 0)\n return this;\n if (position === 0)\n handlers.shift();\n else\n handlers.splice(position, 1);\n if (handlers.length === 0)\n delete events[type], this._eventsCount--;\n return this;\n};\nEventEmitterPrototype.off = EventEmitterPrototype.removeListener;\nEventEmitterPrototype.removeAllListeners = function removeAllListeners(type) {\n var { _events: events } = this;\n if (type && events) {\n if (events[type])\n delete events[type], this._eventsCount--;\n } else\n this._events = { __proto__: null };\n return this;\n};\nEventEmitterPrototype.listeners = function listeners(type) {\n var { _events: events } = this;\n if (!events)\n return [];\n var handlers = events[type];\n if (!handlers)\n return [];\n return handlers.map((x) => x.listener \?\? x);\n};\nEventEmitterPrototype.rawListeners = function rawListeners(type) {\n var { _events } = this;\n if (!_events)\n return [];\n var handlers = _events[type];\n if (!handlers)\n return [];\n return handlers.slice();\n};\nEventEmitterPrototype.listenerCount = function listenerCount2(type) {\n var { _events: events } = this;\n if (!events)\n return 0;\n return events[type]\?.length \?\? 0;\n};\nEventEmitterPrototype.eventNames = function eventNames() {\n return this._eventsCount > 0 \? Reflect.ownKeys(this._events) : [];\n};\nEventEmitterPrototype[kCapture] = !1;\n\nclass AbortError extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n}\nvar AsyncResource = null;\n\nclass EventEmitterAsyncResource extends EventEmitter {\n triggerAsyncId;\n asyncResource;\n constructor(options) {\n if (!AsyncResource)\n AsyncResource = (@getInternalField(@internalModuleRegistry, 8) || @createInternalModuleById(8)).AsyncResource;\n var { captureRejections = !1, triggerAsyncId, name = new.target.name, requireManualDestroy } = options || {};\n super({ captureRejections });\n this.triggerAsyncId = triggerAsyncId \?\? 0, this.asyncResource = new AsyncResource(name, { triggerAsyncId, requireManualDestroy });\n }\n emit(...args) {\n this.asyncResource.runInAsyncScope(() => super.emit(...args));\n }\n emitDestroy() {\n this.asyncResource.emitDestroy();\n }\n}\nObject.defineProperties(EventEmitter, {\n captureRejections: {\n get() {\n return EventEmitterPrototype[kCapture];\n },\n set(value) {\n validateBoolean(value, \"EventEmitter.captureRejections\"), EventEmitterPrototype[kCapture] = value;\n },\n enumerable: !0\n },\n defaultMaxListeners: {\n enumerable: !0,\n get: () => {\n return defaultMaxListeners;\n },\n set: (arg) => {\n validateNumber(arg, \"defaultMaxListeners\", 0), defaultMaxListeners = arg;\n }\n },\n kMaxEventTargetListeners: {\n value: kMaxEventTargetListeners,\n enumerable: !1,\n configurable: !1,\n writable: !1\n },\n kMaxEventTargetListenersWarned: {\n value: kMaxEventTargetListenersWarned,\n enumerable: !1,\n configurable: !1,\n writable: !1\n }\n});\nObject.assign(EventEmitter, {\n once,\n on,\n getEventListeners,\n setMaxListeners,\n EventEmitter,\n usingDomains: !1,\n captureRejectionSymbol,\n EventEmitterAsyncResource,\n errorMonitor: kErrorMonitor,\n setMaxListeners,\n init: EventEmitter,\n listenerCount\n});\nreturn EventEmitter})\n"_s;
+static constexpr ASCIILiteral NodeDomainCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/domain.ts\nvar EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), domain = {};\ndomain.createDomain = domain.create = function() {\n var d = new EventEmitter;\n function emitError(e) {\n d.emit(\"error\", e);\n }\n return d.add = function(emitter) {\n emitter.on(\"error\", emitError);\n }, d.remove = function(emitter) {\n emitter.removeListener(\"error\", emitError);\n }, d.bind = function(fn) {\n return function() {\n var args = @Array.prototype.slice.@call(arguments);\n try {\n fn.@apply(null, args);\n } catch (err) {\n emitError(err);\n }\n };\n }, d.intercept = function(fn) {\n return function(err) {\n if (err)\n emitError(err);\n else {\n var args = @Array.prototype.slice.@call(arguments, 1);\n try {\n fn.@apply(null, args);\n } catch (err2) {\n emitError(err2);\n }\n }\n };\n }, d.run = function(fn) {\n try {\n fn();\n } catch (err) {\n emitError(err);\n }\n return this;\n }, d.dispose = function() {\n return this.removeAllListeners(), this;\n }, d.enter = d.exit = function() {\n return this;\n }, d;\n};\nreturn domain})\n");
//
//
-static constexpr ASCIILiteral NodeFSCode = "(function (){\"use strict\";// src/js/out/tmp/node/fs.ts\nvar getValidatedPath = function(p) {\n if (p instanceof URL)\n return Bun.fileURLToPath(p);\n if (typeof p !== \"string\")\n @throwTypeError(\"Path must be a string or URL.\");\n return (_pathModule \?\?= @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28)).resolve(p);\n}, watchFile = function(filename, options, listener) {\n if (filename = getValidatedPath(filename), typeof options === \"function\")\n listener = options, options = {};\n if (typeof listener !== \"function\")\n @throwTypeError(\"listener must be a function\");\n var stat = statWatchers.get(filename);\n if (!stat)\n stat = new StatWatcher(filename, options), statWatchers.set(filename, stat);\n return stat.addListener(\"change\", listener), stat;\n}, unwatchFile = function(filename, listener) {\n filename = getValidatedPath(filename);\n var stat = statWatchers.get(filename);\n if (!stat)\n return;\n if (listener) {\n if (stat.removeListener(\"change\", listener), stat.listenerCount(\"change\") !== 0)\n return;\n } else\n stat.removeAllListeners(\"change\");\n stat.stop(), statWatchers.delete(filename);\n}, callbackify = function(fsFunction, args) {\n try {\n const result = fsFunction.apply(fs, args.slice(0, args.length - 1)), callback = args[args.length - 1];\n if (typeof callback === \"function\")\n queueMicrotask(() => callback(null, result));\n } catch (e) {\n const callback = args[args.length - 1];\n if (typeof callback === \"function\")\n queueMicrotask(() => callback(e));\n }\n}, createReadStream = function(path, options) {\n return new ReadStream(path, options);\n}, WriteStream_handleWrite = function(er, bytes) {\n if (er)\n return WriteStream_errorOrDestroy.call(this, er);\n this.bytesWritten += bytes;\n}, WriteStream_internalClose = function(err, cb) {\n this[_writeStreamPathFastPathSymbol] = !1;\n var fd = this.fd;\n this[_fs].close(fd, (er) => {\n this.fd = null, cb(err || er);\n });\n}, WriteStream_errorOrDestroy = function(err) {\n var {\n _readableState: r = { destroyed: !1, autoDestroy: !1 },\n _writableState: w = { destroyed: !1, autoDestroy: !1 }\n } = this;\n if (w\?.destroyed || r\?.destroyed)\n return this;\n if (r\?.autoDestroy || w\?.autoDestroy)\n this.destroy(err);\n else if (err)\n this.emit(\"error\", err);\n}, createWriteStream = function(path, options) {\n return new WriteStream(path, options);\n}, cpSync = function(src, dest, options) {\n if (!options)\n return fs.cpSync(src, dest);\n if (typeof options !== \"object\")\n @throwTypeError(\"options must be an object\");\n if (options.dereference || options.filter || options.preserveTimestamps || options.verbatimSymlinks) {\n if (!lazy_cpSync)\n lazy_cpSync = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3);\n return lazy_cpSync(src, dest, options);\n }\n return fs.cpSync(src, dest, options.recursive, options.errorOnExist, options.force \?\? !0, options.mode);\n}, cp = function(src, dest, options, callback) {\n if (typeof options === \"function\")\n callback = options, options = void 0;\n promises.cp(src, dest, options).then(() => callback(), callback);\n}, _toUnixTimestamp = function(time, name = \"time\") {\n if (typeof time === \"string\" && +time == time)\n return +time;\n if (NumberIsFinite(time)) {\n if (time < 0)\n return DateNow() / 1000;\n return time;\n }\n if (isDate(time))\n return DatePrototypeGetTime(time) / 1000;\n @throwTypeError(`Expected ${name} to be a number or Date`);\n}, $, ReadStream, WriteStream, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), promises = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), Stream = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), { isArrayBufferView } = @requireNativeModule(\"util/types\"), _writeStreamPathFastPathSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPath\"), _fs = Symbol.for(\"#fs\"), constants = @processBindingConstants.fs, fs = Bun.fs();\n\nclass FSWatcher extends EventEmitter {\n #watcher;\n #listener;\n constructor(path, options, listener) {\n super();\n if (typeof options === \"function\")\n listener = options, options = {};\n else if (typeof options === \"string\")\n options = { encoding: options };\n if (typeof listener !== \"function\")\n listener = () => {\n };\n this.#listener = listener;\n try {\n this.#watcher = fs.watch(path, options || {}, this.#onEvent.bind(this));\n } catch (e) {\n if (!e.message\?.startsWith(\"FileNotFound\"))\n throw e;\n const notFound = new Error(`ENOENT: no such file or directory, watch '${path}'`);\n throw notFound.code = \"ENOENT\", notFound.errno = -2, notFound.path = path, notFound.syscall = \"watch\", notFound.filename = path, notFound;\n }\n }\n #onEvent(eventType, filenameOrError) {\n if (eventType === \"error\" || eventType === \"close\")\n this.emit(eventType, filenameOrError);\n else\n this.emit(\"change\", eventType, filenameOrError), this.#listener(eventType, filenameOrError);\n }\n close() {\n this.#watcher\?.close(), this.#watcher = null;\n }\n ref() {\n this.#watcher\?.ref();\n }\n unref() {\n this.#watcher\?.unref();\n }\n start() {\n }\n}\n\nclass StatWatcher extends EventEmitter {\n constructor(path, options) {\n super();\n this._handle = fs.watchFile(path, options, this.#onChange.bind(this));\n }\n #onChange(curr, prev) {\n this.emit(\"change\", curr, prev);\n }\n start() {\n }\n stop() {\n this._handle\?.close(), this._handle = null;\n }\n ref() {\n this._handle\?.ref();\n }\n unref() {\n this._handle\?.unref();\n }\n}\nvar access = function access2(...args) {\n callbackify(fs.accessSync, args);\n}, appendFile = function appendFile2(...args) {\n callbackify(fs.appendFileSync, args);\n}, close = function close2(...args) {\n callbackify(fs.closeSync, args);\n}, rm = function rm2(...args) {\n callbackify(fs.rmSync, args);\n}, rmdir = function rmdir2(...args) {\n callbackify(fs.rmdirSync, args);\n}, copyFile = function copyFile2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.copyFile(...args).then((result) => callback(null, result), callback);\n}, exists = function exists2(...args) {\n callbackify(fs.existsSync, args);\n}, chown = function chown2(...args) {\n callbackify(fs.chownSync, args);\n}, chmod = function chmod2(...args) {\n callbackify(fs.chmodSync, args);\n}, fchmod = function fchmod2(...args) {\n callbackify(fs.fchmodSync, args);\n}, fchown = function fchown2(...args) {\n callbackify(fs.fchownSync, args);\n}, fstat = function fstat2(...args) {\n callbackify(fs.fstatSync, args);\n}, fsync = function fsync2(...args) {\n callbackify(fs.fsyncSync, args);\n}, ftruncate = function ftruncate2(...args) {\n callbackify(fs.ftruncateSync, args);\n}, futimes = function futimes2(...args) {\n callbackify(fs.futimesSync, args);\n}, lchmod = function lchmod2(...args) {\n callbackify(fs.lchmodSync, args);\n}, lchown = function lchown2(...args) {\n callbackify(fs.lchownSync, args);\n}, link = function link2(...args) {\n callbackify(fs.linkSync, args);\n}, mkdir = function mkdir2(...args) {\n callbackify(fs.mkdirSync, args);\n}, mkdtemp = function mkdtemp2(...args) {\n callbackify(fs.mkdtempSync, args);\n}, open = function open2(...args) {\n callbackify(fs.openSync, args);\n}, read = function read2(fd, buffer, offsetOrOptions, length, position, callback) {\n let offset = offsetOrOptions, params = null;\n if (arguments.length <= 4) {\n if (arguments.length === 4)\n callback = length, params = offsetOrOptions;\n else if (arguments.length === 3) {\n if (!isArrayBufferView(buffer))\n params = buffer, { buffer = Buffer.alloc(16384) } = params \?\? {};\n callback = offsetOrOptions;\n } else\n callback = buffer, buffer = Buffer.alloc(16384);\n ({ offset = 0, length = buffer\?.byteLength - offset, position = null } = params \?\? {});\n }\n queueMicrotask(() => {\n try {\n var bytesRead = fs.readSync(fd, buffer, offset, length, position);\n } catch (e) {\n callback(e);\n }\n callback(null, bytesRead, buffer);\n });\n}, write = function write2(...args) {\n callbackify(fs.writeSync, args);\n}, readdir = function readdir2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.readdir(...args).then((result) => callback(null, result), callback);\n}, readFile = function readFile2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.readFile(...args).then((result) => callback(null, result), callback);\n}, writeFile = function writeFile2(...args) {\n callbackify(fs.writeFileSync, args);\n}, readlink = function readlink2(...args) {\n callbackify(fs.readlinkSync, args);\n}, realpath = function realpath2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.realpath(...args).then((result) => callback(null, result), callback);\n}, rename = function rename2(...args) {\n callbackify(fs.renameSync, args);\n}, lstat = function lstat2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.lstat(...args).then((result) => callback(null, result), callback);\n}, stat = function stat2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.stat(...args).then((result) => callback(null, result), callback);\n}, symlink = function symlink2(...args) {\n callbackify(fs.symlinkSync, args);\n}, truncate = function truncate2(...args) {\n callbackify(fs.truncateSync, args);\n}, unlink = function unlink2(...args) {\n callbackify(fs.unlinkSync, args);\n}, utimes = function utimes2(...args) {\n callbackify(fs.utimesSync, args);\n}, lutimes = function lutimes2(...args) {\n callbackify(fs.lutimesSync, args);\n}, accessSync = fs.accessSync.bind(fs), appendFileSync = fs.appendFileSync.bind(fs), closeSync = fs.closeSync.bind(fs), copyFileSync = fs.copyFileSync.bind(fs), existsSync = fs.existsSync.bind(fs), chownSync = fs.chownSync.bind(fs), chmodSync = fs.chmodSync.bind(fs), fchmodSync = fs.fchmodSync.bind(fs), fchownSync = fs.fchownSync.bind(fs), fstatSync = fs.fstatSync.bind(fs), fsyncSync = fs.fsyncSync.bind(fs), ftruncateSync = fs.ftruncateSync.bind(fs), futimesSync = fs.futimesSync.bind(fs), lchmodSync = fs.lchmodSync.bind(fs), lchownSync = fs.lchownSync.bind(fs), linkSync = fs.linkSync.bind(fs), lstatSync = fs.lstatSync.bind(fs), mkdirSync = fs.mkdirSync.bind(fs), mkdtempSync = fs.mkdtempSync.bind(fs), openSync = fs.openSync.bind(fs), readSync = fs.readSync.bind(fs), writeSync = fs.writeSync.bind(fs), readdirSync = fs.readdirSync.bind(fs), readFileSync = fs.readFileSync.bind(fs), writeFileSync = fs.writeFileSync.bind(fs), readlinkSync = fs.readlinkSync.bind(fs), realpathSync = fs.realpathSync.bind(fs), renameSync = fs.renameSync.bind(fs), statSync = fs.statSync.bind(fs), symlinkSync = fs.symlinkSync.bind(fs), truncateSync = fs.truncateSync.bind(fs), unlinkSync = fs.unlinkSync.bind(fs), utimesSync = fs.utimesSync.bind(fs), lutimesSync = fs.lutimesSync.bind(fs), rmSync = fs.rmSync.bind(fs), rmdirSync = fs.rmdirSync.bind(fs), writev = (fd, buffers, position, callback) => {\n if (typeof position === \"function\")\n callback = position, position = null;\n queueMicrotask(() => {\n try {\n var written = fs.writevSync(fd, buffers, position);\n } catch (e) {\n callback(e);\n }\n callback(null, written, buffers);\n });\n}, writevSync = fs.writevSync.bind(fs), readv = (fd, buffers, position, callback) => {\n if (typeof position === \"function\")\n callback = position, position = null;\n queueMicrotask(() => {\n try {\n var written = fs.readvSync(fd, buffers, position);\n } catch (e) {\n callback(e);\n }\n callback(null, written, buffers);\n });\n}, readvSync = fs.readvSync.bind(fs), Dirent = fs.Dirent, Stats = fs.Stats, watch = function watch2(path, options, listener) {\n return new FSWatcher(path, options, listener);\n}, statWatchers = new Map, _pathModule, readStreamPathFastPathSymbol = Symbol.for(\"Bun.Node.readStreamPathFastPath\"), readStreamSymbol = Symbol.for(\"Bun.NodeReadStream\"), readStreamPathOrFdSymbol = Symbol.for(\"Bun.NodeReadStreamPathOrFd\"), writeStreamSymbol = Symbol.for(\"Bun.NodeWriteStream\"), writeStreamPathFastPathSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPath\"), writeStreamPathFastPathCallSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPathCall\"), kIoDone = Symbol.for(\"kIoDone\"), defaultReadStreamOptions = {\n file: void 0,\n fd: null,\n flags: \"r\",\n encoding: void 0,\n mode: 438,\n autoClose: !0,\n emitClose: !0,\n start: 0,\n end: Infinity,\n highWaterMark: 65536,\n fs: {\n read,\n open: (path, flags, mode, cb) => {\n var fd;\n try {\n fd = openSync(path, flags, mode);\n } catch (e) {\n cb(e);\n return;\n }\n cb(null, fd);\n },\n openSync,\n close\n },\n autoDestroy: !0\n}, ReadStreamClass;\nReadStream = function(InternalReadStream) {\n ReadStreamClass = InternalReadStream, Object.defineProperty(ReadStreamClass.prototype, Symbol.toStringTag, {\n value: \"ReadStream\",\n enumerable: !1\n });\n function ReadStream3(path, options) {\n return new InternalReadStream(path, options);\n }\n return ReadStream3.prototype = InternalReadStream.prototype, Object.defineProperty(ReadStream3, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalReadStream;\n }\n });\n}(class ReadStream2 extends Stream._getNativeReadableStreamPrototype(2, Stream.Readable) {\n constructor(pathOrFd, options = defaultReadStreamOptions) {\n if (typeof options !== \"object\" || !options)\n @throwTypeError(\"Expected options to be an object\");\n var {\n flags = defaultReadStreamOptions.flags,\n encoding = defaultReadStreamOptions.encoding,\n mode = defaultReadStreamOptions.mode,\n autoClose = defaultReadStreamOptions.autoClose,\n emitClose = defaultReadStreamOptions.emitClose,\n start = defaultReadStreamOptions.start,\n end = defaultReadStreamOptions.end,\n autoDestroy = defaultReadStreamOptions.autoClose,\n fs: fs2 = defaultReadStreamOptions.fs,\n highWaterMark = defaultReadStreamOptions.highWaterMark,\n fd = defaultReadStreamOptions.fd\n } = options;\n if (pathOrFd\?.constructor\?.name === \"URL\")\n pathOrFd = Bun.fileURLToPath(pathOrFd);\n var tempThis = {};\n if (fd != null) {\n if (typeof fd !== \"number\")\n @throwTypeError(\"Expected options.fd to be a number\");\n tempThis.fd = tempThis[readStreamPathOrFdSymbol] = fd, tempThis.autoClose = !1;\n } else if (typeof pathOrFd === \"string\") {\n if (pathOrFd.startsWith(\"file://\"))\n pathOrFd = Bun.fileURLToPath(pathOrFd);\n if (pathOrFd.length === 0)\n @throwTypeError(\"Expected path to be a non-empty string\");\n tempThis.path = tempThis.file = tempThis[readStreamPathOrFdSymbol] = pathOrFd;\n } else if (typeof pathOrFd === \"number\") {\n if (pathOrFd |= 0, pathOrFd < 0)\n @throwTypeError(\"Expected fd to be a positive integer\");\n tempThis.fd = tempThis[readStreamPathOrFdSymbol] = pathOrFd, tempThis.autoClose = !1;\n } else\n @throwTypeError(\"Expected a path or file descriptor\");\n if (tempThis.fd === void 0)\n tempThis.fd = fs2.openSync(pathOrFd, flags, mode);\n var fileRef = Bun.file(tempThis.fd), stream = fileRef.stream(), native = @direct(stream);\n if (!native)\n throw new Error(\"no native readable stream\");\n var { stream: ptr } = native;\n super(ptr, {\n ...options,\n encoding,\n autoDestroy,\n autoClose,\n emitClose,\n highWaterMark\n });\n if (Object.assign(this, tempThis), this.#fileRef = fileRef, this.end = end, this._read = this.#internalRead, this.start = start, this.flags = flags, this.mode = mode, this.emitClose = emitClose, this[readStreamPathFastPathSymbol] = start === 0 && end === Infinity && autoClose && fs2 === defaultReadStreamOptions.fs && (encoding === \"buffer\" || encoding === \"binary\" || encoding == null || encoding === \"utf-8\" || encoding === \"utf8\"), this._readableState.autoClose = autoDestroy = autoClose, this._readableState.highWaterMark = highWaterMark, start !== void 0)\n this.pos = start;\n }\n #fileRef;\n #fs;\n file;\n path;\n fd = null;\n flags;\n mode;\n start;\n end;\n pos;\n bytesRead = 0;\n #fileSize = -1;\n _read;\n [readStreamSymbol] = !0;\n [readStreamPathOrFdSymbol];\n [readStreamPathFastPathSymbol];\n _construct(callback) {\n if (super._construct)\n super._construct(callback);\n else\n callback();\n this.emit(\"open\", this.fd), this.emit(\"ready\");\n }\n _destroy(err, cb) {\n super._destroy(err, cb);\n try {\n var fd = this.fd;\n if (this[readStreamPathFastPathSymbol] = !1, !fd)\n cb(err);\n else\n this.#fs.close(fd, (er) => {\n cb(er || err);\n }), this.fd = null;\n } catch (e) {\n throw e;\n }\n }\n close(cb) {\n if (typeof cb === \"function\")\n Stream.eos(this, cb);\n this.destroy();\n }\n push(chunk) {\n var bytesRead = chunk\?.length \?\? 0;\n if (bytesRead > 0) {\n this.bytesRead += bytesRead;\n var currPos = this.pos;\n if (currPos !== void 0) {\n if (this.bytesRead < currPos)\n return !0;\n if (currPos === this.start) {\n var n = this.bytesRead - currPos;\n chunk = chunk.slice(-n);\n var [_, ...rest] = arguments;\n if (this.pos = this.bytesRead, this.end !== void 0 && this.bytesRead > this.end)\n chunk = chunk.slice(0, this.end - this.start + 1);\n return super.push(chunk, ...rest);\n }\n var end = this.end;\n if (end !== void 0 && this.bytesRead > end) {\n chunk = chunk.slice(0, end - currPos + 1);\n var [_, ...rest] = arguments;\n return this.pos = this.bytesRead, super.push(chunk, ...rest);\n }\n this.pos = this.bytesRead;\n }\n }\n return super.push(...arguments);\n }\n #internalRead(n) {\n var { pos, end, bytesRead, fd, encoding } = this;\n if (n = pos !== void 0 \? Math.min(end - pos + 1, n) : Math.min(end - bytesRead + 1, n), n <= 0) {\n this.push(null);\n return;\n }\n if (this.#fileSize === -1 && bytesRead === 0 && pos === void 0) {\n var stat3 = fstatSync(fd);\n if (this.#fileSize = stat3.size, this.#fileSize > 0 && n > this.#fileSize)\n n = this.#fileSize + 1;\n }\n this[kIoDone] = !1;\n var res = super._read(n);\n if (@isPromise(res)) {\n var then = res\?.then;\n if (then && @isCallable(then))\n res.then(() => {\n if (this[kIoDone] = !0, this.destroyed)\n this.emit(kIoDone);\n }, (er) => {\n this[kIoDone] = !0, this.#errorOrDestroy(er);\n });\n } else if (this[kIoDone] = !0, this.destroyed)\n this.emit(kIoDone), this.#errorOrDestroy(new Error(\"ERR_STREAM_PREMATURE_CLOSE\"));\n }\n #errorOrDestroy(err, sync = null) {\n var {\n _readableState: r = { destroyed: !1, autoDestroy: !1 },\n _writableState: w = { destroyed: !1, autoDestroy: !1 }\n } = this;\n if (w\?.destroyed || r\?.destroyed)\n return this;\n if (r\?.autoDestroy || w\?.autoDestroy)\n this.destroy(err);\n else if (err)\n this.emit(\"error\", err);\n }\n pause() {\n return this[readStreamPathFastPathSymbol] = !1, super.pause();\n }\n resume() {\n return this[readStreamPathFastPathSymbol] = !1, super.resume();\n }\n unshift(...args) {\n return this[readStreamPathFastPathSymbol] = !1, super.unshift(...args);\n }\n pipe(dest, pipeOpts) {\n if (this[readStreamPathFastPathSymbol] && (pipeOpts\?.end \?\? !0) && this._readableState\?.pipes\?.length === 0) {\n if ((writeStreamPathFastPathSymbol in dest) && dest[writeStreamPathFastPathSymbol]) {\n if (dest[writeStreamPathFastPathCallSymbol](this, pipeOpts))\n return this;\n }\n }\n return this[readStreamPathFastPathSymbol] = !1, super.pipe(dest, pipeOpts);\n }\n});\nvar defaultWriteStreamOptions = {\n fd: null,\n start: void 0,\n pos: void 0,\n encoding: void 0,\n flags: \"w\",\n mode: 438,\n fs: {\n write,\n close,\n open,\n openSync\n }\n}, WriteStreamClass = WriteStream = function WriteStream2(path, options = defaultWriteStreamOptions) {\n if (!(this instanceof WriteStream2))\n return new WriteStream2(path, options);\n if (!options)\n @throwTypeError(\"Expected options to be an object\");\n var {\n fs: fs2 = defaultWriteStreamOptions.fs,\n start = defaultWriteStreamOptions.start,\n flags = defaultWriteStreamOptions.flags,\n mode = defaultWriteStreamOptions.mode,\n autoClose = !0,\n emitClose = !1,\n autoDestroy = autoClose,\n encoding = defaultWriteStreamOptions.encoding,\n fd = defaultWriteStreamOptions.fd,\n pos = defaultWriteStreamOptions.pos\n } = options, tempThis = {};\n if (fd != null) {\n if (typeof fd !== \"number\")\n throw new Error(\"Expected options.fd to be a number\");\n tempThis.fd = fd, tempThis[_writeStreamPathFastPathSymbol] = !1;\n } else if (typeof path === \"string\") {\n if (path.length === 0)\n @throwTypeError(\"Expected a non-empty path\");\n if (path.startsWith(\"file:\"))\n path = Bun.fileURLToPath(path);\n tempThis.path = path, tempThis.fd = null, tempThis[_writeStreamPathFastPathSymbol] = autoClose && (start === void 0 || start === 0) && fs2.write === defaultWriteStreamOptions.fs.write && fs2.close === defaultWriteStreamOptions.fs.close;\n }\n if (tempThis.fd == null)\n tempThis.fd = fs2.openSync(path, flags, mode);\n if (NativeWritable.call(this, tempThis.fd, {\n ...options,\n decodeStrings: !1,\n autoDestroy,\n emitClose,\n fd: tempThis\n }), Object.assign(this, tempThis), typeof fs2\?.write !== \"function\")\n @throwTypeError(\"Expected fs.write to be a function\");\n if (typeof fs2\?.close !== \"function\")\n @throwTypeError(\"Expected fs.close to be a function\");\n if (typeof fs2\?.open !== \"function\")\n @throwTypeError(\"Expected fs.open to be a function\");\n if (typeof path === \"object\" && path) {\n if (path instanceof URL)\n path = Bun.fileURLToPath(path);\n }\n if (typeof path !== \"string\" && typeof fd !== \"number\")\n @throwTypeError(\"Expected a path or file descriptor\");\n if (this.start = start, this[_fs] = fs2, this.flags = flags, this.mode = mode, this.bytesWritten = 0, this[writeStreamSymbol] = !0, this[kIoDone] = !1, this.start !== void 0)\n this.pos = this.start;\n if (encoding !== defaultWriteStreamOptions.encoding) {\n if (this.setDefaultEncoding(encoding), encoding !== \"buffer\" && encoding !== \"utf8\" && encoding !== \"utf-8\" && encoding !== \"binary\")\n this[_writeStreamPathFastPathSymbol] = !1;\n }\n return this;\n}, NativeWritable = Stream.NativeWritable, WriteStreamPrototype = WriteStream.prototype = Object.create(NativeWritable.prototype);\nObject.defineProperties(WriteStreamPrototype, {\n autoClose: {\n get() {\n return this._writableState.autoDestroy;\n },\n set(val) {\n this._writableState.autoDestroy = val;\n }\n },\n pending: {\n get() {\n return this.fd === null;\n }\n }\n});\nWriteStreamPrototype.destroySoon = WriteStreamPrototype.end;\nWriteStreamPrototype.open = function open3() {\n};\nWriteStreamPrototype[writeStreamPathFastPathCallSymbol] = function WriteStreamPathFastPathCallSymbol(readStream, pipeOpts) {\n if (!this[_writeStreamPathFastPathSymbol])\n return !1;\n if (this.fd !== null)\n return this[_writeStreamPathFastPathSymbol] = !1, !1;\n return this[kIoDone] = !1, readStream[kIoDone] = !1, Bun.write(this[_writeStreamPathFastPathSymbol], readStream[readStreamPathOrFdSymbol]).then((bytesWritten) => {\n readStream[kIoDone] = this[kIoDone] = !0, this.bytesWritten += bytesWritten, readStream.bytesRead += bytesWritten, this.end(), readStream.close();\n }, (err) => {\n readStream[kIoDone] = this[kIoDone] = !0, WriteStream_errorOrDestroy.call(this, err), readStream.emit(\"error\", err);\n });\n};\nWriteStreamPrototype.isBunFastPathEnabled = function isBunFastPathEnabled() {\n return this[_writeStreamPathFastPathSymbol];\n};\nWriteStreamPrototype.disableBunFastPath = function disableBunFastPath() {\n this[_writeStreamPathFastPathSymbol] = !1;\n};\nWriteStreamPrototype._construct = function _construct(callback) {\n if (typeof this.fd === \"number\") {\n callback();\n return;\n }\n callback(), this.emit(\"open\", this.fd), this.emit(\"ready\");\n};\nWriteStreamPrototype._destroy = function _destroy(err, cb) {\n if (this.fd === null)\n return cb(err);\n if (this[kIoDone]) {\n this.once(kIoDone, () => WriteStream_internalClose.call(this, err, cb));\n return;\n }\n WriteStream_internalClose.call(this, err, cb);\n};\nWriteStreamPrototype.close = function close3(cb) {\n if (cb) {\n if (this.closed) {\n process.nextTick(cb);\n return;\n }\n this.on(\"close\", cb);\n }\n if (!this.autoClose)\n this.on(\"finish\", this.destroy);\n this.end();\n};\nWriteStreamPrototype.write = function write3(chunk, encoding, cb) {\n if (encoding \?\?= this._writableState\?.defaultEncoding, this[_writeStreamPathFastPathSymbol] = !1, typeof chunk === \"string\")\n chunk = Buffer.from(chunk, encoding);\n var native = this.pos === void 0;\n const callback = native \? (err, bytes) => {\n if (this[kIoDone] = !1, WriteStream_handleWrite.call(this, err, bytes), this.emit(kIoDone), cb)\n !err \? cb() : cb(err);\n } : () => {\n };\n if (this[kIoDone] = !0, this._write)\n return this._write(chunk, encoding, callback);\n else\n return NativeWritable.prototype.write.call(this, chunk, encoding, callback, native);\n};\nWriteStreamPrototype._write = void 0;\nWriteStreamPrototype._writev = void 0;\nWriteStreamPrototype.end = function end(chunk, encoding, cb) {\n var native = this.pos === void 0;\n return NativeWritable.prototype.end.call(this, chunk, encoding, cb, native);\n};\nWriteStreamPrototype._destroy = function _destroy2(err, cb) {\n this.close(err, cb);\n};\nObject.defineProperties(fs, {\n createReadStream: {\n value: createReadStream\n },\n createWriteStream: {\n value: createWriteStream\n },\n ReadStream: {\n value: ReadStream\n },\n WriteStream: {\n value: WriteStream\n }\n});\nrealpath.native = realpath;\nrealpathSync.native = realpathSync;\nvar lazy_cpSync = null;\n$ = {\n Dirent,\n FSWatcher,\n ReadStream,\n Stats,\n WriteStream,\n _toUnixTimestamp,\n access,\n accessSync,\n appendFile,\n appendFileSync,\n chmod,\n chmodSync,\n chown,\n chownSync,\n close,\n closeSync,\n constants,\n copyFile,\n copyFileSync,\n cp,\n cpSync,\n createReadStream,\n createWriteStream,\n exists,\n existsSync,\n fchmod,\n fchmodSync,\n fchown,\n fchownSync,\n fstat,\n fstatSync,\n fsync,\n fsyncSync,\n ftruncate,\n ftruncateSync,\n futimes,\n futimesSync,\n lchmod,\n lchmodSync,\n lchown,\n lchownSync,\n link,\n linkSync,\n lstat,\n lstatSync,\n lutimes,\n lutimesSync,\n mkdir,\n mkdirSync,\n mkdtemp,\n mkdtempSync,\n open,\n openSync,\n promises,\n read,\n readFile,\n readFileSync,\n readSync,\n readdir,\n readdirSync,\n readlink,\n readlinkSync,\n readv,\n readvSync,\n realpath,\n realpathSync,\n rename,\n renameSync,\n rm,\n rmSync,\n rmdir,\n rmdirSync,\n stat,\n statSync,\n symlink,\n symlinkSync,\n truncate,\n truncateSync,\n unlink,\n unlinkSync,\n unwatchFile,\n utimes,\n utimesSync,\n watch,\n watchFile,\n write,\n writeFile,\n writeFileSync,\n writeSync,\n writev,\n writevSync,\n [Symbol.for(\"::bunternal::\")]: {\n ReadStreamClass,\n WriteStreamClass\n }\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeEventsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/events.ts\nvar emitError = function(emitter, args) {\n var { _events: events } = emitter;\n if (args[0] \?\?= new Error(\"Unhandled error.\"), !events)\n throw args[0];\n var errorMonitor = events[kErrorMonitor];\n if (errorMonitor)\n for (var handler of ArrayPrototypeSlice.@call(errorMonitor))\n handler.@apply(emitter, args);\n var handlers = events.error;\n if (!handlers)\n throw args[0];\n for (var handler of ArrayPrototypeSlice.@call(handlers))\n handler.@apply(emitter, args);\n return !0;\n}, addCatch = function(emitter, promise, type, args) {\n promise.then(@undefined, function(err) {\n process.nextTick(emitUnhandledRejectionOrErr, emitter, err, type, args);\n });\n}, emitUnhandledRejectionOrErr = function(emitter, err, type, args) {\n if (typeof emitter[kRejection] === \"function\")\n emitter[kRejection](err, type, ...args);\n else\n try {\n emitter[kCapture] = !1, emitter.emit(\"error\", err);\n } finally {\n emitter[kCapture] = !0;\n }\n}, overflowWarning = function(emitter, type, handlers) {\n handlers.warned = !0;\n const warn = new Error(`Possible EventEmitter memory leak detected. ${handlers.length} ${@String(type)} listeners ` + `added to [${emitter.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);\n warn.name = \"MaxListenersExceededWarning\", warn.emitter = emitter, warn.type = type, warn.count = handlers.length, process.emitWarning(warn);\n}, onceWrapper = function(type, listener, ...args) {\n this.removeListener(type, listener), listener.@apply(this, args);\n}, once = function(emitter, type, options) {\n var signal = options\?.signal;\n if (validateAbortSignal(signal, \"options.signal\"), signal\?.aborted)\n throw new AbortError(@undefined, { cause: signal\?.reason });\n return new @Promise((resolve, reject) => {\n const errorListener = (err) => {\n if (emitter.removeListener(type, resolver), signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n reject(err);\n }, resolver = (...args) => {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(\"error\", errorListener);\n if (signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n resolve(args);\n };\n if (eventTargetAgnosticAddListener(emitter, type, resolver, { once: !0 }), type !== \"error\" && typeof emitter.once === \"function\")\n emitter.once(\"error\", errorListener);\n function abortListener() {\n eventTargetAgnosticRemoveListener(emitter, type, resolver), eventTargetAgnosticRemoveListener(emitter, \"error\", errorListener), reject(new AbortError(@undefined, { cause: signal\?.reason }));\n }\n if (signal != null)\n eventTargetAgnosticAddListener(signal, \"abort\", abortListener, { once: !0 });\n });\n}, on = function(emitter, type, options) {\n var { signal, close, highWatermark = Number.MAX_SAFE_INTEGER, lowWatermark = 1 } = options || {};\n throwNotImplemented(\"events.on\", 2679);\n}, getEventListeners = function(emitter, type) {\n if (emitter instanceof EventTarget)\n throwNotImplemented(\"getEventListeners with an EventTarget\", 2678);\n return emitter.listeners(type);\n}, setMaxListeners = function(n, ...eventTargets) {\n validateNumber(n, \"setMaxListeners\", 0);\n var length;\n if (eventTargets && (length = eventTargets.length))\n for (let i = 0;i < length; i++)\n eventTargets[i].setMaxListeners(n);\n else\n defaultMaxListeners = n;\n}, listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n}, eventTargetAgnosticRemoveListener = function(emitter, name, listener, flags) {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(name, listener);\n else\n emitter.removeEventListener(name, listener, flags);\n}, eventTargetAgnosticAddListener = function(emitter, name, listener, flags) {\n if (typeof emitter.on === \"function\")\n if (flags.once)\n emitter.once(name, listener);\n else\n emitter.on(name, listener);\n else\n emitter.addEventListener(name, listener, flags);\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_OUT_OF_RANGE = function(name, range, value) {\n const err = new RangeError(`The \"${name}\" argument is out of range. It must be ${range}. Received ${value}`);\n return err.code = \"ERR_OUT_OF_RANGE\", err;\n}, validateAbortSignal = function(signal, name) {\n if (signal !== @undefined && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateNumber = function(value, name, min = @undefined, max) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (min != null && value < min || max != null && value > max || (min != null || max != null) && Number.isNaN(value))\n throw new ERR_OUT_OF_RANGE(name, `${min != null \? `>= ${min}` : \"\"}${min != null && max != null \? \" && \" : \"\"}${max != null \? `<= ${max}` : \"\"}`, value);\n}, checkListener = function(listener) {\n if (typeof listener !== \"function\")\n @throwTypeError(\"The listener must be a function\");\n}, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), SymbolFor = Symbol.for, kCapture = Symbol(\"kCapture\"), kErrorMonitor = SymbolFor(\"events.errorMonitor\"), kMaxEventTargetListeners = Symbol(\"events.maxEventTargetListeners\"), kMaxEventTargetListenersWarned = Symbol(\"events.maxEventTargetListenersWarned\"), kWatermarkData = SymbolFor(\"nodejs.watermarkData\"), kRejection = SymbolFor(\"nodejs.rejection\"), captureRejectionSymbol = SymbolFor(\"nodejs.rejection\"), ArrayPrototypeSlice = @Array.prototype.slice, defaultMaxListeners = 10, EventEmitter = function EventEmitter2(opts) {\n if (this._events === @undefined || this._events === this.__proto__._events)\n this._events = { __proto__: null }, this._eventsCount = 0;\n if (this._maxListeners \?\?= @undefined, this[kCapture] = opts\?.captureRejections \? Boolean(opts\?.captureRejections) : EventEmitterPrototype[kCapture])\n this.emit = emitWithRejectionCapture;\n}, EventEmitterPrototype = EventEmitter.prototype = {};\nEventEmitterPrototype._events = @undefined;\nEventEmitterPrototype._eventsCount = 0;\nEventEmitterPrototype._maxListeners = @undefined;\nEventEmitterPrototype.setMaxListeners = function setMaxListeners2(n) {\n return validateNumber(n, \"setMaxListeners\", 0), this._maxListeners = n, this;\n};\nEventEmitterPrototype.constructor = EventEmitter;\nEventEmitterPrototype.getMaxListeners = function getMaxListeners() {\n return this._maxListeners \?\? defaultMaxListeners;\n};\nvar emitWithoutRejectionCapture = function emit(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === @undefined)\n return !1;\n var handlers = events[type];\n if (handlers === @undefined)\n return !1;\n const maybeClonedHandlers = handlers.length > 1 \? handlers.slice() : handlers;\n for (let i = 0, { length } = maybeClonedHandlers;i < length; i++) {\n const handler = maybeClonedHandlers[i];\n switch (args.length) {\n case 0:\n handler.@call(this);\n break;\n case 1:\n handler.@call(this, args[0]);\n break;\n case 2:\n handler.@call(this, args[0], args[1]);\n break;\n case 3:\n handler.@call(this, args[0], args[1], args[2]);\n break;\n default:\n handler.@apply(this, args);\n break;\n }\n }\n return !0;\n}, emitWithRejectionCapture = function emit2(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === @undefined)\n return !1;\n var handlers = events[type];\n if (handlers === @undefined)\n return !1;\n const maybeClonedHandlers = handlers.length > 1 \? handlers.slice() : handlers;\n for (let i = 0, { length } = maybeClonedHandlers;i < length; i++) {\n const handler = maybeClonedHandlers[i];\n let result;\n switch (args.length) {\n case 0:\n result = handler.@call(this);\n break;\n case 1:\n result = handler.@call(this, args[0]);\n break;\n case 2:\n result = handler.@call(this, args[0], args[1]);\n break;\n case 3:\n result = handler.@call(this, args[0], args[1], args[2]);\n break;\n default:\n result = handler.@apply(this, args);\n break;\n }\n if (result !== @undefined && @isPromise(result))\n addCatch(this, result, type, args);\n }\n return !0;\n};\nEventEmitterPrototype.emit = emitWithoutRejectionCapture;\nEventEmitterPrototype.addListener = function addListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.push(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.on = EventEmitterPrototype.addListener;\nEventEmitterPrototype.prependListener = function prependListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.unshift(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.once = function once2(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.addListener(type, bound), this;\n};\nEventEmitterPrototype.prependOnceListener = function prependOnceListener(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.prependListener(type, bound), this;\n};\nEventEmitterPrototype.removeListener = function removeListener(type, fn) {\n checkListener(fn);\n var { _events: events } = this;\n if (!events)\n return this;\n var handlers = events[type];\n if (!handlers)\n return this;\n var length = handlers.length;\n let position = -1;\n for (let i = length - 1;i >= 0; i--)\n if (handlers[i] === fn || handlers[i].listener === fn) {\n position = i;\n break;\n }\n if (position < 0)\n return this;\n if (position === 0)\n handlers.shift();\n else\n handlers.splice(position, 1);\n if (handlers.length === 0)\n delete events[type], this._eventsCount--;\n return this;\n};\nEventEmitterPrototype.off = EventEmitterPrototype.removeListener;\nEventEmitterPrototype.removeAllListeners = function removeAllListeners(type) {\n var { _events: events } = this;\n if (type && events) {\n if (events[type])\n delete events[type], this._eventsCount--;\n } else\n this._events = { __proto__: null };\n return this;\n};\nEventEmitterPrototype.listeners = function listeners(type) {\n var { _events: events } = this;\n if (!events)\n return [];\n var handlers = events[type];\n if (!handlers)\n return [];\n return handlers.map((x) => x.listener \?\? x);\n};\nEventEmitterPrototype.rawListeners = function rawListeners(type) {\n var { _events } = this;\n if (!_events)\n return [];\n var handlers = _events[type];\n if (!handlers)\n return [];\n return handlers.slice();\n};\nEventEmitterPrototype.listenerCount = function listenerCount2(type) {\n var { _events: events } = this;\n if (!events)\n return 0;\n return events[type]\?.length \?\? 0;\n};\nEventEmitterPrototype.eventNames = function eventNames() {\n return this._eventsCount > 0 \? Reflect.ownKeys(this._events) : [];\n};\nEventEmitterPrototype[kCapture] = !1;\n\nclass AbortError extends Error {\n constructor(message = \"The operation was aborted\", options = @undefined) {\n if (options !== @undefined && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n}\nvar AsyncResource = null;\n\nclass EventEmitterAsyncResource extends EventEmitter {\n triggerAsyncId;\n asyncResource;\n constructor(options) {\n if (!AsyncResource)\n AsyncResource = (@getInternalField(@internalModuleRegistry, 10) || @createInternalModuleById(10)).AsyncResource;\n var { captureRejections = !1, triggerAsyncId, name = new.target.name, requireManualDestroy } = options || {};\n super({ captureRejections });\n this.triggerAsyncId = triggerAsyncId \?\? 0, this.asyncResource = new AsyncResource(name, { triggerAsyncId, requireManualDestroy });\n }\n emit(...args) {\n this.asyncResource.runInAsyncScope(() => super.emit(...args));\n }\n emitDestroy() {\n this.asyncResource.emitDestroy();\n }\n}\nObject.defineProperties(EventEmitter, {\n captureRejections: {\n get() {\n return EventEmitterPrototype[kCapture];\n },\n set(value) {\n validateBoolean(value, \"EventEmitter.captureRejections\"), EventEmitterPrototype[kCapture] = value;\n },\n enumerable: !0\n },\n defaultMaxListeners: {\n enumerable: !0,\n get: () => {\n return defaultMaxListeners;\n },\n set: (arg) => {\n validateNumber(arg, \"defaultMaxListeners\", 0), defaultMaxListeners = arg;\n }\n },\n kMaxEventTargetListeners: {\n value: kMaxEventTargetListeners,\n enumerable: !1,\n configurable: !1,\n writable: !1\n },\n kMaxEventTargetListenersWarned: {\n value: kMaxEventTargetListenersWarned,\n enumerable: !1,\n configurable: !1,\n writable: !1\n }\n});\nObject.assign(EventEmitter, {\n once,\n on,\n getEventListeners,\n setMaxListeners,\n EventEmitter,\n usingDomains: !1,\n captureRejectionSymbol,\n EventEmitterAsyncResource,\n errorMonitor: kErrorMonitor,\n setMaxListeners,\n init: EventEmitter,\n listenerCount\n});\nreturn EventEmitter})\n");
//
//
-static constexpr ASCIILiteral NodeFSPromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/fs.promises.ts\nvar watch = function(filename, options = {}) {\n if (filename instanceof URL)\n @throwTypeError(\"Watch URLs are not supported yet\");\n else if (Buffer.isBuffer(filename))\n filename = filename.toString();\n else if (typeof filename !== \"string\")\n @throwTypeError(\"Expected path to be a string or Buffer\");\n let nextEventResolve = null;\n if (typeof options === \"string\")\n options = { encoding: options };\n const queue = @createFIFO(), watcher = fs.watch(filename, options || {}, (eventType, filename2) => {\n if (queue.push({ eventType, filename: filename2 }), nextEventResolve) {\n const resolve = nextEventResolve;\n nextEventResolve = null, resolve();\n }\n });\n return {\n [Symbol.asyncIterator]() {\n let closed = !1;\n return {\n async next() {\n while (!closed) {\n let event;\n while (event = queue.shift()) {\n if (event.eventType === \"close\")\n return closed = !0, { value: void 0, done: !0 };\n if (event.eventType === \"error\")\n throw closed = !0, event.filename;\n return { value: event, done: !1 };\n }\n const { promise, resolve } = Promise.withResolvers();\n nextEventResolve = resolve, await promise;\n }\n return { value: void 0, done: !0 };\n },\n return() {\n if (!closed) {\n if (watcher.close(), closed = !0, nextEventResolve) {\n const resolve = nextEventResolve;\n nextEventResolve = null, resolve();\n }\n }\n return { value: void 0, done: !0 };\n }\n };\n }\n };\n}, cp = function(src, dest, options) {\n if (!options)\n return fs.cp(src, dest);\n if (typeof options !== \"object\")\n @throwTypeError(\"options must be an object\");\n if (options.dereference || options.filter || options.preserveTimestamps || options.verbatimSymlinks) {\n if (!lazy_cp)\n lazy_cp = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3);\n return lazy_cp(src, dest, options);\n }\n return fs.cp(src, dest, options.recursive, options.errorOnExist, options.force \?\? !0, options.mode);\n};\nasync function opendir(dir) {\n const entries = await fs.readdir(dir, { withFileTypes: !0 });\n return new Dir(entries);\n}\nvar $, constants = @processBindingConstants.fs, fs = Bun.fs(), notrace = \"::bunternal::\", promisify = {\n [notrace]: (fsFunction) => {\n return async function(...args) {\n return await 1, fsFunction.apply(fs, args);\n };\n }\n}[notrace], lazy_cp = null;\n\nclass Dir {\n #entries;\n constructor(e) {\n this.#entries = e;\n }\n readSync() {\n return this.#entries.shift() \?\? null;\n }\n read(c) {\n if (c)\n process.nextTick(c, null, this.readSync());\n return Promise.resolve(this.readSync());\n }\n closeSync() {\n }\n close(c) {\n if (c)\n process.nextTick(c);\n return Promise.resolve();\n }\n *[Symbol.asyncIterator]() {\n var next;\n while (next = this.readSync())\n yield next;\n }\n}\n$ = {\n access: promisify(fs.accessSync),\n appendFile: promisify(fs.appendFileSync),\n close: promisify(fs.closeSync),\n copyFile: fs.copyFile.bind(fs),\n cp,\n exists: promisify(fs.existsSync),\n chown: promisify(fs.chownSync),\n chmod: promisify(fs.chmodSync),\n fchmod: promisify(fs.fchmodSync),\n fchown: promisify(fs.fchownSync),\n fstat: promisify(fs.fstatSync),\n fsync: promisify(fs.fsyncSync),\n ftruncate: promisify(fs.ftruncateSync),\n futimes: promisify(fs.futimesSync),\n lchmod: promisify(fs.lchmodSync),\n lchown: promisify(fs.lchownSync),\n link: promisify(fs.linkSync),\n lstat: fs.lstat.bind(fs),\n mkdir: promisify(fs.mkdirSync),\n mkdtemp: promisify(fs.mkdtempSync),\n open: promisify(fs.openSync),\n read: promisify(fs.readSync),\n write: promisify(fs.writeSync),\n readdir: fs.readdir.bind(fs),\n readFile: fs.readFile.bind(fs),\n writeFile: promisify(fs.writeFileSync),\n readlink: promisify(fs.readlinkSync),\n realpath: fs.realpath.bind(fs),\n rename: promisify(fs.renameSync),\n stat: fs.stat.bind(fs),\n symlink: promisify(fs.symlinkSync),\n truncate: promisify(fs.truncateSync),\n unlink: promisify(fs.unlinkSync),\n utimes: promisify(fs.utimesSync),\n lutimes: promisify(fs.lutimesSync),\n rm: promisify(fs.rmSync),\n rmdir: promisify(fs.rmdirSync),\n writev: (fd, buffers, position) => {\n return new Promise((resolve, reject) => {\n try {\n var bytesWritten = fs.writevSync(fd, buffers, position);\n } catch (err) {\n reject(err);\n return;\n }\n resolve({\n bytesWritten,\n buffers\n });\n });\n },\n readv: (fd, buffers, position) => {\n return new Promise((resolve, reject) => {\n try {\n var bytesRead = fs.readvSync(fd, buffers, position);\n } catch (err) {\n reject(err);\n return;\n }\n resolve({\n bytesRead,\n buffers\n });\n });\n },\n constants,\n watch,\n opendir\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeFSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/fs.ts\nvar getValidatedPath = function(p) {\n if (p instanceof URL)\n return Bun.fileURLToPath(p);\n if (typeof p !== \"string\")\n @throwTypeError(\"Path must be a string or URL.\");\n return (_pathModule \?\?= @getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30)).resolve(p);\n}, watchFile = function(filename, options, listener) {\n if (filename = getValidatedPath(filename), typeof options === \"function\")\n listener = options, options = {};\n if (typeof listener !== \"function\")\n @throwTypeError(\"listener must be a function\");\n var stat = statWatchers.get(filename);\n if (!stat)\n stat = new StatWatcher(filename, options), statWatchers.set(filename, stat);\n return stat.addListener(\"change\", listener), stat;\n}, unwatchFile = function(filename, listener) {\n filename = getValidatedPath(filename);\n var stat = statWatchers.get(filename);\n if (!stat)\n return;\n if (listener) {\n if (stat.removeListener(\"change\", listener), stat.listenerCount(\"change\") !== 0)\n return;\n } else\n stat.removeAllListeners(\"change\");\n stat.stop(), statWatchers.delete(filename);\n}, callbackify = function(fsFunction, args) {\n const callback = args[args.length - 1];\n try {\n var result = fsFunction.@apply(fs, args.slice(0, args.length - 1));\n result.then((...args2) => callback(null, ...args2), (err) => callback(err));\n } catch (e) {\n if (typeof callback === \"function\")\n callback(e);\n else\n throw e;\n }\n}, createReadStream = function(path, options) {\n return new ReadStream(path, options);\n}, WriteStream_handleWrite = function(er, bytes) {\n if (er)\n return WriteStream_errorOrDestroy.@call(this, er);\n this.bytesWritten += bytes;\n}, WriteStream_internalClose = function(err, cb) {\n this[_writeStreamPathFastPathSymbol] = !1;\n var fd = this.fd;\n this[_fs].close(fd, (er) => {\n this.fd = null, cb(err || er);\n });\n}, WriteStream_errorOrDestroy = function(err) {\n var {\n _readableState: r = { destroyed: !1, autoDestroy: !1 },\n _writableState: w = { destroyed: !1, autoDestroy: !1 }\n } = this;\n if (w\?.destroyed || r\?.destroyed)\n return this;\n if (r\?.autoDestroy || w\?.autoDestroy)\n this.destroy(err);\n else if (err)\n this.emit(\"error\", err);\n}, createWriteStream = function(path, options) {\n return new WriteStream(path, options);\n}, cpSync = function(src, dest, options) {\n if (!options)\n return fs.cpSync(src, dest);\n if (typeof options !== \"object\")\n @throwTypeError(\"options must be an object\");\n if (options.dereference || options.filter || options.preserveTimestamps || options.verbatimSymlinks) {\n if (!lazy_cpSync)\n lazy_cpSync = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3);\n return lazy_cpSync(src, dest, options);\n }\n return fs.cpSync(src, dest, options.recursive, options.errorOnExist, options.force \?\? !0, options.mode);\n}, cp = function(src, dest, options, callback) {\n if (typeof options === \"function\")\n callback = options, options = @undefined;\n promises.cp(src, dest, options).then(() => callback(), callback);\n}, _toUnixTimestamp = function(time, name = \"time\") {\n if (typeof time === \"string\" && +time == time)\n return +time;\n if (NumberIsFinite(time)) {\n if (time < 0)\n return DateNow() / 1000;\n return time;\n }\n if (isDate(time))\n return DatePrototypeGetTime(time) / 1000;\n @throwTypeError(`Expected ${name} to be a number or Date`);\n}, $, ReadStream, WriteStream, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), promises = @getInternalField(@internalModuleRegistry, 22) || @createInternalModuleById(22), Stream = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), { isArrayBufferView } = @requireNativeModule(\"util/types\"), _writeStreamPathFastPathSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPath\"), _fs = Symbol.for(\"#fs\"), constants = @processBindingConstants.fs, fs = Bun.fs();\n\nclass FSWatcher extends EventEmitter {\n #watcher;\n #listener;\n constructor(path, options, listener) {\n super();\n if (typeof options === \"function\")\n listener = options, options = {};\n else if (typeof options === \"string\")\n options = { encoding: options };\n if (typeof listener !== \"function\")\n listener = () => {\n };\n this.#listener = listener;\n try {\n this.#watcher = fs.watch(path, options || {}, this.#onEvent.bind(this));\n } catch (e) {\n if (!e.message\?.startsWith(\"FileNotFound\"))\n throw e;\n const notFound = new Error(`ENOENT: no such file or directory, watch '${path}'`);\n throw notFound.code = \"ENOENT\", notFound.errno = -2, notFound.path = path, notFound.syscall = \"watch\", notFound.filename = path, notFound;\n }\n }\n #onEvent(eventType, filenameOrError) {\n if (eventType === \"error\" || eventType === \"close\")\n this.emit(eventType, filenameOrError);\n else\n this.emit(\"change\", eventType, filenameOrError), this.#listener(eventType, filenameOrError);\n }\n close() {\n this.#watcher\?.close(), this.#watcher = null;\n }\n ref() {\n this.#watcher\?.ref();\n }\n unref() {\n this.#watcher\?.unref();\n }\n start() {\n }\n}\n\nclass StatWatcher extends EventEmitter {\n constructor(path, options) {\n super();\n this._handle = fs.watchFile(path, options, this.#onChange.bind(this));\n }\n #onChange(curr, prev) {\n this.emit(\"change\", curr, prev);\n }\n start() {\n }\n stop() {\n this._handle\?.close(), this._handle = null;\n }\n ref() {\n this._handle\?.ref();\n }\n unref() {\n this._handle\?.unref();\n }\n}\nvar access = function access2(...args) {\n callbackify(fs.access, args);\n}, appendFile = function appendFile2(...args) {\n callbackify(fs.appendFile, args);\n}, close = function close2(...args) {\n callbackify(fs.close, args);\n}, rm = function rm2(...args) {\n callbackify(fs.rm, args);\n}, rmdir = function rmdir2(...args) {\n callbackify(fs.rmdir, args);\n}, copyFile = function copyFile2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\") {\n const err = @makeTypeError(\"Callback must be a function\");\n throw err.code = \"ERR_INVALID_ARG_TYPE\", err;\n }\n fs.copyFile(...args).then((result) => callback(null, result), callback);\n}, exists = function exists2(path, callback) {\n if (typeof callback !== \"function\") {\n const err = @makeTypeError(\"Callback must be a function\");\n throw err.code = \"ERR_INVALID_ARG_TYPE\", err;\n }\n try {\n fs.exists.@apply(fs, [path]).then((existed) => callback(existed), (_) => callback(!1));\n } catch (e) {\n callback(!1);\n }\n}, chown = function chown2(...args) {\n callbackify(fs.chown, args);\n}, chmod = function chmod2(...args) {\n callbackify(fs.chmod, args);\n}, fchmod = function fchmod2(...args) {\n callbackify(fs.fchmod, args);\n}, fchown = function fchown2(...args) {\n callbackify(fs.fchown, args);\n}, fstat = function fstat2(...args) {\n callbackify(fs.fstat, args);\n}, fsync = function fsync2(...args) {\n callbackify(fs.fsync, args);\n}, ftruncate = function ftruncate2(...args) {\n callbackify(fs.ftruncate, args);\n}, futimes = function futimes2(...args) {\n callbackify(fs.futimes, args);\n}, lchmod = function lchmod2(...args) {\n callbackify(fs.lchmod, args);\n}, lchown = function lchown2(...args) {\n callbackify(fs.lchown, args);\n}, link = function link2(...args) {\n callbackify(fs.link, args);\n}, mkdir = function mkdir2(...args) {\n callbackify(fs.mkdir, args);\n}, mkdtemp = function mkdtemp2(...args) {\n callbackify(fs.mkdtemp, args);\n}, open = function open2(...args) {\n callbackify(fs.open, args);\n}, read = function read2(fd, buffer, offsetOrOptions, length, position, callback) {\n let offset = offsetOrOptions, params = null;\n if (arguments.length <= 4) {\n if (arguments.length === 4)\n callback = length, params = offsetOrOptions;\n else if (arguments.length === 3) {\n if (!isArrayBufferView(buffer))\n params = buffer, { buffer = @Buffer.alloc(16384) } = params \?\? {};\n callback = offsetOrOptions;\n } else\n callback = buffer, buffer = @Buffer.alloc(16384);\n ({ offset = 0, length = buffer\?.byteLength - offset, position = null } = params \?\? {});\n }\n queueMicrotask(() => {\n try {\n var bytesRead = fs.readSync(fd, buffer, offset, length, position);\n } catch (e) {\n callback(e);\n }\n callback(null, bytesRead, buffer);\n });\n}, write = function write2(...args) {\n callbackify(fs.write, args);\n}, readdir = function readdir2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.readdir(...args).then((result) => callback(null, result), callback);\n}, readFile = function readFile2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.readFile(...args).then((result) => callback(null, result), callback);\n}, writeFile = function writeFile2(...args) {\n callbackify(fs.writeFile, args);\n}, readlink = function readlink2(...args) {\n callbackify(fs.readlink, args);\n}, realpath = function realpath2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.realpath(...args).then((result) => callback(null, result), callback);\n}, rename = function rename2(...args) {\n callbackify(fs.rename, args);\n}, lstat = function lstat2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.lstat(...args).then((result) => callback(null, result), callback);\n}, stat = function stat2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.stat(...args).then((result) => callback(null, result), callback);\n}, symlink = function symlink2(...args) {\n callbackify(fs.symlink, args);\n}, truncate = function truncate2(...args) {\n callbackify(fs.truncate, args);\n}, unlink = function unlink2(...args) {\n callbackify(fs.unlink, args);\n}, utimes = function utimes2(...args) {\n callbackify(fs.utimes, args);\n}, lutimes = function lutimes2(...args) {\n callbackify(fs.lutimes, args);\n}, accessSync = fs.accessSync.bind(fs), appendFileSync = fs.appendFileSync.bind(fs), closeSync = fs.closeSync.bind(fs), copyFileSync = fs.copyFileSync.bind(fs), existsSync = fs.existsSync.bind(fs), chownSync = fs.chownSync.bind(fs), chmodSync = fs.chmodSync.bind(fs), fchmodSync = fs.fchmodSync.bind(fs), fchownSync = fs.fchownSync.bind(fs), fstatSync = fs.fstatSync.bind(fs), fsyncSync = fs.fsyncSync.bind(fs), ftruncateSync = fs.ftruncateSync.bind(fs), futimesSync = fs.futimesSync.bind(fs), lchmodSync = fs.lchmodSync.bind(fs), lchownSync = fs.lchownSync.bind(fs), linkSync = fs.linkSync.bind(fs), lstatSync = fs.lstatSync.bind(fs), mkdirSync = fs.mkdirSync.bind(fs), mkdtempSync = fs.mkdtempSync.bind(fs), openSync = fs.openSync.bind(fs), readSync = fs.readSync.bind(fs), writeSync = fs.writeSync.bind(fs), readdirSync = fs.readdirSync.bind(fs), readFileSync = fs.readFileSync.bind(fs), writeFileSync = fs.writeFileSync.bind(fs), readlinkSync = fs.readlinkSync.bind(fs), realpathSync = fs.realpathSync.bind(fs), renameSync = fs.renameSync.bind(fs), statSync = fs.statSync.bind(fs), symlinkSync = fs.symlinkSync.bind(fs), truncateSync = fs.truncateSync.bind(fs), unlinkSync = fs.unlinkSync.bind(fs), utimesSync = fs.utimesSync.bind(fs), lutimesSync = fs.lutimesSync.bind(fs), rmSync = fs.rmSync.bind(fs), rmdirSync = fs.rmdirSync.bind(fs), writev = (fd, buffers, position, callback) => {\n if (typeof position === \"function\")\n callback = position, position = null;\n queueMicrotask(() => {\n try {\n var written = fs.writevSync(fd, buffers, position);\n } catch (e) {\n callback(e);\n }\n callback(null, written, buffers);\n });\n}, writevSync = fs.writevSync.bind(fs), readv = (fd, buffers, position, callback) => {\n if (typeof position === \"function\")\n callback = position, position = null;\n queueMicrotask(() => {\n try {\n var written = fs.readvSync(fd, buffers, position);\n } catch (e) {\n callback(e);\n }\n callback(null, written, buffers);\n });\n}, readvSync = fs.readvSync.bind(fs), Dirent = fs.Dirent, Stats = fs.Stats, watch = function watch2(path, options, listener) {\n return new FSWatcher(path, options, listener);\n}, statWatchers = new Map, _pathModule, readStreamPathFastPathSymbol = Symbol.for(\"Bun.Node.readStreamPathFastPath\"), readStreamSymbol = Symbol.for(\"Bun.NodeReadStream\"), readStreamPathOrFdSymbol = Symbol.for(\"Bun.NodeReadStreamPathOrFd\"), writeStreamSymbol = Symbol.for(\"Bun.NodeWriteStream\"), writeStreamPathFastPathSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPath\"), writeStreamPathFastPathCallSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPathCall\"), kIoDone = Symbol.for(\"kIoDone\"), defaultReadStreamOptions = {\n file: @undefined,\n fd: null,\n flags: \"r\",\n encoding: @undefined,\n mode: 438,\n autoClose: !0,\n emitClose: !0,\n start: 0,\n end: @Infinity,\n highWaterMark: 65536,\n fs: {\n read,\n open: (path, flags, mode, cb) => {\n var fd;\n try {\n fd = openSync(path, flags, mode);\n } catch (e) {\n cb(e);\n return;\n }\n cb(null, fd);\n },\n openSync,\n close\n },\n autoDestroy: !0\n}, ReadStreamClass;\nReadStream = function(InternalReadStream) {\n ReadStreamClass = InternalReadStream, Object.defineProperty(ReadStreamClass.prototype, Symbol.toStringTag, {\n value: \"ReadStream\",\n enumerable: !1\n });\n function ReadStream3(path, options) {\n return new InternalReadStream(path, options);\n }\n return ReadStream3.prototype = InternalReadStream.prototype, Object.defineProperty(ReadStream3, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalReadStream;\n }\n });\n}(class ReadStream2 extends Stream._getNativeReadableStreamPrototype(2, Stream.Readable) {\n constructor(pathOrFd, options = defaultReadStreamOptions) {\n if (typeof options !== \"object\" || !options)\n @throwTypeError(\"Expected options to be an object\");\n var {\n flags = defaultReadStreamOptions.flags,\n encoding = defaultReadStreamOptions.encoding,\n mode = defaultReadStreamOptions.mode,\n autoClose = defaultReadStreamOptions.autoClose,\n emitClose = defaultReadStreamOptions.emitClose,\n start = defaultReadStreamOptions.start,\n end = defaultReadStreamOptions.end,\n autoDestroy = defaultReadStreamOptions.autoClose,\n fs: fs2 = defaultReadStreamOptions.fs,\n highWaterMark = defaultReadStreamOptions.highWaterMark,\n fd = defaultReadStreamOptions.fd\n } = options;\n if (pathOrFd\?.constructor\?.name === \"URL\")\n pathOrFd = Bun.fileURLToPath(pathOrFd);\n var tempThis = {};\n if (fd != null) {\n if (typeof fd !== \"number\")\n @throwTypeError(\"Expected options.fd to be a number\");\n tempThis.fd = tempThis[readStreamPathOrFdSymbol] = fd, tempThis.autoClose = !1;\n } else if (typeof pathOrFd === \"string\") {\n if (pathOrFd.startsWith(\"file://\"))\n pathOrFd = Bun.fileURLToPath(pathOrFd);\n if (pathOrFd.length === 0)\n @throwTypeError(\"Expected path to be a non-empty string\");\n tempThis.path = tempThis.file = tempThis[readStreamPathOrFdSymbol] = pathOrFd;\n } else if (typeof pathOrFd === \"number\") {\n if (pathOrFd |= 0, pathOrFd < 0)\n @throwTypeError(\"Expected fd to be a positive integer\");\n tempThis.fd = tempThis[readStreamPathOrFdSymbol] = pathOrFd, tempThis.autoClose = !1;\n } else\n @throwTypeError(\"Expected a path or file descriptor\");\n if (tempThis.fd === @undefined)\n tempThis.fd = fs2.openSync(pathOrFd, flags, mode);\n var fileRef = Bun.file(tempThis.fd), stream = fileRef.stream(), native = @direct(stream);\n if (!native)\n throw new Error(\"no native readable stream\");\n var { stream: ptr } = native;\n super(ptr, {\n ...options,\n encoding,\n autoDestroy,\n autoClose,\n emitClose,\n highWaterMark\n });\n if (Object.assign(this, tempThis), this.#fileRef = fileRef, this.end = end, this._read = this.#internalRead, this.start = start, this.flags = flags, this.mode = mode, this.emitClose = emitClose, this[readStreamPathFastPathSymbol] = start === 0 && end === @Infinity && autoClose && fs2 === defaultReadStreamOptions.fs && (encoding === \"buffer\" || encoding === \"binary\" || encoding == null || encoding === \"utf-8\" || encoding === \"utf8\"), this._readableState.autoClose = autoDestroy = autoClose, this._readableState.highWaterMark = highWaterMark, start !== @undefined)\n this.pos = start;\n }\n #fileRef;\n #fs;\n file;\n path;\n fd = null;\n flags;\n mode;\n start;\n end;\n pos;\n bytesRead = 0;\n #fileSize = -1;\n _read;\n [readStreamSymbol] = !0;\n [readStreamPathOrFdSymbol];\n [readStreamPathFastPathSymbol];\n _construct(callback) {\n if (super._construct)\n super._construct(callback);\n else\n callback();\n this.emit(\"open\", this.fd), this.emit(\"ready\");\n }\n _destroy(err, cb) {\n super._destroy(err, cb);\n try {\n var fd = this.fd;\n if (this[readStreamPathFastPathSymbol] = !1, !fd)\n cb(err);\n else\n this.#fs.close(fd, (er) => {\n cb(er || err);\n }), this.fd = null;\n } catch (e) {\n throw e;\n }\n }\n close(cb) {\n if (typeof cb === \"function\")\n Stream.eos(this, cb);\n this.destroy();\n }\n push(chunk) {\n var bytesRead = chunk\?.length \?\? 0;\n if (bytesRead > 0) {\n this.bytesRead += bytesRead;\n var currPos = this.pos;\n if (currPos !== @undefined) {\n if (this.bytesRead < currPos)\n return !0;\n if (currPos === this.start) {\n var n = this.bytesRead - currPos;\n chunk = chunk.slice(-n);\n var [_, ...rest] = arguments;\n if (this.pos = this.bytesRead, this.end !== @undefined && this.bytesRead > this.end)\n chunk = chunk.slice(0, this.end - this.start + 1);\n return super.push(chunk, ...rest);\n }\n var end = this.end;\n if (end !== @undefined && this.bytesRead > end) {\n chunk = chunk.slice(0, end - currPos + 1);\n var [_, ...rest] = arguments;\n return this.pos = this.bytesRead, super.push(chunk, ...rest);\n }\n this.pos = this.bytesRead;\n }\n }\n return super.push(...arguments);\n }\n #internalRead(n) {\n var { pos, end, bytesRead, fd, encoding } = this;\n if (n = pos !== @undefined \? Math.min(end - pos + 1, n) : Math.min(end - bytesRead + 1, n), n <= 0) {\n this.push(null);\n return;\n }\n if (this.#fileSize === -1 && bytesRead === 0 && pos === @undefined) {\n var stat3 = fstatSync(fd);\n if (this.#fileSize = stat3.size, this.#fileSize > 0 && n > this.#fileSize)\n n = this.#fileSize + 1;\n }\n this[kIoDone] = !1;\n var res = super._read(n);\n if (@isPromise(res)) {\n var then = res\?.then;\n if (then && @isCallable(then))\n res.then(() => {\n if (this[kIoDone] = !0, this.destroyed)\n this.emit(kIoDone);\n }, (er) => {\n this[kIoDone] = !0, this.#errorOrDestroy(er);\n });\n } else if (this[kIoDone] = !0, this.destroyed)\n this.emit(kIoDone), this.#errorOrDestroy(new Error(\"ERR_STREAM_PREMATURE_CLOSE\"));\n }\n #errorOrDestroy(err, sync = null) {\n var {\n _readableState: r = { destroyed: !1, autoDestroy: !1 },\n _writableState: w = { destroyed: !1, autoDestroy: !1 }\n } = this;\n if (w\?.destroyed || r\?.destroyed)\n return this;\n if (r\?.autoDestroy || w\?.autoDestroy)\n this.destroy(err);\n else if (err)\n this.emit(\"error\", err);\n }\n pause() {\n return this[readStreamPathFastPathSymbol] = !1, super.pause();\n }\n resume() {\n return this[readStreamPathFastPathSymbol] = !1, super.resume();\n }\n unshift(...args) {\n return this[readStreamPathFastPathSymbol] = !1, super.unshift(...args);\n }\n pipe(dest, pipeOpts) {\n if (this[readStreamPathFastPathSymbol] && (pipeOpts\?.end \?\? !0) && this._readableState\?.pipes\?.length === 0) {\n if ((writeStreamPathFastPathSymbol in dest) && dest[writeStreamPathFastPathSymbol]) {\n if (dest[writeStreamPathFastPathCallSymbol](this, pipeOpts))\n return this;\n }\n }\n return this[readStreamPathFastPathSymbol] = !1, super.pipe(dest, pipeOpts);\n }\n});\nvar defaultWriteStreamOptions = {\n fd: null,\n start: @undefined,\n pos: @undefined,\n encoding: @undefined,\n flags: \"w\",\n mode: 438,\n fs: {\n write,\n close,\n open,\n openSync\n }\n}, WriteStreamClass = WriteStream = function WriteStream2(path, options = defaultWriteStreamOptions) {\n if (!(this instanceof WriteStream2))\n return new WriteStream2(path, options);\n if (!options)\n @throwTypeError(\"Expected options to be an object\");\n var {\n fs: fs2 = defaultWriteStreamOptions.fs,\n start = defaultWriteStreamOptions.start,\n flags = defaultWriteStreamOptions.flags,\n mode = defaultWriteStreamOptions.mode,\n autoClose = !0,\n emitClose = !1,\n autoDestroy = autoClose,\n encoding = defaultWriteStreamOptions.encoding,\n fd = defaultWriteStreamOptions.fd,\n pos = defaultWriteStreamOptions.pos\n } = options, tempThis = {};\n if (fd != null) {\n if (typeof fd !== \"number\")\n throw new Error(\"Expected options.fd to be a number\");\n tempThis.fd = fd, tempThis[_writeStreamPathFastPathSymbol] = !1;\n } else if (typeof path === \"string\") {\n if (path.length === 0)\n @throwTypeError(\"Expected a non-empty path\");\n if (path.startsWith(\"file:\"))\n path = Bun.fileURLToPath(path);\n tempThis.path = path, tempThis.fd = null, tempThis[_writeStreamPathFastPathSymbol] = autoClose && (start === @undefined || start === 0) && fs2.write === defaultWriteStreamOptions.fs.write && fs2.close === defaultWriteStreamOptions.fs.close;\n }\n if (tempThis.fd == null)\n tempThis.fd = fs2.openSync(path, flags, mode);\n if (NativeWritable.@call(this, tempThis.fd, {\n ...options,\n decodeStrings: !1,\n autoDestroy,\n emitClose,\n fd: tempThis\n }), Object.assign(this, tempThis), typeof fs2\?.write !== \"function\")\n @throwTypeError(\"Expected fs.write to be a function\");\n if (typeof fs2\?.close !== \"function\")\n @throwTypeError(\"Expected fs.close to be a function\");\n if (typeof fs2\?.open !== \"function\")\n @throwTypeError(\"Expected fs.open to be a function\");\n if (typeof path === \"object\" && path) {\n if (path instanceof URL)\n path = Bun.fileURLToPath(path);\n }\n if (typeof path !== \"string\" && typeof fd !== \"number\")\n @throwTypeError(\"Expected a path or file descriptor\");\n if (this.start = start, this[_fs] = fs2, this.flags = flags, this.mode = mode, this.bytesWritten = 0, this[writeStreamSymbol] = !0, this[kIoDone] = !1, this.start !== @undefined)\n this.pos = this.start;\n if (encoding !== defaultWriteStreamOptions.encoding) {\n if (this.setDefaultEncoding(encoding), encoding !== \"buffer\" && encoding !== \"utf8\" && encoding !== \"utf-8\" && encoding !== \"binary\")\n this[_writeStreamPathFastPathSymbol] = !1;\n }\n return this;\n}, NativeWritable = Stream.NativeWritable, WriteStreamPrototype = WriteStream.prototype = Object.create(NativeWritable.prototype);\nObject.defineProperties(WriteStreamPrototype, {\n autoClose: {\n get() {\n return this._writableState.autoDestroy;\n },\n set(val) {\n this._writableState.autoDestroy = val;\n }\n },\n pending: {\n get() {\n return this.fd === null;\n }\n }\n});\nWriteStreamPrototype.destroySoon = WriteStreamPrototype.end;\nWriteStreamPrototype.open = function open3() {\n};\nWriteStreamPrototype[writeStreamPathFastPathCallSymbol] = function WriteStreamPathFastPathCallSymbol(readStream, pipeOpts) {\n if (!this[_writeStreamPathFastPathSymbol])\n return !1;\n if (this.fd !== null)\n return this[_writeStreamPathFastPathSymbol] = !1, !1;\n return this[kIoDone] = !1, readStream[kIoDone] = !1, Bun.write(this[_writeStreamPathFastPathSymbol], readStream[readStreamPathOrFdSymbol]).then((bytesWritten) => {\n readStream[kIoDone] = this[kIoDone] = !0, this.bytesWritten += bytesWritten, readStream.bytesRead += bytesWritten, this.end(), readStream.close();\n }, (err) => {\n readStream[kIoDone] = this[kIoDone] = !0, WriteStream_errorOrDestroy.@call(this, err), readStream.emit(\"error\", err);\n });\n};\nWriteStreamPrototype.isBunFastPathEnabled = function isBunFastPathEnabled() {\n return this[_writeStreamPathFastPathSymbol];\n};\nWriteStreamPrototype.disableBunFastPath = function disableBunFastPath() {\n this[_writeStreamPathFastPathSymbol] = !1;\n};\nWriteStreamPrototype._construct = function _construct(callback) {\n if (typeof this.fd === \"number\") {\n callback();\n return;\n }\n callback(), this.emit(\"open\", this.fd), this.emit(\"ready\");\n};\nWriteStreamPrototype._destroy = function _destroy(err, cb) {\n if (this.fd === null)\n return cb(err);\n if (this[kIoDone]) {\n this.once(kIoDone, () => WriteStream_internalClose.@call(this, err, cb));\n return;\n }\n WriteStream_internalClose.@call(this, err, cb);\n};\nWriteStreamPrototype.close = function close3(cb) {\n if (cb) {\n if (this.closed) {\n process.nextTick(cb);\n return;\n }\n this.on(\"close\", cb);\n }\n if (!this.autoClose)\n this.on(\"finish\", this.destroy);\n this.end();\n};\nWriteStreamPrototype.write = function write3(chunk, encoding, cb) {\n if (encoding \?\?= this._writableState\?.defaultEncoding, this[_writeStreamPathFastPathSymbol] = !1, typeof chunk === \"string\")\n chunk = @Buffer.from(chunk, encoding);\n var native = this.pos === @undefined;\n const callback = native \? (err, bytes) => {\n if (this[kIoDone] = !1, WriteStream_handleWrite.@call(this, err, bytes), this.emit(kIoDone), cb)\n !err \? cb() : cb(err);\n } : () => {\n };\n if (this[kIoDone] = !0, this._write)\n return this._write(chunk, encoding, callback);\n else\n return NativeWritable.prototype.write.@call(this, chunk, encoding, callback, native);\n};\nWriteStreamPrototype._write = @undefined;\nWriteStreamPrototype._writev = @undefined;\nWriteStreamPrototype.end = function end(chunk, encoding, cb) {\n var native = this.pos === @undefined;\n return NativeWritable.prototype.end.@call(this, chunk, encoding, cb, native);\n};\nWriteStreamPrototype._destroy = function _destroy2(err, cb) {\n this.close(err, cb);\n};\nObject.defineProperties(fs, {\n createReadStream: {\n value: createReadStream\n },\n createWriteStream: {\n value: createWriteStream\n },\n ReadStream: {\n value: ReadStream\n },\n WriteStream: {\n value: WriteStream\n }\n});\nrealpath.native = realpath;\nrealpathSync.native = realpathSync;\nvar lazy_cpSync = null;\n$ = {\n Dirent,\n FSWatcher,\n ReadStream,\n Stats,\n WriteStream,\n _toUnixTimestamp,\n access,\n accessSync,\n appendFile,\n appendFileSync,\n chmod,\n chmodSync,\n chown,\n chownSync,\n close,\n closeSync,\n constants,\n copyFile,\n copyFileSync,\n cp,\n cpSync,\n createReadStream,\n createWriteStream,\n exists,\n existsSync,\n fchmod,\n fchmodSync,\n fchown,\n fchownSync,\n fstat,\n fstatSync,\n fsync,\n fsyncSync,\n ftruncate,\n ftruncateSync,\n futimes,\n futimesSync,\n lchmod,\n lchmodSync,\n lchown,\n lchownSync,\n link,\n linkSync,\n lstat,\n lstatSync,\n lutimes,\n lutimesSync,\n mkdir,\n mkdirSync,\n mkdtemp,\n mkdtempSync,\n open,\n openSync,\n promises,\n read,\n readFile,\n readFileSync,\n readSync,\n readdir,\n readdirSync,\n readlink,\n readlinkSync,\n readv,\n readvSync,\n realpath,\n realpathSync,\n rename,\n renameSync,\n rm,\n rmSync,\n rmdir,\n rmdirSync,\n stat,\n statSync,\n symlink,\n symlinkSync,\n truncate,\n truncateSync,\n unlink,\n unlinkSync,\n unwatchFile,\n utimes,\n utimesSync,\n watch,\n watchFile,\n write,\n writeFile,\n writeFileSync,\n writeSync,\n writev,\n writevSync,\n [Symbol.for(\"::bunternal::\")]: {\n ReadStreamClass,\n WriteStreamClass\n }\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeHttpCode = "(function (){\"use strict\";// src/js/out/tmp/node/http.ts\nvar checkInvalidHeaderChar = function(val) {\n return RegExpPrototypeExec.call(headerCharRegex, val) !== null;\n}, isIPv6 = function(input) {\n return new RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\").test(input);\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof ArrayBuffer || obj instanceof Blob)\n return !0;\n if (Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, validateMsecs = function(numberlike, field) {\n if (typeof numberlike !== \"number\" || numberlike < 0)\n throw new ERR_INVALID_ARG_TYPE(field, \"number\", numberlike);\n return numberlike;\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, getHeader = function(headers, name) {\n if (!headers)\n return;\n const result = headers.get(name);\n return result == null \? void 0 : result;\n}, createServer = function(options, callback) {\n return new Server(options, callback);\n}, emitListeningNextTick = function(self, onListen, err, hostname, port) {\n if (typeof onListen === \"function\")\n try {\n onListen(err, hostname, port);\n } catch (err2) {\n self.emit(\"error\", err2);\n }\n if (self.listening = !err, err)\n self.emit(\"error\", err);\n else\n self.emit(\"listening\", hostname, port);\n}, assignHeaders = function(object, req) {\n var headers = req.headers.toJSON();\n const rawHeaders = @newArrayWithSize(req.headers.count * 2);\n var i = 0;\n for (let key in headers)\n rawHeaders[i++] = key, rawHeaders[i++] = headers[key];\n object.headers = headers, object.rawHeaders = rawHeaders;\n};\nvar getDefaultHTTPSAgent = function() {\n return _defaultHTTPSAgent \?\?= new Agent({ defaultPort: 443, protocol: \"https:\" });\n};\nvar urlToHttpOptions = function(url) {\n var { protocol, hostname, hash, search, pathname, href, port, username, password } = url;\n return {\n protocol,\n hostname: typeof hostname === \"string\" && StringPrototypeStartsWith.call(hostname, \"[\") \? StringPrototypeSlice.call(hostname, 1, -1) : hostname,\n hash,\n search,\n pathname,\n path: `${pathname || \"\"}${search || \"\"}`,\n href,\n port: port \? Number(port) : protocol === \"https:\" \? 443 : protocol === \"http:\" \? 80 : void 0,\n auth: username || password \? `${decodeURIComponent(username)}:${decodeURIComponent(password)}` : void 0\n };\n}, validateHost = function(host, name) {\n if (host !== null && host !== void 0 && typeof host !== \"string\")\n throw new Error(\"Invalid arg type in options\");\n return host;\n}, checkIsHttpToken = function(val) {\n return RegExpPrototypeExec.call(tokenRegExp, val) !== null;\n};\nvar _writeHead = function(statusCode, reason, obj, response) {\n if (statusCode |= 0, statusCode < 100 || statusCode > 999)\n throw new Error(\"status code must be between 100 and 999\");\n if (typeof reason === \"string\")\n response.statusMessage = reason;\n else {\n if (!response.statusMessage)\n response.statusMessage = STATUS_CODES[statusCode] || \"unknown\";\n obj = reason;\n }\n response.statusCode = statusCode;\n {\n let k;\n if (Array.isArray(obj)) {\n if (obj.length % 2 !== 0)\n throw new Error(\"raw headers must have an even number of elements\");\n for (let n = 0;n < obj.length; n += 2)\n if (k = obj[n + 0], k)\n response.setHeader(k, obj[n + 1]);\n } else if (obj) {\n const keys = Object.keys(obj);\n for (let i = 0;i < keys.length; i++)\n if (k = keys[i], k)\n response.setHeader(k, obj[k]);\n }\n }\n if (statusCode === 204 || statusCode === 304 || statusCode >= 100 && statusCode <= 199)\n response._hasBody = !1;\n}, request = function(url, options, cb) {\n return new ClientRequest(url, options, cb);\n}, get = function(url, options, cb) {\n const req = request(url, options, cb);\n return req.end(), req;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { isTypedArray } = @requireNativeModule(\"util/types\"), { Duplex, Readable, Writable } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/, validateHeaderName = (name, label) => {\n if (typeof name !== \"string\" || !name || !checkIsHttpToken(name))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN\");\n}, validateHeaderValue = (name, value) => {\n if (value === void 0)\n throw new Error(\"ERR_HTTP_INVALID_HEADER_VALUE\");\n if (checkInvalidHeaderChar(value))\n throw new Error(\"ERR_INVALID_CHAR\");\n}, { URL } = globalThis, globalReportError = globalThis.reportError, setTimeout = globalThis.setTimeout, fetch = Bun.fetch;\nvar kEmptyObject = Object.freeze(Object.create(null)), kOutHeaders = Symbol.for(\"kOutHeaders\"), kEndCalled = Symbol.for(\"kEndCalled\"), kAbortController = Symbol.for(\"kAbortController\"), kClearTimeout = Symbol(\"kClearTimeout\"), kCorked = Symbol.for(\"kCorked\"), searchParamsSymbol = Symbol.for(\"query\"), StringPrototypeSlice = String.prototype.slice, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeToUpperCase = String.prototype.toUpperCase, StringPrototypeIncludes = String.prototype.includes, StringPrototypeCharCodeAt = String.prototype.charCodeAt, StringPrototypeIndexOf = String.prototype.indexOf, ArrayIsArray = Array.isArray, RegExpPrototypeExec = RegExp.prototype.exec, ObjectAssign = Object.assign;\nvar INVALID_PATH_REGEX = /[^\\u0021-\\u00ff]/;\nvar _defaultHTTPSAgent, kInternalRequest = Symbol(\"kInternalRequest\"), kInternalSocketData = Symbol.for(\"::bunternal::\"), kEmptyBuffer = Buffer.alloc(0);\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\nvar FakeSocket = class Socket extends Duplex {\n [kInternalSocketData];\n bytesRead = 0;\n bytesWritten = 0;\n connecting = !1;\n remoteAddress = null;\n remotePort;\n timeout = 0;\n isServer = !1;\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n connect(port, host, connectListener) {\n return this;\n }\n _destroy(err, callback) {\n }\n _final(callback) {\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return 80;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n return this;\n }\n unref() {\n }\n _write(chunk, encoding, callback) {\n }\n};\n\nclass Agent extends EventEmitter {\n defaultPort = 80;\n protocol = \"http:\";\n options;\n requests;\n sockets;\n freeSockets;\n keepAliveMsecs;\n keepAlive;\n maxSockets;\n maxFreeSockets;\n scheduling;\n maxTotalSockets;\n totalSocketCount;\n #fakeSocket;\n static get globalAgent() {\n return globalAgent;\n }\n static get defaultMaxSockets() {\n return Infinity;\n }\n constructor(options = kEmptyObject) {\n super();\n if (this.options = options = { ...options, path: null }, options.noDelay === void 0)\n options.noDelay = !0;\n this.requests = kEmptyObject, this.sockets = kEmptyObject, this.freeSockets = kEmptyObject, this.keepAliveMsecs = options.keepAliveMsecs || 1000, this.keepAlive = options.keepAlive || !1, this.maxSockets = options.maxSockets || Agent.defaultMaxSockets, this.maxFreeSockets = options.maxFreeSockets || 256, this.scheduling = options.scheduling || \"lifo\", this.maxTotalSockets = options.maxTotalSockets, this.totalSocketCount = 0, this.defaultPort = options.defaultPort || 80, this.protocol = options.protocol || \"http:\";\n }\n createConnection() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n getName(options = kEmptyObject) {\n let name = `http:${options.host || \"localhost\"}:`;\n if (options.port)\n name += options.port;\n if (name += \":\", options.localAddress)\n name += options.localAddress;\n if (options.family === 4 || options.family === 6)\n name += `:${options.family}`;\n if (options.socketPath)\n name += `:${options.socketPath}`;\n return name;\n }\n addRequest() {\n }\n createSocket(req, options, cb) {\n cb(null, this.#fakeSocket \?\?= new FakeSocket);\n }\n removeSocket() {\n }\n keepSocketAlive() {\n return !0;\n }\n reuseSocket() {\n }\n destroy() {\n }\n}\n\nclass Server extends EventEmitter {\n #server;\n #options;\n #tls;\n #is_tls = !1;\n listening = !1;\n serverName;\n constructor(options, callback) {\n super();\n if (typeof options === \"function\")\n callback = options, options = {};\n else if (options == null || typeof options === \"object\") {\n options = { ...options }, this.#tls = null;\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n let serverName = options.servername;\n if (serverName && typeof serverName !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n if (this.#is_tls)\n this.#tls = {\n serverName,\n key,\n cert,\n ca,\n passphrase,\n secureOptions\n };\n else\n this.#tls = null;\n } else\n throw new Error(\"bun-http-polyfill: invalid arguments\");\n if (this.#options = options, callback)\n this.on(\"request\", callback);\n }\n closeAllConnections() {\n const server = this.#server;\n if (!server)\n return;\n this.#server = void 0, server.stop(!0), this.emit(\"close\");\n }\n closeIdleConnections() {\n }\n close(optionalCallback) {\n const server = this.#server;\n if (!server) {\n if (typeof optionalCallback === \"function\")\n process.nextTick(optionalCallback, new Error(\"Server is not running\"));\n return;\n }\n if (this.#server = void 0, typeof optionalCallback === \"function\")\n this.once(\"close\", optionalCallback);\n server.stop(), this.emit(\"close\");\n }\n address() {\n if (!this.#server)\n return null;\n const address = this.#server.hostname;\n return {\n address,\n family: isIPv6(address) \? \"IPv6\" : \"IPv4\",\n port: this.#server.port\n };\n }\n listen(port, host, backlog, onListen) {\n const server = this;\n let socketPath;\n if (typeof port == \"string\" && !Number.isSafeInteger(Number(port)))\n socketPath = port;\n if (typeof host === \"function\")\n onListen = host, host = void 0;\n if (typeof port === \"function\")\n onListen = port;\n else if (typeof port === \"object\") {\n if (port\?.signal\?.addEventListener(\"abort\", () => {\n this.close();\n }), host = port\?.host, port = port\?.port, typeof port\?.callback === \"function\")\n onListen = port\?.callback;\n }\n if (typeof backlog === \"function\")\n onListen = backlog;\n const ResponseClass = this.#options.ServerResponse || ServerResponse, RequestClass = this.#options.IncomingMessage || IncomingMessage;\n try {\n const tls = this.#tls;\n if (tls)\n this.serverName = tls.serverName || host || \"localhost\";\n this.#server = Bun.serve({\n tls,\n port,\n hostname: host,\n unix: socketPath,\n websocket: {\n open(ws) {\n ws.data.open(ws);\n },\n message(ws, message) {\n ws.data.message(ws, message);\n },\n close(ws, code, reason) {\n ws.data.close(ws, code, reason);\n },\n drain(ws) {\n ws.data.drain(ws);\n }\n },\n fetch(req, _server) {\n var pendingResponse, pendingError, rejectFunction, resolveFunction, reject = (err) => {\n if (pendingError)\n return;\n if (pendingError = err, rejectFunction)\n rejectFunction(err);\n }, reply = function(resp) {\n if (pendingResponse)\n return;\n if (pendingResponse = resp, resolveFunction)\n resolveFunction(resp);\n };\n const http_req = new RequestClass(req), http_res = new ResponseClass({ reply, req: http_req });\n if (http_req.once(\"error\", (err) => reject(err)), http_res.once(\"error\", (err) => reject(err)), req.headers.get(\"upgrade\")) {\n const socket = http_req.socket;\n socket[kInternalSocketData] = [_server, http_res, req], server.emit(\"upgrade\", http_req, socket, kEmptyBuffer);\n } else\n server.emit(\"request\", http_req, http_res);\n if (pendingError)\n throw pendingError;\n if (pendingResponse)\n return pendingResponse;\n return new Promise((resolve, reject2) => {\n resolveFunction = resolve, rejectFunction = reject2;\n });\n }\n }), setTimeout(emitListeningNextTick, 1, this, onListen, null, this.#server.hostname, this.#server.port);\n } catch (err) {\n setTimeout(emitListeningNextTick, 1, this, onListen, err);\n }\n return this;\n }\n setTimeout(msecs, callback) {\n }\n}\nclass IncomingMessage extends Readable {\n method;\n complete;\n constructor(req, defaultIncomingOpts) {\n const method = req.method;\n super();\n const url = new URL(req.url);\n var { type = \"request\", [kInternalRequest]: nodeReq } = defaultIncomingOpts || {};\n this.#noBody = type === \"request\" \? method === \"GET\" || method === \"HEAD\" || method === \"TRACE\" || method === \"CONNECT\" || method === \"OPTIONS\" || (parseInt(req.headers.get(\"Content-Length\") || \"\") || 0) === 0 : !1, this.#req = req, this.method = method, this.#type = type, this.complete = !!this.#noBody, this.#bodyStream = void 0;\n const socket = new FakeSocket;\n socket.remoteAddress = url.hostname, socket.remotePort = url.port, this.#fakeSocket = socket, this.url = url.pathname + url.search, this.#nodeReq = this.req = nodeReq, assignHeaders(this, req);\n }\n headers;\n rawHeaders;\n _consuming = !1;\n _dumped = !1;\n #bodyStream;\n #fakeSocket;\n #noBody = !1;\n #aborted = !1;\n #req;\n url;\n #type;\n #nodeReq;\n _construct(callback) {\n if (this.#type === \"response\" || this.#noBody) {\n callback();\n return;\n }\n const contentLength = this.#req.headers.get(\"content-length\");\n if ((contentLength \? parseInt(contentLength, 10) : 0) === 0) {\n this.#noBody = !0, callback();\n return;\n }\n callback();\n }\n async#consumeStream(reader) {\n while (!0) {\n var { done, value } = await reader.readMany();\n if (this.#aborted)\n return;\n if (done) {\n this.push(null), this.destroy();\n break;\n }\n for (var v of value)\n this.push(v);\n }\n }\n _read(size) {\n if (this.#noBody)\n this.push(null), this.complete = !0;\n else if (this.#bodyStream == null) {\n const reader = this.#req.body\?.getReader();\n if (!reader) {\n this.push(null);\n return;\n }\n this.#bodyStream = reader, this.#consumeStream(reader);\n }\n }\n get aborted() {\n return this.#aborted;\n }\n #abort() {\n if (this.#aborted)\n return;\n this.#aborted = !0;\n var bodyStream = this.#bodyStream;\n if (!bodyStream)\n return;\n bodyStream.cancel(), this.complete = !0, this.#bodyStream = void 0, this.push(null);\n }\n get connection() {\n return this.#fakeSocket;\n }\n get statusCode() {\n return this.#req.status;\n }\n get statusMessage() {\n return STATUS_CODES[this.#req.status];\n }\n get httpVersion() {\n return \"1.1\";\n }\n get rawTrailers() {\n return [];\n }\n get httpVersionMajor() {\n return 1;\n }\n get httpVersionMinor() {\n return 1;\n }\n get trailers() {\n return kEmptyObject;\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n}\n\nclass OutgoingMessage extends Writable {\n constructor() {\n super(...arguments);\n }\n #headers;\n headersSent = !1;\n sendDate = !0;\n req;\n timeout;\n #finished = !1;\n [kEndCalled] = !1;\n #fakeSocket;\n #timeoutTimer;\n [kAbortController] = null;\n _implicitHeader() {\n }\n get headers() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n get connection() {\n return this.socket;\n }\n get finished() {\n return this.#finished;\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.removeAllListeners(\"timeout\"), this.#timeoutTimer = void 0;\n }\n #onTimeout() {\n this.#timeoutTimer = void 0, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = void 0;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== void 0)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar OriginalWriteHeadFn, OriginalImplicitHeadFn;\n\nclass ServerResponse extends Writable {\n constructor({ req, reply }) {\n super();\n if (this.req = req, this._reply = reply, this.sendDate = !0, this.statusCode = 200, this.headersSent = !1, this.statusMessage = void 0, this.#controller = void 0, this.#firstWrite = void 0, this._writableState.decodeStrings = !1, this.#deferred = void 0, req.method === \"HEAD\")\n this._hasBody = !1;\n }\n req;\n _reply;\n sendDate;\n statusCode;\n #headers;\n headersSent = !1;\n statusMessage;\n #controller;\n #firstWrite;\n _sent100 = !1;\n _defaultKeepAlive = !1;\n _removedConnection = !1;\n _removedContLen = !1;\n _hasBody = !0;\n #deferred = void 0;\n #finished = !1;\n _implicitHeader() {\n this.writeHead(this.statusCode);\n }\n _write(chunk, encoding, callback) {\n if (!this.#firstWrite && !this.headersSent) {\n this.#firstWrite = chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n controller.write(chunk), callback();\n });\n }\n _writev(chunks, callback) {\n if (chunks.length === 1 && !this.headersSent && !this.#firstWrite) {\n this.#firstWrite = chunks[0].chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n for (let chunk of chunks)\n controller.write(chunk.chunk);\n callback();\n });\n }\n #ensureReadableStreamController(run) {\n var thisController = this.#controller;\n if (thisController)\n return run(thisController);\n this.headersSent = !0;\n var firstWrite = this.#firstWrite;\n this.#firstWrite = void 0, this._reply(new Response(new ReadableStream({\n type: \"direct\",\n pull: (controller) => {\n if (this.#controller = controller, firstWrite)\n controller.write(firstWrite);\n if (firstWrite = void 0, run(controller), !this.#finished)\n return new Promise((resolve) => {\n this.#deferred = resolve;\n });\n }\n }), {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n }));\n }\n #drainHeadersIfObservable() {\n if (this._implicitHeader === OriginalImplicitHeadFn && this.writeHead === OriginalWriteHeadFn)\n return;\n this._implicitHeader();\n }\n _final(callback) {\n if (!this.headersSent) {\n var data = this.#firstWrite || \"\";\n this.#firstWrite = void 0, this.#finished = !0, this.#drainHeadersIfObservable(), this._reply(new Response(data, {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n })), callback && callback();\n return;\n }\n this.#finished = !0, this.#ensureReadableStreamController((controller) => {\n controller.end(), callback();\n var deferred = this.#deferred;\n if (deferred)\n this.#deferred = void 0, deferred();\n });\n }\n writeProcessing() {\n throw new Error(\"not implemented\");\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n assignSocket(socket) {\n throw new Error(\"not implemented\");\n }\n detachSocket(socket) {\n throw new Error(\"not implemented\");\n }\n writeContinue(callback) {\n throw new Error(\"not implemented\");\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n var headers = this.#headers;\n if (!headers)\n return kEmptyObject;\n return headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n writeHead(statusCode, statusMessage, headers) {\n return _writeHead(statusCode, statusMessage, headers, this), this;\n }\n}\nOriginalWriteHeadFn = ServerResponse.prototype.writeHead;\nOriginalImplicitHeadFn = ServerResponse.prototype._implicitHeader;\n\nclass ClientRequest extends OutgoingMessage {\n #timeout;\n #res = null;\n #upgradeOrConnect = !1;\n #parser = null;\n #maxHeadersCount = null;\n #reusedSocket = !1;\n #host;\n #protocol;\n #method;\n #port;\n #useDefaultPort;\n #joinDuplicateHeaders;\n #maxHeaderSize;\n #agent = globalAgent;\n #path;\n #socketPath;\n #bodyChunks = null;\n #fetchRequest;\n #signal = null;\n [kAbortController] = null;\n #timeoutTimer = void 0;\n #options;\n #finished;\n get path() {\n return this.#path;\n }\n get port() {\n return this.#port;\n }\n get method() {\n return this.#method;\n }\n get host() {\n return this.#host;\n }\n get protocol() {\n return this.#protocol;\n }\n _write(chunk, encoding, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = [chunk], callback();\n return;\n }\n this.#bodyChunks.push(chunk), callback();\n }\n _writev(chunks, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = chunks, callback();\n return;\n }\n this.#bodyChunks.push(...chunks), callback();\n }\n _final(callback) {\n if (this.#finished = !0, this[kAbortController] = new AbortController, this[kAbortController].signal.addEventListener(\"abort\", () => {\n this[kClearTimeout]();\n }), this.#signal\?.aborted)\n this[kAbortController].abort();\n var method = this.#method, body = this.#bodyChunks\?.length === 1 \? this.#bodyChunks[0] : Buffer.concat(this.#bodyChunks || []);\n let url, proxy;\n if (this.#path.startsWith(\"http://\") || this.#path.startsWith(\"https://\"))\n url = this.#path, proxy = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}`;\n else\n url = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}${this.#path}`;\n try {\n this.#fetchRequest = fetch(url, {\n method,\n headers: this.getHeaders(),\n body: body && method !== \"GET\" && method !== \"HEAD\" && method !== \"OPTIONS\" \? body : void 0,\n redirect: \"manual\",\n verbose: !1,\n signal: this[kAbortController].signal,\n proxy,\n timeout: !1,\n decompress: !1\n }).then((response) => {\n var res = this.#res = new IncomingMessage(response, {\n type: \"response\",\n [kInternalRequest]: this\n });\n this.emit(\"response\", res);\n }).catch((err) => {\n this.emit(\"error\", err);\n }).finally(() => {\n this.#fetchRequest = null, this[kClearTimeout]();\n });\n } catch (err) {\n this.emit(\"error\", err);\n } finally {\n callback();\n }\n }\n get aborted() {\n return this.#signal\?.aborted || !!this[kAbortController]\?.signal.aborted;\n }\n abort() {\n if (this.aborted)\n return;\n this[kAbortController].abort();\n }\n constructor(input, options, cb) {\n super();\n if (typeof input === \"string\") {\n const urlStr = input;\n try {\n var urlObject = new URL(urlStr);\n } catch (e) {\n @throwTypeError(`Invalid URL: ${urlStr}`);\n }\n input = urlToHttpOptions(urlObject);\n } else if (input && typeof input === \"object\" && input instanceof URL)\n input = urlToHttpOptions(input);\n else\n cb = options, options = input, input = null;\n if (typeof options === \"function\")\n cb = options, options = input || kEmptyObject;\n else\n options = ObjectAssign(input || {}, options);\n var defaultAgent = options._defaultAgent || Agent.globalAgent;\n let protocol = options.protocol;\n if (!protocol)\n if (options.port === 443)\n protocol = \"https:\";\n else\n protocol = defaultAgent.protocol || \"http:\";\n switch (this.#protocol = protocol, this.#agent\?.protocol) {\n case void 0:\n break;\n case \"http:\":\n if (protocol === \"https:\") {\n defaultAgent = this.#agent = getDefaultHTTPSAgent();\n break;\n }\n case \"https:\":\n if (protocol === \"https\") {\n defaultAgent = this.#agent = Agent.globalAgent;\n break;\n }\n default:\n break;\n }\n if (options.path) {\n const path = String(options.path);\n if (RegExpPrototypeExec.call(INVALID_PATH_REGEX, path) !== null)\n throw new Error(\"Path contains unescaped characters\");\n }\n if (protocol !== \"http:\" && protocol !== \"https:\" && protocol) {\n const expectedProtocol = defaultAgent\?.protocol \?\? \"http:\";\n throw new Error(`Protocol mismatch. Expected: ${expectedProtocol}. Got: ${protocol}`);\n }\n const defaultPort = protocol === \"https:\" \? 443 : 80;\n this.#port = options.port || options.defaultPort || this.#agent\?.defaultPort || defaultPort, this.#useDefaultPort = this.#port === defaultPort;\n const host = this.#host = options.host = validateHost(options.hostname, \"hostname\") || validateHost(options.host, \"host\") || \"localhost\";\n this.#socketPath = options.socketPath;\n const signal = options.signal;\n if (signal)\n signal.addEventListener(\"abort\", () => {\n this[kAbortController]\?.abort();\n }), this.#signal = signal;\n let method = options.method;\n const methodIsString = typeof method === \"string\";\n if (method !== null && method !== void 0 && !methodIsString)\n throw new Error(\"ERR_INVALID_ARG_TYPE: options.method\");\n if (methodIsString && method) {\n if (!checkIsHttpToken(method))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN: Method\");\n method = this.#method = StringPrototypeToUpperCase.call(method);\n } else\n method = this.#method = \"GET\";\n const _maxHeaderSize = options.maxHeaderSize;\n this.#maxHeaderSize = _maxHeaderSize;\n var _joinDuplicateHeaders = options.joinDuplicateHeaders;\n if (this.#joinDuplicateHeaders = _joinDuplicateHeaders, this.#path = options.path || \"/\", cb)\n this.once(\"response\", cb);\n this.#finished = !1, this.#res = null, this.#upgradeOrConnect = !1, this.#parser = null, this.#maxHeadersCount = null, this.#reusedSocket = !1, this.#host = host, this.#protocol = protocol;\n var timeout = options.timeout;\n if (timeout !== void 0 && timeout !== 0)\n this.setTimeout(timeout, void 0);\n if (!ArrayIsArray(headers)) {\n var headers = options.headers;\n if (headers)\n for (let key in headers)\n this.setHeader(key, headers[key]);\n var auth = options.auth;\n if (auth && !this.getHeader(\"Authorization\"))\n this.setHeader(\"Authorization\", \"Basic \" + Buffer.from(auth).toString(\"base64\"));\n }\n var { signal: _signal, ...optsWithoutSignal } = options;\n this.#options = optsWithoutSignal;\n }\n setSocketKeepAlive(enable = !0, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.#timeoutTimer = void 0, this.removeAllListeners(\"timeout\");\n }\n #onTimeout() {\n this.#timeoutTimer = void 0, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = void 0;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== void 0)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/, METHODS = [\n \"ACL\",\n \"BIND\",\n \"CHECKOUT\",\n \"CONNECT\",\n \"COPY\",\n \"DELETE\",\n \"GET\",\n \"HEAD\",\n \"LINK\",\n \"LOCK\",\n \"M-SEARCH\",\n \"MERGE\",\n \"MKACTIVITY\",\n \"MKCALENDAR\",\n \"MKCOL\",\n \"MOVE\",\n \"NOTIFY\",\n \"OPTIONS\",\n \"PATCH\",\n \"POST\",\n \"PROPFIND\",\n \"PROPPATCH\",\n \"PURGE\",\n \"PUT\",\n \"REBIND\",\n \"REPORT\",\n \"SEARCH\",\n \"SOURCE\",\n \"SUBSCRIBE\",\n \"TRACE\",\n \"UNBIND\",\n \"UNLINK\",\n \"UNLOCK\",\n \"UNSUBSCRIBE\"\n], STATUS_CODES = {\n 100: \"Continue\",\n 101: \"Switching Protocols\",\n 102: \"Processing\",\n 103: \"Early Hints\",\n 200: \"OK\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"Non-Authoritative Information\",\n 204: \"No Content\",\n 205: \"Reset Content\",\n 206: \"Partial Content\",\n 207: \"Multi-Status\",\n 208: \"Already Reported\",\n 226: \"IM Used\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Found\",\n 303: \"See Other\",\n 304: \"Not Modified\",\n 305: \"Use Proxy\",\n 307: \"Temporary Redirect\",\n 308: \"Permanent Redirect\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a Teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 425: \"Too Early\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Request Header Fields Too Large\",\n 451: \"Unavailable For Legal Reasons\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 509: \"Bandwidth Limit Exceeded\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\"\n}, globalAgent = new Agent;\n$ = {\n Agent,\n Server,\n METHODS,\n STATUS_CODES,\n createServer,\n ServerResponse,\n IncomingMessage,\n request,\n get,\n maxHeaderSize: 16384,\n validateHeaderName,\n validateHeaderValue,\n setMaxIdleHTTPParsers(max) {\n },\n globalAgent,\n ClientRequest,\n OutgoingMessage\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeFSPromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/fs.promises.ts\nvar watch = function(filename, options = {}) {\n if (filename instanceof URL)\n @throwTypeError(\"Watch URLs are not supported yet\");\n else if (@Buffer.isBuffer(filename))\n filename = filename.toString();\n else if (typeof filename !== \"string\")\n @throwTypeError(\"Expected path to be a string or Buffer\");\n let nextEventResolve = null;\n if (typeof options === \"string\")\n options = { encoding: options };\n const queue = @createFIFO(), watcher = fs.watch(filename, options || {}, (eventType, filename2) => {\n if (queue.push({ eventType, filename: filename2 }), nextEventResolve) {\n const resolve = nextEventResolve;\n nextEventResolve = null, resolve();\n }\n });\n return {\n [Symbol.asyncIterator]() {\n let closed = !1;\n return {\n async next() {\n while (!closed) {\n let event;\n while (event = queue.shift()) {\n if (event.eventType === \"close\")\n return closed = !0, { value: @undefined, done: !0 };\n if (event.eventType === \"error\")\n throw closed = !0, event.filename;\n return { value: event, done: !1 };\n }\n const { promise, resolve } = @Promise.withResolvers();\n nextEventResolve = resolve, await promise;\n }\n return { value: @undefined, done: !0 };\n },\n return() {\n if (!closed) {\n if (watcher.close(), closed = !0, nextEventResolve) {\n const resolve = nextEventResolve;\n nextEventResolve = null, resolve();\n }\n }\n return { value: @undefined, done: !0 };\n }\n };\n }\n };\n}, cp = function(src, dest, options) {\n if (!options)\n return fs.cp(src, dest);\n if (typeof options !== \"object\")\n @throwTypeError(\"options must be an object\");\n if (options.dereference || options.filter || options.preserveTimestamps || options.verbatimSymlinks) {\n if (!lazy_cp)\n lazy_cp = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3);\n return lazy_cp(src, dest, options);\n }\n return fs.cp(src, dest, options.recursive, options.errorOnExist, options.force \?\? !0, options.mode);\n};\nasync function opendir(dir) {\n const entries = await fs.readdir(dir, { withFileTypes: !0 });\n return new Dir(entries);\n}\nvar $, constants = @processBindingConstants.fs, fs = Bun.fs();\nvar lazy_cp = null;\n\nclass Dir {\n #entries;\n constructor(e) {\n this.#entries = e;\n }\n readSync() {\n return this.#entries.shift() \?\? null;\n }\n read(c) {\n if (c)\n process.nextTick(c, null, this.readSync());\n return @Promise.resolve(this.readSync());\n }\n closeSync() {\n }\n close(c) {\n if (c)\n process.nextTick(c);\n return @Promise.resolve();\n }\n *[Symbol.asyncIterator]() {\n var next;\n while (next = this.readSync())\n yield next;\n }\n}\n$ = {\n access: fs.access.bind(fs),\n appendFile: fs.appendFile.bind(fs),\n close: fs.close.bind(fs),\n copyFile: fs.copyFile.bind(fs),\n cp,\n exists: fs.exists.bind(fs),\n chown: fs.chown.bind(fs),\n chmod: fs.chmod.bind(fs),\n fchmod: fs.fchmod.bind(fs),\n fchown: fs.fchown.bind(fs),\n fstat: fs.fstat.bind(fs),\n fsync: fs.fsync.bind(fs),\n ftruncate: fs.ftruncate.bind(fs),\n futimes: fs.futimes.bind(fs),\n lchmod: fs.lchmod.bind(fs),\n lchown: fs.lchown.bind(fs),\n link: fs.link.bind(fs),\n lstat: fs.lstat.bind(fs),\n mkdir: fs.mkdir.bind(fs),\n mkdtemp: fs.mkdtemp.bind(fs),\n open: fs.open.bind(fs),\n read: fs.read.bind(fs),\n write: fs.write.bind(fs),\n readdir: fs.readdir.bind(fs),\n readFile: fs.readFile.bind(fs),\n writeFile: fs.writeFile.bind(fs),\n readlink: fs.readlink.bind(fs),\n realpath: fs.realpath.bind(fs),\n rename: fs.rename.bind(fs),\n stat: fs.stat.bind(fs),\n symlink: fs.symlink.bind(fs),\n truncate: fs.truncate.bind(fs),\n unlink: fs.unlink.bind(fs),\n utimes: fs.utimes.bind(fs),\n lutimes: fs.lutimes.bind(fs),\n rm: fs.rm.bind(fs),\n rmdir: fs.rmdir.bind(fs),\n writev: async (fd, buffers, position) => {\n var bytesWritten = await fs.writev(fd, buffers, position);\n return {\n bytesWritten,\n buffers\n };\n },\n readv: async (fd, buffers, position) => {\n var bytesRead = await fs.readv(fd, buffers, position);\n return {\n bytesRead,\n buffers\n };\n },\n constants,\n watch,\n opendir\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeHttp2Code = "(function (){\"use strict\";// src/js/out/tmp/node/http2.ts\nvar connect = function() {\n throwNotImplemented(\"node:http2 connect\", 887);\n}, createServer = function() {\n throwNotImplemented(\"node:http2 createServer\", 887);\n}, createSecureServer = function() {\n throwNotImplemented(\"node:http2 createSecureServer\", 887);\n}, getDefaultSettings = function() {\n return {\n headerTableSize: 4096,\n enablePush: !0,\n initialWindowSize: 65535,\n maxFrameSize: 16384,\n maxConcurrentStreams: 4294967295,\n maxHeaderSize: 65535,\n maxHeaderListSize: 65535,\n enableConnectProtocol: !1\n };\n}, getPackedSettings = function() {\n return Buffer.alloc(0);\n}, getUnpackedSettings = function() {\n return Buffer.alloc(0);\n}, Http2ServerRequest = function() {\n throwNotImplemented(\"node:http2 Http2ServerRequest\", 887);\n}, Http2ServerResponse = function() {\n throwNotImplemented(\"node:http2 Http2ServerResponse\", 887);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), constants = {\n NGHTTP2_ERR_FRAME_SIZE_ERROR: -522,\n NGHTTP2_SESSION_SERVER: 0,\n NGHTTP2_SESSION_CLIENT: 1,\n NGHTTP2_STREAM_STATE_IDLE: 1,\n NGHTTP2_STREAM_STATE_OPEN: 2,\n NGHTTP2_STREAM_STATE_RESERVED_LOCAL: 3,\n NGHTTP2_STREAM_STATE_RESERVED_REMOTE: 4,\n NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: 5,\n NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: 6,\n NGHTTP2_STREAM_STATE_CLOSED: 7,\n NGHTTP2_FLAG_NONE: 0,\n NGHTTP2_FLAG_END_STREAM: 1,\n NGHTTP2_FLAG_END_HEADERS: 4,\n NGHTTP2_FLAG_ACK: 1,\n NGHTTP2_FLAG_PADDED: 8,\n NGHTTP2_FLAG_PRIORITY: 32,\n DEFAULT_SETTINGS_HEADER_TABLE_SIZE: 4096,\n DEFAULT_SETTINGS_ENABLE_PUSH: 1,\n DEFAULT_SETTINGS_MAX_CONCURRENT_STREAMS: 4294967295,\n DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: 65535,\n DEFAULT_SETTINGS_MAX_FRAME_SIZE: 16384,\n DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE: 65535,\n DEFAULT_SETTINGS_ENABLE_CONNECT_PROTOCOL: 0,\n MAX_MAX_FRAME_SIZE: 16777215,\n MIN_MAX_FRAME_SIZE: 16384,\n MAX_INITIAL_WINDOW_SIZE: 2147483647,\n NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: 1,\n NGHTTP2_SETTINGS_ENABLE_PUSH: 2,\n NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: 3,\n NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: 4,\n NGHTTP2_SETTINGS_MAX_FRAME_SIZE: 5,\n NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: 6,\n NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL: 8,\n PADDING_STRATEGY_NONE: 0,\n PADDING_STRATEGY_ALIGNED: 1,\n PADDING_STRATEGY_MAX: 2,\n PADDING_STRATEGY_CALLBACK: 1,\n NGHTTP2_NO_ERROR: 0,\n NGHTTP2_PROTOCOL_ERROR: 1,\n NGHTTP2_INTERNAL_ERROR: 2,\n NGHTTP2_FLOW_CONTROL_ERROR: 3,\n NGHTTP2_SETTINGS_TIMEOUT: 4,\n NGHTTP2_STREAM_CLOSED: 5,\n NGHTTP2_FRAME_SIZE_ERROR: 6,\n NGHTTP2_REFUSED_STREAM: 7,\n NGHTTP2_CANCEL: 8,\n NGHTTP2_COMPRESSION_ERROR: 9,\n NGHTTP2_CONNECT_ERROR: 10,\n NGHTTP2_ENHANCE_YOUR_CALM: 11,\n NGHTTP2_INADEQUATE_SECURITY: 12,\n NGHTTP2_HTTP_1_1_REQUIRED: 13,\n NGHTTP2_DEFAULT_WEIGHT: 16,\n HTTP2_HEADER_STATUS: \":status\",\n HTTP2_HEADER_METHOD: \":method\",\n HTTP2_HEADER_AUTHORITY: \":authority\",\n HTTP2_HEADER_SCHEME: \":scheme\",\n HTTP2_HEADER_PATH: \":path\",\n HTTP2_HEADER_PROTOCOL: \":protocol\",\n HTTP2_HEADER_ACCEPT_ENCODING: \"accept-encoding\",\n HTTP2_HEADER_ACCEPT_LANGUAGE: \"accept-language\",\n HTTP2_HEADER_ACCEPT_RANGES: \"accept-ranges\",\n HTTP2_HEADER_ACCEPT: \"accept\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS: \"access-control-allow-credentials\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_HEADERS: \"access-control-allow-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_METHODS: \"access-control-allow-methods\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: \"access-control-allow-origin\",\n HTTP2_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS: \"access-control-expose-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_REQUEST_HEADERS: \"access-control-request-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_REQUEST_METHOD: \"access-control-request-method\",\n HTTP2_HEADER_AGE: \"age\",\n HTTP2_HEADER_AUTHORIZATION: \"authorization\",\n HTTP2_HEADER_CACHE_CONTROL: \"cache-control\",\n HTTP2_HEADER_CONNECTION: \"connection\",\n HTTP2_HEADER_CONTENT_DISPOSITION: \"content-disposition\",\n HTTP2_HEADER_CONTENT_ENCODING: \"content-encoding\",\n HTTP2_HEADER_CONTENT_LENGTH: \"content-length\",\n HTTP2_HEADER_CONTENT_TYPE: \"content-type\",\n HTTP2_HEADER_COOKIE: \"cookie\",\n HTTP2_HEADER_DATE: \"date\",\n HTTP2_HEADER_ETAG: \"etag\",\n HTTP2_HEADER_FORWARDED: \"forwarded\",\n HTTP2_HEADER_HOST: \"host\",\n HTTP2_HEADER_IF_MODIFIED_SINCE: \"if-modified-since\",\n HTTP2_HEADER_IF_NONE_MATCH: \"if-none-match\",\n HTTP2_HEADER_IF_RANGE: \"if-range\",\n HTTP2_HEADER_LAST_MODIFIED: \"last-modified\",\n HTTP2_HEADER_LINK: \"link\",\n HTTP2_HEADER_LOCATION: \"location\",\n HTTP2_HEADER_RANGE: \"range\",\n HTTP2_HEADER_REFERER: \"referer\",\n HTTP2_HEADER_SERVER: \"server\",\n HTTP2_HEADER_SET_COOKIE: \"set-cookie\",\n HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: \"strict-transport-security\",\n HTTP2_HEADER_TRANSFER_ENCODING: \"transfer-encoding\",\n HTTP2_HEADER_TE: \"te\",\n HTTP2_HEADER_UPGRADE_INSECURE_REQUESTS: \"upgrade-insecure-requests\",\n HTTP2_HEADER_UPGRADE: \"upgrade\",\n HTTP2_HEADER_USER_AGENT: \"user-agent\",\n HTTP2_HEADER_VARY: \"vary\",\n HTTP2_HEADER_X_CONTENT_TYPE_OPTIONS: \"x-content-type-options\",\n HTTP2_HEADER_X_FRAME_OPTIONS: \"x-frame-options\",\n HTTP2_HEADER_KEEP_ALIVE: \"keep-alive\",\n HTTP2_HEADER_PROXY_CONNECTION: \"proxy-connection\",\n HTTP2_HEADER_X_XSS_PROTECTION: \"x-xss-protection\",\n HTTP2_HEADER_ALT_SVC: \"alt-svc\",\n HTTP2_HEADER_CONTENT_SECURITY_POLICY: \"content-security-policy\",\n HTTP2_HEADER_EARLY_DATA: \"early-data\",\n HTTP2_HEADER_EXPECT_CT: \"expect-ct\",\n HTTP2_HEADER_ORIGIN: \"origin\",\n HTTP2_HEADER_PURPOSE: \"purpose\",\n HTTP2_HEADER_TIMING_ALLOW_ORIGIN: \"timing-allow-origin\",\n HTTP2_HEADER_X_FORWARDED_FOR: \"x-forwarded-for\",\n HTTP2_HEADER_PRIORITY: \"priority\",\n HTTP2_HEADER_ACCEPT_CHARSET: \"accept-charset\",\n HTTP2_HEADER_ACCESS_CONTROL_MAX_AGE: \"access-control-max-age\",\n HTTP2_HEADER_ALLOW: \"allow\",\n HTTP2_HEADER_CONTENT_LANGUAGE: \"content-language\",\n HTTP2_HEADER_CONTENT_LOCATION: \"content-location\",\n HTTP2_HEADER_CONTENT_MD5: \"content-md5\",\n HTTP2_HEADER_CONTENT_RANGE: \"content-range\",\n HTTP2_HEADER_DNT: \"dnt\",\n HTTP2_HEADER_EXPECT: \"expect\",\n HTTP2_HEADER_EXPIRES: \"expires\",\n HTTP2_HEADER_FROM: \"from\",\n HTTP2_HEADER_IF_MATCH: \"if-match\",\n HTTP2_HEADER_IF_UNMODIFIED_SINCE: \"if-unmodified-since\",\n HTTP2_HEADER_MAX_FORWARDS: \"max-forwards\",\n HTTP2_HEADER_PREFER: \"prefer\",\n HTTP2_HEADER_PROXY_AUTHENTICATE: \"proxy-authenticate\",\n HTTP2_HEADER_PROXY_AUTHORIZATION: \"proxy-authorization\",\n HTTP2_HEADER_REFRESH: \"refresh\",\n HTTP2_HEADER_RETRY_AFTER: \"retry-after\",\n HTTP2_HEADER_TRAILER: \"trailer\",\n HTTP2_HEADER_TK: \"tk\",\n HTTP2_HEADER_VIA: \"via\",\n HTTP2_HEADER_WARNING: \"warning\",\n HTTP2_HEADER_WWW_AUTHENTICATE: \"www-authenticate\",\n HTTP2_HEADER_HTTP2_SETTINGS: \"http2-settings\",\n HTTP2_METHOD_ACL: \"ACL\",\n HTTP2_METHOD_BASELINE_CONTROL: \"BASELINE-CONTROL\",\n HTTP2_METHOD_BIND: \"BIND\",\n HTTP2_METHOD_CHECKIN: \"CHECKIN\",\n HTTP2_METHOD_CHECKOUT: \"CHECKOUT\",\n HTTP2_METHOD_CONNECT: \"CONNECT\",\n HTTP2_METHOD_COPY: \"COPY\",\n HTTP2_METHOD_DELETE: \"DELETE\",\n HTTP2_METHOD_GET: \"GET\",\n HTTP2_METHOD_HEAD: \"HEAD\",\n HTTP2_METHOD_LABEL: \"LABEL\",\n HTTP2_METHOD_LINK: \"LINK\",\n HTTP2_METHOD_LOCK: \"LOCK\",\n HTTP2_METHOD_MERGE: \"MERGE\",\n HTTP2_METHOD_MKACTIVITY: \"MKACTIVITY\",\n HTTP2_METHOD_MKCALENDAR: \"MKCALENDAR\",\n HTTP2_METHOD_MKCOL: \"MKCOL\",\n HTTP2_METHOD_MKREDIRECTREF: \"MKREDIRECTREF\",\n HTTP2_METHOD_MKWORKSPACE: \"MKWORKSPACE\",\n HTTP2_METHOD_MOVE: \"MOVE\",\n HTTP2_METHOD_OPTIONS: \"OPTIONS\",\n HTTP2_METHOD_ORDERPATCH: \"ORDERPATCH\",\n HTTP2_METHOD_PATCH: \"PATCH\",\n HTTP2_METHOD_POST: \"POST\",\n HTTP2_METHOD_PRI: \"PRI\",\n HTTP2_METHOD_PROPFIND: \"PROPFIND\",\n HTTP2_METHOD_PROPPATCH: \"PROPPATCH\",\n HTTP2_METHOD_PUT: \"PUT\",\n HTTP2_METHOD_REBIND: \"REBIND\",\n HTTP2_METHOD_REPORT: \"REPORT\",\n HTTP2_METHOD_SEARCH: \"SEARCH\",\n HTTP2_METHOD_TRACE: \"TRACE\",\n HTTP2_METHOD_UNBIND: \"UNBIND\",\n HTTP2_METHOD_UNCHECKOUT: \"UNCHECKOUT\",\n HTTP2_METHOD_UNLINK: \"UNLINK\",\n HTTP2_METHOD_UNLOCK: \"UNLOCK\",\n HTTP2_METHOD_UPDATE: \"UPDATE\",\n HTTP2_METHOD_UPDATEREDIRECTREF: \"UPDATEREDIRECTREF\",\n HTTP2_METHOD_VERSION_CONTROL: \"VERSION-CONTROL\",\n HTTP_STATUS_CONTINUE: 100,\n HTTP_STATUS_SWITCHING_PROTOCOLS: 101,\n HTTP_STATUS_PROCESSING: 102,\n HTTP_STATUS_EARLY_HINTS: 103,\n HTTP_STATUS_OK: 200,\n HTTP_STATUS_CREATED: 201,\n HTTP_STATUS_ACCEPTED: 202,\n HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: 203,\n HTTP_STATUS_NO_CONTENT: 204,\n HTTP_STATUS_RESET_CONTENT: 205,\n HTTP_STATUS_PARTIAL_CONTENT: 206,\n HTTP_STATUS_MULTI_STATUS: 207,\n HTTP_STATUS_ALREADY_REPORTED: 208,\n HTTP_STATUS_IM_USED: 226,\n HTTP_STATUS_MULTIPLE_CHOICES: 300,\n HTTP_STATUS_MOVED_PERMANENTLY: 301,\n HTTP_STATUS_FOUND: 302,\n HTTP_STATUS_SEE_OTHER: 303,\n HTTP_STATUS_NOT_MODIFIED: 304,\n HTTP_STATUS_USE_PROXY: 305,\n HTTP_STATUS_TEMPORARY_REDIRECT: 307,\n HTTP_STATUS_PERMANENT_REDIRECT: 308,\n HTTP_STATUS_BAD_REQUEST: 400,\n HTTP_STATUS_UNAUTHORIZED: 401,\n HTTP_STATUS_PAYMENT_REQUIRED: 402,\n HTTP_STATUS_FORBIDDEN: 403,\n HTTP_STATUS_NOT_FOUND: 404,\n HTTP_STATUS_METHOD_NOT_ALLOWED: 405,\n HTTP_STATUS_NOT_ACCEPTABLE: 406,\n HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: 407,\n HTTP_STATUS_REQUEST_TIMEOUT: 408,\n HTTP_STATUS_CONFLICT: 409,\n HTTP_STATUS_GONE: 410,\n HTTP_STATUS_LENGTH_REQUIRED: 411,\n HTTP_STATUS_PRECONDITION_FAILED: 412,\n HTTP_STATUS_PAYLOAD_TOO_LARGE: 413,\n HTTP_STATUS_URI_TOO_LONG: 414,\n HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: 415,\n HTTP_STATUS_RANGE_NOT_SATISFIABLE: 416,\n HTTP_STATUS_EXPECTATION_FAILED: 417,\n HTTP_STATUS_TEAPOT: 418,\n HTTP_STATUS_MISDIRECTED_REQUEST: 421,\n HTTP_STATUS_UNPROCESSABLE_ENTITY: 422,\n HTTP_STATUS_LOCKED: 423,\n HTTP_STATUS_FAILED_DEPENDENCY: 424,\n HTTP_STATUS_TOO_EARLY: 425,\n HTTP_STATUS_UPGRADE_REQUIRED: 426,\n HTTP_STATUS_PRECONDITION_REQUIRED: 428,\n HTTP_STATUS_TOO_MANY_REQUESTS: 429,\n HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: 431,\n HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: 451,\n HTTP_STATUS_INTERNAL_SERVER_ERROR: 500,\n HTTP_STATUS_NOT_IMPLEMENTED: 501,\n HTTP_STATUS_BAD_GATEWAY: 502,\n HTTP_STATUS_SERVICE_UNAVAILABLE: 503,\n HTTP_STATUS_GATEWAY_TIMEOUT: 504,\n HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: 505,\n HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: 506,\n HTTP_STATUS_INSUFFICIENT_STORAGE: 507,\n HTTP_STATUS_LOOP_DETECTED: 508,\n HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: 509,\n HTTP_STATUS_NOT_EXTENDED: 510,\n HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: 511\n}, sensitiveHeaders = Symbol.for(\"nodejs.http2.sensitiveHeaders\");\nHttp2ServerRequest.prototype = {};\nHttp2ServerResponse.prototype = {};\n$ = {\n constants,\n createServer,\n createSecureServer,\n getDefaultSettings,\n getPackedSettings,\n getUnpackedSettings,\n sensitiveHeaders,\n Http2ServerRequest,\n Http2ServerResponse,\n connect\n};\nhideFromStack([\n Http2ServerRequest,\n Http2ServerResponse,\n connect,\n createServer,\n createSecureServer,\n getDefaultSettings,\n getPackedSettings,\n getUnpackedSettings\n]);\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeHttpCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/http.ts\nvar checkInvalidHeaderChar = function(val) {\n return RegExpPrototypeExec.@call(headerCharRegex, val) !== null;\n};\nvar isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof @ArrayBuffer || obj instanceof Blob)\n return !0;\n if (@Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof @ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, validateMsecs = function(numberlike, field) {\n if (typeof numberlike !== \"number\" || numberlike < 0)\n throw new ERR_INVALID_ARG_TYPE(field, \"number\", numberlike);\n return numberlike;\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, createServer = function(options, callback) {\n return new Server(options, callback);\n}, emitListeningNextTick = function(self, onListen, err, hostname, port) {\n if (typeof onListen === \"function\")\n try {\n onListen(err, hostname, port);\n } catch (err2) {\n self.emit(\"error\", err2);\n }\n if (self.listening = !err, err)\n self.emit(\"error\", err);\n else\n self.emit(\"listening\", hostname, port);\n}, assignHeaders = function(object, req) {\n var headers = req.headers.toJSON();\n const rawHeaders = @newArrayWithSize(req.headers.count * 2);\n var i = 0;\n for (let key in headers)\n rawHeaders[i++] = key, rawHeaders[i++] = headers[key];\n object.headers = headers, object.rawHeaders = rawHeaders;\n}, destroyBodyStreamNT = function(bodyStream) {\n bodyStream.destroy();\n}, getDefaultHTTPSAgent = function() {\n return _defaultHTTPSAgent \?\?= new Agent({ defaultPort: 443, protocol: \"https:\" });\n};\nvar urlToHttpOptions = function(url) {\n var { protocol, hostname, hash, search, pathname, href, port, username, password } = url;\n return {\n protocol,\n hostname: typeof hostname === \"string\" && StringPrototypeStartsWith.@call(hostname, \"[\") \? StringPrototypeSlice.@call(hostname, 1, -1) : hostname,\n hash,\n search,\n pathname,\n path: `${pathname || \"\"}${search || \"\"}`,\n href,\n port: port \? Number(port) : protocol === \"https:\" \? 443 : protocol === \"http:\" \? 80 : @undefined,\n auth: username || password \? `${decodeURIComponent(username)}:${decodeURIComponent(password)}` : @undefined\n };\n}, validateHost = function(host, name) {\n if (host !== null && host !== @undefined && typeof host !== \"string\")\n throw new Error(\"Invalid arg type in options\");\n return host;\n}, checkIsHttpToken = function(val) {\n return RegExpPrototypeExec.@call(tokenRegExp, val) !== null;\n};\nvar _writeHead = function(statusCode, reason, obj, response) {\n if (statusCode |= 0, statusCode < 100 || statusCode > 999)\n throw new Error(\"status code must be between 100 and 999\");\n if (typeof reason === \"string\")\n response.statusMessage = reason;\n else {\n if (!response.statusMessage)\n response.statusMessage = STATUS_CODES[statusCode] || \"unknown\";\n obj = reason;\n }\n response.statusCode = statusCode;\n {\n let k;\n if (@Array.isArray(obj)) {\n if (obj.length % 2 !== 0)\n throw new Error(\"raw headers must have an even number of elements\");\n for (let n = 0;n < obj.length; n += 2)\n if (k = obj[n + 0], k)\n response.setHeader(k, obj[n + 1]);\n } else if (obj) {\n const keys = Object.keys(obj);\n for (let i = 0;i < keys.length; i++)\n if (k = keys[i], k)\n response.setHeader(k, obj[k]);\n }\n }\n if (statusCode === 204 || statusCode === 304 || statusCode >= 100 && statusCode <= 199)\n response._hasBody = !1;\n}, request = function(url, options, cb) {\n return new ClientRequest(url, options, cb);\n}, get = function(url, options, cb) {\n const req = request(url, options, cb);\n return req.end(), req;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { isTypedArray } = @requireNativeModule(\"util/types\"), { Duplex, Readable, Writable } = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), { getHeader, setHeader } = @lazy(\"http\"), headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/, validateHeaderName = (name, label) => {\n if (typeof name !== \"string\" || !name || !checkIsHttpToken(name))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN\");\n}, validateHeaderValue = (name, value) => {\n if (value === @undefined)\n throw new Error(\"ERR_HTTP_INVALID_HEADER_VALUE\");\n if (checkInvalidHeaderChar(value))\n throw new Error(\"ERR_INVALID_CHAR\");\n}, { URL } = globalThis, globalReportError = globalThis.reportError, setTimeout = globalThis.setTimeout, fetch = Bun.fetch;\nvar kEmptyObject = Object.freeze(Object.create(null)), kOutHeaders = Symbol.for(\"kOutHeaders\"), kEndCalled = Symbol.for(\"kEndCalled\"), kAbortController = Symbol.for(\"kAbortController\"), kClearTimeout = Symbol(\"kClearTimeout\"), kCorked = Symbol.for(\"kCorked\"), searchParamsSymbol = Symbol.for(\"query\"), StringPrototypeSlice = @String.prototype.slice, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeToUpperCase = @String.prototype.toUpperCase, ArrayIsArray = @Array.isArray, RegExpPrototypeExec = @RegExp.prototype.exec, ObjectAssign = Object.assign, INVALID_PATH_REGEX = /[^\\u0021-\\u00ff]/;\nvar _defaultHTTPSAgent, kInternalRequest = Symbol(\"kInternalRequest\"), kInternalSocketData = Symbol.for(\"::bunternal::\"), kEmptyBuffer = @Buffer.alloc(0);\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\nvar FakeSocket = class Socket extends Duplex {\n [kInternalSocketData];\n bytesRead = 0;\n bytesWritten = 0;\n connecting = !1;\n timeout = 0;\n isServer = !1;\n #address;\n address() {\n var internalData;\n return this.#address \?\?= (internalData = this[kInternalSocketData])\?.[0]\?.requestIP(internalData[2]) \?\? {};\n }\n get bufferSize() {\n return this.writableLength;\n }\n connect(port, host, connectListener) {\n return this;\n }\n _destroy(err, callback) {\n }\n _final(callback) {\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return 80;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n }\n get remoteAddress() {\n return this.address()\?.address;\n }\n set remoteAddress(val) {\n this.address().address = val;\n }\n get remotePort() {\n return this.address()\?.port;\n }\n set remotePort(val) {\n this.address().port = val;\n }\n get remoteFamily() {\n return this.address()\?.family;\n }\n set remoteFamily(val) {\n this.address().family = val;\n }\n resetAndDestroy() {\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n return this;\n }\n unref() {\n }\n _write(chunk, encoding, callback) {\n }\n};\n\nclass Agent extends EventEmitter {\n defaultPort = 80;\n protocol = \"http:\";\n options;\n requests;\n sockets;\n freeSockets;\n keepAliveMsecs;\n keepAlive;\n maxSockets;\n maxFreeSockets;\n scheduling;\n maxTotalSockets;\n totalSocketCount;\n #fakeSocket;\n static get globalAgent() {\n return globalAgent;\n }\n static get defaultMaxSockets() {\n return @Infinity;\n }\n constructor(options = kEmptyObject) {\n super();\n if (this.options = options = { ...options, path: null }, options.noDelay === @undefined)\n options.noDelay = !0;\n this.requests = kEmptyObject, this.sockets = kEmptyObject, this.freeSockets = kEmptyObject, this.keepAliveMsecs = options.keepAliveMsecs || 1000, this.keepAlive = options.keepAlive || !1, this.maxSockets = options.maxSockets || Agent.defaultMaxSockets, this.maxFreeSockets = options.maxFreeSockets || 256, this.scheduling = options.scheduling || \"lifo\", this.maxTotalSockets = options.maxTotalSockets, this.totalSocketCount = 0, this.defaultPort = options.defaultPort || 80, this.protocol = options.protocol || \"http:\";\n }\n createConnection() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n getName(options = kEmptyObject) {\n let name = `http:${options.host || \"localhost\"}:`;\n if (options.port)\n name += options.port;\n if (name += \":\", options.localAddress)\n name += options.localAddress;\n if (options.family === 4 || options.family === 6)\n name += `:${options.family}`;\n if (options.socketPath)\n name += `:${options.socketPath}`;\n return name;\n }\n addRequest() {\n }\n createSocket(req, options, cb) {\n cb(null, this.#fakeSocket \?\?= new FakeSocket);\n }\n removeSocket() {\n }\n keepSocketAlive() {\n return !0;\n }\n reuseSocket() {\n }\n destroy() {\n }\n}\n\nclass Server extends EventEmitter {\n #server;\n #options;\n #tls;\n #is_tls = !1;\n listening = !1;\n serverName;\n constructor(options, callback) {\n super();\n if (typeof options === \"function\")\n callback = options, options = {};\n else if (options == null || typeof options === \"object\") {\n options = { ...options }, this.#tls = null;\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n let serverName = options.servername;\n if (serverName && typeof serverName !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n if (this.#is_tls)\n this.#tls = {\n serverName,\n key,\n cert,\n ca,\n passphrase,\n secureOptions\n };\n else\n this.#tls = null;\n } else\n throw new Error(\"bun-http-polyfill: invalid arguments\");\n if (this.#options = options, callback)\n this.on(\"request\", callback);\n }\n closeAllConnections() {\n const server = this.#server;\n if (!server)\n return;\n this.#server = @undefined, server.stop(!0), this.emit(\"close\");\n }\n closeIdleConnections() {\n }\n close(optionalCallback) {\n const server = this.#server;\n if (!server) {\n if (typeof optionalCallback === \"function\")\n process.nextTick(optionalCallback, new Error(\"Server is not running\"));\n return;\n }\n if (this.#server = @undefined, typeof optionalCallback === \"function\")\n this.once(\"close\", optionalCallback);\n server.stop(), this.emit(\"close\");\n }\n address() {\n if (!this.#server)\n return null;\n return this.#server.address;\n }\n listen(port, host, backlog, onListen) {\n const server = this;\n let socketPath;\n if (typeof port == \"string\" && !Number.isSafeInteger(Number(port)))\n socketPath = port;\n if (typeof host === \"function\")\n onListen = host, host = @undefined;\n if (typeof port === \"function\")\n onListen = port;\n else if (typeof port === \"object\") {\n if (port\?.signal\?.addEventListener(\"abort\", () => {\n this.close();\n }), host = port\?.host, port = port\?.port, typeof port\?.callback === \"function\")\n onListen = port\?.callback;\n }\n if (typeof backlog === \"function\")\n onListen = backlog;\n const ResponseClass = this.#options.ServerResponse || ServerResponse, RequestClass = this.#options.IncomingMessage || IncomingMessage;\n try {\n const tls = this.#tls;\n if (tls)\n this.serverName = tls.serverName || host || \"localhost\";\n this.#server = Bun.serve({\n tls,\n port,\n hostname: host,\n unix: socketPath,\n websocket: {\n open(ws) {\n ws.data.open(ws);\n },\n message(ws, message) {\n ws.data.message(ws, message);\n },\n close(ws, code, reason) {\n ws.data.close(ws, code, reason);\n },\n drain(ws) {\n ws.data.drain(ws);\n }\n },\n fetch(req, _server) {\n var pendingResponse, pendingError, rejectFunction, resolveFunction, reject = (err) => {\n if (pendingError)\n return;\n if (pendingError = err, rejectFunction)\n rejectFunction(err);\n }, reply = function(resp) {\n if (pendingResponse)\n return;\n if (pendingResponse = resp, resolveFunction)\n resolveFunction(resp);\n };\n const http_req = new RequestClass(req), http_res = new ResponseClass({ reply, req: http_req });\n if (http_req.socket[kInternalSocketData] = [_server, http_res, req], http_req.once(\"error\", (err) => reject(err)), http_res.once(\"error\", (err) => reject(err)), req.headers.get(\"upgrade\"))\n server.emit(\"upgrade\", http_req, http_req.socket, kEmptyBuffer);\n else\n server.emit(\"request\", http_req, http_res);\n if (pendingError)\n throw pendingError;\n if (pendingResponse)\n return pendingResponse;\n return new @Promise((resolve, reject2) => {\n resolveFunction = resolve, rejectFunction = reject2;\n });\n }\n }), setTimeout(emitListeningNextTick, 1, this, onListen, null, this.#server.hostname, this.#server.port);\n } catch (err) {\n server.emit(\"error\", err);\n }\n return this;\n }\n setTimeout(msecs, callback) {\n }\n}\nclass IncomingMessage extends Readable {\n method;\n complete;\n constructor(req, defaultIncomingOpts) {\n const method = req.method;\n super();\n const url = new URL(req.url);\n var { type = \"request\", [kInternalRequest]: nodeReq } = defaultIncomingOpts || {};\n this.#noBody = type === \"request\" \? method === \"GET\" || method === \"HEAD\" || method === \"TRACE\" || method === \"CONNECT\" || method === \"OPTIONS\" || (parseInt(req.headers.get(\"Content-Length\") || \"\") || 0) === 0 : !1, this.#req = req, this.method = method, this.#type = type, this.complete = !!this.#noBody, this.#bodyStream = @undefined;\n const socket = new FakeSocket;\n if (url.protocol === \"https:\")\n socket.encrypted = !0;\n this.#fakeSocket = socket, this.url = url.pathname + url.search, this.req = nodeReq, assignHeaders(this, req);\n }\n headers;\n rawHeaders;\n _consuming = !1;\n _dumped = !1;\n #bodyStream;\n #fakeSocket;\n #noBody = !1;\n #aborted = !1;\n #req;\n url;\n #type;\n _construct(callback) {\n if (this.#type === \"response\" || this.#noBody) {\n callback();\n return;\n }\n const contentLength = this.#req.headers.get(\"content-length\");\n if ((contentLength \? parseInt(contentLength, 10) : 0) === 0) {\n this.#noBody = !0, callback();\n return;\n }\n callback();\n }\n async#consumeStream(reader) {\n while (!0) {\n var { done, value } = await reader.readMany();\n if (this.#aborted)\n return;\n if (done) {\n this.push(null), process.nextTick(destroyBodyStreamNT, this);\n break;\n }\n for (var v of value)\n this.push(v);\n }\n }\n _read(size) {\n if (this.#noBody)\n this.push(null), this.complete = !0;\n else if (this.#bodyStream == null) {\n const reader = this.#req.body\?.getReader();\n if (!reader) {\n this.push(null);\n return;\n }\n this.#bodyStream = reader, this.#consumeStream(reader);\n }\n }\n get aborted() {\n return this.#aborted;\n }\n #abort() {\n if (this.#aborted)\n return;\n this.#aborted = !0;\n var bodyStream = this.#bodyStream;\n if (!bodyStream)\n return;\n bodyStream.cancel(), this.complete = !0, this.#bodyStream = @undefined, this.push(null);\n }\n get connection() {\n return this.#fakeSocket;\n }\n get statusCode() {\n return this.#req.status;\n }\n get statusMessage() {\n return STATUS_CODES[this.#req.status];\n }\n get httpVersion() {\n return \"1.1\";\n }\n get rawTrailers() {\n return [];\n }\n get httpVersionMajor() {\n return 1;\n }\n get httpVersionMinor() {\n return 1;\n }\n get trailers() {\n return kEmptyObject;\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n}\n\nclass OutgoingMessage extends Writable {\n constructor() {\n super(...arguments);\n }\n #headers;\n headersSent = !1;\n sendDate = !0;\n req;\n timeout;\n #finished = !1;\n [kEndCalled] = !1;\n #fakeSocket;\n #timeoutTimer;\n [kAbortController] = null;\n _implicitHeader() {\n }\n get headers() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n get connection() {\n return this.socket;\n }\n get finished() {\n return this.#finished;\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.removeAllListeners(\"timeout\"), this.#timeoutTimer = @undefined;\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar OriginalWriteHeadFn, OriginalImplicitHeadFn;\n\nclass ServerResponse extends Writable {\n constructor(c) {\n super();\n if (!c)\n c = {};\n var req = c.req || {}, reply = c.reply;\n if (this.req = req, this._reply = reply, this.sendDate = !0, this.statusCode = 200, this.headersSent = !1, this.statusMessage = @undefined, this.#controller = @undefined, this.#firstWrite = @undefined, this._writableState.decodeStrings = !1, this.#deferred = @undefined, req.method === \"HEAD\")\n this._hasBody = !1;\n }\n req;\n _reply;\n sendDate;\n statusCode;\n #headers;\n headersSent = !1;\n statusMessage;\n #controller;\n #firstWrite;\n _sent100 = !1;\n _defaultKeepAlive = !1;\n _removedConnection = !1;\n _removedContLen = !1;\n _hasBody = !0;\n #deferred = @undefined;\n #finished = !1;\n _implicitHeader() {\n this.writeHead(this.statusCode);\n }\n _write(chunk, encoding, callback) {\n if (!this.#firstWrite && !this.headersSent) {\n this.#firstWrite = chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n controller.write(chunk), callback();\n });\n }\n _writev(chunks, callback) {\n if (chunks.length === 1 && !this.headersSent && !this.#firstWrite) {\n this.#firstWrite = chunks[0].chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n for (let chunk of chunks)\n controller.write(chunk.chunk);\n callback();\n });\n }\n #ensureReadableStreamController(run) {\n var thisController = this.#controller;\n if (thisController)\n return run(thisController);\n this.headersSent = !0;\n var firstWrite = this.#firstWrite;\n this.#firstWrite = @undefined, this._reply(new Response(new @ReadableStream({\n type: \"direct\",\n pull: (controller) => {\n if (this.#controller = controller, firstWrite)\n controller.write(firstWrite);\n if (firstWrite = @undefined, run(controller), !this.#finished)\n return new @Promise((resolve) => {\n this.#deferred = resolve;\n });\n }\n }), {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n }));\n }\n #drainHeadersIfObservable() {\n if (this._implicitHeader === OriginalImplicitHeadFn && this.writeHead === OriginalWriteHeadFn)\n return;\n this._implicitHeader();\n }\n _final(callback) {\n if (!this.headersSent) {\n var data = this.#firstWrite || \"\";\n this.#firstWrite = @undefined, this.#finished = !0, this.#drainHeadersIfObservable(), this._reply(new Response(data, {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n })), callback && callback();\n return;\n }\n this.#finished = !0, this.#ensureReadableStreamController((controller) => {\n controller.end(), callback();\n var deferred = this.#deferred;\n if (deferred)\n this.#deferred = @undefined, deferred();\n });\n }\n writeProcessing() {\n throw new Error(\"not implemented\");\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n assignSocket(socket) {\n throw new Error(\"not implemented\");\n }\n detachSocket(socket) {\n throw new Error(\"not implemented\");\n }\n writeContinue(callback) {\n throw new Error(\"not implemented\");\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n var headers = this.#headers;\n if (!headers)\n return kEmptyObject;\n return headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return setHeader(headers, name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n writeHead(statusCode, statusMessage, headers) {\n return _writeHead(statusCode, statusMessage, headers, this), this;\n }\n}\nOriginalWriteHeadFn = ServerResponse.prototype.writeHead;\nOriginalImplicitHeadFn = ServerResponse.prototype._implicitHeader;\n\nclass ClientRequest extends OutgoingMessage {\n #timeout;\n #res = null;\n #upgradeOrConnect = !1;\n #parser = null;\n #maxHeadersCount = null;\n #reusedSocket = !1;\n #host;\n #protocol;\n #method;\n #port;\n #useDefaultPort;\n #joinDuplicateHeaders;\n #maxHeaderSize;\n #agent = globalAgent;\n #path;\n #socketPath;\n #bodyChunks = null;\n #fetchRequest;\n #signal = null;\n [kAbortController] = null;\n #timeoutTimer = @undefined;\n #options;\n #finished;\n get path() {\n return this.#path;\n }\n get port() {\n return this.#port;\n }\n get method() {\n return this.#method;\n }\n get host() {\n return this.#host;\n }\n get protocol() {\n return this.#protocol;\n }\n _write(chunk, encoding, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = [chunk], callback();\n return;\n }\n this.#bodyChunks.push(chunk), callback();\n }\n _writev(chunks, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = chunks, callback();\n return;\n }\n this.#bodyChunks.push(...chunks), callback();\n }\n _final(callback) {\n if (this.#finished = !0, this[kAbortController] = new AbortController, this[kAbortController].signal.addEventListener(\"abort\", () => {\n this[kClearTimeout]();\n }), this.#signal\?.aborted)\n this[kAbortController].abort();\n var method = this.#method, body = this.#bodyChunks\?.length === 1 \? this.#bodyChunks[0] : @Buffer.concat(this.#bodyChunks || []);\n let url, proxy;\n if (this.#path.startsWith(\"http://\") || this.#path.startsWith(\"https://\"))\n url = this.#path, proxy = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}`;\n else\n url = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}${this.#path}`;\n try {\n this.#fetchRequest = fetch(url, {\n method,\n headers: this.getHeaders(),\n body: body && method !== \"GET\" && method !== \"HEAD\" && method !== \"OPTIONS\" \? body : @undefined,\n redirect: \"manual\",\n verbose: !1,\n signal: this[kAbortController].signal,\n proxy,\n timeout: !1,\n decompress: !1\n }).then((response) => {\n var res = this.#res = new IncomingMessage(response, {\n type: \"response\",\n [kInternalRequest]: this\n });\n this.emit(\"response\", res);\n }).catch((err) => {\n this.emit(\"error\", err);\n }).finally(() => {\n this.#fetchRequest = null, this[kClearTimeout]();\n });\n } catch (err) {\n this.emit(\"error\", err);\n } finally {\n callback();\n }\n }\n get aborted() {\n return this.#signal\?.aborted || !!this[kAbortController]\?.signal.aborted;\n }\n abort() {\n if (this.aborted)\n return;\n this[kAbortController].abort();\n }\n constructor(input, options, cb) {\n super();\n if (typeof input === \"string\") {\n const urlStr = input;\n try {\n var urlObject = new URL(urlStr);\n } catch (e) {\n @throwTypeError(`Invalid URL: ${urlStr}`);\n }\n input = urlToHttpOptions(urlObject);\n } else if (input && typeof input === \"object\" && input instanceof URL)\n input = urlToHttpOptions(input);\n else\n cb = options, options = input, input = null;\n if (typeof options === \"function\")\n cb = options, options = input || kEmptyObject;\n else\n options = ObjectAssign(input || {}, options);\n var defaultAgent = options._defaultAgent || Agent.globalAgent;\n let protocol = options.protocol;\n if (!protocol)\n if (options.port === 443)\n protocol = \"https:\";\n else\n protocol = defaultAgent.protocol || \"http:\";\n switch (this.#protocol = protocol, this.#agent\?.protocol) {\n case @undefined:\n break;\n case \"http:\":\n if (protocol === \"https:\") {\n defaultAgent = this.#agent = getDefaultHTTPSAgent();\n break;\n }\n case \"https:\":\n if (protocol === \"https\") {\n defaultAgent = this.#agent = Agent.globalAgent;\n break;\n }\n default:\n break;\n }\n if (options.path) {\n const path = @String(options.path);\n if (RegExpPrototypeExec.@call(INVALID_PATH_REGEX, path) !== null)\n throw new Error(\"Path contains unescaped characters\");\n }\n if (protocol !== \"http:\" && protocol !== \"https:\" && protocol) {\n const expectedProtocol = defaultAgent\?.protocol \?\? \"http:\";\n throw new Error(`Protocol mismatch. Expected: ${expectedProtocol}. Got: ${protocol}`);\n }\n const defaultPort = protocol === \"https:\" \? 443 : 80;\n this.#port = options.port || options.defaultPort || this.#agent\?.defaultPort || defaultPort, this.#useDefaultPort = this.#port === defaultPort;\n const host = this.#host = options.host = validateHost(options.hostname, \"hostname\") || validateHost(options.host, \"host\") || \"localhost\";\n this.#socketPath = options.socketPath;\n const signal = options.signal;\n if (signal)\n signal.addEventListener(\"abort\", () => {\n this[kAbortController]\?.abort();\n }), this.#signal = signal;\n let method = options.method;\n const methodIsString = typeof method === \"string\";\n if (method !== null && method !== @undefined && !methodIsString)\n throw new Error(\"ERR_INVALID_ARG_TYPE: options.method\");\n if (methodIsString && method) {\n if (!checkIsHttpToken(method))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN: Method\");\n method = this.#method = StringPrototypeToUpperCase.@call(method);\n } else\n method = this.#method = \"GET\";\n const _maxHeaderSize = options.maxHeaderSize;\n this.#maxHeaderSize = _maxHeaderSize;\n var _joinDuplicateHeaders = options.joinDuplicateHeaders;\n if (this.#joinDuplicateHeaders = _joinDuplicateHeaders, this.#path = options.path || \"/\", cb)\n this.once(\"response\", cb);\n this.#finished = !1, this.#res = null, this.#upgradeOrConnect = !1, this.#parser = null, this.#maxHeadersCount = null, this.#reusedSocket = !1, this.#host = host, this.#protocol = protocol;\n var timeout = options.timeout;\n if (timeout !== @undefined && timeout !== 0)\n this.setTimeout(timeout, @undefined);\n if (!ArrayIsArray(headers)) {\n var headers = options.headers;\n if (headers)\n for (let key in headers)\n this.setHeader(key, headers[key]);\n var auth = options.auth;\n if (auth && !this.getHeader(\"Authorization\"))\n this.setHeader(\"Authorization\", \"Basic \" + @Buffer.from(auth).toString(\"base64\"));\n }\n var { signal: _signal, ...optsWithoutSignal } = options;\n this.#options = optsWithoutSignal;\n }\n setSocketKeepAlive(enable = !0, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.#timeoutTimer = @undefined, this.removeAllListeners(\"timeout\");\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/, METHODS = [\n \"ACL\",\n \"BIND\",\n \"CHECKOUT\",\n \"CONNECT\",\n \"COPY\",\n \"DELETE\",\n \"GET\",\n \"HEAD\",\n \"LINK\",\n \"LOCK\",\n \"M-SEARCH\",\n \"MERGE\",\n \"MKACTIVITY\",\n \"MKCALENDAR\",\n \"MKCOL\",\n \"MOVE\",\n \"NOTIFY\",\n \"OPTIONS\",\n \"PATCH\",\n \"POST\",\n \"PROPFIND\",\n \"PROPPATCH\",\n \"PURGE\",\n \"PUT\",\n \"REBIND\",\n \"REPORT\",\n \"SEARCH\",\n \"SOURCE\",\n \"SUBSCRIBE\",\n \"TRACE\",\n \"UNBIND\",\n \"UNLINK\",\n \"UNLOCK\",\n \"UNSUBSCRIBE\"\n], STATUS_CODES = {\n 100: \"Continue\",\n 101: \"Switching Protocols\",\n 102: \"Processing\",\n 103: \"Early Hints\",\n 200: \"OK\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"Non-Authoritative Information\",\n 204: \"No Content\",\n 205: \"Reset Content\",\n 206: \"Partial Content\",\n 207: \"Multi-Status\",\n 208: \"Already Reported\",\n 226: \"IM Used\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Found\",\n 303: \"See Other\",\n 304: \"Not Modified\",\n 305: \"Use Proxy\",\n 307: \"Temporary Redirect\",\n 308: \"Permanent Redirect\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a Teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 425: \"Too Early\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Request Header Fields Too Large\",\n 451: \"Unavailable For Legal Reasons\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 509: \"Bandwidth Limit Exceeded\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\"\n}, globalAgent = new Agent;\n$ = {\n Agent,\n Server,\n METHODS,\n STATUS_CODES,\n createServer,\n ServerResponse,\n IncomingMessage,\n request,\n get,\n maxHeaderSize: 16384,\n validateHeaderName,\n validateHeaderValue,\n setMaxIdleHTTPParsers(max) {\n },\n globalAgent,\n ClientRequest,\n OutgoingMessage\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeHttpsCode = "(function (){\"use strict\";// src/js/out/tmp/node/https.ts\nvar request = function(input, options, cb) {\n if (input && typeof input === \"object\" && !(input instanceof URL))\n input.protocol \?\?= \"https:\";\n else if (typeof options === \"object\")\n options.protocol \?\?= \"https:\";\n return http.request(input, options, cb);\n}, get = function(input, options, cb) {\n const req = request(input, options, cb);\n return req.end(), req;\n}, $, http = @getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21);\n$ = {\n ...http,\n get,\n request\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeHttp2Code = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/http2.ts\nvar connect = function() {\n throwNotImplemented(\"node:http2 connect\", 887);\n}, createServer = function() {\n throwNotImplemented(\"node:http2 createServer\", 887);\n}, createSecureServer = function() {\n throwNotImplemented(\"node:http2 createSecureServer\", 887);\n}, getDefaultSettings = function() {\n return {\n headerTableSize: 4096,\n enablePush: !0,\n initialWindowSize: 65535,\n maxFrameSize: 16384,\n maxConcurrentStreams: 4294967295,\n maxHeaderSize: 65535,\n maxHeaderListSize: 65535,\n enableConnectProtocol: !1\n };\n}, getPackedSettings = function() {\n return @Buffer.alloc(0);\n}, getUnpackedSettings = function() {\n return @Buffer.alloc(0);\n}, Http2ServerRequest = function() {\n throwNotImplemented(\"node:http2 Http2ServerRequest\", 887);\n}, Http2ServerResponse = function() {\n throwNotImplemented(\"node:http2 Http2ServerResponse\", 887);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), constants = {\n NGHTTP2_ERR_FRAME_SIZE_ERROR: -522,\n NGHTTP2_SESSION_SERVER: 0,\n NGHTTP2_SESSION_CLIENT: 1,\n NGHTTP2_STREAM_STATE_IDLE: 1,\n NGHTTP2_STREAM_STATE_OPEN: 2,\n NGHTTP2_STREAM_STATE_RESERVED_LOCAL: 3,\n NGHTTP2_STREAM_STATE_RESERVED_REMOTE: 4,\n NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: 5,\n NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: 6,\n NGHTTP2_STREAM_STATE_CLOSED: 7,\n NGHTTP2_FLAG_NONE: 0,\n NGHTTP2_FLAG_END_STREAM: 1,\n NGHTTP2_FLAG_END_HEADERS: 4,\n NGHTTP2_FLAG_ACK: 1,\n NGHTTP2_FLAG_PADDED: 8,\n NGHTTP2_FLAG_PRIORITY: 32,\n DEFAULT_SETTINGS_HEADER_TABLE_SIZE: 4096,\n DEFAULT_SETTINGS_ENABLE_PUSH: 1,\n DEFAULT_SETTINGS_MAX_CONCURRENT_STREAMS: 4294967295,\n DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: 65535,\n DEFAULT_SETTINGS_MAX_FRAME_SIZE: 16384,\n DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE: 65535,\n DEFAULT_SETTINGS_ENABLE_CONNECT_PROTOCOL: 0,\n MAX_MAX_FRAME_SIZE: 16777215,\n MIN_MAX_FRAME_SIZE: 16384,\n MAX_INITIAL_WINDOW_SIZE: 2147483647,\n NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: 1,\n NGHTTP2_SETTINGS_ENABLE_PUSH: 2,\n NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: 3,\n NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: 4,\n NGHTTP2_SETTINGS_MAX_FRAME_SIZE: 5,\n NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: 6,\n NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL: 8,\n PADDING_STRATEGY_NONE: 0,\n PADDING_STRATEGY_ALIGNED: 1,\n PADDING_STRATEGY_MAX: 2,\n PADDING_STRATEGY_CALLBACK: 1,\n NGHTTP2_NO_ERROR: 0,\n NGHTTP2_PROTOCOL_ERROR: 1,\n NGHTTP2_INTERNAL_ERROR: 2,\n NGHTTP2_FLOW_CONTROL_ERROR: 3,\n NGHTTP2_SETTINGS_TIMEOUT: 4,\n NGHTTP2_STREAM_CLOSED: 5,\n NGHTTP2_FRAME_SIZE_ERROR: 6,\n NGHTTP2_REFUSED_STREAM: 7,\n NGHTTP2_CANCEL: 8,\n NGHTTP2_COMPRESSION_ERROR: 9,\n NGHTTP2_CONNECT_ERROR: 10,\n NGHTTP2_ENHANCE_YOUR_CALM: 11,\n NGHTTP2_INADEQUATE_SECURITY: 12,\n NGHTTP2_HTTP_1_1_REQUIRED: 13,\n NGHTTP2_DEFAULT_WEIGHT: 16,\n HTTP2_HEADER_STATUS: \":status\",\n HTTP2_HEADER_METHOD: \":method\",\n HTTP2_HEADER_AUTHORITY: \":authority\",\n HTTP2_HEADER_SCHEME: \":scheme\",\n HTTP2_HEADER_PATH: \":path\",\n HTTP2_HEADER_PROTOCOL: \":protocol\",\n HTTP2_HEADER_ACCEPT_ENCODING: \"accept-encoding\",\n HTTP2_HEADER_ACCEPT_LANGUAGE: \"accept-language\",\n HTTP2_HEADER_ACCEPT_RANGES: \"accept-ranges\",\n HTTP2_HEADER_ACCEPT: \"accept\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS: \"access-control-allow-credentials\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_HEADERS: \"access-control-allow-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_METHODS: \"access-control-allow-methods\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: \"access-control-allow-origin\",\n HTTP2_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS: \"access-control-expose-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_REQUEST_HEADERS: \"access-control-request-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_REQUEST_METHOD: \"access-control-request-method\",\n HTTP2_HEADER_AGE: \"age\",\n HTTP2_HEADER_AUTHORIZATION: \"authorization\",\n HTTP2_HEADER_CACHE_CONTROL: \"cache-control\",\n HTTP2_HEADER_CONNECTION: \"connection\",\n HTTP2_HEADER_CONTENT_DISPOSITION: \"content-disposition\",\n HTTP2_HEADER_CONTENT_ENCODING: \"content-encoding\",\n HTTP2_HEADER_CONTENT_LENGTH: \"content-length\",\n HTTP2_HEADER_CONTENT_TYPE: \"content-type\",\n HTTP2_HEADER_COOKIE: \"cookie\",\n HTTP2_HEADER_DATE: \"date\",\n HTTP2_HEADER_ETAG: \"etag\",\n HTTP2_HEADER_FORWARDED: \"forwarded\",\n HTTP2_HEADER_HOST: \"host\",\n HTTP2_HEADER_IF_MODIFIED_SINCE: \"if-modified-since\",\n HTTP2_HEADER_IF_NONE_MATCH: \"if-none-match\",\n HTTP2_HEADER_IF_RANGE: \"if-range\",\n HTTP2_HEADER_LAST_MODIFIED: \"last-modified\",\n HTTP2_HEADER_LINK: \"link\",\n HTTP2_HEADER_LOCATION: \"location\",\n HTTP2_HEADER_RANGE: \"range\",\n HTTP2_HEADER_REFERER: \"referer\",\n HTTP2_HEADER_SERVER: \"server\",\n HTTP2_HEADER_SET_COOKIE: \"set-cookie\",\n HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: \"strict-transport-security\",\n HTTP2_HEADER_TRANSFER_ENCODING: \"transfer-encoding\",\n HTTP2_HEADER_TE: \"te\",\n HTTP2_HEADER_UPGRADE_INSECURE_REQUESTS: \"upgrade-insecure-requests\",\n HTTP2_HEADER_UPGRADE: \"upgrade\",\n HTTP2_HEADER_USER_AGENT: \"user-agent\",\n HTTP2_HEADER_VARY: \"vary\",\n HTTP2_HEADER_X_CONTENT_TYPE_OPTIONS: \"x-content-type-options\",\n HTTP2_HEADER_X_FRAME_OPTIONS: \"x-frame-options\",\n HTTP2_HEADER_KEEP_ALIVE: \"keep-alive\",\n HTTP2_HEADER_PROXY_CONNECTION: \"proxy-connection\",\n HTTP2_HEADER_X_XSS_PROTECTION: \"x-xss-protection\",\n HTTP2_HEADER_ALT_SVC: \"alt-svc\",\n HTTP2_HEADER_CONTENT_SECURITY_POLICY: \"content-security-policy\",\n HTTP2_HEADER_EARLY_DATA: \"early-data\",\n HTTP2_HEADER_EXPECT_CT: \"expect-ct\",\n HTTP2_HEADER_ORIGIN: \"origin\",\n HTTP2_HEADER_PURPOSE: \"purpose\",\n HTTP2_HEADER_TIMING_ALLOW_ORIGIN: \"timing-allow-origin\",\n HTTP2_HEADER_X_FORWARDED_FOR: \"x-forwarded-for\",\n HTTP2_HEADER_PRIORITY: \"priority\",\n HTTP2_HEADER_ACCEPT_CHARSET: \"accept-charset\",\n HTTP2_HEADER_ACCESS_CONTROL_MAX_AGE: \"access-control-max-age\",\n HTTP2_HEADER_ALLOW: \"allow\",\n HTTP2_HEADER_CONTENT_LANGUAGE: \"content-language\",\n HTTP2_HEADER_CONTENT_LOCATION: \"content-location\",\n HTTP2_HEADER_CONTENT_MD5: \"content-md5\",\n HTTP2_HEADER_CONTENT_RANGE: \"content-range\",\n HTTP2_HEADER_DNT: \"dnt\",\n HTTP2_HEADER_EXPECT: \"expect\",\n HTTP2_HEADER_EXPIRES: \"expires\",\n HTTP2_HEADER_FROM: \"from\",\n HTTP2_HEADER_IF_MATCH: \"if-match\",\n HTTP2_HEADER_IF_UNMODIFIED_SINCE: \"if-unmodified-since\",\n HTTP2_HEADER_MAX_FORWARDS: \"max-forwards\",\n HTTP2_HEADER_PREFER: \"prefer\",\n HTTP2_HEADER_PROXY_AUTHENTICATE: \"proxy-authenticate\",\n HTTP2_HEADER_PROXY_AUTHORIZATION: \"proxy-authorization\",\n HTTP2_HEADER_REFRESH: \"refresh\",\n HTTP2_HEADER_RETRY_AFTER: \"retry-after\",\n HTTP2_HEADER_TRAILER: \"trailer\",\n HTTP2_HEADER_TK: \"tk\",\n HTTP2_HEADER_VIA: \"via\",\n HTTP2_HEADER_WARNING: \"warning\",\n HTTP2_HEADER_WWW_AUTHENTICATE: \"www-authenticate\",\n HTTP2_HEADER_HTTP2_SETTINGS: \"http2-settings\",\n HTTP2_METHOD_ACL: \"ACL\",\n HTTP2_METHOD_BASELINE_CONTROL: \"BASELINE-CONTROL\",\n HTTP2_METHOD_BIND: \"BIND\",\n HTTP2_METHOD_CHECKIN: \"CHECKIN\",\n HTTP2_METHOD_CHECKOUT: \"CHECKOUT\",\n HTTP2_METHOD_CONNECT: \"CONNECT\",\n HTTP2_METHOD_COPY: \"COPY\",\n HTTP2_METHOD_DELETE: \"DELETE\",\n HTTP2_METHOD_GET: \"GET\",\n HTTP2_METHOD_HEAD: \"HEAD\",\n HTTP2_METHOD_LABEL: \"LABEL\",\n HTTP2_METHOD_LINK: \"LINK\",\n HTTP2_METHOD_LOCK: \"LOCK\",\n HTTP2_METHOD_MERGE: \"MERGE\",\n HTTP2_METHOD_MKACTIVITY: \"MKACTIVITY\",\n HTTP2_METHOD_MKCALENDAR: \"MKCALENDAR\",\n HTTP2_METHOD_MKCOL: \"MKCOL\",\n HTTP2_METHOD_MKREDIRECTREF: \"MKREDIRECTREF\",\n HTTP2_METHOD_MKWORKSPACE: \"MKWORKSPACE\",\n HTTP2_METHOD_MOVE: \"MOVE\",\n HTTP2_METHOD_OPTIONS: \"OPTIONS\",\n HTTP2_METHOD_ORDERPATCH: \"ORDERPATCH\",\n HTTP2_METHOD_PATCH: \"PATCH\",\n HTTP2_METHOD_POST: \"POST\",\n HTTP2_METHOD_PRI: \"PRI\",\n HTTP2_METHOD_PROPFIND: \"PROPFIND\",\n HTTP2_METHOD_PROPPATCH: \"PROPPATCH\",\n HTTP2_METHOD_PUT: \"PUT\",\n HTTP2_METHOD_REBIND: \"REBIND\",\n HTTP2_METHOD_REPORT: \"REPORT\",\n HTTP2_METHOD_SEARCH: \"SEARCH\",\n HTTP2_METHOD_TRACE: \"TRACE\",\n HTTP2_METHOD_UNBIND: \"UNBIND\",\n HTTP2_METHOD_UNCHECKOUT: \"UNCHECKOUT\",\n HTTP2_METHOD_UNLINK: \"UNLINK\",\n HTTP2_METHOD_UNLOCK: \"UNLOCK\",\n HTTP2_METHOD_UPDATE: \"UPDATE\",\n HTTP2_METHOD_UPDATEREDIRECTREF: \"UPDATEREDIRECTREF\",\n HTTP2_METHOD_VERSION_CONTROL: \"VERSION-CONTROL\",\n HTTP_STATUS_CONTINUE: 100,\n HTTP_STATUS_SWITCHING_PROTOCOLS: 101,\n HTTP_STATUS_PROCESSING: 102,\n HTTP_STATUS_EARLY_HINTS: 103,\n HTTP_STATUS_OK: 200,\n HTTP_STATUS_CREATED: 201,\n HTTP_STATUS_ACCEPTED: 202,\n HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: 203,\n HTTP_STATUS_NO_CONTENT: 204,\n HTTP_STATUS_RESET_CONTENT: 205,\n HTTP_STATUS_PARTIAL_CONTENT: 206,\n HTTP_STATUS_MULTI_STATUS: 207,\n HTTP_STATUS_ALREADY_REPORTED: 208,\n HTTP_STATUS_IM_USED: 226,\n HTTP_STATUS_MULTIPLE_CHOICES: 300,\n HTTP_STATUS_MOVED_PERMANENTLY: 301,\n HTTP_STATUS_FOUND: 302,\n HTTP_STATUS_SEE_OTHER: 303,\n HTTP_STATUS_NOT_MODIFIED: 304,\n HTTP_STATUS_USE_PROXY: 305,\n HTTP_STATUS_TEMPORARY_REDIRECT: 307,\n HTTP_STATUS_PERMANENT_REDIRECT: 308,\n HTTP_STATUS_BAD_REQUEST: 400,\n HTTP_STATUS_UNAUTHORIZED: 401,\n HTTP_STATUS_PAYMENT_REQUIRED: 402,\n HTTP_STATUS_FORBIDDEN: 403,\n HTTP_STATUS_NOT_FOUND: 404,\n HTTP_STATUS_METHOD_NOT_ALLOWED: 405,\n HTTP_STATUS_NOT_ACCEPTABLE: 406,\n HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: 407,\n HTTP_STATUS_REQUEST_TIMEOUT: 408,\n HTTP_STATUS_CONFLICT: 409,\n HTTP_STATUS_GONE: 410,\n HTTP_STATUS_LENGTH_REQUIRED: 411,\n HTTP_STATUS_PRECONDITION_FAILED: 412,\n HTTP_STATUS_PAYLOAD_TOO_LARGE: 413,\n HTTP_STATUS_URI_TOO_LONG: 414,\n HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: 415,\n HTTP_STATUS_RANGE_NOT_SATISFIABLE: 416,\n HTTP_STATUS_EXPECTATION_FAILED: 417,\n HTTP_STATUS_TEAPOT: 418,\n HTTP_STATUS_MISDIRECTED_REQUEST: 421,\n HTTP_STATUS_UNPROCESSABLE_ENTITY: 422,\n HTTP_STATUS_LOCKED: 423,\n HTTP_STATUS_FAILED_DEPENDENCY: 424,\n HTTP_STATUS_TOO_EARLY: 425,\n HTTP_STATUS_UPGRADE_REQUIRED: 426,\n HTTP_STATUS_PRECONDITION_REQUIRED: 428,\n HTTP_STATUS_TOO_MANY_REQUESTS: 429,\n HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: 431,\n HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: 451,\n HTTP_STATUS_INTERNAL_SERVER_ERROR: 500,\n HTTP_STATUS_NOT_IMPLEMENTED: 501,\n HTTP_STATUS_BAD_GATEWAY: 502,\n HTTP_STATUS_SERVICE_UNAVAILABLE: 503,\n HTTP_STATUS_GATEWAY_TIMEOUT: 504,\n HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: 505,\n HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: 506,\n HTTP_STATUS_INSUFFICIENT_STORAGE: 507,\n HTTP_STATUS_LOOP_DETECTED: 508,\n HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: 509,\n HTTP_STATUS_NOT_EXTENDED: 510,\n HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: 511\n}, sensitiveHeaders = Symbol.for(\"nodejs.http2.sensitiveHeaders\");\nHttp2ServerRequest.prototype = {};\nHttp2ServerResponse.prototype = {};\n$ = {\n constants,\n createServer,\n createSecureServer,\n getDefaultSettings,\n getPackedSettings,\n getUnpackedSettings,\n sensitiveHeaders,\n Http2ServerRequest,\n Http2ServerResponse,\n connect\n};\nhideFromStack([\n Http2ServerRequest,\n Http2ServerResponse,\n connect,\n createServer,\n createSecureServer,\n getDefaultSettings,\n getPackedSettings,\n getUnpackedSettings\n]);\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeInspectorCode = "(function (){\"use strict\";// src/js/out/tmp/node/inspector.ts\nvar open = function() {\n throwNotImplemented(\"node:inspector open\", 2445);\n}, close = function() {\n throwNotImplemented(\"node:inspector close\", 2445);\n}, url = function() {\n throwNotImplemented(\"node:inspector url\", 2445);\n}, waitForDebugger = function() {\n throwNotImplemented(\"node:inspector waitForDebugger\", 2445);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18);\n\nclass Session extends EventEmitter {\n constructor() {\n super();\n throwNotImplemented(\"node:inspector Session\", 2445);\n }\n}\nvar console = {\n ...globalThis.console,\n context: {\n console: globalThis.console\n }\n};\n$ = {\n console,\n open,\n close,\n url,\n waitForDebugger,\n Session\n};\nhideFromStack(open, close, url, waitForDebugger, Session.prototype.constructor);\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeHttpsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/https.ts\nvar request = function(input, options, cb) {\n if (input && typeof input === \"object\" && !(input instanceof URL))\n input.protocol \?\?= \"https:\";\n else if (typeof options === \"object\")\n options.protocol \?\?= \"https:\";\n return http.request(input, options, cb);\n}, get = function(input, options, cb) {\n const req = request(input, options, cb);\n return req.end(), req;\n}, $, http = @getInternalField(@internalModuleRegistry, 23) || @createInternalModuleById(23);\n$ = {\n ...http,\n get,\n request\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeNetCode = "(function (){\"use strict\";// src/js/out/tmp/node/net.ts\nvar isIPv4 = function(s) {\n return IPv4Reg.test(s);\n}, isIPv6 = function(s) {\n return IPv6Reg.test(s);\n}, isIP = function(s) {\n if (isIPv4(s))\n return 4;\n if (isIPv6(s))\n return 6;\n return 0;\n}, createConnection = function(port, host, connectListener) {\n if (typeof port === \"object\")\n return new Socket(port).connect(port, host, connectListener);\n return new Socket().connect(port, host, connectListener);\n}, emitErrorNextTick = function(self, error) {\n self.emit(\"error\", error);\n}, emitListeningNextTick = function(self, onListen) {\n if (typeof onListen === \"function\")\n try {\n onListen();\n } catch (err) {\n self.emit(\"error\", err);\n }\n self.emit(\"listening\");\n}, createServer = function(options, connectionListener) {\n return new Server(options, connectionListener);\n}, $, { Duplex } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18);\nvar IPv4Reg = new RegExp(\"^((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$\");\nvar IPv6Reg = new RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\"), { connect: bunConnect } = Bun, { setTimeout } = globalThis, bunTlsSymbol = Symbol.for(\"::buntls::\"), bunSocketServerHandlers = Symbol.for(\"::bunsocket_serverhandlers::\"), bunSocketServerConnections = Symbol.for(\"::bunnetserverconnections::\"), bunSocketServerOptions = Symbol.for(\"::bunnetserveroptions::\"), bunSocketInternal = Symbol.for(\"::bunnetsocketinternal::\"), bunTLSConnectOptions = Symbol.for(\"::buntlsconnectoptions::\"), SocketClass, Socket = function(InternalSocket) {\n return SocketClass = InternalSocket, Object.defineProperty(SocketClass.prototype, Symbol.toStringTag, {\n value: \"Socket\",\n enumerable: !1\n }), Object.defineProperty(function Socket(options) {\n return new InternalSocket(options);\n }, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalSocket;\n }\n });\n}(class Socket2 extends Duplex {\n static #Handlers = {\n close: Socket2.#Close,\n data({ data: self }, buffer) {\n self.bytesRead += buffer.length;\n const queue = self.#readQueue;\n if (queue.isEmpty()) {\n if (self.push(buffer))\n return;\n }\n queue.push(buffer);\n },\n drain: Socket2.#Drain,\n end: Socket2.#Close,\n error(socket, error) {\n const self = socket.data, callback = self.#writeCallback;\n if (callback)\n self.#writeCallback = null, callback(error);\n self.emit(\"error\", error);\n },\n open(socket) {\n const self = socket.data;\n socket.timeout(self.timeout), socket.ref(), self[bunSocketInternal] = socket, self.connecting = !1;\n const options = self[bunTLSConnectOptions];\n if (options) {\n const { session } = options;\n if (session)\n self.setSession(session);\n }\n if (!self.#upgraded)\n self.emit(\"connect\", self);\n Socket2.#Drain(socket);\n },\n handshake(socket, success, verifyError) {\n const { data: self } = socket;\n self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self.emit(\"secure\", self);\n const { checkServerIdentity } = self[bunTLSConnectOptions];\n if (!verifyError && typeof checkServerIdentity === \"function\" && self.servername) {\n const cert = self.getPeerCertificate(!0);\n verifyError = checkServerIdentity(self.servername, cert);\n }\n if (self._requestCert || self._rejectUnauthorized) {\n if (verifyError) {\n if (self.authorized = !1, self.authorizationError = verifyError.code || verifyError.message, self._rejectUnauthorized) {\n self.destroy(verifyError);\n return;\n }\n }\n } else\n self.authorized = !0;\n self.emit(\"secureConnect\", verifyError);\n },\n timeout(socket) {\n const self = socket.data;\n self.emit(\"timeout\", self);\n },\n binaryType: \"buffer\"\n };\n static #Close(socket) {\n const self = socket.data;\n if (self.#closed)\n return;\n self.#closed = !0, self[bunSocketInternal] = null;\n const queue = self.#readQueue;\n if (queue.isEmpty()) {\n if (self.push(null))\n return;\n }\n queue.push(null);\n }\n static #Drain(socket) {\n const self = socket.data, callback = self.#writeCallback;\n if (callback) {\n const chunk = self.#writeChunk, written = socket.write(chunk);\n if (self.bytesWritten += written, written < chunk.length)\n self.#writeChunk = chunk.slice(written);\n else\n self.#writeCallback = null, self.#writeChunk = null, callback(null);\n }\n }\n static [bunSocketServerHandlers] = {\n data: Socket2.#Handlers.data,\n close(socket) {\n Socket2.#Handlers.close(socket), this.data[bunSocketServerConnections]--;\n },\n end(socket) {\n Socket2.#Handlers.end(socket), this.data[bunSocketServerConnections]--;\n },\n open(socket) {\n const self = this.data, options = self[bunSocketServerOptions], { pauseOnConnect, connectionListener, InternalSocketClass, requestCert, rejectUnauthorized } = options, _socket = new InternalSocketClass({});\n if (_socket.isServer = !0, _socket._requestCert = requestCert, _socket._rejectUnauthorized = rejectUnauthorized, _socket.#attach(this.localPort, socket), self.maxConnections && self[bunSocketServerConnections] >= self.maxConnections) {\n const data = {\n localAddress: _socket.localAddress,\n localPort: _socket.localPort,\n localFamily: _socket.localFamily,\n remoteAddress: _socket.remoteAddress,\n remotePort: _socket.remotePort,\n remoteFamily: _socket.remoteFamily || \"IPv4\"\n };\n socket.end(), self.emit(\"drop\", data);\n return;\n }\n if (!pauseOnConnect)\n _socket.resume();\n if (self[bunSocketServerConnections]++, typeof connectionListener == \"function\")\n if (InternalSocketClass.name === \"TLSSocket\")\n self.once(\"secureConnection\", () => connectionListener(_socket));\n else\n connectionListener(_socket);\n self.emit(\"connection\", _socket);\n },\n handshake(socket, success, verifyError) {\n const { data: self } = socket;\n if (self.emit(\"secure\", self), self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self._requestCert || self._rejectUnauthorized) {\n if (verifyError) {\n if (self.authorized = !1, self.authorizationError = verifyError.code || verifyError.message, self._rejectUnauthorized) {\n self.destroy(verifyError);\n return;\n }\n }\n } else\n self.authorized = !0;\n self.emit(\"secureConnection\", verifyError);\n },\n error(socket, error) {\n Socket2.#Handlers.error(socket, error), this.data.emit(\"error\", error);\n },\n timeout: Socket2.#Handlers.timeout,\n connectError: Socket2.#Handlers.connectError,\n drain: Socket2.#Handlers.drain,\n binaryType: \"buffer\"\n };\n bytesRead = 0;\n bytesWritten = 0;\n #closed = !1;\n connecting = !1;\n localAddress = \"127.0.0.1\";\n #readQueue = @createFIFO();\n remotePort;\n [bunSocketInternal] = null;\n [bunTLSConnectOptions] = null;\n timeout = 0;\n #writeCallback;\n #writeChunk;\n #pendingRead;\n isServer = !1;\n _handle;\n _parent;\n _parentWrap;\n #socket;\n #upgraded;\n constructor(options) {\n const { socket, signal, write, read, allowHalfOpen = !1, ...opts } = options || {};\n super({\n ...opts,\n allowHalfOpen,\n readable: !0,\n writable: !0\n });\n if (this._handle = this, this._parent = this, this._parentWrap = this, this.#pendingRead = void 0, this.#upgraded = !1, socket instanceof Socket2)\n this.#socket = socket;\n signal\?.once(\"abort\", () => this.destroy()), this.once(\"connect\", () => this.emit(\"ready\"));\n }\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n #attach(port, socket) {\n if (this.remotePort = port, socket.data = this, socket.timeout(this.timeout), socket.ref(), this[bunSocketInternal] = socket, this.connecting = !1, !this.#upgraded)\n this.emit(\"connect\", this);\n Socket2.#Drain(socket);\n }\n connect(port, host, connectListener) {\n var path, connection = this.#socket, _checkServerIdentity = void 0;\n if (typeof port === \"string\") {\n if (path = port, port = void 0, typeof host === \"function\")\n connectListener = host, host = void 0;\n } else if (typeof host == \"function\") {\n if (typeof port === \"string\")\n path = port, port = void 0;\n connectListener = host, host = void 0;\n }\n if (typeof port == \"object\") {\n var {\n port,\n host,\n path,\n socket,\n localAddress,\n localPort,\n family,\n hints,\n lookup,\n noDelay,\n keepAlive,\n keepAliveInitialDelay,\n requestCert,\n rejectUnauthorized,\n pauseOnConnect,\n servername,\n checkServerIdentity,\n session\n } = port;\n if (_checkServerIdentity = checkServerIdentity, this.servername = servername, socket)\n connection = socket;\n }\n if (!pauseOnConnect)\n this.resume();\n this.connecting = !0, this.remotePort = port;\n const bunTLS = this[bunTlsSymbol];\n var tls = void 0;\n if (typeof bunTLS === \"function\") {\n if (tls = bunTLS.call(this, port, host, !0), this._requestCert = !0, this._rejectUnauthorized = rejectUnauthorized, tls) {\n if (tls.rejectUnauthorized = rejectUnauthorized, tls.requestCert = !0, tls.session = session || tls.session, this.servername = tls.servername, tls.checkServerIdentity = _checkServerIdentity || tls.checkServerIdentity, this[bunTLSConnectOptions] = tls, !connection && tls.socket)\n connection = tls.socket;\n }\n if (connection) {\n if (typeof connection !== \"object\" || !(connection instanceof Socket2) || typeof connection[bunTlsSymbol] === \"function\")\n @throwTypeError(\"socket must be an instance of net.Socket\");\n }\n if (this.authorized = !1, this.secureConnecting = !0, this._secureEstablished = !1, this._securePending = !0, connectListener)\n this.on(\"secureConnect\", connectListener);\n } else if (connectListener)\n this.on(\"connect\", connectListener);\n if (connection) {\n const socket2 = connection[bunSocketInternal];\n if (socket2) {\n this.connecting = !0, this.#upgraded = !0;\n const result = socket2.upgradeTLS({\n data: this,\n tls,\n socket: Socket2.#Handlers\n });\n if (result) {\n const [raw, tls2] = result;\n connection[bunSocketInternal] = raw, raw.timeout(raw.timeout), raw.connecting = !1, this[bunSocketInternal] = tls2;\n } else\n throw this[bunSocketInternal] = null, new Error(\"Invalid socket\");\n } else\n connection.once(\"connect\", () => {\n const socket3 = connection[bunSocketInternal];\n if (!socket3)\n return;\n this.connecting = !0, this.#upgraded = !0;\n const result = socket3.upgradeTLS({\n data: this,\n tls,\n socket: Socket2.#Handlers\n });\n if (result) {\n const [raw, tls2] = result;\n connection[bunSocketInternal] = raw, raw.timeout(raw.timeout), raw.connecting = !1, this[bunSocketInternal] = tls2;\n } else\n throw this[bunSocketInternal] = null, new Error(\"Invalid socket\");\n });\n } else if (path)\n bunConnect({\n data: this,\n unix: path,\n socket: Socket2.#Handlers,\n tls\n }).catch((error) => {\n this.emit(\"error\", error), this.emit(\"close\");\n });\n else\n bunConnect({\n data: this,\n hostname: host || \"localhost\",\n port,\n socket: Socket2.#Handlers,\n tls\n }).catch((error) => {\n this.emit(\"error\", error), this.emit(\"close\");\n });\n return this;\n }\n _destroy(err, callback) {\n this[bunSocketInternal]\?.end(), callback(err);\n }\n _final(callback) {\n this[bunSocketInternal]\?.end(), callback();\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return this[bunSocketInternal]\?.localPort;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n const queue = this.#readQueue;\n let chunk;\n while (chunk = queue.peek()) {\n if (!this.push(chunk))\n return;\n queue.shift();\n }\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n this[bunSocketInternal]\?.ref();\n }\n get remoteAddress() {\n return this[bunSocketInternal]\?.remoteAddress;\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n this[bunSocketInternal]\?.end();\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n return this;\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n if (this[bunSocketInternal]\?.timeout(timeout), this.timeout = timeout, callback)\n this.once(\"timeout\", callback);\n return this;\n }\n unref() {\n this[bunSocketInternal]\?.unref();\n }\n _write(chunk, encoding, callback) {\n if (typeof chunk == \"string\" && encoding !== \"ascii\")\n chunk = Buffer.from(chunk, encoding);\n var written = this[bunSocketInternal]\?.write(chunk);\n if (written == chunk.length)\n callback();\n else if (this.#writeCallback)\n callback(new Error(\"overlapping _write()\"));\n else {\n if (written > 0)\n if (typeof chunk == \"string\")\n chunk = chunk.slice(written);\n else\n chunk = chunk.subarray(written);\n this.#writeCallback = callback, this.#writeChunk = chunk;\n }\n }\n}), connect = createConnection;\n\nclass Server extends EventEmitter {\n #server;\n #listening = !1;\n [bunSocketServerConnections] = 0;\n [bunSocketServerOptions];\n maxConnections = 0;\n constructor(options, connectionListener) {\n super();\n if (typeof options === \"function\")\n connectionListener = options, options = {};\n else if (options == null || typeof options === \"object\")\n options = { ...options };\n else\n throw new Error(\"bun-net-polyfill: invalid arguments\");\n const { maxConnections } = options;\n this.maxConnections = Number.isSafeInteger(maxConnections) && maxConnections > 0 \? maxConnections : 0, options.connectionListener = connectionListener, this[bunSocketServerOptions] = options;\n }\n ref() {\n return this.#server\?.ref(), this;\n }\n unref() {\n return this.#server\?.unref(), this;\n }\n close(callback) {\n if (this.#server) {\n if (this.#server.stop(!0), this.#server = null, this.#listening = !1, this[bunSocketServerConnections] = 0, this.emit(\"close\"), typeof callback === \"function\")\n callback();\n return this;\n }\n if (typeof callback === \"function\") {\n const error = new Error(\"Server is not running\");\n error.code = \"ERR_SERVER_NOT_RUNNING\", callback(error);\n }\n return this;\n }\n address() {\n const server = this.#server;\n if (server) {\n const unix = server.unix;\n if (unix)\n return unix;\n let address = server.hostname;\n const type = isIP(address), port = server.port;\n if (typeof port === \"number\")\n return {\n port,\n address,\n family: type \? `IPv${type}` : void 0\n };\n if (type)\n return {\n address,\n family: type \? `IPv${type}` : void 0\n };\n return address;\n }\n return null;\n }\n getConnections(callback) {\n if (typeof callback === \"function\")\n callback(null, this.#server \? this[bunSocketServerConnections] : 0);\n return this;\n }\n listen(port, hostname, onListen) {\n let backlog, path, exclusive = !1;\n if (typeof port === \"string\") {\n if (Number.isSafeInteger(hostname)) {\n if (hostname > 0)\n backlog = hostname;\n } else if (typeof hostname === \"function\")\n onListen = hostname;\n path = port, hostname = void 0, port = void 0;\n } else {\n if (typeof hostname === \"function\")\n onListen = hostname, hostname = void 0;\n if (typeof port === \"function\")\n onListen = port, port = 0;\n else if (typeof port === \"object\") {\n const options = port;\n options.signal\?.addEventListener(\"abort\", () => this.close()), hostname = options.host, exclusive = options.exclusive === !0;\n const path2 = options.path;\n if (port = options.port, !Number.isSafeInteger(port) || port < 0)\n if (path2)\n hostname = path2, port = void 0;\n else {\n let message = 'The argument \\'options\\' must have the property \"port\" or \"path\"';\n try {\n message = `${message}. Received ${JSON.stringify(options)}`;\n } catch {\n }\n const error = @makeTypeError(message);\n throw error.code = \"ERR_INVALID_ARG_VALUE\", error;\n }\n else if (!Number.isSafeInteger(port) || port < 0)\n port = 0;\n if (typeof port.callback === \"function\")\n onListen = port\?.callback;\n } else if (!Number.isSafeInteger(port) || port < 0)\n port = 0;\n hostname = hostname || \"::\";\n }\n try {\n var tls = void 0, TLSSocketClass = void 0;\n const bunTLS = this[bunTlsSymbol], options = this[bunSocketServerOptions];\n if (typeof bunTLS === \"function\")\n [tls, TLSSocketClass] = bunTLS.call(this, port, hostname, !1), options.servername = tls.serverName, options.InternalSocketClass = TLSSocketClass;\n else\n options.InternalSocketClass = SocketClass;\n this.#server = Bun.listen(path \? {\n exclusive,\n unix: path,\n tls,\n socket: SocketClass[bunSocketServerHandlers]\n } : {\n exclusive,\n port,\n hostname,\n tls,\n socket: SocketClass[bunSocketServerHandlers]\n }), this.#server.data = this, this.#listening = !0, setTimeout(emitListeningNextTick, 1, this, onListen);\n } catch (err) {\n this.#listening = !1, setTimeout(emitErrorNextTick, 1, this, err);\n }\n return this;\n }\n}\n$ = {\n createServer,\n Server,\n createConnection,\n connect,\n isIP,\n isIPv4,\n isIPv6,\n Socket,\n [Symbol.for(\"::bunternal::\")]: SocketClass\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeInspectorCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/inspector.ts\nvar open = function() {\n throwNotImplemented(\"node:inspector open\", 2445);\n}, close = function() {\n throwNotImplemented(\"node:inspector close\", 2445);\n}, url = function() {\n throwNotImplemented(\"node:inspector url\", 2445);\n}, waitForDebugger = function() {\n throwNotImplemented(\"node:inspector waitForDebugger\", 2445);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20);\n\nclass Session extends EventEmitter {\n constructor() {\n super();\n throwNotImplemented(\"node:inspector Session\", 2445);\n }\n}\nvar console = {\n ...globalThis.console,\n context: {\n console: globalThis.console\n }\n};\n$ = {\n console,\n open,\n close,\n url,\n waitForDebugger,\n Session\n};\nhideFromStack(open, close, url, waitForDebugger, Session.prototype.constructor);\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeOSCode = "(function (){\"use strict\";// src/js/out/tmp/node/os.ts\nvar lazyCpus = function({ cpus }) {\n return () => {\n const array = new Array(navigator.hardwareConcurrency);\n function populate() {\n const results = cpus(), length = results.length;\n array.length = length;\n for (let i = 0;i < length; i++)\n array[i] = results[i];\n }\n for (let i = 0;i < array.length; i++) {\n const instance = {\n get model() {\n if (array[i] === instance)\n populate();\n return array[i].model;\n },\n set model(value) {\n if (array[i] === instance)\n populate();\n array[i].model = value;\n },\n get speed() {\n if (array[i] === instance)\n populate();\n return array[i].speed;\n },\n set speed(value) {\n if (array[i] === instance)\n populate();\n array[i].speed = value;\n },\n get times() {\n if (array[i] === instance)\n populate();\n return array[i].times;\n },\n set times(value) {\n if (array[i] === instance)\n populate();\n array[i].times = value;\n },\n toJSON() {\n if (array[i] === instance)\n populate();\n return array[i];\n }\n };\n array[i] = instance;\n }\n return array;\n };\n}, bound = function(obj) {\n return {\n arch: obj.arch.bind(obj),\n cpus: lazyCpus(obj),\n endianness: obj.endianness.bind(obj),\n freemem: obj.freemem.bind(obj),\n getPriority: obj.getPriority.bind(obj),\n homedir: obj.homedir.bind(obj),\n hostname: obj.hostname.bind(obj),\n loadavg: obj.loadavg.bind(obj),\n networkInterfaces: obj.networkInterfaces.bind(obj),\n platform: obj.platform.bind(obj),\n release: obj.release.bind(obj),\n setPriority: obj.setPriority.bind(obj),\n get tmpdir() {\n return tmpdir;\n },\n totalmem: obj.totalmem.bind(obj),\n type: obj.type.bind(obj),\n uptime: obj.uptime.bind(obj),\n userInfo: obj.userInfo.bind(obj),\n version: obj.version.bind(obj),\n machine: obj.machine.bind(obj),\n devNull: obj.devNull,\n EOL: obj.EOL,\n constants: @processBindingConstants.os\n };\n}, tmpdir = function() {\n var env = Bun.env;\n return tmpdir = function() {\n var path = env.TMPDIR || env.TMP || env.TEMP || \"/tmp\";\n const length = path.length;\n if (length > 1 && path[length - 1] === \"/\")\n path = path.slice(0, -1);\n return path;\n }, tmpdir();\n};\nreturn bound(Bun._Os())})\n"_s;
+static constexpr ASCIILiteral NodeNetCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/net.ts\nvar isIPv4 = function(s) {\n return IPv4Reg.test(s);\n}, isIPv6 = function(s) {\n return IPv6Reg.test(s);\n}, isIP = function(s) {\n if (isIPv4(s))\n return 4;\n if (isIPv6(s))\n return 6;\n return 0;\n}, closeNT = function(self) {\n self.emit(\"close\");\n}, endNT = function(socket, callback, err) {\n socket.end(), callback(err);\n}, createConnection = function(port, host, connectListener) {\n if (typeof port === \"object\")\n return new Socket(port).connect(port, host, connectListener);\n return new Socket().connect(port, host, connectListener);\n}, emitErrorNextTick = function(self, error) {\n self.emit(\"error\", error);\n}, emitErrorAndCloseNextTick = function(self, error) {\n self.emit(\"error\", error), self.emit(\"close\");\n}, emitListeningNextTick = function(self, onListen) {\n if (typeof onListen === \"function\")\n try {\n onListen();\n } catch (err) {\n self.emit(\"error\", err);\n }\n self.emit(\"listening\");\n}, createServer = function(options, connectionListener) {\n return new Server(options, connectionListener);\n}, $, { Duplex } = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20);\nvar IPv4Reg = new @RegExp(\"^((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$\");\nvar IPv6Reg = new @RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\"), { connect: bunConnect } = Bun, { setTimeout } = globalThis, bunTlsSymbol = Symbol.for(\"::buntls::\"), bunSocketServerHandlers = Symbol.for(\"::bunsocket_serverhandlers::\"), bunSocketServerConnections = Symbol.for(\"::bunnetserverconnections::\"), bunSocketServerOptions = Symbol.for(\"::bunnetserveroptions::\"), bunSocketInternal = Symbol.for(\"::bunnetsocketinternal::\"), bunTLSConnectOptions = Symbol.for(\"::buntlsconnectoptions::\"), SocketClass, Socket = function(InternalSocket) {\n SocketClass = InternalSocket, Object.defineProperty(SocketClass.prototype, Symbol.toStringTag, {\n value: \"Socket\",\n enumerable: !1\n });\n function Socket3(options) {\n return new InternalSocket(options);\n }\n return Socket3.prototype = InternalSocket.prototype, Object.defineProperty(Socket3, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalSocket;\n }\n });\n}(class Socket2 extends Duplex {\n static #Handlers = {\n close: Socket2.#Close,\n data({ data: self }, buffer) {\n self.bytesRead += buffer.length;\n const queue = self.#readQueue;\n if (queue.isEmpty()) {\n if (self.push(buffer))\n return;\n }\n queue.push(buffer);\n },\n drain: Socket2.#Drain,\n end: Socket2.#Close,\n error(socket, error) {\n const self = socket.data, callback = self.#writeCallback;\n if (callback)\n self.#writeCallback = null, callback(error);\n self.emit(\"error\", error);\n },\n open(socket) {\n const self = socket.data;\n socket.timeout(self.timeout), socket.ref(), self[bunSocketInternal] = socket, self.connecting = !1;\n const options = self[bunTLSConnectOptions];\n if (options) {\n const { session } = options;\n if (session)\n self.setSession(session);\n }\n if (!self.#upgraded)\n self.emit(\"connect\", self);\n Socket2.#Drain(socket);\n },\n handshake(socket, success, verifyError) {\n const { data: self } = socket;\n self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self.emit(\"secure\", self);\n const { checkServerIdentity } = self[bunTLSConnectOptions];\n if (!verifyError && typeof checkServerIdentity === \"function\" && self.servername) {\n const cert = self.getPeerCertificate(!0);\n verifyError = checkServerIdentity(self.servername, cert);\n }\n if (self._requestCert || self._rejectUnauthorized) {\n if (verifyError) {\n if (self.authorized = !1, self.authorizationError = verifyError.code || verifyError.message, self._rejectUnauthorized) {\n self.destroy(verifyError);\n return;\n }\n }\n } else\n self.authorized = !0;\n self.emit(\"secureConnect\", verifyError);\n },\n timeout(socket) {\n const self = socket.data;\n self.emit(\"timeout\", self);\n },\n binaryType: \"buffer\"\n };\n static #Close(socket) {\n const self = socket.data;\n if (self.#closed)\n return;\n self.#closed = !0, self[bunSocketInternal] = null;\n const queue = self.#readQueue;\n if (queue.isEmpty()) {\n if (self.push(null))\n return;\n }\n queue.push(null);\n }\n static #Drain(socket) {\n const self = socket.data, callback = self.#writeCallback;\n if (callback) {\n const chunk = self.#writeChunk, written = socket.write(chunk);\n if (self.bytesWritten += written, written < chunk.length)\n self.#writeChunk = chunk.slice(written);\n else\n self.#writeCallback = null, self.#writeChunk = null, callback(null);\n }\n }\n static [bunSocketServerHandlers] = {\n data: Socket2.#Handlers.data,\n close(socket) {\n Socket2.#Handlers.close(socket), this.data[bunSocketServerConnections]--;\n },\n end(socket) {\n Socket2.#Handlers.end(socket), this.data[bunSocketServerConnections]--;\n },\n open(socket) {\n const self = this.data, options = self[bunSocketServerOptions], { pauseOnConnect, connectionListener, InternalSocketClass, requestCert, rejectUnauthorized } = options, _socket = new InternalSocketClass({});\n if (_socket.isServer = !0, _socket._requestCert = requestCert, _socket._rejectUnauthorized = rejectUnauthorized, _socket.#attach(this.localPort, socket), self.maxConnections && self[bunSocketServerConnections] >= self.maxConnections) {\n const data = {\n localAddress: _socket.localAddress,\n localPort: _socket.localPort,\n localFamily: _socket.localFamily,\n remoteAddress: _socket.remoteAddress,\n remotePort: _socket.remotePort,\n remoteFamily: _socket.remoteFamily || \"IPv4\"\n };\n socket.end(), self.emit(\"drop\", data);\n return;\n }\n if (!pauseOnConnect)\n _socket.resume();\n if (self[bunSocketServerConnections]++, typeof connectionListener == \"function\")\n if (InternalSocketClass.name === \"TLSSocket\")\n self.once(\"secureConnection\", () => connectionListener(_socket));\n else\n connectionListener(_socket);\n self.emit(\"connection\", _socket);\n },\n handshake(socket, success, verifyError) {\n const { data: self } = socket;\n if (self.emit(\"secure\", self), self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self._requestCert || self._rejectUnauthorized) {\n if (verifyError) {\n if (self.authorized = !1, self.authorizationError = verifyError.code || verifyError.message, self._rejectUnauthorized) {\n self.destroy(verifyError);\n return;\n }\n }\n } else\n self.authorized = !0;\n self.emit(\"secureConnection\", verifyError);\n },\n error(socket, error) {\n Socket2.#Handlers.error(socket, error), this.data.emit(\"error\", error);\n },\n timeout: Socket2.#Handlers.timeout,\n connectError: Socket2.#Handlers.connectError,\n drain: Socket2.#Handlers.drain,\n binaryType: \"buffer\"\n };\n bytesRead = 0;\n bytesWritten = 0;\n #closed = !1;\n connecting = !1;\n localAddress = \"127.0.0.1\";\n #readQueue = @createFIFO();\n remotePort;\n [bunSocketInternal] = null;\n [bunTLSConnectOptions] = null;\n timeout = 0;\n #writeCallback;\n #writeChunk;\n #pendingRead;\n isServer = !1;\n _handle;\n _parent;\n _parentWrap;\n #socket;\n #upgraded;\n constructor(options) {\n const { socket, signal, write, read, allowHalfOpen = !1, ...opts } = options || {};\n super({\n ...opts,\n allowHalfOpen,\n readable: !0,\n writable: !0\n });\n if (this._handle = this, this._parent = this, this._parentWrap = this, this.#pendingRead = @undefined, this.#upgraded = null, socket instanceof Socket2)\n this.#socket = socket;\n signal\?.once(\"abort\", () => this.destroy()), this.once(\"connect\", () => this.emit(\"ready\"));\n }\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n #attach(port, socket) {\n if (this.remotePort = port, socket.data = this, socket.timeout(this.timeout), socket.ref(), this[bunSocketInternal] = socket, this.connecting = !1, !this.#upgraded)\n this.emit(\"connect\", this);\n Socket2.#Drain(socket);\n }\n #closeRawConnection() {\n const connection = this.#upgraded;\n connection[bunSocketInternal] = null, connection.unref(), connection.destroy(), process.nextTick(closeNT, connection);\n }\n connect(port, host, connectListener) {\n var path, connection = this.#socket, _checkServerIdentity = @undefined;\n if (typeof port === \"string\") {\n if (path = port, port = @undefined, typeof host === \"function\")\n connectListener = host, host = @undefined;\n } else if (typeof host == \"function\") {\n if (typeof port === \"string\")\n path = port, port = @undefined;\n connectListener = host, host = @undefined;\n }\n if (typeof port == \"object\") {\n var {\n port,\n host,\n path,\n socket,\n localAddress,\n localPort,\n family,\n hints,\n lookup,\n noDelay,\n keepAlive,\n keepAliveInitialDelay,\n requestCert,\n rejectUnauthorized,\n pauseOnConnect,\n servername,\n checkServerIdentity,\n session\n } = port;\n if (_checkServerIdentity = checkServerIdentity, this.servername = servername, socket)\n connection = socket;\n }\n if (!pauseOnConnect)\n this.resume();\n this.connecting = !0, this.remotePort = port;\n const bunTLS = this[bunTlsSymbol];\n var tls = @undefined;\n if (typeof bunTLS === \"function\") {\n if (tls = bunTLS.@call(this, port, host, !0), this._requestCert = !0, this._rejectUnauthorized = rejectUnauthorized, tls) {\n if (tls.rejectUnauthorized = rejectUnauthorized, tls.requestCert = !0, tls.session = session || tls.session, this.servername = tls.servername, tls.checkServerIdentity = _checkServerIdentity || tls.checkServerIdentity, this[bunTLSConnectOptions] = tls, !connection && tls.socket)\n connection = tls.socket;\n }\n if (connection) {\n if (typeof connection !== \"object\" || !(connection instanceof Socket2) || typeof connection[bunTlsSymbol] === \"function\")\n @throwTypeError(\"socket must be an instance of net.Socket\");\n }\n if (this.authorized = !1, this.secureConnecting = !0, this._secureEstablished = !1, this._securePending = !0, connectListener)\n this.on(\"secureConnect\", connectListener);\n } else if (connectListener)\n this.on(\"connect\", connectListener);\n try {\n if (connection) {\n const socket2 = connection[bunSocketInternal];\n if (socket2) {\n this.connecting = !0, this.#upgraded = connection;\n const result = socket2.upgradeTLS({\n data: this,\n tls,\n socket: Socket2.#Handlers\n });\n if (result) {\n const [raw, tls2] = result;\n connection[bunSocketInternal] = raw, raw.timeout(raw.timeout), this.once(\"end\", this.#closeRawConnection), raw.connecting = !1, this[bunSocketInternal] = tls2;\n } else\n throw this[bunSocketInternal] = null, new Error(\"Invalid socket\");\n } else\n connection.once(\"connect\", () => {\n const socket3 = connection[bunSocketInternal];\n if (!socket3)\n return;\n this.connecting = !0, this.#upgraded = connection;\n const result = socket3.upgradeTLS({\n data: this,\n tls,\n socket: Socket2.#Handlers\n });\n if (result) {\n const [raw, tls2] = result;\n connection[bunSocketInternal] = raw, raw.timeout(raw.timeout), this.once(\"end\", this.#closeRawConnection), raw.connecting = !1, this[bunSocketInternal] = tls2;\n } else\n throw this[bunSocketInternal] = null, new Error(\"Invalid socket\");\n });\n } else if (path)\n bunConnect({\n data: this,\n unix: path,\n socket: Socket2.#Handlers,\n tls\n }).catch((error) => {\n this.emit(\"error\", error), this.emit(\"close\");\n });\n else\n bunConnect({\n data: this,\n hostname: host || \"localhost\",\n port,\n socket: Socket2.#Handlers,\n tls\n }).catch((error) => {\n this.emit(\"error\", error), this.emit(\"close\");\n });\n } catch (error) {\n process.nextTick(emitErrorAndCloseNextTick, this, error);\n }\n return this;\n }\n _destroy(err, callback) {\n const socket = this[bunSocketInternal];\n socket && process.nextTick(endNT, socket, callback, err);\n }\n _final(callback) {\n this[bunSocketInternal]\?.end(), callback(), process.nextTick(closeNT, this);\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return this[bunSocketInternal]\?.localPort;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n const queue = this.#readQueue;\n let chunk;\n while (chunk = queue.peek()) {\n const can_continue = !this.push(chunk);\n if (queue.shift(), !can_continue)\n break;\n }\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n this[bunSocketInternal]\?.ref();\n }\n get remoteAddress() {\n return this[bunSocketInternal]\?.remoteAddress;\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n this[bunSocketInternal]\?.end();\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n return this;\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n if (this[bunSocketInternal]\?.timeout(timeout), this.timeout = timeout, callback)\n this.once(\"timeout\", callback);\n return this;\n }\n unref() {\n this[bunSocketInternal]\?.unref();\n }\n _write(chunk, encoding, callback) {\n if (typeof chunk == \"string\" && encoding !== \"ascii\")\n chunk = @Buffer.from(chunk, encoding);\n var written = this[bunSocketInternal]\?.write(chunk);\n if (written == chunk.length)\n callback();\n else if (this.#writeCallback)\n callback(new Error(\"overlapping _write()\"));\n else {\n if (written > 0)\n if (typeof chunk == \"string\")\n chunk = chunk.slice(written);\n else\n chunk = chunk.subarray(written);\n this.#writeCallback = callback, this.#writeChunk = chunk;\n }\n }\n}), connect = createConnection;\n\nclass Server extends EventEmitter {\n #server;\n #listening = !1;\n [bunSocketServerConnections] = 0;\n [bunSocketServerOptions];\n maxConnections = 0;\n constructor(options, connectionListener) {\n super();\n if (typeof options === \"function\")\n connectionListener = options, options = {};\n else if (options == null || typeof options === \"object\")\n options = { ...options };\n else\n throw new Error(\"bun-net-polyfill: invalid arguments\");\n const { maxConnections } = options;\n this.maxConnections = Number.isSafeInteger(maxConnections) && maxConnections > 0 \? maxConnections : 0, options.connectionListener = connectionListener, this[bunSocketServerOptions] = options;\n }\n ref() {\n return this.#server\?.ref(), this;\n }\n unref() {\n return this.#server\?.unref(), this;\n }\n close(callback) {\n if (this.#server) {\n if (this.#server.stop(!0), this.#server = null, this.#listening = !1, this[bunSocketServerConnections] = 0, this.emit(\"close\"), typeof callback === \"function\")\n callback();\n return this;\n }\n if (typeof callback === \"function\") {\n const error = new Error(\"Server is not running\");\n error.code = \"ERR_SERVER_NOT_RUNNING\", callback(error);\n }\n return this;\n }\n address() {\n const server = this.#server;\n if (server) {\n const unix = server.unix;\n if (unix)\n return unix;\n let address = server.hostname;\n const type = isIP(address), port = server.port;\n if (typeof port === \"number\")\n return {\n port,\n address,\n family: type \? `IPv${type}` : @undefined\n };\n if (type)\n return {\n address,\n family: type \? `IPv${type}` : @undefined\n };\n return address;\n }\n return null;\n }\n getConnections(callback) {\n if (typeof callback === \"function\")\n callback(null, this.#server \? this[bunSocketServerConnections] : 0);\n return this;\n }\n listen(port, hostname, onListen) {\n let backlog, path, exclusive = !1;\n if (typeof port === \"string\") {\n if (Number.isSafeInteger(hostname)) {\n if (hostname > 0)\n backlog = hostname;\n } else if (typeof hostname === \"function\")\n onListen = hostname;\n path = port, hostname = @undefined, port = @undefined;\n } else {\n if (typeof hostname === \"function\")\n onListen = hostname, hostname = @undefined;\n if (typeof port === \"function\")\n onListen = port, port = 0;\n else if (typeof port === \"object\") {\n const options = port;\n options.signal\?.addEventListener(\"abort\", () => this.close()), hostname = options.host, exclusive = options.exclusive === !0;\n const path2 = options.path;\n if (port = options.port, !Number.isSafeInteger(port) || port < 0)\n if (path2)\n hostname = path2, port = @undefined;\n else {\n let message = 'The argument \\'options\\' must have the property \"port\" or \"path\"';\n try {\n message = `${message}. Received ${JSON.stringify(options)}`;\n } catch {\n }\n const error = @makeTypeError(message);\n throw error.code = \"ERR_INVALID_ARG_VALUE\", error;\n }\n else if (!Number.isSafeInteger(port) || port < 0)\n port = 0;\n if (typeof port.callback === \"function\")\n onListen = port\?.callback;\n } else if (!Number.isSafeInteger(port) || port < 0)\n port = 0;\n hostname = hostname || \"::\";\n }\n try {\n var tls = @undefined, TLSSocketClass = @undefined;\n const bunTLS = this[bunTlsSymbol], options = this[bunSocketServerOptions];\n if (typeof bunTLS === \"function\")\n [tls, TLSSocketClass] = bunTLS.@call(this, port, hostname, !1), options.servername = tls.serverName, options.InternalSocketClass = TLSSocketClass;\n else\n options.InternalSocketClass = SocketClass;\n this.#server = Bun.listen(path \? {\n exclusive,\n unix: path,\n tls,\n socket: SocketClass[bunSocketServerHandlers]\n } : {\n exclusive,\n port,\n hostname,\n tls,\n socket: SocketClass[bunSocketServerHandlers]\n }), this.#server.data = this, this.#listening = !0, setTimeout(emitListeningNextTick, 1, this, onListen);\n } catch (err) {\n this.#listening = !1, setTimeout(emitErrorNextTick, 1, this, err);\n }\n return this;\n }\n}\n$ = {\n createServer,\n Server,\n createConnection,\n connect,\n isIP,\n isIPv4,\n isIPv6,\n Socket,\n [Symbol.for(\"::bunternal::\")]: SocketClass\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodePathPosixCode = "(function (){\"use strict\";// src/js/out/tmp/node/path.posix.ts\nreturn (@getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28)).posix})\n"_s;
+static constexpr ASCIILiteral NodeOSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/os.ts\nvar lazyCpus = function({ cpus }) {\n return () => {\n const array = new @Array(navigator.hardwareConcurrency);\n function populate() {\n const results = cpus(), length = results.length;\n array.length = length;\n for (let i = 0;i < length; i++)\n array[i] = results[i];\n }\n for (let i = 0;i < array.length; i++) {\n const instance = {\n get model() {\n if (array[i] === instance)\n populate();\n return array[i].model;\n },\n set model(value) {\n if (array[i] === instance)\n populate();\n array[i].model = value;\n },\n get speed() {\n if (array[i] === instance)\n populate();\n return array[i].speed;\n },\n set speed(value) {\n if (array[i] === instance)\n populate();\n array[i].speed = value;\n },\n get times() {\n if (array[i] === instance)\n populate();\n return array[i].times;\n },\n set times(value) {\n if (array[i] === instance)\n populate();\n array[i].times = value;\n },\n toJSON() {\n if (array[i] === instance)\n populate();\n return array[i];\n }\n };\n array[i] = instance;\n }\n return array;\n };\n}, bound = function(obj) {\n return {\n availableParallelism: () => {\n return navigator.hardwareConcurrency;\n },\n arch: obj.arch.bind(obj),\n cpus: lazyCpus(obj),\n endianness: obj.endianness.bind(obj),\n freemem: obj.freemem.bind(obj),\n getPriority: obj.getPriority.bind(obj),\n homedir: obj.homedir.bind(obj),\n hostname: obj.hostname.bind(obj),\n loadavg: obj.loadavg.bind(obj),\n networkInterfaces: obj.networkInterfaces.bind(obj),\n platform: obj.platform.bind(obj),\n release: obj.release.bind(obj),\n setPriority: obj.setPriority.bind(obj),\n get tmpdir() {\n return tmpdir;\n },\n totalmem: obj.totalmem.bind(obj),\n type: obj.type.bind(obj),\n uptime: obj.uptime.bind(obj),\n userInfo: obj.userInfo.bind(obj),\n version: obj.version.bind(obj),\n machine: obj.machine.bind(obj),\n devNull: obj.devNull,\n EOL: obj.EOL,\n constants: @processBindingConstants.os\n };\n}, tmpdir = function() {\n var env = Bun.env;\n return tmpdir = function() {\n var path = env.TMPDIR || env.TMP || env.TEMP || \"/tmp\";\n const length = path.length;\n if (length > 1 && path[length - 1] === \"/\")\n path = path.slice(0, -1);\n return path;\n }, tmpdir();\n};\nreturn bound(Bun._Os())})\n");
//
//
-static constexpr ASCIILiteral NodePathCode = "(function (){\"use strict\";// src/js/out/tmp/node/path.ts\nvar bound = function(obj) {\n const toNamespacedPath = obj.toNamespacedPath.bind(obj);\n return {\n resolve: obj.resolve.bind(obj),\n normalize: obj.normalize.bind(obj),\n isAbsolute: obj.isAbsolute.bind(obj),\n join: obj.join.bind(obj),\n relative: obj.relative.bind(obj),\n toNamespacedPath,\n dirname: obj.dirname.bind(obj),\n basename: obj.basename.bind(obj),\n extname: obj.extname.bind(obj),\n format: obj.format.bind(obj),\n parse: obj.parse.bind(obj),\n sep: obj.sep,\n delimiter: obj.delimiter,\n win32: void 0,\n posix: void 0,\n _makeLong: toNamespacedPath\n };\n}, posix = bound(Bun._Path(!1)), win32 = bound(Bun._Path(!0));\nposix.win32 = win32.win32 = win32;\nposix.posix = win32.posix = posix;\nreturn win32})\n"_s;
+static constexpr ASCIILiteral NodePathPosixCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/path.posix.ts\nreturn (@getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30)).posix})\n");
//
//
-static constexpr ASCIILiteral NodePathWin32Code = "(function (){\"use strict\";// src/js/out/tmp/node/path.win32.ts\nreturn (@getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28)).win32})\n"_s;
+static constexpr ASCIILiteral NodePathCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/path.ts\nvar bound = function(obj) {\n const toNamespacedPath = obj.toNamespacedPath.bind(obj);\n return {\n resolve: obj.resolve.bind(obj),\n normalize: obj.normalize.bind(obj),\n isAbsolute: obj.isAbsolute.bind(obj),\n join: obj.join.bind(obj),\n relative: obj.relative.bind(obj),\n toNamespacedPath,\n dirname: obj.dirname.bind(obj),\n basename: obj.basename.bind(obj),\n extname: obj.extname.bind(obj),\n format: obj.format.bind(obj),\n parse: obj.parse.bind(obj),\n sep: obj.sep,\n delimiter: obj.delimiter,\n win32: @undefined,\n posix: @undefined,\n _makeLong: toNamespacedPath\n };\n}, posix = bound(Bun._Path(!1)), win32 = bound(Bun._Path(!0));\nposix.win32 = win32.win32 = win32;\nposix.posix = win32.posix = posix;\nreturn win32})\n");
//
//
-static constexpr ASCIILiteral NodePerfHooksCode = "(function (){\"use strict\";// src/js/out/tmp/node/perf_hooks.ts\nvar $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), constants = {\n NODE_PERFORMANCE_GC_MAJOR: 4,\n NODE_PERFORMANCE_GC_MINOR: 1,\n NODE_PERFORMANCE_GC_INCREMENTAL: 8,\n NODE_PERFORMANCE_GC_WEAKCB: 16,\n NODE_PERFORMANCE_GC_FLAGS_NO: 0,\n NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: 2,\n NODE_PERFORMANCE_GC_FLAGS_FORCED: 4,\n NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: 8,\n NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: 16,\n NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: 32,\n NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: 64\n}, performance = globalThis.performance;\n\nclass PerformanceObserver {\n constructor() {\n throwNotImplemented(\"PerformanceObserver\");\n }\n}\n\nclass PerformanceEntry {\n constructor() {\n throwNotImplemented(\"PerformanceEntry\");\n }\n}\n$ = {\n performance,\n constants,\n PerformanceEntry,\n PerformanceObserver\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodePathWin32Code = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/path.win32.ts\nreturn (@getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30)).win32})\n");
//
//
-static constexpr ASCIILiteral NodePunycodeCode = "(function (){\"use strict\";// src/js/out/tmp/node/punycode.ts\nvar error = function(type) {\n @throwRangeError(errors[type]);\n}, map = function(array, callback) {\n const result = [];\n let length = array.length;\n while (length--)\n result[length] = callback(array[length]);\n return result;\n}, mapDomain = function(domain, callback) {\n const parts = domain.split(\"@\");\n let result = \"\";\n if (parts.length > 1)\n result = parts[0] + \"@\", domain = parts[1];\n domain = domain.replace(regexSeparators, \".\");\n const labels = domain.split(\".\"), encoded = map(labels, callback).join(\".\");\n return result + encoded;\n}, ucs2decode = function(string) {\n const output = [];\n let counter = 0;\n const length = string.length;\n while (counter < length) {\n const value = string.charCodeAt(counter++);\n if (value >= 55296 && value <= 56319 && counter < length) {\n const extra = string.charCodeAt(counter++);\n if ((extra & 64512) == 56320)\n output.push(((value & 1023) << 10) + (extra & 1023) + 65536);\n else\n output.push(value), counter--;\n } else\n output.push(value);\n }\n return output;\n}, $, maxInt = 2147483647, base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, delimiter = \"-\", regexPunycode = /^xn--/, regexNonASCII = /[^\\0-\\x7F]/, regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, errors = {\n overflow: \"Overflow: input needs wider integers to process\",\n \"not-basic\": \"Illegal input >= 0x80 (not a basic code point)\",\n \"invalid-input\": \"Invalid input\"\n}, baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, ucs2encode = (codePoints) => String.fromCodePoint(...codePoints), basicToDigit = function(codePoint) {\n if (codePoint >= 48 && codePoint < 58)\n return 26 + (codePoint - 48);\n if (codePoint >= 65 && codePoint < 91)\n return codePoint - 65;\n if (codePoint >= 97 && codePoint < 123)\n return codePoint - 97;\n return base;\n}, digitToBasic = function(digit, flag) {\n return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n}, adapt = function(delta, numPoints, firstTime) {\n let k = 0;\n delta = firstTime \? floor(delta / damp) : delta >> 1, delta += floor(delta / numPoints);\n for (;delta > baseMinusTMin * tMax >> 1; k += base)\n delta = floor(delta / baseMinusTMin);\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n}, decode = function(input) {\n const output = [], inputLength = input.length;\n let i = 0, n = initialN, bias = initialBias, basic = input.lastIndexOf(delimiter);\n if (basic < 0)\n basic = 0;\n for (let j = 0;j < basic; ++j) {\n if (input.charCodeAt(j) >= 128)\n error(\"not-basic\");\n output.push(input.charCodeAt(j));\n }\n for (let index = basic > 0 \? basic + 1 : 0;index < inputLength; ) {\n const oldi = i;\n for (let w = 1, k = base;; k += base) {\n if (index >= inputLength)\n error(\"invalid-input\");\n const digit = basicToDigit(input.charCodeAt(index++));\n if (digit >= base)\n error(\"invalid-input\");\n if (digit > floor((maxInt - i) / w))\n error(\"overflow\");\n i += digit * w;\n const t = k <= bias \? tMin : k >= bias + tMax \? tMax : k - bias;\n if (digit < t)\n break;\n const baseMinusT = base - t;\n if (w > floor(maxInt / baseMinusT))\n error(\"overflow\");\n w *= baseMinusT;\n }\n const out = output.length + 1;\n if (bias = adapt(i - oldi, out, oldi == 0), floor(i / out) > maxInt - n)\n error(\"overflow\");\n n += floor(i / out), i %= out, output.splice(i++, 0, n);\n }\n return String.fromCodePoint(...output);\n}, encode = function(input) {\n const output = [];\n input = ucs2decode(input);\n const inputLength = input.length;\n let n = initialN, delta = 0, bias = initialBias;\n for (let currentValue of input)\n if (currentValue < 128)\n output.push(stringFromCharCode(currentValue));\n const basicLength = output.length;\n let handledCPCount = basicLength;\n if (basicLength)\n output.push(delimiter);\n while (handledCPCount < inputLength) {\n let m = maxInt;\n for (let currentValue of input)\n if (currentValue >= n && currentValue < m)\n m = currentValue;\n const handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne))\n error(\"overflow\");\n delta += (m - n) * handledCPCountPlusOne, n = m;\n for (let currentValue of input) {\n if (currentValue < n && ++delta > maxInt)\n error(\"overflow\");\n if (currentValue === n) {\n let q = delta;\n for (let k = base;; k += base) {\n const t = k <= bias \? tMin : k >= bias + tMax \? tMax : k - bias;\n if (q < t)\n break;\n const qMinusT = q - t, baseMinusT = base - t;\n output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))), q = floor(qMinusT / baseMinusT);\n }\n output.push(stringFromCharCode(digitToBasic(q, 0))), bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength), delta = 0, ++handledCPCount;\n }\n }\n ++delta, ++n;\n }\n return output.join(\"\");\n}, toUnicode = function(input) {\n return mapDomain(input, function(string) {\n return regexPunycode.test(string) \? decode(string.slice(4).toLowerCase()) : string;\n });\n}, toASCII = function(input) {\n return mapDomain(input, function(string) {\n return regexNonASCII.test(string) \? \"xn--\" + encode(string) : string;\n });\n};\n$ = {\n version: \"2.1.0\",\n ucs2: {\n decode: ucs2decode,\n encode: ucs2encode\n },\n decode,\n encode,\n toASCII,\n toUnicode\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodePerfHooksCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/perf_hooks.ts\nvar $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), constants = {\n NODE_PERFORMANCE_GC_MAJOR: 4,\n NODE_PERFORMANCE_GC_MINOR: 1,\n NODE_PERFORMANCE_GC_INCREMENTAL: 8,\n NODE_PERFORMANCE_GC_WEAKCB: 16,\n NODE_PERFORMANCE_GC_FLAGS_NO: 0,\n NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: 2,\n NODE_PERFORMANCE_GC_FLAGS_FORCED: 4,\n NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: 8,\n NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: 16,\n NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: 32,\n NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: 64\n}, performance = globalThis.performance;\n\nclass PerformanceObserver {\n constructor() {\n throwNotImplemented(\"PerformanceObserver\");\n }\n}\n\nclass PerformanceEntry {\n constructor() {\n throwNotImplemented(\"PerformanceEntry\");\n }\n}\n$ = {\n performance,\n constants,\n PerformanceEntry,\n PerformanceObserver\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeQuerystringCode = "(function (){\"use strict\";// src/js/out/tmp/node/querystring.ts\nvar __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports), Buffer = @requireNativeModule(\"buffer\").Buffer, require_object_keys = __commonJS((exports, module) => {\n var objectKeys = Object.keys || function() {\n var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !{ toString: null }.propertyIsEnumerable(\"toString\"), dontEnums = [\n \"toString\",\n \"toLocaleString\",\n \"valueOf\",\n \"hasOwnProperty\",\n \"isPrototypeOf\",\n \"propertyIsEnumerable\",\n \"constructor\"\n ], dontEnumsLength = dontEnums.length;\n return function(obj) {\n if (typeof obj !== \"function\" && (typeof obj !== \"object\" || obj === null))\n @throwTypeError(\"Object.keys called on non-object\");\n var result = [], prop, i;\n for (prop in obj)\n if (hasOwnProperty.call(obj, prop))\n result.push(prop);\n if (hasDontEnumBug) {\n for (i = 0;i < dontEnumsLength; i++)\n if (hasOwnProperty.call(obj, dontEnums[i]))\n result.push(dontEnums[i]);\n }\n return result;\n };\n }();\n module.exports = objectKeys;\n}), require_src = __commonJS((exports, module) => {\n var ParsedQueryString = function() {\n }, unescapeBuffer = function(s, decodeSpaces) {\n var out = Buffer.allocUnsafe(s.length), state = 0, n, m, hexchar, c;\n for (var inIndex = 0, outIndex = 0;; inIndex++) {\n if (inIndex < s.length)\n c = s.charCodeAt(inIndex);\n else {\n if (state > 0) {\n if (out[outIndex++] = 37, state === 2)\n out[outIndex++] = hexchar;\n }\n break;\n }\n switch (state) {\n case 0:\n switch (c) {\n case 37:\n n = 0, m = 0, state = 1;\n break;\n case 43:\n if (decodeSpaces)\n c = 32;\n default:\n out[outIndex++] = c;\n break;\n }\n break;\n case 1:\n if (hexchar = c, n = unhexTable[c], !(n >= 0)) {\n out[outIndex++] = 37, out[outIndex++] = c, state = 0;\n break;\n }\n state = 2;\n break;\n case 2:\n if (state = 0, m = unhexTable[c], !(m >= 0)) {\n out[outIndex++] = 37, out[outIndex++] = hexchar, out[outIndex++] = c;\n break;\n }\n out[outIndex++] = 16 * n + m;\n break;\n }\n }\n return out.slice(0, outIndex);\n }, qsUnescape = function(s, decodeSpaces) {\n try {\n return decodeURIComponent(s);\n } catch (e) {\n return QueryString.unescapeBuffer(s, decodeSpaces).toString();\n }\n }, qsEscape = function(str) {\n if (typeof str !== \"string\")\n if (typeof str === \"object\")\n str = String(str);\n else\n str += \"\";\n var out = \"\", lastPos = 0;\n for (var i2 = 0;i2 < str.length; ++i2) {\n var c = str.charCodeAt(i2);\n if (c < 128) {\n if (noEscape[c] === 1)\n continue;\n if (lastPos < i2)\n out += str.slice(lastPos, i2);\n lastPos = i2 + 1, out += hexTable[c];\n continue;\n }\n if (lastPos < i2)\n out += str.slice(lastPos, i2);\n if (c < 2048) {\n lastPos = i2 + 1, out += hexTable[192 | c >> 6] + hexTable[128 | c & 63];\n continue;\n }\n if (c < 55296 || c >= 57344) {\n lastPos = i2 + 1, out += hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];\n continue;\n }\n ++i2;\n var c2;\n if (i2 < str.length)\n c2 = str.charCodeAt(i2) & 1023;\n else\n throw new URIError(\"URI malformed\");\n lastPos = i2 + 1, c = 65536 + ((c & 1023) << 10 | c2), out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];\n }\n if (lastPos === 0)\n return str;\n if (lastPos < str.length)\n return out + str.slice(lastPos);\n return out;\n }, stringifyPrimitive = function(v) {\n if (typeof v === \"string\")\n return v;\n if (typeof v === \"number\" && isFinite(v))\n return \"\" + v;\n if (typeof v === \"boolean\")\n return v \? \"true\" : \"false\";\n return \"\";\n }, stringify = function(obj, sep, eq, options) {\n sep = sep || \"&\", eq = eq || \"=\";\n var encode = QueryString.escape;\n if (options && typeof options.encodeURIComponent === \"function\")\n encode = options.encodeURIComponent;\n if (obj !== null && typeof obj === \"object\") {\n var keys = objectKeys(obj), len = keys.length, flast = len - 1, fields = \"\";\n for (var i2 = 0;i2 < len; ++i2) {\n var k = keys[i2], v = obj[k], ks = encode(stringifyPrimitive(k)) + eq;\n if (isArray(v)) {\n var vlen = v.length, vlast = vlen - 1;\n for (var j = 0;j < vlen; ++j)\n if (fields += ks + encode(stringifyPrimitive(v[j])), j < vlast)\n fields += sep;\n if (vlen && i2 < flast)\n fields += sep;\n } else if (fields += ks + encode(stringifyPrimitive(v)), i2 < flast)\n fields += sep;\n }\n return fields;\n }\n return \"\";\n }, charCodes = function(str) {\n if (str.length === 0)\n return [];\n if (str.length === 1)\n return [str.charCodeAt(0)];\n const ret = [];\n for (var i2 = 0;i2 < str.length; ++i2)\n ret[ret.length] = str.charCodeAt(i2);\n return ret;\n }, parse = function(qs, sep, eq, options) {\n const obj = new ParsedQueryString;\n if (typeof qs !== \"string\" || qs.length === 0)\n return obj;\n var sepCodes = !sep \? defSepCodes : charCodes(sep + \"\"), eqCodes = !eq \? defEqCodes : charCodes(eq + \"\");\n const sepLen = sepCodes.length, eqLen = eqCodes.length;\n var pairs = 1000;\n if (options && typeof options.maxKeys === \"number\")\n pairs = options.maxKeys > 0 \? options.maxKeys : -1;\n var decode = QueryString.unescape;\n if (options && typeof options.decodeURIComponent === \"function\")\n decode = options.decodeURIComponent;\n const customDecode = decode !== qsUnescape, keys = [];\n var posIdx = 0, lastPos = 0, sepIdx = 0, eqIdx = 0, key = \"\", value = \"\", keyEncoded = customDecode, valEncoded = customDecode, encodeCheck = 0;\n for (var i2 = 0;i2 < qs.length; ++i2) {\n const code = qs.charCodeAt(i2);\n if (code === sepCodes[sepIdx]) {\n if (++sepIdx === sepLen) {\n const end = i2 - sepIdx + 1;\n if (eqIdx < eqLen) {\n if (lastPos < end)\n key += qs.slice(lastPos, end);\n } else if (lastPos < end)\n value += qs.slice(lastPos, end);\n if (keyEncoded)\n key = decodeStr(key, decode);\n if (valEncoded)\n value = decodeStr(value, decode);\n if (key || value || lastPos - posIdx > sepLen || i2 === 0)\n if (indexOf(keys, key) === -1)\n obj[key] = value, keys[keys.length] = key;\n else {\n const curValue = obj[key] || \"\";\n if (curValue.pop)\n curValue[curValue.length] = value;\n else if (curValue)\n obj[key] = [curValue, value];\n }\n else if (i2 === 1)\n delete obj[key];\n if (--pairs === 0)\n break;\n keyEncoded = valEncoded = customDecode, encodeCheck = 0, key = value = \"\", posIdx = lastPos, lastPos = i2 + 1, sepIdx = eqIdx = 0;\n }\n continue;\n } else if (sepIdx = 0, !valEncoded)\n if (code === 37)\n encodeCheck = 1;\n else if (encodeCheck > 0 && (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {\n if (++encodeCheck === 3)\n valEncoded = !0;\n } else\n encodeCheck = 0;\n if (eqIdx < eqLen) {\n if (code === eqCodes[eqIdx]) {\n if (++eqIdx === eqLen) {\n const end = i2 - eqIdx + 1;\n if (lastPos < end)\n key += qs.slice(lastPos, end);\n encodeCheck = 0, lastPos = i2 + 1;\n }\n continue;\n } else if (eqIdx = 0, !keyEncoded)\n if (code === 37)\n encodeCheck = 1;\n else if (encodeCheck > 0 && (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {\n if (++encodeCheck === 3)\n keyEncoded = !0;\n } else\n encodeCheck = 0;\n }\n if (code === 43) {\n if (eqIdx < eqLen) {\n if (lastPos < i2)\n key += qs.slice(lastPos, i2);\n key += \"%20\", keyEncoded = !0;\n } else {\n if (lastPos < i2)\n value += qs.slice(lastPos, i2);\n value += \"%20\", valEncoded = !0;\n }\n lastPos = i2 + 1;\n }\n }\n if (pairs !== 0 && (lastPos < qs.length || eqIdx > 0)) {\n if (lastPos < qs.length) {\n if (eqIdx < eqLen)\n key += qs.slice(lastPos);\n else if (sepIdx < sepLen)\n value += qs.slice(lastPos);\n }\n if (keyEncoded)\n key = decodeStr(key, decode);\n if (valEncoded)\n value = decodeStr(value, decode);\n if (indexOf(keys, key) === -1)\n obj[key] = value, keys[keys.length] = key;\n else {\n const curValue = obj[key];\n if (curValue.pop)\n curValue[curValue.length] = value;\n else\n obj[key] = [curValue, value];\n }\n }\n return obj;\n }, decodeStr = function(s, decoder) {\n try {\n return decoder(s);\n } catch (e) {\n return QueryString.unescape(s, !0);\n }\n }, QueryString = module.exports = {\n unescapeBuffer,\n unescape: qsUnescape,\n escape: qsEscape,\n stringify,\n encode: stringify,\n parse,\n decode: parse\n }, objectKeys = require_object_keys(), isArray = (arg) => Object.prototype.toString.call(arg) === \"[object Array]\", indexOf = (arr, searchElement, fromIndex) => {\n var k;\n if (arr == null)\n @throwTypeError('\"arr\" is null or not defined');\n var o = Object(arr), len = o.length >>> 0;\n if (len === 0)\n return -1;\n var n = fromIndex | 0;\n if (n >= len)\n return -1;\n k = Math.max(n >= 0 \? n : len - Math.abs(n), 0);\n while (k < len) {\n if ((k in o) && o[k] === searchElement)\n return k;\n k++;\n }\n return -1;\n };\n ParsedQueryString.prototype = Object.create \? Object.create(null) : {};\n var unhexTable = [\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1\n ], hexTable = [];\n for (i = 0;i < 256; ++i)\n hexTable[i] = \"%\" + ((i < 16 \? \"0\" : \"\") + i.toString(16)).toUpperCase();\n var i, noEscape = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 1,\n 0\n ], defSepCodes = [38], defEqCodes = [61];\n});\nreturn require_src()})\n"_s;
+static constexpr ASCIILiteral NodePunycodeCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/punycode.ts\nvar error = function(type) {\n @throwRangeError(errors[type]);\n}, map = function(array, callback) {\n const result = [];\n let length = array.length;\n while (length--)\n result[length] = callback(array[length]);\n return result;\n}, mapDomain = function(domain, callback) {\n const parts = domain.split(\"@\");\n let result = \"\";\n if (parts.length > 1)\n result = parts[0] + \"@\", domain = parts[1];\n domain = domain.replace(regexSeparators, \".\");\n const labels = domain.split(\".\"), encoded = map(labels, callback).join(\".\");\n return result + encoded;\n}, ucs2decode = function(string) {\n const output = [];\n let counter = 0;\n const length = string.length;\n while (counter < length) {\n const value = string.charCodeAt(counter++);\n if (value >= 55296 && value <= 56319 && counter < length) {\n const extra = string.charCodeAt(counter++);\n if ((extra & 64512) == 56320)\n output.push(((value & 1023) << 10) + (extra & 1023) + 65536);\n else\n output.push(value), counter--;\n } else\n output.push(value);\n }\n return output;\n}, $, maxInt = 2147483647, base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, delimiter = \"-\", regexPunycode = /^xn--/, regexNonASCII = /[^\\0-\\x7F]/, regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, errors = {\n overflow: \"Overflow: input needs wider integers to process\",\n \"not-basic\": \"Illegal input >= 0x80 (not a basic code point)\",\n \"invalid-input\": \"Invalid input\"\n}, baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = @String.fromCharCode, ucs2encode = (codePoints) => @String.fromCodePoint(...codePoints), basicToDigit = function(codePoint) {\n if (codePoint >= 48 && codePoint < 58)\n return 26 + (codePoint - 48);\n if (codePoint >= 65 && codePoint < 91)\n return codePoint - 65;\n if (codePoint >= 97 && codePoint < 123)\n return codePoint - 97;\n return base;\n}, digitToBasic = function(digit, flag) {\n return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n}, adapt = function(delta, numPoints, firstTime) {\n let k = 0;\n delta = firstTime \? floor(delta / damp) : delta >> 1, delta += floor(delta / numPoints);\n for (;delta > baseMinusTMin * tMax >> 1; k += base)\n delta = floor(delta / baseMinusTMin);\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n}, decode = function(input) {\n const output = [], inputLength = input.length;\n let i = 0, n = initialN, bias = initialBias, basic = input.lastIndexOf(delimiter);\n if (basic < 0)\n basic = 0;\n for (let j = 0;j < basic; ++j) {\n if (input.charCodeAt(j) >= 128)\n error(\"not-basic\");\n output.push(input.charCodeAt(j));\n }\n for (let index = basic > 0 \? basic + 1 : 0;index < inputLength; ) {\n const oldi = i;\n for (let w = 1, k = base;; k += base) {\n if (index >= inputLength)\n error(\"invalid-input\");\n const digit = basicToDigit(input.charCodeAt(index++));\n if (digit >= base)\n error(\"invalid-input\");\n if (digit > floor((maxInt - i) / w))\n error(\"overflow\");\n i += digit * w;\n const t = k <= bias \? tMin : k >= bias + tMax \? tMax : k - bias;\n if (digit < t)\n break;\n const baseMinusT = base - t;\n if (w > floor(maxInt / baseMinusT))\n error(\"overflow\");\n w *= baseMinusT;\n }\n const out = output.length + 1;\n if (bias = adapt(i - oldi, out, oldi == 0), floor(i / out) > maxInt - n)\n error(\"overflow\");\n n += floor(i / out), i %= out, output.splice(i++, 0, n);\n }\n return @String.fromCodePoint(...output);\n}, encode = function(input) {\n const output = [];\n input = ucs2decode(input);\n const inputLength = input.length;\n let n = initialN, delta = 0, bias = initialBias;\n for (let currentValue of input)\n if (currentValue < 128)\n output.push(stringFromCharCode(currentValue));\n const basicLength = output.length;\n let handledCPCount = basicLength;\n if (basicLength)\n output.push(delimiter);\n while (handledCPCount < inputLength) {\n let m = maxInt;\n for (let currentValue of input)\n if (currentValue >= n && currentValue < m)\n m = currentValue;\n const handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne))\n error(\"overflow\");\n delta += (m - n) * handledCPCountPlusOne, n = m;\n for (let currentValue of input) {\n if (currentValue < n && ++delta > maxInt)\n error(\"overflow\");\n if (currentValue === n) {\n let q = delta;\n for (let k = base;; k += base) {\n const t = k <= bias \? tMin : k >= bias + tMax \? tMax : k - bias;\n if (q < t)\n break;\n const qMinusT = q - t, baseMinusT = base - t;\n output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))), q = floor(qMinusT / baseMinusT);\n }\n output.push(stringFromCharCode(digitToBasic(q, 0))), bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength), delta = 0, ++handledCPCount;\n }\n }\n ++delta, ++n;\n }\n return output.join(\"\");\n}, toUnicode = function(input) {\n return mapDomain(input, function(string) {\n return regexPunycode.test(string) \? decode(string.slice(4).toLowerCase()) : string;\n });\n}, toASCII = function(input) {\n return mapDomain(input, function(string) {\n return regexNonASCII.test(string) \? \"xn--\" + encode(string) : string;\n });\n};\n$ = {\n version: \"2.1.0\",\n ucs2: {\n decode: ucs2decode,\n encode: ucs2encode\n },\n decode,\n encode,\n toASCII,\n toUnicode\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeReadlineCode = "(function (){\"use strict\";// src/js/out/tmp/node/readline.ts\nvar stripVTControlCharacters = function(str) {\n return validateString(str, \"str\"), RegExpPrototypeSymbolReplace.call(ansi, str, \"\");\n}, promisify = function(original) {\n if (validateFunction(original, \"original\"), original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n return validateFunction(fn, \"util.promisify.custom\"), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n }\n var argumentNames = original[kCustomPromisifyArgsSymbol];\n function fn(...args) {\n return new Promise((resolve, reject) => {\n ArrayPrototypePush.call(args, (err, ...values) => {\n if (err)\n return reject(err);\n if (argumentNames !== void 0 && values.length > 1) {\n var obj = {};\n for (var i2 = 0;i2 < argumentNames.length; i2++)\n obj[argumentNames[i2]] = values[i2];\n resolve(obj);\n } else\n resolve(values[0]);\n }), ReflectApply(original, this, args);\n });\n }\n ObjectSetPrototypeOf(fn, ObjectGetPrototypeOf(original)), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n var descriptors = ObjectGetOwnPropertyDescriptors(original), propertiesValues = ObjectValues(descriptors);\n for (var i = 0;i < propertiesValues.length; i++)\n ObjectSetPrototypeOf(propertiesValues[i], null);\n return ObjectDefineProperties(fn, descriptors);\n}, getNodeErrorByName = function(typeName) {\n var base = errorBases[typeName];\n if (base)\n return base;\n if (!ObjectKeys(VALID_NODE_ERROR_BASES).includes(typeName))\n throw new Error(\"Invalid NodeError type\");\n var Base = VALID_NODE_ERROR_BASES[typeName];\n\n class NodeError extends Base {\n [kIsNodeError] = !0;\n code;\n constructor(msg, opts) {\n super(msg, opts);\n this.code = opts\?.code || \"ERR_GENERIC\";\n }\n toString() {\n return `${this.name} [${this.code}]: ${this.message}`;\n }\n }\n return errorBases[typeName] = NodeError, NodeError;\n}, validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateArray = function(value, name, minLength = 0) {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n var reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar validateInteger = function(value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, validateUint32 = function(value, name, positive = !1) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n var min = positive \? 1 : 0, max = 4294967295;\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, CSI = function(strings, ...args) {\n var ret = `${kEscape}[`;\n for (var n = 0;n < strings.length; n++)\n if (ret += strings[n], n < args.length)\n ret += args[n];\n return ret;\n}, charLengthLeft = function(str, i) {\n if (i <= 0)\n return 0;\n if (i > 1 && StringPrototypeCodePointAt.call(str, i - 2) >= kUTF16SurrogateThreshold || StringPrototypeCodePointAt.call(str, i - 1) >= kUTF16SurrogateThreshold)\n return 2;\n return 1;\n}, charLengthAt = function(str, i) {\n if (str.length <= i)\n return 1;\n return StringPrototypeCodePointAt.call(str, i) >= kUTF16SurrogateThreshold \? 2 : 1;\n};\nfunction* emitKeys(stream) {\n while (!0) {\n var ch = yield, s = ch, escaped = !1, keySeq = null, keyName, keyCtrl2 = !1, keyMeta = !1, keyShift = !1;\n if (ch === kEscape) {\n if (escaped = !0, s += ch = yield, ch === kEscape)\n s += ch = yield;\n }\n if (escaped && (ch === \"O\" || ch === \"[\")) {\n var code = ch, modifier = 0;\n if (ch === \"O\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n modifier = (ch >> 0) - 1, s += ch = yield;\n code += ch;\n } else if (ch === \"[\") {\n if (s += ch = yield, ch === \"[\")\n code += ch, s += ch = yield;\n var cmdStart = s.length - 1;\n if (ch >= \"0\" && ch <= \"9\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += ch = yield;\n }\n if (ch === \";\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += yield;\n }\n var cmd = StringPrototypeSlice.call(s, cmdStart), match;\n if (match = RegExpPrototypeExec.call(/^(\\d\\d\?)(;(\\d))\?([~^$])$/, cmd))\n code += match[1] + match[4], modifier = (match[3] || 1) - 1;\n else if (match = RegExpPrototypeExec.call(/^((\\d;)\?(\\d))\?([A-Za-z])$/, cmd))\n code += match[4], modifier = (match[3] || 1) - 1;\n else\n code += cmd;\n }\n switch (keyCtrl2 = !!(modifier & 4), keyMeta = !!(modifier & 10), keyShift = !!(modifier & 1), code) {\n case \"[P\":\n keyName = \"f1\";\n break;\n case \"[Q\":\n keyName = \"f2\";\n break;\n case \"[R\":\n keyName = \"f3\";\n break;\n case \"[S\":\n keyName = \"f4\";\n break;\n case \"OP\":\n keyName = \"f1\";\n break;\n case \"OQ\":\n keyName = \"f2\";\n break;\n case \"OR\":\n keyName = \"f3\";\n break;\n case \"OS\":\n keyName = \"f4\";\n break;\n case \"[11~\":\n keyName = \"f1\";\n break;\n case \"[12~\":\n keyName = \"f2\";\n break;\n case \"[13~\":\n keyName = \"f3\";\n break;\n case \"[14~\":\n keyName = \"f4\";\n break;\n case \"[[A\":\n keyName = \"f1\";\n break;\n case \"[[B\":\n keyName = \"f2\";\n break;\n case \"[[C\":\n keyName = \"f3\";\n break;\n case \"[[D\":\n keyName = \"f4\";\n break;\n case \"[[E\":\n keyName = \"f5\";\n break;\n case \"[15~\":\n keyName = \"f5\";\n break;\n case \"[17~\":\n keyName = \"f6\";\n break;\n case \"[18~\":\n keyName = \"f7\";\n break;\n case \"[19~\":\n keyName = \"f8\";\n break;\n case \"[20~\":\n keyName = \"f9\";\n break;\n case \"[21~\":\n keyName = \"f10\";\n break;\n case \"[23~\":\n keyName = \"f11\";\n break;\n case \"[24~\":\n keyName = \"f12\";\n break;\n case \"[A\":\n keyName = \"up\";\n break;\n case \"[B\":\n keyName = \"down\";\n break;\n case \"[C\":\n keyName = \"right\";\n break;\n case \"[D\":\n keyName = \"left\";\n break;\n case \"[E\":\n keyName = \"clear\";\n break;\n case \"[F\":\n keyName = \"end\";\n break;\n case \"[H\":\n keyName = \"home\";\n break;\n case \"OA\":\n keyName = \"up\";\n break;\n case \"OB\":\n keyName = \"down\";\n break;\n case \"OC\":\n keyName = \"right\";\n break;\n case \"OD\":\n keyName = \"left\";\n break;\n case \"OE\":\n keyName = \"clear\";\n break;\n case \"OF\":\n keyName = \"end\";\n break;\n case \"OH\":\n keyName = \"home\";\n break;\n case \"[1~\":\n keyName = \"home\";\n break;\n case \"[2~\":\n keyName = \"insert\";\n break;\n case \"[3~\":\n keyName = \"delete\";\n break;\n case \"[4~\":\n keyName = \"end\";\n break;\n case \"[5~\":\n keyName = \"pageup\";\n break;\n case \"[6~\":\n keyName = \"pagedown\";\n break;\n case \"[[5~\":\n keyName = \"pageup\";\n break;\n case \"[[6~\":\n keyName = \"pagedown\";\n break;\n case \"[7~\":\n keyName = \"home\";\n break;\n case \"[8~\":\n keyName = \"end\";\n break;\n case \"[a\":\n keyName = \"up\", keyShift = !0;\n break;\n case \"[b\":\n keyName = \"down\", keyShift = !0;\n break;\n case \"[c\":\n keyName = \"right\", keyShift = !0;\n break;\n case \"[d\":\n keyName = \"left\", keyShift = !0;\n break;\n case \"[e\":\n keyName = \"clear\", keyShift = !0;\n break;\n case \"[2$\":\n keyName = \"insert\", keyShift = !0;\n break;\n case \"[3$\":\n keyName = \"delete\", keyShift = !0;\n break;\n case \"[5$\":\n keyName = \"pageup\", keyShift = !0;\n break;\n case \"[6$\":\n keyName = \"pagedown\", keyShift = !0;\n break;\n case \"[7$\":\n keyName = \"home\", keyShift = !0;\n break;\n case \"[8$\":\n keyName = \"end\", keyShift = !0;\n break;\n case \"Oa\":\n keyName = \"up\", keyCtrl2 = !0;\n break;\n case \"Ob\":\n keyName = \"down\", keyCtrl2 = !0;\n break;\n case \"Oc\":\n keyName = \"right\", keyCtrl2 = !0;\n break;\n case \"Od\":\n keyName = \"left\", keyCtrl2 = !0;\n break;\n case \"Oe\":\n keyName = \"clear\", keyCtrl2 = !0;\n break;\n case \"[2^\":\n keyName = \"insert\", keyCtrl2 = !0;\n break;\n case \"[3^\":\n keyName = \"delete\", keyCtrl2 = !0;\n break;\n case \"[5^\":\n keyName = \"pageup\", keyCtrl2 = !0;\n break;\n case \"[6^\":\n keyName = \"pagedown\", keyCtrl2 = !0;\n break;\n case \"[7^\":\n keyName = \"home\", keyCtrl2 = !0;\n break;\n case \"[8^\":\n keyName = \"end\", keyCtrl2 = !0;\n break;\n case \"[Z\":\n keyName = \"tab\", keyShift = !0;\n break;\n default:\n keyName = \"undefined\";\n break;\n }\n } else if (ch === \"\\r\")\n keyName = \"return\", keyMeta = escaped;\n else if (ch === \"\\n\")\n keyName = \"enter\", keyMeta = escaped;\n else if (ch === \"\\t\")\n keyName = \"tab\", keyMeta = escaped;\n else if (ch === \"\\b\" || ch === \"\\x7F\")\n keyName = \"backspace\", keyMeta = escaped;\n else if (ch === kEscape)\n keyName = \"escape\", keyMeta = escaped;\n else if (ch === \" \")\n keyName = \"space\", keyMeta = escaped;\n else if (!escaped && ch <= \"\\x1A\")\n keyName = StringFromCharCode(StringPrototypeCharCodeAt.call(ch) + StringPrototypeCharCodeAt.call(\"a\") - 1), keyCtrl2 = !0;\n else if (RegExpPrototypeExec.call(/^[0-9A-Za-z]$/, ch) !== null)\n keyName = StringPrototypeToLowerCase.call(ch), keyShift = RegExpPrototypeExec.call(/^[A-Z]$/, ch) !== null, keyMeta = escaped;\n else if (escaped)\n keyName = ch.length \? void 0 : \"escape\", keyMeta = !0;\n else\n keyName = void 0;\n if (keySeq = s, s.length !== 0 && (keyName !== void 0 || escaped))\n stream.emit(\"keypress\", escaped \? void 0 : s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n else if (charLengthAt(s, 0) === s.length)\n stream.emit(\"keypress\", s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n }\n}\nvar commonPrefix = function(strings) {\n if (strings.length === 0)\n return \"\";\n if (strings.length === 1)\n return strings[0];\n var sorted = ArrayPrototypeSort.call(ArrayPrototypeSlice.call(strings)), min = sorted[0], max = sorted[sorted.length - 1];\n for (var i = 0;i < min.length; i++)\n if (min[i] !== max[i])\n return StringPrototypeSlice.call(min, 0, i);\n return min;\n}, cursorTo = function(stream, x, y, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (typeof y === \"function\")\n callback = y, y = void 0;\n if (NumberIsNaN(x))\n throw new ERR_INVALID_ARG_VALUE(\"x\", x);\n if (NumberIsNaN(y))\n throw new ERR_INVALID_ARG_VALUE(\"y\", y);\n if (stream == null || typeof x !== \"number\" && typeof y !== \"number\") {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n if (typeof x !== \"number\")\n throw new ERR_INVALID_CURSOR_POS;\n var data = typeof y !== \"number\" \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n return stream.write(data, callback);\n}, moveCursor = function(stream, dx, dy, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream == null || !(dx || dy)) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n return stream.write(data, callback);\n}, clearLine = function(stream, dir, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var type = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n return stream.write(type, callback);\n}, clearScreenDown = function(stream, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n return stream.write(kClearScreenDown, callback);\n}, emitKeypressEvents = function(stream, iface = {}) {\n if (stream[KEYPRESS_DECODER])\n return;\n stream[KEYPRESS_DECODER] = new StringDecoder(\"utf8\"), stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next();\n var triggerEscape = () => stream[ESCAPE_DECODER].next(\"\"), { escapeCodeTimeout = ESCAPE_CODE_TIMEOUT } = iface, timeoutId;\n function onData(input) {\n if (stream.listenerCount(\"keypress\") > 0) {\n var string = stream[KEYPRESS_DECODER].write(input);\n if (string) {\n clearTimeout(timeoutId), iface[kSawKeyPress] = charLengthAt(string, 0) === string.length, iface.isCompletionEnabled = !1;\n var length = 0;\n for (var character of new SafeStringIterator(string)) {\n if (length += character.length, length === string.length)\n iface.isCompletionEnabled = !0;\n try {\n if (stream[ESCAPE_DECODER].next(character), length === string.length && character === kEscape)\n timeoutId = setTimeout(triggerEscape, escapeCodeTimeout);\n } catch (err) {\n throw stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next(), err;\n }\n }\n }\n } else\n stream.removeListener(\"data\", onData), stream.on(\"newListener\", onNewListener);\n }\n function onNewListener(event) {\n if (event === \"keypress\")\n stream.on(\"data\", onData), stream.removeListener(\"newListener\", onNewListener);\n }\n if (stream.listenerCount(\"keypress\") > 0)\n stream.on(\"data\", onData);\n else\n stream.on(\"newListener\", onNewListener);\n}, onSelfCloseWithTerminal = function() {\n var input = this.input, output = this.output;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n if (input.removeListener(\"keypress\", this[kOnKeyPress]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnTermEnd]), output !== null && output !== void 0)\n output.removeListener(\"resize\", this[kOnResize]);\n}, onSelfCloseWithoutTerminal = function() {\n var input = this.input;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n input.removeListener(\"data\", this[kOnData]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnEnd]);\n}, onError = function(err) {\n this.emit(\"error\", err);\n}, onData = function(data) {\n debug(\"onData\"), this[kNormalWrite](data);\n}, onEnd = function() {\n if (debug(\"onEnd\"), typeof this[kLine_buffer] === \"string\" && this[kLine_buffer].length > 0)\n this.emit(\"line\", this[kLine_buffer]);\n this.close();\n}, onTermEnd = function() {\n if (debug(\"onTermEnd\"), typeof this.line === \"string\" && this.line.length > 0)\n this.emit(\"line\", this.line);\n this.close();\n}, onKeyPress = function(s, key) {\n if (this[kTtyWrite](s, key), key && key.sequence) {\n var ch = StringPrototypeCodePointAt.call(key.sequence, 0);\n if (ch >= 55296 && ch <= 57343)\n this[kRefreshLine]();\n }\n}, onResize = function() {\n this[kRefreshLine]();\n}, InterfaceConstructor = function(input, output, completer, terminal) {\n if (!(this instanceof InterfaceConstructor))\n return new InterfaceConstructor(input, output, completer, terminal);\n EventEmitter.call(this), this[kOnSelfCloseWithoutTerminal] = onSelfCloseWithoutTerminal.bind(this), this[kOnSelfCloseWithTerminal] = onSelfCloseWithTerminal.bind(this), this[kOnError] = onError.bind(this), this[kOnData] = onData.bind(this), this[kOnEnd] = onEnd.bind(this), this[kOnTermEnd] = onTermEnd.bind(this), this[kOnKeyPress] = onKeyPress.bind(this), this[kOnResize] = onResize.bind(this), this[kSawReturnAt] = 0, this.isCompletionEnabled = !0, this[kSawKeyPress] = !1, this[kPreviousKey] = null, this.escapeCodeTimeout = ESCAPE_CODE_TIMEOUT, this.tabSize = 8;\n var history, historySize, removeHistoryDuplicates = !1, crlfDelay, prompt = \"> \", signal;\n if (input\?.input) {\n output = input.output, completer = input.completer, terminal = input.terminal, history = input.history, historySize = input.historySize, signal = input.signal;\n var tabSize = input.tabSize;\n if (tabSize !== void 0)\n validateUint32(tabSize, \"tabSize\", !0), this.tabSize = tabSize;\n removeHistoryDuplicates = input.removeHistoryDuplicates;\n var inputPrompt = input.prompt;\n if (inputPrompt !== void 0)\n prompt = inputPrompt;\n var inputEscapeCodeTimeout = input.escapeCodeTimeout;\n if (inputEscapeCodeTimeout !== void 0)\n if (NumberIsFinite(inputEscapeCodeTimeout))\n this.escapeCodeTimeout = inputEscapeCodeTimeout;\n else\n throw new ERR_INVALID_ARG_VALUE(\"input.escapeCodeTimeout\", this.escapeCodeTimeout);\n if (signal)\n validateAbortSignal(signal, \"options.signal\");\n crlfDelay = input.crlfDelay, input = input.input;\n }\n if (completer !== void 0 && typeof completer !== \"function\")\n throw new ERR_INVALID_ARG_VALUE(\"completer\", completer);\n if (history === void 0)\n history = [];\n else\n validateArray(history, \"history\");\n if (historySize === void 0)\n historySize = kHistorySize;\n if (typeof historySize !== \"number\" || NumberIsNaN(historySize) || historySize < 0)\n throw new ERR_INVALID_ARG_VALUE(\"historySize\", historySize);\n if (terminal === void 0 && !(output === null || output === void 0))\n terminal = !!output.isTTY;\n if (this.line = \"\", this[kSubstringSearch] = null, this.output = output, this.input = input, this[kUndoStack] = [], this[kRedoStack] = [], this.history = history, this.historySize = historySize, this[kKillRing] = [], this[kKillRingCursor] = 0, this.removeHistoryDuplicates = !!removeHistoryDuplicates, this.crlfDelay = crlfDelay \? MathMax(kMincrlfDelay, crlfDelay) : kMincrlfDelay, this.completer = completer, this.setPrompt(prompt), this.terminal = !!terminal, this[kLineObjectStream] = void 0, input.on(\"error\", this[kOnError]), !this.terminal)\n input.on(\"data\", this[kOnData]), input.on(\"end\", this[kOnEnd]), this.once(\"close\", this[kOnSelfCloseWithoutTerminal]), this[kDecoder] = new StringDecoder(\"utf8\");\n else {\n if (emitKeypressEvents(input, this), input.on(\"keypress\", this[kOnKeyPress]), input.on(\"end\", this[kOnTermEnd]), this[kSetRawMode](!0), this.terminal = !0, this.cursor = 0, this.historyIndex = -1, output !== null && output !== void 0)\n output.on(\"resize\", this[kOnResize]);\n this.once(\"close\", this[kOnSelfCloseWithTerminal]);\n }\n if (signal) {\n var onAborted = (() => this.close()).bind(this);\n if (signal.aborted)\n process.nextTick(onAborted);\n else\n signal.addEventListener(\"abort\", onAborted, { once: !0 }), this.once(\"close\", () => signal.removeEventListener(\"abort\", onAborted));\n }\n this.line = \"\", input.resume();\n}, Interface = function(input, output, completer, terminal) {\n if (!(this instanceof Interface))\n return new Interface(input, output, completer, terminal);\n if (input\?.input && typeof input.completer === \"function\" && input.completer.length !== 2) {\n var { completer } = input;\n input.completer = (v, cb) => cb(null, completer(v));\n } else if (typeof completer === \"function\" && completer.length !== 2) {\n var realCompleter = completer;\n completer = (v, cb) => cb(null, realCompleter(v));\n }\n InterfaceConstructor.call(this, input, output, completer, terminal);\n}, createInterface = function(input, output, completer, terminal) {\n return new Interface(input, output, completer, terminal);\n};\nvar $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { StringDecoder } = @requireNativeModule(\"string_decoder\"), isWritable, { inspect } = Bun, debug = process.env.BUN_JS_DEBUG \? console.log : () => {\n}, SymbolAsyncIterator = Symbol.asyncIterator, SymbolIterator = Symbol.iterator, SymbolFor = Symbol.for, SymbolReplace = Symbol.replace, ArrayFrom = Array.from, ArrayIsArray = Array.isArray, ArrayPrototypeFilter = Array.prototype.filter, ArrayPrototypeSort = Array.prototype.sort, ArrayPrototypeIndexOf = Array.prototype.indexOf, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypePop = Array.prototype.pop, ArrayPrototypePush = Array.prototype.push, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeSplice = Array.prototype.splice, ArrayPrototypeReverse = Array.prototype.reverse, ArrayPrototypeShift = Array.prototype.shift, ArrayPrototypeUnshift = Array.prototype.unshift, RegExpPrototypeExec = RegExp.prototype.exec, RegExpPrototypeSymbolReplace = RegExp.prototype[SymbolReplace], StringFromCharCode = String.fromCharCode, StringPrototypeCharCodeAt = String.prototype.charCodeAt, StringPrototypeCodePointAt = String.prototype.codePointAt, StringPrototypeSlice = String.prototype.slice, StringPrototypeToLowerCase = String.prototype.toLowerCase, StringPrototypeEndsWith = String.prototype.endsWith, StringPrototypeRepeat = String.prototype.repeat, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeTrim = String.prototype.trim, StringPrototypeNormalize = String.prototype.normalize, NumberIsNaN = Number.isNaN, NumberIsFinite = Number.isFinite, NumberIsInteger = Number.isInteger, NumberMAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER, NumberMIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER, MathCeil = Math.ceil, MathFloor = Math.floor, MathMax = Math.max, MathMaxApply = Math.max.apply, DateNow = Date.now, FunctionPrototype = Function.prototype, StringPrototype = String.prototype, StringPrototypeSymbolIterator = StringPrototype[SymbolIterator], StringIteratorPrototypeNext = StringPrototypeSymbolIterator.call(\"\").next, ObjectSetPrototypeOf = Object.setPrototypeOf, ObjectDefineProperty = Object.defineProperty, ObjectDefineProperties = Object.defineProperties, ObjectFreeze = Object.freeze;\nvar { create: ObjectCreate, keys: ObjectKeys } = Object;\nvar createSafeIterator = (factory, next) => {\n class SafeIterator {\n #iterator;\n constructor(iterable) {\n this.#iterator = factory.call(iterable);\n }\n next() {\n return next.call(this.#iterator);\n }\n [SymbolIterator]() {\n return this;\n }\n }\n return ObjectSetPrototypeOf(SafeIterator.prototype, null), ObjectFreeze(SafeIterator.prototype), ObjectFreeze(SafeIterator), SafeIterator;\n}, SafeStringIterator = createSafeIterator(StringPrototypeSymbolIterator, StringIteratorPrototypeNext), isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n}, isZeroWidthCodePoint = (code) => {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, getStringWidth = function getStringWidth2(str, removeControlChars = !0) {\n var width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize.call(str, \"NFC\");\n for (var char of new SafeStringIterator(str)) {\n var code = StringPrototypeCodePointAt.call(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n}, ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new RegExp(ansiPattern, \"g\"), kCustomPromisifiedSymbol = SymbolFor(\"nodejs.util.promisify.custom\"), kCustomPromisifyArgsSymbol = Symbol(\"customPromisifyArgs\");\npromisify.custom = kCustomPromisifiedSymbol;\nvar kUTF16SurrogateThreshold = 65536, kEscape = \"\\x1B\", kSubstringSearch = Symbol(\"kSubstringSearch\"), kIsNodeError = Symbol(\"kIsNodeError\"), errorBases = {}, VALID_NODE_ERROR_BASES = {\n TypeError,\n RangeError,\n Error\n}, NodeError = getNodeErrorByName(\"Error\"), NodeTypeError = getNodeErrorByName(\"TypeError\"), NodeRangeError = getNodeErrorByName(\"RangeError\");\n\nclass ERR_INVALID_ARG_TYPE extends NodeTypeError {\n constructor(name, type, value) {\n super(`The \"${name}\" argument must be of type ${type}. Received type ${typeof value}`, {\n code: \"ERR_INVALID_ARG_TYPE\"\n });\n }\n}\n\nclass ERR_INVALID_ARG_VALUE extends NodeTypeError {\n constructor(name, value, reason = \"not specified\") {\n super(`The value \"${String(value)}\" is invalid for argument '${name}'. Reason: ${reason}`, {\n code: \"ERR_INVALID_ARG_VALUE\"\n });\n }\n}\n\nclass ERR_INVALID_CURSOR_POS extends NodeTypeError {\n constructor() {\n super(\"Cannot set cursor row without setting its column\", {\n code: \"ERR_INVALID_CURSOR_POS\"\n });\n }\n}\n\nclass ERR_OUT_OF_RANGE extends NodeRangeError {\n constructor(name, range, received) {\n super(`The value of \"${name}\" is out of range. It must be ${range}. Received ${received}`, {\n code: \"ERR_OUT_OF_RANGE\"\n });\n }\n}\n\nclass ERR_USE_AFTER_CLOSE extends NodeError {\n constructor() {\n super(\"This socket has been ended by the other party\", {\n code: \"ERR_USE_AFTER_CLOSE\"\n });\n }\n}\n\nclass AbortError extends Error {\n code;\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\nvar kClearLine, kClearScreenDown, kClearToLineBeginning, kClearToLineEnd;\nCSI.kEscape = kEscape;\nCSI.kClearLine = kClearLine = CSI`2K`;\nCSI.kClearScreenDown = kClearScreenDown = CSI`0J`;\nCSI.kClearToLineBeginning = kClearToLineBeginning = CSI`1K`;\nCSI.kClearToLineEnd = kClearToLineEnd = CSI`0K`;\nvar KEYPRESS_DECODER = Symbol(\"keypress-decoder\"), ESCAPE_DECODER = Symbol(\"escape-decoder\"), ESCAPE_CODE_TIMEOUT = 500, kEmptyObject = ObjectFreeze(ObjectCreate(null)), kHistorySize = 30, kMaxUndoRedoStackSize = 2048, kMincrlfDelay = 100, lineEnding = /\\r\?\\n|\\r(\?!\\n)/g, kMaxLengthOfKillRing = 32, kLineObjectStream = Symbol(\"line object stream\"), kQuestionCancel = Symbol(\"kQuestionCancel\"), kQuestion = Symbol(\"kQuestion\"), kAddHistory = Symbol(\"_addHistory\"), kBeforeEdit = Symbol(\"_beforeEdit\"), kDecoder = Symbol(\"_decoder\"), kDeleteLeft = Symbol(\"_deleteLeft\"), kDeleteLineLeft = Symbol(\"_deleteLineLeft\"), kDeleteLineRight = Symbol(\"_deleteLineRight\"), kDeleteRight = Symbol(\"_deleteRight\"), kDeleteWordLeft = Symbol(\"_deleteWordLeft\"), kDeleteWordRight = Symbol(\"_deleteWordRight\"), kGetDisplayPos = Symbol(\"_getDisplayPos\"), kHistoryNext = Symbol(\"_historyNext\"), kHistoryPrev = Symbol(\"_historyPrev\"), kInsertString = Symbol(\"_insertString\"), kLine = Symbol(\"_line\"), kLine_buffer = Symbol(\"_line_buffer\"), kKillRing = Symbol(\"_killRing\"), kKillRingCursor = Symbol(\"_killRingCursor\"), kMoveCursor = Symbol(\"_moveCursor\"), kNormalWrite = Symbol(\"_normalWrite\"), kOldPrompt = Symbol(\"_oldPrompt\"), kOnLine = Symbol(\"_onLine\"), kPreviousKey = Symbol(\"_previousKey\"), kPrompt = Symbol(\"_prompt\"), kPushToKillRing = Symbol(\"_pushToKillRing\"), kPushToUndoStack = Symbol(\"_pushToUndoStack\"), kQuestionCallback = Symbol(\"_questionCallback\"), kRedo = Symbol(\"_redo\"), kRedoStack = Symbol(\"_redoStack\"), kRefreshLine = Symbol(\"_refreshLine\"), kSawKeyPress = Symbol(\"_sawKeyPress\"), kSawReturnAt = Symbol(\"_sawReturnAt\"), kSetRawMode = Symbol(\"_setRawMode\"), kTabComplete = Symbol(\"_tabComplete\"), kTabCompleter = Symbol(\"_tabCompleter\"), kTtyWrite = Symbol(\"_ttyWrite\"), kUndo = Symbol(\"_undo\"), kUndoStack = Symbol(\"_undoStack\"), kWordLeft = Symbol(\"_wordLeft\"), kWordRight = Symbol(\"_wordRight\"), kWriteToOutput = Symbol(\"_writeToOutput\"), kYank = Symbol(\"_yank\"), kYanking = Symbol(\"_yanking\"), kYankPop = Symbol(\"_yankPop\"), kFirstEventParam = Symbol(\"nodejs.kFirstEventParam\"), kOnSelfCloseWithTerminal = Symbol(\"_onSelfCloseWithTerminal\"), kOnSelfCloseWithoutTerminal = Symbol(\"_onSelfCloseWithoutTerminal\"), kOnKeyPress = Symbol(\"_onKeyPress\"), kOnError = Symbol(\"_onError\"), kOnData = Symbol(\"_onData\"), kOnEnd = Symbol(\"_onEnd\"), kOnTermEnd = Symbol(\"_onTermEnd\"), kOnResize = Symbol(\"_onResize\");\nInterfaceConstructor.prototype = {};\nObjectSetPrototypeOf(InterfaceConstructor.prototype, EventEmitter.prototype);\nvar _Interface = class Interface2 extends InterfaceConstructor {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n get columns() {\n var output = this.output;\n if (output && output.columns)\n return output.columns;\n return Infinity;\n }\n setPrompt(prompt) {\n this[kPrompt] = prompt;\n }\n getPrompt() {\n return this[kPrompt];\n }\n [kSetRawMode](flag) {\n const mode = flag + 0, wasInRawMode = this.input.isRaw;\n var setRawMode = this.input.setRawMode;\n if (typeof setRawMode === \"function\")\n setRawMode.call(this.input, mode);\n return wasInRawMode;\n }\n prompt(preserveCursor) {\n if (this.paused)\n this.resume();\n if (this.terminal) {\n if (!preserveCursor)\n this.cursor = 0;\n this[kRefreshLine]();\n } else\n this[kWriteToOutput](this[kPrompt]);\n }\n [kQuestion](query, cb) {\n if (this.closed)\n throw new ERR_USE_AFTER_CLOSE(\"readline\");\n if (this[kQuestionCallback])\n this.prompt();\n else\n this[kOldPrompt] = this[kPrompt], this.setPrompt(query), this[kQuestionCallback] = cb, this.prompt();\n }\n [kOnLine](line) {\n if (this[kQuestionCallback]) {\n var cb = this[kQuestionCallback];\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), cb(line);\n } else\n this.emit(\"line\", line);\n }\n [kBeforeEdit](oldText, oldCursor) {\n this[kPushToUndoStack](oldText, oldCursor);\n }\n [kQuestionCancel]() {\n if (this[kQuestionCallback])\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), this.clearLine();\n }\n [kWriteToOutput](stringToWrite) {\n if (validateString(stringToWrite, \"stringToWrite\"), this.output !== null && this.output !== void 0)\n this.output.write(stringToWrite);\n }\n [kAddHistory]() {\n if (this.line.length === 0)\n return \"\";\n if (this.historySize === 0)\n return this.line;\n if (StringPrototypeTrim.call(this.line).length === 0)\n return this.line;\n if (this.history.length === 0 || this.history[0] !== this.line) {\n if (this.removeHistoryDuplicates) {\n var dupIndex = ArrayPrototypeIndexOf.call(this.history, this.line);\n if (dupIndex !== -1)\n ArrayPrototypeSplice.call(this.history, dupIndex, 1);\n }\n if (ArrayPrototypeUnshift.call(this.history, this.line), this.history.length > this.historySize)\n ArrayPrototypePop.call(this.history);\n }\n this.historyIndex = -1;\n var line = this.history[0];\n return this.emit(\"history\", this.history), line;\n }\n [kRefreshLine]() {\n var line = this[kPrompt] + this.line, dispPos = this[kGetDisplayPos](line), lineCols = dispPos.cols, lineRows = dispPos.rows, cursorPos = this.getCursorPos(), prevRows = this.prevRows || 0;\n if (prevRows > 0)\n moveCursor(this.output, 0, -prevRows);\n if (cursorTo(this.output, 0), clearScreenDown(this.output), this[kWriteToOutput](line), lineCols === 0)\n this[kWriteToOutput](\" \");\n cursorTo(this.output, cursorPos.cols);\n var diff = lineRows - cursorPos.rows;\n if (diff > 0)\n moveCursor(this.output, 0, -diff);\n this.prevRows = cursorPos.rows;\n }\n close() {\n if (this.closed)\n return;\n if (this.pause(), this.terminal)\n this[kSetRawMode](!1);\n this.closed = !0, this.emit(\"close\");\n }\n pause() {\n if (this.paused)\n return;\n return this.input.pause(), this.paused = !0, this.emit(\"pause\"), this;\n }\n resume() {\n if (!this.paused)\n return;\n return this.input.resume(), this.paused = !1, this.emit(\"resume\"), this;\n }\n write(d, key) {\n if (this.paused)\n this.resume();\n if (this.terminal)\n this[kTtyWrite](d, key);\n else\n this[kNormalWrite](d);\n }\n [kNormalWrite](b) {\n if (b === void 0)\n return;\n var string = this[kDecoder].write(b);\n if (this[kSawReturnAt] && DateNow() - this[kSawReturnAt] <= this.crlfDelay) {\n if (StringPrototypeCodePointAt.call(string) === 10)\n string = StringPrototypeSlice.call(string, 1);\n this[kSawReturnAt] = 0;\n }\n var newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n if (newPartContainsEnding !== null) {\n if (this[kLine_buffer])\n string = this[kLine_buffer] + string, this[kLine_buffer] = null, newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n this[kSawReturnAt] = StringPrototypeEndsWith.call(string, \"\\r\") \? DateNow() : 0;\n var indexes = [0, newPartContainsEnding.index, lineEnding.lastIndex], nextMatch;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, string)) !== null)\n ArrayPrototypePush.call(indexes, nextMatch.index, lineEnding.lastIndex);\n var lastIndex = indexes.length - 1;\n this[kLine_buffer] = StringPrototypeSlice.call(string, indexes[lastIndex]);\n for (var i = 1;i < lastIndex; i += 2)\n this[kOnLine](StringPrototypeSlice.call(string, indexes[i - 1], indexes[i]));\n } else if (string)\n if (this[kLine_buffer])\n this[kLine_buffer] += string;\n else\n this[kLine_buffer] = string;\n }\n [kInsertString](c) {\n if (this[kBeforeEdit](this.line, this.cursor), this.cursor < this.line.length) {\n var beg = StringPrototypeSlice.call(this.line, 0, this.cursor), end = StringPrototypeSlice.call(this.line, this.cursor, this.line.length);\n this.line = beg + c + end, this.cursor += c.length, this[kRefreshLine]();\n } else {\n var oldPos = this.getCursorPos();\n this.line += c, this.cursor += c.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows < newPos.rows)\n this[kRefreshLine]();\n else\n this[kWriteToOutput](c);\n }\n }\n async[kTabComplete](lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor), value;\n try {\n value = await this.completer(string);\n } catch (err) {\n this[kWriteToOutput](`Tab completion error: ${inspect(err)}`);\n return;\n } finally {\n this.resume();\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n }\n [kTabCompleter](lastKeypressWasTab, { 0: completions, 1: completeOn }) {\n if (!completions || completions.length === 0)\n return;\n var prefix = commonPrefix(ArrayPrototypeFilter.call(completions, (e) => e !== \"\"));\n if (StringPrototypeStartsWith.call(prefix, completeOn) && prefix.length > completeOn.length) {\n this[kInsertString](StringPrototypeSlice.call(prefix, completeOn.length));\n return;\n } else if (!StringPrototypeStartsWith.call(completeOn, prefix)) {\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - completeOn.length) + prefix + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = this.cursor - completeOn.length + prefix.length, this._refreshLine();\n return;\n }\n if (!lastKeypressWasTab)\n return;\n this[kBeforeEdit](this.line, this.cursor);\n var completionsWidth = ArrayPrototypeMap.call(completions, (e) => getStringWidth(e)), width = MathMaxApply(completionsWidth) + 2, maxColumns = MathFloor(this.columns / width) || 1;\n if (maxColumns === Infinity)\n maxColumns = 1;\n var output = \"\\r\\n\", lineIndex = 0, whitespace = 0;\n for (var i = 0;i < completions.length; i++) {\n var completion = completions[i];\n if (completion === \"\" || lineIndex === maxColumns)\n output += \"\\r\\n\", lineIndex = 0, whitespace = 0;\n else\n output += StringPrototypeRepeat.call(\" \", whitespace);\n if (completion !== \"\")\n output += completion, whitespace = width - completionsWidth[i], lineIndex++;\n else\n output += \"\\r\\n\";\n }\n if (lineIndex !== 0)\n output += \"\\r\\n\\r\\n\";\n this[kWriteToOutput](output), this[kRefreshLine]();\n }\n [kWordLeft]() {\n if (this.cursor > 0) {\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n this[kMoveCursor](-match[0].length);\n }\n }\n [kWordRight]() {\n if (this.cursor < this.line.length) {\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|[^\\w\\s]+|\\w+)\\s*/, trailing);\n this[kMoveCursor](match[0].length);\n }\n }\n [kDeleteLeft]() {\n if (this.cursor > 0 && this.line.length > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthLeft(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - charSize) + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor -= charSize, this[kRefreshLine]();\n }\n }\n [kDeleteRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthAt(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(this.line, this.cursor + charSize, this.line.length), this[kRefreshLine]();\n }\n }\n [kDeleteWordLeft]() {\n if (this.cursor > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n leading = StringPrototypeSlice.call(leading, 0, leading.length - match[0].length), this.line = leading + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = leading.length, this[kRefreshLine]();\n }\n }\n [kDeleteWordRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|\\W+|\\w+)\\s*/, trailing);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(trailing, match[0].length), this[kRefreshLine]();\n }\n }\n [kDeleteLineLeft]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, this.cursor), this.cursor = 0, this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kDeleteLineRight]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor), this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kPushToKillRing](del) {\n if (!del || del === this[kKillRing][0])\n return;\n ArrayPrototypeUnshift.call(this[kKillRing], del), this[kKillRingCursor] = 0;\n while (this[kKillRing].length > kMaxLengthOfKillRing)\n ArrayPrototypePop.call(this[kKillRing]);\n }\n [kYank]() {\n if (this[kKillRing].length > 0)\n this[kYanking] = !0, this[kInsertString](this[kKillRing][this[kKillRingCursor]]);\n }\n [kYankPop]() {\n if (!this[kYanking])\n return;\n if (this[kKillRing].length > 1) {\n var lastYank = this[kKillRing][this[kKillRingCursor]];\n if (this[kKillRingCursor]++, this[kKillRingCursor] >= this[kKillRing].length)\n this[kKillRingCursor] = 0;\n var currentYank = this[kKillRing][this[kKillRingCursor]], head = StringPrototypeSlice.call(this.line, 0, this.cursor - lastYank.length), tail = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = head + currentYank + tail, this.cursor = head.length + currentYank.length, this[kRefreshLine]();\n }\n }\n clearLine() {\n this[kMoveCursor](Infinity), this[kWriteToOutput](\"\\r\\n\"), this.line = \"\", this.cursor = 0, this.prevRows = 0;\n }\n [kLine]() {\n var line = this[kAddHistory]();\n this[kUndoStack] = [], this[kRedoStack] = [], this.clearLine(), this[kOnLine](line);\n }\n [kPushToUndoStack](text, cursor) {\n if (ArrayPrototypePush.call(this[kUndoStack], { text, cursor }) > kMaxUndoRedoStackSize)\n ArrayPrototypeShift.call(this[kUndoStack]);\n }\n [kUndo]() {\n if (this[kUndoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kRedoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kUndoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kRedo]() {\n if (this[kRedoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kUndoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kRedoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kHistoryNext]() {\n if (this.historyIndex >= 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex - 1;\n while (index >= 0 && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index--;\n if (index === -1)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kHistoryPrev]() {\n if (this.historyIndex < this.history.length && this.history.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex + 1;\n while (index < this.history.length && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index++;\n if (index === this.history.length)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kGetDisplayPos](str) {\n var offset = 0, col = this.columns, rows = 0;\n str = stripVTControlCharacters(str);\n for (var char of new SafeStringIterator(str)) {\n if (char === \"\\n\") {\n rows += MathCeil(offset / col) || 1, offset = 0;\n continue;\n }\n if (char === \"\\t\") {\n offset += this.tabSize - offset % this.tabSize;\n continue;\n }\n var width = getStringWidth(char, !1);\n if (width === 0 || width === 1)\n offset += width;\n else {\n if ((offset + 1) % col === 0)\n offset++;\n offset += 2;\n }\n }\n var cols = offset % col;\n return rows += (offset - cols) / col, { cols, rows };\n }\n getCursorPos() {\n var strBeforeCursor = this[kPrompt] + StringPrototypeSlice.call(this.line, 0, this.cursor);\n return this[kGetDisplayPos](strBeforeCursor);\n }\n [kMoveCursor](dx) {\n if (dx === 0)\n return;\n var oldPos = this.getCursorPos();\n if (this.cursor += dx, this.cursor < 0)\n this.cursor = 0;\n else if (this.cursor > this.line.length)\n this.cursor = this.line.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows === newPos.rows) {\n var diffWidth = newPos.cols - oldPos.cols;\n moveCursor(this.output, diffWidth, 0);\n } else\n this[kRefreshLine]();\n }\n [kTtyWrite](s, key) {\n var previousKey = this[kPreviousKey];\n key = key || kEmptyObject, this[kPreviousKey] = key;\n var { name: keyName, meta: keyMeta, ctrl: keyCtrl2, shift: keyShift, sequence: keySeq } = key;\n if (!keyMeta || keyName !== \"y\")\n this[kYanking] = !1;\n if ((keyName === \"up\" || keyName === \"down\") && !keyCtrl2 && !keyMeta && !keyShift) {\n if (this[kSubstringSearch] === null)\n this[kSubstringSearch] = StringPrototypeSlice.call(this.line, 0, this.cursor);\n } else if (this[kSubstringSearch] !== null) {\n if (this[kSubstringSearch] = null, this.history.length === this.historyIndex)\n this.historyIndex = -1;\n }\n if (typeof keySeq === \"string\")\n switch (StringPrototypeCodePointAt.call(keySeq, 0)) {\n case 31:\n this[kUndo]();\n return;\n case 30:\n this[kRedo]();\n return;\n default:\n break;\n }\n if (keyName === \"escape\")\n return;\n if (keyCtrl2 && keyShift)\n switch (keyName) {\n case \"backspace\":\n this[kDeleteLineLeft]();\n break;\n case \"delete\":\n this[kDeleteLineRight]();\n break;\n }\n else if (keyCtrl2)\n switch (keyName) {\n case \"c\":\n if (this.listenerCount(\"SIGINT\") > 0)\n this.emit(\"SIGINT\");\n else\n this.close();\n break;\n case \"h\":\n this[kDeleteLeft]();\n break;\n case \"d\":\n if (this.cursor === 0 && this.line.length === 0)\n this.close();\n else if (this.cursor < this.line.length)\n this[kDeleteRight]();\n break;\n case \"u\":\n this[kDeleteLineLeft]();\n break;\n case \"k\":\n this[kDeleteLineRight]();\n break;\n case \"a\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"e\":\n this[kMoveCursor](Infinity);\n break;\n case \"b\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"f\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"l\":\n cursorTo(this.output, 0, 0), clearScreenDown(this.output), this[kRefreshLine]();\n break;\n case \"n\":\n this[kHistoryNext]();\n break;\n case \"p\":\n this[kHistoryPrev]();\n break;\n case \"y\":\n this[kYank]();\n break;\n case \"z\":\n break;\n case \"w\":\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"left\":\n this[kWordLeft]();\n break;\n case \"right\":\n this[kWordRight]();\n break;\n }\n else if (keyMeta)\n switch (keyName) {\n case \"b\":\n this[kWordLeft]();\n break;\n case \"f\":\n this[kWordRight]();\n break;\n case \"d\":\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"y\":\n this[kYankPop]();\n break;\n }\n else {\n if (this[kSawReturnAt] && keyName !== \"enter\")\n this[kSawReturnAt] = 0;\n switch (keyName) {\n case \"return\":\n this[kSawReturnAt] = DateNow(), this[kLine]();\n break;\n case \"enter\":\n if (this[kSawReturnAt] === 0 || DateNow() - this[kSawReturnAt] > this.crlfDelay)\n this[kLine]();\n this[kSawReturnAt] = 0;\n break;\n case \"backspace\":\n this[kDeleteLeft]();\n break;\n case \"delete\":\n this[kDeleteRight]();\n break;\n case \"left\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"right\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"home\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"end\":\n this[kMoveCursor](Infinity);\n break;\n case \"up\":\n this[kHistoryPrev]();\n break;\n case \"down\":\n this[kHistoryNext]();\n break;\n case \"tab\":\n if (typeof this.completer === \"function\" && this.isCompletionEnabled) {\n var lastKeypressWasTab = previousKey && previousKey.name === \"tab\";\n this[kTabComplete](lastKeypressWasTab);\n break;\n }\n default:\n if (typeof s === \"string\" && s) {\n var nextMatch = RegExpPrototypeExec.call(lineEnding, s);\n if (nextMatch !== null) {\n this[kInsertString](StringPrototypeSlice.call(s, 0, nextMatch.index));\n var { lastIndex } = lineEnding;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, s)) !== null)\n this[kLine](), this[kInsertString](StringPrototypeSlice.call(s, lastIndex, nextMatch.index)), { lastIndex } = lineEnding;\n if (lastIndex === s.length)\n this[kLine]();\n } else\n this[kInsertString](s);\n }\n }\n }\n }\n [SymbolAsyncIterator]() {\n if (this[kLineObjectStream] === void 0)\n this[kLineObjectStream] = EventEmitter.on(this, \"line\", {\n close: [\"close\"],\n highWatermark: 1024,\n [kFirstEventParam]: !0\n });\n return this[kLineObjectStream];\n }\n};\nInterface.prototype = {};\nObjectSetPrototypeOf(Interface.prototype, _Interface.prototype);\nObjectSetPrototypeOf(Interface, _Interface);\nInterface.prototype.question = function question(query, options, cb) {\n if (cb = typeof options === \"function\" \? options : cb, options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return;\n var onAbort = () => {\n this[kQuestionCancel]();\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 });\n var cleanup = () => {\n signal.removeEventListener(\"abort\", onAbort);\n }, originalCb = cb;\n cb = typeof cb === \"function\" \? (answer) => {\n return cleanup(), originalCb(answer);\n } : cleanup;\n }\n if (typeof cb === \"function\")\n this[kQuestion](query, cb);\n};\nInterface.prototype.question[promisify.custom] = function question2(query, options) {\n if (options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal && signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (signal) {\n var onAbort = () => {\n reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this.question(query, options, cb);\n });\n};\nObjectDefineProperties(Interface.prototype, {\n [kSetRawMode]: {\n __proto__: null,\n get() {\n return this._setRawMode;\n }\n },\n [kOnLine]: {\n __proto__: null,\n get() {\n return this._onLine;\n }\n },\n [kWriteToOutput]: {\n __proto__: null,\n get() {\n return this._writeToOutput;\n }\n },\n [kAddHistory]: {\n __proto__: null,\n get() {\n return this._addHistory;\n }\n },\n [kRefreshLine]: {\n __proto__: null,\n get() {\n return this._refreshLine;\n }\n },\n [kNormalWrite]: {\n __proto__: null,\n get() {\n return this._normalWrite;\n }\n },\n [kInsertString]: {\n __proto__: null,\n get() {\n return this._insertString;\n }\n },\n [kTabComplete]: {\n __proto__: null,\n get() {\n return this._tabComplete;\n }\n },\n [kWordLeft]: {\n __proto__: null,\n get() {\n return this._wordLeft;\n }\n },\n [kWordRight]: {\n __proto__: null,\n get() {\n return this._wordRight;\n }\n },\n [kDeleteLeft]: {\n __proto__: null,\n get() {\n return this._deleteLeft;\n }\n },\n [kDeleteRight]: {\n __proto__: null,\n get() {\n return this._deleteRight;\n }\n },\n [kDeleteWordLeft]: {\n __proto__: null,\n get() {\n return this._deleteWordLeft;\n }\n },\n [kDeleteWordRight]: {\n __proto__: null,\n get() {\n return this._deleteWordRight;\n }\n },\n [kDeleteLineLeft]: {\n __proto__: null,\n get() {\n return this._deleteLineLeft;\n }\n },\n [kDeleteLineRight]: {\n __proto__: null,\n get() {\n return this._deleteLineRight;\n }\n },\n [kLine]: {\n __proto__: null,\n get() {\n return this._line;\n }\n },\n [kHistoryNext]: {\n __proto__: null,\n get() {\n return this._historyNext;\n }\n },\n [kHistoryPrev]: {\n __proto__: null,\n get() {\n return this._historyPrev;\n }\n },\n [kGetDisplayPos]: {\n __proto__: null,\n get() {\n return this._getDisplayPos;\n }\n },\n [kMoveCursor]: {\n __proto__: null,\n get() {\n return this._moveCursor;\n }\n },\n [kTtyWrite]: {\n __proto__: null,\n get() {\n return this._ttyWrite;\n }\n },\n _decoder: {\n __proto__: null,\n get() {\n return this[kDecoder];\n },\n set(value) {\n this[kDecoder] = value;\n }\n },\n _line_buffer: {\n __proto__: null,\n get() {\n return this[kLine_buffer];\n },\n set(value) {\n this[kLine_buffer] = value;\n }\n },\n _oldPrompt: {\n __proto__: null,\n get() {\n return this[kOldPrompt];\n },\n set(value) {\n this[kOldPrompt] = value;\n }\n },\n _previousKey: {\n __proto__: null,\n get() {\n return this[kPreviousKey];\n },\n set(value) {\n this[kPreviousKey] = value;\n }\n },\n _prompt: {\n __proto__: null,\n get() {\n return this[kPrompt];\n },\n set(value) {\n this[kPrompt] = value;\n }\n },\n _questionCallback: {\n __proto__: null,\n get() {\n return this[kQuestionCallback];\n },\n set(value) {\n this[kQuestionCallback] = value;\n }\n },\n _sawKeyPress: {\n __proto__: null,\n get() {\n return this[kSawKeyPress];\n },\n set(value) {\n this[kSawKeyPress] = value;\n }\n },\n _sawReturnAt: {\n __proto__: null,\n get() {\n return this[kSawReturnAt];\n },\n set(value) {\n this[kSawReturnAt] = value;\n }\n }\n});\nInterface.prototype._setRawMode = _Interface.prototype[kSetRawMode];\nInterface.prototype._onLine = _Interface.prototype[kOnLine];\nInterface.prototype._writeToOutput = _Interface.prototype[kWriteToOutput];\nInterface.prototype._addHistory = _Interface.prototype[kAddHistory];\nInterface.prototype._refreshLine = _Interface.prototype[kRefreshLine];\nInterface.prototype._normalWrite = _Interface.prototype[kNormalWrite];\nInterface.prototype._insertString = _Interface.prototype[kInsertString];\nInterface.prototype._tabComplete = function(lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.completer(string, (err, value) => {\n if (this.resume(), err) {\n this._writeToOutput(`Tab completion error: ${inspect(err)}`);\n return;\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n });\n};\nInterface.prototype._wordLeft = _Interface.prototype[kWordLeft];\nInterface.prototype._wordRight = _Interface.prototype[kWordRight];\nInterface.prototype._deleteLeft = _Interface.prototype[kDeleteLeft];\nInterface.prototype._deleteRight = _Interface.prototype[kDeleteRight];\nInterface.prototype._deleteWordLeft = _Interface.prototype[kDeleteWordLeft];\nInterface.prototype._deleteWordRight = _Interface.prototype[kDeleteWordRight];\nInterface.prototype._deleteLineLeft = _Interface.prototype[kDeleteLineLeft];\nInterface.prototype._deleteLineRight = _Interface.prototype[kDeleteLineRight];\nInterface.prototype._line = _Interface.prototype[kLine];\nInterface.prototype._historyNext = _Interface.prototype[kHistoryNext];\nInterface.prototype._historyPrev = _Interface.prototype[kHistoryPrev];\nInterface.prototype._getDisplayPos = _Interface.prototype[kGetDisplayPos];\nInterface.prototype._getCursorPos = _Interface.prototype.getCursorPos;\nInterface.prototype._moveCursor = _Interface.prototype[kMoveCursor];\nInterface.prototype._ttyWrite = _Interface.prototype[kTtyWrite];\n\nclass Readline {\n #autoCommit = !1;\n #stream;\n #todo = [];\n constructor(stream, options = void 0) {\n if (isWritable \?\?= (@getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37)).isWritable, !isWritable(stream))\n throw new ERR_INVALID_ARG_TYPE(\"stream\", \"Writable\", stream);\n if (this.#stream = stream, options\?.autoCommit != null)\n validateBoolean(options.autoCommit, \"options.autoCommit\"), this.#autoCommit = options.autoCommit;\n }\n cursorTo(x, y = void 0) {\n if (validateInteger(x, \"x\"), y != null)\n validateInteger(y, \"y\");\n var data = y == null \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n moveCursor(dx, dy) {\n if (dx || dy) {\n validateInteger(dx, \"dx\"), validateInteger(dy, \"dy\");\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n }\n return this;\n }\n clearLine(dir) {\n validateInteger(dir, \"dir\", -1, 1);\n var data = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n clearScreenDown() {\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(kClearScreenDown));\n else\n ArrayPrototypePush.call(this.#todo, kClearScreenDown);\n return this;\n }\n commit() {\n return new Promise((resolve) => {\n this.#stream.write(ArrayPrototypeJoin.call(this.#todo, \"\"), resolve), this.#todo = [];\n });\n }\n rollback() {\n return this.#todo = [], this;\n }\n}\nvar PromisesInterface = class Interface3 extends _Interface {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n question(query, options = kEmptyObject) {\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n }\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (options\?.signal) {\n var onAbort = () => {\n this[kQuestionCancel](), reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this[kQuestion](query, cb);\n });\n }\n};\n$ = {\n Interface,\n clearLine,\n clearScreenDown,\n createInterface,\n cursorTo,\n emitKeypressEvents,\n moveCursor,\n promises: {\n Readline,\n Interface: PromisesInterface,\n createInterface(input, output, completer, terminal) {\n return new PromisesInterface(input, output, completer, terminal);\n }\n },\n [SymbolFor(\"__BUN_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__\")]: {\n CSI,\n utils: {\n getStringWidth,\n stripVTControlCharacters\n }\n }\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeQuerystringCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/querystring.ts\nvar __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports), Buffer = @requireNativeModule(\"buffer\").Buffer, require_object_keys = __commonJS((exports, module) => {\n var objectKeys = Object.keys || function() {\n var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !{ toString: null }.propertyIsEnumerable(\"toString\"), dontEnums = [\n \"toString\",\n \"toLocaleString\",\n \"valueOf\",\n \"hasOwnProperty\",\n \"isPrototypeOf\",\n \"propertyIsEnumerable\",\n \"constructor\"\n ], dontEnumsLength = dontEnums.length;\n return function(obj) {\n if (typeof obj !== \"function\" && (typeof obj !== \"object\" || obj === null))\n @throwTypeError(\"Object.keys called on non-object\");\n var result = [], prop, i;\n for (prop in obj)\n if (hasOwnProperty.@call(obj, prop))\n result.push(prop);\n if (hasDontEnumBug) {\n for (i = 0;i < dontEnumsLength; i++)\n if (hasOwnProperty.@call(obj, dontEnums[i]))\n result.push(dontEnums[i]);\n }\n return result;\n };\n }();\n module.exports = objectKeys;\n}), require_src = __commonJS((exports, module) => {\n var ParsedQueryString = function() {\n }, unescapeBuffer = function(s, decodeSpaces) {\n var out = Buffer.allocUnsafe(s.length), state = 0, n, m, hexchar, c;\n for (var inIndex = 0, outIndex = 0;; inIndex++) {\n if (inIndex < s.length)\n c = s.charCodeAt(inIndex);\n else {\n if (state > 0) {\n if (out[outIndex++] = 37, state === 2)\n out[outIndex++] = hexchar;\n }\n break;\n }\n switch (state) {\n case 0:\n switch (c) {\n case 37:\n n = 0, m = 0, state = 1;\n break;\n case 43:\n if (decodeSpaces)\n c = 32;\n default:\n out[outIndex++] = c;\n break;\n }\n break;\n case 1:\n if (hexchar = c, n = unhexTable[c], !(n >= 0)) {\n out[outIndex++] = 37, out[outIndex++] = c, state = 0;\n break;\n }\n state = 2;\n break;\n case 2:\n if (state = 0, m = unhexTable[c], !(m >= 0)) {\n out[outIndex++] = 37, out[outIndex++] = hexchar, out[outIndex++] = c;\n break;\n }\n out[outIndex++] = 16 * n + m;\n break;\n }\n }\n return out.slice(0, outIndex);\n }, qsUnescape = function(s, decodeSpaces) {\n try {\n return decodeURIComponent(s);\n } catch (e) {\n return QueryString.unescapeBuffer(s, decodeSpaces).toString();\n }\n }, qsEscape = function(str) {\n if (typeof str !== \"string\")\n if (typeof str === \"object\")\n str = @String(str);\n else\n str += \"\";\n var out = \"\", lastPos = 0;\n for (var i2 = 0;i2 < str.length; ++i2) {\n var c = str.charCodeAt(i2);\n if (c < 128) {\n if (noEscape[c] === 1)\n continue;\n if (lastPos < i2)\n out += str.slice(lastPos, i2);\n lastPos = i2 + 1, out += hexTable[c];\n continue;\n }\n if (lastPos < i2)\n out += str.slice(lastPos, i2);\n if (c < 2048) {\n lastPos = i2 + 1, out += hexTable[192 | c >> 6] + hexTable[128 | c & 63];\n continue;\n }\n if (c < 55296 || c >= 57344) {\n lastPos = i2 + 1, out += hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];\n continue;\n }\n ++i2;\n var c2;\n if (i2 < str.length)\n c2 = str.charCodeAt(i2) & 1023;\n else\n throw new URIError(\"URI malformed\");\n lastPos = i2 + 1, c = 65536 + ((c & 1023) << 10 | c2), out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];\n }\n if (lastPos === 0)\n return str;\n if (lastPos < str.length)\n return out + str.slice(lastPos);\n return out;\n }, stringifyPrimitive = function(v) {\n if (typeof v === \"string\")\n return v;\n if (typeof v === \"number\" && @isFinite(v))\n return \"\" + v;\n if (typeof v === \"boolean\")\n return v \? \"true\" : \"false\";\n return \"\";\n }, stringify = function(obj, sep, eq, options) {\n sep = sep || \"&\", eq = eq || \"=\";\n var encode = QueryString.escape;\n if (options && typeof options.encodeURIComponent === \"function\")\n encode = options.encodeURIComponent;\n if (obj !== null && typeof obj === \"object\") {\n var keys = objectKeys(obj), len = keys.length, flast = len - 1, fields = \"\";\n for (var i2 = 0;i2 < len; ++i2) {\n var k = keys[i2], v = obj[k], ks = encode(stringifyPrimitive(k)) + eq;\n if (isArray(v)) {\n var vlen = v.length, vlast = vlen - 1;\n for (var j = 0;j < vlen; ++j)\n if (fields += ks + encode(stringifyPrimitive(v[j])), j < vlast)\n fields += sep;\n if (vlen && i2 < flast)\n fields += sep;\n } else if (fields += ks + encode(stringifyPrimitive(v)), i2 < flast)\n fields += sep;\n }\n return fields;\n }\n return \"\";\n }, charCodes = function(str) {\n if (str.length === 0)\n return [];\n if (str.length === 1)\n return [str.charCodeAt(0)];\n const ret = [];\n for (var i2 = 0;i2 < str.length; ++i2)\n ret[ret.length] = str.charCodeAt(i2);\n return ret;\n }, parse = function(qs, sep, eq, options) {\n const obj = new ParsedQueryString;\n if (typeof qs !== \"string\" || qs.length === 0)\n return obj;\n var sepCodes = !sep \? defSepCodes : charCodes(sep + \"\"), eqCodes = !eq \? defEqCodes : charCodes(eq + \"\");\n const sepLen = sepCodes.length, eqLen = eqCodes.length;\n var pairs = 1000;\n if (options && typeof options.maxKeys === \"number\")\n pairs = options.maxKeys > 0 \? options.maxKeys : -1;\n var decode = QueryString.unescape;\n if (options && typeof options.decodeURIComponent === \"function\")\n decode = options.decodeURIComponent;\n const customDecode = decode !== qsUnescape, keys = [];\n var posIdx = 0, lastPos = 0, sepIdx = 0, eqIdx = 0, key = \"\", value = \"\", keyEncoded = customDecode, valEncoded = customDecode, encodeCheck = 0;\n for (var i2 = 0;i2 < qs.length; ++i2) {\n const code = qs.charCodeAt(i2);\n if (code === sepCodes[sepIdx]) {\n if (++sepIdx === sepLen) {\n const end = i2 - sepIdx + 1;\n if (eqIdx < eqLen) {\n if (lastPos < end)\n key += qs.slice(lastPos, end);\n } else if (lastPos < end)\n value += qs.slice(lastPos, end);\n if (keyEncoded)\n key = decodeStr(key, decode);\n if (valEncoded)\n value = decodeStr(value, decode);\n if (key || value || lastPos - posIdx > sepLen || i2 === 0)\n if (indexOf(keys, key) === -1)\n obj[key] = value, keys[keys.length] = key;\n else {\n const curValue = obj[key] || \"\";\n if (curValue.pop)\n curValue[curValue.length] = value;\n else if (curValue)\n obj[key] = [curValue, value];\n }\n else if (i2 === 1)\n delete obj[key];\n if (--pairs === 0)\n break;\n keyEncoded = valEncoded = customDecode, encodeCheck = 0, key = value = \"\", posIdx = lastPos, lastPos = i2 + 1, sepIdx = eqIdx = 0;\n }\n continue;\n } else if (sepIdx = 0, !valEncoded)\n if (code === 37)\n encodeCheck = 1;\n else if (encodeCheck > 0 && (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {\n if (++encodeCheck === 3)\n valEncoded = !0;\n } else\n encodeCheck = 0;\n if (eqIdx < eqLen) {\n if (code === eqCodes[eqIdx]) {\n if (++eqIdx === eqLen) {\n const end = i2 - eqIdx + 1;\n if (lastPos < end)\n key += qs.slice(lastPos, end);\n encodeCheck = 0, lastPos = i2 + 1;\n }\n continue;\n } else if (eqIdx = 0, !keyEncoded)\n if (code === 37)\n encodeCheck = 1;\n else if (encodeCheck > 0 && (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {\n if (++encodeCheck === 3)\n keyEncoded = !0;\n } else\n encodeCheck = 0;\n }\n if (code === 43) {\n if (eqIdx < eqLen) {\n if (lastPos < i2)\n key += qs.slice(lastPos, i2);\n key += \"%20\", keyEncoded = !0;\n } else {\n if (lastPos < i2)\n value += qs.slice(lastPos, i2);\n value += \"%20\", valEncoded = !0;\n }\n lastPos = i2 + 1;\n }\n }\n if (pairs !== 0 && (lastPos < qs.length || eqIdx > 0)) {\n if (lastPos < qs.length) {\n if (eqIdx < eqLen)\n key += qs.slice(lastPos);\n else if (sepIdx < sepLen)\n value += qs.slice(lastPos);\n }\n if (keyEncoded)\n key = decodeStr(key, decode);\n if (valEncoded)\n value = decodeStr(value, decode);\n if (indexOf(keys, key) === -1)\n obj[key] = value, keys[keys.length] = key;\n else {\n const curValue = obj[key];\n if (curValue.pop)\n curValue[curValue.length] = value;\n else\n obj[key] = [curValue, value];\n }\n }\n return obj;\n }, decodeStr = function(s, decoder) {\n try {\n return decoder(s);\n } catch (e) {\n return QueryString.unescape(s, !0);\n }\n }, QueryString = module.exports = {\n unescapeBuffer,\n unescape: qsUnescape,\n escape: qsEscape,\n stringify,\n encode: stringify,\n parse,\n decode: parse\n }, objectKeys = require_object_keys(), isArray = (arg) => Object.prototype.toString.@call(arg) === \"[object Array]\", indexOf = (arr, searchElement, fromIndex) => {\n var k;\n if (arr == null)\n @throwTypeError('\"arr\" is null or not defined');\n var o = Object(arr), len = o.length >>> 0;\n if (len === 0)\n return -1;\n var n = fromIndex | 0;\n if (n >= len)\n return -1;\n k = Math.max(n >= 0 \? n : len - Math.abs(n), 0);\n while (k < len) {\n if ((k in o) && o[k] === searchElement)\n return k;\n k++;\n }\n return -1;\n };\n ParsedQueryString.prototype = Object.create \? Object.create(null) : {};\n var unhexTable = [\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1\n ], hexTable = [];\n for (i = 0;i < 256; ++i)\n hexTable[i] = \"%\" + ((i < 16 \? \"0\" : \"\") + i.toString(16)).toUpperCase();\n var i, noEscape = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 1,\n 0\n ], defSepCodes = [38], defEqCodes = [61];\n});\nreturn require_src()})\n");
//
//
-static constexpr ASCIILiteral NodeReadlinePromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/readline.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).promises})\n"_s;
+static constexpr ASCIILiteral NodeReadlineCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/readline.ts\nvar stripVTControlCharacters = function(str) {\n return validateString(str, \"str\"), RegExpPrototypeSymbolReplace.@call(ansi, str, \"\");\n}, promisify = function(original) {\n if (validateFunction(original, \"original\"), original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n return validateFunction(fn, \"util.promisify.custom\"), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n }\n var argumentNames = original[kCustomPromisifyArgsSymbol];\n function fn(...args) {\n return new @Promise((resolve, reject) => {\n ArrayPrototypePush.@call(args, (err, ...values) => {\n if (err)\n return reject(err);\n if (argumentNames !== @undefined && values.length > 1) {\n var obj = {};\n for (var i2 = 0;i2 < argumentNames.length; i2++)\n obj[argumentNames[i2]] = values[i2];\n resolve(obj);\n } else\n resolve(values[0]);\n }), ReflectApply(original, this, args);\n });\n }\n ObjectSetPrototypeOf(fn, ObjectGetPrototypeOf(original)), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n var descriptors = ObjectGetOwnPropertyDescriptors(original), propertiesValues = ObjectValues(descriptors);\n for (var i = 0;i < propertiesValues.length; i++)\n ObjectSetPrototypeOf(propertiesValues[i], null);\n return ObjectDefineProperties(fn, descriptors);\n}, getNodeErrorByName = function(typeName) {\n var base = errorBases[typeName];\n if (base)\n return base;\n if (!ObjectKeys(VALID_NODE_ERROR_BASES).includes(typeName))\n throw new Error(\"Invalid NodeError type\");\n var Base = VALID_NODE_ERROR_BASES[typeName];\n\n class NodeError extends Base {\n [kIsNodeError] = !0;\n code;\n constructor(msg, opts) {\n super(msg, opts);\n this.code = opts\?.code || \"ERR_GENERIC\";\n }\n toString() {\n return `${this.name} [${this.code}]: ${this.message}`;\n }\n }\n return errorBases[typeName] = NodeError, NodeError;\n}, validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateAbortSignal = function(signal, name) {\n if (signal !== @undefined && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateArray = function(value, name, minLength = 0) {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n var reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar validateInteger = function(value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, validateUint32 = function(value, name, positive = !1) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n var min = positive \? 1 : 0, max = 4294967295;\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, CSI = function(strings, ...args) {\n var ret = `${kEscape}[`;\n for (var n = 0;n < strings.length; n++)\n if (ret += strings[n], n < args.length)\n ret += args[n];\n return ret;\n}, charLengthLeft = function(str, i) {\n if (i <= 0)\n return 0;\n if (i > 1 && StringPrototypeCodePointAt.@call(str, i - 2) >= kUTF16SurrogateThreshold || StringPrototypeCodePointAt.@call(str, i - 1) >= kUTF16SurrogateThreshold)\n return 2;\n return 1;\n}, charLengthAt = function(str, i) {\n if (str.length <= i)\n return 1;\n return StringPrototypeCodePointAt.@call(str, i) >= kUTF16SurrogateThreshold \? 2 : 1;\n};\nfunction* emitKeys(stream) {\n while (!0) {\n var ch = yield, s = ch, escaped = !1, keySeq = null, keyName, keyCtrl2 = !1, keyMeta = !1, keyShift = !1;\n if (ch === kEscape) {\n if (escaped = !0, s += ch = yield, ch === kEscape)\n s += ch = yield;\n }\n if (escaped && (ch === \"O\" || ch === \"[\")) {\n var code = ch, modifier = 0;\n if (ch === \"O\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n modifier = (ch >> 0) - 1, s += ch = yield;\n code += ch;\n } else if (ch === \"[\") {\n if (s += ch = yield, ch === \"[\")\n code += ch, s += ch = yield;\n var cmdStart = s.length - 1;\n if (ch >= \"0\" && ch <= \"9\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += ch = yield;\n }\n if (ch === \";\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += yield;\n }\n var cmd = StringPrototypeSlice.@call(s, cmdStart), match;\n if (match = RegExpPrototypeExec.@call(/^(\\d\\d\?)(;(\\d))\?([~^$])$/, cmd))\n code += match[1] + match[4], modifier = (match[3] || 1) - 1;\n else if (match = RegExpPrototypeExec.@call(/^((\\d;)\?(\\d))\?([A-Za-z])$/, cmd))\n code += match[4], modifier = (match[3] || 1) - 1;\n else\n code += cmd;\n }\n switch (keyCtrl2 = !!(modifier & 4), keyMeta = !!(modifier & 10), keyShift = !!(modifier & 1), code) {\n case \"[P\":\n keyName = \"f1\";\n break;\n case \"[Q\":\n keyName = \"f2\";\n break;\n case \"[R\":\n keyName = \"f3\";\n break;\n case \"[S\":\n keyName = \"f4\";\n break;\n case \"OP\":\n keyName = \"f1\";\n break;\n case \"OQ\":\n keyName = \"f2\";\n break;\n case \"OR\":\n keyName = \"f3\";\n break;\n case \"OS\":\n keyName = \"f4\";\n break;\n case \"[11~\":\n keyName = \"f1\";\n break;\n case \"[12~\":\n keyName = \"f2\";\n break;\n case \"[13~\":\n keyName = \"f3\";\n break;\n case \"[14~\":\n keyName = \"f4\";\n break;\n case \"[[A\":\n keyName = \"f1\";\n break;\n case \"[[B\":\n keyName = \"f2\";\n break;\n case \"[[C\":\n keyName = \"f3\";\n break;\n case \"[[D\":\n keyName = \"f4\";\n break;\n case \"[[E\":\n keyName = \"f5\";\n break;\n case \"[15~\":\n keyName = \"f5\";\n break;\n case \"[17~\":\n keyName = \"f6\";\n break;\n case \"[18~\":\n keyName = \"f7\";\n break;\n case \"[19~\":\n keyName = \"f8\";\n break;\n case \"[20~\":\n keyName = \"f9\";\n break;\n case \"[21~\":\n keyName = \"f10\";\n break;\n case \"[23~\":\n keyName = \"f11\";\n break;\n case \"[24~\":\n keyName = \"f12\";\n break;\n case \"[A\":\n keyName = \"up\";\n break;\n case \"[B\":\n keyName = \"down\";\n break;\n case \"[C\":\n keyName = \"right\";\n break;\n case \"[D\":\n keyName = \"left\";\n break;\n case \"[E\":\n keyName = \"clear\";\n break;\n case \"[F\":\n keyName = \"end\";\n break;\n case \"[H\":\n keyName = \"home\";\n break;\n case \"OA\":\n keyName = \"up\";\n break;\n case \"OB\":\n keyName = \"down\";\n break;\n case \"OC\":\n keyName = \"right\";\n break;\n case \"OD\":\n keyName = \"left\";\n break;\n case \"OE\":\n keyName = \"clear\";\n break;\n case \"OF\":\n keyName = \"end\";\n break;\n case \"OH\":\n keyName = \"home\";\n break;\n case \"[1~\":\n keyName = \"home\";\n break;\n case \"[2~\":\n keyName = \"insert\";\n break;\n case \"[3~\":\n keyName = \"delete\";\n break;\n case \"[4~\":\n keyName = \"end\";\n break;\n case \"[5~\":\n keyName = \"pageup\";\n break;\n case \"[6~\":\n keyName = \"pagedown\";\n break;\n case \"[[5~\":\n keyName = \"pageup\";\n break;\n case \"[[6~\":\n keyName = \"pagedown\";\n break;\n case \"[7~\":\n keyName = \"home\";\n break;\n case \"[8~\":\n keyName = \"end\";\n break;\n case \"[a\":\n keyName = \"up\", keyShift = !0;\n break;\n case \"[b\":\n keyName = \"down\", keyShift = !0;\n break;\n case \"[c\":\n keyName = \"right\", keyShift = !0;\n break;\n case \"[d\":\n keyName = \"left\", keyShift = !0;\n break;\n case \"[e\":\n keyName = \"clear\", keyShift = !0;\n break;\n case \"[2$\":\n keyName = \"insert\", keyShift = !0;\n break;\n case \"[3$\":\n keyName = \"delete\", keyShift = !0;\n break;\n case \"[5$\":\n keyName = \"pageup\", keyShift = !0;\n break;\n case \"[6$\":\n keyName = \"pagedown\", keyShift = !0;\n break;\n case \"[7$\":\n keyName = \"home\", keyShift = !0;\n break;\n case \"[8$\":\n keyName = \"end\", keyShift = !0;\n break;\n case \"Oa\":\n keyName = \"up\", keyCtrl2 = !0;\n break;\n case \"Ob\":\n keyName = \"down\", keyCtrl2 = !0;\n break;\n case \"Oc\":\n keyName = \"right\", keyCtrl2 = !0;\n break;\n case \"Od\":\n keyName = \"left\", keyCtrl2 = !0;\n break;\n case \"Oe\":\n keyName = \"clear\", keyCtrl2 = !0;\n break;\n case \"[2^\":\n keyName = \"insert\", keyCtrl2 = !0;\n break;\n case \"[3^\":\n keyName = \"delete\", keyCtrl2 = !0;\n break;\n case \"[5^\":\n keyName = \"pageup\", keyCtrl2 = !0;\n break;\n case \"[6^\":\n keyName = \"pagedown\", keyCtrl2 = !0;\n break;\n case \"[7^\":\n keyName = \"home\", keyCtrl2 = !0;\n break;\n case \"[8^\":\n keyName = \"end\", keyCtrl2 = !0;\n break;\n case \"[Z\":\n keyName = \"tab\", keyShift = !0;\n break;\n default:\n keyName = \"undefined\";\n break;\n }\n } else if (ch === \"\\r\")\n keyName = \"return\", keyMeta = escaped;\n else if (ch === \"\\n\")\n keyName = \"enter\", keyMeta = escaped;\n else if (ch === \"\\t\")\n keyName = \"tab\", keyMeta = escaped;\n else if (ch === \"\\b\" || ch === \"\\x7F\")\n keyName = \"backspace\", keyMeta = escaped;\n else if (ch === kEscape)\n keyName = \"escape\", keyMeta = escaped;\n else if (ch === \" \")\n keyName = \"space\", keyMeta = escaped;\n else if (!escaped && ch <= \"\\x1A\")\n keyName = StringFromCharCode(StringPrototypeCharCodeAt.@call(ch) + StringPrototypeCharCodeAt.@call(\"a\") - 1), keyCtrl2 = !0;\n else if (RegExpPrototypeExec.@call(/^[0-9A-Za-z]$/, ch) !== null)\n keyName = StringPrototypeToLowerCase.@call(ch), keyShift = RegExpPrototypeExec.@call(/^[A-Z]$/, ch) !== null, keyMeta = escaped;\n else if (escaped)\n keyName = ch.length \? @undefined : \"escape\", keyMeta = !0;\n else\n keyName = @undefined;\n if (keySeq = s, s.length !== 0 && (keyName !== @undefined || escaped))\n stream.emit(\"keypress\", escaped \? @undefined : s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n else if (charLengthAt(s, 0) === s.length)\n stream.emit(\"keypress\", s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n }\n}\nvar commonPrefix = function(strings) {\n if (strings.length === 0)\n return \"\";\n if (strings.length === 1)\n return strings[0];\n var sorted = ArrayPrototypeSort.@call(ArrayPrototypeSlice.@call(strings)), min = sorted[0], max = sorted[sorted.length - 1];\n for (var i = 0;i < min.length; i++)\n if (min[i] !== max[i])\n return StringPrototypeSlice.@call(min, 0, i);\n return min;\n}, cursorTo = function(stream, x, y, callback) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\");\n if (typeof y === \"function\")\n callback = y, y = @undefined;\n if (NumberIsNaN(x))\n throw new ERR_INVALID_ARG_VALUE(\"x\", x);\n if (NumberIsNaN(y))\n throw new ERR_INVALID_ARG_VALUE(\"y\", y);\n if (stream == null || typeof x !== \"number\" && typeof y !== \"number\") {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n if (typeof x !== \"number\")\n throw new ERR_INVALID_CURSOR_POS;\n var data = typeof y !== \"number\" \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n return stream.write(data, callback);\n}, moveCursor = function(stream, dx, dy, callback) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\");\n if (stream == null || !(dx || dy)) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n return stream.write(data, callback);\n}, clearLine = function(stream, dir, callback) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === @undefined) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var type = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n return stream.write(type, callback);\n}, clearScreenDown = function(stream, callback) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === @undefined) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n return stream.write(kClearScreenDown, callback);\n}, emitKeypressEvents = function(stream, iface = {}) {\n if (stream[KEYPRESS_DECODER])\n return;\n stream[KEYPRESS_DECODER] = new StringDecoder(\"utf8\"), stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next();\n var triggerEscape = () => stream[ESCAPE_DECODER].next(\"\"), { escapeCodeTimeout = ESCAPE_CODE_TIMEOUT } = iface, timeoutId;\n function onData(input) {\n if (stream.listenerCount(\"keypress\") > 0) {\n var string = stream[KEYPRESS_DECODER].write(input);\n if (string) {\n clearTimeout(timeoutId), iface[kSawKeyPress] = charLengthAt(string, 0) === string.length, iface.isCompletionEnabled = !1;\n var length = 0;\n for (var character of new SafeStringIterator(string)) {\n if (length += character.length, length === string.length)\n iface.isCompletionEnabled = !0;\n try {\n if (stream[ESCAPE_DECODER].next(character), length === string.length && character === kEscape)\n timeoutId = setTimeout(triggerEscape, escapeCodeTimeout);\n } catch (err) {\n throw stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next(), err;\n }\n }\n }\n } else\n stream.removeListener(\"data\", onData), stream.on(\"newListener\", onNewListener);\n }\n function onNewListener(event) {\n if (event === \"keypress\")\n stream.on(\"data\", onData), stream.removeListener(\"newListener\", onNewListener);\n }\n if (stream.listenerCount(\"keypress\") > 0)\n stream.on(\"data\", onData);\n else\n stream.on(\"newListener\", onNewListener);\n}, onSelfCloseWithTerminal = function() {\n var input = this.input, output = this.output;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n if (input.removeListener(\"keypress\", this[kOnKeyPress]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnTermEnd]), output !== null && output !== @undefined)\n output.removeListener(\"resize\", this[kOnResize]);\n}, onSelfCloseWithoutTerminal = function() {\n var input = this.input;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n input.removeListener(\"data\", this[kOnData]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnEnd]);\n}, onError = function(err) {\n this.emit(\"error\", err);\n}, onData = function(data) {\n debug(\"onData\"), this[kNormalWrite](data);\n}, onEnd = function() {\n if (debug(\"onEnd\"), typeof this[kLine_buffer] === \"string\" && this[kLine_buffer].length > 0)\n this.emit(\"line\", this[kLine_buffer]);\n this.close();\n}, onTermEnd = function() {\n if (debug(\"onTermEnd\"), typeof this.line === \"string\" && this.line.length > 0)\n this.emit(\"line\", this.line);\n this.close();\n}, onKeyPress = function(s, key) {\n if (this[kTtyWrite](s, key), key && key.sequence) {\n var ch = StringPrototypeCodePointAt.@call(key.sequence, 0);\n if (ch >= 55296 && ch <= 57343)\n this[kRefreshLine]();\n }\n}, onResize = function() {\n this[kRefreshLine]();\n}, InterfaceConstructor = function(input, output, completer, terminal) {\n if (!(this instanceof InterfaceConstructor))\n return new InterfaceConstructor(input, output, completer, terminal);\n EventEmitter.@call(this), this[kOnSelfCloseWithoutTerminal] = onSelfCloseWithoutTerminal.bind(this), this[kOnSelfCloseWithTerminal] = onSelfCloseWithTerminal.bind(this), this[kOnError] = onError.bind(this), this[kOnData] = onData.bind(this), this[kOnEnd] = onEnd.bind(this), this[kOnTermEnd] = onTermEnd.bind(this), this[kOnKeyPress] = onKeyPress.bind(this), this[kOnResize] = onResize.bind(this), this[kSawReturnAt] = 0, this.isCompletionEnabled = !0, this[kSawKeyPress] = !1, this[kPreviousKey] = null, this.escapeCodeTimeout = ESCAPE_CODE_TIMEOUT, this.tabSize = 8;\n var history, historySize, removeHistoryDuplicates = !1, crlfDelay, prompt = \"> \", signal;\n if (input\?.input) {\n output = input.output, completer = input.completer, terminal = input.terminal, history = input.history, historySize = input.historySize, signal = input.signal;\n var tabSize = input.tabSize;\n if (tabSize !== @undefined)\n validateUint32(tabSize, \"tabSize\", !0), this.tabSize = tabSize;\n removeHistoryDuplicates = input.removeHistoryDuplicates;\n var inputPrompt = input.prompt;\n if (inputPrompt !== @undefined)\n prompt = inputPrompt;\n var inputEscapeCodeTimeout = input.escapeCodeTimeout;\n if (inputEscapeCodeTimeout !== @undefined)\n if (NumberIsFinite(inputEscapeCodeTimeout))\n this.escapeCodeTimeout = inputEscapeCodeTimeout;\n else\n throw new ERR_INVALID_ARG_VALUE(\"input.escapeCodeTimeout\", this.escapeCodeTimeout);\n if (signal)\n validateAbortSignal(signal, \"options.signal\");\n crlfDelay = input.crlfDelay, input = input.input;\n }\n if (completer !== @undefined && typeof completer !== \"function\")\n throw new ERR_INVALID_ARG_VALUE(\"completer\", completer);\n if (history === @undefined)\n history = [];\n else\n validateArray(history, \"history\");\n if (historySize === @undefined)\n historySize = kHistorySize;\n if (typeof historySize !== \"number\" || NumberIsNaN(historySize) || historySize < 0)\n throw new ERR_INVALID_ARG_VALUE(\"historySize\", historySize);\n if (terminal === @undefined && !(output === null || output === @undefined))\n terminal = !!output.isTTY;\n if (this.line = \"\", this[kSubstringSearch] = null, this.output = output, this.input = input, this[kUndoStack] = [], this[kRedoStack] = [], this.history = history, this.historySize = historySize, this[kKillRing] = [], this[kKillRingCursor] = 0, this.removeHistoryDuplicates = !!removeHistoryDuplicates, this.crlfDelay = crlfDelay \? MathMax(kMincrlfDelay, crlfDelay) : kMincrlfDelay, this.completer = completer, this.setPrompt(prompt), this.terminal = !!terminal, this[kLineObjectStream] = @undefined, input.on(\"error\", this[kOnError]), !this.terminal)\n input.on(\"data\", this[kOnData]), input.on(\"end\", this[kOnEnd]), this.once(\"close\", this[kOnSelfCloseWithoutTerminal]), this[kDecoder] = new StringDecoder(\"utf8\");\n else {\n if (emitKeypressEvents(input, this), input.on(\"keypress\", this[kOnKeyPress]), input.on(\"end\", this[kOnTermEnd]), this[kSetRawMode](!0), this.terminal = !0, this.cursor = 0, this.historyIndex = -1, output !== null && output !== @undefined)\n output.on(\"resize\", this[kOnResize]);\n this.once(\"close\", this[kOnSelfCloseWithTerminal]);\n }\n if (signal) {\n var onAborted = (() => this.close()).bind(this);\n if (signal.aborted)\n process.nextTick(onAborted);\n else\n signal.addEventListener(\"abort\", onAborted, { once: !0 }), this.once(\"close\", () => signal.removeEventListener(\"abort\", onAborted));\n }\n this.line = \"\", input.resume();\n}, Interface = function(input, output, completer, terminal) {\n if (!(this instanceof Interface))\n return new Interface(input, output, completer, terminal);\n if (input\?.input && typeof input.completer === \"function\" && input.completer.length !== 2) {\n var { completer } = input;\n input.completer = (v, cb) => cb(null, completer(v));\n } else if (typeof completer === \"function\" && completer.length !== 2) {\n var realCompleter = completer;\n completer = (v, cb) => cb(null, realCompleter(v));\n }\n InterfaceConstructor.@call(this, input, output, completer, terminal);\n}, createInterface = function(input, output, completer, terminal) {\n return new Interface(input, output, completer, terminal);\n};\nvar $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { StringDecoder } = @requireNativeModule(\"string_decoder\"), isWritable, { inspect } = Bun, debug = process.env.BUN_JS_DEBUG \? console.log : () => {\n}, SymbolAsyncIterator = Symbol.asyncIterator, SymbolIterator = Symbol.iterator, SymbolFor = Symbol.for, SymbolReplace = Symbol.replace, ArrayFrom = @Array.from, ArrayIsArray = @Array.isArray, ArrayPrototypeFilter = @Array.prototype.filter, ArrayPrototypeSort = @Array.prototype.sort, ArrayPrototypeIndexOf = @Array.prototype.indexOf, ArrayPrototypeJoin = @Array.prototype.join, ArrayPrototypeMap = @Array.prototype.map, ArrayPrototypePop = @Array.prototype.pop, ArrayPrototypePush = @Array.prototype.push, ArrayPrototypeSlice = @Array.prototype.slice, ArrayPrototypeSplice = @Array.prototype.splice, ArrayPrototypeReverse = @Array.prototype.reverse, ArrayPrototypeShift = @Array.prototype.shift, ArrayPrototypeUnshift = @Array.prototype.unshift, RegExpPrototypeExec = @RegExp.prototype.exec, RegExpPrototypeSymbolReplace = @RegExp.prototype[SymbolReplace], StringFromCharCode = @String.fromCharCode, StringPrototypeCharCodeAt = @String.prototype.charCodeAt, StringPrototypeCodePointAt = @String.prototype.codePointAt, StringPrototypeSlice = @String.prototype.slice, StringPrototypeToLowerCase = @String.prototype.toLowerCase, StringPrototypeEndsWith = @String.prototype.endsWith, StringPrototypeRepeat = @String.prototype.repeat, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeTrim = @String.prototype.trim, StringPrototypeNormalize = @String.prototype.normalize, NumberIsNaN = Number.isNaN, NumberIsFinite = Number.isFinite, NumberIsInteger = Number.isInteger, NumberMAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER, NumberMIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER, MathCeil = Math.ceil, MathFloor = Math.floor, MathMax = Math.max, DateNow = Date.now, FunctionPrototype = Function.prototype, StringPrototype = @String.prototype, StringPrototypeSymbolIterator = StringPrototype[SymbolIterator], StringIteratorPrototypeNext = StringPrototypeSymbolIterator.@call(\"\").next, ObjectSetPrototypeOf = Object.setPrototypeOf, ObjectDefineProperty = Object.defineProperty, ObjectDefineProperties = Object.defineProperties, ObjectFreeze = Object.freeze;\nvar { create: ObjectCreate, keys: ObjectKeys } = Object;\nvar createSafeIterator = (factory, next) => {\n class SafeIterator {\n #iterator;\n constructor(iterable) {\n this.#iterator = factory.@call(iterable);\n }\n next() {\n return next.@call(this.#iterator);\n }\n [SymbolIterator]() {\n return this;\n }\n }\n return ObjectSetPrototypeOf(SafeIterator.prototype, null), ObjectFreeze(SafeIterator.prototype), ObjectFreeze(SafeIterator), SafeIterator;\n}, SafeStringIterator = createSafeIterator(StringPrototypeSymbolIterator, StringIteratorPrototypeNext), isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n}, isZeroWidthCodePoint = (code) => {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, getStringWidth = function getStringWidth2(str, removeControlChars = !0) {\n var width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize.@call(str, \"NFC\");\n for (var char of new SafeStringIterator(str)) {\n var code = StringPrototypeCodePointAt.@call(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n}, ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new @RegExp(ansiPattern, \"g\"), kCustomPromisifiedSymbol = SymbolFor(\"nodejs.util.promisify.custom\"), kCustomPromisifyArgsSymbol = Symbol(\"customPromisifyArgs\");\npromisify.custom = kCustomPromisifiedSymbol;\nvar kUTF16SurrogateThreshold = 65536, kEscape = \"\\x1B\", kSubstringSearch = Symbol(\"kSubstringSearch\"), kIsNodeError = Symbol(\"kIsNodeError\"), errorBases = {}, VALID_NODE_ERROR_BASES = {\n TypeError,\n RangeError,\n Error\n}, NodeError = getNodeErrorByName(\"Error\"), NodeTypeError = getNodeErrorByName(\"TypeError\"), NodeRangeError = getNodeErrorByName(\"RangeError\");\n\nclass ERR_INVALID_ARG_TYPE extends NodeTypeError {\n constructor(name, type, value) {\n super(`The \"${name}\" argument must be of type ${type}. Received type ${typeof value}`, {\n code: \"ERR_INVALID_ARG_TYPE\"\n });\n }\n}\n\nclass ERR_INVALID_ARG_VALUE extends NodeTypeError {\n constructor(name, value, reason = \"not specified\") {\n super(`The value \"${@String(value)}\" is invalid for argument '${name}'. Reason: ${reason}`, {\n code: \"ERR_INVALID_ARG_VALUE\"\n });\n }\n}\n\nclass ERR_INVALID_CURSOR_POS extends NodeTypeError {\n constructor() {\n super(\"Cannot set cursor row without setting its column\", {\n code: \"ERR_INVALID_CURSOR_POS\"\n });\n }\n}\n\nclass ERR_OUT_OF_RANGE extends NodeRangeError {\n constructor(name, range, received) {\n super(`The value of \"${name}\" is out of range. It must be ${range}. Received ${received}`, {\n code: \"ERR_OUT_OF_RANGE\"\n });\n }\n}\n\nclass ERR_USE_AFTER_CLOSE extends NodeError {\n constructor() {\n super(\"This socket has been ended by the other party\", {\n code: \"ERR_USE_AFTER_CLOSE\"\n });\n }\n}\n\nclass AbortError extends Error {\n code;\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\nvar kClearLine, kClearScreenDown, kClearToLineBeginning, kClearToLineEnd;\nCSI.kEscape = kEscape;\nCSI.kClearLine = kClearLine = CSI`2K`;\nCSI.kClearScreenDown = kClearScreenDown = CSI`0J`;\nCSI.kClearToLineBeginning = kClearToLineBeginning = CSI`1K`;\nCSI.kClearToLineEnd = kClearToLineEnd = CSI`0K`;\nvar KEYPRESS_DECODER = Symbol(\"keypress-decoder\"), ESCAPE_DECODER = Symbol(\"escape-decoder\"), ESCAPE_CODE_TIMEOUT = 500, kEmptyObject = ObjectFreeze(ObjectCreate(null)), kHistorySize = 30, kMaxUndoRedoStackSize = 2048, kMincrlfDelay = 100, lineEnding = /\\r\?\\n|\\r(\?!\\n)/g, kMaxLengthOfKillRing = 32, kLineObjectStream = Symbol(\"line object stream\"), kQuestionCancel = Symbol(\"kQuestionCancel\"), kQuestion = Symbol(\"kQuestion\"), kAddHistory = Symbol(\"_addHistory\"), kBeforeEdit = Symbol(\"_beforeEdit\"), kDecoder = Symbol(\"_decoder\"), kDeleteLeft = Symbol(\"_deleteLeft\"), kDeleteLineLeft = Symbol(\"_deleteLineLeft\"), kDeleteLineRight = Symbol(\"_deleteLineRight\"), kDeleteRight = Symbol(\"_deleteRight\"), kDeleteWordLeft = Symbol(\"_deleteWordLeft\"), kDeleteWordRight = Symbol(\"_deleteWordRight\"), kGetDisplayPos = Symbol(\"_getDisplayPos\"), kHistoryNext = Symbol(\"_historyNext\"), kHistoryPrev = Symbol(\"_historyPrev\"), kInsertString = Symbol(\"_insertString\"), kLine = Symbol(\"_line\"), kLine_buffer = Symbol(\"_line_buffer\"), kKillRing = Symbol(\"_killRing\"), kKillRingCursor = Symbol(\"_killRingCursor\"), kMoveCursor = Symbol(\"_moveCursor\"), kNormalWrite = Symbol(\"_normalWrite\"), kOldPrompt = Symbol(\"_oldPrompt\"), kOnLine = Symbol(\"_onLine\"), kPreviousKey = Symbol(\"_previousKey\"), kPrompt = Symbol(\"_prompt\"), kPushToKillRing = Symbol(\"_pushToKillRing\"), kPushToUndoStack = Symbol(\"_pushToUndoStack\"), kQuestionCallback = Symbol(\"_questionCallback\"), kRedo = Symbol(\"_redo\"), kRedoStack = Symbol(\"_redoStack\"), kRefreshLine = Symbol(\"_refreshLine\"), kSawKeyPress = Symbol(\"_sawKeyPress\"), kSawReturnAt = Symbol(\"_sawReturnAt\"), kSetRawMode = Symbol(\"_setRawMode\"), kTabComplete = Symbol(\"_tabComplete\"), kTabCompleter = Symbol(\"_tabCompleter\"), kTtyWrite = Symbol(\"_ttyWrite\"), kUndo = Symbol(\"_undo\"), kUndoStack = Symbol(\"_undoStack\"), kWordLeft = Symbol(\"_wordLeft\"), kWordRight = Symbol(\"_wordRight\"), kWriteToOutput = Symbol(\"_writeToOutput\"), kYank = Symbol(\"_yank\"), kYanking = Symbol(\"_yanking\"), kYankPop = Symbol(\"_yankPop\"), kFirstEventParam = Symbol(\"nodejs.kFirstEventParam\"), kOnSelfCloseWithTerminal = Symbol(\"_onSelfCloseWithTerminal\"), kOnSelfCloseWithoutTerminal = Symbol(\"_onSelfCloseWithoutTerminal\"), kOnKeyPress = Symbol(\"_onKeyPress\"), kOnError = Symbol(\"_onError\"), kOnData = Symbol(\"_onData\"), kOnEnd = Symbol(\"_onEnd\"), kOnTermEnd = Symbol(\"_onTermEnd\"), kOnResize = Symbol(\"_onResize\");\nInterfaceConstructor.prototype = {};\nObjectSetPrototypeOf(InterfaceConstructor.prototype, EventEmitter.prototype);\nvar _Interface = class Interface2 extends InterfaceConstructor {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n get columns() {\n var output = this.output;\n if (output && output.columns)\n return output.columns;\n return @Infinity;\n }\n setPrompt(prompt) {\n this[kPrompt] = prompt;\n }\n getPrompt() {\n return this[kPrompt];\n }\n [kSetRawMode](flag) {\n const mode = flag + 0, wasInRawMode = this.input.isRaw;\n var setRawMode = this.input.setRawMode;\n if (typeof setRawMode === \"function\")\n setRawMode.@call(this.input, mode);\n return wasInRawMode;\n }\n prompt(preserveCursor) {\n if (this.paused)\n this.resume();\n if (this.terminal) {\n if (!preserveCursor)\n this.cursor = 0;\n this[kRefreshLine]();\n } else\n this[kWriteToOutput](this[kPrompt]);\n }\n [kQuestion](query, cb) {\n if (this.closed)\n throw new ERR_USE_AFTER_CLOSE(\"readline\");\n if (this[kQuestionCallback])\n this.prompt();\n else\n this[kOldPrompt] = this[kPrompt], this.setPrompt(query), this[kQuestionCallback] = cb, this.prompt();\n }\n [kOnLine](line) {\n if (this[kQuestionCallback]) {\n var cb = this[kQuestionCallback];\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), cb(line);\n } else\n this.emit(\"line\", line);\n }\n [kBeforeEdit](oldText, oldCursor) {\n this[kPushToUndoStack](oldText, oldCursor);\n }\n [kQuestionCancel]() {\n if (this[kQuestionCallback])\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), this.clearLine();\n }\n [kWriteToOutput](stringToWrite) {\n if (validateString(stringToWrite, \"stringToWrite\"), this.output !== null && this.output !== @undefined)\n this.output.write(stringToWrite);\n }\n [kAddHistory]() {\n if (this.line.length === 0)\n return \"\";\n if (this.historySize === 0)\n return this.line;\n if (StringPrototypeTrim.@call(this.line).length === 0)\n return this.line;\n if (this.history.length === 0 || this.history[0] !== this.line) {\n if (this.removeHistoryDuplicates) {\n var dupIndex = ArrayPrototypeIndexOf.@call(this.history, this.line);\n if (dupIndex !== -1)\n ArrayPrototypeSplice.@call(this.history, dupIndex, 1);\n }\n if (ArrayPrototypeUnshift.@call(this.history, this.line), this.history.length > this.historySize)\n ArrayPrototypePop.@call(this.history);\n }\n this.historyIndex = -1;\n var line = this.history[0];\n return this.emit(\"history\", this.history), line;\n }\n [kRefreshLine]() {\n var line = this[kPrompt] + this.line, dispPos = this[kGetDisplayPos](line), lineCols = dispPos.cols, lineRows = dispPos.rows, cursorPos = this.getCursorPos(), prevRows = this.prevRows || 0;\n if (prevRows > 0)\n moveCursor(this.output, 0, -prevRows);\n if (cursorTo(this.output, 0), clearScreenDown(this.output), this[kWriteToOutput](line), lineCols === 0)\n this[kWriteToOutput](\" \");\n cursorTo(this.output, cursorPos.cols);\n var diff = lineRows - cursorPos.rows;\n if (diff > 0)\n moveCursor(this.output, 0, -diff);\n this.prevRows = cursorPos.rows;\n }\n close() {\n if (this.closed)\n return;\n if (this.pause(), this.terminal)\n this[kSetRawMode](!1);\n this.closed = !0, this.emit(\"close\");\n }\n pause() {\n if (this.paused)\n return;\n return this.input.pause(), this.paused = !0, this.emit(\"pause\"), this;\n }\n resume() {\n if (!this.paused)\n return;\n return this.input.resume(), this.paused = !1, this.emit(\"resume\"), this;\n }\n write(d, key) {\n if (this.paused)\n this.resume();\n if (this.terminal)\n this[kTtyWrite](d, key);\n else\n this[kNormalWrite](d);\n }\n [kNormalWrite](b) {\n if (b === @undefined)\n return;\n var string = this[kDecoder].write(b);\n if (this[kSawReturnAt] && DateNow() - this[kSawReturnAt] <= this.crlfDelay) {\n if (StringPrototypeCodePointAt.@call(string) === 10)\n string = StringPrototypeSlice.@call(string, 1);\n this[kSawReturnAt] = 0;\n }\n var newPartContainsEnding = RegExpPrototypeExec.@call(lineEnding, string);\n if (newPartContainsEnding !== null) {\n if (this[kLine_buffer])\n string = this[kLine_buffer] + string, this[kLine_buffer] = null, newPartContainsEnding = RegExpPrototypeExec.@call(lineEnding, string);\n this[kSawReturnAt] = StringPrototypeEndsWith.@call(string, \"\\r\") \? DateNow() : 0;\n var indexes = [0, newPartContainsEnding.index, lineEnding.lastIndex], nextMatch;\n while ((nextMatch = RegExpPrototypeExec.@call(lineEnding, string)) !== null)\n ArrayPrototypePush.@call(indexes, nextMatch.index, lineEnding.lastIndex);\n var lastIndex = indexes.length - 1;\n this[kLine_buffer] = StringPrototypeSlice.@call(string, indexes[lastIndex]);\n for (var i = 1;i < lastIndex; i += 2)\n this[kOnLine](StringPrototypeSlice.@call(string, indexes[i - 1], indexes[i]));\n } else if (string)\n if (this[kLine_buffer])\n this[kLine_buffer] += string;\n else\n this[kLine_buffer] = string;\n }\n [kInsertString](c) {\n if (this[kBeforeEdit](this.line, this.cursor), this.cursor < this.line.length) {\n var beg = StringPrototypeSlice.@call(this.line, 0, this.cursor), end = StringPrototypeSlice.@call(this.line, this.cursor, this.line.length);\n this.line = beg + c + end, this.cursor += c.length, this[kRefreshLine]();\n } else {\n var oldPos = this.getCursorPos();\n this.line += c, this.cursor += c.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows < newPos.rows)\n this[kRefreshLine]();\n else\n this[kWriteToOutput](c);\n }\n }\n async[kTabComplete](lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.@call(this.line, 0, this.cursor), value;\n try {\n value = await this.completer(string);\n } catch (err) {\n this[kWriteToOutput](`Tab completion error: ${inspect(err)}`);\n return;\n } finally {\n this.resume();\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n }\n [kTabCompleter](lastKeypressWasTab, { 0: completions, 1: completeOn }) {\n if (!completions || completions.length === 0)\n return;\n var prefix = commonPrefix(ArrayPrototypeFilter.@call(completions, (e) => e !== \"\"));\n if (StringPrototypeStartsWith.@call(prefix, completeOn) && prefix.length > completeOn.length) {\n this[kInsertString](StringPrototypeSlice.@call(prefix, completeOn.length));\n return;\n } else if (!StringPrototypeStartsWith.@call(completeOn, prefix)) {\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor - completeOn.length) + prefix + StringPrototypeSlice.@call(this.line, this.cursor, this.line.length), this.cursor = this.cursor - completeOn.length + prefix.length, this._refreshLine();\n return;\n }\n if (!lastKeypressWasTab)\n return;\n this[kBeforeEdit](this.line, this.cursor);\n var completionsWidth = ArrayPrototypeMap.@call(completions, (e) => getStringWidth(e)), width = MathMax.@apply(completionsWidth) + 2, maxColumns = MathFloor(this.columns / width) || 1;\n if (maxColumns === @Infinity)\n maxColumns = 1;\n var output = \"\\r\\n\", lineIndex = 0, whitespace = 0;\n for (var i = 0;i < completions.length; i++) {\n var completion = completions[i];\n if (completion === \"\" || lineIndex === maxColumns)\n output += \"\\r\\n\", lineIndex = 0, whitespace = 0;\n else\n output += StringPrototypeRepeat.@call(\" \", whitespace);\n if (completion !== \"\")\n output += completion, whitespace = width - completionsWidth[i], lineIndex++;\n else\n output += \"\\r\\n\";\n }\n if (lineIndex !== 0)\n output += \"\\r\\n\\r\\n\";\n this[kWriteToOutput](output), this[kRefreshLine]();\n }\n [kWordLeft]() {\n if (this.cursor > 0) {\n var leading = StringPrototypeSlice.@call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.@call(ArrayPrototypeReverse.@call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.@call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n this[kMoveCursor](-match[0].length);\n }\n }\n [kWordRight]() {\n if (this.cursor < this.line.length) {\n var trailing = StringPrototypeSlice.@call(this.line, this.cursor), match = RegExpPrototypeExec.@call(/^(\?:\\s+|[^\\w\\s]+|\\w+)\\s*/, trailing);\n this[kMoveCursor](match[0].length);\n }\n }\n [kDeleteLeft]() {\n if (this.cursor > 0 && this.line.length > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthLeft(this.line, this.cursor);\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor - charSize) + StringPrototypeSlice.@call(this.line, this.cursor, this.line.length), this.cursor -= charSize, this[kRefreshLine]();\n }\n }\n [kDeleteRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthAt(this.line, this.cursor);\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor) + StringPrototypeSlice.@call(this.line, this.cursor + charSize, this.line.length), this[kRefreshLine]();\n }\n }\n [kDeleteWordLeft]() {\n if (this.cursor > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var leading = StringPrototypeSlice.@call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.@call(ArrayPrototypeReverse.@call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.@call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n leading = StringPrototypeSlice.@call(leading, 0, leading.length - match[0].length), this.line = leading + StringPrototypeSlice.@call(this.line, this.cursor, this.line.length), this.cursor = leading.length, this[kRefreshLine]();\n }\n }\n [kDeleteWordRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var trailing = StringPrototypeSlice.@call(this.line, this.cursor), match = RegExpPrototypeExec.@call(/^(\?:\\s+|\\W+|\\w+)\\s*/, trailing);\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor) + StringPrototypeSlice.@call(trailing, match[0].length), this[kRefreshLine]();\n }\n }\n [kDeleteLineLeft]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.@call(this.line, 0, this.cursor);\n this.line = StringPrototypeSlice.@call(this.line, this.cursor), this.cursor = 0, this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kDeleteLineRight]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.@call(this.line, this.cursor);\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor), this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kPushToKillRing](del) {\n if (!del || del === this[kKillRing][0])\n return;\n ArrayPrototypeUnshift.@call(this[kKillRing], del), this[kKillRingCursor] = 0;\n while (this[kKillRing].length > kMaxLengthOfKillRing)\n ArrayPrototypePop.@call(this[kKillRing]);\n }\n [kYank]() {\n if (this[kKillRing].length > 0)\n this[kYanking] = !0, this[kInsertString](this[kKillRing][this[kKillRingCursor]]);\n }\n [kYankPop]() {\n if (!this[kYanking])\n return;\n if (this[kKillRing].length > 1) {\n var lastYank = this[kKillRing][this[kKillRingCursor]];\n if (this[kKillRingCursor]++, this[kKillRingCursor] >= this[kKillRing].length)\n this[kKillRingCursor] = 0;\n var currentYank = this[kKillRing][this[kKillRingCursor]], head = StringPrototypeSlice.@call(this.line, 0, this.cursor - lastYank.length), tail = StringPrototypeSlice.@call(this.line, this.cursor);\n this.line = head + currentYank + tail, this.cursor = head.length + currentYank.length, this[kRefreshLine]();\n }\n }\n clearLine() {\n this[kMoveCursor](+@Infinity), this[kWriteToOutput](\"\\r\\n\"), this.line = \"\", this.cursor = 0, this.prevRows = 0;\n }\n [kLine]() {\n var line = this[kAddHistory]();\n this[kUndoStack] = [], this[kRedoStack] = [], this.clearLine(), this[kOnLine](line);\n }\n [kPushToUndoStack](text, cursor) {\n if (ArrayPrototypePush.@call(this[kUndoStack], { text, cursor }) > kMaxUndoRedoStackSize)\n ArrayPrototypeShift.@call(this[kUndoStack]);\n }\n [kUndo]() {\n if (this[kUndoStack].length <= 0)\n return;\n ArrayPrototypePush.@call(this[kRedoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.@call(this[kUndoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kRedo]() {\n if (this[kRedoStack].length <= 0)\n return;\n ArrayPrototypePush.@call(this[kUndoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.@call(this[kRedoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kHistoryNext]() {\n if (this.historyIndex >= 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex - 1;\n while (index >= 0 && (!StringPrototypeStartsWith.@call(this.history[index], search) || this.line === this.history[index]))\n index--;\n if (index === -1)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kHistoryPrev]() {\n if (this.historyIndex < this.history.length && this.history.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex + 1;\n while (index < this.history.length && (!StringPrototypeStartsWith.@call(this.history[index], search) || this.line === this.history[index]))\n index++;\n if (index === this.history.length)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kGetDisplayPos](str) {\n var offset = 0, col = this.columns, rows = 0;\n str = stripVTControlCharacters(str);\n for (var char of new SafeStringIterator(str)) {\n if (char === \"\\n\") {\n rows += MathCeil(offset / col) || 1, offset = 0;\n continue;\n }\n if (char === \"\\t\") {\n offset += this.tabSize - offset % this.tabSize;\n continue;\n }\n var width = getStringWidth(char, !1);\n if (width === 0 || width === 1)\n offset += width;\n else {\n if ((offset + 1) % col === 0)\n offset++;\n offset += 2;\n }\n }\n var cols = offset % col;\n return rows += (offset - cols) / col, { cols, rows };\n }\n getCursorPos() {\n var strBeforeCursor = this[kPrompt] + StringPrototypeSlice.@call(this.line, 0, this.cursor);\n return this[kGetDisplayPos](strBeforeCursor);\n }\n [kMoveCursor](dx) {\n if (dx === 0)\n return;\n var oldPos = this.getCursorPos();\n if (this.cursor += dx, this.cursor < 0)\n this.cursor = 0;\n else if (this.cursor > this.line.length)\n this.cursor = this.line.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows === newPos.rows) {\n var diffWidth = newPos.cols - oldPos.cols;\n moveCursor(this.output, diffWidth, 0);\n } else\n this[kRefreshLine]();\n }\n [kTtyWrite](s, key) {\n var previousKey = this[kPreviousKey];\n key = key || kEmptyObject, this[kPreviousKey] = key;\n var { name: keyName, meta: keyMeta, ctrl: keyCtrl2, shift: keyShift, sequence: keySeq } = key;\n if (!keyMeta || keyName !== \"y\")\n this[kYanking] = !1;\n if ((keyName === \"up\" || keyName === \"down\") && !keyCtrl2 && !keyMeta && !keyShift) {\n if (this[kSubstringSearch] === null)\n this[kSubstringSearch] = StringPrototypeSlice.@call(this.line, 0, this.cursor);\n } else if (this[kSubstringSearch] !== null) {\n if (this[kSubstringSearch] = null, this.history.length === this.historyIndex)\n this.historyIndex = -1;\n }\n if (typeof keySeq === \"string\")\n switch (StringPrototypeCodePointAt.@call(keySeq, 0)) {\n case 31:\n this[kUndo]();\n return;\n case 30:\n this[kRedo]();\n return;\n default:\n break;\n }\n if (keyName === \"escape\")\n return;\n if (keyCtrl2 && keyShift)\n switch (keyName) {\n case \"backspace\":\n this[kDeleteLineLeft]();\n break;\n case \"delete\":\n this[kDeleteLineRight]();\n break;\n }\n else if (keyCtrl2)\n switch (keyName) {\n case \"c\":\n if (this.listenerCount(\"SIGINT\") > 0)\n this.emit(\"SIGINT\");\n else\n this.close();\n break;\n case \"h\":\n this[kDeleteLeft]();\n break;\n case \"d\":\n if (this.cursor === 0 && this.line.length === 0)\n this.close();\n else if (this.cursor < this.line.length)\n this[kDeleteRight]();\n break;\n case \"u\":\n this[kDeleteLineLeft]();\n break;\n case \"k\":\n this[kDeleteLineRight]();\n break;\n case \"a\":\n this[kMoveCursor](-@Infinity);\n break;\n case \"e\":\n this[kMoveCursor](+@Infinity);\n break;\n case \"b\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"f\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"l\":\n cursorTo(this.output, 0, 0), clearScreenDown(this.output), this[kRefreshLine]();\n break;\n case \"n\":\n this[kHistoryNext]();\n break;\n case \"p\":\n this[kHistoryPrev]();\n break;\n case \"y\":\n this[kYank]();\n break;\n case \"z\":\n break;\n case \"w\":\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"left\":\n this[kWordLeft]();\n break;\n case \"right\":\n this[kWordRight]();\n break;\n }\n else if (keyMeta)\n switch (keyName) {\n case \"b\":\n this[kWordLeft]();\n break;\n case \"f\":\n this[kWordRight]();\n break;\n case \"d\":\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"y\":\n this[kYankPop]();\n break;\n }\n else {\n if (this[kSawReturnAt] && keyName !== \"enter\")\n this[kSawReturnAt] = 0;\n switch (keyName) {\n case \"return\":\n this[kSawReturnAt] = DateNow(), this[kLine]();\n break;\n case \"enter\":\n if (this[kSawReturnAt] === 0 || DateNow() - this[kSawReturnAt] > this.crlfDelay)\n this[kLine]();\n this[kSawReturnAt] = 0;\n break;\n case \"backspace\":\n this[kDeleteLeft]();\n break;\n case \"delete\":\n this[kDeleteRight]();\n break;\n case \"left\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"right\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"home\":\n this[kMoveCursor](-@Infinity);\n break;\n case \"end\":\n this[kMoveCursor](+@Infinity);\n break;\n case \"up\":\n this[kHistoryPrev]();\n break;\n case \"down\":\n this[kHistoryNext]();\n break;\n case \"tab\":\n if (typeof this.completer === \"function\" && this.isCompletionEnabled) {\n var lastKeypressWasTab = previousKey && previousKey.name === \"tab\";\n this[kTabComplete](lastKeypressWasTab);\n break;\n }\n default:\n if (typeof s === \"string\" && s) {\n var nextMatch = RegExpPrototypeExec.@call(lineEnding, s);\n if (nextMatch !== null) {\n this[kInsertString](StringPrototypeSlice.@call(s, 0, nextMatch.index));\n var { lastIndex } = lineEnding;\n while ((nextMatch = RegExpPrototypeExec.@call(lineEnding, s)) !== null)\n this[kLine](), this[kInsertString](StringPrototypeSlice.@call(s, lastIndex, nextMatch.index)), { lastIndex } = lineEnding;\n if (lastIndex === s.length)\n this[kLine]();\n } else\n this[kInsertString](s);\n }\n }\n }\n }\n [SymbolAsyncIterator]() {\n if (this[kLineObjectStream] === @undefined)\n this[kLineObjectStream] = EventEmitter.on(this, \"line\", {\n close: [\"close\"],\n highWatermark: 1024,\n [kFirstEventParam]: !0\n });\n return this[kLineObjectStream];\n }\n};\nInterface.prototype = {};\nObjectSetPrototypeOf(Interface.prototype, _Interface.prototype);\nObjectSetPrototypeOf(Interface, _Interface);\nInterface.prototype.question = function question(query, options, cb) {\n if (cb = typeof options === \"function\" \? options : cb, options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return;\n var onAbort = () => {\n this[kQuestionCancel]();\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 });\n var cleanup = () => {\n signal.removeEventListener(\"abort\", onAbort);\n }, originalCb = cb;\n cb = typeof cb === \"function\" \? (answer) => {\n return cleanup(), originalCb(answer);\n } : cleanup;\n }\n if (typeof cb === \"function\")\n this[kQuestion](query, cb);\n};\nInterface.prototype.question[promisify.custom] = function question2(query, options) {\n if (options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal && signal.aborted)\n return PromiseReject(new AbortError(@undefined, { cause: signal.reason }));\n return new @Promise((resolve, reject) => {\n var cb = resolve;\n if (signal) {\n var onAbort = () => {\n reject(new AbortError(@undefined, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this.question(query, options, cb);\n });\n};\nObjectDefineProperties(Interface.prototype, {\n [kSetRawMode]: {\n __proto__: null,\n get() {\n return this._setRawMode;\n }\n },\n [kOnLine]: {\n __proto__: null,\n get() {\n return this._onLine;\n }\n },\n [kWriteToOutput]: {\n __proto__: null,\n get() {\n return this._writeToOutput;\n }\n },\n [kAddHistory]: {\n __proto__: null,\n get() {\n return this._addHistory;\n }\n },\n [kRefreshLine]: {\n __proto__: null,\n get() {\n return this._refreshLine;\n }\n },\n [kNormalWrite]: {\n __proto__: null,\n get() {\n return this._normalWrite;\n }\n },\n [kInsertString]: {\n __proto__: null,\n get() {\n return this._insertString;\n }\n },\n [kTabComplete]: {\n __proto__: null,\n get() {\n return this._tabComplete;\n }\n },\n [kWordLeft]: {\n __proto__: null,\n get() {\n return this._wordLeft;\n }\n },\n [kWordRight]: {\n __proto__: null,\n get() {\n return this._wordRight;\n }\n },\n [kDeleteLeft]: {\n __proto__: null,\n get() {\n return this._deleteLeft;\n }\n },\n [kDeleteRight]: {\n __proto__: null,\n get() {\n return this._deleteRight;\n }\n },\n [kDeleteWordLeft]: {\n __proto__: null,\n get() {\n return this._deleteWordLeft;\n }\n },\n [kDeleteWordRight]: {\n __proto__: null,\n get() {\n return this._deleteWordRight;\n }\n },\n [kDeleteLineLeft]: {\n __proto__: null,\n get() {\n return this._deleteLineLeft;\n }\n },\n [kDeleteLineRight]: {\n __proto__: null,\n get() {\n return this._deleteLineRight;\n }\n },\n [kLine]: {\n __proto__: null,\n get() {\n return this._line;\n }\n },\n [kHistoryNext]: {\n __proto__: null,\n get() {\n return this._historyNext;\n }\n },\n [kHistoryPrev]: {\n __proto__: null,\n get() {\n return this._historyPrev;\n }\n },\n [kGetDisplayPos]: {\n __proto__: null,\n get() {\n return this._getDisplayPos;\n }\n },\n [kMoveCursor]: {\n __proto__: null,\n get() {\n return this._moveCursor;\n }\n },\n [kTtyWrite]: {\n __proto__: null,\n get() {\n return this._ttyWrite;\n }\n },\n _decoder: {\n __proto__: null,\n get() {\n return this[kDecoder];\n },\n set(value) {\n this[kDecoder] = value;\n }\n },\n _line_buffer: {\n __proto__: null,\n get() {\n return this[kLine_buffer];\n },\n set(value) {\n this[kLine_buffer] = value;\n }\n },\n _oldPrompt: {\n __proto__: null,\n get() {\n return this[kOldPrompt];\n },\n set(value) {\n this[kOldPrompt] = value;\n }\n },\n _previousKey: {\n __proto__: null,\n get() {\n return this[kPreviousKey];\n },\n set(value) {\n this[kPreviousKey] = value;\n }\n },\n _prompt: {\n __proto__: null,\n get() {\n return this[kPrompt];\n },\n set(value) {\n this[kPrompt] = value;\n }\n },\n _questionCallback: {\n __proto__: null,\n get() {\n return this[kQuestionCallback];\n },\n set(value) {\n this[kQuestionCallback] = value;\n }\n },\n _sawKeyPress: {\n __proto__: null,\n get() {\n return this[kSawKeyPress];\n },\n set(value) {\n this[kSawKeyPress] = value;\n }\n },\n _sawReturnAt: {\n __proto__: null,\n get() {\n return this[kSawReturnAt];\n },\n set(value) {\n this[kSawReturnAt] = value;\n }\n }\n});\nInterface.prototype._setRawMode = _Interface.prototype[kSetRawMode];\nInterface.prototype._onLine = _Interface.prototype[kOnLine];\nInterface.prototype._writeToOutput = _Interface.prototype[kWriteToOutput];\nInterface.prototype._addHistory = _Interface.prototype[kAddHistory];\nInterface.prototype._refreshLine = _Interface.prototype[kRefreshLine];\nInterface.prototype._normalWrite = _Interface.prototype[kNormalWrite];\nInterface.prototype._insertString = _Interface.prototype[kInsertString];\nInterface.prototype._tabComplete = function(lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.@call(this.line, 0, this.cursor);\n this.completer(string, (err, value) => {\n if (this.resume(), err) {\n this._writeToOutput(`Tab completion error: ${inspect(err)}`);\n return;\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n });\n};\nInterface.prototype._wordLeft = _Interface.prototype[kWordLeft];\nInterface.prototype._wordRight = _Interface.prototype[kWordRight];\nInterface.prototype._deleteLeft = _Interface.prototype[kDeleteLeft];\nInterface.prototype._deleteRight = _Interface.prototype[kDeleteRight];\nInterface.prototype._deleteWordLeft = _Interface.prototype[kDeleteWordLeft];\nInterface.prototype._deleteWordRight = _Interface.prototype[kDeleteWordRight];\nInterface.prototype._deleteLineLeft = _Interface.prototype[kDeleteLineLeft];\nInterface.prototype._deleteLineRight = _Interface.prototype[kDeleteLineRight];\nInterface.prototype._line = _Interface.prototype[kLine];\nInterface.prototype._historyNext = _Interface.prototype[kHistoryNext];\nInterface.prototype._historyPrev = _Interface.prototype[kHistoryPrev];\nInterface.prototype._getDisplayPos = _Interface.prototype[kGetDisplayPos];\nInterface.prototype._getCursorPos = _Interface.prototype.getCursorPos;\nInterface.prototype._moveCursor = _Interface.prototype[kMoveCursor];\nInterface.prototype._ttyWrite = _Interface.prototype[kTtyWrite];\n\nclass Readline {\n #autoCommit = !1;\n #stream;\n #todo = [];\n constructor(stream, options = @undefined) {\n if (isWritable \?\?= (@getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39)).isWritable, !isWritable(stream))\n throw new ERR_INVALID_ARG_TYPE(\"stream\", \"Writable\", stream);\n if (this.#stream = stream, options\?.autoCommit != null)\n validateBoolean(options.autoCommit, \"options.autoCommit\"), this.#autoCommit = options.autoCommit;\n }\n cursorTo(x, y = @undefined) {\n if (validateInteger(x, \"x\"), y != null)\n validateInteger(y, \"y\");\n var data = y == null \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.@call(this.#todo, data);\n return this;\n }\n moveCursor(dx, dy) {\n if (dx || dy) {\n validateInteger(dx, \"dx\"), validateInteger(dy, \"dy\");\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.@call(this.#todo, data);\n }\n return this;\n }\n clearLine(dir) {\n validateInteger(dir, \"dir\", -1, 1);\n var data = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.@call(this.#todo, data);\n return this;\n }\n clearScreenDown() {\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(kClearScreenDown));\n else\n ArrayPrototypePush.@call(this.#todo, kClearScreenDown);\n return this;\n }\n commit() {\n return new @Promise((resolve) => {\n this.#stream.write(ArrayPrototypeJoin.@call(this.#todo, \"\"), resolve), this.#todo = [];\n });\n }\n rollback() {\n return this.#todo = [], this;\n }\n}\nvar PromisesInterface = class Interface3 extends _Interface {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n question(query, options = kEmptyObject) {\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return PromiseReject(new AbortError(@undefined, { cause: signal.reason }));\n }\n return new @Promise((resolve, reject) => {\n var cb = resolve;\n if (options\?.signal) {\n var onAbort = () => {\n this[kQuestionCancel](), reject(new AbortError(@undefined, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this[kQuestion](query, cb);\n });\n }\n};\n$ = {\n Interface,\n clearLine,\n clearScreenDown,\n createInterface,\n cursorTo,\n emitKeypressEvents,\n moveCursor,\n promises: {\n Readline,\n Interface: PromisesInterface,\n createInterface(input, output, completer, terminal) {\n return new PromisesInterface(input, output, completer, terminal);\n }\n },\n [SymbolFor(\"__BUN_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__\")]: {\n CSI,\n utils: {\n getStringWidth,\n stripVTControlCharacters\n }\n }\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeReplCode = "(function (){\"use strict\";// src/js/out/tmp/node/repl.ts\nvar $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5);\n$ = {\n lines: [],\n context: globalThis,\n historyIndex: -1,\n cursor: 0,\n historySize: 1000,\n removeHistoryDuplicates: !1,\n crlfDelay: 100,\n completer: () => {\n throwNotImplemented(\"node:repl\");\n },\n history: [],\n _initialPrompt: \"> \",\n terminal: !0,\n input: new Proxy({}, {\n get() {\n throwNotImplemented(\"node:repl\");\n },\n has: () => !1,\n ownKeys: () => [],\n getOwnPropertyDescriptor: () => {\n return;\n },\n set() {\n throwNotImplemented(\"node:repl\");\n }\n }),\n line: \"\",\n eval: () => {\n throwNotImplemented(\"node:repl\");\n },\n isCompletionEnabled: !0,\n escapeCodeTimeout: 500,\n tabSize: 8,\n breakEvalOnSigint: !0,\n useGlobal: !0,\n underscoreAssigned: !1,\n last: void 0,\n _domain: void 0,\n allowBlockingCompletions: !1,\n useColors: !0,\n output: new Proxy({}, {\n get() {\n throwNotImplemented(\"node:repl\");\n },\n has: () => !1,\n ownKeys: () => [],\n getOwnPropertyDescriptor: () => {\n return;\n },\n set() {\n throwNotImplemented(\"node:repl\");\n }\n }),\n _builtinLibs: [\n \"bun\",\n \"ffi\",\n \"assert\",\n \"assert/strict\",\n \"async_hooks\",\n \"buffer\",\n \"child_process\",\n \"cluster\",\n \"console\",\n \"constants\",\n \"crypto\",\n \"dgram\",\n \"diagnostics_channel\",\n \"dns\",\n \"dns/promises\",\n \"domain\",\n \"events\",\n \"fs\",\n \"fs/promises\",\n \"http\",\n \"http2\",\n \"https\",\n \"inspector\",\n \"inspector/promises\",\n \"module\",\n \"net\",\n \"os\",\n \"path\",\n \"path/posix\",\n \"path/win32\",\n \"perf_hooks\",\n \"process\",\n \"punycode\",\n \"querystring\",\n \"readline\",\n \"readline/promises\",\n \"repl\",\n \"stream\",\n \"stream/consumers\",\n \"stream/promises\",\n \"stream/web\",\n \"string_decoder\",\n \"sys\",\n \"timers\",\n \"timers/promises\",\n \"tls\",\n \"trace_events\",\n \"tty\",\n \"url\",\n \"util\",\n \"util/types\",\n \"v8\",\n \"vm\",\n \"wasi\",\n \"worker_threads\",\n \"zlib\"\n ]\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeReadlinePromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/readline.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).promises})\n");
//
//
-static constexpr ASCIILiteral NodeStreamConsumersCode = "(function (){\"use strict\";// src/js/out/tmp/node/stream.consumers.ts\nvar $, arrayBuffer = Bun.readableStreamToArrayBuffer, text = Bun.readableStreamToText, json = (stream) => Bun.readableStreamToText(stream).then(JSON.parse), buffer = async (readableStream) => {\n return new Buffer(await arrayBuffer(readableStream));\n}, blob = Bun.readableStreamToBlob;\n$ = {\n arrayBuffer,\n text,\n json,\n buffer,\n blob\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeReplCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/repl.ts\nvar $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6);\n$ = {\n lines: [],\n context: globalThis,\n historyIndex: -1,\n cursor: 0,\n historySize: 1000,\n removeHistoryDuplicates: !1,\n crlfDelay: 100,\n completer: () => {\n throwNotImplemented(\"node:repl\");\n },\n history: [],\n _initialPrompt: \"> \",\n terminal: !0,\n input: new Proxy({}, {\n get() {\n throwNotImplemented(\"node:repl\");\n },\n has: () => !1,\n ownKeys: () => [],\n getOwnPropertyDescriptor: () => @undefined,\n set() {\n throwNotImplemented(\"node:repl\");\n }\n }),\n line: \"\",\n eval: () => {\n throwNotImplemented(\"node:repl\");\n },\n isCompletionEnabled: !0,\n escapeCodeTimeout: 500,\n tabSize: 8,\n breakEvalOnSigint: !0,\n useGlobal: !0,\n underscoreAssigned: !1,\n last: @undefined,\n _domain: @undefined,\n allowBlockingCompletions: !1,\n useColors: !0,\n output: new Proxy({}, {\n get() {\n throwNotImplemented(\"node:repl\");\n },\n has: () => !1,\n ownKeys: () => [],\n getOwnPropertyDescriptor: () => @undefined,\n set() {\n throwNotImplemented(\"node:repl\");\n }\n }),\n _builtinLibs: [\n \"bun\",\n \"ffi\",\n \"assert\",\n \"assert/strict\",\n \"async_hooks\",\n \"buffer\",\n \"child_process\",\n \"cluster\",\n \"console\",\n \"constants\",\n \"crypto\",\n \"dgram\",\n \"diagnostics_channel\",\n \"dns\",\n \"dns/promises\",\n \"domain\",\n \"events\",\n \"fs\",\n \"fs/promises\",\n \"http\",\n \"http2\",\n \"https\",\n \"inspector\",\n \"inspector/promises\",\n \"module\",\n \"net\",\n \"os\",\n \"path\",\n \"path/posix\",\n \"path/win32\",\n \"perf_hooks\",\n \"process\",\n \"punycode\",\n \"querystring\",\n \"readline\",\n \"readline/promises\",\n \"repl\",\n \"stream\",\n \"stream/consumers\",\n \"stream/promises\",\n \"stream/web\",\n \"string_decoder\",\n \"sys\",\n \"timers\",\n \"timers/promises\",\n \"tls\",\n \"trace_events\",\n \"tty\",\n \"url\",\n \"util\",\n \"util/types\",\n \"v8\",\n \"vm\",\n \"wasi\",\n \"worker_threads\",\n \"zlib\"\n ]\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeStreamCode = "(function (){\"use strict\";// src/js/out/tmp/node/stream.ts\nvar isReadableStream = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof ReadableStream;\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar ERR_INVALID_ARG_TYPE = function(name, type, value) {\n return new Error(`The argument '${name}' is invalid. Received '${value}' for type '${type}'`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value '${value}' is invalid for argument '${name}'. Reason: ${reason}`);\n}, createNativeStreamReadable = function(nativeType, Readable) {\n var [pull, start, cancel, setClose, deinit, updateRef, drainFn] = globalThis[globalThis.Symbol.for('Bun.lazy')](nativeType), closer = [!1], handleNumberResult = function(nativeReadable, result, view, isClosed) {\n if (result > 0) {\n const slice = view.subarray(0, result), remainder = view.subarray(result);\n if (slice.byteLength > 0)\n nativeReadable.push(slice);\n if (isClosed)\n nativeReadable.push(null);\n return remainder.byteLength > 0 \? remainder : void 0;\n }\n if (isClosed)\n nativeReadable.push(null);\n return view;\n }, handleArrayBufferViewResult = function(nativeReadable, result, view, isClosed) {\n if (result.byteLength > 0)\n nativeReadable.push(result);\n if (isClosed)\n nativeReadable.push(null);\n return view;\n }, DYNAMICALLY_ADJUST_CHUNK_SIZE = process.env.BUN_DISABLE_DYNAMIC_CHUNK_SIZE !== \"1\";\n const finalizer = new FinalizationRegistry((ptr) => ptr && deinit(ptr)), MIN_BUFFER_SIZE = 512;\n var NativeReadable = class NativeReadable2 extends Readable {\n #bunNativePtr;\n #refCount = 1;\n #constructed = !1;\n #remainingChunk = void 0;\n #highWaterMark;\n #pendingRead = !1;\n #hasResized = !DYNAMICALLY_ADJUST_CHUNK_SIZE;\n #unregisterToken;\n constructor(ptr, options = {}) {\n super(options);\n if (typeof options.highWaterMark === \"number\")\n this.#highWaterMark = options.highWaterMark;\n else\n this.#highWaterMark = 262144;\n this.#bunNativePtr = ptr, this.#constructed = !1, this.#remainingChunk = void 0, this.#pendingRead = !1, this.#unregisterToken = {}, finalizer.register(this, this.#bunNativePtr, this.#unregisterToken);\n }\n _read(maxToRead) {\n if (this.#pendingRead)\n return;\n var ptr = this.#bunNativePtr;\n if (ptr === 0) {\n this.push(null);\n return;\n }\n if (!this.#constructed)\n this.#internalConstruct(ptr);\n return this.#internalRead(this.#getRemainingChunk(maxToRead), ptr);\n }\n #internalConstruct(ptr) {\n this.#constructed = !0;\n const result = start(ptr, this.#highWaterMark);\n if (typeof result === \"number\" && result > 1)\n this.#hasResized = !0, this.#highWaterMark = Math.min(this.#highWaterMark, result);\n if (drainFn) {\n const drainResult = drainFn(ptr);\n if ((drainResult\?.byteLength \?\? 0) > 0)\n this.push(drainResult);\n }\n }\n #getRemainingChunk(maxToRead = this.#highWaterMark) {\n var chunk = this.#remainingChunk;\n if (chunk\?.byteLength \?\? 0 < MIN_BUFFER_SIZE) {\n var size = maxToRead > MIN_BUFFER_SIZE \? maxToRead : MIN_BUFFER_SIZE;\n this.#remainingChunk = chunk = new Buffer(size);\n }\n return chunk;\n }\n #handleResult(result, view, isClosed) {\n if (typeof result === \"number\") {\n if (result >= this.#highWaterMark && !this.#hasResized && !isClosed)\n this.#highWaterMark *= 2, this.#hasResized = !0;\n return handleNumberResult(this, result, view, isClosed);\n } else if (typeof result === \"boolean\")\n return process.nextTick(() => {\n this.push(null);\n }), view\?.byteLength \?\? 0 > 0 \? view : void 0;\n else if (ArrayBuffer.isView(result)) {\n if (result.byteLength >= this.#highWaterMark && !this.#hasResized && !isClosed)\n this.#highWaterMark *= 2, this.#hasResized = !0;\n return handleArrayBufferViewResult(this, result, view, isClosed);\n } else\n throw new Error(\"Invalid result from pull\");\n }\n #internalRead(view, ptr) {\n closer[0] = !1;\n var result = pull(ptr, view, closer);\n if (@isPromise(result))\n return this.#pendingRead = !0, result.then((result2) => {\n this.#pendingRead = !1, this.#remainingChunk = this.#handleResult(result2, view, closer[0]);\n }, (reason) => {\n errorOrDestroy(this, reason);\n });\n else\n this.#remainingChunk = this.#handleResult(result, view, closer[0]);\n }\n _destroy(error, callback) {\n var ptr = this.#bunNativePtr;\n if (ptr === 0) {\n callback(error);\n return;\n }\n if (finalizer.unregister(this.#unregisterToken), this.#bunNativePtr = 0, updateRef)\n updateRef(ptr, !1);\n cancel(ptr, error), callback(error);\n }\n ref() {\n var ptr = this.#bunNativePtr;\n if (ptr === 0)\n return;\n if (this.#refCount++ === 0)\n updateRef(ptr, !0);\n }\n unref() {\n var ptr = this.#bunNativePtr;\n if (ptr === 0)\n return;\n if (this.#refCount-- === 1)\n updateRef(ptr, !1);\n }\n };\n if (!updateRef)\n NativeReadable.prototype.ref = void 0, NativeReadable.prototype.unref = void 0;\n return NativeReadable;\n}, getNativeReadableStreamPrototype = function(nativeType, Readable) {\n return nativeReadableStreamPrototypes[nativeType] ||= createNativeStreamReadable(nativeType, Readable);\n}, getNativeReadableStream = function(Readable, stream, options) {\n if (!(stream && typeof stream === \"object\" && stream instanceof ReadableStream))\n return;\n const native = @direct(stream);\n if (!native)\n return;\n const { stream: ptr, data: type } = native;\n return new (getNativeReadableStreamPrototype(type, Readable))(ptr, options);\n}, NativeWritable = function(pathOrFdOrSink, options = {}) {\n Writable.call(this, options), this[_native] = !0, this._construct = NativeWritable_internalConstruct, this._destroy = NativeWritable_internalDestroy, this._final = NativeWritable_internalFinal, this[_pathOrFdOrSink] = pathOrFdOrSink;\n}, NativeWritable_internalConstruct = function(cb) {\n if (this._writableState.constructed = !0, this.constructed = !0, typeof cb === \"function\")\n cb();\n process.nextTick(() => {\n this.emit(\"open\", this.fd), this.emit(\"ready\");\n });\n}, NativeWritable_lazyConstruct = function(stream) {\n var sink = stream[_pathOrFdOrSink];\n if (typeof sink === \"object\")\n if (typeof sink.write === \"function\")\n return stream[_fileSink] = sink;\n else\n throw new Error(\"Invalid FileSink\");\n else\n return stream[_fileSink] = Bun.file(sink).writer();\n}, NativeWritable_internalDestroy = function(error, cb) {\n const w = this._writableState, r = this._readableState;\n if (w)\n w.destroyed = !0, w.closeEmitted = !0;\n if (r)\n r.destroyed = !0, r.closeEmitted = !0;\n if (typeof cb === \"function\")\n cb(error);\n if (w\?.closeEmitted || r\?.closeEmitted)\n this.emit(\"close\");\n}, NativeWritable_internalFinal = function(cb) {\n var sink = this[_fileSink];\n if (sink)\n sink.end();\n if (cb)\n cb();\n}, EE = globalThis[globalThis.Symbol.for('Bun.lazy')](\"events\"), StringDecoder = @requireNativeModule(\"string_decoder\").StringDecoder, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, runOnNextTick = process.nextTick;\nvar ArrayIsArray = Array.isArray, require_primordials = __commonJS({\n \"node_modules/readable-stream/lib/ours/primordials.js\"(exports, module) {\n module.exports = {\n ArrayIsArray(self) {\n return Array.isArray(self);\n },\n ArrayPrototypeIncludes(self, el) {\n return self.includes(el);\n },\n ArrayPrototypeIndexOf(self, el) {\n return self.indexOf(el);\n },\n ArrayPrototypeJoin(self, sep) {\n return self.join(sep);\n },\n ArrayPrototypeMap(self, fn) {\n return self.map(fn);\n },\n ArrayPrototypePop(self, el) {\n return self.pop(el);\n },\n ArrayPrototypePush(self, el) {\n return self.push(el);\n },\n ArrayPrototypeSlice(self, start, end) {\n return self.slice(start, end);\n },\n Error,\n FunctionPrototypeCall(fn, thisArgs, ...args) {\n return fn.call(thisArgs, ...args);\n },\n FunctionPrototypeSymbolHasInstance(self, instance) {\n return Function.prototype[Symbol.hasInstance].call(self, instance);\n },\n MathFloor: Math.floor,\n Number,\n NumberIsInteger: Number.isInteger,\n NumberIsNaN: Number.isNaN,\n NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,\n NumberParseInt: Number.parseInt,\n ObjectDefineProperties(self, props) {\n return Object.defineProperties(self, props);\n },\n ObjectDefineProperty(self, name, prop) {\n return Object.defineProperty(self, name, prop);\n },\n ObjectGetOwnPropertyDescriptor(self, name) {\n return Object.getOwnPropertyDescriptor(self, name);\n },\n ObjectKeys(obj) {\n return Object.keys(obj);\n },\n ObjectSetPrototypeOf(target, proto) {\n return Object.setPrototypeOf(target, proto);\n },\n Promise,\n PromisePrototypeCatch(self, fn) {\n return self.catch(fn);\n },\n PromisePrototypeThen(self, thenFn, catchFn) {\n return self.then(thenFn, catchFn);\n },\n PromiseReject(err) {\n return Promise.reject(err);\n },\n ReflectApply: Reflect.apply,\n RegExpPrototypeTest(self, value) {\n return self.test(value);\n },\n SafeSet: Set,\n String,\n StringPrototypeSlice(self, start, end) {\n return self.slice(start, end);\n },\n StringPrototypeToLowerCase(self) {\n return self.toLowerCase();\n },\n StringPrototypeToUpperCase(self) {\n return self.toUpperCase();\n },\n StringPrototypeTrim(self) {\n return self.trim();\n },\n Symbol,\n SymbolAsyncIterator: Symbol.asyncIterator,\n SymbolHasInstance: Symbol.hasInstance,\n SymbolIterator: Symbol.iterator,\n TypedArrayPrototypeSet(self, buf, len) {\n return self.set(buf, len);\n },\n Uint8Array\n };\n }\n}), require_util = __commonJS({\n \"node_modules/readable-stream/lib/ours/util.js\"(exports, module) {\n var AsyncFunction = Object.getPrototypeOf(async function() {\n }).constructor, isBlob = typeof Blob !== \"undefined\" \? function isBlob2(b) {\n return b instanceof Blob;\n } : function isBlob2(b) {\n return !1;\n }, AggregateError = class extends Error {\n constructor(errors) {\n if (!Array.isArray(errors))\n @throwTypeError(`Expected input to be an Array, got ${typeof errors}`);\n let message = \"\";\n for (let i = 0;i < errors.length; i++)\n message += ` ${errors[i].stack}\n`;\n super(message);\n this.name = \"AggregateError\", this.errors = errors;\n }\n };\n module.exports = {\n AggregateError,\n once(callback) {\n let called = !1;\n return function(...args) {\n if (called)\n return;\n called = !0, callback.apply(this, args);\n };\n },\n createDeferredPromise: function() {\n let resolve, reject;\n return {\n promise: new Promise((res, rej) => {\n resolve = res, reject = rej;\n }),\n resolve,\n reject\n };\n },\n promisify(fn) {\n return new Promise((resolve, reject) => {\n fn((err, ...args) => {\n if (err)\n return reject(err);\n return resolve(...args);\n });\n });\n },\n debuglog() {\n return function() {\n };\n },\n format(format, ...args) {\n return format.replace(/%([sdifj])/g, function(...[_unused, type]) {\n const replacement = args.shift();\n if (type === \"f\")\n return replacement.toFixed(6);\n else if (type === \"j\")\n return JSON.stringify(replacement);\n else if (type === \"s\" && typeof replacement === \"object\")\n return `${replacement.constructor !== Object \? replacement.constructor.name : \"\"} {}`.trim();\n else\n return replacement.toString();\n });\n },\n inspect(value) {\n switch (typeof value) {\n case \"string\":\n if (value.includes(\"'\")) {\n if (!value.includes('\"'))\n return `\"${value}\"`;\n else if (!value.includes(\"`\") && !value.includes(\"${\"))\n return `\\`${value}\\``;\n }\n return `'${value}'`;\n case \"number\":\n if (isNaN(value))\n return \"NaN\";\n else if (Object.is(value, -0))\n return String(value);\n return value;\n case \"bigint\":\n return `${String(value)}n`;\n case \"boolean\":\n case \"undefined\":\n return String(value);\n case \"object\":\n return \"{}\";\n }\n },\n types: {\n isAsyncFunction(fn) {\n return fn instanceof AsyncFunction;\n },\n isArrayBufferView(arr) {\n return ArrayBuffer.isView(arr);\n }\n },\n isBlob\n }, module.exports.promisify.custom = Symbol.for(\"nodejs.util.promisify.custom\");\n }\n}), require_errors = __commonJS({\n \"node_modules/readable-stream/lib/ours/errors.js\"(exports, module) {\n var { format, inspect, AggregateError: CustomAggregateError } = require_util(), AggregateError = globalThis.AggregateError || CustomAggregateError, kIsNodeError = Symbol(\"kIsNodeError\"), kTypes = [\"string\", \"function\", \"number\", \"object\", \"Function\", \"Object\", \"boolean\", \"bigint\", \"symbol\"], classRegExp = /^([A-Z][a-z0-9]*)+$/, nodeInternalPrefix = \"__node_internal_\", codes = {};\n function assert(value, message) {\n if (!value)\n throw new codes.ERR_INTERNAL_ASSERTION(message);\n }\n function addNumericalSeparator(val) {\n let res = \"\", i = val.length;\n const start = val[0] === \"-\" \? 1 : 0;\n for (;i >= start + 4; i -= 3)\n res = `_${val.slice(i - 3, i)}${res}`;\n return `${val.slice(0, i)}${res}`;\n }\n function getMessage(key, msg, args) {\n if (typeof msg === \"function\")\n return assert(msg.length <= args.length, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`), msg(...args);\n const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length;\n if (assert(expectedLength === args.length, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`), args.length === 0)\n return msg;\n return format(msg, ...args);\n }\n function E(code, message, Base) {\n if (!Base)\n Base = Error;\n\n class NodeError extends Base {\n constructor(...args) {\n super(getMessage(code, message, args));\n }\n toString() {\n return `${this.name} [${code}]: ${this.message}`;\n }\n }\n Object.defineProperties(NodeError.prototype, {\n name: {\n value: Base.name,\n writable: !0,\n enumerable: !1,\n configurable: !0\n },\n toString: {\n value() {\n return `${this.name} [${code}]: ${this.message}`;\n },\n writable: !0,\n enumerable: !1,\n configurable: !0\n }\n }), NodeError.prototype.code = code, NodeError.prototype[kIsNodeError] = !0, codes[code] = NodeError;\n }\n function hideStackFrames(fn) {\n const hidden = nodeInternalPrefix + fn.name;\n return Object.defineProperty(fn, \"name\", {\n value: hidden\n }), fn;\n }\n function aggregateTwoErrors(innerError, outerError) {\n if (innerError && outerError && innerError !== outerError) {\n if (Array.isArray(outerError.errors))\n return outerError.errors.push(innerError), outerError;\n const err = new AggregateError([outerError, innerError], outerError.message);\n return err.code = outerError.code, err;\n }\n return innerError || outerError;\n }\n var AbortError2 = class extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n };\n E(\"ERR_ASSERTION\", \"%s\", Error), E(\"ERR_INVALID_ARG_TYPE\", (name, expected, actual) => {\n if (assert(typeof name === \"string\", \"'name' must be a string\"), !Array.isArray(expected))\n expected = [expected];\n let msg = \"The \";\n if (name.endsWith(\" argument\"))\n msg += `${name} `;\n else\n msg += `\"${name}\" ${name.includes(\".\") \? \"property\" : \"argument\"} `;\n msg += \"must be \";\n const types = [], instances = [], other = [];\n for (let value of expected)\n if (assert(typeof value === \"string\", \"All expected entries have to be of type string\"), kTypes.includes(value))\n types.push(value.toLowerCase());\n else if (classRegExp.test(value))\n instances.push(value);\n else\n assert(value !== \"object\", 'The value \"object\" should be written as \"Object\"'), other.push(value);\n if (instances.length > 0) {\n const pos = types.indexOf(\"object\");\n if (pos !== -1)\n types.splice(types, pos, 1), instances.push(\"Object\");\n }\n if (types.length > 0) {\n switch (types.length) {\n case 1:\n msg += `of type ${types[0]}`;\n break;\n case 2:\n msg += `one of type ${types[0]} or ${types[1]}`;\n break;\n default: {\n const last = types.pop();\n msg += `one of type ${types.join(\", \")}, or ${last}`;\n }\n }\n if (instances.length > 0 || other.length > 0)\n msg += \" or \";\n }\n if (instances.length > 0) {\n switch (instances.length) {\n case 1:\n msg += `an instance of ${instances[0]}`;\n break;\n case 2:\n msg += `an instance of ${instances[0]} or ${instances[1]}`;\n break;\n default: {\n const last = instances.pop();\n msg += `an instance of ${instances.join(\", \")}, or ${last}`;\n }\n }\n if (other.length > 0)\n msg += \" or \";\n }\n switch (other.length) {\n case 0:\n break;\n case 1:\n if (other[0].toLowerCase() !== other[0])\n msg += \"an \";\n msg += `${other[0]}`;\n break;\n case 2:\n msg += `one of ${other[0]} or ${other[1]}`;\n break;\n default: {\n const last = other.pop();\n msg += `one of ${other.join(\", \")}, or ${last}`;\n }\n }\n if (actual == null)\n msg += `. Received ${actual}`;\n else if (typeof actual === \"function\" && actual.name)\n msg += `. Received function ${actual.name}`;\n else if (typeof actual === \"object\") {\n var _actual$constructor;\n if ((_actual$constructor = actual.constructor) !== null && _actual$constructor !== void 0 && _actual$constructor.name)\n msg += `. Received an instance of ${actual.constructor.name}`;\n else {\n const inspected = inspect(actual, {\n depth: -1\n });\n msg += `. Received ${inspected}`;\n }\n } else {\n let inspected = inspect(actual, {\n colors: !1\n });\n if (inspected.length > 25)\n inspected = `${inspected.slice(0, 25)}...`;\n msg += `. Received type ${typeof actual} (${inspected})`;\n }\n return msg;\n }, TypeError), E(\"ERR_INVALID_ARG_VALUE\", (name, value, reason = \"is invalid\") => {\n let inspected = inspect(value);\n if (inspected.length > 128)\n inspected = inspected.slice(0, 128) + \"...\";\n return `The ${name.includes(\".\") \? \"property\" : \"argument\"} '${name}' ${reason}. Received ${inspected}`;\n }, TypeError), E(\"ERR_INVALID_RETURN_VALUE\", (input, name, value) => {\n var _value$constructor;\n const type = value !== null && value !== void 0 && (_value$constructor = value.constructor) !== null && _value$constructor !== void 0 && _value$constructor.name \? `instance of ${value.constructor.name}` : `type ${typeof value}`;\n return `Expected ${input} to be returned from the \"${name}\" function but got ${type}.`;\n }, TypeError), E(\"ERR_MISSING_ARGS\", (...args) => {\n assert(args.length > 0, \"At least one arg needs to be specified\");\n let msg;\n const len = args.length;\n switch (args = (Array.isArray(args) \? args : [args]).map((a) => `\"${a}\"`).join(\" or \"), len) {\n case 1:\n msg += `The ${args[0]} argument`;\n break;\n case 2:\n msg += `The ${args[0]} and ${args[1]} arguments`;\n break;\n default:\n {\n const last = args.pop();\n msg += `The ${args.join(\", \")}, and ${last} arguments`;\n }\n break;\n }\n return `${msg} must be specified`;\n }, TypeError), E(\"ERR_OUT_OF_RANGE\", (str, range, input) => {\n assert(range, 'Missing \"range\" argument');\n let received;\n if (Number.isInteger(input) && Math.abs(input) > 4294967296)\n received = addNumericalSeparator(String(input));\n else if (typeof input === \"bigint\") {\n if (received = String(input), input > 2n ** 32n || input < -(2n ** 32n))\n received = addNumericalSeparator(received);\n received += \"n\";\n } else\n received = inspect(input);\n return `The value of \"${str}\" is out of range. It must be ${range}. Received ${received}`;\n }, RangeError), E(\"ERR_MULTIPLE_CALLBACK\", \"Callback called multiple times\", Error), E(\"ERR_METHOD_NOT_IMPLEMENTED\", \"The %s method is not implemented\", Error), E(\"ERR_STREAM_ALREADY_FINISHED\", \"Cannot call %s after a stream was finished\", Error), E(\"ERR_STREAM_CANNOT_PIPE\", \"Cannot pipe, not readable\", Error), E(\"ERR_STREAM_DESTROYED\", \"Cannot call %s after a stream was destroyed\", Error), E(\"ERR_STREAM_NULL_VALUES\", \"May not write null values to stream\", TypeError), E(\"ERR_STREAM_PREMATURE_CLOSE\", \"Premature close\", Error), E(\"ERR_STREAM_PUSH_AFTER_EOF\", \"stream.push() after EOF\", Error), E(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\", \"stream.unshift() after end event\", Error), E(\"ERR_STREAM_WRITE_AFTER_END\", \"write after end\", Error), E(\"ERR_UNKNOWN_ENCODING\", \"Unknown encoding: %s\", TypeError), module.exports = {\n AbortError: AbortError2,\n aggregateTwoErrors: hideStackFrames(aggregateTwoErrors),\n hideStackFrames,\n codes\n };\n }\n}), require_validators = __commonJS({\n \"node_modules/readable-stream/lib/internal/validators.js\"(exports, module) {\n var {\n ArrayIsArray: ArrayIsArray2,\n ArrayPrototypeIncludes,\n ArrayPrototypeJoin,\n ArrayPrototypeMap,\n NumberIsInteger,\n NumberMAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER,\n NumberParseInt,\n RegExpPrototypeTest,\n String: String2,\n StringPrototypeToUpperCase,\n StringPrototypeTrim\n } = require_primordials(), {\n hideStackFrames,\n codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL }\n } = require_errors(), { normalizeEncoding } = require_util(), { isAsyncFunction, isArrayBufferView } = require_util().types, signals = {};\n function isInt32(value) {\n return value === (value | 0);\n }\n function isUint32(value) {\n return value === value >>> 0;\n }\n var octalReg = /^[0-7]+$/, modeDesc = \"must be a 32-bit unsigned integer or an octal string\";\n function parseFileMode(value, name, def) {\n if (typeof value === \"undefined\")\n value = def;\n if (typeof value === \"string\") {\n if (!RegExpPrototypeTest(octalReg, value))\n throw new ERR_INVALID_ARG_VALUE2(name, value, modeDesc);\n value = NumberParseInt(value, 8);\n }\n return validateInt32(value, name, 0, 4294967295), value;\n }\n var validateInteger = hideStackFrames((value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }), validateInt32 = hideStackFrames((value, name, min = -2147483648, max = 2147483647) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!isInt32(value)) {\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }), validateUint32 = hideStackFrames((value, name, positive) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!isUint32(value)) {\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n throw new ERR_OUT_OF_RANGE(name, `>= ${positive \? 1 : 0} && < 4294967296`, value);\n }\n if (positive && value === 0)\n throw new ERR_OUT_OF_RANGE(name, \">= 1 && < 4294967296\", value);\n });\n function validateString(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"string\", value);\n }\n function validateNumber(value, name) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n }\n var validateOneOf = hideStackFrames((value, name, oneOf) => {\n if (!ArrayPrototypeIncludes(oneOf, value)) {\n const reason = \"must be one of: \" + ArrayPrototypeJoin(ArrayPrototypeMap(oneOf, (v) => typeof v === \"string\" \? `'${v}'` : String2(v)), \", \");\n throw new ERR_INVALID_ARG_VALUE2(name, value, reason);\n }\n });\n function validateBoolean2(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"boolean\", value);\n }\n var validateObject = hideStackFrames((value, name, options) => {\n const useDefaultOptions = options == null, allowArray = useDefaultOptions \? !1 : options.allowArray, allowFunction = useDefaultOptions \? !1 : options.allowFunction;\n if (!(useDefaultOptions \? !1 : options.nullable) && value === null || !allowArray && ArrayIsArray2(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Object\", value);\n }), validateArray = hideStackFrames((value, name, minLength = 0) => {\n if (!ArrayIsArray2(value))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE2(name, value, reason);\n }\n });\n function validateSignalName(signal, name = \"signal\") {\n if (validateString(signal, name), signals[signal] === void 0) {\n if (signals[StringPrototypeToUpperCase(signal)] !== void 0)\n throw new ERR_UNKNOWN_SIGNAL(signal + \" (signals must use all capital letters)\");\n throw new ERR_UNKNOWN_SIGNAL(signal);\n }\n }\n var validateBuffer = hideStackFrames((buffer, name = \"buffer\") => {\n if (!isArrayBufferView(buffer))\n throw new ERR_INVALID_ARG_TYPE2(name, [\"Buffer\", \"TypedArray\", \"DataView\"], buffer);\n });\n function validateEncoding(data, encoding) {\n const normalizedEncoding = normalizeEncoding(encoding), length = data.length;\n if (normalizedEncoding === \"hex\" && length % 2 !== 0)\n throw new ERR_INVALID_ARG_VALUE2(\"encoding\", encoding, `is invalid for data of length ${length}`);\n }\n function validatePort(port, name = \"Port\", allowZero = !0) {\n if (typeof port !== \"number\" && typeof port !== \"string\" || typeof port === \"string\" && StringPrototypeTrim(port).length === 0 || +port !== +port >>> 0 || port > 65535 || port === 0 && !allowZero)\n throw new ERR_SOCKET_BAD_PORT(name, port, allowZero);\n return port | 0;\n }\n var validateAbortSignal = hideStackFrames((signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE2(name, \"AbortSignal\", signal);\n }), validateFunction = hideStackFrames((value, name) => {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"Function\", value);\n }), validatePlainFunction = hideStackFrames((value, name) => {\n if (typeof value !== \"function\" || isAsyncFunction(value))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Function\", value);\n }), validateUndefined = hideStackFrames((value, name) => {\n if (value !== void 0)\n throw new ERR_INVALID_ARG_TYPE2(name, \"undefined\", value);\n });\n module.exports = {\n isInt32,\n isUint32,\n parseFileMode,\n validateArray,\n validateBoolean: validateBoolean2,\n validateBuffer,\n validateEncoding,\n validateFunction,\n validateInt32,\n validateInteger,\n validateNumber,\n validateObject,\n validateOneOf,\n validatePlainFunction,\n validatePort,\n validateSignalName,\n validateString,\n validateUint32,\n validateUndefined,\n validateAbortSignal\n };\n }\n}), require_utils = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/utils.js\"(exports, module) {\n var { Symbol: Symbol2, SymbolAsyncIterator, SymbolIterator } = require_primordials(), kDestroyed = Symbol2(\"kDestroyed\"), kIsErrored = Symbol2(\"kIsErrored\"), kIsReadable = Symbol2(\"kIsReadable\"), kIsDisturbed = Symbol2(\"kIsDisturbed\");\n function isReadableNodeStream(obj, strict = !1) {\n var _obj$_readableState;\n return !!(obj && typeof obj.pipe === \"function\" && typeof obj.on === \"function\" && (!strict || typeof obj.pause === \"function\" && typeof obj.resume === \"function\") && (!obj._writableState || ((_obj$_readableState = obj._readableState) === null || _obj$_readableState === void 0 \? void 0 : _obj$_readableState.readable) !== !1) && (!obj._writableState || obj._readableState));\n }\n function isWritableNodeStream(obj) {\n var _obj$_writableState;\n return !!(obj && typeof obj.write === \"function\" && typeof obj.on === \"function\" && (!obj._readableState || ((_obj$_writableState = obj._writableState) === null || _obj$_writableState === void 0 \? void 0 : _obj$_writableState.writable) !== !1));\n }\n function isDuplexNodeStream(obj) {\n return !!(obj && typeof obj.pipe === \"function\" && obj._readableState && typeof obj.on === \"function\" && typeof obj.write === \"function\");\n }\n function isNodeStream(obj) {\n return obj && (obj._readableState || obj._writableState || typeof obj.write === \"function\" && typeof obj.on === \"function\" || typeof obj.pipe === \"function\" && typeof obj.on === \"function\");\n }\n function isIterable(obj, isAsync) {\n if (obj == null)\n return !1;\n if (isAsync === !0)\n return typeof obj[SymbolAsyncIterator] === \"function\";\n if (isAsync === !1)\n return typeof obj[SymbolIterator] === \"function\";\n return typeof obj[SymbolAsyncIterator] === \"function\" || typeof obj[SymbolIterator] === \"function\";\n }\n function isDestroyed(stream) {\n if (!isNodeStream(stream))\n return null;\n const { _writableState: wState, _readableState: rState } = stream, state = wState || rState;\n return !!(stream.destroyed || stream[kDestroyed] || state !== null && state !== void 0 && state.destroyed);\n }\n function isWritableEnded(stream) {\n if (!isWritableNodeStream(stream))\n return null;\n if (stream.writableEnded === !0)\n return !0;\n const wState = stream._writableState;\n if (wState !== null && wState !== void 0 && wState.errored)\n return !1;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.ended) !== \"boolean\")\n return null;\n return wState.ended;\n }\n function isWritableFinished(stream, strict) {\n if (!isWritableNodeStream(stream))\n return null;\n if (stream.writableFinished === !0)\n return !0;\n const wState = stream._writableState;\n if (wState !== null && wState !== void 0 && wState.errored)\n return !1;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.finished) !== \"boolean\")\n return null;\n return !!(wState.finished || strict === !1 && wState.ended === !0 && wState.length === 0);\n }\n function isReadableEnded(stream) {\n if (!isReadableNodeStream(stream))\n return null;\n if (stream.readableEnded === !0)\n return !0;\n const rState = stream._readableState;\n if (!rState || rState.errored)\n return !1;\n if (typeof (rState === null || rState === void 0 \? void 0 : rState.ended) !== \"boolean\")\n return null;\n return rState.ended;\n }\n function isReadableFinished(stream, strict) {\n if (!isReadableNodeStream(stream))\n return null;\n const rState = stream._readableState;\n if (rState !== null && rState !== void 0 && rState.errored)\n return !1;\n if (typeof (rState === null || rState === void 0 \? void 0 : rState.endEmitted) !== \"boolean\")\n return null;\n return !!(rState.endEmitted || strict === !1 && rState.ended === !0 && rState.length === 0);\n }\n function isReadable(stream) {\n if (stream && stream[kIsReadable] != null)\n return stream[kIsReadable];\n if (typeof (stream === null || stream === void 0 \? void 0 : stream.readable) !== \"boolean\")\n return null;\n if (isDestroyed(stream))\n return !1;\n return isReadableNodeStream(stream) && stream.readable && !isReadableFinished(stream);\n }\n function isWritable(stream) {\n if (typeof (stream === null || stream === void 0 \? void 0 : stream.writable) !== \"boolean\")\n return null;\n if (isDestroyed(stream))\n return !1;\n return isWritableNodeStream(stream) && stream.writable && !isWritableEnded(stream);\n }\n function isFinished(stream, opts) {\n if (!isNodeStream(stream))\n return null;\n if (isDestroyed(stream))\n return !0;\n if ((opts === null || opts === void 0 \? void 0 : opts.readable) !== !1 && isReadable(stream))\n return !1;\n if ((opts === null || opts === void 0 \? void 0 : opts.writable) !== !1 && isWritable(stream))\n return !1;\n return !0;\n }\n function isWritableErrored(stream) {\n var _stream$_writableStat, _stream$_writableStat2;\n if (!isNodeStream(stream))\n return null;\n if (stream.writableErrored)\n return stream.writableErrored;\n return (_stream$_writableStat = (_stream$_writableStat2 = stream._writableState) === null || _stream$_writableStat2 === void 0 \? void 0 : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== void 0 \? _stream$_writableStat : null;\n }\n function isReadableErrored(stream) {\n var _stream$_readableStat, _stream$_readableStat2;\n if (!isNodeStream(stream))\n return null;\n if (stream.readableErrored)\n return stream.readableErrored;\n return (_stream$_readableStat = (_stream$_readableStat2 = stream._readableState) === null || _stream$_readableStat2 === void 0 \? void 0 : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== void 0 \? _stream$_readableStat : null;\n }\n function isClosed(stream) {\n if (!isNodeStream(stream))\n return null;\n if (typeof stream.closed === \"boolean\")\n return stream.closed;\n const { _writableState: wState, _readableState: rState } = stream;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.closed) === \"boolean\" || typeof (rState === null || rState === void 0 \? void 0 : rState.closed) === \"boolean\")\n return (wState === null || wState === void 0 \? void 0 : wState.closed) || (rState === null || rState === void 0 \? void 0 : rState.closed);\n if (typeof stream._closed === \"boolean\" && isOutgoingMessage(stream))\n return stream._closed;\n return null;\n }\n function isOutgoingMessage(stream) {\n return typeof stream._closed === \"boolean\" && typeof stream._defaultKeepAlive === \"boolean\" && typeof stream._removedConnection === \"boolean\" && typeof stream._removedContLen === \"boolean\";\n }\n function isServerResponse(stream) {\n return typeof stream._sent100 === \"boolean\" && isOutgoingMessage(stream);\n }\n function isServerRequest(stream) {\n var _stream$req;\n return typeof stream._consuming === \"boolean\" && typeof stream._dumped === \"boolean\" && ((_stream$req = stream.req) === null || _stream$req === void 0 \? void 0 : _stream$req.upgradeOrConnect) === void 0;\n }\n function willEmitClose(stream) {\n if (!isNodeStream(stream))\n return null;\n const { _writableState: wState, _readableState: rState } = stream, state = wState || rState;\n return !state && isServerResponse(stream) || !!(state && state.autoDestroy && state.emitClose && state.closed === !1);\n }\n function isDisturbed(stream) {\n var _stream$kIsDisturbed;\n return !!(stream && ((_stream$kIsDisturbed = stream[kIsDisturbed]) !== null && _stream$kIsDisturbed !== void 0 \? _stream$kIsDisturbed : stream.readableDidRead || stream.readableAborted));\n }\n function isErrored(stream) {\n var _ref, _ref2, _ref3, _ref4, _ref5, _stream$kIsErrored, _stream$_readableStat3, _stream$_writableStat3, _stream$_readableStat4, _stream$_writableStat4;\n return !!(stream && ((_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_stream$kIsErrored = stream[kIsErrored]) !== null && _stream$kIsErrored !== void 0 \? _stream$kIsErrored : stream.readableErrored) !== null && _ref5 !== void 0 \? _ref5 : stream.writableErrored) !== null && _ref4 !== void 0 \? _ref4 : (_stream$_readableStat3 = stream._readableState) === null || _stream$_readableStat3 === void 0 \? void 0 : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== void 0 \? _ref3 : (_stream$_writableStat3 = stream._writableState) === null || _stream$_writableStat3 === void 0 \? void 0 : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== void 0 \? _ref2 : (_stream$_readableStat4 = stream._readableState) === null || _stream$_readableStat4 === void 0 \? void 0 : _stream$_readableStat4.errored) !== null && _ref !== void 0 \? _ref : (_stream$_writableStat4 = stream._writableState) === null || _stream$_writableStat4 === void 0 \? void 0 : _stream$_writableStat4.errored));\n }\n module.exports = {\n kDestroyed,\n isDisturbed,\n kIsDisturbed,\n isErrored,\n kIsErrored,\n isReadable,\n kIsReadable,\n isClosed,\n isDestroyed,\n isDuplexNodeStream,\n isFinished,\n isIterable,\n isReadableNodeStream,\n isReadableEnded,\n isReadableFinished,\n isReadableErrored,\n isNodeStream,\n isWritable,\n isWritableNodeStream,\n isWritableEnded,\n isWritableFinished,\n isWritableErrored,\n isServerRequest,\n isServerResponse,\n willEmitClose\n };\n }\n}), require_end_of_stream = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/end-of-stream.js\"(exports, module) {\n var { AbortError: AbortError2, codes } = require_errors(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_PREMATURE_CLOSE } = codes, { once } = require_util(), { validateAbortSignal, validateFunction, validateObject } = require_validators(), { Promise: Promise2 } = require_primordials(), {\n isClosed,\n isReadable,\n isReadableNodeStream,\n isReadableFinished,\n isReadableErrored,\n isWritable,\n isWritableNodeStream,\n isWritableFinished,\n isWritableErrored,\n isNodeStream,\n willEmitClose: _willEmitClose\n } = require_utils();\n function isRequest(stream) {\n return stream.setHeader && typeof stream.abort === \"function\";\n }\n var nop = () => {\n };\n function eos(stream, options, callback) {\n var _options$readable, _options$writable;\n if (arguments.length === 2)\n callback = options, options = {};\n else if (options == null)\n options = {};\n else\n validateObject(options, \"options\");\n validateFunction(callback, \"callback\"), validateAbortSignal(options.signal, \"options.signal\"), callback = once(callback);\n const readable = (_options$readable = options.readable) !== null && _options$readable !== void 0 \? _options$readable : isReadableNodeStream(stream), writable = (_options$writable = options.writable) !== null && _options$writable !== void 0 \? _options$writable : isWritableNodeStream(stream);\n if (!isNodeStream(stream))\n throw new ERR_INVALID_ARG_TYPE2(\"stream\", \"Stream\", stream);\n const { _writableState: wState, _readableState: rState } = stream, onlegacyfinish = () => {\n if (!stream.writable)\n onfinish();\n };\n let willEmitClose = _willEmitClose(stream) && isReadableNodeStream(stream) === readable && isWritableNodeStream(stream) === writable, writableFinished = isWritableFinished(stream, !1);\n const onfinish = () => {\n if (writableFinished = !0, stream.destroyed)\n willEmitClose = !1;\n if (willEmitClose && (!stream.readable || readable))\n return;\n if (!readable || readableFinished)\n callback.call(stream);\n };\n let readableFinished = isReadableFinished(stream, !1);\n const onend = () => {\n if (readableFinished = !0, stream.destroyed)\n willEmitClose = !1;\n if (willEmitClose && (!stream.writable || writable))\n return;\n if (!writable || writableFinished)\n callback.call(stream);\n }, onerror = (err) => {\n callback.call(stream, err);\n };\n let closed = isClosed(stream);\n const onclose = () => {\n closed = !0;\n const errored = isWritableErrored(stream) || isReadableErrored(stream);\n if (errored && typeof errored !== \"boolean\")\n return callback.call(stream, errored);\n if (readable && !readableFinished && isReadableNodeStream(stream, !0)) {\n if (!isReadableFinished(stream, !1))\n return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE);\n }\n if (writable && !writableFinished) {\n if (!isWritableFinished(stream, !1))\n return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE);\n }\n callback.call(stream);\n }, onrequest = () => {\n stream.req.on(\"finish\", onfinish);\n };\n if (isRequest(stream)) {\n if (stream.on(\"complete\", onfinish), !willEmitClose)\n stream.on(\"abort\", onclose);\n if (stream.req)\n onrequest();\n else\n stream.on(\"request\", onrequest);\n } else if (writable && !wState)\n stream.on(\"end\", onlegacyfinish), stream.on(\"close\", onlegacyfinish);\n if (!willEmitClose && typeof stream.aborted === \"boolean\")\n stream.on(\"aborted\", onclose);\n if (stream.on(\"end\", onend), stream.on(\"finish\", onfinish), options.error !== !1)\n stream.on(\"error\", onerror);\n if (stream.on(\"close\", onclose), closed)\n runOnNextTick(onclose);\n else if (wState !== null && wState !== void 0 && wState.errorEmitted || rState !== null && rState !== void 0 && rState.errorEmitted) {\n if (!willEmitClose)\n runOnNextTick(onclose);\n } else if (!readable && (!willEmitClose || isReadable(stream)) && (writableFinished || isWritable(stream) === !1))\n runOnNextTick(onclose);\n else if (!writable && (!willEmitClose || isWritable(stream)) && (readableFinished || isReadable(stream) === !1))\n runOnNextTick(onclose);\n else if (rState && stream.req && stream.aborted)\n runOnNextTick(onclose);\n const cleanup = () => {\n if (callback = nop, stream.removeListener(\"aborted\", onclose), stream.removeListener(\"complete\", onfinish), stream.removeListener(\"abort\", onclose), stream.removeListener(\"request\", onrequest), stream.req)\n stream.req.removeListener(\"finish\", onfinish);\n stream.removeListener(\"end\", onlegacyfinish), stream.removeListener(\"close\", onlegacyfinish), stream.removeListener(\"finish\", onfinish), stream.removeListener(\"end\", onend), stream.removeListener(\"error\", onerror), stream.removeListener(\"close\", onclose);\n };\n if (options.signal && !closed) {\n const abort = () => {\n const endCallback = callback;\n cleanup(), endCallback.call(stream, new AbortError2(void 0, {\n cause: options.signal.reason\n }));\n };\n if (options.signal.aborted)\n runOnNextTick(abort);\n else {\n const originalCallback = callback;\n callback = once((...args) => {\n options.signal.removeEventListener(\"abort\", abort), originalCallback.apply(stream, args);\n }), options.signal.addEventListener(\"abort\", abort);\n }\n }\n return cleanup;\n }\n function finished(stream, opts) {\n return new Promise2((resolve, reject) => {\n eos(stream, opts, (err) => {\n if (err)\n reject(err);\n else\n resolve();\n });\n });\n }\n module.exports = eos, module.exports.finished = finished;\n }\n}), require_operators = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/operators.js\"(exports, module) {\n var {\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_MISSING_ARGS, ERR_OUT_OF_RANGE },\n AbortError: AbortError2\n } = require_errors(), { validateAbortSignal, validateInteger, validateObject } = require_validators(), kWeakHandler = require_primordials().Symbol(\"kWeak\"), { finished } = require_end_of_stream(), {\n ArrayPrototypePush,\n MathFloor,\n Number: Number2,\n NumberIsNaN,\n Promise: Promise2,\n PromiseReject,\n PromisePrototypeCatch,\n Symbol: Symbol2\n } = require_primordials(), kEmpty = Symbol2(\"kEmpty\"), kEof = Symbol2(\"kEof\");\n function map(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n let concurrency = 1;\n if ((options === null || options === void 0 \? void 0 : options.concurrency) != null)\n concurrency = MathFloor(options.concurrency);\n return validateInteger(concurrency, \"concurrency\", 1), async function* map2() {\n var _options$signal, _options$signal2;\n const ac = new AbortController, stream = this, queue = [], signal = ac.signal, signalOpt = {\n signal\n }, abort = () => ac.abort();\n if (options !== null && options !== void 0 && (_options$signal = options.signal) !== null && _options$signal !== void 0 && _options$signal.aborted)\n abort();\n options === null || options === void 0 || (_options$signal2 = options.signal) === null || _options$signal2 === void 0 || _options$signal2.addEventListener(\"abort\", abort);\n let next, resume, done = !1;\n function onDone() {\n done = !0;\n }\n async function pump() {\n try {\n for await (let val of stream) {\n var _val;\n if (done)\n return;\n if (signal.aborted)\n throw new AbortError2;\n try {\n val = fn(val, signalOpt);\n } catch (err) {\n val = PromiseReject(err);\n }\n if (val === kEmpty)\n continue;\n if (typeof ((_val = val) === null || _val === void 0 \? void 0 : _val.catch) === \"function\")\n val.catch(onDone);\n if (queue.push(val), next)\n next(), next = null;\n if (!done && queue.length && queue.length >= concurrency)\n await new Promise2((resolve) => {\n resume = resolve;\n });\n }\n queue.push(kEof);\n } catch (err) {\n const val = PromiseReject(err);\n PromisePrototypeCatch(val, onDone), queue.push(val);\n } finally {\n var _options$signal3;\n if (done = !0, next)\n next(), next = null;\n options === null || options === void 0 || (_options$signal3 = options.signal) === null || _options$signal3 === void 0 || _options$signal3.removeEventListener(\"abort\", abort);\n }\n }\n pump();\n try {\n while (!0) {\n while (queue.length > 0) {\n const val = await queue[0];\n if (val === kEof)\n return;\n if (signal.aborted)\n throw new AbortError2;\n if (val !== kEmpty)\n yield val;\n if (queue.shift(), resume)\n resume(), resume = null;\n }\n await new Promise2((resolve) => {\n next = resolve;\n });\n }\n } finally {\n if (ac.abort(), done = !0, resume)\n resume(), resume = null;\n }\n }.call(this);\n }\n function asIndexedPairs(options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return async function* asIndexedPairs2() {\n let index = 0;\n for await (let val of this) {\n var _options$signal4;\n if (options !== null && options !== void 0 && (_options$signal4 = options.signal) !== null && _options$signal4 !== void 0 && _options$signal4.aborted)\n throw new AbortError2({\n cause: options.signal.reason\n });\n yield [index++, val];\n }\n }.call(this);\n }\n async function some(fn, options = void 0) {\n for await (let unused of filter.call(this, fn, options))\n return !0;\n return !1;\n }\n async function every(fn, options = void 0) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n return !await some.call(this, async (...args) => {\n return !await fn(...args);\n }, options);\n }\n async function find(fn, options) {\n for await (let result of filter.call(this, fn, options))\n return result;\n return;\n }\n async function forEach(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n async function forEachFn(value, options2) {\n return await fn(value, options2), kEmpty;\n }\n for await (let unused of map.call(this, forEachFn, options))\n ;\n }\n function filter(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n async function filterFn(value, options2) {\n if (await fn(value, options2))\n return value;\n return kEmpty;\n }\n return map.call(this, filterFn, options);\n }\n var ReduceAwareErrMissingArgs = class extends ERR_MISSING_ARGS {\n constructor() {\n super(\"reduce\");\n this.message = \"Reduce of an empty stream requires an initial value\";\n }\n };\n async function reduce(reducer, initialValue, options) {\n var _options$signal5;\n if (typeof reducer !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"reducer\", [\"Function\", \"AsyncFunction\"], reducer);\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n let hasInitialValue = arguments.length > 1;\n if (options !== null && options !== void 0 && (_options$signal5 = options.signal) !== null && _options$signal5 !== void 0 && _options$signal5.aborted) {\n const err = new AbortError2(void 0, {\n cause: options.signal.reason\n });\n throw this.once(\"error\", () => {\n }), await finished(this.destroy(err)), err;\n }\n const ac = new AbortController, signal = ac.signal;\n if (options !== null && options !== void 0 && options.signal) {\n const opts = {\n once: !0,\n [kWeakHandler]: this\n };\n options.signal.addEventListener(\"abort\", () => ac.abort(), opts);\n }\n let gotAnyItemFromStream = !1;\n try {\n for await (let value of this) {\n var _options$signal6;\n if (gotAnyItemFromStream = !0, options !== null && options !== void 0 && (_options$signal6 = options.signal) !== null && _options$signal6 !== void 0 && _options$signal6.aborted)\n throw new AbortError2;\n if (!hasInitialValue)\n initialValue = value, hasInitialValue = !0;\n else\n initialValue = await reducer(initialValue, value, {\n signal\n });\n }\n if (!gotAnyItemFromStream && !hasInitialValue)\n throw new ReduceAwareErrMissingArgs;\n } finally {\n ac.abort();\n }\n return initialValue;\n }\n async function toArray(options) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n const result = [];\n for await (let val of this) {\n var _options$signal7;\n if (options !== null && options !== void 0 && (_options$signal7 = options.signal) !== null && _options$signal7 !== void 0 && _options$signal7.aborted)\n throw new AbortError2(void 0, {\n cause: options.signal.reason\n });\n ArrayPrototypePush(result, val);\n }\n return result;\n }\n function flatMap(fn, options) {\n const values = map.call(this, fn, options);\n return async function* flatMap2() {\n for await (let val of values)\n yield* val;\n }.call(this);\n }\n function toIntegerOrInfinity(number) {\n if (number = Number2(number), NumberIsNaN(number))\n return 0;\n if (number < 0)\n throw new ERR_OUT_OF_RANGE(\"number\", \">= 0\", number);\n return number;\n }\n function drop(number, options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return number = toIntegerOrInfinity(number), async function* drop2() {\n var _options$signal8;\n if (options !== null && options !== void 0 && (_options$signal8 = options.signal) !== null && _options$signal8 !== void 0 && _options$signal8.aborted)\n throw new AbortError2;\n for await (let val of this) {\n var _options$signal9;\n if (options !== null && options !== void 0 && (_options$signal9 = options.signal) !== null && _options$signal9 !== void 0 && _options$signal9.aborted)\n throw new AbortError2;\n if (number-- <= 0)\n yield val;\n }\n }.call(this);\n }\n function take(number, options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return number = toIntegerOrInfinity(number), async function* take2() {\n var _options$signal10;\n if (options !== null && options !== void 0 && (_options$signal10 = options.signal) !== null && _options$signal10 !== void 0 && _options$signal10.aborted)\n throw new AbortError2;\n for await (let val of this) {\n var _options$signal11;\n if (options !== null && options !== void 0 && (_options$signal11 = options.signal) !== null && _options$signal11 !== void 0 && _options$signal11.aborted)\n throw new AbortError2;\n if (number-- > 0)\n yield val;\n else\n return;\n }\n }.call(this);\n }\n module.exports.streamReturningOperators = {\n asIndexedPairs,\n drop,\n filter,\n flatMap,\n map,\n take\n }, module.exports.promiseReturningOperators = {\n every,\n forEach,\n reduce,\n toArray,\n some,\n find\n };\n }\n}), require_destroy = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/destroy.js\"(exports, module) {\n var {\n aggregateTwoErrors,\n codes: { ERR_MULTIPLE_CALLBACK },\n AbortError: AbortError2\n } = require_errors(), { Symbol: Symbol2 } = require_primordials(), { kDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils(), kDestroy = \"#kDestroy\", kConstruct = \"#kConstruct\";\n function checkError(err, w, r) {\n if (err) {\n if (err.stack, w && !w.errored)\n w.errored = err;\n if (r && !r.errored)\n r.errored = err;\n }\n }\n function destroy2(err, cb) {\n const r = this._readableState, w = this._writableState, s = w || r;\n if (w && w.destroyed || r && r.destroyed) {\n if (typeof cb === \"function\")\n cb();\n return this;\n }\n if (checkError(err, w, r), w)\n w.destroyed = !0;\n if (r)\n r.destroyed = !0;\n if (!s.constructed)\n this.once(kDestroy, (er) => {\n _destroy(this, aggregateTwoErrors(er, err), cb);\n });\n else\n _destroy(this, err, cb);\n return this;\n }\n function _destroy(self, err, cb) {\n let called = !1;\n function onDestroy(err2) {\n if (called)\n return;\n called = !0;\n const { _readableState: r, _writableState: w } = self;\n if (checkError(err2, w, r), w)\n w.closed = !0;\n if (r)\n r.closed = !0;\n if (typeof cb === \"function\")\n cb(err2);\n if (err2)\n runOnNextTick(emitErrorCloseNT, self, err2);\n else\n runOnNextTick(emitCloseNT, self);\n }\n try {\n self._destroy(err || null, onDestroy);\n } catch (err2) {\n onDestroy(err2);\n }\n }\n function emitErrorCloseNT(self, err) {\n emitErrorNT(self, err), emitCloseNT(self);\n }\n function emitCloseNT(self) {\n const { _readableState: r, _writableState: w } = self;\n if (w)\n w.closeEmitted = !0;\n if (r)\n r.closeEmitted = !0;\n if (w && w.emitClose || r && r.emitClose)\n self.emit(\"close\");\n }\n function emitErrorNT(self, err) {\n const r = self\?._readableState, w = self\?._writableState;\n if (w\?.errorEmitted || r\?.errorEmitted)\n return;\n if (w)\n w.errorEmitted = !0;\n if (r)\n r.errorEmitted = !0;\n self\?.emit\?.(\"error\", err);\n }\n function undestroy() {\n const r = this._readableState, w = this._writableState;\n if (r)\n r.constructed = !0, r.closed = !1, r.closeEmitted = !1, r.destroyed = !1, r.errored = null, r.errorEmitted = !1, r.reading = !1, r.ended = r.readable === !1, r.endEmitted = r.readable === !1;\n if (w)\n w.constructed = !0, w.destroyed = !1, w.closed = !1, w.closeEmitted = !1, w.errored = null, w.errorEmitted = !1, w.finalCalled = !1, w.prefinished = !1, w.ended = w.writable === !1, w.ending = w.writable === !1, w.finished = w.writable === !1;\n }\n function errorOrDestroy2(stream, err, sync) {\n const r = stream\?._readableState, w = stream\?._writableState;\n if (w && w.destroyed || r && r.destroyed)\n return this;\n if (r && r.autoDestroy || w && w.autoDestroy)\n stream.destroy(err);\n else if (err) {\n if (Error.captureStackTrace(err), w && !w.errored)\n w.errored = err;\n if (r && !r.errored)\n r.errored = err;\n if (sync)\n runOnNextTick(emitErrorNT, stream, err);\n else\n emitErrorNT(stream, err);\n }\n }\n function construct(stream, cb) {\n if (typeof stream._construct !== \"function\")\n return;\n const { _readableState: r, _writableState: w } = stream;\n if (r)\n r.constructed = !1;\n if (w)\n w.constructed = !1;\n if (stream.once(kConstruct, cb), stream.listenerCount(kConstruct) > 1)\n return;\n runOnNextTick(constructNT, stream);\n }\n function constructNT(stream) {\n let called = !1;\n function onConstruct(err) {\n if (called) {\n errorOrDestroy2(stream, err !== null && err !== void 0 \? err : new ERR_MULTIPLE_CALLBACK);\n return;\n }\n called = !0;\n const { _readableState: r, _writableState: w } = stream, s = w || r;\n if (r)\n r.constructed = !0;\n if (w)\n w.constructed = !0;\n if (s.destroyed)\n stream.emit(kDestroy, err);\n else if (err)\n errorOrDestroy2(stream, err, !0);\n else\n runOnNextTick(emitConstructNT, stream);\n }\n try {\n stream._construct(onConstruct);\n } catch (err) {\n onConstruct(err);\n }\n }\n function emitConstructNT(stream) {\n stream.emit(kConstruct);\n }\n function isRequest(stream) {\n return stream && stream.setHeader && typeof stream.abort === \"function\";\n }\n function emitCloseLegacy(stream) {\n stream.emit(\"close\");\n }\n function emitErrorCloseLegacy(stream, err) {\n stream.emit(\"error\", err), runOnNextTick(emitCloseLegacy, stream);\n }\n function destroyer(stream, err) {\n if (!stream || isDestroyed(stream))\n return;\n if (!err && !isFinished(stream))\n err = new AbortError2;\n if (isServerRequest(stream))\n stream.socket = null, stream.destroy(err);\n else if (isRequest(stream))\n stream.abort();\n else if (isRequest(stream.req))\n stream.req.abort();\n else if (typeof stream.destroy === \"function\")\n stream.destroy(err);\n else if (typeof stream.close === \"function\")\n stream.close();\n else if (err)\n runOnNextTick(emitErrorCloseLegacy, stream);\n else\n runOnNextTick(emitCloseLegacy, stream);\n if (!stream.destroyed)\n stream[kDestroyed] = !0;\n }\n module.exports = {\n construct,\n destroyer,\n destroy: destroy2,\n undestroy,\n errorOrDestroy: errorOrDestroy2\n };\n }\n}), require_legacy = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/legacy.js\"(exports, module) {\n var { ArrayIsArray: ArrayIsArray2, ObjectSetPrototypeOf } = require_primordials();\n function Stream(options) {\n if (!(this instanceof Stream))\n return new Stream(options);\n EE.call(this, options);\n }\n Stream.prototype = {}, ObjectSetPrototypeOf(Stream.prototype, EE.prototype), ObjectSetPrototypeOf(Stream, EE), Stream.prototype.pipe = function(dest, options) {\n const source = this;\n function ondata(chunk) {\n if (dest.writable && dest.write(chunk) === !1 && source.pause)\n source.pause();\n }\n source.on(\"data\", ondata);\n function ondrain() {\n if (source.readable && source.resume)\n source.resume();\n }\n if (dest.on(\"drain\", ondrain), !dest._isStdio && (!options || options.end !== !1))\n source.on(\"end\", onend), source.on(\"close\", onclose);\n let didOnEnd = !1;\n function onend() {\n if (didOnEnd)\n return;\n didOnEnd = !0, dest.end();\n }\n function onclose() {\n if (didOnEnd)\n return;\n if (didOnEnd = !0, typeof dest.destroy === \"function\")\n dest.destroy();\n }\n function onerror(er) {\n if (cleanup(), EE.listenerCount(this, \"error\") === 0)\n this.emit(\"error\", er);\n }\n prependListener(source, \"error\", onerror), prependListener(dest, \"error\", onerror);\n function cleanup() {\n source.removeListener(\"data\", ondata), dest.removeListener(\"drain\", ondrain), source.removeListener(\"end\", onend), source.removeListener(\"close\", onclose), source.removeListener(\"error\", onerror), dest.removeListener(\"error\", onerror), source.removeListener(\"end\", cleanup), source.removeListener(\"close\", cleanup), dest.removeListener(\"close\", cleanup);\n }\n return source.on(\"end\", cleanup), source.on(\"close\", cleanup), dest.on(\"close\", cleanup), dest.emit(\"pipe\", source), dest;\n };\n function prependListener(emitter, event, fn) {\n if (typeof emitter.prependListener === \"function\")\n return emitter.prependListener(event, fn);\n if (!emitter._events || !emitter._events[event])\n emitter.on(event, fn);\n else if (ArrayIsArray2(emitter._events[event]))\n emitter._events[event].unshift(fn);\n else\n emitter._events[event] = [fn, emitter._events[event]];\n }\n module.exports = {\n Stream,\n prependListener\n };\n }\n}), require_add_abort_signal = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/add-abort-signal.js\"(exports, module) {\n var { AbortError: AbortError2, codes } = require_errors(), eos = require_end_of_stream(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2 } = codes, validateAbortSignal = (signal, name) => {\n if (typeof signal !== \"object\" || !(\"aborted\" in signal))\n throw new ERR_INVALID_ARG_TYPE2(name, \"AbortSignal\", signal);\n };\n function isNodeStream(obj) {\n return !!(obj && typeof obj.pipe === \"function\");\n }\n module.exports.addAbortSignal = function addAbortSignal(signal, stream) {\n if (validateAbortSignal(signal, \"signal\"), !isNodeStream(stream))\n throw new ERR_INVALID_ARG_TYPE2(\"stream\", \"stream.Stream\", stream);\n return module.exports.addAbortSignalNoValidate(signal, stream);\n }, module.exports.addAbortSignalNoValidate = function(signal, stream) {\n if (typeof signal !== \"object\" || !(\"aborted\" in signal))\n return stream;\n const onAbort = () => {\n stream.destroy(new AbortError2(void 0, {\n cause: signal.reason\n }));\n };\n if (signal.aborted)\n onAbort();\n else\n signal.addEventListener(\"abort\", onAbort), eos(stream, () => signal.removeEventListener(\"abort\", onAbort));\n return stream;\n };\n }\n}), require_state = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/state.js\"(exports, module) {\n var { MathFloor, NumberIsInteger } = require_primordials(), { ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2 } = require_errors().codes;\n function highWaterMarkFrom(options, isDuplex, duplexKey) {\n return options.highWaterMark != null \? options.highWaterMark : isDuplex \? options[duplexKey] : null;\n }\n function getDefaultHighWaterMark(objectMode) {\n return objectMode \? 16 : 16384;\n }\n function getHighWaterMark(state, options, duplexKey, isDuplex) {\n const hwm = highWaterMarkFrom(options, isDuplex, duplexKey);\n if (hwm != null) {\n if (!NumberIsInteger(hwm) || hwm < 0) {\n const name = isDuplex \? `options.${duplexKey}` : \"options.highWaterMark\";\n throw new ERR_INVALID_ARG_VALUE2(name, hwm);\n }\n return MathFloor(hwm);\n }\n return getDefaultHighWaterMark(state.objectMode);\n }\n module.exports = {\n getHighWaterMark,\n getDefaultHighWaterMark\n };\n }\n}), require_from = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/from.js\"(exports, module) {\n var { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_NULL_VALUES } = require_errors().codes;\n function from(Readable, iterable, opts) {\n let iterator;\n if (typeof iterable === \"string\" || iterable instanceof Buffer)\n return new Readable({\n objectMode: !0,\n ...opts,\n read() {\n this.push(iterable), this.push(null);\n }\n });\n let isAsync;\n if (iterable && iterable[SymbolAsyncIterator])\n isAsync = !0, iterator = iterable[SymbolAsyncIterator]();\n else if (iterable && iterable[SymbolIterator])\n isAsync = !1, iterator = iterable[SymbolIterator]();\n else\n throw new ERR_INVALID_ARG_TYPE2(\"iterable\", [\"Iterable\"], iterable);\n const readable = new Readable({\n objectMode: !0,\n highWaterMark: 1,\n ...opts\n });\n let reading = !1;\n readable._read = function() {\n if (!reading)\n reading = !0, next();\n }, readable._destroy = function(error, cb) {\n PromisePrototypeThen(close(error), () => runOnNextTick(cb, error), (e) => runOnNextTick(cb, e || error));\n };\n async function close(error) {\n const hadError = error !== void 0 && error !== null, hasThrow = typeof iterator.throw === \"function\";\n if (hadError && hasThrow) {\n const { value, done } = await iterator.throw(error);\n if (await value, done)\n return;\n }\n if (typeof iterator.return === \"function\") {\n const { value } = await iterator.return();\n await value;\n }\n }\n async function next() {\n for (;; ) {\n try {\n const { value, done } = isAsync \? await iterator.next() : iterator.next();\n if (done)\n readable.push(null);\n else {\n const res = value && typeof value.then === \"function\" \? await value : value;\n if (res === null)\n throw reading = !1, new ERR_STREAM_NULL_VALUES;\n else if (readable.push(res))\n continue;\n else\n reading = !1;\n }\n } catch (err) {\n readable.destroy(err);\n }\n break;\n }\n }\n return readable;\n }\n module.exports = from;\n }\n}), _ReadableFromWeb, _ReadableFromWebForUndici, require_readable = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/readable.js\"(exports, module) {\n var {\n ArrayPrototypeIndexOf,\n NumberIsInteger,\n NumberIsNaN,\n NumberParseInt,\n ObjectDefineProperties,\n ObjectKeys,\n ObjectSetPrototypeOf,\n Promise: Promise2,\n SafeSet,\n SymbolAsyncIterator,\n Symbol: Symbol2\n } = require_primordials(), ReadableState = globalThis[globalThis.Symbol.for('Bun.lazy')](\"bun:stream\").ReadableState, { Stream, prependListener } = require_legacy();\n function Readable(options) {\n if (!(this instanceof Readable))\n return new Readable(options);\n const isDuplex = this instanceof require_duplex();\n if (this._readableState = new ReadableState(options, this, isDuplex), options) {\n const { read, destroy: destroy2, construct, signal } = options;\n if (typeof read === \"function\")\n this._read = read;\n if (typeof destroy2 === \"function\")\n this._destroy = destroy2;\n if (typeof construct === \"function\")\n this._construct = construct;\n if (signal && !isDuplex)\n addAbortSignal(signal, this);\n }\n Stream.call(this, options), destroyImpl.construct(this, () => {\n if (this._readableState.needReadable)\n maybeReadMore(this, this._readableState);\n });\n }\n Readable.prototype = {}, ObjectSetPrototypeOf(Readable.prototype, Stream.prototype), ObjectSetPrototypeOf(Readable, Stream), Readable.prototype.on = function(ev, fn) {\n const res = Stream.prototype.on.call(this, ev, fn), state = this._readableState;\n if (ev === \"data\") {\n if (state.readableListening = this.listenerCount(\"readable\") > 0, state.flowing !== !1)\n this.resume();\n } else if (ev === \"readable\") {\n if (!state.endEmitted && !state.readableListening) {\n if (state.readableListening = state.needReadable = !0, state.flowing = !1, state.emittedReadable = !1, state.length)\n emitReadable(this, state);\n else if (!state.reading)\n runOnNextTick(nReadingNextTick, this);\n } else if (state.endEmitted)\n ;\n }\n return res;\n };\n\n class ReadableFromWeb extends Readable {\n #reader;\n #closed;\n #pendingChunks;\n #stream;\n constructor(options, stream) {\n const { objectMode, highWaterMark, encoding, signal } = options;\n super({\n objectMode,\n highWaterMark,\n encoding,\n signal\n });\n this.#pendingChunks = [], this.#reader = void 0, this.#stream = stream, this.#closed = !1;\n }\n #drainPending() {\n var pendingChunks = this.#pendingChunks, pendingChunksI = 0, pendingChunksCount = pendingChunks.length;\n for (;pendingChunksI < pendingChunksCount; pendingChunksI++) {\n const chunk = pendingChunks[pendingChunksI];\n if (pendingChunks[pendingChunksI] = void 0, !this.push(chunk, void 0))\n return this.#pendingChunks = pendingChunks.slice(pendingChunksI + 1), !0;\n }\n if (pendingChunksCount > 0)\n this.#pendingChunks = [];\n return !1;\n }\n #handleDone(reader) {\n reader.releaseLock(), this.#reader = void 0, this.#closed = !0, this.push(null);\n return;\n }\n async _read() {\n var stream = this.#stream, reader = this.#reader;\n if (stream)\n reader = this.#reader = stream.getReader(), this.#stream = void 0;\n else if (this.#drainPending())\n return;\n var deferredError;\n try {\n do {\n var done = !1, value;\n const firstResult = reader.readMany();\n if (@isPromise(firstResult)) {\n if ({ done, value } = await firstResult, this.#closed) {\n this.#pendingChunks.push(...value);\n return;\n }\n } else\n ({ done, value } = firstResult);\n if (done) {\n this.#handleDone(reader);\n return;\n }\n if (!this.push(value[0])) {\n this.#pendingChunks = value.slice(1);\n return;\n }\n for (let i = 1, count = value.length;i < count; i++)\n if (!this.push(value[i])) {\n this.#pendingChunks = value.slice(i + 1);\n return;\n }\n } while (!this.#closed);\n } catch (e) {\n deferredError = e;\n } finally {\n if (deferredError)\n throw deferredError;\n }\n }\n _destroy(error, callback) {\n if (!this.#closed) {\n var reader = this.#reader;\n if (reader)\n this.#reader = void 0, reader.cancel(error).finally(() => {\n this.#closed = !0, callback(error);\n });\n return;\n }\n try {\n callback(error);\n } catch (error2) {\n globalThis.reportError(error2);\n }\n }\n }\n _ReadableFromWebForUndici = ReadableFromWeb;\n function newStreamReadableFromReadableStream(readableStream, options = {}) {\n if (!isReadableStream(readableStream))\n throw new ERR_INVALID_ARG_TYPE2(\"readableStream\", \"ReadableStream\", readableStream);\n validateObject(options, \"options\");\n const {\n highWaterMark,\n encoding,\n objectMode = !1,\n signal\n } = options;\n if (encoding !== void 0 && !Buffer.isEncoding(encoding))\n throw new ERR_INVALID_ARG_VALUE(encoding, \"options.encoding\");\n return validateBoolean(objectMode, \"options.objectMode\"), getNativeReadableStream(Readable, readableStream, options) || new ReadableFromWeb({\n highWaterMark,\n encoding,\n objectMode,\n signal\n }, readableStream);\n }\n module.exports = Readable, _ReadableFromWeb = newStreamReadableFromReadableStream;\n var { addAbortSignal } = require_add_abort_signal(), eos = require_end_of_stream();\n const { maybeReadMore: _maybeReadMore, resume, emitReadable: _emitReadable, onEofChunk } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"bun:stream\");\n function maybeReadMore(stream, state) {\n process.nextTick(_maybeReadMore, stream, state);\n }\n function emitReadable(stream, state) {\n _emitReadable(stream, state);\n }\n var destroyImpl = require_destroy(), {\n aggregateTwoErrors,\n codes: {\n ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_OUT_OF_RANGE,\n ERR_STREAM_PUSH_AFTER_EOF,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT\n }\n } = require_errors(), { validateObject } = require_validators(), from = require_from(), nop = () => {\n }, { errorOrDestroy: errorOrDestroy2 } = destroyImpl;\n Readable.prototype.destroy = destroyImpl.destroy, Readable.prototype._undestroy = destroyImpl.undestroy, Readable.prototype._destroy = function(err, cb) {\n cb(err);\n }, Readable.prototype[EE.captureRejectionSymbol] = function(err) {\n this.destroy(err);\n }, Readable.prototype.push = function(chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, !1);\n }, Readable.prototype.unshift = function(chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, !0);\n };\n function readableAddChunk(stream, chunk, encoding, addToFront) {\n const state = stream._readableState;\n let err;\n if (!state.objectMode) {\n if (typeof chunk === \"string\") {\n if (encoding = encoding || state.defaultEncoding, state.encoding !== encoding)\n if (addToFront && state.encoding)\n chunk = Buffer.from(chunk, encoding).toString(state.encoding);\n else\n chunk = Buffer.from(chunk, encoding), encoding = \"\";\n } else if (chunk instanceof Buffer)\n encoding = \"\";\n else if (Stream._isUint8Array(chunk)) {\n if (addToFront || !state.decoder)\n chunk = Stream._uint8ArrayToBuffer(chunk);\n encoding = \"\";\n } else if (chunk != null)\n err = new ERR_INVALID_ARG_TYPE2(\"chunk\", [\"string\", \"Buffer\", \"Uint8Array\"], chunk);\n }\n if (err)\n errorOrDestroy2(stream, err);\n else if (chunk === null)\n state.reading = !1, onEofChunk(stream, state);\n else if (state.objectMode || chunk && chunk.length > 0)\n if (addToFront)\n if (state.endEmitted)\n errorOrDestroy2(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT);\n else if (state.destroyed || state.errored)\n return !1;\n else\n addChunk(stream, state, chunk, !0);\n else if (state.ended)\n errorOrDestroy2(stream, new ERR_STREAM_PUSH_AFTER_EOF);\n else if (state.destroyed || state.errored)\n return !1;\n else if (state.reading = !1, state.decoder && !encoding)\n if (chunk = state.decoder.write(chunk), state.objectMode || chunk.length !== 0)\n addChunk(stream, state, chunk, !1);\n else\n maybeReadMore(stream, state);\n else\n addChunk(stream, state, chunk, !1);\n else if (!addToFront)\n state.reading = !1, maybeReadMore(stream, state);\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n }\n function addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync && stream.listenerCount(\"data\") > 0) {\n if (state.multiAwaitDrain)\n state.awaitDrainWriters.clear();\n else\n state.awaitDrainWriters = null;\n state.dataEmitted = !0, stream.emit(\"data\", chunk);\n } else {\n if (state.length += state.objectMode \? 1 : chunk.length, addToFront)\n state.buffer.unshift(chunk);\n else\n state.buffer.push(chunk);\n if (state.needReadable)\n emitReadable(stream, state);\n }\n maybeReadMore(stream, state);\n }\n Readable.prototype.isPaused = function() {\n const state = this._readableState;\n return state.paused === !0 || state.flowing === !1;\n }, Readable.prototype.setEncoding = function(enc) {\n const decoder = new StringDecoder(enc);\n this._readableState.decoder = decoder, this._readableState.encoding = this._readableState.decoder.encoding;\n const buffer = this._readableState.buffer;\n let content = \"\";\n for (let i = buffer.length;i > 0; i--)\n content += decoder.write(buffer.shift());\n if (content !== \"\")\n buffer.push(content);\n return this._readableState.length = content.length, this;\n };\n var MAX_HWM = 1073741824;\n function computeNewHighWaterMark(n) {\n if (n > MAX_HWM)\n throw new ERR_OUT_OF_RANGE(\"size\", \"<= 1GiB\", n);\n else\n n--, n |= n >>> 1, n |= n >>> 2, n |= n >>> 4, n |= n >>> 8, n |= n >>> 16, n++;\n return n;\n }\n function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended)\n return 0;\n if (state.objectMode)\n return 1;\n if (NumberIsNaN(n)) {\n if (state.flowing && state.length)\n return state.buffer.first().length;\n return state.length;\n }\n if (n <= state.length)\n return n;\n return state.ended \? state.length : 0;\n }\n Readable.prototype.read = function(n) {\n if (!NumberIsInteger(n))\n n = NumberParseInt(n, 10);\n const state = this._readableState, nOrig = n;\n if (n > state.highWaterMark)\n state.highWaterMark = computeNewHighWaterMark(n);\n if (n !== 0)\n state.emittedReadable = !1;\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 \? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n if (state.length === 0 && state.ended)\n endReadable(this);\n else\n emitReadable(this, state);\n return null;\n }\n if (n = howMuchToRead(n, state), n === 0 && state.ended) {\n if (state.length === 0)\n endReadable(this);\n return null;\n }\n let doRead = state.needReadable;\n if (state.length === 0 || state.length - n < state.highWaterMark)\n doRead = !0;\n if (state.ended || state.reading || state.destroyed || state.errored || !state.constructed)\n doRead = !1;\n else if (doRead) {\n if (state.reading = !0, state.sync = !0, state.length === 0)\n state.needReadable = !0;\n try {\n var result = this._read(state.highWaterMark);\n if (@isPromise(result)) {\n const peeked = Bun.peek(result);\n if (peeked !== result)\n result = peeked;\n }\n if (@isPromise(result) && result\?.then && @isCallable(result.then))\n result.then(nop, function(err) {\n errorOrDestroy2(this, err);\n });\n } catch (err) {\n errorOrDestroy2(this, err);\n }\n if (state.sync = !1, !state.reading)\n n = howMuchToRead(nOrig, state);\n }\n let ret;\n if (n > 0)\n ret = fromList(n, state);\n else\n ret = null;\n if (ret === null)\n state.needReadable = state.length <= state.highWaterMark, n = 0;\n else if (state.length -= n, state.multiAwaitDrain)\n state.awaitDrainWriters.clear();\n else\n state.awaitDrainWriters = null;\n if (state.length === 0) {\n if (!state.ended)\n state.needReadable = !0;\n if (nOrig !== n && state.ended)\n endReadable(this);\n }\n if (ret !== null && !state.errorEmitted && !state.closeEmitted)\n state.dataEmitted = !0, this.emit(\"data\", ret);\n return ret;\n }, Readable.prototype._read = function(n) {\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_read()\");\n }, Readable.prototype.pipe = function(dest, pipeOpts) {\n const src = this, state = this._readableState;\n if (state.pipes.length === 1) {\n if (!state.multiAwaitDrain)\n state.multiAwaitDrain = !0, state.awaitDrainWriters = new SafeSet(state.awaitDrainWriters \? [state.awaitDrainWriters] : []);\n }\n state.pipes.push(dest);\n const endFn = (!pipeOpts || pipeOpts.end !== !1) && dest !== process.stdout && dest !== process.stderr \? onend : unpipe;\n if (state.endEmitted)\n runOnNextTick(endFn);\n else\n src.once(\"end\", endFn);\n dest.on(\"unpipe\", onunpipe);\n function onunpipe(readable, unpipeInfo) {\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === !1)\n unpipeInfo.hasUnpiped = !0, cleanup();\n }\n }\n function onend() {\n dest.end();\n }\n let ondrain, cleanedUp = !1;\n function cleanup() {\n if (dest.removeListener(\"close\", onclose), dest.removeListener(\"finish\", onfinish), ondrain)\n dest.removeListener(\"drain\", ondrain);\n if (dest.removeListener(\"error\", onerror), dest.removeListener(\"unpipe\", onunpipe), src.removeListener(\"end\", onend), src.removeListener(\"end\", unpipe), src.removeListener(\"data\", ondata), cleanedUp = !0, ondrain && state.awaitDrainWriters && (!dest._writableState || dest._writableState.needDrain))\n ondrain();\n }\n function pause() {\n if (!cleanedUp) {\n if (state.pipes.length === 1 && state.pipes[0] === dest)\n state.awaitDrainWriters = dest, state.multiAwaitDrain = !1;\n else if (state.pipes.length > 1 && state.pipes.includes(dest))\n state.awaitDrainWriters.add(dest);\n src.pause();\n }\n if (!ondrain)\n ondrain = pipeOnDrain(src, dest), dest.on(\"drain\", ondrain);\n }\n src.on(\"data\", ondata);\n function ondata(chunk) {\n if (dest.write(chunk) === !1)\n pause();\n }\n function onerror(er) {\n if (unpipe(), dest.removeListener(\"error\", onerror), dest.listenerCount(\"error\") === 0) {\n const s = dest._writableState || dest._readableState;\n if (s && !s.errorEmitted)\n errorOrDestroy2(dest, er);\n else\n dest.emit(\"error\", er);\n }\n }\n prependListener(dest, \"error\", onerror);\n function onclose() {\n dest.removeListener(\"finish\", onfinish), unpipe();\n }\n dest.once(\"close\", onclose);\n function onfinish() {\n dest.removeListener(\"close\", onclose), unpipe();\n }\n dest.once(\"finish\", onfinish);\n function unpipe() {\n src.unpipe(dest);\n }\n if (dest.emit(\"pipe\", src), dest.writableNeedDrain === !0) {\n if (state.flowing)\n pause();\n } else if (!state.flowing)\n src.resume();\n return dest;\n };\n function pipeOnDrain(src, dest) {\n return function pipeOnDrainFunctionResult() {\n const state = src._readableState;\n if (state.awaitDrainWriters === dest)\n state.awaitDrainWriters = null;\n else if (state.multiAwaitDrain)\n state.awaitDrainWriters.delete(dest);\n if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && src.listenerCount(\"data\"))\n src.resume();\n };\n }\n Readable.prototype.unpipe = function(dest) {\n const state = this._readableState, unpipeInfo = {\n hasUnpiped: !1\n };\n if (state.pipes.length === 0)\n return this;\n if (!dest) {\n const dests = state.pipes;\n state.pipes = [], this.pause();\n for (let i = 0;i < dests.length; i++)\n dests[i].emit(\"unpipe\", this, {\n hasUnpiped: !1\n });\n return this;\n }\n const index = ArrayPrototypeIndexOf(state.pipes, dest);\n if (index === -1)\n return this;\n if (state.pipes.splice(index, 1), state.pipes.length === 0)\n this.pause();\n return dest.emit(\"unpipe\", this, unpipeInfo), this;\n }, Readable.prototype.addListener = Readable.prototype.on, Readable.prototype.removeListener = function(ev, fn) {\n const res = Stream.prototype.removeListener.call(this, ev, fn);\n if (ev === \"readable\")\n runOnNextTick(updateReadableListening, this);\n return res;\n }, Readable.prototype.off = Readable.prototype.removeListener, Readable.prototype.removeAllListeners = function(ev) {\n const res = Stream.prototype.removeAllListeners.apply(this, arguments);\n if (ev === \"readable\" || ev === void 0)\n runOnNextTick(updateReadableListening, this);\n return res;\n };\n function updateReadableListening(self) {\n const state = self._readableState;\n if (state.readableListening = self.listenerCount(\"readable\") > 0, state.resumeScheduled && state.paused === !1)\n state.flowing = !0;\n else if (self.listenerCount(\"data\") > 0)\n self.resume();\n else if (!state.readableListening)\n state.flowing = null;\n }\n function nReadingNextTick(self) {\n self.read(0);\n }\n Readable.prototype.resume = function() {\n const state = this._readableState;\n if (!state.flowing)\n state.flowing = !state.readableListening, resume(this, state);\n return state.paused = !1, this;\n }, Readable.prototype.pause = function() {\n if (this._readableState.flowing !== !1)\n this._readableState.flowing = !1, this.emit(\"pause\");\n return this._readableState.paused = !0, this;\n }, Readable.prototype.wrap = function(stream) {\n let paused = !1;\n stream.on(\"data\", (chunk) => {\n if (!this.push(chunk) && stream.pause)\n paused = !0, stream.pause();\n }), stream.on(\"end\", () => {\n this.push(null);\n }), stream.on(\"error\", (err) => {\n errorOrDestroy2(this, err);\n }), stream.on(\"close\", () => {\n this.destroy();\n }), stream.on(\"destroy\", () => {\n this.destroy();\n }), this._read = () => {\n if (paused && stream.resume)\n paused = !1, stream.resume();\n };\n const streamKeys = ObjectKeys(stream);\n for (let j = 1;j < streamKeys.length; j++) {\n const i = streamKeys[j];\n if (this[i] === void 0 && typeof stream[i] === \"function\")\n this[i] = stream[i].bind(stream);\n }\n return this;\n }, Readable.prototype[SymbolAsyncIterator] = function() {\n return streamToAsyncIterator(this);\n }, Readable.prototype.iterator = function(options) {\n if (options !== void 0)\n validateObject(options, \"options\");\n return streamToAsyncIterator(this, options);\n };\n function streamToAsyncIterator(stream, options) {\n if (typeof stream.read !== \"function\")\n stream = Readable.wrap(stream, {\n objectMode: !0\n });\n const iter = createAsyncIterator(stream, options);\n return iter.stream = stream, iter;\n }\n async function* createAsyncIterator(stream, options) {\n let callback = nop;\n function next(resolve) {\n if (this === stream)\n callback(), callback = nop;\n else\n callback = resolve;\n }\n stream.on(\"readable\", next);\n let error;\n const cleanup = eos(stream, {\n writable: !1\n }, (err) => {\n error = err \? aggregateTwoErrors(error, err) : null, callback(), callback = nop;\n });\n try {\n while (!0) {\n const chunk = stream.destroyed \? null : stream.read();\n if (chunk !== null)\n yield chunk;\n else if (error)\n throw error;\n else if (error === null)\n return;\n else\n await new Promise2(next);\n }\n } catch (err) {\n throw error = aggregateTwoErrors(error, err), error;\n } finally {\n if ((error || (options === null || options === void 0 \? void 0 : options.destroyOnReturn) !== !1) && (error === void 0 || stream._readableState.autoDestroy))\n destroyImpl.destroyer(stream, null);\n else\n stream.off(\"readable\", next), cleanup();\n }\n }\n ObjectDefineProperties(Readable.prototype, {\n readable: {\n get() {\n const r = this._readableState;\n return !!r && r.readable !== !1 && !r.destroyed && !r.errorEmitted && !r.endEmitted;\n },\n set(val) {\n if (this._readableState)\n this._readableState.readable = !!val;\n }\n },\n readableDidRead: {\n enumerable: !1,\n get: function() {\n return this._readableState.dataEmitted;\n }\n },\n readableAborted: {\n enumerable: !1,\n get: function() {\n return !!(this._readableState.readable !== !1 && (this._readableState.destroyed || this._readableState.errored) && !this._readableState.endEmitted);\n }\n },\n readableHighWaterMark: {\n enumerable: !1,\n get: function() {\n return this._readableState.highWaterMark;\n }\n },\n readableBuffer: {\n enumerable: !1,\n get: function() {\n return this._readableState && this._readableState.buffer;\n }\n },\n readableFlowing: {\n enumerable: !1,\n get: function() {\n return this._readableState.flowing;\n },\n set: function(state) {\n if (this._readableState)\n this._readableState.flowing = state;\n }\n },\n readableLength: {\n enumerable: !1,\n get() {\n return this._readableState.length;\n }\n },\n readableObjectMode: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.objectMode : !1;\n }\n },\n readableEncoding: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.encoding : null;\n }\n },\n errored: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.errored : null;\n }\n },\n closed: {\n get() {\n return this._readableState \? this._readableState.closed : !1;\n }\n },\n destroyed: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.destroyed : !1;\n },\n set(value) {\n if (!this._readableState)\n return;\n this._readableState.destroyed = value;\n }\n },\n readableEnded: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.endEmitted : !1;\n }\n }\n }), Readable._fromList = fromList;\n function fromList(n, state) {\n if (state.length === 0)\n return null;\n let ret;\n if (state.objectMode)\n ret = state.buffer.shift();\n else if (!n || n >= state.length) {\n if (state.decoder)\n ret = state.buffer.join(\"\");\n else if (state.buffer.length === 1)\n ret = state.buffer.first();\n else\n ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else\n ret = state.buffer.consume(n, state.decoder);\n return ret;\n }\n function endReadable(stream) {\n const state = stream._readableState;\n if (!state.endEmitted)\n state.ended = !0, runOnNextTick(endReadableNT, state, stream);\n }\n function endReadableNT(state, stream) {\n if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) {\n if (state.endEmitted = !0, stream.emit(\"end\"), stream.writable && stream.allowHalfOpen === !1)\n runOnNextTick(endWritableNT, stream);\n else if (state.autoDestroy) {\n const wState = stream._writableState;\n if (!wState || wState.autoDestroy && (wState.finished || wState.writable === !1))\n stream.destroy();\n }\n }\n }\n function endWritableNT(stream) {\n if (stream.writable && !stream.writableEnded && !stream.destroyed)\n stream.end();\n }\n Readable.from = function(iterable, opts) {\n return from(Readable, iterable, opts);\n };\n var webStreamsAdapters = {\n newStreamReadableFromReadableStream,\n newReadableStreamFromStreamReadable(streamReadable, options = {}) {\n if (typeof streamReadable\?._readableState !== \"object\")\n throw new ERR_INVALID_ARG_TYPE2(\"streamReadable\", \"stream.Readable\", streamReadable);\n var { isDestroyed, isReadable } = require_utils();\n if (isDestroyed(streamReadable) || !isReadable(streamReadable)) {\n const readable = new ReadableStream;\n return readable.cancel(), readable;\n }\n const { readableObjectMode: objectMode, readableHighWaterMark: highWaterMark } = streamReadable, strategy = ((strategy2) => {\n if (strategy2)\n return strategy2;\n if (objectMode)\n return new CountQueuingStrategy({ highWaterMark });\n return { highWaterMark };\n })(options\?.strategy);\n let controller;\n function onData(chunk) {\n if (controller.enqueue(chunk), controller.desiredSize <= 0)\n streamReadable.pause();\n }\n streamReadable.pause();\n const cleanup = eos(streamReadable, (error) => {\n if (error\?.code === \"ERR_STREAM_PREMATURE_CLOSE\")\n error = new AbortError(void 0, { cause: error });\n if (cleanup(), streamReadable.on(\"error\", () => {\n }), error)\n return controller.error(error);\n controller.close();\n });\n return streamReadable.on(\"data\", onData), new ReadableStream({\n start(c) {\n controller = c;\n },\n pull() {\n streamReadable.resume();\n },\n cancel(reason) {\n destroy(streamReadable, reason);\n }\n }, strategy);\n }\n };\n Readable.fromWeb = function(readableStream, options) {\n return webStreamsAdapters.newStreamReadableFromReadableStream(readableStream, options);\n }, Readable.toWeb = function(streamReadable, options) {\n return webStreamsAdapters.newReadableStreamFromStreamReadable(streamReadable, options);\n }, Readable.wrap = function(src, options) {\n var _ref, _src$readableObjectMo;\n return new Readable({\n objectMode: (_ref = (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== void 0 \? _src$readableObjectMo : src.objectMode) !== null && _ref !== void 0 \? _ref : !0,\n ...options,\n destroy(err, callback) {\n destroyImpl.destroyer(src, err), callback(err);\n }\n }).wrap(src);\n };\n }\n}), require_writable = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/writable.js\"(exports, module) {\n var {\n ArrayPrototypeSlice,\n Error: Error2,\n FunctionPrototypeSymbolHasInstance,\n ObjectDefineProperty,\n ObjectDefineProperties,\n ObjectSetPrototypeOf,\n StringPrototypeToLowerCase,\n Symbol: Symbol2,\n SymbolHasInstance\n } = require_primordials(), Stream = require_legacy().Stream, destroyImpl = require_destroy(), { addAbortSignal } = require_add_abort_signal(), { getHighWaterMark, getDefaultHighWaterMark } = require_state(), {\n ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK,\n ERR_STREAM_CANNOT_PIPE,\n ERR_STREAM_DESTROYED,\n ERR_STREAM_ALREADY_FINISHED,\n ERR_STREAM_NULL_VALUES,\n ERR_STREAM_WRITE_AFTER_END,\n ERR_UNKNOWN_ENCODING\n } = require_errors().codes, { errorOrDestroy: errorOrDestroy2 } = destroyImpl;\n function Writable(options = {}) {\n const isDuplex = this instanceof require_duplex();\n if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable, this))\n return new Writable(options);\n if (this._writableState = new WritableState(options, this, isDuplex), options) {\n if (typeof options.write === \"function\")\n this._write = options.write;\n if (typeof options.writev === \"function\")\n this._writev = options.writev;\n if (typeof options.destroy === \"function\")\n this._destroy = options.destroy;\n if (typeof options.final === \"function\")\n this._final = options.final;\n if (typeof options.construct === \"function\")\n this._construct = options.construct;\n if (options.signal)\n addAbortSignal(options.signal, this);\n }\n Stream.call(this, options), destroyImpl.construct(this, () => {\n const state = this._writableState;\n if (!state.writing)\n clearBuffer(this, state);\n finishMaybe(this, state);\n });\n }\n Writable.prototype = {}, ObjectSetPrototypeOf(Writable.prototype, Stream.prototype), ObjectSetPrototypeOf(Writable, Stream), module.exports = Writable;\n function nop() {\n }\n var kOnFinished = Symbol2(\"kOnFinished\");\n function WritableState(options, stream, isDuplex) {\n if (typeof isDuplex !== \"boolean\")\n isDuplex = stream instanceof require_duplex();\n if (this.objectMode = !!(options && options.objectMode), isDuplex)\n this.objectMode = this.objectMode || !!(options && options.writableObjectMode);\n this.highWaterMark = options \? getHighWaterMark(this, options, \"writableHighWaterMark\", isDuplex) : getDefaultHighWaterMark(!1), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;\n const noDecode = !!(options && options.decodeStrings === !1);\n this.decodeStrings = !noDecode, this.defaultEncoding = options && options.defaultEncoding || \"utf8\", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = onwrite.bind(void 0, stream), this.writecb = null, this.writelen = 0, this.afterWriteTickInfo = null, resetBuffer(this), this.pendingcb = 0, this.constructed = !0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = !options || options.emitClose !== !1, this.autoDestroy = !options || options.autoDestroy !== !1, this.errored = null, this.closed = !1, this.closeEmitted = !1, this[kOnFinished] = [];\n }\n WritableState.prototype = {};\n function resetBuffer(state) {\n state.buffered = [], state.bufferedIndex = 0, state.allBuffers = !0, state.allNoop = !0;\n }\n WritableState.prototype.getBuffer = function getBuffer() {\n return ArrayPrototypeSlice(this.buffered, this.bufferedIndex);\n }, ObjectDefineProperty(WritableState.prototype, \"bufferedRequestCount\", {\n get() {\n return this.buffered.length - this.bufferedIndex;\n }\n }), ObjectDefineProperty(Writable, SymbolHasInstance, {\n value: function(object) {\n if (FunctionPrototypeSymbolHasInstance(this, object))\n return !0;\n if (this !== Writable)\n return !1;\n return object && object._writableState instanceof WritableState;\n }\n }), Writable.prototype.pipe = function() {\n errorOrDestroy2(this, new ERR_STREAM_CANNOT_PIPE);\n };\n function _write(stream, chunk, encoding, cb) {\n const state = stream._writableState;\n if (typeof encoding === \"function\")\n cb = encoding, encoding = state.defaultEncoding;\n else {\n if (!encoding)\n encoding = state.defaultEncoding;\n else if (encoding !== \"buffer\" && !Buffer.isEncoding(encoding))\n throw new ERR_UNKNOWN_ENCODING(encoding);\n if (typeof cb !== \"function\")\n cb = nop;\n }\n if (chunk === null)\n throw new ERR_STREAM_NULL_VALUES;\n else if (!state.objectMode)\n if (typeof chunk === \"string\") {\n if (state.decodeStrings !== !1)\n chunk = Buffer.from(chunk, encoding), encoding = \"buffer\";\n } else if (chunk instanceof Buffer)\n encoding = \"buffer\";\n else if (Stream._isUint8Array(chunk))\n chunk = Stream._uint8ArrayToBuffer(chunk), encoding = \"buffer\";\n else\n throw new ERR_INVALID_ARG_TYPE2(\"chunk\", [\"string\", \"Buffer\", \"Uint8Array\"], chunk);\n let err;\n if (state.ending)\n err = new ERR_STREAM_WRITE_AFTER_END;\n else if (state.destroyed)\n err = new ERR_STREAM_DESTROYED(\"write\");\n if (err)\n return runOnNextTick(cb, err), errorOrDestroy2(stream, err, !0), err;\n return state.pendingcb++, writeOrBuffer(stream, state, chunk, encoding, cb);\n }\n Writable.prototype.write = function(chunk, encoding, cb) {\n return _write(this, chunk, encoding, cb) === !0;\n }, Writable.prototype.cork = function() {\n this._writableState.corked++;\n }, Writable.prototype.uncork = function() {\n const state = this._writableState;\n if (state.corked) {\n if (state.corked--, !state.writing)\n clearBuffer(this, state);\n }\n }, Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n if (typeof encoding === \"string\")\n encoding = StringPrototypeToLowerCase(encoding);\n if (!Buffer.isEncoding(encoding))\n throw new ERR_UNKNOWN_ENCODING(encoding);\n return this._writableState.defaultEncoding = encoding, this;\n };\n function writeOrBuffer(stream, state, chunk, encoding, callback) {\n const len = state.objectMode \? 1 : chunk.length;\n state.length += len;\n const ret = state.length < state.highWaterMark;\n if (!ret)\n state.needDrain = !0;\n if (state.writing || state.corked || state.errored || !state.constructed) {\n if (state.buffered.push({\n chunk,\n encoding,\n callback\n }), state.allBuffers && encoding !== \"buffer\")\n state.allBuffers = !1;\n if (state.allNoop && callback !== nop)\n state.allNoop = !1;\n } else\n state.writelen = len, state.writecb = callback, state.writing = !0, state.sync = !0, stream._write(chunk, encoding, state.onwrite), state.sync = !1;\n return ret && !state.errored && !state.destroyed;\n }\n function doWrite(stream, state, writev, len, chunk, encoding, cb) {\n if (state.writelen = len, state.writecb = cb, state.writing = !0, state.sync = !0, state.destroyed)\n state.onwrite(new ERR_STREAM_DESTROYED(\"write\"));\n else if (writev)\n stream._writev(chunk, state.onwrite);\n else\n stream._write(chunk, encoding, state.onwrite);\n state.sync = !1;\n }\n function onwriteError(stream, state, er, cb) {\n --state.pendingcb, cb(er), errorBuffer(state), errorOrDestroy2(stream, er);\n }\n function onwrite(stream, er) {\n const state = stream._writableState, sync = state.sync, cb = state.writecb;\n if (typeof cb !== \"function\") {\n errorOrDestroy2(stream, new ERR_MULTIPLE_CALLBACK);\n return;\n }\n if (state.writing = !1, state.writecb = null, state.length -= state.writelen, state.writelen = 0, er) {\n if (Error.captureStackTrace(er), !state.errored)\n state.errored = er;\n if (stream._readableState && !stream._readableState.errored)\n stream._readableState.errored = er;\n if (sync)\n runOnNextTick(onwriteError, stream, state, er, cb);\n else\n onwriteError(stream, state, er, cb);\n } else {\n if (state.buffered.length > state.bufferedIndex)\n clearBuffer(stream, state);\n if (sync)\n if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb)\n state.afterWriteTickInfo.count++;\n else\n state.afterWriteTickInfo = {\n count: 1,\n cb,\n stream,\n state\n }, runOnNextTick(afterWriteTick, state.afterWriteTickInfo);\n else\n afterWrite(stream, state, 1, cb);\n }\n }\n function afterWriteTick({ stream, state, count, cb }) {\n return state.afterWriteTickInfo = null, afterWrite(stream, state, count, cb);\n }\n function afterWrite(stream, state, count, cb) {\n if (!state.ending && !stream.destroyed && state.length === 0 && state.needDrain)\n state.needDrain = !1, stream.emit(\"drain\");\n while (count-- > 0)\n state.pendingcb--, cb();\n if (state.destroyed)\n errorBuffer(state);\n finishMaybe(stream, state);\n }\n function errorBuffer(state) {\n if (state.writing)\n return;\n for (let n = state.bufferedIndex;n < state.buffered.length; ++n) {\n var _state$errored;\n const { chunk, callback } = state.buffered[n], len = state.objectMode \? 1 : chunk.length;\n state.length -= len, callback((_state$errored = state.errored) !== null && _state$errored !== void 0 \? _state$errored : new ERR_STREAM_DESTROYED(\"write\"));\n }\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++) {\n var _state$errored2;\n onfinishCallbacks[i]((_state$errored2 = state.errored) !== null && _state$errored2 !== void 0 \? _state$errored2 : new ERR_STREAM_DESTROYED(\"end\"));\n }\n resetBuffer(state);\n }\n function clearBuffer(stream, state) {\n if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed)\n return;\n const { buffered, bufferedIndex, objectMode } = state, bufferedLength = buffered.length - bufferedIndex;\n if (!bufferedLength)\n return;\n let i = bufferedIndex;\n if (state.bufferProcessing = !0, bufferedLength > 1 && stream._writev) {\n state.pendingcb -= bufferedLength - 1;\n const callback = state.allNoop \? nop : (err) => {\n for (let n = i;n < buffered.length; ++n)\n buffered[n].callback(err);\n }, chunks = state.allNoop && i === 0 \? buffered : ArrayPrototypeSlice(buffered, i);\n chunks.allBuffers = state.allBuffers, doWrite(stream, state, !0, state.length, chunks, \"\", callback), resetBuffer(state);\n } else {\n do {\n const { chunk, encoding, callback } = buffered[i];\n buffered[i++] = null;\n const len = objectMode \? 1 : chunk.length;\n doWrite(stream, state, !1, len, chunk, encoding, callback);\n } while (i < buffered.length && !state.writing);\n if (i === buffered.length)\n resetBuffer(state);\n else if (i > 256)\n buffered.splice(0, i), state.bufferedIndex = 0;\n else\n state.bufferedIndex = i;\n }\n state.bufferProcessing = !1;\n }\n Writable.prototype._write = function(chunk, encoding, cb) {\n if (this._writev)\n this._writev([\n {\n chunk,\n encoding\n }\n ], cb);\n else\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_write()\");\n }, Writable.prototype._writev = null, Writable.prototype.end = function(chunk, encoding, cb, native = !1) {\n const state = this._writableState;\n if (typeof chunk === \"function\")\n cb = chunk, chunk = null, encoding = null;\n else if (typeof encoding === \"function\")\n cb = encoding, encoding = null;\n let err;\n if (chunk !== null && chunk !== void 0) {\n let ret;\n if (!native)\n ret = _write(this, chunk, encoding);\n else\n ret = this.write(chunk, encoding);\n if (ret instanceof Error2)\n err = ret;\n }\n if (state.corked)\n state.corked = 1, this.uncork();\n if (err)\n this.emit(\"error\", err);\n else if (!state.errored && !state.ending)\n state.ending = !0, finishMaybe(this, state, !0), state.ended = !0;\n else if (state.finished)\n err = new ERR_STREAM_ALREADY_FINISHED(\"end\");\n else if (state.destroyed)\n err = new ERR_STREAM_DESTROYED(\"end\");\n if (typeof cb === \"function\")\n if (err || state.finished)\n runOnNextTick(cb, err);\n else\n state[kOnFinished].push(cb);\n return this;\n };\n function needFinish(state, tag) {\n var needFinish2 = state.ending && !state.destroyed && state.constructed && state.length === 0 && !state.errored && state.buffered.length === 0 && !state.finished && !state.writing && !state.errorEmitted && !state.closeEmitted;\n return needFinish2;\n }\n function callFinal(stream, state) {\n let called = !1;\n function onFinish(err) {\n if (called) {\n errorOrDestroy2(stream, err !== null && err !== void 0 \? err : ERR_MULTIPLE_CALLBACK());\n return;\n }\n if (called = !0, state.pendingcb--, err) {\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++)\n onfinishCallbacks[i](err);\n errorOrDestroy2(stream, err, state.sync);\n } else if (needFinish(state))\n state.prefinished = !0, stream.emit(\"prefinish\"), state.pendingcb++, runOnNextTick(finish, stream, state);\n }\n state.sync = !0, state.pendingcb++;\n try {\n stream._final(onFinish);\n } catch (err) {\n onFinish(err);\n }\n state.sync = !1;\n }\n function prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled)\n if (typeof stream._final === \"function\" && !state.destroyed)\n state.finalCalled = !0, callFinal(stream, state);\n else\n state.prefinished = !0, stream.emit(\"prefinish\");\n }\n function finishMaybe(stream, state, sync) {\n if (!needFinish(state, stream.__id))\n return;\n if (prefinish(stream, state), state.pendingcb === 0) {\n if (sync)\n state.pendingcb++, runOnNextTick((stream2, state2) => {\n if (needFinish(state2))\n finish(stream2, state2);\n else\n state2.pendingcb--;\n }, stream, state);\n else if (needFinish(state))\n state.pendingcb++, finish(stream, state);\n }\n }\n function finish(stream, state) {\n state.pendingcb--, state.finished = !0;\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++)\n onfinishCallbacks[i]();\n if (stream.emit(\"finish\"), state.autoDestroy) {\n const rState = stream._readableState;\n if (!rState || rState.autoDestroy && (rState.endEmitted || rState.readable === !1))\n stream.destroy();\n }\n }\n ObjectDefineProperties(Writable.prototype, {\n closed: {\n get() {\n return this._writableState \? this._writableState.closed : !1;\n }\n },\n destroyed: {\n get() {\n return this._writableState \? this._writableState.destroyed : !1;\n },\n set(value) {\n if (this._writableState)\n this._writableState.destroyed = value;\n }\n },\n writable: {\n get() {\n const w = this._writableState;\n return !!w && w.writable !== !1 && !w.destroyed && !w.errored && !w.ending && !w.ended;\n },\n set(val) {\n if (this._writableState)\n this._writableState.writable = !!val;\n }\n },\n writableFinished: {\n get() {\n return this._writableState \? this._writableState.finished : !1;\n }\n },\n writableObjectMode: {\n get() {\n return this._writableState \? this._writableState.objectMode : !1;\n }\n },\n writableBuffer: {\n get() {\n return this._writableState && this._writableState.getBuffer();\n }\n },\n writableEnded: {\n get() {\n return this._writableState \? this._writableState.ending : !1;\n }\n },\n writableNeedDrain: {\n get() {\n const wState = this._writableState;\n if (!wState)\n return !1;\n return !wState.destroyed && !wState.ending && wState.needDrain;\n }\n },\n writableHighWaterMark: {\n get() {\n return this._writableState && this._writableState.highWaterMark;\n }\n },\n writableCorked: {\n get() {\n return this._writableState \? this._writableState.corked : 0;\n }\n },\n writableLength: {\n get() {\n return this._writableState && this._writableState.length;\n }\n },\n errored: {\n enumerable: !1,\n get() {\n return this._writableState \? this._writableState.errored : null;\n }\n },\n writableAborted: {\n enumerable: !1,\n get: function() {\n return !!(this._writableState.writable !== !1 && (this._writableState.destroyed || this._writableState.errored) && !this._writableState.finished);\n }\n }\n });\n var destroy2 = destroyImpl.destroy;\n Writable.prototype.destroy = function(err, cb) {\n const state = this._writableState;\n if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length))\n runOnNextTick(errorBuffer, state);\n return destroy2.call(this, err, cb), this;\n }, Writable.prototype._undestroy = destroyImpl.undestroy, Writable.prototype._destroy = function(err, cb) {\n cb(err);\n }, Writable.prototype[EE.captureRejectionSymbol] = function(err) {\n this.destroy(err);\n };\n var webStreamsAdapters;\n function lazyWebStreams() {\n if (webStreamsAdapters === void 0)\n webStreamsAdapters = {};\n return webStreamsAdapters;\n }\n Writable.fromWeb = function(writableStream, options) {\n return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options);\n }, Writable.toWeb = function(streamWritable) {\n return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable);\n };\n }\n}), require_duplexify = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/duplexify.js\"(exports, module) {\n var {\n isReadable,\n isWritable,\n isIterable,\n isNodeStream,\n isReadableNodeStream,\n isWritableNodeStream,\n isDuplexNodeStream\n } = require_utils(), eos = require_end_of_stream(), {\n AbortError: AbortError2,\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_RETURN_VALUE }\n } = require_errors(), { destroyer } = require_destroy(), Duplex = require_duplex(), Readable = require_readable(), { createDeferredPromise } = require_util(), from = require_from(), isBlob = typeof Blob !== \"undefined\" \? function isBlob2(b) {\n return b instanceof Blob;\n } : function isBlob2(b) {\n return !1;\n }, { FunctionPrototypeCall } = require_primordials();\n\n class Duplexify extends Duplex {\n constructor(options) {\n super(options);\n if ((options === null || options === void 0 \? void 0 : options.readable) === !1)\n this._readableState.readable = !1, this._readableState.ended = !0, this._readableState.endEmitted = !0;\n if ((options === null || options === void 0 \? void 0 : options.writable) === !1)\n this._writableState.writable = !1, this._writableState.ending = !0, this._writableState.ended = !0, this._writableState.finished = !0;\n }\n }\n module.exports = function duplexify(body, name) {\n if (isDuplexNodeStream(body))\n return body;\n if (isReadableNodeStream(body))\n return _duplexify({\n readable: body\n });\n if (isWritableNodeStream(body))\n return _duplexify({\n writable: body\n });\n if (isNodeStream(body))\n return _duplexify({\n writable: !1,\n readable: !1\n });\n if (typeof body === \"function\") {\n const { value, write, final, destroy: destroy2 } = fromAsyncGen(body);\n if (isIterable(value))\n return from(Duplexify, value, {\n objectMode: !0,\n write,\n final,\n destroy: destroy2\n });\n const then2 = value === null || value === void 0 \? void 0 : value.then;\n if (typeof then2 === \"function\") {\n let d;\n const promise = FunctionPrototypeCall(then2, value, (val) => {\n if (val != null)\n throw new ERR_INVALID_RETURN_VALUE(\"nully\", \"body\", val);\n }, (err) => {\n destroyer(d, err);\n });\n return d = new Duplexify({\n objectMode: !0,\n readable: !1,\n write,\n final(cb) {\n final(async () => {\n try {\n await promise, runOnNextTick(cb, null);\n } catch (err) {\n runOnNextTick(cb, err);\n }\n });\n },\n destroy: destroy2\n });\n }\n throw new ERR_INVALID_RETURN_VALUE(\"Iterable, AsyncIterable or AsyncFunction\", name, value);\n }\n if (isBlob(body))\n return duplexify(body.arrayBuffer());\n if (isIterable(body))\n return from(Duplexify, body, {\n objectMode: !0,\n writable: !1\n });\n if (typeof (body === null || body === void 0 \? void 0 : body.writable) === \"object\" || typeof (body === null || body === void 0 \? void 0 : body.readable) === \"object\") {\n const readable = body !== null && body !== void 0 && body.readable \? isReadableNodeStream(body === null || body === void 0 \? void 0 : body.readable) \? body === null || body === void 0 \? void 0 : body.readable : duplexify(body.readable) : void 0, writable = body !== null && body !== void 0 && body.writable \? isWritableNodeStream(body === null || body === void 0 \? void 0 : body.writable) \? body === null || body === void 0 \? void 0 : body.writable : duplexify(body.writable) : void 0;\n return _duplexify({\n readable,\n writable\n });\n }\n const then = body === null || body === void 0 \? void 0 : body.then;\n if (typeof then === \"function\") {\n let d;\n return FunctionPrototypeCall(then, body, (val) => {\n if (val != null)\n d.push(val);\n d.push(null);\n }, (err) => {\n destroyer(d, err);\n }), d = new Duplexify({\n objectMode: !0,\n writable: !1,\n read() {\n }\n });\n }\n throw new ERR_INVALID_ARG_TYPE2(name, [\n \"Blob\",\n \"ReadableStream\",\n \"WritableStream\",\n \"Stream\",\n \"Iterable\",\n \"AsyncIterable\",\n \"Function\",\n \"{ readable, writable } pair\",\n \"Promise\"\n ], body);\n };\n function fromAsyncGen(fn) {\n let { promise, resolve } = createDeferredPromise();\n const ac = new AbortController, signal = ac.signal;\n return {\n value: fn(async function* () {\n while (!0) {\n const _promise = promise;\n promise = null;\n const { chunk, done, cb } = await _promise;\n if (runOnNextTick(cb), done)\n return;\n if (signal.aborted)\n throw new AbortError2(void 0, {\n cause: signal.reason\n });\n ({ promise, resolve } = createDeferredPromise()), yield chunk;\n }\n }(), {\n signal\n }),\n write(chunk, encoding, cb) {\n const _resolve = resolve;\n resolve = null, _resolve({\n chunk,\n done: !1,\n cb\n });\n },\n final(cb) {\n const _resolve = resolve;\n resolve = null, _resolve({\n done: !0,\n cb\n });\n },\n destroy(err, cb) {\n ac.abort(), cb(err);\n }\n };\n }\n function _duplexify(pair) {\n const r = pair.readable && typeof pair.readable.read !== \"function\" \? Readable.wrap(pair.readable) : pair.readable, w = pair.writable;\n let readable = !!isReadable(r), writable = !!isWritable(w), ondrain, onfinish, onreadable, onclose, d;\n function onfinished(err) {\n const cb = onclose;\n if (onclose = null, cb)\n cb(err);\n else if (err)\n d.destroy(err);\n else if (!readable && !writable)\n d.destroy();\n }\n if (d = new Duplexify({\n readableObjectMode: !!(r !== null && r !== void 0 && r.readableObjectMode),\n writableObjectMode: !!(w !== null && w !== void 0 && w.writableObjectMode),\n readable,\n writable\n }), writable)\n eos(w, (err) => {\n if (writable = !1, err)\n destroyer(r, err);\n onfinished(err);\n }), d._write = function(chunk, encoding, callback) {\n if (w.write(chunk, encoding))\n callback();\n else\n ondrain = callback;\n }, d._final = function(callback) {\n w.end(), onfinish = callback;\n }, w.on(\"drain\", function() {\n if (ondrain) {\n const cb = ondrain;\n ondrain = null, cb();\n }\n }), w.on(\"finish\", function() {\n if (onfinish) {\n const cb = onfinish;\n onfinish = null, cb();\n }\n });\n if (readable)\n eos(r, (err) => {\n if (readable = !1, err)\n destroyer(r, err);\n onfinished(err);\n }), r.on(\"readable\", function() {\n if (onreadable) {\n const cb = onreadable;\n onreadable = null, cb();\n }\n }), r.on(\"end\", function() {\n d.push(null);\n }), d._read = function() {\n while (!0) {\n const buf = r.read();\n if (buf === null) {\n onreadable = d._read;\n return;\n }\n if (!d.push(buf))\n return;\n }\n };\n return d._destroy = function(err, callback) {\n if (!err && onclose !== null)\n err = new AbortError2;\n if (onreadable = null, ondrain = null, onfinish = null, onclose === null)\n callback(err);\n else\n onclose = callback, destroyer(w, err), destroyer(r, err);\n }, d;\n }\n }\n}), require_duplex = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/duplex.js\"(exports, module) {\n var { ObjectDefineProperties, ObjectGetOwnPropertyDescriptor, ObjectKeys, ObjectSetPrototypeOf } = require_primordials(), Readable = require_readable();\n function Duplex(options) {\n if (!(this instanceof Duplex))\n return new Duplex(options);\n if (Readable.call(this, options), Writable.call(this, options), options) {\n if (this.allowHalfOpen = options.allowHalfOpen !== !1, options.readable === !1)\n this._readableState.readable = !1, this._readableState.ended = !0, this._readableState.endEmitted = !0;\n if (options.writable === !1)\n this._writableState.writable = !1, this._writableState.ending = !0, this._writableState.ended = !0, this._writableState.finished = !0;\n } else\n this.allowHalfOpen = !0;\n }\n Duplex.prototype = {}, module.exports = Duplex, ObjectSetPrototypeOf(Duplex.prototype, Readable.prototype), ObjectSetPrototypeOf(Duplex, Readable);\n for (var method in Writable.prototype)\n if (!Duplex.prototype[method])\n Duplex.prototype[method] = Writable.prototype[method];\n ObjectDefineProperties(Duplex.prototype, {\n writable: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writable\"),\n writableHighWaterMark: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableHighWaterMark\"),\n writableObjectMode: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableObjectMode\"),\n writableBuffer: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableBuffer\"),\n writableLength: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableLength\"),\n writableFinished: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableFinished\"),\n writableCorked: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableCorked\"),\n writableEnded: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableEnded\"),\n writableNeedDrain: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableNeedDrain\"),\n destroyed: {\n get() {\n if (this._readableState === void 0 || this._writableState === void 0)\n return !1;\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set(value) {\n if (this._readableState && this._writableState)\n this._readableState.destroyed = value, this._writableState.destroyed = value;\n }\n }\n });\n var webStreamsAdapters;\n function lazyWebStreams() {\n if (webStreamsAdapters === void 0)\n webStreamsAdapters = {};\n return webStreamsAdapters;\n }\n Duplex.fromWeb = function(pair, options) {\n return lazyWebStreams().newStreamDuplexFromReadableWritablePair(pair, options);\n }, Duplex.toWeb = function(duplex) {\n return lazyWebStreams().newReadableWritablePairFromDuplex(duplex);\n };\n var duplexify;\n Duplex.from = function(body) {\n if (!duplexify)\n duplexify = require_duplexify();\n return duplexify(body, \"body\");\n };\n }\n}), require_transform = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/transform.js\"(exports, module) {\n var { ObjectSetPrototypeOf, Symbol: Symbol2 } = require_primordials(), { ERR_METHOD_NOT_IMPLEMENTED } = require_errors().codes, Duplex = require_duplex();\n function Transform(options) {\n if (!(this instanceof Transform))\n return new Transform(options);\n if (Duplex.call(this, options), this._readableState.sync = !1, this[kCallback] = null, options) {\n if (typeof options.transform === \"function\")\n this._transform = options.transform;\n if (typeof options.flush === \"function\")\n this._flush = options.flush;\n }\n this.on(\"prefinish\", prefinish.bind(this));\n }\n Transform.prototype = {}, ObjectSetPrototypeOf(Transform.prototype, Duplex.prototype), ObjectSetPrototypeOf(Transform, Duplex), module.exports = Transform;\n var kCallback = Symbol2(\"kCallback\");\n function final(cb) {\n if (typeof this._flush === \"function\" && !this.destroyed)\n this._flush((er, data) => {\n if (er) {\n if (cb)\n cb(er);\n else\n this.destroy(er);\n return;\n }\n if (data != null)\n this.push(data);\n if (this.push(null), cb)\n cb();\n });\n else if (this.push(null), cb)\n cb();\n }\n function prefinish() {\n if (this._final !== final)\n final.call(this);\n }\n Transform.prototype._final = final, Transform.prototype._transform = function(chunk, encoding, callback) {\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_transform()\");\n }, Transform.prototype._write = function(chunk, encoding, callback) {\n const rState = this._readableState, wState = this._writableState, length = rState.length;\n this._transform(chunk, encoding, (err, val) => {\n if (err) {\n callback(err);\n return;\n }\n if (val != null)\n this.push(val);\n if (wState.ended || length === rState.length || rState.length < rState.highWaterMark || rState.highWaterMark === 0 || rState.length === 0)\n callback();\n else\n this[kCallback] = callback;\n });\n }, Transform.prototype._read = function() {\n if (this[kCallback]) {\n const callback = this[kCallback];\n this[kCallback] = null, callback();\n }\n };\n }\n}), require_passthrough = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/passthrough.js\"(exports, module) {\n var { ObjectSetPrototypeOf } = require_primordials(), Transform = require_transform();\n function PassThrough(options) {\n if (!(this instanceof PassThrough))\n return new PassThrough(options);\n Transform.call(this, options);\n }\n PassThrough.prototype = {}, ObjectSetPrototypeOf(PassThrough.prototype, Transform.prototype), ObjectSetPrototypeOf(PassThrough, Transform), PassThrough.prototype._transform = function(chunk, encoding, cb) {\n cb(null, chunk);\n }, module.exports = PassThrough;\n }\n}), require_pipeline = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/pipeline.js\"(exports, module) {\n var { ArrayIsArray: ArrayIsArray2, Promise: Promise2, SymbolAsyncIterator } = require_primordials(), eos = require_end_of_stream(), { once } = require_util(), destroyImpl = require_destroy(), Duplex = require_duplex(), {\n aggregateTwoErrors,\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS, ERR_STREAM_DESTROYED },\n AbortError: AbortError2\n } = require_errors(), { validateFunction, validateAbortSignal } = require_validators(), { isIterable, isReadable, isReadableNodeStream, isNodeStream } = require_utils(), PassThrough, Readable;\n function destroyer(stream, reading, writing) {\n let finished = !1;\n stream.on(\"close\", () => {\n finished = !0;\n });\n const cleanup = eos(stream, {\n readable: reading,\n writable: writing\n }, (err) => {\n finished = !err;\n });\n return {\n destroy: (err) => {\n if (finished)\n return;\n finished = !0, destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED(\"pipe\"));\n },\n cleanup\n };\n }\n function popCallback(streams) {\n return validateFunction(streams[streams.length - 1], \"streams[stream.length - 1]\"), streams.pop();\n }\n function makeAsyncIterable(val) {\n if (isIterable(val))\n return val;\n else if (isReadableNodeStream(val))\n return fromReadable(val);\n throw new ERR_INVALID_ARG_TYPE2(\"val\", [\"Readable\", \"Iterable\", \"AsyncIterable\"], val);\n }\n async function* fromReadable(val) {\n if (!Readable)\n Readable = require_readable();\n yield* Readable.prototype[SymbolAsyncIterator].call(val);\n }\n async function pump(iterable, writable, finish, { end }) {\n let error, onresolve = null;\n const resume = (err) => {\n if (err)\n error = err;\n if (onresolve) {\n const callback = onresolve;\n onresolve = null, callback();\n }\n }, wait = () => new Promise2((resolve, reject) => {\n if (error)\n reject(error);\n else\n onresolve = () => {\n if (error)\n reject(error);\n else\n resolve();\n };\n });\n writable.on(\"drain\", resume);\n const cleanup = eos(writable, {\n readable: !1\n }, resume);\n try {\n if (writable.writableNeedDrain)\n await wait();\n for await (let chunk of iterable)\n if (!writable.write(chunk))\n await wait();\n if (end)\n writable.end();\n await wait(), finish();\n } catch (err) {\n finish(error !== err \? aggregateTwoErrors(error, err) : err);\n } finally {\n cleanup(), writable.off(\"drain\", resume);\n }\n }\n function pipeline(...streams) {\n return pipelineImpl(streams, once(popCallback(streams)));\n }\n function pipelineImpl(streams, callback, opts) {\n if (streams.length === 1 && ArrayIsArray2(streams[0]))\n streams = streams[0];\n if (streams.length < 2)\n throw new ERR_MISSING_ARGS(\"streams\");\n const ac = new AbortController, signal = ac.signal, outerSignal = opts === null || opts === void 0 \? void 0 : opts.signal, lastStreamCleanup = [];\n validateAbortSignal(outerSignal, \"options.signal\");\n function abort() {\n finishImpl(new AbortError2);\n }\n outerSignal === null || outerSignal === void 0 || outerSignal.addEventListener(\"abort\", abort);\n let error, value;\n const destroys = [];\n let finishCount = 0;\n function finish(err) {\n finishImpl(err, --finishCount === 0);\n }\n function finishImpl(err, final) {\n if (err && (!error || error.code === \"ERR_STREAM_PREMATURE_CLOSE\"))\n error = err;\n if (!error && !final)\n return;\n while (destroys.length)\n destroys.shift()(error);\n if (outerSignal === null || outerSignal === void 0 || outerSignal.removeEventListener(\"abort\", abort), ac.abort(), final) {\n if (!error)\n lastStreamCleanup.forEach((fn) => fn());\n runOnNextTick(callback, error, value);\n }\n }\n let ret;\n for (let i = 0;i < streams.length; i++) {\n const stream = streams[i], reading = i < streams.length - 1, writing = i > 0, end = reading || (opts === null || opts === void 0 \? void 0 : opts.end) !== !1, isLastStream = i === streams.length - 1;\n if (isNodeStream(stream)) {\n let onError = function(err) {\n if (err && err.name !== \"AbortError\" && err.code !== \"ERR_STREAM_PREMATURE_CLOSE\")\n finish(err);\n };\n if (end) {\n const { destroy: destroy2, cleanup } = destroyer(stream, reading, writing);\n if (destroys.push(destroy2), isReadable(stream) && isLastStream)\n lastStreamCleanup.push(cleanup);\n }\n if (stream.on(\"error\", onError), isReadable(stream) && isLastStream)\n lastStreamCleanup.push(() => {\n stream.removeListener(\"error\", onError);\n });\n }\n if (i === 0)\n if (typeof stream === \"function\") {\n if (ret = stream({\n signal\n }), !isIterable(ret))\n throw new ERR_INVALID_RETURN_VALUE(\"Iterable, AsyncIterable or Stream\", \"source\", ret);\n } else if (isIterable(stream) || isReadableNodeStream(stream))\n ret = stream;\n else\n ret = Duplex.from(stream);\n else if (typeof stream === \"function\")\n if (ret = makeAsyncIterable(ret), ret = stream(ret, {\n signal\n }), reading) {\n if (!isIterable(ret, !0))\n throw new ERR_INVALID_RETURN_VALUE(\"AsyncIterable\", `transform[${i - 1}]`, ret);\n } else {\n var _ret;\n if (!PassThrough)\n PassThrough = require_passthrough();\n const pt = new PassThrough({\n objectMode: !0\n }), then = (_ret = ret) === null || _ret === void 0 \? void 0 : _ret.then;\n if (typeof then === \"function\")\n finishCount++, then.call(ret, (val) => {\n if (value = val, val != null)\n pt.write(val);\n if (end)\n pt.end();\n runOnNextTick(finish);\n }, (err) => {\n pt.destroy(err), runOnNextTick(finish, err);\n });\n else if (isIterable(ret, !0))\n finishCount++, pump(ret, pt, finish, {\n end\n });\n else\n throw new ERR_INVALID_RETURN_VALUE(\"AsyncIterable or Promise\", \"destination\", ret);\n ret = pt;\n const { destroy: destroy2, cleanup } = destroyer(ret, !1, !0);\n if (destroys.push(destroy2), isLastStream)\n lastStreamCleanup.push(cleanup);\n }\n else if (isNodeStream(stream)) {\n if (isReadableNodeStream(ret)) {\n finishCount += 2;\n const cleanup = pipe(ret, stream, finish, {\n end\n });\n if (isReadable(stream) && isLastStream)\n lastStreamCleanup.push(cleanup);\n } else if (isIterable(ret))\n finishCount++, pump(ret, stream, finish, {\n end\n });\n else\n throw new ERR_INVALID_ARG_TYPE2(\"val\", [\"Readable\", \"Iterable\", \"AsyncIterable\"], ret);\n ret = stream;\n } else\n ret = Duplex.from(stream);\n }\n if (signal !== null && signal !== void 0 && signal.aborted || outerSignal !== null && outerSignal !== void 0 && outerSignal.aborted)\n runOnNextTick(abort);\n return ret;\n }\n function pipe(src, dst, finish, { end }) {\n if (src.pipe(dst, {\n end\n }), end)\n src.once(\"end\", () => dst.end());\n else\n finish();\n return eos(src, {\n readable: !0,\n writable: !1\n }, (err) => {\n const rState = src._readableState;\n if (err && err.code === \"ERR_STREAM_PREMATURE_CLOSE\" && rState && rState.ended && !rState.errored && !rState.errorEmitted)\n src.once(\"end\", finish).once(\"error\", finish);\n else\n finish(err);\n }), eos(dst, {\n readable: !1,\n writable: !0\n }, finish);\n }\n module.exports = {\n pipelineImpl,\n pipeline\n };\n }\n}), require_compose = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/compose.js\"(exports, module) {\n var { pipeline } = require_pipeline(), Duplex = require_duplex(), { destroyer } = require_destroy(), { isNodeStream, isReadable, isWritable } = require_utils(), {\n AbortError: AbortError2,\n codes: { ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, ERR_MISSING_ARGS }\n } = require_errors();\n module.exports = function compose(...streams) {\n if (streams.length === 0)\n throw new ERR_MISSING_ARGS(\"streams\");\n if (streams.length === 1)\n return Duplex.from(streams[0]);\n const orgStreams = [...streams];\n if (typeof streams[0] === \"function\")\n streams[0] = Duplex.from(streams[0]);\n if (typeof streams[streams.length - 1] === \"function\") {\n const idx = streams.length - 1;\n streams[idx] = Duplex.from(streams[idx]);\n }\n for (let n = 0;n < streams.length; ++n) {\n if (!isNodeStream(streams[n]))\n continue;\n if (n < streams.length - 1 && !isReadable(streams[n]))\n throw new ERR_INVALID_ARG_VALUE2(`streams[${n}]`, orgStreams[n], \"must be readable\");\n if (n > 0 && !isWritable(streams[n]))\n throw new ERR_INVALID_ARG_VALUE2(`streams[${n}]`, orgStreams[n], \"must be writable\");\n }\n let ondrain, onfinish, onreadable, onclose, d;\n function onfinished(err) {\n const cb = onclose;\n if (onclose = null, cb)\n cb(err);\n else if (err)\n d.destroy(err);\n else if (!readable && !writable)\n d.destroy();\n }\n const head = streams[0], tail = pipeline(streams, onfinished), writable = !!isWritable(head), readable = !!isReadable(tail);\n if (d = new Duplex({\n writableObjectMode: !!(head !== null && head !== void 0 && head.writableObjectMode),\n readableObjectMode: !!(tail !== null && tail !== void 0 && tail.writableObjectMode),\n writable,\n readable\n }), writable)\n d._write = function(chunk, encoding, callback) {\n if (head.write(chunk, encoding))\n callback();\n else\n ondrain = callback;\n }, d._final = function(callback) {\n head.end(), onfinish = callback;\n }, head.on(\"drain\", function() {\n if (ondrain) {\n const cb = ondrain;\n ondrain = null, cb();\n }\n }), tail.on(\"finish\", function() {\n if (onfinish) {\n const cb = onfinish;\n onfinish = null, cb();\n }\n });\n if (readable)\n tail.on(\"readable\", function() {\n if (onreadable) {\n const cb = onreadable;\n onreadable = null, cb();\n }\n }), tail.on(\"end\", function() {\n d.push(null);\n }), d._read = function() {\n while (!0) {\n const buf = tail.read();\n if (buf === null) {\n onreadable = d._read;\n return;\n }\n if (!d.push(buf))\n return;\n }\n };\n return d._destroy = function(err, callback) {\n if (!err && onclose !== null)\n err = new AbortError2;\n if (onreadable = null, ondrain = null, onfinish = null, onclose === null)\n callback(err);\n else\n onclose = callback, destroyer(tail, err);\n }, d;\n };\n }\n}), require_promises = __commonJS({\n \"node_modules/readable-stream/lib/stream/promises.js\"(exports, module) {\n var { ArrayPrototypePop, Promise: Promise2 } = require_primordials(), { isIterable, isNodeStream } = require_utils(), { pipelineImpl: pl } = require_pipeline(), { finished } = require_end_of_stream();\n function pipeline(...streams) {\n return new Promise2((resolve, reject) => {\n let signal, end;\n const lastArg = streams[streams.length - 1];\n if (lastArg && typeof lastArg === \"object\" && !isNodeStream(lastArg) && !isIterable(lastArg)) {\n const options = ArrayPrototypePop(streams);\n signal = options.signal, end = options.end;\n }\n pl(streams, (err, value) => {\n if (err)\n reject(err);\n else\n resolve(value);\n }, {\n signal,\n end\n });\n });\n }\n module.exports = {\n finished,\n pipeline\n };\n }\n}), require_stream = __commonJS({\n \"node_modules/readable-stream/lib/stream.js\"(exports, module) {\n var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials(), {\n promisify: { custom: customPromisify }\n } = require_util(), { streamReturningOperators, promiseReturningOperators } = require_operators(), {\n codes: { ERR_ILLEGAL_CONSTRUCTOR }\n } = require_errors(), compose = require_compose(), { pipeline } = require_pipeline(), { destroyer } = require_destroy(), eos = require_end_of_stream(), promises = require_promises(), utils = require_utils(), Stream = module.exports = require_legacy().Stream;\n Stream.isDisturbed = utils.isDisturbed, Stream.isErrored = utils.isErrored, Stream.isWritable = utils.isWritable, Stream.isReadable = utils.isReadable, Stream.Readable = require_readable();\n for (let key of ObjectKeys(streamReturningOperators)) {\n let fn = function(...args) {\n if (new.target)\n throw ERR_ILLEGAL_CONSTRUCTOR();\n return Stream.Readable.from(ReflectApply(op, this, args));\n };\n const op = streamReturningOperators[key];\n ObjectDefineProperty(fn, \"name\", {\n value: op.name\n }), ObjectDefineProperty(fn, \"length\", {\n value: op.length\n }), ObjectDefineProperty(Stream.Readable.prototype, key, {\n value: fn,\n enumerable: !1,\n configurable: !0,\n writable: !0\n });\n }\n for (let key of ObjectKeys(promiseReturningOperators)) {\n let fn = function(...args) {\n if (new.target)\n throw ERR_ILLEGAL_CONSTRUCTOR();\n return ReflectApply(op, this, args);\n };\n const op = promiseReturningOperators[key];\n ObjectDefineProperty(fn, \"name\", {\n value: op.name\n }), ObjectDefineProperty(fn, \"length\", {\n value: op.length\n }), ObjectDefineProperty(Stream.Readable.prototype, key, {\n value: fn,\n enumerable: !1,\n configurable: !0,\n writable: !0\n });\n }\n Stream.Writable = require_writable(), Stream.Duplex = require_duplex(), Stream.Transform = require_transform(), Stream.PassThrough = require_passthrough(), Stream.pipeline = pipeline;\n var { addAbortSignal } = require_add_abort_signal();\n Stream.addAbortSignal = addAbortSignal, Stream.finished = eos, Stream.destroy = destroyer, Stream.compose = compose, ObjectDefineProperty(Stream, \"promises\", {\n configurable: !0,\n enumerable: !0,\n get() {\n return promises;\n }\n }), ObjectDefineProperty(pipeline, customPromisify, {\n enumerable: !0,\n get() {\n return promises.pipeline;\n }\n }), ObjectDefineProperty(eos, customPromisify, {\n enumerable: !0,\n get() {\n return promises.finished;\n }\n }), Stream.Stream = Stream, Stream._isUint8Array = function isUint8Array(value) {\n return value instanceof Uint8Array;\n }, Stream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) {\n return new Buffer(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n };\n }\n}), nativeReadableStreamPrototypes = {\n 0: void 0,\n 1: void 0,\n 2: void 0,\n 3: void 0,\n 4: void 0,\n 5: void 0\n}, Writable = require_writable(), _pathOrFdOrSink = Symbol(\"pathOrFdOrSink\"), _fileSink = Symbol(\"fileSink\"), _native = Symbol(\"native\");\nNativeWritable.prototype = Object.create(Writable.prototype);\nvar WritablePrototypeWrite = Writable.prototype.write;\nNativeWritable.prototype.write = function NativeWritablePrototypeWrite(chunk, encoding, cb, native) {\n if (!(native \?\? this[_native]))\n return this[_native] = !1, WritablePrototypeWrite.call(this, chunk, encoding, cb);\n var fileSink = this[_fileSink] \?\? NativeWritable_lazyConstruct(this), result = fileSink.write(chunk);\n if (@isPromise(result))\n return result.then(() => {\n this.emit(\"drain\"), fileSink.flush(!0);\n }), !1;\n if (fileSink.flush(!0), cb)\n cb(null, chunk.byteLength);\n return !0;\n};\nvar WritablePrototypeEnd = Writable.prototype.end;\nNativeWritable.prototype.end = function end(chunk, encoding, cb, native) {\n return WritablePrototypeEnd.call(this, chunk, encoding, cb, native \?\? this[_native]);\n};\nNativeWritable.prototype.ref = function ref() {\n var sink = this[_fileSink];\n if (!sink)\n this.NativeWritable_lazyConstruct();\n sink.ref();\n};\nNativeWritable.prototype.unref = function unref() {\n this[_fileSink]\?.unref();\n};\nvar exports = require_stream(), promises = require_promises();\nexports._getNativeReadableStreamPrototype = getNativeReadableStreamPrototype;\nexports.NativeWritable = NativeWritable;\nObject.defineProperty(exports, \"promises\", {\n configurable: !0,\n enumerable: !0,\n get() {\n return promises;\n }\n});\nexports[Symbol.for(\"::bunternal::\")] = { _ReadableFromWeb, _ReadableFromWebForUndici };\nexports.eos = require_end_of_stream();\nexports.EventEmitter = EE;\nreturn exports})\n"_s;
+static constexpr ASCIILiteral NodeStreamConsumersCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/stream.consumers.ts\nvar $, arrayBuffer = Bun.readableStreamToArrayBuffer, text = Bun.readableStreamToText, json = (stream) => Bun.readableStreamToText(stream).then(JSON.parse), buffer = async (readableStream) => {\n return new @Buffer(await arrayBuffer(readableStream));\n}, blob = Bun.readableStreamToBlob;\n$ = {\n arrayBuffer,\n text,\n json,\n buffer,\n blob\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeStreamPromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/stream.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37)).promises})\n"_s;
+static constexpr ASCIILiteral NodeStreamCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/stream.ts\nvar isReadableStream = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof @ReadableStream;\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar ERR_INVALID_ARG_TYPE = function(name, type, value) {\n return new Error(`The argument '${name}' is invalid. Received '${value}' for type '${type}'`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value '${value}' is invalid for argument '${name}'. Reason: ${reason}`);\n}, createNativeStreamReadable = function(nativeType, Readable) {\n var [pull, start, cancel, setClose, deinit, updateRef, drainFn] = @lazy(nativeType), closer = [!1], handleNumberResult = function(nativeReadable, result, view, isClosed) {\n if (result > 0) {\n const slice = view.subarray(0, result), remainder = view.subarray(result);\n if (slice.byteLength > 0)\n nativeReadable.push(slice);\n if (isClosed)\n nativeReadable.push(null);\n return remainder.byteLength > 0 \? remainder : @undefined;\n }\n if (isClosed)\n nativeReadable.push(null);\n return view;\n }, handleArrayBufferViewResult = function(nativeReadable, result, view, isClosed) {\n if (result.byteLength > 0)\n nativeReadable.push(result);\n if (isClosed)\n nativeReadable.push(null);\n return view;\n }, DYNAMICALLY_ADJUST_CHUNK_SIZE = process.env.BUN_DISABLE_DYNAMIC_CHUNK_SIZE !== \"1\";\n const finalizer = new FinalizationRegistry((ptr) => ptr && deinit(ptr)), MIN_BUFFER_SIZE = 512;\n var NativeReadable = class NativeReadable2 extends Readable {\n #bunNativePtr;\n #refCount = 1;\n #constructed = !1;\n #remainingChunk = @undefined;\n #highWaterMark;\n #pendingRead = !1;\n #hasResized = !DYNAMICALLY_ADJUST_CHUNK_SIZE;\n #unregisterToken;\n constructor(ptr, options = {}) {\n super(options);\n if (typeof options.highWaterMark === \"number\")\n this.#highWaterMark = options.highWaterMark;\n else\n this.#highWaterMark = 262144;\n this.#bunNativePtr = ptr, this.#constructed = !1, this.#remainingChunk = @undefined, this.#pendingRead = !1, this.#unregisterToken = {}, finalizer.register(this, this.#bunNativePtr, this.#unregisterToken);\n }\n _read(maxToRead) {\n if (this.#pendingRead)\n return;\n var ptr = this.#bunNativePtr;\n if (ptr === 0) {\n this.push(null);\n return;\n }\n if (!this.#constructed)\n this.#internalConstruct(ptr);\n return this.#internalRead(this.#getRemainingChunk(maxToRead), ptr);\n }\n #internalConstruct(ptr) {\n this.#constructed = !0;\n const result = start(ptr, this.#highWaterMark);\n if (typeof result === \"number\" && result > 1)\n this.#hasResized = !0, this.#highWaterMark = Math.min(this.#highWaterMark, result);\n if (drainFn) {\n const drainResult = drainFn(ptr);\n if ((drainResult\?.byteLength \?\? 0) > 0)\n this.push(drainResult);\n }\n }\n #getRemainingChunk(maxToRead = this.#highWaterMark) {\n var chunk = this.#remainingChunk;\n if (chunk\?.byteLength \?\? 0 < MIN_BUFFER_SIZE) {\n var size = maxToRead > MIN_BUFFER_SIZE \? maxToRead : MIN_BUFFER_SIZE;\n this.#remainingChunk = chunk = new @Buffer(size);\n }\n return chunk;\n }\n #handleResult(result, view, isClosed) {\n if (typeof result === \"number\") {\n if (result >= this.#highWaterMark && !this.#hasResized && !isClosed)\n this.#highWaterMark *= 2, this.#hasResized = !0;\n return handleNumberResult(this, result, view, isClosed);\n } else if (typeof result === \"boolean\")\n return process.nextTick(() => {\n this.push(null);\n }), view\?.byteLength \?\? 0 > 0 \? view : @undefined;\n else if (@ArrayBuffer.isView(result)) {\n if (result.byteLength >= this.#highWaterMark && !this.#hasResized && !isClosed)\n this.#highWaterMark *= 2, this.#hasResized = !0;\n return handleArrayBufferViewResult(this, result, view, isClosed);\n } else\n throw new Error(\"Invalid result from pull\");\n }\n #internalRead(view, ptr) {\n closer[0] = !1;\n var result = pull(ptr, view, closer);\n if (@isPromise(result))\n return this.#pendingRead = !0, result.then((result2) => {\n this.#pendingRead = !1, this.#remainingChunk = this.#handleResult(result2, view, closer[0]);\n }, (reason) => {\n errorOrDestroy(this, reason);\n });\n else\n this.#remainingChunk = this.#handleResult(result, view, closer[0]);\n }\n _destroy(error, callback) {\n var ptr = this.#bunNativePtr;\n if (ptr === 0) {\n callback(error);\n return;\n }\n if (finalizer.unregister(this.#unregisterToken), this.#bunNativePtr = 0, updateRef)\n updateRef(ptr, !1);\n cancel(ptr, error), callback(error);\n }\n ref() {\n var ptr = this.#bunNativePtr;\n if (ptr === 0)\n return;\n if (this.#refCount++ === 0)\n updateRef(ptr, !0);\n }\n unref() {\n var ptr = this.#bunNativePtr;\n if (ptr === 0)\n return;\n if (this.#refCount-- === 1)\n updateRef(ptr, !1);\n }\n };\n if (!updateRef)\n NativeReadable.prototype.ref = @undefined, NativeReadable.prototype.unref = @undefined;\n return NativeReadable;\n}, getNativeReadableStreamPrototype = function(nativeType, Readable) {\n return nativeReadableStreamPrototypes[nativeType] ||= createNativeStreamReadable(nativeType, Readable);\n}, getNativeReadableStream = function(Readable, stream, options) {\n if (!(stream && typeof stream === \"object\" && stream instanceof @ReadableStream))\n return @undefined;\n const native = @direct(stream);\n if (!native)\n return @undefined;\n const { stream: ptr, data: type } = native;\n return new (getNativeReadableStreamPrototype(type, Readable))(ptr, options);\n}, NativeWritable = function(pathOrFdOrSink, options = {}) {\n Writable.@call(this, options), this[_native] = !0, this._construct = NativeWritable_internalConstruct, this._destroy = NativeWritable_internalDestroy, this._final = NativeWritable_internalFinal, this[_pathOrFdOrSink] = pathOrFdOrSink;\n}, NativeWritable_internalConstruct = function(cb) {\n if (this._writableState.constructed = !0, this.constructed = !0, typeof cb === \"function\")\n cb();\n process.nextTick(() => {\n this.emit(\"open\", this.fd), this.emit(\"ready\");\n });\n}, NativeWritable_lazyConstruct = function(stream) {\n var sink = stream[_pathOrFdOrSink];\n if (typeof sink === \"object\")\n if (typeof sink.write === \"function\")\n return stream[_fileSink] = sink;\n else\n throw new Error(\"Invalid FileSink\");\n else\n return stream[_fileSink] = Bun.file(sink).writer();\n}, NativeWritable_internalDestroy = function(error, cb) {\n const w = this._writableState, r = this._readableState;\n if (w)\n w.destroyed = !0, w.closeEmitted = !0;\n if (r)\n r.destroyed = !0, r.closeEmitted = !0;\n if (typeof cb === \"function\")\n cb(error);\n if (w\?.closeEmitted || r\?.closeEmitted)\n this.emit(\"close\");\n}, NativeWritable_internalFinal = function(cb) {\n var sink = this[_fileSink];\n if (sink)\n sink.end();\n if (cb)\n cb();\n}, EE = @lazy(\"events\"), StringDecoder = @requireNativeModule(\"string_decoder\").StringDecoder, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, runOnNextTick = process.nextTick;\nvar ArrayIsArray = @Array.isArray, require_primordials = __commonJS({\n \"node_modules/readable-stream/lib/ours/primordials.js\"(exports, module) {\n module.exports = {\n ArrayIsArray(self) {\n return @Array.isArray(self);\n },\n ArrayPrototypeIncludes(self, el) {\n return self.includes(el);\n },\n ArrayPrototypeIndexOf(self, el) {\n return self.indexOf(el);\n },\n ArrayPrototypeJoin(self, sep) {\n return self.join(sep);\n },\n ArrayPrototypeMap(self, fn) {\n return self.map(fn);\n },\n ArrayPrototypePop(self, el) {\n return self.pop(el);\n },\n ArrayPrototypePush(self, el) {\n return self.push(el);\n },\n ArrayPrototypeSlice(self, start, end) {\n return self.slice(start, end);\n },\n Error,\n FunctionPrototypeCall(fn, thisArgs, ...args) {\n return fn.@call(thisArgs, ...args);\n },\n FunctionPrototypeSymbolHasInstance(self, instance) {\n return Function.prototype[Symbol.hasInstance].@call(self, instance);\n },\n MathFloor: Math.floor,\n Number,\n NumberIsInteger: Number.isInteger,\n NumberIsNaN: Number.isNaN,\n NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,\n NumberParseInt: Number.parseInt,\n ObjectDefineProperties(self, props) {\n return Object.defineProperties(self, props);\n },\n ObjectDefineProperty(self, name, prop) {\n return Object.defineProperty(self, name, prop);\n },\n ObjectGetOwnPropertyDescriptor(self, name) {\n return Object.getOwnPropertyDescriptor(self, name);\n },\n ObjectKeys(obj) {\n return Object.keys(obj);\n },\n ObjectSetPrototypeOf(target, proto) {\n return Object.setPrototypeOf(target, proto);\n },\n Promise: @Promise,\n PromisePrototypeCatch(self, fn) {\n return self.catch(fn);\n },\n PromisePrototypeThen(self, thenFn, catchFn) {\n return self.then(thenFn, catchFn);\n },\n PromiseReject(err) {\n return @Promise.reject(err);\n },\n ReflectApply: @getByIdDirect(Reflect, \"apply\"),\n RegExpPrototypeTest(self, value) {\n return self.test(value);\n },\n SafeSet: Set,\n String: @String,\n StringPrototypeSlice(self, start, end) {\n return self.slice(start, end);\n },\n StringPrototypeToLowerCase(self) {\n return self.toLowerCase();\n },\n StringPrototypeToUpperCase(self) {\n return self.toUpperCase();\n },\n StringPrototypeTrim(self) {\n return self.trim();\n },\n Symbol,\n SymbolAsyncIterator: Symbol.asyncIterator,\n SymbolHasInstance: Symbol.hasInstance,\n SymbolIterator: Symbol.iterator,\n TypedArrayPrototypeSet(self, buf, len) {\n return self.set(buf, len);\n },\n Uint8Array: @Uint8Array\n };\n }\n}), require_util = __commonJS({\n \"node_modules/readable-stream/lib/ours/util.js\"(exports, module) {\n var AsyncFunction = Object.getPrototypeOf(async function() {\n }).constructor, isBlob = typeof Blob !== \"undefined\" \? function isBlob2(b) {\n return b instanceof Blob;\n } : function isBlob2(b) {\n return !1;\n }, AggregateError = class extends Error {\n constructor(errors) {\n if (!@Array.isArray(errors))\n @throwTypeError(`Expected input to be an Array, got ${typeof errors}`);\n let message = \"\";\n for (let i = 0;i < errors.length; i++)\n message += ` ${errors[i].stack}\n`;\n super(message);\n this.name = \"AggregateError\", this.errors = errors;\n }\n };\n module.exports = {\n AggregateError,\n once(callback) {\n let called = !1;\n return function(...args) {\n if (called)\n return;\n called = !0, callback.@apply(this, args);\n };\n },\n createDeferredPromise: function() {\n let resolve, reject;\n return {\n promise: new @Promise((res, rej) => {\n resolve = res, reject = rej;\n }),\n resolve,\n reject\n };\n },\n promisify(fn) {\n return new @Promise((resolve, reject) => {\n fn((err, ...args) => {\n if (err)\n return reject(err);\n return resolve(...args);\n });\n });\n },\n debuglog() {\n return function() {\n };\n },\n format(format, ...args) {\n return format.replace(/%([sdifj])/g, function(...[_unused, type]) {\n const replacement = args.shift();\n if (type === \"f\")\n return replacement.toFixed(6);\n else if (type === \"j\")\n return JSON.stringify(replacement);\n else if (type === \"s\" && typeof replacement === \"object\")\n return `${replacement.constructor !== Object \? replacement.constructor.name : \"\"} {}`.trim();\n else\n return replacement.toString();\n });\n },\n inspect(value) {\n switch (typeof value) {\n case \"string\":\n if (value.includes(\"'\")) {\n if (!value.includes('\"'))\n return `\"${value}\"`;\n else if (!value.includes(\"`\") && !value.includes(\"${\"))\n return `\\`${value}\\``;\n }\n return `'${value}'`;\n case \"number\":\n if (isNaN(value))\n return \"NaN\";\n else if (Object.is(value, -0))\n return @String(value);\n return value;\n case \"bigint\":\n return `${@String(value)}n`;\n case \"boolean\":\n case \"undefined\":\n return @String(value);\n case \"object\":\n return \"{}\";\n }\n },\n types: {\n isAsyncFunction(fn) {\n return fn instanceof AsyncFunction;\n },\n isArrayBufferView(arr) {\n return @ArrayBuffer.isView(arr);\n }\n },\n isBlob\n }, module.exports.promisify.custom = Symbol.for(\"nodejs.util.promisify.custom\");\n }\n}), require_errors = __commonJS({\n \"node_modules/readable-stream/lib/ours/errors.js\"(exports, module) {\n var { format, inspect, AggregateError: CustomAggregateError } = require_util(), AggregateError = globalThis.AggregateError || CustomAggregateError, kIsNodeError = Symbol(\"kIsNodeError\"), kTypes = [\"string\", \"function\", \"number\", \"object\", \"Function\", \"Object\", \"boolean\", \"bigint\", \"symbol\"], classRegExp = /^([A-Z][a-z0-9]*)+$/, nodeInternalPrefix = \"__node_internal_\", codes = {};\n function assert(value, message) {\n if (!value)\n throw new codes.ERR_INTERNAL_ASSERTION(message);\n }\n function addNumericalSeparator(val) {\n let res = \"\", i = val.length;\n const start = val[0] === \"-\" \? 1 : 0;\n for (;i >= start + 4; i -= 3)\n res = `_${val.slice(i - 3, i)}${res}`;\n return `${val.slice(0, i)}${res}`;\n }\n function getMessage(key, msg, args) {\n if (typeof msg === \"function\")\n return assert(msg.length <= args.length, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`), msg(...args);\n const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length;\n if (assert(expectedLength === args.length, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`), args.length === 0)\n return msg;\n return format(msg, ...args);\n }\n function E(code, message, Base) {\n if (!Base)\n Base = Error;\n\n class NodeError extends Base {\n constructor(...args) {\n super(getMessage(code, message, args));\n }\n toString() {\n return `${this.name} [${code}]: ${this.message}`;\n }\n }\n Object.defineProperties(NodeError.prototype, {\n name: {\n value: Base.name,\n writable: !0,\n enumerable: !1,\n configurable: !0\n },\n toString: {\n value() {\n return `${this.name} [${code}]: ${this.message}`;\n },\n writable: !0,\n enumerable: !1,\n configurable: !0\n }\n }), NodeError.prototype.code = code, NodeError.prototype[kIsNodeError] = !0, codes[code] = NodeError;\n }\n function hideStackFrames(fn) {\n const hidden = nodeInternalPrefix + fn.name;\n return Object.defineProperty(fn, \"name\", {\n value: hidden\n }), fn;\n }\n function aggregateTwoErrors(innerError, outerError) {\n if (innerError && outerError && innerError !== outerError) {\n if (@Array.isArray(outerError.errors))\n return outerError.errors.push(innerError), outerError;\n const err = new AggregateError([outerError, innerError], outerError.message);\n return err.code = outerError.code, err;\n }\n return innerError || outerError;\n }\n var AbortError2 = class extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n };\n E(\"ERR_ASSERTION\", \"%s\", Error), E(\"ERR_INVALID_ARG_TYPE\", (name, expected, actual) => {\n if (assert(typeof name === \"string\", \"'name' must be a string\"), !@Array.isArray(expected))\n expected = [expected];\n let msg = \"The \";\n if (name.endsWith(\" argument\"))\n msg += `${name} `;\n else\n msg += `\"${name}\" ${name.includes(\".\") \? \"property\" : \"argument\"} `;\n msg += \"must be \";\n const types = [], instances = [], other = [];\n for (let value of expected)\n if (assert(typeof value === \"string\", \"All expected entries have to be of type string\"), kTypes.includes(value))\n types.push(value.toLowerCase());\n else if (classRegExp.test(value))\n instances.push(value);\n else\n assert(value !== \"object\", 'The value \"object\" should be written as \"Object\"'), other.push(value);\n if (instances.length > 0) {\n const pos = types.indexOf(\"object\");\n if (pos !== -1)\n types.splice(types, pos, 1), instances.push(\"Object\");\n }\n if (types.length > 0) {\n switch (types.length) {\n case 1:\n msg += `of type ${types[0]}`;\n break;\n case 2:\n msg += `one of type ${types[0]} or ${types[1]}`;\n break;\n default: {\n const last = types.pop();\n msg += `one of type ${types.join(\", \")}, or ${last}`;\n }\n }\n if (instances.length > 0 || other.length > 0)\n msg += \" or \";\n }\n if (instances.length > 0) {\n switch (instances.length) {\n case 1:\n msg += `an instance of ${instances[0]}`;\n break;\n case 2:\n msg += `an instance of ${instances[0]} or ${instances[1]}`;\n break;\n default: {\n const last = instances.pop();\n msg += `an instance of ${instances.join(\", \")}, or ${last}`;\n }\n }\n if (other.length > 0)\n msg += \" or \";\n }\n switch (other.length) {\n case 0:\n break;\n case 1:\n if (other[0].toLowerCase() !== other[0])\n msg += \"an \";\n msg += `${other[0]}`;\n break;\n case 2:\n msg += `one of ${other[0]} or ${other[1]}`;\n break;\n default: {\n const last = other.pop();\n msg += `one of ${other.join(\", \")}, or ${last}`;\n }\n }\n if (actual == null)\n msg += `. Received ${actual}`;\n else if (typeof actual === \"function\" && actual.name)\n msg += `. Received function ${actual.name}`;\n else if (typeof actual === \"object\") {\n var _actual$constructor;\n if ((_actual$constructor = actual.constructor) !== null && _actual$constructor !== void 0 && _actual$constructor.name)\n msg += `. Received an instance of ${actual.constructor.name}`;\n else {\n const inspected = inspect(actual, {\n depth: -1\n });\n msg += `. Received ${inspected}`;\n }\n } else {\n let inspected = inspect(actual, {\n colors: !1\n });\n if (inspected.length > 25)\n inspected = `${inspected.slice(0, 25)}...`;\n msg += `. Received type ${typeof actual} (${inspected})`;\n }\n return msg;\n }, TypeError), E(\"ERR_INVALID_ARG_VALUE\", (name, value, reason = \"is invalid\") => {\n let inspected = inspect(value);\n if (inspected.length > 128)\n inspected = inspected.slice(0, 128) + \"...\";\n return `The ${name.includes(\".\") \? \"property\" : \"argument\"} '${name}' ${reason}. Received ${inspected}`;\n }, TypeError), E(\"ERR_INVALID_RETURN_VALUE\", (input, name, value) => {\n var _value$constructor;\n const type = value !== null && value !== void 0 && (_value$constructor = value.constructor) !== null && _value$constructor !== void 0 && _value$constructor.name \? `instance of ${value.constructor.name}` : `type ${typeof value}`;\n return `Expected ${input} to be returned from the \"${name}\" function but got ${type}.`;\n }, TypeError), E(\"ERR_MISSING_ARGS\", (...args) => {\n assert(args.length > 0, \"At least one arg needs to be specified\");\n let msg;\n const len = args.length;\n switch (args = (@Array.isArray(args) \? args : [args]).map((a) => `\"${a}\"`).join(\" or \"), len) {\n case 1:\n msg += `The ${args[0]} argument`;\n break;\n case 2:\n msg += `The ${args[0]} and ${args[1]} arguments`;\n break;\n default:\n {\n const last = args.pop();\n msg += `The ${args.join(\", \")}, and ${last} arguments`;\n }\n break;\n }\n return `${msg} must be specified`;\n }, TypeError), E(\"ERR_OUT_OF_RANGE\", (str, range, input) => {\n assert(range, 'Missing \"range\" argument');\n let received;\n if (Number.isInteger(input) && Math.abs(input) > 4294967296)\n received = addNumericalSeparator(@String(input));\n else if (typeof input === \"bigint\") {\n if (received = @String(input), input > 2n ** 32n || input < -(2n ** 32n))\n received = addNumericalSeparator(received);\n received += \"n\";\n } else\n received = inspect(input);\n return `The value of \"${str}\" is out of range. It must be ${range}. Received ${received}`;\n }, RangeError), E(\"ERR_MULTIPLE_CALLBACK\", \"Callback called multiple times\", Error), E(\"ERR_METHOD_NOT_IMPLEMENTED\", \"The %s method is not implemented\", Error), E(\"ERR_STREAM_ALREADY_FINISHED\", \"Cannot call %s after a stream was finished\", Error), E(\"ERR_STREAM_CANNOT_PIPE\", \"Cannot pipe, not readable\", Error), E(\"ERR_STREAM_DESTROYED\", \"Cannot call %s after a stream was destroyed\", Error), E(\"ERR_STREAM_NULL_VALUES\", \"May not write null values to stream\", TypeError), E(\"ERR_STREAM_PREMATURE_CLOSE\", \"Premature close\", Error), E(\"ERR_STREAM_PUSH_AFTER_EOF\", \"stream.push() after EOF\", Error), E(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\", \"stream.unshift() after end event\", Error), E(\"ERR_STREAM_WRITE_AFTER_END\", \"write after end\", Error), E(\"ERR_UNKNOWN_ENCODING\", \"Unknown encoding: %s\", TypeError), module.exports = {\n AbortError: AbortError2,\n aggregateTwoErrors: hideStackFrames(aggregateTwoErrors),\n hideStackFrames,\n codes\n };\n }\n}), require_validators = __commonJS({\n \"node_modules/readable-stream/lib/internal/validators.js\"(exports, module) {\n var {\n ArrayIsArray: ArrayIsArray2,\n ArrayPrototypeIncludes,\n ArrayPrototypeJoin,\n ArrayPrototypeMap,\n NumberIsInteger,\n NumberMAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER,\n NumberParseInt,\n RegExpPrototypeTest,\n String: String2,\n StringPrototypeToUpperCase,\n StringPrototypeTrim\n } = require_primordials(), {\n hideStackFrames,\n codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL }\n } = require_errors(), { normalizeEncoding } = require_util(), { isAsyncFunction, isArrayBufferView } = require_util().types, signals = {};\n function isInt32(value) {\n return value === (value | 0);\n }\n function isUint32(value) {\n return value === value >>> 0;\n }\n var octalReg = /^[0-7]+$/, modeDesc = \"must be a 32-bit unsigned integer or an octal string\";\n function parseFileMode(value, name, def) {\n if (typeof value === \"undefined\")\n value = def;\n if (typeof value === \"string\") {\n if (!RegExpPrototypeTest(octalReg, value))\n throw new ERR_INVALID_ARG_VALUE2(name, value, modeDesc);\n value = NumberParseInt(value, 8);\n }\n return validateInt32(value, name, 0, 4294967295), value;\n }\n var validateInteger = hideStackFrames((value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }), validateInt32 = hideStackFrames((value, name, min = -2147483648, max = 2147483647) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!isInt32(value)) {\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }), validateUint32 = hideStackFrames((value, name, positive) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!isUint32(value)) {\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n throw new ERR_OUT_OF_RANGE(name, `>= ${positive \? 1 : 0} && < 4294967296`, value);\n }\n if (positive && value === 0)\n throw new ERR_OUT_OF_RANGE(name, \">= 1 && < 4294967296\", value);\n });\n function validateString(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"string\", value);\n }\n function validateNumber(value, name) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n }\n var validateOneOf = hideStackFrames((value, name, oneOf) => {\n if (!ArrayPrototypeIncludes(oneOf, value)) {\n const reason = \"must be one of: \" + ArrayPrototypeJoin(ArrayPrototypeMap(oneOf, (v) => typeof v === \"string\" \? `'${v}'` : String2(v)), \", \");\n throw new ERR_INVALID_ARG_VALUE2(name, value, reason);\n }\n });\n function validateBoolean2(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"boolean\", value);\n }\n var validateObject = hideStackFrames((value, name, options) => {\n const useDefaultOptions = options == null, allowArray = useDefaultOptions \? !1 : options.allowArray, allowFunction = useDefaultOptions \? !1 : options.allowFunction;\n if (!(useDefaultOptions \? !1 : options.nullable) && value === null || !allowArray && ArrayIsArray2(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Object\", value);\n }), validateArray = hideStackFrames((value, name, minLength = 0) => {\n if (!ArrayIsArray2(value))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE2(name, value, reason);\n }\n });\n function validateSignalName(signal, name = \"signal\") {\n if (validateString(signal, name), signals[signal] === void 0) {\n if (signals[StringPrototypeToUpperCase(signal)] !== void 0)\n throw new ERR_UNKNOWN_SIGNAL(signal + \" (signals must use all capital letters)\");\n throw new ERR_UNKNOWN_SIGNAL(signal);\n }\n }\n var validateBuffer = hideStackFrames((buffer, name = \"buffer\") => {\n if (!isArrayBufferView(buffer))\n throw new ERR_INVALID_ARG_TYPE2(name, [\"Buffer\", \"TypedArray\", \"DataView\"], buffer);\n });\n function validateEncoding(data, encoding) {\n const normalizedEncoding = normalizeEncoding(encoding), length = data.length;\n if (normalizedEncoding === \"hex\" && length % 2 !== 0)\n throw new ERR_INVALID_ARG_VALUE2(\"encoding\", encoding, `is invalid for data of length ${length}`);\n }\n function validatePort(port, name = \"Port\", allowZero = !0) {\n if (typeof port !== \"number\" && typeof port !== \"string\" || typeof port === \"string\" && StringPrototypeTrim(port).length === 0 || +port !== +port >>> 0 || port > 65535 || port === 0 && !allowZero)\n throw new ERR_SOCKET_BAD_PORT(name, port, allowZero);\n return port | 0;\n }\n var validateAbortSignal = hideStackFrames((signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE2(name, \"AbortSignal\", signal);\n }), validateFunction = hideStackFrames((value, name) => {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"Function\", value);\n }), validatePlainFunction = hideStackFrames((value, name) => {\n if (typeof value !== \"function\" || isAsyncFunction(value))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Function\", value);\n }), validateUndefined = hideStackFrames((value, name) => {\n if (value !== void 0)\n throw new ERR_INVALID_ARG_TYPE2(name, \"undefined\", value);\n });\n module.exports = {\n isInt32,\n isUint32,\n parseFileMode,\n validateArray,\n validateBoolean: validateBoolean2,\n validateBuffer,\n validateEncoding,\n validateFunction,\n validateInt32,\n validateInteger,\n validateNumber,\n validateObject,\n validateOneOf,\n validatePlainFunction,\n validatePort,\n validateSignalName,\n validateString,\n validateUint32,\n validateUndefined,\n validateAbortSignal\n };\n }\n}), require_utils = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/utils.js\"(exports, module) {\n var { Symbol: Symbol2, SymbolAsyncIterator, SymbolIterator } = require_primordials(), kDestroyed = Symbol2(\"kDestroyed\"), kIsErrored = Symbol2(\"kIsErrored\"), kIsReadable = Symbol2(\"kIsReadable\"), kIsDisturbed = Symbol2(\"kIsDisturbed\");\n function isReadableNodeStream(obj, strict = !1) {\n var _obj$_readableState;\n return !!(obj && typeof obj.pipe === \"function\" && typeof obj.on === \"function\" && (!strict || typeof obj.pause === \"function\" && typeof obj.resume === \"function\") && (!obj._writableState || ((_obj$_readableState = obj._readableState) === null || _obj$_readableState === void 0 \? void 0 : _obj$_readableState.readable) !== !1) && (!obj._writableState || obj._readableState));\n }\n function isWritableNodeStream(obj) {\n var _obj$_writableState;\n return !!(obj && typeof obj.write === \"function\" && typeof obj.on === \"function\" && (!obj._readableState || ((_obj$_writableState = obj._writableState) === null || _obj$_writableState === void 0 \? void 0 : _obj$_writableState.writable) !== !1));\n }\n function isDuplexNodeStream(obj) {\n return !!(obj && typeof obj.pipe === \"function\" && obj._readableState && typeof obj.on === \"function\" && typeof obj.write === \"function\");\n }\n function isNodeStream(obj) {\n return obj && (obj._readableState || obj._writableState || typeof obj.write === \"function\" && typeof obj.on === \"function\" || typeof obj.pipe === \"function\" && typeof obj.on === \"function\");\n }\n function isIterable(obj, isAsync) {\n if (obj == null)\n return !1;\n if (isAsync === !0)\n return typeof obj[SymbolAsyncIterator] === \"function\";\n if (isAsync === !1)\n return typeof obj[SymbolIterator] === \"function\";\n return typeof obj[SymbolAsyncIterator] === \"function\" || typeof obj[SymbolIterator] === \"function\";\n }\n function isDestroyed(stream) {\n if (!isNodeStream(stream))\n return null;\n const { _writableState: wState, _readableState: rState } = stream, state = wState || rState;\n return !!(stream.destroyed || stream[kDestroyed] || state !== null && state !== void 0 && state.destroyed);\n }\n function isWritableEnded(stream) {\n if (!isWritableNodeStream(stream))\n return null;\n if (stream.writableEnded === !0)\n return !0;\n const wState = stream._writableState;\n if (wState !== null && wState !== void 0 && wState.errored)\n return !1;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.ended) !== \"boolean\")\n return null;\n return wState.ended;\n }\n function isWritableFinished(stream, strict) {\n if (!isWritableNodeStream(stream))\n return null;\n if (stream.writableFinished === !0)\n return !0;\n const wState = stream._writableState;\n if (wState !== null && wState !== void 0 && wState.errored)\n return !1;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.finished) !== \"boolean\")\n return null;\n return !!(wState.finished || strict === !1 && wState.ended === !0 && wState.length === 0);\n }\n function isReadableEnded(stream) {\n if (!isReadableNodeStream(stream))\n return null;\n if (stream.readableEnded === !0)\n return !0;\n const rState = stream._readableState;\n if (!rState || rState.errored)\n return !1;\n if (typeof (rState === null || rState === void 0 \? void 0 : rState.ended) !== \"boolean\")\n return null;\n return rState.ended;\n }\n function isReadableFinished(stream, strict) {\n if (!isReadableNodeStream(stream))\n return null;\n const rState = stream._readableState;\n if (rState !== null && rState !== void 0 && rState.errored)\n return !1;\n if (typeof (rState === null || rState === void 0 \? void 0 : rState.endEmitted) !== \"boolean\")\n return null;\n return !!(rState.endEmitted || strict === !1 && rState.ended === !0 && rState.length === 0);\n }\n function isReadable(stream) {\n if (stream && stream[kIsReadable] != null)\n return stream[kIsReadable];\n if (typeof (stream === null || stream === void 0 \? void 0 : stream.readable) !== \"boolean\")\n return null;\n if (isDestroyed(stream))\n return !1;\n return isReadableNodeStream(stream) && stream.readable && !isReadableFinished(stream);\n }\n function isWritable(stream) {\n if (typeof (stream === null || stream === void 0 \? void 0 : stream.writable) !== \"boolean\")\n return null;\n if (isDestroyed(stream))\n return !1;\n return isWritableNodeStream(stream) && stream.writable && !isWritableEnded(stream);\n }\n function isFinished(stream, opts) {\n if (!isNodeStream(stream))\n return null;\n if (isDestroyed(stream))\n return !0;\n if ((opts === null || opts === void 0 \? void 0 : opts.readable) !== !1 && isReadable(stream))\n return !1;\n if ((opts === null || opts === void 0 \? void 0 : opts.writable) !== !1 && isWritable(stream))\n return !1;\n return !0;\n }\n function isWritableErrored(stream) {\n var _stream$_writableStat, _stream$_writableStat2;\n if (!isNodeStream(stream))\n return null;\n if (stream.writableErrored)\n return stream.writableErrored;\n return (_stream$_writableStat = (_stream$_writableStat2 = stream._writableState) === null || _stream$_writableStat2 === void 0 \? void 0 : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== void 0 \? _stream$_writableStat : null;\n }\n function isReadableErrored(stream) {\n var _stream$_readableStat, _stream$_readableStat2;\n if (!isNodeStream(stream))\n return null;\n if (stream.readableErrored)\n return stream.readableErrored;\n return (_stream$_readableStat = (_stream$_readableStat2 = stream._readableState) === null || _stream$_readableStat2 === void 0 \? void 0 : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== void 0 \? _stream$_readableStat : null;\n }\n function isClosed(stream) {\n if (!isNodeStream(stream))\n return null;\n if (typeof stream.closed === \"boolean\")\n return stream.closed;\n const { _writableState: wState, _readableState: rState } = stream;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.closed) === \"boolean\" || typeof (rState === null || rState === void 0 \? void 0 : rState.closed) === \"boolean\")\n return (wState === null || wState === void 0 \? void 0 : wState.closed) || (rState === null || rState === void 0 \? void 0 : rState.closed);\n if (typeof stream._closed === \"boolean\" && isOutgoingMessage(stream))\n return stream._closed;\n return null;\n }\n function isOutgoingMessage(stream) {\n return typeof stream._closed === \"boolean\" && typeof stream._defaultKeepAlive === \"boolean\" && typeof stream._removedConnection === \"boolean\" && typeof stream._removedContLen === \"boolean\";\n }\n function isServerResponse(stream) {\n return typeof stream._sent100 === \"boolean\" && isOutgoingMessage(stream);\n }\n function isServerRequest(stream) {\n var _stream$req;\n return typeof stream._consuming === \"boolean\" && typeof stream._dumped === \"boolean\" && ((_stream$req = stream.req) === null || _stream$req === void 0 \? void 0 : _stream$req.upgradeOrConnect) === void 0;\n }\n function willEmitClose(stream) {\n if (!isNodeStream(stream))\n return null;\n const { _writableState: wState, _readableState: rState } = stream, state = wState || rState;\n return !state && isServerResponse(stream) || !!(state && state.autoDestroy && state.emitClose && state.closed === !1);\n }\n function isDisturbed(stream) {\n var _stream$kIsDisturbed;\n return !!(stream && ((_stream$kIsDisturbed = stream[kIsDisturbed]) !== null && _stream$kIsDisturbed !== void 0 \? _stream$kIsDisturbed : stream.readableDidRead || stream.readableAborted));\n }\n function isErrored(stream) {\n var _ref, _ref2, _ref3, _ref4, _ref5, _stream$kIsErrored, _stream$_readableStat3, _stream$_writableStat3, _stream$_readableStat4, _stream$_writableStat4;\n return !!(stream && ((_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_stream$kIsErrored = stream[kIsErrored]) !== null && _stream$kIsErrored !== void 0 \? _stream$kIsErrored : stream.readableErrored) !== null && _ref5 !== void 0 \? _ref5 : stream.writableErrored) !== null && _ref4 !== void 0 \? _ref4 : (_stream$_readableStat3 = stream._readableState) === null || _stream$_readableStat3 === void 0 \? void 0 : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== void 0 \? _ref3 : (_stream$_writableStat3 = stream._writableState) === null || _stream$_writableStat3 === void 0 \? void 0 : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== void 0 \? _ref2 : (_stream$_readableStat4 = stream._readableState) === null || _stream$_readableStat4 === void 0 \? void 0 : _stream$_readableStat4.errored) !== null && _ref !== void 0 \? _ref : (_stream$_writableStat4 = stream._writableState) === null || _stream$_writableStat4 === void 0 \? void 0 : _stream$_writableStat4.errored));\n }\n module.exports = {\n kDestroyed,\n isDisturbed,\n kIsDisturbed,\n isErrored,\n kIsErrored,\n isReadable,\n kIsReadable,\n isClosed,\n isDestroyed,\n isDuplexNodeStream,\n isFinished,\n isIterable,\n isReadableNodeStream,\n isReadableEnded,\n isReadableFinished,\n isReadableErrored,\n isNodeStream,\n isWritable,\n isWritableNodeStream,\n isWritableEnded,\n isWritableFinished,\n isWritableErrored,\n isServerRequest,\n isServerResponse,\n willEmitClose\n };\n }\n}), require_end_of_stream = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/end-of-stream.js\"(exports, module) {\n var { AbortError: AbortError2, codes } = require_errors(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_PREMATURE_CLOSE } = codes, { once } = require_util(), { validateAbortSignal, validateFunction, validateObject } = require_validators(), { Promise: Promise2 } = require_primordials(), {\n isClosed,\n isReadable,\n isReadableNodeStream,\n isReadableFinished,\n isReadableErrored,\n isWritable,\n isWritableNodeStream,\n isWritableFinished,\n isWritableErrored,\n isNodeStream,\n willEmitClose: _willEmitClose\n } = require_utils();\n function isRequest(stream) {\n return stream.setHeader && typeof stream.abort === \"function\";\n }\n var nop = () => {\n };\n function eos(stream, options, callback) {\n var _options$readable, _options$writable;\n if (arguments.length === 2)\n callback = options, options = {};\n else if (options == null)\n options = {};\n else\n validateObject(options, \"options\");\n validateFunction(callback, \"callback\"), validateAbortSignal(options.signal, \"options.signal\"), callback = once(callback);\n const readable = (_options$readable = options.readable) !== null && _options$readable !== void 0 \? _options$readable : isReadableNodeStream(stream), writable = (_options$writable = options.writable) !== null && _options$writable !== void 0 \? _options$writable : isWritableNodeStream(stream);\n if (!isNodeStream(stream))\n throw new ERR_INVALID_ARG_TYPE2(\"stream\", \"Stream\", stream);\n const { _writableState: wState, _readableState: rState } = stream, onlegacyfinish = () => {\n if (!stream.writable)\n onfinish();\n };\n let willEmitClose = _willEmitClose(stream) && isReadableNodeStream(stream) === readable && isWritableNodeStream(stream) === writable, writableFinished = isWritableFinished(stream, !1);\n const onfinish = () => {\n if (writableFinished = !0, stream.destroyed)\n willEmitClose = !1;\n if (willEmitClose && (!stream.readable || readable))\n return;\n if (!readable || readableFinished)\n callback.@call(stream);\n };\n let readableFinished = isReadableFinished(stream, !1);\n const onend = () => {\n if (readableFinished = !0, stream.destroyed)\n willEmitClose = !1;\n if (willEmitClose && (!stream.writable || writable))\n return;\n if (!writable || writableFinished)\n callback.@call(stream);\n }, onerror = (err) => {\n callback.@call(stream, err);\n };\n let closed = isClosed(stream);\n const onclose = () => {\n closed = !0;\n const errored = isWritableErrored(stream) || isReadableErrored(stream);\n if (errored && typeof errored !== \"boolean\")\n return callback.@call(stream, errored);\n if (readable && !readableFinished && isReadableNodeStream(stream, !0)) {\n if (!isReadableFinished(stream, !1))\n return callback.@call(stream, new ERR_STREAM_PREMATURE_CLOSE);\n }\n if (writable && !writableFinished) {\n if (!isWritableFinished(stream, !1))\n return callback.@call(stream, new ERR_STREAM_PREMATURE_CLOSE);\n }\n callback.@call(stream);\n }, onrequest = () => {\n stream.req.on(\"finish\", onfinish);\n };\n if (isRequest(stream)) {\n if (stream.on(\"complete\", onfinish), !willEmitClose)\n stream.on(\"abort\", onclose);\n if (stream.req)\n onrequest();\n else\n stream.on(\"request\", onrequest);\n } else if (writable && !wState)\n stream.on(\"end\", onlegacyfinish), stream.on(\"close\", onlegacyfinish);\n if (!willEmitClose && typeof stream.aborted === \"boolean\")\n stream.on(\"aborted\", onclose);\n if (stream.on(\"end\", onend), stream.on(\"finish\", onfinish), options.error !== !1)\n stream.on(\"error\", onerror);\n if (stream.on(\"close\", onclose), closed)\n runOnNextTick(onclose);\n else if (wState !== null && wState !== void 0 && wState.errorEmitted || rState !== null && rState !== void 0 && rState.errorEmitted) {\n if (!willEmitClose)\n runOnNextTick(onclose);\n } else if (!readable && (!willEmitClose || isReadable(stream)) && (writableFinished || isWritable(stream) === !1))\n runOnNextTick(onclose);\n else if (!writable && (!willEmitClose || isWritable(stream)) && (readableFinished || isReadable(stream) === !1))\n runOnNextTick(onclose);\n else if (rState && stream.req && stream.aborted)\n runOnNextTick(onclose);\n const cleanup = () => {\n if (callback = nop, stream.removeListener(\"aborted\", onclose), stream.removeListener(\"complete\", onfinish), stream.removeListener(\"abort\", onclose), stream.removeListener(\"request\", onrequest), stream.req)\n stream.req.removeListener(\"finish\", onfinish);\n stream.removeListener(\"end\", onlegacyfinish), stream.removeListener(\"close\", onlegacyfinish), stream.removeListener(\"finish\", onfinish), stream.removeListener(\"end\", onend), stream.removeListener(\"error\", onerror), stream.removeListener(\"close\", onclose);\n };\n if (options.signal && !closed) {\n const abort = () => {\n const endCallback = callback;\n cleanup(), endCallback.@call(stream, new AbortError2(void 0, {\n cause: options.signal.reason\n }));\n };\n if (options.signal.aborted)\n runOnNextTick(abort);\n else {\n const originalCallback = callback;\n callback = once((...args) => {\n options.signal.removeEventListener(\"abort\", abort), originalCallback.@apply(stream, args);\n }), options.signal.addEventListener(\"abort\", abort);\n }\n }\n return cleanup;\n }\n function finished(stream, opts) {\n return new Promise2((resolve, reject) => {\n eos(stream, opts, (err) => {\n if (err)\n reject(err);\n else\n resolve();\n });\n });\n }\n module.exports = eos, module.exports.finished = finished;\n }\n}), require_operators = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/operators.js\"(exports, module) {\n var {\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_MISSING_ARGS, ERR_OUT_OF_RANGE },\n AbortError: AbortError2\n } = require_errors(), { validateAbortSignal, validateInteger, validateObject } = require_validators(), kWeakHandler = require_primordials().Symbol(\"kWeak\"), { finished } = require_end_of_stream(), {\n ArrayPrototypePush,\n MathFloor,\n Number: Number2,\n NumberIsNaN,\n Promise: Promise2,\n PromiseReject,\n PromisePrototypeCatch,\n Symbol: Symbol2\n } = require_primordials(), kEmpty = Symbol2(\"kEmpty\"), kEof = Symbol2(\"kEof\");\n function map(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n let concurrency = 1;\n if ((options === null || options === void 0 \? void 0 : options.concurrency) != null)\n concurrency = MathFloor(options.concurrency);\n return validateInteger(concurrency, \"concurrency\", 1), async function* map2() {\n var _options$signal, _options$signal2;\n const ac = new AbortController, stream = this, queue = [], signal = ac.signal, signalOpt = {\n signal\n }, abort = () => ac.abort();\n if (options !== null && options !== void 0 && (_options$signal = options.signal) !== null && _options$signal !== void 0 && _options$signal.aborted)\n abort();\n options === null || options === void 0 || (_options$signal2 = options.signal) === null || _options$signal2 === void 0 || _options$signal2.addEventListener(\"abort\", abort);\n let next, resume, done = !1;\n function onDone() {\n done = !0;\n }\n async function pump() {\n try {\n for await (let val of stream) {\n var _val;\n if (done)\n return;\n if (signal.aborted)\n throw new AbortError2;\n try {\n val = fn(val, signalOpt);\n } catch (err) {\n val = PromiseReject(err);\n }\n if (val === kEmpty)\n continue;\n if (typeof ((_val = val) === null || _val === void 0 \? void 0 : _val.catch) === \"function\")\n val.catch(onDone);\n if (queue.push(val), next)\n next(), next = null;\n if (!done && queue.length && queue.length >= concurrency)\n await new Promise2((resolve) => {\n resume = resolve;\n });\n }\n queue.push(kEof);\n } catch (err) {\n const val = PromiseReject(err);\n PromisePrototypeCatch(val, onDone), queue.push(val);\n } finally {\n var _options$signal3;\n if (done = !0, next)\n next(), next = null;\n options === null || options === void 0 || (_options$signal3 = options.signal) === null || _options$signal3 === void 0 || _options$signal3.removeEventListener(\"abort\", abort);\n }\n }\n pump();\n try {\n while (!0) {\n while (queue.length > 0) {\n const val = await queue[0];\n if (val === kEof)\n return;\n if (signal.aborted)\n throw new AbortError2;\n if (val !== kEmpty)\n yield val;\n if (queue.shift(), resume)\n resume(), resume = null;\n }\n await new Promise2((resolve) => {\n next = resolve;\n });\n }\n } finally {\n if (ac.abort(), done = !0, resume)\n resume(), resume = null;\n }\n }.@call(this);\n }\n function asIndexedPairs(options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return async function* asIndexedPairs2() {\n let index = 0;\n for await (let val of this) {\n var _options$signal4;\n if (options !== null && options !== void 0 && (_options$signal4 = options.signal) !== null && _options$signal4 !== void 0 && _options$signal4.aborted)\n throw new AbortError2({\n cause: options.signal.reason\n });\n yield [index++, val];\n }\n }.@call(this);\n }\n async function some(fn, options = void 0) {\n for await (let unused of filter.@call(this, fn, options))\n return !0;\n return !1;\n }\n async function every(fn, options = void 0) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n return !await some.@call(this, async (...args) => {\n return !await fn(...args);\n }, options);\n }\n async function find(fn, options) {\n for await (let result of filter.@call(this, fn, options))\n return result;\n return;\n }\n async function forEach(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n async function forEachFn(value, options2) {\n return await fn(value, options2), kEmpty;\n }\n for await (let unused of map.@call(this, forEachFn, options))\n ;\n }\n function filter(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n async function filterFn(value, options2) {\n if (await fn(value, options2))\n return value;\n return kEmpty;\n }\n return map.@call(this, filterFn, options);\n }\n var ReduceAwareErrMissingArgs = class extends ERR_MISSING_ARGS {\n constructor() {\n super(\"reduce\");\n this.message = \"Reduce of an empty stream requires an initial value\";\n }\n };\n async function reduce(reducer, initialValue, options) {\n var _options$signal5;\n if (typeof reducer !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"reducer\", [\"Function\", \"AsyncFunction\"], reducer);\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n let hasInitialValue = arguments.length > 1;\n if (options !== null && options !== void 0 && (_options$signal5 = options.signal) !== null && _options$signal5 !== void 0 && _options$signal5.aborted) {\n const err = new AbortError2(void 0, {\n cause: options.signal.reason\n });\n throw this.once(\"error\", () => {\n }), await finished(this.destroy(err)), err;\n }\n const ac = new AbortController, signal = ac.signal;\n if (options !== null && options !== void 0 && options.signal) {\n const opts = {\n once: !0,\n [kWeakHandler]: this\n };\n options.signal.addEventListener(\"abort\", () => ac.abort(), opts);\n }\n let gotAnyItemFromStream = !1;\n try {\n for await (let value of this) {\n var _options$signal6;\n if (gotAnyItemFromStream = !0, options !== null && options !== void 0 && (_options$signal6 = options.signal) !== null && _options$signal6 !== void 0 && _options$signal6.aborted)\n throw new AbortError2;\n if (!hasInitialValue)\n initialValue = value, hasInitialValue = !0;\n else\n initialValue = await reducer(initialValue, value, {\n signal\n });\n }\n if (!gotAnyItemFromStream && !hasInitialValue)\n throw new ReduceAwareErrMissingArgs;\n } finally {\n ac.abort();\n }\n return initialValue;\n }\n async function toArray(options) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n const result = [];\n for await (let val of this) {\n var _options$signal7;\n if (options !== null && options !== void 0 && (_options$signal7 = options.signal) !== null && _options$signal7 !== void 0 && _options$signal7.aborted)\n throw new AbortError2(void 0, {\n cause: options.signal.reason\n });\n ArrayPrototypePush(result, val);\n }\n return result;\n }\n function flatMap(fn, options) {\n const values = map.@call(this, fn, options);\n return async function* flatMap2() {\n for await (let val of values)\n yield* val;\n }.@call(this);\n }\n function toIntegerOrInfinity(number) {\n if (number = Number2(number), NumberIsNaN(number))\n return 0;\n if (number < 0)\n throw new ERR_OUT_OF_RANGE(\"number\", \">= 0\", number);\n return number;\n }\n function drop(number, options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return number = toIntegerOrInfinity(number), async function* drop2() {\n var _options$signal8;\n if (options !== null && options !== void 0 && (_options$signal8 = options.signal) !== null && _options$signal8 !== void 0 && _options$signal8.aborted)\n throw new AbortError2;\n for await (let val of this) {\n var _options$signal9;\n if (options !== null && options !== void 0 && (_options$signal9 = options.signal) !== null && _options$signal9 !== void 0 && _options$signal9.aborted)\n throw new AbortError2;\n if (number-- <= 0)\n yield val;\n }\n }.@call(this);\n }\n function take(number, options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return number = toIntegerOrInfinity(number), async function* take2() {\n var _options$signal10;\n if (options !== null && options !== void 0 && (_options$signal10 = options.signal) !== null && _options$signal10 !== void 0 && _options$signal10.aborted)\n throw new AbortError2;\n for await (let val of this) {\n var _options$signal11;\n if (options !== null && options !== void 0 && (_options$signal11 = options.signal) !== null && _options$signal11 !== void 0 && _options$signal11.aborted)\n throw new AbortError2;\n if (number-- > 0)\n yield val;\n else\n return;\n }\n }.@call(this);\n }\n module.exports.streamReturningOperators = {\n asIndexedPairs,\n drop,\n filter,\n flatMap,\n map,\n take\n }, module.exports.promiseReturningOperators = {\n every,\n forEach,\n reduce,\n toArray,\n some,\n find\n };\n }\n}), require_destroy = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/destroy.js\"(exports, module) {\n var {\n aggregateTwoErrors,\n codes: { ERR_MULTIPLE_CALLBACK },\n AbortError: AbortError2\n } = require_errors(), { Symbol: Symbol2 } = require_primordials(), { kDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils(), kDestroy = \"#kDestroy\", kConstruct = \"#kConstruct\";\n function checkError(err, w, r) {\n if (err) {\n if (err.stack, w && !w.errored)\n w.errored = err;\n if (r && !r.errored)\n r.errored = err;\n }\n }\n function destroy2(err, cb) {\n const r = this._readableState, w = this._writableState, s = w || r;\n if (w && w.destroyed || r && r.destroyed) {\n if (typeof cb === \"function\")\n cb();\n return this;\n }\n if (checkError(err, w, r), w)\n w.destroyed = !0;\n if (r)\n r.destroyed = !0;\n if (!s.constructed)\n this.once(kDestroy, (er) => {\n _destroy(this, aggregateTwoErrors(er, err), cb);\n });\n else\n _destroy(this, err, cb);\n return this;\n }\n function _destroy(self, err, cb) {\n let called = !1;\n function onDestroy(err2) {\n if (called)\n return;\n called = !0;\n const { _readableState: r, _writableState: w } = self;\n if (checkError(err2, w, r), w)\n w.closed = !0;\n if (r)\n r.closed = !0;\n if (typeof cb === \"function\")\n cb(err2);\n if (err2)\n runOnNextTick(emitErrorCloseNT, self, err2);\n else\n runOnNextTick(emitCloseNT, self);\n }\n try {\n self._destroy(err || null, onDestroy);\n } catch (err2) {\n onDestroy(err2);\n }\n }\n function emitErrorCloseNT(self, err) {\n emitErrorNT(self, err), emitCloseNT(self);\n }\n function emitCloseNT(self) {\n const { _readableState: r, _writableState: w } = self;\n if (w)\n w.closeEmitted = !0;\n if (r)\n r.closeEmitted = !0;\n if (w && w.emitClose || r && r.emitClose)\n self.emit(\"close\");\n }\n function emitErrorNT(self, err) {\n const r = self\?._readableState, w = self\?._writableState;\n if (w\?.errorEmitted || r\?.errorEmitted)\n return;\n if (w)\n w.errorEmitted = !0;\n if (r)\n r.errorEmitted = !0;\n self\?.emit\?.(\"error\", err);\n }\n function undestroy() {\n const r = this._readableState, w = this._writableState;\n if (r)\n r.constructed = !0, r.closed = !1, r.closeEmitted = !1, r.destroyed = !1, r.errored = null, r.errorEmitted = !1, r.reading = !1, r.ended = r.readable === !1, r.endEmitted = r.readable === !1;\n if (w)\n w.constructed = !0, w.destroyed = !1, w.closed = !1, w.closeEmitted = !1, w.errored = null, w.errorEmitted = !1, w.finalCalled = !1, w.prefinished = !1, w.ended = w.writable === !1, w.ending = w.writable === !1, w.finished = w.writable === !1;\n }\n function errorOrDestroy2(stream, err, sync) {\n const r = stream\?._readableState, w = stream\?._writableState;\n if (w && w.destroyed || r && r.destroyed)\n return this;\n if (r && r.autoDestroy || w && w.autoDestroy)\n stream.destroy(err);\n else if (err) {\n if (Error.captureStackTrace(err), w && !w.errored)\n w.errored = err;\n if (r && !r.errored)\n r.errored = err;\n if (sync)\n runOnNextTick(emitErrorNT, stream, err);\n else\n emitErrorNT(stream, err);\n }\n }\n function construct(stream, cb) {\n if (typeof stream._construct !== \"function\")\n return;\n const { _readableState: r, _writableState: w } = stream;\n if (r)\n r.constructed = !1;\n if (w)\n w.constructed = !1;\n if (stream.once(kConstruct, cb), stream.listenerCount(kConstruct) > 1)\n return;\n runOnNextTick(constructNT, stream);\n }\n function constructNT(stream) {\n let called = !1;\n function onConstruct(err) {\n if (called) {\n errorOrDestroy2(stream, err !== null && err !== void 0 \? err : new ERR_MULTIPLE_CALLBACK);\n return;\n }\n called = !0;\n const { _readableState: r, _writableState: w } = stream, s = w || r;\n if (r)\n r.constructed = !0;\n if (w)\n w.constructed = !0;\n if (s.destroyed)\n stream.emit(kDestroy, err);\n else if (err)\n errorOrDestroy2(stream, err, !0);\n else\n runOnNextTick(emitConstructNT, stream);\n }\n try {\n stream._construct(onConstruct);\n } catch (err) {\n onConstruct(err);\n }\n }\n function emitConstructNT(stream) {\n stream.emit(kConstruct);\n }\n function isRequest(stream) {\n return stream && stream.setHeader && typeof stream.abort === \"function\";\n }\n function emitCloseLegacy(stream) {\n stream.emit(\"close\");\n }\n function emitErrorCloseLegacy(stream, err) {\n stream.emit(\"error\", err), runOnNextTick(emitCloseLegacy, stream);\n }\n function destroyer(stream, err) {\n if (!stream || isDestroyed(stream))\n return;\n if (!err && !isFinished(stream))\n err = new AbortError2;\n if (isServerRequest(stream))\n stream.socket = null, stream.destroy(err);\n else if (isRequest(stream))\n stream.abort();\n else if (isRequest(stream.req))\n stream.req.abort();\n else if (typeof stream.destroy === \"function\")\n stream.destroy(err);\n else if (typeof stream.close === \"function\")\n stream.close();\n else if (err)\n runOnNextTick(emitErrorCloseLegacy, stream);\n else\n runOnNextTick(emitCloseLegacy, stream);\n if (!stream.destroyed)\n stream[kDestroyed] = !0;\n }\n module.exports = {\n construct,\n destroyer,\n destroy: destroy2,\n undestroy,\n errorOrDestroy: errorOrDestroy2\n };\n }\n}), require_legacy = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/legacy.js\"(exports, module) {\n var { ArrayIsArray: ArrayIsArray2, ObjectSetPrototypeOf } = require_primordials();\n function Stream(options) {\n if (!(this instanceof Stream))\n return new Stream(options);\n EE.@call(this, options);\n }\n Stream.prototype = {}, ObjectSetPrototypeOf(Stream.prototype, EE.prototype), ObjectSetPrototypeOf(Stream, EE), Stream.prototype.pipe = function(dest, options) {\n const source = this;\n function ondata(chunk) {\n if (dest.writable && dest.write(chunk) === !1 && source.pause)\n source.pause();\n }\n source.on(\"data\", ondata);\n function ondrain() {\n if (source.readable && source.resume)\n source.resume();\n }\n if (dest.on(\"drain\", ondrain), !dest._isStdio && (!options || options.end !== !1))\n source.on(\"end\", onend), source.on(\"close\", onclose);\n let didOnEnd = !1;\n function onend() {\n if (didOnEnd)\n return;\n didOnEnd = !0, dest.end();\n }\n function onclose() {\n if (didOnEnd)\n return;\n if (didOnEnd = !0, typeof dest.destroy === \"function\")\n dest.destroy();\n }\n function onerror(er) {\n if (cleanup(), EE.listenerCount(this, \"error\") === 0)\n this.emit(\"error\", er);\n }\n prependListener(source, \"error\", onerror), prependListener(dest, \"error\", onerror);\n function cleanup() {\n source.removeListener(\"data\", ondata), dest.removeListener(\"drain\", ondrain), source.removeListener(\"end\", onend), source.removeListener(\"close\", onclose), source.removeListener(\"error\", onerror), dest.removeListener(\"error\", onerror), source.removeListener(\"end\", cleanup), source.removeListener(\"close\", cleanup), dest.removeListener(\"close\", cleanup);\n }\n return source.on(\"end\", cleanup), source.on(\"close\", cleanup), dest.on(\"close\", cleanup), dest.emit(\"pipe\", source), dest;\n };\n function prependListener(emitter, event, fn) {\n if (typeof emitter.prependListener === \"function\")\n return emitter.prependListener(event, fn);\n if (!emitter._events || !emitter._events[event])\n emitter.on(event, fn);\n else if (ArrayIsArray2(emitter._events[event]))\n emitter._events[event].unshift(fn);\n else\n emitter._events[event] = [fn, emitter._events[event]];\n }\n module.exports = {\n Stream,\n prependListener\n };\n }\n}), require_add_abort_signal = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/add-abort-signal.js\"(exports, module) {\n var { AbortError: AbortError2, codes } = require_errors(), eos = require_end_of_stream(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2 } = codes, validateAbortSignal = (signal, name) => {\n if (typeof signal !== \"object\" || !(\"aborted\" in signal))\n throw new ERR_INVALID_ARG_TYPE2(name, \"AbortSignal\", signal);\n };\n function isNodeStream(obj) {\n return !!(obj && typeof obj.pipe === \"function\");\n }\n module.exports.addAbortSignal = function addAbortSignal(signal, stream) {\n if (validateAbortSignal(signal, \"signal\"), !isNodeStream(stream))\n throw new ERR_INVALID_ARG_TYPE2(\"stream\", \"stream.Stream\", stream);\n return module.exports.addAbortSignalNoValidate(signal, stream);\n }, module.exports.addAbortSignalNoValidate = function(signal, stream) {\n if (typeof signal !== \"object\" || !(\"aborted\" in signal))\n return stream;\n const onAbort = () => {\n stream.destroy(new AbortError2(void 0, {\n cause: signal.reason\n }));\n };\n if (signal.aborted)\n onAbort();\n else\n signal.addEventListener(\"abort\", onAbort), eos(stream, () => signal.removeEventListener(\"abort\", onAbort));\n return stream;\n };\n }\n}), require_state = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/state.js\"(exports, module) {\n var { MathFloor, NumberIsInteger } = require_primordials(), { ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2 } = require_errors().codes;\n function highWaterMarkFrom(options, isDuplex, duplexKey) {\n return options.highWaterMark != null \? options.highWaterMark : isDuplex \? options[duplexKey] : null;\n }\n function getDefaultHighWaterMark(objectMode) {\n return objectMode \? 16 : 16384;\n }\n function getHighWaterMark(state, options, duplexKey, isDuplex) {\n const hwm = highWaterMarkFrom(options, isDuplex, duplexKey);\n if (hwm != null) {\n if (!NumberIsInteger(hwm) || hwm < 0) {\n const name = isDuplex \? `options.${duplexKey}` : \"options.highWaterMark\";\n throw new ERR_INVALID_ARG_VALUE2(name, hwm);\n }\n return MathFloor(hwm);\n }\n return getDefaultHighWaterMark(state.objectMode);\n }\n module.exports = {\n getHighWaterMark,\n getDefaultHighWaterMark\n };\n }\n}), require_from = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/from.js\"(exports, module) {\n var { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_NULL_VALUES } = require_errors().codes;\n function from(Readable, iterable, opts) {\n let iterator;\n if (typeof iterable === \"string\" || iterable instanceof @Buffer)\n return new Readable({\n objectMode: !0,\n ...opts,\n read() {\n this.push(iterable), this.push(null);\n }\n });\n let isAsync;\n if (iterable && iterable[SymbolAsyncIterator])\n isAsync = !0, iterator = iterable[SymbolAsyncIterator]();\n else if (iterable && iterable[SymbolIterator])\n isAsync = !1, iterator = iterable[SymbolIterator]();\n else\n throw new ERR_INVALID_ARG_TYPE2(\"iterable\", [\"Iterable\"], iterable);\n const readable = new Readable({\n objectMode: !0,\n highWaterMark: 1,\n ...opts\n });\n let reading = !1;\n readable._read = function() {\n if (!reading)\n reading = !0, next();\n }, readable._destroy = function(error, cb) {\n PromisePrototypeThen(close(error), () => runOnNextTick(cb, error), (e) => runOnNextTick(cb, e || error));\n };\n async function close(error) {\n const hadError = error !== void 0 && error !== null, hasThrow = typeof iterator.throw === \"function\";\n if (hadError && hasThrow) {\n const { value, done } = await iterator.throw(error);\n if (await value, done)\n return;\n }\n if (typeof iterator.return === \"function\") {\n const { value } = await iterator.return();\n await value;\n }\n }\n async function next() {\n for (;; ) {\n try {\n const { value, done } = isAsync \? await iterator.next() : iterator.next();\n if (done)\n readable.push(null);\n else {\n const res = value && typeof value.then === \"function\" \? await value : value;\n if (res === null)\n throw reading = !1, new ERR_STREAM_NULL_VALUES;\n else if (readable.push(res))\n continue;\n else\n reading = !1;\n }\n } catch (err) {\n readable.destroy(err);\n }\n break;\n }\n }\n return readable;\n }\n module.exports = from;\n }\n}), _ReadableFromWeb, _ReadableFromWebForUndici, require_readable = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/readable.js\"(exports, module) {\n var {\n ArrayPrototypeIndexOf,\n NumberIsInteger,\n NumberIsNaN,\n NumberParseInt,\n ObjectDefineProperties,\n ObjectKeys,\n ObjectSetPrototypeOf,\n Promise: Promise2,\n SafeSet,\n SymbolAsyncIterator,\n Symbol: Symbol2\n } = require_primordials(), ReadableState = @lazy(\"bun:stream\").ReadableState, { Stream, prependListener } = require_legacy();\n function Readable(options) {\n if (!(this instanceof Readable))\n return new Readable(options);\n const isDuplex = this instanceof require_duplex();\n if (this._readableState = new ReadableState(options, this, isDuplex), options) {\n const { read, destroy: destroy2, construct, signal } = options;\n if (typeof read === \"function\")\n this._read = read;\n if (typeof destroy2 === \"function\")\n this._destroy = destroy2;\n if (typeof construct === \"function\")\n this._construct = construct;\n if (signal && !isDuplex)\n addAbortSignal(signal, this);\n }\n Stream.@call(this, options), destroyImpl.construct(this, () => {\n if (this._readableState.needReadable)\n maybeReadMore(this, this._readableState);\n });\n }\n Readable.prototype = {}, ObjectSetPrototypeOf(Readable.prototype, Stream.prototype), ObjectSetPrototypeOf(Readable, Stream), Readable.prototype.on = function(ev, fn) {\n const res = Stream.prototype.on.@call(this, ev, fn), state = this._readableState;\n if (ev === \"data\") {\n if (state.readableListening = this.listenerCount(\"readable\") > 0, state.flowing !== !1)\n this.resume();\n } else if (ev === \"readable\") {\n if (!state.endEmitted && !state.readableListening) {\n if (state.readableListening = state.needReadable = !0, state.flowing = !1, state.emittedReadable = !1, state.length)\n emitReadable(this, state);\n else if (!state.reading)\n runOnNextTick(nReadingNextTick, this);\n } else if (state.endEmitted)\n ;\n }\n return res;\n };\n\n class ReadableFromWeb extends Readable {\n #reader;\n #closed;\n #pendingChunks;\n #stream;\n constructor(options, stream) {\n const { objectMode, highWaterMark, encoding, signal } = options;\n super({\n objectMode,\n highWaterMark,\n encoding,\n signal\n });\n this.#pendingChunks = [], this.#reader = @undefined, this.#stream = stream, this.#closed = !1;\n }\n #drainPending() {\n var pendingChunks = this.#pendingChunks, pendingChunksI = 0, pendingChunksCount = pendingChunks.length;\n for (;pendingChunksI < pendingChunksCount; pendingChunksI++) {\n const chunk = pendingChunks[pendingChunksI];\n if (pendingChunks[pendingChunksI] = @undefined, !this.push(chunk, @undefined))\n return this.#pendingChunks = pendingChunks.slice(pendingChunksI + 1), !0;\n }\n if (pendingChunksCount > 0)\n this.#pendingChunks = [];\n return !1;\n }\n #handleDone(reader) {\n reader.releaseLock(), this.#reader = @undefined, this.#closed = !0, this.push(null);\n return;\n }\n async _read() {\n var stream = this.#stream, reader = this.#reader;\n if (stream)\n reader = this.#reader = stream.getReader(), this.#stream = @undefined;\n else if (this.#drainPending())\n return;\n var deferredError;\n try {\n do {\n var done = !1, value;\n const firstResult = reader.readMany();\n if (@isPromise(firstResult)) {\n if ({ done, value } = await firstResult, this.#closed) {\n this.#pendingChunks.push(...value);\n return;\n }\n } else\n ({ done, value } = firstResult);\n if (done) {\n this.#handleDone(reader);\n return;\n }\n if (!this.push(value[0])) {\n this.#pendingChunks = value.slice(1);\n return;\n }\n for (let i = 1, count = value.length;i < count; i++)\n if (!this.push(value[i])) {\n this.#pendingChunks = value.slice(i + 1);\n return;\n }\n } while (!this.#closed);\n } catch (e) {\n deferredError = e;\n } finally {\n if (deferredError)\n throw deferredError;\n }\n }\n _destroy(error, callback) {\n if (!this.#closed) {\n var reader = this.#reader;\n if (reader)\n this.#reader = @undefined, reader.cancel(error).finally(() => {\n this.#closed = !0, callback(error);\n });\n return;\n }\n try {\n callback(error);\n } catch (error2) {\n globalThis.reportError(error2);\n }\n }\n }\n _ReadableFromWebForUndici = ReadableFromWeb;\n function newStreamReadableFromReadableStream(readableStream, options = {}) {\n if (!isReadableStream(readableStream))\n throw new ERR_INVALID_ARG_TYPE2(\"readableStream\", \"ReadableStream\", readableStream);\n validateObject(options, \"options\");\n const {\n highWaterMark,\n encoding,\n objectMode = !1,\n signal\n } = options;\n if (encoding !== @undefined && !@Buffer.isEncoding(encoding))\n throw new ERR_INVALID_ARG_VALUE(encoding, \"options.encoding\");\n return validateBoolean(objectMode, \"options.objectMode\"), getNativeReadableStream(Readable, readableStream, options) || new ReadableFromWeb({\n highWaterMark,\n encoding,\n objectMode,\n signal\n }, readableStream);\n }\n module.exports = Readable, _ReadableFromWeb = newStreamReadableFromReadableStream;\n var { addAbortSignal } = require_add_abort_signal(), eos = require_end_of_stream();\n const { maybeReadMore: _maybeReadMore, resume, emitReadable: _emitReadable, onEofChunk } = @lazy(\"bun:stream\");\n function maybeReadMore(stream, state) {\n process.nextTick(_maybeReadMore, stream, state);\n }\n function emitReadable(stream, state) {\n _emitReadable(stream, state);\n }\n var destroyImpl = require_destroy(), {\n aggregateTwoErrors,\n codes: {\n ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_OUT_OF_RANGE,\n ERR_STREAM_PUSH_AFTER_EOF,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT\n }\n } = require_errors(), { validateObject } = require_validators(), from = require_from(), nop = () => {\n }, { errorOrDestroy: errorOrDestroy2 } = destroyImpl;\n Readable.prototype.destroy = destroyImpl.destroy, Readable.prototype._undestroy = destroyImpl.undestroy, Readable.prototype._destroy = function(err, cb) {\n cb(err);\n }, Readable.prototype[EE.captureRejectionSymbol] = function(err) {\n this.destroy(err);\n }, Readable.prototype.push = function(chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, !1);\n }, Readable.prototype.unshift = function(chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, !0);\n };\n function readableAddChunk(stream, chunk, encoding, addToFront) {\n const state = stream._readableState;\n let err;\n if (!state.objectMode) {\n if (typeof chunk === \"string\") {\n if (encoding = encoding || state.defaultEncoding, state.encoding !== encoding)\n if (addToFront && state.encoding)\n chunk = @Buffer.from(chunk, encoding).toString(state.encoding);\n else\n chunk = @Buffer.from(chunk, encoding), encoding = \"\";\n } else if (chunk instanceof @Buffer)\n encoding = \"\";\n else if (Stream._isUint8Array(chunk)) {\n if (addToFront || !state.decoder)\n chunk = Stream._uint8ArrayToBuffer(chunk);\n encoding = \"\";\n } else if (chunk != null)\n err = new ERR_INVALID_ARG_TYPE2(\"chunk\", [\"string\", \"Buffer\", \"Uint8Array\"], chunk);\n }\n if (err)\n errorOrDestroy2(stream, err);\n else if (chunk === null)\n state.reading = !1, onEofChunk(stream, state);\n else if (state.objectMode || chunk && chunk.length > 0)\n if (addToFront)\n if (state.endEmitted)\n errorOrDestroy2(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT);\n else if (state.destroyed || state.errored)\n return !1;\n else\n addChunk(stream, state, chunk, !0);\n else if (state.ended)\n errorOrDestroy2(stream, new ERR_STREAM_PUSH_AFTER_EOF);\n else if (state.destroyed || state.errored)\n return !1;\n else if (state.reading = !1, state.decoder && !encoding)\n if (chunk = state.decoder.write(chunk), state.objectMode || chunk.length !== 0)\n addChunk(stream, state, chunk, !1);\n else\n maybeReadMore(stream, state);\n else\n addChunk(stream, state, chunk, !1);\n else if (!addToFront)\n state.reading = !1, maybeReadMore(stream, state);\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n }\n function addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync && stream.listenerCount(\"data\") > 0) {\n if (state.multiAwaitDrain)\n state.awaitDrainWriters.clear();\n else\n state.awaitDrainWriters = null;\n state.dataEmitted = !0, stream.emit(\"data\", chunk);\n } else {\n if (state.length += state.objectMode \? 1 : chunk.length, addToFront)\n state.buffer.unshift(chunk);\n else\n state.buffer.push(chunk);\n if (state.needReadable)\n emitReadable(stream, state);\n }\n maybeReadMore(stream, state);\n }\n Readable.prototype.isPaused = function() {\n const state = this._readableState;\n return state.paused === !0 || state.flowing === !1;\n }, Readable.prototype.setEncoding = function(enc) {\n const decoder = new StringDecoder(enc);\n this._readableState.decoder = decoder, this._readableState.encoding = this._readableState.decoder.encoding;\n const buffer = this._readableState.buffer;\n let content = \"\";\n for (let i = buffer.length;i > 0; i--)\n content += decoder.write(buffer.shift());\n if (content !== \"\")\n buffer.push(content);\n return this._readableState.length = content.length, this;\n };\n var MAX_HWM = 1073741824;\n function computeNewHighWaterMark(n) {\n if (n > MAX_HWM)\n throw new ERR_OUT_OF_RANGE(\"size\", \"<= 1GiB\", n);\n else\n n--, n |= n >>> 1, n |= n >>> 2, n |= n >>> 4, n |= n >>> 8, n |= n >>> 16, n++;\n return n;\n }\n function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended)\n return 0;\n if (state.objectMode)\n return 1;\n if (NumberIsNaN(n)) {\n if (state.flowing && state.length)\n return state.buffer.first().length;\n return state.length;\n }\n if (n <= state.length)\n return n;\n return state.ended \? state.length : 0;\n }\n Readable.prototype.read = function(n) {\n if (!NumberIsInteger(n))\n n = NumberParseInt(n, 10);\n const state = this._readableState, nOrig = n;\n if (n > state.highWaterMark)\n state.highWaterMark = computeNewHighWaterMark(n);\n if (n !== 0)\n state.emittedReadable = !1;\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 \? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n if (state.length === 0 && state.ended)\n endReadable(this);\n else\n emitReadable(this, state);\n return null;\n }\n if (n = howMuchToRead(n, state), n === 0 && state.ended) {\n if (state.length === 0)\n endReadable(this);\n return null;\n }\n let doRead = state.needReadable;\n if (state.length === 0 || state.length - n < state.highWaterMark)\n doRead = !0;\n if (state.ended || state.reading || state.destroyed || state.errored || !state.constructed)\n doRead = !1;\n else if (doRead) {\n if (state.reading = !0, state.sync = !0, state.length === 0)\n state.needReadable = !0;\n try {\n var result = this._read(state.highWaterMark);\n if (@isPromise(result)) {\n const peeked = Bun.peek(result);\n if (peeked !== result)\n result = peeked;\n }\n if (@isPromise(result) && result\?.then && @isCallable(result.then))\n result.then(nop, function(err) {\n errorOrDestroy2(this, err);\n });\n } catch (err) {\n errorOrDestroy2(this, err);\n }\n if (state.sync = !1, !state.reading)\n n = howMuchToRead(nOrig, state);\n }\n let ret;\n if (n > 0)\n ret = fromList(n, state);\n else\n ret = null;\n if (ret === null)\n state.needReadable = state.length <= state.highWaterMark, n = 0;\n else if (state.length -= n, state.multiAwaitDrain)\n state.awaitDrainWriters.clear();\n else\n state.awaitDrainWriters = null;\n if (state.length === 0) {\n if (!state.ended)\n state.needReadable = !0;\n if (nOrig !== n && state.ended)\n endReadable(this);\n }\n if (ret !== null && !state.errorEmitted && !state.closeEmitted)\n state.dataEmitted = !0, this.emit(\"data\", ret);\n return ret;\n }, Readable.prototype._read = function(n) {\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_read()\");\n }, Readable.prototype.pipe = function(dest, pipeOpts) {\n const src = this, state = this._readableState;\n if (state.pipes.length === 1) {\n if (!state.multiAwaitDrain)\n state.multiAwaitDrain = !0, state.awaitDrainWriters = new SafeSet(state.awaitDrainWriters \? [state.awaitDrainWriters] : []);\n }\n state.pipes.push(dest);\n const endFn = (!pipeOpts || pipeOpts.end !== !1) && dest !== process.stdout && dest !== process.stderr \? onend : unpipe;\n if (state.endEmitted)\n runOnNextTick(endFn);\n else\n src.once(\"end\", endFn);\n dest.on(\"unpipe\", onunpipe);\n function onunpipe(readable, unpipeInfo) {\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === !1)\n unpipeInfo.hasUnpiped = !0, cleanup();\n }\n }\n function onend() {\n dest.end();\n }\n let ondrain, cleanedUp = !1;\n function cleanup() {\n if (dest.removeListener(\"close\", onclose), dest.removeListener(\"finish\", onfinish), ondrain)\n dest.removeListener(\"drain\", ondrain);\n if (dest.removeListener(\"error\", onerror), dest.removeListener(\"unpipe\", onunpipe), src.removeListener(\"end\", onend), src.removeListener(\"end\", unpipe), src.removeListener(\"data\", ondata), cleanedUp = !0, ondrain && state.awaitDrainWriters && (!dest._writableState || dest._writableState.needDrain))\n ondrain();\n }\n function pause() {\n if (!cleanedUp) {\n if (state.pipes.length === 1 && state.pipes[0] === dest)\n state.awaitDrainWriters = dest, state.multiAwaitDrain = !1;\n else if (state.pipes.length > 1 && state.pipes.includes(dest))\n state.awaitDrainWriters.add(dest);\n src.pause();\n }\n if (!ondrain)\n ondrain = pipeOnDrain(src, dest), dest.on(\"drain\", ondrain);\n }\n src.on(\"data\", ondata);\n function ondata(chunk) {\n if (dest.write(chunk) === !1)\n pause();\n }\n function onerror(er) {\n if (unpipe(), dest.removeListener(\"error\", onerror), dest.listenerCount(\"error\") === 0) {\n const s = dest._writableState || dest._readableState;\n if (s && !s.errorEmitted)\n errorOrDestroy2(dest, er);\n else\n dest.emit(\"error\", er);\n }\n }\n prependListener(dest, \"error\", onerror);\n function onclose() {\n dest.removeListener(\"finish\", onfinish), unpipe();\n }\n dest.once(\"close\", onclose);\n function onfinish() {\n dest.removeListener(\"close\", onclose), unpipe();\n }\n dest.once(\"finish\", onfinish);\n function unpipe() {\n src.unpipe(dest);\n }\n if (dest.emit(\"pipe\", src), dest.writableNeedDrain === !0) {\n if (state.flowing)\n pause();\n } else if (!state.flowing)\n src.resume();\n return dest;\n };\n function pipeOnDrain(src, dest) {\n return function pipeOnDrainFunctionResult() {\n const state = src._readableState;\n if (state.awaitDrainWriters === dest)\n state.awaitDrainWriters = null;\n else if (state.multiAwaitDrain)\n state.awaitDrainWriters.delete(dest);\n if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && src.listenerCount(\"data\"))\n src.resume();\n };\n }\n Readable.prototype.unpipe = function(dest) {\n const state = this._readableState, unpipeInfo = {\n hasUnpiped: !1\n };\n if (state.pipes.length === 0)\n return this;\n if (!dest) {\n const dests = state.pipes;\n state.pipes = [], this.pause();\n for (let i = 0;i < dests.length; i++)\n dests[i].emit(\"unpipe\", this, {\n hasUnpiped: !1\n });\n return this;\n }\n const index = ArrayPrototypeIndexOf(state.pipes, dest);\n if (index === -1)\n return this;\n if (state.pipes.splice(index, 1), state.pipes.length === 0)\n this.pause();\n return dest.emit(\"unpipe\", this, unpipeInfo), this;\n }, Readable.prototype.addListener = Readable.prototype.on, Readable.prototype.removeListener = function(ev, fn) {\n const res = Stream.prototype.removeListener.@call(this, ev, fn);\n if (ev === \"readable\")\n runOnNextTick(updateReadableListening, this);\n return res;\n }, Readable.prototype.off = Readable.prototype.removeListener, Readable.prototype.removeAllListeners = function(ev) {\n const res = Stream.prototype.removeAllListeners.@apply(this, arguments);\n if (ev === \"readable\" || ev === void 0)\n runOnNextTick(updateReadableListening, this);\n return res;\n };\n function updateReadableListening(self) {\n const state = self._readableState;\n if (state.readableListening = self.listenerCount(\"readable\") > 0, state.resumeScheduled && state.paused === !1)\n state.flowing = !0;\n else if (self.listenerCount(\"data\") > 0)\n self.resume();\n else if (!state.readableListening)\n state.flowing = null;\n }\n function nReadingNextTick(self) {\n self.read(0);\n }\n Readable.prototype.resume = function() {\n const state = this._readableState;\n if (!state.flowing)\n state.flowing = !state.readableListening, resume(this, state);\n return state.paused = !1, this;\n }, Readable.prototype.pause = function() {\n if (this._readableState.flowing !== !1)\n this._readableState.flowing = !1, this.emit(\"pause\");\n return this._readableState.paused = !0, this;\n }, Readable.prototype.wrap = function(stream) {\n let paused = !1;\n stream.on(\"data\", (chunk) => {\n if (!this.push(chunk) && stream.pause)\n paused = !0, stream.pause();\n }), stream.on(\"end\", () => {\n this.push(null);\n }), stream.on(\"error\", (err) => {\n errorOrDestroy2(this, err);\n }), stream.on(\"close\", () => {\n this.destroy();\n }), stream.on(\"destroy\", () => {\n this.destroy();\n }), this._read = () => {\n if (paused && stream.resume)\n paused = !1, stream.resume();\n };\n const streamKeys = ObjectKeys(stream);\n for (let j = 1;j < streamKeys.length; j++) {\n const i = streamKeys[j];\n if (this[i] === void 0 && typeof stream[i] === \"function\")\n this[i] = stream[i].bind(stream);\n }\n return this;\n }, Readable.prototype[SymbolAsyncIterator] = function() {\n return streamToAsyncIterator(this);\n }, Readable.prototype.iterator = function(options) {\n if (options !== void 0)\n validateObject(options, \"options\");\n return streamToAsyncIterator(this, options);\n };\n function streamToAsyncIterator(stream, options) {\n if (typeof stream.read !== \"function\")\n stream = Readable.wrap(stream, {\n objectMode: !0\n });\n const iter = createAsyncIterator(stream, options);\n return iter.stream = stream, iter;\n }\n async function* createAsyncIterator(stream, options) {\n let callback = nop;\n function next(resolve) {\n if (this === stream)\n callback(), callback = nop;\n else\n callback = resolve;\n }\n stream.on(\"readable\", next);\n let error;\n const cleanup = eos(stream, {\n writable: !1\n }, (err) => {\n error = err \? aggregateTwoErrors(error, err) : null, callback(), callback = nop;\n });\n try {\n while (!0) {\n const chunk = stream.destroyed \? null : stream.read();\n if (chunk !== null)\n yield chunk;\n else if (error)\n throw error;\n else if (error === null)\n return;\n else\n await new Promise2(next);\n }\n } catch (err) {\n throw error = aggregateTwoErrors(error, err), error;\n } finally {\n if ((error || (options === null || options === void 0 \? void 0 : options.destroyOnReturn) !== !1) && (error === void 0 || stream._readableState.autoDestroy))\n destroyImpl.destroyer(stream, null);\n else\n stream.off(\"readable\", next), cleanup();\n }\n }\n ObjectDefineProperties(Readable.prototype, {\n readable: {\n get() {\n const r = this._readableState;\n return !!r && r.readable !== !1 && !r.destroyed && !r.errorEmitted && !r.endEmitted;\n },\n set(val) {\n if (this._readableState)\n this._readableState.readable = !!val;\n }\n },\n readableDidRead: {\n enumerable: !1,\n get: function() {\n return this._readableState.dataEmitted;\n }\n },\n readableAborted: {\n enumerable: !1,\n get: function() {\n return !!(this._readableState.readable !== !1 && (this._readableState.destroyed || this._readableState.errored) && !this._readableState.endEmitted);\n }\n },\n readableHighWaterMark: {\n enumerable: !1,\n get: function() {\n return this._readableState.highWaterMark;\n }\n },\n readableBuffer: {\n enumerable: !1,\n get: function() {\n return this._readableState && this._readableState.buffer;\n }\n },\n readableFlowing: {\n enumerable: !1,\n get: function() {\n return this._readableState.flowing;\n },\n set: function(state) {\n if (this._readableState)\n this._readableState.flowing = state;\n }\n },\n readableLength: {\n enumerable: !1,\n get() {\n return this._readableState.length;\n }\n },\n readableObjectMode: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.objectMode : !1;\n }\n },\n readableEncoding: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.encoding : null;\n }\n },\n errored: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.errored : null;\n }\n },\n closed: {\n get() {\n return this._readableState \? this._readableState.closed : !1;\n }\n },\n destroyed: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.destroyed : !1;\n },\n set(value) {\n if (!this._readableState)\n return;\n this._readableState.destroyed = value;\n }\n },\n readableEnded: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.endEmitted : !1;\n }\n }\n }), Readable._fromList = fromList;\n function fromList(n, state) {\n if (state.length === 0)\n return null;\n let ret;\n if (state.objectMode)\n ret = state.buffer.shift();\n else if (!n || n >= state.length) {\n if (state.decoder)\n ret = state.buffer.join(\"\");\n else if (state.buffer.length === 1)\n ret = state.buffer.first();\n else\n ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else\n ret = state.buffer.consume(n, state.decoder);\n return ret;\n }\n function endReadable(stream) {\n const state = stream._readableState;\n if (!state.endEmitted)\n state.ended = !0, runOnNextTick(endReadableNT, state, stream);\n }\n function endReadableNT(state, stream) {\n if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) {\n if (state.endEmitted = !0, stream.emit(\"end\"), stream.writable && stream.allowHalfOpen === !1)\n runOnNextTick(endWritableNT, stream);\n else if (state.autoDestroy) {\n const wState = stream._writableState;\n if (!wState || wState.autoDestroy && (wState.finished || wState.writable === !1))\n stream.destroy();\n }\n }\n }\n function endWritableNT(stream) {\n if (stream.writable && !stream.writableEnded && !stream.destroyed)\n stream.end();\n }\n Readable.from = function(iterable, opts) {\n return from(Readable, iterable, opts);\n };\n var webStreamsAdapters = {\n newStreamReadableFromReadableStream,\n newReadableStreamFromStreamReadable(streamReadable, options = {}) {\n if (typeof streamReadable\?._readableState !== \"object\")\n throw new ERR_INVALID_ARG_TYPE2(\"streamReadable\", \"stream.Readable\", streamReadable);\n var { isDestroyed, isReadable } = require_utils();\n if (isDestroyed(streamReadable) || !isReadable(streamReadable)) {\n const readable = new @ReadableStream;\n return readable.cancel(), readable;\n }\n const { readableObjectMode: objectMode, readableHighWaterMark: highWaterMark } = streamReadable, strategy = ((strategy2) => {\n if (strategy2)\n return strategy2;\n if (objectMode)\n return new CountQueuingStrategy({ highWaterMark });\n return { highWaterMark };\n })(options\?.strategy);\n let controller;\n function onData(chunk) {\n if (controller.enqueue(chunk), controller.desiredSize <= 0)\n streamReadable.pause();\n }\n streamReadable.pause();\n const cleanup = eos(streamReadable, (error) => {\n if (error\?.code === \"ERR_STREAM_PREMATURE_CLOSE\")\n error = new AbortError(@undefined, { cause: error });\n if (cleanup(), streamReadable.on(\"error\", () => {\n }), error)\n return controller.error(error);\n controller.close();\n });\n return streamReadable.on(\"data\", onData), new @ReadableStream({\n start(c) {\n controller = c;\n },\n pull() {\n streamReadable.resume();\n },\n cancel(reason) {\n destroy(streamReadable, reason);\n }\n }, strategy);\n }\n };\n Readable.fromWeb = function(readableStream, options) {\n return webStreamsAdapters.newStreamReadableFromReadableStream(readableStream, options);\n }, Readable.toWeb = function(streamReadable, options) {\n return webStreamsAdapters.newReadableStreamFromStreamReadable(streamReadable, options);\n }, Readable.wrap = function(src, options) {\n var _ref, _src$readableObjectMo;\n return new Readable({\n objectMode: (_ref = (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== void 0 \? _src$readableObjectMo : src.objectMode) !== null && _ref !== void 0 \? _ref : !0,\n ...options,\n destroy(err, callback) {\n destroyImpl.destroyer(src, err), callback(err);\n }\n }).wrap(src);\n };\n }\n}), require_writable = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/writable.js\"(exports, module) {\n var {\n ArrayPrototypeSlice,\n Error: Error2,\n FunctionPrototypeSymbolHasInstance,\n ObjectDefineProperty,\n ObjectDefineProperties,\n ObjectSetPrototypeOf,\n StringPrototypeToLowerCase,\n Symbol: Symbol2,\n SymbolHasInstance\n } = require_primordials(), Stream = require_legacy().Stream, destroyImpl = require_destroy(), { addAbortSignal } = require_add_abort_signal(), { getHighWaterMark, getDefaultHighWaterMark } = require_state(), {\n ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK,\n ERR_STREAM_CANNOT_PIPE,\n ERR_STREAM_DESTROYED,\n ERR_STREAM_ALREADY_FINISHED,\n ERR_STREAM_NULL_VALUES,\n ERR_STREAM_WRITE_AFTER_END,\n ERR_UNKNOWN_ENCODING\n } = require_errors().codes, { errorOrDestroy: errorOrDestroy2 } = destroyImpl;\n function Writable(options = {}) {\n const isDuplex = this instanceof require_duplex();\n if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable, this))\n return new Writable(options);\n if (this._writableState = new WritableState(options, this, isDuplex), options) {\n if (typeof options.write === \"function\")\n this._write = options.write;\n if (typeof options.writev === \"function\")\n this._writev = options.writev;\n if (typeof options.destroy === \"function\")\n this._destroy = options.destroy;\n if (typeof options.final === \"function\")\n this._final = options.final;\n if (typeof options.construct === \"function\")\n this._construct = options.construct;\n if (options.signal)\n addAbortSignal(options.signal, this);\n }\n Stream.@call(this, options), destroyImpl.construct(this, () => {\n const state = this._writableState;\n if (!state.writing)\n clearBuffer(this, state);\n finishMaybe(this, state);\n });\n }\n Writable.prototype = {}, ObjectSetPrototypeOf(Writable.prototype, Stream.prototype), ObjectSetPrototypeOf(Writable, Stream), module.exports = Writable;\n function nop() {\n }\n var kOnFinished = Symbol2(\"kOnFinished\");\n function WritableState(options, stream, isDuplex) {\n if (typeof isDuplex !== \"boolean\")\n isDuplex = stream instanceof require_duplex();\n if (this.objectMode = !!(options && options.objectMode), isDuplex)\n this.objectMode = this.objectMode || !!(options && options.writableObjectMode);\n this.highWaterMark = options \? getHighWaterMark(this, options, \"writableHighWaterMark\", isDuplex) : getDefaultHighWaterMark(!1), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;\n const noDecode = !!(options && options.decodeStrings === !1);\n this.decodeStrings = !noDecode, this.defaultEncoding = options && options.defaultEncoding || \"utf8\", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = onwrite.bind(void 0, stream), this.writecb = null, this.writelen = 0, this.afterWriteTickInfo = null, resetBuffer(this), this.pendingcb = 0, this.constructed = !0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = !options || options.emitClose !== !1, this.autoDestroy = !options || options.autoDestroy !== !1, this.errored = null, this.closed = !1, this.closeEmitted = !1, this[kOnFinished] = [];\n }\n WritableState.prototype = {};\n function resetBuffer(state) {\n state.buffered = [], state.bufferedIndex = 0, state.allBuffers = !0, state.allNoop = !0;\n }\n WritableState.prototype.getBuffer = function getBuffer() {\n return ArrayPrototypeSlice(this.buffered, this.bufferedIndex);\n }, ObjectDefineProperty(WritableState.prototype, \"bufferedRequestCount\", {\n get() {\n return this.buffered.length - this.bufferedIndex;\n }\n }), ObjectDefineProperty(Writable, SymbolHasInstance, {\n value: function(object) {\n if (FunctionPrototypeSymbolHasInstance(this, object))\n return !0;\n if (this !== Writable)\n return !1;\n return object && object._writableState instanceof WritableState;\n }\n }), Writable.prototype.pipe = function() {\n errorOrDestroy2(this, new ERR_STREAM_CANNOT_PIPE);\n };\n function _write(stream, chunk, encoding, cb) {\n const state = stream._writableState;\n if (typeof encoding === \"function\")\n cb = encoding, encoding = state.defaultEncoding;\n else {\n if (!encoding)\n encoding = state.defaultEncoding;\n else if (encoding !== \"buffer\" && !@Buffer.isEncoding(encoding))\n throw new ERR_UNKNOWN_ENCODING(encoding);\n if (typeof cb !== \"function\")\n cb = nop;\n }\n if (chunk === null)\n throw new ERR_STREAM_NULL_VALUES;\n else if (!state.objectMode)\n if (typeof chunk === \"string\") {\n if (state.decodeStrings !== !1)\n chunk = @Buffer.from(chunk, encoding), encoding = \"buffer\";\n } else if (chunk instanceof @Buffer)\n encoding = \"buffer\";\n else if (Stream._isUint8Array(chunk))\n chunk = Stream._uint8ArrayToBuffer(chunk), encoding = \"buffer\";\n else\n throw new ERR_INVALID_ARG_TYPE2(\"chunk\", [\"string\", \"Buffer\", \"Uint8Array\"], chunk);\n let err;\n if (state.ending)\n err = new ERR_STREAM_WRITE_AFTER_END;\n else if (state.destroyed)\n err = new ERR_STREAM_DESTROYED(\"write\");\n if (err)\n return runOnNextTick(cb, err), errorOrDestroy2(stream, err, !0), err;\n return state.pendingcb++, writeOrBuffer(stream, state, chunk, encoding, cb);\n }\n Writable.prototype.write = function(chunk, encoding, cb) {\n return _write(this, chunk, encoding, cb) === !0;\n }, Writable.prototype.cork = function() {\n this._writableState.corked++;\n }, Writable.prototype.uncork = function() {\n const state = this._writableState;\n if (state.corked) {\n if (state.corked--, !state.writing)\n clearBuffer(this, state);\n }\n }, Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n if (typeof encoding === \"string\")\n encoding = StringPrototypeToLowerCase(encoding);\n if (!@Buffer.isEncoding(encoding))\n throw new ERR_UNKNOWN_ENCODING(encoding);\n return this._writableState.defaultEncoding = encoding, this;\n };\n function writeOrBuffer(stream, state, chunk, encoding, callback) {\n const len = state.objectMode \? 1 : chunk.length;\n state.length += len;\n const ret = state.length < state.highWaterMark;\n if (!ret)\n state.needDrain = !0;\n if (state.writing || state.corked || state.errored || !state.constructed) {\n if (state.buffered.push({\n chunk,\n encoding,\n callback\n }), state.allBuffers && encoding !== \"buffer\")\n state.allBuffers = !1;\n if (state.allNoop && callback !== nop)\n state.allNoop = !1;\n } else\n state.writelen = len, state.writecb = callback, state.writing = !0, state.sync = !0, stream._write(chunk, encoding, state.onwrite), state.sync = !1;\n return ret && !state.errored && !state.destroyed;\n }\n function doWrite(stream, state, writev, len, chunk, encoding, cb) {\n if (state.writelen = len, state.writecb = cb, state.writing = !0, state.sync = !0, state.destroyed)\n state.onwrite(new ERR_STREAM_DESTROYED(\"write\"));\n else if (writev)\n stream._writev(chunk, state.onwrite);\n else\n stream._write(chunk, encoding, state.onwrite);\n state.sync = !1;\n }\n function onwriteError(stream, state, er, cb) {\n --state.pendingcb, cb(er), errorBuffer(state), errorOrDestroy2(stream, er);\n }\n function onwrite(stream, er) {\n const state = stream._writableState, sync = state.sync, cb = state.writecb;\n if (typeof cb !== \"function\") {\n errorOrDestroy2(stream, new ERR_MULTIPLE_CALLBACK);\n return;\n }\n if (state.writing = !1, state.writecb = null, state.length -= state.writelen, state.writelen = 0, er) {\n if (Error.captureStackTrace(er), !state.errored)\n state.errored = er;\n if (stream._readableState && !stream._readableState.errored)\n stream._readableState.errored = er;\n if (sync)\n runOnNextTick(onwriteError, stream, state, er, cb);\n else\n onwriteError(stream, state, er, cb);\n } else {\n if (state.buffered.length > state.bufferedIndex)\n clearBuffer(stream, state);\n if (sync)\n if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb)\n state.afterWriteTickInfo.count++;\n else\n state.afterWriteTickInfo = {\n count: 1,\n cb,\n stream,\n state\n }, runOnNextTick(afterWriteTick, state.afterWriteTickInfo);\n else\n afterWrite(stream, state, 1, cb);\n }\n }\n function afterWriteTick({ stream, state, count, cb }) {\n return state.afterWriteTickInfo = null, afterWrite(stream, state, count, cb);\n }\n function afterWrite(stream, state, count, cb) {\n if (!state.ending && !stream.destroyed && state.length === 0 && state.needDrain)\n state.needDrain = !1, stream.emit(\"drain\");\n while (count-- > 0)\n state.pendingcb--, cb();\n if (state.destroyed)\n errorBuffer(state);\n finishMaybe(stream, state);\n }\n function errorBuffer(state) {\n if (state.writing)\n return;\n for (let n = state.bufferedIndex;n < state.buffered.length; ++n) {\n var _state$errored;\n const { chunk, callback } = state.buffered[n], len = state.objectMode \? 1 : chunk.length;\n state.length -= len, callback((_state$errored = state.errored) !== null && _state$errored !== void 0 \? _state$errored : new ERR_STREAM_DESTROYED(\"write\"));\n }\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++) {\n var _state$errored2;\n onfinishCallbacks[i]((_state$errored2 = state.errored) !== null && _state$errored2 !== void 0 \? _state$errored2 : new ERR_STREAM_DESTROYED(\"end\"));\n }\n resetBuffer(state);\n }\n function clearBuffer(stream, state) {\n if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed)\n return;\n const { buffered, bufferedIndex, objectMode } = state, bufferedLength = buffered.length - bufferedIndex;\n if (!bufferedLength)\n return;\n let i = bufferedIndex;\n if (state.bufferProcessing = !0, bufferedLength > 1 && stream._writev) {\n state.pendingcb -= bufferedLength - 1;\n const callback = state.allNoop \? nop : (err) => {\n for (let n = i;n < buffered.length; ++n)\n buffered[n].callback(err);\n }, chunks = state.allNoop && i === 0 \? buffered : ArrayPrototypeSlice(buffered, i);\n chunks.allBuffers = state.allBuffers, doWrite(stream, state, !0, state.length, chunks, \"\", callback), resetBuffer(state);\n } else {\n do {\n const { chunk, encoding, callback } = buffered[i];\n buffered[i++] = null;\n const len = objectMode \? 1 : chunk.length;\n doWrite(stream, state, !1, len, chunk, encoding, callback);\n } while (i < buffered.length && !state.writing);\n if (i === buffered.length)\n resetBuffer(state);\n else if (i > 256)\n buffered.splice(0, i), state.bufferedIndex = 0;\n else\n state.bufferedIndex = i;\n }\n state.bufferProcessing = !1;\n }\n Writable.prototype._write = function(chunk, encoding, cb) {\n if (this._writev)\n this._writev([\n {\n chunk,\n encoding\n }\n ], cb);\n else\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_write()\");\n }, Writable.prototype._writev = null, Writable.prototype.end = function(chunk, encoding, cb, native = !1) {\n const state = this._writableState;\n if (typeof chunk === \"function\")\n cb = chunk, chunk = null, encoding = null;\n else if (typeof encoding === \"function\")\n cb = encoding, encoding = null;\n let err;\n if (chunk !== null && chunk !== void 0) {\n let ret;\n if (!native)\n ret = _write(this, chunk, encoding);\n else\n ret = this.write(chunk, encoding);\n if (ret instanceof Error2)\n err = ret;\n }\n if (state.corked)\n state.corked = 1, this.uncork();\n if (err)\n this.emit(\"error\", err);\n else if (!state.errored && !state.ending)\n state.ending = !0, finishMaybe(this, state, !0), state.ended = !0;\n else if (state.finished)\n err = new ERR_STREAM_ALREADY_FINISHED(\"end\");\n else if (state.destroyed)\n err = new ERR_STREAM_DESTROYED(\"end\");\n if (typeof cb === \"function\")\n if (err || state.finished)\n runOnNextTick(cb, err);\n else\n state[kOnFinished].push(cb);\n return this;\n };\n function needFinish(state, tag) {\n var needFinish2 = state.ending && !state.destroyed && state.constructed && state.length === 0 && !state.errored && state.buffered.length === 0 && !state.finished && !state.writing && !state.errorEmitted && !state.closeEmitted;\n return needFinish2;\n }\n function callFinal(stream, state) {\n let called = !1;\n function onFinish(err) {\n if (called) {\n errorOrDestroy2(stream, err !== null && err !== void 0 \? err : ERR_MULTIPLE_CALLBACK());\n return;\n }\n if (called = !0, state.pendingcb--, err) {\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++)\n onfinishCallbacks[i](err);\n errorOrDestroy2(stream, err, state.sync);\n } else if (needFinish(state))\n state.prefinished = !0, stream.emit(\"prefinish\"), state.pendingcb++, runOnNextTick(finish, stream, state);\n }\n state.sync = !0, state.pendingcb++;\n try {\n stream._final(onFinish);\n } catch (err) {\n onFinish(err);\n }\n state.sync = !1;\n }\n function prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled)\n if (typeof stream._final === \"function\" && !state.destroyed)\n state.finalCalled = !0, callFinal(stream, state);\n else\n state.prefinished = !0, stream.emit(\"prefinish\");\n }\n function finishMaybe(stream, state, sync) {\n if (!needFinish(state, stream.__id))\n return;\n if (prefinish(stream, state), state.pendingcb === 0) {\n if (sync)\n state.pendingcb++, runOnNextTick((stream2, state2) => {\n if (needFinish(state2))\n finish(stream2, state2);\n else\n state2.pendingcb--;\n }, stream, state);\n else if (needFinish(state))\n state.pendingcb++, finish(stream, state);\n }\n }\n function finish(stream, state) {\n state.pendingcb--, state.finished = !0;\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++)\n onfinishCallbacks[i]();\n if (stream.emit(\"finish\"), state.autoDestroy) {\n const rState = stream._readableState;\n if (!rState || rState.autoDestroy && (rState.endEmitted || rState.readable === !1))\n stream.destroy();\n }\n }\n ObjectDefineProperties(Writable.prototype, {\n closed: {\n get() {\n return this._writableState \? this._writableState.closed : !1;\n }\n },\n destroyed: {\n get() {\n return this._writableState \? this._writableState.destroyed : !1;\n },\n set(value) {\n if (this._writableState)\n this._writableState.destroyed = value;\n }\n },\n writable: {\n get() {\n const w = this._writableState;\n return !!w && w.writable !== !1 && !w.destroyed && !w.errored && !w.ending && !w.ended;\n },\n set(val) {\n if (this._writableState)\n this._writableState.writable = !!val;\n }\n },\n writableFinished: {\n get() {\n return this._writableState \? this._writableState.finished : !1;\n }\n },\n writableObjectMode: {\n get() {\n return this._writableState \? this._writableState.objectMode : !1;\n }\n },\n writableBuffer: {\n get() {\n return this._writableState && this._writableState.getBuffer();\n }\n },\n writableEnded: {\n get() {\n return this._writableState \? this._writableState.ending : !1;\n }\n },\n writableNeedDrain: {\n get() {\n const wState = this._writableState;\n if (!wState)\n return !1;\n return !wState.destroyed && !wState.ending && wState.needDrain;\n }\n },\n writableHighWaterMark: {\n get() {\n return this._writableState && this._writableState.highWaterMark;\n }\n },\n writableCorked: {\n get() {\n return this._writableState \? this._writableState.corked : 0;\n }\n },\n writableLength: {\n get() {\n return this._writableState && this._writableState.length;\n }\n },\n errored: {\n enumerable: !1,\n get() {\n return this._writableState \? this._writableState.errored : null;\n }\n },\n writableAborted: {\n enumerable: !1,\n get: function() {\n return !!(this._writableState.writable !== !1 && (this._writableState.destroyed || this._writableState.errored) && !this._writableState.finished);\n }\n }\n });\n var destroy2 = destroyImpl.destroy;\n Writable.prototype.destroy = function(err, cb) {\n const state = this._writableState;\n if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length))\n runOnNextTick(errorBuffer, state);\n return destroy2.@call(this, err, cb), this;\n }, Writable.prototype._undestroy = destroyImpl.undestroy, Writable.prototype._destroy = function(err, cb) {\n cb(err);\n }, Writable.prototype[EE.captureRejectionSymbol] = function(err) {\n this.destroy(err);\n };\n var webStreamsAdapters;\n function lazyWebStreams() {\n if (webStreamsAdapters === void 0)\n webStreamsAdapters = {};\n return webStreamsAdapters;\n }\n Writable.fromWeb = function(writableStream, options) {\n return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options);\n }, Writable.toWeb = function(streamWritable) {\n return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable);\n };\n }\n}), require_duplexify = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/duplexify.js\"(exports, module) {\n var {\n isReadable,\n isWritable,\n isIterable,\n isNodeStream,\n isReadableNodeStream,\n isWritableNodeStream,\n isDuplexNodeStream\n } = require_utils(), eos = require_end_of_stream(), {\n AbortError: AbortError2,\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_RETURN_VALUE }\n } = require_errors(), { destroyer } = require_destroy(), Duplex = require_duplex(), Readable = require_readable(), { createDeferredPromise } = require_util(), from = require_from(), isBlob = typeof Blob !== \"undefined\" \? function isBlob2(b) {\n return b instanceof Blob;\n } : function isBlob2(b) {\n return !1;\n }, { FunctionPrototypeCall } = require_primordials();\n\n class Duplexify extends Duplex {\n constructor(options) {\n super(options);\n if ((options === null || options === @undefined \? @undefined : options.readable) === !1)\n this._readableState.readable = !1, this._readableState.ended = !0, this._readableState.endEmitted = !0;\n if ((options === null || options === @undefined \? @undefined : options.writable) === !1)\n this._writableState.writable = !1, this._writableState.ending = !0, this._writableState.ended = !0, this._writableState.finished = !0;\n }\n }\n module.exports = function duplexify(body, name) {\n if (isDuplexNodeStream(body))\n return body;\n if (isReadableNodeStream(body))\n return _duplexify({\n readable: body\n });\n if (isWritableNodeStream(body))\n return _duplexify({\n writable: body\n });\n if (isNodeStream(body))\n return _duplexify({\n writable: !1,\n readable: !1\n });\n if (typeof body === \"function\") {\n const { value, write, final, destroy: destroy2 } = fromAsyncGen(body);\n if (isIterable(value))\n return from(Duplexify, value, {\n objectMode: !0,\n write,\n final,\n destroy: destroy2\n });\n const then2 = value === null || value === void 0 \? void 0 : value.then;\n if (typeof then2 === \"function\") {\n let d;\n const promise = FunctionPrototypeCall(then2, value, (val) => {\n if (val != null)\n throw new ERR_INVALID_RETURN_VALUE(\"nully\", \"body\", val);\n }, (err) => {\n destroyer(d, err);\n });\n return d = new Duplexify({\n objectMode: !0,\n readable: !1,\n write,\n final(cb) {\n final(async () => {\n try {\n await promise, runOnNextTick(cb, null);\n } catch (err) {\n runOnNextTick(cb, err);\n }\n });\n },\n destroy: destroy2\n });\n }\n throw new ERR_INVALID_RETURN_VALUE(\"Iterable, AsyncIterable or AsyncFunction\", name, value);\n }\n if (isBlob(body))\n return duplexify(body.arrayBuffer());\n if (isIterable(body))\n return from(Duplexify, body, {\n objectMode: !0,\n writable: !1\n });\n if (typeof (body === null || body === void 0 \? void 0 : body.writable) === \"object\" || typeof (body === null || body === void 0 \? void 0 : body.readable) === \"object\") {\n const readable = body !== null && body !== void 0 && body.readable \? isReadableNodeStream(body === null || body === void 0 \? void 0 : body.readable) \? body === null || body === void 0 \? void 0 : body.readable : duplexify(body.readable) : void 0, writable = body !== null && body !== void 0 && body.writable \? isWritableNodeStream(body === null || body === void 0 \? void 0 : body.writable) \? body === null || body === void 0 \? void 0 : body.writable : duplexify(body.writable) : void 0;\n return _duplexify({\n readable,\n writable\n });\n }\n const then = body === null || body === void 0 \? void 0 : body.then;\n if (typeof then === \"function\") {\n let d;\n return FunctionPrototypeCall(then, body, (val) => {\n if (val != null)\n d.push(val);\n d.push(null);\n }, (err) => {\n destroyer(d, err);\n }), d = new Duplexify({\n objectMode: !0,\n writable: !1,\n read() {\n }\n });\n }\n throw new ERR_INVALID_ARG_TYPE2(name, [\n \"Blob\",\n \"ReadableStream\",\n \"WritableStream\",\n \"Stream\",\n \"Iterable\",\n \"AsyncIterable\",\n \"Function\",\n \"{ readable, writable } pair\",\n \"Promise\"\n ], body);\n };\n function fromAsyncGen(fn) {\n let { promise, resolve } = createDeferredPromise();\n const ac = new AbortController, signal = ac.signal;\n return {\n value: fn(async function* () {\n while (!0) {\n const _promise = promise;\n promise = null;\n const { chunk, done, cb } = await _promise;\n if (runOnNextTick(cb), done)\n return;\n if (signal.aborted)\n throw new AbortError2(void 0, {\n cause: signal.reason\n });\n ({ promise, resolve } = createDeferredPromise()), yield chunk;\n }\n }(), {\n signal\n }),\n write(chunk, encoding, cb) {\n const _resolve = resolve;\n resolve = null, _resolve({\n chunk,\n done: !1,\n cb\n });\n },\n final(cb) {\n const _resolve = resolve;\n resolve = null, _resolve({\n done: !0,\n cb\n });\n },\n destroy(err, cb) {\n ac.abort(), cb(err);\n }\n };\n }\n function _duplexify(pair) {\n const r = pair.readable && typeof pair.readable.read !== \"function\" \? Readable.wrap(pair.readable) : pair.readable, w = pair.writable;\n let readable = !!isReadable(r), writable = !!isWritable(w), ondrain, onfinish, onreadable, onclose, d;\n function onfinished(err) {\n const cb = onclose;\n if (onclose = null, cb)\n cb(err);\n else if (err)\n d.destroy(err);\n else if (!readable && !writable)\n d.destroy();\n }\n if (d = new Duplexify({\n readableObjectMode: !!(r !== null && r !== void 0 && r.readableObjectMode),\n writableObjectMode: !!(w !== null && w !== void 0 && w.writableObjectMode),\n readable,\n writable\n }), writable)\n eos(w, (err) => {\n if (writable = !1, err)\n destroyer(r, err);\n onfinished(err);\n }), d._write = function(chunk, encoding, callback) {\n if (w.write(chunk, encoding))\n callback();\n else\n ondrain = callback;\n }, d._final = function(callback) {\n w.end(), onfinish = callback;\n }, w.on(\"drain\", function() {\n if (ondrain) {\n const cb = ondrain;\n ondrain = null, cb();\n }\n }), w.on(\"finish\", function() {\n if (onfinish) {\n const cb = onfinish;\n onfinish = null, cb();\n }\n });\n if (readable)\n eos(r, (err) => {\n if (readable = !1, err)\n destroyer(r, err);\n onfinished(err);\n }), r.on(\"readable\", function() {\n if (onreadable) {\n const cb = onreadable;\n onreadable = null, cb();\n }\n }), r.on(\"end\", function() {\n d.push(null);\n }), d._read = function() {\n while (!0) {\n const buf = r.read();\n if (buf === null) {\n onreadable = d._read;\n return;\n }\n if (!d.push(buf))\n return;\n }\n };\n return d._destroy = function(err, callback) {\n if (!err && onclose !== null)\n err = new AbortError2;\n if (onreadable = null, ondrain = null, onfinish = null, onclose === null)\n callback(err);\n else\n onclose = callback, destroyer(w, err), destroyer(r, err);\n }, d;\n }\n }\n}), require_duplex = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/duplex.js\"(exports, module) {\n var { ObjectDefineProperties, ObjectGetOwnPropertyDescriptor, ObjectKeys, ObjectSetPrototypeOf } = require_primordials(), Readable = require_readable();\n function Duplex(options) {\n if (!(this instanceof Duplex))\n return new Duplex(options);\n if (Readable.@call(this, options), Writable.@call(this, options), options) {\n if (this.allowHalfOpen = options.allowHalfOpen !== !1, options.readable === !1)\n this._readableState.readable = !1, this._readableState.ended = !0, this._readableState.endEmitted = !0;\n if (options.writable === !1)\n this._writableState.writable = !1, this._writableState.ending = !0, this._writableState.ended = !0, this._writableState.finished = !0;\n } else\n this.allowHalfOpen = !0;\n }\n Duplex.prototype = {}, module.exports = Duplex, ObjectSetPrototypeOf(Duplex.prototype, Readable.prototype), ObjectSetPrototypeOf(Duplex, Readable);\n for (var method in Writable.prototype)\n if (!Duplex.prototype[method])\n Duplex.prototype[method] = Writable.prototype[method];\n ObjectDefineProperties(Duplex.prototype, {\n writable: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writable\"),\n writableHighWaterMark: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableHighWaterMark\"),\n writableObjectMode: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableObjectMode\"),\n writableBuffer: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableBuffer\"),\n writableLength: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableLength\"),\n writableFinished: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableFinished\"),\n writableCorked: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableCorked\"),\n writableEnded: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableEnded\"),\n writableNeedDrain: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableNeedDrain\"),\n destroyed: {\n get() {\n if (this._readableState === void 0 || this._writableState === void 0)\n return !1;\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set(value) {\n if (this._readableState && this._writableState)\n this._readableState.destroyed = value, this._writableState.destroyed = value;\n }\n }\n });\n var webStreamsAdapters;\n function lazyWebStreams() {\n if (webStreamsAdapters === void 0)\n webStreamsAdapters = {};\n return webStreamsAdapters;\n }\n Duplex.fromWeb = function(pair, options) {\n return lazyWebStreams().newStreamDuplexFromReadableWritablePair(pair, options);\n }, Duplex.toWeb = function(duplex) {\n return lazyWebStreams().newReadableWritablePairFromDuplex(duplex);\n };\n var duplexify;\n Duplex.from = function(body) {\n if (!duplexify)\n duplexify = require_duplexify();\n return duplexify(body, \"body\");\n };\n }\n}), require_transform = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/transform.js\"(exports, module) {\n var { ObjectSetPrototypeOf, Symbol: Symbol2 } = require_primordials(), { ERR_METHOD_NOT_IMPLEMENTED } = require_errors().codes, Duplex = require_duplex();\n function Transform(options) {\n if (!(this instanceof Transform))\n return new Transform(options);\n if (Duplex.@call(this, options), this._readableState.sync = !1, this[kCallback] = null, options) {\n if (typeof options.transform === \"function\")\n this._transform = options.transform;\n if (typeof options.flush === \"function\")\n this._flush = options.flush;\n }\n this.on(\"prefinish\", prefinish.bind(this));\n }\n Transform.prototype = {}, ObjectSetPrototypeOf(Transform.prototype, Duplex.prototype), ObjectSetPrototypeOf(Transform, Duplex), module.exports = Transform;\n var kCallback = Symbol2(\"kCallback\");\n function final(cb) {\n if (typeof this._flush === \"function\" && !this.destroyed)\n this._flush((er, data) => {\n if (er) {\n if (cb)\n cb(er);\n else\n this.destroy(er);\n return;\n }\n if (data != null)\n this.push(data);\n if (this.push(null), cb)\n cb();\n });\n else if (this.push(null), cb)\n cb();\n }\n function prefinish() {\n if (this._final !== final)\n final.@call(this);\n }\n Transform.prototype._final = final, Transform.prototype._transform = function(chunk, encoding, callback) {\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_transform()\");\n }, Transform.prototype._write = function(chunk, encoding, callback) {\n const rState = this._readableState, wState = this._writableState, length = rState.length;\n this._transform(chunk, encoding, (err, val) => {\n if (err) {\n callback(err);\n return;\n }\n if (val != null)\n this.push(val);\n if (wState.ended || length === rState.length || rState.length < rState.highWaterMark || rState.highWaterMark === 0 || rState.length === 0)\n callback();\n else\n this[kCallback] = callback;\n });\n }, Transform.prototype._read = function() {\n if (this[kCallback]) {\n const callback = this[kCallback];\n this[kCallback] = null, callback();\n }\n };\n }\n}), require_passthrough = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/passthrough.js\"(exports, module) {\n var { ObjectSetPrototypeOf } = require_primordials(), Transform = require_transform();\n function PassThrough(options) {\n if (!(this instanceof PassThrough))\n return new PassThrough(options);\n Transform.@call(this, options);\n }\n PassThrough.prototype = {}, ObjectSetPrototypeOf(PassThrough.prototype, Transform.prototype), ObjectSetPrototypeOf(PassThrough, Transform), PassThrough.prototype._transform = function(chunk, encoding, cb) {\n cb(null, chunk);\n }, module.exports = PassThrough;\n }\n}), require_pipeline = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/pipeline.js\"(exports, module) {\n var { ArrayIsArray: ArrayIsArray2, Promise: Promise2, SymbolAsyncIterator } = require_primordials(), eos = require_end_of_stream(), { once } = require_util(), destroyImpl = require_destroy(), Duplex = require_duplex(), {\n aggregateTwoErrors,\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS, ERR_STREAM_DESTROYED },\n AbortError: AbortError2\n } = require_errors(), { validateFunction, validateAbortSignal } = require_validators(), { isIterable, isReadable, isReadableNodeStream, isNodeStream } = require_utils(), PassThrough, Readable;\n function destroyer(stream, reading, writing) {\n let finished = !1;\n stream.on(\"close\", () => {\n finished = !0;\n });\n const cleanup = eos(stream, {\n readable: reading,\n writable: writing\n }, (err) => {\n finished = !err;\n });\n return {\n destroy: (err) => {\n if (finished)\n return;\n finished = !0, destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED(\"pipe\"));\n },\n cleanup\n };\n }\n function popCallback(streams) {\n return validateFunction(streams[streams.length - 1], \"streams[stream.length - 1]\"), streams.pop();\n }\n function makeAsyncIterable(val) {\n if (isIterable(val))\n return val;\n else if (isReadableNodeStream(val))\n return fromReadable(val);\n throw new ERR_INVALID_ARG_TYPE2(\"val\", [\"Readable\", \"Iterable\", \"AsyncIterable\"], val);\n }\n async function* fromReadable(val) {\n if (!Readable)\n Readable = require_readable();\n yield* Readable.prototype[SymbolAsyncIterator].@call(val);\n }\n async function pump(iterable, writable, finish, { end }) {\n let error, onresolve = null;\n const resume = (err) => {\n if (err)\n error = err;\n if (onresolve) {\n const callback = onresolve;\n onresolve = null, callback();\n }\n }, wait = () => new Promise2((resolve, reject) => {\n if (error)\n reject(error);\n else\n onresolve = () => {\n if (error)\n reject(error);\n else\n resolve();\n };\n });\n writable.on(\"drain\", resume);\n const cleanup = eos(writable, {\n readable: !1\n }, resume);\n try {\n if (writable.writableNeedDrain)\n await wait();\n for await (let chunk of iterable)\n if (!writable.write(chunk))\n await wait();\n if (end)\n writable.end();\n await wait(), finish();\n } catch (err) {\n finish(error !== err \? aggregateTwoErrors(error, err) : err);\n } finally {\n cleanup(), writable.off(\"drain\", resume);\n }\n }\n function pipeline(...streams) {\n return pipelineImpl(streams, once(popCallback(streams)));\n }\n function pipelineImpl(streams, callback, opts) {\n if (streams.length === 1 && ArrayIsArray2(streams[0]))\n streams = streams[0];\n if (streams.length < 2)\n throw new ERR_MISSING_ARGS(\"streams\");\n const ac = new AbortController, signal = ac.signal, outerSignal = opts === null || opts === void 0 \? void 0 : opts.signal, lastStreamCleanup = [];\n validateAbortSignal(outerSignal, \"options.signal\");\n function abort() {\n finishImpl(new AbortError2);\n }\n outerSignal === null || outerSignal === void 0 || outerSignal.addEventListener(\"abort\", abort);\n let error, value;\n const destroys = [];\n let finishCount = 0;\n function finish(err) {\n finishImpl(err, --finishCount === 0);\n }\n function finishImpl(err, final) {\n if (err && (!error || error.code === \"ERR_STREAM_PREMATURE_CLOSE\"))\n error = err;\n if (!error && !final)\n return;\n while (destroys.length)\n destroys.shift()(error);\n if (outerSignal === null || outerSignal === void 0 || outerSignal.removeEventListener(\"abort\", abort), ac.abort(), final) {\n if (!error)\n lastStreamCleanup.forEach((fn) => fn());\n runOnNextTick(callback, error, value);\n }\n }\n let ret;\n for (let i = 0;i < streams.length; i++) {\n const stream = streams[i], reading = i < streams.length - 1, writing = i > 0, end = reading || (opts === null || opts === void 0 \? void 0 : opts.end) !== !1, isLastStream = i === streams.length - 1;\n if (isNodeStream(stream)) {\n let onError = function(err) {\n if (err && err.name !== \"AbortError\" && err.code !== \"ERR_STREAM_PREMATURE_CLOSE\")\n finish(err);\n };\n if (end) {\n const { destroy: destroy2, cleanup } = destroyer(stream, reading, writing);\n if (destroys.push(destroy2), isReadable(stream) && isLastStream)\n lastStreamCleanup.push(cleanup);\n }\n if (stream.on(\"error\", onError), isReadable(stream) && isLastStream)\n lastStreamCleanup.push(() => {\n stream.removeListener(\"error\", onError);\n });\n }\n if (i === 0)\n if (typeof stream === \"function\") {\n if (ret = stream({\n signal\n }), !isIterable(ret))\n throw new ERR_INVALID_RETURN_VALUE(\"Iterable, AsyncIterable or Stream\", \"source\", ret);\n } else if (isIterable(stream) || isReadableNodeStream(stream))\n ret = stream;\n else\n ret = Duplex.from(stream);\n else if (typeof stream === \"function\")\n if (ret = makeAsyncIterable(ret), ret = stream(ret, {\n signal\n }), reading) {\n if (!isIterable(ret, !0))\n throw new ERR_INVALID_RETURN_VALUE(\"AsyncIterable\", `transform[${i - 1}]`, ret);\n } else {\n var _ret;\n if (!PassThrough)\n PassThrough = require_passthrough();\n const pt = new PassThrough({\n objectMode: !0\n }), then = (_ret = ret) === null || _ret === void 0 \? void 0 : _ret.then;\n if (typeof then === \"function\")\n finishCount++, then.@call(ret, (val) => {\n if (value = val, val != null)\n pt.write(val);\n if (end)\n pt.end();\n runOnNextTick(finish);\n }, (err) => {\n pt.destroy(err), runOnNextTick(finish, err);\n });\n else if (isIterable(ret, !0))\n finishCount++, pump(ret, pt, finish, {\n end\n });\n else\n throw new ERR_INVALID_RETURN_VALUE(\"AsyncIterable or Promise\", \"destination\", ret);\n ret = pt;\n const { destroy: destroy2, cleanup } = destroyer(ret, !1, !0);\n if (destroys.push(destroy2), isLastStream)\n lastStreamCleanup.push(cleanup);\n }\n else if (isNodeStream(stream)) {\n if (isReadableNodeStream(ret)) {\n finishCount += 2;\n const cleanup = pipe(ret, stream, finish, {\n end\n });\n if (isReadable(stream) && isLastStream)\n lastStreamCleanup.push(cleanup);\n } else if (isIterable(ret))\n finishCount++, pump(ret, stream, finish, {\n end\n });\n else\n throw new ERR_INVALID_ARG_TYPE2(\"val\", [\"Readable\", \"Iterable\", \"AsyncIterable\"], ret);\n ret = stream;\n } else\n ret = Duplex.from(stream);\n }\n if (signal !== null && signal !== void 0 && signal.aborted || outerSignal !== null && outerSignal !== void 0 && outerSignal.aborted)\n runOnNextTick(abort);\n return ret;\n }\n function pipe(src, dst, finish, { end }) {\n if (src.pipe(dst, {\n end\n }), end)\n src.once(\"end\", () => dst.end());\n else\n finish();\n return eos(src, {\n readable: !0,\n writable: !1\n }, (err) => {\n const rState = src._readableState;\n if (err && err.code === \"ERR_STREAM_PREMATURE_CLOSE\" && rState && rState.ended && !rState.errored && !rState.errorEmitted)\n src.once(\"end\", finish).once(\"error\", finish);\n else\n finish(err);\n }), eos(dst, {\n readable: !1,\n writable: !0\n }, finish);\n }\n module.exports = {\n pipelineImpl,\n pipeline\n };\n }\n}), require_compose = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/compose.js\"(exports, module) {\n var { pipeline } = require_pipeline(), Duplex = require_duplex(), { destroyer } = require_destroy(), { isNodeStream, isReadable, isWritable } = require_utils(), {\n AbortError: AbortError2,\n codes: { ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, ERR_MISSING_ARGS }\n } = require_errors();\n module.exports = function compose(...streams) {\n if (streams.length === 0)\n throw new ERR_MISSING_ARGS(\"streams\");\n if (streams.length === 1)\n return Duplex.from(streams[0]);\n const orgStreams = [...streams];\n if (typeof streams[0] === \"function\")\n streams[0] = Duplex.from(streams[0]);\n if (typeof streams[streams.length - 1] === \"function\") {\n const idx = streams.length - 1;\n streams[idx] = Duplex.from(streams[idx]);\n }\n for (let n = 0;n < streams.length; ++n) {\n if (!isNodeStream(streams[n]))\n continue;\n if (n < streams.length - 1 && !isReadable(streams[n]))\n throw new ERR_INVALID_ARG_VALUE2(`streams[${n}]`, orgStreams[n], \"must be readable\");\n if (n > 0 && !isWritable(streams[n]))\n throw new ERR_INVALID_ARG_VALUE2(`streams[${n}]`, orgStreams[n], \"must be writable\");\n }\n let ondrain, onfinish, onreadable, onclose, d;\n function onfinished(err) {\n const cb = onclose;\n if (onclose = null, cb)\n cb(err);\n else if (err)\n d.destroy(err);\n else if (!readable && !writable)\n d.destroy();\n }\n const head = streams[0], tail = pipeline(streams, onfinished), writable = !!isWritable(head), readable = !!isReadable(tail);\n if (d = new Duplex({\n writableObjectMode: !!(head !== null && head !== void 0 && head.writableObjectMode),\n readableObjectMode: !!(tail !== null && tail !== void 0 && tail.writableObjectMode),\n writable,\n readable\n }), writable)\n d._write = function(chunk, encoding, callback) {\n if (head.write(chunk, encoding))\n callback();\n else\n ondrain = callback;\n }, d._final = function(callback) {\n head.end(), onfinish = callback;\n }, head.on(\"drain\", function() {\n if (ondrain) {\n const cb = ondrain;\n ondrain = null, cb();\n }\n }), tail.on(\"finish\", function() {\n if (onfinish) {\n const cb = onfinish;\n onfinish = null, cb();\n }\n });\n if (readable)\n tail.on(\"readable\", function() {\n if (onreadable) {\n const cb = onreadable;\n onreadable = null, cb();\n }\n }), tail.on(\"end\", function() {\n d.push(null);\n }), d._read = function() {\n while (!0) {\n const buf = tail.read();\n if (buf === null) {\n onreadable = d._read;\n return;\n }\n if (!d.push(buf))\n return;\n }\n };\n return d._destroy = function(err, callback) {\n if (!err && onclose !== null)\n err = new AbortError2;\n if (onreadable = null, ondrain = null, onfinish = null, onclose === null)\n callback(err);\n else\n onclose = callback, destroyer(tail, err);\n }, d;\n };\n }\n}), require_promises = __commonJS({\n \"node_modules/readable-stream/lib/stream/promises.js\"(exports, module) {\n var { ArrayPrototypePop, Promise: Promise2 } = require_primordials(), { isIterable, isNodeStream } = require_utils(), { pipelineImpl: pl } = require_pipeline(), { finished } = require_end_of_stream();\n function pipeline(...streams) {\n return new Promise2((resolve, reject) => {\n let signal, end;\n const lastArg = streams[streams.length - 1];\n if (lastArg && typeof lastArg === \"object\" && !isNodeStream(lastArg) && !isIterable(lastArg)) {\n const options = ArrayPrototypePop(streams);\n signal = options.signal, end = options.end;\n }\n pl(streams, (err, value) => {\n if (err)\n reject(err);\n else\n resolve(value);\n }, {\n signal,\n end\n });\n });\n }\n module.exports = {\n finished,\n pipeline\n };\n }\n}), require_stream = __commonJS({\n \"node_modules/readable-stream/lib/stream.js\"(exports, module) {\n var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials(), {\n promisify: { custom: customPromisify }\n } = require_util(), { streamReturningOperators, promiseReturningOperators } = require_operators(), {\n codes: { ERR_ILLEGAL_CONSTRUCTOR }\n } = require_errors(), compose = require_compose(), { pipeline } = require_pipeline(), { destroyer } = require_destroy(), eos = require_end_of_stream(), promises = require_promises(), utils = require_utils(), Stream = module.exports = require_legacy().Stream;\n Stream.isDisturbed = utils.isDisturbed, Stream.isErrored = utils.isErrored, Stream.isWritable = utils.isWritable, Stream.isReadable = utils.isReadable, Stream.Readable = require_readable();\n for (let key of ObjectKeys(streamReturningOperators)) {\n let fn = function(...args) {\n if (new.target)\n throw ERR_ILLEGAL_CONSTRUCTOR();\n return Stream.Readable.from(ReflectApply(op, this, args));\n };\n const op = streamReturningOperators[key];\n ObjectDefineProperty(fn, \"name\", {\n value: op.name\n }), ObjectDefineProperty(fn, \"length\", {\n value: op.length\n }), ObjectDefineProperty(Stream.Readable.prototype, key, {\n value: fn,\n enumerable: !1,\n configurable: !0,\n writable: !0\n });\n }\n for (let key of ObjectKeys(promiseReturningOperators)) {\n let fn = function(...args) {\n if (new.target)\n throw ERR_ILLEGAL_CONSTRUCTOR();\n return ReflectApply(op, this, args);\n };\n const op = promiseReturningOperators[key];\n ObjectDefineProperty(fn, \"name\", {\n value: op.name\n }), ObjectDefineProperty(fn, \"length\", {\n value: op.length\n }), ObjectDefineProperty(Stream.Readable.prototype, key, {\n value: fn,\n enumerable: !1,\n configurable: !0,\n writable: !0\n });\n }\n Stream.Writable = require_writable(), Stream.Duplex = require_duplex(), Stream.Transform = require_transform(), Stream.PassThrough = require_passthrough(), Stream.pipeline = pipeline;\n var { addAbortSignal } = require_add_abort_signal();\n Stream.addAbortSignal = addAbortSignal, Stream.finished = eos, Stream.destroy = destroyer, Stream.compose = compose, ObjectDefineProperty(Stream, \"promises\", {\n configurable: !0,\n enumerable: !0,\n get() {\n return promises;\n }\n }), ObjectDefineProperty(pipeline, customPromisify, {\n enumerable: !0,\n get() {\n return promises.pipeline;\n }\n }), ObjectDefineProperty(eos, customPromisify, {\n enumerable: !0,\n get() {\n return promises.finished;\n }\n }), Stream.Stream = Stream, Stream._isUint8Array = function isUint8Array(value) {\n return value instanceof @Uint8Array;\n }, Stream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) {\n return new @Buffer(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n };\n }\n}), nativeReadableStreamPrototypes = {\n 0: @undefined,\n 1: @undefined,\n 2: @undefined,\n 3: @undefined,\n 4: @undefined,\n 5: @undefined\n}, Writable = require_writable(), _pathOrFdOrSink = Symbol(\"pathOrFdOrSink\"), _fileSink = Symbol(\"fileSink\"), _native = Symbol(\"native\");\nNativeWritable.prototype = Object.create(Writable.prototype);\nvar WritablePrototypeWrite = Writable.prototype.write;\nNativeWritable.prototype.write = function NativeWritablePrototypeWrite(chunk, encoding, cb, native) {\n if (!(native \?\? this[_native]))\n return this[_native] = !1, WritablePrototypeWrite.@call(this, chunk, encoding, cb);\n var fileSink = this[_fileSink] \?\? NativeWritable_lazyConstruct(this), result = fileSink.write(chunk);\n if (@isPromise(result))\n return result.then(() => {\n this.emit(\"drain\"), fileSink.flush(!0);\n }), !1;\n if (fileSink.flush(!0), typeof encoding === \"function\")\n cb = encoding;\n if (cb)\n cb(null, chunk.byteLength);\n return !0;\n};\nvar WritablePrototypeEnd = Writable.prototype.end;\nNativeWritable.prototype.end = function end(chunk, encoding, cb, native) {\n return WritablePrototypeEnd.@call(this, chunk, encoding, cb, native \?\? this[_native]);\n};\nNativeWritable.prototype.ref = function ref() {\n var sink = this[_fileSink];\n if (!sink)\n this.NativeWritable_lazyConstruct();\n sink.ref();\n};\nNativeWritable.prototype.unref = function unref() {\n this[_fileSink]\?.unref();\n};\nvar exports = require_stream(), promises = require_promises();\nexports._getNativeReadableStreamPrototype = getNativeReadableStreamPrototype;\nexports.NativeWritable = NativeWritable;\nObject.defineProperty(exports, \"promises\", {\n configurable: !0,\n enumerable: !0,\n get() {\n return promises;\n }\n});\nexports[Symbol.for(\"::bunternal::\")] = { _ReadableFromWeb, _ReadableFromWebForUndici };\nexports.eos = require_end_of_stream();\nexports.EventEmitter = EE;\nreturn exports})\n");
//
//
-static constexpr ASCIILiteral NodeStreamWebCode = "(function (){\"use strict\";// src/js/out/tmp/node/stream.web.ts\nvar $;\n$ = {\n ReadableStream,\n ReadableStreamDefaultReader,\n ReadableStreamBYOBReader,\n ReadableStreamBYOBRequest,\n ReadableByteStreamController,\n ReadableStreamDefaultController,\n TransformStream,\n TransformStreamDefaultController,\n WritableStream,\n WritableStreamDefaultWriter,\n WritableStreamDefaultController,\n ByteLengthQueuingStrategy,\n CountQueuingStrategy,\n TextEncoderStream: void 0,\n TextDecoderStream: void 0,\n CompressionStream: void 0,\n DecompressionStream: void 0\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeStreamPromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/stream.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39)).promises})\n");
//
//
-static constexpr ASCIILiteral NodeTimersCode = "(function (){\"use strict\";// src/js/out/tmp/node/timers.ts\nvar $;\n$ = {\n setTimeout,\n clearTimeout,\n setInterval,\n setImmediate,\n clearInterval,\n clearImmediate\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeStreamWebCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/stream.web.ts\nvar $;\n$ = {\n ReadableStream: @ReadableStream,\n ReadableStreamDefaultReader: @ReadableStreamDefaultReader,\n ReadableStreamBYOBReader: @ReadableStreamBYOBReader,\n ReadableStreamBYOBRequest: @ReadableStreamBYOBRequest,\n ReadableByteStreamController: @ReadableByteStreamController,\n ReadableStreamDefaultController: @ReadableStreamDefaultController,\n TransformStream: @TransformStream,\n TransformStreamDefaultController: @TransformStreamDefaultController,\n WritableStream: @WritableStream,\n WritableStreamDefaultWriter: @WritableStreamDefaultWriter,\n WritableStreamDefaultController: @WritableStreamDefaultController,\n ByteLengthQueuingStrategy,\n CountQueuingStrategy,\n TextEncoderStream: @undefined,\n TextDecoderStream: @undefined,\n CompressionStream: @undefined,\n DecompressionStream: @undefined\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeTimersPromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/timers.promises.ts\nvar validateObject = function(object, name) {\n if (object === null || typeof object !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Object\", object);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n}, validateAbortSignal = function(signal, name) {\n if (typeof signal !== \"undefined\" && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, asyncIterator = function({ next: nextFunction, return: returnFunction }) {\n const result = {};\n if (typeof nextFunction === \"function\")\n result.next = nextFunction;\n if (typeof returnFunction === \"function\")\n result.return = returnFunction;\n return result[symbolAsyncIterator] = function() {\n return this;\n }, result;\n}, setTimeoutPromise = function(after = 1, value, options = {}) {\n const arguments_ = [].concat(value \?\? []);\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return Promise.reject(error);\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return Promise.reject(error);\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return Promise.reject(error);\n }\n if (signal\?.aborted)\n return Promise.reject(new AbortError);\n let onCancel;\n const returnValue = new Promise((resolve, reject) => {\n const timeout = setTimeout(() => resolve(value), after, ...arguments_);\n if (!reference)\n timeout\?.unref\?.();\n if (signal)\n onCancel = () => {\n clearTimeout(timeout), reject(new AbortError);\n }, signal.addEventListener(\"abort\", onCancel);\n });\n if (typeof onCancel !== \"undefined\")\n returnValue.finally(() => signal.removeEventListener(\"abort\", onCancel));\n return returnValue;\n}, setImmediatePromise = function(value, options = {}) {\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return Promise.reject(error);\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return Promise.reject(error);\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return Promise.reject(error);\n }\n if (signal\?.aborted)\n return Promise.reject(new AbortError);\n let onCancel;\n const returnValue = new Promise((resolve, reject) => {\n const immediate = setImmediate(() => resolve(value));\n if (!reference)\n immediate\?.unref\?.();\n if (signal)\n onCancel = () => {\n clearImmediate(immediate), reject(new AbortError);\n }, signal.addEventListener(\"abort\", onCancel);\n });\n if (typeof onCancel !== \"undefined\")\n returnValue.finally(() => signal.removeEventListener(\"abort\", onCancel));\n return returnValue;\n}, setIntervalPromise = function(after = 1, value, options = {}) {\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return Promise.reject(error);\n }\n });\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return Promise.reject(error);\n }\n });\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return Promise.reject(error);\n }\n });\n }\n if (signal\?.aborted)\n return asyncIterator({\n next: function() {\n return Promise.reject(new AbortError);\n }\n });\n let onCancel, interval;\n try {\n let notYielded = 0, callback;\n if (interval = setInterval(() => {\n if (notYielded++, callback)\n callback(), callback = void 0;\n }, after), !reference)\n interval\?.unref\?.();\n if (signal)\n onCancel = () => {\n if (clearInterval(interval), callback)\n callback(), callback = void 0;\n }, signal.addEventListener(\"abort\", onCancel);\n return asyncIterator({\n next: function() {\n return new Promise((resolve, reject) => {\n if (!signal\?.aborted)\n if (notYielded === 0)\n callback = resolve;\n else\n resolve();\n else if (notYielded === 0)\n reject(new AbortError);\n else\n resolve();\n }).then(() => {\n if (notYielded > 0)\n return notYielded = notYielded - 1, { done: !1, value };\n return { done: !0 };\n });\n },\n return: function() {\n return clearInterval(interval), signal\?.removeEventListener(\"abort\", onCancel), Promise.resolve({});\n }\n });\n } catch (error) {\n return asyncIterator({\n next: function() {\n clearInterval(interval), signal\?.removeEventListener(\"abort\", onCancel);\n }\n });\n }\n}, $, symbolAsyncIterator = Symbol.asyncIterator;\n\nclass ERR_INVALID_ARG_TYPE extends Error {\n constructor(name, expected, actual) {\n super(`${name} must be ${expected}, ${typeof actual} given`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\n\nclass AbortError extends Error {\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\n$ = {\n setTimeout: setTimeoutPromise,\n setImmediate: setImmediatePromise,\n setInterval: setIntervalPromise,\n scheduler: {\n wait: (delay, options) => setTimeoutPromise(delay, void 0, options),\n yield: setImmediatePromise\n }\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeTimersCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/timers.ts\nvar $;\n$ = {\n setTimeout,\n clearTimeout,\n setInterval,\n setImmediate,\n clearInterval,\n clearImmediate\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeTLSCode = "(function (){\"use strict\";// src/js/out/tmp/node/tls.ts\nvar parseCertString = function() {\n throwNotImplemented(\"Not implemented\");\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof ArrayBuffer || obj instanceof Blob)\n return !0;\n if (Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, unfqdn = function(host) {\n return RegExpPrototypeSymbolReplace.call(/[.]$/, host, \"\");\n}, toLowerCase = function(c) {\n return StringFromCharCode.call(32 + StringPrototypeCharCodeAt.call(c, 0));\n}, splitHost = function(host) {\n return StringPrototypeSplit.call(RegExpPrototypeSymbolReplace.call(/[A-Z]/g, unfqdn(host), toLowerCase), \".\");\n}, check = function(hostParts, pattern, wildcards) {\n if (!pattern)\n return !1;\n const patternParts = splitHost(pattern);\n if (hostParts.length !== patternParts.length)\n return !1;\n if (ArrayPrototypeIncludes.call(patternParts, \"\"))\n return !1;\n const isBad = (s) => RegExpPrototypeExec.call(/[^\\u0021-\\u007F]/u, s) !== null;\n if (ArrayPrototypeSome.call(patternParts, isBad))\n return !1;\n for (let i = hostParts.length - 1;i > 0; i -= 1)\n if (hostParts[i] !== patternParts[i])\n return !1;\n const hostSubdomain = hostParts[0], patternSubdomain = patternParts[0], patternSubdomainParts = StringPrototypeSplit.call(patternSubdomain, \"*\");\n if (patternSubdomainParts.length === 1 || StringPrototypeIncludes.call(patternSubdomain, \"xn--\"))\n return hostSubdomain === patternSubdomain;\n if (!wildcards)\n return !1;\n if (patternSubdomainParts.length > 2)\n return !1;\n if (patternParts.length <= 2)\n return !1;\n const { 0: prefix, 1: suffix } = patternSubdomainParts;\n if (prefix.length + suffix.length > hostSubdomain.length)\n return !1;\n if (!StringPrototypeStartsWith.call(hostSubdomain, prefix))\n return !1;\n if (!StringPrototypeEndsWith.call(hostSubdomain, suffix))\n return !1;\n return !0;\n}, splitEscapedAltNames = function(altNames) {\n const result = [];\n let currentToken = \"\", offset = 0;\n while (offset !== altNames.length) {\n const nextSep = StringPrototypeIndexOf.call(altNames, \", \", offset), nextQuote = StringPrototypeIndexOf.call(altNames, '\"', offset);\n if (nextQuote !== -1 && (nextSep === -1 || nextQuote < nextSep)) {\n currentToken += StringPrototypeSubstring.call(altNames, offset, nextQuote);\n const match = RegExpPrototypeExec.call(jsonStringPattern, StringPrototypeSubstring.call(altNames, nextQuote));\n if (!match) {\n let error = new SyntaxError(\"ERR_TLS_CERT_ALTNAME_FORMAT: Invalid subject alternative name string\");\n throw error.name = ERR_TLS_CERT_ALTNAME_FORMAT, error;\n }\n currentToken += JSON.parse(match[0]), offset = nextQuote + match[0].length;\n } else if (nextSep !== -1)\n currentToken += StringPrototypeSubstring.call(altNames, offset, nextSep), ArrayPrototypePush.call(result, currentToken), currentToken = \"\", offset = nextSep + 2;\n else\n currentToken += StringPrototypeSubstring.call(altNames, offset), offset = altNames.length;\n }\n return ArrayPrototypePush.call(result, currentToken), result;\n}, checkServerIdentity = function(hostname, cert) {\n const { subject, subjectaltname: altNames } = cert, dnsNames = [], ips = [];\n if (hostname = \"\" + hostname, altNames) {\n const splitAltNames = StringPrototypeIncludes.call(altNames, '\"') \? splitEscapedAltNames(altNames) : StringPrototypeSplit.call(altNames, \", \");\n ArrayPrototypeForEach.call(splitAltNames, (name) => {\n if (StringPrototypeStartsWith.call(name, \"DNS:\"))\n ArrayPrototypePush.call(dnsNames, StringPrototypeSlice.call(name, 4));\n else if (StringPrototypeStartsWith.call(name, \"IP Address:\"))\n ArrayPrototypePush.call(ips, canonicalizeIP(StringPrototypeSlice.call(name, 11)));\n });\n }\n let valid = !1, reason = \"Unknown reason\";\n if (hostname = unfqdn(hostname), net.isIP(hostname)) {\n if (valid = ArrayPrototypeIncludes.call(ips, canonicalizeIP(hostname)), !valid)\n reason = `IP: ${hostname} is not in the cert's list: ` + ArrayPrototypeJoin.call(ips, \", \");\n } else if (dnsNames.length > 0 || subject\?.CN) {\n const hostParts = splitHost(hostname), wildcard = (pattern) => check(hostParts, pattern, !0);\n if (dnsNames.length > 0) {\n if (valid = ArrayPrototypeSome.call(dnsNames, wildcard), !valid)\n reason = `Host: ${hostname}. is not in the cert's altnames: ${altNames}`;\n } else {\n const cn = subject.CN;\n if (Array.isArray(cn))\n valid = ArrayPrototypeSome.call(cn, wildcard);\n else if (cn)\n valid = wildcard(cn);\n if (!valid)\n reason = `Host: ${hostname}. is not cert's CN: ${cn}`;\n }\n } else\n reason = \"Cert does not contain a DNS name\";\n if (!valid) {\n let error = new Error(`ERR_TLS_CERT_ALTNAME_INVALID: Hostname/IP does not match certificate's altnames: ${reason}`);\n return error.name = \"ERR_TLS_CERT_ALTNAME_INVALID\", error.reason = reason, error.host = hostname, error.cert = cert, error;\n }\n}, SecureContext = function(options) {\n return new InternalSecureContext(options);\n}, createSecureContext = function(options) {\n return new SecureContext(options);\n}, translatePeerCertificate = function(c) {\n if (!c)\n return null;\n if (c.issuerCertificate != null && c.issuerCertificate !== c)\n c.issuerCertificate = translatePeerCertificate(c.issuerCertificate);\n if (c.infoAccess != null) {\n const info = c.infoAccess;\n c.infoAccess = { __proto__: null }, RegExpPrototypeSymbolReplace.call(/([^\\n:]*):([^\\n]*)(\?:\\n|$)/g, info, (all, key, val) => {\n if (val.charCodeAt(0) === 34)\n val = JSONParse(val);\n if (key in c.infoAccess)\n ArrayPrototypePush.call(c.infoAccess[key], val);\n else\n c.infoAccess[key] = [val];\n });\n }\n return c;\n}, createServer = function(options, connectionListener) {\n return new Server(options, connectionListener);\n}, getCiphers = function() {\n return DEFAULT_CIPHERS.split(\":\");\n}, convertProtocols = function(protocols) {\n const lens = new Array(protocols.length), buff = Buffer.allocUnsafe(ArrayPrototypeReduce.call(protocols, (p, c, i) => {\n const len = Buffer.byteLength(c);\n if (len > 255)\n @throwRangeError(\"The byte length of the protocol at index \" + `${i} exceeds the maximum length.`, \"<= 255\", len, !0);\n return lens[i] = len, p + 1 + len;\n }, 0));\n let offset = 0;\n for (let i = 0, c = protocols.length;i < c; i++)\n buff[offset++] = lens[i], buff.write(protocols[i], offset), offset += lens[i];\n return buff;\n}, convertALPNProtocols = function(protocols, out) {\n if (Array.isArray(protocols))\n out.ALPNProtocols = convertProtocols(protocols);\n else if (isTypedArray(protocols))\n out.ALPNProtocols = Buffer.from(protocols);\n else if (isArrayBufferView(protocols))\n out.ALPNProtocols = Buffer.from(protocols.buffer.slice(protocols.byteOffset, protocols.byteOffset + protocols.byteLength));\n else if (Buffer.isBuffer(protocols))\n out.ALPNProtocols = protocols;\n}, $, { isArrayBufferView, isTypedArray } = @requireNativeModule(\"util/types\"), net = @getInternalField(@internalModuleRegistry, 25) || @createInternalModuleById(25), { Server: NetServer, [Symbol.for(\"::bunternal::\")]: InternalTCPSocket } = net, bunSocketInternal = Symbol.for(\"::bunnetsocketinternal::\"), { rootCertificates, canonicalizeIP } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"internal/tls\"), SymbolReplace = Symbol.replace, RegExpPrototypeSymbolReplace = RegExp.prototype[SymbolReplace], RegExpPrototypeExec = RegExp.prototype.exec, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeSlice = String.prototype.slice, StringPrototypeIncludes = String.prototype.includes, StringPrototypeSplit = String.prototype.split, StringPrototypeIndexOf = String.prototype.indexOf, StringPrototypeSubstring = String.prototype.substring, StringPrototypeEndsWith = String.prototype.endsWith, StringFromCharCode = String.fromCharCode, StringPrototypeCharCodeAt = String.prototype.charCodeAt, ArrayPrototypeIncludes = Array.prototype.includes, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeForEach = Array.prototype.forEach, ArrayPrototypePush = Array.prototype.push, ArrayPrototypeSome = Array.prototype.some, ArrayPrototypeReduce = Array.prototype.reduce, jsonStringPattern = /^\"(\?:[^\"\\\\\\u0000-\\u001f]|\\\\(\?:[\"\\\\/bfnrt]|u[0-9a-fA-F]{4}))*\"/, InternalSecureContext = class SecureContext2 {\n context;\n constructor(options) {\n const context = {};\n if (options) {\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.key = key;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.cert = cert;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.ca = ca;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n this.passphrase = passphrase;\n let servername = options.servername;\n if (servername && typeof servername !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n this.servername = servername;\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n this.secureOptions = secureOptions;\n }\n this.context = context;\n }\n}, buntls = Symbol.for(\"::buntls::\"), SocketClass, TLSSocket = function(InternalTLSSocket) {\n return SocketClass = InternalTLSSocket, Object.defineProperty(SocketClass.prototype, Symbol.toStringTag, {\n value: \"TLSSocket\",\n enumerable: !1\n }), Object.defineProperty(function Socket(options) {\n return new InternalTLSSocket(options);\n }, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalTLSSocket;\n }\n });\n}(class TLSSocket2 extends InternalTCPSocket {\n #secureContext;\n ALPNProtocols;\n #socket;\n #checkServerIdentity;\n #session;\n constructor(socket, options) {\n super(socket instanceof InternalTCPSocket \? options : options || socket);\n if (options = options || socket || {}, typeof options === \"object\") {\n const { ALPNProtocols } = options;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, this);\n if (socket instanceof InternalTCPSocket)\n this.#socket = socket;\n }\n this.#secureContext = options.secureContext || createSecureContext(options), this.authorized = !1, this.secureConnecting = !0, this._secureEstablished = !1, this._securePending = !0, this.#checkServerIdentity = options.checkServerIdentity || checkServerIdentity, this.#session = options.session || null;\n }\n _secureEstablished = !1;\n _securePending = !0;\n _newSessionPending;\n _controlReleased;\n secureConnecting = !1;\n _SNICallback;\n servername;\n authorized = !1;\n authorizationError;\n #renegotiationDisabled = !1;\n encrypted = !0;\n _start() {\n this.connect();\n }\n getSession() {\n return this[bunSocketInternal]\?.getSession();\n }\n getEphemeralKeyInfo() {\n return this[bunSocketInternal]\?.getEphemeralKeyInfo();\n }\n getCipher() {\n return this[bunSocketInternal]\?.getCipher();\n }\n getSharedSigalgs() {\n return this[bunSocketInternal]\?.getSharedSigalgs();\n }\n getProtocol() {\n return this[bunSocketInternal]\?.getTLSVersion();\n }\n getFinished() {\n return this[bunSocketInternal]\?.getTLSFinishedMessage() || void 0;\n }\n getPeerFinished() {\n return this[bunSocketInternal]\?.getTLSPeerFinishedMessage() || void 0;\n }\n isSessionReused() {\n return !!this.#session;\n }\n renegotiate() {\n if (this.#renegotiationDisabled) {\n const error = new Error(\"ERR_TLS_RENEGOTIATION_DISABLED: TLS session renegotiation disabled for this socket\");\n throw error.name = \"ERR_TLS_RENEGOTIATION_DISABLED\", error;\n }\n throw Error(\"Not implented in Bun yet\");\n }\n disableRenegotiation() {\n this.#renegotiationDisabled = !0;\n }\n getTLSTicket() {\n return this[bunSocketInternal]\?.getTLSTicket();\n }\n exportKeyingMaterial(length, label, context) {\n if (context)\n return this[bunSocketInternal]\?.exportKeyingMaterial(length, label, context);\n return this[bunSocketInternal]\?.exportKeyingMaterial(length, label);\n }\n setMaxSendFragment(size) {\n return this[bunSocketInternal]\?.setMaxSendFragment(size) || !1;\n }\n enableTrace() {\n }\n setServername(name) {\n if (this.isServer) {\n let error = new Error(\"ERR_TLS_SNI_FROM_SERVER: Cannot issue SNI from a TLS server-side socket\");\n throw error.name = \"ERR_TLS_SNI_FROM_SERVER\", error;\n }\n this.servername = name, this[bunSocketInternal]\?.setServername(name);\n }\n setSession(session) {\n if (this.#session = session, typeof session === \"string\")\n session = Buffer.from(session, \"latin1\");\n return this[bunSocketInternal]\?.setSession(session);\n }\n getPeerCertificate(abbreviated) {\n const cert = arguments.length < 1 \? this[bunSocketInternal]\?.getPeerCertificate() : this[bunSocketInternal]\?.getPeerCertificate(abbreviated);\n if (cert)\n return translatePeerCertificate(cert);\n }\n getCertificate() {\n const cert = this[bunSocketInternal]\?.getCertificate();\n if (cert)\n return translatePeerCertificate(cert);\n }\n getPeerX509Certificate() {\n throw Error(\"Not implented in Bun yet\");\n }\n getX509Certificate() {\n throw Error(\"Not implented in Bun yet\");\n }\n get alpnProtocol() {\n return this[bunSocketInternal]\?.alpnProtocol;\n }\n [buntls](port, host) {\n return {\n socket: this.#socket,\n ALPNProtocols: this.ALPNProtocols,\n serverName: this.servername || host || \"localhost\",\n checkServerIdentity: this.#checkServerIdentity,\n session: this.#session,\n ...this.#secureContext\n };\n }\n});\n\nclass Server extends NetServer {\n key;\n cert;\n ca;\n passphrase;\n secureOptions;\n _rejectUnauthorized;\n _requestCert;\n servername;\n ALPNProtocols;\n constructor(options, secureConnectionListener) {\n super(options, secureConnectionListener);\n this.setSecureContext(options);\n }\n setSecureContext(options) {\n if (options instanceof InternalSecureContext)\n options = options.context;\n if (options) {\n const { ALPNProtocols } = options;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, this);\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.key = key;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.cert = cert;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.ca = ca;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n this.passphrase = passphrase;\n let servername = options.servername;\n if (servername && typeof servername !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n this.servername = servername;\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n this.secureOptions = secureOptions;\n const requestCert = options.requestCert || !1;\n if (requestCert)\n this._requestCert = requestCert;\n else\n this._requestCert = void 0;\n const rejectUnauthorized = options.rejectUnauthorized || !1;\n if (rejectUnauthorized)\n this._rejectUnauthorized = rejectUnauthorized;\n else\n this._rejectUnauthorized = void 0;\n }\n }\n getTicketKeys() {\n throw Error(\"Not implented in Bun yet\");\n }\n setTicketKeys() {\n throw Error(\"Not implented in Bun yet\");\n }\n [buntls](port, host, isClient) {\n return [\n {\n serverName: this.servername || host || \"localhost\",\n key: this.key,\n cert: this.cert,\n ca: this.ca,\n passphrase: this.passphrase,\n secureOptions: this.secureOptions,\n rejectUnauthorized: isClient \? !1 : this._rejectUnauthorized,\n requestCert: isClient \? !1 : this._requestCert,\n ALPNProtocols: this.ALPNProtocols\n },\n SocketClass\n ];\n }\n}\nvar CLIENT_RENEG_LIMIT = 3, CLIENT_RENEG_WINDOW = 600, DEFAULT_ECDH_CURVE = \"auto\", DEFAULT_CIPHERS = \"DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256\", DEFAULT_MIN_VERSION = \"TLSv1.2\", DEFAULT_MAX_VERSION = \"TLSv1.3\", createConnection = (port, host, connectListener) => {\n if (typeof port === \"object\") {\n port.checkServerIdentity;\n const { ALPNProtocols } = port;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, port);\n return new TLSSocket(port).connect(port, host, connectListener);\n }\n return new TLSSocket().connect(port, host, connectListener);\n}, connect = createConnection;\n$ = {\n CLIENT_RENEG_LIMIT,\n CLIENT_RENEG_WINDOW,\n connect,\n convertALPNProtocols,\n createConnection,\n createSecureContext,\n createServer,\n DEFAULT_CIPHERS,\n DEFAULT_ECDH_CURVE,\n DEFAULT_MAX_VERSION,\n DEFAULT_MIN_VERSION,\n getCiphers,\n parseCertString,\n SecureContext,\n Server,\n TLSSocket,\n checkServerIdentity,\n rootCertificates\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeTimersPromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/timers.promises.ts\nvar validateObject = function(object, name) {\n if (object === null || typeof object !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Object\", object);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n}, validateAbortSignal = function(signal, name) {\n if (typeof signal !== \"undefined\" && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, asyncIterator = function({ next: nextFunction, return: returnFunction }) {\n const result = {};\n if (typeof nextFunction === \"function\")\n result.next = nextFunction;\n if (typeof returnFunction === \"function\")\n result.return = returnFunction;\n return result[symbolAsyncIterator] = function() {\n return this;\n }, result;\n}, setTimeoutPromise = function(after = 1, value, options = {}) {\n const arguments_ = [].concat(value \?\? []);\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return @Promise.reject(error);\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return @Promise.reject(error);\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return @Promise.reject(error);\n }\n if (signal\?.aborted)\n return @Promise.reject(new AbortError);\n let onCancel;\n const returnValue = new @Promise((resolve, reject) => {\n const timeout = setTimeout(() => resolve(value), after, ...arguments_);\n if (!reference)\n timeout\?.unref\?.();\n if (signal)\n onCancel = () => {\n clearTimeout(timeout), reject(new AbortError);\n }, signal.addEventListener(\"abort\", onCancel);\n });\n if (typeof onCancel !== \"undefined\")\n returnValue.finally(() => signal.removeEventListener(\"abort\", onCancel));\n return returnValue;\n}, setImmediatePromise = function(value, options = {}) {\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return @Promise.reject(error);\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return @Promise.reject(error);\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return @Promise.reject(error);\n }\n if (signal\?.aborted)\n return @Promise.reject(new AbortError);\n let onCancel;\n const returnValue = new @Promise((resolve, reject) => {\n const immediate = setImmediate(() => resolve(value));\n if (!reference)\n immediate\?.unref\?.();\n if (signal)\n onCancel = () => {\n clearImmediate(immediate), reject(new AbortError);\n }, signal.addEventListener(\"abort\", onCancel);\n });\n if (typeof onCancel !== \"undefined\")\n returnValue.finally(() => signal.removeEventListener(\"abort\", onCancel));\n return returnValue;\n}, setIntervalPromise = function(after = 1, value, options = {}) {\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return @Promise.reject(error);\n }\n });\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return @Promise.reject(error);\n }\n });\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return @Promise.reject(error);\n }\n });\n }\n if (signal\?.aborted)\n return asyncIterator({\n next: function() {\n return @Promise.reject(new AbortError);\n }\n });\n let onCancel, interval;\n try {\n let notYielded = 0, callback;\n if (interval = setInterval(() => {\n if (notYielded++, callback)\n callback(), callback = @undefined;\n }, after), !reference)\n interval\?.unref\?.();\n if (signal)\n onCancel = () => {\n if (clearInterval(interval), callback)\n callback(), callback = @undefined;\n }, signal.addEventListener(\"abort\", onCancel);\n return asyncIterator({\n next: function() {\n return new @Promise((resolve, reject) => {\n if (!signal\?.aborted)\n if (notYielded === 0)\n callback = resolve;\n else\n resolve();\n else if (notYielded === 0)\n reject(new AbortError);\n else\n resolve();\n }).then(() => {\n if (notYielded > 0)\n return notYielded = notYielded - 1, { done: !1, value };\n return { done: !0 };\n });\n },\n return: function() {\n return clearInterval(interval), signal\?.removeEventListener(\"abort\", onCancel), @Promise.resolve({});\n }\n });\n } catch (error) {\n return asyncIterator({\n next: function() {\n clearInterval(interval), signal\?.removeEventListener(\"abort\", onCancel);\n }\n });\n }\n}, $, symbolAsyncIterator = Symbol.asyncIterator;\n\nclass ERR_INVALID_ARG_TYPE extends Error {\n constructor(name, expected, actual) {\n super(`${name} must be ${expected}, ${typeof actual} given`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\n\nclass AbortError extends Error {\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\n$ = {\n setTimeout: setTimeoutPromise,\n setImmediate: setImmediatePromise,\n setInterval: setIntervalPromise,\n scheduler: {\n wait: (delay, options) => setTimeoutPromise(delay, @undefined, options),\n yield: setImmediatePromise\n }\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeTraceEventsCode = "(function (){\"use strict\";// src/js/out/tmp/node/trace_events.ts\nvar ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, createTracing = function(opts) {\n if (typeof opts !== \"object\" || opts == null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", opts);\n return new Tracing(opts);\n}, getEnabledCategories = function() {\n return \"\";\n}, $;\n\nclass Tracing {\n enabled = !1;\n categories = \"\";\n}\n$ = {\n createTracing,\n getEnabledCategories\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeTLSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/tls.ts\nvar parseCertString = function() {\n throwNotImplemented(\"Not implemented\");\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof @ArrayBuffer || obj instanceof Blob)\n return !0;\n if (@Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof @ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, unfqdn = function(host) {\n return RegExpPrototypeSymbolReplace.@call(/[.]$/, host, \"\");\n}, toLowerCase = function(c) {\n return StringFromCharCode.@call(32 + StringPrototypeCharCodeAt.@call(c, 0));\n}, splitHost = function(host) {\n return StringPrototypeSplit.@call(RegExpPrototypeSymbolReplace.@call(/[A-Z]/g, unfqdn(host), toLowerCase), \".\");\n}, check = function(hostParts, pattern, wildcards) {\n if (!pattern)\n return !1;\n const patternParts = splitHost(pattern);\n if (hostParts.length !== patternParts.length)\n return !1;\n if (ArrayPrototypeIncludes.@call(patternParts, \"\"))\n return !1;\n const isBad = (s) => RegExpPrototypeExec.@call(/[^\\u0021-\\u007F]/u, s) !== null;\n if (ArrayPrototypeSome.@call(patternParts, isBad))\n return !1;\n for (let i = hostParts.length - 1;i > 0; i -= 1)\n if (hostParts[i] !== patternParts[i])\n return !1;\n const hostSubdomain = hostParts[0], patternSubdomain = patternParts[0], patternSubdomainParts = StringPrototypeSplit.@call(patternSubdomain, \"*\");\n if (patternSubdomainParts.length === 1 || StringPrototypeIncludes.@call(patternSubdomain, \"xn--\"))\n return hostSubdomain === patternSubdomain;\n if (!wildcards)\n return !1;\n if (patternSubdomainParts.length > 2)\n return !1;\n if (patternParts.length <= 2)\n return !1;\n const { 0: prefix, 1: suffix } = patternSubdomainParts;\n if (prefix.length + suffix.length > hostSubdomain.length)\n return !1;\n if (!StringPrototypeStartsWith.@call(hostSubdomain, prefix))\n return !1;\n if (!StringPrototypeEndsWith.@call(hostSubdomain, suffix))\n return !1;\n return !0;\n}, splitEscapedAltNames = function(altNames) {\n const result = [];\n let currentToken = \"\", offset = 0;\n while (offset !== altNames.length) {\n const nextSep = StringPrototypeIndexOf.@call(altNames, \", \", offset), nextQuote = StringPrototypeIndexOf.@call(altNames, '\"', offset);\n if (nextQuote !== -1 && (nextSep === -1 || nextQuote < nextSep)) {\n currentToken += StringPrototypeSubstring.@call(altNames, offset, nextQuote);\n const match = RegExpPrototypeExec.@call(jsonStringPattern, StringPrototypeSubstring.@call(altNames, nextQuote));\n if (!match) {\n let error = new SyntaxError(\"ERR_TLS_CERT_ALTNAME_FORMAT: Invalid subject alternative name string\");\n throw error.name = ERR_TLS_CERT_ALTNAME_FORMAT, error;\n }\n currentToken += JSON.parse(match[0]), offset = nextQuote + match[0].length;\n } else if (nextSep !== -1)\n currentToken += StringPrototypeSubstring.@call(altNames, offset, nextSep), ArrayPrototypePush.@call(result, currentToken), currentToken = \"\", offset = nextSep + 2;\n else\n currentToken += StringPrototypeSubstring.@call(altNames, offset), offset = altNames.length;\n }\n return ArrayPrototypePush.@call(result, currentToken), result;\n}, checkServerIdentity = function(hostname, cert) {\n const { subject, subjectaltname: altNames } = cert, dnsNames = [], ips = [];\n if (hostname = \"\" + hostname, altNames) {\n const splitAltNames = StringPrototypeIncludes.@call(altNames, '\"') \? splitEscapedAltNames(altNames) : StringPrototypeSplit.@call(altNames, \", \");\n ArrayPrototypeForEach.@call(splitAltNames, (name) => {\n if (StringPrototypeStartsWith.@call(name, \"DNS:\"))\n ArrayPrototypePush.@call(dnsNames, StringPrototypeSlice.@call(name, 4));\n else if (StringPrototypeStartsWith.@call(name, \"IP Address:\"))\n ArrayPrototypePush.@call(ips, canonicalizeIP(StringPrototypeSlice.@call(name, 11)));\n });\n }\n let valid = !1, reason = \"Unknown reason\";\n if (hostname = unfqdn(hostname), net.isIP(hostname)) {\n if (valid = ArrayPrototypeIncludes.@call(ips, canonicalizeIP(hostname)), !valid)\n reason = `IP: ${hostname} is not in the cert's list: ` + ArrayPrototypeJoin.@call(ips, \", \");\n } else if (dnsNames.length > 0 || subject\?.CN) {\n const hostParts = splitHost(hostname), wildcard = (pattern) => check(hostParts, pattern, !0);\n if (dnsNames.length > 0) {\n if (valid = ArrayPrototypeSome.@call(dnsNames, wildcard), !valid)\n reason = `Host: ${hostname}. is not in the cert's altnames: ${altNames}`;\n } else {\n const cn = subject.CN;\n if (@Array.isArray(cn))\n valid = ArrayPrototypeSome.@call(cn, wildcard);\n else if (cn)\n valid = wildcard(cn);\n if (!valid)\n reason = `Host: ${hostname}. is not cert's CN: ${cn}`;\n }\n } else\n reason = \"Cert does not contain a DNS name\";\n if (!valid) {\n let error = new Error(`ERR_TLS_CERT_ALTNAME_INVALID: Hostname/IP does not match certificate's altnames: ${reason}`);\n return error.name = \"ERR_TLS_CERT_ALTNAME_INVALID\", error.reason = reason, error.host = hostname, error.cert = cert, error;\n }\n}, SecureContext = function(options) {\n return new InternalSecureContext(options);\n}, createSecureContext = function(options) {\n return new SecureContext(options);\n}, translatePeerCertificate = function(c) {\n if (!c)\n return null;\n if (c.issuerCertificate != null && c.issuerCertificate !== c)\n c.issuerCertificate = translatePeerCertificate(c.issuerCertificate);\n if (c.infoAccess != null) {\n const info = c.infoAccess;\n c.infoAccess = { __proto__: null }, RegExpPrototypeSymbolReplace.@call(/([^\\n:]*):([^\\n]*)(\?:\\n|$)/g, info, (all, key, val) => {\n if (val.charCodeAt(0) === 34)\n val = JSONParse(val);\n if (key in c.infoAccess)\n ArrayPrototypePush.@call(c.infoAccess[key], val);\n else\n c.infoAccess[key] = [val];\n });\n }\n return c;\n}, createServer = function(options, connectionListener) {\n return new Server(options, connectionListener);\n}, getCiphers = function() {\n return DEFAULT_CIPHERS.split(\":\");\n}, convertProtocols = function(protocols) {\n const lens = new @Array(protocols.length), buff = @Buffer.allocUnsafe(ArrayPrototypeReduce.@call(protocols, (p, c, i) => {\n const len = @Buffer.byteLength(c);\n if (len > 255)\n @throwRangeError(\"The byte length of the protocol at index \" + `${i} exceeds the maximum length.`, \"<= 255\", len, !0);\n return lens[i] = len, p + 1 + len;\n }, 0));\n let offset = 0;\n for (let i = 0, c = protocols.length;i < c; i++)\n buff[offset++] = lens[i], buff.write(protocols[i], offset), offset += lens[i];\n return buff;\n}, convertALPNProtocols = function(protocols, out) {\n if (@Array.isArray(protocols))\n out.ALPNProtocols = convertProtocols(protocols);\n else if (isTypedArray(protocols))\n out.ALPNProtocols = @Buffer.from(protocols);\n else if (isArrayBufferView(protocols))\n out.ALPNProtocols = @Buffer.from(protocols.buffer.slice(protocols.byteOffset, protocols.byteOffset + protocols.byteLength));\n else if (@Buffer.isBuffer(protocols))\n out.ALPNProtocols = protocols;\n}, $, { isArrayBufferView, isTypedArray } = @requireNativeModule(\"util/types\"), net = @getInternalField(@internalModuleRegistry, 27) || @createInternalModuleById(27), { Server: NetServer, [Symbol.for(\"::bunternal::\")]: InternalTCPSocket } = net, bunSocketInternal = Symbol.for(\"::bunnetsocketinternal::\"), { rootCertificates, canonicalizeIP } = @lazy(\"internal/tls\"), SymbolReplace = Symbol.replace, RegExpPrototypeSymbolReplace = @RegExp.prototype[SymbolReplace], RegExpPrototypeExec = @RegExp.prototype.exec, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeSlice = @String.prototype.slice, StringPrototypeIncludes = @String.prototype.includes, StringPrototypeSplit = @String.prototype.split, StringPrototypeIndexOf = @String.prototype.indexOf, StringPrototypeSubstring = @String.prototype.substring, StringPrototypeEndsWith = @String.prototype.endsWith, StringFromCharCode = @String.fromCharCode, StringPrototypeCharCodeAt = @String.prototype.charCodeAt, ArrayPrototypeIncludes = @Array.prototype.includes, ArrayPrototypeJoin = @Array.prototype.join, ArrayPrototypeForEach = @Array.prototype.forEach, ArrayPrototypePush = @Array.prototype.push, ArrayPrototypeSome = @Array.prototype.some, ArrayPrototypeReduce = @Array.prototype.reduce, jsonStringPattern = /^\"(\?:[^\"\\\\\\u0000-\\u001f]|\\\\(\?:[\"\\\\/bfnrt]|u[0-9a-fA-F]{4}))*\"/, InternalSecureContext = class SecureContext2 {\n context;\n constructor(options) {\n const context = {};\n if (options) {\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.key = key;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.cert = cert;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.ca = ca;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n this.passphrase = passphrase;\n let servername = options.servername;\n if (servername && typeof servername !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n this.servername = servername;\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n this.secureOptions = secureOptions;\n }\n this.context = context;\n }\n}, buntls = Symbol.for(\"::buntls::\"), SocketClass, TLSSocket = function(InternalTLSSocket) {\n SocketClass = InternalTLSSocket, Object.defineProperty(SocketClass.prototype, Symbol.toStringTag, {\n value: \"TLSSocket\",\n enumerable: !1\n });\n function Socket(options) {\n return new InternalTLSSocket(options);\n }\n return Socket.prototype = InternalTLSSocket.prototype, Object.defineProperty(Socket, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalTLSSocket;\n }\n });\n}(class TLSSocket2 extends InternalTCPSocket {\n #secureContext;\n ALPNProtocols;\n #socket;\n #checkServerIdentity;\n #session;\n constructor(socket, options) {\n super(socket instanceof InternalTCPSocket \? options : options || socket);\n if (options = options || socket || {}, typeof options === \"object\") {\n const { ALPNProtocols } = options;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, this);\n if (socket instanceof InternalTCPSocket)\n this.#socket = socket;\n }\n this.#secureContext = options.secureContext || createSecureContext(options), this.authorized = !1, this.secureConnecting = !0, this._secureEstablished = !1, this._securePending = !0, this.#checkServerIdentity = options.checkServerIdentity || checkServerIdentity, this.#session = options.session || null;\n }\n _secureEstablished = !1;\n _securePending = !0;\n _newSessionPending;\n _controlReleased;\n secureConnecting = !1;\n _SNICallback;\n servername;\n authorized = !1;\n authorizationError;\n #renegotiationDisabled = !1;\n encrypted = !0;\n _start() {\n this.connect();\n }\n getSession() {\n return this[bunSocketInternal]\?.getSession();\n }\n getEphemeralKeyInfo() {\n return this[bunSocketInternal]\?.getEphemeralKeyInfo();\n }\n getCipher() {\n return this[bunSocketInternal]\?.getCipher();\n }\n getSharedSigalgs() {\n return this[bunSocketInternal]\?.getSharedSigalgs();\n }\n getProtocol() {\n return this[bunSocketInternal]\?.getTLSVersion();\n }\n getFinished() {\n return this[bunSocketInternal]\?.getTLSFinishedMessage() || @undefined;\n }\n getPeerFinished() {\n return this[bunSocketInternal]\?.getTLSPeerFinishedMessage() || @undefined;\n }\n isSessionReused() {\n return !!this.#session;\n }\n renegotiate() {\n if (this.#renegotiationDisabled) {\n const error = new Error(\"ERR_TLS_RENEGOTIATION_DISABLED: TLS session renegotiation disabled for this socket\");\n throw error.name = \"ERR_TLS_RENEGOTIATION_DISABLED\", error;\n }\n throw Error(\"Not implented in Bun yet\");\n }\n disableRenegotiation() {\n this.#renegotiationDisabled = !0;\n }\n getTLSTicket() {\n return this[bunSocketInternal]\?.getTLSTicket();\n }\n exportKeyingMaterial(length, label, context) {\n if (context)\n return this[bunSocketInternal]\?.exportKeyingMaterial(length, label, context);\n return this[bunSocketInternal]\?.exportKeyingMaterial(length, label);\n }\n setMaxSendFragment(size) {\n return this[bunSocketInternal]\?.setMaxSendFragment(size) || !1;\n }\n enableTrace() {\n }\n setServername(name) {\n if (this.isServer) {\n let error = new Error(\"ERR_TLS_SNI_FROM_SERVER: Cannot issue SNI from a TLS server-side socket\");\n throw error.name = \"ERR_TLS_SNI_FROM_SERVER\", error;\n }\n this.servername = name, this[bunSocketInternal]\?.setServername(name);\n }\n setSession(session) {\n if (this.#session = session, typeof session === \"string\")\n session = @Buffer.from(session, \"latin1\");\n return this[bunSocketInternal]\?.setSession(session);\n }\n getPeerCertificate(abbreviated) {\n const cert = arguments.length < 1 \? this[bunSocketInternal]\?.getPeerCertificate() : this[bunSocketInternal]\?.getPeerCertificate(abbreviated);\n if (cert)\n return translatePeerCertificate(cert);\n }\n getCertificate() {\n const cert = this[bunSocketInternal]\?.getCertificate();\n if (cert)\n return translatePeerCertificate(cert);\n }\n getPeerX509Certificate() {\n throw Error(\"Not implented in Bun yet\");\n }\n getX509Certificate() {\n throw Error(\"Not implented in Bun yet\");\n }\n get alpnProtocol() {\n return this[bunSocketInternal]\?.alpnProtocol;\n }\n [buntls](port, host) {\n return {\n socket: this.#socket,\n ALPNProtocols: this.ALPNProtocols,\n serverName: this.servername || host || \"localhost\",\n checkServerIdentity: this.#checkServerIdentity,\n session: this.#session,\n ...this.#secureContext\n };\n }\n});\n\nclass Server extends NetServer {\n key;\n cert;\n ca;\n passphrase;\n secureOptions;\n _rejectUnauthorized;\n _requestCert;\n servername;\n ALPNProtocols;\n constructor(options, secureConnectionListener) {\n super(options, secureConnectionListener);\n this.setSecureContext(options);\n }\n setSecureContext(options) {\n if (options instanceof InternalSecureContext)\n options = options.context;\n if (options) {\n const { ALPNProtocols } = options;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, this);\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.key = key;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.cert = cert;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.ca = ca;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n this.passphrase = passphrase;\n let servername = options.servername;\n if (servername && typeof servername !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n this.servername = servername;\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n this.secureOptions = secureOptions;\n const requestCert = options.requestCert || !1;\n if (requestCert)\n this._requestCert = requestCert;\n else\n this._requestCert = @undefined;\n const rejectUnauthorized = options.rejectUnauthorized || !1;\n if (rejectUnauthorized)\n this._rejectUnauthorized = rejectUnauthorized;\n else\n this._rejectUnauthorized = @undefined;\n }\n }\n getTicketKeys() {\n throw Error(\"Not implented in Bun yet\");\n }\n setTicketKeys() {\n throw Error(\"Not implented in Bun yet\");\n }\n [buntls](port, host, isClient) {\n return [\n {\n serverName: this.servername || host || \"localhost\",\n key: this.key,\n cert: this.cert,\n ca: this.ca,\n passphrase: this.passphrase,\n secureOptions: this.secureOptions,\n rejectUnauthorized: isClient \? !1 : this._rejectUnauthorized,\n requestCert: isClient \? !1 : this._requestCert,\n ALPNProtocols: this.ALPNProtocols\n },\n SocketClass\n ];\n }\n}\nvar CLIENT_RENEG_LIMIT = 3, CLIENT_RENEG_WINDOW = 600, DEFAULT_ECDH_CURVE = \"auto\", DEFAULT_CIPHERS = \"DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256\", DEFAULT_MIN_VERSION = \"TLSv1.2\", DEFAULT_MAX_VERSION = \"TLSv1.3\", createConnection = (port, host, connectListener) => {\n if (typeof port === \"object\") {\n port.checkServerIdentity;\n const { ALPNProtocols } = port;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, port);\n return new TLSSocket(port).connect(port, host, connectListener);\n }\n return new TLSSocket().connect(port, host, connectListener);\n}, connect = createConnection;\n$ = {\n CLIENT_RENEG_LIMIT,\n CLIENT_RENEG_WINDOW,\n connect,\n convertALPNProtocols,\n createConnection,\n createSecureContext,\n createServer,\n DEFAULT_CIPHERS,\n DEFAULT_ECDH_CURVE,\n DEFAULT_MAX_VERSION,\n DEFAULT_MIN_VERSION,\n getCiphers,\n parseCertString,\n SecureContext,\n Server,\n TLSSocket,\n checkServerIdentity,\n rootCertificates\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeTtyCode = "(function (){\"use strict\";// src/js/out/tmp/node/tty.ts\nvar ReadStream = function(fd) {\n if (!(this instanceof ReadStream))\n return new ReadStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19)).ReadStream.call(this, \"\", {\n fd\n });\n return stream.isRaw = !1, stream.isTTY = isatty(stream.fd), stream;\n}, warnOnDeactivatedColors = function(env) {\n if (warned)\n return;\n let name = \"\";\n if (env.NODE_DISABLE_COLORS !== void 0)\n name = \"NODE_DISABLE_COLORS\";\n if (env.NO_COLOR !== void 0) {\n if (name !== \"\")\n name += \"' and '\";\n name += \"NO_COLOR\";\n }\n if (name !== \"\")\n process.emitWarning(`The '${name}' env is ignored due to the 'FORCE_COLOR' env being set.`, \"Warning\"), warned = !0;\n}, WriteStream = function(fd) {\n if (!(this instanceof WriteStream))\n return new WriteStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19)).WriteStream.call(this, \"\", {\n fd\n });\n if (stream.columns = void 0, stream.rows = void 0, stream.isTTY = isatty(stream.fd), stream.isTTY) {\n const windowSizeArray = [0, 0];\n if (_getWindowSize(fd, windowSizeArray) === !0)\n stream.columns = windowSizeArray[0], stream.rows = windowSizeArray[1];\n }\n return stream;\n}, { ttySetMode, isatty, getWindowSize: _getWindowSize } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"tty\");\nObject.defineProperty(ReadStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19)).ReadStream.prototype;\n return Object.defineProperty(ReadStream, \"prototype\", { value: Real }), ReadStream.prototype.setRawMode = function(flag) {\n const mode = flag \? 1 : 0, err = ttySetMode(this.fd, mode);\n if (err)\n return this.emit(\"error\", new Error(\"setRawMode failed with errno:\", err)), this;\n return this.isRaw = flag, this;\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar OSRelease, COLORS_2 = 1, COLORS_16 = 4, COLORS_256 = 8, COLORS_16m = 24, TERM_ENVS = {\n eterm: COLORS_16,\n cons25: COLORS_16,\n console: COLORS_16,\n cygwin: COLORS_16,\n dtterm: COLORS_16,\n gnome: COLORS_16,\n hurd: COLORS_16,\n jfbterm: COLORS_16,\n konsole: COLORS_16,\n kterm: COLORS_16,\n mlterm: COLORS_16,\n mosh: COLORS_16m,\n putty: COLORS_16,\n st: COLORS_16,\n \"rxvt-unicode-24bit\": COLORS_16m,\n terminator: COLORS_16m\n}, TERM_ENVS_REG_EXP = [/ansi/, /color/, /linux/, /^con[0-9]*x[0-9]/, /^rxvt/, /^screen/, /^xterm/, /^vt100/], warned = !1;\nObject.defineProperty(WriteStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19)).WriteStream.prototype;\n Object.defineProperty(WriteStream, \"prototype\", { value: Real }), WriteStream.prototype._refreshSize = function() {\n const oldCols = this.columns, oldRows = this.rows, windowSizeArray = [0, 0];\n if (_getWindowSize(this.fd, windowSizeArray) === !0) {\n if (oldCols !== windowSizeArray[0] || oldRows !== windowSizeArray[1])\n this.columns = windowSizeArray[0], this.rows = windowSizeArray[1], this.emit(\"resize\");\n }\n };\n var readline = void 0;\n return WriteStream.prototype.clearLine = function(dir, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).clearLine(this, dir, cb);\n }, WriteStream.prototype.clearScreenDown = function(cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).clearScreenDown(this, cb);\n }, WriteStream.prototype.cursorTo = function(x, y, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).cursorTo(this, x, y, cb);\n }, WriteStream.prototype.getColorDepth = function(env = process.env) {\n if (env.FORCE_COLOR !== void 0)\n switch (env.FORCE_COLOR) {\n case \"\":\n case \"1\":\n case \"true\":\n return warnOnDeactivatedColors(env), COLORS_16;\n case \"2\":\n return warnOnDeactivatedColors(env), COLORS_256;\n case \"3\":\n return warnOnDeactivatedColors(env), COLORS_16m;\n default:\n return COLORS_2;\n }\n if (env.NODE_DISABLE_COLORS !== void 0 || env.NO_COLOR !== void 0 || env.TERM === \"dumb\")\n return COLORS_2;\n if (OSRelease === void 0) {\n const { release } = @getInternalField(@internalModuleRegistry, 26) || @createInternalModuleById(26);\n OSRelease = StringPrototypeSplit(release(), \".\");\n }\n if (+OSRelease[0] >= 10) {\n const build = +OSRelease[2];\n if (build >= 14931)\n return COLORS_16m;\n if (build >= 10586)\n return COLORS_256;\n }\n return COLORS_16;\n switch (env.TERM_PROGRAM) {\n case \"iTerm.app\":\n if (!env.TERM_PROGRAM_VERSION || RegExpPrototypeExec(/^[0-2]\\./, env.TERM_PROGRAM_VERSION) !== null)\n return COLORS_256;\n return COLORS_16m;\n case \"HyperTerm\":\n case \"MacTerm\":\n return COLORS_16m;\n case \"Apple_Terminal\":\n return COLORS_256;\n }\n }, WriteStream.prototype.getWindowSize = function() {\n return [this.columns, this.rows];\n }, WriteStream.prototype.hasColors = function(count, env) {\n if (env === void 0 && (count === void 0 || typeof count === \"object\" && count !== null))\n env = count, count = 16;\n else\n validateInteger(count, \"count\", 2);\n return count <= 2 ** this.getColorDepth(env);\n }, WriteStream.prototype.moveCursor = function(dx, dy, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).moveCursor(this, dx, dy, cb);\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar validateInteger = (value, name, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!Number.isInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n};\nreturn { ReadStream, WriteStream, isatty }})\n"_s;
+static constexpr ASCIILiteral NodeTraceEventsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/trace_events.ts\nvar ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, createTracing = function(opts) {\n if (typeof opts !== \"object\" || opts == null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", opts);\n return new Tracing(opts);\n}, getEnabledCategories = function() {\n return \"\";\n}, $;\n\nclass Tracing {\n enabled = !1;\n categories = \"\";\n}\n$ = {\n createTracing,\n getEnabledCategories\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeUrlCode = "(function (){\"use strict\";// src/js/out/tmp/node/url.ts\nvar Url = function() {\n this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;\n}, urlParse = function(url, parseQueryString, slashesDenoteHost) {\n if (url && typeof url === \"object\" && url instanceof Url)\n return url;\n var u = new Url;\n return u.parse(url, parseQueryString, slashesDenoteHost), u;\n}, urlFormat = function(obj) {\n if (typeof obj === \"string\")\n obj = urlParse(obj);\n if (!(obj instanceof Url))\n return Url.prototype.format.call(obj);\n return obj.format();\n}, urlResolve = function(source, relative) {\n return urlParse(source, !1, !0).resolve(relative);\n}, urlResolveObject = function(source, relative) {\n if (!source)\n return relative;\n return urlParse(source, !1, !0).resolveObject(relative);\n}, urlToHttpOptions = function(url) {\n const options = {\n protocol: url.protocol,\n hostname: typeof url.hostname === \"string\" && url.hostname.startsWith(\"[\") \? url.hostname.slice(1, -1) : url.hostname,\n hash: url.hash,\n search: url.search,\n pathname: url.pathname,\n path: `${url.pathname || \"\"}${url.search || \"\"}`,\n href: url.href\n };\n if (url.port !== \"\")\n options.port = Number(url.port);\n if (url.username || url.password)\n options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;\n return options;\n}, $, { URL, URLSearchParams } = globalThis;\nUrl.prototype = {};\nvar protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, simplePathPattern = /^(\\/\\/\?(\?!\\/)[^\?\\s]*)(\\\?[^\\s]*)\?$/, delims = [\"<\", \">\", '\"', \"`\", \" \", \"\\r\", \"\\n\", \"\\t\"], unwise = [\"{\", \"}\", \"|\", \"\\\\\", \"^\", \"`\"].concat(delims), autoEscape = [\"'\"].concat(unwise), nonHostChars = [\"%\", \"/\", \"\?\", \";\", \"#\"].concat(autoEscape), hostEndingChars = [\"/\", \"\?\", \"#\"], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, unsafeProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, hostlessProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, slashedProtocol = {\n http: !0,\n https: !0,\n ftp: !0,\n gopher: !0,\n file: !0,\n \"http:\": !0,\n \"https:\": !0,\n \"ftp:\": !0,\n \"gopher:\": !0,\n \"file:\": !0\n};\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (typeof url !== \"string\")\n @throwTypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n var queryIndex = url.indexOf(\"\?\"), splitter = queryIndex !== -1 && queryIndex < url.indexOf(\"#\") \? \"\?\" : \"#\", uSplit = url.split(splitter), slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, \"/\"), url = uSplit.join(splitter);\n var rest = url;\n if (rest = rest.trim(), !slashesDenoteHost && url.split(\"#\").length === 1) {\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n if (this.path = rest, this.href = rest, this.pathname = simplePath[1], simplePath[2])\n if (this.search = simplePath[2], parseQueryString)\n this.query = new URLSearchParams(this.search.substr(1)).toJSON();\n else\n this.query = this.search.substr(1);\n else if (parseQueryString)\n this.search = \"\", this.query = {};\n return this;\n }\n }\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto, rest = rest.substr(proto.length);\n }\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@/]+@[^@/]+/)) {\n var slashes = rest.substr(0, 2) === \"//\";\n if (slashes && !(proto && hostlessProtocol[proto]))\n rest = rest.substr(2), this.slashes = !0;\n }\n if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {\n var hostEnd = -1;\n for (var i = 0;i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n var auth, atSign;\n if (hostEnd === -1)\n atSign = rest.lastIndexOf(\"@\");\n else\n atSign = rest.lastIndexOf(\"@\", hostEnd);\n if (atSign !== -1)\n auth = rest.slice(0, atSign), rest = rest.slice(atSign + 1), this.auth = decodeURIComponent(auth);\n hostEnd = -1;\n for (var i = 0;i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n if (hostEnd === -1)\n hostEnd = rest.length;\n this.host = rest.slice(0, hostEnd), rest = rest.slice(hostEnd), this.parseHost(), this.hostname = this.hostname || \"\";\n var ipv6Hostname = this.hostname[0] === \"[\" && this.hostname[this.hostname.length - 1] === \"]\";\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length;i < l; i++) {\n var part = hostparts[i];\n if (!part)\n continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = \"\";\n for (var j = 0, k = part.length;j < k; j++)\n if (part.charCodeAt(j) > 127)\n newpart += \"x\";\n else\n newpart += part[j];\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i), notHost = hostparts.slice(i + 1), bit = part.match(hostnamePartStart);\n if (bit)\n validParts.push(bit[1]), notHost.unshift(bit[2]);\n if (notHost.length)\n rest = \"/\" + notHost.join(\".\") + rest;\n this.hostname = validParts.join(\".\");\n break;\n }\n }\n }\n }\n if (this.hostname.length > hostnameMaxLen)\n this.hostname = \"\";\n else\n this.hostname = this.hostname.toLowerCase();\n if (!ipv6Hostname)\n this.hostname = new URL(\"http://\" + this.hostname).hostname;\n var p = this.port \? \":\" + this.port : \"\", h = this.hostname || \"\";\n if (this.host = h + p, this.href += this.host, ipv6Hostname) {\n if (this.hostname = this.hostname.substr(1, this.hostname.length - 2), rest[0] !== \"/\")\n rest = \"/\" + rest;\n }\n }\n if (!unsafeProtocol[lowerProto])\n for (var i = 0, l = autoEscape.length;i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae)\n esc = escape(ae);\n rest = rest.split(ae).join(esc);\n }\n var hash = rest.indexOf(\"#\");\n if (hash !== -1)\n this.hash = rest.substr(hash), rest = rest.slice(0, hash);\n var qm = rest.indexOf(\"\?\");\n if (qm !== -1) {\n if (this.search = rest.substr(qm), this.query = rest.substr(qm + 1), parseQueryString)\n this.query = new URLSearchParams(this.query);\n rest = rest.slice(0, qm);\n } else if (parseQueryString)\n this.search = \"\", this.query = {};\n if (rest)\n this.pathname = rest;\n if (slashedProtocol[lowerProto] && this.hostname && !this.pathname)\n this.pathname = \"/\";\n if (this.pathname || this.search) {\n var p = this.pathname || \"\", s = this.search || \"\";\n this.path = p + s;\n }\n return this.href = this.format(), this;\n};\nUrl.prototype.format = function() {\n var auth = this.auth || \"\";\n if (auth)\n auth = encodeURIComponent(auth), auth = auth.replace(/%3A/i, \":\"), auth += \"@\";\n var protocol = this.protocol || \"\", pathname = this.pathname || \"\", hash = this.hash || \"\", host = !1, query = \"\";\n if (this.host)\n host = auth + this.host;\n else if (this.hostname) {\n if (host = auth + (this.hostname.indexOf(\":\") === -1 \? this.hostname : \"[\" + this.hostname + \"]\"), this.port)\n host += \":\" + this.port;\n }\n if (this.query && typeof this.query === \"object\" && Object.keys(this.query).length)\n query = new URLSearchParams(this.query).toString();\n var search = this.search || query && \"\?\" + query || \"\";\n if (protocol && protocol.substr(-1) !== \":\")\n protocol += \":\";\n if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== !1) {\n if (host = \"//\" + (host || \"\"), pathname && pathname.charAt(0) !== \"/\")\n pathname = \"/\" + pathname;\n } else if (!host)\n host = \"\";\n if (hash && hash.charAt(0) !== \"#\")\n hash = \"#\" + hash;\n if (search && search.charAt(0) !== \"\?\")\n search = \"\?\" + search;\n return pathname = pathname.replace(/[\?#]/g, function(match) {\n return encodeURIComponent(match);\n }), search = search.replace(\"#\", \"%23\"), protocol + host + pathname + search + hash;\n};\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, !1, !0)).format();\n};\nUrl.prototype.resolveObject = function(relative) {\n if (typeof relative === \"string\") {\n var rel = new Url;\n rel.parse(relative, !1, !0), relative = rel;\n }\n var result = new Url, tkeys = Object.keys(this);\n for (var tk = 0;tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n if (result.hash = relative.hash, relative.href === \"\")\n return result.href = result.format(), result;\n if (relative.slashes && !relative.protocol) {\n var rkeys = Object.keys(relative);\n for (var rk = 0;rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== \"protocol\")\n result[rkey] = relative[rkey];\n }\n if (slashedProtocol[result.protocol] && result.hostname && !result.pathname)\n result.pathname = \"/\", result.path = result.pathname;\n return result.href = result.format(), result;\n }\n if (relative.protocol && relative.protocol !== result.protocol) {\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0;v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n return result.href = result.format(), result;\n }\n if (result.protocol = relative.protocol, !relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || \"\").split(\"/\");\n while (relPath.length && !(relative.host = relPath.shift()))\n ;\n if (!relative.host)\n relative.host = \"\";\n if (!relative.hostname)\n relative.hostname = \"\";\n if (relPath[0] !== \"\")\n relPath.unshift(\"\");\n if (relPath.length < 2)\n relPath.unshift(\"\");\n result.pathname = relPath.join(\"/\");\n } else\n result.pathname = relative.pathname;\n if (result.search = relative.search, result.query = relative.query, result.host = relative.host || \"\", result.auth = relative.auth, result.hostname = relative.hostname || relative.host, result.port = relative.port, result.pathname || result.search) {\n var p = result.pathname || \"\", s = result.search || \"\";\n result.path = p + s;\n }\n return result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n }\n var isSourceAbs = result.pathname && result.pathname.charAt(0) === \"/\", isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === \"/\", mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split(\"/\") || [], relPath = relative.pathname && relative.pathname.split(\"/\") || [], psychotic = result.protocol && !slashedProtocol[result.protocol];\n if (psychotic) {\n if (result.hostname = \"\", result.port = null, result.host)\n if (srcPath[0] === \"\")\n srcPath[0] = result.host;\n else\n srcPath.unshift(result.host);\n if (result.host = \"\", relative.protocol) {\n if (relative.hostname = null, relative.port = null, relative.host)\n if (relPath[0] === \"\")\n relPath[0] = relative.host;\n else\n relPath.unshift(relative.host);\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === \"\" || srcPath[0] === \"\");\n }\n if (isRelAbs)\n result.host = relative.host || relative.host === \"\" \? relative.host : result.host, result.hostname = relative.hostname || relative.hostname === \"\" \? relative.hostname : result.hostname, result.search = relative.search, result.query = relative.query, srcPath = relPath;\n else if (relPath.length) {\n if (!srcPath)\n srcPath = [];\n srcPath.pop(), srcPath = srcPath.concat(relPath), result.search = relative.search, result.query = relative.query;\n } else if (relative.search != null) {\n if (psychotic) {\n result.host = srcPath.shift(), result.hostname = result.host;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (result.search = relative.search, result.query = relative.query, result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.href = result.format(), result;\n }\n if (!srcPath.length) {\n if (result.pathname = null, result.search)\n result.path = \"/\" + result.search;\n else\n result.path = null;\n return result.href = result.format(), result;\n }\n var last = srcPath.slice(-1)[0], hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === \".\" || last === \"..\") || last === \"\", up = 0;\n for (var i = srcPath.length;i >= 0; i--)\n if (last = srcPath[i], last === \".\")\n srcPath.splice(i, 1);\n else if (last === \"..\")\n srcPath.splice(i, 1), up++;\n else if (up)\n srcPath.splice(i, 1), up--;\n if (!mustEndAbs && !removeAllDots)\n for (;up--; up)\n srcPath.unshift(\"..\");\n if (mustEndAbs && srcPath[0] !== \"\" && (!srcPath[0] || srcPath[0].charAt(0) !== \"/\"))\n srcPath.unshift(\"\");\n if (hasTrailingSlash && srcPath.join(\"/\").substr(-1) !== \"/\")\n srcPath.push(\"\");\n var isAbsolute = srcPath[0] === \"\" || srcPath[0] && srcPath[0].charAt(0) === \"/\";\n if (psychotic) {\n result.hostname = isAbsolute \? \"\" : srcPath.length \? srcPath.shift() : \"\", result.host = result.hostname;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (mustEndAbs = mustEndAbs || result.host && srcPath.length, mustEndAbs && !isAbsolute)\n srcPath.unshift(\"\");\n if (srcPath.length > 0)\n result.pathname = srcPath.join(\"/\");\n else\n result.pathname = null, result.path = null;\n if (result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.auth = relative.auth || result.auth, result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n};\nUrl.prototype.parseHost = function() {\n var host = this.host, port = portPattern.exec(host);\n if (port) {\n if (port = port[0], port !== \":\")\n this.port = port.substr(1);\n host = host.substr(0, host.length - port.length);\n }\n if (host)\n this.hostname = host;\n};\nvar pathToFileURL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"pathToFileURL\"), fileURLToPath = globalThis[globalThis.Symbol.for('Bun.lazy')](\"fileURLToPath\");\n$ = {\n parse: urlParse,\n resolve: urlResolve,\n resolveObject: urlResolveObject,\n format: urlFormat,\n Url,\n URLSearchParams,\n URL,\n pathToFileURL,\n fileURLToPath,\n urlToHttpOptions\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeTtyCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/tty.ts\nvar ReadStream = function(fd) {\n if (!(this instanceof ReadStream))\n return new ReadStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21)).ReadStream.@call(this, \"\", {\n fd\n });\n return Object.setPrototypeOf(stream, ReadStream.prototype), stream.isRaw = !1, stream.isTTY = !0, stream;\n}, warnOnDeactivatedColors = function(env) {\n if (warned)\n return;\n let name = \"\";\n if (env.NODE_DISABLE_COLORS !== @undefined)\n name = \"NODE_DISABLE_COLORS\";\n if (env.NO_COLOR !== @undefined) {\n if (name !== \"\")\n name += \"' and '\";\n name += \"NO_COLOR\";\n }\n if (name !== \"\")\n process.emitWarning(`The '${name}' env is ignored due to the 'FORCE_COLOR' env being set.`, \"Warning\"), warned = !0;\n}, WriteStream = function(fd) {\n if (!(this instanceof WriteStream))\n return new WriteStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21)).WriteStream.@call(this, \"\", {\n fd\n });\n if (stream.columns = @undefined, stream.rows = @undefined, stream.isTTY = isatty(stream.fd), stream.isTTY) {\n const windowSizeArray = [0, 0];\n if (_getWindowSize(fd, windowSizeArray) === !0)\n stream.columns = windowSizeArray[0], stream.rows = windowSizeArray[1];\n }\n return stream;\n}, { ttySetMode, isatty, getWindowSize: _getWindowSize } = @lazy(\"tty\"), NumberIsInteger = Number.isInteger;\nObject.defineProperty(ReadStream, \"prototype\", {\n get() {\n const Prototype = Object.create((@getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21)).ReadStream.prototype);\n return Prototype.setRawMode = function(flag) {\n const mode = flag \? 1 : 0, err = ttySetMode(this.fd, mode);\n if (err)\n return this.emit(\"error\", new Error(\"setRawMode failed with errno: \" + err)), this;\n return this.isRaw = flag, this;\n }, Object.defineProperty(ReadStream, \"prototype\", { value: Prototype }), Prototype;\n },\n enumerable: !0,\n configurable: !0\n});\nvar OSRelease, COLORS_2 = 1, COLORS_16 = 4, COLORS_256 = 8, COLORS_16m = 24, TERM_ENVS = {\n eterm: COLORS_16,\n cons25: COLORS_16,\n console: COLORS_16,\n cygwin: COLORS_16,\n dtterm: COLORS_16,\n gnome: COLORS_16,\n hurd: COLORS_16,\n jfbterm: COLORS_16,\n konsole: COLORS_16,\n kterm: COLORS_16,\n mlterm: COLORS_16,\n mosh: COLORS_16m,\n putty: COLORS_16,\n st: COLORS_16,\n \"rxvt-unicode-24bit\": COLORS_16m,\n terminator: COLORS_16m\n}, TERM_ENVS_REG_EXP = [/ansi/, /color/, /linux/, /^con[0-9]*x[0-9]/, /^rxvt/, /^screen/, /^xterm/, /^vt100/], warned = !1;\nObject.defineProperty(WriteStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21)).WriteStream.prototype;\n Object.defineProperty(WriteStream, \"prototype\", { value: Real }), WriteStream.prototype._refreshSize = function() {\n const oldCols = this.columns, oldRows = this.rows, windowSizeArray = [0, 0];\n if (_getWindowSize(this.fd, windowSizeArray) === !0) {\n if (oldCols !== windowSizeArray[0] || oldRows !== windowSizeArray[1])\n this.columns = windowSizeArray[0], this.rows = windowSizeArray[1], this.emit(\"resize\");\n }\n };\n var readline = @undefined;\n return WriteStream.prototype.clearLine = function(dir, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).clearLine(this, dir, cb);\n }, WriteStream.prototype.clearScreenDown = function(cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).clearScreenDown(this, cb);\n }, WriteStream.prototype.cursorTo = function(x, y, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).cursorTo(this, x, y, cb);\n }, WriteStream.prototype.getColorDepth = function(env = process.env) {\n if (env.FORCE_COLOR !== @undefined)\n switch (env.FORCE_COLOR) {\n case \"\":\n case \"1\":\n case \"true\":\n return warnOnDeactivatedColors(env), COLORS_16;\n case \"2\":\n return warnOnDeactivatedColors(env), COLORS_256;\n case \"3\":\n return warnOnDeactivatedColors(env), COLORS_16m;\n default:\n return COLORS_2;\n }\n if (env.NODE_DISABLE_COLORS !== @undefined || env.NO_COLOR !== @undefined || env.TERM === \"dumb\")\n return COLORS_2;\n if (OSRelease === @undefined) {\n const { release } = @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28);\n OSRelease = release().split(\".\");\n }\n if (+OSRelease[0] >= 10) {\n const build = +OSRelease[2];\n if (build >= 14931)\n return COLORS_16m;\n if (build >= 10586)\n return COLORS_256;\n }\n return COLORS_16;\n switch (env.TERM_PROGRAM) {\n case \"iTerm.app\":\n if (!env.TERM_PROGRAM_VERSION || /^[0-2]\\./.test(env.TERM_PROGRAM_VERSION))\n return COLORS_256;\n return COLORS_16m;\n case \"HyperTerm\":\n case \"MacTerm\":\n return COLORS_16m;\n case \"Apple_Terminal\":\n return COLORS_256;\n }\n }, WriteStream.prototype.getWindowSize = function() {\n return [this.columns, this.rows];\n }, WriteStream.prototype.hasColors = function(count, env) {\n if (env === @undefined && (count === @undefined || typeof count === \"object\" && count !== null))\n env = count, count = 16;\n else\n validateInteger(count, \"count\", 2);\n return count <= 2 ** this.getColorDepth(env);\n }, WriteStream.prototype.moveCursor = function(dx, dy, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).moveCursor(this, dx, dy, cb);\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar validateInteger = (value, name, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n};\nreturn { ReadStream, WriteStream, isatty }})\n");
//
//
-static constexpr ASCIILiteral NodeUtilCode = "(function (){\"use strict\";// src/js/out/tmp/node/util.ts\nvar isBufferInterface = function({ copy, fill, readUint8 }) {\n return typeof copy === \"function\" && typeof fill === \"function\" && typeof readUint8 === \"function\";\n}, isBuffer = function(value) {\n return Buffer.isBuffer(value) || typeof value === \"object\" && isBufferInterface(value || {});\n}, isFunction = function(value) {\n return typeof value === \"function\";\n}, formatWithOptions = function(inspectOptions, f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0;i < arguments.length; i++)\n objects.push(inspect(arguments[i], inspectOptions));\n return objects.join(\" \");\n }\n var i = 2, args = arguments, len = args.length, str = String(f).replace(formatRegExp, function(x2) {\n if (x2 === \"%%\")\n return \"%\";\n if (i >= len)\n return x2;\n switch (x2) {\n case \"%s\":\n return String(args[i++]);\n case \"%f\":\n return Number(args[i++]);\n case \"%d\":\n return Math.round(Number(args[i++]));\n case \"%j\":\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return \"[Circular]\";\n }\n case \"%o\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n case \"%O\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n default:\n return x2;\n }\n });\n for (var x = args[i];i < len; x = args[++i])\n if (isNull(x) || !isObject(x))\n str += \" \" + x;\n else\n str += \" \" + inspect(x, inspectOptions);\n return str;\n}, format = function(...args) {\n return formatWithOptions({}, ...args);\n}, deprecate = function(fn, msg, code) {\n if (process.noDeprecation === !0)\n return fn;\n var warned = !1;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n var err = new Error(msg);\n if (code)\n err.code = code;\n throw err;\n } else if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n warned = !0;\n }\n return fn.apply(this, arguments);\n }\n return deprecated;\n}, debuglog = function(set) {\n if (set = set.toUpperCase(), !debugs[set])\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = format.apply(cjs_exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else\n debugs[set] = function() {\n };\n return debugs[set];\n}, inspect = function(obj, opts) {\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n if (arguments.length >= 3)\n ctx.depth = arguments[2];\n if (arguments.length >= 4)\n ctx.colors = arguments[3];\n if (isBoolean(opts))\n ctx.showHidden = opts;\n else if (opts)\n _extend(ctx, opts);\n if (isUndefined(ctx.showHidden))\n ctx.showHidden = !1;\n if (isUndefined(ctx.depth))\n ctx.depth = 2;\n if (isUndefined(ctx.colors))\n ctx.colors = !1;\n if (isUndefined(ctx.customInspect))\n ctx.customInspect = !0;\n if (ctx.colors)\n ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}, stylizeWithColor = function(str, styleType) {\n const style = inspect.styles[styleType];\n if (style !== void 0) {\n const color = inspect.colors[style];\n if (color !== void 0)\n return `\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`;\n }\n return str;\n}, stylizeNoColor = function(str, styleType) {\n return str;\n}, arrayToHash = function(array) {\n var hash = {};\n return array.forEach(function(val, idx) {\n hash[val] = !0;\n }), hash;\n}, formatValue = function(ctx, value, recurseTimes) {\n if (ctx.customInspect && value) {\n const customInspect = value[kInspectCustom];\n if (isFunction(customInspect)) {\n var ret = customInspect.call(value, recurseTimes, ctx, inspect);\n if (!isString(ret))\n ret = formatValue(ctx, ret, recurseTimes);\n return ret;\n }\n }\n var primitive = formatPrimitive(ctx, value);\n if (primitive)\n return primitive;\n var keys = Object.keys(value).concat(Object.getOwnPropertySymbols(value)), visibleKeys = arrayToHash(keys);\n if (ctx.showHidden)\n keys = Object.getOwnPropertyNames(value);\n if (isError(value) && (keys.indexOf(\"message\") >= 0 || keys.indexOf(\"description\") >= 0))\n return formatError(value);\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name \? \": \" + value.name : \"\";\n return ctx.stylize(\"[Function\" + name + \"]\", \"special\");\n }\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n if (isDate(value))\n return ctx.stylize(Date.prototype.toString.call(value), \"date\");\n if (isError(value))\n return formatError(value);\n }\n var base = \"\", array = !1, braces = [\"{\", \"}\"];\n if (@isArray(value))\n array = !0, braces = [\"[\", \"]\"];\n if (isFunction(value)) {\n var n = value.name \? \": \" + value.name : \"\";\n base = \" [Function\" + n + \"]\";\n }\n if (isRegExp(value))\n base = \" \" + RegExp.prototype.toString.call(value);\n if (isDate(value))\n base = \" \" + Date.prototype.toUTCString.call(value);\n if (isError(value))\n base = \" \" + formatError(value);\n if (keys.length === 0 && (!array || value.length == 0))\n return braces[0] + base + braces[1];\n if (recurseTimes < 0)\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n else\n return ctx.stylize(\"[Object]\", \"special\");\n ctx.seen.push(value);\n var output;\n if (array)\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n else\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n return ctx.seen.pop(), reduceToSingleString(output, base, braces);\n}, formatPrimitive = function(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize(\"undefined\", \"undefined\");\n if (isString(value)) {\n var simple = \"'\" + JSON.stringify(value).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return ctx.stylize(simple, \"string\");\n }\n if (isNumber(value))\n return ctx.stylize(\"\" + value, \"number\");\n if (isBoolean(value))\n return ctx.stylize(\"\" + value, \"boolean\");\n if (isNull(value))\n return ctx.stylize(\"null\", \"null\");\n}, formatError = function(value) {\n return \"[\" + Error.prototype.toString.call(value) + \"]\";\n}, formatArray = function(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length;i < l; ++i)\n if (hasOwnProperty(value, String(i)))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), !0));\n else\n output.push(\"\");\n return keys.forEach(function(key) {\n if (!key.match(/^\\d+$/))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, !0));\n }), output;\n}, formatProperty = function(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n if (desc = Object.getOwnPropertyDescriptor(value, key) || {\n value: value[key]\n }, desc.get)\n if (desc.set)\n str = ctx.stylize(\"[Getter/Setter]\", \"special\");\n else\n str = ctx.stylize(\"[Getter]\", \"special\");\n else if (desc.set)\n str = ctx.stylize(\"[Setter]\", \"special\");\n if (!hasOwnProperty(visibleKeys, key))\n name = \"[\" + (typeof key === \"symbol\" \? key.description : key) + \"]\";\n if (typeof key === \"symbol\")\n name = \"[\" + ctx.stylize(`Symbol(${key.description})`, \"string\") + \"]\";\n if (!str)\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes))\n str = formatValue(ctx, desc.value, null);\n else\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n if (str.indexOf(\"\\n\") > -1)\n if (array)\n str = str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\").substr(2);\n else\n str = \"\\n\" + str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\");\n } else\n str = ctx.stylize(\"[Circular]\", \"special\");\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/))\n return str;\n if (name = JSON.stringify(\"\" + key), name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/))\n name = name.substr(1, name.length - 2), name = ctx.stylize(name, \"name\");\n else\n name = name.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\"), name = ctx.stylize(name, \"string\");\n }\n return name + \": \" + str;\n}, reduceToSingleString = function(output, base, braces) {\n var numLinesEst = 0, length = output.reduce(function(prev, cur) {\n if (numLinesEst++, cur.indexOf(\"\\n\") >= 0)\n numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d\?m/g, \"\").length + 1;\n }, 0);\n if (length > 60)\n return braces[0] + (base === \"\" \? \"\" : base + \"\\n \") + \" \" + output.join(\",\\n \") + \" \" + braces[1];\n return braces[0] + base + \" \" + output.join(\", \") + \" \" + braces[1];\n}, isBoolean = function(arg) {\n return typeof arg === \"boolean\";\n}, isNull = function(arg) {\n return arg === null;\n}, isNullOrUndefined = function(arg) {\n return arg == null;\n}, isNumber = function(arg) {\n return typeof arg === \"number\";\n}, isString = function(arg) {\n return typeof arg === \"string\";\n}, isSymbol = function(arg) {\n return typeof arg === \"symbol\";\n}, isUndefined = function(arg) {\n return arg === void 0;\n}, isObject = function(arg) {\n return typeof arg === \"object\" && arg !== null;\n}, isPrimitive = function(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || typeof arg === \"undefined\";\n}, pad = function(n) {\n return n < 10 \? \"0\" + n.toString(10) : n.toString(10);\n}, timestamp = function() {\n var d = new Date, time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(\":\");\n return [d.getDate(), months[d.getMonth()], time].join(\" \");\n}, hasOwnProperty = function(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}, callbackifyOnRejected = function(reason, cb) {\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason, newReason.code = \"ERR_FALSY_VALUE_REJECTION\", reason = newReason;\n }\n return cb(reason);\n}, callbackify = function(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n function callbackified() {\n var args = Array.prototype.slice.call(arguments), maybeCb = args.pop();\n if (typeof maybeCb !== \"function\")\n @throwTypeError(\"The last argument must be of type Function\");\n var self = this, cb = function() {\n return maybeCb.apply(self, arguments);\n };\n original.apply(this, args).then(function(ret) {\n process.nextTick(cb, null, ret);\n }, function(rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }\n return Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)), Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)), callbackified;\n}, $, types = @requireNativeModule(\"util/types\"), cjs_exports = {}, deepEquals = Bun.deepEquals, isDeepStrictEqual = (a, b) => deepEquals(a, b, !0), getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors, formatRegExp = /%[sdjfoc%]/g, debugs = {}, debugEnvRegex = /^$/;\nif (process.env.NODE_DEBUG)\n debugEnv = process.env.NODE_DEBUG, debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+\?.]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/,/g, \"$|^\").toUpperCase(), debugEnvRegex = new RegExp(\"^\" + debugEnv + \"$\", \"i\");\nvar debugEnv, kInspectCustom = Symbol.for(\"nodejs.util.inspect.custom\");\ninspect.colors = {\n bold: [1, 22],\n italic: [3, 23],\n underline: [4, 24],\n inverse: [7, 27],\n white: [37, 39],\n grey: [90, 39],\n black: [30, 39],\n blue: [34, 39],\n cyan: [36, 39],\n green: [32, 39],\n magenta: [35, 39],\n red: [31, 39],\n yellow: [33, 39]\n};\ninspect.styles = {\n special: \"cyan\",\n number: \"yellow\",\n boolean: \"yellow\",\n undefined: \"grey\",\n null: \"bold\",\n string: \"green\",\n date: \"magenta\",\n regexp: \"red\"\n};\ninspect.custom = kInspectCustom;\ninspect.defaultOptions = {\n showHidden: !1,\n depth: 2,\n colors: !1,\n customInspect: !0,\n showProxy: !1,\n maxArrayLength: 100,\n maxStringLength: 1e4,\n breakLength: 80,\n compact: 3,\n sorted: !1,\n getters: !1,\n numericSeparator: !1\n};\nvar { isRegExp, isDate, isNativeError: isError } = types, months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], log = function log2() {\n console.log(\"%s - %s\", timestamp(), format.apply(cjs_exports, arguments));\n}, inherits = function inherits2(ctor, superCtor) {\n ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n });\n}, _extend = function(origin, add) {\n if (!add || !isObject(add))\n return origin;\n var keys = Object.keys(add), i = keys.length;\n while (i--)\n origin[keys[i]] = add[keys[i]];\n return origin;\n}, kCustomPromisifiedSymbol = Symbol.for(\"util.promisify.custom\"), promisify = function promisify2(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\")\n @throwTypeError('The \"util.promisify.custom\" argument must be of type Function');\n return Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n }), fn;\n }\n function fn() {\n var promiseResolve, promiseReject, promise = new Promise(function(resolve, reject) {\n promiseResolve = resolve, promiseReject = reject;\n }), args = [];\n for (var i = 0;i < arguments.length; i++)\n args.push(arguments[i]);\n args.push(function(err, value) {\n if (err)\n promiseReject(err);\n else\n promiseResolve(value);\n });\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n if (Object.setPrototypeOf(fn, Object.getPrototypeOf(original)), kCustomPromisifiedSymbol)\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n return Object.defineProperties(fn, getOwnPropertyDescriptors(original));\n};\npromisify.custom = kCustomPromisifiedSymbol;\nvar toUSVString = (input) => {\n return (input + \"\").toWellFormed();\n};\n$ = Object.assign(cjs_exports, {\n format,\n formatWithOptions,\n deprecate,\n debuglog,\n _extend,\n inspect,\n types,\n isArray: @isArray,\n isBoolean,\n isNull,\n isNullOrUndefined,\n isNumber,\n isString,\n isSymbol,\n isUndefined,\n isRegExp,\n isObject,\n isDate,\n isFunction,\n isError,\n isPrimitive,\n isBuffer,\n log,\n inherits,\n toUSVString,\n promisify,\n callbackify,\n isDeepStrictEqual,\n TextDecoder,\n TextEncoder\n});\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeUrlCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/url.ts\nvar Url = function() {\n this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;\n}, urlParse = function(url, parseQueryString, slashesDenoteHost) {\n if (url && typeof url === \"object\" && url instanceof Url)\n return url;\n var u = new Url;\n return u.parse(url, parseQueryString, slashesDenoteHost), u;\n}, urlFormat = function(obj) {\n if (typeof obj === \"string\")\n obj = urlParse(obj);\n if (!(obj instanceof Url))\n return Url.prototype.format.@call(obj);\n return obj.format();\n}, urlResolve = function(source, relative) {\n return urlParse(source, !1, !0).resolve(relative);\n}, urlResolveObject = function(source, relative) {\n if (!source)\n return relative;\n return urlParse(source, !1, !0).resolveObject(relative);\n}, urlToHttpOptions = function(url) {\n const options = {\n protocol: url.protocol,\n hostname: typeof url.hostname === \"string\" && url.hostname.startsWith(\"[\") \? url.hostname.slice(1, -1) : url.hostname,\n hash: url.hash,\n search: url.search,\n pathname: url.pathname,\n path: `${url.pathname || \"\"}${url.search || \"\"}`,\n href: url.href\n };\n if (url.port !== \"\")\n options.port = Number(url.port);\n if (url.username || url.password)\n options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;\n return options;\n}, $, { URL, URLSearchParams } = globalThis;\nUrl.prototype = {};\nvar protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, simplePathPattern = /^(\\/\\/\?(\?!\\/)[^\?\\s]*)(\\\?[^\\s]*)\?$/, delims = [\"<\", \">\", '\"', \"`\", \" \", \"\\r\", \"\\n\", \"\\t\"], unwise = [\"{\", \"}\", \"|\", \"\\\\\", \"^\", \"`\"].concat(delims), autoEscape = [\"'\"].concat(unwise), nonHostChars = [\"%\", \"/\", \"\?\", \";\", \"#\"].concat(autoEscape), hostEndingChars = [\"/\", \"\?\", \"#\"], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, unsafeProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, hostlessProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, slashedProtocol = {\n http: !0,\n https: !0,\n ftp: !0,\n gopher: !0,\n file: !0,\n \"http:\": !0,\n \"https:\": !0,\n \"ftp:\": !0,\n \"gopher:\": !0,\n \"file:\": !0\n};\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (typeof url !== \"string\")\n @throwTypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n var queryIndex = url.indexOf(\"\?\"), splitter = queryIndex !== -1 && queryIndex < url.indexOf(\"#\") \? \"\?\" : \"#\", uSplit = url.split(splitter), slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, \"/\"), url = uSplit.join(splitter);\n var rest = url;\n if (rest = rest.trim(), !slashesDenoteHost && url.split(\"#\").length === 1) {\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n if (this.path = rest, this.href = rest, this.pathname = simplePath[1], simplePath[2])\n if (this.search = simplePath[2], parseQueryString)\n this.query = new URLSearchParams(this.search.substr(1)).toJSON();\n else\n this.query = this.search.substr(1);\n else if (parseQueryString)\n this.search = \"\", this.query = {};\n return this;\n }\n }\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto, rest = rest.substr(proto.length);\n }\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@/]+@[^@/]+/)) {\n var slashes = rest.substr(0, 2) === \"//\";\n if (slashes && !(proto && hostlessProtocol[proto]))\n rest = rest.substr(2), this.slashes = !0;\n }\n if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {\n var hostEnd = -1;\n for (var i = 0;i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n var auth, atSign;\n if (hostEnd === -1)\n atSign = rest.lastIndexOf(\"@\");\n else\n atSign = rest.lastIndexOf(\"@\", hostEnd);\n if (atSign !== -1)\n auth = rest.slice(0, atSign), rest = rest.slice(atSign + 1), this.auth = decodeURIComponent(auth);\n hostEnd = -1;\n for (var i = 0;i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n if (hostEnd === -1)\n hostEnd = rest.length;\n this.host = rest.slice(0, hostEnd), rest = rest.slice(hostEnd), this.parseHost(), this.hostname = this.hostname || \"\";\n var ipv6Hostname = this.hostname[0] === \"[\" && this.hostname[this.hostname.length - 1] === \"]\";\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length;i < l; i++) {\n var part = hostparts[i];\n if (!part)\n continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = \"\";\n for (var j = 0, k = part.length;j < k; j++)\n if (part.charCodeAt(j) > 127)\n newpart += \"x\";\n else\n newpart += part[j];\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i), notHost = hostparts.slice(i + 1), bit = part.match(hostnamePartStart);\n if (bit)\n validParts.push(bit[1]), notHost.unshift(bit[2]);\n if (notHost.length)\n rest = \"/\" + notHost.join(\".\") + rest;\n this.hostname = validParts.join(\".\");\n break;\n }\n }\n }\n }\n if (this.hostname.length > hostnameMaxLen)\n this.hostname = \"\";\n else\n this.hostname = this.hostname.toLowerCase();\n if (!ipv6Hostname)\n this.hostname = new URL(\"http://\" + this.hostname).hostname;\n var p = this.port \? \":\" + this.port : \"\", h = this.hostname || \"\";\n if (this.host = h + p, this.href += this.host, ipv6Hostname) {\n if (this.hostname = this.hostname.substr(1, this.hostname.length - 2), rest[0] !== \"/\")\n rest = \"/\" + rest;\n }\n }\n if (!unsafeProtocol[lowerProto])\n for (var i = 0, l = autoEscape.length;i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae)\n esc = escape(ae);\n rest = rest.split(ae).join(esc);\n }\n var hash = rest.indexOf(\"#\");\n if (hash !== -1)\n this.hash = rest.substr(hash), rest = rest.slice(0, hash);\n var qm = rest.indexOf(\"\?\");\n if (qm !== -1) {\n if (this.search = rest.substr(qm), this.query = rest.substr(qm + 1), parseQueryString) {\n const query = this.query;\n this.query = new URLSearchParams(query).toJSON();\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString)\n this.search = \"\", this.query = {};\n if (rest)\n this.pathname = rest;\n if (slashedProtocol[lowerProto] && this.hostname && !this.pathname)\n this.pathname = \"/\";\n if (this.pathname || this.search) {\n var p = this.pathname || \"\", s = this.search || \"\";\n this.path = p + s;\n }\n return this.href = this.format(), this;\n};\nUrl.prototype.format = function() {\n var auth = this.auth || \"\";\n if (auth)\n auth = encodeURIComponent(auth), auth = auth.replace(/%3A/i, \":\"), auth += \"@\";\n var protocol = this.protocol || \"\", pathname = this.pathname || \"\", hash = this.hash || \"\", host = !1, query = \"\";\n if (this.host)\n host = auth + this.host;\n else if (this.hostname) {\n if (host = auth + (this.hostname.indexOf(\":\") === -1 \? this.hostname : \"[\" + this.hostname + \"]\"), this.port)\n host += \":\" + this.port;\n }\n if (this.query && typeof this.query === \"object\" && Object.keys(this.query).length)\n query = new URLSearchParams(this.query).toString();\n var search = this.search || query && \"\?\" + query || \"\";\n if (protocol && protocol.substr(-1) !== \":\")\n protocol += \":\";\n if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== !1) {\n if (host = \"//\" + (host || \"\"), pathname && pathname.charAt(0) !== \"/\")\n pathname = \"/\" + pathname;\n } else if (!host)\n host = \"\";\n if (hash && hash.charAt(0) !== \"#\")\n hash = \"#\" + hash;\n if (search && search.charAt(0) !== \"\?\")\n search = \"\?\" + search;\n return pathname = pathname.replace(/[\?#]/g, function(match) {\n return encodeURIComponent(match);\n }), search = search.replace(\"#\", \"%23\"), protocol + host + pathname + search + hash;\n};\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, !1, !0)).format();\n};\nUrl.prototype.resolveObject = function(relative) {\n if (typeof relative === \"string\") {\n var rel = new Url;\n rel.parse(relative, !1, !0), relative = rel;\n }\n var result = new Url, tkeys = Object.keys(this);\n for (var tk = 0;tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n if (result.hash = relative.hash, relative.href === \"\")\n return result.href = result.format(), result;\n if (relative.slashes && !relative.protocol) {\n var rkeys = Object.keys(relative);\n for (var rk = 0;rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== \"protocol\")\n result[rkey] = relative[rkey];\n }\n if (slashedProtocol[result.protocol] && result.hostname && !result.pathname)\n result.pathname = \"/\", result.path = result.pathname;\n return result.href = result.format(), result;\n }\n if (relative.protocol && relative.protocol !== result.protocol) {\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0;v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n return result.href = result.format(), result;\n }\n if (result.protocol = relative.protocol, !relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || \"\").split(\"/\");\n while (relPath.length && !(relative.host = relPath.shift()))\n ;\n if (!relative.host)\n relative.host = \"\";\n if (!relative.hostname)\n relative.hostname = \"\";\n if (relPath[0] !== \"\")\n relPath.unshift(\"\");\n if (relPath.length < 2)\n relPath.unshift(\"\");\n result.pathname = relPath.join(\"/\");\n } else\n result.pathname = relative.pathname;\n if (result.search = relative.search, result.query = relative.query, result.host = relative.host || \"\", result.auth = relative.auth, result.hostname = relative.hostname || relative.host, result.port = relative.port, result.pathname || result.search) {\n var p = result.pathname || \"\", s = result.search || \"\";\n result.path = p + s;\n }\n return result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n }\n var isSourceAbs = result.pathname && result.pathname.charAt(0) === \"/\", isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === \"/\", mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split(\"/\") || [], relPath = relative.pathname && relative.pathname.split(\"/\") || [], psychotic = result.protocol && !slashedProtocol[result.protocol];\n if (psychotic) {\n if (result.hostname = \"\", result.port = null, result.host)\n if (srcPath[0] === \"\")\n srcPath[0] = result.host;\n else\n srcPath.unshift(result.host);\n if (result.host = \"\", relative.protocol) {\n if (relative.hostname = null, relative.port = null, relative.host)\n if (relPath[0] === \"\")\n relPath[0] = relative.host;\n else\n relPath.unshift(relative.host);\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === \"\" || srcPath[0] === \"\");\n }\n if (isRelAbs)\n result.host = relative.host || relative.host === \"\" \? relative.host : result.host, result.hostname = relative.hostname || relative.hostname === \"\" \? relative.hostname : result.hostname, result.search = relative.search, result.query = relative.query, srcPath = relPath;\n else if (relPath.length) {\n if (!srcPath)\n srcPath = [];\n srcPath.pop(), srcPath = srcPath.concat(relPath), result.search = relative.search, result.query = relative.query;\n } else if (relative.search != null) {\n if (psychotic) {\n result.host = srcPath.shift(), result.hostname = result.host;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (result.search = relative.search, result.query = relative.query, result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.href = result.format(), result;\n }\n if (!srcPath.length) {\n if (result.pathname = null, result.search)\n result.path = \"/\" + result.search;\n else\n result.path = null;\n return result.href = result.format(), result;\n }\n var last = srcPath.slice(-1)[0], hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === \".\" || last === \"..\") || last === \"\", up = 0;\n for (var i = srcPath.length;i >= 0; i--)\n if (last = srcPath[i], last === \".\")\n srcPath.splice(i, 1);\n else if (last === \"..\")\n srcPath.splice(i, 1), up++;\n else if (up)\n srcPath.splice(i, 1), up--;\n if (!mustEndAbs && !removeAllDots)\n for (;up--; up)\n srcPath.unshift(\"..\");\n if (mustEndAbs && srcPath[0] !== \"\" && (!srcPath[0] || srcPath[0].charAt(0) !== \"/\"))\n srcPath.unshift(\"\");\n if (hasTrailingSlash && srcPath.join(\"/\").substr(-1) !== \"/\")\n srcPath.push(\"\");\n var isAbsolute = srcPath[0] === \"\" || srcPath[0] && srcPath[0].charAt(0) === \"/\";\n if (psychotic) {\n result.hostname = isAbsolute \? \"\" : srcPath.length \? srcPath.shift() : \"\", result.host = result.hostname;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (mustEndAbs = mustEndAbs || result.host && srcPath.length, mustEndAbs && !isAbsolute)\n srcPath.unshift(\"\");\n if (srcPath.length > 0)\n result.pathname = srcPath.join(\"/\");\n else\n result.pathname = null, result.path = null;\n if (result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.auth = relative.auth || result.auth, result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n};\nUrl.prototype.parseHost = function() {\n var host = this.host, port = portPattern.exec(host);\n if (port) {\n if (port = port[0], port !== \":\")\n this.port = port.substr(1);\n host = host.substr(0, host.length - port.length);\n }\n if (host)\n this.hostname = host;\n};\nvar pathToFileURL = @lazy(\"pathToFileURL\"), fileURLToPath = @lazy(\"fileURLToPath\");\n$ = {\n parse: urlParse,\n resolve: urlResolve,\n resolveObject: urlResolveObject,\n format: urlFormat,\n Url,\n URLSearchParams,\n URL,\n pathToFileURL,\n fileURLToPath,\n urlToHttpOptions\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeV8Code = "(function (){\"use strict\";// src/js/out/tmp/node/v8.ts\nvar notimpl = function(message) {\n throwNotImplemented(\"node:v8 \" + message);\n}, cachedDataVersionTag = function() {\n notimpl(\"cachedDataVersionTag\");\n}, getHeapSnapshot = function() {\n notimpl(\"getHeapSnapshot\");\n}, getHeapStatistics = function() {\n const stats = jsc.heapStats();\n return {\n total_heap_size: stats.heapCapacity,\n total_heap_size_executable: 0,\n total_physical_size: stats.heapSize,\n total_available_size: Infinity,\n used_heap_size: stats.heapSize,\n heap_size_limit: Infinity,\n malloced_memory: stats.heapSize,\n peak_malloced_memory: Infinity,\n does_zap_garbage: 0,\n number_of_native_contexts: Infinity,\n number_of_detached_contexts: Infinity,\n total_global_handles_size: Infinity,\n used_global_handles_size: Infinity,\n external_memory: Infinity\n };\n}, getHeapSpaceStatistics = function() {\n notimpl(\"getHeapSpaceStatistics\");\n}, getHeapCodeStatistics = function() {\n notimpl(\"getHeapCodeStatistics\");\n}, setFlagsFromString = function() {\n notimpl(\"setFlagsFromString\");\n}, deserialize = function(value) {\n return jsc.deserialize(value);\n}, takeCoverage = function() {\n notimpl(\"takeCoverage\");\n}, stopCoverage = function() {\n notimpl(\"stopCoverage\");\n}, serialize = function(arg1) {\n return jsc.serialize(arg1, { binaryType: \"nodebuffer\" });\n}, writeHeapSnapshot = function() {\n notimpl(\"writeHeapSnapshot\");\n}, setHeapSnapshotNearHeapLimit = function() {\n notimpl(\"setHeapSnapshotNearHeapLimit\");\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), jsc = @requireNativeModule(\"bun:jsc\");\n\nclass Deserializer {\n constructor() {\n notimpl(\"Deserializer\");\n }\n}\n\nclass Serializer {\n constructor() {\n notimpl(\"Serializer\");\n }\n}\n\nclass DefaultDeserializer extends Deserializer {\n constructor() {\n super(...arguments);\n }\n}\n\nclass DefaultSerializer extends Serializer {\n constructor() {\n super(...arguments);\n }\n}\n\nclass GCProfiler {\n constructor() {\n notimpl(\"GCProfiler\");\n }\n}\nvar promiseHooks = {\n createHook: () => {\n notimpl(\"createHook\");\n },\n onInit: () => {\n notimpl(\"onInit\");\n },\n onBefore: () => {\n notimpl(\"onBefore\");\n },\n onAfter: () => {\n notimpl(\"onAfter\");\n },\n onSettled: () => {\n notimpl(\"onSettled\");\n }\n}, startupSnapshot = {\n addDeserializeCallback: () => notimpl(\"addDeserializeCallback\"),\n addSerializeCallback: () => notimpl(\"addSerializeCallback\"),\n setDeserializeMainFunction: () => notimpl(\"setDeserializeMainFunction\"),\n isBuildingSnapshot: () => notimpl(\"isBuildingSnapshot\")\n};\n$ = {\n cachedDataVersionTag,\n getHeapSnapshot,\n getHeapStatistics,\n getHeapSpaceStatistics,\n getHeapCodeStatistics,\n setFlagsFromString,\n deserialize,\n takeCoverage,\n stopCoverage,\n serialize,\n writeHeapSnapshot,\n setHeapSnapshotNearHeapLimit,\n promiseHooks,\n startupSnapshot,\n Deserializer,\n Serializer\n};\nhideFromStack(notimpl, cachedDataVersionTag, getHeapSnapshot, getHeapStatistics, getHeapSpaceStatistics, getHeapCodeStatistics, setFlagsFromString, deserialize, takeCoverage, stopCoverage, serialize, writeHeapSnapshot, setHeapSnapshotNearHeapLimit, Deserializer, Serializer, DefaultDeserializer, DefaultSerializer, GCProfiler);\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeUtilCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/util.ts\nvar isBuffer = function(value) {\n return @Buffer.isBuffer(value);\n}, isFunction = function(value) {\n return typeof value === \"function\";\n}, deprecate = function(fn, msg, code) {\n if (process.noDeprecation === !0)\n return fn;\n var warned = !1;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n var err = new Error(msg);\n if (code)\n err.code = code;\n throw err;\n } else if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n warned = !0;\n }\n return fn.@apply(this, arguments);\n }\n return deprecated;\n}, debuglog = function(set) {\n if (set = set.toUpperCase(), !debugs[set])\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = format.@apply(cjs_exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else\n debugs[set] = function() {\n };\n return debugs[set];\n}, isBoolean = function(arg) {\n return typeof arg === \"boolean\";\n}, isNull = function(arg) {\n return arg === null;\n}, isNullOrUndefined = function(arg) {\n return arg == null;\n}, isNumber = function(arg) {\n return typeof arg === \"number\";\n}, isString = function(arg) {\n return typeof arg === \"string\";\n}, isSymbol = function(arg) {\n return typeof arg === \"symbol\";\n}, isUndefined = function(arg) {\n return arg === void 0;\n}, isObject = function(arg) {\n return typeof arg === \"object\" && arg !== null;\n}, isPrimitive = function(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || typeof arg === \"undefined\";\n}, pad = function(n) {\n return n < 10 \? \"0\" + n.toString(10) : n.toString(10);\n}, timestamp = function() {\n var d = new Date, time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(\":\");\n return [d.getDate(), months[d.getMonth()], time].join(\" \");\n}, callbackifyOnRejected = function(reason, cb) {\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason, newReason.code = \"ERR_FALSY_VALUE_REJECTION\", reason = newReason;\n }\n return cb(reason);\n}, callbackify = function(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n function callbackified() {\n var args = @Array.prototype.slice.@call(arguments), maybeCb = args.pop();\n if (typeof maybeCb !== \"function\")\n @throwTypeError(\"The last argument must be of type Function\");\n var self = this, cb = function() {\n return maybeCb.@apply(self, arguments);\n };\n original.@apply(this, args).then(function(ret) {\n process.nextTick(cb, null, ret);\n }, function(rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }\n return Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)), Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)), callbackified;\n}, $, types = @requireNativeModule(\"util/types\"), utl = @getInternalField(@internalModuleRegistry, 7) || @createInternalModuleById(7), cjs_exports = {}, deepEquals = Bun.deepEquals, isDeepStrictEqual = (a, b) => deepEquals(a, b, !0), getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors, inspect = utl.inspect, formatWithOptions = utl.formatWithOptions, format = utl.format, stripVTControlCharacters = utl.stripVTControlCharacters, debugs = {}, debugEnvRegex = /^$/;\nif (process.env.NODE_DEBUG)\n debugEnv = process.env.NODE_DEBUG, debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+\?.]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/,/g, \"$|^\").toUpperCase(), debugEnvRegex = new @RegExp(\"^\" + debugEnv + \"$\", \"i\");\nvar debugEnv, isRegExp = types.isRegExp, isDate = types.isDate, isError = types.isNativeError, months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], log = function log2() {\n console.log(\"%s - %s\", timestamp(), format.@apply(cjs_exports, arguments));\n}, inherits = function inherits2(ctor, superCtor) {\n ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n });\n}, _extend = function(origin, add) {\n if (!add || !isObject(add))\n return origin;\n var keys = Object.keys(add), i = keys.length;\n while (i--)\n origin[keys[i]] = add[keys[i]];\n return origin;\n}, kCustomPromisifiedSymbol = Symbol.for(\"util.promisify.custom\"), promisify = function promisify2(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\")\n @throwTypeError('The \"util.promisify.custom\" argument must be of type Function');\n return Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n }), fn;\n }\n function fn() {\n var promiseResolve, promiseReject, promise = new @Promise(function(resolve, reject) {\n promiseResolve = resolve, promiseReject = reject;\n }), args = [];\n for (var i = 0;i < arguments.length; i++)\n args.push(arguments[i]);\n args.push(function(err, value) {\n if (err)\n promiseReject(err);\n else\n promiseResolve(value);\n });\n try {\n original.@apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n if (Object.setPrototypeOf(fn, Object.getPrototypeOf(original)), kCustomPromisifiedSymbol)\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n return Object.defineProperties(fn, getOwnPropertyDescriptors(original));\n};\npromisify.custom = kCustomPromisifiedSymbol;\nvar toUSVString = (input) => {\n return (input + \"\").toWellFormed();\n};\n$ = Object.assign(cjs_exports, {\n format,\n formatWithOptions,\n stripVTControlCharacters,\n deprecate,\n debuglog,\n _extend,\n inspect,\n types,\n isArray: @isArray,\n isBoolean,\n isNull,\n isNullOrUndefined,\n isNumber,\n isString,\n isSymbol,\n isUndefined,\n isRegExp,\n isObject,\n isDate,\n isFunction,\n isError,\n isPrimitive,\n isBuffer,\n log,\n inherits,\n toUSVString,\n promisify,\n callbackify,\n isDeepStrictEqual,\n TextDecoder,\n TextEncoder\n});\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeVMCode = "(function (){\"use strict\";// src/js/out/tmp/node/vm.ts\nvar runInContext = function(code, context, options) {\n return new Script(code, options).runInContext(context);\n}, compileFunction = function() {\n throwNotImplemented(\"node:vm compileFunction\");\n}, measureMemory = function() {\n throwNotImplemented(\"node:vm measureMemory\");\n}, $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), vm = globalThis[globalThis.Symbol.for('Bun.lazy')](\"vm\"), { createContext, isContext, Script, runInNewContext, runInThisContext } = vm;\n\nclass Module {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n\nclass SourceTextModule {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n\nclass SyntheticModule {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n$ = {\n createContext,\n runInContext,\n runInNewContext,\n runInThisContext,\n isContext,\n compileFunction,\n measureMemory,\n Script,\n Module,\n SourceTextModule,\n SyntheticModule\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeV8Code = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/v8.ts\nvar notimpl = function(message) {\n throwNotImplemented(\"node:v8 \" + message);\n}, cachedDataVersionTag = function() {\n notimpl(\"cachedDataVersionTag\");\n}, getHeapSnapshot = function() {\n notimpl(\"getHeapSnapshot\");\n}, getHeapStatistics = function() {\n const stats = jsc.heapStats();\n return {\n total_heap_size: stats.heapCapacity,\n total_heap_size_executable: 0,\n total_physical_size: stats.heapSize,\n total_available_size: @Infinity,\n used_heap_size: stats.heapSize,\n heap_size_limit: @Infinity,\n malloced_memory: stats.heapSize,\n peak_malloced_memory: @Infinity,\n does_zap_garbage: 0,\n number_of_native_contexts: @Infinity,\n number_of_detached_contexts: @Infinity,\n total_global_handles_size: @Infinity,\n used_global_handles_size: @Infinity,\n external_memory: @Infinity\n };\n}, getHeapSpaceStatistics = function() {\n notimpl(\"getHeapSpaceStatistics\");\n}, getHeapCodeStatistics = function() {\n notimpl(\"getHeapCodeStatistics\");\n}, setFlagsFromString = function() {\n notimpl(\"setFlagsFromString\");\n}, deserialize = function(value) {\n return jsc.deserialize(value);\n}, takeCoverage = function() {\n notimpl(\"takeCoverage\");\n}, stopCoverage = function() {\n notimpl(\"stopCoverage\");\n}, serialize = function(arg1) {\n return jsc.serialize(arg1, { binaryType: \"nodebuffer\" });\n}, writeHeapSnapshot = function() {\n notimpl(\"writeHeapSnapshot\");\n}, setHeapSnapshotNearHeapLimit = function() {\n notimpl(\"setHeapSnapshotNearHeapLimit\");\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), jsc = @requireNativeModule(\"bun:jsc\");\n\nclass Deserializer {\n constructor() {\n notimpl(\"Deserializer\");\n }\n}\n\nclass Serializer {\n constructor() {\n notimpl(\"Serializer\");\n }\n}\n\nclass DefaultDeserializer extends Deserializer {\n constructor() {\n super(...arguments);\n }\n}\n\nclass DefaultSerializer extends Serializer {\n constructor() {\n super(...arguments);\n }\n}\n\nclass GCProfiler {\n constructor() {\n notimpl(\"GCProfiler\");\n }\n}\nvar promiseHooks = {\n createHook: () => {\n notimpl(\"createHook\");\n },\n onInit: () => {\n notimpl(\"onInit\");\n },\n onBefore: () => {\n notimpl(\"onBefore\");\n },\n onAfter: () => {\n notimpl(\"onAfter\");\n },\n onSettled: () => {\n notimpl(\"onSettled\");\n }\n}, startupSnapshot = {\n addDeserializeCallback: () => notimpl(\"addDeserializeCallback\"),\n addSerializeCallback: () => notimpl(\"addSerializeCallback\"),\n setDeserializeMainFunction: () => notimpl(\"setDeserializeMainFunction\"),\n isBuildingSnapshot: () => notimpl(\"isBuildingSnapshot\")\n};\n$ = {\n cachedDataVersionTag,\n getHeapSnapshot,\n getHeapStatistics,\n getHeapSpaceStatistics,\n getHeapCodeStatistics,\n setFlagsFromString,\n deserialize,\n takeCoverage,\n stopCoverage,\n serialize,\n writeHeapSnapshot,\n setHeapSnapshotNearHeapLimit,\n promiseHooks,\n startupSnapshot,\n Deserializer,\n Serializer\n};\nhideFromStack(notimpl, cachedDataVersionTag, getHeapSnapshot, getHeapStatistics, getHeapSpaceStatistics, getHeapCodeStatistics, setFlagsFromString, deserialize, takeCoverage, stopCoverage, serialize, writeHeapSnapshot, setHeapSnapshotNearHeapLimit, Deserializer, Serializer, DefaultDeserializer, DefaultSerializer, GCProfiler);\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeWasiCode = "(function (){\"use strict\";// src/js/out/tmp/node/wasi.ts\nvar nodeFsConstants = @processBindingConstants.fs, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_types = __commonJS({\n \"node_modules/wasi-js/dist/types.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASIKillError = exports.WASIExitError = exports.WASIError = void 0;\n var WASIError = class extends Error {\n constructor(errno) {\n super();\n this.errno = errno, Object.setPrototypeOf(this, WASIError.prototype);\n }\n };\n exports.WASIError = WASIError;\n var WASIExitError = class extends Error {\n constructor(code) {\n super(`WASI Exit error: ${code}`);\n this.code = code, Object.setPrototypeOf(this, WASIExitError.prototype);\n }\n };\n exports.WASIExitError = WASIExitError;\n var WASIKillError = class extends Error {\n constructor(signal) {\n super(`WASI Kill signal: ${signal}`);\n this.signal = signal, Object.setPrototypeOf(this, WASIKillError.prototype);\n }\n };\n exports.WASIKillError = WASIKillError;\n }\n}), require_constants = __commonJS({\n \"node_modules/wasi-js/dist/constants.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASI_ENOMSG = exports.WASI_ENOMEM = exports.WASI_ENOLINK = exports.WASI_ENOLCK = exports.WASI_ENOEXEC = exports.WASI_ENOENT = exports.WASI_ENODEV = exports.WASI_ENOBUFS = exports.WASI_ENFILE = exports.WASI_ENETUNREACH = exports.WASI_ENETRESET = exports.WASI_ENETDOWN = exports.WASI_ENAMETOOLONG = exports.WASI_EMULTIHOP = exports.WASI_EMSGSIZE = exports.WASI_EMLINK = exports.WASI_EMFILE = exports.WASI_ELOOP = exports.WASI_EISDIR = exports.WASI_EISCONN = exports.WASI_EIO = exports.WASI_EINVAL = exports.WASI_EINTR = exports.WASI_EINPROGRESS = exports.WASI_EILSEQ = exports.WASI_EIDRM = exports.WASI_EHOSTUNREACH = exports.WASI_EFBIG = exports.WASI_EFAULT = exports.WASI_EEXIST = exports.WASI_EDQUOT = exports.WASI_EDOM = exports.WASI_EDESTADDRREQ = exports.WASI_EDEADLK = exports.WASI_ECONNRESET = exports.WASI_ECONNREFUSED = exports.WASI_ECONNABORTED = exports.WASI_ECHILD = exports.WASI_ECANCELED = exports.WASI_EBUSY = exports.WASI_EBADMSG = exports.WASI_EBADF = exports.WASI_EALREADY = exports.WASI_EAGAIN = exports.WASI_EAFNOSUPPORT = exports.WASI_EADDRNOTAVAIL = exports.WASI_EADDRINUSE = exports.WASI_EACCES = exports.WASI_E2BIG = exports.WASI_ESUCCESS = void 0, exports.WASI_SIGVTALRM = exports.WASI_SIGUSR2 = exports.WASI_SIGUSR1 = exports.WASI_SIGURG = exports.WASI_SIGTTOU = exports.WASI_SIGTTIN = exports.WASI_SIGTSTP = exports.WASI_SIGTRAP = exports.WASI_SIGTERM = exports.WASI_SIGSTOP = exports.WASI_SIGSEGV = exports.WASI_SIGQUIT = exports.WASI_SIGPIPE = exports.WASI_SIGKILL = exports.WASI_SIGINT = exports.WASI_SIGILL = exports.WASI_SIGHUP = exports.WASI_SIGFPE = exports.WASI_SIGCONT = exports.WASI_SIGCHLD = exports.WASI_SIGBUS = exports.WASI_SIGALRM = exports.WASI_SIGABRT = exports.WASI_ENOTCAPABLE = exports.WASI_EXDEV = exports.WASI_ETXTBSY = exports.WASI_ETIMEDOUT = exports.WASI_ESTALE = exports.WASI_ESRCH = exports.WASI_ESPIPE = exports.WASI_EROFS = exports.WASI_ERANGE = exports.WASI_EPROTOTYPE = exports.WASI_EPROTONOSUPPORT = exports.WASI_EPROTO = exports.WASI_EPIPE = exports.WASI_EPERM = exports.WASI_EOWNERDEAD = exports.WASI_EOVERFLOW = exports.WASI_ENXIO = exports.WASI_ENOTTY = exports.WASI_ENOTSUP = exports.WASI_ENOTSOCK = exports.WASI_ENOTRECOVERABLE = exports.WASI_ENOTEMPTY = exports.WASI_ENOTDIR = exports.WASI_ENOTCONN = exports.WASI_ENOSYS = exports.WASI_ENOSPC = exports.WASI_ENOPROTOOPT = void 0, exports.RIGHTS_REGULAR_FILE_BASE = exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL = exports.WASI_RIGHT_SOCK_SHUTDOWN = exports.WASI_RIGHT_POLL_FD_READWRITE = exports.WASI_RIGHT_PATH_UNLINK_FILE = exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = exports.WASI_RIGHT_PATH_SYMLINK = exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = exports.WASI_RIGHT_FD_FILESTAT_GET = exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = exports.WASI_RIGHT_PATH_FILESTAT_GET = exports.WASI_RIGHT_PATH_RENAME_TARGET = exports.WASI_RIGHT_PATH_RENAME_SOURCE = exports.WASI_RIGHT_PATH_READLINK = exports.WASI_RIGHT_FD_READDIR = exports.WASI_RIGHT_PATH_OPEN = exports.WASI_RIGHT_PATH_LINK_TARGET = exports.WASI_RIGHT_PATH_LINK_SOURCE = exports.WASI_RIGHT_PATH_CREATE_FILE = exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = exports.WASI_RIGHT_FD_ALLOCATE = exports.WASI_RIGHT_FD_ADVISE = exports.WASI_RIGHT_FD_WRITE = exports.WASI_RIGHT_FD_TELL = exports.WASI_RIGHT_FD_SYNC = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = exports.WASI_RIGHT_FD_SEEK = exports.WASI_RIGHT_FD_READ = exports.WASI_RIGHT_FD_DATASYNC = exports.WASI_FDFLAG_SYNC = exports.WASI_FDFLAG_RSYNC = exports.WASI_FDFLAG_NONBLOCK = exports.WASI_FDFLAG_DSYNC = exports.WASI_FDFLAG_APPEND = exports.WASI_FILETYPE_SYMBOLIC_LINK = exports.WASI_FILETYPE_SOCKET_STREAM = exports.WASI_FILETYPE_SOCKET_DGRAM = exports.WASI_FILETYPE_REGULAR_FILE = exports.WASI_FILETYPE_DIRECTORY = exports.WASI_FILETYPE_CHARACTER_DEVICE = exports.WASI_FILETYPE_BLOCK_DEVICE = exports.WASI_FILETYPE_UNKNOWN = exports.WASI_SIGXFSZ = exports.WASI_SIGXCPU = void 0, exports.SIGNAL_MAP = exports.ERROR_MAP = exports.WASI_WHENCE_END = exports.WASI_WHENCE_CUR = exports.WASI_WHENCE_SET = exports.WASI_STDERR_FILENO = exports.WASI_STDOUT_FILENO = exports.WASI_STDIN_FILENO = exports.WASI_DIRCOOKIE_START = exports.WASI_PREOPENTYPE_DIR = exports.WASI_O_TRUNC = exports.WASI_O_EXCL = exports.WASI_O_DIRECTORY = exports.WASI_O_CREAT = exports.WASI_FILESTAT_SET_MTIM_NOW = exports.WASI_FILESTAT_SET_MTIM = exports.WASI_FILESTAT_SET_ATIM_NOW = exports.WASI_FILESTAT_SET_ATIM = exports.WASI_EVENTTYPE_FD_WRITE = exports.WASI_EVENTTYPE_FD_READ = exports.WASI_EVENTTYPE_CLOCK = exports.WASI_CLOCK_THREAD_CPUTIME_ID = exports.WASI_CLOCK_PROCESS_CPUTIME_ID = exports.WASI_CLOCK_MONOTONIC = exports.WASI_CLOCK_REALTIME = exports.RIGHTS_TTY_INHERITING = exports.RIGHTS_TTY_BASE = exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_SOCKET_BASE = exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE = exports.RIGHTS_REGULAR_FILE_INHERITING = void 0, exports.WASI_ESUCCESS = 0, exports.WASI_E2BIG = 1, exports.WASI_EACCES = 2, exports.WASI_EADDRINUSE = 3, exports.WASI_EADDRNOTAVAIL = 4, exports.WASI_EAFNOSUPPORT = 5, exports.WASI_EAGAIN = 6, exports.WASI_EALREADY = 7, exports.WASI_EBADF = 8, exports.WASI_EBADMSG = 9, exports.WASI_EBUSY = 10, exports.WASI_ECANCELED = 11, exports.WASI_ECHILD = 12, exports.WASI_ECONNABORTED = 13, exports.WASI_ECONNREFUSED = 14, exports.WASI_ECONNRESET = 15, exports.WASI_EDEADLK = 16, exports.WASI_EDESTADDRREQ = 17, exports.WASI_EDOM = 18, exports.WASI_EDQUOT = 19, exports.WASI_EEXIST = 20, exports.WASI_EFAULT = 21, exports.WASI_EFBIG = 22, exports.WASI_EHOSTUNREACH = 23, exports.WASI_EIDRM = 24, exports.WASI_EILSEQ = 25, exports.WASI_EINPROGRESS = 26, exports.WASI_EINTR = 27, exports.WASI_EINVAL = 28, exports.WASI_EIO = 29, exports.WASI_EISCONN = 30, exports.WASI_EISDIR = 31, exports.WASI_ELOOP = 32, exports.WASI_EMFILE = 33, exports.WASI_EMLINK = 34, exports.WASI_EMSGSIZE = 35, exports.WASI_EMULTIHOP = 36, exports.WASI_ENAMETOOLONG = 37, exports.WASI_ENETDOWN = 38, exports.WASI_ENETRESET = 39, exports.WASI_ENETUNREACH = 40, exports.WASI_ENFILE = 41, exports.WASI_ENOBUFS = 42, exports.WASI_ENODEV = 43, exports.WASI_ENOENT = 44, exports.WASI_ENOEXEC = 45, exports.WASI_ENOLCK = 46, exports.WASI_ENOLINK = 47, exports.WASI_ENOMEM = 48, exports.WASI_ENOMSG = 49, exports.WASI_ENOPROTOOPT = 50, exports.WASI_ENOSPC = 51, exports.WASI_ENOSYS = 52, exports.WASI_ENOTCONN = 53, exports.WASI_ENOTDIR = 54, exports.WASI_ENOTEMPTY = 55, exports.WASI_ENOTRECOVERABLE = 56, exports.WASI_ENOTSOCK = 57, exports.WASI_ENOTSUP = 58, exports.WASI_ENOTTY = 59, exports.WASI_ENXIO = 60, exports.WASI_EOVERFLOW = 61, exports.WASI_EOWNERDEAD = 62, exports.WASI_EPERM = 63, exports.WASI_EPIPE = 64, exports.WASI_EPROTO = 65, exports.WASI_EPROTONOSUPPORT = 66, exports.WASI_EPROTOTYPE = 67, exports.WASI_ERANGE = 68, exports.WASI_EROFS = 69, exports.WASI_ESPIPE = 70, exports.WASI_ESRCH = 71, exports.WASI_ESTALE = 72, exports.WASI_ETIMEDOUT = 73, exports.WASI_ETXTBSY = 74, exports.WASI_EXDEV = 75, exports.WASI_ENOTCAPABLE = 76, exports.WASI_SIGABRT = 0, exports.WASI_SIGALRM = 1, exports.WASI_SIGBUS = 2, exports.WASI_SIGCHLD = 3, exports.WASI_SIGCONT = 4, exports.WASI_SIGFPE = 5, exports.WASI_SIGHUP = 6, exports.WASI_SIGILL = 7, exports.WASI_SIGINT = 8, exports.WASI_SIGKILL = 9, exports.WASI_SIGPIPE = 10, exports.WASI_SIGQUIT = 11, exports.WASI_SIGSEGV = 12, exports.WASI_SIGSTOP = 13, exports.WASI_SIGTERM = 14, exports.WASI_SIGTRAP = 15, exports.WASI_SIGTSTP = 16, exports.WASI_SIGTTIN = 17, exports.WASI_SIGTTOU = 18, exports.WASI_SIGURG = 19, exports.WASI_SIGUSR1 = 20, exports.WASI_SIGUSR2 = 21, exports.WASI_SIGVTALRM = 22, exports.WASI_SIGXCPU = 23, exports.WASI_SIGXFSZ = 24, exports.WASI_FILETYPE_UNKNOWN = 0, exports.WASI_FILETYPE_BLOCK_DEVICE = 1, exports.WASI_FILETYPE_CHARACTER_DEVICE = 2, exports.WASI_FILETYPE_DIRECTORY = 3, exports.WASI_FILETYPE_REGULAR_FILE = 4, exports.WASI_FILETYPE_SOCKET_DGRAM = 5, exports.WASI_FILETYPE_SOCKET_STREAM = 6, exports.WASI_FILETYPE_SYMBOLIC_LINK = 7, exports.WASI_FDFLAG_APPEND = 1, exports.WASI_FDFLAG_DSYNC = 2, exports.WASI_FDFLAG_NONBLOCK = 4, exports.WASI_FDFLAG_RSYNC = 8, exports.WASI_FDFLAG_SYNC = 16, exports.WASI_RIGHT_FD_DATASYNC = BigInt(1), exports.WASI_RIGHT_FD_READ = BigInt(2), exports.WASI_RIGHT_FD_SEEK = BigInt(4), exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = BigInt(8), exports.WASI_RIGHT_FD_SYNC = BigInt(16), exports.WASI_RIGHT_FD_TELL = BigInt(32), exports.WASI_RIGHT_FD_WRITE = BigInt(64), exports.WASI_RIGHT_FD_ADVISE = BigInt(128), exports.WASI_RIGHT_FD_ALLOCATE = BigInt(256), exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = BigInt(512), exports.WASI_RIGHT_PATH_CREATE_FILE = BigInt(1024), exports.WASI_RIGHT_PATH_LINK_SOURCE = BigInt(2048), exports.WASI_RIGHT_PATH_LINK_TARGET = BigInt(4096), exports.WASI_RIGHT_PATH_OPEN = BigInt(8192), exports.WASI_RIGHT_FD_READDIR = BigInt(16384), exports.WASI_RIGHT_PATH_READLINK = BigInt(32768), exports.WASI_RIGHT_PATH_RENAME_SOURCE = BigInt(65536), exports.WASI_RIGHT_PATH_RENAME_TARGET = BigInt(131072), exports.WASI_RIGHT_PATH_FILESTAT_GET = BigInt(262144), exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = BigInt(524288), exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = BigInt(1048576), exports.WASI_RIGHT_FD_FILESTAT_GET = BigInt(2097152), exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = BigInt(4194304), exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = BigInt(8388608), exports.WASI_RIGHT_PATH_SYMLINK = BigInt(16777216), exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = BigInt(33554432), exports.WASI_RIGHT_PATH_UNLINK_FILE = BigInt(67108864), exports.WASI_RIGHT_POLL_FD_READWRITE = BigInt(134217728), exports.WASI_RIGHT_SOCK_SHUTDOWN = BigInt(268435456), exports.RIGHTS_ALL = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_REGULAR_FILE_BASE = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_REGULAR_FILE_INHERITING = BigInt(0), exports.RIGHTS_DIRECTORY_BASE = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE | exports.RIGHTS_REGULAR_FILE_BASE, exports.RIGHTS_SOCKET_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_TTY_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_TTY_INHERITING = BigInt(0), exports.WASI_CLOCK_REALTIME = 0, exports.WASI_CLOCK_MONOTONIC = 1, exports.WASI_CLOCK_PROCESS_CPUTIME_ID = 2, exports.WASI_CLOCK_THREAD_CPUTIME_ID = 3, exports.WASI_EVENTTYPE_CLOCK = 0, exports.WASI_EVENTTYPE_FD_READ = 1, exports.WASI_EVENTTYPE_FD_WRITE = 2, exports.WASI_FILESTAT_SET_ATIM = 1 << 0, exports.WASI_FILESTAT_SET_ATIM_NOW = 1 << 1, exports.WASI_FILESTAT_SET_MTIM = 1 << 2, exports.WASI_FILESTAT_SET_MTIM_NOW = 1 << 3, exports.WASI_O_CREAT = 1 << 0, exports.WASI_O_DIRECTORY = 1 << 1, exports.WASI_O_EXCL = 1 << 2, exports.WASI_O_TRUNC = 1 << 3, exports.WASI_PREOPENTYPE_DIR = 0, exports.WASI_DIRCOOKIE_START = 0, exports.WASI_STDIN_FILENO = 0, exports.WASI_STDOUT_FILENO = 1, exports.WASI_STDERR_FILENO = 2, exports.WASI_WHENCE_SET = 0, exports.WASI_WHENCE_CUR = 1, exports.WASI_WHENCE_END = 2, exports.ERROR_MAP = {\n E2BIG: exports.WASI_E2BIG,\n EACCES: exports.WASI_EACCES,\n EADDRINUSE: exports.WASI_EADDRINUSE,\n EADDRNOTAVAIL: exports.WASI_EADDRNOTAVAIL,\n EAFNOSUPPORT: exports.WASI_EAFNOSUPPORT,\n EALREADY: exports.WASI_EALREADY,\n EAGAIN: exports.WASI_EAGAIN,\n EBADF: exports.WASI_EBADF,\n EBADMSG: exports.WASI_EBADMSG,\n EBUSY: exports.WASI_EBUSY,\n ECANCELED: exports.WASI_ECANCELED,\n ECHILD: exports.WASI_ECHILD,\n ECONNABORTED: exports.WASI_ECONNABORTED,\n ECONNREFUSED: exports.WASI_ECONNREFUSED,\n ECONNRESET: exports.WASI_ECONNRESET,\n EDEADLOCK: exports.WASI_EDEADLK,\n EDESTADDRREQ: exports.WASI_EDESTADDRREQ,\n EDOM: exports.WASI_EDOM,\n EDQUOT: exports.WASI_EDQUOT,\n EEXIST: exports.WASI_EEXIST,\n EFAULT: exports.WASI_EFAULT,\n EFBIG: exports.WASI_EFBIG,\n EHOSTDOWN: exports.WASI_EHOSTUNREACH,\n EHOSTUNREACH: exports.WASI_EHOSTUNREACH,\n EIDRM: exports.WASI_EIDRM,\n EILSEQ: exports.WASI_EILSEQ,\n EINPROGRESS: exports.WASI_EINPROGRESS,\n EINTR: exports.WASI_EINTR,\n EINVAL: exports.WASI_EINVAL,\n EIO: exports.WASI_EIO,\n EISCONN: exports.WASI_EISCONN,\n EISDIR: exports.WASI_EISDIR,\n ELOOP: exports.WASI_ELOOP,\n EMFILE: exports.WASI_EMFILE,\n EMLINK: exports.WASI_EMLINK,\n EMSGSIZE: exports.WASI_EMSGSIZE,\n EMULTIHOP: exports.WASI_EMULTIHOP,\n ENAMETOOLONG: exports.WASI_ENAMETOOLONG,\n ENETDOWN: exports.WASI_ENETDOWN,\n ENETRESET: exports.WASI_ENETRESET,\n ENETUNREACH: exports.WASI_ENETUNREACH,\n ENFILE: exports.WASI_ENFILE,\n ENOBUFS: exports.WASI_ENOBUFS,\n ENODEV: exports.WASI_ENODEV,\n ENOENT: exports.WASI_ENOENT,\n ENOEXEC: exports.WASI_ENOEXEC,\n ENOLCK: exports.WASI_ENOLCK,\n ENOLINK: exports.WASI_ENOLINK,\n ENOMEM: exports.WASI_ENOMEM,\n ENOMSG: exports.WASI_ENOMSG,\n ENOPROTOOPT: exports.WASI_ENOPROTOOPT,\n ENOSPC: exports.WASI_ENOSPC,\n ENOSYS: exports.WASI_ENOSYS,\n ENOTCONN: exports.WASI_ENOTCONN,\n ENOTDIR: exports.WASI_ENOTDIR,\n ENOTEMPTY: exports.WASI_ENOTEMPTY,\n ENOTRECOVERABLE: exports.WASI_ENOTRECOVERABLE,\n ENOTSOCK: exports.WASI_ENOTSOCK,\n ENOTTY: exports.WASI_ENOTTY,\n ENXIO: exports.WASI_ENXIO,\n EOVERFLOW: exports.WASI_EOVERFLOW,\n EOWNERDEAD: exports.WASI_EOWNERDEAD,\n EPERM: exports.WASI_EPERM,\n EPIPE: exports.WASI_EPIPE,\n EPROTO: exports.WASI_EPROTO,\n EPROTONOSUPPORT: exports.WASI_EPROTONOSUPPORT,\n EPROTOTYPE: exports.WASI_EPROTOTYPE,\n ERANGE: exports.WASI_ERANGE,\n EROFS: exports.WASI_EROFS,\n ESPIPE: exports.WASI_ESPIPE,\n ESRCH: exports.WASI_ESRCH,\n ESTALE: exports.WASI_ESTALE,\n ETIMEDOUT: exports.WASI_ETIMEDOUT,\n ETXTBSY: exports.WASI_ETXTBSY,\n EXDEV: exports.WASI_EXDEV\n }, exports.SIGNAL_MAP = {\n [exports.WASI_SIGHUP]: \"SIGHUP\",\n [exports.WASI_SIGINT]: \"SIGINT\",\n [exports.WASI_SIGQUIT]: \"SIGQUIT\",\n [exports.WASI_SIGILL]: \"SIGILL\",\n [exports.WASI_SIGTRAP]: \"SIGTRAP\",\n [exports.WASI_SIGABRT]: \"SIGABRT\",\n [exports.WASI_SIGBUS]: \"SIGBUS\",\n [exports.WASI_SIGFPE]: \"SIGFPE\",\n [exports.WASI_SIGKILL]: \"SIGKILL\",\n [exports.WASI_SIGUSR1]: \"SIGUSR1\",\n [exports.WASI_SIGSEGV]: \"SIGSEGV\",\n [exports.WASI_SIGUSR2]: \"SIGUSR2\",\n [exports.WASI_SIGPIPE]: \"SIGPIPE\",\n [exports.WASI_SIGALRM]: \"SIGALRM\",\n [exports.WASI_SIGTERM]: \"SIGTERM\",\n [exports.WASI_SIGCHLD]: \"SIGCHLD\",\n [exports.WASI_SIGCONT]: \"SIGCONT\",\n [exports.WASI_SIGSTOP]: \"SIGSTOP\",\n [exports.WASI_SIGTSTP]: \"SIGTSTP\",\n [exports.WASI_SIGTTIN]: \"SIGTTIN\",\n [exports.WASI_SIGTTOU]: \"SIGTTOU\",\n [exports.WASI_SIGURG]: \"SIGURG\",\n [exports.WASI_SIGXCPU]: \"SIGXCPU\",\n [exports.WASI_SIGXFSZ]: \"SIGXFSZ\",\n [exports.WASI_SIGVTALRM]: \"SIGVTALRM\"\n };\n }\n}), require_wasi = __commonJS({\n \"node_modules/wasi-js/dist/wasi.js\"(exports) {\n var __importDefault = exports && exports.__importDefault || function(mod) {\n return mod && mod.__esModule \? mod : { default: mod };\n };\n let fs;\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.SOCKET_DEFAULT_RIGHTS = void 0;\n var log = () => {\n }, logOpen = () => {\n }, SC_OPEN_MAX = 32768, types_1 = require_types(), constants_1 = require_constants(), STDIN_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDOUT_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDERR_DEFAULT_RIGHTS = STDOUT_DEFAULT_RIGHTS;\n exports.SOCKET_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE | constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS;\n var msToNs = (ms) => {\n const msInt = Math.trunc(ms), decimal = BigInt(Math.round((ms - msInt) * 1e6));\n return BigInt(msInt) * BigInt(1e6) + decimal;\n }, nsToMs = (ns) => {\n if (typeof ns === \"number\")\n ns = Math.trunc(ns);\n const nsInt = BigInt(ns);\n return Number(nsInt / BigInt(1e6));\n }, wrap = (f) => (...args) => {\n try {\n return f(...args);\n } catch (err) {\n let e = err;\n while (e.prev != null)\n e = e.prev;\n if (e\?.code && typeof e\?.code === \"string\")\n return constants_1.ERROR_MAP[e.code] || constants_1.WASI_EINVAL;\n if (e instanceof types_1.WASIError)\n return e.errno;\n throw e;\n }\n }, stat = (wasi, fd) => {\n const entry = wasi.FD_MAP.get(fd);\n if (!entry)\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n if (entry.filetype === void 0) {\n const stats = wasi.fstatSync(entry.real), { filetype, rightsBase, rightsInheriting } = translateFileAttributes(wasi, fd, stats);\n if (entry.filetype = filetype, !entry.rights)\n entry.rights = {\n base: rightsBase,\n inheriting: rightsInheriting\n };\n }\n return entry;\n }, translateFileAttributes = (wasi, fd, stats) => {\n switch (!0) {\n case stats.isBlockDevice():\n return {\n filetype: constants_1.WASI_FILETYPE_BLOCK_DEVICE,\n rightsBase: constants_1.RIGHTS_BLOCK_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_BLOCK_DEVICE_INHERITING\n };\n case stats.isCharacterDevice(): {\n const filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n if (fd !== void 0 && wasi.bindings.isTTY(fd))\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_TTY_BASE,\n rightsInheriting: constants_1.RIGHTS_TTY_INHERITING\n };\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_CHARACTER_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_CHARACTER_DEVICE_INHERITING\n };\n }\n case stats.isDirectory():\n return {\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rightsBase: constants_1.RIGHTS_DIRECTORY_BASE,\n rightsInheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n };\n case stats.isFIFO():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isFile():\n return {\n filetype: constants_1.WASI_FILETYPE_REGULAR_FILE,\n rightsBase: constants_1.RIGHTS_REGULAR_FILE_BASE,\n rightsInheriting: constants_1.RIGHTS_REGULAR_FILE_INHERITING\n };\n case stats.isSocket():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isSymbolicLink():\n return {\n filetype: constants_1.WASI_FILETYPE_SYMBOLIC_LINK,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n default:\n return {\n filetype: constants_1.WASI_FILETYPE_UNKNOWN,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n }\n }, warnedAboutSleep = !1, defaultConfig;\n function getDefaults() {\n if (defaultConfig)\n return defaultConfig;\n const defaultBindings = {\n hrtime: () => process.hrtime.bigint(),\n exit: (code) => {\n process.exit(code);\n },\n kill: (signal) => {\n process.kill(process.pid, signal);\n },\n randomFillSync: (array) => crypto.getRandomValues(array),\n isTTY: (fd) => (@getInternalField(@internalModuleRegistry, 44) || @createInternalModuleById(44)).isatty(fd),\n fs: Bun.fs(),\n path: @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28)\n };\n return defaultConfig = {\n args: [],\n env: {},\n preopens: {},\n bindings: defaultBindings,\n sleep: (ms) => {\n Bun.sleepSync(ms);\n }\n };\n }\n var WASI = class WASI2 {\n constructor(wasiConfig = {}) {\n const defaultConfig2 = getDefaults();\n this.lastStdin = 0, this.sleep = wasiConfig.sleep || defaultConfig2.sleep, this.getStdin = wasiConfig.getStdin, this.sendStdout = wasiConfig.sendStdout, this.sendStderr = wasiConfig.sendStderr;\n let preopens = wasiConfig.preopens \?\? defaultConfig2.preopens;\n this.env = wasiConfig.env \?\? defaultConfig2.env;\n const args = wasiConfig.args \?\? defaultConfig2.args;\n this.memory = void 0, this.view = void 0, this.bindings = wasiConfig.bindings || defaultConfig2.bindings;\n const bindings2 = this.bindings;\n fs = bindings2.fs, this.FD_MAP = new Map([\n [\n constants_1.WASI_STDIN_FILENO,\n {\n real: 0,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdin\"\n }\n ],\n [\n constants_1.WASI_STDOUT_FILENO,\n {\n real: 1,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDOUT_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdout\"\n }\n ],\n [\n constants_1.WASI_STDERR_FILENO,\n {\n real: 2,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDERR_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stderr\"\n }\n ]\n ]);\n const path = bindings2.path;\n for (let [k, v] of Object.entries(preopens)) {\n const real = fs.openSync(v, nodeFsConstants.O_RDONLY), newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real,\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rights: {\n base: constants_1.RIGHTS_DIRECTORY_BASE,\n inheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n },\n fakePath: k,\n path: v\n });\n }\n const getiovs = (iovs, iovsLen) => {\n this.refreshMemory();\n const { view, memory } = this, { buffer } = memory, { byteLength } = buffer;\n if (iovsLen === 1) {\n const ptr = iovs, buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n return [new Uint8Array(buffer, buf, bufLen)];\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n const buffers = [];\n buffers.length = iovsLen;\n for (let i = 0, ptr = iovs;i < iovsLen; i++, ptr += 8) {\n const buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n buffers[i] = new Uint8Array(buffer, buf, bufLen);\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n return buffers;\n }, CHECK_FD = (fd, rights) => {\n const stats = stat(this, fd);\n if (rights !== BigInt(0) && (stats.rights.base & rights) === BigInt(0))\n throw new types_1.WASIError(constants_1.WASI_EPERM);\n return stats;\n }, CPUTIME_START = Bun.nanoseconds(), timeOrigin = Math.trunc(performance.timeOrigin * 1e6), now = (clockId) => {\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n return Bun.nanoseconds();\n case constants_1.WASI_CLOCK_REALTIME:\n return Bun.nanoseconds() + timeOrigin;\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID:\n return Bun.nanoseconds() - CPUTIME_START;\n default:\n return null;\n }\n };\n if (this.wasiImport = {\n args_get: (argv, argvBuf) => {\n this.refreshMemory();\n let coffset = argv, offset = argvBuf;\n return args.forEach((a) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${a}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n args_sizes_get: (argc, argvBufSize) => {\n this.refreshMemory(), this.view.setUint32(argc, args.length, !0);\n const size = args.reduce((acc, a) => acc + Buffer.byteLength(a) + 1, 0);\n return this.view.setUint32(argvBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n environ_get: (environ, environBuf) => {\n this.refreshMemory();\n let coffset = environ, offset = environBuf;\n return Object.entries(this.env).forEach(([key, value]) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${key}=${value}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n environ_sizes_get: (environCount, environBufSize) => {\n this.refreshMemory();\n const envProcessed = Object.entries(this.env).map(([key, value]) => `${key}=${value}\\0`), size = envProcessed.reduce((acc, e) => acc + Buffer.byteLength(e), 0);\n return this.view.setUint32(environCount, envProcessed.length, !0), this.view.setUint32(environBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n clock_res_get: (clockId, resolution) => {\n let res;\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID: {\n res = BigInt(1);\n break;\n }\n case constants_1.WASI_CLOCK_REALTIME: {\n res = BigInt(1000);\n break;\n }\n }\n if (!res)\n throw Error(\"invalid clockId\");\n return this.view.setBigUint64(resolution, res), constants_1.WASI_ESUCCESS;\n },\n clock_time_get: (clockId, _precision, time) => {\n this.refreshMemory();\n const n = now(clockId);\n if (n === null)\n return constants_1.WASI_EINVAL;\n return this.view.setBigUint64(time, BigInt(n), !0), constants_1.WASI_ESUCCESS;\n },\n fd_advise: wrap((fd, _offset, _len, _advice) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ADVISE), constants_1.WASI_ENOSYS;\n }),\n fd_allocate: wrap((fd, _offset, _len) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ALLOCATE), constants_1.WASI_ENOSYS;\n }),\n fd_close: wrap((fd) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return fs.closeSync(stats.real), this.FD_MAP.delete(fd), constants_1.WASI_ESUCCESS;\n }),\n fd_datasync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_DATASYNC);\n return fs.fdatasyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if (this.refreshMemory(), stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), this.view.setUint16(bufPtr + 2, 0, !0), this.view.setUint16(bufPtr + 4, 0, !0), this.view.setBigUint64(bufPtr + 8, BigInt(stats.rights.base), !0), this.view.setBigUint64(bufPtr + 8 + 8, BigInt(stats.rights.inheriting), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_set_flags: wrap((fd, flags) => {\n if (CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS), this.wasiImport.sock_fcntlSetFlags(fd, flags) == 0)\n return constants_1.WASI_ESUCCESS;\n return constants_1.WASI_ENOSYS;\n }),\n fd_fdstat_set_rights: wrap((fd, fsRightsBase, fsRightsInheriting) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if ((stats.rights.base | fsRightsBase) > stats.rights.base)\n return constants_1.WASI_EPERM;\n if ((stats.rights.inheriting | fsRightsInheriting) > stats.rights.inheriting)\n return constants_1.WASI_EPERM;\n return stats.rights.base = fsRightsBase, stats.rights.inheriting = fsRightsInheriting, constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_GET), rstats = this.fstatSync(stats.real);\n if (this.refreshMemory(), this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.atimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.mtimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.ctimeMs), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_size: wrap((fd, stSize) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE);\n return fs.ftruncateSync(stats.real, Number(stSize)), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_times: wrap((fd, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_TIMES), rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n return fs.futimesSync(stats.real, new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), this.view.setUint8(bufPtr, constants_1.WASI_PREOPENTYPE_DIR), this.view.setUint32(bufPtr + 4, Buffer.byteLength(stats.fakePath \?\? stats.path \?\? \"\"), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_dir_name: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), Buffer.from(this.memory.buffer).write(stats.fakePath \?\? stats.path \?\? \"\", pathPtr, pathLen, \"utf8\"), constants_1.WASI_ESUCCESS;\n }),\n fd_pwrite: wrap((fd, iovs, iovsLen, offset, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SEEK);\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n let w = 0;\n while (w < iov.byteLength)\n w += fs.writeSync(stats.real, iov, w, iov.byteLength - w, Number(offset) + written + w);\n written += w;\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_write: wrap((fd, iovs, iovsLen, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE), IS_STDOUT = fd == constants_1.WASI_STDOUT_FILENO, IS_STDERR = fd == constants_1.WASI_STDERR_FILENO;\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n if (iov.byteLength == 0)\n return;\n if (IS_STDOUT && this.sendStdout != null)\n this.sendStdout(iov), written += iov.byteLength;\n else if (IS_STDERR && this.sendStderr != null)\n this.sendStderr(iov), written += iov.byteLength;\n else {\n let w = 0;\n while (w < iov.byteLength) {\n const i = fs.writeSync(stats.real, iov, w, iov.byteLength - w, stats.offset \? Number(stats.offset) : null);\n if (stats.offset)\n stats.offset += BigInt(i);\n w += i;\n }\n written += w;\n }\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_pread: wrap((fd, iovs, iovsLen, offset, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SEEK);\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n const length = iov.byteLength - r, rr = fs.readSync(stats.real, iov, r, iov.byteLength - r, Number(offset) + read + r);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n read += r;\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_read: wrap((fd, iovs, iovsLen, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ), IS_STDIN = fd == constants_1.WASI_STDIN_FILENO;\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n let length = iov.byteLength - r, position = IS_STDIN || stats.offset === void 0 \? null : Number(stats.offset), rr = 0;\n if (IS_STDIN)\n if (this.getStdin != null) {\n if (this.stdinBuffer == null)\n this.stdinBuffer = this.getStdin();\n if (this.stdinBuffer != null) {\n if (rr = this.stdinBuffer.copy(iov), rr == this.stdinBuffer.length)\n this.stdinBuffer = void 0;\n else\n this.stdinBuffer = this.stdinBuffer.slice(rr);\n if (rr > 0)\n this.lastStdin = (new Date()).valueOf();\n }\n } else {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(cpu waiting for stdin: please define a way to sleep!) \");\n try {\n rr = fs.readSync(stats.real, iov, r, length, position);\n } catch (_err) {\n }\n if (rr == 0)\n this.shortPause();\n else\n this.lastStdin = (new Date()).valueOf();\n }\n else\n rr = fs.readSync(stats.real, iov, r, length, position);\n if (stats.filetype == constants_1.WASI_FILETYPE_REGULAR_FILE)\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(rr);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_readdir: wrap((fd, bufPtr, bufLen, cookie, bufusedPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READDIR);\n this.refreshMemory();\n const entries = fs.readdirSync(stats.path, { withFileTypes: !0 }), startPtr = bufPtr;\n for (let i = Number(cookie);i < entries.length; i += 1) {\n const entry = entries[i];\n let nameLength = Buffer.byteLength(entry.name);\n if (bufPtr - startPtr > bufLen)\n break;\n if (this.view.setBigUint64(bufPtr, BigInt(i + 1), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n const rstats = fs.lstatSync(path.resolve(stats.path, entry.name));\n if (this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n if (this.view.setUint32(bufPtr, nameLength, !0), bufPtr += 4, bufPtr - startPtr > bufLen)\n break;\n let filetype;\n switch (!0) {\n case rstats.isBlockDevice():\n filetype = constants_1.WASI_FILETYPE_BLOCK_DEVICE;\n break;\n case rstats.isCharacterDevice():\n filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n break;\n case rstats.isDirectory():\n filetype = constants_1.WASI_FILETYPE_DIRECTORY;\n break;\n case rstats.isFIFO():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isFile():\n filetype = constants_1.WASI_FILETYPE_REGULAR_FILE;\n break;\n case rstats.isSocket():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isSymbolicLink():\n filetype = constants_1.WASI_FILETYPE_SYMBOLIC_LINK;\n break;\n default:\n filetype = constants_1.WASI_FILETYPE_UNKNOWN;\n break;\n }\n if (this.view.setUint8(bufPtr, filetype), bufPtr += 1, bufPtr += 3, bufPtr + nameLength >= startPtr + bufLen)\n break;\n Buffer.from(this.memory.buffer).write(entry.name, bufPtr), bufPtr += nameLength;\n }\n const bufused = bufPtr - startPtr;\n return this.view.setUint32(bufusedPtr, Math.min(bufused, bufLen), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_renumber: wrap((from, to) => {\n return CHECK_FD(from, BigInt(0)), CHECK_FD(to, BigInt(0)), fs.closeSync(this.FD_MAP.get(from).real), this.FD_MAP.set(from, this.FD_MAP.get(to)), this.FD_MAP.delete(to), constants_1.WASI_ESUCCESS;\n }),\n fd_seek: wrap((fd, offset, whence, newOffsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SEEK);\n switch (this.refreshMemory(), whence) {\n case constants_1.WASI_WHENCE_CUR:\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_END:\n const { size } = this.fstatSync(stats.real);\n stats.offset = BigInt(size) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_SET:\n stats.offset = BigInt(offset);\n break;\n }\n if (stats.offset == null)\n throw Error(\"stats.offset must be defined\");\n return this.view.setBigUint64(newOffsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_tell: wrap((fd, offsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_TELL);\n if (this.refreshMemory(), !stats.offset)\n stats.offset = BigInt(0);\n return this.view.setBigUint64(offsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_sync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SYNC);\n return fs.fsyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n path_create_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_CREATE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.mkdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_get: wrap((fd, flags, pathPtr, pathLen, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_GET);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n let rstats;\n if (flags)\n rstats = fs.statSync(path.resolve(stats.path, p));\n else\n rstats = fs.lstatSync(path.resolve(stats.path, p));\n return this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, this.view.setUint8(bufPtr, translateFileAttributes(this, void 0, rstats).filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.atime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.mtime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ctime.getTime() * 1e6), !0), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_set_times: wrap((fd, _dirflags, pathPtr, pathLen, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.utimesSync(path.resolve(stats.path, p), new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n path_link: wrap((oldFd, _oldFlags, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_LINK_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_LINK_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.linkSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_open: wrap((dirfd, _dirflags, pathPtr, pathLen, oflags, fsRightsBase, fsRightsInheriting, fsFlags, fdPtr) => {\n try {\n const stats = CHECK_FD(dirfd, constants_1.WASI_RIGHT_PATH_OPEN);\n fsRightsBase = BigInt(fsRightsBase), fsRightsInheriting = BigInt(fsRightsInheriting);\n const read = (fsRightsBase & (constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_READDIR)) !== BigInt(0), write = (fsRightsBase & (constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ALLOCATE | constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE)) !== BigInt(0);\n let noflags;\n if (write && read)\n noflags = nodeFsConstants.O_RDWR;\n else if (read)\n noflags = nodeFsConstants.O_RDONLY;\n else if (write)\n noflags = nodeFsConstants.O_WRONLY;\n let neededBase = fsRightsBase | constants_1.WASI_RIGHT_PATH_OPEN, neededInheriting = fsRightsBase | fsRightsInheriting;\n if ((oflags & constants_1.WASI_O_CREAT) !== 0)\n noflags |= nodeFsConstants.O_CREAT, neededBase |= constants_1.WASI_RIGHT_PATH_CREATE_FILE;\n if ((oflags & constants_1.WASI_O_DIRECTORY) !== 0)\n noflags |= nodeFsConstants.O_DIRECTORY;\n if ((oflags & constants_1.WASI_O_EXCL) !== 0)\n noflags |= nodeFsConstants.O_EXCL;\n if ((oflags & constants_1.WASI_O_TRUNC) !== 0)\n noflags |= nodeFsConstants.O_TRUNC, neededBase |= constants_1.WASI_RIGHT_PATH_FILESTAT_SET_SIZE;\n if ((fsFlags & constants_1.WASI_FDFLAG_APPEND) !== 0)\n noflags |= nodeFsConstants.O_APPEND;\n if ((fsFlags & constants_1.WASI_FDFLAG_DSYNC) !== 0) {\n if (nodeFsConstants.O_DSYNC)\n noflags |= nodeFsConstants.O_DSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_DATASYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_NONBLOCK) !== 0)\n noflags |= nodeFsConstants.O_NONBLOCK;\n if ((fsFlags & constants_1.WASI_FDFLAG_RSYNC) !== 0) {\n if (nodeFsConstants.O_RSYNC)\n noflags |= nodeFsConstants.O_RSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_SYNC) !== 0)\n noflags |= nodeFsConstants.O_SYNC, neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n if (write && (noflags & (nodeFsConstants.O_APPEND | nodeFsConstants.O_TRUNC)) === 0)\n neededInheriting |= constants_1.WASI_RIGHT_FD_SEEK;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n if (p == \"dev/tty\")\n return this.view.setUint32(fdPtr, constants_1.WASI_STDIN_FILENO, !0), constants_1.WASI_ESUCCESS;\n if (logOpen(\"path_open\", p), p.startsWith(\"proc/\"))\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n const fullUnresolved = path.resolve(p);\n let full;\n try {\n full = fs.realpathSync(fullUnresolved);\n } catch (e) {\n if (e\?.code === \"ENOENT\")\n full = fullUnresolved;\n else\n throw e;\n }\n let isDirectory;\n if (write)\n try {\n isDirectory = fs.statSync(full).isDirectory();\n } catch (_err) {\n }\n let realfd;\n if (!write && isDirectory)\n realfd = fs.openSync(full, nodeFsConstants.O_RDONLY);\n else\n realfd = fs.openSync(full, noflags);\n const newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real: realfd,\n filetype: void 0,\n rights: {\n base: neededBase,\n inheriting: neededInheriting\n },\n path: full\n }), stat(this, newfd), this.view.setUint32(fdPtr, newfd, !0);\n } catch (e) {\n console.error(e);\n }\n return constants_1.WASI_ESUCCESS;\n }),\n path_readlink: wrap((fd, pathPtr, pathLen, buf, bufLen, bufused) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_READLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString(), full = path.resolve(stats.path, p), r = fs.readlinkSync(full), used = Buffer.from(this.memory.buffer).write(r, buf, bufLen);\n return this.view.setUint32(bufused, used, !0), constants_1.WASI_ESUCCESS;\n }),\n path_remove_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_REMOVE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.rmdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_rename: wrap((oldFd, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_RENAME_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_RENAME_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.renameSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_symlink: wrap((oldPath, oldPathLen, fd, newPath, newPathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_SYMLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.symlinkSync(op, path.resolve(stats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_unlink_file: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_UNLINK_FILE);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.unlinkSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n poll_oneoff: (sin, sout, nsubscriptions, neventsPtr) => {\n let nevents = 0, name = \"\", waitTimeNs = BigInt(0), fd = -1, fd_type = \"read\", fd_timeout_ms = 0;\n const startNs = BigInt(bindings2.hrtime());\n this.refreshMemory();\n let last_sin = sin;\n for (let i = 0;i < nsubscriptions; i += 1) {\n const userdata = this.view.getBigUint64(sin, !0);\n sin += 8;\n const type = this.view.getUint8(sin);\n if (sin += 1, sin += 7, log.enabled) {\n if (type == constants_1.WASI_EVENTTYPE_CLOCK)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_CLOCK): \";\n else if (type == constants_1.WASI_EVENTTYPE_FD_READ)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_READ): \";\n else\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_WRITE): \";\n log(name);\n }\n switch (type) {\n case constants_1.WASI_EVENTTYPE_CLOCK: {\n const clockid = this.view.getUint32(sin, !0);\n sin += 4, sin += 4;\n const timeout = this.view.getBigUint64(sin, !0);\n sin += 8, sin += 8;\n const subclockflags = this.view.getUint16(sin, !0);\n sin += 2, sin += 6;\n const absolute = subclockflags === 1;\n if (log.enabled)\n log(name, { clockid, timeout, absolute });\n if (!absolute)\n fd_timeout_ms = timeout / BigInt(1e6);\n let e = constants_1.WASI_ESUCCESS;\n const t = now(clockid);\n if (t == null)\n e = constants_1.WASI_EINVAL;\n else {\n const tNS = BigInt(t), waitNs = (absolute \? timeout : tNS + timeout) - tNS;\n if (waitNs > waitTimeNs)\n waitTimeNs = waitNs;\n }\n this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, e, !0), sout += 2, this.view.setUint8(sout, constants_1.WASI_EVENTTYPE_CLOCK), sout += 1, sout += 5, nevents += 1;\n break;\n }\n case constants_1.WASI_EVENTTYPE_FD_READ:\n case constants_1.WASI_EVENTTYPE_FD_WRITE: {\n if (fd = this.view.getUint32(sin, !0), fd_type = type == constants_1.WASI_EVENTTYPE_FD_READ \? \"read\" : \"write\", sin += 4, log(name, \"fd =\", fd), sin += 28, this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, constants_1.WASI_ENOSYS, !0), sout += 2, this.view.setUint8(sout, type), sout += 1, sout += 5, nevents += 1, fd == constants_1.WASI_STDIN_FILENO && constants_1.WASI_EVENTTYPE_FD_READ == type)\n this.shortPause();\n break;\n }\n default:\n return constants_1.WASI_EINVAL;\n }\n if (sin - last_sin != 48)\n console.warn(\"*** BUG in wasi-js in poll_oneoff \", {\n i,\n sin,\n last_sin,\n diff: sin - last_sin\n });\n last_sin = sin;\n }\n if (this.view.setUint32(neventsPtr, nevents, !0), nevents == 2 && fd >= 0) {\n const r = this.wasiImport.sock_pollSocket(fd, fd_type, fd_timeout_ms);\n if (r != constants_1.WASI_ENOSYS)\n return r;\n }\n if (waitTimeNs > 0) {\n if (waitTimeNs -= Bun.nanoseconds() - timeOrigin, waitTimeNs >= 1e6) {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(100% cpu burning waiting for stdin: please define a way to sleep!) \");\n if (this.sleep != null) {\n const ms = nsToMs(waitTimeNs);\n this.sleep(ms);\n } else {\n const end = BigInt(bindings2.hrtime()) + waitTimeNs;\n while (BigInt(bindings2.hrtime()) < end)\n ;\n }\n }\n }\n return constants_1.WASI_ESUCCESS;\n },\n proc_exit: (rval) => {\n return bindings2.exit(rval), constants_1.WASI_ESUCCESS;\n },\n proc_raise: (sig) => {\n if (!(sig in constants_1.SIGNAL_MAP))\n return constants_1.WASI_EINVAL;\n return bindings2.kill(constants_1.SIGNAL_MAP[sig]), constants_1.WASI_ESUCCESS;\n },\n random_get: (bufPtr, bufLen) => {\n return this.refreshMemory(), crypto.getRandomValues(this.memory.buffer, bufPtr, bufLen), bufLen;\n },\n sched_yield() {\n return constants_1.WASI_ESUCCESS;\n },\n sock_recv() {\n return constants_1.WASI_ENOSYS;\n },\n sock_send() {\n return constants_1.WASI_ENOSYS;\n },\n sock_shutdown() {\n return constants_1.WASI_ENOSYS;\n },\n sock_fcntlSetFlags(_fd, _flags) {\n return constants_1.WASI_ENOSYS;\n },\n sock_pollSocket(_fd, _eventtype, _timeout_ms) {\n return constants_1.WASI_ENOSYS;\n }\n }, log.enabled)\n Object.keys(this.wasiImport).forEach((key) => {\n const prevImport = this.wasiImport[key];\n this.wasiImport[key] = function(...args2) {\n log(key, args2);\n try {\n let result = prevImport(...args2);\n return log(\"result\", result), result;\n } catch (e) {\n throw log(\"error: \", e), e;\n }\n };\n });\n }\n getState() {\n return { env: this.env, FD_MAP: this.FD_MAP, bindings };\n }\n setState(state) {\n this.env = state.env, this.FD_MAP = state.FD_MAP, bindings = state.bindings;\n }\n fstatSync(real_fd) {\n if (real_fd <= 2)\n try {\n return fs.fstatSync(real_fd);\n } catch (_) {\n const now = new Date;\n return {\n dev: 0,\n mode: 8592,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n blksize: 65536,\n ino: 0,\n size: 0,\n blocks: 0,\n atimeMs: now.valueOf(),\n mtimeMs: now.valueOf(),\n ctimeMs: now.valueOf(),\n birthtimeMs: 0,\n atime: new Date,\n mtime: new Date,\n ctime: new Date,\n birthtime: new Date(0)\n };\n }\n return fs.fstatSync(real_fd);\n }\n shortPause() {\n if (this.sleep == null)\n return;\n if ((new Date()).valueOf() - this.lastStdin > 2000)\n this.sleep(50);\n }\n getUnusedFileDescriptor(start = 3) {\n let fd = start;\n while (this.FD_MAP.has(fd))\n fd += 1;\n if (fd > SC_OPEN_MAX)\n throw Error(\"no available file descriptors\");\n return fd;\n }\n refreshMemory() {\n if (!this.view || this.view.buffer.byteLength === 0)\n this.view = new DataView(this.memory.buffer);\n }\n setMemory(memory) {\n this.memory = memory;\n }\n start(instance, memory) {\n const exports2 = instance.exports;\n if (exports2 === null || typeof exports2 !== \"object\")\n throw new Error(`instance.exports must be an Object. Received ${exports2}.`);\n if (memory == null) {\n if (memory = exports2.memory, !(memory instanceof WebAssembly.Memory))\n throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${memory}.`);\n }\n if (this.setMemory(memory), exports2._start)\n exports2._start();\n }\n getImports(module2) {\n let namespace = null;\n const imports = WebAssembly.Module.imports(module2);\n for (let imp of imports) {\n if (imp.kind !== \"function\")\n continue;\n if (!imp.module.startsWith(\"wasi_\"))\n continue;\n namespace = imp.module;\n break;\n }\n switch (namespace) {\n case \"wasi_unstable\":\n return {\n wasi_unstable: this.wasiImport\n };\n case \"wasi_snapshot_preview1\":\n return {\n wasi_snapshot_preview1: this.wasiImport\n };\n default:\n throw new Error(\"No WASI namespace found. Only wasi_unstable and wasi_snapshot_preview1 are supported.\\n\\nList of imports:\\n\\n\" + imports.map(({ name, kind, module }) => `${module}:${name} (${kind})`).join(\"\\n\") + \"\\n\");\n }\n }\n initWasiFdInfo() {\n if (this.env.WASI_FD_INFO != null) {\n const fdInfo = JSON.parse(this.env.WASI_FD_INFO);\n for (let wasi_fd in fdInfo) {\n console.log(wasi_fd);\n const fd = parseInt(wasi_fd);\n if (this.FD_MAP.has(fd))\n continue;\n const real = fdInfo[wasi_fd];\n try {\n this.fstatSync(real);\n } catch (_err) {\n console.log(\"discarding \", { wasi_fd, real });\n continue;\n }\n const file = {\n real,\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n }\n };\n this.FD_MAP.set(fd, file);\n }\n console.log(\"after initWasiFdInfo: \", this.FD_MAP), console.log(\"fdInfo = \", fdInfo);\n } else\n console.log(\"no WASI_FD_INFO\");\n }\n };\n exports.default = WASI;\n }\n});\nreturn { WASI: require_wasi().default }})\n"_s;
+static constexpr ASCIILiteral NodeVMCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/vm.ts\nvar runInContext = function(code, context, options) {\n return new Script(code, options).runInContext(context);\n}, compileFunction = function() {\n throwNotImplemented(\"node:vm compileFunction\");\n}, measureMemory = function() {\n throwNotImplemented(\"node:vm measureMemory\");\n}, $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), vm = @lazy(\"vm\"), { createContext, isContext, Script, runInNewContext, runInThisContext } = vm;\n\nclass Module {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n\nclass SourceTextModule {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n\nclass SyntheticModule {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n$ = {\n createContext,\n runInContext,\n runInNewContext,\n runInThisContext,\n isContext,\n compileFunction,\n measureMemory,\n Script,\n Module,\n SourceTextModule,\n SyntheticModule\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeWorkerThreadsCode = "(function (){\"use strict\";// src/js/out/tmp/node/worker_threads.ts\nvar emitWarning = function(type, message) {\n if (emittedWarnings.has(type))\n return;\n emittedWarnings.add(type), console.warn(\"[bun] Warning:\", message);\n}, injectFakeEmitter = function(Class) {\n function messageEventHandler(event) {\n return event.data;\n }\n function errorEventHandler(event) {\n return event.error;\n }\n const wrappedListener = Symbol(\"wrappedListener\");\n function wrapped(run, listener) {\n const callback = function(event) {\n return listener(run(event));\n };\n return listener[wrappedListener] = callback, callback;\n }\n function functionForEventType(event, listener) {\n switch (event) {\n case \"error\":\n case \"messageerror\":\n return wrapped(errorEventHandler, listener);\n default:\n return wrapped(messageEventHandler, listener);\n }\n }\n Class.prototype.on = function(event, listener) {\n return this.addEventListener(event, functionForEventType(event, listener)), this;\n }, Class.prototype.off = function(event, listener) {\n if (listener)\n this.removeEventListener(event, listener[wrappedListener] || listener);\n else\n this.removeEventListener(event);\n return this;\n }, Class.prototype.once = function(event, listener) {\n return this.addEventListener(event, functionForEventType(event, listener), { once: !0 }), this;\n };\n function EventClass(eventName) {\n if (eventName === \"error\" || eventName === \"messageerror\")\n return ErrorEvent;\n return MessageEvent;\n }\n Class.prototype.emit = function(event, ...args) {\n return this.dispatchEvent(new (EventClass(event))(event, ...args)), this;\n }, Class.prototype.prependListener = Class.prototype.on, Class.prototype.prependOnceListener = Class.prototype.once;\n}, receiveMessageOnPort = function(port) {\n let res = _receiveMessageOnPort(port);\n if (!res)\n return;\n return {\n message: res\n };\n}, fakeParentPort = function() {\n const fake = Object.create(MessagePort.prototype);\n return Object.defineProperty(fake, \"onmessage\", {\n get() {\n return self.onmessage;\n },\n set(value) {\n self.onmessage = value;\n }\n }), Object.defineProperty(fake, \"onmessageerror\", {\n get() {\n return self.onmessageerror;\n },\n set(value) {\n }\n }), Object.defineProperty(fake, \"postMessage\", {\n value(...args) {\n return self.postMessage(...args);\n }\n }), Object.defineProperty(fake, \"close\", {\n value() {\n return process.exit(0);\n }\n }), Object.defineProperty(fake, \"start\", {\n value() {\n }\n }), Object.defineProperty(fake, \"unref\", {\n value() {\n }\n }), Object.defineProperty(fake, \"ref\", {\n value() {\n }\n }), Object.defineProperty(fake, \"hasRef\", {\n value() {\n return !1;\n }\n }), Object.defineProperty(fake, \"setEncoding\", {\n value() {\n }\n }), Object.defineProperty(fake, \"addEventListener\", {\n value: self.addEventListener.bind(self)\n }), Object.defineProperty(fake, \"removeEventListener\", {\n value: self.removeEventListener.bind(self)\n }), fake;\n}, getEnvironmentData = function() {\n return process.env;\n}, setEnvironmentData = function(env) {\n process.env = env;\n}, markAsUntransferable = function() {\n throwNotImplemented(\"worker_threads.markAsUntransferable\");\n}, moveMessagePortToContext = function() {\n throwNotImplemented(\"worker_threads.moveMessagePortToContext\");\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), { MessageChannel, BroadcastChannel, Worker: WebWorker } = globalThis, SHARE_ENV = Symbol(\"nodejs.worker_threads.SHARE_ENV\"), isMainThread = Bun.isMainThread, [_workerData, _threadId, _receiveMessageOnPort] = globalThis[globalThis.Symbol.for('Bun.lazy')](\"worker_threads\"), emittedWarnings = new Set, _MessagePort = globalThis.MessagePort;\ninjectFakeEmitter(_MessagePort);\nvar MessagePort = _MessagePort, resourceLimits = {}, workerData = _workerData, threadId = _threadId, parentPort = isMainThread \? null : fakeParentPort(), unsupportedOptions = [\n \"eval\",\n \"argv\",\n \"execArgv\",\n \"stdin\",\n \"stdout\",\n \"stderr\",\n \"trackedUnmanagedFds\",\n \"resourceLimits\"\n];\n\nclass Worker extends EventEmitter {\n #worker;\n #performance;\n #onExitPromise = void 0;\n constructor(filename, options = {}) {\n super();\n for (let key of unsupportedOptions)\n if (key in options)\n emitWarning(\"option.\" + key, `worker_threads.Worker option \"${key}\" is not implemented.`);\n this.#worker = new WebWorker(filename, options), this.#worker.addEventListener(\"close\", this.#onClose.bind(this)), this.#worker.addEventListener(\"error\", this.#onError.bind(this)), this.#worker.addEventListener(\"message\", this.#onMessage.bind(this)), this.#worker.addEventListener(\"messageerror\", this.#onMessageError.bind(this)), this.#worker.addEventListener(\"open\", this.#onOpen.bind(this));\n }\n ref() {\n this.#worker.ref();\n }\n unref() {\n this.#worker.unref();\n }\n get stdin() {\n return null;\n }\n get stdout() {\n return null;\n }\n get stderr() {\n return null;\n }\n get performance() {\n return this.#performance \?\?= {\n eventLoopUtilization() {\n return emitWarning(\"performance\", \"worker_threads.Worker.performance is not implemented.\"), {\n idle: 0,\n active: 0,\n utilization: 0\n };\n }\n };\n }\n terminate() {\n var onExitPromise = this.#onExitPromise;\n if (onExitPromise)\n return @isPromise(onExitPromise) \? onExitPromise : Promise.resolve(onExitPromise);\n const { resolve, promise } = Promise.withResolvers();\n return this.#worker.addEventListener(\"close\", (event) => {\n resolve(event.code);\n }, { once: !0 }), this.#worker.terminate(), this.#onExitPromise = promise;\n }\n postMessage(...args) {\n return this.#worker.postMessage(...args);\n }\n #onClose(e) {\n this.#onExitPromise = e.code, this.emit(\"exit\", e.code);\n }\n #onError(error) {\n this.emit(\"error\", error);\n }\n #onMessage(event) {\n this.emit(\"message\", event.data);\n }\n #onMessageError(event) {\n this.emit(\"messageerror\", event.error \?\? event.data \?\? event);\n }\n #onOpen() {\n this.emit(\"online\");\n }\n async getHeapSnapshot() {\n throwNotImplemented(\"worker_threads.Worker.getHeapSnapshot\");\n }\n}\n$ = {\n Worker,\n workerData,\n parentPort,\n resourceLimits,\n isMainThread,\n MessageChannel,\n BroadcastChannel,\n MessagePort,\n getEnvironmentData,\n setEnvironmentData,\n getHeapSnapshot() {\n return {};\n },\n markAsUntransferable,\n moveMessagePortToContext,\n receiveMessageOnPort,\n SHARE_ENV,\n threadId\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeWasiCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/wasi.ts\nvar nodeFsConstants = @processBindingConstants.fs, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_types = __commonJS({\n \"node_modules/wasi-js/dist/types.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASIKillError = exports.WASIExitError = exports.WASIError = void 0;\n var WASIError = class extends Error {\n constructor(errno) {\n super();\n this.errno = errno, Object.setPrototypeOf(this, WASIError.prototype);\n }\n };\n exports.WASIError = WASIError;\n var WASIExitError = class extends Error {\n constructor(code) {\n super(`WASI Exit error: ${code}`);\n this.code = code, Object.setPrototypeOf(this, WASIExitError.prototype);\n }\n };\n exports.WASIExitError = WASIExitError;\n var WASIKillError = class extends Error {\n constructor(signal) {\n super(`WASI Kill signal: ${signal}`);\n this.signal = signal, Object.setPrototypeOf(this, WASIKillError.prototype);\n }\n };\n exports.WASIKillError = WASIKillError;\n }\n}), require_constants = __commonJS({\n \"node_modules/wasi-js/dist/constants.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASI_ENOMSG = exports.WASI_ENOMEM = exports.WASI_ENOLINK = exports.WASI_ENOLCK = exports.WASI_ENOEXEC = exports.WASI_ENOENT = exports.WASI_ENODEV = exports.WASI_ENOBUFS = exports.WASI_ENFILE = exports.WASI_ENETUNREACH = exports.WASI_ENETRESET = exports.WASI_ENETDOWN = exports.WASI_ENAMETOOLONG = exports.WASI_EMULTIHOP = exports.WASI_EMSGSIZE = exports.WASI_EMLINK = exports.WASI_EMFILE = exports.WASI_ELOOP = exports.WASI_EISDIR = exports.WASI_EISCONN = exports.WASI_EIO = exports.WASI_EINVAL = exports.WASI_EINTR = exports.WASI_EINPROGRESS = exports.WASI_EILSEQ = exports.WASI_EIDRM = exports.WASI_EHOSTUNREACH = exports.WASI_EFBIG = exports.WASI_EFAULT = exports.WASI_EEXIST = exports.WASI_EDQUOT = exports.WASI_EDOM = exports.WASI_EDESTADDRREQ = exports.WASI_EDEADLK = exports.WASI_ECONNRESET = exports.WASI_ECONNREFUSED = exports.WASI_ECONNABORTED = exports.WASI_ECHILD = exports.WASI_ECANCELED = exports.WASI_EBUSY = exports.WASI_EBADMSG = exports.WASI_EBADF = exports.WASI_EALREADY = exports.WASI_EAGAIN = exports.WASI_EAFNOSUPPORT = exports.WASI_EADDRNOTAVAIL = exports.WASI_EADDRINUSE = exports.WASI_EACCES = exports.WASI_E2BIG = exports.WASI_ESUCCESS = void 0, exports.WASI_SIGVTALRM = exports.WASI_SIGUSR2 = exports.WASI_SIGUSR1 = exports.WASI_SIGURG = exports.WASI_SIGTTOU = exports.WASI_SIGTTIN = exports.WASI_SIGTSTP = exports.WASI_SIGTRAP = exports.WASI_SIGTERM = exports.WASI_SIGSTOP = exports.WASI_SIGSEGV = exports.WASI_SIGQUIT = exports.WASI_SIGPIPE = exports.WASI_SIGKILL = exports.WASI_SIGINT = exports.WASI_SIGILL = exports.WASI_SIGHUP = exports.WASI_SIGFPE = exports.WASI_SIGCONT = exports.WASI_SIGCHLD = exports.WASI_SIGBUS = exports.WASI_SIGALRM = exports.WASI_SIGABRT = exports.WASI_ENOTCAPABLE = exports.WASI_EXDEV = exports.WASI_ETXTBSY = exports.WASI_ETIMEDOUT = exports.WASI_ESTALE = exports.WASI_ESRCH = exports.WASI_ESPIPE = exports.WASI_EROFS = exports.WASI_ERANGE = exports.WASI_EPROTOTYPE = exports.WASI_EPROTONOSUPPORT = exports.WASI_EPROTO = exports.WASI_EPIPE = exports.WASI_EPERM = exports.WASI_EOWNERDEAD = exports.WASI_EOVERFLOW = exports.WASI_ENXIO = exports.WASI_ENOTTY = exports.WASI_ENOTSUP = exports.WASI_ENOTSOCK = exports.WASI_ENOTRECOVERABLE = exports.WASI_ENOTEMPTY = exports.WASI_ENOTDIR = exports.WASI_ENOTCONN = exports.WASI_ENOSYS = exports.WASI_ENOSPC = exports.WASI_ENOPROTOOPT = void 0, exports.RIGHTS_REGULAR_FILE_BASE = exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL = exports.WASI_RIGHT_SOCK_SHUTDOWN = exports.WASI_RIGHT_POLL_FD_READWRITE = exports.WASI_RIGHT_PATH_UNLINK_FILE = exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = exports.WASI_RIGHT_PATH_SYMLINK = exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = exports.WASI_RIGHT_FD_FILESTAT_GET = exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = exports.WASI_RIGHT_PATH_FILESTAT_GET = exports.WASI_RIGHT_PATH_RENAME_TARGET = exports.WASI_RIGHT_PATH_RENAME_SOURCE = exports.WASI_RIGHT_PATH_READLINK = exports.WASI_RIGHT_FD_READDIR = exports.WASI_RIGHT_PATH_OPEN = exports.WASI_RIGHT_PATH_LINK_TARGET = exports.WASI_RIGHT_PATH_LINK_SOURCE = exports.WASI_RIGHT_PATH_CREATE_FILE = exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = exports.WASI_RIGHT_FD_ALLOCATE = exports.WASI_RIGHT_FD_ADVISE = exports.WASI_RIGHT_FD_WRITE = exports.WASI_RIGHT_FD_TELL = exports.WASI_RIGHT_FD_SYNC = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = exports.WASI_RIGHT_FD_SEEK = exports.WASI_RIGHT_FD_READ = exports.WASI_RIGHT_FD_DATASYNC = exports.WASI_FDFLAG_SYNC = exports.WASI_FDFLAG_RSYNC = exports.WASI_FDFLAG_NONBLOCK = exports.WASI_FDFLAG_DSYNC = exports.WASI_FDFLAG_APPEND = exports.WASI_FILETYPE_SYMBOLIC_LINK = exports.WASI_FILETYPE_SOCKET_STREAM = exports.WASI_FILETYPE_SOCKET_DGRAM = exports.WASI_FILETYPE_REGULAR_FILE = exports.WASI_FILETYPE_DIRECTORY = exports.WASI_FILETYPE_CHARACTER_DEVICE = exports.WASI_FILETYPE_BLOCK_DEVICE = exports.WASI_FILETYPE_UNKNOWN = exports.WASI_SIGXFSZ = exports.WASI_SIGXCPU = void 0, exports.SIGNAL_MAP = exports.ERROR_MAP = exports.WASI_WHENCE_END = exports.WASI_WHENCE_CUR = exports.WASI_WHENCE_SET = exports.WASI_STDERR_FILENO = exports.WASI_STDOUT_FILENO = exports.WASI_STDIN_FILENO = exports.WASI_DIRCOOKIE_START = exports.WASI_PREOPENTYPE_DIR = exports.WASI_O_TRUNC = exports.WASI_O_EXCL = exports.WASI_O_DIRECTORY = exports.WASI_O_CREAT = exports.WASI_FILESTAT_SET_MTIM_NOW = exports.WASI_FILESTAT_SET_MTIM = exports.WASI_FILESTAT_SET_ATIM_NOW = exports.WASI_FILESTAT_SET_ATIM = exports.WASI_EVENTTYPE_FD_WRITE = exports.WASI_EVENTTYPE_FD_READ = exports.WASI_EVENTTYPE_CLOCK = exports.WASI_CLOCK_THREAD_CPUTIME_ID = exports.WASI_CLOCK_PROCESS_CPUTIME_ID = exports.WASI_CLOCK_MONOTONIC = exports.WASI_CLOCK_REALTIME = exports.RIGHTS_TTY_INHERITING = exports.RIGHTS_TTY_BASE = exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_SOCKET_BASE = exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE = exports.RIGHTS_REGULAR_FILE_INHERITING = void 0, exports.WASI_ESUCCESS = 0, exports.WASI_E2BIG = 1, exports.WASI_EACCES = 2, exports.WASI_EADDRINUSE = 3, exports.WASI_EADDRNOTAVAIL = 4, exports.WASI_EAFNOSUPPORT = 5, exports.WASI_EAGAIN = 6, exports.WASI_EALREADY = 7, exports.WASI_EBADF = 8, exports.WASI_EBADMSG = 9, exports.WASI_EBUSY = 10, exports.WASI_ECANCELED = 11, exports.WASI_ECHILD = 12, exports.WASI_ECONNABORTED = 13, exports.WASI_ECONNREFUSED = 14, exports.WASI_ECONNRESET = 15, exports.WASI_EDEADLK = 16, exports.WASI_EDESTADDRREQ = 17, exports.WASI_EDOM = 18, exports.WASI_EDQUOT = 19, exports.WASI_EEXIST = 20, exports.WASI_EFAULT = 21, exports.WASI_EFBIG = 22, exports.WASI_EHOSTUNREACH = 23, exports.WASI_EIDRM = 24, exports.WASI_EILSEQ = 25, exports.WASI_EINPROGRESS = 26, exports.WASI_EINTR = 27, exports.WASI_EINVAL = 28, exports.WASI_EIO = 29, exports.WASI_EISCONN = 30, exports.WASI_EISDIR = 31, exports.WASI_ELOOP = 32, exports.WASI_EMFILE = 33, exports.WASI_EMLINK = 34, exports.WASI_EMSGSIZE = 35, exports.WASI_EMULTIHOP = 36, exports.WASI_ENAMETOOLONG = 37, exports.WASI_ENETDOWN = 38, exports.WASI_ENETRESET = 39, exports.WASI_ENETUNREACH = 40, exports.WASI_ENFILE = 41, exports.WASI_ENOBUFS = 42, exports.WASI_ENODEV = 43, exports.WASI_ENOENT = 44, exports.WASI_ENOEXEC = 45, exports.WASI_ENOLCK = 46, exports.WASI_ENOLINK = 47, exports.WASI_ENOMEM = 48, exports.WASI_ENOMSG = 49, exports.WASI_ENOPROTOOPT = 50, exports.WASI_ENOSPC = 51, exports.WASI_ENOSYS = 52, exports.WASI_ENOTCONN = 53, exports.WASI_ENOTDIR = 54, exports.WASI_ENOTEMPTY = 55, exports.WASI_ENOTRECOVERABLE = 56, exports.WASI_ENOTSOCK = 57, exports.WASI_ENOTSUP = 58, exports.WASI_ENOTTY = 59, exports.WASI_ENXIO = 60, exports.WASI_EOVERFLOW = 61, exports.WASI_EOWNERDEAD = 62, exports.WASI_EPERM = 63, exports.WASI_EPIPE = 64, exports.WASI_EPROTO = 65, exports.WASI_EPROTONOSUPPORT = 66, exports.WASI_EPROTOTYPE = 67, exports.WASI_ERANGE = 68, exports.WASI_EROFS = 69, exports.WASI_ESPIPE = 70, exports.WASI_ESRCH = 71, exports.WASI_ESTALE = 72, exports.WASI_ETIMEDOUT = 73, exports.WASI_ETXTBSY = 74, exports.WASI_EXDEV = 75, exports.WASI_ENOTCAPABLE = 76, exports.WASI_SIGABRT = 0, exports.WASI_SIGALRM = 1, exports.WASI_SIGBUS = 2, exports.WASI_SIGCHLD = 3, exports.WASI_SIGCONT = 4, exports.WASI_SIGFPE = 5, exports.WASI_SIGHUP = 6, exports.WASI_SIGILL = 7, exports.WASI_SIGINT = 8, exports.WASI_SIGKILL = 9, exports.WASI_SIGPIPE = 10, exports.WASI_SIGQUIT = 11, exports.WASI_SIGSEGV = 12, exports.WASI_SIGSTOP = 13, exports.WASI_SIGTERM = 14, exports.WASI_SIGTRAP = 15, exports.WASI_SIGTSTP = 16, exports.WASI_SIGTTIN = 17, exports.WASI_SIGTTOU = 18, exports.WASI_SIGURG = 19, exports.WASI_SIGUSR1 = 20, exports.WASI_SIGUSR2 = 21, exports.WASI_SIGVTALRM = 22, exports.WASI_SIGXCPU = 23, exports.WASI_SIGXFSZ = 24, exports.WASI_FILETYPE_UNKNOWN = 0, exports.WASI_FILETYPE_BLOCK_DEVICE = 1, exports.WASI_FILETYPE_CHARACTER_DEVICE = 2, exports.WASI_FILETYPE_DIRECTORY = 3, exports.WASI_FILETYPE_REGULAR_FILE = 4, exports.WASI_FILETYPE_SOCKET_DGRAM = 5, exports.WASI_FILETYPE_SOCKET_STREAM = 6, exports.WASI_FILETYPE_SYMBOLIC_LINK = 7, exports.WASI_FDFLAG_APPEND = 1, exports.WASI_FDFLAG_DSYNC = 2, exports.WASI_FDFLAG_NONBLOCK = 4, exports.WASI_FDFLAG_RSYNC = 8, exports.WASI_FDFLAG_SYNC = 16, exports.WASI_RIGHT_FD_DATASYNC = BigInt(1), exports.WASI_RIGHT_FD_READ = BigInt(2), exports.WASI_RIGHT_FD_SEEK = BigInt(4), exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = BigInt(8), exports.WASI_RIGHT_FD_SYNC = BigInt(16), exports.WASI_RIGHT_FD_TELL = BigInt(32), exports.WASI_RIGHT_FD_WRITE = BigInt(64), exports.WASI_RIGHT_FD_ADVISE = BigInt(128), exports.WASI_RIGHT_FD_ALLOCATE = BigInt(256), exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = BigInt(512), exports.WASI_RIGHT_PATH_CREATE_FILE = BigInt(1024), exports.WASI_RIGHT_PATH_LINK_SOURCE = BigInt(2048), exports.WASI_RIGHT_PATH_LINK_TARGET = BigInt(4096), exports.WASI_RIGHT_PATH_OPEN = BigInt(8192), exports.WASI_RIGHT_FD_READDIR = BigInt(16384), exports.WASI_RIGHT_PATH_READLINK = BigInt(32768), exports.WASI_RIGHT_PATH_RENAME_SOURCE = BigInt(65536), exports.WASI_RIGHT_PATH_RENAME_TARGET = BigInt(131072), exports.WASI_RIGHT_PATH_FILESTAT_GET = BigInt(262144), exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = BigInt(524288), exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = BigInt(1048576), exports.WASI_RIGHT_FD_FILESTAT_GET = BigInt(2097152), exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = BigInt(4194304), exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = BigInt(8388608), exports.WASI_RIGHT_PATH_SYMLINK = BigInt(16777216), exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = BigInt(33554432), exports.WASI_RIGHT_PATH_UNLINK_FILE = BigInt(67108864), exports.WASI_RIGHT_POLL_FD_READWRITE = BigInt(134217728), exports.WASI_RIGHT_SOCK_SHUTDOWN = BigInt(268435456), exports.RIGHTS_ALL = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_REGULAR_FILE_BASE = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_REGULAR_FILE_INHERITING = BigInt(0), exports.RIGHTS_DIRECTORY_BASE = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE | exports.RIGHTS_REGULAR_FILE_BASE, exports.RIGHTS_SOCKET_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_TTY_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_TTY_INHERITING = BigInt(0), exports.WASI_CLOCK_REALTIME = 0, exports.WASI_CLOCK_MONOTONIC = 1, exports.WASI_CLOCK_PROCESS_CPUTIME_ID = 2, exports.WASI_CLOCK_THREAD_CPUTIME_ID = 3, exports.WASI_EVENTTYPE_CLOCK = 0, exports.WASI_EVENTTYPE_FD_READ = 1, exports.WASI_EVENTTYPE_FD_WRITE = 2, exports.WASI_FILESTAT_SET_ATIM = 1 << 0, exports.WASI_FILESTAT_SET_ATIM_NOW = 1 << 1, exports.WASI_FILESTAT_SET_MTIM = 1 << 2, exports.WASI_FILESTAT_SET_MTIM_NOW = 1 << 3, exports.WASI_O_CREAT = 1 << 0, exports.WASI_O_DIRECTORY = 1 << 1, exports.WASI_O_EXCL = 1 << 2, exports.WASI_O_TRUNC = 1 << 3, exports.WASI_PREOPENTYPE_DIR = 0, exports.WASI_DIRCOOKIE_START = 0, exports.WASI_STDIN_FILENO = 0, exports.WASI_STDOUT_FILENO = 1, exports.WASI_STDERR_FILENO = 2, exports.WASI_WHENCE_SET = 0, exports.WASI_WHENCE_CUR = 1, exports.WASI_WHENCE_END = 2, exports.ERROR_MAP = {\n E2BIG: exports.WASI_E2BIG,\n EACCES: exports.WASI_EACCES,\n EADDRINUSE: exports.WASI_EADDRINUSE,\n EADDRNOTAVAIL: exports.WASI_EADDRNOTAVAIL,\n EAFNOSUPPORT: exports.WASI_EAFNOSUPPORT,\n EALREADY: exports.WASI_EALREADY,\n EAGAIN: exports.WASI_EAGAIN,\n EBADF: exports.WASI_EBADF,\n EBADMSG: exports.WASI_EBADMSG,\n EBUSY: exports.WASI_EBUSY,\n ECANCELED: exports.WASI_ECANCELED,\n ECHILD: exports.WASI_ECHILD,\n ECONNABORTED: exports.WASI_ECONNABORTED,\n ECONNREFUSED: exports.WASI_ECONNREFUSED,\n ECONNRESET: exports.WASI_ECONNRESET,\n EDEADLOCK: exports.WASI_EDEADLK,\n EDESTADDRREQ: exports.WASI_EDESTADDRREQ,\n EDOM: exports.WASI_EDOM,\n EDQUOT: exports.WASI_EDQUOT,\n EEXIST: exports.WASI_EEXIST,\n EFAULT: exports.WASI_EFAULT,\n EFBIG: exports.WASI_EFBIG,\n EHOSTDOWN: exports.WASI_EHOSTUNREACH,\n EHOSTUNREACH: exports.WASI_EHOSTUNREACH,\n EIDRM: exports.WASI_EIDRM,\n EILSEQ: exports.WASI_EILSEQ,\n EINPROGRESS: exports.WASI_EINPROGRESS,\n EINTR: exports.WASI_EINTR,\n EINVAL: exports.WASI_EINVAL,\n EIO: exports.WASI_EIO,\n EISCONN: exports.WASI_EISCONN,\n EISDIR: exports.WASI_EISDIR,\n ELOOP: exports.WASI_ELOOP,\n EMFILE: exports.WASI_EMFILE,\n EMLINK: exports.WASI_EMLINK,\n EMSGSIZE: exports.WASI_EMSGSIZE,\n EMULTIHOP: exports.WASI_EMULTIHOP,\n ENAMETOOLONG: exports.WASI_ENAMETOOLONG,\n ENETDOWN: exports.WASI_ENETDOWN,\n ENETRESET: exports.WASI_ENETRESET,\n ENETUNREACH: exports.WASI_ENETUNREACH,\n ENFILE: exports.WASI_ENFILE,\n ENOBUFS: exports.WASI_ENOBUFS,\n ENODEV: exports.WASI_ENODEV,\n ENOENT: exports.WASI_ENOENT,\n ENOEXEC: exports.WASI_ENOEXEC,\n ENOLCK: exports.WASI_ENOLCK,\n ENOLINK: exports.WASI_ENOLINK,\n ENOMEM: exports.WASI_ENOMEM,\n ENOMSG: exports.WASI_ENOMSG,\n ENOPROTOOPT: exports.WASI_ENOPROTOOPT,\n ENOSPC: exports.WASI_ENOSPC,\n ENOSYS: exports.WASI_ENOSYS,\n ENOTCONN: exports.WASI_ENOTCONN,\n ENOTDIR: exports.WASI_ENOTDIR,\n ENOTEMPTY: exports.WASI_ENOTEMPTY,\n ENOTRECOVERABLE: exports.WASI_ENOTRECOVERABLE,\n ENOTSOCK: exports.WASI_ENOTSOCK,\n ENOTTY: exports.WASI_ENOTTY,\n ENXIO: exports.WASI_ENXIO,\n EOVERFLOW: exports.WASI_EOVERFLOW,\n EOWNERDEAD: exports.WASI_EOWNERDEAD,\n EPERM: exports.WASI_EPERM,\n EPIPE: exports.WASI_EPIPE,\n EPROTO: exports.WASI_EPROTO,\n EPROTONOSUPPORT: exports.WASI_EPROTONOSUPPORT,\n EPROTOTYPE: exports.WASI_EPROTOTYPE,\n ERANGE: exports.WASI_ERANGE,\n EROFS: exports.WASI_EROFS,\n ESPIPE: exports.WASI_ESPIPE,\n ESRCH: exports.WASI_ESRCH,\n ESTALE: exports.WASI_ESTALE,\n ETIMEDOUT: exports.WASI_ETIMEDOUT,\n ETXTBSY: exports.WASI_ETXTBSY,\n EXDEV: exports.WASI_EXDEV\n }, exports.SIGNAL_MAP = {\n [exports.WASI_SIGHUP]: \"SIGHUP\",\n [exports.WASI_SIGINT]: \"SIGINT\",\n [exports.WASI_SIGQUIT]: \"SIGQUIT\",\n [exports.WASI_SIGILL]: \"SIGILL\",\n [exports.WASI_SIGTRAP]: \"SIGTRAP\",\n [exports.WASI_SIGABRT]: \"SIGABRT\",\n [exports.WASI_SIGBUS]: \"SIGBUS\",\n [exports.WASI_SIGFPE]: \"SIGFPE\",\n [exports.WASI_SIGKILL]: \"SIGKILL\",\n [exports.WASI_SIGUSR1]: \"SIGUSR1\",\n [exports.WASI_SIGSEGV]: \"SIGSEGV\",\n [exports.WASI_SIGUSR2]: \"SIGUSR2\",\n [exports.WASI_SIGPIPE]: \"SIGPIPE\",\n [exports.WASI_SIGALRM]: \"SIGALRM\",\n [exports.WASI_SIGTERM]: \"SIGTERM\",\n [exports.WASI_SIGCHLD]: \"SIGCHLD\",\n [exports.WASI_SIGCONT]: \"SIGCONT\",\n [exports.WASI_SIGSTOP]: \"SIGSTOP\",\n [exports.WASI_SIGTSTP]: \"SIGTSTP\",\n [exports.WASI_SIGTTIN]: \"SIGTTIN\",\n [exports.WASI_SIGTTOU]: \"SIGTTOU\",\n [exports.WASI_SIGURG]: \"SIGURG\",\n [exports.WASI_SIGXCPU]: \"SIGXCPU\",\n [exports.WASI_SIGXFSZ]: \"SIGXFSZ\",\n [exports.WASI_SIGVTALRM]: \"SIGVTALRM\"\n };\n }\n}), require_wasi = __commonJS({\n \"node_modules/wasi-js/dist/wasi.js\"(exports) {\n var __importDefault = exports && exports.__importDefault || function(mod) {\n return mod && mod.__esModule \? mod : { default: mod };\n };\n let fs;\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.SOCKET_DEFAULT_RIGHTS = void 0;\n var log = () => {\n }, logOpen = () => {\n }, SC_OPEN_MAX = 32768, types_1 = require_types(), constants_1 = require_constants(), STDIN_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDOUT_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDERR_DEFAULT_RIGHTS = STDOUT_DEFAULT_RIGHTS;\n exports.SOCKET_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE | constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS;\n var msToNs = (ms) => {\n const msInt = Math.trunc(ms), decimal = BigInt(Math.round((ms - msInt) * 1e6));\n return BigInt(msInt) * BigInt(1e6) + decimal;\n }, nsToMs = (ns) => {\n if (typeof ns === \"number\")\n ns = Math.trunc(ns);\n const nsInt = BigInt(ns);\n return Number(nsInt / BigInt(1e6));\n }, wrap = (f) => (...args) => {\n try {\n return f(...args);\n } catch (err) {\n let e = err;\n while (e.prev != null)\n e = e.prev;\n if (e\?.code && typeof e\?.code === \"string\")\n return constants_1.ERROR_MAP[e.code] || constants_1.WASI_EINVAL;\n if (e instanceof types_1.WASIError)\n return e.errno;\n throw e;\n }\n }, stat = (wasi, fd) => {\n const entry = wasi.FD_MAP.get(fd);\n if (!entry)\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n if (entry.filetype === void 0) {\n const stats = wasi.fstatSync(entry.real), { filetype, rightsBase, rightsInheriting } = translateFileAttributes(wasi, fd, stats);\n if (entry.filetype = filetype, !entry.rights)\n entry.rights = {\n base: rightsBase,\n inheriting: rightsInheriting\n };\n }\n return entry;\n }, translateFileAttributes = (wasi, fd, stats) => {\n switch (!0) {\n case stats.isBlockDevice():\n return {\n filetype: constants_1.WASI_FILETYPE_BLOCK_DEVICE,\n rightsBase: constants_1.RIGHTS_BLOCK_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_BLOCK_DEVICE_INHERITING\n };\n case stats.isCharacterDevice(): {\n const filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n if (fd !== void 0 && wasi.bindings.isTTY(fd))\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_TTY_BASE,\n rightsInheriting: constants_1.RIGHTS_TTY_INHERITING\n };\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_CHARACTER_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_CHARACTER_DEVICE_INHERITING\n };\n }\n case stats.isDirectory():\n return {\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rightsBase: constants_1.RIGHTS_DIRECTORY_BASE,\n rightsInheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n };\n case stats.isFIFO():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isFile():\n return {\n filetype: constants_1.WASI_FILETYPE_REGULAR_FILE,\n rightsBase: constants_1.RIGHTS_REGULAR_FILE_BASE,\n rightsInheriting: constants_1.RIGHTS_REGULAR_FILE_INHERITING\n };\n case stats.isSocket():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isSymbolicLink():\n return {\n filetype: constants_1.WASI_FILETYPE_SYMBOLIC_LINK,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n default:\n return {\n filetype: constants_1.WASI_FILETYPE_UNKNOWN,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n }\n }, warnedAboutSleep = !1, defaultConfig;\n function getDefaults() {\n if (defaultConfig)\n return defaultConfig;\n const defaultBindings = {\n hrtime: () => process.hrtime.bigint(),\n exit: (code) => {\n process.exit(code);\n },\n kill: (signal) => {\n process.kill(process.pid, signal);\n },\n randomFillSync: (array) => crypto.getRandomValues(array),\n isTTY: (fd) => (@getInternalField(@internalModuleRegistry, 46) || @createInternalModuleById(46)).isatty(fd),\n fs: Bun.fs(),\n path: @getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30)\n };\n return defaultConfig = {\n args: [],\n env: {},\n preopens: {},\n bindings: defaultBindings,\n sleep: (ms) => {\n Bun.sleepSync(ms);\n }\n };\n }\n var WASI = class WASI2 {\n constructor(wasiConfig = {}) {\n const defaultConfig2 = getDefaults();\n this.lastStdin = 0, this.sleep = wasiConfig.sleep || defaultConfig2.sleep, this.getStdin = wasiConfig.getStdin, this.sendStdout = wasiConfig.sendStdout, this.sendStderr = wasiConfig.sendStderr;\n let preopens = wasiConfig.preopens \?\? defaultConfig2.preopens;\n this.env = wasiConfig.env \?\? defaultConfig2.env;\n const args = wasiConfig.args \?\? defaultConfig2.args;\n this.memory = void 0, this.view = void 0, this.bindings = wasiConfig.bindings || defaultConfig2.bindings;\n const bindings2 = this.bindings;\n fs = bindings2.fs, this.FD_MAP = new Map([\n [\n constants_1.WASI_STDIN_FILENO,\n {\n real: 0,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdin\"\n }\n ],\n [\n constants_1.WASI_STDOUT_FILENO,\n {\n real: 1,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDOUT_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdout\"\n }\n ],\n [\n constants_1.WASI_STDERR_FILENO,\n {\n real: 2,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDERR_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stderr\"\n }\n ]\n ]);\n const path = bindings2.path;\n for (let [k, v] of Object.entries(preopens)) {\n const real = fs.openSync(v, nodeFsConstants.O_RDONLY), newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real,\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rights: {\n base: constants_1.RIGHTS_DIRECTORY_BASE,\n inheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n },\n fakePath: k,\n path: v\n });\n }\n const getiovs = (iovs, iovsLen) => {\n this.refreshMemory();\n const { view, memory } = this, { buffer } = memory, { byteLength } = buffer;\n if (iovsLen === 1) {\n const ptr = iovs, buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n return [new @Uint8Array(buffer, buf, bufLen)];\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n const buffers = [];\n buffers.length = iovsLen;\n for (let i = 0, ptr = iovs;i < iovsLen; i++, ptr += 8) {\n const buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n buffers[i] = new @Uint8Array(buffer, buf, bufLen);\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n return buffers;\n }, CHECK_FD = (fd, rights) => {\n const stats = stat(this, fd);\n if (rights !== BigInt(0) && (stats.rights.base & rights) === BigInt(0))\n throw new types_1.WASIError(constants_1.WASI_EPERM);\n return stats;\n }, CPUTIME_START = Bun.nanoseconds(), timeOrigin = Math.trunc(performance.timeOrigin * 1e6), now = (clockId) => {\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n return Bun.nanoseconds();\n case constants_1.WASI_CLOCK_REALTIME:\n return Bun.nanoseconds() + timeOrigin;\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID:\n return Bun.nanoseconds() - CPUTIME_START;\n default:\n return null;\n }\n };\n if (this.wasiImport = {\n args_get: (argv, argvBuf) => {\n this.refreshMemory();\n let coffset = argv, offset = argvBuf;\n return args.forEach((a) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += @Buffer.from(this.memory.buffer).write(`${a}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n args_sizes_get: (argc, argvBufSize) => {\n this.refreshMemory(), this.view.setUint32(argc, args.length, !0);\n const size = args.reduce((acc, a) => acc + @Buffer.byteLength(a) + 1, 0);\n return this.view.setUint32(argvBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n environ_get: (environ, environBuf) => {\n this.refreshMemory();\n let coffset = environ, offset = environBuf;\n return Object.entries(this.env).forEach(([key, value]) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += @Buffer.from(this.memory.buffer).write(`${key}=${value}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n environ_sizes_get: (environCount, environBufSize) => {\n this.refreshMemory();\n const envProcessed = Object.entries(this.env).map(([key, value]) => `${key}=${value}\\0`), size = envProcessed.reduce((acc, e) => acc + @Buffer.byteLength(e), 0);\n return this.view.setUint32(environCount, envProcessed.length, !0), this.view.setUint32(environBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n clock_res_get: (clockId, resolution) => {\n let res;\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID: {\n res = BigInt(1);\n break;\n }\n case constants_1.WASI_CLOCK_REALTIME: {\n res = BigInt(1000);\n break;\n }\n }\n if (!res)\n throw Error(\"invalid clockId\");\n return this.view.setBigUint64(resolution, res), constants_1.WASI_ESUCCESS;\n },\n clock_time_get: (clockId, _precision, time) => {\n this.refreshMemory();\n const n = now(clockId);\n if (n === null)\n return constants_1.WASI_EINVAL;\n return this.view.setBigUint64(time, BigInt(n), !0), constants_1.WASI_ESUCCESS;\n },\n fd_advise: wrap((fd, _offset, _len, _advice) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ADVISE), constants_1.WASI_ENOSYS;\n }),\n fd_allocate: wrap((fd, _offset, _len) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ALLOCATE), constants_1.WASI_ENOSYS;\n }),\n fd_close: wrap((fd) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return fs.closeSync(stats.real), this.FD_MAP.delete(fd), constants_1.WASI_ESUCCESS;\n }),\n fd_datasync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_DATASYNC);\n return fs.fdatasyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if (this.refreshMemory(), stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), this.view.setUint16(bufPtr + 2, 0, !0), this.view.setUint16(bufPtr + 4, 0, !0), this.view.setBigUint64(bufPtr + 8, BigInt(stats.rights.base), !0), this.view.setBigUint64(bufPtr + 8 + 8, BigInt(stats.rights.inheriting), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_set_flags: wrap((fd, flags) => {\n if (CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS), this.wasiImport.sock_fcntlSetFlags(fd, flags) == 0)\n return constants_1.WASI_ESUCCESS;\n return constants_1.WASI_ENOSYS;\n }),\n fd_fdstat_set_rights: wrap((fd, fsRightsBase, fsRightsInheriting) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if ((stats.rights.base | fsRightsBase) > stats.rights.base)\n return constants_1.WASI_EPERM;\n if ((stats.rights.inheriting | fsRightsInheriting) > stats.rights.inheriting)\n return constants_1.WASI_EPERM;\n return stats.rights.base = fsRightsBase, stats.rights.inheriting = fsRightsInheriting, constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_GET), rstats = this.fstatSync(stats.real);\n if (this.refreshMemory(), this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.atimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.mtimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.ctimeMs), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_size: wrap((fd, stSize) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE);\n return fs.ftruncateSync(stats.real, Number(stSize)), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_times: wrap((fd, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_TIMES), rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n return fs.futimesSync(stats.real, new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), this.view.setUint8(bufPtr, constants_1.WASI_PREOPENTYPE_DIR), this.view.setUint32(bufPtr + 4, @Buffer.byteLength(stats.fakePath \?\? stats.path \?\? \"\"), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_dir_name: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), @Buffer.from(this.memory.buffer).write(stats.fakePath \?\? stats.path \?\? \"\", pathPtr, pathLen, \"utf8\"), constants_1.WASI_ESUCCESS;\n }),\n fd_pwrite: wrap((fd, iovs, iovsLen, offset, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SEEK);\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n let w = 0;\n while (w < iov.byteLength)\n w += fs.writeSync(stats.real, iov, w, iov.byteLength - w, Number(offset) + written + w);\n written += w;\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_write: wrap((fd, iovs, iovsLen, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE), IS_STDOUT = fd == constants_1.WASI_STDOUT_FILENO, IS_STDERR = fd == constants_1.WASI_STDERR_FILENO;\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n if (iov.byteLength == 0)\n return;\n if (IS_STDOUT && this.sendStdout != null)\n this.sendStdout(iov), written += iov.byteLength;\n else if (IS_STDERR && this.sendStderr != null)\n this.sendStderr(iov), written += iov.byteLength;\n else {\n let w = 0;\n while (w < iov.byteLength) {\n const i = fs.writeSync(stats.real, iov, w, iov.byteLength - w, stats.offset \? Number(stats.offset) : null);\n if (stats.offset)\n stats.offset += BigInt(i);\n w += i;\n }\n written += w;\n }\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_pread: wrap((fd, iovs, iovsLen, offset, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SEEK);\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n const length = iov.byteLength - r, rr = fs.readSync(stats.real, iov, r, iov.byteLength - r, Number(offset) + read + r);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n read += r;\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_read: wrap((fd, iovs, iovsLen, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ), IS_STDIN = fd == constants_1.WASI_STDIN_FILENO;\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n let length = iov.byteLength - r, position = IS_STDIN || stats.offset === void 0 \? null : Number(stats.offset), rr = 0;\n if (IS_STDIN)\n if (this.getStdin != null) {\n if (this.stdinBuffer == null)\n this.stdinBuffer = this.getStdin();\n if (this.stdinBuffer != null) {\n if (rr = this.stdinBuffer.copy(iov), rr == this.stdinBuffer.length)\n this.stdinBuffer = void 0;\n else\n this.stdinBuffer = this.stdinBuffer.slice(rr);\n if (rr > 0)\n this.lastStdin = (new Date()).valueOf();\n }\n } else {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(cpu waiting for stdin: please define a way to sleep!) \");\n try {\n rr = fs.readSync(stats.real, iov, r, length, position);\n } catch (_err) {\n }\n if (rr == 0)\n this.shortPause();\n else\n this.lastStdin = (new Date()).valueOf();\n }\n else\n rr = fs.readSync(stats.real, iov, r, length, position);\n if (stats.filetype == constants_1.WASI_FILETYPE_REGULAR_FILE)\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(rr);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_readdir: wrap((fd, bufPtr, bufLen, cookie, bufusedPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READDIR);\n this.refreshMemory();\n const entries = fs.readdirSync(stats.path, { withFileTypes: !0 }), startPtr = bufPtr;\n for (let i = Number(cookie);i < entries.length; i += 1) {\n const entry = entries[i];\n let nameLength = @Buffer.byteLength(entry.name);\n if (bufPtr - startPtr > bufLen)\n break;\n if (this.view.setBigUint64(bufPtr, BigInt(i + 1), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n const rstats = fs.lstatSync(path.resolve(stats.path, entry.name));\n if (this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n if (this.view.setUint32(bufPtr, nameLength, !0), bufPtr += 4, bufPtr - startPtr > bufLen)\n break;\n let filetype;\n switch (!0) {\n case rstats.isBlockDevice():\n filetype = constants_1.WASI_FILETYPE_BLOCK_DEVICE;\n break;\n case rstats.isCharacterDevice():\n filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n break;\n case rstats.isDirectory():\n filetype = constants_1.WASI_FILETYPE_DIRECTORY;\n break;\n case rstats.isFIFO():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isFile():\n filetype = constants_1.WASI_FILETYPE_REGULAR_FILE;\n break;\n case rstats.isSocket():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isSymbolicLink():\n filetype = constants_1.WASI_FILETYPE_SYMBOLIC_LINK;\n break;\n default:\n filetype = constants_1.WASI_FILETYPE_UNKNOWN;\n break;\n }\n if (this.view.setUint8(bufPtr, filetype), bufPtr += 1, bufPtr += 3, bufPtr + nameLength >= startPtr + bufLen)\n break;\n @Buffer.from(this.memory.buffer).write(entry.name, bufPtr), bufPtr += nameLength;\n }\n const bufused = bufPtr - startPtr;\n return this.view.setUint32(bufusedPtr, Math.min(bufused, bufLen), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_renumber: wrap((from, to) => {\n return CHECK_FD(from, BigInt(0)), CHECK_FD(to, BigInt(0)), fs.closeSync(this.FD_MAP.get(from).real), this.FD_MAP.set(from, this.FD_MAP.get(to)), this.FD_MAP.delete(to), constants_1.WASI_ESUCCESS;\n }),\n fd_seek: wrap((fd, offset, whence, newOffsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SEEK);\n switch (this.refreshMemory(), whence) {\n case constants_1.WASI_WHENCE_CUR:\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_END:\n const { size } = this.fstatSync(stats.real);\n stats.offset = BigInt(size) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_SET:\n stats.offset = BigInt(offset);\n break;\n }\n if (stats.offset == null)\n throw Error(\"stats.offset must be defined\");\n return this.view.setBigUint64(newOffsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_tell: wrap((fd, offsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_TELL);\n if (this.refreshMemory(), !stats.offset)\n stats.offset = BigInt(0);\n return this.view.setBigUint64(offsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_sync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SYNC);\n return fs.fsyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n path_create_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_CREATE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.mkdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_get: wrap((fd, flags, pathPtr, pathLen, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_GET);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n let rstats;\n if (flags)\n rstats = fs.statSync(path.resolve(stats.path, p));\n else\n rstats = fs.lstatSync(path.resolve(stats.path, p));\n return this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, this.view.setUint8(bufPtr, translateFileAttributes(this, void 0, rstats).filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.atime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.mtime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ctime.getTime() * 1e6), !0), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_set_times: wrap((fd, _dirflags, pathPtr, pathLen, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.utimesSync(path.resolve(stats.path, p), new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n path_link: wrap((oldFd, _oldFlags, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_LINK_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_LINK_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = @Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = @Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.linkSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_open: wrap((dirfd, _dirflags, pathPtr, pathLen, oflags, fsRightsBase, fsRightsInheriting, fsFlags, fdPtr) => {\n try {\n const stats = CHECK_FD(dirfd, constants_1.WASI_RIGHT_PATH_OPEN);\n fsRightsBase = BigInt(fsRightsBase), fsRightsInheriting = BigInt(fsRightsInheriting);\n const read = (fsRightsBase & (constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_READDIR)) !== BigInt(0), write = (fsRightsBase & (constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ALLOCATE | constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE)) !== BigInt(0);\n let noflags;\n if (write && read)\n noflags = nodeFsConstants.O_RDWR;\n else if (read)\n noflags = nodeFsConstants.O_RDONLY;\n else if (write)\n noflags = nodeFsConstants.O_WRONLY;\n let neededBase = fsRightsBase | constants_1.WASI_RIGHT_PATH_OPEN, neededInheriting = fsRightsBase | fsRightsInheriting;\n if ((oflags & constants_1.WASI_O_CREAT) !== 0)\n noflags |= nodeFsConstants.O_CREAT, neededBase |= constants_1.WASI_RIGHT_PATH_CREATE_FILE;\n if ((oflags & constants_1.WASI_O_DIRECTORY) !== 0)\n noflags |= nodeFsConstants.O_DIRECTORY;\n if ((oflags & constants_1.WASI_O_EXCL) !== 0)\n noflags |= nodeFsConstants.O_EXCL;\n if ((oflags & constants_1.WASI_O_TRUNC) !== 0)\n noflags |= nodeFsConstants.O_TRUNC, neededBase |= constants_1.WASI_RIGHT_PATH_FILESTAT_SET_SIZE;\n if ((fsFlags & constants_1.WASI_FDFLAG_APPEND) !== 0)\n noflags |= nodeFsConstants.O_APPEND;\n if ((fsFlags & constants_1.WASI_FDFLAG_DSYNC) !== 0) {\n if (nodeFsConstants.O_DSYNC)\n noflags |= nodeFsConstants.O_DSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_DATASYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_NONBLOCK) !== 0)\n noflags |= nodeFsConstants.O_NONBLOCK;\n if ((fsFlags & constants_1.WASI_FDFLAG_RSYNC) !== 0) {\n if (nodeFsConstants.O_RSYNC)\n noflags |= nodeFsConstants.O_RSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_SYNC) !== 0)\n noflags |= nodeFsConstants.O_SYNC, neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n if (write && (noflags & (nodeFsConstants.O_APPEND | nodeFsConstants.O_TRUNC)) === 0)\n neededInheriting |= constants_1.WASI_RIGHT_FD_SEEK;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n if (p == \"dev/tty\")\n return this.view.setUint32(fdPtr, constants_1.WASI_STDIN_FILENO, !0), constants_1.WASI_ESUCCESS;\n if (logOpen(\"path_open\", p), p.startsWith(\"proc/\"))\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n const fullUnresolved = path.resolve(p);\n let full;\n try {\n full = fs.realpathSync(fullUnresolved);\n } catch (e) {\n if (e\?.code === \"ENOENT\")\n full = fullUnresolved;\n else\n throw e;\n }\n let isDirectory;\n if (write)\n try {\n isDirectory = fs.statSync(full).isDirectory();\n } catch (_err) {\n }\n let realfd;\n if (!write && isDirectory)\n realfd = fs.openSync(full, nodeFsConstants.O_RDONLY);\n else\n realfd = fs.openSync(full, noflags);\n const newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real: realfd,\n filetype: void 0,\n rights: {\n base: neededBase,\n inheriting: neededInheriting\n },\n path: full\n }), stat(this, newfd), this.view.setUint32(fdPtr, newfd, !0);\n } catch (e) {\n console.error(e);\n }\n return constants_1.WASI_ESUCCESS;\n }),\n path_readlink: wrap((fd, pathPtr, pathLen, buf, bufLen, bufused) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_READLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString(), full = path.resolve(stats.path, p), r = fs.readlinkSync(full), used = @Buffer.from(this.memory.buffer).write(r, buf, bufLen);\n return this.view.setUint32(bufused, used, !0), constants_1.WASI_ESUCCESS;\n }),\n path_remove_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_REMOVE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.rmdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_rename: wrap((oldFd, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_RENAME_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_RENAME_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = @Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = @Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.renameSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_symlink: wrap((oldPath, oldPathLen, fd, newPath, newPathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_SYMLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = @Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = @Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.symlinkSync(op, path.resolve(stats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_unlink_file: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_UNLINK_FILE);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.unlinkSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n poll_oneoff: (sin, sout, nsubscriptions, neventsPtr) => {\n let nevents = 0, name = \"\", waitTimeNs = BigInt(0), fd = -1, fd_type = \"read\", fd_timeout_ms = 0;\n const startNs = BigInt(bindings2.hrtime());\n this.refreshMemory();\n let last_sin = sin;\n for (let i = 0;i < nsubscriptions; i += 1) {\n const userdata = this.view.getBigUint64(sin, !0);\n sin += 8;\n const type = this.view.getUint8(sin);\n if (sin += 1, sin += 7, log.enabled) {\n if (type == constants_1.WASI_EVENTTYPE_CLOCK)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_CLOCK): \";\n else if (type == constants_1.WASI_EVENTTYPE_FD_READ)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_READ): \";\n else\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_WRITE): \";\n log(name);\n }\n switch (type) {\n case constants_1.WASI_EVENTTYPE_CLOCK: {\n const clockid = this.view.getUint32(sin, !0);\n sin += 4, sin += 4;\n const timeout = this.view.getBigUint64(sin, !0);\n sin += 8, sin += 8;\n const subclockflags = this.view.getUint16(sin, !0);\n sin += 2, sin += 6;\n const absolute = subclockflags === 1;\n if (log.enabled)\n log(name, { clockid, timeout, absolute });\n if (!absolute)\n fd_timeout_ms = timeout / BigInt(1e6);\n let e = constants_1.WASI_ESUCCESS;\n const t = now(clockid);\n if (t == null)\n e = constants_1.WASI_EINVAL;\n else {\n const tNS = BigInt(t), waitNs = (absolute \? timeout : tNS + timeout) - tNS;\n if (waitNs > waitTimeNs)\n waitTimeNs = waitNs;\n }\n this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, e, !0), sout += 2, this.view.setUint8(sout, constants_1.WASI_EVENTTYPE_CLOCK), sout += 1, sout += 5, nevents += 1;\n break;\n }\n case constants_1.WASI_EVENTTYPE_FD_READ:\n case constants_1.WASI_EVENTTYPE_FD_WRITE: {\n if (fd = this.view.getUint32(sin, !0), fd_type = type == constants_1.WASI_EVENTTYPE_FD_READ \? \"read\" : \"write\", sin += 4, log(name, \"fd =\", fd), sin += 28, this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, constants_1.WASI_ENOSYS, !0), sout += 2, this.view.setUint8(sout, type), sout += 1, sout += 5, nevents += 1, fd == constants_1.WASI_STDIN_FILENO && constants_1.WASI_EVENTTYPE_FD_READ == type)\n this.shortPause();\n break;\n }\n default:\n return constants_1.WASI_EINVAL;\n }\n if (sin - last_sin != 48)\n console.warn(\"*** BUG in wasi-js in poll_oneoff \", {\n i,\n sin,\n last_sin,\n diff: sin - last_sin\n });\n last_sin = sin;\n }\n if (this.view.setUint32(neventsPtr, nevents, !0), nevents == 2 && fd >= 0) {\n const r = this.wasiImport.sock_pollSocket(fd, fd_type, fd_timeout_ms);\n if (r != constants_1.WASI_ENOSYS)\n return r;\n }\n if (waitTimeNs > 0) {\n if (waitTimeNs -= Bun.nanoseconds() - timeOrigin, waitTimeNs >= 1e6) {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(100% cpu burning waiting for stdin: please define a way to sleep!) \");\n if (this.sleep != null) {\n const ms = nsToMs(waitTimeNs);\n this.sleep(ms);\n } else {\n const end = BigInt(bindings2.hrtime()) + waitTimeNs;\n while (BigInt(bindings2.hrtime()) < end)\n ;\n }\n }\n }\n return constants_1.WASI_ESUCCESS;\n },\n proc_exit: (rval) => {\n return bindings2.exit(rval), constants_1.WASI_ESUCCESS;\n },\n proc_raise: (sig) => {\n if (!(sig in constants_1.SIGNAL_MAP))\n return constants_1.WASI_EINVAL;\n return bindings2.kill(constants_1.SIGNAL_MAP[sig]), constants_1.WASI_ESUCCESS;\n },\n random_get: (bufPtr, bufLen) => {\n return this.refreshMemory(), crypto.getRandomValues(this.memory.buffer, bufPtr, bufLen), bufLen;\n },\n sched_yield() {\n return constants_1.WASI_ESUCCESS;\n },\n sock_recv() {\n return constants_1.WASI_ENOSYS;\n },\n sock_send() {\n return constants_1.WASI_ENOSYS;\n },\n sock_shutdown() {\n return constants_1.WASI_ENOSYS;\n },\n sock_fcntlSetFlags(_fd, _flags) {\n return constants_1.WASI_ENOSYS;\n },\n sock_pollSocket(_fd, _eventtype, _timeout_ms) {\n return constants_1.WASI_ENOSYS;\n }\n }, log.enabled)\n Object.keys(this.wasiImport).forEach((key) => {\n const prevImport = this.wasiImport[key];\n this.wasiImport[key] = function(...args2) {\n log(key, args2);\n try {\n let result = prevImport(...args2);\n return log(\"result\", result), result;\n } catch (e) {\n throw log(\"error: \", e), e;\n }\n };\n });\n }\n getState() {\n return { env: this.env, FD_MAP: this.FD_MAP, bindings };\n }\n setState(state) {\n this.env = state.env, this.FD_MAP = state.FD_MAP, bindings = state.bindings;\n }\n fstatSync(real_fd) {\n if (real_fd <= 2)\n try {\n return fs.fstatSync(real_fd);\n } catch (_) {\n const now = new Date;\n return {\n dev: 0,\n mode: 8592,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n blksize: 65536,\n ino: 0,\n size: 0,\n blocks: 0,\n atimeMs: now.valueOf(),\n mtimeMs: now.valueOf(),\n ctimeMs: now.valueOf(),\n birthtimeMs: 0,\n atime: new Date,\n mtime: new Date,\n ctime: new Date,\n birthtime: new Date(0)\n };\n }\n return fs.fstatSync(real_fd);\n }\n shortPause() {\n if (this.sleep == null)\n return;\n if ((new Date()).valueOf() - this.lastStdin > 2000)\n this.sleep(50);\n }\n getUnusedFileDescriptor(start = 3) {\n let fd = start;\n while (this.FD_MAP.has(fd))\n fd += 1;\n if (fd > SC_OPEN_MAX)\n throw Error(\"no available file descriptors\");\n return fd;\n }\n refreshMemory() {\n if (!this.view || this.view.buffer.byteLength === 0)\n this.view = new DataView(this.memory.buffer);\n }\n setMemory(memory) {\n this.memory = memory;\n }\n start(instance, memory) {\n const exports2 = instance.exports;\n if (exports2 === null || typeof exports2 !== \"object\")\n throw new Error(`instance.exports must be an Object. Received ${exports2}.`);\n if (memory == null) {\n if (memory = exports2.memory, !(memory instanceof WebAssembly.Memory))\n throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${memory}.`);\n }\n if (this.setMemory(memory), exports2._start)\n exports2._start();\n }\n getImports(module2) {\n let namespace = null;\n const imports = WebAssembly.Module.imports(module2);\n for (let imp of imports) {\n if (imp.kind !== \"function\")\n continue;\n if (!imp.module.startsWith(\"wasi_\"))\n continue;\n namespace = imp.module;\n break;\n }\n switch (namespace) {\n case \"wasi_unstable\":\n return {\n wasi_unstable: this.wasiImport\n };\n case \"wasi_snapshot_preview1\":\n return {\n wasi_snapshot_preview1: this.wasiImport\n };\n default:\n throw new Error(\"No WASI namespace found. Only wasi_unstable and wasi_snapshot_preview1 are supported.\\n\\nList of imports:\\n\\n\" + imports.map(({ name, kind, module }) => `${module}:${name} (${kind})`).join(\"\\n\") + \"\\n\");\n }\n }\n initWasiFdInfo() {\n if (this.env.WASI_FD_INFO != null) {\n const fdInfo = JSON.parse(this.env.WASI_FD_INFO);\n for (let wasi_fd in fdInfo) {\n console.log(wasi_fd);\n const fd = parseInt(wasi_fd);\n if (this.FD_MAP.has(fd))\n continue;\n const real = fdInfo[wasi_fd];\n try {\n this.fstatSync(real);\n } catch (_err) {\n console.log(\"discarding \", { wasi_fd, real });\n continue;\n }\n const file = {\n real,\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n }\n };\n this.FD_MAP.set(fd, file);\n }\n console.log(\"after initWasiFdInfo: \", this.FD_MAP), console.log(\"fdInfo = \", fdInfo);\n } else\n console.log(\"no WASI_FD_INFO\");\n }\n };\n exports.default = WASI;\n }\n});\nreturn { WASI: require_wasi().default }})\n");
//
//
-static constexpr ASCIILiteral NodeZlibCode = "(function (){\"use strict\";// src/js/out/tmp/node/zlib.ts\nvar assert = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), BufferModule = @requireNativeModule(\"buffer\"), StreamModule = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), Util = @getInternalField(@internalModuleRegistry, 46) || @createInternalModuleById(46), __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_zstream = __commonJS({\n \"node_modules/pako/lib/zlib/zstream.js\"(exports, module2) {\n function ZStream() {\n this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = \"\", this.state = null, this.data_type = 2, this.adler = 0;\n }\n module2.exports = ZStream;\n }\n}), require_common = __commonJS({\n \"node_modules/pako/lib/utils/common.js\"(exports) {\n var TYPED_OK = typeof Uint8Array !== \"undefined\" && typeof Uint16Array !== \"undefined\" && typeof Int32Array !== \"undefined\";\n function _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n }\n exports.assign = function(obj) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source)\n continue;\n if (typeof source !== \"object\")\n @throwTypeError(source + \"must be non-object\");\n for (var p in source)\n if (_has(source, p))\n obj[p] = source[p];\n }\n return obj;\n }, exports.shrinkBuf = function(buf, size) {\n if (buf.length === size)\n return buf;\n if (buf.subarray)\n return buf.subarray(0, size);\n return buf.length = size, buf;\n };\n var fnTyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n var i, l, len, pos, chunk, result;\n len = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n len += chunks[i].length;\n result = new Uint8Array(len), pos = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n chunk = chunks[i], result.set(chunk, pos), pos += chunk.length;\n return result;\n }\n }, fnUntyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n return [].concat.apply([], chunks);\n }\n };\n exports.setTyped = function(on) {\n if (on)\n exports.Buf8 = Uint8Array, exports.Buf16 = Uint16Array, exports.Buf32 = Int32Array, exports.assign(exports, fnTyped);\n else\n exports.Buf8 = Array, exports.Buf16 = Array, exports.Buf32 = Array, exports.assign(exports, fnUntyped);\n }, exports.setTyped(TYPED_OK);\n }\n}), require_trees = __commonJS({\n \"node_modules/pako/lib/zlib/trees.js\"(exports) {\n var utils = require_common(), Z_FIXED = 4, Z_BINARY = 0, Z_TEXT = 1, Z_UNKNOWN = 2;\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n var STORED_BLOCK = 0, STATIC_TREES = 1, DYN_TREES = 2, MIN_MATCH = 3, MAX_MATCH = 258, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, Buf_size = 16, MAX_BL_BITS = 7, END_BLOCK = 256, REP_3_6 = 16, REPZ_3_10 = 17, REPZ_11_138 = 18, extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], extra_dbits = [\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 4,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 8,\n 8,\n 9,\n 9,\n 10,\n 10,\n 11,\n 11,\n 12,\n 12,\n 13,\n 13\n ], extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], DIST_CODE_LEN = 512, static_ltree = new Array((L_CODES + 2) * 2);\n zero(static_ltree);\n var static_dtree = new Array(D_CODES * 2);\n zero(static_dtree);\n var _dist_code = new Array(DIST_CODE_LEN);\n zero(_dist_code);\n var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\n zero(_length_code);\n var base_length = new Array(LENGTH_CODES);\n zero(base_length);\n var base_dist = new Array(D_CODES);\n zero(base_dist);\n function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree, this.extra_bits = extra_bits, this.extra_base = extra_base, this.elems = elems, this.max_length = max_length, this.has_stree = static_tree && static_tree.length;\n }\n var static_l_desc, static_d_desc, static_bl_desc;\n function TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree, this.max_code = 0, this.stat_desc = stat_desc;\n }\n function d_code(dist) {\n return dist < 256 \? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n }\n function put_short(s, w) {\n s.pending_buf[s.pending++] = w & 255, s.pending_buf[s.pending++] = w >>> 8 & 255;\n }\n function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length)\n s.bi_buf |= value << s.bi_valid & 65535, put_short(s, s.bi_buf), s.bi_buf = value >> Buf_size - s.bi_valid, s.bi_valid += length - Buf_size;\n else\n s.bi_buf |= value << s.bi_valid & 65535, s.bi_valid += length;\n }\n function send_code(s, c, tree) {\n send_bits(s, tree[c * 2], tree[c * 2 + 1]);\n }\n function bi_reverse(code, len) {\n var res = 0;\n do\n res |= code & 1, code >>>= 1, res <<= 1;\n while (--len > 0);\n return res >>> 1;\n }\n function bi_flush(s) {\n if (s.bi_valid === 16)\n put_short(s, s.bi_buf), s.bi_buf = 0, s.bi_valid = 0;\n else if (s.bi_valid >= 8)\n s.pending_buf[s.pending++] = s.bi_buf & 255, s.bi_buf >>= 8, s.bi_valid -= 8;\n }\n function gen_bitlen(s, desc) {\n var { dyn_tree: tree, max_code } = desc, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, extra = desc.stat_desc.extra_bits, base = desc.stat_desc.extra_base, max_length = desc.stat_desc.max_length, h, n, m, bits, xbits, f, overflow = 0;\n for (bits = 0;bits <= MAX_BITS; bits++)\n s.bl_count[bits] = 0;\n tree[s.heap[s.heap_max] * 2 + 1] = 0;\n for (h = s.heap_max + 1;h < HEAP_SIZE; h++) {\n if (n = s.heap[h], bits = tree[tree[n * 2 + 1] * 2 + 1] + 1, bits > max_length)\n bits = max_length, overflow++;\n if (tree[n * 2 + 1] = bits, n > max_code)\n continue;\n if (s.bl_count[bits]++, xbits = 0, n >= base)\n xbits = extra[n - base];\n if (f = tree[n * 2], s.opt_len += f * (bits + xbits), has_stree)\n s.static_len += f * (stree[n * 2 + 1] + xbits);\n }\n if (overflow === 0)\n return;\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0)\n bits--;\n s.bl_count[bits]--, s.bl_count[bits + 1] += 2, s.bl_count[max_length]--, overflow -= 2;\n } while (overflow > 0);\n for (bits = max_length;bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n if (m = s.heap[--h], m > max_code)\n continue;\n if (tree[m * 2 + 1] !== bits)\n s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2], tree[m * 2 + 1] = bits;\n n--;\n }\n }\n }\n function gen_codes(tree, max_code, bl_count) {\n var next_code = new Array(MAX_BITS + 1), code = 0, bits, n;\n for (bits = 1;bits <= MAX_BITS; bits++)\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n for (n = 0;n <= max_code; n++) {\n var len = tree[n * 2 + 1];\n if (len === 0)\n continue;\n tree[n * 2] = bi_reverse(next_code[len]++, len);\n }\n }\n function tr_static_init() {\n var n, bits, length, code, dist, bl_count = new Array(MAX_BITS + 1);\n length = 0;\n for (code = 0;code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0;n < 1 << extra_lbits[code]; n++)\n _length_code[length++] = code;\n }\n _length_code[length - 1] = code, dist = 0;\n for (code = 0;code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0;n < 1 << extra_dbits[code]; n++)\n _dist_code[dist++] = code;\n }\n dist >>= 7;\n for (;code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0;n < 1 << extra_dbits[code] - 7; n++)\n _dist_code[256 + dist++] = code;\n }\n for (bits = 0;bits <= MAX_BITS; bits++)\n bl_count[bits] = 0;\n n = 0;\n while (n <= 143)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n while (n <= 255)\n static_ltree[n * 2 + 1] = 9, n++, bl_count[9]++;\n while (n <= 279)\n static_ltree[n * 2 + 1] = 7, n++, bl_count[7]++;\n while (n <= 287)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n for (n = 0;n < D_CODES; n++)\n static_dtree[n * 2 + 1] = 5, static_dtree[n * 2] = bi_reverse(n, 5);\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS), static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS), static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n }\n function init_block(s) {\n var n;\n for (n = 0;n < L_CODES; n++)\n s.dyn_ltree[n * 2] = 0;\n for (n = 0;n < D_CODES; n++)\n s.dyn_dtree[n * 2] = 0;\n for (n = 0;n < BL_CODES; n++)\n s.bl_tree[n * 2] = 0;\n s.dyn_ltree[END_BLOCK * 2] = 1, s.opt_len = s.static_len = 0, s.last_lit = s.matches = 0;\n }\n function bi_windup(s) {\n if (s.bi_valid > 8)\n put_short(s, s.bi_buf);\n else if (s.bi_valid > 0)\n s.pending_buf[s.pending++] = s.bi_buf;\n s.bi_buf = 0, s.bi_valid = 0;\n }\n function copy_block(s, buf, len, header) {\n if (bi_windup(s), header)\n put_short(s, len), put_short(s, ~len);\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending), s.pending += len;\n }\n function smaller(tree, n, m, depth) {\n var _n2 = n * 2, _m2 = m * 2;\n return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];\n }\n function pqdownheap(s, tree, k) {\n var v = s.heap[k], j = k << 1;\n while (j <= s.heap_len) {\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth))\n j++;\n if (smaller(tree, v, s.heap[j], s.depth))\n break;\n s.heap[k] = s.heap[j], k = j, j <<= 1;\n }\n s.heap[k] = v;\n }\n function compress_block(s, ltree, dtree) {\n var dist, lc, lx = 0, code, extra;\n if (s.last_lit !== 0)\n do\n if (dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1], lc = s.pending_buf[s.l_buf + lx], lx++, dist === 0)\n send_code(s, lc, ltree);\n else {\n if (code = _length_code[lc], send_code(s, code + LITERALS + 1, ltree), extra = extra_lbits[code], extra !== 0)\n lc -= base_length[code], send_bits(s, lc, extra);\n if (dist--, code = d_code(dist), send_code(s, code, dtree), extra = extra_dbits[code], extra !== 0)\n dist -= base_dist[code], send_bits(s, dist, extra);\n }\n while (lx < s.last_lit);\n send_code(s, END_BLOCK, ltree);\n }\n function build_tree(s, desc) {\n var tree = desc.dyn_tree, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, elems = desc.stat_desc.elems, n, m, max_code = -1, node;\n s.heap_len = 0, s.heap_max = HEAP_SIZE;\n for (n = 0;n < elems; n++)\n if (tree[n * 2] !== 0)\n s.heap[++s.heap_len] = max_code = n, s.depth[n] = 0;\n else\n tree[n * 2 + 1] = 0;\n while (s.heap_len < 2)\n if (node = s.heap[++s.heap_len] = max_code < 2 \? ++max_code : 0, tree[node * 2] = 1, s.depth[node] = 0, s.opt_len--, has_stree)\n s.static_len -= stree[node * 2 + 1];\n desc.max_code = max_code;\n for (n = s.heap_len >> 1;n >= 1; n--)\n pqdownheap(s, tree, n);\n node = elems;\n do\n n = s.heap[1], s.heap[1] = s.heap[s.heap_len--], pqdownheap(s, tree, 1), m = s.heap[1], s.heap[--s.heap_max] = n, s.heap[--s.heap_max] = m, tree[node * 2] = tree[n * 2] + tree[m * 2], s.depth[node] = (s.depth[n] >= s.depth[m] \? s.depth[n] : s.depth[m]) + 1, tree[n * 2 + 1] = tree[m * 2 + 1] = node, s.heap[1] = node++, pqdownheap(s, tree, 1);\n while (s.heap_len >= 2);\n s.heap[--s.heap_max] = s.heap[1], gen_bitlen(s, desc), gen_codes(tree, max_code, s.bl_count);\n }\n function scan_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n tree[(max_code + 1) * 2 + 1] = 65535;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n s.bl_tree[curlen * 2] += count;\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n s.bl_tree[curlen * 2]++;\n s.bl_tree[REP_3_6 * 2]++;\n } else if (count <= 10)\n s.bl_tree[REPZ_3_10 * 2]++;\n else\n s.bl_tree[REPZ_11_138 * 2]++;\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function send_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n do\n send_code(s, curlen, s.bl_tree);\n while (--count !== 0);\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n send_code(s, curlen, s.bl_tree), count--;\n send_code(s, REP_3_6, s.bl_tree), send_bits(s, count - 3, 2);\n } else if (count <= 10)\n send_code(s, REPZ_3_10, s.bl_tree), send_bits(s, count - 3, 3);\n else\n send_code(s, REPZ_11_138, s.bl_tree), send_bits(s, count - 11, 7);\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function build_bl_tree(s) {\n var max_blindex;\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code), scan_tree(s, s.dyn_dtree, s.d_desc.max_code), build_tree(s, s.bl_desc);\n for (max_blindex = BL_CODES - 1;max_blindex >= 3; max_blindex--)\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0)\n break;\n return s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4, max_blindex;\n }\n function send_all_trees(s, lcodes, dcodes, blcodes) {\n var rank;\n send_bits(s, lcodes - 257, 5), send_bits(s, dcodes - 1, 5), send_bits(s, blcodes - 4, 4);\n for (rank = 0;rank < blcodes; rank++)\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);\n send_tree(s, s.dyn_ltree, lcodes - 1), send_tree(s, s.dyn_dtree, dcodes - 1);\n }\n function detect_data_type(s) {\n var black_mask = 4093624447, n;\n for (n = 0;n <= 31; n++, black_mask >>>= 1)\n if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0)\n return Z_BINARY;\n if (s.dyn_ltree[18] !== 0 || s.dyn_ltree[20] !== 0 || s.dyn_ltree[26] !== 0)\n return Z_TEXT;\n for (n = 32;n < LITERALS; n++)\n if (s.dyn_ltree[n * 2] !== 0)\n return Z_TEXT;\n return Z_BINARY;\n }\n var static_init_done = !1;\n function _tr_init(s) {\n if (!static_init_done)\n tr_static_init(), static_init_done = !0;\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc), s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc), s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc), s.bi_buf = 0, s.bi_valid = 0, init_block(s);\n }\n function _tr_stored_block(s, buf, stored_len, last) {\n send_bits(s, (STORED_BLOCK << 1) + (last \? 1 : 0), 3), copy_block(s, buf, stored_len, !0);\n }\n function _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3), send_code(s, END_BLOCK, static_ltree), bi_flush(s);\n }\n function _tr_flush_block(s, buf, stored_len, last) {\n var opt_lenb, static_lenb, max_blindex = 0;\n if (s.level > 0) {\n if (s.strm.data_type === Z_UNKNOWN)\n s.strm.data_type = detect_data_type(s);\n if (build_tree(s, s.l_desc), build_tree(s, s.d_desc), max_blindex = build_bl_tree(s), opt_lenb = s.opt_len + 3 + 7 >>> 3, static_lenb = s.static_len + 3 + 7 >>> 3, static_lenb <= opt_lenb)\n opt_lenb = static_lenb;\n } else\n opt_lenb = static_lenb = stored_len + 5;\n if (stored_len + 4 <= opt_lenb && buf !== -1)\n _tr_stored_block(s, buf, stored_len, last);\n else if (s.strategy === Z_FIXED || static_lenb === opt_lenb)\n send_bits(s, (STATIC_TREES << 1) + (last \? 1 : 0), 3), compress_block(s, static_ltree, static_dtree);\n else\n send_bits(s, (DYN_TREES << 1) + (last \? 1 : 0), 3), send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1), compress_block(s, s.dyn_ltree, s.dyn_dtree);\n if (init_block(s), last)\n bi_windup(s);\n }\n function _tr_tally(s, dist, lc) {\n if (s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255, s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255, s.pending_buf[s.l_buf + s.last_lit] = lc & 255, s.last_lit++, dist === 0)\n s.dyn_ltree[lc * 2]++;\n else\n s.matches++, dist--, s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++, s.dyn_dtree[d_code(dist) * 2]++;\n return s.last_lit === s.lit_bufsize - 1;\n }\n exports._tr_init = _tr_init, exports._tr_stored_block = _tr_stored_block, exports._tr_flush_block = _tr_flush_block, exports._tr_tally = _tr_tally, exports._tr_align = _tr_align;\n }\n}), require_adler32 = __commonJS({\n \"node_modules/pako/lib/zlib/adler32.js\"(exports, module2) {\n function adler32(adler, buf, len, pos) {\n var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;\n while (len !== 0) {\n n = len > 2000 \? 2000 : len, len -= n;\n do\n s1 = s1 + buf[pos++] | 0, s2 = s2 + s1 | 0;\n while (--n);\n s1 %= 65521, s2 %= 65521;\n }\n return s1 | s2 << 16 | 0;\n }\n module2.exports = adler32;\n }\n}), require_crc32 = __commonJS({\n \"node_modules/pako/lib/zlib/crc32.js\"(exports, module2) {\n function makeTable() {\n var c, table = [];\n for (var n = 0;n < 256; n++) {\n c = n;\n for (var k = 0;k < 8; k++)\n c = c & 1 \? 3988292384 ^ c >>> 1 : c >>> 1;\n table[n] = c;\n }\n return table;\n }\n var crcTable = makeTable();\n function crc32(crc, buf, len, pos) {\n var t = crcTable, end = pos + len;\n crc ^= -1;\n for (var i = pos;i < end; i++)\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];\n return crc ^ -1;\n }\n module2.exports = crc32;\n }\n}), require_messages = __commonJS({\n \"node_modules/pako/lib/zlib/messages.js\"(exports, module2) {\n module2.exports = {\n 2: \"need dictionary\",\n 1: \"stream end\",\n 0: \"\",\n \"-1\": \"file error\",\n \"-2\": \"stream error\",\n \"-3\": \"data error\",\n \"-4\": \"insufficient memory\",\n \"-5\": \"buffer error\",\n \"-6\": \"incompatible version\"\n };\n }\n}), require_deflate = __commonJS({\n \"node_modules/pako/lib/zlib/deflate.js\"(exports) {\n var utils = require_common(), trees = require_trees(), adler32 = require_adler32(), crc32 = require_crc32(), msg = require_messages(), Z_NO_FLUSH = 0, Z_PARTIAL_FLUSH = 1, Z_FULL_FLUSH = 3, Z_FINISH = 4, Z_BLOCK = 5, Z_OK = 0, Z_STREAM_END = 1, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_BUF_ERROR = -5, Z_DEFAULT_COMPRESSION = -1, Z_FILTERED = 1, Z_HUFFMAN_ONLY = 2, Z_RLE = 3, Z_FIXED = 4, Z_DEFAULT_STRATEGY = 0, Z_UNKNOWN = 2, Z_DEFLATED = 8, MAX_MEM_LEVEL = 9, MAX_WBITS = 15, DEF_MEM_LEVEL = 8, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, MIN_MATCH = 3, MAX_MATCH = 258, MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, PRESET_DICT = 32, INIT_STATE = 42, EXTRA_STATE = 69, NAME_STATE = 73, COMMENT_STATE = 91, HCRC_STATE = 103, BUSY_STATE = 113, FINISH_STATE = 666, BS_NEED_MORE = 1, BS_BLOCK_DONE = 2, BS_FINISH_STARTED = 3, BS_FINISH_DONE = 4, OS_CODE = 3;\n function err(strm, errorCode) {\n return strm.msg = msg[errorCode], errorCode;\n }\n function rank(f) {\n return (f << 1) - (f > 4 \? 9 : 0);\n }\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n function flush_pending(strm) {\n var s = strm.state, len = s.pending;\n if (len > strm.avail_out)\n len = strm.avail_out;\n if (len === 0)\n return;\n if (utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out), strm.next_out += len, s.pending_out += len, strm.total_out += len, strm.avail_out -= len, s.pending -= len, s.pending === 0)\n s.pending_out = 0;\n }\n function flush_block_only(s, last) {\n trees._tr_flush_block(s, s.block_start >= 0 \? s.block_start : -1, s.strstart - s.block_start, last), s.block_start = s.strstart, flush_pending(s.strm);\n }\n function put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n }\n function putShortMSB(s, b) {\n s.pending_buf[s.pending++] = b >>> 8 & 255, s.pending_buf[s.pending++] = b & 255;\n }\n function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n if (len > size)\n len = size;\n if (len === 0)\n return 0;\n if (strm.avail_in -= len, utils.arraySet(buf, strm.input, strm.next_in, len, start), strm.state.wrap === 1)\n strm.adler = adler32(strm.adler, buf, len, start);\n else if (strm.state.wrap === 2)\n strm.adler = crc32(strm.adler, buf, len, start);\n return strm.next_in += len, strm.total_in += len, len;\n }\n function longest_match(s, cur_match) {\n var { max_chain_length: chain_length, strstart: scan } = s, match, len, best_len = s.prev_length, nice_match = s.nice_match, limit = s.strstart > s.w_size - MIN_LOOKAHEAD \? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0, _win = s.window, wmask = s.w_mask, prev = s.prev, strend = s.strstart + MAX_MATCH, scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n if (s.prev_length >= s.good_match)\n chain_length >>= 2;\n if (nice_match > s.lookahead)\n nice_match = s.lookahead;\n do {\n if (match = cur_match, _win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1])\n continue;\n scan += 2, match++;\n do\n ;\n while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);\n if (len = MAX_MATCH - (strend - scan), scan = strend - MAX_MATCH, len > best_len) {\n if (s.match_start = cur_match, best_len = len, len >= nice_match)\n break;\n scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n if (best_len <= s.lookahead)\n return best_len;\n return s.lookahead;\n }\n function fill_window(s) {\n var _w_size = s.w_size, p, n, m, more, str;\n do {\n if (more = s.window_size - s.lookahead - s.strstart, s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0), s.match_start -= _w_size, s.strstart -= _w_size, s.block_start -= _w_size, n = s.hash_size, p = n;\n do\n m = s.head[--p], s.head[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n n = _w_size, p = n;\n do\n m = s.prev[--p], s.prev[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n more += _w_size;\n }\n if (s.strm.avail_in === 0)\n break;\n if (n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more), s.lookahead += n, s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert, s.ins_h = s.window[str], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;\n while (s.insert)\n if (s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++, s.insert--, s.lookahead + s.insert < MIN_MATCH)\n break;\n }\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n }\n function deflate_stored(s, flush) {\n var max_block_size = 65535;\n if (max_block_size > s.pending_buf_size - 5)\n max_block_size = s.pending_buf_size - 5;\n for (;; ) {\n if (s.lookahead <= 1) {\n if (fill_window(s), s.lookahead === 0 && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n s.strstart += s.lookahead, s.lookahead = 0;\n var max_start = s.block_start + max_block_size;\n if (s.strstart === 0 || s.strstart >= max_start) {\n if (s.lookahead = s.strstart - max_start, s.strstart = max_start, flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.strstart > s.block_start) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_NEED_MORE;\n }\n function deflate_fast(s, flush) {\n var hash_head, bflush;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD)\n s.match_length = longest_match(s, hash_head);\n if (s.match_length >= MIN_MATCH)\n if (bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n do\n s.strstart++, s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.match_length !== 0);\n s.strstart++;\n } else\n s.strstart += s.match_length, s.match_length = 0, s.ins_h = s.window[s.strstart], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_slow(s, flush) {\n var hash_head, bflush, max_insert;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (s.prev_length = s.match_length, s.prev_match = s.match_start, s.match_length = MIN_MATCH - 1, hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n if (s.match_length = longest_match(s, hash_head), s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096))\n s.match_length = MIN_MATCH - 1;\n }\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH, bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH), s.lookahead -= s.prev_length - 1, s.prev_length -= 2;\n do\n if (++s.strstart <= max_insert)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.prev_length !== 0);\n if (s.match_available = 0, s.match_length = MIN_MATCH - 1, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n } else if (s.match_available) {\n if (bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), bflush)\n flush_block_only(s, !1);\n if (s.strstart++, s.lookahead--, s.strm.avail_out === 0)\n return BS_NEED_MORE;\n } else\n s.match_available = 1, s.strstart++, s.lookahead--;\n }\n if (s.match_available)\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), s.match_available = 0;\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_rle(s, flush) {\n var bflush, prev, scan, strend, _win = s.window;\n for (;; ) {\n if (s.lookahead <= MAX_MATCH) {\n if (fill_window(s), s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (s.match_length = 0, s.lookahead >= MIN_MATCH && s.strstart > 0) {\n if (scan = s.strstart - 1, prev = _win[scan], prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do\n ;\n while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n if (s.match_length = MAX_MATCH - (strend - scan), s.match_length > s.lookahead)\n s.match_length = s.lookahead;\n }\n }\n if (s.match_length >= MIN_MATCH)\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.strstart += s.match_length, s.match_length = 0;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_huff(s, flush) {\n var bflush;\n for (;; ) {\n if (s.lookahead === 0) {\n if (fill_window(s), s.lookahead === 0) {\n if (flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n break;\n }\n }\n if (s.match_length = 0, bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length, this.max_lazy = max_lazy, this.nice_length = nice_length, this.max_chain = max_chain, this.func = func;\n }\n var configuration_table = [\n new Config(0, 0, 0, 0, deflate_stored),\n new Config(4, 4, 8, 4, deflate_fast),\n new Config(4, 5, 16, 8, deflate_fast),\n new Config(4, 6, 32, 32, deflate_fast),\n new Config(4, 4, 16, 16, deflate_slow),\n new Config(8, 16, 32, 32, deflate_slow),\n new Config(8, 16, 128, 128, deflate_slow),\n new Config(8, 32, 128, 256, deflate_slow),\n new Config(32, 128, 258, 1024, deflate_slow),\n new Config(32, 258, 258, 4096, deflate_slow)\n ];\n function lm_init(s) {\n s.window_size = 2 * s.w_size, zero(s.head), s.max_lazy_match = configuration_table[s.level].max_lazy, s.good_match = configuration_table[s.level].good_length, s.nice_match = configuration_table[s.level].nice_length, s.max_chain_length = configuration_table[s.level].max_chain, s.strstart = 0, s.block_start = 0, s.lookahead = 0, s.insert = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, s.ins_h = 0;\n }\n function DeflateState() {\n this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Z_DEFLATED, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2), this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2), this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2), zero(this.dyn_ltree), zero(this.dyn_dtree), zero(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new utils.Buf16(MAX_BITS + 1), this.heap = new utils.Buf16(2 * L_CODES + 1), zero(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new utils.Buf16(2 * L_CODES + 1), zero(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;\n }\n function deflateResetKeep(strm) {\n var s;\n if (!strm || !strm.state)\n return err(strm, Z_STREAM_ERROR);\n if (strm.total_in = strm.total_out = 0, strm.data_type = Z_UNKNOWN, s = strm.state, s.pending = 0, s.pending_out = 0, s.wrap < 0)\n s.wrap = -s.wrap;\n return s.status = s.wrap \? INIT_STATE : BUSY_STATE, strm.adler = s.wrap === 2 \? 0 : 1, s.last_flush = Z_NO_FLUSH, trees._tr_init(s), Z_OK;\n }\n function deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK)\n lm_init(strm.state);\n return ret;\n }\n function deflateSetHeader(strm, head) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (strm.state.wrap !== 2)\n return Z_STREAM_ERROR;\n return strm.state.gzhead = head, Z_OK;\n }\n function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm)\n return Z_STREAM_ERROR;\n var wrap = 1;\n if (level === Z_DEFAULT_COMPRESSION)\n level = 6;\n if (windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (windowBits > 15)\n wrap = 2, windowBits -= 16;\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED)\n return err(strm, Z_STREAM_ERROR);\n if (windowBits === 8)\n windowBits = 9;\n var s = new DeflateState;\n return strm.state = s, s.strm = strm, s.wrap = wrap, s.gzhead = null, s.w_bits = windowBits, s.w_size = 1 << s.w_bits, s.w_mask = s.w_size - 1, s.hash_bits = memLevel + 7, s.hash_size = 1 << s.hash_bits, s.hash_mask = s.hash_size - 1, s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH), s.window = new utils.Buf8(s.w_size * 2), s.head = new utils.Buf16(s.hash_size), s.prev = new utils.Buf16(s.w_size), s.lit_bufsize = 1 << memLevel + 6, s.pending_buf_size = s.lit_bufsize * 4, s.pending_buf = new utils.Buf8(s.pending_buf_size), s.d_buf = 1 * s.lit_bufsize, s.l_buf = 3 * s.lit_bufsize, s.level = level, s.strategy = strategy, s.method = method, deflateReset(strm);\n }\n function deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n }\n function deflate(strm, flush) {\n var old_flush, s, beg, val;\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0)\n return strm \? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n if (s = strm.state, !strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH)\n return err(strm, strm.avail_out === 0 \? Z_BUF_ERROR : Z_STREAM_ERROR);\n if (s.strm = strm, old_flush = s.last_flush, s.last_flush = flush, s.status === INIT_STATE)\n if (s.wrap === 2)\n if (strm.adler = 0, put_byte(s, 31), put_byte(s, 139), put_byte(s, 8), !s.gzhead)\n put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, OS_CODE), s.status = BUSY_STATE;\n else {\n if (put_byte(s, (s.gzhead.text \? 1 : 0) + (s.gzhead.hcrc \? 2 : 0) + (!s.gzhead.extra \? 0 : 4) + (!s.gzhead.name \? 0 : 8) + (!s.gzhead.comment \? 0 : 16)), put_byte(s, s.gzhead.time & 255), put_byte(s, s.gzhead.time >> 8 & 255), put_byte(s, s.gzhead.time >> 16 & 255), put_byte(s, s.gzhead.time >> 24 & 255), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length)\n put_byte(s, s.gzhead.extra.length & 255), put_byte(s, s.gzhead.extra.length >> 8 & 255);\n if (s.gzhead.hcrc)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n s.gzindex = 0, s.status = EXTRA_STATE;\n }\n else {\n var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8, level_flags = -1;\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2)\n level_flags = 0;\n else if (s.level < 6)\n level_flags = 1;\n else if (s.level === 6)\n level_flags = 2;\n else\n level_flags = 3;\n if (header |= level_flags << 6, s.strstart !== 0)\n header |= PRESET_DICT;\n if (header += 31 - header % 31, s.status = BUSY_STATE, putShortMSB(s, header), s.strstart !== 0)\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n strm.adler = 1;\n }\n if (s.status === EXTRA_STATE)\n if (s.gzhead.extra) {\n beg = s.pending;\n while (s.gzindex < (s.gzhead.extra.length & 65535)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size)\n break;\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 255), s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (s.gzindex === s.gzhead.extra.length)\n s.gzindex = 0, s.status = NAME_STATE;\n } else\n s.status = NAME_STATE;\n if (s.status === NAME_STATE)\n if (s.gzhead.name) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.name.length)\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.gzindex = 0, s.status = COMMENT_STATE;\n } else\n s.status = COMMENT_STATE;\n if (s.status === COMMENT_STATE)\n if (s.gzhead.comment) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.comment.length)\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.status = HCRC_STATE;\n } else\n s.status = HCRC_STATE;\n if (s.status === HCRC_STATE)\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size)\n flush_pending(strm);\n if (s.pending + 2 <= s.pending_buf_size)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), strm.adler = 0, s.status = BUSY_STATE;\n } else\n s.status = BUSY_STATE;\n if (s.pending !== 0) {\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH)\n return err(strm, Z_BUF_ERROR);\n if (s.status === FINISH_STATE && strm.avail_in !== 0)\n return err(strm, Z_BUF_ERROR);\n if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY \? deflate_huff(s, flush) : s.strategy === Z_RLE \? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE)\n s.status = FINISH_STATE;\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0)\n s.last_flush = -1;\n return Z_OK;\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH)\n trees._tr_align(s);\n else if (flush !== Z_BLOCK) {\n if (trees._tr_stored_block(s, 0, 0, !1), flush === Z_FULL_FLUSH) {\n if (zero(s.head), s.lookahead === 0)\n s.strstart = 0, s.block_start = 0, s.insert = 0;\n }\n }\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n }\n }\n if (flush !== Z_FINISH)\n return Z_OK;\n if (s.wrap <= 0)\n return Z_STREAM_END;\n if (s.wrap === 2)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), put_byte(s, strm.adler >> 16 & 255), put_byte(s, strm.adler >> 24 & 255), put_byte(s, strm.total_in & 255), put_byte(s, strm.total_in >> 8 & 255), put_byte(s, strm.total_in >> 16 & 255), put_byte(s, strm.total_in >> 24 & 255);\n else\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n if (flush_pending(strm), s.wrap > 0)\n s.wrap = -s.wrap;\n return s.pending !== 0 \? Z_OK : Z_STREAM_END;\n }\n function deflateEnd(strm) {\n var status;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (status = strm.state.status, status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE)\n return err(strm, Z_STREAM_ERROR);\n return strm.state = null, status === BUSY_STATE \? err(strm, Z_DATA_ERROR) : Z_OK;\n }\n function deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, s, str, n, wrap, avail, next, input, tmpDict;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (s = strm.state, wrap = s.wrap, wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead)\n return Z_STREAM_ERROR;\n if (wrap === 1)\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n if (s.wrap = 0, dictLength >= s.w_size) {\n if (wrap === 0)\n zero(s.head), s.strstart = 0, s.block_start = 0, s.insert = 0;\n tmpDict = new utils.Buf8(s.w_size), utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0), dictionary = tmpDict, dictLength = s.w_size;\n }\n avail = strm.avail_in, next = strm.next_in, input = strm.input, strm.avail_in = dictLength, strm.next_in = 0, strm.input = dictionary, fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart, n = s.lookahead - (MIN_MATCH - 1);\n do\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++;\n while (--n);\n s.strstart = str, s.lookahead = MIN_MATCH - 1, fill_window(s);\n }\n return s.strstart += s.lookahead, s.block_start = s.strstart, s.insert = s.lookahead, s.lookahead = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, strm.next_in = next, strm.input = input, strm.avail_in = avail, s.wrap = wrap, Z_OK;\n }\n exports.deflateInit = deflateInit, exports.deflateInit2 = deflateInit2, exports.deflateReset = deflateReset, exports.deflateResetKeep = deflateResetKeep, exports.deflateSetHeader = deflateSetHeader, exports.deflate = deflate, exports.deflateEnd = deflateEnd, exports.deflateSetDictionary = deflateSetDictionary, exports.deflateInfo = \"pako deflate (from Nodeca project)\";\n }\n}), require_inffast = __commonJS({\n \"node_modules/pako/lib/zlib/inffast.js\"(exports, module2) {\n var BAD = 30, TYPE = 12;\n module2.exports = function inflate_fast(strm, start) {\n var state, _in, last, _out, beg, end, dmax, wsize, whave, wnext, s_window, hold, bits, lcode, dcode, lmask, dmask, here, op, len, dist, from, from_source, input, output;\n state = strm.state, _in = strm.next_in, input = strm.input, last = _in + (strm.avail_in - 5), _out = strm.next_out, output = strm.output, beg = _out - (start - strm.avail_out), end = _out + (strm.avail_out - 257), dmax = state.dmax, wsize = state.wsize, whave = state.whave, wnext = state.wnext, s_window = state.window, hold = state.hold, bits = state.bits, lcode = state.lencode, dcode = state.distcode, lmask = (1 << state.lenbits) - 1, dmask = (1 << state.distbits) - 1;\n top:\n do {\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = lcode[hold & lmask];\n dolen:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op === 0)\n output[_out++] = here & 65535;\n else if (op & 16) {\n if (len = here & 65535, op &= 15, op) {\n if (bits < op)\n hold += input[_in++] << bits, bits += 8;\n len += hold & (1 << op) - 1, hold >>>= op, bits -= op;\n }\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = dcode[hold & dmask];\n dodist:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op & 16) {\n if (dist = here & 65535, op &= 15, bits < op) {\n if (hold += input[_in++] << bits, bits += 8, bits < op)\n hold += input[_in++] << bits, bits += 8;\n }\n if (dist += hold & (1 << op) - 1, dist > dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n if (hold >>>= op, bits -= op, op = _out - beg, dist > op) {\n if (op = dist - op, op > whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n }\n if (from = 0, from_source = s_window, wnext === 0) {\n if (from += wsize - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n } else if (wnext < op) {\n if (from += wsize + wnext - op, op -= wnext, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n if (from = 0, wnext < len) {\n op = wnext, len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n }\n } else if (from += wnext - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n while (len > 2)\n output[_out++] = from_source[from++], output[_out++] = from_source[from++], output[_out++] = from_source[from++], len -= 3;\n if (len) {\n if (output[_out++] = from_source[from++], len > 1)\n output[_out++] = from_source[from++];\n }\n } else {\n from = _out - dist;\n do\n output[_out++] = output[from++], output[_out++] = output[from++], output[_out++] = output[from++], len -= 3;\n while (len > 2);\n if (len) {\n if (output[_out++] = output[from++], len > 1)\n output[_out++] = output[from++];\n }\n }\n } else if ((op & 64) === 0) {\n here = dcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } else if ((op & 64) === 0) {\n here = lcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) {\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } while (_in < last && _out < end);\n len = bits >> 3, _in -= len, bits -= len << 3, hold &= (1 << bits) - 1, strm.next_in = _in, strm.next_out = _out, strm.avail_in = _in < last \? 5 + (last - _in) : 5 - (_in - last), strm.avail_out = _out < end \? 257 + (end - _out) : 257 - (_out - end), state.hold = hold, state.bits = bits;\n return;\n };\n }\n}), require_inftrees = __commonJS({\n \"node_modules/pako/lib/zlib/inftrees.js\"(exports, module2) {\n var utils = require_common(), MAXBITS = 15, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, CODES = 0, LENS = 1, DISTS = 2, lbase = [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 13,\n 15,\n 17,\n 19,\n 23,\n 27,\n 31,\n 35,\n 43,\n 51,\n 59,\n 67,\n 83,\n 99,\n 115,\n 131,\n 163,\n 195,\n 227,\n 258,\n 0,\n 0\n ], lext = [\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 17,\n 17,\n 18,\n 18,\n 18,\n 18,\n 19,\n 19,\n 19,\n 19,\n 20,\n 20,\n 20,\n 20,\n 21,\n 21,\n 21,\n 21,\n 16,\n 72,\n 78\n ], dbase = [\n 1,\n 2,\n 3,\n 4,\n 5,\n 7,\n 9,\n 13,\n 17,\n 25,\n 33,\n 49,\n 65,\n 97,\n 129,\n 193,\n 257,\n 385,\n 513,\n 769,\n 1025,\n 1537,\n 2049,\n 3073,\n 4097,\n 6145,\n 8193,\n 12289,\n 16385,\n 24577,\n 0,\n 0\n ], dext = [\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 18,\n 18,\n 19,\n 19,\n 20,\n 20,\n 21,\n 21,\n 22,\n 22,\n 23,\n 23,\n 24,\n 24,\n 25,\n 25,\n 26,\n 26,\n 27,\n 27,\n 28,\n 28,\n 29,\n 29,\n 64,\n 64\n ];\n module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n var bits = opts.bits, len = 0, sym = 0, min = 0, max = 0, root = 0, curr = 0, drop = 0, left = 0, used = 0, huff = 0, incr, fill, low, mask, next, base = null, base_index = 0, end, count = new utils.Buf16(MAXBITS + 1), offs = new utils.Buf16(MAXBITS + 1), extra = null, extra_index = 0, here_bits, here_op, here_val;\n for (len = 0;len <= MAXBITS; len++)\n count[len] = 0;\n for (sym = 0;sym < codes; sym++)\n count[lens[lens_index + sym]]++;\n root = bits;\n for (max = MAXBITS;max >= 1; max--)\n if (count[max] !== 0)\n break;\n if (root > max)\n root = max;\n if (max === 0)\n return table[table_index++] = 1 << 24 | 64 << 16 | 0, table[table_index++] = 1 << 24 | 64 << 16 | 0, opts.bits = 1, 0;\n for (min = 1;min < max; min++)\n if (count[min] !== 0)\n break;\n if (root < min)\n root = min;\n left = 1;\n for (len = 1;len <= MAXBITS; len++)\n if (left <<= 1, left -= count[len], left < 0)\n return -1;\n if (left > 0 && (type === CODES || max !== 1))\n return -1;\n offs[1] = 0;\n for (len = 1;len < MAXBITS; len++)\n offs[len + 1] = offs[len] + count[len];\n for (sym = 0;sym < codes; sym++)\n if (lens[lens_index + sym] !== 0)\n work[offs[lens[lens_index + sym]]++] = sym;\n if (type === CODES)\n base = extra = work, end = 19;\n else if (type === LENS)\n base = lbase, base_index -= 257, extra = lext, extra_index -= 257, end = 256;\n else\n base = dbase, extra = dext, end = -1;\n if (huff = 0, sym = 0, len = min, next = table_index, curr = root, drop = 0, low = -1, used = 1 << root, mask = used - 1, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n for (;; ) {\n if (here_bits = len - drop, work[sym] < end)\n here_op = 0, here_val = work[sym];\n else if (work[sym] > end)\n here_op = extra[extra_index + work[sym]], here_val = base[base_index + work[sym]];\n else\n here_op = 96, here_val = 0;\n incr = 1 << len - drop, fill = 1 << curr, min = fill;\n do\n fill -= incr, table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;\n while (fill !== 0);\n incr = 1 << len - 1;\n while (huff & incr)\n incr >>= 1;\n if (incr !== 0)\n huff &= incr - 1, huff += incr;\n else\n huff = 0;\n if (sym++, --count[len] === 0) {\n if (len === max)\n break;\n len = lens[lens_index + work[sym]];\n }\n if (len > root && (huff & mask) !== low) {\n if (drop === 0)\n drop = root;\n next += min, curr = len - drop, left = 1 << curr;\n while (curr + drop < max) {\n if (left -= count[curr + drop], left <= 0)\n break;\n curr++, left <<= 1;\n }\n if (used += 1 << curr, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n low = huff & mask, table[low] = root << 24 | curr << 16 | next - table_index | 0;\n }\n }\n if (huff !== 0)\n table[next + huff] = len - drop << 24 | 64 << 16 | 0;\n return opts.bits = root, 0;\n };\n }\n}), require_inflate = __commonJS({\n \"node_modules/pako/lib/zlib/inflate.js\"(exports) {\n var utils = require_common(), adler32 = require_adler32(), crc32 = require_crc32(), inflate_fast = require_inffast(), inflate_table = require_inftrees(), CODES = 0, LENS = 1, DISTS = 2, Z_FINISH = 4, Z_BLOCK = 5, Z_TREES = 6, Z_OK = 0, Z_STREAM_END = 1, Z_NEED_DICT = 2, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_MEM_ERROR = -4, Z_BUF_ERROR = -5, Z_DEFLATED = 8, HEAD = 1, FLAGS = 2, TIME = 3, OS = 4, EXLEN = 5, EXTRA = 6, NAME = 7, COMMENT = 8, HCRC = 9, DICTID = 10, DICT = 11, TYPE = 12, TYPEDO = 13, STORED = 14, COPY_ = 15, COPY = 16, TABLE = 17, LENLENS = 18, CODELENS = 19, LEN_ = 20, LEN = 21, LENEXT = 22, DIST = 23, DISTEXT = 24, MATCH = 25, LIT = 26, CHECK = 27, LENGTH = 28, DONE = 29, BAD = 30, MEM = 31, SYNC = 32, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, MAX_WBITS = 15, DEF_WBITS = MAX_WBITS;\n function zswap32(q) {\n return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);\n }\n function InflateState() {\n this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new utils.Buf16(320), this.work = new utils.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;\n }\n function inflateResetKeep(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, strm.total_in = strm.total_out = state.total = 0, strm.msg = \"\", state.wrap)\n strm.adler = state.wrap & 1;\n return state.mode = HEAD, state.last = 0, state.havedict = 0, state.dmax = 32768, state.head = null, state.hold = 0, state.bits = 0, state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS), state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS), state.sane = 1, state.back = -1, Z_OK;\n }\n function inflateReset(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n return state = strm.state, state.wsize = 0, state.whave = 0, state.wnext = 0, inflateResetKeep(strm);\n }\n function inflateReset2(strm, windowBits) {\n var wrap, state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (wrap = (windowBits >> 4) + 1, windowBits < 48)\n windowBits &= 15;\n if (windowBits && (windowBits < 8 || windowBits > 15))\n return Z_STREAM_ERROR;\n if (state.window !== null && state.wbits !== windowBits)\n state.window = null;\n return state.wrap = wrap, state.wbits = windowBits, inflateReset(strm);\n }\n function inflateInit2(strm, windowBits) {\n var ret, state;\n if (!strm)\n return Z_STREAM_ERROR;\n if (state = new InflateState, strm.state = state, state.window = null, ret = inflateReset2(strm, windowBits), ret !== Z_OK)\n strm.state = null;\n return ret;\n }\n function inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n }\n var virgin = !0, lenfix, distfix;\n function fixedtables(state) {\n if (virgin) {\n var sym;\n lenfix = new utils.Buf32(512), distfix = new utils.Buf32(32), sym = 0;\n while (sym < 144)\n state.lens[sym++] = 8;\n while (sym < 256)\n state.lens[sym++] = 9;\n while (sym < 280)\n state.lens[sym++] = 7;\n while (sym < 288)\n state.lens[sym++] = 8;\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {\n bits: 9\n }), sym = 0;\n while (sym < 32)\n state.lens[sym++] = 5;\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {\n bits: 5\n }), virgin = !1;\n }\n state.lencode = lenfix, state.lenbits = 9, state.distcode = distfix, state.distbits = 5;\n }\n function updatewindow(strm, src, end, copy) {\n var dist, state = strm.state;\n if (state.window === null)\n state.wsize = 1 << state.wbits, state.wnext = 0, state.whave = 0, state.window = new utils.Buf8(state.wsize);\n if (copy >= state.wsize)\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0), state.wnext = 0, state.whave = state.wsize;\n else {\n if (dist = state.wsize - state.wnext, dist > copy)\n dist = copy;\n if (utils.arraySet(state.window, src, end - copy, dist, state.wnext), copy -= dist, copy)\n utils.arraySet(state.window, src, end - copy, copy, 0), state.wnext = copy, state.whave = state.wsize;\n else {\n if (state.wnext += dist, state.wnext === state.wsize)\n state.wnext = 0;\n if (state.whave < state.wsize)\n state.whave += dist;\n }\n }\n return 0;\n }\n function inflate(strm, flush) {\n var state, input, output, next, put, have, left, hold, bits, _in, _out, copy, from, from_source, here = 0, here_bits, here_op, here_val, last_bits, last_op, last_val, len, ret, hbuf = new utils.Buf8(4), opts, n, order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.mode === TYPE)\n state.mode = TYPEDO;\n put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, _in = have, _out = left, ret = Z_OK;\n inf_leave:\n for (;; )\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.wrap & 2 && hold === 35615) {\n state.check = 0, hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0), hold = 0, bits = 0, state.mode = FLAGS;\n break;\n }\n if (state.flags = 0, state.head)\n state.head.done = !1;\n if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {\n strm.msg = \"incorrect header check\", state.mode = BAD;\n break;\n }\n if ((hold & 15) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (hold >>>= 4, bits -= 4, len = (hold & 15) + 8, state.wbits === 0)\n state.wbits = len;\n else if (len > state.wbits) {\n strm.msg = \"invalid window size\", state.mode = BAD;\n break;\n }\n state.dmax = 1 << len, strm.adler = state.check = 1, state.mode = hold & 512 \? DICTID : TYPE, hold = 0, bits = 0;\n break;\n case FLAGS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.flags = hold, (state.flags & 255) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (state.flags & 57344) {\n strm.msg = \"unknown header flags set\", state.mode = BAD;\n break;\n }\n if (state.head)\n state.head.text = hold >> 8 & 1;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = TIME;\n case TIME:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.time = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, hbuf[2] = hold >>> 16 & 255, hbuf[3] = hold >>> 24 & 255, state.check = crc32(state.check, hbuf, 4, 0);\n hold = 0, bits = 0, state.mode = OS;\n case OS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.xflags = hold & 255, state.head.os = hold >> 8;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = EXLEN;\n case EXLEN:\n if (state.flags & 1024) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.length = hold, state.head)\n state.head.extra_len = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0;\n } else if (state.head)\n state.head.extra = null;\n state.mode = EXTRA;\n case EXTRA:\n if (state.flags & 1024) {\n if (copy = state.length, copy > have)\n copy = have;\n if (copy) {\n if (state.head) {\n if (len = state.head.extra_len - state.length, !state.head.extra)\n state.head.extra = new Array(state.head.extra_len);\n utils.arraySet(state.head.extra, input, next, copy, len);\n }\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n have -= copy, next += copy, state.length -= copy;\n }\n if (state.length)\n break inf_leave;\n }\n state.length = 0, state.mode = NAME;\n case NAME:\n if (state.flags & 2048) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.name += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.name = null;\n state.length = 0, state.mode = COMMENT;\n case COMMENT:\n if (state.flags & 4096) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.comment += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.comment = null;\n state.mode = HCRC;\n case HCRC:\n if (state.flags & 512) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.check & 65535)) {\n strm.msg = \"header crc mismatch\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n if (state.head)\n state.head.hcrc = state.flags >> 9 & 1, state.head.done = !0;\n strm.adler = state.check = 0, state.mode = TYPE;\n break;\n case DICTID:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n strm.adler = state.check = zswap32(hold), hold = 0, bits = 0, state.mode = DICT;\n case DICT:\n if (state.havedict === 0)\n return strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, Z_NEED_DICT;\n strm.adler = state.check = 1, state.mode = TYPE;\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES)\n break inf_leave;\n case TYPEDO:\n if (state.last) {\n hold >>>= bits & 7, bits -= bits & 7, state.mode = CHECK;\n break;\n }\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n switch (state.last = hold & 1, hold >>>= 1, bits -= 1, hold & 3) {\n case 0:\n state.mode = STORED;\n break;\n case 1:\n if (fixedtables(state), state.mode = LEN_, flush === Z_TREES) {\n hold >>>= 2, bits -= 2;\n break inf_leave;\n }\n break;\n case 2:\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = \"invalid block type\", state.mode = BAD;\n }\n hold >>>= 2, bits -= 2;\n break;\n case STORED:\n hold >>>= bits & 7, bits -= bits & 7;\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {\n strm.msg = \"invalid stored block lengths\", state.mode = BAD;\n break;\n }\n if (state.length = hold & 65535, hold = 0, bits = 0, state.mode = COPY_, flush === Z_TREES)\n break inf_leave;\n case COPY_:\n state.mode = COPY;\n case COPY:\n if (copy = state.length, copy) {\n if (copy > have)\n copy = have;\n if (copy > left)\n copy = left;\n if (copy === 0)\n break inf_leave;\n utils.arraySet(output, input, next, copy, put), have -= copy, next += copy, left -= copy, put += copy, state.length -= copy;\n break;\n }\n state.mode = TYPE;\n break;\n case TABLE:\n while (bits < 14) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.nlen = (hold & 31) + 257, hold >>>= 5, bits -= 5, state.ndist = (hold & 31) + 1, hold >>>= 5, bits -= 5, state.ncode = (hold & 15) + 4, hold >>>= 4, bits -= 4, state.nlen > 286 || state.ndist > 30) {\n strm.msg = \"too many length or distance symbols\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = LENLENS;\n case LENLENS:\n while (state.have < state.ncode) {\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.lens[order[state.have++]] = hold & 7, hold >>>= 3, bits -= 3;\n }\n while (state.have < 19)\n state.lens[order[state.have++]] = 0;\n if (state.lencode = state.lendyn, state.lenbits = 7, opts = { bits: state.lenbits }, ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid code lengths set\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = CODELENS;\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_val < 16)\n hold >>>= here_bits, bits -= here_bits, state.lens[state.have++] = here_val;\n else {\n if (here_val === 16) {\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.have === 0) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1], copy = 3 + (hold & 3), hold >>>= 2, bits -= 2;\n } else if (here_val === 17) {\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 3 + (hold & 7), hold >>>= 3, bits -= 3;\n } else {\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 11 + (hold & 127), hold >>>= 7, bits -= 7;\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n while (copy--)\n state.lens[state.have++] = len;\n }\n }\n if (state.mode === BAD)\n break;\n if (state.lens[256] === 0) {\n strm.msg = \"invalid code -- missing end-of-block\", state.mode = BAD;\n break;\n }\n if (state.lenbits = 9, opts = { bits: state.lenbits }, ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid literal/lengths set\", state.mode = BAD;\n break;\n }\n if (state.distbits = 6, state.distcode = state.distdyn, opts = { bits: state.distbits }, ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts), state.distbits = opts.bits, ret) {\n strm.msg = \"invalid distances set\", state.mode = BAD;\n break;\n }\n if (state.mode = LEN_, flush === Z_TREES)\n break inf_leave;\n case LEN_:\n state.mode = LEN;\n case LEN:\n if (have >= 6 && left >= 258) {\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, inflate_fast(strm, _out), put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, state.mode === TYPE)\n state.back = -1;\n break;\n }\n state.back = 0;\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_op && (here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, state.length = here_val, here_op === 0) {\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n state.back = -1, state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break;\n }\n state.extra = here_op & 15, state.mode = LENEXT;\n case LENEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.length += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n state.was = state.length, state.mode = DIST;\n case DIST:\n for (;; ) {\n if (here = state.distcode[hold & (1 << state.distbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, here_op & 64) {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break;\n }\n state.offset = here_val, state.extra = here_op & 15, state.mode = DISTEXT;\n case DISTEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.offset += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n if (state.offset > state.dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n state.mode = MATCH;\n case MATCH:\n if (left === 0)\n break inf_leave;\n if (copy = _out - left, state.offset > copy) {\n if (copy = state.offset - copy, copy > state.whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n }\n if (copy > state.wnext)\n copy -= state.wnext, from = state.wsize - copy;\n else\n from = state.wnext - copy;\n if (copy > state.length)\n copy = state.length;\n from_source = state.window;\n } else\n from_source = output, from = put - state.offset, copy = state.length;\n if (copy > left)\n copy = left;\n left -= copy, state.length -= copy;\n do\n output[put++] = from_source[from++];\n while (--copy);\n if (state.length === 0)\n state.mode = LEN;\n break;\n case LIT:\n if (left === 0)\n break inf_leave;\n output[put++] = state.length, left--, state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold |= input[next++] << bits, bits += 8;\n }\n if (_out -= left, strm.total_out += _out, state.total += _out, _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);\n if (_out = left, (state.flags \? hold : zswap32(hold)) !== state.check) {\n strm.msg = \"incorrect data check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = LENGTH;\n case LENGTH:\n if (state.wrap && state.flags) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.total & 4294967295)) {\n strm.msg = \"incorrect length check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = DONE;\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n default:\n return Z_STREAM_ERROR;\n }\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out))\n return state.mode = MEM, Z_MEM_ERROR;\n }\n if (_in -= strm.avail_in, _out -= strm.avail_out, strm.total_in += _in, strm.total_out += _out, state.total += _out, state.wrap && _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);\n if (strm.data_type = state.bits + (state.last \? 64 : 0) + (state.mode === TYPE \? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ \? 256 : 0), (_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK)\n ret = Z_BUF_ERROR;\n return ret;\n }\n function inflateEnd(strm) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n var state = strm.state;\n if (state.window)\n state.window = null;\n return strm.state = null, Z_OK;\n }\n function inflateGetHeader(strm, head) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, (state.wrap & 2) === 0)\n return Z_STREAM_ERROR;\n return state.head = head, head.done = !1, Z_OK;\n }\n function inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, state, dictid, ret;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.wrap !== 0 && state.mode !== DICT)\n return Z_STREAM_ERROR;\n if (state.mode === DICT) {\n if (dictid = 1, dictid = adler32(dictid, dictionary, dictLength, 0), dictid !== state.check)\n return Z_DATA_ERROR;\n }\n if (ret = updatewindow(strm, dictionary, dictLength, dictLength), ret)\n return state.mode = MEM, Z_MEM_ERROR;\n return state.havedict = 1, Z_OK;\n }\n exports.inflateReset = inflateReset, exports.inflateReset2 = inflateReset2, exports.inflateResetKeep = inflateResetKeep, exports.inflateInit = inflateInit, exports.inflateInit2 = inflateInit2, exports.inflate = inflate, exports.inflateEnd = inflateEnd, exports.inflateGetHeader = inflateGetHeader, exports.inflateSetDictionary = inflateSetDictionary, exports.inflateInfo = \"pako inflate (from Nodeca project)\";\n }\n}), require_constants = __commonJS({\n \"node_modules/pako/lib/zlib/constants.js\"(exports, module2) {\n module2.exports = {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_BUF_ERROR: -5,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n Z_BINARY: 0,\n Z_TEXT: 1,\n Z_UNKNOWN: 2,\n Z_DEFLATED: 8\n };\n }\n}), require_binding = __commonJS({\n \"node_modules/browserify-zlib/lib/binding.js\"(exports) {\n var Zstream = require_zstream(), zlib_deflate = require_deflate(), zlib_inflate = require_inflate(), constants = require_constants();\n for (key in constants)\n exports[key] = constants[key];\n var key;\n exports.NONE = 0, exports.DEFLATE = 1, exports.INFLATE = 2, exports.GZIP = 3, exports.GUNZIP = 4, exports.DEFLATERAW = 5, exports.INFLATERAW = 6, exports.UNZIP = 7;\n var GZIP_HEADER_ID1 = 31, GZIP_HEADER_ID2 = 139;\n function Zlib(mode) {\n if (typeof mode !== \"number\" || mode < exports.DEFLATE || mode > exports.UNZIP)\n @throwTypeError(\"Bad argument\");\n this.dictionary = null, this.err = 0, this.flush = 0, this.init_done = !1, this.level = 0, this.memLevel = 0, this.mode = mode, this.strategy = 0, this.windowBits = 0, this.write_in_progress = !1, this.pending_close = !1, this.gzip_id_bytes_read = 0;\n }\n Zlib.prototype = {}, Zlib.prototype.close = function() {\n if (this.write_in_progress) {\n this.pending_close = !0;\n return;\n }\n if (this.pending_close = !1, assert(this.init_done, \"close before init\"), assert(this.mode <= exports.UNZIP), this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW)\n zlib_deflate.deflateEnd(this.strm);\n else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP)\n zlib_inflate.inflateEnd(this.strm);\n this.mode = exports.NONE, this.dictionary = null;\n }, Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!0, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!1, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype._write = function(async, flush, input, in_off, in_len, out, out_off, out_len) {\n if (assert.equal(arguments.length, 8), assert(this.init_done, \"write before init\"), assert(this.mode !== exports.NONE, \"already finalized\"), assert.equal(!1, this.write_in_progress, \"write already in progress\"), assert.equal(!1, this.pending_close, \"close is pending\"), this.write_in_progress = !0, assert.equal(!1, flush === void 0, \"must provide flush value\"), this.write_in_progress = !0, flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK)\n throw new Error(\"Invalid flush value\");\n if (input == null)\n input = Buffer.alloc(0), in_len = 0, in_off = 0;\n if (this.strm.avail_in = in_len, this.strm.input = input, this.strm.next_in = in_off, this.strm.avail_out = out_len, this.strm.output = out, this.strm.next_out = out_off, this.flush = flush, !async) {\n if (this._process(), this._checkError())\n return this._afterSync();\n return;\n }\n var self = this;\n return process.nextTick(function() {\n self._process(), self._after();\n }), this;\n }, Zlib.prototype._afterSync = function() {\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n return this.write_in_progress = !1, [avail_in, avail_out];\n }, Zlib.prototype._process = function() {\n var next_expected_header_byte = null;\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n case exports.UNZIP:\n if (this.strm.avail_in > 0)\n next_expected_header_byte = this.strm.next_in;\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n if (this.gzip_id_bytes_read = 1, next_expected_header_byte++, this.strm.avail_in === 1)\n break;\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n case 1:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2)\n this.gzip_id_bytes_read = 2, this.mode = exports.GUNZIP;\n else\n this.mode = exports.INFLATE;\n break;\n default:\n throw new Error(\"invalid number of gzip magic number bytes read\");\n }\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n if (this.err = zlib_inflate.inflate(this.strm, this.flush), this.err === exports.Z_NEED_DICT && this.dictionary) {\n if (this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary), this.err === exports.Z_OK)\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n else if (this.err === exports.Z_DATA_ERROR)\n this.err = exports.Z_NEED_DICT;\n }\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0)\n this.reset(), this.err = zlib_inflate.inflate(this.strm, this.flush);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n }, Zlib.prototype._checkError = function() {\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH)\n return this._error(\"unexpected end of file\"), !1;\n break;\n case exports.Z_STREAM_END:\n break;\n case exports.Z_NEED_DICT:\n if (this.dictionary == null)\n this._error(\"Missing dictionary\");\n else\n this._error(\"Bad dictionary\");\n return !1;\n default:\n return this._error(\"Zlib error\"), !1;\n }\n return !0;\n }, Zlib.prototype._after = function() {\n if (!this._checkError())\n return;\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n if (this.write_in_progress = !1, this.callback(avail_in, avail_out), this.pending_close)\n this.close();\n }, Zlib.prototype._error = function(message) {\n if (this.strm.msg)\n message = this.strm.msg;\n if (this.onerror(message, this.err), this.write_in_progress = !1, this.pending_close)\n this.close();\n }, Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, \"init(windowBits, level, memLevel, strategy, [dictionary])\"), assert(windowBits >= 8 && windowBits <= 15, \"invalid windowBits\"), assert(level >= -1 && level <= 9, \"invalid compression level\"), assert(memLevel >= 1 && memLevel <= 9, \"invalid memlevel\"), assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, \"invalid strategy\"), this._init(level, windowBits, memLevel, strategy, dictionary), this._setDictionary();\n }, Zlib.prototype.params = function() {\n throw new Error(\"deflateParams Not supported\");\n }, Zlib.prototype.reset = function() {\n this._reset(), this._setDictionary();\n }, Zlib.prototype._init = function(level, windowBits, memLevel, strategy, dictionary) {\n if (this.level = level, this.windowBits = windowBits, this.memLevel = memLevel, this.strategy = strategy, this.flush = exports.Z_NO_FLUSH, this.err = exports.Z_OK, this.mode === exports.GZIP || this.mode === exports.GUNZIP)\n this.windowBits += 16;\n if (this.mode === exports.UNZIP)\n this.windowBits += 32;\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW)\n this.windowBits = -1 * this.windowBits;\n switch (this.strm = new Zstream, this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Init error\");\n this.dictionary = dictionary, this.write_in_progress = !1, this.init_done = !0;\n }, Zlib.prototype._setDictionary = function() {\n if (this.dictionary == null)\n return;\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to set dictionary\");\n }, Zlib.prototype._reset = function() {\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to reset stream\");\n }, exports.Zlib = Zlib;\n }\n}), require_lib = __commonJS({\n \"node_modules/browserify-zlib/lib/index.js\"(exports) {\n var Buffer2 = BufferModule.Buffer, Transform = StreamModule.Transform, binding = require_binding(), util = Util, kMaxLength = BufferModule.kMaxLength, kRangeErrorMessage = \"Cannot create final Buffer. It would be larger than 0x\" + kMaxLength.toString(16) + \" bytes\";\n binding.Z_MIN_WINDOWBITS = 8, binding.Z_MAX_WINDOWBITS = 15, binding.Z_DEFAULT_WINDOWBITS = 15, binding.Z_MIN_CHUNK = 64, binding.Z_MAX_CHUNK = Infinity, binding.Z_DEFAULT_CHUNK = 16384, binding.Z_MIN_MEMLEVEL = 1, binding.Z_MAX_MEMLEVEL = 9, binding.Z_DEFAULT_MEMLEVEL = 8, binding.Z_MIN_LEVEL = -1, binding.Z_MAX_LEVEL = 9, binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;\n var bkeys = Object.keys(binding);\n for (bk = 0;bk < bkeys.length; bk++)\n if (bkey = bkeys[bk], bkey.match(/^Z/))\n Object.defineProperty(exports, bkey, {\n enumerable: !0,\n value: binding[bkey],\n writable: !1\n });\n var bkey, bk, codes = {\n Z_OK: binding.Z_OK,\n Z_STREAM_END: binding.Z_STREAM_END,\n Z_NEED_DICT: binding.Z_NEED_DICT,\n Z_ERRNO: binding.Z_ERRNO,\n Z_STREAM_ERROR: binding.Z_STREAM_ERROR,\n Z_DATA_ERROR: binding.Z_DATA_ERROR,\n Z_MEM_ERROR: binding.Z_MEM_ERROR,\n Z_BUF_ERROR: binding.Z_BUF_ERROR,\n Z_VERSION_ERROR: binding.Z_VERSION_ERROR\n }, ckeys = Object.keys(codes);\n for (ck = 0;ck < ckeys.length; ck++)\n ckey = ckeys[ck], codes[codes[ckey]] = ckey;\n var ckey, ck;\n Object.defineProperty(exports, \"codes\", {\n enumerable: !0,\n value: Object.freeze(codes),\n writable: !1\n }), exports.constants = require_constants(), exports.Deflate = Deflate, exports.Inflate = Inflate, exports.Gzip = Gzip, exports.Gunzip = Gunzip, exports.DeflateRaw = DeflateRaw, exports.InflateRaw = InflateRaw, exports.Unzip = Unzip, exports.createDeflate = function(o) {\n return new Deflate(o);\n }, exports.createInflate = function(o) {\n return new Inflate(o);\n }, exports.createDeflateRaw = function(o) {\n return new DeflateRaw(o);\n }, exports.createInflateRaw = function(o) {\n return new InflateRaw(o);\n }, exports.createGzip = function(o) {\n return new Gzip(o);\n }, exports.createGunzip = function(o) {\n return new Gunzip(o);\n }, exports.createUnzip = function(o) {\n return new Unzip(o);\n }, exports.deflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Deflate(opts), buffer, callback);\n }, exports.deflateSync = function(buffer, opts) {\n return zlibBufferSync(new Deflate(opts), buffer);\n }, exports.gzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gzip(opts), buffer, callback);\n }, exports.gzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gzip(opts), buffer);\n }, exports.deflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new DeflateRaw(opts), buffer, callback);\n }, exports.deflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new DeflateRaw(opts), buffer);\n }, exports.unzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Unzip(opts), buffer, callback);\n }, exports.unzipSync = function(buffer, opts) {\n return zlibBufferSync(new Unzip(opts), buffer);\n }, exports.inflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Inflate(opts), buffer, callback);\n }, exports.inflateSync = function(buffer, opts) {\n return zlibBufferSync(new Inflate(opts), buffer);\n }, exports.gunzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gunzip(opts), buffer, callback);\n }, exports.gunzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gunzip(opts), buffer);\n }, exports.inflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new InflateRaw(opts), buffer, callback);\n }, exports.inflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new InflateRaw(opts), buffer);\n }, exports.brotliCompress = function(buffer, opts, callback) {\n throw new Error(\"zlib.brotliCompress is not implemented\");\n };\n function zlibBuffer(engine, buffer, callback) {\n var buffers = [], nread = 0;\n engine.on(\"error\", onError), engine.on(\"end\", onEnd), engine.end(buffer), flow();\n function flow() {\n var chunk;\n while ((chunk = engine.read()) !== null)\n buffers.push(chunk), nread += chunk.length;\n engine.once(\"readable\", flow);\n }\n function onError(err) {\n engine.removeListener(\"end\", onEnd), engine.removeListener(\"readable\", flow), callback(err);\n }\n function onEnd() {\n var buf, err = null;\n if (nread >= kMaxLength)\n err = new RangeError(kRangeErrorMessage);\n else\n buf = Buffer2.concat(buffers, nread);\n buffers = [], engine.close(), callback(err, buf);\n }\n }\n function zlibBufferSync(engine, buffer) {\n if (typeof buffer === \"string\")\n buffer = Buffer2.from(buffer);\n if (!Buffer2.isBuffer(buffer))\n @throwTypeError(\"Not a string or buffer\");\n var flushFlag = engine._finishFlushFlag;\n return engine._processChunk(buffer, flushFlag);\n }\n function Deflate(opts) {\n if (!(this instanceof Deflate))\n return new Deflate(opts);\n Zlib.call(this, opts, binding.DEFLATE);\n }\n function Inflate(opts) {\n if (!(this instanceof Inflate))\n return new Inflate(opts);\n Zlib.call(this, opts, binding.INFLATE);\n }\n function Gzip(opts) {\n if (!(this instanceof Gzip))\n return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n }\n function Gunzip(opts) {\n if (!(this instanceof Gunzip))\n return new Gunzip(opts);\n Zlib.call(this, opts, binding.GUNZIP);\n }\n function DeflateRaw(opts) {\n if (!(this instanceof DeflateRaw))\n return new DeflateRaw(opts);\n Zlib.call(this, opts, binding.DEFLATERAW);\n }\n function InflateRaw(opts) {\n if (!(this instanceof InflateRaw))\n return new InflateRaw(opts);\n Zlib.call(this, opts, binding.INFLATERAW);\n }\n function Unzip(opts) {\n if (!(this instanceof Unzip))\n return new Unzip(opts);\n Zlib.call(this, opts, binding.UNZIP);\n }\n function isValidFlushFlag(flag) {\n return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;\n }\n function Zlib(opts, mode) {\n var _this = this;\n if (this._opts = opts = opts || {}, this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK, Transform.call(this, opts), opts.flush && !isValidFlushFlag(opts.flush))\n throw new Error(\"Invalid flush flag: \" + opts.flush);\n if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush))\n throw new Error(\"Invalid flush flag: \" + opts.finishFlush);\n if (this._flushFlag = opts.flush || binding.Z_NO_FLUSH, this._finishFlushFlag = typeof opts.finishFlush !== \"undefined\" \? opts.finishFlush : binding.Z_FINISH, opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK)\n throw new Error(\"Invalid chunk size: \" + opts.chunkSize);\n }\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS)\n throw new Error(\"Invalid windowBits: \" + opts.windowBits);\n }\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL)\n throw new Error(\"Invalid compression level: \" + opts.level);\n }\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL)\n throw new Error(\"Invalid memLevel: \" + opts.memLevel);\n }\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY)\n throw new Error(\"Invalid strategy: \" + opts.strategy);\n }\n if (opts.dictionary) {\n if (!Buffer2.isBuffer(opts.dictionary))\n throw new Error(\"Invalid dictionary: it should be a Buffer instance\");\n }\n this._handle = new binding.Zlib(mode);\n var self = this;\n this._hadError = !1, this._handle.onerror = function(message, errno) {\n _close(self), self._hadError = !0;\n var error = new Error(message);\n error.errno = errno, error.code = exports.codes[errno], self.emit(\"error\", error);\n };\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === \"number\")\n level = opts.level;\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === \"number\")\n strategy = opts.strategy;\n this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary), this._buffer = Buffer2.allocUnsafe(this._chunkSize), this._offset = 0, this._level = level, this._strategy = strategy, this.once(\"end\", this.close), Object.defineProperty(this, \"_closed\", {\n get: function() {\n return !_this._handle;\n },\n configurable: !0,\n enumerable: !0\n });\n }\n util.inherits(Zlib, Transform), Zlib.prototype.params = function(level, strategy, callback) {\n if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL)\n @throwRangeError(\"Invalid compression level: \" + level);\n if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY)\n @throwTypeError(\"Invalid strategy: \" + strategy);\n if (this._level !== level || this._strategy !== strategy) {\n var self = this;\n this.flush(binding.Z_SYNC_FLUSH, function() {\n if (assert(self._handle, \"zlib binding closed\"), self._handle.params(level, strategy), !self._hadError) {\n if (self._level = level, self._strategy = strategy, callback)\n callback();\n }\n });\n } else\n process.nextTick(callback);\n }, Zlib.prototype.reset = function() {\n return assert(this._handle, \"zlib binding closed\"), this._handle.reset();\n }, Zlib.prototype._flush = function(callback) {\n this._transform(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.flush = function(kind, callback) {\n var _this2 = this, ws = this._writableState;\n if (typeof kind === \"function\" || kind === void 0 && !callback)\n callback = kind, kind = binding.Z_FULL_FLUSH;\n if (ws.ended) {\n if (callback)\n process.nextTick(callback);\n } else if (ws.ending) {\n if (callback)\n this.once(\"end\", callback);\n } else if (ws.needDrain) {\n if (callback)\n this.once(\"drain\", function() {\n return _this2.flush(kind, callback);\n });\n } else\n this._flushFlag = kind, this.write(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.close = function(callback) {\n _close(this, callback), process.nextTick(emitCloseNT, this);\n };\n function _close(engine, callback) {\n if (callback)\n process.nextTick(callback);\n if (!engine._handle)\n return;\n engine._handle.close(), engine._handle = null;\n }\n function emitCloseNT(self) {\n self.emit(\"close\");\n }\n Zlib.prototype._transform = function(chunk, encoding, cb) {\n var flushFlag, ws = this._writableState, ending = ws.ending || ws.ended, last = ending && (!chunk || ws.length === chunk.length);\n if (chunk !== null && !Buffer2.isBuffer(chunk))\n return cb(new Error(\"invalid input\"));\n if (!this._handle)\n return cb(new Error(\"zlib binding closed\"));\n if (last)\n flushFlag = this._finishFlushFlag;\n else if (flushFlag = this._flushFlag, chunk.length >= ws.length)\n this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;\n this._processChunk(chunk, flushFlag, cb);\n }, Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {\n var availInBefore = chunk && chunk.length, availOutBefore = this._chunkSize - this._offset, inOff = 0, self = this, async = typeof cb === \"function\";\n if (!async) {\n var buffers = [], nread = 0, error;\n this.on(\"error\", function(er) {\n error = er;\n }), assert(this._handle, \"zlib binding closed\");\n do\n var res = this._handle.writeSync(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n while (!this._hadError && callback(res[0], res[1]));\n if (this._hadError)\n throw error;\n if (nread >= kMaxLength)\n _close(this), @throwRangeError(kRangeErrorMessage);\n var buf = Buffer2.concat(buffers, nread);\n return _close(this), buf;\n }\n assert(this._handle, \"zlib binding closed\");\n var req = this._handle.write(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n req.buffer = chunk, req.callback = callback;\n function callback(availInAfter, availOutAfter) {\n if (this)\n this.buffer = null, this.callback = null;\n if (self._hadError)\n return;\n var have = availOutBefore - availOutAfter;\n if (assert(have >= 0, \"have should not go down\"), have > 0) {\n var out = self._buffer.slice(self._offset, self._offset + have);\n if (self._offset += have, async)\n self.push(out);\n else\n buffers.push(out), nread += out.length;\n }\n if (availOutAfter === 0 || self._offset >= self._chunkSize)\n availOutBefore = self._chunkSize, self._offset = 0, self._buffer = Buffer2.allocUnsafe(self._chunkSize);\n if (availOutAfter === 0) {\n if (inOff += availInBefore - availInAfter, availInBefore = availInAfter, !async)\n return !0;\n var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);\n newReq.callback = callback, newReq.buffer = chunk;\n return;\n }\n if (!async)\n return !1;\n cb();\n }\n }, util.inherits(Deflate, Zlib), util.inherits(Inflate, Zlib), util.inherits(Gzip, Zlib), util.inherits(Gunzip, Zlib), util.inherits(DeflateRaw, Zlib), util.inherits(InflateRaw, Zlib), util.inherits(Unzip, Zlib);\n }\n});\nreturn require_lib()})\n"_s;
+static constexpr ASCIILiteral NodeWorkerThreadsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/worker_threads.ts\nvar emitWarning = function(type, message) {\n if (emittedWarnings.has(type))\n return;\n emittedWarnings.add(type), console.warn(\"[bun] Warning:\", message);\n}, injectFakeEmitter = function(Class) {\n function messageEventHandler(event) {\n return event.data;\n }\n function errorEventHandler(event) {\n return event.error;\n }\n const wrappedListener = Symbol(\"wrappedListener\");\n function wrapped(run, listener) {\n const callback = function(event) {\n return listener(run(event));\n };\n return listener[wrappedListener] = callback, callback;\n }\n function functionForEventType(event, listener) {\n switch (event) {\n case \"error\":\n case \"messageerror\":\n return wrapped(errorEventHandler, listener);\n default:\n return wrapped(messageEventHandler, listener);\n }\n }\n Class.prototype.on = function(event, listener) {\n return this.addEventListener(event, functionForEventType(event, listener)), this;\n }, Class.prototype.off = function(event, listener) {\n if (listener)\n this.removeEventListener(event, listener[wrappedListener] || listener);\n else\n this.removeEventListener(event);\n return this;\n }, Class.prototype.once = function(event, listener) {\n return this.addEventListener(event, functionForEventType(event, listener), { once: !0 }), this;\n };\n function EventClass(eventName) {\n if (eventName === \"error\" || eventName === \"messageerror\")\n return ErrorEvent;\n return MessageEvent;\n }\n Class.prototype.emit = function(event, ...args) {\n return this.dispatchEvent(new (EventClass(event))(event, ...args)), this;\n }, Class.prototype.prependListener = Class.prototype.on, Class.prototype.prependOnceListener = Class.prototype.once;\n}, receiveMessageOnPort = function(port) {\n let res = _receiveMessageOnPort(port);\n if (!res)\n return @undefined;\n return {\n message: res\n };\n}, fakeParentPort = function() {\n const fake = Object.create(MessagePort.prototype);\n return Object.defineProperty(fake, \"onmessage\", {\n get() {\n return self.onmessage;\n },\n set(value) {\n self.onmessage = value;\n }\n }), Object.defineProperty(fake, \"onmessageerror\", {\n get() {\n return self.onmessageerror;\n },\n set(value) {\n }\n }), Object.defineProperty(fake, \"postMessage\", {\n value(...args) {\n return self.postMessage(...args);\n }\n }), Object.defineProperty(fake, \"close\", {\n value() {\n return process.exit(0);\n }\n }), Object.defineProperty(fake, \"start\", {\n value() {\n }\n }), Object.defineProperty(fake, \"unref\", {\n value() {\n }\n }), Object.defineProperty(fake, \"ref\", {\n value() {\n }\n }), Object.defineProperty(fake, \"hasRef\", {\n value() {\n return !1;\n }\n }), Object.defineProperty(fake, \"setEncoding\", {\n value() {\n }\n }), Object.defineProperty(fake, \"addEventListener\", {\n value: self.addEventListener.bind(self)\n }), Object.defineProperty(fake, \"removeEventListener\", {\n value: self.removeEventListener.bind(self)\n }), fake;\n}, getEnvironmentData = function() {\n return process.env;\n}, setEnvironmentData = function(env) {\n process.env = env;\n}, markAsUntransferable = function() {\n throwNotImplemented(\"worker_threads.markAsUntransferable\");\n}, moveMessagePortToContext = function() {\n throwNotImplemented(\"worker_threads.moveMessagePortToContext\");\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), { MessageChannel, BroadcastChannel, Worker: WebWorker } = globalThis, SHARE_ENV = Symbol(\"nodejs.worker_threads.SHARE_ENV\"), isMainThread = Bun.isMainThread, [_workerData, _threadId, _receiveMessageOnPort] = @lazy(\"worker_threads\"), emittedWarnings = new Set, _MessagePort = globalThis.MessagePort;\ninjectFakeEmitter(_MessagePort);\nvar MessagePort = _MessagePort, resourceLimits = {}, workerData = _workerData, threadId = _threadId, parentPort = isMainThread \? null : fakeParentPort(), unsupportedOptions = [\n \"eval\",\n \"argv\",\n \"execArgv\",\n \"stdin\",\n \"stdout\",\n \"stderr\",\n \"trackedUnmanagedFds\",\n \"resourceLimits\"\n];\n\nclass Worker extends EventEmitter {\n #worker;\n #performance;\n #onExitPromise = @undefined;\n constructor(filename, options = {}) {\n super();\n for (let key of unsupportedOptions)\n if (key in options)\n emitWarning(\"option.\" + key, `worker_threads.Worker option \"${key}\" is not implemented.`);\n this.#worker = new WebWorker(filename, options), this.#worker.addEventListener(\"close\", this.#onClose.bind(this)), this.#worker.addEventListener(\"error\", this.#onError.bind(this)), this.#worker.addEventListener(\"message\", this.#onMessage.bind(this)), this.#worker.addEventListener(\"messageerror\", this.#onMessageError.bind(this)), this.#worker.addEventListener(\"open\", this.#onOpen.bind(this));\n }\n get threadId() {\n return this.#worker.threadId;\n }\n ref() {\n this.#worker.ref();\n }\n unref() {\n this.#worker.unref();\n }\n get stdin() {\n return null;\n }\n get stdout() {\n return null;\n }\n get stderr() {\n return null;\n }\n get performance() {\n return this.#performance \?\?= {\n eventLoopUtilization() {\n return emitWarning(\"performance\", \"worker_threads.Worker.performance is not implemented.\"), {\n idle: 0,\n active: 0,\n utilization: 0\n };\n }\n };\n }\n terminate() {\n const onExitPromise = this.#onExitPromise;\n if (onExitPromise)\n return @isPromise(onExitPromise) \? onExitPromise : @Promise.resolve(onExitPromise);\n const { resolve, promise } = @Promise.withResolvers();\n return this.#worker.addEventListener(\"close\", (event) => {\n resolve(event.code);\n }, { once: !0 }), this.#worker.terminate(), this.#onExitPromise = promise;\n }\n postMessage(...args) {\n return this.#worker.postMessage(...args);\n }\n #onClose(e) {\n this.#onExitPromise = e.code, this.emit(\"exit\", e.code);\n }\n #onError(error) {\n this.emit(\"error\", error);\n }\n #onMessage(event) {\n this.emit(\"message\", event.data);\n }\n #onMessageError(event) {\n this.emit(\"messageerror\", event.error \?\? event.data \?\? event);\n }\n #onOpen() {\n this.emit(\"online\");\n }\n async getHeapSnapshot() {\n throwNotImplemented(\"worker_threads.Worker.getHeapSnapshot\");\n }\n}\n$ = {\n Worker,\n workerData,\n parentPort,\n resourceLimits,\n isMainThread,\n MessageChannel,\n BroadcastChannel,\n MessagePort,\n getEnvironmentData,\n setEnvironmentData,\n getHeapSnapshot() {\n return {};\n },\n markAsUntransferable,\n moveMessagePortToContext,\n receiveMessageOnPort,\n SHARE_ENV,\n threadId\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyDepdCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/depd.ts\nvar wrapfunction = function(fn, message) {\n if (typeof fn !== \"function\")\n @throwTypeError(\"argument fn must be a function\");\n return fn;\n}, wrapproperty = function(obj, prop, message) {\n if (!obj || typeof obj !== \"object\" && typeof obj !== \"function\")\n @throwTypeError(\"argument obj must be object\");\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n if (!descriptor)\n @throwTypeError(\"must call property on owner object\");\n if (!descriptor.configurable)\n @throwTypeError(\"property must be configurable\");\n}, $;\n$ = function depd(namespace) {\n if (!namespace)\n @throwTypeError(\"argument namespace is required\");\n function deprecate(message) {\n }\n return deprecate._file = void 0, deprecate._ignored = !0, deprecate._namespace = namespace, deprecate._traced = !1, deprecate._warned = Object.create(null), deprecate.function = wrapfunction, deprecate.property = wrapproperty, deprecate;\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeZlibCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/zlib.ts\nvar assert = @getInternalField(@internalModuleRegistry, 8) || @createInternalModuleById(8), BufferModule = @requireNativeModule(\"buffer\"), StreamModule = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), Util = @getInternalField(@internalModuleRegistry, 48) || @createInternalModuleById(48), __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_zstream = __commonJS({\n \"node_modules/pako/lib/zlib/zstream.js\"(exports, module2) {\n function ZStream() {\n this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = \"\", this.state = null, this.data_type = 2, this.adler = 0;\n }\n module2.exports = ZStream;\n }\n}), require_common = __commonJS({\n \"node_modules/pako/lib/utils/common.js\"(exports) {\n var TYPED_OK = typeof @Uint8Array !== \"undefined\" && typeof Uint16Array !== \"undefined\" && typeof Int32Array !== \"undefined\";\n function _has(obj, key) {\n return Object.prototype.hasOwnProperty.@call(obj, key);\n }\n exports.assign = function(obj) {\n var sources = @Array.prototype.slice.@call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source)\n continue;\n if (typeof source !== \"object\")\n @throwTypeError(source + \"must be non-object\");\n for (var p in source)\n if (_has(source, p))\n obj[p] = source[p];\n }\n return obj;\n }, exports.shrinkBuf = function(buf, size) {\n if (buf.length === size)\n return buf;\n if (buf.subarray)\n return buf.subarray(0, size);\n return buf.length = size, buf;\n };\n var fnTyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n var i, l, len, pos, chunk, result;\n len = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n len += chunks[i].length;\n result = new @Uint8Array(len), pos = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n chunk = chunks[i], result.set(chunk, pos), pos += chunk.length;\n return result;\n }\n }, fnUntyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n return [].concat.@apply([], chunks);\n }\n };\n exports.setTyped = function(on) {\n if (on)\n exports.Buf8 = @Uint8Array, exports.Buf16 = Uint16Array, exports.Buf32 = Int32Array, exports.assign(exports, fnTyped);\n else\n exports.Buf8 = @Array, exports.Buf16 = @Array, exports.Buf32 = @Array, exports.assign(exports, fnUntyped);\n }, exports.setTyped(TYPED_OK);\n }\n}), require_trees = __commonJS({\n \"node_modules/pako/lib/zlib/trees.js\"(exports) {\n var utils = require_common(), Z_FIXED = 4, Z_BINARY = 0, Z_TEXT = 1, Z_UNKNOWN = 2;\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n var STORED_BLOCK = 0, STATIC_TREES = 1, DYN_TREES = 2, MIN_MATCH = 3, MAX_MATCH = 258, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, Buf_size = 16, MAX_BL_BITS = 7, END_BLOCK = 256, REP_3_6 = 16, REPZ_3_10 = 17, REPZ_11_138 = 18, extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], extra_dbits = [\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 4,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 8,\n 8,\n 9,\n 9,\n 10,\n 10,\n 11,\n 11,\n 12,\n 12,\n 13,\n 13\n ], extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], DIST_CODE_LEN = 512, static_ltree = new @Array((L_CODES + 2) * 2);\n zero(static_ltree);\n var static_dtree = new @Array(D_CODES * 2);\n zero(static_dtree);\n var _dist_code = new @Array(DIST_CODE_LEN);\n zero(_dist_code);\n var _length_code = new @Array(MAX_MATCH - MIN_MATCH + 1);\n zero(_length_code);\n var base_length = new @Array(LENGTH_CODES);\n zero(base_length);\n var base_dist = new @Array(D_CODES);\n zero(base_dist);\n function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree, this.extra_bits = extra_bits, this.extra_base = extra_base, this.elems = elems, this.max_length = max_length, this.has_stree = static_tree && static_tree.length;\n }\n var static_l_desc, static_d_desc, static_bl_desc;\n function TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree, this.max_code = 0, this.stat_desc = stat_desc;\n }\n function d_code(dist) {\n return dist < 256 \? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n }\n function put_short(s, w) {\n s.pending_buf[s.pending++] = w & 255, s.pending_buf[s.pending++] = w >>> 8 & 255;\n }\n function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length)\n s.bi_buf |= value << s.bi_valid & 65535, put_short(s, s.bi_buf), s.bi_buf = value >> Buf_size - s.bi_valid, s.bi_valid += length - Buf_size;\n else\n s.bi_buf |= value << s.bi_valid & 65535, s.bi_valid += length;\n }\n function send_code(s, c, tree) {\n send_bits(s, tree[c * 2], tree[c * 2 + 1]);\n }\n function bi_reverse(code, len) {\n var res = 0;\n do\n res |= code & 1, code >>>= 1, res <<= 1;\n while (--len > 0);\n return res >>> 1;\n }\n function bi_flush(s) {\n if (s.bi_valid === 16)\n put_short(s, s.bi_buf), s.bi_buf = 0, s.bi_valid = 0;\n else if (s.bi_valid >= 8)\n s.pending_buf[s.pending++] = s.bi_buf & 255, s.bi_buf >>= 8, s.bi_valid -= 8;\n }\n function gen_bitlen(s, desc) {\n var { dyn_tree: tree, max_code } = desc, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, extra = desc.stat_desc.extra_bits, base = desc.stat_desc.extra_base, max_length = desc.stat_desc.max_length, h, n, m, bits, xbits, f, overflow = 0;\n for (bits = 0;bits <= MAX_BITS; bits++)\n s.bl_count[bits] = 0;\n tree[s.heap[s.heap_max] * 2 + 1] = 0;\n for (h = s.heap_max + 1;h < HEAP_SIZE; h++) {\n if (n = s.heap[h], bits = tree[tree[n * 2 + 1] * 2 + 1] + 1, bits > max_length)\n bits = max_length, overflow++;\n if (tree[n * 2 + 1] = bits, n > max_code)\n continue;\n if (s.bl_count[bits]++, xbits = 0, n >= base)\n xbits = extra[n - base];\n if (f = tree[n * 2], s.opt_len += f * (bits + xbits), has_stree)\n s.static_len += f * (stree[n * 2 + 1] + xbits);\n }\n if (overflow === 0)\n return;\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0)\n bits--;\n s.bl_count[bits]--, s.bl_count[bits + 1] += 2, s.bl_count[max_length]--, overflow -= 2;\n } while (overflow > 0);\n for (bits = max_length;bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n if (m = s.heap[--h], m > max_code)\n continue;\n if (tree[m * 2 + 1] !== bits)\n s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2], tree[m * 2 + 1] = bits;\n n--;\n }\n }\n }\n function gen_codes(tree, max_code, bl_count) {\n var next_code = new @Array(MAX_BITS + 1), code = 0, bits, n;\n for (bits = 1;bits <= MAX_BITS; bits++)\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n for (n = 0;n <= max_code; n++) {\n var len = tree[n * 2 + 1];\n if (len === 0)\n continue;\n tree[n * 2] = bi_reverse(next_code[len]++, len);\n }\n }\n function tr_static_init() {\n var n, bits, length, code, dist, bl_count = new @Array(MAX_BITS + 1);\n length = 0;\n for (code = 0;code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0;n < 1 << extra_lbits[code]; n++)\n _length_code[length++] = code;\n }\n _length_code[length - 1] = code, dist = 0;\n for (code = 0;code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0;n < 1 << extra_dbits[code]; n++)\n _dist_code[dist++] = code;\n }\n dist >>= 7;\n for (;code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0;n < 1 << extra_dbits[code] - 7; n++)\n _dist_code[256 + dist++] = code;\n }\n for (bits = 0;bits <= MAX_BITS; bits++)\n bl_count[bits] = 0;\n n = 0;\n while (n <= 143)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n while (n <= 255)\n static_ltree[n * 2 + 1] = 9, n++, bl_count[9]++;\n while (n <= 279)\n static_ltree[n * 2 + 1] = 7, n++, bl_count[7]++;\n while (n <= 287)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n for (n = 0;n < D_CODES; n++)\n static_dtree[n * 2 + 1] = 5, static_dtree[n * 2] = bi_reverse(n, 5);\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS), static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS), static_bl_desc = new StaticTreeDesc(new @Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n }\n function init_block(s) {\n var n;\n for (n = 0;n < L_CODES; n++)\n s.dyn_ltree[n * 2] = 0;\n for (n = 0;n < D_CODES; n++)\n s.dyn_dtree[n * 2] = 0;\n for (n = 0;n < BL_CODES; n++)\n s.bl_tree[n * 2] = 0;\n s.dyn_ltree[END_BLOCK * 2] = 1, s.opt_len = s.static_len = 0, s.last_lit = s.matches = 0;\n }\n function bi_windup(s) {\n if (s.bi_valid > 8)\n put_short(s, s.bi_buf);\n else if (s.bi_valid > 0)\n s.pending_buf[s.pending++] = s.bi_buf;\n s.bi_buf = 0, s.bi_valid = 0;\n }\n function copy_block(s, buf, len, header) {\n if (bi_windup(s), header)\n put_short(s, len), put_short(s, ~len);\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending), s.pending += len;\n }\n function smaller(tree, n, m, depth) {\n var _n2 = n * 2, _m2 = m * 2;\n return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];\n }\n function pqdownheap(s, tree, k) {\n var v = s.heap[k], j = k << 1;\n while (j <= s.heap_len) {\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth))\n j++;\n if (smaller(tree, v, s.heap[j], s.depth))\n break;\n s.heap[k] = s.heap[j], k = j, j <<= 1;\n }\n s.heap[k] = v;\n }\n function compress_block(s, ltree, dtree) {\n var dist, lc, lx = 0, code, extra;\n if (s.last_lit !== 0)\n do\n if (dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1], lc = s.pending_buf[s.l_buf + lx], lx++, dist === 0)\n send_code(s, lc, ltree);\n else {\n if (code = _length_code[lc], send_code(s, code + LITERALS + 1, ltree), extra = extra_lbits[code], extra !== 0)\n lc -= base_length[code], send_bits(s, lc, extra);\n if (dist--, code = d_code(dist), send_code(s, code, dtree), extra = extra_dbits[code], extra !== 0)\n dist -= base_dist[code], send_bits(s, dist, extra);\n }\n while (lx < s.last_lit);\n send_code(s, END_BLOCK, ltree);\n }\n function build_tree(s, desc) {\n var tree = desc.dyn_tree, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, elems = desc.stat_desc.elems, n, m, max_code = -1, node;\n s.heap_len = 0, s.heap_max = HEAP_SIZE;\n for (n = 0;n < elems; n++)\n if (tree[n * 2] !== 0)\n s.heap[++s.heap_len] = max_code = n, s.depth[n] = 0;\n else\n tree[n * 2 + 1] = 0;\n while (s.heap_len < 2)\n if (node = s.heap[++s.heap_len] = max_code < 2 \? ++max_code : 0, tree[node * 2] = 1, s.depth[node] = 0, s.opt_len--, has_stree)\n s.static_len -= stree[node * 2 + 1];\n desc.max_code = max_code;\n for (n = s.heap_len >> 1;n >= 1; n--)\n pqdownheap(s, tree, n);\n node = elems;\n do\n n = s.heap[1], s.heap[1] = s.heap[s.heap_len--], pqdownheap(s, tree, 1), m = s.heap[1], s.heap[--s.heap_max] = n, s.heap[--s.heap_max] = m, tree[node * 2] = tree[n * 2] + tree[m * 2], s.depth[node] = (s.depth[n] >= s.depth[m] \? s.depth[n] : s.depth[m]) + 1, tree[n * 2 + 1] = tree[m * 2 + 1] = node, s.heap[1] = node++, pqdownheap(s, tree, 1);\n while (s.heap_len >= 2);\n s.heap[--s.heap_max] = s.heap[1], gen_bitlen(s, desc), gen_codes(tree, max_code, s.bl_count);\n }\n function scan_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n tree[(max_code + 1) * 2 + 1] = 65535;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n s.bl_tree[curlen * 2] += count;\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n s.bl_tree[curlen * 2]++;\n s.bl_tree[REP_3_6 * 2]++;\n } else if (count <= 10)\n s.bl_tree[REPZ_3_10 * 2]++;\n else\n s.bl_tree[REPZ_11_138 * 2]++;\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function send_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n do\n send_code(s, curlen, s.bl_tree);\n while (--count !== 0);\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n send_code(s, curlen, s.bl_tree), count--;\n send_code(s, REP_3_6, s.bl_tree), send_bits(s, count - 3, 2);\n } else if (count <= 10)\n send_code(s, REPZ_3_10, s.bl_tree), send_bits(s, count - 3, 3);\n else\n send_code(s, REPZ_11_138, s.bl_tree), send_bits(s, count - 11, 7);\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function build_bl_tree(s) {\n var max_blindex;\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code), scan_tree(s, s.dyn_dtree, s.d_desc.max_code), build_tree(s, s.bl_desc);\n for (max_blindex = BL_CODES - 1;max_blindex >= 3; max_blindex--)\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0)\n break;\n return s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4, max_blindex;\n }\n function send_all_trees(s, lcodes, dcodes, blcodes) {\n var rank;\n send_bits(s, lcodes - 257, 5), send_bits(s, dcodes - 1, 5), send_bits(s, blcodes - 4, 4);\n for (rank = 0;rank < blcodes; rank++)\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);\n send_tree(s, s.dyn_ltree, lcodes - 1), send_tree(s, s.dyn_dtree, dcodes - 1);\n }\n function detect_data_type(s) {\n var black_mask = 4093624447, n;\n for (n = 0;n <= 31; n++, black_mask >>>= 1)\n if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0)\n return Z_BINARY;\n if (s.dyn_ltree[18] !== 0 || s.dyn_ltree[20] !== 0 || s.dyn_ltree[26] !== 0)\n return Z_TEXT;\n for (n = 32;n < LITERALS; n++)\n if (s.dyn_ltree[n * 2] !== 0)\n return Z_TEXT;\n return Z_BINARY;\n }\n var static_init_done = !1;\n function _tr_init(s) {\n if (!static_init_done)\n tr_static_init(), static_init_done = !0;\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc), s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc), s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc), s.bi_buf = 0, s.bi_valid = 0, init_block(s);\n }\n function _tr_stored_block(s, buf, stored_len, last) {\n send_bits(s, (STORED_BLOCK << 1) + (last \? 1 : 0), 3), copy_block(s, buf, stored_len, !0);\n }\n function _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3), send_code(s, END_BLOCK, static_ltree), bi_flush(s);\n }\n function _tr_flush_block(s, buf, stored_len, last) {\n var opt_lenb, static_lenb, max_blindex = 0;\n if (s.level > 0) {\n if (s.strm.data_type === Z_UNKNOWN)\n s.strm.data_type = detect_data_type(s);\n if (build_tree(s, s.l_desc), build_tree(s, s.d_desc), max_blindex = build_bl_tree(s), opt_lenb = s.opt_len + 3 + 7 >>> 3, static_lenb = s.static_len + 3 + 7 >>> 3, static_lenb <= opt_lenb)\n opt_lenb = static_lenb;\n } else\n opt_lenb = static_lenb = stored_len + 5;\n if (stored_len + 4 <= opt_lenb && buf !== -1)\n _tr_stored_block(s, buf, stored_len, last);\n else if (s.strategy === Z_FIXED || static_lenb === opt_lenb)\n send_bits(s, (STATIC_TREES << 1) + (last \? 1 : 0), 3), compress_block(s, static_ltree, static_dtree);\n else\n send_bits(s, (DYN_TREES << 1) + (last \? 1 : 0), 3), send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1), compress_block(s, s.dyn_ltree, s.dyn_dtree);\n if (init_block(s), last)\n bi_windup(s);\n }\n function _tr_tally(s, dist, lc) {\n if (s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255, s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255, s.pending_buf[s.l_buf + s.last_lit] = lc & 255, s.last_lit++, dist === 0)\n s.dyn_ltree[lc * 2]++;\n else\n s.matches++, dist--, s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++, s.dyn_dtree[d_code(dist) * 2]++;\n return s.last_lit === s.lit_bufsize - 1;\n }\n exports._tr_init = _tr_init, exports._tr_stored_block = _tr_stored_block, exports._tr_flush_block = _tr_flush_block, exports._tr_tally = _tr_tally, exports._tr_align = _tr_align;\n }\n}), require_adler32 = __commonJS({\n \"node_modules/pako/lib/zlib/adler32.js\"(exports, module2) {\n function adler32(adler, buf, len, pos) {\n var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;\n while (len !== 0) {\n n = len > 2000 \? 2000 : len, len -= n;\n do\n s1 = s1 + buf[pos++] | 0, s2 = s2 + s1 | 0;\n while (--n);\n s1 %= 65521, s2 %= 65521;\n }\n return s1 | s2 << 16 | 0;\n }\n module2.exports = adler32;\n }\n}), require_crc32 = __commonJS({\n \"node_modules/pako/lib/zlib/crc32.js\"(exports, module2) {\n function makeTable() {\n var c, table = [];\n for (var n = 0;n < 256; n++) {\n c = n;\n for (var k = 0;k < 8; k++)\n c = c & 1 \? 3988292384 ^ c >>> 1 : c >>> 1;\n table[n] = c;\n }\n return table;\n }\n var crcTable = makeTable();\n function crc32(crc, buf, len, pos) {\n var t = crcTable, end = pos + len;\n crc ^= -1;\n for (var i = pos;i < end; i++)\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];\n return crc ^ -1;\n }\n module2.exports = crc32;\n }\n}), require_messages = __commonJS({\n \"node_modules/pako/lib/zlib/messages.js\"(exports, module2) {\n module2.exports = {\n 2: \"need dictionary\",\n 1: \"stream end\",\n 0: \"\",\n \"-1\": \"file error\",\n \"-2\": \"stream error\",\n \"-3\": \"data error\",\n \"-4\": \"insufficient memory\",\n \"-5\": \"buffer error\",\n \"-6\": \"incompatible version\"\n };\n }\n}), require_deflate = __commonJS({\n \"node_modules/pako/lib/zlib/deflate.js\"(exports) {\n var utils = require_common(), trees = require_trees(), adler32 = require_adler32(), crc32 = require_crc32(), msg = require_messages(), Z_NO_FLUSH = 0, Z_PARTIAL_FLUSH = 1, Z_FULL_FLUSH = 3, Z_FINISH = 4, Z_BLOCK = 5, Z_OK = 0, Z_STREAM_END = 1, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_BUF_ERROR = -5, Z_DEFAULT_COMPRESSION = -1, Z_FILTERED = 1, Z_HUFFMAN_ONLY = 2, Z_RLE = 3, Z_FIXED = 4, Z_DEFAULT_STRATEGY = 0, Z_UNKNOWN = 2, Z_DEFLATED = 8, MAX_MEM_LEVEL = 9, MAX_WBITS = 15, DEF_MEM_LEVEL = 8, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, MIN_MATCH = 3, MAX_MATCH = 258, MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, PRESET_DICT = 32, INIT_STATE = 42, EXTRA_STATE = 69, NAME_STATE = 73, COMMENT_STATE = 91, HCRC_STATE = 103, BUSY_STATE = 113, FINISH_STATE = 666, BS_NEED_MORE = 1, BS_BLOCK_DONE = 2, BS_FINISH_STARTED = 3, BS_FINISH_DONE = 4, OS_CODE = 3;\n function err(strm, errorCode) {\n return strm.msg = msg[errorCode], errorCode;\n }\n function rank(f) {\n return (f << 1) - (f > 4 \? 9 : 0);\n }\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n function flush_pending(strm) {\n var s = strm.state, len = s.pending;\n if (len > strm.avail_out)\n len = strm.avail_out;\n if (len === 0)\n return;\n if (utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out), strm.next_out += len, s.pending_out += len, strm.total_out += len, strm.avail_out -= len, s.pending -= len, s.pending === 0)\n s.pending_out = 0;\n }\n function flush_block_only(s, last) {\n trees._tr_flush_block(s, s.block_start >= 0 \? s.block_start : -1, s.strstart - s.block_start, last), s.block_start = s.strstart, flush_pending(s.strm);\n }\n function put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n }\n function putShortMSB(s, b) {\n s.pending_buf[s.pending++] = b >>> 8 & 255, s.pending_buf[s.pending++] = b & 255;\n }\n function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n if (len > size)\n len = size;\n if (len === 0)\n return 0;\n if (strm.avail_in -= len, utils.arraySet(buf, strm.input, strm.next_in, len, start), strm.state.wrap === 1)\n strm.adler = adler32(strm.adler, buf, len, start);\n else if (strm.state.wrap === 2)\n strm.adler = crc32(strm.adler, buf, len, start);\n return strm.next_in += len, strm.total_in += len, len;\n }\n function longest_match(s, cur_match) {\n var { max_chain_length: chain_length, strstart: scan } = s, match, len, best_len = s.prev_length, nice_match = s.nice_match, limit = s.strstart > s.w_size - MIN_LOOKAHEAD \? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0, _win = s.window, wmask = s.w_mask, prev = s.prev, strend = s.strstart + MAX_MATCH, scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n if (s.prev_length >= s.good_match)\n chain_length >>= 2;\n if (nice_match > s.lookahead)\n nice_match = s.lookahead;\n do {\n if (match = cur_match, _win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1])\n continue;\n scan += 2, match++;\n do\n ;\n while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);\n if (len = MAX_MATCH - (strend - scan), scan = strend - MAX_MATCH, len > best_len) {\n if (s.match_start = cur_match, best_len = len, len >= nice_match)\n break;\n scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n if (best_len <= s.lookahead)\n return best_len;\n return s.lookahead;\n }\n function fill_window(s) {\n var _w_size = s.w_size, p, n, m, more, str;\n do {\n if (more = s.window_size - s.lookahead - s.strstart, s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0), s.match_start -= _w_size, s.strstart -= _w_size, s.block_start -= _w_size, n = s.hash_size, p = n;\n do\n m = s.head[--p], s.head[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n n = _w_size, p = n;\n do\n m = s.prev[--p], s.prev[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n more += _w_size;\n }\n if (s.strm.avail_in === 0)\n break;\n if (n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more), s.lookahead += n, s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert, s.ins_h = s.window[str], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;\n while (s.insert)\n if (s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++, s.insert--, s.lookahead + s.insert < MIN_MATCH)\n break;\n }\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n }\n function deflate_stored(s, flush) {\n var max_block_size = 65535;\n if (max_block_size > s.pending_buf_size - 5)\n max_block_size = s.pending_buf_size - 5;\n for (;; ) {\n if (s.lookahead <= 1) {\n if (fill_window(s), s.lookahead === 0 && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n s.strstart += s.lookahead, s.lookahead = 0;\n var max_start = s.block_start + max_block_size;\n if (s.strstart === 0 || s.strstart >= max_start) {\n if (s.lookahead = s.strstart - max_start, s.strstart = max_start, flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.strstart > s.block_start) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_NEED_MORE;\n }\n function deflate_fast(s, flush) {\n var hash_head, bflush;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD)\n s.match_length = longest_match(s, hash_head);\n if (s.match_length >= MIN_MATCH)\n if (bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n do\n s.strstart++, s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.match_length !== 0);\n s.strstart++;\n } else\n s.strstart += s.match_length, s.match_length = 0, s.ins_h = s.window[s.strstart], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_slow(s, flush) {\n var hash_head, bflush, max_insert;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (s.prev_length = s.match_length, s.prev_match = s.match_start, s.match_length = MIN_MATCH - 1, hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n if (s.match_length = longest_match(s, hash_head), s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096))\n s.match_length = MIN_MATCH - 1;\n }\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH, bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH), s.lookahead -= s.prev_length - 1, s.prev_length -= 2;\n do\n if (++s.strstart <= max_insert)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.prev_length !== 0);\n if (s.match_available = 0, s.match_length = MIN_MATCH - 1, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n } else if (s.match_available) {\n if (bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), bflush)\n flush_block_only(s, !1);\n if (s.strstart++, s.lookahead--, s.strm.avail_out === 0)\n return BS_NEED_MORE;\n } else\n s.match_available = 1, s.strstart++, s.lookahead--;\n }\n if (s.match_available)\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), s.match_available = 0;\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_rle(s, flush) {\n var bflush, prev, scan, strend, _win = s.window;\n for (;; ) {\n if (s.lookahead <= MAX_MATCH) {\n if (fill_window(s), s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (s.match_length = 0, s.lookahead >= MIN_MATCH && s.strstart > 0) {\n if (scan = s.strstart - 1, prev = _win[scan], prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do\n ;\n while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n if (s.match_length = MAX_MATCH - (strend - scan), s.match_length > s.lookahead)\n s.match_length = s.lookahead;\n }\n }\n if (s.match_length >= MIN_MATCH)\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.strstart += s.match_length, s.match_length = 0;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_huff(s, flush) {\n var bflush;\n for (;; ) {\n if (s.lookahead === 0) {\n if (fill_window(s), s.lookahead === 0) {\n if (flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n break;\n }\n }\n if (s.match_length = 0, bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length, this.max_lazy = max_lazy, this.nice_length = nice_length, this.max_chain = max_chain, this.func = func;\n }\n var configuration_table = [\n new Config(0, 0, 0, 0, deflate_stored),\n new Config(4, 4, 8, 4, deflate_fast),\n new Config(4, 5, 16, 8, deflate_fast),\n new Config(4, 6, 32, 32, deflate_fast),\n new Config(4, 4, 16, 16, deflate_slow),\n new Config(8, 16, 32, 32, deflate_slow),\n new Config(8, 16, 128, 128, deflate_slow),\n new Config(8, 32, 128, 256, deflate_slow),\n new Config(32, 128, 258, 1024, deflate_slow),\n new Config(32, 258, 258, 4096, deflate_slow)\n ];\n function lm_init(s) {\n s.window_size = 2 * s.w_size, zero(s.head), s.max_lazy_match = configuration_table[s.level].max_lazy, s.good_match = configuration_table[s.level].good_length, s.nice_match = configuration_table[s.level].nice_length, s.max_chain_length = configuration_table[s.level].max_chain, s.strstart = 0, s.block_start = 0, s.lookahead = 0, s.insert = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, s.ins_h = 0;\n }\n function DeflateState() {\n this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Z_DEFLATED, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2), this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2), this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2), zero(this.dyn_ltree), zero(this.dyn_dtree), zero(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new utils.Buf16(MAX_BITS + 1), this.heap = new utils.Buf16(2 * L_CODES + 1), zero(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new utils.Buf16(2 * L_CODES + 1), zero(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;\n }\n function deflateResetKeep(strm) {\n var s;\n if (!strm || !strm.state)\n return err(strm, Z_STREAM_ERROR);\n if (strm.total_in = strm.total_out = 0, strm.data_type = Z_UNKNOWN, s = strm.state, s.pending = 0, s.pending_out = 0, s.wrap < 0)\n s.wrap = -s.wrap;\n return s.status = s.wrap \? INIT_STATE : BUSY_STATE, strm.adler = s.wrap === 2 \? 0 : 1, s.last_flush = Z_NO_FLUSH, trees._tr_init(s), Z_OK;\n }\n function deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK)\n lm_init(strm.state);\n return ret;\n }\n function deflateSetHeader(strm, head) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (strm.state.wrap !== 2)\n return Z_STREAM_ERROR;\n return strm.state.gzhead = head, Z_OK;\n }\n function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm)\n return Z_STREAM_ERROR;\n var wrap = 1;\n if (level === Z_DEFAULT_COMPRESSION)\n level = 6;\n if (windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (windowBits > 15)\n wrap = 2, windowBits -= 16;\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED)\n return err(strm, Z_STREAM_ERROR);\n if (windowBits === 8)\n windowBits = 9;\n var s = new DeflateState;\n return strm.state = s, s.strm = strm, s.wrap = wrap, s.gzhead = null, s.w_bits = windowBits, s.w_size = 1 << s.w_bits, s.w_mask = s.w_size - 1, s.hash_bits = memLevel + 7, s.hash_size = 1 << s.hash_bits, s.hash_mask = s.hash_size - 1, s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH), s.window = new utils.Buf8(s.w_size * 2), s.head = new utils.Buf16(s.hash_size), s.prev = new utils.Buf16(s.w_size), s.lit_bufsize = 1 << memLevel + 6, s.pending_buf_size = s.lit_bufsize * 4, s.pending_buf = new utils.Buf8(s.pending_buf_size), s.d_buf = 1 * s.lit_bufsize, s.l_buf = 3 * s.lit_bufsize, s.level = level, s.strategy = strategy, s.method = method, deflateReset(strm);\n }\n function deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n }\n function deflate(strm, flush) {\n var old_flush, s, beg, val;\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0)\n return strm \? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n if (s = strm.state, !strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH)\n return err(strm, strm.avail_out === 0 \? Z_BUF_ERROR : Z_STREAM_ERROR);\n if (s.strm = strm, old_flush = s.last_flush, s.last_flush = flush, s.status === INIT_STATE)\n if (s.wrap === 2)\n if (strm.adler = 0, put_byte(s, 31), put_byte(s, 139), put_byte(s, 8), !s.gzhead)\n put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, OS_CODE), s.status = BUSY_STATE;\n else {\n if (put_byte(s, (s.gzhead.text \? 1 : 0) + (s.gzhead.hcrc \? 2 : 0) + (!s.gzhead.extra \? 0 : 4) + (!s.gzhead.name \? 0 : 8) + (!s.gzhead.comment \? 0 : 16)), put_byte(s, s.gzhead.time & 255), put_byte(s, s.gzhead.time >> 8 & 255), put_byte(s, s.gzhead.time >> 16 & 255), put_byte(s, s.gzhead.time >> 24 & 255), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length)\n put_byte(s, s.gzhead.extra.length & 255), put_byte(s, s.gzhead.extra.length >> 8 & 255);\n if (s.gzhead.hcrc)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n s.gzindex = 0, s.status = EXTRA_STATE;\n }\n else {\n var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8, level_flags = -1;\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2)\n level_flags = 0;\n else if (s.level < 6)\n level_flags = 1;\n else if (s.level === 6)\n level_flags = 2;\n else\n level_flags = 3;\n if (header |= level_flags << 6, s.strstart !== 0)\n header |= PRESET_DICT;\n if (header += 31 - header % 31, s.status = BUSY_STATE, putShortMSB(s, header), s.strstart !== 0)\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n strm.adler = 1;\n }\n if (s.status === EXTRA_STATE)\n if (s.gzhead.extra) {\n beg = s.pending;\n while (s.gzindex < (s.gzhead.extra.length & 65535)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size)\n break;\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 255), s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (s.gzindex === s.gzhead.extra.length)\n s.gzindex = 0, s.status = NAME_STATE;\n } else\n s.status = NAME_STATE;\n if (s.status === NAME_STATE)\n if (s.gzhead.name) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.name.length)\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.gzindex = 0, s.status = COMMENT_STATE;\n } else\n s.status = COMMENT_STATE;\n if (s.status === COMMENT_STATE)\n if (s.gzhead.comment) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.comment.length)\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.status = HCRC_STATE;\n } else\n s.status = HCRC_STATE;\n if (s.status === HCRC_STATE)\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size)\n flush_pending(strm);\n if (s.pending + 2 <= s.pending_buf_size)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), strm.adler = 0, s.status = BUSY_STATE;\n } else\n s.status = BUSY_STATE;\n if (s.pending !== 0) {\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH)\n return err(strm, Z_BUF_ERROR);\n if (s.status === FINISH_STATE && strm.avail_in !== 0)\n return err(strm, Z_BUF_ERROR);\n if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY \? deflate_huff(s, flush) : s.strategy === Z_RLE \? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE)\n s.status = FINISH_STATE;\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0)\n s.last_flush = -1;\n return Z_OK;\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH)\n trees._tr_align(s);\n else if (flush !== Z_BLOCK) {\n if (trees._tr_stored_block(s, 0, 0, !1), flush === Z_FULL_FLUSH) {\n if (zero(s.head), s.lookahead === 0)\n s.strstart = 0, s.block_start = 0, s.insert = 0;\n }\n }\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n }\n }\n if (flush !== Z_FINISH)\n return Z_OK;\n if (s.wrap <= 0)\n return Z_STREAM_END;\n if (s.wrap === 2)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), put_byte(s, strm.adler >> 16 & 255), put_byte(s, strm.adler >> 24 & 255), put_byte(s, strm.total_in & 255), put_byte(s, strm.total_in >> 8 & 255), put_byte(s, strm.total_in >> 16 & 255), put_byte(s, strm.total_in >> 24 & 255);\n else\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n if (flush_pending(strm), s.wrap > 0)\n s.wrap = -s.wrap;\n return s.pending !== 0 \? Z_OK : Z_STREAM_END;\n }\n function deflateEnd(strm) {\n var status;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (status = strm.state.status, status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE)\n return err(strm, Z_STREAM_ERROR);\n return strm.state = null, status === BUSY_STATE \? err(strm, Z_DATA_ERROR) : Z_OK;\n }\n function deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, s, str, n, wrap, avail, next, input, tmpDict;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (s = strm.state, wrap = s.wrap, wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead)\n return Z_STREAM_ERROR;\n if (wrap === 1)\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n if (s.wrap = 0, dictLength >= s.w_size) {\n if (wrap === 0)\n zero(s.head), s.strstart = 0, s.block_start = 0, s.insert = 0;\n tmpDict = new utils.Buf8(s.w_size), utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0), dictionary = tmpDict, dictLength = s.w_size;\n }\n avail = strm.avail_in, next = strm.next_in, input = strm.input, strm.avail_in = dictLength, strm.next_in = 0, strm.input = dictionary, fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart, n = s.lookahead - (MIN_MATCH - 1);\n do\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++;\n while (--n);\n s.strstart = str, s.lookahead = MIN_MATCH - 1, fill_window(s);\n }\n return s.strstart += s.lookahead, s.block_start = s.strstart, s.insert = s.lookahead, s.lookahead = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, strm.next_in = next, strm.input = input, strm.avail_in = avail, s.wrap = wrap, Z_OK;\n }\n exports.deflateInit = deflateInit, exports.deflateInit2 = deflateInit2, exports.deflateReset = deflateReset, exports.deflateResetKeep = deflateResetKeep, exports.deflateSetHeader = deflateSetHeader, exports.deflate = deflate, exports.deflateEnd = deflateEnd, exports.deflateSetDictionary = deflateSetDictionary, exports.deflateInfo = \"pako deflate (from Nodeca project)\";\n }\n}), require_inffast = __commonJS({\n \"node_modules/pako/lib/zlib/inffast.js\"(exports, module2) {\n var BAD = 30, TYPE = 12;\n module2.exports = function inflate_fast(strm, start) {\n var state, _in, last, _out, beg, end, dmax, wsize, whave, wnext, s_window, hold, bits, lcode, dcode, lmask, dmask, here, op, len, dist, from, from_source, input, output;\n state = strm.state, _in = strm.next_in, input = strm.input, last = _in + (strm.avail_in - 5), _out = strm.next_out, output = strm.output, beg = _out - (start - strm.avail_out), end = _out + (strm.avail_out - 257), dmax = state.dmax, wsize = state.wsize, whave = state.whave, wnext = state.wnext, s_window = state.window, hold = state.hold, bits = state.bits, lcode = state.lencode, dcode = state.distcode, lmask = (1 << state.lenbits) - 1, dmask = (1 << state.distbits) - 1;\n top:\n do {\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = lcode[hold & lmask];\n dolen:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op === 0)\n output[_out++] = here & 65535;\n else if (op & 16) {\n if (len = here & 65535, op &= 15, op) {\n if (bits < op)\n hold += input[_in++] << bits, bits += 8;\n len += hold & (1 << op) - 1, hold >>>= op, bits -= op;\n }\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = dcode[hold & dmask];\n dodist:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op & 16) {\n if (dist = here & 65535, op &= 15, bits < op) {\n if (hold += input[_in++] << bits, bits += 8, bits < op)\n hold += input[_in++] << bits, bits += 8;\n }\n if (dist += hold & (1 << op) - 1, dist > dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n if (hold >>>= op, bits -= op, op = _out - beg, dist > op) {\n if (op = dist - op, op > whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n }\n if (from = 0, from_source = s_window, wnext === 0) {\n if (from += wsize - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n } else if (wnext < op) {\n if (from += wsize + wnext - op, op -= wnext, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n if (from = 0, wnext < len) {\n op = wnext, len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n }\n } else if (from += wnext - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n while (len > 2)\n output[_out++] = from_source[from++], output[_out++] = from_source[from++], output[_out++] = from_source[from++], len -= 3;\n if (len) {\n if (output[_out++] = from_source[from++], len > 1)\n output[_out++] = from_source[from++];\n }\n } else {\n from = _out - dist;\n do\n output[_out++] = output[from++], output[_out++] = output[from++], output[_out++] = output[from++], len -= 3;\n while (len > 2);\n if (len) {\n if (output[_out++] = output[from++], len > 1)\n output[_out++] = output[from++];\n }\n }\n } else if ((op & 64) === 0) {\n here = dcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } else if ((op & 64) === 0) {\n here = lcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) {\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } while (_in < last && _out < end);\n len = bits >> 3, _in -= len, bits -= len << 3, hold &= (1 << bits) - 1, strm.next_in = _in, strm.next_out = _out, strm.avail_in = _in < last \? 5 + (last - _in) : 5 - (_in - last), strm.avail_out = _out < end \? 257 + (end - _out) : 257 - (_out - end), state.hold = hold, state.bits = bits;\n return;\n };\n }\n}), require_inftrees = __commonJS({\n \"node_modules/pako/lib/zlib/inftrees.js\"(exports, module2) {\n var utils = require_common(), MAXBITS = 15, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, CODES = 0, LENS = 1, DISTS = 2, lbase = [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 13,\n 15,\n 17,\n 19,\n 23,\n 27,\n 31,\n 35,\n 43,\n 51,\n 59,\n 67,\n 83,\n 99,\n 115,\n 131,\n 163,\n 195,\n 227,\n 258,\n 0,\n 0\n ], lext = [\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 17,\n 17,\n 18,\n 18,\n 18,\n 18,\n 19,\n 19,\n 19,\n 19,\n 20,\n 20,\n 20,\n 20,\n 21,\n 21,\n 21,\n 21,\n 16,\n 72,\n 78\n ], dbase = [\n 1,\n 2,\n 3,\n 4,\n 5,\n 7,\n 9,\n 13,\n 17,\n 25,\n 33,\n 49,\n 65,\n 97,\n 129,\n 193,\n 257,\n 385,\n 513,\n 769,\n 1025,\n 1537,\n 2049,\n 3073,\n 4097,\n 6145,\n 8193,\n 12289,\n 16385,\n 24577,\n 0,\n 0\n ], dext = [\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 18,\n 18,\n 19,\n 19,\n 20,\n 20,\n 21,\n 21,\n 22,\n 22,\n 23,\n 23,\n 24,\n 24,\n 25,\n 25,\n 26,\n 26,\n 27,\n 27,\n 28,\n 28,\n 29,\n 29,\n 64,\n 64\n ];\n module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n var bits = opts.bits, len = 0, sym = 0, min = 0, max = 0, root = 0, curr = 0, drop = 0, left = 0, used = 0, huff = 0, incr, fill, low, mask, next, base = null, base_index = 0, end, count = new utils.Buf16(MAXBITS + 1), offs = new utils.Buf16(MAXBITS + 1), extra = null, extra_index = 0, here_bits, here_op, here_val;\n for (len = 0;len <= MAXBITS; len++)\n count[len] = 0;\n for (sym = 0;sym < codes; sym++)\n count[lens[lens_index + sym]]++;\n root = bits;\n for (max = MAXBITS;max >= 1; max--)\n if (count[max] !== 0)\n break;\n if (root > max)\n root = max;\n if (max === 0)\n return table[table_index++] = 1 << 24 | 64 << 16 | 0, table[table_index++] = 1 << 24 | 64 << 16 | 0, opts.bits = 1, 0;\n for (min = 1;min < max; min++)\n if (count[min] !== 0)\n break;\n if (root < min)\n root = min;\n left = 1;\n for (len = 1;len <= MAXBITS; len++)\n if (left <<= 1, left -= count[len], left < 0)\n return -1;\n if (left > 0 && (type === CODES || max !== 1))\n return -1;\n offs[1] = 0;\n for (len = 1;len < MAXBITS; len++)\n offs[len + 1] = offs[len] + count[len];\n for (sym = 0;sym < codes; sym++)\n if (lens[lens_index + sym] !== 0)\n work[offs[lens[lens_index + sym]]++] = sym;\n if (type === CODES)\n base = extra = work, end = 19;\n else if (type === LENS)\n base = lbase, base_index -= 257, extra = lext, extra_index -= 257, end = 256;\n else\n base = dbase, extra = dext, end = -1;\n if (huff = 0, sym = 0, len = min, next = table_index, curr = root, drop = 0, low = -1, used = 1 << root, mask = used - 1, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n for (;; ) {\n if (here_bits = len - drop, work[sym] < end)\n here_op = 0, here_val = work[sym];\n else if (work[sym] > end)\n here_op = extra[extra_index + work[sym]], here_val = base[base_index + work[sym]];\n else\n here_op = 96, here_val = 0;\n incr = 1 << len - drop, fill = 1 << curr, min = fill;\n do\n fill -= incr, table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;\n while (fill !== 0);\n incr = 1 << len - 1;\n while (huff & incr)\n incr >>= 1;\n if (incr !== 0)\n huff &= incr - 1, huff += incr;\n else\n huff = 0;\n if (sym++, --count[len] === 0) {\n if (len === max)\n break;\n len = lens[lens_index + work[sym]];\n }\n if (len > root && (huff & mask) !== low) {\n if (drop === 0)\n drop = root;\n next += min, curr = len - drop, left = 1 << curr;\n while (curr + drop < max) {\n if (left -= count[curr + drop], left <= 0)\n break;\n curr++, left <<= 1;\n }\n if (used += 1 << curr, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n low = huff & mask, table[low] = root << 24 | curr << 16 | next - table_index | 0;\n }\n }\n if (huff !== 0)\n table[next + huff] = len - drop << 24 | 64 << 16 | 0;\n return opts.bits = root, 0;\n };\n }\n}), require_inflate = __commonJS({\n \"node_modules/pako/lib/zlib/inflate.js\"(exports) {\n var utils = require_common(), adler32 = require_adler32(), crc32 = require_crc32(), inflate_fast = require_inffast(), inflate_table = require_inftrees(), CODES = 0, LENS = 1, DISTS = 2, Z_FINISH = 4, Z_BLOCK = 5, Z_TREES = 6, Z_OK = 0, Z_STREAM_END = 1, Z_NEED_DICT = 2, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_MEM_ERROR = -4, Z_BUF_ERROR = -5, Z_DEFLATED = 8, HEAD = 1, FLAGS = 2, TIME = 3, OS = 4, EXLEN = 5, EXTRA = 6, NAME = 7, COMMENT = 8, HCRC = 9, DICTID = 10, DICT = 11, TYPE = 12, TYPEDO = 13, STORED = 14, COPY_ = 15, COPY = 16, TABLE = 17, LENLENS = 18, CODELENS = 19, LEN_ = 20, LEN = 21, LENEXT = 22, DIST = 23, DISTEXT = 24, MATCH = 25, LIT = 26, CHECK = 27, LENGTH = 28, DONE = 29, BAD = 30, MEM = 31, SYNC = 32, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, MAX_WBITS = 15, DEF_WBITS = MAX_WBITS;\n function zswap32(q) {\n return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);\n }\n function InflateState() {\n this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new utils.Buf16(320), this.work = new utils.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;\n }\n function inflateResetKeep(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, strm.total_in = strm.total_out = state.total = 0, strm.msg = \"\", state.wrap)\n strm.adler = state.wrap & 1;\n return state.mode = HEAD, state.last = 0, state.havedict = 0, state.dmax = 32768, state.head = null, state.hold = 0, state.bits = 0, state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS), state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS), state.sane = 1, state.back = -1, Z_OK;\n }\n function inflateReset(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n return state = strm.state, state.wsize = 0, state.whave = 0, state.wnext = 0, inflateResetKeep(strm);\n }\n function inflateReset2(strm, windowBits) {\n var wrap, state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (wrap = (windowBits >> 4) + 1, windowBits < 48)\n windowBits &= 15;\n if (windowBits && (windowBits < 8 || windowBits > 15))\n return Z_STREAM_ERROR;\n if (state.window !== null && state.wbits !== windowBits)\n state.window = null;\n return state.wrap = wrap, state.wbits = windowBits, inflateReset(strm);\n }\n function inflateInit2(strm, windowBits) {\n var ret, state;\n if (!strm)\n return Z_STREAM_ERROR;\n if (state = new InflateState, strm.state = state, state.window = null, ret = inflateReset2(strm, windowBits), ret !== Z_OK)\n strm.state = null;\n return ret;\n }\n function inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n }\n var virgin = !0, lenfix, distfix;\n function fixedtables(state) {\n if (virgin) {\n var sym;\n lenfix = new utils.Buf32(512), distfix = new utils.Buf32(32), sym = 0;\n while (sym < 144)\n state.lens[sym++] = 8;\n while (sym < 256)\n state.lens[sym++] = 9;\n while (sym < 280)\n state.lens[sym++] = 7;\n while (sym < 288)\n state.lens[sym++] = 8;\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {\n bits: 9\n }), sym = 0;\n while (sym < 32)\n state.lens[sym++] = 5;\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {\n bits: 5\n }), virgin = !1;\n }\n state.lencode = lenfix, state.lenbits = 9, state.distcode = distfix, state.distbits = 5;\n }\n function updatewindow(strm, src, end, copy) {\n var dist, state = strm.state;\n if (state.window === null)\n state.wsize = 1 << state.wbits, state.wnext = 0, state.whave = 0, state.window = new utils.Buf8(state.wsize);\n if (copy >= state.wsize)\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0), state.wnext = 0, state.whave = state.wsize;\n else {\n if (dist = state.wsize - state.wnext, dist > copy)\n dist = copy;\n if (utils.arraySet(state.window, src, end - copy, dist, state.wnext), copy -= dist, copy)\n utils.arraySet(state.window, src, end - copy, copy, 0), state.wnext = copy, state.whave = state.wsize;\n else {\n if (state.wnext += dist, state.wnext === state.wsize)\n state.wnext = 0;\n if (state.whave < state.wsize)\n state.whave += dist;\n }\n }\n return 0;\n }\n function inflate(strm, flush) {\n var state, input, output, next, put, have, left, hold, bits, _in, _out, copy, from, from_source, here = 0, here_bits, here_op, here_val, last_bits, last_op, last_val, len, ret, hbuf = new utils.Buf8(4), opts, n, order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.mode === TYPE)\n state.mode = TYPEDO;\n put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, _in = have, _out = left, ret = Z_OK;\n inf_leave:\n for (;; )\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.wrap & 2 && hold === 35615) {\n state.check = 0, hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0), hold = 0, bits = 0, state.mode = FLAGS;\n break;\n }\n if (state.flags = 0, state.head)\n state.head.done = !1;\n if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {\n strm.msg = \"incorrect header check\", state.mode = BAD;\n break;\n }\n if ((hold & 15) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (hold >>>= 4, bits -= 4, len = (hold & 15) + 8, state.wbits === 0)\n state.wbits = len;\n else if (len > state.wbits) {\n strm.msg = \"invalid window size\", state.mode = BAD;\n break;\n }\n state.dmax = 1 << len, strm.adler = state.check = 1, state.mode = hold & 512 \? DICTID : TYPE, hold = 0, bits = 0;\n break;\n case FLAGS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.flags = hold, (state.flags & 255) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (state.flags & 57344) {\n strm.msg = \"unknown header flags set\", state.mode = BAD;\n break;\n }\n if (state.head)\n state.head.text = hold >> 8 & 1;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = TIME;\n case TIME:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.time = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, hbuf[2] = hold >>> 16 & 255, hbuf[3] = hold >>> 24 & 255, state.check = crc32(state.check, hbuf, 4, 0);\n hold = 0, bits = 0, state.mode = OS;\n case OS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.xflags = hold & 255, state.head.os = hold >> 8;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = EXLEN;\n case EXLEN:\n if (state.flags & 1024) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.length = hold, state.head)\n state.head.extra_len = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0;\n } else if (state.head)\n state.head.extra = null;\n state.mode = EXTRA;\n case EXTRA:\n if (state.flags & 1024) {\n if (copy = state.length, copy > have)\n copy = have;\n if (copy) {\n if (state.head) {\n if (len = state.head.extra_len - state.length, !state.head.extra)\n state.head.extra = new @Array(state.head.extra_len);\n utils.arraySet(state.head.extra, input, next, copy, len);\n }\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n have -= copy, next += copy, state.length -= copy;\n }\n if (state.length)\n break inf_leave;\n }\n state.length = 0, state.mode = NAME;\n case NAME:\n if (state.flags & 2048) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.name += @String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.name = null;\n state.length = 0, state.mode = COMMENT;\n case COMMENT:\n if (state.flags & 4096) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.comment += @String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.comment = null;\n state.mode = HCRC;\n case HCRC:\n if (state.flags & 512) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.check & 65535)) {\n strm.msg = \"header crc mismatch\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n if (state.head)\n state.head.hcrc = state.flags >> 9 & 1, state.head.done = !0;\n strm.adler = state.check = 0, state.mode = TYPE;\n break;\n case DICTID:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n strm.adler = state.check = zswap32(hold), hold = 0, bits = 0, state.mode = DICT;\n case DICT:\n if (state.havedict === 0)\n return strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, Z_NEED_DICT;\n strm.adler = state.check = 1, state.mode = TYPE;\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES)\n break inf_leave;\n case TYPEDO:\n if (state.last) {\n hold >>>= bits & 7, bits -= bits & 7, state.mode = CHECK;\n break;\n }\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n switch (state.last = hold & 1, hold >>>= 1, bits -= 1, hold & 3) {\n case 0:\n state.mode = STORED;\n break;\n case 1:\n if (fixedtables(state), state.mode = LEN_, flush === Z_TREES) {\n hold >>>= 2, bits -= 2;\n break inf_leave;\n }\n break;\n case 2:\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = \"invalid block type\", state.mode = BAD;\n }\n hold >>>= 2, bits -= 2;\n break;\n case STORED:\n hold >>>= bits & 7, bits -= bits & 7;\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {\n strm.msg = \"invalid stored block lengths\", state.mode = BAD;\n break;\n }\n if (state.length = hold & 65535, hold = 0, bits = 0, state.mode = COPY_, flush === Z_TREES)\n break inf_leave;\n case COPY_:\n state.mode = COPY;\n case COPY:\n if (copy = state.length, copy) {\n if (copy > have)\n copy = have;\n if (copy > left)\n copy = left;\n if (copy === 0)\n break inf_leave;\n utils.arraySet(output, input, next, copy, put), have -= copy, next += copy, left -= copy, put += copy, state.length -= copy;\n break;\n }\n state.mode = TYPE;\n break;\n case TABLE:\n while (bits < 14) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.nlen = (hold & 31) + 257, hold >>>= 5, bits -= 5, state.ndist = (hold & 31) + 1, hold >>>= 5, bits -= 5, state.ncode = (hold & 15) + 4, hold >>>= 4, bits -= 4, state.nlen > 286 || state.ndist > 30) {\n strm.msg = \"too many length or distance symbols\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = LENLENS;\n case LENLENS:\n while (state.have < state.ncode) {\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.lens[order[state.have++]] = hold & 7, hold >>>= 3, bits -= 3;\n }\n while (state.have < 19)\n state.lens[order[state.have++]] = 0;\n if (state.lencode = state.lendyn, state.lenbits = 7, opts = { bits: state.lenbits }, ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid code lengths set\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = CODELENS;\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_val < 16)\n hold >>>= here_bits, bits -= here_bits, state.lens[state.have++] = here_val;\n else {\n if (here_val === 16) {\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.have === 0) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1], copy = 3 + (hold & 3), hold >>>= 2, bits -= 2;\n } else if (here_val === 17) {\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 3 + (hold & 7), hold >>>= 3, bits -= 3;\n } else {\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 11 + (hold & 127), hold >>>= 7, bits -= 7;\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n while (copy--)\n state.lens[state.have++] = len;\n }\n }\n if (state.mode === BAD)\n break;\n if (state.lens[256] === 0) {\n strm.msg = \"invalid code -- missing end-of-block\", state.mode = BAD;\n break;\n }\n if (state.lenbits = 9, opts = { bits: state.lenbits }, ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid literal/lengths set\", state.mode = BAD;\n break;\n }\n if (state.distbits = 6, state.distcode = state.distdyn, opts = { bits: state.distbits }, ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts), state.distbits = opts.bits, ret) {\n strm.msg = \"invalid distances set\", state.mode = BAD;\n break;\n }\n if (state.mode = LEN_, flush === Z_TREES)\n break inf_leave;\n case LEN_:\n state.mode = LEN;\n case LEN:\n if (have >= 6 && left >= 258) {\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, inflate_fast(strm, _out), put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, state.mode === TYPE)\n state.back = -1;\n break;\n }\n state.back = 0;\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_op && (here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, state.length = here_val, here_op === 0) {\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n state.back = -1, state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break;\n }\n state.extra = here_op & 15, state.mode = LENEXT;\n case LENEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.length += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n state.was = state.length, state.mode = DIST;\n case DIST:\n for (;; ) {\n if (here = state.distcode[hold & (1 << state.distbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, here_op & 64) {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break;\n }\n state.offset = here_val, state.extra = here_op & 15, state.mode = DISTEXT;\n case DISTEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.offset += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n if (state.offset > state.dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n state.mode = MATCH;\n case MATCH:\n if (left === 0)\n break inf_leave;\n if (copy = _out - left, state.offset > copy) {\n if (copy = state.offset - copy, copy > state.whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n }\n if (copy > state.wnext)\n copy -= state.wnext, from = state.wsize - copy;\n else\n from = state.wnext - copy;\n if (copy > state.length)\n copy = state.length;\n from_source = state.window;\n } else\n from_source = output, from = put - state.offset, copy = state.length;\n if (copy > left)\n copy = left;\n left -= copy, state.length -= copy;\n do\n output[put++] = from_source[from++];\n while (--copy);\n if (state.length === 0)\n state.mode = LEN;\n break;\n case LIT:\n if (left === 0)\n break inf_leave;\n output[put++] = state.length, left--, state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold |= input[next++] << bits, bits += 8;\n }\n if (_out -= left, strm.total_out += _out, state.total += _out, _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);\n if (_out = left, (state.flags \? hold : zswap32(hold)) !== state.check) {\n strm.msg = \"incorrect data check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = LENGTH;\n case LENGTH:\n if (state.wrap && state.flags) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.total & 4294967295)) {\n strm.msg = \"incorrect length check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = DONE;\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n default:\n return Z_STREAM_ERROR;\n }\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out))\n return state.mode = MEM, Z_MEM_ERROR;\n }\n if (_in -= strm.avail_in, _out -= strm.avail_out, strm.total_in += _in, strm.total_out += _out, state.total += _out, state.wrap && _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);\n if (strm.data_type = state.bits + (state.last \? 64 : 0) + (state.mode === TYPE \? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ \? 256 : 0), (_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK)\n ret = Z_BUF_ERROR;\n return ret;\n }\n function inflateEnd(strm) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n var state = strm.state;\n if (state.window)\n state.window = null;\n return strm.state = null, Z_OK;\n }\n function inflateGetHeader(strm, head) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, (state.wrap & 2) === 0)\n return Z_STREAM_ERROR;\n return state.head = head, head.done = !1, Z_OK;\n }\n function inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, state, dictid, ret;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.wrap !== 0 && state.mode !== DICT)\n return Z_STREAM_ERROR;\n if (state.mode === DICT) {\n if (dictid = 1, dictid = adler32(dictid, dictionary, dictLength, 0), dictid !== state.check)\n return Z_DATA_ERROR;\n }\n if (ret = updatewindow(strm, dictionary, dictLength, dictLength), ret)\n return state.mode = MEM, Z_MEM_ERROR;\n return state.havedict = 1, Z_OK;\n }\n exports.inflateReset = inflateReset, exports.inflateReset2 = inflateReset2, exports.inflateResetKeep = inflateResetKeep, exports.inflateInit = inflateInit, exports.inflateInit2 = inflateInit2, exports.inflate = inflate, exports.inflateEnd = inflateEnd, exports.inflateGetHeader = inflateGetHeader, exports.inflateSetDictionary = inflateSetDictionary, exports.inflateInfo = \"pako inflate (from Nodeca project)\";\n }\n}), require_constants = __commonJS({\n \"node_modules/pako/lib/zlib/constants.js\"(exports, module2) {\n module2.exports = {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_BUF_ERROR: -5,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n Z_BINARY: 0,\n Z_TEXT: 1,\n Z_UNKNOWN: 2,\n Z_DEFLATED: 8\n };\n }\n}), require_binding = __commonJS({\n \"node_modules/browserify-zlib/lib/binding.js\"(exports) {\n var Zstream = require_zstream(), zlib_deflate = require_deflate(), zlib_inflate = require_inflate(), constants = require_constants();\n for (key in constants)\n exports[key] = constants[key];\n var key;\n exports.NONE = 0, exports.DEFLATE = 1, exports.INFLATE = 2, exports.GZIP = 3, exports.GUNZIP = 4, exports.DEFLATERAW = 5, exports.INFLATERAW = 6, exports.UNZIP = 7;\n var GZIP_HEADER_ID1 = 31, GZIP_HEADER_ID2 = 139;\n function Zlib(mode) {\n if (typeof mode !== \"number\" || mode < exports.DEFLATE || mode > exports.UNZIP)\n @throwTypeError(\"Bad argument\");\n this.dictionary = null, this.err = 0, this.flush = 0, this.init_done = !1, this.level = 0, this.memLevel = 0, this.mode = mode, this.strategy = 0, this.windowBits = 0, this.write_in_progress = !1, this.pending_close = !1, this.gzip_id_bytes_read = 0;\n }\n Zlib.prototype = {}, Zlib.prototype.close = function() {\n if (this.write_in_progress) {\n this.pending_close = !0;\n return;\n }\n if (this.pending_close = !1, assert(this.init_done, \"close before init\"), assert(this.mode <= exports.UNZIP), this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW)\n zlib_deflate.deflateEnd(this.strm);\n else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP)\n zlib_inflate.inflateEnd(this.strm);\n this.mode = exports.NONE, this.dictionary = null;\n }, Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!0, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!1, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype._write = function(async, flush, input, in_off, in_len, out, out_off, out_len) {\n if (assert.equal(arguments.length, 8), assert(this.init_done, \"write before init\"), assert(this.mode !== exports.NONE, \"already finalized\"), assert.equal(!1, this.write_in_progress, \"write already in progress\"), assert.equal(!1, this.pending_close, \"close is pending\"), this.write_in_progress = !0, assert.equal(!1, flush === void 0, \"must provide flush value\"), this.write_in_progress = !0, flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK)\n throw new Error(\"Invalid flush value\");\n if (input == null)\n input = @Buffer.alloc(0), in_len = 0, in_off = 0;\n if (this.strm.avail_in = in_len, this.strm.input = input, this.strm.next_in = in_off, this.strm.avail_out = out_len, this.strm.output = out, this.strm.next_out = out_off, this.flush = flush, !async) {\n if (this._process(), this._checkError())\n return this._afterSync();\n return;\n }\n var self = this;\n return process.nextTick(function() {\n self._process(), self._after();\n }), this;\n }, Zlib.prototype._afterSync = function() {\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n return this.write_in_progress = !1, [avail_in, avail_out];\n }, Zlib.prototype._process = function() {\n var next_expected_header_byte = null;\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n case exports.UNZIP:\n if (this.strm.avail_in > 0)\n next_expected_header_byte = this.strm.next_in;\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n if (this.gzip_id_bytes_read = 1, next_expected_header_byte++, this.strm.avail_in === 1)\n break;\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n case 1:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2)\n this.gzip_id_bytes_read = 2, this.mode = exports.GUNZIP;\n else\n this.mode = exports.INFLATE;\n break;\n default:\n throw new Error(\"invalid number of gzip magic number bytes read\");\n }\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n if (this.err = zlib_inflate.inflate(this.strm, this.flush), this.err === exports.Z_NEED_DICT && this.dictionary) {\n if (this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary), this.err === exports.Z_OK)\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n else if (this.err === exports.Z_DATA_ERROR)\n this.err = exports.Z_NEED_DICT;\n }\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0)\n this.reset(), this.err = zlib_inflate.inflate(this.strm, this.flush);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n }, Zlib.prototype._checkError = function() {\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH)\n return this._error(\"unexpected end of file\"), !1;\n break;\n case exports.Z_STREAM_END:\n break;\n case exports.Z_NEED_DICT:\n if (this.dictionary == null)\n this._error(\"Missing dictionary\");\n else\n this._error(\"Bad dictionary\");\n return !1;\n default:\n return this._error(\"Zlib error\"), !1;\n }\n return !0;\n }, Zlib.prototype._after = function() {\n if (!this._checkError())\n return;\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n if (this.write_in_progress = !1, this.callback(avail_in, avail_out), this.pending_close)\n this.close();\n }, Zlib.prototype._error = function(message) {\n if (this.strm.msg)\n message = this.strm.msg;\n if (this.onerror(message, this.err), this.write_in_progress = !1, this.pending_close)\n this.close();\n }, Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, \"init(windowBits, level, memLevel, strategy, [dictionary])\"), assert(windowBits >= 8 && windowBits <= 15, \"invalid windowBits\"), assert(level >= -1 && level <= 9, \"invalid compression level\"), assert(memLevel >= 1 && memLevel <= 9, \"invalid memlevel\"), assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, \"invalid strategy\"), this._init(level, windowBits, memLevel, strategy, dictionary), this._setDictionary();\n }, Zlib.prototype.params = function() {\n throw new Error(\"deflateParams Not supported\");\n }, Zlib.prototype.reset = function() {\n this._reset(), this._setDictionary();\n }, Zlib.prototype._init = function(level, windowBits, memLevel, strategy, dictionary) {\n if (this.level = level, this.windowBits = windowBits, this.memLevel = memLevel, this.strategy = strategy, this.flush = exports.Z_NO_FLUSH, this.err = exports.Z_OK, this.mode === exports.GZIP || this.mode === exports.GUNZIP)\n this.windowBits += 16;\n if (this.mode === exports.UNZIP)\n this.windowBits += 32;\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW)\n this.windowBits = -1 * this.windowBits;\n switch (this.strm = new Zstream, this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Init error\");\n this.dictionary = dictionary, this.write_in_progress = !1, this.init_done = !0;\n }, Zlib.prototype._setDictionary = function() {\n if (this.dictionary == null)\n return;\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to set dictionary\");\n }, Zlib.prototype._reset = function() {\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to reset stream\");\n }, exports.Zlib = Zlib;\n }\n}), require_lib = __commonJS({\n \"node_modules/browserify-zlib/lib/index.js\"(exports) {\n var Buffer2 = BufferModule.Buffer, Transform = StreamModule.Transform, binding = require_binding(), util = Util, kMaxLength = BufferModule.kMaxLength, kRangeErrorMessage = \"Cannot create final Buffer. It would be larger than 0x\" + kMaxLength.toString(16) + \" bytes\";\n binding.Z_MIN_WINDOWBITS = 8, binding.Z_MAX_WINDOWBITS = 15, binding.Z_DEFAULT_WINDOWBITS = 15, binding.Z_MIN_CHUNK = 64, binding.Z_MAX_CHUNK = @Infinity, binding.Z_DEFAULT_CHUNK = 16384, binding.Z_MIN_MEMLEVEL = 1, binding.Z_MAX_MEMLEVEL = 9, binding.Z_DEFAULT_MEMLEVEL = 8, binding.Z_MIN_LEVEL = -1, binding.Z_MAX_LEVEL = 9, binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;\n var bkeys = Object.keys(binding);\n for (bk = 0;bk < bkeys.length; bk++)\n if (bkey = bkeys[bk], bkey.match(/^Z/))\n Object.defineProperty(exports, bkey, {\n enumerable: !0,\n value: binding[bkey],\n writable: !1\n });\n var bkey, bk, codes = {\n Z_OK: binding.Z_OK,\n Z_STREAM_END: binding.Z_STREAM_END,\n Z_NEED_DICT: binding.Z_NEED_DICT,\n Z_ERRNO: binding.Z_ERRNO,\n Z_STREAM_ERROR: binding.Z_STREAM_ERROR,\n Z_DATA_ERROR: binding.Z_DATA_ERROR,\n Z_MEM_ERROR: binding.Z_MEM_ERROR,\n Z_BUF_ERROR: binding.Z_BUF_ERROR,\n Z_VERSION_ERROR: binding.Z_VERSION_ERROR\n }, ckeys = Object.keys(codes);\n for (ck = 0;ck < ckeys.length; ck++)\n ckey = ckeys[ck], codes[codes[ckey]] = ckey;\n var ckey, ck;\n Object.defineProperty(exports, \"codes\", {\n enumerable: !0,\n value: Object.freeze(codes),\n writable: !1\n }), exports.constants = require_constants(), exports.Deflate = Deflate, exports.Inflate = Inflate, exports.Gzip = Gzip, exports.Gunzip = Gunzip, exports.DeflateRaw = DeflateRaw, exports.InflateRaw = InflateRaw, exports.Unzip = Unzip, exports.createDeflate = function(o) {\n return new Deflate(o);\n }, exports.createInflate = function(o) {\n return new Inflate(o);\n }, exports.createDeflateRaw = function(o) {\n return new DeflateRaw(o);\n }, exports.createInflateRaw = function(o) {\n return new InflateRaw(o);\n }, exports.createGzip = function(o) {\n return new Gzip(o);\n }, exports.createGunzip = function(o) {\n return new Gunzip(o);\n }, exports.createUnzip = function(o) {\n return new Unzip(o);\n }, exports.deflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Deflate(opts), buffer, callback);\n }, exports.deflateSync = function(buffer, opts) {\n return zlibBufferSync(new Deflate(opts), buffer);\n }, exports.gzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gzip(opts), buffer, callback);\n }, exports.gzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gzip(opts), buffer);\n }, exports.deflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new DeflateRaw(opts), buffer, callback);\n }, exports.deflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new DeflateRaw(opts), buffer);\n }, exports.unzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Unzip(opts), buffer, callback);\n }, exports.unzipSync = function(buffer, opts) {\n return zlibBufferSync(new Unzip(opts), buffer);\n }, exports.inflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Inflate(opts), buffer, callback);\n }, exports.inflateSync = function(buffer, opts) {\n return zlibBufferSync(new Inflate(opts), buffer);\n }, exports.gunzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gunzip(opts), buffer, callback);\n }, exports.gunzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gunzip(opts), buffer);\n }, exports.inflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new InflateRaw(opts), buffer, callback);\n }, exports.inflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new InflateRaw(opts), buffer);\n }, exports.brotliCompress = function(buffer, opts, callback) {\n throw new Error(\"zlib.brotliCompress is not implemented\");\n };\n function zlibBuffer(engine, buffer, callback) {\n var buffers = [], nread = 0;\n engine.on(\"error\", onError), engine.on(\"end\", onEnd), engine.end(buffer), flow();\n function flow() {\n var chunk;\n while ((chunk = engine.read()) !== null)\n buffers.push(chunk), nread += chunk.length;\n engine.once(\"readable\", flow);\n }\n function onError(err) {\n engine.removeListener(\"end\", onEnd), engine.removeListener(\"readable\", flow), callback(err);\n }\n function onEnd() {\n var buf, err = null;\n if (nread >= kMaxLength)\n err = new RangeError(kRangeErrorMessage);\n else\n buf = Buffer2.concat(buffers, nread);\n buffers = [], engine.close(), callback(err, buf);\n }\n }\n function zlibBufferSync(engine, buffer) {\n if (typeof buffer === \"string\")\n buffer = Buffer2.from(buffer);\n if (!Buffer2.isBuffer(buffer))\n @throwTypeError(\"Not a string or buffer\");\n var flushFlag = engine._finishFlushFlag;\n return engine._processChunk(buffer, flushFlag);\n }\n function Deflate(opts) {\n if (!(this instanceof Deflate))\n return new Deflate(opts);\n Zlib.@call(this, opts, binding.DEFLATE);\n }\n function Inflate(opts) {\n if (!(this instanceof Inflate))\n return new Inflate(opts);\n Zlib.@call(this, opts, binding.INFLATE);\n }\n function Gzip(opts) {\n if (!(this instanceof Gzip))\n return new Gzip(opts);\n Zlib.@call(this, opts, binding.GZIP);\n }\n function Gunzip(opts) {\n if (!(this instanceof Gunzip))\n return new Gunzip(opts);\n Zlib.@call(this, opts, binding.GUNZIP);\n }\n function DeflateRaw(opts) {\n if (!(this instanceof DeflateRaw))\n return new DeflateRaw(opts);\n Zlib.@call(this, opts, binding.DEFLATERAW);\n }\n function InflateRaw(opts) {\n if (!(this instanceof InflateRaw))\n return new InflateRaw(opts);\n Zlib.@call(this, opts, binding.INFLATERAW);\n }\n function Unzip(opts) {\n if (!(this instanceof Unzip))\n return new Unzip(opts);\n Zlib.@call(this, opts, binding.UNZIP);\n }\n function isValidFlushFlag(flag) {\n return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;\n }\n function Zlib(opts, mode) {\n var _this = this;\n if (this._opts = opts = opts || {}, this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK, Transform.@call(this, opts), opts.flush && !isValidFlushFlag(opts.flush))\n throw new Error(\"Invalid flush flag: \" + opts.flush);\n if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush))\n throw new Error(\"Invalid flush flag: \" + opts.finishFlush);\n if (this._flushFlag = opts.flush || binding.Z_NO_FLUSH, this._finishFlushFlag = typeof opts.finishFlush !== \"undefined\" \? opts.finishFlush : binding.Z_FINISH, opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK)\n throw new Error(\"Invalid chunk size: \" + opts.chunkSize);\n }\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS)\n throw new Error(\"Invalid windowBits: \" + opts.windowBits);\n }\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL)\n throw new Error(\"Invalid compression level: \" + opts.level);\n }\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL)\n throw new Error(\"Invalid memLevel: \" + opts.memLevel);\n }\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY)\n throw new Error(\"Invalid strategy: \" + opts.strategy);\n }\n if (opts.dictionary) {\n if (!Buffer2.isBuffer(opts.dictionary))\n throw new Error(\"Invalid dictionary: it should be a Buffer instance\");\n }\n this._handle = new binding.Zlib(mode);\n var self = this;\n this._hadError = !1, this._handle.onerror = function(message, errno) {\n _close(self), self._hadError = !0;\n var error = new Error(message);\n error.errno = errno, error.code = exports.codes[errno], self.emit(\"error\", error);\n };\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === \"number\")\n level = opts.level;\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === \"number\")\n strategy = opts.strategy;\n this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary), this._buffer = Buffer2.allocUnsafe(this._chunkSize), this._offset = 0, this._level = level, this._strategy = strategy, this.once(\"end\", this.close), Object.defineProperty(this, \"_closed\", {\n get: function() {\n return !_this._handle;\n },\n configurable: !0,\n enumerable: !0\n });\n }\n util.inherits(Zlib, Transform), Zlib.prototype.params = function(level, strategy, callback) {\n if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL)\n @throwRangeError(\"Invalid compression level: \" + level);\n if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY)\n @throwTypeError(\"Invalid strategy: \" + strategy);\n if (this._level !== level || this._strategy !== strategy) {\n var self = this;\n this.flush(binding.Z_SYNC_FLUSH, function() {\n if (assert(self._handle, \"zlib binding closed\"), self._handle.params(level, strategy), !self._hadError) {\n if (self._level = level, self._strategy = strategy, callback)\n callback();\n }\n });\n } else\n process.nextTick(callback);\n }, Zlib.prototype.reset = function() {\n return assert(this._handle, \"zlib binding closed\"), this._handle.reset();\n }, Zlib.prototype._flush = function(callback) {\n this._transform(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.flush = function(kind, callback) {\n var _this2 = this, ws = this._writableState;\n if (typeof kind === \"function\" || kind === void 0 && !callback)\n callback = kind, kind = binding.Z_FULL_FLUSH;\n if (ws.ended) {\n if (callback)\n process.nextTick(callback);\n } else if (ws.ending) {\n if (callback)\n this.once(\"end\", callback);\n } else if (ws.needDrain) {\n if (callback)\n this.once(\"drain\", function() {\n return _this2.flush(kind, callback);\n });\n } else\n this._flushFlag = kind, this.write(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.close = function(callback) {\n _close(this, callback), process.nextTick(emitCloseNT, this);\n };\n function _close(engine, callback) {\n if (callback)\n process.nextTick(callback);\n if (!engine._handle)\n return;\n engine._handle.close(), engine._handle = null;\n }\n function emitCloseNT(self) {\n self.emit(\"close\");\n }\n Zlib.prototype._transform = function(chunk, encoding, cb) {\n var flushFlag, ws = this._writableState, ending = ws.ending || ws.ended, last = ending && (!chunk || ws.length === chunk.length);\n if (chunk !== null && !Buffer2.isBuffer(chunk))\n return cb(new Error(\"invalid input\"));\n if (!this._handle)\n return cb(new Error(\"zlib binding closed\"));\n if (last)\n flushFlag = this._finishFlushFlag;\n else if (flushFlag = this._flushFlag, chunk.length >= ws.length)\n this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;\n this._processChunk(chunk, flushFlag, cb);\n }, Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {\n var availInBefore = chunk && chunk.length, availOutBefore = this._chunkSize - this._offset, inOff = 0, self = this, async = typeof cb === \"function\";\n if (!async) {\n var buffers = [], nread = 0, error;\n this.on(\"error\", function(er) {\n error = er;\n }), assert(this._handle, \"zlib binding closed\");\n do\n var res = this._handle.writeSync(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n while (!this._hadError && callback(res[0], res[1]));\n if (this._hadError)\n throw error;\n if (nread >= kMaxLength)\n _close(this), @throwRangeError(kRangeErrorMessage);\n var buf = Buffer2.concat(buffers, nread);\n return _close(this), buf;\n }\n assert(this._handle, \"zlib binding closed\");\n var req = this._handle.write(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n req.buffer = chunk, req.callback = callback;\n function callback(availInAfter, availOutAfter) {\n if (this)\n this.buffer = null, this.callback = null;\n if (self._hadError)\n return;\n var have = availOutBefore - availOutAfter;\n if (assert(have >= 0, \"have should not go down\"), have > 0) {\n var out = self._buffer.slice(self._offset, self._offset + have);\n if (self._offset += have, async)\n self.push(out);\n else\n buffers.push(out), nread += out.length;\n }\n if (availOutAfter === 0 || self._offset >= self._chunkSize)\n availOutBefore = self._chunkSize, self._offset = 0, self._buffer = Buffer2.allocUnsafe(self._chunkSize);\n if (availOutAfter === 0) {\n if (inOff += availInBefore - availInAfter, availInBefore = availInAfter, !async)\n return !0;\n var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);\n newReq.callback = callback, newReq.buffer = chunk;\n return;\n }\n if (!async)\n return !1;\n cb();\n }\n }, util.inherits(Deflate, Zlib), util.inherits(Inflate, Zlib), util.inherits(Gzip, Zlib), util.inherits(Gunzip, Zlib), util.inherits(DeflateRaw, Zlib), util.inherits(InflateRaw, Zlib), util.inherits(Unzip, Zlib);\n }\n});\nreturn require_lib()})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyDetectLibcCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/detect-libc.ts\nvar family = function() {\n return Promise.resolve(familySync());\n}, familySync = function() {\n return null;\n}, version = function() {\n return Promise.resolve(versionSync());\n}, versionSync = function() {\n return null;\n}, isNonGlibcLinuxSync = function() {\n return !1;\n}, isNonGlibcLinux = function() {\n return Promise.resolve(isNonGlibcLinuxSync());\n}, $, GLIBC = \"glibc\", MUSL = \"musl\";\n$ = {\n GLIBC,\n MUSL,\n family,\n familySync,\n isNonGlibcLinux,\n isNonGlibcLinuxSync,\n version,\n versionSync\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyDepdCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/depd.ts\nvar wrapfunction = function(fn, message) {\n if (typeof fn !== \"function\")\n @throwTypeError(\"argument fn must be a function\");\n return fn;\n}, wrapproperty = function(obj, prop, message) {\n if (!obj || typeof obj !== \"object\" && typeof obj !== \"function\")\n @throwTypeError(\"argument obj must be object\");\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n if (!descriptor)\n @throwTypeError(\"must call property on owner object\");\n if (!descriptor.configurable)\n @throwTypeError(\"property must be configurable\");\n}, $;\n$ = function depd(namespace) {\n if (!namespace)\n @throwTypeError(\"argument namespace is required\");\n function deprecate(message) {\n }\n return deprecate._file = void 0, deprecate._ignored = !0, deprecate._namespace = namespace, deprecate._traced = !1, deprecate._warned = Object.create(null), deprecate.function = wrapfunction, deprecate.property = wrapproperty, deprecate;\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyDetectLibcLinuxCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/detect-libc.linux.ts\nvar family = function() {\n return Promise.resolve(familySync());\n}, familySync = function() {\n return GLIBC;\n}, version = function() {\n return Promise.resolve(versionSync());\n}, versionSync = function() {\n return \"2.29\";\n}, isNonGlibcLinuxSync = function() {\n return !1;\n}, isNonGlibcLinux = function() {\n return Promise.resolve(isNonGlibcLinuxSync());\n}, $, GLIBC = \"glibc\", MUSL = \"musl\";\n$ = {\n GLIBC,\n MUSL,\n family,\n familySync,\n isNonGlibcLinux,\n isNonGlibcLinuxSync,\n version,\n versionSync\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyDetectLibcCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/detect-libc.ts\nvar family = function() {\n return @Promise.resolve(familySync());\n}, familySync = function() {\n return null;\n}, version = function() {\n return @Promise.resolve(versionSync());\n}, versionSync = function() {\n return null;\n}, isNonGlibcLinuxSync = function() {\n return !1;\n}, isNonGlibcLinux = function() {\n return @Promise.resolve(isNonGlibcLinuxSync());\n}, $, GLIBC = \"glibc\", MUSL = \"musl\";\n$ = {\n GLIBC,\n MUSL,\n family,\n familySync,\n isNonGlibcLinux,\n isNonGlibcLinuxSync,\n version,\n versionSync\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyIsomorphicFetchCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/isomorphic-fetch.ts\nvar bunFetch = Bun.fetch, fetch = (...args) => bunFetch(...args);\nfetch.default = fetch;\nfetch.fetch = fetch;\nreturn fetch})\n"_s;
+static constexpr ASCIILiteral ThirdpartyDetectLibcLinuxCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/detect-libc.linux.ts\nvar family = function() {\n return @Promise.resolve(familySync());\n}, familySync = function() {\n return GLIBC;\n}, version = function() {\n return @Promise.resolve(versionSync());\n}, versionSync = function() {\n return \"2.29\";\n}, isNonGlibcLinuxSync = function() {\n return !1;\n}, isNonGlibcLinux = function() {\n return @Promise.resolve(isNonGlibcLinuxSync());\n}, $, GLIBC = \"glibc\", MUSL = \"musl\";\n$ = {\n GLIBC,\n MUSL,\n family,\n familySync,\n isNonGlibcLinux,\n isNonGlibcLinuxSync,\n version,\n versionSync\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyNodeFetchCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/node-fetch.ts\nasync function fetch(url, init) {\n let body = init\?.body;\n if (body) {\n const chunks = [];\n if (body instanceof Readable) {\n for await (let chunk of body)\n chunks.push(chunk);\n init = { ...init, body: new Blob(chunks) };\n }\n }\n const response = await nativeFetch(url, init);\n return Object.setPrototypeOf(response, Response.prototype), response;\n}\nvar blobFrom = function(path, options) {\n return Promise.resolve(Bun.file(path, options));\n}, blobFromSync = function(path, options) {\n return Bun.file(path, options);\n}, isRedirect = function(code) {\n return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n}, $, { Headers, Request, Response: WebResponse, Blob, File = Blob, FormData } = globalThis, nativeFetch = Bun.fetch, { Readable } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37);\n\nclass Response extends WebResponse {\n constructor() {\n super(...arguments);\n }\n _body;\n get body() {\n return this._body \?\? (this._body = Readable.fromWeb(super.body));\n }\n}\n\nclass AbortError extends DOMException {\n constructor(message) {\n super(message, \"AbortError\");\n }\n}\n\nclass FetchBaseError extends Error {\n type;\n constructor(message, type) {\n super(message);\n this.type = type;\n }\n}\n\nclass FetchError extends FetchBaseError {\n constructor(message, type, systemError) {\n super(message, type);\n this.code = systemError\?.code;\n }\n}\nvar fileFrom = blobFrom, fileFromSync = blobFromSync;\n$ = Object.assign(fetch, {\n AbortError,\n Blob,\n FetchBaseError,\n FetchError,\n File,\n FormData,\n Headers,\n Request,\n Response,\n blobFrom,\n blobFromSync,\n fileFrom,\n fileFromSync,\n isRedirect,\n fetch,\n default: fetch\n});\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyIsomorphicFetchCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/isomorphic-fetch.ts\nvar bunFetch = Bun.fetch, fetch = (...args) => bunFetch(...args);\nfetch.default = fetch;\nfetch.fetch = fetch;\nreturn fetch})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyUndiciCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/undici.ts\nvar notImplemented = function() {\n throw new Error(\"Not implemented in bun\");\n};\nasync function request(url, options = {\n method: \"GET\",\n signal: null,\n headers: null,\n query: null,\n reset: !1,\n throwOnError: !1,\n body: null\n}) {\n let {\n method = \"GET\",\n headers: inputHeaders,\n query,\n signal,\n reset = !1,\n throwOnError = !1,\n body: inputBody,\n maxRedirections\n } = options;\n if (typeof url === \"string\") {\n if (query)\n url = new URL(url);\n } else if (typeof url === \"object\" && url !== null) {\n if (!(url instanceof URL))\n throw new Error(\"not implemented\");\n } else\n @throwTypeError(\"url must be a string, URL, or UrlObject\");\n if (typeof url === \"string\" && query)\n url = new URL(url);\n if (typeof url === \"object\" && url !== null && query) {\n if (query)\n url.search = new URLSearchParams(query).toString();\n }\n if (method = method && typeof method === \"string\" \? method.toUpperCase() : null, inputBody && (method === \"GET\" || method === \"HEAD\"))\n throw new Error(\"Body not allowed for GET or HEAD requests\");\n if (inputBody && inputBody.read && inputBody instanceof Readable) {\n let data = \"\";\n inputBody.setEncoding(\"utf8\");\n for await (let chunk of stream)\n data += chunk;\n inputBody = (new TextEncoder()).encode(data);\n }\n if (maxRedirections !== void 0 && Number.isNaN(maxRedirections))\n throw new Error(\"maxRedirections must be a number if defined\");\n if (signal && !(signal instanceof AbortSignal))\n throw new Error(\"signal must be an instance of AbortSignal\");\n let resp;\n const {\n status: statusCode,\n headers,\n trailers\n } = resp = await fetch(url, {\n signal,\n mode: \"cors\",\n method,\n headers: inputHeaders || kEmptyObject,\n body: inputBody,\n redirect: maxRedirections === \"undefined\" || maxRedirections > 0 \? \"follow\" : \"manual\",\n keepalive: !reset\n });\n if (throwOnError && statusCode >= 400 && statusCode < 600)\n throw new Error(`Request failed with status code ${statusCode}`);\n const body = resp.body \? new BodyReadable(resp) : null;\n return { statusCode, headers: headers.toJSON(), body, trailers, opaque: kEmptyObject, context: kEmptyObject };\n}\nvar stream = function() {\n throw new Error(\"Not implemented in bun\");\n}, pipeline = function() {\n throw new Error(\"Not implemented in bun\");\n}, connect = function() {\n throw new Error(\"Not implemented in bun\");\n}, upgrade = function() {\n throw new Error(\"Not implemented in bun\");\n}, mockErrors = function() {\n throw new Error(\"Not implemented in bun\");\n}, Undici = function() {\n throw new Error(\"Not implemented in bun\");\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), StreamModule = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), { Readable } = StreamModule, { _ReadableFromWebForUndici: ReadableFromWeb } = StreamModule[Symbol.for(\"::bunternal::\")], ObjectCreate = Object.create, kEmptyObject = ObjectCreate(null), fetch = Bun.fetch, Response = globalThis.Response, Headers = globalThis.Headers, Request = globalThis.Request, URLSearchParams = globalThis.URLSearchParams, URL = globalThis.URL;\n\nclass File extends Blob {\n constructor() {\n super(...arguments);\n }\n}\n\nclass FileReader extends EventTarget {\n constructor() {\n throw new Error(\"Not implemented yet!\");\n }\n}\nvar FormData = globalThis.FormData;\n\nclass BodyReadable extends ReadableFromWeb {\n #response;\n #bodyUsed;\n constructor(response, options = {}) {\n var { body } = response;\n if (!body)\n throw new Error(\"Response body is null\");\n super(options, body);\n this.#response = response, this.#bodyUsed = response.bodyUsed;\n }\n get bodyUsed() {\n return this.#bodyUsed;\n }\n #consume() {\n if (this.#bodyUsed)\n @throwTypeError(\"unusable\");\n this.#bodyUsed = !0;\n }\n async arrayBuffer() {\n return this.#consume(), await this.#response.arrayBuffer();\n }\n async blob() {\n return this.#consume(), await this.#response.blob();\n }\n async formData() {\n return this.#consume(), await this.#response.formData();\n }\n async json() {\n return this.#consume(), await this.#response.json();\n }\n async text() {\n return this.#consume(), await this.#response.text();\n }\n}\n\nclass MockClient {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass MockPool {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass MockAgent {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass Dispatcher extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Agent extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Pool extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n request() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass BalancedPool extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Client extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n request() {\n throw new Error(\"Not implemented in bun\");\n }\n}\nUndici.Dispatcher = Dispatcher;\nUndici.Pool = Pool;\nUndici.BalancedPool = BalancedPool;\nUndici.Client = Client;\nUndici.Agent = Agent;\nUndici.buildConnector = Undici.errors = Undici.setGlobalDispatcher = Undici.getGlobalDispatcher = Undici.request = Undici.stream = Undici.pipeline = Undici.connect = Undici.upgrade = Undici.MockClient = Undici.MockPool = Undici.MockAgent = Undici.mockErrors = notImplemented;\nUndici.fetch = fetch;\n$ = {\n fetch,\n Response,\n Headers,\n Request,\n URLSearchParams,\n URL,\n File,\n FileReader,\n FormData,\n request,\n stream,\n pipeline,\n connect,\n upgrade,\n MockClient,\n MockPool,\n MockAgent,\n mockErrors,\n Dispatcher,\n Pool,\n BalancedPool,\n Client,\n Agent,\n Undici\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyNodeFetchCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/node-fetch.ts\nasync function fetch(url, init) {\n let body = init\?.body;\n if (body) {\n const chunks = [];\n if (body instanceof Readable) {\n for await (let chunk of body)\n chunks.push(chunk);\n init = { ...init, body: new Blob(chunks) };\n }\n }\n const response = await nativeFetch(url, init);\n return Object.setPrototypeOf(response, Response.prototype), response;\n}\nvar blobFrom = function(path, options) {\n return @Promise.resolve(Bun.file(path, options));\n}, blobFromSync = function(path, options) {\n return Bun.file(path, options);\n}, isRedirect = function(code) {\n return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n}, $, { Headers, Request, Response: WebResponse, Blob, File = Blob, FormData } = globalThis, nativeFetch = Bun.fetch, { Readable } = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39);\n\nclass Response extends WebResponse {\n constructor() {\n super(...arguments);\n }\n _body;\n get body() {\n return this._body \?\? (this._body = Readable.fromWeb(super.body));\n }\n}\n\nclass AbortError extends DOMException {\n constructor(message) {\n super(message, \"AbortError\");\n }\n}\n\nclass FetchBaseError extends Error {\n type;\n constructor(message, type) {\n super(message);\n this.type = type;\n }\n}\n\nclass FetchError extends FetchBaseError {\n constructor(message, type, systemError) {\n super(message, type);\n this.code = systemError\?.code;\n }\n}\nvar fileFrom = blobFrom, fileFromSync = blobFromSync;\n$ = Object.assign(fetch, {\n AbortError,\n Blob,\n FetchBaseError,\n FetchError,\n File,\n FormData,\n Headers,\n Request,\n Response,\n blobFrom,\n blobFromSync,\n fileFrom,\n fileFromSync,\n isRedirect,\n fetch,\n default: fetch\n});\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyVercelFetchCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/vercel_fetch.ts\nvar $;\n$ = (wrapper = Bun.fetch) => {\n async function vercelFetch(url, opts = {}) {\n if (opts.body && typeof opts.body === \"object\" && (!(\"buffer\" in opts.body) || typeof opts.body.buffer !== \"object\" || !(opts.body.buffer instanceof ArrayBuffer))) {\n if (opts.body = JSON.stringify(opts.body), !opts.headers)\n opts.headers = new Headers;\n opts.headers.set(\"Content-Type\", \"application/json\");\n }\n try {\n return await wrapper(url, opts);\n } catch (err) {\n if (typeof err === \"string\")\n err = new Error(err);\n throw err.url = url, err.opts = opts, err;\n }\n }\n return vercelFetch.default = vercelFetch, vercelFetch;\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyUndiciCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/undici.ts\nvar notImplemented = function() {\n throw new Error(\"Not implemented in bun\");\n};\nasync function request(url, options = {\n method: \"GET\",\n signal: null,\n headers: null,\n query: null,\n reset: !1,\n throwOnError: !1,\n body: null\n}) {\n let {\n method = \"GET\",\n headers: inputHeaders,\n query,\n signal,\n reset = !1,\n throwOnError = !1,\n body: inputBody,\n maxRedirections\n } = options;\n if (typeof url === \"string\") {\n if (query)\n url = new URL(url);\n } else if (typeof url === \"object\" && url !== null) {\n if (!(url instanceof URL))\n throw new Error(\"not implemented\");\n } else\n @throwTypeError(\"url must be a string, URL, or UrlObject\");\n if (typeof url === \"string\" && query)\n url = new URL(url);\n if (typeof url === \"object\" && url !== null && query) {\n if (query)\n url.search = new URLSearchParams(query).toString();\n }\n if (method = method && typeof method === \"string\" \? method.toUpperCase() : null, inputBody && (method === \"GET\" || method === \"HEAD\"))\n throw new Error(\"Body not allowed for GET or HEAD requests\");\n if (inputBody && inputBody.read && inputBody instanceof Readable) {\n let data = \"\";\n inputBody.setEncoding(\"utf8\");\n for await (let chunk of stream)\n data += chunk;\n inputBody = (new TextEncoder()).encode(data);\n }\n if (maxRedirections !== @undefined && Number.isNaN(maxRedirections))\n throw new Error(\"maxRedirections must be a number if defined\");\n if (signal && !(signal instanceof @AbortSignal))\n throw new Error(\"signal must be an instance of AbortSignal\");\n let resp;\n const {\n status: statusCode,\n headers,\n trailers\n } = resp = await fetch(url, {\n signal,\n mode: \"cors\",\n method,\n headers: inputHeaders || kEmptyObject,\n body: inputBody,\n redirect: maxRedirections === \"undefined\" || maxRedirections > 0 \? \"follow\" : \"manual\",\n keepalive: !reset\n });\n if (throwOnError && statusCode >= 400 && statusCode < 600)\n throw new Error(`Request failed with status code ${statusCode}`);\n const body = resp.body \? new BodyReadable(resp) : null;\n return { statusCode, headers: headers.toJSON(), body, trailers, opaque: kEmptyObject, context: kEmptyObject };\n}\nvar stream = function() {\n throw new Error(\"Not implemented in bun\");\n}, pipeline = function() {\n throw new Error(\"Not implemented in bun\");\n}, connect = function() {\n throw new Error(\"Not implemented in bun\");\n}, upgrade = function() {\n throw new Error(\"Not implemented in bun\");\n}, mockErrors = function() {\n throw new Error(\"Not implemented in bun\");\n}, Undici = function() {\n throw new Error(\"Not implemented in bun\");\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), StreamModule = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), { Readable } = StreamModule, { _ReadableFromWebForUndici: ReadableFromWeb } = StreamModule[Symbol.for(\"::bunternal::\")], ObjectCreate = Object.create, kEmptyObject = ObjectCreate(null), fetch = Bun.fetch, Response = globalThis.Response, Headers = globalThis.Headers, Request = globalThis.Request, URLSearchParams = globalThis.URLSearchParams, URL = globalThis.URL;\n\nclass File extends Blob {\n constructor() {\n super(...arguments);\n }\n}\n\nclass FileReader extends EventTarget {\n constructor() {\n throw new Error(\"Not implemented yet!\");\n }\n}\nvar FormData = globalThis.FormData;\n\nclass BodyReadable extends ReadableFromWeb {\n #response;\n #bodyUsed;\n constructor(response, options = {}) {\n var { body } = response;\n if (!body)\n throw new Error(\"Response body is null\");\n super(options, body);\n this.#response = response, this.#bodyUsed = response.bodyUsed;\n }\n get bodyUsed() {\n return this.#bodyUsed;\n }\n #consume() {\n if (this.#bodyUsed)\n @throwTypeError(\"unusable\");\n this.#bodyUsed = !0;\n }\n async arrayBuffer() {\n return this.#consume(), await this.#response.arrayBuffer();\n }\n async blob() {\n return this.#consume(), await this.#response.blob();\n }\n async formData() {\n return this.#consume(), await this.#response.formData();\n }\n async json() {\n return this.#consume(), await this.#response.json();\n }\n async text() {\n return this.#consume(), await this.#response.text();\n }\n}\n\nclass MockClient {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass MockPool {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass MockAgent {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass Dispatcher extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Agent extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Pool extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n request() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass BalancedPool extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Client extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n request() {\n throw new Error(\"Not implemented in bun\");\n }\n}\nUndici.Dispatcher = Dispatcher;\nUndici.Pool = Pool;\nUndici.BalancedPool = BalancedPool;\nUndici.Client = Client;\nUndici.Agent = Agent;\nUndici.buildConnector = Undici.errors = Undici.setGlobalDispatcher = Undici.getGlobalDispatcher = Undici.request = Undici.stream = Undici.pipeline = Undici.connect = Undici.upgrade = Undici.MockClient = Undici.MockPool = Undici.MockAgent = Undici.mockErrors = notImplemented;\nUndici.fetch = fetch;\n$ = {\n fetch,\n Response,\n Headers,\n Request,\n URLSearchParams,\n URL,\n File,\n FileReader,\n FormData,\n request,\n stream,\n pipeline,\n connect,\n upgrade,\n MockClient,\n MockPool,\n MockAgent,\n mockErrors,\n Dispatcher,\n Pool,\n BalancedPool,\n Client,\n Agent,\n Undici\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyWSCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/ws.ts\nvar emitWarning = function(type, message) {\n if (emittedWarnings.has(type))\n return;\n emittedWarnings.add(type), console.warn(\"[bun] Warning:\", message);\n}, subprotocolParse = function(header) {\n const protocols = new Set;\n let start = -1, end = -1, i = 0;\n for (i;i < header.length; i++) {\n const code = header.charCodeAt(i);\n if (end === -1 && wsTokenChars[code] === 1) {\n if (start === -1)\n start = i;\n } else if (i !== 0 && (code === 32 || code === 9)) {\n if (end === -1 && start !== -1)\n end = i;\n } else if (code === 44) {\n if (start === -1)\n throw new SyntaxError(`Unexpected character at index ${i}`);\n if (end === -1)\n end = i;\n const protocol2 = header.slice(start, end);\n if (protocols.has(protocol2))\n throw new SyntaxError(`The \"${protocol2}\" subprotocol is duplicated`);\n protocols.add(protocol2), start = end = -1;\n } else\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n if (start === -1 || end !== -1)\n throw new SyntaxError(\"Unexpected end of input\");\n const protocol = header.slice(start, i);\n if (protocols.has(protocol))\n throw new SyntaxError(`The \"${protocol}\" subprotocol is duplicated`);\n return protocols.add(protocol), protocols;\n}, wsEmitClose = function(server) {\n server._state = CLOSED, server.emit(\"close\");\n}, abortHandshake = function(response, code, message, headers) {\n message = message || http.STATUS_CODES[code], headers = {\n Connection: \"close\",\n \"Content-Type\": \"text/html\",\n \"Content-Length\": Buffer.byteLength(message),\n ...headers\n }, response.writeHead(code, headers), response.write(message), response.end();\n}, abortHandshakeOrEmitwsClientError = function(server, req, response, socket, code, message) {\n if (server.listenerCount(\"wsClientError\")) {\n const err = new Error(message);\n Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError), server.emit(\"wsClientError\", err, socket, req);\n } else\n abortHandshake(response, code, message);\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), http = @getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21), kBunInternals = Symbol.for(\"::bunternal::\"), readyStates = [\"CONNECTING\", \"OPEN\", \"CLOSING\", \"CLOSED\"], encoder = new TextEncoder, eventIds = {\n open: 1,\n close: 2,\n message: 3,\n error: 4,\n ping: 5,\n pong: 6\n}, emittedWarnings = new Set;\n\nclass BunWebSocket extends EventEmitter {\n static CONNECTING = 0;\n static OPEN = 1;\n static CLOSING = 2;\n static CLOSED = 3;\n #ws;\n #paused = !1;\n #fragments = !1;\n #binaryType = \"nodebuffer\";\n #eventId = 0;\n constructor(url, protocols, options) {\n super();\n let ws = this.#ws = new WebSocket(url, protocols);\n ws.binaryType = \"nodebuffer\";\n }\n on(event, listener) {\n if (event === \"unexpected-response\" || event === \"upgrade\" || event === \"redirect\")\n emitWarning(event, \"ws.WebSocket '\" + event + \"' event is not implemented in bun\");\n const mask = 1 << eventIds[event];\n if (mask && (this.#eventId & mask) !== mask) {\n if (this.#eventId |= mask, event === \"open\")\n this.#ws.addEventListener(\"open\", () => {\n this.emit(\"open\");\n });\n else if (event === \"close\")\n this.#ws.addEventListener(\"close\", ({ code, reason, wasClean }) => {\n this.emit(\"close\", code, reason, wasClean);\n });\n else if (event === \"message\")\n this.#ws.addEventListener(\"message\", ({ data }) => {\n const isBinary = typeof data !== \"string\";\n if (isBinary)\n this.emit(\"message\", this.#fragments \? [data] : data, isBinary);\n else {\n let encoded = encoder.encode(data);\n if (this.#binaryType !== \"arraybuffer\")\n encoded = Buffer.from(encoded.buffer, encoded.byteOffset, encoded.byteLength);\n this.emit(\"message\", this.#fragments \? [encoded] : encoded, isBinary);\n }\n });\n else if (event === \"error\")\n this.#ws.addEventListener(\"error\", (err) => {\n this.emit(\"error\", err);\n });\n else if (event === \"ping\")\n this.#ws.addEventListener(\"ping\", ({ data }) => {\n this.emit(\"ping\", data);\n });\n else if (event === \"pong\")\n this.#ws.addEventListener(\"pong\", ({ data }) => {\n this.emit(\"pong\", data);\n });\n }\n return super.on(event, listener);\n }\n send(data, opts, cb) {\n try {\n this.#ws.send(data, opts\?.compress);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n close(code, reason) {\n this.#ws.close(code, reason);\n }\n terminate() {\n this.#ws.terminate();\n }\n get url() {\n return this.#ws.url;\n }\n get readyState() {\n return this.#ws.readyState;\n }\n get binaryType() {\n return this.#binaryType;\n }\n set binaryType(value) {\n if (value === \"nodebuffer\" || value === \"arraybuffer\")\n this.#ws.binaryType = this.#binaryType = value, this.#fragments = !1;\n else if (value === \"fragments\")\n this.#ws.binaryType = \"nodebuffer\", this.#binaryType = \"fragments\", this.#fragments = !0;\n else\n throw new Error(`Invalid binaryType: ${value}`);\n }\n get protocol() {\n return this.#ws.protocol;\n }\n get extensions() {\n return this.#ws.extensions;\n }\n addEventListener(type, listener, options) {\n this.#ws.addEventListener(type, listener, options);\n }\n removeEventListener(type, listener) {\n this.#ws.removeEventListener(type, listener);\n }\n get onopen() {\n return this.#ws.onopen;\n }\n set onopen(value) {\n this.#ws.onopen = value;\n }\n get onerror() {\n return this.#ws.onerror;\n }\n set onerror(value) {\n this.#ws.onerror = value;\n }\n get onclose() {\n return this.#ws.onclose;\n }\n set onclose(value) {\n this.#ws.onclose = value;\n }\n get onmessage() {\n return this.#ws.onmessage;\n }\n set onmessage(value) {\n this.#ws.onmessage = value;\n }\n get bufferedAmount() {\n return this.#ws.bufferedAmount;\n }\n get isPaused() {\n return this.#paused;\n }\n ping(data, mask, cb) {\n if (typeof data === \"function\")\n cb = data, data = mask = void 0;\n else if (typeof mask === \"function\")\n cb = mask, mask = void 0;\n if (typeof data === \"number\")\n data = data.toString();\n try {\n this.#ws.ping(data);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n pong(data, mask, cb) {\n if (typeof data === \"function\")\n cb = data, data = mask = void 0;\n else if (typeof mask === \"function\")\n cb = mask, mask = void 0;\n if (typeof data === \"number\")\n data = data.toString();\n try {\n this.#ws.pong(data);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n pause() {\n switch (this.readyState) {\n case WebSocket.CONNECTING:\n case WebSocket.CLOSED:\n return;\n }\n this.#paused = !0, emitWarning(\"pause()\", \"ws.WebSocket.pause() is not implemented in bun\");\n }\n resume() {\n switch (this.readyState) {\n case WebSocket.CONNECTING:\n case WebSocket.CLOSED:\n return;\n }\n this.#paused = !1, emitWarning(\"resume()\", \"ws.WebSocket.resume() is not implemented in bun\");\n }\n}\nObject.defineProperty(BunWebSocket, \"name\", { value: \"WebSocket\" });\nvar wsKeyRegex = /^[+/0-9A-Za-z]{22}==$/, wsTokenChars = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 1,\n 0,\n 1,\n 0\n], RUNNING = 0, CLOSING = 1, CLOSED = 2;\n\nclass BunWebSocketMocked extends EventEmitter {\n #ws;\n #state;\n #enquedMessages = [];\n #url;\n #protocol;\n #extensions;\n #bufferedAmount = 0;\n #binaryType = \"arraybuffer\";\n #onclose;\n #onerror;\n #onmessage;\n #onopen;\n constructor(url, protocol, extensions, binaryType) {\n super();\n if (this.#ws = null, this.#state = 0, this.#url = url, this.#bufferedAmount = 0, binaryType = binaryType || \"arraybuffer\", binaryType !== \"nodebuffer\" && binaryType !== \"blob\" && binaryType !== \"arraybuffer\")\n @throwTypeError(\"binaryType must be either 'blob', 'arraybuffer' or 'nodebuffer'\");\n this.#binaryType = binaryType, this.#protocol = protocol, this.#extensions = extensions;\n const message = this.#message.bind(this), open = this.#open.bind(this), close = this.#close.bind(this), drain = this.#drain.bind(this);\n this[kBunInternals] = {\n message,\n open,\n close,\n drain\n };\n }\n #message(ws, message) {\n if (this.#ws = ws, typeof message === \"string\")\n if (this.#binaryType === \"arraybuffer\")\n message = encoder.encode(message).buffer;\n else if (this.#binaryType === \"blob\")\n message = new Blob([message], { type: \"text/plain\" });\n else\n message = Buffer.from(message);\n else if (this.#binaryType !== \"nodebuffer\") {\n if (this.#binaryType === \"arraybuffer\")\n message = new Uint8Array(message);\n else if (this.#binaryType === \"blob\")\n message = new Blob([message]);\n }\n this.emit(\"message\", message);\n }\n #open(ws) {\n this.#ws = ws, this.#state = 1, this.emit(\"open\", this), this.#drain(ws);\n }\n #close(ws, code, reason) {\n this.#state = 3, this.#ws = null, this.emit(\"close\", code, reason);\n }\n #drain(ws) {\n const chunk = this.#enquedMessages[0];\n if (chunk) {\n const [data, compress, cb] = chunk;\n if (ws.send(data, compress) == -1)\n return;\n typeof cb === \"function\" && cb(), this.#bufferedAmount -= chunk.length, this.#enquedMessages.shift();\n }\n }\n send(data, opts, cb) {\n if (this.#state === 1) {\n const compress = opts\?.compress;\n if (this.#ws.send(data, compress) == -1) {\n this.#enquedMessages.push([data, compress, cb]), this.#bufferedAmount += data.length;\n return;\n }\n typeof cb === \"function\" && cb();\n } else if (this.#state === 0)\n this.#enquedMessages.push([data, opts\?.compress, cb]), this.#bufferedAmount += data.length;\n }\n close(code, reason) {\n if (this.#state === 1)\n this.#state = 2, this.#ws.close(code, reason);\n }\n get binaryType() {\n return this.#binaryType;\n }\n set binaryType(type) {\n if (type !== \"nodebuffer\" && type !== \"blob\" && type !== \"arraybuffer\")\n @throwTypeError(\"binaryType must be either 'blob', 'arraybuffer' or 'nodebuffer'\");\n this.#binaryType = type;\n }\n get readyState() {\n return this.#state;\n }\n get url() {\n return this.#url;\n }\n get protocol() {\n return this.#protocol;\n }\n get extensions() {\n return this.#extensions;\n }\n get bufferedAmount() {\n return this.#bufferedAmount \?\? 0;\n }\n setSocket(socket, head, options) {\n throw new Error(\"Not implemented\");\n }\n set onclose(cb) {\n if (this.#onclose)\n this.removeListener(\"close\", this.#onclose);\n this.on(\"close\", cb), this.#onclose = cb;\n }\n set onerror(cb) {\n if (this.#onerror)\n this.removeListener(\"error\", this.#onerror);\n this.on(\"error\", cb), this.#onerror = cb;\n }\n set onmessage(cb) {\n if (this.#onmessage)\n this.removeListener(\"message\", this.#onmessage);\n this.on(\"message\", cb), this.#onmessage = cb;\n }\n set onopen(cb) {\n if (this.#onopen)\n this.removeListener(\"open\", this.#onopen);\n this.on(\"open\", cb), this.#onopen = cb;\n }\n get onclose() {\n return this.#onclose;\n }\n get onerror() {\n return this.#onerror;\n }\n get onmessage() {\n return this.#onmessage;\n }\n get onopen() {\n return this.#onopen;\n }\n addEventListener(type, listener, options) {\n if (type === \"message\") {\n const l = (data) => listener({ data });\n l.listener = listener, this.on(type, l);\n return;\n }\n this.on(type, listener);\n }\n removeEventListener(type, listener) {\n this.off(type, listener);\n }\n}\n\nclass WebSocketServer extends EventEmitter {\n _server;\n options;\n clients;\n _shouldEmitClose;\n _state;\n _removeListeners;\n constructor(options, callback) {\n super();\n if (options = {\n maxPayload: 104857600,\n skipUTF8Validation: !1,\n perMessageDeflate: !1,\n handleProtocols: null,\n clientTracking: !0,\n verifyClient: null,\n noServer: !1,\n backlog: null,\n server: null,\n host: null,\n path: null,\n port: null,\n ...options\n }, options.port == null && !options.server && !options.noServer || options.port != null && (options.server || options.noServer) || options.server && options.noServer)\n @throwTypeError('One and only one of the \"port\", \"server\", or \"noServer\" options must be specified');\n if (options.port != null)\n this._server = http.createServer((req, res) => {\n const body = http.STATUS_CODES[426];\n res.writeHead(426, {\n \"Content-Length\": body.length,\n \"Content-Type\": \"text/plain\"\n }), res.end(body);\n }), this._server.listen(options.port, options.host, options.backlog, callback);\n else if (options.server)\n this._server = options.server;\n if (this._server) {\n const emitConnection = this.emit.bind(this, \"connection\"), emitListening = this.emit.bind(this, \"listening\"), emitError = this.emit.bind(this, \"error\"), doUpgrade = (req, socket, head) => {\n this.handleUpgrade(req, socket, head, emitConnection);\n };\n this._server.on(\"listening\", emitListening), this._server.on(\"error\", emitError), this._server.on(\"upgrade\", doUpgrade), this._removeListeners = () => {\n this._server.removeListener(\"upgrade\", doUpgrade), this._server.removeListener(\"listening\", emitListening), this._server.removeListener(\"error\", emitError);\n };\n }\n if (options.perMessageDeflate === !0)\n options.perMessageDeflate = {};\n if (options.clientTracking)\n this.clients = new Set, this._shouldEmitClose = !1;\n this.options = options, this._state = RUNNING;\n }\n address() {\n if (this.options.noServer)\n throw new Error('The server is operating in \"noServer\" mode');\n if (!this._server)\n return null;\n return this._server.address();\n }\n close(cb) {\n if (this._state === CLOSED) {\n if (cb)\n this.once(\"close\", () => {\n cb(new Error(\"The server is not running\"));\n });\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n return;\n }\n if (cb)\n this.once(\"close\", cb);\n if (this._state === CLOSING)\n return;\n if (this._state = CLOSING, this.options.noServer || this.options.server) {\n if (this._server)\n this._removeListeners(), this._removeListeners = this._server = null;\n if (this.clients)\n if (!this.clients.size)\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n else\n this._shouldEmitClose = !0;\n else\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n } else {\n const server = this._server;\n this._removeListeners(), this._removeListeners = this._server = null, server.close(() => {\n this._state = CLOSED, this.emit(\"close\");\n });\n }\n }\n shouldHandle(req) {\n if (this.options.path) {\n const index = req.url.indexOf(\"\?\");\n if ((index !== -1 \? req.url.slice(0, index) : req.url) !== this.options.path)\n return !1;\n }\n return !0;\n }\n completeUpgrade(extensions, key, protocols, request, socket, head, cb) {\n const [server, response, req] = socket[kBunInternals];\n if (this._state > RUNNING)\n return abortHandshake(response, 503);\n let protocol = \"\";\n if (protocols.size)\n protocol = this.options.handleProtocols \? this.options.handleProtocols(protocols, request) : protocols.values().next().value;\n const ws = new BunWebSocketMocked(request.url, protocol, extensions, \"nodebuffer\"), headers = [\"HTTP/1.1 101 Switching Protocols\", \"Upgrade: websocket\", \"Connection: Upgrade\"];\n if (this.emit(\"headers\", headers, request), server.upgrade(req, {\n data: ws[kBunInternals]\n })) {\n if (response._reply(void 0), this.clients)\n this.clients.add(ws), ws.on(\"close\", () => {\n if (this.clients.delete(ws), this._shouldEmitClose && !this.clients.size)\n process.nextTick(wsEmitClose, this);\n });\n cb(ws, request);\n } else\n abortHandshake(response, 500);\n }\n handleUpgrade(req, socket, head, cb) {\n const [_, response] = socket[kBunInternals], key = req.headers[\"sec-websocket-key\"], version = +req.headers[\"sec-websocket-version\"];\n if (req.method !== \"GET\") {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 405, \"Invalid HTTP method\");\n return;\n }\n if (req.headers.upgrade.toLowerCase() !== \"websocket\") {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Invalid Upgrade header\");\n return;\n }\n if (!key || !wsKeyRegex.test(key)) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Missing or invalid Sec-WebSocket-Key header\");\n return;\n }\n if (version !== 8 && version !== 13) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Missing or invalid Sec-WebSocket-Version header\");\n return;\n }\n if (!this.shouldHandle(req)) {\n abortHandshake(response, 400);\n return;\n }\n const secWebSocketProtocol = req.headers[\"sec-websocket-protocol\"];\n let protocols = new Set;\n if (secWebSocketProtocol !== void 0)\n try {\n protocols = subprotocolParse(secWebSocketProtocol);\n } catch (err) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Invalid Sec-WebSocket-Protocol header\");\n return;\n }\n const extensions = {};\n if (this.options.verifyClient) {\n const info = {\n origin: req.headers[`${version === 8 \? \"sec-websocket-origin\" : \"origin\"}`],\n secure: !!(req.socket.authorized || req.socket.encrypted),\n req\n };\n if (this.options.verifyClient.length === 2) {\n this.options.verifyClient(info, (verified, code, message, headers) => {\n if (!verified)\n return abortHandshake(response, code || 401, message, headers);\n this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);\n });\n return;\n }\n if (!this.options.verifyClient(info))\n return abortHandshake(response, 401);\n }\n this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);\n }\n}\nObject.defineProperty(BunWebSocket, \"CONNECTING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CONNECTING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(BunWebSocket, \"OPEN\", {\n enumerable: !0,\n value: readyStates.indexOf(\"OPEN\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"OPEN\", {\n enumerable: !0,\n value: readyStates.indexOf(\"OPEN\")\n});\nObject.defineProperty(BunWebSocket, \"CLOSING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSING\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CLOSING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSING\")\n});\nObject.defineProperty(BunWebSocket, \"CLOSED\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSED\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CLOSED\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSED\")\n});\n\nclass Sender {\n constructor() {\n throw new Error(\"Not supported yet in Bun\");\n }\n}\n\nclass Receiver {\n constructor() {\n throw new Error(\"Not supported yet in Bun\");\n }\n}\nvar createWebSocketStream = (ws) => {\n throw new Error(\"Not supported yet in Bun\");\n};\n$ = Object.assign(BunWebSocket, {\n createWebSocketStream,\n Receiver,\n Sender,\n WebSocket: BunWebSocket,\n Server: WebSocketServer,\n WebSocketServer\n});\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyVercelFetchCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/vercel_fetch.ts\nvar $;\n$ = (wrapper = Bun.fetch) => {\n async function vercelFetch(url, opts = {}) {\n if (opts.body && typeof opts.body === \"object\" && (!(\"buffer\" in opts.body) || typeof opts.body.buffer !== \"object\" || !(opts.body.buffer instanceof @ArrayBuffer))) {\n if (opts.body = JSON.stringify(opts.body), !opts.headers)\n opts.headers = new Headers;\n opts.headers.set(\"Content-Type\", \"application/json\");\n }\n try {\n return await wrapper(url, opts);\n } catch (err) {\n if (typeof err === \"string\")\n err = new Error(err);\n throw err.url = url, err.opts = opts, err;\n }\n }\n return vercelFetch.default = vercelFetch, vercelFetch;\n};\nreturn $})\n");
+//
+
+//
+static constexpr ASCIILiteral ThirdpartyWSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/ws.ts\nvar emitWarning = function(type, message) {\n if (emittedWarnings.has(type))\n return;\n emittedWarnings.add(type), console.warn(\"[bun] Warning:\", message);\n}, subprotocolParse = function(header) {\n const protocols = new Set;\n let start = -1, end = -1, i = 0;\n for (i;i < header.length; i++) {\n const code = header.charCodeAt(i);\n if (end === -1 && wsTokenChars[code] === 1) {\n if (start === -1)\n start = i;\n } else if (i !== 0 && (code === 32 || code === 9)) {\n if (end === -1 && start !== -1)\n end = i;\n } else if (code === 44) {\n if (start === -1)\n throw new SyntaxError(`Unexpected character at index ${i}`);\n if (end === -1)\n end = i;\n const protocol2 = header.slice(start, end);\n if (protocols.has(protocol2))\n throw new SyntaxError(`The \"${protocol2}\" subprotocol is duplicated`);\n protocols.add(protocol2), start = end = -1;\n } else\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n if (start === -1 || end !== -1)\n throw new SyntaxError(\"Unexpected end of input\");\n const protocol = header.slice(start, i);\n if (protocols.has(protocol))\n throw new SyntaxError(`The \"${protocol}\" subprotocol is duplicated`);\n return protocols.add(protocol), protocols;\n}, wsEmitClose = function(server) {\n server._state = CLOSED, server.emit(\"close\");\n}, abortHandshake = function(response, code, message, headers) {\n message = message || http.STATUS_CODES[code], headers = {\n Connection: \"close\",\n \"Content-Type\": \"text/html\",\n \"Content-Length\": @Buffer.byteLength(message),\n ...headers\n }, response.writeHead(code, headers), response.write(message), response.end();\n}, abortHandshakeOrEmitwsClientError = function(server, req, response, socket, code, message) {\n if (server.listenerCount(\"wsClientError\")) {\n const err = new Error(message);\n Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError), server.emit(\"wsClientError\", err, socket, req);\n } else\n abortHandshake(response, code, message);\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), http = @getInternalField(@internalModuleRegistry, 23) || @createInternalModuleById(23), kBunInternals = Symbol.for(\"::bunternal::\"), readyStates = [\"CONNECTING\", \"OPEN\", \"CLOSING\", \"CLOSED\"], encoder = new TextEncoder, eventIds = {\n open: 1,\n close: 2,\n message: 3,\n error: 4,\n ping: 5,\n pong: 6\n}, emittedWarnings = new Set;\n\nclass BunWebSocket extends EventEmitter {\n static CONNECTING = 0;\n static OPEN = 1;\n static CLOSING = 2;\n static CLOSED = 3;\n #ws;\n #paused = !1;\n #fragments = !1;\n #binaryType = \"nodebuffer\";\n #eventId = 0;\n constructor(url, protocols, options) {\n super();\n let ws = this.#ws = new WebSocket(url, protocols);\n ws.binaryType = \"nodebuffer\";\n }\n on(event, listener) {\n if (event === \"unexpected-response\" || event === \"upgrade\" || event === \"redirect\")\n emitWarning(event, \"ws.WebSocket '\" + event + \"' event is not implemented in bun\");\n const mask = 1 << eventIds[event];\n if (mask && (this.#eventId & mask) !== mask) {\n if (this.#eventId |= mask, event === \"open\")\n this.#ws.addEventListener(\"open\", () => {\n this.emit(\"open\");\n });\n else if (event === \"close\")\n this.#ws.addEventListener(\"close\", ({ code, reason, wasClean }) => {\n this.emit(\"close\", code, reason, wasClean);\n });\n else if (event === \"message\")\n this.#ws.addEventListener(\"message\", ({ data }) => {\n const isBinary = typeof data !== \"string\";\n if (isBinary)\n this.emit(\"message\", this.#fragments \? [data] : data, isBinary);\n else {\n let encoded = encoder.encode(data);\n if (this.#binaryType !== \"arraybuffer\")\n encoded = @Buffer.from(encoded.buffer, encoded.byteOffset, encoded.byteLength);\n this.emit(\"message\", this.#fragments \? [encoded] : encoded, isBinary);\n }\n });\n else if (event === \"error\")\n this.#ws.addEventListener(\"error\", (err) => {\n this.emit(\"error\", err);\n });\n else if (event === \"ping\")\n this.#ws.addEventListener(\"ping\", ({ data }) => {\n this.emit(\"ping\", data);\n });\n else if (event === \"pong\")\n this.#ws.addEventListener(\"pong\", ({ data }) => {\n this.emit(\"pong\", data);\n });\n }\n return super.on(event, listener);\n }\n send(data, opts, cb) {\n try {\n this.#ws.send(data, opts\?.compress);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n close(code, reason) {\n this.#ws.close(code, reason);\n }\n terminate() {\n this.#ws.terminate();\n }\n get url() {\n return this.#ws.url;\n }\n get readyState() {\n return this.#ws.readyState;\n }\n get binaryType() {\n return this.#binaryType;\n }\n set binaryType(value) {\n if (value === \"nodebuffer\" || value === \"arraybuffer\")\n this.#ws.binaryType = this.#binaryType = value, this.#fragments = !1;\n else if (value === \"fragments\")\n this.#ws.binaryType = \"nodebuffer\", this.#binaryType = \"fragments\", this.#fragments = !0;\n else\n throw new Error(`Invalid binaryType: ${value}`);\n }\n get protocol() {\n return this.#ws.protocol;\n }\n get extensions() {\n return this.#ws.extensions;\n }\n addEventListener(type, listener, options) {\n this.#ws.addEventListener(type, listener, options);\n }\n removeEventListener(type, listener) {\n this.#ws.removeEventListener(type, listener);\n }\n get onopen() {\n return this.#ws.onopen;\n }\n set onopen(value) {\n this.#ws.onopen = value;\n }\n get onerror() {\n return this.#ws.onerror;\n }\n set onerror(value) {\n this.#ws.onerror = value;\n }\n get onclose() {\n return this.#ws.onclose;\n }\n set onclose(value) {\n this.#ws.onclose = value;\n }\n get onmessage() {\n return this.#ws.onmessage;\n }\n set onmessage(value) {\n this.#ws.onmessage = value;\n }\n get bufferedAmount() {\n return this.#ws.bufferedAmount;\n }\n get isPaused() {\n return this.#paused;\n }\n ping(data, mask, cb) {\n if (typeof data === \"function\")\n cb = data, data = mask = @undefined;\n else if (typeof mask === \"function\")\n cb = mask, mask = @undefined;\n if (typeof data === \"number\")\n data = data.toString();\n try {\n this.#ws.ping(data);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n pong(data, mask, cb) {\n if (typeof data === \"function\")\n cb = data, data = mask = @undefined;\n else if (typeof mask === \"function\")\n cb = mask, mask = @undefined;\n if (typeof data === \"number\")\n data = data.toString();\n try {\n this.#ws.pong(data);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n pause() {\n switch (this.readyState) {\n case WebSocket.CONNECTING:\n case WebSocket.CLOSED:\n return;\n }\n this.#paused = !0, emitWarning(\"pause()\", \"ws.WebSocket.pause() is not implemented in bun\");\n }\n resume() {\n switch (this.readyState) {\n case WebSocket.CONNECTING:\n case WebSocket.CLOSED:\n return;\n }\n this.#paused = !1, emitWarning(\"resume()\", \"ws.WebSocket.resume() is not implemented in bun\");\n }\n}\nObject.defineProperty(BunWebSocket, \"name\", { value: \"WebSocket\" });\nvar wsKeyRegex = /^[+/0-9A-Za-z]{22}==$/, wsTokenChars = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 1,\n 0,\n 1,\n 0\n], RUNNING = 0, CLOSING = 1, CLOSED = 2;\n\nclass BunWebSocketMocked extends EventEmitter {\n #ws;\n #state;\n #enquedMessages = [];\n #url;\n #protocol;\n #extensions;\n #bufferedAmount = 0;\n #binaryType = \"arraybuffer\";\n #onclose;\n #onerror;\n #onmessage;\n #onopen;\n constructor(url, protocol, extensions, binaryType) {\n super();\n if (this.#ws = null, this.#state = 0, this.#url = url, this.#bufferedAmount = 0, binaryType = binaryType || \"arraybuffer\", binaryType !== \"nodebuffer\" && binaryType !== \"blob\" && binaryType !== \"arraybuffer\")\n @throwTypeError(\"binaryType must be either 'blob', 'arraybuffer' or 'nodebuffer'\");\n this.#binaryType = binaryType, this.#protocol = protocol, this.#extensions = extensions;\n const message = this.#message.bind(this), open = this.#open.bind(this), close = this.#close.bind(this), drain = this.#drain.bind(this);\n this[kBunInternals] = {\n message,\n open,\n close,\n drain\n };\n }\n #message(ws, message) {\n this.#ws = ws;\n let isBinary = !1;\n if (typeof message === \"string\")\n if (this.#binaryType === \"arraybuffer\")\n message = encoder.encode(message).buffer;\n else if (this.#binaryType === \"blob\")\n message = new Blob([message], { type: \"text/plain\" });\n else\n message = @Buffer.from(message);\n else if (isBinary = !0, this.#binaryType !== \"nodebuffer\") {\n if (this.#binaryType === \"arraybuffer\")\n message = new @Uint8Array(message);\n else if (this.#binaryType === \"blob\")\n message = new Blob([message]);\n }\n this.emit(\"message\", message, isBinary);\n }\n #open(ws) {\n this.#ws = ws, this.#state = 1, this.emit(\"open\", this), this.#drain(ws);\n }\n #close(ws, code, reason) {\n this.#state = 3, this.#ws = null, this.emit(\"close\", code, reason);\n }\n #drain(ws) {\n const chunk = this.#enquedMessages[0];\n if (chunk) {\n const [data, compress, cb] = chunk;\n if (ws.send(data, compress) == -1)\n return;\n typeof cb === \"function\" && cb(), this.#bufferedAmount -= chunk.length, this.#enquedMessages.shift();\n }\n }\n send(data, opts, cb) {\n if (this.#state === 1) {\n const compress = opts\?.compress;\n if (this.#ws.send(data, compress) == -1) {\n this.#enquedMessages.push([data, compress, cb]), this.#bufferedAmount += data.length;\n return;\n }\n typeof cb === \"function\" && cb();\n } else if (this.#state === 0)\n this.#enquedMessages.push([data, opts\?.compress, cb]), this.#bufferedAmount += data.length;\n }\n close(code, reason) {\n if (this.#state === 1)\n this.#state = 2, this.#ws.close(code, reason);\n }\n get binaryType() {\n return this.#binaryType;\n }\n set binaryType(type) {\n if (type !== \"nodebuffer\" && type !== \"blob\" && type !== \"arraybuffer\")\n @throwTypeError(\"binaryType must be either 'blob', 'arraybuffer' or 'nodebuffer'\");\n this.#binaryType = type;\n }\n get readyState() {\n return this.#state;\n }\n get url() {\n return this.#url;\n }\n get protocol() {\n return this.#protocol;\n }\n get extensions() {\n return this.#extensions;\n }\n get bufferedAmount() {\n return this.#bufferedAmount \?\? 0;\n }\n setSocket(socket, head, options) {\n throw new Error(\"Not implemented\");\n }\n set onclose(cb) {\n if (this.#onclose)\n this.removeListener(\"close\", this.#onclose);\n this.on(\"close\", cb), this.#onclose = cb;\n }\n set onerror(cb) {\n if (this.#onerror)\n this.removeListener(\"error\", this.#onerror);\n this.on(\"error\", cb), this.#onerror = cb;\n }\n set onmessage(cb) {\n if (this.#onmessage)\n this.removeListener(\"message\", this.#onmessage);\n this.on(\"message\", cb), this.#onmessage = cb;\n }\n set onopen(cb) {\n if (this.#onopen)\n this.removeListener(\"open\", this.#onopen);\n this.on(\"open\", cb), this.#onopen = cb;\n }\n get onclose() {\n return this.#onclose;\n }\n get onerror() {\n return this.#onerror;\n }\n get onmessage() {\n return this.#onmessage;\n }\n get onopen() {\n return this.#onopen;\n }\n addEventListener(type, listener, options) {\n if (type === \"message\") {\n const l = (data) => listener({ data });\n l.listener = listener, this.on(type, l);\n return;\n }\n this.on(type, listener);\n }\n removeEventListener(type, listener) {\n this.off(type, listener);\n }\n}\n\nclass WebSocketServer extends EventEmitter {\n _server;\n options;\n clients;\n _shouldEmitClose;\n _state;\n _removeListeners;\n constructor(options, callback) {\n super();\n if (options = {\n maxPayload: 104857600,\n skipUTF8Validation: !1,\n perMessageDeflate: !1,\n handleProtocols: null,\n clientTracking: !0,\n verifyClient: null,\n noServer: !1,\n backlog: null,\n server: null,\n host: null,\n path: null,\n port: null,\n ...options\n }, options.port == null && !options.server && !options.noServer || options.port != null && (options.server || options.noServer) || options.server && options.noServer)\n @throwTypeError('One and only one of the \"port\", \"server\", or \"noServer\" options must be specified');\n if (options.port != null)\n this._server = http.createServer((req, res) => {\n const body = http.STATUS_CODES[426];\n res.writeHead(426, {\n \"Content-Length\": body.length,\n \"Content-Type\": \"text/plain\"\n }), res.end(body);\n }), this._server.listen(options.port, options.host, options.backlog, callback);\n else if (options.server)\n this._server = options.server;\n if (this._server) {\n const emitConnection = this.emit.bind(this, \"connection\"), emitListening = this.emit.bind(this, \"listening\"), emitError = this.emit.bind(this, \"error\"), doUpgrade = (req, socket, head) => {\n this.handleUpgrade(req, socket, head, emitConnection);\n };\n this._server.on(\"listening\", emitListening), this._server.on(\"error\", emitError), this._server.on(\"upgrade\", doUpgrade), this._removeListeners = () => {\n this._server.removeListener(\"upgrade\", doUpgrade), this._server.removeListener(\"listening\", emitListening), this._server.removeListener(\"error\", emitError);\n };\n }\n if (options.perMessageDeflate === !0)\n options.perMessageDeflate = {};\n if (options.clientTracking)\n this.clients = new Set, this._shouldEmitClose = !1;\n this.options = options, this._state = RUNNING;\n }\n address() {\n if (this.options.noServer)\n throw new Error('The server is operating in \"noServer\" mode');\n if (!this._server)\n return null;\n return this._server.address();\n }\n close(cb) {\n if (this._state === CLOSED) {\n if (cb)\n this.once(\"close\", () => {\n cb(new Error(\"The server is not running\"));\n });\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n return;\n }\n if (cb)\n this.once(\"close\", cb);\n if (this._state === CLOSING)\n return;\n if (this._state = CLOSING, this.options.noServer || this.options.server) {\n if (this._server)\n this._removeListeners(), this._removeListeners = this._server = null;\n if (this.clients)\n if (!this.clients.size)\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n else\n this._shouldEmitClose = !0;\n else\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n } else {\n const server = this._server;\n this._removeListeners(), this._removeListeners = this._server = null, server.close(() => {\n this._state = CLOSED, this.emit(\"close\");\n });\n }\n }\n shouldHandle(req) {\n if (this.options.path) {\n const index = req.url.indexOf(\"\?\");\n if ((index !== -1 \? req.url.slice(0, index) : req.url) !== this.options.path)\n return !1;\n }\n return !0;\n }\n completeUpgrade(extensions, key, protocols, request, socket, head, cb) {\n const [server, response, req] = socket[kBunInternals];\n if (this._state > RUNNING)\n return abortHandshake(response, 503);\n let protocol = \"\";\n if (protocols.size)\n protocol = this.options.handleProtocols \? this.options.handleProtocols(protocols, request) : protocols.values().next().value;\n const ws = new BunWebSocketMocked(request.url, protocol, extensions, \"nodebuffer\"), headers = [\"HTTP/1.1 101 Switching Protocols\", \"Upgrade: websocket\", \"Connection: Upgrade\"];\n if (this.emit(\"headers\", headers, request), server.upgrade(req, {\n data: ws[kBunInternals]\n })) {\n if (response._reply(@undefined), this.clients)\n this.clients.add(ws), ws.on(\"close\", () => {\n if (this.clients.delete(ws), this._shouldEmitClose && !this.clients.size)\n process.nextTick(wsEmitClose, this);\n });\n cb(ws, request);\n } else\n abortHandshake(response, 500);\n }\n handleUpgrade(req, socket, head, cb) {\n const [_, response] = socket[kBunInternals], key = req.headers[\"sec-websocket-key\"], version = +req.headers[\"sec-websocket-version\"];\n if (req.method !== \"GET\") {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 405, \"Invalid HTTP method\");\n return;\n }\n if (req.headers.upgrade.toLowerCase() !== \"websocket\") {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Invalid Upgrade header\");\n return;\n }\n if (!key || !wsKeyRegex.test(key)) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Missing or invalid Sec-WebSocket-Key header\");\n return;\n }\n if (version !== 8 && version !== 13) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Missing or invalid Sec-WebSocket-Version header\");\n return;\n }\n if (!this.shouldHandle(req)) {\n abortHandshake(response, 400);\n return;\n }\n const secWebSocketProtocol = req.headers[\"sec-websocket-protocol\"];\n let protocols = new Set;\n if (secWebSocketProtocol !== @undefined)\n try {\n protocols = subprotocolParse(secWebSocketProtocol);\n } catch (err) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Invalid Sec-WebSocket-Protocol header\");\n return;\n }\n const extensions = {};\n if (this.options.verifyClient) {\n const info = {\n origin: req.headers[`${version === 8 \? \"sec-websocket-origin\" : \"origin\"}`],\n secure: !!(req.socket.authorized || req.socket.encrypted),\n req\n };\n if (this.options.verifyClient.length === 2) {\n this.options.verifyClient(info, (verified, code, message, headers) => {\n if (!verified)\n return abortHandshake(response, code || 401, message, headers);\n this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);\n });\n return;\n }\n if (!this.options.verifyClient(info))\n return abortHandshake(response, 401);\n }\n this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);\n }\n}\nObject.defineProperty(BunWebSocket, \"CONNECTING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CONNECTING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(BunWebSocket, \"OPEN\", {\n enumerable: !0,\n value: readyStates.indexOf(\"OPEN\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"OPEN\", {\n enumerable: !0,\n value: readyStates.indexOf(\"OPEN\")\n});\nObject.defineProperty(BunWebSocket, \"CLOSING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSING\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CLOSING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSING\")\n});\nObject.defineProperty(BunWebSocket, \"CLOSED\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSED\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CLOSED\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSED\")\n});\n\nclass Sender {\n constructor() {\n throw new Error(\"Not supported yet in Bun\");\n }\n}\n\nclass Receiver {\n constructor() {\n throw new Error(\"Not supported yet in Bun\");\n }\n}\nvar createWebSocketStream = (ws) => {\n throw new Error(\"Not supported yet in Bun\");\n};\n$ = Object.assign(BunWebSocket, {\n createWebSocketStream,\n Receiver,\n Sender,\n WebSocket: BunWebSocket,\n Server: WebSocketServer,\n WebSocketServer\n});\nreturn $})\n");
//
#else
// Not 100% accurate, but basically inlining linux on non-windows non-mac platforms.
//
-static constexpr ASCIILiteral BunFFICode = "(function (){\"use strict\";// src/js/out/tmp/bun/ffi.ts\nvar FFIBuilder = function(params, returnType, functionToCall, name) {\n const hasReturnType = typeof FFIType[returnType] === \"number\" && FFIType[returnType] !== FFIType.void;\n var paramNames = new Array(params.length), args = new Array(params.length);\n for (let i = 0;i < params.length; i++) {\n paramNames[i] = `p${i}`;\n const wrapper = ffiWrappers[FFIType[params[i]]];\n if (wrapper)\n args[i] = `(val=>${wrapper})(p${i})`;\n else\n @throwTypeError(`Unsupported type ${params[i]}. Must be one of: ${Object.keys(FFIType).sort().join(\", \")}`);\n }\n var code = `functionToCall(${args.join(\", \")})`;\n if (hasReturnType)\n if (FFIType[returnType] === FFIType.cstring)\n code = `return new __GlobalBunCString(${code})`;\n else\n code = `return ${code}`;\n var func = new Function(\"functionToCall\", ...paramNames, code);\n Object.defineProperty(func, \"name\", {\n value: name\n });\n var wrap;\n switch (paramNames.length) {\n case 0:\n wrap = () => func(functionToCall);\n break;\n case 1:\n wrap = (arg1) => func(functionToCall, arg1);\n break;\n case 2:\n wrap = (arg1, arg2) => func(functionToCall, arg1, arg2);\n break;\n case 3:\n wrap = (arg1, arg2, arg3) => func(functionToCall, arg1, arg2, arg3);\n break;\n case 4:\n wrap = (arg1, arg2, arg3, arg4) => func(functionToCall, arg1, arg2, arg3, arg4);\n break;\n case 5:\n wrap = (arg1, arg2, arg3, arg4, arg5) => func(functionToCall, arg1, arg2, arg3, arg4, arg5);\n break;\n case 6:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6);\n break;\n case 7:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7);\n break;\n case 8:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);\n break;\n case 9:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);\n break;\n default: {\n wrap = (...args2) => func(functionToCall, ...args2);\n break;\n }\n }\n return wrap.native = functionToCall, wrap.ptr = functionToCall.ptr, wrap;\n}, dlopen = function(path, options) {\n const result = nativeDLOpen(path, options);\n for (let key in result.symbols) {\n var symbol = result.symbols[key];\n if (options[key]\?.args\?.length || FFIType[options[key]\?.returns] === FFIType.cstring)\n result.symbols[key] = FFIBuilder(options[key].args \?\? [], options[key].returns \?\? FFIType.void, symbol, path.includes(\"/\") \? `${key} (${path.split(\"/\").pop()})` : `${key} (${path})`);\n else\n result.symbols[key].native = result.symbols[key];\n }\n return result.close = result.close.bind(result), result;\n}, linkSymbols = function(options) {\n const result = nativeLinkSymbols(options);\n for (let key in result.symbols) {\n var symbol = result.symbols[key];\n if (options[key]\?.args\?.length || FFIType[options[key]\?.returns] === FFIType.cstring)\n result.symbols[key] = FFIBuilder(options[key].args \?\? [], options[key].returns \?\? FFIType.void, symbol, key);\n else\n result.symbols[key].native = result.symbols[key];\n }\n return result;\n}, onCloseCFunction = function(close) {\n close();\n}, CFunction = function(options) {\n const identifier = `CFunction${cFunctionI++}`;\n var result = linkSymbols({\n [identifier]: options\n }), hasClosed = !1, close = result.close.bind(result);\n return result.symbols[identifier].close = () => {\n if (hasClosed || !close)\n return;\n hasClosed = !0, close(), close = void 0;\n }, cFunctionRegistry ||= new FinalizationRegistry(onCloseCFunction), cFunctionRegistry.register(result.symbols[identifier], result.symbols[identifier].close), result.symbols[identifier];\n}, $, FFIType = {\n \"0\": 0,\n \"1\": 1,\n \"2\": 2,\n \"3\": 3,\n \"4\": 4,\n \"5\": 5,\n \"6\": 6,\n \"7\": 7,\n \"8\": 8,\n \"9\": 9,\n \"10\": 10,\n \"11\": 11,\n \"12\": 12,\n \"13\": 13,\n \"14\": 14,\n \"15\": 15,\n \"16\": 16,\n \"17\": 17,\n bool: 11,\n c_int: 5,\n c_uint: 6,\n char: 0,\n \"char*\": 12,\n double: 9,\n f32: 10,\n f64: 9,\n float: 10,\n i16: 3,\n i32: 5,\n i64: 7,\n i8: 1,\n int: 5,\n int16_t: 3,\n int32_t: 5,\n int64_t: 7,\n int8_t: 1,\n isize: 7,\n u16: 4,\n u32: 6,\n u64: 8,\n u8: 2,\n uint16_t: 4,\n uint32_t: 6,\n uint64_t: 8,\n uint8_t: 2,\n usize: 8,\n \"void*\": 12,\n ptr: 12,\n pointer: 12,\n void: 13,\n cstring: 14,\n i64_fast: 15,\n u64_fast: 16,\n function: 17,\n callback: 17,\n fn: 17\n};\nvar ffi = globalThis.Bun.FFI, ptr = (arg1, arg2) => typeof arg2 === \"undefined\" \? ffi.ptr(arg1) : ffi.ptr(arg1, arg2), toBuffer = ffi.toBuffer, toArrayBuffer = ffi.toArrayBuffer, viewSource = ffi.viewSource, BunCString = ffi.CString, nativeLinkSymbols = ffi.linkSymbols, nativeDLOpen = ffi.dlopen, nativeCallback = ffi.callback, closeCallback = ffi.closeCallback;\ndelete ffi.callback;\ndelete ffi.closeCallback;\n\nclass JSCallback {\n constructor(cb, options) {\n const { ctx, ptr: ptr2 } = nativeCallback(options, cb);\n this.#ctx = ctx, this.ptr = ptr2, this.#threadsafe = !!options\?.threadsafe;\n }\n ptr;\n #ctx;\n #threadsafe;\n get threadsafe() {\n return this.#threadsafe;\n }\n [Symbol.toPrimitive]() {\n const { ptr: ptr2 } = this;\n return typeof ptr2 === \"number\" \? ptr2 : 0;\n }\n close() {\n const ctx = this.#ctx;\n if (this.ptr = null, this.#ctx = null, ctx)\n closeCallback(ctx);\n }\n}\n\nclass CString extends String {\n constructor(ptr2, byteOffset, byteLength) {\n super(ptr2 \? typeof byteLength === \"number\" && Number.isSafeInteger(byteLength) \? BunCString(ptr2, byteOffset || 0, byteLength) : BunCString(ptr2) : \"\");\n if (this.ptr = typeof ptr2 === \"number\" \? ptr2 : 0, typeof byteOffset !== \"undefined\")\n this.byteOffset = byteOffset;\n if (typeof byteLength !== \"undefined\")\n this.byteLength = byteLength;\n }\n ptr;\n byteOffset;\n byteLength;\n #cachedArrayBuffer;\n get arrayBuffer() {\n if (this.#cachedArrayBuffer)\n return this.#cachedArrayBuffer;\n if (!this.ptr)\n return this.#cachedArrayBuffer = new ArrayBuffer(0);\n return this.#cachedArrayBuffer = toArrayBuffer(this.ptr, this.byteOffset, this.byteLength);\n }\n}\nObject.defineProperty(globalThis, \"__GlobalBunCString\", {\n value: CString,\n enumerable: !1,\n configurable: !1\n});\nvar ffiWrappers = new Array(18), char = \"val|0\";\nffiWrappers.fill(char);\nffiWrappers[FFIType.uint8_t] = \"val<0\?0:val>=255\?255:val|0\";\nffiWrappers[FFIType.int16_t] = \"val<=-32768\?-32768:val>=32768\?32768:val|0\";\nffiWrappers[FFIType.uint16_t] = \"val<=0\?0:val>=65536\?65536:val|0\";\nffiWrappers[FFIType.int32_t] = \"val|0\";\nffiWrappers[FFIType.uint32_t] = \"val<=0\?0:val>=0xffffffff\?0xffffffff:+val||0\";\nffiWrappers[FFIType.i64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(-Number.MAX_SAFE_INTEGER)) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.i64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(-Number.MAX_SAFE_INTEGER)) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.u64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= 0) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.int64_t] = `{\n if (typeof val === \"bigint\") {\n return val;\n }\n\n if (typeof val === \"number\") {\n return BigInt(val || 0);\n }\n\n return BigInt(+val || 0);\n}`;\nffiWrappers[FFIType.uint64_t] = `{\n if (typeof val === \"bigint\") {\n return val;\n }\n\n if (typeof val === \"number\") {\n return val <= 0 \? BigInt(0) : BigInt(val || 0);\n }\n\n return BigInt(+val || 0);\n}`;\nffiWrappers[FFIType.u64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(0)) return Number(val);\n return val;\n }\n\n return typeof val === \"number\" \? (val <= 0 \? 0 : +val || 0) : +val || 0;\n}`;\nffiWrappers[FFIType.uint16_t] = `{\n const ret = (typeof val === \"bigint\" \? Number(val) : val) | 0;\n return ret <= 0 \? 0 : ret > 0xffff \? 0xffff : ret;\n}`;\nffiWrappers[FFIType.double] = `{\n if (typeof val === \"bigint\") {\n if (val.valueOf() < BigInt(Number.MAX_VALUE)) {\n return Math.abs(Number(val).valueOf()) + 0.00000000000001 - 0.00000000000001;\n }\n }\n\n if (!val) {\n return 0 + 0.00000000000001 - 0.00000000000001;\n }\n\n return val + 0.00000000000001 - 0.00000000000001;\n}`;\nffiWrappers[FFIType.float] = ffiWrappers[10] = `{\n return Math.fround(val);\n}`;\nffiWrappers[FFIType.bool] = `{\n return !!val;\n}`;\nObject.defineProperty(globalThis, \"__GlobalBunFFIPtrFunctionForWrapper\", {\n value: ptr,\n enumerable: !1,\n configurable: !0\n});\nffiWrappers[FFIType.cstring] = ffiWrappers[FFIType.pointer] = `{\n if (typeof val === \"number\") return val;\n if (!val) {\n return null;\n }\n\n if (ArrayBuffer.isView(val) || val instanceof ArrayBuffer) {\n return __GlobalBunFFIPtrFunctionForWrapper(val);\n }\n\n if (typeof val === \"string\") {\n throw new TypeError(\"To convert a string to a pointer, encode it as a buffer\");\n }\n\n throw new TypeError(\\`Unable to convert \\${ val } to a pointer\\`);\n}`;\nffiWrappers[FFIType.function] = `{\n if (typeof val === \"number\") {\n return val;\n }\n\n if (typeof val === \"bigint\") {\n return Number(val);\n }\n\n var ptr = val && val.ptr;\n\n if (!ptr) {\n throw new TypeError(\"Expected function to be a JSCallback or a number\");\n }\n\n return ptr;\n}`;\nvar native = {\n dlopen: nativeDLOpen,\n callback: () => {\n throw new Error(\"Deprecated. Use new JSCallback(options, fn) instead\");\n }\n}, cFunctionI = 0, cFunctionRegistry, read = ffi.read;\n$ = {\n CFunction,\n CString,\n FFIType,\n JSCallback,\n dlopen,\n linkSymbols,\n native,\n ptr,\n read,\n suffix: \"so\",\n toArrayBuffer,\n toBuffer,\n viewSource\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral BunFFICode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/bun/ffi.ts\nvar FFIBuilder = function(params, returnType, functionToCall, name) {\n const hasReturnType = typeof FFIType[returnType] === \"number\" && FFIType[returnType] !== FFIType.void;\n var paramNames = new @Array(params.length), args = new @Array(params.length);\n for (let i = 0;i < params.length; i++) {\n paramNames[i] = `p${i}`;\n const wrapper = ffiWrappers[FFIType[params[i]]];\n if (wrapper)\n args[i] = `(val=>${wrapper})(p${i})`;\n else\n @throwTypeError(`Unsupported type ${params[i]}. Must be one of: ${Object.keys(FFIType).sort().join(\", \")}`);\n }\n var code = `functionToCall(${args.join(\", \")})`;\n if (hasReturnType)\n if (FFIType[returnType] === FFIType.cstring)\n code = `return new __GlobalBunCString(${code})`;\n else\n code = `return ${code}`;\n var func = new Function(\"functionToCall\", ...paramNames, code);\n Object.defineProperty(func, \"name\", {\n value: name\n });\n var wrap;\n switch (paramNames.length) {\n case 0:\n wrap = () => func(functionToCall);\n break;\n case 1:\n wrap = (arg1) => func(functionToCall, arg1);\n break;\n case 2:\n wrap = (arg1, arg2) => func(functionToCall, arg1, arg2);\n break;\n case 3:\n wrap = (arg1, arg2, arg3) => func(functionToCall, arg1, arg2, arg3);\n break;\n case 4:\n wrap = (arg1, arg2, arg3, arg4) => func(functionToCall, arg1, arg2, arg3, arg4);\n break;\n case 5:\n wrap = (arg1, arg2, arg3, arg4, arg5) => func(functionToCall, arg1, arg2, arg3, arg4, arg5);\n break;\n case 6:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6);\n break;\n case 7:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7);\n break;\n case 8:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);\n break;\n case 9:\n wrap = (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => func(functionToCall, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);\n break;\n default: {\n wrap = (...args2) => func(functionToCall, ...args2);\n break;\n }\n }\n return wrap.native = functionToCall, wrap.ptr = functionToCall.ptr, wrap;\n}, dlopen = function(path, options) {\n const result = nativeDLOpen(path, options);\n if (result instanceof Error)\n throw result;\n for (let key in result.symbols) {\n var symbol = result.symbols[key];\n if (options[key]\?.args\?.length || FFIType[options[key]\?.returns] === FFIType.cstring)\n result.symbols[key] = FFIBuilder(options[key].args \?\? [], options[key].returns \?\? FFIType.void, symbol, path.includes(\"/\") \? `${key} (${path.split(\"/\").pop()})` : `${key} (${path})`);\n else\n result.symbols[key].native = result.symbols[key];\n }\n return result.close = result.close.bind(result), result;\n}, linkSymbols = function(options) {\n const result = nativeLinkSymbols(options);\n for (let key in result.symbols) {\n var symbol = result.symbols[key];\n if (options[key]\?.args\?.length || FFIType[options[key]\?.returns] === FFIType.cstring)\n result.symbols[key] = FFIBuilder(options[key].args \?\? [], options[key].returns \?\? FFIType.void, symbol, key);\n else\n result.symbols[key].native = result.symbols[key];\n }\n return result;\n}, onCloseCFunction = function(close) {\n close();\n}, CFunction = function(options) {\n const identifier = `CFunction${cFunctionI++}`;\n var result = linkSymbols({\n [identifier]: options\n }), hasClosed = !1, close = result.close.bind(result);\n return result.symbols[identifier].close = () => {\n if (hasClosed || !close)\n return;\n hasClosed = !0, close(), close = @undefined;\n }, cFunctionRegistry ||= new FinalizationRegistry(onCloseCFunction), cFunctionRegistry.register(result.symbols[identifier], result.symbols[identifier].close), result.symbols[identifier];\n}, $, FFIType = {\n \"0\": 0,\n \"1\": 1,\n \"2\": 2,\n \"3\": 3,\n \"4\": 4,\n \"5\": 5,\n \"6\": 6,\n \"7\": 7,\n \"8\": 8,\n \"9\": 9,\n \"10\": 10,\n \"11\": 11,\n \"12\": 12,\n \"13\": 13,\n \"14\": 14,\n \"15\": 15,\n \"16\": 16,\n \"17\": 17,\n bool: 11,\n c_int: 5,\n c_uint: 6,\n char: 0,\n \"char*\": 12,\n double: 9,\n f32: 10,\n f64: 9,\n float: 10,\n i16: 3,\n i32: 5,\n i64: 7,\n i8: 1,\n int: 5,\n int16_t: 3,\n int32_t: 5,\n int64_t: 7,\n int8_t: 1,\n isize: 7,\n u16: 4,\n u32: 6,\n u64: 8,\n u8: 2,\n uint16_t: 4,\n uint32_t: 6,\n uint64_t: 8,\n uint8_t: 2,\n usize: 8,\n \"void*\": 12,\n ptr: 12,\n pointer: 12,\n void: 13,\n cstring: 14,\n i64_fast: 15,\n u64_fast: 16,\n function: 17,\n callback: 17,\n fn: 17\n};\nvar ffi = globalThis.Bun.FFI, ptr = (arg1, arg2) => typeof arg2 === \"undefined\" \? ffi.ptr(arg1) : ffi.ptr(arg1, arg2), toBuffer = ffi.toBuffer, toArrayBuffer = ffi.toArrayBuffer, viewSource = ffi.viewSource, BunCString = ffi.CString, nativeLinkSymbols = ffi.linkSymbols, nativeDLOpen = ffi.dlopen, nativeCallback = ffi.callback, closeCallback = ffi.closeCallback;\ndelete ffi.callback;\ndelete ffi.closeCallback;\n\nclass JSCallback {\n constructor(cb, options) {\n const { ctx, ptr: ptr2 } = nativeCallback(options, cb);\n this.#ctx = ctx, this.ptr = ptr2, this.#threadsafe = !!options\?.threadsafe;\n }\n ptr;\n #ctx;\n #threadsafe;\n get threadsafe() {\n return this.#threadsafe;\n }\n [Symbol.toPrimitive]() {\n const { ptr: ptr2 } = this;\n return typeof ptr2 === \"number\" \? ptr2 : 0;\n }\n close() {\n const ctx = this.#ctx;\n if (this.ptr = null, this.#ctx = null, ctx)\n closeCallback(ctx);\n }\n}\n\nclass CString extends @String {\n constructor(ptr2, byteOffset, byteLength) {\n super(ptr2 \? typeof byteLength === \"number\" && Number.isSafeInteger(byteLength) \? BunCString(ptr2, byteOffset || 0, byteLength) : BunCString(ptr2) : \"\");\n if (this.ptr = typeof ptr2 === \"number\" \? ptr2 : 0, typeof byteOffset !== \"undefined\")\n this.byteOffset = byteOffset;\n if (typeof byteLength !== \"undefined\")\n this.byteLength = byteLength;\n }\n ptr;\n byteOffset;\n byteLength;\n #cachedArrayBuffer;\n get arrayBuffer() {\n if (this.#cachedArrayBuffer)\n return this.#cachedArrayBuffer;\n if (!this.ptr)\n return this.#cachedArrayBuffer = new @ArrayBuffer(0);\n return this.#cachedArrayBuffer = toArrayBuffer(this.ptr, this.byteOffset, this.byteLength);\n }\n}\nObject.defineProperty(globalThis, \"__GlobalBunCString\", {\n value: CString,\n enumerable: !1,\n configurable: !1\n});\nvar ffiWrappers = new @Array(18), char = \"val|0\";\nffiWrappers.fill(char);\nffiWrappers[FFIType.uint8_t] = \"val<0\?0:val>=255\?255:val|0\";\nffiWrappers[FFIType.int16_t] = \"val<=-32768\?-32768:val>=32768\?32768:val|0\";\nffiWrappers[FFIType.uint16_t] = \"val<=0\?0:val>=65536\?65536:val|0\";\nffiWrappers[FFIType.int32_t] = \"val|0\";\nffiWrappers[FFIType.uint32_t] = \"val<=0\?0:val>=0xffffffff\?0xffffffff:+val||0\";\nffiWrappers[FFIType.i64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(-Number.MAX_SAFE_INTEGER)) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.i64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(-Number.MAX_SAFE_INTEGER)) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.u64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= 0) {\n return Number(val).valueOf() || 0;\n }\n\n return val;\n }\n\n return !val \? 0 : +val || 0;\n}`;\nffiWrappers[FFIType.int64_t] = `{\n if (typeof val === \"bigint\") {\n return val;\n }\n\n if (typeof val === \"number\") {\n return BigInt(val || 0);\n }\n\n return BigInt(+val || 0);\n}`;\nffiWrappers[FFIType.uint64_t] = `{\n if (typeof val === \"bigint\") {\n return val;\n }\n\n if (typeof val === \"number\") {\n return val <= 0 \? BigInt(0) : BigInt(val || 0);\n }\n\n return BigInt(+val || 0);\n}`;\nffiWrappers[FFIType.u64_fast] = `{\n if (typeof val === \"bigint\") {\n if (val <= BigInt(Number.MAX_SAFE_INTEGER) && val >= BigInt(0)) return Number(val);\n return val;\n }\n\n return typeof val === \"number\" \? (val <= 0 \? 0 : +val || 0) : +val || 0;\n}`;\nffiWrappers[FFIType.uint16_t] = `{\n const ret = (typeof val === \"bigint\" \? Number(val) : val) | 0;\n return ret <= 0 \? 0 : ret > 0xffff \? 0xffff : ret;\n}`;\nffiWrappers[FFIType.double] = `{\n if (typeof val === \"bigint\") {\n if (val.valueOf() < BigInt(Number.MAX_VALUE)) {\n return Math.abs(Number(val).valueOf()) + 0.00000000000001 - 0.00000000000001;\n }\n }\n\n if (!val) {\n return 0 + 0.00000000000001 - 0.00000000000001;\n }\n\n return val + 0.00000000000001 - 0.00000000000001;\n}`;\nffiWrappers[FFIType.float] = ffiWrappers[10] = `{\n return Math.fround(val);\n}`;\nffiWrappers[FFIType.bool] = `{\n return !!val;\n}`;\nObject.defineProperty(globalThis, \"__GlobalBunFFIPtrFunctionForWrapper\", {\n value: ptr,\n enumerable: !1,\n configurable: !0\n});\nffiWrappers[FFIType.cstring] = ffiWrappers[FFIType.pointer] = `{\n if (typeof val === \"number\") return val;\n if (!val) {\n return null;\n }\n\n if (ArrayBuffer.isView(val) || val instanceof ArrayBuffer) {\n return __GlobalBunFFIPtrFunctionForWrapper(val);\n }\n\n if (typeof val === \"string\") {\n throw new TypeError(\"To convert a string to a pointer, encode it as a buffer\");\n }\n\n throw new TypeError(\\`Unable to convert \\${ val } to a pointer\\`);\n}`;\nffiWrappers[FFIType.function] = `{\n if (typeof val === \"number\") {\n return val;\n }\n\n if (typeof val === \"bigint\") {\n return Number(val);\n }\n\n var ptr = val && val.ptr;\n\n if (!ptr) {\n throw new TypeError(\"Expected function to be a JSCallback or a number\");\n }\n\n return ptr;\n}`;\nvar native = {\n dlopen: nativeDLOpen,\n callback: () => {\n throw new Error(\"Deprecated. Use new JSCallback(options, fn) instead\");\n }\n}, cFunctionI = 0, cFunctionRegistry, read = ffi.read;\n$ = {\n CFunction,\n CString,\n FFIType,\n JSCallback,\n dlopen,\n linkSymbols,\n native,\n ptr,\n read,\n suffix: \"so\",\n toArrayBuffer,\n toBuffer,\n viewSource\n};\nreturn $})\n");
+//
+
+//
+static constexpr ASCIILiteral BunSqliteCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/bun/sqlite.ts\nvar $, defineProperties = Object.defineProperties, toStringTag = Symbol.toStringTag, isArray = @Array.isArray, isTypedArray = @ArrayBuffer.isView, constants = {\n SQLITE_OPEN_READONLY: 1,\n SQLITE_OPEN_READWRITE: 2,\n SQLITE_OPEN_CREATE: 4,\n SQLITE_OPEN_DELETEONCLOSE: 8,\n SQLITE_OPEN_EXCLUSIVE: 16,\n SQLITE_OPEN_AUTOPROXY: 32,\n SQLITE_OPEN_URI: 64,\n SQLITE_OPEN_MEMORY: 128,\n SQLITE_OPEN_MAIN_DB: 256,\n SQLITE_OPEN_TEMP_DB: 512,\n SQLITE_OPEN_TRANSIENT_DB: 1024,\n SQLITE_OPEN_MAIN_JOURNAL: 2048,\n SQLITE_OPEN_TEMP_JOURNAL: 4096,\n SQLITE_OPEN_SUBJOURNAL: 8192,\n SQLITE_OPEN_SUPER_JOURNAL: 16384,\n SQLITE_OPEN_NOMUTEX: 32768,\n SQLITE_OPEN_FULLMUTEX: 65536,\n SQLITE_OPEN_SHAREDCACHE: 131072,\n SQLITE_OPEN_PRIVATECACHE: 262144,\n SQLITE_OPEN_WAL: 524288,\n SQLITE_OPEN_NOFOLLOW: 16777216,\n SQLITE_OPEN_EXRESCODE: 33554432,\n SQLITE_PREPARE_PERSISTENT: 1,\n SQLITE_PREPARE_NORMALIZE: 2,\n SQLITE_PREPARE_NO_VTAB: 4\n}, SQL, controllers;\n\nclass Statement {\n constructor(raw) {\n switch (this.#raw = raw, raw.paramsCount) {\n case 0: {\n this.get = this.#getNoArgs, this.all = this.#allNoArgs, this.values = this.#valuesNoArgs, this.run = this.#runNoArgs;\n break;\n }\n default: {\n this.get = this.#get, this.all = this.#all, this.values = this.#values, this.run = this.#run;\n break;\n }\n }\n }\n #raw;\n get;\n all;\n values;\n run;\n isFinalized = !1;\n toJSON() {\n return {\n sql: this.native.toString(),\n isFinalized: this.isFinalized,\n paramsCount: this.paramsCount,\n columnNames: this.columnNames\n };\n }\n get [toStringTag]() {\n return `\"${this.native.toString()}\"`;\n }\n toString() {\n return this.native.toString();\n }\n get native() {\n return this.#raw;\n }\n #getNoArgs() {\n return this.#raw.get();\n }\n #allNoArgs() {\n return this.#raw.all();\n }\n #valuesNoArgs() {\n return this.#raw.values();\n }\n #runNoArgs() {\n this.#raw.run();\n }\n #get(...args) {\n if (args.length === 0)\n return this.#getNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.get(args) : this.#raw.get(...args);\n }\n #all(...args) {\n if (args.length === 0)\n return this.#allNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.all(args) : this.#raw.all(...args);\n }\n #values(...args) {\n if (args.length === 0)\n return this.#valuesNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.values(args) : this.#raw.values(...args);\n }\n #run(...args) {\n if (args.length === 0)\n return this.#runNoArgs();\n var arg0 = args[0];\n !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.run(args) : this.#raw.run(...args);\n }\n get columnNames() {\n return this.#raw.columns;\n }\n get paramsCount() {\n return this.#raw.paramsCount;\n }\n finalize(...args) {\n return this.isFinalized = !0, this.#raw.finalize(...args);\n }\n}\nvar cachedCount = Symbol.for(\"Bun.Database.cache.count\");\n\nclass Database {\n constructor(filenameGiven, options) {\n if (typeof filenameGiven === \"undefined\")\n ;\n else if (typeof filenameGiven !== \"string\") {\n if (isTypedArray(filenameGiven)) {\n this.#handle = Database.#deserialize(filenameGiven, typeof options === \"object\" && options \? !!options.readonly : ((options | 0) & constants.SQLITE_OPEN_READONLY) != 0), this.filename = \":memory:\";\n return;\n }\n @throwTypeError(`Expected 'filename' to be a string, got '${typeof filenameGiven}'`);\n }\n var filename = typeof filenameGiven === \"string\" \? filenameGiven.trim() : \":memory:\", flags = constants.SQLITE_OPEN_READWRITE | constants.SQLITE_OPEN_CREATE;\n if (typeof options === \"object\" && options) {\n if (flags = 0, options.readonly)\n flags = constants.SQLITE_OPEN_READONLY;\n if (\"readOnly\" in options)\n @throwTypeError('Misspelled option \"readOnly\" should be \"readonly\"');\n if (options.create)\n flags = constants.SQLITE_OPEN_READWRITE | constants.SQLITE_OPEN_CREATE;\n if (options.readwrite)\n flags |= constants.SQLITE_OPEN_READWRITE;\n } else if (typeof options === \"number\")\n flags = options;\n const anonymous = filename === \"\" || filename === \":memory:\";\n if (anonymous && (flags & constants.SQLITE_OPEN_READONLY) !== 0)\n throw new Error(\"Cannot open an anonymous database in read-only mode.\");\n if (!SQL)\n SQL = @lazy(\"sqlite\");\n this.#handle = SQL.open(anonymous \? \":memory:\" : filename, flags), this.filename = filename;\n }\n #handle;\n #cachedQueriesKeys = [];\n #cachedQueriesLengths = [];\n #cachedQueriesValues = [];\n filename;\n get handle() {\n return this.#handle;\n }\n get inTransaction() {\n return SQL.isInTransaction(this.#handle);\n }\n static open(filename, options) {\n return new Database(filename, options);\n }\n loadExtension(name, entryPoint) {\n return SQL.loadExtension(this.#handle, name, entryPoint);\n }\n serialize(optionalName) {\n return SQL.serialize(this.#handle, optionalName || \"main\");\n }\n static #deserialize(serialized, isReadOnly = !1) {\n if (!SQL)\n SQL = @lazy(\"sqlite\");\n return SQL.deserialize(serialized, isReadOnly);\n }\n static deserialize(serialized, isReadOnly = !1) {\n return new Database(serialized, isReadOnly \? constants.SQLITE_OPEN_READONLY : 0);\n }\n static setCustomSQLite(path) {\n if (!SQL)\n SQL = @lazy(\"sqlite\");\n return SQL.setCustomSQLite(path);\n }\n close() {\n return this.clearQueryCache(), SQL.close(this.#handle);\n }\n clearQueryCache() {\n for (let item of this.#cachedQueriesValues)\n item.finalize();\n this.#cachedQueriesKeys.length = 0, this.#cachedQueriesValues.length = 0, this.#cachedQueriesLengths.length = 0;\n }\n run(query, ...params) {\n if (params.length === 0) {\n SQL.run(this.#handle, query);\n return;\n }\n var arg0 = params[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? SQL.run(this.#handle, query, params) : SQL.run(this.#handle, query, ...params);\n }\n prepare(query, params, flags) {\n return new Statement(SQL.prepare(this.#handle, query, params, flags || 0));\n }\n static MAX_QUERY_CACHE_SIZE = 20;\n get [cachedCount]() {\n return this.#cachedQueriesKeys.length;\n }\n query(query) {\n if (typeof query !== \"string\")\n @throwTypeError(`Expected 'query' to be a string, got '${typeof query}'`);\n if (query.length === 0)\n throw new Error(\"SQL query cannot be empty.\");\n const willCache = this.#cachedQueriesKeys.length < Database.MAX_QUERY_CACHE_SIZE;\n var index = this.#cachedQueriesLengths.indexOf(query.length);\n while (index !== -1) {\n if (this.#cachedQueriesKeys[index] !== query) {\n index = this.#cachedQueriesLengths.indexOf(query.length, index + 1);\n continue;\n }\n var stmt = this.#cachedQueriesValues[index];\n if (stmt.isFinalized)\n return this.#cachedQueriesValues[index] = this.prepare(query, @undefined, willCache \? constants.SQLITE_PREPARE_PERSISTENT : 0);\n return stmt;\n }\n var stmt = this.prepare(query, @undefined, willCache \? constants.SQLITE_PREPARE_PERSISTENT : 0);\n if (willCache)\n this.#cachedQueriesKeys.push(query), this.#cachedQueriesLengths.push(query.length), this.#cachedQueriesValues.push(stmt);\n return stmt;\n }\n transaction(fn, self) {\n if (typeof fn !== \"function\")\n @throwTypeError(\"Expected first argument to be a function\");\n const db = this, controller = getController(db, self), properties = {\n default: { value: wrapTransaction(fn, db, controller.default) },\n deferred: { value: wrapTransaction(fn, db, controller.deferred) },\n immediate: {\n value: wrapTransaction(fn, db, controller.immediate)\n },\n exclusive: {\n value: wrapTransaction(fn, db, controller.exclusive)\n },\n database: { value: this, enumerable: !0 }\n };\n return defineProperties(properties.default.value, properties), defineProperties(properties.deferred.value, properties), defineProperties(properties.immediate.value, properties), defineProperties(properties.exclusive.value, properties), properties.default.value;\n }\n}\nDatabase.prototype.exec = Database.prototype.run;\nvar getController = (db, self) => {\n let controller = (controllers ||= new WeakMap).get(db);\n if (!controller) {\n const shared = {\n commit: db.prepare(\"COMMIT\", @undefined, 0),\n rollback: db.prepare(\"ROLLBACK\", @undefined, 0),\n savepoint: db.prepare(\"SAVEPOINT `\\t_bs3.\\t`\", @undefined, 0),\n release: db.prepare(\"RELEASE `\\t_bs3.\\t`\", @undefined, 0),\n rollbackTo: db.prepare(\"ROLLBACK TO `\\t_bs3.\\t`\", @undefined, 0)\n };\n controllers.set(db, controller = {\n default: Object.assign({ begin: db.prepare(\"BEGIN\", @undefined, 0) }, shared),\n deferred: Object.assign({ begin: db.prepare(\"BEGIN DEFERRED\", @undefined, 0) }, shared),\n immediate: Object.assign({ begin: db.prepare(\"BEGIN IMMEDIATE\", @undefined, 0) }, shared),\n exclusive: Object.assign({ begin: db.prepare(\"BEGIN EXCLUSIVE\", @undefined, 0) }, shared)\n });\n }\n return controller;\n}, wrapTransaction = (fn, db, { begin, commit, rollback, savepoint, release, rollbackTo }) => function transaction(...args) {\n let before, after, undo;\n if (db.inTransaction)\n before = savepoint, after = release, undo = rollbackTo;\n else\n before = begin, after = commit, undo = rollback;\n try {\n before.run();\n const result = fn.@apply(this, args);\n return after.run(), result;\n } catch (ex) {\n if (db.inTransaction) {\n if (undo.run(), undo !== rollback)\n after.run();\n }\n throw ex;\n }\n};\n$ = {\n __esModule: !0,\n Database,\n Statement,\n constants,\n default: Database\n};\nreturn $})\n");
+//
+
+//
+static constexpr ASCIILiteral InternalDebuggerCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/debugger.ts\nvar versionInfo = function() {\n return {\n \"Protocol-Version\": \"1.3\",\n Browser: \"Bun\",\n \"User-Agent\": navigator.userAgent,\n \"WebKit-Version\": process.versions.webkit,\n \"Bun-Version\": Bun.version,\n \"Bun-Revision\": Bun.revision\n };\n}, webSocketWriter = function(ws) {\n return {\n write: (message) => !!ws.sendText(message),\n close: () => ws.close()\n };\n}, socketWriter = function(socket) {\n return {\n write: (message) => !!socket.write(message),\n close: () => socket.end()\n };\n}, bufferedWriter = function(writer) {\n let draining = !1, pendingMessages = [];\n return {\n write: (message) => {\n if (draining || !writer.write(message))\n pendingMessages.push(message);\n return !0;\n },\n drain: () => {\n draining = !0;\n try {\n for (let i = 0;i < pendingMessages.length; i++)\n if (!writer.write(pendingMessages[i])) {\n pendingMessages = pendingMessages.slice(i);\n return;\n }\n } finally {\n draining = !1;\n }\n },\n close: () => {\n writer.close(), pendingMessages.length = 0;\n }\n };\n}, parseUrl = function(url) {\n try {\n if (!url)\n return new URL(randomId(), `ws://${defaultHostname}:${defaultPort}/`);\n else if (url.startsWith(\"/\"))\n return new URL(url, `ws://${defaultHostname}:${defaultPort}/`);\n else if (/^[a-z+]+:\\/\\//i.test(url))\n return new URL(url);\n else if (/^\\d+$/.test(url))\n return new URL(randomId(), `ws://${defaultHostname}:${url}/`);\n else if (!url.includes(\"/\") && url.includes(\":\"))\n return new URL(randomId(), `ws://${url}/`);\n else if (!url.includes(\":\")) {\n const [hostname, pathname] = url.split(\"/\", 2);\n return new URL(`ws://${hostname}:${defaultPort}/${pathname}`);\n } else\n return new URL(randomId(), `ws://${url}`);\n } catch {\n @throwTypeError(`Invalid hostname or URL: '${url}'`);\n }\n}, randomId = function() {\n return Math.random().toString(36).slice(2);\n}, dim = function(string) {\n if (enableANSIColors)\n return `\\x1B[2m${string}\\x1B[22m`;\n return string;\n}, link = function(url) {\n if (enableANSIColors)\n return `\\x1B[1m\\x1B]8;;${url}\\x1B\\\\${url}\\x1B]8;;\\x1B\\\\\\x1B[22m`;\n return url;\n}, reset = function() {\n if (enableANSIColors)\n return \"\\x1B[49m\";\n return \"\";\n}, notify = function(unix) {\n Bun.connect({\n unix,\n socket: {\n open: (socket) => {\n socket.end(\"1\");\n },\n data: () => {\n }\n }\n }).finally(() => {\n });\n}, exit = function(...args) {\n console.error(...args), process.exit(1);\n}, $;\n$ = function(executionContextId, url, createBackend, send, close) {\n let debug;\n try {\n debug = new Debugger(executionContextId, url, createBackend, send, close);\n } catch (error) {\n exit(\"Failed to start inspector:\\n\", error);\n }\n const { protocol, href, host, pathname } = debug.url;\n if (!protocol.includes(\"unix\")) {\n if (console.log(dim(\"--------------------- Bun Inspector ---------------------\"), reset()), console.log(`Listening:\\n ${dim(href)}`), protocol.includes(\"ws\"))\n console.log(`Inspect in browser:\\n ${link(`https://debug.bun.sh/#${host}${pathname}`)}`);\n console.log(dim(\"--------------------- Bun Inspector ---------------------\"), reset());\n }\n const unix = process.env.BUN_INSPECT_NOTIFY;\n if (unix) {\n const { protocol: protocol2, pathname: pathname2 } = parseUrl(unix);\n if (protocol2 === \"unix:\")\n notify(pathname2);\n }\n};\n\nclass Debugger {\n #url;\n #createBackend;\n constructor(executionContextId, url, createBackend, send, close) {\n this.#url = parseUrl(url), this.#createBackend = (refEventLoop, receive) => {\n const backend = createBackend(executionContextId, refEventLoop, receive);\n return {\n write: (message) => {\n return send.@call(backend, message), !0;\n },\n close: () => close.@call(backend)\n };\n }, this.#listen();\n }\n get url() {\n return this.#url;\n }\n #listen() {\n const { protocol, hostname, port, pathname } = this.#url;\n if (protocol === \"ws:\" || protocol === \"ws+tcp:\") {\n const server = Bun.serve({\n hostname,\n port,\n fetch: this.#fetch.bind(this),\n websocket: this.#websocket\n });\n this.#url.hostname = server.hostname, this.#url.port = `${server.port}`;\n return;\n }\n if (protocol === \"ws+unix:\") {\n Bun.serve({\n unix: pathname,\n fetch: this.#fetch.bind(this),\n websocket: this.#websocket\n });\n return;\n }\n @throwTypeError(`Unsupported protocol: '${protocol}' (expected 'ws:', 'ws+unix:', or 'unix:')`);\n }\n get #websocket() {\n return {\n idleTimeout: 0,\n closeOnBackpressureLimit: !1,\n open: (ws) => this.#open(ws, webSocketWriter(ws)),\n message: (ws, message) => {\n if (typeof message === \"string\")\n this.#message(ws, message);\n else\n this.#error(ws, new Error(`Unexpected binary message: ${message.toString()}`));\n },\n drain: (ws) => this.#drain(ws),\n close: (ws) => this.#close(ws)\n };\n }\n #fetch(request, server) {\n const { method, url, headers } = request, { pathname } = new URL(url);\n if (method !== \"GET\")\n return new Response(null, {\n status: 405\n });\n switch (pathname) {\n case \"/json/version\":\n return Response.json(versionInfo());\n case \"/json\":\n case \"/json/list\":\n }\n if (!this.#url.protocol.includes(\"unix\") && this.#url.pathname !== pathname)\n return new Response(null, {\n status: 404\n });\n const data = {\n refEventLoop: headers.get(\"Ref-Event-Loop\") === \"0\"\n };\n if (!server.upgrade(request, { data }))\n return new Response(null, {\n status: 426,\n headers: {\n Upgrade: \"websocket\"\n }\n });\n }\n get #socket() {\n return {\n open: (socket) => this.#open(socket, socketWriter(socket)),\n data: (socket, message) => this.#message(socket, message.toString()),\n drain: (socket) => this.#drain(socket),\n close: (socket) => this.#close(socket),\n error: (socket, error) => this.#error(socket, error),\n connectError: (_, error) => exit(\"Failed to start inspector:\\n\", error)\n };\n }\n #open(connection, writer) {\n const { data } = connection, { refEventLoop } = data, client = bufferedWriter(writer), backend = this.#createBackend(refEventLoop, (...messages) => {\n for (let message of messages)\n client.write(message);\n });\n data.client = client, data.backend = backend;\n }\n #message(connection, message) {\n const { data } = connection, { backend } = data;\n backend\?.write(message);\n }\n #drain(connection) {\n const { data } = connection, { client } = data;\n client\?.drain\?.();\n }\n #close(connection) {\n const { data } = connection, { backend } = data;\n backend\?.close();\n }\n #error(connection, error) {\n const { data } = connection, { backend } = data;\n console.error(error), backend\?.close();\n }\n}\nvar defaultHostname = \"localhost\", defaultPort = 6499, { enableANSIColors } = Bun;\nreturn $})\n");
//
//
-static constexpr ASCIILiteral BunSqliteCode = "(function (){\"use strict\";// src/js/out/tmp/bun/sqlite.ts\nvar $, defineProperties = Object.defineProperties, toStringTag = Symbol.toStringTag, isArray = Array.isArray, isTypedArray = ArrayBuffer.isView, constants = {\n SQLITE_OPEN_READONLY: 1,\n SQLITE_OPEN_READWRITE: 2,\n SQLITE_OPEN_CREATE: 4,\n SQLITE_OPEN_DELETEONCLOSE: 8,\n SQLITE_OPEN_EXCLUSIVE: 16,\n SQLITE_OPEN_AUTOPROXY: 32,\n SQLITE_OPEN_URI: 64,\n SQLITE_OPEN_MEMORY: 128,\n SQLITE_OPEN_MAIN_DB: 256,\n SQLITE_OPEN_TEMP_DB: 512,\n SQLITE_OPEN_TRANSIENT_DB: 1024,\n SQLITE_OPEN_MAIN_JOURNAL: 2048,\n SQLITE_OPEN_TEMP_JOURNAL: 4096,\n SQLITE_OPEN_SUBJOURNAL: 8192,\n SQLITE_OPEN_SUPER_JOURNAL: 16384,\n SQLITE_OPEN_NOMUTEX: 32768,\n SQLITE_OPEN_FULLMUTEX: 65536,\n SQLITE_OPEN_SHAREDCACHE: 131072,\n SQLITE_OPEN_PRIVATECACHE: 262144,\n SQLITE_OPEN_WAL: 524288,\n SQLITE_OPEN_NOFOLLOW: 16777216,\n SQLITE_OPEN_EXRESCODE: 33554432,\n SQLITE_PREPARE_PERSISTENT: 1,\n SQLITE_PREPARE_NORMALIZE: 2,\n SQLITE_PREPARE_NO_VTAB: 4\n}, SQL, controllers;\n\nclass Statement {\n constructor(raw) {\n switch (this.#raw = raw, raw.paramsCount) {\n case 0: {\n this.get = this.#getNoArgs, this.all = this.#allNoArgs, this.values = this.#valuesNoArgs, this.run = this.#runNoArgs;\n break;\n }\n default: {\n this.get = this.#get, this.all = this.#all, this.values = this.#values, this.run = this.#run;\n break;\n }\n }\n }\n #raw;\n get;\n all;\n values;\n run;\n isFinalized = !1;\n toJSON() {\n return {\n sql: this.native.toString(),\n isFinalized: this.isFinalized,\n paramsCount: this.paramsCount,\n columnNames: this.columnNames\n };\n }\n get [toStringTag]() {\n return `\"${this.native.toString()}\"`;\n }\n toString() {\n return this.native.toString();\n }\n get native() {\n return this.#raw;\n }\n #getNoArgs() {\n return this.#raw.get();\n }\n #allNoArgs() {\n return this.#raw.all();\n }\n #valuesNoArgs() {\n return this.#raw.values();\n }\n #runNoArgs() {\n this.#raw.run();\n }\n #get(...args) {\n if (args.length === 0)\n return this.#getNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.get(args) : this.#raw.get(...args);\n }\n #all(...args) {\n if (args.length === 0)\n return this.#allNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.all(args) : this.#raw.all(...args);\n }\n #values(...args) {\n if (args.length === 0)\n return this.#valuesNoArgs();\n var arg0 = args[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.values(args) : this.#raw.values(...args);\n }\n #run(...args) {\n if (args.length === 0)\n return this.#runNoArgs();\n var arg0 = args[0];\n !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? this.#raw.run(args) : this.#raw.run(...args);\n }\n get columnNames() {\n return this.#raw.columns;\n }\n get paramsCount() {\n return this.#raw.paramsCount;\n }\n finalize(...args) {\n return this.isFinalized = !0, this.#raw.finalize(...args);\n }\n}\nvar cachedCount = Symbol.for(\"Bun.Database.cache.count\");\n\nclass Database {\n constructor(filenameGiven, options) {\n if (typeof filenameGiven === \"undefined\")\n ;\n else if (typeof filenameGiven !== \"string\") {\n if (isTypedArray(filenameGiven)) {\n this.#handle = Database.deserialize(filenameGiven, typeof options === \"object\" && options \? !!options.readonly : ((options | 0) & constants.SQLITE_OPEN_READONLY) != 0), this.filename = \":memory:\";\n return;\n }\n @throwTypeError(`Expected 'filename' to be a string, got '${typeof filenameGiven}'`);\n }\n var filename = typeof filenameGiven === \"string\" \? filenameGiven.trim() : \":memory:\", flags = constants.SQLITE_OPEN_READWRITE | constants.SQLITE_OPEN_CREATE;\n if (typeof options === \"object\" && options) {\n if (flags = 0, options.readonly)\n flags = constants.SQLITE_OPEN_READONLY;\n if (\"readOnly\" in options)\n @throwTypeError('Misspelled option \"readOnly\" should be \"readonly\"');\n if (options.create)\n flags = constants.SQLITE_OPEN_READWRITE | constants.SQLITE_OPEN_CREATE;\n if (options.readwrite)\n flags |= constants.SQLITE_OPEN_READWRITE;\n } else if (typeof options === \"number\")\n flags = options;\n const anonymous = filename === \"\" || filename === \":memory:\";\n if (anonymous && (flags & constants.SQLITE_OPEN_READONLY) !== 0)\n throw new Error(\"Cannot open an anonymous database in read-only mode.\");\n if (!SQL)\n SQL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"sqlite\");\n this.#handle = SQL.open(anonymous \? \":memory:\" : filename, flags), this.filename = filename;\n }\n #handle;\n #cachedQueriesKeys = [];\n #cachedQueriesLengths = [];\n #cachedQueriesValues = [];\n filename;\n get handle() {\n return this.#handle;\n }\n get inTransaction() {\n return SQL.isInTransaction(this.#handle);\n }\n static open(filename, options) {\n return new Database(filename, options);\n }\n loadExtension(name, entryPoint) {\n return SQL.loadExtension(this.#handle, name, entryPoint);\n }\n serialize(optionalName) {\n return SQL.serialize(this.#handle, optionalName || \"main\");\n }\n static deserialize(serialized, isReadOnly = !1) {\n if (!SQL)\n SQL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"sqlite\");\n return SQL.deserialize(serialized, isReadOnly);\n }\n static setCustomSQLite(path) {\n if (!SQL)\n SQL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"sqlite\");\n return SQL.setCustomSQLite(path);\n }\n close() {\n return this.clearQueryCache(), SQL.close(this.#handle);\n }\n clearQueryCache() {\n for (let item of this.#cachedQueriesValues)\n item.finalize();\n this.#cachedQueriesKeys.length = 0, this.#cachedQueriesValues.length = 0, this.#cachedQueriesLengths.length = 0;\n }\n run(query, ...params) {\n if (params.length === 0) {\n SQL.run(this.#handle, query);\n return;\n }\n var arg0 = params[0];\n return !isArray(arg0) && (!arg0 || typeof arg0 !== \"object\" || isTypedArray(arg0)) \? SQL.run(this.#handle, query, params) : SQL.run(this.#handle, query, ...params);\n }\n prepare(query, params, flags) {\n return new Statement(SQL.prepare(this.#handle, query, params, flags || 0));\n }\n static MAX_QUERY_CACHE_SIZE = 20;\n get [cachedCount]() {\n return this.#cachedQueriesKeys.length;\n }\n query(query) {\n if (typeof query !== \"string\")\n @throwTypeError(`Expected 'query' to be a string, got '${typeof query}'`);\n if (query.length === 0)\n throw new Error(\"SQL query cannot be empty.\");\n var index = this.#cachedQueriesLengths.indexOf(query.length);\n while (index !== -1) {\n if (this.#cachedQueriesKeys[index] !== query) {\n index = this.#cachedQueriesLengths.indexOf(query.length, index + 1);\n continue;\n }\n var stmt = this.#cachedQueriesValues[index];\n if (stmt.isFinalized)\n return this.#cachedQueriesValues[index] = this.prepare(query, void 0, willCache \? constants.SQLITE_PREPARE_PERSISTENT : 0);\n return stmt;\n }\n const willCache = this.#cachedQueriesKeys.length < Database.MAX_QUERY_CACHE_SIZE;\n var stmt = this.prepare(query, void 0, willCache \? constants.SQLITE_PREPARE_PERSISTENT : 0);\n if (willCache)\n this.#cachedQueriesKeys.push(query), this.#cachedQueriesLengths.push(query.length), this.#cachedQueriesValues.push(stmt);\n return stmt;\n }\n transaction(fn, self) {\n if (typeof fn !== \"function\")\n @throwTypeError(\"Expected first argument to be a function\");\n const db = this, controller = getController(db, self), properties = {\n default: { value: wrapTransaction(fn, db, controller.default) },\n deferred: { value: wrapTransaction(fn, db, controller.deferred) },\n immediate: {\n value: wrapTransaction(fn, db, controller.immediate)\n },\n exclusive: {\n value: wrapTransaction(fn, db, controller.exclusive)\n },\n database: { value: this, enumerable: !0 }\n };\n return defineProperties(properties.default.value, properties), defineProperties(properties.deferred.value, properties), defineProperties(properties.immediate.value, properties), defineProperties(properties.exclusive.value, properties), properties.default.value;\n }\n}\nDatabase.prototype.exec = Database.prototype.run;\nvar getController = (db, self) => {\n let controller = (controllers ||= new WeakMap).get(db);\n if (!controller) {\n const shared = {\n commit: db.prepare(\"COMMIT\", void 0, 0),\n rollback: db.prepare(\"ROLLBACK\", void 0, 0),\n savepoint: db.prepare(\"SAVEPOINT `\\t_bs3.\\t`\", void 0, 0),\n release: db.prepare(\"RELEASE `\\t_bs3.\\t`\", void 0, 0),\n rollbackTo: db.prepare(\"ROLLBACK TO `\\t_bs3.\\t`\", void 0, 0)\n };\n controllers.set(db, controller = {\n default: Object.assign({ begin: db.prepare(\"BEGIN\", void 0, 0) }, shared),\n deferred: Object.assign({ begin: db.prepare(\"BEGIN DEFERRED\", void 0, 0) }, shared),\n immediate: Object.assign({ begin: db.prepare(\"BEGIN IMMEDIATE\", void 0, 0) }, shared),\n exclusive: Object.assign({ begin: db.prepare(\"BEGIN EXCLUSIVE\", void 0, 0) }, shared)\n });\n }\n return controller;\n}, wrapTransaction = (fn, db, { begin, commit, rollback, savepoint, release, rollbackTo }) => function transaction(...args) {\n let before, after, undo;\n if (db.inTransaction)\n before = savepoint, after = release, undo = rollbackTo;\n else\n before = begin, after = commit, undo = rollback;\n try {\n before.run();\n const result = fn.apply(this, args);\n return after.run(), result;\n } catch (ex) {\n if (db.inTransaction) {\n if (undo.run(), undo !== rollback)\n after.run();\n }\n throw ex;\n }\n};\n$ = {\n __esModule: !0,\n Database,\n Statement,\n constants,\n default: Database\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral InternalFSCpSyncCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/fs/cp-sync.ts\nvar areIdentical = function(srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;\n}, isSrcSubdir = function(src, dest) {\n const srcArr = normalizePathToArray(src), destArr = normalizePathToArray(dest);\n return ArrayPrototypeEvery.@call(srcArr, (cur, i) => destArr[i] === cur);\n}, cpSyncFn = function(src, dest, opts) {\n const { srcStat, destStat, skipped } = checkPathsSync(src, dest, opts);\n if (skipped)\n return;\n return checkParentPathsSync(src, srcStat, dest), checkParentDir(destStat, src, dest, opts);\n}, checkPathsSync = function(src, dest, opts) {\n if (opts.filter) {\n const shouldCopy = opts.filter(src, dest);\n if (isPromise(shouldCopy))\n throw new Error(\"Expected a boolean from the filter function, but got a promise. Use `fs.promises.cp` instead.\");\n if (!shouldCopy)\n return { __proto__: null, skipped: !0 };\n }\n const { srcStat, destStat } = getStatsSync(src, dest, opts);\n if (destStat) {\n if (areIdentical(srcStat, destStat))\n throw new Error(\"src and dest cannot be the same\");\n if (srcStat.isDirectory() && !destStat.isDirectory())\n throw new Error(`cannot overwrite directory ${src} with non-directory ${dest}`);\n if (!srcStat.isDirectory() && destStat.isDirectory())\n throw new Error(`cannot overwrite non-directory ${src} with directory ${dest}`);\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return { __proto__: null, srcStat, destStat, skipped: !1 };\n}, getStatsSync = function(src, dest, opts) {\n let destStat;\n const statFunc = opts.dereference \? (file) => statSync(file, { bigint: !0 }) : (file) => lstatSync(file, { bigint: !0 }), srcStat = statFunc(src);\n try {\n destStat = statFunc(dest);\n } catch (err) {\n if (err.code === \"ENOENT\")\n return { srcStat, destStat: null };\n throw err;\n }\n return { srcStat, destStat };\n}, checkParentPathsSync = function(src, srcStat, dest) {\n const srcParent = resolve(dirname(src)), destParent = resolve(dirname(dest));\n if (destParent === srcParent || destParent === parse(destParent).root)\n return;\n let destStat;\n try {\n destStat = statSync(destParent, { bigint: !0 });\n } catch (err) {\n if (err.code === \"ENOENT\")\n return;\n throw err;\n }\n if (areIdentical(srcStat, destStat))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return checkParentPathsSync(src, srcStat, destParent);\n}, checkParentDir = function(destStat, src, dest, opts) {\n const destParent = dirname(dest);\n if (!existsSync(destParent))\n mkdirSync(destParent, { recursive: !0 });\n return getStats(destStat, src, dest, opts);\n}, getStats = function(destStat, src, dest, opts) {\n const srcStat = (opts.dereference \? statSync : lstatSync)(src);\n if (srcStat.isDirectory() && opts.recursive)\n return onDir(srcStat, destStat, src, dest, opts);\n else if (srcStat.isDirectory())\n throw new Error(`${src} is a directory (not copied)`);\n else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())\n return onFile(srcStat, destStat, src, dest, opts);\n else if (srcStat.isSymbolicLink())\n return onLink(destStat, src, dest, opts);\n else if (srcStat.isSocket())\n throw new Error(`cannot copy a socket file: ${dest}`);\n else if (srcStat.isFIFO())\n throw new Error(`cannot copy a FIFO pipe: ${dest}`);\n throw new Error(`cannot copy an unknown file type: ${dest}`);\n}, onFile = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return copyFile(srcStat, src, dest, opts);\n return mayCopyFile(srcStat, src, dest, opts);\n}, mayCopyFile = function(srcStat, src, dest, opts) {\n if (opts.force)\n return unlinkSync(dest), copyFile(srcStat, src, dest, opts);\n else if (opts.errorOnExist)\n throw new Error(`${dest} already exists`);\n}, copyFile = function(srcStat, src, dest, opts) {\n if (copyFileSync(src, dest, opts.mode), opts.preserveTimestamps)\n handleTimestamps(srcStat.mode, src, dest);\n return setDestMode(dest, srcStat.mode);\n}, handleTimestamps = function(srcMode, src, dest) {\n if (fileIsNotWritable(srcMode))\n makeFileWritable(dest, srcMode);\n return setDestTimestamps(src, dest);\n}, fileIsNotWritable = function(srcMode) {\n return (srcMode & 128) === 0;\n}, makeFileWritable = function(dest, srcMode) {\n return setDestMode(dest, srcMode | 128);\n}, setDestMode = function(dest, srcMode) {\n return chmodSync(dest, srcMode);\n}, setDestTimestamps = function(src, dest) {\n const updatedSrcStat = statSync(src);\n return utimesSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\n}, onDir = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return mkDirAndCopy(srcStat.mode, src, dest, opts);\n return copyDir(src, dest, opts);\n}, mkDirAndCopy = function(srcMode, src, dest, opts) {\n return mkdirSync(dest), copyDir(src, dest, opts), setDestMode(dest, srcMode);\n}, copyDir = function(src, dest, opts) {\n for (let dirent of readdirSync(src, { withFileTypes: !0 })) {\n const { name } = dirent, srcItem = join(src, name), destItem = join(dest, name), { destStat, skipped } = checkPathsSync(srcItem, destItem, opts);\n if (!skipped)\n getStats(destStat, srcItem, destItem, opts);\n }\n}, onLink = function(destStat, src, dest, opts) {\n let resolvedSrc = readlinkSync(src);\n if (!opts.verbatimSymlinks && !isAbsolute(resolvedSrc))\n resolvedSrc = resolve(dirname(src), resolvedSrc);\n if (!destStat)\n return symlinkSync(resolvedSrc, dest);\n let resolvedDest;\n try {\n resolvedDest = readlinkSync(dest);\n } catch (err) {\n if (err.code === \"EINVAL\" || err.code === \"UNKNOWN\")\n return symlinkSync(resolvedSrc, dest);\n throw err;\n }\n if (!isAbsolute(resolvedDest))\n resolvedDest = resolve(dirname(dest), resolvedDest);\n if (isSrcSubdir(resolvedSrc, resolvedDest))\n throw new Error(`cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`);\n if (statSync(dest).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc))\n throw new Error(`cannot overwrite ${resolvedDest} with ${resolvedSrc}`);\n return copyLink(resolvedSrc, dest);\n}, copyLink = function(resolvedSrc, dest) {\n return unlinkSync(dest), symlinkSync(resolvedSrc, dest);\n}, ArrayPrototypeEvery = @Array.prototype.every, ArrayPrototypeFilter = @Array.prototype.filter, StringPrototypeSplit = @String.prototype.split, normalizePathToArray = (path) => ArrayPrototypeFilter.@call(StringPrototypeSplit.@call(resolve(path), sep), Boolean), {\n chmodSync,\n copyFileSync,\n existsSync,\n lstatSync,\n mkdirSync,\n readdirSync,\n readlinkSync,\n statSync,\n symlinkSync,\n unlinkSync,\n utimesSync\n} = @getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21), { dirname, isAbsolute, join, parse, resolve, sep } = @getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30), { isPromise } = @requireNativeModule(\"util/types\");\nreturn cpSyncFn})\n");
//
//
-static constexpr ASCIILiteral InternalDebuggerCode = "(function (){\"use strict\";// src/js/out/tmp/internal/debugger.ts\nvar versionInfo = function() {\n return {\n \"Protocol-Version\": \"1.3\",\n Browser: \"Bun\",\n \"User-Agent\": navigator.userAgent,\n \"WebKit-Version\": process.versions.webkit,\n \"Bun-Version\": Bun.version,\n \"Bun-Revision\": Bun.revision\n };\n}, webSocketWriter = function(ws) {\n return {\n write: (message) => !!ws.sendText(message),\n close: () => ws.close()\n };\n}, socketWriter = function(socket) {\n return {\n write: (message) => !!socket.write(message),\n close: () => socket.end()\n };\n}, bufferedWriter = function(writer) {\n let draining = !1, pendingMessages = [];\n return {\n write: (message) => {\n if (draining || !writer.write(message))\n pendingMessages.push(message);\n return !0;\n },\n drain: () => {\n draining = !0;\n try {\n for (let i = 0;i < pendingMessages.length; i++)\n if (!writer.write(pendingMessages[i])) {\n pendingMessages = pendingMessages.slice(i);\n return;\n }\n } finally {\n draining = !1;\n }\n },\n close: () => {\n writer.close(), pendingMessages.length = 0;\n }\n };\n}, parseUrl = function(url) {\n try {\n if (!url)\n return new URL(randomId(), `ws://${defaultHostname}:${defaultPort}/`);\n else if (url.startsWith(\"/\"))\n return new URL(url, `ws://${defaultHostname}:${defaultPort}/`);\n else if (/^[a-z+]+:\\/\\//i.test(url))\n return new URL(url);\n else if (/^\\d+$/.test(url))\n return new URL(randomId(), `ws://${defaultHostname}:${url}/`);\n else if (!url.includes(\"/\") && url.includes(\":\"))\n return new URL(randomId(), `ws://${url}/`);\n else if (!url.includes(\":\")) {\n const [hostname, pathname] = url.split(\"/\", 2);\n return new URL(`ws://${hostname}:${defaultPort}/${pathname}`);\n } else\n return new URL(randomId(), `ws://${url}`);\n } catch {\n @throwTypeError(`Invalid hostname or URL: '${url}'`);\n }\n}, randomId = function() {\n return Math.random().toString(36).slice(2);\n}, dim = function(string) {\n if (enableANSIColors)\n return `\\x1B[2m${string}\\x1B[22m`;\n return string;\n}, link = function(url) {\n if (enableANSIColors)\n return `\\x1B[1m\\x1B]8;;${url}\\x1B\\\\${url}\\x1B]8;;\\x1B\\\\\\x1B[22m`;\n return url;\n}, reset = function() {\n if (enableANSIColors)\n return \"\\x1B[49m\";\n return \"\";\n}, notify = function(unix) {\n Bun.connect({\n unix,\n socket: {\n open: (socket) => {\n socket.end(\"1\");\n },\n data: () => {\n }\n }\n }).finally(() => {\n });\n}, exit = function(...args) {\n console.error(...args), process.exit(1);\n}, $;\n$ = function(executionContextId, url, createBackend, send, close) {\n let debug;\n try {\n debug = new Debugger(executionContextId, url, createBackend, send, close);\n } catch (error) {\n exit(\"Failed to start inspector:\\n\", error);\n }\n const { protocol, href, host, pathname } = debug.url;\n if (!protocol.includes(\"unix\")) {\n if (console.log(dim(\"--------------------- Bun Inspector ---------------------\"), reset()), console.log(`Listening:\\n ${dim(href)}`), protocol.includes(\"ws\"))\n console.log(`Inspect in browser:\\n ${link(`https://debug.bun.sh/#${host}${pathname}`)}`);\n console.log(dim(\"--------------------- Bun Inspector ---------------------\"), reset());\n }\n const unix = process.env.BUN_INSPECT_NOTIFY;\n if (unix) {\n const { protocol: protocol2, pathname: pathname2 } = parseUrl(unix);\n if (protocol2 === \"unix:\")\n notify(pathname2);\n }\n};\n\nclass Debugger {\n #url;\n #createBackend;\n constructor(executionContextId, url, createBackend, send, close) {\n this.#url = parseUrl(url), this.#createBackend = (refEventLoop, receive) => {\n const backend = createBackend(executionContextId, refEventLoop, receive);\n return {\n write: (message) => {\n return send.call(backend, message), !0;\n },\n close: () => close.call(backend)\n };\n }, this.#listen();\n }\n get url() {\n return this.#url;\n }\n #listen() {\n const { protocol, hostname, port, pathname } = this.#url;\n if (protocol === \"ws:\" || protocol === \"ws+tcp:\") {\n const server = Bun.serve({\n hostname,\n port,\n fetch: this.#fetch.bind(this),\n websocket: this.#websocket\n });\n this.#url.hostname = server.hostname, this.#url.port = `${server.port}`;\n return;\n }\n if (protocol === \"ws+unix:\") {\n Bun.serve({\n unix: pathname,\n fetch: this.#fetch.bind(this),\n websocket: this.#websocket\n });\n return;\n }\n @throwTypeError(`Unsupported protocol: '${protocol}' (expected 'ws:', 'ws+unix:', or 'unix:')`);\n }\n get #websocket() {\n return {\n idleTimeout: 0,\n closeOnBackpressureLimit: !1,\n open: (ws) => this.#open(ws, webSocketWriter(ws)),\n message: (ws, message) => {\n if (typeof message === \"string\")\n this.#message(ws, message);\n else\n this.#error(ws, new Error(`Unexpected binary message: ${message.toString()}`));\n },\n drain: (ws) => this.#drain(ws),\n close: (ws) => this.#close(ws)\n };\n }\n #fetch(request, server) {\n const { method, url, headers } = request, { pathname } = new URL(url);\n if (method !== \"GET\")\n return new Response(null, {\n status: 405\n });\n switch (pathname) {\n case \"/json/version\":\n return Response.json(versionInfo());\n case \"/json\":\n case \"/json/list\":\n }\n if (!this.#url.protocol.includes(\"unix\") && this.#url.pathname !== pathname)\n return new Response(null, {\n status: 404\n });\n const data = {\n refEventLoop: headers.get(\"Ref-Event-Loop\") === \"0\"\n };\n if (!server.upgrade(request, { data }))\n return new Response(null, {\n status: 426,\n headers: {\n Upgrade: \"websocket\"\n }\n });\n }\n get #socket() {\n return {\n open: (socket) => this.#open(socket, socketWriter(socket)),\n data: (socket, message) => this.#message(socket, message.toString()),\n drain: (socket) => this.#drain(socket),\n close: (socket) => this.#close(socket),\n error: (socket, error) => this.#error(socket, error),\n connectError: (_, error) => exit(\"Failed to start inspector:\\n\", error)\n };\n }\n #open(connection, writer) {\n const { data } = connection, { refEventLoop } = data, client = bufferedWriter(writer), backend = this.#createBackend(refEventLoop, (...messages) => {\n for (let message of messages)\n client.write(message);\n });\n data.client = client, data.backend = backend;\n }\n #message(connection, message) {\n const { data } = connection, { backend } = data;\n backend\?.write(message);\n }\n #drain(connection) {\n const { data } = connection, { client } = data;\n client\?.drain\?.();\n }\n #close(connection) {\n const { data } = connection, { backend } = data;\n backend\?.close();\n }\n #error(connection, error) {\n const { data } = connection, { backend } = data;\n console.error(error), backend\?.close();\n }\n}\nvar defaultHostname = \"localhost\", defaultPort = 6499, { enableANSIColors } = Bun;\nreturn $})\n"_s;
+static constexpr ASCIILiteral InternalFSCpCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/fs/cp.ts\nasync function cpFn(src, dest, opts) {\n const stats = await checkPaths(src, dest, opts), { srcStat, destStat, skipped } = stats;\n if (skipped)\n return;\n return await checkParentPaths(src, srcStat, dest), checkParentDir(destStat, src, dest, opts);\n}\nasync function checkPaths(src, dest, opts) {\n if (opts.filter && !await opts.filter(src, dest))\n return { __proto__: null, skipped: !0 };\n const { 0: srcStat, 1: destStat } = await getStats(src, dest, opts);\n if (destStat) {\n if (areIdentical(srcStat, destStat))\n throw new Error(\"Source and destination must not be the same.\");\n if (srcStat.isDirectory() && !destStat.isDirectory())\n throw new Error(`cannot overwrite directory ${src} with non-directory ${dest}`);\n if (!srcStat.isDirectory() && destStat.isDirectory())\n throw new Error(`cannot overwrite non-directory ${src} with directory ${dest}`);\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return { __proto__: null, srcStat, destStat, skipped: !1 };\n}\nvar areIdentical = function(srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;\n}, getStats = function(src, dest, opts) {\n const statFunc = opts.dereference \? (file) => stat(file, { bigint: !0 }) : (file) => lstat(file, { bigint: !0 });\n return SafePromiseAll([\n statFunc(src),\n PromisePrototypeThen.@call(statFunc(dest), @undefined, (err) => {\n if (err.code === \"ENOENT\")\n return null;\n throw err;\n })\n ]);\n};\nasync function checkParentDir(destStat, src, dest, opts) {\n const destParent = dirname(dest);\n if (await pathExists(destParent))\n return getStatsForCopy(destStat, src, dest, opts);\n return await mkdir(destParent, { recursive: !0 }), getStatsForCopy(destStat, src, dest, opts);\n}\nvar pathExists = function(dest) {\n return PromisePrototypeThen(stat(dest), () => !0, (err) => err.code === \"ENOENT\" \? !1 : PromiseReject(err));\n};\nasync function checkParentPaths(src, srcStat, dest) {\n const srcParent = resolve(dirname(src)), destParent = resolve(dirname(dest));\n if (destParent === srcParent || destParent === parse(destParent).root)\n return;\n let destStat;\n try {\n destStat = await stat(destParent, { bigint: !0 });\n } catch (err) {\n if (err.code === \"ENOENT\")\n return;\n throw err;\n }\n if (areIdentical(srcStat, destStat))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return checkParentPaths(src, srcStat, destParent);\n}\nvar isSrcSubdir = function(src, dest) {\n const srcArr = normalizePathToArray(src), destArr = normalizePathToArray(dest);\n return ArrayPrototypeEvery.@call(srcArr, (cur, i) => destArr[i] === cur);\n};\nasync function getStatsForCopy(destStat, src, dest, opts) {\n const srcStat = await (opts.dereference \? stat : lstat)(src);\n if (srcStat.isDirectory() && opts.recursive)\n return onDir(srcStat, destStat, src, dest, opts);\n else if (srcStat.isDirectory())\n throw new Error(`${src} is a directory (not copied)`);\n else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())\n return onFile(srcStat, destStat, src, dest, opts);\n else if (srcStat.isSymbolicLink())\n return onLink(destStat, src, dest, opts);\n else if (srcStat.isSocket())\n throw new Error(`cannot copy a socket file: ${dest}`);\n else if (srcStat.isFIFO())\n throw new Error(`cannot copy a FIFO pipe: ${dest}`);\n throw new Error(`cannot copy an unknown file type: ${dest}`);\n}\nvar onFile = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return _copyFile(srcStat, src, dest, opts);\n return mayCopyFile(srcStat, src, dest, opts);\n};\nasync function mayCopyFile(srcStat, src, dest, opts) {\n if (opts.force)\n return await unlink(dest), _copyFile(srcStat, src, dest, opts);\n else if (opts.errorOnExist)\n throw new Error(`${dest} already exists`);\n}\nasync function _copyFile(srcStat, src, dest, opts) {\n if (await copyFile(src, dest, opts.mode), opts.preserveTimestamps)\n return handleTimestampsAndMode(srcStat.mode, src, dest);\n return setDestMode(dest, srcStat.mode);\n}\nasync function handleTimestampsAndMode(srcMode, src, dest) {\n if (fileIsNotWritable(srcMode))\n return await makeFileWritable(dest, srcMode), setDestTimestampsAndMode(srcMode, src, dest);\n return setDestTimestampsAndMode(srcMode, src, dest);\n}\nvar fileIsNotWritable = function(srcMode) {\n return (srcMode & 128) === 0;\n}, makeFileWritable = function(dest, srcMode) {\n return setDestMode(dest, srcMode | 128);\n};\nasync function setDestTimestampsAndMode(srcMode, src, dest) {\n return await setDestTimestamps(src, dest), setDestMode(dest, srcMode);\n}\nvar setDestMode = function(dest, srcMode) {\n return chmod(dest, srcMode);\n};\nasync function setDestTimestamps(src, dest) {\n const updatedSrcStat = await stat(src);\n return utimes(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\n}\nvar onDir = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return mkDirAndCopy(srcStat.mode, src, dest, opts);\n return copyDir(src, dest, opts);\n};\nasync function mkDirAndCopy(srcMode, src, dest, opts) {\n return await mkdir(dest), await copyDir(src, dest, opts), setDestMode(dest, srcMode);\n}\nasync function copyDir(src, dest, opts) {\n const dir = await opendir(src);\n for await (let { name } of dir) {\n const srcItem = join(src, name), destItem = join(dest, name), { destStat, skipped } = await checkPaths(srcItem, destItem, opts);\n if (!skipped)\n await getStatsForCopy(destStat, srcItem, destItem, opts);\n }\n}\nasync function onLink(destStat, src, dest, opts) {\n let resolvedSrc = await readlink(src);\n if (!opts.verbatimSymlinks && !isAbsolute(resolvedSrc))\n resolvedSrc = resolve(dirname(src), resolvedSrc);\n if (!destStat)\n return symlink(resolvedSrc, dest);\n let resolvedDest;\n try {\n resolvedDest = await readlink(dest);\n } catch (err) {\n if (err.code === \"EINVAL\" || err.code === \"UNKNOWN\")\n return symlink(resolvedSrc, dest);\n throw err;\n }\n if (!isAbsolute(resolvedDest))\n resolvedDest = resolve(dirname(dest), resolvedDest);\n if (isSrcSubdir(resolvedSrc, resolvedDest))\n throw new Error(`cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`);\n if ((await stat(src)).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc))\n throw new Error(`cannot overwrite ${resolvedDest} with ${resolvedSrc}`);\n return copyLink(resolvedSrc, dest);\n}\nasync function copyLink(resolvedSrc, dest) {\n return await unlink(dest), symlink(resolvedSrc, dest);\n}\nvar { chmod, copyFile, lstat, mkdir, opendir, readlink, stat, symlink, unlink, utimes } = @getInternalField(@internalModuleRegistry, 22) || @createInternalModuleById(22), { dirname, isAbsolute, join, parse, resolve, sep } = @getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30), SafePromiseAll = @Promise.all, PromisePrototypeThen = @Promise.prototype.then, PromiseReject = @Promise.reject, ArrayPrototypeFilter = @Array.prototype.filter, StringPrototypeSplit = @String.prototype.split, ArrayPrototypeEvery = @Array.prototype.every, normalizePathToArray = (path) => ArrayPrototypeFilter.@call(StringPrototypeSplit(resolve(path), sep), Boolean);\nreturn cpFn})\n");
//
//
-static constexpr ASCIILiteral InternalFSCpSyncCode = "(function (){\"use strict\";// src/js/out/tmp/internal/fs/cp-sync.ts\nvar areIdentical = function(srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;\n}, isSrcSubdir = function(src, dest) {\n const srcArr = normalizePathToArray(src), destArr = normalizePathToArray(dest);\n return ArrayPrototypeEvery.@call(srcArr, (cur, i) => destArr[i] === cur);\n}, cpSyncFn = function(src, dest, opts) {\n const { srcStat, destStat, skipped } = checkPathsSync(src, dest, opts);\n if (skipped)\n return;\n return checkParentPathsSync(src, srcStat, dest), checkParentDir(destStat, src, dest, opts);\n}, checkPathsSync = function(src, dest, opts) {\n if (opts.filter) {\n const shouldCopy = opts.filter(src, dest);\n if (isPromise(shouldCopy))\n throw new Error(\"Expected a boolean from the filter function, but got a promise. Use `fs.promises.cp` instead.\");\n if (!shouldCopy)\n return { __proto__: null, skipped: !0 };\n }\n const { srcStat, destStat } = getStatsSync(src, dest, opts);\n if (destStat) {\n if (areIdentical(srcStat, destStat))\n throw new Error(\"src and dest cannot be the same\");\n if (srcStat.isDirectory() && !destStat.isDirectory())\n throw new Error(`cannot overwrite directory ${src} with non-directory ${dest}`);\n if (!srcStat.isDirectory() && destStat.isDirectory())\n throw new Error(`cannot overwrite non-directory ${src} with directory ${dest}`);\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return { __proto__: null, srcStat, destStat, skipped: !1 };\n}, getStatsSync = function(src, dest, opts) {\n let destStat;\n const statFunc = opts.dereference \? (file) => statSync(file, { bigint: !0 }) : (file) => lstatSync(file, { bigint: !0 }), srcStat = statFunc(src);\n try {\n destStat = statFunc(dest);\n } catch (err) {\n if (err.code === \"ENOENT\")\n return { srcStat, destStat: null };\n throw err;\n }\n return { srcStat, destStat };\n}, checkParentPathsSync = function(src, srcStat, dest) {\n const srcParent = resolve(dirname(src)), destParent = resolve(dirname(dest));\n if (destParent === srcParent || destParent === parse(destParent).root)\n return;\n let destStat;\n try {\n destStat = statSync(destParent, { bigint: !0 });\n } catch (err) {\n if (err.code === \"ENOENT\")\n return;\n throw err;\n }\n if (areIdentical(srcStat, destStat))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return checkParentPathsSync(src, srcStat, destParent);\n}, checkParentDir = function(destStat, src, dest, opts) {\n const destParent = dirname(dest);\n if (!existsSync(destParent))\n mkdirSync(destParent, { recursive: !0 });\n return getStats(destStat, src, dest, opts);\n}, getStats = function(destStat, src, dest, opts) {\n const srcStat = (opts.dereference \? statSync : lstatSync)(src);\n if (srcStat.isDirectory() && opts.recursive)\n return onDir(srcStat, destStat, src, dest, opts);\n else if (srcStat.isDirectory())\n throw new Error(`${src} is a directory (not copied)`);\n else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())\n return onFile(srcStat, destStat, src, dest, opts);\n else if (srcStat.isSymbolicLink())\n return onLink(destStat, src, dest, opts);\n else if (srcStat.isSocket())\n throw new Error(`cannot copy a socket file: ${dest}`);\n else if (srcStat.isFIFO())\n throw new Error(`cannot copy a FIFO pipe: ${dest}`);\n throw new Error(`cannot copy an unknown file type: ${dest}`);\n}, onFile = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return copyFile(srcStat, src, dest, opts);\n return mayCopyFile(srcStat, src, dest, opts);\n}, mayCopyFile = function(srcStat, src, dest, opts) {\n if (opts.force)\n return unlinkSync(dest), copyFile(srcStat, src, dest, opts);\n else if (opts.errorOnExist)\n throw new Error(`${dest} already exists`);\n}, copyFile = function(srcStat, src, dest, opts) {\n if (copyFileSync(src, dest, opts.mode), opts.preserveTimestamps)\n handleTimestamps(srcStat.mode, src, dest);\n return setDestMode(dest, srcStat.mode);\n}, handleTimestamps = function(srcMode, src, dest) {\n if (fileIsNotWritable(srcMode))\n makeFileWritable(dest, srcMode);\n return setDestTimestamps(src, dest);\n}, fileIsNotWritable = function(srcMode) {\n return (srcMode & 128) === 0;\n}, makeFileWritable = function(dest, srcMode) {\n return setDestMode(dest, srcMode | 128);\n}, setDestMode = function(dest, srcMode) {\n return chmodSync(dest, srcMode);\n}, setDestTimestamps = function(src, dest) {\n const updatedSrcStat = statSync(src);\n return utimesSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\n}, onDir = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return mkDirAndCopy(srcStat.mode, src, dest, opts);\n return copyDir(src, dest, opts);\n}, mkDirAndCopy = function(srcMode, src, dest, opts) {\n return mkdirSync(dest), copyDir(src, dest, opts), setDestMode(dest, srcMode);\n}, copyDir = function(src, dest, opts) {\n for (let dirent of readdirSync(src, { withFileTypes: !0 })) {\n const { name } = dirent, srcItem = join(src, name), destItem = join(dest, name), { destStat, skipped } = checkPathsSync(srcItem, destItem, opts);\n if (!skipped)\n getStats(destStat, srcItem, destItem, opts);\n }\n}, onLink = function(destStat, src, dest, opts) {\n let resolvedSrc = readlinkSync(src);\n if (!opts.verbatimSymlinks && !isAbsolute(resolvedSrc))\n resolvedSrc = resolve(dirname(src), resolvedSrc);\n if (!destStat)\n return symlinkSync(resolvedSrc, dest);\n let resolvedDest;\n try {\n resolvedDest = readlinkSync(dest);\n } catch (err) {\n if (err.code === \"EINVAL\" || err.code === \"UNKNOWN\")\n return symlinkSync(resolvedSrc, dest);\n throw err;\n }\n if (!isAbsolute(resolvedDest))\n resolvedDest = resolve(dirname(dest), resolvedDest);\n if (isSrcSubdir(resolvedSrc, resolvedDest))\n throw new Error(`cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`);\n if (statSync(dest).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc))\n throw new Error(`cannot overwrite ${resolvedDest} with ${resolvedSrc}`);\n return copyLink(resolvedSrc, dest);\n}, copyLink = function(resolvedSrc, dest) {\n return unlinkSync(dest), symlinkSync(resolvedSrc, dest);\n}, ArrayPrototypeEvery = Array.prototype.every, ArrayPrototypeFilter = Array.prototype.filter, StringPrototypeSplit = String.prototype.split, normalizePathToArray = (path) => ArrayPrototypeFilter.@call(StringPrototypeSplit.@call(resolve(path), sep), Boolean), {\n chmodSync,\n copyFileSync,\n existsSync,\n lstatSync,\n mkdirSync,\n readdirSync,\n readlinkSync,\n statSync,\n symlinkSync,\n unlinkSync,\n utimesSync\n} = @getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19), { dirname, isAbsolute, join, parse, resolve, sep } = @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28), { isPromise } = @requireNativeModule(\"util/types\");\nreturn cpSyncFn})\n"_s;
+static constexpr ASCIILiteral InternalPrimordialsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/primordials.ts\nvar getGetter = function(cls, getter) {\n return FunctionPrototypeCall.bind(cls.prototype.__lookupGetter__(getter));\n}, uncurryThis = function(func) {\n return FunctionPrototypeCall.bind(func);\n}, ErrorCaptureStackTrace = function(targetObject) {\n const stack = new Error().stack;\n targetObject.stack = stack.replace(/.*\\n.*/, \"$1\");\n}, $, createSafeIterator = (factory, next) => {\n\n class SafeIterator {\n constructor(iterable) {\n this._iterator = factory(iterable);\n }\n next() {\n return next(this._iterator);\n }\n [Symbol.iterator]() {\n return this;\n }\n }\n return Object.setPrototypeOf(SafeIterator.prototype, null), Object.freeze(SafeIterator.prototype), Object.freeze(SafeIterator), SafeIterator;\n}, FunctionPrototypeCall = @getByIdDirect(Function.prototype, \"call\"), copyProps = (src, dest) => {\n ArrayPrototypeForEach(Reflect.ownKeys(src), (key) => {\n if (!Reflect.getOwnPropertyDescriptor(dest, key))\n Reflect.defineProperty(dest, key, Reflect.getOwnPropertyDescriptor(src, key));\n });\n}, makeSafe = (unsafe, safe) => {\n if (Symbol.iterator in unsafe.prototype) {\n const dummy = new unsafe;\n let next;\n ArrayPrototypeForEach(Reflect.ownKeys(unsafe.prototype), (key) => {\n if (!Reflect.getOwnPropertyDescriptor(safe.prototype, key)) {\n const desc = Reflect.getOwnPropertyDescriptor(unsafe.prototype, key);\n if (typeof desc.value === \"function\" && desc.value.length === 0 && (Symbol.iterator in (desc.value.@call(dummy) || {}))) {\n const createIterator = uncurryThis(desc.value);\n next \?\?= uncurryThis(createIterator(dummy).next);\n const SafeIterator = createSafeIterator(createIterator, next);\n desc.value = function() {\n return new SafeIterator(this);\n };\n }\n Reflect.defineProperty(safe.prototype, key, desc);\n }\n });\n } else\n copyProps(unsafe.prototype, safe.prototype);\n return copyProps(unsafe, safe), Object.setPrototypeOf(safe.prototype, null), Object.freeze(safe.prototype), Object.freeze(safe), safe;\n}, StringIterator = uncurryThis(@String.prototype[Symbol.iterator]), StringIteratorPrototype = Reflect.getPrototypeOf(StringIterator(\"\")), ArrayPrototypeForEach = uncurryThis(@Array.prototype.forEach), arrayProtoPush = @Array.prototype.push;\n$ = {\n makeSafe,\n Array: @Array,\n ArrayFrom: @Array.from,\n ArrayIsArray: @Array.isArray,\n ArrayPrototypeFlat: uncurryThis(@Array.prototype.flat),\n ArrayPrototypeFilter: uncurryThis(@Array.prototype.filter),\n ArrayPrototypeForEach,\n ArrayPrototypeIncludes: uncurryThis(@Array.prototype.includes),\n ArrayPrototypeIndexOf: uncurryThis(@Array.prototype.indexOf),\n ArrayPrototypeJoin: uncurryThis(@Array.prototype.join),\n ArrayPrototypeMap: uncurryThis(@Array.prototype.map),\n ArrayPrototypePop: uncurryThis(@Array.prototype.pop),\n ArrayPrototypePush: uncurryThis(arrayProtoPush),\n ArrayPrototypePushApply: (a, b) => arrayProtoPush.@apply(a, b),\n ArrayPrototypeSlice: uncurryThis(@Array.prototype.slice),\n ArrayPrototypeSort: uncurryThis(@Array.prototype.sort),\n ArrayPrototypeSplice: uncurryThis(@Array.prototype.splice),\n ArrayPrototypeUnshift: uncurryThis(@Array.prototype.unshift),\n BigIntPrototypeValueOf: uncurryThis(BigInt.prototype.valueOf),\n BooleanPrototypeValueOf: uncurryThis(Boolean.prototype.valueOf),\n DatePrototypeGetTime: uncurryThis(Date.prototype.getTime),\n DatePrototypeToISOString: uncurryThis(Date.prototype.toISOString),\n DatePrototypeToString: uncurryThis(Date.prototype.toString),\n ErrorCaptureStackTrace,\n ErrorPrototypeToString: uncurryThis(Error.prototype.toString),\n FunctionPrototypeToString: uncurryThis(Function.prototype.toString),\n JSONStringify: JSON.stringify,\n MapPrototypeGetSize: getGetter(Map, \"size\"),\n MapPrototypeEntries: uncurryThis(Map.prototype.entries),\n MapPrototypeValues: uncurryThis(Map.prototype.values),\n MapPrototypeKeys: uncurryThis(Map.prototype.keys),\n MathFloor: Math.floor,\n MathMax: Math.max,\n MathMin: Math.min,\n MathRound: Math.round,\n MathSqrt: Math.sqrt,\n MathTrunc: Math.trunc,\n Number,\n NumberIsFinite: Number.isFinite,\n NumberIsNaN: Number.isNaN,\n NumberParseFloat: Number.parseFloat,\n NumberParseInt: Number.parseInt,\n NumberPrototypeToString: uncurryThis(Number.prototype.toString),\n NumberPrototypeValueOf: uncurryThis(Number.prototype.valueOf),\n Object,\n ObjectAssign: Object.assign,\n ObjectCreate: Object.create,\n ObjectDefineProperty: Object.defineProperty,\n ObjectEntries: Object.entries,\n ObjectGetOwnPropertyDescriptor: Object.getOwnPropertyDescriptor,\n ObjectGetOwnPropertyDescriptors: Object.getOwnPropertyDescriptors,\n ObjectGetOwnPropertyNames: Object.getOwnPropertyNames,\n ObjectGetOwnPropertySymbols: Object.getOwnPropertySymbols,\n ObjectGetPrototypeOf: Object.getPrototypeOf,\n ObjectIs: Object.is,\n ObjectKeys: Object.keys,\n ObjectPrototypeHasOwnProperty: uncurryThis(Object.prototype.hasOwnProperty),\n ObjectPrototypePropertyIsEnumerable: uncurryThis(Object.prototype.propertyIsEnumerable),\n ObjectPrototypeToString: uncurryThis(Object.prototype.toString),\n ObjectSeal: Object.seal,\n ObjectSetPrototypeOf: Object.setPrototypeOf,\n ReflectApply: @getByIdDirect(Reflect, \"apply\"),\n ReflectOwnKeys: Reflect.ownKeys,\n RegExp: @RegExp,\n RegExpPrototypeExec: uncurryThis(@RegExp.prototype.exec),\n RegExpPrototypeSymbolReplace: uncurryThis(@RegExp.prototype[Symbol.replace]),\n RegExpPrototypeSymbolSplit: uncurryThis(@RegExp.prototype[Symbol.split]),\n RegExpPrototypeTest: uncurryThis(@RegExp.prototype.test),\n RegExpPrototypeToString: uncurryThis(@RegExp.prototype.toString),\n SafeStringIterator: createSafeIterator(StringIterator, uncurryThis(StringIteratorPrototype.next)),\n SafeMap: makeSafe(Map, class SafeMap extends Map {\n constructor(i) {\n super(i);\n }\n }),\n SafeSet: makeSafe(Set, class SafeSet extends Set {\n constructor(i) {\n super(i);\n }\n }),\n SetPrototypeGetSize: getGetter(Set, \"size\"),\n SetPrototypeEntries: uncurryThis(Set.prototype.entries),\n SetPrototypeValues: uncurryThis(Set.prototype.values),\n String: @String,\n StringPrototypeCharCodeAt: uncurryThis(@String.prototype.charCodeAt),\n StringPrototypeCodePointAt: uncurryThis(@String.prototype.codePointAt),\n StringPrototypeEndsWith: uncurryThis(@String.prototype.endsWith),\n StringPrototypeIncludes: uncurryThis(@String.prototype.includes),\n StringPrototypeIndexOf: uncurryThis(@String.prototype.indexOf),\n StringPrototypeLastIndexOf: uncurryThis(@String.prototype.lastIndexOf),\n StringPrototypeMatch: uncurryThis(@String.prototype.match),\n StringPrototypeNormalize: uncurryThis(@String.prototype.normalize),\n StringPrototypePadEnd: uncurryThis(@String.prototype.padEnd),\n StringPrototypePadStart: uncurryThis(@String.prototype.padStart),\n StringPrototypeRepeat: uncurryThis(@String.prototype.repeat),\n StringPrototypeReplace: uncurryThis(@String.prototype.replace),\n StringPrototypeReplaceAll: uncurryThis(@String.prototype.replaceAll),\n StringPrototypeSlice: uncurryThis(@String.prototype.slice),\n StringPrototypeSplit: uncurryThis(@String.prototype.split),\n StringPrototypeStartsWith: uncurryThis(@String.prototype.startsWith),\n StringPrototypeToLowerCase: uncurryThis(@String.prototype.toLowerCase),\n StringPrototypeTrim: uncurryThis(@String.prototype.trim),\n StringPrototypeValueOf: uncurryThis(@String.prototype.valueOf),\n SymbolPrototypeToString: uncurryThis(Symbol.prototype.toString),\n SymbolPrototypeValueOf: uncurryThis(Symbol.prototype.valueOf),\n FunctionPrototypeToString: uncurryThis(Function.prototype.toString),\n FunctionPrototypeBind: uncurryThis(Function.prototype.bind),\n SymbolIterator: Symbol.iterator,\n SymbolFor: Symbol.for,\n SymbolToStringTag: Symbol.toStringTag,\n TypedArrayPrototypeGetLength: getGetter(@Uint8Array, \"length\"),\n TypedArrayPrototypeGetSymbolToStringTag: getGetter(@Uint8Array, Symbol.toStringTag),\n Uint8ClampedArray,\n Uint8Array: @Uint8Array,\n Uint16Array,\n Uint32Array,\n Int8Array,\n Int16Array,\n Int32Array,\n Float32Array,\n Float64Array,\n BigUint64Array,\n BigInt64Array,\n uncurryThis\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral InternalFSCpCode = "(function (){\"use strict\";// src/js/out/tmp/internal/fs/cp.ts\nasync function cpFn(src, dest, opts) {\n const stats = await checkPaths(src, dest, opts), { srcStat, destStat, skipped } = stats;\n if (skipped)\n return;\n return await checkParentPaths(src, srcStat, dest), checkParentDir(destStat, src, dest, opts);\n}\nasync function checkPaths(src, dest, opts) {\n if (opts.filter && !await opts.filter(src, dest))\n return { __proto__: null, skipped: !0 };\n const { 0: srcStat, 1: destStat } = await getStats(src, dest, opts);\n if (destStat) {\n if (areIdentical(srcStat, destStat))\n throw new Error(\"Source and destination must not be the same.\");\n if (srcStat.isDirectory() && !destStat.isDirectory())\n throw new Error(`cannot overwrite directory ${src} with non-directory ${dest}`);\n if (!srcStat.isDirectory() && destStat.isDirectory())\n throw new Error(`cannot overwrite non-directory ${src} with directory ${dest}`);\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return { __proto__: null, srcStat, destStat, skipped: !1 };\n}\nvar areIdentical = function(srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;\n}, getStats = function(src, dest, opts) {\n const statFunc = opts.dereference \? (file) => stat(file, { bigint: !0 }) : (file) => lstat(file, { bigint: !0 });\n return SafePromiseAll([\n statFunc(src),\n PromisePrototypeThen.@call(statFunc(dest), void 0, (err) => {\n if (err.code === \"ENOENT\")\n return null;\n throw err;\n })\n ]);\n};\nasync function checkParentDir(destStat, src, dest, opts) {\n const destParent = dirname(dest);\n if (await pathExists(destParent))\n return getStatsForCopy(destStat, src, dest, opts);\n return await mkdir(destParent, { recursive: !0 }), getStatsForCopy(destStat, src, dest, opts);\n}\nvar pathExists = function(dest) {\n return PromisePrototypeThen(stat(dest), () => !0, (err) => err.code === \"ENOENT\" \? !1 : PromiseReject(err));\n};\nasync function checkParentPaths(src, srcStat, dest) {\n const srcParent = resolve(dirname(src)), destParent = resolve(dirname(dest));\n if (destParent === srcParent || destParent === parse(destParent).root)\n return;\n let destStat;\n try {\n destStat = await stat(destParent, { bigint: !0 });\n } catch (err) {\n if (err.code === \"ENOENT\")\n return;\n throw err;\n }\n if (areIdentical(srcStat, destStat))\n throw new Error(`cannot copy ${src} to a subdirectory of self ${dest}`);\n return checkParentPaths(src, srcStat, destParent);\n}\nvar isSrcSubdir = function(src, dest) {\n const srcArr = normalizePathToArray(src), destArr = normalizePathToArray(dest);\n return ArrayPrototypeEvery.@call(srcArr, (cur, i) => destArr[i] === cur);\n};\nasync function getStatsForCopy(destStat, src, dest, opts) {\n const srcStat = await (opts.dereference \? stat : lstat)(src);\n if (srcStat.isDirectory() && opts.recursive)\n return onDir(srcStat, destStat, src, dest, opts);\n else if (srcStat.isDirectory())\n throw new Error(`${src} is a directory (not copied)`);\n else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())\n return onFile(srcStat, destStat, src, dest, opts);\n else if (srcStat.isSymbolicLink())\n return onLink(destStat, src, dest, opts);\n else if (srcStat.isSocket())\n throw new Error(`cannot copy a socket file: ${dest}`);\n else if (srcStat.isFIFO())\n throw new Error(`cannot copy a FIFO pipe: ${dest}`);\n throw new Error(`cannot copy an unknown file type: ${dest}`);\n}\nvar onFile = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return _copyFile(srcStat, src, dest, opts);\n return mayCopyFile(srcStat, src, dest, opts);\n};\nasync function mayCopyFile(srcStat, src, dest, opts) {\n if (opts.force)\n return await unlink(dest), _copyFile(srcStat, src, dest, opts);\n else if (opts.errorOnExist)\n throw new Error(`${dest} already exists`);\n}\nasync function _copyFile(srcStat, src, dest, opts) {\n if (await copyFile(src, dest, opts.mode), opts.preserveTimestamps)\n return handleTimestampsAndMode(srcStat.mode, src, dest);\n return setDestMode(dest, srcStat.mode);\n}\nasync function handleTimestampsAndMode(srcMode, src, dest) {\n if (fileIsNotWritable(srcMode))\n return await makeFileWritable(dest, srcMode), setDestTimestampsAndMode(srcMode, src, dest);\n return setDestTimestampsAndMode(srcMode, src, dest);\n}\nvar fileIsNotWritable = function(srcMode) {\n return (srcMode & 128) === 0;\n}, makeFileWritable = function(dest, srcMode) {\n return setDestMode(dest, srcMode | 128);\n};\nasync function setDestTimestampsAndMode(srcMode, src, dest) {\n return await setDestTimestamps(src, dest), setDestMode(dest, srcMode);\n}\nvar setDestMode = function(dest, srcMode) {\n return chmod(dest, srcMode);\n};\nasync function setDestTimestamps(src, dest) {\n const updatedSrcStat = await stat(src);\n return utimes(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\n}\nvar onDir = function(srcStat, destStat, src, dest, opts) {\n if (!destStat)\n return mkDirAndCopy(srcStat.mode, src, dest, opts);\n return copyDir(src, dest, opts);\n};\nasync function mkDirAndCopy(srcMode, src, dest, opts) {\n return await mkdir(dest), await copyDir(src, dest, opts), setDestMode(dest, srcMode);\n}\nasync function copyDir(src, dest, opts) {\n const dir = await opendir(src);\n for await (let { name } of dir) {\n const srcItem = join(src, name), destItem = join(dest, name), { destStat, skipped } = await checkPaths(srcItem, destItem, opts);\n if (!skipped)\n await getStatsForCopy(destStat, srcItem, destItem, opts);\n }\n}\nasync function onLink(destStat, src, dest, opts) {\n let resolvedSrc = await readlink(src);\n if (!opts.verbatimSymlinks && !isAbsolute(resolvedSrc))\n resolvedSrc = resolve(dirname(src), resolvedSrc);\n if (!destStat)\n return symlink(resolvedSrc, dest);\n let resolvedDest;\n try {\n resolvedDest = await readlink(dest);\n } catch (err) {\n if (err.code === \"EINVAL\" || err.code === \"UNKNOWN\")\n return symlink(resolvedSrc, dest);\n throw err;\n }\n if (!isAbsolute(resolvedDest))\n resolvedDest = resolve(dirname(dest), resolvedDest);\n if (isSrcSubdir(resolvedSrc, resolvedDest))\n throw new Error(`cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`);\n if ((await stat(src)).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc))\n throw new Error(`cannot overwrite ${resolvedDest} with ${resolvedSrc}`);\n return copyLink(resolvedSrc, dest);\n}\nasync function copyLink(resolvedSrc, dest) {\n return await unlink(dest), symlink(resolvedSrc, dest);\n}\nvar { chmod, copyFile, lstat, mkdir, opendir, readlink, stat, symlink, unlink, utimes } = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { dirname, isAbsolute, join, parse, resolve, sep } = @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28), SafePromiseAll = Promise.all, PromisePrototypeThen = Promise.prototype.then, PromiseReject = Promise.reject, ArrayPrototypeFilter = Array.prototype.filter, StringPrototypeSplit = String.prototype.split, ArrayPrototypeEvery = Array.prototype.every, normalizePathToArray = (path) => ArrayPrototypeFilter.@call(StringPrototypeSplit(resolve(path), sep), Boolean);\nreturn cpFn})\n"_s;
+static constexpr ASCIILiteral InternalSharedCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/shared.ts\nvar throwNotImplemented = function(feature, issue) {\n throw hideFromStack(throwNotImplemented), new NotImplementedError(feature, issue);\n}, hideFromStack = function(...fns) {\n for (let fn of fns)\n Object.defineProperty(fn, \"name\", {\n value: \"::bunternal::\"\n });\n}, $;\n\nclass NotImplementedError extends Error {\n code;\n constructor(feature, issue) {\n super(feature + \" is not yet implemented in Bun.\" + (issue \? \" Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/\" + issue : \"\"));\n this.name = \"NotImplementedError\", this.code = \"ERR_NOT_IMPLEMENTED\", hideFromStack(NotImplementedError);\n }\n}\n$ = {\n NotImplementedError,\n throwNotImplemented,\n hideFromStack\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral InternalSharedCode = "(function (){\"use strict\";// src/js/out/tmp/internal/shared.ts\nvar throwNotImplemented = function(feature, issue) {\n throw hideFromStack(throwNotImplemented), new NotImplementedError(feature, issue);\n}, hideFromStack = function(...fns) {\n for (let fn of fns)\n Object.defineProperty(fn, \"name\", {\n value: \"::bunternal::\"\n });\n}, $;\n\nclass NotImplementedError extends Error {\n code;\n constructor(feature, issue) {\n super(feature + \" is not yet implemented in Bun.\" + (issue \? \" Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/\" + issue : \"\"));\n this.name = \"NotImplementedError\", this.code = \"ERR_NOT_IMPLEMENTED\", hideFromStack(NotImplementedError);\n }\n}\n$ = {\n NotImplementedError,\n throwNotImplemented,\n hideFromStack\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral InternalUtilInspectCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/internal/util/inspect.ts\nvar vmSafeInstanceof = function(val, ctor) {\n if (val instanceof ctor)\n return !0;\n while (val) {\n if (typeof val !== \"object\")\n return !1;\n if (ctor.name === internalGetConstructorName(val))\n return !0;\n val = ObjectGetPrototypeOf(val);\n }\n return !1;\n}, checkBox = function(ctor) {\n return (val) => {\n if (!vmSafeInstanceof(val, ctor))\n return !1;\n try {\n ctor.prototype.valueOf.@call(val);\n } catch {\n return !1;\n }\n return !0;\n };\n}, assert = function(p, message) {\n if (!p)\n throw new AssertionError(message);\n}, getUserOptions = function(ctx, isCrossContext) {\n const ret = {\n stylize: ctx.stylize,\n showHidden: ctx.showHidden,\n depth: ctx.depth,\n colors: ctx.colors,\n customInspect: ctx.customInspect,\n showProxy: ctx.showProxy,\n maxArrayLength: ctx.maxArrayLength,\n maxStringLength: ctx.maxStringLength,\n breakLength: ctx.breakLength,\n compact: ctx.compact,\n sorted: ctx.sorted,\n getters: ctx.getters,\n numericSeparator: ctx.numericSeparator,\n ...ctx.userOptions\n };\n if (isCrossContext) {\n ObjectSetPrototypeOf(ret, null);\n for (let key of ObjectKeys(ret))\n if ((typeof ret[key] === \"object\" || typeof ret[key] === \"function\") && ret[key] !== null)\n delete ret[key];\n ret.stylize = ObjectSetPrototypeOf((value, flavour) => {\n let stylized;\n try {\n stylized = `${ctx.stylize(value, flavour)}`;\n } catch {\n }\n if (typeof stylized !== \"string\")\n return value;\n return stylized;\n }, null);\n }\n return ret;\n}, inspect = function(value, opts) {\n const ctx = {\n budget: {},\n indentationLvl: 0,\n seen: [],\n currentDepth: 0,\n stylize: stylizeNoColor,\n showHidden: inspectDefaultOptions.showHidden,\n depth: inspectDefaultOptions.depth,\n colors: inspectDefaultOptions.colors,\n customInspect: inspectDefaultOptions.customInspect,\n showProxy: inspectDefaultOptions.showProxy,\n maxArrayLength: inspectDefaultOptions.maxArrayLength,\n maxStringLength: inspectDefaultOptions.maxStringLength,\n breakLength: inspectDefaultOptions.breakLength,\n compact: inspectDefaultOptions.compact,\n sorted: inspectDefaultOptions.sorted,\n getters: inspectDefaultOptions.getters,\n numericSeparator: inspectDefaultOptions.numericSeparator\n };\n if (arguments.length > 1) {\n if (arguments.length > 2) {\n if (arguments[2] !== @undefined)\n ctx.depth = arguments[2];\n if (arguments.length > 3 && arguments[3] !== @undefined)\n ctx.colors = arguments[3];\n }\n if (typeof opts === \"boolean\")\n ctx.showHidden = opts;\n else if (opts) {\n const optKeys = ObjectKeys(opts);\n for (let i = 0;i < optKeys.length; ++i) {\n const key = optKeys[i];\n if (ObjectPrototypeHasOwnProperty(inspectDefaultOptions, key) || key === \"stylize\")\n ctx[key] = opts[key];\n else if (ctx.userOptions === @undefined)\n ctx.userOptions = opts;\n }\n }\n }\n if (ctx.colors)\n ctx.stylize = stylizeWithColor;\n if (ctx.maxArrayLength === null)\n ctx.maxArrayLength = @Infinity;\n if (ctx.maxStringLength === null)\n ctx.maxStringLength = @Infinity;\n return formatValue(ctx, value, 0);\n}, defineColorAlias = function(target, alias) {\n ObjectDefineProperty(inspect.colors, alias, {\n __proto__: null,\n get() {\n return this[target];\n },\n set(value) {\n this[target] = value;\n },\n configurable: !0,\n enumerable: !1\n });\n}, addQuotes = function(str, quotes) {\n if (quotes === -1)\n return `\"${str}\"`;\n if (quotes === -2)\n return `\\`${str}\\``;\n return `'${str}'`;\n}, escapeFn = function(str) {\n const charCode = StringPrototypeCharCodeAt(str);\n return meta.length > charCode \? meta[charCode] : `\\\\u${NumberPrototypeToString(charCode, 16)}`;\n}, strEscape = function(str) {\n let escapeTest = strEscapeSequencesRegExp, escapeReplace = strEscapeSequencesReplacer, singleQuote = 39;\n if (StringPrototypeIncludes(str, \"'\")) {\n if (!StringPrototypeIncludes(str, '\"'))\n singleQuote = -1;\n else if (!StringPrototypeIncludes(str, \"`\") && !StringPrototypeIncludes(str, \"${\"))\n singleQuote = -2;\n if (singleQuote !== 39)\n escapeTest = strEscapeSequencesRegExpSingle, escapeReplace = strEscapeSequencesReplacerSingle;\n }\n if (str.length < 5000 && RegExpPrototypeExec(escapeTest, str) === null)\n return addQuotes(str, singleQuote);\n if (str.length > 100)\n return str = RegExpPrototypeSymbolReplace(escapeReplace, str, escapeFn), addQuotes(str, singleQuote);\n let result = \"\", last = 0;\n for (let i = 0;i < str.length; i++) {\n const point = StringPrototypeCharCodeAt(str, i);\n if (point === singleQuote || point === 92 || point < 32 || point > 126 && point < 160) {\n if (last === i)\n result += meta[point];\n else\n result += `${StringPrototypeSlice(str, last, i)}${meta[point]}`;\n last = i + 1;\n } else if (point >= 55296 && point <= 57343) {\n if (point <= 56319 && i + 1 < str.length) {\n const point2 = StringPrototypeCharCodeAt(str, i + 1);\n if (point2 >= 56320 && point2 <= 57343) {\n i++;\n continue;\n }\n }\n result += `${StringPrototypeSlice(str, last, i)}\\\\u${NumberPrototypeToString(point, 16)}`, last = i + 1;\n }\n }\n if (last !== str.length)\n result += StringPrototypeSlice(str, last);\n return addQuotes(result, singleQuote);\n}, stylizeWithColor = function(str, styleType) {\n const style = inspect.styles[styleType];\n if (style !== @undefined) {\n const color = inspect.colors[style];\n if (color !== @undefined)\n return `\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`;\n }\n return str;\n}, stylizeNoColor = function(str) {\n return str;\n}, getEmptyFormatArray = function() {\n return [];\n}, isInstanceof = function(object, proto) {\n try {\n return object instanceof proto;\n } catch {\n return !1;\n }\n}, getConstructorName = function(obj, ctx, recurseTimes, protoProps) {\n let firstProto;\n const tmp = obj;\n while (obj || isUndetectableObject(obj)) {\n const descriptor = ObjectGetOwnPropertyDescriptor(obj, \"constructor\");\n if (descriptor !== @undefined && typeof descriptor.value === \"function\" && descriptor.value.name !== \"\" && isInstanceof(tmp, descriptor.value)) {\n if (protoProps !== @undefined && (firstProto !== obj || !builtInObjects.has(descriptor.value.name)))\n addPrototypeProperties(ctx, tmp, firstProto || tmp, recurseTimes, protoProps);\n return String(descriptor.value.name);\n }\n if (obj = ObjectGetPrototypeOf(obj), firstProto === @undefined)\n firstProto = obj;\n }\n if (firstProto === null)\n return null;\n const res = internalGetConstructorName(tmp);\n if (recurseTimes > ctx.depth && ctx.depth !== null)\n return `${res} <Complex prototype>`;\n const protoConstr = getConstructorName(firstProto, ctx, recurseTimes + 1, protoProps);\n if (protoConstr === null)\n return `${res} <${inspect(firstProto, {\n ...ctx,\n customInspect: !1,\n depth: -1\n })}>`;\n return `${res} <${protoConstr}>`;\n}, addPrototypeProperties = function(ctx, main, obj, recurseTimes, output) {\n let depth = 0, keys, keySet;\n do {\n if (depth !== 0 || main === obj) {\n if (obj = ObjectGetPrototypeOf(obj), obj === null)\n return;\n const descriptor = ObjectGetOwnPropertyDescriptor(obj, \"constructor\");\n if (descriptor !== @undefined && typeof descriptor.value === \"function\" && builtInObjects.has(descriptor.value.name))\n return;\n }\n if (depth === 0)\n keySet = new SafeSet;\n else\n ArrayPrototypeForEach(keys, (key) => keySet.add(key));\n keys = ReflectOwnKeys(obj), ArrayPrototypePush(ctx.seen, main);\n for (let key of keys) {\n if (key === \"constructor\" || ObjectPrototypeHasOwnProperty(main, key) || depth !== 0 && keySet.has(key))\n continue;\n const desc = ObjectGetOwnPropertyDescriptor(obj, key);\n if (typeof desc.value === \"function\")\n continue;\n const value = formatProperty(ctx, obj, recurseTimes, key, kObjectType, desc, main);\n if (ctx.colors)\n ArrayPrototypePush(output, `\\x1B[2m${value}\\x1B[22m`);\n else\n ArrayPrototypePush(output, value);\n }\n ArrayPrototypePop(ctx.seen);\n } while (++depth !== 3);\n}, getPrefix = function(constructor, tag, fallback, size = \"\") {\n if (constructor === null) {\n if (tag !== \"\" && fallback !== tag)\n return `[${fallback}${size}: null prototype] [${tag}] `;\n return `[${fallback}${size}: null prototype] `;\n }\n if (tag !== \"\" && constructor !== tag)\n return `${constructor}${size} [${tag}] `;\n return `${constructor}${size} `;\n}, getKeys = function(value, showHidden) {\n let keys;\n const symbols = ObjectGetOwnPropertySymbols(value);\n if (showHidden) {\n if (keys = ObjectGetOwnPropertyNames(value), symbols.length !== 0)\n ArrayPrototypePushApply(keys, symbols);\n } else {\n try {\n keys = ObjectKeys(value);\n } catch (err) {\n assert(isNativeError(err) && err.name === \"ReferenceError\" && isModuleNamespaceObject(value)), keys = ObjectGetOwnPropertyNames(value);\n }\n if (symbols.length !== 0)\n ArrayPrototypePushApply(keys, ArrayPrototypeFilter(symbols, (key) => ObjectPrototypePropertyIsEnumerable(value, key)));\n }\n return keys;\n}, getCtxStyle = function(value, constructor, tag) {\n let fallback = \"\";\n if (constructor === null) {\n if (fallback = internalGetConstructorName(value), fallback === tag)\n fallback = \"Object\";\n }\n return getPrefix(constructor, tag, fallback);\n}, formatProxy = function(ctx, proxy, recurseTimes) {\n if (recurseTimes > ctx.depth && ctx.depth !== null)\n return ctx.stylize(\"Proxy [Array]\", \"special\");\n recurseTimes += 1, ctx.indentationLvl += 2;\n const res = [formatValue(ctx, proxy[0], recurseTimes), formatValue(ctx, proxy[1], recurseTimes)];\n return ctx.indentationLvl -= 2, reduceToSingleString(ctx, res, \"\", [\"Proxy [\", \"]\"], kArrayExtrasType, recurseTimes);\n}, formatValue = function(ctx, value, recurseTimes, typedArray) {\n if (typeof value !== \"object\" && typeof value !== \"function\" && !isUndetectableObject(value))\n return formatPrimitive(ctx.stylize, value, ctx);\n if (value === null)\n return ctx.stylize(\"null\", \"null\");\n const context = value, proxy = getProxyDetails(value, !!ctx.showProxy);\n if (proxy !== @undefined) {\n if (proxy === null || proxy[0] === null)\n return ctx.stylize(\"<Revoked Proxy>\", \"special\");\n if (ctx.showProxy)\n return formatProxy(ctx, proxy, recurseTimes);\n value = proxy;\n }\n if (ctx.customInspect) {\n const maybeCustom = value[customInspectSymbol];\n if (typeof maybeCustom === \"function\" && maybeCustom !== inspect && !(value.constructor && value.constructor.prototype === value)) {\n const depth = ctx.depth === null \? null : ctx.depth - recurseTimes, isCrossContext = proxy !== @undefined || !(context instanceof Object), ret = maybeCustom.@call(context, depth, getUserOptions(ctx, isCrossContext), inspect);\n if (ret !== context) {\n if (typeof ret !== \"string\")\n return formatValue(ctx, ret, recurseTimes);\n return StringPrototypeReplaceAll(ret, \"\\n\", `\\n${StringPrototypeRepeat(\" \", ctx.indentationLvl)}`);\n }\n }\n }\n if (ctx.seen.includes(value)) {\n let index = 1;\n if (ctx.circular === @undefined)\n ctx.circular = new SafeMap, ctx.circular.set(value, index);\n else if (index = ctx.circular.get(value), index === @undefined)\n index = ctx.circular.size + 1, ctx.circular.set(value, index);\n return ctx.stylize(`[Circular *${index}]`, \"special\");\n }\n return formatRaw(ctx, value, recurseTimes, typedArray);\n}, formatRaw = function(ctx, value, recurseTimes, typedArray) {\n let keys, protoProps;\n if (ctx.showHidden && (recurseTimes <= ctx.depth || ctx.depth === null))\n protoProps = [];\n const constructor = getConstructorName(value, ctx, recurseTimes, protoProps);\n if (protoProps !== @undefined && protoProps.length === 0)\n protoProps = @undefined;\n let tag = value[SymbolToStringTag];\n if (typeof tag !== \"string\" || tag !== \"\" && (ctx.showHidden \? ObjectPrototypeHasOwnProperty : ObjectPrototypePropertyIsEnumerable)(value, SymbolToStringTag))\n tag = \"\";\n let base = \"\", formatter = getEmptyFormatArray, braces, noIterator = !0, i = 0;\n const filter = ctx.showHidden \? 0 : 2;\n let extrasType = kObjectType;\n if ((SymbolIterator in value) || constructor === null)\n if (noIterator = !1, ArrayIsArray(value)) {\n const prefix = constructor !== \"Array\" || tag !== \"\" \? getPrefix(constructor, tag, \"Array\", `(${value.length})`) : \"\";\n if (keys = getOwnNonIndexProperties(value, filter), braces = [`${prefix}[`, \"]\"], value.length === 0 && keys.length === 0 && protoProps === @undefined)\n return `${braces[0]}]`;\n extrasType = kArrayExtrasType, formatter = formatArray;\n } else if (isSet(value)) {\n const size = SetPrototypeGetSize(value), prefix = getPrefix(constructor, tag, \"Set\", `(${size})`);\n if (keys = getKeys(value, ctx.showHidden), formatter = constructor !== null \? FunctionPrototypeBind(formatSet, null, value) : FunctionPrototypeBind(formatSet, null, SetPrototypeValues(value)), size === 0 && keys.length === 0 && protoProps === @undefined)\n return `${prefix}{}`;\n braces = [`${prefix}{`, \"}\"];\n } else if (isMap(value)) {\n const size = MapPrototypeGetSize(value), prefix = getPrefix(constructor, tag, \"Map\", `(${size})`);\n if (keys = getKeys(value, ctx.showHidden), formatter = constructor !== null \? FunctionPrototypeBind(formatMap, null, value) : FunctionPrototypeBind(formatMap, null, MapPrototypeEntries(value)), size === 0 && keys.length === 0 && protoProps === @undefined)\n return `${prefix}{}`;\n braces = [`${prefix}{`, \"}\"];\n } else if (isTypedArray(value)) {\n keys = getOwnNonIndexProperties(value, filter);\n let bound = value, fallback = \"\";\n if (constructor === null)\n fallback = TypedArrayPrototypeGetSymbolToStringTag(value), bound = new primordials[fallback](value);\n const size = TypedArrayPrototypeGetLength(value);\n if (braces = [`${getPrefix(constructor, tag, fallback, `(${size})`)}[`, \"]\"], value.length === 0 && keys.length === 0 && !ctx.showHidden)\n return `${braces[0]}]`;\n formatter = FunctionPrototypeBind(formatTypedArray, null, bound, size), extrasType = kArrayExtrasType;\n } else if (isMapIterator(value))\n keys = getKeys(value, ctx.showHidden), braces = getIteratorBraces(\"Map\", tag), formatter = FunctionPrototypeBind(formatIterator, null, braces);\n else if (isSetIterator(value))\n keys = getKeys(value, ctx.showHidden), braces = getIteratorBraces(\"Set\", tag), formatter = FunctionPrototypeBind(formatIterator, null, braces);\n else\n noIterator = !0;\n if (noIterator)\n if (keys = getKeys(value, ctx.showHidden), braces = [\"{\", \"}\"], constructor === \"Object\") {\n if (isArgumentsObject(value))\n braces[0] = \"[Arguments] {\";\n else if (tag !== \"\")\n braces[0] = `${getPrefix(constructor, tag, \"Object\")}{`;\n if (keys.length === 0 && protoProps === @undefined)\n return `${braces[0]}}`;\n } else if (typeof value === \"function\") {\n if (base = getFunctionBase(value, constructor, tag), keys.length === 0 && protoProps === @undefined)\n return ctx.stylize(base, \"special\");\n } else if (isRegExp(value)) {\n base = RegExpPrototypeToString(constructor !== null \? value : new RegExp(value));\n const prefix = getPrefix(constructor, tag, \"RegExp\");\n if (prefix !== \"RegExp \")\n base = `${prefix}${base}`;\n if (keys.length === 0 && protoProps === @undefined || recurseTimes > ctx.depth && ctx.depth !== null)\n return ctx.stylize(base, \"regexp\");\n } else if (isDate(value)) {\n base = NumberIsNaN(DatePrototypeGetTime(value)) \? DatePrototypeToString(value) : DatePrototypeToISOString(value);\n const prefix = getPrefix(constructor, tag, \"Date\");\n if (prefix !== \"Date \")\n base = `${prefix}${base}`;\n if (keys.length === 0 && protoProps === @undefined)\n return ctx.stylize(base, \"date\");\n } else if (value instanceof Error) {\n if (base = formatError(value, constructor, tag, ctx, keys), keys.length === 0 && protoProps === @undefined)\n return base;\n } else if (isAnyArrayBuffer(value)) {\n const arrayType = isArrayBuffer(value) \? \"ArrayBuffer\" : \"SharedArrayBuffer\", prefix = getPrefix(constructor, tag, arrayType);\n if (typedArray === @undefined)\n formatter = formatArrayBuffer;\n else if (keys.length === 0 && protoProps === @undefined)\n return prefix + `{ byteLength: ${formatNumber(ctx.stylize, value.byteLength, !1)} }`;\n braces[0] = `${prefix}{`, ArrayPrototypeUnshift(keys, \"byteLength\");\n } else if (isDataView(value))\n braces[0] = `${getPrefix(constructor, tag, \"DataView\")}{`, ArrayPrototypeUnshift(keys, \"byteLength\", \"byteOffset\", \"buffer\");\n else if (isPromise(value))\n braces[0] = `${getPrefix(constructor, tag, \"Promise\")}{`, formatter = formatPromise;\n else if (isWeakSet(value))\n braces[0] = `${getPrefix(constructor, tag, \"WeakSet\")}{`, formatter = ctx.showHidden \? formatWeakSet : formatWeakCollection;\n else if (isWeakMap(value))\n braces[0] = `${getPrefix(constructor, tag, \"WeakMap\")}{`, formatter = ctx.showHidden \? formatWeakMap : formatWeakCollection;\n else if (isModuleNamespaceObject(value))\n braces[0] = `${getPrefix(constructor, tag, \"Module\")}{`, formatter = formatNamespaceObject.bind(null, keys);\n else if (isBoxedPrimitive(value)) {\n if (base = getBoxedBase(value, ctx, keys, constructor, tag), keys.length === 0 && protoProps === @undefined)\n return base;\n } else {\n if (keys.length === 0 && protoProps === @undefined) {\n if (isExternal(value))\n return ctx.stylize(\"[External: 0]\", \"special\");\n return `${getCtxStyle(value, constructor, tag)}{}`;\n }\n braces[0] = `${getCtxStyle(value, constructor, tag)}{`;\n }\n if (recurseTimes > ctx.depth && ctx.depth !== null) {\n let constructorName = StringPrototypeSlice(getCtxStyle(value, constructor, tag), 0, -1);\n if (constructor !== null)\n constructorName = `[${constructorName}]`;\n return ctx.stylize(constructorName, \"special\");\n }\n recurseTimes += 1, ctx.seen.push(value), ctx.currentDepth = recurseTimes;\n let output;\n const indentationLvl = ctx.indentationLvl;\n try {\n if (ctx.currentDepth > 1000)\n @throwRangeError(ERROR_STACK_OVERFLOW_MSG);\n output = formatter(ctx, value, recurseTimes);\n for (i = 0;i < keys.length; i++)\n ArrayPrototypePush(output, formatProperty(ctx, value, recurseTimes, keys[i], extrasType));\n if (protoProps !== @undefined)\n ArrayPrototypePushApply(output, protoProps);\n } catch (err) {\n if (err instanceof RangeError && err.message === ERROR_STACK_OVERFLOW_MSG) {\n const constructorName = StringPrototypeSlice(getCtxStyle(value, constructor, tag), 0, -1);\n return ctx.seen.pop(), ctx.indentationLvl = indentationLvl, ctx.stylize(`[${constructorName}: Inspection interrupted prematurely. Maximum call stack size exceeded.]`, \"special\");\n }\n throw new AssertionError(\"handleMaxCallStackSize assertion failed: \" + String(err), !0);\n }\n if (ctx.circular !== @undefined) {\n const index = ctx.circular.get(value);\n if (index !== @undefined)\n if (ctx.seenRefs \?\?= new Set, !ctx.seenRefs.has(index)) {\n ctx.seenRefs.add(index);\n const reference = ctx.stylize(`<ref *${index}>`, \"special\");\n if (ctx.compact !== !0)\n base = base === \"\" \? reference : `${reference} ${base}`;\n else\n braces[0] = `${reference} ${braces[0]}`;\n } else {\n //! this is a non-standard behavior compared to Node's implementation\n return ctx.stylize(`[Circular *${index}]`, \"special\");\n }\n }\n if (ctx.seen.pop(), ctx.sorted) {\n const comparator = ctx.sorted === !0 \? @undefined : ctx.sorted;\n if (extrasType === kObjectType)\n ArrayPrototypeSort(output, comparator);\n else if (keys.length > 1) {\n const sorted = ArrayPrototypeSort(ArrayPrototypeSlice(output, output.length - keys.length), comparator);\n ArrayPrototypeUnshift(sorted, output, output.length - keys.length, keys.length), ReflectApply(ArrayPrototypeSplice, null, sorted);\n }\n }\n const res = reduceToSingleString(ctx, output, base, braces, extrasType, recurseTimes, value), newLength = (ctx.budget[ctx.indentationLvl] || 0) + res.length;\n if (ctx.budget[ctx.indentationLvl] = newLength, newLength > 134217728)\n ctx.depth = -1;\n return res;\n}, getIteratorBraces = function(type, tag) {\n if (tag !== `${type} Iterator`) {\n if (tag !== \"\")\n tag += \"] [\";\n tag += `${type} Iterator`;\n }\n return [`[${tag}] {`, \"}\"];\n}, getBoxedBase = function(value, ctx, keys, constructor, tag) {\n let fn, type;\n if (isNumberObject(value))\n fn = NumberPrototypeValueOf, type = \"Number\";\n else if (isStringObject(value))\n fn = StringPrototypeValueOf, type = \"String\", keys.splice(0, value.length);\n else if (isBooleanObject(value))\n fn = BooleanPrototypeValueOf, type = \"Boolean\";\n else if (isBigIntObject(value))\n fn = BigIntPrototypeValueOf, type = \"BigInt\";\n else\n fn = SymbolPrototypeValueOf, type = \"Symbol\";\n let base = `[${type}`;\n if (type !== constructor)\n if (constructor === null)\n base += \" (null prototype)\";\n else\n base += ` (${constructor})`;\n if (base += `: ${formatPrimitive(stylizeNoColor, fn(value), ctx)}]`, tag !== \"\" && tag !== constructor)\n base += ` [${tag}]`;\n if (keys.length !== 0 || ctx.stylize === stylizeNoColor)\n return base;\n return ctx.stylize(base, StringPrototypeToLowerCase(type));\n}, getClassBase = function(value, constructor, tag) {\n let base = `class ${ObjectPrototypeHasOwnProperty(value, \"name\") && value.name || \"(anonymous)\"}`;\n if (constructor !== \"Function\" && constructor !== null)\n base += ` [${constructor}]`;\n if (tag !== \"\" && constructor !== tag)\n base += ` [${tag}]`;\n if (constructor !== null) {\n const superName = ObjectGetPrototypeOf(value).name;\n if (superName)\n base += ` extends ${superName}`;\n } else\n base += \" extends [null prototype]\";\n return `[${base}]`;\n}, getFunctionBase = function(value, constructor, tag) {\n const stringified = FunctionPrototypeToString(value);\n if (StringPrototypeStartsWith(stringified, \"class\") && StringPrototypeEndsWith(stringified, \"}\")) {\n const slice = StringPrototypeSlice(stringified, 5, -1), bracketIndex = StringPrototypeIndexOf(slice, \"{\");\n if (bracketIndex !== -1 && (!StringPrototypeIncludes(StringPrototypeSlice(slice, 0, bracketIndex), \"(\") || RegExpPrototypeExec(classRegExp, RegExpPrototypeSymbolReplace(stripCommentsRegExp, slice)) !== null))\n return getClassBase(value, constructor, tag);\n }\n let type = \"Function\";\n if (isGeneratorFunction(value))\n type = `Generator${type}`;\n if (isAsyncFunction(value))\n type = `Async${type}`;\n let base = `[${type}`;\n if (constructor === null)\n base += \" (null prototype)\";\n if (value.name === \"\")\n base += \" (anonymous)\";\n else\n base += `: ${value.name}`;\n if (base += \"]\", constructor !== type && constructor !== null)\n base += ` ${constructor}`;\n if (tag !== \"\" && constructor !== tag)\n base += ` [${tag}]`;\n return base;\n}, identicalSequenceRange = function(a, b) {\n for (let i = 0;i < a.length - 3; i++) {\n const pos = b.indexOf(a[i]);\n if (pos !== -1) {\n const rest = b.length - pos;\n if (rest > 3) {\n let len = 1;\n const maxLen = MathMin(a.length - i, rest);\n while (maxLen > len && a[i + len] === b[pos + len])\n len++;\n if (len > 3)\n return { len, offset: i };\n }\n }\n }\n return { len: 0, offset: 0 };\n}, getStackString = function(error) {\n return error.stack \? String(error.stack) : ErrorPrototypeToString(error);\n}, getStackFrames = function(ctx, err, stack) {\n const frames = StringPrototypeSplit(stack, \"\\n\");\n let cause;\n try {\n ({ cause } = err);\n } catch {\n }\n if (cause != null && cause instanceof Error) {\n const causeStack = getStackString(cause), causeStackStart = StringPrototypeIndexOf(causeStack, \"\\n at\");\n if (causeStackStart !== -1) {\n const causeFrames = StringPrototypeSplit(StringPrototypeSlice(causeStack, causeStackStart + 1), \"\\n\"), { len, offset } = identicalSequenceRange(frames, causeFrames);\n if (len > 0) {\n const skipped = len - 2, msg = ` ... ${skipped} lines matching cause stack trace ...`;\n frames.splice(offset + 1, skipped, ctx.stylize(msg, \"undefined\"));\n }\n }\n }\n return frames;\n}, improveStack = function(stack, constructor, name, tag) {\n let len = name.length;\n if (constructor === null || StringPrototypeEndsWith(name, \"Error\") && StringPrototypeStartsWith(stack, name) && (stack.length === len || stack[len] === \":\" || stack[len] === \"\\n\")) {\n let fallback = \"Error\";\n if (constructor === null) {\n const start = RegExpPrototypeExec(/^([A-Z][a-z_ A-Z0-9[\\]()-]+)(\?::|\\n {4}at)/, stack) || RegExpPrototypeExec(/^([a-z_A-Z0-9-]*Error)$/, stack);\n fallback = start && start[1] || \"\", len = fallback.length, fallback = fallback || \"Error\";\n }\n const prefix = StringPrototypeSlice(getPrefix(constructor, tag, fallback), 0, -1);\n if (name !== prefix)\n if (StringPrototypeIncludes(prefix, name))\n if (len === 0)\n stack = `${prefix}: ${stack}`;\n else\n stack = `${prefix}${StringPrototypeSlice(stack, len)}`;\n else\n stack = `${prefix} [${name}]${StringPrototypeSlice(stack, len)}`;\n }\n return stack;\n}, removeDuplicateErrorKeys = function(ctx, keys, err, stack) {\n if (!ctx.showHidden && keys.length !== 0)\n for (let name of [\"name\", \"message\", \"stack\"]) {\n const index = ArrayPrototypeIndexOf(keys, name);\n if (index !== -1 && StringPrototypeIncludes(stack, err[name]))\n ArrayPrototypeSplice(keys, index, 1);\n }\n}, markNodeModules = function(ctx, line) {\n let tempLine = \"\", nodeModule, pos = 0;\n while ((nodeModule = nodeModulesRegExp.exec(line)) !== null)\n tempLine += StringPrototypeSlice(line, pos, nodeModule.index + 14), tempLine += ctx.stylize(nodeModule[1], \"module\"), pos = nodeModule.index + nodeModule[0].length;\n if (pos !== 0)\n line = tempLine + StringPrototypeSlice(line, pos);\n return line;\n}, markCwd = function(ctx, line, workingDirectory) {\n let cwdStartPos = StringPrototypeIndexOf(line, workingDirectory), tempLine = \"\", cwdLength = workingDirectory.length;\n if (cwdStartPos !== -1) {\n if (StringPrototypeSlice(line, cwdStartPos - 7, cwdStartPos) === \"file://\")\n cwdLength += 7, cwdStartPos -= 7;\n const start = line[cwdStartPos - 1] === \"(\" \? cwdStartPos - 1 : cwdStartPos, end = start !== cwdStartPos && StringPrototypeEndsWith(line, \")\") \? -1 : line.length, workingDirectoryEndPos = cwdStartPos + cwdLength + 1, cwdSlice = StringPrototypeSlice(line, start, workingDirectoryEndPos);\n if (tempLine += StringPrototypeSlice(line, 0, start), tempLine += ctx.stylize(cwdSlice, \"undefined\"), tempLine += StringPrototypeSlice(line, workingDirectoryEndPos, end), end === -1)\n tempLine += ctx.stylize(\")\", \"undefined\");\n } else\n tempLine += line;\n return tempLine;\n}, safeGetCWD = function() {\n let workingDirectory;\n try {\n workingDirectory = process.cwd();\n } catch {\n return;\n }\n return workingDirectory;\n}, formatError = function(err, constructor, tag, ctx, keys) {\n const name = err.name != null \? String(err.name) : \"Error\";\n let stack = getStackString(err);\n //! temp fix for Bun losing the error name from inherited errors + extraneous \": \" with no message\n if (stack = stack.replace(/^Error: /, `${name}${err.message \? \": \" : \"\"}`), removeDuplicateErrorKeys(ctx, keys, err, stack), (\"cause\" in err) && (keys.length === 0 || !ArrayPrototypeIncludes(keys, \"cause\")))\n ArrayPrototypePush(keys, \"cause\");\n if (ArrayIsArray(err.errors) && (keys.length === 0 || !ArrayPrototypeIncludes(keys, \"errors\")))\n ArrayPrototypePush(keys, \"errors\");\n stack = improveStack(stack, constructor, name, tag);\n let pos = err.message && StringPrototypeIndexOf(stack, err.message) || -1;\n if (pos !== -1)\n pos += err.message.length;\n const stackStart = StringPrototypeIndexOf(stack, \"\\n at\", pos);\n if (stackStart === -1)\n stack = `[${stack}]`;\n else {\n let newStack = StringPrototypeSlice(stack, 0, stackStart);\n const stackFramePart = StringPrototypeSlice(stack, stackStart + 1), lines = getStackFrames(ctx, err, stackFramePart);\n if (ctx.colors) {\n const workingDirectory = safeGetCWD();\n let esmWorkingDirectory;\n for (let line of lines) {\n const core = RegExpPrototypeExec(coreModuleRegExp, line);\n if (core !== null && (StringPrototypeStartsWith(core[1], \"internal/\") || ArrayPrototypeIncludes(@requireNativeModule(\"module\").builtinModules, core[1])))\n newStack += `\\n${ctx.stylize(line, \"undefined\")}`;\n else {\n if (newStack += \"\\n\", line = markNodeModules(ctx, line), workingDirectory !== @undefined) {\n let newLine = markCwd(ctx, line, workingDirectory);\n if (newLine === line)\n esmWorkingDirectory \?\?= pathToFileURL(workingDirectory), newLine = markCwd(ctx, line, esmWorkingDirectory);\n line = newLine;\n }\n newStack += line;\n }\n }\n } else\n newStack += `\\n${ArrayPrototypeJoin(lines, \"\\n\")}`;\n stack = newStack;\n }\n if (ctx.indentationLvl !== 0) {\n const indentation = StringPrototypeRepeat(\" \", ctx.indentationLvl);\n stack = StringPrototypeReplaceAll(stack, \"\\n\", `\\n${indentation}`);\n }\n return stack;\n}, groupArrayElements = function(ctx, output, value) {\n let totalLength = 0, maxLength = 0, i = 0, outputLength = output.length;\n if (ctx.maxArrayLength < output.length)\n outputLength--;\n const separatorSpace = 2, dataLen = new Array(outputLength);\n for (;i < outputLength; i++) {\n const len = getStringWidth(output[i], ctx.colors);\n if (dataLen[i] = len, totalLength += len + separatorSpace, maxLength < len)\n maxLength = len;\n }\n const actualMax = maxLength + separatorSpace;\n if (actualMax * 3 + ctx.indentationLvl < ctx.breakLength && (totalLength / actualMax > 5 || maxLength <= 6)) {\n const averageBias = MathSqrt(actualMax - totalLength / output.length), biasedMax = MathMax(actualMax - 3 - averageBias, 1), columns = MathMin(MathRound(MathSqrt(2.5 * biasedMax * outputLength) / biasedMax), MathFloor((ctx.breakLength - ctx.indentationLvl) / actualMax), ctx.compact * 4, 15);\n if (columns <= 1)\n return output;\n const tmp = [], maxLineLength = [];\n for (let i2 = 0;i2 < columns; i2++) {\n let lineMaxLength = 0;\n for (let j = i2;j < output.length; j += columns)\n if (dataLen[j] > lineMaxLength)\n lineMaxLength = dataLen[j];\n lineMaxLength += separatorSpace, maxLineLength[i2] = lineMaxLength;\n }\n let order = StringPrototypePadStart;\n if (value !== @undefined) {\n for (let i2 = 0;i2 < output.length; i2++)\n if (typeof value[i2] !== \"number\" && typeof value[i2] !== \"bigint\") {\n order = StringPrototypePadEnd;\n break;\n }\n }\n for (let i2 = 0;i2 < outputLength; i2 += columns) {\n const max = MathMin(i2 + columns, outputLength);\n let str = \"\", j = i2;\n for (;j < max - 1; j++) {\n const padding = maxLineLength[j - i2] + output[j].length - dataLen[j];\n str += order(`${output[j]}, `, padding, \" \");\n }\n if (order === StringPrototypePadStart) {\n const padding = maxLineLength[j - i2] + output[j].length - dataLen[j] - separatorSpace;\n str += StringPrototypePadStart(output[j], padding, \" \");\n } else\n str += output[j];\n ArrayPrototypePush(tmp, str);\n }\n if (ctx.maxArrayLength < output.length)\n ArrayPrototypePush(tmp, output[outputLength]);\n output = tmp;\n }\n return output;\n}, addNumericSeparator = function(integerString) {\n let result = \"\", i = integerString.length;\n const start = StringPrototypeStartsWith(integerString, \"-\") \? 1 : 0;\n for (;i >= start + 4; i -= 3)\n result = `_${StringPrototypeSlice(integerString, i - 3, i)}${result}`;\n return i === integerString.length \? integerString : `${StringPrototypeSlice(integerString, 0, i)}${result}`;\n}, addNumericSeparatorEnd = function(integerString) {\n let result = \"\", i = 0;\n for (;i < integerString.length - 3; i += 3)\n result += `${StringPrototypeSlice(integerString, i, i + 3)}_`;\n return i === 0 \? integerString : `${result}${StringPrototypeSlice(integerString, i)}`;\n}, formatNumber = function(fn, number, numericSeparator) {\n if (!numericSeparator) {\n if (ObjectIs(number, -0))\n return fn(\"-0\", \"number\");\n return fn(`${number}`, \"number\");\n }\n const integer = MathTrunc(number), string = String(integer);\n if (integer === number) {\n if (!NumberIsFinite(number) || StringPrototypeIncludes(string, \"e\"))\n return fn(string, \"number\");\n return fn(`${addNumericSeparator(string)}`, \"number\");\n }\n if (NumberIsNaN(number))\n return fn(string, \"number\");\n return fn(`${addNumericSeparator(string)}.${addNumericSeparatorEnd(StringPrototypeSlice(String(number), string.length + 1))}`, \"number\");\n}, formatBigInt = function(fn, bigint, numericSeparator) {\n const string = String(bigint);\n if (!numericSeparator)\n return fn(`${string}n`, \"bigint\");\n return fn(`${addNumericSeparator(string)}n`, \"bigint\");\n}, formatPrimitive = function(fn, value, ctx) {\n if (typeof value === \"string\") {\n let trailer = \"\";\n if (value.length > ctx.maxStringLength) {\n const remaining = value.length - ctx.maxStringLength;\n value = StringPrototypeSlice(value, 0, ctx.maxStringLength), trailer = `... ${remaining} more character${remaining > 1 \? \"s\" : \"\"}`;\n }\n if (ctx.compact !== !0 && value.length > kMinLineLength && value.length > ctx.breakLength - ctx.indentationLvl - 4)\n return ArrayPrototypeJoin(ArrayPrototypeMap(extractedSplitNewLines(value), (line) => fn(strEscape(line), \"string\")), ` +\\n${StringPrototypeRepeat(\" \", ctx.indentationLvl + 2)}`) + trailer;\n return fn(strEscape(value), \"string\") + trailer;\n }\n if (typeof value === \"number\")\n return formatNumber(fn, value, ctx.numericSeparator);\n if (typeof value === \"bigint\")\n return formatBigInt(fn, value, ctx.numericSeparator);\n if (typeof value === \"boolean\")\n return fn(`${value}`, \"boolean\");\n if (typeof value === \"undefined\")\n return fn(\"undefined\", \"undefined\");\n return fn(SymbolPrototypeToString(value), \"symbol\");\n}, formatNamespaceObject = function(keys, ctx, value, recurseTimes) {\n const output = new Array(keys.length);\n for (let i = 0;i < keys.length; i++)\n try {\n output[i] = formatProperty(ctx, value, recurseTimes, keys[i], kObjectType);\n } catch (err) {\n assert(isNativeError(err) && err.name === \"ReferenceError\");\n const tmp = { [keys[i]]: \"\" };\n output[i] = formatProperty(ctx, tmp, recurseTimes, keys[i], kObjectType);\n const pos = StringPrototypeLastIndexOf(output[i], \" \");\n output[i] = StringPrototypeSlice(output[i], 0, pos + 1) + ctx.stylize(\"<uninitialized>\", \"special\");\n }\n return keys.length = 0, output;\n}, formatSpecialArray = function(ctx, value, recurseTimes, maxLength, output, i) {\n const keys = ObjectKeys(value);\n let index = i;\n for (;i < keys.length && output.length < maxLength; i++) {\n const key = keys[i], tmp = +key;\n if (tmp > 4294967294)\n break;\n if (`${index}` !== key) {\n if (RegExpPrototypeExec(numberRegExp, key) === null)\n break;\n const emptyItems = tmp - index, ending = emptyItems > 1 \? \"s\" : \"\", message = `<${emptyItems} empty item${ending}>`;\n if (ArrayPrototypePush(output, ctx.stylize(message, \"undefined\")), index = tmp, output.length === maxLength)\n break;\n }\n ArrayPrototypePush(output, formatProperty(ctx, value, recurseTimes, key, kArrayType)), index++;\n }\n const remaining = value.length - index;\n if (output.length !== maxLength) {\n if (remaining > 0) {\n const ending = remaining > 1 \? \"s\" : \"\", message = `<${remaining} empty item${ending}>`;\n ArrayPrototypePush(output, ctx.stylize(message, \"undefined\"));\n }\n } else if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return output;\n}, hexSlice = function(buf, start = 0, end) {\n return ArrayPrototypeJoin(ArrayPrototypeMap(buf.slice(start, end), (x) => (\"00\" + x.toString(16)).slice(-2)), \"\");\n}, formatArrayBuffer = function(ctx, value) {\n let buffer;\n try {\n buffer = new Uint8Array(value);\n } catch {\n return [ctx.stylize(\"(detached)\", \"special\")];\n }\n let str = StringPrototypeTrim(RegExpPrototypeSymbolReplace(/(.{2})/g, hexSlice(buffer, 0, MathMin(ctx.maxArrayLength, buffer.length)), \"$1 \"));\n const remaining = buffer.length - ctx.maxArrayLength;\n if (remaining > 0)\n str += ` ... ${remaining} more byte${remaining > 1 \? \"s\" : \"\"}`;\n return [`${ctx.stylize(\"[Uint8Contents]\", \"special\")}: <${str}>`];\n}, formatArray = function(ctx, value, recurseTimes) {\n const valLen = value.length, len = MathMin(MathMax(0, ctx.maxArrayLength), valLen), remaining = valLen - len, output = [];\n for (let i = 0;i < len; i++) {\n if (!ObjectPrototypeHasOwnProperty(value, i))\n return formatSpecialArray(ctx, value, recurseTimes, len, output, i);\n ArrayPrototypePush(output, formatProperty(ctx, value, recurseTimes, i, kArrayType));\n }\n if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return output;\n}, formatTypedArray = function(value, length, ctx, ignored, recurseTimes) {\n const maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length), remaining = value.length - maxLength, output = new Array(maxLength), elementFormatter = value.length > 0 && typeof value[0] === \"number\" \? formatNumber : formatBigInt;\n for (let i = 0;i < maxLength; ++i)\n output[i] = elementFormatter(ctx.stylize, value[i], ctx.numericSeparator);\n if (remaining > 0)\n output[maxLength] = remainingText(remaining);\n if (ctx.showHidden) {\n ctx.indentationLvl += 2;\n for (let key of [\"BYTES_PER_ELEMENT\", \"length\", \"byteLength\", \"byteOffset\", \"buffer\"]) {\n const str = formatValue(ctx, value[key], recurseTimes, !0);\n ArrayPrototypePush(output, `[${key}]: ${str}`);\n }\n ctx.indentationLvl -= 2;\n }\n return output;\n}, formatSet = function(value, ctx, ignored, recurseTimes) {\n const length = value.size, maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length), remaining = length - maxLength, output = [];\n ctx.indentationLvl += 2;\n let i = 0;\n for (let v of value) {\n if (i >= maxLength)\n break;\n ArrayPrototypePush(output, formatValue(ctx, v, recurseTimes)), i++;\n }\n if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return ctx.indentationLvl -= 2, output;\n}, formatMap = function(value, ctx, ignored, recurseTimes) {\n const length = value.size, maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length), remaining = length - maxLength, output = [];\n ctx.indentationLvl += 2;\n let i = 0;\n for (let { 0: k, 1: v } of value) {\n if (i >= maxLength)\n break;\n ArrayPrototypePush(output, `${formatValue(ctx, k, recurseTimes)} => ${formatValue(ctx, v, recurseTimes)}`), i++;\n }\n if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return ctx.indentationLvl -= 2, output;\n}, formatSetIterInner = function(ctx, recurseTimes, entries, state) {\n const maxArrayLength = MathMax(ctx.maxArrayLength, 0), maxLength = MathMin(maxArrayLength, entries.length), output = new Array(maxLength);\n ctx.indentationLvl += 2;\n for (let i = 0;i < maxLength; i++)\n output[i] = formatValue(ctx, entries[i], recurseTimes);\n if (ctx.indentationLvl -= 2, state === kWeak && !ctx.sorted)\n ArrayPrototypeSort(output);\n const remaining = entries.length - maxLength;\n if (remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return output;\n}, formatMapIterInner = function(ctx, recurseTimes, entries, state) {\n const maxArrayLength = MathMax(ctx.maxArrayLength, 0), len = entries.length / 2, remaining = len - maxArrayLength, maxLength = MathMin(maxArrayLength, len), output = new Array(maxLength);\n let i = 0;\n if (ctx.indentationLvl += 2, state === kWeak) {\n for (;i < maxLength; i++) {\n const pos = i * 2;\n output[i] = `${formatValue(ctx, entries[pos], recurseTimes)} => ${formatValue(ctx, entries[pos + 1], recurseTimes)}`;\n }\n if (!ctx.sorted)\n ArrayPrototypeSort(output);\n } else\n for (;i < maxLength; i++) {\n const pos = i * 2, res = [formatValue(ctx, entries[pos], recurseTimes), formatValue(ctx, entries[pos + 1], recurseTimes)];\n output[i] = reduceToSingleString(ctx, res, \"\", [\"[\", \"]\"], kArrayExtrasType, recurseTimes);\n }\n if (ctx.indentationLvl -= 2, remaining > 0)\n ArrayPrototypePush(output, remainingText(remaining));\n return output;\n}, formatWeakCollection = function(ctx) {\n return [ctx.stylize(\"<items unknown>\", \"special\")];\n}, formatWeakSet = function(ctx, value, recurseTimes) {\n const entries = previewEntries(value);\n return formatSetIterInner(ctx, recurseTimes, entries, kWeak);\n}, formatWeakMap = function(ctx, value, recurseTimes) {\n const entries = previewEntries(value);\n return formatMapIterInner(ctx, recurseTimes, entries, kWeak);\n}, formatIterator = function(braces, ctx, value, recurseTimes) {\n const { 0: entries, 1: isKeyValue } = previewEntries(value, !0);\n if (isKeyValue)\n return braces[0] = RegExpPrototypeSymbolReplace(/ Iterator] {$/, braces[0], \" Entries] {\"), formatMapIterInner(ctx, recurseTimes, entries, kMapEntries);\n return formatSetIterInner(ctx, recurseTimes, entries, kIterator);\n}, formatPromise = function(ctx, value, recurseTimes) {\n let output;\n const { 0: state, 1: result } = getPromiseDetails(value);\n if (state === kPending)\n output = [ctx.stylize(\"<pending>\", \"special\")];\n else {\n ctx.indentationLvl += 2;\n const str = formatValue(ctx, result, recurseTimes);\n ctx.indentationLvl -= 2, output = [state === kRejected \? `${ctx.stylize(\"<rejected>\", \"special\")} ${str}` : str];\n }\n return output;\n}, formatProperty = function(ctx, value, recurseTimes, key, type, desc, original = value) {\n let name, str, extra = \" \";\n if (desc ||= ObjectGetOwnPropertyDescriptor(value, key) || { value: value[key], enumerable: !0 }, desc.value !== @undefined) {\n const diff = ctx.compact !== !0 || type !== kObjectType \? 2 : 3;\n if (ctx.indentationLvl += diff, str = formatValue(ctx, desc.value, recurseTimes), diff === 3 && ctx.breakLength < getStringWidth(str, ctx.colors))\n extra = `\\n${StringPrototypeRepeat(\" \", ctx.indentationLvl)}`;\n ctx.indentationLvl -= diff;\n } else if (desc.get !== @undefined) {\n const label = desc.set !== @undefined \? \"Getter/Setter\" : \"Getter\", s = ctx.stylize;\n if (ctx.getters && (ctx.getters === !0 || ctx.getters === \"get\" && desc.set === @undefined || ctx.getters === \"set\" && desc.set !== @undefined))\n try {\n const tmp = desc.get.@call(original);\n if (ctx.indentationLvl += 2, tmp === null)\n str = `${s(`[${label}:`, \"special\")} ${s(\"null\", \"null\")}${s(\"]\", \"special\")}`;\n else if (typeof tmp === \"object\")\n str = `${s(`[${label}]`, \"special\")} ${formatValue(ctx, tmp, recurseTimes)}`;\n else {\n const primitive = formatPrimitive(s, tmp, ctx);\n str = `${s(`[${label}:`, \"special\")} ${primitive}${s(\"]\", \"special\")}`;\n }\n ctx.indentationLvl -= 2;\n } catch (err) {\n const message = `<Inspection threw (${err.message})>`;\n str = `${s(`[${label}:`, \"special\")} ${message}${s(\"]\", \"special\")}`;\n }\n else\n str = ctx.stylize(`[${label}]`, \"special\");\n } else if (desc.set !== @undefined)\n str = ctx.stylize(\"[Setter]\", \"special\");\n else\n str = ctx.stylize(\"undefined\", \"undefined\");\n if (type === kArrayType)\n return str;\n if (typeof key === \"symbol\") {\n const tmp = RegExpPrototypeSymbolReplace(strEscapeSequencesReplacer, SymbolPrototypeToString(key), escapeFn);\n name = `[${ctx.stylize(tmp, \"symbol\")}]`;\n } else if (key === \"__proto__\")\n name = \"['__proto__']\";\n else if (desc.enumerable === !1)\n name = `[${RegExpPrototypeSymbolReplace(strEscapeSequencesReplacer, key, escapeFn)}]`;\n else if (RegExpPrototypeExec(keyStrRegExp, key) !== null)\n name = ctx.stylize(key, \"name\");\n else\n name = ctx.stylize(strEscape(key), \"string\");\n return `${name}:${extra}${str}`;\n}, isBelowBreakLength = function(ctx, output, start, base) {\n let totalLength = output.length + start;\n if (totalLength + output.length > ctx.breakLength)\n return !1;\n for (let i = 0;i < output.length; i++) {\n if (ctx.colors)\n totalLength += StringPrototypeReplaceAll(output[i], /\\u001B\\[\\d\\d\?m/g, \"\").length;\n else\n totalLength += output[i].length;\n if (totalLength > ctx.breakLength)\n return !1;\n }\n return base === \"\" || !StringPrototypeIncludes(base, \"\\n\");\n}, reduceToSingleString = function(ctx, output, base, braces, extrasType, recurseTimes, value) {\n if (ctx.compact !== !0) {\n if (typeof ctx.compact === \"number\" && ctx.compact >= 1) {\n const entries = output.length;\n if (extrasType === kArrayExtrasType && entries > 6)\n output = groupArrayElements(ctx, output, value);\n if (ctx.currentDepth - recurseTimes < ctx.compact && entries === output.length) {\n const start = output.length + ctx.indentationLvl + braces[0].length + base.length + 10;\n if (isBelowBreakLength(ctx, output, start, base)) {\n const joinedOutput = ArrayPrototypeJoin(output, \", \");\n if (!StringPrototypeIncludes(joinedOutput, \"\\n\"))\n return `${base \? `${base} ` : \"\"}${braces[0]} ${joinedOutput}` + ` ${braces[1]}`;\n }\n }\n }\n const indentation2 = `\\n${StringPrototypeRepeat(\" \", ctx.indentationLvl)}`;\n return `${base \? `${base} ` : \"\"}${braces[0]}${indentation2} ` + `${ArrayPrototypeJoin(output, `,${indentation2} `)}${indentation2}${braces[1]}`;\n }\n if (isBelowBreakLength(ctx, output, 0, base))\n return `${braces[0]}${base \? ` ${base}` : \"\"} ${ArrayPrototypeJoin(output, \", \")} ` + braces[1];\n const indentation = StringPrototypeRepeat(\" \", ctx.indentationLvl), ln = base === \"\" && braces[0].length === 1 \? \" \" : `${base \? ` ${base}` : \"\"}\\n${indentation} `;\n return `${braces[0]}${ln}${ArrayPrototypeJoin(output, `,\\n${indentation} `)} ${braces[1]}`;\n}, hasBuiltInToString = function(value) {\n const proxyTarget = getProxyDetails(value, !1);\n if (proxyTarget !== @undefined) {\n if (proxyTarget === null)\n return !0;\n value = proxyTarget;\n }\n if (typeof value.toString !== \"function\")\n return !0;\n if (ObjectPrototypeHasOwnProperty(value, \"toString\"))\n return !1;\n let pointer = value;\n do\n pointer = ObjectGetPrototypeOf(pointer);\n while (!ObjectPrototypeHasOwnProperty(pointer, \"toString\"));\n const descriptor = ObjectGetOwnPropertyDescriptor(pointer, \"constructor\");\n return descriptor !== @undefined && typeof descriptor.value === \"function\" && builtInObjects.has(descriptor.value.name);\n}, tryStringify = function(arg) {\n try {\n return JSONStringify(arg);\n } catch (err) {\n if (!CIRCULAR_ERROR_MESSAGE)\n try {\n const a = {};\n a.a = a, JSONStringify(a);\n } catch (circularError) {\n CIRCULAR_ERROR_MESSAGE = firstErrorLine(circularError);\n }\n if (err.name === \"TypeError\" && firstErrorLine(err) === CIRCULAR_ERROR_MESSAGE)\n return \"[Circular]\";\n throw err;\n }\n}, format = function(...args) {\n return formatWithOptionsInternal(@undefined, args);\n}, formatWithOptions = function(inspectOptions, ...args) {\n return validateObject(inspectOptions, \"inspectOptions\", { allowArray: !0 }), formatWithOptionsInternal(inspectOptions, args);\n}, formatNumberNoColor = function(number, options) {\n return formatNumber(stylizeNoColor, number, options\?.numericSeparator \?\? inspectDefaultOptions.numericSeparator);\n}, formatBigIntNoColor = function(bigint, options) {\n return formatBigInt(stylizeNoColor, bigint, options\?.numericSeparator \?\? inspectDefaultOptions.numericSeparator);\n}, formatWithOptionsInternal = function(inspectOptions, args) {\n const first = args[0];\n let a = 0, str = \"\", join = \"\";\n if (typeof first === \"string\") {\n if (args.length === 1)\n return first;\n let tempStr, lastPos = 0;\n for (let i = 0;i < first.length - 1; i++)\n if (StringPrototypeCharCodeAt(first, i) === 37) {\n const nextChar = StringPrototypeCharCodeAt(first, ++i);\n if (a + 1 !== args.length) {\n switch (nextChar) {\n case 115: {\n const tempArg = args[++a];\n if (typeof tempArg === \"number\")\n tempStr = formatNumberNoColor(tempArg, inspectOptions);\n else if (typeof tempArg === \"bigint\")\n tempStr = formatBigIntNoColor(tempArg, inspectOptions);\n else if (typeof tempArg !== \"object\" || tempArg === null || !hasBuiltInToString(tempArg))\n tempStr = String(tempArg);\n else\n tempStr = inspect(tempArg, {\n ...inspectOptions,\n compact: 3,\n colors: !1,\n depth: 0\n });\n break;\n }\n case 106:\n tempStr = tryStringify(args[++a]);\n break;\n case 100: {\n const tempNum = args[++a];\n if (typeof tempNum === \"bigint\")\n tempStr = formatBigIntNoColor(tempNum, inspectOptions);\n else if (typeof tempNum === \"symbol\")\n tempStr = \"NaN\";\n else\n tempStr = formatNumberNoColor(Number(tempNum), inspectOptions);\n break;\n }\n case 79:\n tempStr = inspect(args[++a], inspectOptions);\n break;\n case 111:\n tempStr = inspect(args[++a], {\n ...inspectOptions,\n showHidden: !0,\n showProxy: !0,\n depth: 4\n });\n break;\n case 105: {\n const tempInteger = args[++a];\n if (typeof tempInteger === \"bigint\")\n tempStr = formatBigIntNoColor(tempInteger, inspectOptions);\n else if (typeof tempInteger === \"symbol\")\n tempStr = \"NaN\";\n else\n tempStr = formatNumberNoColor(NumberParseInt(tempInteger), inspectOptions);\n break;\n }\n case 102: {\n const tempFloat = args[++a];\n if (typeof tempFloat === \"symbol\")\n tempStr = \"NaN\";\n else\n tempStr = formatNumberNoColor(NumberParseFloat(tempFloat), inspectOptions);\n break;\n }\n case 99:\n a += 1, tempStr = \"\";\n break;\n case 37:\n str += StringPrototypeSlice(first, lastPos, i), lastPos = i + 1;\n continue;\n default:\n continue;\n }\n if (lastPos !== i - 1)\n str += StringPrototypeSlice(first, lastPos, i - 1);\n str += tempStr, lastPos = i + 1;\n } else if (nextChar === 37)\n str += StringPrototypeSlice(first, lastPos, i), lastPos = i + 1;\n }\n if (lastPos !== 0) {\n if (a++, join = \" \", lastPos < first.length)\n str += StringPrototypeSlice(first, lastPos);\n }\n }\n while (a < args.length) {\n const value = args[a];\n str += join, str += typeof value !== \"string\" \? inspect(value, inspectOptions) : value, join = \" \", a++;\n }\n return str;\n}, isZeroWidthCodePoint = function(code) {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, stripVTControlCharacters = function(str) {\n if (typeof str !== \"string\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"str\", \"string\", str);\n return RegExpPrototypeSymbolReplace(ansi, str, \"\");\n}, getOwnNonIndexProperties = function(a, filter = 2) {\n const desc = ObjectGetOwnPropertyDescriptors(a), ret = [];\n for (let [k, v] of ObjectEntries(desc))\n if (!RegExpPrototypeTest(/^(0|[1-9][0-9]*)$/, k) || NumberParseInt(k, 10) >= 4294967295)\n if (filter === 2 && !v.enumerable)\n continue;\n else\n ArrayPrototypePush(ret, k);\n for (let s of ObjectGetOwnPropertySymbols(a)) {\n const v = ObjectGetOwnPropertyDescriptor(a, s);\n if (filter === 2 && !v.enumerable)\n continue;\n ArrayPrototypePush(ret, s);\n }\n return ret;\n}, getPromiseDetails = function(promise) {\n const state = @getPromiseInternalField(promise, @promiseFieldFlags) & @promiseStateMask;\n if (state !== @promiseStatePending)\n return [\n state === @promiseStateRejected \? kRejected : kFulfilled,\n @getPromiseInternalField(promise, @promiseFieldReactionsOrResult)\n ];\n return [kPending, @undefined];\n}, getProxyDetails = function(proxy, withHandler = !0) {\n if (!@isProxyObject(proxy))\n return @undefined;\n const handler = @getProxyInternalField(proxy, @proxyFieldHandler), target = handler === null \? null : @getProxyInternalField(proxy, @proxyFieldTarget);\n if (withHandler)\n return [target, handler];\n else\n return target;\n}, previewEntries = function(val, isIterator = !1) {\n if (isIterator) {\n const iteratedObject = @getInternalField(val, 1), kind = @getInternalField(val, 2), isEntries = kind === 2;\n if (@isMap(iteratedObject))\n if (isEntries)\n return [ArrayPrototypeFlat(ArrayFrom(iteratedObject)), !0];\n else if (kind === 1)\n return [ArrayFrom(MapPrototypeValues(iteratedObject)), !1];\n else\n return [ArrayFrom(MapPrototypeKeys(iteratedObject)), !1];\n else if (@isSet(iteratedObject))\n if (isEntries)\n return [ArrayPrototypeFlat(ArrayFrom(SetPrototypeEntries(iteratedObject))), !0];\n else\n return [ArrayFrom(iteratedObject), !1];\n else\n throw new Error(\"previewEntries(): Invalid iterator received\");\n }\n if (isWeakMap(val))\n return [];\n if (isWeakSet(val))\n return [];\n else\n throw new Error(\"previewEntries(): Invalid object received\");\n}, internalGetConstructorName = function(val) {\n if (!val || typeof val !== \"object\")\n throw new Error(\"Invalid object\");\n if (val.constructor\?.name)\n return val.constructor.name;\n const str = ObjectPrototypeToString(val), m = StringPrototypeMatch(str, /^\\[object ([^\\]]+)\\]/);\n return m \? m[1] : \"Object\";\n}, $, { pathToFileURL } = @getInternalField(@internalModuleRegistry, 47) || @createInternalModuleById(47), primordials = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), {\n Array,\n ArrayFrom,\n ArrayIsArray,\n ArrayPrototypeFilter,\n ArrayPrototypeFlat,\n ArrayPrototypeForEach,\n ArrayPrototypeIncludes,\n ArrayPrototypeIndexOf,\n ArrayPrototypeJoin,\n ArrayPrototypeMap,\n ArrayPrototypePop,\n ArrayPrototypePush,\n ArrayPrototypePushApply,\n ArrayPrototypeSlice,\n ArrayPrototypeSplice,\n ArrayPrototypeSort,\n ArrayPrototypeUnshift,\n BigIntPrototypeValueOf,\n BooleanPrototypeValueOf,\n DatePrototypeGetTime,\n DatePrototypeToISOString,\n DatePrototypeToString,\n ErrorCaptureStackTrace,\n ErrorPrototypeToString,\n FunctionPrototypeBind,\n FunctionPrototypeToString,\n JSONStringify,\n MapPrototypeGetSize,\n MapPrototypeEntries,\n MapPrototypeValues,\n MapPrototypeKeys,\n MathFloor,\n MathMax,\n MathMin,\n MathRound,\n MathSqrt,\n MathTrunc,\n Number,\n NumberIsFinite,\n NumberIsNaN,\n NumberParseFloat,\n NumberParseInt,\n NumberPrototypeToString,\n NumberPrototypeValueOf,\n Object,\n ObjectAssign,\n ObjectDefineProperty,\n ObjectEntries,\n ObjectGetOwnPropertyDescriptor,\n ObjectGetOwnPropertyDescriptors,\n ObjectGetOwnPropertyNames,\n ObjectGetOwnPropertySymbols,\n ObjectGetPrototypeOf,\n ObjectIs,\n ObjectKeys,\n ObjectPrototypeHasOwnProperty,\n ObjectPrototypePropertyIsEnumerable,\n ObjectPrototypeToString,\n ObjectSeal,\n ObjectSetPrototypeOf,\n ReflectApply,\n ReflectOwnKeys,\n RegExp,\n RegExpPrototypeExec,\n RegExpPrototypeSymbolReplace,\n RegExpPrototypeSymbolSplit,\n RegExpPrototypeTest,\n RegExpPrototypeToString,\n SafeStringIterator,\n SafeMap,\n SafeSet,\n SetPrototypeEntries,\n SetPrototypeGetSize,\n SetPrototypeValues,\n String,\n StringPrototypeCharCodeAt,\n StringPrototypeCodePointAt,\n StringPrototypeIncludes,\n StringPrototypeIndexOf,\n StringPrototypeLastIndexOf,\n StringPrototypeMatch,\n StringPrototypeNormalize,\n StringPrototypePadEnd,\n StringPrototypePadStart,\n StringPrototypeRepeat,\n StringPrototypeReplaceAll,\n StringPrototypeSlice,\n StringPrototypeSplit,\n StringPrototypeEndsWith,\n StringPrototypeStartsWith,\n StringPrototypeToLowerCase,\n StringPrototypeTrim,\n StringPrototypeValueOf,\n SymbolPrototypeToString,\n SymbolPrototypeValueOf,\n SymbolIterator,\n SymbolToStringTag,\n TypedArrayPrototypeGetLength,\n TypedArrayPrototypeGetSymbolToStringTag,\n Uint8Array\n} = primordials, customInspectSymbol = Symbol.for(\"nodejs.util.inspect.custom\"), kPending = Symbol(\"kPending\"), kFulfilled = Symbol(\"kFulfilled\"), kRejected = Symbol(\"kRejected\");\nvar isAsyncFunction = (v) => typeof v === \"function\" && StringPrototypeStartsWith(FunctionPrototypeToString(v), \"async\"), isGeneratorFunction = (v) => typeof v === \"function\" && StringPrototypeMatch(FunctionPrototypeToString(v), /^(async\\s+)\?function *\\*/), isBigIntObject = checkBox(BigInt), isSymbolObject = checkBox(Symbol), {\n isAnyArrayBuffer,\n isArrayBuffer,\n isArgumentsObject,\n isBoxedPrimitive: _native_isBoxedPrimitive,\n isDataView,\n isExternal,\n isMap,\n isMapIterator,\n isModuleNamespaceObject,\n isNativeError,\n isPromise,\n isSet,\n isSetIterator,\n isWeakMap,\n isWeakSet,\n isRegExp,\n isDate,\n isTypedArray,\n isStringObject,\n isNumberObject,\n isBooleanObject\n} = @requireNativeModule(\"util/types\");\n//! The native versions of the commented out functions are currently buggy, so we use the polyfills above for now.\n//! temp workaround to apply is{BigInt,Symbol}Object fix\nvar isBoxedPrimitive = (val) => isBigIntObject(val) || isSymbolObject(val) || _native_isBoxedPrimitive(val);\n\nclass AssertionError extends Error {\n constructor(message, isForced = !1) {\n super(message);\n this.name = \"AssertionError\", this.code = \"ERR_ASSERTION\", this.operator = \"==\", this.generatedMessage = !isForced, this.actual = isForced && @undefined, this.expected = !isForced || @undefined;\n }\n}\nvar codes = {};\n{\n const kTypes = [\n \"string\",\n \"function\",\n \"number\",\n \"object\",\n \"Function\",\n \"Object\",\n \"boolean\",\n \"bigint\",\n \"symbol\"\n ], classRegExp = /^([A-Z][a-z0-9]*)+$/, messages = new SafeMap;\n messages.set(\"ERR_INVALID_ARG_TYPE\", (name, expected, actual) => {\n if (assert(typeof name === \"string\", \"'name' must be a string\"), !ArrayIsArray(expected))\n expected = [expected];\n let msg = \"The \";\n if (StringPrototypeEndsWith(name, \" argument\"))\n msg += `${name} `;\n else\n msg += `\"${name}\" ${StringPrototypeIncludes(name, \".\") \? \"property\" : \"argument\"} `;\n msg += \"must be \";\n const types = [], instances = [], other = [];\n for (let value of expected)\n if (assert(typeof value === \"string\", \"All expected entries have to be of type string\"), ArrayPrototypeIncludes(kTypes, value))\n ArrayPrototypePush(types, StringPrototypeToLowerCase(value));\n else if (RegExpPrototypeTest(classRegExp, value))\n ArrayPrototypePush(instances, value);\n else\n assert(value !== \"object\", 'The value \"object\" should be written as \"Object\"'), ArrayPrototypePush(other, value);\n if (instances.length > 0) {\n const pos = ArrayPrototypeIndexOf(types, \"object\");\n if (pos !== -1)\n ArrayPrototypeSplice(types, pos, 1), ArrayPrototypePush(instances, \"Object\");\n }\n if (types.length > 0) {\n if (types.length > 2)\n msg += `one of type ${ArrayPrototypeJoin(types, \", \")}, or ${ArrayPrototypePop(types)}`;\n else if (types.length === 2)\n msg += `one of type ${types[0]} or ${types[1]}`;\n else\n msg += `of type ${types[0]}`;\n if (instances.length > 0 || other.length > 0)\n msg += \" or \";\n }\n if (instances.length > 0) {\n if (instances.length > 2)\n msg += `an instance of ${ArrayPrototypeJoin(instances, \", \")}, or ${ArrayPrototypePop(instances)}`;\n else\n msg += `an instance of ${instances[0]}` + (instances.length === 2 \? ` or ${instances[1]}` : \"\");\n if (other.length > 0)\n msg += \" or \";\n }\n if (other.length > 0)\n if (other.length > 2) {\n const last = ArrayPrototypePop(other);\n msg += `one of ${ArrayPrototypeJoin(other, \", \")}, or ${last}`;\n } else if (other.length === 2)\n msg += `one of ${other[0]} or ${other[1]}`;\n else {\n if (StringPrototypeToLowerCase(other[0]) !== other[0])\n msg += \"an \";\n msg += `${other[0]}`;\n }\n if (actual == null)\n msg += `. Received ${actual}`;\n else if (typeof actual === \"function\" && actual.name)\n msg += `. Received function ${actual.name}`;\n else if (typeof actual === \"object\")\n if (actual.constructor && actual.constructor.name)\n msg += `. Received an instance of ${actual.constructor.name}`;\n else\n msg += `. Received ${inspect(actual, { depth: -1 })}`;\n else {\n let inspected = inspect(actual, { colors: !1 });\n if (inspected.length > 25)\n inspected = `${StringPrototypeSlice(inspected, 0, 25)}...`;\n msg += `. Received type ${typeof actual} (${inspected})`;\n }\n return msg;\n }), codes[\"ERR_INVALID_ARG_TYPE\"] = function NodeError(...args) {\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n const error = @makeTypeError();\n Error.stackTraceLimit = limit;\n const msg = messages.get(\"ERR_INVALID_ARG_TYPE\");\n assert(typeof msg === \"function\"), assert(msg.length <= args.length, `Code: ERR_INVALID_ARG_TYPE; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`);\n const message = ReflectApply(msg, error, args);\n ObjectDefineProperty(error, \"message\", { value: message, enumerable: !1, writable: !0, configurable: !0 }), ObjectDefineProperty(error, \"toString\", {\n value() {\n return `${this.name} [ERR_INVALID_ARG_TYPE]: ${this.message}`;\n },\n enumerable: !1,\n writable: !0,\n configurable: !0\n });\n let err = error;\n const userStackTraceLimit = Error.stackTraceLimit;\n return Error.stackTraceLimit = @Infinity, ErrorCaptureStackTrace(err), Error.stackTraceLimit = userStackTraceLimit, err.name = `${TypeError.name} [ERR_INVALID_ARG_TYPE]`, err.stack, delete err.name, error.code = \"ERR_INVALID_ARG_TYPE\", error;\n };\n}\nvar validateObject = (value, name, allowArray = !1) => {\n if (value === null || !allowArray && ArrayIsArray(value) || typeof value !== \"object\" && typeof value !== \"function\")\n throw new codes.ERR_INVALID_ARG_TYPE(name, \"Object\", value);\n}, builtInObjects = new SafeSet(ArrayPrototypeFilter(ObjectGetOwnPropertyNames(globalThis), (e) => RegExpPrototypeExec(/^[A-Z][a-zA-Z0-9]+$/, e) !== null)), isUndetectableObject = (v) => typeof v === \"undefined\" && v !== @undefined, ERROR_STACK_OVERFLOW_MSG = \"Maximum call stack size exceeded.\", inspectDefaultOptions = ObjectSeal({\n showHidden: !1,\n depth: 2,\n colors: !1,\n customInspect: !0,\n showProxy: !1,\n maxArrayLength: 100,\n maxStringLength: 1e4,\n breakLength: 80,\n compact: 3,\n sorted: !1,\n getters: !1,\n numericSeparator: !1\n}), inspectReplDefaults = ObjectSeal({\n ...inspectDefaultOptions,\n colors: Bun.enableANSIColors,\n showProxy: !0\n}), kObjectType = 0, kArrayType = 1, kArrayExtrasType = 2, strEscapeSequencesRegExp, strEscapeSequencesReplacer, strEscapeSequencesRegExpSingle, strEscapeSequencesReplacerSingle, extractedSplitNewLines;\ntry {\n strEscapeSequencesRegExp = new RegExp(\"[\\\\x00-\\\\x1f\\\\x27\\\\x5c\\\\x7f-\\\\x9f]|[\\\\ud800-\\\\udbff](\?![\\\\udc00-\\\\udfff])|(\?<![\\\\ud800-\\\\udbff])[\\\\udc00-\\\\udfff]\"), strEscapeSequencesReplacer = new RegExp(\"[\\0-\\\\x1f\\\\x27\\\\x5c\\\\x7f-\\\\x9f]|[\\\\ud800-\\\\udbff](\?![\\\\udc00-\\\\udfff])|(\?<![\\\\ud800-\\\\udbff])[\\\\udc00-\\\\udfff]\", \"g\"), strEscapeSequencesRegExpSingle = new RegExp(\"[\\\\x00-\\\\x1f\\\\x5c\\\\x7f-\\\\x9f]|[\\\\ud800-\\\\udbff](\?![\\\\udc00-\\\\udfff])|(\?<![\\\\ud800-\\\\udbff])[\\\\udc00-\\\\udfff]\"), strEscapeSequencesReplacerSingle = new RegExp(\"[\\\\x00-\\\\x1f\\\\x5c\\\\x7f-\\\\x9f]|[\\\\ud800-\\\\udbff](\?![\\\\udc00-\\\\udfff])|(\?<![\\\\ud800-\\\\udbff])[\\\\udc00-\\\\udfff]\", \"g\");\n const extractedNewLineRe = new RegExp(\"(\?<=\\\\n)\");\n extractedSplitNewLines = (value) => RegExpPrototypeSymbolSplit(extractedNewLineRe, value);\n} catch {\n strEscapeSequencesRegExp = /[\\x00-\\x1f\\x27\\x5c\\x7f-\\x9f]/, strEscapeSequencesReplacer = /[\\x00-\\x1f\\x27\\x5c\\x7f-\\x9f]/g, strEscapeSequencesRegExpSingle = /[\\x00-\\x1f\\x5c\\x7f-\\x9f]/, strEscapeSequencesReplacerSingle = /[\\x00-\\x1f\\x5c\\x7f-\\x9f]/g, extractedSplitNewLines = (value) => {\n const lines = RegExpPrototypeSymbolSplit(/\\n/, value), last = ArrayPrototypePop(lines), nlLines = ArrayPrototypeMap(lines, (line) => line + \"\\n\");\n if (last !== \"\")\n nlLines.push(last);\n return nlLines;\n };\n}\nvar keyStrRegExp = /^[a-zA-Z_][a-zA-Z_0-9]*$/, numberRegExp = /^(0|[1-9][0-9]*)$/, coreModuleRegExp = /^ {4}at (\?:[^/\\\\(]+ \\(|)node:(.+):\\d+:\\d+\\)\?$/, nodeModulesRegExp = /[/\\\\]node_modules[/\\\\](.+\?)(\?=[/\\\\])/g, classRegExp = /^(\\s+[^(]*\?)\\s*{/, stripCommentsRegExp = /(\\/\\/.*\?\\n)|(\\/\\*(.|\\n)*\?\\*\\/)/g, kMinLineLength = 16, kWeak = 0, kIterator = 1, kMapEntries = 2, meta = [\n \"\\\\x00\",\n \"\\\\x01\",\n \"\\\\x02\",\n \"\\\\x03\",\n \"\\\\x04\",\n \"\\\\x05\",\n \"\\\\x06\",\n \"\\\\x07\",\n \"\\\\b\",\n \"\\\\t\",\n \"\\\\n\",\n \"\\\\x0B\",\n \"\\\\f\",\n \"\\\\r\",\n \"\\\\x0E\",\n \"\\\\x0F\",\n \"\\\\x10\",\n \"\\\\x11\",\n \"\\\\x12\",\n \"\\\\x13\",\n \"\\\\x14\",\n \"\\\\x15\",\n \"\\\\x16\",\n \"\\\\x17\",\n \"\\\\x18\",\n \"\\\\x19\",\n \"\\\\x1A\",\n \"\\\\x1B\",\n \"\\\\x1C\",\n \"\\\\x1D\",\n \"\\\\x1E\",\n \"\\\\x1F\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\\\\'\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\\\\\\\\\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\\\\x7F\",\n \"\\\\x80\",\n \"\\\\x81\",\n \"\\\\x82\",\n \"\\\\x83\",\n \"\\\\x84\",\n \"\\\\x85\",\n \"\\\\x86\",\n \"\\\\x87\",\n \"\\\\x88\",\n \"\\\\x89\",\n \"\\\\x8A\",\n \"\\\\x8B\",\n \"\\\\x8C\",\n \"\\\\x8D\",\n \"\\\\x8E\",\n \"\\\\x8F\",\n \"\\\\x90\",\n \"\\\\x91\",\n \"\\\\x92\",\n \"\\\\x93\",\n \"\\\\x94\",\n \"\\\\x95\",\n \"\\\\x96\",\n \"\\\\x97\",\n \"\\\\x98\",\n \"\\\\x99\",\n \"\\\\x9A\",\n \"\\\\x9B\",\n \"\\\\x9C\",\n \"\\\\x9D\",\n \"\\\\x9E\",\n \"\\\\x9F\"\n], getStringWidth;\ninspect.custom = customInspectSymbol;\nObjectDefineProperty(inspect, \"defaultOptions\", {\n __proto__: null,\n get() {\n return inspectDefaultOptions;\n },\n set(options) {\n return validateObject(options, \"options\"), ObjectAssign(inspectDefaultOptions, options);\n }\n});\nObjectDefineProperty(inspect, \"replDefaults\", {\n __proto__: null,\n get() {\n return inspectReplDefaults;\n },\n set(options) {\n return validateObject(options, \"options\"), ObjectAssign(inspectReplDefaults, options);\n }\n});\nvar defaultFG = 39, defaultBG = 49;\ninspect.colors = {\n __proto__: null,\n reset: [0, 0],\n bold: [1, 22],\n dim: [2, 22],\n italic: [3, 23],\n underline: [4, 24],\n blink: [5, 25],\n inverse: [7, 27],\n hidden: [8, 28],\n strikethrough: [9, 29],\n doubleunderline: [21, 24],\n black: [30, defaultFG],\n red: [31, defaultFG],\n green: [32, defaultFG],\n yellow: [33, defaultFG],\n blue: [34, defaultFG],\n magenta: [35, defaultFG],\n cyan: [36, defaultFG],\n white: [37, defaultFG],\n bgBlack: [40, defaultBG],\n bgRed: [41, defaultBG],\n bgGreen: [42, defaultBG],\n bgYellow: [43, defaultBG],\n bgBlue: [44, defaultBG],\n bgMagenta: [45, defaultBG],\n bgCyan: [46, defaultBG],\n bgWhite: [47, defaultBG],\n framed: [51, 54],\n overlined: [53, 55],\n gray: [90, defaultFG],\n redBright: [91, defaultFG],\n greenBright: [92, defaultFG],\n yellowBright: [93, defaultFG],\n blueBright: [94, defaultFG],\n magentaBright: [95, defaultFG],\n cyanBright: [96, defaultFG],\n whiteBright: [97, defaultFG],\n bgGray: [100, defaultBG],\n bgRedBright: [101, defaultBG],\n bgGreenBright: [102, defaultBG],\n bgYellowBright: [103, defaultBG],\n bgBlueBright: [104, defaultBG],\n bgMagentaBright: [105, defaultBG],\n bgCyanBright: [106, defaultBG],\n bgWhiteBright: [107, defaultBG]\n};\ndefineColorAlias(\"gray\", \"grey\");\ndefineColorAlias(\"gray\", \"blackBright\");\ndefineColorAlias(\"bgGray\", \"bgGrey\");\ndefineColorAlias(\"bgGray\", \"bgBlackBright\");\ndefineColorAlias(\"dim\", \"faint\");\ndefineColorAlias(\"strikethrough\", \"crossedout\");\ndefineColorAlias(\"strikethrough\", \"strikeThrough\");\ndefineColorAlias(\"strikethrough\", \"crossedOut\");\ndefineColorAlias(\"hidden\", \"conceal\");\ndefineColorAlias(\"inverse\", \"swapColors\");\ndefineColorAlias(\"inverse\", \"swapcolors\");\ndefineColorAlias(\"doubleunderline\", \"doubleUnderline\");\ninspect.styles = {\n __proto__: null,\n special: \"cyan\",\n number: \"yellow\",\n bigint: \"yellow\",\n boolean: \"yellow\",\n undefined: \"grey\",\n null: \"bold\",\n string: \"green\",\n symbol: \"green\",\n date: \"magenta\",\n regexp: \"red\",\n module: \"underline\"\n};\nvar remainingText = (remaining) => `... ${remaining} more item${remaining > 1 \? \"s\" : \"\"}`, firstErrorLine = (error) => StringPrototypeSplit(error.message, \"\\n\", 1)[0], CIRCULAR_ERROR_MESSAGE;\n{\n getStringWidth = function getStringWidth(str, removeControlChars = !0) {\n let width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize(str, \"NFC\");\n for (let char of new SafeStringIterator(str)) {\n const code = StringPrototypeCodePointAt(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n };\n const isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n };\n}\nvar ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new RegExp(ansiPattern, \"g\");\n$ = {\n inspect,\n format,\n formatWithOptions,\n stripVTControlCharacters\n};\n//! non-standard properties, should these be kept\? (not currently exposed)\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeAssertCode = "(function (){\"use strict\";// src/js/out/tmp/node/assert.ts\nvar CallTracker = function() {\n throw new Error(\"CallTracker is not supported yet\");\n}, util = @getInternalField(@internalModuleRegistry, 46) || @createInternalModuleById(46), isDeepEqual = Bun.deepEquals, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_errors = __commonJS({\n \"assert/build/internal/errors.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n var codes = {}, assert, util2;\n function createErrorType(code, message, Base) {\n Base || (Base = Error);\n function getMessage(arg1, arg2, arg3) {\n return typeof message == \"string\" \? message : message(arg1, arg2, arg3);\n }\n var NodeError = function(_Base) {\n _inherits(NodeError2, _Base);\n function NodeError2(arg1, arg2, arg3) {\n var _this;\n return _classCallCheck(this, NodeError2), _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError2).call(this, getMessage(arg1, arg2, arg3))), _this.code = code, _this;\n }\n return NodeError2;\n }(Base);\n codes[code] = NodeError;\n }\n function oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n return expected = expected.map(function(i) {\n return String(i);\n }), len > 2 \? \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1] : len === 2 \? \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]) : \"of \".concat(thing, \" \").concat(expected[0]);\n } else\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n function startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 \? 0 : +pos, search.length) === search;\n }\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function includes(str, search, start) {\n return typeof start != \"number\" && (start = 0), start + search.length > str.length \? !1 : str.indexOf(search, start) !== -1;\n }\n createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError), createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n assert === void 0 && (assert = require_assert()), assert(typeof name == \"string\", \"'name' must be a string\");\n var determiner;\n typeof expected == \"string\" && startsWith(expected, \"not \") \? (determiner = \"must not be\", expected = expected.replace(/^not /, \"\")) : determiner = \"must be\";\n var msg;\n if (endsWith(name, \" argument\"))\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n else {\n var type = includes(name, \".\") \? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n }\n return msg += \". Received type \".concat(_typeof(actual)), msg;\n }, TypeError), createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== void 0 \? arguments[2] : \"is invalid\", inspected = util2.inspect(value);\n return inspected.length > 128 && (inspected = \"\".concat(inspected.slice(0, 128), \"...\")), \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n }, TypeError, RangeError), createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n return value && value.constructor && value.constructor.name \? type = \"instance of \".concat(value.constructor.name) : type = \"type \".concat(_typeof(value)), \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n }, TypeError), createErrorType(\"ERR_MISSING_ARGS\", function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n assert === void 0 && (assert = require_assert()), assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \", len = args.length;\n switch (args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n }), len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \"), msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n }, TypeError), module2.exports.codes = codes;\n }\n}), require_assertion_error = __commonJS({\n \"assert/build/internal/assert/assertion_error.js\"(exports, module2) {\n function _objectSpread(target) {\n for (var i = 1;i < arguments.length; i++) {\n var source = arguments[i] != null \? arguments[i] : {}, ownKeys = Object.keys(source);\n typeof Object.getOwnPropertySymbols == \"function\" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }))), ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n }\n function _defineProperty(obj, key, value) {\n return (key in obj) \? Object.defineProperty(obj, key, {\n value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : obj[key] = value, obj;\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _defineProperties(target, props) {\n for (var i = 0;i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, (\"value\" in descriptor) && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map == \"function\" \? new Map : void 0;\n return _wrapNativeSuper = function(Class2) {\n if (Class2 === null || !_isNativeFunction(Class2))\n return Class2;\n if (typeof Class2 != \"function\")\n @throwTypeError(\"Super expression must either be null or a function\");\n if (typeof _cache != \"undefined\") {\n if (_cache.has(Class2))\n return _cache.get(Class2);\n _cache.set(Class2, Wrapper);\n }\n function Wrapper() {\n return _construct(Class2, arguments, _getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(Class2.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), _setPrototypeOf(Wrapper, Class2);\n }, _wrapNativeSuper(Class);\n }\n function isNativeReflectConstruct() {\n if (typeof Reflect == \"undefined\" || !Reflect.construct || Reflect.construct.sham)\n return !1;\n if (typeof Proxy == \"function\")\n return !0;\n try {\n return Date.prototype.toString.call(Reflect.construct(Date, [], function() {\n })), !0;\n } catch {\n return !1;\n }\n }\n function _construct(Parent, args, Class) {\n return isNativeReflectConstruct() \? _construct = Reflect.construct : _construct = function(Parent2, args2, Class2) {\n var a = [null];\n a.push.apply(a, args2);\n var Constructor = Function.bind.apply(Parent2, a), instance = new Constructor;\n return Class2 && _setPrototypeOf(instance, Class2.prototype), instance;\n }, _construct.apply(null, arguments);\n }\n function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n var inspect = util.inspect, _require2 = require_errors(), ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function repeat(str, count) {\n if (count = Math.floor(count), str.length == 0 || count == 0)\n return \"\";\n var maxCount = str.length * count;\n for (count = Math.floor(Math.log(count) / Math.log(2));count; )\n str += str, count--;\n return str += str.substring(0, maxCount - str.length), str;\n }\n var blue = \"\", green = \"\", red = \"\", white = \"\", kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n }, kMaxShortLength = 10;\n function copyError(source) {\n var keys = Object.keys(source), target = Object.create(Object.getPrototypeOf(source));\n return keys.forEach(function(key) {\n target[key] = source[key];\n }), Object.defineProperty(target, \"message\", {\n value: source.message\n }), target;\n }\n function inspectValue(val) {\n return inspect(val, {\n compact: !1,\n customInspect: !1,\n depth: 1000,\n maxArrayLength: Infinity,\n showHidden: !1,\n breakLength: Infinity,\n showProxy: !1,\n sorted: !0,\n getters: !0\n });\n }\n function createErrDiff(actual, expected, operator) {\n var other = \"\", res = \"\", lastPos = 0, end = \"\", skipped = !1, actualInspected = inspectValue(actual), actualLines = actualInspected.split(`\n`), expectedLines = inspectValue(expected).split(`\n`), i = 0, indicator = \"\";\n if (operator === \"strictEqual\" && _typeof(actual) === \"object\" && _typeof(expected) === \"object\" && actual !== null && expected !== null && (operator = \"strictEqualObject\"), actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== \"object\" || actual === null) && (_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0))\n return \"\".concat(kReadableOperator[operator], `\n\n`) + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], `\n`);\n } else if (operator !== \"strictEqualObject\") {\n var maxLength = process.stderr && process.stderr.isTTY \? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n for (;actualLines[0][i] === expectedLines[0][i]; )\n i++;\n i > 2 && (indicator = `\n `.concat(repeat(\" \", i), \"^\"), i = 0);\n }\n }\n }\n for (var a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];a === b && (i++ < 2 \? end = `\n `.concat(a).concat(end) : other = a, actualLines.pop(), expectedLines.pop(), !(actualLines.length === 0 || expectedLines.length === 0)); )\n a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n if (maxLines === 0) {\n var _actualLines = actualInspected.split(`\n`);\n if (_actualLines.length > 30)\n for (_actualLines[26] = \"\".concat(blue, \"...\").concat(white);_actualLines.length > 27; )\n _actualLines.pop();\n return \"\".concat(kReadableOperator.notIdentical, `\n\n`).concat(_actualLines.join(`\n`), `\n`);\n }\n i > 3 && (end = `\n`.concat(blue, \"...\").concat(white).concat(end), skipped = !0), other !== \"\" && (end = `\n `.concat(other).concat(end), other = \"\");\n var printedLines = 0, msg = kReadableOperator[operator] + `\n`.concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white), skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0;i < maxLines; i++) {\n var cur = i - lastPos;\n if (actualLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(expectedLines[i - 2]), printedLines++), res += `\n `.concat(expectedLines[i - 1]), printedLines++), lastPos = i, other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]), printedLines++;\n else if (expectedLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLines[i]), printedLines++;\n else {\n var expectedLine = expectedLines[i], actualLine = actualLines[i], divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n divergingLines && endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine && (divergingLines = !1, actualLine += \",\"), divergingLines \? (cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLine), other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLine), printedLines += 2) : (res += other, other = \"\", (cur === 1 || i === 0) && (res += `\n `.concat(actualLine), printedLines++));\n }\n if (printedLines > 20 && i < maxLines - 2)\n return \"\".concat(msg).concat(skippedMsg, `\n`).concat(res, `\n`).concat(blue, \"...\").concat(white).concat(other, `\n`) + \"\".concat(blue, \"...\").concat(white);\n }\n return \"\".concat(msg).concat(skipped \? skippedMsg : \"\", `\n`).concat(res).concat(other).concat(end).concat(indicator);\n }\n var AssertionError = function(_Error) {\n function AssertionError2(options) {\n var _this;\n if (_classCallCheck(this, AssertionError2), _typeof(options) !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var { message, operator, stackStartFn, actual, expected } = options, limit = Error.stackTraceLimit;\n if (Error.stackTraceLimit = 0, message != null)\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, String(message)));\n else if (process.stderr && process.stderr.isTTY && (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1 \? (blue = \"\", green = \"\", white = \"\", red = \"\") : (blue = \"\", green = \"\", white = \"\", red = \"\")), _typeof(actual) === \"object\" && actual !== null && _typeof(expected) === \"object\" && expected !== null && (\"stack\" in actual) && actual instanceof Error && (\"stack\" in expected) && expected instanceof Error && (actual = copyError(actual), expected = copyError(expected)), operator === \"deepStrictEqual\" || operator === \"strictEqual\")\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, createErrDiff(actual, expected, operator)));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n var base = kReadableOperator[operator], res = inspectValue(actual).split(`\n`);\n if (operator === \"notStrictEqual\" && _typeof(actual) === \"object\" && actual !== null && (base = kReadableOperator.notStrictEqualObject), res.length > 30)\n for (res[26] = \"\".concat(blue, \"...\").concat(white);res.length > 27; )\n res.pop();\n res.length === 1 \? _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, \" \").concat(res[0]))) : _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(base, `\n\n`).concat(res.join(`\n`), `\n`)));\n } else {\n var _res = inspectValue(actual), other = \"\", knownOperators = kReadableOperator[operator];\n operator === \"notDeepEqual\" || operator === \"notEqual\" \? (_res = \"\".concat(kReadableOperator[operator], `\n\n`).concat(_res), _res.length > 1024 && (_res = \"\".concat(_res.slice(0, 1021), \"...\"))) : (other = \"\".concat(inspectValue(expected)), _res.length > 512 && (_res = \"\".concat(_res.slice(0, 509), \"...\")), other.length > 512 && (other = \"\".concat(other.slice(0, 509), \"...\")), operator === \"deepEqual\" || operator === \"equal\" \? _res = \"\".concat(knownOperators, `\n\n`).concat(_res, `\n\nshould equal\n\n`) : other = \" \".concat(operator, \" \").concat(other)), _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, \"\".concat(_res).concat(other)));\n }\n return Error.stackTraceLimit = limit, _this.generatedMessage = !message, Object.defineProperty(_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: !1,\n writable: !0,\n configurable: !0\n }), _this.code = \"ERR_ASSERTION\", _this.actual = actual, _this.expected = expected, _this.operator = operator, Error.captureStackTrace && Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn), _this.stack, _this.name = \"AssertionError\", _possibleConstructorReturn(_this);\n }\n return AssertionError2.prototype = {}, _inherits(AssertionError2, _Error), _createClass(AssertionError2, [\n {\n key: \"toString\",\n value: function() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: inspect.custom,\n value: function(recurseTimes, ctx) {\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: !1,\n depth: 0\n }));\n }\n }\n ]), AssertionError2;\n }(_wrapNativeSuper(Error));\n module2.exports = AssertionError;\n }\n}), require_assert = __commonJS({\n \"assert/build/assert.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n var _require = require_errors(), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, AssertionError = require_assertion_error(), _require2 = util, inspect = _require2.inspect, _require$types = util.types, isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp, objectAssign = Object.assign, objectIs = Object.is, errorCache = new Map, warned = !1, assert = module2.exports = ok, NO_EXCEPTION_SENTINEL = {};\n function innerFail(obj) {\n throw obj.message instanceof Error \? obj.message : new AssertionError(obj);\n }\n function fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length, internalMessage;\n if (argsLen === 0)\n internalMessage = \"Failed\";\n else if (argsLen === 1)\n message = actual, actual = void 0;\n else {\n if (warned === !1) {\n warned = !0;\n var warn = process.emitWarning \? process.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n argsLen === 2 && (operator = \"!=\");\n }\n if (message instanceof Error)\n throw message;\n var errArgs = {\n actual,\n expected,\n operator: operator === void 0 \? \"fail\" : operator,\n stackStartFn: stackStartFn || fail\n };\n message !== void 0 && (errArgs.message = message);\n var err = new AssertionError(errArgs);\n throw internalMessage && (err.message = internalMessage, err.generatedMessage = !0), err;\n }\n assert.fail = fail, assert.AssertionError = AssertionError;\n function innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = !1;\n if (argLen === 0)\n generatedMessage = !0, message = \"No value argument passed to `assert.ok()`\";\n else if (message instanceof Error)\n throw message;\n var err = new AssertionError({\n actual: value,\n expected: !0,\n message,\n operator: \"==\",\n stackStartFn: fn\n });\n throw err.generatedMessage = generatedMessage, err;\n }\n }\n function ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n innerOk.apply(void 0, [ok, args.length].concat(args));\n }\n assert.ok = ok, assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual != expected && innerFail({\n actual,\n expected,\n message,\n operator: \"==\",\n stackStartFn: equal\n });\n }, assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual == expected && innerFail({\n actual,\n expected,\n message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n }, assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n }, assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n }, assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n }, assert.notDeepStrictEqual = notDeepStrictEqual;\n function notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: notDeepStrictEqual\n });\n }\n assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) || innerFail({\n actual,\n expected,\n message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n }, assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) && innerFail({\n actual,\n expected,\n message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n }, assert.match = function match(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!isRegExp(expected))\n throw new ERR_INVALID_ARG_TYPE(\"expected\", \"RegExp\", expected);\n expected.test(actual) || innerFail({\n actual,\n expected,\n message,\n operator: \"match\",\n stackStartFn: match\n });\n };\n var Comparison = function Comparison2(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison2), keys.forEach(function(key) {\n (key in obj) && (actual !== void 0 && typeof actual[key] == \"string\" && isRegExp(obj[key]) && obj[key].test(actual[key]) \? _this[key] = actual[key] : _this[key] = obj[key]);\n });\n };\n function compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepEqual(actual[key], expected[key], !0)) {\n if (!message) {\n var a = new Comparison(actual, keys), b = new Comparison(expected, keys, actual), err = new AssertionError({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.actual = actual, err.expected = expected, err.operator = fn.name, err;\n }\n innerFail({\n actual,\n expected,\n message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n }\n function expectedException(actual, expected, msg, fn) {\n if (typeof expected != \"function\") {\n if (isRegExp(expected))\n return expected.test(actual);\n if (arguments.length === 2)\n throw new ERR_INVALID_ARG_TYPE(\"expected\", [\"Function\", \"RegExp\"], expected);\n if (_typeof(actual) !== \"object\" || actual === null) {\n var err = new AssertionError({\n actual,\n expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.operator = fn.name, err;\n }\n var keys = Object.keys(expected);\n if (expected instanceof Error)\n keys.push(\"name\", \"message\");\n else if (keys.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n return keys.forEach(function(key) {\n return typeof actual[key] == \"string\" && isRegExp(expected[key]) && expected[key].test(actual[key]) || compareExceptionKey(actual, expected, key, msg, keys, fn);\n }), !0;\n }\n return expected.prototype !== void 0 && actual instanceof expected \? !0 : Error.isPrototypeOf(expected) \? !1 : expected.call({}, actual) === !0;\n }\n function getActual(fn) {\n if (typeof fn != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n }\n function checkIsPromise(obj) {\n return isPromise(obj) || obj !== null && _typeof(obj) === \"object\" && typeof obj.then == \"function\" && typeof obj.catch == \"function\";\n }\n function waitForActual(promiseFn) {\n return Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn == \"function\") {\n if (resultPromise = promiseFn(), !checkIsPromise(resultPromise))\n throw new ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if (checkIsPromise(promiseFn))\n resultPromise = promiseFn;\n else\n throw new ERR_INVALID_ARG_TYPE(\"promiseFn\", [\"Function\", \"Promise\"], promiseFn);\n return Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n }\n function expectsError(stackStartFn, actual, error, message) {\n if (typeof error == \"string\") {\n if (arguments.length === 4)\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error, error = void 0;\n } else if (error != null && _typeof(error) !== \"object\" && typeof error != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n error && error.name && (details += \" (\".concat(error.name, \")\")), details += message \? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" \? \"rejection\" : \"exception\";\n innerFail({\n actual: void 0,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn))\n throw actual;\n }\n function expectsNoError(stackStartFn, actual, error, message) {\n if (actual !== NO_EXCEPTION_SENTINEL) {\n if (typeof error == \"string\" && (message = error, error = void 0), !error || expectedException(actual, error)) {\n var details = message \? \": \".concat(message) : \".\", fnType = stackStartFn.name === \"doesNotReject\" \? \"rejection\" : \"exception\";\n innerFail({\n actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, `\n`) + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn\n });\n }\n throw actual;\n }\n }\n assert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 \? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++)\n args[_key2 - 1] = arguments[_key2];\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n }, assert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 \? _len3 - 1 : 0), _key3 = 1;_key3 < _len3; _key3++)\n args[_key3 - 1] = arguments[_key3];\n return waitForActual(promiseFn).then(function(result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n }, assert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 \? _len4 - 1 : 0), _key4 = 1;_key4 < _len4; _key4++)\n args[_key4 - 1] = arguments[_key4];\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n }, assert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 \? _len5 - 1 : 0), _key5 = 1;_key5 < _len5; _key5++)\n args[_key5 - 1] = arguments[_key5];\n return waitForActual(fn).then(function(result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n }, assert.ifError = function ifError(err) {\n if (err != null) {\n var message = \"ifError got unwanted exception: \";\n _typeof(err) === \"object\" && typeof err.message == \"string\" \? err.message.length === 0 && err.constructor \? message += err.constructor.name : message += err.message : message += inspect(err);\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message,\n stackStartFn: ifError\n }), origStack = err.stack;\n if (typeof origStack == \"string\") {\n var tmp2 = origStack.split(`\n`);\n tmp2.shift();\n for (var tmp1 = newErr.stack.split(`\n`), i = 0;i < tmp2.length; i++) {\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(`\n`), `\n`).concat(tmp2.join(`\n`));\n }\n throw newErr;\n }\n };\n function strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0;_key6 < _len6; _key6++)\n args[_key6] = arguments[_key6];\n innerOk.apply(void 0, [strict, args.length].concat(args));\n }\n assert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n }), assert.strict.strict = assert.strict;\n }\n}), assert_module = require_assert();\nassert_module.CallTracker = CallTracker;\nreturn assert_module})\n"_s;
+static constexpr ASCIILiteral NodeAssertCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/assert.ts\nvar CallTracker = function() {\n throw new Error(\"CallTracker is not supported yet\");\n}, util = @getInternalField(@internalModuleRegistry, 48) || @createInternalModuleById(48), isDeepEqual = Bun.deepEquals, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_errors = __commonJS({\n \"assert/build/internal/errors.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n var codes = {}, assert, util2;\n function createErrorType(code, message, Base) {\n Base || (Base = Error);\n function getMessage(arg1, arg2, arg3) {\n return typeof message == \"string\" \? message : message(arg1, arg2, arg3);\n }\n var NodeError = function(_Base) {\n _inherits(NodeError2, _Base);\n function NodeError2(arg1, arg2, arg3) {\n var _this;\n return _classCallCheck(this, NodeError2), _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError2).@call(this, getMessage(arg1, arg2, arg3))), _this.code = code, _this;\n }\n return NodeError2;\n }(Base);\n codes[code] = NodeError;\n }\n function oneOf(expected, thing) {\n if (@Array.isArray(expected)) {\n var len = expected.length;\n return expected = expected.map(function(i) {\n return @String(i);\n }), len > 2 \? \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(\", \"), \", or \") + expected[len - 1] : len === 2 \? \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]) : \"of \".concat(thing, \" \").concat(expected[0]);\n } else\n return \"of \".concat(thing, \" \").concat(@String(expected));\n }\n function startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 \? 0 : +pos, search.length) === search;\n }\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function includes(str, search, start) {\n return typeof start != \"number\" && (start = 0), start + search.length > str.length \? !1 : str.indexOf(search, start) !== -1;\n }\n createErrorType(\"ERR_AMBIGUOUS_ARGUMENT\", 'The \"%s\" argument is ambiguous. %s', TypeError), createErrorType(\"ERR_INVALID_ARG_TYPE\", function(name, expected, actual) {\n assert === void 0 && (assert = require_assert()), assert(typeof name == \"string\", \"'name' must be a string\");\n var determiner;\n typeof expected == \"string\" && startsWith(expected, \"not \") \? (determiner = \"must not be\", expected = expected.replace(/^not /, \"\")) : determiner = \"must be\";\n var msg;\n if (endsWith(name, \" argument\"))\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n else {\n var type = includes(name, \".\") \? \"property\" : \"argument\";\n msg = 'The \"'.concat(name, '\" ').concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, \"type\"));\n }\n return msg += \". Received type \".concat(_typeof(actual)), msg;\n }, TypeError), createErrorType(\"ERR_INVALID_ARG_VALUE\", function(name, value) {\n var reason = arguments.length > 2 && arguments[2] !== void 0 \? arguments[2] : \"is invalid\", inspected = util2.inspect(value);\n return inspected.length > 128 && (inspected = \"\".concat(inspected.slice(0, 128), \"...\")), \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n }, TypeError, RangeError), createErrorType(\"ERR_INVALID_RETURN_VALUE\", function(input, name, value) {\n var type;\n return value && value.constructor && value.constructor.name \? type = \"instance of \".concat(value.constructor.name) : type = \"type \".concat(_typeof(value)), \"Expected \".concat(input, ' to be returned from the \"').concat(name, '\"') + \" function but got \".concat(type, \".\");\n }, TypeError), createErrorType(\"ERR_MISSING_ARGS\", function() {\n for (var _len = arguments.length, args = new @Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n assert === void 0 && (assert = require_assert()), assert(args.length > 0, \"At least one arg needs to be specified\");\n var msg = \"The \", len = args.length;\n switch (args = args.map(function(a) {\n return '\"'.concat(a, '\"');\n }), len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n default:\n msg += args.slice(0, len - 1).join(\", \"), msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n return \"\".concat(msg, \" must be specified\");\n }, TypeError), module2.exports.codes = codes;\n }\n}), require_assertion_error = __commonJS({\n \"assert/build/internal/assert/assertion_error.js\"(exports, module2) {\n function _objectSpread(target) {\n for (var i = 1;i < arguments.length; i++) {\n var source = arguments[i] != null \? arguments[i] : {}, ownKeys = Object.keys(source);\n typeof Object.getOwnPropertySymbols == \"function\" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }))), ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n }\n function _defineProperty(obj, key, value) {\n return (key in obj) \? Object.defineProperty(obj, key, {\n value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : obj[key] = value, obj;\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n function _defineProperties(target, props) {\n for (var i = 0;i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, (\"value\" in descriptor) && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;\n }\n function _possibleConstructorReturn(self, call) {\n return call && (_typeof(call) === \"object\" || typeof call == \"function\") \? call : _assertThisInitialized(self);\n }\n function _assertThisInitialized(self) {\n if (self === void 0)\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n }\n function _inherits(subClass, superClass) {\n if (typeof superClass != \"function\" && superClass !== null)\n @throwTypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: { value: subClass, writable: !0, configurable: !0 }\n }), superClass && _setPrototypeOf(subClass, superClass);\n }\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map == \"function\" \? new Map : void 0;\n return _wrapNativeSuper = function(Class2) {\n if (Class2 === null || !_isNativeFunction(Class2))\n return Class2;\n if (typeof Class2 != \"function\")\n @throwTypeError(\"Super expression must either be null or a function\");\n if (typeof _cache != \"undefined\") {\n if (_cache.has(Class2))\n return _cache.get(Class2);\n _cache.set(Class2, Wrapper);\n }\n function Wrapper() {\n return _construct(Class2, arguments, _getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(Class2.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), _setPrototypeOf(Wrapper, Class2);\n }, _wrapNativeSuper(Class);\n }\n function isNativeReflectConstruct() {\n if (typeof Reflect == \"undefined\" || !Reflect.construct || Reflect.construct.sham)\n return !1;\n if (typeof Proxy == \"function\")\n return !0;\n try {\n return Date.prototype.toString.@call(Reflect.construct(Date, [], function() {\n })), !0;\n } catch {\n return !1;\n }\n }\n function _construct(Parent, args, Class) {\n return isNativeReflectConstruct() \? _construct = Reflect.construct : _construct = function(Parent2, args2, Class2) {\n var a = [null];\n a.push.@apply(a, args2);\n var Constructor = Function.bind.@apply(Parent2, a), instance = new Constructor;\n return Class2 && _setPrototypeOf(instance, Class2.prototype), instance;\n }, _construct.@apply(null, arguments);\n }\n function _isNativeFunction(fn) {\n return Function.toString.@call(fn).indexOf(\"[native code]\") !== -1;\n }\n function _setPrototypeOf(o, p) {\n return _setPrototypeOf = Object.setPrototypeOf || function(o2, p2) {\n return o2.__proto__ = p2, o2;\n }, _setPrototypeOf(o, p);\n }\n function _getPrototypeOf(o) {\n return _getPrototypeOf = Object.setPrototypeOf \? Object.getPrototypeOf : function(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n }, _getPrototypeOf(o);\n }\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n var inspect = util.inspect, _require2 = require_errors(), ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;\n function endsWith(str, search, this_len) {\n return (this_len === void 0 || this_len > str.length) && (this_len = str.length), str.substring(this_len - search.length, this_len) === search;\n }\n function repeat(str, count) {\n if (count = Math.floor(count), str.length == 0 || count == 0)\n return \"\";\n var maxCount = str.length * count;\n for (count = Math.floor(Math.log(count) / Math.log(2));count; )\n str += str, count--;\n return str += str.substring(0, maxCount - str.length), str;\n }\n var blue = \"\", green = \"\", red = \"\", white = \"\", kReadableOperator = {\n deepStrictEqual: \"Expected values to be strictly deep-equal:\",\n strictEqual: \"Expected values to be strictly equal:\",\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: \"Expected values to be loosely deep-equal:\",\n equal: \"Expected values to be loosely equal:\",\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: \"Values identical but not reference-equal:\"\n }, kMaxShortLength = 10;\n function copyError(source) {\n var keys = Object.keys(source), target = Object.create(Object.getPrototypeOf(source));\n return keys.forEach(function(key) {\n target[key] = source[key];\n }), Object.defineProperty(target, \"message\", {\n value: source.message\n }), target;\n }\n function inspectValue(val) {\n return inspect(val, {\n compact: !1,\n customInspect: !1,\n depth: 1000,\n maxArrayLength: Infinity,\n showHidden: !1,\n breakLength: Infinity,\n showProxy: !1,\n sorted: !0,\n getters: !0\n });\n }\n function createErrDiff(actual, expected, operator) {\n var other = \"\", res = \"\", lastPos = 0, end = \"\", skipped = !1, actualInspected = inspectValue(actual), actualLines = actualInspected.split(`\n`), expectedLines = inspectValue(expected).split(`\n`), i = 0, indicator = \"\";\n if (operator === \"strictEqual\" && _typeof(actual) === \"object\" && _typeof(expected) === \"object\" && actual !== null && expected !== null && (operator = \"strictEqualObject\"), actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length;\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== \"object\" || actual === null) && (_typeof(expected) !== \"object\" || expected === null) && (actual !== 0 || expected !== 0))\n return \"\".concat(kReadableOperator[operator], `\n\n`) + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], `\n`);\n } else if (operator !== \"strictEqualObject\") {\n var maxLength = process.stderr && process.stderr.isTTY \? process.stderr.columns : 80;\n if (inputLength < maxLength) {\n for (;actualLines[0][i] === expectedLines[0][i]; )\n i++;\n i > 2 && (indicator = `\n `.concat(repeat(\" \", i), \"^\"), i = 0);\n }\n }\n }\n for (var a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];a === b && (i++ < 2 \? end = `\n `.concat(a).concat(end) : other = a, actualLines.pop(), expectedLines.pop(), !(actualLines.length === 0 || expectedLines.length === 0)); )\n a = actualLines[actualLines.length - 1], b = expectedLines[expectedLines.length - 1];\n var maxLines = Math.max(actualLines.length, expectedLines.length);\n if (maxLines === 0) {\n var _actualLines = actualInspected.split(`\n`);\n if (_actualLines.length > 30)\n for (_actualLines[26] = \"\".concat(blue, \"...\").concat(white);_actualLines.length > 27; )\n _actualLines.pop();\n return \"\".concat(kReadableOperator.notIdentical, `\n\n`).concat(_actualLines.join(`\n`), `\n`);\n }\n i > 3 && (end = `\n`.concat(blue, \"...\").concat(white).concat(end), skipped = !0), other !== \"\" && (end = `\n `.concat(other).concat(end), other = \"\");\n var printedLines = 0, msg = kReadableOperator[operator] + `\n`.concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white), skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n for (i = 0;i < maxLines; i++) {\n var cur = i - lastPos;\n if (actualLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(expectedLines[i - 2]), printedLines++), res += `\n `.concat(expectedLines[i - 1]), printedLines++), lastPos = i, other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]), printedLines++;\n else if (expectedLines.length < i + 1)\n cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLines[i]), printedLines++;\n else {\n var expectedLine = expectedLines[i], actualLine = actualLines[i], divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, \",\") || actualLine.slice(0, -1) !== expectedLine);\n divergingLines && endsWith(expectedLine, \",\") && expectedLine.slice(0, -1) === actualLine && (divergingLines = !1, actualLine += \",\"), divergingLines \? (cur > 1 && i > 2 && (cur > 4 \? (res += `\n`.concat(blue, \"...\").concat(white), skipped = !0) : cur > 3 && (res += `\n `.concat(actualLines[i - 2]), printedLines++), res += `\n `.concat(actualLines[i - 1]), printedLines++), lastPos = i, res += `\n`.concat(green, \"+\").concat(white, \" \").concat(actualLine), other += `\n`.concat(red, \"-\").concat(white, \" \").concat(expectedLine), printedLines += 2) : (res += other, other = \"\", (cur === 1 || i === 0) && (res += `\n `.concat(actualLine), printedLines++));\n }\n if (printedLines > 20 && i < maxLines - 2)\n return \"\".concat(msg).concat(skippedMsg, `\n`).concat(res, `\n`).concat(blue, \"...\").concat(white).concat(other, `\n`) + \"\".concat(blue, \"...\").concat(white);\n }\n return \"\".concat(msg).concat(skipped \? skippedMsg : \"\", `\n`).concat(res).concat(other).concat(end).concat(indicator);\n }\n var AssertionError = function(_Error) {\n function AssertionError2(options) {\n var _this;\n if (_classCallCheck(this, AssertionError2), _typeof(options) !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n var { message, operator, stackStartFn, actual, expected } = options, limit = Error.stackTraceLimit;\n if (Error.stackTraceLimit = 0, message != null)\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, @String(message)));\n else if (process.stderr && process.stderr.isTTY && (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1 \? (blue = \"\", green = \"\", white = \"\", red = \"\") : (blue = \"\", green = \"\", white = \"\", red = \"\")), _typeof(actual) === \"object\" && actual !== null && _typeof(expected) === \"object\" && expected !== null && (\"stack\" in actual) && actual instanceof Error && (\"stack\" in expected) && expected instanceof Error && (actual = copyError(actual), expected = copyError(expected)), operator === \"deepStrictEqual\" || operator === \"strictEqual\")\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, createErrDiff(actual, expected, operator)));\n else if (operator === \"notDeepStrictEqual\" || operator === \"notStrictEqual\") {\n var base = kReadableOperator[operator], res = inspectValue(actual).split(`\n`);\n if (operator === \"notStrictEqual\" && _typeof(actual) === \"object\" && actual !== null && (base = kReadableOperator.notStrictEqualObject), res.length > 30)\n for (res[26] = \"\".concat(blue, \"...\").concat(white);res.length > 27; )\n res.pop();\n res.length === 1 \? _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, \"\".concat(base, \" \").concat(res[0]))) : _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, \"\".concat(base, `\n\n`).concat(res.join(`\n`), `\n`)));\n } else {\n var _res = inspectValue(actual), other = \"\", knownOperators = kReadableOperator[operator];\n operator === \"notDeepEqual\" || operator === \"notEqual\" \? (_res = \"\".concat(kReadableOperator[operator], `\n\n`).concat(_res), _res.length > 1024 && (_res = \"\".concat(_res.slice(0, 1021), \"...\"))) : (other = \"\".concat(inspectValue(expected)), _res.length > 512 && (_res = \"\".concat(_res.slice(0, 509), \"...\")), other.length > 512 && (other = \"\".concat(other.slice(0, 509), \"...\")), operator === \"deepEqual\" || operator === \"equal\" \? _res = \"\".concat(knownOperators, `\n\n`).concat(_res, `\n\nshould equal\n\n`) : other = \" \".concat(operator, \" \").concat(other)), _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).@call(this, \"\".concat(_res).concat(other)));\n }\n return Error.stackTraceLimit = limit, _this.generatedMessage = !message, Object.defineProperty(_assertThisInitialized(_this), \"name\", {\n value: \"AssertionError [ERR_ASSERTION]\",\n enumerable: !1,\n writable: !0,\n configurable: !0\n }), _this.code = \"ERR_ASSERTION\", _this.actual = actual, _this.expected = expected, _this.operator = operator, Error.captureStackTrace && Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn), _this.stack, _this.name = \"AssertionError\", _possibleConstructorReturn(_this);\n }\n return AssertionError2.prototype = {}, _inherits(AssertionError2, _Error), _createClass(AssertionError2, [\n {\n key: \"toString\",\n value: function() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n },\n {\n key: inspect.custom,\n value: function(recurseTimes, ctx) {\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: !1,\n depth: 0\n }));\n }\n }\n ]), AssertionError2;\n }(_wrapNativeSuper(Error));\n module2.exports = AssertionError;\n }\n}), require_assert = __commonJS({\n \"assert/build/assert.js\"(exports, module2) {\n function _typeof(obj) {\n return typeof Symbol == \"function\" && typeof Symbol.iterator == \"symbol\" \? _typeof = function(obj2) {\n return typeof obj2;\n } : _typeof = function(obj2) {\n return obj2 && typeof Symbol == \"function\" && obj2.constructor === Symbol && obj2 !== Symbol.prototype \? \"symbol\" : typeof obj2;\n }, _typeof(obj);\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor))\n @throwTypeError(\"Cannot call a class as a function\");\n }\n var _require = require_errors(), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, AssertionError = require_assertion_error(), _require2 = util, inspect = _require2.inspect, _require$types = util.types, isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp, objectAssign = Object.assign, objectIs = Object.is, errorCache = new Map, warned = !1, assert = module2.exports = ok, NO_EXCEPTION_SENTINEL = {};\n function innerFail(obj) {\n throw obj.message instanceof Error \? obj.message : new AssertionError(obj);\n }\n function fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length, internalMessage;\n if (argsLen === 0)\n internalMessage = \"Failed\";\n else if (argsLen === 1)\n message = actual, actual = void 0;\n else {\n if (warned === !1) {\n warned = !0;\n var warn = process.emitWarning \? process.emitWarning : console.warn.bind(console);\n warn(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\", \"DeprecationWarning\", \"DEP0094\");\n }\n argsLen === 2 && (operator = \"!=\");\n }\n if (message instanceof Error)\n throw message;\n var errArgs = {\n actual,\n expected,\n operator: operator === void 0 \? \"fail\" : operator,\n stackStartFn: stackStartFn || fail\n };\n message !== void 0 && (errArgs.message = message);\n var err = new AssertionError(errArgs);\n throw internalMessage && (err.message = internalMessage, err.generatedMessage = !0), err;\n }\n assert.fail = fail, assert.AssertionError = AssertionError;\n function innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = !1;\n if (argLen === 0)\n generatedMessage = !0, message = \"No value argument passed to `assert.ok()`\";\n else if (message instanceof Error)\n throw message;\n var err = new AssertionError({\n actual: value,\n expected: !0,\n message,\n operator: \"==\",\n stackStartFn: fn\n });\n throw err.generatedMessage = generatedMessage, err;\n }\n }\n function ok() {\n for (var _len = arguments.length, args = new @Array(_len), _key = 0;_key < _len; _key++)\n args[_key] = arguments[_key];\n innerOk.@apply(void 0, [ok, args.length].concat(args));\n }\n assert.ok = ok, assert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual != expected && innerFail({\n actual,\n expected,\n message,\n operator: \"==\",\n stackStartFn: equal\n });\n }, assert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n actual == expected && innerFail({\n actual,\n expected,\n message,\n operator: \"!=\",\n stackStartFn: notEqual\n });\n }, assert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepEqual\",\n stackStartFn: deepEqual\n });\n }, assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !1) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepEqual\",\n stackStartFn: notDeepEqual\n });\n }, assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) || innerFail({\n actual,\n expected,\n message,\n operator: \"deepStrictEqual\",\n stackStartFn: deepStrictEqual\n });\n }, assert.notDeepStrictEqual = notDeepStrictEqual;\n function notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n isDeepEqual(actual, expected, !0) && innerFail({\n actual,\n expected,\n message,\n operator: \"notDeepStrictEqual\",\n stackStartFn: notDeepStrictEqual\n });\n }\n assert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) || innerFail({\n actual,\n expected,\n message,\n operator: \"strictEqual\",\n stackStartFn: strictEqual\n });\n }, assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n objectIs(actual, expected) && innerFail({\n actual,\n expected,\n message,\n operator: \"notStrictEqual\",\n stackStartFn: notStrictEqual\n });\n }, assert.match = function match(actual, expected, message) {\n if (arguments.length < 2)\n throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n if (!isRegExp(expected))\n throw new ERR_INVALID_ARG_TYPE(\"expected\", \"RegExp\", expected);\n expected.test(actual) || innerFail({\n actual,\n expected,\n message,\n operator: \"match\",\n stackStartFn: match\n });\n };\n var Comparison = function Comparison2(obj, keys, actual) {\n var _this = this;\n _classCallCheck(this, Comparison2), keys.forEach(function(key) {\n (key in obj) && (actual !== void 0 && typeof actual[key] == \"string\" && isRegExp(obj[key]) && obj[key].test(actual[key]) \? _this[key] = actual[key] : _this[key] = obj[key]);\n });\n };\n function compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepEqual(actual[key], expected[key], !0)) {\n if (!message) {\n var a = new Comparison(actual, keys), b = new Comparison(expected, keys, actual), err = new AssertionError({\n actual: a,\n expected: b,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.actual = actual, err.expected = expected, err.operator = fn.name, err;\n }\n innerFail({\n actual,\n expected,\n message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n }\n function expectedException(actual, expected, msg, fn) {\n if (typeof expected != \"function\") {\n if (isRegExp(expected))\n return expected.test(actual);\n if (arguments.length === 2)\n throw new ERR_INVALID_ARG_TYPE(\"expected\", [\"Function\", \"RegExp\"], expected);\n if (_typeof(actual) !== \"object\" || actual === null) {\n var err = new AssertionError({\n actual,\n expected,\n message: msg,\n operator: \"deepStrictEqual\",\n stackStartFn: fn\n });\n throw err.operator = fn.name, err;\n }\n var keys = Object.keys(expected);\n if (expected instanceof Error)\n keys.push(\"name\", \"message\");\n else if (keys.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"error\", expected, \"may not be an empty object\");\n return keys.forEach(function(key) {\n return typeof actual[key] == \"string\" && isRegExp(expected[key]) && expected[key].test(actual[key]) || compareExceptionKey(actual, expected, key, msg, keys, fn);\n }), !0;\n }\n return expected.prototype !== void 0 && actual instanceof expected \? !0 : Error.isPrototypeOf(expected) \? !1 : expected.@call({}, actual) === !0;\n }\n function getActual(fn) {\n if (typeof fn != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"fn\", \"Function\", fn);\n try {\n fn();\n } catch (e) {\n return e;\n }\n return NO_EXCEPTION_SENTINEL;\n }\n function checkIsPromise(obj) {\n return isPromise(obj) || obj !== null && _typeof(obj) === \"object\" && typeof obj.then == \"function\" && typeof obj.catch == \"function\";\n }\n function waitForActual(promiseFn) {\n return @Promise.resolve().then(function() {\n var resultPromise;\n if (typeof promiseFn == \"function\") {\n if (resultPromise = promiseFn(), !checkIsPromise(resultPromise))\n throw new ERR_INVALID_RETURN_VALUE(\"instance of Promise\", \"promiseFn\", resultPromise);\n } else if (checkIsPromise(promiseFn))\n resultPromise = promiseFn;\n else\n throw new ERR_INVALID_ARG_TYPE(\"promiseFn\", [\"Function\", \"Promise\"], promiseFn);\n return @Promise.resolve().then(function() {\n return resultPromise;\n }).then(function() {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function(e) {\n return e;\n });\n });\n }\n function expectsError(stackStartFn, actual, error, message) {\n if (typeof error == \"string\") {\n if (arguments.length === 4)\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (_typeof(actual) === \"object\" && actual !== null) {\n if (actual.message === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error message \"'.concat(actual.message, '\" is identical to the message.'));\n } else if (actual === error)\n throw new ERR_AMBIGUOUS_ARGUMENT(\"error/message\", 'The error \"'.concat(actual, '\" is identical to the message.'));\n message = error, error = void 0;\n } else if (error != null && _typeof(error) !== \"object\" && typeof error != \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"error\", [\"Object\", \"Error\", \"Function\", \"RegExp\"], error);\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = \"\";\n error && error.name && (details += \" (\".concat(error.name, \")\")), details += message \? \": \".concat(message) : \".\";\n var fnType = stackStartFn.name === \"rejects\" \? \"rejection\" : \"exception\";\n innerFail({\n actual: void 0,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn\n });\n }\n if (error && !expectedException(actual, error, message, stackStartFn))\n throw actual;\n }\n function expectsNoError(stackStartFn, actual, error, message) {\n if (actual !== NO_EXCEPTION_SENTINEL) {\n if (typeof error == \"string\" && (message = error, error = void 0), !error || expectedException(actual, error)) {\n var details = message \? \": \".concat(message) : \".\", fnType = stackStartFn.name === \"doesNotReject\" \? \"rejection\" : \"exception\";\n innerFail({\n actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, `\n`) + 'Actual message: \"'.concat(actual && actual.message, '\"'),\n stackStartFn\n });\n }\n throw actual;\n }\n }\n assert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new @Array(_len2 > 1 \? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++)\n args[_key2 - 1] = arguments[_key2];\n expectsError.@apply(void 0, [throws, getActual(promiseFn)].concat(args));\n }, assert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new @Array(_len3 > 1 \? _len3 - 1 : 0), _key3 = 1;_key3 < _len3; _key3++)\n args[_key3 - 1] = arguments[_key3];\n return waitForActual(promiseFn).then(function(result) {\n return expectsError.@apply(void 0, [rejects, result].concat(args));\n });\n }, assert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new @Array(_len4 > 1 \? _len4 - 1 : 0), _key4 = 1;_key4 < _len4; _key4++)\n args[_key4 - 1] = arguments[_key4];\n expectsNoError.@apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n }, assert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new @Array(_len5 > 1 \? _len5 - 1 : 0), _key5 = 1;_key5 < _len5; _key5++)\n args[_key5 - 1] = arguments[_key5];\n return waitForActual(fn).then(function(result) {\n return expectsNoError.@apply(void 0, [doesNotReject, result].concat(args));\n });\n }, assert.ifError = function ifError(err) {\n if (err != null) {\n var message = \"ifError got unwanted exception: \";\n _typeof(err) === \"object\" && typeof err.message == \"string\" \? err.message.length === 0 && err.constructor \? message += err.constructor.name : message += err.message : message += inspect(err);\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: \"ifError\",\n message,\n stackStartFn: ifError\n }), origStack = err.stack;\n if (typeof origStack == \"string\") {\n var tmp2 = origStack.split(`\n`);\n tmp2.shift();\n for (var tmp1 = newErr.stack.split(`\n`), i = 0;i < tmp2.length; i++) {\n var pos = tmp1.indexOf(tmp2[i]);\n if (pos !== -1) {\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n newErr.stack = \"\".concat(tmp1.join(`\n`), `\n`).concat(tmp2.join(`\n`));\n }\n throw newErr;\n }\n };\n function strict() {\n for (var _len6 = arguments.length, args = new @Array(_len6), _key6 = 0;_key6 < _len6; _key6++)\n args[_key6] = arguments[_key6];\n innerOk.@apply(void 0, [strict, args.length].concat(args));\n }\n assert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n }), assert.strict.strict = assert.strict;\n }\n}), assert_module = require_assert();\nassert_module.CallTracker = CallTracker;\nreturn assert_module})\n");
//
//
-static constexpr ASCIILiteral NodeAssertStrictCode = "(function (){\"use strict\";// src/js/out/tmp/node/assert.strict.ts\nreturn (@getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6)).strict})\n"_s;
+static constexpr ASCIILiteral NodeAssertStrictCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/assert.strict.ts\nreturn (@getInternalField(@internalModuleRegistry, 8) || @createInternalModuleById(8)).strict})\n");
//
//
-static constexpr ASCIILiteral NodeAsyncHooksCode = "(function (){\"use strict\";// src/js/out/tmp/node/async_hooks.ts\nvar get = function() {\n return @getInternalField(@asyncContext, 0);\n}, set = function(contextValue) {\n return @putInternalField(@asyncContext, 0, contextValue);\n}, createWarning = function(message) {\n let warned = !1;\n var wrapped = function() {\n if (warned)\n return;\n if (new Error().stack.includes(\"zx/build/core.js\"))\n return;\n warned = !0, console.warn(\"[bun] Warning:\", message);\n };\n return wrapped;\n}, createHook = function(callbacks) {\n return {\n enable: createHookNotImpl,\n disable: createHookNotImpl\n };\n}, executionAsyncId = function() {\n return executionAsyncIdNotImpl(), 0;\n}, triggerAsyncId = function() {\n return 0;\n}, executionAsyncResource = function() {\n return executionAsyncResourceWarning(), process.stdin;\n}, $, { cleanupLater, setAsyncHooksEnabled } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"async_hooks\");\n\nclass AsyncLocalStorage {\n #disableCalled = !1;\n constructor() {\n setAsyncHooksEnabled(!0);\n }\n static bind(fn, ...args) {\n return this.snapshot().bind(null, fn, ...args);\n }\n static snapshot() {\n var context = get();\n return (fn, ...args) => {\n var prev = get();\n set(context);\n try {\n return fn(...args);\n } catch (error) {\n throw error;\n } finally {\n set(prev);\n }\n };\n }\n enterWith(store) {\n cleanupLater();\n var context = get();\n if (!context) {\n set([this, store]);\n return;\n }\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this) {\n const clone = context.slice();\n clone[i + 1] = store, set(clone);\n return;\n }\n set(context.concat(this, store));\n }\n exit(cb, ...args) {\n return this.run(void 0, cb, ...args);\n }\n run(store, callback, ...args) {\n var context = get(), hasPrevious = !1, previous, i = 0, contextWasInit = !context;\n if (contextWasInit)\n set(context = [this, store]);\n else {\n if (context = context.slice(), i = context.indexOf(this), i > -1)\n hasPrevious = !0, previous = context[i + 1], context[i + 1] = store;\n else\n context.push(this, store);\n set(context);\n }\n try {\n return callback(...args);\n } catch (e) {\n throw e;\n } finally {\n if (!this.#disableCalled) {\n var context2 = get();\n if (context2 === context && contextWasInit)\n set(void 0);\n else if (context2 = context2.slice(), hasPrevious)\n context2[i + 1] = previous, set(context2);\n else\n context2.splice(i, 2), set(context2.length \? context2 : void 0);\n }\n }\n }\n disable() {\n if (!this.#disableCalled) {\n var context = get();\n if (context) {\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this) {\n context.splice(i, 2), set(context.length \? context : void 0);\n break;\n }\n }\n this.#disableCalled = !0;\n }\n }\n getStore() {\n var context = get();\n if (!context)\n return;\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this)\n return context[i + 1];\n }\n}\n\nclass AsyncResource {\n type;\n #snapshot;\n constructor(type, options) {\n if (typeof type !== \"string\")\n @throwTypeError('The \"type\" argument must be of type string. Received type ' + typeof type);\n setAsyncHooksEnabled(!0), this.type = type, this.#snapshot = get();\n }\n emitBefore() {\n return !0;\n }\n emitAfter() {\n return !0;\n }\n asyncId() {\n return 0;\n }\n triggerAsyncId() {\n return 0;\n }\n emitDestroy() {\n }\n runInAsyncScope(fn, thisArg, ...args) {\n var prev = get();\n set(this.#snapshot);\n try {\n return fn.apply(thisArg, args);\n } catch (error) {\n throw error;\n } finally {\n set(prev);\n }\n }\n}\nvar createHookNotImpl = createWarning(\"async_hooks.createHook is not implemented in Bun. Hooks can still be created but will never be called.\"), executionAsyncIdNotImpl = createWarning(\"async_hooks.executionAsyncId/triggerAsyncId are not implemented in Bun. It will return 0 every time.\"), executionAsyncResourceWarning = createWarning(\"async_hooks.executionAsyncResource is not implemented in Bun. It returns a reference to process.stdin every time.\"), asyncWrapProviders = {\n NONE: 0,\n DIRHANDLE: 1,\n DNSCHANNEL: 2,\n ELDHISTOGRAM: 3,\n FILEHANDLE: 4,\n FILEHANDLECLOSEREQ: 5,\n FIXEDSIZEBLOBCOPY: 6,\n FSEVENTWRAP: 7,\n FSREQCALLBACK: 8,\n FSREQPROMISE: 9,\n GETADDRINFOREQWRAP: 10,\n GETNAMEINFOREQWRAP: 11,\n HEAPSNAPSHOT: 12,\n HTTP2SESSION: 13,\n HTTP2STREAM: 14,\n HTTP2PING: 15,\n HTTP2SETTINGS: 16,\n HTTPINCOMINGMESSAGE: 17,\n HTTPCLIENTREQUEST: 18,\n JSSTREAM: 19,\n JSUDPWRAP: 20,\n MESSAGEPORT: 21,\n PIPECONNECTWRAP: 22,\n PIPESERVERWRAP: 23,\n PIPEWRAP: 24,\n PROCESSWRAP: 25,\n PROMISE: 26,\n QUERYWRAP: 27,\n SHUTDOWNWRAP: 28,\n SIGNALWRAP: 29,\n STATWATCHER: 30,\n STREAMPIPE: 31,\n TCPCONNECTWRAP: 32,\n TCPSERVERWRAP: 33,\n TCPWRAP: 34,\n TTYWRAP: 35,\n UDPSENDWRAP: 36,\n UDPWRAP: 37,\n SIGINTWATCHDOG: 38,\n WORKER: 39,\n WORKERHEAPSNAPSHOT: 40,\n WRITEWRAP: 41,\n ZLIB: 42,\n CHECKPRIMEREQUEST: 43,\n PBKDF2REQUEST: 44,\n KEYPAIRGENREQUEST: 45,\n KEYGENREQUEST: 46,\n KEYEXPORTREQUEST: 47,\n CIPHERREQUEST: 48,\n DERIVEBITSREQUEST: 49,\n HASHREQUEST: 50,\n RANDOMBYTESREQUEST: 51,\n RANDOMPRIMEREQUEST: 52,\n SCRYPTREQUEST: 53,\n SIGNREQUEST: 54,\n TLSWRAP: 55,\n VERIFYREQUEST: 56,\n INSPECTORJSBINDING: 57\n};\n$ = {\n AsyncLocalStorage,\n createHook,\n executionAsyncId,\n triggerAsyncId,\n executionAsyncResource,\n asyncWrapProviders,\n AsyncResource\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeAsyncHooksCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/async_hooks.ts\nvar get = function() {\n return @getInternalField(@asyncContext, 0);\n}, set = function(contextValue) {\n return @putInternalField(@asyncContext, 0, contextValue);\n}, createWarning = function(message) {\n let warned = !1;\n var wrapped = function() {\n if (warned)\n return;\n if (new Error().stack.includes(\"zx/build/core.js\"))\n return;\n warned = !0, console.warn(\"[bun] Warning:\", message);\n };\n return wrapped;\n}, createHook = function(callbacks) {\n return {\n enable: createHookNotImpl,\n disable: createHookNotImpl\n };\n}, executionAsyncId = function() {\n return executionAsyncIdNotImpl(), 0;\n}, triggerAsyncId = function() {\n return 0;\n}, executionAsyncResource = function() {\n return executionAsyncResourceWarning(), process.stdin;\n}, $, { cleanupLater, setAsyncHooksEnabled } = @lazy(\"async_hooks\");\n\nclass AsyncLocalStorage {\n #disableCalled = !1;\n constructor() {\n setAsyncHooksEnabled(!0);\n }\n static bind(fn, ...args) {\n return this.snapshot().bind(null, fn, ...args);\n }\n static snapshot() {\n var context = get();\n return (fn, ...args) => {\n var prev = get();\n set(context);\n try {\n return fn(...args);\n } catch (error) {\n throw error;\n } finally {\n set(prev);\n }\n };\n }\n enterWith(store) {\n cleanupLater();\n var context = get();\n if (!context) {\n set([this, store]);\n return;\n }\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this) {\n const clone = context.slice();\n clone[i + 1] = store, set(clone);\n return;\n }\n set(context.concat(this, store));\n }\n exit(cb, ...args) {\n return this.run(@undefined, cb, ...args);\n }\n run(store_value, callback, ...args) {\n var context = get(), hasPrevious = !1, previous_value, i = 0, contextWasAlreadyInit = !context;\n if (contextWasAlreadyInit)\n set(context = [this, store_value]);\n else {\n if (context = context.slice(), i = context.indexOf(this), i > -1)\n hasPrevious = !0, previous_value = context[i + 1], context[i + 1] = store_value;\n else\n i = context.length, context.push(this, store_value);\n set(context);\n }\n try {\n return callback(...args);\n } catch (e) {\n throw e;\n } finally {\n if (!this.#disableCalled) {\n var context2 = get();\n if (context2 === context && contextWasAlreadyInit)\n set(@undefined);\n else if (context2 = context2.slice(), hasPrevious)\n context2[i + 1] = previous_value, set(context2);\n else\n context2.splice(i, 2), set(context2.length \? context2 : @undefined);\n }\n }\n }\n disable() {\n if (!this.#disableCalled) {\n var context = get();\n if (context) {\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this) {\n context.splice(i, 2), set(context.length \? context : @undefined);\n break;\n }\n }\n this.#disableCalled = !0;\n }\n }\n getStore() {\n var context = get();\n if (!context)\n return;\n var { length } = context;\n for (var i = 0;i < length; i += 2)\n if (context[i] === this)\n return context[i + 1];\n }\n}\n\nclass AsyncResource {\n type;\n #snapshot;\n constructor(type, options) {\n if (typeof type !== \"string\")\n @throwTypeError('The \"type\" argument must be of type string. Received type ' + typeof type);\n setAsyncHooksEnabled(!0), this.type = type, this.#snapshot = get();\n }\n emitBefore() {\n return !0;\n }\n emitAfter() {\n return !0;\n }\n asyncId() {\n return 0;\n }\n triggerAsyncId() {\n return 0;\n }\n emitDestroy() {\n }\n runInAsyncScope(fn, thisArg, ...args) {\n var prev = get();\n set(this.#snapshot);\n try {\n return fn.@apply(thisArg, args);\n } catch (error) {\n throw error;\n } finally {\n set(prev);\n }\n }\n bind(fn, thisArg) {\n return this.runInAsyncScope.bind(this, fn, thisArg \?\? this);\n }\n static bind(fn, type, thisArg) {\n return type = type || fn.name, new AsyncResource(type || \"bound-anonymous-fn\").bind(fn, thisArg);\n }\n}\nvar createHookNotImpl = createWarning(\"async_hooks.createHook is not implemented in Bun. Hooks can still be created but will never be called.\"), executionAsyncIdNotImpl = createWarning(\"async_hooks.executionAsyncId/triggerAsyncId are not implemented in Bun. It will return 0 every time.\"), executionAsyncResourceWarning = createWarning(\"async_hooks.executionAsyncResource is not implemented in Bun. It returns a reference to process.stdin every time.\"), asyncWrapProviders = {\n NONE: 0,\n DIRHANDLE: 1,\n DNSCHANNEL: 2,\n ELDHISTOGRAM: 3,\n FILEHANDLE: 4,\n FILEHANDLECLOSEREQ: 5,\n FIXEDSIZEBLOBCOPY: 6,\n FSEVENTWRAP: 7,\n FSREQCALLBACK: 8,\n FSREQPROMISE: 9,\n GETADDRINFOREQWRAP: 10,\n GETNAMEINFOREQWRAP: 11,\n HEAPSNAPSHOT: 12,\n HTTP2SESSION: 13,\n HTTP2STREAM: 14,\n HTTP2PING: 15,\n HTTP2SETTINGS: 16,\n HTTPINCOMINGMESSAGE: 17,\n HTTPCLIENTREQUEST: 18,\n JSSTREAM: 19,\n JSUDPWRAP: 20,\n MESSAGEPORT: 21,\n PIPECONNECTWRAP: 22,\n PIPESERVERWRAP: 23,\n PIPEWRAP: 24,\n PROCESSWRAP: 25,\n PROMISE: 26,\n QUERYWRAP: 27,\n SHUTDOWNWRAP: 28,\n SIGNALWRAP: 29,\n STATWATCHER: 30,\n STREAMPIPE: 31,\n TCPCONNECTWRAP: 32,\n TCPSERVERWRAP: 33,\n TCPWRAP: 34,\n TTYWRAP: 35,\n UDPSENDWRAP: 36,\n UDPWRAP: 37,\n SIGINTWATCHDOG: 38,\n WORKER: 39,\n WORKERHEAPSNAPSHOT: 40,\n WRITEWRAP: 41,\n ZLIB: 42,\n CHECKPRIMEREQUEST: 43,\n PBKDF2REQUEST: 44,\n KEYPAIRGENREQUEST: 45,\n KEYGENREQUEST: 46,\n KEYEXPORTREQUEST: 47,\n CIPHERREQUEST: 48,\n DERIVEBITSREQUEST: 49,\n HASHREQUEST: 50,\n RANDOMBYTESREQUEST: 51,\n RANDOMPRIMEREQUEST: 52,\n SCRYPTREQUEST: 53,\n SIGNREQUEST: 54,\n TLSWRAP: 55,\n VERIFYREQUEST: 56,\n INSPECTORJSBINDING: 57\n};\n$ = {\n AsyncLocalStorage,\n createHook,\n executionAsyncId,\n triggerAsyncId,\n executionAsyncResource,\n asyncWrapProviders,\n AsyncResource\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeChildProcessCode = "(function (){\"use strict\";// src/js/out/tmp/node/child_process.ts\nvar spawn = function(file, args, options) {\n options = normalizeSpawnArguments(file, args, options), validateTimeout(options.timeout), validateAbortSignal(options.signal, \"options.signal\");\n const killSignal2 = sanitizeKillSignal(options.killSignal), child = new ChildProcess;\n if (child.spawn(options), options.timeout > 0) {\n let timeoutId = setTimeout(() => {\n if (timeoutId) {\n try {\n child.kill(killSignal2);\n } catch (err) {\n child.emit(\"error\", err);\n }\n timeoutId = null;\n }\n });\n child.once(\"exit\", () => {\n if (timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n });\n }\n if (options.signal) {\n let onAbortListener2 = function() {\n abortChildProcess(child, killSignal2, options.signal.reason);\n };\n var onAbortListener = onAbortListener2;\n const signal = options.signal;\n if (signal.aborted)\n process.nextTick(onAbortListener2);\n else\n signal.addEventListener(\"abort\", onAbortListener2, { once: !0 }), child.once(\"exit\", () => signal.removeEventListener(\"abort\", onAbortListener2));\n }\n return child;\n}, execFile = function(file, args, options, callback) {\n ({ file, args, options, callback } = normalizeExecFileArgs(file, args, options, callback)), options = {\n encoding: \"utf8\",\n timeout: 0,\n maxBuffer: MAX_BUFFER,\n killSignal: \"SIGTERM\",\n cwd: null,\n env: null,\n shell: !1,\n ...options\n };\n const maxBuffer = options.maxBuffer;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const child = spawn(file, args, {\n cwd: options.cwd,\n env: options.env,\n shell: options.shell,\n signal: options.signal\n });\n let encoding;\n const _stdout = [], _stderr = [];\n if (options.encoding !== \"buffer\" && BufferIsEncoding(options.encoding))\n encoding = options.encoding;\n else\n encoding = null;\n let stdoutLen = 0, stderrLen = 0, killed = !1, exited = !1, timeoutId, encodedStdoutLen, encodedStderrLen, ex = null, cmd = file;\n function exitHandler(code, signal) {\n if (exited)\n return;\n if (exited = !0, timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n if (!callback)\n return;\n const readableEncoding = child\?.stdout\?.readableEncoding;\n let stdout, stderr;\n if (encoding || child.stdout && readableEncoding)\n stdout = ArrayPrototypeJoin.call(_stdout, \"\");\n else\n stdout = BufferConcat(_stdout);\n if (encoding || child.stderr && readableEncoding)\n stderr = ArrayPrototypeJoin.call(_stderr, \"\");\n else\n stderr = BufferConcat(_stderr);\n if (!ex && code === 0 && signal === null) {\n callback(null, stdout, stderr);\n return;\n }\n if (args\?.length)\n cmd += ` ${ArrayPrototypeJoin.call(args, \" \")}`;\n if (!ex) {\n let message = `Command failed: ${cmd}`;\n if (stderr)\n message += `\\n${stderr}`;\n ex = genericNodeError(message, {\n code,\n killed: child.killed || killed,\n signal\n });\n }\n ex.cmd = cmd, callback(ex, stdout, stderr);\n }\n function errorHandler(e) {\n if (ex = e, child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n exitHandler();\n }\n function kill() {\n if (child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n killed = !0;\n try {\n child.kill(options.killSignal);\n } catch (e) {\n ex = e, exitHandler();\n }\n }\n if (options.timeout > 0)\n timeoutId = setTimeout(function delayedKill() {\n kill(), timeoutId = null;\n }, options.timeout);\n if (child.stdout) {\n if (encoding)\n child.stdout.setEncoding(encoding);\n child.stdout.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stdout, chunk);\n } : encoding \? function onChildStdoutEncoded(chunk) {\n if (stdoutLen += chunk.length, stdoutLen * 4 > maxBuffer) {\n const encoding2 = child.stdout.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStdoutLen === void 0)\n for (let i = 0;i < _stdout.length; i++)\n encodedStdoutLen += Buffer.byteLength(_stdout[i], encoding2);\n else\n encodedStdoutLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStdoutLen - actualLen);\n ArrayPrototypePush.call(_stdout, StringPrototypeSlice.apply(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n } : function onChildStdoutRaw(chunk) {\n if (stdoutLen += chunk.length, stdoutLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stdoutLen - chunk.length);\n ArrayPrototypePush.call(_stdout, chunk.slice(0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.call(_stdout, chunk);\n });\n }\n if (child.stderr) {\n if (encoding)\n child.stderr.setEncoding(encoding);\n child.stderr.on(\"data\", maxBuffer === Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.call(_stderr, chunk);\n } : encoding \? function onChildStderrEncoded(chunk) {\n if (stderrLen += chunk.length, stderrLen * 4 > maxBuffer) {\n const encoding2 = child.stderr.readableEncoding, actualLen = Buffer.byteLength(chunk, encoding2);\n if (encodedStderrLen === void 0)\n for (let i = 0;i < _stderr.length; i++)\n encodedStderrLen += Buffer.byteLength(_stderr[i], encoding2);\n else\n encodedStderrLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStderrLen - actualLen);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n } : function onChildStderrRaw(chunk) {\n if (stderrLen += chunk.length, stderrLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stderrLen - chunk.length);\n ArrayPrototypePush.call(_stderr, StringPrototypeSlice.call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.call(_stderr, chunk);\n });\n }\n return child.addListener(\"close\", exitHandler), child.addListener(\"error\", errorHandler), child;\n}, exec = function(command, options, callback) {\n const opts = normalizeExecArgs(command, options, callback);\n return execFile(opts.file, opts.options, opts.callback);\n}, spawnSync = function(file, args, options) {\n options = {\n maxBuffer: MAX_BUFFER,\n ...normalizeSpawnArguments(file, args, options)\n };\n const { maxBuffer, encoding } = options;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const stdio = options.stdio || \"pipe\", bunStdio = getBunStdioFromOptions(stdio);\n var { input } = options;\n if (input)\n if (ArrayBufferIsView(input))\n bunStdio[0] = input;\n else if (typeof input === \"string\")\n bunStdio[0] = Buffer.from(input, encoding || \"utf8\");\n else\n throw new ERR_INVALID_ARG_TYPE(\"options.stdio[0]\", [\"Buffer\", \"TypedArray\", \"DataView\", \"string\"], input);\n const { stdout, stderr, success, exitCode } = Bun.spawnSync({\n cmd: options.args,\n env: options.env || void 0,\n cwd: options.cwd || void 0,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2]\n }), result = {\n signal: null,\n status: exitCode,\n output: [null, stdout, stderr]\n };\n if (stdout && encoding && encoding !== \"buffer\")\n result.output[1] = result.output[1]\?.toString(encoding);\n if (stderr && encoding && encoding !== \"buffer\")\n result.output[2] = result.output[2]\?.toString(encoding);\n if (result.stdout = result.output[1], result.stderr = result.output[2], !success)\n result.error = new SystemError(result.output[2], options.file, \"spawnSync\", -1, result.status), result.error.spawnargs = ArrayPrototypeSlice.call(options.args, 1);\n return result;\n}, execFileSync = function(file, args, options) {\n ({ file, args, options } = normalizeExecFileArgs(file, args, options));\n const ret = spawnSync(file, args, options), errArgs = [options.argv0 || file];\n ArrayPrototypePush.apply(errArgs, args);\n const err = checkExecSyncError(ret, errArgs);\n if (err)\n throw err;\n return ret.stdout;\n}, execSync = function(command, options) {\n const opts = normalizeExecArgs(command, options, null), ret = spawnSync(opts.file, opts.options), err = checkExecSyncError(ret, void 0, command);\n if (err)\n throw err;\n return ret.stdout;\n}, stdioStringToArray = function(stdio, channel) {\n const options = [];\n switch (stdio) {\n case \"ignore\":\n case \"overlapped\":\n case \"pipe\":\n ArrayPrototypePush.call(options, stdio, stdio, stdio);\n break;\n case \"inherit\":\n ArrayPrototypePush.call(options, 0, 1, 2);\n break;\n default:\n throw new ERR_INVALID_ARG_VALUE(\"stdio\", stdio);\n }\n if (channel)\n ArrayPrototypePush.call(options, channel);\n return options;\n}, fork = function(modulePath, args = [], options) {\n modulePath = getValidatedPath(modulePath, \"modulePath\");\n let execArgv;\n if (args == null)\n args = [];\n else if (typeof args === \"object\" && !ArrayIsArray(args))\n options = args, args = [];\n else\n validateArray(args, \"args\");\n if (options != null)\n validateObject(options, \"options\");\n if (options = { __proto__: null, ...options, shell: !1 }, options.execPath = options.execPath || process.execPath, validateArgumentNullCheck(options.execPath, \"options.execPath\"), execArgv = options.execArgv || process.execArgv, validateArgumentsNullCheck(execArgv, \"options.execArgv\"), execArgv === process.execArgv && process._eval != null) {\n const index = ArrayPrototypeLastIndexOf.call(execArgv, process._eval);\n if (index > 0)\n execArgv = ArrayPrototypeSlice.call(execArgv), ArrayPrototypeSplice.call(execArgv, index - 1, 2);\n }\n if (args = [...execArgv, modulePath, ...args], typeof options.stdio === \"string\")\n options.stdio = stdioStringToArray(options.stdio, \"ipc\");\n else if (!ArrayIsArray(options.stdio))\n options.stdio = stdioStringToArray(options.silent \? \"pipe\" : \"inherit\", \"ipc\");\n else if (!ArrayPrototypeIncludes.call(options.stdio, \"ipc\"))\n throw new ERR_CHILD_PROCESS_IPC_REQUIRED(\"options.stdio\");\n return spawn(options.execPath, args, options);\n}, convertToValidSignal = function(signal) {\n if (typeof signal === \"number\" && getSignalsToNamesMapping()[signal])\n return signal;\n if (typeof signal === \"string\") {\n const signalName = signals[StringPrototypeToUpperCase.call(signal)];\n if (signalName)\n return signalName;\n }\n throw new ERR_UNKNOWN_SIGNAL(signal);\n}, sanitizeKillSignal = function(killSignal2) {\n if (typeof killSignal2 === \"string\" || typeof killSignal2 === \"number\")\n return convertToValidSignal(killSignal2);\n else if (killSignal2 != null)\n throw new ERR_INVALID_ARG_TYPE(\"options.killSignal\", [\"string\", \"number\"], killSignal2);\n}, getSignalsToNamesMapping = function() {\n if (signalsToNamesMapping !== void 0)\n return signalsToNamesMapping;\n signalsToNamesMapping = ObjectCreate(null);\n for (let key in signals)\n signalsToNamesMapping[signals[key]] = key;\n return signalsToNamesMapping;\n}, normalizeExecFileArgs = function(file, args, options, callback) {\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args != null && typeof args === \"object\")\n callback = options, options = args, args = null;\n else if (typeof args === \"function\")\n callback = args, options = null, args = null;\n if (args == null)\n args = [];\n if (typeof options === \"function\")\n callback = options;\n else if (options != null)\n validateObject(options, \"options\");\n if (options == null)\n options = kEmptyObject;\n if (callback != null)\n validateFunction(callback, \"callback\");\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n return { file, args, options, callback };\n}, normalizeExecArgs = function(command, options, callback) {\n if (validateString(command, \"command\"), validateArgumentNullCheck(command, \"command\"), typeof options === \"function\")\n callback = options, options = void 0;\n return options = { ...options }, options.shell = typeof options.shell === \"string\" \? options.shell : !0, {\n file: command,\n options,\n callback\n };\n}, normalizeSpawnArguments = function(file, args, options) {\n if (validateString(file, \"file\"), validateArgumentNullCheck(file, \"file\"), file.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"file\", file, \"cannot be empty\");\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.call(args);\n else if (args == null)\n args = [];\n else if (typeof args !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"args\", \"object\", args);\n else\n options = args, args = [];\n if (validateArgumentsNullCheck(args, \"args\"), options === void 0)\n options = {};\n else\n validateObject(options, \"options\");\n let cwd = options.cwd;\n if (cwd != null)\n cwd = getValidatedPath(cwd, \"options.cwd\");\n var detached = !1;\n const { detached: detachedOption } = options;\n if (detachedOption != null)\n detached = !!detachedOption;\n if (options.shell != null && typeof options.shell !== \"boolean\" && typeof options.shell !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(\"options.shell\", [\"boolean\", \"string\"], options.shell);\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n if (options.shell) {\n validateArgumentNullCheck(options.shell, \"options.shell\");\n const command = ArrayPrototypeJoin.call([file, ...args], \" \");\n if (typeof options.shell === \"string\")\n file = options.shell;\n else\n file = \"sh\";\n args = [\"-c\", command];\n }\n if (typeof options.argv0 === \"string\")\n ArrayPrototypeUnshift.call(args, options.argv0);\n else\n ArrayPrototypeUnshift.call(args, file);\n const envPairs = options.env || process.env;\n return { ...options, detached, file, args, cwd, envPairs };\n}, checkExecSyncError = function(ret, args, cmd) {\n let err;\n if (ret.error)\n err = ret.error, ObjectAssign(err, ret);\n else if (ret.status !== 0) {\n let msg = \"Command failed: \";\n if (msg += cmd || ArrayPrototypeJoin.call(args, \" \"), ret.stderr && ret.stderr.length > 0)\n msg += `\\n${ret.stderr.toString()}`;\n err = genericNodeError(msg, ret);\n }\n return err;\n}, nodeToBun = function(item) {\n if (typeof item === \"number\")\n return item;\n else {\n const result = nodeToBunLookup[item];\n if (result === void 0)\n throw new Error(\"Invalid stdio option\");\n return result;\n }\n}, fdToStdioName = function(fd) {\n switch (fd) {\n case 0:\n return \"stdin\";\n case 1:\n return \"stdout\";\n case 2:\n return \"stderr\";\n default:\n return null;\n }\n}, getBunStdioFromOptions = function(stdio) {\n return normalizeStdio(stdio).map((item) => nodeToBun(item));\n}, normalizeStdio = function(stdio) {\n if (typeof stdio === \"string\")\n switch (stdio) {\n case \"ignore\":\n return [\"ignore\", \"ignore\", \"ignore\"];\n case \"pipe\":\n return [\"pipe\", \"pipe\", \"pipe\"];\n case \"inherit\":\n return [\"inherit\", \"inherit\", \"inherit\"];\n default:\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n }\n else if (ArrayIsArray(stdio)) {\n let processedStdio;\n if (stdio.length === 0)\n processedStdio = [\"pipe\", \"pipe\", \"pipe\"];\n else if (stdio.length === 1)\n processedStdio = [stdio[0], \"pipe\", \"pipe\"];\n else if (stdio.length === 2)\n processedStdio = [stdio[0], stdio[1], \"pipe\"];\n else if (stdio.length >= 3)\n processedStdio = [stdio[0], stdio[1], stdio[2]];\n return processedStdio.map((item) => !item \? \"pipe\" : item);\n } else\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n}, flushStdio = function(subprocess) {\n const stdio = subprocess.stdio;\n if (stdio == null)\n return;\n for (let i = 0;i < stdio.length; i++) {\n const stream = stdio[i];\n if (!stream || !stream.readable)\n continue;\n stream.resume();\n }\n}, onSpawnNT = function(self) {\n self.emit(\"spawn\");\n}, abortChildProcess = function(child, killSignal2, reason) {\n if (!child)\n return;\n try {\n if (child.kill(killSignal2))\n child.emit(\"error\", new AbortError(void 0, { cause: reason }));\n } catch (err) {\n child.emit(\"error\", err);\n }\n}, validateMaxBuffer = function(maxBuffer) {\n if (maxBuffer != null && !(typeof maxBuffer === \"number\" && maxBuffer >= 0))\n throw new ERR_OUT_OF_RANGE(\"options.maxBuffer\", \"a positive number\", maxBuffer);\n}, validateArgumentNullCheck = function(arg, propName) {\n if (typeof arg === \"string\" && StringPrototypeIncludes.call(arg, \"\\0\"))\n throw new ERR_INVALID_ARG_VALUE(propName, arg, \"must be a string without null bytes\");\n}, validateArgumentsNullCheck = function(args, propName) {\n for (let i = 0;i < args.length; ++i)\n validateArgumentNullCheck(args[i], `${propName}[${i}]`);\n}, validateTimeout = function(timeout) {\n if (timeout != null && !(NumberIsInteger(timeout) && timeout >= 0))\n throw new ERR_OUT_OF_RANGE(\"timeout\", \"an unsigned integer\", timeout);\n};\nvar validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, nullCheck = function(path, propName, throwError = !0) {\n const pathIsString = typeof path === \"string\", pathIsUint8Array = isUint8Array(path);\n if (!pathIsString && !pathIsUint8Array || pathIsString && !StringPrototypeIncludes.call(path, \"\\0\") || pathIsUint8Array && !Uint8ArrayPrototypeIncludes.call(path, 0))\n return;\n const err = new ERR_INVALID_ARG_VALUE(propName, path, \"must be a string or Uint8Array without null bytes\");\n if (throwError)\n throw err;\n return err;\n}, validatePath = function(path, propName = \"path\") {\n if (typeof path !== \"string\" && !isUint8Array(path))\n throw new ERR_INVALID_ARG_TYPE(propName, [\"string\", \"Buffer\", \"URL\"], path);\n const err = nullCheck(path, propName, !1);\n if (err !== void 0)\n throw err;\n}, getValidatedPath = function(fileURLOrPath, propName = \"path\") {\n const path = toPathIfFileURL(fileURLOrPath);\n return validatePath(path, propName), path;\n}, isUint8Array = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof Uint8Array;\n}, isURLInstance = function(fileURLOrPath) {\n return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin;\n}, toPathIfFileURL = function(fileURLOrPath) {\n if (!isURLInstance(fileURLOrPath))\n return fileURLOrPath;\n return Bun.fileURLToPath(fileURLOrPath);\n}, genericNodeError = function(message, options) {\n const err = new Error(message);\n return err.code = options.code, err.killed = options.killed, err.signal = options.signal, err;\n}, ERR_OUT_OF_RANGE = function(str, range, input, replaceDefaultBoolean = !1) {\n return new RangeError(`The value of ${str} is out of range. It must be ${range}. Received ${input}`);\n}, ERR_CHILD_PROCESS_STDIO_MAXBUFFER = function(stdio) {\n return Error(`${stdio} maxBuffer length exceeded`);\n}, ERR_UNKNOWN_SIGNAL = function(name) {\n const err = @makeTypeError(`Unknown signal: ${name}`);\n return err.code = \"ERR_UNKNOWN_SIGNAL\", err;\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value\?.toString()}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_INVALID_OPT_VALUE = function(name, value) {\n return @makeTypeError(`The value \"${value}\" is invalid for option \"${name}\"`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value \"${value}\" is invalid for argument '${name}'. Reason: ${reason}`);\n}, ERR_CHILD_PROCESS_IPC_REQUIRED = function(name) {\n const err = @makeTypeError(`Forked processes must have an IPC channel, missing value 'ipc' in ${name}`);\n return err.code = \"ERR_CHILD_PROCESS_IPC_REQUIRED\", err;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), StreamModule = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), {\n constants: { signals }\n} = @getInternalField(@internalModuleRegistry, 26) || @createInternalModuleById(26), { promisify } = @getInternalField(@internalModuleRegistry, 46) || @createInternalModuleById(46), ObjectCreate = Object.create, ObjectAssign = Object.assign, ObjectDefineProperty = Object.defineProperty, BufferConcat = Buffer.concat, BufferIsEncoding = Buffer.isEncoding, kEmptyObject = ObjectCreate(null), ArrayPrototypePush = Array.prototype.push, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypeIncludes = Array.prototype.includes, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeUnshift = Array.prototype.unshift, ArrayPrototypeLastIndexOf = Array.prototype.lastIndexOf, ArrayPrototypeSplice = Array.prototype.splice, ArrayIsArray = Array.isArray, ArrayBufferIsView = ArrayBuffer.isView, NumberIsInteger = Number.isInteger;\nvar StringPrototypeToUpperCase = String.prototype.toUpperCase, StringPrototypeIncludes = String.prototype.includes, StringPrototypeSlice = String.prototype.slice, Uint8ArrayPrototypeIncludes = Uint8Array.prototype.includes, MAX_BUFFER = 1048576, NativeWritable, ReadableFromWeb, customPromiseExecFunction = (orig) => {\n return (...args) => {\n let resolve, reject;\n const promise = new Promise((res, rej) => {\n resolve = res, reject = rej;\n });\n return promise.child = orig(...args, (err, stdout, stderr) => {\n if (err !== null)\n err.stdout = stdout, err.stderr = stderr, reject(err);\n else\n resolve({ stdout, stderr });\n }), promise;\n };\n};\nObjectDefineProperty(exec, promisify.custom, {\n __proto__: null,\n enumerable: !1,\n value: customPromiseExecFunction(exec)\n});\nvar signalsToNamesMapping;\n\nclass ChildProcess extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n #handle;\n #exited = !1;\n #closesNeeded = 1;\n #closesGot = 0;\n connected = !1;\n signalCode = null;\n exitCode = null;\n spawnfile;\n spawnargs;\n pid;\n channel;\n get killed() {\n if (this.#handle == null)\n return !1;\n }\n #handleOnExit(exitCode, signalCode, err) {\n if (this.#exited)\n return;\n if (signalCode)\n this.signalCode = signalCode;\n else\n this.exitCode = exitCode;\n if (this.#stdin)\n this.#stdin.destroy();\n if (this.#handle)\n this.#handle = null;\n if (exitCode < 0) {\n const err2 = new SystemError(`Spawned process exited with error code: ${exitCode}`, void 0, \"spawn\", \"EUNKNOWN\", \"ERR_CHILD_PROCESS_UNKNOWN_ERROR\");\n if (this.spawnfile)\n err2.path = this.spawnfile;\n err2.spawnargs = ArrayPrototypeSlice.call(this.spawnargs, 1), this.emit(\"error\", err2);\n } else\n this.emit(\"exit\", this.exitCode, this.signalCode);\n process.nextTick(flushStdio, this), this.#maybeClose(), this.#exited = !0, this.#stdioOptions = [\"destroyed\", \"destroyed\", \"destroyed\"];\n }\n #getBunSpawnIo(i, encoding) {\n NativeWritable ||= StreamModule.NativeWritable, ReadableFromWeb ||= StreamModule.Readable.fromWeb;\n const io = this.#stdioOptions[i];\n switch (i) {\n case 0:\n switch (io) {\n case \"pipe\":\n return new NativeWritable(this.#handle.stdin);\n case \"inherit\":\n return process.stdin || null;\n case \"destroyed\":\n return new ShimmedStdin;\n default:\n return null;\n }\n case 2:\n case 1:\n switch (io) {\n case \"pipe\":\n return ReadableFromWeb(this.#handle[fdToStdioName(i)], { encoding });\n case \"inherit\":\n return process[fdToStdioName(i)] || null;\n case \"destroyed\":\n return new ShimmedStdioOutStream;\n default:\n return null;\n }\n }\n }\n #stdin;\n #stdout;\n #stderr;\n #stdioObject;\n #encoding;\n #stdioOptions;\n #createStdioObject() {\n return Object.create(null, {\n 0: {\n get: () => this.stdin\n },\n 1: {\n get: () => this.stdout\n },\n 2: {\n get: () => this.stderr\n }\n });\n }\n get stdin() {\n return this.#stdin \?\?= this.#getBunSpawnIo(0, this.#encoding);\n }\n get stdout() {\n return this.#stdout \?\?= this.#getBunSpawnIo(1, this.#encoding);\n }\n get stderr() {\n return this.#stderr \?\?= this.#getBunSpawnIo(2, this.#encoding);\n }\n get stdio() {\n return this.#stdioObject \?\?= this.#createStdioObject();\n }\n spawn(options) {\n validateObject(options, \"options\"), validateString(options.file, \"options.file\");\n var file = this.spawnfile = options.file, spawnargs;\n if (options.args == null)\n spawnargs = this.spawnargs = [];\n else\n validateArray(options.args, \"options.args\"), spawnargs = this.spawnargs = options.args;\n const stdio = options.stdio || [\"pipe\", \"pipe\", \"pipe\"], bunStdio = getBunStdioFromOptions(stdio), ipc = @isArray(stdio) && stdio[3] === \"ipc\";\n var env = options.envPairs || void 0;\n const detachedOption = options.detached;\n if (this.#encoding = options.encoding || void 0, this.#stdioOptions = bunStdio, this.#handle = Bun.spawn({\n cmd: spawnargs,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2],\n cwd: options.cwd || void 0,\n env: env || process.env,\n detached: typeof detachedOption !== \"undefined\" \? !!detachedOption : !1,\n onExit: (handle, exitCode, signalCode, err) => {\n this.#handle = handle, this.pid = this.#handle.pid, process.nextTick((exitCode2, signalCode2, err2) => this.#handleOnExit(exitCode2, signalCode2, err2), exitCode, signalCode, err);\n },\n lazy: !0,\n ipc: ipc \? this.#emitIpcMessage.bind(this) : void 0\n }), this.pid = this.#handle.pid, onSpawnNT(this), ipc)\n this.send = this.#send, this.disconnect = this.#disconnect;\n }\n #emitIpcMessage(message) {\n this.emit(\"message\", message);\n }\n #send(message, handle, options, callback) {\n if (typeof handle === \"function\")\n callback = handle, handle = void 0, options = void 0;\n else if (typeof options === \"function\")\n callback = options, options = void 0;\n else if (options !== void 0) {\n if (typeof options !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n }\n if (!this.#handle) {\n if (callback)\n process.nextTick(callback, @makeTypeError(\"Process was closed while trying to send message\"));\n else\n this.emit(\"error\", @makeTypeError(\"Process was closed while trying to send message\"));\n return !1;\n }\n try {\n if (this.#handle.send(message), callback)\n process.nextTick(callback);\n return !0;\n } catch (error) {\n if (callback)\n process.nextTick(callback, error);\n else\n this.emit(\"error\", error);\n return !1;\n }\n }\n #disconnect() {\n if (!this.connected) {\n this.emit(\"error\", @makeTypeError(\"Process was closed while trying to send message\"));\n return;\n }\n this.connected = !1, this.#handle.disconnect();\n }\n kill(sig) {\n const signal = sig === 0 \? sig : convertToValidSignal(sig === void 0 \? \"SIGTERM\" : sig);\n if (this.#handle)\n this.#handle.kill(signal);\n return this.#maybeClose(), !0;\n }\n #maybeClose() {\n if (this.#closesGot++, this.#closesGot === this.#closesNeeded)\n this.emit(\"close\", this.exitCode, this.signalCode);\n }\n ref() {\n if (this.#handle)\n this.#handle.ref();\n }\n unref() {\n if (this.#handle)\n this.#handle.unref();\n }\n}\nvar nodeToBunLookup = {\n ignore: null,\n pipe: \"pipe\",\n overlapped: \"pipe\",\n inherit: \"inherit\"\n};\n\nclass ShimmedStdin extends EventEmitter {\n constructor() {\n super();\n }\n write() {\n return !1;\n }\n destroy() {\n }\n end() {\n }\n pipe() {\n }\n}\n\nclass ShimmedStdioOutStream extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n pipe() {\n }\n}\nvar validateAbortSignal = (signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n};\nvar validateObject = (value, name, options = null) => {\n const allowArray = options\?.allowArray \?\? !1, allowFunction = options\?.allowFunction \?\? !1;\n if (!(options\?.nullable \?\? !1) && value === null || !allowArray && ArrayIsArray.call(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE(name, \"object\", value);\n}, validateArray = (value, name, minLength = 0) => {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, Error = globalThis.Error, TypeError = globalThis.TypeError, RangeError = globalThis.RangeError;\n\nclass AbortError extends Error {\n code = \"ABORT_ERR\";\n name = \"AbortError\";\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n }\n}\n\nclass SystemError extends Error {\n path;\n syscall;\n errno;\n code;\n constructor(message, path, syscall, errno, code) {\n super(message);\n this.path = path, this.syscall = syscall, this.errno = errno, this.code = code;\n }\n get name() {\n return \"SystemError\";\n }\n}\n$ = {\n ChildProcess,\n spawn,\n execFile,\n exec,\n fork,\n spawnSync,\n execFileSync,\n execSync\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeChildProcessCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/child_process.ts\nvar spawn = function(file, args, options) {\n options = normalizeSpawnArguments(file, args, options), validateTimeout(options.timeout), validateAbortSignal(options.signal, \"options.signal\");\n const killSignal2 = sanitizeKillSignal(options.killSignal), child = new ChildProcess;\n if (child.spawn(options), options.timeout > 0) {\n let timeoutId = setTimeout(() => {\n if (timeoutId) {\n try {\n child.kill(killSignal2);\n } catch (err) {\n child.emit(\"error\", err);\n }\n timeoutId = null;\n }\n });\n child.once(\"exit\", () => {\n if (timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n });\n }\n if (options.signal) {\n let onAbortListener2 = function() {\n abortChildProcess(child, killSignal2, options.signal.reason);\n };\n var onAbortListener = onAbortListener2;\n const signal = options.signal;\n if (signal.aborted)\n process.nextTick(onAbortListener2);\n else\n signal.addEventListener(\"abort\", onAbortListener2, { once: !0 }), child.once(\"exit\", () => signal.removeEventListener(\"abort\", onAbortListener2));\n }\n return child;\n}, execFile = function(file, args, options, callback) {\n ({ file, args, options, callback } = normalizeExecFileArgs(file, args, options, callback)), options = {\n encoding: \"utf8\",\n timeout: 0,\n maxBuffer: MAX_BUFFER,\n killSignal: \"SIGTERM\",\n cwd: null,\n env: null,\n shell: !1,\n ...options\n };\n const maxBuffer = options.maxBuffer;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const child = spawn(file, args, {\n cwd: options.cwd,\n env: options.env,\n shell: options.shell,\n signal: options.signal\n });\n let encoding;\n const _stdout = [], _stderr = [];\n if (options.encoding !== \"buffer\" && BufferIsEncoding(options.encoding))\n encoding = options.encoding;\n else\n encoding = null;\n let stdoutLen = 0, stderrLen = 0, killed = !1, exited = !1, timeoutId, encodedStdoutLen, encodedStderrLen, ex = null, cmd = file;\n function exitHandler(code, signal) {\n if (exited)\n return;\n if (exited = !0, timeoutId)\n clearTimeout(timeoutId), timeoutId = null;\n if (!callback)\n return;\n const readableEncoding = child\?.stdout\?.readableEncoding;\n let stdout, stderr;\n if (encoding || child.stdout && readableEncoding)\n stdout = ArrayPrototypeJoin.@call(_stdout, \"\");\n else\n stdout = BufferConcat(_stdout);\n if (encoding || child.stderr && readableEncoding)\n stderr = ArrayPrototypeJoin.@call(_stderr, \"\");\n else\n stderr = BufferConcat(_stderr);\n if (!ex && code === 0 && signal === null) {\n callback(null, stdout, stderr);\n return;\n }\n if (args\?.length)\n cmd += ` ${ArrayPrototypeJoin.@call(args, \" \")}`;\n if (!ex) {\n let message = `Command failed: ${cmd}`;\n if (stderr)\n message += `\\n${stderr}`;\n ex = genericNodeError(message, {\n code,\n killed: child.killed || killed,\n signal\n });\n }\n ex.cmd = cmd, callback(ex, stdout, stderr);\n }\n function errorHandler(e) {\n if (ex = e, child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n exitHandler();\n }\n function kill() {\n if (child.stdout)\n child.stdout.destroy();\n if (child.stderr)\n child.stderr.destroy();\n killed = !0;\n try {\n child.kill(options.killSignal);\n } catch (e) {\n ex = e, exitHandler();\n }\n }\n if (options.timeout > 0)\n timeoutId = setTimeout(function delayedKill() {\n kill(), timeoutId = null;\n }, options.timeout);\n if (child.stdout) {\n if (encoding)\n child.stdout.setEncoding(encoding);\n child.stdout.on(\"data\", maxBuffer === @Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.@call(_stdout, chunk);\n } : encoding \? function onChildStdoutEncoded(chunk) {\n if (stdoutLen += chunk.length, stdoutLen * 4 > maxBuffer) {\n const encoding2 = child.stdout.readableEncoding, actualLen = @Buffer.byteLength(chunk, encoding2);\n if (encodedStdoutLen === @undefined)\n for (let i = 0;i < _stdout.length; i++)\n encodedStdoutLen += @Buffer.byteLength(_stdout[i], encoding2);\n else\n encodedStdoutLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStdoutLen - actualLen);\n ArrayPrototypePush.@call(_stdout, StringPrototypeSlice.@apply(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.@call(_stdout, chunk);\n } : function onChildStdoutRaw(chunk) {\n if (stdoutLen += chunk.length, stdoutLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stdoutLen - chunk.length);\n ArrayPrototypePush.@call(_stdout, chunk.slice(0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stdout\"), kill();\n } else\n ArrayPrototypePush.@call(_stdout, chunk);\n });\n }\n if (child.stderr) {\n if (encoding)\n child.stderr.setEncoding(encoding);\n child.stderr.on(\"data\", maxBuffer === @Infinity \? function onUnlimitedSizeBufferedData(chunk) {\n ArrayPrototypePush.@call(_stderr, chunk);\n } : encoding \? function onChildStderrEncoded(chunk) {\n if (stderrLen += chunk.length, stderrLen * 4 > maxBuffer) {\n const encoding2 = child.stderr.readableEncoding, actualLen = @Buffer.byteLength(chunk, encoding2);\n if (encodedStderrLen === @undefined)\n for (let i = 0;i < _stderr.length; i++)\n encodedStderrLen += @Buffer.byteLength(_stderr[i], encoding2);\n else\n encodedStderrLen += actualLen;\n const truncatedLen = maxBuffer - (encodedStderrLen - actualLen);\n ArrayPrototypePush.@call(_stderr, StringPrototypeSlice.@call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.@call(_stderr, chunk);\n } : function onChildStderrRaw(chunk) {\n if (stderrLen += chunk.length, stderrLen > maxBuffer) {\n const truncatedLen = maxBuffer - (stderrLen - chunk.length);\n ArrayPrototypePush.@call(_stderr, StringPrototypeSlice.@call(chunk, 0, truncatedLen)), ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER(\"stderr\"), kill();\n } else\n ArrayPrototypePush.@call(_stderr, chunk);\n });\n }\n return child.addListener(\"close\", exitHandler), child.addListener(\"error\", errorHandler), child;\n}, exec = function(command, options, callback) {\n const opts = normalizeExecArgs(command, options, callback);\n return execFile(opts.file, opts.options, opts.callback);\n}, spawnSync = function(file, args, options) {\n options = {\n maxBuffer: MAX_BUFFER,\n ...normalizeSpawnArguments(file, args, options)\n };\n const { maxBuffer, encoding } = options;\n validateTimeout(options.timeout), validateMaxBuffer(maxBuffer), options.killSignal = sanitizeKillSignal(options.killSignal);\n const stdio = options.stdio || \"pipe\", bunStdio = getBunStdioFromOptions(stdio);\n var { input } = options;\n if (input)\n if (ArrayBufferIsView(input))\n bunStdio[0] = input;\n else if (typeof input === \"string\")\n bunStdio[0] = @Buffer.from(input, encoding || \"utf8\");\n else\n throw new ERR_INVALID_ARG_TYPE(\"options.stdio[0]\", [\"Buffer\", \"TypedArray\", \"DataView\", \"string\"], input);\n const { stdout, stderr, success, exitCode } = Bun.spawnSync({\n cmd: options.args,\n env: options.env || @undefined,\n cwd: options.cwd || @undefined,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2]\n }), result = {\n signal: null,\n status: exitCode,\n output: [null, stdout, stderr]\n };\n if (stdout && encoding && encoding !== \"buffer\")\n result.output[1] = result.output[1]\?.toString(encoding);\n if (stderr && encoding && encoding !== \"buffer\")\n result.output[2] = result.output[2]\?.toString(encoding);\n if (result.stdout = result.output[1], result.stderr = result.output[2], !success)\n result.error = new SystemError(result.output[2], options.file, \"spawnSync\", -1, result.status), result.error.spawnargs = ArrayPrototypeSlice.@call(options.args, 1);\n return result;\n}, execFileSync = function(file, args, options) {\n ({ file, args, options } = normalizeExecFileArgs(file, args, options));\n const ret = spawnSync(file, args, options), errArgs = [options.argv0 || file];\n ArrayPrototypePush.@apply(errArgs, args);\n const err = checkExecSyncError(ret, errArgs);\n if (err)\n throw err;\n return ret.stdout;\n}, execSync = function(command, options) {\n const opts = normalizeExecArgs(command, options, null), ret = spawnSync(opts.file, opts.options), err = checkExecSyncError(ret, @undefined, command);\n if (err)\n throw err;\n return ret.stdout;\n}, stdioStringToArray = function(stdio, channel) {\n const options = [];\n switch (stdio) {\n case \"ignore\":\n case \"overlapped\":\n case \"pipe\":\n ArrayPrototypePush.@call(options, stdio, stdio, stdio);\n break;\n case \"inherit\":\n ArrayPrototypePush.@call(options, 0, 1, 2);\n break;\n default:\n throw new ERR_INVALID_ARG_VALUE(\"stdio\", stdio);\n }\n if (channel)\n ArrayPrototypePush.@call(options, channel);\n return options;\n}, fork = function(modulePath, args = [], options) {\n modulePath = getValidatedPath(modulePath, \"modulePath\");\n let execArgv;\n if (args == null)\n args = [];\n else if (typeof args === \"object\" && !ArrayIsArray(args))\n options = args, args = [];\n else\n validateArray(args, \"args\");\n if (options != null)\n validateObject(options, \"options\");\n if (options = { __proto__: null, ...options, shell: !1 }, options.execPath = options.execPath || process.execPath, validateArgumentNullCheck(options.execPath, \"options.execPath\"), args = [modulePath, ...args], typeof options.stdio === \"string\")\n options.stdio = stdioStringToArray(options.stdio, \"ipc\");\n else if (!ArrayIsArray(options.stdio))\n options.stdio = stdioStringToArray(options.silent \? \"pipe\" : \"inherit\", \"ipc\");\n else if (!ArrayPrototypeIncludes.@call(options.stdio, \"ipc\"))\n throw new ERR_CHILD_PROCESS_IPC_REQUIRED(\"options.stdio\");\n return spawn(options.execPath, args, options);\n}, convertToValidSignal = function(signal) {\n if (typeof signal === \"number\" && getSignalsToNamesMapping()[signal])\n return signal;\n if (typeof signal === \"string\") {\n const signalName = signals[StringPrototypeToUpperCase.@call(signal)];\n if (signalName)\n return signalName;\n }\n throw new ERR_UNKNOWN_SIGNAL(signal);\n}, sanitizeKillSignal = function(killSignal2) {\n if (typeof killSignal2 === \"string\" || typeof killSignal2 === \"number\")\n return convertToValidSignal(killSignal2);\n else if (killSignal2 != null)\n throw new ERR_INVALID_ARG_TYPE(\"options.killSignal\", [\"string\", \"number\"], killSignal2);\n}, getSignalsToNamesMapping = function() {\n if (signalsToNamesMapping !== @undefined)\n return signalsToNamesMapping;\n signalsToNamesMapping = ObjectCreate(null);\n for (let key in signals)\n signalsToNamesMapping[signals[key]] = key;\n return signalsToNamesMapping;\n}, normalizeExecFileArgs = function(file, args, options, callback) {\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.@call(args);\n else if (args != null && typeof args === \"object\")\n callback = options, options = args, args = null;\n else if (typeof args === \"function\")\n callback = args, options = null, args = null;\n if (args == null)\n args = [];\n if (typeof options === \"function\")\n callback = options;\n else if (options != null)\n validateObject(options, \"options\");\n if (options == null)\n options = kEmptyObject;\n if (callback != null)\n validateFunction(callback, \"callback\");\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n return { file, args, options, callback };\n}, normalizeExecArgs = function(command, options, callback) {\n if (validateString(command, \"command\"), validateArgumentNullCheck(command, \"command\"), typeof options === \"function\")\n callback = options, options = @undefined;\n return options = { ...options }, options.shell = typeof options.shell === \"string\" \? options.shell : !0, {\n file: command,\n options,\n callback\n };\n}, normalizeSpawnArguments = function(file, args, options) {\n if (validateString(file, \"file\"), validateArgumentNullCheck(file, \"file\"), file.length === 0)\n throw new ERR_INVALID_ARG_VALUE(\"file\", file, \"cannot be empty\");\n if (ArrayIsArray(args))\n args = ArrayPrototypeSlice.@call(args);\n else if (args == null)\n args = [];\n else if (typeof args !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"args\", \"object\", args);\n else\n options = args, args = [];\n if (validateArgumentsNullCheck(args, \"args\"), options === @undefined)\n options = {};\n else\n validateObject(options, \"options\");\n let cwd = options.cwd;\n if (cwd != null)\n cwd = getValidatedPath(cwd, \"options.cwd\");\n var detached = !1;\n const { detached: detachedOption } = options;\n if (detachedOption != null)\n detached = !!detachedOption;\n if (options.shell != null && typeof options.shell !== \"boolean\" && typeof options.shell !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(\"options.shell\", [\"boolean\", \"string\"], options.shell);\n if (options.argv0 != null)\n validateString(options.argv0, \"options.argv0\"), validateArgumentNullCheck(options.argv0, \"options.argv0\");\n if (options.shell) {\n validateArgumentNullCheck(options.shell, \"options.shell\");\n const command = ArrayPrototypeJoin.@call([file, ...args], \" \");\n if (typeof options.shell === \"string\")\n file = options.shell;\n else\n file = \"sh\";\n args = [\"-c\", command];\n }\n if (typeof options.argv0 === \"string\")\n ArrayPrototypeUnshift.@call(args, options.argv0);\n else\n ArrayPrototypeUnshift.@call(args, file);\n const envPairs = options.env || process.env;\n return { ...options, detached, file, args, cwd, envPairs };\n}, checkExecSyncError = function(ret, args, cmd) {\n let err;\n if (ret.error)\n err = ret.error, ObjectAssign(err, ret);\n else if (ret.status !== 0) {\n let msg = \"Command failed: \";\n if (msg += cmd || ArrayPrototypeJoin.@call(args, \" \"), ret.stderr && ret.stderr.length > 0)\n msg += `\\n${ret.stderr.toString()}`;\n err = genericNodeError(msg, ret);\n }\n return err;\n}, nodeToBun = function(item) {\n if (typeof item === \"number\")\n return item;\n else {\n const result = nodeToBunLookup[item];\n if (result === @undefined)\n throw new Error(`Invalid stdio option \"${item}\"`);\n return result;\n }\n}, fdToStdioName = function(fd) {\n switch (fd) {\n case 0:\n return \"stdin\";\n case 1:\n return \"stdout\";\n case 2:\n return \"stderr\";\n default:\n return null;\n }\n}, getBunStdioFromOptions = function(stdio) {\n return normalizeStdio(stdio).map((item) => nodeToBun(item));\n}, normalizeStdio = function(stdio) {\n if (typeof stdio === \"string\")\n switch (stdio) {\n case \"ignore\":\n return [\"ignore\", \"ignore\", \"ignore\"];\n case \"pipe\":\n return [\"pipe\", \"pipe\", \"pipe\"];\n case \"inherit\":\n return [\"inherit\", \"inherit\", \"inherit\"];\n default:\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n }\n else if (ArrayIsArray(stdio)) {\n let processedStdio;\n if (stdio.length === 0)\n processedStdio = [\"pipe\", \"pipe\", \"pipe\"];\n else if (stdio.length === 1)\n processedStdio = [stdio[0], \"pipe\", \"pipe\"];\n else if (stdio.length === 2)\n processedStdio = [stdio[0], stdio[1], \"pipe\"];\n else if (stdio.length >= 3)\n processedStdio = [stdio[0], stdio[1], stdio[2]];\n return processedStdio.map((item) => !item \? \"pipe\" : item);\n } else\n throw new ERR_INVALID_OPT_VALUE(\"stdio\", stdio);\n}, flushStdio = function(subprocess) {\n const stdio = subprocess.stdio;\n if (stdio == null)\n return;\n for (let i = 0;i < stdio.length; i++) {\n const stream = stdio[i];\n if (!stream || !stream.readable)\n continue;\n stream.resume();\n }\n}, onSpawnNT = function(self) {\n self.emit(\"spawn\");\n}, abortChildProcess = function(child, killSignal2, reason) {\n if (!child)\n return;\n try {\n if (child.kill(killSignal2))\n child.emit(\"error\", new AbortError(@undefined, { cause: reason }));\n } catch (err) {\n child.emit(\"error\", err);\n }\n}, validateMaxBuffer = function(maxBuffer) {\n if (maxBuffer != null && !(typeof maxBuffer === \"number\" && maxBuffer >= 0))\n throw new ERR_OUT_OF_RANGE(\"options.maxBuffer\", \"a positive number\", maxBuffer);\n}, validateArgumentNullCheck = function(arg, propName) {\n if (typeof arg === \"string\" && StringPrototypeIncludes.@call(arg, \"\\0\"))\n throw new ERR_INVALID_ARG_VALUE(propName, arg, \"must be a string without null bytes\");\n}, validateArgumentsNullCheck = function(args, propName) {\n for (let i = 0;i < args.length; ++i)\n validateArgumentNullCheck(args[i], `${propName}[${i}]`);\n}, validateTimeout = function(timeout) {\n if (timeout != null && !(NumberIsInteger(timeout) && timeout >= 0))\n throw new ERR_OUT_OF_RANGE(\"timeout\", \"an unsigned integer\", timeout);\n};\nvar validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, nullCheck = function(path, propName, throwError = !0) {\n const pathIsString = typeof path === \"string\", pathIsUint8Array = isUint8Array(path);\n if (!pathIsString && !pathIsUint8Array || pathIsString && !StringPrototypeIncludes.@call(path, \"\\0\") || pathIsUint8Array && !Uint8ArrayPrototypeIncludes.@call(path, 0))\n return;\n const err = new ERR_INVALID_ARG_VALUE(propName, path, \"must be a string or Uint8Array without null bytes\");\n if (throwError)\n throw err;\n return err;\n}, validatePath = function(path, propName = \"path\") {\n if (typeof path !== \"string\" && !isUint8Array(path))\n throw new ERR_INVALID_ARG_TYPE(propName, [\"string\", \"Buffer\", \"URL\"], path);\n const err = nullCheck(path, propName, !1);\n if (err !== @undefined)\n throw err;\n}, getValidatedPath = function(fileURLOrPath, propName = \"path\") {\n const path = toPathIfFileURL(fileURLOrPath);\n return validatePath(path, propName), path;\n}, isUint8Array = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof @Uint8Array;\n}, isURLInstance = function(fileURLOrPath) {\n return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin;\n}, toPathIfFileURL = function(fileURLOrPath) {\n if (!isURLInstance(fileURLOrPath))\n return fileURLOrPath;\n return Bun.fileURLToPath(fileURLOrPath);\n}, genericNodeError = function(message, options) {\n const err = new Error(message);\n return err.code = options.code, err.killed = options.killed, err.signal = options.signal, err;\n}, ERR_OUT_OF_RANGE = function(str, range, input, replaceDefaultBoolean = !1) {\n return new RangeError(`The value of ${str} is out of range. It must be ${range}. Received ${input}`);\n}, ERR_CHILD_PROCESS_STDIO_MAXBUFFER = function(stdio) {\n return Error(`${stdio} maxBuffer length exceeded`);\n}, ERR_UNKNOWN_SIGNAL = function(name) {\n const err = @makeTypeError(`Unknown signal: ${name}`);\n return err.code = \"ERR_UNKNOWN_SIGNAL\", err;\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value\?.toString()}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_INVALID_OPT_VALUE = function(name, value) {\n return @makeTypeError(`The value \"${value}\" is invalid for option \"${name}\"`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value \"${value}\" is invalid for argument '${name}'. Reason: ${reason}`);\n}, ERR_CHILD_PROCESS_IPC_REQUIRED = function(name) {\n const err = @makeTypeError(`Forked processes must have an IPC channel, missing value 'ipc' in ${name}`);\n return err.code = \"ERR_CHILD_PROCESS_IPC_REQUIRED\", err;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), StreamModule = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), {\n constants: { signals }\n} = @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28), { promisify } = @getInternalField(@internalModuleRegistry, 48) || @createInternalModuleById(48), ObjectCreate = Object.create, ObjectAssign = Object.assign, ObjectDefineProperty = Object.defineProperty, BufferConcat = @Buffer.concat, BufferIsEncoding = @Buffer.isEncoding, kEmptyObject = ObjectCreate(null), ArrayPrototypePush = @Array.prototype.push, ArrayPrototypeJoin = @Array.prototype.join, ArrayPrototypeMap = @Array.prototype.map, ArrayPrototypeIncludes = @Array.prototype.includes, ArrayPrototypeSlice = @Array.prototype.slice, ArrayPrototypeUnshift = @Array.prototype.unshift, ArrayPrototypeLastIndexOf = @Array.prototype.lastIndexOf, ArrayPrototypeSplice = @Array.prototype.splice, ArrayIsArray = @Array.isArray, ArrayBufferIsView = @ArrayBuffer.isView, NumberIsInteger = Number.isInteger;\nvar StringPrototypeToUpperCase = @String.prototype.toUpperCase, StringPrototypeIncludes = @String.prototype.includes, StringPrototypeSlice = @String.prototype.slice, Uint8ArrayPrototypeIncludes = @Uint8Array.prototype.includes, MAX_BUFFER = 1048576, NativeWritable, ReadableFromWeb, customPromiseExecFunction = (orig) => {\n return (...args) => {\n let resolve, reject;\n const promise = new @Promise((res, rej) => {\n resolve = res, reject = rej;\n });\n return promise.child = orig(...args, (err, stdout, stderr) => {\n if (err !== null)\n err.stdout = stdout, err.stderr = stderr, reject(err);\n else\n resolve({ stdout, stderr });\n }), promise;\n };\n};\nObjectDefineProperty(exec, promisify.custom, {\n __proto__: null,\n enumerable: !1,\n value: customPromiseExecFunction(exec)\n});\nvar signalsToNamesMapping;\n\nclass ChildProcess extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n #handle;\n #exited = !1;\n #closesNeeded = 1;\n #closesGot = 0;\n connected = !1;\n signalCode = null;\n exitCode = null;\n spawnfile;\n spawnargs;\n pid;\n channel;\n get killed() {\n if (this.#handle == null)\n return !1;\n }\n #handleOnExit(exitCode, signalCode, err) {\n if (this.#exited)\n return;\n if (signalCode)\n this.signalCode = signalCode;\n else\n this.exitCode = exitCode;\n if (this.#stdin)\n this.#stdin.destroy();\n if (this.#handle)\n this.#handle = null;\n if (exitCode < 0) {\n const err2 = new SystemError(`Spawned process exited with error code: ${exitCode}`, @undefined, \"spawn\", \"EUNKNOWN\", \"ERR_CHILD_PROCESS_UNKNOWN_ERROR\");\n if (this.spawnfile)\n err2.path = this.spawnfile;\n err2.spawnargs = ArrayPrototypeSlice.@call(this.spawnargs, 1), this.emit(\"error\", err2);\n } else\n this.emit(\"exit\", this.exitCode, this.signalCode);\n process.nextTick(flushStdio, this), this.#maybeClose(), this.#exited = !0, this.#stdioOptions = [\"destroyed\", \"destroyed\", \"destroyed\"];\n }\n #getBunSpawnIo(i, encoding) {\n NativeWritable ||= StreamModule.NativeWritable, ReadableFromWeb ||= StreamModule.Readable.fromWeb;\n const io = this.#stdioOptions[i];\n switch (i) {\n case 0:\n switch (io) {\n case \"pipe\":\n return new NativeWritable(this.#handle.stdin);\n case \"inherit\":\n return process.stdin || null;\n case \"destroyed\":\n return new ShimmedStdin;\n default:\n return null;\n }\n case 2:\n case 1:\n switch (io) {\n case \"pipe\":\n return ReadableFromWeb(this.#handle[fdToStdioName(i)], { encoding });\n case \"inherit\":\n return process[fdToStdioName(i)] || null;\n case \"destroyed\":\n return new ShimmedStdioOutStream;\n default:\n return null;\n }\n }\n }\n #stdin;\n #stdout;\n #stderr;\n #stdioObject;\n #encoding;\n #stdioOptions;\n #createStdioObject() {\n return Object.create(null, {\n 0: {\n get: () => this.stdin\n },\n 1: {\n get: () => this.stdout\n },\n 2: {\n get: () => this.stderr\n }\n });\n }\n get stdin() {\n return this.#stdin \?\?= this.#getBunSpawnIo(0, this.#encoding);\n }\n get stdout() {\n return this.#stdout \?\?= this.#getBunSpawnIo(1, this.#encoding);\n }\n get stderr() {\n return this.#stderr \?\?= this.#getBunSpawnIo(2, this.#encoding);\n }\n get stdio() {\n return this.#stdioObject \?\?= this.#createStdioObject();\n }\n spawn(options) {\n validateObject(options, \"options\"), validateString(options.file, \"options.file\");\n var file = this.spawnfile = options.file, spawnargs;\n if (options.args == null)\n spawnargs = this.spawnargs = [];\n else\n validateArray(options.args, \"options.args\"), spawnargs = this.spawnargs = options.args;\n const stdio = options.stdio || [\"pipe\", \"pipe\", \"pipe\"], bunStdio = getBunStdioFromOptions(stdio), ipc = @isArray(stdio) && stdio[3] === \"ipc\";\n var env = options.envPairs || @undefined;\n const detachedOption = options.detached;\n if (this.#encoding = options.encoding || @undefined, this.#stdioOptions = bunStdio, this.#handle = Bun.spawn({\n cmd: spawnargs,\n stdin: bunStdio[0],\n stdout: bunStdio[1],\n stderr: bunStdio[2],\n cwd: options.cwd || @undefined,\n env: env || process.env,\n detached: typeof detachedOption !== \"undefined\" \? !!detachedOption : !1,\n onExit: (handle, exitCode, signalCode, err) => {\n this.#handle = handle, this.pid = this.#handle.pid, process.nextTick((exitCode2, signalCode2, err2) => this.#handleOnExit(exitCode2, signalCode2, err2), exitCode, signalCode, err);\n },\n lazy: !0,\n ipc: ipc \? this.#emitIpcMessage.bind(this) : @undefined\n }), this.pid = this.#handle.pid, onSpawnNT(this), ipc)\n this.send = this.#send, this.disconnect = this.#disconnect;\n }\n #emitIpcMessage(message) {\n this.emit(\"message\", message);\n }\n #send(message, handle, options, callback) {\n if (typeof handle === \"function\")\n callback = handle, handle = @undefined, options = @undefined;\n else if (typeof options === \"function\")\n callback = options, options = @undefined;\n else if (options !== @undefined) {\n if (typeof options !== \"object\" || options === null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n }\n if (!this.#handle) {\n if (callback)\n process.nextTick(callback, @makeTypeError(\"Process was closed while trying to send message\"));\n else\n this.emit(\"error\", @makeTypeError(\"Process was closed while trying to send message\"));\n return !1;\n }\n try {\n if (this.#handle.send(message), callback)\n process.nextTick(callback);\n return !0;\n } catch (error) {\n if (callback)\n process.nextTick(callback, error);\n else\n this.emit(\"error\", error);\n return !1;\n }\n }\n #disconnect() {\n if (!this.connected) {\n this.emit(\"error\", @makeTypeError(\"Process was closed while trying to send message\"));\n return;\n }\n this.connected = !1, this.#handle.disconnect();\n }\n kill(sig) {\n const signal = sig === 0 \? sig : convertToValidSignal(sig === @undefined \? \"SIGTERM\" : sig);\n if (this.#handle)\n this.#handle.kill(signal);\n return this.#maybeClose(), !0;\n }\n #maybeClose() {\n if (this.#closesGot++, this.#closesGot === this.#closesNeeded)\n this.emit(\"close\", this.exitCode, this.signalCode);\n }\n ref() {\n if (this.#handle)\n this.#handle.ref();\n }\n unref() {\n if (this.#handle)\n this.#handle.unref();\n }\n}\nvar nodeToBunLookup = {\n ignore: null,\n pipe: \"pipe\",\n overlapped: \"pipe\",\n inherit: \"inherit\"\n};\n\nclass ShimmedStdin extends EventEmitter {\n constructor() {\n super();\n }\n write() {\n return !1;\n }\n destroy() {\n }\n end() {\n }\n pipe() {\n }\n}\n\nclass ShimmedStdioOutStream extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n pipe() {\n }\n}\nvar validateAbortSignal = (signal, name) => {\n if (signal !== @undefined && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n};\nvar validateObject = (value, name, options = null) => {\n const allowArray = options\?.allowArray \?\? !1, allowFunction = options\?.allowFunction \?\? !1;\n if (!(options\?.nullable \?\? !1) && value === null || !allowArray && ArrayIsArray.@call(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE(name, \"object\", value);\n}, validateArray = (value, name, minLength = 0) => {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, Error = globalThis.Error, TypeError = globalThis.TypeError, RangeError = globalThis.RangeError;\n\nclass AbortError extends Error {\n code = \"ABORT_ERR\";\n name = \"AbortError\";\n constructor(message = \"The operation was aborted\", options = @undefined) {\n if (options !== @undefined && typeof options !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n }\n}\n\nclass SystemError extends Error {\n path;\n syscall;\n errno;\n code;\n constructor(message, path, syscall, errno, code) {\n super(message);\n this.path = path, this.syscall = syscall, this.errno = errno, this.code = code;\n }\n get name() {\n return \"SystemError\";\n }\n}\n$ = {\n ChildProcess,\n spawn,\n execFile,\n exec,\n fork,\n spawnSync,\n execFileSync,\n execSync\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeClusterCode = "(function (){\"use strict\";// src/js/out/tmp/node/cluster.ts\nvar EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5);\n\nclass Cluster extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n isWorker = !1;\n isPrimary = !0;\n isMaster = !0;\n workers = {};\n settings = {};\n SCHED_NONE = 1;\n SCHED_RR = 2;\n schedulingPolicy = 2;\n Worker = function Worker() {\n throwNotImplemented(\"node:cluster Worker\", 2428);\n };\n setupPrimary() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n setupMaster() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n fork() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n disconnect() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n}\nreturn new Cluster})\n"_s;
+static constexpr ASCIILiteral NodeClusterCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/cluster.ts\nvar EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6);\n\nclass Cluster extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n isWorker = !1;\n isPrimary = !0;\n isMaster = !0;\n workers = {};\n settings = {};\n SCHED_NONE = 1;\n SCHED_RR = 2;\n schedulingPolicy = 2;\n Worker = function Worker() {\n throwNotImplemented(\"node:cluster Worker\", 2428);\n };\n setupPrimary() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n setupMaster() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n fork() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n disconnect() {\n throwNotImplemented(\"node:cluster\", 2428);\n }\n}\nreturn new Cluster})\n");
//
//
-static constexpr ASCIILiteral NodeConsoleCode = "(function (){\"use strict\";// src/js/out/tmp/node/console.ts\nreturn console})\n"_s;
+static constexpr ASCIILiteral NodeConsoleCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/console.ts\nreturn console})\n");
//
//
-static constexpr ASCIILiteral NodeCryptoCode = "(function (){\"use strict\";// src/js/out/tmp/node/crypto.ts\nvar getArrayBufferOrView = function(buffer, name, encoding) {\n if (isAnyArrayBuffer(buffer))\n return buffer;\n if (typeof buffer === \"string\") {\n if (encoding === \"buffer\")\n encoding = \"utf8\";\n return Buffer.from(buffer, encoding);\n }\n if (!isArrayBufferView(buffer)) {\n var error = @makeTypeError(`ERR_INVALID_ARG_TYPE: The \"${name}\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, or DataView. Received ` + buffer);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n return buffer;\n}, getCurves = function() {\n return harcoded_curves;\n}, $, __defProp = Object.defineProperty, __getOwnPropNames = Object.getOwnPropertyNames, StreamModule = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), BufferModule = @requireNativeModule(\"buffer\"), StringDecoder = @requireNativeModule(\"string_decoder\").StringDecoder, MAX_STRING_LENGTH = 536870888, Buffer = globalThis.Buffer, EMPTY_BUFFER = Buffer.alloc(0), { isAnyArrayBuffer, isArrayBufferView } = @requireNativeModule(\"util/types\"), crypto = globalThis.crypto, globalCrypto = crypto, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: !0 });\n}, require_safe_buffer = __commonJS({\n \"node_modules/safe-buffer/index.js\"(exports, module) {\n var buffer = BufferModule, Buffer2 = buffer.Buffer;\n function copyProps(src, dst) {\n for (var key in src)\n dst[key] = src[key];\n }\n Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow \? module.exports = buffer : (copyProps(buffer, exports), exports.Buffer = SafeBuffer);\n function SafeBuffer(arg, encodingOrOffset, length) {\n return Buffer2(arg, encodingOrOffset, length);\n }\n SafeBuffer.prototype = Object.create(Buffer2.prototype), copyProps(Buffer2, SafeBuffer), SafeBuffer.from = function(arg, encodingOrOffset, length) {\n if (typeof arg == \"number\")\n @throwTypeError(\"Argument must not be a number\");\n return Buffer2(arg, encodingOrOffset, length);\n }, SafeBuffer.alloc = function(size, fill, encoding) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n var buf = Buffer2(size);\n return fill !== void 0 \? typeof encoding == \"string\" \? buf.fill(fill, encoding) : buf.fill(fill) : buf.fill(0), buf;\n }, SafeBuffer.allocUnsafe = function(size) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n return Buffer2(size);\n }, SafeBuffer.allocUnsafeSlow = function(size) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n return buffer.SlowBuffer(size);\n };\n }\n}), require_browser = __commonJS({\n \"node_modules/randombytes/browser.js\"(exports, module) {\n var MAX_BYTES = 65536, MAX_UINT32 = 4294967295;\n function oldBrowser() {\n throw new Error(`Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11`);\n }\n var Buffer2 = require_safe_buffer().Buffer, crypto2 = globalCrypto;\n crypto2 && crypto2.getRandomValues \? module.exports = randomBytes : module.exports = oldBrowser;\n function randomBytes(size, cb) {\n if (size > MAX_UINT32)\n @throwRangeError(\"requested too many random bytes\");\n var bytes = Buffer2.allocUnsafe(size);\n if (size > 0)\n if (size > MAX_BYTES)\n for (var generated = 0;generated < size; generated += MAX_BYTES)\n crypto2.getRandomValues(bytes.slice(generated, generated + MAX_BYTES));\n else\n crypto2.getRandomValues(bytes);\n return typeof cb == \"function\" \? process.nextTick(function() {\n cb(null, bytes);\n }) : bytes;\n }\n }\n}), require_inherits_browser = __commonJS({\n \"node_modules/inherits/inherits_browser.js\"(exports, module) {\n module.exports = function(ctor, superCtor) {\n superCtor && (ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }));\n };\n }\n}), require_hash_base = __commonJS({\n \"node_modules/hash-base/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, inherits = require_inherits_browser();\n function throwIfNotStringOrBuffer(val, prefix) {\n if (!Buffer2.isBuffer(val) && typeof val != \"string\")\n @throwTypeError(prefix + \" must be a string or a buffer\");\n }\n function HashBase(blockSize) {\n StreamModule.Transform.call(this), this._block = Buffer2.allocUnsafe(blockSize), this._blockSize = blockSize, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = !1;\n }\n inherits(HashBase, StreamModule.Transform), HashBase.prototype._transform = function(chunk, encoding, callback) {\n var error = null;\n try {\n this.update(chunk, encoding);\n } catch (err) {\n error = err;\n }\n callback(error);\n }, HashBase.prototype._flush = function(callback) {\n var error = null;\n try {\n this.push(this.digest());\n } catch (err) {\n error = err;\n }\n callback(error);\n }, HashBase.prototype.update = function(data, encoding) {\n if (throwIfNotStringOrBuffer(data, \"Data\"), this._finalized)\n throw new Error(\"Digest already called\");\n Buffer2.isBuffer(data) || (data = Buffer2.from(data, encoding));\n for (var block = this._block, offset = 0;this._blockOffset + data.length - offset >= this._blockSize; ) {\n for (var i = this._blockOffset;i < this._blockSize; )\n block[i++] = data[offset++];\n this._update(), this._blockOffset = 0;\n }\n for (;offset < data.length; )\n block[this._blockOffset++] = data[offset++];\n for (var j = 0, carry = data.length * 8;carry > 0; ++j)\n this._length[j] += carry, carry = this._length[j] / 4294967296 | 0, carry > 0 && (this._length[j] -= 4294967296 * carry);\n return this;\n }, HashBase.prototype._update = function() {\n throw new Error(\"_update is not implemented\");\n }, HashBase.prototype.digest = function(encoding) {\n if (this._finalized)\n throw new Error(\"Digest already called\");\n this._finalized = !0;\n var digest = this._digest();\n encoding !== void 0 && (digest = digest.toString(encoding)), this._block.fill(0), this._blockOffset = 0;\n for (var i = 0;i < 4; ++i)\n this._length[i] = 0;\n return digest;\n }, HashBase.prototype._digest = function() {\n throw new Error(\"_digest is not implemented\");\n }, module.exports = HashBase;\n }\n}), require_md5 = __commonJS({\n \"node_modules/md5.js/index.js\"(exports, module) {\n var inherits = require_inherits_browser(), HashBase = require_hash_base(), Buffer2 = require_safe_buffer().Buffer, ARRAY16 = new Array(16);\n function MD5() {\n HashBase.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878;\n }\n inherits(MD5, HashBase), MD5.prototype._update = function() {\n for (var M = ARRAY16, i = 0;i < 16; ++i)\n M[i] = this._block.readInt32LE(i * 4);\n var a = this._a, b = this._b, c = this._c, d = this._d;\n a = fnF(a, b, c, d, M[0], 3614090360, 7), d = fnF(d, a, b, c, M[1], 3905402710, 12), c = fnF(c, d, a, b, M[2], 606105819, 17), b = fnF(b, c, d, a, M[3], 3250441966, 22), a = fnF(a, b, c, d, M[4], 4118548399, 7), d = fnF(d, a, b, c, M[5], 1200080426, 12), c = fnF(c, d, a, b, M[6], 2821735955, 17), b = fnF(b, c, d, a, M[7], 4249261313, 22), a = fnF(a, b, c, d, M[8], 1770035416, 7), d = fnF(d, a, b, c, M[9], 2336552879, 12), c = fnF(c, d, a, b, M[10], 4294925233, 17), b = fnF(b, c, d, a, M[11], 2304563134, 22), a = fnF(a, b, c, d, M[12], 1804603682, 7), d = fnF(d, a, b, c, M[13], 4254626195, 12), c = fnF(c, d, a, b, M[14], 2792965006, 17), b = fnF(b, c, d, a, M[15], 1236535329, 22), a = fnG(a, b, c, d, M[1], 4129170786, 5), d = fnG(d, a, b, c, M[6], 3225465664, 9), c = fnG(c, d, a, b, M[11], 643717713, 14), b = fnG(b, c, d, a, M[0], 3921069994, 20), a = fnG(a, b, c, d, M[5], 3593408605, 5), d = fnG(d, a, b, c, M[10], 38016083, 9), c = fnG(c, d, a, b, M[15], 3634488961, 14), b = fnG(b, c, d, a, M[4], 3889429448, 20), a = fnG(a, b, c, d, M[9], 568446438, 5), d = fnG(d, a, b, c, M[14], 3275163606, 9), c = fnG(c, d, a, b, M[3], 4107603335, 14), b = fnG(b, c, d, a, M[8], 1163531501, 20), a = fnG(a, b, c, d, M[13], 2850285829, 5), d = fnG(d, a, b, c, M[2], 4243563512, 9), c = fnG(c, d, a, b, M[7], 1735328473, 14), b = fnG(b, c, d, a, M[12], 2368359562, 20), a = fnH(a, b, c, d, M[5], 4294588738, 4), d = fnH(d, a, b, c, M[8], 2272392833, 11), c = fnH(c, d, a, b, M[11], 1839030562, 16), b = fnH(b, c, d, a, M[14], 4259657740, 23), a = fnH(a, b, c, d, M[1], 2763975236, 4), d = fnH(d, a, b, c, M[4], 1272893353, 11), c = fnH(c, d, a, b, M[7], 4139469664, 16), b = fnH(b, c, d, a, M[10], 3200236656, 23), a = fnH(a, b, c, d, M[13], 681279174, 4), d = fnH(d, a, b, c, M[0], 3936430074, 11), c = fnH(c, d, a, b, M[3], 3572445317, 16), b = fnH(b, c, d, a, M[6], 76029189, 23), a = fnH(a, b, c, d, M[9], 3654602809, 4), d = fnH(d, a, b, c, M[12], 3873151461, 11), c = fnH(c, d, a, b, M[15], 530742520, 16), b = fnH(b, c, d, a, M[2], 3299628645, 23), a = fnI(a, b, c, d, M[0], 4096336452, 6), d = fnI(d, a, b, c, M[7], 1126891415, 10), c = fnI(c, d, a, b, M[14], 2878612391, 15), b = fnI(b, c, d, a, M[5], 4237533241, 21), a = fnI(a, b, c, d, M[12], 1700485571, 6), d = fnI(d, a, b, c, M[3], 2399980690, 10), c = fnI(c, d, a, b, M[10], 4293915773, 15), b = fnI(b, c, d, a, M[1], 2240044497, 21), a = fnI(a, b, c, d, M[8], 1873313359, 6), d = fnI(d, a, b, c, M[15], 4264355552, 10), c = fnI(c, d, a, b, M[6], 2734768916, 15), b = fnI(b, c, d, a, M[13], 1309151649, 21), a = fnI(a, b, c, d, M[4], 4149444226, 6), d = fnI(d, a, b, c, M[11], 3174756917, 10), c = fnI(c, d, a, b, M[2], 718787259, 15), b = fnI(b, c, d, a, M[9], 3951481745, 21), this._a = this._a + a | 0, this._b = this._b + b | 0, this._c = this._c + c | 0, this._d = this._d + d | 0;\n }, MD5.prototype._digest = function() {\n this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();\n var buffer = Buffer2.allocUnsafe(16);\n return buffer.writeInt32LE(this._a, 0), buffer.writeInt32LE(this._b, 4), buffer.writeInt32LE(this._c, 8), buffer.writeInt32LE(this._d, 12), buffer;\n };\n function rotl(x, n) {\n return x << n | x >>> 32 - n;\n }\n function fnF(a, b, c, d, m, k, s) {\n return rotl(a + (b & c | ~b & d) + m + k | 0, s) + b | 0;\n }\n function fnG(a, b, c, d, m, k, s) {\n return rotl(a + (b & d | c & ~d) + m + k | 0, s) + b | 0;\n }\n function fnH(a, b, c, d, m, k, s) {\n return rotl(a + (b ^ c ^ d) + m + k | 0, s) + b | 0;\n }\n function fnI(a, b, c, d, m, k, s) {\n return rotl(a + (c ^ (b | ~d)) + m + k | 0, s) + b | 0;\n }\n module.exports = MD5;\n }\n}), require_ripemd160 = __commonJS({\n \"node_modules/ripemd160/index.js\"(exports, module) {\n var Buffer2 = Buffer, inherits = require_inherits_browser(), HashBase = require_hash_base(), ARRAY16 = new Array(16), zl = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 7,\n 4,\n 13,\n 1,\n 10,\n 6,\n 15,\n 3,\n 12,\n 0,\n 9,\n 5,\n 2,\n 14,\n 11,\n 8,\n 3,\n 10,\n 14,\n 4,\n 9,\n 15,\n 8,\n 1,\n 2,\n 7,\n 0,\n 6,\n 13,\n 11,\n 5,\n 12,\n 1,\n 9,\n 11,\n 10,\n 0,\n 8,\n 12,\n 4,\n 13,\n 3,\n 7,\n 15,\n 14,\n 5,\n 6,\n 2,\n 4,\n 0,\n 5,\n 9,\n 7,\n 12,\n 2,\n 10,\n 14,\n 1,\n 3,\n 8,\n 11,\n 6,\n 15,\n 13\n ], zr = [\n 5,\n 14,\n 7,\n 0,\n 9,\n 2,\n 11,\n 4,\n 13,\n 6,\n 15,\n 8,\n 1,\n 10,\n 3,\n 12,\n 6,\n 11,\n 3,\n 7,\n 0,\n 13,\n 5,\n 10,\n 14,\n 15,\n 8,\n 12,\n 4,\n 9,\n 1,\n 2,\n 15,\n 5,\n 1,\n 3,\n 7,\n 14,\n 6,\n 9,\n 11,\n 8,\n 12,\n 2,\n 10,\n 0,\n 4,\n 13,\n 8,\n 6,\n 4,\n 1,\n 3,\n 11,\n 15,\n 0,\n 5,\n 12,\n 2,\n 13,\n 9,\n 7,\n 10,\n 14,\n 12,\n 15,\n 10,\n 4,\n 1,\n 5,\n 8,\n 7,\n 6,\n 2,\n 13,\n 14,\n 0,\n 3,\n 9,\n 11\n ], sl = [\n 11,\n 14,\n 15,\n 12,\n 5,\n 8,\n 7,\n 9,\n 11,\n 13,\n 14,\n 15,\n 6,\n 7,\n 9,\n 8,\n 7,\n 6,\n 8,\n 13,\n 11,\n 9,\n 7,\n 15,\n 7,\n 12,\n 15,\n 9,\n 11,\n 7,\n 13,\n 12,\n 11,\n 13,\n 6,\n 7,\n 14,\n 9,\n 13,\n 15,\n 14,\n 8,\n 13,\n 6,\n 5,\n 12,\n 7,\n 5,\n 11,\n 12,\n 14,\n 15,\n 14,\n 15,\n 9,\n 8,\n 9,\n 14,\n 5,\n 6,\n 8,\n 6,\n 5,\n 12,\n 9,\n 15,\n 5,\n 11,\n 6,\n 8,\n 13,\n 12,\n 5,\n 12,\n 13,\n 14,\n 11,\n 8,\n 5,\n 6\n ], sr = [\n 8,\n 9,\n 9,\n 11,\n 13,\n 15,\n 15,\n 5,\n 7,\n 7,\n 8,\n 11,\n 14,\n 14,\n 12,\n 6,\n 9,\n 13,\n 15,\n 7,\n 12,\n 8,\n 9,\n 11,\n 7,\n 7,\n 12,\n 7,\n 6,\n 15,\n 13,\n 11,\n 9,\n 7,\n 15,\n 11,\n 8,\n 6,\n 6,\n 14,\n 12,\n 13,\n 5,\n 14,\n 13,\n 13,\n 7,\n 5,\n 15,\n 5,\n 8,\n 11,\n 14,\n 14,\n 6,\n 14,\n 6,\n 9,\n 12,\n 9,\n 12,\n 5,\n 15,\n 8,\n 8,\n 5,\n 12,\n 9,\n 12,\n 5,\n 14,\n 6,\n 8,\n 13,\n 6,\n 5,\n 15,\n 13,\n 11,\n 11\n ], hl = [0, 1518500249, 1859775393, 2400959708, 2840853838], hr = [1352829926, 1548603684, 1836072691, 2053994217, 0];\n function RIPEMD160() {\n HashBase.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520;\n }\n inherits(RIPEMD160, HashBase), RIPEMD160.prototype._update = function() {\n for (var words = ARRAY16, j = 0;j < 16; ++j)\n words[j] = this._block.readInt32LE(j * 4);\n for (var al = this._a | 0, bl = this._b | 0, cl = this._c | 0, dl = this._d | 0, el = this._e | 0, ar = this._a | 0, br = this._b | 0, cr = this._c | 0, dr = this._d | 0, er = this._e | 0, i = 0;i < 80; i += 1) {\n var tl, tr;\n i < 16 \? (tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i]), tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])) : i < 32 \? (tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i]), tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])) : i < 48 \? (tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i]), tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])) : i < 64 \? (tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i]), tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])) : (tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i]), tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])), al = el, el = dl, dl = rotl(cl, 10), cl = bl, bl = tl, ar = er, er = dr, dr = rotl(cr, 10), cr = br, br = tr;\n }\n var t = this._b + cl + dr | 0;\n this._b = this._c + dl + er | 0, this._c = this._d + el + ar | 0, this._d = this._e + al + br | 0, this._e = this._a + bl + cr | 0, this._a = t;\n }, RIPEMD160.prototype._digest = function() {\n this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();\n var buffer = Buffer2.alloc \? Buffer2.alloc(20) : new Buffer2(20);\n return buffer.writeInt32LE(this._a, 0), buffer.writeInt32LE(this._b, 4), buffer.writeInt32LE(this._c, 8), buffer.writeInt32LE(this._d, 12), buffer.writeInt32LE(this._e, 16), buffer;\n };\n function rotl(x, n) {\n return x << n | x >>> 32 - n;\n }\n function fn1(a, b, c, d, e, m, k, s) {\n return rotl(a + (b ^ c ^ d) + m + k | 0, s) + e | 0;\n }\n function fn2(a, b, c, d, e, m, k, s) {\n return rotl(a + (b & c | ~b & d) + m + k | 0, s) + e | 0;\n }\n function fn3(a, b, c, d, e, m, k, s) {\n return rotl(a + ((b | ~c) ^ d) + m + k | 0, s) + e | 0;\n }\n function fn4(a, b, c, d, e, m, k, s) {\n return rotl(a + (b & d | c & ~d) + m + k | 0, s) + e | 0;\n }\n function fn5(a, b, c, d, e, m, k, s) {\n return rotl(a + (b ^ (c | ~d)) + m + k | 0, s) + e | 0;\n }\n module.exports = RIPEMD160;\n }\n}), require_hash = __commonJS({\n \"node_modules/sha.js/hash.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n function Hash(blockSize, finalSize) {\n this._block = Buffer2.alloc(blockSize), this._finalSize = finalSize, this._blockSize = blockSize, this._len = 0;\n }\n Hash.prototype = {}, Hash.prototype.update = function(data, enc) {\n typeof data == \"string\" && (enc = enc || \"utf8\", data = Buffer2.from(data, enc));\n for (var block = this._block, blockSize = this._blockSize, length = data.length, accum = this._len, offset = 0;offset < length; ) {\n for (var assigned = accum % blockSize, remainder = Math.min(length - offset, blockSize - assigned), i = 0;i < remainder; i++)\n block[assigned + i] = data[offset + i];\n accum += remainder, offset += remainder, accum % blockSize === 0 && this._update(block);\n }\n return this._len += length, this;\n }, Hash.prototype.digest = function(enc) {\n var rem = this._len % this._blockSize;\n this._block[rem] = 128, this._block.fill(0, rem + 1), rem >= this._finalSize && (this._update(this._block), this._block.fill(0));\n var bits = this._len * 8;\n if (bits <= 4294967295)\n this._block.writeUInt32BE(bits, this._blockSize - 4);\n else {\n var lowBits = (bits & 4294967295) >>> 0, highBits = (bits - lowBits) / 4294967296;\n this._block.writeUInt32BE(highBits, this._blockSize - 8), this._block.writeUInt32BE(lowBits, this._blockSize - 4);\n }\n this._update(this._block);\n var hash = this._hash();\n return enc \? hash.toString(enc) : hash;\n }, Hash.prototype._update = function() {\n throw new Error(\"_update must be implemented by subclass\");\n }, module.exports = Hash;\n }\n}), require_sha = __commonJS({\n \"node_modules/sha.js/sha.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [1518500249, 1859775393, -1894007588, -899497514], W = new Array(80);\n function Sha() {\n this.init(), this._w = W, Hash.call(this, 64, 56);\n }\n inherits(Sha, Hash), Sha.prototype.init = function() {\n return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;\n };\n function rotl5(num) {\n return num << 5 | num >>> 27;\n }\n function rotl30(num) {\n return num << 30 | num >>> 2;\n }\n function ft(s, b, c, d) {\n return s === 0 \? b & c | ~b & d : s === 2 \? b & c | b & d | c & d : b ^ c ^ d;\n }\n Sha.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 80; ++i)\n W2[i] = W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16];\n for (var j = 0;j < 80; ++j) {\n var s = ~~(j / 20), t = rotl5(a) + ft(s, b, c, d) + e + W2[j] + K[s] | 0;\n e = d, d = c, c = rotl30(b), b = a, a = t;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0;\n }, Sha.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(20);\n return H.writeInt32BE(this._a | 0, 0), H.writeInt32BE(this._b | 0, 4), H.writeInt32BE(this._c | 0, 8), H.writeInt32BE(this._d | 0, 12), H.writeInt32BE(this._e | 0, 16), H;\n }, module.exports = Sha;\n }\n}), require_sha1 = __commonJS({\n \"node_modules/sha.js/sha1.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [1518500249, 1859775393, -1894007588, -899497514], W = new Array(80);\n function Sha1() {\n this.init(), this._w = W, Hash.call(this, 64, 56);\n }\n inherits(Sha1, Hash), Sha1.prototype.init = function() {\n return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;\n };\n function rotl1(num) {\n return num << 1 | num >>> 31;\n }\n function rotl5(num) {\n return num << 5 | num >>> 27;\n }\n function rotl30(num) {\n return num << 30 | num >>> 2;\n }\n function ft(s, b, c, d) {\n return s === 0 \? b & c | ~b & d : s === 2 \? b & c | b & d | c & d : b ^ c ^ d;\n }\n Sha1.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 80; ++i)\n W2[i] = rotl1(W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16]);\n for (var j = 0;j < 80; ++j) {\n var s = ~~(j / 20), t = rotl5(a) + ft(s, b, c, d) + e + W2[j] + K[s] | 0;\n e = d, d = c, c = rotl30(b), b = a, a = t;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0;\n }, Sha1.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(20);\n return H.writeInt32BE(this._a | 0, 0), H.writeInt32BE(this._b | 0, 4), H.writeInt32BE(this._c | 0, 8), H.writeInt32BE(this._d | 0, 12), H.writeInt32BE(this._e | 0, 16), H;\n }, module.exports = Sha1;\n }\n}), require_sha256 = __commonJS({\n \"node_modules/sha.js/sha256.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [\n 1116352408,\n 1899447441,\n 3049323471,\n 3921009573,\n 961987163,\n 1508970993,\n 2453635748,\n 2870763221,\n 3624381080,\n 310598401,\n 607225278,\n 1426881987,\n 1925078388,\n 2162078206,\n 2614888103,\n 3248222580,\n 3835390401,\n 4022224774,\n 264347078,\n 604807628,\n 770255983,\n 1249150122,\n 1555081692,\n 1996064986,\n 2554220882,\n 2821834349,\n 2952996808,\n 3210313671,\n 3336571891,\n 3584528711,\n 113926993,\n 338241895,\n 666307205,\n 773529912,\n 1294757372,\n 1396182291,\n 1695183700,\n 1986661051,\n 2177026350,\n 2456956037,\n 2730485921,\n 2820302411,\n 3259730800,\n 3345764771,\n 3516065817,\n 3600352804,\n 4094571909,\n 275423344,\n 430227734,\n 506948616,\n 659060556,\n 883997877,\n 958139571,\n 1322822218,\n 1537002063,\n 1747873779,\n 1955562222,\n 2024104815,\n 2227730452,\n 2361852424,\n 2428436474,\n 2756734187,\n 3204031479,\n 3329325298\n ], W = new Array(64);\n function Sha256() {\n this.init(), this._w = W, Hash.call(this, 64, 56);\n }\n inherits(Sha256, Hash), Sha256.prototype.init = function() {\n return this._a = 1779033703, this._b = 3144134277, this._c = 1013904242, this._d = 2773480762, this._e = 1359893119, this._f = 2600822924, this._g = 528734635, this._h = 1541459225, this;\n };\n function ch(x, y, z) {\n return z ^ x & (y ^ z);\n }\n function maj(x, y, z) {\n return x & y | z & (x | y);\n }\n function sigma0(x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10);\n }\n function sigma1(x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7);\n }\n function gamma0(x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ x >>> 3;\n }\n function gamma1(x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ x >>> 10;\n }\n Sha256.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, f = this._f | 0, g = this._g | 0, h = this._h | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 64; ++i)\n W2[i] = gamma1(W2[i - 2]) + W2[i - 7] + gamma0(W2[i - 15]) + W2[i - 16] | 0;\n for (var j = 0;j < 64; ++j) {\n var T1 = h + sigma1(e) + ch(e, f, g) + K[j] + W2[j] | 0, T2 = sigma0(a) + maj(a, b, c) | 0;\n h = g, g = f, f = e, e = d + T1 | 0, d = c, c = b, b = a, a = T1 + T2 | 0;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0, this._f = f + this._f | 0, this._g = g + this._g | 0, this._h = h + this._h | 0;\n }, Sha256.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(32);\n return H.writeInt32BE(this._a, 0), H.writeInt32BE(this._b, 4), H.writeInt32BE(this._c, 8), H.writeInt32BE(this._d, 12), H.writeInt32BE(this._e, 16), H.writeInt32BE(this._f, 20), H.writeInt32BE(this._g, 24), H.writeInt32BE(this._h, 28), H;\n }, module.exports = Sha256;\n }\n}), require_sha224 = __commonJS({\n \"node_modules/sha.js/sha224.js\"(exports, module) {\n var inherits = require_inherits_browser(), Sha256 = require_sha256(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, W = new Array(64);\n function Sha224() {\n this.init(), this._w = W, Hash.call(this, 64, 56);\n }\n inherits(Sha224, Sha256), Sha224.prototype.init = function() {\n return this._a = 3238371032, this._b = 914150663, this._c = 812702999, this._d = 4144912697, this._e = 4290775857, this._f = 1750603025, this._g = 1694076839, this._h = 3204075428, this;\n }, Sha224.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(28);\n return H.writeInt32BE(this._a, 0), H.writeInt32BE(this._b, 4), H.writeInt32BE(this._c, 8), H.writeInt32BE(this._d, 12), H.writeInt32BE(this._e, 16), H.writeInt32BE(this._f, 20), H.writeInt32BE(this._g, 24), H;\n }, module.exports = Sha224;\n }\n}), require_sha512 = __commonJS({\n \"node_modules/sha.js/sha512.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [\n 1116352408,\n 3609767458,\n 1899447441,\n 602891725,\n 3049323471,\n 3964484399,\n 3921009573,\n 2173295548,\n 961987163,\n 4081628472,\n 1508970993,\n 3053834265,\n 2453635748,\n 2937671579,\n 2870763221,\n 3664609560,\n 3624381080,\n 2734883394,\n 310598401,\n 1164996542,\n 607225278,\n 1323610764,\n 1426881987,\n 3590304994,\n 1925078388,\n 4068182383,\n 2162078206,\n 991336113,\n 2614888103,\n 633803317,\n 3248222580,\n 3479774868,\n 3835390401,\n 2666613458,\n 4022224774,\n 944711139,\n 264347078,\n 2341262773,\n 604807628,\n 2007800933,\n 770255983,\n 1495990901,\n 1249150122,\n 1856431235,\n 1555081692,\n 3175218132,\n 1996064986,\n 2198950837,\n 2554220882,\n 3999719339,\n 2821834349,\n 766784016,\n 2952996808,\n 2566594879,\n 3210313671,\n 3203337956,\n 3336571891,\n 1034457026,\n 3584528711,\n 2466948901,\n 113926993,\n 3758326383,\n 338241895,\n 168717936,\n 666307205,\n 1188179964,\n 773529912,\n 1546045734,\n 1294757372,\n 1522805485,\n 1396182291,\n 2643833823,\n 1695183700,\n 2343527390,\n 1986661051,\n 1014477480,\n 2177026350,\n 1206759142,\n 2456956037,\n 344077627,\n 2730485921,\n 1290863460,\n 2820302411,\n 3158454273,\n 3259730800,\n 3505952657,\n 3345764771,\n 106217008,\n 3516065817,\n 3606008344,\n 3600352804,\n 1432725776,\n 4094571909,\n 1467031594,\n 275423344,\n 851169720,\n 430227734,\n 3100823752,\n 506948616,\n 1363258195,\n 659060556,\n 3750685593,\n 883997877,\n 3785050280,\n 958139571,\n 3318307427,\n 1322822218,\n 3812723403,\n 1537002063,\n 2003034995,\n 1747873779,\n 3602036899,\n 1955562222,\n 1575990012,\n 2024104815,\n 1125592928,\n 2227730452,\n 2716904306,\n 2361852424,\n 442776044,\n 2428436474,\n 593698344,\n 2756734187,\n 3733110249,\n 3204031479,\n 2999351573,\n 3329325298,\n 3815920427,\n 3391569614,\n 3928383900,\n 3515267271,\n 566280711,\n 3940187606,\n 3454069534,\n 4118630271,\n 4000239992,\n 116418474,\n 1914138554,\n 174292421,\n 2731055270,\n 289380356,\n 3203993006,\n 460393269,\n 320620315,\n 685471733,\n 587496836,\n 852142971,\n 1086792851,\n 1017036298,\n 365543100,\n 1126000580,\n 2618297676,\n 1288033470,\n 3409855158,\n 1501505948,\n 4234509866,\n 1607167915,\n 987167468,\n 1816402316,\n 1246189591\n ], W = new Array(160);\n function Sha512() {\n this.init(), this._w = W, Hash.call(this, 128, 112);\n }\n inherits(Sha512, Hash), Sha512.prototype.init = function() {\n return this._ah = 1779033703, this._bh = 3144134277, this._ch = 1013904242, this._dh = 2773480762, this._eh = 1359893119, this._fh = 2600822924, this._gh = 528734635, this._hh = 1541459225, this._al = 4089235720, this._bl = 2227873595, this._cl = 4271175723, this._dl = 1595750129, this._el = 2917565137, this._fl = 725511199, this._gl = 4215389547, this._hl = 327033209, this;\n };\n function Ch(x, y, z) {\n return z ^ x & (y ^ z);\n }\n function maj(x, y, z) {\n return x & y | z & (x | y);\n }\n function sigma0(x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25);\n }\n function sigma1(x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23);\n }\n function Gamma0(x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ x >>> 7;\n }\n function Gamma0l(x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25);\n }\n function Gamma1(x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ x >>> 6;\n }\n function Gamma1l(x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26);\n }\n function getCarry(a, b) {\n return a >>> 0 < b >>> 0 \? 1 : 0;\n }\n Sha512.prototype._update = function(M) {\n for (var W2 = this._w, ah = this._ah | 0, bh = this._bh | 0, ch = this._ch | 0, dh = this._dh | 0, eh = this._eh | 0, fh = this._fh | 0, gh = this._gh | 0, hh = this._hh | 0, al = this._al | 0, bl = this._bl | 0, cl = this._cl | 0, dl = this._dl | 0, el = this._el | 0, fl = this._fl | 0, gl = this._gl | 0, hl = this._hl | 0, i = 0;i < 32; i += 2)\n W2[i] = M.readInt32BE(i * 4), W2[i + 1] = M.readInt32BE(i * 4 + 4);\n for (;i < 160; i += 2) {\n var xh = W2[i - 30], xl = W2[i - 30 + 1], gamma0 = Gamma0(xh, xl), gamma0l = Gamma0l(xl, xh);\n xh = W2[i - 4], xl = W2[i - 4 + 1];\n var gamma1 = Gamma1(xh, xl), gamma1l = Gamma1l(xl, xh), Wi7h = W2[i - 14], Wi7l = W2[i - 14 + 1], Wi16h = W2[i - 32], Wi16l = W2[i - 32 + 1], Wil = gamma0l + Wi7l | 0, Wih = gamma0 + Wi7h + getCarry(Wil, gamma0l) | 0;\n Wil = Wil + gamma1l | 0, Wih = Wih + gamma1 + getCarry(Wil, gamma1l) | 0, Wil = Wil + Wi16l | 0, Wih = Wih + Wi16h + getCarry(Wil, Wi16l) | 0, W2[i] = Wih, W2[i + 1] = Wil;\n }\n for (var j = 0;j < 160; j += 2) {\n Wih = W2[j], Wil = W2[j + 1];\n var majh = maj(ah, bh, ch), majl = maj(al, bl, cl), sigma0h = sigma0(ah, al), sigma0l = sigma0(al, ah), sigma1h = sigma1(eh, el), sigma1l = sigma1(el, eh), Kih = K[j], Kil = K[j + 1], chh = Ch(eh, fh, gh), chl = Ch(el, fl, gl), t1l = hl + sigma1l | 0, t1h = hh + sigma1h + getCarry(t1l, hl) | 0;\n t1l = t1l + chl | 0, t1h = t1h + chh + getCarry(t1l, chl) | 0, t1l = t1l + Kil | 0, t1h = t1h + Kih + getCarry(t1l, Kil) | 0, t1l = t1l + Wil | 0, t1h = t1h + Wih + getCarry(t1l, Wil) | 0;\n var t2l = sigma0l + majl | 0, t2h = sigma0h + majh + getCarry(t2l, sigma0l) | 0;\n hh = gh, hl = gl, gh = fh, gl = fl, fh = eh, fl = el, el = dl + t1l | 0, eh = dh + t1h + getCarry(el, dl) | 0, dh = ch, dl = cl, ch = bh, cl = bl, bh = ah, bl = al, al = t1l + t2l | 0, ah = t1h + t2h + getCarry(al, t1l) | 0;\n }\n this._al = this._al + al | 0, this._bl = this._bl + bl | 0, this._cl = this._cl + cl | 0, this._dl = this._dl + dl | 0, this._el = this._el + el | 0, this._fl = this._fl + fl | 0, this._gl = this._gl + gl | 0, this._hl = this._hl + hl | 0, this._ah = this._ah + ah + getCarry(this._al, al) | 0, this._bh = this._bh + bh + getCarry(this._bl, bl) | 0, this._ch = this._ch + ch + getCarry(this._cl, cl) | 0, this._dh = this._dh + dh + getCarry(this._dl, dl) | 0, this._eh = this._eh + eh + getCarry(this._el, el) | 0, this._fh = this._fh + fh + getCarry(this._fl, fl) | 0, this._gh = this._gh + gh + getCarry(this._gl, gl) | 0, this._hh = this._hh + hh + getCarry(this._hl, hl) | 0;\n }, Sha512.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(64);\n function writeInt64BE(h, l, offset) {\n H.writeInt32BE(h, offset), H.writeInt32BE(l, offset + 4);\n }\n return writeInt64BE(this._ah, this._al, 0), writeInt64BE(this._bh, this._bl, 8), writeInt64BE(this._ch, this._cl, 16), writeInt64BE(this._dh, this._dl, 24), writeInt64BE(this._eh, this._el, 32), writeInt64BE(this._fh, this._fl, 40), writeInt64BE(this._gh, this._gl, 48), writeInt64BE(this._hh, this._hl, 56), H;\n }, module.exports = Sha512;\n }\n}), require_sha384 = __commonJS({\n \"node_modules/sha.js/sha384.js\"(exports, module) {\n var inherits = require_inherits_browser(), SHA512 = require_sha512(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, W = new Array(160);\n function Sha384() {\n this.init(), this._w = W, Hash.call(this, 128, 112);\n }\n inherits(Sha384, SHA512), Sha384.prototype.init = function() {\n return this._ah = 3418070365, this._bh = 1654270250, this._ch = 2438529370, this._dh = 355462360, this._eh = 1731405415, this._fh = 2394180231, this._gh = 3675008525, this._hh = 1203062813, this._al = 3238371032, this._bl = 914150663, this._cl = 812702999, this._dl = 4144912697, this._el = 4290775857, this._fl = 1750603025, this._gl = 1694076839, this._hl = 3204075428, this;\n }, Sha384.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(48);\n function writeInt64BE(h, l, offset) {\n H.writeInt32BE(h, offset), H.writeInt32BE(l, offset + 4);\n }\n return writeInt64BE(this._ah, this._al, 0), writeInt64BE(this._bh, this._bl, 8), writeInt64BE(this._ch, this._cl, 16), writeInt64BE(this._dh, this._dl, 24), writeInt64BE(this._eh, this._el, 32), writeInt64BE(this._fh, this._fl, 40), H;\n }, module.exports = Sha384;\n }\n}), require_sha2 = __commonJS({\n \"node_modules/sha.js/index.js\"(exports, module) {\n var exports = module.exports = function(algorithm) {\n algorithm = algorithm.toLowerCase();\n var Algorithm = exports[algorithm];\n if (!Algorithm)\n throw new Error(algorithm + \" is not supported (we accept pull requests)\");\n return new Algorithm;\n };\n exports.sha = require_sha(), exports.sha1 = require_sha1(), exports.sha224 = require_sha224(), exports.sha256 = require_sha256(), exports.sha384 = require_sha384(), exports.sha512 = require_sha512();\n }\n}), require_cipher_base = __commonJS({\n \"node_modules/cipher-base/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, inherits = require_inherits_browser();\n function CipherBase(hashMode) {\n StreamModule.Transform.call(this), this.hashMode = typeof hashMode == \"string\", this.hashMode \? this[hashMode] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null;\n }\n inherits(CipherBase, StreamModule.Transform), CipherBase.prototype.update = function(data, inputEnc, outputEnc) {\n typeof data == \"string\" && (data = Buffer2.from(data, inputEnc));\n var outData = this._update(data);\n return this.hashMode \? this : (outputEnc && (outData = this._toString(outData, outputEnc)), outData);\n }, CipherBase.prototype.setAutoPadding = function() {\n }, CipherBase.prototype.getAuthTag = function() {\n throw new Error(\"trying to get auth tag in unsupported state\");\n }, CipherBase.prototype.setAuthTag = function() {\n throw new Error(\"trying to set auth tag in unsupported state\");\n }, CipherBase.prototype.setAAD = function() {\n throw new Error(\"trying to set aad in unsupported state\");\n }, CipherBase.prototype._transform = function(data, _, next) {\n var err;\n try {\n this.hashMode \? this._update(data) : this.push(this._update(data));\n } catch (e) {\n err = e;\n } finally {\n next(err);\n }\n }, CipherBase.prototype._flush = function(done) {\n var err;\n try {\n this.push(this.__final());\n } catch (e) {\n err = e;\n }\n done(err);\n }, CipherBase.prototype._finalOrDigest = function(outputEnc) {\n var outData = this.__final() || Buffer2.alloc(0);\n return outputEnc && (outData = this._toString(outData, outputEnc, !0)), outData;\n }, CipherBase.prototype._toString = function(value, enc, fin) {\n if (this._decoder || (this._decoder = new StringDecoder(enc), this._encoding = enc), this._encoding !== enc)\n throw new Error(\"can't switch encodings\");\n var out = this._decoder.write(value);\n return fin && (out += this._decoder.end()), out;\n }, module.exports = CipherBase;\n }\n}), require_browser2 = __commonJS({\n \"node_modules/create-hash/browser.js\"(exports, module) {\n const LazyHash = function Hash(algorithm, options) {\n this._options = options, this._hasher = new CryptoHasher(algorithm, options), this._finalized = !1;\n };\n LazyHash.prototype = Object.create(StreamModule.Transform.prototype), LazyHash.prototype.update = function update(data, encoding) {\n return this._checkFinalized(), this._hasher.update(data, encoding), this;\n }, LazyHash.prototype.digest = function update(data, encoding) {\n return this._checkFinalized(), this._finalized = !0, this._hasher.digest(data, encoding);\n }, LazyHash.prototype._checkFinalized = function _checkFinalized() {\n if (this._finalized) {\n var err = new Error(\"Digest already called\");\n throw err.code = \"ERR_CRYPTO_HASH_FINALIZED\", err;\n }\n }, LazyHash.prototype.copy = function copy() {\n const copy = Object.create(LazyHash.prototype);\n return copy._options = this._options, copy._hasher = this._hasher.copy(), copy._finalized = this._finalized, copy;\n };\n const lazyHashFullInitProto = {\n __proto__: StreamModule.Transform.prototype,\n ...LazyHash.prototype,\n _transform(data, encoding, callback) {\n this.update(data, encoding), callback && callback();\n },\n _flush(callback) {\n this.push(this.digest()), callback();\n }\n }, triggerMethods = [\n \"_events\",\n \"_eventsCount\",\n \"_final\",\n \"_maxListeners\",\n \"_maxListeners\",\n \"_read\",\n \"_undestroy\",\n \"_writableState\",\n \"_write\",\n \"_writev\",\n \"addListener\",\n \"asIndexedPairs\",\n \"closed\",\n \"compose\",\n \"constructor\",\n \"cork\",\n \"destroy\",\n \"destroyed\",\n \"drop\",\n \"emit\",\n \"end\",\n \"errored\",\n \"eventNames\",\n \"every\",\n \"filter\",\n \"find\",\n \"flatMap\",\n \"forEach\",\n \"getMaxListeners\",\n \"hasOwnProperty\",\n \"isPaused\",\n \"isPrototypeOf\",\n \"iterator\",\n \"listenerCount\",\n \"listeners\",\n \"map\",\n \"off\",\n \"on\",\n \"once\",\n \"pause\",\n \"pipe\",\n \"prependListener\",\n \"prependOnceListener\",\n \"propertyIsEnumerable\",\n \"push\",\n \"rawListeners\",\n \"read\",\n \"readable\",\n \"readableAborted\",\n \"readableBuffer\",\n \"readableDidRead\",\n \"readableEncoding\",\n \"readableEnded\",\n \"readableFlowing\",\n \"readableHighWaterMark\",\n \"readableLength\",\n \"readableObjectMode\",\n \"reduce\",\n \"removeAllListeners\",\n \"removeListener\",\n \"resume\",\n \"setDefaultEncoding\",\n \"setEncoding\",\n \"setMaxListeners\",\n \"some\",\n \"take\",\n \"toArray\",\n \"toLocaleString\",\n \"toString\",\n \"uncork\",\n \"unpipe\",\n \"unshift\",\n \"valueOf\",\n \"wrap\",\n \"writable\",\n \"writableBuffer\",\n \"writableCorked\",\n \"writableEnded\",\n \"writableFinished\",\n \"writableHighWaterMark\",\n \"writableLength\",\n \"writableNeedDrain\",\n \"writableObjectMode\",\n \"write\"\n ];\n for (let method of triggerMethods)\n Object.defineProperty(LazyHash.prototype, method, {\n get() {\n return Object.setPrototypeOf(this, lazyHashFullInitProto), StreamModule.Transform.call(this, this._options), this[method];\n },\n enumerable: !1,\n configurable: !0\n });\n module.exports = function createHash(algorithm) {\n return new LazyHash(algorithm);\n }, module.exports.createHash = module.exports, module.exports.Hash = LazyHash;\n }\n}), require_legacy = __commonJS({\n \"node_modules/create-hmac/legacy.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safe_buffer().Buffer, Base = require_cipher_base(), ZEROS = Buffer2.alloc(128), blocksize = 64;\n function Hmac(alg, key) {\n Base.call(this, \"digest\"), typeof key == \"string\" && (key = Buffer2.from(key)), this._alg = alg, this._key = key, key.length > blocksize \? key = alg(key) : key.length < blocksize && (key = Buffer2.concat([key, ZEROS], blocksize));\n for (var ipad = this._ipad = Buffer2.allocUnsafe(blocksize), opad = this._opad = Buffer2.allocUnsafe(blocksize), i = 0;i < blocksize; i++)\n ipad[i] = key[i] ^ 54, opad[i] = key[i] ^ 92;\n this._hash = [ipad];\n }\n Hmac.prototype = {}, inherits(Hmac, Base), Hmac.prototype._update = function(data) {\n this._hash.push(data);\n }, Hmac.prototype._final = function() {\n var h = this._alg(Buffer2.concat(this._hash));\n return this._alg(Buffer2.concat([this._opad, h]));\n }, module.exports = Hmac;\n }\n}), require_md52 = __commonJS({\n \"node_modules/create-hash/md5.js\"(exports, module) {\n var MD5 = require_md5();\n module.exports = function(buffer) {\n return new MD5().update(buffer).digest();\n };\n }\n}), require_browser3 = __commonJS({\n \"node_modules/create-hmac/browser.js\"(exports, module) {\n var inherits = require_inherits_browser(), Legacy = require_legacy(), Base = require_cipher_base(), Buffer2 = require_safe_buffer().Buffer, md5 = require_md52(), RIPEMD160 = require_ripemd160(), sha = require_sha2(), ZEROS = Buffer2.alloc(128);\n function Hmac(alg, key) {\n Base.call(this, \"digest\"), typeof key == \"string\" && (key = Buffer2.from(key));\n var blocksize = alg === \"sha512\" || alg === \"sha384\" \? 128 : 64;\n if (this._alg = alg, this._key = key, key.length > blocksize) {\n var hash = alg === \"rmd160\" \? new RIPEMD160 : sha(alg);\n key = hash.update(key).digest();\n } else\n key.length < blocksize && (key = Buffer2.concat([key, ZEROS], blocksize));\n for (var ipad = this._ipad = Buffer2.allocUnsafe(blocksize), opad = this._opad = Buffer2.allocUnsafe(blocksize), i = 0;i < blocksize; i++)\n ipad[i] = key[i] ^ 54, opad[i] = key[i] ^ 92;\n this._hash = alg === \"rmd160\" \? new RIPEMD160 : sha(alg), this._hash.update(ipad);\n }\n inherits(Hmac, Base), Hmac.prototype._update = function(data) {\n this._hash.update(data);\n }, Hmac.prototype._final = function() {\n var h = this._hash.digest(), hash = this._alg === \"rmd160\" \? new RIPEMD160 : sha(this._alg);\n return hash.update(this._opad).update(h).digest();\n }, module.exports = function(alg, key) {\n return alg = alg.toLowerCase(), alg === \"rmd160\" || alg === \"ripemd160\" \? new Hmac(\"rmd160\", key) : alg === \"md5\" \? new Legacy(md5, key) : new Hmac(alg, key);\n };\n }\n}), require_algorithms = __commonJS({\n \"node_modules/browserify-sign/browser/algorithms.json\"(exports, module) {\n module.exports = {\n sha224WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha224\",\n id: \"302d300d06096086480165030402040500041c\"\n },\n \"RSA-SHA224\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha224\",\n id: \"302d300d06096086480165030402040500041c\"\n },\n sha256WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha256\",\n id: \"3031300d060960864801650304020105000420\"\n },\n \"RSA-SHA256\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha256\",\n id: \"3031300d060960864801650304020105000420\"\n },\n sha384WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha384\",\n id: \"3041300d060960864801650304020205000430\"\n },\n \"RSA-SHA384\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha384\",\n id: \"3041300d060960864801650304020205000430\"\n },\n sha512WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha512\",\n id: \"3051300d060960864801650304020305000440\"\n },\n \"RSA-SHA512\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha512\",\n id: \"3051300d060960864801650304020305000440\"\n },\n \"RSA-SHA1\": {\n sign: \"rsa\",\n hash: \"sha1\",\n id: \"3021300906052b0e03021a05000414\"\n },\n \"ecdsa-with-SHA1\": {\n sign: \"ecdsa\",\n hash: \"sha1\",\n id: \"\"\n },\n sha256: {\n sign: \"ecdsa\",\n hash: \"sha256\",\n id: \"\"\n },\n sha224: {\n sign: \"ecdsa\",\n hash: \"sha224\",\n id: \"\"\n },\n sha384: {\n sign: \"ecdsa\",\n hash: \"sha384\",\n id: \"\"\n },\n sha512: {\n sign: \"ecdsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-SHA\": {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n \"DSA-SHA1\": {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n DSA: {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n \"DSA-WITH-SHA224\": {\n sign: \"dsa\",\n hash: \"sha224\",\n id: \"\"\n },\n \"DSA-SHA224\": {\n sign: \"dsa\",\n hash: \"sha224\",\n id: \"\"\n },\n \"DSA-WITH-SHA256\": {\n sign: \"dsa\",\n hash: \"sha256\",\n id: \"\"\n },\n \"DSA-SHA256\": {\n sign: \"dsa\",\n hash: \"sha256\",\n id: \"\"\n },\n \"DSA-WITH-SHA384\": {\n sign: \"dsa\",\n hash: \"sha384\",\n id: \"\"\n },\n \"DSA-SHA384\": {\n sign: \"dsa\",\n hash: \"sha384\",\n id: \"\"\n },\n \"DSA-WITH-SHA512\": {\n sign: \"dsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-SHA512\": {\n sign: \"dsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-RIPEMD160\": {\n sign: \"dsa\",\n hash: \"rmd160\",\n id: \"\"\n },\n ripemd160WithRSA: {\n sign: \"rsa\",\n hash: \"rmd160\",\n id: \"3021300906052b2403020105000414\"\n },\n \"RSA-RIPEMD160\": {\n sign: \"rsa\",\n hash: \"rmd160\",\n id: \"3021300906052b2403020105000414\"\n },\n md5WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"md5\",\n id: \"3020300c06082a864886f70d020505000410\"\n },\n \"RSA-MD5\": {\n sign: \"rsa\",\n hash: \"md5\",\n id: \"3020300c06082a864886f70d020505000410\"\n }\n };\n }\n}), require_algos = __commonJS({\n \"node_modules/browserify-sign/algos.js\"(exports, module) {\n module.exports = require_algorithms();\n }\n}), require_precondition = __commonJS({\n \"node_modules/pbkdf2/lib/precondition.js\"(exports, module) {\n var MAX_ALLOC = Math.pow(2, 30) - 1;\n module.exports = function(iterations, keylen) {\n if (typeof iterations != \"number\")\n @throwTypeError(\"Iterations not a number\");\n if (iterations < 0)\n @throwTypeError(\"Bad iterations\");\n if (typeof keylen != \"number\")\n @throwTypeError(\"Key length not a number\");\n if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen)\n @throwTypeError(\"Bad key length\");\n };\n }\n}), require_default_encoding = __commonJS({\n \"node_modules/pbkdf2/lib/default-encoding.js\"(exports, module) {\n var defaultEncoding;\n global.process && global.process.browser \? defaultEncoding = \"utf-8\" : global.process && global.process.version \? (pVersionMajor = parseInt(process.version.split(\".\")[0].slice(1), 10), defaultEncoding = pVersionMajor >= 6 \? \"utf-8\" : \"binary\") : defaultEncoding = \"utf-8\";\n var pVersionMajor;\n module.exports = defaultEncoding;\n }\n}), require_to_buffer = __commonJS({\n \"node_modules/pbkdf2/lib/to-buffer.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(thing, encoding, name) {\n if (Buffer2.isBuffer(thing))\n return thing;\n if (typeof thing == \"string\")\n return Buffer2.from(thing, encoding);\n if (ArrayBuffer.isView(thing))\n return Buffer2.from(thing.buffer);\n @throwTypeError(name + \" must be a string, a Buffer, a typed array or a DataView\");\n };\n }\n}), require_sync_browser = __commonJS({\n \"node_modules/pbkdf2/lib/sync-browser.js\"(exports, module) {\n var md5 = require_md52(), RIPEMD160 = require_ripemd160(), sha = require_sha2(), Buffer2 = require_safe_buffer().Buffer, checkParameters = require_precondition(), defaultEncoding = require_default_encoding(), toBuffer = require_to_buffer(), ZEROS = Buffer2.alloc(128), sizes = {\n md5: 16,\n sha1: 20,\n sha224: 28,\n sha256: 32,\n sha384: 48,\n sha512: 64,\n rmd160: 20,\n ripemd160: 20\n };\n function Hmac(alg, key, saltLen) {\n var hash = getDigest(alg), blocksize = alg === \"sha512\" || alg === \"sha384\" \? 128 : 64;\n key.length > blocksize \? key = hash(key) : key.length < blocksize && (key = Buffer2.concat([key, ZEROS], blocksize));\n for (var ipad = Buffer2.allocUnsafe(blocksize + sizes[alg]), opad = Buffer2.allocUnsafe(blocksize + sizes[alg]), i = 0;i < blocksize; i++)\n ipad[i] = key[i] ^ 54, opad[i] = key[i] ^ 92;\n var ipad1 = Buffer2.allocUnsafe(blocksize + saltLen + 4);\n ipad.copy(ipad1, 0, 0, blocksize), this.ipad1 = ipad1, this.ipad2 = ipad, this.opad = opad, this.alg = alg, this.blocksize = blocksize, this.hash = hash, this.size = sizes[alg];\n }\n Hmac.prototype = {}, Hmac.prototype.run = function(data, ipad) {\n data.copy(ipad, this.blocksize);\n var h = this.hash(ipad);\n return h.copy(this.opad, this.blocksize), this.hash(this.opad);\n };\n function getDigest(alg) {\n function shaFunc(data) {\n return sha(alg).update(data).digest();\n }\n function rmd160Func(data) {\n return new RIPEMD160().update(data).digest();\n }\n return alg === \"rmd160\" || alg === \"ripemd160\" \? rmd160Func : alg === \"md5\" \? md5 : shaFunc;\n }\n function pbkdf2(password, salt, iterations, keylen, digest) {\n checkParameters(iterations, keylen), password = toBuffer(password, defaultEncoding, \"Password\"), salt = toBuffer(salt, defaultEncoding, \"Salt\"), digest = digest || \"sha1\";\n var hmac = new Hmac(digest, password, salt.length), DK = Buffer2.allocUnsafe(keylen), block1 = Buffer2.allocUnsafe(salt.length + 4);\n salt.copy(block1, 0, 0, salt.length);\n for (var destPos = 0, hLen = sizes[digest], l = Math.ceil(keylen / hLen), i = 1;i <= l; i++) {\n block1.writeUInt32BE(i, salt.length);\n for (var T = hmac.run(block1, hmac.ipad1), U = T, j = 1;j < iterations; j++) {\n U = hmac.run(U, hmac.ipad2);\n for (var k = 0;k < hLen; k++)\n T[k] ^= U[k];\n }\n T.copy(DK, destPos), destPos += hLen;\n }\n return DK;\n }\n module.exports = pbkdf2;\n }\n}), require_async = __commonJS({\n \"node_modules/pbkdf2/lib/async.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, checkParameters = require_precondition(), defaultEncoding = require_default_encoding(), sync = require_sync_browser(), toBuffer = require_to_buffer(), ZERO_BUF, subtle = globalCrypto.subtle, toBrowser = {\n sha: \"SHA-1\",\n \"sha-1\": \"SHA-1\",\n sha1: \"SHA-1\",\n sha256: \"SHA-256\",\n \"sha-256\": \"SHA-256\",\n sha384: \"SHA-384\",\n \"sha-384\": \"SHA-384\",\n \"sha-512\": \"SHA-512\",\n sha512: \"SHA-512\"\n }, checks = [];\n function checkNative(algo) {\n if (global.process && !global.process.browser || !subtle || !subtle.importKey || !subtle.deriveBits)\n return Promise.resolve(!1);\n if (checks[algo] !== void 0)\n return checks[algo];\n ZERO_BUF = ZERO_BUF || Buffer2.alloc(8);\n var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo).then(function() {\n return !0;\n }).catch(function() {\n return !1;\n });\n return checks[algo] = prom, prom;\n }\n var nextTick;\n function getNextTick() {\n return nextTick || (global.process && global.process.nextTick \? nextTick = global.process.nextTick : global.queueMicrotask \? nextTick = global.queueMicrotask : global.setImmediate \? nextTick = global.setImmediate : nextTick = global.setTimeout, nextTick);\n }\n function browserPbkdf2(password, salt, iterations, length, algo) {\n return subtle.importKey(\"raw\", password, { name: \"PBKDF2\" }, !1, [\"deriveBits\"]).then(function(key) {\n return subtle.deriveBits({\n name: \"PBKDF2\",\n salt,\n iterations,\n hash: {\n name: algo\n }\n }, key, length << 3);\n }).then(function(res) {\n return Buffer2.from(res);\n });\n }\n function resolvePromise(promise, callback) {\n promise.then(function(out) {\n getNextTick()(function() {\n callback(null, out);\n });\n }, function(e) {\n getNextTick()(function() {\n callback(e);\n });\n });\n }\n module.exports = function(password, salt, iterations, keylen, digest, callback) {\n typeof digest == \"function\" && (callback = digest, digest = void 0), digest = digest || \"sha1\";\n var algo = toBrowser[digest.toLowerCase()];\n if (!algo || typeof global.Promise != \"function\") {\n getNextTick()(function() {\n var out;\n try {\n out = sync(password, salt, iterations, keylen, digest);\n } catch (e) {\n return callback(e);\n }\n callback(null, out);\n });\n return;\n }\n if (checkParameters(iterations, keylen), password = toBuffer(password, defaultEncoding, \"Password\"), salt = toBuffer(salt, defaultEncoding, \"Salt\"), typeof callback != \"function\")\n throw new Error(\"No callback provided to pbkdf2\");\n resolvePromise(checkNative(algo).then(function(resp) {\n return resp \? browserPbkdf2(password, salt, iterations, keylen, algo) : sync(password, salt, iterations, keylen, digest);\n }), callback);\n };\n }\n}), require_browser4 = __commonJS({\n \"node_modules/pbkdf2/browser.js\"(exports) {\n exports.pbkdf2 = require_async(), exports.pbkdf2Sync = require_sync_browser();\n }\n}), require_utils = __commonJS({\n \"node_modules/des.js/lib/des/utils.js\"(exports) {\n exports.readUInt32BE = function(bytes, off) {\n var res = bytes[0 + off] << 24 | bytes[1 + off] << 16 | bytes[2 + off] << 8 | bytes[3 + off];\n return res >>> 0;\n }, exports.writeUInt32BE = function(bytes, value, off) {\n bytes[0 + off] = value >>> 24, bytes[1 + off] = value >>> 16 & 255, bytes[2 + off] = value >>> 8 & 255, bytes[3 + off] = value & 255;\n }, exports.ip = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 6;i >= 0; i -= 2) {\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >>> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inL >>> j + i & 1;\n }\n for (var i = 6;i >= 0; i -= 2) {\n for (var j = 1;j <= 25; j += 8)\n outR <<= 1, outR |= inR >>> j + i & 1;\n for (var j = 1;j <= 25; j += 8)\n outR <<= 1, outR |= inL >>> j + i & 1;\n }\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.rip = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 0;i < 4; i++)\n for (var j = 24;j >= 0; j -= 8)\n outL <<= 1, outL |= inR >>> j + i & 1, outL <<= 1, outL |= inL >>> j + i & 1;\n for (var i = 4;i < 8; i++)\n for (var j = 24;j >= 0; j -= 8)\n outR <<= 1, outR |= inR >>> j + i & 1, outR <<= 1, outR |= inL >>> j + i & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.pc1 = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 7;i >= 5; i--) {\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inL >> j + i & 1;\n }\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >> j + i & 1;\n for (var i = 1;i <= 3; i++) {\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inR >> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inL >> j + i & 1;\n }\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inL >> j + i & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.r28shl = function(num, shift) {\n return num << shift & 268435455 | num >>> 28 - shift;\n };\n var pc2table = [\n 14,\n 11,\n 17,\n 4,\n 27,\n 23,\n 25,\n 0,\n 13,\n 22,\n 7,\n 18,\n 5,\n 9,\n 16,\n 24,\n 2,\n 20,\n 12,\n 21,\n 1,\n 8,\n 15,\n 26,\n 15,\n 4,\n 25,\n 19,\n 9,\n 1,\n 26,\n 16,\n 5,\n 11,\n 23,\n 8,\n 12,\n 7,\n 17,\n 0,\n 22,\n 3,\n 10,\n 14,\n 6,\n 20,\n 27,\n 24\n ];\n exports.pc2 = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, len = pc2table.length >>> 1, i = 0;i < len; i++)\n outL <<= 1, outL |= inL >>> pc2table[i] & 1;\n for (var i = len;i < pc2table.length; i++)\n outR <<= 1, outR |= inR >>> pc2table[i] & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.expand = function(r, out, off) {\n var outL = 0, outR = 0;\n outL = (r & 1) << 5 | r >>> 27;\n for (var i = 23;i >= 15; i -= 4)\n outL <<= 6, outL |= r >>> i & 63;\n for (var i = 11;i >= 3; i -= 4)\n outR |= r >>> i & 63, outR <<= 6;\n outR |= (r & 31) << 1 | r >>> 31, out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n };\n var sTable = [\n 14,\n 0,\n 4,\n 15,\n 13,\n 7,\n 1,\n 4,\n 2,\n 14,\n 15,\n 2,\n 11,\n 13,\n 8,\n 1,\n 3,\n 10,\n 10,\n 6,\n 6,\n 12,\n 12,\n 11,\n 5,\n 9,\n 9,\n 5,\n 0,\n 3,\n 7,\n 8,\n 4,\n 15,\n 1,\n 12,\n 14,\n 8,\n 8,\n 2,\n 13,\n 4,\n 6,\n 9,\n 2,\n 1,\n 11,\n 7,\n 15,\n 5,\n 12,\n 11,\n 9,\n 3,\n 7,\n 14,\n 3,\n 10,\n 10,\n 0,\n 5,\n 6,\n 0,\n 13,\n 15,\n 3,\n 1,\n 13,\n 8,\n 4,\n 14,\n 7,\n 6,\n 15,\n 11,\n 2,\n 3,\n 8,\n 4,\n 14,\n 9,\n 12,\n 7,\n 0,\n 2,\n 1,\n 13,\n 10,\n 12,\n 6,\n 0,\n 9,\n 5,\n 11,\n 10,\n 5,\n 0,\n 13,\n 14,\n 8,\n 7,\n 10,\n 11,\n 1,\n 10,\n 3,\n 4,\n 15,\n 13,\n 4,\n 1,\n 2,\n 5,\n 11,\n 8,\n 6,\n 12,\n 7,\n 6,\n 12,\n 9,\n 0,\n 3,\n 5,\n 2,\n 14,\n 15,\n 9,\n 10,\n 13,\n 0,\n 7,\n 9,\n 0,\n 14,\n 9,\n 6,\n 3,\n 3,\n 4,\n 15,\n 6,\n 5,\n 10,\n 1,\n 2,\n 13,\n 8,\n 12,\n 5,\n 7,\n 14,\n 11,\n 12,\n 4,\n 11,\n 2,\n 15,\n 8,\n 1,\n 13,\n 1,\n 6,\n 10,\n 4,\n 13,\n 9,\n 0,\n 8,\n 6,\n 15,\n 9,\n 3,\n 8,\n 0,\n 7,\n 11,\n 4,\n 1,\n 15,\n 2,\n 14,\n 12,\n 3,\n 5,\n 11,\n 10,\n 5,\n 14,\n 2,\n 7,\n 12,\n 7,\n 13,\n 13,\n 8,\n 14,\n 11,\n 3,\n 5,\n 0,\n 6,\n 6,\n 15,\n 9,\n 0,\n 10,\n 3,\n 1,\n 4,\n 2,\n 7,\n 8,\n 2,\n 5,\n 12,\n 11,\n 1,\n 12,\n 10,\n 4,\n 14,\n 15,\n 9,\n 10,\n 3,\n 6,\n 15,\n 9,\n 0,\n 0,\n 6,\n 12,\n 10,\n 11,\n 1,\n 7,\n 13,\n 13,\n 8,\n 15,\n 9,\n 1,\n 4,\n 3,\n 5,\n 14,\n 11,\n 5,\n 12,\n 2,\n 7,\n 8,\n 2,\n 4,\n 14,\n 2,\n 14,\n 12,\n 11,\n 4,\n 2,\n 1,\n 12,\n 7,\n 4,\n 10,\n 7,\n 11,\n 13,\n 6,\n 1,\n 8,\n 5,\n 5,\n 0,\n 3,\n 15,\n 15,\n 10,\n 13,\n 3,\n 0,\n 9,\n 14,\n 8,\n 9,\n 6,\n 4,\n 11,\n 2,\n 8,\n 1,\n 12,\n 11,\n 7,\n 10,\n 1,\n 13,\n 14,\n 7,\n 2,\n 8,\n 13,\n 15,\n 6,\n 9,\n 15,\n 12,\n 0,\n 5,\n 9,\n 6,\n 10,\n 3,\n 4,\n 0,\n 5,\n 14,\n 3,\n 12,\n 10,\n 1,\n 15,\n 10,\n 4,\n 15,\n 2,\n 9,\n 7,\n 2,\n 12,\n 6,\n 9,\n 8,\n 5,\n 0,\n 6,\n 13,\n 1,\n 3,\n 13,\n 4,\n 14,\n 14,\n 0,\n 7,\n 11,\n 5,\n 3,\n 11,\n 8,\n 9,\n 4,\n 14,\n 3,\n 15,\n 2,\n 5,\n 12,\n 2,\n 9,\n 8,\n 5,\n 12,\n 15,\n 3,\n 10,\n 7,\n 11,\n 0,\n 14,\n 4,\n 1,\n 10,\n 7,\n 1,\n 6,\n 13,\n 0,\n 11,\n 8,\n 6,\n 13,\n 4,\n 13,\n 11,\n 0,\n 2,\n 11,\n 14,\n 7,\n 15,\n 4,\n 0,\n 9,\n 8,\n 1,\n 13,\n 10,\n 3,\n 14,\n 12,\n 3,\n 9,\n 5,\n 7,\n 12,\n 5,\n 2,\n 10,\n 15,\n 6,\n 8,\n 1,\n 6,\n 1,\n 6,\n 4,\n 11,\n 11,\n 13,\n 13,\n 8,\n 12,\n 1,\n 3,\n 4,\n 7,\n 10,\n 14,\n 7,\n 10,\n 9,\n 15,\n 5,\n 6,\n 0,\n 8,\n 15,\n 0,\n 14,\n 5,\n 2,\n 9,\n 3,\n 2,\n 12,\n 13,\n 1,\n 2,\n 15,\n 8,\n 13,\n 4,\n 8,\n 6,\n 10,\n 15,\n 3,\n 11,\n 7,\n 1,\n 4,\n 10,\n 12,\n 9,\n 5,\n 3,\n 6,\n 14,\n 11,\n 5,\n 0,\n 0,\n 14,\n 12,\n 9,\n 7,\n 2,\n 7,\n 2,\n 11,\n 1,\n 4,\n 14,\n 1,\n 7,\n 9,\n 4,\n 12,\n 10,\n 14,\n 8,\n 2,\n 13,\n 0,\n 15,\n 6,\n 12,\n 10,\n 9,\n 13,\n 0,\n 15,\n 3,\n 3,\n 5,\n 5,\n 6,\n 8,\n 11\n ];\n exports.substitute = function(inL, inR) {\n for (var out = 0, i = 0;i < 4; i++) {\n var b = inL >>> 18 - i * 6 & 63, sb = sTable[i * 64 + b];\n out <<= 4, out |= sb;\n }\n for (var i = 0;i < 4; i++) {\n var b = inR >>> 18 - i * 6 & 63, sb = sTable[256 + i * 64 + b];\n out <<= 4, out |= sb;\n }\n return out >>> 0;\n };\n var permuteTable = [\n 16,\n 25,\n 12,\n 11,\n 3,\n 20,\n 4,\n 15,\n 31,\n 17,\n 9,\n 6,\n 27,\n 14,\n 1,\n 22,\n 30,\n 24,\n 8,\n 18,\n 0,\n 5,\n 29,\n 23,\n 13,\n 19,\n 2,\n 26,\n 10,\n 21,\n 28,\n 7\n ];\n exports.permute = function(num) {\n for (var out = 0, i = 0;i < permuteTable.length; i++)\n out <<= 1, out |= num >>> permuteTable[i] & 1;\n return out >>> 0;\n }, exports.padSplit = function(num, size, group) {\n for (var str = num.toString(2);str.length < size; )\n str = \"0\" + str;\n for (var out = [], i = 0;i < size; i += group)\n out.push(str.slice(i, i + group));\n return out.join(\" \");\n };\n }\n}), require_minimalistic_assert = __commonJS({\n \"node_modules/minimalistic-assert/index.js\"(exports, module) {\n module.exports = assert;\n function assert(val, msg) {\n if (!val)\n throw new Error(msg || \"Assertion failed\");\n }\n assert.equal = function(l, r, msg) {\n if (l != r)\n throw new Error(msg || \"Assertion failed: \" + l + \" != \" + r);\n };\n }\n}), require_cipher = __commonJS({\n \"node_modules/des.js/lib/des/cipher.js\"(exports, module) {\n var assert = require_minimalistic_assert();\n function Cipher(options) {\n this.options = options, this.type = this.options.type, this.blockSize = 8, this._init(), this.buffer = new Array(this.blockSize), this.bufferOff = 0;\n }\n Cipher.prototype = {}, module.exports = Cipher, Cipher.prototype._init = function() {\n }, Cipher.prototype.update = function(data) {\n return data.length === 0 \? [] : this.type === \"decrypt\" \? this._updateDecrypt(data) : this._updateEncrypt(data);\n }, Cipher.prototype._buffer = function(data, off) {\n for (var min = Math.min(this.buffer.length - this.bufferOff, data.length - off), i = 0;i < min; i++)\n this.buffer[this.bufferOff + i] = data[off + i];\n return this.bufferOff += min, min;\n }, Cipher.prototype._flushBuffer = function(out, off) {\n return this._update(this.buffer, 0, out, off), this.bufferOff = 0, this.blockSize;\n }, Cipher.prototype._updateEncrypt = function(data) {\n var inputOff = 0, outputOff = 0, count = (this.bufferOff + data.length) / this.blockSize | 0, out = new Array(count * this.blockSize);\n this.bufferOff !== 0 && (inputOff += this._buffer(data, inputOff), this.bufferOff === this.buffer.length && (outputOff += this._flushBuffer(out, outputOff)));\n for (var max = data.length - (data.length - inputOff) % this.blockSize;inputOff < max; inputOff += this.blockSize)\n this._update(data, inputOff, out, outputOff), outputOff += this.blockSize;\n for (;inputOff < data.length; inputOff++, this.bufferOff++)\n this.buffer[this.bufferOff] = data[inputOff];\n return out;\n }, Cipher.prototype._updateDecrypt = function(data) {\n for (var inputOff = 0, outputOff = 0, count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1, out = new Array(count * this.blockSize);count > 0; count--)\n inputOff += this._buffer(data, inputOff), outputOff += this._flushBuffer(out, outputOff);\n return inputOff += this._buffer(data, inputOff), out;\n }, Cipher.prototype.final = function(buffer) {\n var first;\n buffer && (first = this.update(buffer));\n var last;\n return this.type === \"encrypt\" \? last = this._finalEncrypt() : last = this._finalDecrypt(), first \? first.concat(last) : last;\n }, Cipher.prototype._pad = function(buffer, off) {\n if (off === 0)\n return !1;\n for (;off < buffer.length; )\n buffer[off++] = 0;\n return !0;\n }, Cipher.prototype._finalEncrypt = function() {\n if (!this._pad(this.buffer, this.bufferOff))\n return [];\n var out = new Array(this.blockSize);\n return this._update(this.buffer, 0, out, 0), out;\n }, Cipher.prototype._unpad = function(buffer) {\n return buffer;\n }, Cipher.prototype._finalDecrypt = function() {\n assert.equal(this.bufferOff, this.blockSize, \"Not enough data to decrypt\");\n var out = new Array(this.blockSize);\n return this._flushBuffer(out, 0), this._unpad(out);\n };\n }\n}), require_des = __commonJS({\n \"node_modules/des.js/lib/des/des.js\"(exports, module) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), utils = require_utils(), Cipher = require_cipher();\n function DESState() {\n this.tmp = new Array(2), this.keys = null;\n }\n function DES(options) {\n Cipher.call(this, options);\n var state = new DESState;\n this._desState = state, this.deriveKeys(state, options.key);\n }\n inherits(DES, Cipher), module.exports = DES, DES.create = function(options) {\n return new DES(options);\n };\n var shiftTable = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1];\n DES.prototype.deriveKeys = function(state, key) {\n state.keys = new Array(32), assert.equal(key.length, this.blockSize, \"Invalid key length\");\n var kL = utils.readUInt32BE(key, 0), kR = utils.readUInt32BE(key, 4);\n utils.pc1(kL, kR, state.tmp, 0), kL = state.tmp[0], kR = state.tmp[1];\n for (var i = 0;i < state.keys.length; i += 2) {\n var shift = shiftTable[i >>> 1];\n kL = utils.r28shl(kL, shift), kR = utils.r28shl(kR, shift), utils.pc2(kL, kR, state.keys, i);\n }\n }, DES.prototype._update = function(inp, inOff, out, outOff) {\n var state = this._desState, l = utils.readUInt32BE(inp, inOff), r = utils.readUInt32BE(inp, inOff + 4);\n utils.ip(l, r, state.tmp, 0), l = state.tmp[0], r = state.tmp[1], this.type === \"encrypt\" \? this._encrypt(state, l, r, state.tmp, 0) : this._decrypt(state, l, r, state.tmp, 0), l = state.tmp[0], r = state.tmp[1], utils.writeUInt32BE(out, l, outOff), utils.writeUInt32BE(out, r, outOff + 4);\n }, DES.prototype._pad = function(buffer, off) {\n for (var value = buffer.length - off, i = off;i < buffer.length; i++)\n buffer[i] = value;\n return !0;\n }, DES.prototype._unpad = function(buffer) {\n for (var pad = buffer[buffer.length - 1], i = buffer.length - pad;i < buffer.length; i++)\n assert.equal(buffer[i], pad);\n return buffer.slice(0, buffer.length - pad);\n }, DES.prototype._encrypt = function(state, lStart, rStart, out, off) {\n for (var l = lStart, r = rStart, i = 0;i < state.keys.length; i += 2) {\n var keyL = state.keys[i], keyR = state.keys[i + 1];\n utils.expand(r, state.tmp, 0), keyL ^= state.tmp[0], keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR), f = utils.permute(s), t = r;\n r = (l ^ f) >>> 0, l = t;\n }\n utils.rip(r, l, out, off);\n }, DES.prototype._decrypt = function(state, lStart, rStart, out, off) {\n for (var l = rStart, r = lStart, i = state.keys.length - 2;i >= 0; i -= 2) {\n var keyL = state.keys[i], keyR = state.keys[i + 1];\n utils.expand(l, state.tmp, 0), keyL ^= state.tmp[0], keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR), f = utils.permute(s), t = l;\n l = (r ^ f) >>> 0, r = t;\n }\n utils.rip(l, r, out, off);\n };\n }\n}), require_cbc = __commonJS({\n \"node_modules/des.js/lib/des/cbc.js\"(exports) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), proto = {};\n function CBCState(iv) {\n assert.equal(iv.length, 8, \"Invalid IV length\"), this.iv = new Array(8);\n for (var i = 0;i < this.iv.length; i++)\n this.iv[i] = iv[i];\n }\n function instantiate(Base) {\n function CBC(options) {\n Base.call(this, options), this._cbcInit();\n }\n inherits(CBC, Base);\n for (var keys = Object.keys(proto), i = 0;i < keys.length; i++) {\n var key = keys[i];\n CBC.prototype[key] = proto[key];\n }\n return CBC.create = function(options) {\n return new CBC(options);\n }, CBC;\n }\n exports.instantiate = instantiate, proto._cbcInit = function() {\n var state = new CBCState(this.options.iv);\n this._cbcState = state;\n }, proto._update = function(inp, inOff, out, outOff) {\n var state = this._cbcState, superProto = this.constructor.super_.prototype, iv = state.iv;\n if (this.type === \"encrypt\") {\n for (var i = 0;i < this.blockSize; i++)\n iv[i] ^= inp[inOff + i];\n superProto._update.call(this, iv, 0, out, outOff);\n for (var i = 0;i < this.blockSize; i++)\n iv[i] = out[outOff + i];\n } else {\n superProto._update.call(this, inp, inOff, out, outOff);\n for (var i = 0;i < this.blockSize; i++)\n out[outOff + i] ^= iv[i];\n for (var i = 0;i < this.blockSize; i++)\n iv[i] = inp[inOff + i];\n }\n };\n }\n}), require_ede = __commonJS({\n \"node_modules/des.js/lib/des/ede.js\"(exports, module) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), Cipher = require_cipher(), DES = require_des();\n function EDEState(type, key) {\n assert.equal(key.length, 24, \"Invalid key length\");\n var k1 = key.slice(0, 8), k2 = key.slice(8, 16), k3 = key.slice(16, 24);\n type === \"encrypt\" \? this.ciphers = [\n DES.create({ type: \"encrypt\", key: k1 }),\n DES.create({ type: \"decrypt\", key: k2 }),\n DES.create({ type: \"encrypt\", key: k3 })\n ] : this.ciphers = [\n DES.create({ type: \"decrypt\", key: k3 }),\n DES.create({ type: \"encrypt\", key: k2 }),\n DES.create({ type: \"decrypt\", key: k1 })\n ];\n }\n function EDE(options) {\n Cipher.call(this, options);\n var state = new EDEState(this.type, this.options.key);\n this._edeState = state;\n }\n inherits(EDE, Cipher), module.exports = EDE, EDE.create = function(options) {\n return new EDE(options);\n }, EDE.prototype._update = function(inp, inOff, out, outOff) {\n var state = this._edeState;\n state.ciphers[0]._update(inp, inOff, out, outOff), state.ciphers[1]._update(out, outOff, out, outOff), state.ciphers[2]._update(out, outOff, out, outOff);\n }, EDE.prototype._pad = DES.prototype._pad, EDE.prototype._unpad = DES.prototype._unpad;\n }\n}), require_des2 = __commonJS({\n \"node_modules/des.js/lib/des.js\"(exports) {\n exports.utils = require_utils(), exports.Cipher = require_cipher(), exports.DES = require_des(), exports.CBC = require_cbc(), exports.EDE = require_ede();\n }\n}), require_browserify_des = __commonJS({\n \"node_modules/browserify-des/index.js\"(exports, module) {\n var CipherBase = require_cipher_base(), des = require_des2(), inherits = require_inherits_browser(), Buffer2 = require_safe_buffer().Buffer, modes = {\n \"des-ede3-cbc\": des.CBC.instantiate(des.EDE),\n \"des-ede3\": des.EDE,\n \"des-ede-cbc\": des.CBC.instantiate(des.EDE),\n \"des-ede\": des.EDE,\n \"des-cbc\": des.CBC.instantiate(des.DES),\n \"des-ecb\": des.DES\n };\n modes.des = modes[\"des-cbc\"], modes.des3 = modes[\"des-ede3-cbc\"], module.exports = DES, inherits(DES, CipherBase);\n function DES(opts) {\n CipherBase.call(this);\n var modeName = opts.mode.toLowerCase(), mode = modes[modeName], type;\n opts.decrypt \? type = \"decrypt\" : type = \"encrypt\";\n var key = opts.key;\n Buffer2.isBuffer(key) || (key = Buffer2.from(key)), (modeName === \"des-ede\" || modeName === \"des-ede-cbc\") && (key = Buffer2.concat([key, key.slice(0, 8)]));\n var iv = opts.iv;\n Buffer2.isBuffer(iv) || (iv = Buffer2.from(iv)), this._des = mode.create({\n key,\n iv,\n type\n });\n }\n DES.prototype._update = function(data) {\n return Buffer2.from(this._des.update(data));\n }, DES.prototype._final = function() {\n return Buffer2.from(this._des.final());\n };\n }\n}), require_ecb = __commonJS({\n \"node_modules/browserify-aes/modes/ecb.js\"(exports) {\n exports.encrypt = function(self2, block) {\n return self2._cipher.encryptBlock(block);\n }, exports.decrypt = function(self2, block) {\n return self2._cipher.decryptBlock(block);\n };\n }\n}), require_buffer_xor = __commonJS({\n \"node_modules/buffer-xor/index.js\"(exports, module) {\n module.exports = function(a, b) {\n for (var length = Math.min(a.length, b.length), buffer = new Buffer(length), i = 0;i < length; ++i)\n buffer[i] = a[i] ^ b[i];\n return buffer;\n };\n }\n}), require_cbc2 = __commonJS({\n \"node_modules/browserify-aes/modes/cbc.js\"(exports) {\n var xor = require_buffer_xor();\n exports.encrypt = function(self2, block) {\n var data = xor(block, self2._prev);\n return self2._prev = self2._cipher.encryptBlock(data), self2._prev;\n }, exports.decrypt = function(self2, block) {\n var pad = self2._prev;\n self2._prev = block;\n var out = self2._cipher.decryptBlock(block);\n return xor(out, pad);\n };\n }\n}), require_cfb = __commonJS({\n \"node_modules/browserify-aes/modes/cfb.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer, xor = require_buffer_xor();\n function encryptStart(self2, data, decrypt) {\n var len = data.length, out = xor(data, self2._cache);\n return self2._cache = self2._cache.slice(len), self2._prev = Buffer2.concat([self2._prev, decrypt \? data : out]), out;\n }\n exports.encrypt = function(self2, data, decrypt) {\n for (var out = Buffer2.allocUnsafe(0), len;data.length; )\n if (self2._cache.length === 0 && (self2._cache = self2._cipher.encryptBlock(self2._prev), self2._prev = Buffer2.allocUnsafe(0)), self2._cache.length <= data.length)\n len = self2._cache.length, out = Buffer2.concat([out, encryptStart(self2, data.slice(0, len), decrypt)]), data = data.slice(len);\n else {\n out = Buffer2.concat([out, encryptStart(self2, data, decrypt)]);\n break;\n }\n return out;\n };\n }\n}), require_cfb8 = __commonJS({\n \"node_modules/browserify-aes/modes/cfb8.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer;\n function encryptByte(self2, byteParam, decrypt) {\n var pad = self2._cipher.encryptBlock(self2._prev), out = pad[0] ^ byteParam;\n return self2._prev = Buffer2.concat([self2._prev.slice(1), Buffer2.from([decrypt \? byteParam : out])]), out;\n }\n exports.encrypt = function(self2, chunk, decrypt) {\n for (var len = chunk.length, out = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n out[i] = encryptByte(self2, chunk[i], decrypt);\n return out;\n };\n }\n}), require_cfb1 = __commonJS({\n \"node_modules/browserify-aes/modes/cfb1.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer;\n function encryptByte(self2, byteParam, decrypt) {\n for (var pad, i = -1, len = 8, out = 0, bit, value;++i < len; )\n pad = self2._cipher.encryptBlock(self2._prev), bit = byteParam & 1 << 7 - i \? 128 : 0, value = pad[0] ^ bit, out += (value & 128) >> i % 8, self2._prev = shiftIn(self2._prev, decrypt \? bit : value);\n return out;\n }\n function shiftIn(buffer, value) {\n var len = buffer.length, i = -1, out = Buffer2.allocUnsafe(buffer.length);\n for (buffer = Buffer2.concat([buffer, Buffer2.from([value])]);++i < len; )\n out[i] = buffer[i] << 1 | buffer[i + 1] >> 7;\n return out;\n }\n exports.encrypt = function(self2, chunk, decrypt) {\n for (var len = chunk.length, out = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n out[i] = encryptByte(self2, chunk[i], decrypt);\n return out;\n };\n }\n}), require_ofb = __commonJS({\n \"node_modules/browserify-aes/modes/ofb.js\"(exports) {\n var xor = require_buffer_xor();\n function getBlock(self2) {\n return self2._prev = self2._cipher.encryptBlock(self2._prev), self2._prev;\n }\n exports.encrypt = function(self2, chunk) {\n for (;self2._cache.length < chunk.length; )\n self2._cache = Buffer.concat([self2._cache, getBlock(self2)]);\n var pad = self2._cache.slice(0, chunk.length);\n return self2._cache = self2._cache.slice(chunk.length), xor(chunk, pad);\n };\n }\n}), require_incr32 = __commonJS({\n \"node_modules/browserify-aes/incr32.js\"(exports, module) {\n function incr32(iv) {\n for (var len = iv.length, item;len--; )\n if (item = iv.readUInt8(len), item === 255)\n iv.writeUInt8(0, len);\n else {\n item++, iv.writeUInt8(item, len);\n break;\n }\n }\n module.exports = incr32;\n }\n}), require_ctr = __commonJS({\n \"node_modules/browserify-aes/modes/ctr.js\"(exports) {\n var xor = require_buffer_xor(), Buffer2 = require_safe_buffer().Buffer, incr32 = require_incr32();\n function getBlock(self2) {\n var out = self2._cipher.encryptBlockRaw(self2._prev);\n return incr32(self2._prev), out;\n }\n var blockSize = 16;\n exports.encrypt = function(self2, chunk) {\n var chunkNum = Math.ceil(chunk.length / blockSize), start = self2._cache.length;\n self2._cache = Buffer2.concat([self2._cache, Buffer2.allocUnsafe(chunkNum * blockSize)]);\n for (var i = 0;i < chunkNum; i++) {\n var out = getBlock(self2), offset = start + i * blockSize;\n self2._cache.writeUInt32BE(out[0], offset + 0), self2._cache.writeUInt32BE(out[1], offset + 4), self2._cache.writeUInt32BE(out[2], offset + 8), self2._cache.writeUInt32BE(out[3], offset + 12);\n }\n var pad = self2._cache.slice(0, chunk.length);\n return self2._cache = self2._cache.slice(chunk.length), xor(chunk, pad);\n };\n }\n}), require_list = __commonJS({\n \"node_modules/browserify-aes/modes/list.json\"(exports, module) {\n module.exports = {\n \"aes-128-ecb\": {\n cipher: \"AES\",\n key: 128,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-192-ecb\": {\n cipher: \"AES\",\n key: 192,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-256-ecb\": {\n cipher: \"AES\",\n key: 256,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-128-cbc\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-192-cbc\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-256-cbc\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes128: {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes192: {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes256: {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-128-cfb\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-192-cfb\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-256-cfb\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-128-cfb8\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-192-cfb8\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-256-cfb8\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-128-cfb1\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-192-cfb1\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-256-cfb1\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-128-ofb\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-192-ofb\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-256-ofb\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-128-ctr\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-192-ctr\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-256-ctr\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-128-gcm\": {\n cipher: \"AES\",\n key: 128,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n },\n \"aes-192-gcm\": {\n cipher: \"AES\",\n key: 192,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n },\n \"aes-256-gcm\": {\n cipher: \"AES\",\n key: 256,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n }\n };\n }\n}), require_modes = __commonJS({\n \"node_modules/browserify-aes/modes/index.js\"(exports, module) {\n var modeModules = {\n ECB: require_ecb(),\n CBC: require_cbc2(),\n CFB: require_cfb(),\n CFB8: require_cfb8(),\n CFB1: require_cfb1(),\n OFB: require_ofb(),\n CTR: require_ctr(),\n GCM: require_ctr()\n }, modes = require_list();\n for (key in modes)\n modes[key].module = modeModules[modes[key].mode];\n var key;\n module.exports = modes;\n }\n}), require_aes = __commonJS({\n \"node_modules/browserify-aes/aes.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n function asUInt32Array(buf) {\n Buffer2.isBuffer(buf) || (buf = Buffer2.from(buf));\n for (var len = buf.length / 4 | 0, out = new Array(len), i = 0;i < len; i++)\n out[i] = buf.readUInt32BE(i * 4);\n return out;\n }\n function scrubVec(v) {\n for (var i = 0;i < v.length; v++)\n v[i] = 0;\n }\n function cryptBlock(M, keySchedule, SUB_MIX, SBOX, nRounds) {\n for (var SUB_MIX0 = SUB_MIX[0], SUB_MIX1 = SUB_MIX[1], SUB_MIX2 = SUB_MIX[2], SUB_MIX3 = SUB_MIX[3], s0 = M[0] ^ keySchedule[0], s1 = M[1] ^ keySchedule[1], s2 = M[2] ^ keySchedule[2], s3 = M[3] ^ keySchedule[3], t0, t1, t2, t3, ksRow = 4, round = 1;round < nRounds; round++)\n t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[s1 >>> 16 & 255] ^ SUB_MIX2[s2 >>> 8 & 255] ^ SUB_MIX3[s3 & 255] ^ keySchedule[ksRow++], t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[s2 >>> 16 & 255] ^ SUB_MIX2[s3 >>> 8 & 255] ^ SUB_MIX3[s0 & 255] ^ keySchedule[ksRow++], t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[s3 >>> 16 & 255] ^ SUB_MIX2[s0 >>> 8 & 255] ^ SUB_MIX3[s1 & 255] ^ keySchedule[ksRow++], t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[s0 >>> 16 & 255] ^ SUB_MIX2[s1 >>> 8 & 255] ^ SUB_MIX3[s2 & 255] ^ keySchedule[ksRow++], s0 = t0, s1 = t1, s2 = t2, s3 = t3;\n return t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 255] << 16 | SBOX[s2 >>> 8 & 255] << 8 | SBOX[s3 & 255]) ^ keySchedule[ksRow++], t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 255] << 16 | SBOX[s3 >>> 8 & 255] << 8 | SBOX[s0 & 255]) ^ keySchedule[ksRow++], t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 255] << 16 | SBOX[s0 >>> 8 & 255] << 8 | SBOX[s1 & 255]) ^ keySchedule[ksRow++], t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 255] << 16 | SBOX[s1 >>> 8 & 255] << 8 | SBOX[s2 & 255]) ^ keySchedule[ksRow++], t0 = t0 >>> 0, t1 = t1 >>> 0, t2 = t2 >>> 0, t3 = t3 >>> 0, [t0, t1, t2, t3];\n }\n var RCON = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], G = function() {\n for (var d = new Array(256), j = 0;j < 256; j++)\n j < 128 \? d[j] = j << 1 : d[j] = j << 1 ^ 283;\n for (var SBOX = [], INV_SBOX = [], SUB_MIX = [[], [], [], []], INV_SUB_MIX = [[], [], [], []], x = 0, xi = 0, i = 0;i < 256; ++i) {\n var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n sx = sx >>> 8 ^ sx & 255 ^ 99, SBOX[x] = sx, INV_SBOX[sx] = x;\n var x2 = d[x], x4 = d[x2], x8 = d[x4], t = d[sx] * 257 ^ sx * 16843008;\n SUB_MIX[0][x] = t << 24 | t >>> 8, SUB_MIX[1][x] = t << 16 | t >>> 16, SUB_MIX[2][x] = t << 8 | t >>> 24, SUB_MIX[3][x] = t, t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008, INV_SUB_MIX[0][sx] = t << 24 | t >>> 8, INV_SUB_MIX[1][sx] = t << 16 | t >>> 16, INV_SUB_MIX[2][sx] = t << 8 | t >>> 24, INV_SUB_MIX[3][sx] = t, x === 0 \? x = xi = 1 : (x = x2 ^ d[d[d[x8 ^ x2]]], xi ^= d[d[xi]]);\n }\n return {\n SBOX,\n INV_SBOX,\n SUB_MIX,\n INV_SUB_MIX\n };\n }();\n function AES(key) {\n this._key = asUInt32Array(key), this._reset();\n }\n AES.prototype = {}, AES.blockSize = 16, AES.keySize = 32, AES.prototype.blockSize = AES.blockSize, AES.prototype.keySize = AES.keySize, AES.prototype._reset = function() {\n for (var keyWords = this._key, keySize = keyWords.length, nRounds = keySize + 6, ksRows = (nRounds + 1) * 4, keySchedule = [], k = 0;k < keySize; k++)\n keySchedule[k] = keyWords[k];\n for (k = keySize;k < ksRows; k++) {\n var t = keySchedule[k - 1];\n k % keySize === 0 \? (t = t << 8 | t >>> 24, t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255], t ^= RCON[k / keySize | 0] << 24) : keySize > 6 && k % keySize === 4 && (t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255]), keySchedule[k] = keySchedule[k - keySize] ^ t;\n }\n for (var invKeySchedule = [], ik = 0;ik < ksRows; ik++) {\n var ksR = ksRows - ik, tt = keySchedule[ksR - (ik % 4 \? 0 : 4)];\n ik < 4 || ksR <= 4 \? invKeySchedule[ik] = tt : invKeySchedule[ik] = G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^ G.INV_SUB_MIX[1][G.SBOX[tt >>> 16 & 255]] ^ G.INV_SUB_MIX[2][G.SBOX[tt >>> 8 & 255]] ^ G.INV_SUB_MIX[3][G.SBOX[tt & 255]];\n }\n this._nRounds = nRounds, this._keySchedule = keySchedule, this._invKeySchedule = invKeySchedule;\n }, AES.prototype.encryptBlockRaw = function(M) {\n return M = asUInt32Array(M), cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds);\n }, AES.prototype.encryptBlock = function(M) {\n var out = this.encryptBlockRaw(M), buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0], 0), buf.writeUInt32BE(out[1], 4), buf.writeUInt32BE(out[2], 8), buf.writeUInt32BE(out[3], 12), buf;\n }, AES.prototype.decryptBlock = function(M) {\n M = asUInt32Array(M);\n var m1 = M[1];\n M[1] = M[3], M[3] = m1;\n var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds), buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0], 0), buf.writeUInt32BE(out[3], 4), buf.writeUInt32BE(out[2], 8), buf.writeUInt32BE(out[1], 12), buf;\n }, AES.prototype.scrub = function() {\n scrubVec(this._keySchedule), scrubVec(this._invKeySchedule), scrubVec(this._key);\n }, module.exports.AES = AES;\n }\n}), require_ghash = __commonJS({\n \"node_modules/browserify-aes/ghash.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, ZEROES = Buffer2.alloc(16, 0);\n function toArray(buf) {\n return [buf.readUInt32BE(0), buf.readUInt32BE(4), buf.readUInt32BE(8), buf.readUInt32BE(12)];\n }\n function fromArray(out) {\n var buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0] >>> 0, 0), buf.writeUInt32BE(out[1] >>> 0, 4), buf.writeUInt32BE(out[2] >>> 0, 8), buf.writeUInt32BE(out[3] >>> 0, 12), buf;\n }\n function GHASH(key) {\n this.h = key, this.state = Buffer2.alloc(16, 0), this.cache = Buffer2.allocUnsafe(0);\n }\n GHASH.prototype = {}, GHASH.prototype.ghash = function(block) {\n for (var i = -1;++i < block.length; )\n this.state[i] ^= block[i];\n this._multiply();\n }, GHASH.prototype._multiply = function() {\n for (var Vi = toArray(this.h), Zi = [0, 0, 0, 0], j, xi, lsbVi, i = -1;++i < 128; ) {\n for (xi = (this.state[~~(i / 8)] & 1 << 7 - i % 8) !== 0, xi && (Zi[0] ^= Vi[0], Zi[1] ^= Vi[1], Zi[2] ^= Vi[2], Zi[3] ^= Vi[3]), lsbVi = (Vi[3] & 1) !== 0, j = 3;j > 0; j--)\n Vi[j] = Vi[j] >>> 1 | (Vi[j - 1] & 1) << 31;\n Vi[0] = Vi[0] >>> 1, lsbVi && (Vi[0] = Vi[0] ^ 225 << 24);\n }\n this.state = fromArray(Zi);\n }, GHASH.prototype.update = function(buf) {\n this.cache = Buffer2.concat([this.cache, buf]);\n for (var chunk;this.cache.length >= 16; )\n chunk = this.cache.slice(0, 16), this.cache = this.cache.slice(16), this.ghash(chunk);\n }, GHASH.prototype.final = function(abl, bl) {\n return this.cache.length && this.ghash(Buffer2.concat([this.cache, ZEROES], 16)), this.ghash(fromArray([0, abl, 0, bl])), this.state;\n }, module.exports = GHASH;\n }\n}), require_authCipher = __commonJS({\n \"node_modules/browserify-aes/authCipher.js\"(exports, module) {\n var aes = require_aes(), Buffer2 = require_safe_buffer().Buffer, Transform = require_cipher_base(), inherits = require_inherits_browser(), GHASH = require_ghash(), xor = require_buffer_xor(), incr32 = require_incr32();\n function xorTest(a, b) {\n var out = 0;\n a.length !== b.length && out++;\n for (var len = Math.min(a.length, b.length), i = 0;i < len; ++i)\n out += a[i] ^ b[i];\n return out;\n }\n function calcIv(self2, iv, ck) {\n if (iv.length === 12)\n return self2._finID = Buffer2.concat([iv, Buffer2.from([0, 0, 0, 1])]), Buffer2.concat([iv, Buffer2.from([0, 0, 0, 2])]);\n var ghash = new GHASH(ck), len = iv.length, toPad = len % 16;\n ghash.update(iv), toPad && (toPad = 16 - toPad, ghash.update(Buffer2.alloc(toPad, 0))), ghash.update(Buffer2.alloc(8, 0));\n var ivBits = len * 8, tail = Buffer2.alloc(8);\n tail.writeUIntBE(ivBits, 0, 8), ghash.update(tail), self2._finID = ghash.state;\n var out = Buffer2.from(self2._finID);\n return incr32(out), out;\n }\n function StreamCipher(mode, key, iv, decrypt) {\n Transform.call(this);\n var h = Buffer2.alloc(4, 0);\n this._cipher = new aes.AES(key);\n var ck = this._cipher.encryptBlock(h);\n this._ghash = new GHASH(ck), iv = calcIv(this, iv, ck), this._prev = Buffer2.from(iv), this._cache = Buffer2.allocUnsafe(0), this._secCache = Buffer2.allocUnsafe(0), this._decrypt = decrypt, this._alen = 0, this._len = 0, this._mode = mode, this._authTag = null, this._called = !1;\n }\n inherits(StreamCipher, Transform), StreamCipher.prototype._update = function(chunk) {\n if (!this._called && this._alen) {\n var rump = 16 - this._alen % 16;\n rump < 16 && (rump = Buffer2.alloc(rump, 0), this._ghash.update(rump));\n }\n this._called = !0;\n var out = this._mode.encrypt(this, chunk);\n return this._decrypt \? this._ghash.update(chunk) : this._ghash.update(out), this._len += chunk.length, out;\n }, StreamCipher.prototype._final = function() {\n if (this._decrypt && !this._authTag)\n throw new Error(\"Unsupported state or unable to authenticate data\");\n var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID));\n if (this._decrypt && xorTest(tag, this._authTag))\n throw new Error(\"Unsupported state or unable to authenticate data\");\n this._authTag = tag, this._cipher.scrub();\n }, StreamCipher.prototype.getAuthTag = function() {\n if (this._decrypt || !Buffer2.isBuffer(this._authTag))\n throw new Error(\"Attempting to get auth tag in unsupported state\");\n return this._authTag;\n }, StreamCipher.prototype.setAuthTag = function(tag) {\n if (!this._decrypt)\n throw new Error(\"Attempting to set auth tag in unsupported state\");\n this._authTag = tag;\n }, StreamCipher.prototype.setAAD = function(buf) {\n if (this._called)\n throw new Error(\"Attempting to set AAD in unsupported state\");\n this._ghash.update(buf), this._alen += buf.length;\n }, module.exports = StreamCipher;\n }\n}), require_streamCipher = __commonJS({\n \"node_modules/browserify-aes/streamCipher.js\"(exports, module) {\n var aes = require_aes(), Buffer2 = require_safe_buffer().Buffer, Transform = require_cipher_base(), inherits = require_inherits_browser();\n function StreamCipher(mode, key, iv, decrypt) {\n Transform.call(this), this._cipher = new aes.AES(key), this._prev = Buffer2.from(iv), this._cache = Buffer2.allocUnsafe(0), this._secCache = Buffer2.allocUnsafe(0), this._decrypt = decrypt, this._mode = mode;\n }\n inherits(StreamCipher, Transform), StreamCipher.prototype._update = function(chunk) {\n return this._mode.encrypt(this, chunk, this._decrypt);\n }, StreamCipher.prototype._final = function() {\n this._cipher.scrub();\n }, module.exports = StreamCipher;\n }\n}), require_evp_bytestokey = __commonJS({\n \"node_modules/evp_bytestokey/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, MD5 = require_md5();\n function EVP_BytesToKey(password, salt, keyBits, ivLen) {\n if (Buffer2.isBuffer(password) || (password = Buffer2.from(password, \"binary\")), salt && (Buffer2.isBuffer(salt) || (salt = Buffer2.from(salt, \"binary\")), salt.length !== 8))\n @throwRangeError(\"salt should be Buffer with 8 byte length\");\n for (var keyLen = keyBits / 8, key = Buffer2.alloc(keyLen), iv = Buffer2.alloc(ivLen || 0), tmp = Buffer2.alloc(0);keyLen > 0 || ivLen > 0; ) {\n var hash = new MD5;\n hash.update(tmp), hash.update(password), salt && hash.update(salt), tmp = hash.digest();\n var used = 0;\n if (keyLen > 0) {\n var keyStart = key.length - keyLen;\n used = Math.min(keyLen, tmp.length), tmp.copy(key, keyStart, 0, used), keyLen -= used;\n }\n if (used < tmp.length && ivLen > 0) {\n var ivStart = iv.length - ivLen, length = Math.min(ivLen, tmp.length - used);\n tmp.copy(iv, ivStart, used, used + length), ivLen -= length;\n }\n }\n return tmp.fill(0), { key, iv };\n }\n module.exports = EVP_BytesToKey;\n }\n}), require_encrypter = __commonJS({\n \"node_modules/browserify-aes/encrypter.js\"(exports) {\n var MODES = require_modes(), AuthCipher = require_authCipher(), Buffer2 = require_safe_buffer().Buffer, StreamCipher = require_streamCipher(), Transform = require_cipher_base(), aes = require_aes(), ebtk = require_evp_bytestokey(), inherits = require_inherits_browser();\n function Cipher(mode, key, iv) {\n Transform.call(this), this._cache = new Splitter, this._cipher = new aes.AES(key), this._prev = Buffer2.from(iv), this._mode = mode, this._autopadding = !0;\n }\n inherits(Cipher, Transform), Cipher.prototype._update = function(data) {\n this._cache.add(data);\n for (var chunk, thing, out = [];chunk = this._cache.get(); )\n thing = this._mode.encrypt(this, chunk), out.push(thing);\n return Buffer2.concat(out);\n };\n var PADDING = Buffer2.alloc(16, 16);\n Cipher.prototype._final = function() {\n var chunk = this._cache.flush();\n if (this._autopadding)\n return chunk = this._mode.encrypt(this, chunk), this._cipher.scrub(), chunk;\n if (!chunk.equals(PADDING))\n throw this._cipher.scrub(), new Error(\"data not multiple of block length\");\n }, Cipher.prototype.setAutoPadding = function(setTo) {\n return this._autopadding = !!setTo, this;\n };\n function Splitter() {\n this.cache = Buffer2.allocUnsafe(0);\n }\n Splitter.prototype = {}, Splitter.prototype.add = function(data) {\n this.cache = Buffer2.concat([this.cache, data]);\n }, Splitter.prototype.get = function() {\n if (this.cache.length > 15) {\n var out = this.cache.slice(0, 16);\n return this.cache = this.cache.slice(16), out;\n }\n return null;\n }, Splitter.prototype.flush = function() {\n for (var len = 16 - this.cache.length, padBuff = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n padBuff.writeUInt8(len, i);\n return Buffer2.concat([this.cache, padBuff]);\n };\n function createCipheriv(suite, password, iv) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n password = getArrayBufferOrView(password, \"password\");\n const iv_length = iv\?.length || 0, required_iv_length = config.iv || 0;\n if (iv = iv === null \? EMPTY_BUFFER : getArrayBufferOrView(iv, \"iv\"), password\?.length !== config.key / 8) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n if (config.mode !== \"GCM\" && iv_length !== required_iv_length) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n return config.type === \"stream\" \? new StreamCipher(config.module, password, iv) : config.type === \"auth\" \? new AuthCipher(config.module, password, iv) : new Cipher(config.module, password, iv);\n }\n function createCipher(suite, password) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, config.key, config.iv);\n return createCipheriv(suite, keys.key, keys.iv);\n }\n exports.createCipheriv = createCipheriv, exports.createCipher = createCipher;\n }\n}), require_decrypter = __commonJS({\n \"node_modules/browserify-aes/decrypter.js\"(exports) {\n var AuthCipher = require_authCipher(), Buffer2 = require_safe_buffer().Buffer, MODES = require_modes(), StreamCipher = require_streamCipher(), Transform = require_cipher_base(), aes = require_aes(), ebtk = require_evp_bytestokey(), inherits = require_inherits_browser();\n function Decipher(mode, key, iv) {\n Transform.call(this), this._cache = new Splitter, this._last = void 0, this._cipher = new aes.AES(key), this._prev = Buffer2.from(iv), this._mode = mode, this._autopadding = !0;\n }\n inherits(Decipher, Transform), Decipher.prototype._update = function(data) {\n this._cache.add(data);\n for (var chunk, thing, out = [];chunk = this._cache.get(this._autopadding); )\n thing = this._mode.decrypt(this, chunk), out.push(thing);\n return Buffer2.concat(out);\n }, Decipher.prototype._final = function() {\n var chunk = this._cache.flush();\n if (this._autopadding)\n return unpad(this._mode.decrypt(this, chunk));\n if (chunk)\n throw new Error(\"data not multiple of block length\");\n }, Decipher.prototype.setAutoPadding = function(setTo) {\n return this._autopadding = !!setTo, this;\n };\n function Splitter() {\n this.cache = Buffer2.allocUnsafe(0);\n }\n Splitter.prototype = {}, Splitter.prototype.add = function(data) {\n this.cache = Buffer2.concat([this.cache, data]);\n }, Splitter.prototype.get = function(autoPadding) {\n var out;\n if (autoPadding) {\n if (this.cache.length > 16)\n return out = this.cache.slice(0, 16), this.cache = this.cache.slice(16), out;\n } else if (this.cache.length >= 16)\n return out = this.cache.slice(0, 16), this.cache = this.cache.slice(16), out;\n return null;\n }, Splitter.prototype.flush = function() {\n if (this.cache.length)\n return this.cache;\n };\n function unpad(last) {\n var padded = last[15];\n if (padded < 1 || padded > 16)\n throw new Error(\"unable to decrypt data\");\n for (var i = -1;++i < padded; )\n if (last[i + (16 - padded)] !== padded)\n throw new Error(\"unable to decrypt data\");\n if (padded !== 16)\n return last.slice(0, 16 - padded);\n }\n function createDecipheriv(suite, password, iv) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n password = getArrayBufferOrView(password, \"password\");\n const iv_length = iv\?.length || 0, required_iv_length = config.iv || 0;\n if (iv = iv === null \? EMPTY_BUFFER : getArrayBufferOrView(iv, \"iv\"), config.mode !== \"GCM\" && iv_length !== required_iv_length) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n if (password.length !== config.key / 8) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n return config.type === \"stream\" \? new StreamCipher(config.module, password, iv, !0) : config.type === \"auth\" \? new AuthCipher(config.module, password, iv, !0) : new Decipher(config.module, password, iv);\n }\n function createDecipher(suite, password) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, config.key, config.iv);\n return createDecipheriv(suite, keys.key, keys.iv);\n }\n exports.createDecipher = createDecipher, exports.createDecipheriv = createDecipheriv;\n }\n}), require_browser5 = __commonJS({\n \"node_modules/browserify-aes/browser.js\"(exports) {\n var ciphers = require_encrypter(), deciphers = require_decrypter(), modes = require_list();\n function getCiphers() {\n return Object.keys(modes);\n }\n exports.createCipher = exports.Cipher = ciphers.createCipher, exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv, exports.createDecipher = exports.Decipher = deciphers.createDecipher, exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv, exports.listCiphers = exports.getCiphers = getCiphers;\n }\n}), require_modes2 = __commonJS({\n \"node_modules/browserify-des/modes.js\"(exports) {\n exports[\"des-ecb\"] = {\n key: 8,\n iv: 0\n }, exports[\"des-cbc\"] = exports.des = {\n key: 8,\n iv: 8\n }, exports[\"des-ede3-cbc\"] = exports.des3 = {\n key: 24,\n iv: 8\n }, exports[\"des-ede3\"] = {\n key: 24,\n iv: 0\n }, exports[\"des-ede-cbc\"] = {\n key: 16,\n iv: 8\n }, exports[\"des-ede\"] = {\n key: 16,\n iv: 0\n };\n }\n}), require_browser6 = __commonJS({\n \"node_modules/browserify-cipher/browser.js\"(exports) {\n var DES = require_browserify_des(), aes = require_browser5(), aesModes = require_modes(), desModes = require_modes2(), ebtk = require_evp_bytestokey();\n function createCipher(suite, password) {\n suite = suite.toLowerCase();\n var keyLen, ivLen;\n if (aesModes[suite])\n keyLen = aesModes[suite].key, ivLen = aesModes[suite].iv;\n else if (desModes[suite])\n keyLen = desModes[suite].key * 8, ivLen = desModes[suite].iv;\n else\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, keyLen, ivLen);\n return createCipheriv(suite, keys.key, keys.iv);\n }\n function createDecipher(suite, password) {\n suite = suite.toLowerCase();\n var keyLen, ivLen;\n if (aesModes[suite])\n keyLen = aesModes[suite].key, ivLen = aesModes[suite].iv;\n else if (desModes[suite])\n keyLen = desModes[suite].key * 8, ivLen = desModes[suite].iv;\n else\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, keyLen, ivLen);\n return createDecipheriv(suite, keys.key, keys.iv);\n }\n function createCipheriv(suite, key, iv) {\n if (suite = suite.toLowerCase(), aesModes[suite])\n return aes.createCipheriv(suite, key, iv);\n if (desModes[suite])\n return new DES({ key, iv, mode: suite });\n @throwTypeError(\"invalid suite type\");\n }\n function createDecipheriv(suite, key, iv) {\n if (suite = suite.toLowerCase(), aesModes[suite])\n return aes.createDecipheriv(suite, key, iv);\n if (desModes[suite])\n return new DES({ key, iv, mode: suite, decrypt: !0 });\n @throwTypeError(\"invalid suite type\");\n }\n function getCiphers() {\n return Object.keys(desModes).concat(aes.getCiphers());\n }\n exports.createCipher = exports.Cipher = createCipher, exports.createCipheriv = exports.Cipheriv = createCipheriv, exports.createDecipher = exports.Decipher = createDecipher, exports.createDecipheriv = exports.Decipheriv = createDecipheriv, exports.listCiphers = exports.getCiphers = getCiphers;\n }\n}), require_bn = __commonJS({\n \"node_modules/diffie-hellman/node_modules/bn.js/lib/bn.js\"(exports, module) {\n (function(module2, exports2) {\n function assert(val, msg) {\n if (!val)\n throw new Error(msg || \"Assertion failed\");\n }\n function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function() {\n };\n TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor, ctor.prototype.constructor = ctor;\n }\n function BN(number, base, endian) {\n if (BN.isBN(number))\n return number;\n this.negative = 0, this.words = null, this.length = 0, this.red = null, number !== null && ((base === \"le\" || base === \"be\") && (endian = base, base = 10), this._init(number || 0, base || 10, endian || \"be\"));\n }\n BN.prototype = {}, typeof module2 == \"object\" \? module2.exports = BN : exports2.BN = BN, BN.BN = BN, BN.wordSize = 26;\n var Buffer2 = Buffer;\n BN.isBN = function(num) {\n return num instanceof BN \? !0 : num !== null && typeof num == \"object\" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n }, BN.max = function(left, right) {\n return left.cmp(right) > 0 \? left : right;\n }, BN.min = function(left, right) {\n return left.cmp(right) < 0 \? left : right;\n }, BN.prototype._init = function(number, base, endian) {\n if (typeof number == \"number\")\n return this._initNumber(number, base, endian);\n if (typeof number == \"object\")\n return this._initArray(number, base, endian);\n base === \"hex\" && (base = 16), assert(base === (base | 0) && base >= 2 && base <= 36), number = number.toString().replace(/\\s+/g, \"\");\n var start = 0;\n number[0] === \"-\" && (start++, this.negative = 1), start < number.length && (base === 16 \? this._parseHex(number, start, endian) : (this._parseBase(number, base, start), endian === \"le\" && this._initArray(this.toArray(), base, endian)));\n }, BN.prototype._initNumber = function(number, base, endian) {\n number < 0 && (this.negative = 1, number = -number), number < 67108864 \? (this.words = [number & 67108863], this.length = 1) : number < 4503599627370496 \? (this.words = [number & 67108863, number / 67108864 & 67108863], this.length = 2) : (assert(number < 9007199254740992), this.words = [number & 67108863, number / 67108864 & 67108863, 1], this.length = 3), endian === \"le\" && this._initArray(this.toArray(), base, endian);\n }, BN.prototype._initArray = function(number, base, endian) {\n if (assert(typeof number.length == \"number\"), number.length <= 0)\n return this.words = [0], this.length = 1, this;\n this.length = Math.ceil(number.length / 3), this.words = new Array(this.length);\n for (var i = 0;i < this.length; i++)\n this.words[i] = 0;\n var j, w, off = 0;\n if (endian === \"be\")\n for (i = number.length - 1, j = 0;i >= 0; i -= 3)\n w = number[i] | number[i - 1] << 8 | number[i - 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26 && (off -= 26, j++);\n else if (endian === \"le\")\n for (i = 0, j = 0;i < number.length; i += 3)\n w = number[i] | number[i + 1] << 8 | number[i + 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26 && (off -= 26, j++);\n return this.strip();\n };\n function parseHex4Bits(string, index) {\n var c = string.charCodeAt(index);\n return c >= 65 && c <= 70 \? c - 55 : c >= 97 && c <= 102 \? c - 87 : c - 48 & 15;\n }\n function parseHexByte(string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n return index - 1 >= lowerBound && (r |= parseHex4Bits(string, index - 1) << 4), r;\n }\n BN.prototype._parseHex = function(number, start, endian) {\n this.length = Math.ceil((number.length - start) / 6), this.words = new Array(this.length);\n for (var i = 0;i < this.length; i++)\n this.words[i] = 0;\n var off = 0, j = 0, w;\n if (endian === \"be\")\n for (i = number.length - 1;i >= start; i -= 2)\n w = parseHexByte(number, start, i) << off, this.words[j] |= w & 67108863, off >= 18 \? (off -= 18, j += 1, this.words[j] |= w >>> 26) : off += 8;\n else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 \? start + 1 : start;i < number.length; i += 2)\n w = parseHexByte(number, start, i) << off, this.words[j] |= w & 67108863, off >= 18 \? (off -= 18, j += 1, this.words[j] |= w >>> 26) : off += 8;\n }\n this.strip();\n };\n function parseBase(str, start, end, mul) {\n for (var r = 0, len = Math.min(str.length, end), i = start;i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n r *= mul, c >= 49 \? r += c - 49 + 10 : c >= 17 \? r += c - 17 + 10 : r += c;\n }\n return r;\n }\n BN.prototype._parseBase = function(number, base, start) {\n this.words = [0], this.length = 1;\n for (var limbLen = 0, limbPow = 1;limbPow <= 67108863; limbPow *= base)\n limbLen++;\n limbLen--, limbPow = limbPow / base | 0;\n for (var total = number.length - start, mod = total % limbLen, end = Math.min(total, total - mod) + start, word = 0, i = start;i < end; i += limbLen)\n word = parseBase(number, i, i + limbLen, base), this.imuln(limbPow), this.words[0] + word < 67108864 \? this.words[0] += word : this._iaddn(word);\n if (mod !== 0) {\n var pow = 1;\n for (word = parseBase(number, i, number.length, base), i = 0;i < mod; i++)\n pow *= base;\n this.imuln(pow), this.words[0] + word < 67108864 \? this.words[0] += word : this._iaddn(word);\n }\n this.strip();\n }, BN.prototype.copy = function(dest) {\n dest.words = new Array(this.length);\n for (var i = 0;i < this.length; i++)\n dest.words[i] = this.words[i];\n dest.length = this.length, dest.negative = this.negative, dest.red = this.red;\n }, BN.prototype.clone = function() {\n var r = new BN(null);\n return this.copy(r), r;\n }, BN.prototype._expand = function(size) {\n for (;this.length < size; )\n this.words[this.length++] = 0;\n return this;\n }, BN.prototype.strip = function() {\n for (;this.length > 1 && this.words[this.length - 1] === 0; )\n this.length--;\n return this._normSign();\n }, BN.prototype._normSign = function() {\n return this.length === 1 && this.words[0] === 0 && (this.negative = 0), this;\n }, BN.prototype.inspect = function() {\n return (this.red \? \"<BN-R: \" : \"<BN: \") + this.toString(16) + \">\";\n };\n var zeros = [\n \"\",\n \"0\",\n \"00\",\n \"000\",\n \"0000\",\n \"00000\",\n \"000000\",\n \"0000000\",\n \"00000000\",\n \"000000000\",\n \"0000000000\",\n \"00000000000\",\n \"000000000000\",\n \"0000000000000\",\n \"00000000000000\",\n \"000000000000000\",\n \"0000000000000000\",\n \"00000000000000000\",\n \"000000000000000000\",\n \"0000000000000000000\",\n \"00000000000000000000\",\n \"000000000000000000000\",\n \"0000000000000000000000\",\n \"00000000000000000000000\",\n \"000000000000000000000000\",\n \"0000000000000000000000000\"\n ], groupSizes = [\n 0,\n 0,\n 25,\n 16,\n 12,\n 11,\n 10,\n 9,\n 8,\n 8,\n 7,\n 7,\n 7,\n 7,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5\n ], groupBases = [\n 0,\n 0,\n 33554432,\n 43046721,\n 16777216,\n 48828125,\n 60466176,\n 40353607,\n 16777216,\n 43046721,\n 1e7,\n 19487171,\n 35831808,\n 62748517,\n 7529536,\n 11390625,\n 16777216,\n 24137569,\n 34012224,\n 47045881,\n 64000000,\n 4084101,\n 5153632,\n 6436343,\n 7962624,\n 9765625,\n 11881376,\n 14348907,\n 17210368,\n 20511149,\n 24300000,\n 28629151,\n 33554432,\n 39135393,\n 45435424,\n 52521875,\n 60466176\n ];\n BN.prototype.toString = function(base, padding) {\n base = base || 10, padding = padding | 0 || 1;\n var out;\n if (base === 16 || base === \"hex\") {\n out = \"\";\n for (var off = 0, carry = 0, i = 0;i < this.length; i++) {\n var w = this.words[i], word = ((w << off | carry) & 16777215).toString(16);\n carry = w >>> 24 - off & 16777215, carry !== 0 || i !== this.length - 1 \? out = zeros[6 - word.length] + word + out : out = word + out, off += 2, off >= 26 && (off -= 26, i--);\n }\n for (carry !== 0 && (out = carry.toString(16) + out);out.length % padding !== 0; )\n out = \"0\" + out;\n return this.negative !== 0 && (out = \"-\" + out), out;\n }\n if (base === (base | 0) && base >= 2 && base <= 36) {\n var groupSize = groupSizes[base], groupBase = groupBases[base];\n out = \"\";\n var c = this.clone();\n for (c.negative = 0;!c.isZero(); ) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase), c.isZero() \? out = r + out : out = zeros[groupSize - r.length] + r + out;\n }\n for (this.isZero() && (out = \"0\" + out);out.length % padding !== 0; )\n out = \"0\" + out;\n return this.negative !== 0 && (out = \"-\" + out), out;\n }\n assert(!1, \"Base should be between 2 and 36\");\n }, BN.prototype.toNumber = function() {\n var ret = this.words[0];\n return this.length === 2 \? ret += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 \? ret += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && assert(!1, \"Number can only safely store up to 53 bits\"), this.negative !== 0 \? -ret : ret;\n }, BN.prototype.toJSON = function() {\n return this.toString(16);\n }, BN.prototype.toBuffer = function(endian, length) {\n return assert(typeof Buffer2 < \"u\"), this.toArrayLike(Buffer2, endian, length);\n }, BN.prototype.toArray = function(endian, length) {\n return this.toArrayLike(Array, endian, length);\n }, BN.prototype.toArrayLike = function(ArrayType, endian, length) {\n var byteLength = this.byteLength(), reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, \"byte array longer than desired length\"), assert(reqLength > 0, \"Requested array length <= 0\"), this.strip();\n var littleEndian = endian === \"le\", res = new ArrayType(reqLength), b, i, q = this.clone();\n if (littleEndian) {\n for (i = 0;!q.isZero(); i++)\n b = q.andln(255), q.iushrn(8), res[i] = b;\n for (;i < reqLength; i++)\n res[i] = 0;\n } else {\n for (i = 0;i < reqLength - byteLength; i++)\n res[i] = 0;\n for (i = 0;!q.isZero(); i++)\n b = q.andln(255), q.iushrn(8), res[reqLength - i - 1] = b;\n }\n return res;\n }, Math.clz32 \? BN.prototype._countBits = function(w) {\n return 32 - Math.clz32(w);\n } : BN.prototype._countBits = function(w) {\n var t = w, r = 0;\n return t >= 4096 && (r += 13, t >>>= 13), t >= 64 && (r += 7, t >>>= 7), t >= 8 && (r += 4, t >>>= 4), t >= 2 && (r += 2, t >>>= 2), r + t;\n }, BN.prototype._zeroBits = function(w) {\n if (w === 0)\n return 26;\n var t = w, r = 0;\n return (t & 8191) === 0 && (r += 13, t >>>= 13), (t & 127) === 0 && (r += 7, t >>>= 7), (t & 15) === 0 && (r += 4, t >>>= 4), (t & 3) === 0 && (r += 2, t >>>= 2), (t & 1) === 0 && r++, r;\n }, BN.prototype.bitLength = function() {\n var w = this.words[this.length - 1], hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n function toBitArray(num) {\n for (var w = new Array(num.bitLength()), bit = 0;bit < w.length; bit++) {\n var off = bit / 26 | 0, wbit = bit % 26;\n w[bit] = (num.words[off] & 1 << wbit) >>> wbit;\n }\n return w;\n }\n BN.prototype.zeroBits = function() {\n if (this.isZero())\n return 0;\n for (var r = 0, i = 0;i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n if (r += b, b !== 26)\n break;\n }\n return r;\n }, BN.prototype.byteLength = function() {\n return Math.ceil(this.bitLength() / 8);\n }, BN.prototype.toTwos = function(width) {\n return this.negative !== 0 \? this.abs().inotn(width).iaddn(1) : this.clone();\n }, BN.prototype.fromTwos = function(width) {\n return this.testn(width - 1) \? this.notn(width).iaddn(1).ineg() : this.clone();\n }, BN.prototype.isNeg = function() {\n return this.negative !== 0;\n }, BN.prototype.neg = function() {\n return this.clone().ineg();\n }, BN.prototype.ineg = function() {\n return this.isZero() || (this.negative ^= 1), this;\n }, BN.prototype.iuor = function(num) {\n for (;this.length < num.length; )\n this.words[this.length++] = 0;\n for (var i = 0;i < num.length; i++)\n this.words[i] = this.words[i] | num.words[i];\n return this.strip();\n }, BN.prototype.ior = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuor(num);\n }, BN.prototype.or = function(num) {\n return this.length > num.length \? this.clone().ior(num) : num.clone().ior(this);\n }, BN.prototype.uor = function(num) {\n return this.length > num.length \? this.clone().iuor(num) : num.clone().iuor(this);\n }, BN.prototype.iuand = function(num) {\n var b;\n this.length > num.length \? b = num : b = this;\n for (var i = 0;i < b.length; i++)\n this.words[i] = this.words[i] & num.words[i];\n return this.length = b.length, this.strip();\n }, BN.prototype.iand = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuand(num);\n }, BN.prototype.and = function(num) {\n return this.length > num.length \? this.clone().iand(num) : num.clone().iand(this);\n }, BN.prototype.uand = function(num) {\n return this.length > num.length \? this.clone().iuand(num) : num.clone().iuand(this);\n }, BN.prototype.iuxor = function(num) {\n var a, b;\n this.length > num.length \? (a = this, b = num) : (a = num, b = this);\n for (var i = 0;i < b.length; i++)\n this.words[i] = a.words[i] ^ b.words[i];\n if (this !== a)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this.length = a.length, this.strip();\n }, BN.prototype.ixor = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuxor(num);\n }, BN.prototype.xor = function(num) {\n return this.length > num.length \? this.clone().ixor(num) : num.clone().ixor(this);\n }, BN.prototype.uxor = function(num) {\n return this.length > num.length \? this.clone().iuxor(num) : num.clone().iuxor(this);\n }, BN.prototype.inotn = function(width) {\n assert(typeof width == \"number\" && width >= 0);\n var bytesNeeded = Math.ceil(width / 26) | 0, bitsLeft = width % 26;\n this._expand(bytesNeeded), bitsLeft > 0 && bytesNeeded--;\n for (var i = 0;i < bytesNeeded; i++)\n this.words[i] = ~this.words[i] & 67108863;\n return bitsLeft > 0 && (this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft), this.strip();\n }, BN.prototype.notn = function(width) {\n return this.clone().inotn(width);\n }, BN.prototype.setn = function(bit, val) {\n assert(typeof bit == \"number\" && bit >= 0);\n var off = bit / 26 | 0, wbit = bit % 26;\n return this._expand(off + 1), val \? this.words[off] = this.words[off] | 1 << wbit : this.words[off] = this.words[off] & ~(1 << wbit), this.strip();\n }, BN.prototype.iadd = function(num) {\n var r;\n if (this.negative !== 0 && num.negative === 0)\n return this.negative = 0, r = this.isub(num), this.negative ^= 1, this._normSign();\n if (this.negative === 0 && num.negative !== 0)\n return num.negative = 0, r = this.isub(num), num.negative = 1, r._normSign();\n var a, b;\n this.length > num.length \? (a = this, b = num) : (a = num, b = this);\n for (var carry = 0, i = 0;i < b.length; i++)\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry, this.words[i] = r & 67108863, carry = r >>> 26;\n for (;carry !== 0 && i < a.length; i++)\n r = (a.words[i] | 0) + carry, this.words[i] = r & 67108863, carry = r >>> 26;\n if (this.length = a.length, carry !== 0)\n this.words[this.length] = carry, this.length++;\n else if (a !== this)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this;\n }, BN.prototype.add = function(num) {\n var res;\n return num.negative !== 0 && this.negative === 0 \? (num.negative = 0, res = this.sub(num), num.negative ^= 1, res) : num.negative === 0 && this.negative !== 0 \? (this.negative = 0, res = num.sub(this), this.negative = 1, res) : this.length > num.length \? this.clone().iadd(num) : num.clone().iadd(this);\n }, BN.prototype.isub = function(num) {\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n return num.negative = 1, r._normSign();\n } else if (this.negative !== 0)\n return this.negative = 0, this.iadd(num), this.negative = 1, this._normSign();\n var cmp = this.cmp(num);\n if (cmp === 0)\n return this.negative = 0, this.length = 1, this.words[0] = 0, this;\n var a, b;\n cmp > 0 \? (a = this, b = num) : (a = num, b = this);\n for (var carry = 0, i = 0;i < b.length; i++)\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry, carry = r >> 26, this.words[i] = r & 67108863;\n for (;carry !== 0 && i < a.length; i++)\n r = (a.words[i] | 0) + carry, carry = r >> 26, this.words[i] = r & 67108863;\n if (carry === 0 && i < a.length && a !== this)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this.length = Math.max(this.length, i), a !== this && (this.negative = 1), this.strip();\n }, BN.prototype.sub = function(num) {\n return this.clone().isub(num);\n };\n function smallMulTo(self2, num, out) {\n out.negative = num.negative ^ self2.negative;\n var len = self2.length + num.length | 0;\n out.length = len, len = len - 1 | 0;\n var a = self2.words[0] | 0, b = num.words[0] | 0, r = a * b, lo = r & 67108863, carry = r / 67108864 | 0;\n out.words[0] = lo;\n for (var k = 1;k < len; k++) {\n for (var ncarry = carry >>> 26, rword = carry & 67108863, maxJ = Math.min(k, num.length - 1), j = Math.max(0, k - self2.length + 1);j <= maxJ; j++) {\n var i = k - j | 0;\n a = self2.words[i] | 0, b = num.words[j] | 0, r = a * b + rword, ncarry += r / 67108864 | 0, rword = r & 67108863;\n }\n out.words[k] = rword | 0, carry = ncarry | 0;\n }\n return carry !== 0 \? out.words[k] = carry | 0 : out.length--, out.strip();\n }\n var comb10MulTo = function(self2, num, out) {\n var a = self2.words, b = num.words, o = out.words, c = 0, lo, mid, hi, a0 = a[0] | 0, al0 = a0 & 8191, ah0 = a0 >>> 13, a1 = a[1] | 0, al1 = a1 & 8191, ah1 = a1 >>> 13, a2 = a[2] | 0, al2 = a2 & 8191, ah2 = a2 >>> 13, a3 = a[3] | 0, al3 = a3 & 8191, ah3 = a3 >>> 13, a4 = a[4] | 0, al4 = a4 & 8191, ah4 = a4 >>> 13, a5 = a[5] | 0, al5 = a5 & 8191, ah5 = a5 >>> 13, a6 = a[6] | 0, al6 = a6 & 8191, ah6 = a6 >>> 13, a7 = a[7] | 0, al7 = a7 & 8191, ah7 = a7 >>> 13, a8 = a[8] | 0, al8 = a8 & 8191, ah8 = a8 >>> 13, a9 = a[9] | 0, al9 = a9 & 8191, ah9 = a9 >>> 13, b0 = b[0] | 0, bl0 = b0 & 8191, bh0 = b0 >>> 13, b1 = b[1] | 0, bl1 = b1 & 8191, bh1 = b1 >>> 13, b2 = b[2] | 0, bl2 = b2 & 8191, bh2 = b2 >>> 13, b3 = b[3] | 0, bl3 = b3 & 8191, bh3 = b3 >>> 13, b4 = b[4] | 0, bl4 = b4 & 8191, bh4 = b4 >>> 13, b5 = b[5] | 0, bl5 = b5 & 8191, bh5 = b5 >>> 13, b6 = b[6] | 0, bl6 = b6 & 8191, bh6 = b6 >>> 13, b7 = b[7] | 0, bl7 = b7 & 8191, bh7 = b7 >>> 13, b8 = b[8] | 0, bl8 = b8 & 8191, bh8 = b8 >>> 13, b9 = b[9] | 0, bl9 = b9 & 8191, bh9 = b9 >>> 13;\n out.negative = self2.negative ^ num.negative, out.length = 19, lo = Math.imul(al0, bl0), mid = Math.imul(al0, bh0), mid = mid + Math.imul(ah0, bl0) | 0, hi = Math.imul(ah0, bh0);\n var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0, w0 &= 67108863, lo = Math.imul(al1, bl0), mid = Math.imul(al1, bh0), mid = mid + Math.imul(ah1, bl0) | 0, hi = Math.imul(ah1, bh0), lo = lo + Math.imul(al0, bl1) | 0, mid = mid + Math.imul(al0, bh1) | 0, mid = mid + Math.imul(ah0, bl1) | 0, hi = hi + Math.imul(ah0, bh1) | 0;\n var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0, w1 &= 67108863, lo = Math.imul(al2, bl0), mid = Math.imul(al2, bh0), mid = mid + Math.imul(ah2, bl0) | 0, hi = Math.imul(ah2, bh0), lo = lo + Math.imul(al1, bl1) | 0, mid = mid + Math.imul(al1, bh1) | 0, mid = mid + Math.imul(ah1, bl1) | 0, hi = hi + Math.imul(ah1, bh1) | 0, lo = lo + Math.imul(al0, bl2) | 0, mid = mid + Math.imul(al0, bh2) | 0, mid = mid + Math.imul(ah0, bl2) | 0, hi = hi + Math.imul(ah0, bh2) | 0;\n var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0, w2 &= 67108863, lo = Math.imul(al3, bl0), mid = Math.imul(al3, bh0), mid = mid + Math.imul(ah3, bl0) | 0, hi = Math.imul(ah3, bh0), lo = lo + Math.imul(al2, bl1) | 0, mid = mid + Math.imul(al2, bh1) | 0, mid = mid + Math.imul(ah2, bl1) | 0, hi = hi + Math.imul(ah2, bh1) | 0, lo = lo + Math.imul(al1, bl2) | 0, mid = mid + Math.imul(al1, bh2) | 0, mid = mid + Math.imul(ah1, bl2) | 0, hi = hi + Math.imul(ah1, bh2) | 0, lo = lo + Math.imul(al0, bl3) | 0, mid = mid + Math.imul(al0, bh3) | 0, mid = mid + Math.imul(ah0, bl3) | 0, hi = hi + Math.imul(ah0, bh3) | 0;\n var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0, w3 &= 67108863, lo = Math.imul(al4, bl0), mid = Math.imul(al4, bh0), mid = mid + Math.imul(ah4, bl0) | 0, hi = Math.imul(ah4, bh0), lo = lo + Math.imul(al3, bl1) | 0, mid = mid + Math.imul(al3, bh1) | 0, mid = mid + Math.imul(ah3, bl1) | 0, hi = hi + Math.imul(ah3, bh1) | 0, lo = lo + Math.imul(al2, bl2) | 0, mid = mid + Math.imul(al2, bh2) | 0, mid = mid + Math.imul(ah2, bl2) | 0, hi = hi + Math.imul(ah2, bh2) | 0, lo = lo + Math.imul(al1, bl3) | 0, mid = mid + Math.imul(al1, bh3) | 0, mid = mid + Math.imul(ah1, bl3) | 0, hi = hi + Math.imul(ah1, bh3) | 0, lo = lo + Math.imul(al0, bl4) | 0, mid = mid + Math.imul(al0, bh4) | 0, mid = mid + Math.imul(ah0, bl4) | 0, hi = hi + Math.imul(ah0, bh4) | 0;\n var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0, w4 &= 67108863, lo = Math.imul(al5, bl0), mid = Math.imul(al5, bh0), mid = mid + Math.imul(ah5, bl0) | 0, hi = Math.imul(ah5, bh0), lo = lo + Math.imul(al4, bl1) | 0, mid = mid + Math.imul(al4, bh1) | 0, mid = mid + Math.imul(ah4, bl1) | 0, hi = hi + Math.imul(ah4, bh1) | 0, lo = lo + Math.imul(al3, bl2) | 0, mid = mid + Math.imul(al3, bh2) | 0, mid = mid + Math.imul(ah3, bl2) | 0, hi = hi + Math.imul(ah3, bh2) | 0, lo = lo + Math.imul(al2, bl3) | 0, mid = mid + Math.imul(al2, bh3) | 0, mid = mid + Math.imul(ah2, bl3) | 0, hi = hi + Math.imul(ah2, bh3) | 0, lo = lo + Math.imul(al1, bl4) | 0, mid = mid + Math.imul(al1, bh4) | 0, mid = mid + Math.imul(ah1, bl4) | 0, hi = hi + Math.imul(ah1, bh4) | 0, lo = lo + Math.imul(al0, bl5) | 0, mid = mid + Math.imul(al0, bh5) | 0, mid = mid + Math.imul(ah0, bl5) | 0, hi = hi + Math.imul(ah0, bh5) | 0;\n var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0, w5 &= 67108863, lo = Math.imul(al6, bl0), mid = Math.imul(al6, bh0), mid = mid + Math.imul(ah6, bl0) | 0, hi = Math.imul(ah6, bh0), lo = lo + Math.imul(al5, bl1) | 0, mid = mid + Math.imul(al5, bh1) | 0, mid = mid + Math.imul(ah5, bl1) | 0, hi = hi + Math.imul(ah5, bh1) | 0, lo = lo + Math.imul(al4, bl2) | 0, mid = mid + Math.imul(al4, bh2) | 0, mid = mid + Math.imul(ah4, bl2) | 0, hi = hi + Math.imul(ah4, bh2) | 0, lo = lo + Math.imul(al3, bl3) | 0, mid = mid + Math.imul(al3, bh3) | 0, mid = mid + Math.imul(ah3, bl3) | 0, hi = hi + Math.imul(ah3, bh3) | 0, lo = lo + Math.imul(al2, bl4) | 0, mid = mid + Math.imul(al2, bh4) | 0, mid = mid + Math.imul(ah2, bl4) | 0, hi = hi + Math.imul(ah2, bh4) | 0, lo = lo + Math.imul(al1, bl5) | 0, mid = mid + Math.imul(al1, bh5) | 0, mid = mid + Math.imul(ah1, bl5) | 0, hi = hi + Math.imul(ah1, bh5) | 0, lo = lo + Math.imul(al0, bl6) | 0, mid = mid + Math.imul(al0, bh6) | 0, mid = mid + Math.imul(ah0, bl6) | 0, hi = hi + Math.imul(ah0, bh6) | 0;\n var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0, w6 &= 67108863, lo = Math.imul(al7, bl0), mid = Math.imul(al7, bh0), mid = mid + Math.imul(ah7, bl0) | 0, hi = Math.imul(ah7, bh0), lo = lo + Math.imul(al6, bl1) | 0, mid = mid + Math.imul(al6, bh1) | 0, mid = mid + Math.imul(ah6, bl1) | 0, hi = hi + Math.imul(ah6, bh1) | 0, lo = lo + Math.imul(al5, bl2) | 0, mid = mid + Math.imul(al5, bh2) | 0, mid = mid + Math.imul(ah5, bl2) | 0, hi = hi + Math.imul(ah5, bh2) | 0, lo = lo + Math.imul(al4, bl3) | 0, mid = mid + Math.imul(al4, bh3) | 0, mid = mid + Math.imul(ah4, bl3) | 0, hi = hi + Math.imul(ah4, bh3) | 0, lo = lo + Math.imul(al3, bl4) | 0, mid = mid + Math.imul(al3, bh4) | 0, mid = mid + Math.imul(ah3, bl4) | 0, hi = hi + Math.imul(ah3, bh4) | 0, lo = lo + Math.imul(al2, bl5) | 0, mid = mid + Math.imul(al2, bh5) | 0, mid = mid + Math.imul(ah2, bl5) | 0, hi = hi + Math.imul(ah2, bh5) | 0, lo = lo + Math.imul(al1, bl6) | 0, mid = mid + Math.imul(al1, bh6) | 0, mid = mid + Math.imul(ah1, bl6) | 0, hi = hi + Math.imul(ah1, bh6) | 0, lo = lo + Math.imul(al0, bl7) | 0, mid = mid + Math.imul(al0, bh7) | 0, mid = mid + Math.imul(ah0, bl7) | 0, hi = hi + Math.imul(ah0, bh7) | 0;\n var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0, w7 &= 67108863, lo = Math.imul(al8, bl0), mid = Math.imul(al8, bh0), mid = mid + Math.imul(ah8, bl0) | 0, hi = Math.imul(ah8, bh0), lo = lo + Math.imul(al7, bl1) | 0, mid = mid + Math.imul(al7, bh1) | 0, mid = mid + Math.imul(ah7, bl1) | 0, hi = hi + Math.imul(ah7, bh1) | 0, lo = lo + Math.imul(al6, bl2) | 0, mid = mid + Math.imul(al6, bh2) | 0, mid = mid + Math.imul(ah6, bl2) | 0, hi = hi + Math.imul(ah6, bh2) | 0, lo = lo + Math.imul(al5, bl3) | 0, mid = mid + Math.imul(al5, bh3) | 0, mid = mid + Math.imul(ah5, bl3) | 0, hi = hi + Math.imul(ah5, bh3) | 0, lo = lo + Math.imul(al4, bl4) | 0, mid = mid + Math.imul(al4, bh4) | 0, mid = mid + Math.imul(ah4, bl4) | 0, hi = hi + Math.imul(ah4, bh4) | 0, lo = lo + Math.imul(al3, bl5) | 0, mid = mid + Math.imul(al3, bh5) | 0, mid = mid + Math.imul(ah3, bl5) | 0, hi = hi + Math.imul(ah3, bh5) | 0, lo = lo + Math.imul(al2, bl6) | 0, mid = mid + Math.imul(al2, bh6) | 0, mid = mid + Math.imul(ah2, bl6) | 0, hi = hi + Math.imul(ah2, bh6) | 0, lo = lo + Math.imul(al1, bl7) | 0, mid = mid + Math.imul(al1, bh7) | 0, mid = mid + Math.imul(ah1, bl7) | 0, hi = hi + Math.imul(ah1, bh7) | 0, lo = lo + Math.imul(al0, bl8) | 0, mid = mid + Math.imul(al0, bh8) | 0, mid = mid + Math.imul(ah0, bl8) | 0, hi = hi + Math.imul(ah0, bh8) | 0;\n var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0, w8 &= 67108863, lo = Math.imul(al9, bl0), mid = Math.imul(al9, bh0), mid = mid + Math.imul(ah9, bl0) | 0, hi = Math.imul(ah9, bh0), lo = lo + Math.imul(al8, bl1) | 0, mid = mid + Math.imul(al8, bh1) | 0, mid = mid + Math.imul(ah8, bl1) | 0, hi = hi + Math.imul(ah8, bh1) | 0, lo = lo + Math.imul(al7, bl2) | 0, mid = mid + Math.imul(al7, bh2) | 0, mid = mid + Math.imul(ah7, bl2) | 0, hi = hi + Math.imul(ah7, bh2) | 0, lo = lo + Math.imul(al6, bl3) | 0, mid = mid + Math.imul(al6, bh3) | 0, mid = mid + Math.imul(ah6, bl3) | 0, hi = hi + Math.imul(ah6, bh3) | 0, lo = lo + Math.imul(al5, bl4) | 0, mid = mid + Math.imul(al5, bh4) | 0, mid = mid + Math.imul(ah5, bl4) | 0, hi = hi + Math.imul(ah5, bh4) | 0, lo = lo + Math.imul(al4, bl5) | 0, mid = mid + Math.imul(al4, bh5) | 0, mid = mid + Math.imul(ah4, bl5) | 0, hi = hi + Math.imul(ah4, bh5) | 0, lo = lo + Math.imul(al3, bl6) | 0, mid = mid + Math.imul(al3, bh6) | 0, mid = mid + Math.imul(ah3, bl6) | 0, hi = hi + Math.imul(ah3, bh6) | 0, lo = lo + Math.imul(al2, bl7) | 0, mid = mid + Math.imul(al2, bh7) | 0, mid = mid + Math.imul(ah2, bl7) | 0, hi = hi + Math.imul(ah2, bh7) | 0, lo = lo + Math.imul(al1, bl8) | 0, mid = mid + Math.imul(al1, bh8) | 0, mid = mid + Math.imul(ah1, bl8) | 0, hi = hi + Math.imul(ah1, bh8) | 0, lo = lo + Math.imul(al0, bl9) | 0, mid = mid + Math.imul(al0, bh9) | 0, mid = mid + Math.imul(ah0, bl9) | 0, hi = hi + Math.imul(ah0, bh9) | 0;\n var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0, w9 &= 67108863, lo = Math.imul(al9, bl1), mid = Math.imul(al9, bh1), mid = mid + Math.imul(ah9, bl1) | 0, hi = Math.imul(ah9, bh1), lo = lo + Math.imul(al8, bl2) | 0, mid = mid + Math.imul(al8, bh2) | 0, mid = mid + Math.imul(ah8, bl2) | 0, hi = hi + Math.imul(ah8, bh2) | 0, lo = lo + Math.imul(al7, bl3) | 0, mid = mid + Math.imul(al7, bh3) | 0, mid = mid + Math.imul(ah7, bl3) | 0, hi = hi + Math.imul(ah7, bh3) | 0, lo = lo + Math.imul(al6, bl4) | 0, mid = mid + Math.imul(al6, bh4) | 0, mid = mid + Math.imul(ah6, bl4) | 0, hi = hi + Math.imul(ah6, bh4) | 0, lo = lo + Math.imul(al5, bl5) | 0, mid = mid + Math.imul(al5, bh5) | 0, mid = mid + Math.imul(ah5, bl5) | 0, hi = hi + Math.imul(ah5, bh5) | 0, lo = lo + Math.imul(al4, bl6) | 0, mid = mid + Math.imul(al4, bh6) | 0, mid = mid + Math.imul(ah4, bl6) | 0, hi = hi + Math.imul(ah4, bh6) | 0, lo = lo + Math.imul(al3, bl7) | 0, mid = mid + Math.imul(al3, bh7) | 0, mid = mid + Math.imul(ah3, bl7) | 0, hi = hi + Math.imul(ah3, bh7) | 0, lo = lo + Math.imul(al2, bl8) | 0, mid = mid + Math.imul(al2, bh8) | 0, mid = mid + Math.imul(ah2, bl8) | 0, hi = hi + Math.imul(ah2, bh8) | 0, lo = lo + Math.imul(al1, bl9) | 0, mid = mid + Math.imul(al1, bh9) | 0, mid = mid + Math.imul(ah1, bl9) | 0, hi = hi + Math.imul(ah1, bh9) | 0;\n var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0, w10 &= 67108863, lo = Math.imul(al9, bl2), mid = Math.imul(al9, bh2), mid = mid + Math.imul(ah9, bl2) | 0, hi = Math.imul(ah9, bh2), lo = lo + Math.imul(al8, bl3) | 0, mid = mid + Math.imul(al8, bh3) | 0, mid = mid + Math.imul(ah8, bl3) | 0, hi = hi + Math.imul(ah8, bh3) | 0, lo = lo + Math.imul(al7, bl4) | 0, mid = mid + Math.imul(al7, bh4) | 0, mid = mid + Math.imul(ah7, bl4) | 0, hi = hi + Math.imul(ah7, bh4) | 0, lo = lo + Math.imul(al6, bl5) | 0, mid = mid + Math.imul(al6, bh5) | 0, mid = mid + Math.imul(ah6, bl5) | 0, hi = hi + Math.imul(ah6, bh5) | 0, lo = lo + Math.imul(al5, bl6) | 0, mid = mid + Math.imul(al5, bh6) | 0, mid = mid + Math.imul(ah5, bl6) | 0, hi = hi + Math.imul(ah5, bh6) | 0, lo = lo + Math.imul(al4, bl7) | 0, mid = mid + Math.imul(al4, bh7) | 0, mid = mid + Math.imul(ah4, bl7) | 0, hi = hi + Math.imul(ah4, bh7) | 0, lo = lo + Math.imul(al3, bl8) | 0, mid = mid + Math.imul(al3, bh8) | 0, mid = mid + Math.imul(ah3, bl8) | 0, hi = hi + Math.imul(ah3, bh8) | 0, lo = lo + Math.imul(al2, bl9) | 0, mid = mid + Math.imul(al2, bh9) | 0, mid = mid + Math.imul(ah2, bl9) | 0, hi = hi + Math.imul(ah2, bh9) | 0;\n var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0, w11 &= 67108863, lo = Math.imul(al9, bl3), mid = Math.imul(al9, bh3), mid = mid + Math.imul(ah9, bl3) | 0, hi = Math.imul(ah9, bh3), lo = lo + Math.imul(al8, bl4) | 0, mid = mid + Math.imul(al8, bh4) | 0, mid = mid + Math.imul(ah8, bl4) | 0, hi = hi + Math.imul(ah8, bh4) | 0, lo = lo + Math.imul(al7, bl5) | 0, mid = mid + Math.imul(al7, bh5) | 0, mid = mid + Math.imul(ah7, bl5) | 0, hi = hi + Math.imul(ah7, bh5) | 0, lo = lo + Math.imul(al6, bl6) | 0, mid = mid + Math.imul(al6, bh6) | 0, mid = mid + Math.imul(ah6, bl6) | 0, hi = hi + Math.imul(ah6, bh6) | 0, lo = lo + Math.imul(al5, bl7) | 0, mid = mid + Math.imul(al5, bh7) | 0, mid = mid + Math.imul(ah5, bl7) | 0, hi = hi + Math.imul(ah5, bh7) | 0, lo = lo + Math.imul(al4, bl8) | 0, mid = mid + Math.imul(al4, bh8) | 0, mid = mid + Math.imul(ah4, bl8) | 0, hi = hi + Math.imul(ah4, bh8) | 0, lo = lo + Math.imul(al3, bl9) | 0, mid = mid + Math.imul(al3, bh9) | 0, mid = mid + Math.imul(ah3, bl9) | 0, hi = hi + Math.imul(ah3, bh9) | 0;\n var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0, w12 &= 67108863, lo = Math.imul(al9, bl4), mid = Math.imul(al9, bh4), mid = mid + Math.imul(ah9, bl4) | 0, hi = Math.imul(ah9, bh4), lo = lo + Math.imul(al8, bl5) | 0, mid = mid + Math.imul(al8, bh5) | 0, mid = mid + Math.imul(ah8, bl5) | 0, hi = hi + Math.imul(ah8, bh5) | 0, lo = lo + Math.imul(al7, bl6) | 0, mid = mid + Math.imul(al7, bh6) | 0, mid = mid + Math.imul(ah7, bl6) | 0, hi = hi + Math.imul(ah7, bh6) | 0, lo = lo + Math.imul(al6, bl7) | 0, mid = mid + Math.imul(al6, bh7) | 0, mid = mid + Math.imul(ah6, bl7) | 0, hi = hi + Math.imul(ah6, bh7) | 0, lo = lo + Math.imul(al5, bl8) | 0, mid = mid + Math.imul(al5, bh8) | 0, mid = mid + Math.imul(ah5, bl8) | 0, hi = hi + Math.imul(ah5, bh8) | 0, lo = lo + Math.imul(al4, bl9) | 0, mid = mid + Math.imul(al4, bh9) | 0, mid = mid + Math.imul(ah4, bl9) | 0, hi = hi + Math.imul(ah4, bh9) | 0;\n var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0, w13 &= 67108863, lo = Math.imul(al9, bl5), mid = Math.imul(al9, bh5), mid = mid + Math.imul(ah9, bl5) | 0, hi = Math.imul(ah9, bh5), lo = lo + Math.imul(al8, bl6) | 0, mid = mid + Math.imul(al8, bh6) | 0, mid = mid + Math.imul(ah8, bl6) | 0, hi = hi + Math.imul(ah8, bh6) | 0, lo = lo + Math.imul(al7, bl7) | 0, mid = mid + Math.imul(al7, bh7) | 0, mid = mid + Math.imul(ah7, bl7) | 0, hi = hi + Math.imul(ah7, bh7) | 0, lo = lo + Math.imul(al6, bl8) | 0, mid = mid + Math.imul(al6, bh8) | 0, mid = mid + Math.imul(ah6, bl8) | 0, hi = hi + Math.imul(ah6, bh8) | 0, lo = lo + Math.imul(al5, bl9) | 0, mid = mid + Math.imul(al5, bh9) | 0, mid = mid + Math.imul(ah5, bl9) | 0, hi = hi + Math.imul(ah5, bh9) | 0;\n var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0, w14 &= 67108863, lo = Math.imul(al9, bl6), mid = Math.imul(al9, bh6), mid = mid + Math.imul(ah9, bl6) | 0, hi = Math.imul(ah9, bh6), lo = lo + Math.imul(al8, bl7) | 0, mid = mid + Math.imul(al8, bh7) | 0, mid = mid + Math.imul(ah8, bl7) | 0, hi = hi + Math.imul(ah8, bh7) | 0, lo = lo + Math.imul(al7, bl8) | 0, mid = mid + Math.imul(al7, bh8) | 0, mid = mid + Math.imul(ah7, bl8) | 0, hi = hi + Math.imul(ah7, bh8) | 0, lo = lo + Math.imul(al6, bl9) | 0, mid = mid + Math.imul(al6, bh9) | 0, mid = mid + Math.imul(ah6, bl9) | 0, hi = hi + Math.imul(ah6, bh9) | 0;\n var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0, w15 &= 67108863, lo = Math.imul(al9, bl7), mid = Math.imul(al9, bh7), mid = mid + Math.imul(ah9, bl7) | 0, hi = Math.imul(ah9, bh7), lo = lo + Math.imul(al8, bl8) | 0, mid = mid + Math.imul(al8, bh8) | 0, mid = mid + Math.imul(ah8, bl8) | 0, hi = hi + Math.imul(ah8, bh8) | 0, lo = lo + Math.imul(al7, bl9) | 0, mid = mid + Math.imul(al7, bh9) | 0, mid = mid + Math.imul(ah7, bl9) | 0, hi = hi + Math.imul(ah7, bh9) | 0;\n var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0, w16 &= 67108863, lo = Math.imul(al9, bl8), mid = Math.imul(al9, bh8), mid = mid + Math.imul(ah9, bl8) | 0, hi = Math.imul(ah9, bh8), lo = lo + Math.imul(al8, bl9) | 0, mid = mid + Math.imul(al8, bh9) | 0, mid = mid + Math.imul(ah8, bl9) | 0, hi = hi + Math.imul(ah8, bh9) | 0;\n var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0, w17 &= 67108863, lo = Math.imul(al9, bl9), mid = Math.imul(al9, bh9), mid = mid + Math.imul(ah9, bl9) | 0, hi = Math.imul(ah9, bh9);\n var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n return c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0, w18 &= 67108863, o[0] = w0, o[1] = w1, o[2] = w2, o[3] = w3, o[4] = w4, o[5] = w5, o[6] = w6, o[7] = w7, o[8] = w8, o[9] = w9, o[10] = w10, o[11] = w11, o[12] = w12, o[13] = w13, o[14] = w14, o[15] = w15, o[16] = w16, o[17] = w17, o[18] = w18, c !== 0 && (o[19] = c, out.length++), out;\n };\n Math.imul || (comb10MulTo = smallMulTo);\n function bigMulTo(self2, num, out) {\n out.negative = num.negative ^ self2.negative, out.length = self2.length + num.length;\n for (var carry = 0, hncarry = 0, k = 0;k < out.length - 1; k++) {\n var ncarry = hncarry;\n hncarry = 0;\n for (var rword = carry & 67108863, maxJ = Math.min(k, num.length - 1), j = Math.max(0, k - self2.length + 1);j <= maxJ; j++) {\n var i = k - j, a = self2.words[i] | 0, b = num.words[j] | 0, r = a * b, lo = r & 67108863;\n ncarry = ncarry + (r / 67108864 | 0) | 0, lo = lo + rword | 0, rword = lo & 67108863, ncarry = ncarry + (lo >>> 26) | 0, hncarry += ncarry >>> 26, ncarry &= 67108863;\n }\n out.words[k] = rword, carry = ncarry, ncarry = hncarry;\n }\n return carry !== 0 \? out.words[k] = carry : out.length--, out.strip();\n }\n function jumboMulTo(self2, num, out) {\n var fftm = new FFTM;\n return fftm.mulp(self2, num, out);\n }\n BN.prototype.mulTo = function(num, out) {\n var res, len = this.length + num.length;\n return this.length === 10 && num.length === 10 \? res = comb10MulTo(this, num, out) : len < 63 \? res = smallMulTo(this, num, out) : len < 1024 \? res = bigMulTo(this, num, out) : res = jumboMulTo(this, num, out), res;\n };\n function FFTM(x, y) {\n this.x = x, this.y = y;\n }\n FFTM.prototype = {}, FFTM.prototype.makeRBT = function(N) {\n for (var t = new Array(N), l = BN.prototype._countBits(N) - 1, i = 0;i < N; i++)\n t[i] = this.revBin(i, l, N);\n return t;\n }, FFTM.prototype.revBin = function(x, l, N) {\n if (x === 0 || x === N - 1)\n return x;\n for (var rb = 0, i = 0;i < l; i++)\n rb |= (x & 1) << l - i - 1, x >>= 1;\n return rb;\n }, FFTM.prototype.permute = function(rbt, rws, iws, rtws, itws, N) {\n for (var i = 0;i < N; i++)\n rtws[i] = rws[rbt[i]], itws[i] = iws[rbt[i]];\n }, FFTM.prototype.transform = function(rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n for (var s = 1;s < N; s <<= 1)\n for (var l = s << 1, rtwdf = Math.cos(2 * Math.PI / l), itwdf = Math.sin(2 * Math.PI / l), p = 0;p < N; p += l)\n for (var rtwdf_ = rtwdf, itwdf_ = itwdf, j = 0;j < s; j++) {\n var re = rtws[p + j], ie = itws[p + j], ro = rtws[p + j + s], io = itws[p + j + s], rx = rtwdf_ * ro - itwdf_ * io;\n io = rtwdf_ * io + itwdf_ * ro, ro = rx, rtws[p + j] = re + ro, itws[p + j] = ie + io, rtws[p + j + s] = re - ro, itws[p + j + s] = ie - io, j !== l && (rx = rtwdf * rtwdf_ - itwdf * itwdf_, itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_, rtwdf_ = rx);\n }\n }, FFTM.prototype.guessLen13b = function(n, m) {\n var N = Math.max(m, n) | 1, odd = N & 1, i = 0;\n for (N = N / 2 | 0;N; N = N >>> 1)\n i++;\n return 1 << i + 1 + odd;\n }, FFTM.prototype.conjugate = function(rws, iws, N) {\n if (!(N <= 1))\n for (var i = 0;i < N / 2; i++) {\n var t = rws[i];\n rws[i] = rws[N - i - 1], rws[N - i - 1] = t, t = iws[i], iws[i] = -iws[N - i - 1], iws[N - i - 1] = -t;\n }\n }, FFTM.prototype.normalize13b = function(ws, N) {\n for (var carry = 0, i = 0;i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;\n ws[i] = w & 67108863, w < 67108864 \? carry = 0 : carry = w / 67108864 | 0;\n }\n return ws;\n }, FFTM.prototype.convert13b = function(ws, len, rws, N) {\n for (var carry = 0, i = 0;i < len; i++)\n carry = carry + (ws[i] | 0), rws[2 * i] = carry & 8191, carry = carry >>> 13, rws[2 * i + 1] = carry & 8191, carry = carry >>> 13;\n for (i = 2 * len;i < N; ++i)\n rws[i] = 0;\n assert(carry === 0), assert((carry & -8192) === 0);\n }, FFTM.prototype.stub = function(N) {\n for (var ph = new Array(N), i = 0;i < N; i++)\n ph[i] = 0;\n return ph;\n }, FFTM.prototype.mulp = function(x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length), rbt = this.makeRBT(N), _ = this.stub(N), rws = new Array(N), rwst = new Array(N), iwst = new Array(N), nrws = new Array(N), nrwst = new Array(N), niwst = new Array(N), rmws = out.words;\n rmws.length = N, this.convert13b(x.words, x.length, rws, N), this.convert13b(y.words, y.length, nrws, N), this.transform(rws, _, rwst, iwst, N, rbt), this.transform(nrws, _, nrwst, niwst, N, rbt);\n for (var i = 0;i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i], rwst[i] = rx;\n }\n return this.conjugate(rwst, iwst, N), this.transform(rwst, iwst, rmws, _, N, rbt), this.conjugate(rmws, _, N), this.normalize13b(rmws, N), out.negative = x.negative ^ y.negative, out.length = x.length + y.length, out.strip();\n }, BN.prototype.mul = function(num) {\n var out = new BN(null);\n return out.words = new Array(this.length + num.length), this.mulTo(num, out);\n }, BN.prototype.mulf = function(num) {\n var out = new BN(null);\n return out.words = new Array(this.length + num.length), jumboMulTo(this, num, out);\n }, BN.prototype.imul = function(num) {\n return this.clone().mulTo(num, this);\n }, BN.prototype.imuln = function(num) {\n assert(typeof num == \"number\"), assert(num < 67108864);\n for (var carry = 0, i = 0;i < this.length; i++) {\n var w = (this.words[i] | 0) * num, lo = (w & 67108863) + (carry & 67108863);\n carry >>= 26, carry += w / 67108864 | 0, carry += lo >>> 26, this.words[i] = lo & 67108863;\n }\n return carry !== 0 && (this.words[i] = carry, this.length++), this;\n }, BN.prototype.muln = function(num) {\n return this.clone().imuln(num);\n }, BN.prototype.sqr = function() {\n return this.mul(this);\n }, BN.prototype.isqr = function() {\n return this.imul(this.clone());\n }, BN.prototype.pow = function(num) {\n var w = toBitArray(num);\n if (w.length === 0)\n return new BN(1);\n for (var res = this, i = 0;i < w.length && w[i] === 0; i++, res = res.sqr())\n ;\n if (++i < w.length)\n for (var q = res.sqr();i < w.length; i++, q = q.sqr())\n w[i] !== 0 && (res = res.mul(q));\n return res;\n }, BN.prototype.iushln = function(bits) {\n assert(typeof bits == \"number\" && bits >= 0);\n var r = bits % 26, s = (bits - r) / 26, carryMask = 67108863 >>> 26 - r << 26 - r, i;\n if (r !== 0) {\n var carry = 0;\n for (i = 0;i < this.length; i++) {\n var newCarry = this.words[i] & carryMask, c = (this.words[i] | 0) - newCarry << r;\n this.words[i] = c | carry, carry = newCarry >>> 26 - r;\n }\n carry && (this.words[i] = carry, this.length++);\n }\n if (s !== 0) {\n for (i = this.length - 1;i >= 0; i--)\n this.words[i + s] = this.words[i];\n for (i = 0;i < s; i++)\n this.words[i] = 0;\n this.length += s;\n }\n return this.strip();\n }, BN.prototype.ishln = function(bits) {\n return assert(this.negative === 0), this.iushln(bits);\n }, BN.prototype.iushrn = function(bits, hint, extended) {\n assert(typeof bits == \"number\" && bits >= 0);\n var h;\n hint \? h = (hint - hint % 26) / 26 : h = 0;\n var r = bits % 26, s = Math.min((bits - r) / 26, this.length), mask = 67108863 ^ 67108863 >>> r << r, maskedWords = extended;\n if (h -= s, h = Math.max(0, h), maskedWords) {\n for (var i = 0;i < s; i++)\n maskedWords.words[i] = this.words[i];\n maskedWords.length = s;\n }\n if (s !== 0)\n if (this.length > s)\n for (this.length -= s, i = 0;i < this.length; i++)\n this.words[i] = this.words[i + s];\n else\n this.words[0] = 0, this.length = 1;\n var carry = 0;\n for (i = this.length - 1;i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = carry << 26 - r | word >>> r, carry = word & mask;\n }\n return maskedWords && carry !== 0 && (maskedWords.words[maskedWords.length++] = carry), this.length === 0 && (this.words[0] = 0, this.length = 1), this.strip();\n }, BN.prototype.ishrn = function(bits, hint, extended) {\n return assert(this.negative === 0), this.iushrn(bits, hint, extended);\n }, BN.prototype.shln = function(bits) {\n return this.clone().ishln(bits);\n }, BN.prototype.ushln = function(bits) {\n return this.clone().iushln(bits);\n }, BN.prototype.shrn = function(bits) {\n return this.clone().ishrn(bits);\n }, BN.prototype.ushrn = function(bits) {\n return this.clone().iushrn(bits);\n }, BN.prototype.testn = function(bit) {\n assert(typeof bit == \"number\" && bit >= 0);\n var r = bit % 26, s = (bit - r) / 26, q = 1 << r;\n if (this.length <= s)\n return !1;\n var w = this.words[s];\n return !!(w & q);\n }, BN.prototype.imaskn = function(bits) {\n assert(typeof bits == \"number\" && bits >= 0);\n var r = bits % 26, s = (bits - r) / 26;\n if (assert(this.negative === 0, \"imaskn works only with positive numbers\"), this.length <= s)\n return this;\n if (r !== 0 && s++, this.length = Math.min(s, this.length), r !== 0) {\n var mask = 67108863 ^ 67108863 >>> r << r;\n this.words[this.length - 1] &= mask;\n }\n return this.strip();\n }, BN.prototype.maskn = function(bits) {\n return this.clone().imaskn(bits);\n }, BN.prototype.iaddn = function(num) {\n return assert(typeof num == \"number\"), assert(num < 67108864), num < 0 \? this.isubn(-num) : this.negative !== 0 \? this.length === 1 && (this.words[0] | 0) < num \? (this.words[0] = num - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(num), this.negative = 1, this) : this._iaddn(num);\n }, BN.prototype._iaddn = function(num) {\n this.words[0] += num;\n for (var i = 0;i < this.length && this.words[i] >= 67108864; i++)\n this.words[i] -= 67108864, i === this.length - 1 \? this.words[i + 1] = 1 : this.words[i + 1]++;\n return this.length = Math.max(this.length, i + 1), this;\n }, BN.prototype.isubn = function(num) {\n if (assert(typeof num == \"number\"), assert(num < 67108864), num < 0)\n return this.iaddn(-num);\n if (this.negative !== 0)\n return this.negative = 0, this.iaddn(num), this.negative = 1, this;\n if (this.words[0] -= num, this.length === 1 && this.words[0] < 0)\n this.words[0] = -this.words[0], this.negative = 1;\n else\n for (var i = 0;i < this.length && this.words[i] < 0; i++)\n this.words[i] += 67108864, this.words[i + 1] -= 1;\n return this.strip();\n }, BN.prototype.addn = function(num) {\n return this.clone().iaddn(num);\n }, BN.prototype.subn = function(num) {\n return this.clone().isubn(num);\n }, BN.prototype.iabs = function() {\n return this.negative = 0, this;\n }, BN.prototype.abs = function() {\n return this.clone().iabs();\n }, BN.prototype._ishlnsubmul = function(num, mul, shift) {\n var len = num.length + shift, i;\n this._expand(len);\n var w, carry = 0;\n for (i = 0;i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 67108863, carry = (w >> 26) - (right / 67108864 | 0), this.words[i + shift] = w & 67108863;\n }\n for (;i < this.length - shift; i++)\n w = (this.words[i + shift] | 0) + carry, carry = w >> 26, this.words[i + shift] = w & 67108863;\n if (carry === 0)\n return this.strip();\n for (assert(carry === -1), carry = 0, i = 0;i < this.length; i++)\n w = -(this.words[i] | 0) + carry, carry = w >> 26, this.words[i] = w & 67108863;\n return this.negative = 1, this.strip();\n }, BN.prototype._wordDiv = function(num, mode) {\n var shift = this.length - num.length, a = this.clone(), b = num, bhi = b.words[b.length - 1] | 0, bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits, shift !== 0 && (b = b.ushln(shift), a.iushln(shift), bhi = b.words[b.length - 1] | 0);\n var m = a.length - b.length, q;\n if (mode !== \"mod\") {\n q = new BN(null), q.length = m + 1, q.words = new Array(q.length);\n for (var i = 0;i < q.length; i++)\n q.words[i] = 0;\n }\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n diff.negative === 0 && (a = diff, q && (q.words[m] = 1));\n for (var j = m - 1;j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);\n for (qj = Math.min(qj / bhi | 0, 67108863), a._ishlnsubmul(b, qj, j);a.negative !== 0; )\n qj--, a.negative = 0, a._ishlnsubmul(b, 1, j), a.isZero() || (a.negative ^= 1);\n q && (q.words[j] = qj);\n }\n return q && q.strip(), a.strip(), mode !== \"div\" && shift !== 0 && a.iushrn(shift), {\n div: q || null,\n mod: a\n };\n }, BN.prototype.divmod = function(num, mode, positive) {\n if (assert(!num.isZero()), this.isZero())\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n var div, mod, res;\n return this.negative !== 0 && num.negative === 0 \? (res = this.neg().divmod(num, mode), mode !== \"mod\" && (div = res.div.neg()), mode !== \"div\" && (mod = res.mod.neg(), positive && mod.negative !== 0 && mod.iadd(num)), {\n div,\n mod\n }) : this.negative === 0 && num.negative !== 0 \? (res = this.divmod(num.neg(), mode), mode !== \"mod\" && (div = res.div.neg()), {\n div,\n mod: res.mod\n }) : (this.negative & num.negative) !== 0 \? (res = this.neg().divmod(num.neg(), mode), mode !== \"div\" && (mod = res.mod.neg(), positive && mod.negative !== 0 && mod.isub(num)), {\n div: res.div,\n mod\n }) : num.length > this.length || this.cmp(num) < 0 \? {\n div: new BN(0),\n mod: this\n } : num.length === 1 \? mode === \"div\" \? {\n div: this.divn(num.words[0]),\n mod: null\n } : mode === \"mod\" \? {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n } : {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n } : this._wordDiv(num, mode);\n }, BN.prototype.div = function(num) {\n return this.divmod(num, \"div\", !1).div;\n }, BN.prototype.mod = function(num) {\n return this.divmod(num, \"mod\", !1).mod;\n }, BN.prototype.umod = function(num) {\n return this.divmod(num, \"mod\", !0).mod;\n }, BN.prototype.divRound = function(num) {\n var dm = this.divmod(num);\n if (dm.mod.isZero())\n return dm.div;\n var mod = dm.div.negative !== 0 \? dm.mod.isub(num) : dm.mod, half = num.ushrn(1), r2 = num.andln(1), cmp = mod.cmp(half);\n return cmp < 0 || r2 === 1 && cmp === 0 \? dm.div : dm.div.negative !== 0 \? dm.div.isubn(1) : dm.div.iaddn(1);\n }, BN.prototype.modn = function(num) {\n assert(num <= 67108863);\n for (var p = (1 << 26) % num, acc = 0, i = this.length - 1;i >= 0; i--)\n acc = (p * acc + (this.words[i] | 0)) % num;\n return acc;\n }, BN.prototype.idivn = function(num) {\n assert(num <= 67108863);\n for (var carry = 0, i = this.length - 1;i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 67108864;\n this.words[i] = w / num | 0, carry = w % num;\n }\n return this.strip();\n }, BN.prototype.divn = function(num) {\n return this.clone().idivn(num);\n }, BN.prototype.egcd = function(p) {\n assert(p.negative === 0), assert(!p.isZero());\n var x = this, y = p.clone();\n x.negative !== 0 \? x = x.umod(p) : x = x.clone();\n for (var A = new BN(1), B = new BN(0), C = new BN(0), D = new BN(1), g = 0;x.isEven() && y.isEven(); )\n x.iushrn(1), y.iushrn(1), ++g;\n for (var yp = y.clone(), xp = x.clone();!x.isZero(); ) {\n for (var i = 0, im = 1;(x.words[0] & im) === 0 && i < 26; ++i, im <<= 1)\n ;\n if (i > 0)\n for (x.iushrn(i);i-- > 0; )\n (A.isOdd() || B.isOdd()) && (A.iadd(yp), B.isub(xp)), A.iushrn(1), B.iushrn(1);\n for (var j = 0, jm = 1;(y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1)\n ;\n if (j > 0)\n for (y.iushrn(j);j-- > 0; )\n (C.isOdd() || D.isOdd()) && (C.iadd(yp), D.isub(xp)), C.iushrn(1), D.iushrn(1);\n x.cmp(y) >= 0 \? (x.isub(y), A.isub(C), B.isub(D)) : (y.isub(x), C.isub(A), D.isub(B));\n }\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n }, BN.prototype._invmp = function(p) {\n assert(p.negative === 0), assert(!p.isZero());\n var a = this, b = p.clone();\n a.negative !== 0 \? a = a.umod(p) : a = a.clone();\n for (var x1 = new BN(1), x2 = new BN(0), delta = b.clone();a.cmpn(1) > 0 && b.cmpn(1) > 0; ) {\n for (var i = 0, im = 1;(a.words[0] & im) === 0 && i < 26; ++i, im <<= 1)\n ;\n if (i > 0)\n for (a.iushrn(i);i-- > 0; )\n x1.isOdd() && x1.iadd(delta), x1.iushrn(1);\n for (var j = 0, jm = 1;(b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1)\n ;\n if (j > 0)\n for (b.iushrn(j);j-- > 0; )\n x2.isOdd() && x2.iadd(delta), x2.iushrn(1);\n a.cmp(b) >= 0 \? (a.isub(b), x1.isub(x2)) : (b.isub(a), x2.isub(x1));\n }\n var res;\n return a.cmpn(1) === 0 \? res = x1 : res = x2, res.cmpn(0) < 0 && res.iadd(p), res;\n }, BN.prototype.gcd = function(num) {\n if (this.isZero())\n return num.abs();\n if (num.isZero())\n return this.abs();\n var a = this.clone(), b = num.clone();\n a.negative = 0, b.negative = 0;\n for (var shift = 0;a.isEven() && b.isEven(); shift++)\n a.iushrn(1), b.iushrn(1);\n do {\n for (;a.isEven(); )\n a.iushrn(1);\n for (;b.isEven(); )\n b.iushrn(1);\n var r = a.cmp(b);\n if (r < 0) {\n var t = a;\n a = b, b = t;\n } else if (r === 0 || b.cmpn(1) === 0)\n break;\n a.isub(b);\n } while (!0);\n return b.iushln(shift);\n }, BN.prototype.invm = function(num) {\n return this.egcd(num).a.umod(num);\n }, BN.prototype.isEven = function() {\n return (this.words[0] & 1) === 0;\n }, BN.prototype.isOdd = function() {\n return (this.words[0] & 1) === 1;\n }, BN.prototype.andln = function(num) {\n return this.words[0] & num;\n }, BN.prototype.bincn = function(bit) {\n assert(typeof bit == \"number\");\n var r = bit % 26, s = (bit - r) / 26, q = 1 << r;\n if (this.length <= s)\n return this._expand(s + 1), this.words[s] |= q, this;\n for (var carry = q, i = s;carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry, carry = w >>> 26, w &= 67108863, this.words[i] = w;\n }\n return carry !== 0 && (this.words[i] = carry, this.length++), this;\n }, BN.prototype.isZero = function() {\n return this.length === 1 && this.words[0] === 0;\n }, BN.prototype.cmpn = function(num) {\n var negative = num < 0;\n if (this.negative !== 0 && !negative)\n return -1;\n if (this.negative === 0 && negative)\n return 1;\n this.strip();\n var res;\n if (this.length > 1)\n res = 1;\n else {\n negative && (num = -num), assert(num <= 67108863, \"Number is too big\");\n var w = this.words[0] | 0;\n res = w === num \? 0 : w < num \? -1 : 1;\n }\n return this.negative !== 0 \? -res | 0 : res;\n }, BN.prototype.cmp = function(num) {\n if (this.negative !== 0 && num.negative === 0)\n return -1;\n if (this.negative === 0 && num.negative !== 0)\n return 1;\n var res = this.ucmp(num);\n return this.negative !== 0 \? -res | 0 : res;\n }, BN.prototype.ucmp = function(num) {\n if (this.length > num.length)\n return 1;\n if (this.length < num.length)\n return -1;\n for (var res = 0, i = this.length - 1;i >= 0; i--) {\n var a = this.words[i] | 0, b = num.words[i] | 0;\n if (a !== b) {\n a < b \? res = -1 : a > b && (res = 1);\n break;\n }\n }\n return res;\n }, BN.prototype.gtn = function(num) {\n return this.cmpn(num) === 1;\n }, BN.prototype.gt = function(num) {\n return this.cmp(num) === 1;\n }, BN.prototype.gten = function(num) {\n return this.cmpn(num) >= 0;\n }, BN.prototype.gte = function(num) {\n return this.cmp(num) >= 0;\n }, BN.prototype.ltn = function(num) {\n return this.cmpn(num) === -1;\n }, BN.prototype.lt = function(num) {\n return this.cmp(num) === -1;\n }, BN.prototype.lten = function(num) {\n return this.cmpn(num) <= 0;\n }, BN.prototype.lte = function(num) {\n return this.cmp(num) <= 0;\n }, BN.prototype.eqn = function(num) {\n return this.cmpn(num) === 0;\n }, BN.prototype.eq = function(num) {\n return this.cmp(num) === 0;\n }, BN.red = function(num) {\n return new Red(num);\n }, BN.prototype.toRed = function(ctx) {\n return assert(!this.red, \"Already a number in reduction context\"), assert(this.negative === 0, \"red works only with positives\"), ctx.convertTo(this)._forceRed(ctx);\n }, BN.prototype.fromRed = function() {\n return assert(this.red, \"fromRed works only with numbers in reduction context\"), this.red.convertFrom(this);\n }, BN.prototype._forceRed = function(ctx) {\n return this.red = ctx, this;\n }, BN.prototype.forceRed = function(ctx) {\n return assert(!this.red, \"Already a number in reduction context\"), this._forceRed(ctx);\n }, BN.prototype.redAdd = function(num) {\n return assert(this.red, \"redAdd works only with red numbers\"), this.red.add(this, num);\n }, BN.prototype.redIAdd = function(num) {\n return assert(this.red, \"redIAdd works only with red numbers\"), this.red.iadd(this, num);\n }, BN.prototype.redSub = function(num) {\n return assert(this.red, \"redSub works only with red numbers\"), this.red.sub(this, num);\n }, BN.prototype.redISub = function(num) {\n return assert(this.red, \"redISub works only with red numbers\"), this.red.isub(this, num);\n }, BN.prototype.redShl = function(num) {\n return assert(this.red, \"redShl works only with red numbers\"), this.red.shl(this, num);\n }, BN.prototype.redMul = function(num) {\n return assert(this.red, \"redMul works only with red numbers\"), this.red._verify2(this, num), this.red.mul(this, num);\n }, BN.prototype.redIMul = function(num) {\n return assert(this.red, \"redMul works only with red numbers\"), this.red._verify2(this, num), this.red.imul(this, num);\n }, BN.prototype.redSqr = function() {\n return assert(this.red, \"redSqr works only with red numbers\"), this.red._verify1(this), this.red.sqr(this);\n }, BN.prototype.redISqr = function() {\n return assert(this.red, \"redISqr works only with red numbers\"), this.red._verify1(this), this.red.isqr(this);\n }, BN.prototype.redSqrt = function() {\n return assert(this.red, \"redSqrt works only with red numbers\"), this.red._verify1(this), this.red.sqrt(this);\n }, BN.prototype.redInvm = function() {\n return assert(this.red, \"redInvm works only with red numbers\"), this.red._verify1(this), this.red.invm(this);\n }, BN.prototype.redNeg = function() {\n return assert(this.red, \"redNeg works only with red numbers\"), this.red._verify1(this), this.red.neg(this);\n }, BN.prototype.redPow = function(num) {\n return assert(this.red && !num.red, \"redPow(normalNum)\"), this.red._verify1(this), this.red.pow(this, num);\n };\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n function MPrime(name, p) {\n this.name = name, this.p = new BN(p, 16), this.n = this.p.bitLength(), this.k = new BN(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();\n }\n MPrime.prototype = {}, MPrime.prototype._tmp = function() {\n var tmp = new BN(null);\n return tmp.words = new Array(Math.ceil(this.n / 13)), tmp;\n }, MPrime.prototype.ireduce = function(num) {\n var r = num, rlen;\n do\n this.split(r, this.tmp), r = this.imulK(r), r = r.iadd(this.tmp), rlen = r.bitLength();\n while (rlen > this.n);\n var cmp = rlen < this.n \? -1 : r.ucmp(this.p);\n return cmp === 0 \? (r.words[0] = 0, r.length = 1) : cmp > 0 \? r.isub(this.p) : r.strip !== void 0 \? r.strip() : r._strip(), r;\n }, MPrime.prototype.split = function(input, out) {\n input.iushrn(this.n, 0, out);\n }, MPrime.prototype.imulK = function(num) {\n return num.imul(this.k);\n };\n function K256() {\n MPrime.call(this, \"k256\", \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\");\n }\n inherits(K256, MPrime), K256.prototype.split = function(input, output) {\n for (var mask = 4194303, outLen = Math.min(input.length, 9), i = 0;i < outLen; i++)\n output.words[i] = input.words[i];\n if (output.length = outLen, input.length <= 9) {\n input.words[0] = 0, input.length = 1;\n return;\n }\n var prev = input.words[9];\n for (output.words[output.length++] = prev & mask, i = 10;i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = (next & mask) << 4 | prev >>> 22, prev = next;\n }\n prev >>>= 22, input.words[i - 10] = prev, prev === 0 && input.length > 10 \? input.length -= 10 : input.length -= 9;\n }, K256.prototype.imulK = function(num) {\n num.words[num.length] = 0, num.words[num.length + 1] = 0, num.length += 2;\n for (var lo = 0, i = 0;i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 977, num.words[i] = lo & 67108863, lo = w * 64 + (lo / 67108864 | 0);\n }\n return num.words[num.length - 1] === 0 && (num.length--, num.words[num.length - 1] === 0 && num.length--), num;\n };\n function P224() {\n MPrime.call(this, \"p224\", \"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\");\n }\n inherits(P224, MPrime);\n function P192() {\n MPrime.call(this, \"p192\", \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\");\n }\n inherits(P192, MPrime);\n function P25519() {\n MPrime.call(this, \"25519\", \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\");\n }\n inherits(P25519, MPrime), P25519.prototype.imulK = function(num) {\n for (var carry = 0, i = 0;i < num.length; i++) {\n var hi = (num.words[i] | 0) * 19 + carry, lo = hi & 67108863;\n hi >>>= 26, num.words[i] = lo, carry = hi;\n }\n return carry !== 0 && (num.words[num.length++] = carry), num;\n }, BN._prime = function(name) {\n if (primes[name])\n return primes[name];\n var prime2;\n if (name === \"k256\")\n prime2 = new K256;\n else if (name === \"p224\")\n prime2 = new P224;\n else if (name === \"p192\")\n prime2 = new P192;\n else if (name === \"p25519\")\n prime2 = new P25519;\n else\n throw new Error(\"Unknown prime \" + name);\n return primes[name] = prime2, prime2;\n };\n function Red(m) {\n if (typeof m == \"string\") {\n var prime = BN._prime(m);\n this.m = prime.p, this.prime = prime;\n } else\n assert(m.gtn(1), \"modulus must be greater than 1\"), this.m = m, this.prime = null;\n }\n Red.prototype = {}, Red.prototype._verify1 = function(a) {\n assert(a.negative === 0, \"red works only with positives\"), assert(a.red, \"red works only with red numbers\");\n }, Red.prototype._verify2 = function(a, b) {\n assert((a.negative | b.negative) === 0, \"red works only with positives\"), assert(a.red && a.red === b.red, \"red works only with red numbers\");\n }, Red.prototype.imod = function(a) {\n return this.prime \? this.prime.ireduce(a)._forceRed(this) : a.umod(this.m)._forceRed(this);\n }, Red.prototype.neg = function(a) {\n return a.isZero() \? a.clone() : this.m.sub(a)._forceRed(this);\n }, Red.prototype.add = function(a, b) {\n this._verify2(a, b);\n var res = a.add(b);\n return res.cmp(this.m) >= 0 && res.isub(this.m), res._forceRed(this);\n }, Red.prototype.iadd = function(a, b) {\n this._verify2(a, b);\n var res = a.iadd(b);\n return res.cmp(this.m) >= 0 && res.isub(this.m), res;\n }, Red.prototype.sub = function(a, b) {\n this._verify2(a, b);\n var res = a.sub(b);\n return res.cmpn(0) < 0 && res.iadd(this.m), res._forceRed(this);\n }, Red.prototype.isub = function(a, b) {\n this._verify2(a, b);\n var res = a.isub(b);\n return res.cmpn(0) < 0 && res.iadd(this.m), res;\n }, Red.prototype.shl = function(a, num) {\n return this._verify1(a), this.imod(a.ushln(num));\n }, Red.prototype.imul = function(a, b) {\n return this._verify2(a, b), this.imod(a.imul(b));\n }, Red.prototype.mul = function(a, b) {\n return this._verify2(a, b), this.imod(a.mul(b));\n }, Red.prototype.isqr = function(a) {\n return this.imul(a, a.clone());\n }, Red.prototype.sqr = function(a) {\n return this.mul(a, a);\n }, Red.prototype.sqrt = function(a) {\n if (a.isZero())\n return a.clone();\n var mod3 = this.m.andln(3);\n if (assert(mod3 % 2 === 1), mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n for (var q = this.m.subn(1), s = 0;!q.isZero() && q.andln(1) === 0; )\n s++, q.iushrn(1);\n assert(!q.isZero());\n var one = new BN(1).toRed(this), nOne = one.redNeg(), lpow = this.m.subn(1).iushrn(1), z = this.m.bitLength();\n for (z = new BN(2 * z * z).toRed(this);this.pow(z, lpow).cmp(nOne) !== 0; )\n z.redIAdd(nOne);\n for (var c = this.pow(z, q), r = this.pow(a, q.addn(1).iushrn(1)), t = this.pow(a, q), m = s;t.cmp(one) !== 0; ) {\n for (var tmp = t, i = 0;tmp.cmp(one) !== 0; i++)\n tmp = tmp.redSqr();\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n r = r.redMul(b), c = b.redSqr(), t = t.redMul(c), m = i;\n }\n return r;\n }, Red.prototype.invm = function(a) {\n var inv = a._invmp(this.m);\n return inv.negative !== 0 \? (inv.negative = 0, this.imod(inv).redNeg()) : this.imod(inv);\n }, Red.prototype.pow = function(a, num) {\n if (num.isZero())\n return new BN(1).toRed(this);\n if (num.cmpn(1) === 0)\n return a.clone();\n var windowSize = 4, wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this), wnd[1] = a;\n for (var i = 2;i < wnd.length; i++)\n wnd[i] = this.mul(wnd[i - 1], a);\n var res = wnd[0], current = 0, currentLen = 0, start = num.bitLength() % 26;\n for (start === 0 && (start = 26), i = num.length - 1;i >= 0; i--) {\n for (var word = num.words[i], j = start - 1;j >= 0; j--) {\n var bit = word >> j & 1;\n if (res !== wnd[0] && (res = this.sqr(res)), bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n current <<= 1, current |= bit, currentLen++, !(currentLen !== windowSize && (i !== 0 || j !== 0)) && (res = this.mul(res, wnd[current]), currentLen = 0, current = 0);\n }\n start = 26;\n }\n return res;\n }, Red.prototype.convertTo = function(num) {\n var r = num.umod(this.m);\n return r === num \? r.clone() : r;\n }, Red.prototype.convertFrom = function(num) {\n var res = num.clone();\n return res.red = null, res;\n }, BN.mont = function(num) {\n return new Mont(num);\n };\n function Mont(m) {\n Red.call(this, m), this.shift = this.m.bitLength(), this.shift % 26 !== 0 && (this.shift += 26 - this.shift % 26), this.r = new BN(1).iushln(this.shift), this.r2 = this.imod(this.r.sqr()), this.rinv = this.r._invmp(this.m), this.minv = this.rinv.mul(this.r).isubn(1).div(this.m), this.minv = this.minv.umod(this.r), this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red), Mont.prototype.convertTo = function(num) {\n return this.imod(num.ushln(this.shift));\n }, Mont.prototype.convertFrom = function(num) {\n var r = this.imod(num.mul(this.rinv));\n return r.red = null, r;\n }, Mont.prototype.imul = function(a, b) {\n if (a.isZero() || b.isZero())\n return a.words[0] = 0, a.length = 1, a;\n var t = a.imul(b), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u = t.isub(c).iushrn(this.shift), res = u;\n return u.cmp(this.m) >= 0 \? res = u.isub(this.m) : u.cmpn(0) < 0 && (res = u.iadd(this.m)), res._forceRed(this);\n }, Mont.prototype.mul = function(a, b) {\n if (a.isZero() || b.isZero())\n return new BN(0)._forceRed(this);\n var t = a.mul(b), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u = t.isub(c).iushrn(this.shift), res = u;\n return u.cmp(this.m) >= 0 \? res = u.isub(this.m) : u.cmpn(0) < 0 && (res = u.iadd(this.m)), res._forceRed(this);\n }, Mont.prototype.invm = function(a) {\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n })(typeof module > \"u\" || module, exports);\n }\n}), require_bn2 = require_bn, require_brorand = __commonJS({\n \"node_modules/brorand/index.js\"(exports, module) {\n var r;\n module.exports = function(len) {\n return r || (r = new Rand(null)), r.generate(len);\n };\n function Rand(rand) {\n this.rand = rand;\n }\n Rand.prototype = {}, module.exports.Rand = Rand, Rand.prototype.generate = function(len) {\n return this._rand(len);\n }, Rand.prototype._rand = function(n) {\n var out = new Buffer(n);\n return crypto.getRandomValues(out), out;\n };\n }\n}), require_mr = __commonJS({\n \"node_modules/miller-rabin/lib/mr.js\"(exports, module) {\n var bn = require_bn2(), brorand = require_brorand();\n function MillerRabin(rand) {\n this.rand = rand || new brorand.Rand;\n }\n module.exports = MillerRabin, MillerRabin.create = function(rand) {\n return new MillerRabin(rand);\n }, MillerRabin.prototype = {}, MillerRabin.prototype._randbelow = function(n) {\n var len = n.bitLength(), min_bytes = Math.ceil(len / 8);\n do\n var a = new bn(this.rand.generate(min_bytes));\n while (a.cmp(n) >= 0);\n return a;\n }, MillerRabin.prototype._randrange = function(start, stop) {\n var size = stop.sub(start);\n return start.add(this._randbelow(size));\n }, MillerRabin.prototype.test = function(n, k, cb) {\n var len = n.bitLength(), red = bn.mont(n), rone = new bn(1).toRed(red);\n k || (k = Math.max(1, len / 48 | 0));\n for (var n1 = n.subn(1), s = 0;!n1.testn(s); s++)\n ;\n for (var d = n.shrn(s), rn1 = n1.toRed(red), prime = !0;k > 0; k--) {\n var a = this._randrange(new bn(2), n1);\n cb && cb(a);\n var x = a.toRed(red).redPow(d);\n if (!(x.cmp(rone) === 0 || x.cmp(rn1) === 0)) {\n for (var i = 1;i < s; i++) {\n if (x = x.redSqr(), x.cmp(rone) === 0)\n return !1;\n if (x.cmp(rn1) === 0)\n break;\n }\n if (i === s)\n return !1;\n }\n }\n return prime;\n }, MillerRabin.prototype.getDivisor = function(n, k) {\n var len = n.bitLength(), red = bn.mont(n), rone = new bn(1).toRed(red);\n k || (k = Math.max(1, len / 48 | 0));\n for (var n1 = n.subn(1), s = 0;!n1.testn(s); s++)\n ;\n for (var d = n.shrn(s), rn1 = n1.toRed(red);k > 0; k--) {\n var a = this._randrange(new bn(2), n1), g = n.gcd(a);\n if (g.cmpn(1) !== 0)\n return g;\n var x = a.toRed(red).redPow(d);\n if (!(x.cmp(rone) === 0 || x.cmp(rn1) === 0)) {\n for (var i = 1;i < s; i++) {\n if (x = x.redSqr(), x.cmp(rone) === 0)\n return x.fromRed().subn(1).gcd(n);\n if (x.cmp(rn1) === 0)\n break;\n }\n if (i === s)\n return x = x.redSqr(), x.fromRed().subn(1).gcd(n);\n }\n }\n return !1;\n };\n }\n}), require_generatePrime = __commonJS({\n \"node_modules/diffie-hellman/lib/generatePrime.js\"(exports, module) {\n var randomBytes = require_browser();\n module.exports = findPrime, findPrime.simpleSieve = simpleSieve, findPrime.fermatTest = fermatTest;\n var BN = require_bn(), TWENTYFOUR = new BN(24), MillerRabin = require_mr(), millerRabin = new MillerRabin, ONE = new BN(1), TWO = new BN(2), FIVE = new BN(5), SIXTEEN = new BN(16), EIGHT = new BN(8), TEN = new BN(10), THREE = new BN(3), SEVEN = new BN(7), ELEVEN = new BN(11), FOUR = new BN(4), TWELVE = new BN(12), primes = null;\n function _getPrimes() {\n if (primes !== null)\n return primes;\n var limit = 1048576, res = [];\n res[0] = 2;\n for (var i = 1, k = 3;k < limit; k += 2) {\n for (var sqrt = Math.ceil(Math.sqrt(k)), j = 0;j < i && res[j] <= sqrt && k % res[j] !== 0; j++)\n ;\n i !== j && res[j] <= sqrt || (res[i++] = k);\n }\n return primes = res, res;\n }\n function simpleSieve(p) {\n for (var primes2 = _getPrimes(), i = 0;i < primes2.length; i++)\n if (p.modn(primes2[i]) === 0)\n return p.cmpn(primes2[i]) === 0;\n return !0;\n }\n function fermatTest(p) {\n var red = BN.mont(p);\n return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;\n }\n function findPrime(bits, gen) {\n if (bits < 16)\n return gen === 2 || gen === 5 \? new BN([140, 123]) : new BN([140, 39]);\n gen = new BN(gen);\n for (var num, n2;; ) {\n for (num = new BN(randomBytes(Math.ceil(bits / 8)));num.bitLength() > bits; )\n num.ishrn(1);\n if (num.isEven() && num.iadd(ONE), num.testn(1) || num.iadd(TWO), gen.cmp(TWO)) {\n if (!gen.cmp(FIVE))\n for (;num.mod(TEN).cmp(THREE); )\n num.iadd(FOUR);\n } else\n for (;num.mod(TWENTYFOUR).cmp(ELEVEN); )\n num.iadd(FOUR);\n if (n2 = num.shrn(1), simpleSieve(n2) && simpleSieve(num) && fermatTest(n2) && fermatTest(num) && millerRabin.test(n2) && millerRabin.test(num))\n return num;\n }\n }\n }\n}), require_primes = __commonJS({\n \"node_modules/diffie-hellman/lib/primes.json\"(exports, module) {\n module.exports = {\n modp1: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff\"\n },\n modp2: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff\"\n },\n modp5: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff\"\n },\n modp14: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff\"\n },\n modp15: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff\"\n },\n modp16: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff\"\n },\n modp17: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff\"\n },\n modp18: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff\"\n }\n };\n }\n}), require_dh = __commonJS({\n \"node_modules/diffie-hellman/lib/dh.js\"(exports, module) {\n var BN = require_bn(), MillerRabin = require_mr(), millerRabin = new MillerRabin, TWENTYFOUR = new BN(24), ELEVEN = new BN(11), TEN = new BN(10), THREE = new BN(3), SEVEN = new BN(7), primes = require_generatePrime(), randomBytes = require_browser();\n module.exports = DH;\n function setPublicKey(pub, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(pub) || (pub = new Buffer(pub, enc)), this._pub = new BN(pub), this;\n }\n function setPrivateKey(priv, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(priv) || (priv = new Buffer(priv, enc)), this._priv = new BN(priv), this;\n }\n var primeCache = {};\n function checkPrime(prime, generator) {\n var gen = generator.toString(\"hex\"), hex = [gen, prime.toString(16)].join(\"_\");\n if (hex in primeCache)\n return primeCache[hex];\n var error = 0;\n if (prime.isEven() || !primes.simpleSieve || !primes.fermatTest(prime) || !millerRabin.test(prime))\n return error += 1, gen === \"02\" || gen === \"05\" \? error += 8 : error += 4, primeCache[hex] = error, error;\n millerRabin.test(prime.shrn(1)) || (error += 2);\n var rem;\n switch (gen) {\n case \"02\":\n prime.mod(TWENTYFOUR).cmp(ELEVEN) && (error += 8);\n break;\n case \"05\":\n rem = prime.mod(TEN), rem.cmp(THREE) && rem.cmp(SEVEN) && (error += 8);\n break;\n default:\n error += 4;\n }\n return primeCache[hex] = error, error;\n }\n function DH(prime, generator, malleable) {\n this.setGenerator(generator), this.__prime = new BN(prime), this._prime = BN.mont(this.__prime), this._primeLen = prime.length, this._pub = void 0, this._priv = void 0, this._primeCode = void 0, malleable \? (this.setPublicKey = setPublicKey, this.setPrivateKey = setPrivateKey) : this._primeCode = 8;\n }\n DH.prototype = {}, Object.defineProperty(DH.prototype, \"verifyError\", {\n enumerable: !0,\n get: function() {\n return typeof this._primeCode != \"number\" && (this._primeCode = checkPrime(this.__prime, this.__gen)), this._primeCode;\n }\n }), DH.prototype.generateKeys = function() {\n return this._priv || (this._priv = new BN(randomBytes(this._primeLen))), this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(), this.getPublicKey();\n }, DH.prototype.computeSecret = function(other) {\n other = new BN(other), other = other.toRed(this._prime);\n var secret = other.redPow(this._priv).fromRed(), out = new Buffer(secret.toArray()), prime = this.getPrime();\n if (out.length < prime.length) {\n var front = new Buffer(prime.length - out.length);\n front.fill(0), out = Buffer.concat([front, out]);\n }\n return out;\n }, DH.prototype.getPublicKey = function(enc) {\n return formatReturnValue(this._pub, enc);\n }, DH.prototype.getPrivateKey = function(enc) {\n return formatReturnValue(this._priv, enc);\n }, DH.prototype.getPrime = function(enc) {\n return formatReturnValue(this.__prime, enc);\n }, DH.prototype.getGenerator = function(enc) {\n return formatReturnValue(this._gen, enc);\n }, DH.prototype.setGenerator = function(gen, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(gen) || (gen = new Buffer(gen, enc)), this.__gen = gen, this._gen = new BN(gen), this;\n };\n function formatReturnValue(bn, enc) {\n var buf = new Buffer(bn.toArray());\n return enc \? buf.toString(enc) : buf;\n }\n }\n}), require_browser7 = __commonJS({\n \"node_modules/diffie-hellman/browser.js\"(exports) {\n var generatePrime = require_generatePrime(), primes = require_primes(), DH = require_dh();\n function getDiffieHellman(mod) {\n var prime = new Buffer(primes[mod].prime, \"hex\"), gen = new Buffer(primes[mod].gen, \"hex\");\n return new DH(prime, gen);\n }\n var ENCODINGS = {\n binary: !0,\n hex: !0,\n base64: !0\n };\n function createDiffieHellman(prime, enc, generator, genc) {\n return Buffer.isBuffer(enc) || ENCODINGS[enc] === void 0 \? createDiffieHellman(prime, \"binary\", enc, generator) : (enc = enc || \"binary\", genc = genc || \"binary\", generator = generator || new Buffer([2]), Buffer.isBuffer(generator) || (generator = new Buffer(generator, genc)), typeof prime == \"number\" \? new DH(generatePrime(prime, generator), generator, !0) : (Buffer.isBuffer(prime) || (prime = new Buffer(prime, enc)), new DH(prime, generator, !0)));\n }\n exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman, exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman;\n }\n}), require_bn3 = require_bn, require_browserify_rsa = __commonJS({\n \"node_modules/browserify-rsa/index.js\"(exports, module) {\n var BN = require_bn3(), randomBytes = require_browser();\n function blind(priv) {\n var r = getr(priv), blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed();\n return { blinder, unblinder: r.invm(priv.modulus) };\n }\n function getr(priv) {\n var len = priv.modulus.byteLength(), r;\n do\n r = new BN(randomBytes(len));\n while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2));\n return r;\n }\n function crt(msg, priv) {\n var blinds = blind(priv), len = priv.modulus.byteLength(), blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus), c1 = blinded.toRed(BN.mont(priv.prime1)), c2 = blinded.toRed(BN.mont(priv.prime2)), qinv = priv.coefficient, p = priv.prime1, q = priv.prime2, m1 = c1.redPow(priv.exponent1).fromRed(), m2 = c2.redPow(priv.exponent2).fromRed(), h = m1.isub(m2).imul(qinv).umod(p).imul(q);\n return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, \"be\", len);\n }\n crt.getr = getr, module.exports = crt;\n }\n}), require_package = __commonJS({\n \"node_modules/elliptic/package.json\"(exports, module) {\n module.exports = {\n name: \"elliptic\",\n version: \"6.5.4\",\n description: \"EC cryptography\",\n main: \"lib/elliptic.js\",\n files: [\"lib\"],\n scripts: {\n lint: \"eslint lib test\",\n \"lint:fix\": \"npm run lint -- --fix\",\n unit: \"istanbul test _mocha --reporter=spec test/index.js\",\n test: \"npm run lint && npm run unit\",\n version: \"grunt dist && git add dist/\"\n },\n repository: {\n type: \"git\",\n url: \"git@github.com:indutny/elliptic\"\n },\n keywords: [\"EC\", \"Elliptic\", \"curve\", \"Cryptography\"],\n author: \"Fedor Indutny <fedor@indutny.com>\",\n license: \"MIT\",\n bugs: {\n url: \"https://github.com/indutny/elliptic/issues\"\n },\n homepage: \"https://github.com/indutny/elliptic\",\n devDependencies: {\n brfs: \"^2.0.2\",\n coveralls: \"^3.1.0\",\n eslint: \"^7.6.0\",\n grunt: \"^1.2.1\",\n \"grunt-browserify\": \"^5.3.0\",\n \"grunt-cli\": \"^1.3.2\",\n \"grunt-contrib-connect\": \"^3.0.0\",\n \"grunt-contrib-copy\": \"^1.0.0\",\n \"grunt-contrib-uglify\": \"^5.0.0\",\n \"grunt-mocha-istanbul\": \"^5.0.2\",\n \"grunt-saucelabs\": \"^9.0.1\",\n istanbul: \"^0.4.5\",\n mocha: \"^8.0.1\"\n },\n dependencies: {\n \"bn.js\": \"^4.11.9\",\n brorand: \"^1.1.0\",\n \"hash.js\": \"^1.0.0\",\n \"hmac-drbg\": \"^1.0.1\",\n inherits: \"^2.0.4\",\n \"minimalistic-assert\": \"^1.0.1\",\n \"minimalistic-crypto-utils\": \"^1.0.1\"\n }\n };\n }\n}), require_bn4 = require_bn, require_utils2 = __commonJS({\n \"node_modules/minimalistic-crypto-utils/lib/utils.js\"(exports) {\n var utils = exports;\n function toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg != \"string\") {\n for (var i = 0;i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n if (enc === \"hex\") {\n msg = msg.replace(/[^a-z0-9]+/gi, \"\"), msg.length % 2 !== 0 && (msg = \"0\" + msg);\n for (var i = 0;i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else\n for (var i = 0;i < msg.length; i++) {\n var c = msg.charCodeAt(i), hi = c >> 8, lo = c & 255;\n hi \? res.push(hi, lo) : res.push(lo);\n }\n return res;\n }\n utils.toArray = toArray;\n function zero2(word) {\n return word.length === 1 \? \"0\" + word : word;\n }\n utils.zero2 = zero2;\n function toHex(msg) {\n for (var res = \"\", i = 0;i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n }\n utils.toHex = toHex, utils.encode = function(arr, enc) {\n return enc === \"hex\" \? toHex(arr) : arr;\n };\n }\n}), require_utils3 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/utils.js\"(exports) {\n var utils = exports, BN = require_bn4(), minAssert = require_minimalistic_assert(), minUtils = require_utils2();\n utils.assert = minAssert, utils.toArray = minUtils.toArray, utils.zero2 = minUtils.zero2, utils.toHex = minUtils.toHex, utils.encode = minUtils.encode;\n function getNAF(num, w, bits) {\n var naf = new Array(Math.max(num.bitLength(), bits) + 1);\n naf.fill(0);\n for (var ws = 1 << w + 1, k = num.clone(), i = 0;i < naf.length; i++) {\n var z, mod = k.andln(ws - 1);\n k.isOdd() \? (mod > (ws >> 1) - 1 \? z = (ws >> 1) - mod : z = mod, k.isubn(z)) : z = 0, naf[i] = z, k.iushrn(1);\n }\n return naf;\n }\n utils.getNAF = getNAF;\n function getJSF(k1, k2) {\n var jsf = [[], []];\n k1 = k1.clone(), k2 = k2.clone();\n for (var d1 = 0, d2 = 0, m8;k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0; ) {\n var m14 = k1.andln(3) + d1 & 3, m24 = k2.andln(3) + d2 & 3;\n m14 === 3 && (m14 = -1), m24 === 3 && (m24 = -1);\n var u1;\n (m14 & 1) === 0 \? u1 = 0 : (m8 = k1.andln(7) + d1 & 7, (m8 === 3 || m8 === 5) && m24 === 2 \? u1 = -m14 : u1 = m14), jsf[0].push(u1);\n var u2;\n (m24 & 1) === 0 \? u2 = 0 : (m8 = k2.andln(7) + d2 & 7, (m8 === 3 || m8 === 5) && m14 === 2 \? u2 = -m24 : u2 = m24), jsf[1].push(u2), 2 * d1 === u1 + 1 && (d1 = 1 - d1), 2 * d2 === u2 + 1 && (d2 = 1 - d2), k1.iushrn(1), k2.iushrn(1);\n }\n return jsf;\n }\n utils.getJSF = getJSF;\n function cachedProperty(obj, name, computer) {\n var key = \"_\" + name;\n obj.prototype[name] = function() {\n return this[key] !== void 0 \? this[key] : this[key] = computer.call(this);\n };\n }\n utils.cachedProperty = cachedProperty;\n function parseBytes(bytes) {\n return typeof bytes == \"string\" \? utils.toArray(bytes, \"hex\") : bytes;\n }\n utils.parseBytes = parseBytes;\n function intFromLE(bytes) {\n return new BN(bytes, \"hex\", \"le\");\n }\n utils.intFromLE = intFromLE;\n }\n}), require_base = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/base.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), getNAF = utils.getNAF, getJSF = utils.getJSF, assert = utils.assert;\n function BaseCurve(type, conf) {\n this.type = type, this.p = new BN(conf.p, 16), this.red = conf.prime \? BN.red(conf.prime) : BN.mont(this.p), this.zero = new BN(0).toRed(this.red), this.one = new BN(1).toRed(this.red), this.two = new BN(2).toRed(this.red), this.n = conf.n && new BN(conf.n, 16), this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed), this._wnafT1 = new Array(4), this._wnafT2 = new Array(4), this._wnafT3 = new Array(4), this._wnafT4 = new Array(4), this._bitLength = this.n \? this.n.bitLength() : 0;\n var adjustCount = this.n && this.p.div(this.n);\n !adjustCount || adjustCount.cmpn(100) > 0 \? this.redN = null : (this._maxwellTrick = !0, this.redN = this.n.toRed(this.red));\n }\n module.exports = BaseCurve, BaseCurve.prototype = {}, BaseCurve.prototype.point = function() {\n throw new Error(\"Not implemented\");\n }, BaseCurve.prototype.validate = function() {\n throw new Error(\"Not implemented\");\n }, BaseCurve.prototype._fixedNafMul = function(p, k) {\n assert(p.precomputed);\n var doubles = p._getDoubles(), naf = getNAF(k, 1, this._bitLength), I = (1 << doubles.step + 1) - (doubles.step % 2 === 0 \? 2 : 1);\n I /= 3;\n var repr = [], j, nafW;\n for (j = 0;j < naf.length; j += doubles.step) {\n nafW = 0;\n for (var l = j + doubles.step - 1;l >= j; l--)\n nafW = (nafW << 1) + naf[l];\n repr.push(nafW);\n }\n for (var a = this.jpoint(null, null, null), b = this.jpoint(null, null, null), i = I;i > 0; i--) {\n for (j = 0;j < repr.length; j++)\n nafW = repr[j], nafW === i \? b = b.mixedAdd(doubles.points[j]) : nafW === -i && (b = b.mixedAdd(doubles.points[j].neg()));\n a = a.add(b);\n }\n return a.toP();\n }, BaseCurve.prototype._wnafMul = function(p, k) {\n var w = 4, nafPoints = p._getNAFPoints(w);\n w = nafPoints.wnd;\n for (var wnd = nafPoints.points, naf = getNAF(k, w, this._bitLength), acc = this.jpoint(null, null, null), i = naf.length - 1;i >= 0; i--) {\n for (var l = 0;i >= 0 && naf[i] === 0; i--)\n l++;\n if (i >= 0 && l++, acc = acc.dblp(l), i < 0)\n break;\n var z = naf[i];\n assert(z !== 0), p.type === \"affine\" \? z > 0 \? acc = acc.mixedAdd(wnd[z - 1 >> 1]) : acc = acc.mixedAdd(wnd[-z - 1 >> 1].neg()) : z > 0 \? acc = acc.add(wnd[z - 1 >> 1]) : acc = acc.add(wnd[-z - 1 >> 1].neg());\n }\n return p.type === \"affine\" \? acc.toP() : acc;\n }, BaseCurve.prototype._wnafMulAdd = function(defW, points, coeffs, len, jacobianResult) {\n var wndWidth = this._wnafT1, wnd = this._wnafT2, naf = this._wnafT3, max = 0, i, j, p;\n for (i = 0;i < len; i++) {\n p = points[i];\n var nafPoints = p._getNAFPoints(defW);\n wndWidth[i] = nafPoints.wnd, wnd[i] = nafPoints.points;\n }\n for (i = len - 1;i >= 1; i -= 2) {\n var a = i - 1, b = i;\n if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength), naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength), max = Math.max(naf[a].length, max), max = Math.max(naf[b].length, max);\n continue;\n }\n var comb = [points[a], null, null, points[b]];\n points[a].y.cmp(points[b].y) === 0 \? (comb[1] = points[a].add(points[b]), comb[2] = points[a].toJ().mixedAdd(points[b].neg())) : points[a].y.cmp(points[b].y.redNeg()) === 0 \? (comb[1] = points[a].toJ().mixedAdd(points[b]), comb[2] = points[a].add(points[b].neg())) : (comb[1] = points[a].toJ().mixedAdd(points[b]), comb[2] = points[a].toJ().mixedAdd(points[b].neg()));\n var index = [-3, -1, -5, -7, 0, 7, 5, 1, 3], jsf = getJSF(coeffs[a], coeffs[b]);\n for (max = Math.max(jsf[0].length, max), naf[a] = new Array(max), naf[b] = new Array(max), j = 0;j < max; j++) {\n var ja = jsf[0][j] | 0, jb = jsf[1][j] | 0;\n naf[a][j] = index[(ja + 1) * 3 + (jb + 1)], naf[b][j] = 0, wnd[a] = comb;\n }\n }\n var acc = this.jpoint(null, null, null), tmp = this._wnafT4;\n for (i = max;i >= 0; i--) {\n for (var k = 0;i >= 0; ) {\n var zero = !0;\n for (j = 0;j < len; j++)\n tmp[j] = naf[j][i] | 0, tmp[j] !== 0 && (zero = !1);\n if (!zero)\n break;\n k++, i--;\n }\n if (i >= 0 && k++, acc = acc.dblp(k), i < 0)\n break;\n for (j = 0;j < len; j++) {\n var z = tmp[j];\n z !== 0 && (z > 0 \? p = wnd[j][z - 1 >> 1] : z < 0 && (p = wnd[j][-z - 1 >> 1].neg()), p.type === \"affine\" \? acc = acc.mixedAdd(p) : acc = acc.add(p));\n }\n }\n for (i = 0;i < len; i++)\n wnd[i] = null;\n return jacobianResult \? acc : acc.toP();\n };\n function BasePoint(curve, type) {\n this.curve = curve, this.type = type, this.precomputed = null;\n }\n BasePoint.prototype = {}, BaseCurve.BasePoint = BasePoint, BasePoint.prototype.eq = function() {\n throw new Error(\"Not implemented\");\n }, BasePoint.prototype.validate = function() {\n return this.curve.validate(this);\n }, BaseCurve.prototype.decodePoint = function(bytes, enc) {\n bytes = utils.toArray(bytes, enc);\n var len = this.p.byteLength();\n if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) {\n bytes[0] === 6 \? assert(bytes[bytes.length - 1] % 2 === 0) : bytes[0] === 7 && assert(bytes[bytes.length - 1] % 2 === 1);\n var res = this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len));\n return res;\n } else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len)\n return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3);\n throw new Error(\"Unknown point format\");\n }, BasePoint.prototype.encodeCompressed = function(enc) {\n return this.encode(enc, !0);\n }, BasePoint.prototype._encode = function(compact) {\n var len = this.curve.p.byteLength(), x = this.getX().toArray(\"be\", len);\n return compact \? [this.getY().isEven() \? 2 : 3].concat(x) : [4].concat(x, this.getY().toArray(\"be\", len));\n }, BasePoint.prototype.encode = function(enc, compact) {\n return utils.encode(this._encode(compact), enc);\n }, BasePoint.prototype.precompute = function(power) {\n if (this.precomputed)\n return this;\n var precomputed = {\n doubles: null,\n naf: null,\n beta: null\n };\n return precomputed.naf = this._getNAFPoints(8), precomputed.doubles = this._getDoubles(4, power), precomputed.beta = this._getBeta(), this.precomputed = precomputed, this;\n }, BasePoint.prototype._hasDoubles = function(k) {\n if (!this.precomputed)\n return !1;\n var doubles = this.precomputed.doubles;\n return doubles \? doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step) : !1;\n }, BasePoint.prototype._getDoubles = function(step, power) {\n if (this.precomputed && this.precomputed.doubles)\n return this.precomputed.doubles;\n for (var doubles = [this], acc = this, i = 0;i < power; i += step) {\n for (var j = 0;j < step; j++)\n acc = acc.dbl();\n doubles.push(acc);\n }\n return {\n step,\n points: doubles\n };\n }, BasePoint.prototype._getNAFPoints = function(wnd) {\n if (this.precomputed && this.precomputed.naf)\n return this.precomputed.naf;\n for (var res = [this], max = (1 << wnd) - 1, dbl = max === 1 \? null : this.dbl(), i = 1;i < max; i++)\n res[i] = res[i - 1].add(dbl);\n return {\n wnd,\n points: res\n };\n }, BasePoint.prototype._getBeta = function() {\n return null;\n }, BasePoint.prototype.dblp = function(k) {\n for (var r = this, i = 0;i < k; i++)\n r = r.dbl();\n return r;\n };\n }\n}), require_short = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/short.js\"(exports, module) {\n var utils = require_utils3(), BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), assert = utils.assert;\n function ShortCurve(conf) {\n Base.call(this, \"short\", conf), this.a = new BN(conf.a, 16).toRed(this.red), this.b = new BN(conf.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = this.a.fromRed().cmpn(0) === 0, this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0, this.endo = this._getEndomorphism(conf), this._endoWnafT1 = new Array(4), this._endoWnafT2 = new Array(4);\n }\n inherits(ShortCurve, Base), module.exports = ShortCurve, ShortCurve.prototype._getEndomorphism = function(conf) {\n if (!(!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)) {\n var beta, lambda;\n if (conf.beta)\n beta = new BN(conf.beta, 16).toRed(this.red);\n else {\n var betas = this._getEndoRoots(this.p);\n beta = betas[0].cmp(betas[1]) < 0 \? betas[0] : betas[1], beta = beta.toRed(this.red);\n }\n if (conf.lambda)\n lambda = new BN(conf.lambda, 16);\n else {\n var lambdas = this._getEndoRoots(this.n);\n this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0 \? lambda = lambdas[0] : (lambda = lambdas[1], assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0));\n }\n var basis;\n return conf.basis \? basis = conf.basis.map(function(vec) {\n return {\n a: new BN(vec.a, 16),\n b: new BN(vec.b, 16)\n };\n }) : basis = this._getEndoBasis(lambda), {\n beta,\n lambda,\n basis\n };\n }\n }, ShortCurve.prototype._getEndoRoots = function(num) {\n var red = num === this.p \? this.red : BN.mont(num), tinv = new BN(2).toRed(red).redInvm(), ntinv = tinv.redNeg(), s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv), l1 = ntinv.redAdd(s).fromRed(), l2 = ntinv.redSub(s).fromRed();\n return [l1, l2];\n }, ShortCurve.prototype._getEndoBasis = function(lambda) {\n for (var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), u = lambda, v = this.n.clone(), x1 = new BN(1), y1 = new BN(0), x2 = new BN(0), y2 = new BN(1), a0, b0, a1, b1, a2, b2, prevR, i = 0, r, x;u.cmpn(0) !== 0; ) {\n var q = v.div(u);\n r = v.sub(q.mul(u)), x = x2.sub(q.mul(x1));\n var y = y2.sub(q.mul(y1));\n if (!a1 && r.cmp(aprxSqrt) < 0)\n a0 = prevR.neg(), b0 = x1, a1 = r.neg(), b1 = x;\n else if (a1 && ++i === 2)\n break;\n prevR = r, v = u, u = r, x2 = x1, x1 = x, y2 = y1, y1 = y;\n }\n a2 = r.neg(), b2 = x;\n var len1 = a1.sqr().add(b1.sqr()), len2 = a2.sqr().add(b2.sqr());\n return len2.cmp(len1) >= 0 && (a2 = a0, b2 = b0), a1.negative && (a1 = a1.neg(), b1 = b1.neg()), a2.negative && (a2 = a2.neg(), b2 = b2.neg()), [\n { a: a1, b: b1 },\n { a: a2, b: b2 }\n ];\n }, ShortCurve.prototype._endoSplit = function(k) {\n var basis = this.endo.basis, v1 = basis[0], v2 = basis[1], c1 = v2.b.mul(k).divRound(this.n), c2 = v1.b.neg().mul(k).divRound(this.n), p1 = c1.mul(v1.a), p2 = c2.mul(v2.a), q1 = c1.mul(v1.b), q2 = c2.mul(v2.b), k1 = k.sub(p1).sub(p2), k2 = q1.add(q2).neg();\n return { k1, k2 };\n }, ShortCurve.prototype.pointFromX = function(x, odd) {\n x = new BN(x, 16), x.red || (x = x.toRed(this.red));\n var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b), y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n var isOdd = y.fromRed().isOdd();\n return (odd && !isOdd || !odd && isOdd) && (y = y.redNeg()), this.point(x, y);\n }, ShortCurve.prototype.validate = function(point) {\n if (point.inf)\n return !0;\n var { x, y } = point, ax = this.a.redMul(x), rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n return y.redSqr().redISub(rhs).cmpn(0) === 0;\n }, ShortCurve.prototype._endoWnafMulAdd = function(points, coeffs, jacobianResult) {\n for (var npoints = this._endoWnafT1, ncoeffs = this._endoWnafT2, i = 0;i < points.length; i++) {\n var split = this._endoSplit(coeffs[i]), p = points[i], beta = p._getBeta();\n split.k1.negative && (split.k1.ineg(), p = p.neg(!0)), split.k2.negative && (split.k2.ineg(), beta = beta.neg(!0)), npoints[i * 2] = p, npoints[i * 2 + 1] = beta, ncoeffs[i * 2] = split.k1, ncoeffs[i * 2 + 1] = split.k2;\n }\n for (var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult), j = 0;j < i * 2; j++)\n npoints[j] = null, ncoeffs[j] = null;\n return res;\n };\n function Point(curve, x, y, isRed) {\n Base.BasePoint.call(this, curve, \"affine\"), x === null && y === null \? (this.x = null, this.y = null, this.inf = !0) : (this.x = new BN(x, 16), this.y = new BN(y, 16), isRed && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = !1);\n }\n inherits(Point, Base.BasePoint), ShortCurve.prototype.point = function(x, y, isRed) {\n return new Point(this, x, y, isRed);\n }, ShortCurve.prototype.pointFromJSON = function(obj, red) {\n return Point.fromJSON(this, obj, red);\n }, Point.prototype._getBeta = function() {\n if (this.curve.endo) {\n var pre = this.precomputed;\n if (pre && pre.beta)\n return pre.beta;\n var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n if (pre) {\n var curve = this.curve, endoMul = function(p) {\n return curve.point(p.x.redMul(curve.endo.beta), p.y);\n };\n pre.beta = beta, beta.precomputed = {\n beta: null,\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(endoMul)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(endoMul)\n }\n };\n }\n return beta;\n }\n }, Point.prototype.toJSON = function() {\n return this.precomputed \? [\n this.x,\n this.y,\n this.precomputed && {\n doubles: this.precomputed.doubles && {\n step: this.precomputed.doubles.step,\n points: this.precomputed.doubles.points.slice(1)\n },\n naf: this.precomputed.naf && {\n wnd: this.precomputed.naf.wnd,\n points: this.precomputed.naf.points.slice(1)\n }\n }\n ] : [this.x, this.y];\n }, Point.fromJSON = function(curve, obj, red) {\n typeof obj == \"string\" && (obj = JSON.parse(obj));\n var res = curve.point(obj[0], obj[1], red);\n if (!obj[2])\n return res;\n function obj2point(obj2) {\n return curve.point(obj2[0], obj2[1], red);\n }\n var pre = obj[2];\n return res.precomputed = {\n beta: null,\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: [res].concat(pre.doubles.points.map(obj2point))\n },\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: [res].concat(pre.naf.points.map(obj2point))\n }\n }, res;\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" y: \" + this.y.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.inf;\n }, Point.prototype.add = function(p) {\n if (this.inf)\n return p;\n if (p.inf)\n return this;\n if (this.eq(p))\n return this.dbl();\n if (this.neg().eq(p))\n return this.curve.point(null, null);\n if (this.x.cmp(p.x) === 0)\n return this.curve.point(null, null);\n var c = this.y.redSub(p.y);\n c.cmpn(0) !== 0 && (c = c.redMul(this.x.redSub(p.x).redInvm()));\n var nx = c.redSqr().redISub(this.x).redISub(p.x), ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n }, Point.prototype.dbl = function() {\n if (this.inf)\n return this;\n var ys1 = this.y.redAdd(this.y);\n if (ys1.cmpn(0) === 0)\n return this.curve.point(null, null);\n var a = this.curve.a, x2 = this.x.redSqr(), dyinv = ys1.redInvm(), c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv), nx = c.redSqr().redISub(this.x.redAdd(this.x)), ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n }, Point.prototype.getX = function() {\n return this.x.fromRed();\n }, Point.prototype.getY = function() {\n return this.y.fromRed();\n }, Point.prototype.mul = function(k) {\n return k = new BN(k, 16), this.isInfinity() \? this : this._hasDoubles(k) \? this.curve._fixedNafMul(this, k) : this.curve.endo \? this.curve._endoWnafMulAdd([this], [k]) : this.curve._wnafMul(this, k);\n }, Point.prototype.mulAdd = function(k1, p2, k2) {\n var points = [this, p2], coeffs = [k1, k2];\n return this.curve.endo \? this.curve._endoWnafMulAdd(points, coeffs) : this.curve._wnafMulAdd(1, points, coeffs, 2);\n }, Point.prototype.jmulAdd = function(k1, p2, k2) {\n var points = [this, p2], coeffs = [k1, k2];\n return this.curve.endo \? this.curve._endoWnafMulAdd(points, coeffs, !0) : this.curve._wnafMulAdd(1, points, coeffs, 2, !0);\n }, Point.prototype.eq = function(p) {\n return this === p || this.inf === p.inf && (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n }, Point.prototype.neg = function(_precompute) {\n if (this.inf)\n return this;\n var res = this.curve.point(this.x, this.y.redNeg());\n if (_precompute && this.precomputed) {\n var pre = this.precomputed, negate = function(p) {\n return p.neg();\n };\n res.precomputed = {\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(negate)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(negate)\n }\n };\n }\n return res;\n }, Point.prototype.toJ = function() {\n if (this.inf)\n return this.curve.jpoint(null, null, null);\n var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n return res;\n };\n function JPoint(curve, x, y, z) {\n Base.BasePoint.call(this, curve, \"jacobian\"), x === null && y === null && z === null \? (this.x = this.curve.one, this.y = this.curve.one, this.z = new BN(0)) : (this.x = new BN(x, 16), this.y = new BN(y, 16), this.z = new BN(z, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one;\n }\n inherits(JPoint, Base.BasePoint), ShortCurve.prototype.jpoint = function(x, y, z) {\n return new JPoint(this, x, y, z);\n }, JPoint.prototype.toP = function() {\n if (this.isInfinity())\n return this.curve.point(null, null);\n var zinv = this.z.redInvm(), zinv2 = zinv.redSqr(), ax = this.x.redMul(zinv2), ay = this.y.redMul(zinv2).redMul(zinv);\n return this.curve.point(ax, ay);\n }, JPoint.prototype.neg = function() {\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n }, JPoint.prototype.add = function(p) {\n if (this.isInfinity())\n return p;\n if (p.isInfinity())\n return this;\n var pz2 = p.z.redSqr(), z2 = this.z.redSqr(), u1 = this.x.redMul(pz2), u2 = p.x.redMul(z2), s1 = this.y.redMul(pz2.redMul(p.z)), s2 = p.y.redMul(z2.redMul(this.z)), h = u1.redSub(u2), r = s1.redSub(s2);\n if (h.cmpn(0) === 0)\n return r.cmpn(0) !== 0 \? this.curve.jpoint(null, null, null) : this.dbl();\n var h2 = h.redSqr(), h3 = h2.redMul(h), v = u1.redMul(h2), nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v), ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)), nz = this.z.redMul(p.z).redMul(h);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.mixedAdd = function(p) {\n if (this.isInfinity())\n return p.toJ();\n if (p.isInfinity())\n return this;\n var z2 = this.z.redSqr(), u1 = this.x, u2 = p.x.redMul(z2), s1 = this.y, s2 = p.y.redMul(z2).redMul(this.z), h = u1.redSub(u2), r = s1.redSub(s2);\n if (h.cmpn(0) === 0)\n return r.cmpn(0) !== 0 \? this.curve.jpoint(null, null, null) : this.dbl();\n var h2 = h.redSqr(), h3 = h2.redMul(h), v = u1.redMul(h2), nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v), ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)), nz = this.z.redMul(h);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.dblp = function(pow) {\n if (pow === 0)\n return this;\n if (this.isInfinity())\n return this;\n if (!pow)\n return this.dbl();\n var i;\n if (this.curve.zeroA || this.curve.threeA) {\n var r = this;\n for (i = 0;i < pow; i++)\n r = r.dbl();\n return r;\n }\n var a = this.curve.a, tinv = this.curve.tinv, jx = this.x, jy = this.y, jz = this.z, jz4 = jz.redSqr().redSqr(), jyd = jy.redAdd(jy);\n for (i = 0;i < pow; i++) {\n var jx2 = jx.redSqr(), jyd2 = jyd.redSqr(), jyd4 = jyd2.redSqr(), c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)), t1 = jx.redMul(jyd2), nx = c.redSqr().redISub(t1.redAdd(t1)), t2 = t1.redISub(nx), dny = c.redMul(t2);\n dny = dny.redIAdd(dny).redISub(jyd4);\n var nz = jyd.redMul(jz);\n i + 1 < pow && (jz4 = jz4.redMul(jyd4)), jx = nx, jz = nz, jyd = dny;\n }\n return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n }, JPoint.prototype.dbl = function() {\n return this.isInfinity() \? this : this.curve.zeroA \? this._zeroDbl() : this.curve.threeA \? this._threeDbl() : this._dbl();\n }, JPoint.prototype._zeroDbl = function() {\n var nx, ny, nz;\n if (this.zOne) {\n var xx = this.x.redSqr(), yy = this.y.redSqr(), yyyy = yy.redSqr(), s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n var m = xx.redAdd(xx).redIAdd(xx), t = m.redSqr().redISub(s).redISub(s), yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8), yyyy8 = yyyy8.redIAdd(yyyy8), nx = t, ny = m.redMul(s.redISub(t)).redISub(yyyy8), nz = this.y.redAdd(this.y);\n } else {\n var a = this.x.redSqr(), b = this.y.redSqr(), c = b.redSqr(), d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n d = d.redIAdd(d);\n var e = a.redAdd(a).redIAdd(a), f = e.redSqr(), c8 = c.redIAdd(c);\n c8 = c8.redIAdd(c8), c8 = c8.redIAdd(c8), nx = f.redISub(d).redISub(d), ny = e.redMul(d.redISub(nx)).redISub(c8), nz = this.y.redMul(this.z), nz = nz.redIAdd(nz);\n }\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype._threeDbl = function() {\n var nx, ny, nz;\n if (this.zOne) {\n var xx = this.x.redSqr(), yy = this.y.redSqr(), yyyy = yy.redSqr(), s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a), t = m.redSqr().redISub(s).redISub(s);\n nx = t;\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8), yyyy8 = yyyy8.redIAdd(yyyy8), ny = m.redMul(s.redISub(t)).redISub(yyyy8), nz = this.y.redAdd(this.y);\n } else {\n var delta = this.z.redSqr(), gamma = this.y.redSqr(), beta = this.x.redMul(gamma), alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n alpha = alpha.redAdd(alpha).redIAdd(alpha);\n var beta4 = beta.redIAdd(beta);\n beta4 = beta4.redIAdd(beta4);\n var beta8 = beta4.redAdd(beta4);\n nx = alpha.redSqr().redISub(beta8), nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n var ggamma8 = gamma.redSqr();\n ggamma8 = ggamma8.redIAdd(ggamma8), ggamma8 = ggamma8.redIAdd(ggamma8), ggamma8 = ggamma8.redIAdd(ggamma8), ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n }\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype._dbl = function() {\n var a = this.curve.a, jx = this.x, jy = this.y, jz = this.z, jz4 = jz.redSqr().redSqr(), jx2 = jx.redSqr(), jy2 = jy.redSqr(), c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)), jxd4 = jx.redAdd(jx);\n jxd4 = jxd4.redIAdd(jxd4);\n var t1 = jxd4.redMul(jy2), nx = c.redSqr().redISub(t1.redAdd(t1)), t2 = t1.redISub(nx), jyd8 = jy2.redSqr();\n jyd8 = jyd8.redIAdd(jyd8), jyd8 = jyd8.redIAdd(jyd8), jyd8 = jyd8.redIAdd(jyd8);\n var ny = c.redMul(t2).redISub(jyd8), nz = jy.redAdd(jy).redMul(jz);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.trpl = function() {\n if (!this.curve.zeroA)\n return this.dbl().add(this);\n var xx = this.x.redSqr(), yy = this.y.redSqr(), zz = this.z.redSqr(), yyyy = yy.redSqr(), m = xx.redAdd(xx).redIAdd(xx), mm = m.redSqr(), e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n e = e.redIAdd(e), e = e.redAdd(e).redIAdd(e), e = e.redISub(mm);\n var ee = e.redSqr(), t = yyyy.redIAdd(yyyy);\n t = t.redIAdd(t), t = t.redIAdd(t), t = t.redIAdd(t);\n var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t), yyu4 = yy.redMul(u);\n yyu4 = yyu4.redIAdd(yyu4), yyu4 = yyu4.redIAdd(yyu4);\n var nx = this.x.redMul(ee).redISub(yyu4);\n nx = nx.redIAdd(nx), nx = nx.redIAdd(nx);\n var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n ny = ny.redIAdd(ny), ny = ny.redIAdd(ny), ny = ny.redIAdd(ny);\n var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.mul = function(k, kbase) {\n return k = new BN(k, kbase), this.curve._wnafMul(this, k);\n }, JPoint.prototype.eq = function(p) {\n if (p.type === \"affine\")\n return this.eq(p.toJ());\n if (this === p)\n return !0;\n var z2 = this.z.redSqr(), pz2 = p.z.redSqr();\n if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n return !1;\n var z3 = z2.redMul(this.z), pz3 = pz2.redMul(p.z);\n return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n }, JPoint.prototype.eqXToP = function(x) {\n var zs = this.z.redSqr(), rx = x.toRed(this.curve.red).redMul(zs);\n if (this.x.cmp(rx) === 0)\n return !0;\n for (var xc = x.clone(), t = this.curve.redN.redMul(zs);; ) {\n if (xc.iadd(this.curve.n), xc.cmp(this.curve.p) >= 0)\n return !1;\n if (rx.redIAdd(t), this.x.cmp(rx) === 0)\n return !0;\n }\n }, JPoint.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC JPoint Infinity>\" : \"<EC JPoint x: \" + this.x.toString(16, 2) + \" y: \" + this.y.toString(16, 2) + \" z: \" + this.z.toString(16, 2) + \">\";\n }, JPoint.prototype.isInfinity = function() {\n return this.z.cmpn(0) === 0;\n };\n }\n}), require_mont = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/mont.js\"(exports, module) {\n var BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), utils = require_utils3();\n function MontCurve(conf) {\n Base.call(this, \"mont\", conf), this.a = new BN(conf.a, 16).toRed(this.red), this.b = new BN(conf.b, 16).toRed(this.red), this.i4 = new BN(4).toRed(this.red).redInvm(), this.two = new BN(2).toRed(this.red), this.a24 = this.i4.redMul(this.a.redAdd(this.two));\n }\n inherits(MontCurve, Base), module.exports = MontCurve, MontCurve.prototype.validate = function(point) {\n var x = point.normalize().x, x2 = x.redSqr(), rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x), y = rhs.redSqrt();\n return y.redSqr().cmp(rhs) === 0;\n };\n function Point(curve, x, z) {\n Base.BasePoint.call(this, curve, \"projective\"), x === null && z === null \? (this.x = this.curve.one, this.z = this.curve.zero) : (this.x = new BN(x, 16), this.z = new BN(z, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)));\n }\n inherits(Point, Base.BasePoint), MontCurve.prototype.decodePoint = function(bytes, enc) {\n return this.point(utils.toArray(bytes, enc), 1);\n }, MontCurve.prototype.point = function(x, z) {\n return new Point(this, x, z);\n }, MontCurve.prototype.pointFromJSON = function(obj) {\n return Point.fromJSON(this, obj);\n }, Point.prototype.precompute = function() {\n }, Point.prototype._encode = function() {\n return this.getX().toArray(\"be\", this.curve.p.byteLength());\n }, Point.fromJSON = function(curve, obj) {\n return new Point(curve, obj[0], obj[1] || curve.one);\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" z: \" + this.z.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.z.cmpn(0) === 0;\n }, Point.prototype.dbl = function() {\n var a = this.x.redAdd(this.z), aa = a.redSqr(), b = this.x.redSub(this.z), bb = b.redSqr(), c = aa.redSub(bb), nx = aa.redMul(bb), nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\n return this.curve.point(nx, nz);\n }, Point.prototype.add = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.diffAdd = function(p, diff) {\n var a = this.x.redAdd(this.z), b = this.x.redSub(this.z), c = p.x.redAdd(p.z), d = p.x.redSub(p.z), da = d.redMul(a), cb = c.redMul(b), nx = diff.z.redMul(da.redAdd(cb).redSqr()), nz = diff.x.redMul(da.redISub(cb).redSqr());\n return this.curve.point(nx, nz);\n }, Point.prototype.mul = function(k) {\n for (var t = k.clone(), a = this, b = this.curve.point(null, null), c = this, bits = [];t.cmpn(0) !== 0; t.iushrn(1))\n bits.push(t.andln(1));\n for (var i = bits.length - 1;i >= 0; i--)\n bits[i] === 0 \? (a = a.diffAdd(b, c), b = b.dbl()) : (b = a.diffAdd(b, c), a = a.dbl());\n return b;\n }, Point.prototype.mulAdd = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.jumlAdd = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.eq = function(other) {\n return this.getX().cmp(other.getX()) === 0;\n }, Point.prototype.normalize = function() {\n return this.x = this.x.redMul(this.z.redInvm()), this.z = this.curve.one, this;\n }, Point.prototype.getX = function() {\n return this.normalize(), this.x.fromRed();\n };\n }\n}), require_edwards = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/edwards.js\"(exports, module) {\n var utils = require_utils3(), BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), assert = utils.assert;\n function EdwardsCurve(conf) {\n this.twisted = (conf.a | 0) !== 1, this.mOneA = this.twisted && (conf.a | 0) === -1, this.extended = this.mOneA, Base.call(this, \"edwards\", conf), this.a = new BN(conf.a, 16).umod(this.red.m), this.a = this.a.toRed(this.red), this.c = new BN(conf.c, 16).toRed(this.red), this.c2 = this.c.redSqr(), this.d = new BN(conf.d, 16).toRed(this.red), this.dd = this.d.redAdd(this.d), assert(!this.twisted || this.c.fromRed().cmpn(1) === 0), this.oneC = (conf.c | 0) === 1;\n }\n inherits(EdwardsCurve, Base), module.exports = EdwardsCurve, EdwardsCurve.prototype._mulA = function(num) {\n return this.mOneA \? num.redNeg() : this.a.redMul(num);\n }, EdwardsCurve.prototype._mulC = function(num) {\n return this.oneC \? num : this.c.redMul(num);\n }, EdwardsCurve.prototype.jpoint = function(x, y, z, t) {\n return this.point(x, y, z, t);\n }, EdwardsCurve.prototype.pointFromX = function(x, odd) {\n x = new BN(x, 16), x.red || (x = x.toRed(this.red));\n var x2 = x.redSqr(), rhs = this.c2.redSub(this.a.redMul(x2)), lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2)), y2 = rhs.redMul(lhs.redInvm()), y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n var isOdd = y.fromRed().isOdd();\n return (odd && !isOdd || !odd && isOdd) && (y = y.redNeg()), this.point(x, y);\n }, EdwardsCurve.prototype.pointFromY = function(y, odd) {\n y = new BN(y, 16), y.red || (y = y.toRed(this.red));\n var y2 = y.redSqr(), lhs = y2.redSub(this.c2), rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a), x2 = lhs.redMul(rhs.redInvm());\n if (x2.cmp(this.zero) === 0) {\n if (odd)\n throw new Error(\"invalid point\");\n return this.point(this.zero, y);\n }\n var x = x2.redSqrt();\n if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n return x.fromRed().isOdd() !== odd && (x = x.redNeg()), this.point(x, y);\n }, EdwardsCurve.prototype.validate = function(point) {\n if (point.isInfinity())\n return !0;\n point.normalize();\n var x2 = point.x.redSqr(), y2 = point.y.redSqr(), lhs = x2.redMul(this.a).redAdd(y2), rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\n return lhs.cmp(rhs) === 0;\n };\n function Point(curve, x, y, z, t) {\n Base.BasePoint.call(this, curve, \"projective\"), x === null && y === null && z === null \? (this.x = this.curve.zero, this.y = this.curve.one, this.z = this.curve.one, this.t = this.curve.zero, this.zOne = !0) : (this.x = new BN(x, 16), this.y = new BN(y, 16), this.z = z \? new BN(z, 16) : this.curve.one, this.t = t && new BN(t, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.t && !this.t.red && (this.t = this.t.toRed(this.curve.red)), this.zOne = this.z === this.curve.one, this.curve.extended && !this.t && (this.t = this.x.redMul(this.y), this.zOne || (this.t = this.t.redMul(this.z.redInvm()))));\n }\n inherits(Point, Base.BasePoint), EdwardsCurve.prototype.pointFromJSON = function(obj) {\n return Point.fromJSON(this, obj);\n }, EdwardsCurve.prototype.point = function(x, y, z, t) {\n return new Point(this, x, y, z, t);\n }, Point.fromJSON = function(curve, obj) {\n return new Point(curve, obj[0], obj[1], obj[2]);\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" y: \" + this.y.fromRed().toString(16, 2) + \" z: \" + this.z.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || this.zOne && this.y.cmp(this.curve.c) === 0);\n }, Point.prototype._extDbl = function() {\n var a = this.x.redSqr(), b = this.y.redSqr(), c = this.z.redSqr();\n c = c.redIAdd(c);\n var d = this.curve._mulA(a), e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b), g = d.redAdd(b), f = g.redSub(c), h = d.redSub(b), nx = e.redMul(f), ny = g.redMul(h), nt = e.redMul(h), nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n }, Point.prototype._projDbl = function() {\n var b = this.x.redAdd(this.y).redSqr(), c = this.x.redSqr(), d = this.y.redSqr(), nx, ny, nz, e, h, j;\n if (this.curve.twisted) {\n e = this.curve._mulA(c);\n var f = e.redAdd(d);\n this.zOne \? (nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)), ny = f.redMul(e.redSub(d)), nz = f.redSqr().redSub(f).redSub(f)) : (h = this.z.redSqr(), j = f.redSub(h).redISub(h), nx = b.redSub(c).redISub(d).redMul(j), ny = f.redMul(e.redSub(d)), nz = f.redMul(j));\n } else\n e = c.redAdd(d), h = this.curve._mulC(this.z).redSqr(), j = e.redSub(h).redSub(h), nx = this.curve._mulC(b.redISub(e)).redMul(j), ny = this.curve._mulC(e).redMul(c.redISub(d)), nz = e.redMul(j);\n return this.curve.point(nx, ny, nz);\n }, Point.prototype.dbl = function() {\n return this.isInfinity() \? this : this.curve.extended \? this._extDbl() : this._projDbl();\n }, Point.prototype._extAdd = function(p) {\n var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)), b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)), c = this.t.redMul(this.curve.dd).redMul(p.t), d = this.z.redMul(p.z.redAdd(p.z)), e = b.redSub(a), f = d.redSub(c), g = d.redAdd(c), h = b.redAdd(a), nx = e.redMul(f), ny = g.redMul(h), nt = e.redMul(h), nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n }, Point.prototype._projAdd = function(p) {\n var a = this.z.redMul(p.z), b = a.redSqr(), c = this.x.redMul(p.x), d = this.y.redMul(p.y), e = this.curve.d.redMul(c).redMul(d), f = b.redSub(e), g = b.redAdd(e), tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d), nx = a.redMul(f).redMul(tmp), ny, nz;\n return this.curve.twisted \? (ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))), nz = f.redMul(g)) : (ny = a.redMul(g).redMul(d.redSub(c)), nz = this.curve._mulC(f).redMul(g)), this.curve.point(nx, ny, nz);\n }, Point.prototype.add = function(p) {\n return this.isInfinity() \? p : p.isInfinity() \? this : this.curve.extended \? this._extAdd(p) : this._projAdd(p);\n }, Point.prototype.mul = function(k) {\n return this._hasDoubles(k) \? this.curve._fixedNafMul(this, k) : this.curve._wnafMul(this, k);\n }, Point.prototype.mulAdd = function(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, !1);\n }, Point.prototype.jmulAdd = function(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, !0);\n }, Point.prototype.normalize = function() {\n if (this.zOne)\n return this;\n var zi = this.z.redInvm();\n return this.x = this.x.redMul(zi), this.y = this.y.redMul(zi), this.t && (this.t = this.t.redMul(zi)), this.z = this.curve.one, this.zOne = !0, this;\n }, Point.prototype.neg = function() {\n return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg());\n }, Point.prototype.getX = function() {\n return this.normalize(), this.x.fromRed();\n }, Point.prototype.getY = function() {\n return this.normalize(), this.y.fromRed();\n }, Point.prototype.eq = function(other) {\n return this === other || this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0;\n }, Point.prototype.eqXToP = function(x) {\n var rx = x.toRed(this.curve.red).redMul(this.z);\n if (this.x.cmp(rx) === 0)\n return !0;\n for (var xc = x.clone(), t = this.curve.redN.redMul(this.z);; ) {\n if (xc.iadd(this.curve.n), xc.cmp(this.curve.p) >= 0)\n return !1;\n if (rx.redIAdd(t), this.x.cmp(rx) === 0)\n return !0;\n }\n }, Point.prototype.toP = Point.prototype.normalize, Point.prototype.mixedAdd = Point.prototype.add;\n }\n}), require_curve = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/index.js\"(exports) {\n var curve = exports;\n curve.base = require_base(), curve.short = require_short(), curve.mont = require_mont(), curve.edwards = require_edwards();\n }\n}), require_utils4 = __commonJS({\n \"node_modules/hash.js/lib/hash/utils.js\"(exports) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser();\n exports.inherits = inherits;\n function isSurrogatePair(msg, i) {\n return (msg.charCodeAt(i) & 64512) !== 55296 || i < 0 || i + 1 >= msg.length \? !1 : (msg.charCodeAt(i + 1) & 64512) === 56320;\n }\n function toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg == \"string\")\n if (enc) {\n if (enc === \"hex\")\n for (msg = msg.replace(/[^a-z0-9]+/gi, \"\"), msg.length % 2 !== 0 && (msg = \"0\" + msg), i = 0;i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else\n for (var p = 0, i = 0;i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n c < 128 \? res[p++] = c : c < 2048 \? (res[p++] = c >> 6 | 192, res[p++] = c & 63 | 128) : isSurrogatePair(msg, i) \? (c = 65536 + ((c & 1023) << 10) + (msg.charCodeAt(++i) & 1023), res[p++] = c >> 18 | 240, res[p++] = c >> 12 & 63 | 128, res[p++] = c >> 6 & 63 | 128, res[p++] = c & 63 | 128) : (res[p++] = c >> 12 | 224, res[p++] = c >> 6 & 63 | 128, res[p++] = c & 63 | 128);\n }\n else\n for (i = 0;i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n exports.toArray = toArray;\n function toHex(msg) {\n for (var res = \"\", i = 0;i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n }\n exports.toHex = toHex;\n function htonl(w) {\n var res = w >>> 24 | w >>> 8 & 65280 | w << 8 & 16711680 | (w & 255) << 24;\n return res >>> 0;\n }\n exports.htonl = htonl;\n function toHex32(msg, endian) {\n for (var res = \"\", i = 0;i < msg.length; i++) {\n var w = msg[i];\n endian === \"little\" && (w = htonl(w)), res += zero8(w.toString(16));\n }\n return res;\n }\n exports.toHex32 = toHex32;\n function zero2(word) {\n return word.length === 1 \? \"0\" + word : word;\n }\n exports.zero2 = zero2;\n function zero8(word) {\n return word.length === 7 \? \"0\" + word : word.length === 6 \? \"00\" + word : word.length === 5 \? \"000\" + word : word.length === 4 \? \"0000\" + word : word.length === 3 \? \"00000\" + word : word.length === 2 \? \"000000\" + word : word.length === 1 \? \"0000000\" + word : word;\n }\n exports.zero8 = zero8;\n function join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n for (var res = new Array(len / 4), i = 0, k = start;i < res.length; i++, k += 4) {\n var w;\n endian === \"big\" \? w = msg[k] << 24 | msg[k + 1] << 16 | msg[k + 2] << 8 | msg[k + 3] : w = msg[k + 3] << 24 | msg[k + 2] << 16 | msg[k + 1] << 8 | msg[k], res[i] = w >>> 0;\n }\n return res;\n }\n exports.join32 = join32;\n function split32(msg, endian) {\n for (var res = new Array(msg.length * 4), i = 0, k = 0;i < msg.length; i++, k += 4) {\n var m = msg[i];\n endian === \"big\" \? (res[k] = m >>> 24, res[k + 1] = m >>> 16 & 255, res[k + 2] = m >>> 8 & 255, res[k + 3] = m & 255) : (res[k + 3] = m >>> 24, res[k + 2] = m >>> 16 & 255, res[k + 1] = m >>> 8 & 255, res[k] = m & 255);\n }\n return res;\n }\n exports.split32 = split32;\n function rotr32(w, b) {\n return w >>> b | w << 32 - b;\n }\n exports.rotr32 = rotr32;\n function rotl32(w, b) {\n return w << b | w >>> 32 - b;\n }\n exports.rotl32 = rotl32;\n function sum32(a, b) {\n return a + b >>> 0;\n }\n exports.sum32 = sum32;\n function sum32_3(a, b, c) {\n return a + b + c >>> 0;\n }\n exports.sum32_3 = sum32_3;\n function sum32_4(a, b, c, d) {\n return a + b + c + d >>> 0;\n }\n exports.sum32_4 = sum32_4;\n function sum32_5(a, b, c, d, e) {\n return a + b + c + d + e >>> 0;\n }\n exports.sum32_5 = sum32_5;\n function sum64(buf, pos, ah, al) {\n var bh = buf[pos], bl = buf[pos + 1], lo = al + bl >>> 0, hi = (lo < al \? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0, buf[pos + 1] = lo;\n }\n exports.sum64 = sum64;\n function sum64_hi(ah, al, bh, bl) {\n var lo = al + bl >>> 0, hi = (lo < al \? 1 : 0) + ah + bh;\n return hi >>> 0;\n }\n exports.sum64_hi = sum64_hi;\n function sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n }\n exports.sum64_lo = sum64_lo;\n function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0, lo = al;\n lo = lo + bl >>> 0, carry += lo < al \? 1 : 0, lo = lo + cl >>> 0, carry += lo < cl \? 1 : 0, lo = lo + dl >>> 0, carry += lo < dl \? 1 : 0;\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n }\n exports.sum64_4_hi = sum64_4_hi;\n function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n }\n exports.sum64_4_lo = sum64_4_lo;\n function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0, lo = al;\n lo = lo + bl >>> 0, carry += lo < al \? 1 : 0, lo = lo + cl >>> 0, carry += lo < cl \? 1 : 0, lo = lo + dl >>> 0, carry += lo < dl \? 1 : 0, lo = lo + el >>> 0, carry += lo < el \? 1 : 0;\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n }\n exports.sum64_5_hi = sum64_5_hi;\n function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n return lo >>> 0;\n }\n exports.sum64_5_lo = sum64_5_lo;\n function rotr64_hi(ah, al, num) {\n var r = al << 32 - num | ah >>> num;\n return r >>> 0;\n }\n exports.rotr64_hi = rotr64_hi;\n function rotr64_lo(ah, al, num) {\n var r = ah << 32 - num | al >>> num;\n return r >>> 0;\n }\n exports.rotr64_lo = rotr64_lo;\n function shr64_hi(ah, al, num) {\n return ah >>> num;\n }\n exports.shr64_hi = shr64_hi;\n function shr64_lo(ah, al, num) {\n var r = ah << 32 - num | al >>> num;\n return r >>> 0;\n }\n exports.shr64_lo = shr64_lo;\n }\n}), require_common = __commonJS({\n \"node_modules/hash.js/lib/hash/common.js\"(exports) {\n var utils = require_utils4(), assert = require_minimalistic_assert();\n function BlockHash() {\n this.pending = null, this.pendingTotal = 0, this.blockSize = this.constructor.blockSize, this.outSize = this.constructor.outSize, this.hmacStrength = this.constructor.hmacStrength, this.padLength = this.constructor.padLength / 8, this.endian = \"big\", this._delta8 = this.blockSize / 8, this._delta32 = this.blockSize / 32;\n }\n BlockHash.prototype = {}, exports.BlockHash = BlockHash, BlockHash.prototype.update = function(msg, enc) {\n if (msg = utils.toArray(msg, enc), this.pending \? this.pending = this.pending.concat(msg) : this.pending = msg, this.pendingTotal += msg.length, this.pending.length >= this._delta8) {\n msg = this.pending;\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length), this.pending.length === 0 && (this.pending = null), msg = utils.join32(msg, 0, msg.length - r, this.endian);\n for (var i = 0;i < msg.length; i += this._delta32)\n this._update(msg, i, i + this._delta32);\n }\n return this;\n }, BlockHash.prototype.digest = function(enc) {\n return this.update(this._pad()), assert(this.pending === null), this._digest(enc);\n }, BlockHash.prototype._pad = function() {\n var len = this.pendingTotal, bytes = this._delta8, k = bytes - (len + this.padLength) % bytes, res = new Array(k + this.padLength);\n res[0] = 128;\n for (var i = 1;i < k; i++)\n res[i] = 0;\n if (len <<= 3, this.endian === \"big\") {\n for (var t = 8;t < this.padLength; t++)\n res[i++] = 0;\n res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = len >>> 24 & 255, res[i++] = len >>> 16 & 255, res[i++] = len >>> 8 & 255, res[i++] = len & 255;\n } else\n for (res[i++] = len & 255, res[i++] = len >>> 8 & 255, res[i++] = len >>> 16 & 255, res[i++] = len >>> 24 & 255, res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = 0, t = 8;t < this.padLength; t++)\n res[i++] = 0;\n return res;\n };\n }\n}), require_common2 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/common.js\"(exports) {\n var utils = require_utils4(), rotr32 = utils.rotr32;\n function ft_1(s, x, y, z) {\n if (s === 0)\n return ch32(x, y, z);\n if (s === 1 || s === 3)\n return p32(x, y, z);\n if (s === 2)\n return maj32(x, y, z);\n }\n exports.ft_1 = ft_1;\n function ch32(x, y, z) {\n return x & y ^ ~x & z;\n }\n exports.ch32 = ch32;\n function maj32(x, y, z) {\n return x & y ^ x & z ^ y & z;\n }\n exports.maj32 = maj32;\n function p32(x, y, z) {\n return x ^ y ^ z;\n }\n exports.p32 = p32;\n function s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n }\n exports.s0_256 = s0_256;\n function s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n }\n exports.s1_256 = s1_256;\n function g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ x >>> 3;\n }\n exports.g0_256 = g0_256;\n function g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ x >>> 10;\n }\n exports.g1_256 = g1_256;\n }\n}), require__ = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/1.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), shaCommon = require_common2(), rotl32 = utils.rotl32, sum32 = utils.sum32, sum32_5 = utils.sum32_5, ft_1 = shaCommon.ft_1, BlockHash = common.BlockHash, sha1_K = [1518500249, 1859775393, 2400959708, 3395469782];\n function SHA1() {\n if (!(this instanceof SHA1))\n return new SHA1;\n BlockHash.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.W = new Array(80);\n }\n utils.inherits(SHA1, BlockHash), module.exports = SHA1, SHA1.blockSize = 512, SHA1.outSize = 160, SHA1.hmacStrength = 80, SHA1.padLength = 64, SHA1.prototype._update = function(msg, start) {\n for (var W = this.W, i = 0;i < 16; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i++)\n W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n var a = this.h[0], b = this.h[1], c = this.h[2], d = this.h[3], e = this.h[4];\n for (i = 0;i < W.length; i++) {\n var s = ~~(i / 20), t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n e = d, d = c, c = rotl32(b, 30), b = a, a = t;\n }\n this.h[0] = sum32(this.h[0], a), this.h[1] = sum32(this.h[1], b), this.h[2] = sum32(this.h[2], c), this.h[3] = sum32(this.h[3], d), this.h[4] = sum32(this.h[4], e);\n }, SHA1.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n }\n}), require__2 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/256.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), shaCommon = require_common2(), assert = require_minimalistic_assert(), sum32 = utils.sum32, sum32_4 = utils.sum32_4, sum32_5 = utils.sum32_5, ch32 = shaCommon.ch32, maj32 = shaCommon.maj32, s0_256 = shaCommon.s0_256, s1_256 = shaCommon.s1_256, g0_256 = shaCommon.g0_256, g1_256 = shaCommon.g1_256, BlockHash = common.BlockHash, sha256_K = [\n 1116352408,\n 1899447441,\n 3049323471,\n 3921009573,\n 961987163,\n 1508970993,\n 2453635748,\n 2870763221,\n 3624381080,\n 310598401,\n 607225278,\n 1426881987,\n 1925078388,\n 2162078206,\n 2614888103,\n 3248222580,\n 3835390401,\n 4022224774,\n 264347078,\n 604807628,\n 770255983,\n 1249150122,\n 1555081692,\n 1996064986,\n 2554220882,\n 2821834349,\n 2952996808,\n 3210313671,\n 3336571891,\n 3584528711,\n 113926993,\n 338241895,\n 666307205,\n 773529912,\n 1294757372,\n 1396182291,\n 1695183700,\n 1986661051,\n 2177026350,\n 2456956037,\n 2730485921,\n 2820302411,\n 3259730800,\n 3345764771,\n 3516065817,\n 3600352804,\n 4094571909,\n 275423344,\n 430227734,\n 506948616,\n 659060556,\n 883997877,\n 958139571,\n 1322822218,\n 1537002063,\n 1747873779,\n 1955562222,\n 2024104815,\n 2227730452,\n 2361852424,\n 2428436474,\n 2756734187,\n 3204031479,\n 3329325298\n ];\n function SHA256() {\n if (!(this instanceof SHA256))\n return new SHA256;\n BlockHash.call(this), this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], this.k = sha256_K, this.W = new Array(64);\n }\n utils.inherits(SHA256, BlockHash), module.exports = SHA256, SHA256.blockSize = 512, SHA256.outSize = 256, SHA256.hmacStrength = 192, SHA256.padLength = 64, SHA256.prototype._update = function(msg, start) {\n for (var W = this.W, i = 0;i < 16; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i++)\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n var a = this.h[0], b = this.h[1], c = this.h[2], d = this.h[3], e = this.h[4], f = this.h[5], g = this.h[6], h = this.h[7];\n for (assert(this.k.length === W.length), i = 0;i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]), T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g, g = f, f = e, e = sum32(d, T1), d = c, c = b, b = a, a = sum32(T1, T2);\n }\n this.h[0] = sum32(this.h[0], a), this.h[1] = sum32(this.h[1], b), this.h[2] = sum32(this.h[2], c), this.h[3] = sum32(this.h[3], d), this.h[4] = sum32(this.h[4], e), this.h[5] = sum32(this.h[5], f), this.h[6] = sum32(this.h[6], g), this.h[7] = sum32(this.h[7], h);\n }, SHA256.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n }\n}), require__3 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/224.js\"(exports, module) {\n var utils = require_utils4(), SHA256 = require__2();\n function SHA224() {\n if (!(this instanceof SHA224))\n return new SHA224;\n SHA256.call(this), this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428];\n }\n utils.inherits(SHA224, SHA256), module.exports = SHA224, SHA224.blockSize = 512, SHA224.outSize = 224, SHA224.hmacStrength = 192, SHA224.padLength = 64, SHA224.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h.slice(0, 7), \"big\") : utils.split32(this.h.slice(0, 7), \"big\");\n };\n }\n}), require__4 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/512.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), assert = require_minimalistic_assert(), rotr64_hi = utils.rotr64_hi, rotr64_lo = utils.rotr64_lo, shr64_hi = utils.shr64_hi, shr64_lo = utils.shr64_lo, sum64 = utils.sum64, sum64_hi = utils.sum64_hi, sum64_lo = utils.sum64_lo, sum64_4_hi = utils.sum64_4_hi, sum64_4_lo = utils.sum64_4_lo, sum64_5_hi = utils.sum64_5_hi, sum64_5_lo = utils.sum64_5_lo, BlockHash = common.BlockHash, sha512_K = [\n 1116352408,\n 3609767458,\n 1899447441,\n 602891725,\n 3049323471,\n 3964484399,\n 3921009573,\n 2173295548,\n 961987163,\n 4081628472,\n 1508970993,\n 3053834265,\n 2453635748,\n 2937671579,\n 2870763221,\n 3664609560,\n 3624381080,\n 2734883394,\n 310598401,\n 1164996542,\n 607225278,\n 1323610764,\n 1426881987,\n 3590304994,\n 1925078388,\n 4068182383,\n 2162078206,\n 991336113,\n 2614888103,\n 633803317,\n 3248222580,\n 3479774868,\n 3835390401,\n 2666613458,\n 4022224774,\n 944711139,\n 264347078,\n 2341262773,\n 604807628,\n 2007800933,\n 770255983,\n 1495990901,\n 1249150122,\n 1856431235,\n 1555081692,\n 3175218132,\n 1996064986,\n 2198950837,\n 2554220882,\n 3999719339,\n 2821834349,\n 766784016,\n 2952996808,\n 2566594879,\n 3210313671,\n 3203337956,\n 3336571891,\n 1034457026,\n 3584528711,\n 2466948901,\n 113926993,\n 3758326383,\n 338241895,\n 168717936,\n 666307205,\n 1188179964,\n 773529912,\n 1546045734,\n 1294757372,\n 1522805485,\n 1396182291,\n 2643833823,\n 1695183700,\n 2343527390,\n 1986661051,\n 1014477480,\n 2177026350,\n 1206759142,\n 2456956037,\n 344077627,\n 2730485921,\n 1290863460,\n 2820302411,\n 3158454273,\n 3259730800,\n 3505952657,\n 3345764771,\n 106217008,\n 3516065817,\n 3606008344,\n 3600352804,\n 1432725776,\n 4094571909,\n 1467031594,\n 275423344,\n 851169720,\n 430227734,\n 3100823752,\n 506948616,\n 1363258195,\n 659060556,\n 3750685593,\n 883997877,\n 3785050280,\n 958139571,\n 3318307427,\n 1322822218,\n 3812723403,\n 1537002063,\n 2003034995,\n 1747873779,\n 3602036899,\n 1955562222,\n 1575990012,\n 2024104815,\n 1125592928,\n 2227730452,\n 2716904306,\n 2361852424,\n 442776044,\n 2428436474,\n 593698344,\n 2756734187,\n 3733110249,\n 3204031479,\n 2999351573,\n 3329325298,\n 3815920427,\n 3391569614,\n 3928383900,\n 3515267271,\n 566280711,\n 3940187606,\n 3454069534,\n 4118630271,\n 4000239992,\n 116418474,\n 1914138554,\n 174292421,\n 2731055270,\n 289380356,\n 3203993006,\n 460393269,\n 320620315,\n 685471733,\n 587496836,\n 852142971,\n 1086792851,\n 1017036298,\n 365543100,\n 1126000580,\n 2618297676,\n 1288033470,\n 3409855158,\n 1501505948,\n 4234509866,\n 1607167915,\n 987167468,\n 1816402316,\n 1246189591\n ];\n function SHA512() {\n if (!(this instanceof SHA512))\n return new SHA512;\n BlockHash.call(this), this.h = [\n 1779033703,\n 4089235720,\n 3144134277,\n 2227873595,\n 1013904242,\n 4271175723,\n 2773480762,\n 1595750129,\n 1359893119,\n 2917565137,\n 2600822924,\n 725511199,\n 528734635,\n 4215389547,\n 1541459225,\n 327033209\n ], this.k = sha512_K, this.W = new Array(160);\n }\n utils.inherits(SHA512, BlockHash), module.exports = SHA512, SHA512.blockSize = 1024, SHA512.outSize = 512, SHA512.hmacStrength = 192, SHA512.padLength = 128, SHA512.prototype._prepareBlock = function(msg, start) {\n for (var W = this.W, i = 0;i < 32; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i += 2) {\n var c0_hi = g1_512_hi(W[i - 4], W[i - 3]), c0_lo = g1_512_lo(W[i - 4], W[i - 3]), c1_hi = W[i - 14], c1_lo = W[i - 13], c2_hi = g0_512_hi(W[i - 30], W[i - 29]), c2_lo = g0_512_lo(W[i - 30], W[i - 29]), c3_hi = W[i - 32], c3_lo = W[i - 31];\n W[i] = sum64_4_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo), W[i + 1] = sum64_4_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo);\n }\n }, SHA512.prototype._update = function(msg, start) {\n this._prepareBlock(msg, start);\n var W = this.W, ah = this.h[0], al = this.h[1], bh = this.h[2], bl = this.h[3], ch = this.h[4], cl = this.h[5], dh = this.h[6], dl = this.h[7], eh = this.h[8], el = this.h[9], fh = this.h[10], fl = this.h[11], gh = this.h[12], gl = this.h[13], hh = this.h[14], hl = this.h[15];\n assert(this.k.length === W.length);\n for (var i = 0;i < W.length; i += 2) {\n var c0_hi = hh, c0_lo = hl, c1_hi = s1_512_hi(eh, el), c1_lo = s1_512_lo(eh, el), c2_hi = ch64_hi(eh, el, fh, fl, gh, gl), c2_lo = ch64_lo(eh, el, fh, fl, gh, gl), c3_hi = this.k[i], c3_lo = this.k[i + 1], c4_hi = W[i], c4_lo = W[i + 1], T1_hi = sum64_5_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo), T1_lo = sum64_5_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo);\n c0_hi = s0_512_hi(ah, al), c0_lo = s0_512_lo(ah, al), c1_hi = maj64_hi(ah, al, bh, bl, ch, cl), c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo), T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n hh = gh, hl = gl, gh = fh, gl = fl, fh = eh, fl = el, eh = sum64_hi(dh, dl, T1_hi, T1_lo), el = sum64_lo(dl, dl, T1_hi, T1_lo), dh = ch, dl = cl, ch = bh, cl = bl, bh = ah, bl = al, ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo), al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n }\n sum64(this.h, 0, ah, al), sum64(this.h, 2, bh, bl), sum64(this.h, 4, ch, cl), sum64(this.h, 6, dh, dl), sum64(this.h, 8, eh, el), sum64(this.h, 10, fh, fl), sum64(this.h, 12, gh, gl), sum64(this.h, 14, hh, hl);\n }, SHA512.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n function ch64_hi(xh, xl, yh, yl, zh) {\n var r = xh & yh ^ ~xh & zh;\n return r < 0 && (r += 4294967296), r;\n }\n function ch64_lo(xh, xl, yh, yl, zh, zl) {\n var r = xl & yl ^ ~xl & zl;\n return r < 0 && (r += 4294967296), r;\n }\n function maj64_hi(xh, xl, yh, yl, zh) {\n var r = xh & yh ^ xh & zh ^ yh & zh;\n return r < 0 && (r += 4294967296), r;\n }\n function maj64_lo(xh, xl, yh, yl, zh, zl) {\n var r = xl & yl ^ xl & zl ^ yl & zl;\n return r < 0 && (r += 4294967296), r;\n }\n function s0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 28), c1_hi = rotr64_hi(xl, xh, 2), c2_hi = rotr64_hi(xl, xh, 7), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function s0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 28), c1_lo = rotr64_lo(xl, xh, 2), c2_lo = rotr64_lo(xl, xh, 7), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function s1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 14), c1_hi = rotr64_hi(xh, xl, 18), c2_hi = rotr64_hi(xl, xh, 9), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function s1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 14), c1_lo = rotr64_lo(xh, xl, 18), c2_lo = rotr64_lo(xl, xh, 9), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function g0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 1), c1_hi = rotr64_hi(xh, xl, 8), c2_hi = shr64_hi(xh, xl, 7), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function g0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 1), c1_lo = rotr64_lo(xh, xl, 8), c2_lo = shr64_lo(xh, xl, 7), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function g1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 19), c1_hi = rotr64_hi(xl, xh, 29), c2_hi = shr64_hi(xh, xl, 6), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function g1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 19), c1_lo = rotr64_lo(xl, xh, 29), c2_lo = shr64_lo(xh, xl, 6), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n }\n}), require__5 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/384.js\"(exports, module) {\n var utils = require_utils4(), SHA512 = require__4();\n function SHA384() {\n if (!(this instanceof SHA384))\n return new SHA384;\n SHA512.call(this), this.h = [\n 3418070365,\n 3238371032,\n 1654270250,\n 914150663,\n 2438529370,\n 812702999,\n 355462360,\n 4144912697,\n 1731405415,\n 4290775857,\n 2394180231,\n 1750603025,\n 3675008525,\n 1694076839,\n 1203062813,\n 3204075428\n ];\n }\n utils.inherits(SHA384, SHA512), module.exports = SHA384, SHA384.blockSize = 1024, SHA384.outSize = 384, SHA384.hmacStrength = 192, SHA384.padLength = 128, SHA384.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h.slice(0, 12), \"big\") : utils.split32(this.h.slice(0, 12), \"big\");\n };\n }\n}), require_sha3 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha.js\"(exports) {\n exports.sha1 = require__(), exports.sha224 = require__3(), exports.sha256 = require__2(), exports.sha384 = require__5(), exports.sha512 = require__4();\n }\n}), require_ripemd = __commonJS({\n \"node_modules/hash.js/lib/hash/ripemd.js\"(exports) {\n var utils = require_utils4(), common = require_common(), rotl32 = utils.rotl32, sum32 = utils.sum32, sum32_3 = utils.sum32_3, sum32_4 = utils.sum32_4, BlockHash = common.BlockHash;\n function RIPEMD160() {\n if (!(this instanceof RIPEMD160))\n return new RIPEMD160;\n BlockHash.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = \"little\";\n }\n utils.inherits(RIPEMD160, BlockHash), exports.ripemd160 = RIPEMD160, RIPEMD160.blockSize = 512, RIPEMD160.outSize = 160, RIPEMD160.hmacStrength = 192, RIPEMD160.padLength = 64, RIPEMD160.prototype._update = function(msg, start) {\n for (var A = this.h[0], B = this.h[1], C = this.h[2], D = this.h[3], E = this.h[4], Ah = A, Bh = B, Ch = C, Dh = D, Eh = E, j = 0;j < 80; j++) {\n var T = sum32(rotl32(sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), s[j]), E);\n A = E, E = D, D = rotl32(C, 10), C = B, B = T, T = sum32(rotl32(sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), sh[j]), Eh), Ah = Eh, Eh = Dh, Dh = rotl32(Ch, 10), Ch = Bh, Bh = T;\n }\n T = sum32_3(this.h[1], C, Dh), this.h[1] = sum32_3(this.h[2], D, Eh), this.h[2] = sum32_3(this.h[3], E, Ah), this.h[3] = sum32_3(this.h[4], A, Bh), this.h[4] = sum32_3(this.h[0], B, Ch), this.h[0] = T;\n }, RIPEMD160.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"little\") : utils.split32(this.h, \"little\");\n };\n function f(j, x, y, z) {\n return j <= 15 \? x ^ y ^ z : j <= 31 \? x & y | ~x & z : j <= 47 \? (x | ~y) ^ z : j <= 63 \? x & z | y & ~z : x ^ (y | ~z);\n }\n function K(j) {\n return j <= 15 \? 0 : j <= 31 \? 1518500249 : j <= 47 \? 1859775393 : j <= 63 \? 2400959708 : 2840853838;\n }\n function Kh(j) {\n return j <= 15 \? 1352829926 : j <= 31 \? 1548603684 : j <= 47 \? 1836072691 : j <= 63 \? 2053994217 : 0;\n }\n var r = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 7,\n 4,\n 13,\n 1,\n 10,\n 6,\n 15,\n 3,\n 12,\n 0,\n 9,\n 5,\n 2,\n 14,\n 11,\n 8,\n 3,\n 10,\n 14,\n 4,\n 9,\n 15,\n 8,\n 1,\n 2,\n 7,\n 0,\n 6,\n 13,\n 11,\n 5,\n 12,\n 1,\n 9,\n 11,\n 10,\n 0,\n 8,\n 12,\n 4,\n 13,\n 3,\n 7,\n 15,\n 14,\n 5,\n 6,\n 2,\n 4,\n 0,\n 5,\n 9,\n 7,\n 12,\n 2,\n 10,\n 14,\n 1,\n 3,\n 8,\n 11,\n 6,\n 15,\n 13\n ], rh = [\n 5,\n 14,\n 7,\n 0,\n 9,\n 2,\n 11,\n 4,\n 13,\n 6,\n 15,\n 8,\n 1,\n 10,\n 3,\n 12,\n 6,\n 11,\n 3,\n 7,\n 0,\n 13,\n 5,\n 10,\n 14,\n 15,\n 8,\n 12,\n 4,\n 9,\n 1,\n 2,\n 15,\n 5,\n 1,\n 3,\n 7,\n 14,\n 6,\n 9,\n 11,\n 8,\n 12,\n 2,\n 10,\n 0,\n 4,\n 13,\n 8,\n 6,\n 4,\n 1,\n 3,\n 11,\n 15,\n 0,\n 5,\n 12,\n 2,\n 13,\n 9,\n 7,\n 10,\n 14,\n 12,\n 15,\n 10,\n 4,\n 1,\n 5,\n 8,\n 7,\n 6,\n 2,\n 13,\n 14,\n 0,\n 3,\n 9,\n 11\n ], s = [\n 11,\n 14,\n 15,\n 12,\n 5,\n 8,\n 7,\n 9,\n 11,\n 13,\n 14,\n 15,\n 6,\n 7,\n 9,\n 8,\n 7,\n 6,\n 8,\n 13,\n 11,\n 9,\n 7,\n 15,\n 7,\n 12,\n 15,\n 9,\n 11,\n 7,\n 13,\n 12,\n 11,\n 13,\n 6,\n 7,\n 14,\n 9,\n 13,\n 15,\n 14,\n 8,\n 13,\n 6,\n 5,\n 12,\n 7,\n 5,\n 11,\n 12,\n 14,\n 15,\n 14,\n 15,\n 9,\n 8,\n 9,\n 14,\n 5,\n 6,\n 8,\n 6,\n 5,\n 12,\n 9,\n 15,\n 5,\n 11,\n 6,\n 8,\n 13,\n 12,\n 5,\n 12,\n 13,\n 14,\n 11,\n 8,\n 5,\n 6\n ], sh = [\n 8,\n 9,\n 9,\n 11,\n 13,\n 15,\n 15,\n 5,\n 7,\n 7,\n 8,\n 11,\n 14,\n 14,\n 12,\n 6,\n 9,\n 13,\n 15,\n 7,\n 12,\n 8,\n 9,\n 11,\n 7,\n 7,\n 12,\n 7,\n 6,\n 15,\n 13,\n 11,\n 9,\n 7,\n 15,\n 11,\n 8,\n 6,\n 6,\n 14,\n 12,\n 13,\n 5,\n 14,\n 13,\n 13,\n 7,\n 5,\n 15,\n 5,\n 8,\n 11,\n 14,\n 14,\n 6,\n 14,\n 6,\n 9,\n 12,\n 9,\n 12,\n 5,\n 15,\n 8,\n 8,\n 5,\n 12,\n 9,\n 12,\n 5,\n 14,\n 6,\n 8,\n 13,\n 6,\n 5,\n 15,\n 13,\n 11,\n 11\n ];\n }\n}), require_hmac = __commonJS({\n \"node_modules/hash.js/lib/hash/hmac.js\"(exports, module) {\n var utils = require_utils4(), assert = require_minimalistic_assert();\n function Hmac(hash, key, enc) {\n if (!(this instanceof Hmac))\n return new Hmac(hash, key, enc);\n this.Hash = hash, this.blockSize = hash.blockSize / 8, this.outSize = hash.outSize / 8, this.inner = null, this.outer = null, this._init(utils.toArray(key, enc));\n }\n Hmac.prototype = {}, module.exports = Hmac, Hmac.prototype._init = function(key) {\n key.length > this.blockSize && (key = new this.Hash().update(key).digest()), assert(key.length <= this.blockSize);\n for (var i = key.length;i < this.blockSize; i++)\n key.push(0);\n for (i = 0;i < key.length; i++)\n key[i] ^= 54;\n for (this.inner = new this.Hash().update(key), i = 0;i < key.length; i++)\n key[i] ^= 106;\n this.outer = new this.Hash().update(key);\n }, Hmac.prototype.update = function(msg, enc) {\n return this.inner.update(msg, enc), this;\n }, Hmac.prototype.digest = function(enc) {\n return this.outer.update(this.inner.digest()), this.outer.digest(enc);\n };\n }\n}), require_hash2 = __commonJS({\n \"node_modules/hash.js/lib/hash.js\"(exports) {\n var hash = exports;\n hash.utils = require_utils4(), hash.common = require_common(), hash.sha = require_sha3(), hash.ripemd = require_ripemd(), hash.hmac = require_hmac(), hash.sha1 = hash.sha.sha1, hash.sha256 = hash.sha.sha256, hash.sha224 = hash.sha.sha224, hash.sha384 = hash.sha.sha384, hash.sha512 = hash.sha.sha512, hash.ripemd160 = hash.ripemd.ripemd160;\n }\n}), require_secp256k1 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js\"(exports, module) {\n module.exports = {\n doubles: {\n step: 4,\n points: [\n [\n \"e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a\",\n \"f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821\"\n ],\n [\n \"8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508\",\n \"11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf\"\n ],\n [\n \"175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739\",\n \"d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695\"\n ],\n [\n \"363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640\",\n \"4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9\"\n ],\n [\n \"8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c\",\n \"4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36\"\n ],\n [\n \"723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda\",\n \"96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f\"\n ],\n [\n \"eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa\",\n \"5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999\"\n ],\n [\n \"100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0\",\n \"cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09\"\n ],\n [\n \"e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d\",\n \"9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d\"\n ],\n [\n \"feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d\",\n \"e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088\"\n ],\n [\n \"da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1\",\n \"9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d\"\n ],\n [\n \"53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0\",\n \"5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8\"\n ],\n [\n \"8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047\",\n \"10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a\"\n ],\n [\n \"385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862\",\n \"283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453\"\n ],\n [\n \"6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7\",\n \"7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160\"\n ],\n [\n \"3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd\",\n \"56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0\"\n ],\n [\n \"85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83\",\n \"7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6\"\n ],\n [\n \"948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a\",\n \"53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589\"\n ],\n [\n \"6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8\",\n \"bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17\"\n ],\n [\n \"e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d\",\n \"4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda\"\n ],\n [\n \"e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725\",\n \"7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd\"\n ],\n [\n \"213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754\",\n \"4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2\"\n ],\n [\n \"4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c\",\n \"17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6\"\n ],\n [\n \"fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6\",\n \"6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f\"\n ],\n [\n \"76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39\",\n \"c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01\"\n ],\n [\n \"c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891\",\n \"893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3\"\n ],\n [\n \"d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b\",\n \"febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f\"\n ],\n [\n \"b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03\",\n \"2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7\"\n ],\n [\n \"e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d\",\n \"eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78\"\n ],\n [\n \"a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070\",\n \"7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1\"\n ],\n [\n \"90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4\",\n \"e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150\"\n ],\n [\n \"8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da\",\n \"662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82\"\n ],\n [\n \"e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11\",\n \"1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc\"\n ],\n [\n \"8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e\",\n \"efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b\"\n ],\n [\n \"e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41\",\n \"2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51\"\n ],\n [\n \"b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef\",\n \"67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45\"\n ],\n [\n \"d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8\",\n \"db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120\"\n ],\n [\n \"324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d\",\n \"648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84\"\n ],\n [\n \"4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96\",\n \"35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d\"\n ],\n [\n \"9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd\",\n \"ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d\"\n ],\n [\n \"6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5\",\n \"9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8\"\n ],\n [\n \"a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266\",\n \"40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8\"\n ],\n [\n \"7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71\",\n \"34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac\"\n ],\n [\n \"928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac\",\n \"c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f\"\n ],\n [\n \"85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751\",\n \"1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962\"\n ],\n [\n \"ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e\",\n \"493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907\"\n ],\n [\n \"827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241\",\n \"c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec\"\n ],\n [\n \"eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3\",\n \"be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d\"\n ],\n [\n \"e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f\",\n \"4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414\"\n ],\n [\n \"1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19\",\n \"aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd\"\n ],\n [\n \"146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be\",\n \"b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0\"\n ],\n [\n \"fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9\",\n \"6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811\"\n ],\n [\n \"da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2\",\n \"8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1\"\n ],\n [\n \"a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13\",\n \"7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c\"\n ],\n [\n \"174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c\",\n \"ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73\"\n ],\n [\n \"959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba\",\n \"2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd\"\n ],\n [\n \"d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151\",\n \"e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405\"\n ],\n [\n \"64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073\",\n \"d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589\"\n ],\n [\n \"8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458\",\n \"38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e\"\n ],\n [\n \"13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b\",\n \"69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27\"\n ],\n [\n \"bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366\",\n \"d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1\"\n ],\n [\n \"8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa\",\n \"40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482\"\n ],\n [\n \"8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0\",\n \"620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945\"\n ],\n [\n \"dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787\",\n \"7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573\"\n ],\n [\n \"f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e\",\n \"ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82\"\n ]\n ]\n },\n naf: {\n wnd: 7,\n points: [\n [\n \"f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9\",\n \"388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672\"\n ],\n [\n \"2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4\",\n \"d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6\"\n ],\n [\n \"5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc\",\n \"6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da\"\n ],\n [\n \"acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe\",\n \"cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37\"\n ],\n [\n \"774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb\",\n \"d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b\"\n ],\n [\n \"f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8\",\n \"ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81\"\n ],\n [\n \"d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e\",\n \"581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58\"\n ],\n [\n \"defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34\",\n \"4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77\"\n ],\n [\n \"2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c\",\n \"85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a\"\n ],\n [\n \"352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5\",\n \"321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c\"\n ],\n [\n \"2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f\",\n \"2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67\"\n ],\n [\n \"9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714\",\n \"73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402\"\n ],\n [\n \"daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729\",\n \"a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55\"\n ],\n [\n \"c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db\",\n \"2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482\"\n ],\n [\n \"6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4\",\n \"e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82\"\n ],\n [\n \"1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5\",\n \"b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396\"\n ],\n [\n \"605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479\",\n \"2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49\"\n ],\n [\n \"62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d\",\n \"80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf\"\n ],\n [\n \"80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f\",\n \"1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a\"\n ],\n [\n \"7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb\",\n \"d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7\"\n ],\n [\n \"d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9\",\n \"eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933\"\n ],\n [\n \"49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963\",\n \"758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a\"\n ],\n [\n \"77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74\",\n \"958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6\"\n ],\n [\n \"f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530\",\n \"e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37\"\n ],\n [\n \"463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b\",\n \"5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e\"\n ],\n [\n \"f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247\",\n \"cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6\"\n ],\n [\n \"caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1\",\n \"cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476\"\n ],\n [\n \"2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120\",\n \"4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40\"\n ],\n [\n \"7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435\",\n \"91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61\"\n ],\n [\n \"754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18\",\n \"673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683\"\n ],\n [\n \"e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8\",\n \"59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5\"\n ],\n [\n \"186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb\",\n \"3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b\"\n ],\n [\n \"df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f\",\n \"55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417\"\n ],\n [\n \"5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143\",\n \"efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868\"\n ],\n [\n \"290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba\",\n \"e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a\"\n ],\n [\n \"af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45\",\n \"f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6\"\n ],\n [\n \"766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a\",\n \"744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996\"\n ],\n [\n \"59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e\",\n \"c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e\"\n ],\n [\n \"f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8\",\n \"e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d\"\n ],\n [\n \"7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c\",\n \"30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2\"\n ],\n [\n \"948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519\",\n \"e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e\"\n ],\n [\n \"7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab\",\n \"100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437\"\n ],\n [\n \"3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca\",\n \"ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311\"\n ],\n [\n \"d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf\",\n \"8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4\"\n ],\n [\n \"1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610\",\n \"68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575\"\n ],\n [\n \"733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4\",\n \"f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d\"\n ],\n [\n \"15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c\",\n \"d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d\"\n ],\n [\n \"a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940\",\n \"edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629\"\n ],\n [\n \"e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980\",\n \"a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06\"\n ],\n [\n \"311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3\",\n \"66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374\"\n ],\n [\n \"34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf\",\n \"9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee\"\n ],\n [\n \"f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63\",\n \"4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1\"\n ],\n [\n \"d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448\",\n \"fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b\"\n ],\n [\n \"32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf\",\n \"5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661\"\n ],\n [\n \"7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5\",\n \"8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6\"\n ],\n [\n \"ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6\",\n \"8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e\"\n ],\n [\n \"16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5\",\n \"5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d\"\n ],\n [\n \"eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99\",\n \"f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc\"\n ],\n [\n \"78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51\",\n \"f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4\"\n ],\n [\n \"494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5\",\n \"42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c\"\n ],\n [\n \"a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5\",\n \"204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b\"\n ],\n [\n \"c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997\",\n \"4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913\"\n ],\n [\n \"841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881\",\n \"73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154\"\n ],\n [\n \"5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5\",\n \"39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865\"\n ],\n [\n \"36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66\",\n \"d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc\"\n ],\n [\n \"336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726\",\n \"ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224\"\n ],\n [\n \"8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede\",\n \"6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e\"\n ],\n [\n \"1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94\",\n \"60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6\"\n ],\n [\n \"85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31\",\n \"3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511\"\n ],\n [\n \"29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51\",\n \"b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b\"\n ],\n [\n \"a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252\",\n \"ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2\"\n ],\n [\n \"4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5\",\n \"cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c\"\n ],\n [\n \"d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b\",\n \"6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3\"\n ],\n [\n \"ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4\",\n \"322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d\"\n ],\n [\n \"af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f\",\n \"6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700\"\n ],\n [\n \"e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889\",\n \"2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4\"\n ],\n [\n \"591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246\",\n \"b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196\"\n ],\n [\n \"11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984\",\n \"998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4\"\n ],\n [\n \"3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a\",\n \"b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257\"\n ],\n [\n \"cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030\",\n \"bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13\"\n ],\n [\n \"c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197\",\n \"6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096\"\n ],\n [\n \"c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593\",\n \"c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38\"\n ],\n [\n \"a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef\",\n \"21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f\"\n ],\n [\n \"347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38\",\n \"60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448\"\n ],\n [\n \"da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a\",\n \"49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a\"\n ],\n [\n \"c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111\",\n \"5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4\"\n ],\n [\n \"4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502\",\n \"7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437\"\n ],\n [\n \"3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea\",\n \"be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7\"\n ],\n [\n \"cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26\",\n \"8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d\"\n ],\n [\n \"b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986\",\n \"39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a\"\n ],\n [\n \"d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e\",\n \"62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54\"\n ],\n [\n \"48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4\",\n \"25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77\"\n ],\n [\n \"dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda\",\n \"ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517\"\n ],\n [\n \"6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859\",\n \"cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10\"\n ],\n [\n \"e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f\",\n \"f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125\"\n ],\n [\n \"eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c\",\n \"6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e\"\n ],\n [\n \"13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942\",\n \"fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1\"\n ],\n [\n \"ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a\",\n \"1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2\"\n ],\n [\n \"b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80\",\n \"5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423\"\n ],\n [\n \"ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d\",\n \"438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8\"\n ],\n [\n \"8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1\",\n \"cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758\"\n ],\n [\n \"52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63\",\n \"c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375\"\n ],\n [\n \"e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352\",\n \"6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d\"\n ],\n [\n \"7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193\",\n \"ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec\"\n ],\n [\n \"5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00\",\n \"9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0\"\n ],\n [\n \"32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58\",\n \"ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c\"\n ],\n [\n \"e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7\",\n \"d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4\"\n ],\n [\n \"8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8\",\n \"c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f\"\n ],\n [\n \"4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e\",\n \"67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649\"\n ],\n [\n \"3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d\",\n \"cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826\"\n ],\n [\n \"674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b\",\n \"299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5\"\n ],\n [\n \"d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f\",\n \"f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87\"\n ],\n [\n \"30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6\",\n \"462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b\"\n ],\n [\n \"be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297\",\n \"62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc\"\n ],\n [\n \"93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a\",\n \"7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c\"\n ],\n [\n \"b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c\",\n \"ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f\"\n ],\n [\n \"d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52\",\n \"4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a\"\n ],\n [\n \"d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb\",\n \"bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46\"\n ],\n [\n \"463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065\",\n \"bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f\"\n ],\n [\n \"7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917\",\n \"603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03\"\n ],\n [\n \"74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9\",\n \"cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08\"\n ],\n [\n \"30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3\",\n \"553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8\"\n ],\n [\n \"9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57\",\n \"712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373\"\n ],\n [\n \"176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66\",\n \"ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3\"\n ],\n [\n \"75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8\",\n \"9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8\"\n ],\n [\n \"809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721\",\n \"9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1\"\n ],\n [\n \"1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180\",\n \"4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9\"\n ]\n ]\n }\n };\n }\n}), require_curves = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curves.js\"(exports) {\n var curves = exports, hash = require_hash2(), curve = require_curve(), utils = require_utils3(), assert = utils.assert;\n function PresetCurve(options) {\n options.type === \"short\" \? this.curve = new curve.short(options) : options.type === \"edwards\" \? this.curve = new curve.edwards(options) : this.curve = new curve.mont(options), this.g = this.curve.g, this.n = this.curve.n, this.hash = options.hash, assert(this.g.validate(), \"Invalid curve\"), assert(this.g.mul(this.n).isInfinity(), \"Invalid curve, G*N != O\");\n }\n PresetCurve.prototype = {}, curves.PresetCurve = PresetCurve;\n function defineCurve(name, options) {\n Object.defineProperty(curves, name, {\n configurable: !0,\n enumerable: !0,\n get: function() {\n var curve2 = new PresetCurve(options);\n return Object.defineProperty(curves, name, {\n configurable: !0,\n enumerable: !0,\n value: curve2\n }), curve2;\n }\n });\n }\n defineCurve(\"p192\", {\n type: \"short\",\n prime: \"p192\",\n p: \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\",\n a: \"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc\",\n b: \"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1\",\n n: \"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012\",\n \"07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811\"\n ]\n }), defineCurve(\"p224\", {\n type: \"short\",\n prime: \"p224\",\n p: \"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\",\n a: \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe\",\n b: \"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4\",\n n: \"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21\",\n \"bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34\"\n ]\n }), defineCurve(\"p256\", {\n type: \"short\",\n prime: null,\n p: \"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff\",\n a: \"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc\",\n b: \"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b\",\n n: \"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296\",\n \"4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5\"\n ]\n }), defineCurve(\"p384\", {\n type: \"short\",\n prime: null,\n p: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff\",\n a: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc\",\n b: \"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef\",\n n: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973\",\n hash: hash.sha384,\n gRed: !1,\n g: [\n \"aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7\",\n \"3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f\"\n ]\n }), defineCurve(\"p521\", {\n type: \"short\",\n prime: null,\n p: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff\",\n a: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc\",\n b: \"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00\",\n n: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409\",\n hash: hash.sha512,\n gRed: !1,\n g: [\n \"000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66\",\n \"00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650\"\n ]\n }), defineCurve(\"curve25519\", {\n type: \"mont\",\n prime: \"p25519\",\n p: \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",\n a: \"76d06\",\n b: \"1\",\n n: \"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",\n hash: hash.sha256,\n gRed: !1,\n g: [\"9\"]\n }), defineCurve(\"ed25519\", {\n type: \"edwards\",\n prime: \"p25519\",\n p: \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",\n a: \"-1\",\n c: \"1\",\n d: \"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3\",\n n: \"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a\",\n \"6666666666666666666666666666666666666666666666666666666666666658\"\n ]\n });\n var pre;\n try {\n pre = require_secp256k1();\n } catch {\n pre = void 0;\n }\n defineCurve(\"secp256k1\", {\n type: \"short\",\n prime: \"k256\",\n p: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\",\n a: \"0\",\n b: \"7\",\n n: \"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141\",\n h: \"1\",\n hash: hash.sha256,\n beta: \"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\",\n lambda: \"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72\",\n basis: [\n {\n a: \"3086d221a7d46bcde86c90e49284eb15\",\n b: \"-e4437ed6010e88286f547fa90abfe4c3\"\n },\n {\n a: \"114ca50f7a8e2f3f657c1108d9d44cfd8\",\n b: \"3086d221a7d46bcde86c90e49284eb15\"\n }\n ],\n gRed: !1,\n g: [\n \"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\",\n \"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n pre\n ]\n });\n }\n}), require_hmac_drbg = __commonJS({\n \"node_modules/hmac-drbg/lib/hmac-drbg.js\"(exports, module) {\n var hash = require_hash2(), utils = require_utils2(), assert = require_minimalistic_assert();\n function HmacDRBG(options) {\n if (!(this instanceof HmacDRBG))\n return new HmacDRBG(options);\n this.hash = options.hash, this.predResist = !!options.predResist, this.outLen = this.hash.outSize, this.minEntropy = options.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null;\n var entropy = utils.toArray(options.entropy, options.entropyEnc || \"hex\"), nonce = utils.toArray(options.nonce, options.nonceEnc || \"hex\"), pers = utils.toArray(options.pers, options.persEnc || \"hex\");\n assert(entropy.length >= this.minEntropy / 8, \"Not enough entropy. Minimum is: \" + this.minEntropy + \" bits\"), this._init(entropy, nonce, pers);\n }\n HmacDRBG.prototype = {}, module.exports = HmacDRBG, HmacDRBG.prototype._init = function(entropy, nonce, pers) {\n var seed = entropy.concat(nonce).concat(pers);\n this.K = new Array(this.outLen / 8), this.V = new Array(this.outLen / 8);\n for (var i = 0;i < this.V.length; i++)\n this.K[i] = 0, this.V[i] = 1;\n this._update(seed), this._reseed = 1, this.reseedInterval = 281474976710656;\n }, HmacDRBG.prototype._hmac = function() {\n return new hash.hmac(this.hash, this.K);\n }, HmacDRBG.prototype._update = function(seed) {\n var kmac = this._hmac().update(this.V).update([0]);\n seed && (kmac = kmac.update(seed)), this.K = kmac.digest(), this.V = this._hmac().update(this.V).digest(), seed && (this.K = this._hmac().update(this.V).update([1]).update(seed).digest(), this.V = this._hmac().update(this.V).digest());\n }, HmacDRBG.prototype.reseed = function(entropy, entropyEnc, add, addEnc) {\n typeof entropyEnc != \"string\" && (addEnc = add, add = entropyEnc, entropyEnc = null), entropy = utils.toArray(entropy, entropyEnc), add = utils.toArray(add, addEnc), assert(entropy.length >= this.minEntropy / 8, \"Not enough entropy. Minimum is: \" + this.minEntropy + \" bits\"), this._update(entropy.concat(add || [])), this._reseed = 1;\n }, HmacDRBG.prototype.generate = function(len, enc, add, addEnc) {\n if (this._reseed > this.reseedInterval)\n throw new Error(\"Reseed is required\");\n typeof enc != \"string\" && (addEnc = add, add = enc, enc = null), add && (add = utils.toArray(add, addEnc || \"hex\"), this._update(add));\n for (var temp = [];temp.length < len; )\n this.V = this._hmac().update(this.V).digest(), temp = temp.concat(this.V);\n var res = temp.slice(0, len);\n return this._update(add), this._reseed++, utils.encode(res, enc);\n };\n }\n}), require_key = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/key.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert;\n function KeyPair(ec, options) {\n this.ec = ec, this.priv = null, this.pub = null, options.priv && this._importPrivate(options.priv, options.privEnc), options.pub && this._importPublic(options.pub, options.pubEnc);\n }\n KeyPair.prototype = {}, module.exports = KeyPair, KeyPair.fromPublic = function(ec, pub, enc) {\n return pub instanceof KeyPair \? pub : new KeyPair(ec, {\n pub,\n pubEnc: enc\n });\n }, KeyPair.fromPrivate = function(ec, priv, enc) {\n return priv instanceof KeyPair \? priv : new KeyPair(ec, {\n priv,\n privEnc: enc\n });\n }, KeyPair.prototype.validate = function() {\n var pub = this.getPublic();\n return pub.isInfinity() \? { result: !1, reason: \"Invalid public key\" } : pub.validate() \? pub.mul(this.ec.curve.n).isInfinity() \? { result: !0, reason: null } : { result: !1, reason: \"Public key * N != O\" } : { result: !1, reason: \"Public key is not a point\" };\n }, KeyPair.prototype.getPublic = function(compact, enc) {\n return typeof compact == \"string\" && (enc = compact, compact = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), enc \? this.pub.encode(enc, compact) : this.pub;\n }, KeyPair.prototype.getPrivate = function(enc) {\n return enc === \"hex\" \? this.priv.toString(16, 2) : this.priv;\n }, KeyPair.prototype._importPrivate = function(key, enc) {\n this.priv = new BN(key, enc || 16), this.priv = this.priv.umod(this.ec.curve.n);\n }, KeyPair.prototype._importPublic = function(key, enc) {\n if (key.x || key.y) {\n this.ec.curve.type === \"mont\" \? assert(key.x, \"Need x coordinate\") : (this.ec.curve.type === \"short\" || this.ec.curve.type === \"edwards\") && assert(key.x && key.y, \"Need both x and y coordinate\"), this.pub = this.ec.curve.point(key.x, key.y);\n return;\n }\n this.pub = this.ec.curve.decodePoint(key, enc);\n }, KeyPair.prototype.derive = function(pub) {\n return pub.validate() || assert(pub.validate(), \"public point not validated\"), pub.mul(this.priv).getX();\n }, KeyPair.prototype.sign = function(msg, enc, options) {\n return this.ec.sign(msg, this, enc, options);\n }, KeyPair.prototype.verify = function(msg, signature) {\n return this.ec.verify(msg, signature, this);\n }, KeyPair.prototype.inspect = function() {\n return \"<Key priv: \" + (this.priv && this.priv.toString(16, 2)) + \" pub: \" + (this.pub && this.pub.inspect()) + \" >\";\n };\n }\n}), require_signature = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/signature.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert;\n function Signature(options, enc) {\n if (options instanceof Signature)\n return options;\n this._importDER(options, enc) || (assert(options.r && options.s, \"Signature without r or s\"), this.r = new BN(options.r, 16), this.s = new BN(options.s, 16), options.recoveryParam === void 0 \? this.recoveryParam = null : this.recoveryParam = options.recoveryParam);\n }\n Signature.prototype = {}, module.exports = Signature;\n function Position() {\n this.place = 0;\n }\n function getLength(buf, p) {\n var initial = buf[p.place++];\n if (!(initial & 128))\n return initial;\n var octetLen = initial & 15;\n if (octetLen === 0 || octetLen > 4)\n return !1;\n for (var val = 0, i = 0, off = p.place;i < octetLen; i++, off++)\n val <<= 8, val |= buf[off], val >>>= 0;\n return val <= 127 \? !1 : (p.place = off, val);\n }\n function rmPadding(buf) {\n for (var i = 0, len = buf.length - 1;!buf[i] && !(buf[i + 1] & 128) && i < len; )\n i++;\n return i === 0 \? buf : buf.slice(i);\n }\n Signature.prototype._importDER = function(data, enc) {\n data = utils.toArray(data, enc);\n var p = new Position;\n if (data[p.place++] !== 48)\n return !1;\n var len = getLength(data, p);\n if (len === !1 || len + p.place !== data.length || data[p.place++] !== 2)\n return !1;\n var rlen = getLength(data, p);\n if (rlen === !1)\n return !1;\n var r = data.slice(p.place, rlen + p.place);\n if (p.place += rlen, data[p.place++] !== 2)\n return !1;\n var slen = getLength(data, p);\n if (slen === !1 || data.length !== slen + p.place)\n return !1;\n var s = data.slice(p.place, slen + p.place);\n if (r[0] === 0)\n if (r[1] & 128)\n r = r.slice(1);\n else\n return !1;\n if (s[0] === 0)\n if (s[1] & 128)\n s = s.slice(1);\n else\n return !1;\n return this.r = new BN(r), this.s = new BN(s), this.recoveryParam = null, !0;\n };\n function constructLength(arr, len) {\n if (len < 128) {\n arr.push(len);\n return;\n }\n var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n for (arr.push(octets | 128);--octets; )\n arr.push(len >>> (octets << 3) & 255);\n arr.push(len);\n }\n Signature.prototype.toDER = function(enc) {\n var r = this.r.toArray(), s = this.s.toArray();\n for (r[0] & 128 && (r = [0].concat(r)), s[0] & 128 && (s = [0].concat(s)), r = rmPadding(r), s = rmPadding(s);!s[0] && !(s[1] & 128); )\n s = s.slice(1);\n var arr = [2];\n constructLength(arr, r.length), arr = arr.concat(r), arr.push(2), constructLength(arr, s.length);\n var backHalf = arr.concat(s), res = [48];\n return constructLength(res, backHalf.length), res = res.concat(backHalf), utils.encode(res, enc);\n };\n }\n}), require_ec = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/index.js\"(exports, module) {\n var BN = require_bn4(), HmacDRBG = require_hmac_drbg(), utils = require_utils3(), curves = require_curves(), rand = require_brorand(), assert = utils.assert, KeyPair = require_key(), Signature = require_signature();\n function EC(options) {\n if (!(this instanceof EC))\n return new EC(options);\n typeof options == \"string\" && (assert(Object.prototype.hasOwnProperty.call(curves, options), \"Unknown curve \" + options), options = curves[options]), options instanceof curves.PresetCurve && (options = { curve: options }), this.curve = options.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = options.curve.g, this.g.precompute(options.curve.n.bitLength() + 1), this.hash = options.hash || options.curve.hash;\n }\n EC.prototype = {}, module.exports = EC, EC.prototype.keyPair = function(options) {\n return new KeyPair(this, options);\n }, EC.prototype.keyFromPrivate = function(priv, enc) {\n return KeyPair.fromPrivate(this, priv, enc);\n }, EC.prototype.keyFromPublic = function(pub, enc) {\n return KeyPair.fromPublic(this, pub, enc);\n }, EC.prototype.genKeyPair = function(options) {\n options || (options = {});\n for (var drbg = new HmacDRBG({\n hash: this.hash,\n pers: options.pers,\n persEnc: options.persEnc || \"utf8\",\n entropy: options.entropy || rand(this.hash.hmacStrength),\n entropyEnc: options.entropy && options.entropyEnc || \"utf8\",\n nonce: this.n.toArray()\n }), bytes = this.n.byteLength(), ns2 = this.n.sub(new BN(2));; ) {\n var priv = new BN(drbg.generate(bytes));\n if (!(priv.cmp(ns2) > 0))\n return priv.iaddn(1), this.keyFromPrivate(priv);\n }\n }, EC.prototype._truncateToN = function(msg, truncOnly) {\n var delta = msg.byteLength() * 8 - this.n.bitLength();\n return delta > 0 && (msg = msg.ushrn(delta)), !truncOnly && msg.cmp(this.n) >= 0 \? msg.sub(this.n) : msg;\n }, EC.prototype.sign = function(msg, key, enc, options) {\n typeof enc == \"object\" && (options = enc, enc = null), options || (options = {}), key = this.keyFromPrivate(key, enc), msg = this._truncateToN(new BN(msg, 16));\n for (var bytes = this.n.byteLength(), bkey = key.getPrivate().toArray(\"be\", bytes), nonce = msg.toArray(\"be\", bytes), drbg = new HmacDRBG({\n hash: this.hash,\n entropy: bkey,\n nonce,\n pers: options.pers,\n persEnc: options.persEnc || \"utf8\"\n }), ns1 = this.n.sub(new BN(1)), iter = 0;; iter++) {\n var k = options.k \? options.k(iter) : new BN(drbg.generate(this.n.byteLength()));\n if (k = this._truncateToN(k, !0), !(k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)) {\n var kp = this.g.mul(k);\n if (!kp.isInfinity()) {\n var kpX = kp.getX(), r = kpX.umod(this.n);\n if (r.cmpn(0) !== 0) {\n var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));\n if (s = s.umod(this.n), s.cmpn(0) !== 0) {\n var recoveryParam = (kp.getY().isOdd() \? 1 : 0) | (kpX.cmp(r) !== 0 \? 2 : 0);\n return options.canonical && s.cmp(this.nh) > 0 && (s = this.n.sub(s), recoveryParam ^= 1), new Signature({ r, s, recoveryParam });\n }\n }\n }\n }\n }\n }, EC.prototype.verify = function(msg, signature, key, enc) {\n msg = this._truncateToN(new BN(msg, 16)), key = this.keyFromPublic(key, enc), signature = new Signature(signature, \"hex\");\n var { r, s } = signature;\n if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0 || s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n return !1;\n var sinv = s.invm(this.n), u1 = sinv.mul(msg).umod(this.n), u2 = sinv.mul(r).umod(this.n), p;\n return this.curve._maxwellTrick \? (p = this.g.jmulAdd(u1, key.getPublic(), u2), p.isInfinity() \? !1 : p.eqXToP(r)) : (p = this.g.mulAdd(u1, key.getPublic(), u2), p.isInfinity() \? !1 : p.getX().umod(this.n).cmp(r) === 0);\n }, EC.prototype.recoverPubKey = function(msg, signature, j, enc) {\n assert((3 & j) === j, \"The recovery param is more than two bits\"), signature = new Signature(signature, enc);\n var n = this.n, e = new BN(msg), r = signature.r, s = signature.s, isYOdd = j & 1, isSecondKey = j >> 1;\n if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n throw new Error(\"Unable to find sencond key candinate\");\n isSecondKey \? r = this.curve.pointFromX(r.add(this.curve.n), isYOdd) : r = this.curve.pointFromX(r, isYOdd);\n var rInv = signature.r.invm(n), s1 = n.sub(e).mul(rInv).umod(n), s2 = s.mul(rInv).umod(n);\n return this.g.mulAdd(s1, r, s2);\n }, EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {\n if (signature = new Signature(signature, enc), signature.recoveryParam !== null)\n return signature.recoveryParam;\n for (var i = 0;i < 4; i++) {\n var Qprime;\n try {\n Qprime = this.recoverPubKey(e, signature, i);\n } catch {\n continue;\n }\n if (Qprime.eq(Q))\n return i;\n }\n throw new Error(\"Unable to find valid recovery factor\");\n };\n }\n}), require_key2 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/key.js\"(exports, module) {\n var utils = require_utils3(), assert = utils.assert, parseBytes = utils.parseBytes, cachedProperty = utils.cachedProperty;\n function KeyPair(eddsa, params) {\n this.eddsa = eddsa, this._secret = parseBytes(params.secret), eddsa.isPoint(params.pub) \? this._pub = params.pub : this._pubBytes = parseBytes(params.pub);\n }\n KeyPair.prototype = {}, KeyPair.fromPublic = function(eddsa, pub) {\n return pub instanceof KeyPair \? pub : new KeyPair(eddsa, { pub });\n }, KeyPair.fromSecret = function(eddsa, secret) {\n return secret instanceof KeyPair \? secret : new KeyPair(eddsa, { secret });\n }, KeyPair.prototype.secret = function() {\n return this._secret;\n }, cachedProperty(KeyPair, \"pubBytes\", function() {\n return this.eddsa.encodePoint(this.pub());\n }), cachedProperty(KeyPair, \"pub\", function() {\n return this._pubBytes \? this.eddsa.decodePoint(this._pubBytes) : this.eddsa.g.mul(this.priv());\n }), cachedProperty(KeyPair, \"privBytes\", function() {\n var eddsa = this.eddsa, hash = this.hash(), lastIx = eddsa.encodingLength - 1, a = hash.slice(0, eddsa.encodingLength);\n return a[0] &= 248, a[lastIx] &= 127, a[lastIx] |= 64, a;\n }), cachedProperty(KeyPair, \"priv\", function() {\n return this.eddsa.decodeInt(this.privBytes());\n }), cachedProperty(KeyPair, \"hash\", function() {\n return this.eddsa.hash().update(this.secret()).digest();\n }), cachedProperty(KeyPair, \"messagePrefix\", function() {\n return this.hash().slice(this.eddsa.encodingLength);\n }), KeyPair.prototype.sign = function(message) {\n return assert(this._secret, \"KeyPair can only verify\"), this.eddsa.sign(message, this);\n }, KeyPair.prototype.verify = function(message, sig) {\n return this.eddsa.verify(message, sig, this);\n }, KeyPair.prototype.getSecret = function(enc) {\n return assert(this._secret, \"KeyPair is public only\"), utils.encode(this.secret(), enc);\n }, KeyPair.prototype.getPublic = function(enc) {\n return utils.encode(this.pubBytes(), enc);\n }, module.exports = KeyPair;\n }\n}), require_signature2 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/signature.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert, cachedProperty = utils.cachedProperty, parseBytes = utils.parseBytes;\n function Signature(eddsa, sig) {\n this.eddsa = eddsa, typeof sig != \"object\" && (sig = parseBytes(sig)), Array.isArray(sig) && (sig = {\n R: sig.slice(0, eddsa.encodingLength),\n S: sig.slice(eddsa.encodingLength)\n }), assert(sig.R && sig.S, \"Signature without R or S\"), eddsa.isPoint(sig.R) && (this._R = sig.R), sig.S instanceof BN && (this._S = sig.S), this._Rencoded = Array.isArray(sig.R) \? sig.R : sig.Rencoded, this._Sencoded = Array.isArray(sig.S) \? sig.S : sig.Sencoded;\n }\n Signature.prototype = {}, cachedProperty(Signature, \"S\", function() {\n return this.eddsa.decodeInt(this.Sencoded());\n }), cachedProperty(Signature, \"R\", function() {\n return this.eddsa.decodePoint(this.Rencoded());\n }), cachedProperty(Signature, \"Rencoded\", function() {\n return this.eddsa.encodePoint(this.R());\n }), cachedProperty(Signature, \"Sencoded\", function() {\n return this.eddsa.encodeInt(this.S());\n }), Signature.prototype.toBytes = function() {\n return this.Rencoded().concat(this.Sencoded());\n }, Signature.prototype.toHex = function() {\n return utils.encode(this.toBytes(), \"hex\").toUpperCase();\n }, module.exports = Signature;\n }\n}), require_eddsa = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/index.js\"(exports, module) {\n var hash = require_hash2(), curves = require_curves(), utils = require_utils3(), assert = utils.assert, parseBytes = utils.parseBytes, KeyPair = require_key2(), Signature = require_signature2();\n function EDDSA(curve) {\n if (assert(curve === \"ed25519\", \"only tested with ed25519 so far\"), !(this instanceof EDDSA))\n return new EDDSA(curve);\n curve = curves[curve].curve, this.curve = curve, this.g = curve.g, this.g.precompute(curve.n.bitLength() + 1), this.pointClass = curve.point().constructor, this.encodingLength = Math.ceil(curve.n.bitLength() / 8), this.hash = hash.sha512;\n }\n EDDSA.prototype = {}, module.exports = EDDSA, EDDSA.prototype.sign = function(message, secret) {\n message = parseBytes(message);\n var key = this.keyFromSecret(secret), r = this.hashInt(key.messagePrefix(), message), R = this.g.mul(r), Rencoded = this.encodePoint(R), s_ = this.hashInt(Rencoded, key.pubBytes(), message).mul(key.priv()), S = r.add(s_).umod(this.curve.n);\n return this.makeSignature({ R, S, Rencoded });\n }, EDDSA.prototype.verify = function(message, sig, pub) {\n message = parseBytes(message), sig = this.makeSignature(sig);\n var key = this.keyFromPublic(pub), h = this.hashInt(sig.Rencoded(), key.pubBytes(), message), SG = this.g.mul(sig.S()), RplusAh = sig.R().add(key.pub().mul(h));\n return RplusAh.eq(SG);\n }, EDDSA.prototype.hashInt = function() {\n for (var hash2 = this.hash(), i = 0;i < arguments.length; i++)\n hash2.update(arguments[i]);\n return utils.intFromLE(hash2.digest()).umod(this.curve.n);\n }, EDDSA.prototype.keyFromPublic = function(pub) {\n return KeyPair.fromPublic(this, pub);\n }, EDDSA.prototype.keyFromSecret = function(secret) {\n return KeyPair.fromSecret(this, secret);\n }, EDDSA.prototype.makeSignature = function(sig) {\n return sig instanceof Signature \? sig : new Signature(this, sig);\n }, EDDSA.prototype.encodePoint = function(point) {\n var enc = point.getY().toArray(\"le\", this.encodingLength);\n return enc[this.encodingLength - 1] |= point.getX().isOdd() \? 128 : 0, enc;\n }, EDDSA.prototype.decodePoint = function(bytes) {\n bytes = utils.parseBytes(bytes);\n var lastIx = bytes.length - 1, normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & -129), xIsOdd = (bytes[lastIx] & 128) !== 0, y = utils.intFromLE(normed);\n return this.curve.pointFromY(y, xIsOdd);\n }, EDDSA.prototype.encodeInt = function(num) {\n return num.toArray(\"le\", this.encodingLength);\n }, EDDSA.prototype.decodeInt = function(bytes) {\n return utils.intFromLE(bytes);\n }, EDDSA.prototype.isPoint = function(val) {\n return val instanceof this.pointClass;\n };\n }\n}), require_elliptic = __commonJS({\n \"node_modules/elliptic/lib/elliptic.js\"(exports) {\n var elliptic = exports;\n elliptic.version = require_package().version, elliptic.utils = require_utils3(), elliptic.rand = require_brorand(), elliptic.curve = require_curve(), elliptic.curves = require_curves(), elliptic.ec = require_ec(), elliptic.eddsa = require_eddsa();\n }\n}), require_bn5 = require_bn, require_safer = __commonJS({\n \"node_modules/safer-buffer/safer.js\"(exports, module) {\n var buffer = BufferModule, Buffer2 = Buffer, safer = {}, key;\n for (key in buffer)\n !buffer.hasOwnProperty(key) || key === \"SlowBuffer\" || key === \"Buffer\" || (safer[key] = buffer[key]);\n var Safer = safer.Buffer = {};\n for (key in Buffer2)\n !Buffer2.hasOwnProperty(key) || key === \"allocUnsafe\" || key === \"allocUnsafeSlow\" || (Safer[key] = Buffer2[key]);\n if (safer.Buffer.prototype = Buffer2.prototype, (!Safer.from || Safer.from === Uint8Array.from) && (Safer.from = function(value, encodingOrOffset, length) {\n if (typeof value == \"number\")\n @throwTypeError('The \"value\" argument must not be of type number. Received type ' + typeof value);\n if (value && typeof value.length > \"u\")\n @throwTypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \" + typeof value);\n return Buffer2(value, encodingOrOffset, length);\n }), Safer.alloc || (Safer.alloc = function(size, fill, encoding) {\n if (typeof size != \"number\")\n @throwTypeError('The \"size\" argument must be of type number. Received type ' + typeof size);\n if (size < 0 || size >= 2 * (1 << 30))\n @throwRangeError('The value \"' + size + '\" is invalid for option \"size\"');\n var buf = Buffer2(size);\n return !fill || fill.length === 0 \? buf.fill(0) : typeof encoding == \"string\" \? buf.fill(fill, encoding) : buf.fill(fill), buf;\n }), !safer.kStringMaxLength)\n try {\n safer.kStringMaxLength = MAX_STRING_LENGTH;\n } catch {\n }\n safer.constants || (safer.constants = {\n MAX_LENGTH: safer.kMaxLength\n }, safer.kStringMaxLength && (safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength)), module.exports = safer;\n }\n}), require_reporter = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/reporter.js\"(exports) {\n var inherits = require_inherits_browser();\n function Reporter(options) {\n this._reporterState = {\n obj: null,\n path: [],\n options: options || {},\n errors: []\n };\n }\n Reporter.prototype = {}, exports.Reporter = Reporter, Reporter.prototype.isError = function(obj) {\n return obj instanceof ReporterError;\n }, Reporter.prototype.save = function() {\n let state = this._reporterState;\n return { obj: state.obj, pathLen: state.path.length };\n }, Reporter.prototype.restore = function(data) {\n let state = this._reporterState;\n state.obj = data.obj, state.path = state.path.slice(0, data.pathLen);\n }, Reporter.prototype.enterKey = function(key) {\n return this._reporterState.path.push(key);\n }, Reporter.prototype.exitKey = function(index) {\n let state = this._reporterState;\n state.path = state.path.slice(0, index - 1);\n }, Reporter.prototype.leaveKey = function(index, key, value) {\n let state = this._reporterState;\n this.exitKey(index), state.obj !== null && (state.obj[key] = value);\n }, Reporter.prototype.path = function() {\n return this._reporterState.path.join(\"/\");\n }, Reporter.prototype.enterObject = function() {\n let state = this._reporterState, prev = state.obj;\n return state.obj = {}, prev;\n }, Reporter.prototype.leaveObject = function(prev) {\n let state = this._reporterState, now = state.obj;\n return state.obj = prev, now;\n }, Reporter.prototype.error = function(msg) {\n let err, state = this._reporterState, inherited = msg instanceof ReporterError;\n if (inherited \? err = msg : err = new ReporterError(state.path.map(function(elem) {\n return \"[\" + JSON.stringify(elem) + \"]\";\n }).join(\"\"), msg.message || msg, msg.stack), !state.options.partial)\n throw err;\n return inherited || state.errors.push(err), err;\n }, Reporter.prototype.wrapResult = function(result) {\n let state = this._reporterState;\n return state.options.partial \? {\n result: this.isError(result) \? null : result,\n errors: state.errors\n } : result;\n };\n function ReporterError(path, msg) {\n this.path = path, this.rethrow(msg);\n }\n inherits(ReporterError, Error), ReporterError.prototype.rethrow = function(msg) {\n if (this.message = msg + \" at: \" + (this.path || \"(shallow)\"), Error.captureStackTrace && Error.captureStackTrace(this, ReporterError), !this.stack)\n try {\n throw new Error(this.message);\n } catch (e) {\n this.stack = e.stack;\n }\n return this;\n };\n }\n}), require_buffer = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/buffer.js\"(exports) {\n var inherits = require_inherits_browser(), Reporter = require_reporter().Reporter, Buffer2 = require_safer().Buffer;\n function DecoderBuffer(base, options) {\n if (Reporter.call(this, options), !Buffer2.isBuffer(base)) {\n this.error(\"Input not Buffer\");\n return;\n }\n this.base = base, this.offset = 0, this.length = base.length;\n }\n inherits(DecoderBuffer, Reporter), exports.DecoderBuffer = DecoderBuffer, DecoderBuffer.isDecoderBuffer = function(data) {\n return data instanceof DecoderBuffer \? !0 : typeof data == \"object\" && Buffer2.isBuffer(data.base) && data.constructor.name === \"DecoderBuffer\" && typeof data.offset == \"number\" && typeof data.length == \"number\" && typeof data.save == \"function\" && typeof data.restore == \"function\" && typeof data.isEmpty == \"function\" && typeof data.readUInt8 == \"function\" && typeof data.skip == \"function\" && typeof data.raw == \"function\";\n }, DecoderBuffer.prototype.save = function() {\n return {\n offset: this.offset,\n reporter: Reporter.prototype.save.call(this)\n };\n }, DecoderBuffer.prototype.restore = function(save) {\n let res = new DecoderBuffer(this.base);\n return res.offset = save.offset, res.length = this.offset, this.offset = save.offset, Reporter.prototype.restore.call(this, save.reporter), res;\n }, DecoderBuffer.prototype.isEmpty = function() {\n return this.offset === this.length;\n }, DecoderBuffer.prototype.readUInt8 = function(fail) {\n return this.offset + 1 <= this.length \? this.base.readUInt8(this.offset++, !0) : this.error(fail || \"DecoderBuffer overrun\");\n }, DecoderBuffer.prototype.skip = function(bytes, fail) {\n if (!(this.offset + bytes <= this.length))\n return this.error(fail || \"DecoderBuffer overrun\");\n let res = new DecoderBuffer(this.base);\n return res._reporterState = this._reporterState, res.offset = this.offset, res.length = this.offset + bytes, this.offset += bytes, res;\n }, DecoderBuffer.prototype.raw = function(save) {\n return this.base.slice(save \? save.offset : this.offset, this.length);\n };\n function EncoderBuffer(value, reporter) {\n if (Array.isArray(value))\n this.length = 0, this.value = value.map(function(item) {\n return EncoderBuffer.isEncoderBuffer(item) || (item = new EncoderBuffer(item, reporter)), this.length += item.length, item;\n }, this);\n else if (typeof value == \"number\") {\n if (!(0 <= value && value <= 255))\n return reporter.error(\"non-byte EncoderBuffer value\");\n this.value = value, this.length = 1;\n } else if (typeof value == \"string\")\n this.value = value, this.length = Buffer2.byteLength(value);\n else if (Buffer2.isBuffer(value))\n this.value = value, this.length = value.length;\n else\n return reporter.error(\"Unsupported type: \" + typeof value);\n }\n EncoderBuffer.prototype = {}, exports.EncoderBuffer = EncoderBuffer, EncoderBuffer.isEncoderBuffer = function(data) {\n return data instanceof EncoderBuffer \? !0 : typeof data == \"object\" && data.constructor.name === \"EncoderBuffer\" && typeof data.length == \"number\" && typeof data.join == \"function\";\n }, EncoderBuffer.prototype.join = function(out, offset) {\n return out || (out = Buffer2.alloc(this.length)), offset || (offset = 0), this.length === 0 || (Array.isArray(this.value) \? this.value.forEach(function(item) {\n item.join(out, offset), offset += item.length;\n }) : (typeof this.value == \"number\" \? out[offset] = this.value : typeof this.value == \"string\" \? out.write(this.value, offset) : Buffer2.isBuffer(this.value) && this.value.copy(out, offset), offset += this.length)), out;\n };\n }\n}), require_node = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/node.js\"(exports, module) {\n var Reporter = require_reporter().Reporter, EncoderBuffer = require_buffer().EncoderBuffer, DecoderBuffer = require_buffer().DecoderBuffer, assert = require_minimalistic_assert(), tags = [\n \"seq\",\n \"seqof\",\n \"set\",\n \"setof\",\n \"objid\",\n \"bool\",\n \"gentime\",\n \"utctime\",\n \"null_\",\n \"enum\",\n \"int\",\n \"objDesc\",\n \"bitstr\",\n \"bmpstr\",\n \"charstr\",\n \"genstr\",\n \"graphstr\",\n \"ia5str\",\n \"iso646str\",\n \"numstr\",\n \"octstr\",\n \"printstr\",\n \"t61str\",\n \"unistr\",\n \"utf8str\",\n \"videostr\"\n ], methods = [\"key\", \"obj\", \"use\", \"optional\", \"explicit\", \"implicit\", \"def\", \"choice\", \"any\", \"contains\"].concat(tags), overrided = [\n \"_peekTag\",\n \"_decodeTag\",\n \"_use\",\n \"_decodeStr\",\n \"_decodeObjid\",\n \"_decodeTime\",\n \"_decodeNull\",\n \"_decodeInt\",\n \"_decodeBool\",\n \"_decodeList\",\n \"_encodeComposite\",\n \"_encodeStr\",\n \"_encodeObjid\",\n \"_encodeTime\",\n \"_encodeNull\",\n \"_encodeInt\",\n \"_encodeBool\"\n ];\n function Node(enc, parent, name) {\n let state = {};\n this._baseState = state, state.name = name, state.enc = enc, state.parent = parent || null, state.children = null, state.tag = null, state.args = null, state.reverseArgs = null, state.choice = null, state.optional = !1, state.any = !1, state.obj = !1, state.use = null, state.useDecoder = null, state.key = null, state.default = null, state.explicit = null, state.implicit = null, state.contains = null, state.parent || (state.children = [], this._wrap());\n }\n Node.prototype = {}, module.exports = Node;\n var stateProps = [\n \"enc\",\n \"parent\",\n \"children\",\n \"tag\",\n \"args\",\n \"reverseArgs\",\n \"choice\",\n \"optional\",\n \"any\",\n \"obj\",\n \"use\",\n \"alteredUse\",\n \"key\",\n \"default\",\n \"explicit\",\n \"implicit\",\n \"contains\"\n ];\n Node.prototype.clone = function() {\n let state = this._baseState, cstate = {};\n stateProps.forEach(function(prop) {\n cstate[prop] = state[prop];\n });\n let res = new this.constructor(cstate.parent);\n return res._baseState = cstate, res;\n }, Node.prototype._wrap = function() {\n let state = this._baseState;\n methods.forEach(function(method) {\n this[method] = function() {\n let clone = new this.constructor(this);\n return state.children.push(clone), clone[method].apply(clone, arguments);\n };\n }, this);\n }, Node.prototype._init = function(body) {\n let state = this._baseState;\n assert(state.parent === null), body.call(this), state.children = state.children.filter(function(child) {\n return child._baseState.parent === this;\n }, this), assert.equal(state.children.length, 1, \"Root node can have only one child\");\n }, Node.prototype._useArgs = function(args) {\n let state = this._baseState, children = args.filter(function(arg) {\n return arg instanceof this.constructor;\n }, this);\n args = args.filter(function(arg) {\n return !(arg instanceof this.constructor);\n }, this), children.length !== 0 && (assert(state.children === null), state.children = children, children.forEach(function(child) {\n child._baseState.parent = this;\n }, this)), args.length !== 0 && (assert(state.args === null), state.args = args, state.reverseArgs = args.map(function(arg) {\n if (typeof arg != \"object\" || arg.constructor !== Object)\n return arg;\n let res = {};\n return Object.keys(arg).forEach(function(key) {\n key == (key | 0) && (key |= 0);\n let value = arg[key];\n res[value] = key;\n }), res;\n }));\n }, overrided.forEach(function(method) {\n Node.prototype[method] = function() {\n let state = this._baseState;\n throw new Error(method + \" not implemented for encoding: \" + state.enc);\n };\n }), tags.forEach(function(tag) {\n Node.prototype[tag] = function() {\n let state = this._baseState, args = Array.prototype.slice.call(arguments);\n return assert(state.tag === null), state.tag = tag, this._useArgs(args), this;\n };\n }), Node.prototype.use = function(item) {\n assert(item);\n let state = this._baseState;\n return assert(state.use === null), state.use = item, this;\n }, Node.prototype.optional = function() {\n let state = this._baseState;\n return state.optional = !0, this;\n }, Node.prototype.def = function(val) {\n let state = this._baseState;\n return assert(state.default === null), state.default = val, state.optional = !0, this;\n }, Node.prototype.explicit = function(num) {\n let state = this._baseState;\n return assert(state.explicit === null && state.implicit === null), state.explicit = num, this;\n }, Node.prototype.implicit = function(num) {\n let state = this._baseState;\n return assert(state.explicit === null && state.implicit === null), state.implicit = num, this;\n }, Node.prototype.obj = function() {\n let state = this._baseState, args = Array.prototype.slice.call(arguments);\n return state.obj = !0, args.length !== 0 && this._useArgs(args), this;\n }, Node.prototype.key = function(newKey) {\n let state = this._baseState;\n return assert(state.key === null), state.key = newKey, this;\n }, Node.prototype.any = function() {\n let state = this._baseState;\n return state.any = !0, this;\n }, Node.prototype.choice = function(obj) {\n let state = this._baseState;\n return assert(state.choice === null), state.choice = obj, this._useArgs(Object.keys(obj).map(function(key) {\n return obj[key];\n })), this;\n }, Node.prototype.contains = function(item) {\n let state = this._baseState;\n return assert(state.use === null), state.contains = item, this;\n }, Node.prototype._decode = function(input, options) {\n let state = this._baseState;\n if (state.parent === null)\n return input.wrapResult(state.children[0]._decode(input, options));\n let result = state.default, present = !0, prevKey = null;\n if (state.key !== null && (prevKey = input.enterKey(state.key)), state.optional) {\n let tag = null;\n if (state.explicit !== null \? tag = state.explicit : state.implicit !== null \? tag = state.implicit : state.tag !== null && (tag = state.tag), tag === null && !state.any) {\n let save = input.save();\n try {\n state.choice === null \? this._decodeGeneric(state.tag, input, options) : this._decodeChoice(input, options), present = !0;\n } catch {\n present = !1;\n }\n input.restore(save);\n } else if (present = this._peekTag(input, tag, state.any), input.isError(present))\n return present;\n }\n let prevObj;\n if (state.obj && present && (prevObj = input.enterObject()), present) {\n if (state.explicit !== null) {\n let explicit = this._decodeTag(input, state.explicit);\n if (input.isError(explicit))\n return explicit;\n input = explicit;\n }\n let start = input.offset;\n if (state.use === null && state.choice === null) {\n let save;\n state.any && (save = input.save());\n let body = this._decodeTag(input, state.implicit !== null \? state.implicit : state.tag, state.any);\n if (input.isError(body))\n return body;\n state.any \? result = input.raw(save) : input = body;\n }\n if (options && options.track && state.tag !== null && options.track(input.path(), start, input.length, \"tagged\"), options && options.track && state.tag !== null && options.track(input.path(), input.offset, input.length, \"content\"), state.any || (state.choice === null \? result = this._decodeGeneric(state.tag, input, options) : result = this._decodeChoice(input, options)), input.isError(result))\n return result;\n if (!state.any && state.choice === null && state.children !== null && state.children.forEach(function(child) {\n child._decode(input, options);\n }), state.contains && (state.tag === \"octstr\" || state.tag === \"bitstr\")) {\n let data = new DecoderBuffer(result);\n result = this._getUse(state.contains, input._reporterState.obj)._decode(data, options);\n }\n }\n return state.obj && present && (result = input.leaveObject(prevObj)), state.key !== null && (result !== null || present === !0) \? input.leaveKey(prevKey, state.key, result) : prevKey !== null && input.exitKey(prevKey), result;\n }, Node.prototype._decodeGeneric = function(tag, input, options) {\n let state = this._baseState;\n return tag === \"seq\" || tag === \"set\" \? null : tag === \"seqof\" || tag === \"setof\" \? this._decodeList(input, tag, state.args[0], options) : /str$/.test(tag) \? this._decodeStr(input, tag, options) : tag === \"objid\" && state.args \? this._decodeObjid(input, state.args[0], state.args[1], options) : tag === \"objid\" \? this._decodeObjid(input, null, null, options) : tag === \"gentime\" || tag === \"utctime\" \? this._decodeTime(input, tag, options) : tag === \"null_\" \? this._decodeNull(input, options) : tag === \"bool\" \? this._decodeBool(input, options) : tag === \"objDesc\" \? this._decodeStr(input, tag, options) : tag === \"int\" || tag === \"enum\" \? this._decodeInt(input, state.args && state.args[0], options) : state.use !== null \? this._getUse(state.use, input._reporterState.obj)._decode(input, options) : input.error(\"unknown tag: \" + tag);\n }, Node.prototype._getUse = function(entity, obj) {\n let state = this._baseState;\n return state.useDecoder = this._use(entity, obj), assert(state.useDecoder._baseState.parent === null), state.useDecoder = state.useDecoder._baseState.children[0], state.implicit !== state.useDecoder._baseState.implicit && (state.useDecoder = state.useDecoder.clone(), state.useDecoder._baseState.implicit = state.implicit), state.useDecoder;\n }, Node.prototype._decodeChoice = function(input, options) {\n let state = this._baseState, result = null, match = !1;\n return Object.keys(state.choice).some(function(key) {\n let save = input.save(), node = state.choice[key];\n try {\n let value = node._decode(input, options);\n if (input.isError(value))\n return !1;\n result = { type: key, value }, match = !0;\n } catch {\n return input.restore(save), !1;\n }\n return !0;\n }, this), match \? result : input.error(\"Choice not matched\");\n }, Node.prototype._createEncoderBuffer = function(data) {\n return new EncoderBuffer(data, this.reporter);\n }, Node.prototype._encode = function(data, reporter, parent) {\n let state = this._baseState;\n if (state.default !== null && state.default === data)\n return;\n let result = this._encodeValue(data, reporter, parent);\n if (result !== void 0 && !this._skipDefault(result, reporter, parent))\n return result;\n }, Node.prototype._encodeValue = function(data, reporter, parent) {\n let state = this._baseState;\n if (state.parent === null)\n return state.children[0]._encode(data, reporter || new Reporter);\n let result = null;\n if (this.reporter = reporter, state.optional && data === void 0)\n if (state.default !== null)\n data = state.default;\n else\n return;\n let content = null, primitive = !1;\n if (state.any)\n result = this._createEncoderBuffer(data);\n else if (state.choice)\n result = this._encodeChoice(data, reporter);\n else if (state.contains)\n content = this._getUse(state.contains, parent)._encode(data, reporter), primitive = !0;\n else if (state.children)\n content = state.children.map(function(child) {\n if (child._baseState.tag === \"null_\")\n return child._encode(null, reporter, data);\n if (child._baseState.key === null)\n return reporter.error(\"Child should have a key\");\n let prevKey = reporter.enterKey(child._baseState.key);\n if (typeof data != \"object\")\n return reporter.error(\"Child expected, but input is not object\");\n let res = child._encode(data[child._baseState.key], reporter, data);\n return reporter.leaveKey(prevKey), res;\n }, this).filter(function(child) {\n return child;\n }), content = this._createEncoderBuffer(content);\n else if (state.tag === \"seqof\" || state.tag === \"setof\") {\n if (!(state.args && state.args.length === 1))\n return reporter.error(\"Too many args for : \" + state.tag);\n if (!Array.isArray(data))\n return reporter.error(\"seqof/setof, but data is not Array\");\n let child = this.clone();\n child._baseState.implicit = null, content = this._createEncoderBuffer(data.map(function(item) {\n let state2 = this._baseState;\n return this._getUse(state2.args[0], data)._encode(item, reporter);\n }, child));\n } else\n state.use !== null \? result = this._getUse(state.use, parent)._encode(data, reporter) : (content = this._encodePrimitive(state.tag, data), primitive = !0);\n if (!state.any && state.choice === null) {\n let tag = state.implicit !== null \? state.implicit : state.tag, cls = state.implicit === null \? \"universal\" : \"context\";\n tag === null \? state.use === null && reporter.error(\"Tag could be omitted only for .use()\") : state.use === null && (result = this._encodeComposite(tag, primitive, cls, content));\n }\n return state.explicit !== null && (result = this._encodeComposite(state.explicit, !1, \"context\", result)), result;\n }, Node.prototype._encodeChoice = function(data, reporter) {\n let state = this._baseState, node = state.choice[data.type];\n return node || assert(!1, data.type + \" not found in \" + JSON.stringify(Object.keys(state.choice))), node._encode(data.value, reporter);\n }, Node.prototype._encodePrimitive = function(tag, data) {\n let state = this._baseState;\n if (/str$/.test(tag))\n return this._encodeStr(data, tag);\n if (tag === \"objid\" && state.args)\n return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);\n if (tag === \"objid\")\n return this._encodeObjid(data, null, null);\n if (tag === \"gentime\" || tag === \"utctime\")\n return this._encodeTime(data, tag);\n if (tag === \"null_\")\n return this._encodeNull();\n if (tag === \"int\" || tag === \"enum\")\n return this._encodeInt(data, state.args && state.reverseArgs[0]);\n if (tag === \"bool\")\n return this._encodeBool(data);\n if (tag === \"objDesc\")\n return this._encodeStr(data, tag);\n throw new Error(\"Unsupported tag: \" + tag);\n }, Node.prototype._isNumstr = function(str) {\n return /^[0-9 ]*$/.test(str);\n }, Node.prototype._isPrintstr = function(str) {\n return /^[A-Za-z0-9 '()+,-./:=\?]*$/.test(str);\n };\n }\n}), require_der = __commonJS({\n \"node_modules/asn1.js/lib/asn1/constants/der.js\"(exports) {\n function reverse(map) {\n let res = {};\n return Object.keys(map).forEach(function(key) {\n (key | 0) == key && (key = key | 0);\n let value = map[key];\n res[value] = key;\n }), res;\n }\n exports.tagClass = {\n 0: \"universal\",\n 1: \"application\",\n 2: \"context\",\n 3: \"private\"\n }, exports.tagClassByName = reverse(exports.tagClass), exports.tag = {\n 0: \"end\",\n 1: \"bool\",\n 2: \"int\",\n 3: \"bitstr\",\n 4: \"octstr\",\n 5: \"null_\",\n 6: \"objid\",\n 7: \"objDesc\",\n 8: \"external\",\n 9: \"real\",\n 10: \"enum\",\n 11: \"embed\",\n 12: \"utf8str\",\n 13: \"relativeOid\",\n 16: \"seq\",\n 17: \"set\",\n 18: \"numstr\",\n 19: \"printstr\",\n 20: \"t61str\",\n 21: \"videostr\",\n 22: \"ia5str\",\n 23: \"utctime\",\n 24: \"gentime\",\n 25: \"graphstr\",\n 26: \"iso646str\",\n 27: \"genstr\",\n 28: \"unistr\",\n 29: \"charstr\",\n 30: \"bmpstr\"\n }, exports.tagByName = reverse(exports.tag);\n }\n}), require_der2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/der.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safer().Buffer, Node = require_node(), der = require_der();\n function DEREncoder(entity) {\n this.enc = \"der\", this.name = entity.name, this.entity = entity, this.tree = new DERNode, this.tree._init(entity.body);\n }\n DEREncoder.prototype = {}, module.exports = DEREncoder, DEREncoder.prototype.encode = function(data, reporter) {\n return this.tree._encode(data, reporter).join();\n };\n function DERNode(parent) {\n Node.call(this, \"der\", parent);\n }\n inherits(DERNode, Node), DERNode.prototype._encodeComposite = function(tag, primitive, cls, content) {\n let encodedTag = encodeTag(tag, primitive, cls, this.reporter);\n if (content.length < 128) {\n let header2 = Buffer2.alloc(2);\n return header2[0] = encodedTag, header2[1] = content.length, this._createEncoderBuffer([header2, content]);\n }\n let lenOctets = 1;\n for (let i = content.length;i >= 256; i >>= 8)\n lenOctets++;\n let header = Buffer2.alloc(2 + lenOctets);\n header[0] = encodedTag, header[1] = 128 | lenOctets;\n for (let i = 1 + lenOctets, j = content.length;j > 0; i--, j >>= 8)\n header[i] = j & 255;\n return this._createEncoderBuffer([header, content]);\n }, DERNode.prototype._encodeStr = function(str, tag) {\n if (tag === \"bitstr\")\n return this._createEncoderBuffer([str.unused | 0, str.data]);\n if (tag === \"bmpstr\") {\n let buf = Buffer2.alloc(str.length * 2);\n for (let i = 0;i < str.length; i++)\n buf.writeUInt16BE(str.charCodeAt(i), i * 2);\n return this._createEncoderBuffer(buf);\n } else\n return tag === \"numstr\" \? this._isNumstr(str) \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: numstr supports only digits and space\") : tag === \"printstr\" \? this._isPrintstr(str) \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark\") : /str$/.test(tag) \? this._createEncoderBuffer(str) : tag === \"objDesc\" \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: \" + tag + \" unsupported\");\n }, DERNode.prototype._encodeObjid = function(id, values, relative) {\n if (typeof id == \"string\") {\n if (!values)\n return this.reporter.error(\"string objid given, but no values map found\");\n if (!values.hasOwnProperty(id))\n return this.reporter.error(\"objid not found in values map\");\n id = values[id].split(/[\\s.]+/g);\n for (let i = 0;i < id.length; i++)\n id[i] |= 0;\n } else if (Array.isArray(id)) {\n id = id.slice();\n for (let i = 0;i < id.length; i++)\n id[i] |= 0;\n }\n if (!Array.isArray(id))\n return this.reporter.error(\"objid() should be either array or string, got: \" + JSON.stringify(id));\n if (!relative) {\n if (id[1] >= 40)\n return this.reporter.error(\"Second objid identifier OOB\");\n id.splice(0, 2, id[0] * 40 + id[1]);\n }\n let size = 0;\n for (let i = 0;i < id.length; i++) {\n let ident = id[i];\n for (size++;ident >= 128; ident >>= 7)\n size++;\n }\n let objid = Buffer2.alloc(size), offset = objid.length - 1;\n for (let i = id.length - 1;i >= 0; i--) {\n let ident = id[i];\n for (objid[offset--] = ident & 127;(ident >>= 7) > 0; )\n objid[offset--] = 128 | ident & 127;\n }\n return this._createEncoderBuffer(objid);\n };\n function two(num) {\n return num < 10 \? \"0\" + num : num;\n }\n DERNode.prototype._encodeTime = function(time, tag) {\n let str, date = new Date(time);\n return tag === \"gentime\" \? str = [\n two(date.getUTCFullYear()),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n \"Z\"\n ].join(\"\") : tag === \"utctime\" \? str = [\n two(date.getUTCFullYear() % 100),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n \"Z\"\n ].join(\"\") : this.reporter.error(\"Encoding \" + tag + \" time is not supported yet\"), this._encodeStr(str, \"octstr\");\n }, DERNode.prototype._encodeNull = function() {\n return this._createEncoderBuffer(\"\");\n }, DERNode.prototype._encodeInt = function(num, values) {\n if (typeof num == \"string\") {\n if (!values)\n return this.reporter.error(\"String int or enum given, but no values map\");\n if (!values.hasOwnProperty(num))\n return this.reporter.error(\"Values map doesn't contain: \" + JSON.stringify(num));\n num = values[num];\n }\n if (typeof num != \"number\" && !Buffer2.isBuffer(num)) {\n let numArray = num.toArray();\n !num.sign && numArray[0] & 128 && numArray.unshift(0), num = Buffer2.from(numArray);\n }\n if (Buffer2.isBuffer(num)) {\n let size2 = num.length;\n num.length === 0 && size2++;\n let out2 = Buffer2.alloc(size2);\n return num.copy(out2), num.length === 0 && (out2[0] = 0), this._createEncoderBuffer(out2);\n }\n if (num < 128)\n return this._createEncoderBuffer(num);\n if (num < 256)\n return this._createEncoderBuffer([0, num]);\n let size = 1;\n for (let i = num;i >= 256; i >>= 8)\n size++;\n let out = new Array(size);\n for (let i = out.length - 1;i >= 0; i--)\n out[i] = num & 255, num >>= 8;\n return out[0] & 128 && out.unshift(0), this._createEncoderBuffer(Buffer2.from(out));\n }, DERNode.prototype._encodeBool = function(value) {\n return this._createEncoderBuffer(value \? 255 : 0);\n }, DERNode.prototype._use = function(entity, obj) {\n return typeof entity == \"function\" && (entity = entity(obj)), entity._getEncoder(\"der\").tree;\n }, DERNode.prototype._skipDefault = function(dataBuffer, reporter, parent) {\n let state = this._baseState, i;\n if (state.default === null)\n return !1;\n let data = dataBuffer.join();\n if (state.defaultBuffer === void 0 && (state.defaultBuffer = this._encodeValue(state.default, reporter, parent).join()), data.length !== state.defaultBuffer.length)\n return !1;\n for (i = 0;i < data.length; i++)\n if (data[i] !== state.defaultBuffer[i])\n return !1;\n return !0;\n };\n function encodeTag(tag, primitive, cls, reporter) {\n let res;\n if (tag === \"seqof\" \? tag = \"seq\" : tag === \"setof\" && (tag = \"set\"), der.tagByName.hasOwnProperty(tag))\n res = der.tagByName[tag];\n else if (typeof tag == \"number\" && (tag | 0) === tag)\n res = tag;\n else\n return reporter.error(\"Unknown tag: \" + tag);\n return res >= 31 \? reporter.error(\"Multi-octet tag encoding unsupported\") : (primitive || (res |= 32), res |= der.tagClassByName[cls || \"universal\"] << 6, res);\n }\n }\n}), require_pem = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/pem.js\"(exports, module) {\n var inherits = require_inherits_browser(), DEREncoder = require_der2();\n function PEMEncoder(entity) {\n DEREncoder.call(this, entity), this.enc = \"pem\";\n }\n inherits(PEMEncoder, DEREncoder), module.exports = PEMEncoder, PEMEncoder.prototype.encode = function(data, options) {\n let p = DEREncoder.prototype.encode.call(this, data).toString(\"base64\"), out = [\"-----BEGIN \" + options.label + \"-----\"];\n for (let i = 0;i < p.length; i += 64)\n out.push(p.slice(i, i + 64));\n return out.push(\"-----END \" + options.label + \"-----\"), out.join(`\n`);\n };\n }\n}), require_encoders = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/index.js\"(exports) {\n var encoders = exports;\n encoders.der = require_der2(), encoders.pem = require_pem();\n }\n}), require_der3 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/der.js\"(exports, module) {\n var inherits = require_inherits_browser(), bignum = require_bn5(), DecoderBuffer = require_buffer().DecoderBuffer, Node = require_node(), der = require_der();\n function DERDecoder(entity) {\n this.enc = \"der\", this.name = entity.name, this.entity = entity, this.tree = new DERNode, this.tree._init(entity.body);\n }\n DERDecoder.prototype = {}, module.exports = DERDecoder, DERDecoder.prototype.decode = function(data, options) {\n return DecoderBuffer.isDecoderBuffer(data) || (data = new DecoderBuffer(data, options)), this.tree._decode(data, options);\n };\n function DERNode(parent) {\n Node.call(this, \"der\", parent);\n }\n inherits(DERNode, Node), DERNode.prototype._peekTag = function(buffer, tag, any) {\n if (buffer.isEmpty())\n return !1;\n let state = buffer.save(), decodedTag = derDecodeTag(buffer, 'Failed to peek tag: \"' + tag + '\"');\n return buffer.isError(decodedTag) \? decodedTag : (buffer.restore(state), decodedTag.tag === tag || decodedTag.tagStr === tag || decodedTag.tagStr + \"of\" === tag || any);\n }, DERNode.prototype._decodeTag = function(buffer, tag, any) {\n let decodedTag = derDecodeTag(buffer, 'Failed to decode tag of \"' + tag + '\"');\n if (buffer.isError(decodedTag))\n return decodedTag;\n let len = derDecodeLen(buffer, decodedTag.primitive, 'Failed to get length of \"' + tag + '\"');\n if (buffer.isError(len))\n return len;\n if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + \"of\" !== tag)\n return buffer.error('Failed to match tag: \"' + tag + '\"');\n if (decodedTag.primitive || len !== null)\n return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n let state = buffer.save(), res = this._skipUntilEnd(buffer, 'Failed to skip indefinite length body: \"' + this.tag + '\"');\n return buffer.isError(res) \? res : (len = buffer.offset - state.offset, buffer.restore(state), buffer.skip(len, 'Failed to match body of: \"' + tag + '\"'));\n }, DERNode.prototype._skipUntilEnd = function(buffer, fail) {\n for (;; ) {\n let tag = derDecodeTag(buffer, fail);\n if (buffer.isError(tag))\n return tag;\n let len = derDecodeLen(buffer, tag.primitive, fail);\n if (buffer.isError(len))\n return len;\n let res;\n if (tag.primitive || len !== null \? res = buffer.skip(len) : res = this._skipUntilEnd(buffer, fail), buffer.isError(res))\n return res;\n if (tag.tagStr === \"end\")\n break;\n }\n }, DERNode.prototype._decodeList = function(buffer, tag, decoder, options) {\n let result = [];\n for (;!buffer.isEmpty(); ) {\n let possibleEnd = this._peekTag(buffer, \"end\");\n if (buffer.isError(possibleEnd))\n return possibleEnd;\n let res = decoder.decode(buffer, \"der\", options);\n if (buffer.isError(res) && possibleEnd)\n break;\n result.push(res);\n }\n return result;\n }, DERNode.prototype._decodeStr = function(buffer, tag) {\n if (tag === \"bitstr\") {\n let unused = buffer.readUInt8();\n return buffer.isError(unused) \? unused : { unused, data: buffer.raw() };\n } else if (tag === \"bmpstr\") {\n let raw = buffer.raw();\n if (raw.length % 2 === 1)\n return buffer.error(\"Decoding of string type: bmpstr length mismatch\");\n let str = \"\";\n for (let i = 0;i < raw.length / 2; i++)\n str += String.fromCharCode(raw.readUInt16BE(i * 2));\n return str;\n } else if (tag === \"numstr\") {\n let numstr = buffer.raw().toString(\"ascii\");\n return this._isNumstr(numstr) \? numstr : buffer.error(\"Decoding of string type: numstr unsupported characters\");\n } else {\n if (tag === \"octstr\")\n return buffer.raw();\n if (tag === \"objDesc\")\n return buffer.raw();\n if (tag === \"printstr\") {\n let printstr = buffer.raw().toString(\"ascii\");\n return this._isPrintstr(printstr) \? printstr : buffer.error(\"Decoding of string type: printstr unsupported characters\");\n } else\n return /str$/.test(tag) \? buffer.raw().toString() : buffer.error(\"Decoding of string type: \" + tag + \" unsupported\");\n }\n }, DERNode.prototype._decodeObjid = function(buffer, values, relative) {\n let result, identifiers = [], ident = 0, subident = 0;\n for (;!buffer.isEmpty(); )\n subident = buffer.readUInt8(), ident <<= 7, ident |= subident & 127, (subident & 128) === 0 && (identifiers.push(ident), ident = 0);\n subident & 128 && identifiers.push(ident);\n let first = identifiers[0] / 40 | 0, second = identifiers[0] % 40;\n if (relative \? result = identifiers : result = [first, second].concat(identifiers.slice(1)), values) {\n let tmp = values[result.join(\" \")];\n tmp === void 0 && (tmp = values[result.join(\".\")]), tmp !== void 0 && (result = tmp);\n }\n return result;\n }, DERNode.prototype._decodeTime = function(buffer, tag) {\n let str = buffer.raw().toString(), year, mon, day, hour, min, sec;\n if (tag === \"gentime\")\n year = str.slice(0, 4) | 0, mon = str.slice(4, 6) | 0, day = str.slice(6, 8) | 0, hour = str.slice(8, 10) | 0, min = str.slice(10, 12) | 0, sec = str.slice(12, 14) | 0;\n else if (tag === \"utctime\")\n year = str.slice(0, 2) | 0, mon = str.slice(2, 4) | 0, day = str.slice(4, 6) | 0, hour = str.slice(6, 8) | 0, min = str.slice(8, 10) | 0, sec = str.slice(10, 12) | 0, year < 70 \? year = 2000 + year : year = 1900 + year;\n else\n return buffer.error(\"Decoding \" + tag + \" time is not supported yet\");\n return Date.UTC(year, mon - 1, day, hour, min, sec, 0);\n }, DERNode.prototype._decodeNull = function() {\n return null;\n }, DERNode.prototype._decodeBool = function(buffer) {\n let res = buffer.readUInt8();\n return buffer.isError(res) \? res : res !== 0;\n }, DERNode.prototype._decodeInt = function(buffer, values) {\n let raw = buffer.raw(), res = new bignum(raw);\n return values && (res = values[res.toString(10)] || res), res;\n }, DERNode.prototype._use = function(entity, obj) {\n return typeof entity == \"function\" && (entity = entity(obj)), entity._getDecoder(\"der\").tree;\n };\n function derDecodeTag(buf, fail) {\n let tag = buf.readUInt8(fail);\n if (buf.isError(tag))\n return tag;\n let cls = der.tagClass[tag >> 6], primitive = (tag & 32) === 0;\n if ((tag & 31) === 31) {\n let oct = tag;\n for (tag = 0;(oct & 128) === 128; ) {\n if (oct = buf.readUInt8(fail), buf.isError(oct))\n return oct;\n tag <<= 7, tag |= oct & 127;\n }\n } else\n tag &= 31;\n let tagStr = der.tag[tag];\n return {\n cls,\n primitive,\n tag,\n tagStr\n };\n }\n function derDecodeLen(buf, primitive, fail) {\n let len = buf.readUInt8(fail);\n if (buf.isError(len))\n return len;\n if (!primitive && len === 128)\n return null;\n if ((len & 128) === 0)\n return len;\n let num = len & 127;\n if (num > 4)\n return buf.error(\"length octect is too long\");\n len = 0;\n for (let i = 0;i < num; i++) {\n len <<= 8;\n let j = buf.readUInt8(fail);\n if (buf.isError(j))\n return j;\n len |= j;\n }\n return len;\n }\n }\n}), require_pem2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/pem.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safer().Buffer, DERDecoder = require_der3();\n function PEMDecoder(entity) {\n DERDecoder.call(this, entity), this.enc = \"pem\";\n }\n inherits(PEMDecoder, DERDecoder), module.exports = PEMDecoder, PEMDecoder.prototype.decode = function(data, options) {\n let lines = data.toString().split(/[\\r\\n]+/g), label = options.label.toUpperCase(), re = /^-----(BEGIN|END) ([^-]+)-----$/, start = -1, end = -1;\n for (let i = 0;i < lines.length; i++) {\n let match = lines[i].match(re);\n if (match !== null && match[2] === label)\n if (start === -1) {\n if (match[1] !== \"BEGIN\")\n break;\n start = i;\n } else {\n if (match[1] !== \"END\")\n break;\n end = i;\n break;\n }\n }\n if (start === -1 || end === -1)\n throw new Error(\"PEM section not found for: \" + label);\n let base64 = lines.slice(start + 1, end).join(\"\");\n base64.replace(/[^a-z0-9+/=]+/gi, \"\");\n let input = Buffer2.from(base64, \"base64\");\n return DERDecoder.prototype.decode.call(this, input, options);\n };\n }\n}), require_decoders = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/index.js\"(exports) {\n var decoders = exports;\n decoders.der = require_der3(), decoders.pem = require_pem2();\n }\n}), require_api = __commonJS({\n \"node_modules/asn1.js/lib/asn1/api.js\"(exports) {\n var encoders = require_encoders(), decoders = require_decoders(), inherits = require_inherits_browser(), api = exports;\n api.define = function(name, body) {\n return new Entity(name, body);\n };\n function Entity(name, body) {\n this.name = name, this.body = body, this.decoders = {}, this.encoders = {};\n }\n Entity.prototype = {}, Entity.prototype._createNamed = function(Base) {\n let name = this.name;\n function Generated(entity) {\n this._initNamed(entity, name);\n }\n return inherits(Generated, Base), Generated.prototype._initNamed = function(entity, name2) {\n Base.call(this, entity, name2);\n }, new Generated(this);\n }, Entity.prototype._getDecoder = function(enc) {\n return enc = enc || \"der\", this.decoders.hasOwnProperty(enc) || (this.decoders[enc] = this._createNamed(decoders[enc])), this.decoders[enc];\n }, Entity.prototype.decode = function(data, enc, options) {\n return this._getDecoder(enc).decode(data, options);\n }, Entity.prototype._getEncoder = function(enc) {\n return enc = enc || \"der\", this.encoders.hasOwnProperty(enc) || (this.encoders[enc] = this._createNamed(encoders[enc])), this.encoders[enc];\n }, Entity.prototype.encode = function(data, enc, reporter) {\n return this._getEncoder(enc).encode(data, reporter);\n };\n }\n}), require_base2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/index.js\"(exports) {\n var base = exports;\n base.Reporter = require_reporter().Reporter, base.DecoderBuffer = require_buffer().DecoderBuffer, base.EncoderBuffer = require_buffer().EncoderBuffer, base.Node = require_node();\n }\n}), require_constants = __commonJS({\n \"node_modules/asn1.js/lib/asn1/constants/index.js\"(exports) {\n var constants = exports;\n constants._reverse = function(map) {\n let res = {};\n return Object.keys(map).forEach(function(key) {\n (key | 0) == key && (key = key | 0);\n let value = map[key];\n res[value] = key;\n }), res;\n }, constants.der = require_der();\n }\n}), require_asn1 = __commonJS({\n \"node_modules/asn1.js/lib/asn1.js\"(exports) {\n var asn1 = exports;\n asn1.bignum = require_bn5(), asn1.define = require_api().define, asn1.base = require_base2(), asn1.constants = require_constants(), asn1.decoders = require_decoders(), asn1.encoders = require_encoders();\n }\n}), require_certificate = __commonJS({\n \"node_modules/parse-asn1/certificate.js\"(exports, module) {\n var asn = require_asn1(), Time = asn.define(\"Time\", function() {\n this.choice({\n utcTime: this.utctime(),\n generalTime: this.gentime()\n });\n }), AttributeTypeValue = asn.define(\"AttributeTypeValue\", function() {\n this.seq().obj(this.key(\"type\").objid(), this.key(\"value\").any());\n }), AlgorithmIdentifier = asn.define(\"AlgorithmIdentifier\", function() {\n this.seq().obj(this.key(\"algorithm\").objid(), this.key(\"parameters\").optional(), this.key(\"curve\").objid().optional());\n }), SubjectPublicKeyInfo = asn.define(\"SubjectPublicKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPublicKey\").bitstr());\n }), RelativeDistinguishedName = asn.define(\"RelativeDistinguishedName\", function() {\n this.setof(AttributeTypeValue);\n }), RDNSequence = asn.define(\"RDNSequence\", function() {\n this.seqof(RelativeDistinguishedName);\n }), Name = asn.define(\"Name\", function() {\n this.choice({\n rdnSequence: this.use(RDNSequence)\n });\n }), Validity = asn.define(\"Validity\", function() {\n this.seq().obj(this.key(\"notBefore\").use(Time), this.key(\"notAfter\").use(Time));\n }), Extension = asn.define(\"Extension\", function() {\n this.seq().obj(this.key(\"extnID\").objid(), this.key(\"critical\").bool().def(!1), this.key(\"extnValue\").octstr());\n }), TBSCertificate = asn.define(\"TBSCertificate\", function() {\n this.seq().obj(this.key(\"version\").explicit(0).int().optional(), this.key(\"serialNumber\").int(), this.key(\"signature\").use(AlgorithmIdentifier), this.key(\"issuer\").use(Name), this.key(\"validity\").use(Validity), this.key(\"subject\").use(Name), this.key(\"subjectPublicKeyInfo\").use(SubjectPublicKeyInfo), this.key(\"issuerUniqueID\").implicit(1).bitstr().optional(), this.key(\"subjectUniqueID\").implicit(2).bitstr().optional(), this.key(\"extensions\").explicit(3).seqof(Extension).optional());\n }), X509Certificate = asn.define(\"X509Certificate\", function() {\n this.seq().obj(this.key(\"tbsCertificate\").use(TBSCertificate), this.key(\"signatureAlgorithm\").use(AlgorithmIdentifier), this.key(\"signatureValue\").bitstr());\n });\n module.exports = X509Certificate;\n }\n}), require_asn12 = __commonJS({\n \"node_modules/parse-asn1/asn1.js\"(exports) {\n var asn1 = require_asn1();\n exports.certificate = require_certificate();\n var RSAPrivateKey = asn1.define(\"RSAPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"modulus\").int(), this.key(\"publicExponent\").int(), this.key(\"privateExponent\").int(), this.key(\"prime1\").int(), this.key(\"prime2\").int(), this.key(\"exponent1\").int(), this.key(\"exponent2\").int(), this.key(\"coefficient\").int());\n });\n exports.RSAPrivateKey = RSAPrivateKey;\n var RSAPublicKey = asn1.define(\"RSAPublicKey\", function() {\n this.seq().obj(this.key(\"modulus\").int(), this.key(\"publicExponent\").int());\n });\n exports.RSAPublicKey = RSAPublicKey;\n var PublicKey = asn1.define(\"SubjectPublicKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPublicKey\").bitstr());\n });\n exports.PublicKey = PublicKey;\n var AlgorithmIdentifier = asn1.define(\"AlgorithmIdentifier\", function() {\n this.seq().obj(this.key(\"algorithm\").objid(), this.key(\"none\").null_().optional(), this.key(\"curve\").objid().optional(), this.key(\"params\").seq().obj(this.key(\"p\").int(), this.key(\"q\").int(), this.key(\"g\").int()).optional());\n }), PrivateKeyInfo = asn1.define(\"PrivateKeyInfo\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPrivateKey\").octstr());\n });\n exports.PrivateKey = PrivateKeyInfo;\n var EncryptedPrivateKeyInfo = asn1.define(\"EncryptedPrivateKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").seq().obj(this.key(\"id\").objid(), this.key(\"decrypt\").seq().obj(this.key(\"kde\").seq().obj(this.key(\"id\").objid(), this.key(\"kdeparams\").seq().obj(this.key(\"salt\").octstr(), this.key(\"iters\").int())), this.key(\"cipher\").seq().obj(this.key(\"algo\").objid(), this.key(\"iv\").octstr()))), this.key(\"subjectPrivateKey\").octstr());\n });\n exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo;\n var DSAPrivateKey = asn1.define(\"DSAPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"p\").int(), this.key(\"q\").int(), this.key(\"g\").int(), this.key(\"pub_key\").int(), this.key(\"priv_key\").int());\n });\n exports.DSAPrivateKey = DSAPrivateKey, exports.DSAparam = asn1.define(\"DSAparam\", function() {\n this.int();\n });\n var ECPrivateKey = asn1.define(\"ECPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"privateKey\").octstr(), this.key(\"parameters\").optional().explicit(0).use(ECParameters), this.key(\"publicKey\").optional().explicit(1).bitstr());\n });\n exports.ECPrivateKey = ECPrivateKey;\n var ECParameters = asn1.define(\"ECParameters\", function() {\n this.choice({\n namedCurve: this.objid()\n });\n });\n exports.signature = asn1.define(\"signature\", function() {\n this.seq().obj(this.key(\"r\").int(), this.key(\"s\").int());\n });\n }\n}), require_aesid = __commonJS({\n \"node_modules/parse-asn1/aesid.json\"(exports, module) {\n module.exports = {\n \"2.16.840.1.101.3.4.1.1\": \"aes-128-ecb\",\n \"2.16.840.1.101.3.4.1.2\": \"aes-128-cbc\",\n \"2.16.840.1.101.3.4.1.3\": \"aes-128-ofb\",\n \"2.16.840.1.101.3.4.1.4\": \"aes-128-cfb\",\n \"2.16.840.1.101.3.4.1.21\": \"aes-192-ecb\",\n \"2.16.840.1.101.3.4.1.22\": \"aes-192-cbc\",\n \"2.16.840.1.101.3.4.1.23\": \"aes-192-ofb\",\n \"2.16.840.1.101.3.4.1.24\": \"aes-192-cfb\",\n \"2.16.840.1.101.3.4.1.41\": \"aes-256-ecb\",\n \"2.16.840.1.101.3.4.1.42\": \"aes-256-cbc\",\n \"2.16.840.1.101.3.4.1.43\": \"aes-256-ofb\",\n \"2.16.840.1.101.3.4.1.44\": \"aes-256-cfb\"\n };\n }\n}), require_fixProc = __commonJS({\n \"node_modules/parse-asn1/fixProc.js\"(exports, module) {\n var findProc = /Proc-Type: 4,ENCRYPTED[\\n\\r]+DEK-Info: AES-((\?:128)|(\?:192)|(\?:256))-CBC,([0-9A-H]+)[\\n\\r]+([0-9A-z\\n\\r+/=]+)[\\n\\r]+/m, startRegex = /^-----BEGIN ((\?:.*\? KEY)|CERTIFICATE)-----/m, fullRegex = /^-----BEGIN ((\?:.*\? KEY)|CERTIFICATE)-----([0-9A-z\\n\\r+/=]+)-----END \\1-----$/m, evp = require_evp_bytestokey(), ciphers = require_browser5(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(okey, password) {\n var key = okey.toString(), match = key.match(findProc), decrypted;\n if (match) {\n var suite = \"aes\" + match[1], iv = Buffer2.from(match[2], \"hex\"), cipherText = Buffer2.from(match[3].replace(/[\\r\\n]/g, \"\"), \"base64\"), cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key, out = [], cipher = ciphers.createDecipheriv(suite, cipherKey, iv);\n out.push(cipher.update(cipherText)), out.push(cipher.final()), decrypted = Buffer2.concat(out);\n } else {\n var match2 = key.match(fullRegex);\n decrypted = Buffer2.from(match2[2].replace(/[\\r\\n]/g, \"\"), \"base64\");\n }\n var tag = key.match(startRegex)[1];\n return {\n tag,\n data: decrypted\n };\n };\n }\n}), require_parse_asn1 = __commonJS({\n \"node_modules/parse-asn1/index.js\"(exports, module) {\n var asn1 = require_asn12(), aesid = require_aesid(), fixProc = require_fixProc(), ciphers = require_browser5(), compat = require_browser4(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = parseKeys;\n function parseKeys(buffer) {\n var password;\n typeof buffer == \"object\" && !Buffer2.isBuffer(buffer) && (password = buffer.passphrase, buffer = buffer.key), typeof buffer == \"string\" && (buffer = Buffer2.from(buffer));\n var stripped = fixProc(buffer, password), type = stripped.tag, data = stripped.data, subtype, ndata;\n switch (type) {\n case \"CERTIFICATE\":\n ndata = asn1.certificate.decode(data, \"der\").tbsCertificate.subjectPublicKeyInfo;\n case \"PUBLIC KEY\":\n switch (ndata || (ndata = asn1.PublicKey.decode(data, \"der\")), subtype = ndata.algorithm.algorithm.join(\".\"), subtype) {\n case \"1.2.840.113549.1.1.1\":\n return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, \"der\");\n case \"1.2.840.10045.2.1\":\n return ndata.subjectPrivateKey = ndata.subjectPublicKey, {\n type: \"ec\",\n data: ndata\n };\n case \"1.2.840.10040.4.1\":\n return ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, \"der\"), {\n type: \"dsa\",\n data: ndata.algorithm.params\n };\n default:\n throw new Error(\"unknown key id \" + subtype);\n }\n case \"ENCRYPTED PRIVATE KEY\":\n data = asn1.EncryptedPrivateKey.decode(data, \"der\"), data = decrypt(data, password);\n case \"PRIVATE KEY\":\n switch (ndata = asn1.PrivateKey.decode(data, \"der\"), subtype = ndata.algorithm.algorithm.join(\".\"), subtype) {\n case \"1.2.840.113549.1.1.1\":\n return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, \"der\");\n case \"1.2.840.10045.2.1\":\n return {\n curve: ndata.algorithm.curve,\n privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, \"der\").privateKey\n };\n case \"1.2.840.10040.4.1\":\n return ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, \"der\"), {\n type: \"dsa\",\n params: ndata.algorithm.params\n };\n default:\n throw new Error(\"unknown key id \" + subtype);\n }\n case \"RSA PUBLIC KEY\":\n return asn1.RSAPublicKey.decode(data, \"der\");\n case \"RSA PRIVATE KEY\":\n return asn1.RSAPrivateKey.decode(data, \"der\");\n case \"DSA PRIVATE KEY\":\n return {\n type: \"dsa\",\n params: asn1.DSAPrivateKey.decode(data, \"der\")\n };\n case \"EC PRIVATE KEY\":\n return data = asn1.ECPrivateKey.decode(data, \"der\"), {\n curve: data.parameters.value,\n privateKey: data.privateKey\n };\n default:\n throw new Error(\"unknown key type \" + type);\n }\n }\n parseKeys.signature = asn1.signature;\n function decrypt(data, password) {\n var salt = data.algorithm.decrypt.kde.kdeparams.salt, iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10), algo = aesid[data.algorithm.decrypt.cipher.algo.join(\".\")], iv = data.algorithm.decrypt.cipher.iv, cipherText = data.subjectPrivateKey, keylen = parseInt(algo.split(\"-\")[1], 10) / 8, key = compat.pbkdf2Sync(password, salt, iters, keylen, \"sha1\"), cipher = ciphers.createDecipheriv(algo, key, iv), out = [];\n return out.push(cipher.update(cipherText)), out.push(cipher.final()), Buffer2.concat(out);\n }\n }\n}), require_curves2 = __commonJS({\n \"node_modules/browserify-sign/browser/curves.json\"(exports, module) {\n module.exports = {\n \"1.3.132.0.10\": \"secp256k1\",\n \"1.3.132.0.33\": \"p224\",\n \"1.2.840.10045.3.1.1\": \"p192\",\n \"1.2.840.10045.3.1.7\": \"p256\",\n \"1.3.132.0.34\": \"p384\",\n \"1.3.132.0.35\": \"p521\"\n };\n }\n}), require_sign = __commonJS({\n \"node_modules/browserify-sign/browser/sign.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, createHmac = require_browser3(), crt = require_browserify_rsa(), EC = require_elliptic().ec, BN = require_bn3(), parseKeys = require_parse_asn1(), curves = require_curves2();\n function sign(hash, key, hashType, signType, tag) {\n var priv = parseKeys(key);\n if (priv.curve) {\n if (signType !== \"ecdsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong private key type\");\n return ecSign(hash, priv);\n } else if (priv.type === \"dsa\") {\n if (signType !== \"dsa\")\n throw new Error(\"wrong private key type\");\n return dsaSign(hash, priv, hashType);\n } else if (signType !== \"rsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong private key type\");\n hash = Buffer2.concat([tag, hash]);\n for (var len = priv.modulus.byteLength(), pad = [0, 1];hash.length + pad.length + 1 < len; )\n pad.push(255);\n pad.push(0);\n for (var i = -1;++i < hash.length; )\n pad.push(hash[i]);\n var out = crt(pad, priv);\n return out;\n }\n function ecSign(hash, priv) {\n var curveId = curves[priv.curve.join(\".\")];\n if (!curveId)\n throw new Error(\"unknown curve \" + priv.curve.join(\".\"));\n var curve = new EC(curveId), key = curve.keyFromPrivate(priv.privateKey), out = key.sign(hash);\n return Buffer2.from(out.toDER());\n }\n function dsaSign(hash, priv, algo) {\n for (var x = priv.params.priv_key, p = priv.params.p, q = priv.params.q, g = priv.params.g, r = new BN(0), k, H = bits2int(hash, q).mod(q), s = !1, kv = getKey(x, q, hash, algo);s === !1; )\n k = makeKey(q, kv, algo), r = makeR(g, k, p, q), s = k.invm(q).imul(H.add(x.mul(r))).mod(q), s.cmpn(0) === 0 && (s = !1, r = new BN(0));\n return toDER(r, s);\n }\n function toDER(r, s) {\n r = r.toArray(), s = s.toArray(), r[0] & 128 && (r = [0].concat(r)), s[0] & 128 && (s = [0].concat(s));\n var total = r.length + s.length + 4, res = [48, total, 2, r.length];\n return res = res.concat(r, [2, s.length], s), Buffer2.from(res);\n }\n function getKey(x, q, hash, algo) {\n if (x = Buffer2.from(x.toArray()), x.length < q.byteLength()) {\n var zeros = Buffer2.alloc(q.byteLength() - x.length);\n x = Buffer2.concat([zeros, x]);\n }\n var hlen = hash.length, hbits = bits2octets(hash, q), v = Buffer2.alloc(hlen);\n v.fill(1);\n var k = Buffer2.alloc(hlen);\n return k = createHmac(algo, k).update(v).update(Buffer2.from([0])).update(x).update(hbits).digest(), v = createHmac(algo, k).update(v).digest(), k = createHmac(algo, k).update(v).update(Buffer2.from([1])).update(x).update(hbits).digest(), v = createHmac(algo, k).update(v).digest(), { k, v };\n }\n function bits2int(obits, q) {\n var bits = new BN(obits), shift = (obits.length << 3) - q.bitLength();\n return shift > 0 && bits.ishrn(shift), bits;\n }\n function bits2octets(bits, q) {\n bits = bits2int(bits, q), bits = bits.mod(q);\n var out = Buffer2.from(bits.toArray());\n if (out.length < q.byteLength()) {\n var zeros = Buffer2.alloc(q.byteLength() - out.length);\n out = Buffer2.concat([zeros, out]);\n }\n return out;\n }\n function makeKey(q, kv, algo) {\n var t, k;\n do {\n for (t = Buffer2.alloc(0);t.length * 8 < q.bitLength(); )\n kv.v = createHmac(algo, kv.k).update(kv.v).digest(), t = Buffer2.concat([t, kv.v]);\n k = bits2int(t, q), kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer2.from([0])).digest(), kv.v = createHmac(algo, kv.k).update(kv.v).digest();\n } while (k.cmp(q) !== -1);\n return k;\n }\n function makeR(g, k, p, q) {\n return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q);\n }\n module.exports = sign, module.exports.getKey = getKey, module.exports.makeKey = makeKey;\n }\n}), require_verify = __commonJS({\n \"node_modules/browserify-sign/browser/verify.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, BN = require_bn3(), EC = require_elliptic().ec, parseKeys = require_parse_asn1(), curves = require_curves2();\n function verify(sig, hash, key, signType, tag) {\n var pub = parseKeys(key);\n if (pub.type === \"ec\") {\n if (signType !== \"ecdsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong public key type\");\n return ecVerify(sig, hash, pub);\n } else if (pub.type === \"dsa\") {\n if (signType !== \"dsa\")\n throw new Error(\"wrong public key type\");\n return dsaVerify(sig, hash, pub);\n } else if (signType !== \"rsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong public key type\");\n hash = Buffer2.concat([tag, hash]);\n for (var len = pub.modulus.byteLength(), pad = [1], padNum = 0;hash.length + pad.length + 2 < len; )\n pad.push(255), padNum++;\n pad.push(0);\n for (var i = -1;++i < hash.length; )\n pad.push(hash[i]);\n pad = Buffer2.from(pad);\n var red = BN.mont(pub.modulus);\n sig = new BN(sig).toRed(red), sig = sig.redPow(new BN(pub.publicExponent)), sig = Buffer2.from(sig.fromRed().toArray());\n var out = padNum < 8 \? 1 : 0;\n for (len = Math.min(sig.length, pad.length), sig.length !== pad.length && (out = 1), i = -1;++i < len; )\n out |= sig[i] ^ pad[i];\n return out === 0;\n }\n function ecVerify(sig, hash, pub) {\n var curveId = curves[pub.data.algorithm.curve.join(\".\")];\n if (!curveId)\n throw new Error(\"unknown curve \" + pub.data.algorithm.curve.join(\".\"));\n var curve = new EC(curveId), pubkey = pub.data.subjectPrivateKey.data;\n return curve.verify(hash, sig, pubkey);\n }\n function dsaVerify(sig, hash, pub) {\n var p = pub.data.p, q = pub.data.q, g = pub.data.g, y = pub.data.pub_key, unpacked = parseKeys.signature.decode(sig, \"der\"), s = unpacked.s, r = unpacked.r;\n checkValue(s, q), checkValue(r, q);\n var montp = BN.mont(p), w = s.invm(q), v = g.toRed(montp).redPow(new BN(hash).mul(w).mod(q)).fromRed().mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed()).mod(p).mod(q);\n return v.cmp(r) === 0;\n }\n function checkValue(b, q) {\n if (b.cmpn(0) <= 0)\n throw new Error(\"invalid sig\");\n if (b.cmp(q) >= q)\n throw new Error(\"invalid sig\");\n }\n module.exports = verify;\n }\n}), require_browser8 = __commonJS({\n \"node_modules/browserify-sign/browser/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, createHash = require_browser2(), inherits = require_inherits_browser(), sign = require_sign(), verify = require_verify(), algorithms = require_algorithms();\n Object.keys(algorithms).forEach(function(key) {\n algorithms[key].id = Buffer2.from(algorithms[key].id, \"hex\"), algorithms[key.toLowerCase()] = algorithms[key];\n });\n function Sign(algorithm) {\n StreamModule.Writable.call(this);\n var data = algorithms[algorithm];\n if (!data)\n throw new Error(\"Unknown message digest\");\n this._hashType = data.hash, this._hash = createHash(data.hash), this._tag = data.id, this._signType = data.sign;\n }\n inherits(Sign, StreamModule.Writable), Sign.prototype._write = function(data, _, done) {\n this._hash.update(data), done();\n }, Sign.prototype.update = function(data, enc) {\n return typeof data == \"string\" && (data = Buffer2.from(data, enc)), this._hash.update(data), this;\n }, Sign.prototype.sign = function(key, enc) {\n this.end();\n var hash = this._hash.digest(), sig = sign(hash, key, this._hashType, this._signType, this._tag);\n return enc \? sig.toString(enc) : sig;\n };\n function Verify(algorithm) {\n StreamModule.Writable.call(this);\n var data = algorithms[algorithm];\n if (!data)\n throw new Error(\"Unknown message digest\");\n this._hash = createHash(data.hash), this._tag = data.id, this._signType = data.sign;\n }\n inherits(Verify, StreamModule.Writable), Verify.prototype._write = function(data, _, done) {\n this._hash.update(data), done();\n }, Verify.prototype.update = function(data, enc) {\n return typeof data == \"string\" && (data = Buffer2.from(data, enc)), this._hash.update(data), this;\n }, Verify.prototype.verify = function(key, sig, enc) {\n typeof sig == \"string\" && (sig = Buffer2.from(sig, enc)), this.end();\n var hash = this._hash.digest();\n return verify(sig, hash, key, this._signType, this._tag);\n };\n function createSign(algorithm) {\n return new Sign(algorithm);\n }\n function createVerify(algorithm) {\n return new Verify(algorithm);\n }\n module.exports = {\n Sign: createSign,\n Verify: createVerify,\n createSign,\n createVerify\n };\n }\n}), require_bn6 = require_bn, require_browser9 = __commonJS({\n \"node_modules/create-ecdh/browser.js\"(exports, module) {\n var elliptic = require_elliptic(), BN = require_bn6();\n module.exports = function(curve) {\n return new ECDH(curve);\n };\n var aliases = {\n secp256k1: {\n name: \"secp256k1\",\n byteLength: 32\n },\n secp224r1: {\n name: \"p224\",\n byteLength: 28\n },\n prime256v1: {\n name: \"p256\",\n byteLength: 32\n },\n prime192v1: {\n name: \"p192\",\n byteLength: 24\n },\n ed25519: {\n name: \"ed25519\",\n byteLength: 32\n },\n secp384r1: {\n name: \"p384\",\n byteLength: 48\n },\n secp521r1: {\n name: \"p521\",\n byteLength: 66\n }\n };\n aliases.p224 = aliases.secp224r1, aliases.p256 = aliases.secp256r1 = aliases.prime256v1, aliases.p192 = aliases.secp192r1 = aliases.prime192v1, aliases.p384 = aliases.secp384r1, aliases.p521 = aliases.secp521r1;\n function ECDH(curve) {\n this.curveType = aliases[curve], this.curveType || (this.curveType = {\n name: curve\n }), this.curve = new elliptic.ec(this.curveType.name), this.keys = void 0;\n }\n ECDH.prototype = {}, ECDH.prototype.generateKeys = function(enc, format) {\n return this.keys = this.curve.genKeyPair(), this.getPublicKey(enc, format);\n }, ECDH.prototype.computeSecret = function(other, inenc, enc) {\n inenc = inenc || \"utf8\", Buffer.isBuffer(other) || (other = new Buffer(other, inenc));\n var otherPub = this.curve.keyFromPublic(other).getPublic(), out = otherPub.mul(this.keys.getPrivate()).getX();\n return formatReturnValue(out, enc, this.curveType.byteLength);\n }, ECDH.prototype.getPublicKey = function(enc, format) {\n var key = this.keys.getPublic(format === \"compressed\", !0);\n return format === \"hybrid\" && (key[key.length - 1] % 2 \? key[0] = 7 : key[0] = 6), formatReturnValue(key, enc);\n }, ECDH.prototype.getPrivateKey = function(enc) {\n return formatReturnValue(this.keys.getPrivate(), enc);\n }, ECDH.prototype.setPublicKey = function(pub, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(pub) || (pub = new Buffer(pub, enc)), this.keys._importPublic(pub), this;\n }, ECDH.prototype.setPrivateKey = function(priv, enc) {\n enc = enc || \"utf8\", Buffer.isBuffer(priv) || (priv = new Buffer(priv, enc));\n var _priv = new BN(priv);\n return _priv = _priv.toString(16), this.keys = this.curve.genKeyPair(), this.keys._importPrivate(_priv), this;\n };\n function formatReturnValue(bn, enc, len) {\n Array.isArray(bn) || (bn = bn.toArray());\n var buf = new Buffer(bn);\n if (len && buf.length < len) {\n var zeros = new Buffer(len - buf.length);\n zeros.fill(0), buf = Buffer.concat([zeros, buf]);\n }\n return enc \? buf.toString(enc) : buf;\n }\n }\n}), require_mgf = __commonJS({\n \"node_modules/public-encrypt/mgf.js\"(exports, module) {\n var createHash = require_browser2(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(seed, len) {\n for (var t = Buffer2.alloc(0), i = 0, c;t.length < len; )\n c = i2ops(i++), t = Buffer2.concat([t, createHash(\"sha1\").update(seed).update(c).digest()]);\n return t.slice(0, len);\n };\n function i2ops(c) {\n var out = Buffer2.allocUnsafe(4);\n return out.writeUInt32BE(c, 0), out;\n }\n }\n}), require_xor = __commonJS({\n \"node_modules/public-encrypt/xor.js\"(exports, module) {\n module.exports = function(a, b) {\n for (var len = a.length, i = -1;++i < len; )\n a[i] ^= b[i];\n return a;\n };\n }\n}), require_bn7 = require_bn, { CryptoHasher } = globalThis.Bun, require_withPublic = __commonJS({\n \"node_modules/public-encrypt/withPublic.js\"(exports, module) {\n var BN = require_bn7(), Buffer2 = require_safe_buffer().Buffer;\n function withPublic(paddedMsg, key) {\n return Buffer2.from(paddedMsg.toRed(BN.mont(key.modulus)).redPow(new BN(key.publicExponent)).fromRed().toArray());\n }\n module.exports = withPublic;\n }\n}), require_publicEncrypt = __commonJS({\n \"node_modules/public-encrypt/publicEncrypt.js\"(exports, module) {\n var parseKeys = require_parse_asn1(), randomBytes = require_browser(), createHash = require_browser2(), mgf = require_mgf(), xor = require_xor(), BN = require_bn7(), withPublic = require_withPublic(), crt = require_browserify_rsa(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(publicKey, msg, reverse) {\n var padding;\n publicKey.padding \? padding = publicKey.padding : reverse \? padding = 1 : padding = 4;\n var key = parseKeys(publicKey), paddedMsg;\n if (padding === 4)\n paddedMsg = oaep(key, msg);\n else if (padding === 1)\n paddedMsg = pkcs1(key, msg, reverse);\n else if (padding === 3) {\n if (paddedMsg = new BN(msg), paddedMsg.cmp(key.modulus) >= 0)\n throw new Error(\"data too long for modulus\");\n } else\n throw new Error(\"unknown padding\");\n return reverse \? crt(paddedMsg, key) : withPublic(paddedMsg, key);\n };\n function oaep(key, msg) {\n var k = key.modulus.byteLength(), mLen = msg.length, iHash = createHash(\"sha1\").update(Buffer2.alloc(0)).digest(), hLen = iHash.length, hLen2 = 2 * hLen;\n if (mLen > k - hLen2 - 2)\n throw new Error(\"message too long\");\n var ps = Buffer2.alloc(k - mLen - hLen2 - 2), dblen = k - hLen - 1, seed = randomBytes(hLen), maskedDb = xor(Buffer2.concat([iHash, ps, Buffer2.alloc(1, 1), msg], dblen), mgf(seed, dblen)), maskedSeed = xor(seed, mgf(maskedDb, hLen));\n return new BN(Buffer2.concat([Buffer2.alloc(1), maskedSeed, maskedDb], k));\n }\n function pkcs1(key, msg, reverse) {\n var mLen = msg.length, k = key.modulus.byteLength();\n if (mLen > k - 11)\n throw new Error(\"message too long\");\n var ps;\n return reverse \? ps = Buffer2.alloc(k - mLen - 3, 255) : ps = nonZero(k - mLen - 3), new BN(Buffer2.concat([Buffer2.from([0, reverse \? 1 : 2]), ps, Buffer2.alloc(1), msg], k));\n }\n function nonZero(len) {\n for (var out = Buffer2.allocUnsafe(len), i = 0, cache = randomBytes(len * 2), cur = 0, num;i < len; )\n cur === cache.length && (cache = randomBytes(len * 2), cur = 0), num = cache[cur++], num && (out[i++] = num);\n return out;\n }\n }\n}), require_privateDecrypt = __commonJS({\n \"node_modules/public-encrypt/privateDecrypt.js\"(exports, module) {\n var parseKeys = require_parse_asn1(), mgf = require_mgf(), xor = require_xor(), BN = require_bn7(), crt = require_browserify_rsa(), createHash = require_browser2(), withPublic = require_withPublic(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(privateKey, enc, reverse) {\n var padding;\n privateKey.padding \? padding = privateKey.padding : reverse \? padding = 1 : padding = 4;\n var key = parseKeys(privateKey), k = key.modulus.byteLength();\n if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0)\n throw new Error(\"decryption error\");\n var msg;\n reverse \? msg = withPublic(new BN(enc), key) : msg = crt(enc, key);\n var zBuffer = Buffer2.alloc(k - msg.length);\n if (msg = Buffer2.concat([zBuffer, msg], k), padding === 4)\n return oaep(key, msg);\n if (padding === 1)\n return pkcs1(key, msg, reverse);\n if (padding === 3)\n return msg;\n throw new Error(\"unknown padding\");\n };\n function oaep(key, msg) {\n var k = key.modulus.byteLength(), iHash = createHash(\"sha1\").update(Buffer2.alloc(0)).digest(), hLen = iHash.length;\n if (msg[0] !== 0)\n throw new Error(\"decryption error\");\n var maskedSeed = msg.slice(1, hLen + 1), maskedDb = msg.slice(hLen + 1), seed = xor(maskedSeed, mgf(maskedDb, hLen)), db = xor(maskedDb, mgf(seed, k - hLen - 1));\n if (compare(iHash, db.slice(0, hLen)))\n throw new Error(\"decryption error\");\n for (var i = hLen;db[i] === 0; )\n i++;\n if (db[i++] !== 1)\n throw new Error(\"decryption error\");\n return db.slice(i);\n }\n function pkcs1(key, msg, reverse) {\n for (var p1 = msg.slice(0, 2), i = 2, status = 0;msg[i++] !== 0; )\n if (i >= msg.length) {\n status++;\n break;\n }\n var ps = msg.slice(2, i - 1);\n if ((p1.toString(\"hex\") !== \"0002\" && !reverse || p1.toString(\"hex\") !== \"0001\" && reverse) && status++, ps.length < 8 && status++, status)\n throw new Error(\"decryption error\");\n return msg.slice(i);\n }\n function compare(a, b) {\n a = Buffer2.from(a), b = Buffer2.from(b);\n var dif = 0, len = a.length;\n a.length !== b.length && (dif++, len = Math.min(a.length, b.length));\n for (var i = -1;++i < len; )\n dif += a[i] ^ b[i];\n return dif;\n }\n }\n}), require_browser10 = __commonJS({\n \"node_modules/public-encrypt/browser.js\"(exports) {\n exports.publicEncrypt = require_publicEncrypt(), exports.privateDecrypt = require_privateDecrypt(), exports.privateEncrypt = function(key, buf) {\n return exports.publicEncrypt(key, buf, !0);\n }, exports.publicDecrypt = function(key, buf) {\n return exports.privateDecrypt(key, buf, !0);\n };\n }\n}), require_browser11 = __commonJS({\n \"node_modules/randomfill/browser.js\"(exports) {\n var safeBuffer = require_safe_buffer(), randombytes = require_browser(), Buffer2 = safeBuffer.Buffer, kBufferMaxLength = safeBuffer.kMaxLength, kMaxUint32 = Math.pow(2, 32) - 1;\n function assertOffset(offset, length) {\n if (typeof offset != \"number\" || offset !== offset)\n @throwTypeError(\"offset must be a number\");\n if (offset > kMaxUint32 || offset < 0)\n @throwTypeError(\"offset must be a uint32\");\n if (offset > kBufferMaxLength || offset > length)\n @throwRangeError(\"offset out of range\");\n }\n function assertSize(size, offset, length) {\n if (typeof size != \"number\" || size !== size)\n @throwTypeError(\"size must be a number\");\n if (size > kMaxUint32 || size < 0)\n @throwTypeError(\"size must be a uint32\");\n if (size + offset > length || size > kBufferMaxLength)\n @throwRangeError(\"buffer too small\");\n }\n exports.randomFill = randomFill, exports.randomFillSync = randomFillSync;\n function randomFill(buf, offset, size, cb) {\n if (!Buffer2.isBuffer(buf) && !(buf instanceof global.Uint8Array))\n @throwTypeError('\"buf\" argument must be a Buffer or Uint8Array');\n if (typeof offset == \"function\")\n cb = offset, offset = 0, size = buf.length;\n else if (typeof size == \"function\")\n cb = size, size = buf.length - offset;\n else if (typeof cb != \"function\")\n @throwTypeError('\"cb\" argument must be a function');\n return assertOffset(offset, buf.length), assertSize(size, offset, buf.length), actualFill(buf, offset, size, cb);\n }\n function actualFill(buf, offset, size, cb) {\n if (cb) {\n randombytes(size, function(err, bytes2) {\n if (err)\n return cb(err);\n bytes2.copy(buf, offset), cb(null, buf);\n });\n return;\n }\n var bytes = randombytes(size);\n return bytes.copy(buf, offset), buf;\n }\n function randomFillSync(buf, offset, size) {\n if (typeof offset > \"u\" && (offset = 0), !Buffer2.isBuffer(buf) && !(buf instanceof global.Uint8Array))\n @throwTypeError('\"buf\" argument must be a Buffer or Uint8Array');\n return assertOffset(offset, buf.length), size === void 0 && (size = buf.length - offset), assertSize(size, offset, buf.length), actualFill(buf, offset, size);\n }\n }\n}), require_crypto_browserify2 = __commonJS({\n \"node_modules/crypto-browserify/index.js\"(exports) {\n exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require_browser(), exports.createHash = require_browser2(), exports.Hash = exports.createHash.Hash, exports.createHmac = exports.Hmac = require_browser3();\n var algos = require_algos(), algoKeys = Object.keys(algos), hashes = [\"sha1\", \"sha224\", \"sha256\", \"sha384\", \"sha512\", \"md5\", \"rmd160\"].concat(algoKeys);\n exports.getHashes = function() {\n return hashes;\n };\n var p = require_browser4();\n exports.pbkdf2 = p.pbkdf2, exports.pbkdf2Sync = p.pbkdf2Sync;\n var aes = require_browser6();\n exports.Cipher = aes.Cipher, exports.createCipher = aes.createCipher, exports.Cipheriv = aes.Cipheriv, exports.createCipheriv = aes.createCipheriv, exports.Decipher = aes.Decipher, exports.createDecipher = aes.createDecipher, exports.Decipheriv = aes.Decipheriv, exports.createDecipheriv = aes.createDecipheriv, exports.getCiphers = aes.getCiphers, exports.listCiphers = aes.listCiphers;\n var dh = require_browser7();\n exports.DiffieHellmanGroup = dh.DiffieHellmanGroup, exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup, exports.getDiffieHellman = dh.getDiffieHellman, exports.createDiffieHellman = dh.createDiffieHellman, exports.DiffieHellman = dh.DiffieHellman;\n var sign = require_browser8();\n exports.createSign = sign.createSign, exports.Sign = sign.Sign, exports.createVerify = sign.createVerify, exports.Verify = sign.Verify, exports.createECDH = require_browser9();\n var publicEncrypt = require_browser10();\n exports.publicEncrypt = publicEncrypt.publicEncrypt, exports.privateEncrypt = publicEncrypt.privateEncrypt, exports.publicDecrypt = publicEncrypt.publicDecrypt, exports.privateDecrypt = publicEncrypt.privateDecrypt, exports.getRandomValues = (values) => crypto.getRandomValues(values);\n var rf = require_browser11();\n exports.randomFill = rf.randomFill, exports.randomFillSync = rf.randomFillSync, exports.createCredentials = function() {\n throw new Error([\n \"sorry, createCredentials is not implemented yet\",\n \"we accept pull requests\",\n \"https://github.com/crypto-browserify/crypto-browserify\"\n ].join(`\n`));\n }, exports.constants = @processBindingConstants.crypto;\n }\n}), crypto_exports = require_crypto_browserify2(), DEFAULT_ENCODING = \"buffer\", getRandomValues = (array) => crypto.getRandomValues(array), randomUUID = () => crypto.randomUUID(), randomInt = (...args) => crypto.randomInt(...args), timingSafeEqual = \"timingSafeEqual\" in crypto \? (a, b) => {\n let { byteLength: byteLengthA } = a, { byteLength: byteLengthB } = b;\n if (typeof byteLengthA != \"number\" || typeof byteLengthB != \"number\")\n @throwTypeError(\"Input must be an array buffer view\");\n if (byteLengthA !== byteLengthB)\n @throwRangeError(\"Input buffers must have the same length\");\n return crypto.timingSafeEqual(a, b);\n} : void 0, scryptSync = \"scryptSync\" in crypto \? (password, salt, keylen, options) => {\n let res = crypto.scryptSync(password, salt, keylen, options);\n return DEFAULT_ENCODING !== \"buffer\" \? new Buffer(res).toString(DEFAULT_ENCODING) : new Buffer(res);\n} : void 0, scrypt = \"scryptSync\" in crypto \? function(password, salt, keylen, options, callback) {\n if (typeof options == \"function\" && (callback = options, options = void 0), typeof callback != \"function\") {\n var err = @makeTypeError(\"callback must be a function\");\n throw err.code = \"ERR_INVALID_CALLBACK\", err;\n }\n try {\n let result = crypto.scryptSync(password, salt, keylen, options);\n process.nextTick(callback, null, DEFAULT_ENCODING !== \"buffer\" \? new Buffer(result).toString(DEFAULT_ENCODING) : new Buffer(result));\n } catch (err2) {\n throw err2;\n }\n} : void 0;\ntimingSafeEqual && (Object.defineProperty(timingSafeEqual, \"name\", {\n value: \"::bunternal::\"\n}), Object.defineProperty(scrypt, \"name\", {\n value: \"::bunternal::\"\n}), Object.defineProperty(scryptSync, \"name\", {\n value: \"::bunternal::\"\n}));\nvar harcoded_curves = [\n \"p192\",\n \"p224\",\n \"p256\",\n \"p384\",\n \"p521\",\n \"curve25519\",\n \"ed25519\",\n \"secp256k1\",\n \"secp224r1\",\n \"prime256v1\",\n \"prime192v1\",\n \"ed25519\",\n \"secp384r1\",\n \"secp521r1\"\n], webcrypto = crypto;\n__export(crypto_exports, {\n DEFAULT_ENCODING: () => DEFAULT_ENCODING,\n getRandomValues: () => getRandomValues,\n randomUUID: () => randomUUID,\n randomInt: () => randomInt,\n getCurves: () => getCurves,\n scrypt: () => scrypt,\n scryptSync: () => scryptSync,\n timingSafeEqual: () => timingSafeEqual,\n webcrypto: () => webcrypto,\n subtle: () => webcrypto.subtle\n});\n$ = crypto_exports;\n/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeCryptoCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/crypto.ts\nvar exportIfKeyObject = function(key2) {\n if (key2 instanceof KeyObject)\n key2 = key2.export();\n else if (key2 instanceof CryptoKey)\n key2 = KeyObject.from(key2).export();\n return key2;\n}, getKeyFrom = function(key2, type) {\n if (key2 instanceof KeyObject)\n key2 = key2.export();\n else if (key2 instanceof CryptoKey)\n key2 = KeyObject.from(key2).export();\n else if (!Buffer.isBuffer(key2) && typeof key2 === \"object\") {\n if ((typeof key2.format === \"string\" || typeof key2.passphrase === \"string\") && typeof key2.key !== \"undefined\")\n key2 = type === \"public\" \? _createPublicKey(key2).export() : _createPrivateKey(key2).export();\n } else if (typeof key2 === \"string\" && type === \"public\")\n key2.indexOf(\"PRIVATE KEY-----\") !== -1 && (key2 = _createPublicKey(key2).export());\n return key2;\n}, getArrayBufferOrView = function(buffer, name, encoding) {\n if (buffer instanceof KeyObject) {\n if (buffer.type !== \"secret\") {\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key.type}, expected secret`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n }\n buffer = buffer.export();\n }\n if (isAnyArrayBuffer(buffer))\n return buffer;\n if (typeof buffer === \"string\") {\n if (encoding === \"buffer\")\n encoding = \"utf8\";\n return Buffer.from(buffer, encoding);\n }\n if (!isArrayBufferView(buffer)) {\n var error = @makeTypeError(`ERR_INVALID_ARG_TYPE: The \"${name}\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, or DataView. Received ` + buffer);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n return buffer;\n}, getCurves = function() {\n return harcoded_curves;\n}, _generateKeyPairSync = function(algorithm, options) {\n const result = generateKeyPairSync(algorithm, options);\n if (result) {\n const publicKeyEncoding = options\?.publicKeyEncoding, privateKeyEncoding = options\?.privateKeyEncoding;\n result.publicKey = publicKeyEncoding \? KeyObject.from(result.publicKey).export(publicKeyEncoding) : KeyObject.from(result.publicKey), result.privateKey = privateKeyEncoding \? KeyObject.from(result.privateKey).export(privateKeyEncoding) : KeyObject.from(result.privateKey);\n }\n return result;\n}, _createPrivateKey = function(key2) {\n if (typeof key2 === \"string\")\n return key2 = Buffer.from(key2, \"utf8\"), KeyObject.from(createPrivateKey({ key: key2, format: \"pem\" }));\n else if (isAnyArrayBuffer(key2) || isArrayBufferView(key2))\n return KeyObject.from(createPrivateKey({ key: key2, format: \"pem\" }));\n else if (typeof key2 === \"object\")\n if (key2 instanceof KeyObject || key2 instanceof CryptoKey) {\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key2.type}`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n } else {\n let actual_key = key2.key;\n if (typeof actual_key === \"string\")\n actual_key = Buffer.from(actual_key, key2.encoding || \"utf8\"), key2.key = actual_key;\n else if (actual_key instanceof KeyObject || actual_key instanceof CryptoKey) {\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key2.type}`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n }\n if (!isAnyArrayBuffer(actual_key) && !isArrayBufferView(actual_key) && typeof actual_key !== \"object\") {\n var error = @makeTypeError('ERR_INVALID_ARG_TYPE: The \"key\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ' + actual_key);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n if (!key2.format)\n key2.format = \"pem\";\n return KeyObject.from(createPrivateKey(key2));\n }\n else {\n var error = @makeTypeError('ERR_INVALID_ARG_TYPE: The \"key\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ' + key2);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n}, _createPublicKey = function(key2) {\n if (typeof key2 === \"string\")\n return key2 = Buffer.from(key2, \"utf8\"), KeyObject.from(createPublicKey({ key: key2, format: \"pem\" }));\n else if (isAnyArrayBuffer(key2) || isArrayBufferView(key2))\n return KeyObject.from(createPublicKey({ key: key2, format: \"pem\" }));\n else if (typeof key2 === \"object\")\n if (key2 instanceof KeyObject || key2 instanceof CryptoKey) {\n if (key2.type === \"private\")\n return KeyObject.from(createPublicKey({ key: key2[kCryptoKey] || key2, format: \"\" }));\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key2.type}, expected private`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n } else {\n if (key2.passphrase) {\n let actual_key2 = key2.key;\n if (typeof actual_key2 === \"string\")\n actual_key2 = Buffer.from(actual_key2, key2.encoding || \"utf8\");\n return KeyObject.from(createPublicKey({\n key: createPrivateKey({ key: actual_key2, format: key2.format, passphrase: key2.passphrase }),\n format: \"\"\n }));\n }\n let actual_key = key2.key;\n if (typeof actual_key === \"string\")\n actual_key = Buffer.from(actual_key, key2.encoding || \"utf8\"), key2.key = actual_key;\n else if (actual_key instanceof KeyObject || actual_key instanceof CryptoKey) {\n if (actual_key.type === \"private\")\n return KeyObject.from(createPublicKey({ key: actual_key[kCryptoKey] || actual_key, format: \"\" }));\n const error2 = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${actual_key.type}, expected private`);\n throw error2.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error2;\n }\n if (!isAnyArrayBuffer(actual_key) && !isArrayBufferView(actual_key) && typeof actual_key !== \"object\") {\n var error = @makeTypeError('ERR_INVALID_ARG_TYPE: The \"key\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ' + key2);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n if (!key2.format)\n key2.format = \"pem\";\n return KeyObject.from(createPublicKey(key2));\n }\n else {\n var error = @makeTypeError('ERR_INVALID_ARG_TYPE: The \"key\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView or object. Received ' + key2);\n throw error.code = \"ERR_INVALID_ARG_TYPE\", error;\n }\n}, $, __defProp = Object.defineProperty, __getOwnPropNames = Object.getOwnPropertyNames, StreamModule = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), BufferModule = @requireNativeModule(\"buffer\"), StringDecoder = @requireNativeModule(\"string_decoder\").StringDecoder, MAX_STRING_LENGTH = 536870888, Buffer = globalThis.Buffer, EMPTY_BUFFER = Buffer.alloc(0), { isAnyArrayBuffer, isArrayBufferView } = @requireNativeModule(\"util/types\"), crypto = globalThis.crypto, globalCrypto = crypto, __commonJS = (cb, mod) => function() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: !0 });\n}, require_safe_buffer = __commonJS({\n \"node_modules/safe-buffer/index.js\"(exports, module) {\n var buffer = BufferModule, Buffer2 = buffer.Buffer;\n function copyProps(src, dst) {\n for (var key2 in src)\n dst[key2] = src[key2];\n }\n Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow \? module.exports = buffer : (copyProps(buffer, exports), exports.Buffer = SafeBuffer);\n function SafeBuffer(arg, encodingOrOffset, length) {\n return Buffer2(arg, encodingOrOffset, length);\n }\n SafeBuffer.prototype = Object.create(Buffer2.prototype), copyProps(Buffer2, SafeBuffer), SafeBuffer.from = function(arg, encodingOrOffset, length) {\n if (typeof arg == \"number\")\n @throwTypeError(\"Argument must not be a number\");\n return Buffer2(arg, encodingOrOffset, length);\n }, SafeBuffer.alloc = function(size, fill, encoding) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n var buf = Buffer2(size);\n return fill !== void 0 \? typeof encoding == \"string\" \? buf.fill(fill, encoding) : buf.fill(fill) : buf.fill(0), buf;\n }, SafeBuffer.allocUnsafe = function(size) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n return Buffer2(size);\n }, SafeBuffer.allocUnsafeSlow = function(size) {\n if (typeof size != \"number\")\n @throwTypeError(\"Argument must be a number\");\n return buffer.SlowBuffer(size);\n };\n }\n}), require_browser = __commonJS({\n \"node_modules/randombytes/browser.js\"(exports, module) {\n var MAX_BYTES = 65536, MAX_UINT32 = 4294967295;\n function oldBrowser() {\n throw new Error(`Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11`);\n }\n var Buffer2 = require_safe_buffer().Buffer, crypto2 = globalCrypto;\n crypto2 && crypto2.getRandomValues \? module.exports = randomBytes : module.exports = oldBrowser;\n function randomBytes(size, cb) {\n if (size > MAX_UINT32)\n @throwRangeError(\"requested too many random bytes\");\n var bytes = Buffer2.allocUnsafe(size);\n if (size > 0)\n if (size > MAX_BYTES)\n for (var generated = 0;generated < size; generated += MAX_BYTES)\n crypto2.getRandomValues(bytes.slice(generated, generated + MAX_BYTES));\n else\n crypto2.getRandomValues(bytes);\n return typeof cb == \"function\" \? process.nextTick(function() {\n cb(null, bytes);\n }) : bytes;\n }\n }\n}), require_inherits_browser = __commonJS({\n \"node_modules/inherits/inherits_browser.js\"(exports, module) {\n module.exports = function(ctor, superCtor) {\n superCtor && (ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }));\n };\n }\n}), require_hash_base = __commonJS({\n \"node_modules/hash-base/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, inherits = require_inherits_browser();\n function throwIfNotStringOrBuffer(val, prefix) {\n if (!Buffer2.isBuffer(val) && typeof val != \"string\")\n @throwTypeError(prefix + \" must be a string or a buffer\");\n }\n function HashBase(blockSize) {\n StreamModule.Transform.@call(this), this._block = Buffer2.allocUnsafe(blockSize), this._blockSize = blockSize, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = !1;\n }\n inherits(HashBase, StreamModule.Transform), HashBase.prototype._transform = function(chunk, encoding, callback) {\n var error = null;\n try {\n this.update(chunk, encoding);\n } catch (err) {\n error = err;\n }\n callback(error);\n }, HashBase.prototype._flush = function(callback) {\n var error = null;\n try {\n this.push(this.digest());\n } catch (err) {\n error = err;\n }\n callback(error);\n }, HashBase.prototype.update = function(data, encoding) {\n if (throwIfNotStringOrBuffer(data, \"Data\"), this._finalized)\n throw new Error(\"Digest already called\");\n Buffer2.isBuffer(data) || (data = Buffer2.from(data, encoding));\n for (var block = this._block, offset = 0;this._blockOffset + data.length - offset >= this._blockSize; ) {\n for (var i = this._blockOffset;i < this._blockSize; )\n block[i++] = data[offset++];\n this._update(), this._blockOffset = 0;\n }\n for (;offset < data.length; )\n block[this._blockOffset++] = data[offset++];\n for (var j = 0, carry = data.length * 8;carry > 0; ++j)\n this._length[j] += carry, carry = this._length[j] / 4294967296 | 0, carry > 0 && (this._length[j] -= 4294967296 * carry);\n return this;\n }, HashBase.prototype._update = function() {\n throw new Error(\"_update is not implemented\");\n }, HashBase.prototype.digest = function(encoding) {\n if (this._finalized)\n throw new Error(\"Digest already called\");\n this._finalized = !0;\n var digest = this._digest();\n encoding !== void 0 && (digest = digest.toString(encoding)), this._block.fill(0), this._blockOffset = 0;\n for (var i = 0;i < 4; ++i)\n this._length[i] = 0;\n return digest;\n }, HashBase.prototype._digest = function() {\n throw new Error(\"_digest is not implemented\");\n }, module.exports = HashBase;\n }\n}), require_md5 = __commonJS({\n \"node_modules/md5.js/index.js\"(exports, module) {\n var inherits = require_inherits_browser(), HashBase = require_hash_base(), Buffer2 = require_safe_buffer().Buffer, ARRAY16 = new @Array(16);\n function MD5() {\n HashBase.@call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878;\n }\n inherits(MD5, HashBase), MD5.prototype._update = function() {\n for (var M = ARRAY16, i = 0;i < 16; ++i)\n M[i] = this._block.readInt32LE(i * 4);\n var a = this._a, b = this._b, c = this._c, d = this._d;\n a = fnF(a, b, c, d, M[0], 3614090360, 7), d = fnF(d, a, b, c, M[1], 3905402710, 12), c = fnF(c, d, a, b, M[2], 606105819, 17), b = fnF(b, c, d, a, M[3], 3250441966, 22), a = fnF(a, b, c, d, M[4], 4118548399, 7), d = fnF(d, a, b, c, M[5], 1200080426, 12), c = fnF(c, d, a, b, M[6], 2821735955, 17), b = fnF(b, c, d, a, M[7], 4249261313, 22), a = fnF(a, b, c, d, M[8], 1770035416, 7), d = fnF(d, a, b, c, M[9], 2336552879, 12), c = fnF(c, d, a, b, M[10], 4294925233, 17), b = fnF(b, c, d, a, M[11], 2304563134, 22), a = fnF(a, b, c, d, M[12], 1804603682, 7), d = fnF(d, a, b, c, M[13], 4254626195, 12), c = fnF(c, d, a, b, M[14], 2792965006, 17), b = fnF(b, c, d, a, M[15], 1236535329, 22), a = fnG(a, b, c, d, M[1], 4129170786, 5), d = fnG(d, a, b, c, M[6], 3225465664, 9), c = fnG(c, d, a, b, M[11], 643717713, 14), b = fnG(b, c, d, a, M[0], 3921069994, 20), a = fnG(a, b, c, d, M[5], 3593408605, 5), d = fnG(d, a, b, c, M[10], 38016083, 9), c = fnG(c, d, a, b, M[15], 3634488961, 14), b = fnG(b, c, d, a, M[4], 3889429448, 20), a = fnG(a, b, c, d, M[9], 568446438, 5), d = fnG(d, a, b, c, M[14], 3275163606, 9), c = fnG(c, d, a, b, M[3], 4107603335, 14), b = fnG(b, c, d, a, M[8], 1163531501, 20), a = fnG(a, b, c, d, M[13], 2850285829, 5), d = fnG(d, a, b, c, M[2], 4243563512, 9), c = fnG(c, d, a, b, M[7], 1735328473, 14), b = fnG(b, c, d, a, M[12], 2368359562, 20), a = fnH(a, b, c, d, M[5], 4294588738, 4), d = fnH(d, a, b, c, M[8], 2272392833, 11), c = fnH(c, d, a, b, M[11], 1839030562, 16), b = fnH(b, c, d, a, M[14], 4259657740, 23), a = fnH(a, b, c, d, M[1], 2763975236, 4), d = fnH(d, a, b, c, M[4], 1272893353, 11), c = fnH(c, d, a, b, M[7], 4139469664, 16), b = fnH(b, c, d, a, M[10], 3200236656, 23), a = fnH(a, b, c, d, M[13], 681279174, 4), d = fnH(d, a, b, c, M[0], 3936430074, 11), c = fnH(c, d, a, b, M[3], 3572445317, 16), b = fnH(b, c, d, a, M[6], 76029189, 23), a = fnH(a, b, c, d, M[9], 3654602809, 4), d = fnH(d, a, b, c, M[12], 3873151461, 11), c = fnH(c, d, a, b, M[15], 530742520, 16), b = fnH(b, c, d, a, M[2], 3299628645, 23), a = fnI(a, b, c, d, M[0], 4096336452, 6), d = fnI(d, a, b, c, M[7], 1126891415, 10), c = fnI(c, d, a, b, M[14], 2878612391, 15), b = fnI(b, c, d, a, M[5], 4237533241, 21), a = fnI(a, b, c, d, M[12], 1700485571, 6), d = fnI(d, a, b, c, M[3], 2399980690, 10), c = fnI(c, d, a, b, M[10], 4293915773, 15), b = fnI(b, c, d, a, M[1], 2240044497, 21), a = fnI(a, b, c, d, M[8], 1873313359, 6), d = fnI(d, a, b, c, M[15], 4264355552, 10), c = fnI(c, d, a, b, M[6], 2734768916, 15), b = fnI(b, c, d, a, M[13], 1309151649, 21), a = fnI(a, b, c, d, M[4], 4149444226, 6), d = fnI(d, a, b, c, M[11], 3174756917, 10), c = fnI(c, d, a, b, M[2], 718787259, 15), b = fnI(b, c, d, a, M[9], 3951481745, 21), this._a = this._a + a | 0, this._b = this._b + b | 0, this._c = this._c + c | 0, this._d = this._d + d | 0;\n }, MD5.prototype._digest = function() {\n this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();\n var buffer = Buffer2.allocUnsafe(16);\n return buffer.writeInt32LE(this._a, 0), buffer.writeInt32LE(this._b, 4), buffer.writeInt32LE(this._c, 8), buffer.writeInt32LE(this._d, 12), buffer;\n };\n function rotl(x, n) {\n return x << n | x >>> 32 - n;\n }\n function fnF(a, b, c, d, m, k, s) {\n return rotl(a + (b & c | ~b & d) + m + k | 0, s) + b | 0;\n }\n function fnG(a, b, c, d, m, k, s) {\n return rotl(a + (b & d | c & ~d) + m + k | 0, s) + b | 0;\n }\n function fnH(a, b, c, d, m, k, s) {\n return rotl(a + (b ^ c ^ d) + m + k | 0, s) + b | 0;\n }\n function fnI(a, b, c, d, m, k, s) {\n return rotl(a + (c ^ (b | ~d)) + m + k | 0, s) + b | 0;\n }\n module.exports = MD5;\n }\n}), require_ripemd160 = __commonJS({\n \"node_modules/ripemd160/index.js\"(exports, module) {\n var Buffer2 = Buffer, inherits = require_inherits_browser(), HashBase = require_hash_base(), ARRAY16 = new @Array(16), zl = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 7,\n 4,\n 13,\n 1,\n 10,\n 6,\n 15,\n 3,\n 12,\n 0,\n 9,\n 5,\n 2,\n 14,\n 11,\n 8,\n 3,\n 10,\n 14,\n 4,\n 9,\n 15,\n 8,\n 1,\n 2,\n 7,\n 0,\n 6,\n 13,\n 11,\n 5,\n 12,\n 1,\n 9,\n 11,\n 10,\n 0,\n 8,\n 12,\n 4,\n 13,\n 3,\n 7,\n 15,\n 14,\n 5,\n 6,\n 2,\n 4,\n 0,\n 5,\n 9,\n 7,\n 12,\n 2,\n 10,\n 14,\n 1,\n 3,\n 8,\n 11,\n 6,\n 15,\n 13\n ], zr = [\n 5,\n 14,\n 7,\n 0,\n 9,\n 2,\n 11,\n 4,\n 13,\n 6,\n 15,\n 8,\n 1,\n 10,\n 3,\n 12,\n 6,\n 11,\n 3,\n 7,\n 0,\n 13,\n 5,\n 10,\n 14,\n 15,\n 8,\n 12,\n 4,\n 9,\n 1,\n 2,\n 15,\n 5,\n 1,\n 3,\n 7,\n 14,\n 6,\n 9,\n 11,\n 8,\n 12,\n 2,\n 10,\n 0,\n 4,\n 13,\n 8,\n 6,\n 4,\n 1,\n 3,\n 11,\n 15,\n 0,\n 5,\n 12,\n 2,\n 13,\n 9,\n 7,\n 10,\n 14,\n 12,\n 15,\n 10,\n 4,\n 1,\n 5,\n 8,\n 7,\n 6,\n 2,\n 13,\n 14,\n 0,\n 3,\n 9,\n 11\n ], sl = [\n 11,\n 14,\n 15,\n 12,\n 5,\n 8,\n 7,\n 9,\n 11,\n 13,\n 14,\n 15,\n 6,\n 7,\n 9,\n 8,\n 7,\n 6,\n 8,\n 13,\n 11,\n 9,\n 7,\n 15,\n 7,\n 12,\n 15,\n 9,\n 11,\n 7,\n 13,\n 12,\n 11,\n 13,\n 6,\n 7,\n 14,\n 9,\n 13,\n 15,\n 14,\n 8,\n 13,\n 6,\n 5,\n 12,\n 7,\n 5,\n 11,\n 12,\n 14,\n 15,\n 14,\n 15,\n 9,\n 8,\n 9,\n 14,\n 5,\n 6,\n 8,\n 6,\n 5,\n 12,\n 9,\n 15,\n 5,\n 11,\n 6,\n 8,\n 13,\n 12,\n 5,\n 12,\n 13,\n 14,\n 11,\n 8,\n 5,\n 6\n ], sr = [\n 8,\n 9,\n 9,\n 11,\n 13,\n 15,\n 15,\n 5,\n 7,\n 7,\n 8,\n 11,\n 14,\n 14,\n 12,\n 6,\n 9,\n 13,\n 15,\n 7,\n 12,\n 8,\n 9,\n 11,\n 7,\n 7,\n 12,\n 7,\n 6,\n 15,\n 13,\n 11,\n 9,\n 7,\n 15,\n 11,\n 8,\n 6,\n 6,\n 14,\n 12,\n 13,\n 5,\n 14,\n 13,\n 13,\n 7,\n 5,\n 15,\n 5,\n 8,\n 11,\n 14,\n 14,\n 6,\n 14,\n 6,\n 9,\n 12,\n 9,\n 12,\n 5,\n 15,\n 8,\n 8,\n 5,\n 12,\n 9,\n 12,\n 5,\n 14,\n 6,\n 8,\n 13,\n 6,\n 5,\n 15,\n 13,\n 11,\n 11\n ], hl = [0, 1518500249, 1859775393, 2400959708, 2840853838], hr = [1352829926, 1548603684, 1836072691, 2053994217, 0];\n function RIPEMD160() {\n HashBase.@call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520;\n }\n inherits(RIPEMD160, HashBase), RIPEMD160.prototype._update = function() {\n for (var words = ARRAY16, j = 0;j < 16; ++j)\n words[j] = this._block.readInt32LE(j * 4);\n for (var al = this._a | 0, bl = this._b | 0, cl = this._c | 0, dl = this._d | 0, el = this._e | 0, ar = this._a | 0, br = this._b | 0, cr = this._c | 0, dr = this._d | 0, er = this._e | 0, i = 0;i < 80; i += 1) {\n var tl, tr;\n i < 16 \? (tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i]), tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])) : i < 32 \? (tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i]), tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])) : i < 48 \? (tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i]), tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])) : i < 64 \? (tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i]), tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])) : (tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i]), tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])), al = el, el = dl, dl = rotl(cl, 10), cl = bl, bl = tl, ar = er, er = dr, dr = rotl(cr, 10), cr = br, br = tr;\n }\n var t = this._b + cl + dr | 0;\n this._b = this._c + dl + er | 0, this._c = this._d + el + ar | 0, this._d = this._e + al + br | 0, this._e = this._a + bl + cr | 0, this._a = t;\n }, RIPEMD160.prototype._digest = function() {\n this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();\n var buffer = Buffer2.alloc \? Buffer2.alloc(20) : new Buffer2(20);\n return buffer.writeInt32LE(this._a, 0), buffer.writeInt32LE(this._b, 4), buffer.writeInt32LE(this._c, 8), buffer.writeInt32LE(this._d, 12), buffer.writeInt32LE(this._e, 16), buffer;\n };\n function rotl(x, n) {\n return x << n | x >>> 32 - n;\n }\n function fn1(a, b, c, d, e, m, k, s) {\n return rotl(a + (b ^ c ^ d) + m + k | 0, s) + e | 0;\n }\n function fn2(a, b, c, d, e, m, k, s) {\n return rotl(a + (b & c | ~b & d) + m + k | 0, s) + e | 0;\n }\n function fn3(a, b, c, d, e, m, k, s) {\n return rotl(a + ((b | ~c) ^ d) + m + k | 0, s) + e | 0;\n }\n function fn4(a, b, c, d, e, m, k, s) {\n return rotl(a + (b & d | c & ~d) + m + k | 0, s) + e | 0;\n }\n function fn5(a, b, c, d, e, m, k, s) {\n return rotl(a + (b ^ (c | ~d)) + m + k | 0, s) + e | 0;\n }\n module.exports = RIPEMD160;\n }\n}), require_hash = __commonJS({\n \"node_modules/sha.js/hash.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n function Hash(blockSize, finalSize) {\n this._block = Buffer2.alloc(blockSize), this._finalSize = finalSize, this._blockSize = blockSize, this._len = 0;\n }\n Hash.prototype = {}, Hash.prototype.update = function(data, enc) {\n typeof data == \"string\" && (enc = enc || \"utf8\", data = Buffer2.from(data, enc));\n for (var block = this._block, blockSize = this._blockSize, length = data.length, accum = this._len, offset = 0;offset < length; ) {\n for (var assigned = accum % blockSize, remainder = Math.min(length - offset, blockSize - assigned), i = 0;i < remainder; i++)\n block[assigned + i] = data[offset + i];\n accum += remainder, offset += remainder, accum % blockSize === 0 && this._update(block);\n }\n return this._len += length, this;\n }, Hash.prototype.digest = function(enc) {\n var rem = this._len % this._blockSize;\n this._block[rem] = 128, this._block.fill(0, rem + 1), rem >= this._finalSize && (this._update(this._block), this._block.fill(0));\n var bits = this._len * 8;\n if (bits <= 4294967295)\n this._block.writeUInt32BE(bits, this._blockSize - 4);\n else {\n var lowBits = (bits & 4294967295) >>> 0, highBits = (bits - lowBits) / 4294967296;\n this._block.writeUInt32BE(highBits, this._blockSize - 8), this._block.writeUInt32BE(lowBits, this._blockSize - 4);\n }\n this._update(this._block);\n var hash = this._hash();\n return enc \? hash.toString(enc) : hash;\n }, Hash.prototype._update = function() {\n throw new Error(\"_update must be implemented by subclass\");\n }, module.exports = Hash;\n }\n}), require_sha = __commonJS({\n \"node_modules/sha.js/sha.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [1518500249, 1859775393, -1894007588, -899497514], W = new @Array(80);\n function Sha() {\n this.init(), this._w = W, Hash.@call(this, 64, 56);\n }\n inherits(Sha, Hash), Sha.prototype.init = function() {\n return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;\n };\n function rotl5(num) {\n return num << 5 | num >>> 27;\n }\n function rotl30(num) {\n return num << 30 | num >>> 2;\n }\n function ft(s, b, c, d) {\n return s === 0 \? b & c | ~b & d : s === 2 \? b & c | b & d | c & d : b ^ c ^ d;\n }\n Sha.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 80; ++i)\n W2[i] = W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16];\n for (var j = 0;j < 80; ++j) {\n var s = ~~(j / 20), t = rotl5(a) + ft(s, b, c, d) + e + W2[j] + K[s] | 0;\n e = d, d = c, c = rotl30(b), b = a, a = t;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0;\n }, Sha.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(20);\n return H.writeInt32BE(this._a | 0, 0), H.writeInt32BE(this._b | 0, 4), H.writeInt32BE(this._c | 0, 8), H.writeInt32BE(this._d | 0, 12), H.writeInt32BE(this._e | 0, 16), H;\n }, module.exports = Sha;\n }\n}), require_sha1 = __commonJS({\n \"node_modules/sha.js/sha1.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [1518500249, 1859775393, -1894007588, -899497514], W = new @Array(80);\n function Sha1() {\n this.init(), this._w = W, Hash.@call(this, 64, 56);\n }\n inherits(Sha1, Hash), Sha1.prototype.init = function() {\n return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;\n };\n function rotl1(num) {\n return num << 1 | num >>> 31;\n }\n function rotl5(num) {\n return num << 5 | num >>> 27;\n }\n function rotl30(num) {\n return num << 30 | num >>> 2;\n }\n function ft(s, b, c, d) {\n return s === 0 \? b & c | ~b & d : s === 2 \? b & c | b & d | c & d : b ^ c ^ d;\n }\n Sha1.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 80; ++i)\n W2[i] = rotl1(W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16]);\n for (var j = 0;j < 80; ++j) {\n var s = ~~(j / 20), t = rotl5(a) + ft(s, b, c, d) + e + W2[j] + K[s] | 0;\n e = d, d = c, c = rotl30(b), b = a, a = t;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0;\n }, Sha1.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(20);\n return H.writeInt32BE(this._a | 0, 0), H.writeInt32BE(this._b | 0, 4), H.writeInt32BE(this._c | 0, 8), H.writeInt32BE(this._d | 0, 12), H.writeInt32BE(this._e | 0, 16), H;\n }, module.exports = Sha1;\n }\n}), require_sha256 = __commonJS({\n \"node_modules/sha.js/sha256.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [\n 1116352408,\n 1899447441,\n 3049323471,\n 3921009573,\n 961987163,\n 1508970993,\n 2453635748,\n 2870763221,\n 3624381080,\n 310598401,\n 607225278,\n 1426881987,\n 1925078388,\n 2162078206,\n 2614888103,\n 3248222580,\n 3835390401,\n 4022224774,\n 264347078,\n 604807628,\n 770255983,\n 1249150122,\n 1555081692,\n 1996064986,\n 2554220882,\n 2821834349,\n 2952996808,\n 3210313671,\n 3336571891,\n 3584528711,\n 113926993,\n 338241895,\n 666307205,\n 773529912,\n 1294757372,\n 1396182291,\n 1695183700,\n 1986661051,\n 2177026350,\n 2456956037,\n 2730485921,\n 2820302411,\n 3259730800,\n 3345764771,\n 3516065817,\n 3600352804,\n 4094571909,\n 275423344,\n 430227734,\n 506948616,\n 659060556,\n 883997877,\n 958139571,\n 1322822218,\n 1537002063,\n 1747873779,\n 1955562222,\n 2024104815,\n 2227730452,\n 2361852424,\n 2428436474,\n 2756734187,\n 3204031479,\n 3329325298\n ], W = new @Array(64);\n function Sha256() {\n this.init(), this._w = W, Hash.@call(this, 64, 56);\n }\n inherits(Sha256, Hash), Sha256.prototype.init = function() {\n return this._a = 1779033703, this._b = 3144134277, this._c = 1013904242, this._d = 2773480762, this._e = 1359893119, this._f = 2600822924, this._g = 528734635, this._h = 1541459225, this;\n };\n function ch(x, y, z) {\n return z ^ x & (y ^ z);\n }\n function maj(x, y, z) {\n return x & y | z & (x | y);\n }\n function sigma0(x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10);\n }\n function sigma1(x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7);\n }\n function gamma0(x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ x >>> 3;\n }\n function gamma1(x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ x >>> 10;\n }\n Sha256.prototype._update = function(M) {\n for (var W2 = this._w, a = this._a | 0, b = this._b | 0, c = this._c | 0, d = this._d | 0, e = this._e | 0, f = this._f | 0, g = this._g | 0, h = this._h | 0, i = 0;i < 16; ++i)\n W2[i] = M.readInt32BE(i * 4);\n for (;i < 64; ++i)\n W2[i] = gamma1(W2[i - 2]) + W2[i - 7] + gamma0(W2[i - 15]) + W2[i - 16] | 0;\n for (var j = 0;j < 64; ++j) {\n var T1 = h + sigma1(e) + ch(e, f, g) + K[j] + W2[j] | 0, T2 = sigma0(a) + maj(a, b, c) | 0;\n h = g, g = f, f = e, e = d + T1 | 0, d = c, c = b, b = a, a = T1 + T2 | 0;\n }\n this._a = a + this._a | 0, this._b = b + this._b | 0, this._c = c + this._c | 0, this._d = d + this._d | 0, this._e = e + this._e | 0, this._f = f + this._f | 0, this._g = g + this._g | 0, this._h = h + this._h | 0;\n }, Sha256.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(32);\n return H.writeInt32BE(this._a, 0), H.writeInt32BE(this._b, 4), H.writeInt32BE(this._c, 8), H.writeInt32BE(this._d, 12), H.writeInt32BE(this._e, 16), H.writeInt32BE(this._f, 20), H.writeInt32BE(this._g, 24), H.writeInt32BE(this._h, 28), H;\n }, module.exports = Sha256;\n }\n}), require_sha224 = __commonJS({\n \"node_modules/sha.js/sha224.js\"(exports, module) {\n var inherits = require_inherits_browser(), Sha256 = require_sha256(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, W = new @Array(64);\n function Sha224() {\n this.init(), this._w = W, Hash.@call(this, 64, 56);\n }\n inherits(Sha224, Sha256), Sha224.prototype.init = function() {\n return this._a = 3238371032, this._b = 914150663, this._c = 812702999, this._d = 4144912697, this._e = 4290775857, this._f = 1750603025, this._g = 1694076839, this._h = 3204075428, this;\n }, Sha224.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(28);\n return H.writeInt32BE(this._a, 0), H.writeInt32BE(this._b, 4), H.writeInt32BE(this._c, 8), H.writeInt32BE(this._d, 12), H.writeInt32BE(this._e, 16), H.writeInt32BE(this._f, 20), H.writeInt32BE(this._g, 24), H;\n }, module.exports = Sha224;\n }\n}), require_sha512 = __commonJS({\n \"node_modules/sha.js/sha512.js\"(exports, module) {\n var inherits = require_inherits_browser(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, K = [\n 1116352408,\n 3609767458,\n 1899447441,\n 602891725,\n 3049323471,\n 3964484399,\n 3921009573,\n 2173295548,\n 961987163,\n 4081628472,\n 1508970993,\n 3053834265,\n 2453635748,\n 2937671579,\n 2870763221,\n 3664609560,\n 3624381080,\n 2734883394,\n 310598401,\n 1164996542,\n 607225278,\n 1323610764,\n 1426881987,\n 3590304994,\n 1925078388,\n 4068182383,\n 2162078206,\n 991336113,\n 2614888103,\n 633803317,\n 3248222580,\n 3479774868,\n 3835390401,\n 2666613458,\n 4022224774,\n 944711139,\n 264347078,\n 2341262773,\n 604807628,\n 2007800933,\n 770255983,\n 1495990901,\n 1249150122,\n 1856431235,\n 1555081692,\n 3175218132,\n 1996064986,\n 2198950837,\n 2554220882,\n 3999719339,\n 2821834349,\n 766784016,\n 2952996808,\n 2566594879,\n 3210313671,\n 3203337956,\n 3336571891,\n 1034457026,\n 3584528711,\n 2466948901,\n 113926993,\n 3758326383,\n 338241895,\n 168717936,\n 666307205,\n 1188179964,\n 773529912,\n 1546045734,\n 1294757372,\n 1522805485,\n 1396182291,\n 2643833823,\n 1695183700,\n 2343527390,\n 1986661051,\n 1014477480,\n 2177026350,\n 1206759142,\n 2456956037,\n 344077627,\n 2730485921,\n 1290863460,\n 2820302411,\n 3158454273,\n 3259730800,\n 3505952657,\n 3345764771,\n 106217008,\n 3516065817,\n 3606008344,\n 3600352804,\n 1432725776,\n 4094571909,\n 1467031594,\n 275423344,\n 851169720,\n 430227734,\n 3100823752,\n 506948616,\n 1363258195,\n 659060556,\n 3750685593,\n 883997877,\n 3785050280,\n 958139571,\n 3318307427,\n 1322822218,\n 3812723403,\n 1537002063,\n 2003034995,\n 1747873779,\n 3602036899,\n 1955562222,\n 1575990012,\n 2024104815,\n 1125592928,\n 2227730452,\n 2716904306,\n 2361852424,\n 442776044,\n 2428436474,\n 593698344,\n 2756734187,\n 3733110249,\n 3204031479,\n 2999351573,\n 3329325298,\n 3815920427,\n 3391569614,\n 3928383900,\n 3515267271,\n 566280711,\n 3940187606,\n 3454069534,\n 4118630271,\n 4000239992,\n 116418474,\n 1914138554,\n 174292421,\n 2731055270,\n 289380356,\n 3203993006,\n 460393269,\n 320620315,\n 685471733,\n 587496836,\n 852142971,\n 1086792851,\n 1017036298,\n 365543100,\n 1126000580,\n 2618297676,\n 1288033470,\n 3409855158,\n 1501505948,\n 4234509866,\n 1607167915,\n 987167468,\n 1816402316,\n 1246189591\n ], W = new @Array(160);\n function Sha512() {\n this.init(), this._w = W, Hash.@call(this, 128, 112);\n }\n inherits(Sha512, Hash), Sha512.prototype.init = function() {\n return this._ah = 1779033703, this._bh = 3144134277, this._ch = 1013904242, this._dh = 2773480762, this._eh = 1359893119, this._fh = 2600822924, this._gh = 528734635, this._hh = 1541459225, this._al = 4089235720, this._bl = 2227873595, this._cl = 4271175723, this._dl = 1595750129, this._el = 2917565137, this._fl = 725511199, this._gl = 4215389547, this._hl = 327033209, this;\n };\n function Ch(x, y, z) {\n return z ^ x & (y ^ z);\n }\n function maj(x, y, z) {\n return x & y | z & (x | y);\n }\n function sigma0(x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25);\n }\n function sigma1(x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23);\n }\n function Gamma0(x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ x >>> 7;\n }\n function Gamma0l(x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25);\n }\n function Gamma1(x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ x >>> 6;\n }\n function Gamma1l(x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26);\n }\n function getCarry(a, b) {\n return a >>> 0 < b >>> 0 \? 1 : 0;\n }\n Sha512.prototype._update = function(M) {\n for (var W2 = this._w, ah = this._ah | 0, bh = this._bh | 0, ch = this._ch | 0, dh = this._dh | 0, eh = this._eh | 0, fh = this._fh | 0, gh = this._gh | 0, hh = this._hh | 0, al = this._al | 0, bl = this._bl | 0, cl = this._cl | 0, dl = this._dl | 0, el = this._el | 0, fl = this._fl | 0, gl = this._gl | 0, hl = this._hl | 0, i = 0;i < 32; i += 2)\n W2[i] = M.readInt32BE(i * 4), W2[i + 1] = M.readInt32BE(i * 4 + 4);\n for (;i < 160; i += 2) {\n var xh = W2[i - 30], xl = W2[i - 30 + 1], gamma0 = Gamma0(xh, xl), gamma0l = Gamma0l(xl, xh);\n xh = W2[i - 4], xl = W2[i - 4 + 1];\n var gamma1 = Gamma1(xh, xl), gamma1l = Gamma1l(xl, xh), Wi7h = W2[i - 14], Wi7l = W2[i - 14 + 1], Wi16h = W2[i - 32], Wi16l = W2[i - 32 + 1], Wil = gamma0l + Wi7l | 0, Wih = gamma0 + Wi7h + getCarry(Wil, gamma0l) | 0;\n Wil = Wil + gamma1l | 0, Wih = Wih + gamma1 + getCarry(Wil, gamma1l) | 0, Wil = Wil + Wi16l | 0, Wih = Wih + Wi16h + getCarry(Wil, Wi16l) | 0, W2[i] = Wih, W2[i + 1] = Wil;\n }\n for (var j = 0;j < 160; j += 2) {\n Wih = W2[j], Wil = W2[j + 1];\n var majh = maj(ah, bh, ch), majl = maj(al, bl, cl), sigma0h = sigma0(ah, al), sigma0l = sigma0(al, ah), sigma1h = sigma1(eh, el), sigma1l = sigma1(el, eh), Kih = K[j], Kil = K[j + 1], chh = Ch(eh, fh, gh), chl = Ch(el, fl, gl), t1l = hl + sigma1l | 0, t1h = hh + sigma1h + getCarry(t1l, hl) | 0;\n t1l = t1l + chl | 0, t1h = t1h + chh + getCarry(t1l, chl) | 0, t1l = t1l + Kil | 0, t1h = t1h + Kih + getCarry(t1l, Kil) | 0, t1l = t1l + Wil | 0, t1h = t1h + Wih + getCarry(t1l, Wil) | 0;\n var t2l = sigma0l + majl | 0, t2h = sigma0h + majh + getCarry(t2l, sigma0l) | 0;\n hh = gh, hl = gl, gh = fh, gl = fl, fh = eh, fl = el, el = dl + t1l | 0, eh = dh + t1h + getCarry(el, dl) | 0, dh = ch, dl = cl, ch = bh, cl = bl, bh = ah, bl = al, al = t1l + t2l | 0, ah = t1h + t2h + getCarry(al, t1l) | 0;\n }\n this._al = this._al + al | 0, this._bl = this._bl + bl | 0, this._cl = this._cl + cl | 0, this._dl = this._dl + dl | 0, this._el = this._el + el | 0, this._fl = this._fl + fl | 0, this._gl = this._gl + gl | 0, this._hl = this._hl + hl | 0, this._ah = this._ah + ah + getCarry(this._al, al) | 0, this._bh = this._bh + bh + getCarry(this._bl, bl) | 0, this._ch = this._ch + ch + getCarry(this._cl, cl) | 0, this._dh = this._dh + dh + getCarry(this._dl, dl) | 0, this._eh = this._eh + eh + getCarry(this._el, el) | 0, this._fh = this._fh + fh + getCarry(this._fl, fl) | 0, this._gh = this._gh + gh + getCarry(this._gl, gl) | 0, this._hh = this._hh + hh + getCarry(this._hl, hl) | 0;\n }, Sha512.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(64);\n function writeInt64BE(h, l, offset) {\n H.writeInt32BE(h, offset), H.writeInt32BE(l, offset + 4);\n }\n return writeInt64BE(this._ah, this._al, 0), writeInt64BE(this._bh, this._bl, 8), writeInt64BE(this._ch, this._cl, 16), writeInt64BE(this._dh, this._dl, 24), writeInt64BE(this._eh, this._el, 32), writeInt64BE(this._fh, this._fl, 40), writeInt64BE(this._gh, this._gl, 48), writeInt64BE(this._hh, this._hl, 56), H;\n }, module.exports = Sha512;\n }\n}), require_sha384 = __commonJS({\n \"node_modules/sha.js/sha384.js\"(exports, module) {\n var inherits = require_inherits_browser(), SHA512 = require_sha512(), Hash = require_hash(), Buffer2 = require_safe_buffer().Buffer, W = new @Array(160);\n function Sha384() {\n this.init(), this._w = W, Hash.@call(this, 128, 112);\n }\n inherits(Sha384, SHA512), Sha384.prototype.init = function() {\n return this._ah = 3418070365, this._bh = 1654270250, this._ch = 2438529370, this._dh = 355462360, this._eh = 1731405415, this._fh = 2394180231, this._gh = 3675008525, this._hh = 1203062813, this._al = 3238371032, this._bl = 914150663, this._cl = 812702999, this._dl = 4144912697, this._el = 4290775857, this._fl = 1750603025, this._gl = 1694076839, this._hl = 3204075428, this;\n }, Sha384.prototype._hash = function() {\n var H = Buffer2.allocUnsafe(48);\n function writeInt64BE(h, l, offset) {\n H.writeInt32BE(h, offset), H.writeInt32BE(l, offset + 4);\n }\n return writeInt64BE(this._ah, this._al, 0), writeInt64BE(this._bh, this._bl, 8), writeInt64BE(this._ch, this._cl, 16), writeInt64BE(this._dh, this._dl, 24), writeInt64BE(this._eh, this._el, 32), writeInt64BE(this._fh, this._fl, 40), H;\n }, module.exports = Sha384;\n }\n}), require_sha2 = __commonJS({\n \"node_modules/sha.js/index.js\"(exports, module) {\n var exports = module.exports = function(algorithm) {\n algorithm = algorithm.toLowerCase();\n var Algorithm = exports[algorithm];\n if (!Algorithm)\n throw new Error(algorithm + \" is not supported (we accept pull requests)\");\n return new Algorithm;\n };\n exports.sha = require_sha(), exports.sha1 = require_sha1(), exports.sha224 = require_sha224(), exports.sha256 = require_sha256(), exports.sha384 = require_sha384(), exports.sha512 = require_sha512();\n }\n}), require_cipher_base = __commonJS({\n \"node_modules/cipher-base/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, inherits = require_inherits_browser();\n function CipherBase(hashMode) {\n StreamModule.Transform.@call(this), this.hashMode = typeof hashMode == \"string\", this.hashMode \? this[hashMode] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null, this._finalized = !1;\n }\n inherits(CipherBase, StreamModule.Transform), CipherBase.prototype.update = function(data, inputEnc, outputEnc) {\n if (outputEnc === \"buffer\")\n outputEnc = @undefined;\n typeof data == \"string\" && (data = Buffer2.from(data, inputEnc));\n var outData = this._update(data);\n return this.hashMode \? this : (outputEnc && (outData = this._toString(outData, outputEnc)), outData);\n }, CipherBase.prototype.setAutoPadding = function() {\n }, CipherBase.prototype.getAuthTag = function() {\n throw new Error(\"trying to get auth tag in unsupported state\");\n }, CipherBase.prototype.setAuthTag = function() {\n throw new Error(\"trying to set auth tag in unsupported state\");\n }, CipherBase.prototype.setAAD = function() {\n throw new Error(\"trying to set aad in unsupported state\");\n }, CipherBase.prototype._transform = function(data, _, next) {\n var err;\n try {\n this.hashMode \? this._update(data) : this.push(this._update(data));\n } catch (e) {\n err = e;\n } finally {\n next(err);\n }\n }, CipherBase.prototype._flush = function(done) {\n var err;\n try {\n this.push(this.__final());\n } catch (e) {\n err = e;\n }\n done(err);\n }, CipherBase.prototype._finalOrDigest = function(outputEnc) {\n if (outputEnc === \"buffer\")\n outputEnc = @undefined;\n if (this._finalized) {\n if (!this._encoding)\n return Buffer2.alloc(0);\n return \"\";\n }\n this._finalized = !0;\n var outData = this.__final() || Buffer2.alloc(0);\n return outputEnc && (outData = this._toString(outData, outputEnc, !0)), outData;\n }, CipherBase.prototype._toString = function(value, enc, fin) {\n if (this._decoder || (this._decoder = new StringDecoder(enc), this._encoding = enc), this._encoding !== enc)\n throw new Error(\"can't switch encodings\");\n var out = this._decoder.write(value);\n return fin && (out += this._decoder.end()), out;\n }, module.exports = CipherBase;\n }\n}), require_browser2 = __commonJS({\n \"node_modules/create-hash/browser.js\"(exports, module) {\n const LazyHash = function Hash(algorithm, options) {\n this._options = options, this._hasher = new CryptoHasher(algorithm, options), this._finalized = !1;\n };\n LazyHash.prototype = Object.create(StreamModule.Transform.prototype), LazyHash.prototype.update = function update(data, encoding) {\n return this._checkFinalized(), this._hasher.update(data, encoding), this;\n }, LazyHash.prototype.digest = function update(data, encoding) {\n return this._checkFinalized(), this._finalized = !0, this._hasher.digest(data, encoding);\n }, LazyHash.prototype._checkFinalized = function _checkFinalized() {\n if (this._finalized) {\n var err = new Error(\"Digest already called\");\n throw err.code = \"ERR_CRYPTO_HASH_FINALIZED\", err;\n }\n }, LazyHash.prototype.copy = function copy() {\n const copy = Object.create(LazyHash.prototype);\n return copy._options = this._options, copy._hasher = this._hasher.copy(), copy._finalized = this._finalized, copy;\n };\n const lazyHashFullInitProto = {\n __proto__: StreamModule.Transform.prototype,\n ...LazyHash.prototype,\n _transform(data, encoding, callback) {\n this.update(data, encoding), callback && callback();\n },\n _flush(callback) {\n this.push(this.digest()), callback();\n }\n }, triggerMethods = [\n \"_events\",\n \"_eventsCount\",\n \"_final\",\n \"_maxListeners\",\n \"_maxListeners\",\n \"_read\",\n \"_undestroy\",\n \"_writableState\",\n \"_write\",\n \"_writev\",\n \"addListener\",\n \"asIndexedPairs\",\n \"closed\",\n \"compose\",\n \"constructor\",\n \"cork\",\n \"destroy\",\n \"destroyed\",\n \"drop\",\n \"emit\",\n \"end\",\n \"errored\",\n \"eventNames\",\n \"every\",\n \"filter\",\n \"find\",\n \"flatMap\",\n \"forEach\",\n \"getMaxListeners\",\n \"hasOwnProperty\",\n \"isPaused\",\n \"isPrototypeOf\",\n \"iterator\",\n \"listenerCount\",\n \"listeners\",\n \"map\",\n \"off\",\n \"on\",\n \"once\",\n \"pause\",\n \"pipe\",\n \"prependListener\",\n \"prependOnceListener\",\n \"propertyIsEnumerable\",\n \"push\",\n \"rawListeners\",\n \"read\",\n \"readable\",\n \"readableAborted\",\n \"readableBuffer\",\n \"readableDidRead\",\n \"readableEncoding\",\n \"readableEnded\",\n \"readableFlowing\",\n \"readableHighWaterMark\",\n \"readableLength\",\n \"readableObjectMode\",\n \"reduce\",\n \"removeAllListeners\",\n \"removeListener\",\n \"resume\",\n \"setDefaultEncoding\",\n \"setEncoding\",\n \"setMaxListeners\",\n \"some\",\n \"take\",\n \"toArray\",\n \"toLocaleString\",\n \"toString\",\n \"uncork\",\n \"unpipe\",\n \"unshift\",\n \"valueOf\",\n \"wrap\",\n \"writable\",\n \"writableBuffer\",\n \"writableCorked\",\n \"writableEnded\",\n \"writableFinished\",\n \"writableHighWaterMark\",\n \"writableLength\",\n \"writableNeedDrain\",\n \"writableObjectMode\",\n \"write\"\n ];\n for (let method of triggerMethods)\n Object.defineProperty(LazyHash.prototype, method, {\n get() {\n return Object.setPrototypeOf(this, lazyHashFullInitProto), StreamModule.Transform.@call(this, this._options), this[method];\n },\n enumerable: !1,\n configurable: !0\n });\n module.exports = function createHash(algorithm) {\n return new LazyHash(algorithm);\n }, module.exports.createHash = module.exports, module.exports.Hash = LazyHash;\n }\n}), require_legacy = __commonJS({\n \"node_modules/create-hmac/legacy.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safe_buffer().Buffer, Base = require_cipher_base(), ZEROS = Buffer2.alloc(128), blocksize = 64;\n function Hmac(alg, key2) {\n key2 = exportIfKeyObject(key2), Base.@call(this, \"digest\"), typeof key2 == \"string\" && (key2 = Buffer2.from(key2)), this._alg = alg, this._key = key2, key2.length > blocksize \? key2 = alg(key2) : key2.length < blocksize && (key2 = Buffer2.concat([key2, ZEROS], blocksize));\n for (var ipad = this._ipad = Buffer2.allocUnsafe(blocksize), opad = this._opad = Buffer2.allocUnsafe(blocksize), i = 0;i < blocksize; i++)\n ipad[i] = key2[i] ^ 54, opad[i] = key2[i] ^ 92;\n this._hash = [ipad];\n }\n Hmac.prototype = {}, inherits(Hmac, Base), Hmac.prototype._update = function(data) {\n this._hash.push(data);\n }, Hmac.prototype._final = function() {\n var h = this._alg(Buffer2.concat(this._hash));\n return this._alg(Buffer2.concat([this._opad, h]));\n }, module.exports = Hmac;\n }\n}), require_md52 = __commonJS({\n \"node_modules/create-hash/md5.js\"(exports, module) {\n var MD5 = require_md5();\n module.exports = function(buffer) {\n return new MD5().update(buffer).digest();\n };\n }\n}), require_browser3 = __commonJS({\n \"node_modules/create-hmac/browser.js\"(exports, module) {\n var inherits = require_inherits_browser(), Legacy = require_legacy(), Base = require_cipher_base(), Buffer2 = require_safe_buffer().Buffer, md5 = require_md52(), RIPEMD160 = require_ripemd160(), sha = require_sha2(), ZEROS = Buffer2.alloc(128);\n function Hmac(alg, key2) {\n key2 = exportIfKeyObject(key2), Base.@call(this, \"digest\"), typeof key2 == \"string\" && (key2 = Buffer2.from(key2));\n var blocksize = alg === \"sha512\" || alg === \"sha384\" \? 128 : 64;\n if (this._alg = alg, this._key = key2, key2.length > blocksize) {\n var hash = alg === \"rmd160\" \? new RIPEMD160 : sha(alg);\n key2 = hash.update(key2).digest();\n } else\n key2.length < blocksize && (key2 = Buffer2.concat([key2, ZEROS], blocksize));\n for (var ipad = this._ipad = Buffer2.allocUnsafe(blocksize), opad = this._opad = Buffer2.allocUnsafe(blocksize), i = 0;i < blocksize; i++)\n ipad[i] = key2[i] ^ 54, opad[i] = key2[i] ^ 92;\n this._hash = alg === \"rmd160\" \? new RIPEMD160 : sha(alg), this._hash.update(ipad);\n }\n inherits(Hmac, Base), Hmac.prototype._update = function(data) {\n this._hash.update(data);\n }, Hmac.prototype._final = function() {\n var h = this._hash.digest(), hash = this._alg === \"rmd160\" \? new RIPEMD160 : sha(this._alg);\n return hash.update(this._opad).update(h).digest();\n }, module.exports = function(alg, key2) {\n return key2 = exportIfKeyObject(key2), alg = alg.toLowerCase(), alg === \"rmd160\" || alg === \"ripemd160\" \? new Hmac(\"rmd160\", key2) : alg === \"md5\" \? new Legacy(md5, key2) : new Hmac(alg, key2);\n };\n }\n}), require_algorithms = __commonJS({\n \"node_modules/browserify-sign/browser/algorithms.json\"(exports, module) {\n module.exports = {\n sha224WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha224\",\n id: \"302d300d06096086480165030402040500041c\"\n },\n \"RSA-SHA224\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha224\",\n id: \"302d300d06096086480165030402040500041c\"\n },\n sha256WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha256\",\n id: \"3031300d060960864801650304020105000420\"\n },\n \"RSA-SHA256\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha256\",\n id: \"3031300d060960864801650304020105000420\"\n },\n sha384WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha384\",\n id: \"3041300d060960864801650304020205000430\"\n },\n \"RSA-SHA384\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha384\",\n id: \"3041300d060960864801650304020205000430\"\n },\n sha512WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"sha512\",\n id: \"3051300d060960864801650304020305000440\"\n },\n \"RSA-SHA512\": {\n sign: \"ecdsa/rsa\",\n hash: \"sha512\",\n id: \"3051300d060960864801650304020305000440\"\n },\n \"RSA-SHA1\": {\n sign: \"rsa\",\n hash: \"sha1\",\n id: \"3021300906052b0e03021a05000414\"\n },\n \"ecdsa-with-SHA1\": {\n sign: \"ecdsa\",\n hash: \"sha1\",\n id: \"\"\n },\n sha1: {\n sign: \"ecdsa/rsa\",\n hash: \"sha1\",\n id: \"\"\n },\n sha256: {\n sign: \"ecdsa/rsa\",\n hash: \"sha256\",\n id: \"\"\n },\n sha224: {\n sign: \"ecdsa/rsa\",\n hash: \"sha224\",\n id: \"\"\n },\n sha384: {\n sign: \"ecdsa/rsa\",\n hash: \"sha384\",\n id: \"\"\n },\n sha512: {\n sign: \"ecdsa/rsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-SHA\": {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n \"DSA-SHA1\": {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n DSA: {\n sign: \"dsa\",\n hash: \"sha1\",\n id: \"\"\n },\n \"DSA-WITH-SHA224\": {\n sign: \"dsa\",\n hash: \"sha224\",\n id: \"\"\n },\n \"DSA-SHA224\": {\n sign: \"dsa\",\n hash: \"sha224\",\n id: \"\"\n },\n \"DSA-WITH-SHA256\": {\n sign: \"dsa\",\n hash: \"sha256\",\n id: \"\"\n },\n \"DSA-SHA256\": {\n sign: \"dsa\",\n hash: \"sha256\",\n id: \"\"\n },\n \"DSA-WITH-SHA384\": {\n sign: \"dsa\",\n hash: \"sha384\",\n id: \"\"\n },\n \"DSA-SHA384\": {\n sign: \"dsa\",\n hash: \"sha384\",\n id: \"\"\n },\n \"DSA-WITH-SHA512\": {\n sign: \"dsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-SHA512\": {\n sign: \"dsa\",\n hash: \"sha512\",\n id: \"\"\n },\n \"DSA-RIPEMD160\": {\n sign: \"dsa\",\n hash: \"rmd160\",\n id: \"\"\n },\n ripemd160WithRSA: {\n sign: \"rsa\",\n hash: \"rmd160\",\n id: \"3021300906052b2403020105000414\"\n },\n \"RSA-RIPEMD160\": {\n sign: \"rsa\",\n hash: \"rmd160\",\n id: \"3021300906052b2403020105000414\"\n },\n md5WithRSAEncryption: {\n sign: \"rsa\",\n hash: \"md5\",\n id: \"3020300c06082a864886f70d020505000410\"\n },\n \"RSA-MD5\": {\n sign: \"rsa\",\n hash: \"md5\",\n id: \"3020300c06082a864886f70d020505000410\"\n }\n };\n }\n}), require_algos = __commonJS({\n \"node_modules/browserify-sign/algos.js\"(exports, module) {\n module.exports = require_algorithms();\n }\n}), require_precondition = __commonJS({\n \"node_modules/pbkdf2/lib/precondition.js\"(exports, module) {\n var MAX_ALLOC = Math.pow(2, 30) - 1;\n module.exports = function(iterations, keylen) {\n if (typeof iterations != \"number\")\n @throwTypeError(\"Iterations not a number\");\n if (iterations < 0)\n @throwTypeError(\"Bad iterations\");\n if (typeof keylen != \"number\")\n @throwTypeError(\"Key length not a number\");\n if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen)\n @throwTypeError(\"Bad key length\");\n };\n }\n}), require_default_encoding = __commonJS({\n \"node_modules/pbkdf2/lib/default-encoding.js\"(exports, module) {\n var defaultEncoding;\n global.process && global.process.browser \? defaultEncoding = \"utf-8\" : global.process && global.process.version \? (pVersionMajor = parseInt(process.version.split(\".\")[0].slice(1), 10), defaultEncoding = pVersionMajor >= 6 \? \"utf-8\" : \"binary\") : defaultEncoding = \"utf-8\";\n var pVersionMajor;\n module.exports = defaultEncoding;\n }\n}), require_to_buffer = __commonJS({\n \"node_modules/pbkdf2/lib/to-buffer.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(thing, encoding, name) {\n if (Buffer2.isBuffer(thing))\n return thing;\n if (typeof thing == \"string\")\n return Buffer2.from(thing, encoding);\n if (@ArrayBuffer.isView(thing))\n return Buffer2.from(thing.buffer);\n @throwTypeError(name + \" must be a string, a Buffer, a typed array or a DataView\");\n };\n }\n}), require_sync_browser = __commonJS({\n \"node_modules/pbkdf2/lib/sync-browser.js\"(exports, module) {\n var md5 = require_md52(), RIPEMD160 = require_ripemd160(), sha = require_sha2(), Buffer2 = require_safe_buffer().Buffer, checkParameters = require_precondition(), defaultEncoding = require_default_encoding(), toBuffer = require_to_buffer(), ZEROS = Buffer2.alloc(128), sizes = {\n md5: 16,\n sha1: 20,\n sha224: 28,\n sha256: 32,\n sha384: 48,\n sha512: 64,\n rmd160: 20,\n ripemd160: 20\n };\n function Hmac(alg, key2, saltLen) {\n key2 = exportIfKeyObject(key2);\n var hash = getDigest(alg), blocksize = alg === \"sha512\" || alg === \"sha384\" \? 128 : 64;\n key2.length > blocksize \? key2 = hash(key2) : key2.length < blocksize && (key2 = Buffer2.concat([key2, ZEROS], blocksize));\n for (var ipad = Buffer2.allocUnsafe(blocksize + sizes[alg]), opad = Buffer2.allocUnsafe(blocksize + sizes[alg]), i = 0;i < blocksize; i++)\n ipad[i] = key2[i] ^ 54, opad[i] = key2[i] ^ 92;\n var ipad1 = Buffer2.allocUnsafe(blocksize + saltLen + 4);\n ipad.copy(ipad1, 0, 0, blocksize), this.ipad1 = ipad1, this.ipad2 = ipad, this.opad = opad, this.alg = alg, this.blocksize = blocksize, this.hash = hash, this.size = sizes[alg];\n }\n Hmac.prototype = {}, Hmac.prototype.run = function(data, ipad) {\n data.copy(ipad, this.blocksize);\n var h = this.hash(ipad);\n return h.copy(this.opad, this.blocksize), this.hash(this.opad);\n };\n function getDigest(alg) {\n function shaFunc(data) {\n return sha(alg).update(data).digest();\n }\n function rmd160Func(data) {\n return new RIPEMD160().update(data).digest();\n }\n return alg === \"rmd160\" || alg === \"ripemd160\" \? rmd160Func : alg === \"md5\" \? md5 : shaFunc;\n }\n function pbkdf2(password, salt, iterations, keylen, digest) {\n checkParameters(iterations, keylen), password = toBuffer(password, defaultEncoding, \"Password\"), salt = toBuffer(salt, defaultEncoding, \"Salt\"), digest = digest || \"sha1\";\n var hmac = new Hmac(digest, password, salt.length), DK = Buffer2.allocUnsafe(keylen), block1 = Buffer2.allocUnsafe(salt.length + 4);\n salt.copy(block1, 0, 0, salt.length);\n for (var destPos = 0, hLen = sizes[digest], l = Math.ceil(keylen / hLen), i = 1;i <= l; i++) {\n block1.writeUInt32BE(i, salt.length);\n for (var T = hmac.run(block1, hmac.ipad1), U = T, j = 1;j < iterations; j++) {\n U = hmac.run(U, hmac.ipad2);\n for (var k = 0;k < hLen; k++)\n T[k] ^= U[k];\n }\n T.copy(DK, destPos), destPos += hLen;\n }\n return DK;\n }\n module.exports = pbkdf2;\n }\n}), require_async = __commonJS({\n \"node_modules/pbkdf2/lib/async.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, checkParameters = require_precondition(), defaultEncoding = require_default_encoding(), sync = require_sync_browser(), toBuffer = require_to_buffer(), ZERO_BUF, subtle = globalCrypto.subtle, toBrowser = {\n sha: \"SHA-1\",\n \"sha-1\": \"SHA-1\",\n sha1: \"SHA-1\",\n sha256: \"SHA-256\",\n \"sha-256\": \"SHA-256\",\n sha384: \"SHA-384\",\n \"sha-384\": \"SHA-384\",\n \"sha-512\": \"SHA-512\",\n sha512: \"SHA-512\"\n }, checks = [];\n function checkNative(algo) {\n if (global.process && !global.process.browser || !subtle || !subtle.importKey || !subtle.deriveBits)\n return @Promise.resolve(!1);\n if (checks[algo] !== void 0)\n return checks[algo];\n ZERO_BUF = ZERO_BUF || Buffer2.alloc(8);\n var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo).then(function() {\n return !0;\n }).catch(function() {\n return !1;\n });\n return checks[algo] = prom, prom;\n }\n var nextTick;\n function getNextTick() {\n return nextTick || (global.process && global.process.nextTick \? nextTick = global.process.nextTick : global.queueMicrotask \? nextTick = global.queueMicrotask : global.setImmediate \? nextTick = global.setImmediate : nextTick = global.setTimeout, nextTick);\n }\n function browserPbkdf2(password, salt, iterations, length, algo) {\n return subtle.importKey(\"raw\", password, { name: \"PBKDF2\" }, !1, [\"deriveBits\"]).then(function(key2) {\n return subtle.deriveBits({\n name: \"PBKDF2\",\n salt,\n iterations,\n hash: {\n name: algo\n }\n }, key2, length << 3);\n }).then(function(res) {\n return Buffer2.from(res);\n });\n }\n function resolvePromise(promise, callback) {\n promise.then(function(out) {\n getNextTick()(function() {\n callback(null, out);\n });\n }, function(e) {\n getNextTick()(function() {\n callback(e);\n });\n });\n }\n module.exports = function(password, salt, iterations, keylen, digest, callback) {\n typeof digest == \"function\" && (callback = digest, digest = void 0), digest = digest || \"sha1\";\n var algo = toBrowser[digest.toLowerCase()];\n if (!algo || typeof global.Promise != \"function\") {\n getNextTick()(function() {\n var out;\n try {\n out = sync(password, salt, iterations, keylen, digest);\n } catch (e) {\n return callback(e);\n }\n callback(null, out);\n });\n return;\n }\n if (checkParameters(iterations, keylen), password = toBuffer(password, defaultEncoding, \"Password\"), salt = toBuffer(salt, defaultEncoding, \"Salt\"), typeof callback != \"function\")\n throw new Error(\"No callback provided to pbkdf2\");\n resolvePromise(checkNative(algo).then(function(resp) {\n return resp \? browserPbkdf2(password, salt, iterations, keylen, algo) : sync(password, salt, iterations, keylen, digest);\n }), callback);\n };\n }\n}), require_browser4 = __commonJS({\n \"node_modules/pbkdf2/browser.js\"(exports) {\n exports.pbkdf2 = require_async(), exports.pbkdf2Sync = require_sync_browser();\n }\n}), require_utils = __commonJS({\n \"node_modules/des.js/lib/des/utils.js\"(exports) {\n exports.readUInt32BE = function(bytes, off) {\n var res = bytes[0 + off] << 24 | bytes[1 + off] << 16 | bytes[2 + off] << 8 | bytes[3 + off];\n return res >>> 0;\n }, exports.writeUInt32BE = function(bytes, value, off) {\n bytes[0 + off] = value >>> 24, bytes[1 + off] = value >>> 16 & 255, bytes[2 + off] = value >>> 8 & 255, bytes[3 + off] = value & 255;\n }, exports.ip = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 6;i >= 0; i -= 2) {\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >>> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inL >>> j + i & 1;\n }\n for (var i = 6;i >= 0; i -= 2) {\n for (var j = 1;j <= 25; j += 8)\n outR <<= 1, outR |= inR >>> j + i & 1;\n for (var j = 1;j <= 25; j += 8)\n outR <<= 1, outR |= inL >>> j + i & 1;\n }\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.rip = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 0;i < 4; i++)\n for (var j = 24;j >= 0; j -= 8)\n outL <<= 1, outL |= inR >>> j + i & 1, outL <<= 1, outL |= inL >>> j + i & 1;\n for (var i = 4;i < 8; i++)\n for (var j = 24;j >= 0; j -= 8)\n outR <<= 1, outR |= inR >>> j + i & 1, outR <<= 1, outR |= inL >>> j + i & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.pc1 = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, i = 7;i >= 5; i--) {\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inL >> j + i & 1;\n }\n for (var j = 0;j <= 24; j += 8)\n outL <<= 1, outL |= inR >> j + i & 1;\n for (var i = 1;i <= 3; i++) {\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inR >> j + i & 1;\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inL >> j + i & 1;\n }\n for (var j = 0;j <= 24; j += 8)\n outR <<= 1, outR |= inL >> j + i & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.r28shl = function(num, shift) {\n return num << shift & 268435455 | num >>> 28 - shift;\n };\n var pc2table = [\n 14,\n 11,\n 17,\n 4,\n 27,\n 23,\n 25,\n 0,\n 13,\n 22,\n 7,\n 18,\n 5,\n 9,\n 16,\n 24,\n 2,\n 20,\n 12,\n 21,\n 1,\n 8,\n 15,\n 26,\n 15,\n 4,\n 25,\n 19,\n 9,\n 1,\n 26,\n 16,\n 5,\n 11,\n 23,\n 8,\n 12,\n 7,\n 17,\n 0,\n 22,\n 3,\n 10,\n 14,\n 6,\n 20,\n 27,\n 24\n ];\n exports.pc2 = function(inL, inR, out, off) {\n for (var outL = 0, outR = 0, len = pc2table.length >>> 1, i = 0;i < len; i++)\n outL <<= 1, outL |= inL >>> pc2table[i] & 1;\n for (var i = len;i < pc2table.length; i++)\n outR <<= 1, outR |= inR >>> pc2table[i] & 1;\n out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n }, exports.expand = function(r, out, off) {\n var outL = 0, outR = 0;\n outL = (r & 1) << 5 | r >>> 27;\n for (var i = 23;i >= 15; i -= 4)\n outL <<= 6, outL |= r >>> i & 63;\n for (var i = 11;i >= 3; i -= 4)\n outR |= r >>> i & 63, outR <<= 6;\n outR |= (r & 31) << 1 | r >>> 31, out[off + 0] = outL >>> 0, out[off + 1] = outR >>> 0;\n };\n var sTable = [\n 14,\n 0,\n 4,\n 15,\n 13,\n 7,\n 1,\n 4,\n 2,\n 14,\n 15,\n 2,\n 11,\n 13,\n 8,\n 1,\n 3,\n 10,\n 10,\n 6,\n 6,\n 12,\n 12,\n 11,\n 5,\n 9,\n 9,\n 5,\n 0,\n 3,\n 7,\n 8,\n 4,\n 15,\n 1,\n 12,\n 14,\n 8,\n 8,\n 2,\n 13,\n 4,\n 6,\n 9,\n 2,\n 1,\n 11,\n 7,\n 15,\n 5,\n 12,\n 11,\n 9,\n 3,\n 7,\n 14,\n 3,\n 10,\n 10,\n 0,\n 5,\n 6,\n 0,\n 13,\n 15,\n 3,\n 1,\n 13,\n 8,\n 4,\n 14,\n 7,\n 6,\n 15,\n 11,\n 2,\n 3,\n 8,\n 4,\n 14,\n 9,\n 12,\n 7,\n 0,\n 2,\n 1,\n 13,\n 10,\n 12,\n 6,\n 0,\n 9,\n 5,\n 11,\n 10,\n 5,\n 0,\n 13,\n 14,\n 8,\n 7,\n 10,\n 11,\n 1,\n 10,\n 3,\n 4,\n 15,\n 13,\n 4,\n 1,\n 2,\n 5,\n 11,\n 8,\n 6,\n 12,\n 7,\n 6,\n 12,\n 9,\n 0,\n 3,\n 5,\n 2,\n 14,\n 15,\n 9,\n 10,\n 13,\n 0,\n 7,\n 9,\n 0,\n 14,\n 9,\n 6,\n 3,\n 3,\n 4,\n 15,\n 6,\n 5,\n 10,\n 1,\n 2,\n 13,\n 8,\n 12,\n 5,\n 7,\n 14,\n 11,\n 12,\n 4,\n 11,\n 2,\n 15,\n 8,\n 1,\n 13,\n 1,\n 6,\n 10,\n 4,\n 13,\n 9,\n 0,\n 8,\n 6,\n 15,\n 9,\n 3,\n 8,\n 0,\n 7,\n 11,\n 4,\n 1,\n 15,\n 2,\n 14,\n 12,\n 3,\n 5,\n 11,\n 10,\n 5,\n 14,\n 2,\n 7,\n 12,\n 7,\n 13,\n 13,\n 8,\n 14,\n 11,\n 3,\n 5,\n 0,\n 6,\n 6,\n 15,\n 9,\n 0,\n 10,\n 3,\n 1,\n 4,\n 2,\n 7,\n 8,\n 2,\n 5,\n 12,\n 11,\n 1,\n 12,\n 10,\n 4,\n 14,\n 15,\n 9,\n 10,\n 3,\n 6,\n 15,\n 9,\n 0,\n 0,\n 6,\n 12,\n 10,\n 11,\n 1,\n 7,\n 13,\n 13,\n 8,\n 15,\n 9,\n 1,\n 4,\n 3,\n 5,\n 14,\n 11,\n 5,\n 12,\n 2,\n 7,\n 8,\n 2,\n 4,\n 14,\n 2,\n 14,\n 12,\n 11,\n 4,\n 2,\n 1,\n 12,\n 7,\n 4,\n 10,\n 7,\n 11,\n 13,\n 6,\n 1,\n 8,\n 5,\n 5,\n 0,\n 3,\n 15,\n 15,\n 10,\n 13,\n 3,\n 0,\n 9,\n 14,\n 8,\n 9,\n 6,\n 4,\n 11,\n 2,\n 8,\n 1,\n 12,\n 11,\n 7,\n 10,\n 1,\n 13,\n 14,\n 7,\n 2,\n 8,\n 13,\n 15,\n 6,\n 9,\n 15,\n 12,\n 0,\n 5,\n 9,\n 6,\n 10,\n 3,\n 4,\n 0,\n 5,\n 14,\n 3,\n 12,\n 10,\n 1,\n 15,\n 10,\n 4,\n 15,\n 2,\n 9,\n 7,\n 2,\n 12,\n 6,\n 9,\n 8,\n 5,\n 0,\n 6,\n 13,\n 1,\n 3,\n 13,\n 4,\n 14,\n 14,\n 0,\n 7,\n 11,\n 5,\n 3,\n 11,\n 8,\n 9,\n 4,\n 14,\n 3,\n 15,\n 2,\n 5,\n 12,\n 2,\n 9,\n 8,\n 5,\n 12,\n 15,\n 3,\n 10,\n 7,\n 11,\n 0,\n 14,\n 4,\n 1,\n 10,\n 7,\n 1,\n 6,\n 13,\n 0,\n 11,\n 8,\n 6,\n 13,\n 4,\n 13,\n 11,\n 0,\n 2,\n 11,\n 14,\n 7,\n 15,\n 4,\n 0,\n 9,\n 8,\n 1,\n 13,\n 10,\n 3,\n 14,\n 12,\n 3,\n 9,\n 5,\n 7,\n 12,\n 5,\n 2,\n 10,\n 15,\n 6,\n 8,\n 1,\n 6,\n 1,\n 6,\n 4,\n 11,\n 11,\n 13,\n 13,\n 8,\n 12,\n 1,\n 3,\n 4,\n 7,\n 10,\n 14,\n 7,\n 10,\n 9,\n 15,\n 5,\n 6,\n 0,\n 8,\n 15,\n 0,\n 14,\n 5,\n 2,\n 9,\n 3,\n 2,\n 12,\n 13,\n 1,\n 2,\n 15,\n 8,\n 13,\n 4,\n 8,\n 6,\n 10,\n 15,\n 3,\n 11,\n 7,\n 1,\n 4,\n 10,\n 12,\n 9,\n 5,\n 3,\n 6,\n 14,\n 11,\n 5,\n 0,\n 0,\n 14,\n 12,\n 9,\n 7,\n 2,\n 7,\n 2,\n 11,\n 1,\n 4,\n 14,\n 1,\n 7,\n 9,\n 4,\n 12,\n 10,\n 14,\n 8,\n 2,\n 13,\n 0,\n 15,\n 6,\n 12,\n 10,\n 9,\n 13,\n 0,\n 15,\n 3,\n 3,\n 5,\n 5,\n 6,\n 8,\n 11\n ];\n exports.substitute = function(inL, inR) {\n for (var out = 0, i = 0;i < 4; i++) {\n var b = inL >>> 18 - i * 6 & 63, sb = sTable[i * 64 + b];\n out <<= 4, out |= sb;\n }\n for (var i = 0;i < 4; i++) {\n var b = inR >>> 18 - i * 6 & 63, sb = sTable[256 + i * 64 + b];\n out <<= 4, out |= sb;\n }\n return out >>> 0;\n };\n var permuteTable = [\n 16,\n 25,\n 12,\n 11,\n 3,\n 20,\n 4,\n 15,\n 31,\n 17,\n 9,\n 6,\n 27,\n 14,\n 1,\n 22,\n 30,\n 24,\n 8,\n 18,\n 0,\n 5,\n 29,\n 23,\n 13,\n 19,\n 2,\n 26,\n 10,\n 21,\n 28,\n 7\n ];\n exports.permute = function(num) {\n for (var out = 0, i = 0;i < permuteTable.length; i++)\n out <<= 1, out |= num >>> permuteTable[i] & 1;\n return out >>> 0;\n }, exports.padSplit = function(num, size, group) {\n for (var str = num.toString(2);str.length < size; )\n str = \"0\" + str;\n for (var out = [], i = 0;i < size; i += group)\n out.push(str.slice(i, i + group));\n return out.join(\" \");\n };\n }\n}), require_minimalistic_assert = __commonJS({\n \"node_modules/minimalistic-assert/index.js\"(exports, module) {\n module.exports = assert;\n function assert(val, msg) {\n if (!val)\n throw new Error(msg || \"Assertion failed\");\n }\n assert.equal = function(l, r, msg) {\n if (l != r)\n throw new Error(msg || \"Assertion failed: \" + l + \" != \" + r);\n };\n }\n}), require_cipher = __commonJS({\n \"node_modules/des.js/lib/des/cipher.js\"(exports, module) {\n var assert = require_minimalistic_assert();\n function Cipher(options) {\n this.options = options, this.type = this.options.type, this.blockSize = 8, this._init(), this.buffer = new @Array(this.blockSize), this.bufferOff = 0;\n }\n Cipher.prototype = {}, module.exports = Cipher, Cipher.prototype._init = function() {\n }, Cipher.prototype.update = function(data) {\n return data.length === 0 \? [] : this.type === \"decrypt\" \? this._updateDecrypt(data) : this._updateEncrypt(data);\n }, Cipher.prototype._buffer = function(data, off) {\n for (var min = Math.min(this.buffer.length - this.bufferOff, data.length - off), i = 0;i < min; i++)\n this.buffer[this.bufferOff + i] = data[off + i];\n return this.bufferOff += min, min;\n }, Cipher.prototype._flushBuffer = function(out, off) {\n return this._update(this.buffer, 0, out, off), this.bufferOff = 0, this.blockSize;\n }, Cipher.prototype._updateEncrypt = function(data) {\n var inputOff = 0, outputOff = 0, count = (this.bufferOff + data.length) / this.blockSize | 0, out = new @Array(count * this.blockSize);\n this.bufferOff !== 0 && (inputOff += this._buffer(data, inputOff), this.bufferOff === this.buffer.length && (outputOff += this._flushBuffer(out, outputOff)));\n for (var max = data.length - (data.length - inputOff) % this.blockSize;inputOff < max; inputOff += this.blockSize)\n this._update(data, inputOff, out, outputOff), outputOff += this.blockSize;\n for (;inputOff < data.length; inputOff++, this.bufferOff++)\n this.buffer[this.bufferOff] = data[inputOff];\n return out;\n }, Cipher.prototype._updateDecrypt = function(data) {\n for (var inputOff = 0, outputOff = 0, count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1, out = new @Array(count * this.blockSize);count > 0; count--)\n inputOff += this._buffer(data, inputOff), outputOff += this._flushBuffer(out, outputOff);\n return inputOff += this._buffer(data, inputOff), out;\n }, Cipher.prototype.final = function(buffer) {\n var first;\n buffer && (first = this.update(buffer));\n var last;\n return this.type === \"encrypt\" \? last = this._finalEncrypt() : last = this._finalDecrypt(), first \? first.concat(last) : last;\n }, Cipher.prototype._pad = function(buffer, off) {\n if (off === 0)\n return !1;\n for (;off < buffer.length; )\n buffer[off++] = 0;\n return !0;\n }, Cipher.prototype._finalEncrypt = function() {\n if (!this._pad(this.buffer, this.bufferOff))\n return [];\n var out = new @Array(this.blockSize);\n return this._update(this.buffer, 0, out, 0), out;\n }, Cipher.prototype._unpad = function(buffer) {\n return buffer;\n }, Cipher.prototype._finalDecrypt = function() {\n assert.equal(this.bufferOff, this.blockSize, \"Not enough data to decrypt\");\n var out = new @Array(this.blockSize);\n return this._flushBuffer(out, 0), this._unpad(out);\n };\n }\n}), require_des = __commonJS({\n \"node_modules/des.js/lib/des/des.js\"(exports, module) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), utils = require_utils(), Cipher = require_cipher();\n function DESState() {\n this.tmp = new @Array(2), this.keys = null;\n }\n function DES(options) {\n Cipher.@call(this, options);\n var state = new DESState;\n this._desState = state, this.deriveKeys(state, options.key);\n }\n inherits(DES, Cipher), module.exports = DES, DES.create = function(options) {\n return new DES(options);\n };\n var shiftTable = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1];\n DES.prototype.deriveKeys = function(state, key2) {\n state.keys = new @Array(32), assert.equal(key2.length, this.blockSize, \"Invalid key length\");\n var kL = utils.readUInt32BE(key2, 0), kR = utils.readUInt32BE(key2, 4);\n utils.pc1(kL, kR, state.tmp, 0), kL = state.tmp[0], kR = state.tmp[1];\n for (var i = 0;i < state.keys.length; i += 2) {\n var shift = shiftTable[i >>> 1];\n kL = utils.r28shl(kL, shift), kR = utils.r28shl(kR, shift), utils.pc2(kL, kR, state.keys, i);\n }\n }, DES.prototype._update = function(inp, inOff, out, outOff) {\n var state = this._desState, l = utils.readUInt32BE(inp, inOff), r = utils.readUInt32BE(inp, inOff + 4);\n utils.ip(l, r, state.tmp, 0), l = state.tmp[0], r = state.tmp[1], this.type === \"encrypt\" \? this._encrypt(state, l, r, state.tmp, 0) : this._decrypt(state, l, r, state.tmp, 0), l = state.tmp[0], r = state.tmp[1], utils.writeUInt32BE(out, l, outOff), utils.writeUInt32BE(out, r, outOff + 4);\n }, DES.prototype._pad = function(buffer, off) {\n for (var value = buffer.length - off, i = off;i < buffer.length; i++)\n buffer[i] = value;\n return !0;\n }, DES.prototype._unpad = function(buffer) {\n for (var pad = buffer[buffer.length - 1], i = buffer.length - pad;i < buffer.length; i++)\n assert.equal(buffer[i], pad);\n return buffer.slice(0, buffer.length - pad);\n }, DES.prototype._encrypt = function(state, lStart, rStart, out, off) {\n for (var l = lStart, r = rStart, i = 0;i < state.keys.length; i += 2) {\n var keyL = state.keys[i], keyR = state.keys[i + 1];\n utils.expand(r, state.tmp, 0), keyL ^= state.tmp[0], keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR), f = utils.permute(s), t = r;\n r = (l ^ f) >>> 0, l = t;\n }\n utils.rip(r, l, out, off);\n }, DES.prototype._decrypt = function(state, lStart, rStart, out, off) {\n for (var l = rStart, r = lStart, i = state.keys.length - 2;i >= 0; i -= 2) {\n var keyL = state.keys[i], keyR = state.keys[i + 1];\n utils.expand(l, state.tmp, 0), keyL ^= state.tmp[0], keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR), f = utils.permute(s), t = l;\n l = (r ^ f) >>> 0, r = t;\n }\n utils.rip(l, r, out, off);\n };\n }\n}), require_cbc = __commonJS({\n \"node_modules/des.js/lib/des/cbc.js\"(exports) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), proto = {};\n function CBCState(iv) {\n assert.equal(iv.length, 8, \"Invalid IV length\"), this.iv = new @Array(8);\n for (var i = 0;i < this.iv.length; i++)\n this.iv[i] = iv[i];\n }\n function instantiate(Base) {\n function CBC(options) {\n Base.@call(this, options), this._cbcInit();\n }\n inherits(CBC, Base);\n for (var keys = Object.keys(proto), i = 0;i < keys.length; i++) {\n var key2 = keys[i];\n CBC.prototype[key2] = proto[key2];\n }\n return CBC.create = function(options) {\n return new CBC(options);\n }, CBC;\n }\n exports.instantiate = instantiate, proto._cbcInit = function() {\n var state = new CBCState(this.options.iv);\n this._cbcState = state;\n }, proto._update = function(inp, inOff, out, outOff) {\n var state = this._cbcState, superProto = this.constructor.super_.prototype, iv = state.iv;\n if (this.type === \"encrypt\") {\n for (var i = 0;i < this.blockSize; i++)\n iv[i] ^= inp[inOff + i];\n superProto._update.@call(this, iv, 0, out, outOff);\n for (var i = 0;i < this.blockSize; i++)\n iv[i] = out[outOff + i];\n } else {\n superProto._update.@call(this, inp, inOff, out, outOff);\n for (var i = 0;i < this.blockSize; i++)\n out[outOff + i] ^= iv[i];\n for (var i = 0;i < this.blockSize; i++)\n iv[i] = inp[inOff + i];\n }\n };\n }\n}), require_ede = __commonJS({\n \"node_modules/des.js/lib/des/ede.js\"(exports, module) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser(), Cipher = require_cipher(), DES = require_des();\n function EDEState(type, key2) {\n assert.equal(key2.length, 24, \"Invalid key length\");\n var k1 = key2.slice(0, 8), k2 = key2.slice(8, 16), k3 = key2.slice(16, 24);\n type === \"encrypt\" \? this.ciphers = [\n DES.create({ type: \"encrypt\", key: k1 }),\n DES.create({ type: \"decrypt\", key: k2 }),\n DES.create({ type: \"encrypt\", key: k3 })\n ] : this.ciphers = [\n DES.create({ type: \"decrypt\", key: k3 }),\n DES.create({ type: \"encrypt\", key: k2 }),\n DES.create({ type: \"decrypt\", key: k1 })\n ];\n }\n function EDE(options) {\n Cipher.@call(this, options);\n var state = new EDEState(this.type, this.options.key);\n this._edeState = state;\n }\n inherits(EDE, Cipher), module.exports = EDE, EDE.create = function(options) {\n return new EDE(options);\n }, EDE.prototype._update = function(inp, inOff, out, outOff) {\n var state = this._edeState;\n state.ciphers[0]._update(inp, inOff, out, outOff), state.ciphers[1]._update(out, outOff, out, outOff), state.ciphers[2]._update(out, outOff, out, outOff);\n }, EDE.prototype._pad = DES.prototype._pad, EDE.prototype._unpad = DES.prototype._unpad;\n }\n}), require_des2 = __commonJS({\n \"node_modules/des.js/lib/des.js\"(exports) {\n exports.utils = require_utils(), exports.Cipher = require_cipher(), exports.DES = require_des(), exports.CBC = require_cbc(), exports.EDE = require_ede();\n }\n}), require_browserify_des = __commonJS({\n \"node_modules/browserify-des/index.js\"(exports, module) {\n var CipherBase = require_cipher_base(), des = require_des2(), inherits = require_inherits_browser(), Buffer2 = require_safe_buffer().Buffer, modes = {\n \"des-ede3-cbc\": des.CBC.instantiate(des.EDE),\n \"des-ede3\": des.EDE,\n \"des-ede-cbc\": des.CBC.instantiate(des.EDE),\n \"des-ede\": des.EDE,\n \"des-cbc\": des.CBC.instantiate(des.DES),\n \"des-ecb\": des.DES\n };\n modes.des = modes[\"des-cbc\"], modes.des3 = modes[\"des-ede3-cbc\"], module.exports = DES, inherits(DES, CipherBase);\n function DES(opts) {\n CipherBase.@call(this);\n var modeName = opts.mode.toLowerCase(), mode = modes[modeName], type;\n opts.decrypt \? type = \"decrypt\" : type = \"encrypt\";\n var key2 = opts.key;\n Buffer2.isBuffer(key2) || (key2 = Buffer2.from(key2)), (modeName === \"des-ede\" || modeName === \"des-ede-cbc\") && (key2 = Buffer2.concat([key2, key2.slice(0, 8)]));\n var iv = opts.iv;\n Buffer2.isBuffer(iv) || (iv = Buffer2.from(iv)), this._des = mode.create({\n key: key2,\n iv,\n type\n });\n }\n DES.prototype._update = function(data) {\n return Buffer2.from(this._des.update(data));\n }, DES.prototype._final = function() {\n return Buffer2.from(this._des.final());\n };\n }\n}), require_ecb = __commonJS({\n \"node_modules/browserify-aes/modes/ecb.js\"(exports) {\n exports.encrypt = function(self2, block) {\n return self2._cipher.encryptBlock(block);\n }, exports.decrypt = function(self2, block) {\n return self2._cipher.decryptBlock(block);\n };\n }\n}), require_buffer_xor = __commonJS({\n \"node_modules/buffer-xor/index.js\"(exports, module) {\n module.exports = function(a, b) {\n for (var length = Math.min(a.length, b.length), buffer = new Buffer(length), i = 0;i < length; ++i)\n buffer[i] = a[i] ^ b[i];\n return buffer;\n };\n }\n}), require_cbc2 = __commonJS({\n \"node_modules/browserify-aes/modes/cbc.js\"(exports) {\n var xor = require_buffer_xor();\n exports.encrypt = function(self2, block) {\n var data = xor(block, self2._prev);\n return self2._prev = self2._cipher.encryptBlock(data), self2._prev;\n }, exports.decrypt = function(self2, block) {\n var pad = self2._prev;\n self2._prev = block;\n var out = self2._cipher.decryptBlock(block);\n return xor(out, pad);\n };\n }\n}), require_cfb = __commonJS({\n \"node_modules/browserify-aes/modes/cfb.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer, xor = require_buffer_xor();\n function encryptStart(self2, data, decrypt) {\n var len = data.length, out = xor(data, self2._cache);\n return self2._cache = self2._cache.slice(len), self2._prev = Buffer2.concat([self2._prev, decrypt \? data : out]), out;\n }\n exports.encrypt = function(self2, data, decrypt) {\n for (var out = Buffer2.allocUnsafe(0), len;data.length; )\n if (self2._cache.length === 0 && (self2._cache = self2._cipher.encryptBlock(self2._prev), self2._prev = Buffer2.allocUnsafe(0)), self2._cache.length <= data.length)\n len = self2._cache.length, out = Buffer2.concat([out, encryptStart(self2, data.slice(0, len), decrypt)]), data = data.slice(len);\n else {\n out = Buffer2.concat([out, encryptStart(self2, data, decrypt)]);\n break;\n }\n return out;\n };\n }\n}), require_cfb8 = __commonJS({\n \"node_modules/browserify-aes/modes/cfb8.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer;\n function encryptByte(self2, byteParam, decrypt) {\n var pad = self2._cipher.encryptBlock(self2._prev), out = pad[0] ^ byteParam;\n return self2._prev = Buffer2.concat([self2._prev.slice(1), Buffer2.from([decrypt \? byteParam : out])]), out;\n }\n exports.encrypt = function(self2, chunk, decrypt) {\n for (var len = chunk.length, out = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n out[i] = encryptByte(self2, chunk[i], decrypt);\n return out;\n };\n }\n}), require_cfb1 = __commonJS({\n \"node_modules/browserify-aes/modes/cfb1.js\"(exports) {\n var Buffer2 = require_safe_buffer().Buffer;\n function encryptByte(self2, byteParam, decrypt) {\n for (var pad, i = -1, len = 8, out = 0, bit, value;++i < len; )\n pad = self2._cipher.encryptBlock(self2._prev), bit = byteParam & 1 << 7 - i \? 128 : 0, value = pad[0] ^ bit, out += (value & 128) >> i % 8, self2._prev = shiftIn(self2._prev, decrypt \? bit : value);\n return out;\n }\n function shiftIn(buffer, value) {\n var len = buffer.length, i = -1, out = Buffer2.allocUnsafe(buffer.length);\n for (buffer = Buffer2.concat([buffer, Buffer2.from([value])]);++i < len; )\n out[i] = buffer[i] << 1 | buffer[i + 1] >> 7;\n return out;\n }\n exports.encrypt = function(self2, chunk, decrypt) {\n for (var len = chunk.length, out = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n out[i] = encryptByte(self2, chunk[i], decrypt);\n return out;\n };\n }\n}), require_ofb = __commonJS({\n \"node_modules/browserify-aes/modes/ofb.js\"(exports) {\n var xor = require_buffer_xor();\n function getBlock(self2) {\n return self2._prev = self2._cipher.encryptBlock(self2._prev), self2._prev;\n }\n exports.encrypt = function(self2, chunk) {\n for (;self2._cache.length < chunk.length; )\n self2._cache = Buffer.concat([self2._cache, getBlock(self2)]);\n var pad = self2._cache.slice(0, chunk.length);\n return self2._cache = self2._cache.slice(chunk.length), xor(chunk, pad);\n };\n }\n}), require_incr32 = __commonJS({\n \"node_modules/browserify-aes/incr32.js\"(exports, module) {\n function incr32(iv) {\n for (var len = iv.length, item;len--; )\n if (item = iv.readUInt8(len), item === 255)\n iv.writeUInt8(0, len);\n else {\n item++, iv.writeUInt8(item, len);\n break;\n }\n }\n module.exports = incr32;\n }\n}), require_ctr = __commonJS({\n \"node_modules/browserify-aes/modes/ctr.js\"(exports) {\n var xor = require_buffer_xor(), Buffer2 = require_safe_buffer().Buffer, incr32 = require_incr32();\n function getBlock(self2) {\n var out = self2._cipher.encryptBlockRaw(self2._prev);\n return incr32(self2._prev), out;\n }\n var blockSize = 16;\n exports.encrypt = function(self2, chunk) {\n var chunkNum = Math.ceil(chunk.length / blockSize), start = self2._cache.length;\n self2._cache = Buffer2.concat([self2._cache, Buffer2.allocUnsafe(chunkNum * blockSize)]);\n for (var i = 0;i < chunkNum; i++) {\n var out = getBlock(self2), offset = start + i * blockSize;\n self2._cache.writeUInt32BE(out[0], offset + 0), self2._cache.writeUInt32BE(out[1], offset + 4), self2._cache.writeUInt32BE(out[2], offset + 8), self2._cache.writeUInt32BE(out[3], offset + 12);\n }\n var pad = self2._cache.slice(0, chunk.length);\n return self2._cache = self2._cache.slice(chunk.length), xor(chunk, pad);\n };\n }\n}), require_list = __commonJS({\n \"node_modules/browserify-aes/modes/list.json\"(exports, module) {\n module.exports = {\n \"aes-128-ecb\": {\n cipher: \"AES\",\n key: 128,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-192-ecb\": {\n cipher: \"AES\",\n key: 192,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-256-ecb\": {\n cipher: \"AES\",\n key: 256,\n iv: 0,\n mode: \"ECB\",\n type: \"block\"\n },\n \"aes-128-cbc\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-192-cbc\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-256-cbc\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes128: {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes192: {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n aes256: {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CBC\",\n type: \"block\"\n },\n \"aes-128-cfb\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-192-cfb\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-256-cfb\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB\",\n type: \"stream\"\n },\n \"aes-128-cfb8\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-192-cfb8\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-256-cfb8\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB8\",\n type: \"stream\"\n },\n \"aes-128-cfb1\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-192-cfb1\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-256-cfb1\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CFB1\",\n type: \"stream\"\n },\n \"aes-128-ofb\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-192-ofb\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-256-ofb\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"OFB\",\n type: \"stream\"\n },\n \"aes-128-ctr\": {\n cipher: \"AES\",\n key: 128,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-192-ctr\": {\n cipher: \"AES\",\n key: 192,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-256-ctr\": {\n cipher: \"AES\",\n key: 256,\n iv: 16,\n mode: \"CTR\",\n type: \"stream\"\n },\n \"aes-128-gcm\": {\n cipher: \"AES\",\n key: 128,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n },\n \"aes-192-gcm\": {\n cipher: \"AES\",\n key: 192,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n },\n \"aes-256-gcm\": {\n cipher: \"AES\",\n key: 256,\n iv: 12,\n mode: \"GCM\",\n type: \"auth\"\n }\n };\n }\n}), require_modes = __commonJS({\n \"node_modules/browserify-aes/modes/index.js\"(exports, module) {\n var modeModules = {\n ECB: require_ecb(),\n CBC: require_cbc2(),\n CFB: require_cfb(),\n CFB8: require_cfb8(),\n CFB1: require_cfb1(),\n OFB: require_ofb(),\n CTR: require_ctr(),\n GCM: require_ctr()\n }, modes = require_list();\n for (key2 in modes)\n modes[key2].module = modeModules[modes[key2].mode];\n var key2;\n module.exports = modes;\n }\n}), require_aes = __commonJS({\n \"node_modules/browserify-aes/aes.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer;\n function asUInt32Array(buf) {\n if (buf instanceof KeyObject)\n buf = buf.export();\n else if (buf instanceof CryptoKey)\n buf = KeyObject.from(buf).export();\n Buffer2.isBuffer(buf) || (buf = Buffer2.from(buf));\n for (var len = buf.length / 4 | 0, out = new @Array(len), i = 0;i < len; i++)\n out[i] = buf.readUInt32BE(i * 4);\n return out;\n }\n function scrubVec(v) {\n for (var i = 0;i < v.length; v++)\n v[i] = 0;\n }\n function cryptBlock(M, keySchedule, SUB_MIX, SBOX, nRounds) {\n for (var SUB_MIX0 = SUB_MIX[0], SUB_MIX1 = SUB_MIX[1], SUB_MIX2 = SUB_MIX[2], SUB_MIX3 = SUB_MIX[3], s0 = M[0] ^ keySchedule[0], s1 = M[1] ^ keySchedule[1], s2 = M[2] ^ keySchedule[2], s3 = M[3] ^ keySchedule[3], t0, t1, t2, t3, ksRow = 4, round = 1;round < nRounds; round++)\n t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[s1 >>> 16 & 255] ^ SUB_MIX2[s2 >>> 8 & 255] ^ SUB_MIX3[s3 & 255] ^ keySchedule[ksRow++], t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[s2 >>> 16 & 255] ^ SUB_MIX2[s3 >>> 8 & 255] ^ SUB_MIX3[s0 & 255] ^ keySchedule[ksRow++], t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[s3 >>> 16 & 255] ^ SUB_MIX2[s0 >>> 8 & 255] ^ SUB_MIX3[s1 & 255] ^ keySchedule[ksRow++], t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[s0 >>> 16 & 255] ^ SUB_MIX2[s1 >>> 8 & 255] ^ SUB_MIX3[s2 & 255] ^ keySchedule[ksRow++], s0 = t0, s1 = t1, s2 = t2, s3 = t3;\n return t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 255] << 16 | SBOX[s2 >>> 8 & 255] << 8 | SBOX[s3 & 255]) ^ keySchedule[ksRow++], t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 255] << 16 | SBOX[s3 >>> 8 & 255] << 8 | SBOX[s0 & 255]) ^ keySchedule[ksRow++], t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 255] << 16 | SBOX[s0 >>> 8 & 255] << 8 | SBOX[s1 & 255]) ^ keySchedule[ksRow++], t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 255] << 16 | SBOX[s1 >>> 8 & 255] << 8 | SBOX[s2 & 255]) ^ keySchedule[ksRow++], t0 = t0 >>> 0, t1 = t1 >>> 0, t2 = t2 >>> 0, t3 = t3 >>> 0, [t0, t1, t2, t3];\n }\n var RCON = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], G = function() {\n for (var d = new @Array(256), j = 0;j < 256; j++)\n j < 128 \? d[j] = j << 1 : d[j] = j << 1 ^ 283;\n for (var SBOX = [], INV_SBOX = [], SUB_MIX = [[], [], [], []], INV_SUB_MIX = [[], [], [], []], x = 0, xi = 0, i = 0;i < 256; ++i) {\n var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n sx = sx >>> 8 ^ sx & 255 ^ 99, SBOX[x] = sx, INV_SBOX[sx] = x;\n var x2 = d[x], x4 = d[x2], x8 = d[x4], t = d[sx] * 257 ^ sx * 16843008;\n SUB_MIX[0][x] = t << 24 | t >>> 8, SUB_MIX[1][x] = t << 16 | t >>> 16, SUB_MIX[2][x] = t << 8 | t >>> 24, SUB_MIX[3][x] = t, t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008, INV_SUB_MIX[0][sx] = t << 24 | t >>> 8, INV_SUB_MIX[1][sx] = t << 16 | t >>> 16, INV_SUB_MIX[2][sx] = t << 8 | t >>> 24, INV_SUB_MIX[3][sx] = t, x === 0 \? x = xi = 1 : (x = x2 ^ d[d[d[x8 ^ x2]]], xi ^= d[d[xi]]);\n }\n return {\n SBOX,\n INV_SBOX,\n SUB_MIX,\n INV_SUB_MIX\n };\n }();\n function AES(key2) {\n this._key = asUInt32Array(key2), this._reset();\n }\n AES.prototype = {}, AES.blockSize = 16, AES.keySize = 32, AES.prototype.blockSize = AES.blockSize, AES.prototype.keySize = AES.keySize, AES.prototype._reset = function() {\n for (var keyWords = this._key, keySize = keyWords.length, nRounds = keySize + 6, ksRows = (nRounds + 1) * 4, keySchedule = [], k = 0;k < keySize; k++)\n keySchedule[k] = keyWords[k];\n for (k = keySize;k < ksRows; k++) {\n var t = keySchedule[k - 1];\n k % keySize === 0 \? (t = t << 8 | t >>> 24, t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255], t ^= RCON[k / keySize | 0] << 24) : keySize > 6 && k % keySize === 4 && (t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255]), keySchedule[k] = keySchedule[k - keySize] ^ t;\n }\n for (var invKeySchedule = [], ik = 0;ik < ksRows; ik++) {\n var ksR = ksRows - ik, tt = keySchedule[ksR - (ik % 4 \? 0 : 4)];\n ik < 4 || ksR <= 4 \? invKeySchedule[ik] = tt : invKeySchedule[ik] = G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^ G.INV_SUB_MIX[1][G.SBOX[tt >>> 16 & 255]] ^ G.INV_SUB_MIX[2][G.SBOX[tt >>> 8 & 255]] ^ G.INV_SUB_MIX[3][G.SBOX[tt & 255]];\n }\n this._nRounds = nRounds, this._keySchedule = keySchedule, this._invKeySchedule = invKeySchedule;\n }, AES.prototype.encryptBlockRaw = function(M) {\n return M = asUInt32Array(M), cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds);\n }, AES.prototype.encryptBlock = function(M) {\n var out = this.encryptBlockRaw(M), buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0], 0), buf.writeUInt32BE(out[1], 4), buf.writeUInt32BE(out[2], 8), buf.writeUInt32BE(out[3], 12), buf;\n }, AES.prototype.decryptBlock = function(M) {\n M = asUInt32Array(M);\n var m1 = M[1];\n M[1] = M[3], M[3] = m1;\n var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds), buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0], 0), buf.writeUInt32BE(out[3], 4), buf.writeUInt32BE(out[2], 8), buf.writeUInt32BE(out[1], 12), buf;\n }, AES.prototype.scrub = function() {\n scrubVec(this._keySchedule), scrubVec(this._invKeySchedule), scrubVec(this._key);\n }, module.exports.AES = AES;\n }\n}), require_ghash = __commonJS({\n \"node_modules/browserify-aes/ghash.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, ZEROES = Buffer2.alloc(16, 0);\n function toArray(buf) {\n return [buf.readUInt32BE(0), buf.readUInt32BE(4), buf.readUInt32BE(8), buf.readUInt32BE(12)];\n }\n function fromArray(out) {\n var buf = Buffer2.allocUnsafe(16);\n return buf.writeUInt32BE(out[0] >>> 0, 0), buf.writeUInt32BE(out[1] >>> 0, 4), buf.writeUInt32BE(out[2] >>> 0, 8), buf.writeUInt32BE(out[3] >>> 0, 12), buf;\n }\n function GHASH(key2) {\n this.h = key2, this.state = Buffer2.alloc(16, 0), this.cache = Buffer2.allocUnsafe(0);\n }\n GHASH.prototype = {}, GHASH.prototype.ghash = function(block) {\n for (var i = -1;++i < block.length; )\n this.state[i] ^= block[i];\n this._multiply();\n }, GHASH.prototype._multiply = function() {\n for (var Vi = toArray(this.h), Zi = [0, 0, 0, 0], j, xi, lsbVi, i = -1;++i < 128; ) {\n for (xi = (this.state[~~(i / 8)] & 1 << 7 - i % 8) !== 0, xi && (Zi[0] ^= Vi[0], Zi[1] ^= Vi[1], Zi[2] ^= Vi[2], Zi[3] ^= Vi[3]), lsbVi = (Vi[3] & 1) !== 0, j = 3;j > 0; j--)\n Vi[j] = Vi[j] >>> 1 | (Vi[j - 1] & 1) << 31;\n Vi[0] = Vi[0] >>> 1, lsbVi && (Vi[0] = Vi[0] ^ 225 << 24);\n }\n this.state = fromArray(Zi);\n }, GHASH.prototype.update = function(buf) {\n this.cache = Buffer2.concat([this.cache, buf]);\n for (var chunk;this.cache.length >= 16; )\n chunk = this.cache.slice(0, 16), this.cache = this.cache.slice(16), this.ghash(chunk);\n }, GHASH.prototype.final = function(abl, bl) {\n return this.cache.length && this.ghash(Buffer2.concat([this.cache, ZEROES], 16)), this.ghash(fromArray([0, abl, 0, bl])), this.state;\n }, module.exports = GHASH;\n }\n}), require_authCipher = __commonJS({\n \"node_modules/browserify-aes/authCipher.js\"(exports, module) {\n var aes = require_aes(), Buffer2 = require_safe_buffer().Buffer, Transform = require_cipher_base(), inherits = require_inherits_browser(), GHASH = require_ghash(), xor = require_buffer_xor(), incr32 = require_incr32();\n function xorTest(a, b) {\n var out = 0;\n a.length !== b.length && out++;\n for (var len = Math.min(a.length, b.length), i = 0;i < len; ++i)\n out += a[i] ^ b[i];\n return out;\n }\n function calcIv(self2, iv, ck) {\n if (iv.length === 12)\n return self2._finID = Buffer2.concat([iv, Buffer2.from([0, 0, 0, 1])]), Buffer2.concat([iv, Buffer2.from([0, 0, 0, 2])]);\n var ghash = new GHASH(ck), len = iv.length, toPad = len % 16;\n ghash.update(iv), toPad && (toPad = 16 - toPad, ghash.update(Buffer2.alloc(toPad, 0))), ghash.update(Buffer2.alloc(8, 0));\n var ivBits = len * 8, tail = Buffer2.alloc(8);\n tail.writeUIntBE(ivBits, 0, 8), ghash.update(tail), self2._finID = ghash.state;\n var out = Buffer2.from(self2._finID);\n return incr32(out), out;\n }\n function StreamCipher(mode, key2, iv, decrypt) {\n Transform.@call(this);\n var h = Buffer2.alloc(4, 0);\n this._cipher = new aes.AES(key2);\n var ck = this._cipher.encryptBlock(h);\n this._ghash = new GHASH(ck), iv = calcIv(this, iv, ck), this._prev = Buffer2.from(iv), this._cache = Buffer2.allocUnsafe(0), this._secCache = Buffer2.allocUnsafe(0), this._decrypt = decrypt, this._alen = 0, this._len = 0, this._mode = mode, this._authTag = null, this._called = !1;\n }\n inherits(StreamCipher, Transform), StreamCipher.prototype._update = function(chunk) {\n if (!this._called && this._alen) {\n var rump = 16 - this._alen % 16;\n rump < 16 && (rump = Buffer2.alloc(rump, 0), this._ghash.update(rump));\n }\n this._called = !0;\n var out = this._mode.encrypt(this, chunk);\n return this._decrypt \? this._ghash.update(chunk) : this._ghash.update(out), this._len += chunk.length, out;\n }, StreamCipher.prototype._final = function() {\n if (this._decrypt && !this._authTag)\n throw new Error(\"Unsupported state or unable to authenticate data\");\n var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID));\n if (this._decrypt && xorTest(tag, this._authTag))\n throw new Error(\"Unsupported state or unable to authenticate data\");\n this._authTag = tag, this._cipher.scrub();\n }, StreamCipher.prototype.getAuthTag = function() {\n if (this._decrypt || !Buffer2.isBuffer(this._authTag))\n throw new Error(\"Attempting to get auth tag in unsupported state\");\n return this._authTag;\n }, StreamCipher.prototype.setAuthTag = function(tag) {\n if (!this._decrypt)\n throw new Error(\"Attempting to set auth tag in unsupported state\");\n this._authTag = tag;\n }, StreamCipher.prototype.setAAD = function(buf) {\n if (this._called)\n throw new Error(\"Attempting to set AAD in unsupported state\");\n this._ghash.update(buf), this._alen += buf.length;\n }, module.exports = StreamCipher;\n }\n}), require_streamCipher = __commonJS({\n \"node_modules/browserify-aes/streamCipher.js\"(exports, module) {\n var aes = require_aes(), Buffer2 = require_safe_buffer().Buffer, Transform = require_cipher_base(), inherits = require_inherits_browser();\n function StreamCipher(mode, key2, iv, decrypt) {\n Transform.@call(this), this._cipher = new aes.AES(key2), this._prev = Buffer2.from(iv), this._cache = Buffer2.allocUnsafe(0), this._secCache = Buffer2.allocUnsafe(0), this._decrypt = decrypt, this._mode = mode;\n }\n inherits(StreamCipher, Transform), StreamCipher.prototype._update = function(chunk) {\n return this._mode.encrypt(this, chunk, this._decrypt);\n }, StreamCipher.prototype._final = function() {\n this._cipher.scrub();\n }, module.exports = StreamCipher;\n }\n}), require_evp_bytestokey = __commonJS({\n \"node_modules/evp_bytestokey/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, MD5 = require_md5();\n function EVP_BytesToKey(password, salt, keyBits, ivLen) {\n if (Buffer2.isBuffer(password) || (password = Buffer2.from(password, \"binary\")), salt && (Buffer2.isBuffer(salt) || (salt = Buffer2.from(salt, \"binary\")), salt.length !== 8))\n @throwRangeError(\"salt should be Buffer with 8 byte length\");\n for (var keyLen = keyBits / 8, key2 = Buffer2.alloc(keyLen), iv = Buffer2.alloc(ivLen || 0), tmp = Buffer2.alloc(0);keyLen > 0 || ivLen > 0; ) {\n var hash = new MD5;\n hash.update(tmp), hash.update(password), salt && hash.update(salt), tmp = hash.digest();\n var used = 0;\n if (keyLen > 0) {\n var keyStart = key2.length - keyLen;\n used = Math.min(keyLen, tmp.length), tmp.copy(key2, keyStart, 0, used), keyLen -= used;\n }\n if (used < tmp.length && ivLen > 0) {\n var ivStart = iv.length - ivLen, length = Math.min(ivLen, tmp.length - used);\n tmp.copy(iv, ivStart, used, used + length), ivLen -= length;\n }\n }\n return tmp.fill(0), { key: key2, iv };\n }\n module.exports = EVP_BytesToKey;\n }\n}), require_encrypter = __commonJS({\n \"node_modules/browserify-aes/encrypter.js\"(exports) {\n var MODES = require_modes(), AuthCipher = require_authCipher(), Buffer2 = require_safe_buffer().Buffer, StreamCipher = require_streamCipher(), Transform = require_cipher_base(), aes = require_aes(), ebtk = require_evp_bytestokey(), inherits = require_inherits_browser();\n function Cipher(mode, key2, iv) {\n Transform.@call(this), this._cache = new Splitter, this._cipher = new aes.AES(key2), this._prev = Buffer2.from(iv), this._mode = mode, this._autopadding = !0;\n }\n inherits(Cipher, Transform), Cipher.prototype._update = function(data) {\n this._cache.add(data);\n for (var chunk, thing, out = [];chunk = this._cache.get(); )\n thing = this._mode.encrypt(this, chunk), out.push(thing);\n return Buffer2.concat(out);\n };\n var PADDING = Buffer2.alloc(16, 16);\n Cipher.prototype._final = function() {\n var chunk = this._cache.flush();\n if (this._autopadding)\n return chunk = this._mode.encrypt(this, chunk), this._cipher.scrub(), chunk;\n if (!chunk.equals(PADDING))\n throw this._cipher.scrub(), new Error(\"data not multiple of block length\");\n }, Cipher.prototype.setAutoPadding = function(setTo) {\n return this._autopadding = !!setTo, this;\n };\n function Splitter() {\n this.cache = Buffer2.allocUnsafe(0);\n }\n Splitter.prototype = {}, Splitter.prototype.add = function(data) {\n this.cache = Buffer2.concat([this.cache, data]);\n }, Splitter.prototype.get = function() {\n if (this.cache.length > 15) {\n var out = this.cache.slice(0, 16);\n return this.cache = this.cache.slice(16), out;\n }\n return null;\n }, Splitter.prototype.flush = function() {\n for (var len = 16 - this.cache.length, padBuff = Buffer2.allocUnsafe(len), i = -1;++i < len; )\n padBuff.writeUInt8(len, i);\n return Buffer2.concat([this.cache, padBuff]);\n };\n function createCipheriv(suite, password, iv) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n password = getArrayBufferOrView(password, \"password\");\n const iv_length = iv\?.length || 0, required_iv_length = config.iv || 0;\n if (iv = iv === null \? EMPTY_BUFFER : getArrayBufferOrView(iv, \"iv\"), password\?.length !== config.key / 8) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n if (config.mode !== \"GCM\" && iv_length !== required_iv_length) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n return config.type === \"stream\" \? new StreamCipher(config.module, password, iv) : config.type === \"auth\" \? new AuthCipher(config.module, password, iv) : new Cipher(config.module, password, iv);\n }\n function createCipher(suite, password) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, config.key, config.iv);\n return createCipheriv(suite, keys.key, keys.iv);\n }\n exports.createCipheriv = createCipheriv, exports.createCipher = createCipher;\n }\n}), require_decrypter = __commonJS({\n \"node_modules/browserify-aes/decrypter.js\"(exports) {\n var AuthCipher = require_authCipher(), Buffer2 = require_safe_buffer().Buffer, MODES = require_modes(), StreamCipher = require_streamCipher(), Transform = require_cipher_base(), aes = require_aes(), ebtk = require_evp_bytestokey(), inherits = require_inherits_browser();\n function Decipher(mode, key2, iv) {\n Transform.@call(this), this._cache = new Splitter, this._last = void 0, this._cipher = new aes.AES(key2), this._prev = Buffer2.from(iv), this._mode = mode, this._autopadding = !0;\n }\n inherits(Decipher, Transform), Decipher.prototype._update = function(data) {\n this._cache.add(data);\n for (var chunk, thing, out = [];chunk = this._cache.get(this._autopadding); )\n thing = this._mode.decrypt(this, chunk), out.push(thing);\n return Buffer2.concat(out);\n }, Decipher.prototype._final = function() {\n var chunk = this._cache.flush();\n if (this._autopadding)\n return unpad(this._mode.decrypt(this, chunk));\n if (chunk)\n throw new Error(\"data not multiple of block length\");\n }, Decipher.prototype.setAutoPadding = function(setTo) {\n return this._autopadding = !!setTo, this;\n };\n function Splitter() {\n this.cache = Buffer2.allocUnsafe(0);\n }\n Splitter.prototype = {}, Splitter.prototype.add = function(data) {\n this.cache = Buffer2.concat([this.cache, data]);\n }, Splitter.prototype.get = function(autoPadding) {\n var out;\n if (autoPadding) {\n if (this.cache.length > 16)\n return out = this.cache.slice(0, 16), this.cache = this.cache.slice(16), out;\n } else if (this.cache.length >= 16)\n return out = this.cache.slice(0, 16), this.cache = this.cache.slice(16), out;\n return null;\n }, Splitter.prototype.flush = function() {\n if (this.cache.length)\n return this.cache;\n };\n function unpad(last) {\n var padded = last[15];\n if (padded < 1 || padded > 16)\n throw new Error(\"unable to decrypt data\");\n for (var i = -1;++i < padded; )\n if (last[i + (16 - padded)] !== padded)\n throw new Error(\"unable to decrypt data\");\n if (padded !== 16)\n return last.slice(0, 16 - padded);\n }\n function createDecipheriv(suite, password, iv) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n password = getArrayBufferOrView(password, \"password\");\n const iv_length = iv\?.length || 0, required_iv_length = config.iv || 0;\n if (iv = iv === null \? EMPTY_BUFFER : getArrayBufferOrView(iv, \"iv\"), config.mode !== \"GCM\" && iv_length !== required_iv_length) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n if (password.length !== config.key / 8) {\n var error = new RangeError(\"Invalid key length\");\n throw error.code = \"ERR_CRYPTO_INVALID_KEYLEN\", error;\n }\n return config.type === \"stream\" \? new StreamCipher(config.module, password, iv, !0) : config.type === \"auth\" \? new AuthCipher(config.module, password, iv, !0) : new Decipher(config.module, password, iv);\n }\n function createDecipher(suite, password) {\n var config = MODES[suite.toLowerCase()];\n if (!config)\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, config.key, config.iv);\n return createDecipheriv(suite, keys.key, keys.iv);\n }\n exports.createDecipher = createDecipher, exports.createDecipheriv = createDecipheriv;\n }\n}), require_browser5 = __commonJS({\n \"node_modules/browserify-aes/browser.js\"(exports) {\n var ciphers = require_encrypter(), deciphers = require_decrypter(), modes = require_list();\n function getCiphers() {\n return Object.keys(modes);\n }\n exports.createCipher = exports.Cipher = ciphers.createCipher, exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv, exports.createDecipher = exports.Decipher = deciphers.createDecipher, exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv, exports.listCiphers = exports.getCiphers = getCiphers;\n }\n}), require_modes2 = __commonJS({\n \"node_modules/browserify-des/modes.js\"(exports) {\n exports[\"des-ecb\"] = {\n key: 8,\n iv: 0\n }, exports[\"des-cbc\"] = exports.des = {\n key: 8,\n iv: 8\n }, exports[\"des-ede3-cbc\"] = exports.des3 = {\n key: 24,\n iv: 8\n }, exports[\"des-ede3\"] = {\n key: 24,\n iv: 0\n }, exports[\"des-ede-cbc\"] = {\n key: 16,\n iv: 8\n }, exports[\"des-ede\"] = {\n key: 16,\n iv: 0\n };\n }\n}), require_browser6 = __commonJS({\n \"node_modules/browserify-cipher/browser.js\"(exports) {\n var DES = require_browserify_des(), aes = require_browser5(), aesModes = require_modes(), desModes = require_modes2(), ebtk = require_evp_bytestokey();\n function createCipher(suite, password) {\n suite = suite.toLowerCase();\n var keyLen, ivLen;\n if (aesModes[suite])\n keyLen = aesModes[suite].key, ivLen = aesModes[suite].iv;\n else if (desModes[suite])\n keyLen = desModes[suite].key * 8, ivLen = desModes[suite].iv;\n else\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, keyLen, ivLen);\n return createCipheriv(suite, keys.key, keys.iv);\n }\n function createDecipher(suite, password) {\n suite = suite.toLowerCase();\n var keyLen, ivLen;\n if (aesModes[suite])\n keyLen = aesModes[suite].key, ivLen = aesModes[suite].iv;\n else if (desModes[suite])\n keyLen = desModes[suite].key * 8, ivLen = desModes[suite].iv;\n else\n @throwTypeError(\"invalid suite type\");\n var keys = ebtk(password, !1, keyLen, ivLen);\n return createDecipheriv(suite, keys.key, keys.iv);\n }\n function createCipheriv(suite, key2, iv) {\n if (suite = suite.toLowerCase(), aesModes[suite])\n return aes.createCipheriv(suite, key2, iv);\n if (desModes[suite])\n return new DES({ key: key2, iv, mode: suite });\n @throwTypeError(\"invalid suite type\");\n }\n function createDecipheriv(suite, key2, iv) {\n if (suite = suite.toLowerCase(), aesModes[suite])\n return aes.createDecipheriv(suite, key2, iv);\n if (desModes[suite])\n return new DES({ key: key2, iv, mode: suite, decrypt: !0 });\n @throwTypeError(\"invalid suite type\");\n }\n function getCiphers() {\n return Object.keys(desModes).concat(aes.getCiphers());\n }\n exports.createCipher = exports.Cipher = createCipher, exports.createCipheriv = exports.Cipheriv = createCipheriv, exports.createDecipher = exports.Decipher = createDecipher, exports.createDecipheriv = exports.Decipheriv = createDecipheriv, exports.listCiphers = exports.getCiphers = getCiphers;\n }\n}), require_bn = __commonJS({\n \"node_modules/diffie-hellman/node_modules/bn.js/lib/bn.js\"(exports, module) {\n (function(module2, exports2) {\n function assert(val, msg) {\n if (!val)\n throw new Error(msg || \"Assertion failed\");\n }\n function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function() {\n };\n TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor, ctor.prototype.constructor = ctor;\n }\n function BN(number, base, endian) {\n if (BN.isBN(number))\n return number;\n this.negative = 0, this.words = null, this.length = 0, this.red = null, number !== null && ((base === \"le\" || base === \"be\") && (endian = base, base = 10), this._init(number || 0, base || 10, endian || \"be\"));\n }\n BN.prototype = {}, typeof module2 == \"object\" \? module2.exports = BN : exports2.BN = BN, BN.BN = BN, BN.wordSize = 26;\n var Buffer2 = Buffer;\n BN.isBN = function(num) {\n return num instanceof BN \? !0 : num !== null && typeof num == \"object\" && num.constructor.wordSize === BN.wordSize && @Array.isArray(num.words);\n }, BN.max = function(left, right) {\n return left.cmp(right) > 0 \? left : right;\n }, BN.min = function(left, right) {\n return left.cmp(right) < 0 \? left : right;\n }, BN.prototype._init = function(number, base, endian) {\n if (typeof number == \"number\")\n return this._initNumber(number, base, endian);\n if (typeof number == \"object\")\n return this._initArray(number, base, endian);\n base === \"hex\" && (base = 16), assert(base === (base | 0) && base >= 2 && base <= 36), number = number.toString().replace(/\\s+/g, \"\");\n var start = 0;\n number[0] === \"-\" && (start++, this.negative = 1), start < number.length && (base === 16 \? this._parseHex(number, start, endian) : (this._parseBase(number, base, start), endian === \"le\" && this._initArray(this.toArray(), base, endian)));\n }, BN.prototype._initNumber = function(number, base, endian) {\n number < 0 && (this.negative = 1, number = -number), number < 67108864 \? (this.words = [number & 67108863], this.length = 1) : number < 4503599627370496 \? (this.words = [number & 67108863, number / 67108864 & 67108863], this.length = 2) : (assert(number < 9007199254740992), this.words = [number & 67108863, number / 67108864 & 67108863, 1], this.length = 3), endian === \"le\" && this._initArray(this.toArray(), base, endian);\n }, BN.prototype._initArray = function(number, base, endian) {\n if (assert(typeof number.length == \"number\"), number.length <= 0)\n return this.words = [0], this.length = 1, this;\n this.length = Math.ceil(number.length / 3), this.words = new @Array(this.length);\n for (var i = 0;i < this.length; i++)\n this.words[i] = 0;\n var j, w, off = 0;\n if (endian === \"be\")\n for (i = number.length - 1, j = 0;i >= 0; i -= 3)\n w = number[i] | number[i - 1] << 8 | number[i - 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26 && (off -= 26, j++);\n else if (endian === \"le\")\n for (i = 0, j = 0;i < number.length; i += 3)\n w = number[i] | number[i + 1] << 8 | number[i + 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26 && (off -= 26, j++);\n return this.strip();\n };\n function parseHex4Bits(string, index) {\n var c = string.charCodeAt(index);\n return c >= 65 && c <= 70 \? c - 55 : c >= 97 && c <= 102 \? c - 87 : c - 48 & 15;\n }\n function parseHexByte(string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n return index - 1 >= lowerBound && (r |= parseHex4Bits(string, index - 1) << 4), r;\n }\n BN.prototype._parseHex = function(number, start, endian) {\n this.length = Math.ceil((number.length - start) / 6), this.words = new @Array(this.length);\n for (var i = 0;i < this.length; i++)\n this.words[i] = 0;\n var off = 0, j = 0, w;\n if (endian === \"be\")\n for (i = number.length - 1;i >= start; i -= 2)\n w = parseHexByte(number, start, i) << off, this.words[j] |= w & 67108863, off >= 18 \? (off -= 18, j += 1, this.words[j] |= w >>> 26) : off += 8;\n else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 \? start + 1 : start;i < number.length; i += 2)\n w = parseHexByte(number, start, i) << off, this.words[j] |= w & 67108863, off >= 18 \? (off -= 18, j += 1, this.words[j] |= w >>> 26) : off += 8;\n }\n this.strip();\n };\n function parseBase(str, start, end, mul) {\n for (var r = 0, len = Math.min(str.length, end), i = start;i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n r *= mul, c >= 49 \? r += c - 49 + 10 : c >= 17 \? r += c - 17 + 10 : r += c;\n }\n return r;\n }\n BN.prototype._parseBase = function(number, base, start) {\n this.words = [0], this.length = 1;\n for (var limbLen = 0, limbPow = 1;limbPow <= 67108863; limbPow *= base)\n limbLen++;\n limbLen--, limbPow = limbPow / base | 0;\n for (var total = number.length - start, mod = total % limbLen, end = Math.min(total, total - mod) + start, word = 0, i = start;i < end; i += limbLen)\n word = parseBase(number, i, i + limbLen, base), this.imuln(limbPow), this.words[0] + word < 67108864 \? this.words[0] += word : this._iaddn(word);\n if (mod !== 0) {\n var pow = 1;\n for (word = parseBase(number, i, number.length, base), i = 0;i < mod; i++)\n pow *= base;\n this.imuln(pow), this.words[0] + word < 67108864 \? this.words[0] += word : this._iaddn(word);\n }\n this.strip();\n }, BN.prototype.copy = function(dest) {\n dest.words = new @Array(this.length);\n for (var i = 0;i < this.length; i++)\n dest.words[i] = this.words[i];\n dest.length = this.length, dest.negative = this.negative, dest.red = this.red;\n }, BN.prototype.clone = function() {\n var r = new BN(null);\n return this.copy(r), r;\n }, BN.prototype._expand = function(size) {\n for (;this.length < size; )\n this.words[this.length++] = 0;\n return this;\n }, BN.prototype.strip = function() {\n for (;this.length > 1 && this.words[this.length - 1] === 0; )\n this.length--;\n return this._normSign();\n }, BN.prototype._normSign = function() {\n return this.length === 1 && this.words[0] === 0 && (this.negative = 0), this;\n }, BN.prototype.inspect = function() {\n return (this.red \? \"<BN-R: \" : \"<BN: \") + this.toString(16) + \">\";\n };\n var zeros = [\n \"\",\n \"0\",\n \"00\",\n \"000\",\n \"0000\",\n \"00000\",\n \"000000\",\n \"0000000\",\n \"00000000\",\n \"000000000\",\n \"0000000000\",\n \"00000000000\",\n \"000000000000\",\n \"0000000000000\",\n \"00000000000000\",\n \"000000000000000\",\n \"0000000000000000\",\n \"00000000000000000\",\n \"000000000000000000\",\n \"0000000000000000000\",\n \"00000000000000000000\",\n \"000000000000000000000\",\n \"0000000000000000000000\",\n \"00000000000000000000000\",\n \"000000000000000000000000\",\n \"0000000000000000000000000\"\n ], groupSizes = [\n 0,\n 0,\n 25,\n 16,\n 12,\n 11,\n 10,\n 9,\n 8,\n 8,\n 7,\n 7,\n 7,\n 7,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5\n ], groupBases = [\n 0,\n 0,\n 33554432,\n 43046721,\n 16777216,\n 48828125,\n 60466176,\n 40353607,\n 16777216,\n 43046721,\n 1e7,\n 19487171,\n 35831808,\n 62748517,\n 7529536,\n 11390625,\n 16777216,\n 24137569,\n 34012224,\n 47045881,\n 64000000,\n 4084101,\n 5153632,\n 6436343,\n 7962624,\n 9765625,\n 11881376,\n 14348907,\n 17210368,\n 20511149,\n 24300000,\n 28629151,\n 33554432,\n 39135393,\n 45435424,\n 52521875,\n 60466176\n ];\n BN.prototype.toString = function(base, padding) {\n base = base || 10, padding = padding | 0 || 1;\n var out;\n if (base === 16 || base === \"hex\") {\n out = \"\";\n for (var off = 0, carry = 0, i = 0;i < this.length; i++) {\n var w = this.words[i], word = ((w << off | carry) & 16777215).toString(16);\n carry = w >>> 24 - off & 16777215, carry !== 0 || i !== this.length - 1 \? out = zeros[6 - word.length] + word + out : out = word + out, off += 2, off >= 26 && (off -= 26, i--);\n }\n for (carry !== 0 && (out = carry.toString(16) + out);out.length % padding !== 0; )\n out = \"0\" + out;\n return this.negative !== 0 && (out = \"-\" + out), out;\n }\n if (base === (base | 0) && base >= 2 && base <= 36) {\n var groupSize = groupSizes[base], groupBase = groupBases[base];\n out = \"\";\n var c = this.clone();\n for (c.negative = 0;!c.isZero(); ) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase), c.isZero() \? out = r + out : out = zeros[groupSize - r.length] + r + out;\n }\n for (this.isZero() && (out = \"0\" + out);out.length % padding !== 0; )\n out = \"0\" + out;\n return this.negative !== 0 && (out = \"-\" + out), out;\n }\n assert(!1, \"Base should be between 2 and 36\");\n }, BN.prototype.toNumber = function() {\n var ret = this.words[0];\n return this.length === 2 \? ret += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 \? ret += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && assert(!1, \"Number can only safely store up to 53 bits\"), this.negative !== 0 \? -ret : ret;\n }, BN.prototype.toJSON = function() {\n return this.toString(16);\n }, BN.prototype.toBuffer = function(endian, length) {\n return assert(typeof Buffer2 < \"u\"), this.toArrayLike(Buffer2, endian, length);\n }, BN.prototype.toArray = function(endian, length) {\n return this.toArrayLike(@Array, endian, length);\n }, BN.prototype.toArrayLike = function(ArrayType, endian, length) {\n var byteLength = this.byteLength(), reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, \"byte array longer than desired length\"), assert(reqLength > 0, \"Requested array length <= 0\"), this.strip();\n var littleEndian = endian === \"le\", res = new ArrayType(reqLength), b, i, q = this.clone();\n if (littleEndian) {\n for (i = 0;!q.isZero(); i++)\n b = q.andln(255), q.iushrn(8), res[i] = b;\n for (;i < reqLength; i++)\n res[i] = 0;\n } else {\n for (i = 0;i < reqLength - byteLength; i++)\n res[i] = 0;\n for (i = 0;!q.isZero(); i++)\n b = q.andln(255), q.iushrn(8), res[reqLength - i - 1] = b;\n }\n return res;\n }, Math.clz32 \? BN.prototype._countBits = function(w) {\n return 32 - Math.clz32(w);\n } : BN.prototype._countBits = function(w) {\n var t = w, r = 0;\n return t >= 4096 && (r += 13, t >>>= 13), t >= 64 && (r += 7, t >>>= 7), t >= 8 && (r += 4, t >>>= 4), t >= 2 && (r += 2, t >>>= 2), r + t;\n }, BN.prototype._zeroBits = function(w) {\n if (w === 0)\n return 26;\n var t = w, r = 0;\n return (t & 8191) === 0 && (r += 13, t >>>= 13), (t & 127) === 0 && (r += 7, t >>>= 7), (t & 15) === 0 && (r += 4, t >>>= 4), (t & 3) === 0 && (r += 2, t >>>= 2), (t & 1) === 0 && r++, r;\n }, BN.prototype.bitLength = function() {\n var w = this.words[this.length - 1], hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n function toBitArray(num) {\n for (var w = new @Array(num.bitLength()), bit = 0;bit < w.length; bit++) {\n var off = bit / 26 | 0, wbit = bit % 26;\n w[bit] = (num.words[off] & 1 << wbit) >>> wbit;\n }\n return w;\n }\n BN.prototype.zeroBits = function() {\n if (this.isZero())\n return 0;\n for (var r = 0, i = 0;i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n if (r += b, b !== 26)\n break;\n }\n return r;\n }, BN.prototype.byteLength = function() {\n return Math.ceil(this.bitLength() / 8);\n }, BN.prototype.toTwos = function(width) {\n return this.negative !== 0 \? this.abs().inotn(width).iaddn(1) : this.clone();\n }, BN.prototype.fromTwos = function(width) {\n return this.testn(width - 1) \? this.notn(width).iaddn(1).ineg() : this.clone();\n }, BN.prototype.isNeg = function() {\n return this.negative !== 0;\n }, BN.prototype.neg = function() {\n return this.clone().ineg();\n }, BN.prototype.ineg = function() {\n return this.isZero() || (this.negative ^= 1), this;\n }, BN.prototype.iuor = function(num) {\n for (;this.length < num.length; )\n this.words[this.length++] = 0;\n for (var i = 0;i < num.length; i++)\n this.words[i] = this.words[i] | num.words[i];\n return this.strip();\n }, BN.prototype.ior = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuor(num);\n }, BN.prototype.or = function(num) {\n return this.length > num.length \? this.clone().ior(num) : num.clone().ior(this);\n }, BN.prototype.uor = function(num) {\n return this.length > num.length \? this.clone().iuor(num) : num.clone().iuor(this);\n }, BN.prototype.iuand = function(num) {\n var b;\n this.length > num.length \? b = num : b = this;\n for (var i = 0;i < b.length; i++)\n this.words[i] = this.words[i] & num.words[i];\n return this.length = b.length, this.strip();\n }, BN.prototype.iand = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuand(num);\n }, BN.prototype.and = function(num) {\n return this.length > num.length \? this.clone().iand(num) : num.clone().iand(this);\n }, BN.prototype.uand = function(num) {\n return this.length > num.length \? this.clone().iuand(num) : num.clone().iuand(this);\n }, BN.prototype.iuxor = function(num) {\n var a, b;\n this.length > num.length \? (a = this, b = num) : (a = num, b = this);\n for (var i = 0;i < b.length; i++)\n this.words[i] = a.words[i] ^ b.words[i];\n if (this !== a)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this.length = a.length, this.strip();\n }, BN.prototype.ixor = function(num) {\n return assert((this.negative | num.negative) === 0), this.iuxor(num);\n }, BN.prototype.xor = function(num) {\n return this.length > num.length \? this.clone().ixor(num) : num.clone().ixor(this);\n }, BN.prototype.uxor = function(num) {\n return this.length > num.length \? this.clone().iuxor(num) : num.clone().iuxor(this);\n }, BN.prototype.inotn = function(width) {\n assert(typeof width == \"number\" && width >= 0);\n var bytesNeeded = Math.ceil(width / 26) | 0, bitsLeft = width % 26;\n this._expand(bytesNeeded), bitsLeft > 0 && bytesNeeded--;\n for (var i = 0;i < bytesNeeded; i++)\n this.words[i] = ~this.words[i] & 67108863;\n return bitsLeft > 0 && (this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft), this.strip();\n }, BN.prototype.notn = function(width) {\n return this.clone().inotn(width);\n }, BN.prototype.setn = function(bit, val) {\n assert(typeof bit == \"number\" && bit >= 0);\n var off = bit / 26 | 0, wbit = bit % 26;\n return this._expand(off + 1), val \? this.words[off] = this.words[off] | 1 << wbit : this.words[off] = this.words[off] & ~(1 << wbit), this.strip();\n }, BN.prototype.iadd = function(num) {\n var r;\n if (this.negative !== 0 && num.negative === 0)\n return this.negative = 0, r = this.isub(num), this.negative ^= 1, this._normSign();\n if (this.negative === 0 && num.negative !== 0)\n return num.negative = 0, r = this.isub(num), num.negative = 1, r._normSign();\n var a, b;\n this.length > num.length \? (a = this, b = num) : (a = num, b = this);\n for (var carry = 0, i = 0;i < b.length; i++)\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry, this.words[i] = r & 67108863, carry = r >>> 26;\n for (;carry !== 0 && i < a.length; i++)\n r = (a.words[i] | 0) + carry, this.words[i] = r & 67108863, carry = r >>> 26;\n if (this.length = a.length, carry !== 0)\n this.words[this.length] = carry, this.length++;\n else if (a !== this)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this;\n }, BN.prototype.add = function(num) {\n var res;\n return num.negative !== 0 && this.negative === 0 \? (num.negative = 0, res = this.sub(num), num.negative ^= 1, res) : num.negative === 0 && this.negative !== 0 \? (this.negative = 0, res = num.sub(this), this.negative = 1, res) : this.length > num.length \? this.clone().iadd(num) : num.clone().iadd(this);\n }, BN.prototype.isub = function(num) {\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n return num.negative = 1, r._normSign();\n } else if (this.negative !== 0)\n return this.negative = 0, this.iadd(num), this.negative = 1, this._normSign();\n var cmp = this.cmp(num);\n if (cmp === 0)\n return this.negative = 0, this.length = 1, this.words[0] = 0, this;\n var a, b;\n cmp > 0 \? (a = this, b = num) : (a = num, b = this);\n for (var carry = 0, i = 0;i < b.length; i++)\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry, carry = r >> 26, this.words[i] = r & 67108863;\n for (;carry !== 0 && i < a.length; i++)\n r = (a.words[i] | 0) + carry, carry = r >> 26, this.words[i] = r & 67108863;\n if (carry === 0 && i < a.length && a !== this)\n for (;i < a.length; i++)\n this.words[i] = a.words[i];\n return this.length = Math.max(this.length, i), a !== this && (this.negative = 1), this.strip();\n }, BN.prototype.sub = function(num) {\n return this.clone().isub(num);\n };\n function smallMulTo(self2, num, out) {\n out.negative = num.negative ^ self2.negative;\n var len = self2.length + num.length | 0;\n out.length = len, len = len - 1 | 0;\n var a = self2.words[0] | 0, b = num.words[0] | 0, r = a * b, lo = r & 67108863, carry = r / 67108864 | 0;\n out.words[0] = lo;\n for (var k = 1;k < len; k++) {\n for (var ncarry = carry >>> 26, rword = carry & 67108863, maxJ = Math.min(k, num.length - 1), j = Math.max(0, k - self2.length + 1);j <= maxJ; j++) {\n var i = k - j | 0;\n a = self2.words[i] | 0, b = num.words[j] | 0, r = a * b + rword, ncarry += r / 67108864 | 0, rword = r & 67108863;\n }\n out.words[k] = rword | 0, carry = ncarry | 0;\n }\n return carry !== 0 \? out.words[k] = carry | 0 : out.length--, out.strip();\n }\n var comb10MulTo = function(self2, num, out) {\n var a = self2.words, b = num.words, o = out.words, c = 0, lo, mid, hi, a0 = a[0] | 0, al0 = a0 & 8191, ah0 = a0 >>> 13, a1 = a[1] | 0, al1 = a1 & 8191, ah1 = a1 >>> 13, a2 = a[2] | 0, al2 = a2 & 8191, ah2 = a2 >>> 13, a3 = a[3] | 0, al3 = a3 & 8191, ah3 = a3 >>> 13, a4 = a[4] | 0, al4 = a4 & 8191, ah4 = a4 >>> 13, a5 = a[5] | 0, al5 = a5 & 8191, ah5 = a5 >>> 13, a6 = a[6] | 0, al6 = a6 & 8191, ah6 = a6 >>> 13, a7 = a[7] | 0, al7 = a7 & 8191, ah7 = a7 >>> 13, a8 = a[8] | 0, al8 = a8 & 8191, ah8 = a8 >>> 13, a9 = a[9] | 0, al9 = a9 & 8191, ah9 = a9 >>> 13, b0 = b[0] | 0, bl0 = b0 & 8191, bh0 = b0 >>> 13, b1 = b[1] | 0, bl1 = b1 & 8191, bh1 = b1 >>> 13, b2 = b[2] | 0, bl2 = b2 & 8191, bh2 = b2 >>> 13, b3 = b[3] | 0, bl3 = b3 & 8191, bh3 = b3 >>> 13, b4 = b[4] | 0, bl4 = b4 & 8191, bh4 = b4 >>> 13, b5 = b[5] | 0, bl5 = b5 & 8191, bh5 = b5 >>> 13, b6 = b[6] | 0, bl6 = b6 & 8191, bh6 = b6 >>> 13, b7 = b[7] | 0, bl7 = b7 & 8191, bh7 = b7 >>> 13, b8 = b[8] | 0, bl8 = b8 & 8191, bh8 = b8 >>> 13, b9 = b[9] | 0, bl9 = b9 & 8191, bh9 = b9 >>> 13;\n out.negative = self2.negative ^ num.negative, out.length = 19, lo = Math.imul(al0, bl0), mid = Math.imul(al0, bh0), mid = mid + Math.imul(ah0, bl0) | 0, hi = Math.imul(ah0, bh0);\n var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0, w0 &= 67108863, lo = Math.imul(al1, bl0), mid = Math.imul(al1, bh0), mid = mid + Math.imul(ah1, bl0) | 0, hi = Math.imul(ah1, bh0), lo = lo + Math.imul(al0, bl1) | 0, mid = mid + Math.imul(al0, bh1) | 0, mid = mid + Math.imul(ah0, bl1) | 0, hi = hi + Math.imul(ah0, bh1) | 0;\n var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0, w1 &= 67108863, lo = Math.imul(al2, bl0), mid = Math.imul(al2, bh0), mid = mid + Math.imul(ah2, bl0) | 0, hi = Math.imul(ah2, bh0), lo = lo + Math.imul(al1, bl1) | 0, mid = mid + Math.imul(al1, bh1) | 0, mid = mid + Math.imul(ah1, bl1) | 0, hi = hi + Math.imul(ah1, bh1) | 0, lo = lo + Math.imul(al0, bl2) | 0, mid = mid + Math.imul(al0, bh2) | 0, mid = mid + Math.imul(ah0, bl2) | 0, hi = hi + Math.imul(ah0, bh2) | 0;\n var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0, w2 &= 67108863, lo = Math.imul(al3, bl0), mid = Math.imul(al3, bh0), mid = mid + Math.imul(ah3, bl0) | 0, hi = Math.imul(ah3, bh0), lo = lo + Math.imul(al2, bl1) | 0, mid = mid + Math.imul(al2, bh1) | 0, mid = mid + Math.imul(ah2, bl1) | 0, hi = hi + Math.imul(ah2, bh1) | 0, lo = lo + Math.imul(al1, bl2) | 0, mid = mid + Math.imul(al1, bh2) | 0, mid = mid + Math.imul(ah1, bl2) | 0, hi = hi + Math.imul(ah1, bh2) | 0, lo = lo + Math.imul(al0, bl3) | 0, mid = mid + Math.imul(al0, bh3) | 0, mid = mid + Math.imul(ah0, bl3) | 0, hi = hi + Math.imul(ah0, bh3) | 0;\n var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0, w3 &= 67108863, lo = Math.imul(al4, bl0), mid = Math.imul(al4, bh0), mid = mid + Math.imul(ah4, bl0) | 0, hi = Math.imul(ah4, bh0), lo = lo + Math.imul(al3, bl1) | 0, mid = mid + Math.imul(al3, bh1) | 0, mid = mid + Math.imul(ah3, bl1) | 0, hi = hi + Math.imul(ah3, bh1) | 0, lo = lo + Math.imul(al2, bl2) | 0, mid = mid + Math.imul(al2, bh2) | 0, mid = mid + Math.imul(ah2, bl2) | 0, hi = hi + Math.imul(ah2, bh2) | 0, lo = lo + Math.imul(al1, bl3) | 0, mid = mid + Math.imul(al1, bh3) | 0, mid = mid + Math.imul(ah1, bl3) | 0, hi = hi + Math.imul(ah1, bh3) | 0, lo = lo + Math.imul(al0, bl4) | 0, mid = mid + Math.imul(al0, bh4) | 0, mid = mid + Math.imul(ah0, bl4) | 0, hi = hi + Math.imul(ah0, bh4) | 0;\n var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0, w4 &= 67108863, lo = Math.imul(al5, bl0), mid = Math.imul(al5, bh0), mid = mid + Math.imul(ah5, bl0) | 0, hi = Math.imul(ah5, bh0), lo = lo + Math.imul(al4, bl1) | 0, mid = mid + Math.imul(al4, bh1) | 0, mid = mid + Math.imul(ah4, bl1) | 0, hi = hi + Math.imul(ah4, bh1) | 0, lo = lo + Math.imul(al3, bl2) | 0, mid = mid + Math.imul(al3, bh2) | 0, mid = mid + Math.imul(ah3, bl2) | 0, hi = hi + Math.imul(ah3, bh2) | 0, lo = lo + Math.imul(al2, bl3) | 0, mid = mid + Math.imul(al2, bh3) | 0, mid = mid + Math.imul(ah2, bl3) | 0, hi = hi + Math.imul(ah2, bh3) | 0, lo = lo + Math.imul(al1, bl4) | 0, mid = mid + Math.imul(al1, bh4) | 0, mid = mid + Math.imul(ah1, bl4) | 0, hi = hi + Math.imul(ah1, bh4) | 0, lo = lo + Math.imul(al0, bl5) | 0, mid = mid + Math.imul(al0, bh5) | 0, mid = mid + Math.imul(ah0, bl5) | 0, hi = hi + Math.imul(ah0, bh5) | 0;\n var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0, w5 &= 67108863, lo = Math.imul(al6, bl0), mid = Math.imul(al6, bh0), mid = mid + Math.imul(ah6, bl0) | 0, hi = Math.imul(ah6, bh0), lo = lo + Math.imul(al5, bl1) | 0, mid = mid + Math.imul(al5, bh1) | 0, mid = mid + Math.imul(ah5, bl1) | 0, hi = hi + Math.imul(ah5, bh1) | 0, lo = lo + Math.imul(al4, bl2) | 0, mid = mid + Math.imul(al4, bh2) | 0, mid = mid + Math.imul(ah4, bl2) | 0, hi = hi + Math.imul(ah4, bh2) | 0, lo = lo + Math.imul(al3, bl3) | 0, mid = mid + Math.imul(al3, bh3) | 0, mid = mid + Math.imul(ah3, bl3) | 0, hi = hi + Math.imul(ah3, bh3) | 0, lo = lo + Math.imul(al2, bl4) | 0, mid = mid + Math.imul(al2, bh4) | 0, mid = mid + Math.imul(ah2, bl4) | 0, hi = hi + Math.imul(ah2, bh4) | 0, lo = lo + Math.imul(al1, bl5) | 0, mid = mid + Math.imul(al1, bh5) | 0, mid = mid + Math.imul(ah1, bl5) | 0, hi = hi + Math.imul(ah1, bh5) | 0, lo = lo + Math.imul(al0, bl6) | 0, mid = mid + Math.imul(al0, bh6) | 0, mid = mid + Math.imul(ah0, bl6) | 0, hi = hi + Math.imul(ah0, bh6) | 0;\n var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0, w6 &= 67108863, lo = Math.imul(al7, bl0), mid = Math.imul(al7, bh0), mid = mid + Math.imul(ah7, bl0) | 0, hi = Math.imul(ah7, bh0), lo = lo + Math.imul(al6, bl1) | 0, mid = mid + Math.imul(al6, bh1) | 0, mid = mid + Math.imul(ah6, bl1) | 0, hi = hi + Math.imul(ah6, bh1) | 0, lo = lo + Math.imul(al5, bl2) | 0, mid = mid + Math.imul(al5, bh2) | 0, mid = mid + Math.imul(ah5, bl2) | 0, hi = hi + Math.imul(ah5, bh2) | 0, lo = lo + Math.imul(al4, bl3) | 0, mid = mid + Math.imul(al4, bh3) | 0, mid = mid + Math.imul(ah4, bl3) | 0, hi = hi + Math.imul(ah4, bh3) | 0, lo = lo + Math.imul(al3, bl4) | 0, mid = mid + Math.imul(al3, bh4) | 0, mid = mid + Math.imul(ah3, bl4) | 0, hi = hi + Math.imul(ah3, bh4) | 0, lo = lo + Math.imul(al2, bl5) | 0, mid = mid + Math.imul(al2, bh5) | 0, mid = mid + Math.imul(ah2, bl5) | 0, hi = hi + Math.imul(ah2, bh5) | 0, lo = lo + Math.imul(al1, bl6) | 0, mid = mid + Math.imul(al1, bh6) | 0, mid = mid + Math.imul(ah1, bl6) | 0, hi = hi + Math.imul(ah1, bh6) | 0, lo = lo + Math.imul(al0, bl7) | 0, mid = mid + Math.imul(al0, bh7) | 0, mid = mid + Math.imul(ah0, bl7) | 0, hi = hi + Math.imul(ah0, bh7) | 0;\n var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0, w7 &= 67108863, lo = Math.imul(al8, bl0), mid = Math.imul(al8, bh0), mid = mid + Math.imul(ah8, bl0) | 0, hi = Math.imul(ah8, bh0), lo = lo + Math.imul(al7, bl1) | 0, mid = mid + Math.imul(al7, bh1) | 0, mid = mid + Math.imul(ah7, bl1) | 0, hi = hi + Math.imul(ah7, bh1) | 0, lo = lo + Math.imul(al6, bl2) | 0, mid = mid + Math.imul(al6, bh2) | 0, mid = mid + Math.imul(ah6, bl2) | 0, hi = hi + Math.imul(ah6, bh2) | 0, lo = lo + Math.imul(al5, bl3) | 0, mid = mid + Math.imul(al5, bh3) | 0, mid = mid + Math.imul(ah5, bl3) | 0, hi = hi + Math.imul(ah5, bh3) | 0, lo = lo + Math.imul(al4, bl4) | 0, mid = mid + Math.imul(al4, bh4) | 0, mid = mid + Math.imul(ah4, bl4) | 0, hi = hi + Math.imul(ah4, bh4) | 0, lo = lo + Math.imul(al3, bl5) | 0, mid = mid + Math.imul(al3, bh5) | 0, mid = mid + Math.imul(ah3, bl5) | 0, hi = hi + Math.imul(ah3, bh5) | 0, lo = lo + Math.imul(al2, bl6) | 0, mid = mid + Math.imul(al2, bh6) | 0, mid = mid + Math.imul(ah2, bl6) | 0, hi = hi + Math.imul(ah2, bh6) | 0, lo = lo + Math.imul(al1, bl7) | 0, mid = mid + Math.imul(al1, bh7) | 0, mid = mid + Math.imul(ah1, bl7) | 0, hi = hi + Math.imul(ah1, bh7) | 0, lo = lo + Math.imul(al0, bl8) | 0, mid = mid + Math.imul(al0, bh8) | 0, mid = mid + Math.imul(ah0, bl8) | 0, hi = hi + Math.imul(ah0, bh8) | 0;\n var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0, w8 &= 67108863, lo = Math.imul(al9, bl0), mid = Math.imul(al9, bh0), mid = mid + Math.imul(ah9, bl0) | 0, hi = Math.imul(ah9, bh0), lo = lo + Math.imul(al8, bl1) | 0, mid = mid + Math.imul(al8, bh1) | 0, mid = mid + Math.imul(ah8, bl1) | 0, hi = hi + Math.imul(ah8, bh1) | 0, lo = lo + Math.imul(al7, bl2) | 0, mid = mid + Math.imul(al7, bh2) | 0, mid = mid + Math.imul(ah7, bl2) | 0, hi = hi + Math.imul(ah7, bh2) | 0, lo = lo + Math.imul(al6, bl3) | 0, mid = mid + Math.imul(al6, bh3) | 0, mid = mid + Math.imul(ah6, bl3) | 0, hi = hi + Math.imul(ah6, bh3) | 0, lo = lo + Math.imul(al5, bl4) | 0, mid = mid + Math.imul(al5, bh4) | 0, mid = mid + Math.imul(ah5, bl4) | 0, hi = hi + Math.imul(ah5, bh4) | 0, lo = lo + Math.imul(al4, bl5) | 0, mid = mid + Math.imul(al4, bh5) | 0, mid = mid + Math.imul(ah4, bl5) | 0, hi = hi + Math.imul(ah4, bh5) | 0, lo = lo + Math.imul(al3, bl6) | 0, mid = mid + Math.imul(al3, bh6) | 0, mid = mid + Math.imul(ah3, bl6) | 0, hi = hi + Math.imul(ah3, bh6) | 0, lo = lo + Math.imul(al2, bl7) | 0, mid = mid + Math.imul(al2, bh7) | 0, mid = mid + Math.imul(ah2, bl7) | 0, hi = hi + Math.imul(ah2, bh7) | 0, lo = lo + Math.imul(al1, bl8) | 0, mid = mid + Math.imul(al1, bh8) | 0, mid = mid + Math.imul(ah1, bl8) | 0, hi = hi + Math.imul(ah1, bh8) | 0, lo = lo + Math.imul(al0, bl9) | 0, mid = mid + Math.imul(al0, bh9) | 0, mid = mid + Math.imul(ah0, bl9) | 0, hi = hi + Math.imul(ah0, bh9) | 0;\n var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0, w9 &= 67108863, lo = Math.imul(al9, bl1), mid = Math.imul(al9, bh1), mid = mid + Math.imul(ah9, bl1) | 0, hi = Math.imul(ah9, bh1), lo = lo + Math.imul(al8, bl2) | 0, mid = mid + Math.imul(al8, bh2) | 0, mid = mid + Math.imul(ah8, bl2) | 0, hi = hi + Math.imul(ah8, bh2) | 0, lo = lo + Math.imul(al7, bl3) | 0, mid = mid + Math.imul(al7, bh3) | 0, mid = mid + Math.imul(ah7, bl3) | 0, hi = hi + Math.imul(ah7, bh3) | 0, lo = lo + Math.imul(al6, bl4) | 0, mid = mid + Math.imul(al6, bh4) | 0, mid = mid + Math.imul(ah6, bl4) | 0, hi = hi + Math.imul(ah6, bh4) | 0, lo = lo + Math.imul(al5, bl5) | 0, mid = mid + Math.imul(al5, bh5) | 0, mid = mid + Math.imul(ah5, bl5) | 0, hi = hi + Math.imul(ah5, bh5) | 0, lo = lo + Math.imul(al4, bl6) | 0, mid = mid + Math.imul(al4, bh6) | 0, mid = mid + Math.imul(ah4, bl6) | 0, hi = hi + Math.imul(ah4, bh6) | 0, lo = lo + Math.imul(al3, bl7) | 0, mid = mid + Math.imul(al3, bh7) | 0, mid = mid + Math.imul(ah3, bl7) | 0, hi = hi + Math.imul(ah3, bh7) | 0, lo = lo + Math.imul(al2, bl8) | 0, mid = mid + Math.imul(al2, bh8) | 0, mid = mid + Math.imul(ah2, bl8) | 0, hi = hi + Math.imul(ah2, bh8) | 0, lo = lo + Math.imul(al1, bl9) | 0, mid = mid + Math.imul(al1, bh9) | 0, mid = mid + Math.imul(ah1, bl9) | 0, hi = hi + Math.imul(ah1, bh9) | 0;\n var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0, w10 &= 67108863, lo = Math.imul(al9, bl2), mid = Math.imul(al9, bh2), mid = mid + Math.imul(ah9, bl2) | 0, hi = Math.imul(ah9, bh2), lo = lo + Math.imul(al8, bl3) | 0, mid = mid + Math.imul(al8, bh3) | 0, mid = mid + Math.imul(ah8, bl3) | 0, hi = hi + Math.imul(ah8, bh3) | 0, lo = lo + Math.imul(al7, bl4) | 0, mid = mid + Math.imul(al7, bh4) | 0, mid = mid + Math.imul(ah7, bl4) | 0, hi = hi + Math.imul(ah7, bh4) | 0, lo = lo + Math.imul(al6, bl5) | 0, mid = mid + Math.imul(al6, bh5) | 0, mid = mid + Math.imul(ah6, bl5) | 0, hi = hi + Math.imul(ah6, bh5) | 0, lo = lo + Math.imul(al5, bl6) | 0, mid = mid + Math.imul(al5, bh6) | 0, mid = mid + Math.imul(ah5, bl6) | 0, hi = hi + Math.imul(ah5, bh6) | 0, lo = lo + Math.imul(al4, bl7) | 0, mid = mid + Math.imul(al4, bh7) | 0, mid = mid + Math.imul(ah4, bl7) | 0, hi = hi + Math.imul(ah4, bh7) | 0, lo = lo + Math.imul(al3, bl8) | 0, mid = mid + Math.imul(al3, bh8) | 0, mid = mid + Math.imul(ah3, bl8) | 0, hi = hi + Math.imul(ah3, bh8) | 0, lo = lo + Math.imul(al2, bl9) | 0, mid = mid + Math.imul(al2, bh9) | 0, mid = mid + Math.imul(ah2, bl9) | 0, hi = hi + Math.imul(ah2, bh9) | 0;\n var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0, w11 &= 67108863, lo = Math.imul(al9, bl3), mid = Math.imul(al9, bh3), mid = mid + Math.imul(ah9, bl3) | 0, hi = Math.imul(ah9, bh3), lo = lo + Math.imul(al8, bl4) | 0, mid = mid + Math.imul(al8, bh4) | 0, mid = mid + Math.imul(ah8, bl4) | 0, hi = hi + Math.imul(ah8, bh4) | 0, lo = lo + Math.imul(al7, bl5) | 0, mid = mid + Math.imul(al7, bh5) | 0, mid = mid + Math.imul(ah7, bl5) | 0, hi = hi + Math.imul(ah7, bh5) | 0, lo = lo + Math.imul(al6, bl6) | 0, mid = mid + Math.imul(al6, bh6) | 0, mid = mid + Math.imul(ah6, bl6) | 0, hi = hi + Math.imul(ah6, bh6) | 0, lo = lo + Math.imul(al5, bl7) | 0, mid = mid + Math.imul(al5, bh7) | 0, mid = mid + Math.imul(ah5, bl7) | 0, hi = hi + Math.imul(ah5, bh7) | 0, lo = lo + Math.imul(al4, bl8) | 0, mid = mid + Math.imul(al4, bh8) | 0, mid = mid + Math.imul(ah4, bl8) | 0, hi = hi + Math.imul(ah4, bh8) | 0, lo = lo + Math.imul(al3, bl9) | 0, mid = mid + Math.imul(al3, bh9) | 0, mid = mid + Math.imul(ah3, bl9) | 0, hi = hi + Math.imul(ah3, bh9) | 0;\n var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0, w12 &= 67108863, lo = Math.imul(al9, bl4), mid = Math.imul(al9, bh4), mid = mid + Math.imul(ah9, bl4) | 0, hi = Math.imul(ah9, bh4), lo = lo + Math.imul(al8, bl5) | 0, mid = mid + Math.imul(al8, bh5) | 0, mid = mid + Math.imul(ah8, bl5) | 0, hi = hi + Math.imul(ah8, bh5) | 0, lo = lo + Math.imul(al7, bl6) | 0, mid = mid + Math.imul(al7, bh6) | 0, mid = mid + Math.imul(ah7, bl6) | 0, hi = hi + Math.imul(ah7, bh6) | 0, lo = lo + Math.imul(al6, bl7) | 0, mid = mid + Math.imul(al6, bh7) | 0, mid = mid + Math.imul(ah6, bl7) | 0, hi = hi + Math.imul(ah6, bh7) | 0, lo = lo + Math.imul(al5, bl8) | 0, mid = mid + Math.imul(al5, bh8) | 0, mid = mid + Math.imul(ah5, bl8) | 0, hi = hi + Math.imul(ah5, bh8) | 0, lo = lo + Math.imul(al4, bl9) | 0, mid = mid + Math.imul(al4, bh9) | 0, mid = mid + Math.imul(ah4, bl9) | 0, hi = hi + Math.imul(ah4, bh9) | 0;\n var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0, w13 &= 67108863, lo = Math.imul(al9, bl5), mid = Math.imul(al9, bh5), mid = mid + Math.imul(ah9, bl5) | 0, hi = Math.imul(ah9, bh5), lo = lo + Math.imul(al8, bl6) | 0, mid = mid + Math.imul(al8, bh6) | 0, mid = mid + Math.imul(ah8, bl6) | 0, hi = hi + Math.imul(ah8, bh6) | 0, lo = lo + Math.imul(al7, bl7) | 0, mid = mid + Math.imul(al7, bh7) | 0, mid = mid + Math.imul(ah7, bl7) | 0, hi = hi + Math.imul(ah7, bh7) | 0, lo = lo + Math.imul(al6, bl8) | 0, mid = mid + Math.imul(al6, bh8) | 0, mid = mid + Math.imul(ah6, bl8) | 0, hi = hi + Math.imul(ah6, bh8) | 0, lo = lo + Math.imul(al5, bl9) | 0, mid = mid + Math.imul(al5, bh9) | 0, mid = mid + Math.imul(ah5, bl9) | 0, hi = hi + Math.imul(ah5, bh9) | 0;\n var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0, w14 &= 67108863, lo = Math.imul(al9, bl6), mid = Math.imul(al9, bh6), mid = mid + Math.imul(ah9, bl6) | 0, hi = Math.imul(ah9, bh6), lo = lo + Math.imul(al8, bl7) | 0, mid = mid + Math.imul(al8, bh7) | 0, mid = mid + Math.imul(ah8, bl7) | 0, hi = hi + Math.imul(ah8, bh7) | 0, lo = lo + Math.imul(al7, bl8) | 0, mid = mid + Math.imul(al7, bh8) | 0, mid = mid + Math.imul(ah7, bl8) | 0, hi = hi + Math.imul(ah7, bh8) | 0, lo = lo + Math.imul(al6, bl9) | 0, mid = mid + Math.imul(al6, bh9) | 0, mid = mid + Math.imul(ah6, bl9) | 0, hi = hi + Math.imul(ah6, bh9) | 0;\n var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0, w15 &= 67108863, lo = Math.imul(al9, bl7), mid = Math.imul(al9, bh7), mid = mid + Math.imul(ah9, bl7) | 0, hi = Math.imul(ah9, bh7), lo = lo + Math.imul(al8, bl8) | 0, mid = mid + Math.imul(al8, bh8) | 0, mid = mid + Math.imul(ah8, bl8) | 0, hi = hi + Math.imul(ah8, bh8) | 0, lo = lo + Math.imul(al7, bl9) | 0, mid = mid + Math.imul(al7, bh9) | 0, mid = mid + Math.imul(ah7, bl9) | 0, hi = hi + Math.imul(ah7, bh9) | 0;\n var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0, w16 &= 67108863, lo = Math.imul(al9, bl8), mid = Math.imul(al9, bh8), mid = mid + Math.imul(ah9, bl8) | 0, hi = Math.imul(ah9, bh8), lo = lo + Math.imul(al8, bl9) | 0, mid = mid + Math.imul(al8, bh9) | 0, mid = mid + Math.imul(ah8, bl9) | 0, hi = hi + Math.imul(ah8, bh9) | 0;\n var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0, w17 &= 67108863, lo = Math.imul(al9, bl9), mid = Math.imul(al9, bh9), mid = mid + Math.imul(ah9, bl9) | 0, hi = Math.imul(ah9, bh9);\n var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;\n return c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0, w18 &= 67108863, o[0] = w0, o[1] = w1, o[2] = w2, o[3] = w3, o[4] = w4, o[5] = w5, o[6] = w6, o[7] = w7, o[8] = w8, o[9] = w9, o[10] = w10, o[11] = w11, o[12] = w12, o[13] = w13, o[14] = w14, o[15] = w15, o[16] = w16, o[17] = w17, o[18] = w18, c !== 0 && (o[19] = c, out.length++), out;\n };\n Math.imul || (comb10MulTo = smallMulTo);\n function bigMulTo(self2, num, out) {\n out.negative = num.negative ^ self2.negative, out.length = self2.length + num.length;\n for (var carry = 0, hncarry = 0, k = 0;k < out.length - 1; k++) {\n var ncarry = hncarry;\n hncarry = 0;\n for (var rword = carry & 67108863, maxJ = Math.min(k, num.length - 1), j = Math.max(0, k - self2.length + 1);j <= maxJ; j++) {\n var i = k - j, a = self2.words[i] | 0, b = num.words[j] | 0, r = a * b, lo = r & 67108863;\n ncarry = ncarry + (r / 67108864 | 0) | 0, lo = lo + rword | 0, rword = lo & 67108863, ncarry = ncarry + (lo >>> 26) | 0, hncarry += ncarry >>> 26, ncarry &= 67108863;\n }\n out.words[k] = rword, carry = ncarry, ncarry = hncarry;\n }\n return carry !== 0 \? out.words[k] = carry : out.length--, out.strip();\n }\n function jumboMulTo(self2, num, out) {\n var fftm = new FFTM;\n return fftm.mulp(self2, num, out);\n }\n BN.prototype.mulTo = function(num, out) {\n var res, len = this.length + num.length;\n return this.length === 10 && num.length === 10 \? res = comb10MulTo(this, num, out) : len < 63 \? res = smallMulTo(this, num, out) : len < 1024 \? res = bigMulTo(this, num, out) : res = jumboMulTo(this, num, out), res;\n };\n function FFTM(x, y) {\n this.x = x, this.y = y;\n }\n FFTM.prototype = {}, FFTM.prototype.makeRBT = function(N) {\n for (var t = new @Array(N), l = BN.prototype._countBits(N) - 1, i = 0;i < N; i++)\n t[i] = this.revBin(i, l, N);\n return t;\n }, FFTM.prototype.revBin = function(x, l, N) {\n if (x === 0 || x === N - 1)\n return x;\n for (var rb = 0, i = 0;i < l; i++)\n rb |= (x & 1) << l - i - 1, x >>= 1;\n return rb;\n }, FFTM.prototype.permute = function(rbt, rws, iws, rtws, itws, N) {\n for (var i = 0;i < N; i++)\n rtws[i] = rws[rbt[i]], itws[i] = iws[rbt[i]];\n }, FFTM.prototype.transform = function(rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n for (var s = 1;s < N; s <<= 1)\n for (var l = s << 1, rtwdf = Math.cos(2 * Math.PI / l), itwdf = Math.sin(2 * Math.PI / l), p = 0;p < N; p += l)\n for (var rtwdf_ = rtwdf, itwdf_ = itwdf, j = 0;j < s; j++) {\n var re = rtws[p + j], ie = itws[p + j], ro = rtws[p + j + s], io = itws[p + j + s], rx = rtwdf_ * ro - itwdf_ * io;\n io = rtwdf_ * io + itwdf_ * ro, ro = rx, rtws[p + j] = re + ro, itws[p + j] = ie + io, rtws[p + j + s] = re - ro, itws[p + j + s] = ie - io, j !== l && (rx = rtwdf * rtwdf_ - itwdf * itwdf_, itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_, rtwdf_ = rx);\n }\n }, FFTM.prototype.guessLen13b = function(n, m) {\n var N = Math.max(m, n) | 1, odd = N & 1, i = 0;\n for (N = N / 2 | 0;N; N = N >>> 1)\n i++;\n return 1 << i + 1 + odd;\n }, FFTM.prototype.conjugate = function(rws, iws, N) {\n if (!(N <= 1))\n for (var i = 0;i < N / 2; i++) {\n var t = rws[i];\n rws[i] = rws[N - i - 1], rws[N - i - 1] = t, t = iws[i], iws[i] = -iws[N - i - 1], iws[N - i - 1] = -t;\n }\n }, FFTM.prototype.normalize13b = function(ws, N) {\n for (var carry = 0, i = 0;i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;\n ws[i] = w & 67108863, w < 67108864 \? carry = 0 : carry = w / 67108864 | 0;\n }\n return ws;\n }, FFTM.prototype.convert13b = function(ws, len, rws, N) {\n for (var carry = 0, i = 0;i < len; i++)\n carry = carry + (ws[i] | 0), rws[2 * i] = carry & 8191, carry = carry >>> 13, rws[2 * i + 1] = carry & 8191, carry = carry >>> 13;\n for (i = 2 * len;i < N; ++i)\n rws[i] = 0;\n assert(carry === 0), assert((carry & -8192) === 0);\n }, FFTM.prototype.stub = function(N) {\n for (var ph = new @Array(N), i = 0;i < N; i++)\n ph[i] = 0;\n return ph;\n }, FFTM.prototype.mulp = function(x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length), rbt = this.makeRBT(N), _ = this.stub(N), rws = new @Array(N), rwst = new @Array(N), iwst = new @Array(N), nrws = new @Array(N), nrwst = new @Array(N), niwst = new @Array(N), rmws = out.words;\n rmws.length = N, this.convert13b(x.words, x.length, rws, N), this.convert13b(y.words, y.length, nrws, N), this.transform(rws, _, rwst, iwst, N, rbt), this.transform(nrws, _, nrwst, niwst, N, rbt);\n for (var i = 0;i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i], rwst[i] = rx;\n }\n return this.conjugate(rwst, iwst, N), this.transform(rwst, iwst, rmws, _, N, rbt), this.conjugate(rmws, _, N), this.normalize13b(rmws, N), out.negative = x.negative ^ y.negative, out.length = x.length + y.length, out.strip();\n }, BN.prototype.mul = function(num) {\n var out = new BN(null);\n return out.words = new @Array(this.length + num.length), this.mulTo(num, out);\n }, BN.prototype.mulf = function(num) {\n var out = new BN(null);\n return out.words = new @Array(this.length + num.length), jumboMulTo(this, num, out);\n }, BN.prototype.imul = function(num) {\n return this.clone().mulTo(num, this);\n }, BN.prototype.imuln = function(num) {\n assert(typeof num == \"number\"), assert(num < 67108864);\n for (var carry = 0, i = 0;i < this.length; i++) {\n var w = (this.words[i] | 0) * num, lo = (w & 67108863) + (carry & 67108863);\n carry >>= 26, carry += w / 67108864 | 0, carry += lo >>> 26, this.words[i] = lo & 67108863;\n }\n return carry !== 0 && (this.words[i] = carry, this.length++), this;\n }, BN.prototype.muln = function(num) {\n return this.clone().imuln(num);\n }, BN.prototype.sqr = function() {\n return this.mul(this);\n }, BN.prototype.isqr = function() {\n return this.imul(this.clone());\n }, BN.prototype.pow = function(num) {\n var w = toBitArray(num);\n if (w.length === 0)\n return new BN(1);\n for (var res = this, i = 0;i < w.length && w[i] === 0; i++, res = res.sqr())\n ;\n if (++i < w.length)\n for (var q = res.sqr();i < w.length; i++, q = q.sqr())\n w[i] !== 0 && (res = res.mul(q));\n return res;\n }, BN.prototype.iushln = function(bits) {\n assert(typeof bits == \"number\" && bits >= 0);\n var r = bits % 26, s = (bits - r) / 26, carryMask = 67108863 >>> 26 - r << 26 - r, i;\n if (r !== 0) {\n var carry = 0;\n for (i = 0;i < this.length; i++) {\n var newCarry = this.words[i] & carryMask, c = (this.words[i] | 0) - newCarry << r;\n this.words[i] = c | carry, carry = newCarry >>> 26 - r;\n }\n carry && (this.words[i] = carry, this.length++);\n }\n if (s !== 0) {\n for (i = this.length - 1;i >= 0; i--)\n this.words[i + s] = this.words[i];\n for (i = 0;i < s; i++)\n this.words[i] = 0;\n this.length += s;\n }\n return this.strip();\n }, BN.prototype.ishln = function(bits) {\n return assert(this.negative === 0), this.iushln(bits);\n }, BN.prototype.iushrn = function(bits, hint, extended) {\n assert(typeof bits == \"number\" && bits >= 0);\n var h;\n hint \? h = (hint - hint % 26) / 26 : h = 0;\n var r = bits % 26, s = Math.min((bits - r) / 26, this.length), mask = 67108863 ^ 67108863 >>> r << r, maskedWords = extended;\n if (h -= s, h = Math.max(0, h), maskedWords) {\n for (var i = 0;i < s; i++)\n maskedWords.words[i] = this.words[i];\n maskedWords.length = s;\n }\n if (s !== 0)\n if (this.length > s)\n for (this.length -= s, i = 0;i < this.length; i++)\n this.words[i] = this.words[i + s];\n else\n this.words[0] = 0, this.length = 1;\n var carry = 0;\n for (i = this.length - 1;i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = carry << 26 - r | word >>> r, carry = word & mask;\n }\n return maskedWords && carry !== 0 && (maskedWords.words[maskedWords.length++] = carry), this.length === 0 && (this.words[0] = 0, this.length = 1), this.strip();\n }, BN.prototype.ishrn = function(bits, hint, extended) {\n return assert(this.negative === 0), this.iushrn(bits, hint, extended);\n }, BN.prototype.shln = function(bits) {\n return this.clone().ishln(bits);\n }, BN.prototype.ushln = function(bits) {\n return this.clone().iushln(bits);\n }, BN.prototype.shrn = function(bits) {\n return this.clone().ishrn(bits);\n }, BN.prototype.ushrn = function(bits) {\n return this.clone().iushrn(bits);\n }, BN.prototype.testn = function(bit) {\n assert(typeof bit == \"number\" && bit >= 0);\n var r = bit % 26, s = (bit - r) / 26, q = 1 << r;\n if (this.length <= s)\n return !1;\n var w = this.words[s];\n return !!(w & q);\n }, BN.prototype.imaskn = function(bits) {\n assert(typeof bits == \"number\" && bits >= 0);\n var r = bits % 26, s = (bits - r) / 26;\n if (assert(this.negative === 0, \"imaskn works only with positive numbers\"), this.length <= s)\n return this;\n if (r !== 0 && s++, this.length = Math.min(s, this.length), r !== 0) {\n var mask = 67108863 ^ 67108863 >>> r << r;\n this.words[this.length - 1] &= mask;\n }\n return this.strip();\n }, BN.prototype.maskn = function(bits) {\n return this.clone().imaskn(bits);\n }, BN.prototype.iaddn = function(num) {\n return assert(typeof num == \"number\"), assert(num < 67108864), num < 0 \? this.isubn(-num) : this.negative !== 0 \? this.length === 1 && (this.words[0] | 0) < num \? (this.words[0] = num - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(num), this.negative = 1, this) : this._iaddn(num);\n }, BN.prototype._iaddn = function(num) {\n this.words[0] += num;\n for (var i = 0;i < this.length && this.words[i] >= 67108864; i++)\n this.words[i] -= 67108864, i === this.length - 1 \? this.words[i + 1] = 1 : this.words[i + 1]++;\n return this.length = Math.max(this.length, i + 1), this;\n }, BN.prototype.isubn = function(num) {\n if (assert(typeof num == \"number\"), assert(num < 67108864), num < 0)\n return this.iaddn(-num);\n if (this.negative !== 0)\n return this.negative = 0, this.iaddn(num), this.negative = 1, this;\n if (this.words[0] -= num, this.length === 1 && this.words[0] < 0)\n this.words[0] = -this.words[0], this.negative = 1;\n else\n for (var i = 0;i < this.length && this.words[i] < 0; i++)\n this.words[i] += 67108864, this.words[i + 1] -= 1;\n return this.strip();\n }, BN.prototype.addn = function(num) {\n return this.clone().iaddn(num);\n }, BN.prototype.subn = function(num) {\n return this.clone().isubn(num);\n }, BN.prototype.iabs = function() {\n return this.negative = 0, this;\n }, BN.prototype.abs = function() {\n return this.clone().iabs();\n }, BN.prototype._ishlnsubmul = function(num, mul, shift) {\n var len = num.length + shift, i;\n this._expand(len);\n var w, carry = 0;\n for (i = 0;i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 67108863, carry = (w >> 26) - (right / 67108864 | 0), this.words[i + shift] = w & 67108863;\n }\n for (;i < this.length - shift; i++)\n w = (this.words[i + shift] | 0) + carry, carry = w >> 26, this.words[i + shift] = w & 67108863;\n if (carry === 0)\n return this.strip();\n for (assert(carry === -1), carry = 0, i = 0;i < this.length; i++)\n w = -(this.words[i] | 0) + carry, carry = w >> 26, this.words[i] = w & 67108863;\n return this.negative = 1, this.strip();\n }, BN.prototype._wordDiv = function(num, mode) {\n var shift = this.length - num.length, a = this.clone(), b = num, bhi = b.words[b.length - 1] | 0, bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits, shift !== 0 && (b = b.ushln(shift), a.iushln(shift), bhi = b.words[b.length - 1] | 0);\n var m = a.length - b.length, q;\n if (mode !== \"mod\") {\n q = new BN(null), q.length = m + 1, q.words = new @Array(q.length);\n for (var i = 0;i < q.length; i++)\n q.words[i] = 0;\n }\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n diff.negative === 0 && (a = diff, q && (q.words[m] = 1));\n for (var j = m - 1;j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);\n for (qj = Math.min(qj / bhi | 0, 67108863), a._ishlnsubmul(b, qj, j);a.negative !== 0; )\n qj--, a.negative = 0, a._ishlnsubmul(b, 1, j), a.isZero() || (a.negative ^= 1);\n q && (q.words[j] = qj);\n }\n return q && q.strip(), a.strip(), mode !== \"div\" && shift !== 0 && a.iushrn(shift), {\n div: q || null,\n mod: a\n };\n }, BN.prototype.divmod = function(num, mode, positive) {\n if (assert(!num.isZero()), this.isZero())\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n var div, mod, res;\n return this.negative !== 0 && num.negative === 0 \? (res = this.neg().divmod(num, mode), mode !== \"mod\" && (div = res.div.neg()), mode !== \"div\" && (mod = res.mod.neg(), positive && mod.negative !== 0 && mod.iadd(num)), {\n div,\n mod\n }) : this.negative === 0 && num.negative !== 0 \? (res = this.divmod(num.neg(), mode), mode !== \"mod\" && (div = res.div.neg()), {\n div,\n mod: res.mod\n }) : (this.negative & num.negative) !== 0 \? (res = this.neg().divmod(num.neg(), mode), mode !== \"div\" && (mod = res.mod.neg(), positive && mod.negative !== 0 && mod.isub(num)), {\n div: res.div,\n mod\n }) : num.length > this.length || this.cmp(num) < 0 \? {\n div: new BN(0),\n mod: this\n } : num.length === 1 \? mode === \"div\" \? {\n div: this.divn(num.words[0]),\n mod: null\n } : mode === \"mod\" \? {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n } : {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n } : this._wordDiv(num, mode);\n }, BN.prototype.div = function(num) {\n return this.divmod(num, \"div\", !1).div;\n }, BN.prototype.mod = function(num) {\n return this.divmod(num, \"mod\", !1).mod;\n }, BN.prototype.umod = function(num) {\n return this.divmod(num, \"mod\", !0).mod;\n }, BN.prototype.divRound = function(num) {\n var dm = this.divmod(num);\n if (dm.mod.isZero())\n return dm.div;\n var mod = dm.div.negative !== 0 \? dm.mod.isub(num) : dm.mod, half = num.ushrn(1), r2 = num.andln(1), cmp = mod.cmp(half);\n return cmp < 0 || r2 === 1 && cmp === 0 \? dm.div : dm.div.negative !== 0 \? dm.div.isubn(1) : dm.div.iaddn(1);\n }, BN.prototype.modn = function(num) {\n assert(num <= 67108863);\n for (var p = (1 << 26) % num, acc = 0, i = this.length - 1;i >= 0; i--)\n acc = (p * acc + (this.words[i] | 0)) % num;\n return acc;\n }, BN.prototype.idivn = function(num) {\n assert(num <= 67108863);\n for (var carry = 0, i = this.length - 1;i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 67108864;\n this.words[i] = w / num | 0, carry = w % num;\n }\n return this.strip();\n }, BN.prototype.divn = function(num) {\n return this.clone().idivn(num);\n }, BN.prototype.egcd = function(p) {\n assert(p.negative === 0), assert(!p.isZero());\n var x = this, y = p.clone();\n x.negative !== 0 \? x = x.umod(p) : x = x.clone();\n for (var A = new BN(1), B = new BN(0), C = new BN(0), D = new BN(1), g = 0;x.isEven() && y.isEven(); )\n x.iushrn(1), y.iushrn(1), ++g;\n for (var yp = y.clone(), xp = x.clone();!x.isZero(); ) {\n for (var i = 0, im = 1;(x.words[0] & im) === 0 && i < 26; ++i, im <<= 1)\n ;\n if (i > 0)\n for (x.iushrn(i);i-- > 0; )\n (A.isOdd() || B.isOdd()) && (A.iadd(yp), B.isub(xp)), A.iushrn(1), B.iushrn(1);\n for (var j = 0, jm = 1;(y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1)\n ;\n if (j > 0)\n for (y.iushrn(j);j-- > 0; )\n (C.isOdd() || D.isOdd()) && (C.iadd(yp), D.isub(xp)), C.iushrn(1), D.iushrn(1);\n x.cmp(y) >= 0 \? (x.isub(y), A.isub(C), B.isub(D)) : (y.isub(x), C.isub(A), D.isub(B));\n }\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n }, BN.prototype._invmp = function(p) {\n assert(p.negative === 0), assert(!p.isZero());\n var a = this, b = p.clone();\n a.negative !== 0 \? a = a.umod(p) : a = a.clone();\n for (var x1 = new BN(1), x2 = new BN(0), delta = b.clone();a.cmpn(1) > 0 && b.cmpn(1) > 0; ) {\n for (var i = 0, im = 1;(a.words[0] & im) === 0 && i < 26; ++i, im <<= 1)\n ;\n if (i > 0)\n for (a.iushrn(i);i-- > 0; )\n x1.isOdd() && x1.iadd(delta), x1.iushrn(1);\n for (var j = 0, jm = 1;(b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1)\n ;\n if (j > 0)\n for (b.iushrn(j);j-- > 0; )\n x2.isOdd() && x2.iadd(delta), x2.iushrn(1);\n a.cmp(b) >= 0 \? (a.isub(b), x1.isub(x2)) : (b.isub(a), x2.isub(x1));\n }\n var res;\n return a.cmpn(1) === 0 \? res = x1 : res = x2, res.cmpn(0) < 0 && res.iadd(p), res;\n }, BN.prototype.gcd = function(num) {\n if (this.isZero())\n return num.abs();\n if (num.isZero())\n return this.abs();\n var a = this.clone(), b = num.clone();\n a.negative = 0, b.negative = 0;\n for (var shift = 0;a.isEven() && b.isEven(); shift++)\n a.iushrn(1), b.iushrn(1);\n do {\n for (;a.isEven(); )\n a.iushrn(1);\n for (;b.isEven(); )\n b.iushrn(1);\n var r = a.cmp(b);\n if (r < 0) {\n var t = a;\n a = b, b = t;\n } else if (r === 0 || b.cmpn(1) === 0)\n break;\n a.isub(b);\n } while (!0);\n return b.iushln(shift);\n }, BN.prototype.invm = function(num) {\n return this.egcd(num).a.umod(num);\n }, BN.prototype.isEven = function() {\n return (this.words[0] & 1) === 0;\n }, BN.prototype.isOdd = function() {\n return (this.words[0] & 1) === 1;\n }, BN.prototype.andln = function(num) {\n return this.words[0] & num;\n }, BN.prototype.bincn = function(bit) {\n assert(typeof bit == \"number\");\n var r = bit % 26, s = (bit - r) / 26, q = 1 << r;\n if (this.length <= s)\n return this._expand(s + 1), this.words[s] |= q, this;\n for (var carry = q, i = s;carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry, carry = w >>> 26, w &= 67108863, this.words[i] = w;\n }\n return carry !== 0 && (this.words[i] = carry, this.length++), this;\n }, BN.prototype.isZero = function() {\n return this.length === 1 && this.words[0] === 0;\n }, BN.prototype.cmpn = function(num) {\n var negative = num < 0;\n if (this.negative !== 0 && !negative)\n return -1;\n if (this.negative === 0 && negative)\n return 1;\n this.strip();\n var res;\n if (this.length > 1)\n res = 1;\n else {\n negative && (num = -num), assert(num <= 67108863, \"Number is too big\");\n var w = this.words[0] | 0;\n res = w === num \? 0 : w < num \? -1 : 1;\n }\n return this.negative !== 0 \? -res | 0 : res;\n }, BN.prototype.cmp = function(num) {\n if (this.negative !== 0 && num.negative === 0)\n return -1;\n if (this.negative === 0 && num.negative !== 0)\n return 1;\n var res = this.ucmp(num);\n return this.negative !== 0 \? -res | 0 : res;\n }, BN.prototype.ucmp = function(num) {\n if (this.length > num.length)\n return 1;\n if (this.length < num.length)\n return -1;\n for (var res = 0, i = this.length - 1;i >= 0; i--) {\n var a = this.words[i] | 0, b = num.words[i] | 0;\n if (a !== b) {\n a < b \? res = -1 : a > b && (res = 1);\n break;\n }\n }\n return res;\n }, BN.prototype.gtn = function(num) {\n return this.cmpn(num) === 1;\n }, BN.prototype.gt = function(num) {\n return this.cmp(num) === 1;\n }, BN.prototype.gten = function(num) {\n return this.cmpn(num) >= 0;\n }, BN.prototype.gte = function(num) {\n return this.cmp(num) >= 0;\n }, BN.prototype.ltn = function(num) {\n return this.cmpn(num) === -1;\n }, BN.prototype.lt = function(num) {\n return this.cmp(num) === -1;\n }, BN.prototype.lten = function(num) {\n return this.cmpn(num) <= 0;\n }, BN.prototype.lte = function(num) {\n return this.cmp(num) <= 0;\n }, BN.prototype.eqn = function(num) {\n return this.cmpn(num) === 0;\n }, BN.prototype.eq = function(num) {\n return this.cmp(num) === 0;\n }, BN.red = function(num) {\n return new Red(num);\n }, BN.prototype.toRed = function(ctx) {\n return assert(!this.red, \"Already a number in reduction context\"), assert(this.negative === 0, \"red works only with positives\"), ctx.convertTo(this)._forceRed(ctx);\n }, BN.prototype.fromRed = function() {\n return assert(this.red, \"fromRed works only with numbers in reduction context\"), this.red.convertFrom(this);\n }, BN.prototype._forceRed = function(ctx) {\n return this.red = ctx, this;\n }, BN.prototype.forceRed = function(ctx) {\n return assert(!this.red, \"Already a number in reduction context\"), this._forceRed(ctx);\n }, BN.prototype.redAdd = function(num) {\n return assert(this.red, \"redAdd works only with red numbers\"), this.red.add(this, num);\n }, BN.prototype.redIAdd = function(num) {\n return assert(this.red, \"redIAdd works only with red numbers\"), this.red.iadd(this, num);\n }, BN.prototype.redSub = function(num) {\n return assert(this.red, \"redSub works only with red numbers\"), this.red.sub(this, num);\n }, BN.prototype.redISub = function(num) {\n return assert(this.red, \"redISub works only with red numbers\"), this.red.isub(this, num);\n }, BN.prototype.redShl = function(num) {\n return assert(this.red, \"redShl works only with red numbers\"), this.red.shl(this, num);\n }, BN.prototype.redMul = function(num) {\n return assert(this.red, \"redMul works only with red numbers\"), this.red._verify2(this, num), this.red.mul(this, num);\n }, BN.prototype.redIMul = function(num) {\n return assert(this.red, \"redMul works only with red numbers\"), this.red._verify2(this, num), this.red.imul(this, num);\n }, BN.prototype.redSqr = function() {\n return assert(this.red, \"redSqr works only with red numbers\"), this.red._verify1(this), this.red.sqr(this);\n }, BN.prototype.redISqr = function() {\n return assert(this.red, \"redISqr works only with red numbers\"), this.red._verify1(this), this.red.isqr(this);\n }, BN.prototype.redSqrt = function() {\n return assert(this.red, \"redSqrt works only with red numbers\"), this.red._verify1(this), this.red.sqrt(this);\n }, BN.prototype.redInvm = function() {\n return assert(this.red, \"redInvm works only with red numbers\"), this.red._verify1(this), this.red.invm(this);\n }, BN.prototype.redNeg = function() {\n return assert(this.red, \"redNeg works only with red numbers\"), this.red._verify1(this), this.red.neg(this);\n }, BN.prototype.redPow = function(num) {\n return assert(this.red && !num.red, \"redPow(normalNum)\"), this.red._verify1(this), this.red.pow(this, num);\n };\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n function MPrime(name, p) {\n this.name = name, this.p = new BN(p, 16), this.n = this.p.bitLength(), this.k = new BN(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();\n }\n MPrime.prototype = {}, MPrime.prototype._tmp = function() {\n var tmp = new BN(null);\n return tmp.words = new @Array(Math.ceil(this.n / 13)), tmp;\n }, MPrime.prototype.ireduce = function(num) {\n var r = num, rlen;\n do\n this.split(r, this.tmp), r = this.imulK(r), r = r.iadd(this.tmp), rlen = r.bitLength();\n while (rlen > this.n);\n var cmp = rlen < this.n \? -1 : r.ucmp(this.p);\n return cmp === 0 \? (r.words[0] = 0, r.length = 1) : cmp > 0 \? r.isub(this.p) : r.strip !== void 0 \? r.strip() : r._strip(), r;\n }, MPrime.prototype.split = function(input, out) {\n input.iushrn(this.n, 0, out);\n }, MPrime.prototype.imulK = function(num) {\n return num.imul(this.k);\n };\n function K256() {\n MPrime.@call(this, \"k256\", \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\");\n }\n inherits(K256, MPrime), K256.prototype.split = function(input, output) {\n for (var mask = 4194303, outLen = Math.min(input.length, 9), i = 0;i < outLen; i++)\n output.words[i] = input.words[i];\n if (output.length = outLen, input.length <= 9) {\n input.words[0] = 0, input.length = 1;\n return;\n }\n var prev = input.words[9];\n for (output.words[output.length++] = prev & mask, i = 10;i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = (next & mask) << 4 | prev >>> 22, prev = next;\n }\n prev >>>= 22, input.words[i - 10] = prev, prev === 0 && input.length > 10 \? input.length -= 10 : input.length -= 9;\n }, K256.prototype.imulK = function(num) {\n num.words[num.length] = 0, num.words[num.length + 1] = 0, num.length += 2;\n for (var lo = 0, i = 0;i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 977, num.words[i] = lo & 67108863, lo = w * 64 + (lo / 67108864 | 0);\n }\n return num.words[num.length - 1] === 0 && (num.length--, num.words[num.length - 1] === 0 && num.length--), num;\n };\n function P224() {\n MPrime.@call(this, \"p224\", \"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\");\n }\n inherits(P224, MPrime);\n function P192() {\n MPrime.@call(this, \"p192\", \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\");\n }\n inherits(P192, MPrime);\n function P25519() {\n MPrime.@call(this, \"25519\", \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\");\n }\n inherits(P25519, MPrime), P25519.prototype.imulK = function(num) {\n for (var carry = 0, i = 0;i < num.length; i++) {\n var hi = (num.words[i] | 0) * 19 + carry, lo = hi & 67108863;\n hi >>>= 26, num.words[i] = lo, carry = hi;\n }\n return carry !== 0 && (num.words[num.length++] = carry), num;\n }, BN._prime = function(name) {\n if (primes[name])\n return primes[name];\n var prime2;\n if (name === \"k256\")\n prime2 = new K256;\n else if (name === \"p224\")\n prime2 = new P224;\n else if (name === \"p192\")\n prime2 = new P192;\n else if (name === \"p25519\")\n prime2 = new P25519;\n else\n throw new Error(\"Unknown prime \" + name);\n return primes[name] = prime2, prime2;\n };\n function Red(m) {\n if (typeof m == \"string\") {\n var prime = BN._prime(m);\n this.m = prime.p, this.prime = prime;\n } else\n assert(m.gtn(1), \"modulus must be greater than 1\"), this.m = m, this.prime = null;\n }\n Red.prototype = {}, Red.prototype._verify1 = function(a) {\n assert(a.negative === 0, \"red works only with positives\"), assert(a.red, \"red works only with red numbers\");\n }, Red.prototype._verify2 = function(a, b) {\n assert((a.negative | b.negative) === 0, \"red works only with positives\"), assert(a.red && a.red === b.red, \"red works only with red numbers\");\n }, Red.prototype.imod = function(a) {\n return this.prime \? this.prime.ireduce(a)._forceRed(this) : a.umod(this.m)._forceRed(this);\n }, Red.prototype.neg = function(a) {\n return a.isZero() \? a.clone() : this.m.sub(a)._forceRed(this);\n }, Red.prototype.add = function(a, b) {\n this._verify2(a, b);\n var res = a.add(b);\n return res.cmp(this.m) >= 0 && res.isub(this.m), res._forceRed(this);\n }, Red.prototype.iadd = function(a, b) {\n this._verify2(a, b);\n var res = a.iadd(b);\n return res.cmp(this.m) >= 0 && res.isub(this.m), res;\n }, Red.prototype.sub = function(a, b) {\n this._verify2(a, b);\n var res = a.sub(b);\n return res.cmpn(0) < 0 && res.iadd(this.m), res._forceRed(this);\n }, Red.prototype.isub = function(a, b) {\n this._verify2(a, b);\n var res = a.isub(b);\n return res.cmpn(0) < 0 && res.iadd(this.m), res;\n }, Red.prototype.shl = function(a, num) {\n return this._verify1(a), this.imod(a.ushln(num));\n }, Red.prototype.imul = function(a, b) {\n return this._verify2(a, b), this.imod(a.imul(b));\n }, Red.prototype.mul = function(a, b) {\n return this._verify2(a, b), this.imod(a.mul(b));\n }, Red.prototype.isqr = function(a) {\n return this.imul(a, a.clone());\n }, Red.prototype.sqr = function(a) {\n return this.mul(a, a);\n }, Red.prototype.sqrt = function(a) {\n if (a.isZero())\n return a.clone();\n var mod3 = this.m.andln(3);\n if (assert(mod3 % 2 === 1), mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n for (var q = this.m.subn(1), s = 0;!q.isZero() && q.andln(1) === 0; )\n s++, q.iushrn(1);\n assert(!q.isZero());\n var one = new BN(1).toRed(this), nOne = one.redNeg(), lpow = this.m.subn(1).iushrn(1), z = this.m.bitLength();\n for (z = new BN(2 * z * z).toRed(this);this.pow(z, lpow).cmp(nOne) !== 0; )\n z.redIAdd(nOne);\n for (var c = this.pow(z, q), r = this.pow(a, q.addn(1).iushrn(1)), t = this.pow(a, q), m = s;t.cmp(one) !== 0; ) {\n for (var tmp = t, i = 0;tmp.cmp(one) !== 0; i++)\n tmp = tmp.redSqr();\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n r = r.redMul(b), c = b.redSqr(), t = t.redMul(c), m = i;\n }\n return r;\n }, Red.prototype.invm = function(a) {\n var inv = a._invmp(this.m);\n return inv.negative !== 0 \? (inv.negative = 0, this.imod(inv).redNeg()) : this.imod(inv);\n }, Red.prototype.pow = function(a, num) {\n if (num.isZero())\n return new BN(1).toRed(this);\n if (num.cmpn(1) === 0)\n return a.clone();\n var windowSize = 4, wnd = new @Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this), wnd[1] = a;\n for (var i = 2;i < wnd.length; i++)\n wnd[i] = this.mul(wnd[i - 1], a);\n var res = wnd[0], current = 0, currentLen = 0, start = num.bitLength() % 26;\n for (start === 0 && (start = 26), i = num.length - 1;i >= 0; i--) {\n for (var word = num.words[i], j = start - 1;j >= 0; j--) {\n var bit = word >> j & 1;\n if (res !== wnd[0] && (res = this.sqr(res)), bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n current <<= 1, current |= bit, currentLen++, !(currentLen !== windowSize && (i !== 0 || j !== 0)) && (res = this.mul(res, wnd[current]), currentLen = 0, current = 0);\n }\n start = 26;\n }\n return res;\n }, Red.prototype.convertTo = function(num) {\n var r = num.umod(this.m);\n return r === num \? r.clone() : r;\n }, Red.prototype.convertFrom = function(num) {\n var res = num.clone();\n return res.red = null, res;\n }, BN.mont = function(num) {\n return new Mont(num);\n };\n function Mont(m) {\n Red.@call(this, m), this.shift = this.m.bitLength(), this.shift % 26 !== 0 && (this.shift += 26 - this.shift % 26), this.r = new BN(1).iushln(this.shift), this.r2 = this.imod(this.r.sqr()), this.rinv = this.r._invmp(this.m), this.minv = this.rinv.mul(this.r).isubn(1).div(this.m), this.minv = this.minv.umod(this.r), this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red), Mont.prototype.convertTo = function(num) {\n return this.imod(num.ushln(this.shift));\n }, Mont.prototype.convertFrom = function(num) {\n var r = this.imod(num.mul(this.rinv));\n return r.red = null, r;\n }, Mont.prototype.imul = function(a, b) {\n if (a.isZero() || b.isZero())\n return a.words[0] = 0, a.length = 1, a;\n var t = a.imul(b), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u = t.isub(c).iushrn(this.shift), res = u;\n return u.cmp(this.m) >= 0 \? res = u.isub(this.m) : u.cmpn(0) < 0 && (res = u.iadd(this.m)), res._forceRed(this);\n }, Mont.prototype.mul = function(a, b) {\n if (a.isZero() || b.isZero())\n return new BN(0)._forceRed(this);\n var t = a.mul(b), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u = t.isub(c).iushrn(this.shift), res = u;\n return u.cmp(this.m) >= 0 \? res = u.isub(this.m) : u.cmpn(0) < 0 && (res = u.iadd(this.m)), res._forceRed(this);\n }, Mont.prototype.invm = function(a) {\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n })(typeof module > \"u\" || module, exports);\n }\n}), require_bn2 = require_bn, require_brorand = __commonJS({\n \"node_modules/brorand/index.js\"(exports, module) {\n var r;\n module.exports = function(len) {\n return r || (r = new Rand(null)), r.generate(len);\n };\n function Rand(rand) {\n this.rand = rand;\n }\n Rand.prototype = {}, module.exports.Rand = Rand, Rand.prototype.generate = function(len) {\n return this._rand(len);\n }, Rand.prototype._rand = function(n) {\n var out = new Buffer(n);\n return crypto.getRandomValues(out), out;\n };\n }\n}), require_mr = __commonJS({\n \"node_modules/miller-rabin/lib/mr.js\"(exports, module) {\n var bn = require_bn2(), brorand = require_brorand();\n function MillerRabin(rand) {\n this.rand = rand || new brorand.Rand;\n }\n module.exports = MillerRabin, MillerRabin.create = function(rand) {\n return new MillerRabin(rand);\n }, MillerRabin.prototype = {}, MillerRabin.prototype._randbelow = function(n) {\n var len = n.bitLength(), min_bytes = Math.ceil(len / 8);\n do\n var a = new bn(this.rand.generate(min_bytes));\n while (a.cmp(n) >= 0);\n return a;\n }, MillerRabin.prototype._randrange = function(start, stop) {\n var size = stop.sub(start);\n return start.add(this._randbelow(size));\n }, MillerRabin.prototype.test = function(n, k, cb) {\n var len = n.bitLength(), red = bn.mont(n), rone = new bn(1).toRed(red);\n k || (k = Math.max(1, len / 48 | 0));\n for (var n1 = n.subn(1), s = 0;!n1.testn(s); s++)\n ;\n for (var d = n.shrn(s), rn1 = n1.toRed(red), prime = !0;k > 0; k--) {\n var a = this._randrange(new bn(2), n1);\n cb && cb(a);\n var x = a.toRed(red).redPow(d);\n if (!(x.cmp(rone) === 0 || x.cmp(rn1) === 0)) {\n for (var i = 1;i < s; i++) {\n if (x = x.redSqr(), x.cmp(rone) === 0)\n return !1;\n if (x.cmp(rn1) === 0)\n break;\n }\n if (i === s)\n return !1;\n }\n }\n return prime;\n }, MillerRabin.prototype.getDivisor = function(n, k) {\n var len = n.bitLength(), red = bn.mont(n), rone = new bn(1).toRed(red);\n k || (k = Math.max(1, len / 48 | 0));\n for (var n1 = n.subn(1), s = 0;!n1.testn(s); s++)\n ;\n for (var d = n.shrn(s), rn1 = n1.toRed(red);k > 0; k--) {\n var a = this._randrange(new bn(2), n1), g = n.gcd(a);\n if (g.cmpn(1) !== 0)\n return g;\n var x = a.toRed(red).redPow(d);\n if (!(x.cmp(rone) === 0 || x.cmp(rn1) === 0)) {\n for (var i = 1;i < s; i++) {\n if (x = x.redSqr(), x.cmp(rone) === 0)\n return x.fromRed().subn(1).gcd(n);\n if (x.cmp(rn1) === 0)\n break;\n }\n if (i === s)\n return x = x.redSqr(), x.fromRed().subn(1).gcd(n);\n }\n }\n return !1;\n };\n }\n}), require_generatePrime = __commonJS({\n \"node_modules/diffie-hellman/lib/generatePrime.js\"(exports, module) {\n var randomBytes = require_browser();\n module.exports = findPrime, findPrime.simpleSieve = simpleSieve, findPrime.fermatTest = fermatTest;\n var BN = require_bn(), TWENTYFOUR = new BN(24), MillerRabin = require_mr(), millerRabin = new MillerRabin, ONE = new BN(1), TWO = new BN(2), FIVE = new BN(5), SIXTEEN = new BN(16), EIGHT = new BN(8), TEN = new BN(10), THREE = new BN(3), SEVEN = new BN(7), ELEVEN = new BN(11), FOUR = new BN(4), TWELVE = new BN(12), primes = null;\n function _getPrimes() {\n if (primes !== null)\n return primes;\n var limit = 1048576, res = [];\n res[0] = 2;\n for (var i = 1, k = 3;k < limit; k += 2) {\n for (var sqrt = Math.ceil(Math.sqrt(k)), j = 0;j < i && res[j] <= sqrt && k % res[j] !== 0; j++)\n ;\n i !== j && res[j] <= sqrt || (res[i++] = k);\n }\n return primes = res, res;\n }\n function simpleSieve(p) {\n for (var primes2 = _getPrimes(), i = 0;i < primes2.length; i++)\n if (p.modn(primes2[i]) === 0)\n return p.cmpn(primes2[i]) === 0;\n return !0;\n }\n function fermatTest(p) {\n var red = BN.mont(p);\n return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;\n }\n function findPrime(bits, gen) {\n if (bits < 16)\n return gen === 2 || gen === 5 \? new BN([140, 123]) : new BN([140, 39]);\n gen = new BN(gen);\n for (var num, n2;; ) {\n for (num = new BN(randomBytes(Math.ceil(bits / 8)));num.bitLength() > bits; )\n num.ishrn(1);\n if (num.isEven() && num.iadd(ONE), num.testn(1) || num.iadd(TWO), gen.cmp(TWO)) {\n if (!gen.cmp(FIVE))\n for (;num.mod(TEN).cmp(THREE); )\n num.iadd(FOUR);\n } else\n for (;num.mod(TWENTYFOUR).cmp(ELEVEN); )\n num.iadd(FOUR);\n if (n2 = num.shrn(1), simpleSieve(n2) && simpleSieve(num) && fermatTest(n2) && fermatTest(num) && millerRabin.test(n2) && millerRabin.test(num))\n return num;\n }\n }\n }\n}), require_primes = __commonJS({\n \"node_modules/diffie-hellman/lib/primes.json\"(exports, module) {\n module.exports = {\n modp1: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff\"\n },\n modp2: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff\"\n },\n modp5: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff\"\n },\n modp14: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff\"\n },\n modp15: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff\"\n },\n modp16: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff\"\n },\n modp17: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff\"\n },\n modp18: {\n gen: \"02\",\n prime: \"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff\"\n }\n };\n }\n}), require_dh = __commonJS({\n \"node_modules/diffie-hellman/lib/dh.js\"(exports, module) {\n var BN = require_bn(), MillerRabin = require_mr(), millerRabin = new MillerRabin, TWENTYFOUR = new BN(24), ELEVEN = new BN(11), TEN = new BN(10), THREE = new BN(3), SEVEN = new BN(7), primes = require_generatePrime(), randomBytes = require_browser();\n module.exports = DH;\n function setPublicKey(pub, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(pub) || (pub = new Buffer(pub, enc)), this._pub = new BN(pub), this;\n }\n function setPrivateKey(priv, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(priv) || (priv = new Buffer(priv, enc)), this._priv = new BN(priv), this;\n }\n var primeCache = {};\n function checkPrime(prime, generator) {\n var gen = generator.toString(\"hex\"), hex = [gen, prime.toString(16)].join(\"_\");\n if (hex in primeCache)\n return primeCache[hex];\n var error = 0;\n if (prime.isEven() || !primes.simpleSieve || !primes.fermatTest(prime) || !millerRabin.test(prime))\n return error += 1, gen === \"02\" || gen === \"05\" \? error += 8 : error += 4, primeCache[hex] = error, error;\n millerRabin.test(prime.shrn(1)) || (error += 2);\n var rem;\n switch (gen) {\n case \"02\":\n prime.mod(TWENTYFOUR).cmp(ELEVEN) && (error += 8);\n break;\n case \"05\":\n rem = prime.mod(TEN), rem.cmp(THREE) && rem.cmp(SEVEN) && (error += 8);\n break;\n default:\n error += 4;\n }\n return primeCache[hex] = error, error;\n }\n function DH(prime, generator, malleable) {\n this.setGenerator(generator), this.__prime = new BN(prime), this._prime = BN.mont(this.__prime), this._primeLen = prime.length, this._pub = void 0, this._priv = void 0, this._primeCode = void 0, malleable \? (this.setPublicKey = setPublicKey, this.setPrivateKey = setPrivateKey) : this._primeCode = 8;\n }\n DH.prototype = {}, Object.defineProperty(DH.prototype, \"verifyError\", {\n enumerable: !0,\n get: function() {\n return typeof this._primeCode != \"number\" && (this._primeCode = checkPrime(this.__prime, this.__gen)), this._primeCode;\n }\n }), DH.prototype.generateKeys = function() {\n return this._priv || (this._priv = new BN(randomBytes(this._primeLen))), this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(), this.getPublicKey();\n }, DH.prototype.computeSecret = function(other) {\n other = new BN(other), other = other.toRed(this._prime);\n var secret = other.redPow(this._priv).fromRed(), out = new Buffer(secret.toArray()), prime = this.getPrime();\n if (out.length < prime.length) {\n var front = new Buffer(prime.length - out.length);\n front.fill(0), out = Buffer.concat([front, out]);\n }\n return out;\n }, DH.prototype.getPublicKey = function(enc) {\n return formatReturnValue(this._pub, enc);\n }, DH.prototype.getPrivateKey = function(enc) {\n return formatReturnValue(this._priv, enc);\n }, DH.prototype.getPrime = function(enc) {\n return formatReturnValue(this.__prime, enc);\n }, DH.prototype.getGenerator = function(enc) {\n return formatReturnValue(this._gen, enc);\n }, DH.prototype.setGenerator = function(gen, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(gen) || (gen = new Buffer(gen, enc)), this.__gen = gen, this._gen = new BN(gen), this;\n };\n function formatReturnValue(bn, enc) {\n var buf = new Buffer(bn.toArray());\n return enc \? buf.toString(enc) : buf;\n }\n }\n}), require_browser7 = __commonJS({\n \"node_modules/diffie-hellman/browser.js\"(exports) {\n var generatePrime = require_generatePrime(), primes = require_primes(), DH = require_dh();\n function getDiffieHellman(mod) {\n var prime = new Buffer(primes[mod].prime, \"hex\"), gen = new Buffer(primes[mod].gen, \"hex\");\n return new DH(prime, gen);\n }\n var ENCODINGS = {\n binary: !0,\n hex: !0,\n base64: !0\n };\n function createDiffieHellman(prime, enc, generator, genc) {\n return Buffer.isBuffer(enc) || ENCODINGS[enc] === void 0 \? createDiffieHellman(prime, \"binary\", enc, generator) : (enc = enc || \"binary\", genc = genc || \"binary\", generator = generator || new Buffer([2]), Buffer.isBuffer(generator) || (generator = new Buffer(generator, genc)), typeof prime == \"number\" \? new DH(generatePrime(prime, generator), generator, !0) : (Buffer.isBuffer(prime) || (prime = new Buffer(prime, enc)), new DH(prime, generator, !0)));\n }\n exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman, exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman;\n }\n}), require_bn3 = require_bn, require_browserify_rsa = __commonJS({\n \"node_modules/browserify-rsa/index.js\"(exports, module) {\n var BN = require_bn3(), randomBytes = require_browser();\n function blind(priv) {\n var r = getr(priv), blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed();\n return { blinder, unblinder: r.invm(priv.modulus) };\n }\n function getr(priv) {\n var len = priv.modulus.byteLength(), r;\n do\n r = new BN(randomBytes(len));\n while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2));\n return r;\n }\n function crt(msg, priv) {\n var blinds = blind(priv), len = priv.modulus.byteLength(), blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus), c1 = blinded.toRed(BN.mont(priv.prime1)), c2 = blinded.toRed(BN.mont(priv.prime2)), qinv = priv.coefficient, p = priv.prime1, q = priv.prime2, m1 = c1.redPow(priv.exponent1).fromRed(), m2 = c2.redPow(priv.exponent2).fromRed(), h = m1.isub(m2).imul(qinv).umod(p).imul(q);\n return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, \"be\", len);\n }\n crt.getr = getr, module.exports = crt;\n }\n}), require_package = __commonJS({\n \"node_modules/elliptic/package.json\"(exports, module) {\n module.exports = {\n name: \"elliptic\",\n version: \"6.5.4\",\n description: \"EC cryptography\",\n main: \"lib/elliptic.js\",\n files: [\"lib\"],\n scripts: {\n lint: \"eslint lib test\",\n \"lint:fix\": \"npm run lint -- --fix\",\n unit: \"istanbul test _mocha --reporter=spec test/index.js\",\n test: \"npm run lint && npm run unit\",\n version: \"grunt dist && git add dist/\"\n },\n repository: {\n type: \"git\",\n url: \"git@github.com:indutny/elliptic\"\n },\n keywords: [\"EC\", \"Elliptic\", \"curve\", \"Cryptography\"],\n author: \"Fedor Indutny <fedor@indutny.com>\",\n license: \"MIT\",\n bugs: {\n url: \"https://github.com/indutny/elliptic/issues\"\n },\n homepage: \"https://github.com/indutny/elliptic\",\n devDependencies: {\n brfs: \"^2.0.2\",\n coveralls: \"^3.1.0\",\n eslint: \"^7.6.0\",\n grunt: \"^1.2.1\",\n \"grunt-browserify\": \"^5.3.0\",\n \"grunt-cli\": \"^1.3.2\",\n \"grunt-contrib-connect\": \"^3.0.0\",\n \"grunt-contrib-copy\": \"^1.0.0\",\n \"grunt-contrib-uglify\": \"^5.0.0\",\n \"grunt-mocha-istanbul\": \"^5.0.2\",\n \"grunt-saucelabs\": \"^9.0.1\",\n istanbul: \"^0.4.5\",\n mocha: \"^8.0.1\"\n },\n dependencies: {\n \"bn.js\": \"^4.11.9\",\n brorand: \"^1.1.0\",\n \"hash.js\": \"^1.0.0\",\n \"hmac-drbg\": \"^1.0.1\",\n inherits: \"^2.0.4\",\n \"minimalistic-assert\": \"^1.0.1\",\n \"minimalistic-crypto-utils\": \"^1.0.1\"\n }\n };\n }\n}), require_bn4 = require_bn, require_utils2 = __commonJS({\n \"node_modules/minimalistic-crypto-utils/lib/utils.js\"(exports) {\n var utils = exports;\n function toArray(msg, enc) {\n if (@Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg != \"string\") {\n for (var i = 0;i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n if (enc === \"hex\") {\n msg = msg.replace(/[^a-z0-9]+/gi, \"\"), msg.length % 2 !== 0 && (msg = \"0\" + msg);\n for (var i = 0;i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else\n for (var i = 0;i < msg.length; i++) {\n var c = msg.charCodeAt(i), hi = c >> 8, lo = c & 255;\n hi \? res.push(hi, lo) : res.push(lo);\n }\n return res;\n }\n utils.toArray = toArray;\n function zero2(word) {\n return word.length === 1 \? \"0\" + word : word;\n }\n utils.zero2 = zero2;\n function toHex(msg) {\n for (var res = \"\", i = 0;i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n }\n utils.toHex = toHex, utils.encode = function(arr, enc) {\n return enc === \"hex\" \? toHex(arr) : arr;\n };\n }\n}), require_utils3 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/utils.js\"(exports) {\n var utils = exports, BN = require_bn4(), minAssert = require_minimalistic_assert(), minUtils = require_utils2();\n utils.assert = minAssert, utils.toArray = minUtils.toArray, utils.zero2 = minUtils.zero2, utils.toHex = minUtils.toHex, utils.encode = minUtils.encode;\n function getNAF(num, w, bits) {\n var naf = new @Array(Math.max(num.bitLength(), bits) + 1);\n naf.fill(0);\n for (var ws = 1 << w + 1, k = num.clone(), i = 0;i < naf.length; i++) {\n var z, mod = k.andln(ws - 1);\n k.isOdd() \? (mod > (ws >> 1) - 1 \? z = (ws >> 1) - mod : z = mod, k.isubn(z)) : z = 0, naf[i] = z, k.iushrn(1);\n }\n return naf;\n }\n utils.getNAF = getNAF;\n function getJSF(k1, k2) {\n var jsf = [[], []];\n k1 = k1.clone(), k2 = k2.clone();\n for (var d1 = 0, d2 = 0, m8;k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0; ) {\n var m14 = k1.andln(3) + d1 & 3, m24 = k2.andln(3) + d2 & 3;\n m14 === 3 && (m14 = -1), m24 === 3 && (m24 = -1);\n var u1;\n (m14 & 1) === 0 \? u1 = 0 : (m8 = k1.andln(7) + d1 & 7, (m8 === 3 || m8 === 5) && m24 === 2 \? u1 = -m14 : u1 = m14), jsf[0].push(u1);\n var u2;\n (m24 & 1) === 0 \? u2 = 0 : (m8 = k2.andln(7) + d2 & 7, (m8 === 3 || m8 === 5) && m14 === 2 \? u2 = -m24 : u2 = m24), jsf[1].push(u2), 2 * d1 === u1 + 1 && (d1 = 1 - d1), 2 * d2 === u2 + 1 && (d2 = 1 - d2), k1.iushrn(1), k2.iushrn(1);\n }\n return jsf;\n }\n utils.getJSF = getJSF;\n function cachedProperty(obj, name, computer) {\n var key2 = \"_\" + name;\n obj.prototype[name] = function() {\n return this[key2] !== void 0 \? this[key2] : this[key2] = computer.@call(this);\n };\n }\n utils.cachedProperty = cachedProperty;\n function parseBytes(bytes) {\n if (bytes instanceof KeyObject)\n bytes = bytes.export();\n else if (bytes instanceof CryptoKey)\n bytes = KeyObject.from(bytes).export();\n return typeof bytes == \"string\" \? utils.toArray(bytes, \"hex\") : bytes;\n }\n utils.parseBytes = parseBytes;\n function intFromLE(bytes) {\n return new BN(bytes, \"hex\", \"le\");\n }\n utils.intFromLE = intFromLE;\n }\n}), require_base = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/base.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), getNAF = utils.getNAF, getJSF = utils.getJSF, assert = utils.assert;\n function BaseCurve(type, conf) {\n this.type = type, this.p = new BN(conf.p, 16), this.red = conf.prime \? BN.red(conf.prime) : BN.mont(this.p), this.zero = new BN(0).toRed(this.red), this.one = new BN(1).toRed(this.red), this.two = new BN(2).toRed(this.red), this.n = conf.n && new BN(conf.n, 16), this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed), this._wnafT1 = new @Array(4), this._wnafT2 = new @Array(4), this._wnafT3 = new @Array(4), this._wnafT4 = new @Array(4), this._bitLength = this.n \? this.n.bitLength() : 0;\n var adjustCount = this.n && this.p.div(this.n);\n !adjustCount || adjustCount.cmpn(100) > 0 \? this.redN = null : (this._maxwellTrick = !0, this.redN = this.n.toRed(this.red));\n }\n module.exports = BaseCurve, BaseCurve.prototype = {}, BaseCurve.prototype.point = function() {\n throw new Error(\"Not implemented\");\n }, BaseCurve.prototype.validate = function() {\n throw new Error(\"Not implemented\");\n }, BaseCurve.prototype._fixedNafMul = function(p, k) {\n assert(p.precomputed);\n var doubles = p._getDoubles(), naf = getNAF(k, 1, this._bitLength), I = (1 << doubles.step + 1) - (doubles.step % 2 === 0 \? 2 : 1);\n I /= 3;\n var repr = [], j, nafW;\n for (j = 0;j < naf.length; j += doubles.step) {\n nafW = 0;\n for (var l = j + doubles.step - 1;l >= j; l--)\n nafW = (nafW << 1) + naf[l];\n repr.push(nafW);\n }\n for (var a = this.jpoint(null, null, null), b = this.jpoint(null, null, null), i = I;i > 0; i--) {\n for (j = 0;j < repr.length; j++)\n nafW = repr[j], nafW === i \? b = b.mixedAdd(doubles.points[j]) : nafW === -i && (b = b.mixedAdd(doubles.points[j].neg()));\n a = a.add(b);\n }\n return a.toP();\n }, BaseCurve.prototype._wnafMul = function(p, k) {\n var w = 4, nafPoints = p._getNAFPoints(w);\n w = nafPoints.wnd;\n for (var wnd = nafPoints.points, naf = getNAF(k, w, this._bitLength), acc = this.jpoint(null, null, null), i = naf.length - 1;i >= 0; i--) {\n for (var l = 0;i >= 0 && naf[i] === 0; i--)\n l++;\n if (i >= 0 && l++, acc = acc.dblp(l), i < 0)\n break;\n var z = naf[i];\n assert(z !== 0), p.type === \"affine\" \? z > 0 \? acc = acc.mixedAdd(wnd[z - 1 >> 1]) : acc = acc.mixedAdd(wnd[-z - 1 >> 1].neg()) : z > 0 \? acc = acc.add(wnd[z - 1 >> 1]) : acc = acc.add(wnd[-z - 1 >> 1].neg());\n }\n return p.type === \"affine\" \? acc.toP() : acc;\n }, BaseCurve.prototype._wnafMulAdd = function(defW, points, coeffs, len, jacobianResult) {\n var wndWidth = this._wnafT1, wnd = this._wnafT2, naf = this._wnafT3, max = 0, i, j, p;\n for (i = 0;i < len; i++) {\n p = points[i];\n var nafPoints = p._getNAFPoints(defW);\n wndWidth[i] = nafPoints.wnd, wnd[i] = nafPoints.points;\n }\n for (i = len - 1;i >= 1; i -= 2) {\n var a = i - 1, b = i;\n if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength), naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength), max = Math.max(naf[a].length, max), max = Math.max(naf[b].length, max);\n continue;\n }\n var comb = [points[a], null, null, points[b]];\n points[a].y.cmp(points[b].y) === 0 \? (comb[1] = points[a].add(points[b]), comb[2] = points[a].toJ().mixedAdd(points[b].neg())) : points[a].y.cmp(points[b].y.redNeg()) === 0 \? (comb[1] = points[a].toJ().mixedAdd(points[b]), comb[2] = points[a].add(points[b].neg())) : (comb[1] = points[a].toJ().mixedAdd(points[b]), comb[2] = points[a].toJ().mixedAdd(points[b].neg()));\n var index = [-3, -1, -5, -7, 0, 7, 5, 1, 3], jsf = getJSF(coeffs[a], coeffs[b]);\n for (max = Math.max(jsf[0].length, max), naf[a] = new @Array(max), naf[b] = new @Array(max), j = 0;j < max; j++) {\n var ja = jsf[0][j] | 0, jb = jsf[1][j] | 0;\n naf[a][j] = index[(ja + 1) * 3 + (jb + 1)], naf[b][j] = 0, wnd[a] = comb;\n }\n }\n var acc = this.jpoint(null, null, null), tmp = this._wnafT4;\n for (i = max;i >= 0; i--) {\n for (var k = 0;i >= 0; ) {\n var zero = !0;\n for (j = 0;j < len; j++)\n tmp[j] = naf[j][i] | 0, tmp[j] !== 0 && (zero = !1);\n if (!zero)\n break;\n k++, i--;\n }\n if (i >= 0 && k++, acc = acc.dblp(k), i < 0)\n break;\n for (j = 0;j < len; j++) {\n var z = tmp[j];\n z !== 0 && (z > 0 \? p = wnd[j][z - 1 >> 1] : z < 0 && (p = wnd[j][-z - 1 >> 1].neg()), p.type === \"affine\" \? acc = acc.mixedAdd(p) : acc = acc.add(p));\n }\n }\n for (i = 0;i < len; i++)\n wnd[i] = null;\n return jacobianResult \? acc : acc.toP();\n };\n function BasePoint(curve, type) {\n this.curve = curve, this.type = type, this.precomputed = null;\n }\n BasePoint.prototype = {}, BaseCurve.BasePoint = BasePoint, BasePoint.prototype.eq = function() {\n throw new Error(\"Not implemented\");\n }, BasePoint.prototype.validate = function() {\n return this.curve.validate(this);\n }, BaseCurve.prototype.decodePoint = function(bytes, enc) {\n bytes = utils.toArray(bytes, enc);\n var len = this.p.byteLength();\n if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) {\n bytes[0] === 6 \? assert(bytes[bytes.length - 1] % 2 === 0) : bytes[0] === 7 && assert(bytes[bytes.length - 1] % 2 === 1);\n var res = this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len));\n return res;\n } else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len)\n return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3);\n throw new Error(\"Unknown point format\");\n }, BasePoint.prototype.encodeCompressed = function(enc) {\n return this.encode(enc, !0);\n }, BasePoint.prototype._encode = function(compact) {\n var len = this.curve.p.byteLength(), x = this.getX().toArray(\"be\", len);\n return compact \? [this.getY().isEven() \? 2 : 3].concat(x) : [4].concat(x, this.getY().toArray(\"be\", len));\n }, BasePoint.prototype.encode = function(enc, compact) {\n return utils.encode(this._encode(compact), enc);\n }, BasePoint.prototype.precompute = function(power) {\n if (this.precomputed)\n return this;\n var precomputed = {\n doubles: null,\n naf: null,\n beta: null\n };\n return precomputed.naf = this._getNAFPoints(8), precomputed.doubles = this._getDoubles(4, power), precomputed.beta = this._getBeta(), this.precomputed = precomputed, this;\n }, BasePoint.prototype._hasDoubles = function(k) {\n if (!this.precomputed)\n return !1;\n var doubles = this.precomputed.doubles;\n return doubles \? doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step) : !1;\n }, BasePoint.prototype._getDoubles = function(step, power) {\n if (this.precomputed && this.precomputed.doubles)\n return this.precomputed.doubles;\n for (var doubles = [this], acc = this, i = 0;i < power; i += step) {\n for (var j = 0;j < step; j++)\n acc = acc.dbl();\n doubles.push(acc);\n }\n return {\n step,\n points: doubles\n };\n }, BasePoint.prototype._getNAFPoints = function(wnd) {\n if (this.precomputed && this.precomputed.naf)\n return this.precomputed.naf;\n for (var res = [this], max = (1 << wnd) - 1, dbl = max === 1 \? null : this.dbl(), i = 1;i < max; i++)\n res[i] = res[i - 1].add(dbl);\n return {\n wnd,\n points: res\n };\n }, BasePoint.prototype._getBeta = function() {\n return null;\n }, BasePoint.prototype.dblp = function(k) {\n for (var r = this, i = 0;i < k; i++)\n r = r.dbl();\n return r;\n };\n }\n}), require_short = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/short.js\"(exports, module) {\n var utils = require_utils3(), BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), assert = utils.assert;\n function ShortCurve(conf) {\n Base.@call(this, \"short\", conf), this.a = new BN(conf.a, 16).toRed(this.red), this.b = new BN(conf.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = this.a.fromRed().cmpn(0) === 0, this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0, this.endo = this._getEndomorphism(conf), this._endoWnafT1 = new @Array(4), this._endoWnafT2 = new @Array(4);\n }\n inherits(ShortCurve, Base), module.exports = ShortCurve, ShortCurve.prototype._getEndomorphism = function(conf) {\n if (!(!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)) {\n var beta, lambda;\n if (conf.beta)\n beta = new BN(conf.beta, 16).toRed(this.red);\n else {\n var betas = this._getEndoRoots(this.p);\n beta = betas[0].cmp(betas[1]) < 0 \? betas[0] : betas[1], beta = beta.toRed(this.red);\n }\n if (conf.lambda)\n lambda = new BN(conf.lambda, 16);\n else {\n var lambdas = this._getEndoRoots(this.n);\n this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0 \? lambda = lambdas[0] : (lambda = lambdas[1], assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0));\n }\n var basis;\n return conf.basis \? basis = conf.basis.map(function(vec) {\n return {\n a: new BN(vec.a, 16),\n b: new BN(vec.b, 16)\n };\n }) : basis = this._getEndoBasis(lambda), {\n beta,\n lambda,\n basis\n };\n }\n }, ShortCurve.prototype._getEndoRoots = function(num) {\n var red = num === this.p \? this.red : BN.mont(num), tinv = new BN(2).toRed(red).redInvm(), ntinv = tinv.redNeg(), s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv), l1 = ntinv.redAdd(s).fromRed(), l2 = ntinv.redSub(s).fromRed();\n return [l1, l2];\n }, ShortCurve.prototype._getEndoBasis = function(lambda) {\n for (var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), u = lambda, v = this.n.clone(), x1 = new BN(1), y1 = new BN(0), x2 = new BN(0), y2 = new BN(1), a0, b0, a1, b1, a2, b2, prevR, i = 0, r, x;u.cmpn(0) !== 0; ) {\n var q = v.div(u);\n r = v.sub(q.mul(u)), x = x2.sub(q.mul(x1));\n var y = y2.sub(q.mul(y1));\n if (!a1 && r.cmp(aprxSqrt) < 0)\n a0 = prevR.neg(), b0 = x1, a1 = r.neg(), b1 = x;\n else if (a1 && ++i === 2)\n break;\n prevR = r, v = u, u = r, x2 = x1, x1 = x, y2 = y1, y1 = y;\n }\n a2 = r.neg(), b2 = x;\n var len1 = a1.sqr().add(b1.sqr()), len2 = a2.sqr().add(b2.sqr());\n return len2.cmp(len1) >= 0 && (a2 = a0, b2 = b0), a1.negative && (a1 = a1.neg(), b1 = b1.neg()), a2.negative && (a2 = a2.neg(), b2 = b2.neg()), [\n { a: a1, b: b1 },\n { a: a2, b: b2 }\n ];\n }, ShortCurve.prototype._endoSplit = function(k) {\n var basis = this.endo.basis, v1 = basis[0], v2 = basis[1], c1 = v2.b.mul(k).divRound(this.n), c2 = v1.b.neg().mul(k).divRound(this.n), p1 = c1.mul(v1.a), p2 = c2.mul(v2.a), q1 = c1.mul(v1.b), q2 = c2.mul(v2.b), k1 = k.sub(p1).sub(p2), k2 = q1.add(q2).neg();\n return { k1, k2 };\n }, ShortCurve.prototype.pointFromX = function(x, odd) {\n x = new BN(x, 16), x.red || (x = x.toRed(this.red));\n var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b), y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n var isOdd = y.fromRed().isOdd();\n return (odd && !isOdd || !odd && isOdd) && (y = y.redNeg()), this.point(x, y);\n }, ShortCurve.prototype.validate = function(point) {\n if (point.inf)\n return !0;\n var { x, y } = point, ax = this.a.redMul(x), rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n return y.redSqr().redISub(rhs).cmpn(0) === 0;\n }, ShortCurve.prototype._endoWnafMulAdd = function(points, coeffs, jacobianResult) {\n for (var npoints = this._endoWnafT1, ncoeffs = this._endoWnafT2, i = 0;i < points.length; i++) {\n var split = this._endoSplit(coeffs[i]), p = points[i], beta = p._getBeta();\n split.k1.negative && (split.k1.ineg(), p = p.neg(!0)), split.k2.negative && (split.k2.ineg(), beta = beta.neg(!0)), npoints[i * 2] = p, npoints[i * 2 + 1] = beta, ncoeffs[i * 2] = split.k1, ncoeffs[i * 2 + 1] = split.k2;\n }\n for (var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult), j = 0;j < i * 2; j++)\n npoints[j] = null, ncoeffs[j] = null;\n return res;\n };\n function Point(curve, x, y, isRed) {\n Base.BasePoint.@call(this, curve, \"affine\"), x === null && y === null \? (this.x = null, this.y = null, this.inf = !0) : (this.x = new BN(x, 16), this.y = new BN(y, 16), isRed && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = !1);\n }\n inherits(Point, Base.BasePoint), ShortCurve.prototype.point = function(x, y, isRed) {\n return new Point(this, x, y, isRed);\n }, ShortCurve.prototype.pointFromJSON = function(obj, red) {\n return Point.fromJSON(this, obj, red);\n }, Point.prototype._getBeta = function() {\n if (this.curve.endo) {\n var pre = this.precomputed;\n if (pre && pre.beta)\n return pre.beta;\n var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n if (pre) {\n var curve = this.curve, endoMul = function(p) {\n return curve.point(p.x.redMul(curve.endo.beta), p.y);\n };\n pre.beta = beta, beta.precomputed = {\n beta: null,\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(endoMul)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(endoMul)\n }\n };\n }\n return beta;\n }\n }, Point.prototype.toJSON = function() {\n return this.precomputed \? [\n this.x,\n this.y,\n this.precomputed && {\n doubles: this.precomputed.doubles && {\n step: this.precomputed.doubles.step,\n points: this.precomputed.doubles.points.slice(1)\n },\n naf: this.precomputed.naf && {\n wnd: this.precomputed.naf.wnd,\n points: this.precomputed.naf.points.slice(1)\n }\n }\n ] : [this.x, this.y];\n }, Point.fromJSON = function(curve, obj, red) {\n typeof obj == \"string\" && (obj = JSON.parse(obj));\n var res = curve.point(obj[0], obj[1], red);\n if (!obj[2])\n return res;\n function obj2point(obj2) {\n return curve.point(obj2[0], obj2[1], red);\n }\n var pre = obj[2];\n return res.precomputed = {\n beta: null,\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: [res].concat(pre.doubles.points.map(obj2point))\n },\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: [res].concat(pre.naf.points.map(obj2point))\n }\n }, res;\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" y: \" + this.y.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.inf;\n }, Point.prototype.add = function(p) {\n if (this.inf)\n return p;\n if (p.inf)\n return this;\n if (this.eq(p))\n return this.dbl();\n if (this.neg().eq(p))\n return this.curve.point(null, null);\n if (this.x.cmp(p.x) === 0)\n return this.curve.point(null, null);\n var c = this.y.redSub(p.y);\n c.cmpn(0) !== 0 && (c = c.redMul(this.x.redSub(p.x).redInvm()));\n var nx = c.redSqr().redISub(this.x).redISub(p.x), ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n }, Point.prototype.dbl = function() {\n if (this.inf)\n return this;\n var ys1 = this.y.redAdd(this.y);\n if (ys1.cmpn(0) === 0)\n return this.curve.point(null, null);\n var a = this.curve.a, x2 = this.x.redSqr(), dyinv = ys1.redInvm(), c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv), nx = c.redSqr().redISub(this.x.redAdd(this.x)), ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n }, Point.prototype.getX = function() {\n return this.x.fromRed();\n }, Point.prototype.getY = function() {\n return this.y.fromRed();\n }, Point.prototype.mul = function(k) {\n return k = new BN(k, 16), this.isInfinity() \? this : this._hasDoubles(k) \? this.curve._fixedNafMul(this, k) : this.curve.endo \? this.curve._endoWnafMulAdd([this], [k]) : this.curve._wnafMul(this, k);\n }, Point.prototype.mulAdd = function(k1, p2, k2) {\n var points = [this, p2], coeffs = [k1, k2];\n return this.curve.endo \? this.curve._endoWnafMulAdd(points, coeffs) : this.curve._wnafMulAdd(1, points, coeffs, 2);\n }, Point.prototype.jmulAdd = function(k1, p2, k2) {\n var points = [this, p2], coeffs = [k1, k2];\n return this.curve.endo \? this.curve._endoWnafMulAdd(points, coeffs, !0) : this.curve._wnafMulAdd(1, points, coeffs, 2, !0);\n }, Point.prototype.eq = function(p) {\n return this === p || this.inf === p.inf && (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n }, Point.prototype.neg = function(_precompute) {\n if (this.inf)\n return this;\n var res = this.curve.point(this.x, this.y.redNeg());\n if (_precompute && this.precomputed) {\n var pre = this.precomputed, negate = function(p) {\n return p.neg();\n };\n res.precomputed = {\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(negate)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(negate)\n }\n };\n }\n return res;\n }, Point.prototype.toJ = function() {\n if (this.inf)\n return this.curve.jpoint(null, null, null);\n var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n return res;\n };\n function JPoint(curve, x, y, z) {\n Base.BasePoint.@call(this, curve, \"jacobian\"), x === null && y === null && z === null \? (this.x = this.curve.one, this.y = this.curve.one, this.z = new BN(0)) : (this.x = new BN(x, 16), this.y = new BN(y, 16), this.z = new BN(z, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one;\n }\n inherits(JPoint, Base.BasePoint), ShortCurve.prototype.jpoint = function(x, y, z) {\n return new JPoint(this, x, y, z);\n }, JPoint.prototype.toP = function() {\n if (this.isInfinity())\n return this.curve.point(null, null);\n var zinv = this.z.redInvm(), zinv2 = zinv.redSqr(), ax = this.x.redMul(zinv2), ay = this.y.redMul(zinv2).redMul(zinv);\n return this.curve.point(ax, ay);\n }, JPoint.prototype.neg = function() {\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n }, JPoint.prototype.add = function(p) {\n if (this.isInfinity())\n return p;\n if (p.isInfinity())\n return this;\n var pz2 = p.z.redSqr(), z2 = this.z.redSqr(), u1 = this.x.redMul(pz2), u2 = p.x.redMul(z2), s1 = this.y.redMul(pz2.redMul(p.z)), s2 = p.y.redMul(z2.redMul(this.z)), h = u1.redSub(u2), r = s1.redSub(s2);\n if (h.cmpn(0) === 0)\n return r.cmpn(0) !== 0 \? this.curve.jpoint(null, null, null) : this.dbl();\n var h2 = h.redSqr(), h3 = h2.redMul(h), v = u1.redMul(h2), nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v), ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)), nz = this.z.redMul(p.z).redMul(h);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.mixedAdd = function(p) {\n if (this.isInfinity())\n return p.toJ();\n if (p.isInfinity())\n return this;\n var z2 = this.z.redSqr(), u1 = this.x, u2 = p.x.redMul(z2), s1 = this.y, s2 = p.y.redMul(z2).redMul(this.z), h = u1.redSub(u2), r = s1.redSub(s2);\n if (h.cmpn(0) === 0)\n return r.cmpn(0) !== 0 \? this.curve.jpoint(null, null, null) : this.dbl();\n var h2 = h.redSqr(), h3 = h2.redMul(h), v = u1.redMul(h2), nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v), ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)), nz = this.z.redMul(h);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.dblp = function(pow) {\n if (pow === 0)\n return this;\n if (this.isInfinity())\n return this;\n if (!pow)\n return this.dbl();\n var i;\n if (this.curve.zeroA || this.curve.threeA) {\n var r = this;\n for (i = 0;i < pow; i++)\n r = r.dbl();\n return r;\n }\n var a = this.curve.a, tinv = this.curve.tinv, jx = this.x, jy = this.y, jz = this.z, jz4 = jz.redSqr().redSqr(), jyd = jy.redAdd(jy);\n for (i = 0;i < pow; i++) {\n var jx2 = jx.redSqr(), jyd2 = jyd.redSqr(), jyd4 = jyd2.redSqr(), c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)), t1 = jx.redMul(jyd2), nx = c.redSqr().redISub(t1.redAdd(t1)), t2 = t1.redISub(nx), dny = c.redMul(t2);\n dny = dny.redIAdd(dny).redISub(jyd4);\n var nz = jyd.redMul(jz);\n i + 1 < pow && (jz4 = jz4.redMul(jyd4)), jx = nx, jz = nz, jyd = dny;\n }\n return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n }, JPoint.prototype.dbl = function() {\n return this.isInfinity() \? this : this.curve.zeroA \? this._zeroDbl() : this.curve.threeA \? this._threeDbl() : this._dbl();\n }, JPoint.prototype._zeroDbl = function() {\n var nx, ny, nz;\n if (this.zOne) {\n var xx = this.x.redSqr(), yy = this.y.redSqr(), yyyy = yy.redSqr(), s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n var m = xx.redAdd(xx).redIAdd(xx), t = m.redSqr().redISub(s).redISub(s), yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8), yyyy8 = yyyy8.redIAdd(yyyy8), nx = t, ny = m.redMul(s.redISub(t)).redISub(yyyy8), nz = this.y.redAdd(this.y);\n } else {\n var a = this.x.redSqr(), b = this.y.redSqr(), c = b.redSqr(), d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n d = d.redIAdd(d);\n var e = a.redAdd(a).redIAdd(a), f = e.redSqr(), c8 = c.redIAdd(c);\n c8 = c8.redIAdd(c8), c8 = c8.redIAdd(c8), nx = f.redISub(d).redISub(d), ny = e.redMul(d.redISub(nx)).redISub(c8), nz = this.y.redMul(this.z), nz = nz.redIAdd(nz);\n }\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype._threeDbl = function() {\n var nx, ny, nz;\n if (this.zOne) {\n var xx = this.x.redSqr(), yy = this.y.redSqr(), yyyy = yy.redSqr(), s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a), t = m.redSqr().redISub(s).redISub(s);\n nx = t;\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8), yyyy8 = yyyy8.redIAdd(yyyy8), ny = m.redMul(s.redISub(t)).redISub(yyyy8), nz = this.y.redAdd(this.y);\n } else {\n var delta = this.z.redSqr(), gamma = this.y.redSqr(), beta = this.x.redMul(gamma), alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n alpha = alpha.redAdd(alpha).redIAdd(alpha);\n var beta4 = beta.redIAdd(beta);\n beta4 = beta4.redIAdd(beta4);\n var beta8 = beta4.redAdd(beta4);\n nx = alpha.redSqr().redISub(beta8), nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n var ggamma8 = gamma.redSqr();\n ggamma8 = ggamma8.redIAdd(ggamma8), ggamma8 = ggamma8.redIAdd(ggamma8), ggamma8 = ggamma8.redIAdd(ggamma8), ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n }\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype._dbl = function() {\n var a = this.curve.a, jx = this.x, jy = this.y, jz = this.z, jz4 = jz.redSqr().redSqr(), jx2 = jx.redSqr(), jy2 = jy.redSqr(), c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)), jxd4 = jx.redAdd(jx);\n jxd4 = jxd4.redIAdd(jxd4);\n var t1 = jxd4.redMul(jy2), nx = c.redSqr().redISub(t1.redAdd(t1)), t2 = t1.redISub(nx), jyd8 = jy2.redSqr();\n jyd8 = jyd8.redIAdd(jyd8), jyd8 = jyd8.redIAdd(jyd8), jyd8 = jyd8.redIAdd(jyd8);\n var ny = c.redMul(t2).redISub(jyd8), nz = jy.redAdd(jy).redMul(jz);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.trpl = function() {\n if (!this.curve.zeroA)\n return this.dbl().add(this);\n var xx = this.x.redSqr(), yy = this.y.redSqr(), zz = this.z.redSqr(), yyyy = yy.redSqr(), m = xx.redAdd(xx).redIAdd(xx), mm = m.redSqr(), e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n e = e.redIAdd(e), e = e.redAdd(e).redIAdd(e), e = e.redISub(mm);\n var ee = e.redSqr(), t = yyyy.redIAdd(yyyy);\n t = t.redIAdd(t), t = t.redIAdd(t), t = t.redIAdd(t);\n var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t), yyu4 = yy.redMul(u);\n yyu4 = yyu4.redIAdd(yyu4), yyu4 = yyu4.redIAdd(yyu4);\n var nx = this.x.redMul(ee).redISub(yyu4);\n nx = nx.redIAdd(nx), nx = nx.redIAdd(nx);\n var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n ny = ny.redIAdd(ny), ny = ny.redIAdd(ny), ny = ny.redIAdd(ny);\n var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n return this.curve.jpoint(nx, ny, nz);\n }, JPoint.prototype.mul = function(k, kbase) {\n return k = new BN(k, kbase), this.curve._wnafMul(this, k);\n }, JPoint.prototype.eq = function(p) {\n if (p.type === \"affine\")\n return this.eq(p.toJ());\n if (this === p)\n return !0;\n var z2 = this.z.redSqr(), pz2 = p.z.redSqr();\n if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n return !1;\n var z3 = z2.redMul(this.z), pz3 = pz2.redMul(p.z);\n return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n }, JPoint.prototype.eqXToP = function(x) {\n var zs = this.z.redSqr(), rx = x.toRed(this.curve.red).redMul(zs);\n if (this.x.cmp(rx) === 0)\n return !0;\n for (var xc = x.clone(), t = this.curve.redN.redMul(zs);; ) {\n if (xc.iadd(this.curve.n), xc.cmp(this.curve.p) >= 0)\n return !1;\n if (rx.redIAdd(t), this.x.cmp(rx) === 0)\n return !0;\n }\n }, JPoint.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC JPoint Infinity>\" : \"<EC JPoint x: \" + this.x.toString(16, 2) + \" y: \" + this.y.toString(16, 2) + \" z: \" + this.z.toString(16, 2) + \">\";\n }, JPoint.prototype.isInfinity = function() {\n return this.z.cmpn(0) === 0;\n };\n }\n}), require_mont = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/mont.js\"(exports, module) {\n var BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), utils = require_utils3();\n function MontCurve(conf) {\n Base.@call(this, \"mont\", conf), this.a = new BN(conf.a, 16).toRed(this.red), this.b = new BN(conf.b, 16).toRed(this.red), this.i4 = new BN(4).toRed(this.red).redInvm(), this.two = new BN(2).toRed(this.red), this.a24 = this.i4.redMul(this.a.redAdd(this.two));\n }\n inherits(MontCurve, Base), module.exports = MontCurve, MontCurve.prototype.validate = function(point) {\n var x = point.normalize().x, x2 = x.redSqr(), rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x), y = rhs.redSqrt();\n return y.redSqr().cmp(rhs) === 0;\n };\n function Point(curve, x, z) {\n Base.BasePoint.@call(this, curve, \"projective\"), x === null && z === null \? (this.x = this.curve.one, this.z = this.curve.zero) : (this.x = new BN(x, 16), this.z = new BN(z, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)));\n }\n inherits(Point, Base.BasePoint), MontCurve.prototype.decodePoint = function(bytes, enc) {\n return this.point(utils.toArray(bytes, enc), 1);\n }, MontCurve.prototype.point = function(x, z) {\n return new Point(this, x, z);\n }, MontCurve.prototype.pointFromJSON = function(obj) {\n return Point.fromJSON(this, obj);\n }, Point.prototype.precompute = function() {\n }, Point.prototype._encode = function() {\n return this.getX().toArray(\"be\", this.curve.p.byteLength());\n }, Point.fromJSON = function(curve, obj) {\n return new Point(curve, obj[0], obj[1] || curve.one);\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" z: \" + this.z.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.z.cmpn(0) === 0;\n }, Point.prototype.dbl = function() {\n var a = this.x.redAdd(this.z), aa = a.redSqr(), b = this.x.redSub(this.z), bb = b.redSqr(), c = aa.redSub(bb), nx = aa.redMul(bb), nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\n return this.curve.point(nx, nz);\n }, Point.prototype.add = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.diffAdd = function(p, diff) {\n var a = this.x.redAdd(this.z), b = this.x.redSub(this.z), c = p.x.redAdd(p.z), d = p.x.redSub(p.z), da = d.redMul(a), cb = c.redMul(b), nx = diff.z.redMul(da.redAdd(cb).redSqr()), nz = diff.x.redMul(da.redISub(cb).redSqr());\n return this.curve.point(nx, nz);\n }, Point.prototype.mul = function(k) {\n for (var t = k.clone(), a = this, b = this.curve.point(null, null), c = this, bits = [];t.cmpn(0) !== 0; t.iushrn(1))\n bits.push(t.andln(1));\n for (var i = bits.length - 1;i >= 0; i--)\n bits[i] === 0 \? (a = a.diffAdd(b, c), b = b.dbl()) : (b = a.diffAdd(b, c), a = a.dbl());\n return b;\n }, Point.prototype.mulAdd = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.jumlAdd = function() {\n throw new Error(\"Not supported on Montgomery curve\");\n }, Point.prototype.eq = function(other) {\n return this.getX().cmp(other.getX()) === 0;\n }, Point.prototype.normalize = function() {\n return this.x = this.x.redMul(this.z.redInvm()), this.z = this.curve.one, this;\n }, Point.prototype.getX = function() {\n return this.normalize(), this.x.fromRed();\n };\n }\n}), require_edwards = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/edwards.js\"(exports, module) {\n var utils = require_utils3(), BN = require_bn4(), inherits = require_inherits_browser(), Base = require_base(), assert = utils.assert;\n function EdwardsCurve(conf) {\n this.twisted = (conf.a | 0) !== 1, this.mOneA = this.twisted && (conf.a | 0) === -1, this.extended = this.mOneA, Base.@call(this, \"edwards\", conf), this.a = new BN(conf.a, 16).umod(this.red.m), this.a = this.a.toRed(this.red), this.c = new BN(conf.c, 16).toRed(this.red), this.c2 = this.c.redSqr(), this.d = new BN(conf.d, 16).toRed(this.red), this.dd = this.d.redAdd(this.d), assert(!this.twisted || this.c.fromRed().cmpn(1) === 0), this.oneC = (conf.c | 0) === 1;\n }\n inherits(EdwardsCurve, Base), module.exports = EdwardsCurve, EdwardsCurve.prototype._mulA = function(num) {\n return this.mOneA \? num.redNeg() : this.a.redMul(num);\n }, EdwardsCurve.prototype._mulC = function(num) {\n return this.oneC \? num : this.c.redMul(num);\n }, EdwardsCurve.prototype.jpoint = function(x, y, z, t) {\n return this.point(x, y, z, t);\n }, EdwardsCurve.prototype.pointFromX = function(x, odd) {\n x = new BN(x, 16), x.red || (x = x.toRed(this.red));\n var x2 = x.redSqr(), rhs = this.c2.redSub(this.a.redMul(x2)), lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2)), y2 = rhs.redMul(lhs.redInvm()), y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n var isOdd = y.fromRed().isOdd();\n return (odd && !isOdd || !odd && isOdd) && (y = y.redNeg()), this.point(x, y);\n }, EdwardsCurve.prototype.pointFromY = function(y, odd) {\n y = new BN(y, 16), y.red || (y = y.toRed(this.red));\n var y2 = y.redSqr(), lhs = y2.redSub(this.c2), rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a), x2 = lhs.redMul(rhs.redInvm());\n if (x2.cmp(this.zero) === 0) {\n if (odd)\n throw new Error(\"invalid point\");\n return this.point(this.zero, y);\n }\n var x = x2.redSqrt();\n if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)\n throw new Error(\"invalid point\");\n return x.fromRed().isOdd() !== odd && (x = x.redNeg()), this.point(x, y);\n }, EdwardsCurve.prototype.validate = function(point) {\n if (point.isInfinity())\n return !0;\n point.normalize();\n var x2 = point.x.redSqr(), y2 = point.y.redSqr(), lhs = x2.redMul(this.a).redAdd(y2), rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\n return lhs.cmp(rhs) === 0;\n };\n function Point(curve, x, y, z, t) {\n Base.BasePoint.@call(this, curve, \"projective\"), x === null && y === null && z === null \? (this.x = this.curve.zero, this.y = this.curve.one, this.z = this.curve.one, this.t = this.curve.zero, this.zOne = !0) : (this.x = new BN(x, 16), this.y = new BN(y, 16), this.z = z \? new BN(z, 16) : this.curve.one, this.t = t && new BN(t, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.t && !this.t.red && (this.t = this.t.toRed(this.curve.red)), this.zOne = this.z === this.curve.one, this.curve.extended && !this.t && (this.t = this.x.redMul(this.y), this.zOne || (this.t = this.t.redMul(this.z.redInvm()))));\n }\n inherits(Point, Base.BasePoint), EdwardsCurve.prototype.pointFromJSON = function(obj) {\n return Point.fromJSON(this, obj);\n }, EdwardsCurve.prototype.point = function(x, y, z, t) {\n return new Point(this, x, y, z, t);\n }, Point.fromJSON = function(curve, obj) {\n return new Point(curve, obj[0], obj[1], obj[2]);\n }, Point.prototype.inspect = function() {\n return this.isInfinity() \? \"<EC Point Infinity>\" : \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" y: \" + this.y.fromRed().toString(16, 2) + \" z: \" + this.z.fromRed().toString(16, 2) + \">\";\n }, Point.prototype.isInfinity = function() {\n return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || this.zOne && this.y.cmp(this.curve.c) === 0);\n }, Point.prototype._extDbl = function() {\n var a = this.x.redSqr(), b = this.y.redSqr(), c = this.z.redSqr();\n c = c.redIAdd(c);\n var d = this.curve._mulA(a), e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b), g = d.redAdd(b), f = g.redSub(c), h = d.redSub(b), nx = e.redMul(f), ny = g.redMul(h), nt = e.redMul(h), nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n }, Point.prototype._projDbl = function() {\n var b = this.x.redAdd(this.y).redSqr(), c = this.x.redSqr(), d = this.y.redSqr(), nx, ny, nz, e, h, j;\n if (this.curve.twisted) {\n e = this.curve._mulA(c);\n var f = e.redAdd(d);\n this.zOne \? (nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)), ny = f.redMul(e.redSub(d)), nz = f.redSqr().redSub(f).redSub(f)) : (h = this.z.redSqr(), j = f.redSub(h).redISub(h), nx = b.redSub(c).redISub(d).redMul(j), ny = f.redMul(e.redSub(d)), nz = f.redMul(j));\n } else\n e = c.redAdd(d), h = this.curve._mulC(this.z).redSqr(), j = e.redSub(h).redSub(h), nx = this.curve._mulC(b.redISub(e)).redMul(j), ny = this.curve._mulC(e).redMul(c.redISub(d)), nz = e.redMul(j);\n return this.curve.point(nx, ny, nz);\n }, Point.prototype.dbl = function() {\n return this.isInfinity() \? this : this.curve.extended \? this._extDbl() : this._projDbl();\n }, Point.prototype._extAdd = function(p) {\n var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)), b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)), c = this.t.redMul(this.curve.dd).redMul(p.t), d = this.z.redMul(p.z.redAdd(p.z)), e = b.redSub(a), f = d.redSub(c), g = d.redAdd(c), h = b.redAdd(a), nx = e.redMul(f), ny = g.redMul(h), nt = e.redMul(h), nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n }, Point.prototype._projAdd = function(p) {\n var a = this.z.redMul(p.z), b = a.redSqr(), c = this.x.redMul(p.x), d = this.y.redMul(p.y), e = this.curve.d.redMul(c).redMul(d), f = b.redSub(e), g = b.redAdd(e), tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d), nx = a.redMul(f).redMul(tmp), ny, nz;\n return this.curve.twisted \? (ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))), nz = f.redMul(g)) : (ny = a.redMul(g).redMul(d.redSub(c)), nz = this.curve._mulC(f).redMul(g)), this.curve.point(nx, ny, nz);\n }, Point.prototype.add = function(p) {\n return this.isInfinity() \? p : p.isInfinity() \? this : this.curve.extended \? this._extAdd(p) : this._projAdd(p);\n }, Point.prototype.mul = function(k) {\n return this._hasDoubles(k) \? this.curve._fixedNafMul(this, k) : this.curve._wnafMul(this, k);\n }, Point.prototype.mulAdd = function(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, !1);\n }, Point.prototype.jmulAdd = function(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, !0);\n }, Point.prototype.normalize = function() {\n if (this.zOne)\n return this;\n var zi = this.z.redInvm();\n return this.x = this.x.redMul(zi), this.y = this.y.redMul(zi), this.t && (this.t = this.t.redMul(zi)), this.z = this.curve.one, this.zOne = !0, this;\n }, Point.prototype.neg = function() {\n return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg());\n }, Point.prototype.getX = function() {\n return this.normalize(), this.x.fromRed();\n }, Point.prototype.getY = function() {\n return this.normalize(), this.y.fromRed();\n }, Point.prototype.eq = function(other) {\n return this === other || this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0;\n }, Point.prototype.eqXToP = function(x) {\n var rx = x.toRed(this.curve.red).redMul(this.z);\n if (this.x.cmp(rx) === 0)\n return !0;\n for (var xc = x.clone(), t = this.curve.redN.redMul(this.z);; ) {\n if (xc.iadd(this.curve.n), xc.cmp(this.curve.p) >= 0)\n return !1;\n if (rx.redIAdd(t), this.x.cmp(rx) === 0)\n return !0;\n }\n }, Point.prototype.toP = Point.prototype.normalize, Point.prototype.mixedAdd = Point.prototype.add;\n }\n}), require_curve = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curve/index.js\"(exports) {\n var curve = exports;\n curve.base = require_base(), curve.short = require_short(), curve.mont = require_mont(), curve.edwards = require_edwards();\n }\n}), require_utils4 = __commonJS({\n \"node_modules/hash.js/lib/hash/utils.js\"(exports) {\n var assert = require_minimalistic_assert(), inherits = require_inherits_browser();\n exports.inherits = inherits;\n function isSurrogatePair(msg, i) {\n return (msg.charCodeAt(i) & 64512) !== 55296 || i < 0 || i + 1 >= msg.length \? !1 : (msg.charCodeAt(i + 1) & 64512) === 56320;\n }\n function toArray(msg, enc) {\n if (@Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg == \"string\")\n if (enc) {\n if (enc === \"hex\")\n for (msg = msg.replace(/[^a-z0-9]+/gi, \"\"), msg.length % 2 !== 0 && (msg = \"0\" + msg), i = 0;i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else\n for (var p = 0, i = 0;i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n c < 128 \? res[p++] = c : c < 2048 \? (res[p++] = c >> 6 | 192, res[p++] = c & 63 | 128) : isSurrogatePair(msg, i) \? (c = 65536 + ((c & 1023) << 10) + (msg.charCodeAt(++i) & 1023), res[p++] = c >> 18 | 240, res[p++] = c >> 12 & 63 | 128, res[p++] = c >> 6 & 63 | 128, res[p++] = c & 63 | 128) : (res[p++] = c >> 12 | 224, res[p++] = c >> 6 & 63 | 128, res[p++] = c & 63 | 128);\n }\n else\n for (i = 0;i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n exports.toArray = toArray;\n function toHex(msg) {\n for (var res = \"\", i = 0;i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n }\n exports.toHex = toHex;\n function htonl(w) {\n var res = w >>> 24 | w >>> 8 & 65280 | w << 8 & 16711680 | (w & 255) << 24;\n return res >>> 0;\n }\n exports.htonl = htonl;\n function toHex32(msg, endian) {\n for (var res = \"\", i = 0;i < msg.length; i++) {\n var w = msg[i];\n endian === \"little\" && (w = htonl(w)), res += zero8(w.toString(16));\n }\n return res;\n }\n exports.toHex32 = toHex32;\n function zero2(word) {\n return word.length === 1 \? \"0\" + word : word;\n }\n exports.zero2 = zero2;\n function zero8(word) {\n return word.length === 7 \? \"0\" + word : word.length === 6 \? \"00\" + word : word.length === 5 \? \"000\" + word : word.length === 4 \? \"0000\" + word : word.length === 3 \? \"00000\" + word : word.length === 2 \? \"000000\" + word : word.length === 1 \? \"0000000\" + word : word;\n }\n exports.zero8 = zero8;\n function join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n for (var res = new @Array(len / 4), i = 0, k = start;i < res.length; i++, k += 4) {\n var w;\n endian === \"big\" \? w = msg[k] << 24 | msg[k + 1] << 16 | msg[k + 2] << 8 | msg[k + 3] : w = msg[k + 3] << 24 | msg[k + 2] << 16 | msg[k + 1] << 8 | msg[k], res[i] = w >>> 0;\n }\n return res;\n }\n exports.join32 = join32;\n function split32(msg, endian) {\n for (var res = new @Array(msg.length * 4), i = 0, k = 0;i < msg.length; i++, k += 4) {\n var m = msg[i];\n endian === \"big\" \? (res[k] = m >>> 24, res[k + 1] = m >>> 16 & 255, res[k + 2] = m >>> 8 & 255, res[k + 3] = m & 255) : (res[k + 3] = m >>> 24, res[k + 2] = m >>> 16 & 255, res[k + 1] = m >>> 8 & 255, res[k] = m & 255);\n }\n return res;\n }\n exports.split32 = split32;\n function rotr32(w, b) {\n return w >>> b | w << 32 - b;\n }\n exports.rotr32 = rotr32;\n function rotl32(w, b) {\n return w << b | w >>> 32 - b;\n }\n exports.rotl32 = rotl32;\n function sum32(a, b) {\n return a + b >>> 0;\n }\n exports.sum32 = sum32;\n function sum32_3(a, b, c) {\n return a + b + c >>> 0;\n }\n exports.sum32_3 = sum32_3;\n function sum32_4(a, b, c, d) {\n return a + b + c + d >>> 0;\n }\n exports.sum32_4 = sum32_4;\n function sum32_5(a, b, c, d, e) {\n return a + b + c + d + e >>> 0;\n }\n exports.sum32_5 = sum32_5;\n function sum64(buf, pos, ah, al) {\n var bh = buf[pos], bl = buf[pos + 1], lo = al + bl >>> 0, hi = (lo < al \? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0, buf[pos + 1] = lo;\n }\n exports.sum64 = sum64;\n function sum64_hi(ah, al, bh, bl) {\n var lo = al + bl >>> 0, hi = (lo < al \? 1 : 0) + ah + bh;\n return hi >>> 0;\n }\n exports.sum64_hi = sum64_hi;\n function sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n }\n exports.sum64_lo = sum64_lo;\n function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0, lo = al;\n lo = lo + bl >>> 0, carry += lo < al \? 1 : 0, lo = lo + cl >>> 0, carry += lo < cl \? 1 : 0, lo = lo + dl >>> 0, carry += lo < dl \? 1 : 0;\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n }\n exports.sum64_4_hi = sum64_4_hi;\n function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n }\n exports.sum64_4_lo = sum64_4_lo;\n function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0, lo = al;\n lo = lo + bl >>> 0, carry += lo < al \? 1 : 0, lo = lo + cl >>> 0, carry += lo < cl \? 1 : 0, lo = lo + dl >>> 0, carry += lo < dl \? 1 : 0, lo = lo + el >>> 0, carry += lo < el \? 1 : 0;\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n }\n exports.sum64_5_hi = sum64_5_hi;\n function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n return lo >>> 0;\n }\n exports.sum64_5_lo = sum64_5_lo;\n function rotr64_hi(ah, al, num) {\n var r = al << 32 - num | ah >>> num;\n return r >>> 0;\n }\n exports.rotr64_hi = rotr64_hi;\n function rotr64_lo(ah, al, num) {\n var r = ah << 32 - num | al >>> num;\n return r >>> 0;\n }\n exports.rotr64_lo = rotr64_lo;\n function shr64_hi(ah, al, num) {\n return ah >>> num;\n }\n exports.shr64_hi = shr64_hi;\n function shr64_lo(ah, al, num) {\n var r = ah << 32 - num | al >>> num;\n return r >>> 0;\n }\n exports.shr64_lo = shr64_lo;\n }\n}), require_common = __commonJS({\n \"node_modules/hash.js/lib/hash/common.js\"(exports) {\n var utils = require_utils4(), assert = require_minimalistic_assert();\n function BlockHash() {\n this.pending = null, this.pendingTotal = 0, this.blockSize = this.constructor.blockSize, this.outSize = this.constructor.outSize, this.hmacStrength = this.constructor.hmacStrength, this.padLength = this.constructor.padLength / 8, this.endian = \"big\", this._delta8 = this.blockSize / 8, this._delta32 = this.blockSize / 32;\n }\n BlockHash.prototype = {}, exports.BlockHash = BlockHash, BlockHash.prototype.update = function(msg, enc) {\n if (msg = utils.toArray(msg, enc), this.pending \? this.pending = this.pending.concat(msg) : this.pending = msg, this.pendingTotal += msg.length, this.pending.length >= this._delta8) {\n msg = this.pending;\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length), this.pending.length === 0 && (this.pending = null), msg = utils.join32(msg, 0, msg.length - r, this.endian);\n for (var i = 0;i < msg.length; i += this._delta32)\n this._update(msg, i, i + this._delta32);\n }\n return this;\n }, BlockHash.prototype.digest = function(enc) {\n return this.update(this._pad()), assert(this.pending === null), this._digest(enc);\n }, BlockHash.prototype._pad = function() {\n var len = this.pendingTotal, bytes = this._delta8, k = bytes - (len + this.padLength) % bytes, res = new @Array(k + this.padLength);\n res[0] = 128;\n for (var i = 1;i < k; i++)\n res[i] = 0;\n if (len <<= 3, this.endian === \"big\") {\n for (var t = 8;t < this.padLength; t++)\n res[i++] = 0;\n res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = len >>> 24 & 255, res[i++] = len >>> 16 & 255, res[i++] = len >>> 8 & 255, res[i++] = len & 255;\n } else\n for (res[i++] = len & 255, res[i++] = len >>> 8 & 255, res[i++] = len >>> 16 & 255, res[i++] = len >>> 24 & 255, res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = 0, t = 8;t < this.padLength; t++)\n res[i++] = 0;\n return res;\n };\n }\n}), require_common2 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/common.js\"(exports) {\n var utils = require_utils4(), rotr32 = utils.rotr32;\n function ft_1(s, x, y, z) {\n if (s === 0)\n return ch32(x, y, z);\n if (s === 1 || s === 3)\n return p32(x, y, z);\n if (s === 2)\n return maj32(x, y, z);\n }\n exports.ft_1 = ft_1;\n function ch32(x, y, z) {\n return x & y ^ ~x & z;\n }\n exports.ch32 = ch32;\n function maj32(x, y, z) {\n return x & y ^ x & z ^ y & z;\n }\n exports.maj32 = maj32;\n function p32(x, y, z) {\n return x ^ y ^ z;\n }\n exports.p32 = p32;\n function s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n }\n exports.s0_256 = s0_256;\n function s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n }\n exports.s1_256 = s1_256;\n function g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ x >>> 3;\n }\n exports.g0_256 = g0_256;\n function g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ x >>> 10;\n }\n exports.g1_256 = g1_256;\n }\n}), require__ = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/1.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), shaCommon = require_common2(), rotl32 = utils.rotl32, sum32 = utils.sum32, sum32_5 = utils.sum32_5, ft_1 = shaCommon.ft_1, BlockHash = common.BlockHash, sha1_K = [1518500249, 1859775393, 2400959708, 3395469782];\n function SHA1() {\n if (!(this instanceof SHA1))\n return new SHA1;\n BlockHash.@call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.W = new @Array(80);\n }\n utils.inherits(SHA1, BlockHash), module.exports = SHA1, SHA1.blockSize = 512, SHA1.outSize = 160, SHA1.hmacStrength = 80, SHA1.padLength = 64, SHA1.prototype._update = function(msg, start) {\n for (var W = this.W, i = 0;i < 16; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i++)\n W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n var a = this.h[0], b = this.h[1], c = this.h[2], d = this.h[3], e = this.h[4];\n for (i = 0;i < W.length; i++) {\n var s = ~~(i / 20), t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n e = d, d = c, c = rotl32(b, 30), b = a, a = t;\n }\n this.h[0] = sum32(this.h[0], a), this.h[1] = sum32(this.h[1], b), this.h[2] = sum32(this.h[2], c), this.h[3] = sum32(this.h[3], d), this.h[4] = sum32(this.h[4], e);\n }, SHA1.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n }\n}), require__2 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/256.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), shaCommon = require_common2(), assert = require_minimalistic_assert(), sum32 = utils.sum32, sum32_4 = utils.sum32_4, sum32_5 = utils.sum32_5, ch32 = shaCommon.ch32, maj32 = shaCommon.maj32, s0_256 = shaCommon.s0_256, s1_256 = shaCommon.s1_256, g0_256 = shaCommon.g0_256, g1_256 = shaCommon.g1_256, BlockHash = common.BlockHash, sha256_K = [\n 1116352408,\n 1899447441,\n 3049323471,\n 3921009573,\n 961987163,\n 1508970993,\n 2453635748,\n 2870763221,\n 3624381080,\n 310598401,\n 607225278,\n 1426881987,\n 1925078388,\n 2162078206,\n 2614888103,\n 3248222580,\n 3835390401,\n 4022224774,\n 264347078,\n 604807628,\n 770255983,\n 1249150122,\n 1555081692,\n 1996064986,\n 2554220882,\n 2821834349,\n 2952996808,\n 3210313671,\n 3336571891,\n 3584528711,\n 113926993,\n 338241895,\n 666307205,\n 773529912,\n 1294757372,\n 1396182291,\n 1695183700,\n 1986661051,\n 2177026350,\n 2456956037,\n 2730485921,\n 2820302411,\n 3259730800,\n 3345764771,\n 3516065817,\n 3600352804,\n 4094571909,\n 275423344,\n 430227734,\n 506948616,\n 659060556,\n 883997877,\n 958139571,\n 1322822218,\n 1537002063,\n 1747873779,\n 1955562222,\n 2024104815,\n 2227730452,\n 2361852424,\n 2428436474,\n 2756734187,\n 3204031479,\n 3329325298\n ];\n function SHA256() {\n if (!(this instanceof SHA256))\n return new SHA256;\n BlockHash.@call(this), this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], this.k = sha256_K, this.W = new @Array(64);\n }\n utils.inherits(SHA256, BlockHash), module.exports = SHA256, SHA256.blockSize = 512, SHA256.outSize = 256, SHA256.hmacStrength = 192, SHA256.padLength = 64, SHA256.prototype._update = function(msg, start) {\n for (var W = this.W, i = 0;i < 16; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i++)\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n var a = this.h[0], b = this.h[1], c = this.h[2], d = this.h[3], e = this.h[4], f = this.h[5], g = this.h[6], h = this.h[7];\n for (assert(this.k.length === W.length), i = 0;i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]), T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g, g = f, f = e, e = sum32(d, T1), d = c, c = b, b = a, a = sum32(T1, T2);\n }\n this.h[0] = sum32(this.h[0], a), this.h[1] = sum32(this.h[1], b), this.h[2] = sum32(this.h[2], c), this.h[3] = sum32(this.h[3], d), this.h[4] = sum32(this.h[4], e), this.h[5] = sum32(this.h[5], f), this.h[6] = sum32(this.h[6], g), this.h[7] = sum32(this.h[7], h);\n }, SHA256.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n }\n}), require__3 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/224.js\"(exports, module) {\n var utils = require_utils4(), SHA256 = require__2();\n function SHA224() {\n if (!(this instanceof SHA224))\n return new SHA224;\n SHA256.@call(this), this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428];\n }\n utils.inherits(SHA224, SHA256), module.exports = SHA224, SHA224.blockSize = 512, SHA224.outSize = 224, SHA224.hmacStrength = 192, SHA224.padLength = 64, SHA224.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h.slice(0, 7), \"big\") : utils.split32(this.h.slice(0, 7), \"big\");\n };\n }\n}), require__4 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/512.js\"(exports, module) {\n var utils = require_utils4(), common = require_common(), assert = require_minimalistic_assert(), rotr64_hi = utils.rotr64_hi, rotr64_lo = utils.rotr64_lo, shr64_hi = utils.shr64_hi, shr64_lo = utils.shr64_lo, sum64 = utils.sum64, sum64_hi = utils.sum64_hi, sum64_lo = utils.sum64_lo, sum64_4_hi = utils.sum64_4_hi, sum64_4_lo = utils.sum64_4_lo, sum64_5_hi = utils.sum64_5_hi, sum64_5_lo = utils.sum64_5_lo, BlockHash = common.BlockHash, sha512_K = [\n 1116352408,\n 3609767458,\n 1899447441,\n 602891725,\n 3049323471,\n 3964484399,\n 3921009573,\n 2173295548,\n 961987163,\n 4081628472,\n 1508970993,\n 3053834265,\n 2453635748,\n 2937671579,\n 2870763221,\n 3664609560,\n 3624381080,\n 2734883394,\n 310598401,\n 1164996542,\n 607225278,\n 1323610764,\n 1426881987,\n 3590304994,\n 1925078388,\n 4068182383,\n 2162078206,\n 991336113,\n 2614888103,\n 633803317,\n 3248222580,\n 3479774868,\n 3835390401,\n 2666613458,\n 4022224774,\n 944711139,\n 264347078,\n 2341262773,\n 604807628,\n 2007800933,\n 770255983,\n 1495990901,\n 1249150122,\n 1856431235,\n 1555081692,\n 3175218132,\n 1996064986,\n 2198950837,\n 2554220882,\n 3999719339,\n 2821834349,\n 766784016,\n 2952996808,\n 2566594879,\n 3210313671,\n 3203337956,\n 3336571891,\n 1034457026,\n 3584528711,\n 2466948901,\n 113926993,\n 3758326383,\n 338241895,\n 168717936,\n 666307205,\n 1188179964,\n 773529912,\n 1546045734,\n 1294757372,\n 1522805485,\n 1396182291,\n 2643833823,\n 1695183700,\n 2343527390,\n 1986661051,\n 1014477480,\n 2177026350,\n 1206759142,\n 2456956037,\n 344077627,\n 2730485921,\n 1290863460,\n 2820302411,\n 3158454273,\n 3259730800,\n 3505952657,\n 3345764771,\n 106217008,\n 3516065817,\n 3606008344,\n 3600352804,\n 1432725776,\n 4094571909,\n 1467031594,\n 275423344,\n 851169720,\n 430227734,\n 3100823752,\n 506948616,\n 1363258195,\n 659060556,\n 3750685593,\n 883997877,\n 3785050280,\n 958139571,\n 3318307427,\n 1322822218,\n 3812723403,\n 1537002063,\n 2003034995,\n 1747873779,\n 3602036899,\n 1955562222,\n 1575990012,\n 2024104815,\n 1125592928,\n 2227730452,\n 2716904306,\n 2361852424,\n 442776044,\n 2428436474,\n 593698344,\n 2756734187,\n 3733110249,\n 3204031479,\n 2999351573,\n 3329325298,\n 3815920427,\n 3391569614,\n 3928383900,\n 3515267271,\n 566280711,\n 3940187606,\n 3454069534,\n 4118630271,\n 4000239992,\n 116418474,\n 1914138554,\n 174292421,\n 2731055270,\n 289380356,\n 3203993006,\n 460393269,\n 320620315,\n 685471733,\n 587496836,\n 852142971,\n 1086792851,\n 1017036298,\n 365543100,\n 1126000580,\n 2618297676,\n 1288033470,\n 3409855158,\n 1501505948,\n 4234509866,\n 1607167915,\n 987167468,\n 1816402316,\n 1246189591\n ];\n function SHA512() {\n if (!(this instanceof SHA512))\n return new SHA512;\n BlockHash.@call(this), this.h = [\n 1779033703,\n 4089235720,\n 3144134277,\n 2227873595,\n 1013904242,\n 4271175723,\n 2773480762,\n 1595750129,\n 1359893119,\n 2917565137,\n 2600822924,\n 725511199,\n 528734635,\n 4215389547,\n 1541459225,\n 327033209\n ], this.k = sha512_K, this.W = new @Array(160);\n }\n utils.inherits(SHA512, BlockHash), module.exports = SHA512, SHA512.blockSize = 1024, SHA512.outSize = 512, SHA512.hmacStrength = 192, SHA512.padLength = 128, SHA512.prototype._prepareBlock = function(msg, start) {\n for (var W = this.W, i = 0;i < 32; i++)\n W[i] = msg[start + i];\n for (;i < W.length; i += 2) {\n var c0_hi = g1_512_hi(W[i - 4], W[i - 3]), c0_lo = g1_512_lo(W[i - 4], W[i - 3]), c1_hi = W[i - 14], c1_lo = W[i - 13], c2_hi = g0_512_hi(W[i - 30], W[i - 29]), c2_lo = g0_512_lo(W[i - 30], W[i - 29]), c3_hi = W[i - 32], c3_lo = W[i - 31];\n W[i] = sum64_4_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo), W[i + 1] = sum64_4_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo);\n }\n }, SHA512.prototype._update = function(msg, start) {\n this._prepareBlock(msg, start);\n var W = this.W, ah = this.h[0], al = this.h[1], bh = this.h[2], bl = this.h[3], ch = this.h[4], cl = this.h[5], dh = this.h[6], dl = this.h[7], eh = this.h[8], el = this.h[9], fh = this.h[10], fl = this.h[11], gh = this.h[12], gl = this.h[13], hh = this.h[14], hl = this.h[15];\n assert(this.k.length === W.length);\n for (var i = 0;i < W.length; i += 2) {\n var c0_hi = hh, c0_lo = hl, c1_hi = s1_512_hi(eh, el), c1_lo = s1_512_lo(eh, el), c2_hi = ch64_hi(eh, el, fh, fl, gh, gl), c2_lo = ch64_lo(eh, el, fh, fl, gh, gl), c3_hi = this.k[i], c3_lo = this.k[i + 1], c4_hi = W[i], c4_lo = W[i + 1], T1_hi = sum64_5_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo), T1_lo = sum64_5_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo);\n c0_hi = s0_512_hi(ah, al), c0_lo = s0_512_lo(ah, al), c1_hi = maj64_hi(ah, al, bh, bl, ch, cl), c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo), T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n hh = gh, hl = gl, gh = fh, gl = fl, fh = eh, fl = el, eh = sum64_hi(dh, dl, T1_hi, T1_lo), el = sum64_lo(dl, dl, T1_hi, T1_lo), dh = ch, dl = cl, ch = bh, cl = bl, bh = ah, bl = al, ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo), al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n }\n sum64(this.h, 0, ah, al), sum64(this.h, 2, bh, bl), sum64(this.h, 4, ch, cl), sum64(this.h, 6, dh, dl), sum64(this.h, 8, eh, el), sum64(this.h, 10, fh, fl), sum64(this.h, 12, gh, gl), sum64(this.h, 14, hh, hl);\n }, SHA512.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"big\") : utils.split32(this.h, \"big\");\n };\n function ch64_hi(xh, xl, yh, yl, zh) {\n var r = xh & yh ^ ~xh & zh;\n return r < 0 && (r += 4294967296), r;\n }\n function ch64_lo(xh, xl, yh, yl, zh, zl) {\n var r = xl & yl ^ ~xl & zl;\n return r < 0 && (r += 4294967296), r;\n }\n function maj64_hi(xh, xl, yh, yl, zh) {\n var r = xh & yh ^ xh & zh ^ yh & zh;\n return r < 0 && (r += 4294967296), r;\n }\n function maj64_lo(xh, xl, yh, yl, zh, zl) {\n var r = xl & yl ^ xl & zl ^ yl & zl;\n return r < 0 && (r += 4294967296), r;\n }\n function s0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 28), c1_hi = rotr64_hi(xl, xh, 2), c2_hi = rotr64_hi(xl, xh, 7), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function s0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 28), c1_lo = rotr64_lo(xl, xh, 2), c2_lo = rotr64_lo(xl, xh, 7), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function s1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 14), c1_hi = rotr64_hi(xh, xl, 18), c2_hi = rotr64_hi(xl, xh, 9), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function s1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 14), c1_lo = rotr64_lo(xh, xl, 18), c2_lo = rotr64_lo(xl, xh, 9), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function g0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 1), c1_hi = rotr64_hi(xh, xl, 8), c2_hi = shr64_hi(xh, xl, 7), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function g0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 1), c1_lo = rotr64_lo(xh, xl, 8), c2_lo = shr64_lo(xh, xl, 7), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n function g1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 19), c1_hi = rotr64_hi(xl, xh, 29), c2_hi = shr64_hi(xh, xl, 6), r = c0_hi ^ c1_hi ^ c2_hi;\n return r < 0 && (r += 4294967296), r;\n }\n function g1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 19), c1_lo = rotr64_lo(xl, xh, 29), c2_lo = shr64_lo(xh, xl, 6), r = c0_lo ^ c1_lo ^ c2_lo;\n return r < 0 && (r += 4294967296), r;\n }\n }\n}), require__5 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha/384.js\"(exports, module) {\n var utils = require_utils4(), SHA512 = require__4();\n function SHA384() {\n if (!(this instanceof SHA384))\n return new SHA384;\n SHA512.@call(this), this.h = [\n 3418070365,\n 3238371032,\n 1654270250,\n 914150663,\n 2438529370,\n 812702999,\n 355462360,\n 4144912697,\n 1731405415,\n 4290775857,\n 2394180231,\n 1750603025,\n 3675008525,\n 1694076839,\n 1203062813,\n 3204075428\n ];\n }\n utils.inherits(SHA384, SHA512), module.exports = SHA384, SHA384.blockSize = 1024, SHA384.outSize = 384, SHA384.hmacStrength = 192, SHA384.padLength = 128, SHA384.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h.slice(0, 12), \"big\") : utils.split32(this.h.slice(0, 12), \"big\");\n };\n }\n}), require_sha3 = __commonJS({\n \"node_modules/hash.js/lib/hash/sha.js\"(exports) {\n exports.sha1 = require__(), exports.sha224 = require__3(), exports.sha256 = require__2(), exports.sha384 = require__5(), exports.sha512 = require__4();\n }\n}), require_ripemd = __commonJS({\n \"node_modules/hash.js/lib/hash/ripemd.js\"(exports) {\n var utils = require_utils4(), common = require_common(), rotl32 = utils.rotl32, sum32 = utils.sum32, sum32_3 = utils.sum32_3, sum32_4 = utils.sum32_4, BlockHash = common.BlockHash;\n function RIPEMD160() {\n if (!(this instanceof RIPEMD160))\n return new RIPEMD160;\n BlockHash.@call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = \"little\";\n }\n utils.inherits(RIPEMD160, BlockHash), exports.ripemd160 = RIPEMD160, RIPEMD160.blockSize = 512, RIPEMD160.outSize = 160, RIPEMD160.hmacStrength = 192, RIPEMD160.padLength = 64, RIPEMD160.prototype._update = function(msg, start) {\n for (var A = this.h[0], B = this.h[1], C = this.h[2], D = this.h[3], E = this.h[4], Ah = A, Bh = B, Ch = C, Dh = D, Eh = E, j = 0;j < 80; j++) {\n var T = sum32(rotl32(sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), s[j]), E);\n A = E, E = D, D = rotl32(C, 10), C = B, B = T, T = sum32(rotl32(sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), sh[j]), Eh), Ah = Eh, Eh = Dh, Dh = rotl32(Ch, 10), Ch = Bh, Bh = T;\n }\n T = sum32_3(this.h[1], C, Dh), this.h[1] = sum32_3(this.h[2], D, Eh), this.h[2] = sum32_3(this.h[3], E, Ah), this.h[3] = sum32_3(this.h[4], A, Bh), this.h[4] = sum32_3(this.h[0], B, Ch), this.h[0] = T;\n }, RIPEMD160.prototype._digest = function(enc) {\n return enc === \"hex\" \? utils.toHex32(this.h, \"little\") : utils.split32(this.h, \"little\");\n };\n function f(j, x, y, z) {\n return j <= 15 \? x ^ y ^ z : j <= 31 \? x & y | ~x & z : j <= 47 \? (x | ~y) ^ z : j <= 63 \? x & z | y & ~z : x ^ (y | ~z);\n }\n function K(j) {\n return j <= 15 \? 0 : j <= 31 \? 1518500249 : j <= 47 \? 1859775393 : j <= 63 \? 2400959708 : 2840853838;\n }\n function Kh(j) {\n return j <= 15 \? 1352829926 : j <= 31 \? 1548603684 : j <= 47 \? 1836072691 : j <= 63 \? 2053994217 : 0;\n }\n var r = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 7,\n 4,\n 13,\n 1,\n 10,\n 6,\n 15,\n 3,\n 12,\n 0,\n 9,\n 5,\n 2,\n 14,\n 11,\n 8,\n 3,\n 10,\n 14,\n 4,\n 9,\n 15,\n 8,\n 1,\n 2,\n 7,\n 0,\n 6,\n 13,\n 11,\n 5,\n 12,\n 1,\n 9,\n 11,\n 10,\n 0,\n 8,\n 12,\n 4,\n 13,\n 3,\n 7,\n 15,\n 14,\n 5,\n 6,\n 2,\n 4,\n 0,\n 5,\n 9,\n 7,\n 12,\n 2,\n 10,\n 14,\n 1,\n 3,\n 8,\n 11,\n 6,\n 15,\n 13\n ], rh = [\n 5,\n 14,\n 7,\n 0,\n 9,\n 2,\n 11,\n 4,\n 13,\n 6,\n 15,\n 8,\n 1,\n 10,\n 3,\n 12,\n 6,\n 11,\n 3,\n 7,\n 0,\n 13,\n 5,\n 10,\n 14,\n 15,\n 8,\n 12,\n 4,\n 9,\n 1,\n 2,\n 15,\n 5,\n 1,\n 3,\n 7,\n 14,\n 6,\n 9,\n 11,\n 8,\n 12,\n 2,\n 10,\n 0,\n 4,\n 13,\n 8,\n 6,\n 4,\n 1,\n 3,\n 11,\n 15,\n 0,\n 5,\n 12,\n 2,\n 13,\n 9,\n 7,\n 10,\n 14,\n 12,\n 15,\n 10,\n 4,\n 1,\n 5,\n 8,\n 7,\n 6,\n 2,\n 13,\n 14,\n 0,\n 3,\n 9,\n 11\n ], s = [\n 11,\n 14,\n 15,\n 12,\n 5,\n 8,\n 7,\n 9,\n 11,\n 13,\n 14,\n 15,\n 6,\n 7,\n 9,\n 8,\n 7,\n 6,\n 8,\n 13,\n 11,\n 9,\n 7,\n 15,\n 7,\n 12,\n 15,\n 9,\n 11,\n 7,\n 13,\n 12,\n 11,\n 13,\n 6,\n 7,\n 14,\n 9,\n 13,\n 15,\n 14,\n 8,\n 13,\n 6,\n 5,\n 12,\n 7,\n 5,\n 11,\n 12,\n 14,\n 15,\n 14,\n 15,\n 9,\n 8,\n 9,\n 14,\n 5,\n 6,\n 8,\n 6,\n 5,\n 12,\n 9,\n 15,\n 5,\n 11,\n 6,\n 8,\n 13,\n 12,\n 5,\n 12,\n 13,\n 14,\n 11,\n 8,\n 5,\n 6\n ], sh = [\n 8,\n 9,\n 9,\n 11,\n 13,\n 15,\n 15,\n 5,\n 7,\n 7,\n 8,\n 11,\n 14,\n 14,\n 12,\n 6,\n 9,\n 13,\n 15,\n 7,\n 12,\n 8,\n 9,\n 11,\n 7,\n 7,\n 12,\n 7,\n 6,\n 15,\n 13,\n 11,\n 9,\n 7,\n 15,\n 11,\n 8,\n 6,\n 6,\n 14,\n 12,\n 13,\n 5,\n 14,\n 13,\n 13,\n 7,\n 5,\n 15,\n 5,\n 8,\n 11,\n 14,\n 14,\n 6,\n 14,\n 6,\n 9,\n 12,\n 9,\n 12,\n 5,\n 15,\n 8,\n 8,\n 5,\n 12,\n 9,\n 12,\n 5,\n 14,\n 6,\n 8,\n 13,\n 6,\n 5,\n 15,\n 13,\n 11,\n 11\n ];\n }\n}), require_hmac = __commonJS({\n \"node_modules/hash.js/lib/hash/hmac.js\"(exports, module) {\n var utils = require_utils4(), assert = require_minimalistic_assert();\n function Hmac(hash, key2, enc) {\n if (key2 = exportIfKeyObject(key2), !(this instanceof Hmac))\n return new Hmac(hash, key2, enc);\n this.Hash = hash, this.blockSize = hash.blockSize / 8, this.outSize = hash.outSize / 8, this.inner = null, this.outer = null, this._init(utils.toArray(key2, enc));\n }\n Hmac.prototype = {}, module.exports = Hmac, Hmac.prototype._init = function(key2) {\n key2.length > this.blockSize && (key2 = new this.Hash().update(key2).digest()), assert(key2.length <= this.blockSize);\n for (var i = key2.length;i < this.blockSize; i++)\n key2.push(0);\n for (i = 0;i < key2.length; i++)\n key2[i] ^= 54;\n for (this.inner = new this.Hash().update(key2), i = 0;i < key2.length; i++)\n key2[i] ^= 106;\n this.outer = new this.Hash().update(key2);\n }, Hmac.prototype.update = function(msg, enc) {\n return this.inner.update(msg, enc), this;\n }, Hmac.prototype.digest = function(enc) {\n return this.outer.update(this.inner.digest()), this.outer.digest(enc);\n };\n }\n}), require_hash2 = __commonJS({\n \"node_modules/hash.js/lib/hash.js\"(exports) {\n var hash = exports;\n hash.utils = require_utils4(), hash.common = require_common(), hash.sha = require_sha3(), hash.ripemd = require_ripemd(), hash.hmac = require_hmac(), hash.sha1 = hash.sha.sha1, hash.sha256 = hash.sha.sha256, hash.sha224 = hash.sha.sha224, hash.sha384 = hash.sha.sha384, hash.sha512 = hash.sha.sha512, hash.ripemd160 = hash.ripemd.ripemd160;\n }\n}), require_secp256k1 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js\"(exports, module) {\n module.exports = {\n doubles: {\n step: 4,\n points: [\n [\n \"e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a\",\n \"f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821\"\n ],\n [\n \"8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508\",\n \"11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf\"\n ],\n [\n \"175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739\",\n \"d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695\"\n ],\n [\n \"363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640\",\n \"4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9\"\n ],\n [\n \"8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c\",\n \"4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36\"\n ],\n [\n \"723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda\",\n \"96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f\"\n ],\n [\n \"eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa\",\n \"5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999\"\n ],\n [\n \"100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0\",\n \"cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09\"\n ],\n [\n \"e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d\",\n \"9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d\"\n ],\n [\n \"feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d\",\n \"e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088\"\n ],\n [\n \"da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1\",\n \"9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d\"\n ],\n [\n \"53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0\",\n \"5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8\"\n ],\n [\n \"8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047\",\n \"10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a\"\n ],\n [\n \"385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862\",\n \"283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453\"\n ],\n [\n \"6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7\",\n \"7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160\"\n ],\n [\n \"3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd\",\n \"56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0\"\n ],\n [\n \"85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83\",\n \"7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6\"\n ],\n [\n \"948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a\",\n \"53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589\"\n ],\n [\n \"6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8\",\n \"bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17\"\n ],\n [\n \"e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d\",\n \"4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda\"\n ],\n [\n \"e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725\",\n \"7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd\"\n ],\n [\n \"213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754\",\n \"4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2\"\n ],\n [\n \"4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c\",\n \"17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6\"\n ],\n [\n \"fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6\",\n \"6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f\"\n ],\n [\n \"76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39\",\n \"c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01\"\n ],\n [\n \"c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891\",\n \"893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3\"\n ],\n [\n \"d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b\",\n \"febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f\"\n ],\n [\n \"b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03\",\n \"2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7\"\n ],\n [\n \"e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d\",\n \"eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78\"\n ],\n [\n \"a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070\",\n \"7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1\"\n ],\n [\n \"90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4\",\n \"e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150\"\n ],\n [\n \"8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da\",\n \"662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82\"\n ],\n [\n \"e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11\",\n \"1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc\"\n ],\n [\n \"8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e\",\n \"efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b\"\n ],\n [\n \"e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41\",\n \"2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51\"\n ],\n [\n \"b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef\",\n \"67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45\"\n ],\n [\n \"d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8\",\n \"db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120\"\n ],\n [\n \"324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d\",\n \"648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84\"\n ],\n [\n \"4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96\",\n \"35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d\"\n ],\n [\n \"9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd\",\n \"ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d\"\n ],\n [\n \"6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5\",\n \"9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8\"\n ],\n [\n \"a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266\",\n \"40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8\"\n ],\n [\n \"7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71\",\n \"34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac\"\n ],\n [\n \"928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac\",\n \"c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f\"\n ],\n [\n \"85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751\",\n \"1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962\"\n ],\n [\n \"ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e\",\n \"493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907\"\n ],\n [\n \"827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241\",\n \"c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec\"\n ],\n [\n \"eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3\",\n \"be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d\"\n ],\n [\n \"e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f\",\n \"4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414\"\n ],\n [\n \"1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19\",\n \"aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd\"\n ],\n [\n \"146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be\",\n \"b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0\"\n ],\n [\n \"fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9\",\n \"6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811\"\n ],\n [\n \"da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2\",\n \"8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1\"\n ],\n [\n \"a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13\",\n \"7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c\"\n ],\n [\n \"174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c\",\n \"ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73\"\n ],\n [\n \"959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba\",\n \"2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd\"\n ],\n [\n \"d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151\",\n \"e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405\"\n ],\n [\n \"64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073\",\n \"d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589\"\n ],\n [\n \"8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458\",\n \"38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e\"\n ],\n [\n \"13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b\",\n \"69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27\"\n ],\n [\n \"bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366\",\n \"d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1\"\n ],\n [\n \"8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa\",\n \"40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482\"\n ],\n [\n \"8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0\",\n \"620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945\"\n ],\n [\n \"dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787\",\n \"7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573\"\n ],\n [\n \"f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e\",\n \"ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82\"\n ]\n ]\n },\n naf: {\n wnd: 7,\n points: [\n [\n \"f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9\",\n \"388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672\"\n ],\n [\n \"2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4\",\n \"d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6\"\n ],\n [\n \"5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc\",\n \"6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da\"\n ],\n [\n \"acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe\",\n \"cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37\"\n ],\n [\n \"774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb\",\n \"d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b\"\n ],\n [\n \"f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8\",\n \"ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81\"\n ],\n [\n \"d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e\",\n \"581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58\"\n ],\n [\n \"defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34\",\n \"4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77\"\n ],\n [\n \"2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c\",\n \"85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a\"\n ],\n [\n \"352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5\",\n \"321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c\"\n ],\n [\n \"2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f\",\n \"2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67\"\n ],\n [\n \"9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714\",\n \"73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402\"\n ],\n [\n \"daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729\",\n \"a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55\"\n ],\n [\n \"c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db\",\n \"2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482\"\n ],\n [\n \"6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4\",\n \"e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82\"\n ],\n [\n \"1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5\",\n \"b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396\"\n ],\n [\n \"605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479\",\n \"2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49\"\n ],\n [\n \"62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d\",\n \"80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf\"\n ],\n [\n \"80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f\",\n \"1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a\"\n ],\n [\n \"7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb\",\n \"d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7\"\n ],\n [\n \"d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9\",\n \"eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933\"\n ],\n [\n \"49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963\",\n \"758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a\"\n ],\n [\n \"77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74\",\n \"958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6\"\n ],\n [\n \"f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530\",\n \"e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37\"\n ],\n [\n \"463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b\",\n \"5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e\"\n ],\n [\n \"f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247\",\n \"cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6\"\n ],\n [\n \"caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1\",\n \"cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476\"\n ],\n [\n \"2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120\",\n \"4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40\"\n ],\n [\n \"7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435\",\n \"91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61\"\n ],\n [\n \"754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18\",\n \"673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683\"\n ],\n [\n \"e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8\",\n \"59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5\"\n ],\n [\n \"186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb\",\n \"3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b\"\n ],\n [\n \"df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f\",\n \"55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417\"\n ],\n [\n \"5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143\",\n \"efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868\"\n ],\n [\n \"290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba\",\n \"e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a\"\n ],\n [\n \"af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45\",\n \"f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6\"\n ],\n [\n \"766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a\",\n \"744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996\"\n ],\n [\n \"59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e\",\n \"c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e\"\n ],\n [\n \"f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8\",\n \"e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d\"\n ],\n [\n \"7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c\",\n \"30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2\"\n ],\n [\n \"948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519\",\n \"e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e\"\n ],\n [\n \"7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab\",\n \"100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437\"\n ],\n [\n \"3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca\",\n \"ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311\"\n ],\n [\n \"d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf\",\n \"8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4\"\n ],\n [\n \"1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610\",\n \"68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575\"\n ],\n [\n \"733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4\",\n \"f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d\"\n ],\n [\n \"15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c\",\n \"d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d\"\n ],\n [\n \"a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940\",\n \"edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629\"\n ],\n [\n \"e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980\",\n \"a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06\"\n ],\n [\n \"311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3\",\n \"66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374\"\n ],\n [\n \"34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf\",\n \"9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee\"\n ],\n [\n \"f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63\",\n \"4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1\"\n ],\n [\n \"d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448\",\n \"fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b\"\n ],\n [\n \"32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf\",\n \"5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661\"\n ],\n [\n \"7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5\",\n \"8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6\"\n ],\n [\n \"ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6\",\n \"8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e\"\n ],\n [\n \"16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5\",\n \"5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d\"\n ],\n [\n \"eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99\",\n \"f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc\"\n ],\n [\n \"78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51\",\n \"f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4\"\n ],\n [\n \"494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5\",\n \"42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c\"\n ],\n [\n \"a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5\",\n \"204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b\"\n ],\n [\n \"c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997\",\n \"4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913\"\n ],\n [\n \"841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881\",\n \"73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154\"\n ],\n [\n \"5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5\",\n \"39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865\"\n ],\n [\n \"36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66\",\n \"d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc\"\n ],\n [\n \"336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726\",\n \"ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224\"\n ],\n [\n \"8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede\",\n \"6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e\"\n ],\n [\n \"1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94\",\n \"60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6\"\n ],\n [\n \"85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31\",\n \"3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511\"\n ],\n [\n \"29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51\",\n \"b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b\"\n ],\n [\n \"a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252\",\n \"ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2\"\n ],\n [\n \"4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5\",\n \"cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c\"\n ],\n [\n \"d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b\",\n \"6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3\"\n ],\n [\n \"ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4\",\n \"322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d\"\n ],\n [\n \"af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f\",\n \"6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700\"\n ],\n [\n \"e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889\",\n \"2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4\"\n ],\n [\n \"591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246\",\n \"b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196\"\n ],\n [\n \"11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984\",\n \"998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4\"\n ],\n [\n \"3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a\",\n \"b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257\"\n ],\n [\n \"cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030\",\n \"bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13\"\n ],\n [\n \"c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197\",\n \"6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096\"\n ],\n [\n \"c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593\",\n \"c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38\"\n ],\n [\n \"a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef\",\n \"21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f\"\n ],\n [\n \"347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38\",\n \"60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448\"\n ],\n [\n \"da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a\",\n \"49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a\"\n ],\n [\n \"c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111\",\n \"5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4\"\n ],\n [\n \"4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502\",\n \"7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437\"\n ],\n [\n \"3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea\",\n \"be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7\"\n ],\n [\n \"cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26\",\n \"8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d\"\n ],\n [\n \"b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986\",\n \"39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a\"\n ],\n [\n \"d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e\",\n \"62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54\"\n ],\n [\n \"48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4\",\n \"25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77\"\n ],\n [\n \"dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda\",\n \"ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517\"\n ],\n [\n \"6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859\",\n \"cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10\"\n ],\n [\n \"e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f\",\n \"f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125\"\n ],\n [\n \"eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c\",\n \"6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e\"\n ],\n [\n \"13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942\",\n \"fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1\"\n ],\n [\n \"ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a\",\n \"1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2\"\n ],\n [\n \"b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80\",\n \"5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423\"\n ],\n [\n \"ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d\",\n \"438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8\"\n ],\n [\n \"8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1\",\n \"cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758\"\n ],\n [\n \"52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63\",\n \"c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375\"\n ],\n [\n \"e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352\",\n \"6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d\"\n ],\n [\n \"7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193\",\n \"ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec\"\n ],\n [\n \"5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00\",\n \"9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0\"\n ],\n [\n \"32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58\",\n \"ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c\"\n ],\n [\n \"e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7\",\n \"d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4\"\n ],\n [\n \"8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8\",\n \"c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f\"\n ],\n [\n \"4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e\",\n \"67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649\"\n ],\n [\n \"3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d\",\n \"cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826\"\n ],\n [\n \"674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b\",\n \"299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5\"\n ],\n [\n \"d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f\",\n \"f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87\"\n ],\n [\n \"30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6\",\n \"462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b\"\n ],\n [\n \"be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297\",\n \"62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc\"\n ],\n [\n \"93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a\",\n \"7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c\"\n ],\n [\n \"b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c\",\n \"ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f\"\n ],\n [\n \"d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52\",\n \"4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a\"\n ],\n [\n \"d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb\",\n \"bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46\"\n ],\n [\n \"463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065\",\n \"bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f\"\n ],\n [\n \"7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917\",\n \"603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03\"\n ],\n [\n \"74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9\",\n \"cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08\"\n ],\n [\n \"30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3\",\n \"553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8\"\n ],\n [\n \"9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57\",\n \"712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373\"\n ],\n [\n \"176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66\",\n \"ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3\"\n ],\n [\n \"75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8\",\n \"9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8\"\n ],\n [\n \"809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721\",\n \"9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1\"\n ],\n [\n \"1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180\",\n \"4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9\"\n ]\n ]\n }\n };\n }\n}), require_curves = __commonJS({\n \"node_modules/elliptic/lib/elliptic/curves.js\"(exports) {\n var curves = exports, hash = require_hash2(), curve = require_curve(), utils = require_utils3(), assert = utils.assert;\n function PresetCurve(options) {\n options.type === \"short\" \? this.curve = new curve.short(options) : options.type === \"edwards\" \? this.curve = new curve.edwards(options) : this.curve = new curve.mont(options), this.g = this.curve.g, this.n = this.curve.n, this.hash = options.hash, assert(this.g.validate(), \"Invalid curve\"), assert(this.g.mul(this.n).isInfinity(), \"Invalid curve, G*N != O\");\n }\n PresetCurve.prototype = {}, curves.PresetCurve = PresetCurve;\n function defineCurve(name, options) {\n Object.defineProperty(curves, name, {\n configurable: !0,\n enumerable: !0,\n get: function() {\n var curve2 = new PresetCurve(options);\n return Object.defineProperty(curves, name, {\n configurable: !0,\n enumerable: !0,\n value: curve2\n }), curve2;\n }\n });\n }\n defineCurve(\"p192\", {\n type: \"short\",\n prime: \"p192\",\n p: \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\",\n a: \"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc\",\n b: \"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1\",\n n: \"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012\",\n \"07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811\"\n ]\n }), defineCurve(\"p224\", {\n type: \"short\",\n prime: \"p224\",\n p: \"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\",\n a: \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe\",\n b: \"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4\",\n n: \"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21\",\n \"bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34\"\n ]\n }), defineCurve(\"p256\", {\n type: \"short\",\n prime: null,\n p: \"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff\",\n a: \"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc\",\n b: \"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b\",\n n: \"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296\",\n \"4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5\"\n ]\n }), defineCurve(\"p384\", {\n type: \"short\",\n prime: null,\n p: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff\",\n a: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc\",\n b: \"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef\",\n n: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973\",\n hash: hash.sha384,\n gRed: !1,\n g: [\n \"aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7\",\n \"3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f\"\n ]\n }), defineCurve(\"p521\", {\n type: \"short\",\n prime: null,\n p: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff\",\n a: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc\",\n b: \"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00\",\n n: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409\",\n hash: hash.sha512,\n gRed: !1,\n g: [\n \"000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66\",\n \"00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650\"\n ]\n }), defineCurve(\"curve25519\", {\n type: \"mont\",\n prime: \"p25519\",\n p: \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",\n a: \"76d06\",\n b: \"1\",\n n: \"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",\n hash: hash.sha256,\n gRed: !1,\n g: [\"9\"]\n }), defineCurve(\"ed25519\", {\n type: \"edwards\",\n prime: \"p25519\",\n p: \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",\n a: \"-1\",\n c: \"1\",\n d: \"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3\",\n n: \"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",\n hash: hash.sha256,\n gRed: !1,\n g: [\n \"216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a\",\n \"6666666666666666666666666666666666666666666666666666666666666658\"\n ]\n });\n var pre;\n try {\n pre = require_secp256k1();\n } catch {\n pre = void 0;\n }\n defineCurve(\"secp256k1\", {\n type: \"short\",\n prime: \"k256\",\n p: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\",\n a: \"0\",\n b: \"7\",\n n: \"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141\",\n h: \"1\",\n hash: hash.sha256,\n beta: \"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\",\n lambda: \"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72\",\n basis: [\n {\n a: \"3086d221a7d46bcde86c90e49284eb15\",\n b: \"-e4437ed6010e88286f547fa90abfe4c3\"\n },\n {\n a: \"114ca50f7a8e2f3f657c1108d9d44cfd8\",\n b: \"3086d221a7d46bcde86c90e49284eb15\"\n }\n ],\n gRed: !1,\n g: [\n \"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\",\n \"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n pre\n ]\n });\n }\n}), require_hmac_drbg = __commonJS({\n \"node_modules/hmac-drbg/lib/hmac-drbg.js\"(exports, module) {\n var hash = require_hash2(), utils = require_utils2(), assert = require_minimalistic_assert();\n function HmacDRBG(options) {\n if (!(this instanceof HmacDRBG))\n return new HmacDRBG(options);\n this.hash = options.hash, this.predResist = !!options.predResist, this.outLen = this.hash.outSize, this.minEntropy = options.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null;\n var entropy = utils.toArray(options.entropy, options.entropyEnc || \"hex\"), nonce = utils.toArray(options.nonce, options.nonceEnc || \"hex\"), pers = utils.toArray(options.pers, options.persEnc || \"hex\");\n assert(entropy.length >= this.minEntropy / 8, \"Not enough entropy. Minimum is: \" + this.minEntropy + \" bits\"), this._init(entropy, nonce, pers);\n }\n HmacDRBG.prototype = {}, module.exports = HmacDRBG, HmacDRBG.prototype._init = function(entropy, nonce, pers) {\n var seed = entropy.concat(nonce).concat(pers);\n this.K = new @Array(this.outLen / 8), this.V = new @Array(this.outLen / 8);\n for (var i = 0;i < this.V.length; i++)\n this.K[i] = 0, this.V[i] = 1;\n this._update(seed), this._reseed = 1, this.reseedInterval = 281474976710656;\n }, HmacDRBG.prototype._hmac = function() {\n return new hash.hmac(this.hash, this.K);\n }, HmacDRBG.prototype._update = function(seed) {\n var kmac = this._hmac().update(this.V).update([0]);\n seed && (kmac = kmac.update(seed)), this.K = kmac.digest(), this.V = this._hmac().update(this.V).digest(), seed && (this.K = this._hmac().update(this.V).update([1]).update(seed).digest(), this.V = this._hmac().update(this.V).digest());\n }, HmacDRBG.prototype.reseed = function(entropy, entropyEnc, add, addEnc) {\n typeof entropyEnc != \"string\" && (addEnc = add, add = entropyEnc, entropyEnc = null), entropy = utils.toArray(entropy, entropyEnc), add = utils.toArray(add, addEnc), assert(entropy.length >= this.minEntropy / 8, \"Not enough entropy. Minimum is: \" + this.minEntropy + \" bits\"), this._update(entropy.concat(add || [])), this._reseed = 1;\n }, HmacDRBG.prototype.generate = function(len, enc, add, addEnc) {\n if (this._reseed > this.reseedInterval)\n throw new Error(\"Reseed is required\");\n typeof enc != \"string\" && (addEnc = add, add = enc, enc = null), add && (add = utils.toArray(add, addEnc || \"hex\"), this._update(add));\n for (var temp = [];temp.length < len; )\n this.V = this._hmac().update(this.V).digest(), temp = temp.concat(this.V);\n var res = temp.slice(0, len);\n return this._update(add), this._reseed++, utils.encode(res, enc);\n };\n }\n}), require_key = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/key.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert;\n function KeyPair(ec, options) {\n this.ec = ec, this.priv = null, this.pub = null, options.priv && this._importPrivate(options.priv, options.privEnc), options.pub && this._importPublic(options.pub, options.pubEnc);\n }\n KeyPair.prototype = {}, module.exports = KeyPair, KeyPair.fromPublic = function(ec, pub, enc) {\n return pub instanceof KeyPair \? pub : new KeyPair(ec, {\n pub,\n pubEnc: enc\n });\n }, KeyPair.fromPrivate = function(ec, priv, enc) {\n return priv instanceof KeyPair \? priv : new KeyPair(ec, {\n priv,\n privEnc: enc\n });\n }, KeyPair.prototype.validate = function() {\n var pub = this.getPublic();\n return pub.isInfinity() \? { result: !1, reason: \"Invalid public key\" } : pub.validate() \? pub.mul(this.ec.curve.n).isInfinity() \? { result: !0, reason: null } : { result: !1, reason: \"Public key * N != O\" } : { result: !1, reason: \"Public key is not a point\" };\n }, KeyPair.prototype.getPublic = function(compact, enc) {\n return typeof compact == \"string\" && (enc = compact, compact = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), enc \? this.pub.encode(enc, compact) : this.pub;\n }, KeyPair.prototype.getPrivate = function(enc) {\n return enc === \"hex\" \? this.priv.toString(16, 2) : this.priv;\n }, KeyPair.prototype._importPrivate = function(key2, enc) {\n this.priv = new BN(key2, enc || 16), this.priv = this.priv.umod(this.ec.curve.n);\n }, KeyPair.prototype._importPublic = function(key2, enc) {\n if (key2.x || key2.y) {\n this.ec.curve.type === \"mont\" \? assert(key2.x, \"Need x coordinate\") : (this.ec.curve.type === \"short\" || this.ec.curve.type === \"edwards\") && assert(key2.x && key2.y, \"Need both x and y coordinate\"), this.pub = this.ec.curve.point(key2.x, key2.y);\n return;\n }\n this.pub = this.ec.curve.decodePoint(key2, enc);\n }, KeyPair.prototype.derive = function(pub) {\n return pub.validate() || assert(pub.validate(), \"public point not validated\"), pub.mul(this.priv).getX();\n }, KeyPair.prototype.sign = function(msg, enc, options) {\n return this.ec.sign(msg, this, enc, options);\n }, KeyPair.prototype.verify = function(msg, signature) {\n return this.ec.verify(msg, signature, this);\n }, KeyPair.prototype.inspect = function() {\n return \"<Key priv: \" + (this.priv && this.priv.toString(16, 2)) + \" pub: \" + (this.pub && this.pub.inspect()) + \" >\";\n };\n }\n}), require_signature = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/signature.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert;\n function Signature(options, enc) {\n if (options instanceof Signature)\n return options;\n this._importDER(options, enc) || (assert(options.r && options.s, \"Signature without r or s\"), this.r = new BN(options.r, 16), this.s = new BN(options.s, 16), options.recoveryParam === void 0 \? this.recoveryParam = null : this.recoveryParam = options.recoveryParam);\n }\n Signature.prototype = {}, module.exports = Signature;\n function Position() {\n this.place = 0;\n }\n function getLength(buf, p) {\n var initial = buf[p.place++];\n if (!(initial & 128))\n return initial;\n var octetLen = initial & 15;\n if (octetLen === 0 || octetLen > 4)\n return !1;\n for (var val = 0, i = 0, off = p.place;i < octetLen; i++, off++)\n val <<= 8, val |= buf[off], val >>>= 0;\n return val <= 127 \? !1 : (p.place = off, val);\n }\n function rmPadding(buf) {\n for (var i = 0, len = buf.length - 1;!buf[i] && !(buf[i + 1] & 128) && i < len; )\n i++;\n return i === 0 \? buf : buf.slice(i);\n }\n Signature.prototype._importDER = function(data, enc) {\n data = utils.toArray(data, enc);\n var p = new Position;\n if (data[p.place++] !== 48)\n return !1;\n var len = getLength(data, p);\n if (len === !1 || len + p.place !== data.length || data[p.place++] !== 2)\n return !1;\n var rlen = getLength(data, p);\n if (rlen === !1)\n return !1;\n var r = data.slice(p.place, rlen + p.place);\n if (p.place += rlen, data[p.place++] !== 2)\n return !1;\n var slen = getLength(data, p);\n if (slen === !1 || data.length !== slen + p.place)\n return !1;\n var s = data.slice(p.place, slen + p.place);\n if (r[0] === 0)\n if (r[1] & 128)\n r = r.slice(1);\n else\n return !1;\n if (s[0] === 0)\n if (s[1] & 128)\n s = s.slice(1);\n else\n return !1;\n return this.r = new BN(r), this.s = new BN(s), this.recoveryParam = null, !0;\n };\n function constructLength(arr, len) {\n if (len < 128) {\n arr.push(len);\n return;\n }\n var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n for (arr.push(octets | 128);--octets; )\n arr.push(len >>> (octets << 3) & 255);\n arr.push(len);\n }\n Signature.prototype.toDER = function(enc) {\n var r = this.r.toArray(), s = this.s.toArray();\n for (r[0] & 128 && (r = [0].concat(r)), s[0] & 128 && (s = [0].concat(s)), r = rmPadding(r), s = rmPadding(s);!s[0] && !(s[1] & 128); )\n s = s.slice(1);\n var arr = [2];\n constructLength(arr, r.length), arr = arr.concat(r), arr.push(2), constructLength(arr, s.length);\n var backHalf = arr.concat(s), res = [48];\n return constructLength(res, backHalf.length), res = res.concat(backHalf), utils.encode(res, enc);\n };\n }\n}), require_ec = __commonJS({\n \"node_modules/elliptic/lib/elliptic/ec/index.js\"(exports, module) {\n var BN = require_bn4(), HmacDRBG = require_hmac_drbg(), utils = require_utils3(), curves = require_curves(), rand = require_brorand(), assert = utils.assert, KeyPair = require_key(), Signature = require_signature();\n function EC(options) {\n if (!(this instanceof EC))\n return new EC(options);\n typeof options == \"string\" && (assert(Object.prototype.hasOwnProperty.@call(curves, options), \"Unknown curve \" + options), options = curves[options]), options instanceof curves.PresetCurve && (options = { curve: options }), this.curve = options.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = options.curve.g, this.g.precompute(options.curve.n.bitLength() + 1), this.hash = options.hash || options.curve.hash;\n }\n EC.prototype = {}, module.exports = EC, EC.prototype.keyPair = function(options) {\n return new KeyPair(this, options);\n }, EC.prototype.keyFromPrivate = function(priv, enc) {\n return KeyPair.fromPrivate(this, priv, enc);\n }, EC.prototype.keyFromPublic = function(pub, enc) {\n return KeyPair.fromPublic(this, pub, enc);\n }, EC.prototype.genKeyPair = function(options) {\n options || (options = {});\n for (var drbg = new HmacDRBG({\n hash: this.hash,\n pers: options.pers,\n persEnc: options.persEnc || \"utf8\",\n entropy: options.entropy || rand(this.hash.hmacStrength),\n entropyEnc: options.entropy && options.entropyEnc || \"utf8\",\n nonce: this.n.toArray()\n }), bytes = this.n.byteLength(), ns2 = this.n.sub(new BN(2));; ) {\n var priv = new BN(drbg.generate(bytes));\n if (!(priv.cmp(ns2) > 0))\n return priv.iaddn(1), this.keyFromPrivate(priv);\n }\n }, EC.prototype._truncateToN = function(msg, truncOnly) {\n var delta = msg.byteLength() * 8 - this.n.bitLength();\n return delta > 0 && (msg = msg.ushrn(delta)), !truncOnly && msg.cmp(this.n) >= 0 \? msg.sub(this.n) : msg;\n }, EC.prototype.sign = function(msg, key2, enc, options) {\n typeof enc == \"object\" && (options = enc, enc = null), options || (options = {}), key2 = this.keyFromPrivate(key2, enc), msg = this._truncateToN(new BN(msg, 16));\n for (var bytes = this.n.byteLength(), bkey = key2.getPrivate().toArray(\"be\", bytes), nonce = msg.toArray(\"be\", bytes), drbg = new HmacDRBG({\n hash: this.hash,\n entropy: bkey,\n nonce,\n pers: options.pers,\n persEnc: options.persEnc || \"utf8\"\n }), ns1 = this.n.sub(new BN(1)), iter = 0;; iter++) {\n var k = options.k \? options.k(iter) : new BN(drbg.generate(this.n.byteLength()));\n if (k = this._truncateToN(k, !0), !(k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)) {\n var kp = this.g.mul(k);\n if (!kp.isInfinity()) {\n var kpX = kp.getX(), r = kpX.umod(this.n);\n if (r.cmpn(0) !== 0) {\n var s = k.invm(this.n).mul(r.mul(key2.getPrivate()).iadd(msg));\n if (s = s.umod(this.n), s.cmpn(0) !== 0) {\n var recoveryParam = (kp.getY().isOdd() \? 1 : 0) | (kpX.cmp(r) !== 0 \? 2 : 0);\n return options.canonical && s.cmp(this.nh) > 0 && (s = this.n.sub(s), recoveryParam ^= 1), new Signature({ r, s, recoveryParam });\n }\n }\n }\n }\n }\n }, EC.prototype.verify = function(msg, signature, key2, enc) {\n msg = this._truncateToN(new BN(msg, 16)), key2 = this.keyFromPublic(key2, enc), signature = new Signature(signature, \"hex\");\n var { r, s } = signature;\n if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0 || s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n return !1;\n var sinv = s.invm(this.n), u1 = sinv.mul(msg).umod(this.n), u2 = sinv.mul(r).umod(this.n), p;\n return this.curve._maxwellTrick \? (p = this.g.jmulAdd(u1, key2.getPublic(), u2), p.isInfinity() \? !1 : p.eqXToP(r)) : (p = this.g.mulAdd(u1, key2.getPublic(), u2), p.isInfinity() \? !1 : p.getX().umod(this.n).cmp(r) === 0);\n }, EC.prototype.recoverPubKey = function(msg, signature, j, enc) {\n assert((3 & j) === j, \"The recovery param is more than two bits\"), signature = new Signature(signature, enc);\n var n = this.n, e = new BN(msg), r = signature.r, s = signature.s, isYOdd = j & 1, isSecondKey = j >> 1;\n if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n throw new Error(\"Unable to find sencond key candinate\");\n isSecondKey \? r = this.curve.pointFromX(r.add(this.curve.n), isYOdd) : r = this.curve.pointFromX(r, isYOdd);\n var rInv = signature.r.invm(n), s1 = n.sub(e).mul(rInv).umod(n), s2 = s.mul(rInv).umod(n);\n return this.g.mulAdd(s1, r, s2);\n }, EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {\n if (signature = new Signature(signature, enc), signature.recoveryParam !== null)\n return signature.recoveryParam;\n for (var i = 0;i < 4; i++) {\n var Qprime;\n try {\n Qprime = this.recoverPubKey(e, signature, i);\n } catch {\n continue;\n }\n if (Qprime.eq(Q))\n return i;\n }\n throw new Error(\"Unable to find valid recovery factor\");\n };\n }\n}), require_key2 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/key.js\"(exports, module) {\n var utils = require_utils3(), assert = utils.assert, parseBytes = utils.parseBytes, cachedProperty = utils.cachedProperty;\n function KeyPair(eddsa, params) {\n this.eddsa = eddsa, this._secret = parseBytes(params.secret), eddsa.isPoint(params.pub) \? this._pub = params.pub : this._pubBytes = parseBytes(params.pub);\n }\n KeyPair.prototype = {}, KeyPair.fromPublic = function(eddsa, pub) {\n return pub instanceof KeyPair \? pub : new KeyPair(eddsa, { pub });\n }, KeyPair.fromSecret = function(eddsa, secret) {\n return secret instanceof KeyPair \? secret : new KeyPair(eddsa, { secret });\n }, KeyPair.prototype.secret = function() {\n return this._secret;\n }, cachedProperty(KeyPair, \"pubBytes\", function() {\n return this.eddsa.encodePoint(this.pub());\n }), cachedProperty(KeyPair, \"pub\", function() {\n return this._pubBytes \? this.eddsa.decodePoint(this._pubBytes) : this.eddsa.g.mul(this.priv());\n }), cachedProperty(KeyPair, \"privBytes\", function() {\n var eddsa = this.eddsa, hash = this.hash(), lastIx = eddsa.encodingLength - 1, a = hash.slice(0, eddsa.encodingLength);\n return a[0] &= 248, a[lastIx] &= 127, a[lastIx] |= 64, a;\n }), cachedProperty(KeyPair, \"priv\", function() {\n return this.eddsa.decodeInt(this.privBytes());\n }), cachedProperty(KeyPair, \"hash\", function() {\n return this.eddsa.hash().update(this.secret()).digest();\n }), cachedProperty(KeyPair, \"messagePrefix\", function() {\n return this.hash().slice(this.eddsa.encodingLength);\n }), KeyPair.prototype.sign = function(message) {\n return assert(this._secret, \"KeyPair can only verify\"), this.eddsa.sign(message, this);\n }, KeyPair.prototype.verify = function(message, sig) {\n return this.eddsa.verify(message, sig, this);\n }, KeyPair.prototype.getSecret = function(enc) {\n return assert(this._secret, \"KeyPair is public only\"), utils.encode(this.secret(), enc);\n }, KeyPair.prototype.getPublic = function(enc) {\n return utils.encode(this.pubBytes(), enc);\n }, module.exports = KeyPair;\n }\n}), require_signature2 = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/signature.js\"(exports, module) {\n var BN = require_bn4(), utils = require_utils3(), assert = utils.assert, cachedProperty = utils.cachedProperty, parseBytes = utils.parseBytes;\n function Signature(eddsa, sig) {\n this.eddsa = eddsa, typeof sig != \"object\" && (sig = parseBytes(sig)), @Array.isArray(sig) && (sig = {\n R: sig.slice(0, eddsa.encodingLength),\n S: sig.slice(eddsa.encodingLength)\n }), assert(sig.R && sig.S, \"Signature without R or S\"), eddsa.isPoint(sig.R) && (this._R = sig.R), sig.S instanceof BN && (this._S = sig.S), this._Rencoded = @Array.isArray(sig.R) \? sig.R : sig.Rencoded, this._Sencoded = @Array.isArray(sig.S) \? sig.S : sig.Sencoded;\n }\n Signature.prototype = {}, cachedProperty(Signature, \"S\", function() {\n return this.eddsa.decodeInt(this.Sencoded());\n }), cachedProperty(Signature, \"R\", function() {\n return this.eddsa.decodePoint(this.Rencoded());\n }), cachedProperty(Signature, \"Rencoded\", function() {\n return this.eddsa.encodePoint(this.R());\n }), cachedProperty(Signature, \"Sencoded\", function() {\n return this.eddsa.encodeInt(this.S());\n }), Signature.prototype.toBytes = function() {\n return this.Rencoded().concat(this.Sencoded());\n }, Signature.prototype.toHex = function() {\n return utils.encode(this.toBytes(), \"hex\").toUpperCase();\n }, module.exports = Signature;\n }\n}), require_eddsa = __commonJS({\n \"node_modules/elliptic/lib/elliptic/eddsa/index.js\"(exports, module) {\n var hash = require_hash2(), curves = require_curves(), utils = require_utils3(), assert = utils.assert, parseBytes = utils.parseBytes, KeyPair = require_key2(), Signature = require_signature2();\n function EDDSA(curve) {\n if (assert(curve === \"ed25519\", \"only tested with ed25519 so far\"), !(this instanceof EDDSA))\n return new EDDSA(curve);\n curve = curves[curve].curve, this.curve = curve, this.g = curve.g, this.g.precompute(curve.n.bitLength() + 1), this.pointClass = curve.point().constructor, this.encodingLength = Math.ceil(curve.n.bitLength() / 8), this.hash = hash.sha512;\n }\n EDDSA.prototype = {}, module.exports = EDDSA, EDDSA.prototype.sign = function(message, secret) {\n message = parseBytes(message);\n var key2 = this.keyFromSecret(secret), r = this.hashInt(key2.messagePrefix(), message), R = this.g.mul(r), Rencoded = this.encodePoint(R), s_ = this.hashInt(Rencoded, key2.pubBytes(), message).mul(key2.priv()), S = r.add(s_).umod(this.curve.n);\n return this.makeSignature({ R, S, Rencoded });\n }, EDDSA.prototype.verify = function(message, sig, pub) {\n message = parseBytes(message), sig = this.makeSignature(sig);\n var key2 = this.keyFromPublic(pub), h = this.hashInt(sig.Rencoded(), key2.pubBytes(), message), SG = this.g.mul(sig.S()), RplusAh = sig.R().add(key2.pub().mul(h));\n return RplusAh.eq(SG);\n }, EDDSA.prototype.hashInt = function() {\n for (var hash2 = this.hash(), i = 0;i < arguments.length; i++)\n hash2.update(arguments[i]);\n return utils.intFromLE(hash2.digest()).umod(this.curve.n);\n }, EDDSA.prototype.keyFromPublic = function(pub) {\n return KeyPair.fromPublic(this, pub);\n }, EDDSA.prototype.keyFromSecret = function(secret) {\n return KeyPair.fromSecret(this, secret);\n }, EDDSA.prototype.makeSignature = function(sig) {\n return sig instanceof Signature \? sig : new Signature(this, sig);\n }, EDDSA.prototype.encodePoint = function(point) {\n var enc = point.getY().toArray(\"le\", this.encodingLength);\n return enc[this.encodingLength - 1] |= point.getX().isOdd() \? 128 : 0, enc;\n }, EDDSA.prototype.decodePoint = function(bytes) {\n bytes = utils.parseBytes(bytes);\n var lastIx = bytes.length - 1, normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & -129), xIsOdd = (bytes[lastIx] & 128) !== 0, y = utils.intFromLE(normed);\n return this.curve.pointFromY(y, xIsOdd);\n }, EDDSA.prototype.encodeInt = function(num) {\n return num.toArray(\"le\", this.encodingLength);\n }, EDDSA.prototype.decodeInt = function(bytes) {\n return utils.intFromLE(bytes);\n }, EDDSA.prototype.isPoint = function(val) {\n return val instanceof this.pointClass;\n };\n }\n}), require_elliptic = __commonJS({\n \"node_modules/elliptic/lib/elliptic.js\"(exports) {\n var elliptic = exports;\n elliptic.version = require_package().version, elliptic.utils = require_utils3(), elliptic.rand = require_brorand(), elliptic.curve = require_curve(), elliptic.curves = require_curves(), elliptic.ec = require_ec(), elliptic.eddsa = require_eddsa();\n }\n}), require_bn5 = require_bn, require_safer = __commonJS({\n \"node_modules/safer-buffer/safer.js\"(exports, module) {\n var buffer = BufferModule, Buffer2 = Buffer, safer = {}, key2;\n for (key2 in buffer)\n !buffer.hasOwnProperty(key2) || key2 === \"SlowBuffer\" || key2 === \"Buffer\" || (safer[key2] = buffer[key2]);\n var Safer = safer.Buffer = {};\n for (key2 in Buffer2)\n !Buffer2.hasOwnProperty(key2) || key2 === \"allocUnsafe\" || key2 === \"allocUnsafeSlow\" || (Safer[key2] = Buffer2[key2]);\n if (safer.Buffer.prototype = Buffer2.prototype, (!Safer.from || Safer.from === @Uint8Array.from) && (Safer.from = function(value, encodingOrOffset, length) {\n if (typeof value == \"number\")\n @throwTypeError('The \"value\" argument must not be of type number. Received type ' + typeof value);\n if (value && typeof value.length > \"u\")\n @throwTypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \" + typeof value);\n return Buffer2(value, encodingOrOffset, length);\n }), Safer.alloc || (Safer.alloc = function(size, fill, encoding) {\n if (typeof size != \"number\")\n @throwTypeError('The \"size\" argument must be of type number. Received type ' + typeof size);\n if (size < 0 || size >= 2 * (1 << 30))\n @throwRangeError('The value \"' + size + '\" is invalid for option \"size\"');\n var buf = Buffer2(size);\n return !fill || fill.length === 0 \? buf.fill(0) : typeof encoding == \"string\" \? buf.fill(fill, encoding) : buf.fill(fill), buf;\n }), !safer.kStringMaxLength)\n try {\n safer.kStringMaxLength = MAX_STRING_LENGTH;\n } catch {\n }\n safer.constants || (safer.constants = {\n MAX_LENGTH: safer.kMaxLength\n }, safer.kStringMaxLength && (safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength)), module.exports = safer;\n }\n}), require_reporter = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/reporter.js\"(exports) {\n var inherits = require_inherits_browser();\n function Reporter(options) {\n this._reporterState = {\n obj: null,\n path: [],\n options: options || {},\n errors: []\n };\n }\n Reporter.prototype = {}, exports.Reporter = Reporter, Reporter.prototype.isError = function(obj) {\n return obj instanceof ReporterError;\n }, Reporter.prototype.save = function() {\n let state = this._reporterState;\n return { obj: state.obj, pathLen: state.path.length };\n }, Reporter.prototype.restore = function(data) {\n let state = this._reporterState;\n state.obj = data.obj, state.path = state.path.slice(0, data.pathLen);\n }, Reporter.prototype.enterKey = function(key2) {\n return this._reporterState.path.push(key2);\n }, Reporter.prototype.exitKey = function(index) {\n let state = this._reporterState;\n state.path = state.path.slice(0, index - 1);\n }, Reporter.prototype.leaveKey = function(index, key2, value) {\n let state = this._reporterState;\n this.exitKey(index), state.obj !== null && (state.obj[key2] = value);\n }, Reporter.prototype.path = function() {\n return this._reporterState.path.join(\"/\");\n }, Reporter.prototype.enterObject = function() {\n let state = this._reporterState, prev = state.obj;\n return state.obj = {}, prev;\n }, Reporter.prototype.leaveObject = function(prev) {\n let state = this._reporterState, now = state.obj;\n return state.obj = prev, now;\n }, Reporter.prototype.error = function(msg) {\n let err, state = this._reporterState, inherited = msg instanceof ReporterError;\n if (inherited \? err = msg : err = new ReporterError(state.path.map(function(elem) {\n return \"[\" + JSON.stringify(elem) + \"]\";\n }).join(\"\"), msg.message || msg, msg.stack), !state.options.partial)\n throw err;\n return inherited || state.errors.push(err), err;\n }, Reporter.prototype.wrapResult = function(result) {\n let state = this._reporterState;\n return state.options.partial \? {\n result: this.isError(result) \? null : result,\n errors: state.errors\n } : result;\n };\n function ReporterError(path, msg) {\n this.path = path, this.rethrow(msg);\n }\n inherits(ReporterError, Error), ReporterError.prototype.rethrow = function(msg) {\n if (this.message = msg + \" at: \" + (this.path || \"(shallow)\"), Error.captureStackTrace && Error.captureStackTrace(this, ReporterError), !this.stack)\n try {\n throw new Error(this.message);\n } catch (e) {\n this.stack = e.stack;\n }\n return this;\n };\n }\n}), require_buffer = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/buffer.js\"(exports) {\n var inherits = require_inherits_browser(), Reporter = require_reporter().Reporter, Buffer2 = require_safer().Buffer;\n function DecoderBuffer(base, options) {\n if (Reporter.@call(this, options), !Buffer2.isBuffer(base)) {\n this.error(\"Input not Buffer\");\n return;\n }\n this.base = base, this.offset = 0, this.length = base.length;\n }\n inherits(DecoderBuffer, Reporter), exports.DecoderBuffer = DecoderBuffer, DecoderBuffer.isDecoderBuffer = function(data) {\n return data instanceof DecoderBuffer \? !0 : typeof data == \"object\" && Buffer2.isBuffer(data.base) && data.constructor.name === \"DecoderBuffer\" && typeof data.offset == \"number\" && typeof data.length == \"number\" && typeof data.save == \"function\" && typeof data.restore == \"function\" && typeof data.isEmpty == \"function\" && typeof data.readUInt8 == \"function\" && typeof data.skip == \"function\" && typeof data.raw == \"function\";\n }, DecoderBuffer.prototype.save = function() {\n return {\n offset: this.offset,\n reporter: Reporter.prototype.save.@call(this)\n };\n }, DecoderBuffer.prototype.restore = function(save) {\n let res = new DecoderBuffer(this.base);\n return res.offset = save.offset, res.length = this.offset, this.offset = save.offset, Reporter.prototype.restore.@call(this, save.reporter), res;\n }, DecoderBuffer.prototype.isEmpty = function() {\n return this.offset === this.length;\n }, DecoderBuffer.prototype.readUInt8 = function(fail) {\n return this.offset + 1 <= this.length \? this.base.readUInt8(this.offset++, !0) : this.error(fail || \"DecoderBuffer overrun\");\n }, DecoderBuffer.prototype.skip = function(bytes, fail) {\n if (!(this.offset + bytes <= this.length))\n return this.error(fail || \"DecoderBuffer overrun\");\n let res = new DecoderBuffer(this.base);\n return res._reporterState = this._reporterState, res.offset = this.offset, res.length = this.offset + bytes, this.offset += bytes, res;\n }, DecoderBuffer.prototype.raw = function(save) {\n return this.base.slice(save \? save.offset : this.offset, this.length);\n };\n function EncoderBuffer(value, reporter) {\n if (@Array.isArray(value))\n this.length = 0, this.value = value.map(function(item) {\n return EncoderBuffer.isEncoderBuffer(item) || (item = new EncoderBuffer(item, reporter)), this.length += item.length, item;\n }, this);\n else if (typeof value == \"number\") {\n if (!(0 <= value && value <= 255))\n return reporter.error(\"non-byte EncoderBuffer value\");\n this.value = value, this.length = 1;\n } else if (typeof value == \"string\")\n this.value = value, this.length = Buffer2.byteLength(value);\n else if (Buffer2.isBuffer(value))\n this.value = value, this.length = value.length;\n else\n return reporter.error(\"Unsupported type: \" + typeof value);\n }\n EncoderBuffer.prototype = {}, exports.EncoderBuffer = EncoderBuffer, EncoderBuffer.isEncoderBuffer = function(data) {\n return data instanceof EncoderBuffer \? !0 : typeof data == \"object\" && data.constructor.name === \"EncoderBuffer\" && typeof data.length == \"number\" && typeof data.join == \"function\";\n }, EncoderBuffer.prototype.join = function(out, offset) {\n return out || (out = Buffer2.alloc(this.length)), offset || (offset = 0), this.length === 0 || (@Array.isArray(this.value) \? this.value.forEach(function(item) {\n item.join(out, offset), offset += item.length;\n }) : (typeof this.value == \"number\" \? out[offset] = this.value : typeof this.value == \"string\" \? out.write(this.value, offset) : Buffer2.isBuffer(this.value) && this.value.copy(out, offset), offset += this.length)), out;\n };\n }\n}), require_node = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/node.js\"(exports, module) {\n var Reporter = require_reporter().Reporter, EncoderBuffer = require_buffer().EncoderBuffer, DecoderBuffer = require_buffer().DecoderBuffer, assert = require_minimalistic_assert(), tags = [\n \"seq\",\n \"seqof\",\n \"set\",\n \"setof\",\n \"objid\",\n \"bool\",\n \"gentime\",\n \"utctime\",\n \"null_\",\n \"enum\",\n \"int\",\n \"objDesc\",\n \"bitstr\",\n \"bmpstr\",\n \"charstr\",\n \"genstr\",\n \"graphstr\",\n \"ia5str\",\n \"iso646str\",\n \"numstr\",\n \"octstr\",\n \"printstr\",\n \"t61str\",\n \"unistr\",\n \"utf8str\",\n \"videostr\"\n ], methods = [\"key\", \"obj\", \"use\", \"optional\", \"explicit\", \"implicit\", \"def\", \"choice\", \"any\", \"contains\"].concat(tags), overrided = [\n \"_peekTag\",\n \"_decodeTag\",\n \"_use\",\n \"_decodeStr\",\n \"_decodeObjid\",\n \"_decodeTime\",\n \"_decodeNull\",\n \"_decodeInt\",\n \"_decodeBool\",\n \"_decodeList\",\n \"_encodeComposite\",\n \"_encodeStr\",\n \"_encodeObjid\",\n \"_encodeTime\",\n \"_encodeNull\",\n \"_encodeInt\",\n \"_encodeBool\"\n ];\n function Node(enc, parent, name) {\n let state = {};\n this._baseState = state, state.name = name, state.enc = enc, state.parent = parent || null, state.children = null, state.tag = null, state.args = null, state.reverseArgs = null, state.choice = null, state.optional = !1, state.any = !1, state.obj = !1, state.use = null, state.useDecoder = null, state.key = null, state.default = null, state.explicit = null, state.implicit = null, state.contains = null, state.parent || (state.children = [], this._wrap());\n }\n Node.prototype = {}, module.exports = Node;\n var stateProps = [\n \"enc\",\n \"parent\",\n \"children\",\n \"tag\",\n \"args\",\n \"reverseArgs\",\n \"choice\",\n \"optional\",\n \"any\",\n \"obj\",\n \"use\",\n \"alteredUse\",\n \"key\",\n \"default\",\n \"explicit\",\n \"implicit\",\n \"contains\"\n ];\n Node.prototype.clone = function() {\n let state = this._baseState, cstate = {};\n stateProps.forEach(function(prop) {\n cstate[prop] = state[prop];\n });\n let res = new this.constructor(cstate.parent);\n return res._baseState = cstate, res;\n }, Node.prototype._wrap = function() {\n let state = this._baseState;\n methods.forEach(function(method) {\n this[method] = function() {\n let clone = new this.constructor(this);\n return state.children.push(clone), clone[method].@apply(clone, arguments);\n };\n }, this);\n }, Node.prototype._init = function(body) {\n let state = this._baseState;\n assert(state.parent === null), body.@call(this), state.children = state.children.filter(function(child) {\n return child._baseState.parent === this;\n }, this), assert.equal(state.children.length, 1, \"Root node can have only one child\");\n }, Node.prototype._useArgs = function(args) {\n let state = this._baseState, children = args.filter(function(arg) {\n return arg instanceof this.constructor;\n }, this);\n args = args.filter(function(arg) {\n return !(arg instanceof this.constructor);\n }, this), children.length !== 0 && (assert(state.children === null), state.children = children, children.forEach(function(child) {\n child._baseState.parent = this;\n }, this)), args.length !== 0 && (assert(state.args === null), state.args = args, state.reverseArgs = args.map(function(arg) {\n if (typeof arg != \"object\" || arg.constructor !== Object)\n return arg;\n let res = {};\n return Object.keys(arg).forEach(function(key2) {\n key2 == (key2 | 0) && (key2 |= 0);\n let value = arg[key2];\n res[value] = key2;\n }), res;\n }));\n }, overrided.forEach(function(method) {\n Node.prototype[method] = function() {\n let state = this._baseState;\n throw new Error(method + \" not implemented for encoding: \" + state.enc);\n };\n }), tags.forEach(function(tag) {\n Node.prototype[tag] = function() {\n let state = this._baseState, args = @Array.prototype.slice.@call(arguments);\n return assert(state.tag === null), state.tag = tag, this._useArgs(args), this;\n };\n }), Node.prototype.use = function(item) {\n assert(item);\n let state = this._baseState;\n return assert(state.use === null), state.use = item, this;\n }, Node.prototype.optional = function() {\n let state = this._baseState;\n return state.optional = !0, this;\n }, Node.prototype.def = function(val) {\n let state = this._baseState;\n return assert(state.default === null), state.default = val, state.optional = !0, this;\n }, Node.prototype.explicit = function(num) {\n let state = this._baseState;\n return assert(state.explicit === null && state.implicit === null), state.explicit = num, this;\n }, Node.prototype.implicit = function(num) {\n let state = this._baseState;\n return assert(state.explicit === null && state.implicit === null), state.implicit = num, this;\n }, Node.prototype.obj = function() {\n let state = this._baseState, args = @Array.prototype.slice.@call(arguments);\n return state.obj = !0, args.length !== 0 && this._useArgs(args), this;\n }, Node.prototype.key = function(newKey) {\n let state = this._baseState;\n return assert(state.key === null), state.key = newKey, this;\n }, Node.prototype.any = function() {\n let state = this._baseState;\n return state.any = !0, this;\n }, Node.prototype.choice = function(obj) {\n let state = this._baseState;\n return assert(state.choice === null), state.choice = obj, this._useArgs(Object.keys(obj).map(function(key2) {\n return obj[key2];\n })), this;\n }, Node.prototype.contains = function(item) {\n let state = this._baseState;\n return assert(state.use === null), state.contains = item, this;\n }, Node.prototype._decode = function(input, options) {\n let state = this._baseState;\n if (state.parent === null)\n return input.wrapResult(state.children[0]._decode(input, options));\n let result = state.default, present = !0, prevKey = null;\n if (state.key !== null && (prevKey = input.enterKey(state.key)), state.optional) {\n let tag = null;\n if (state.explicit !== null \? tag = state.explicit : state.implicit !== null \? tag = state.implicit : state.tag !== null && (tag = state.tag), tag === null && !state.any) {\n let save = input.save();\n try {\n state.choice === null \? this._decodeGeneric(state.tag, input, options) : this._decodeChoice(input, options), present = !0;\n } catch {\n present = !1;\n }\n input.restore(save);\n } else if (present = this._peekTag(input, tag, state.any), input.isError(present))\n return present;\n }\n let prevObj;\n if (state.obj && present && (prevObj = input.enterObject()), present) {\n if (state.explicit !== null) {\n let explicit = this._decodeTag(input, state.explicit);\n if (input.isError(explicit))\n return explicit;\n input = explicit;\n }\n let start = input.offset;\n if (state.use === null && state.choice === null) {\n let save;\n state.any && (save = input.save());\n let body = this._decodeTag(input, state.implicit !== null \? state.implicit : state.tag, state.any);\n if (input.isError(body))\n return body;\n state.any \? result = input.raw(save) : input = body;\n }\n if (options && options.track && state.tag !== null && options.track(input.path(), start, input.length, \"tagged\"), options && options.track && state.tag !== null && options.track(input.path(), input.offset, input.length, \"content\"), state.any || (state.choice === null \? result = this._decodeGeneric(state.tag, input, options) : result = this._decodeChoice(input, options)), input.isError(result))\n return result;\n if (!state.any && state.choice === null && state.children !== null && state.children.forEach(function(child) {\n child._decode(input, options);\n }), state.contains && (state.tag === \"octstr\" || state.tag === \"bitstr\")) {\n let data = new DecoderBuffer(result);\n result = this._getUse(state.contains, input._reporterState.obj)._decode(data, options);\n }\n }\n return state.obj && present && (result = input.leaveObject(prevObj)), state.key !== null && (result !== null || present === !0) \? input.leaveKey(prevKey, state.key, result) : prevKey !== null && input.exitKey(prevKey), result;\n }, Node.prototype._decodeGeneric = function(tag, input, options) {\n let state = this._baseState;\n return tag === \"seq\" || tag === \"set\" \? null : tag === \"seqof\" || tag === \"setof\" \? this._decodeList(input, tag, state.args[0], options) : /str$/.test(tag) \? this._decodeStr(input, tag, options) : tag === \"objid\" && state.args \? this._decodeObjid(input, state.args[0], state.args[1], options) : tag === \"objid\" \? this._decodeObjid(input, null, null, options) : tag === \"gentime\" || tag === \"utctime\" \? this._decodeTime(input, tag, options) : tag === \"null_\" \? this._decodeNull(input, options) : tag === \"bool\" \? this._decodeBool(input, options) : tag === \"objDesc\" \? this._decodeStr(input, tag, options) : tag === \"int\" || tag === \"enum\" \? this._decodeInt(input, state.args && state.args[0], options) : state.use !== null \? this._getUse(state.use, input._reporterState.obj)._decode(input, options) : input.error(\"unknown tag: \" + tag);\n }, Node.prototype._getUse = function(entity, obj) {\n let state = this._baseState;\n return state.useDecoder = this._use(entity, obj), assert(state.useDecoder._baseState.parent === null), state.useDecoder = state.useDecoder._baseState.children[0], state.implicit !== state.useDecoder._baseState.implicit && (state.useDecoder = state.useDecoder.clone(), state.useDecoder._baseState.implicit = state.implicit), state.useDecoder;\n }, Node.prototype._decodeChoice = function(input, options) {\n let state = this._baseState, result = null, match = !1;\n return Object.keys(state.choice).some(function(key2) {\n let save = input.save(), node = state.choice[key2];\n try {\n let value = node._decode(input, options);\n if (input.isError(value))\n return !1;\n result = { type: key2, value }, match = !0;\n } catch {\n return input.restore(save), !1;\n }\n return !0;\n }, this), match \? result : input.error(\"Choice not matched\");\n }, Node.prototype._createEncoderBuffer = function(data) {\n return new EncoderBuffer(data, this.reporter);\n }, Node.prototype._encode = function(data, reporter, parent) {\n let state = this._baseState;\n if (state.default !== null && state.default === data)\n return;\n let result = this._encodeValue(data, reporter, parent);\n if (result !== void 0 && !this._skipDefault(result, reporter, parent))\n return result;\n }, Node.prototype._encodeValue = function(data, reporter, parent) {\n let state = this._baseState;\n if (state.parent === null)\n return state.children[0]._encode(data, reporter || new Reporter);\n let result = null;\n if (this.reporter = reporter, state.optional && data === void 0)\n if (state.default !== null)\n data = state.default;\n else\n return;\n let content = null, primitive = !1;\n if (state.any)\n result = this._createEncoderBuffer(data);\n else if (state.choice)\n result = this._encodeChoice(data, reporter);\n else if (state.contains)\n content = this._getUse(state.contains, parent)._encode(data, reporter), primitive = !0;\n else if (state.children)\n content = state.children.map(function(child) {\n if (child._baseState.tag === \"null_\")\n return child._encode(null, reporter, data);\n if (child._baseState.key === null)\n return reporter.error(\"Child should have a key\");\n let prevKey = reporter.enterKey(child._baseState.key);\n if (typeof data != \"object\")\n return reporter.error(\"Child expected, but input is not object\");\n let res = child._encode(data[child._baseState.key], reporter, data);\n return reporter.leaveKey(prevKey), res;\n }, this).filter(function(child) {\n return child;\n }), content = this._createEncoderBuffer(content);\n else if (state.tag === \"seqof\" || state.tag === \"setof\") {\n if (!(state.args && state.args.length === 1))\n return reporter.error(\"Too many args for : \" + state.tag);\n if (!@Array.isArray(data))\n return reporter.error(\"seqof/setof, but data is not Array\");\n let child = this.clone();\n child._baseState.implicit = null, content = this._createEncoderBuffer(data.map(function(item) {\n let state2 = this._baseState;\n return this._getUse(state2.args[0], data)._encode(item, reporter);\n }, child));\n } else\n state.use !== null \? result = this._getUse(state.use, parent)._encode(data, reporter) : (content = this._encodePrimitive(state.tag, data), primitive = !0);\n if (!state.any && state.choice === null) {\n let tag = state.implicit !== null \? state.implicit : state.tag, cls = state.implicit === null \? \"universal\" : \"context\";\n tag === null \? state.use === null && reporter.error(\"Tag could be omitted only for .use()\") : state.use === null && (result = this._encodeComposite(tag, primitive, cls, content));\n }\n return state.explicit !== null && (result = this._encodeComposite(state.explicit, !1, \"context\", result)), result;\n }, Node.prototype._encodeChoice = function(data, reporter) {\n let state = this._baseState, node = state.choice[data.type];\n return node || assert(!1, data.type + \" not found in \" + JSON.stringify(Object.keys(state.choice))), node._encode(data.value, reporter);\n }, Node.prototype._encodePrimitive = function(tag, data) {\n let state = this._baseState;\n if (/str$/.test(tag))\n return this._encodeStr(data, tag);\n if (tag === \"objid\" && state.args)\n return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);\n if (tag === \"objid\")\n return this._encodeObjid(data, null, null);\n if (tag === \"gentime\" || tag === \"utctime\")\n return this._encodeTime(data, tag);\n if (tag === \"null_\")\n return this._encodeNull();\n if (tag === \"int\" || tag === \"enum\")\n return this._encodeInt(data, state.args && state.reverseArgs[0]);\n if (tag === \"bool\")\n return this._encodeBool(data);\n if (tag === \"objDesc\")\n return this._encodeStr(data, tag);\n throw new Error(\"Unsupported tag: \" + tag);\n }, Node.prototype._isNumstr = function(str) {\n return /^[0-9 ]*$/.test(str);\n }, Node.prototype._isPrintstr = function(str) {\n return /^[A-Za-z0-9 '()+,-./:=\?]*$/.test(str);\n };\n }\n}), require_der = __commonJS({\n \"node_modules/asn1.js/lib/asn1/constants/der.js\"(exports) {\n function reverse(map) {\n let res = {};\n return Object.keys(map).forEach(function(key2) {\n (key2 | 0) == key2 && (key2 = key2 | 0);\n let value = map[key2];\n res[value] = key2;\n }), res;\n }\n exports.tagClass = {\n 0: \"universal\",\n 1: \"application\",\n 2: \"context\",\n 3: \"private\"\n }, exports.tagClassByName = reverse(exports.tagClass), exports.tag = {\n 0: \"end\",\n 1: \"bool\",\n 2: \"int\",\n 3: \"bitstr\",\n 4: \"octstr\",\n 5: \"null_\",\n 6: \"objid\",\n 7: \"objDesc\",\n 8: \"external\",\n 9: \"real\",\n 10: \"enum\",\n 11: \"embed\",\n 12: \"utf8str\",\n 13: \"relativeOid\",\n 16: \"seq\",\n 17: \"set\",\n 18: \"numstr\",\n 19: \"printstr\",\n 20: \"t61str\",\n 21: \"videostr\",\n 22: \"ia5str\",\n 23: \"utctime\",\n 24: \"gentime\",\n 25: \"graphstr\",\n 26: \"iso646str\",\n 27: \"genstr\",\n 28: \"unistr\",\n 29: \"charstr\",\n 30: \"bmpstr\"\n }, exports.tagByName = reverse(exports.tag);\n }\n}), require_der2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/der.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safer().Buffer, Node = require_node(), der = require_der();\n function DEREncoder(entity) {\n this.enc = \"der\", this.name = entity.name, this.entity = entity, this.tree = new DERNode, this.tree._init(entity.body);\n }\n DEREncoder.prototype = {}, module.exports = DEREncoder, DEREncoder.prototype.encode = function(data, reporter) {\n return this.tree._encode(data, reporter).join();\n };\n function DERNode(parent) {\n Node.@call(this, \"der\", parent);\n }\n inherits(DERNode, Node), DERNode.prototype._encodeComposite = function(tag, primitive, cls, content) {\n let encodedTag = encodeTag(tag, primitive, cls, this.reporter);\n if (content.length < 128) {\n let header2 = Buffer2.alloc(2);\n return header2[0] = encodedTag, header2[1] = content.length, this._createEncoderBuffer([header2, content]);\n }\n let lenOctets = 1;\n for (let i = content.length;i >= 256; i >>= 8)\n lenOctets++;\n let header = Buffer2.alloc(2 + lenOctets);\n header[0] = encodedTag, header[1] = 128 | lenOctets;\n for (let i = 1 + lenOctets, j = content.length;j > 0; i--, j >>= 8)\n header[i] = j & 255;\n return this._createEncoderBuffer([header, content]);\n }, DERNode.prototype._encodeStr = function(str, tag) {\n if (tag === \"bitstr\")\n return this._createEncoderBuffer([str.unused | 0, str.data]);\n if (tag === \"bmpstr\") {\n let buf = Buffer2.alloc(str.length * 2);\n for (let i = 0;i < str.length; i++)\n buf.writeUInt16BE(str.charCodeAt(i), i * 2);\n return this._createEncoderBuffer(buf);\n } else\n return tag === \"numstr\" \? this._isNumstr(str) \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: numstr supports only digits and space\") : tag === \"printstr\" \? this._isPrintstr(str) \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark\") : /str$/.test(tag) \? this._createEncoderBuffer(str) : tag === \"objDesc\" \? this._createEncoderBuffer(str) : this.reporter.error(\"Encoding of string type: \" + tag + \" unsupported\");\n }, DERNode.prototype._encodeObjid = function(id, values, relative) {\n if (typeof id == \"string\") {\n if (!values)\n return this.reporter.error(\"string objid given, but no values map found\");\n if (!values.hasOwnProperty(id))\n return this.reporter.error(\"objid not found in values map\");\n id = values[id].split(/[\\s.]+/g);\n for (let i = 0;i < id.length; i++)\n id[i] |= 0;\n } else if (@Array.isArray(id)) {\n id = id.slice();\n for (let i = 0;i < id.length; i++)\n id[i] |= 0;\n }\n if (!@Array.isArray(id))\n return this.reporter.error(\"objid() should be either array or string, got: \" + JSON.stringify(id));\n if (!relative) {\n if (id[1] >= 40)\n return this.reporter.error(\"Second objid identifier OOB\");\n id.splice(0, 2, id[0] * 40 + id[1]);\n }\n let size = 0;\n for (let i = 0;i < id.length; i++) {\n let ident = id[i];\n for (size++;ident >= 128; ident >>= 7)\n size++;\n }\n let objid = Buffer2.alloc(size), offset = objid.length - 1;\n for (let i = id.length - 1;i >= 0; i--) {\n let ident = id[i];\n for (objid[offset--] = ident & 127;(ident >>= 7) > 0; )\n objid[offset--] = 128 | ident & 127;\n }\n return this._createEncoderBuffer(objid);\n };\n function two(num) {\n return num < 10 \? \"0\" + num : num;\n }\n DERNode.prototype._encodeTime = function(time, tag) {\n let str, date = new Date(time);\n return tag === \"gentime\" \? str = [\n two(date.getUTCFullYear()),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n \"Z\"\n ].join(\"\") : tag === \"utctime\" \? str = [\n two(date.getUTCFullYear() % 100),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n \"Z\"\n ].join(\"\") : this.reporter.error(\"Encoding \" + tag + \" time is not supported yet\"), this._encodeStr(str, \"octstr\");\n }, DERNode.prototype._encodeNull = function() {\n return this._createEncoderBuffer(\"\");\n }, DERNode.prototype._encodeInt = function(num, values) {\n if (typeof num == \"string\") {\n if (!values)\n return this.reporter.error(\"String int or enum given, but no values map\");\n if (!values.hasOwnProperty(num))\n return this.reporter.error(\"Values map doesn't contain: \" + JSON.stringify(num));\n num = values[num];\n }\n if (typeof num != \"number\" && !Buffer2.isBuffer(num)) {\n let numArray = num.toArray();\n !num.sign && numArray[0] & 128 && numArray.unshift(0), num = Buffer2.from(numArray);\n }\n if (Buffer2.isBuffer(num)) {\n let size2 = num.length;\n num.length === 0 && size2++;\n let out2 = Buffer2.alloc(size2);\n return num.copy(out2), num.length === 0 && (out2[0] = 0), this._createEncoderBuffer(out2);\n }\n if (num < 128)\n return this._createEncoderBuffer(num);\n if (num < 256)\n return this._createEncoderBuffer([0, num]);\n let size = 1;\n for (let i = num;i >= 256; i >>= 8)\n size++;\n let out = new @Array(size);\n for (let i = out.length - 1;i >= 0; i--)\n out[i] = num & 255, num >>= 8;\n return out[0] & 128 && out.unshift(0), this._createEncoderBuffer(Buffer2.from(out));\n }, DERNode.prototype._encodeBool = function(value) {\n return this._createEncoderBuffer(value \? 255 : 0);\n }, DERNode.prototype._use = function(entity, obj) {\n return typeof entity == \"function\" && (entity = entity(obj)), entity._getEncoder(\"der\").tree;\n }, DERNode.prototype._skipDefault = function(dataBuffer, reporter, parent) {\n let state = this._baseState, i;\n if (state.default === null)\n return !1;\n let data = dataBuffer.join();\n if (state.defaultBuffer === void 0 && (state.defaultBuffer = this._encodeValue(state.default, reporter, parent).join()), data.length !== state.defaultBuffer.length)\n return !1;\n for (i = 0;i < data.length; i++)\n if (data[i] !== state.defaultBuffer[i])\n return !1;\n return !0;\n };\n function encodeTag(tag, primitive, cls, reporter) {\n let res;\n if (tag === \"seqof\" \? tag = \"seq\" : tag === \"setof\" && (tag = \"set\"), der.tagByName.hasOwnProperty(tag))\n res = der.tagByName[tag];\n else if (typeof tag == \"number\" && (tag | 0) === tag)\n res = tag;\n else\n return reporter.error(\"Unknown tag: \" + tag);\n return res >= 31 \? reporter.error(\"Multi-octet tag encoding unsupported\") : (primitive || (res |= 32), res |= der.tagClassByName[cls || \"universal\"] << 6, res);\n }\n }\n}), require_pem = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/pem.js\"(exports, module) {\n var inherits = require_inherits_browser(), DEREncoder = require_der2();\n function PEMEncoder(entity) {\n DEREncoder.@call(this, entity), this.enc = \"pem\";\n }\n inherits(PEMEncoder, DEREncoder), module.exports = PEMEncoder, PEMEncoder.prototype.encode = function(data, options) {\n let p = DEREncoder.prototype.encode.@call(this, data).toString(\"base64\"), out = [\"-----BEGIN \" + options.label + \"-----\"];\n for (let i = 0;i < p.length; i += 64)\n out.push(p.slice(i, i + 64));\n return out.push(\"-----END \" + options.label + \"-----\"), out.join(`\n`);\n };\n }\n}), require_encoders = __commonJS({\n \"node_modules/asn1.js/lib/asn1/encoders/index.js\"(exports) {\n var encoders = exports;\n encoders.der = require_der2(), encoders.pem = require_pem();\n }\n}), require_der3 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/der.js\"(exports, module) {\n var inherits = require_inherits_browser(), bignum = require_bn5(), DecoderBuffer = require_buffer().DecoderBuffer, Node = require_node(), der = require_der();\n function DERDecoder(entity) {\n this.enc = \"der\", this.name = entity.name, this.entity = entity, this.tree = new DERNode, this.tree._init(entity.body);\n }\n DERDecoder.prototype = {}, module.exports = DERDecoder, DERDecoder.prototype.decode = function(data, options) {\n return DecoderBuffer.isDecoderBuffer(data) || (data = new DecoderBuffer(data, options)), this.tree._decode(data, options);\n };\n function DERNode(parent) {\n Node.@call(this, \"der\", parent);\n }\n inherits(DERNode, Node), DERNode.prototype._peekTag = function(buffer, tag, any) {\n if (buffer.isEmpty())\n return !1;\n let state = buffer.save(), decodedTag = derDecodeTag(buffer, 'Failed to peek tag: \"' + tag + '\"');\n return buffer.isError(decodedTag) \? decodedTag : (buffer.restore(state), decodedTag.tag === tag || decodedTag.tagStr === tag || decodedTag.tagStr + \"of\" === tag || any);\n }, DERNode.prototype._decodeTag = function(buffer, tag, any) {\n let decodedTag = derDecodeTag(buffer, 'Failed to decode tag of \"' + tag + '\"');\n if (buffer.isError(decodedTag))\n return decodedTag;\n let len = derDecodeLen(buffer, decodedTag.primitive, 'Failed to get length of \"' + tag + '\"');\n if (buffer.isError(len))\n return len;\n if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + \"of\" !== tag)\n return buffer.error('Failed to match tag: \"' + tag + '\"');\n if (decodedTag.primitive || len !== null)\n return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n let state = buffer.save(), res = this._skipUntilEnd(buffer, 'Failed to skip indefinite length body: \"' + this.tag + '\"');\n return buffer.isError(res) \? res : (len = buffer.offset - state.offset, buffer.restore(state), buffer.skip(len, 'Failed to match body of: \"' + tag + '\"'));\n }, DERNode.prototype._skipUntilEnd = function(buffer, fail) {\n for (;; ) {\n let tag = derDecodeTag(buffer, fail);\n if (buffer.isError(tag))\n return tag;\n let len = derDecodeLen(buffer, tag.primitive, fail);\n if (buffer.isError(len))\n return len;\n let res;\n if (tag.primitive || len !== null \? res = buffer.skip(len) : res = this._skipUntilEnd(buffer, fail), buffer.isError(res))\n return res;\n if (tag.tagStr === \"end\")\n break;\n }\n }, DERNode.prototype._decodeList = function(buffer, tag, decoder, options) {\n let result = [];\n for (;!buffer.isEmpty(); ) {\n let possibleEnd = this._peekTag(buffer, \"end\");\n if (buffer.isError(possibleEnd))\n return possibleEnd;\n let res = decoder.decode(buffer, \"der\", options);\n if (buffer.isError(res) && possibleEnd)\n break;\n result.push(res);\n }\n return result;\n }, DERNode.prototype._decodeStr = function(buffer, tag) {\n if (tag === \"bitstr\") {\n let unused = buffer.readUInt8();\n return buffer.isError(unused) \? unused : { unused, data: buffer.raw() };\n } else if (tag === \"bmpstr\") {\n let raw = buffer.raw();\n if (raw.length % 2 === 1)\n return buffer.error(\"Decoding of string type: bmpstr length mismatch\");\n let str = \"\";\n for (let i = 0;i < raw.length / 2; i++)\n str += @String.fromCharCode(raw.readUInt16BE(i * 2));\n return str;\n } else if (tag === \"numstr\") {\n let numstr = buffer.raw().toString(\"ascii\");\n return this._isNumstr(numstr) \? numstr : buffer.error(\"Decoding of string type: numstr unsupported characters\");\n } else {\n if (tag === \"octstr\")\n return buffer.raw();\n if (tag === \"objDesc\")\n return buffer.raw();\n if (tag === \"printstr\") {\n let printstr = buffer.raw().toString(\"ascii\");\n return this._isPrintstr(printstr) \? printstr : buffer.error(\"Decoding of string type: printstr unsupported characters\");\n } else\n return /str$/.test(tag) \? buffer.raw().toString() : buffer.error(\"Decoding of string type: \" + tag + \" unsupported\");\n }\n }, DERNode.prototype._decodeObjid = function(buffer, values, relative) {\n let result, identifiers = [], ident = 0, subident = 0;\n for (;!buffer.isEmpty(); )\n subident = buffer.readUInt8(), ident <<= 7, ident |= subident & 127, (subident & 128) === 0 && (identifiers.push(ident), ident = 0);\n subident & 128 && identifiers.push(ident);\n let first = identifiers[0] / 40 | 0, second = identifiers[0] % 40;\n if (relative \? result = identifiers : result = [first, second].concat(identifiers.slice(1)), values) {\n let tmp = values[result.join(\" \")];\n tmp === void 0 && (tmp = values[result.join(\".\")]), tmp !== void 0 && (result = tmp);\n }\n return result;\n }, DERNode.prototype._decodeTime = function(buffer, tag) {\n let str = buffer.raw().toString(), year, mon, day, hour, min, sec;\n if (tag === \"gentime\")\n year = str.slice(0, 4) | 0, mon = str.slice(4, 6) | 0, day = str.slice(6, 8) | 0, hour = str.slice(8, 10) | 0, min = str.slice(10, 12) | 0, sec = str.slice(12, 14) | 0;\n else if (tag === \"utctime\")\n year = str.slice(0, 2) | 0, mon = str.slice(2, 4) | 0, day = str.slice(4, 6) | 0, hour = str.slice(6, 8) | 0, min = str.slice(8, 10) | 0, sec = str.slice(10, 12) | 0, year < 70 \? year = 2000 + year : year = 1900 + year;\n else\n return buffer.error(\"Decoding \" + tag + \" time is not supported yet\");\n return Date.UTC(year, mon - 1, day, hour, min, sec, 0);\n }, DERNode.prototype._decodeNull = function() {\n return null;\n }, DERNode.prototype._decodeBool = function(buffer) {\n let res = buffer.readUInt8();\n return buffer.isError(res) \? res : res !== 0;\n }, DERNode.prototype._decodeInt = function(buffer, values) {\n let raw = buffer.raw(), res = new bignum(raw);\n return values && (res = values[res.toString(10)] || res), res;\n }, DERNode.prototype._use = function(entity, obj) {\n return typeof entity == \"function\" && (entity = entity(obj)), entity._getDecoder(\"der\").tree;\n };\n function derDecodeTag(buf, fail) {\n let tag = buf.readUInt8(fail);\n if (buf.isError(tag))\n return tag;\n let cls = der.tagClass[tag >> 6], primitive = (tag & 32) === 0;\n if ((tag & 31) === 31) {\n let oct = tag;\n for (tag = 0;(oct & 128) === 128; ) {\n if (oct = buf.readUInt8(fail), buf.isError(oct))\n return oct;\n tag <<= 7, tag |= oct & 127;\n }\n } else\n tag &= 31;\n let tagStr = der.tag[tag];\n return {\n cls,\n primitive,\n tag,\n tagStr\n };\n }\n function derDecodeLen(buf, primitive, fail) {\n let len = buf.readUInt8(fail);\n if (buf.isError(len))\n return len;\n if (!primitive && len === 128)\n return null;\n if ((len & 128) === 0)\n return len;\n let num = len & 127;\n if (num > 4)\n return buf.error(\"length octect is too long\");\n len = 0;\n for (let i = 0;i < num; i++) {\n len <<= 8;\n let j = buf.readUInt8(fail);\n if (buf.isError(j))\n return j;\n len |= j;\n }\n return len;\n }\n }\n}), require_pem2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/pem.js\"(exports, module) {\n var inherits = require_inherits_browser(), Buffer2 = require_safer().Buffer, DERDecoder = require_der3();\n function PEMDecoder(entity) {\n DERDecoder.@call(this, entity), this.enc = \"pem\";\n }\n inherits(PEMDecoder, DERDecoder), module.exports = PEMDecoder, PEMDecoder.prototype.decode = function(data, options) {\n let lines = data.toString().split(/[\\r\\n]+/g), label = options.label.toUpperCase(), re = /^-----(BEGIN|END) ([^-]+)-----$/, start = -1, end = -1;\n for (let i = 0;i < lines.length; i++) {\n let match = lines[i].match(re);\n if (match !== null && match[2] === label)\n if (start === -1) {\n if (match[1] !== \"BEGIN\")\n break;\n start = i;\n } else {\n if (match[1] !== \"END\")\n break;\n end = i;\n break;\n }\n }\n if (start === -1 || end === -1)\n throw new Error(\"PEM section not found for: \" + label);\n let base64 = lines.slice(start + 1, end).join(\"\");\n base64.replace(/[^a-z0-9+/=]+/gi, \"\");\n let input = Buffer2.from(base64, \"base64\");\n return DERDecoder.prototype.decode.@call(this, input, options);\n };\n }\n}), require_decoders = __commonJS({\n \"node_modules/asn1.js/lib/asn1/decoders/index.js\"(exports) {\n var decoders = exports;\n decoders.der = require_der3(), decoders.pem = require_pem2();\n }\n}), require_api = __commonJS({\n \"node_modules/asn1.js/lib/asn1/api.js\"(exports) {\n var encoders = require_encoders(), decoders = require_decoders(), inherits = require_inherits_browser(), api = exports;\n api.define = function(name, body) {\n return new Entity(name, body);\n };\n function Entity(name, body) {\n this.name = name, this.body = body, this.decoders = {}, this.encoders = {};\n }\n Entity.prototype = {}, Entity.prototype._createNamed = function(Base) {\n let name = this.name;\n function Generated(entity) {\n this._initNamed(entity, name);\n }\n return inherits(Generated, Base), Generated.prototype._initNamed = function(entity, name2) {\n Base.@call(this, entity, name2);\n }, new Generated(this);\n }, Entity.prototype._getDecoder = function(enc) {\n return enc = enc || \"der\", this.decoders.hasOwnProperty(enc) || (this.decoders[enc] = this._createNamed(decoders[enc])), this.decoders[enc];\n }, Entity.prototype.decode = function(data, enc, options) {\n return this._getDecoder(enc).decode(data, options);\n }, Entity.prototype._getEncoder = function(enc) {\n return enc = enc || \"der\", this.encoders.hasOwnProperty(enc) || (this.encoders[enc] = this._createNamed(encoders[enc])), this.encoders[enc];\n }, Entity.prototype.encode = function(data, enc, reporter) {\n return this._getEncoder(enc).encode(data, reporter);\n };\n }\n}), require_base2 = __commonJS({\n \"node_modules/asn1.js/lib/asn1/base/index.js\"(exports) {\n var base = exports;\n base.Reporter = require_reporter().Reporter, base.DecoderBuffer = require_buffer().DecoderBuffer, base.EncoderBuffer = require_buffer().EncoderBuffer, base.Node = require_node();\n }\n}), require_constants = __commonJS({\n \"node_modules/asn1.js/lib/asn1/constants/index.js\"(exports) {\n var constants = exports;\n constants._reverse = function(map) {\n let res = {};\n return Object.keys(map).forEach(function(key2) {\n (key2 | 0) == key2 && (key2 = key2 | 0);\n let value = map[key2];\n res[value] = key2;\n }), res;\n }, constants.der = require_der();\n }\n}), require_asn1 = __commonJS({\n \"node_modules/asn1.js/lib/asn1.js\"(exports) {\n var asn1 = exports;\n asn1.bignum = require_bn5(), asn1.define = require_api().define, asn1.base = require_base2(), asn1.constants = require_constants(), asn1.decoders = require_decoders(), asn1.encoders = require_encoders();\n }\n}), require_certificate = __commonJS({\n \"node_modules/parse-asn1/certificate.js\"(exports, module) {\n var asn = require_asn1(), Time = asn.define(\"Time\", function() {\n this.choice({\n utcTime: this.utctime(),\n generalTime: this.gentime()\n });\n }), AttributeTypeValue = asn.define(\"AttributeTypeValue\", function() {\n this.seq().obj(this.key(\"type\").objid(), this.key(\"value\").any());\n }), AlgorithmIdentifier = asn.define(\"AlgorithmIdentifier\", function() {\n this.seq().obj(this.key(\"algorithm\").objid(), this.key(\"parameters\").optional(), this.key(\"curve\").objid().optional());\n }), SubjectPublicKeyInfo = asn.define(\"SubjectPublicKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPublicKey\").bitstr());\n }), RelativeDistinguishedName = asn.define(\"RelativeDistinguishedName\", function() {\n this.setof(AttributeTypeValue);\n }), RDNSequence = asn.define(\"RDNSequence\", function() {\n this.seqof(RelativeDistinguishedName);\n }), Name = asn.define(\"Name\", function() {\n this.choice({\n rdnSequence: this.use(RDNSequence)\n });\n }), Validity = asn.define(\"Validity\", function() {\n this.seq().obj(this.key(\"notBefore\").use(Time), this.key(\"notAfter\").use(Time));\n }), Extension = asn.define(\"Extension\", function() {\n this.seq().obj(this.key(\"extnID\").objid(), this.key(\"critical\").bool().def(!1), this.key(\"extnValue\").octstr());\n }), TBSCertificate = asn.define(\"TBSCertificate\", function() {\n this.seq().obj(this.key(\"version\").explicit(0).int().optional(), this.key(\"serialNumber\").int(), this.key(\"signature\").use(AlgorithmIdentifier), this.key(\"issuer\").use(Name), this.key(\"validity\").use(Validity), this.key(\"subject\").use(Name), this.key(\"subjectPublicKeyInfo\").use(SubjectPublicKeyInfo), this.key(\"issuerUniqueID\").implicit(1).bitstr().optional(), this.key(\"subjectUniqueID\").implicit(2).bitstr().optional(), this.key(\"extensions\").explicit(3).seqof(Extension).optional());\n }), X509Certificate = asn.define(\"X509Certificate\", function() {\n this.seq().obj(this.key(\"tbsCertificate\").use(TBSCertificate), this.key(\"signatureAlgorithm\").use(AlgorithmIdentifier), this.key(\"signatureValue\").bitstr());\n });\n module.exports = X509Certificate;\n }\n}), require_asn12 = __commonJS({\n \"node_modules/parse-asn1/asn1.js\"(exports) {\n var asn1 = require_asn1();\n exports.certificate = require_certificate();\n var RSAPrivateKey = asn1.define(\"RSAPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"modulus\").int(), this.key(\"publicExponent\").int(), this.key(\"privateExponent\").int(), this.key(\"prime1\").int(), this.key(\"prime2\").int(), this.key(\"exponent1\").int(), this.key(\"exponent2\").int(), this.key(\"coefficient\").int());\n });\n exports.RSAPrivateKey = RSAPrivateKey;\n var RSAPublicKey = asn1.define(\"RSAPublicKey\", function() {\n this.seq().obj(this.key(\"modulus\").int(), this.key(\"publicExponent\").int());\n });\n exports.RSAPublicKey = RSAPublicKey;\n var PublicKey = asn1.define(\"SubjectPublicKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPublicKey\").bitstr());\n });\n exports.PublicKey = PublicKey;\n var AlgorithmIdentifier = asn1.define(\"AlgorithmIdentifier\", function() {\n this.seq().obj(this.key(\"algorithm\").objid(), this.key(\"none\").null_().optional(), this.key(\"curve\").objid().optional(), this.key(\"params\").seq().obj(this.key(\"p\").int(), this.key(\"q\").int(), this.key(\"g\").int()).optional());\n }), PrivateKeyInfo = asn1.define(\"PrivateKeyInfo\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"algorithm\").use(AlgorithmIdentifier), this.key(\"subjectPrivateKey\").octstr());\n });\n exports.PrivateKey = PrivateKeyInfo;\n var EncryptedPrivateKeyInfo = asn1.define(\"EncryptedPrivateKeyInfo\", function() {\n this.seq().obj(this.key(\"algorithm\").seq().obj(this.key(\"id\").objid(), this.key(\"decrypt\").seq().obj(this.key(\"kde\").seq().obj(this.key(\"id\").objid(), this.key(\"kdeparams\").seq().obj(this.key(\"salt\").octstr(), this.key(\"iters\").int())), this.key(\"cipher\").seq().obj(this.key(\"algo\").objid(), this.key(\"iv\").octstr()))), this.key(\"subjectPrivateKey\").octstr());\n });\n exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo;\n var DSAPrivateKey = asn1.define(\"DSAPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"p\").int(), this.key(\"q\").int(), this.key(\"g\").int(), this.key(\"pub_key\").int(), this.key(\"priv_key\").int());\n });\n exports.DSAPrivateKey = DSAPrivateKey, exports.DSAparam = asn1.define(\"DSAparam\", function() {\n this.int();\n });\n var ECPrivateKey = asn1.define(\"ECPrivateKey\", function() {\n this.seq().obj(this.key(\"version\").int(), this.key(\"privateKey\").octstr(), this.key(\"parameters\").optional().explicit(0).use(ECParameters), this.key(\"publicKey\").optional().explicit(1).bitstr());\n });\n exports.ECPrivateKey = ECPrivateKey;\n var ECParameters = asn1.define(\"ECParameters\", function() {\n this.choice({\n namedCurve: this.objid()\n });\n });\n exports.signature = asn1.define(\"signature\", function() {\n this.seq().obj(this.key(\"r\").int(), this.key(\"s\").int());\n });\n }\n}), require_aesid = __commonJS({\n \"node_modules/parse-asn1/aesid.json\"(exports, module) {\n module.exports = {\n \"2.16.840.1.101.3.4.1.1\": \"aes-128-ecb\",\n \"2.16.840.1.101.3.4.1.2\": \"aes-128-cbc\",\n \"2.16.840.1.101.3.4.1.3\": \"aes-128-ofb\",\n \"2.16.840.1.101.3.4.1.4\": \"aes-128-cfb\",\n \"2.16.840.1.101.3.4.1.21\": \"aes-192-ecb\",\n \"2.16.840.1.101.3.4.1.22\": \"aes-192-cbc\",\n \"2.16.840.1.101.3.4.1.23\": \"aes-192-ofb\",\n \"2.16.840.1.101.3.4.1.24\": \"aes-192-cfb\",\n \"2.16.840.1.101.3.4.1.41\": \"aes-256-ecb\",\n \"2.16.840.1.101.3.4.1.42\": \"aes-256-cbc\",\n \"2.16.840.1.101.3.4.1.43\": \"aes-256-ofb\",\n \"2.16.840.1.101.3.4.1.44\": \"aes-256-cfb\"\n };\n }\n}), require_fixProc = __commonJS({\n \"node_modules/parse-asn1/fixProc.js\"(exports, module) {\n var findProc = /Proc-Type: 4,ENCRYPTED[\\n\\r]+DEK-Info: AES-((\?:128)|(\?:192)|(\?:256))-CBC,([0-9A-H]+)[\\n\\r]+([0-9A-z\\n\\r+/=]+)[\\n\\r]+/m, startRegex = /^-----BEGIN ((\?:.*\? KEY)|CERTIFICATE)-----/m, fullRegex = /^-----BEGIN ((\?:.*\? KEY)|CERTIFICATE)-----([0-9A-z\\n\\r+/=]+)-----END \\1-----$/m, evp = require_evp_bytestokey(), ciphers = require_browser5(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(okey, password) {\n var key2 = okey.toString(), match = key2.match(findProc), decrypted;\n if (match) {\n var suite = \"aes\" + match[1], iv = Buffer2.from(match[2], \"hex\"), cipherText = Buffer2.from(match[3].replace(/[\\r\\n]/g, \"\"), \"base64\"), cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key, out = [], cipher = ciphers.createDecipheriv(suite, cipherKey, iv);\n out.push(cipher.update(cipherText)), out.push(cipher.final()), decrypted = Buffer2.concat(out);\n } else {\n var match2 = key2.match(fullRegex);\n decrypted = Buffer2.from(match2[2].replace(/[\\r\\n]/g, \"\"), \"base64\");\n }\n var tag = key2.match(startRegex)[1];\n return {\n tag,\n data: decrypted\n };\n };\n }\n}), require_parse_asn1 = __commonJS({\n \"node_modules/parse-asn1/index.js\"(exports, module) {\n var asn1 = require_asn12(), aesid = require_aesid(), fixProc = require_fixProc(), ciphers = require_browser5(), compat = require_browser4(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = parseKeys;\n function parseKeys(buffer) {\n var password;\n if (buffer instanceof KeyObject)\n buffer = buffer.export();\n else if (buffer instanceof CryptoKey)\n buffer = KeyObject.from(buffer).export();\n else if (typeof buffer == \"object\" && !Buffer2.isBuffer(buffer)) {\n if (password = buffer.passphrase, buffer = buffer.key, buffer instanceof KeyObject) {\n var options;\n switch (buffer.type) {\n case \"secret\":\n options = {\n format: \"buffer\"\n };\n break;\n case \"public\":\n options = {\n format: \"pem\",\n type: \"spki\",\n passphrase: password\n };\n break;\n case \"private\":\n options = {\n format: \"pem\",\n type: \"pkcs8\",\n passphrase: password\n };\n break;\n }\n buffer = buffer.export(options);\n } else if (buffer instanceof CryptoKey) {\n var options;\n switch (buffer.type) {\n case \"secret\":\n options = {\n format: \"buffer\"\n };\n break;\n case \"public\":\n options = {\n format: \"pem\",\n type: \"spki\",\n passphrase: password\n };\n break;\n case \"private\":\n options = {\n format: \"pem\",\n type: \"pkcs8\",\n passphrase: password\n };\n break;\n }\n buffer = KeyObject.from(buffer).export(options);\n }\n }\n typeof buffer == \"string\" && (buffer = Buffer2.from(buffer));\n var stripped = fixProc(buffer, password), type = stripped.tag, data = stripped.data, subtype, ndata;\n switch (type) {\n case \"CERTIFICATE\":\n ndata = asn1.certificate.decode(data, \"der\").tbsCertificate.subjectPublicKeyInfo;\n case \"PUBLIC KEY\":\n switch (ndata || (ndata = asn1.PublicKey.decode(data, \"der\")), subtype = ndata.algorithm.algorithm.join(\".\"), subtype) {\n case \"1.2.840.113549.1.1.1\":\n return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, \"der\");\n case \"1.2.840.10045.2.1\":\n return ndata.subjectPrivateKey = ndata.subjectPublicKey, {\n type: \"ec\",\n data: ndata\n };\n case \"1.2.840.10040.4.1\":\n return ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, \"der\"), {\n type: \"dsa\",\n data: ndata.algorithm.params\n };\n default:\n throw new Error(\"unknown key id \" + subtype);\n }\n case \"ENCRYPTED PRIVATE KEY\":\n data = asn1.EncryptedPrivateKey.decode(data, \"der\"), data = decrypt(data, password);\n case \"PRIVATE KEY\":\n switch (ndata = asn1.PrivateKey.decode(data, \"der\"), subtype = ndata.algorithm.algorithm.join(\".\"), subtype) {\n case \"1.2.840.113549.1.1.1\":\n return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, \"der\");\n case \"1.2.840.10045.2.1\":\n return {\n curve: ndata.algorithm.curve,\n privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, \"der\").privateKey\n };\n case \"1.2.840.10040.4.1\":\n return ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, \"der\"), {\n type: \"dsa\",\n params: ndata.algorithm.params\n };\n default:\n throw new Error(\"unknown key id \" + subtype);\n }\n case \"RSA PUBLIC KEY\":\n return asn1.RSAPublicKey.decode(data, \"der\");\n case \"RSA PRIVATE KEY\":\n return asn1.RSAPrivateKey.decode(data, \"der\");\n case \"DSA PRIVATE KEY\":\n return {\n type: \"dsa\",\n params: asn1.DSAPrivateKey.decode(data, \"der\")\n };\n case \"EC PRIVATE KEY\":\n return data = asn1.ECPrivateKey.decode(data, \"der\"), {\n curve: data.parameters.value,\n privateKey: data.privateKey\n };\n default:\n throw new Error(\"unknown key type \" + type);\n }\n }\n parseKeys.signature = asn1.signature;\n function decrypt(data, password) {\n var salt = data.algorithm.decrypt.kde.kdeparams.salt, iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10), algo = aesid[data.algorithm.decrypt.cipher.algo.join(\".\")], iv = data.algorithm.decrypt.cipher.iv, cipherText = data.subjectPrivateKey, keylen = parseInt(algo.split(\"-\")[1], 10) / 8, key2 = compat.pbkdf2Sync(password, salt, iters, keylen, \"sha1\"), cipher = ciphers.createDecipheriv(algo, key2, iv), out = [];\n return out.push(cipher.update(cipherText)), out.push(cipher.final()), Buffer2.concat(out);\n }\n }\n}), require_curves2 = __commonJS({\n \"node_modules/browserify-sign/browser/curves.json\"(exports, module) {\n module.exports = {\n \"1.3.132.0.10\": \"secp256k1\",\n \"1.3.132.0.33\": \"p224\",\n \"1.2.840.10045.3.1.1\": \"p192\",\n \"1.2.840.10045.3.1.7\": \"p256\",\n \"1.3.132.0.34\": \"p384\",\n \"1.3.132.0.35\": \"p521\"\n };\n }\n}), require_sign = __commonJS({\n \"node_modules/browserify-sign/browser/sign.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, createHmac = require_browser3(), crt = require_browserify_rsa(), EC = require_elliptic().ec, BN = require_bn3(), parseKeys = require_parse_asn1(), curves = require_curves2();\n function sign(hash, key2, hashType, signType, tag) {\n var priv = parseKeys(getKeyFrom(key2, \"private\"));\n if (priv.curve) {\n if (signType !== \"ecdsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong private key type\");\n return ecSign(hash, priv);\n } else if (priv.type === \"dsa\") {\n if (signType !== \"dsa\")\n throw new Error(\"wrong private key type\");\n return dsaSign(hash, priv, hashType);\n } else if (signType !== \"rsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong private key type\");\n hash = Buffer2.concat([tag, hash]);\n for (var len = priv.modulus.byteLength(), pad = [0, 1];hash.length + pad.length + 1 < len; )\n pad.push(255);\n pad.push(0);\n for (var i = -1;++i < hash.length; )\n pad.push(hash[i]);\n var out = crt(pad, priv);\n return out;\n }\n function ecSign(hash, priv) {\n var curveId = curves[priv.curve.join(\".\")];\n if (!curveId)\n throw new Error(\"unknown curve \" + priv.curve.join(\".\"));\n var curve = new EC(curveId), key2 = curve.keyFromPrivate(priv.privateKey), out = key2.sign(hash);\n return Buffer2.from(out.toDER());\n }\n function dsaSign(hash, priv, algo) {\n for (var x = priv.params.priv_key, p = priv.params.p, q = priv.params.q, g = priv.params.g, r = new BN(0), k, H = bits2int(hash, q).mod(q), s = !1, kv = getKey(x, q, hash, algo);s === !1; )\n k = makeKey(q, kv, algo), r = makeR(g, k, p, q), s = k.invm(q).imul(H.add(x.mul(r))).mod(q), s.cmpn(0) === 0 && (s = !1, r = new BN(0));\n return toDER(r, s);\n }\n function toDER(r, s) {\n r = r.toArray(), s = s.toArray(), r[0] & 128 && (r = [0].concat(r)), s[0] & 128 && (s = [0].concat(s));\n var total = r.length + s.length + 4, res = [48, total, 2, r.length];\n return res = res.concat(r, [2, s.length], s), Buffer2.from(res);\n }\n function getKey(x, q, hash, algo) {\n if (x = Buffer2.from(x.toArray()), x.length < q.byteLength()) {\n var zeros = Buffer2.alloc(q.byteLength() - x.length);\n x = Buffer2.concat([zeros, x]);\n }\n var hlen = hash.length, hbits = bits2octets(hash, q), v = Buffer2.alloc(hlen);\n v.fill(1);\n var k = Buffer2.alloc(hlen);\n return k = createHmac(algo, k).update(v).update(Buffer2.from([0])).update(x).update(hbits).digest(), v = createHmac(algo, k).update(v).digest(), k = createHmac(algo, k).update(v).update(Buffer2.from([1])).update(x).update(hbits).digest(), v = createHmac(algo, k).update(v).digest(), { k, v };\n }\n function bits2int(obits, q) {\n var bits = new BN(obits), shift = (obits.length << 3) - q.bitLength();\n return shift > 0 && bits.ishrn(shift), bits;\n }\n function bits2octets(bits, q) {\n bits = bits2int(bits, q), bits = bits.mod(q);\n var out = Buffer2.from(bits.toArray());\n if (out.length < q.byteLength()) {\n var zeros = Buffer2.alloc(q.byteLength() - out.length);\n out = Buffer2.concat([zeros, out]);\n }\n return out;\n }\n function makeKey(q, kv, algo) {\n var t, k;\n do {\n for (t = Buffer2.alloc(0);t.length * 8 < q.bitLength(); )\n kv.v = createHmac(algo, kv.k).update(kv.v).digest(), t = Buffer2.concat([t, kv.v]);\n k = bits2int(t, q), kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer2.from([0])).digest(), kv.v = createHmac(algo, kv.k).update(kv.v).digest();\n } while (k.cmp(q) !== -1);\n return k;\n }\n function makeR(g, k, p, q) {\n return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q);\n }\n module.exports = sign, module.exports.getKey = getKey, module.exports.makeKey = makeKey;\n }\n}), require_verify = __commonJS({\n \"node_modules/browserify-sign/browser/verify.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, BN = require_bn3(), EC = require_elliptic().ec, parseKeys = require_parse_asn1(), curves = require_curves2();\n function verify(sig, hash, key2, signType, tag) {\n var pub = parseKeys(getKeyFrom(key2, \"public\"));\n if (pub.type === \"ec\") {\n if (signType !== \"ecdsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong public key type\");\n return ecVerify(sig, hash, pub);\n } else if (pub.type === \"dsa\") {\n if (signType !== \"dsa\")\n throw new Error(\"wrong public key type\");\n return dsaVerify(sig, hash, pub);\n } else if (signType !== \"rsa\" && signType !== \"ecdsa/rsa\")\n throw new Error(\"wrong public key type\");\n hash = Buffer2.concat([tag, hash]);\n for (var len = pub.modulus.byteLength(), pad = [1], padNum = 0;hash.length + pad.length + 2 < len; )\n pad.push(255), padNum++;\n pad.push(0);\n for (var i = -1;++i < hash.length; )\n pad.push(hash[i]);\n pad = Buffer2.from(pad);\n var red = BN.mont(pub.modulus);\n sig = new BN(sig).toRed(red), sig = sig.redPow(new BN(pub.publicExponent)), sig = Buffer2.from(sig.fromRed().toArray());\n var out = padNum < 8 \? 1 : 0;\n for (len = Math.min(sig.length, pad.length), sig.length !== pad.length && (out = 1), i = -1;++i < len; )\n out |= sig[i] ^ pad[i];\n return out === 0;\n }\n function ecVerify(sig, hash, pub) {\n var curveId = curves[pub.data.algorithm.curve.join(\".\")];\n if (!curveId)\n throw new Error(\"unknown curve \" + pub.data.algorithm.curve.join(\".\"));\n var curve = new EC(curveId), pubkey = pub.data.subjectPrivateKey.data;\n return curve.verify(hash, sig, pubkey);\n }\n function dsaVerify(sig, hash, pub) {\n var p = pub.data.p, q = pub.data.q, g = pub.data.g, y = pub.data.pub_key, unpacked = parseKeys.signature.decode(sig, \"der\"), s = unpacked.s, r = unpacked.r;\n checkValue(s, q), checkValue(r, q);\n var montp = BN.mont(p), w = s.invm(q), v = g.toRed(montp).redPow(new BN(hash).mul(w).mod(q)).fromRed().mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed()).mod(p).mod(q);\n return v.cmp(r) === 0;\n }\n function checkValue(b, q) {\n if (b.cmpn(0) <= 0)\n throw new Error(\"invalid sig\");\n if (b.cmp(q) >= q)\n throw new Error(\"invalid sig\");\n }\n module.exports = verify;\n }\n}), require_browser8 = __commonJS({\n \"node_modules/browserify-sign/browser/index.js\"(exports, module) {\n var Buffer2 = require_safe_buffer().Buffer, createHash = require_browser2(), inherits = require_inherits_browser(), sign = require_sign(), verify = require_verify(), algorithms = require_algorithms();\n Object.keys(algorithms).forEach(function(key2) {\n algorithms[key2].id = Buffer2.from(algorithms[key2].id, \"hex\"), algorithms[key2.toLowerCase()] = algorithms[key2];\n });\n function Sign(algorithm) {\n if (typeof algorithm === \"string\")\n algorithm = algorithm.toLowerCase();\n StreamModule.Writable.@call(this);\n var data = algorithms[algorithm];\n if (!data)\n throw new Error(\"Unknown message digest\");\n this._hashType = data.hash, this._hash = createHash(data.hash), this._tag = data.id, this._signType = data.sign;\n }\n inherits(Sign, StreamModule.Writable), Sign.prototype._write = function(data, _, done) {\n this._hash.update(data), done();\n }, Sign.prototype.update = function(data, enc) {\n return typeof data == \"string\" && (data = Buffer2.from(data, enc)), this._hash.update(data), this;\n }, Sign.prototype.sign = function(key2, enc) {\n this.end();\n var hash = this._hash.digest(), sig = sign(hash, key2, this._hashType, this._signType, this._tag);\n return enc \? sig.toString(enc) : sig;\n };\n function Verify(algorithm) {\n if (StreamModule.Writable.@call(this), typeof algorithm === \"string\")\n algorithm = algorithm.toLowerCase();\n var data = algorithms[algorithm];\n if (!data)\n throw new Error(\"Unknown message digest\");\n this._hash = createHash(data.hash), this._tag = data.id, this._signType = data.sign;\n }\n inherits(Verify, StreamModule.Writable), Verify.prototype._write = function(data, _, done) {\n this._hash.update(data), done();\n }, Verify.prototype.update = function(data, enc) {\n return typeof data == \"string\" && (data = Buffer2.from(data, enc)), this._hash.update(data), this;\n }, Verify.prototype.verify = function(key2, sig, enc) {\n typeof sig == \"string\" && (sig = Buffer2.from(sig, enc)), this.end();\n var hash = this._hash.digest();\n return verify(sig, hash, key2, this._signType, this._tag);\n };\n function createSign(algorithm) {\n return new Sign(algorithm);\n }\n function createVerify(algorithm) {\n return new Verify(algorithm);\n }\n module.exports = {\n Sign: createSign,\n Verify: createVerify,\n createSign,\n createVerify\n };\n }\n}), require_bn6 = require_bn, require_browser9 = __commonJS({\n \"node_modules/create-ecdh/browser.js\"(exports, module) {\n var elliptic = require_elliptic(), BN = require_bn6();\n module.exports = function(curve) {\n return new ECDH(curve);\n };\n var aliases = {\n secp256k1: {\n name: \"secp256k1\",\n byteLength: 32\n },\n secp224r1: {\n name: \"p224\",\n byteLength: 28\n },\n prime256v1: {\n name: \"p256\",\n byteLength: 32\n },\n prime192v1: {\n name: \"p192\",\n byteLength: 24\n },\n ed25519: {\n name: \"ed25519\",\n byteLength: 32\n },\n secp384r1: {\n name: \"p384\",\n byteLength: 48\n },\n secp521r1: {\n name: \"p521\",\n byteLength: 66\n }\n };\n aliases.p224 = aliases.secp224r1, aliases.p256 = aliases.secp256r1 = aliases.prime256v1, aliases.p192 = aliases.secp192r1 = aliases.prime192v1, aliases.p384 = aliases.secp384r1, aliases.p521 = aliases.secp521r1;\n function ECDH(curve) {\n this.curveType = aliases[curve], this.curveType || (this.curveType = {\n name: curve\n }), this.curve = new elliptic.ec(this.curveType.name), this.keys = void 0;\n }\n ECDH.prototype = {}, ECDH.prototype.generateKeys = function(enc, format) {\n return this.keys = this.curve.genKeyPair(), this.getPublicKey(enc, format);\n }, ECDH.prototype.computeSecret = function(other, inenc, enc) {\n inenc = inenc || \"utf8\", Buffer.isBuffer(other) || (other = new Buffer(other, inenc));\n var otherPub = this.curve.keyFromPublic(other).getPublic(), out = otherPub.mul(this.keys.getPrivate()).getX();\n return formatReturnValue(out, enc, this.curveType.byteLength);\n }, ECDH.prototype.getPublicKey = function(enc, format) {\n var key2 = this.keys.getPublic(format === \"compressed\", !0);\n return format === \"hybrid\" && (key2[key2.length - 1] % 2 \? key2[0] = 7 : key2[0] = 6), formatReturnValue(key2, enc);\n }, ECDH.prototype.getPrivateKey = function(enc) {\n return formatReturnValue(this.keys.getPrivate(), enc);\n }, ECDH.prototype.setPublicKey = function(pub, enc) {\n return enc = enc || \"utf8\", Buffer.isBuffer(pub) || (pub = new Buffer(pub, enc)), this.keys._importPublic(pub), this;\n }, ECDH.prototype.setPrivateKey = function(priv, enc) {\n enc = enc || \"utf8\", Buffer.isBuffer(priv) || (priv = new Buffer(priv, enc));\n var _priv = new BN(priv);\n return _priv = _priv.toString(16), this.keys = this.curve.genKeyPair(), this.keys._importPrivate(_priv), this;\n };\n function formatReturnValue(bn, enc, len) {\n @Array.isArray(bn) || (bn = bn.toArray());\n var buf = new Buffer(bn);\n if (len && buf.length < len) {\n var zeros = new Buffer(len - buf.length);\n zeros.fill(0), buf = Buffer.concat([zeros, buf]);\n }\n return enc \? buf.toString(enc) : buf;\n }\n }\n}), require_mgf = __commonJS({\n \"node_modules/public-encrypt/mgf.js\"(exports, module) {\n var createHash = require_browser2(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(seed, len) {\n for (var t = Buffer2.alloc(0), i = 0, c;t.length < len; )\n c = i2ops(i++), t = Buffer2.concat([t, createHash(\"sha1\").update(seed).update(c).digest()]);\n return t.slice(0, len);\n };\n function i2ops(c) {\n var out = Buffer2.allocUnsafe(4);\n return out.writeUInt32BE(c, 0), out;\n }\n }\n}), require_xor = __commonJS({\n \"node_modules/public-encrypt/xor.js\"(exports, module) {\n module.exports = function(a, b) {\n for (var len = a.length, i = -1;++i < len; )\n a[i] ^= b[i];\n return a;\n };\n }\n}), require_bn7 = require_bn, { CryptoHasher } = globalThis.Bun, require_withPublic = __commonJS({\n \"node_modules/public-encrypt/withPublic.js\"(exports, module) {\n var BN = require_bn7(), Buffer2 = require_safe_buffer().Buffer;\n function withPublic(paddedMsg, key2) {\n return Buffer2.from(paddedMsg.toRed(BN.mont(key2.modulus)).redPow(new BN(key2.publicExponent)).fromRed().toArray());\n }\n module.exports = withPublic;\n }\n}), require_publicEncrypt = __commonJS({\n \"node_modules/public-encrypt/publicEncrypt.js\"(exports, module) {\n var parseKeys = require_parse_asn1(), randomBytes = require_browser(), createHash = require_browser2(), mgf = require_mgf(), xor = require_xor(), BN = require_bn7(), withPublic = require_withPublic(), crt = require_browserify_rsa(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(publicKey, msg, reverse) {\n var padding;\n publicKey.padding \? padding = publicKey.padding : reverse \? padding = 1 : padding = 4;\n var key2 = parseKeys(publicKey), paddedMsg;\n if (padding === 4)\n paddedMsg = oaep(key2, msg);\n else if (padding === 1)\n paddedMsg = pkcs1(key2, msg, reverse);\n else if (padding === 3) {\n if (paddedMsg = new BN(msg), paddedMsg.cmp(key2.modulus) >= 0)\n throw new Error(\"data too long for modulus\");\n } else\n throw new Error(\"unknown padding\");\n return reverse \? crt(paddedMsg, key2) : withPublic(paddedMsg, key2);\n };\n function oaep(key2, msg) {\n var k = key2.modulus.byteLength(), mLen = msg.length, iHash = createHash(\"sha1\").update(Buffer2.alloc(0)).digest(), hLen = iHash.length, hLen2 = 2 * hLen;\n if (mLen > k - hLen2 - 2)\n throw new Error(\"message too long\");\n var ps = Buffer2.alloc(k - mLen - hLen2 - 2), dblen = k - hLen - 1, seed = randomBytes(hLen), maskedDb = xor(Buffer2.concat([iHash, ps, Buffer2.alloc(1, 1), msg], dblen), mgf(seed, dblen)), maskedSeed = xor(seed, mgf(maskedDb, hLen));\n return new BN(Buffer2.concat([Buffer2.alloc(1), maskedSeed, maskedDb], k));\n }\n function pkcs1(key2, msg, reverse) {\n var mLen = msg.length, k = key2.modulus.byteLength();\n if (mLen > k - 11)\n throw new Error(\"message too long\");\n var ps;\n return reverse \? ps = Buffer2.alloc(k - mLen - 3, 255) : ps = nonZero(k - mLen - 3), new BN(Buffer2.concat([Buffer2.from([0, reverse \? 1 : 2]), ps, Buffer2.alloc(1), msg], k));\n }\n function nonZero(len) {\n for (var out = Buffer2.allocUnsafe(len), i = 0, cache = randomBytes(len * 2), cur = 0, num;i < len; )\n cur === cache.length && (cache = randomBytes(len * 2), cur = 0), num = cache[cur++], num && (out[i++] = num);\n return out;\n }\n }\n}), require_privateDecrypt = __commonJS({\n \"node_modules/public-encrypt/privateDecrypt.js\"(exports, module) {\n var parseKeys = require_parse_asn1(), mgf = require_mgf(), xor = require_xor(), BN = require_bn7(), crt = require_browserify_rsa(), createHash = require_browser2(), withPublic = require_withPublic(), Buffer2 = require_safe_buffer().Buffer;\n module.exports = function(privateKey, enc, reverse) {\n var padding;\n privateKey.padding \? padding = privateKey.padding : reverse \? padding = 1 : padding = 4;\n var key2 = parseKeys(privateKey), k = key2.modulus.byteLength();\n if (enc.length > k || new BN(enc).cmp(key2.modulus) >= 0)\n throw new Error(\"decryption error\");\n var msg;\n reverse \? msg = withPublic(new BN(enc), key2) : msg = crt(enc, key2);\n var zBuffer = Buffer2.alloc(k - msg.length);\n if (msg = Buffer2.concat([zBuffer, msg], k), padding === 4)\n return oaep(key2, msg);\n if (padding === 1)\n return pkcs1(key2, msg, reverse);\n if (padding === 3)\n return msg;\n throw new Error(\"unknown padding\");\n };\n function oaep(key2, msg) {\n var k = key2.modulus.byteLength(), iHash = createHash(\"sha1\").update(Buffer2.alloc(0)).digest(), hLen = iHash.length;\n if (msg[0] !== 0)\n throw new Error(\"decryption error\");\n var maskedSeed = msg.slice(1, hLen + 1), maskedDb = msg.slice(hLen + 1), seed = xor(maskedSeed, mgf(maskedDb, hLen)), db = xor(maskedDb, mgf(seed, k - hLen - 1));\n if (compare(iHash, db.slice(0, hLen)))\n throw new Error(\"decryption error\");\n for (var i = hLen;db[i] === 0; )\n i++;\n if (db[i++] !== 1)\n throw new Error(\"decryption error\");\n return db.slice(i);\n }\n function pkcs1(key2, msg, reverse) {\n for (var p1 = msg.slice(0, 2), i = 2, status = 0;msg[i++] !== 0; )\n if (i >= msg.length) {\n status++;\n break;\n }\n var ps = msg.slice(2, i - 1);\n if ((p1.toString(\"hex\") !== \"0002\" && !reverse || p1.toString(\"hex\") !== \"0001\" && reverse) && status++, ps.length < 8 && status++, status)\n throw new Error(\"decryption error\");\n return msg.slice(i);\n }\n function compare(a, b) {\n a = Buffer2.from(a), b = Buffer2.from(b);\n var dif = 0, len = a.length;\n a.length !== b.length && (dif++, len = Math.min(a.length, b.length));\n for (var i = -1;++i < len; )\n dif += a[i] ^ b[i];\n return dif;\n }\n }\n}), require_browser10 = __commonJS({\n \"node_modules/public-encrypt/browser.js\"(exports) {\n var publicEncrypt = require_publicEncrypt();\n exports.publicEncrypt = function(key2, buf, options) {\n return publicEncrypt(getKeyFrom(key2, \"public\"), buf, options);\n };\n var privateDecrypt = require_privateDecrypt();\n exports.privateDecrypt = function(key2, buf, options) {\n return privateDecrypt(getKeyFrom(key2, \"private\"), buf, options);\n }, exports.privateEncrypt = function(key2, buf) {\n return publicEncrypt(getKeyFrom(key2, \"private\"), buf, !0);\n }, exports.publicDecrypt = function(key2, buf) {\n return privateDecrypt(getKeyFrom(key2, \"public\"), buf, !0);\n };\n }\n}), require_browser11 = __commonJS({\n \"node_modules/randomfill/browser.js\"(exports) {\n var safeBuffer = require_safe_buffer(), randombytes = require_browser(), Buffer2 = safeBuffer.Buffer, kBufferMaxLength = safeBuffer.kMaxLength, kMaxUint32 = Math.pow(2, 32) - 1;\n function assertOffset(offset, length) {\n if (typeof offset != \"number\" || offset !== offset)\n @throwTypeError(\"offset must be a number\");\n if (offset > kMaxUint32 || offset < 0)\n @throwTypeError(\"offset must be a uint32\");\n if (offset > kBufferMaxLength || offset > length)\n @throwRangeError(\"offset out of range\");\n }\n function assertSize(size, offset, length) {\n if (typeof size != \"number\" || size !== size)\n @throwTypeError(\"size must be a number\");\n if (size > kMaxUint32 || size < 0)\n @throwTypeError(\"size must be a uint32\");\n if (size + offset > length || size > kBufferMaxLength)\n @throwRangeError(\"buffer too small\");\n }\n exports.randomFill = randomFill, exports.randomFillSync = randomFillSync;\n function randomFill(buf, offset, size, cb) {\n if (!Buffer2.isBuffer(buf) && !(buf instanceof global.Uint8Array))\n @throwTypeError('\"buf\" argument must be a Buffer or Uint8Array');\n if (typeof offset == \"function\")\n cb = offset, offset = 0, size = buf.length;\n else if (typeof size == \"function\")\n cb = size, size = buf.length - offset;\n else if (typeof cb != \"function\")\n @throwTypeError('\"cb\" argument must be a function');\n return assertOffset(offset, buf.length), assertSize(size, offset, buf.length), actualFill(buf, offset, size, cb);\n }\n function actualFill(buf, offset, size, cb) {\n if (cb) {\n randombytes(size, function(err, bytes2) {\n if (err)\n return cb(err);\n bytes2.copy(buf, offset), cb(null, buf);\n });\n return;\n }\n var bytes = randombytes(size);\n return bytes.copy(buf, offset), buf;\n }\n function randomFillSync(buf, offset, size) {\n if (typeof offset > \"u\" && (offset = 0), !Buffer2.isBuffer(buf) && !(buf instanceof global.Uint8Array))\n @throwTypeError('\"buf\" argument must be a Buffer or Uint8Array');\n return assertOffset(offset, buf.length), size === void 0 && (size = buf.length - offset), assertSize(size, offset, buf.length), actualFill(buf, offset, size);\n }\n }\n}), require_crypto_browserify2 = __commonJS({\n \"node_modules/crypto-browserify/index.js\"(exports) {\n exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require_browser(), exports.createHash = require_browser2(), exports.Hash = exports.createHash.Hash, exports.createHmac = exports.Hmac = require_browser3();\n var algos = require_algos(), algoKeys = Object.keys(algos), hashes = [\"sha1\", \"sha224\", \"sha256\", \"sha384\", \"sha512\", \"md5\", \"rmd160\"].concat(algoKeys);\n exports.getHashes = function() {\n return hashes;\n };\n var p = require_browser4();\n exports.pbkdf2 = p.pbkdf2, exports.pbkdf2Sync = p.pbkdf2Sync;\n var aes = require_browser6();\n exports.Cipher = aes.Cipher, exports.createCipher = aes.createCipher, exports.Cipheriv = aes.Cipheriv, exports.createCipheriv = aes.createCipheriv, exports.Decipher = aes.Decipher, exports.createDecipher = aes.createDecipher, exports.Decipheriv = aes.Decipheriv, exports.createDecipheriv = aes.createDecipheriv, exports.getCiphers = aes.getCiphers, exports.listCiphers = aes.listCiphers;\n var dh = require_browser7();\n exports.DiffieHellmanGroup = dh.DiffieHellmanGroup, exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup, exports.getDiffieHellman = dh.getDiffieHellman, exports.createDiffieHellman = dh.createDiffieHellman, exports.DiffieHellman = dh.DiffieHellman;\n var sign = require_browser8();\n exports.createSign = sign.createSign, exports.Sign = sign.Sign, exports.createVerify = sign.createVerify, exports.Verify = sign.Verify, exports.createECDH = require_browser9();\n var publicEncrypt = require_browser10();\n exports.publicEncrypt = publicEncrypt.publicEncrypt, exports.privateEncrypt = publicEncrypt.privateEncrypt, exports.publicDecrypt = publicEncrypt.publicDecrypt, exports.privateDecrypt = publicEncrypt.privateDecrypt, exports.getRandomValues = (values) => crypto.getRandomValues(values);\n var rf = require_browser11();\n exports.randomFill = rf.randomFill, exports.randomFillSync = rf.randomFillSync, exports.createCredentials = function() {\n throw new Error([\n \"sorry, createCredentials is not implemented yet\",\n \"we accept pull requests\",\n \"https://github.com/crypto-browserify/crypto-browserify\"\n ].join(`\n`));\n }, exports.constants = @processBindingConstants.crypto;\n }\n}), crypto_exports = require_crypto_browserify2(), DEFAULT_ENCODING = \"buffer\", getRandomValues = (array) => crypto.getRandomValues(array), randomUUID = () => crypto.randomUUID(), randomInt = (...args) => crypto.randomInt(...args), timingSafeEqual = \"timingSafeEqual\" in crypto \? (a, b) => {\n let { byteLength: byteLengthA } = a, { byteLength: byteLengthB } = b;\n if (typeof byteLengthA != \"number\" || typeof byteLengthB != \"number\")\n @throwTypeError(\"Input must be an array buffer view\");\n if (byteLengthA !== byteLengthB)\n @throwRangeError(\"Input buffers must have the same length\");\n return crypto.timingSafeEqual(a, b);\n} : void 0, scryptSync = \"scryptSync\" in crypto \? (password, salt, keylen, options) => {\n let res = crypto.scryptSync(password, salt, keylen, options);\n return DEFAULT_ENCODING !== \"buffer\" \? new Buffer(res).toString(DEFAULT_ENCODING) : new Buffer(res);\n} : void 0, scrypt = \"scryptSync\" in crypto \? function(password, salt, keylen, options, callback) {\n if (typeof options == \"function\" && (callback = options, options = void 0), typeof callback != \"function\") {\n var err = @makeTypeError(\"callback must be a function\");\n throw err.code = \"ERR_INVALID_CALLBACK\", err;\n }\n try {\n let result = crypto.scryptSync(password, salt, keylen, options);\n process.nextTick(callback, null, DEFAULT_ENCODING !== \"buffer\" \? new Buffer(result).toString(DEFAULT_ENCODING) : new Buffer(result));\n } catch (err2) {\n throw err2;\n }\n} : void 0;\ntimingSafeEqual && (Object.defineProperty(timingSafeEqual, \"name\", {\n value: \"::bunternal::\"\n}), Object.defineProperty(scrypt, \"name\", {\n value: \"::bunternal::\"\n}), Object.defineProperty(scryptSync, \"name\", {\n value: \"::bunternal::\"\n}));\nvar harcoded_curves = [\n \"p192\",\n \"p224\",\n \"p256\",\n \"p384\",\n \"p521\",\n \"curve25519\",\n \"ed25519\",\n \"secp256k1\",\n \"secp224r1\",\n \"prime256v1\",\n \"prime192v1\",\n \"ed25519\",\n \"secp384r1\",\n \"secp521r1\"\n], {\n symmetricKeySize,\n asymmetricKeyDetails,\n asymmetricKeyType,\n equals,\n exports,\n createSecretKey,\n createPublicKey,\n createPrivateKey,\n generateKeySync,\n generateKeyPairSync\n} = @lazy(\"internal/crypto\"), kCryptoKey = Symbol.for(\"::bunKeyObjectCryptoKey::\");\n\nclass KeyObject {\n [kCryptoKey];\n constructor(key2) {\n if (typeof key2 !== \"object\")\n @throwTypeError('The \"key\" argument must be an instance of CryptoKey.');\n this[kCryptoKey] = key2;\n }\n toString() {\n return \"[object KeyObject]\";\n }\n static from(key2) {\n if (key2 instanceof KeyObject)\n key2 = key2[kCryptoKey];\n return new KeyObject(key2);\n }\n get asymmetricKeyDetails() {\n return asymmetricKeyDetails(this[kCryptoKey]);\n }\n get symmetricKeySize() {\n return symmetricKeySize(this[kCryptoKey]);\n }\n get asymmetricKeyType() {\n return asymmetricKeyType(this[kCryptoKey]);\n }\n [\"export\"](options) {\n switch (arguments.length) {\n case 0:\n switch (this.type) {\n case \"secret\":\n options = {\n format: \"buffer\"\n };\n break;\n case \"public\":\n options = {\n format: \"pem\",\n type: \"spki\"\n };\n break;\n case \"private\":\n options = {\n format: \"pem\",\n type: \"pkcs8\"\n };\n break;\n }\n break;\n case 1:\n if (typeof options === \"object\" && !options.format)\n switch (this.type) {\n case \"secret\":\n options.format = \"buffer\";\n break;\n default:\n options.format = \"pem\";\n break;\n }\n }\n return exports(this[kCryptoKey], options);\n }\n equals(otherKey) {\n if (!(otherKey instanceof KeyObject))\n @throwTypeError(\"otherKey must be a KeyObject\");\n return equals(this[kCryptoKey], otherKey[kCryptoKey]);\n }\n get type() {\n return this[kCryptoKey].type;\n }\n}\ncrypto_exports.generateKeySync = function(algorithm, options) {\n return KeyObject.from(generateKeySync(algorithm, options\?.length));\n};\ncrypto_exports.generateKey = function(algorithm, options, callback) {\n try {\n const key2 = KeyObject.from(generateKeySync(algorithm, options\?.length));\n typeof callback === \"function\" && callback(null, KeyObject.from(key2));\n } catch (err) {\n typeof callback === \"function\" && callback(err);\n }\n};\ncrypto_exports.generateKeyPairSync = _generateKeyPairSync;\ncrypto_exports.generateKeyPair = function(algorithm, options, callback) {\n try {\n const result = _generateKeyPairSync(algorithm, options);\n typeof callback === \"function\" && callback(null, result.publicKey, result.privateKey);\n } catch (err) {\n typeof callback === \"function\" && callback(err);\n }\n};\ncrypto_exports.createSecretKey = function(key2, encoding) {\n if (key2 instanceof KeyObject || key2 instanceof CryptoKey) {\n if (key2.type !== \"secret\") {\n const error = @makeTypeError(`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE: Invalid key object type ${key2.type}, expected secret`);\n throw error.code = \"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\", error;\n }\n return KeyObject.from(key2);\n }\n const buffer = getArrayBufferOrView(key2, encoding || \"utf8\");\n return KeyObject.from(createSecretKey(buffer));\n};\ncrypto_exports.createPrivateKey = _createPrivateKey;\ncrypto_exports.createPublicKey = _createPublicKey;\ncrypto_exports.KeyObject = KeyObject;\nvar _createSign = crypto_exports.createSign;\ncrypto_exports.sign = function(algorithm, data, key2, encoding, callback) {\n if (typeof callback === \"function\")\n try {\n const result = _createSign(algorithm).update(data, encoding).sign(key2, encoding);\n callback(null, result);\n } catch (err) {\n callback(err);\n }\n else\n return _createSign(algorithm).update(data, encoding).sign(key2, encoding);\n};\nvar _createVerify = crypto_exports.createVerify;\ncrypto_exports.verify = function(algorithm, data, key2, signature, callback) {\n if (typeof callback === \"function\")\n try {\n const result = _createVerify(algorithm).update(data).verify(key2, signature);\n callback(null, result);\n } catch (err) {\n callback(err);\n }\n else\n return _createVerify(algorithm).update(data).verify(key2, signature);\n};\nvar webcrypto = crypto;\n__export(crypto_exports, {\n DEFAULT_ENCODING: () => DEFAULT_ENCODING,\n getRandomValues: () => getRandomValues,\n randomUUID: () => randomUUID,\n randomInt: () => randomInt,\n getCurves: () => getCurves,\n scrypt: () => scrypt,\n scryptSync: () => scryptSync,\n timingSafeEqual: () => timingSafeEqual,\n webcrypto: () => webcrypto,\n subtle: () => webcrypto.subtle\n});\n$ = crypto_exports;\n/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeDgramCode = "(function (){\"use strict\";// src/js/out/tmp/node/dgram.ts\nvar createSocket = function() {\n throwNotImplemented(\"node:dgram createSocket\", 1630);\n}, Socket = function() {\n throwNotImplemented(\"node:dgram Socket\", 1630);\n}, _createSocketHandle = function() {\n throwNotImplemented(\"node:dgram _createSocketHandle\", 1630);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5);\n$ = {\n createSocket,\n Socket,\n _createSocketHandle\n};\nhideFromStack(createSocket, Socket, _createSocketHandle);\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeDgramCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/dgram.ts\nvar createSocket = function() {\n throwNotImplemented(\"node:dgram createSocket\", 1630);\n}, Socket = function() {\n throwNotImplemented(\"node:dgram Socket\", 1630);\n}, _createSocketHandle = function() {\n throwNotImplemented(\"node:dgram _createSocketHandle\", 1630);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6);\n$ = {\n createSocket,\n Socket,\n _createSocketHandle\n};\nhideFromStack(createSocket, Socket, _createSocketHandle);\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeDiagnosticsChannelCode = "(function (){\"use strict\";// src/js/out/tmp/node/diagnostics_channel.ts\nvar markActive = function(channel) {\n ObjectSetPrototypeOf(channel, ActiveChannel.prototype), channel._subscribers = [], channel._stores = new SafeMap;\n}, maybeMarkInactive = function(channel) {\n if (!channel._subscribers.length && !channel._stores.size)\n ObjectSetPrototypeOf(channel, Channel.prototype), channel._subscribers = void 0, channel._stores = void 0;\n}, defaultTransform = function(data) {\n return data;\n}, wrapStoreRun = function(store, data, next, transform = defaultTransform) {\n return () => {\n let context;\n try {\n context = transform(data);\n } catch (err) {\n return process.nextTick(() => reportError(err)), next();\n }\n return store.run(context, next);\n };\n}, channel = function(name) {\n const channel2 = channels.get(name);\n if (channel2)\n return channel2;\n if (typeof name !== \"string\" && typeof name !== \"symbol\")\n throw new ERR_INVALID_ARG_TYPE(\"channel\", [\"string\", \"symbol\"], name);\n return new Channel(name);\n}, subscribe = function(name, subscription) {\n return channel(name).subscribe(subscription);\n}, unsubscribe = function(name, subscription) {\n return channel(name).unsubscribe(subscription);\n}, hasSubscribers = function(name) {\n const channel2 = channels.get(name);\n if (!channel2)\n return !1;\n return channel2.hasSubscribers;\n}, assertChannel = function(value, name) {\n if (!(value instanceof Channel))\n throw new ERR_INVALID_ARG_TYPE(name, [\"Channel\"], value);\n}, tracingChannel = function(nameOrChannels) {\n return new TracingChannel(nameOrChannels);\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, $, SafeMap = Map, SafeFinalizationRegistry = FinalizationRegistry, ArrayPrototypeAt = (array, index) => array[index], ArrayPrototypeIndexOf = (array, value) => array.indexOf(value), ArrayPrototypePush = (array, value) => array.push(value), ArrayPrototypeSplice = (array, start, deleteCount) => array.splice(start, deleteCount), ObjectGetPrototypeOf = Object.getPrototypeOf, ObjectSetPrototypeOf = Object.setPrototypeOf, SymbolHasInstance = Symbol.hasInstance, ReflectApply = Reflect.apply, PromiseResolve = Promise.resolve, PromiseReject = Promise.reject, PromisePrototypeThen = (promise, onFulfilled, onRejected) => promise.then(onFulfilled, onRejected);\n\nclass WeakReference extends WeakRef {\n constructor() {\n super(...arguments);\n }\n #refs = 0;\n get() {\n return this.deref();\n }\n incRef() {\n return ++this.#refs;\n }\n decRef() {\n return --this.#refs;\n }\n}\n\nclass WeakRefMap extends SafeMap {\n constructor() {\n super(...arguments);\n }\n #finalizers = new SafeFinalizationRegistry((key) => {\n this.delete(key);\n });\n set(key, value) {\n return this.#finalizers.register(value, key), super.set(key, new WeakReference(value));\n }\n get(key) {\n return super.get(key)\?.get();\n }\n incRef(key) {\n return super.get(key)\?.incRef();\n }\n decRef(key) {\n return super.get(key)\?.decRef();\n }\n}\n\nclass ActiveChannel {\n subscribe(subscription) {\n validateFunction(subscription, \"subscription\"), ArrayPrototypePush(this._subscribers, subscription), channels.incRef(this.name);\n }\n unsubscribe(subscription) {\n const index = ArrayPrototypeIndexOf(this._subscribers, subscription);\n if (index === -1)\n return !1;\n return ArrayPrototypeSplice(this._subscribers, index, 1), channels.decRef(this.name), maybeMarkInactive(this), !0;\n }\n bindStore(store, transform) {\n if (!this._stores.has(store))\n channels.incRef(this.name);\n this._stores.set(store, transform);\n }\n unbindStore(store) {\n if (!this._stores.has(store))\n return !1;\n return this._stores.delete(store), channels.decRef(this.name), maybeMarkInactive(this), !0;\n }\n get hasSubscribers() {\n return !0;\n }\n publish(data) {\n for (let i = 0;i < (this._subscribers\?.length || 0); i++)\n try {\n const onMessage = this._subscribers[i];\n onMessage(data, this.name);\n } catch (err) {\n process.nextTick(() => reportError(err));\n }\n }\n runStores(data, fn, thisArg, ...args) {\n let run = () => {\n return this.publish(data), ReflectApply(fn, thisArg, args);\n };\n for (let entry of this._stores.entries()) {\n const store = entry[0], transform = entry[1];\n run = wrapStoreRun(store, data, run, transform);\n }\n return run();\n }\n}\n\nclass Channel {\n constructor(name) {\n this._subscribers = void 0, this._stores = void 0, this.name = name, channels.set(name, this);\n }\n static [SymbolHasInstance](instance) {\n const prototype = ObjectGetPrototypeOf(instance);\n return prototype === Channel.prototype || prototype === ActiveChannel.prototype;\n }\n subscribe(subscription) {\n markActive(this), this.subscribe(subscription);\n }\n unsubscribe() {\n return !1;\n }\n bindStore(store, transform) {\n markActive(this), this.bindStore(store, transform);\n }\n unbindStore() {\n return !1;\n }\n get hasSubscribers() {\n return !1;\n }\n publish() {\n }\n runStores(data, fn, thisArg, ...args) {\n return ReflectApply(fn, thisArg, args);\n }\n}\nvar channels = new WeakRefMap, traceEvents = [\"start\", \"end\", \"asyncStart\", \"asyncEnd\", \"error\"];\n\nclass TracingChannel {\n constructor(nameOrChannels) {\n if (typeof nameOrChannels === \"string\")\n this.start = channel(`tracing:${nameOrChannels}:start`), this.end = channel(`tracing:${nameOrChannels}:end`), this.asyncStart = channel(`tracing:${nameOrChannels}:asyncStart`), this.asyncEnd = channel(`tracing:${nameOrChannels}:asyncEnd`), this.error = channel(`tracing:${nameOrChannels}:error`);\n else if (typeof nameOrChannels === \"object\") {\n const { start, end, asyncStart, asyncEnd, error } = nameOrChannels;\n assertChannel(start, \"nameOrChannels.start\"), assertChannel(end, \"nameOrChannels.end\"), assertChannel(asyncStart, \"nameOrChannels.asyncStart\"), assertChannel(asyncEnd, \"nameOrChannels.asyncEnd\"), assertChannel(error, \"nameOrChannels.error\"), this.start = start, this.end = end, this.asyncStart = asyncStart, this.asyncEnd = asyncEnd, this.error = error;\n } else\n throw new ERR_INVALID_ARG_TYPE(\"nameOrChannels\", [\"string\", \"object\", \"Channel\"], nameOrChannels);\n }\n subscribe(handlers) {\n for (let name of traceEvents) {\n if (!handlers[name])\n continue;\n this[name]\?.subscribe(handlers[name]);\n }\n }\n unsubscribe(handlers) {\n let done = !0;\n for (let name of traceEvents) {\n if (!handlers[name])\n continue;\n if (!this[name]\?.unsubscribe(handlers[name]))\n done = !1;\n }\n return done;\n }\n traceSync(fn, context = {}, thisArg, ...args) {\n const { start, end, error } = this;\n return start.runStores(context, () => {\n try {\n const result = ReflectApply(fn, thisArg, args);\n return context.result = result, result;\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n tracePromise(fn, context = {}, thisArg, ...args) {\n const { start, end, asyncStart, asyncEnd, error } = this;\n function reject(err) {\n return context.error = err, error.publish(context), asyncStart.publish(context), asyncEnd.publish(context), PromiseReject(err);\n }\n function resolve(result) {\n return context.result = result, asyncStart.publish(context), asyncEnd.publish(context), result;\n }\n return start.runStores(context, () => {\n try {\n let promise = ReflectApply(fn, thisArg, args);\n if (!(promise instanceof Promise))\n promise = PromiseResolve(promise);\n return PromisePrototypeThen(promise, resolve, reject);\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n traceCallback(fn, position = -1, context = {}, thisArg, ...args) {\n const { start, end, asyncStart, asyncEnd, error } = this;\n function wrappedCallback(err, res) {\n if (err)\n context.error = err, error.publish(context);\n else\n context.result = res;\n asyncStart.runStores(context, () => {\n try {\n if (callback)\n return ReflectApply(callback, this, arguments);\n } finally {\n asyncEnd.publish(context);\n }\n });\n }\n const callback = ArrayPrototypeAt(args, position);\n if (typeof callback !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"callback\", [\"function\"], callback);\n return ArrayPrototypeSplice(args, position, 1, wrappedCallback), start.runStores(context, () => {\n try {\n return ReflectApply(fn, thisArg, args);\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n}\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\n$ = {\n channel,\n hasSubscribers,\n subscribe,\n tracingChannel,\n unsubscribe,\n Channel\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeDiagnosticsChannelCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/diagnostics_channel.ts\nvar markActive = function(channel) {\n ObjectSetPrototypeOf(channel, ActiveChannel.prototype), channel._subscribers = [], channel._stores = new SafeMap;\n}, maybeMarkInactive = function(channel) {\n if (!channel._subscribers.length && !channel._stores.size)\n ObjectSetPrototypeOf(channel, Channel.prototype), channel._subscribers = @undefined, channel._stores = @undefined;\n}, defaultTransform = function(data) {\n return data;\n}, wrapStoreRun = function(store, data, next, transform = defaultTransform) {\n return () => {\n let context;\n try {\n context = transform(data);\n } catch (err) {\n return process.nextTick(() => reportError(err)), next();\n }\n return store.run(context, next);\n };\n}, channel = function(name) {\n const channel2 = channels.get(name);\n if (channel2)\n return channel2;\n if (typeof name !== \"string\" && typeof name !== \"symbol\")\n throw new ERR_INVALID_ARG_TYPE(\"channel\", [\"string\", \"symbol\"], name);\n return new Channel(name);\n}, subscribe = function(name, subscription) {\n return channel(name).subscribe(subscription);\n}, unsubscribe = function(name, subscription) {\n return channel(name).unsubscribe(subscription);\n}, hasSubscribers = function(name) {\n const channel2 = channels.get(name);\n if (!channel2)\n return !1;\n return channel2.hasSubscribers;\n}, assertChannel = function(value, name) {\n if (!(value instanceof Channel))\n throw new ERR_INVALID_ARG_TYPE(name, [\"Channel\"], value);\n}, tracingChannel = function(nameOrChannels) {\n return new TracingChannel(nameOrChannels);\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, $, SafeMap = Map, SafeFinalizationRegistry = FinalizationRegistry, ArrayPrototypeAt = (array, index) => array[index], ArrayPrototypeIndexOf = (array, value) => array.indexOf(value), ArrayPrototypePush = (array, value) => array.push(value), ArrayPrototypeSplice = (array, start, deleteCount) => array.splice(start, deleteCount), ObjectGetPrototypeOf = Object.getPrototypeOf, ObjectSetPrototypeOf = Object.setPrototypeOf, SymbolHasInstance = Symbol.hasInstance, ReflectApply = @getByIdDirect(Reflect, \"apply\"), PromiseResolve = @Promise.resolve, PromiseReject = @Promise.reject, PromisePrototypeThen = (promise, onFulfilled, onRejected) => promise.then(onFulfilled, onRejected);\n\nclass WeakReference extends WeakRef {\n constructor() {\n super(...arguments);\n }\n #refs = 0;\n get() {\n return this.deref();\n }\n incRef() {\n return ++this.#refs;\n }\n decRef() {\n return --this.#refs;\n }\n}\n\nclass WeakRefMap extends SafeMap {\n constructor() {\n super(...arguments);\n }\n #finalizers = new SafeFinalizationRegistry((key) => {\n this.delete(key);\n });\n set(key, value) {\n return this.#finalizers.register(value, key), super.set(key, new WeakReference(value));\n }\n get(key) {\n return super.get(key)\?.get();\n }\n incRef(key) {\n return super.get(key)\?.incRef();\n }\n decRef(key) {\n return super.get(key)\?.decRef();\n }\n}\n\nclass ActiveChannel {\n subscribe(subscription) {\n validateFunction(subscription, \"subscription\"), ArrayPrototypePush(this._subscribers, subscription), channels.incRef(this.name);\n }\n unsubscribe(subscription) {\n const index = ArrayPrototypeIndexOf(this._subscribers, subscription);\n if (index === -1)\n return !1;\n return ArrayPrototypeSplice(this._subscribers, index, 1), channels.decRef(this.name), maybeMarkInactive(this), !0;\n }\n bindStore(store, transform) {\n if (!this._stores.has(store))\n channels.incRef(this.name);\n this._stores.set(store, transform);\n }\n unbindStore(store) {\n if (!this._stores.has(store))\n return !1;\n return this._stores.delete(store), channels.decRef(this.name), maybeMarkInactive(this), !0;\n }\n get hasSubscribers() {\n return !0;\n }\n publish(data) {\n for (let i = 0;i < (this._subscribers\?.length || 0); i++)\n try {\n const onMessage = this._subscribers[i];\n onMessage(data, this.name);\n } catch (err) {\n process.nextTick(() => reportError(err));\n }\n }\n runStores(data, fn, thisArg, ...args) {\n let run = () => {\n return this.publish(data), ReflectApply(fn, thisArg, args);\n };\n for (let entry of this._stores.entries()) {\n const store = entry[0], transform = entry[1];\n run = wrapStoreRun(store, data, run, transform);\n }\n return run();\n }\n}\n\nclass Channel {\n constructor(name) {\n this._subscribers = @undefined, this._stores = @undefined, this.name = name, channels.set(name, this);\n }\n static [SymbolHasInstance](instance) {\n const prototype = ObjectGetPrototypeOf(instance);\n return prototype === Channel.prototype || prototype === ActiveChannel.prototype;\n }\n subscribe(subscription) {\n markActive(this), this.subscribe(subscription);\n }\n unsubscribe() {\n return !1;\n }\n bindStore(store, transform) {\n markActive(this), this.bindStore(store, transform);\n }\n unbindStore() {\n return !1;\n }\n get hasSubscribers() {\n return !1;\n }\n publish() {\n }\n runStores(data, fn, thisArg, ...args) {\n return ReflectApply(fn, thisArg, args);\n }\n}\nvar channels = new WeakRefMap, traceEvents = [\"start\", \"end\", \"asyncStart\", \"asyncEnd\", \"error\"];\n\nclass TracingChannel {\n constructor(nameOrChannels) {\n if (typeof nameOrChannels === \"string\")\n this.start = channel(`tracing:${nameOrChannels}:start`), this.end = channel(`tracing:${nameOrChannels}:end`), this.asyncStart = channel(`tracing:${nameOrChannels}:asyncStart`), this.asyncEnd = channel(`tracing:${nameOrChannels}:asyncEnd`), this.error = channel(`tracing:${nameOrChannels}:error`);\n else if (typeof nameOrChannels === \"object\") {\n const { start, end, asyncStart, asyncEnd, error } = nameOrChannels;\n assertChannel(start, \"nameOrChannels.start\"), assertChannel(end, \"nameOrChannels.end\"), assertChannel(asyncStart, \"nameOrChannels.asyncStart\"), assertChannel(asyncEnd, \"nameOrChannels.asyncEnd\"), assertChannel(error, \"nameOrChannels.error\"), this.start = start, this.end = end, this.asyncStart = asyncStart, this.asyncEnd = asyncEnd, this.error = error;\n } else\n throw new ERR_INVALID_ARG_TYPE(\"nameOrChannels\", [\"string\", \"object\", \"Channel\"], nameOrChannels);\n }\n subscribe(handlers) {\n for (let name of traceEvents) {\n if (!handlers[name])\n continue;\n this[name]\?.subscribe(handlers[name]);\n }\n }\n unsubscribe(handlers) {\n let done = !0;\n for (let name of traceEvents) {\n if (!handlers[name])\n continue;\n if (!this[name]\?.unsubscribe(handlers[name]))\n done = !1;\n }\n return done;\n }\n traceSync(fn, context = {}, thisArg, ...args) {\n const { start, end, error } = this;\n return start.runStores(context, () => {\n try {\n const result = ReflectApply(fn, thisArg, args);\n return context.result = result, result;\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n tracePromise(fn, context = {}, thisArg, ...args) {\n const { start, end, asyncStart, asyncEnd, error } = this;\n function reject(err) {\n return context.error = err, error.publish(context), asyncStart.publish(context), asyncEnd.publish(context), PromiseReject(err);\n }\n function resolve(result) {\n return context.result = result, asyncStart.publish(context), asyncEnd.publish(context), result;\n }\n return start.runStores(context, () => {\n try {\n let promise = ReflectApply(fn, thisArg, args);\n if (!(promise instanceof @Promise))\n promise = PromiseResolve(promise);\n return PromisePrototypeThen(promise, resolve, reject);\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n traceCallback(fn, position = -1, context = {}, thisArg, ...args) {\n const { start, end, asyncStart, asyncEnd, error } = this;\n function wrappedCallback(err, res) {\n if (err)\n context.error = err, error.publish(context);\n else\n context.result = res;\n asyncStart.runStores(context, () => {\n try {\n if (callback)\n return ReflectApply(callback, this, arguments);\n } finally {\n asyncEnd.publish(context);\n }\n });\n }\n const callback = ArrayPrototypeAt(args, position);\n if (typeof callback !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(\"callback\", [\"function\"], callback);\n return ArrayPrototypeSplice(args, position, 1, wrappedCallback), start.runStores(context, () => {\n try {\n return ReflectApply(fn, thisArg, args);\n } catch (err) {\n throw context.error = err, error.publish(context), err;\n } finally {\n end.publish(context);\n }\n });\n }\n}\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\n$ = {\n channel,\n hasSubscribers,\n subscribe,\n tracingChannel,\n unsubscribe,\n Channel\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeDNSCode = "(function (){\"use strict\";// src/js/out/tmp/node/dns.ts\nvar getServers = function() {\n return dns.getServers();\n}, lookup = function(domain, options, callback) {\n if (typeof options == \"function\")\n callback = options;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n if (typeof options == \"number\")\n options = { family: options };\n dns.lookup(domain, options).then((res) => {\n if (res.sort((a, b) => a.family - b.family), options\?.all)\n callback(null, res.map(mapLookupAll));\n else {\n const [{ address, family }] = res;\n callback(null, address, family);\n }\n }, (error) => {\n callback(error);\n });\n}, resolveSrv = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveTxt = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveSoa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNaptr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveMx = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCaa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNs = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolvePtr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCname = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, lookupService = function(address, port, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n callback(null, address, port);\n}, reverse = function(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolve = function(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(({ address }) => address));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n}, Resolver = function(options) {\n return new InternalResolver(options);\n}, setDefaultResultOrder = function() {\n}, setServers = function() {\n}, $, dns = Bun.dns, InternalResolver = class Resolver2 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype, rrtype = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(mapResolveX));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n }\n resolve4(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 4 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(mapResolveX));\n }, (error) => {\n callback(error);\n });\n }\n resolve6(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 6 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(({ address }) => address));\n }, (error) => {\n callback(error);\n });\n }\n resolveAny(hostname, callback) {\n callback(null, []);\n }\n resolveCname(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveMx(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNaptr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNs(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolvePtr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSrv(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveCaa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveTxt(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSoa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n reverse(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n setServers(servers) {\n }\n};\nResolver.prototype = {};\nObject.setPrototypeOf(Resolver.prototype, InternalResolver.prototype);\nObject.setPrototypeOf(Resolver, InternalResolver);\nvar {\n resolve,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNaptr,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n reverse,\n resolveTxt\n} = InternalResolver.prototype, promisifyLookup = (res) => {\n res.sort((a, b) => a.family - b.family);\n const [{ address, family }] = res;\n return { address, family };\n}, mapLookupAll = (res) => {\n const { address, family } = res;\n return { address, family };\n}, promisifyLookupAll = (res) => {\n return res.sort((a, b) => a.family - b.family), res.map(mapLookupAll);\n}, mapResolveX = (a) => a.address, promisifyResolveX = (res) => {\n return res\?.map(mapResolveX);\n}, promises = {\n lookup(domain, options) {\n if (options\?.all)\n return dns.lookup(domain, options).then(promisifyLookupAll);\n return dns.lookup(domain, options).then(promisifyLookup);\n },\n lookupService(address, port) {\n return Promise.resolve([]);\n },\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n },\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n },\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n },\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n },\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n },\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n },\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n },\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n },\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n },\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n },\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n },\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n },\n reverse(ip) {\n return dns.reverse(ip);\n },\n Resolver: class Resolver3 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n }\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n }\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n }\n resolveAny(hostname) {\n return Promise.resolve([]);\n }\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n }\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n }\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n }\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n }\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n }\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n }\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n }\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n }\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n }\n reverse(ip) {\n return dns.reverse(ip);\n }\n setServers(servers) {\n }\n }\n};\nfor (let key of [\"resolveAny\"])\n promises[key] = () => Promise.resolve(void 0);\n$ = {\n ADDRCONFIG: 0,\n ALL: 1,\n V4MAPPED: 2,\n NODATA: \"DNS_ENODATA\",\n FORMERR: \"DNS_EFORMERR\",\n SERVFAIL: \"DNS_ESERVFAIL\",\n NOTFOUND: \"DNS_ENOTFOUND\",\n NOTIMP: \"DNS_ENOTIMP\",\n REFUSED: \"DNS_EREFUSED\",\n BADQUERY: \"DNS_EBADQUERY\",\n BADNAME: \"DNS_EBADNAME\",\n BADFAMILY: \"DNS_EBADFAMILY\",\n BADRESP: \"DNS_EBADRESP\",\n CONNREFUSED: \"DNS_ECONNREFUSED\",\n TIMEOUT: \"DNS_ETIMEOUT\",\n EOF: \"DNS_EEOF\",\n FILE: \"DNS_EFILE\",\n NOMEM: \"DNS_ENOMEM\",\n DESTRUCTION: \"DNS_EDESTRUCTION\",\n BADSTR: \"DNS_EBADSTR\",\n BADFLAGS: \"DNS_EBADFLAGS\",\n NONAME: \"DNS_ENONAME\",\n BADHINTS: \"DNS_EBADHINTS\",\n NOTINITIALIZED: \"DNS_ENOTINITIALIZED\",\n LOADIPHLPAPI: \"DNS_ELOADIPHLPAPI\",\n ADDRGETNETWORKPARAMS: \"DNS_EADDRGETNETWORKPARAMS\",\n CANCELLED: \"DNS_ECANCELLED\",\n lookup,\n lookupService,\n Resolver,\n setServers,\n setDefaultResultOrder,\n resolve,\n reverse,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n resolveTxt,\n resolveNaptr,\n promises,\n getServers\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeDNSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/dns.ts\nvar getServers = function() {\n return dns.getServers();\n}, lookup = function(domain, options, callback) {\n if (typeof options == \"function\")\n callback = options;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n if (typeof options == \"number\")\n options = { family: options };\n if (domain !== domain || typeof domain !== \"number\" && !domain) {\n console.warn(`DeprecationWarning: The provided hostname \"${@String(domain)}\" is not a valid hostname, and is supported in the dns module solely for compatibility.`), callback(null, null, 4);\n return;\n }\n dns.lookup(domain, options).then((res) => {\n if (res.sort((a, b) => a.family - b.family), options\?.all)\n callback(null, res.map(mapLookupAll));\n else {\n const [{ address, family }] = res;\n callback(null, address, family);\n }\n }, (error) => {\n callback(error);\n });\n}, resolveSrv = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveTxt = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveSoa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNaptr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveMx = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCaa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNs = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolvePtr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCname = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, lookupService = function(address, port, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookupService(address, port, callback).then((results) => {\n callback(null, ...results);\n }, (error) => {\n callback(error);\n });\n}, reverse = function(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolve = function(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(({ address }) => address));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n}, Resolver = function(options) {\n return new InternalResolver(options);\n}, setDefaultResultOrder = function() {\n}, setServers = function() {\n}, $, dns = Bun.dns, InternalResolver = class Resolver2 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype, rrtype = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(mapResolveX));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n }\n resolve4(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 4 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(mapResolveX));\n }, (error) => {\n callback(error);\n });\n }\n resolve6(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 6 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(({ address }) => address));\n }, (error) => {\n callback(error);\n });\n }\n resolveAny(hostname, callback) {\n callback(null, []);\n }\n resolveCname(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveMx(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNaptr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNs(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolvePtr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSrv(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveCaa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveTxt(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSoa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n reverse(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n setServers(servers) {\n }\n};\nResolver.prototype = {};\nObject.setPrototypeOf(Resolver.prototype, InternalResolver.prototype);\nObject.setPrototypeOf(Resolver, InternalResolver);\nvar {\n resolve,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNaptr,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n reverse,\n resolveTxt\n} = InternalResolver.prototype, promisifyLookup = (res) => {\n res.sort((a, b) => a.family - b.family);\n const [{ address, family }] = res;\n return { address, family };\n}, mapLookupAll = (res) => {\n const { address, family } = res;\n return { address, family };\n}, promisifyLookupAll = (res) => {\n return res.sort((a, b) => a.family - b.family), res.map(mapLookupAll);\n}, mapResolveX = (a) => a.address, promisifyResolveX = (res) => {\n return res\?.map(mapResolveX);\n}, promises = {\n lookup(domain, options) {\n if (options\?.all)\n return dns.lookup(domain, options).then(promisifyLookupAll);\n return dns.lookup(domain, options).then(promisifyLookup);\n },\n lookupService(address, port) {\n return dns.lookupService(address, port);\n },\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n },\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n },\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n },\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n },\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n },\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n },\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n },\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n },\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n },\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n },\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n },\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n },\n reverse(ip) {\n return dns.reverse(ip);\n },\n Resolver: class Resolver3 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n }\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n }\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n }\n resolveAny(hostname) {\n return @Promise.resolve([]);\n }\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n }\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n }\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n }\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n }\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n }\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n }\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n }\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n }\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n }\n reverse(ip) {\n return dns.reverse(ip);\n }\n setServers(servers) {\n }\n }\n};\nfor (let key of [\"resolveAny\"])\n promises[key] = () => @Promise.resolve(@undefined);\n$ = {\n ADDRCONFIG: 0,\n ALL: 1,\n V4MAPPED: 2,\n NODATA: \"DNS_ENODATA\",\n FORMERR: \"DNS_EFORMERR\",\n SERVFAIL: \"DNS_ESERVFAIL\",\n NOTFOUND: \"DNS_ENOTFOUND\",\n NOTIMP: \"DNS_ENOTIMP\",\n REFUSED: \"DNS_EREFUSED\",\n BADQUERY: \"DNS_EBADQUERY\",\n BADNAME: \"DNS_EBADNAME\",\n BADFAMILY: \"DNS_EBADFAMILY\",\n BADRESP: \"DNS_EBADRESP\",\n CONNREFUSED: \"DNS_ECONNREFUSED\",\n TIMEOUT: \"DNS_ETIMEOUT\",\n EOF: \"DNS_EEOF\",\n FILE: \"DNS_EFILE\",\n NOMEM: \"DNS_ENOMEM\",\n DESTRUCTION: \"DNS_EDESTRUCTION\",\n BADSTR: \"DNS_EBADSTR\",\n BADFLAGS: \"DNS_EBADFLAGS\",\n NONAME: \"DNS_ENONAME\",\n BADHINTS: \"DNS_EBADHINTS\",\n NOTINITIALIZED: \"DNS_ENOTINITIALIZED\",\n LOADIPHLPAPI: \"DNS_ELOADIPHLPAPI\",\n ADDRGETNETWORKPARAMS: \"DNS_EADDRGETNETWORKPARAMS\",\n CANCELLED: \"DNS_ECANCELLED\",\n lookup,\n lookupService,\n Resolver,\n setServers,\n setDefaultResultOrder,\n resolve,\n reverse,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n resolveTxt,\n resolveNaptr,\n promises,\n getServers\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeDNSPromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/dns.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 15) || @createInternalModuleById(15)).promises})\n"_s;
+static constexpr ASCIILiteral NodeDNSPromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/dns.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 17) || @createInternalModuleById(17)).promises})\n");
//
//
-static constexpr ASCIILiteral NodeDomainCode = "(function (){\"use strict\";// src/js/out/tmp/node/domain.ts\nvar EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), domain = {};\ndomain.createDomain = domain.create = function() {\n var d = new EventEmitter;\n function emitError(e) {\n d.emit(\"error\", e);\n }\n return d.add = function(emitter) {\n emitter.on(\"error\", emitError);\n }, d.remove = function(emitter) {\n emitter.removeListener(\"error\", emitError);\n }, d.bind = function(fn) {\n return function() {\n var args = Array.prototype.slice.call(arguments);\n try {\n fn.apply(null, args);\n } catch (err) {\n emitError(err);\n }\n };\n }, d.intercept = function(fn) {\n return function(err) {\n if (err)\n emitError(err);\n else {\n var args = Array.prototype.slice.call(arguments, 1);\n try {\n fn.apply(null, args);\n } catch (err2) {\n emitError(err2);\n }\n }\n };\n }, d.run = function(fn) {\n try {\n fn();\n } catch (err) {\n emitError(err);\n }\n return this;\n }, d.dispose = function() {\n return this.removeAllListeners(), this;\n }, d.enter = d.exit = function() {\n return this;\n }, d;\n};\nreturn domain})\n"_s;
+static constexpr ASCIILiteral NodeDomainCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/domain.ts\nvar EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), domain = {};\ndomain.createDomain = domain.create = function() {\n var d = new EventEmitter;\n function emitError(e) {\n d.emit(\"error\", e);\n }\n return d.add = function(emitter) {\n emitter.on(\"error\", emitError);\n }, d.remove = function(emitter) {\n emitter.removeListener(\"error\", emitError);\n }, d.bind = function(fn) {\n return function() {\n var args = @Array.prototype.slice.@call(arguments);\n try {\n fn.@apply(null, args);\n } catch (err) {\n emitError(err);\n }\n };\n }, d.intercept = function(fn) {\n return function(err) {\n if (err)\n emitError(err);\n else {\n var args = @Array.prototype.slice.@call(arguments, 1);\n try {\n fn.@apply(null, args);\n } catch (err2) {\n emitError(err2);\n }\n }\n };\n }, d.run = function(fn) {\n try {\n fn();\n } catch (err) {\n emitError(err);\n }\n return this;\n }, d.dispose = function() {\n return this.removeAllListeners(), this;\n }, d.enter = d.exit = function() {\n return this;\n }, d;\n};\nreturn domain})\n");
//
//
-static constexpr ASCIILiteral NodeEventsCode = "(function (){\"use strict\";// src/js/out/tmp/node/events.ts\nvar emitError = function(emitter, args) {\n var { _events: events } = emitter;\n if (args[0] \?\?= new Error(\"Unhandled error.\"), !events)\n throw args[0];\n var errorMonitor = events[kErrorMonitor];\n if (errorMonitor)\n for (var handler of ArrayPrototypeSlice.call(errorMonitor))\n handler.apply(emitter, args);\n var handlers = events.error;\n if (!handlers)\n throw args[0];\n for (var handler of ArrayPrototypeSlice.call(handlers))\n handler.apply(emitter, args);\n return !0;\n}, addCatch = function(emitter, promise, type, args) {\n promise.then(void 0, function(err) {\n process.nextTick(emitUnhandledRejectionOrErr, emitter, err, type, args);\n });\n}, emitUnhandledRejectionOrErr = function(emitter, err, type, args) {\n if (typeof emitter[kRejection] === \"function\")\n emitter[kRejection](err, type, ...args);\n else\n try {\n emitter[kCapture] = !1, emitter.emit(\"error\", err);\n } finally {\n emitter[kCapture] = !0;\n }\n}, overflowWarning = function(emitter, type, handlers) {\n handlers.warned = !0;\n const warn = new Error(`Possible EventEmitter memory leak detected. ${handlers.length} ${String(type)} listeners ` + `added to [${emitter.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);\n warn.name = \"MaxListenersExceededWarning\", warn.emitter = emitter, warn.type = type, warn.count = handlers.length, process.emitWarning(warn);\n}, onceWrapper = function(type, listener, ...args) {\n this.removeListener(type, listener), listener.apply(this, args);\n}, once = function(emitter, type, options) {\n var signal = options\?.signal;\n if (validateAbortSignal(signal, \"options.signal\"), signal\?.aborted)\n throw new AbortError(void 0, { cause: signal\?.reason });\n return new Promise((resolve, reject) => {\n const errorListener = (err) => {\n if (emitter.removeListener(type, resolver), signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n reject(err);\n }, resolver = (...args) => {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(\"error\", errorListener);\n if (signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n resolve(args);\n };\n if (eventTargetAgnosticAddListener(emitter, type, resolver, { once: !0 }), type !== \"error\" && typeof emitter.once === \"function\")\n emitter.once(\"error\", errorListener);\n function abortListener() {\n eventTargetAgnosticRemoveListener(emitter, type, resolver), eventTargetAgnosticRemoveListener(emitter, \"error\", errorListener), reject(new AbortError(void 0, { cause: signal\?.reason }));\n }\n if (signal != null)\n eventTargetAgnosticAddListener(signal, \"abort\", abortListener, { once: !0 });\n });\n}, on = function(emitter, type, options) {\n var { signal, close, highWatermark = Number.MAX_SAFE_INTEGER, lowWatermark = 1 } = options || {};\n throwNotImplemented(\"events.on\", 2679);\n}, getEventListeners = function(emitter, type) {\n if (emitter instanceof EventTarget)\n throwNotImplemented(\"getEventListeners with an EventTarget\", 2678);\n return emitter.listeners(type);\n}, setMaxListeners = function(n, ...eventTargets) {\n validateNumber(n, \"setMaxListeners\", 0);\n var length;\n if (eventTargets && (length = eventTargets.length))\n for (let i = 0;i < length; i++)\n eventTargets[i].setMaxListeners(n);\n else\n defaultMaxListeners = n;\n}, listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n}, eventTargetAgnosticRemoveListener = function(emitter, name, listener, flags) {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(name, listener);\n else\n emitter.removeEventListener(name, listener, flags);\n}, eventTargetAgnosticAddListener = function(emitter, name, listener, flags) {\n if (typeof emitter.on === \"function\")\n if (flags.once)\n emitter.once(name, listener);\n else\n emitter.on(name, listener);\n else\n emitter.addEventListener(name, listener, flags);\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_OUT_OF_RANGE = function(name, range, value) {\n const err = new RangeError(`The \"${name}\" argument is out of range. It must be ${range}. Received ${value}`);\n return err.code = \"ERR_OUT_OF_RANGE\", err;\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateNumber = function(value, name, min = void 0, max) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (min != null && value < min || max != null && value > max || (min != null || max != null) && Number.isNaN(value))\n throw new ERR_OUT_OF_RANGE(name, `${min != null \? `>= ${min}` : \"\"}${min != null && max != null \? \" && \" : \"\"}${max != null \? `<= ${max}` : \"\"}`, value);\n}, checkListener = function(listener) {\n if (typeof listener !== \"function\")\n @throwTypeError(\"The listener must be a function\");\n}, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), SymbolFor = Symbol.for, kCapture = Symbol(\"kCapture\"), kErrorMonitor = SymbolFor(\"events.errorMonitor\"), kMaxEventTargetListeners = Symbol(\"events.maxEventTargetListeners\"), kMaxEventTargetListenersWarned = Symbol(\"events.maxEventTargetListenersWarned\"), kWatermarkData = SymbolFor(\"nodejs.watermarkData\"), kRejection = SymbolFor(\"nodejs.rejection\"), captureRejectionSymbol = SymbolFor(\"nodejs.rejection\"), ArrayPrototypeSlice = Array.prototype.slice, defaultMaxListeners = 10, EventEmitter = function EventEmitter2(opts) {\n if (this._events === void 0 || this._events === this.__proto__._events)\n this._events = { __proto__: null }, this._eventsCount = 0;\n if (this._maxListeners \?\?= void 0, this[kCapture] = opts\?.captureRejections \? Boolean(opts\?.captureRejections) : EventEmitterPrototype[kCapture])\n this.emit = emitWithRejectionCapture;\n}, EventEmitterPrototype = EventEmitter.prototype = {};\nEventEmitterPrototype._events = void 0;\nEventEmitterPrototype._eventsCount = 0;\nEventEmitterPrototype._maxListeners = void 0;\nEventEmitterPrototype.setMaxListeners = function setMaxListeners2(n) {\n return validateNumber(n, \"setMaxListeners\", 0), this._maxListeners = n, this;\n};\nEventEmitterPrototype.constructor = EventEmitter;\nEventEmitterPrototype.getMaxListeners = function getMaxListeners() {\n return this._maxListeners \?\? defaultMaxListeners;\n};\nvar emitWithoutRejectionCapture = function emit(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers])\n handler.apply(this, args);\n return !0;\n}, emitWithRejectionCapture = function emit2(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === void 0)\n return !1;\n var handlers = events[type];\n if (handlers === void 0)\n return !1;\n for (var handler of [...handlers]) {\n var result = handler.apply(this, args);\n if (result !== void 0 && @isPromise(result))\n addCatch(this, result, type, args);\n }\n return !0;\n};\nEventEmitterPrototype.emit = emitWithoutRejectionCapture;\nEventEmitterPrototype.addListener = function addListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.push(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.on = EventEmitterPrototype.addListener;\nEventEmitterPrototype.prependListener = function prependListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.unshift(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.once = function once2(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.addListener(type, bound), this;\n};\nEventEmitterPrototype.prependOnceListener = function prependOnceListener(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.prependListener(type, bound), this;\n};\nEventEmitterPrototype.removeListener = function removeListener(type, fn) {\n checkListener(fn);\n var { _events: events } = this;\n if (!events)\n return this;\n var handlers = events[type];\n if (!handlers)\n return this;\n var length = handlers.length;\n let position = -1;\n for (let i = length - 1;i >= 0; i--)\n if (handlers[i] === fn || handlers[i].listener === fn) {\n position = i;\n break;\n }\n if (position < 0)\n return this;\n if (position === 0)\n handlers.shift();\n else\n handlers.splice(position, 1);\n if (handlers.length === 0)\n delete events[type], this._eventsCount--;\n return this;\n};\nEventEmitterPrototype.off = EventEmitterPrototype.removeListener;\nEventEmitterPrototype.removeAllListeners = function removeAllListeners(type) {\n var { _events: events } = this;\n if (type && events) {\n if (events[type])\n delete events[type], this._eventsCount--;\n } else\n this._events = { __proto__: null };\n return this;\n};\nEventEmitterPrototype.listeners = function listeners(type) {\n var { _events: events } = this;\n if (!events)\n return [];\n var handlers = events[type];\n if (!handlers)\n return [];\n return handlers.map((x) => x.listener \?\? x);\n};\nEventEmitterPrototype.rawListeners = function rawListeners(type) {\n var { _events } = this;\n if (!_events)\n return [];\n var handlers = _events[type];\n if (!handlers)\n return [];\n return handlers.slice();\n};\nEventEmitterPrototype.listenerCount = function listenerCount2(type) {\n var { _events: events } = this;\n if (!events)\n return 0;\n return events[type]\?.length \?\? 0;\n};\nEventEmitterPrototype.eventNames = function eventNames() {\n return this._eventsCount > 0 \? Reflect.ownKeys(this._events) : [];\n};\nEventEmitterPrototype[kCapture] = !1;\n\nclass AbortError extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n}\nvar AsyncResource = null;\n\nclass EventEmitterAsyncResource extends EventEmitter {\n triggerAsyncId;\n asyncResource;\n constructor(options) {\n if (!AsyncResource)\n AsyncResource = (@getInternalField(@internalModuleRegistry, 8) || @createInternalModuleById(8)).AsyncResource;\n var { captureRejections = !1, triggerAsyncId, name = new.target.name, requireManualDestroy } = options || {};\n super({ captureRejections });\n this.triggerAsyncId = triggerAsyncId \?\? 0, this.asyncResource = new AsyncResource(name, { triggerAsyncId, requireManualDestroy });\n }\n emit(...args) {\n this.asyncResource.runInAsyncScope(() => super.emit(...args));\n }\n emitDestroy() {\n this.asyncResource.emitDestroy();\n }\n}\nObject.defineProperties(EventEmitter, {\n captureRejections: {\n get() {\n return EventEmitterPrototype[kCapture];\n },\n set(value) {\n validateBoolean(value, \"EventEmitter.captureRejections\"), EventEmitterPrototype[kCapture] = value;\n },\n enumerable: !0\n },\n defaultMaxListeners: {\n enumerable: !0,\n get: () => {\n return defaultMaxListeners;\n },\n set: (arg) => {\n validateNumber(arg, \"defaultMaxListeners\", 0), defaultMaxListeners = arg;\n }\n },\n kMaxEventTargetListeners: {\n value: kMaxEventTargetListeners,\n enumerable: !1,\n configurable: !1,\n writable: !1\n },\n kMaxEventTargetListenersWarned: {\n value: kMaxEventTargetListenersWarned,\n enumerable: !1,\n configurable: !1,\n writable: !1\n }\n});\nObject.assign(EventEmitter, {\n once,\n on,\n getEventListeners,\n setMaxListeners,\n EventEmitter,\n usingDomains: !1,\n captureRejectionSymbol,\n EventEmitterAsyncResource,\n errorMonitor: kErrorMonitor,\n setMaxListeners,\n init: EventEmitter,\n listenerCount\n});\nreturn EventEmitter})\n"_s;
+static constexpr ASCIILiteral NodeEventsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/events.ts\nvar emitError = function(emitter, args) {\n var { _events: events } = emitter;\n if (args[0] \?\?= new Error(\"Unhandled error.\"), !events)\n throw args[0];\n var errorMonitor = events[kErrorMonitor];\n if (errorMonitor)\n for (var handler of ArrayPrototypeSlice.@call(errorMonitor))\n handler.@apply(emitter, args);\n var handlers = events.error;\n if (!handlers)\n throw args[0];\n for (var handler of ArrayPrototypeSlice.@call(handlers))\n handler.@apply(emitter, args);\n return !0;\n}, addCatch = function(emitter, promise, type, args) {\n promise.then(@undefined, function(err) {\n process.nextTick(emitUnhandledRejectionOrErr, emitter, err, type, args);\n });\n}, emitUnhandledRejectionOrErr = function(emitter, err, type, args) {\n if (typeof emitter[kRejection] === \"function\")\n emitter[kRejection](err, type, ...args);\n else\n try {\n emitter[kCapture] = !1, emitter.emit(\"error\", err);\n } finally {\n emitter[kCapture] = !0;\n }\n}, overflowWarning = function(emitter, type, handlers) {\n handlers.warned = !0;\n const warn = new Error(`Possible EventEmitter memory leak detected. ${handlers.length} ${@String(type)} listeners ` + `added to [${emitter.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);\n warn.name = \"MaxListenersExceededWarning\", warn.emitter = emitter, warn.type = type, warn.count = handlers.length, process.emitWarning(warn);\n}, onceWrapper = function(type, listener, ...args) {\n this.removeListener(type, listener), listener.@apply(this, args);\n}, once = function(emitter, type, options) {\n var signal = options\?.signal;\n if (validateAbortSignal(signal, \"options.signal\"), signal\?.aborted)\n throw new AbortError(@undefined, { cause: signal\?.reason });\n return new @Promise((resolve, reject) => {\n const errorListener = (err) => {\n if (emitter.removeListener(type, resolver), signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n reject(err);\n }, resolver = (...args) => {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(\"error\", errorListener);\n if (signal != null)\n eventTargetAgnosticRemoveListener(signal, \"abort\", abortListener);\n resolve(args);\n };\n if (eventTargetAgnosticAddListener(emitter, type, resolver, { once: !0 }), type !== \"error\" && typeof emitter.once === \"function\")\n emitter.once(\"error\", errorListener);\n function abortListener() {\n eventTargetAgnosticRemoveListener(emitter, type, resolver), eventTargetAgnosticRemoveListener(emitter, \"error\", errorListener), reject(new AbortError(@undefined, { cause: signal\?.reason }));\n }\n if (signal != null)\n eventTargetAgnosticAddListener(signal, \"abort\", abortListener, { once: !0 });\n });\n}, on = function(emitter, type, options) {\n var { signal, close, highWatermark = Number.MAX_SAFE_INTEGER, lowWatermark = 1 } = options || {};\n throwNotImplemented(\"events.on\", 2679);\n}, getEventListeners = function(emitter, type) {\n if (emitter instanceof EventTarget)\n throwNotImplemented(\"getEventListeners with an EventTarget\", 2678);\n return emitter.listeners(type);\n}, setMaxListeners = function(n, ...eventTargets) {\n validateNumber(n, \"setMaxListeners\", 0);\n var length;\n if (eventTargets && (length = eventTargets.length))\n for (let i = 0;i < length; i++)\n eventTargets[i].setMaxListeners(n);\n else\n defaultMaxListeners = n;\n}, listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n}, eventTargetAgnosticRemoveListener = function(emitter, name, listener, flags) {\n if (typeof emitter.removeListener === \"function\")\n emitter.removeListener(name, listener);\n else\n emitter.removeEventListener(name, listener, flags);\n}, eventTargetAgnosticAddListener = function(emitter, name, listener, flags) {\n if (typeof emitter.on === \"function\")\n if (flags.once)\n emitter.once(name, listener);\n else\n emitter.on(name, listener);\n else\n emitter.addEventListener(name, listener, flags);\n}, ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, ERR_OUT_OF_RANGE = function(name, range, value) {\n const err = new RangeError(`The \"${name}\" argument is out of range. It must be ${range}. Received ${value}`);\n return err.code = \"ERR_OUT_OF_RANGE\", err;\n}, validateAbortSignal = function(signal, name) {\n if (signal !== @undefined && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateNumber = function(value, name, min = @undefined, max) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (min != null && value < min || max != null && value > max || (min != null || max != null) && Number.isNaN(value))\n throw new ERR_OUT_OF_RANGE(name, `${min != null \? `>= ${min}` : \"\"}${min != null && max != null \? \" && \" : \"\"}${max != null \? `<= ${max}` : \"\"}`, value);\n}, checkListener = function(listener) {\n if (typeof listener !== \"function\")\n @throwTypeError(\"The listener must be a function\");\n}, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), SymbolFor = Symbol.for, kCapture = Symbol(\"kCapture\"), kErrorMonitor = SymbolFor(\"events.errorMonitor\"), kMaxEventTargetListeners = Symbol(\"events.maxEventTargetListeners\"), kMaxEventTargetListenersWarned = Symbol(\"events.maxEventTargetListenersWarned\"), kWatermarkData = SymbolFor(\"nodejs.watermarkData\"), kRejection = SymbolFor(\"nodejs.rejection\"), captureRejectionSymbol = SymbolFor(\"nodejs.rejection\"), ArrayPrototypeSlice = @Array.prototype.slice, defaultMaxListeners = 10, EventEmitter = function EventEmitter2(opts) {\n if (this._events === @undefined || this._events === this.__proto__._events)\n this._events = { __proto__: null }, this._eventsCount = 0;\n if (this._maxListeners \?\?= @undefined, this[kCapture] = opts\?.captureRejections \? Boolean(opts\?.captureRejections) : EventEmitterPrototype[kCapture])\n this.emit = emitWithRejectionCapture;\n}, EventEmitterPrototype = EventEmitter.prototype = {};\nEventEmitterPrototype._events = @undefined;\nEventEmitterPrototype._eventsCount = 0;\nEventEmitterPrototype._maxListeners = @undefined;\nEventEmitterPrototype.setMaxListeners = function setMaxListeners2(n) {\n return validateNumber(n, \"setMaxListeners\", 0), this._maxListeners = n, this;\n};\nEventEmitterPrototype.constructor = EventEmitter;\nEventEmitterPrototype.getMaxListeners = function getMaxListeners() {\n return this._maxListeners \?\? defaultMaxListeners;\n};\nvar emitWithoutRejectionCapture = function emit(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === @undefined)\n return !1;\n var handlers = events[type];\n if (handlers === @undefined)\n return !1;\n const maybeClonedHandlers = handlers.length > 1 \? handlers.slice() : handlers;\n for (let i = 0, { length } = maybeClonedHandlers;i < length; i++) {\n const handler = maybeClonedHandlers[i];\n switch (args.length) {\n case 0:\n handler.@call(this);\n break;\n case 1:\n handler.@call(this, args[0]);\n break;\n case 2:\n handler.@call(this, args[0], args[1]);\n break;\n case 3:\n handler.@call(this, args[0], args[1], args[2]);\n break;\n default:\n handler.@apply(this, args);\n break;\n }\n }\n return !0;\n}, emitWithRejectionCapture = function emit2(type, ...args) {\n if (type === \"error\")\n return emitError(this, args);\n var { _events: events } = this;\n if (events === @undefined)\n return !1;\n var handlers = events[type];\n if (handlers === @undefined)\n return !1;\n const maybeClonedHandlers = handlers.length > 1 \? handlers.slice() : handlers;\n for (let i = 0, { length } = maybeClonedHandlers;i < length; i++) {\n const handler = maybeClonedHandlers[i];\n let result;\n switch (args.length) {\n case 0:\n result = handler.@call(this);\n break;\n case 1:\n result = handler.@call(this, args[0]);\n break;\n case 2:\n result = handler.@call(this, args[0], args[1]);\n break;\n case 3:\n result = handler.@call(this, args[0], args[1], args[2]);\n break;\n default:\n result = handler.@apply(this, args);\n break;\n }\n if (result !== @undefined && @isPromise(result))\n addCatch(this, result, type, args);\n }\n return !0;\n};\nEventEmitterPrototype.emit = emitWithoutRejectionCapture;\nEventEmitterPrototype.addListener = function addListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.push(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.on = EventEmitterPrototype.addListener;\nEventEmitterPrototype.prependListener = function prependListener(type, fn) {\n checkListener(fn);\n var events = this._events;\n if (!events)\n events = this._events = { __proto__: null }, this._eventsCount = 0;\n else if (events.newListener)\n this.emit(\"newListener\", type, fn.listener \?\? fn);\n var handlers = events[type];\n if (!handlers)\n events[type] = [fn], this._eventsCount++;\n else {\n handlers.unshift(fn);\n var m = this._maxListeners \?\? defaultMaxListeners;\n if (m > 0 && handlers.length > m && !handlers.warned)\n overflowWarning(this, type, handlers);\n }\n return this;\n};\nEventEmitterPrototype.once = function once2(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.addListener(type, bound), this;\n};\nEventEmitterPrototype.prependOnceListener = function prependOnceListener(type, fn) {\n checkListener(fn);\n const bound = onceWrapper.bind(this, type, fn);\n return bound.listener = fn, this.prependListener(type, bound), this;\n};\nEventEmitterPrototype.removeListener = function removeListener(type, fn) {\n checkListener(fn);\n var { _events: events } = this;\n if (!events)\n return this;\n var handlers = events[type];\n if (!handlers)\n return this;\n var length = handlers.length;\n let position = -1;\n for (let i = length - 1;i >= 0; i--)\n if (handlers[i] === fn || handlers[i].listener === fn) {\n position = i;\n break;\n }\n if (position < 0)\n return this;\n if (position === 0)\n handlers.shift();\n else\n handlers.splice(position, 1);\n if (handlers.length === 0)\n delete events[type], this._eventsCount--;\n return this;\n};\nEventEmitterPrototype.off = EventEmitterPrototype.removeListener;\nEventEmitterPrototype.removeAllListeners = function removeAllListeners(type) {\n var { _events: events } = this;\n if (type && events) {\n if (events[type])\n delete events[type], this._eventsCount--;\n } else\n this._events = { __proto__: null };\n return this;\n};\nEventEmitterPrototype.listeners = function listeners(type) {\n var { _events: events } = this;\n if (!events)\n return [];\n var handlers = events[type];\n if (!handlers)\n return [];\n return handlers.map((x) => x.listener \?\? x);\n};\nEventEmitterPrototype.rawListeners = function rawListeners(type) {\n var { _events } = this;\n if (!_events)\n return [];\n var handlers = _events[type];\n if (!handlers)\n return [];\n return handlers.slice();\n};\nEventEmitterPrototype.listenerCount = function listenerCount2(type) {\n var { _events: events } = this;\n if (!events)\n return 0;\n return events[type]\?.length \?\? 0;\n};\nEventEmitterPrototype.eventNames = function eventNames() {\n return this._eventsCount > 0 \? Reflect.ownKeys(this._events) : [];\n};\nEventEmitterPrototype[kCapture] = !1;\n\nclass AbortError extends Error {\n constructor(message = \"The operation was aborted\", options = @undefined) {\n if (options !== @undefined && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n}\nvar AsyncResource = null;\n\nclass EventEmitterAsyncResource extends EventEmitter {\n triggerAsyncId;\n asyncResource;\n constructor(options) {\n if (!AsyncResource)\n AsyncResource = (@getInternalField(@internalModuleRegistry, 10) || @createInternalModuleById(10)).AsyncResource;\n var { captureRejections = !1, triggerAsyncId, name = new.target.name, requireManualDestroy } = options || {};\n super({ captureRejections });\n this.triggerAsyncId = triggerAsyncId \?\? 0, this.asyncResource = new AsyncResource(name, { triggerAsyncId, requireManualDestroy });\n }\n emit(...args) {\n this.asyncResource.runInAsyncScope(() => super.emit(...args));\n }\n emitDestroy() {\n this.asyncResource.emitDestroy();\n }\n}\nObject.defineProperties(EventEmitter, {\n captureRejections: {\n get() {\n return EventEmitterPrototype[kCapture];\n },\n set(value) {\n validateBoolean(value, \"EventEmitter.captureRejections\"), EventEmitterPrototype[kCapture] = value;\n },\n enumerable: !0\n },\n defaultMaxListeners: {\n enumerable: !0,\n get: () => {\n return defaultMaxListeners;\n },\n set: (arg) => {\n validateNumber(arg, \"defaultMaxListeners\", 0), defaultMaxListeners = arg;\n }\n },\n kMaxEventTargetListeners: {\n value: kMaxEventTargetListeners,\n enumerable: !1,\n configurable: !1,\n writable: !1\n },\n kMaxEventTargetListenersWarned: {\n value: kMaxEventTargetListenersWarned,\n enumerable: !1,\n configurable: !1,\n writable: !1\n }\n});\nObject.assign(EventEmitter, {\n once,\n on,\n getEventListeners,\n setMaxListeners,\n EventEmitter,\n usingDomains: !1,\n captureRejectionSymbol,\n EventEmitterAsyncResource,\n errorMonitor: kErrorMonitor,\n setMaxListeners,\n init: EventEmitter,\n listenerCount\n});\nreturn EventEmitter})\n");
//
//
-static constexpr ASCIILiteral NodeFSCode = "(function (){\"use strict\";// src/js/out/tmp/node/fs.ts\nvar getValidatedPath = function(p) {\n if (p instanceof URL)\n return Bun.fileURLToPath(p);\n if (typeof p !== \"string\")\n @throwTypeError(\"Path must be a string or URL.\");\n return (_pathModule \?\?= @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28)).resolve(p);\n}, watchFile = function(filename, options, listener) {\n if (filename = getValidatedPath(filename), typeof options === \"function\")\n listener = options, options = {};\n if (typeof listener !== \"function\")\n @throwTypeError(\"listener must be a function\");\n var stat = statWatchers.get(filename);\n if (!stat)\n stat = new StatWatcher(filename, options), statWatchers.set(filename, stat);\n return stat.addListener(\"change\", listener), stat;\n}, unwatchFile = function(filename, listener) {\n filename = getValidatedPath(filename);\n var stat = statWatchers.get(filename);\n if (!stat)\n return;\n if (listener) {\n if (stat.removeListener(\"change\", listener), stat.listenerCount(\"change\") !== 0)\n return;\n } else\n stat.removeAllListeners(\"change\");\n stat.stop(), statWatchers.delete(filename);\n}, callbackify = function(fsFunction, args) {\n try {\n const result = fsFunction.apply(fs, args.slice(0, args.length - 1)), callback = args[args.length - 1];\n if (typeof callback === \"function\")\n queueMicrotask(() => callback(null, result));\n } catch (e) {\n const callback = args[args.length - 1];\n if (typeof callback === \"function\")\n queueMicrotask(() => callback(e));\n }\n}, createReadStream = function(path, options) {\n return new ReadStream(path, options);\n}, WriteStream_handleWrite = function(er, bytes) {\n if (er)\n return WriteStream_errorOrDestroy.call(this, er);\n this.bytesWritten += bytes;\n}, WriteStream_internalClose = function(err, cb) {\n this[_writeStreamPathFastPathSymbol] = !1;\n var fd = this.fd;\n this[_fs].close(fd, (er) => {\n this.fd = null, cb(err || er);\n });\n}, WriteStream_errorOrDestroy = function(err) {\n var {\n _readableState: r = { destroyed: !1, autoDestroy: !1 },\n _writableState: w = { destroyed: !1, autoDestroy: !1 }\n } = this;\n if (w\?.destroyed || r\?.destroyed)\n return this;\n if (r\?.autoDestroy || w\?.autoDestroy)\n this.destroy(err);\n else if (err)\n this.emit(\"error\", err);\n}, createWriteStream = function(path, options) {\n return new WriteStream(path, options);\n}, cpSync = function(src, dest, options) {\n if (!options)\n return fs.cpSync(src, dest);\n if (typeof options !== \"object\")\n @throwTypeError(\"options must be an object\");\n if (options.dereference || options.filter || options.preserveTimestamps || options.verbatimSymlinks) {\n if (!lazy_cpSync)\n lazy_cpSync = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3);\n return lazy_cpSync(src, dest, options);\n }\n return fs.cpSync(src, dest, options.recursive, options.errorOnExist, options.force \?\? !0, options.mode);\n}, cp = function(src, dest, options, callback) {\n if (typeof options === \"function\")\n callback = options, options = void 0;\n promises.cp(src, dest, options).then(() => callback(), callback);\n}, _toUnixTimestamp = function(time, name = \"time\") {\n if (typeof time === \"string\" && +time == time)\n return +time;\n if (NumberIsFinite(time)) {\n if (time < 0)\n return DateNow() / 1000;\n return time;\n }\n if (isDate(time))\n return DatePrototypeGetTime(time) / 1000;\n @throwTypeError(`Expected ${name} to be a number or Date`);\n}, $, ReadStream, WriteStream, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), promises = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), Stream = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), { isArrayBufferView } = @requireNativeModule(\"util/types\"), _writeStreamPathFastPathSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPath\"), _fs = Symbol.for(\"#fs\"), constants = @processBindingConstants.fs, fs = Bun.fs();\n\nclass FSWatcher extends EventEmitter {\n #watcher;\n #listener;\n constructor(path, options, listener) {\n super();\n if (typeof options === \"function\")\n listener = options, options = {};\n else if (typeof options === \"string\")\n options = { encoding: options };\n if (typeof listener !== \"function\")\n listener = () => {\n };\n this.#listener = listener;\n try {\n this.#watcher = fs.watch(path, options || {}, this.#onEvent.bind(this));\n } catch (e) {\n if (!e.message\?.startsWith(\"FileNotFound\"))\n throw e;\n const notFound = new Error(`ENOENT: no such file or directory, watch '${path}'`);\n throw notFound.code = \"ENOENT\", notFound.errno = -2, notFound.path = path, notFound.syscall = \"watch\", notFound.filename = path, notFound;\n }\n }\n #onEvent(eventType, filenameOrError) {\n if (eventType === \"error\" || eventType === \"close\")\n this.emit(eventType, filenameOrError);\n else\n this.emit(\"change\", eventType, filenameOrError), this.#listener(eventType, filenameOrError);\n }\n close() {\n this.#watcher\?.close(), this.#watcher = null;\n }\n ref() {\n this.#watcher\?.ref();\n }\n unref() {\n this.#watcher\?.unref();\n }\n start() {\n }\n}\n\nclass StatWatcher extends EventEmitter {\n constructor(path, options) {\n super();\n this._handle = fs.watchFile(path, options, this.#onChange.bind(this));\n }\n #onChange(curr, prev) {\n this.emit(\"change\", curr, prev);\n }\n start() {\n }\n stop() {\n this._handle\?.close(), this._handle = null;\n }\n ref() {\n this._handle\?.ref();\n }\n unref() {\n this._handle\?.unref();\n }\n}\nvar access = function access2(...args) {\n callbackify(fs.accessSync, args);\n}, appendFile = function appendFile2(...args) {\n callbackify(fs.appendFileSync, args);\n}, close = function close2(...args) {\n callbackify(fs.closeSync, args);\n}, rm = function rm2(...args) {\n callbackify(fs.rmSync, args);\n}, rmdir = function rmdir2(...args) {\n callbackify(fs.rmdirSync, args);\n}, copyFile = function copyFile2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.copyFile(...args).then((result) => callback(null, result), callback);\n}, exists = function exists2(...args) {\n callbackify(fs.existsSync, args);\n}, chown = function chown2(...args) {\n callbackify(fs.chownSync, args);\n}, chmod = function chmod2(...args) {\n callbackify(fs.chmodSync, args);\n}, fchmod = function fchmod2(...args) {\n callbackify(fs.fchmodSync, args);\n}, fchown = function fchown2(...args) {\n callbackify(fs.fchownSync, args);\n}, fstat = function fstat2(...args) {\n callbackify(fs.fstatSync, args);\n}, fsync = function fsync2(...args) {\n callbackify(fs.fsyncSync, args);\n}, ftruncate = function ftruncate2(...args) {\n callbackify(fs.ftruncateSync, args);\n}, futimes = function futimes2(...args) {\n callbackify(fs.futimesSync, args);\n}, lchmod = function lchmod2(...args) {\n callbackify(fs.lchmodSync, args);\n}, lchown = function lchown2(...args) {\n callbackify(fs.lchownSync, args);\n}, link = function link2(...args) {\n callbackify(fs.linkSync, args);\n}, mkdir = function mkdir2(...args) {\n callbackify(fs.mkdirSync, args);\n}, mkdtemp = function mkdtemp2(...args) {\n callbackify(fs.mkdtempSync, args);\n}, open = function open2(...args) {\n callbackify(fs.openSync, args);\n}, read = function read2(fd, buffer, offsetOrOptions, length, position, callback) {\n let offset = offsetOrOptions, params = null;\n if (arguments.length <= 4) {\n if (arguments.length === 4)\n callback = length, params = offsetOrOptions;\n else if (arguments.length === 3) {\n if (!isArrayBufferView(buffer))\n params = buffer, { buffer = Buffer.alloc(16384) } = params \?\? {};\n callback = offsetOrOptions;\n } else\n callback = buffer, buffer = Buffer.alloc(16384);\n ({ offset = 0, length = buffer\?.byteLength - offset, position = null } = params \?\? {});\n }\n queueMicrotask(() => {\n try {\n var bytesRead = fs.readSync(fd, buffer, offset, length, position);\n } catch (e) {\n callback(e);\n }\n callback(null, bytesRead, buffer);\n });\n}, write = function write2(...args) {\n callbackify(fs.writeSync, args);\n}, readdir = function readdir2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.readdir(...args).then((result) => callback(null, result), callback);\n}, readFile = function readFile2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.readFile(...args).then((result) => callback(null, result), callback);\n}, writeFile = function writeFile2(...args) {\n callbackify(fs.writeFileSync, args);\n}, readlink = function readlink2(...args) {\n callbackify(fs.readlinkSync, args);\n}, realpath = function realpath2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.realpath(...args).then((result) => callback(null, result), callback);\n}, rename = function rename2(...args) {\n callbackify(fs.renameSync, args);\n}, lstat = function lstat2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.lstat(...args).then((result) => callback(null, result), callback);\n}, stat = function stat2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.stat(...args).then((result) => callback(null, result), callback);\n}, symlink = function symlink2(...args) {\n callbackify(fs.symlinkSync, args);\n}, truncate = function truncate2(...args) {\n callbackify(fs.truncateSync, args);\n}, unlink = function unlink2(...args) {\n callbackify(fs.unlinkSync, args);\n}, utimes = function utimes2(...args) {\n callbackify(fs.utimesSync, args);\n}, lutimes = function lutimes2(...args) {\n callbackify(fs.lutimesSync, args);\n}, accessSync = fs.accessSync.bind(fs), appendFileSync = fs.appendFileSync.bind(fs), closeSync = fs.closeSync.bind(fs), copyFileSync = fs.copyFileSync.bind(fs), existsSync = fs.existsSync.bind(fs), chownSync = fs.chownSync.bind(fs), chmodSync = fs.chmodSync.bind(fs), fchmodSync = fs.fchmodSync.bind(fs), fchownSync = fs.fchownSync.bind(fs), fstatSync = fs.fstatSync.bind(fs), fsyncSync = fs.fsyncSync.bind(fs), ftruncateSync = fs.ftruncateSync.bind(fs), futimesSync = fs.futimesSync.bind(fs), lchmodSync = fs.lchmodSync.bind(fs), lchownSync = fs.lchownSync.bind(fs), linkSync = fs.linkSync.bind(fs), lstatSync = fs.lstatSync.bind(fs), mkdirSync = fs.mkdirSync.bind(fs), mkdtempSync = fs.mkdtempSync.bind(fs), openSync = fs.openSync.bind(fs), readSync = fs.readSync.bind(fs), writeSync = fs.writeSync.bind(fs), readdirSync = fs.readdirSync.bind(fs), readFileSync = fs.readFileSync.bind(fs), writeFileSync = fs.writeFileSync.bind(fs), readlinkSync = fs.readlinkSync.bind(fs), realpathSync = fs.realpathSync.bind(fs), renameSync = fs.renameSync.bind(fs), statSync = fs.statSync.bind(fs), symlinkSync = fs.symlinkSync.bind(fs), truncateSync = fs.truncateSync.bind(fs), unlinkSync = fs.unlinkSync.bind(fs), utimesSync = fs.utimesSync.bind(fs), lutimesSync = fs.lutimesSync.bind(fs), rmSync = fs.rmSync.bind(fs), rmdirSync = fs.rmdirSync.bind(fs), writev = (fd, buffers, position, callback) => {\n if (typeof position === \"function\")\n callback = position, position = null;\n queueMicrotask(() => {\n try {\n var written = fs.writevSync(fd, buffers, position);\n } catch (e) {\n callback(e);\n }\n callback(null, written, buffers);\n });\n}, writevSync = fs.writevSync.bind(fs), readv = (fd, buffers, position, callback) => {\n if (typeof position === \"function\")\n callback = position, position = null;\n queueMicrotask(() => {\n try {\n var written = fs.readvSync(fd, buffers, position);\n } catch (e) {\n callback(e);\n }\n callback(null, written, buffers);\n });\n}, readvSync = fs.readvSync.bind(fs), Dirent = fs.Dirent, Stats = fs.Stats, watch = function watch2(path, options, listener) {\n return new FSWatcher(path, options, listener);\n}, statWatchers = new Map, _pathModule, readStreamPathFastPathSymbol = Symbol.for(\"Bun.Node.readStreamPathFastPath\"), readStreamSymbol = Symbol.for(\"Bun.NodeReadStream\"), readStreamPathOrFdSymbol = Symbol.for(\"Bun.NodeReadStreamPathOrFd\"), writeStreamSymbol = Symbol.for(\"Bun.NodeWriteStream\"), writeStreamPathFastPathSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPath\"), writeStreamPathFastPathCallSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPathCall\"), kIoDone = Symbol.for(\"kIoDone\"), defaultReadStreamOptions = {\n file: void 0,\n fd: null,\n flags: \"r\",\n encoding: void 0,\n mode: 438,\n autoClose: !0,\n emitClose: !0,\n start: 0,\n end: Infinity,\n highWaterMark: 65536,\n fs: {\n read,\n open: (path, flags, mode, cb) => {\n var fd;\n try {\n fd = openSync(path, flags, mode);\n } catch (e) {\n cb(e);\n return;\n }\n cb(null, fd);\n },\n openSync,\n close\n },\n autoDestroy: !0\n}, ReadStreamClass;\nReadStream = function(InternalReadStream) {\n ReadStreamClass = InternalReadStream, Object.defineProperty(ReadStreamClass.prototype, Symbol.toStringTag, {\n value: \"ReadStream\",\n enumerable: !1\n });\n function ReadStream3(path, options) {\n return new InternalReadStream(path, options);\n }\n return ReadStream3.prototype = InternalReadStream.prototype, Object.defineProperty(ReadStream3, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalReadStream;\n }\n });\n}(class ReadStream2 extends Stream._getNativeReadableStreamPrototype(2, Stream.Readable) {\n constructor(pathOrFd, options = defaultReadStreamOptions) {\n if (typeof options !== \"object\" || !options)\n @throwTypeError(\"Expected options to be an object\");\n var {\n flags = defaultReadStreamOptions.flags,\n encoding = defaultReadStreamOptions.encoding,\n mode = defaultReadStreamOptions.mode,\n autoClose = defaultReadStreamOptions.autoClose,\n emitClose = defaultReadStreamOptions.emitClose,\n start = defaultReadStreamOptions.start,\n end = defaultReadStreamOptions.end,\n autoDestroy = defaultReadStreamOptions.autoClose,\n fs: fs2 = defaultReadStreamOptions.fs,\n highWaterMark = defaultReadStreamOptions.highWaterMark,\n fd = defaultReadStreamOptions.fd\n } = options;\n if (pathOrFd\?.constructor\?.name === \"URL\")\n pathOrFd = Bun.fileURLToPath(pathOrFd);\n var tempThis = {};\n if (fd != null) {\n if (typeof fd !== \"number\")\n @throwTypeError(\"Expected options.fd to be a number\");\n tempThis.fd = tempThis[readStreamPathOrFdSymbol] = fd, tempThis.autoClose = !1;\n } else if (typeof pathOrFd === \"string\") {\n if (pathOrFd.startsWith(\"file://\"))\n pathOrFd = Bun.fileURLToPath(pathOrFd);\n if (pathOrFd.length === 0)\n @throwTypeError(\"Expected path to be a non-empty string\");\n tempThis.path = tempThis.file = tempThis[readStreamPathOrFdSymbol] = pathOrFd;\n } else if (typeof pathOrFd === \"number\") {\n if (pathOrFd |= 0, pathOrFd < 0)\n @throwTypeError(\"Expected fd to be a positive integer\");\n tempThis.fd = tempThis[readStreamPathOrFdSymbol] = pathOrFd, tempThis.autoClose = !1;\n } else\n @throwTypeError(\"Expected a path or file descriptor\");\n if (tempThis.fd === void 0)\n tempThis.fd = fs2.openSync(pathOrFd, flags, mode);\n var fileRef = Bun.file(tempThis.fd), stream = fileRef.stream(), native = @direct(stream);\n if (!native)\n throw new Error(\"no native readable stream\");\n var { stream: ptr } = native;\n super(ptr, {\n ...options,\n encoding,\n autoDestroy,\n autoClose,\n emitClose,\n highWaterMark\n });\n if (Object.assign(this, tempThis), this.#fileRef = fileRef, this.end = end, this._read = this.#internalRead, this.start = start, this.flags = flags, this.mode = mode, this.emitClose = emitClose, this[readStreamPathFastPathSymbol] = start === 0 && end === Infinity && autoClose && fs2 === defaultReadStreamOptions.fs && (encoding === \"buffer\" || encoding === \"binary\" || encoding == null || encoding === \"utf-8\" || encoding === \"utf8\"), this._readableState.autoClose = autoDestroy = autoClose, this._readableState.highWaterMark = highWaterMark, start !== void 0)\n this.pos = start;\n }\n #fileRef;\n #fs;\n file;\n path;\n fd = null;\n flags;\n mode;\n start;\n end;\n pos;\n bytesRead = 0;\n #fileSize = -1;\n _read;\n [readStreamSymbol] = !0;\n [readStreamPathOrFdSymbol];\n [readStreamPathFastPathSymbol];\n _construct(callback) {\n if (super._construct)\n super._construct(callback);\n else\n callback();\n this.emit(\"open\", this.fd), this.emit(\"ready\");\n }\n _destroy(err, cb) {\n super._destroy(err, cb);\n try {\n var fd = this.fd;\n if (this[readStreamPathFastPathSymbol] = !1, !fd)\n cb(err);\n else\n this.#fs.close(fd, (er) => {\n cb(er || err);\n }), this.fd = null;\n } catch (e) {\n throw e;\n }\n }\n close(cb) {\n if (typeof cb === \"function\")\n Stream.eos(this, cb);\n this.destroy();\n }\n push(chunk) {\n var bytesRead = chunk\?.length \?\? 0;\n if (bytesRead > 0) {\n this.bytesRead += bytesRead;\n var currPos = this.pos;\n if (currPos !== void 0) {\n if (this.bytesRead < currPos)\n return !0;\n if (currPos === this.start) {\n var n = this.bytesRead - currPos;\n chunk = chunk.slice(-n);\n var [_, ...rest] = arguments;\n if (this.pos = this.bytesRead, this.end !== void 0 && this.bytesRead > this.end)\n chunk = chunk.slice(0, this.end - this.start + 1);\n return super.push(chunk, ...rest);\n }\n var end = this.end;\n if (end !== void 0 && this.bytesRead > end) {\n chunk = chunk.slice(0, end - currPos + 1);\n var [_, ...rest] = arguments;\n return this.pos = this.bytesRead, super.push(chunk, ...rest);\n }\n this.pos = this.bytesRead;\n }\n }\n return super.push(...arguments);\n }\n #internalRead(n) {\n var { pos, end, bytesRead, fd, encoding } = this;\n if (n = pos !== void 0 \? Math.min(end - pos + 1, n) : Math.min(end - bytesRead + 1, n), n <= 0) {\n this.push(null);\n return;\n }\n if (this.#fileSize === -1 && bytesRead === 0 && pos === void 0) {\n var stat3 = fstatSync(fd);\n if (this.#fileSize = stat3.size, this.#fileSize > 0 && n > this.#fileSize)\n n = this.#fileSize + 1;\n }\n this[kIoDone] = !1;\n var res = super._read(n);\n if (@isPromise(res)) {\n var then = res\?.then;\n if (then && @isCallable(then))\n res.then(() => {\n if (this[kIoDone] = !0, this.destroyed)\n this.emit(kIoDone);\n }, (er) => {\n this[kIoDone] = !0, this.#errorOrDestroy(er);\n });\n } else if (this[kIoDone] = !0, this.destroyed)\n this.emit(kIoDone), this.#errorOrDestroy(new Error(\"ERR_STREAM_PREMATURE_CLOSE\"));\n }\n #errorOrDestroy(err, sync = null) {\n var {\n _readableState: r = { destroyed: !1, autoDestroy: !1 },\n _writableState: w = { destroyed: !1, autoDestroy: !1 }\n } = this;\n if (w\?.destroyed || r\?.destroyed)\n return this;\n if (r\?.autoDestroy || w\?.autoDestroy)\n this.destroy(err);\n else if (err)\n this.emit(\"error\", err);\n }\n pause() {\n return this[readStreamPathFastPathSymbol] = !1, super.pause();\n }\n resume() {\n return this[readStreamPathFastPathSymbol] = !1, super.resume();\n }\n unshift(...args) {\n return this[readStreamPathFastPathSymbol] = !1, super.unshift(...args);\n }\n pipe(dest, pipeOpts) {\n if (this[readStreamPathFastPathSymbol] && (pipeOpts\?.end \?\? !0) && this._readableState\?.pipes\?.length === 0) {\n if ((writeStreamPathFastPathSymbol in dest) && dest[writeStreamPathFastPathSymbol]) {\n if (dest[writeStreamPathFastPathCallSymbol](this, pipeOpts))\n return this;\n }\n }\n return this[readStreamPathFastPathSymbol] = !1, super.pipe(dest, pipeOpts);\n }\n});\nvar defaultWriteStreamOptions = {\n fd: null,\n start: void 0,\n pos: void 0,\n encoding: void 0,\n flags: \"w\",\n mode: 438,\n fs: {\n write,\n close,\n open,\n openSync\n }\n}, WriteStreamClass = WriteStream = function WriteStream2(path, options = defaultWriteStreamOptions) {\n if (!(this instanceof WriteStream2))\n return new WriteStream2(path, options);\n if (!options)\n @throwTypeError(\"Expected options to be an object\");\n var {\n fs: fs2 = defaultWriteStreamOptions.fs,\n start = defaultWriteStreamOptions.start,\n flags = defaultWriteStreamOptions.flags,\n mode = defaultWriteStreamOptions.mode,\n autoClose = !0,\n emitClose = !1,\n autoDestroy = autoClose,\n encoding = defaultWriteStreamOptions.encoding,\n fd = defaultWriteStreamOptions.fd,\n pos = defaultWriteStreamOptions.pos\n } = options, tempThis = {};\n if (fd != null) {\n if (typeof fd !== \"number\")\n throw new Error(\"Expected options.fd to be a number\");\n tempThis.fd = fd, tempThis[_writeStreamPathFastPathSymbol] = !1;\n } else if (typeof path === \"string\") {\n if (path.length === 0)\n @throwTypeError(\"Expected a non-empty path\");\n if (path.startsWith(\"file:\"))\n path = Bun.fileURLToPath(path);\n tempThis.path = path, tempThis.fd = null, tempThis[_writeStreamPathFastPathSymbol] = autoClose && (start === void 0 || start === 0) && fs2.write === defaultWriteStreamOptions.fs.write && fs2.close === defaultWriteStreamOptions.fs.close;\n }\n if (tempThis.fd == null)\n tempThis.fd = fs2.openSync(path, flags, mode);\n if (NativeWritable.call(this, tempThis.fd, {\n ...options,\n decodeStrings: !1,\n autoDestroy,\n emitClose,\n fd: tempThis\n }), Object.assign(this, tempThis), typeof fs2\?.write !== \"function\")\n @throwTypeError(\"Expected fs.write to be a function\");\n if (typeof fs2\?.close !== \"function\")\n @throwTypeError(\"Expected fs.close to be a function\");\n if (typeof fs2\?.open !== \"function\")\n @throwTypeError(\"Expected fs.open to be a function\");\n if (typeof path === \"object\" && path) {\n if (path instanceof URL)\n path = Bun.fileURLToPath(path);\n }\n if (typeof path !== \"string\" && typeof fd !== \"number\")\n @throwTypeError(\"Expected a path or file descriptor\");\n if (this.start = start, this[_fs] = fs2, this.flags = flags, this.mode = mode, this.bytesWritten = 0, this[writeStreamSymbol] = !0, this[kIoDone] = !1, this.start !== void 0)\n this.pos = this.start;\n if (encoding !== defaultWriteStreamOptions.encoding) {\n if (this.setDefaultEncoding(encoding), encoding !== \"buffer\" && encoding !== \"utf8\" && encoding !== \"utf-8\" && encoding !== \"binary\")\n this[_writeStreamPathFastPathSymbol] = !1;\n }\n return this;\n}, NativeWritable = Stream.NativeWritable, WriteStreamPrototype = WriteStream.prototype = Object.create(NativeWritable.prototype);\nObject.defineProperties(WriteStreamPrototype, {\n autoClose: {\n get() {\n return this._writableState.autoDestroy;\n },\n set(val) {\n this._writableState.autoDestroy = val;\n }\n },\n pending: {\n get() {\n return this.fd === null;\n }\n }\n});\nWriteStreamPrototype.destroySoon = WriteStreamPrototype.end;\nWriteStreamPrototype.open = function open3() {\n};\nWriteStreamPrototype[writeStreamPathFastPathCallSymbol] = function WriteStreamPathFastPathCallSymbol(readStream, pipeOpts) {\n if (!this[_writeStreamPathFastPathSymbol])\n return !1;\n if (this.fd !== null)\n return this[_writeStreamPathFastPathSymbol] = !1, !1;\n return this[kIoDone] = !1, readStream[kIoDone] = !1, Bun.write(this[_writeStreamPathFastPathSymbol], readStream[readStreamPathOrFdSymbol]).then((bytesWritten) => {\n readStream[kIoDone] = this[kIoDone] = !0, this.bytesWritten += bytesWritten, readStream.bytesRead += bytesWritten, this.end(), readStream.close();\n }, (err) => {\n readStream[kIoDone] = this[kIoDone] = !0, WriteStream_errorOrDestroy.call(this, err), readStream.emit(\"error\", err);\n });\n};\nWriteStreamPrototype.isBunFastPathEnabled = function isBunFastPathEnabled() {\n return this[_writeStreamPathFastPathSymbol];\n};\nWriteStreamPrototype.disableBunFastPath = function disableBunFastPath() {\n this[_writeStreamPathFastPathSymbol] = !1;\n};\nWriteStreamPrototype._construct = function _construct(callback) {\n if (typeof this.fd === \"number\") {\n callback();\n return;\n }\n callback(), this.emit(\"open\", this.fd), this.emit(\"ready\");\n};\nWriteStreamPrototype._destroy = function _destroy(err, cb) {\n if (this.fd === null)\n return cb(err);\n if (this[kIoDone]) {\n this.once(kIoDone, () => WriteStream_internalClose.call(this, err, cb));\n return;\n }\n WriteStream_internalClose.call(this, err, cb);\n};\nWriteStreamPrototype.close = function close3(cb) {\n if (cb) {\n if (this.closed) {\n process.nextTick(cb);\n return;\n }\n this.on(\"close\", cb);\n }\n if (!this.autoClose)\n this.on(\"finish\", this.destroy);\n this.end();\n};\nWriteStreamPrototype.write = function write3(chunk, encoding, cb) {\n if (encoding \?\?= this._writableState\?.defaultEncoding, this[_writeStreamPathFastPathSymbol] = !1, typeof chunk === \"string\")\n chunk = Buffer.from(chunk, encoding);\n var native = this.pos === void 0;\n const callback = native \? (err, bytes) => {\n if (this[kIoDone] = !1, WriteStream_handleWrite.call(this, err, bytes), this.emit(kIoDone), cb)\n !err \? cb() : cb(err);\n } : () => {\n };\n if (this[kIoDone] = !0, this._write)\n return this._write(chunk, encoding, callback);\n else\n return NativeWritable.prototype.write.call(this, chunk, encoding, callback, native);\n};\nWriteStreamPrototype._write = void 0;\nWriteStreamPrototype._writev = void 0;\nWriteStreamPrototype.end = function end(chunk, encoding, cb) {\n var native = this.pos === void 0;\n return NativeWritable.prototype.end.call(this, chunk, encoding, cb, native);\n};\nWriteStreamPrototype._destroy = function _destroy2(err, cb) {\n this.close(err, cb);\n};\nObject.defineProperties(fs, {\n createReadStream: {\n value: createReadStream\n },\n createWriteStream: {\n value: createWriteStream\n },\n ReadStream: {\n value: ReadStream\n },\n WriteStream: {\n value: WriteStream\n }\n});\nrealpath.native = realpath;\nrealpathSync.native = realpathSync;\nvar lazy_cpSync = null;\n$ = {\n Dirent,\n FSWatcher,\n ReadStream,\n Stats,\n WriteStream,\n _toUnixTimestamp,\n access,\n accessSync,\n appendFile,\n appendFileSync,\n chmod,\n chmodSync,\n chown,\n chownSync,\n close,\n closeSync,\n constants,\n copyFile,\n copyFileSync,\n cp,\n cpSync,\n createReadStream,\n createWriteStream,\n exists,\n existsSync,\n fchmod,\n fchmodSync,\n fchown,\n fchownSync,\n fstat,\n fstatSync,\n fsync,\n fsyncSync,\n ftruncate,\n ftruncateSync,\n futimes,\n futimesSync,\n lchmod,\n lchmodSync,\n lchown,\n lchownSync,\n link,\n linkSync,\n lstat,\n lstatSync,\n lutimes,\n lutimesSync,\n mkdir,\n mkdirSync,\n mkdtemp,\n mkdtempSync,\n open,\n openSync,\n promises,\n read,\n readFile,\n readFileSync,\n readSync,\n readdir,\n readdirSync,\n readlink,\n readlinkSync,\n readv,\n readvSync,\n realpath,\n realpathSync,\n rename,\n renameSync,\n rm,\n rmSync,\n rmdir,\n rmdirSync,\n stat,\n statSync,\n symlink,\n symlinkSync,\n truncate,\n truncateSync,\n unlink,\n unlinkSync,\n unwatchFile,\n utimes,\n utimesSync,\n watch,\n watchFile,\n write,\n writeFile,\n writeFileSync,\n writeSync,\n writev,\n writevSync,\n [Symbol.for(\"::bunternal::\")]: {\n ReadStreamClass,\n WriteStreamClass\n }\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeFSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/fs.ts\nvar getValidatedPath = function(p) {\n if (p instanceof URL)\n return Bun.fileURLToPath(p);\n if (typeof p !== \"string\")\n @throwTypeError(\"Path must be a string or URL.\");\n return (_pathModule \?\?= @getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30)).resolve(p);\n}, watchFile = function(filename, options, listener) {\n if (filename = getValidatedPath(filename), typeof options === \"function\")\n listener = options, options = {};\n if (typeof listener !== \"function\")\n @throwTypeError(\"listener must be a function\");\n var stat = statWatchers.get(filename);\n if (!stat)\n stat = new StatWatcher(filename, options), statWatchers.set(filename, stat);\n return stat.addListener(\"change\", listener), stat;\n}, unwatchFile = function(filename, listener) {\n filename = getValidatedPath(filename);\n var stat = statWatchers.get(filename);\n if (!stat)\n return;\n if (listener) {\n if (stat.removeListener(\"change\", listener), stat.listenerCount(\"change\") !== 0)\n return;\n } else\n stat.removeAllListeners(\"change\");\n stat.stop(), statWatchers.delete(filename);\n}, callbackify = function(fsFunction, args) {\n const callback = args[args.length - 1];\n try {\n var result = fsFunction.@apply(fs, args.slice(0, args.length - 1));\n result.then((...args2) => callback(null, ...args2), (err) => callback(err));\n } catch (e) {\n if (typeof callback === \"function\")\n callback(e);\n else\n throw e;\n }\n}, createReadStream = function(path, options) {\n return new ReadStream(path, options);\n}, WriteStream_handleWrite = function(er, bytes) {\n if (er)\n return WriteStream_errorOrDestroy.@call(this, er);\n this.bytesWritten += bytes;\n}, WriteStream_internalClose = function(err, cb) {\n this[_writeStreamPathFastPathSymbol] = !1;\n var fd = this.fd;\n this[_fs].close(fd, (er) => {\n this.fd = null, cb(err || er);\n });\n}, WriteStream_errorOrDestroy = function(err) {\n var {\n _readableState: r = { destroyed: !1, autoDestroy: !1 },\n _writableState: w = { destroyed: !1, autoDestroy: !1 }\n } = this;\n if (w\?.destroyed || r\?.destroyed)\n return this;\n if (r\?.autoDestroy || w\?.autoDestroy)\n this.destroy(err);\n else if (err)\n this.emit(\"error\", err);\n}, createWriteStream = function(path, options) {\n return new WriteStream(path, options);\n}, cpSync = function(src, dest, options) {\n if (!options)\n return fs.cpSync(src, dest);\n if (typeof options !== \"object\")\n @throwTypeError(\"options must be an object\");\n if (options.dereference || options.filter || options.preserveTimestamps || options.verbatimSymlinks) {\n if (!lazy_cpSync)\n lazy_cpSync = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3);\n return lazy_cpSync(src, dest, options);\n }\n return fs.cpSync(src, dest, options.recursive, options.errorOnExist, options.force \?\? !0, options.mode);\n}, cp = function(src, dest, options, callback) {\n if (typeof options === \"function\")\n callback = options, options = @undefined;\n promises.cp(src, dest, options).then(() => callback(), callback);\n}, _toUnixTimestamp = function(time, name = \"time\") {\n if (typeof time === \"string\" && +time == time)\n return +time;\n if (NumberIsFinite(time)) {\n if (time < 0)\n return DateNow() / 1000;\n return time;\n }\n if (isDate(time))\n return DatePrototypeGetTime(time) / 1000;\n @throwTypeError(`Expected ${name} to be a number or Date`);\n}, $, ReadStream, WriteStream, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), promises = @getInternalField(@internalModuleRegistry, 22) || @createInternalModuleById(22), Stream = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), { isArrayBufferView } = @requireNativeModule(\"util/types\"), _writeStreamPathFastPathSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPath\"), _fs = Symbol.for(\"#fs\"), constants = @processBindingConstants.fs, fs = Bun.fs();\n\nclass FSWatcher extends EventEmitter {\n #watcher;\n #listener;\n constructor(path, options, listener) {\n super();\n if (typeof options === \"function\")\n listener = options, options = {};\n else if (typeof options === \"string\")\n options = { encoding: options };\n if (typeof listener !== \"function\")\n listener = () => {\n };\n this.#listener = listener;\n try {\n this.#watcher = fs.watch(path, options || {}, this.#onEvent.bind(this));\n } catch (e) {\n if (!e.message\?.startsWith(\"FileNotFound\"))\n throw e;\n const notFound = new Error(`ENOENT: no such file or directory, watch '${path}'`);\n throw notFound.code = \"ENOENT\", notFound.errno = -2, notFound.path = path, notFound.syscall = \"watch\", notFound.filename = path, notFound;\n }\n }\n #onEvent(eventType, filenameOrError) {\n if (eventType === \"error\" || eventType === \"close\")\n this.emit(eventType, filenameOrError);\n else\n this.emit(\"change\", eventType, filenameOrError), this.#listener(eventType, filenameOrError);\n }\n close() {\n this.#watcher\?.close(), this.#watcher = null;\n }\n ref() {\n this.#watcher\?.ref();\n }\n unref() {\n this.#watcher\?.unref();\n }\n start() {\n }\n}\n\nclass StatWatcher extends EventEmitter {\n constructor(path, options) {\n super();\n this._handle = fs.watchFile(path, options, this.#onChange.bind(this));\n }\n #onChange(curr, prev) {\n this.emit(\"change\", curr, prev);\n }\n start() {\n }\n stop() {\n this._handle\?.close(), this._handle = null;\n }\n ref() {\n this._handle\?.ref();\n }\n unref() {\n this._handle\?.unref();\n }\n}\nvar access = function access2(...args) {\n callbackify(fs.access, args);\n}, appendFile = function appendFile2(...args) {\n callbackify(fs.appendFile, args);\n}, close = function close2(...args) {\n callbackify(fs.close, args);\n}, rm = function rm2(...args) {\n callbackify(fs.rm, args);\n}, rmdir = function rmdir2(...args) {\n callbackify(fs.rmdir, args);\n}, copyFile = function copyFile2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\") {\n const err = @makeTypeError(\"Callback must be a function\");\n throw err.code = \"ERR_INVALID_ARG_TYPE\", err;\n }\n fs.copyFile(...args).then((result) => callback(null, result), callback);\n}, exists = function exists2(path, callback) {\n if (typeof callback !== \"function\") {\n const err = @makeTypeError(\"Callback must be a function\");\n throw err.code = \"ERR_INVALID_ARG_TYPE\", err;\n }\n try {\n fs.exists.@apply(fs, [path]).then((existed) => callback(existed), (_) => callback(!1));\n } catch (e) {\n callback(!1);\n }\n}, chown = function chown2(...args) {\n callbackify(fs.chown, args);\n}, chmod = function chmod2(...args) {\n callbackify(fs.chmod, args);\n}, fchmod = function fchmod2(...args) {\n callbackify(fs.fchmod, args);\n}, fchown = function fchown2(...args) {\n callbackify(fs.fchown, args);\n}, fstat = function fstat2(...args) {\n callbackify(fs.fstat, args);\n}, fsync = function fsync2(...args) {\n callbackify(fs.fsync, args);\n}, ftruncate = function ftruncate2(...args) {\n callbackify(fs.ftruncate, args);\n}, futimes = function futimes2(...args) {\n callbackify(fs.futimes, args);\n}, lchmod = function lchmod2(...args) {\n callbackify(fs.lchmod, args);\n}, lchown = function lchown2(...args) {\n callbackify(fs.lchown, args);\n}, link = function link2(...args) {\n callbackify(fs.link, args);\n}, mkdir = function mkdir2(...args) {\n callbackify(fs.mkdir, args);\n}, mkdtemp = function mkdtemp2(...args) {\n callbackify(fs.mkdtemp, args);\n}, open = function open2(...args) {\n callbackify(fs.open, args);\n}, read = function read2(fd, buffer, offsetOrOptions, length, position, callback) {\n let offset = offsetOrOptions, params = null;\n if (arguments.length <= 4) {\n if (arguments.length === 4)\n callback = length, params = offsetOrOptions;\n else if (arguments.length === 3) {\n if (!isArrayBufferView(buffer))\n params = buffer, { buffer = @Buffer.alloc(16384) } = params \?\? {};\n callback = offsetOrOptions;\n } else\n callback = buffer, buffer = @Buffer.alloc(16384);\n ({ offset = 0, length = buffer\?.byteLength - offset, position = null } = params \?\? {});\n }\n queueMicrotask(() => {\n try {\n var bytesRead = fs.readSync(fd, buffer, offset, length, position);\n } catch (e) {\n callback(e);\n }\n callback(null, bytesRead, buffer);\n });\n}, write = function write2(...args) {\n callbackify(fs.write, args);\n}, readdir = function readdir2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.readdir(...args).then((result) => callback(null, result), callback);\n}, readFile = function readFile2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.readFile(...args).then((result) => callback(null, result), callback);\n}, writeFile = function writeFile2(...args) {\n callbackify(fs.writeFile, args);\n}, readlink = function readlink2(...args) {\n callbackify(fs.readlink, args);\n}, realpath = function realpath2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.realpath(...args).then((result) => callback(null, result), callback);\n}, rename = function rename2(...args) {\n callbackify(fs.rename, args);\n}, lstat = function lstat2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.lstat(...args).then((result) => callback(null, result), callback);\n}, stat = function stat2(...args) {\n const callback = args[args.length - 1];\n if (typeof callback !== \"function\")\n @throwTypeError(\"Callback must be a function\");\n fs.stat(...args).then((result) => callback(null, result), callback);\n}, symlink = function symlink2(...args) {\n callbackify(fs.symlink, args);\n}, truncate = function truncate2(...args) {\n callbackify(fs.truncate, args);\n}, unlink = function unlink2(...args) {\n callbackify(fs.unlink, args);\n}, utimes = function utimes2(...args) {\n callbackify(fs.utimes, args);\n}, lutimes = function lutimes2(...args) {\n callbackify(fs.lutimes, args);\n}, accessSync = fs.accessSync.bind(fs), appendFileSync = fs.appendFileSync.bind(fs), closeSync = fs.closeSync.bind(fs), copyFileSync = fs.copyFileSync.bind(fs), existsSync = fs.existsSync.bind(fs), chownSync = fs.chownSync.bind(fs), chmodSync = fs.chmodSync.bind(fs), fchmodSync = fs.fchmodSync.bind(fs), fchownSync = fs.fchownSync.bind(fs), fstatSync = fs.fstatSync.bind(fs), fsyncSync = fs.fsyncSync.bind(fs), ftruncateSync = fs.ftruncateSync.bind(fs), futimesSync = fs.futimesSync.bind(fs), lchmodSync = fs.lchmodSync.bind(fs), lchownSync = fs.lchownSync.bind(fs), linkSync = fs.linkSync.bind(fs), lstatSync = fs.lstatSync.bind(fs), mkdirSync = fs.mkdirSync.bind(fs), mkdtempSync = fs.mkdtempSync.bind(fs), openSync = fs.openSync.bind(fs), readSync = fs.readSync.bind(fs), writeSync = fs.writeSync.bind(fs), readdirSync = fs.readdirSync.bind(fs), readFileSync = fs.readFileSync.bind(fs), writeFileSync = fs.writeFileSync.bind(fs), readlinkSync = fs.readlinkSync.bind(fs), realpathSync = fs.realpathSync.bind(fs), renameSync = fs.renameSync.bind(fs), statSync = fs.statSync.bind(fs), symlinkSync = fs.symlinkSync.bind(fs), truncateSync = fs.truncateSync.bind(fs), unlinkSync = fs.unlinkSync.bind(fs), utimesSync = fs.utimesSync.bind(fs), lutimesSync = fs.lutimesSync.bind(fs), rmSync = fs.rmSync.bind(fs), rmdirSync = fs.rmdirSync.bind(fs), writev = (fd, buffers, position, callback) => {\n if (typeof position === \"function\")\n callback = position, position = null;\n queueMicrotask(() => {\n try {\n var written = fs.writevSync(fd, buffers, position);\n } catch (e) {\n callback(e);\n }\n callback(null, written, buffers);\n });\n}, writevSync = fs.writevSync.bind(fs), readv = (fd, buffers, position, callback) => {\n if (typeof position === \"function\")\n callback = position, position = null;\n queueMicrotask(() => {\n try {\n var written = fs.readvSync(fd, buffers, position);\n } catch (e) {\n callback(e);\n }\n callback(null, written, buffers);\n });\n}, readvSync = fs.readvSync.bind(fs), Dirent = fs.Dirent, Stats = fs.Stats, watch = function watch2(path, options, listener) {\n return new FSWatcher(path, options, listener);\n}, statWatchers = new Map, _pathModule, readStreamPathFastPathSymbol = Symbol.for(\"Bun.Node.readStreamPathFastPath\"), readStreamSymbol = Symbol.for(\"Bun.NodeReadStream\"), readStreamPathOrFdSymbol = Symbol.for(\"Bun.NodeReadStreamPathOrFd\"), writeStreamSymbol = Symbol.for(\"Bun.NodeWriteStream\"), writeStreamPathFastPathSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPath\"), writeStreamPathFastPathCallSymbol = Symbol.for(\"Bun.NodeWriteStreamFastPathCall\"), kIoDone = Symbol.for(\"kIoDone\"), defaultReadStreamOptions = {\n file: @undefined,\n fd: null,\n flags: \"r\",\n encoding: @undefined,\n mode: 438,\n autoClose: !0,\n emitClose: !0,\n start: 0,\n end: @Infinity,\n highWaterMark: 65536,\n fs: {\n read,\n open: (path, flags, mode, cb) => {\n var fd;\n try {\n fd = openSync(path, flags, mode);\n } catch (e) {\n cb(e);\n return;\n }\n cb(null, fd);\n },\n openSync,\n close\n },\n autoDestroy: !0\n}, ReadStreamClass;\nReadStream = function(InternalReadStream) {\n ReadStreamClass = InternalReadStream, Object.defineProperty(ReadStreamClass.prototype, Symbol.toStringTag, {\n value: \"ReadStream\",\n enumerable: !1\n });\n function ReadStream3(path, options) {\n return new InternalReadStream(path, options);\n }\n return ReadStream3.prototype = InternalReadStream.prototype, Object.defineProperty(ReadStream3, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalReadStream;\n }\n });\n}(class ReadStream2 extends Stream._getNativeReadableStreamPrototype(2, Stream.Readable) {\n constructor(pathOrFd, options = defaultReadStreamOptions) {\n if (typeof options !== \"object\" || !options)\n @throwTypeError(\"Expected options to be an object\");\n var {\n flags = defaultReadStreamOptions.flags,\n encoding = defaultReadStreamOptions.encoding,\n mode = defaultReadStreamOptions.mode,\n autoClose = defaultReadStreamOptions.autoClose,\n emitClose = defaultReadStreamOptions.emitClose,\n start = defaultReadStreamOptions.start,\n end = defaultReadStreamOptions.end,\n autoDestroy = defaultReadStreamOptions.autoClose,\n fs: fs2 = defaultReadStreamOptions.fs,\n highWaterMark = defaultReadStreamOptions.highWaterMark,\n fd = defaultReadStreamOptions.fd\n } = options;\n if (pathOrFd\?.constructor\?.name === \"URL\")\n pathOrFd = Bun.fileURLToPath(pathOrFd);\n var tempThis = {};\n if (fd != null) {\n if (typeof fd !== \"number\")\n @throwTypeError(\"Expected options.fd to be a number\");\n tempThis.fd = tempThis[readStreamPathOrFdSymbol] = fd, tempThis.autoClose = !1;\n } else if (typeof pathOrFd === \"string\") {\n if (pathOrFd.startsWith(\"file://\"))\n pathOrFd = Bun.fileURLToPath(pathOrFd);\n if (pathOrFd.length === 0)\n @throwTypeError(\"Expected path to be a non-empty string\");\n tempThis.path = tempThis.file = tempThis[readStreamPathOrFdSymbol] = pathOrFd;\n } else if (typeof pathOrFd === \"number\") {\n if (pathOrFd |= 0, pathOrFd < 0)\n @throwTypeError(\"Expected fd to be a positive integer\");\n tempThis.fd = tempThis[readStreamPathOrFdSymbol] = pathOrFd, tempThis.autoClose = !1;\n } else\n @throwTypeError(\"Expected a path or file descriptor\");\n if (tempThis.fd === @undefined)\n tempThis.fd = fs2.openSync(pathOrFd, flags, mode);\n var fileRef = Bun.file(tempThis.fd), stream = fileRef.stream(), native = @direct(stream);\n if (!native)\n throw new Error(\"no native readable stream\");\n var { stream: ptr } = native;\n super(ptr, {\n ...options,\n encoding,\n autoDestroy,\n autoClose,\n emitClose,\n highWaterMark\n });\n if (Object.assign(this, tempThis), this.#fileRef = fileRef, this.end = end, this._read = this.#internalRead, this.start = start, this.flags = flags, this.mode = mode, this.emitClose = emitClose, this[readStreamPathFastPathSymbol] = start === 0 && end === @Infinity && autoClose && fs2 === defaultReadStreamOptions.fs && (encoding === \"buffer\" || encoding === \"binary\" || encoding == null || encoding === \"utf-8\" || encoding === \"utf8\"), this._readableState.autoClose = autoDestroy = autoClose, this._readableState.highWaterMark = highWaterMark, start !== @undefined)\n this.pos = start;\n }\n #fileRef;\n #fs;\n file;\n path;\n fd = null;\n flags;\n mode;\n start;\n end;\n pos;\n bytesRead = 0;\n #fileSize = -1;\n _read;\n [readStreamSymbol] = !0;\n [readStreamPathOrFdSymbol];\n [readStreamPathFastPathSymbol];\n _construct(callback) {\n if (super._construct)\n super._construct(callback);\n else\n callback();\n this.emit(\"open\", this.fd), this.emit(\"ready\");\n }\n _destroy(err, cb) {\n super._destroy(err, cb);\n try {\n var fd = this.fd;\n if (this[readStreamPathFastPathSymbol] = !1, !fd)\n cb(err);\n else\n this.#fs.close(fd, (er) => {\n cb(er || err);\n }), this.fd = null;\n } catch (e) {\n throw e;\n }\n }\n close(cb) {\n if (typeof cb === \"function\")\n Stream.eos(this, cb);\n this.destroy();\n }\n push(chunk) {\n var bytesRead = chunk\?.length \?\? 0;\n if (bytesRead > 0) {\n this.bytesRead += bytesRead;\n var currPos = this.pos;\n if (currPos !== @undefined) {\n if (this.bytesRead < currPos)\n return !0;\n if (currPos === this.start) {\n var n = this.bytesRead - currPos;\n chunk = chunk.slice(-n);\n var [_, ...rest] = arguments;\n if (this.pos = this.bytesRead, this.end !== @undefined && this.bytesRead > this.end)\n chunk = chunk.slice(0, this.end - this.start + 1);\n return super.push(chunk, ...rest);\n }\n var end = this.end;\n if (end !== @undefined && this.bytesRead > end) {\n chunk = chunk.slice(0, end - currPos + 1);\n var [_, ...rest] = arguments;\n return this.pos = this.bytesRead, super.push(chunk, ...rest);\n }\n this.pos = this.bytesRead;\n }\n }\n return super.push(...arguments);\n }\n #internalRead(n) {\n var { pos, end, bytesRead, fd, encoding } = this;\n if (n = pos !== @undefined \? Math.min(end - pos + 1, n) : Math.min(end - bytesRead + 1, n), n <= 0) {\n this.push(null);\n return;\n }\n if (this.#fileSize === -1 && bytesRead === 0 && pos === @undefined) {\n var stat3 = fstatSync(fd);\n if (this.#fileSize = stat3.size, this.#fileSize > 0 && n > this.#fileSize)\n n = this.#fileSize + 1;\n }\n this[kIoDone] = !1;\n var res = super._read(n);\n if (@isPromise(res)) {\n var then = res\?.then;\n if (then && @isCallable(then))\n res.then(() => {\n if (this[kIoDone] = !0, this.destroyed)\n this.emit(kIoDone);\n }, (er) => {\n this[kIoDone] = !0, this.#errorOrDestroy(er);\n });\n } else if (this[kIoDone] = !0, this.destroyed)\n this.emit(kIoDone), this.#errorOrDestroy(new Error(\"ERR_STREAM_PREMATURE_CLOSE\"));\n }\n #errorOrDestroy(err, sync = null) {\n var {\n _readableState: r = { destroyed: !1, autoDestroy: !1 },\n _writableState: w = { destroyed: !1, autoDestroy: !1 }\n } = this;\n if (w\?.destroyed || r\?.destroyed)\n return this;\n if (r\?.autoDestroy || w\?.autoDestroy)\n this.destroy(err);\n else if (err)\n this.emit(\"error\", err);\n }\n pause() {\n return this[readStreamPathFastPathSymbol] = !1, super.pause();\n }\n resume() {\n return this[readStreamPathFastPathSymbol] = !1, super.resume();\n }\n unshift(...args) {\n return this[readStreamPathFastPathSymbol] = !1, super.unshift(...args);\n }\n pipe(dest, pipeOpts) {\n if (this[readStreamPathFastPathSymbol] && (pipeOpts\?.end \?\? !0) && this._readableState\?.pipes\?.length === 0) {\n if ((writeStreamPathFastPathSymbol in dest) && dest[writeStreamPathFastPathSymbol]) {\n if (dest[writeStreamPathFastPathCallSymbol](this, pipeOpts))\n return this;\n }\n }\n return this[readStreamPathFastPathSymbol] = !1, super.pipe(dest, pipeOpts);\n }\n});\nvar defaultWriteStreamOptions = {\n fd: null,\n start: @undefined,\n pos: @undefined,\n encoding: @undefined,\n flags: \"w\",\n mode: 438,\n fs: {\n write,\n close,\n open,\n openSync\n }\n}, WriteStreamClass = WriteStream = function WriteStream2(path, options = defaultWriteStreamOptions) {\n if (!(this instanceof WriteStream2))\n return new WriteStream2(path, options);\n if (!options)\n @throwTypeError(\"Expected options to be an object\");\n var {\n fs: fs2 = defaultWriteStreamOptions.fs,\n start = defaultWriteStreamOptions.start,\n flags = defaultWriteStreamOptions.flags,\n mode = defaultWriteStreamOptions.mode,\n autoClose = !0,\n emitClose = !1,\n autoDestroy = autoClose,\n encoding = defaultWriteStreamOptions.encoding,\n fd = defaultWriteStreamOptions.fd,\n pos = defaultWriteStreamOptions.pos\n } = options, tempThis = {};\n if (fd != null) {\n if (typeof fd !== \"number\")\n throw new Error(\"Expected options.fd to be a number\");\n tempThis.fd = fd, tempThis[_writeStreamPathFastPathSymbol] = !1;\n } else if (typeof path === \"string\") {\n if (path.length === 0)\n @throwTypeError(\"Expected a non-empty path\");\n if (path.startsWith(\"file:\"))\n path = Bun.fileURLToPath(path);\n tempThis.path = path, tempThis.fd = null, tempThis[_writeStreamPathFastPathSymbol] = autoClose && (start === @undefined || start === 0) && fs2.write === defaultWriteStreamOptions.fs.write && fs2.close === defaultWriteStreamOptions.fs.close;\n }\n if (tempThis.fd == null)\n tempThis.fd = fs2.openSync(path, flags, mode);\n if (NativeWritable.@call(this, tempThis.fd, {\n ...options,\n decodeStrings: !1,\n autoDestroy,\n emitClose,\n fd: tempThis\n }), Object.assign(this, tempThis), typeof fs2\?.write !== \"function\")\n @throwTypeError(\"Expected fs.write to be a function\");\n if (typeof fs2\?.close !== \"function\")\n @throwTypeError(\"Expected fs.close to be a function\");\n if (typeof fs2\?.open !== \"function\")\n @throwTypeError(\"Expected fs.open to be a function\");\n if (typeof path === \"object\" && path) {\n if (path instanceof URL)\n path = Bun.fileURLToPath(path);\n }\n if (typeof path !== \"string\" && typeof fd !== \"number\")\n @throwTypeError(\"Expected a path or file descriptor\");\n if (this.start = start, this[_fs] = fs2, this.flags = flags, this.mode = mode, this.bytesWritten = 0, this[writeStreamSymbol] = !0, this[kIoDone] = !1, this.start !== @undefined)\n this.pos = this.start;\n if (encoding !== defaultWriteStreamOptions.encoding) {\n if (this.setDefaultEncoding(encoding), encoding !== \"buffer\" && encoding !== \"utf8\" && encoding !== \"utf-8\" && encoding !== \"binary\")\n this[_writeStreamPathFastPathSymbol] = !1;\n }\n return this;\n}, NativeWritable = Stream.NativeWritable, WriteStreamPrototype = WriteStream.prototype = Object.create(NativeWritable.prototype);\nObject.defineProperties(WriteStreamPrototype, {\n autoClose: {\n get() {\n return this._writableState.autoDestroy;\n },\n set(val) {\n this._writableState.autoDestroy = val;\n }\n },\n pending: {\n get() {\n return this.fd === null;\n }\n }\n});\nWriteStreamPrototype.destroySoon = WriteStreamPrototype.end;\nWriteStreamPrototype.open = function open3() {\n};\nWriteStreamPrototype[writeStreamPathFastPathCallSymbol] = function WriteStreamPathFastPathCallSymbol(readStream, pipeOpts) {\n if (!this[_writeStreamPathFastPathSymbol])\n return !1;\n if (this.fd !== null)\n return this[_writeStreamPathFastPathSymbol] = !1, !1;\n return this[kIoDone] = !1, readStream[kIoDone] = !1, Bun.write(this[_writeStreamPathFastPathSymbol], readStream[readStreamPathOrFdSymbol]).then((bytesWritten) => {\n readStream[kIoDone] = this[kIoDone] = !0, this.bytesWritten += bytesWritten, readStream.bytesRead += bytesWritten, this.end(), readStream.close();\n }, (err) => {\n readStream[kIoDone] = this[kIoDone] = !0, WriteStream_errorOrDestroy.@call(this, err), readStream.emit(\"error\", err);\n });\n};\nWriteStreamPrototype.isBunFastPathEnabled = function isBunFastPathEnabled() {\n return this[_writeStreamPathFastPathSymbol];\n};\nWriteStreamPrototype.disableBunFastPath = function disableBunFastPath() {\n this[_writeStreamPathFastPathSymbol] = !1;\n};\nWriteStreamPrototype._construct = function _construct(callback) {\n if (typeof this.fd === \"number\") {\n callback();\n return;\n }\n callback(), this.emit(\"open\", this.fd), this.emit(\"ready\");\n};\nWriteStreamPrototype._destroy = function _destroy(err, cb) {\n if (this.fd === null)\n return cb(err);\n if (this[kIoDone]) {\n this.once(kIoDone, () => WriteStream_internalClose.@call(this, err, cb));\n return;\n }\n WriteStream_internalClose.@call(this, err, cb);\n};\nWriteStreamPrototype.close = function close3(cb) {\n if (cb) {\n if (this.closed) {\n process.nextTick(cb);\n return;\n }\n this.on(\"close\", cb);\n }\n if (!this.autoClose)\n this.on(\"finish\", this.destroy);\n this.end();\n};\nWriteStreamPrototype.write = function write3(chunk, encoding, cb) {\n if (encoding \?\?= this._writableState\?.defaultEncoding, this[_writeStreamPathFastPathSymbol] = !1, typeof chunk === \"string\")\n chunk = @Buffer.from(chunk, encoding);\n var native = this.pos === @undefined;\n const callback = native \? (err, bytes) => {\n if (this[kIoDone] = !1, WriteStream_handleWrite.@call(this, err, bytes), this.emit(kIoDone), cb)\n !err \? cb() : cb(err);\n } : () => {\n };\n if (this[kIoDone] = !0, this._write)\n return this._write(chunk, encoding, callback);\n else\n return NativeWritable.prototype.write.@call(this, chunk, encoding, callback, native);\n};\nWriteStreamPrototype._write = @undefined;\nWriteStreamPrototype._writev = @undefined;\nWriteStreamPrototype.end = function end(chunk, encoding, cb) {\n var native = this.pos === @undefined;\n return NativeWritable.prototype.end.@call(this, chunk, encoding, cb, native);\n};\nWriteStreamPrototype._destroy = function _destroy2(err, cb) {\n this.close(err, cb);\n};\nObject.defineProperties(fs, {\n createReadStream: {\n value: createReadStream\n },\n createWriteStream: {\n value: createWriteStream\n },\n ReadStream: {\n value: ReadStream\n },\n WriteStream: {\n value: WriteStream\n }\n});\nrealpath.native = realpath;\nrealpathSync.native = realpathSync;\nvar lazy_cpSync = null;\n$ = {\n Dirent,\n FSWatcher,\n ReadStream,\n Stats,\n WriteStream,\n _toUnixTimestamp,\n access,\n accessSync,\n appendFile,\n appendFileSync,\n chmod,\n chmodSync,\n chown,\n chownSync,\n close,\n closeSync,\n constants,\n copyFile,\n copyFileSync,\n cp,\n cpSync,\n createReadStream,\n createWriteStream,\n exists,\n existsSync,\n fchmod,\n fchmodSync,\n fchown,\n fchownSync,\n fstat,\n fstatSync,\n fsync,\n fsyncSync,\n ftruncate,\n ftruncateSync,\n futimes,\n futimesSync,\n lchmod,\n lchmodSync,\n lchown,\n lchownSync,\n link,\n linkSync,\n lstat,\n lstatSync,\n lutimes,\n lutimesSync,\n mkdir,\n mkdirSync,\n mkdtemp,\n mkdtempSync,\n open,\n openSync,\n promises,\n read,\n readFile,\n readFileSync,\n readSync,\n readdir,\n readdirSync,\n readlink,\n readlinkSync,\n readv,\n readvSync,\n realpath,\n realpathSync,\n rename,\n renameSync,\n rm,\n rmSync,\n rmdir,\n rmdirSync,\n stat,\n statSync,\n symlink,\n symlinkSync,\n truncate,\n truncateSync,\n unlink,\n unlinkSync,\n unwatchFile,\n utimes,\n utimesSync,\n watch,\n watchFile,\n write,\n writeFile,\n writeFileSync,\n writeSync,\n writev,\n writevSync,\n [Symbol.for(\"::bunternal::\")]: {\n ReadStreamClass,\n WriteStreamClass\n }\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeFSPromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/fs.promises.ts\nvar watch = function(filename, options = {}) {\n if (filename instanceof URL)\n @throwTypeError(\"Watch URLs are not supported yet\");\n else if (Buffer.isBuffer(filename))\n filename = filename.toString();\n else if (typeof filename !== \"string\")\n @throwTypeError(\"Expected path to be a string or Buffer\");\n let nextEventResolve = null;\n if (typeof options === \"string\")\n options = { encoding: options };\n const queue = @createFIFO(), watcher = fs.watch(filename, options || {}, (eventType, filename2) => {\n if (queue.push({ eventType, filename: filename2 }), nextEventResolve) {\n const resolve = nextEventResolve;\n nextEventResolve = null, resolve();\n }\n });\n return {\n [Symbol.asyncIterator]() {\n let closed = !1;\n return {\n async next() {\n while (!closed) {\n let event;\n while (event = queue.shift()) {\n if (event.eventType === \"close\")\n return closed = !0, { value: void 0, done: !0 };\n if (event.eventType === \"error\")\n throw closed = !0, event.filename;\n return { value: event, done: !1 };\n }\n const { promise, resolve } = Promise.withResolvers();\n nextEventResolve = resolve, await promise;\n }\n return { value: void 0, done: !0 };\n },\n return() {\n if (!closed) {\n if (watcher.close(), closed = !0, nextEventResolve) {\n const resolve = nextEventResolve;\n nextEventResolve = null, resolve();\n }\n }\n return { value: void 0, done: !0 };\n }\n };\n }\n };\n}, cp = function(src, dest, options) {\n if (!options)\n return fs.cp(src, dest);\n if (typeof options !== \"object\")\n @throwTypeError(\"options must be an object\");\n if (options.dereference || options.filter || options.preserveTimestamps || options.verbatimSymlinks) {\n if (!lazy_cp)\n lazy_cp = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3);\n return lazy_cp(src, dest, options);\n }\n return fs.cp(src, dest, options.recursive, options.errorOnExist, options.force \?\? !0, options.mode);\n};\nasync function opendir(dir) {\n const entries = await fs.readdir(dir, { withFileTypes: !0 });\n return new Dir(entries);\n}\nvar $, constants = @processBindingConstants.fs, fs = Bun.fs(), notrace = \"::bunternal::\", promisify = {\n [notrace]: (fsFunction) => {\n return async function(...args) {\n return await 1, fsFunction.apply(fs, args);\n };\n }\n}[notrace], lazy_cp = null;\n\nclass Dir {\n #entries;\n constructor(e) {\n this.#entries = e;\n }\n readSync() {\n return this.#entries.shift() \?\? null;\n }\n read(c) {\n if (c)\n process.nextTick(c, null, this.readSync());\n return Promise.resolve(this.readSync());\n }\n closeSync() {\n }\n close(c) {\n if (c)\n process.nextTick(c);\n return Promise.resolve();\n }\n *[Symbol.asyncIterator]() {\n var next;\n while (next = this.readSync())\n yield next;\n }\n}\n$ = {\n access: promisify(fs.accessSync),\n appendFile: promisify(fs.appendFileSync),\n close: promisify(fs.closeSync),\n copyFile: fs.copyFile.bind(fs),\n cp,\n exists: promisify(fs.existsSync),\n chown: promisify(fs.chownSync),\n chmod: promisify(fs.chmodSync),\n fchmod: promisify(fs.fchmodSync),\n fchown: promisify(fs.fchownSync),\n fstat: promisify(fs.fstatSync),\n fsync: promisify(fs.fsyncSync),\n ftruncate: promisify(fs.ftruncateSync),\n futimes: promisify(fs.futimesSync),\n lchmod: promisify(fs.lchmodSync),\n lchown: promisify(fs.lchownSync),\n link: promisify(fs.linkSync),\n lstat: fs.lstat.bind(fs),\n mkdir: promisify(fs.mkdirSync),\n mkdtemp: promisify(fs.mkdtempSync),\n open: promisify(fs.openSync),\n read: promisify(fs.readSync),\n write: promisify(fs.writeSync),\n readdir: fs.readdir.bind(fs),\n readFile: fs.readFile.bind(fs),\n writeFile: promisify(fs.writeFileSync),\n readlink: promisify(fs.readlinkSync),\n realpath: fs.realpath.bind(fs),\n rename: promisify(fs.renameSync),\n stat: fs.stat.bind(fs),\n symlink: promisify(fs.symlinkSync),\n truncate: promisify(fs.truncateSync),\n unlink: promisify(fs.unlinkSync),\n utimes: promisify(fs.utimesSync),\n lutimes: promisify(fs.lutimesSync),\n rm: promisify(fs.rmSync),\n rmdir: promisify(fs.rmdirSync),\n writev: (fd, buffers, position) => {\n return new Promise((resolve, reject) => {\n try {\n var bytesWritten = fs.writevSync(fd, buffers, position);\n } catch (err) {\n reject(err);\n return;\n }\n resolve({\n bytesWritten,\n buffers\n });\n });\n },\n readv: (fd, buffers, position) => {\n return new Promise((resolve, reject) => {\n try {\n var bytesRead = fs.readvSync(fd, buffers, position);\n } catch (err) {\n reject(err);\n return;\n }\n resolve({\n bytesRead,\n buffers\n });\n });\n },\n constants,\n watch,\n opendir\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeFSPromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/fs.promises.ts\nvar watch = function(filename, options = {}) {\n if (filename instanceof URL)\n @throwTypeError(\"Watch URLs are not supported yet\");\n else if (@Buffer.isBuffer(filename))\n filename = filename.toString();\n else if (typeof filename !== \"string\")\n @throwTypeError(\"Expected path to be a string or Buffer\");\n let nextEventResolve = null;\n if (typeof options === \"string\")\n options = { encoding: options };\n const queue = @createFIFO(), watcher = fs.watch(filename, options || {}, (eventType, filename2) => {\n if (queue.push({ eventType, filename: filename2 }), nextEventResolve) {\n const resolve = nextEventResolve;\n nextEventResolve = null, resolve();\n }\n });\n return {\n [Symbol.asyncIterator]() {\n let closed = !1;\n return {\n async next() {\n while (!closed) {\n let event;\n while (event = queue.shift()) {\n if (event.eventType === \"close\")\n return closed = !0, { value: @undefined, done: !0 };\n if (event.eventType === \"error\")\n throw closed = !0, event.filename;\n return { value: event, done: !1 };\n }\n const { promise, resolve } = @Promise.withResolvers();\n nextEventResolve = resolve, await promise;\n }\n return { value: @undefined, done: !0 };\n },\n return() {\n if (!closed) {\n if (watcher.close(), closed = !0, nextEventResolve) {\n const resolve = nextEventResolve;\n nextEventResolve = null, resolve();\n }\n }\n return { value: @undefined, done: !0 };\n }\n };\n }\n };\n}, cp = function(src, dest, options) {\n if (!options)\n return fs.cp(src, dest);\n if (typeof options !== \"object\")\n @throwTypeError(\"options must be an object\");\n if (options.dereference || options.filter || options.preserveTimestamps || options.verbatimSymlinks) {\n if (!lazy_cp)\n lazy_cp = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3);\n return lazy_cp(src, dest, options);\n }\n return fs.cp(src, dest, options.recursive, options.errorOnExist, options.force \?\? !0, options.mode);\n};\nasync function opendir(dir) {\n const entries = await fs.readdir(dir, { withFileTypes: !0 });\n return new Dir(entries);\n}\nvar $, constants = @processBindingConstants.fs, fs = Bun.fs();\nvar lazy_cp = null;\n\nclass Dir {\n #entries;\n constructor(e) {\n this.#entries = e;\n }\n readSync() {\n return this.#entries.shift() \?\? null;\n }\n read(c) {\n if (c)\n process.nextTick(c, null, this.readSync());\n return @Promise.resolve(this.readSync());\n }\n closeSync() {\n }\n close(c) {\n if (c)\n process.nextTick(c);\n return @Promise.resolve();\n }\n *[Symbol.asyncIterator]() {\n var next;\n while (next = this.readSync())\n yield next;\n }\n}\n$ = {\n access: fs.access.bind(fs),\n appendFile: fs.appendFile.bind(fs),\n close: fs.close.bind(fs),\n copyFile: fs.copyFile.bind(fs),\n cp,\n exists: fs.exists.bind(fs),\n chown: fs.chown.bind(fs),\n chmod: fs.chmod.bind(fs),\n fchmod: fs.fchmod.bind(fs),\n fchown: fs.fchown.bind(fs),\n fstat: fs.fstat.bind(fs),\n fsync: fs.fsync.bind(fs),\n ftruncate: fs.ftruncate.bind(fs),\n futimes: fs.futimes.bind(fs),\n lchmod: fs.lchmod.bind(fs),\n lchown: fs.lchown.bind(fs),\n link: fs.link.bind(fs),\n lstat: fs.lstat.bind(fs),\n mkdir: fs.mkdir.bind(fs),\n mkdtemp: fs.mkdtemp.bind(fs),\n open: fs.open.bind(fs),\n read: fs.read.bind(fs),\n write: fs.write.bind(fs),\n readdir: fs.readdir.bind(fs),\n readFile: fs.readFile.bind(fs),\n writeFile: fs.writeFile.bind(fs),\n readlink: fs.readlink.bind(fs),\n realpath: fs.realpath.bind(fs),\n rename: fs.rename.bind(fs),\n stat: fs.stat.bind(fs),\n symlink: fs.symlink.bind(fs),\n truncate: fs.truncate.bind(fs),\n unlink: fs.unlink.bind(fs),\n utimes: fs.utimes.bind(fs),\n lutimes: fs.lutimes.bind(fs),\n rm: fs.rm.bind(fs),\n rmdir: fs.rmdir.bind(fs),\n writev: async (fd, buffers, position) => {\n var bytesWritten = await fs.writev(fd, buffers, position);\n return {\n bytesWritten,\n buffers\n };\n },\n readv: async (fd, buffers, position) => {\n var bytesRead = await fs.readv(fd, buffers, position);\n return {\n bytesRead,\n buffers\n };\n },\n constants,\n watch,\n opendir\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeHttpCode = "(function (){\"use strict\";// src/js/out/tmp/node/http.ts\nvar checkInvalidHeaderChar = function(val) {\n return RegExpPrototypeExec.call(headerCharRegex, val) !== null;\n}, isIPv6 = function(input) {\n return new RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\").test(input);\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof ArrayBuffer || obj instanceof Blob)\n return !0;\n if (Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, validateMsecs = function(numberlike, field) {\n if (typeof numberlike !== \"number\" || numberlike < 0)\n throw new ERR_INVALID_ARG_TYPE(field, \"number\", numberlike);\n return numberlike;\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, getHeader = function(headers, name) {\n if (!headers)\n return;\n const result = headers.get(name);\n return result == null \? void 0 : result;\n}, createServer = function(options, callback) {\n return new Server(options, callback);\n}, emitListeningNextTick = function(self, onListen, err, hostname, port) {\n if (typeof onListen === \"function\")\n try {\n onListen(err, hostname, port);\n } catch (err2) {\n self.emit(\"error\", err2);\n }\n if (self.listening = !err, err)\n self.emit(\"error\", err);\n else\n self.emit(\"listening\", hostname, port);\n}, assignHeaders = function(object, req) {\n var headers = req.headers.toJSON();\n const rawHeaders = @newArrayWithSize(req.headers.count * 2);\n var i = 0;\n for (let key in headers)\n rawHeaders[i++] = key, rawHeaders[i++] = headers[key];\n object.headers = headers, object.rawHeaders = rawHeaders;\n};\nvar getDefaultHTTPSAgent = function() {\n return _defaultHTTPSAgent \?\?= new Agent({ defaultPort: 443, protocol: \"https:\" });\n};\nvar urlToHttpOptions = function(url) {\n var { protocol, hostname, hash, search, pathname, href, port, username, password } = url;\n return {\n protocol,\n hostname: typeof hostname === \"string\" && StringPrototypeStartsWith.call(hostname, \"[\") \? StringPrototypeSlice.call(hostname, 1, -1) : hostname,\n hash,\n search,\n pathname,\n path: `${pathname || \"\"}${search || \"\"}`,\n href,\n port: port \? Number(port) : protocol === \"https:\" \? 443 : protocol === \"http:\" \? 80 : void 0,\n auth: username || password \? `${decodeURIComponent(username)}:${decodeURIComponent(password)}` : void 0\n };\n}, validateHost = function(host, name) {\n if (host !== null && host !== void 0 && typeof host !== \"string\")\n throw new Error(\"Invalid arg type in options\");\n return host;\n}, checkIsHttpToken = function(val) {\n return RegExpPrototypeExec.call(tokenRegExp, val) !== null;\n};\nvar _writeHead = function(statusCode, reason, obj, response) {\n if (statusCode |= 0, statusCode < 100 || statusCode > 999)\n throw new Error(\"status code must be between 100 and 999\");\n if (typeof reason === \"string\")\n response.statusMessage = reason;\n else {\n if (!response.statusMessage)\n response.statusMessage = STATUS_CODES[statusCode] || \"unknown\";\n obj = reason;\n }\n response.statusCode = statusCode;\n {\n let k;\n if (Array.isArray(obj)) {\n if (obj.length % 2 !== 0)\n throw new Error(\"raw headers must have an even number of elements\");\n for (let n = 0;n < obj.length; n += 2)\n if (k = obj[n + 0], k)\n response.setHeader(k, obj[n + 1]);\n } else if (obj) {\n const keys = Object.keys(obj);\n for (let i = 0;i < keys.length; i++)\n if (k = keys[i], k)\n response.setHeader(k, obj[k]);\n }\n }\n if (statusCode === 204 || statusCode === 304 || statusCode >= 100 && statusCode <= 199)\n response._hasBody = !1;\n}, request = function(url, options, cb) {\n return new ClientRequest(url, options, cb);\n}, get = function(url, options, cb) {\n const req = request(url, options, cb);\n return req.end(), req;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { isTypedArray } = @requireNativeModule(\"util/types\"), { Duplex, Readable, Writable } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/, validateHeaderName = (name, label) => {\n if (typeof name !== \"string\" || !name || !checkIsHttpToken(name))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN\");\n}, validateHeaderValue = (name, value) => {\n if (value === void 0)\n throw new Error(\"ERR_HTTP_INVALID_HEADER_VALUE\");\n if (checkInvalidHeaderChar(value))\n throw new Error(\"ERR_INVALID_CHAR\");\n}, { URL } = globalThis, globalReportError = globalThis.reportError, setTimeout = globalThis.setTimeout, fetch = Bun.fetch;\nvar kEmptyObject = Object.freeze(Object.create(null)), kOutHeaders = Symbol.for(\"kOutHeaders\"), kEndCalled = Symbol.for(\"kEndCalled\"), kAbortController = Symbol.for(\"kAbortController\"), kClearTimeout = Symbol(\"kClearTimeout\"), kCorked = Symbol.for(\"kCorked\"), searchParamsSymbol = Symbol.for(\"query\"), StringPrototypeSlice = String.prototype.slice, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeToUpperCase = String.prototype.toUpperCase, StringPrototypeIncludes = String.prototype.includes, StringPrototypeCharCodeAt = String.prototype.charCodeAt, StringPrototypeIndexOf = String.prototype.indexOf, ArrayIsArray = Array.isArray, RegExpPrototypeExec = RegExp.prototype.exec, ObjectAssign = Object.assign;\nvar INVALID_PATH_REGEX = /[^\\u0021-\\u00ff]/;\nvar _defaultHTTPSAgent, kInternalRequest = Symbol(\"kInternalRequest\"), kInternalSocketData = Symbol.for(\"::bunternal::\"), kEmptyBuffer = Buffer.alloc(0);\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\nvar FakeSocket = class Socket extends Duplex {\n [kInternalSocketData];\n bytesRead = 0;\n bytesWritten = 0;\n connecting = !1;\n remoteAddress = null;\n remotePort;\n timeout = 0;\n isServer = !1;\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n connect(port, host, connectListener) {\n return this;\n }\n _destroy(err, callback) {\n }\n _final(callback) {\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return 80;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n return this;\n }\n unref() {\n }\n _write(chunk, encoding, callback) {\n }\n};\n\nclass Agent extends EventEmitter {\n defaultPort = 80;\n protocol = \"http:\";\n options;\n requests;\n sockets;\n freeSockets;\n keepAliveMsecs;\n keepAlive;\n maxSockets;\n maxFreeSockets;\n scheduling;\n maxTotalSockets;\n totalSocketCount;\n #fakeSocket;\n static get globalAgent() {\n return globalAgent;\n }\n static get defaultMaxSockets() {\n return Infinity;\n }\n constructor(options = kEmptyObject) {\n super();\n if (this.options = options = { ...options, path: null }, options.noDelay === void 0)\n options.noDelay = !0;\n this.requests = kEmptyObject, this.sockets = kEmptyObject, this.freeSockets = kEmptyObject, this.keepAliveMsecs = options.keepAliveMsecs || 1000, this.keepAlive = options.keepAlive || !1, this.maxSockets = options.maxSockets || Agent.defaultMaxSockets, this.maxFreeSockets = options.maxFreeSockets || 256, this.scheduling = options.scheduling || \"lifo\", this.maxTotalSockets = options.maxTotalSockets, this.totalSocketCount = 0, this.defaultPort = options.defaultPort || 80, this.protocol = options.protocol || \"http:\";\n }\n createConnection() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n getName(options = kEmptyObject) {\n let name = `http:${options.host || \"localhost\"}:`;\n if (options.port)\n name += options.port;\n if (name += \":\", options.localAddress)\n name += options.localAddress;\n if (options.family === 4 || options.family === 6)\n name += `:${options.family}`;\n if (options.socketPath)\n name += `:${options.socketPath}`;\n return name;\n }\n addRequest() {\n }\n createSocket(req, options, cb) {\n cb(null, this.#fakeSocket \?\?= new FakeSocket);\n }\n removeSocket() {\n }\n keepSocketAlive() {\n return !0;\n }\n reuseSocket() {\n }\n destroy() {\n }\n}\n\nclass Server extends EventEmitter {\n #server;\n #options;\n #tls;\n #is_tls = !1;\n listening = !1;\n serverName;\n constructor(options, callback) {\n super();\n if (typeof options === \"function\")\n callback = options, options = {};\n else if (options == null || typeof options === \"object\") {\n options = { ...options }, this.#tls = null;\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n let serverName = options.servername;\n if (serverName && typeof serverName !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n if (this.#is_tls)\n this.#tls = {\n serverName,\n key,\n cert,\n ca,\n passphrase,\n secureOptions\n };\n else\n this.#tls = null;\n } else\n throw new Error(\"bun-http-polyfill: invalid arguments\");\n if (this.#options = options, callback)\n this.on(\"request\", callback);\n }\n closeAllConnections() {\n const server = this.#server;\n if (!server)\n return;\n this.#server = void 0, server.stop(!0), this.emit(\"close\");\n }\n closeIdleConnections() {\n }\n close(optionalCallback) {\n const server = this.#server;\n if (!server) {\n if (typeof optionalCallback === \"function\")\n process.nextTick(optionalCallback, new Error(\"Server is not running\"));\n return;\n }\n if (this.#server = void 0, typeof optionalCallback === \"function\")\n this.once(\"close\", optionalCallback);\n server.stop(), this.emit(\"close\");\n }\n address() {\n if (!this.#server)\n return null;\n const address = this.#server.hostname;\n return {\n address,\n family: isIPv6(address) \? \"IPv6\" : \"IPv4\",\n port: this.#server.port\n };\n }\n listen(port, host, backlog, onListen) {\n const server = this;\n let socketPath;\n if (typeof port == \"string\" && !Number.isSafeInteger(Number(port)))\n socketPath = port;\n if (typeof host === \"function\")\n onListen = host, host = void 0;\n if (typeof port === \"function\")\n onListen = port;\n else if (typeof port === \"object\") {\n if (port\?.signal\?.addEventListener(\"abort\", () => {\n this.close();\n }), host = port\?.host, port = port\?.port, typeof port\?.callback === \"function\")\n onListen = port\?.callback;\n }\n if (typeof backlog === \"function\")\n onListen = backlog;\n const ResponseClass = this.#options.ServerResponse || ServerResponse, RequestClass = this.#options.IncomingMessage || IncomingMessage;\n try {\n const tls = this.#tls;\n if (tls)\n this.serverName = tls.serverName || host || \"localhost\";\n this.#server = Bun.serve({\n tls,\n port,\n hostname: host,\n unix: socketPath,\n websocket: {\n open(ws) {\n ws.data.open(ws);\n },\n message(ws, message) {\n ws.data.message(ws, message);\n },\n close(ws, code, reason) {\n ws.data.close(ws, code, reason);\n },\n drain(ws) {\n ws.data.drain(ws);\n }\n },\n fetch(req, _server) {\n var pendingResponse, pendingError, rejectFunction, resolveFunction, reject = (err) => {\n if (pendingError)\n return;\n if (pendingError = err, rejectFunction)\n rejectFunction(err);\n }, reply = function(resp) {\n if (pendingResponse)\n return;\n if (pendingResponse = resp, resolveFunction)\n resolveFunction(resp);\n };\n const http_req = new RequestClass(req), http_res = new ResponseClass({ reply, req: http_req });\n if (http_req.once(\"error\", (err) => reject(err)), http_res.once(\"error\", (err) => reject(err)), req.headers.get(\"upgrade\")) {\n const socket = http_req.socket;\n socket[kInternalSocketData] = [_server, http_res, req], server.emit(\"upgrade\", http_req, socket, kEmptyBuffer);\n } else\n server.emit(\"request\", http_req, http_res);\n if (pendingError)\n throw pendingError;\n if (pendingResponse)\n return pendingResponse;\n return new Promise((resolve, reject2) => {\n resolveFunction = resolve, rejectFunction = reject2;\n });\n }\n }), setTimeout(emitListeningNextTick, 1, this, onListen, null, this.#server.hostname, this.#server.port);\n } catch (err) {\n setTimeout(emitListeningNextTick, 1, this, onListen, err);\n }\n return this;\n }\n setTimeout(msecs, callback) {\n }\n}\nclass IncomingMessage extends Readable {\n method;\n complete;\n constructor(req, defaultIncomingOpts) {\n const method = req.method;\n super();\n const url = new URL(req.url);\n var { type = \"request\", [kInternalRequest]: nodeReq } = defaultIncomingOpts || {};\n this.#noBody = type === \"request\" \? method === \"GET\" || method === \"HEAD\" || method === \"TRACE\" || method === \"CONNECT\" || method === \"OPTIONS\" || (parseInt(req.headers.get(\"Content-Length\") || \"\") || 0) === 0 : !1, this.#req = req, this.method = method, this.#type = type, this.complete = !!this.#noBody, this.#bodyStream = void 0;\n const socket = new FakeSocket;\n socket.remoteAddress = url.hostname, socket.remotePort = url.port, this.#fakeSocket = socket, this.url = url.pathname + url.search, this.#nodeReq = this.req = nodeReq, assignHeaders(this, req);\n }\n headers;\n rawHeaders;\n _consuming = !1;\n _dumped = !1;\n #bodyStream;\n #fakeSocket;\n #noBody = !1;\n #aborted = !1;\n #req;\n url;\n #type;\n #nodeReq;\n _construct(callback) {\n if (this.#type === \"response\" || this.#noBody) {\n callback();\n return;\n }\n const contentLength = this.#req.headers.get(\"content-length\");\n if ((contentLength \? parseInt(contentLength, 10) : 0) === 0) {\n this.#noBody = !0, callback();\n return;\n }\n callback();\n }\n async#consumeStream(reader) {\n while (!0) {\n var { done, value } = await reader.readMany();\n if (this.#aborted)\n return;\n if (done) {\n this.push(null), this.destroy();\n break;\n }\n for (var v of value)\n this.push(v);\n }\n }\n _read(size) {\n if (this.#noBody)\n this.push(null), this.complete = !0;\n else if (this.#bodyStream == null) {\n const reader = this.#req.body\?.getReader();\n if (!reader) {\n this.push(null);\n return;\n }\n this.#bodyStream = reader, this.#consumeStream(reader);\n }\n }\n get aborted() {\n return this.#aborted;\n }\n #abort() {\n if (this.#aborted)\n return;\n this.#aborted = !0;\n var bodyStream = this.#bodyStream;\n if (!bodyStream)\n return;\n bodyStream.cancel(), this.complete = !0, this.#bodyStream = void 0, this.push(null);\n }\n get connection() {\n return this.#fakeSocket;\n }\n get statusCode() {\n return this.#req.status;\n }\n get statusMessage() {\n return STATUS_CODES[this.#req.status];\n }\n get httpVersion() {\n return \"1.1\";\n }\n get rawTrailers() {\n return [];\n }\n get httpVersionMajor() {\n return 1;\n }\n get httpVersionMinor() {\n return 1;\n }\n get trailers() {\n return kEmptyObject;\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n}\n\nclass OutgoingMessage extends Writable {\n constructor() {\n super(...arguments);\n }\n #headers;\n headersSent = !1;\n sendDate = !0;\n req;\n timeout;\n #finished = !1;\n [kEndCalled] = !1;\n #fakeSocket;\n #timeoutTimer;\n [kAbortController] = null;\n _implicitHeader() {\n }\n get headers() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n get connection() {\n return this.socket;\n }\n get finished() {\n return this.#finished;\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.removeAllListeners(\"timeout\"), this.#timeoutTimer = void 0;\n }\n #onTimeout() {\n this.#timeoutTimer = void 0, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = void 0;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== void 0)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar OriginalWriteHeadFn, OriginalImplicitHeadFn;\n\nclass ServerResponse extends Writable {\n constructor({ req, reply }) {\n super();\n if (this.req = req, this._reply = reply, this.sendDate = !0, this.statusCode = 200, this.headersSent = !1, this.statusMessage = void 0, this.#controller = void 0, this.#firstWrite = void 0, this._writableState.decodeStrings = !1, this.#deferred = void 0, req.method === \"HEAD\")\n this._hasBody = !1;\n }\n req;\n _reply;\n sendDate;\n statusCode;\n #headers;\n headersSent = !1;\n statusMessage;\n #controller;\n #firstWrite;\n _sent100 = !1;\n _defaultKeepAlive = !1;\n _removedConnection = !1;\n _removedContLen = !1;\n _hasBody = !0;\n #deferred = void 0;\n #finished = !1;\n _implicitHeader() {\n this.writeHead(this.statusCode);\n }\n _write(chunk, encoding, callback) {\n if (!this.#firstWrite && !this.headersSent) {\n this.#firstWrite = chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n controller.write(chunk), callback();\n });\n }\n _writev(chunks, callback) {\n if (chunks.length === 1 && !this.headersSent && !this.#firstWrite) {\n this.#firstWrite = chunks[0].chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n for (let chunk of chunks)\n controller.write(chunk.chunk);\n callback();\n });\n }\n #ensureReadableStreamController(run) {\n var thisController = this.#controller;\n if (thisController)\n return run(thisController);\n this.headersSent = !0;\n var firstWrite = this.#firstWrite;\n this.#firstWrite = void 0, this._reply(new Response(new ReadableStream({\n type: \"direct\",\n pull: (controller) => {\n if (this.#controller = controller, firstWrite)\n controller.write(firstWrite);\n if (firstWrite = void 0, run(controller), !this.#finished)\n return new Promise((resolve) => {\n this.#deferred = resolve;\n });\n }\n }), {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n }));\n }\n #drainHeadersIfObservable() {\n if (this._implicitHeader === OriginalImplicitHeadFn && this.writeHead === OriginalWriteHeadFn)\n return;\n this._implicitHeader();\n }\n _final(callback) {\n if (!this.headersSent) {\n var data = this.#firstWrite || \"\";\n this.#firstWrite = void 0, this.#finished = !0, this.#drainHeadersIfObservable(), this._reply(new Response(data, {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n })), callback && callback();\n return;\n }\n this.#finished = !0, this.#ensureReadableStreamController((controller) => {\n controller.end(), callback();\n var deferred = this.#deferred;\n if (deferred)\n this.#deferred = void 0, deferred();\n });\n }\n writeProcessing() {\n throw new Error(\"not implemented\");\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n assignSocket(socket) {\n throw new Error(\"not implemented\");\n }\n detachSocket(socket) {\n throw new Error(\"not implemented\");\n }\n writeContinue(callback) {\n throw new Error(\"not implemented\");\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n var headers = this.#headers;\n if (!headers)\n return kEmptyObject;\n return headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n writeHead(statusCode, statusMessage, headers) {\n return _writeHead(statusCode, statusMessage, headers, this), this;\n }\n}\nOriginalWriteHeadFn = ServerResponse.prototype.writeHead;\nOriginalImplicitHeadFn = ServerResponse.prototype._implicitHeader;\n\nclass ClientRequest extends OutgoingMessage {\n #timeout;\n #res = null;\n #upgradeOrConnect = !1;\n #parser = null;\n #maxHeadersCount = null;\n #reusedSocket = !1;\n #host;\n #protocol;\n #method;\n #port;\n #useDefaultPort;\n #joinDuplicateHeaders;\n #maxHeaderSize;\n #agent = globalAgent;\n #path;\n #socketPath;\n #bodyChunks = null;\n #fetchRequest;\n #signal = null;\n [kAbortController] = null;\n #timeoutTimer = void 0;\n #options;\n #finished;\n get path() {\n return this.#path;\n }\n get port() {\n return this.#port;\n }\n get method() {\n return this.#method;\n }\n get host() {\n return this.#host;\n }\n get protocol() {\n return this.#protocol;\n }\n _write(chunk, encoding, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = [chunk], callback();\n return;\n }\n this.#bodyChunks.push(chunk), callback();\n }\n _writev(chunks, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = chunks, callback();\n return;\n }\n this.#bodyChunks.push(...chunks), callback();\n }\n _final(callback) {\n if (this.#finished = !0, this[kAbortController] = new AbortController, this[kAbortController].signal.addEventListener(\"abort\", () => {\n this[kClearTimeout]();\n }), this.#signal\?.aborted)\n this[kAbortController].abort();\n var method = this.#method, body = this.#bodyChunks\?.length === 1 \? this.#bodyChunks[0] : Buffer.concat(this.#bodyChunks || []);\n let url, proxy;\n if (this.#path.startsWith(\"http://\") || this.#path.startsWith(\"https://\"))\n url = this.#path, proxy = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}`;\n else\n url = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}${this.#path}`;\n try {\n this.#fetchRequest = fetch(url, {\n method,\n headers: this.getHeaders(),\n body: body && method !== \"GET\" && method !== \"HEAD\" && method !== \"OPTIONS\" \? body : void 0,\n redirect: \"manual\",\n verbose: !1,\n signal: this[kAbortController].signal,\n proxy,\n timeout: !1,\n decompress: !1\n }).then((response) => {\n var res = this.#res = new IncomingMessage(response, {\n type: \"response\",\n [kInternalRequest]: this\n });\n this.emit(\"response\", res);\n }).catch((err) => {\n this.emit(\"error\", err);\n }).finally(() => {\n this.#fetchRequest = null, this[kClearTimeout]();\n });\n } catch (err) {\n this.emit(\"error\", err);\n } finally {\n callback();\n }\n }\n get aborted() {\n return this.#signal\?.aborted || !!this[kAbortController]\?.signal.aborted;\n }\n abort() {\n if (this.aborted)\n return;\n this[kAbortController].abort();\n }\n constructor(input, options, cb) {\n super();\n if (typeof input === \"string\") {\n const urlStr = input;\n try {\n var urlObject = new URL(urlStr);\n } catch (e) {\n @throwTypeError(`Invalid URL: ${urlStr}`);\n }\n input = urlToHttpOptions(urlObject);\n } else if (input && typeof input === \"object\" && input instanceof URL)\n input = urlToHttpOptions(input);\n else\n cb = options, options = input, input = null;\n if (typeof options === \"function\")\n cb = options, options = input || kEmptyObject;\n else\n options = ObjectAssign(input || {}, options);\n var defaultAgent = options._defaultAgent || Agent.globalAgent;\n let protocol = options.protocol;\n if (!protocol)\n if (options.port === 443)\n protocol = \"https:\";\n else\n protocol = defaultAgent.protocol || \"http:\";\n switch (this.#protocol = protocol, this.#agent\?.protocol) {\n case void 0:\n break;\n case \"http:\":\n if (protocol === \"https:\") {\n defaultAgent = this.#agent = getDefaultHTTPSAgent();\n break;\n }\n case \"https:\":\n if (protocol === \"https\") {\n defaultAgent = this.#agent = Agent.globalAgent;\n break;\n }\n default:\n break;\n }\n if (options.path) {\n const path = String(options.path);\n if (RegExpPrototypeExec.call(INVALID_PATH_REGEX, path) !== null)\n throw new Error(\"Path contains unescaped characters\");\n }\n if (protocol !== \"http:\" && protocol !== \"https:\" && protocol) {\n const expectedProtocol = defaultAgent\?.protocol \?\? \"http:\";\n throw new Error(`Protocol mismatch. Expected: ${expectedProtocol}. Got: ${protocol}`);\n }\n const defaultPort = protocol === \"https:\" \? 443 : 80;\n this.#port = options.port || options.defaultPort || this.#agent\?.defaultPort || defaultPort, this.#useDefaultPort = this.#port === defaultPort;\n const host = this.#host = options.host = validateHost(options.hostname, \"hostname\") || validateHost(options.host, \"host\") || \"localhost\";\n this.#socketPath = options.socketPath;\n const signal = options.signal;\n if (signal)\n signal.addEventListener(\"abort\", () => {\n this[kAbortController]\?.abort();\n }), this.#signal = signal;\n let method = options.method;\n const methodIsString = typeof method === \"string\";\n if (method !== null && method !== void 0 && !methodIsString)\n throw new Error(\"ERR_INVALID_ARG_TYPE: options.method\");\n if (methodIsString && method) {\n if (!checkIsHttpToken(method))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN: Method\");\n method = this.#method = StringPrototypeToUpperCase.call(method);\n } else\n method = this.#method = \"GET\";\n const _maxHeaderSize = options.maxHeaderSize;\n this.#maxHeaderSize = _maxHeaderSize;\n var _joinDuplicateHeaders = options.joinDuplicateHeaders;\n if (this.#joinDuplicateHeaders = _joinDuplicateHeaders, this.#path = options.path || \"/\", cb)\n this.once(\"response\", cb);\n this.#finished = !1, this.#res = null, this.#upgradeOrConnect = !1, this.#parser = null, this.#maxHeadersCount = null, this.#reusedSocket = !1, this.#host = host, this.#protocol = protocol;\n var timeout = options.timeout;\n if (timeout !== void 0 && timeout !== 0)\n this.setTimeout(timeout, void 0);\n if (!ArrayIsArray(headers)) {\n var headers = options.headers;\n if (headers)\n for (let key in headers)\n this.setHeader(key, headers[key]);\n var auth = options.auth;\n if (auth && !this.getHeader(\"Authorization\"))\n this.setHeader(\"Authorization\", \"Basic \" + Buffer.from(auth).toString(\"base64\"));\n }\n var { signal: _signal, ...optsWithoutSignal } = options;\n this.#options = optsWithoutSignal;\n }\n setSocketKeepAlive(enable = !0, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.#timeoutTimer = void 0, this.removeAllListeners(\"timeout\");\n }\n #onTimeout() {\n this.#timeoutTimer = void 0, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = void 0;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== void 0)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/, METHODS = [\n \"ACL\",\n \"BIND\",\n \"CHECKOUT\",\n \"CONNECT\",\n \"COPY\",\n \"DELETE\",\n \"GET\",\n \"HEAD\",\n \"LINK\",\n \"LOCK\",\n \"M-SEARCH\",\n \"MERGE\",\n \"MKACTIVITY\",\n \"MKCALENDAR\",\n \"MKCOL\",\n \"MOVE\",\n \"NOTIFY\",\n \"OPTIONS\",\n \"PATCH\",\n \"POST\",\n \"PROPFIND\",\n \"PROPPATCH\",\n \"PURGE\",\n \"PUT\",\n \"REBIND\",\n \"REPORT\",\n \"SEARCH\",\n \"SOURCE\",\n \"SUBSCRIBE\",\n \"TRACE\",\n \"UNBIND\",\n \"UNLINK\",\n \"UNLOCK\",\n \"UNSUBSCRIBE\"\n], STATUS_CODES = {\n 100: \"Continue\",\n 101: \"Switching Protocols\",\n 102: \"Processing\",\n 103: \"Early Hints\",\n 200: \"OK\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"Non-Authoritative Information\",\n 204: \"No Content\",\n 205: \"Reset Content\",\n 206: \"Partial Content\",\n 207: \"Multi-Status\",\n 208: \"Already Reported\",\n 226: \"IM Used\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Found\",\n 303: \"See Other\",\n 304: \"Not Modified\",\n 305: \"Use Proxy\",\n 307: \"Temporary Redirect\",\n 308: \"Permanent Redirect\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a Teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 425: \"Too Early\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Request Header Fields Too Large\",\n 451: \"Unavailable For Legal Reasons\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 509: \"Bandwidth Limit Exceeded\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\"\n}, globalAgent = new Agent;\n$ = {\n Agent,\n Server,\n METHODS,\n STATUS_CODES,\n createServer,\n ServerResponse,\n IncomingMessage,\n request,\n get,\n maxHeaderSize: 16384,\n validateHeaderName,\n validateHeaderValue,\n setMaxIdleHTTPParsers(max) {\n },\n globalAgent,\n ClientRequest,\n OutgoingMessage\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeHttpCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/http.ts\nvar checkInvalidHeaderChar = function(val) {\n return RegExpPrototypeExec.@call(headerCharRegex, val) !== null;\n};\nvar isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof @ArrayBuffer || obj instanceof Blob)\n return !0;\n if (@Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof @ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, validateMsecs = function(numberlike, field) {\n if (typeof numberlike !== \"number\" || numberlike < 0)\n throw new ERR_INVALID_ARG_TYPE(field, \"number\", numberlike);\n return numberlike;\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, createServer = function(options, callback) {\n return new Server(options, callback);\n}, emitListeningNextTick = function(self, onListen, err, hostname, port) {\n if (typeof onListen === \"function\")\n try {\n onListen(err, hostname, port);\n } catch (err2) {\n self.emit(\"error\", err2);\n }\n if (self.listening = !err, err)\n self.emit(\"error\", err);\n else\n self.emit(\"listening\", hostname, port);\n}, assignHeaders = function(object, req) {\n var headers = req.headers.toJSON();\n const rawHeaders = @newArrayWithSize(req.headers.count * 2);\n var i = 0;\n for (let key in headers)\n rawHeaders[i++] = key, rawHeaders[i++] = headers[key];\n object.headers = headers, object.rawHeaders = rawHeaders;\n}, destroyBodyStreamNT = function(bodyStream) {\n bodyStream.destroy();\n}, getDefaultHTTPSAgent = function() {\n return _defaultHTTPSAgent \?\?= new Agent({ defaultPort: 443, protocol: \"https:\" });\n};\nvar urlToHttpOptions = function(url) {\n var { protocol, hostname, hash, search, pathname, href, port, username, password } = url;\n return {\n protocol,\n hostname: typeof hostname === \"string\" && StringPrototypeStartsWith.@call(hostname, \"[\") \? StringPrototypeSlice.@call(hostname, 1, -1) : hostname,\n hash,\n search,\n pathname,\n path: `${pathname || \"\"}${search || \"\"}`,\n href,\n port: port \? Number(port) : protocol === \"https:\" \? 443 : protocol === \"http:\" \? 80 : @undefined,\n auth: username || password \? `${decodeURIComponent(username)}:${decodeURIComponent(password)}` : @undefined\n };\n}, validateHost = function(host, name) {\n if (host !== null && host !== @undefined && typeof host !== \"string\")\n throw new Error(\"Invalid arg type in options\");\n return host;\n}, checkIsHttpToken = function(val) {\n return RegExpPrototypeExec.@call(tokenRegExp, val) !== null;\n};\nvar _writeHead = function(statusCode, reason, obj, response) {\n if (statusCode |= 0, statusCode < 100 || statusCode > 999)\n throw new Error(\"status code must be between 100 and 999\");\n if (typeof reason === \"string\")\n response.statusMessage = reason;\n else {\n if (!response.statusMessage)\n response.statusMessage = STATUS_CODES[statusCode] || \"unknown\";\n obj = reason;\n }\n response.statusCode = statusCode;\n {\n let k;\n if (@Array.isArray(obj)) {\n if (obj.length % 2 !== 0)\n throw new Error(\"raw headers must have an even number of elements\");\n for (let n = 0;n < obj.length; n += 2)\n if (k = obj[n + 0], k)\n response.setHeader(k, obj[n + 1]);\n } else if (obj) {\n const keys = Object.keys(obj);\n for (let i = 0;i < keys.length; i++)\n if (k = keys[i], k)\n response.setHeader(k, obj[k]);\n }\n }\n if (statusCode === 204 || statusCode === 304 || statusCode >= 100 && statusCode <= 199)\n response._hasBody = !1;\n}, request = function(url, options, cb) {\n return new ClientRequest(url, options, cb);\n}, get = function(url, options, cb) {\n const req = request(url, options, cb);\n return req.end(), req;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { isTypedArray } = @requireNativeModule(\"util/types\"), { Duplex, Readable, Writable } = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), { getHeader, setHeader } = @lazy(\"http\"), headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/, validateHeaderName = (name, label) => {\n if (typeof name !== \"string\" || !name || !checkIsHttpToken(name))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN\");\n}, validateHeaderValue = (name, value) => {\n if (value === @undefined)\n throw new Error(\"ERR_HTTP_INVALID_HEADER_VALUE\");\n if (checkInvalidHeaderChar(value))\n throw new Error(\"ERR_INVALID_CHAR\");\n}, { URL } = globalThis, globalReportError = globalThis.reportError, setTimeout = globalThis.setTimeout, fetch = Bun.fetch;\nvar kEmptyObject = Object.freeze(Object.create(null)), kOutHeaders = Symbol.for(\"kOutHeaders\"), kEndCalled = Symbol.for(\"kEndCalled\"), kAbortController = Symbol.for(\"kAbortController\"), kClearTimeout = Symbol(\"kClearTimeout\"), kCorked = Symbol.for(\"kCorked\"), searchParamsSymbol = Symbol.for(\"query\"), StringPrototypeSlice = @String.prototype.slice, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeToUpperCase = @String.prototype.toUpperCase, ArrayIsArray = @Array.isArray, RegExpPrototypeExec = @RegExp.prototype.exec, ObjectAssign = Object.assign, INVALID_PATH_REGEX = /[^\\u0021-\\u00ff]/;\nvar _defaultHTTPSAgent, kInternalRequest = Symbol(\"kInternalRequest\"), kInternalSocketData = Symbol.for(\"::bunternal::\"), kEmptyBuffer = @Buffer.alloc(0);\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\nvar FakeSocket = class Socket extends Duplex {\n [kInternalSocketData];\n bytesRead = 0;\n bytesWritten = 0;\n connecting = !1;\n timeout = 0;\n isServer = !1;\n #address;\n address() {\n var internalData;\n return this.#address \?\?= (internalData = this[kInternalSocketData])\?.[0]\?.requestIP(internalData[2]) \?\? {};\n }\n get bufferSize() {\n return this.writableLength;\n }\n connect(port, host, connectListener) {\n return this;\n }\n _destroy(err, callback) {\n }\n _final(callback) {\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return 80;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n }\n get remoteAddress() {\n return this.address()\?.address;\n }\n set remoteAddress(val) {\n this.address().address = val;\n }\n get remotePort() {\n return this.address()\?.port;\n }\n set remotePort(val) {\n this.address().port = val;\n }\n get remoteFamily() {\n return this.address()\?.family;\n }\n set remoteFamily(val) {\n this.address().family = val;\n }\n resetAndDestroy() {\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n return this;\n }\n unref() {\n }\n _write(chunk, encoding, callback) {\n }\n};\n\nclass Agent extends EventEmitter {\n defaultPort = 80;\n protocol = \"http:\";\n options;\n requests;\n sockets;\n freeSockets;\n keepAliveMsecs;\n keepAlive;\n maxSockets;\n maxFreeSockets;\n scheduling;\n maxTotalSockets;\n totalSocketCount;\n #fakeSocket;\n static get globalAgent() {\n return globalAgent;\n }\n static get defaultMaxSockets() {\n return @Infinity;\n }\n constructor(options = kEmptyObject) {\n super();\n if (this.options = options = { ...options, path: null }, options.noDelay === @undefined)\n options.noDelay = !0;\n this.requests = kEmptyObject, this.sockets = kEmptyObject, this.freeSockets = kEmptyObject, this.keepAliveMsecs = options.keepAliveMsecs || 1000, this.keepAlive = options.keepAlive || !1, this.maxSockets = options.maxSockets || Agent.defaultMaxSockets, this.maxFreeSockets = options.maxFreeSockets || 256, this.scheduling = options.scheduling || \"lifo\", this.maxTotalSockets = options.maxTotalSockets, this.totalSocketCount = 0, this.defaultPort = options.defaultPort || 80, this.protocol = options.protocol || \"http:\";\n }\n createConnection() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n getName(options = kEmptyObject) {\n let name = `http:${options.host || \"localhost\"}:`;\n if (options.port)\n name += options.port;\n if (name += \":\", options.localAddress)\n name += options.localAddress;\n if (options.family === 4 || options.family === 6)\n name += `:${options.family}`;\n if (options.socketPath)\n name += `:${options.socketPath}`;\n return name;\n }\n addRequest() {\n }\n createSocket(req, options, cb) {\n cb(null, this.#fakeSocket \?\?= new FakeSocket);\n }\n removeSocket() {\n }\n keepSocketAlive() {\n return !0;\n }\n reuseSocket() {\n }\n destroy() {\n }\n}\n\nclass Server extends EventEmitter {\n #server;\n #options;\n #tls;\n #is_tls = !1;\n listening = !1;\n serverName;\n constructor(options, callback) {\n super();\n if (typeof options === \"function\")\n callback = options, options = {};\n else if (options == null || typeof options === \"object\") {\n options = { ...options }, this.#tls = null;\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n let serverName = options.servername;\n if (serverName && typeof serverName !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n if (this.#is_tls)\n this.#tls = {\n serverName,\n key,\n cert,\n ca,\n passphrase,\n secureOptions\n };\n else\n this.#tls = null;\n } else\n throw new Error(\"bun-http-polyfill: invalid arguments\");\n if (this.#options = options, callback)\n this.on(\"request\", callback);\n }\n closeAllConnections() {\n const server = this.#server;\n if (!server)\n return;\n this.#server = @undefined, server.stop(!0), this.emit(\"close\");\n }\n closeIdleConnections() {\n }\n close(optionalCallback) {\n const server = this.#server;\n if (!server) {\n if (typeof optionalCallback === \"function\")\n process.nextTick(optionalCallback, new Error(\"Server is not running\"));\n return;\n }\n if (this.#server = @undefined, typeof optionalCallback === \"function\")\n this.once(\"close\", optionalCallback);\n server.stop(), this.emit(\"close\");\n }\n address() {\n if (!this.#server)\n return null;\n return this.#server.address;\n }\n listen(port, host, backlog, onListen) {\n const server = this;\n let socketPath;\n if (typeof port == \"string\" && !Number.isSafeInteger(Number(port)))\n socketPath = port;\n if (typeof host === \"function\")\n onListen = host, host = @undefined;\n if (typeof port === \"function\")\n onListen = port;\n else if (typeof port === \"object\") {\n if (port\?.signal\?.addEventListener(\"abort\", () => {\n this.close();\n }), host = port\?.host, port = port\?.port, typeof port\?.callback === \"function\")\n onListen = port\?.callback;\n }\n if (typeof backlog === \"function\")\n onListen = backlog;\n const ResponseClass = this.#options.ServerResponse || ServerResponse, RequestClass = this.#options.IncomingMessage || IncomingMessage;\n try {\n const tls = this.#tls;\n if (tls)\n this.serverName = tls.serverName || host || \"localhost\";\n this.#server = Bun.serve({\n tls,\n port,\n hostname: host,\n unix: socketPath,\n websocket: {\n open(ws) {\n ws.data.open(ws);\n },\n message(ws, message) {\n ws.data.message(ws, message);\n },\n close(ws, code, reason) {\n ws.data.close(ws, code, reason);\n },\n drain(ws) {\n ws.data.drain(ws);\n }\n },\n fetch(req, _server) {\n var pendingResponse, pendingError, rejectFunction, resolveFunction, reject = (err) => {\n if (pendingError)\n return;\n if (pendingError = err, rejectFunction)\n rejectFunction(err);\n }, reply = function(resp) {\n if (pendingResponse)\n return;\n if (pendingResponse = resp, resolveFunction)\n resolveFunction(resp);\n };\n const http_req = new RequestClass(req), http_res = new ResponseClass({ reply, req: http_req });\n if (http_req.socket[kInternalSocketData] = [_server, http_res, req], http_req.once(\"error\", (err) => reject(err)), http_res.once(\"error\", (err) => reject(err)), req.headers.get(\"upgrade\"))\n server.emit(\"upgrade\", http_req, http_req.socket, kEmptyBuffer);\n else\n server.emit(\"request\", http_req, http_res);\n if (pendingError)\n throw pendingError;\n if (pendingResponse)\n return pendingResponse;\n return new @Promise((resolve, reject2) => {\n resolveFunction = resolve, rejectFunction = reject2;\n });\n }\n }), setTimeout(emitListeningNextTick, 1, this, onListen, null, this.#server.hostname, this.#server.port);\n } catch (err) {\n server.emit(\"error\", err);\n }\n return this;\n }\n setTimeout(msecs, callback) {\n }\n}\nclass IncomingMessage extends Readable {\n method;\n complete;\n constructor(req, defaultIncomingOpts) {\n const method = req.method;\n super();\n const url = new URL(req.url);\n var { type = \"request\", [kInternalRequest]: nodeReq } = defaultIncomingOpts || {};\n this.#noBody = type === \"request\" \? method === \"GET\" || method === \"HEAD\" || method === \"TRACE\" || method === \"CONNECT\" || method === \"OPTIONS\" || (parseInt(req.headers.get(\"Content-Length\") || \"\") || 0) === 0 : !1, this.#req = req, this.method = method, this.#type = type, this.complete = !!this.#noBody, this.#bodyStream = @undefined;\n const socket = new FakeSocket;\n if (url.protocol === \"https:\")\n socket.encrypted = !0;\n this.#fakeSocket = socket, this.url = url.pathname + url.search, this.req = nodeReq, assignHeaders(this, req);\n }\n headers;\n rawHeaders;\n _consuming = !1;\n _dumped = !1;\n #bodyStream;\n #fakeSocket;\n #noBody = !1;\n #aborted = !1;\n #req;\n url;\n #type;\n _construct(callback) {\n if (this.#type === \"response\" || this.#noBody) {\n callback();\n return;\n }\n const contentLength = this.#req.headers.get(\"content-length\");\n if ((contentLength \? parseInt(contentLength, 10) : 0) === 0) {\n this.#noBody = !0, callback();\n return;\n }\n callback();\n }\n async#consumeStream(reader) {\n while (!0) {\n var { done, value } = await reader.readMany();\n if (this.#aborted)\n return;\n if (done) {\n this.push(null), process.nextTick(destroyBodyStreamNT, this);\n break;\n }\n for (var v of value)\n this.push(v);\n }\n }\n _read(size) {\n if (this.#noBody)\n this.push(null), this.complete = !0;\n else if (this.#bodyStream == null) {\n const reader = this.#req.body\?.getReader();\n if (!reader) {\n this.push(null);\n return;\n }\n this.#bodyStream = reader, this.#consumeStream(reader);\n }\n }\n get aborted() {\n return this.#aborted;\n }\n #abort() {\n if (this.#aborted)\n return;\n this.#aborted = !0;\n var bodyStream = this.#bodyStream;\n if (!bodyStream)\n return;\n bodyStream.cancel(), this.complete = !0, this.#bodyStream = @undefined, this.push(null);\n }\n get connection() {\n return this.#fakeSocket;\n }\n get statusCode() {\n return this.#req.status;\n }\n get statusMessage() {\n return STATUS_CODES[this.#req.status];\n }\n get httpVersion() {\n return \"1.1\";\n }\n get rawTrailers() {\n return [];\n }\n get httpVersionMajor() {\n return 1;\n }\n get httpVersionMinor() {\n return 1;\n }\n get trailers() {\n return kEmptyObject;\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n}\n\nclass OutgoingMessage extends Writable {\n constructor() {\n super(...arguments);\n }\n #headers;\n headersSent = !1;\n sendDate = !0;\n req;\n timeout;\n #finished = !1;\n [kEndCalled] = !1;\n #fakeSocket;\n #timeoutTimer;\n [kAbortController] = null;\n _implicitHeader() {\n }\n get headers() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n get connection() {\n return this.socket;\n }\n get finished() {\n return this.#finished;\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.removeAllListeners(\"timeout\"), this.#timeoutTimer = @undefined;\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar OriginalWriteHeadFn, OriginalImplicitHeadFn;\n\nclass ServerResponse extends Writable {\n constructor(c) {\n super();\n if (!c)\n c = {};\n var req = c.req || {}, reply = c.reply;\n if (this.req = req, this._reply = reply, this.sendDate = !0, this.statusCode = 200, this.headersSent = !1, this.statusMessage = @undefined, this.#controller = @undefined, this.#firstWrite = @undefined, this._writableState.decodeStrings = !1, this.#deferred = @undefined, req.method === \"HEAD\")\n this._hasBody = !1;\n }\n req;\n _reply;\n sendDate;\n statusCode;\n #headers;\n headersSent = !1;\n statusMessage;\n #controller;\n #firstWrite;\n _sent100 = !1;\n _defaultKeepAlive = !1;\n _removedConnection = !1;\n _removedContLen = !1;\n _hasBody = !0;\n #deferred = @undefined;\n #finished = !1;\n _implicitHeader() {\n this.writeHead(this.statusCode);\n }\n _write(chunk, encoding, callback) {\n if (!this.#firstWrite && !this.headersSent) {\n this.#firstWrite = chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n controller.write(chunk), callback();\n });\n }\n _writev(chunks, callback) {\n if (chunks.length === 1 && !this.headersSent && !this.#firstWrite) {\n this.#firstWrite = chunks[0].chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n for (let chunk of chunks)\n controller.write(chunk.chunk);\n callback();\n });\n }\n #ensureReadableStreamController(run) {\n var thisController = this.#controller;\n if (thisController)\n return run(thisController);\n this.headersSent = !0;\n var firstWrite = this.#firstWrite;\n this.#firstWrite = @undefined, this._reply(new Response(new @ReadableStream({\n type: \"direct\",\n pull: (controller) => {\n if (this.#controller = controller, firstWrite)\n controller.write(firstWrite);\n if (firstWrite = @undefined, run(controller), !this.#finished)\n return new @Promise((resolve) => {\n this.#deferred = resolve;\n });\n }\n }), {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n }));\n }\n #drainHeadersIfObservable() {\n if (this._implicitHeader === OriginalImplicitHeadFn && this.writeHead === OriginalWriteHeadFn)\n return;\n this._implicitHeader();\n }\n _final(callback) {\n if (!this.headersSent) {\n var data = this.#firstWrite || \"\";\n this.#firstWrite = @undefined, this.#finished = !0, this.#drainHeadersIfObservable(), this._reply(new Response(data, {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n })), callback && callback();\n return;\n }\n this.#finished = !0, this.#ensureReadableStreamController((controller) => {\n controller.end(), callback();\n var deferred = this.#deferred;\n if (deferred)\n this.#deferred = @undefined, deferred();\n });\n }\n writeProcessing() {\n throw new Error(\"not implemented\");\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n assignSocket(socket) {\n throw new Error(\"not implemented\");\n }\n detachSocket(socket) {\n throw new Error(\"not implemented\");\n }\n writeContinue(callback) {\n throw new Error(\"not implemented\");\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n var headers = this.#headers;\n if (!headers)\n return kEmptyObject;\n return headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return setHeader(headers, name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n writeHead(statusCode, statusMessage, headers) {\n return _writeHead(statusCode, statusMessage, headers, this), this;\n }\n}\nOriginalWriteHeadFn = ServerResponse.prototype.writeHead;\nOriginalImplicitHeadFn = ServerResponse.prototype._implicitHeader;\n\nclass ClientRequest extends OutgoingMessage {\n #timeout;\n #res = null;\n #upgradeOrConnect = !1;\n #parser = null;\n #maxHeadersCount = null;\n #reusedSocket = !1;\n #host;\n #protocol;\n #method;\n #port;\n #useDefaultPort;\n #joinDuplicateHeaders;\n #maxHeaderSize;\n #agent = globalAgent;\n #path;\n #socketPath;\n #bodyChunks = null;\n #fetchRequest;\n #signal = null;\n [kAbortController] = null;\n #timeoutTimer = @undefined;\n #options;\n #finished;\n get path() {\n return this.#path;\n }\n get port() {\n return this.#port;\n }\n get method() {\n return this.#method;\n }\n get host() {\n return this.#host;\n }\n get protocol() {\n return this.#protocol;\n }\n _write(chunk, encoding, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = [chunk], callback();\n return;\n }\n this.#bodyChunks.push(chunk), callback();\n }\n _writev(chunks, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = chunks, callback();\n return;\n }\n this.#bodyChunks.push(...chunks), callback();\n }\n _final(callback) {\n if (this.#finished = !0, this[kAbortController] = new AbortController, this[kAbortController].signal.addEventListener(\"abort\", () => {\n this[kClearTimeout]();\n }), this.#signal\?.aborted)\n this[kAbortController].abort();\n var method = this.#method, body = this.#bodyChunks\?.length === 1 \? this.#bodyChunks[0] : @Buffer.concat(this.#bodyChunks || []);\n let url, proxy;\n if (this.#path.startsWith(\"http://\") || this.#path.startsWith(\"https://\"))\n url = this.#path, proxy = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}`;\n else\n url = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}${this.#path}`;\n try {\n this.#fetchRequest = fetch(url, {\n method,\n headers: this.getHeaders(),\n body: body && method !== \"GET\" && method !== \"HEAD\" && method !== \"OPTIONS\" \? body : @undefined,\n redirect: \"manual\",\n verbose: !1,\n signal: this[kAbortController].signal,\n proxy,\n timeout: !1,\n decompress: !1\n }).then((response) => {\n var res = this.#res = new IncomingMessage(response, {\n type: \"response\",\n [kInternalRequest]: this\n });\n this.emit(\"response\", res);\n }).catch((err) => {\n this.emit(\"error\", err);\n }).finally(() => {\n this.#fetchRequest = null, this[kClearTimeout]();\n });\n } catch (err) {\n this.emit(\"error\", err);\n } finally {\n callback();\n }\n }\n get aborted() {\n return this.#signal\?.aborted || !!this[kAbortController]\?.signal.aborted;\n }\n abort() {\n if (this.aborted)\n return;\n this[kAbortController].abort();\n }\n constructor(input, options, cb) {\n super();\n if (typeof input === \"string\") {\n const urlStr = input;\n try {\n var urlObject = new URL(urlStr);\n } catch (e) {\n @throwTypeError(`Invalid URL: ${urlStr}`);\n }\n input = urlToHttpOptions(urlObject);\n } else if (input && typeof input === \"object\" && input instanceof URL)\n input = urlToHttpOptions(input);\n else\n cb = options, options = input, input = null;\n if (typeof options === \"function\")\n cb = options, options = input || kEmptyObject;\n else\n options = ObjectAssign(input || {}, options);\n var defaultAgent = options._defaultAgent || Agent.globalAgent;\n let protocol = options.protocol;\n if (!protocol)\n if (options.port === 443)\n protocol = \"https:\";\n else\n protocol = defaultAgent.protocol || \"http:\";\n switch (this.#protocol = protocol, this.#agent\?.protocol) {\n case @undefined:\n break;\n case \"http:\":\n if (protocol === \"https:\") {\n defaultAgent = this.#agent = getDefaultHTTPSAgent();\n break;\n }\n case \"https:\":\n if (protocol === \"https\") {\n defaultAgent = this.#agent = Agent.globalAgent;\n break;\n }\n default:\n break;\n }\n if (options.path) {\n const path = @String(options.path);\n if (RegExpPrototypeExec.@call(INVALID_PATH_REGEX, path) !== null)\n throw new Error(\"Path contains unescaped characters\");\n }\n if (protocol !== \"http:\" && protocol !== \"https:\" && protocol) {\n const expectedProtocol = defaultAgent\?.protocol \?\? \"http:\";\n throw new Error(`Protocol mismatch. Expected: ${expectedProtocol}. Got: ${protocol}`);\n }\n const defaultPort = protocol === \"https:\" \? 443 : 80;\n this.#port = options.port || options.defaultPort || this.#agent\?.defaultPort || defaultPort, this.#useDefaultPort = this.#port === defaultPort;\n const host = this.#host = options.host = validateHost(options.hostname, \"hostname\") || validateHost(options.host, \"host\") || \"localhost\";\n this.#socketPath = options.socketPath;\n const signal = options.signal;\n if (signal)\n signal.addEventListener(\"abort\", () => {\n this[kAbortController]\?.abort();\n }), this.#signal = signal;\n let method = options.method;\n const methodIsString = typeof method === \"string\";\n if (method !== null && method !== @undefined && !methodIsString)\n throw new Error(\"ERR_INVALID_ARG_TYPE: options.method\");\n if (methodIsString && method) {\n if (!checkIsHttpToken(method))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN: Method\");\n method = this.#method = StringPrototypeToUpperCase.@call(method);\n } else\n method = this.#method = \"GET\";\n const _maxHeaderSize = options.maxHeaderSize;\n this.#maxHeaderSize = _maxHeaderSize;\n var _joinDuplicateHeaders = options.joinDuplicateHeaders;\n if (this.#joinDuplicateHeaders = _joinDuplicateHeaders, this.#path = options.path || \"/\", cb)\n this.once(\"response\", cb);\n this.#finished = !1, this.#res = null, this.#upgradeOrConnect = !1, this.#parser = null, this.#maxHeadersCount = null, this.#reusedSocket = !1, this.#host = host, this.#protocol = protocol;\n var timeout = options.timeout;\n if (timeout !== @undefined && timeout !== 0)\n this.setTimeout(timeout, @undefined);\n if (!ArrayIsArray(headers)) {\n var headers = options.headers;\n if (headers)\n for (let key in headers)\n this.setHeader(key, headers[key]);\n var auth = options.auth;\n if (auth && !this.getHeader(\"Authorization\"))\n this.setHeader(\"Authorization\", \"Basic \" + @Buffer.from(auth).toString(\"base64\"));\n }\n var { signal: _signal, ...optsWithoutSignal } = options;\n this.#options = optsWithoutSignal;\n }\n setSocketKeepAlive(enable = !0, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.#timeoutTimer = @undefined, this.removeAllListeners(\"timeout\");\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/, METHODS = [\n \"ACL\",\n \"BIND\",\n \"CHECKOUT\",\n \"CONNECT\",\n \"COPY\",\n \"DELETE\",\n \"GET\",\n \"HEAD\",\n \"LINK\",\n \"LOCK\",\n \"M-SEARCH\",\n \"MERGE\",\n \"MKACTIVITY\",\n \"MKCALENDAR\",\n \"MKCOL\",\n \"MOVE\",\n \"NOTIFY\",\n \"OPTIONS\",\n \"PATCH\",\n \"POST\",\n \"PROPFIND\",\n \"PROPPATCH\",\n \"PURGE\",\n \"PUT\",\n \"REBIND\",\n \"REPORT\",\n \"SEARCH\",\n \"SOURCE\",\n \"SUBSCRIBE\",\n \"TRACE\",\n \"UNBIND\",\n \"UNLINK\",\n \"UNLOCK\",\n \"UNSUBSCRIBE\"\n], STATUS_CODES = {\n 100: \"Continue\",\n 101: \"Switching Protocols\",\n 102: \"Processing\",\n 103: \"Early Hints\",\n 200: \"OK\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"Non-Authoritative Information\",\n 204: \"No Content\",\n 205: \"Reset Content\",\n 206: \"Partial Content\",\n 207: \"Multi-Status\",\n 208: \"Already Reported\",\n 226: \"IM Used\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Found\",\n 303: \"See Other\",\n 304: \"Not Modified\",\n 305: \"Use Proxy\",\n 307: \"Temporary Redirect\",\n 308: \"Permanent Redirect\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a Teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 425: \"Too Early\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Request Header Fields Too Large\",\n 451: \"Unavailable For Legal Reasons\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 509: \"Bandwidth Limit Exceeded\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\"\n}, globalAgent = new Agent;\n$ = {\n Agent,\n Server,\n METHODS,\n STATUS_CODES,\n createServer,\n ServerResponse,\n IncomingMessage,\n request,\n get,\n maxHeaderSize: 16384,\n validateHeaderName,\n validateHeaderValue,\n setMaxIdleHTTPParsers(max) {\n },\n globalAgent,\n ClientRequest,\n OutgoingMessage\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeHttp2Code = "(function (){\"use strict\";// src/js/out/tmp/node/http2.ts\nvar connect = function() {\n throwNotImplemented(\"node:http2 connect\", 887);\n}, createServer = function() {\n throwNotImplemented(\"node:http2 createServer\", 887);\n}, createSecureServer = function() {\n throwNotImplemented(\"node:http2 createSecureServer\", 887);\n}, getDefaultSettings = function() {\n return {\n headerTableSize: 4096,\n enablePush: !0,\n initialWindowSize: 65535,\n maxFrameSize: 16384,\n maxConcurrentStreams: 4294967295,\n maxHeaderSize: 65535,\n maxHeaderListSize: 65535,\n enableConnectProtocol: !1\n };\n}, getPackedSettings = function() {\n return Buffer.alloc(0);\n}, getUnpackedSettings = function() {\n return Buffer.alloc(0);\n}, Http2ServerRequest = function() {\n throwNotImplemented(\"node:http2 Http2ServerRequest\", 887);\n}, Http2ServerResponse = function() {\n throwNotImplemented(\"node:http2 Http2ServerResponse\", 887);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), constants = {\n NGHTTP2_ERR_FRAME_SIZE_ERROR: -522,\n NGHTTP2_SESSION_SERVER: 0,\n NGHTTP2_SESSION_CLIENT: 1,\n NGHTTP2_STREAM_STATE_IDLE: 1,\n NGHTTP2_STREAM_STATE_OPEN: 2,\n NGHTTP2_STREAM_STATE_RESERVED_LOCAL: 3,\n NGHTTP2_STREAM_STATE_RESERVED_REMOTE: 4,\n NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: 5,\n NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: 6,\n NGHTTP2_STREAM_STATE_CLOSED: 7,\n NGHTTP2_FLAG_NONE: 0,\n NGHTTP2_FLAG_END_STREAM: 1,\n NGHTTP2_FLAG_END_HEADERS: 4,\n NGHTTP2_FLAG_ACK: 1,\n NGHTTP2_FLAG_PADDED: 8,\n NGHTTP2_FLAG_PRIORITY: 32,\n DEFAULT_SETTINGS_HEADER_TABLE_SIZE: 4096,\n DEFAULT_SETTINGS_ENABLE_PUSH: 1,\n DEFAULT_SETTINGS_MAX_CONCURRENT_STREAMS: 4294967295,\n DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: 65535,\n DEFAULT_SETTINGS_MAX_FRAME_SIZE: 16384,\n DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE: 65535,\n DEFAULT_SETTINGS_ENABLE_CONNECT_PROTOCOL: 0,\n MAX_MAX_FRAME_SIZE: 16777215,\n MIN_MAX_FRAME_SIZE: 16384,\n MAX_INITIAL_WINDOW_SIZE: 2147483647,\n NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: 1,\n NGHTTP2_SETTINGS_ENABLE_PUSH: 2,\n NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: 3,\n NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: 4,\n NGHTTP2_SETTINGS_MAX_FRAME_SIZE: 5,\n NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: 6,\n NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL: 8,\n PADDING_STRATEGY_NONE: 0,\n PADDING_STRATEGY_ALIGNED: 1,\n PADDING_STRATEGY_MAX: 2,\n PADDING_STRATEGY_CALLBACK: 1,\n NGHTTP2_NO_ERROR: 0,\n NGHTTP2_PROTOCOL_ERROR: 1,\n NGHTTP2_INTERNAL_ERROR: 2,\n NGHTTP2_FLOW_CONTROL_ERROR: 3,\n NGHTTP2_SETTINGS_TIMEOUT: 4,\n NGHTTP2_STREAM_CLOSED: 5,\n NGHTTP2_FRAME_SIZE_ERROR: 6,\n NGHTTP2_REFUSED_STREAM: 7,\n NGHTTP2_CANCEL: 8,\n NGHTTP2_COMPRESSION_ERROR: 9,\n NGHTTP2_CONNECT_ERROR: 10,\n NGHTTP2_ENHANCE_YOUR_CALM: 11,\n NGHTTP2_INADEQUATE_SECURITY: 12,\n NGHTTP2_HTTP_1_1_REQUIRED: 13,\n NGHTTP2_DEFAULT_WEIGHT: 16,\n HTTP2_HEADER_STATUS: \":status\",\n HTTP2_HEADER_METHOD: \":method\",\n HTTP2_HEADER_AUTHORITY: \":authority\",\n HTTP2_HEADER_SCHEME: \":scheme\",\n HTTP2_HEADER_PATH: \":path\",\n HTTP2_HEADER_PROTOCOL: \":protocol\",\n HTTP2_HEADER_ACCEPT_ENCODING: \"accept-encoding\",\n HTTP2_HEADER_ACCEPT_LANGUAGE: \"accept-language\",\n HTTP2_HEADER_ACCEPT_RANGES: \"accept-ranges\",\n HTTP2_HEADER_ACCEPT: \"accept\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS: \"access-control-allow-credentials\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_HEADERS: \"access-control-allow-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_METHODS: \"access-control-allow-methods\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: \"access-control-allow-origin\",\n HTTP2_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS: \"access-control-expose-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_REQUEST_HEADERS: \"access-control-request-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_REQUEST_METHOD: \"access-control-request-method\",\n HTTP2_HEADER_AGE: \"age\",\n HTTP2_HEADER_AUTHORIZATION: \"authorization\",\n HTTP2_HEADER_CACHE_CONTROL: \"cache-control\",\n HTTP2_HEADER_CONNECTION: \"connection\",\n HTTP2_HEADER_CONTENT_DISPOSITION: \"content-disposition\",\n HTTP2_HEADER_CONTENT_ENCODING: \"content-encoding\",\n HTTP2_HEADER_CONTENT_LENGTH: \"content-length\",\n HTTP2_HEADER_CONTENT_TYPE: \"content-type\",\n HTTP2_HEADER_COOKIE: \"cookie\",\n HTTP2_HEADER_DATE: \"date\",\n HTTP2_HEADER_ETAG: \"etag\",\n HTTP2_HEADER_FORWARDED: \"forwarded\",\n HTTP2_HEADER_HOST: \"host\",\n HTTP2_HEADER_IF_MODIFIED_SINCE: \"if-modified-since\",\n HTTP2_HEADER_IF_NONE_MATCH: \"if-none-match\",\n HTTP2_HEADER_IF_RANGE: \"if-range\",\n HTTP2_HEADER_LAST_MODIFIED: \"last-modified\",\n HTTP2_HEADER_LINK: \"link\",\n HTTP2_HEADER_LOCATION: \"location\",\n HTTP2_HEADER_RANGE: \"range\",\n HTTP2_HEADER_REFERER: \"referer\",\n HTTP2_HEADER_SERVER: \"server\",\n HTTP2_HEADER_SET_COOKIE: \"set-cookie\",\n HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: \"strict-transport-security\",\n HTTP2_HEADER_TRANSFER_ENCODING: \"transfer-encoding\",\n HTTP2_HEADER_TE: \"te\",\n HTTP2_HEADER_UPGRADE_INSECURE_REQUESTS: \"upgrade-insecure-requests\",\n HTTP2_HEADER_UPGRADE: \"upgrade\",\n HTTP2_HEADER_USER_AGENT: \"user-agent\",\n HTTP2_HEADER_VARY: \"vary\",\n HTTP2_HEADER_X_CONTENT_TYPE_OPTIONS: \"x-content-type-options\",\n HTTP2_HEADER_X_FRAME_OPTIONS: \"x-frame-options\",\n HTTP2_HEADER_KEEP_ALIVE: \"keep-alive\",\n HTTP2_HEADER_PROXY_CONNECTION: \"proxy-connection\",\n HTTP2_HEADER_X_XSS_PROTECTION: \"x-xss-protection\",\n HTTP2_HEADER_ALT_SVC: \"alt-svc\",\n HTTP2_HEADER_CONTENT_SECURITY_POLICY: \"content-security-policy\",\n HTTP2_HEADER_EARLY_DATA: \"early-data\",\n HTTP2_HEADER_EXPECT_CT: \"expect-ct\",\n HTTP2_HEADER_ORIGIN: \"origin\",\n HTTP2_HEADER_PURPOSE: \"purpose\",\n HTTP2_HEADER_TIMING_ALLOW_ORIGIN: \"timing-allow-origin\",\n HTTP2_HEADER_X_FORWARDED_FOR: \"x-forwarded-for\",\n HTTP2_HEADER_PRIORITY: \"priority\",\n HTTP2_HEADER_ACCEPT_CHARSET: \"accept-charset\",\n HTTP2_HEADER_ACCESS_CONTROL_MAX_AGE: \"access-control-max-age\",\n HTTP2_HEADER_ALLOW: \"allow\",\n HTTP2_HEADER_CONTENT_LANGUAGE: \"content-language\",\n HTTP2_HEADER_CONTENT_LOCATION: \"content-location\",\n HTTP2_HEADER_CONTENT_MD5: \"content-md5\",\n HTTP2_HEADER_CONTENT_RANGE: \"content-range\",\n HTTP2_HEADER_DNT: \"dnt\",\n HTTP2_HEADER_EXPECT: \"expect\",\n HTTP2_HEADER_EXPIRES: \"expires\",\n HTTP2_HEADER_FROM: \"from\",\n HTTP2_HEADER_IF_MATCH: \"if-match\",\n HTTP2_HEADER_IF_UNMODIFIED_SINCE: \"if-unmodified-since\",\n HTTP2_HEADER_MAX_FORWARDS: \"max-forwards\",\n HTTP2_HEADER_PREFER: \"prefer\",\n HTTP2_HEADER_PROXY_AUTHENTICATE: \"proxy-authenticate\",\n HTTP2_HEADER_PROXY_AUTHORIZATION: \"proxy-authorization\",\n HTTP2_HEADER_REFRESH: \"refresh\",\n HTTP2_HEADER_RETRY_AFTER: \"retry-after\",\n HTTP2_HEADER_TRAILER: \"trailer\",\n HTTP2_HEADER_TK: \"tk\",\n HTTP2_HEADER_VIA: \"via\",\n HTTP2_HEADER_WARNING: \"warning\",\n HTTP2_HEADER_WWW_AUTHENTICATE: \"www-authenticate\",\n HTTP2_HEADER_HTTP2_SETTINGS: \"http2-settings\",\n HTTP2_METHOD_ACL: \"ACL\",\n HTTP2_METHOD_BASELINE_CONTROL: \"BASELINE-CONTROL\",\n HTTP2_METHOD_BIND: \"BIND\",\n HTTP2_METHOD_CHECKIN: \"CHECKIN\",\n HTTP2_METHOD_CHECKOUT: \"CHECKOUT\",\n HTTP2_METHOD_CONNECT: \"CONNECT\",\n HTTP2_METHOD_COPY: \"COPY\",\n HTTP2_METHOD_DELETE: \"DELETE\",\n HTTP2_METHOD_GET: \"GET\",\n HTTP2_METHOD_HEAD: \"HEAD\",\n HTTP2_METHOD_LABEL: \"LABEL\",\n HTTP2_METHOD_LINK: \"LINK\",\n HTTP2_METHOD_LOCK: \"LOCK\",\n HTTP2_METHOD_MERGE: \"MERGE\",\n HTTP2_METHOD_MKACTIVITY: \"MKACTIVITY\",\n HTTP2_METHOD_MKCALENDAR: \"MKCALENDAR\",\n HTTP2_METHOD_MKCOL: \"MKCOL\",\n HTTP2_METHOD_MKREDIRECTREF: \"MKREDIRECTREF\",\n HTTP2_METHOD_MKWORKSPACE: \"MKWORKSPACE\",\n HTTP2_METHOD_MOVE: \"MOVE\",\n HTTP2_METHOD_OPTIONS: \"OPTIONS\",\n HTTP2_METHOD_ORDERPATCH: \"ORDERPATCH\",\n HTTP2_METHOD_PATCH: \"PATCH\",\n HTTP2_METHOD_POST: \"POST\",\n HTTP2_METHOD_PRI: \"PRI\",\n HTTP2_METHOD_PROPFIND: \"PROPFIND\",\n HTTP2_METHOD_PROPPATCH: \"PROPPATCH\",\n HTTP2_METHOD_PUT: \"PUT\",\n HTTP2_METHOD_REBIND: \"REBIND\",\n HTTP2_METHOD_REPORT: \"REPORT\",\n HTTP2_METHOD_SEARCH: \"SEARCH\",\n HTTP2_METHOD_TRACE: \"TRACE\",\n HTTP2_METHOD_UNBIND: \"UNBIND\",\n HTTP2_METHOD_UNCHECKOUT: \"UNCHECKOUT\",\n HTTP2_METHOD_UNLINK: \"UNLINK\",\n HTTP2_METHOD_UNLOCK: \"UNLOCK\",\n HTTP2_METHOD_UPDATE: \"UPDATE\",\n HTTP2_METHOD_UPDATEREDIRECTREF: \"UPDATEREDIRECTREF\",\n HTTP2_METHOD_VERSION_CONTROL: \"VERSION-CONTROL\",\n HTTP_STATUS_CONTINUE: 100,\n HTTP_STATUS_SWITCHING_PROTOCOLS: 101,\n HTTP_STATUS_PROCESSING: 102,\n HTTP_STATUS_EARLY_HINTS: 103,\n HTTP_STATUS_OK: 200,\n HTTP_STATUS_CREATED: 201,\n HTTP_STATUS_ACCEPTED: 202,\n HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: 203,\n HTTP_STATUS_NO_CONTENT: 204,\n HTTP_STATUS_RESET_CONTENT: 205,\n HTTP_STATUS_PARTIAL_CONTENT: 206,\n HTTP_STATUS_MULTI_STATUS: 207,\n HTTP_STATUS_ALREADY_REPORTED: 208,\n HTTP_STATUS_IM_USED: 226,\n HTTP_STATUS_MULTIPLE_CHOICES: 300,\n HTTP_STATUS_MOVED_PERMANENTLY: 301,\n HTTP_STATUS_FOUND: 302,\n HTTP_STATUS_SEE_OTHER: 303,\n HTTP_STATUS_NOT_MODIFIED: 304,\n HTTP_STATUS_USE_PROXY: 305,\n HTTP_STATUS_TEMPORARY_REDIRECT: 307,\n HTTP_STATUS_PERMANENT_REDIRECT: 308,\n HTTP_STATUS_BAD_REQUEST: 400,\n HTTP_STATUS_UNAUTHORIZED: 401,\n HTTP_STATUS_PAYMENT_REQUIRED: 402,\n HTTP_STATUS_FORBIDDEN: 403,\n HTTP_STATUS_NOT_FOUND: 404,\n HTTP_STATUS_METHOD_NOT_ALLOWED: 405,\n HTTP_STATUS_NOT_ACCEPTABLE: 406,\n HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: 407,\n HTTP_STATUS_REQUEST_TIMEOUT: 408,\n HTTP_STATUS_CONFLICT: 409,\n HTTP_STATUS_GONE: 410,\n HTTP_STATUS_LENGTH_REQUIRED: 411,\n HTTP_STATUS_PRECONDITION_FAILED: 412,\n HTTP_STATUS_PAYLOAD_TOO_LARGE: 413,\n HTTP_STATUS_URI_TOO_LONG: 414,\n HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: 415,\n HTTP_STATUS_RANGE_NOT_SATISFIABLE: 416,\n HTTP_STATUS_EXPECTATION_FAILED: 417,\n HTTP_STATUS_TEAPOT: 418,\n HTTP_STATUS_MISDIRECTED_REQUEST: 421,\n HTTP_STATUS_UNPROCESSABLE_ENTITY: 422,\n HTTP_STATUS_LOCKED: 423,\n HTTP_STATUS_FAILED_DEPENDENCY: 424,\n HTTP_STATUS_TOO_EARLY: 425,\n HTTP_STATUS_UPGRADE_REQUIRED: 426,\n HTTP_STATUS_PRECONDITION_REQUIRED: 428,\n HTTP_STATUS_TOO_MANY_REQUESTS: 429,\n HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: 431,\n HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: 451,\n HTTP_STATUS_INTERNAL_SERVER_ERROR: 500,\n HTTP_STATUS_NOT_IMPLEMENTED: 501,\n HTTP_STATUS_BAD_GATEWAY: 502,\n HTTP_STATUS_SERVICE_UNAVAILABLE: 503,\n HTTP_STATUS_GATEWAY_TIMEOUT: 504,\n HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: 505,\n HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: 506,\n HTTP_STATUS_INSUFFICIENT_STORAGE: 507,\n HTTP_STATUS_LOOP_DETECTED: 508,\n HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: 509,\n HTTP_STATUS_NOT_EXTENDED: 510,\n HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: 511\n}, sensitiveHeaders = Symbol.for(\"nodejs.http2.sensitiveHeaders\");\nHttp2ServerRequest.prototype = {};\nHttp2ServerResponse.prototype = {};\n$ = {\n constants,\n createServer,\n createSecureServer,\n getDefaultSettings,\n getPackedSettings,\n getUnpackedSettings,\n sensitiveHeaders,\n Http2ServerRequest,\n Http2ServerResponse,\n connect\n};\nhideFromStack([\n Http2ServerRequest,\n Http2ServerResponse,\n connect,\n createServer,\n createSecureServer,\n getDefaultSettings,\n getPackedSettings,\n getUnpackedSettings\n]);\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeHttp2Code = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/http2.ts\nvar connect = function() {\n throwNotImplemented(\"node:http2 connect\", 887);\n}, createServer = function() {\n throwNotImplemented(\"node:http2 createServer\", 887);\n}, createSecureServer = function() {\n throwNotImplemented(\"node:http2 createSecureServer\", 887);\n}, getDefaultSettings = function() {\n return {\n headerTableSize: 4096,\n enablePush: !0,\n initialWindowSize: 65535,\n maxFrameSize: 16384,\n maxConcurrentStreams: 4294967295,\n maxHeaderSize: 65535,\n maxHeaderListSize: 65535,\n enableConnectProtocol: !1\n };\n}, getPackedSettings = function() {\n return @Buffer.alloc(0);\n}, getUnpackedSettings = function() {\n return @Buffer.alloc(0);\n}, Http2ServerRequest = function() {\n throwNotImplemented(\"node:http2 Http2ServerRequest\", 887);\n}, Http2ServerResponse = function() {\n throwNotImplemented(\"node:http2 Http2ServerResponse\", 887);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), constants = {\n NGHTTP2_ERR_FRAME_SIZE_ERROR: -522,\n NGHTTP2_SESSION_SERVER: 0,\n NGHTTP2_SESSION_CLIENT: 1,\n NGHTTP2_STREAM_STATE_IDLE: 1,\n NGHTTP2_STREAM_STATE_OPEN: 2,\n NGHTTP2_STREAM_STATE_RESERVED_LOCAL: 3,\n NGHTTP2_STREAM_STATE_RESERVED_REMOTE: 4,\n NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: 5,\n NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: 6,\n NGHTTP2_STREAM_STATE_CLOSED: 7,\n NGHTTP2_FLAG_NONE: 0,\n NGHTTP2_FLAG_END_STREAM: 1,\n NGHTTP2_FLAG_END_HEADERS: 4,\n NGHTTP2_FLAG_ACK: 1,\n NGHTTP2_FLAG_PADDED: 8,\n NGHTTP2_FLAG_PRIORITY: 32,\n DEFAULT_SETTINGS_HEADER_TABLE_SIZE: 4096,\n DEFAULT_SETTINGS_ENABLE_PUSH: 1,\n DEFAULT_SETTINGS_MAX_CONCURRENT_STREAMS: 4294967295,\n DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: 65535,\n DEFAULT_SETTINGS_MAX_FRAME_SIZE: 16384,\n DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE: 65535,\n DEFAULT_SETTINGS_ENABLE_CONNECT_PROTOCOL: 0,\n MAX_MAX_FRAME_SIZE: 16777215,\n MIN_MAX_FRAME_SIZE: 16384,\n MAX_INITIAL_WINDOW_SIZE: 2147483647,\n NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: 1,\n NGHTTP2_SETTINGS_ENABLE_PUSH: 2,\n NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: 3,\n NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: 4,\n NGHTTP2_SETTINGS_MAX_FRAME_SIZE: 5,\n NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: 6,\n NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL: 8,\n PADDING_STRATEGY_NONE: 0,\n PADDING_STRATEGY_ALIGNED: 1,\n PADDING_STRATEGY_MAX: 2,\n PADDING_STRATEGY_CALLBACK: 1,\n NGHTTP2_NO_ERROR: 0,\n NGHTTP2_PROTOCOL_ERROR: 1,\n NGHTTP2_INTERNAL_ERROR: 2,\n NGHTTP2_FLOW_CONTROL_ERROR: 3,\n NGHTTP2_SETTINGS_TIMEOUT: 4,\n NGHTTP2_STREAM_CLOSED: 5,\n NGHTTP2_FRAME_SIZE_ERROR: 6,\n NGHTTP2_REFUSED_STREAM: 7,\n NGHTTP2_CANCEL: 8,\n NGHTTP2_COMPRESSION_ERROR: 9,\n NGHTTP2_CONNECT_ERROR: 10,\n NGHTTP2_ENHANCE_YOUR_CALM: 11,\n NGHTTP2_INADEQUATE_SECURITY: 12,\n NGHTTP2_HTTP_1_1_REQUIRED: 13,\n NGHTTP2_DEFAULT_WEIGHT: 16,\n HTTP2_HEADER_STATUS: \":status\",\n HTTP2_HEADER_METHOD: \":method\",\n HTTP2_HEADER_AUTHORITY: \":authority\",\n HTTP2_HEADER_SCHEME: \":scheme\",\n HTTP2_HEADER_PATH: \":path\",\n HTTP2_HEADER_PROTOCOL: \":protocol\",\n HTTP2_HEADER_ACCEPT_ENCODING: \"accept-encoding\",\n HTTP2_HEADER_ACCEPT_LANGUAGE: \"accept-language\",\n HTTP2_HEADER_ACCEPT_RANGES: \"accept-ranges\",\n HTTP2_HEADER_ACCEPT: \"accept\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS: \"access-control-allow-credentials\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_HEADERS: \"access-control-allow-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_METHODS: \"access-control-allow-methods\",\n HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: \"access-control-allow-origin\",\n HTTP2_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS: \"access-control-expose-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_REQUEST_HEADERS: \"access-control-request-headers\",\n HTTP2_HEADER_ACCESS_CONTROL_REQUEST_METHOD: \"access-control-request-method\",\n HTTP2_HEADER_AGE: \"age\",\n HTTP2_HEADER_AUTHORIZATION: \"authorization\",\n HTTP2_HEADER_CACHE_CONTROL: \"cache-control\",\n HTTP2_HEADER_CONNECTION: \"connection\",\n HTTP2_HEADER_CONTENT_DISPOSITION: \"content-disposition\",\n HTTP2_HEADER_CONTENT_ENCODING: \"content-encoding\",\n HTTP2_HEADER_CONTENT_LENGTH: \"content-length\",\n HTTP2_HEADER_CONTENT_TYPE: \"content-type\",\n HTTP2_HEADER_COOKIE: \"cookie\",\n HTTP2_HEADER_DATE: \"date\",\n HTTP2_HEADER_ETAG: \"etag\",\n HTTP2_HEADER_FORWARDED: \"forwarded\",\n HTTP2_HEADER_HOST: \"host\",\n HTTP2_HEADER_IF_MODIFIED_SINCE: \"if-modified-since\",\n HTTP2_HEADER_IF_NONE_MATCH: \"if-none-match\",\n HTTP2_HEADER_IF_RANGE: \"if-range\",\n HTTP2_HEADER_LAST_MODIFIED: \"last-modified\",\n HTTP2_HEADER_LINK: \"link\",\n HTTP2_HEADER_LOCATION: \"location\",\n HTTP2_HEADER_RANGE: \"range\",\n HTTP2_HEADER_REFERER: \"referer\",\n HTTP2_HEADER_SERVER: \"server\",\n HTTP2_HEADER_SET_COOKIE: \"set-cookie\",\n HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: \"strict-transport-security\",\n HTTP2_HEADER_TRANSFER_ENCODING: \"transfer-encoding\",\n HTTP2_HEADER_TE: \"te\",\n HTTP2_HEADER_UPGRADE_INSECURE_REQUESTS: \"upgrade-insecure-requests\",\n HTTP2_HEADER_UPGRADE: \"upgrade\",\n HTTP2_HEADER_USER_AGENT: \"user-agent\",\n HTTP2_HEADER_VARY: \"vary\",\n HTTP2_HEADER_X_CONTENT_TYPE_OPTIONS: \"x-content-type-options\",\n HTTP2_HEADER_X_FRAME_OPTIONS: \"x-frame-options\",\n HTTP2_HEADER_KEEP_ALIVE: \"keep-alive\",\n HTTP2_HEADER_PROXY_CONNECTION: \"proxy-connection\",\n HTTP2_HEADER_X_XSS_PROTECTION: \"x-xss-protection\",\n HTTP2_HEADER_ALT_SVC: \"alt-svc\",\n HTTP2_HEADER_CONTENT_SECURITY_POLICY: \"content-security-policy\",\n HTTP2_HEADER_EARLY_DATA: \"early-data\",\n HTTP2_HEADER_EXPECT_CT: \"expect-ct\",\n HTTP2_HEADER_ORIGIN: \"origin\",\n HTTP2_HEADER_PURPOSE: \"purpose\",\n HTTP2_HEADER_TIMING_ALLOW_ORIGIN: \"timing-allow-origin\",\n HTTP2_HEADER_X_FORWARDED_FOR: \"x-forwarded-for\",\n HTTP2_HEADER_PRIORITY: \"priority\",\n HTTP2_HEADER_ACCEPT_CHARSET: \"accept-charset\",\n HTTP2_HEADER_ACCESS_CONTROL_MAX_AGE: \"access-control-max-age\",\n HTTP2_HEADER_ALLOW: \"allow\",\n HTTP2_HEADER_CONTENT_LANGUAGE: \"content-language\",\n HTTP2_HEADER_CONTENT_LOCATION: \"content-location\",\n HTTP2_HEADER_CONTENT_MD5: \"content-md5\",\n HTTP2_HEADER_CONTENT_RANGE: \"content-range\",\n HTTP2_HEADER_DNT: \"dnt\",\n HTTP2_HEADER_EXPECT: \"expect\",\n HTTP2_HEADER_EXPIRES: \"expires\",\n HTTP2_HEADER_FROM: \"from\",\n HTTP2_HEADER_IF_MATCH: \"if-match\",\n HTTP2_HEADER_IF_UNMODIFIED_SINCE: \"if-unmodified-since\",\n HTTP2_HEADER_MAX_FORWARDS: \"max-forwards\",\n HTTP2_HEADER_PREFER: \"prefer\",\n HTTP2_HEADER_PROXY_AUTHENTICATE: \"proxy-authenticate\",\n HTTP2_HEADER_PROXY_AUTHORIZATION: \"proxy-authorization\",\n HTTP2_HEADER_REFRESH: \"refresh\",\n HTTP2_HEADER_RETRY_AFTER: \"retry-after\",\n HTTP2_HEADER_TRAILER: \"trailer\",\n HTTP2_HEADER_TK: \"tk\",\n HTTP2_HEADER_VIA: \"via\",\n HTTP2_HEADER_WARNING: \"warning\",\n HTTP2_HEADER_WWW_AUTHENTICATE: \"www-authenticate\",\n HTTP2_HEADER_HTTP2_SETTINGS: \"http2-settings\",\n HTTP2_METHOD_ACL: \"ACL\",\n HTTP2_METHOD_BASELINE_CONTROL: \"BASELINE-CONTROL\",\n HTTP2_METHOD_BIND: \"BIND\",\n HTTP2_METHOD_CHECKIN: \"CHECKIN\",\n HTTP2_METHOD_CHECKOUT: \"CHECKOUT\",\n HTTP2_METHOD_CONNECT: \"CONNECT\",\n HTTP2_METHOD_COPY: \"COPY\",\n HTTP2_METHOD_DELETE: \"DELETE\",\n HTTP2_METHOD_GET: \"GET\",\n HTTP2_METHOD_HEAD: \"HEAD\",\n HTTP2_METHOD_LABEL: \"LABEL\",\n HTTP2_METHOD_LINK: \"LINK\",\n HTTP2_METHOD_LOCK: \"LOCK\",\n HTTP2_METHOD_MERGE: \"MERGE\",\n HTTP2_METHOD_MKACTIVITY: \"MKACTIVITY\",\n HTTP2_METHOD_MKCALENDAR: \"MKCALENDAR\",\n HTTP2_METHOD_MKCOL: \"MKCOL\",\n HTTP2_METHOD_MKREDIRECTREF: \"MKREDIRECTREF\",\n HTTP2_METHOD_MKWORKSPACE: \"MKWORKSPACE\",\n HTTP2_METHOD_MOVE: \"MOVE\",\n HTTP2_METHOD_OPTIONS: \"OPTIONS\",\n HTTP2_METHOD_ORDERPATCH: \"ORDERPATCH\",\n HTTP2_METHOD_PATCH: \"PATCH\",\n HTTP2_METHOD_POST: \"POST\",\n HTTP2_METHOD_PRI: \"PRI\",\n HTTP2_METHOD_PROPFIND: \"PROPFIND\",\n HTTP2_METHOD_PROPPATCH: \"PROPPATCH\",\n HTTP2_METHOD_PUT: \"PUT\",\n HTTP2_METHOD_REBIND: \"REBIND\",\n HTTP2_METHOD_REPORT: \"REPORT\",\n HTTP2_METHOD_SEARCH: \"SEARCH\",\n HTTP2_METHOD_TRACE: \"TRACE\",\n HTTP2_METHOD_UNBIND: \"UNBIND\",\n HTTP2_METHOD_UNCHECKOUT: \"UNCHECKOUT\",\n HTTP2_METHOD_UNLINK: \"UNLINK\",\n HTTP2_METHOD_UNLOCK: \"UNLOCK\",\n HTTP2_METHOD_UPDATE: \"UPDATE\",\n HTTP2_METHOD_UPDATEREDIRECTREF: \"UPDATEREDIRECTREF\",\n HTTP2_METHOD_VERSION_CONTROL: \"VERSION-CONTROL\",\n HTTP_STATUS_CONTINUE: 100,\n HTTP_STATUS_SWITCHING_PROTOCOLS: 101,\n HTTP_STATUS_PROCESSING: 102,\n HTTP_STATUS_EARLY_HINTS: 103,\n HTTP_STATUS_OK: 200,\n HTTP_STATUS_CREATED: 201,\n HTTP_STATUS_ACCEPTED: 202,\n HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: 203,\n HTTP_STATUS_NO_CONTENT: 204,\n HTTP_STATUS_RESET_CONTENT: 205,\n HTTP_STATUS_PARTIAL_CONTENT: 206,\n HTTP_STATUS_MULTI_STATUS: 207,\n HTTP_STATUS_ALREADY_REPORTED: 208,\n HTTP_STATUS_IM_USED: 226,\n HTTP_STATUS_MULTIPLE_CHOICES: 300,\n HTTP_STATUS_MOVED_PERMANENTLY: 301,\n HTTP_STATUS_FOUND: 302,\n HTTP_STATUS_SEE_OTHER: 303,\n HTTP_STATUS_NOT_MODIFIED: 304,\n HTTP_STATUS_USE_PROXY: 305,\n HTTP_STATUS_TEMPORARY_REDIRECT: 307,\n HTTP_STATUS_PERMANENT_REDIRECT: 308,\n HTTP_STATUS_BAD_REQUEST: 400,\n HTTP_STATUS_UNAUTHORIZED: 401,\n HTTP_STATUS_PAYMENT_REQUIRED: 402,\n HTTP_STATUS_FORBIDDEN: 403,\n HTTP_STATUS_NOT_FOUND: 404,\n HTTP_STATUS_METHOD_NOT_ALLOWED: 405,\n HTTP_STATUS_NOT_ACCEPTABLE: 406,\n HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: 407,\n HTTP_STATUS_REQUEST_TIMEOUT: 408,\n HTTP_STATUS_CONFLICT: 409,\n HTTP_STATUS_GONE: 410,\n HTTP_STATUS_LENGTH_REQUIRED: 411,\n HTTP_STATUS_PRECONDITION_FAILED: 412,\n HTTP_STATUS_PAYLOAD_TOO_LARGE: 413,\n HTTP_STATUS_URI_TOO_LONG: 414,\n HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: 415,\n HTTP_STATUS_RANGE_NOT_SATISFIABLE: 416,\n HTTP_STATUS_EXPECTATION_FAILED: 417,\n HTTP_STATUS_TEAPOT: 418,\n HTTP_STATUS_MISDIRECTED_REQUEST: 421,\n HTTP_STATUS_UNPROCESSABLE_ENTITY: 422,\n HTTP_STATUS_LOCKED: 423,\n HTTP_STATUS_FAILED_DEPENDENCY: 424,\n HTTP_STATUS_TOO_EARLY: 425,\n HTTP_STATUS_UPGRADE_REQUIRED: 426,\n HTTP_STATUS_PRECONDITION_REQUIRED: 428,\n HTTP_STATUS_TOO_MANY_REQUESTS: 429,\n HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: 431,\n HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: 451,\n HTTP_STATUS_INTERNAL_SERVER_ERROR: 500,\n HTTP_STATUS_NOT_IMPLEMENTED: 501,\n HTTP_STATUS_BAD_GATEWAY: 502,\n HTTP_STATUS_SERVICE_UNAVAILABLE: 503,\n HTTP_STATUS_GATEWAY_TIMEOUT: 504,\n HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: 505,\n HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: 506,\n HTTP_STATUS_INSUFFICIENT_STORAGE: 507,\n HTTP_STATUS_LOOP_DETECTED: 508,\n HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: 509,\n HTTP_STATUS_NOT_EXTENDED: 510,\n HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: 511\n}, sensitiveHeaders = Symbol.for(\"nodejs.http2.sensitiveHeaders\");\nHttp2ServerRequest.prototype = {};\nHttp2ServerResponse.prototype = {};\n$ = {\n constants,\n createServer,\n createSecureServer,\n getDefaultSettings,\n getPackedSettings,\n getUnpackedSettings,\n sensitiveHeaders,\n Http2ServerRequest,\n Http2ServerResponse,\n connect\n};\nhideFromStack([\n Http2ServerRequest,\n Http2ServerResponse,\n connect,\n createServer,\n createSecureServer,\n getDefaultSettings,\n getPackedSettings,\n getUnpackedSettings\n]);\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeHttpsCode = "(function (){\"use strict\";// src/js/out/tmp/node/https.ts\nvar request = function(input, options, cb) {\n if (input && typeof input === \"object\" && !(input instanceof URL))\n input.protocol \?\?= \"https:\";\n else if (typeof options === \"object\")\n options.protocol \?\?= \"https:\";\n return http.request(input, options, cb);\n}, get = function(input, options, cb) {\n const req = request(input, options, cb);\n return req.end(), req;\n}, $, http = @getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21);\n$ = {\n ...http,\n get,\n request\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeHttpsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/https.ts\nvar request = function(input, options, cb) {\n if (input && typeof input === \"object\" && !(input instanceof URL))\n input.protocol \?\?= \"https:\";\n else if (typeof options === \"object\")\n options.protocol \?\?= \"https:\";\n return http.request(input, options, cb);\n}, get = function(input, options, cb) {\n const req = request(input, options, cb);\n return req.end(), req;\n}, $, http = @getInternalField(@internalModuleRegistry, 23) || @createInternalModuleById(23);\n$ = {\n ...http,\n get,\n request\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeInspectorCode = "(function (){\"use strict\";// src/js/out/tmp/node/inspector.ts\nvar open = function() {\n throwNotImplemented(\"node:inspector open\", 2445);\n}, close = function() {\n throwNotImplemented(\"node:inspector close\", 2445);\n}, url = function() {\n throwNotImplemented(\"node:inspector url\", 2445);\n}, waitForDebugger = function() {\n throwNotImplemented(\"node:inspector waitForDebugger\", 2445);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18);\n\nclass Session extends EventEmitter {\n constructor() {\n super();\n throwNotImplemented(\"node:inspector Session\", 2445);\n }\n}\nvar console = {\n ...globalThis.console,\n context: {\n console: globalThis.console\n }\n};\n$ = {\n console,\n open,\n close,\n url,\n waitForDebugger,\n Session\n};\nhideFromStack(open, close, url, waitForDebugger, Session.prototype.constructor);\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeInspectorCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/inspector.ts\nvar open = function() {\n throwNotImplemented(\"node:inspector open\", 2445);\n}, close = function() {\n throwNotImplemented(\"node:inspector close\", 2445);\n}, url = function() {\n throwNotImplemented(\"node:inspector url\", 2445);\n}, waitForDebugger = function() {\n throwNotImplemented(\"node:inspector waitForDebugger\", 2445);\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20);\n\nclass Session extends EventEmitter {\n constructor() {\n super();\n throwNotImplemented(\"node:inspector Session\", 2445);\n }\n}\nvar console = {\n ...globalThis.console,\n context: {\n console: globalThis.console\n }\n};\n$ = {\n console,\n open,\n close,\n url,\n waitForDebugger,\n Session\n};\nhideFromStack(open, close, url, waitForDebugger, Session.prototype.constructor);\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeNetCode = "(function (){\"use strict\";// src/js/out/tmp/node/net.ts\nvar isIPv4 = function(s) {\n return IPv4Reg.test(s);\n}, isIPv6 = function(s) {\n return IPv6Reg.test(s);\n}, isIP = function(s) {\n if (isIPv4(s))\n return 4;\n if (isIPv6(s))\n return 6;\n return 0;\n}, createConnection = function(port, host, connectListener) {\n if (typeof port === \"object\")\n return new Socket(port).connect(port, host, connectListener);\n return new Socket().connect(port, host, connectListener);\n}, emitErrorNextTick = function(self, error) {\n self.emit(\"error\", error);\n}, emitListeningNextTick = function(self, onListen) {\n if (typeof onListen === \"function\")\n try {\n onListen();\n } catch (err) {\n self.emit(\"error\", err);\n }\n self.emit(\"listening\");\n}, createServer = function(options, connectionListener) {\n return new Server(options, connectionListener);\n}, $, { Duplex } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18);\nvar IPv4Reg = new RegExp(\"^((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$\");\nvar IPv6Reg = new RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\"), { connect: bunConnect } = Bun, { setTimeout } = globalThis, bunTlsSymbol = Symbol.for(\"::buntls::\"), bunSocketServerHandlers = Symbol.for(\"::bunsocket_serverhandlers::\"), bunSocketServerConnections = Symbol.for(\"::bunnetserverconnections::\"), bunSocketServerOptions = Symbol.for(\"::bunnetserveroptions::\"), bunSocketInternal = Symbol.for(\"::bunnetsocketinternal::\"), bunTLSConnectOptions = Symbol.for(\"::buntlsconnectoptions::\"), SocketClass, Socket = function(InternalSocket) {\n return SocketClass = InternalSocket, Object.defineProperty(SocketClass.prototype, Symbol.toStringTag, {\n value: \"Socket\",\n enumerable: !1\n }), Object.defineProperty(function Socket(options) {\n return new InternalSocket(options);\n }, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalSocket;\n }\n });\n}(class Socket2 extends Duplex {\n static #Handlers = {\n close: Socket2.#Close,\n data({ data: self }, buffer) {\n self.bytesRead += buffer.length;\n const queue = self.#readQueue;\n if (queue.isEmpty()) {\n if (self.push(buffer))\n return;\n }\n queue.push(buffer);\n },\n drain: Socket2.#Drain,\n end: Socket2.#Close,\n error(socket, error) {\n const self = socket.data, callback = self.#writeCallback;\n if (callback)\n self.#writeCallback = null, callback(error);\n self.emit(\"error\", error);\n },\n open(socket) {\n const self = socket.data;\n socket.timeout(self.timeout), socket.ref(), self[bunSocketInternal] = socket, self.connecting = !1;\n const options = self[bunTLSConnectOptions];\n if (options) {\n const { session } = options;\n if (session)\n self.setSession(session);\n }\n if (!self.#upgraded)\n self.emit(\"connect\", self);\n Socket2.#Drain(socket);\n },\n handshake(socket, success, verifyError) {\n const { data: self } = socket;\n self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self.emit(\"secure\", self);\n const { checkServerIdentity } = self[bunTLSConnectOptions];\n if (!verifyError && typeof checkServerIdentity === \"function\" && self.servername) {\n const cert = self.getPeerCertificate(!0);\n verifyError = checkServerIdentity(self.servername, cert);\n }\n if (self._requestCert || self._rejectUnauthorized) {\n if (verifyError) {\n if (self.authorized = !1, self.authorizationError = verifyError.code || verifyError.message, self._rejectUnauthorized) {\n self.destroy(verifyError);\n return;\n }\n }\n } else\n self.authorized = !0;\n self.emit(\"secureConnect\", verifyError);\n },\n timeout(socket) {\n const self = socket.data;\n self.emit(\"timeout\", self);\n },\n binaryType: \"buffer\"\n };\n static #Close(socket) {\n const self = socket.data;\n if (self.#closed)\n return;\n self.#closed = !0, self[bunSocketInternal] = null;\n const queue = self.#readQueue;\n if (queue.isEmpty()) {\n if (self.push(null))\n return;\n }\n queue.push(null);\n }\n static #Drain(socket) {\n const self = socket.data, callback = self.#writeCallback;\n if (callback) {\n const chunk = self.#writeChunk, written = socket.write(chunk);\n if (self.bytesWritten += written, written < chunk.length)\n self.#writeChunk = chunk.slice(written);\n else\n self.#writeCallback = null, self.#writeChunk = null, callback(null);\n }\n }\n static [bunSocketServerHandlers] = {\n data: Socket2.#Handlers.data,\n close(socket) {\n Socket2.#Handlers.close(socket), this.data[bunSocketServerConnections]--;\n },\n end(socket) {\n Socket2.#Handlers.end(socket), this.data[bunSocketServerConnections]--;\n },\n open(socket) {\n const self = this.data, options = self[bunSocketServerOptions], { pauseOnConnect, connectionListener, InternalSocketClass, requestCert, rejectUnauthorized } = options, _socket = new InternalSocketClass({});\n if (_socket.isServer = !0, _socket._requestCert = requestCert, _socket._rejectUnauthorized = rejectUnauthorized, _socket.#attach(this.localPort, socket), self.maxConnections && self[bunSocketServerConnections] >= self.maxConnections) {\n const data = {\n localAddress: _socket.localAddress,\n localPort: _socket.localPort,\n localFamily: _socket.localFamily,\n remoteAddress: _socket.remoteAddress,\n remotePort: _socket.remotePort,\n remoteFamily: _socket.remoteFamily || \"IPv4\"\n };\n socket.end(), self.emit(\"drop\", data);\n return;\n }\n if (!pauseOnConnect)\n _socket.resume();\n if (self[bunSocketServerConnections]++, typeof connectionListener == \"function\")\n if (InternalSocketClass.name === \"TLSSocket\")\n self.once(\"secureConnection\", () => connectionListener(_socket));\n else\n connectionListener(_socket);\n self.emit(\"connection\", _socket);\n },\n handshake(socket, success, verifyError) {\n const { data: self } = socket;\n if (self.emit(\"secure\", self), self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self._requestCert || self._rejectUnauthorized) {\n if (verifyError) {\n if (self.authorized = !1, self.authorizationError = verifyError.code || verifyError.message, self._rejectUnauthorized) {\n self.destroy(verifyError);\n return;\n }\n }\n } else\n self.authorized = !0;\n self.emit(\"secureConnection\", verifyError);\n },\n error(socket, error) {\n Socket2.#Handlers.error(socket, error), this.data.emit(\"error\", error);\n },\n timeout: Socket2.#Handlers.timeout,\n connectError: Socket2.#Handlers.connectError,\n drain: Socket2.#Handlers.drain,\n binaryType: \"buffer\"\n };\n bytesRead = 0;\n bytesWritten = 0;\n #closed = !1;\n connecting = !1;\n localAddress = \"127.0.0.1\";\n #readQueue = @createFIFO();\n remotePort;\n [bunSocketInternal] = null;\n [bunTLSConnectOptions] = null;\n timeout = 0;\n #writeCallback;\n #writeChunk;\n #pendingRead;\n isServer = !1;\n _handle;\n _parent;\n _parentWrap;\n #socket;\n #upgraded;\n constructor(options) {\n const { socket, signal, write, read, allowHalfOpen = !1, ...opts } = options || {};\n super({\n ...opts,\n allowHalfOpen,\n readable: !0,\n writable: !0\n });\n if (this._handle = this, this._parent = this, this._parentWrap = this, this.#pendingRead = void 0, this.#upgraded = !1, socket instanceof Socket2)\n this.#socket = socket;\n signal\?.once(\"abort\", () => this.destroy()), this.once(\"connect\", () => this.emit(\"ready\"));\n }\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n #attach(port, socket) {\n if (this.remotePort = port, socket.data = this, socket.timeout(this.timeout), socket.ref(), this[bunSocketInternal] = socket, this.connecting = !1, !this.#upgraded)\n this.emit(\"connect\", this);\n Socket2.#Drain(socket);\n }\n connect(port, host, connectListener) {\n var path, connection = this.#socket, _checkServerIdentity = void 0;\n if (typeof port === \"string\") {\n if (path = port, port = void 0, typeof host === \"function\")\n connectListener = host, host = void 0;\n } else if (typeof host == \"function\") {\n if (typeof port === \"string\")\n path = port, port = void 0;\n connectListener = host, host = void 0;\n }\n if (typeof port == \"object\") {\n var {\n port,\n host,\n path,\n socket,\n localAddress,\n localPort,\n family,\n hints,\n lookup,\n noDelay,\n keepAlive,\n keepAliveInitialDelay,\n requestCert,\n rejectUnauthorized,\n pauseOnConnect,\n servername,\n checkServerIdentity,\n session\n } = port;\n if (_checkServerIdentity = checkServerIdentity, this.servername = servername, socket)\n connection = socket;\n }\n if (!pauseOnConnect)\n this.resume();\n this.connecting = !0, this.remotePort = port;\n const bunTLS = this[bunTlsSymbol];\n var tls = void 0;\n if (typeof bunTLS === \"function\") {\n if (tls = bunTLS.call(this, port, host, !0), this._requestCert = !0, this._rejectUnauthorized = rejectUnauthorized, tls) {\n if (tls.rejectUnauthorized = rejectUnauthorized, tls.requestCert = !0, tls.session = session || tls.session, this.servername = tls.servername, tls.checkServerIdentity = _checkServerIdentity || tls.checkServerIdentity, this[bunTLSConnectOptions] = tls, !connection && tls.socket)\n connection = tls.socket;\n }\n if (connection) {\n if (typeof connection !== \"object\" || !(connection instanceof Socket2) || typeof connection[bunTlsSymbol] === \"function\")\n @throwTypeError(\"socket must be an instance of net.Socket\");\n }\n if (this.authorized = !1, this.secureConnecting = !0, this._secureEstablished = !1, this._securePending = !0, connectListener)\n this.on(\"secureConnect\", connectListener);\n } else if (connectListener)\n this.on(\"connect\", connectListener);\n if (connection) {\n const socket2 = connection[bunSocketInternal];\n if (socket2) {\n this.connecting = !0, this.#upgraded = !0;\n const result = socket2.upgradeTLS({\n data: this,\n tls,\n socket: Socket2.#Handlers\n });\n if (result) {\n const [raw, tls2] = result;\n connection[bunSocketInternal] = raw, raw.timeout(raw.timeout), raw.connecting = !1, this[bunSocketInternal] = tls2;\n } else\n throw this[bunSocketInternal] = null, new Error(\"Invalid socket\");\n } else\n connection.once(\"connect\", () => {\n const socket3 = connection[bunSocketInternal];\n if (!socket3)\n return;\n this.connecting = !0, this.#upgraded = !0;\n const result = socket3.upgradeTLS({\n data: this,\n tls,\n socket: Socket2.#Handlers\n });\n if (result) {\n const [raw, tls2] = result;\n connection[bunSocketInternal] = raw, raw.timeout(raw.timeout), raw.connecting = !1, this[bunSocketInternal] = tls2;\n } else\n throw this[bunSocketInternal] = null, new Error(\"Invalid socket\");\n });\n } else if (path)\n bunConnect({\n data: this,\n unix: path,\n socket: Socket2.#Handlers,\n tls\n }).catch((error) => {\n this.emit(\"error\", error), this.emit(\"close\");\n });\n else\n bunConnect({\n data: this,\n hostname: host || \"localhost\",\n port,\n socket: Socket2.#Handlers,\n tls\n }).catch((error) => {\n this.emit(\"error\", error), this.emit(\"close\");\n });\n return this;\n }\n _destroy(err, callback) {\n this[bunSocketInternal]\?.end(), callback(err);\n }\n _final(callback) {\n this[bunSocketInternal]\?.end(), callback();\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return this[bunSocketInternal]\?.localPort;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n const queue = this.#readQueue;\n let chunk;\n while (chunk = queue.peek()) {\n if (!this.push(chunk))\n return;\n queue.shift();\n }\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n this[bunSocketInternal]\?.ref();\n }\n get remoteAddress() {\n return this[bunSocketInternal]\?.remoteAddress;\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n this[bunSocketInternal]\?.end();\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n return this;\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n if (this[bunSocketInternal]\?.timeout(timeout), this.timeout = timeout, callback)\n this.once(\"timeout\", callback);\n return this;\n }\n unref() {\n this[bunSocketInternal]\?.unref();\n }\n _write(chunk, encoding, callback) {\n if (typeof chunk == \"string\" && encoding !== \"ascii\")\n chunk = Buffer.from(chunk, encoding);\n var written = this[bunSocketInternal]\?.write(chunk);\n if (written == chunk.length)\n callback();\n else if (this.#writeCallback)\n callback(new Error(\"overlapping _write()\"));\n else {\n if (written > 0)\n if (typeof chunk == \"string\")\n chunk = chunk.slice(written);\n else\n chunk = chunk.subarray(written);\n this.#writeCallback = callback, this.#writeChunk = chunk;\n }\n }\n}), connect = createConnection;\n\nclass Server extends EventEmitter {\n #server;\n #listening = !1;\n [bunSocketServerConnections] = 0;\n [bunSocketServerOptions];\n maxConnections = 0;\n constructor(options, connectionListener) {\n super();\n if (typeof options === \"function\")\n connectionListener = options, options = {};\n else if (options == null || typeof options === \"object\")\n options = { ...options };\n else\n throw new Error(\"bun-net-polyfill: invalid arguments\");\n const { maxConnections } = options;\n this.maxConnections = Number.isSafeInteger(maxConnections) && maxConnections > 0 \? maxConnections : 0, options.connectionListener = connectionListener, this[bunSocketServerOptions] = options;\n }\n ref() {\n return this.#server\?.ref(), this;\n }\n unref() {\n return this.#server\?.unref(), this;\n }\n close(callback) {\n if (this.#server) {\n if (this.#server.stop(!0), this.#server = null, this.#listening = !1, this[bunSocketServerConnections] = 0, this.emit(\"close\"), typeof callback === \"function\")\n callback();\n return this;\n }\n if (typeof callback === \"function\") {\n const error = new Error(\"Server is not running\");\n error.code = \"ERR_SERVER_NOT_RUNNING\", callback(error);\n }\n return this;\n }\n address() {\n const server = this.#server;\n if (server) {\n const unix = server.unix;\n if (unix)\n return unix;\n let address = server.hostname;\n const type = isIP(address), port = server.port;\n if (typeof port === \"number\")\n return {\n port,\n address,\n family: type \? `IPv${type}` : void 0\n };\n if (type)\n return {\n address,\n family: type \? `IPv${type}` : void 0\n };\n return address;\n }\n return null;\n }\n getConnections(callback) {\n if (typeof callback === \"function\")\n callback(null, this.#server \? this[bunSocketServerConnections] : 0);\n return this;\n }\n listen(port, hostname, onListen) {\n let backlog, path, exclusive = !1;\n if (typeof port === \"string\") {\n if (Number.isSafeInteger(hostname)) {\n if (hostname > 0)\n backlog = hostname;\n } else if (typeof hostname === \"function\")\n onListen = hostname;\n path = port, hostname = void 0, port = void 0;\n } else {\n if (typeof hostname === \"function\")\n onListen = hostname, hostname = void 0;\n if (typeof port === \"function\")\n onListen = port, port = 0;\n else if (typeof port === \"object\") {\n const options = port;\n options.signal\?.addEventListener(\"abort\", () => this.close()), hostname = options.host, exclusive = options.exclusive === !0;\n const path2 = options.path;\n if (port = options.port, !Number.isSafeInteger(port) || port < 0)\n if (path2)\n hostname = path2, port = void 0;\n else {\n let message = 'The argument \\'options\\' must have the property \"port\" or \"path\"';\n try {\n message = `${message}. Received ${JSON.stringify(options)}`;\n } catch {\n }\n const error = @makeTypeError(message);\n throw error.code = \"ERR_INVALID_ARG_VALUE\", error;\n }\n else if (!Number.isSafeInteger(port) || port < 0)\n port = 0;\n if (typeof port.callback === \"function\")\n onListen = port\?.callback;\n } else if (!Number.isSafeInteger(port) || port < 0)\n port = 0;\n hostname = hostname || \"::\";\n }\n try {\n var tls = void 0, TLSSocketClass = void 0;\n const bunTLS = this[bunTlsSymbol], options = this[bunSocketServerOptions];\n if (typeof bunTLS === \"function\")\n [tls, TLSSocketClass] = bunTLS.call(this, port, hostname, !1), options.servername = tls.serverName, options.InternalSocketClass = TLSSocketClass;\n else\n options.InternalSocketClass = SocketClass;\n this.#server = Bun.listen(path \? {\n exclusive,\n unix: path,\n tls,\n socket: SocketClass[bunSocketServerHandlers]\n } : {\n exclusive,\n port,\n hostname,\n tls,\n socket: SocketClass[bunSocketServerHandlers]\n }), this.#server.data = this, this.#listening = !0, setTimeout(emitListeningNextTick, 1, this, onListen);\n } catch (err) {\n this.#listening = !1, setTimeout(emitErrorNextTick, 1, this, err);\n }\n return this;\n }\n}\n$ = {\n createServer,\n Server,\n createConnection,\n connect,\n isIP,\n isIPv4,\n isIPv6,\n Socket,\n [Symbol.for(\"::bunternal::\")]: SocketClass\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeNetCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/net.ts\nvar isIPv4 = function(s) {\n return IPv4Reg.test(s);\n}, isIPv6 = function(s) {\n return IPv6Reg.test(s);\n}, isIP = function(s) {\n if (isIPv4(s))\n return 4;\n if (isIPv6(s))\n return 6;\n return 0;\n}, closeNT = function(self) {\n self.emit(\"close\");\n}, endNT = function(socket, callback, err) {\n socket.end(), callback(err);\n}, createConnection = function(port, host, connectListener) {\n if (typeof port === \"object\")\n return new Socket(port).connect(port, host, connectListener);\n return new Socket().connect(port, host, connectListener);\n}, emitErrorNextTick = function(self, error) {\n self.emit(\"error\", error);\n}, emitErrorAndCloseNextTick = function(self, error) {\n self.emit(\"error\", error), self.emit(\"close\");\n}, emitListeningNextTick = function(self, onListen) {\n if (typeof onListen === \"function\")\n try {\n onListen();\n } catch (err) {\n self.emit(\"error\", err);\n }\n self.emit(\"listening\");\n}, createServer = function(options, connectionListener) {\n return new Server(options, connectionListener);\n}, $, { Duplex } = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20);\nvar IPv4Reg = new @RegExp(\"^((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$\");\nvar IPv6Reg = new @RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\"), { connect: bunConnect } = Bun, { setTimeout } = globalThis, bunTlsSymbol = Symbol.for(\"::buntls::\"), bunSocketServerHandlers = Symbol.for(\"::bunsocket_serverhandlers::\"), bunSocketServerConnections = Symbol.for(\"::bunnetserverconnections::\"), bunSocketServerOptions = Symbol.for(\"::bunnetserveroptions::\"), bunSocketInternal = Symbol.for(\"::bunnetsocketinternal::\"), bunTLSConnectOptions = Symbol.for(\"::buntlsconnectoptions::\"), SocketClass, Socket = function(InternalSocket) {\n SocketClass = InternalSocket, Object.defineProperty(SocketClass.prototype, Symbol.toStringTag, {\n value: \"Socket\",\n enumerable: !1\n });\n function Socket3(options) {\n return new InternalSocket(options);\n }\n return Socket3.prototype = InternalSocket.prototype, Object.defineProperty(Socket3, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalSocket;\n }\n });\n}(class Socket2 extends Duplex {\n static #Handlers = {\n close: Socket2.#Close,\n data({ data: self }, buffer) {\n self.bytesRead += buffer.length;\n const queue = self.#readQueue;\n if (queue.isEmpty()) {\n if (self.push(buffer))\n return;\n }\n queue.push(buffer);\n },\n drain: Socket2.#Drain,\n end: Socket2.#Close,\n error(socket, error) {\n const self = socket.data, callback = self.#writeCallback;\n if (callback)\n self.#writeCallback = null, callback(error);\n self.emit(\"error\", error);\n },\n open(socket) {\n const self = socket.data;\n socket.timeout(self.timeout), socket.ref(), self[bunSocketInternal] = socket, self.connecting = !1;\n const options = self[bunTLSConnectOptions];\n if (options) {\n const { session } = options;\n if (session)\n self.setSession(session);\n }\n if (!self.#upgraded)\n self.emit(\"connect\", self);\n Socket2.#Drain(socket);\n },\n handshake(socket, success, verifyError) {\n const { data: self } = socket;\n self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self.emit(\"secure\", self);\n const { checkServerIdentity } = self[bunTLSConnectOptions];\n if (!verifyError && typeof checkServerIdentity === \"function\" && self.servername) {\n const cert = self.getPeerCertificate(!0);\n verifyError = checkServerIdentity(self.servername, cert);\n }\n if (self._requestCert || self._rejectUnauthorized) {\n if (verifyError) {\n if (self.authorized = !1, self.authorizationError = verifyError.code || verifyError.message, self._rejectUnauthorized) {\n self.destroy(verifyError);\n return;\n }\n }\n } else\n self.authorized = !0;\n self.emit(\"secureConnect\", verifyError);\n },\n timeout(socket) {\n const self = socket.data;\n self.emit(\"timeout\", self);\n },\n binaryType: \"buffer\"\n };\n static #Close(socket) {\n const self = socket.data;\n if (self.#closed)\n return;\n self.#closed = !0, self[bunSocketInternal] = null;\n const queue = self.#readQueue;\n if (queue.isEmpty()) {\n if (self.push(null))\n return;\n }\n queue.push(null);\n }\n static #Drain(socket) {\n const self = socket.data, callback = self.#writeCallback;\n if (callback) {\n const chunk = self.#writeChunk, written = socket.write(chunk);\n if (self.bytesWritten += written, written < chunk.length)\n self.#writeChunk = chunk.slice(written);\n else\n self.#writeCallback = null, self.#writeChunk = null, callback(null);\n }\n }\n static [bunSocketServerHandlers] = {\n data: Socket2.#Handlers.data,\n close(socket) {\n Socket2.#Handlers.close(socket), this.data[bunSocketServerConnections]--;\n },\n end(socket) {\n Socket2.#Handlers.end(socket), this.data[bunSocketServerConnections]--;\n },\n open(socket) {\n const self = this.data, options = self[bunSocketServerOptions], { pauseOnConnect, connectionListener, InternalSocketClass, requestCert, rejectUnauthorized } = options, _socket = new InternalSocketClass({});\n if (_socket.isServer = !0, _socket._requestCert = requestCert, _socket._rejectUnauthorized = rejectUnauthorized, _socket.#attach(this.localPort, socket), self.maxConnections && self[bunSocketServerConnections] >= self.maxConnections) {\n const data = {\n localAddress: _socket.localAddress,\n localPort: _socket.localPort,\n localFamily: _socket.localFamily,\n remoteAddress: _socket.remoteAddress,\n remotePort: _socket.remotePort,\n remoteFamily: _socket.remoteFamily || \"IPv4\"\n };\n socket.end(), self.emit(\"drop\", data);\n return;\n }\n if (!pauseOnConnect)\n _socket.resume();\n if (self[bunSocketServerConnections]++, typeof connectionListener == \"function\")\n if (InternalSocketClass.name === \"TLSSocket\")\n self.once(\"secureConnection\", () => connectionListener(_socket));\n else\n connectionListener(_socket);\n self.emit(\"connection\", _socket);\n },\n handshake(socket, success, verifyError) {\n const { data: self } = socket;\n if (self.emit(\"secure\", self), self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self._requestCert || self._rejectUnauthorized) {\n if (verifyError) {\n if (self.authorized = !1, self.authorizationError = verifyError.code || verifyError.message, self._rejectUnauthorized) {\n self.destroy(verifyError);\n return;\n }\n }\n } else\n self.authorized = !0;\n self.emit(\"secureConnection\", verifyError);\n },\n error(socket, error) {\n Socket2.#Handlers.error(socket, error), this.data.emit(\"error\", error);\n },\n timeout: Socket2.#Handlers.timeout,\n connectError: Socket2.#Handlers.connectError,\n drain: Socket2.#Handlers.drain,\n binaryType: \"buffer\"\n };\n bytesRead = 0;\n bytesWritten = 0;\n #closed = !1;\n connecting = !1;\n localAddress = \"127.0.0.1\";\n #readQueue = @createFIFO();\n remotePort;\n [bunSocketInternal] = null;\n [bunTLSConnectOptions] = null;\n timeout = 0;\n #writeCallback;\n #writeChunk;\n #pendingRead;\n isServer = !1;\n _handle;\n _parent;\n _parentWrap;\n #socket;\n #upgraded;\n constructor(options) {\n const { socket, signal, write, read, allowHalfOpen = !1, ...opts } = options || {};\n super({\n ...opts,\n allowHalfOpen,\n readable: !0,\n writable: !0\n });\n if (this._handle = this, this._parent = this, this._parentWrap = this, this.#pendingRead = @undefined, this.#upgraded = null, socket instanceof Socket2)\n this.#socket = socket;\n signal\?.once(\"abort\", () => this.destroy()), this.once(\"connect\", () => this.emit(\"ready\"));\n }\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n #attach(port, socket) {\n if (this.remotePort = port, socket.data = this, socket.timeout(this.timeout), socket.ref(), this[bunSocketInternal] = socket, this.connecting = !1, !this.#upgraded)\n this.emit(\"connect\", this);\n Socket2.#Drain(socket);\n }\n #closeRawConnection() {\n const connection = this.#upgraded;\n connection[bunSocketInternal] = null, connection.unref(), connection.destroy(), process.nextTick(closeNT, connection);\n }\n connect(port, host, connectListener) {\n var path, connection = this.#socket, _checkServerIdentity = @undefined;\n if (typeof port === \"string\") {\n if (path = port, port = @undefined, typeof host === \"function\")\n connectListener = host, host = @undefined;\n } else if (typeof host == \"function\") {\n if (typeof port === \"string\")\n path = port, port = @undefined;\n connectListener = host, host = @undefined;\n }\n if (typeof port == \"object\") {\n var {\n port,\n host,\n path,\n socket,\n localAddress,\n localPort,\n family,\n hints,\n lookup,\n noDelay,\n keepAlive,\n keepAliveInitialDelay,\n requestCert,\n rejectUnauthorized,\n pauseOnConnect,\n servername,\n checkServerIdentity,\n session\n } = port;\n if (_checkServerIdentity = checkServerIdentity, this.servername = servername, socket)\n connection = socket;\n }\n if (!pauseOnConnect)\n this.resume();\n this.connecting = !0, this.remotePort = port;\n const bunTLS = this[bunTlsSymbol];\n var tls = @undefined;\n if (typeof bunTLS === \"function\") {\n if (tls = bunTLS.@call(this, port, host, !0), this._requestCert = !0, this._rejectUnauthorized = rejectUnauthorized, tls) {\n if (tls.rejectUnauthorized = rejectUnauthorized, tls.requestCert = !0, tls.session = session || tls.session, this.servername = tls.servername, tls.checkServerIdentity = _checkServerIdentity || tls.checkServerIdentity, this[bunTLSConnectOptions] = tls, !connection && tls.socket)\n connection = tls.socket;\n }\n if (connection) {\n if (typeof connection !== \"object\" || !(connection instanceof Socket2) || typeof connection[bunTlsSymbol] === \"function\")\n @throwTypeError(\"socket must be an instance of net.Socket\");\n }\n if (this.authorized = !1, this.secureConnecting = !0, this._secureEstablished = !1, this._securePending = !0, connectListener)\n this.on(\"secureConnect\", connectListener);\n } else if (connectListener)\n this.on(\"connect\", connectListener);\n try {\n if (connection) {\n const socket2 = connection[bunSocketInternal];\n if (socket2) {\n this.connecting = !0, this.#upgraded = connection;\n const result = socket2.upgradeTLS({\n data: this,\n tls,\n socket: Socket2.#Handlers\n });\n if (result) {\n const [raw, tls2] = result;\n connection[bunSocketInternal] = raw, raw.timeout(raw.timeout), this.once(\"end\", this.#closeRawConnection), raw.connecting = !1, this[bunSocketInternal] = tls2;\n } else\n throw this[bunSocketInternal] = null, new Error(\"Invalid socket\");\n } else\n connection.once(\"connect\", () => {\n const socket3 = connection[bunSocketInternal];\n if (!socket3)\n return;\n this.connecting = !0, this.#upgraded = connection;\n const result = socket3.upgradeTLS({\n data: this,\n tls,\n socket: Socket2.#Handlers\n });\n if (result) {\n const [raw, tls2] = result;\n connection[bunSocketInternal] = raw, raw.timeout(raw.timeout), this.once(\"end\", this.#closeRawConnection), raw.connecting = !1, this[bunSocketInternal] = tls2;\n } else\n throw this[bunSocketInternal] = null, new Error(\"Invalid socket\");\n });\n } else if (path)\n bunConnect({\n data: this,\n unix: path,\n socket: Socket2.#Handlers,\n tls\n }).catch((error) => {\n this.emit(\"error\", error), this.emit(\"close\");\n });\n else\n bunConnect({\n data: this,\n hostname: host || \"localhost\",\n port,\n socket: Socket2.#Handlers,\n tls\n }).catch((error) => {\n this.emit(\"error\", error), this.emit(\"close\");\n });\n } catch (error) {\n process.nextTick(emitErrorAndCloseNextTick, this, error);\n }\n return this;\n }\n _destroy(err, callback) {\n const socket = this[bunSocketInternal];\n socket && process.nextTick(endNT, socket, callback, err);\n }\n _final(callback) {\n this[bunSocketInternal]\?.end(), callback(), process.nextTick(closeNT, this);\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return this[bunSocketInternal]\?.localPort;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n const queue = this.#readQueue;\n let chunk;\n while (chunk = queue.peek()) {\n const can_continue = !this.push(chunk);\n if (queue.shift(), !can_continue)\n break;\n }\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n this[bunSocketInternal]\?.ref();\n }\n get remoteAddress() {\n return this[bunSocketInternal]\?.remoteAddress;\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n this[bunSocketInternal]\?.end();\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n return this;\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n if (this[bunSocketInternal]\?.timeout(timeout), this.timeout = timeout, callback)\n this.once(\"timeout\", callback);\n return this;\n }\n unref() {\n this[bunSocketInternal]\?.unref();\n }\n _write(chunk, encoding, callback) {\n if (typeof chunk == \"string\" && encoding !== \"ascii\")\n chunk = @Buffer.from(chunk, encoding);\n var written = this[bunSocketInternal]\?.write(chunk);\n if (written == chunk.length)\n callback();\n else if (this.#writeCallback)\n callback(new Error(\"overlapping _write()\"));\n else {\n if (written > 0)\n if (typeof chunk == \"string\")\n chunk = chunk.slice(written);\n else\n chunk = chunk.subarray(written);\n this.#writeCallback = callback, this.#writeChunk = chunk;\n }\n }\n}), connect = createConnection;\n\nclass Server extends EventEmitter {\n #server;\n #listening = !1;\n [bunSocketServerConnections] = 0;\n [bunSocketServerOptions];\n maxConnections = 0;\n constructor(options, connectionListener) {\n super();\n if (typeof options === \"function\")\n connectionListener = options, options = {};\n else if (options == null || typeof options === \"object\")\n options = { ...options };\n else\n throw new Error(\"bun-net-polyfill: invalid arguments\");\n const { maxConnections } = options;\n this.maxConnections = Number.isSafeInteger(maxConnections) && maxConnections > 0 \? maxConnections : 0, options.connectionListener = connectionListener, this[bunSocketServerOptions] = options;\n }\n ref() {\n return this.#server\?.ref(), this;\n }\n unref() {\n return this.#server\?.unref(), this;\n }\n close(callback) {\n if (this.#server) {\n if (this.#server.stop(!0), this.#server = null, this.#listening = !1, this[bunSocketServerConnections] = 0, this.emit(\"close\"), typeof callback === \"function\")\n callback();\n return this;\n }\n if (typeof callback === \"function\") {\n const error = new Error(\"Server is not running\");\n error.code = \"ERR_SERVER_NOT_RUNNING\", callback(error);\n }\n return this;\n }\n address() {\n const server = this.#server;\n if (server) {\n const unix = server.unix;\n if (unix)\n return unix;\n let address = server.hostname;\n const type = isIP(address), port = server.port;\n if (typeof port === \"number\")\n return {\n port,\n address,\n family: type \? `IPv${type}` : @undefined\n };\n if (type)\n return {\n address,\n family: type \? `IPv${type}` : @undefined\n };\n return address;\n }\n return null;\n }\n getConnections(callback) {\n if (typeof callback === \"function\")\n callback(null, this.#server \? this[bunSocketServerConnections] : 0);\n return this;\n }\n listen(port, hostname, onListen) {\n let backlog, path, exclusive = !1;\n if (typeof port === \"string\") {\n if (Number.isSafeInteger(hostname)) {\n if (hostname > 0)\n backlog = hostname;\n } else if (typeof hostname === \"function\")\n onListen = hostname;\n path = port, hostname = @undefined, port = @undefined;\n } else {\n if (typeof hostname === \"function\")\n onListen = hostname, hostname = @undefined;\n if (typeof port === \"function\")\n onListen = port, port = 0;\n else if (typeof port === \"object\") {\n const options = port;\n options.signal\?.addEventListener(\"abort\", () => this.close()), hostname = options.host, exclusive = options.exclusive === !0;\n const path2 = options.path;\n if (port = options.port, !Number.isSafeInteger(port) || port < 0)\n if (path2)\n hostname = path2, port = @undefined;\n else {\n let message = 'The argument \\'options\\' must have the property \"port\" or \"path\"';\n try {\n message = `${message}. Received ${JSON.stringify(options)}`;\n } catch {\n }\n const error = @makeTypeError(message);\n throw error.code = \"ERR_INVALID_ARG_VALUE\", error;\n }\n else if (!Number.isSafeInteger(port) || port < 0)\n port = 0;\n if (typeof port.callback === \"function\")\n onListen = port\?.callback;\n } else if (!Number.isSafeInteger(port) || port < 0)\n port = 0;\n hostname = hostname || \"::\";\n }\n try {\n var tls = @undefined, TLSSocketClass = @undefined;\n const bunTLS = this[bunTlsSymbol], options = this[bunSocketServerOptions];\n if (typeof bunTLS === \"function\")\n [tls, TLSSocketClass] = bunTLS.@call(this, port, hostname, !1), options.servername = tls.serverName, options.InternalSocketClass = TLSSocketClass;\n else\n options.InternalSocketClass = SocketClass;\n this.#server = Bun.listen(path \? {\n exclusive,\n unix: path,\n tls,\n socket: SocketClass[bunSocketServerHandlers]\n } : {\n exclusive,\n port,\n hostname,\n tls,\n socket: SocketClass[bunSocketServerHandlers]\n }), this.#server.data = this, this.#listening = !0, setTimeout(emitListeningNextTick, 1, this, onListen);\n } catch (err) {\n this.#listening = !1, setTimeout(emitErrorNextTick, 1, this, err);\n }\n return this;\n }\n}\n$ = {\n createServer,\n Server,\n createConnection,\n connect,\n isIP,\n isIPv4,\n isIPv6,\n Socket,\n [Symbol.for(\"::bunternal::\")]: SocketClass\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeOSCode = "(function (){\"use strict\";// src/js/out/tmp/node/os.ts\nvar lazyCpus = function({ cpus }) {\n return () => {\n const array = new Array(navigator.hardwareConcurrency);\n function populate() {\n const results = cpus(), length = results.length;\n array.length = length;\n for (let i = 0;i < length; i++)\n array[i] = results[i];\n }\n for (let i = 0;i < array.length; i++) {\n const instance = {\n get model() {\n if (array[i] === instance)\n populate();\n return array[i].model;\n },\n set model(value) {\n if (array[i] === instance)\n populate();\n array[i].model = value;\n },\n get speed() {\n if (array[i] === instance)\n populate();\n return array[i].speed;\n },\n set speed(value) {\n if (array[i] === instance)\n populate();\n array[i].speed = value;\n },\n get times() {\n if (array[i] === instance)\n populate();\n return array[i].times;\n },\n set times(value) {\n if (array[i] === instance)\n populate();\n array[i].times = value;\n },\n toJSON() {\n if (array[i] === instance)\n populate();\n return array[i];\n }\n };\n array[i] = instance;\n }\n return array;\n };\n}, bound = function(obj) {\n return {\n arch: obj.arch.bind(obj),\n cpus: lazyCpus(obj),\n endianness: obj.endianness.bind(obj),\n freemem: obj.freemem.bind(obj),\n getPriority: obj.getPriority.bind(obj),\n homedir: obj.homedir.bind(obj),\n hostname: obj.hostname.bind(obj),\n loadavg: obj.loadavg.bind(obj),\n networkInterfaces: obj.networkInterfaces.bind(obj),\n platform: obj.platform.bind(obj),\n release: obj.release.bind(obj),\n setPriority: obj.setPriority.bind(obj),\n get tmpdir() {\n return tmpdir;\n },\n totalmem: obj.totalmem.bind(obj),\n type: obj.type.bind(obj),\n uptime: obj.uptime.bind(obj),\n userInfo: obj.userInfo.bind(obj),\n version: obj.version.bind(obj),\n machine: obj.machine.bind(obj),\n devNull: obj.devNull,\n EOL: obj.EOL,\n constants: @processBindingConstants.os\n };\n}, tmpdir = function() {\n var env = Bun.env;\n return tmpdir = function() {\n var path = env.TMPDIR || env.TMP || env.TEMP || \"/tmp\";\n const length = path.length;\n if (length > 1 && path[length - 1] === \"/\")\n path = path.slice(0, -1);\n return path;\n }, tmpdir();\n};\nreturn bound(Bun._Os())})\n"_s;
+static constexpr ASCIILiteral NodeOSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/os.ts\nvar lazyCpus = function({ cpus }) {\n return () => {\n const array = new @Array(navigator.hardwareConcurrency);\n function populate() {\n const results = cpus(), length = results.length;\n array.length = length;\n for (let i = 0;i < length; i++)\n array[i] = results[i];\n }\n for (let i = 0;i < array.length; i++) {\n const instance = {\n get model() {\n if (array[i] === instance)\n populate();\n return array[i].model;\n },\n set model(value) {\n if (array[i] === instance)\n populate();\n array[i].model = value;\n },\n get speed() {\n if (array[i] === instance)\n populate();\n return array[i].speed;\n },\n set speed(value) {\n if (array[i] === instance)\n populate();\n array[i].speed = value;\n },\n get times() {\n if (array[i] === instance)\n populate();\n return array[i].times;\n },\n set times(value) {\n if (array[i] === instance)\n populate();\n array[i].times = value;\n },\n toJSON() {\n if (array[i] === instance)\n populate();\n return array[i];\n }\n };\n array[i] = instance;\n }\n return array;\n };\n}, bound = function(obj) {\n return {\n availableParallelism: () => {\n return navigator.hardwareConcurrency;\n },\n arch: obj.arch.bind(obj),\n cpus: lazyCpus(obj),\n endianness: obj.endianness.bind(obj),\n freemem: obj.freemem.bind(obj),\n getPriority: obj.getPriority.bind(obj),\n homedir: obj.homedir.bind(obj),\n hostname: obj.hostname.bind(obj),\n loadavg: obj.loadavg.bind(obj),\n networkInterfaces: obj.networkInterfaces.bind(obj),\n platform: obj.platform.bind(obj),\n release: obj.release.bind(obj),\n setPriority: obj.setPriority.bind(obj),\n get tmpdir() {\n return tmpdir;\n },\n totalmem: obj.totalmem.bind(obj),\n type: obj.type.bind(obj),\n uptime: obj.uptime.bind(obj),\n userInfo: obj.userInfo.bind(obj),\n version: obj.version.bind(obj),\n machine: obj.machine.bind(obj),\n devNull: obj.devNull,\n EOL: obj.EOL,\n constants: @processBindingConstants.os\n };\n}, tmpdir = function() {\n var env = Bun.env;\n return tmpdir = function() {\n var path = env.TMPDIR || env.TMP || env.TEMP || \"/tmp\";\n const length = path.length;\n if (length > 1 && path[length - 1] === \"/\")\n path = path.slice(0, -1);\n return path;\n }, tmpdir();\n};\nreturn bound(Bun._Os())})\n");
//
//
-static constexpr ASCIILiteral NodePathPosixCode = "(function (){\"use strict\";// src/js/out/tmp/node/path.posix.ts\nreturn (@getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28)).posix})\n"_s;
+static constexpr ASCIILiteral NodePathPosixCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/path.posix.ts\nreturn (@getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30)).posix})\n");
//
//
-static constexpr ASCIILiteral NodePathCode = "(function (){\"use strict\";// src/js/out/tmp/node/path.ts\nvar bound = function(obj) {\n const toNamespacedPath = obj.toNamespacedPath.bind(obj);\n return {\n resolve: obj.resolve.bind(obj),\n normalize: obj.normalize.bind(obj),\n isAbsolute: obj.isAbsolute.bind(obj),\n join: obj.join.bind(obj),\n relative: obj.relative.bind(obj),\n toNamespacedPath,\n dirname: obj.dirname.bind(obj),\n basename: obj.basename.bind(obj),\n extname: obj.extname.bind(obj),\n format: obj.format.bind(obj),\n parse: obj.parse.bind(obj),\n sep: obj.sep,\n delimiter: obj.delimiter,\n win32: void 0,\n posix: void 0,\n _makeLong: toNamespacedPath\n };\n}, posix = bound(Bun._Path(!1)), win32 = bound(Bun._Path(!0));\nposix.win32 = win32.win32 = win32;\nposix.posix = win32.posix = posix;\nreturn posix})\n"_s;
+static constexpr ASCIILiteral NodePathCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/path.ts\nvar bound = function(obj) {\n const toNamespacedPath = obj.toNamespacedPath.bind(obj);\n return {\n resolve: obj.resolve.bind(obj),\n normalize: obj.normalize.bind(obj),\n isAbsolute: obj.isAbsolute.bind(obj),\n join: obj.join.bind(obj),\n relative: obj.relative.bind(obj),\n toNamespacedPath,\n dirname: obj.dirname.bind(obj),\n basename: obj.basename.bind(obj),\n extname: obj.extname.bind(obj),\n format: obj.format.bind(obj),\n parse: obj.parse.bind(obj),\n sep: obj.sep,\n delimiter: obj.delimiter,\n win32: @undefined,\n posix: @undefined,\n _makeLong: toNamespacedPath\n };\n}, posix = bound(Bun._Path(!1)), win32 = bound(Bun._Path(!0));\nposix.win32 = win32.win32 = win32;\nposix.posix = win32.posix = posix;\nreturn posix})\n");
//
//
-static constexpr ASCIILiteral NodePathWin32Code = "(function (){\"use strict\";// src/js/out/tmp/node/path.win32.ts\nreturn (@getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28)).win32})\n"_s;
+static constexpr ASCIILiteral NodePathWin32Code = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/path.win32.ts\nreturn (@getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30)).win32})\n");
//
//
-static constexpr ASCIILiteral NodePerfHooksCode = "(function (){\"use strict\";// src/js/out/tmp/node/perf_hooks.ts\nvar $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), constants = {\n NODE_PERFORMANCE_GC_MAJOR: 4,\n NODE_PERFORMANCE_GC_MINOR: 1,\n NODE_PERFORMANCE_GC_INCREMENTAL: 8,\n NODE_PERFORMANCE_GC_WEAKCB: 16,\n NODE_PERFORMANCE_GC_FLAGS_NO: 0,\n NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: 2,\n NODE_PERFORMANCE_GC_FLAGS_FORCED: 4,\n NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: 8,\n NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: 16,\n NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: 32,\n NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: 64\n}, performance = globalThis.performance;\n\nclass PerformanceObserver {\n constructor() {\n throwNotImplemented(\"PerformanceObserver\");\n }\n}\n\nclass PerformanceEntry {\n constructor() {\n throwNotImplemented(\"PerformanceEntry\");\n }\n}\n$ = {\n performance,\n constants,\n PerformanceEntry,\n PerformanceObserver\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodePerfHooksCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/perf_hooks.ts\nvar $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), constants = {\n NODE_PERFORMANCE_GC_MAJOR: 4,\n NODE_PERFORMANCE_GC_MINOR: 1,\n NODE_PERFORMANCE_GC_INCREMENTAL: 8,\n NODE_PERFORMANCE_GC_WEAKCB: 16,\n NODE_PERFORMANCE_GC_FLAGS_NO: 0,\n NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: 2,\n NODE_PERFORMANCE_GC_FLAGS_FORCED: 4,\n NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: 8,\n NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: 16,\n NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: 32,\n NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: 64\n}, performance = globalThis.performance;\n\nclass PerformanceObserver {\n constructor() {\n throwNotImplemented(\"PerformanceObserver\");\n }\n}\n\nclass PerformanceEntry {\n constructor() {\n throwNotImplemented(\"PerformanceEntry\");\n }\n}\n$ = {\n performance,\n constants,\n PerformanceEntry,\n PerformanceObserver\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodePunycodeCode = "(function (){\"use strict\";// src/js/out/tmp/node/punycode.ts\nvar error = function(type) {\n @throwRangeError(errors[type]);\n}, map = function(array, callback) {\n const result = [];\n let length = array.length;\n while (length--)\n result[length] = callback(array[length]);\n return result;\n}, mapDomain = function(domain, callback) {\n const parts = domain.split(\"@\");\n let result = \"\";\n if (parts.length > 1)\n result = parts[0] + \"@\", domain = parts[1];\n domain = domain.replace(regexSeparators, \".\");\n const labels = domain.split(\".\"), encoded = map(labels, callback).join(\".\");\n return result + encoded;\n}, ucs2decode = function(string) {\n const output = [];\n let counter = 0;\n const length = string.length;\n while (counter < length) {\n const value = string.charCodeAt(counter++);\n if (value >= 55296 && value <= 56319 && counter < length) {\n const extra = string.charCodeAt(counter++);\n if ((extra & 64512) == 56320)\n output.push(((value & 1023) << 10) + (extra & 1023) + 65536);\n else\n output.push(value), counter--;\n } else\n output.push(value);\n }\n return output;\n}, $, maxInt = 2147483647, base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, delimiter = \"-\", regexPunycode = /^xn--/, regexNonASCII = /[^\\0-\\x7F]/, regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, errors = {\n overflow: \"Overflow: input needs wider integers to process\",\n \"not-basic\": \"Illegal input >= 0x80 (not a basic code point)\",\n \"invalid-input\": \"Invalid input\"\n}, baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, ucs2encode = (codePoints) => String.fromCodePoint(...codePoints), basicToDigit = function(codePoint) {\n if (codePoint >= 48 && codePoint < 58)\n return 26 + (codePoint - 48);\n if (codePoint >= 65 && codePoint < 91)\n return codePoint - 65;\n if (codePoint >= 97 && codePoint < 123)\n return codePoint - 97;\n return base;\n}, digitToBasic = function(digit, flag) {\n return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n}, adapt = function(delta, numPoints, firstTime) {\n let k = 0;\n delta = firstTime \? floor(delta / damp) : delta >> 1, delta += floor(delta / numPoints);\n for (;delta > baseMinusTMin * tMax >> 1; k += base)\n delta = floor(delta / baseMinusTMin);\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n}, decode = function(input) {\n const output = [], inputLength = input.length;\n let i = 0, n = initialN, bias = initialBias, basic = input.lastIndexOf(delimiter);\n if (basic < 0)\n basic = 0;\n for (let j = 0;j < basic; ++j) {\n if (input.charCodeAt(j) >= 128)\n error(\"not-basic\");\n output.push(input.charCodeAt(j));\n }\n for (let index = basic > 0 \? basic + 1 : 0;index < inputLength; ) {\n const oldi = i;\n for (let w = 1, k = base;; k += base) {\n if (index >= inputLength)\n error(\"invalid-input\");\n const digit = basicToDigit(input.charCodeAt(index++));\n if (digit >= base)\n error(\"invalid-input\");\n if (digit > floor((maxInt - i) / w))\n error(\"overflow\");\n i += digit * w;\n const t = k <= bias \? tMin : k >= bias + tMax \? tMax : k - bias;\n if (digit < t)\n break;\n const baseMinusT = base - t;\n if (w > floor(maxInt / baseMinusT))\n error(\"overflow\");\n w *= baseMinusT;\n }\n const out = output.length + 1;\n if (bias = adapt(i - oldi, out, oldi == 0), floor(i / out) > maxInt - n)\n error(\"overflow\");\n n += floor(i / out), i %= out, output.splice(i++, 0, n);\n }\n return String.fromCodePoint(...output);\n}, encode = function(input) {\n const output = [];\n input = ucs2decode(input);\n const inputLength = input.length;\n let n = initialN, delta = 0, bias = initialBias;\n for (let currentValue of input)\n if (currentValue < 128)\n output.push(stringFromCharCode(currentValue));\n const basicLength = output.length;\n let handledCPCount = basicLength;\n if (basicLength)\n output.push(delimiter);\n while (handledCPCount < inputLength) {\n let m = maxInt;\n for (let currentValue of input)\n if (currentValue >= n && currentValue < m)\n m = currentValue;\n const handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne))\n error(\"overflow\");\n delta += (m - n) * handledCPCountPlusOne, n = m;\n for (let currentValue of input) {\n if (currentValue < n && ++delta > maxInt)\n error(\"overflow\");\n if (currentValue === n) {\n let q = delta;\n for (let k = base;; k += base) {\n const t = k <= bias \? tMin : k >= bias + tMax \? tMax : k - bias;\n if (q < t)\n break;\n const qMinusT = q - t, baseMinusT = base - t;\n output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))), q = floor(qMinusT / baseMinusT);\n }\n output.push(stringFromCharCode(digitToBasic(q, 0))), bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength), delta = 0, ++handledCPCount;\n }\n }\n ++delta, ++n;\n }\n return output.join(\"\");\n}, toUnicode = function(input) {\n return mapDomain(input, function(string) {\n return regexPunycode.test(string) \? decode(string.slice(4).toLowerCase()) : string;\n });\n}, toASCII = function(input) {\n return mapDomain(input, function(string) {\n return regexNonASCII.test(string) \? \"xn--\" + encode(string) : string;\n });\n};\n$ = {\n version: \"2.1.0\",\n ucs2: {\n decode: ucs2decode,\n encode: ucs2encode\n },\n decode,\n encode,\n toASCII,\n toUnicode\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodePunycodeCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/punycode.ts\nvar error = function(type) {\n @throwRangeError(errors[type]);\n}, map = function(array, callback) {\n const result = [];\n let length = array.length;\n while (length--)\n result[length] = callback(array[length]);\n return result;\n}, mapDomain = function(domain, callback) {\n const parts = domain.split(\"@\");\n let result = \"\";\n if (parts.length > 1)\n result = parts[0] + \"@\", domain = parts[1];\n domain = domain.replace(regexSeparators, \".\");\n const labels = domain.split(\".\"), encoded = map(labels, callback).join(\".\");\n return result + encoded;\n}, ucs2decode = function(string) {\n const output = [];\n let counter = 0;\n const length = string.length;\n while (counter < length) {\n const value = string.charCodeAt(counter++);\n if (value >= 55296 && value <= 56319 && counter < length) {\n const extra = string.charCodeAt(counter++);\n if ((extra & 64512) == 56320)\n output.push(((value & 1023) << 10) + (extra & 1023) + 65536);\n else\n output.push(value), counter--;\n } else\n output.push(value);\n }\n return output;\n}, $, maxInt = 2147483647, base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, delimiter = \"-\", regexPunycode = /^xn--/, regexNonASCII = /[^\\0-\\x7F]/, regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, errors = {\n overflow: \"Overflow: input needs wider integers to process\",\n \"not-basic\": \"Illegal input >= 0x80 (not a basic code point)\",\n \"invalid-input\": \"Invalid input\"\n}, baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = @String.fromCharCode, ucs2encode = (codePoints) => @String.fromCodePoint(...codePoints), basicToDigit = function(codePoint) {\n if (codePoint >= 48 && codePoint < 58)\n return 26 + (codePoint - 48);\n if (codePoint >= 65 && codePoint < 91)\n return codePoint - 65;\n if (codePoint >= 97 && codePoint < 123)\n return codePoint - 97;\n return base;\n}, digitToBasic = function(digit, flag) {\n return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n}, adapt = function(delta, numPoints, firstTime) {\n let k = 0;\n delta = firstTime \? floor(delta / damp) : delta >> 1, delta += floor(delta / numPoints);\n for (;delta > baseMinusTMin * tMax >> 1; k += base)\n delta = floor(delta / baseMinusTMin);\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n}, decode = function(input) {\n const output = [], inputLength = input.length;\n let i = 0, n = initialN, bias = initialBias, basic = input.lastIndexOf(delimiter);\n if (basic < 0)\n basic = 0;\n for (let j = 0;j < basic; ++j) {\n if (input.charCodeAt(j) >= 128)\n error(\"not-basic\");\n output.push(input.charCodeAt(j));\n }\n for (let index = basic > 0 \? basic + 1 : 0;index < inputLength; ) {\n const oldi = i;\n for (let w = 1, k = base;; k += base) {\n if (index >= inputLength)\n error(\"invalid-input\");\n const digit = basicToDigit(input.charCodeAt(index++));\n if (digit >= base)\n error(\"invalid-input\");\n if (digit > floor((maxInt - i) / w))\n error(\"overflow\");\n i += digit * w;\n const t = k <= bias \? tMin : k >= bias + tMax \? tMax : k - bias;\n if (digit < t)\n break;\n const baseMinusT = base - t;\n if (w > floor(maxInt / baseMinusT))\n error(\"overflow\");\n w *= baseMinusT;\n }\n const out = output.length + 1;\n if (bias = adapt(i - oldi, out, oldi == 0), floor(i / out) > maxInt - n)\n error(\"overflow\");\n n += floor(i / out), i %= out, output.splice(i++, 0, n);\n }\n return @String.fromCodePoint(...output);\n}, encode = function(input) {\n const output = [];\n input = ucs2decode(input);\n const inputLength = input.length;\n let n = initialN, delta = 0, bias = initialBias;\n for (let currentValue of input)\n if (currentValue < 128)\n output.push(stringFromCharCode(currentValue));\n const basicLength = output.length;\n let handledCPCount = basicLength;\n if (basicLength)\n output.push(delimiter);\n while (handledCPCount < inputLength) {\n let m = maxInt;\n for (let currentValue of input)\n if (currentValue >= n && currentValue < m)\n m = currentValue;\n const handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne))\n error(\"overflow\");\n delta += (m - n) * handledCPCountPlusOne, n = m;\n for (let currentValue of input) {\n if (currentValue < n && ++delta > maxInt)\n error(\"overflow\");\n if (currentValue === n) {\n let q = delta;\n for (let k = base;; k += base) {\n const t = k <= bias \? tMin : k >= bias + tMax \? tMax : k - bias;\n if (q < t)\n break;\n const qMinusT = q - t, baseMinusT = base - t;\n output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))), q = floor(qMinusT / baseMinusT);\n }\n output.push(stringFromCharCode(digitToBasic(q, 0))), bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength), delta = 0, ++handledCPCount;\n }\n }\n ++delta, ++n;\n }\n return output.join(\"\");\n}, toUnicode = function(input) {\n return mapDomain(input, function(string) {\n return regexPunycode.test(string) \? decode(string.slice(4).toLowerCase()) : string;\n });\n}, toASCII = function(input) {\n return mapDomain(input, function(string) {\n return regexNonASCII.test(string) \? \"xn--\" + encode(string) : string;\n });\n};\n$ = {\n version: \"2.1.0\",\n ucs2: {\n decode: ucs2decode,\n encode: ucs2encode\n },\n decode,\n encode,\n toASCII,\n toUnicode\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeQuerystringCode = "(function (){\"use strict\";// src/js/out/tmp/node/querystring.ts\nvar __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports), Buffer = @requireNativeModule(\"buffer\").Buffer, require_object_keys = __commonJS((exports, module) => {\n var objectKeys = Object.keys || function() {\n var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !{ toString: null }.propertyIsEnumerable(\"toString\"), dontEnums = [\n \"toString\",\n \"toLocaleString\",\n \"valueOf\",\n \"hasOwnProperty\",\n \"isPrototypeOf\",\n \"propertyIsEnumerable\",\n \"constructor\"\n ], dontEnumsLength = dontEnums.length;\n return function(obj) {\n if (typeof obj !== \"function\" && (typeof obj !== \"object\" || obj === null))\n @throwTypeError(\"Object.keys called on non-object\");\n var result = [], prop, i;\n for (prop in obj)\n if (hasOwnProperty.call(obj, prop))\n result.push(prop);\n if (hasDontEnumBug) {\n for (i = 0;i < dontEnumsLength; i++)\n if (hasOwnProperty.call(obj, dontEnums[i]))\n result.push(dontEnums[i]);\n }\n return result;\n };\n }();\n module.exports = objectKeys;\n}), require_src = __commonJS((exports, module) => {\n var ParsedQueryString = function() {\n }, unescapeBuffer = function(s, decodeSpaces) {\n var out = Buffer.allocUnsafe(s.length), state = 0, n, m, hexchar, c;\n for (var inIndex = 0, outIndex = 0;; inIndex++) {\n if (inIndex < s.length)\n c = s.charCodeAt(inIndex);\n else {\n if (state > 0) {\n if (out[outIndex++] = 37, state === 2)\n out[outIndex++] = hexchar;\n }\n break;\n }\n switch (state) {\n case 0:\n switch (c) {\n case 37:\n n = 0, m = 0, state = 1;\n break;\n case 43:\n if (decodeSpaces)\n c = 32;\n default:\n out[outIndex++] = c;\n break;\n }\n break;\n case 1:\n if (hexchar = c, n = unhexTable[c], !(n >= 0)) {\n out[outIndex++] = 37, out[outIndex++] = c, state = 0;\n break;\n }\n state = 2;\n break;\n case 2:\n if (state = 0, m = unhexTable[c], !(m >= 0)) {\n out[outIndex++] = 37, out[outIndex++] = hexchar, out[outIndex++] = c;\n break;\n }\n out[outIndex++] = 16 * n + m;\n break;\n }\n }\n return out.slice(0, outIndex);\n }, qsUnescape = function(s, decodeSpaces) {\n try {\n return decodeURIComponent(s);\n } catch (e) {\n return QueryString.unescapeBuffer(s, decodeSpaces).toString();\n }\n }, qsEscape = function(str) {\n if (typeof str !== \"string\")\n if (typeof str === \"object\")\n str = String(str);\n else\n str += \"\";\n var out = \"\", lastPos = 0;\n for (var i2 = 0;i2 < str.length; ++i2) {\n var c = str.charCodeAt(i2);\n if (c < 128) {\n if (noEscape[c] === 1)\n continue;\n if (lastPos < i2)\n out += str.slice(lastPos, i2);\n lastPos = i2 + 1, out += hexTable[c];\n continue;\n }\n if (lastPos < i2)\n out += str.slice(lastPos, i2);\n if (c < 2048) {\n lastPos = i2 + 1, out += hexTable[192 | c >> 6] + hexTable[128 | c & 63];\n continue;\n }\n if (c < 55296 || c >= 57344) {\n lastPos = i2 + 1, out += hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];\n continue;\n }\n ++i2;\n var c2;\n if (i2 < str.length)\n c2 = str.charCodeAt(i2) & 1023;\n else\n throw new URIError(\"URI malformed\");\n lastPos = i2 + 1, c = 65536 + ((c & 1023) << 10 | c2), out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];\n }\n if (lastPos === 0)\n return str;\n if (lastPos < str.length)\n return out + str.slice(lastPos);\n return out;\n }, stringifyPrimitive = function(v) {\n if (typeof v === \"string\")\n return v;\n if (typeof v === \"number\" && isFinite(v))\n return \"\" + v;\n if (typeof v === \"boolean\")\n return v \? \"true\" : \"false\";\n return \"\";\n }, stringify = function(obj, sep, eq, options) {\n sep = sep || \"&\", eq = eq || \"=\";\n var encode = QueryString.escape;\n if (options && typeof options.encodeURIComponent === \"function\")\n encode = options.encodeURIComponent;\n if (obj !== null && typeof obj === \"object\") {\n var keys = objectKeys(obj), len = keys.length, flast = len - 1, fields = \"\";\n for (var i2 = 0;i2 < len; ++i2) {\n var k = keys[i2], v = obj[k], ks = encode(stringifyPrimitive(k)) + eq;\n if (isArray(v)) {\n var vlen = v.length, vlast = vlen - 1;\n for (var j = 0;j < vlen; ++j)\n if (fields += ks + encode(stringifyPrimitive(v[j])), j < vlast)\n fields += sep;\n if (vlen && i2 < flast)\n fields += sep;\n } else if (fields += ks + encode(stringifyPrimitive(v)), i2 < flast)\n fields += sep;\n }\n return fields;\n }\n return \"\";\n }, charCodes = function(str) {\n if (str.length === 0)\n return [];\n if (str.length === 1)\n return [str.charCodeAt(0)];\n const ret = [];\n for (var i2 = 0;i2 < str.length; ++i2)\n ret[ret.length] = str.charCodeAt(i2);\n return ret;\n }, parse = function(qs, sep, eq, options) {\n const obj = new ParsedQueryString;\n if (typeof qs !== \"string\" || qs.length === 0)\n return obj;\n var sepCodes = !sep \? defSepCodes : charCodes(sep + \"\"), eqCodes = !eq \? defEqCodes : charCodes(eq + \"\");\n const sepLen = sepCodes.length, eqLen = eqCodes.length;\n var pairs = 1000;\n if (options && typeof options.maxKeys === \"number\")\n pairs = options.maxKeys > 0 \? options.maxKeys : -1;\n var decode = QueryString.unescape;\n if (options && typeof options.decodeURIComponent === \"function\")\n decode = options.decodeURIComponent;\n const customDecode = decode !== qsUnescape, keys = [];\n var posIdx = 0, lastPos = 0, sepIdx = 0, eqIdx = 0, key = \"\", value = \"\", keyEncoded = customDecode, valEncoded = customDecode, encodeCheck = 0;\n for (var i2 = 0;i2 < qs.length; ++i2) {\n const code = qs.charCodeAt(i2);\n if (code === sepCodes[sepIdx]) {\n if (++sepIdx === sepLen) {\n const end = i2 - sepIdx + 1;\n if (eqIdx < eqLen) {\n if (lastPos < end)\n key += qs.slice(lastPos, end);\n } else if (lastPos < end)\n value += qs.slice(lastPos, end);\n if (keyEncoded)\n key = decodeStr(key, decode);\n if (valEncoded)\n value = decodeStr(value, decode);\n if (key || value || lastPos - posIdx > sepLen || i2 === 0)\n if (indexOf(keys, key) === -1)\n obj[key] = value, keys[keys.length] = key;\n else {\n const curValue = obj[key] || \"\";\n if (curValue.pop)\n curValue[curValue.length] = value;\n else if (curValue)\n obj[key] = [curValue, value];\n }\n else if (i2 === 1)\n delete obj[key];\n if (--pairs === 0)\n break;\n keyEncoded = valEncoded = customDecode, encodeCheck = 0, key = value = \"\", posIdx = lastPos, lastPos = i2 + 1, sepIdx = eqIdx = 0;\n }\n continue;\n } else if (sepIdx = 0, !valEncoded)\n if (code === 37)\n encodeCheck = 1;\n else if (encodeCheck > 0 && (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {\n if (++encodeCheck === 3)\n valEncoded = !0;\n } else\n encodeCheck = 0;\n if (eqIdx < eqLen) {\n if (code === eqCodes[eqIdx]) {\n if (++eqIdx === eqLen) {\n const end = i2 - eqIdx + 1;\n if (lastPos < end)\n key += qs.slice(lastPos, end);\n encodeCheck = 0, lastPos = i2 + 1;\n }\n continue;\n } else if (eqIdx = 0, !keyEncoded)\n if (code === 37)\n encodeCheck = 1;\n else if (encodeCheck > 0 && (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {\n if (++encodeCheck === 3)\n keyEncoded = !0;\n } else\n encodeCheck = 0;\n }\n if (code === 43) {\n if (eqIdx < eqLen) {\n if (lastPos < i2)\n key += qs.slice(lastPos, i2);\n key += \"%20\", keyEncoded = !0;\n } else {\n if (lastPos < i2)\n value += qs.slice(lastPos, i2);\n value += \"%20\", valEncoded = !0;\n }\n lastPos = i2 + 1;\n }\n }\n if (pairs !== 0 && (lastPos < qs.length || eqIdx > 0)) {\n if (lastPos < qs.length) {\n if (eqIdx < eqLen)\n key += qs.slice(lastPos);\n else if (sepIdx < sepLen)\n value += qs.slice(lastPos);\n }\n if (keyEncoded)\n key = decodeStr(key, decode);\n if (valEncoded)\n value = decodeStr(value, decode);\n if (indexOf(keys, key) === -1)\n obj[key] = value, keys[keys.length] = key;\n else {\n const curValue = obj[key];\n if (curValue.pop)\n curValue[curValue.length] = value;\n else\n obj[key] = [curValue, value];\n }\n }\n return obj;\n }, decodeStr = function(s, decoder) {\n try {\n return decoder(s);\n } catch (e) {\n return QueryString.unescape(s, !0);\n }\n }, QueryString = module.exports = {\n unescapeBuffer,\n unescape: qsUnescape,\n escape: qsEscape,\n stringify,\n encode: stringify,\n parse,\n decode: parse\n }, objectKeys = require_object_keys(), isArray = (arg) => Object.prototype.toString.call(arg) === \"[object Array]\", indexOf = (arr, searchElement, fromIndex) => {\n var k;\n if (arr == null)\n @throwTypeError('\"arr\" is null or not defined');\n var o = Object(arr), len = o.length >>> 0;\n if (len === 0)\n return -1;\n var n = fromIndex | 0;\n if (n >= len)\n return -1;\n k = Math.max(n >= 0 \? n : len - Math.abs(n), 0);\n while (k < len) {\n if ((k in o) && o[k] === searchElement)\n return k;\n k++;\n }\n return -1;\n };\n ParsedQueryString.prototype = Object.create \? Object.create(null) : {};\n var unhexTable = [\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1\n ], hexTable = [];\n for (i = 0;i < 256; ++i)\n hexTable[i] = \"%\" + ((i < 16 \? \"0\" : \"\") + i.toString(16)).toUpperCase();\n var i, noEscape = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 1,\n 0\n ], defSepCodes = [38], defEqCodes = [61];\n});\nreturn require_src()})\n"_s;
+static constexpr ASCIILiteral NodeQuerystringCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/querystring.ts\nvar __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports), Buffer = @requireNativeModule(\"buffer\").Buffer, require_object_keys = __commonJS((exports, module) => {\n var objectKeys = Object.keys || function() {\n var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !{ toString: null }.propertyIsEnumerable(\"toString\"), dontEnums = [\n \"toString\",\n \"toLocaleString\",\n \"valueOf\",\n \"hasOwnProperty\",\n \"isPrototypeOf\",\n \"propertyIsEnumerable\",\n \"constructor\"\n ], dontEnumsLength = dontEnums.length;\n return function(obj) {\n if (typeof obj !== \"function\" && (typeof obj !== \"object\" || obj === null))\n @throwTypeError(\"Object.keys called on non-object\");\n var result = [], prop, i;\n for (prop in obj)\n if (hasOwnProperty.@call(obj, prop))\n result.push(prop);\n if (hasDontEnumBug) {\n for (i = 0;i < dontEnumsLength; i++)\n if (hasOwnProperty.@call(obj, dontEnums[i]))\n result.push(dontEnums[i]);\n }\n return result;\n };\n }();\n module.exports = objectKeys;\n}), require_src = __commonJS((exports, module) => {\n var ParsedQueryString = function() {\n }, unescapeBuffer = function(s, decodeSpaces) {\n var out = Buffer.allocUnsafe(s.length), state = 0, n, m, hexchar, c;\n for (var inIndex = 0, outIndex = 0;; inIndex++) {\n if (inIndex < s.length)\n c = s.charCodeAt(inIndex);\n else {\n if (state > 0) {\n if (out[outIndex++] = 37, state === 2)\n out[outIndex++] = hexchar;\n }\n break;\n }\n switch (state) {\n case 0:\n switch (c) {\n case 37:\n n = 0, m = 0, state = 1;\n break;\n case 43:\n if (decodeSpaces)\n c = 32;\n default:\n out[outIndex++] = c;\n break;\n }\n break;\n case 1:\n if (hexchar = c, n = unhexTable[c], !(n >= 0)) {\n out[outIndex++] = 37, out[outIndex++] = c, state = 0;\n break;\n }\n state = 2;\n break;\n case 2:\n if (state = 0, m = unhexTable[c], !(m >= 0)) {\n out[outIndex++] = 37, out[outIndex++] = hexchar, out[outIndex++] = c;\n break;\n }\n out[outIndex++] = 16 * n + m;\n break;\n }\n }\n return out.slice(0, outIndex);\n }, qsUnescape = function(s, decodeSpaces) {\n try {\n return decodeURIComponent(s);\n } catch (e) {\n return QueryString.unescapeBuffer(s, decodeSpaces).toString();\n }\n }, qsEscape = function(str) {\n if (typeof str !== \"string\")\n if (typeof str === \"object\")\n str = @String(str);\n else\n str += \"\";\n var out = \"\", lastPos = 0;\n for (var i2 = 0;i2 < str.length; ++i2) {\n var c = str.charCodeAt(i2);\n if (c < 128) {\n if (noEscape[c] === 1)\n continue;\n if (lastPos < i2)\n out += str.slice(lastPos, i2);\n lastPos = i2 + 1, out += hexTable[c];\n continue;\n }\n if (lastPos < i2)\n out += str.slice(lastPos, i2);\n if (c < 2048) {\n lastPos = i2 + 1, out += hexTable[192 | c >> 6] + hexTable[128 | c & 63];\n continue;\n }\n if (c < 55296 || c >= 57344) {\n lastPos = i2 + 1, out += hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];\n continue;\n }\n ++i2;\n var c2;\n if (i2 < str.length)\n c2 = str.charCodeAt(i2) & 1023;\n else\n throw new URIError(\"URI malformed\");\n lastPos = i2 + 1, c = 65536 + ((c & 1023) << 10 | c2), out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];\n }\n if (lastPos === 0)\n return str;\n if (lastPos < str.length)\n return out + str.slice(lastPos);\n return out;\n }, stringifyPrimitive = function(v) {\n if (typeof v === \"string\")\n return v;\n if (typeof v === \"number\" && @isFinite(v))\n return \"\" + v;\n if (typeof v === \"boolean\")\n return v \? \"true\" : \"false\";\n return \"\";\n }, stringify = function(obj, sep, eq, options) {\n sep = sep || \"&\", eq = eq || \"=\";\n var encode = QueryString.escape;\n if (options && typeof options.encodeURIComponent === \"function\")\n encode = options.encodeURIComponent;\n if (obj !== null && typeof obj === \"object\") {\n var keys = objectKeys(obj), len = keys.length, flast = len - 1, fields = \"\";\n for (var i2 = 0;i2 < len; ++i2) {\n var k = keys[i2], v = obj[k], ks = encode(stringifyPrimitive(k)) + eq;\n if (isArray(v)) {\n var vlen = v.length, vlast = vlen - 1;\n for (var j = 0;j < vlen; ++j)\n if (fields += ks + encode(stringifyPrimitive(v[j])), j < vlast)\n fields += sep;\n if (vlen && i2 < flast)\n fields += sep;\n } else if (fields += ks + encode(stringifyPrimitive(v)), i2 < flast)\n fields += sep;\n }\n return fields;\n }\n return \"\";\n }, charCodes = function(str) {\n if (str.length === 0)\n return [];\n if (str.length === 1)\n return [str.charCodeAt(0)];\n const ret = [];\n for (var i2 = 0;i2 < str.length; ++i2)\n ret[ret.length] = str.charCodeAt(i2);\n return ret;\n }, parse = function(qs, sep, eq, options) {\n const obj = new ParsedQueryString;\n if (typeof qs !== \"string\" || qs.length === 0)\n return obj;\n var sepCodes = !sep \? defSepCodes : charCodes(sep + \"\"), eqCodes = !eq \? defEqCodes : charCodes(eq + \"\");\n const sepLen = sepCodes.length, eqLen = eqCodes.length;\n var pairs = 1000;\n if (options && typeof options.maxKeys === \"number\")\n pairs = options.maxKeys > 0 \? options.maxKeys : -1;\n var decode = QueryString.unescape;\n if (options && typeof options.decodeURIComponent === \"function\")\n decode = options.decodeURIComponent;\n const customDecode = decode !== qsUnescape, keys = [];\n var posIdx = 0, lastPos = 0, sepIdx = 0, eqIdx = 0, key = \"\", value = \"\", keyEncoded = customDecode, valEncoded = customDecode, encodeCheck = 0;\n for (var i2 = 0;i2 < qs.length; ++i2) {\n const code = qs.charCodeAt(i2);\n if (code === sepCodes[sepIdx]) {\n if (++sepIdx === sepLen) {\n const end = i2 - sepIdx + 1;\n if (eqIdx < eqLen) {\n if (lastPos < end)\n key += qs.slice(lastPos, end);\n } else if (lastPos < end)\n value += qs.slice(lastPos, end);\n if (keyEncoded)\n key = decodeStr(key, decode);\n if (valEncoded)\n value = decodeStr(value, decode);\n if (key || value || lastPos - posIdx > sepLen || i2 === 0)\n if (indexOf(keys, key) === -1)\n obj[key] = value, keys[keys.length] = key;\n else {\n const curValue = obj[key] || \"\";\n if (curValue.pop)\n curValue[curValue.length] = value;\n else if (curValue)\n obj[key] = [curValue, value];\n }\n else if (i2 === 1)\n delete obj[key];\n if (--pairs === 0)\n break;\n keyEncoded = valEncoded = customDecode, encodeCheck = 0, key = value = \"\", posIdx = lastPos, lastPos = i2 + 1, sepIdx = eqIdx = 0;\n }\n continue;\n } else if (sepIdx = 0, !valEncoded)\n if (code === 37)\n encodeCheck = 1;\n else if (encodeCheck > 0 && (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {\n if (++encodeCheck === 3)\n valEncoded = !0;\n } else\n encodeCheck = 0;\n if (eqIdx < eqLen) {\n if (code === eqCodes[eqIdx]) {\n if (++eqIdx === eqLen) {\n const end = i2 - eqIdx + 1;\n if (lastPos < end)\n key += qs.slice(lastPos, end);\n encodeCheck = 0, lastPos = i2 + 1;\n }\n continue;\n } else if (eqIdx = 0, !keyEncoded)\n if (code === 37)\n encodeCheck = 1;\n else if (encodeCheck > 0 && (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {\n if (++encodeCheck === 3)\n keyEncoded = !0;\n } else\n encodeCheck = 0;\n }\n if (code === 43) {\n if (eqIdx < eqLen) {\n if (lastPos < i2)\n key += qs.slice(lastPos, i2);\n key += \"%20\", keyEncoded = !0;\n } else {\n if (lastPos < i2)\n value += qs.slice(lastPos, i2);\n value += \"%20\", valEncoded = !0;\n }\n lastPos = i2 + 1;\n }\n }\n if (pairs !== 0 && (lastPos < qs.length || eqIdx > 0)) {\n if (lastPos < qs.length) {\n if (eqIdx < eqLen)\n key += qs.slice(lastPos);\n else if (sepIdx < sepLen)\n value += qs.slice(lastPos);\n }\n if (keyEncoded)\n key = decodeStr(key, decode);\n if (valEncoded)\n value = decodeStr(value, decode);\n if (indexOf(keys, key) === -1)\n obj[key] = value, keys[keys.length] = key;\n else {\n const curValue = obj[key];\n if (curValue.pop)\n curValue[curValue.length] = value;\n else\n obj[key] = [curValue, value];\n }\n }\n return obj;\n }, decodeStr = function(s, decoder) {\n try {\n return decoder(s);\n } catch (e) {\n return QueryString.unescape(s, !0);\n }\n }, QueryString = module.exports = {\n unescapeBuffer,\n unescape: qsUnescape,\n escape: qsEscape,\n stringify,\n encode: stringify,\n parse,\n decode: parse\n }, objectKeys = require_object_keys(), isArray = (arg) => Object.prototype.toString.@call(arg) === \"[object Array]\", indexOf = (arr, searchElement, fromIndex) => {\n var k;\n if (arr == null)\n @throwTypeError('\"arr\" is null or not defined');\n var o = Object(arr), len = o.length >>> 0;\n if (len === 0)\n return -1;\n var n = fromIndex | 0;\n if (n >= len)\n return -1;\n k = Math.max(n >= 0 \? n : len - Math.abs(n), 0);\n while (k < len) {\n if ((k in o) && o[k] === searchElement)\n return k;\n k++;\n }\n return -1;\n };\n ParsedQueryString.prototype = Object.create \? Object.create(null) : {};\n var unhexTable = [\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1,\n -1\n ], hexTable = [];\n for (i = 0;i < 256; ++i)\n hexTable[i] = \"%\" + ((i < 16 \? \"0\" : \"\") + i.toString(16)).toUpperCase();\n var i, noEscape = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 1,\n 0\n ], defSepCodes = [38], defEqCodes = [61];\n});\nreturn require_src()})\n");
//
//
-static constexpr ASCIILiteral NodeReadlineCode = "(function (){\"use strict\";// src/js/out/tmp/node/readline.ts\nvar stripVTControlCharacters = function(str) {\n return validateString(str, \"str\"), RegExpPrototypeSymbolReplace.call(ansi, str, \"\");\n}, promisify = function(original) {\n if (validateFunction(original, \"original\"), original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n return validateFunction(fn, \"util.promisify.custom\"), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n }\n var argumentNames = original[kCustomPromisifyArgsSymbol];\n function fn(...args) {\n return new Promise((resolve, reject) => {\n ArrayPrototypePush.call(args, (err, ...values) => {\n if (err)\n return reject(err);\n if (argumentNames !== void 0 && values.length > 1) {\n var obj = {};\n for (var i2 = 0;i2 < argumentNames.length; i2++)\n obj[argumentNames[i2]] = values[i2];\n resolve(obj);\n } else\n resolve(values[0]);\n }), ReflectApply(original, this, args);\n });\n }\n ObjectSetPrototypeOf(fn, ObjectGetPrototypeOf(original)), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n var descriptors = ObjectGetOwnPropertyDescriptors(original), propertiesValues = ObjectValues(descriptors);\n for (var i = 0;i < propertiesValues.length; i++)\n ObjectSetPrototypeOf(propertiesValues[i], null);\n return ObjectDefineProperties(fn, descriptors);\n}, getNodeErrorByName = function(typeName) {\n var base = errorBases[typeName];\n if (base)\n return base;\n if (!ObjectKeys(VALID_NODE_ERROR_BASES).includes(typeName))\n throw new Error(\"Invalid NodeError type\");\n var Base = VALID_NODE_ERROR_BASES[typeName];\n\n class NodeError extends Base {\n [kIsNodeError] = !0;\n code;\n constructor(msg, opts) {\n super(msg, opts);\n this.code = opts\?.code || \"ERR_GENERIC\";\n }\n toString() {\n return `${this.name} [${this.code}]: ${this.message}`;\n }\n }\n return errorBases[typeName] = NodeError, NodeError;\n}, validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateAbortSignal = function(signal, name) {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateArray = function(value, name, minLength = 0) {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n var reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar validateInteger = function(value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, validateUint32 = function(value, name, positive = !1) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n var min = positive \? 1 : 0, max = 4294967295;\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, CSI = function(strings, ...args) {\n var ret = `${kEscape}[`;\n for (var n = 0;n < strings.length; n++)\n if (ret += strings[n], n < args.length)\n ret += args[n];\n return ret;\n}, charLengthLeft = function(str, i) {\n if (i <= 0)\n return 0;\n if (i > 1 && StringPrototypeCodePointAt.call(str, i - 2) >= kUTF16SurrogateThreshold || StringPrototypeCodePointAt.call(str, i - 1) >= kUTF16SurrogateThreshold)\n return 2;\n return 1;\n}, charLengthAt = function(str, i) {\n if (str.length <= i)\n return 1;\n return StringPrototypeCodePointAt.call(str, i) >= kUTF16SurrogateThreshold \? 2 : 1;\n};\nfunction* emitKeys(stream) {\n while (!0) {\n var ch = yield, s = ch, escaped = !1, keySeq = null, keyName, keyCtrl2 = !1, keyMeta = !1, keyShift = !1;\n if (ch === kEscape) {\n if (escaped = !0, s += ch = yield, ch === kEscape)\n s += ch = yield;\n }\n if (escaped && (ch === \"O\" || ch === \"[\")) {\n var code = ch, modifier = 0;\n if (ch === \"O\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n modifier = (ch >> 0) - 1, s += ch = yield;\n code += ch;\n } else if (ch === \"[\") {\n if (s += ch = yield, ch === \"[\")\n code += ch, s += ch = yield;\n var cmdStart = s.length - 1;\n if (ch >= \"0\" && ch <= \"9\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += ch = yield;\n }\n if (ch === \";\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += yield;\n }\n var cmd = StringPrototypeSlice.call(s, cmdStart), match;\n if (match = RegExpPrototypeExec.call(/^(\\d\\d\?)(;(\\d))\?([~^$])$/, cmd))\n code += match[1] + match[4], modifier = (match[3] || 1) - 1;\n else if (match = RegExpPrototypeExec.call(/^((\\d;)\?(\\d))\?([A-Za-z])$/, cmd))\n code += match[4], modifier = (match[3] || 1) - 1;\n else\n code += cmd;\n }\n switch (keyCtrl2 = !!(modifier & 4), keyMeta = !!(modifier & 10), keyShift = !!(modifier & 1), code) {\n case \"[P\":\n keyName = \"f1\";\n break;\n case \"[Q\":\n keyName = \"f2\";\n break;\n case \"[R\":\n keyName = \"f3\";\n break;\n case \"[S\":\n keyName = \"f4\";\n break;\n case \"OP\":\n keyName = \"f1\";\n break;\n case \"OQ\":\n keyName = \"f2\";\n break;\n case \"OR\":\n keyName = \"f3\";\n break;\n case \"OS\":\n keyName = \"f4\";\n break;\n case \"[11~\":\n keyName = \"f1\";\n break;\n case \"[12~\":\n keyName = \"f2\";\n break;\n case \"[13~\":\n keyName = \"f3\";\n break;\n case \"[14~\":\n keyName = \"f4\";\n break;\n case \"[[A\":\n keyName = \"f1\";\n break;\n case \"[[B\":\n keyName = \"f2\";\n break;\n case \"[[C\":\n keyName = \"f3\";\n break;\n case \"[[D\":\n keyName = \"f4\";\n break;\n case \"[[E\":\n keyName = \"f5\";\n break;\n case \"[15~\":\n keyName = \"f5\";\n break;\n case \"[17~\":\n keyName = \"f6\";\n break;\n case \"[18~\":\n keyName = \"f7\";\n break;\n case \"[19~\":\n keyName = \"f8\";\n break;\n case \"[20~\":\n keyName = \"f9\";\n break;\n case \"[21~\":\n keyName = \"f10\";\n break;\n case \"[23~\":\n keyName = \"f11\";\n break;\n case \"[24~\":\n keyName = \"f12\";\n break;\n case \"[A\":\n keyName = \"up\";\n break;\n case \"[B\":\n keyName = \"down\";\n break;\n case \"[C\":\n keyName = \"right\";\n break;\n case \"[D\":\n keyName = \"left\";\n break;\n case \"[E\":\n keyName = \"clear\";\n break;\n case \"[F\":\n keyName = \"end\";\n break;\n case \"[H\":\n keyName = \"home\";\n break;\n case \"OA\":\n keyName = \"up\";\n break;\n case \"OB\":\n keyName = \"down\";\n break;\n case \"OC\":\n keyName = \"right\";\n break;\n case \"OD\":\n keyName = \"left\";\n break;\n case \"OE\":\n keyName = \"clear\";\n break;\n case \"OF\":\n keyName = \"end\";\n break;\n case \"OH\":\n keyName = \"home\";\n break;\n case \"[1~\":\n keyName = \"home\";\n break;\n case \"[2~\":\n keyName = \"insert\";\n break;\n case \"[3~\":\n keyName = \"delete\";\n break;\n case \"[4~\":\n keyName = \"end\";\n break;\n case \"[5~\":\n keyName = \"pageup\";\n break;\n case \"[6~\":\n keyName = \"pagedown\";\n break;\n case \"[[5~\":\n keyName = \"pageup\";\n break;\n case \"[[6~\":\n keyName = \"pagedown\";\n break;\n case \"[7~\":\n keyName = \"home\";\n break;\n case \"[8~\":\n keyName = \"end\";\n break;\n case \"[a\":\n keyName = \"up\", keyShift = !0;\n break;\n case \"[b\":\n keyName = \"down\", keyShift = !0;\n break;\n case \"[c\":\n keyName = \"right\", keyShift = !0;\n break;\n case \"[d\":\n keyName = \"left\", keyShift = !0;\n break;\n case \"[e\":\n keyName = \"clear\", keyShift = !0;\n break;\n case \"[2$\":\n keyName = \"insert\", keyShift = !0;\n break;\n case \"[3$\":\n keyName = \"delete\", keyShift = !0;\n break;\n case \"[5$\":\n keyName = \"pageup\", keyShift = !0;\n break;\n case \"[6$\":\n keyName = \"pagedown\", keyShift = !0;\n break;\n case \"[7$\":\n keyName = \"home\", keyShift = !0;\n break;\n case \"[8$\":\n keyName = \"end\", keyShift = !0;\n break;\n case \"Oa\":\n keyName = \"up\", keyCtrl2 = !0;\n break;\n case \"Ob\":\n keyName = \"down\", keyCtrl2 = !0;\n break;\n case \"Oc\":\n keyName = \"right\", keyCtrl2 = !0;\n break;\n case \"Od\":\n keyName = \"left\", keyCtrl2 = !0;\n break;\n case \"Oe\":\n keyName = \"clear\", keyCtrl2 = !0;\n break;\n case \"[2^\":\n keyName = \"insert\", keyCtrl2 = !0;\n break;\n case \"[3^\":\n keyName = \"delete\", keyCtrl2 = !0;\n break;\n case \"[5^\":\n keyName = \"pageup\", keyCtrl2 = !0;\n break;\n case \"[6^\":\n keyName = \"pagedown\", keyCtrl2 = !0;\n break;\n case \"[7^\":\n keyName = \"home\", keyCtrl2 = !0;\n break;\n case \"[8^\":\n keyName = \"end\", keyCtrl2 = !0;\n break;\n case \"[Z\":\n keyName = \"tab\", keyShift = !0;\n break;\n default:\n keyName = \"undefined\";\n break;\n }\n } else if (ch === \"\\r\")\n keyName = \"return\", keyMeta = escaped;\n else if (ch === \"\\n\")\n keyName = \"enter\", keyMeta = escaped;\n else if (ch === \"\\t\")\n keyName = \"tab\", keyMeta = escaped;\n else if (ch === \"\\b\" || ch === \"\\x7F\")\n keyName = \"backspace\", keyMeta = escaped;\n else if (ch === kEscape)\n keyName = \"escape\", keyMeta = escaped;\n else if (ch === \" \")\n keyName = \"space\", keyMeta = escaped;\n else if (!escaped && ch <= \"\\x1A\")\n keyName = StringFromCharCode(StringPrototypeCharCodeAt.call(ch) + StringPrototypeCharCodeAt.call(\"a\") - 1), keyCtrl2 = !0;\n else if (RegExpPrototypeExec.call(/^[0-9A-Za-z]$/, ch) !== null)\n keyName = StringPrototypeToLowerCase.call(ch), keyShift = RegExpPrototypeExec.call(/^[A-Z]$/, ch) !== null, keyMeta = escaped;\n else if (escaped)\n keyName = ch.length \? void 0 : \"escape\", keyMeta = !0;\n else\n keyName = void 0;\n if (keySeq = s, s.length !== 0 && (keyName !== void 0 || escaped))\n stream.emit(\"keypress\", escaped \? void 0 : s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n else if (charLengthAt(s, 0) === s.length)\n stream.emit(\"keypress\", s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n }\n}\nvar commonPrefix = function(strings) {\n if (strings.length === 0)\n return \"\";\n if (strings.length === 1)\n return strings[0];\n var sorted = ArrayPrototypeSort.call(ArrayPrototypeSlice.call(strings)), min = sorted[0], max = sorted[sorted.length - 1];\n for (var i = 0;i < min.length; i++)\n if (min[i] !== max[i])\n return StringPrototypeSlice.call(min, 0, i);\n return min;\n}, cursorTo = function(stream, x, y, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (typeof y === \"function\")\n callback = y, y = void 0;\n if (NumberIsNaN(x))\n throw new ERR_INVALID_ARG_VALUE(\"x\", x);\n if (NumberIsNaN(y))\n throw new ERR_INVALID_ARG_VALUE(\"y\", y);\n if (stream == null || typeof x !== \"number\" && typeof y !== \"number\") {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n if (typeof x !== \"number\")\n throw new ERR_INVALID_CURSOR_POS;\n var data = typeof y !== \"number\" \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n return stream.write(data, callback);\n}, moveCursor = function(stream, dx, dy, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream == null || !(dx || dy)) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n return stream.write(data, callback);\n}, clearLine = function(stream, dir, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var type = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n return stream.write(type, callback);\n}, clearScreenDown = function(stream, callback) {\n if (callback !== void 0)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === void 0) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n return stream.write(kClearScreenDown, callback);\n}, emitKeypressEvents = function(stream, iface = {}) {\n if (stream[KEYPRESS_DECODER])\n return;\n stream[KEYPRESS_DECODER] = new StringDecoder(\"utf8\"), stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next();\n var triggerEscape = () => stream[ESCAPE_DECODER].next(\"\"), { escapeCodeTimeout = ESCAPE_CODE_TIMEOUT } = iface, timeoutId;\n function onData(input) {\n if (stream.listenerCount(\"keypress\") > 0) {\n var string = stream[KEYPRESS_DECODER].write(input);\n if (string) {\n clearTimeout(timeoutId), iface[kSawKeyPress] = charLengthAt(string, 0) === string.length, iface.isCompletionEnabled = !1;\n var length = 0;\n for (var character of new SafeStringIterator(string)) {\n if (length += character.length, length === string.length)\n iface.isCompletionEnabled = !0;\n try {\n if (stream[ESCAPE_DECODER].next(character), length === string.length && character === kEscape)\n timeoutId = setTimeout(triggerEscape, escapeCodeTimeout);\n } catch (err) {\n throw stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next(), err;\n }\n }\n }\n } else\n stream.removeListener(\"data\", onData), stream.on(\"newListener\", onNewListener);\n }\n function onNewListener(event) {\n if (event === \"keypress\")\n stream.on(\"data\", onData), stream.removeListener(\"newListener\", onNewListener);\n }\n if (stream.listenerCount(\"keypress\") > 0)\n stream.on(\"data\", onData);\n else\n stream.on(\"newListener\", onNewListener);\n}, onSelfCloseWithTerminal = function() {\n var input = this.input, output = this.output;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n if (input.removeListener(\"keypress\", this[kOnKeyPress]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnTermEnd]), output !== null && output !== void 0)\n output.removeListener(\"resize\", this[kOnResize]);\n}, onSelfCloseWithoutTerminal = function() {\n var input = this.input;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n input.removeListener(\"data\", this[kOnData]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnEnd]);\n}, onError = function(err) {\n this.emit(\"error\", err);\n}, onData = function(data) {\n debug(\"onData\"), this[kNormalWrite](data);\n}, onEnd = function() {\n if (debug(\"onEnd\"), typeof this[kLine_buffer] === \"string\" && this[kLine_buffer].length > 0)\n this.emit(\"line\", this[kLine_buffer]);\n this.close();\n}, onTermEnd = function() {\n if (debug(\"onTermEnd\"), typeof this.line === \"string\" && this.line.length > 0)\n this.emit(\"line\", this.line);\n this.close();\n}, onKeyPress = function(s, key) {\n if (this[kTtyWrite](s, key), key && key.sequence) {\n var ch = StringPrototypeCodePointAt.call(key.sequence, 0);\n if (ch >= 55296 && ch <= 57343)\n this[kRefreshLine]();\n }\n}, onResize = function() {\n this[kRefreshLine]();\n}, InterfaceConstructor = function(input, output, completer, terminal) {\n if (!(this instanceof InterfaceConstructor))\n return new InterfaceConstructor(input, output, completer, terminal);\n EventEmitter.call(this), this[kOnSelfCloseWithoutTerminal] = onSelfCloseWithoutTerminal.bind(this), this[kOnSelfCloseWithTerminal] = onSelfCloseWithTerminal.bind(this), this[kOnError] = onError.bind(this), this[kOnData] = onData.bind(this), this[kOnEnd] = onEnd.bind(this), this[kOnTermEnd] = onTermEnd.bind(this), this[kOnKeyPress] = onKeyPress.bind(this), this[kOnResize] = onResize.bind(this), this[kSawReturnAt] = 0, this.isCompletionEnabled = !0, this[kSawKeyPress] = !1, this[kPreviousKey] = null, this.escapeCodeTimeout = ESCAPE_CODE_TIMEOUT, this.tabSize = 8;\n var history, historySize, removeHistoryDuplicates = !1, crlfDelay, prompt = \"> \", signal;\n if (input\?.input) {\n output = input.output, completer = input.completer, terminal = input.terminal, history = input.history, historySize = input.historySize, signal = input.signal;\n var tabSize = input.tabSize;\n if (tabSize !== void 0)\n validateUint32(tabSize, \"tabSize\", !0), this.tabSize = tabSize;\n removeHistoryDuplicates = input.removeHistoryDuplicates;\n var inputPrompt = input.prompt;\n if (inputPrompt !== void 0)\n prompt = inputPrompt;\n var inputEscapeCodeTimeout = input.escapeCodeTimeout;\n if (inputEscapeCodeTimeout !== void 0)\n if (NumberIsFinite(inputEscapeCodeTimeout))\n this.escapeCodeTimeout = inputEscapeCodeTimeout;\n else\n throw new ERR_INVALID_ARG_VALUE(\"input.escapeCodeTimeout\", this.escapeCodeTimeout);\n if (signal)\n validateAbortSignal(signal, \"options.signal\");\n crlfDelay = input.crlfDelay, input = input.input;\n }\n if (completer !== void 0 && typeof completer !== \"function\")\n throw new ERR_INVALID_ARG_VALUE(\"completer\", completer);\n if (history === void 0)\n history = [];\n else\n validateArray(history, \"history\");\n if (historySize === void 0)\n historySize = kHistorySize;\n if (typeof historySize !== \"number\" || NumberIsNaN(historySize) || historySize < 0)\n throw new ERR_INVALID_ARG_VALUE(\"historySize\", historySize);\n if (terminal === void 0 && !(output === null || output === void 0))\n terminal = !!output.isTTY;\n if (this.line = \"\", this[kSubstringSearch] = null, this.output = output, this.input = input, this[kUndoStack] = [], this[kRedoStack] = [], this.history = history, this.historySize = historySize, this[kKillRing] = [], this[kKillRingCursor] = 0, this.removeHistoryDuplicates = !!removeHistoryDuplicates, this.crlfDelay = crlfDelay \? MathMax(kMincrlfDelay, crlfDelay) : kMincrlfDelay, this.completer = completer, this.setPrompt(prompt), this.terminal = !!terminal, this[kLineObjectStream] = void 0, input.on(\"error\", this[kOnError]), !this.terminal)\n input.on(\"data\", this[kOnData]), input.on(\"end\", this[kOnEnd]), this.once(\"close\", this[kOnSelfCloseWithoutTerminal]), this[kDecoder] = new StringDecoder(\"utf8\");\n else {\n if (emitKeypressEvents(input, this), input.on(\"keypress\", this[kOnKeyPress]), input.on(\"end\", this[kOnTermEnd]), this[kSetRawMode](!0), this.terminal = !0, this.cursor = 0, this.historyIndex = -1, output !== null && output !== void 0)\n output.on(\"resize\", this[kOnResize]);\n this.once(\"close\", this[kOnSelfCloseWithTerminal]);\n }\n if (signal) {\n var onAborted = (() => this.close()).bind(this);\n if (signal.aborted)\n process.nextTick(onAborted);\n else\n signal.addEventListener(\"abort\", onAborted, { once: !0 }), this.once(\"close\", () => signal.removeEventListener(\"abort\", onAborted));\n }\n this.line = \"\", input.resume();\n}, Interface = function(input, output, completer, terminal) {\n if (!(this instanceof Interface))\n return new Interface(input, output, completer, terminal);\n if (input\?.input && typeof input.completer === \"function\" && input.completer.length !== 2) {\n var { completer } = input;\n input.completer = (v, cb) => cb(null, completer(v));\n } else if (typeof completer === \"function\" && completer.length !== 2) {\n var realCompleter = completer;\n completer = (v, cb) => cb(null, realCompleter(v));\n }\n InterfaceConstructor.call(this, input, output, completer, terminal);\n}, createInterface = function(input, output, completer, terminal) {\n return new Interface(input, output, completer, terminal);\n};\nvar $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { StringDecoder } = @requireNativeModule(\"string_decoder\"), isWritable, { inspect } = Bun, debug = process.env.BUN_JS_DEBUG \? console.log : () => {\n}, SymbolAsyncIterator = Symbol.asyncIterator, SymbolIterator = Symbol.iterator, SymbolFor = Symbol.for, SymbolReplace = Symbol.replace, ArrayFrom = Array.from, ArrayIsArray = Array.isArray, ArrayPrototypeFilter = Array.prototype.filter, ArrayPrototypeSort = Array.prototype.sort, ArrayPrototypeIndexOf = Array.prototype.indexOf, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeMap = Array.prototype.map, ArrayPrototypePop = Array.prototype.pop, ArrayPrototypePush = Array.prototype.push, ArrayPrototypeSlice = Array.prototype.slice, ArrayPrototypeSplice = Array.prototype.splice, ArrayPrototypeReverse = Array.prototype.reverse, ArrayPrototypeShift = Array.prototype.shift, ArrayPrototypeUnshift = Array.prototype.unshift, RegExpPrototypeExec = RegExp.prototype.exec, RegExpPrototypeSymbolReplace = RegExp.prototype[SymbolReplace], StringFromCharCode = String.fromCharCode, StringPrototypeCharCodeAt = String.prototype.charCodeAt, StringPrototypeCodePointAt = String.prototype.codePointAt, StringPrototypeSlice = String.prototype.slice, StringPrototypeToLowerCase = String.prototype.toLowerCase, StringPrototypeEndsWith = String.prototype.endsWith, StringPrototypeRepeat = String.prototype.repeat, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeTrim = String.prototype.trim, StringPrototypeNormalize = String.prototype.normalize, NumberIsNaN = Number.isNaN, NumberIsFinite = Number.isFinite, NumberIsInteger = Number.isInteger, NumberMAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER, NumberMIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER, MathCeil = Math.ceil, MathFloor = Math.floor, MathMax = Math.max, MathMaxApply = Math.max.apply, DateNow = Date.now, FunctionPrototype = Function.prototype, StringPrototype = String.prototype, StringPrototypeSymbolIterator = StringPrototype[SymbolIterator], StringIteratorPrototypeNext = StringPrototypeSymbolIterator.call(\"\").next, ObjectSetPrototypeOf = Object.setPrototypeOf, ObjectDefineProperty = Object.defineProperty, ObjectDefineProperties = Object.defineProperties, ObjectFreeze = Object.freeze;\nvar { create: ObjectCreate, keys: ObjectKeys } = Object;\nvar createSafeIterator = (factory, next) => {\n class SafeIterator {\n #iterator;\n constructor(iterable) {\n this.#iterator = factory.call(iterable);\n }\n next() {\n return next.call(this.#iterator);\n }\n [SymbolIterator]() {\n return this;\n }\n }\n return ObjectSetPrototypeOf(SafeIterator.prototype, null), ObjectFreeze(SafeIterator.prototype), ObjectFreeze(SafeIterator), SafeIterator;\n}, SafeStringIterator = createSafeIterator(StringPrototypeSymbolIterator, StringIteratorPrototypeNext), isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n}, isZeroWidthCodePoint = (code) => {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, getStringWidth = function getStringWidth2(str, removeControlChars = !0) {\n var width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize.call(str, \"NFC\");\n for (var char of new SafeStringIterator(str)) {\n var code = StringPrototypeCodePointAt.call(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n}, ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new RegExp(ansiPattern, \"g\"), kCustomPromisifiedSymbol = SymbolFor(\"nodejs.util.promisify.custom\"), kCustomPromisifyArgsSymbol = Symbol(\"customPromisifyArgs\");\npromisify.custom = kCustomPromisifiedSymbol;\nvar kUTF16SurrogateThreshold = 65536, kEscape = \"\\x1B\", kSubstringSearch = Symbol(\"kSubstringSearch\"), kIsNodeError = Symbol(\"kIsNodeError\"), errorBases = {}, VALID_NODE_ERROR_BASES = {\n TypeError,\n RangeError,\n Error\n}, NodeError = getNodeErrorByName(\"Error\"), NodeTypeError = getNodeErrorByName(\"TypeError\"), NodeRangeError = getNodeErrorByName(\"RangeError\");\n\nclass ERR_INVALID_ARG_TYPE extends NodeTypeError {\n constructor(name, type, value) {\n super(`The \"${name}\" argument must be of type ${type}. Received type ${typeof value}`, {\n code: \"ERR_INVALID_ARG_TYPE\"\n });\n }\n}\n\nclass ERR_INVALID_ARG_VALUE extends NodeTypeError {\n constructor(name, value, reason = \"not specified\") {\n super(`The value \"${String(value)}\" is invalid for argument '${name}'. Reason: ${reason}`, {\n code: \"ERR_INVALID_ARG_VALUE\"\n });\n }\n}\n\nclass ERR_INVALID_CURSOR_POS extends NodeTypeError {\n constructor() {\n super(\"Cannot set cursor row without setting its column\", {\n code: \"ERR_INVALID_CURSOR_POS\"\n });\n }\n}\n\nclass ERR_OUT_OF_RANGE extends NodeRangeError {\n constructor(name, range, received) {\n super(`The value of \"${name}\" is out of range. It must be ${range}. Received ${received}`, {\n code: \"ERR_OUT_OF_RANGE\"\n });\n }\n}\n\nclass ERR_USE_AFTER_CLOSE extends NodeError {\n constructor() {\n super(\"This socket has been ended by the other party\", {\n code: \"ERR_USE_AFTER_CLOSE\"\n });\n }\n}\n\nclass AbortError extends Error {\n code;\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\nvar kClearLine, kClearScreenDown, kClearToLineBeginning, kClearToLineEnd;\nCSI.kEscape = kEscape;\nCSI.kClearLine = kClearLine = CSI`2K`;\nCSI.kClearScreenDown = kClearScreenDown = CSI`0J`;\nCSI.kClearToLineBeginning = kClearToLineBeginning = CSI`1K`;\nCSI.kClearToLineEnd = kClearToLineEnd = CSI`0K`;\nvar KEYPRESS_DECODER = Symbol(\"keypress-decoder\"), ESCAPE_DECODER = Symbol(\"escape-decoder\"), ESCAPE_CODE_TIMEOUT = 500, kEmptyObject = ObjectFreeze(ObjectCreate(null)), kHistorySize = 30, kMaxUndoRedoStackSize = 2048, kMincrlfDelay = 100, lineEnding = /\\r\?\\n|\\r(\?!\\n)/g, kMaxLengthOfKillRing = 32, kLineObjectStream = Symbol(\"line object stream\"), kQuestionCancel = Symbol(\"kQuestionCancel\"), kQuestion = Symbol(\"kQuestion\"), kAddHistory = Symbol(\"_addHistory\"), kBeforeEdit = Symbol(\"_beforeEdit\"), kDecoder = Symbol(\"_decoder\"), kDeleteLeft = Symbol(\"_deleteLeft\"), kDeleteLineLeft = Symbol(\"_deleteLineLeft\"), kDeleteLineRight = Symbol(\"_deleteLineRight\"), kDeleteRight = Symbol(\"_deleteRight\"), kDeleteWordLeft = Symbol(\"_deleteWordLeft\"), kDeleteWordRight = Symbol(\"_deleteWordRight\"), kGetDisplayPos = Symbol(\"_getDisplayPos\"), kHistoryNext = Symbol(\"_historyNext\"), kHistoryPrev = Symbol(\"_historyPrev\"), kInsertString = Symbol(\"_insertString\"), kLine = Symbol(\"_line\"), kLine_buffer = Symbol(\"_line_buffer\"), kKillRing = Symbol(\"_killRing\"), kKillRingCursor = Symbol(\"_killRingCursor\"), kMoveCursor = Symbol(\"_moveCursor\"), kNormalWrite = Symbol(\"_normalWrite\"), kOldPrompt = Symbol(\"_oldPrompt\"), kOnLine = Symbol(\"_onLine\"), kPreviousKey = Symbol(\"_previousKey\"), kPrompt = Symbol(\"_prompt\"), kPushToKillRing = Symbol(\"_pushToKillRing\"), kPushToUndoStack = Symbol(\"_pushToUndoStack\"), kQuestionCallback = Symbol(\"_questionCallback\"), kRedo = Symbol(\"_redo\"), kRedoStack = Symbol(\"_redoStack\"), kRefreshLine = Symbol(\"_refreshLine\"), kSawKeyPress = Symbol(\"_sawKeyPress\"), kSawReturnAt = Symbol(\"_sawReturnAt\"), kSetRawMode = Symbol(\"_setRawMode\"), kTabComplete = Symbol(\"_tabComplete\"), kTabCompleter = Symbol(\"_tabCompleter\"), kTtyWrite = Symbol(\"_ttyWrite\"), kUndo = Symbol(\"_undo\"), kUndoStack = Symbol(\"_undoStack\"), kWordLeft = Symbol(\"_wordLeft\"), kWordRight = Symbol(\"_wordRight\"), kWriteToOutput = Symbol(\"_writeToOutput\"), kYank = Symbol(\"_yank\"), kYanking = Symbol(\"_yanking\"), kYankPop = Symbol(\"_yankPop\"), kFirstEventParam = Symbol(\"nodejs.kFirstEventParam\"), kOnSelfCloseWithTerminal = Symbol(\"_onSelfCloseWithTerminal\"), kOnSelfCloseWithoutTerminal = Symbol(\"_onSelfCloseWithoutTerminal\"), kOnKeyPress = Symbol(\"_onKeyPress\"), kOnError = Symbol(\"_onError\"), kOnData = Symbol(\"_onData\"), kOnEnd = Symbol(\"_onEnd\"), kOnTermEnd = Symbol(\"_onTermEnd\"), kOnResize = Symbol(\"_onResize\");\nInterfaceConstructor.prototype = {};\nObjectSetPrototypeOf(InterfaceConstructor.prototype, EventEmitter.prototype);\nvar _Interface = class Interface2 extends InterfaceConstructor {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n get columns() {\n var output = this.output;\n if (output && output.columns)\n return output.columns;\n return Infinity;\n }\n setPrompt(prompt) {\n this[kPrompt] = prompt;\n }\n getPrompt() {\n return this[kPrompt];\n }\n [kSetRawMode](flag) {\n const mode = flag + 0, wasInRawMode = this.input.isRaw;\n var setRawMode = this.input.setRawMode;\n if (typeof setRawMode === \"function\")\n setRawMode.call(this.input, mode);\n return wasInRawMode;\n }\n prompt(preserveCursor) {\n if (this.paused)\n this.resume();\n if (this.terminal) {\n if (!preserveCursor)\n this.cursor = 0;\n this[kRefreshLine]();\n } else\n this[kWriteToOutput](this[kPrompt]);\n }\n [kQuestion](query, cb) {\n if (this.closed)\n throw new ERR_USE_AFTER_CLOSE(\"readline\");\n if (this[kQuestionCallback])\n this.prompt();\n else\n this[kOldPrompt] = this[kPrompt], this.setPrompt(query), this[kQuestionCallback] = cb, this.prompt();\n }\n [kOnLine](line) {\n if (this[kQuestionCallback]) {\n var cb = this[kQuestionCallback];\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), cb(line);\n } else\n this.emit(\"line\", line);\n }\n [kBeforeEdit](oldText, oldCursor) {\n this[kPushToUndoStack](oldText, oldCursor);\n }\n [kQuestionCancel]() {\n if (this[kQuestionCallback])\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), this.clearLine();\n }\n [kWriteToOutput](stringToWrite) {\n if (validateString(stringToWrite, \"stringToWrite\"), this.output !== null && this.output !== void 0)\n this.output.write(stringToWrite);\n }\n [kAddHistory]() {\n if (this.line.length === 0)\n return \"\";\n if (this.historySize === 0)\n return this.line;\n if (StringPrototypeTrim.call(this.line).length === 0)\n return this.line;\n if (this.history.length === 0 || this.history[0] !== this.line) {\n if (this.removeHistoryDuplicates) {\n var dupIndex = ArrayPrototypeIndexOf.call(this.history, this.line);\n if (dupIndex !== -1)\n ArrayPrototypeSplice.call(this.history, dupIndex, 1);\n }\n if (ArrayPrototypeUnshift.call(this.history, this.line), this.history.length > this.historySize)\n ArrayPrototypePop.call(this.history);\n }\n this.historyIndex = -1;\n var line = this.history[0];\n return this.emit(\"history\", this.history), line;\n }\n [kRefreshLine]() {\n var line = this[kPrompt] + this.line, dispPos = this[kGetDisplayPos](line), lineCols = dispPos.cols, lineRows = dispPos.rows, cursorPos = this.getCursorPos(), prevRows = this.prevRows || 0;\n if (prevRows > 0)\n moveCursor(this.output, 0, -prevRows);\n if (cursorTo(this.output, 0), clearScreenDown(this.output), this[kWriteToOutput](line), lineCols === 0)\n this[kWriteToOutput](\" \");\n cursorTo(this.output, cursorPos.cols);\n var diff = lineRows - cursorPos.rows;\n if (diff > 0)\n moveCursor(this.output, 0, -diff);\n this.prevRows = cursorPos.rows;\n }\n close() {\n if (this.closed)\n return;\n if (this.pause(), this.terminal)\n this[kSetRawMode](!1);\n this.closed = !0, this.emit(\"close\");\n }\n pause() {\n if (this.paused)\n return;\n return this.input.pause(), this.paused = !0, this.emit(\"pause\"), this;\n }\n resume() {\n if (!this.paused)\n return;\n return this.input.resume(), this.paused = !1, this.emit(\"resume\"), this;\n }\n write(d, key) {\n if (this.paused)\n this.resume();\n if (this.terminal)\n this[kTtyWrite](d, key);\n else\n this[kNormalWrite](d);\n }\n [kNormalWrite](b) {\n if (b === void 0)\n return;\n var string = this[kDecoder].write(b);\n if (this[kSawReturnAt] && DateNow() - this[kSawReturnAt] <= this.crlfDelay) {\n if (StringPrototypeCodePointAt.call(string) === 10)\n string = StringPrototypeSlice.call(string, 1);\n this[kSawReturnAt] = 0;\n }\n var newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n if (newPartContainsEnding !== null) {\n if (this[kLine_buffer])\n string = this[kLine_buffer] + string, this[kLine_buffer] = null, newPartContainsEnding = RegExpPrototypeExec.call(lineEnding, string);\n this[kSawReturnAt] = StringPrototypeEndsWith.call(string, \"\\r\") \? DateNow() : 0;\n var indexes = [0, newPartContainsEnding.index, lineEnding.lastIndex], nextMatch;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, string)) !== null)\n ArrayPrototypePush.call(indexes, nextMatch.index, lineEnding.lastIndex);\n var lastIndex = indexes.length - 1;\n this[kLine_buffer] = StringPrototypeSlice.call(string, indexes[lastIndex]);\n for (var i = 1;i < lastIndex; i += 2)\n this[kOnLine](StringPrototypeSlice.call(string, indexes[i - 1], indexes[i]));\n } else if (string)\n if (this[kLine_buffer])\n this[kLine_buffer] += string;\n else\n this[kLine_buffer] = string;\n }\n [kInsertString](c) {\n if (this[kBeforeEdit](this.line, this.cursor), this.cursor < this.line.length) {\n var beg = StringPrototypeSlice.call(this.line, 0, this.cursor), end = StringPrototypeSlice.call(this.line, this.cursor, this.line.length);\n this.line = beg + c + end, this.cursor += c.length, this[kRefreshLine]();\n } else {\n var oldPos = this.getCursorPos();\n this.line += c, this.cursor += c.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows < newPos.rows)\n this[kRefreshLine]();\n else\n this[kWriteToOutput](c);\n }\n }\n async[kTabComplete](lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor), value;\n try {\n value = await this.completer(string);\n } catch (err) {\n this[kWriteToOutput](`Tab completion error: ${inspect(err)}`);\n return;\n } finally {\n this.resume();\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n }\n [kTabCompleter](lastKeypressWasTab, { 0: completions, 1: completeOn }) {\n if (!completions || completions.length === 0)\n return;\n var prefix = commonPrefix(ArrayPrototypeFilter.call(completions, (e) => e !== \"\"));\n if (StringPrototypeStartsWith.call(prefix, completeOn) && prefix.length > completeOn.length) {\n this[kInsertString](StringPrototypeSlice.call(prefix, completeOn.length));\n return;\n } else if (!StringPrototypeStartsWith.call(completeOn, prefix)) {\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - completeOn.length) + prefix + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = this.cursor - completeOn.length + prefix.length, this._refreshLine();\n return;\n }\n if (!lastKeypressWasTab)\n return;\n this[kBeforeEdit](this.line, this.cursor);\n var completionsWidth = ArrayPrototypeMap.call(completions, (e) => getStringWidth(e)), width = MathMaxApply(completionsWidth) + 2, maxColumns = MathFloor(this.columns / width) || 1;\n if (maxColumns === Infinity)\n maxColumns = 1;\n var output = \"\\r\\n\", lineIndex = 0, whitespace = 0;\n for (var i = 0;i < completions.length; i++) {\n var completion = completions[i];\n if (completion === \"\" || lineIndex === maxColumns)\n output += \"\\r\\n\", lineIndex = 0, whitespace = 0;\n else\n output += StringPrototypeRepeat.call(\" \", whitespace);\n if (completion !== \"\")\n output += completion, whitespace = width - completionsWidth[i], lineIndex++;\n else\n output += \"\\r\\n\";\n }\n if (lineIndex !== 0)\n output += \"\\r\\n\\r\\n\";\n this[kWriteToOutput](output), this[kRefreshLine]();\n }\n [kWordLeft]() {\n if (this.cursor > 0) {\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n this[kMoveCursor](-match[0].length);\n }\n }\n [kWordRight]() {\n if (this.cursor < this.line.length) {\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|[^\\w\\s]+|\\w+)\\s*/, trailing);\n this[kMoveCursor](match[0].length);\n }\n }\n [kDeleteLeft]() {\n if (this.cursor > 0 && this.line.length > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthLeft(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor - charSize) + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor -= charSize, this[kRefreshLine]();\n }\n }\n [kDeleteRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthAt(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(this.line, this.cursor + charSize, this.line.length), this[kRefreshLine]();\n }\n }\n [kDeleteWordLeft]() {\n if (this.cursor > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var leading = StringPrototypeSlice.call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.call(ArrayPrototypeReverse.call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n leading = StringPrototypeSlice.call(leading, 0, leading.length - match[0].length), this.line = leading + StringPrototypeSlice.call(this.line, this.cursor, this.line.length), this.cursor = leading.length, this[kRefreshLine]();\n }\n }\n [kDeleteWordRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var trailing = StringPrototypeSlice.call(this.line, this.cursor), match = RegExpPrototypeExec.call(/^(\?:\\s+|\\W+|\\w+)\\s*/, trailing);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor) + StringPrototypeSlice.call(trailing, match[0].length), this[kRefreshLine]();\n }\n }\n [kDeleteLineLeft]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, this.cursor), this.cursor = 0, this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kDeleteLineRight]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = StringPrototypeSlice.call(this.line, 0, this.cursor), this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kPushToKillRing](del) {\n if (!del || del === this[kKillRing][0])\n return;\n ArrayPrototypeUnshift.call(this[kKillRing], del), this[kKillRingCursor] = 0;\n while (this[kKillRing].length > kMaxLengthOfKillRing)\n ArrayPrototypePop.call(this[kKillRing]);\n }\n [kYank]() {\n if (this[kKillRing].length > 0)\n this[kYanking] = !0, this[kInsertString](this[kKillRing][this[kKillRingCursor]]);\n }\n [kYankPop]() {\n if (!this[kYanking])\n return;\n if (this[kKillRing].length > 1) {\n var lastYank = this[kKillRing][this[kKillRingCursor]];\n if (this[kKillRingCursor]++, this[kKillRingCursor] >= this[kKillRing].length)\n this[kKillRingCursor] = 0;\n var currentYank = this[kKillRing][this[kKillRingCursor]], head = StringPrototypeSlice.call(this.line, 0, this.cursor - lastYank.length), tail = StringPrototypeSlice.call(this.line, this.cursor);\n this.line = head + currentYank + tail, this.cursor = head.length + currentYank.length, this[kRefreshLine]();\n }\n }\n clearLine() {\n this[kMoveCursor](Infinity), this[kWriteToOutput](\"\\r\\n\"), this.line = \"\", this.cursor = 0, this.prevRows = 0;\n }\n [kLine]() {\n var line = this[kAddHistory]();\n this[kUndoStack] = [], this[kRedoStack] = [], this.clearLine(), this[kOnLine](line);\n }\n [kPushToUndoStack](text, cursor) {\n if (ArrayPrototypePush.call(this[kUndoStack], { text, cursor }) > kMaxUndoRedoStackSize)\n ArrayPrototypeShift.call(this[kUndoStack]);\n }\n [kUndo]() {\n if (this[kUndoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kRedoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kUndoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kRedo]() {\n if (this[kRedoStack].length <= 0)\n return;\n ArrayPrototypePush.call(this[kUndoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.call(this[kRedoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kHistoryNext]() {\n if (this.historyIndex >= 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex - 1;\n while (index >= 0 && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index--;\n if (index === -1)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kHistoryPrev]() {\n if (this.historyIndex < this.history.length && this.history.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex + 1;\n while (index < this.history.length && (!StringPrototypeStartsWith.call(this.history[index], search) || this.line === this.history[index]))\n index++;\n if (index === this.history.length)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kGetDisplayPos](str) {\n var offset = 0, col = this.columns, rows = 0;\n str = stripVTControlCharacters(str);\n for (var char of new SafeStringIterator(str)) {\n if (char === \"\\n\") {\n rows += MathCeil(offset / col) || 1, offset = 0;\n continue;\n }\n if (char === \"\\t\") {\n offset += this.tabSize - offset % this.tabSize;\n continue;\n }\n var width = getStringWidth(char, !1);\n if (width === 0 || width === 1)\n offset += width;\n else {\n if ((offset + 1) % col === 0)\n offset++;\n offset += 2;\n }\n }\n var cols = offset % col;\n return rows += (offset - cols) / col, { cols, rows };\n }\n getCursorPos() {\n var strBeforeCursor = this[kPrompt] + StringPrototypeSlice.call(this.line, 0, this.cursor);\n return this[kGetDisplayPos](strBeforeCursor);\n }\n [kMoveCursor](dx) {\n if (dx === 0)\n return;\n var oldPos = this.getCursorPos();\n if (this.cursor += dx, this.cursor < 0)\n this.cursor = 0;\n else if (this.cursor > this.line.length)\n this.cursor = this.line.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows === newPos.rows) {\n var diffWidth = newPos.cols - oldPos.cols;\n moveCursor(this.output, diffWidth, 0);\n } else\n this[kRefreshLine]();\n }\n [kTtyWrite](s, key) {\n var previousKey = this[kPreviousKey];\n key = key || kEmptyObject, this[kPreviousKey] = key;\n var { name: keyName, meta: keyMeta, ctrl: keyCtrl2, shift: keyShift, sequence: keySeq } = key;\n if (!keyMeta || keyName !== \"y\")\n this[kYanking] = !1;\n if ((keyName === \"up\" || keyName === \"down\") && !keyCtrl2 && !keyMeta && !keyShift) {\n if (this[kSubstringSearch] === null)\n this[kSubstringSearch] = StringPrototypeSlice.call(this.line, 0, this.cursor);\n } else if (this[kSubstringSearch] !== null) {\n if (this[kSubstringSearch] = null, this.history.length === this.historyIndex)\n this.historyIndex = -1;\n }\n if (typeof keySeq === \"string\")\n switch (StringPrototypeCodePointAt.call(keySeq, 0)) {\n case 31:\n this[kUndo]();\n return;\n case 30:\n this[kRedo]();\n return;\n default:\n break;\n }\n if (keyName === \"escape\")\n return;\n if (keyCtrl2 && keyShift)\n switch (keyName) {\n case \"backspace\":\n this[kDeleteLineLeft]();\n break;\n case \"delete\":\n this[kDeleteLineRight]();\n break;\n }\n else if (keyCtrl2)\n switch (keyName) {\n case \"c\":\n if (this.listenerCount(\"SIGINT\") > 0)\n this.emit(\"SIGINT\");\n else\n this.close();\n break;\n case \"h\":\n this[kDeleteLeft]();\n break;\n case \"d\":\n if (this.cursor === 0 && this.line.length === 0)\n this.close();\n else if (this.cursor < this.line.length)\n this[kDeleteRight]();\n break;\n case \"u\":\n this[kDeleteLineLeft]();\n break;\n case \"k\":\n this[kDeleteLineRight]();\n break;\n case \"a\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"e\":\n this[kMoveCursor](Infinity);\n break;\n case \"b\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"f\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"l\":\n cursorTo(this.output, 0, 0), clearScreenDown(this.output), this[kRefreshLine]();\n break;\n case \"n\":\n this[kHistoryNext]();\n break;\n case \"p\":\n this[kHistoryPrev]();\n break;\n case \"y\":\n this[kYank]();\n break;\n case \"z\":\n if (this.listenerCount(\"SIGTSTP\") > 0)\n this.emit(\"SIGTSTP\");\n else\n process.once(\"SIGCONT\", () => {\n if (!this.paused)\n this.pause(), this.emit(\"SIGCONT\");\n this[kSetRawMode](!0), this[kRefreshLine]();\n }), this[kSetRawMode](!1), process.kill(process.pid, \"SIGTSTP\");\n break;\n case \"w\":\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"left\":\n this[kWordLeft]();\n break;\n case \"right\":\n this[kWordRight]();\n break;\n }\n else if (keyMeta)\n switch (keyName) {\n case \"b\":\n this[kWordLeft]();\n break;\n case \"f\":\n this[kWordRight]();\n break;\n case \"d\":\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"y\":\n this[kYankPop]();\n break;\n }\n else {\n if (this[kSawReturnAt] && keyName !== \"enter\")\n this[kSawReturnAt] = 0;\n switch (keyName) {\n case \"return\":\n this[kSawReturnAt] = DateNow(), this[kLine]();\n break;\n case \"enter\":\n if (this[kSawReturnAt] === 0 || DateNow() - this[kSawReturnAt] > this.crlfDelay)\n this[kLine]();\n this[kSawReturnAt] = 0;\n break;\n case \"backspace\":\n this[kDeleteLeft]();\n break;\n case \"delete\":\n this[kDeleteRight]();\n break;\n case \"left\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"right\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"home\":\n this[kMoveCursor]((-Infinity));\n break;\n case \"end\":\n this[kMoveCursor](Infinity);\n break;\n case \"up\":\n this[kHistoryPrev]();\n break;\n case \"down\":\n this[kHistoryNext]();\n break;\n case \"tab\":\n if (typeof this.completer === \"function\" && this.isCompletionEnabled) {\n var lastKeypressWasTab = previousKey && previousKey.name === \"tab\";\n this[kTabComplete](lastKeypressWasTab);\n break;\n }\n default:\n if (typeof s === \"string\" && s) {\n var nextMatch = RegExpPrototypeExec.call(lineEnding, s);\n if (nextMatch !== null) {\n this[kInsertString](StringPrototypeSlice.call(s, 0, nextMatch.index));\n var { lastIndex } = lineEnding;\n while ((nextMatch = RegExpPrototypeExec.call(lineEnding, s)) !== null)\n this[kLine](), this[kInsertString](StringPrototypeSlice.call(s, lastIndex, nextMatch.index)), { lastIndex } = lineEnding;\n if (lastIndex === s.length)\n this[kLine]();\n } else\n this[kInsertString](s);\n }\n }\n }\n }\n [SymbolAsyncIterator]() {\n if (this[kLineObjectStream] === void 0)\n this[kLineObjectStream] = EventEmitter.on(this, \"line\", {\n close: [\"close\"],\n highWatermark: 1024,\n [kFirstEventParam]: !0\n });\n return this[kLineObjectStream];\n }\n};\nInterface.prototype = {};\nObjectSetPrototypeOf(Interface.prototype, _Interface.prototype);\nObjectSetPrototypeOf(Interface, _Interface);\nInterface.prototype.question = function question(query, options, cb) {\n if (cb = typeof options === \"function\" \? options : cb, options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return;\n var onAbort = () => {\n this[kQuestionCancel]();\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 });\n var cleanup = () => {\n signal.removeEventListener(\"abort\", onAbort);\n }, originalCb = cb;\n cb = typeof cb === \"function\" \? (answer) => {\n return cleanup(), originalCb(answer);\n } : cleanup;\n }\n if (typeof cb === \"function\")\n this[kQuestion](query, cb);\n};\nInterface.prototype.question[promisify.custom] = function question2(query, options) {\n if (options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal && signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (signal) {\n var onAbort = () => {\n reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this.question(query, options, cb);\n });\n};\nObjectDefineProperties(Interface.prototype, {\n [kSetRawMode]: {\n __proto__: null,\n get() {\n return this._setRawMode;\n }\n },\n [kOnLine]: {\n __proto__: null,\n get() {\n return this._onLine;\n }\n },\n [kWriteToOutput]: {\n __proto__: null,\n get() {\n return this._writeToOutput;\n }\n },\n [kAddHistory]: {\n __proto__: null,\n get() {\n return this._addHistory;\n }\n },\n [kRefreshLine]: {\n __proto__: null,\n get() {\n return this._refreshLine;\n }\n },\n [kNormalWrite]: {\n __proto__: null,\n get() {\n return this._normalWrite;\n }\n },\n [kInsertString]: {\n __proto__: null,\n get() {\n return this._insertString;\n }\n },\n [kTabComplete]: {\n __proto__: null,\n get() {\n return this._tabComplete;\n }\n },\n [kWordLeft]: {\n __proto__: null,\n get() {\n return this._wordLeft;\n }\n },\n [kWordRight]: {\n __proto__: null,\n get() {\n return this._wordRight;\n }\n },\n [kDeleteLeft]: {\n __proto__: null,\n get() {\n return this._deleteLeft;\n }\n },\n [kDeleteRight]: {\n __proto__: null,\n get() {\n return this._deleteRight;\n }\n },\n [kDeleteWordLeft]: {\n __proto__: null,\n get() {\n return this._deleteWordLeft;\n }\n },\n [kDeleteWordRight]: {\n __proto__: null,\n get() {\n return this._deleteWordRight;\n }\n },\n [kDeleteLineLeft]: {\n __proto__: null,\n get() {\n return this._deleteLineLeft;\n }\n },\n [kDeleteLineRight]: {\n __proto__: null,\n get() {\n return this._deleteLineRight;\n }\n },\n [kLine]: {\n __proto__: null,\n get() {\n return this._line;\n }\n },\n [kHistoryNext]: {\n __proto__: null,\n get() {\n return this._historyNext;\n }\n },\n [kHistoryPrev]: {\n __proto__: null,\n get() {\n return this._historyPrev;\n }\n },\n [kGetDisplayPos]: {\n __proto__: null,\n get() {\n return this._getDisplayPos;\n }\n },\n [kMoveCursor]: {\n __proto__: null,\n get() {\n return this._moveCursor;\n }\n },\n [kTtyWrite]: {\n __proto__: null,\n get() {\n return this._ttyWrite;\n }\n },\n _decoder: {\n __proto__: null,\n get() {\n return this[kDecoder];\n },\n set(value) {\n this[kDecoder] = value;\n }\n },\n _line_buffer: {\n __proto__: null,\n get() {\n return this[kLine_buffer];\n },\n set(value) {\n this[kLine_buffer] = value;\n }\n },\n _oldPrompt: {\n __proto__: null,\n get() {\n return this[kOldPrompt];\n },\n set(value) {\n this[kOldPrompt] = value;\n }\n },\n _previousKey: {\n __proto__: null,\n get() {\n return this[kPreviousKey];\n },\n set(value) {\n this[kPreviousKey] = value;\n }\n },\n _prompt: {\n __proto__: null,\n get() {\n return this[kPrompt];\n },\n set(value) {\n this[kPrompt] = value;\n }\n },\n _questionCallback: {\n __proto__: null,\n get() {\n return this[kQuestionCallback];\n },\n set(value) {\n this[kQuestionCallback] = value;\n }\n },\n _sawKeyPress: {\n __proto__: null,\n get() {\n return this[kSawKeyPress];\n },\n set(value) {\n this[kSawKeyPress] = value;\n }\n },\n _sawReturnAt: {\n __proto__: null,\n get() {\n return this[kSawReturnAt];\n },\n set(value) {\n this[kSawReturnAt] = value;\n }\n }\n});\nInterface.prototype._setRawMode = _Interface.prototype[kSetRawMode];\nInterface.prototype._onLine = _Interface.prototype[kOnLine];\nInterface.prototype._writeToOutput = _Interface.prototype[kWriteToOutput];\nInterface.prototype._addHistory = _Interface.prototype[kAddHistory];\nInterface.prototype._refreshLine = _Interface.prototype[kRefreshLine];\nInterface.prototype._normalWrite = _Interface.prototype[kNormalWrite];\nInterface.prototype._insertString = _Interface.prototype[kInsertString];\nInterface.prototype._tabComplete = function(lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.call(this.line, 0, this.cursor);\n this.completer(string, (err, value) => {\n if (this.resume(), err) {\n this._writeToOutput(`Tab completion error: ${inspect(err)}`);\n return;\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n });\n};\nInterface.prototype._wordLeft = _Interface.prototype[kWordLeft];\nInterface.prototype._wordRight = _Interface.prototype[kWordRight];\nInterface.prototype._deleteLeft = _Interface.prototype[kDeleteLeft];\nInterface.prototype._deleteRight = _Interface.prototype[kDeleteRight];\nInterface.prototype._deleteWordLeft = _Interface.prototype[kDeleteWordLeft];\nInterface.prototype._deleteWordRight = _Interface.prototype[kDeleteWordRight];\nInterface.prototype._deleteLineLeft = _Interface.prototype[kDeleteLineLeft];\nInterface.prototype._deleteLineRight = _Interface.prototype[kDeleteLineRight];\nInterface.prototype._line = _Interface.prototype[kLine];\nInterface.prototype._historyNext = _Interface.prototype[kHistoryNext];\nInterface.prototype._historyPrev = _Interface.prototype[kHistoryPrev];\nInterface.prototype._getDisplayPos = _Interface.prototype[kGetDisplayPos];\nInterface.prototype._getCursorPos = _Interface.prototype.getCursorPos;\nInterface.prototype._moveCursor = _Interface.prototype[kMoveCursor];\nInterface.prototype._ttyWrite = _Interface.prototype[kTtyWrite];\n\nclass Readline {\n #autoCommit = !1;\n #stream;\n #todo = [];\n constructor(stream, options = void 0) {\n if (isWritable \?\?= (@getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37)).isWritable, !isWritable(stream))\n throw new ERR_INVALID_ARG_TYPE(\"stream\", \"Writable\", stream);\n if (this.#stream = stream, options\?.autoCommit != null)\n validateBoolean(options.autoCommit, \"options.autoCommit\"), this.#autoCommit = options.autoCommit;\n }\n cursorTo(x, y = void 0) {\n if (validateInteger(x, \"x\"), y != null)\n validateInteger(y, \"y\");\n var data = y == null \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n moveCursor(dx, dy) {\n if (dx || dy) {\n validateInteger(dx, \"dx\"), validateInteger(dy, \"dy\");\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n }\n return this;\n }\n clearLine(dir) {\n validateInteger(dir, \"dir\", -1, 1);\n var data = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.call(this.#todo, data);\n return this;\n }\n clearScreenDown() {\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(kClearScreenDown));\n else\n ArrayPrototypePush.call(this.#todo, kClearScreenDown);\n return this;\n }\n commit() {\n return new Promise((resolve) => {\n this.#stream.write(ArrayPrototypeJoin.call(this.#todo, \"\"), resolve), this.#todo = [];\n });\n }\n rollback() {\n return this.#todo = [], this;\n }\n}\nvar PromisesInterface = class Interface3 extends _Interface {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n question(query, options = kEmptyObject) {\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return PromiseReject(new AbortError(void 0, { cause: signal.reason }));\n }\n return new Promise((resolve, reject) => {\n var cb = resolve;\n if (options\?.signal) {\n var onAbort = () => {\n this[kQuestionCancel](), reject(new AbortError(void 0, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this[kQuestion](query, cb);\n });\n }\n};\n$ = {\n Interface,\n clearLine,\n clearScreenDown,\n createInterface,\n cursorTo,\n emitKeypressEvents,\n moveCursor,\n promises: {\n Readline,\n Interface: PromisesInterface,\n createInterface(input, output, completer, terminal) {\n return new PromisesInterface(input, output, completer, terminal);\n }\n },\n [SymbolFor(\"__BUN_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__\")]: {\n CSI,\n utils: {\n getStringWidth,\n stripVTControlCharacters\n }\n }\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeReadlineCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/readline.ts\nvar stripVTControlCharacters = function(str) {\n return validateString(str, \"str\"), RegExpPrototypeSymbolReplace.@call(ansi, str, \"\");\n}, promisify = function(original) {\n if (validateFunction(original, \"original\"), original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n return validateFunction(fn, \"util.promisify.custom\"), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n }\n var argumentNames = original[kCustomPromisifyArgsSymbol];\n function fn(...args) {\n return new @Promise((resolve, reject) => {\n ArrayPrototypePush.@call(args, (err, ...values) => {\n if (err)\n return reject(err);\n if (argumentNames !== @undefined && values.length > 1) {\n var obj = {};\n for (var i2 = 0;i2 < argumentNames.length; i2++)\n obj[argumentNames[i2]] = values[i2];\n resolve(obj);\n } else\n resolve(values[0]);\n }), ReflectApply(original, this, args);\n });\n }\n ObjectSetPrototypeOf(fn, ObjectGetPrototypeOf(original)), ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {\n __proto__: null,\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n var descriptors = ObjectGetOwnPropertyDescriptors(original), propertiesValues = ObjectValues(descriptors);\n for (var i = 0;i < propertiesValues.length; i++)\n ObjectSetPrototypeOf(propertiesValues[i], null);\n return ObjectDefineProperties(fn, descriptors);\n}, getNodeErrorByName = function(typeName) {\n var base = errorBases[typeName];\n if (base)\n return base;\n if (!ObjectKeys(VALID_NODE_ERROR_BASES).includes(typeName))\n throw new Error(\"Invalid NodeError type\");\n var Base = VALID_NODE_ERROR_BASES[typeName];\n\n class NodeError extends Base {\n [kIsNodeError] = !0;\n code;\n constructor(msg, opts) {\n super(msg, opts);\n this.code = opts\?.code || \"ERR_GENERIC\";\n }\n toString() {\n return `${this.name} [${this.code}]: ${this.message}`;\n }\n }\n return errorBases[typeName] = NodeError, NodeError;\n}, validateFunction = function(value, name) {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Function\", value);\n}, validateAbortSignal = function(signal, name) {\n if (signal !== @undefined && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, validateArray = function(value, name, minLength = 0) {\n if (!ArrayIsArray(value))\n throw new ERR_INVALID_ARG_TYPE(name, \"Array\", value);\n if (value.length < minLength) {\n var reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE(name, value, reason);\n }\n}, validateString = function(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE(name, \"string\", value);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar validateInteger = function(value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, validateUint32 = function(value, name, positive = !1) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n var min = positive \? 1 : 0, max = 4294967295;\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n}, CSI = function(strings, ...args) {\n var ret = `${kEscape}[`;\n for (var n = 0;n < strings.length; n++)\n if (ret += strings[n], n < args.length)\n ret += args[n];\n return ret;\n}, charLengthLeft = function(str, i) {\n if (i <= 0)\n return 0;\n if (i > 1 && StringPrototypeCodePointAt.@call(str, i - 2) >= kUTF16SurrogateThreshold || StringPrototypeCodePointAt.@call(str, i - 1) >= kUTF16SurrogateThreshold)\n return 2;\n return 1;\n}, charLengthAt = function(str, i) {\n if (str.length <= i)\n return 1;\n return StringPrototypeCodePointAt.@call(str, i) >= kUTF16SurrogateThreshold \? 2 : 1;\n};\nfunction* emitKeys(stream) {\n while (!0) {\n var ch = yield, s = ch, escaped = !1, keySeq = null, keyName, keyCtrl2 = !1, keyMeta = !1, keyShift = !1;\n if (ch === kEscape) {\n if (escaped = !0, s += ch = yield, ch === kEscape)\n s += ch = yield;\n }\n if (escaped && (ch === \"O\" || ch === \"[\")) {\n var code = ch, modifier = 0;\n if (ch === \"O\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n modifier = (ch >> 0) - 1, s += ch = yield;\n code += ch;\n } else if (ch === \"[\") {\n if (s += ch = yield, ch === \"[\")\n code += ch, s += ch = yield;\n var cmdStart = s.length - 1;\n if (ch >= \"0\" && ch <= \"9\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += ch = yield;\n }\n if (ch === \";\") {\n if (s += ch = yield, ch >= \"0\" && ch <= \"9\")\n s += yield;\n }\n var cmd = StringPrototypeSlice.@call(s, cmdStart), match;\n if (match = RegExpPrototypeExec.@call(/^(\\d\\d\?)(;(\\d))\?([~^$])$/, cmd))\n code += match[1] + match[4], modifier = (match[3] || 1) - 1;\n else if (match = RegExpPrototypeExec.@call(/^((\\d;)\?(\\d))\?([A-Za-z])$/, cmd))\n code += match[4], modifier = (match[3] || 1) - 1;\n else\n code += cmd;\n }\n switch (keyCtrl2 = !!(modifier & 4), keyMeta = !!(modifier & 10), keyShift = !!(modifier & 1), code) {\n case \"[P\":\n keyName = \"f1\";\n break;\n case \"[Q\":\n keyName = \"f2\";\n break;\n case \"[R\":\n keyName = \"f3\";\n break;\n case \"[S\":\n keyName = \"f4\";\n break;\n case \"OP\":\n keyName = \"f1\";\n break;\n case \"OQ\":\n keyName = \"f2\";\n break;\n case \"OR\":\n keyName = \"f3\";\n break;\n case \"OS\":\n keyName = \"f4\";\n break;\n case \"[11~\":\n keyName = \"f1\";\n break;\n case \"[12~\":\n keyName = \"f2\";\n break;\n case \"[13~\":\n keyName = \"f3\";\n break;\n case \"[14~\":\n keyName = \"f4\";\n break;\n case \"[[A\":\n keyName = \"f1\";\n break;\n case \"[[B\":\n keyName = \"f2\";\n break;\n case \"[[C\":\n keyName = \"f3\";\n break;\n case \"[[D\":\n keyName = \"f4\";\n break;\n case \"[[E\":\n keyName = \"f5\";\n break;\n case \"[15~\":\n keyName = \"f5\";\n break;\n case \"[17~\":\n keyName = \"f6\";\n break;\n case \"[18~\":\n keyName = \"f7\";\n break;\n case \"[19~\":\n keyName = \"f8\";\n break;\n case \"[20~\":\n keyName = \"f9\";\n break;\n case \"[21~\":\n keyName = \"f10\";\n break;\n case \"[23~\":\n keyName = \"f11\";\n break;\n case \"[24~\":\n keyName = \"f12\";\n break;\n case \"[A\":\n keyName = \"up\";\n break;\n case \"[B\":\n keyName = \"down\";\n break;\n case \"[C\":\n keyName = \"right\";\n break;\n case \"[D\":\n keyName = \"left\";\n break;\n case \"[E\":\n keyName = \"clear\";\n break;\n case \"[F\":\n keyName = \"end\";\n break;\n case \"[H\":\n keyName = \"home\";\n break;\n case \"OA\":\n keyName = \"up\";\n break;\n case \"OB\":\n keyName = \"down\";\n break;\n case \"OC\":\n keyName = \"right\";\n break;\n case \"OD\":\n keyName = \"left\";\n break;\n case \"OE\":\n keyName = \"clear\";\n break;\n case \"OF\":\n keyName = \"end\";\n break;\n case \"OH\":\n keyName = \"home\";\n break;\n case \"[1~\":\n keyName = \"home\";\n break;\n case \"[2~\":\n keyName = \"insert\";\n break;\n case \"[3~\":\n keyName = \"delete\";\n break;\n case \"[4~\":\n keyName = \"end\";\n break;\n case \"[5~\":\n keyName = \"pageup\";\n break;\n case \"[6~\":\n keyName = \"pagedown\";\n break;\n case \"[[5~\":\n keyName = \"pageup\";\n break;\n case \"[[6~\":\n keyName = \"pagedown\";\n break;\n case \"[7~\":\n keyName = \"home\";\n break;\n case \"[8~\":\n keyName = \"end\";\n break;\n case \"[a\":\n keyName = \"up\", keyShift = !0;\n break;\n case \"[b\":\n keyName = \"down\", keyShift = !0;\n break;\n case \"[c\":\n keyName = \"right\", keyShift = !0;\n break;\n case \"[d\":\n keyName = \"left\", keyShift = !0;\n break;\n case \"[e\":\n keyName = \"clear\", keyShift = !0;\n break;\n case \"[2$\":\n keyName = \"insert\", keyShift = !0;\n break;\n case \"[3$\":\n keyName = \"delete\", keyShift = !0;\n break;\n case \"[5$\":\n keyName = \"pageup\", keyShift = !0;\n break;\n case \"[6$\":\n keyName = \"pagedown\", keyShift = !0;\n break;\n case \"[7$\":\n keyName = \"home\", keyShift = !0;\n break;\n case \"[8$\":\n keyName = \"end\", keyShift = !0;\n break;\n case \"Oa\":\n keyName = \"up\", keyCtrl2 = !0;\n break;\n case \"Ob\":\n keyName = \"down\", keyCtrl2 = !0;\n break;\n case \"Oc\":\n keyName = \"right\", keyCtrl2 = !0;\n break;\n case \"Od\":\n keyName = \"left\", keyCtrl2 = !0;\n break;\n case \"Oe\":\n keyName = \"clear\", keyCtrl2 = !0;\n break;\n case \"[2^\":\n keyName = \"insert\", keyCtrl2 = !0;\n break;\n case \"[3^\":\n keyName = \"delete\", keyCtrl2 = !0;\n break;\n case \"[5^\":\n keyName = \"pageup\", keyCtrl2 = !0;\n break;\n case \"[6^\":\n keyName = \"pagedown\", keyCtrl2 = !0;\n break;\n case \"[7^\":\n keyName = \"home\", keyCtrl2 = !0;\n break;\n case \"[8^\":\n keyName = \"end\", keyCtrl2 = !0;\n break;\n case \"[Z\":\n keyName = \"tab\", keyShift = !0;\n break;\n default:\n keyName = \"undefined\";\n break;\n }\n } else if (ch === \"\\r\")\n keyName = \"return\", keyMeta = escaped;\n else if (ch === \"\\n\")\n keyName = \"enter\", keyMeta = escaped;\n else if (ch === \"\\t\")\n keyName = \"tab\", keyMeta = escaped;\n else if (ch === \"\\b\" || ch === \"\\x7F\")\n keyName = \"backspace\", keyMeta = escaped;\n else if (ch === kEscape)\n keyName = \"escape\", keyMeta = escaped;\n else if (ch === \" \")\n keyName = \"space\", keyMeta = escaped;\n else if (!escaped && ch <= \"\\x1A\")\n keyName = StringFromCharCode(StringPrototypeCharCodeAt.@call(ch) + StringPrototypeCharCodeAt.@call(\"a\") - 1), keyCtrl2 = !0;\n else if (RegExpPrototypeExec.@call(/^[0-9A-Za-z]$/, ch) !== null)\n keyName = StringPrototypeToLowerCase.@call(ch), keyShift = RegExpPrototypeExec.@call(/^[A-Z]$/, ch) !== null, keyMeta = escaped;\n else if (escaped)\n keyName = ch.length \? @undefined : \"escape\", keyMeta = !0;\n else\n keyName = @undefined;\n if (keySeq = s, s.length !== 0 && (keyName !== @undefined || escaped))\n stream.emit(\"keypress\", escaped \? @undefined : s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n else if (charLengthAt(s, 0) === s.length)\n stream.emit(\"keypress\", s, {\n sequence: keySeq,\n name: keyName,\n ctrl: keyCtrl2,\n meta: keyMeta,\n shift: keyShift\n });\n }\n}\nvar commonPrefix = function(strings) {\n if (strings.length === 0)\n return \"\";\n if (strings.length === 1)\n return strings[0];\n var sorted = ArrayPrototypeSort.@call(ArrayPrototypeSlice.@call(strings)), min = sorted[0], max = sorted[sorted.length - 1];\n for (var i = 0;i < min.length; i++)\n if (min[i] !== max[i])\n return StringPrototypeSlice.@call(min, 0, i);\n return min;\n}, cursorTo = function(stream, x, y, callback) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\");\n if (typeof y === \"function\")\n callback = y, y = @undefined;\n if (NumberIsNaN(x))\n throw new ERR_INVALID_ARG_VALUE(\"x\", x);\n if (NumberIsNaN(y))\n throw new ERR_INVALID_ARG_VALUE(\"y\", y);\n if (stream == null || typeof x !== \"number\" && typeof y !== \"number\") {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n if (typeof x !== \"number\")\n throw new ERR_INVALID_CURSOR_POS;\n var data = typeof y !== \"number\" \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n return stream.write(data, callback);\n}, moveCursor = function(stream, dx, dy, callback) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\");\n if (stream == null || !(dx || dy)) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n return stream.write(data, callback);\n}, clearLine = function(stream, dir, callback) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === @undefined) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n var type = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n return stream.write(type, callback);\n}, clearScreenDown = function(stream, callback) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\");\n if (stream === null || stream === @undefined) {\n if (typeof callback === \"function\")\n process.nextTick(callback, null);\n return !0;\n }\n return stream.write(kClearScreenDown, callback);\n}, emitKeypressEvents = function(stream, iface = {}) {\n if (stream[KEYPRESS_DECODER])\n return;\n stream[KEYPRESS_DECODER] = new StringDecoder(\"utf8\"), stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next();\n var triggerEscape = () => stream[ESCAPE_DECODER].next(\"\"), { escapeCodeTimeout = ESCAPE_CODE_TIMEOUT } = iface, timeoutId;\n function onData(input) {\n if (stream.listenerCount(\"keypress\") > 0) {\n var string = stream[KEYPRESS_DECODER].write(input);\n if (string) {\n clearTimeout(timeoutId), iface[kSawKeyPress] = charLengthAt(string, 0) === string.length, iface.isCompletionEnabled = !1;\n var length = 0;\n for (var character of new SafeStringIterator(string)) {\n if (length += character.length, length === string.length)\n iface.isCompletionEnabled = !0;\n try {\n if (stream[ESCAPE_DECODER].next(character), length === string.length && character === kEscape)\n timeoutId = setTimeout(triggerEscape, escapeCodeTimeout);\n } catch (err) {\n throw stream[ESCAPE_DECODER] = emitKeys(stream), stream[ESCAPE_DECODER].next(), err;\n }\n }\n }\n } else\n stream.removeListener(\"data\", onData), stream.on(\"newListener\", onNewListener);\n }\n function onNewListener(event) {\n if (event === \"keypress\")\n stream.on(\"data\", onData), stream.removeListener(\"newListener\", onNewListener);\n }\n if (stream.listenerCount(\"keypress\") > 0)\n stream.on(\"data\", onData);\n else\n stream.on(\"newListener\", onNewListener);\n}, onSelfCloseWithTerminal = function() {\n var input = this.input, output = this.output;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n if (input.removeListener(\"keypress\", this[kOnKeyPress]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnTermEnd]), output !== null && output !== @undefined)\n output.removeListener(\"resize\", this[kOnResize]);\n}, onSelfCloseWithoutTerminal = function() {\n var input = this.input;\n if (!input)\n throw new Error(\"Input not set, invalid state for readline!\");\n input.removeListener(\"data\", this[kOnData]), input.removeListener(\"error\", this[kOnError]), input.removeListener(\"end\", this[kOnEnd]);\n}, onError = function(err) {\n this.emit(\"error\", err);\n}, onData = function(data) {\n debug(\"onData\"), this[kNormalWrite](data);\n}, onEnd = function() {\n if (debug(\"onEnd\"), typeof this[kLine_buffer] === \"string\" && this[kLine_buffer].length > 0)\n this.emit(\"line\", this[kLine_buffer]);\n this.close();\n}, onTermEnd = function() {\n if (debug(\"onTermEnd\"), typeof this.line === \"string\" && this.line.length > 0)\n this.emit(\"line\", this.line);\n this.close();\n}, onKeyPress = function(s, key) {\n if (this[kTtyWrite](s, key), key && key.sequence) {\n var ch = StringPrototypeCodePointAt.@call(key.sequence, 0);\n if (ch >= 55296 && ch <= 57343)\n this[kRefreshLine]();\n }\n}, onResize = function() {\n this[kRefreshLine]();\n}, InterfaceConstructor = function(input, output, completer, terminal) {\n if (!(this instanceof InterfaceConstructor))\n return new InterfaceConstructor(input, output, completer, terminal);\n EventEmitter.@call(this), this[kOnSelfCloseWithoutTerminal] = onSelfCloseWithoutTerminal.bind(this), this[kOnSelfCloseWithTerminal] = onSelfCloseWithTerminal.bind(this), this[kOnError] = onError.bind(this), this[kOnData] = onData.bind(this), this[kOnEnd] = onEnd.bind(this), this[kOnTermEnd] = onTermEnd.bind(this), this[kOnKeyPress] = onKeyPress.bind(this), this[kOnResize] = onResize.bind(this), this[kSawReturnAt] = 0, this.isCompletionEnabled = !0, this[kSawKeyPress] = !1, this[kPreviousKey] = null, this.escapeCodeTimeout = ESCAPE_CODE_TIMEOUT, this.tabSize = 8;\n var history, historySize, removeHistoryDuplicates = !1, crlfDelay, prompt = \"> \", signal;\n if (input\?.input) {\n output = input.output, completer = input.completer, terminal = input.terminal, history = input.history, historySize = input.historySize, signal = input.signal;\n var tabSize = input.tabSize;\n if (tabSize !== @undefined)\n validateUint32(tabSize, \"tabSize\", !0), this.tabSize = tabSize;\n removeHistoryDuplicates = input.removeHistoryDuplicates;\n var inputPrompt = input.prompt;\n if (inputPrompt !== @undefined)\n prompt = inputPrompt;\n var inputEscapeCodeTimeout = input.escapeCodeTimeout;\n if (inputEscapeCodeTimeout !== @undefined)\n if (NumberIsFinite(inputEscapeCodeTimeout))\n this.escapeCodeTimeout = inputEscapeCodeTimeout;\n else\n throw new ERR_INVALID_ARG_VALUE(\"input.escapeCodeTimeout\", this.escapeCodeTimeout);\n if (signal)\n validateAbortSignal(signal, \"options.signal\");\n crlfDelay = input.crlfDelay, input = input.input;\n }\n if (completer !== @undefined && typeof completer !== \"function\")\n throw new ERR_INVALID_ARG_VALUE(\"completer\", completer);\n if (history === @undefined)\n history = [];\n else\n validateArray(history, \"history\");\n if (historySize === @undefined)\n historySize = kHistorySize;\n if (typeof historySize !== \"number\" || NumberIsNaN(historySize) || historySize < 0)\n throw new ERR_INVALID_ARG_VALUE(\"historySize\", historySize);\n if (terminal === @undefined && !(output === null || output === @undefined))\n terminal = !!output.isTTY;\n if (this.line = \"\", this[kSubstringSearch] = null, this.output = output, this.input = input, this[kUndoStack] = [], this[kRedoStack] = [], this.history = history, this.historySize = historySize, this[kKillRing] = [], this[kKillRingCursor] = 0, this.removeHistoryDuplicates = !!removeHistoryDuplicates, this.crlfDelay = crlfDelay \? MathMax(kMincrlfDelay, crlfDelay) : kMincrlfDelay, this.completer = completer, this.setPrompt(prompt), this.terminal = !!terminal, this[kLineObjectStream] = @undefined, input.on(\"error\", this[kOnError]), !this.terminal)\n input.on(\"data\", this[kOnData]), input.on(\"end\", this[kOnEnd]), this.once(\"close\", this[kOnSelfCloseWithoutTerminal]), this[kDecoder] = new StringDecoder(\"utf8\");\n else {\n if (emitKeypressEvents(input, this), input.on(\"keypress\", this[kOnKeyPress]), input.on(\"end\", this[kOnTermEnd]), this[kSetRawMode](!0), this.terminal = !0, this.cursor = 0, this.historyIndex = -1, output !== null && output !== @undefined)\n output.on(\"resize\", this[kOnResize]);\n this.once(\"close\", this[kOnSelfCloseWithTerminal]);\n }\n if (signal) {\n var onAborted = (() => this.close()).bind(this);\n if (signal.aborted)\n process.nextTick(onAborted);\n else\n signal.addEventListener(\"abort\", onAborted, { once: !0 }), this.once(\"close\", () => signal.removeEventListener(\"abort\", onAborted));\n }\n this.line = \"\", input.resume();\n}, Interface = function(input, output, completer, terminal) {\n if (!(this instanceof Interface))\n return new Interface(input, output, completer, terminal);\n if (input\?.input && typeof input.completer === \"function\" && input.completer.length !== 2) {\n var { completer } = input;\n input.completer = (v, cb) => cb(null, completer(v));\n } else if (typeof completer === \"function\" && completer.length !== 2) {\n var realCompleter = completer;\n completer = (v, cb) => cb(null, realCompleter(v));\n }\n InterfaceConstructor.@call(this, input, output, completer, terminal);\n}, createInterface = function(input, output, completer, terminal) {\n return new Interface(input, output, completer, terminal);\n};\nvar $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { StringDecoder } = @requireNativeModule(\"string_decoder\"), isWritable, { inspect } = Bun, debug = process.env.BUN_JS_DEBUG \? console.log : () => {\n}, SymbolAsyncIterator = Symbol.asyncIterator, SymbolIterator = Symbol.iterator, SymbolFor = Symbol.for, SymbolReplace = Symbol.replace, ArrayFrom = @Array.from, ArrayIsArray = @Array.isArray, ArrayPrototypeFilter = @Array.prototype.filter, ArrayPrototypeSort = @Array.prototype.sort, ArrayPrototypeIndexOf = @Array.prototype.indexOf, ArrayPrototypeJoin = @Array.prototype.join, ArrayPrototypeMap = @Array.prototype.map, ArrayPrototypePop = @Array.prototype.pop, ArrayPrototypePush = @Array.prototype.push, ArrayPrototypeSlice = @Array.prototype.slice, ArrayPrototypeSplice = @Array.prototype.splice, ArrayPrototypeReverse = @Array.prototype.reverse, ArrayPrototypeShift = @Array.prototype.shift, ArrayPrototypeUnshift = @Array.prototype.unshift, RegExpPrototypeExec = @RegExp.prototype.exec, RegExpPrototypeSymbolReplace = @RegExp.prototype[SymbolReplace], StringFromCharCode = @String.fromCharCode, StringPrototypeCharCodeAt = @String.prototype.charCodeAt, StringPrototypeCodePointAt = @String.prototype.codePointAt, StringPrototypeSlice = @String.prototype.slice, StringPrototypeToLowerCase = @String.prototype.toLowerCase, StringPrototypeEndsWith = @String.prototype.endsWith, StringPrototypeRepeat = @String.prototype.repeat, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeTrim = @String.prototype.trim, StringPrototypeNormalize = @String.prototype.normalize, NumberIsNaN = Number.isNaN, NumberIsFinite = Number.isFinite, NumberIsInteger = Number.isInteger, NumberMAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER, NumberMIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER, MathCeil = Math.ceil, MathFloor = Math.floor, MathMax = Math.max, DateNow = Date.now, FunctionPrototype = Function.prototype, StringPrototype = @String.prototype, StringPrototypeSymbolIterator = StringPrototype[SymbolIterator], StringIteratorPrototypeNext = StringPrototypeSymbolIterator.@call(\"\").next, ObjectSetPrototypeOf = Object.setPrototypeOf, ObjectDefineProperty = Object.defineProperty, ObjectDefineProperties = Object.defineProperties, ObjectFreeze = Object.freeze;\nvar { create: ObjectCreate, keys: ObjectKeys } = Object;\nvar createSafeIterator = (factory, next) => {\n class SafeIterator {\n #iterator;\n constructor(iterable) {\n this.#iterator = factory.@call(iterable);\n }\n next() {\n return next.@call(this.#iterator);\n }\n [SymbolIterator]() {\n return this;\n }\n }\n return ObjectSetPrototypeOf(SafeIterator.prototype, null), ObjectFreeze(SafeIterator.prototype), ObjectFreeze(SafeIterator), SafeIterator;\n}, SafeStringIterator = createSafeIterator(StringPrototypeSymbolIterator, StringIteratorPrototypeNext), isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n}, isZeroWidthCodePoint = (code) => {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n}, getStringWidth = function getStringWidth2(str, removeControlChars = !0) {\n var width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize.@call(str, \"NFC\");\n for (var char of new SafeStringIterator(str)) {\n var code = StringPrototypeCodePointAt.@call(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n}, ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new @RegExp(ansiPattern, \"g\"), kCustomPromisifiedSymbol = SymbolFor(\"nodejs.util.promisify.custom\"), kCustomPromisifyArgsSymbol = Symbol(\"customPromisifyArgs\");\npromisify.custom = kCustomPromisifiedSymbol;\nvar kUTF16SurrogateThreshold = 65536, kEscape = \"\\x1B\", kSubstringSearch = Symbol(\"kSubstringSearch\"), kIsNodeError = Symbol(\"kIsNodeError\"), errorBases = {}, VALID_NODE_ERROR_BASES = {\n TypeError,\n RangeError,\n Error\n}, NodeError = getNodeErrorByName(\"Error\"), NodeTypeError = getNodeErrorByName(\"TypeError\"), NodeRangeError = getNodeErrorByName(\"RangeError\");\n\nclass ERR_INVALID_ARG_TYPE extends NodeTypeError {\n constructor(name, type, value) {\n super(`The \"${name}\" argument must be of type ${type}. Received type ${typeof value}`, {\n code: \"ERR_INVALID_ARG_TYPE\"\n });\n }\n}\n\nclass ERR_INVALID_ARG_VALUE extends NodeTypeError {\n constructor(name, value, reason = \"not specified\") {\n super(`The value \"${@String(value)}\" is invalid for argument '${name}'. Reason: ${reason}`, {\n code: \"ERR_INVALID_ARG_VALUE\"\n });\n }\n}\n\nclass ERR_INVALID_CURSOR_POS extends NodeTypeError {\n constructor() {\n super(\"Cannot set cursor row without setting its column\", {\n code: \"ERR_INVALID_CURSOR_POS\"\n });\n }\n}\n\nclass ERR_OUT_OF_RANGE extends NodeRangeError {\n constructor(name, range, received) {\n super(`The value of \"${name}\" is out of range. It must be ${range}. Received ${received}`, {\n code: \"ERR_OUT_OF_RANGE\"\n });\n }\n}\n\nclass ERR_USE_AFTER_CLOSE extends NodeError {\n constructor() {\n super(\"This socket has been ended by the other party\", {\n code: \"ERR_USE_AFTER_CLOSE\"\n });\n }\n}\n\nclass AbortError extends Error {\n code;\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\nvar kClearLine, kClearScreenDown, kClearToLineBeginning, kClearToLineEnd;\nCSI.kEscape = kEscape;\nCSI.kClearLine = kClearLine = CSI`2K`;\nCSI.kClearScreenDown = kClearScreenDown = CSI`0J`;\nCSI.kClearToLineBeginning = kClearToLineBeginning = CSI`1K`;\nCSI.kClearToLineEnd = kClearToLineEnd = CSI`0K`;\nvar KEYPRESS_DECODER = Symbol(\"keypress-decoder\"), ESCAPE_DECODER = Symbol(\"escape-decoder\"), ESCAPE_CODE_TIMEOUT = 500, kEmptyObject = ObjectFreeze(ObjectCreate(null)), kHistorySize = 30, kMaxUndoRedoStackSize = 2048, kMincrlfDelay = 100, lineEnding = /\\r\?\\n|\\r(\?!\\n)/g, kMaxLengthOfKillRing = 32, kLineObjectStream = Symbol(\"line object stream\"), kQuestionCancel = Symbol(\"kQuestionCancel\"), kQuestion = Symbol(\"kQuestion\"), kAddHistory = Symbol(\"_addHistory\"), kBeforeEdit = Symbol(\"_beforeEdit\"), kDecoder = Symbol(\"_decoder\"), kDeleteLeft = Symbol(\"_deleteLeft\"), kDeleteLineLeft = Symbol(\"_deleteLineLeft\"), kDeleteLineRight = Symbol(\"_deleteLineRight\"), kDeleteRight = Symbol(\"_deleteRight\"), kDeleteWordLeft = Symbol(\"_deleteWordLeft\"), kDeleteWordRight = Symbol(\"_deleteWordRight\"), kGetDisplayPos = Symbol(\"_getDisplayPos\"), kHistoryNext = Symbol(\"_historyNext\"), kHistoryPrev = Symbol(\"_historyPrev\"), kInsertString = Symbol(\"_insertString\"), kLine = Symbol(\"_line\"), kLine_buffer = Symbol(\"_line_buffer\"), kKillRing = Symbol(\"_killRing\"), kKillRingCursor = Symbol(\"_killRingCursor\"), kMoveCursor = Symbol(\"_moveCursor\"), kNormalWrite = Symbol(\"_normalWrite\"), kOldPrompt = Symbol(\"_oldPrompt\"), kOnLine = Symbol(\"_onLine\"), kPreviousKey = Symbol(\"_previousKey\"), kPrompt = Symbol(\"_prompt\"), kPushToKillRing = Symbol(\"_pushToKillRing\"), kPushToUndoStack = Symbol(\"_pushToUndoStack\"), kQuestionCallback = Symbol(\"_questionCallback\"), kRedo = Symbol(\"_redo\"), kRedoStack = Symbol(\"_redoStack\"), kRefreshLine = Symbol(\"_refreshLine\"), kSawKeyPress = Symbol(\"_sawKeyPress\"), kSawReturnAt = Symbol(\"_sawReturnAt\"), kSetRawMode = Symbol(\"_setRawMode\"), kTabComplete = Symbol(\"_tabComplete\"), kTabCompleter = Symbol(\"_tabCompleter\"), kTtyWrite = Symbol(\"_ttyWrite\"), kUndo = Symbol(\"_undo\"), kUndoStack = Symbol(\"_undoStack\"), kWordLeft = Symbol(\"_wordLeft\"), kWordRight = Symbol(\"_wordRight\"), kWriteToOutput = Symbol(\"_writeToOutput\"), kYank = Symbol(\"_yank\"), kYanking = Symbol(\"_yanking\"), kYankPop = Symbol(\"_yankPop\"), kFirstEventParam = Symbol(\"nodejs.kFirstEventParam\"), kOnSelfCloseWithTerminal = Symbol(\"_onSelfCloseWithTerminal\"), kOnSelfCloseWithoutTerminal = Symbol(\"_onSelfCloseWithoutTerminal\"), kOnKeyPress = Symbol(\"_onKeyPress\"), kOnError = Symbol(\"_onError\"), kOnData = Symbol(\"_onData\"), kOnEnd = Symbol(\"_onEnd\"), kOnTermEnd = Symbol(\"_onTermEnd\"), kOnResize = Symbol(\"_onResize\");\nInterfaceConstructor.prototype = {};\nObjectSetPrototypeOf(InterfaceConstructor.prototype, EventEmitter.prototype);\nvar _Interface = class Interface2 extends InterfaceConstructor {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n get columns() {\n var output = this.output;\n if (output && output.columns)\n return output.columns;\n return @Infinity;\n }\n setPrompt(prompt) {\n this[kPrompt] = prompt;\n }\n getPrompt() {\n return this[kPrompt];\n }\n [kSetRawMode](flag) {\n const mode = flag + 0, wasInRawMode = this.input.isRaw;\n var setRawMode = this.input.setRawMode;\n if (typeof setRawMode === \"function\")\n setRawMode.@call(this.input, mode);\n return wasInRawMode;\n }\n prompt(preserveCursor) {\n if (this.paused)\n this.resume();\n if (this.terminal) {\n if (!preserveCursor)\n this.cursor = 0;\n this[kRefreshLine]();\n } else\n this[kWriteToOutput](this[kPrompt]);\n }\n [kQuestion](query, cb) {\n if (this.closed)\n throw new ERR_USE_AFTER_CLOSE(\"readline\");\n if (this[kQuestionCallback])\n this.prompt();\n else\n this[kOldPrompt] = this[kPrompt], this.setPrompt(query), this[kQuestionCallback] = cb, this.prompt();\n }\n [kOnLine](line) {\n if (this[kQuestionCallback]) {\n var cb = this[kQuestionCallback];\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), cb(line);\n } else\n this.emit(\"line\", line);\n }\n [kBeforeEdit](oldText, oldCursor) {\n this[kPushToUndoStack](oldText, oldCursor);\n }\n [kQuestionCancel]() {\n if (this[kQuestionCallback])\n this[kQuestionCallback] = null, this.setPrompt(this[kOldPrompt]), this.clearLine();\n }\n [kWriteToOutput](stringToWrite) {\n if (validateString(stringToWrite, \"stringToWrite\"), this.output !== null && this.output !== @undefined)\n this.output.write(stringToWrite);\n }\n [kAddHistory]() {\n if (this.line.length === 0)\n return \"\";\n if (this.historySize === 0)\n return this.line;\n if (StringPrototypeTrim.@call(this.line).length === 0)\n return this.line;\n if (this.history.length === 0 || this.history[0] !== this.line) {\n if (this.removeHistoryDuplicates) {\n var dupIndex = ArrayPrototypeIndexOf.@call(this.history, this.line);\n if (dupIndex !== -1)\n ArrayPrototypeSplice.@call(this.history, dupIndex, 1);\n }\n if (ArrayPrototypeUnshift.@call(this.history, this.line), this.history.length > this.historySize)\n ArrayPrototypePop.@call(this.history);\n }\n this.historyIndex = -1;\n var line = this.history[0];\n return this.emit(\"history\", this.history), line;\n }\n [kRefreshLine]() {\n var line = this[kPrompt] + this.line, dispPos = this[kGetDisplayPos](line), lineCols = dispPos.cols, lineRows = dispPos.rows, cursorPos = this.getCursorPos(), prevRows = this.prevRows || 0;\n if (prevRows > 0)\n moveCursor(this.output, 0, -prevRows);\n if (cursorTo(this.output, 0), clearScreenDown(this.output), this[kWriteToOutput](line), lineCols === 0)\n this[kWriteToOutput](\" \");\n cursorTo(this.output, cursorPos.cols);\n var diff = lineRows - cursorPos.rows;\n if (diff > 0)\n moveCursor(this.output, 0, -diff);\n this.prevRows = cursorPos.rows;\n }\n close() {\n if (this.closed)\n return;\n if (this.pause(), this.terminal)\n this[kSetRawMode](!1);\n this.closed = !0, this.emit(\"close\");\n }\n pause() {\n if (this.paused)\n return;\n return this.input.pause(), this.paused = !0, this.emit(\"pause\"), this;\n }\n resume() {\n if (!this.paused)\n return;\n return this.input.resume(), this.paused = !1, this.emit(\"resume\"), this;\n }\n write(d, key) {\n if (this.paused)\n this.resume();\n if (this.terminal)\n this[kTtyWrite](d, key);\n else\n this[kNormalWrite](d);\n }\n [kNormalWrite](b) {\n if (b === @undefined)\n return;\n var string = this[kDecoder].write(b);\n if (this[kSawReturnAt] && DateNow() - this[kSawReturnAt] <= this.crlfDelay) {\n if (StringPrototypeCodePointAt.@call(string) === 10)\n string = StringPrototypeSlice.@call(string, 1);\n this[kSawReturnAt] = 0;\n }\n var newPartContainsEnding = RegExpPrototypeExec.@call(lineEnding, string);\n if (newPartContainsEnding !== null) {\n if (this[kLine_buffer])\n string = this[kLine_buffer] + string, this[kLine_buffer] = null, newPartContainsEnding = RegExpPrototypeExec.@call(lineEnding, string);\n this[kSawReturnAt] = StringPrototypeEndsWith.@call(string, \"\\r\") \? DateNow() : 0;\n var indexes = [0, newPartContainsEnding.index, lineEnding.lastIndex], nextMatch;\n while ((nextMatch = RegExpPrototypeExec.@call(lineEnding, string)) !== null)\n ArrayPrototypePush.@call(indexes, nextMatch.index, lineEnding.lastIndex);\n var lastIndex = indexes.length - 1;\n this[kLine_buffer] = StringPrototypeSlice.@call(string, indexes[lastIndex]);\n for (var i = 1;i < lastIndex; i += 2)\n this[kOnLine](StringPrototypeSlice.@call(string, indexes[i - 1], indexes[i]));\n } else if (string)\n if (this[kLine_buffer])\n this[kLine_buffer] += string;\n else\n this[kLine_buffer] = string;\n }\n [kInsertString](c) {\n if (this[kBeforeEdit](this.line, this.cursor), this.cursor < this.line.length) {\n var beg = StringPrototypeSlice.@call(this.line, 0, this.cursor), end = StringPrototypeSlice.@call(this.line, this.cursor, this.line.length);\n this.line = beg + c + end, this.cursor += c.length, this[kRefreshLine]();\n } else {\n var oldPos = this.getCursorPos();\n this.line += c, this.cursor += c.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows < newPos.rows)\n this[kRefreshLine]();\n else\n this[kWriteToOutput](c);\n }\n }\n async[kTabComplete](lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.@call(this.line, 0, this.cursor), value;\n try {\n value = await this.completer(string);\n } catch (err) {\n this[kWriteToOutput](`Tab completion error: ${inspect(err)}`);\n return;\n } finally {\n this.resume();\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n }\n [kTabCompleter](lastKeypressWasTab, { 0: completions, 1: completeOn }) {\n if (!completions || completions.length === 0)\n return;\n var prefix = commonPrefix(ArrayPrototypeFilter.@call(completions, (e) => e !== \"\"));\n if (StringPrototypeStartsWith.@call(prefix, completeOn) && prefix.length > completeOn.length) {\n this[kInsertString](StringPrototypeSlice.@call(prefix, completeOn.length));\n return;\n } else if (!StringPrototypeStartsWith.@call(completeOn, prefix)) {\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor - completeOn.length) + prefix + StringPrototypeSlice.@call(this.line, this.cursor, this.line.length), this.cursor = this.cursor - completeOn.length + prefix.length, this._refreshLine();\n return;\n }\n if (!lastKeypressWasTab)\n return;\n this[kBeforeEdit](this.line, this.cursor);\n var completionsWidth = ArrayPrototypeMap.@call(completions, (e) => getStringWidth(e)), width = MathMax.@apply(completionsWidth) + 2, maxColumns = MathFloor(this.columns / width) || 1;\n if (maxColumns === @Infinity)\n maxColumns = 1;\n var output = \"\\r\\n\", lineIndex = 0, whitespace = 0;\n for (var i = 0;i < completions.length; i++) {\n var completion = completions[i];\n if (completion === \"\" || lineIndex === maxColumns)\n output += \"\\r\\n\", lineIndex = 0, whitespace = 0;\n else\n output += StringPrototypeRepeat.@call(\" \", whitespace);\n if (completion !== \"\")\n output += completion, whitespace = width - completionsWidth[i], lineIndex++;\n else\n output += \"\\r\\n\";\n }\n if (lineIndex !== 0)\n output += \"\\r\\n\\r\\n\";\n this[kWriteToOutput](output), this[kRefreshLine]();\n }\n [kWordLeft]() {\n if (this.cursor > 0) {\n var leading = StringPrototypeSlice.@call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.@call(ArrayPrototypeReverse.@call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.@call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n this[kMoveCursor](-match[0].length);\n }\n }\n [kWordRight]() {\n if (this.cursor < this.line.length) {\n var trailing = StringPrototypeSlice.@call(this.line, this.cursor), match = RegExpPrototypeExec.@call(/^(\?:\\s+|[^\\w\\s]+|\\w+)\\s*/, trailing);\n this[kMoveCursor](match[0].length);\n }\n }\n [kDeleteLeft]() {\n if (this.cursor > 0 && this.line.length > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthLeft(this.line, this.cursor);\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor - charSize) + StringPrototypeSlice.@call(this.line, this.cursor, this.line.length), this.cursor -= charSize, this[kRefreshLine]();\n }\n }\n [kDeleteRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var charSize = charLengthAt(this.line, this.cursor);\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor) + StringPrototypeSlice.@call(this.line, this.cursor + charSize, this.line.length), this[kRefreshLine]();\n }\n }\n [kDeleteWordLeft]() {\n if (this.cursor > 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var leading = StringPrototypeSlice.@call(this.line, 0, this.cursor), reversed = ArrayPrototypeJoin.@call(ArrayPrototypeReverse.@call(ArrayFrom(leading)), \"\"), match = RegExpPrototypeExec.@call(/^\\s*(\?:[^\\w\\s]+|\\w+)\?/, reversed);\n leading = StringPrototypeSlice.@call(leading, 0, leading.length - match[0].length), this.line = leading + StringPrototypeSlice.@call(this.line, this.cursor, this.line.length), this.cursor = leading.length, this[kRefreshLine]();\n }\n }\n [kDeleteWordRight]() {\n if (this.cursor < this.line.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var trailing = StringPrototypeSlice.@call(this.line, this.cursor), match = RegExpPrototypeExec.@call(/^(\?:\\s+|\\W+|\\w+)\\s*/, trailing);\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor) + StringPrototypeSlice.@call(trailing, match[0].length), this[kRefreshLine]();\n }\n }\n [kDeleteLineLeft]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.@call(this.line, 0, this.cursor);\n this.line = StringPrototypeSlice.@call(this.line, this.cursor), this.cursor = 0, this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kDeleteLineRight]() {\n this[kBeforeEdit](this.line, this.cursor);\n var del = StringPrototypeSlice.@call(this.line, this.cursor);\n this.line = StringPrototypeSlice.@call(this.line, 0, this.cursor), this[kPushToKillRing](del), this[kRefreshLine]();\n }\n [kPushToKillRing](del) {\n if (!del || del === this[kKillRing][0])\n return;\n ArrayPrototypeUnshift.@call(this[kKillRing], del), this[kKillRingCursor] = 0;\n while (this[kKillRing].length > kMaxLengthOfKillRing)\n ArrayPrototypePop.@call(this[kKillRing]);\n }\n [kYank]() {\n if (this[kKillRing].length > 0)\n this[kYanking] = !0, this[kInsertString](this[kKillRing][this[kKillRingCursor]]);\n }\n [kYankPop]() {\n if (!this[kYanking])\n return;\n if (this[kKillRing].length > 1) {\n var lastYank = this[kKillRing][this[kKillRingCursor]];\n if (this[kKillRingCursor]++, this[kKillRingCursor] >= this[kKillRing].length)\n this[kKillRingCursor] = 0;\n var currentYank = this[kKillRing][this[kKillRingCursor]], head = StringPrototypeSlice.@call(this.line, 0, this.cursor - lastYank.length), tail = StringPrototypeSlice.@call(this.line, this.cursor);\n this.line = head + currentYank + tail, this.cursor = head.length + currentYank.length, this[kRefreshLine]();\n }\n }\n clearLine() {\n this[kMoveCursor](+@Infinity), this[kWriteToOutput](\"\\r\\n\"), this.line = \"\", this.cursor = 0, this.prevRows = 0;\n }\n [kLine]() {\n var line = this[kAddHistory]();\n this[kUndoStack] = [], this[kRedoStack] = [], this.clearLine(), this[kOnLine](line);\n }\n [kPushToUndoStack](text, cursor) {\n if (ArrayPrototypePush.@call(this[kUndoStack], { text, cursor }) > kMaxUndoRedoStackSize)\n ArrayPrototypeShift.@call(this[kUndoStack]);\n }\n [kUndo]() {\n if (this[kUndoStack].length <= 0)\n return;\n ArrayPrototypePush.@call(this[kRedoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.@call(this[kUndoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kRedo]() {\n if (this[kRedoStack].length <= 0)\n return;\n ArrayPrototypePush.@call(this[kUndoStack], {\n text: this.line,\n cursor: this.cursor\n });\n var entry = ArrayPrototypePop.@call(this[kRedoStack]);\n this.line = entry.text, this.cursor = entry.cursor, this[kRefreshLine]();\n }\n [kHistoryNext]() {\n if (this.historyIndex >= 0) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex - 1;\n while (index >= 0 && (!StringPrototypeStartsWith.@call(this.history[index], search) || this.line === this.history[index]))\n index--;\n if (index === -1)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kHistoryPrev]() {\n if (this.historyIndex < this.history.length && this.history.length) {\n this[kBeforeEdit](this.line, this.cursor);\n var search = this[kSubstringSearch] || \"\", index = this.historyIndex + 1;\n while (index < this.history.length && (!StringPrototypeStartsWith.@call(this.history[index], search) || this.line === this.history[index]))\n index++;\n if (index === this.history.length)\n this.line = search;\n else\n this.line = this.history[index];\n this.historyIndex = index, this.cursor = this.line.length, this[kRefreshLine]();\n }\n }\n [kGetDisplayPos](str) {\n var offset = 0, col = this.columns, rows = 0;\n str = stripVTControlCharacters(str);\n for (var char of new SafeStringIterator(str)) {\n if (char === \"\\n\") {\n rows += MathCeil(offset / col) || 1, offset = 0;\n continue;\n }\n if (char === \"\\t\") {\n offset += this.tabSize - offset % this.tabSize;\n continue;\n }\n var width = getStringWidth(char, !1);\n if (width === 0 || width === 1)\n offset += width;\n else {\n if ((offset + 1) % col === 0)\n offset++;\n offset += 2;\n }\n }\n var cols = offset % col;\n return rows += (offset - cols) / col, { cols, rows };\n }\n getCursorPos() {\n var strBeforeCursor = this[kPrompt] + StringPrototypeSlice.@call(this.line, 0, this.cursor);\n return this[kGetDisplayPos](strBeforeCursor);\n }\n [kMoveCursor](dx) {\n if (dx === 0)\n return;\n var oldPos = this.getCursorPos();\n if (this.cursor += dx, this.cursor < 0)\n this.cursor = 0;\n else if (this.cursor > this.line.length)\n this.cursor = this.line.length;\n var newPos = this.getCursorPos();\n if (oldPos.rows === newPos.rows) {\n var diffWidth = newPos.cols - oldPos.cols;\n moveCursor(this.output, diffWidth, 0);\n } else\n this[kRefreshLine]();\n }\n [kTtyWrite](s, key) {\n var previousKey = this[kPreviousKey];\n key = key || kEmptyObject, this[kPreviousKey] = key;\n var { name: keyName, meta: keyMeta, ctrl: keyCtrl2, shift: keyShift, sequence: keySeq } = key;\n if (!keyMeta || keyName !== \"y\")\n this[kYanking] = !1;\n if ((keyName === \"up\" || keyName === \"down\") && !keyCtrl2 && !keyMeta && !keyShift) {\n if (this[kSubstringSearch] === null)\n this[kSubstringSearch] = StringPrototypeSlice.@call(this.line, 0, this.cursor);\n } else if (this[kSubstringSearch] !== null) {\n if (this[kSubstringSearch] = null, this.history.length === this.historyIndex)\n this.historyIndex = -1;\n }\n if (typeof keySeq === \"string\")\n switch (StringPrototypeCodePointAt.@call(keySeq, 0)) {\n case 31:\n this[kUndo]();\n return;\n case 30:\n this[kRedo]();\n return;\n default:\n break;\n }\n if (keyName === \"escape\")\n return;\n if (keyCtrl2 && keyShift)\n switch (keyName) {\n case \"backspace\":\n this[kDeleteLineLeft]();\n break;\n case \"delete\":\n this[kDeleteLineRight]();\n break;\n }\n else if (keyCtrl2)\n switch (keyName) {\n case \"c\":\n if (this.listenerCount(\"SIGINT\") > 0)\n this.emit(\"SIGINT\");\n else\n this.close();\n break;\n case \"h\":\n this[kDeleteLeft]();\n break;\n case \"d\":\n if (this.cursor === 0 && this.line.length === 0)\n this.close();\n else if (this.cursor < this.line.length)\n this[kDeleteRight]();\n break;\n case \"u\":\n this[kDeleteLineLeft]();\n break;\n case \"k\":\n this[kDeleteLineRight]();\n break;\n case \"a\":\n this[kMoveCursor](-@Infinity);\n break;\n case \"e\":\n this[kMoveCursor](+@Infinity);\n break;\n case \"b\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"f\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"l\":\n cursorTo(this.output, 0, 0), clearScreenDown(this.output), this[kRefreshLine]();\n break;\n case \"n\":\n this[kHistoryNext]();\n break;\n case \"p\":\n this[kHistoryPrev]();\n break;\n case \"y\":\n this[kYank]();\n break;\n case \"z\":\n if (this.listenerCount(\"SIGTSTP\") > 0)\n this.emit(\"SIGTSTP\");\n else\n process.once(\"SIGCONT\", () => {\n if (!this.paused)\n this.pause(), this.emit(\"SIGCONT\");\n this[kSetRawMode](!0), this[kRefreshLine]();\n }), this[kSetRawMode](!1), process.kill(process.pid, \"SIGTSTP\");\n break;\n case \"w\":\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"left\":\n this[kWordLeft]();\n break;\n case \"right\":\n this[kWordRight]();\n break;\n }\n else if (keyMeta)\n switch (keyName) {\n case \"b\":\n this[kWordLeft]();\n break;\n case \"f\":\n this[kWordRight]();\n break;\n case \"d\":\n case \"delete\":\n this[kDeleteWordRight]();\n break;\n case \"backspace\":\n this[kDeleteWordLeft]();\n break;\n case \"y\":\n this[kYankPop]();\n break;\n }\n else {\n if (this[kSawReturnAt] && keyName !== \"enter\")\n this[kSawReturnAt] = 0;\n switch (keyName) {\n case \"return\":\n this[kSawReturnAt] = DateNow(), this[kLine]();\n break;\n case \"enter\":\n if (this[kSawReturnAt] === 0 || DateNow() - this[kSawReturnAt] > this.crlfDelay)\n this[kLine]();\n this[kSawReturnAt] = 0;\n break;\n case \"backspace\":\n this[kDeleteLeft]();\n break;\n case \"delete\":\n this[kDeleteRight]();\n break;\n case \"left\":\n this[kMoveCursor](-charLengthLeft(this.line, this.cursor));\n break;\n case \"right\":\n this[kMoveCursor](+charLengthAt(this.line, this.cursor));\n break;\n case \"home\":\n this[kMoveCursor](-@Infinity);\n break;\n case \"end\":\n this[kMoveCursor](+@Infinity);\n break;\n case \"up\":\n this[kHistoryPrev]();\n break;\n case \"down\":\n this[kHistoryNext]();\n break;\n case \"tab\":\n if (typeof this.completer === \"function\" && this.isCompletionEnabled) {\n var lastKeypressWasTab = previousKey && previousKey.name === \"tab\";\n this[kTabComplete](lastKeypressWasTab);\n break;\n }\n default:\n if (typeof s === \"string\" && s) {\n var nextMatch = RegExpPrototypeExec.@call(lineEnding, s);\n if (nextMatch !== null) {\n this[kInsertString](StringPrototypeSlice.@call(s, 0, nextMatch.index));\n var { lastIndex } = lineEnding;\n while ((nextMatch = RegExpPrototypeExec.@call(lineEnding, s)) !== null)\n this[kLine](), this[kInsertString](StringPrototypeSlice.@call(s, lastIndex, nextMatch.index)), { lastIndex } = lineEnding;\n if (lastIndex === s.length)\n this[kLine]();\n } else\n this[kInsertString](s);\n }\n }\n }\n }\n [SymbolAsyncIterator]() {\n if (this[kLineObjectStream] === @undefined)\n this[kLineObjectStream] = EventEmitter.on(this, \"line\", {\n close: [\"close\"],\n highWatermark: 1024,\n [kFirstEventParam]: !0\n });\n return this[kLineObjectStream];\n }\n};\nInterface.prototype = {};\nObjectSetPrototypeOf(Interface.prototype, _Interface.prototype);\nObjectSetPrototypeOf(Interface, _Interface);\nInterface.prototype.question = function question(query, options, cb) {\n if (cb = typeof options === \"function\" \? options : cb, options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return;\n var onAbort = () => {\n this[kQuestionCancel]();\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 });\n var cleanup = () => {\n signal.removeEventListener(\"abort\", onAbort);\n }, originalCb = cb;\n cb = typeof cb === \"function\" \? (answer) => {\n return cleanup(), originalCb(answer);\n } : cleanup;\n }\n if (typeof cb === \"function\")\n this[kQuestion](query, cb);\n};\nInterface.prototype.question[promisify.custom] = function question2(query, options) {\n if (options === null || typeof options !== \"object\")\n options = kEmptyObject;\n var signal = options\?.signal;\n if (signal && signal.aborted)\n return PromiseReject(new AbortError(@undefined, { cause: signal.reason }));\n return new @Promise((resolve, reject) => {\n var cb = resolve;\n if (signal) {\n var onAbort = () => {\n reject(new AbortError(@undefined, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this.question(query, options, cb);\n });\n};\nObjectDefineProperties(Interface.prototype, {\n [kSetRawMode]: {\n __proto__: null,\n get() {\n return this._setRawMode;\n }\n },\n [kOnLine]: {\n __proto__: null,\n get() {\n return this._onLine;\n }\n },\n [kWriteToOutput]: {\n __proto__: null,\n get() {\n return this._writeToOutput;\n }\n },\n [kAddHistory]: {\n __proto__: null,\n get() {\n return this._addHistory;\n }\n },\n [kRefreshLine]: {\n __proto__: null,\n get() {\n return this._refreshLine;\n }\n },\n [kNormalWrite]: {\n __proto__: null,\n get() {\n return this._normalWrite;\n }\n },\n [kInsertString]: {\n __proto__: null,\n get() {\n return this._insertString;\n }\n },\n [kTabComplete]: {\n __proto__: null,\n get() {\n return this._tabComplete;\n }\n },\n [kWordLeft]: {\n __proto__: null,\n get() {\n return this._wordLeft;\n }\n },\n [kWordRight]: {\n __proto__: null,\n get() {\n return this._wordRight;\n }\n },\n [kDeleteLeft]: {\n __proto__: null,\n get() {\n return this._deleteLeft;\n }\n },\n [kDeleteRight]: {\n __proto__: null,\n get() {\n return this._deleteRight;\n }\n },\n [kDeleteWordLeft]: {\n __proto__: null,\n get() {\n return this._deleteWordLeft;\n }\n },\n [kDeleteWordRight]: {\n __proto__: null,\n get() {\n return this._deleteWordRight;\n }\n },\n [kDeleteLineLeft]: {\n __proto__: null,\n get() {\n return this._deleteLineLeft;\n }\n },\n [kDeleteLineRight]: {\n __proto__: null,\n get() {\n return this._deleteLineRight;\n }\n },\n [kLine]: {\n __proto__: null,\n get() {\n return this._line;\n }\n },\n [kHistoryNext]: {\n __proto__: null,\n get() {\n return this._historyNext;\n }\n },\n [kHistoryPrev]: {\n __proto__: null,\n get() {\n return this._historyPrev;\n }\n },\n [kGetDisplayPos]: {\n __proto__: null,\n get() {\n return this._getDisplayPos;\n }\n },\n [kMoveCursor]: {\n __proto__: null,\n get() {\n return this._moveCursor;\n }\n },\n [kTtyWrite]: {\n __proto__: null,\n get() {\n return this._ttyWrite;\n }\n },\n _decoder: {\n __proto__: null,\n get() {\n return this[kDecoder];\n },\n set(value) {\n this[kDecoder] = value;\n }\n },\n _line_buffer: {\n __proto__: null,\n get() {\n return this[kLine_buffer];\n },\n set(value) {\n this[kLine_buffer] = value;\n }\n },\n _oldPrompt: {\n __proto__: null,\n get() {\n return this[kOldPrompt];\n },\n set(value) {\n this[kOldPrompt] = value;\n }\n },\n _previousKey: {\n __proto__: null,\n get() {\n return this[kPreviousKey];\n },\n set(value) {\n this[kPreviousKey] = value;\n }\n },\n _prompt: {\n __proto__: null,\n get() {\n return this[kPrompt];\n },\n set(value) {\n this[kPrompt] = value;\n }\n },\n _questionCallback: {\n __proto__: null,\n get() {\n return this[kQuestionCallback];\n },\n set(value) {\n this[kQuestionCallback] = value;\n }\n },\n _sawKeyPress: {\n __proto__: null,\n get() {\n return this[kSawKeyPress];\n },\n set(value) {\n this[kSawKeyPress] = value;\n }\n },\n _sawReturnAt: {\n __proto__: null,\n get() {\n return this[kSawReturnAt];\n },\n set(value) {\n this[kSawReturnAt] = value;\n }\n }\n});\nInterface.prototype._setRawMode = _Interface.prototype[kSetRawMode];\nInterface.prototype._onLine = _Interface.prototype[kOnLine];\nInterface.prototype._writeToOutput = _Interface.prototype[kWriteToOutput];\nInterface.prototype._addHistory = _Interface.prototype[kAddHistory];\nInterface.prototype._refreshLine = _Interface.prototype[kRefreshLine];\nInterface.prototype._normalWrite = _Interface.prototype[kNormalWrite];\nInterface.prototype._insertString = _Interface.prototype[kInsertString];\nInterface.prototype._tabComplete = function(lastKeypressWasTab) {\n this.pause();\n var string = StringPrototypeSlice.@call(this.line, 0, this.cursor);\n this.completer(string, (err, value) => {\n if (this.resume(), err) {\n this._writeToOutput(`Tab completion error: ${inspect(err)}`);\n return;\n }\n this[kTabCompleter](lastKeypressWasTab, value);\n });\n};\nInterface.prototype._wordLeft = _Interface.prototype[kWordLeft];\nInterface.prototype._wordRight = _Interface.prototype[kWordRight];\nInterface.prototype._deleteLeft = _Interface.prototype[kDeleteLeft];\nInterface.prototype._deleteRight = _Interface.prototype[kDeleteRight];\nInterface.prototype._deleteWordLeft = _Interface.prototype[kDeleteWordLeft];\nInterface.prototype._deleteWordRight = _Interface.prototype[kDeleteWordRight];\nInterface.prototype._deleteLineLeft = _Interface.prototype[kDeleteLineLeft];\nInterface.prototype._deleteLineRight = _Interface.prototype[kDeleteLineRight];\nInterface.prototype._line = _Interface.prototype[kLine];\nInterface.prototype._historyNext = _Interface.prototype[kHistoryNext];\nInterface.prototype._historyPrev = _Interface.prototype[kHistoryPrev];\nInterface.prototype._getDisplayPos = _Interface.prototype[kGetDisplayPos];\nInterface.prototype._getCursorPos = _Interface.prototype.getCursorPos;\nInterface.prototype._moveCursor = _Interface.prototype[kMoveCursor];\nInterface.prototype._ttyWrite = _Interface.prototype[kTtyWrite];\n\nclass Readline {\n #autoCommit = !1;\n #stream;\n #todo = [];\n constructor(stream, options = @undefined) {\n if (isWritable \?\?= (@getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39)).isWritable, !isWritable(stream))\n throw new ERR_INVALID_ARG_TYPE(\"stream\", \"Writable\", stream);\n if (this.#stream = stream, options\?.autoCommit != null)\n validateBoolean(options.autoCommit, \"options.autoCommit\"), this.#autoCommit = options.autoCommit;\n }\n cursorTo(x, y = @undefined) {\n if (validateInteger(x, \"x\"), y != null)\n validateInteger(y, \"y\");\n var data = y == null \? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.@call(this.#todo, data);\n return this;\n }\n moveCursor(dx, dy) {\n if (dx || dy) {\n validateInteger(dx, \"dx\"), validateInteger(dy, \"dy\");\n var data = \"\";\n if (dx < 0)\n data += CSI`${-dx}D`;\n else if (dx > 0)\n data += CSI`${dx}C`;\n if (dy < 0)\n data += CSI`${-dy}A`;\n else if (dy > 0)\n data += CSI`${dy}B`;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.@call(this.#todo, data);\n }\n return this;\n }\n clearLine(dir) {\n validateInteger(dir, \"dir\", -1, 1);\n var data = dir < 0 \? kClearToLineBeginning : dir > 0 \? kClearToLineEnd : kClearLine;\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(data));\n else\n ArrayPrototypePush.@call(this.#todo, data);\n return this;\n }\n clearScreenDown() {\n if (this.#autoCommit)\n process.nextTick(() => this.#stream.write(kClearScreenDown));\n else\n ArrayPrototypePush.@call(this.#todo, kClearScreenDown);\n return this;\n }\n commit() {\n return new @Promise((resolve) => {\n this.#stream.write(ArrayPrototypeJoin.@call(this.#todo, \"\"), resolve), this.#todo = [];\n });\n }\n rollback() {\n return this.#todo = [], this;\n }\n}\nvar PromisesInterface = class Interface3 extends _Interface {\n constructor(input, output, completer, terminal) {\n super(input, output, completer, terminal);\n }\n question(query, options = kEmptyObject) {\n var signal = options\?.signal;\n if (signal) {\n if (validateAbortSignal(signal, \"options.signal\"), signal.aborted)\n return PromiseReject(new AbortError(@undefined, { cause: signal.reason }));\n }\n return new @Promise((resolve, reject) => {\n var cb = resolve;\n if (options\?.signal) {\n var onAbort = () => {\n this[kQuestionCancel](), reject(new AbortError(@undefined, { cause: signal.reason }));\n };\n signal.addEventListener(\"abort\", onAbort, { once: !0 }), cb = (answer) => {\n signal.removeEventListener(\"abort\", onAbort), resolve(answer);\n };\n }\n this[kQuestion](query, cb);\n });\n }\n};\n$ = {\n Interface,\n clearLine,\n clearScreenDown,\n createInterface,\n cursorTo,\n emitKeypressEvents,\n moveCursor,\n promises: {\n Readline,\n Interface: PromisesInterface,\n createInterface(input, output, completer, terminal) {\n return new PromisesInterface(input, output, completer, terminal);\n }\n },\n [SymbolFor(\"__BUN_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__\")]: {\n CSI,\n utils: {\n getStringWidth,\n stripVTControlCharacters\n }\n }\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeReadlinePromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/readline.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).promises})\n"_s;
+static constexpr ASCIILiteral NodeReadlinePromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/readline.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).promises})\n");
//
//
-static constexpr ASCIILiteral NodeReplCode = "(function (){\"use strict\";// src/js/out/tmp/node/repl.ts\nvar $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5);\n$ = {\n lines: [],\n context: globalThis,\n historyIndex: -1,\n cursor: 0,\n historySize: 1000,\n removeHistoryDuplicates: !1,\n crlfDelay: 100,\n completer: () => {\n throwNotImplemented(\"node:repl\");\n },\n history: [],\n _initialPrompt: \"> \",\n terminal: !0,\n input: new Proxy({}, {\n get() {\n throwNotImplemented(\"node:repl\");\n },\n has: () => !1,\n ownKeys: () => [],\n getOwnPropertyDescriptor: () => {\n return;\n },\n set() {\n throwNotImplemented(\"node:repl\");\n }\n }),\n line: \"\",\n eval: () => {\n throwNotImplemented(\"node:repl\");\n },\n isCompletionEnabled: !0,\n escapeCodeTimeout: 500,\n tabSize: 8,\n breakEvalOnSigint: !0,\n useGlobal: !0,\n underscoreAssigned: !1,\n last: void 0,\n _domain: void 0,\n allowBlockingCompletions: !1,\n useColors: !0,\n output: new Proxy({}, {\n get() {\n throwNotImplemented(\"node:repl\");\n },\n has: () => !1,\n ownKeys: () => [],\n getOwnPropertyDescriptor: () => {\n return;\n },\n set() {\n throwNotImplemented(\"node:repl\");\n }\n }),\n _builtinLibs: [\n \"bun\",\n \"ffi\",\n \"assert\",\n \"assert/strict\",\n \"async_hooks\",\n \"buffer\",\n \"child_process\",\n \"cluster\",\n \"console\",\n \"constants\",\n \"crypto\",\n \"dgram\",\n \"diagnostics_channel\",\n \"dns\",\n \"dns/promises\",\n \"domain\",\n \"events\",\n \"fs\",\n \"fs/promises\",\n \"http\",\n \"http2\",\n \"https\",\n \"inspector\",\n \"inspector/promises\",\n \"module\",\n \"net\",\n \"os\",\n \"path\",\n \"path/posix\",\n \"path/win32\",\n \"perf_hooks\",\n \"process\",\n \"punycode\",\n \"querystring\",\n \"readline\",\n \"readline/promises\",\n \"repl\",\n \"stream\",\n \"stream/consumers\",\n \"stream/promises\",\n \"stream/web\",\n \"string_decoder\",\n \"sys\",\n \"timers\",\n \"timers/promises\",\n \"tls\",\n \"trace_events\",\n \"tty\",\n \"url\",\n \"util\",\n \"util/types\",\n \"v8\",\n \"vm\",\n \"wasi\",\n \"worker_threads\",\n \"zlib\"\n ]\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeReplCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/repl.ts\nvar $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6);\n$ = {\n lines: [],\n context: globalThis,\n historyIndex: -1,\n cursor: 0,\n historySize: 1000,\n removeHistoryDuplicates: !1,\n crlfDelay: 100,\n completer: () => {\n throwNotImplemented(\"node:repl\");\n },\n history: [],\n _initialPrompt: \"> \",\n terminal: !0,\n input: new Proxy({}, {\n get() {\n throwNotImplemented(\"node:repl\");\n },\n has: () => !1,\n ownKeys: () => [],\n getOwnPropertyDescriptor: () => @undefined,\n set() {\n throwNotImplemented(\"node:repl\");\n }\n }),\n line: \"\",\n eval: () => {\n throwNotImplemented(\"node:repl\");\n },\n isCompletionEnabled: !0,\n escapeCodeTimeout: 500,\n tabSize: 8,\n breakEvalOnSigint: !0,\n useGlobal: !0,\n underscoreAssigned: !1,\n last: @undefined,\n _domain: @undefined,\n allowBlockingCompletions: !1,\n useColors: !0,\n output: new Proxy({}, {\n get() {\n throwNotImplemented(\"node:repl\");\n },\n has: () => !1,\n ownKeys: () => [],\n getOwnPropertyDescriptor: () => @undefined,\n set() {\n throwNotImplemented(\"node:repl\");\n }\n }),\n _builtinLibs: [\n \"bun\",\n \"ffi\",\n \"assert\",\n \"assert/strict\",\n \"async_hooks\",\n \"buffer\",\n \"child_process\",\n \"cluster\",\n \"console\",\n \"constants\",\n \"crypto\",\n \"dgram\",\n \"diagnostics_channel\",\n \"dns\",\n \"dns/promises\",\n \"domain\",\n \"events\",\n \"fs\",\n \"fs/promises\",\n \"http\",\n \"http2\",\n \"https\",\n \"inspector\",\n \"inspector/promises\",\n \"module\",\n \"net\",\n \"os\",\n \"path\",\n \"path/posix\",\n \"path/win32\",\n \"perf_hooks\",\n \"process\",\n \"punycode\",\n \"querystring\",\n \"readline\",\n \"readline/promises\",\n \"repl\",\n \"stream\",\n \"stream/consumers\",\n \"stream/promises\",\n \"stream/web\",\n \"string_decoder\",\n \"sys\",\n \"timers\",\n \"timers/promises\",\n \"tls\",\n \"trace_events\",\n \"tty\",\n \"url\",\n \"util\",\n \"util/types\",\n \"v8\",\n \"vm\",\n \"wasi\",\n \"worker_threads\",\n \"zlib\"\n ]\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeStreamConsumersCode = "(function (){\"use strict\";// src/js/out/tmp/node/stream.consumers.ts\nvar $, arrayBuffer = Bun.readableStreamToArrayBuffer, text = Bun.readableStreamToText, json = (stream) => Bun.readableStreamToText(stream).then(JSON.parse), buffer = async (readableStream) => {\n return new Buffer(await arrayBuffer(readableStream));\n}, blob = Bun.readableStreamToBlob;\n$ = {\n arrayBuffer,\n text,\n json,\n buffer,\n blob\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeStreamConsumersCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/stream.consumers.ts\nvar $, arrayBuffer = Bun.readableStreamToArrayBuffer, text = Bun.readableStreamToText, json = (stream) => Bun.readableStreamToText(stream).then(JSON.parse), buffer = async (readableStream) => {\n return new @Buffer(await arrayBuffer(readableStream));\n}, blob = Bun.readableStreamToBlob;\n$ = {\n arrayBuffer,\n text,\n json,\n buffer,\n blob\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeStreamCode = "(function (){\"use strict\";// src/js/out/tmp/node/stream.ts\nvar isReadableStream = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof ReadableStream;\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar ERR_INVALID_ARG_TYPE = function(name, type, value) {\n return new Error(`The argument '${name}' is invalid. Received '${value}' for type '${type}'`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value '${value}' is invalid for argument '${name}'. Reason: ${reason}`);\n}, createNativeStreamReadable = function(nativeType, Readable) {\n var [pull, start, cancel, setClose, deinit, updateRef, drainFn] = globalThis[globalThis.Symbol.for('Bun.lazy')](nativeType), closer = [!1], handleNumberResult = function(nativeReadable, result, view, isClosed) {\n if (result > 0) {\n const slice = view.subarray(0, result), remainder = view.subarray(result);\n if (slice.byteLength > 0)\n nativeReadable.push(slice);\n if (isClosed)\n nativeReadable.push(null);\n return remainder.byteLength > 0 \? remainder : void 0;\n }\n if (isClosed)\n nativeReadable.push(null);\n return view;\n }, handleArrayBufferViewResult = function(nativeReadable, result, view, isClosed) {\n if (result.byteLength > 0)\n nativeReadable.push(result);\n if (isClosed)\n nativeReadable.push(null);\n return view;\n }, DYNAMICALLY_ADJUST_CHUNK_SIZE = process.env.BUN_DISABLE_DYNAMIC_CHUNK_SIZE !== \"1\";\n const finalizer = new FinalizationRegistry((ptr) => ptr && deinit(ptr)), MIN_BUFFER_SIZE = 512;\n var NativeReadable = class NativeReadable2 extends Readable {\n #bunNativePtr;\n #refCount = 1;\n #constructed = !1;\n #remainingChunk = void 0;\n #highWaterMark;\n #pendingRead = !1;\n #hasResized = !DYNAMICALLY_ADJUST_CHUNK_SIZE;\n #unregisterToken;\n constructor(ptr, options = {}) {\n super(options);\n if (typeof options.highWaterMark === \"number\")\n this.#highWaterMark = options.highWaterMark;\n else\n this.#highWaterMark = 262144;\n this.#bunNativePtr = ptr, this.#constructed = !1, this.#remainingChunk = void 0, this.#pendingRead = !1, this.#unregisterToken = {}, finalizer.register(this, this.#bunNativePtr, this.#unregisterToken);\n }\n _read(maxToRead) {\n if (this.#pendingRead)\n return;\n var ptr = this.#bunNativePtr;\n if (ptr === 0) {\n this.push(null);\n return;\n }\n if (!this.#constructed)\n this.#internalConstruct(ptr);\n return this.#internalRead(this.#getRemainingChunk(maxToRead), ptr);\n }\n #internalConstruct(ptr) {\n this.#constructed = !0;\n const result = start(ptr, this.#highWaterMark);\n if (typeof result === \"number\" && result > 1)\n this.#hasResized = !0, this.#highWaterMark = Math.min(this.#highWaterMark, result);\n if (drainFn) {\n const drainResult = drainFn(ptr);\n if ((drainResult\?.byteLength \?\? 0) > 0)\n this.push(drainResult);\n }\n }\n #getRemainingChunk(maxToRead = this.#highWaterMark) {\n var chunk = this.#remainingChunk;\n if (chunk\?.byteLength \?\? 0 < MIN_BUFFER_SIZE) {\n var size = maxToRead > MIN_BUFFER_SIZE \? maxToRead : MIN_BUFFER_SIZE;\n this.#remainingChunk = chunk = new Buffer(size);\n }\n return chunk;\n }\n #handleResult(result, view, isClosed) {\n if (typeof result === \"number\") {\n if (result >= this.#highWaterMark && !this.#hasResized && !isClosed)\n this.#highWaterMark *= 2, this.#hasResized = !0;\n return handleNumberResult(this, result, view, isClosed);\n } else if (typeof result === \"boolean\")\n return process.nextTick(() => {\n this.push(null);\n }), view\?.byteLength \?\? 0 > 0 \? view : void 0;\n else if (ArrayBuffer.isView(result)) {\n if (result.byteLength >= this.#highWaterMark && !this.#hasResized && !isClosed)\n this.#highWaterMark *= 2, this.#hasResized = !0;\n return handleArrayBufferViewResult(this, result, view, isClosed);\n } else\n throw new Error(\"Invalid result from pull\");\n }\n #internalRead(view, ptr) {\n closer[0] = !1;\n var result = pull(ptr, view, closer);\n if (@isPromise(result))\n return this.#pendingRead = !0, result.then((result2) => {\n this.#pendingRead = !1, this.#remainingChunk = this.#handleResult(result2, view, closer[0]);\n }, (reason) => {\n errorOrDestroy(this, reason);\n });\n else\n this.#remainingChunk = this.#handleResult(result, view, closer[0]);\n }\n _destroy(error, callback) {\n var ptr = this.#bunNativePtr;\n if (ptr === 0) {\n callback(error);\n return;\n }\n if (finalizer.unregister(this.#unregisterToken), this.#bunNativePtr = 0, updateRef)\n updateRef(ptr, !1);\n cancel(ptr, error), callback(error);\n }\n ref() {\n var ptr = this.#bunNativePtr;\n if (ptr === 0)\n return;\n if (this.#refCount++ === 0)\n updateRef(ptr, !0);\n }\n unref() {\n var ptr = this.#bunNativePtr;\n if (ptr === 0)\n return;\n if (this.#refCount-- === 1)\n updateRef(ptr, !1);\n }\n };\n if (!updateRef)\n NativeReadable.prototype.ref = void 0, NativeReadable.prototype.unref = void 0;\n return NativeReadable;\n}, getNativeReadableStreamPrototype = function(nativeType, Readable) {\n return nativeReadableStreamPrototypes[nativeType] ||= createNativeStreamReadable(nativeType, Readable);\n}, getNativeReadableStream = function(Readable, stream, options) {\n if (!(stream && typeof stream === \"object\" && stream instanceof ReadableStream))\n return;\n const native = @direct(stream);\n if (!native)\n return;\n const { stream: ptr, data: type } = native;\n return new (getNativeReadableStreamPrototype(type, Readable))(ptr, options);\n}, NativeWritable = function(pathOrFdOrSink, options = {}) {\n Writable.call(this, options), this[_native] = !0, this._construct = NativeWritable_internalConstruct, this._destroy = NativeWritable_internalDestroy, this._final = NativeWritable_internalFinal, this[_pathOrFdOrSink] = pathOrFdOrSink;\n}, NativeWritable_internalConstruct = function(cb) {\n if (this._writableState.constructed = !0, this.constructed = !0, typeof cb === \"function\")\n cb();\n process.nextTick(() => {\n this.emit(\"open\", this.fd), this.emit(\"ready\");\n });\n}, NativeWritable_lazyConstruct = function(stream) {\n var sink = stream[_pathOrFdOrSink];\n if (typeof sink === \"object\")\n if (typeof sink.write === \"function\")\n return stream[_fileSink] = sink;\n else\n throw new Error(\"Invalid FileSink\");\n else\n return stream[_fileSink] = Bun.file(sink).writer();\n}, NativeWritable_internalDestroy = function(error, cb) {\n const w = this._writableState, r = this._readableState;\n if (w)\n w.destroyed = !0, w.closeEmitted = !0;\n if (r)\n r.destroyed = !0, r.closeEmitted = !0;\n if (typeof cb === \"function\")\n cb(error);\n if (w\?.closeEmitted || r\?.closeEmitted)\n this.emit(\"close\");\n}, NativeWritable_internalFinal = function(cb) {\n var sink = this[_fileSink];\n if (sink)\n sink.end();\n if (cb)\n cb();\n}, EE = globalThis[globalThis.Symbol.for('Bun.lazy')](\"events\"), StringDecoder = @requireNativeModule(\"string_decoder\").StringDecoder, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, runOnNextTick = process.nextTick;\nvar ArrayIsArray = Array.isArray, require_primordials = __commonJS({\n \"node_modules/readable-stream/lib/ours/primordials.js\"(exports, module) {\n module.exports = {\n ArrayIsArray(self) {\n return Array.isArray(self);\n },\n ArrayPrototypeIncludes(self, el) {\n return self.includes(el);\n },\n ArrayPrototypeIndexOf(self, el) {\n return self.indexOf(el);\n },\n ArrayPrototypeJoin(self, sep) {\n return self.join(sep);\n },\n ArrayPrototypeMap(self, fn) {\n return self.map(fn);\n },\n ArrayPrototypePop(self, el) {\n return self.pop(el);\n },\n ArrayPrototypePush(self, el) {\n return self.push(el);\n },\n ArrayPrototypeSlice(self, start, end) {\n return self.slice(start, end);\n },\n Error,\n FunctionPrototypeCall(fn, thisArgs, ...args) {\n return fn.call(thisArgs, ...args);\n },\n FunctionPrototypeSymbolHasInstance(self, instance) {\n return Function.prototype[Symbol.hasInstance].call(self, instance);\n },\n MathFloor: Math.floor,\n Number,\n NumberIsInteger: Number.isInteger,\n NumberIsNaN: Number.isNaN,\n NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,\n NumberParseInt: Number.parseInt,\n ObjectDefineProperties(self, props) {\n return Object.defineProperties(self, props);\n },\n ObjectDefineProperty(self, name, prop) {\n return Object.defineProperty(self, name, prop);\n },\n ObjectGetOwnPropertyDescriptor(self, name) {\n return Object.getOwnPropertyDescriptor(self, name);\n },\n ObjectKeys(obj) {\n return Object.keys(obj);\n },\n ObjectSetPrototypeOf(target, proto) {\n return Object.setPrototypeOf(target, proto);\n },\n Promise,\n PromisePrototypeCatch(self, fn) {\n return self.catch(fn);\n },\n PromisePrototypeThen(self, thenFn, catchFn) {\n return self.then(thenFn, catchFn);\n },\n PromiseReject(err) {\n return Promise.reject(err);\n },\n ReflectApply: Reflect.apply,\n RegExpPrototypeTest(self, value) {\n return self.test(value);\n },\n SafeSet: Set,\n String,\n StringPrototypeSlice(self, start, end) {\n return self.slice(start, end);\n },\n StringPrototypeToLowerCase(self) {\n return self.toLowerCase();\n },\n StringPrototypeToUpperCase(self) {\n return self.toUpperCase();\n },\n StringPrototypeTrim(self) {\n return self.trim();\n },\n Symbol,\n SymbolAsyncIterator: Symbol.asyncIterator,\n SymbolHasInstance: Symbol.hasInstance,\n SymbolIterator: Symbol.iterator,\n TypedArrayPrototypeSet(self, buf, len) {\n return self.set(buf, len);\n },\n Uint8Array\n };\n }\n}), require_util = __commonJS({\n \"node_modules/readable-stream/lib/ours/util.js\"(exports, module) {\n var AsyncFunction = Object.getPrototypeOf(async function() {\n }).constructor, isBlob = typeof Blob !== \"undefined\" \? function isBlob2(b) {\n return b instanceof Blob;\n } : function isBlob2(b) {\n return !1;\n }, AggregateError = class extends Error {\n constructor(errors) {\n if (!Array.isArray(errors))\n @throwTypeError(`Expected input to be an Array, got ${typeof errors}`);\n let message = \"\";\n for (let i = 0;i < errors.length; i++)\n message += ` ${errors[i].stack}\n`;\n super(message);\n this.name = \"AggregateError\", this.errors = errors;\n }\n };\n module.exports = {\n AggregateError,\n once(callback) {\n let called = !1;\n return function(...args) {\n if (called)\n return;\n called = !0, callback.apply(this, args);\n };\n },\n createDeferredPromise: function() {\n let resolve, reject;\n return {\n promise: new Promise((res, rej) => {\n resolve = res, reject = rej;\n }),\n resolve,\n reject\n };\n },\n promisify(fn) {\n return new Promise((resolve, reject) => {\n fn((err, ...args) => {\n if (err)\n return reject(err);\n return resolve(...args);\n });\n });\n },\n debuglog() {\n return function() {\n };\n },\n format(format, ...args) {\n return format.replace(/%([sdifj])/g, function(...[_unused, type]) {\n const replacement = args.shift();\n if (type === \"f\")\n return replacement.toFixed(6);\n else if (type === \"j\")\n return JSON.stringify(replacement);\n else if (type === \"s\" && typeof replacement === \"object\")\n return `${replacement.constructor !== Object \? replacement.constructor.name : \"\"} {}`.trim();\n else\n return replacement.toString();\n });\n },\n inspect(value) {\n switch (typeof value) {\n case \"string\":\n if (value.includes(\"'\")) {\n if (!value.includes('\"'))\n return `\"${value}\"`;\n else if (!value.includes(\"`\") && !value.includes(\"${\"))\n return `\\`${value}\\``;\n }\n return `'${value}'`;\n case \"number\":\n if (isNaN(value))\n return \"NaN\";\n else if (Object.is(value, -0))\n return String(value);\n return value;\n case \"bigint\":\n return `${String(value)}n`;\n case \"boolean\":\n case \"undefined\":\n return String(value);\n case \"object\":\n return \"{}\";\n }\n },\n types: {\n isAsyncFunction(fn) {\n return fn instanceof AsyncFunction;\n },\n isArrayBufferView(arr) {\n return ArrayBuffer.isView(arr);\n }\n },\n isBlob\n }, module.exports.promisify.custom = Symbol.for(\"nodejs.util.promisify.custom\");\n }\n}), require_errors = __commonJS({\n \"node_modules/readable-stream/lib/ours/errors.js\"(exports, module) {\n var { format, inspect, AggregateError: CustomAggregateError } = require_util(), AggregateError = globalThis.AggregateError || CustomAggregateError, kIsNodeError = Symbol(\"kIsNodeError\"), kTypes = [\"string\", \"function\", \"number\", \"object\", \"Function\", \"Object\", \"boolean\", \"bigint\", \"symbol\"], classRegExp = /^([A-Z][a-z0-9]*)+$/, nodeInternalPrefix = \"__node_internal_\", codes = {};\n function assert(value, message) {\n if (!value)\n throw new codes.ERR_INTERNAL_ASSERTION(message);\n }\n function addNumericalSeparator(val) {\n let res = \"\", i = val.length;\n const start = val[0] === \"-\" \? 1 : 0;\n for (;i >= start + 4; i -= 3)\n res = `_${val.slice(i - 3, i)}${res}`;\n return `${val.slice(0, i)}${res}`;\n }\n function getMessage(key, msg, args) {\n if (typeof msg === \"function\")\n return assert(msg.length <= args.length, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`), msg(...args);\n const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length;\n if (assert(expectedLength === args.length, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`), args.length === 0)\n return msg;\n return format(msg, ...args);\n }\n function E(code, message, Base) {\n if (!Base)\n Base = Error;\n\n class NodeError extends Base {\n constructor(...args) {\n super(getMessage(code, message, args));\n }\n toString() {\n return `${this.name} [${code}]: ${this.message}`;\n }\n }\n Object.defineProperties(NodeError.prototype, {\n name: {\n value: Base.name,\n writable: !0,\n enumerable: !1,\n configurable: !0\n },\n toString: {\n value() {\n return `${this.name} [${code}]: ${this.message}`;\n },\n writable: !0,\n enumerable: !1,\n configurable: !0\n }\n }), NodeError.prototype.code = code, NodeError.prototype[kIsNodeError] = !0, codes[code] = NodeError;\n }\n function hideStackFrames(fn) {\n const hidden = nodeInternalPrefix + fn.name;\n return Object.defineProperty(fn, \"name\", {\n value: hidden\n }), fn;\n }\n function aggregateTwoErrors(innerError, outerError) {\n if (innerError && outerError && innerError !== outerError) {\n if (Array.isArray(outerError.errors))\n return outerError.errors.push(innerError), outerError;\n const err = new AggregateError([outerError, innerError], outerError.message);\n return err.code = outerError.code, err;\n }\n return innerError || outerError;\n }\n var AbortError2 = class extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n };\n E(\"ERR_ASSERTION\", \"%s\", Error), E(\"ERR_INVALID_ARG_TYPE\", (name, expected, actual) => {\n if (assert(typeof name === \"string\", \"'name' must be a string\"), !Array.isArray(expected))\n expected = [expected];\n let msg = \"The \";\n if (name.endsWith(\" argument\"))\n msg += `${name} `;\n else\n msg += `\"${name}\" ${name.includes(\".\") \? \"property\" : \"argument\"} `;\n msg += \"must be \";\n const types = [], instances = [], other = [];\n for (let value of expected)\n if (assert(typeof value === \"string\", \"All expected entries have to be of type string\"), kTypes.includes(value))\n types.push(value.toLowerCase());\n else if (classRegExp.test(value))\n instances.push(value);\n else\n assert(value !== \"object\", 'The value \"object\" should be written as \"Object\"'), other.push(value);\n if (instances.length > 0) {\n const pos = types.indexOf(\"object\");\n if (pos !== -1)\n types.splice(types, pos, 1), instances.push(\"Object\");\n }\n if (types.length > 0) {\n switch (types.length) {\n case 1:\n msg += `of type ${types[0]}`;\n break;\n case 2:\n msg += `one of type ${types[0]} or ${types[1]}`;\n break;\n default: {\n const last = types.pop();\n msg += `one of type ${types.join(\", \")}, or ${last}`;\n }\n }\n if (instances.length > 0 || other.length > 0)\n msg += \" or \";\n }\n if (instances.length > 0) {\n switch (instances.length) {\n case 1:\n msg += `an instance of ${instances[0]}`;\n break;\n case 2:\n msg += `an instance of ${instances[0]} or ${instances[1]}`;\n break;\n default: {\n const last = instances.pop();\n msg += `an instance of ${instances.join(\", \")}, or ${last}`;\n }\n }\n if (other.length > 0)\n msg += \" or \";\n }\n switch (other.length) {\n case 0:\n break;\n case 1:\n if (other[0].toLowerCase() !== other[0])\n msg += \"an \";\n msg += `${other[0]}`;\n break;\n case 2:\n msg += `one of ${other[0]} or ${other[1]}`;\n break;\n default: {\n const last = other.pop();\n msg += `one of ${other.join(\", \")}, or ${last}`;\n }\n }\n if (actual == null)\n msg += `. Received ${actual}`;\n else if (typeof actual === \"function\" && actual.name)\n msg += `. Received function ${actual.name}`;\n else if (typeof actual === \"object\") {\n var _actual$constructor;\n if ((_actual$constructor = actual.constructor) !== null && _actual$constructor !== void 0 && _actual$constructor.name)\n msg += `. Received an instance of ${actual.constructor.name}`;\n else {\n const inspected = inspect(actual, {\n depth: -1\n });\n msg += `. Received ${inspected}`;\n }\n } else {\n let inspected = inspect(actual, {\n colors: !1\n });\n if (inspected.length > 25)\n inspected = `${inspected.slice(0, 25)}...`;\n msg += `. Received type ${typeof actual} (${inspected})`;\n }\n return msg;\n }, TypeError), E(\"ERR_INVALID_ARG_VALUE\", (name, value, reason = \"is invalid\") => {\n let inspected = inspect(value);\n if (inspected.length > 128)\n inspected = inspected.slice(0, 128) + \"...\";\n return `The ${name.includes(\".\") \? \"property\" : \"argument\"} '${name}' ${reason}. Received ${inspected}`;\n }, TypeError), E(\"ERR_INVALID_RETURN_VALUE\", (input, name, value) => {\n var _value$constructor;\n const type = value !== null && value !== void 0 && (_value$constructor = value.constructor) !== null && _value$constructor !== void 0 && _value$constructor.name \? `instance of ${value.constructor.name}` : `type ${typeof value}`;\n return `Expected ${input} to be returned from the \"${name}\" function but got ${type}.`;\n }, TypeError), E(\"ERR_MISSING_ARGS\", (...args) => {\n assert(args.length > 0, \"At least one arg needs to be specified\");\n let msg;\n const len = args.length;\n switch (args = (Array.isArray(args) \? args : [args]).map((a) => `\"${a}\"`).join(\" or \"), len) {\n case 1:\n msg += `The ${args[0]} argument`;\n break;\n case 2:\n msg += `The ${args[0]} and ${args[1]} arguments`;\n break;\n default:\n {\n const last = args.pop();\n msg += `The ${args.join(\", \")}, and ${last} arguments`;\n }\n break;\n }\n return `${msg} must be specified`;\n }, TypeError), E(\"ERR_OUT_OF_RANGE\", (str, range, input) => {\n assert(range, 'Missing \"range\" argument');\n let received;\n if (Number.isInteger(input) && Math.abs(input) > 4294967296)\n received = addNumericalSeparator(String(input));\n else if (typeof input === \"bigint\") {\n if (received = String(input), input > 2n ** 32n || input < -(2n ** 32n))\n received = addNumericalSeparator(received);\n received += \"n\";\n } else\n received = inspect(input);\n return `The value of \"${str}\" is out of range. It must be ${range}. Received ${received}`;\n }, RangeError), E(\"ERR_MULTIPLE_CALLBACK\", \"Callback called multiple times\", Error), E(\"ERR_METHOD_NOT_IMPLEMENTED\", \"The %s method is not implemented\", Error), E(\"ERR_STREAM_ALREADY_FINISHED\", \"Cannot call %s after a stream was finished\", Error), E(\"ERR_STREAM_CANNOT_PIPE\", \"Cannot pipe, not readable\", Error), E(\"ERR_STREAM_DESTROYED\", \"Cannot call %s after a stream was destroyed\", Error), E(\"ERR_STREAM_NULL_VALUES\", \"May not write null values to stream\", TypeError), E(\"ERR_STREAM_PREMATURE_CLOSE\", \"Premature close\", Error), E(\"ERR_STREAM_PUSH_AFTER_EOF\", \"stream.push() after EOF\", Error), E(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\", \"stream.unshift() after end event\", Error), E(\"ERR_STREAM_WRITE_AFTER_END\", \"write after end\", Error), E(\"ERR_UNKNOWN_ENCODING\", \"Unknown encoding: %s\", TypeError), module.exports = {\n AbortError: AbortError2,\n aggregateTwoErrors: hideStackFrames(aggregateTwoErrors),\n hideStackFrames,\n codes\n };\n }\n}), require_validators = __commonJS({\n \"node_modules/readable-stream/lib/internal/validators.js\"(exports, module) {\n var {\n ArrayIsArray: ArrayIsArray2,\n ArrayPrototypeIncludes,\n ArrayPrototypeJoin,\n ArrayPrototypeMap,\n NumberIsInteger,\n NumberMAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER,\n NumberParseInt,\n RegExpPrototypeTest,\n String: String2,\n StringPrototypeToUpperCase,\n StringPrototypeTrim\n } = require_primordials(), {\n hideStackFrames,\n codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL }\n } = require_errors(), { normalizeEncoding } = require_util(), { isAsyncFunction, isArrayBufferView } = require_util().types, signals = {};\n function isInt32(value) {\n return value === (value | 0);\n }\n function isUint32(value) {\n return value === value >>> 0;\n }\n var octalReg = /^[0-7]+$/, modeDesc = \"must be a 32-bit unsigned integer or an octal string\";\n function parseFileMode(value, name, def) {\n if (typeof value === \"undefined\")\n value = def;\n if (typeof value === \"string\") {\n if (!RegExpPrototypeTest(octalReg, value))\n throw new ERR_INVALID_ARG_VALUE2(name, value, modeDesc);\n value = NumberParseInt(value, 8);\n }\n return validateInt32(value, name, 0, 4294967295), value;\n }\n var validateInteger = hideStackFrames((value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }), validateInt32 = hideStackFrames((value, name, min = -2147483648, max = 2147483647) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!isInt32(value)) {\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }), validateUint32 = hideStackFrames((value, name, positive) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!isUint32(value)) {\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n throw new ERR_OUT_OF_RANGE(name, `>= ${positive \? 1 : 0} && < 4294967296`, value);\n }\n if (positive && value === 0)\n throw new ERR_OUT_OF_RANGE(name, \">= 1 && < 4294967296\", value);\n });\n function validateString(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"string\", value);\n }\n function validateNumber(value, name) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n }\n var validateOneOf = hideStackFrames((value, name, oneOf) => {\n if (!ArrayPrototypeIncludes(oneOf, value)) {\n const reason = \"must be one of: \" + ArrayPrototypeJoin(ArrayPrototypeMap(oneOf, (v) => typeof v === \"string\" \? `'${v}'` : String2(v)), \", \");\n throw new ERR_INVALID_ARG_VALUE2(name, value, reason);\n }\n });\n function validateBoolean2(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"boolean\", value);\n }\n var validateObject = hideStackFrames((value, name, options) => {\n const useDefaultOptions = options == null, allowArray = useDefaultOptions \? !1 : options.allowArray, allowFunction = useDefaultOptions \? !1 : options.allowFunction;\n if (!(useDefaultOptions \? !1 : options.nullable) && value === null || !allowArray && ArrayIsArray2(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Object\", value);\n }), validateArray = hideStackFrames((value, name, minLength = 0) => {\n if (!ArrayIsArray2(value))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE2(name, value, reason);\n }\n });\n function validateSignalName(signal, name = \"signal\") {\n if (validateString(signal, name), signals[signal] === void 0) {\n if (signals[StringPrototypeToUpperCase(signal)] !== void 0)\n throw new ERR_UNKNOWN_SIGNAL(signal + \" (signals must use all capital letters)\");\n throw new ERR_UNKNOWN_SIGNAL(signal);\n }\n }\n var validateBuffer = hideStackFrames((buffer, name = \"buffer\") => {\n if (!isArrayBufferView(buffer))\n throw new ERR_INVALID_ARG_TYPE2(name, [\"Buffer\", \"TypedArray\", \"DataView\"], buffer);\n });\n function validateEncoding(data, encoding) {\n const normalizedEncoding = normalizeEncoding(encoding), length = data.length;\n if (normalizedEncoding === \"hex\" && length % 2 !== 0)\n throw new ERR_INVALID_ARG_VALUE2(\"encoding\", encoding, `is invalid for data of length ${length}`);\n }\n function validatePort(port, name = \"Port\", allowZero = !0) {\n if (typeof port !== \"number\" && typeof port !== \"string\" || typeof port === \"string\" && StringPrototypeTrim(port).length === 0 || +port !== +port >>> 0 || port > 65535 || port === 0 && !allowZero)\n throw new ERR_SOCKET_BAD_PORT(name, port, allowZero);\n return port | 0;\n }\n var validateAbortSignal = hideStackFrames((signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE2(name, \"AbortSignal\", signal);\n }), validateFunction = hideStackFrames((value, name) => {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"Function\", value);\n }), validatePlainFunction = hideStackFrames((value, name) => {\n if (typeof value !== \"function\" || isAsyncFunction(value))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Function\", value);\n }), validateUndefined = hideStackFrames((value, name) => {\n if (value !== void 0)\n throw new ERR_INVALID_ARG_TYPE2(name, \"undefined\", value);\n });\n module.exports = {\n isInt32,\n isUint32,\n parseFileMode,\n validateArray,\n validateBoolean: validateBoolean2,\n validateBuffer,\n validateEncoding,\n validateFunction,\n validateInt32,\n validateInteger,\n validateNumber,\n validateObject,\n validateOneOf,\n validatePlainFunction,\n validatePort,\n validateSignalName,\n validateString,\n validateUint32,\n validateUndefined,\n validateAbortSignal\n };\n }\n}), require_utils = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/utils.js\"(exports, module) {\n var { Symbol: Symbol2, SymbolAsyncIterator, SymbolIterator } = require_primordials(), kDestroyed = Symbol2(\"kDestroyed\"), kIsErrored = Symbol2(\"kIsErrored\"), kIsReadable = Symbol2(\"kIsReadable\"), kIsDisturbed = Symbol2(\"kIsDisturbed\");\n function isReadableNodeStream(obj, strict = !1) {\n var _obj$_readableState;\n return !!(obj && typeof obj.pipe === \"function\" && typeof obj.on === \"function\" && (!strict || typeof obj.pause === \"function\" && typeof obj.resume === \"function\") && (!obj._writableState || ((_obj$_readableState = obj._readableState) === null || _obj$_readableState === void 0 \? void 0 : _obj$_readableState.readable) !== !1) && (!obj._writableState || obj._readableState));\n }\n function isWritableNodeStream(obj) {\n var _obj$_writableState;\n return !!(obj && typeof obj.write === \"function\" && typeof obj.on === \"function\" && (!obj._readableState || ((_obj$_writableState = obj._writableState) === null || _obj$_writableState === void 0 \? void 0 : _obj$_writableState.writable) !== !1));\n }\n function isDuplexNodeStream(obj) {\n return !!(obj && typeof obj.pipe === \"function\" && obj._readableState && typeof obj.on === \"function\" && typeof obj.write === \"function\");\n }\n function isNodeStream(obj) {\n return obj && (obj._readableState || obj._writableState || typeof obj.write === \"function\" && typeof obj.on === \"function\" || typeof obj.pipe === \"function\" && typeof obj.on === \"function\");\n }\n function isIterable(obj, isAsync) {\n if (obj == null)\n return !1;\n if (isAsync === !0)\n return typeof obj[SymbolAsyncIterator] === \"function\";\n if (isAsync === !1)\n return typeof obj[SymbolIterator] === \"function\";\n return typeof obj[SymbolAsyncIterator] === \"function\" || typeof obj[SymbolIterator] === \"function\";\n }\n function isDestroyed(stream) {\n if (!isNodeStream(stream))\n return null;\n const { _writableState: wState, _readableState: rState } = stream, state = wState || rState;\n return !!(stream.destroyed || stream[kDestroyed] || state !== null && state !== void 0 && state.destroyed);\n }\n function isWritableEnded(stream) {\n if (!isWritableNodeStream(stream))\n return null;\n if (stream.writableEnded === !0)\n return !0;\n const wState = stream._writableState;\n if (wState !== null && wState !== void 0 && wState.errored)\n return !1;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.ended) !== \"boolean\")\n return null;\n return wState.ended;\n }\n function isWritableFinished(stream, strict) {\n if (!isWritableNodeStream(stream))\n return null;\n if (stream.writableFinished === !0)\n return !0;\n const wState = stream._writableState;\n if (wState !== null && wState !== void 0 && wState.errored)\n return !1;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.finished) !== \"boolean\")\n return null;\n return !!(wState.finished || strict === !1 && wState.ended === !0 && wState.length === 0);\n }\n function isReadableEnded(stream) {\n if (!isReadableNodeStream(stream))\n return null;\n if (stream.readableEnded === !0)\n return !0;\n const rState = stream._readableState;\n if (!rState || rState.errored)\n return !1;\n if (typeof (rState === null || rState === void 0 \? void 0 : rState.ended) !== \"boolean\")\n return null;\n return rState.ended;\n }\n function isReadableFinished(stream, strict) {\n if (!isReadableNodeStream(stream))\n return null;\n const rState = stream._readableState;\n if (rState !== null && rState !== void 0 && rState.errored)\n return !1;\n if (typeof (rState === null || rState === void 0 \? void 0 : rState.endEmitted) !== \"boolean\")\n return null;\n return !!(rState.endEmitted || strict === !1 && rState.ended === !0 && rState.length === 0);\n }\n function isReadable(stream) {\n if (stream && stream[kIsReadable] != null)\n return stream[kIsReadable];\n if (typeof (stream === null || stream === void 0 \? void 0 : stream.readable) !== \"boolean\")\n return null;\n if (isDestroyed(stream))\n return !1;\n return isReadableNodeStream(stream) && stream.readable && !isReadableFinished(stream);\n }\n function isWritable(stream) {\n if (typeof (stream === null || stream === void 0 \? void 0 : stream.writable) !== \"boolean\")\n return null;\n if (isDestroyed(stream))\n return !1;\n return isWritableNodeStream(stream) && stream.writable && !isWritableEnded(stream);\n }\n function isFinished(stream, opts) {\n if (!isNodeStream(stream))\n return null;\n if (isDestroyed(stream))\n return !0;\n if ((opts === null || opts === void 0 \? void 0 : opts.readable) !== !1 && isReadable(stream))\n return !1;\n if ((opts === null || opts === void 0 \? void 0 : opts.writable) !== !1 && isWritable(stream))\n return !1;\n return !0;\n }\n function isWritableErrored(stream) {\n var _stream$_writableStat, _stream$_writableStat2;\n if (!isNodeStream(stream))\n return null;\n if (stream.writableErrored)\n return stream.writableErrored;\n return (_stream$_writableStat = (_stream$_writableStat2 = stream._writableState) === null || _stream$_writableStat2 === void 0 \? void 0 : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== void 0 \? _stream$_writableStat : null;\n }\n function isReadableErrored(stream) {\n var _stream$_readableStat, _stream$_readableStat2;\n if (!isNodeStream(stream))\n return null;\n if (stream.readableErrored)\n return stream.readableErrored;\n return (_stream$_readableStat = (_stream$_readableStat2 = stream._readableState) === null || _stream$_readableStat2 === void 0 \? void 0 : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== void 0 \? _stream$_readableStat : null;\n }\n function isClosed(stream) {\n if (!isNodeStream(stream))\n return null;\n if (typeof stream.closed === \"boolean\")\n return stream.closed;\n const { _writableState: wState, _readableState: rState } = stream;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.closed) === \"boolean\" || typeof (rState === null || rState === void 0 \? void 0 : rState.closed) === \"boolean\")\n return (wState === null || wState === void 0 \? void 0 : wState.closed) || (rState === null || rState === void 0 \? void 0 : rState.closed);\n if (typeof stream._closed === \"boolean\" && isOutgoingMessage(stream))\n return stream._closed;\n return null;\n }\n function isOutgoingMessage(stream) {\n return typeof stream._closed === \"boolean\" && typeof stream._defaultKeepAlive === \"boolean\" && typeof stream._removedConnection === \"boolean\" && typeof stream._removedContLen === \"boolean\";\n }\n function isServerResponse(stream) {\n return typeof stream._sent100 === \"boolean\" && isOutgoingMessage(stream);\n }\n function isServerRequest(stream) {\n var _stream$req;\n return typeof stream._consuming === \"boolean\" && typeof stream._dumped === \"boolean\" && ((_stream$req = stream.req) === null || _stream$req === void 0 \? void 0 : _stream$req.upgradeOrConnect) === void 0;\n }\n function willEmitClose(stream) {\n if (!isNodeStream(stream))\n return null;\n const { _writableState: wState, _readableState: rState } = stream, state = wState || rState;\n return !state && isServerResponse(stream) || !!(state && state.autoDestroy && state.emitClose && state.closed === !1);\n }\n function isDisturbed(stream) {\n var _stream$kIsDisturbed;\n return !!(stream && ((_stream$kIsDisturbed = stream[kIsDisturbed]) !== null && _stream$kIsDisturbed !== void 0 \? _stream$kIsDisturbed : stream.readableDidRead || stream.readableAborted));\n }\n function isErrored(stream) {\n var _ref, _ref2, _ref3, _ref4, _ref5, _stream$kIsErrored, _stream$_readableStat3, _stream$_writableStat3, _stream$_readableStat4, _stream$_writableStat4;\n return !!(stream && ((_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_stream$kIsErrored = stream[kIsErrored]) !== null && _stream$kIsErrored !== void 0 \? _stream$kIsErrored : stream.readableErrored) !== null && _ref5 !== void 0 \? _ref5 : stream.writableErrored) !== null && _ref4 !== void 0 \? _ref4 : (_stream$_readableStat3 = stream._readableState) === null || _stream$_readableStat3 === void 0 \? void 0 : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== void 0 \? _ref3 : (_stream$_writableStat3 = stream._writableState) === null || _stream$_writableStat3 === void 0 \? void 0 : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== void 0 \? _ref2 : (_stream$_readableStat4 = stream._readableState) === null || _stream$_readableStat4 === void 0 \? void 0 : _stream$_readableStat4.errored) !== null && _ref !== void 0 \? _ref : (_stream$_writableStat4 = stream._writableState) === null || _stream$_writableStat4 === void 0 \? void 0 : _stream$_writableStat4.errored));\n }\n module.exports = {\n kDestroyed,\n isDisturbed,\n kIsDisturbed,\n isErrored,\n kIsErrored,\n isReadable,\n kIsReadable,\n isClosed,\n isDestroyed,\n isDuplexNodeStream,\n isFinished,\n isIterable,\n isReadableNodeStream,\n isReadableEnded,\n isReadableFinished,\n isReadableErrored,\n isNodeStream,\n isWritable,\n isWritableNodeStream,\n isWritableEnded,\n isWritableFinished,\n isWritableErrored,\n isServerRequest,\n isServerResponse,\n willEmitClose\n };\n }\n}), require_end_of_stream = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/end-of-stream.js\"(exports, module) {\n var { AbortError: AbortError2, codes } = require_errors(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_PREMATURE_CLOSE } = codes, { once } = require_util(), { validateAbortSignal, validateFunction, validateObject } = require_validators(), { Promise: Promise2 } = require_primordials(), {\n isClosed,\n isReadable,\n isReadableNodeStream,\n isReadableFinished,\n isReadableErrored,\n isWritable,\n isWritableNodeStream,\n isWritableFinished,\n isWritableErrored,\n isNodeStream,\n willEmitClose: _willEmitClose\n } = require_utils();\n function isRequest(stream) {\n return stream.setHeader && typeof stream.abort === \"function\";\n }\n var nop = () => {\n };\n function eos(stream, options, callback) {\n var _options$readable, _options$writable;\n if (arguments.length === 2)\n callback = options, options = {};\n else if (options == null)\n options = {};\n else\n validateObject(options, \"options\");\n validateFunction(callback, \"callback\"), validateAbortSignal(options.signal, \"options.signal\"), callback = once(callback);\n const readable = (_options$readable = options.readable) !== null && _options$readable !== void 0 \? _options$readable : isReadableNodeStream(stream), writable = (_options$writable = options.writable) !== null && _options$writable !== void 0 \? _options$writable : isWritableNodeStream(stream);\n if (!isNodeStream(stream))\n throw new ERR_INVALID_ARG_TYPE2(\"stream\", \"Stream\", stream);\n const { _writableState: wState, _readableState: rState } = stream, onlegacyfinish = () => {\n if (!stream.writable)\n onfinish();\n };\n let willEmitClose = _willEmitClose(stream) && isReadableNodeStream(stream) === readable && isWritableNodeStream(stream) === writable, writableFinished = isWritableFinished(stream, !1);\n const onfinish = () => {\n if (writableFinished = !0, stream.destroyed)\n willEmitClose = !1;\n if (willEmitClose && (!stream.readable || readable))\n return;\n if (!readable || readableFinished)\n callback.call(stream);\n };\n let readableFinished = isReadableFinished(stream, !1);\n const onend = () => {\n if (readableFinished = !0, stream.destroyed)\n willEmitClose = !1;\n if (willEmitClose && (!stream.writable || writable))\n return;\n if (!writable || writableFinished)\n callback.call(stream);\n }, onerror = (err) => {\n callback.call(stream, err);\n };\n let closed = isClosed(stream);\n const onclose = () => {\n closed = !0;\n const errored = isWritableErrored(stream) || isReadableErrored(stream);\n if (errored && typeof errored !== \"boolean\")\n return callback.call(stream, errored);\n if (readable && !readableFinished && isReadableNodeStream(stream, !0)) {\n if (!isReadableFinished(stream, !1))\n return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE);\n }\n if (writable && !writableFinished) {\n if (!isWritableFinished(stream, !1))\n return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE);\n }\n callback.call(stream);\n }, onrequest = () => {\n stream.req.on(\"finish\", onfinish);\n };\n if (isRequest(stream)) {\n if (stream.on(\"complete\", onfinish), !willEmitClose)\n stream.on(\"abort\", onclose);\n if (stream.req)\n onrequest();\n else\n stream.on(\"request\", onrequest);\n } else if (writable && !wState)\n stream.on(\"end\", onlegacyfinish), stream.on(\"close\", onlegacyfinish);\n if (!willEmitClose && typeof stream.aborted === \"boolean\")\n stream.on(\"aborted\", onclose);\n if (stream.on(\"end\", onend), stream.on(\"finish\", onfinish), options.error !== !1)\n stream.on(\"error\", onerror);\n if (stream.on(\"close\", onclose), closed)\n runOnNextTick(onclose);\n else if (wState !== null && wState !== void 0 && wState.errorEmitted || rState !== null && rState !== void 0 && rState.errorEmitted) {\n if (!willEmitClose)\n runOnNextTick(onclose);\n } else if (!readable && (!willEmitClose || isReadable(stream)) && (writableFinished || isWritable(stream) === !1))\n runOnNextTick(onclose);\n else if (!writable && (!willEmitClose || isWritable(stream)) && (readableFinished || isReadable(stream) === !1))\n runOnNextTick(onclose);\n else if (rState && stream.req && stream.aborted)\n runOnNextTick(onclose);\n const cleanup = () => {\n if (callback = nop, stream.removeListener(\"aborted\", onclose), stream.removeListener(\"complete\", onfinish), stream.removeListener(\"abort\", onclose), stream.removeListener(\"request\", onrequest), stream.req)\n stream.req.removeListener(\"finish\", onfinish);\n stream.removeListener(\"end\", onlegacyfinish), stream.removeListener(\"close\", onlegacyfinish), stream.removeListener(\"finish\", onfinish), stream.removeListener(\"end\", onend), stream.removeListener(\"error\", onerror), stream.removeListener(\"close\", onclose);\n };\n if (options.signal && !closed) {\n const abort = () => {\n const endCallback = callback;\n cleanup(), endCallback.call(stream, new AbortError2(void 0, {\n cause: options.signal.reason\n }));\n };\n if (options.signal.aborted)\n runOnNextTick(abort);\n else {\n const originalCallback = callback;\n callback = once((...args) => {\n options.signal.removeEventListener(\"abort\", abort), originalCallback.apply(stream, args);\n }), options.signal.addEventListener(\"abort\", abort);\n }\n }\n return cleanup;\n }\n function finished(stream, opts) {\n return new Promise2((resolve, reject) => {\n eos(stream, opts, (err) => {\n if (err)\n reject(err);\n else\n resolve();\n });\n });\n }\n module.exports = eos, module.exports.finished = finished;\n }\n}), require_operators = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/operators.js\"(exports, module) {\n var {\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_MISSING_ARGS, ERR_OUT_OF_RANGE },\n AbortError: AbortError2\n } = require_errors(), { validateAbortSignal, validateInteger, validateObject } = require_validators(), kWeakHandler = require_primordials().Symbol(\"kWeak\"), { finished } = require_end_of_stream(), {\n ArrayPrototypePush,\n MathFloor,\n Number: Number2,\n NumberIsNaN,\n Promise: Promise2,\n PromiseReject,\n PromisePrototypeCatch,\n Symbol: Symbol2\n } = require_primordials(), kEmpty = Symbol2(\"kEmpty\"), kEof = Symbol2(\"kEof\");\n function map(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n let concurrency = 1;\n if ((options === null || options === void 0 \? void 0 : options.concurrency) != null)\n concurrency = MathFloor(options.concurrency);\n return validateInteger(concurrency, \"concurrency\", 1), async function* map2() {\n var _options$signal, _options$signal2;\n const ac = new AbortController, stream = this, queue = [], signal = ac.signal, signalOpt = {\n signal\n }, abort = () => ac.abort();\n if (options !== null && options !== void 0 && (_options$signal = options.signal) !== null && _options$signal !== void 0 && _options$signal.aborted)\n abort();\n options === null || options === void 0 || (_options$signal2 = options.signal) === null || _options$signal2 === void 0 || _options$signal2.addEventListener(\"abort\", abort);\n let next, resume, done = !1;\n function onDone() {\n done = !0;\n }\n async function pump() {\n try {\n for await (let val of stream) {\n var _val;\n if (done)\n return;\n if (signal.aborted)\n throw new AbortError2;\n try {\n val = fn(val, signalOpt);\n } catch (err) {\n val = PromiseReject(err);\n }\n if (val === kEmpty)\n continue;\n if (typeof ((_val = val) === null || _val === void 0 \? void 0 : _val.catch) === \"function\")\n val.catch(onDone);\n if (queue.push(val), next)\n next(), next = null;\n if (!done && queue.length && queue.length >= concurrency)\n await new Promise2((resolve) => {\n resume = resolve;\n });\n }\n queue.push(kEof);\n } catch (err) {\n const val = PromiseReject(err);\n PromisePrototypeCatch(val, onDone), queue.push(val);\n } finally {\n var _options$signal3;\n if (done = !0, next)\n next(), next = null;\n options === null || options === void 0 || (_options$signal3 = options.signal) === null || _options$signal3 === void 0 || _options$signal3.removeEventListener(\"abort\", abort);\n }\n }\n pump();\n try {\n while (!0) {\n while (queue.length > 0) {\n const val = await queue[0];\n if (val === kEof)\n return;\n if (signal.aborted)\n throw new AbortError2;\n if (val !== kEmpty)\n yield val;\n if (queue.shift(), resume)\n resume(), resume = null;\n }\n await new Promise2((resolve) => {\n next = resolve;\n });\n }\n } finally {\n if (ac.abort(), done = !0, resume)\n resume(), resume = null;\n }\n }.call(this);\n }\n function asIndexedPairs(options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return async function* asIndexedPairs2() {\n let index = 0;\n for await (let val of this) {\n var _options$signal4;\n if (options !== null && options !== void 0 && (_options$signal4 = options.signal) !== null && _options$signal4 !== void 0 && _options$signal4.aborted)\n throw new AbortError2({\n cause: options.signal.reason\n });\n yield [index++, val];\n }\n }.call(this);\n }\n async function some(fn, options = void 0) {\n for await (let unused of filter.call(this, fn, options))\n return !0;\n return !1;\n }\n async function every(fn, options = void 0) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n return !await some.call(this, async (...args) => {\n return !await fn(...args);\n }, options);\n }\n async function find(fn, options) {\n for await (let result of filter.call(this, fn, options))\n return result;\n return;\n }\n async function forEach(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n async function forEachFn(value, options2) {\n return await fn(value, options2), kEmpty;\n }\n for await (let unused of map.call(this, forEachFn, options))\n ;\n }\n function filter(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n async function filterFn(value, options2) {\n if (await fn(value, options2))\n return value;\n return kEmpty;\n }\n return map.call(this, filterFn, options);\n }\n var ReduceAwareErrMissingArgs = class extends ERR_MISSING_ARGS {\n constructor() {\n super(\"reduce\");\n this.message = \"Reduce of an empty stream requires an initial value\";\n }\n };\n async function reduce(reducer, initialValue, options) {\n var _options$signal5;\n if (typeof reducer !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"reducer\", [\"Function\", \"AsyncFunction\"], reducer);\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n let hasInitialValue = arguments.length > 1;\n if (options !== null && options !== void 0 && (_options$signal5 = options.signal) !== null && _options$signal5 !== void 0 && _options$signal5.aborted) {\n const err = new AbortError2(void 0, {\n cause: options.signal.reason\n });\n throw this.once(\"error\", () => {\n }), await finished(this.destroy(err)), err;\n }\n const ac = new AbortController, signal = ac.signal;\n if (options !== null && options !== void 0 && options.signal) {\n const opts = {\n once: !0,\n [kWeakHandler]: this\n };\n options.signal.addEventListener(\"abort\", () => ac.abort(), opts);\n }\n let gotAnyItemFromStream = !1;\n try {\n for await (let value of this) {\n var _options$signal6;\n if (gotAnyItemFromStream = !0, options !== null && options !== void 0 && (_options$signal6 = options.signal) !== null && _options$signal6 !== void 0 && _options$signal6.aborted)\n throw new AbortError2;\n if (!hasInitialValue)\n initialValue = value, hasInitialValue = !0;\n else\n initialValue = await reducer(initialValue, value, {\n signal\n });\n }\n if (!gotAnyItemFromStream && !hasInitialValue)\n throw new ReduceAwareErrMissingArgs;\n } finally {\n ac.abort();\n }\n return initialValue;\n }\n async function toArray(options) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n const result = [];\n for await (let val of this) {\n var _options$signal7;\n if (options !== null && options !== void 0 && (_options$signal7 = options.signal) !== null && _options$signal7 !== void 0 && _options$signal7.aborted)\n throw new AbortError2(void 0, {\n cause: options.signal.reason\n });\n ArrayPrototypePush(result, val);\n }\n return result;\n }\n function flatMap(fn, options) {\n const values = map.call(this, fn, options);\n return async function* flatMap2() {\n for await (let val of values)\n yield* val;\n }.call(this);\n }\n function toIntegerOrInfinity(number) {\n if (number = Number2(number), NumberIsNaN(number))\n return 0;\n if (number < 0)\n throw new ERR_OUT_OF_RANGE(\"number\", \">= 0\", number);\n return number;\n }\n function drop(number, options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return number = toIntegerOrInfinity(number), async function* drop2() {\n var _options$signal8;\n if (options !== null && options !== void 0 && (_options$signal8 = options.signal) !== null && _options$signal8 !== void 0 && _options$signal8.aborted)\n throw new AbortError2;\n for await (let val of this) {\n var _options$signal9;\n if (options !== null && options !== void 0 && (_options$signal9 = options.signal) !== null && _options$signal9 !== void 0 && _options$signal9.aborted)\n throw new AbortError2;\n if (number-- <= 0)\n yield val;\n }\n }.call(this);\n }\n function take(number, options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return number = toIntegerOrInfinity(number), async function* take2() {\n var _options$signal10;\n if (options !== null && options !== void 0 && (_options$signal10 = options.signal) !== null && _options$signal10 !== void 0 && _options$signal10.aborted)\n throw new AbortError2;\n for await (let val of this) {\n var _options$signal11;\n if (options !== null && options !== void 0 && (_options$signal11 = options.signal) !== null && _options$signal11 !== void 0 && _options$signal11.aborted)\n throw new AbortError2;\n if (number-- > 0)\n yield val;\n else\n return;\n }\n }.call(this);\n }\n module.exports.streamReturningOperators = {\n asIndexedPairs,\n drop,\n filter,\n flatMap,\n map,\n take\n }, module.exports.promiseReturningOperators = {\n every,\n forEach,\n reduce,\n toArray,\n some,\n find\n };\n }\n}), require_destroy = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/destroy.js\"(exports, module) {\n var {\n aggregateTwoErrors,\n codes: { ERR_MULTIPLE_CALLBACK },\n AbortError: AbortError2\n } = require_errors(), { Symbol: Symbol2 } = require_primordials(), { kDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils(), kDestroy = \"#kDestroy\", kConstruct = \"#kConstruct\";\n function checkError(err, w, r) {\n if (err) {\n if (err.stack, w && !w.errored)\n w.errored = err;\n if (r && !r.errored)\n r.errored = err;\n }\n }\n function destroy2(err, cb) {\n const r = this._readableState, w = this._writableState, s = w || r;\n if (w && w.destroyed || r && r.destroyed) {\n if (typeof cb === \"function\")\n cb();\n return this;\n }\n if (checkError(err, w, r), w)\n w.destroyed = !0;\n if (r)\n r.destroyed = !0;\n if (!s.constructed)\n this.once(kDestroy, (er) => {\n _destroy(this, aggregateTwoErrors(er, err), cb);\n });\n else\n _destroy(this, err, cb);\n return this;\n }\n function _destroy(self, err, cb) {\n let called = !1;\n function onDestroy(err2) {\n if (called)\n return;\n called = !0;\n const { _readableState: r, _writableState: w } = self;\n if (checkError(err2, w, r), w)\n w.closed = !0;\n if (r)\n r.closed = !0;\n if (typeof cb === \"function\")\n cb(err2);\n if (err2)\n runOnNextTick(emitErrorCloseNT, self, err2);\n else\n runOnNextTick(emitCloseNT, self);\n }\n try {\n self._destroy(err || null, onDestroy);\n } catch (err2) {\n onDestroy(err2);\n }\n }\n function emitErrorCloseNT(self, err) {\n emitErrorNT(self, err), emitCloseNT(self);\n }\n function emitCloseNT(self) {\n const { _readableState: r, _writableState: w } = self;\n if (w)\n w.closeEmitted = !0;\n if (r)\n r.closeEmitted = !0;\n if (w && w.emitClose || r && r.emitClose)\n self.emit(\"close\");\n }\n function emitErrorNT(self, err) {\n const r = self\?._readableState, w = self\?._writableState;\n if (w\?.errorEmitted || r\?.errorEmitted)\n return;\n if (w)\n w.errorEmitted = !0;\n if (r)\n r.errorEmitted = !0;\n self\?.emit\?.(\"error\", err);\n }\n function undestroy() {\n const r = this._readableState, w = this._writableState;\n if (r)\n r.constructed = !0, r.closed = !1, r.closeEmitted = !1, r.destroyed = !1, r.errored = null, r.errorEmitted = !1, r.reading = !1, r.ended = r.readable === !1, r.endEmitted = r.readable === !1;\n if (w)\n w.constructed = !0, w.destroyed = !1, w.closed = !1, w.closeEmitted = !1, w.errored = null, w.errorEmitted = !1, w.finalCalled = !1, w.prefinished = !1, w.ended = w.writable === !1, w.ending = w.writable === !1, w.finished = w.writable === !1;\n }\n function errorOrDestroy2(stream, err, sync) {\n const r = stream\?._readableState, w = stream\?._writableState;\n if (w && w.destroyed || r && r.destroyed)\n return this;\n if (r && r.autoDestroy || w && w.autoDestroy)\n stream.destroy(err);\n else if (err) {\n if (Error.captureStackTrace(err), w && !w.errored)\n w.errored = err;\n if (r && !r.errored)\n r.errored = err;\n if (sync)\n runOnNextTick(emitErrorNT, stream, err);\n else\n emitErrorNT(stream, err);\n }\n }\n function construct(stream, cb) {\n if (typeof stream._construct !== \"function\")\n return;\n const { _readableState: r, _writableState: w } = stream;\n if (r)\n r.constructed = !1;\n if (w)\n w.constructed = !1;\n if (stream.once(kConstruct, cb), stream.listenerCount(kConstruct) > 1)\n return;\n runOnNextTick(constructNT, stream);\n }\n function constructNT(stream) {\n let called = !1;\n function onConstruct(err) {\n if (called) {\n errorOrDestroy2(stream, err !== null && err !== void 0 \? err : new ERR_MULTIPLE_CALLBACK);\n return;\n }\n called = !0;\n const { _readableState: r, _writableState: w } = stream, s = w || r;\n if (r)\n r.constructed = !0;\n if (w)\n w.constructed = !0;\n if (s.destroyed)\n stream.emit(kDestroy, err);\n else if (err)\n errorOrDestroy2(stream, err, !0);\n else\n runOnNextTick(emitConstructNT, stream);\n }\n try {\n stream._construct(onConstruct);\n } catch (err) {\n onConstruct(err);\n }\n }\n function emitConstructNT(stream) {\n stream.emit(kConstruct);\n }\n function isRequest(stream) {\n return stream && stream.setHeader && typeof stream.abort === \"function\";\n }\n function emitCloseLegacy(stream) {\n stream.emit(\"close\");\n }\n function emitErrorCloseLegacy(stream, err) {\n stream.emit(\"error\", err), runOnNextTick(emitCloseLegacy, stream);\n }\n function destroyer(stream, err) {\n if (!stream || isDestroyed(stream))\n return;\n if (!err && !isFinished(stream))\n err = new AbortError2;\n if (isServerRequest(stream))\n stream.socket = null, stream.destroy(err);\n else if (isRequest(stream))\n stream.abort();\n else if (isRequest(stream.req))\n stream.req.abort();\n else if (typeof stream.destroy === \"function\")\n stream.destroy(err);\n else if (typeof stream.close === \"function\")\n stream.close();\n else if (err)\n runOnNextTick(emitErrorCloseLegacy, stream);\n else\n runOnNextTick(emitCloseLegacy, stream);\n if (!stream.destroyed)\n stream[kDestroyed] = !0;\n }\n module.exports = {\n construct,\n destroyer,\n destroy: destroy2,\n undestroy,\n errorOrDestroy: errorOrDestroy2\n };\n }\n}), require_legacy = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/legacy.js\"(exports, module) {\n var { ArrayIsArray: ArrayIsArray2, ObjectSetPrototypeOf } = require_primordials();\n function Stream(options) {\n if (!(this instanceof Stream))\n return new Stream(options);\n EE.call(this, options);\n }\n Stream.prototype = {}, ObjectSetPrototypeOf(Stream.prototype, EE.prototype), ObjectSetPrototypeOf(Stream, EE), Stream.prototype.pipe = function(dest, options) {\n const source = this;\n function ondata(chunk) {\n if (dest.writable && dest.write(chunk) === !1 && source.pause)\n source.pause();\n }\n source.on(\"data\", ondata);\n function ondrain() {\n if (source.readable && source.resume)\n source.resume();\n }\n if (dest.on(\"drain\", ondrain), !dest._isStdio && (!options || options.end !== !1))\n source.on(\"end\", onend), source.on(\"close\", onclose);\n let didOnEnd = !1;\n function onend() {\n if (didOnEnd)\n return;\n didOnEnd = !0, dest.end();\n }\n function onclose() {\n if (didOnEnd)\n return;\n if (didOnEnd = !0, typeof dest.destroy === \"function\")\n dest.destroy();\n }\n function onerror(er) {\n if (cleanup(), EE.listenerCount(this, \"error\") === 0)\n this.emit(\"error\", er);\n }\n prependListener(source, \"error\", onerror), prependListener(dest, \"error\", onerror);\n function cleanup() {\n source.removeListener(\"data\", ondata), dest.removeListener(\"drain\", ondrain), source.removeListener(\"end\", onend), source.removeListener(\"close\", onclose), source.removeListener(\"error\", onerror), dest.removeListener(\"error\", onerror), source.removeListener(\"end\", cleanup), source.removeListener(\"close\", cleanup), dest.removeListener(\"close\", cleanup);\n }\n return source.on(\"end\", cleanup), source.on(\"close\", cleanup), dest.on(\"close\", cleanup), dest.emit(\"pipe\", source), dest;\n };\n function prependListener(emitter, event, fn) {\n if (typeof emitter.prependListener === \"function\")\n return emitter.prependListener(event, fn);\n if (!emitter._events || !emitter._events[event])\n emitter.on(event, fn);\n else if (ArrayIsArray2(emitter._events[event]))\n emitter._events[event].unshift(fn);\n else\n emitter._events[event] = [fn, emitter._events[event]];\n }\n module.exports = {\n Stream,\n prependListener\n };\n }\n}), require_add_abort_signal = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/add-abort-signal.js\"(exports, module) {\n var { AbortError: AbortError2, codes } = require_errors(), eos = require_end_of_stream(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2 } = codes, validateAbortSignal = (signal, name) => {\n if (typeof signal !== \"object\" || !(\"aborted\" in signal))\n throw new ERR_INVALID_ARG_TYPE2(name, \"AbortSignal\", signal);\n };\n function isNodeStream(obj) {\n return !!(obj && typeof obj.pipe === \"function\");\n }\n module.exports.addAbortSignal = function addAbortSignal(signal, stream) {\n if (validateAbortSignal(signal, \"signal\"), !isNodeStream(stream))\n throw new ERR_INVALID_ARG_TYPE2(\"stream\", \"stream.Stream\", stream);\n return module.exports.addAbortSignalNoValidate(signal, stream);\n }, module.exports.addAbortSignalNoValidate = function(signal, stream) {\n if (typeof signal !== \"object\" || !(\"aborted\" in signal))\n return stream;\n const onAbort = () => {\n stream.destroy(new AbortError2(void 0, {\n cause: signal.reason\n }));\n };\n if (signal.aborted)\n onAbort();\n else\n signal.addEventListener(\"abort\", onAbort), eos(stream, () => signal.removeEventListener(\"abort\", onAbort));\n return stream;\n };\n }\n}), require_state = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/state.js\"(exports, module) {\n var { MathFloor, NumberIsInteger } = require_primordials(), { ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2 } = require_errors().codes;\n function highWaterMarkFrom(options, isDuplex, duplexKey) {\n return options.highWaterMark != null \? options.highWaterMark : isDuplex \? options[duplexKey] : null;\n }\n function getDefaultHighWaterMark(objectMode) {\n return objectMode \? 16 : 16384;\n }\n function getHighWaterMark(state, options, duplexKey, isDuplex) {\n const hwm = highWaterMarkFrom(options, isDuplex, duplexKey);\n if (hwm != null) {\n if (!NumberIsInteger(hwm) || hwm < 0) {\n const name = isDuplex \? `options.${duplexKey}` : \"options.highWaterMark\";\n throw new ERR_INVALID_ARG_VALUE2(name, hwm);\n }\n return MathFloor(hwm);\n }\n return getDefaultHighWaterMark(state.objectMode);\n }\n module.exports = {\n getHighWaterMark,\n getDefaultHighWaterMark\n };\n }\n}), require_from = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/from.js\"(exports, module) {\n var { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_NULL_VALUES } = require_errors().codes;\n function from(Readable, iterable, opts) {\n let iterator;\n if (typeof iterable === \"string\" || iterable instanceof Buffer)\n return new Readable({\n objectMode: !0,\n ...opts,\n read() {\n this.push(iterable), this.push(null);\n }\n });\n let isAsync;\n if (iterable && iterable[SymbolAsyncIterator])\n isAsync = !0, iterator = iterable[SymbolAsyncIterator]();\n else if (iterable && iterable[SymbolIterator])\n isAsync = !1, iterator = iterable[SymbolIterator]();\n else\n throw new ERR_INVALID_ARG_TYPE2(\"iterable\", [\"Iterable\"], iterable);\n const readable = new Readable({\n objectMode: !0,\n highWaterMark: 1,\n ...opts\n });\n let reading = !1;\n readable._read = function() {\n if (!reading)\n reading = !0, next();\n }, readable._destroy = function(error, cb) {\n PromisePrototypeThen(close(error), () => runOnNextTick(cb, error), (e) => runOnNextTick(cb, e || error));\n };\n async function close(error) {\n const hadError = error !== void 0 && error !== null, hasThrow = typeof iterator.throw === \"function\";\n if (hadError && hasThrow) {\n const { value, done } = await iterator.throw(error);\n if (await value, done)\n return;\n }\n if (typeof iterator.return === \"function\") {\n const { value } = await iterator.return();\n await value;\n }\n }\n async function next() {\n for (;; ) {\n try {\n const { value, done } = isAsync \? await iterator.next() : iterator.next();\n if (done)\n readable.push(null);\n else {\n const res = value && typeof value.then === \"function\" \? await value : value;\n if (res === null)\n throw reading = !1, new ERR_STREAM_NULL_VALUES;\n else if (readable.push(res))\n continue;\n else\n reading = !1;\n }\n } catch (err) {\n readable.destroy(err);\n }\n break;\n }\n }\n return readable;\n }\n module.exports = from;\n }\n}), _ReadableFromWeb, _ReadableFromWebForUndici, require_readable = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/readable.js\"(exports, module) {\n var {\n ArrayPrototypeIndexOf,\n NumberIsInteger,\n NumberIsNaN,\n NumberParseInt,\n ObjectDefineProperties,\n ObjectKeys,\n ObjectSetPrototypeOf,\n Promise: Promise2,\n SafeSet,\n SymbolAsyncIterator,\n Symbol: Symbol2\n } = require_primordials(), ReadableState = globalThis[globalThis.Symbol.for('Bun.lazy')](\"bun:stream\").ReadableState, { Stream, prependListener } = require_legacy();\n function Readable(options) {\n if (!(this instanceof Readable))\n return new Readable(options);\n const isDuplex = this instanceof require_duplex();\n if (this._readableState = new ReadableState(options, this, isDuplex), options) {\n const { read, destroy: destroy2, construct, signal } = options;\n if (typeof read === \"function\")\n this._read = read;\n if (typeof destroy2 === \"function\")\n this._destroy = destroy2;\n if (typeof construct === \"function\")\n this._construct = construct;\n if (signal && !isDuplex)\n addAbortSignal(signal, this);\n }\n Stream.call(this, options), destroyImpl.construct(this, () => {\n if (this._readableState.needReadable)\n maybeReadMore(this, this._readableState);\n });\n }\n Readable.prototype = {}, ObjectSetPrototypeOf(Readable.prototype, Stream.prototype), ObjectSetPrototypeOf(Readable, Stream), Readable.prototype.on = function(ev, fn) {\n const res = Stream.prototype.on.call(this, ev, fn), state = this._readableState;\n if (ev === \"data\") {\n if (state.readableListening = this.listenerCount(\"readable\") > 0, state.flowing !== !1)\n this.resume();\n } else if (ev === \"readable\") {\n if (!state.endEmitted && !state.readableListening) {\n if (state.readableListening = state.needReadable = !0, state.flowing = !1, state.emittedReadable = !1, state.length)\n emitReadable(this, state);\n else if (!state.reading)\n runOnNextTick(nReadingNextTick, this);\n } else if (state.endEmitted)\n ;\n }\n return res;\n };\n\n class ReadableFromWeb extends Readable {\n #reader;\n #closed;\n #pendingChunks;\n #stream;\n constructor(options, stream) {\n const { objectMode, highWaterMark, encoding, signal } = options;\n super({\n objectMode,\n highWaterMark,\n encoding,\n signal\n });\n this.#pendingChunks = [], this.#reader = void 0, this.#stream = stream, this.#closed = !1;\n }\n #drainPending() {\n var pendingChunks = this.#pendingChunks, pendingChunksI = 0, pendingChunksCount = pendingChunks.length;\n for (;pendingChunksI < pendingChunksCount; pendingChunksI++) {\n const chunk = pendingChunks[pendingChunksI];\n if (pendingChunks[pendingChunksI] = void 0, !this.push(chunk, void 0))\n return this.#pendingChunks = pendingChunks.slice(pendingChunksI + 1), !0;\n }\n if (pendingChunksCount > 0)\n this.#pendingChunks = [];\n return !1;\n }\n #handleDone(reader) {\n reader.releaseLock(), this.#reader = void 0, this.#closed = !0, this.push(null);\n return;\n }\n async _read() {\n var stream = this.#stream, reader = this.#reader;\n if (stream)\n reader = this.#reader = stream.getReader(), this.#stream = void 0;\n else if (this.#drainPending())\n return;\n var deferredError;\n try {\n do {\n var done = !1, value;\n const firstResult = reader.readMany();\n if (@isPromise(firstResult)) {\n if ({ done, value } = await firstResult, this.#closed) {\n this.#pendingChunks.push(...value);\n return;\n }\n } else\n ({ done, value } = firstResult);\n if (done) {\n this.#handleDone(reader);\n return;\n }\n if (!this.push(value[0])) {\n this.#pendingChunks = value.slice(1);\n return;\n }\n for (let i = 1, count = value.length;i < count; i++)\n if (!this.push(value[i])) {\n this.#pendingChunks = value.slice(i + 1);\n return;\n }\n } while (!this.#closed);\n } catch (e) {\n deferredError = e;\n } finally {\n if (deferredError)\n throw deferredError;\n }\n }\n _destroy(error, callback) {\n if (!this.#closed) {\n var reader = this.#reader;\n if (reader)\n this.#reader = void 0, reader.cancel(error).finally(() => {\n this.#closed = !0, callback(error);\n });\n return;\n }\n try {\n callback(error);\n } catch (error2) {\n globalThis.reportError(error2);\n }\n }\n }\n _ReadableFromWebForUndici = ReadableFromWeb;\n function newStreamReadableFromReadableStream(readableStream, options = {}) {\n if (!isReadableStream(readableStream))\n throw new ERR_INVALID_ARG_TYPE2(\"readableStream\", \"ReadableStream\", readableStream);\n validateObject(options, \"options\");\n const {\n highWaterMark,\n encoding,\n objectMode = !1,\n signal\n } = options;\n if (encoding !== void 0 && !Buffer.isEncoding(encoding))\n throw new ERR_INVALID_ARG_VALUE(encoding, \"options.encoding\");\n return validateBoolean(objectMode, \"options.objectMode\"), getNativeReadableStream(Readable, readableStream, options) || new ReadableFromWeb({\n highWaterMark,\n encoding,\n objectMode,\n signal\n }, readableStream);\n }\n module.exports = Readable, _ReadableFromWeb = newStreamReadableFromReadableStream;\n var { addAbortSignal } = require_add_abort_signal(), eos = require_end_of_stream();\n const { maybeReadMore: _maybeReadMore, resume, emitReadable: _emitReadable, onEofChunk } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"bun:stream\");\n function maybeReadMore(stream, state) {\n process.nextTick(_maybeReadMore, stream, state);\n }\n function emitReadable(stream, state) {\n _emitReadable(stream, state);\n }\n var destroyImpl = require_destroy(), {\n aggregateTwoErrors,\n codes: {\n ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_OUT_OF_RANGE,\n ERR_STREAM_PUSH_AFTER_EOF,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT\n }\n } = require_errors(), { validateObject } = require_validators(), from = require_from(), nop = () => {\n }, { errorOrDestroy: errorOrDestroy2 } = destroyImpl;\n Readable.prototype.destroy = destroyImpl.destroy, Readable.prototype._undestroy = destroyImpl.undestroy, Readable.prototype._destroy = function(err, cb) {\n cb(err);\n }, Readable.prototype[EE.captureRejectionSymbol] = function(err) {\n this.destroy(err);\n }, Readable.prototype.push = function(chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, !1);\n }, Readable.prototype.unshift = function(chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, !0);\n };\n function readableAddChunk(stream, chunk, encoding, addToFront) {\n const state = stream._readableState;\n let err;\n if (!state.objectMode) {\n if (typeof chunk === \"string\") {\n if (encoding = encoding || state.defaultEncoding, state.encoding !== encoding)\n if (addToFront && state.encoding)\n chunk = Buffer.from(chunk, encoding).toString(state.encoding);\n else\n chunk = Buffer.from(chunk, encoding), encoding = \"\";\n } else if (chunk instanceof Buffer)\n encoding = \"\";\n else if (Stream._isUint8Array(chunk)) {\n if (addToFront || !state.decoder)\n chunk = Stream._uint8ArrayToBuffer(chunk);\n encoding = \"\";\n } else if (chunk != null)\n err = new ERR_INVALID_ARG_TYPE2(\"chunk\", [\"string\", \"Buffer\", \"Uint8Array\"], chunk);\n }\n if (err)\n errorOrDestroy2(stream, err);\n else if (chunk === null)\n state.reading = !1, onEofChunk(stream, state);\n else if (state.objectMode || chunk && chunk.length > 0)\n if (addToFront)\n if (state.endEmitted)\n errorOrDestroy2(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT);\n else if (state.destroyed || state.errored)\n return !1;\n else\n addChunk(stream, state, chunk, !0);\n else if (state.ended)\n errorOrDestroy2(stream, new ERR_STREAM_PUSH_AFTER_EOF);\n else if (state.destroyed || state.errored)\n return !1;\n else if (state.reading = !1, state.decoder && !encoding)\n if (chunk = state.decoder.write(chunk), state.objectMode || chunk.length !== 0)\n addChunk(stream, state, chunk, !1);\n else\n maybeReadMore(stream, state);\n else\n addChunk(stream, state, chunk, !1);\n else if (!addToFront)\n state.reading = !1, maybeReadMore(stream, state);\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n }\n function addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync && stream.listenerCount(\"data\") > 0) {\n if (state.multiAwaitDrain)\n state.awaitDrainWriters.clear();\n else\n state.awaitDrainWriters = null;\n state.dataEmitted = !0, stream.emit(\"data\", chunk);\n } else {\n if (state.length += state.objectMode \? 1 : chunk.length, addToFront)\n state.buffer.unshift(chunk);\n else\n state.buffer.push(chunk);\n if (state.needReadable)\n emitReadable(stream, state);\n }\n maybeReadMore(stream, state);\n }\n Readable.prototype.isPaused = function() {\n const state = this._readableState;\n return state.paused === !0 || state.flowing === !1;\n }, Readable.prototype.setEncoding = function(enc) {\n const decoder = new StringDecoder(enc);\n this._readableState.decoder = decoder, this._readableState.encoding = this._readableState.decoder.encoding;\n const buffer = this._readableState.buffer;\n let content = \"\";\n for (let i = buffer.length;i > 0; i--)\n content += decoder.write(buffer.shift());\n if (content !== \"\")\n buffer.push(content);\n return this._readableState.length = content.length, this;\n };\n var MAX_HWM = 1073741824;\n function computeNewHighWaterMark(n) {\n if (n > MAX_HWM)\n throw new ERR_OUT_OF_RANGE(\"size\", \"<= 1GiB\", n);\n else\n n--, n |= n >>> 1, n |= n >>> 2, n |= n >>> 4, n |= n >>> 8, n |= n >>> 16, n++;\n return n;\n }\n function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended)\n return 0;\n if (state.objectMode)\n return 1;\n if (NumberIsNaN(n)) {\n if (state.flowing && state.length)\n return state.buffer.first().length;\n return state.length;\n }\n if (n <= state.length)\n return n;\n return state.ended \? state.length : 0;\n }\n Readable.prototype.read = function(n) {\n if (!NumberIsInteger(n))\n n = NumberParseInt(n, 10);\n const state = this._readableState, nOrig = n;\n if (n > state.highWaterMark)\n state.highWaterMark = computeNewHighWaterMark(n);\n if (n !== 0)\n state.emittedReadable = !1;\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 \? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n if (state.length === 0 && state.ended)\n endReadable(this);\n else\n emitReadable(this, state);\n return null;\n }\n if (n = howMuchToRead(n, state), n === 0 && state.ended) {\n if (state.length === 0)\n endReadable(this);\n return null;\n }\n let doRead = state.needReadable;\n if (state.length === 0 || state.length - n < state.highWaterMark)\n doRead = !0;\n if (state.ended || state.reading || state.destroyed || state.errored || !state.constructed)\n doRead = !1;\n else if (doRead) {\n if (state.reading = !0, state.sync = !0, state.length === 0)\n state.needReadable = !0;\n try {\n var result = this._read(state.highWaterMark);\n if (@isPromise(result)) {\n const peeked = Bun.peek(result);\n if (peeked !== result)\n result = peeked;\n }\n if (@isPromise(result) && result\?.then && @isCallable(result.then))\n result.then(nop, function(err) {\n errorOrDestroy2(this, err);\n });\n } catch (err) {\n errorOrDestroy2(this, err);\n }\n if (state.sync = !1, !state.reading)\n n = howMuchToRead(nOrig, state);\n }\n let ret;\n if (n > 0)\n ret = fromList(n, state);\n else\n ret = null;\n if (ret === null)\n state.needReadable = state.length <= state.highWaterMark, n = 0;\n else if (state.length -= n, state.multiAwaitDrain)\n state.awaitDrainWriters.clear();\n else\n state.awaitDrainWriters = null;\n if (state.length === 0) {\n if (!state.ended)\n state.needReadable = !0;\n if (nOrig !== n && state.ended)\n endReadable(this);\n }\n if (ret !== null && !state.errorEmitted && !state.closeEmitted)\n state.dataEmitted = !0, this.emit(\"data\", ret);\n return ret;\n }, Readable.prototype._read = function(n) {\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_read()\");\n }, Readable.prototype.pipe = function(dest, pipeOpts) {\n const src = this, state = this._readableState;\n if (state.pipes.length === 1) {\n if (!state.multiAwaitDrain)\n state.multiAwaitDrain = !0, state.awaitDrainWriters = new SafeSet(state.awaitDrainWriters \? [state.awaitDrainWriters] : []);\n }\n state.pipes.push(dest);\n const endFn = (!pipeOpts || pipeOpts.end !== !1) && dest !== process.stdout && dest !== process.stderr \? onend : unpipe;\n if (state.endEmitted)\n runOnNextTick(endFn);\n else\n src.once(\"end\", endFn);\n dest.on(\"unpipe\", onunpipe);\n function onunpipe(readable, unpipeInfo) {\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === !1)\n unpipeInfo.hasUnpiped = !0, cleanup();\n }\n }\n function onend() {\n dest.end();\n }\n let ondrain, cleanedUp = !1;\n function cleanup() {\n if (dest.removeListener(\"close\", onclose), dest.removeListener(\"finish\", onfinish), ondrain)\n dest.removeListener(\"drain\", ondrain);\n if (dest.removeListener(\"error\", onerror), dest.removeListener(\"unpipe\", onunpipe), src.removeListener(\"end\", onend), src.removeListener(\"end\", unpipe), src.removeListener(\"data\", ondata), cleanedUp = !0, ondrain && state.awaitDrainWriters && (!dest._writableState || dest._writableState.needDrain))\n ondrain();\n }\n function pause() {\n if (!cleanedUp) {\n if (state.pipes.length === 1 && state.pipes[0] === dest)\n state.awaitDrainWriters = dest, state.multiAwaitDrain = !1;\n else if (state.pipes.length > 1 && state.pipes.includes(dest))\n state.awaitDrainWriters.add(dest);\n src.pause();\n }\n if (!ondrain)\n ondrain = pipeOnDrain(src, dest), dest.on(\"drain\", ondrain);\n }\n src.on(\"data\", ondata);\n function ondata(chunk) {\n if (dest.write(chunk) === !1)\n pause();\n }\n function onerror(er) {\n if (unpipe(), dest.removeListener(\"error\", onerror), dest.listenerCount(\"error\") === 0) {\n const s = dest._writableState || dest._readableState;\n if (s && !s.errorEmitted)\n errorOrDestroy2(dest, er);\n else\n dest.emit(\"error\", er);\n }\n }\n prependListener(dest, \"error\", onerror);\n function onclose() {\n dest.removeListener(\"finish\", onfinish), unpipe();\n }\n dest.once(\"close\", onclose);\n function onfinish() {\n dest.removeListener(\"close\", onclose), unpipe();\n }\n dest.once(\"finish\", onfinish);\n function unpipe() {\n src.unpipe(dest);\n }\n if (dest.emit(\"pipe\", src), dest.writableNeedDrain === !0) {\n if (state.flowing)\n pause();\n } else if (!state.flowing)\n src.resume();\n return dest;\n };\n function pipeOnDrain(src, dest) {\n return function pipeOnDrainFunctionResult() {\n const state = src._readableState;\n if (state.awaitDrainWriters === dest)\n state.awaitDrainWriters = null;\n else if (state.multiAwaitDrain)\n state.awaitDrainWriters.delete(dest);\n if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && src.listenerCount(\"data\"))\n src.resume();\n };\n }\n Readable.prototype.unpipe = function(dest) {\n const state = this._readableState, unpipeInfo = {\n hasUnpiped: !1\n };\n if (state.pipes.length === 0)\n return this;\n if (!dest) {\n const dests = state.pipes;\n state.pipes = [], this.pause();\n for (let i = 0;i < dests.length; i++)\n dests[i].emit(\"unpipe\", this, {\n hasUnpiped: !1\n });\n return this;\n }\n const index = ArrayPrototypeIndexOf(state.pipes, dest);\n if (index === -1)\n return this;\n if (state.pipes.splice(index, 1), state.pipes.length === 0)\n this.pause();\n return dest.emit(\"unpipe\", this, unpipeInfo), this;\n }, Readable.prototype.addListener = Readable.prototype.on, Readable.prototype.removeListener = function(ev, fn) {\n const res = Stream.prototype.removeListener.call(this, ev, fn);\n if (ev === \"readable\")\n runOnNextTick(updateReadableListening, this);\n return res;\n }, Readable.prototype.off = Readable.prototype.removeListener, Readable.prototype.removeAllListeners = function(ev) {\n const res = Stream.prototype.removeAllListeners.apply(this, arguments);\n if (ev === \"readable\" || ev === void 0)\n runOnNextTick(updateReadableListening, this);\n return res;\n };\n function updateReadableListening(self) {\n const state = self._readableState;\n if (state.readableListening = self.listenerCount(\"readable\") > 0, state.resumeScheduled && state.paused === !1)\n state.flowing = !0;\n else if (self.listenerCount(\"data\") > 0)\n self.resume();\n else if (!state.readableListening)\n state.flowing = null;\n }\n function nReadingNextTick(self) {\n self.read(0);\n }\n Readable.prototype.resume = function() {\n const state = this._readableState;\n if (!state.flowing)\n state.flowing = !state.readableListening, resume(this, state);\n return state.paused = !1, this;\n }, Readable.prototype.pause = function() {\n if (this._readableState.flowing !== !1)\n this._readableState.flowing = !1, this.emit(\"pause\");\n return this._readableState.paused = !0, this;\n }, Readable.prototype.wrap = function(stream) {\n let paused = !1;\n stream.on(\"data\", (chunk) => {\n if (!this.push(chunk) && stream.pause)\n paused = !0, stream.pause();\n }), stream.on(\"end\", () => {\n this.push(null);\n }), stream.on(\"error\", (err) => {\n errorOrDestroy2(this, err);\n }), stream.on(\"close\", () => {\n this.destroy();\n }), stream.on(\"destroy\", () => {\n this.destroy();\n }), this._read = () => {\n if (paused && stream.resume)\n paused = !1, stream.resume();\n };\n const streamKeys = ObjectKeys(stream);\n for (let j = 1;j < streamKeys.length; j++) {\n const i = streamKeys[j];\n if (this[i] === void 0 && typeof stream[i] === \"function\")\n this[i] = stream[i].bind(stream);\n }\n return this;\n }, Readable.prototype[SymbolAsyncIterator] = function() {\n return streamToAsyncIterator(this);\n }, Readable.prototype.iterator = function(options) {\n if (options !== void 0)\n validateObject(options, \"options\");\n return streamToAsyncIterator(this, options);\n };\n function streamToAsyncIterator(stream, options) {\n if (typeof stream.read !== \"function\")\n stream = Readable.wrap(stream, {\n objectMode: !0\n });\n const iter = createAsyncIterator(stream, options);\n return iter.stream = stream, iter;\n }\n async function* createAsyncIterator(stream, options) {\n let callback = nop;\n function next(resolve) {\n if (this === stream)\n callback(), callback = nop;\n else\n callback = resolve;\n }\n stream.on(\"readable\", next);\n let error;\n const cleanup = eos(stream, {\n writable: !1\n }, (err) => {\n error = err \? aggregateTwoErrors(error, err) : null, callback(), callback = nop;\n });\n try {\n while (!0) {\n const chunk = stream.destroyed \? null : stream.read();\n if (chunk !== null)\n yield chunk;\n else if (error)\n throw error;\n else if (error === null)\n return;\n else\n await new Promise2(next);\n }\n } catch (err) {\n throw error = aggregateTwoErrors(error, err), error;\n } finally {\n if ((error || (options === null || options === void 0 \? void 0 : options.destroyOnReturn) !== !1) && (error === void 0 || stream._readableState.autoDestroy))\n destroyImpl.destroyer(stream, null);\n else\n stream.off(\"readable\", next), cleanup();\n }\n }\n ObjectDefineProperties(Readable.prototype, {\n readable: {\n get() {\n const r = this._readableState;\n return !!r && r.readable !== !1 && !r.destroyed && !r.errorEmitted && !r.endEmitted;\n },\n set(val) {\n if (this._readableState)\n this._readableState.readable = !!val;\n }\n },\n readableDidRead: {\n enumerable: !1,\n get: function() {\n return this._readableState.dataEmitted;\n }\n },\n readableAborted: {\n enumerable: !1,\n get: function() {\n return !!(this._readableState.readable !== !1 && (this._readableState.destroyed || this._readableState.errored) && !this._readableState.endEmitted);\n }\n },\n readableHighWaterMark: {\n enumerable: !1,\n get: function() {\n return this._readableState.highWaterMark;\n }\n },\n readableBuffer: {\n enumerable: !1,\n get: function() {\n return this._readableState && this._readableState.buffer;\n }\n },\n readableFlowing: {\n enumerable: !1,\n get: function() {\n return this._readableState.flowing;\n },\n set: function(state) {\n if (this._readableState)\n this._readableState.flowing = state;\n }\n },\n readableLength: {\n enumerable: !1,\n get() {\n return this._readableState.length;\n }\n },\n readableObjectMode: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.objectMode : !1;\n }\n },\n readableEncoding: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.encoding : null;\n }\n },\n errored: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.errored : null;\n }\n },\n closed: {\n get() {\n return this._readableState \? this._readableState.closed : !1;\n }\n },\n destroyed: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.destroyed : !1;\n },\n set(value) {\n if (!this._readableState)\n return;\n this._readableState.destroyed = value;\n }\n },\n readableEnded: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.endEmitted : !1;\n }\n }\n }), Readable._fromList = fromList;\n function fromList(n, state) {\n if (state.length === 0)\n return null;\n let ret;\n if (state.objectMode)\n ret = state.buffer.shift();\n else if (!n || n >= state.length) {\n if (state.decoder)\n ret = state.buffer.join(\"\");\n else if (state.buffer.length === 1)\n ret = state.buffer.first();\n else\n ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else\n ret = state.buffer.consume(n, state.decoder);\n return ret;\n }\n function endReadable(stream) {\n const state = stream._readableState;\n if (!state.endEmitted)\n state.ended = !0, runOnNextTick(endReadableNT, state, stream);\n }\n function endReadableNT(state, stream) {\n if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) {\n if (state.endEmitted = !0, stream.emit(\"end\"), stream.writable && stream.allowHalfOpen === !1)\n runOnNextTick(endWritableNT, stream);\n else if (state.autoDestroy) {\n const wState = stream._writableState;\n if (!wState || wState.autoDestroy && (wState.finished || wState.writable === !1))\n stream.destroy();\n }\n }\n }\n function endWritableNT(stream) {\n if (stream.writable && !stream.writableEnded && !stream.destroyed)\n stream.end();\n }\n Readable.from = function(iterable, opts) {\n return from(Readable, iterable, opts);\n };\n var webStreamsAdapters = {\n newStreamReadableFromReadableStream,\n newReadableStreamFromStreamReadable(streamReadable, options = {}) {\n if (typeof streamReadable\?._readableState !== \"object\")\n throw new ERR_INVALID_ARG_TYPE2(\"streamReadable\", \"stream.Readable\", streamReadable);\n var { isDestroyed, isReadable } = require_utils();\n if (isDestroyed(streamReadable) || !isReadable(streamReadable)) {\n const readable = new ReadableStream;\n return readable.cancel(), readable;\n }\n const { readableObjectMode: objectMode, readableHighWaterMark: highWaterMark } = streamReadable, strategy = ((strategy2) => {\n if (strategy2)\n return strategy2;\n if (objectMode)\n return new CountQueuingStrategy({ highWaterMark });\n return { highWaterMark };\n })(options\?.strategy);\n let controller;\n function onData(chunk) {\n if (controller.enqueue(chunk), controller.desiredSize <= 0)\n streamReadable.pause();\n }\n streamReadable.pause();\n const cleanup = eos(streamReadable, (error) => {\n if (error\?.code === \"ERR_STREAM_PREMATURE_CLOSE\")\n error = new AbortError(void 0, { cause: error });\n if (cleanup(), streamReadable.on(\"error\", () => {\n }), error)\n return controller.error(error);\n controller.close();\n });\n return streamReadable.on(\"data\", onData), new ReadableStream({\n start(c) {\n controller = c;\n },\n pull() {\n streamReadable.resume();\n },\n cancel(reason) {\n destroy(streamReadable, reason);\n }\n }, strategy);\n }\n };\n Readable.fromWeb = function(readableStream, options) {\n return webStreamsAdapters.newStreamReadableFromReadableStream(readableStream, options);\n }, Readable.toWeb = function(streamReadable, options) {\n return webStreamsAdapters.newReadableStreamFromStreamReadable(streamReadable, options);\n }, Readable.wrap = function(src, options) {\n var _ref, _src$readableObjectMo;\n return new Readable({\n objectMode: (_ref = (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== void 0 \? _src$readableObjectMo : src.objectMode) !== null && _ref !== void 0 \? _ref : !0,\n ...options,\n destroy(err, callback) {\n destroyImpl.destroyer(src, err), callback(err);\n }\n }).wrap(src);\n };\n }\n}), require_writable = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/writable.js\"(exports, module) {\n var {\n ArrayPrototypeSlice,\n Error: Error2,\n FunctionPrototypeSymbolHasInstance,\n ObjectDefineProperty,\n ObjectDefineProperties,\n ObjectSetPrototypeOf,\n StringPrototypeToLowerCase,\n Symbol: Symbol2,\n SymbolHasInstance\n } = require_primordials(), Stream = require_legacy().Stream, destroyImpl = require_destroy(), { addAbortSignal } = require_add_abort_signal(), { getHighWaterMark, getDefaultHighWaterMark } = require_state(), {\n ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK,\n ERR_STREAM_CANNOT_PIPE,\n ERR_STREAM_DESTROYED,\n ERR_STREAM_ALREADY_FINISHED,\n ERR_STREAM_NULL_VALUES,\n ERR_STREAM_WRITE_AFTER_END,\n ERR_UNKNOWN_ENCODING\n } = require_errors().codes, { errorOrDestroy: errorOrDestroy2 } = destroyImpl;\n function Writable(options = {}) {\n const isDuplex = this instanceof require_duplex();\n if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable, this))\n return new Writable(options);\n if (this._writableState = new WritableState(options, this, isDuplex), options) {\n if (typeof options.write === \"function\")\n this._write = options.write;\n if (typeof options.writev === \"function\")\n this._writev = options.writev;\n if (typeof options.destroy === \"function\")\n this._destroy = options.destroy;\n if (typeof options.final === \"function\")\n this._final = options.final;\n if (typeof options.construct === \"function\")\n this._construct = options.construct;\n if (options.signal)\n addAbortSignal(options.signal, this);\n }\n Stream.call(this, options), destroyImpl.construct(this, () => {\n const state = this._writableState;\n if (!state.writing)\n clearBuffer(this, state);\n finishMaybe(this, state);\n });\n }\n Writable.prototype = {}, ObjectSetPrototypeOf(Writable.prototype, Stream.prototype), ObjectSetPrototypeOf(Writable, Stream), module.exports = Writable;\n function nop() {\n }\n var kOnFinished = Symbol2(\"kOnFinished\");\n function WritableState(options, stream, isDuplex) {\n if (typeof isDuplex !== \"boolean\")\n isDuplex = stream instanceof require_duplex();\n if (this.objectMode = !!(options && options.objectMode), isDuplex)\n this.objectMode = this.objectMode || !!(options && options.writableObjectMode);\n this.highWaterMark = options \? getHighWaterMark(this, options, \"writableHighWaterMark\", isDuplex) : getDefaultHighWaterMark(!1), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;\n const noDecode = !!(options && options.decodeStrings === !1);\n this.decodeStrings = !noDecode, this.defaultEncoding = options && options.defaultEncoding || \"utf8\", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = onwrite.bind(void 0, stream), this.writecb = null, this.writelen = 0, this.afterWriteTickInfo = null, resetBuffer(this), this.pendingcb = 0, this.constructed = !0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = !options || options.emitClose !== !1, this.autoDestroy = !options || options.autoDestroy !== !1, this.errored = null, this.closed = !1, this.closeEmitted = !1, this[kOnFinished] = [];\n }\n WritableState.prototype = {};\n function resetBuffer(state) {\n state.buffered = [], state.bufferedIndex = 0, state.allBuffers = !0, state.allNoop = !0;\n }\n WritableState.prototype.getBuffer = function getBuffer() {\n return ArrayPrototypeSlice(this.buffered, this.bufferedIndex);\n }, ObjectDefineProperty(WritableState.prototype, \"bufferedRequestCount\", {\n get() {\n return this.buffered.length - this.bufferedIndex;\n }\n }), ObjectDefineProperty(Writable, SymbolHasInstance, {\n value: function(object) {\n if (FunctionPrototypeSymbolHasInstance(this, object))\n return !0;\n if (this !== Writable)\n return !1;\n return object && object._writableState instanceof WritableState;\n }\n }), Writable.prototype.pipe = function() {\n errorOrDestroy2(this, new ERR_STREAM_CANNOT_PIPE);\n };\n function _write(stream, chunk, encoding, cb) {\n const state = stream._writableState;\n if (typeof encoding === \"function\")\n cb = encoding, encoding = state.defaultEncoding;\n else {\n if (!encoding)\n encoding = state.defaultEncoding;\n else if (encoding !== \"buffer\" && !Buffer.isEncoding(encoding))\n throw new ERR_UNKNOWN_ENCODING(encoding);\n if (typeof cb !== \"function\")\n cb = nop;\n }\n if (chunk === null)\n throw new ERR_STREAM_NULL_VALUES;\n else if (!state.objectMode)\n if (typeof chunk === \"string\") {\n if (state.decodeStrings !== !1)\n chunk = Buffer.from(chunk, encoding), encoding = \"buffer\";\n } else if (chunk instanceof Buffer)\n encoding = \"buffer\";\n else if (Stream._isUint8Array(chunk))\n chunk = Stream._uint8ArrayToBuffer(chunk), encoding = \"buffer\";\n else\n throw new ERR_INVALID_ARG_TYPE2(\"chunk\", [\"string\", \"Buffer\", \"Uint8Array\"], chunk);\n let err;\n if (state.ending)\n err = new ERR_STREAM_WRITE_AFTER_END;\n else if (state.destroyed)\n err = new ERR_STREAM_DESTROYED(\"write\");\n if (err)\n return runOnNextTick(cb, err), errorOrDestroy2(stream, err, !0), err;\n return state.pendingcb++, writeOrBuffer(stream, state, chunk, encoding, cb);\n }\n Writable.prototype.write = function(chunk, encoding, cb) {\n return _write(this, chunk, encoding, cb) === !0;\n }, Writable.prototype.cork = function() {\n this._writableState.corked++;\n }, Writable.prototype.uncork = function() {\n const state = this._writableState;\n if (state.corked) {\n if (state.corked--, !state.writing)\n clearBuffer(this, state);\n }\n }, Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n if (typeof encoding === \"string\")\n encoding = StringPrototypeToLowerCase(encoding);\n if (!Buffer.isEncoding(encoding))\n throw new ERR_UNKNOWN_ENCODING(encoding);\n return this._writableState.defaultEncoding = encoding, this;\n };\n function writeOrBuffer(stream, state, chunk, encoding, callback) {\n const len = state.objectMode \? 1 : chunk.length;\n state.length += len;\n const ret = state.length < state.highWaterMark;\n if (!ret)\n state.needDrain = !0;\n if (state.writing || state.corked || state.errored || !state.constructed) {\n if (state.buffered.push({\n chunk,\n encoding,\n callback\n }), state.allBuffers && encoding !== \"buffer\")\n state.allBuffers = !1;\n if (state.allNoop && callback !== nop)\n state.allNoop = !1;\n } else\n state.writelen = len, state.writecb = callback, state.writing = !0, state.sync = !0, stream._write(chunk, encoding, state.onwrite), state.sync = !1;\n return ret && !state.errored && !state.destroyed;\n }\n function doWrite(stream, state, writev, len, chunk, encoding, cb) {\n if (state.writelen = len, state.writecb = cb, state.writing = !0, state.sync = !0, state.destroyed)\n state.onwrite(new ERR_STREAM_DESTROYED(\"write\"));\n else if (writev)\n stream._writev(chunk, state.onwrite);\n else\n stream._write(chunk, encoding, state.onwrite);\n state.sync = !1;\n }\n function onwriteError(stream, state, er, cb) {\n --state.pendingcb, cb(er), errorBuffer(state), errorOrDestroy2(stream, er);\n }\n function onwrite(stream, er) {\n const state = stream._writableState, sync = state.sync, cb = state.writecb;\n if (typeof cb !== \"function\") {\n errorOrDestroy2(stream, new ERR_MULTIPLE_CALLBACK);\n return;\n }\n if (state.writing = !1, state.writecb = null, state.length -= state.writelen, state.writelen = 0, er) {\n if (Error.captureStackTrace(er), !state.errored)\n state.errored = er;\n if (stream._readableState && !stream._readableState.errored)\n stream._readableState.errored = er;\n if (sync)\n runOnNextTick(onwriteError, stream, state, er, cb);\n else\n onwriteError(stream, state, er, cb);\n } else {\n if (state.buffered.length > state.bufferedIndex)\n clearBuffer(stream, state);\n if (sync)\n if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb)\n state.afterWriteTickInfo.count++;\n else\n state.afterWriteTickInfo = {\n count: 1,\n cb,\n stream,\n state\n }, runOnNextTick(afterWriteTick, state.afterWriteTickInfo);\n else\n afterWrite(stream, state, 1, cb);\n }\n }\n function afterWriteTick({ stream, state, count, cb }) {\n return state.afterWriteTickInfo = null, afterWrite(stream, state, count, cb);\n }\n function afterWrite(stream, state, count, cb) {\n if (!state.ending && !stream.destroyed && state.length === 0 && state.needDrain)\n state.needDrain = !1, stream.emit(\"drain\");\n while (count-- > 0)\n state.pendingcb--, cb();\n if (state.destroyed)\n errorBuffer(state);\n finishMaybe(stream, state);\n }\n function errorBuffer(state) {\n if (state.writing)\n return;\n for (let n = state.bufferedIndex;n < state.buffered.length; ++n) {\n var _state$errored;\n const { chunk, callback } = state.buffered[n], len = state.objectMode \? 1 : chunk.length;\n state.length -= len, callback((_state$errored = state.errored) !== null && _state$errored !== void 0 \? _state$errored : new ERR_STREAM_DESTROYED(\"write\"));\n }\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++) {\n var _state$errored2;\n onfinishCallbacks[i]((_state$errored2 = state.errored) !== null && _state$errored2 !== void 0 \? _state$errored2 : new ERR_STREAM_DESTROYED(\"end\"));\n }\n resetBuffer(state);\n }\n function clearBuffer(stream, state) {\n if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed)\n return;\n const { buffered, bufferedIndex, objectMode } = state, bufferedLength = buffered.length - bufferedIndex;\n if (!bufferedLength)\n return;\n let i = bufferedIndex;\n if (state.bufferProcessing = !0, bufferedLength > 1 && stream._writev) {\n state.pendingcb -= bufferedLength - 1;\n const callback = state.allNoop \? nop : (err) => {\n for (let n = i;n < buffered.length; ++n)\n buffered[n].callback(err);\n }, chunks = state.allNoop && i === 0 \? buffered : ArrayPrototypeSlice(buffered, i);\n chunks.allBuffers = state.allBuffers, doWrite(stream, state, !0, state.length, chunks, \"\", callback), resetBuffer(state);\n } else {\n do {\n const { chunk, encoding, callback } = buffered[i];\n buffered[i++] = null;\n const len = objectMode \? 1 : chunk.length;\n doWrite(stream, state, !1, len, chunk, encoding, callback);\n } while (i < buffered.length && !state.writing);\n if (i === buffered.length)\n resetBuffer(state);\n else if (i > 256)\n buffered.splice(0, i), state.bufferedIndex = 0;\n else\n state.bufferedIndex = i;\n }\n state.bufferProcessing = !1;\n }\n Writable.prototype._write = function(chunk, encoding, cb) {\n if (this._writev)\n this._writev([\n {\n chunk,\n encoding\n }\n ], cb);\n else\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_write()\");\n }, Writable.prototype._writev = null, Writable.prototype.end = function(chunk, encoding, cb, native = !1) {\n const state = this._writableState;\n if (typeof chunk === \"function\")\n cb = chunk, chunk = null, encoding = null;\n else if (typeof encoding === \"function\")\n cb = encoding, encoding = null;\n let err;\n if (chunk !== null && chunk !== void 0) {\n let ret;\n if (!native)\n ret = _write(this, chunk, encoding);\n else\n ret = this.write(chunk, encoding);\n if (ret instanceof Error2)\n err = ret;\n }\n if (state.corked)\n state.corked = 1, this.uncork();\n if (err)\n this.emit(\"error\", err);\n else if (!state.errored && !state.ending)\n state.ending = !0, finishMaybe(this, state, !0), state.ended = !0;\n else if (state.finished)\n err = new ERR_STREAM_ALREADY_FINISHED(\"end\");\n else if (state.destroyed)\n err = new ERR_STREAM_DESTROYED(\"end\");\n if (typeof cb === \"function\")\n if (err || state.finished)\n runOnNextTick(cb, err);\n else\n state[kOnFinished].push(cb);\n return this;\n };\n function needFinish(state, tag) {\n var needFinish2 = state.ending && !state.destroyed && state.constructed && state.length === 0 && !state.errored && state.buffered.length === 0 && !state.finished && !state.writing && !state.errorEmitted && !state.closeEmitted;\n return needFinish2;\n }\n function callFinal(stream, state) {\n let called = !1;\n function onFinish(err) {\n if (called) {\n errorOrDestroy2(stream, err !== null && err !== void 0 \? err : ERR_MULTIPLE_CALLBACK());\n return;\n }\n if (called = !0, state.pendingcb--, err) {\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++)\n onfinishCallbacks[i](err);\n errorOrDestroy2(stream, err, state.sync);\n } else if (needFinish(state))\n state.prefinished = !0, stream.emit(\"prefinish\"), state.pendingcb++, runOnNextTick(finish, stream, state);\n }\n state.sync = !0, state.pendingcb++;\n try {\n stream._final(onFinish);\n } catch (err) {\n onFinish(err);\n }\n state.sync = !1;\n }\n function prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled)\n if (typeof stream._final === \"function\" && !state.destroyed)\n state.finalCalled = !0, callFinal(stream, state);\n else\n state.prefinished = !0, stream.emit(\"prefinish\");\n }\n function finishMaybe(stream, state, sync) {\n if (!needFinish(state, stream.__id))\n return;\n if (prefinish(stream, state), state.pendingcb === 0) {\n if (sync)\n state.pendingcb++, runOnNextTick((stream2, state2) => {\n if (needFinish(state2))\n finish(stream2, state2);\n else\n state2.pendingcb--;\n }, stream, state);\n else if (needFinish(state))\n state.pendingcb++, finish(stream, state);\n }\n }\n function finish(stream, state) {\n state.pendingcb--, state.finished = !0;\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++)\n onfinishCallbacks[i]();\n if (stream.emit(\"finish\"), state.autoDestroy) {\n const rState = stream._readableState;\n if (!rState || rState.autoDestroy && (rState.endEmitted || rState.readable === !1))\n stream.destroy();\n }\n }\n ObjectDefineProperties(Writable.prototype, {\n closed: {\n get() {\n return this._writableState \? this._writableState.closed : !1;\n }\n },\n destroyed: {\n get() {\n return this._writableState \? this._writableState.destroyed : !1;\n },\n set(value) {\n if (this._writableState)\n this._writableState.destroyed = value;\n }\n },\n writable: {\n get() {\n const w = this._writableState;\n return !!w && w.writable !== !1 && !w.destroyed && !w.errored && !w.ending && !w.ended;\n },\n set(val) {\n if (this._writableState)\n this._writableState.writable = !!val;\n }\n },\n writableFinished: {\n get() {\n return this._writableState \? this._writableState.finished : !1;\n }\n },\n writableObjectMode: {\n get() {\n return this._writableState \? this._writableState.objectMode : !1;\n }\n },\n writableBuffer: {\n get() {\n return this._writableState && this._writableState.getBuffer();\n }\n },\n writableEnded: {\n get() {\n return this._writableState \? this._writableState.ending : !1;\n }\n },\n writableNeedDrain: {\n get() {\n const wState = this._writableState;\n if (!wState)\n return !1;\n return !wState.destroyed && !wState.ending && wState.needDrain;\n }\n },\n writableHighWaterMark: {\n get() {\n return this._writableState && this._writableState.highWaterMark;\n }\n },\n writableCorked: {\n get() {\n return this._writableState \? this._writableState.corked : 0;\n }\n },\n writableLength: {\n get() {\n return this._writableState && this._writableState.length;\n }\n },\n errored: {\n enumerable: !1,\n get() {\n return this._writableState \? this._writableState.errored : null;\n }\n },\n writableAborted: {\n enumerable: !1,\n get: function() {\n return !!(this._writableState.writable !== !1 && (this._writableState.destroyed || this._writableState.errored) && !this._writableState.finished);\n }\n }\n });\n var destroy2 = destroyImpl.destroy;\n Writable.prototype.destroy = function(err, cb) {\n const state = this._writableState;\n if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length))\n runOnNextTick(errorBuffer, state);\n return destroy2.call(this, err, cb), this;\n }, Writable.prototype._undestroy = destroyImpl.undestroy, Writable.prototype._destroy = function(err, cb) {\n cb(err);\n }, Writable.prototype[EE.captureRejectionSymbol] = function(err) {\n this.destroy(err);\n };\n var webStreamsAdapters;\n function lazyWebStreams() {\n if (webStreamsAdapters === void 0)\n webStreamsAdapters = {};\n return webStreamsAdapters;\n }\n Writable.fromWeb = function(writableStream, options) {\n return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options);\n }, Writable.toWeb = function(streamWritable) {\n return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable);\n };\n }\n}), require_duplexify = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/duplexify.js\"(exports, module) {\n var {\n isReadable,\n isWritable,\n isIterable,\n isNodeStream,\n isReadableNodeStream,\n isWritableNodeStream,\n isDuplexNodeStream\n } = require_utils(), eos = require_end_of_stream(), {\n AbortError: AbortError2,\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_RETURN_VALUE }\n } = require_errors(), { destroyer } = require_destroy(), Duplex = require_duplex(), Readable = require_readable(), { createDeferredPromise } = require_util(), from = require_from(), isBlob = typeof Blob !== \"undefined\" \? function isBlob2(b) {\n return b instanceof Blob;\n } : function isBlob2(b) {\n return !1;\n }, { FunctionPrototypeCall } = require_primordials();\n\n class Duplexify extends Duplex {\n constructor(options) {\n super(options);\n if ((options === null || options === void 0 \? void 0 : options.readable) === !1)\n this._readableState.readable = !1, this._readableState.ended = !0, this._readableState.endEmitted = !0;\n if ((options === null || options === void 0 \? void 0 : options.writable) === !1)\n this._writableState.writable = !1, this._writableState.ending = !0, this._writableState.ended = !0, this._writableState.finished = !0;\n }\n }\n module.exports = function duplexify(body, name) {\n if (isDuplexNodeStream(body))\n return body;\n if (isReadableNodeStream(body))\n return _duplexify({\n readable: body\n });\n if (isWritableNodeStream(body))\n return _duplexify({\n writable: body\n });\n if (isNodeStream(body))\n return _duplexify({\n writable: !1,\n readable: !1\n });\n if (typeof body === \"function\") {\n const { value, write, final, destroy: destroy2 } = fromAsyncGen(body);\n if (isIterable(value))\n return from(Duplexify, value, {\n objectMode: !0,\n write,\n final,\n destroy: destroy2\n });\n const then2 = value === null || value === void 0 \? void 0 : value.then;\n if (typeof then2 === \"function\") {\n let d;\n const promise = FunctionPrototypeCall(then2, value, (val) => {\n if (val != null)\n throw new ERR_INVALID_RETURN_VALUE(\"nully\", \"body\", val);\n }, (err) => {\n destroyer(d, err);\n });\n return d = new Duplexify({\n objectMode: !0,\n readable: !1,\n write,\n final(cb) {\n final(async () => {\n try {\n await promise, runOnNextTick(cb, null);\n } catch (err) {\n runOnNextTick(cb, err);\n }\n });\n },\n destroy: destroy2\n });\n }\n throw new ERR_INVALID_RETURN_VALUE(\"Iterable, AsyncIterable or AsyncFunction\", name, value);\n }\n if (isBlob(body))\n return duplexify(body.arrayBuffer());\n if (isIterable(body))\n return from(Duplexify, body, {\n objectMode: !0,\n writable: !1\n });\n if (typeof (body === null || body === void 0 \? void 0 : body.writable) === \"object\" || typeof (body === null || body === void 0 \? void 0 : body.readable) === \"object\") {\n const readable = body !== null && body !== void 0 && body.readable \? isReadableNodeStream(body === null || body === void 0 \? void 0 : body.readable) \? body === null || body === void 0 \? void 0 : body.readable : duplexify(body.readable) : void 0, writable = body !== null && body !== void 0 && body.writable \? isWritableNodeStream(body === null || body === void 0 \? void 0 : body.writable) \? body === null || body === void 0 \? void 0 : body.writable : duplexify(body.writable) : void 0;\n return _duplexify({\n readable,\n writable\n });\n }\n const then = body === null || body === void 0 \? void 0 : body.then;\n if (typeof then === \"function\") {\n let d;\n return FunctionPrototypeCall(then, body, (val) => {\n if (val != null)\n d.push(val);\n d.push(null);\n }, (err) => {\n destroyer(d, err);\n }), d = new Duplexify({\n objectMode: !0,\n writable: !1,\n read() {\n }\n });\n }\n throw new ERR_INVALID_ARG_TYPE2(name, [\n \"Blob\",\n \"ReadableStream\",\n \"WritableStream\",\n \"Stream\",\n \"Iterable\",\n \"AsyncIterable\",\n \"Function\",\n \"{ readable, writable } pair\",\n \"Promise\"\n ], body);\n };\n function fromAsyncGen(fn) {\n let { promise, resolve } = createDeferredPromise();\n const ac = new AbortController, signal = ac.signal;\n return {\n value: fn(async function* () {\n while (!0) {\n const _promise = promise;\n promise = null;\n const { chunk, done, cb } = await _promise;\n if (runOnNextTick(cb), done)\n return;\n if (signal.aborted)\n throw new AbortError2(void 0, {\n cause: signal.reason\n });\n ({ promise, resolve } = createDeferredPromise()), yield chunk;\n }\n }(), {\n signal\n }),\n write(chunk, encoding, cb) {\n const _resolve = resolve;\n resolve = null, _resolve({\n chunk,\n done: !1,\n cb\n });\n },\n final(cb) {\n const _resolve = resolve;\n resolve = null, _resolve({\n done: !0,\n cb\n });\n },\n destroy(err, cb) {\n ac.abort(), cb(err);\n }\n };\n }\n function _duplexify(pair) {\n const r = pair.readable && typeof pair.readable.read !== \"function\" \? Readable.wrap(pair.readable) : pair.readable, w = pair.writable;\n let readable = !!isReadable(r), writable = !!isWritable(w), ondrain, onfinish, onreadable, onclose, d;\n function onfinished(err) {\n const cb = onclose;\n if (onclose = null, cb)\n cb(err);\n else if (err)\n d.destroy(err);\n else if (!readable && !writable)\n d.destroy();\n }\n if (d = new Duplexify({\n readableObjectMode: !!(r !== null && r !== void 0 && r.readableObjectMode),\n writableObjectMode: !!(w !== null && w !== void 0 && w.writableObjectMode),\n readable,\n writable\n }), writable)\n eos(w, (err) => {\n if (writable = !1, err)\n destroyer(r, err);\n onfinished(err);\n }), d._write = function(chunk, encoding, callback) {\n if (w.write(chunk, encoding))\n callback();\n else\n ondrain = callback;\n }, d._final = function(callback) {\n w.end(), onfinish = callback;\n }, w.on(\"drain\", function() {\n if (ondrain) {\n const cb = ondrain;\n ondrain = null, cb();\n }\n }), w.on(\"finish\", function() {\n if (onfinish) {\n const cb = onfinish;\n onfinish = null, cb();\n }\n });\n if (readable)\n eos(r, (err) => {\n if (readable = !1, err)\n destroyer(r, err);\n onfinished(err);\n }), r.on(\"readable\", function() {\n if (onreadable) {\n const cb = onreadable;\n onreadable = null, cb();\n }\n }), r.on(\"end\", function() {\n d.push(null);\n }), d._read = function() {\n while (!0) {\n const buf = r.read();\n if (buf === null) {\n onreadable = d._read;\n return;\n }\n if (!d.push(buf))\n return;\n }\n };\n return d._destroy = function(err, callback) {\n if (!err && onclose !== null)\n err = new AbortError2;\n if (onreadable = null, ondrain = null, onfinish = null, onclose === null)\n callback(err);\n else\n onclose = callback, destroyer(w, err), destroyer(r, err);\n }, d;\n }\n }\n}), require_duplex = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/duplex.js\"(exports, module) {\n var { ObjectDefineProperties, ObjectGetOwnPropertyDescriptor, ObjectKeys, ObjectSetPrototypeOf } = require_primordials(), Readable = require_readable();\n function Duplex(options) {\n if (!(this instanceof Duplex))\n return new Duplex(options);\n if (Readable.call(this, options), Writable.call(this, options), options) {\n if (this.allowHalfOpen = options.allowHalfOpen !== !1, options.readable === !1)\n this._readableState.readable = !1, this._readableState.ended = !0, this._readableState.endEmitted = !0;\n if (options.writable === !1)\n this._writableState.writable = !1, this._writableState.ending = !0, this._writableState.ended = !0, this._writableState.finished = !0;\n } else\n this.allowHalfOpen = !0;\n }\n Duplex.prototype = {}, module.exports = Duplex, ObjectSetPrototypeOf(Duplex.prototype, Readable.prototype), ObjectSetPrototypeOf(Duplex, Readable);\n for (var method in Writable.prototype)\n if (!Duplex.prototype[method])\n Duplex.prototype[method] = Writable.prototype[method];\n ObjectDefineProperties(Duplex.prototype, {\n writable: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writable\"),\n writableHighWaterMark: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableHighWaterMark\"),\n writableObjectMode: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableObjectMode\"),\n writableBuffer: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableBuffer\"),\n writableLength: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableLength\"),\n writableFinished: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableFinished\"),\n writableCorked: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableCorked\"),\n writableEnded: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableEnded\"),\n writableNeedDrain: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableNeedDrain\"),\n destroyed: {\n get() {\n if (this._readableState === void 0 || this._writableState === void 0)\n return !1;\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set(value) {\n if (this._readableState && this._writableState)\n this._readableState.destroyed = value, this._writableState.destroyed = value;\n }\n }\n });\n var webStreamsAdapters;\n function lazyWebStreams() {\n if (webStreamsAdapters === void 0)\n webStreamsAdapters = {};\n return webStreamsAdapters;\n }\n Duplex.fromWeb = function(pair, options) {\n return lazyWebStreams().newStreamDuplexFromReadableWritablePair(pair, options);\n }, Duplex.toWeb = function(duplex) {\n return lazyWebStreams().newReadableWritablePairFromDuplex(duplex);\n };\n var duplexify;\n Duplex.from = function(body) {\n if (!duplexify)\n duplexify = require_duplexify();\n return duplexify(body, \"body\");\n };\n }\n}), require_transform = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/transform.js\"(exports, module) {\n var { ObjectSetPrototypeOf, Symbol: Symbol2 } = require_primordials(), { ERR_METHOD_NOT_IMPLEMENTED } = require_errors().codes, Duplex = require_duplex();\n function Transform(options) {\n if (!(this instanceof Transform))\n return new Transform(options);\n if (Duplex.call(this, options), this._readableState.sync = !1, this[kCallback] = null, options) {\n if (typeof options.transform === \"function\")\n this._transform = options.transform;\n if (typeof options.flush === \"function\")\n this._flush = options.flush;\n }\n this.on(\"prefinish\", prefinish.bind(this));\n }\n Transform.prototype = {}, ObjectSetPrototypeOf(Transform.prototype, Duplex.prototype), ObjectSetPrototypeOf(Transform, Duplex), module.exports = Transform;\n var kCallback = Symbol2(\"kCallback\");\n function final(cb) {\n if (typeof this._flush === \"function\" && !this.destroyed)\n this._flush((er, data) => {\n if (er) {\n if (cb)\n cb(er);\n else\n this.destroy(er);\n return;\n }\n if (data != null)\n this.push(data);\n if (this.push(null), cb)\n cb();\n });\n else if (this.push(null), cb)\n cb();\n }\n function prefinish() {\n if (this._final !== final)\n final.call(this);\n }\n Transform.prototype._final = final, Transform.prototype._transform = function(chunk, encoding, callback) {\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_transform()\");\n }, Transform.prototype._write = function(chunk, encoding, callback) {\n const rState = this._readableState, wState = this._writableState, length = rState.length;\n this._transform(chunk, encoding, (err, val) => {\n if (err) {\n callback(err);\n return;\n }\n if (val != null)\n this.push(val);\n if (wState.ended || length === rState.length || rState.length < rState.highWaterMark || rState.highWaterMark === 0 || rState.length === 0)\n callback();\n else\n this[kCallback] = callback;\n });\n }, Transform.prototype._read = function() {\n if (this[kCallback]) {\n const callback = this[kCallback];\n this[kCallback] = null, callback();\n }\n };\n }\n}), require_passthrough = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/passthrough.js\"(exports, module) {\n var { ObjectSetPrototypeOf } = require_primordials(), Transform = require_transform();\n function PassThrough(options) {\n if (!(this instanceof PassThrough))\n return new PassThrough(options);\n Transform.call(this, options);\n }\n PassThrough.prototype = {}, ObjectSetPrototypeOf(PassThrough.prototype, Transform.prototype), ObjectSetPrototypeOf(PassThrough, Transform), PassThrough.prototype._transform = function(chunk, encoding, cb) {\n cb(null, chunk);\n }, module.exports = PassThrough;\n }\n}), require_pipeline = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/pipeline.js\"(exports, module) {\n var { ArrayIsArray: ArrayIsArray2, Promise: Promise2, SymbolAsyncIterator } = require_primordials(), eos = require_end_of_stream(), { once } = require_util(), destroyImpl = require_destroy(), Duplex = require_duplex(), {\n aggregateTwoErrors,\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS, ERR_STREAM_DESTROYED },\n AbortError: AbortError2\n } = require_errors(), { validateFunction, validateAbortSignal } = require_validators(), { isIterable, isReadable, isReadableNodeStream, isNodeStream } = require_utils(), PassThrough, Readable;\n function destroyer(stream, reading, writing) {\n let finished = !1;\n stream.on(\"close\", () => {\n finished = !0;\n });\n const cleanup = eos(stream, {\n readable: reading,\n writable: writing\n }, (err) => {\n finished = !err;\n });\n return {\n destroy: (err) => {\n if (finished)\n return;\n finished = !0, destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED(\"pipe\"));\n },\n cleanup\n };\n }\n function popCallback(streams) {\n return validateFunction(streams[streams.length - 1], \"streams[stream.length - 1]\"), streams.pop();\n }\n function makeAsyncIterable(val) {\n if (isIterable(val))\n return val;\n else if (isReadableNodeStream(val))\n return fromReadable(val);\n throw new ERR_INVALID_ARG_TYPE2(\"val\", [\"Readable\", \"Iterable\", \"AsyncIterable\"], val);\n }\n async function* fromReadable(val) {\n if (!Readable)\n Readable = require_readable();\n yield* Readable.prototype[SymbolAsyncIterator].call(val);\n }\n async function pump(iterable, writable, finish, { end }) {\n let error, onresolve = null;\n const resume = (err) => {\n if (err)\n error = err;\n if (onresolve) {\n const callback = onresolve;\n onresolve = null, callback();\n }\n }, wait = () => new Promise2((resolve, reject) => {\n if (error)\n reject(error);\n else\n onresolve = () => {\n if (error)\n reject(error);\n else\n resolve();\n };\n });\n writable.on(\"drain\", resume);\n const cleanup = eos(writable, {\n readable: !1\n }, resume);\n try {\n if (writable.writableNeedDrain)\n await wait();\n for await (let chunk of iterable)\n if (!writable.write(chunk))\n await wait();\n if (end)\n writable.end();\n await wait(), finish();\n } catch (err) {\n finish(error !== err \? aggregateTwoErrors(error, err) : err);\n } finally {\n cleanup(), writable.off(\"drain\", resume);\n }\n }\n function pipeline(...streams) {\n return pipelineImpl(streams, once(popCallback(streams)));\n }\n function pipelineImpl(streams, callback, opts) {\n if (streams.length === 1 && ArrayIsArray2(streams[0]))\n streams = streams[0];\n if (streams.length < 2)\n throw new ERR_MISSING_ARGS(\"streams\");\n const ac = new AbortController, signal = ac.signal, outerSignal = opts === null || opts === void 0 \? void 0 : opts.signal, lastStreamCleanup = [];\n validateAbortSignal(outerSignal, \"options.signal\");\n function abort() {\n finishImpl(new AbortError2);\n }\n outerSignal === null || outerSignal === void 0 || outerSignal.addEventListener(\"abort\", abort);\n let error, value;\n const destroys = [];\n let finishCount = 0;\n function finish(err) {\n finishImpl(err, --finishCount === 0);\n }\n function finishImpl(err, final) {\n if (err && (!error || error.code === \"ERR_STREAM_PREMATURE_CLOSE\"))\n error = err;\n if (!error && !final)\n return;\n while (destroys.length)\n destroys.shift()(error);\n if (outerSignal === null || outerSignal === void 0 || outerSignal.removeEventListener(\"abort\", abort), ac.abort(), final) {\n if (!error)\n lastStreamCleanup.forEach((fn) => fn());\n runOnNextTick(callback, error, value);\n }\n }\n let ret;\n for (let i = 0;i < streams.length; i++) {\n const stream = streams[i], reading = i < streams.length - 1, writing = i > 0, end = reading || (opts === null || opts === void 0 \? void 0 : opts.end) !== !1, isLastStream = i === streams.length - 1;\n if (isNodeStream(stream)) {\n let onError = function(err) {\n if (err && err.name !== \"AbortError\" && err.code !== \"ERR_STREAM_PREMATURE_CLOSE\")\n finish(err);\n };\n if (end) {\n const { destroy: destroy2, cleanup } = destroyer(stream, reading, writing);\n if (destroys.push(destroy2), isReadable(stream) && isLastStream)\n lastStreamCleanup.push(cleanup);\n }\n if (stream.on(\"error\", onError), isReadable(stream) && isLastStream)\n lastStreamCleanup.push(() => {\n stream.removeListener(\"error\", onError);\n });\n }\n if (i === 0)\n if (typeof stream === \"function\") {\n if (ret = stream({\n signal\n }), !isIterable(ret))\n throw new ERR_INVALID_RETURN_VALUE(\"Iterable, AsyncIterable or Stream\", \"source\", ret);\n } else if (isIterable(stream) || isReadableNodeStream(stream))\n ret = stream;\n else\n ret = Duplex.from(stream);\n else if (typeof stream === \"function\")\n if (ret = makeAsyncIterable(ret), ret = stream(ret, {\n signal\n }), reading) {\n if (!isIterable(ret, !0))\n throw new ERR_INVALID_RETURN_VALUE(\"AsyncIterable\", `transform[${i - 1}]`, ret);\n } else {\n var _ret;\n if (!PassThrough)\n PassThrough = require_passthrough();\n const pt = new PassThrough({\n objectMode: !0\n }), then = (_ret = ret) === null || _ret === void 0 \? void 0 : _ret.then;\n if (typeof then === \"function\")\n finishCount++, then.call(ret, (val) => {\n if (value = val, val != null)\n pt.write(val);\n if (end)\n pt.end();\n runOnNextTick(finish);\n }, (err) => {\n pt.destroy(err), runOnNextTick(finish, err);\n });\n else if (isIterable(ret, !0))\n finishCount++, pump(ret, pt, finish, {\n end\n });\n else\n throw new ERR_INVALID_RETURN_VALUE(\"AsyncIterable or Promise\", \"destination\", ret);\n ret = pt;\n const { destroy: destroy2, cleanup } = destroyer(ret, !1, !0);\n if (destroys.push(destroy2), isLastStream)\n lastStreamCleanup.push(cleanup);\n }\n else if (isNodeStream(stream)) {\n if (isReadableNodeStream(ret)) {\n finishCount += 2;\n const cleanup = pipe(ret, stream, finish, {\n end\n });\n if (isReadable(stream) && isLastStream)\n lastStreamCleanup.push(cleanup);\n } else if (isIterable(ret))\n finishCount++, pump(ret, stream, finish, {\n end\n });\n else\n throw new ERR_INVALID_ARG_TYPE2(\"val\", [\"Readable\", \"Iterable\", \"AsyncIterable\"], ret);\n ret = stream;\n } else\n ret = Duplex.from(stream);\n }\n if (signal !== null && signal !== void 0 && signal.aborted || outerSignal !== null && outerSignal !== void 0 && outerSignal.aborted)\n runOnNextTick(abort);\n return ret;\n }\n function pipe(src, dst, finish, { end }) {\n if (src.pipe(dst, {\n end\n }), end)\n src.once(\"end\", () => dst.end());\n else\n finish();\n return eos(src, {\n readable: !0,\n writable: !1\n }, (err) => {\n const rState = src._readableState;\n if (err && err.code === \"ERR_STREAM_PREMATURE_CLOSE\" && rState && rState.ended && !rState.errored && !rState.errorEmitted)\n src.once(\"end\", finish).once(\"error\", finish);\n else\n finish(err);\n }), eos(dst, {\n readable: !1,\n writable: !0\n }, finish);\n }\n module.exports = {\n pipelineImpl,\n pipeline\n };\n }\n}), require_compose = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/compose.js\"(exports, module) {\n var { pipeline } = require_pipeline(), Duplex = require_duplex(), { destroyer } = require_destroy(), { isNodeStream, isReadable, isWritable } = require_utils(), {\n AbortError: AbortError2,\n codes: { ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, ERR_MISSING_ARGS }\n } = require_errors();\n module.exports = function compose(...streams) {\n if (streams.length === 0)\n throw new ERR_MISSING_ARGS(\"streams\");\n if (streams.length === 1)\n return Duplex.from(streams[0]);\n const orgStreams = [...streams];\n if (typeof streams[0] === \"function\")\n streams[0] = Duplex.from(streams[0]);\n if (typeof streams[streams.length - 1] === \"function\") {\n const idx = streams.length - 1;\n streams[idx] = Duplex.from(streams[idx]);\n }\n for (let n = 0;n < streams.length; ++n) {\n if (!isNodeStream(streams[n]))\n continue;\n if (n < streams.length - 1 && !isReadable(streams[n]))\n throw new ERR_INVALID_ARG_VALUE2(`streams[${n}]`, orgStreams[n], \"must be readable\");\n if (n > 0 && !isWritable(streams[n]))\n throw new ERR_INVALID_ARG_VALUE2(`streams[${n}]`, orgStreams[n], \"must be writable\");\n }\n let ondrain, onfinish, onreadable, onclose, d;\n function onfinished(err) {\n const cb = onclose;\n if (onclose = null, cb)\n cb(err);\n else if (err)\n d.destroy(err);\n else if (!readable && !writable)\n d.destroy();\n }\n const head = streams[0], tail = pipeline(streams, onfinished), writable = !!isWritable(head), readable = !!isReadable(tail);\n if (d = new Duplex({\n writableObjectMode: !!(head !== null && head !== void 0 && head.writableObjectMode),\n readableObjectMode: !!(tail !== null && tail !== void 0 && tail.writableObjectMode),\n writable,\n readable\n }), writable)\n d._write = function(chunk, encoding, callback) {\n if (head.write(chunk, encoding))\n callback();\n else\n ondrain = callback;\n }, d._final = function(callback) {\n head.end(), onfinish = callback;\n }, head.on(\"drain\", function() {\n if (ondrain) {\n const cb = ondrain;\n ondrain = null, cb();\n }\n }), tail.on(\"finish\", function() {\n if (onfinish) {\n const cb = onfinish;\n onfinish = null, cb();\n }\n });\n if (readable)\n tail.on(\"readable\", function() {\n if (onreadable) {\n const cb = onreadable;\n onreadable = null, cb();\n }\n }), tail.on(\"end\", function() {\n d.push(null);\n }), d._read = function() {\n while (!0) {\n const buf = tail.read();\n if (buf === null) {\n onreadable = d._read;\n return;\n }\n if (!d.push(buf))\n return;\n }\n };\n return d._destroy = function(err, callback) {\n if (!err && onclose !== null)\n err = new AbortError2;\n if (onreadable = null, ondrain = null, onfinish = null, onclose === null)\n callback(err);\n else\n onclose = callback, destroyer(tail, err);\n }, d;\n };\n }\n}), require_promises = __commonJS({\n \"node_modules/readable-stream/lib/stream/promises.js\"(exports, module) {\n var { ArrayPrototypePop, Promise: Promise2 } = require_primordials(), { isIterable, isNodeStream } = require_utils(), { pipelineImpl: pl } = require_pipeline(), { finished } = require_end_of_stream();\n function pipeline(...streams) {\n return new Promise2((resolve, reject) => {\n let signal, end;\n const lastArg = streams[streams.length - 1];\n if (lastArg && typeof lastArg === \"object\" && !isNodeStream(lastArg) && !isIterable(lastArg)) {\n const options = ArrayPrototypePop(streams);\n signal = options.signal, end = options.end;\n }\n pl(streams, (err, value) => {\n if (err)\n reject(err);\n else\n resolve(value);\n }, {\n signal,\n end\n });\n });\n }\n module.exports = {\n finished,\n pipeline\n };\n }\n}), require_stream = __commonJS({\n \"node_modules/readable-stream/lib/stream.js\"(exports, module) {\n var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials(), {\n promisify: { custom: customPromisify }\n } = require_util(), { streamReturningOperators, promiseReturningOperators } = require_operators(), {\n codes: { ERR_ILLEGAL_CONSTRUCTOR }\n } = require_errors(), compose = require_compose(), { pipeline } = require_pipeline(), { destroyer } = require_destroy(), eos = require_end_of_stream(), promises = require_promises(), utils = require_utils(), Stream = module.exports = require_legacy().Stream;\n Stream.isDisturbed = utils.isDisturbed, Stream.isErrored = utils.isErrored, Stream.isWritable = utils.isWritable, Stream.isReadable = utils.isReadable, Stream.Readable = require_readable();\n for (let key of ObjectKeys(streamReturningOperators)) {\n let fn = function(...args) {\n if (new.target)\n throw ERR_ILLEGAL_CONSTRUCTOR();\n return Stream.Readable.from(ReflectApply(op, this, args));\n };\n const op = streamReturningOperators[key];\n ObjectDefineProperty(fn, \"name\", {\n value: op.name\n }), ObjectDefineProperty(fn, \"length\", {\n value: op.length\n }), ObjectDefineProperty(Stream.Readable.prototype, key, {\n value: fn,\n enumerable: !1,\n configurable: !0,\n writable: !0\n });\n }\n for (let key of ObjectKeys(promiseReturningOperators)) {\n let fn = function(...args) {\n if (new.target)\n throw ERR_ILLEGAL_CONSTRUCTOR();\n return ReflectApply(op, this, args);\n };\n const op = promiseReturningOperators[key];\n ObjectDefineProperty(fn, \"name\", {\n value: op.name\n }), ObjectDefineProperty(fn, \"length\", {\n value: op.length\n }), ObjectDefineProperty(Stream.Readable.prototype, key, {\n value: fn,\n enumerable: !1,\n configurable: !0,\n writable: !0\n });\n }\n Stream.Writable = require_writable(), Stream.Duplex = require_duplex(), Stream.Transform = require_transform(), Stream.PassThrough = require_passthrough(), Stream.pipeline = pipeline;\n var { addAbortSignal } = require_add_abort_signal();\n Stream.addAbortSignal = addAbortSignal, Stream.finished = eos, Stream.destroy = destroyer, Stream.compose = compose, ObjectDefineProperty(Stream, \"promises\", {\n configurable: !0,\n enumerable: !0,\n get() {\n return promises;\n }\n }), ObjectDefineProperty(pipeline, customPromisify, {\n enumerable: !0,\n get() {\n return promises.pipeline;\n }\n }), ObjectDefineProperty(eos, customPromisify, {\n enumerable: !0,\n get() {\n return promises.finished;\n }\n }), Stream.Stream = Stream, Stream._isUint8Array = function isUint8Array(value) {\n return value instanceof Uint8Array;\n }, Stream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) {\n return new Buffer(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n };\n }\n}), nativeReadableStreamPrototypes = {\n 0: void 0,\n 1: void 0,\n 2: void 0,\n 3: void 0,\n 4: void 0,\n 5: void 0\n}, Writable = require_writable(), _pathOrFdOrSink = Symbol(\"pathOrFdOrSink\"), _fileSink = Symbol(\"fileSink\"), _native = Symbol(\"native\");\nNativeWritable.prototype = Object.create(Writable.prototype);\nvar WritablePrototypeWrite = Writable.prototype.write;\nNativeWritable.prototype.write = function NativeWritablePrototypeWrite(chunk, encoding, cb, native) {\n if (!(native \?\? this[_native]))\n return this[_native] = !1, WritablePrototypeWrite.call(this, chunk, encoding, cb);\n var fileSink = this[_fileSink] \?\? NativeWritable_lazyConstruct(this), result = fileSink.write(chunk);\n if (@isPromise(result))\n return result.then(() => {\n this.emit(\"drain\"), fileSink.flush(!0);\n }), !1;\n if (fileSink.flush(!0), cb)\n cb(null, chunk.byteLength);\n return !0;\n};\nvar WritablePrototypeEnd = Writable.prototype.end;\nNativeWritable.prototype.end = function end(chunk, encoding, cb, native) {\n return WritablePrototypeEnd.call(this, chunk, encoding, cb, native \?\? this[_native]);\n};\nNativeWritable.prototype.ref = function ref() {\n var sink = this[_fileSink];\n if (!sink)\n this.NativeWritable_lazyConstruct();\n sink.ref();\n};\nNativeWritable.prototype.unref = function unref() {\n this[_fileSink]\?.unref();\n};\nvar exports = require_stream(), promises = require_promises();\nexports._getNativeReadableStreamPrototype = getNativeReadableStreamPrototype;\nexports.NativeWritable = NativeWritable;\nObject.defineProperty(exports, \"promises\", {\n configurable: !0,\n enumerable: !0,\n get() {\n return promises;\n }\n});\nexports[Symbol.for(\"::bunternal::\")] = { _ReadableFromWeb, _ReadableFromWebForUndici };\nexports.eos = require_end_of_stream();\nexports.EventEmitter = EE;\nreturn exports})\n"_s;
+static constexpr ASCIILiteral NodeStreamCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/stream.ts\nvar isReadableStream = function(value) {\n return typeof value === \"object\" && value !== null && value instanceof @ReadableStream;\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n};\nvar ERR_INVALID_ARG_TYPE = function(name, type, value) {\n return new Error(`The argument '${name}' is invalid. Received '${value}' for type '${type}'`);\n}, ERR_INVALID_ARG_VALUE = function(name, value, reason) {\n return new Error(`The value '${value}' is invalid for argument '${name}'. Reason: ${reason}`);\n}, createNativeStreamReadable = function(nativeType, Readable) {\n var [pull, start, cancel, setClose, deinit, updateRef, drainFn] = @lazy(nativeType), closer = [!1], handleNumberResult = function(nativeReadable, result, view, isClosed) {\n if (result > 0) {\n const slice = view.subarray(0, result), remainder = view.subarray(result);\n if (slice.byteLength > 0)\n nativeReadable.push(slice);\n if (isClosed)\n nativeReadable.push(null);\n return remainder.byteLength > 0 \? remainder : @undefined;\n }\n if (isClosed)\n nativeReadable.push(null);\n return view;\n }, handleArrayBufferViewResult = function(nativeReadable, result, view, isClosed) {\n if (result.byteLength > 0)\n nativeReadable.push(result);\n if (isClosed)\n nativeReadable.push(null);\n return view;\n }, DYNAMICALLY_ADJUST_CHUNK_SIZE = process.env.BUN_DISABLE_DYNAMIC_CHUNK_SIZE !== \"1\";\n const finalizer = new FinalizationRegistry((ptr) => ptr && deinit(ptr)), MIN_BUFFER_SIZE = 512;\n var NativeReadable = class NativeReadable2 extends Readable {\n #bunNativePtr;\n #refCount = 1;\n #constructed = !1;\n #remainingChunk = @undefined;\n #highWaterMark;\n #pendingRead = !1;\n #hasResized = !DYNAMICALLY_ADJUST_CHUNK_SIZE;\n #unregisterToken;\n constructor(ptr, options = {}) {\n super(options);\n if (typeof options.highWaterMark === \"number\")\n this.#highWaterMark = options.highWaterMark;\n else\n this.#highWaterMark = 262144;\n this.#bunNativePtr = ptr, this.#constructed = !1, this.#remainingChunk = @undefined, this.#pendingRead = !1, this.#unregisterToken = {}, finalizer.register(this, this.#bunNativePtr, this.#unregisterToken);\n }\n _read(maxToRead) {\n if (this.#pendingRead)\n return;\n var ptr = this.#bunNativePtr;\n if (ptr === 0) {\n this.push(null);\n return;\n }\n if (!this.#constructed)\n this.#internalConstruct(ptr);\n return this.#internalRead(this.#getRemainingChunk(maxToRead), ptr);\n }\n #internalConstruct(ptr) {\n this.#constructed = !0;\n const result = start(ptr, this.#highWaterMark);\n if (typeof result === \"number\" && result > 1)\n this.#hasResized = !0, this.#highWaterMark = Math.min(this.#highWaterMark, result);\n if (drainFn) {\n const drainResult = drainFn(ptr);\n if ((drainResult\?.byteLength \?\? 0) > 0)\n this.push(drainResult);\n }\n }\n #getRemainingChunk(maxToRead = this.#highWaterMark) {\n var chunk = this.#remainingChunk;\n if (chunk\?.byteLength \?\? 0 < MIN_BUFFER_SIZE) {\n var size = maxToRead > MIN_BUFFER_SIZE \? maxToRead : MIN_BUFFER_SIZE;\n this.#remainingChunk = chunk = new @Buffer(size);\n }\n return chunk;\n }\n #handleResult(result, view, isClosed) {\n if (typeof result === \"number\") {\n if (result >= this.#highWaterMark && !this.#hasResized && !isClosed)\n this.#highWaterMark *= 2, this.#hasResized = !0;\n return handleNumberResult(this, result, view, isClosed);\n } else if (typeof result === \"boolean\")\n return process.nextTick(() => {\n this.push(null);\n }), view\?.byteLength \?\? 0 > 0 \? view : @undefined;\n else if (@ArrayBuffer.isView(result)) {\n if (result.byteLength >= this.#highWaterMark && !this.#hasResized && !isClosed)\n this.#highWaterMark *= 2, this.#hasResized = !0;\n return handleArrayBufferViewResult(this, result, view, isClosed);\n } else\n throw new Error(\"Invalid result from pull\");\n }\n #internalRead(view, ptr) {\n closer[0] = !1;\n var result = pull(ptr, view, closer);\n if (@isPromise(result))\n return this.#pendingRead = !0, result.then((result2) => {\n this.#pendingRead = !1, this.#remainingChunk = this.#handleResult(result2, view, closer[0]);\n }, (reason) => {\n errorOrDestroy(this, reason);\n });\n else\n this.#remainingChunk = this.#handleResult(result, view, closer[0]);\n }\n _destroy(error, callback) {\n var ptr = this.#bunNativePtr;\n if (ptr === 0) {\n callback(error);\n return;\n }\n if (finalizer.unregister(this.#unregisterToken), this.#bunNativePtr = 0, updateRef)\n updateRef(ptr, !1);\n cancel(ptr, error), callback(error);\n }\n ref() {\n var ptr = this.#bunNativePtr;\n if (ptr === 0)\n return;\n if (this.#refCount++ === 0)\n updateRef(ptr, !0);\n }\n unref() {\n var ptr = this.#bunNativePtr;\n if (ptr === 0)\n return;\n if (this.#refCount-- === 1)\n updateRef(ptr, !1);\n }\n };\n if (!updateRef)\n NativeReadable.prototype.ref = @undefined, NativeReadable.prototype.unref = @undefined;\n return NativeReadable;\n}, getNativeReadableStreamPrototype = function(nativeType, Readable) {\n return nativeReadableStreamPrototypes[nativeType] ||= createNativeStreamReadable(nativeType, Readable);\n}, getNativeReadableStream = function(Readable, stream, options) {\n if (!(stream && typeof stream === \"object\" && stream instanceof @ReadableStream))\n return @undefined;\n const native = @direct(stream);\n if (!native)\n return @undefined;\n const { stream: ptr, data: type } = native;\n return new (getNativeReadableStreamPrototype(type, Readable))(ptr, options);\n}, NativeWritable = function(pathOrFdOrSink, options = {}) {\n Writable.@call(this, options), this[_native] = !0, this._construct = NativeWritable_internalConstruct, this._destroy = NativeWritable_internalDestroy, this._final = NativeWritable_internalFinal, this[_pathOrFdOrSink] = pathOrFdOrSink;\n}, NativeWritable_internalConstruct = function(cb) {\n if (this._writableState.constructed = !0, this.constructed = !0, typeof cb === \"function\")\n cb();\n process.nextTick(() => {\n this.emit(\"open\", this.fd), this.emit(\"ready\");\n });\n}, NativeWritable_lazyConstruct = function(stream) {\n var sink = stream[_pathOrFdOrSink];\n if (typeof sink === \"object\")\n if (typeof sink.write === \"function\")\n return stream[_fileSink] = sink;\n else\n throw new Error(\"Invalid FileSink\");\n else\n return stream[_fileSink] = Bun.file(sink).writer();\n}, NativeWritable_internalDestroy = function(error, cb) {\n const w = this._writableState, r = this._readableState;\n if (w)\n w.destroyed = !0, w.closeEmitted = !0;\n if (r)\n r.destroyed = !0, r.closeEmitted = !0;\n if (typeof cb === \"function\")\n cb(error);\n if (w\?.closeEmitted || r\?.closeEmitted)\n this.emit(\"close\");\n}, NativeWritable_internalFinal = function(cb) {\n var sink = this[_fileSink];\n if (sink)\n sink.end();\n if (cb)\n cb();\n}, EE = @lazy(\"events\"), StringDecoder = @requireNativeModule(\"string_decoder\").StringDecoder, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, runOnNextTick = process.nextTick;\nvar ArrayIsArray = @Array.isArray, require_primordials = __commonJS({\n \"node_modules/readable-stream/lib/ours/primordials.js\"(exports, module) {\n module.exports = {\n ArrayIsArray(self) {\n return @Array.isArray(self);\n },\n ArrayPrototypeIncludes(self, el) {\n return self.includes(el);\n },\n ArrayPrototypeIndexOf(self, el) {\n return self.indexOf(el);\n },\n ArrayPrototypeJoin(self, sep) {\n return self.join(sep);\n },\n ArrayPrototypeMap(self, fn) {\n return self.map(fn);\n },\n ArrayPrototypePop(self, el) {\n return self.pop(el);\n },\n ArrayPrototypePush(self, el) {\n return self.push(el);\n },\n ArrayPrototypeSlice(self, start, end) {\n return self.slice(start, end);\n },\n Error,\n FunctionPrototypeCall(fn, thisArgs, ...args) {\n return fn.@call(thisArgs, ...args);\n },\n FunctionPrototypeSymbolHasInstance(self, instance) {\n return Function.prototype[Symbol.hasInstance].@call(self, instance);\n },\n MathFloor: Math.floor,\n Number,\n NumberIsInteger: Number.isInteger,\n NumberIsNaN: Number.isNaN,\n NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,\n NumberParseInt: Number.parseInt,\n ObjectDefineProperties(self, props) {\n return Object.defineProperties(self, props);\n },\n ObjectDefineProperty(self, name, prop) {\n return Object.defineProperty(self, name, prop);\n },\n ObjectGetOwnPropertyDescriptor(self, name) {\n return Object.getOwnPropertyDescriptor(self, name);\n },\n ObjectKeys(obj) {\n return Object.keys(obj);\n },\n ObjectSetPrototypeOf(target, proto) {\n return Object.setPrototypeOf(target, proto);\n },\n Promise: @Promise,\n PromisePrototypeCatch(self, fn) {\n return self.catch(fn);\n },\n PromisePrototypeThen(self, thenFn, catchFn) {\n return self.then(thenFn, catchFn);\n },\n PromiseReject(err) {\n return @Promise.reject(err);\n },\n ReflectApply: @getByIdDirect(Reflect, \"apply\"),\n RegExpPrototypeTest(self, value) {\n return self.test(value);\n },\n SafeSet: Set,\n String: @String,\n StringPrototypeSlice(self, start, end) {\n return self.slice(start, end);\n },\n StringPrototypeToLowerCase(self) {\n return self.toLowerCase();\n },\n StringPrototypeToUpperCase(self) {\n return self.toUpperCase();\n },\n StringPrototypeTrim(self) {\n return self.trim();\n },\n Symbol,\n SymbolAsyncIterator: Symbol.asyncIterator,\n SymbolHasInstance: Symbol.hasInstance,\n SymbolIterator: Symbol.iterator,\n TypedArrayPrototypeSet(self, buf, len) {\n return self.set(buf, len);\n },\n Uint8Array: @Uint8Array\n };\n }\n}), require_util = __commonJS({\n \"node_modules/readable-stream/lib/ours/util.js\"(exports, module) {\n var AsyncFunction = Object.getPrototypeOf(async function() {\n }).constructor, isBlob = typeof Blob !== \"undefined\" \? function isBlob2(b) {\n return b instanceof Blob;\n } : function isBlob2(b) {\n return !1;\n }, AggregateError = class extends Error {\n constructor(errors) {\n if (!@Array.isArray(errors))\n @throwTypeError(`Expected input to be an Array, got ${typeof errors}`);\n let message = \"\";\n for (let i = 0;i < errors.length; i++)\n message += ` ${errors[i].stack}\n`;\n super(message);\n this.name = \"AggregateError\", this.errors = errors;\n }\n };\n module.exports = {\n AggregateError,\n once(callback) {\n let called = !1;\n return function(...args) {\n if (called)\n return;\n called = !0, callback.@apply(this, args);\n };\n },\n createDeferredPromise: function() {\n let resolve, reject;\n return {\n promise: new @Promise((res, rej) => {\n resolve = res, reject = rej;\n }),\n resolve,\n reject\n };\n },\n promisify(fn) {\n return new @Promise((resolve, reject) => {\n fn((err, ...args) => {\n if (err)\n return reject(err);\n return resolve(...args);\n });\n });\n },\n debuglog() {\n return function() {\n };\n },\n format(format, ...args) {\n return format.replace(/%([sdifj])/g, function(...[_unused, type]) {\n const replacement = args.shift();\n if (type === \"f\")\n return replacement.toFixed(6);\n else if (type === \"j\")\n return JSON.stringify(replacement);\n else if (type === \"s\" && typeof replacement === \"object\")\n return `${replacement.constructor !== Object \? replacement.constructor.name : \"\"} {}`.trim();\n else\n return replacement.toString();\n });\n },\n inspect(value) {\n switch (typeof value) {\n case \"string\":\n if (value.includes(\"'\")) {\n if (!value.includes('\"'))\n return `\"${value}\"`;\n else if (!value.includes(\"`\") && !value.includes(\"${\"))\n return `\\`${value}\\``;\n }\n return `'${value}'`;\n case \"number\":\n if (isNaN(value))\n return \"NaN\";\n else if (Object.is(value, -0))\n return @String(value);\n return value;\n case \"bigint\":\n return `${@String(value)}n`;\n case \"boolean\":\n case \"undefined\":\n return @String(value);\n case \"object\":\n return \"{}\";\n }\n },\n types: {\n isAsyncFunction(fn) {\n return fn instanceof AsyncFunction;\n },\n isArrayBufferView(arr) {\n return @ArrayBuffer.isView(arr);\n }\n },\n isBlob\n }, module.exports.promisify.custom = Symbol.for(\"nodejs.util.promisify.custom\");\n }\n}), require_errors = __commonJS({\n \"node_modules/readable-stream/lib/ours/errors.js\"(exports, module) {\n var { format, inspect, AggregateError: CustomAggregateError } = require_util(), AggregateError = globalThis.AggregateError || CustomAggregateError, kIsNodeError = Symbol(\"kIsNodeError\"), kTypes = [\"string\", \"function\", \"number\", \"object\", \"Function\", \"Object\", \"boolean\", \"bigint\", \"symbol\"], classRegExp = /^([A-Z][a-z0-9]*)+$/, nodeInternalPrefix = \"__node_internal_\", codes = {};\n function assert(value, message) {\n if (!value)\n throw new codes.ERR_INTERNAL_ASSERTION(message);\n }\n function addNumericalSeparator(val) {\n let res = \"\", i = val.length;\n const start = val[0] === \"-\" \? 1 : 0;\n for (;i >= start + 4; i -= 3)\n res = `_${val.slice(i - 3, i)}${res}`;\n return `${val.slice(0, i)}${res}`;\n }\n function getMessage(key, msg, args) {\n if (typeof msg === \"function\")\n return assert(msg.length <= args.length, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`), msg(...args);\n const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length;\n if (assert(expectedLength === args.length, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`), args.length === 0)\n return msg;\n return format(msg, ...args);\n }\n function E(code, message, Base) {\n if (!Base)\n Base = Error;\n\n class NodeError extends Base {\n constructor(...args) {\n super(getMessage(code, message, args));\n }\n toString() {\n return `${this.name} [${code}]: ${this.message}`;\n }\n }\n Object.defineProperties(NodeError.prototype, {\n name: {\n value: Base.name,\n writable: !0,\n enumerable: !1,\n configurable: !0\n },\n toString: {\n value() {\n return `${this.name} [${code}]: ${this.message}`;\n },\n writable: !0,\n enumerable: !1,\n configurable: !0\n }\n }), NodeError.prototype.code = code, NodeError.prototype[kIsNodeError] = !0, codes[code] = NodeError;\n }\n function hideStackFrames(fn) {\n const hidden = nodeInternalPrefix + fn.name;\n return Object.defineProperty(fn, \"name\", {\n value: hidden\n }), fn;\n }\n function aggregateTwoErrors(innerError, outerError) {\n if (innerError && outerError && innerError !== outerError) {\n if (@Array.isArray(outerError.errors))\n return outerError.errors.push(innerError), outerError;\n const err = new AggregateError([outerError, innerError], outerError.message);\n return err.code = outerError.code, err;\n }\n return innerError || outerError;\n }\n var AbortError2 = class extends Error {\n constructor(message = \"The operation was aborted\", options = void 0) {\n if (options !== void 0 && typeof options !== \"object\")\n throw new codes.ERR_INVALID_ARG_TYPE(\"options\", \"Object\", options);\n super(message, options);\n this.code = \"ABORT_ERR\", this.name = \"AbortError\";\n }\n };\n E(\"ERR_ASSERTION\", \"%s\", Error), E(\"ERR_INVALID_ARG_TYPE\", (name, expected, actual) => {\n if (assert(typeof name === \"string\", \"'name' must be a string\"), !@Array.isArray(expected))\n expected = [expected];\n let msg = \"The \";\n if (name.endsWith(\" argument\"))\n msg += `${name} `;\n else\n msg += `\"${name}\" ${name.includes(\".\") \? \"property\" : \"argument\"} `;\n msg += \"must be \";\n const types = [], instances = [], other = [];\n for (let value of expected)\n if (assert(typeof value === \"string\", \"All expected entries have to be of type string\"), kTypes.includes(value))\n types.push(value.toLowerCase());\n else if (classRegExp.test(value))\n instances.push(value);\n else\n assert(value !== \"object\", 'The value \"object\" should be written as \"Object\"'), other.push(value);\n if (instances.length > 0) {\n const pos = types.indexOf(\"object\");\n if (pos !== -1)\n types.splice(types, pos, 1), instances.push(\"Object\");\n }\n if (types.length > 0) {\n switch (types.length) {\n case 1:\n msg += `of type ${types[0]}`;\n break;\n case 2:\n msg += `one of type ${types[0]} or ${types[1]}`;\n break;\n default: {\n const last = types.pop();\n msg += `one of type ${types.join(\", \")}, or ${last}`;\n }\n }\n if (instances.length > 0 || other.length > 0)\n msg += \" or \";\n }\n if (instances.length > 0) {\n switch (instances.length) {\n case 1:\n msg += `an instance of ${instances[0]}`;\n break;\n case 2:\n msg += `an instance of ${instances[0]} or ${instances[1]}`;\n break;\n default: {\n const last = instances.pop();\n msg += `an instance of ${instances.join(\", \")}, or ${last}`;\n }\n }\n if (other.length > 0)\n msg += \" or \";\n }\n switch (other.length) {\n case 0:\n break;\n case 1:\n if (other[0].toLowerCase() !== other[0])\n msg += \"an \";\n msg += `${other[0]}`;\n break;\n case 2:\n msg += `one of ${other[0]} or ${other[1]}`;\n break;\n default: {\n const last = other.pop();\n msg += `one of ${other.join(\", \")}, or ${last}`;\n }\n }\n if (actual == null)\n msg += `. Received ${actual}`;\n else if (typeof actual === \"function\" && actual.name)\n msg += `. Received function ${actual.name}`;\n else if (typeof actual === \"object\") {\n var _actual$constructor;\n if ((_actual$constructor = actual.constructor) !== null && _actual$constructor !== void 0 && _actual$constructor.name)\n msg += `. Received an instance of ${actual.constructor.name}`;\n else {\n const inspected = inspect(actual, {\n depth: -1\n });\n msg += `. Received ${inspected}`;\n }\n } else {\n let inspected = inspect(actual, {\n colors: !1\n });\n if (inspected.length > 25)\n inspected = `${inspected.slice(0, 25)}...`;\n msg += `. Received type ${typeof actual} (${inspected})`;\n }\n return msg;\n }, TypeError), E(\"ERR_INVALID_ARG_VALUE\", (name, value, reason = \"is invalid\") => {\n let inspected = inspect(value);\n if (inspected.length > 128)\n inspected = inspected.slice(0, 128) + \"...\";\n return `The ${name.includes(\".\") \? \"property\" : \"argument\"} '${name}' ${reason}. Received ${inspected}`;\n }, TypeError), E(\"ERR_INVALID_RETURN_VALUE\", (input, name, value) => {\n var _value$constructor;\n const type = value !== null && value !== void 0 && (_value$constructor = value.constructor) !== null && _value$constructor !== void 0 && _value$constructor.name \? `instance of ${value.constructor.name}` : `type ${typeof value}`;\n return `Expected ${input} to be returned from the \"${name}\" function but got ${type}.`;\n }, TypeError), E(\"ERR_MISSING_ARGS\", (...args) => {\n assert(args.length > 0, \"At least one arg needs to be specified\");\n let msg;\n const len = args.length;\n switch (args = (@Array.isArray(args) \? args : [args]).map((a) => `\"${a}\"`).join(\" or \"), len) {\n case 1:\n msg += `The ${args[0]} argument`;\n break;\n case 2:\n msg += `The ${args[0]} and ${args[1]} arguments`;\n break;\n default:\n {\n const last = args.pop();\n msg += `The ${args.join(\", \")}, and ${last} arguments`;\n }\n break;\n }\n return `${msg} must be specified`;\n }, TypeError), E(\"ERR_OUT_OF_RANGE\", (str, range, input) => {\n assert(range, 'Missing \"range\" argument');\n let received;\n if (Number.isInteger(input) && Math.abs(input) > 4294967296)\n received = addNumericalSeparator(@String(input));\n else if (typeof input === \"bigint\") {\n if (received = @String(input), input > 2n ** 32n || input < -(2n ** 32n))\n received = addNumericalSeparator(received);\n received += \"n\";\n } else\n received = inspect(input);\n return `The value of \"${str}\" is out of range. It must be ${range}. Received ${received}`;\n }, RangeError), E(\"ERR_MULTIPLE_CALLBACK\", \"Callback called multiple times\", Error), E(\"ERR_METHOD_NOT_IMPLEMENTED\", \"The %s method is not implemented\", Error), E(\"ERR_STREAM_ALREADY_FINISHED\", \"Cannot call %s after a stream was finished\", Error), E(\"ERR_STREAM_CANNOT_PIPE\", \"Cannot pipe, not readable\", Error), E(\"ERR_STREAM_DESTROYED\", \"Cannot call %s after a stream was destroyed\", Error), E(\"ERR_STREAM_NULL_VALUES\", \"May not write null values to stream\", TypeError), E(\"ERR_STREAM_PREMATURE_CLOSE\", \"Premature close\", Error), E(\"ERR_STREAM_PUSH_AFTER_EOF\", \"stream.push() after EOF\", Error), E(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\", \"stream.unshift() after end event\", Error), E(\"ERR_STREAM_WRITE_AFTER_END\", \"write after end\", Error), E(\"ERR_UNKNOWN_ENCODING\", \"Unknown encoding: %s\", TypeError), module.exports = {\n AbortError: AbortError2,\n aggregateTwoErrors: hideStackFrames(aggregateTwoErrors),\n hideStackFrames,\n codes\n };\n }\n}), require_validators = __commonJS({\n \"node_modules/readable-stream/lib/internal/validators.js\"(exports, module) {\n var {\n ArrayIsArray: ArrayIsArray2,\n ArrayPrototypeIncludes,\n ArrayPrototypeJoin,\n ArrayPrototypeMap,\n NumberIsInteger,\n NumberMAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER,\n NumberParseInt,\n RegExpPrototypeTest,\n String: String2,\n StringPrototypeToUpperCase,\n StringPrototypeTrim\n } = require_primordials(), {\n hideStackFrames,\n codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL }\n } = require_errors(), { normalizeEncoding } = require_util(), { isAsyncFunction, isArrayBufferView } = require_util().types, signals = {};\n function isInt32(value) {\n return value === (value | 0);\n }\n function isUint32(value) {\n return value === value >>> 0;\n }\n var octalReg = /^[0-7]+$/, modeDesc = \"must be a 32-bit unsigned integer or an octal string\";\n function parseFileMode(value, name, def) {\n if (typeof value === \"undefined\")\n value = def;\n if (typeof value === \"string\") {\n if (!RegExpPrototypeTest(octalReg, value))\n throw new ERR_INVALID_ARG_VALUE2(name, value, modeDesc);\n value = NumberParseInt(value, 8);\n }\n return validateInt32(value, name, 0, 4294967295), value;\n }\n var validateInteger = hideStackFrames((value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }), validateInt32 = hideStackFrames((value, name, min = -2147483648, max = 2147483647) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!isInt32(value)) {\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n }), validateUint32 = hideStackFrames((value, name, positive) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n if (!isUint32(value)) {\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n throw new ERR_OUT_OF_RANGE(name, `>= ${positive \? 1 : 0} && < 4294967296`, value);\n }\n if (positive && value === 0)\n throw new ERR_OUT_OF_RANGE(name, \">= 1 && < 4294967296\", value);\n });\n function validateString(value, name) {\n if (typeof value !== \"string\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"string\", value);\n }\n function validateNumber(value, name) {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"number\", value);\n }\n var validateOneOf = hideStackFrames((value, name, oneOf) => {\n if (!ArrayPrototypeIncludes(oneOf, value)) {\n const reason = \"must be one of: \" + ArrayPrototypeJoin(ArrayPrototypeMap(oneOf, (v) => typeof v === \"string\" \? `'${v}'` : String2(v)), \", \");\n throw new ERR_INVALID_ARG_VALUE2(name, value, reason);\n }\n });\n function validateBoolean2(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"boolean\", value);\n }\n var validateObject = hideStackFrames((value, name, options) => {\n const useDefaultOptions = options == null, allowArray = useDefaultOptions \? !1 : options.allowArray, allowFunction = useDefaultOptions \? !1 : options.allowFunction;\n if (!(useDefaultOptions \? !1 : options.nullable) && value === null || !allowArray && ArrayIsArray2(value) || typeof value !== \"object\" && (!allowFunction || typeof value !== \"function\"))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Object\", value);\n }), validateArray = hideStackFrames((value, name, minLength = 0) => {\n if (!ArrayIsArray2(value))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Array\", value);\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`;\n throw new ERR_INVALID_ARG_VALUE2(name, value, reason);\n }\n });\n function validateSignalName(signal, name = \"signal\") {\n if (validateString(signal, name), signals[signal] === void 0) {\n if (signals[StringPrototypeToUpperCase(signal)] !== void 0)\n throw new ERR_UNKNOWN_SIGNAL(signal + \" (signals must use all capital letters)\");\n throw new ERR_UNKNOWN_SIGNAL(signal);\n }\n }\n var validateBuffer = hideStackFrames((buffer, name = \"buffer\") => {\n if (!isArrayBufferView(buffer))\n throw new ERR_INVALID_ARG_TYPE2(name, [\"Buffer\", \"TypedArray\", \"DataView\"], buffer);\n });\n function validateEncoding(data, encoding) {\n const normalizedEncoding = normalizeEncoding(encoding), length = data.length;\n if (normalizedEncoding === \"hex\" && length % 2 !== 0)\n throw new ERR_INVALID_ARG_VALUE2(\"encoding\", encoding, `is invalid for data of length ${length}`);\n }\n function validatePort(port, name = \"Port\", allowZero = !0) {\n if (typeof port !== \"number\" && typeof port !== \"string\" || typeof port === \"string\" && StringPrototypeTrim(port).length === 0 || +port !== +port >>> 0 || port > 65535 || port === 0 && !allowZero)\n throw new ERR_SOCKET_BAD_PORT(name, port, allowZero);\n return port | 0;\n }\n var validateAbortSignal = hideStackFrames((signal, name) => {\n if (signal !== void 0 && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE2(name, \"AbortSignal\", signal);\n }), validateFunction = hideStackFrames((value, name) => {\n if (typeof value !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(name, \"Function\", value);\n }), validatePlainFunction = hideStackFrames((value, name) => {\n if (typeof value !== \"function\" || isAsyncFunction(value))\n throw new ERR_INVALID_ARG_TYPE2(name, \"Function\", value);\n }), validateUndefined = hideStackFrames((value, name) => {\n if (value !== void 0)\n throw new ERR_INVALID_ARG_TYPE2(name, \"undefined\", value);\n });\n module.exports = {\n isInt32,\n isUint32,\n parseFileMode,\n validateArray,\n validateBoolean: validateBoolean2,\n validateBuffer,\n validateEncoding,\n validateFunction,\n validateInt32,\n validateInteger,\n validateNumber,\n validateObject,\n validateOneOf,\n validatePlainFunction,\n validatePort,\n validateSignalName,\n validateString,\n validateUint32,\n validateUndefined,\n validateAbortSignal\n };\n }\n}), require_utils = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/utils.js\"(exports, module) {\n var { Symbol: Symbol2, SymbolAsyncIterator, SymbolIterator } = require_primordials(), kDestroyed = Symbol2(\"kDestroyed\"), kIsErrored = Symbol2(\"kIsErrored\"), kIsReadable = Symbol2(\"kIsReadable\"), kIsDisturbed = Symbol2(\"kIsDisturbed\");\n function isReadableNodeStream(obj, strict = !1) {\n var _obj$_readableState;\n return !!(obj && typeof obj.pipe === \"function\" && typeof obj.on === \"function\" && (!strict || typeof obj.pause === \"function\" && typeof obj.resume === \"function\") && (!obj._writableState || ((_obj$_readableState = obj._readableState) === null || _obj$_readableState === void 0 \? void 0 : _obj$_readableState.readable) !== !1) && (!obj._writableState || obj._readableState));\n }\n function isWritableNodeStream(obj) {\n var _obj$_writableState;\n return !!(obj && typeof obj.write === \"function\" && typeof obj.on === \"function\" && (!obj._readableState || ((_obj$_writableState = obj._writableState) === null || _obj$_writableState === void 0 \? void 0 : _obj$_writableState.writable) !== !1));\n }\n function isDuplexNodeStream(obj) {\n return !!(obj && typeof obj.pipe === \"function\" && obj._readableState && typeof obj.on === \"function\" && typeof obj.write === \"function\");\n }\n function isNodeStream(obj) {\n return obj && (obj._readableState || obj._writableState || typeof obj.write === \"function\" && typeof obj.on === \"function\" || typeof obj.pipe === \"function\" && typeof obj.on === \"function\");\n }\n function isIterable(obj, isAsync) {\n if (obj == null)\n return !1;\n if (isAsync === !0)\n return typeof obj[SymbolAsyncIterator] === \"function\";\n if (isAsync === !1)\n return typeof obj[SymbolIterator] === \"function\";\n return typeof obj[SymbolAsyncIterator] === \"function\" || typeof obj[SymbolIterator] === \"function\";\n }\n function isDestroyed(stream) {\n if (!isNodeStream(stream))\n return null;\n const { _writableState: wState, _readableState: rState } = stream, state = wState || rState;\n return !!(stream.destroyed || stream[kDestroyed] || state !== null && state !== void 0 && state.destroyed);\n }\n function isWritableEnded(stream) {\n if (!isWritableNodeStream(stream))\n return null;\n if (stream.writableEnded === !0)\n return !0;\n const wState = stream._writableState;\n if (wState !== null && wState !== void 0 && wState.errored)\n return !1;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.ended) !== \"boolean\")\n return null;\n return wState.ended;\n }\n function isWritableFinished(stream, strict) {\n if (!isWritableNodeStream(stream))\n return null;\n if (stream.writableFinished === !0)\n return !0;\n const wState = stream._writableState;\n if (wState !== null && wState !== void 0 && wState.errored)\n return !1;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.finished) !== \"boolean\")\n return null;\n return !!(wState.finished || strict === !1 && wState.ended === !0 && wState.length === 0);\n }\n function isReadableEnded(stream) {\n if (!isReadableNodeStream(stream))\n return null;\n if (stream.readableEnded === !0)\n return !0;\n const rState = stream._readableState;\n if (!rState || rState.errored)\n return !1;\n if (typeof (rState === null || rState === void 0 \? void 0 : rState.ended) !== \"boolean\")\n return null;\n return rState.ended;\n }\n function isReadableFinished(stream, strict) {\n if (!isReadableNodeStream(stream))\n return null;\n const rState = stream._readableState;\n if (rState !== null && rState !== void 0 && rState.errored)\n return !1;\n if (typeof (rState === null || rState === void 0 \? void 0 : rState.endEmitted) !== \"boolean\")\n return null;\n return !!(rState.endEmitted || strict === !1 && rState.ended === !0 && rState.length === 0);\n }\n function isReadable(stream) {\n if (stream && stream[kIsReadable] != null)\n return stream[kIsReadable];\n if (typeof (stream === null || stream === void 0 \? void 0 : stream.readable) !== \"boolean\")\n return null;\n if (isDestroyed(stream))\n return !1;\n return isReadableNodeStream(stream) && stream.readable && !isReadableFinished(stream);\n }\n function isWritable(stream) {\n if (typeof (stream === null || stream === void 0 \? void 0 : stream.writable) !== \"boolean\")\n return null;\n if (isDestroyed(stream))\n return !1;\n return isWritableNodeStream(stream) && stream.writable && !isWritableEnded(stream);\n }\n function isFinished(stream, opts) {\n if (!isNodeStream(stream))\n return null;\n if (isDestroyed(stream))\n return !0;\n if ((opts === null || opts === void 0 \? void 0 : opts.readable) !== !1 && isReadable(stream))\n return !1;\n if ((opts === null || opts === void 0 \? void 0 : opts.writable) !== !1 && isWritable(stream))\n return !1;\n return !0;\n }\n function isWritableErrored(stream) {\n var _stream$_writableStat, _stream$_writableStat2;\n if (!isNodeStream(stream))\n return null;\n if (stream.writableErrored)\n return stream.writableErrored;\n return (_stream$_writableStat = (_stream$_writableStat2 = stream._writableState) === null || _stream$_writableStat2 === void 0 \? void 0 : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== void 0 \? _stream$_writableStat : null;\n }\n function isReadableErrored(stream) {\n var _stream$_readableStat, _stream$_readableStat2;\n if (!isNodeStream(stream))\n return null;\n if (stream.readableErrored)\n return stream.readableErrored;\n return (_stream$_readableStat = (_stream$_readableStat2 = stream._readableState) === null || _stream$_readableStat2 === void 0 \? void 0 : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== void 0 \? _stream$_readableStat : null;\n }\n function isClosed(stream) {\n if (!isNodeStream(stream))\n return null;\n if (typeof stream.closed === \"boolean\")\n return stream.closed;\n const { _writableState: wState, _readableState: rState } = stream;\n if (typeof (wState === null || wState === void 0 \? void 0 : wState.closed) === \"boolean\" || typeof (rState === null || rState === void 0 \? void 0 : rState.closed) === \"boolean\")\n return (wState === null || wState === void 0 \? void 0 : wState.closed) || (rState === null || rState === void 0 \? void 0 : rState.closed);\n if (typeof stream._closed === \"boolean\" && isOutgoingMessage(stream))\n return stream._closed;\n return null;\n }\n function isOutgoingMessage(stream) {\n return typeof stream._closed === \"boolean\" && typeof stream._defaultKeepAlive === \"boolean\" && typeof stream._removedConnection === \"boolean\" && typeof stream._removedContLen === \"boolean\";\n }\n function isServerResponse(stream) {\n return typeof stream._sent100 === \"boolean\" && isOutgoingMessage(stream);\n }\n function isServerRequest(stream) {\n var _stream$req;\n return typeof stream._consuming === \"boolean\" && typeof stream._dumped === \"boolean\" && ((_stream$req = stream.req) === null || _stream$req === void 0 \? void 0 : _stream$req.upgradeOrConnect) === void 0;\n }\n function willEmitClose(stream) {\n if (!isNodeStream(stream))\n return null;\n const { _writableState: wState, _readableState: rState } = stream, state = wState || rState;\n return !state && isServerResponse(stream) || !!(state && state.autoDestroy && state.emitClose && state.closed === !1);\n }\n function isDisturbed(stream) {\n var _stream$kIsDisturbed;\n return !!(stream && ((_stream$kIsDisturbed = stream[kIsDisturbed]) !== null && _stream$kIsDisturbed !== void 0 \? _stream$kIsDisturbed : stream.readableDidRead || stream.readableAborted));\n }\n function isErrored(stream) {\n var _ref, _ref2, _ref3, _ref4, _ref5, _stream$kIsErrored, _stream$_readableStat3, _stream$_writableStat3, _stream$_readableStat4, _stream$_writableStat4;\n return !!(stream && ((_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_stream$kIsErrored = stream[kIsErrored]) !== null && _stream$kIsErrored !== void 0 \? _stream$kIsErrored : stream.readableErrored) !== null && _ref5 !== void 0 \? _ref5 : stream.writableErrored) !== null && _ref4 !== void 0 \? _ref4 : (_stream$_readableStat3 = stream._readableState) === null || _stream$_readableStat3 === void 0 \? void 0 : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== void 0 \? _ref3 : (_stream$_writableStat3 = stream._writableState) === null || _stream$_writableStat3 === void 0 \? void 0 : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== void 0 \? _ref2 : (_stream$_readableStat4 = stream._readableState) === null || _stream$_readableStat4 === void 0 \? void 0 : _stream$_readableStat4.errored) !== null && _ref !== void 0 \? _ref : (_stream$_writableStat4 = stream._writableState) === null || _stream$_writableStat4 === void 0 \? void 0 : _stream$_writableStat4.errored));\n }\n module.exports = {\n kDestroyed,\n isDisturbed,\n kIsDisturbed,\n isErrored,\n kIsErrored,\n isReadable,\n kIsReadable,\n isClosed,\n isDestroyed,\n isDuplexNodeStream,\n isFinished,\n isIterable,\n isReadableNodeStream,\n isReadableEnded,\n isReadableFinished,\n isReadableErrored,\n isNodeStream,\n isWritable,\n isWritableNodeStream,\n isWritableEnded,\n isWritableFinished,\n isWritableErrored,\n isServerRequest,\n isServerResponse,\n willEmitClose\n };\n }\n}), require_end_of_stream = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/end-of-stream.js\"(exports, module) {\n var { AbortError: AbortError2, codes } = require_errors(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_PREMATURE_CLOSE } = codes, { once } = require_util(), { validateAbortSignal, validateFunction, validateObject } = require_validators(), { Promise: Promise2 } = require_primordials(), {\n isClosed,\n isReadable,\n isReadableNodeStream,\n isReadableFinished,\n isReadableErrored,\n isWritable,\n isWritableNodeStream,\n isWritableFinished,\n isWritableErrored,\n isNodeStream,\n willEmitClose: _willEmitClose\n } = require_utils();\n function isRequest(stream) {\n return stream.setHeader && typeof stream.abort === \"function\";\n }\n var nop = () => {\n };\n function eos(stream, options, callback) {\n var _options$readable, _options$writable;\n if (arguments.length === 2)\n callback = options, options = {};\n else if (options == null)\n options = {};\n else\n validateObject(options, \"options\");\n validateFunction(callback, \"callback\"), validateAbortSignal(options.signal, \"options.signal\"), callback = once(callback);\n const readable = (_options$readable = options.readable) !== null && _options$readable !== void 0 \? _options$readable : isReadableNodeStream(stream), writable = (_options$writable = options.writable) !== null && _options$writable !== void 0 \? _options$writable : isWritableNodeStream(stream);\n if (!isNodeStream(stream))\n throw new ERR_INVALID_ARG_TYPE2(\"stream\", \"Stream\", stream);\n const { _writableState: wState, _readableState: rState } = stream, onlegacyfinish = () => {\n if (!stream.writable)\n onfinish();\n };\n let willEmitClose = _willEmitClose(stream) && isReadableNodeStream(stream) === readable && isWritableNodeStream(stream) === writable, writableFinished = isWritableFinished(stream, !1);\n const onfinish = () => {\n if (writableFinished = !0, stream.destroyed)\n willEmitClose = !1;\n if (willEmitClose && (!stream.readable || readable))\n return;\n if (!readable || readableFinished)\n callback.@call(stream);\n };\n let readableFinished = isReadableFinished(stream, !1);\n const onend = () => {\n if (readableFinished = !0, stream.destroyed)\n willEmitClose = !1;\n if (willEmitClose && (!stream.writable || writable))\n return;\n if (!writable || writableFinished)\n callback.@call(stream);\n }, onerror = (err) => {\n callback.@call(stream, err);\n };\n let closed = isClosed(stream);\n const onclose = () => {\n closed = !0;\n const errored = isWritableErrored(stream) || isReadableErrored(stream);\n if (errored && typeof errored !== \"boolean\")\n return callback.@call(stream, errored);\n if (readable && !readableFinished && isReadableNodeStream(stream, !0)) {\n if (!isReadableFinished(stream, !1))\n return callback.@call(stream, new ERR_STREAM_PREMATURE_CLOSE);\n }\n if (writable && !writableFinished) {\n if (!isWritableFinished(stream, !1))\n return callback.@call(stream, new ERR_STREAM_PREMATURE_CLOSE);\n }\n callback.@call(stream);\n }, onrequest = () => {\n stream.req.on(\"finish\", onfinish);\n };\n if (isRequest(stream)) {\n if (stream.on(\"complete\", onfinish), !willEmitClose)\n stream.on(\"abort\", onclose);\n if (stream.req)\n onrequest();\n else\n stream.on(\"request\", onrequest);\n } else if (writable && !wState)\n stream.on(\"end\", onlegacyfinish), stream.on(\"close\", onlegacyfinish);\n if (!willEmitClose && typeof stream.aborted === \"boolean\")\n stream.on(\"aborted\", onclose);\n if (stream.on(\"end\", onend), stream.on(\"finish\", onfinish), options.error !== !1)\n stream.on(\"error\", onerror);\n if (stream.on(\"close\", onclose), closed)\n runOnNextTick(onclose);\n else if (wState !== null && wState !== void 0 && wState.errorEmitted || rState !== null && rState !== void 0 && rState.errorEmitted) {\n if (!willEmitClose)\n runOnNextTick(onclose);\n } else if (!readable && (!willEmitClose || isReadable(stream)) && (writableFinished || isWritable(stream) === !1))\n runOnNextTick(onclose);\n else if (!writable && (!willEmitClose || isWritable(stream)) && (readableFinished || isReadable(stream) === !1))\n runOnNextTick(onclose);\n else if (rState && stream.req && stream.aborted)\n runOnNextTick(onclose);\n const cleanup = () => {\n if (callback = nop, stream.removeListener(\"aborted\", onclose), stream.removeListener(\"complete\", onfinish), stream.removeListener(\"abort\", onclose), stream.removeListener(\"request\", onrequest), stream.req)\n stream.req.removeListener(\"finish\", onfinish);\n stream.removeListener(\"end\", onlegacyfinish), stream.removeListener(\"close\", onlegacyfinish), stream.removeListener(\"finish\", onfinish), stream.removeListener(\"end\", onend), stream.removeListener(\"error\", onerror), stream.removeListener(\"close\", onclose);\n };\n if (options.signal && !closed) {\n const abort = () => {\n const endCallback = callback;\n cleanup(), endCallback.@call(stream, new AbortError2(void 0, {\n cause: options.signal.reason\n }));\n };\n if (options.signal.aborted)\n runOnNextTick(abort);\n else {\n const originalCallback = callback;\n callback = once((...args) => {\n options.signal.removeEventListener(\"abort\", abort), originalCallback.@apply(stream, args);\n }), options.signal.addEventListener(\"abort\", abort);\n }\n }\n return cleanup;\n }\n function finished(stream, opts) {\n return new Promise2((resolve, reject) => {\n eos(stream, opts, (err) => {\n if (err)\n reject(err);\n else\n resolve();\n });\n });\n }\n module.exports = eos, module.exports.finished = finished;\n }\n}), require_operators = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/operators.js\"(exports, module) {\n var {\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_MISSING_ARGS, ERR_OUT_OF_RANGE },\n AbortError: AbortError2\n } = require_errors(), { validateAbortSignal, validateInteger, validateObject } = require_validators(), kWeakHandler = require_primordials().Symbol(\"kWeak\"), { finished } = require_end_of_stream(), {\n ArrayPrototypePush,\n MathFloor,\n Number: Number2,\n NumberIsNaN,\n Promise: Promise2,\n PromiseReject,\n PromisePrototypeCatch,\n Symbol: Symbol2\n } = require_primordials(), kEmpty = Symbol2(\"kEmpty\"), kEof = Symbol2(\"kEof\");\n function map(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n let concurrency = 1;\n if ((options === null || options === void 0 \? void 0 : options.concurrency) != null)\n concurrency = MathFloor(options.concurrency);\n return validateInteger(concurrency, \"concurrency\", 1), async function* map2() {\n var _options$signal, _options$signal2;\n const ac = new AbortController, stream = this, queue = [], signal = ac.signal, signalOpt = {\n signal\n }, abort = () => ac.abort();\n if (options !== null && options !== void 0 && (_options$signal = options.signal) !== null && _options$signal !== void 0 && _options$signal.aborted)\n abort();\n options === null || options === void 0 || (_options$signal2 = options.signal) === null || _options$signal2 === void 0 || _options$signal2.addEventListener(\"abort\", abort);\n let next, resume, done = !1;\n function onDone() {\n done = !0;\n }\n async function pump() {\n try {\n for await (let val of stream) {\n var _val;\n if (done)\n return;\n if (signal.aborted)\n throw new AbortError2;\n try {\n val = fn(val, signalOpt);\n } catch (err) {\n val = PromiseReject(err);\n }\n if (val === kEmpty)\n continue;\n if (typeof ((_val = val) === null || _val === void 0 \? void 0 : _val.catch) === \"function\")\n val.catch(onDone);\n if (queue.push(val), next)\n next(), next = null;\n if (!done && queue.length && queue.length >= concurrency)\n await new Promise2((resolve) => {\n resume = resolve;\n });\n }\n queue.push(kEof);\n } catch (err) {\n const val = PromiseReject(err);\n PromisePrototypeCatch(val, onDone), queue.push(val);\n } finally {\n var _options$signal3;\n if (done = !0, next)\n next(), next = null;\n options === null || options === void 0 || (_options$signal3 = options.signal) === null || _options$signal3 === void 0 || _options$signal3.removeEventListener(\"abort\", abort);\n }\n }\n pump();\n try {\n while (!0) {\n while (queue.length > 0) {\n const val = await queue[0];\n if (val === kEof)\n return;\n if (signal.aborted)\n throw new AbortError2;\n if (val !== kEmpty)\n yield val;\n if (queue.shift(), resume)\n resume(), resume = null;\n }\n await new Promise2((resolve) => {\n next = resolve;\n });\n }\n } finally {\n if (ac.abort(), done = !0, resume)\n resume(), resume = null;\n }\n }.@call(this);\n }\n function asIndexedPairs(options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return async function* asIndexedPairs2() {\n let index = 0;\n for await (let val of this) {\n var _options$signal4;\n if (options !== null && options !== void 0 && (_options$signal4 = options.signal) !== null && _options$signal4 !== void 0 && _options$signal4.aborted)\n throw new AbortError2({\n cause: options.signal.reason\n });\n yield [index++, val];\n }\n }.@call(this);\n }\n async function some(fn, options = void 0) {\n for await (let unused of filter.@call(this, fn, options))\n return !0;\n return !1;\n }\n async function every(fn, options = void 0) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n return !await some.@call(this, async (...args) => {\n return !await fn(...args);\n }, options);\n }\n async function find(fn, options) {\n for await (let result of filter.@call(this, fn, options))\n return result;\n return;\n }\n async function forEach(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n async function forEachFn(value, options2) {\n return await fn(value, options2), kEmpty;\n }\n for await (let unused of map.@call(this, forEachFn, options))\n ;\n }\n function filter(fn, options) {\n if (typeof fn !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"fn\", [\"Function\", \"AsyncFunction\"], fn);\n async function filterFn(value, options2) {\n if (await fn(value, options2))\n return value;\n return kEmpty;\n }\n return map.@call(this, filterFn, options);\n }\n var ReduceAwareErrMissingArgs = class extends ERR_MISSING_ARGS {\n constructor() {\n super(\"reduce\");\n this.message = \"Reduce of an empty stream requires an initial value\";\n }\n };\n async function reduce(reducer, initialValue, options) {\n var _options$signal5;\n if (typeof reducer !== \"function\")\n throw new ERR_INVALID_ARG_TYPE2(\"reducer\", [\"Function\", \"AsyncFunction\"], reducer);\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n let hasInitialValue = arguments.length > 1;\n if (options !== null && options !== void 0 && (_options$signal5 = options.signal) !== null && _options$signal5 !== void 0 && _options$signal5.aborted) {\n const err = new AbortError2(void 0, {\n cause: options.signal.reason\n });\n throw this.once(\"error\", () => {\n }), await finished(this.destroy(err)), err;\n }\n const ac = new AbortController, signal = ac.signal;\n if (options !== null && options !== void 0 && options.signal) {\n const opts = {\n once: !0,\n [kWeakHandler]: this\n };\n options.signal.addEventListener(\"abort\", () => ac.abort(), opts);\n }\n let gotAnyItemFromStream = !1;\n try {\n for await (let value of this) {\n var _options$signal6;\n if (gotAnyItemFromStream = !0, options !== null && options !== void 0 && (_options$signal6 = options.signal) !== null && _options$signal6 !== void 0 && _options$signal6.aborted)\n throw new AbortError2;\n if (!hasInitialValue)\n initialValue = value, hasInitialValue = !0;\n else\n initialValue = await reducer(initialValue, value, {\n signal\n });\n }\n if (!gotAnyItemFromStream && !hasInitialValue)\n throw new ReduceAwareErrMissingArgs;\n } finally {\n ac.abort();\n }\n return initialValue;\n }\n async function toArray(options) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n const result = [];\n for await (let val of this) {\n var _options$signal7;\n if (options !== null && options !== void 0 && (_options$signal7 = options.signal) !== null && _options$signal7 !== void 0 && _options$signal7.aborted)\n throw new AbortError2(void 0, {\n cause: options.signal.reason\n });\n ArrayPrototypePush(result, val);\n }\n return result;\n }\n function flatMap(fn, options) {\n const values = map.@call(this, fn, options);\n return async function* flatMap2() {\n for await (let val of values)\n yield* val;\n }.@call(this);\n }\n function toIntegerOrInfinity(number) {\n if (number = Number2(number), NumberIsNaN(number))\n return 0;\n if (number < 0)\n throw new ERR_OUT_OF_RANGE(\"number\", \">= 0\", number);\n return number;\n }\n function drop(number, options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return number = toIntegerOrInfinity(number), async function* drop2() {\n var _options$signal8;\n if (options !== null && options !== void 0 && (_options$signal8 = options.signal) !== null && _options$signal8 !== void 0 && _options$signal8.aborted)\n throw new AbortError2;\n for await (let val of this) {\n var _options$signal9;\n if (options !== null && options !== void 0 && (_options$signal9 = options.signal) !== null && _options$signal9 !== void 0 && _options$signal9.aborted)\n throw new AbortError2;\n if (number-- <= 0)\n yield val;\n }\n }.@call(this);\n }\n function take(number, options = void 0) {\n if (options != null)\n validateObject(options, \"options\");\n if ((options === null || options === void 0 \? void 0 : options.signal) != null)\n validateAbortSignal(options.signal, \"options.signal\");\n return number = toIntegerOrInfinity(number), async function* take2() {\n var _options$signal10;\n if (options !== null && options !== void 0 && (_options$signal10 = options.signal) !== null && _options$signal10 !== void 0 && _options$signal10.aborted)\n throw new AbortError2;\n for await (let val of this) {\n var _options$signal11;\n if (options !== null && options !== void 0 && (_options$signal11 = options.signal) !== null && _options$signal11 !== void 0 && _options$signal11.aborted)\n throw new AbortError2;\n if (number-- > 0)\n yield val;\n else\n return;\n }\n }.@call(this);\n }\n module.exports.streamReturningOperators = {\n asIndexedPairs,\n drop,\n filter,\n flatMap,\n map,\n take\n }, module.exports.promiseReturningOperators = {\n every,\n forEach,\n reduce,\n toArray,\n some,\n find\n };\n }\n}), require_destroy = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/destroy.js\"(exports, module) {\n var {\n aggregateTwoErrors,\n codes: { ERR_MULTIPLE_CALLBACK },\n AbortError: AbortError2\n } = require_errors(), { Symbol: Symbol2 } = require_primordials(), { kDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils(), kDestroy = \"#kDestroy\", kConstruct = \"#kConstruct\";\n function checkError(err, w, r) {\n if (err) {\n if (err.stack, w && !w.errored)\n w.errored = err;\n if (r && !r.errored)\n r.errored = err;\n }\n }\n function destroy2(err, cb) {\n const r = this._readableState, w = this._writableState, s = w || r;\n if (w && w.destroyed || r && r.destroyed) {\n if (typeof cb === \"function\")\n cb();\n return this;\n }\n if (checkError(err, w, r), w)\n w.destroyed = !0;\n if (r)\n r.destroyed = !0;\n if (!s.constructed)\n this.once(kDestroy, (er) => {\n _destroy(this, aggregateTwoErrors(er, err), cb);\n });\n else\n _destroy(this, err, cb);\n return this;\n }\n function _destroy(self, err, cb) {\n let called = !1;\n function onDestroy(err2) {\n if (called)\n return;\n called = !0;\n const { _readableState: r, _writableState: w } = self;\n if (checkError(err2, w, r), w)\n w.closed = !0;\n if (r)\n r.closed = !0;\n if (typeof cb === \"function\")\n cb(err2);\n if (err2)\n runOnNextTick(emitErrorCloseNT, self, err2);\n else\n runOnNextTick(emitCloseNT, self);\n }\n try {\n self._destroy(err || null, onDestroy);\n } catch (err2) {\n onDestroy(err2);\n }\n }\n function emitErrorCloseNT(self, err) {\n emitErrorNT(self, err), emitCloseNT(self);\n }\n function emitCloseNT(self) {\n const { _readableState: r, _writableState: w } = self;\n if (w)\n w.closeEmitted = !0;\n if (r)\n r.closeEmitted = !0;\n if (w && w.emitClose || r && r.emitClose)\n self.emit(\"close\");\n }\n function emitErrorNT(self, err) {\n const r = self\?._readableState, w = self\?._writableState;\n if (w\?.errorEmitted || r\?.errorEmitted)\n return;\n if (w)\n w.errorEmitted = !0;\n if (r)\n r.errorEmitted = !0;\n self\?.emit\?.(\"error\", err);\n }\n function undestroy() {\n const r = this._readableState, w = this._writableState;\n if (r)\n r.constructed = !0, r.closed = !1, r.closeEmitted = !1, r.destroyed = !1, r.errored = null, r.errorEmitted = !1, r.reading = !1, r.ended = r.readable === !1, r.endEmitted = r.readable === !1;\n if (w)\n w.constructed = !0, w.destroyed = !1, w.closed = !1, w.closeEmitted = !1, w.errored = null, w.errorEmitted = !1, w.finalCalled = !1, w.prefinished = !1, w.ended = w.writable === !1, w.ending = w.writable === !1, w.finished = w.writable === !1;\n }\n function errorOrDestroy2(stream, err, sync) {\n const r = stream\?._readableState, w = stream\?._writableState;\n if (w && w.destroyed || r && r.destroyed)\n return this;\n if (r && r.autoDestroy || w && w.autoDestroy)\n stream.destroy(err);\n else if (err) {\n if (Error.captureStackTrace(err), w && !w.errored)\n w.errored = err;\n if (r && !r.errored)\n r.errored = err;\n if (sync)\n runOnNextTick(emitErrorNT, stream, err);\n else\n emitErrorNT(stream, err);\n }\n }\n function construct(stream, cb) {\n if (typeof stream._construct !== \"function\")\n return;\n const { _readableState: r, _writableState: w } = stream;\n if (r)\n r.constructed = !1;\n if (w)\n w.constructed = !1;\n if (stream.once(kConstruct, cb), stream.listenerCount(kConstruct) > 1)\n return;\n runOnNextTick(constructNT, stream);\n }\n function constructNT(stream) {\n let called = !1;\n function onConstruct(err) {\n if (called) {\n errorOrDestroy2(stream, err !== null && err !== void 0 \? err : new ERR_MULTIPLE_CALLBACK);\n return;\n }\n called = !0;\n const { _readableState: r, _writableState: w } = stream, s = w || r;\n if (r)\n r.constructed = !0;\n if (w)\n w.constructed = !0;\n if (s.destroyed)\n stream.emit(kDestroy, err);\n else if (err)\n errorOrDestroy2(stream, err, !0);\n else\n runOnNextTick(emitConstructNT, stream);\n }\n try {\n stream._construct(onConstruct);\n } catch (err) {\n onConstruct(err);\n }\n }\n function emitConstructNT(stream) {\n stream.emit(kConstruct);\n }\n function isRequest(stream) {\n return stream && stream.setHeader && typeof stream.abort === \"function\";\n }\n function emitCloseLegacy(stream) {\n stream.emit(\"close\");\n }\n function emitErrorCloseLegacy(stream, err) {\n stream.emit(\"error\", err), runOnNextTick(emitCloseLegacy, stream);\n }\n function destroyer(stream, err) {\n if (!stream || isDestroyed(stream))\n return;\n if (!err && !isFinished(stream))\n err = new AbortError2;\n if (isServerRequest(stream))\n stream.socket = null, stream.destroy(err);\n else if (isRequest(stream))\n stream.abort();\n else if (isRequest(stream.req))\n stream.req.abort();\n else if (typeof stream.destroy === \"function\")\n stream.destroy(err);\n else if (typeof stream.close === \"function\")\n stream.close();\n else if (err)\n runOnNextTick(emitErrorCloseLegacy, stream);\n else\n runOnNextTick(emitCloseLegacy, stream);\n if (!stream.destroyed)\n stream[kDestroyed] = !0;\n }\n module.exports = {\n construct,\n destroyer,\n destroy: destroy2,\n undestroy,\n errorOrDestroy: errorOrDestroy2\n };\n }\n}), require_legacy = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/legacy.js\"(exports, module) {\n var { ArrayIsArray: ArrayIsArray2, ObjectSetPrototypeOf } = require_primordials();\n function Stream(options) {\n if (!(this instanceof Stream))\n return new Stream(options);\n EE.@call(this, options);\n }\n Stream.prototype = {}, ObjectSetPrototypeOf(Stream.prototype, EE.prototype), ObjectSetPrototypeOf(Stream, EE), Stream.prototype.pipe = function(dest, options) {\n const source = this;\n function ondata(chunk) {\n if (dest.writable && dest.write(chunk) === !1 && source.pause)\n source.pause();\n }\n source.on(\"data\", ondata);\n function ondrain() {\n if (source.readable && source.resume)\n source.resume();\n }\n if (dest.on(\"drain\", ondrain), !dest._isStdio && (!options || options.end !== !1))\n source.on(\"end\", onend), source.on(\"close\", onclose);\n let didOnEnd = !1;\n function onend() {\n if (didOnEnd)\n return;\n didOnEnd = !0, dest.end();\n }\n function onclose() {\n if (didOnEnd)\n return;\n if (didOnEnd = !0, typeof dest.destroy === \"function\")\n dest.destroy();\n }\n function onerror(er) {\n if (cleanup(), EE.listenerCount(this, \"error\") === 0)\n this.emit(\"error\", er);\n }\n prependListener(source, \"error\", onerror), prependListener(dest, \"error\", onerror);\n function cleanup() {\n source.removeListener(\"data\", ondata), dest.removeListener(\"drain\", ondrain), source.removeListener(\"end\", onend), source.removeListener(\"close\", onclose), source.removeListener(\"error\", onerror), dest.removeListener(\"error\", onerror), source.removeListener(\"end\", cleanup), source.removeListener(\"close\", cleanup), dest.removeListener(\"close\", cleanup);\n }\n return source.on(\"end\", cleanup), source.on(\"close\", cleanup), dest.on(\"close\", cleanup), dest.emit(\"pipe\", source), dest;\n };\n function prependListener(emitter, event, fn) {\n if (typeof emitter.prependListener === \"function\")\n return emitter.prependListener(event, fn);\n if (!emitter._events || !emitter._events[event])\n emitter.on(event, fn);\n else if (ArrayIsArray2(emitter._events[event]))\n emitter._events[event].unshift(fn);\n else\n emitter._events[event] = [fn, emitter._events[event]];\n }\n module.exports = {\n Stream,\n prependListener\n };\n }\n}), require_add_abort_signal = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/add-abort-signal.js\"(exports, module) {\n var { AbortError: AbortError2, codes } = require_errors(), eos = require_end_of_stream(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2 } = codes, validateAbortSignal = (signal, name) => {\n if (typeof signal !== \"object\" || !(\"aborted\" in signal))\n throw new ERR_INVALID_ARG_TYPE2(name, \"AbortSignal\", signal);\n };\n function isNodeStream(obj) {\n return !!(obj && typeof obj.pipe === \"function\");\n }\n module.exports.addAbortSignal = function addAbortSignal(signal, stream) {\n if (validateAbortSignal(signal, \"signal\"), !isNodeStream(stream))\n throw new ERR_INVALID_ARG_TYPE2(\"stream\", \"stream.Stream\", stream);\n return module.exports.addAbortSignalNoValidate(signal, stream);\n }, module.exports.addAbortSignalNoValidate = function(signal, stream) {\n if (typeof signal !== \"object\" || !(\"aborted\" in signal))\n return stream;\n const onAbort = () => {\n stream.destroy(new AbortError2(void 0, {\n cause: signal.reason\n }));\n };\n if (signal.aborted)\n onAbort();\n else\n signal.addEventListener(\"abort\", onAbort), eos(stream, () => signal.removeEventListener(\"abort\", onAbort));\n return stream;\n };\n }\n}), require_state = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/state.js\"(exports, module) {\n var { MathFloor, NumberIsInteger } = require_primordials(), { ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2 } = require_errors().codes;\n function highWaterMarkFrom(options, isDuplex, duplexKey) {\n return options.highWaterMark != null \? options.highWaterMark : isDuplex \? options[duplexKey] : null;\n }\n function getDefaultHighWaterMark(objectMode) {\n return objectMode \? 16 : 16384;\n }\n function getHighWaterMark(state, options, duplexKey, isDuplex) {\n const hwm = highWaterMarkFrom(options, isDuplex, duplexKey);\n if (hwm != null) {\n if (!NumberIsInteger(hwm) || hwm < 0) {\n const name = isDuplex \? `options.${duplexKey}` : \"options.highWaterMark\";\n throw new ERR_INVALID_ARG_VALUE2(name, hwm);\n }\n return MathFloor(hwm);\n }\n return getDefaultHighWaterMark(state.objectMode);\n }\n module.exports = {\n getHighWaterMark,\n getDefaultHighWaterMark\n };\n }\n}), require_from = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/from.js\"(exports, module) {\n var { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_NULL_VALUES } = require_errors().codes;\n function from(Readable, iterable, opts) {\n let iterator;\n if (typeof iterable === \"string\" || iterable instanceof @Buffer)\n return new Readable({\n objectMode: !0,\n ...opts,\n read() {\n this.push(iterable), this.push(null);\n }\n });\n let isAsync;\n if (iterable && iterable[SymbolAsyncIterator])\n isAsync = !0, iterator = iterable[SymbolAsyncIterator]();\n else if (iterable && iterable[SymbolIterator])\n isAsync = !1, iterator = iterable[SymbolIterator]();\n else\n throw new ERR_INVALID_ARG_TYPE2(\"iterable\", [\"Iterable\"], iterable);\n const readable = new Readable({\n objectMode: !0,\n highWaterMark: 1,\n ...opts\n });\n let reading = !1;\n readable._read = function() {\n if (!reading)\n reading = !0, next();\n }, readable._destroy = function(error, cb) {\n PromisePrototypeThen(close(error), () => runOnNextTick(cb, error), (e) => runOnNextTick(cb, e || error));\n };\n async function close(error) {\n const hadError = error !== void 0 && error !== null, hasThrow = typeof iterator.throw === \"function\";\n if (hadError && hasThrow) {\n const { value, done } = await iterator.throw(error);\n if (await value, done)\n return;\n }\n if (typeof iterator.return === \"function\") {\n const { value } = await iterator.return();\n await value;\n }\n }\n async function next() {\n for (;; ) {\n try {\n const { value, done } = isAsync \? await iterator.next() : iterator.next();\n if (done)\n readable.push(null);\n else {\n const res = value && typeof value.then === \"function\" \? await value : value;\n if (res === null)\n throw reading = !1, new ERR_STREAM_NULL_VALUES;\n else if (readable.push(res))\n continue;\n else\n reading = !1;\n }\n } catch (err) {\n readable.destroy(err);\n }\n break;\n }\n }\n return readable;\n }\n module.exports = from;\n }\n}), _ReadableFromWeb, _ReadableFromWebForUndici, require_readable = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/readable.js\"(exports, module) {\n var {\n ArrayPrototypeIndexOf,\n NumberIsInteger,\n NumberIsNaN,\n NumberParseInt,\n ObjectDefineProperties,\n ObjectKeys,\n ObjectSetPrototypeOf,\n Promise: Promise2,\n SafeSet,\n SymbolAsyncIterator,\n Symbol: Symbol2\n } = require_primordials(), ReadableState = @lazy(\"bun:stream\").ReadableState, { Stream, prependListener } = require_legacy();\n function Readable(options) {\n if (!(this instanceof Readable))\n return new Readable(options);\n const isDuplex = this instanceof require_duplex();\n if (this._readableState = new ReadableState(options, this, isDuplex), options) {\n const { read, destroy: destroy2, construct, signal } = options;\n if (typeof read === \"function\")\n this._read = read;\n if (typeof destroy2 === \"function\")\n this._destroy = destroy2;\n if (typeof construct === \"function\")\n this._construct = construct;\n if (signal && !isDuplex)\n addAbortSignal(signal, this);\n }\n Stream.@call(this, options), destroyImpl.construct(this, () => {\n if (this._readableState.needReadable)\n maybeReadMore(this, this._readableState);\n });\n }\n Readable.prototype = {}, ObjectSetPrototypeOf(Readable.prototype, Stream.prototype), ObjectSetPrototypeOf(Readable, Stream), Readable.prototype.on = function(ev, fn) {\n const res = Stream.prototype.on.@call(this, ev, fn), state = this._readableState;\n if (ev === \"data\") {\n if (state.readableListening = this.listenerCount(\"readable\") > 0, state.flowing !== !1)\n this.resume();\n } else if (ev === \"readable\") {\n if (!state.endEmitted && !state.readableListening) {\n if (state.readableListening = state.needReadable = !0, state.flowing = !1, state.emittedReadable = !1, state.length)\n emitReadable(this, state);\n else if (!state.reading)\n runOnNextTick(nReadingNextTick, this);\n } else if (state.endEmitted)\n ;\n }\n return res;\n };\n\n class ReadableFromWeb extends Readable {\n #reader;\n #closed;\n #pendingChunks;\n #stream;\n constructor(options, stream) {\n const { objectMode, highWaterMark, encoding, signal } = options;\n super({\n objectMode,\n highWaterMark,\n encoding,\n signal\n });\n this.#pendingChunks = [], this.#reader = @undefined, this.#stream = stream, this.#closed = !1;\n }\n #drainPending() {\n var pendingChunks = this.#pendingChunks, pendingChunksI = 0, pendingChunksCount = pendingChunks.length;\n for (;pendingChunksI < pendingChunksCount; pendingChunksI++) {\n const chunk = pendingChunks[pendingChunksI];\n if (pendingChunks[pendingChunksI] = @undefined, !this.push(chunk, @undefined))\n return this.#pendingChunks = pendingChunks.slice(pendingChunksI + 1), !0;\n }\n if (pendingChunksCount > 0)\n this.#pendingChunks = [];\n return !1;\n }\n #handleDone(reader) {\n reader.releaseLock(), this.#reader = @undefined, this.#closed = !0, this.push(null);\n return;\n }\n async _read() {\n var stream = this.#stream, reader = this.#reader;\n if (stream)\n reader = this.#reader = stream.getReader(), this.#stream = @undefined;\n else if (this.#drainPending())\n return;\n var deferredError;\n try {\n do {\n var done = !1, value;\n const firstResult = reader.readMany();\n if (@isPromise(firstResult)) {\n if ({ done, value } = await firstResult, this.#closed) {\n this.#pendingChunks.push(...value);\n return;\n }\n } else\n ({ done, value } = firstResult);\n if (done) {\n this.#handleDone(reader);\n return;\n }\n if (!this.push(value[0])) {\n this.#pendingChunks = value.slice(1);\n return;\n }\n for (let i = 1, count = value.length;i < count; i++)\n if (!this.push(value[i])) {\n this.#pendingChunks = value.slice(i + 1);\n return;\n }\n } while (!this.#closed);\n } catch (e) {\n deferredError = e;\n } finally {\n if (deferredError)\n throw deferredError;\n }\n }\n _destroy(error, callback) {\n if (!this.#closed) {\n var reader = this.#reader;\n if (reader)\n this.#reader = @undefined, reader.cancel(error).finally(() => {\n this.#closed = !0, callback(error);\n });\n return;\n }\n try {\n callback(error);\n } catch (error2) {\n globalThis.reportError(error2);\n }\n }\n }\n _ReadableFromWebForUndici = ReadableFromWeb;\n function newStreamReadableFromReadableStream(readableStream, options = {}) {\n if (!isReadableStream(readableStream))\n throw new ERR_INVALID_ARG_TYPE2(\"readableStream\", \"ReadableStream\", readableStream);\n validateObject(options, \"options\");\n const {\n highWaterMark,\n encoding,\n objectMode = !1,\n signal\n } = options;\n if (encoding !== @undefined && !@Buffer.isEncoding(encoding))\n throw new ERR_INVALID_ARG_VALUE(encoding, \"options.encoding\");\n return validateBoolean(objectMode, \"options.objectMode\"), getNativeReadableStream(Readable, readableStream, options) || new ReadableFromWeb({\n highWaterMark,\n encoding,\n objectMode,\n signal\n }, readableStream);\n }\n module.exports = Readable, _ReadableFromWeb = newStreamReadableFromReadableStream;\n var { addAbortSignal } = require_add_abort_signal(), eos = require_end_of_stream();\n const { maybeReadMore: _maybeReadMore, resume, emitReadable: _emitReadable, onEofChunk } = @lazy(\"bun:stream\");\n function maybeReadMore(stream, state) {\n process.nextTick(_maybeReadMore, stream, state);\n }\n function emitReadable(stream, state) {\n _emitReadable(stream, state);\n }\n var destroyImpl = require_destroy(), {\n aggregateTwoErrors,\n codes: {\n ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_OUT_OF_RANGE,\n ERR_STREAM_PUSH_AFTER_EOF,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT\n }\n } = require_errors(), { validateObject } = require_validators(), from = require_from(), nop = () => {\n }, { errorOrDestroy: errorOrDestroy2 } = destroyImpl;\n Readable.prototype.destroy = destroyImpl.destroy, Readable.prototype._undestroy = destroyImpl.undestroy, Readable.prototype._destroy = function(err, cb) {\n cb(err);\n }, Readable.prototype[EE.captureRejectionSymbol] = function(err) {\n this.destroy(err);\n }, Readable.prototype.push = function(chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, !1);\n }, Readable.prototype.unshift = function(chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, !0);\n };\n function readableAddChunk(stream, chunk, encoding, addToFront) {\n const state = stream._readableState;\n let err;\n if (!state.objectMode) {\n if (typeof chunk === \"string\") {\n if (encoding = encoding || state.defaultEncoding, state.encoding !== encoding)\n if (addToFront && state.encoding)\n chunk = @Buffer.from(chunk, encoding).toString(state.encoding);\n else\n chunk = @Buffer.from(chunk, encoding), encoding = \"\";\n } else if (chunk instanceof @Buffer)\n encoding = \"\";\n else if (Stream._isUint8Array(chunk)) {\n if (addToFront || !state.decoder)\n chunk = Stream._uint8ArrayToBuffer(chunk);\n encoding = \"\";\n } else if (chunk != null)\n err = new ERR_INVALID_ARG_TYPE2(\"chunk\", [\"string\", \"Buffer\", \"Uint8Array\"], chunk);\n }\n if (err)\n errorOrDestroy2(stream, err);\n else if (chunk === null)\n state.reading = !1, onEofChunk(stream, state);\n else if (state.objectMode || chunk && chunk.length > 0)\n if (addToFront)\n if (state.endEmitted)\n errorOrDestroy2(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT);\n else if (state.destroyed || state.errored)\n return !1;\n else\n addChunk(stream, state, chunk, !0);\n else if (state.ended)\n errorOrDestroy2(stream, new ERR_STREAM_PUSH_AFTER_EOF);\n else if (state.destroyed || state.errored)\n return !1;\n else if (state.reading = !1, state.decoder && !encoding)\n if (chunk = state.decoder.write(chunk), state.objectMode || chunk.length !== 0)\n addChunk(stream, state, chunk, !1);\n else\n maybeReadMore(stream, state);\n else\n addChunk(stream, state, chunk, !1);\n else if (!addToFront)\n state.reading = !1, maybeReadMore(stream, state);\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n }\n function addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync && stream.listenerCount(\"data\") > 0) {\n if (state.multiAwaitDrain)\n state.awaitDrainWriters.clear();\n else\n state.awaitDrainWriters = null;\n state.dataEmitted = !0, stream.emit(\"data\", chunk);\n } else {\n if (state.length += state.objectMode \? 1 : chunk.length, addToFront)\n state.buffer.unshift(chunk);\n else\n state.buffer.push(chunk);\n if (state.needReadable)\n emitReadable(stream, state);\n }\n maybeReadMore(stream, state);\n }\n Readable.prototype.isPaused = function() {\n const state = this._readableState;\n return state.paused === !0 || state.flowing === !1;\n }, Readable.prototype.setEncoding = function(enc) {\n const decoder = new StringDecoder(enc);\n this._readableState.decoder = decoder, this._readableState.encoding = this._readableState.decoder.encoding;\n const buffer = this._readableState.buffer;\n let content = \"\";\n for (let i = buffer.length;i > 0; i--)\n content += decoder.write(buffer.shift());\n if (content !== \"\")\n buffer.push(content);\n return this._readableState.length = content.length, this;\n };\n var MAX_HWM = 1073741824;\n function computeNewHighWaterMark(n) {\n if (n > MAX_HWM)\n throw new ERR_OUT_OF_RANGE(\"size\", \"<= 1GiB\", n);\n else\n n--, n |= n >>> 1, n |= n >>> 2, n |= n >>> 4, n |= n >>> 8, n |= n >>> 16, n++;\n return n;\n }\n function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended)\n return 0;\n if (state.objectMode)\n return 1;\n if (NumberIsNaN(n)) {\n if (state.flowing && state.length)\n return state.buffer.first().length;\n return state.length;\n }\n if (n <= state.length)\n return n;\n return state.ended \? state.length : 0;\n }\n Readable.prototype.read = function(n) {\n if (!NumberIsInteger(n))\n n = NumberParseInt(n, 10);\n const state = this._readableState, nOrig = n;\n if (n > state.highWaterMark)\n state.highWaterMark = computeNewHighWaterMark(n);\n if (n !== 0)\n state.emittedReadable = !1;\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 \? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n if (state.length === 0 && state.ended)\n endReadable(this);\n else\n emitReadable(this, state);\n return null;\n }\n if (n = howMuchToRead(n, state), n === 0 && state.ended) {\n if (state.length === 0)\n endReadable(this);\n return null;\n }\n let doRead = state.needReadable;\n if (state.length === 0 || state.length - n < state.highWaterMark)\n doRead = !0;\n if (state.ended || state.reading || state.destroyed || state.errored || !state.constructed)\n doRead = !1;\n else if (doRead) {\n if (state.reading = !0, state.sync = !0, state.length === 0)\n state.needReadable = !0;\n try {\n var result = this._read(state.highWaterMark);\n if (@isPromise(result)) {\n const peeked = Bun.peek(result);\n if (peeked !== result)\n result = peeked;\n }\n if (@isPromise(result) && result\?.then && @isCallable(result.then))\n result.then(nop, function(err) {\n errorOrDestroy2(this, err);\n });\n } catch (err) {\n errorOrDestroy2(this, err);\n }\n if (state.sync = !1, !state.reading)\n n = howMuchToRead(nOrig, state);\n }\n let ret;\n if (n > 0)\n ret = fromList(n, state);\n else\n ret = null;\n if (ret === null)\n state.needReadable = state.length <= state.highWaterMark, n = 0;\n else if (state.length -= n, state.multiAwaitDrain)\n state.awaitDrainWriters.clear();\n else\n state.awaitDrainWriters = null;\n if (state.length === 0) {\n if (!state.ended)\n state.needReadable = !0;\n if (nOrig !== n && state.ended)\n endReadable(this);\n }\n if (ret !== null && !state.errorEmitted && !state.closeEmitted)\n state.dataEmitted = !0, this.emit(\"data\", ret);\n return ret;\n }, Readable.prototype._read = function(n) {\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_read()\");\n }, Readable.prototype.pipe = function(dest, pipeOpts) {\n const src = this, state = this._readableState;\n if (state.pipes.length === 1) {\n if (!state.multiAwaitDrain)\n state.multiAwaitDrain = !0, state.awaitDrainWriters = new SafeSet(state.awaitDrainWriters \? [state.awaitDrainWriters] : []);\n }\n state.pipes.push(dest);\n const endFn = (!pipeOpts || pipeOpts.end !== !1) && dest !== process.stdout && dest !== process.stderr \? onend : unpipe;\n if (state.endEmitted)\n runOnNextTick(endFn);\n else\n src.once(\"end\", endFn);\n dest.on(\"unpipe\", onunpipe);\n function onunpipe(readable, unpipeInfo) {\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === !1)\n unpipeInfo.hasUnpiped = !0, cleanup();\n }\n }\n function onend() {\n dest.end();\n }\n let ondrain, cleanedUp = !1;\n function cleanup() {\n if (dest.removeListener(\"close\", onclose), dest.removeListener(\"finish\", onfinish), ondrain)\n dest.removeListener(\"drain\", ondrain);\n if (dest.removeListener(\"error\", onerror), dest.removeListener(\"unpipe\", onunpipe), src.removeListener(\"end\", onend), src.removeListener(\"end\", unpipe), src.removeListener(\"data\", ondata), cleanedUp = !0, ondrain && state.awaitDrainWriters && (!dest._writableState || dest._writableState.needDrain))\n ondrain();\n }\n function pause() {\n if (!cleanedUp) {\n if (state.pipes.length === 1 && state.pipes[0] === dest)\n state.awaitDrainWriters = dest, state.multiAwaitDrain = !1;\n else if (state.pipes.length > 1 && state.pipes.includes(dest))\n state.awaitDrainWriters.add(dest);\n src.pause();\n }\n if (!ondrain)\n ondrain = pipeOnDrain(src, dest), dest.on(\"drain\", ondrain);\n }\n src.on(\"data\", ondata);\n function ondata(chunk) {\n if (dest.write(chunk) === !1)\n pause();\n }\n function onerror(er) {\n if (unpipe(), dest.removeListener(\"error\", onerror), dest.listenerCount(\"error\") === 0) {\n const s = dest._writableState || dest._readableState;\n if (s && !s.errorEmitted)\n errorOrDestroy2(dest, er);\n else\n dest.emit(\"error\", er);\n }\n }\n prependListener(dest, \"error\", onerror);\n function onclose() {\n dest.removeListener(\"finish\", onfinish), unpipe();\n }\n dest.once(\"close\", onclose);\n function onfinish() {\n dest.removeListener(\"close\", onclose), unpipe();\n }\n dest.once(\"finish\", onfinish);\n function unpipe() {\n src.unpipe(dest);\n }\n if (dest.emit(\"pipe\", src), dest.writableNeedDrain === !0) {\n if (state.flowing)\n pause();\n } else if (!state.flowing)\n src.resume();\n return dest;\n };\n function pipeOnDrain(src, dest) {\n return function pipeOnDrainFunctionResult() {\n const state = src._readableState;\n if (state.awaitDrainWriters === dest)\n state.awaitDrainWriters = null;\n else if (state.multiAwaitDrain)\n state.awaitDrainWriters.delete(dest);\n if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && src.listenerCount(\"data\"))\n src.resume();\n };\n }\n Readable.prototype.unpipe = function(dest) {\n const state = this._readableState, unpipeInfo = {\n hasUnpiped: !1\n };\n if (state.pipes.length === 0)\n return this;\n if (!dest) {\n const dests = state.pipes;\n state.pipes = [], this.pause();\n for (let i = 0;i < dests.length; i++)\n dests[i].emit(\"unpipe\", this, {\n hasUnpiped: !1\n });\n return this;\n }\n const index = ArrayPrototypeIndexOf(state.pipes, dest);\n if (index === -1)\n return this;\n if (state.pipes.splice(index, 1), state.pipes.length === 0)\n this.pause();\n return dest.emit(\"unpipe\", this, unpipeInfo), this;\n }, Readable.prototype.addListener = Readable.prototype.on, Readable.prototype.removeListener = function(ev, fn) {\n const res = Stream.prototype.removeListener.@call(this, ev, fn);\n if (ev === \"readable\")\n runOnNextTick(updateReadableListening, this);\n return res;\n }, Readable.prototype.off = Readable.prototype.removeListener, Readable.prototype.removeAllListeners = function(ev) {\n const res = Stream.prototype.removeAllListeners.@apply(this, arguments);\n if (ev === \"readable\" || ev === void 0)\n runOnNextTick(updateReadableListening, this);\n return res;\n };\n function updateReadableListening(self) {\n const state = self._readableState;\n if (state.readableListening = self.listenerCount(\"readable\") > 0, state.resumeScheduled && state.paused === !1)\n state.flowing = !0;\n else if (self.listenerCount(\"data\") > 0)\n self.resume();\n else if (!state.readableListening)\n state.flowing = null;\n }\n function nReadingNextTick(self) {\n self.read(0);\n }\n Readable.prototype.resume = function() {\n const state = this._readableState;\n if (!state.flowing)\n state.flowing = !state.readableListening, resume(this, state);\n return state.paused = !1, this;\n }, Readable.prototype.pause = function() {\n if (this._readableState.flowing !== !1)\n this._readableState.flowing = !1, this.emit(\"pause\");\n return this._readableState.paused = !0, this;\n }, Readable.prototype.wrap = function(stream) {\n let paused = !1;\n stream.on(\"data\", (chunk) => {\n if (!this.push(chunk) && stream.pause)\n paused = !0, stream.pause();\n }), stream.on(\"end\", () => {\n this.push(null);\n }), stream.on(\"error\", (err) => {\n errorOrDestroy2(this, err);\n }), stream.on(\"close\", () => {\n this.destroy();\n }), stream.on(\"destroy\", () => {\n this.destroy();\n }), this._read = () => {\n if (paused && stream.resume)\n paused = !1, stream.resume();\n };\n const streamKeys = ObjectKeys(stream);\n for (let j = 1;j < streamKeys.length; j++) {\n const i = streamKeys[j];\n if (this[i] === void 0 && typeof stream[i] === \"function\")\n this[i] = stream[i].bind(stream);\n }\n return this;\n }, Readable.prototype[SymbolAsyncIterator] = function() {\n return streamToAsyncIterator(this);\n }, Readable.prototype.iterator = function(options) {\n if (options !== void 0)\n validateObject(options, \"options\");\n return streamToAsyncIterator(this, options);\n };\n function streamToAsyncIterator(stream, options) {\n if (typeof stream.read !== \"function\")\n stream = Readable.wrap(stream, {\n objectMode: !0\n });\n const iter = createAsyncIterator(stream, options);\n return iter.stream = stream, iter;\n }\n async function* createAsyncIterator(stream, options) {\n let callback = nop;\n function next(resolve) {\n if (this === stream)\n callback(), callback = nop;\n else\n callback = resolve;\n }\n stream.on(\"readable\", next);\n let error;\n const cleanup = eos(stream, {\n writable: !1\n }, (err) => {\n error = err \? aggregateTwoErrors(error, err) : null, callback(), callback = nop;\n });\n try {\n while (!0) {\n const chunk = stream.destroyed \? null : stream.read();\n if (chunk !== null)\n yield chunk;\n else if (error)\n throw error;\n else if (error === null)\n return;\n else\n await new Promise2(next);\n }\n } catch (err) {\n throw error = aggregateTwoErrors(error, err), error;\n } finally {\n if ((error || (options === null || options === void 0 \? void 0 : options.destroyOnReturn) !== !1) && (error === void 0 || stream._readableState.autoDestroy))\n destroyImpl.destroyer(stream, null);\n else\n stream.off(\"readable\", next), cleanup();\n }\n }\n ObjectDefineProperties(Readable.prototype, {\n readable: {\n get() {\n const r = this._readableState;\n return !!r && r.readable !== !1 && !r.destroyed && !r.errorEmitted && !r.endEmitted;\n },\n set(val) {\n if (this._readableState)\n this._readableState.readable = !!val;\n }\n },\n readableDidRead: {\n enumerable: !1,\n get: function() {\n return this._readableState.dataEmitted;\n }\n },\n readableAborted: {\n enumerable: !1,\n get: function() {\n return !!(this._readableState.readable !== !1 && (this._readableState.destroyed || this._readableState.errored) && !this._readableState.endEmitted);\n }\n },\n readableHighWaterMark: {\n enumerable: !1,\n get: function() {\n return this._readableState.highWaterMark;\n }\n },\n readableBuffer: {\n enumerable: !1,\n get: function() {\n return this._readableState && this._readableState.buffer;\n }\n },\n readableFlowing: {\n enumerable: !1,\n get: function() {\n return this._readableState.flowing;\n },\n set: function(state) {\n if (this._readableState)\n this._readableState.flowing = state;\n }\n },\n readableLength: {\n enumerable: !1,\n get() {\n return this._readableState.length;\n }\n },\n readableObjectMode: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.objectMode : !1;\n }\n },\n readableEncoding: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.encoding : null;\n }\n },\n errored: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.errored : null;\n }\n },\n closed: {\n get() {\n return this._readableState \? this._readableState.closed : !1;\n }\n },\n destroyed: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.destroyed : !1;\n },\n set(value) {\n if (!this._readableState)\n return;\n this._readableState.destroyed = value;\n }\n },\n readableEnded: {\n enumerable: !1,\n get() {\n return this._readableState \? this._readableState.endEmitted : !1;\n }\n }\n }), Readable._fromList = fromList;\n function fromList(n, state) {\n if (state.length === 0)\n return null;\n let ret;\n if (state.objectMode)\n ret = state.buffer.shift();\n else if (!n || n >= state.length) {\n if (state.decoder)\n ret = state.buffer.join(\"\");\n else if (state.buffer.length === 1)\n ret = state.buffer.first();\n else\n ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else\n ret = state.buffer.consume(n, state.decoder);\n return ret;\n }\n function endReadable(stream) {\n const state = stream._readableState;\n if (!state.endEmitted)\n state.ended = !0, runOnNextTick(endReadableNT, state, stream);\n }\n function endReadableNT(state, stream) {\n if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) {\n if (state.endEmitted = !0, stream.emit(\"end\"), stream.writable && stream.allowHalfOpen === !1)\n runOnNextTick(endWritableNT, stream);\n else if (state.autoDestroy) {\n const wState = stream._writableState;\n if (!wState || wState.autoDestroy && (wState.finished || wState.writable === !1))\n stream.destroy();\n }\n }\n }\n function endWritableNT(stream) {\n if (stream.writable && !stream.writableEnded && !stream.destroyed)\n stream.end();\n }\n Readable.from = function(iterable, opts) {\n return from(Readable, iterable, opts);\n };\n var webStreamsAdapters = {\n newStreamReadableFromReadableStream,\n newReadableStreamFromStreamReadable(streamReadable, options = {}) {\n if (typeof streamReadable\?._readableState !== \"object\")\n throw new ERR_INVALID_ARG_TYPE2(\"streamReadable\", \"stream.Readable\", streamReadable);\n var { isDestroyed, isReadable } = require_utils();\n if (isDestroyed(streamReadable) || !isReadable(streamReadable)) {\n const readable = new @ReadableStream;\n return readable.cancel(), readable;\n }\n const { readableObjectMode: objectMode, readableHighWaterMark: highWaterMark } = streamReadable, strategy = ((strategy2) => {\n if (strategy2)\n return strategy2;\n if (objectMode)\n return new CountQueuingStrategy({ highWaterMark });\n return { highWaterMark };\n })(options\?.strategy);\n let controller;\n function onData(chunk) {\n if (controller.enqueue(chunk), controller.desiredSize <= 0)\n streamReadable.pause();\n }\n streamReadable.pause();\n const cleanup = eos(streamReadable, (error) => {\n if (error\?.code === \"ERR_STREAM_PREMATURE_CLOSE\")\n error = new AbortError(@undefined, { cause: error });\n if (cleanup(), streamReadable.on(\"error\", () => {\n }), error)\n return controller.error(error);\n controller.close();\n });\n return streamReadable.on(\"data\", onData), new @ReadableStream({\n start(c) {\n controller = c;\n },\n pull() {\n streamReadable.resume();\n },\n cancel(reason) {\n destroy(streamReadable, reason);\n }\n }, strategy);\n }\n };\n Readable.fromWeb = function(readableStream, options) {\n return webStreamsAdapters.newStreamReadableFromReadableStream(readableStream, options);\n }, Readable.toWeb = function(streamReadable, options) {\n return webStreamsAdapters.newReadableStreamFromStreamReadable(streamReadable, options);\n }, Readable.wrap = function(src, options) {\n var _ref, _src$readableObjectMo;\n return new Readable({\n objectMode: (_ref = (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== void 0 \? _src$readableObjectMo : src.objectMode) !== null && _ref !== void 0 \? _ref : !0,\n ...options,\n destroy(err, callback) {\n destroyImpl.destroyer(src, err), callback(err);\n }\n }).wrap(src);\n };\n }\n}), require_writable = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/writable.js\"(exports, module) {\n var {\n ArrayPrototypeSlice,\n Error: Error2,\n FunctionPrototypeSymbolHasInstance,\n ObjectDefineProperty,\n ObjectDefineProperties,\n ObjectSetPrototypeOf,\n StringPrototypeToLowerCase,\n Symbol: Symbol2,\n SymbolHasInstance\n } = require_primordials(), Stream = require_legacy().Stream, destroyImpl = require_destroy(), { addAbortSignal } = require_add_abort_signal(), { getHighWaterMark, getDefaultHighWaterMark } = require_state(), {\n ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK,\n ERR_STREAM_CANNOT_PIPE,\n ERR_STREAM_DESTROYED,\n ERR_STREAM_ALREADY_FINISHED,\n ERR_STREAM_NULL_VALUES,\n ERR_STREAM_WRITE_AFTER_END,\n ERR_UNKNOWN_ENCODING\n } = require_errors().codes, { errorOrDestroy: errorOrDestroy2 } = destroyImpl;\n function Writable(options = {}) {\n const isDuplex = this instanceof require_duplex();\n if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable, this))\n return new Writable(options);\n if (this._writableState = new WritableState(options, this, isDuplex), options) {\n if (typeof options.write === \"function\")\n this._write = options.write;\n if (typeof options.writev === \"function\")\n this._writev = options.writev;\n if (typeof options.destroy === \"function\")\n this._destroy = options.destroy;\n if (typeof options.final === \"function\")\n this._final = options.final;\n if (typeof options.construct === \"function\")\n this._construct = options.construct;\n if (options.signal)\n addAbortSignal(options.signal, this);\n }\n Stream.@call(this, options), destroyImpl.construct(this, () => {\n const state = this._writableState;\n if (!state.writing)\n clearBuffer(this, state);\n finishMaybe(this, state);\n });\n }\n Writable.prototype = {}, ObjectSetPrototypeOf(Writable.prototype, Stream.prototype), ObjectSetPrototypeOf(Writable, Stream), module.exports = Writable;\n function nop() {\n }\n var kOnFinished = Symbol2(\"kOnFinished\");\n function WritableState(options, stream, isDuplex) {\n if (typeof isDuplex !== \"boolean\")\n isDuplex = stream instanceof require_duplex();\n if (this.objectMode = !!(options && options.objectMode), isDuplex)\n this.objectMode = this.objectMode || !!(options && options.writableObjectMode);\n this.highWaterMark = options \? getHighWaterMark(this, options, \"writableHighWaterMark\", isDuplex) : getDefaultHighWaterMark(!1), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;\n const noDecode = !!(options && options.decodeStrings === !1);\n this.decodeStrings = !noDecode, this.defaultEncoding = options && options.defaultEncoding || \"utf8\", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = onwrite.bind(void 0, stream), this.writecb = null, this.writelen = 0, this.afterWriteTickInfo = null, resetBuffer(this), this.pendingcb = 0, this.constructed = !0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = !options || options.emitClose !== !1, this.autoDestroy = !options || options.autoDestroy !== !1, this.errored = null, this.closed = !1, this.closeEmitted = !1, this[kOnFinished] = [];\n }\n WritableState.prototype = {};\n function resetBuffer(state) {\n state.buffered = [], state.bufferedIndex = 0, state.allBuffers = !0, state.allNoop = !0;\n }\n WritableState.prototype.getBuffer = function getBuffer() {\n return ArrayPrototypeSlice(this.buffered, this.bufferedIndex);\n }, ObjectDefineProperty(WritableState.prototype, \"bufferedRequestCount\", {\n get() {\n return this.buffered.length - this.bufferedIndex;\n }\n }), ObjectDefineProperty(Writable, SymbolHasInstance, {\n value: function(object) {\n if (FunctionPrototypeSymbolHasInstance(this, object))\n return !0;\n if (this !== Writable)\n return !1;\n return object && object._writableState instanceof WritableState;\n }\n }), Writable.prototype.pipe = function() {\n errorOrDestroy2(this, new ERR_STREAM_CANNOT_PIPE);\n };\n function _write(stream, chunk, encoding, cb) {\n const state = stream._writableState;\n if (typeof encoding === \"function\")\n cb = encoding, encoding = state.defaultEncoding;\n else {\n if (!encoding)\n encoding = state.defaultEncoding;\n else if (encoding !== \"buffer\" && !@Buffer.isEncoding(encoding))\n throw new ERR_UNKNOWN_ENCODING(encoding);\n if (typeof cb !== \"function\")\n cb = nop;\n }\n if (chunk === null)\n throw new ERR_STREAM_NULL_VALUES;\n else if (!state.objectMode)\n if (typeof chunk === \"string\") {\n if (state.decodeStrings !== !1)\n chunk = @Buffer.from(chunk, encoding), encoding = \"buffer\";\n } else if (chunk instanceof @Buffer)\n encoding = \"buffer\";\n else if (Stream._isUint8Array(chunk))\n chunk = Stream._uint8ArrayToBuffer(chunk), encoding = \"buffer\";\n else\n throw new ERR_INVALID_ARG_TYPE2(\"chunk\", [\"string\", \"Buffer\", \"Uint8Array\"], chunk);\n let err;\n if (state.ending)\n err = new ERR_STREAM_WRITE_AFTER_END;\n else if (state.destroyed)\n err = new ERR_STREAM_DESTROYED(\"write\");\n if (err)\n return runOnNextTick(cb, err), errorOrDestroy2(stream, err, !0), err;\n return state.pendingcb++, writeOrBuffer(stream, state, chunk, encoding, cb);\n }\n Writable.prototype.write = function(chunk, encoding, cb) {\n return _write(this, chunk, encoding, cb) === !0;\n }, Writable.prototype.cork = function() {\n this._writableState.corked++;\n }, Writable.prototype.uncork = function() {\n const state = this._writableState;\n if (state.corked) {\n if (state.corked--, !state.writing)\n clearBuffer(this, state);\n }\n }, Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n if (typeof encoding === \"string\")\n encoding = StringPrototypeToLowerCase(encoding);\n if (!@Buffer.isEncoding(encoding))\n throw new ERR_UNKNOWN_ENCODING(encoding);\n return this._writableState.defaultEncoding = encoding, this;\n };\n function writeOrBuffer(stream, state, chunk, encoding, callback) {\n const len = state.objectMode \? 1 : chunk.length;\n state.length += len;\n const ret = state.length < state.highWaterMark;\n if (!ret)\n state.needDrain = !0;\n if (state.writing || state.corked || state.errored || !state.constructed) {\n if (state.buffered.push({\n chunk,\n encoding,\n callback\n }), state.allBuffers && encoding !== \"buffer\")\n state.allBuffers = !1;\n if (state.allNoop && callback !== nop)\n state.allNoop = !1;\n } else\n state.writelen = len, state.writecb = callback, state.writing = !0, state.sync = !0, stream._write(chunk, encoding, state.onwrite), state.sync = !1;\n return ret && !state.errored && !state.destroyed;\n }\n function doWrite(stream, state, writev, len, chunk, encoding, cb) {\n if (state.writelen = len, state.writecb = cb, state.writing = !0, state.sync = !0, state.destroyed)\n state.onwrite(new ERR_STREAM_DESTROYED(\"write\"));\n else if (writev)\n stream._writev(chunk, state.onwrite);\n else\n stream._write(chunk, encoding, state.onwrite);\n state.sync = !1;\n }\n function onwriteError(stream, state, er, cb) {\n --state.pendingcb, cb(er), errorBuffer(state), errorOrDestroy2(stream, er);\n }\n function onwrite(stream, er) {\n const state = stream._writableState, sync = state.sync, cb = state.writecb;\n if (typeof cb !== \"function\") {\n errorOrDestroy2(stream, new ERR_MULTIPLE_CALLBACK);\n return;\n }\n if (state.writing = !1, state.writecb = null, state.length -= state.writelen, state.writelen = 0, er) {\n if (Error.captureStackTrace(er), !state.errored)\n state.errored = er;\n if (stream._readableState && !stream._readableState.errored)\n stream._readableState.errored = er;\n if (sync)\n runOnNextTick(onwriteError, stream, state, er, cb);\n else\n onwriteError(stream, state, er, cb);\n } else {\n if (state.buffered.length > state.bufferedIndex)\n clearBuffer(stream, state);\n if (sync)\n if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb)\n state.afterWriteTickInfo.count++;\n else\n state.afterWriteTickInfo = {\n count: 1,\n cb,\n stream,\n state\n }, runOnNextTick(afterWriteTick, state.afterWriteTickInfo);\n else\n afterWrite(stream, state, 1, cb);\n }\n }\n function afterWriteTick({ stream, state, count, cb }) {\n return state.afterWriteTickInfo = null, afterWrite(stream, state, count, cb);\n }\n function afterWrite(stream, state, count, cb) {\n if (!state.ending && !stream.destroyed && state.length === 0 && state.needDrain)\n state.needDrain = !1, stream.emit(\"drain\");\n while (count-- > 0)\n state.pendingcb--, cb();\n if (state.destroyed)\n errorBuffer(state);\n finishMaybe(stream, state);\n }\n function errorBuffer(state) {\n if (state.writing)\n return;\n for (let n = state.bufferedIndex;n < state.buffered.length; ++n) {\n var _state$errored;\n const { chunk, callback } = state.buffered[n], len = state.objectMode \? 1 : chunk.length;\n state.length -= len, callback((_state$errored = state.errored) !== null && _state$errored !== void 0 \? _state$errored : new ERR_STREAM_DESTROYED(\"write\"));\n }\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++) {\n var _state$errored2;\n onfinishCallbacks[i]((_state$errored2 = state.errored) !== null && _state$errored2 !== void 0 \? _state$errored2 : new ERR_STREAM_DESTROYED(\"end\"));\n }\n resetBuffer(state);\n }\n function clearBuffer(stream, state) {\n if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed)\n return;\n const { buffered, bufferedIndex, objectMode } = state, bufferedLength = buffered.length - bufferedIndex;\n if (!bufferedLength)\n return;\n let i = bufferedIndex;\n if (state.bufferProcessing = !0, bufferedLength > 1 && stream._writev) {\n state.pendingcb -= bufferedLength - 1;\n const callback = state.allNoop \? nop : (err) => {\n for (let n = i;n < buffered.length; ++n)\n buffered[n].callback(err);\n }, chunks = state.allNoop && i === 0 \? buffered : ArrayPrototypeSlice(buffered, i);\n chunks.allBuffers = state.allBuffers, doWrite(stream, state, !0, state.length, chunks, \"\", callback), resetBuffer(state);\n } else {\n do {\n const { chunk, encoding, callback } = buffered[i];\n buffered[i++] = null;\n const len = objectMode \? 1 : chunk.length;\n doWrite(stream, state, !1, len, chunk, encoding, callback);\n } while (i < buffered.length && !state.writing);\n if (i === buffered.length)\n resetBuffer(state);\n else if (i > 256)\n buffered.splice(0, i), state.bufferedIndex = 0;\n else\n state.bufferedIndex = i;\n }\n state.bufferProcessing = !1;\n }\n Writable.prototype._write = function(chunk, encoding, cb) {\n if (this._writev)\n this._writev([\n {\n chunk,\n encoding\n }\n ], cb);\n else\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_write()\");\n }, Writable.prototype._writev = null, Writable.prototype.end = function(chunk, encoding, cb, native = !1) {\n const state = this._writableState;\n if (typeof chunk === \"function\")\n cb = chunk, chunk = null, encoding = null;\n else if (typeof encoding === \"function\")\n cb = encoding, encoding = null;\n let err;\n if (chunk !== null && chunk !== void 0) {\n let ret;\n if (!native)\n ret = _write(this, chunk, encoding);\n else\n ret = this.write(chunk, encoding);\n if (ret instanceof Error2)\n err = ret;\n }\n if (state.corked)\n state.corked = 1, this.uncork();\n if (err)\n this.emit(\"error\", err);\n else if (!state.errored && !state.ending)\n state.ending = !0, finishMaybe(this, state, !0), state.ended = !0;\n else if (state.finished)\n err = new ERR_STREAM_ALREADY_FINISHED(\"end\");\n else if (state.destroyed)\n err = new ERR_STREAM_DESTROYED(\"end\");\n if (typeof cb === \"function\")\n if (err || state.finished)\n runOnNextTick(cb, err);\n else\n state[kOnFinished].push(cb);\n return this;\n };\n function needFinish(state, tag) {\n var needFinish2 = state.ending && !state.destroyed && state.constructed && state.length === 0 && !state.errored && state.buffered.length === 0 && !state.finished && !state.writing && !state.errorEmitted && !state.closeEmitted;\n return needFinish2;\n }\n function callFinal(stream, state) {\n let called = !1;\n function onFinish(err) {\n if (called) {\n errorOrDestroy2(stream, err !== null && err !== void 0 \? err : ERR_MULTIPLE_CALLBACK());\n return;\n }\n if (called = !0, state.pendingcb--, err) {\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++)\n onfinishCallbacks[i](err);\n errorOrDestroy2(stream, err, state.sync);\n } else if (needFinish(state))\n state.prefinished = !0, stream.emit(\"prefinish\"), state.pendingcb++, runOnNextTick(finish, stream, state);\n }\n state.sync = !0, state.pendingcb++;\n try {\n stream._final(onFinish);\n } catch (err) {\n onFinish(err);\n }\n state.sync = !1;\n }\n function prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled)\n if (typeof stream._final === \"function\" && !state.destroyed)\n state.finalCalled = !0, callFinal(stream, state);\n else\n state.prefinished = !0, stream.emit(\"prefinish\");\n }\n function finishMaybe(stream, state, sync) {\n if (!needFinish(state, stream.__id))\n return;\n if (prefinish(stream, state), state.pendingcb === 0) {\n if (sync)\n state.pendingcb++, runOnNextTick((stream2, state2) => {\n if (needFinish(state2))\n finish(stream2, state2);\n else\n state2.pendingcb--;\n }, stream, state);\n else if (needFinish(state))\n state.pendingcb++, finish(stream, state);\n }\n }\n function finish(stream, state) {\n state.pendingcb--, state.finished = !0;\n const onfinishCallbacks = state[kOnFinished].splice(0);\n for (let i = 0;i < onfinishCallbacks.length; i++)\n onfinishCallbacks[i]();\n if (stream.emit(\"finish\"), state.autoDestroy) {\n const rState = stream._readableState;\n if (!rState || rState.autoDestroy && (rState.endEmitted || rState.readable === !1))\n stream.destroy();\n }\n }\n ObjectDefineProperties(Writable.prototype, {\n closed: {\n get() {\n return this._writableState \? this._writableState.closed : !1;\n }\n },\n destroyed: {\n get() {\n return this._writableState \? this._writableState.destroyed : !1;\n },\n set(value) {\n if (this._writableState)\n this._writableState.destroyed = value;\n }\n },\n writable: {\n get() {\n const w = this._writableState;\n return !!w && w.writable !== !1 && !w.destroyed && !w.errored && !w.ending && !w.ended;\n },\n set(val) {\n if (this._writableState)\n this._writableState.writable = !!val;\n }\n },\n writableFinished: {\n get() {\n return this._writableState \? this._writableState.finished : !1;\n }\n },\n writableObjectMode: {\n get() {\n return this._writableState \? this._writableState.objectMode : !1;\n }\n },\n writableBuffer: {\n get() {\n return this._writableState && this._writableState.getBuffer();\n }\n },\n writableEnded: {\n get() {\n return this._writableState \? this._writableState.ending : !1;\n }\n },\n writableNeedDrain: {\n get() {\n const wState = this._writableState;\n if (!wState)\n return !1;\n return !wState.destroyed && !wState.ending && wState.needDrain;\n }\n },\n writableHighWaterMark: {\n get() {\n return this._writableState && this._writableState.highWaterMark;\n }\n },\n writableCorked: {\n get() {\n return this._writableState \? this._writableState.corked : 0;\n }\n },\n writableLength: {\n get() {\n return this._writableState && this._writableState.length;\n }\n },\n errored: {\n enumerable: !1,\n get() {\n return this._writableState \? this._writableState.errored : null;\n }\n },\n writableAborted: {\n enumerable: !1,\n get: function() {\n return !!(this._writableState.writable !== !1 && (this._writableState.destroyed || this._writableState.errored) && !this._writableState.finished);\n }\n }\n });\n var destroy2 = destroyImpl.destroy;\n Writable.prototype.destroy = function(err, cb) {\n const state = this._writableState;\n if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length))\n runOnNextTick(errorBuffer, state);\n return destroy2.@call(this, err, cb), this;\n }, Writable.prototype._undestroy = destroyImpl.undestroy, Writable.prototype._destroy = function(err, cb) {\n cb(err);\n }, Writable.prototype[EE.captureRejectionSymbol] = function(err) {\n this.destroy(err);\n };\n var webStreamsAdapters;\n function lazyWebStreams() {\n if (webStreamsAdapters === void 0)\n webStreamsAdapters = {};\n return webStreamsAdapters;\n }\n Writable.fromWeb = function(writableStream, options) {\n return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options);\n }, Writable.toWeb = function(streamWritable) {\n return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable);\n };\n }\n}), require_duplexify = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/duplexify.js\"(exports, module) {\n var {\n isReadable,\n isWritable,\n isIterable,\n isNodeStream,\n isReadableNodeStream,\n isWritableNodeStream,\n isDuplexNodeStream\n } = require_utils(), eos = require_end_of_stream(), {\n AbortError: AbortError2,\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_RETURN_VALUE }\n } = require_errors(), { destroyer } = require_destroy(), Duplex = require_duplex(), Readable = require_readable(), { createDeferredPromise } = require_util(), from = require_from(), isBlob = typeof Blob !== \"undefined\" \? function isBlob2(b) {\n return b instanceof Blob;\n } : function isBlob2(b) {\n return !1;\n }, { FunctionPrototypeCall } = require_primordials();\n\n class Duplexify extends Duplex {\n constructor(options) {\n super(options);\n if ((options === null || options === @undefined \? @undefined : options.readable) === !1)\n this._readableState.readable = !1, this._readableState.ended = !0, this._readableState.endEmitted = !0;\n if ((options === null || options === @undefined \? @undefined : options.writable) === !1)\n this._writableState.writable = !1, this._writableState.ending = !0, this._writableState.ended = !0, this._writableState.finished = !0;\n }\n }\n module.exports = function duplexify(body, name) {\n if (isDuplexNodeStream(body))\n return body;\n if (isReadableNodeStream(body))\n return _duplexify({\n readable: body\n });\n if (isWritableNodeStream(body))\n return _duplexify({\n writable: body\n });\n if (isNodeStream(body))\n return _duplexify({\n writable: !1,\n readable: !1\n });\n if (typeof body === \"function\") {\n const { value, write, final, destroy: destroy2 } = fromAsyncGen(body);\n if (isIterable(value))\n return from(Duplexify, value, {\n objectMode: !0,\n write,\n final,\n destroy: destroy2\n });\n const then2 = value === null || value === void 0 \? void 0 : value.then;\n if (typeof then2 === \"function\") {\n let d;\n const promise = FunctionPrototypeCall(then2, value, (val) => {\n if (val != null)\n throw new ERR_INVALID_RETURN_VALUE(\"nully\", \"body\", val);\n }, (err) => {\n destroyer(d, err);\n });\n return d = new Duplexify({\n objectMode: !0,\n readable: !1,\n write,\n final(cb) {\n final(async () => {\n try {\n await promise, runOnNextTick(cb, null);\n } catch (err) {\n runOnNextTick(cb, err);\n }\n });\n },\n destroy: destroy2\n });\n }\n throw new ERR_INVALID_RETURN_VALUE(\"Iterable, AsyncIterable or AsyncFunction\", name, value);\n }\n if (isBlob(body))\n return duplexify(body.arrayBuffer());\n if (isIterable(body))\n return from(Duplexify, body, {\n objectMode: !0,\n writable: !1\n });\n if (typeof (body === null || body === void 0 \? void 0 : body.writable) === \"object\" || typeof (body === null || body === void 0 \? void 0 : body.readable) === \"object\") {\n const readable = body !== null && body !== void 0 && body.readable \? isReadableNodeStream(body === null || body === void 0 \? void 0 : body.readable) \? body === null || body === void 0 \? void 0 : body.readable : duplexify(body.readable) : void 0, writable = body !== null && body !== void 0 && body.writable \? isWritableNodeStream(body === null || body === void 0 \? void 0 : body.writable) \? body === null || body === void 0 \? void 0 : body.writable : duplexify(body.writable) : void 0;\n return _duplexify({\n readable,\n writable\n });\n }\n const then = body === null || body === void 0 \? void 0 : body.then;\n if (typeof then === \"function\") {\n let d;\n return FunctionPrototypeCall(then, body, (val) => {\n if (val != null)\n d.push(val);\n d.push(null);\n }, (err) => {\n destroyer(d, err);\n }), d = new Duplexify({\n objectMode: !0,\n writable: !1,\n read() {\n }\n });\n }\n throw new ERR_INVALID_ARG_TYPE2(name, [\n \"Blob\",\n \"ReadableStream\",\n \"WritableStream\",\n \"Stream\",\n \"Iterable\",\n \"AsyncIterable\",\n \"Function\",\n \"{ readable, writable } pair\",\n \"Promise\"\n ], body);\n };\n function fromAsyncGen(fn) {\n let { promise, resolve } = createDeferredPromise();\n const ac = new AbortController, signal = ac.signal;\n return {\n value: fn(async function* () {\n while (!0) {\n const _promise = promise;\n promise = null;\n const { chunk, done, cb } = await _promise;\n if (runOnNextTick(cb), done)\n return;\n if (signal.aborted)\n throw new AbortError2(void 0, {\n cause: signal.reason\n });\n ({ promise, resolve } = createDeferredPromise()), yield chunk;\n }\n }(), {\n signal\n }),\n write(chunk, encoding, cb) {\n const _resolve = resolve;\n resolve = null, _resolve({\n chunk,\n done: !1,\n cb\n });\n },\n final(cb) {\n const _resolve = resolve;\n resolve = null, _resolve({\n done: !0,\n cb\n });\n },\n destroy(err, cb) {\n ac.abort(), cb(err);\n }\n };\n }\n function _duplexify(pair) {\n const r = pair.readable && typeof pair.readable.read !== \"function\" \? Readable.wrap(pair.readable) : pair.readable, w = pair.writable;\n let readable = !!isReadable(r), writable = !!isWritable(w), ondrain, onfinish, onreadable, onclose, d;\n function onfinished(err) {\n const cb = onclose;\n if (onclose = null, cb)\n cb(err);\n else if (err)\n d.destroy(err);\n else if (!readable && !writable)\n d.destroy();\n }\n if (d = new Duplexify({\n readableObjectMode: !!(r !== null && r !== void 0 && r.readableObjectMode),\n writableObjectMode: !!(w !== null && w !== void 0 && w.writableObjectMode),\n readable,\n writable\n }), writable)\n eos(w, (err) => {\n if (writable = !1, err)\n destroyer(r, err);\n onfinished(err);\n }), d._write = function(chunk, encoding, callback) {\n if (w.write(chunk, encoding))\n callback();\n else\n ondrain = callback;\n }, d._final = function(callback) {\n w.end(), onfinish = callback;\n }, w.on(\"drain\", function() {\n if (ondrain) {\n const cb = ondrain;\n ondrain = null, cb();\n }\n }), w.on(\"finish\", function() {\n if (onfinish) {\n const cb = onfinish;\n onfinish = null, cb();\n }\n });\n if (readable)\n eos(r, (err) => {\n if (readable = !1, err)\n destroyer(r, err);\n onfinished(err);\n }), r.on(\"readable\", function() {\n if (onreadable) {\n const cb = onreadable;\n onreadable = null, cb();\n }\n }), r.on(\"end\", function() {\n d.push(null);\n }), d._read = function() {\n while (!0) {\n const buf = r.read();\n if (buf === null) {\n onreadable = d._read;\n return;\n }\n if (!d.push(buf))\n return;\n }\n };\n return d._destroy = function(err, callback) {\n if (!err && onclose !== null)\n err = new AbortError2;\n if (onreadable = null, ondrain = null, onfinish = null, onclose === null)\n callback(err);\n else\n onclose = callback, destroyer(w, err), destroyer(r, err);\n }, d;\n }\n }\n}), require_duplex = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/duplex.js\"(exports, module) {\n var { ObjectDefineProperties, ObjectGetOwnPropertyDescriptor, ObjectKeys, ObjectSetPrototypeOf } = require_primordials(), Readable = require_readable();\n function Duplex(options) {\n if (!(this instanceof Duplex))\n return new Duplex(options);\n if (Readable.@call(this, options), Writable.@call(this, options), options) {\n if (this.allowHalfOpen = options.allowHalfOpen !== !1, options.readable === !1)\n this._readableState.readable = !1, this._readableState.ended = !0, this._readableState.endEmitted = !0;\n if (options.writable === !1)\n this._writableState.writable = !1, this._writableState.ending = !0, this._writableState.ended = !0, this._writableState.finished = !0;\n } else\n this.allowHalfOpen = !0;\n }\n Duplex.prototype = {}, module.exports = Duplex, ObjectSetPrototypeOf(Duplex.prototype, Readable.prototype), ObjectSetPrototypeOf(Duplex, Readable);\n for (var method in Writable.prototype)\n if (!Duplex.prototype[method])\n Duplex.prototype[method] = Writable.prototype[method];\n ObjectDefineProperties(Duplex.prototype, {\n writable: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writable\"),\n writableHighWaterMark: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableHighWaterMark\"),\n writableObjectMode: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableObjectMode\"),\n writableBuffer: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableBuffer\"),\n writableLength: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableLength\"),\n writableFinished: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableFinished\"),\n writableCorked: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableCorked\"),\n writableEnded: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableEnded\"),\n writableNeedDrain: ObjectGetOwnPropertyDescriptor(Writable.prototype, \"writableNeedDrain\"),\n destroyed: {\n get() {\n if (this._readableState === void 0 || this._writableState === void 0)\n return !1;\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set(value) {\n if (this._readableState && this._writableState)\n this._readableState.destroyed = value, this._writableState.destroyed = value;\n }\n }\n });\n var webStreamsAdapters;\n function lazyWebStreams() {\n if (webStreamsAdapters === void 0)\n webStreamsAdapters = {};\n return webStreamsAdapters;\n }\n Duplex.fromWeb = function(pair, options) {\n return lazyWebStreams().newStreamDuplexFromReadableWritablePair(pair, options);\n }, Duplex.toWeb = function(duplex) {\n return lazyWebStreams().newReadableWritablePairFromDuplex(duplex);\n };\n var duplexify;\n Duplex.from = function(body) {\n if (!duplexify)\n duplexify = require_duplexify();\n return duplexify(body, \"body\");\n };\n }\n}), require_transform = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/transform.js\"(exports, module) {\n var { ObjectSetPrototypeOf, Symbol: Symbol2 } = require_primordials(), { ERR_METHOD_NOT_IMPLEMENTED } = require_errors().codes, Duplex = require_duplex();\n function Transform(options) {\n if (!(this instanceof Transform))\n return new Transform(options);\n if (Duplex.@call(this, options), this._readableState.sync = !1, this[kCallback] = null, options) {\n if (typeof options.transform === \"function\")\n this._transform = options.transform;\n if (typeof options.flush === \"function\")\n this._flush = options.flush;\n }\n this.on(\"prefinish\", prefinish.bind(this));\n }\n Transform.prototype = {}, ObjectSetPrototypeOf(Transform.prototype, Duplex.prototype), ObjectSetPrototypeOf(Transform, Duplex), module.exports = Transform;\n var kCallback = Symbol2(\"kCallback\");\n function final(cb) {\n if (typeof this._flush === \"function\" && !this.destroyed)\n this._flush((er, data) => {\n if (er) {\n if (cb)\n cb(er);\n else\n this.destroy(er);\n return;\n }\n if (data != null)\n this.push(data);\n if (this.push(null), cb)\n cb();\n });\n else if (this.push(null), cb)\n cb();\n }\n function prefinish() {\n if (this._final !== final)\n final.@call(this);\n }\n Transform.prototype._final = final, Transform.prototype._transform = function(chunk, encoding, callback) {\n throw new ERR_METHOD_NOT_IMPLEMENTED(\"_transform()\");\n }, Transform.prototype._write = function(chunk, encoding, callback) {\n const rState = this._readableState, wState = this._writableState, length = rState.length;\n this._transform(chunk, encoding, (err, val) => {\n if (err) {\n callback(err);\n return;\n }\n if (val != null)\n this.push(val);\n if (wState.ended || length === rState.length || rState.length < rState.highWaterMark || rState.highWaterMark === 0 || rState.length === 0)\n callback();\n else\n this[kCallback] = callback;\n });\n }, Transform.prototype._read = function() {\n if (this[kCallback]) {\n const callback = this[kCallback];\n this[kCallback] = null, callback();\n }\n };\n }\n}), require_passthrough = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/passthrough.js\"(exports, module) {\n var { ObjectSetPrototypeOf } = require_primordials(), Transform = require_transform();\n function PassThrough(options) {\n if (!(this instanceof PassThrough))\n return new PassThrough(options);\n Transform.@call(this, options);\n }\n PassThrough.prototype = {}, ObjectSetPrototypeOf(PassThrough.prototype, Transform.prototype), ObjectSetPrototypeOf(PassThrough, Transform), PassThrough.prototype._transform = function(chunk, encoding, cb) {\n cb(null, chunk);\n }, module.exports = PassThrough;\n }\n}), require_pipeline = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/pipeline.js\"(exports, module) {\n var { ArrayIsArray: ArrayIsArray2, Promise: Promise2, SymbolAsyncIterator } = require_primordials(), eos = require_end_of_stream(), { once } = require_util(), destroyImpl = require_destroy(), Duplex = require_duplex(), {\n aggregateTwoErrors,\n codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS, ERR_STREAM_DESTROYED },\n AbortError: AbortError2\n } = require_errors(), { validateFunction, validateAbortSignal } = require_validators(), { isIterable, isReadable, isReadableNodeStream, isNodeStream } = require_utils(), PassThrough, Readable;\n function destroyer(stream, reading, writing) {\n let finished = !1;\n stream.on(\"close\", () => {\n finished = !0;\n });\n const cleanup = eos(stream, {\n readable: reading,\n writable: writing\n }, (err) => {\n finished = !err;\n });\n return {\n destroy: (err) => {\n if (finished)\n return;\n finished = !0, destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED(\"pipe\"));\n },\n cleanup\n };\n }\n function popCallback(streams) {\n return validateFunction(streams[streams.length - 1], \"streams[stream.length - 1]\"), streams.pop();\n }\n function makeAsyncIterable(val) {\n if (isIterable(val))\n return val;\n else if (isReadableNodeStream(val))\n return fromReadable(val);\n throw new ERR_INVALID_ARG_TYPE2(\"val\", [\"Readable\", \"Iterable\", \"AsyncIterable\"], val);\n }\n async function* fromReadable(val) {\n if (!Readable)\n Readable = require_readable();\n yield* Readable.prototype[SymbolAsyncIterator].@call(val);\n }\n async function pump(iterable, writable, finish, { end }) {\n let error, onresolve = null;\n const resume = (err) => {\n if (err)\n error = err;\n if (onresolve) {\n const callback = onresolve;\n onresolve = null, callback();\n }\n }, wait = () => new Promise2((resolve, reject) => {\n if (error)\n reject(error);\n else\n onresolve = () => {\n if (error)\n reject(error);\n else\n resolve();\n };\n });\n writable.on(\"drain\", resume);\n const cleanup = eos(writable, {\n readable: !1\n }, resume);\n try {\n if (writable.writableNeedDrain)\n await wait();\n for await (let chunk of iterable)\n if (!writable.write(chunk))\n await wait();\n if (end)\n writable.end();\n await wait(), finish();\n } catch (err) {\n finish(error !== err \? aggregateTwoErrors(error, err) : err);\n } finally {\n cleanup(), writable.off(\"drain\", resume);\n }\n }\n function pipeline(...streams) {\n return pipelineImpl(streams, once(popCallback(streams)));\n }\n function pipelineImpl(streams, callback, opts) {\n if (streams.length === 1 && ArrayIsArray2(streams[0]))\n streams = streams[0];\n if (streams.length < 2)\n throw new ERR_MISSING_ARGS(\"streams\");\n const ac = new AbortController, signal = ac.signal, outerSignal = opts === null || opts === void 0 \? void 0 : opts.signal, lastStreamCleanup = [];\n validateAbortSignal(outerSignal, \"options.signal\");\n function abort() {\n finishImpl(new AbortError2);\n }\n outerSignal === null || outerSignal === void 0 || outerSignal.addEventListener(\"abort\", abort);\n let error, value;\n const destroys = [];\n let finishCount = 0;\n function finish(err) {\n finishImpl(err, --finishCount === 0);\n }\n function finishImpl(err, final) {\n if (err && (!error || error.code === \"ERR_STREAM_PREMATURE_CLOSE\"))\n error = err;\n if (!error && !final)\n return;\n while (destroys.length)\n destroys.shift()(error);\n if (outerSignal === null || outerSignal === void 0 || outerSignal.removeEventListener(\"abort\", abort), ac.abort(), final) {\n if (!error)\n lastStreamCleanup.forEach((fn) => fn());\n runOnNextTick(callback, error, value);\n }\n }\n let ret;\n for (let i = 0;i < streams.length; i++) {\n const stream = streams[i], reading = i < streams.length - 1, writing = i > 0, end = reading || (opts === null || opts === void 0 \? void 0 : opts.end) !== !1, isLastStream = i === streams.length - 1;\n if (isNodeStream(stream)) {\n let onError = function(err) {\n if (err && err.name !== \"AbortError\" && err.code !== \"ERR_STREAM_PREMATURE_CLOSE\")\n finish(err);\n };\n if (end) {\n const { destroy: destroy2, cleanup } = destroyer(stream, reading, writing);\n if (destroys.push(destroy2), isReadable(stream) && isLastStream)\n lastStreamCleanup.push(cleanup);\n }\n if (stream.on(\"error\", onError), isReadable(stream) && isLastStream)\n lastStreamCleanup.push(() => {\n stream.removeListener(\"error\", onError);\n });\n }\n if (i === 0)\n if (typeof stream === \"function\") {\n if (ret = stream({\n signal\n }), !isIterable(ret))\n throw new ERR_INVALID_RETURN_VALUE(\"Iterable, AsyncIterable or Stream\", \"source\", ret);\n } else if (isIterable(stream) || isReadableNodeStream(stream))\n ret = stream;\n else\n ret = Duplex.from(stream);\n else if (typeof stream === \"function\")\n if (ret = makeAsyncIterable(ret), ret = stream(ret, {\n signal\n }), reading) {\n if (!isIterable(ret, !0))\n throw new ERR_INVALID_RETURN_VALUE(\"AsyncIterable\", `transform[${i - 1}]`, ret);\n } else {\n var _ret;\n if (!PassThrough)\n PassThrough = require_passthrough();\n const pt = new PassThrough({\n objectMode: !0\n }), then = (_ret = ret) === null || _ret === void 0 \? void 0 : _ret.then;\n if (typeof then === \"function\")\n finishCount++, then.@call(ret, (val) => {\n if (value = val, val != null)\n pt.write(val);\n if (end)\n pt.end();\n runOnNextTick(finish);\n }, (err) => {\n pt.destroy(err), runOnNextTick(finish, err);\n });\n else if (isIterable(ret, !0))\n finishCount++, pump(ret, pt, finish, {\n end\n });\n else\n throw new ERR_INVALID_RETURN_VALUE(\"AsyncIterable or Promise\", \"destination\", ret);\n ret = pt;\n const { destroy: destroy2, cleanup } = destroyer(ret, !1, !0);\n if (destroys.push(destroy2), isLastStream)\n lastStreamCleanup.push(cleanup);\n }\n else if (isNodeStream(stream)) {\n if (isReadableNodeStream(ret)) {\n finishCount += 2;\n const cleanup = pipe(ret, stream, finish, {\n end\n });\n if (isReadable(stream) && isLastStream)\n lastStreamCleanup.push(cleanup);\n } else if (isIterable(ret))\n finishCount++, pump(ret, stream, finish, {\n end\n });\n else\n throw new ERR_INVALID_ARG_TYPE2(\"val\", [\"Readable\", \"Iterable\", \"AsyncIterable\"], ret);\n ret = stream;\n } else\n ret = Duplex.from(stream);\n }\n if (signal !== null && signal !== void 0 && signal.aborted || outerSignal !== null && outerSignal !== void 0 && outerSignal.aborted)\n runOnNextTick(abort);\n return ret;\n }\n function pipe(src, dst, finish, { end }) {\n if (src.pipe(dst, {\n end\n }), end)\n src.once(\"end\", () => dst.end());\n else\n finish();\n return eos(src, {\n readable: !0,\n writable: !1\n }, (err) => {\n const rState = src._readableState;\n if (err && err.code === \"ERR_STREAM_PREMATURE_CLOSE\" && rState && rState.ended && !rState.errored && !rState.errorEmitted)\n src.once(\"end\", finish).once(\"error\", finish);\n else\n finish(err);\n }), eos(dst, {\n readable: !1,\n writable: !0\n }, finish);\n }\n module.exports = {\n pipelineImpl,\n pipeline\n };\n }\n}), require_compose = __commonJS({\n \"node_modules/readable-stream/lib/internal/streams/compose.js\"(exports, module) {\n var { pipeline } = require_pipeline(), Duplex = require_duplex(), { destroyer } = require_destroy(), { isNodeStream, isReadable, isWritable } = require_utils(), {\n AbortError: AbortError2,\n codes: { ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, ERR_MISSING_ARGS }\n } = require_errors();\n module.exports = function compose(...streams) {\n if (streams.length === 0)\n throw new ERR_MISSING_ARGS(\"streams\");\n if (streams.length === 1)\n return Duplex.from(streams[0]);\n const orgStreams = [...streams];\n if (typeof streams[0] === \"function\")\n streams[0] = Duplex.from(streams[0]);\n if (typeof streams[streams.length - 1] === \"function\") {\n const idx = streams.length - 1;\n streams[idx] = Duplex.from(streams[idx]);\n }\n for (let n = 0;n < streams.length; ++n) {\n if (!isNodeStream(streams[n]))\n continue;\n if (n < streams.length - 1 && !isReadable(streams[n]))\n throw new ERR_INVALID_ARG_VALUE2(`streams[${n}]`, orgStreams[n], \"must be readable\");\n if (n > 0 && !isWritable(streams[n]))\n throw new ERR_INVALID_ARG_VALUE2(`streams[${n}]`, orgStreams[n], \"must be writable\");\n }\n let ondrain, onfinish, onreadable, onclose, d;\n function onfinished(err) {\n const cb = onclose;\n if (onclose = null, cb)\n cb(err);\n else if (err)\n d.destroy(err);\n else if (!readable && !writable)\n d.destroy();\n }\n const head = streams[0], tail = pipeline(streams, onfinished), writable = !!isWritable(head), readable = !!isReadable(tail);\n if (d = new Duplex({\n writableObjectMode: !!(head !== null && head !== void 0 && head.writableObjectMode),\n readableObjectMode: !!(tail !== null && tail !== void 0 && tail.writableObjectMode),\n writable,\n readable\n }), writable)\n d._write = function(chunk, encoding, callback) {\n if (head.write(chunk, encoding))\n callback();\n else\n ondrain = callback;\n }, d._final = function(callback) {\n head.end(), onfinish = callback;\n }, head.on(\"drain\", function() {\n if (ondrain) {\n const cb = ondrain;\n ondrain = null, cb();\n }\n }), tail.on(\"finish\", function() {\n if (onfinish) {\n const cb = onfinish;\n onfinish = null, cb();\n }\n });\n if (readable)\n tail.on(\"readable\", function() {\n if (onreadable) {\n const cb = onreadable;\n onreadable = null, cb();\n }\n }), tail.on(\"end\", function() {\n d.push(null);\n }), d._read = function() {\n while (!0) {\n const buf = tail.read();\n if (buf === null) {\n onreadable = d._read;\n return;\n }\n if (!d.push(buf))\n return;\n }\n };\n return d._destroy = function(err, callback) {\n if (!err && onclose !== null)\n err = new AbortError2;\n if (onreadable = null, ondrain = null, onfinish = null, onclose === null)\n callback(err);\n else\n onclose = callback, destroyer(tail, err);\n }, d;\n };\n }\n}), require_promises = __commonJS({\n \"node_modules/readable-stream/lib/stream/promises.js\"(exports, module) {\n var { ArrayPrototypePop, Promise: Promise2 } = require_primordials(), { isIterable, isNodeStream } = require_utils(), { pipelineImpl: pl } = require_pipeline(), { finished } = require_end_of_stream();\n function pipeline(...streams) {\n return new Promise2((resolve, reject) => {\n let signal, end;\n const lastArg = streams[streams.length - 1];\n if (lastArg && typeof lastArg === \"object\" && !isNodeStream(lastArg) && !isIterable(lastArg)) {\n const options = ArrayPrototypePop(streams);\n signal = options.signal, end = options.end;\n }\n pl(streams, (err, value) => {\n if (err)\n reject(err);\n else\n resolve(value);\n }, {\n signal,\n end\n });\n });\n }\n module.exports = {\n finished,\n pipeline\n };\n }\n}), require_stream = __commonJS({\n \"node_modules/readable-stream/lib/stream.js\"(exports, module) {\n var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials(), {\n promisify: { custom: customPromisify }\n } = require_util(), { streamReturningOperators, promiseReturningOperators } = require_operators(), {\n codes: { ERR_ILLEGAL_CONSTRUCTOR }\n } = require_errors(), compose = require_compose(), { pipeline } = require_pipeline(), { destroyer } = require_destroy(), eos = require_end_of_stream(), promises = require_promises(), utils = require_utils(), Stream = module.exports = require_legacy().Stream;\n Stream.isDisturbed = utils.isDisturbed, Stream.isErrored = utils.isErrored, Stream.isWritable = utils.isWritable, Stream.isReadable = utils.isReadable, Stream.Readable = require_readable();\n for (let key of ObjectKeys(streamReturningOperators)) {\n let fn = function(...args) {\n if (new.target)\n throw ERR_ILLEGAL_CONSTRUCTOR();\n return Stream.Readable.from(ReflectApply(op, this, args));\n };\n const op = streamReturningOperators[key];\n ObjectDefineProperty(fn, \"name\", {\n value: op.name\n }), ObjectDefineProperty(fn, \"length\", {\n value: op.length\n }), ObjectDefineProperty(Stream.Readable.prototype, key, {\n value: fn,\n enumerable: !1,\n configurable: !0,\n writable: !0\n });\n }\n for (let key of ObjectKeys(promiseReturningOperators)) {\n let fn = function(...args) {\n if (new.target)\n throw ERR_ILLEGAL_CONSTRUCTOR();\n return ReflectApply(op, this, args);\n };\n const op = promiseReturningOperators[key];\n ObjectDefineProperty(fn, \"name\", {\n value: op.name\n }), ObjectDefineProperty(fn, \"length\", {\n value: op.length\n }), ObjectDefineProperty(Stream.Readable.prototype, key, {\n value: fn,\n enumerable: !1,\n configurable: !0,\n writable: !0\n });\n }\n Stream.Writable = require_writable(), Stream.Duplex = require_duplex(), Stream.Transform = require_transform(), Stream.PassThrough = require_passthrough(), Stream.pipeline = pipeline;\n var { addAbortSignal } = require_add_abort_signal();\n Stream.addAbortSignal = addAbortSignal, Stream.finished = eos, Stream.destroy = destroyer, Stream.compose = compose, ObjectDefineProperty(Stream, \"promises\", {\n configurable: !0,\n enumerable: !0,\n get() {\n return promises;\n }\n }), ObjectDefineProperty(pipeline, customPromisify, {\n enumerable: !0,\n get() {\n return promises.pipeline;\n }\n }), ObjectDefineProperty(eos, customPromisify, {\n enumerable: !0,\n get() {\n return promises.finished;\n }\n }), Stream.Stream = Stream, Stream._isUint8Array = function isUint8Array(value) {\n return value instanceof @Uint8Array;\n }, Stream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) {\n return new @Buffer(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n };\n }\n}), nativeReadableStreamPrototypes = {\n 0: @undefined,\n 1: @undefined,\n 2: @undefined,\n 3: @undefined,\n 4: @undefined,\n 5: @undefined\n}, Writable = require_writable(), _pathOrFdOrSink = Symbol(\"pathOrFdOrSink\"), _fileSink = Symbol(\"fileSink\"), _native = Symbol(\"native\");\nNativeWritable.prototype = Object.create(Writable.prototype);\nvar WritablePrototypeWrite = Writable.prototype.write;\nNativeWritable.prototype.write = function NativeWritablePrototypeWrite(chunk, encoding, cb, native) {\n if (!(native \?\? this[_native]))\n return this[_native] = !1, WritablePrototypeWrite.@call(this, chunk, encoding, cb);\n var fileSink = this[_fileSink] \?\? NativeWritable_lazyConstruct(this), result = fileSink.write(chunk);\n if (@isPromise(result))\n return result.then(() => {\n this.emit(\"drain\"), fileSink.flush(!0);\n }), !1;\n if (fileSink.flush(!0), typeof encoding === \"function\")\n cb = encoding;\n if (cb)\n cb(null, chunk.byteLength);\n return !0;\n};\nvar WritablePrototypeEnd = Writable.prototype.end;\nNativeWritable.prototype.end = function end(chunk, encoding, cb, native) {\n return WritablePrototypeEnd.@call(this, chunk, encoding, cb, native \?\? this[_native]);\n};\nNativeWritable.prototype.ref = function ref() {\n var sink = this[_fileSink];\n if (!sink)\n this.NativeWritable_lazyConstruct();\n sink.ref();\n};\nNativeWritable.prototype.unref = function unref() {\n this[_fileSink]\?.unref();\n};\nvar exports = require_stream(), promises = require_promises();\nexports._getNativeReadableStreamPrototype = getNativeReadableStreamPrototype;\nexports.NativeWritable = NativeWritable;\nObject.defineProperty(exports, \"promises\", {\n configurable: !0,\n enumerable: !0,\n get() {\n return promises;\n }\n});\nexports[Symbol.for(\"::bunternal::\")] = { _ReadableFromWeb, _ReadableFromWebForUndici };\nexports.eos = require_end_of_stream();\nexports.EventEmitter = EE;\nreturn exports})\n");
//
//
-static constexpr ASCIILiteral NodeStreamPromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/stream.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37)).promises})\n"_s;
+static constexpr ASCIILiteral NodeStreamPromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/stream.promises.ts\nreturn (@getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39)).promises})\n");
//
//
-static constexpr ASCIILiteral NodeStreamWebCode = "(function (){\"use strict\";// src/js/out/tmp/node/stream.web.ts\nvar $;\n$ = {\n ReadableStream,\n ReadableStreamDefaultReader,\n ReadableStreamBYOBReader,\n ReadableStreamBYOBRequest,\n ReadableByteStreamController,\n ReadableStreamDefaultController,\n TransformStream,\n TransformStreamDefaultController,\n WritableStream,\n WritableStreamDefaultWriter,\n WritableStreamDefaultController,\n ByteLengthQueuingStrategy,\n CountQueuingStrategy,\n TextEncoderStream: void 0,\n TextDecoderStream: void 0,\n CompressionStream: void 0,\n DecompressionStream: void 0\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeStreamWebCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/stream.web.ts\nvar $;\n$ = {\n ReadableStream: @ReadableStream,\n ReadableStreamDefaultReader: @ReadableStreamDefaultReader,\n ReadableStreamBYOBReader: @ReadableStreamBYOBReader,\n ReadableStreamBYOBRequest: @ReadableStreamBYOBRequest,\n ReadableByteStreamController: @ReadableByteStreamController,\n ReadableStreamDefaultController: @ReadableStreamDefaultController,\n TransformStream: @TransformStream,\n TransformStreamDefaultController: @TransformStreamDefaultController,\n WritableStream: @WritableStream,\n WritableStreamDefaultWriter: @WritableStreamDefaultWriter,\n WritableStreamDefaultController: @WritableStreamDefaultController,\n ByteLengthQueuingStrategy,\n CountQueuingStrategy,\n TextEncoderStream: @undefined,\n TextDecoderStream: @undefined,\n CompressionStream: @undefined,\n DecompressionStream: @undefined\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeTimersCode = "(function (){\"use strict\";// src/js/out/tmp/node/timers.ts\nvar $;\n$ = {\n setTimeout,\n clearTimeout,\n setInterval,\n setImmediate,\n clearInterval,\n clearImmediate\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeTimersCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/timers.ts\nvar $;\n$ = {\n setTimeout,\n clearTimeout,\n setInterval,\n setImmediate,\n clearInterval,\n clearImmediate\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeTimersPromisesCode = "(function (){\"use strict\";// src/js/out/tmp/node/timers.promises.ts\nvar validateObject = function(object, name) {\n if (object === null || typeof object !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Object\", object);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n}, validateAbortSignal = function(signal, name) {\n if (typeof signal !== \"undefined\" && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, asyncIterator = function({ next: nextFunction, return: returnFunction }) {\n const result = {};\n if (typeof nextFunction === \"function\")\n result.next = nextFunction;\n if (typeof returnFunction === \"function\")\n result.return = returnFunction;\n return result[symbolAsyncIterator] = function() {\n return this;\n }, result;\n}, setTimeoutPromise = function(after = 1, value, options = {}) {\n const arguments_ = [].concat(value \?\? []);\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return Promise.reject(error);\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return Promise.reject(error);\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return Promise.reject(error);\n }\n if (signal\?.aborted)\n return Promise.reject(new AbortError);\n let onCancel;\n const returnValue = new Promise((resolve, reject) => {\n const timeout = setTimeout(() => resolve(value), after, ...arguments_);\n if (!reference)\n timeout\?.unref\?.();\n if (signal)\n onCancel = () => {\n clearTimeout(timeout), reject(new AbortError);\n }, signal.addEventListener(\"abort\", onCancel);\n });\n if (typeof onCancel !== \"undefined\")\n returnValue.finally(() => signal.removeEventListener(\"abort\", onCancel));\n return returnValue;\n}, setImmediatePromise = function(value, options = {}) {\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return Promise.reject(error);\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return Promise.reject(error);\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return Promise.reject(error);\n }\n if (signal\?.aborted)\n return Promise.reject(new AbortError);\n let onCancel;\n const returnValue = new Promise((resolve, reject) => {\n const immediate = setImmediate(() => resolve(value));\n if (!reference)\n immediate\?.unref\?.();\n if (signal)\n onCancel = () => {\n clearImmediate(immediate), reject(new AbortError);\n }, signal.addEventListener(\"abort\", onCancel);\n });\n if (typeof onCancel !== \"undefined\")\n returnValue.finally(() => signal.removeEventListener(\"abort\", onCancel));\n return returnValue;\n}, setIntervalPromise = function(after = 1, value, options = {}) {\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return Promise.reject(error);\n }\n });\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return Promise.reject(error);\n }\n });\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return Promise.reject(error);\n }\n });\n }\n if (signal\?.aborted)\n return asyncIterator({\n next: function() {\n return Promise.reject(new AbortError);\n }\n });\n let onCancel, interval;\n try {\n let notYielded = 0, callback;\n if (interval = setInterval(() => {\n if (notYielded++, callback)\n callback(), callback = void 0;\n }, after), !reference)\n interval\?.unref\?.();\n if (signal)\n onCancel = () => {\n if (clearInterval(interval), callback)\n callback(), callback = void 0;\n }, signal.addEventListener(\"abort\", onCancel);\n return asyncIterator({\n next: function() {\n return new Promise((resolve, reject) => {\n if (!signal\?.aborted)\n if (notYielded === 0)\n callback = resolve;\n else\n resolve();\n else if (notYielded === 0)\n reject(new AbortError);\n else\n resolve();\n }).then(() => {\n if (notYielded > 0)\n return notYielded = notYielded - 1, { done: !1, value };\n return { done: !0 };\n });\n },\n return: function() {\n return clearInterval(interval), signal\?.removeEventListener(\"abort\", onCancel), Promise.resolve({});\n }\n });\n } catch (error) {\n return asyncIterator({\n next: function() {\n clearInterval(interval), signal\?.removeEventListener(\"abort\", onCancel);\n }\n });\n }\n}, $, symbolAsyncIterator = Symbol.asyncIterator;\n\nclass ERR_INVALID_ARG_TYPE extends Error {\n constructor(name, expected, actual) {\n super(`${name} must be ${expected}, ${typeof actual} given`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\n\nclass AbortError extends Error {\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\n$ = {\n setTimeout: setTimeoutPromise,\n setImmediate: setImmediatePromise,\n setInterval: setIntervalPromise,\n scheduler: {\n wait: (delay, options) => setTimeoutPromise(delay, void 0, options),\n yield: setImmediatePromise\n }\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeTimersPromisesCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/timers.promises.ts\nvar validateObject = function(object, name) {\n if (object === null || typeof object !== \"object\")\n throw new ERR_INVALID_ARG_TYPE(name, \"Object\", object);\n}, validateBoolean = function(value, name) {\n if (typeof value !== \"boolean\")\n throw new ERR_INVALID_ARG_TYPE(name, \"boolean\", value);\n}, validateAbortSignal = function(signal, name) {\n if (typeof signal !== \"undefined\" && (signal === null || typeof signal !== \"object\" || !(\"aborted\" in signal)))\n throw new ERR_INVALID_ARG_TYPE(name, \"AbortSignal\", signal);\n}, asyncIterator = function({ next: nextFunction, return: returnFunction }) {\n const result = {};\n if (typeof nextFunction === \"function\")\n result.next = nextFunction;\n if (typeof returnFunction === \"function\")\n result.return = returnFunction;\n return result[symbolAsyncIterator] = function() {\n return this;\n }, result;\n}, setTimeoutPromise = function(after = 1, value, options = {}) {\n const arguments_ = [].concat(value \?\? []);\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return @Promise.reject(error);\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return @Promise.reject(error);\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return @Promise.reject(error);\n }\n if (signal\?.aborted)\n return @Promise.reject(new AbortError);\n let onCancel;\n const returnValue = new @Promise((resolve, reject) => {\n const timeout = setTimeout(() => resolve(value), after, ...arguments_);\n if (!reference)\n timeout\?.unref\?.();\n if (signal)\n onCancel = () => {\n clearTimeout(timeout), reject(new AbortError);\n }, signal.addEventListener(\"abort\", onCancel);\n });\n if (typeof onCancel !== \"undefined\")\n returnValue.finally(() => signal.removeEventListener(\"abort\", onCancel));\n return returnValue;\n}, setImmediatePromise = function(value, options = {}) {\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return @Promise.reject(error);\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return @Promise.reject(error);\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return @Promise.reject(error);\n }\n if (signal\?.aborted)\n return @Promise.reject(new AbortError);\n let onCancel;\n const returnValue = new @Promise((resolve, reject) => {\n const immediate = setImmediate(() => resolve(value));\n if (!reference)\n immediate\?.unref\?.();\n if (signal)\n onCancel = () => {\n clearImmediate(immediate), reject(new AbortError);\n }, signal.addEventListener(\"abort\", onCancel);\n });\n if (typeof onCancel !== \"undefined\")\n returnValue.finally(() => signal.removeEventListener(\"abort\", onCancel));\n return returnValue;\n}, setIntervalPromise = function(after = 1, value, options = {}) {\n try {\n validateObject(options, \"options\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return @Promise.reject(error);\n }\n });\n }\n const { signal, ref: reference = !0 } = options;\n try {\n validateAbortSignal(signal, \"options.signal\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return @Promise.reject(error);\n }\n });\n }\n try {\n validateBoolean(reference, \"options.ref\");\n } catch (error) {\n return asyncIterator({\n next: function() {\n return @Promise.reject(error);\n }\n });\n }\n if (signal\?.aborted)\n return asyncIterator({\n next: function() {\n return @Promise.reject(new AbortError);\n }\n });\n let onCancel, interval;\n try {\n let notYielded = 0, callback;\n if (interval = setInterval(() => {\n if (notYielded++, callback)\n callback(), callback = @undefined;\n }, after), !reference)\n interval\?.unref\?.();\n if (signal)\n onCancel = () => {\n if (clearInterval(interval), callback)\n callback(), callback = @undefined;\n }, signal.addEventListener(\"abort\", onCancel);\n return asyncIterator({\n next: function() {\n return new @Promise((resolve, reject) => {\n if (!signal\?.aborted)\n if (notYielded === 0)\n callback = resolve;\n else\n resolve();\n else if (notYielded === 0)\n reject(new AbortError);\n else\n resolve();\n }).then(() => {\n if (notYielded > 0)\n return notYielded = notYielded - 1, { done: !1, value };\n return { done: !0 };\n });\n },\n return: function() {\n return clearInterval(interval), signal\?.removeEventListener(\"abort\", onCancel), @Promise.resolve({});\n }\n });\n } catch (error) {\n return asyncIterator({\n next: function() {\n clearInterval(interval), signal\?.removeEventListener(\"abort\", onCancel);\n }\n });\n }\n}, $, symbolAsyncIterator = Symbol.asyncIterator;\n\nclass ERR_INVALID_ARG_TYPE extends Error {\n constructor(name, expected, actual) {\n super(`${name} must be ${expected}, ${typeof actual} given`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\n\nclass AbortError extends Error {\n constructor() {\n super(\"The operation was aborted\");\n this.code = \"ABORT_ERR\";\n }\n}\n$ = {\n setTimeout: setTimeoutPromise,\n setImmediate: setImmediatePromise,\n setInterval: setIntervalPromise,\n scheduler: {\n wait: (delay, options) => setTimeoutPromise(delay, @undefined, options),\n yield: setImmediatePromise\n }\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeTLSCode = "(function (){\"use strict\";// src/js/out/tmp/node/tls.ts\nvar parseCertString = function() {\n throwNotImplemented(\"Not implemented\");\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof ArrayBuffer || obj instanceof Blob)\n return !0;\n if (Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, unfqdn = function(host) {\n return RegExpPrototypeSymbolReplace.call(/[.]$/, host, \"\");\n}, toLowerCase = function(c) {\n return StringFromCharCode.call(32 + StringPrototypeCharCodeAt.call(c, 0));\n}, splitHost = function(host) {\n return StringPrototypeSplit.call(RegExpPrototypeSymbolReplace.call(/[A-Z]/g, unfqdn(host), toLowerCase), \".\");\n}, check = function(hostParts, pattern, wildcards) {\n if (!pattern)\n return !1;\n const patternParts = splitHost(pattern);\n if (hostParts.length !== patternParts.length)\n return !1;\n if (ArrayPrototypeIncludes.call(patternParts, \"\"))\n return !1;\n const isBad = (s) => RegExpPrototypeExec.call(/[^\\u0021-\\u007F]/u, s) !== null;\n if (ArrayPrototypeSome.call(patternParts, isBad))\n return !1;\n for (let i = hostParts.length - 1;i > 0; i -= 1)\n if (hostParts[i] !== patternParts[i])\n return !1;\n const hostSubdomain = hostParts[0], patternSubdomain = patternParts[0], patternSubdomainParts = StringPrototypeSplit.call(patternSubdomain, \"*\");\n if (patternSubdomainParts.length === 1 || StringPrototypeIncludes.call(patternSubdomain, \"xn--\"))\n return hostSubdomain === patternSubdomain;\n if (!wildcards)\n return !1;\n if (patternSubdomainParts.length > 2)\n return !1;\n if (patternParts.length <= 2)\n return !1;\n const { 0: prefix, 1: suffix } = patternSubdomainParts;\n if (prefix.length + suffix.length > hostSubdomain.length)\n return !1;\n if (!StringPrototypeStartsWith.call(hostSubdomain, prefix))\n return !1;\n if (!StringPrototypeEndsWith.call(hostSubdomain, suffix))\n return !1;\n return !0;\n}, splitEscapedAltNames = function(altNames) {\n const result = [];\n let currentToken = \"\", offset = 0;\n while (offset !== altNames.length) {\n const nextSep = StringPrototypeIndexOf.call(altNames, \", \", offset), nextQuote = StringPrototypeIndexOf.call(altNames, '\"', offset);\n if (nextQuote !== -1 && (nextSep === -1 || nextQuote < nextSep)) {\n currentToken += StringPrototypeSubstring.call(altNames, offset, nextQuote);\n const match = RegExpPrototypeExec.call(jsonStringPattern, StringPrototypeSubstring.call(altNames, nextQuote));\n if (!match) {\n let error = new SyntaxError(\"ERR_TLS_CERT_ALTNAME_FORMAT: Invalid subject alternative name string\");\n throw error.name = ERR_TLS_CERT_ALTNAME_FORMAT, error;\n }\n currentToken += JSON.parse(match[0]), offset = nextQuote + match[0].length;\n } else if (nextSep !== -1)\n currentToken += StringPrototypeSubstring.call(altNames, offset, nextSep), ArrayPrototypePush.call(result, currentToken), currentToken = \"\", offset = nextSep + 2;\n else\n currentToken += StringPrototypeSubstring.call(altNames, offset), offset = altNames.length;\n }\n return ArrayPrototypePush.call(result, currentToken), result;\n}, checkServerIdentity = function(hostname, cert) {\n const { subject, subjectaltname: altNames } = cert, dnsNames = [], ips = [];\n if (hostname = \"\" + hostname, altNames) {\n const splitAltNames = StringPrototypeIncludes.call(altNames, '\"') \? splitEscapedAltNames(altNames) : StringPrototypeSplit.call(altNames, \", \");\n ArrayPrototypeForEach.call(splitAltNames, (name) => {\n if (StringPrototypeStartsWith.call(name, \"DNS:\"))\n ArrayPrototypePush.call(dnsNames, StringPrototypeSlice.call(name, 4));\n else if (StringPrototypeStartsWith.call(name, \"IP Address:\"))\n ArrayPrototypePush.call(ips, canonicalizeIP(StringPrototypeSlice.call(name, 11)));\n });\n }\n let valid = !1, reason = \"Unknown reason\";\n if (hostname = unfqdn(hostname), net.isIP(hostname)) {\n if (valid = ArrayPrototypeIncludes.call(ips, canonicalizeIP(hostname)), !valid)\n reason = `IP: ${hostname} is not in the cert's list: ` + ArrayPrototypeJoin.call(ips, \", \");\n } else if (dnsNames.length > 0 || subject\?.CN) {\n const hostParts = splitHost(hostname), wildcard = (pattern) => check(hostParts, pattern, !0);\n if (dnsNames.length > 0) {\n if (valid = ArrayPrototypeSome.call(dnsNames, wildcard), !valid)\n reason = `Host: ${hostname}. is not in the cert's altnames: ${altNames}`;\n } else {\n const cn = subject.CN;\n if (Array.isArray(cn))\n valid = ArrayPrototypeSome.call(cn, wildcard);\n else if (cn)\n valid = wildcard(cn);\n if (!valid)\n reason = `Host: ${hostname}. is not cert's CN: ${cn}`;\n }\n } else\n reason = \"Cert does not contain a DNS name\";\n if (!valid) {\n let error = new Error(`ERR_TLS_CERT_ALTNAME_INVALID: Hostname/IP does not match certificate's altnames: ${reason}`);\n return error.name = \"ERR_TLS_CERT_ALTNAME_INVALID\", error.reason = reason, error.host = hostname, error.cert = cert, error;\n }\n}, SecureContext = function(options) {\n return new InternalSecureContext(options);\n}, createSecureContext = function(options) {\n return new SecureContext(options);\n}, translatePeerCertificate = function(c) {\n if (!c)\n return null;\n if (c.issuerCertificate != null && c.issuerCertificate !== c)\n c.issuerCertificate = translatePeerCertificate(c.issuerCertificate);\n if (c.infoAccess != null) {\n const info = c.infoAccess;\n c.infoAccess = { __proto__: null }, RegExpPrototypeSymbolReplace.call(/([^\\n:]*):([^\\n]*)(\?:\\n|$)/g, info, (all, key, val) => {\n if (val.charCodeAt(0) === 34)\n val = JSONParse(val);\n if (key in c.infoAccess)\n ArrayPrototypePush.call(c.infoAccess[key], val);\n else\n c.infoAccess[key] = [val];\n });\n }\n return c;\n}, createServer = function(options, connectionListener) {\n return new Server(options, connectionListener);\n}, getCiphers = function() {\n return DEFAULT_CIPHERS.split(\":\");\n}, convertProtocols = function(protocols) {\n const lens = new Array(protocols.length), buff = Buffer.allocUnsafe(ArrayPrototypeReduce.call(protocols, (p, c, i) => {\n const len = Buffer.byteLength(c);\n if (len > 255)\n @throwRangeError(\"The byte length of the protocol at index \" + `${i} exceeds the maximum length.`, \"<= 255\", len, !0);\n return lens[i] = len, p + 1 + len;\n }, 0));\n let offset = 0;\n for (let i = 0, c = protocols.length;i < c; i++)\n buff[offset++] = lens[i], buff.write(protocols[i], offset), offset += lens[i];\n return buff;\n}, convertALPNProtocols = function(protocols, out) {\n if (Array.isArray(protocols))\n out.ALPNProtocols = convertProtocols(protocols);\n else if (isTypedArray(protocols))\n out.ALPNProtocols = Buffer.from(protocols);\n else if (isArrayBufferView(protocols))\n out.ALPNProtocols = Buffer.from(protocols.buffer.slice(protocols.byteOffset, protocols.byteOffset + protocols.byteLength));\n else if (Buffer.isBuffer(protocols))\n out.ALPNProtocols = protocols;\n}, $, { isArrayBufferView, isTypedArray } = @requireNativeModule(\"util/types\"), net = @getInternalField(@internalModuleRegistry, 25) || @createInternalModuleById(25), { Server: NetServer, [Symbol.for(\"::bunternal::\")]: InternalTCPSocket } = net, bunSocketInternal = Symbol.for(\"::bunnetsocketinternal::\"), { rootCertificates, canonicalizeIP } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"internal/tls\"), SymbolReplace = Symbol.replace, RegExpPrototypeSymbolReplace = RegExp.prototype[SymbolReplace], RegExpPrototypeExec = RegExp.prototype.exec, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeSlice = String.prototype.slice, StringPrototypeIncludes = String.prototype.includes, StringPrototypeSplit = String.prototype.split, StringPrototypeIndexOf = String.prototype.indexOf, StringPrototypeSubstring = String.prototype.substring, StringPrototypeEndsWith = String.prototype.endsWith, StringFromCharCode = String.fromCharCode, StringPrototypeCharCodeAt = String.prototype.charCodeAt, ArrayPrototypeIncludes = Array.prototype.includes, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeForEach = Array.prototype.forEach, ArrayPrototypePush = Array.prototype.push, ArrayPrototypeSome = Array.prototype.some, ArrayPrototypeReduce = Array.prototype.reduce, jsonStringPattern = /^\"(\?:[^\"\\\\\\u0000-\\u001f]|\\\\(\?:[\"\\\\/bfnrt]|u[0-9a-fA-F]{4}))*\"/, InternalSecureContext = class SecureContext2 {\n context;\n constructor(options) {\n const context = {};\n if (options) {\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.key = key;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.cert = cert;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.ca = ca;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n this.passphrase = passphrase;\n let servername = options.servername;\n if (servername && typeof servername !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n this.servername = servername;\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n this.secureOptions = secureOptions;\n }\n this.context = context;\n }\n}, buntls = Symbol.for(\"::buntls::\"), SocketClass, TLSSocket = function(InternalTLSSocket) {\n return SocketClass = InternalTLSSocket, Object.defineProperty(SocketClass.prototype, Symbol.toStringTag, {\n value: \"TLSSocket\",\n enumerable: !1\n }), Object.defineProperty(function Socket(options) {\n return new InternalTLSSocket(options);\n }, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalTLSSocket;\n }\n });\n}(class TLSSocket2 extends InternalTCPSocket {\n #secureContext;\n ALPNProtocols;\n #socket;\n #checkServerIdentity;\n #session;\n constructor(socket, options) {\n super(socket instanceof InternalTCPSocket \? options : options || socket);\n if (options = options || socket || {}, typeof options === \"object\") {\n const { ALPNProtocols } = options;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, this);\n if (socket instanceof InternalTCPSocket)\n this.#socket = socket;\n }\n this.#secureContext = options.secureContext || createSecureContext(options), this.authorized = !1, this.secureConnecting = !0, this._secureEstablished = !1, this._securePending = !0, this.#checkServerIdentity = options.checkServerIdentity || checkServerIdentity, this.#session = options.session || null;\n }\n _secureEstablished = !1;\n _securePending = !0;\n _newSessionPending;\n _controlReleased;\n secureConnecting = !1;\n _SNICallback;\n servername;\n authorized = !1;\n authorizationError;\n #renegotiationDisabled = !1;\n encrypted = !0;\n _start() {\n this.connect();\n }\n getSession() {\n return this[bunSocketInternal]\?.getSession();\n }\n getEphemeralKeyInfo() {\n return this[bunSocketInternal]\?.getEphemeralKeyInfo();\n }\n getCipher() {\n return this[bunSocketInternal]\?.getCipher();\n }\n getSharedSigalgs() {\n return this[bunSocketInternal]\?.getSharedSigalgs();\n }\n getProtocol() {\n return this[bunSocketInternal]\?.getTLSVersion();\n }\n getFinished() {\n return this[bunSocketInternal]\?.getTLSFinishedMessage() || void 0;\n }\n getPeerFinished() {\n return this[bunSocketInternal]\?.getTLSPeerFinishedMessage() || void 0;\n }\n isSessionReused() {\n return !!this.#session;\n }\n renegotiate() {\n if (this.#renegotiationDisabled) {\n const error = new Error(\"ERR_TLS_RENEGOTIATION_DISABLED: TLS session renegotiation disabled for this socket\");\n throw error.name = \"ERR_TLS_RENEGOTIATION_DISABLED\", error;\n }\n throw Error(\"Not implented in Bun yet\");\n }\n disableRenegotiation() {\n this.#renegotiationDisabled = !0;\n }\n getTLSTicket() {\n return this[bunSocketInternal]\?.getTLSTicket();\n }\n exportKeyingMaterial(length, label, context) {\n if (context)\n return this[bunSocketInternal]\?.exportKeyingMaterial(length, label, context);\n return this[bunSocketInternal]\?.exportKeyingMaterial(length, label);\n }\n setMaxSendFragment(size) {\n return this[bunSocketInternal]\?.setMaxSendFragment(size) || !1;\n }\n enableTrace() {\n }\n setServername(name) {\n if (this.isServer) {\n let error = new Error(\"ERR_TLS_SNI_FROM_SERVER: Cannot issue SNI from a TLS server-side socket\");\n throw error.name = \"ERR_TLS_SNI_FROM_SERVER\", error;\n }\n this.servername = name, this[bunSocketInternal]\?.setServername(name);\n }\n setSession(session) {\n if (this.#session = session, typeof session === \"string\")\n session = Buffer.from(session, \"latin1\");\n return this[bunSocketInternal]\?.setSession(session);\n }\n getPeerCertificate(abbreviated) {\n const cert = arguments.length < 1 \? this[bunSocketInternal]\?.getPeerCertificate() : this[bunSocketInternal]\?.getPeerCertificate(abbreviated);\n if (cert)\n return translatePeerCertificate(cert);\n }\n getCertificate() {\n const cert = this[bunSocketInternal]\?.getCertificate();\n if (cert)\n return translatePeerCertificate(cert);\n }\n getPeerX509Certificate() {\n throw Error(\"Not implented in Bun yet\");\n }\n getX509Certificate() {\n throw Error(\"Not implented in Bun yet\");\n }\n get alpnProtocol() {\n return this[bunSocketInternal]\?.alpnProtocol;\n }\n [buntls](port, host) {\n return {\n socket: this.#socket,\n ALPNProtocols: this.ALPNProtocols,\n serverName: this.servername || host || \"localhost\",\n checkServerIdentity: this.#checkServerIdentity,\n session: this.#session,\n ...this.#secureContext\n };\n }\n});\n\nclass Server extends NetServer {\n key;\n cert;\n ca;\n passphrase;\n secureOptions;\n _rejectUnauthorized;\n _requestCert;\n servername;\n ALPNProtocols;\n constructor(options, secureConnectionListener) {\n super(options, secureConnectionListener);\n this.setSecureContext(options);\n }\n setSecureContext(options) {\n if (options instanceof InternalSecureContext)\n options = options.context;\n if (options) {\n const { ALPNProtocols } = options;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, this);\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.key = key;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.cert = cert;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.ca = ca;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n this.passphrase = passphrase;\n let servername = options.servername;\n if (servername && typeof servername !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n this.servername = servername;\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n this.secureOptions = secureOptions;\n const requestCert = options.requestCert || !1;\n if (requestCert)\n this._requestCert = requestCert;\n else\n this._requestCert = void 0;\n const rejectUnauthorized = options.rejectUnauthorized || !1;\n if (rejectUnauthorized)\n this._rejectUnauthorized = rejectUnauthorized;\n else\n this._rejectUnauthorized = void 0;\n }\n }\n getTicketKeys() {\n throw Error(\"Not implented in Bun yet\");\n }\n setTicketKeys() {\n throw Error(\"Not implented in Bun yet\");\n }\n [buntls](port, host, isClient) {\n return [\n {\n serverName: this.servername || host || \"localhost\",\n key: this.key,\n cert: this.cert,\n ca: this.ca,\n passphrase: this.passphrase,\n secureOptions: this.secureOptions,\n rejectUnauthorized: isClient \? !1 : this._rejectUnauthorized,\n requestCert: isClient \? !1 : this._requestCert,\n ALPNProtocols: this.ALPNProtocols\n },\n SocketClass\n ];\n }\n}\nvar CLIENT_RENEG_LIMIT = 3, CLIENT_RENEG_WINDOW = 600, DEFAULT_ECDH_CURVE = \"auto\", DEFAULT_CIPHERS = \"DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256\", DEFAULT_MIN_VERSION = \"TLSv1.2\", DEFAULT_MAX_VERSION = \"TLSv1.3\", createConnection = (port, host, connectListener) => {\n if (typeof port === \"object\") {\n port.checkServerIdentity;\n const { ALPNProtocols } = port;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, port);\n return new TLSSocket(port).connect(port, host, connectListener);\n }\n return new TLSSocket().connect(port, host, connectListener);\n}, connect = createConnection;\n$ = {\n CLIENT_RENEG_LIMIT,\n CLIENT_RENEG_WINDOW,\n connect,\n convertALPNProtocols,\n createConnection,\n createSecureContext,\n createServer,\n DEFAULT_CIPHERS,\n DEFAULT_ECDH_CURVE,\n DEFAULT_MAX_VERSION,\n DEFAULT_MIN_VERSION,\n getCiphers,\n parseCertString,\n SecureContext,\n Server,\n TLSSocket,\n checkServerIdentity,\n rootCertificates\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeTLSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/tls.ts\nvar parseCertString = function() {\n throwNotImplemented(\"Not implemented\");\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof @ArrayBuffer || obj instanceof Blob)\n return !0;\n if (@Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof @ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, unfqdn = function(host) {\n return RegExpPrototypeSymbolReplace.@call(/[.]$/, host, \"\");\n}, toLowerCase = function(c) {\n return StringFromCharCode.@call(32 + StringPrototypeCharCodeAt.@call(c, 0));\n}, splitHost = function(host) {\n return StringPrototypeSplit.@call(RegExpPrototypeSymbolReplace.@call(/[A-Z]/g, unfqdn(host), toLowerCase), \".\");\n}, check = function(hostParts, pattern, wildcards) {\n if (!pattern)\n return !1;\n const patternParts = splitHost(pattern);\n if (hostParts.length !== patternParts.length)\n return !1;\n if (ArrayPrototypeIncludes.@call(patternParts, \"\"))\n return !1;\n const isBad = (s) => RegExpPrototypeExec.@call(/[^\\u0021-\\u007F]/u, s) !== null;\n if (ArrayPrototypeSome.@call(patternParts, isBad))\n return !1;\n for (let i = hostParts.length - 1;i > 0; i -= 1)\n if (hostParts[i] !== patternParts[i])\n return !1;\n const hostSubdomain = hostParts[0], patternSubdomain = patternParts[0], patternSubdomainParts = StringPrototypeSplit.@call(patternSubdomain, \"*\");\n if (patternSubdomainParts.length === 1 || StringPrototypeIncludes.@call(patternSubdomain, \"xn--\"))\n return hostSubdomain === patternSubdomain;\n if (!wildcards)\n return !1;\n if (patternSubdomainParts.length > 2)\n return !1;\n if (patternParts.length <= 2)\n return !1;\n const { 0: prefix, 1: suffix } = patternSubdomainParts;\n if (prefix.length + suffix.length > hostSubdomain.length)\n return !1;\n if (!StringPrototypeStartsWith.@call(hostSubdomain, prefix))\n return !1;\n if (!StringPrototypeEndsWith.@call(hostSubdomain, suffix))\n return !1;\n return !0;\n}, splitEscapedAltNames = function(altNames) {\n const result = [];\n let currentToken = \"\", offset = 0;\n while (offset !== altNames.length) {\n const nextSep = StringPrototypeIndexOf.@call(altNames, \", \", offset), nextQuote = StringPrototypeIndexOf.@call(altNames, '\"', offset);\n if (nextQuote !== -1 && (nextSep === -1 || nextQuote < nextSep)) {\n currentToken += StringPrototypeSubstring.@call(altNames, offset, nextQuote);\n const match = RegExpPrototypeExec.@call(jsonStringPattern, StringPrototypeSubstring.@call(altNames, nextQuote));\n if (!match) {\n let error = new SyntaxError(\"ERR_TLS_CERT_ALTNAME_FORMAT: Invalid subject alternative name string\");\n throw error.name = ERR_TLS_CERT_ALTNAME_FORMAT, error;\n }\n currentToken += JSON.parse(match[0]), offset = nextQuote + match[0].length;\n } else if (nextSep !== -1)\n currentToken += StringPrototypeSubstring.@call(altNames, offset, nextSep), ArrayPrototypePush.@call(result, currentToken), currentToken = \"\", offset = nextSep + 2;\n else\n currentToken += StringPrototypeSubstring.@call(altNames, offset), offset = altNames.length;\n }\n return ArrayPrototypePush.@call(result, currentToken), result;\n}, checkServerIdentity = function(hostname, cert) {\n const { subject, subjectaltname: altNames } = cert, dnsNames = [], ips = [];\n if (hostname = \"\" + hostname, altNames) {\n const splitAltNames = StringPrototypeIncludes.@call(altNames, '\"') \? splitEscapedAltNames(altNames) : StringPrototypeSplit.@call(altNames, \", \");\n ArrayPrototypeForEach.@call(splitAltNames, (name) => {\n if (StringPrototypeStartsWith.@call(name, \"DNS:\"))\n ArrayPrototypePush.@call(dnsNames, StringPrototypeSlice.@call(name, 4));\n else if (StringPrototypeStartsWith.@call(name, \"IP Address:\"))\n ArrayPrototypePush.@call(ips, canonicalizeIP(StringPrototypeSlice.@call(name, 11)));\n });\n }\n let valid = !1, reason = \"Unknown reason\";\n if (hostname = unfqdn(hostname), net.isIP(hostname)) {\n if (valid = ArrayPrototypeIncludes.@call(ips, canonicalizeIP(hostname)), !valid)\n reason = `IP: ${hostname} is not in the cert's list: ` + ArrayPrototypeJoin.@call(ips, \", \");\n } else if (dnsNames.length > 0 || subject\?.CN) {\n const hostParts = splitHost(hostname), wildcard = (pattern) => check(hostParts, pattern, !0);\n if (dnsNames.length > 0) {\n if (valid = ArrayPrototypeSome.@call(dnsNames, wildcard), !valid)\n reason = `Host: ${hostname}. is not in the cert's altnames: ${altNames}`;\n } else {\n const cn = subject.CN;\n if (@Array.isArray(cn))\n valid = ArrayPrototypeSome.@call(cn, wildcard);\n else if (cn)\n valid = wildcard(cn);\n if (!valid)\n reason = `Host: ${hostname}. is not cert's CN: ${cn}`;\n }\n } else\n reason = \"Cert does not contain a DNS name\";\n if (!valid) {\n let error = new Error(`ERR_TLS_CERT_ALTNAME_INVALID: Hostname/IP does not match certificate's altnames: ${reason}`);\n return error.name = \"ERR_TLS_CERT_ALTNAME_INVALID\", error.reason = reason, error.host = hostname, error.cert = cert, error;\n }\n}, SecureContext = function(options) {\n return new InternalSecureContext(options);\n}, createSecureContext = function(options) {\n return new SecureContext(options);\n}, translatePeerCertificate = function(c) {\n if (!c)\n return null;\n if (c.issuerCertificate != null && c.issuerCertificate !== c)\n c.issuerCertificate = translatePeerCertificate(c.issuerCertificate);\n if (c.infoAccess != null) {\n const info = c.infoAccess;\n c.infoAccess = { __proto__: null }, RegExpPrototypeSymbolReplace.@call(/([^\\n:]*):([^\\n]*)(\?:\\n|$)/g, info, (all, key, val) => {\n if (val.charCodeAt(0) === 34)\n val = JSONParse(val);\n if (key in c.infoAccess)\n ArrayPrototypePush.@call(c.infoAccess[key], val);\n else\n c.infoAccess[key] = [val];\n });\n }\n return c;\n}, createServer = function(options, connectionListener) {\n return new Server(options, connectionListener);\n}, getCiphers = function() {\n return DEFAULT_CIPHERS.split(\":\");\n}, convertProtocols = function(protocols) {\n const lens = new @Array(protocols.length), buff = @Buffer.allocUnsafe(ArrayPrototypeReduce.@call(protocols, (p, c, i) => {\n const len = @Buffer.byteLength(c);\n if (len > 255)\n @throwRangeError(\"The byte length of the protocol at index \" + `${i} exceeds the maximum length.`, \"<= 255\", len, !0);\n return lens[i] = len, p + 1 + len;\n }, 0));\n let offset = 0;\n for (let i = 0, c = protocols.length;i < c; i++)\n buff[offset++] = lens[i], buff.write(protocols[i], offset), offset += lens[i];\n return buff;\n}, convertALPNProtocols = function(protocols, out) {\n if (@Array.isArray(protocols))\n out.ALPNProtocols = convertProtocols(protocols);\n else if (isTypedArray(protocols))\n out.ALPNProtocols = @Buffer.from(protocols);\n else if (isArrayBufferView(protocols))\n out.ALPNProtocols = @Buffer.from(protocols.buffer.slice(protocols.byteOffset, protocols.byteOffset + protocols.byteLength));\n else if (@Buffer.isBuffer(protocols))\n out.ALPNProtocols = protocols;\n}, $, { isArrayBufferView, isTypedArray } = @requireNativeModule(\"util/types\"), net = @getInternalField(@internalModuleRegistry, 27) || @createInternalModuleById(27), { Server: NetServer, [Symbol.for(\"::bunternal::\")]: InternalTCPSocket } = net, bunSocketInternal = Symbol.for(\"::bunnetsocketinternal::\"), { rootCertificates, canonicalizeIP } = @lazy(\"internal/tls\"), SymbolReplace = Symbol.replace, RegExpPrototypeSymbolReplace = @RegExp.prototype[SymbolReplace], RegExpPrototypeExec = @RegExp.prototype.exec, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeSlice = @String.prototype.slice, StringPrototypeIncludes = @String.prototype.includes, StringPrototypeSplit = @String.prototype.split, StringPrototypeIndexOf = @String.prototype.indexOf, StringPrototypeSubstring = @String.prototype.substring, StringPrototypeEndsWith = @String.prototype.endsWith, StringFromCharCode = @String.fromCharCode, StringPrototypeCharCodeAt = @String.prototype.charCodeAt, ArrayPrototypeIncludes = @Array.prototype.includes, ArrayPrototypeJoin = @Array.prototype.join, ArrayPrototypeForEach = @Array.prototype.forEach, ArrayPrototypePush = @Array.prototype.push, ArrayPrototypeSome = @Array.prototype.some, ArrayPrototypeReduce = @Array.prototype.reduce, jsonStringPattern = /^\"(\?:[^\"\\\\\\u0000-\\u001f]|\\\\(\?:[\"\\\\/bfnrt]|u[0-9a-fA-F]{4}))*\"/, InternalSecureContext = class SecureContext2 {\n context;\n constructor(options) {\n const context = {};\n if (options) {\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.key = key;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.cert = cert;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.ca = ca;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n this.passphrase = passphrase;\n let servername = options.servername;\n if (servername && typeof servername !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n this.servername = servername;\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n this.secureOptions = secureOptions;\n }\n this.context = context;\n }\n}, buntls = Symbol.for(\"::buntls::\"), SocketClass, TLSSocket = function(InternalTLSSocket) {\n SocketClass = InternalTLSSocket, Object.defineProperty(SocketClass.prototype, Symbol.toStringTag, {\n value: \"TLSSocket\",\n enumerable: !1\n });\n function Socket(options) {\n return new InternalTLSSocket(options);\n }\n return Socket.prototype = InternalTLSSocket.prototype, Object.defineProperty(Socket, Symbol.hasInstance, {\n value(instance) {\n return instance instanceof InternalTLSSocket;\n }\n });\n}(class TLSSocket2 extends InternalTCPSocket {\n #secureContext;\n ALPNProtocols;\n #socket;\n #checkServerIdentity;\n #session;\n constructor(socket, options) {\n super(socket instanceof InternalTCPSocket \? options : options || socket);\n if (options = options || socket || {}, typeof options === \"object\") {\n const { ALPNProtocols } = options;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, this);\n if (socket instanceof InternalTCPSocket)\n this.#socket = socket;\n }\n this.#secureContext = options.secureContext || createSecureContext(options), this.authorized = !1, this.secureConnecting = !0, this._secureEstablished = !1, this._securePending = !0, this.#checkServerIdentity = options.checkServerIdentity || checkServerIdentity, this.#session = options.session || null;\n }\n _secureEstablished = !1;\n _securePending = !0;\n _newSessionPending;\n _controlReleased;\n secureConnecting = !1;\n _SNICallback;\n servername;\n authorized = !1;\n authorizationError;\n #renegotiationDisabled = !1;\n encrypted = !0;\n _start() {\n this.connect();\n }\n getSession() {\n return this[bunSocketInternal]\?.getSession();\n }\n getEphemeralKeyInfo() {\n return this[bunSocketInternal]\?.getEphemeralKeyInfo();\n }\n getCipher() {\n return this[bunSocketInternal]\?.getCipher();\n }\n getSharedSigalgs() {\n return this[bunSocketInternal]\?.getSharedSigalgs();\n }\n getProtocol() {\n return this[bunSocketInternal]\?.getTLSVersion();\n }\n getFinished() {\n return this[bunSocketInternal]\?.getTLSFinishedMessage() || @undefined;\n }\n getPeerFinished() {\n return this[bunSocketInternal]\?.getTLSPeerFinishedMessage() || @undefined;\n }\n isSessionReused() {\n return !!this.#session;\n }\n renegotiate() {\n if (this.#renegotiationDisabled) {\n const error = new Error(\"ERR_TLS_RENEGOTIATION_DISABLED: TLS session renegotiation disabled for this socket\");\n throw error.name = \"ERR_TLS_RENEGOTIATION_DISABLED\", error;\n }\n throw Error(\"Not implented in Bun yet\");\n }\n disableRenegotiation() {\n this.#renegotiationDisabled = !0;\n }\n getTLSTicket() {\n return this[bunSocketInternal]\?.getTLSTicket();\n }\n exportKeyingMaterial(length, label, context) {\n if (context)\n return this[bunSocketInternal]\?.exportKeyingMaterial(length, label, context);\n return this[bunSocketInternal]\?.exportKeyingMaterial(length, label);\n }\n setMaxSendFragment(size) {\n return this[bunSocketInternal]\?.setMaxSendFragment(size) || !1;\n }\n enableTrace() {\n }\n setServername(name) {\n if (this.isServer) {\n let error = new Error(\"ERR_TLS_SNI_FROM_SERVER: Cannot issue SNI from a TLS server-side socket\");\n throw error.name = \"ERR_TLS_SNI_FROM_SERVER\", error;\n }\n this.servername = name, this[bunSocketInternal]\?.setServername(name);\n }\n setSession(session) {\n if (this.#session = session, typeof session === \"string\")\n session = @Buffer.from(session, \"latin1\");\n return this[bunSocketInternal]\?.setSession(session);\n }\n getPeerCertificate(abbreviated) {\n const cert = arguments.length < 1 \? this[bunSocketInternal]\?.getPeerCertificate() : this[bunSocketInternal]\?.getPeerCertificate(abbreviated);\n if (cert)\n return translatePeerCertificate(cert);\n }\n getCertificate() {\n const cert = this[bunSocketInternal]\?.getCertificate();\n if (cert)\n return translatePeerCertificate(cert);\n }\n getPeerX509Certificate() {\n throw Error(\"Not implented in Bun yet\");\n }\n getX509Certificate() {\n throw Error(\"Not implented in Bun yet\");\n }\n get alpnProtocol() {\n return this[bunSocketInternal]\?.alpnProtocol;\n }\n [buntls](port, host) {\n return {\n socket: this.#socket,\n ALPNProtocols: this.ALPNProtocols,\n serverName: this.servername || host || \"localhost\",\n checkServerIdentity: this.#checkServerIdentity,\n session: this.#session,\n ...this.#secureContext\n };\n }\n});\n\nclass Server extends NetServer {\n key;\n cert;\n ca;\n passphrase;\n secureOptions;\n _rejectUnauthorized;\n _requestCert;\n servername;\n ALPNProtocols;\n constructor(options, secureConnectionListener) {\n super(options, secureConnectionListener);\n this.setSecureContext(options);\n }\n setSecureContext(options) {\n if (options instanceof InternalSecureContext)\n options = options.context;\n if (options) {\n const { ALPNProtocols } = options;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, this);\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.key = key;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.cert = cert;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.ca = ca;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n this.passphrase = passphrase;\n let servername = options.servername;\n if (servername && typeof servername !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n this.servername = servername;\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n this.secureOptions = secureOptions;\n const requestCert = options.requestCert || !1;\n if (requestCert)\n this._requestCert = requestCert;\n else\n this._requestCert = @undefined;\n const rejectUnauthorized = options.rejectUnauthorized || !1;\n if (rejectUnauthorized)\n this._rejectUnauthorized = rejectUnauthorized;\n else\n this._rejectUnauthorized = @undefined;\n }\n }\n getTicketKeys() {\n throw Error(\"Not implented in Bun yet\");\n }\n setTicketKeys() {\n throw Error(\"Not implented in Bun yet\");\n }\n [buntls](port, host, isClient) {\n return [\n {\n serverName: this.servername || host || \"localhost\",\n key: this.key,\n cert: this.cert,\n ca: this.ca,\n passphrase: this.passphrase,\n secureOptions: this.secureOptions,\n rejectUnauthorized: isClient \? !1 : this._rejectUnauthorized,\n requestCert: isClient \? !1 : this._requestCert,\n ALPNProtocols: this.ALPNProtocols\n },\n SocketClass\n ];\n }\n}\nvar CLIENT_RENEG_LIMIT = 3, CLIENT_RENEG_WINDOW = 600, DEFAULT_ECDH_CURVE = \"auto\", DEFAULT_CIPHERS = \"DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256\", DEFAULT_MIN_VERSION = \"TLSv1.2\", DEFAULT_MAX_VERSION = \"TLSv1.3\", createConnection = (port, host, connectListener) => {\n if (typeof port === \"object\") {\n port.checkServerIdentity;\n const { ALPNProtocols } = port;\n if (ALPNProtocols)\n convertALPNProtocols(ALPNProtocols, port);\n return new TLSSocket(port).connect(port, host, connectListener);\n }\n return new TLSSocket().connect(port, host, connectListener);\n}, connect = createConnection;\n$ = {\n CLIENT_RENEG_LIMIT,\n CLIENT_RENEG_WINDOW,\n connect,\n convertALPNProtocols,\n createConnection,\n createSecureContext,\n createServer,\n DEFAULT_CIPHERS,\n DEFAULT_ECDH_CURVE,\n DEFAULT_MAX_VERSION,\n DEFAULT_MIN_VERSION,\n getCiphers,\n parseCertString,\n SecureContext,\n Server,\n TLSSocket,\n checkServerIdentity,\n rootCertificates\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeTraceEventsCode = "(function (){\"use strict\";// src/js/out/tmp/node/trace_events.ts\nvar ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, createTracing = function(opts) {\n if (typeof opts !== \"object\" || opts == null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", opts);\n return new Tracing(opts);\n}, getEnabledCategories = function() {\n return \"\";\n}, $;\n\nclass Tracing {\n enabled = !1;\n categories = \"\";\n}\n$ = {\n createTracing,\n getEnabledCategories\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeTraceEventsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/trace_events.ts\nvar ERR_INVALID_ARG_TYPE = function(name, type, value) {\n const err = @makeTypeError(`The \"${name}\" argument must be of type ${type}. Received ${value}`);\n return err.code = \"ERR_INVALID_ARG_TYPE\", err;\n}, createTracing = function(opts) {\n if (typeof opts !== \"object\" || opts == null)\n throw new ERR_INVALID_ARG_TYPE(\"options\", \"Object\", opts);\n return new Tracing(opts);\n}, getEnabledCategories = function() {\n return \"\";\n}, $;\n\nclass Tracing {\n enabled = !1;\n categories = \"\";\n}\n$ = {\n createTracing,\n getEnabledCategories\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeTtyCode = "(function (){\"use strict\";// src/js/out/tmp/node/tty.ts\nvar ReadStream = function(fd) {\n if (!(this instanceof ReadStream))\n return new ReadStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19)).ReadStream.call(this, \"\", {\n fd\n });\n return stream.isRaw = !1, stream.isTTY = isatty(stream.fd), stream;\n}, warnOnDeactivatedColors = function(env) {\n if (warned)\n return;\n let name = \"\";\n if (env.NODE_DISABLE_COLORS !== void 0)\n name = \"NODE_DISABLE_COLORS\";\n if (env.NO_COLOR !== void 0) {\n if (name !== \"\")\n name += \"' and '\";\n name += \"NO_COLOR\";\n }\n if (name !== \"\")\n process.emitWarning(`The '${name}' env is ignored due to the 'FORCE_COLOR' env being set.`, \"Warning\"), warned = !0;\n}, WriteStream = function(fd) {\n if (!(this instanceof WriteStream))\n return new WriteStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19)).WriteStream.call(this, \"\", {\n fd\n });\n if (stream.columns = void 0, stream.rows = void 0, stream.isTTY = isatty(stream.fd), stream.isTTY) {\n const windowSizeArray = [0, 0];\n if (_getWindowSize(fd, windowSizeArray) === !0)\n stream.columns = windowSizeArray[0], stream.rows = windowSizeArray[1];\n }\n return stream;\n}, { ttySetMode, isatty, getWindowSize: _getWindowSize } = globalThis[globalThis.Symbol.for('Bun.lazy')](\"tty\");\nObject.defineProperty(ReadStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19)).ReadStream.prototype;\n return Object.defineProperty(ReadStream, \"prototype\", { value: Real }), ReadStream.prototype.setRawMode = function(flag) {\n const mode = flag \? 1 : 0, err = ttySetMode(this.fd, mode);\n if (err)\n return this.emit(\"error\", new Error(\"setRawMode failed with errno:\", err)), this;\n return this.isRaw = flag, this;\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar COLORS_2 = 1, COLORS_16 = 4, COLORS_256 = 8, COLORS_16m = 24, TERM_ENVS = {\n eterm: COLORS_16,\n cons25: COLORS_16,\n console: COLORS_16,\n cygwin: COLORS_16,\n dtterm: COLORS_16,\n gnome: COLORS_16,\n hurd: COLORS_16,\n jfbterm: COLORS_16,\n konsole: COLORS_16,\n kterm: COLORS_16,\n mlterm: COLORS_16,\n mosh: COLORS_16m,\n putty: COLORS_16,\n st: COLORS_16,\n \"rxvt-unicode-24bit\": COLORS_16m,\n terminator: COLORS_16m\n}, TERM_ENVS_REG_EXP = [/ansi/, /color/, /linux/, /^con[0-9]*x[0-9]/, /^rxvt/, /^screen/, /^xterm/, /^vt100/], warned = !1;\nObject.defineProperty(WriteStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 19) || @createInternalModuleById(19)).WriteStream.prototype;\n Object.defineProperty(WriteStream, \"prototype\", { value: Real }), WriteStream.prototype._refreshSize = function() {\n const oldCols = this.columns, oldRows = this.rows, windowSizeArray = [0, 0];\n if (_getWindowSize(this.fd, windowSizeArray) === !0) {\n if (oldCols !== windowSizeArray[0] || oldRows !== windowSizeArray[1])\n this.columns = windowSizeArray[0], this.rows = windowSizeArray[1], this.emit(\"resize\");\n }\n };\n var readline = void 0;\n return WriteStream.prototype.clearLine = function(dir, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).clearLine(this, dir, cb);\n }, WriteStream.prototype.clearScreenDown = function(cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).clearScreenDown(this, cb);\n }, WriteStream.prototype.cursorTo = function(x, y, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).cursorTo(this, x, y, cb);\n }, WriteStream.prototype.getColorDepth = function(env = process.env) {\n if (env.FORCE_COLOR !== void 0)\n switch (env.FORCE_COLOR) {\n case \"\":\n case \"1\":\n case \"true\":\n return warnOnDeactivatedColors(env), COLORS_16;\n case \"2\":\n return warnOnDeactivatedColors(env), COLORS_256;\n case \"3\":\n return warnOnDeactivatedColors(env), COLORS_16m;\n default:\n return COLORS_2;\n }\n if (env.NODE_DISABLE_COLORS !== void 0 || env.NO_COLOR !== void 0 || env.TERM === \"dumb\")\n return COLORS_2;\n if (env.TMUX)\n return COLORS_256;\n if (env.CI) {\n if ([\"APPVEYOR\", \"BUILDKITE\", \"CIRCLECI\", \"DRONE\", \"GITHUB_ACTIONS\", \"GITLAB_CI\", \"TRAVIS\"].some((sign) => (sign in env)) || env.CI_NAME === \"codeship\")\n return COLORS_256;\n return COLORS_2;\n }\n if (\"TEAMCITY_VERSION\" in env)\n return RegExpPrototypeExec(/^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/, env.TEAMCITY_VERSION) !== null \? COLORS_16 : COLORS_2;\n switch (env.TERM_PROGRAM) {\n case \"iTerm.app\":\n if (!env.TERM_PROGRAM_VERSION || RegExpPrototypeExec(/^[0-2]\\./, env.TERM_PROGRAM_VERSION) !== null)\n return COLORS_256;\n return COLORS_16m;\n case \"HyperTerm\":\n case \"MacTerm\":\n return COLORS_16m;\n case \"Apple_Terminal\":\n return COLORS_256;\n }\n if (env.COLORTERM === \"truecolor\" || env.COLORTERM === \"24bit\")\n return COLORS_16m;\n if (env.TERM) {\n if (RegExpPrototypeExec(/^xterm-256/, env.TERM) !== null)\n return COLORS_256;\n const termEnv = StringPrototypeToLowerCase(env.TERM);\n if (TERM_ENVS[termEnv])\n return TERM_ENVS[termEnv];\n if (ArrayPrototypeSome(TERM_ENVS_REG_EXP, (term) => RegExpPrototypeExec(term, termEnv) !== null))\n return COLORS_16;\n }\n if (env.COLORTERM)\n return COLORS_16;\n return COLORS_2;\n }, WriteStream.prototype.getWindowSize = function() {\n return [this.columns, this.rows];\n }, WriteStream.prototype.hasColors = function(count, env) {\n if (env === void 0 && (count === void 0 || typeof count === \"object\" && count !== null))\n env = count, count = 16;\n else\n validateInteger(count, \"count\", 2);\n return count <= 2 ** this.getColorDepth(env);\n }, WriteStream.prototype.moveCursor = function(dx, dy, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 33) || @createInternalModuleById(33)).moveCursor(this, dx, dy, cb);\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar validateInteger = (value, name, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!Number.isInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n};\nreturn { ReadStream, WriteStream, isatty }})\n"_s;
+static constexpr ASCIILiteral NodeTtyCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/tty.ts\nvar ReadStream = function(fd) {\n if (!(this instanceof ReadStream))\n return new ReadStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21)).ReadStream.@call(this, \"\", {\n fd\n });\n return Object.setPrototypeOf(stream, ReadStream.prototype), stream.isRaw = !1, stream.isTTY = !0, stream;\n}, warnOnDeactivatedColors = function(env) {\n if (warned)\n return;\n let name = \"\";\n if (env.NODE_DISABLE_COLORS !== @undefined)\n name = \"NODE_DISABLE_COLORS\";\n if (env.NO_COLOR !== @undefined) {\n if (name !== \"\")\n name += \"' and '\";\n name += \"NO_COLOR\";\n }\n if (name !== \"\")\n process.emitWarning(`The '${name}' env is ignored due to the 'FORCE_COLOR' env being set.`, \"Warning\"), warned = !0;\n}, WriteStream = function(fd) {\n if (!(this instanceof WriteStream))\n return new WriteStream(fd);\n if (fd >> 0 !== fd || fd < 0)\n @throwRangeError(\"fd must be a positive integer\");\n const stream = (@getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21)).WriteStream.@call(this, \"\", {\n fd\n });\n if (stream.columns = @undefined, stream.rows = @undefined, stream.isTTY = isatty(stream.fd), stream.isTTY) {\n const windowSizeArray = [0, 0];\n if (_getWindowSize(fd, windowSizeArray) === !0)\n stream.columns = windowSizeArray[0], stream.rows = windowSizeArray[1];\n }\n return stream;\n}, { ttySetMode, isatty, getWindowSize: _getWindowSize } = @lazy(\"tty\"), NumberIsInteger = Number.isInteger;\nObject.defineProperty(ReadStream, \"prototype\", {\n get() {\n const Prototype = Object.create((@getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21)).ReadStream.prototype);\n return Prototype.setRawMode = function(flag) {\n const mode = flag \? 1 : 0, err = ttySetMode(this.fd, mode);\n if (err)\n return this.emit(\"error\", new Error(\"setRawMode failed with errno: \" + err)), this;\n return this.isRaw = flag, this;\n }, Object.defineProperty(ReadStream, \"prototype\", { value: Prototype }), Prototype;\n },\n enumerable: !0,\n configurable: !0\n});\nvar COLORS_2 = 1, COLORS_16 = 4, COLORS_256 = 8, COLORS_16m = 24, TERM_ENVS = {\n eterm: COLORS_16,\n cons25: COLORS_16,\n console: COLORS_16,\n cygwin: COLORS_16,\n dtterm: COLORS_16,\n gnome: COLORS_16,\n hurd: COLORS_16,\n jfbterm: COLORS_16,\n konsole: COLORS_16,\n kterm: COLORS_16,\n mlterm: COLORS_16,\n mosh: COLORS_16m,\n putty: COLORS_16,\n st: COLORS_16,\n \"rxvt-unicode-24bit\": COLORS_16m,\n terminator: COLORS_16m\n}, TERM_ENVS_REG_EXP = [/ansi/, /color/, /linux/, /^con[0-9]*x[0-9]/, /^rxvt/, /^screen/, /^xterm/, /^vt100/], warned = !1;\nObject.defineProperty(WriteStream, \"prototype\", {\n get() {\n const Real = (@getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21)).WriteStream.prototype;\n Object.defineProperty(WriteStream, \"prototype\", { value: Real }), WriteStream.prototype._refreshSize = function() {\n const oldCols = this.columns, oldRows = this.rows, windowSizeArray = [0, 0];\n if (_getWindowSize(this.fd, windowSizeArray) === !0) {\n if (oldCols !== windowSizeArray[0] || oldRows !== windowSizeArray[1])\n this.columns = windowSizeArray[0], this.rows = windowSizeArray[1], this.emit(\"resize\");\n }\n };\n var readline = @undefined;\n return WriteStream.prototype.clearLine = function(dir, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).clearLine(this, dir, cb);\n }, WriteStream.prototype.clearScreenDown = function(cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).clearScreenDown(this, cb);\n }, WriteStream.prototype.cursorTo = function(x, y, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).cursorTo(this, x, y, cb);\n }, WriteStream.prototype.getColorDepth = function(env = process.env) {\n if (env.FORCE_COLOR !== @undefined)\n switch (env.FORCE_COLOR) {\n case \"\":\n case \"1\":\n case \"true\":\n return warnOnDeactivatedColors(env), COLORS_16;\n case \"2\":\n return warnOnDeactivatedColors(env), COLORS_256;\n case \"3\":\n return warnOnDeactivatedColors(env), COLORS_16m;\n default:\n return COLORS_2;\n }\n if (env.NODE_DISABLE_COLORS !== @undefined || env.NO_COLOR !== @undefined || env.TERM === \"dumb\")\n return COLORS_2;\n if (env.TMUX)\n return COLORS_256;\n if (env.CI) {\n if ([\"APPVEYOR\", \"BUILDKITE\", \"CIRCLECI\", \"DRONE\", \"GITHUB_ACTIONS\", \"GITLAB_CI\", \"TRAVIS\"].some((sign) => (sign in env)) || env.CI_NAME === \"codeship\")\n return COLORS_256;\n return COLORS_2;\n }\n if (\"TEAMCITY_VERSION\" in env)\n return /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) \? COLORS_16 : COLORS_2;\n switch (env.TERM_PROGRAM) {\n case \"iTerm.app\":\n if (!env.TERM_PROGRAM_VERSION || /^[0-2]\\./.test(env.TERM_PROGRAM_VERSION))\n return COLORS_256;\n return COLORS_16m;\n case \"HyperTerm\":\n case \"MacTerm\":\n return COLORS_16m;\n case \"Apple_Terminal\":\n return COLORS_256;\n }\n if (env.COLORTERM === \"truecolor\" || env.COLORTERM === \"24bit\")\n return COLORS_16m;\n if (env.TERM) {\n if (/^xterm-256/.test(env.TERM) !== null)\n return COLORS_256;\n const termEnv = env.TERM.toLowerCase();\n if (TERM_ENVS[termEnv])\n return TERM_ENVS[termEnv];\n if (TERM_ENVS_REG_EXP.some((term) => term.test(termEnv)))\n return COLORS_16;\n }\n if (env.COLORTERM)\n return COLORS_16;\n return COLORS_2;\n }, WriteStream.prototype.getWindowSize = function() {\n return [this.columns, this.rows];\n }, WriteStream.prototype.hasColors = function(count, env) {\n if (env === @undefined && (count === @undefined || typeof count === \"object\" && count !== null))\n env = count, count = 16;\n else\n validateInteger(count, \"count\", 2);\n return count <= 2 ** this.getColorDepth(env);\n }, WriteStream.prototype.moveCursor = function(dx, dy, cb) {\n return (readline \?\?= @getInternalField(@internalModuleRegistry, 35) || @createInternalModuleById(35)).moveCursor(this, dx, dy, cb);\n }, Real;\n },\n enumerable: !0,\n configurable: !0\n});\nvar validateInteger = (value, name, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) => {\n if (typeof value !== \"number\")\n throw new ERR_INVALID_ARG_TYPE(name, \"number\", value);\n if (!NumberIsInteger(value))\n throw new ERR_OUT_OF_RANGE(name, \"an integer\", value);\n if (value < min || value > max)\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);\n};\nreturn { ReadStream, WriteStream, isatty }})\n");
//
//
-static constexpr ASCIILiteral NodeUrlCode = "(function (){\"use strict\";// src/js/out/tmp/node/url.ts\nvar Url = function() {\n this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;\n}, urlParse = function(url, parseQueryString, slashesDenoteHost) {\n if (url && typeof url === \"object\" && url instanceof Url)\n return url;\n var u = new Url;\n return u.parse(url, parseQueryString, slashesDenoteHost), u;\n}, urlFormat = function(obj) {\n if (typeof obj === \"string\")\n obj = urlParse(obj);\n if (!(obj instanceof Url))\n return Url.prototype.format.call(obj);\n return obj.format();\n}, urlResolve = function(source, relative) {\n return urlParse(source, !1, !0).resolve(relative);\n}, urlResolveObject = function(source, relative) {\n if (!source)\n return relative;\n return urlParse(source, !1, !0).resolveObject(relative);\n}, urlToHttpOptions = function(url) {\n const options = {\n protocol: url.protocol,\n hostname: typeof url.hostname === \"string\" && url.hostname.startsWith(\"[\") \? url.hostname.slice(1, -1) : url.hostname,\n hash: url.hash,\n search: url.search,\n pathname: url.pathname,\n path: `${url.pathname || \"\"}${url.search || \"\"}`,\n href: url.href\n };\n if (url.port !== \"\")\n options.port = Number(url.port);\n if (url.username || url.password)\n options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;\n return options;\n}, $, { URL, URLSearchParams } = globalThis;\nUrl.prototype = {};\nvar protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, simplePathPattern = /^(\\/\\/\?(\?!\\/)[^\?\\s]*)(\\\?[^\\s]*)\?$/, delims = [\"<\", \">\", '\"', \"`\", \" \", \"\\r\", \"\\n\", \"\\t\"], unwise = [\"{\", \"}\", \"|\", \"\\\\\", \"^\", \"`\"].concat(delims), autoEscape = [\"'\"].concat(unwise), nonHostChars = [\"%\", \"/\", \"\?\", \";\", \"#\"].concat(autoEscape), hostEndingChars = [\"/\", \"\?\", \"#\"], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, unsafeProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, hostlessProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, slashedProtocol = {\n http: !0,\n https: !0,\n ftp: !0,\n gopher: !0,\n file: !0,\n \"http:\": !0,\n \"https:\": !0,\n \"ftp:\": !0,\n \"gopher:\": !0,\n \"file:\": !0\n};\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (typeof url !== \"string\")\n @throwTypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n var queryIndex = url.indexOf(\"\?\"), splitter = queryIndex !== -1 && queryIndex < url.indexOf(\"#\") \? \"\?\" : \"#\", uSplit = url.split(splitter), slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, \"/\"), url = uSplit.join(splitter);\n var rest = url;\n if (rest = rest.trim(), !slashesDenoteHost && url.split(\"#\").length === 1) {\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n if (this.path = rest, this.href = rest, this.pathname = simplePath[1], simplePath[2])\n if (this.search = simplePath[2], parseQueryString)\n this.query = new URLSearchParams(this.search.substr(1)).toJSON();\n else\n this.query = this.search.substr(1);\n else if (parseQueryString)\n this.search = \"\", this.query = {};\n return this;\n }\n }\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto, rest = rest.substr(proto.length);\n }\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@/]+@[^@/]+/)) {\n var slashes = rest.substr(0, 2) === \"//\";\n if (slashes && !(proto && hostlessProtocol[proto]))\n rest = rest.substr(2), this.slashes = !0;\n }\n if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {\n var hostEnd = -1;\n for (var i = 0;i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n var auth, atSign;\n if (hostEnd === -1)\n atSign = rest.lastIndexOf(\"@\");\n else\n atSign = rest.lastIndexOf(\"@\", hostEnd);\n if (atSign !== -1)\n auth = rest.slice(0, atSign), rest = rest.slice(atSign + 1), this.auth = decodeURIComponent(auth);\n hostEnd = -1;\n for (var i = 0;i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n if (hostEnd === -1)\n hostEnd = rest.length;\n this.host = rest.slice(0, hostEnd), rest = rest.slice(hostEnd), this.parseHost(), this.hostname = this.hostname || \"\";\n var ipv6Hostname = this.hostname[0] === \"[\" && this.hostname[this.hostname.length - 1] === \"]\";\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length;i < l; i++) {\n var part = hostparts[i];\n if (!part)\n continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = \"\";\n for (var j = 0, k = part.length;j < k; j++)\n if (part.charCodeAt(j) > 127)\n newpart += \"x\";\n else\n newpart += part[j];\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i), notHost = hostparts.slice(i + 1), bit = part.match(hostnamePartStart);\n if (bit)\n validParts.push(bit[1]), notHost.unshift(bit[2]);\n if (notHost.length)\n rest = \"/\" + notHost.join(\".\") + rest;\n this.hostname = validParts.join(\".\");\n break;\n }\n }\n }\n }\n if (this.hostname.length > hostnameMaxLen)\n this.hostname = \"\";\n else\n this.hostname = this.hostname.toLowerCase();\n if (!ipv6Hostname)\n this.hostname = new URL(\"http://\" + this.hostname).hostname;\n var p = this.port \? \":\" + this.port : \"\", h = this.hostname || \"\";\n if (this.host = h + p, this.href += this.host, ipv6Hostname) {\n if (this.hostname = this.hostname.substr(1, this.hostname.length - 2), rest[0] !== \"/\")\n rest = \"/\" + rest;\n }\n }\n if (!unsafeProtocol[lowerProto])\n for (var i = 0, l = autoEscape.length;i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae)\n esc = escape(ae);\n rest = rest.split(ae).join(esc);\n }\n var hash = rest.indexOf(\"#\");\n if (hash !== -1)\n this.hash = rest.substr(hash), rest = rest.slice(0, hash);\n var qm = rest.indexOf(\"\?\");\n if (qm !== -1) {\n if (this.search = rest.substr(qm), this.query = rest.substr(qm + 1), parseQueryString)\n this.query = new URLSearchParams(this.query);\n rest = rest.slice(0, qm);\n } else if (parseQueryString)\n this.search = \"\", this.query = {};\n if (rest)\n this.pathname = rest;\n if (slashedProtocol[lowerProto] && this.hostname && !this.pathname)\n this.pathname = \"/\";\n if (this.pathname || this.search) {\n var p = this.pathname || \"\", s = this.search || \"\";\n this.path = p + s;\n }\n return this.href = this.format(), this;\n};\nUrl.prototype.format = function() {\n var auth = this.auth || \"\";\n if (auth)\n auth = encodeURIComponent(auth), auth = auth.replace(/%3A/i, \":\"), auth += \"@\";\n var protocol = this.protocol || \"\", pathname = this.pathname || \"\", hash = this.hash || \"\", host = !1, query = \"\";\n if (this.host)\n host = auth + this.host;\n else if (this.hostname) {\n if (host = auth + (this.hostname.indexOf(\":\") === -1 \? this.hostname : \"[\" + this.hostname + \"]\"), this.port)\n host += \":\" + this.port;\n }\n if (this.query && typeof this.query === \"object\" && Object.keys(this.query).length)\n query = new URLSearchParams(this.query).toString();\n var search = this.search || query && \"\?\" + query || \"\";\n if (protocol && protocol.substr(-1) !== \":\")\n protocol += \":\";\n if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== !1) {\n if (host = \"//\" + (host || \"\"), pathname && pathname.charAt(0) !== \"/\")\n pathname = \"/\" + pathname;\n } else if (!host)\n host = \"\";\n if (hash && hash.charAt(0) !== \"#\")\n hash = \"#\" + hash;\n if (search && search.charAt(0) !== \"\?\")\n search = \"\?\" + search;\n return pathname = pathname.replace(/[\?#]/g, function(match) {\n return encodeURIComponent(match);\n }), search = search.replace(\"#\", \"%23\"), protocol + host + pathname + search + hash;\n};\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, !1, !0)).format();\n};\nUrl.prototype.resolveObject = function(relative) {\n if (typeof relative === \"string\") {\n var rel = new Url;\n rel.parse(relative, !1, !0), relative = rel;\n }\n var result = new Url, tkeys = Object.keys(this);\n for (var tk = 0;tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n if (result.hash = relative.hash, relative.href === \"\")\n return result.href = result.format(), result;\n if (relative.slashes && !relative.protocol) {\n var rkeys = Object.keys(relative);\n for (var rk = 0;rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== \"protocol\")\n result[rkey] = relative[rkey];\n }\n if (slashedProtocol[result.protocol] && result.hostname && !result.pathname)\n result.pathname = \"/\", result.path = result.pathname;\n return result.href = result.format(), result;\n }\n if (relative.protocol && relative.protocol !== result.protocol) {\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0;v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n return result.href = result.format(), result;\n }\n if (result.protocol = relative.protocol, !relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || \"\").split(\"/\");\n while (relPath.length && !(relative.host = relPath.shift()))\n ;\n if (!relative.host)\n relative.host = \"\";\n if (!relative.hostname)\n relative.hostname = \"\";\n if (relPath[0] !== \"\")\n relPath.unshift(\"\");\n if (relPath.length < 2)\n relPath.unshift(\"\");\n result.pathname = relPath.join(\"/\");\n } else\n result.pathname = relative.pathname;\n if (result.search = relative.search, result.query = relative.query, result.host = relative.host || \"\", result.auth = relative.auth, result.hostname = relative.hostname || relative.host, result.port = relative.port, result.pathname || result.search) {\n var p = result.pathname || \"\", s = result.search || \"\";\n result.path = p + s;\n }\n return result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n }\n var isSourceAbs = result.pathname && result.pathname.charAt(0) === \"/\", isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === \"/\", mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split(\"/\") || [], relPath = relative.pathname && relative.pathname.split(\"/\") || [], psychotic = result.protocol && !slashedProtocol[result.protocol];\n if (psychotic) {\n if (result.hostname = \"\", result.port = null, result.host)\n if (srcPath[0] === \"\")\n srcPath[0] = result.host;\n else\n srcPath.unshift(result.host);\n if (result.host = \"\", relative.protocol) {\n if (relative.hostname = null, relative.port = null, relative.host)\n if (relPath[0] === \"\")\n relPath[0] = relative.host;\n else\n relPath.unshift(relative.host);\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === \"\" || srcPath[0] === \"\");\n }\n if (isRelAbs)\n result.host = relative.host || relative.host === \"\" \? relative.host : result.host, result.hostname = relative.hostname || relative.hostname === \"\" \? relative.hostname : result.hostname, result.search = relative.search, result.query = relative.query, srcPath = relPath;\n else if (relPath.length) {\n if (!srcPath)\n srcPath = [];\n srcPath.pop(), srcPath = srcPath.concat(relPath), result.search = relative.search, result.query = relative.query;\n } else if (relative.search != null) {\n if (psychotic) {\n result.host = srcPath.shift(), result.hostname = result.host;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (result.search = relative.search, result.query = relative.query, result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.href = result.format(), result;\n }\n if (!srcPath.length) {\n if (result.pathname = null, result.search)\n result.path = \"/\" + result.search;\n else\n result.path = null;\n return result.href = result.format(), result;\n }\n var last = srcPath.slice(-1)[0], hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === \".\" || last === \"..\") || last === \"\", up = 0;\n for (var i = srcPath.length;i >= 0; i--)\n if (last = srcPath[i], last === \".\")\n srcPath.splice(i, 1);\n else if (last === \"..\")\n srcPath.splice(i, 1), up++;\n else if (up)\n srcPath.splice(i, 1), up--;\n if (!mustEndAbs && !removeAllDots)\n for (;up--; up)\n srcPath.unshift(\"..\");\n if (mustEndAbs && srcPath[0] !== \"\" && (!srcPath[0] || srcPath[0].charAt(0) !== \"/\"))\n srcPath.unshift(\"\");\n if (hasTrailingSlash && srcPath.join(\"/\").substr(-1) !== \"/\")\n srcPath.push(\"\");\n var isAbsolute = srcPath[0] === \"\" || srcPath[0] && srcPath[0].charAt(0) === \"/\";\n if (psychotic) {\n result.hostname = isAbsolute \? \"\" : srcPath.length \? srcPath.shift() : \"\", result.host = result.hostname;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (mustEndAbs = mustEndAbs || result.host && srcPath.length, mustEndAbs && !isAbsolute)\n srcPath.unshift(\"\");\n if (srcPath.length > 0)\n result.pathname = srcPath.join(\"/\");\n else\n result.pathname = null, result.path = null;\n if (result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.auth = relative.auth || result.auth, result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n};\nUrl.prototype.parseHost = function() {\n var host = this.host, port = portPattern.exec(host);\n if (port) {\n if (port = port[0], port !== \":\")\n this.port = port.substr(1);\n host = host.substr(0, host.length - port.length);\n }\n if (host)\n this.hostname = host;\n};\nvar pathToFileURL = globalThis[globalThis.Symbol.for('Bun.lazy')](\"pathToFileURL\"), fileURLToPath = globalThis[globalThis.Symbol.for('Bun.lazy')](\"fileURLToPath\");\n$ = {\n parse: urlParse,\n resolve: urlResolve,\n resolveObject: urlResolveObject,\n format: urlFormat,\n Url,\n URLSearchParams,\n URL,\n pathToFileURL,\n fileURLToPath,\n urlToHttpOptions\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeUrlCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/url.ts\nvar Url = function() {\n this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;\n}, urlParse = function(url, parseQueryString, slashesDenoteHost) {\n if (url && typeof url === \"object\" && url instanceof Url)\n return url;\n var u = new Url;\n return u.parse(url, parseQueryString, slashesDenoteHost), u;\n}, urlFormat = function(obj) {\n if (typeof obj === \"string\")\n obj = urlParse(obj);\n if (!(obj instanceof Url))\n return Url.prototype.format.@call(obj);\n return obj.format();\n}, urlResolve = function(source, relative) {\n return urlParse(source, !1, !0).resolve(relative);\n}, urlResolveObject = function(source, relative) {\n if (!source)\n return relative;\n return urlParse(source, !1, !0).resolveObject(relative);\n}, urlToHttpOptions = function(url) {\n const options = {\n protocol: url.protocol,\n hostname: typeof url.hostname === \"string\" && url.hostname.startsWith(\"[\") \? url.hostname.slice(1, -1) : url.hostname,\n hash: url.hash,\n search: url.search,\n pathname: url.pathname,\n path: `${url.pathname || \"\"}${url.search || \"\"}`,\n href: url.href\n };\n if (url.port !== \"\")\n options.port = Number(url.port);\n if (url.username || url.password)\n options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;\n return options;\n}, $, { URL, URLSearchParams } = globalThis;\nUrl.prototype = {};\nvar protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, simplePathPattern = /^(\\/\\/\?(\?!\\/)[^\?\\s]*)(\\\?[^\\s]*)\?$/, delims = [\"<\", \">\", '\"', \"`\", \" \", \"\\r\", \"\\n\", \"\\t\"], unwise = [\"{\", \"}\", \"|\", \"\\\\\", \"^\", \"`\"].concat(delims), autoEscape = [\"'\"].concat(unwise), nonHostChars = [\"%\", \"/\", \"\?\", \";\", \"#\"].concat(autoEscape), hostEndingChars = [\"/\", \"\?\", \"#\"], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, unsafeProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, hostlessProtocol = {\n javascript: !0,\n \"javascript:\": !0\n}, slashedProtocol = {\n http: !0,\n https: !0,\n ftp: !0,\n gopher: !0,\n file: !0,\n \"http:\": !0,\n \"https:\": !0,\n \"ftp:\": !0,\n \"gopher:\": !0,\n \"file:\": !0\n};\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (typeof url !== \"string\")\n @throwTypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n var queryIndex = url.indexOf(\"\?\"), splitter = queryIndex !== -1 && queryIndex < url.indexOf(\"#\") \? \"\?\" : \"#\", uSplit = url.split(splitter), slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, \"/\"), url = uSplit.join(splitter);\n var rest = url;\n if (rest = rest.trim(), !slashesDenoteHost && url.split(\"#\").length === 1) {\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n if (this.path = rest, this.href = rest, this.pathname = simplePath[1], simplePath[2])\n if (this.search = simplePath[2], parseQueryString)\n this.query = new URLSearchParams(this.search.substr(1)).toJSON();\n else\n this.query = this.search.substr(1);\n else if (parseQueryString)\n this.search = \"\", this.query = {};\n return this;\n }\n }\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto, rest = rest.substr(proto.length);\n }\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@/]+@[^@/]+/)) {\n var slashes = rest.substr(0, 2) === \"//\";\n if (slashes && !(proto && hostlessProtocol[proto]))\n rest = rest.substr(2), this.slashes = !0;\n }\n if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {\n var hostEnd = -1;\n for (var i = 0;i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n var auth, atSign;\n if (hostEnd === -1)\n atSign = rest.lastIndexOf(\"@\");\n else\n atSign = rest.lastIndexOf(\"@\", hostEnd);\n if (atSign !== -1)\n auth = rest.slice(0, atSign), rest = rest.slice(atSign + 1), this.auth = decodeURIComponent(auth);\n hostEnd = -1;\n for (var i = 0;i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n if (hostEnd === -1)\n hostEnd = rest.length;\n this.host = rest.slice(0, hostEnd), rest = rest.slice(hostEnd), this.parseHost(), this.hostname = this.hostname || \"\";\n var ipv6Hostname = this.hostname[0] === \"[\" && this.hostname[this.hostname.length - 1] === \"]\";\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length;i < l; i++) {\n var part = hostparts[i];\n if (!part)\n continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = \"\";\n for (var j = 0, k = part.length;j < k; j++)\n if (part.charCodeAt(j) > 127)\n newpart += \"x\";\n else\n newpart += part[j];\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i), notHost = hostparts.slice(i + 1), bit = part.match(hostnamePartStart);\n if (bit)\n validParts.push(bit[1]), notHost.unshift(bit[2]);\n if (notHost.length)\n rest = \"/\" + notHost.join(\".\") + rest;\n this.hostname = validParts.join(\".\");\n break;\n }\n }\n }\n }\n if (this.hostname.length > hostnameMaxLen)\n this.hostname = \"\";\n else\n this.hostname = this.hostname.toLowerCase();\n if (!ipv6Hostname)\n this.hostname = new URL(\"http://\" + this.hostname).hostname;\n var p = this.port \? \":\" + this.port : \"\", h = this.hostname || \"\";\n if (this.host = h + p, this.href += this.host, ipv6Hostname) {\n if (this.hostname = this.hostname.substr(1, this.hostname.length - 2), rest[0] !== \"/\")\n rest = \"/\" + rest;\n }\n }\n if (!unsafeProtocol[lowerProto])\n for (var i = 0, l = autoEscape.length;i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae)\n esc = escape(ae);\n rest = rest.split(ae).join(esc);\n }\n var hash = rest.indexOf(\"#\");\n if (hash !== -1)\n this.hash = rest.substr(hash), rest = rest.slice(0, hash);\n var qm = rest.indexOf(\"\?\");\n if (qm !== -1) {\n if (this.search = rest.substr(qm), this.query = rest.substr(qm + 1), parseQueryString) {\n const query = this.query;\n this.query = new URLSearchParams(query).toJSON();\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString)\n this.search = \"\", this.query = {};\n if (rest)\n this.pathname = rest;\n if (slashedProtocol[lowerProto] && this.hostname && !this.pathname)\n this.pathname = \"/\";\n if (this.pathname || this.search) {\n var p = this.pathname || \"\", s = this.search || \"\";\n this.path = p + s;\n }\n return this.href = this.format(), this;\n};\nUrl.prototype.format = function() {\n var auth = this.auth || \"\";\n if (auth)\n auth = encodeURIComponent(auth), auth = auth.replace(/%3A/i, \":\"), auth += \"@\";\n var protocol = this.protocol || \"\", pathname = this.pathname || \"\", hash = this.hash || \"\", host = !1, query = \"\";\n if (this.host)\n host = auth + this.host;\n else if (this.hostname) {\n if (host = auth + (this.hostname.indexOf(\":\") === -1 \? this.hostname : \"[\" + this.hostname + \"]\"), this.port)\n host += \":\" + this.port;\n }\n if (this.query && typeof this.query === \"object\" && Object.keys(this.query).length)\n query = new URLSearchParams(this.query).toString();\n var search = this.search || query && \"\?\" + query || \"\";\n if (protocol && protocol.substr(-1) !== \":\")\n protocol += \":\";\n if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== !1) {\n if (host = \"//\" + (host || \"\"), pathname && pathname.charAt(0) !== \"/\")\n pathname = \"/\" + pathname;\n } else if (!host)\n host = \"\";\n if (hash && hash.charAt(0) !== \"#\")\n hash = \"#\" + hash;\n if (search && search.charAt(0) !== \"\?\")\n search = \"\?\" + search;\n return pathname = pathname.replace(/[\?#]/g, function(match) {\n return encodeURIComponent(match);\n }), search = search.replace(\"#\", \"%23\"), protocol + host + pathname + search + hash;\n};\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, !1, !0)).format();\n};\nUrl.prototype.resolveObject = function(relative) {\n if (typeof relative === \"string\") {\n var rel = new Url;\n rel.parse(relative, !1, !0), relative = rel;\n }\n var result = new Url, tkeys = Object.keys(this);\n for (var tk = 0;tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n if (result.hash = relative.hash, relative.href === \"\")\n return result.href = result.format(), result;\n if (relative.slashes && !relative.protocol) {\n var rkeys = Object.keys(relative);\n for (var rk = 0;rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== \"protocol\")\n result[rkey] = relative[rkey];\n }\n if (slashedProtocol[result.protocol] && result.hostname && !result.pathname)\n result.pathname = \"/\", result.path = result.pathname;\n return result.href = result.format(), result;\n }\n if (relative.protocol && relative.protocol !== result.protocol) {\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0;v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n return result.href = result.format(), result;\n }\n if (result.protocol = relative.protocol, !relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || \"\").split(\"/\");\n while (relPath.length && !(relative.host = relPath.shift()))\n ;\n if (!relative.host)\n relative.host = \"\";\n if (!relative.hostname)\n relative.hostname = \"\";\n if (relPath[0] !== \"\")\n relPath.unshift(\"\");\n if (relPath.length < 2)\n relPath.unshift(\"\");\n result.pathname = relPath.join(\"/\");\n } else\n result.pathname = relative.pathname;\n if (result.search = relative.search, result.query = relative.query, result.host = relative.host || \"\", result.auth = relative.auth, result.hostname = relative.hostname || relative.host, result.port = relative.port, result.pathname || result.search) {\n var p = result.pathname || \"\", s = result.search || \"\";\n result.path = p + s;\n }\n return result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n }\n var isSourceAbs = result.pathname && result.pathname.charAt(0) === \"/\", isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === \"/\", mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split(\"/\") || [], relPath = relative.pathname && relative.pathname.split(\"/\") || [], psychotic = result.protocol && !slashedProtocol[result.protocol];\n if (psychotic) {\n if (result.hostname = \"\", result.port = null, result.host)\n if (srcPath[0] === \"\")\n srcPath[0] = result.host;\n else\n srcPath.unshift(result.host);\n if (result.host = \"\", relative.protocol) {\n if (relative.hostname = null, relative.port = null, relative.host)\n if (relPath[0] === \"\")\n relPath[0] = relative.host;\n else\n relPath.unshift(relative.host);\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === \"\" || srcPath[0] === \"\");\n }\n if (isRelAbs)\n result.host = relative.host || relative.host === \"\" \? relative.host : result.host, result.hostname = relative.hostname || relative.hostname === \"\" \? relative.hostname : result.hostname, result.search = relative.search, result.query = relative.query, srcPath = relPath;\n else if (relPath.length) {\n if (!srcPath)\n srcPath = [];\n srcPath.pop(), srcPath = srcPath.concat(relPath), result.search = relative.search, result.query = relative.query;\n } else if (relative.search != null) {\n if (psychotic) {\n result.host = srcPath.shift(), result.hostname = result.host;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (result.search = relative.search, result.query = relative.query, result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.href = result.format(), result;\n }\n if (!srcPath.length) {\n if (result.pathname = null, result.search)\n result.path = \"/\" + result.search;\n else\n result.path = null;\n return result.href = result.format(), result;\n }\n var last = srcPath.slice(-1)[0], hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === \".\" || last === \"..\") || last === \"\", up = 0;\n for (var i = srcPath.length;i >= 0; i--)\n if (last = srcPath[i], last === \".\")\n srcPath.splice(i, 1);\n else if (last === \"..\")\n srcPath.splice(i, 1), up++;\n else if (up)\n srcPath.splice(i, 1), up--;\n if (!mustEndAbs && !removeAllDots)\n for (;up--; up)\n srcPath.unshift(\"..\");\n if (mustEndAbs && srcPath[0] !== \"\" && (!srcPath[0] || srcPath[0].charAt(0) !== \"/\"))\n srcPath.unshift(\"\");\n if (hasTrailingSlash && srcPath.join(\"/\").substr(-1) !== \"/\")\n srcPath.push(\"\");\n var isAbsolute = srcPath[0] === \"\" || srcPath[0] && srcPath[0].charAt(0) === \"/\";\n if (psychotic) {\n result.hostname = isAbsolute \? \"\" : srcPath.length \? srcPath.shift() : \"\", result.host = result.hostname;\n var authInHost = result.host && result.host.indexOf(\"@\") > 0 \? result.host.split(\"@\") : !1;\n if (authInHost)\n result.auth = authInHost.shift(), result.hostname = authInHost.shift(), result.host = result.hostname;\n }\n if (mustEndAbs = mustEndAbs || result.host && srcPath.length, mustEndAbs && !isAbsolute)\n srcPath.unshift(\"\");\n if (srcPath.length > 0)\n result.pathname = srcPath.join(\"/\");\n else\n result.pathname = null, result.path = null;\n if (result.pathname !== null || result.search !== null)\n result.path = (result.pathname \? result.pathname : \"\") + (result.search \? result.search : \"\");\n return result.auth = relative.auth || result.auth, result.slashes = result.slashes || relative.slashes, result.href = result.format(), result;\n};\nUrl.prototype.parseHost = function() {\n var host = this.host, port = portPattern.exec(host);\n if (port) {\n if (port = port[0], port !== \":\")\n this.port = port.substr(1);\n host = host.substr(0, host.length - port.length);\n }\n if (host)\n this.hostname = host;\n};\nvar pathToFileURL = @lazy(\"pathToFileURL\"), fileURLToPath = @lazy(\"fileURLToPath\");\n$ = {\n parse: urlParse,\n resolve: urlResolve,\n resolveObject: urlResolveObject,\n format: urlFormat,\n Url,\n URLSearchParams,\n URL,\n pathToFileURL,\n fileURLToPath,\n urlToHttpOptions\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeUtilCode = "(function (){\"use strict\";// src/js/out/tmp/node/util.ts\nvar isBufferInterface = function({ copy, fill, readUint8 }) {\n return typeof copy === \"function\" && typeof fill === \"function\" && typeof readUint8 === \"function\";\n}, isBuffer = function(value) {\n return Buffer.isBuffer(value) || typeof value === \"object\" && isBufferInterface(value || {});\n}, isFunction = function(value) {\n return typeof value === \"function\";\n}, formatWithOptions = function(inspectOptions, f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0;i < arguments.length; i++)\n objects.push(inspect(arguments[i], inspectOptions));\n return objects.join(\" \");\n }\n var i = 2, args = arguments, len = args.length, str = String(f).replace(formatRegExp, function(x2) {\n if (x2 === \"%%\")\n return \"%\";\n if (i >= len)\n return x2;\n switch (x2) {\n case \"%s\":\n return String(args[i++]);\n case \"%f\":\n return Number(args[i++]);\n case \"%d\":\n return Math.round(Number(args[i++]));\n case \"%j\":\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return \"[Circular]\";\n }\n case \"%o\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n case \"%O\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n default:\n return x2;\n }\n });\n for (var x = args[i];i < len; x = args[++i])\n if (isNull(x) || !isObject(x))\n str += \" \" + x;\n else\n str += \" \" + inspect(x, inspectOptions);\n return str;\n}, format = function(...args) {\n return formatWithOptions({}, ...args);\n}, deprecate = function(fn, msg, code) {\n if (process.noDeprecation === !0)\n return fn;\n var warned = !1;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n var err = new Error(msg);\n if (code)\n err.code = code;\n throw err;\n } else if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n warned = !0;\n }\n return fn.apply(this, arguments);\n }\n return deprecated;\n}, debuglog = function(set) {\n if (set = set.toUpperCase(), !debugs[set])\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = format.apply(cjs_exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else\n debugs[set] = function() {\n };\n return debugs[set];\n}, inspect = function(obj, opts) {\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n if (arguments.length >= 3)\n ctx.depth = arguments[2];\n if (arguments.length >= 4)\n ctx.colors = arguments[3];\n if (isBoolean(opts))\n ctx.showHidden = opts;\n else if (opts)\n _extend(ctx, opts);\n if (isUndefined(ctx.showHidden))\n ctx.showHidden = !1;\n if (isUndefined(ctx.depth))\n ctx.depth = 2;\n if (isUndefined(ctx.colors))\n ctx.colors = !1;\n if (isUndefined(ctx.customInspect))\n ctx.customInspect = !0;\n if (ctx.colors)\n ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}, stylizeWithColor = function(str, styleType) {\n const style = inspect.styles[styleType];\n if (style !== void 0) {\n const color = inspect.colors[style];\n if (color !== void 0)\n return `\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`;\n }\n return str;\n}, stylizeNoColor = function(str, styleType) {\n return str;\n}, arrayToHash = function(array) {\n var hash = {};\n return array.forEach(function(val, idx) {\n hash[val] = !0;\n }), hash;\n}, formatValue = function(ctx, value, recurseTimes) {\n if (ctx.customInspect && value) {\n const customInspect = value[kInspectCustom];\n if (isFunction(customInspect)) {\n var ret = customInspect.call(value, recurseTimes, ctx, inspect);\n if (!isString(ret))\n ret = formatValue(ctx, ret, recurseTimes);\n return ret;\n }\n }\n var primitive = formatPrimitive(ctx, value);\n if (primitive)\n return primitive;\n var keys = Object.keys(value).concat(Object.getOwnPropertySymbols(value)), visibleKeys = arrayToHash(keys);\n if (ctx.showHidden)\n keys = Object.getOwnPropertyNames(value);\n if (isError(value) && (keys.indexOf(\"message\") >= 0 || keys.indexOf(\"description\") >= 0))\n return formatError(value);\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name \? \": \" + value.name : \"\";\n return ctx.stylize(\"[Function\" + name + \"]\", \"special\");\n }\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n if (isDate(value))\n return ctx.stylize(Date.prototype.toString.call(value), \"date\");\n if (isError(value))\n return formatError(value);\n }\n var base = \"\", array = !1, braces = [\"{\", \"}\"];\n if (@isArray(value))\n array = !0, braces = [\"[\", \"]\"];\n if (isFunction(value)) {\n var n = value.name \? \": \" + value.name : \"\";\n base = \" [Function\" + n + \"]\";\n }\n if (isRegExp(value))\n base = \" \" + RegExp.prototype.toString.call(value);\n if (isDate(value))\n base = \" \" + Date.prototype.toUTCString.call(value);\n if (isError(value))\n base = \" \" + formatError(value);\n if (keys.length === 0 && (!array || value.length == 0))\n return braces[0] + base + braces[1];\n if (recurseTimes < 0)\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n else\n return ctx.stylize(\"[Object]\", \"special\");\n ctx.seen.push(value);\n var output;\n if (array)\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n else\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n return ctx.seen.pop(), reduceToSingleString(output, base, braces);\n}, formatPrimitive = function(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize(\"undefined\", \"undefined\");\n if (isString(value)) {\n var simple = \"'\" + JSON.stringify(value).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return ctx.stylize(simple, \"string\");\n }\n if (isNumber(value))\n return ctx.stylize(\"\" + value, \"number\");\n if (isBoolean(value))\n return ctx.stylize(\"\" + value, \"boolean\");\n if (isNull(value))\n return ctx.stylize(\"null\", \"null\");\n}, formatError = function(value) {\n return \"[\" + Error.prototype.toString.call(value) + \"]\";\n}, formatArray = function(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length;i < l; ++i)\n if (hasOwnProperty(value, String(i)))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), !0));\n else\n output.push(\"\");\n return keys.forEach(function(key) {\n if (!key.match(/^\\d+$/))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, !0));\n }), output;\n}, formatProperty = function(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n if (desc = Object.getOwnPropertyDescriptor(value, key) || {\n value: value[key]\n }, desc.get)\n if (desc.set)\n str = ctx.stylize(\"[Getter/Setter]\", \"special\");\n else\n str = ctx.stylize(\"[Getter]\", \"special\");\n else if (desc.set)\n str = ctx.stylize(\"[Setter]\", \"special\");\n if (!hasOwnProperty(visibleKeys, key))\n name = \"[\" + (typeof key === \"symbol\" \? key.description : key) + \"]\";\n if (typeof key === \"symbol\")\n name = \"[\" + ctx.stylize(`Symbol(${key.description})`, \"string\") + \"]\";\n if (!str)\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes))\n str = formatValue(ctx, desc.value, null);\n else\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n if (str.indexOf(\"\\n\") > -1)\n if (array)\n str = str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\").substr(2);\n else\n str = \"\\n\" + str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\");\n } else\n str = ctx.stylize(\"[Circular]\", \"special\");\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/))\n return str;\n if (name = JSON.stringify(\"\" + key), name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/))\n name = name.substr(1, name.length - 2), name = ctx.stylize(name, \"name\");\n else\n name = name.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\"), name = ctx.stylize(name, \"string\");\n }\n return name + \": \" + str;\n}, reduceToSingleString = function(output, base, braces) {\n var numLinesEst = 0, length = output.reduce(function(prev, cur) {\n if (numLinesEst++, cur.indexOf(\"\\n\") >= 0)\n numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d\?m/g, \"\").length + 1;\n }, 0);\n if (length > 60)\n return braces[0] + (base === \"\" \? \"\" : base + \"\\n \") + \" \" + output.join(\",\\n \") + \" \" + braces[1];\n return braces[0] + base + \" \" + output.join(\", \") + \" \" + braces[1];\n}, isBoolean = function(arg) {\n return typeof arg === \"boolean\";\n}, isNull = function(arg) {\n return arg === null;\n}, isNullOrUndefined = function(arg) {\n return arg == null;\n}, isNumber = function(arg) {\n return typeof arg === \"number\";\n}, isString = function(arg) {\n return typeof arg === \"string\";\n}, isSymbol = function(arg) {\n return typeof arg === \"symbol\";\n}, isUndefined = function(arg) {\n return arg === void 0;\n}, isObject = function(arg) {\n return typeof arg === \"object\" && arg !== null;\n}, isPrimitive = function(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || typeof arg === \"undefined\";\n}, pad = function(n) {\n return n < 10 \? \"0\" + n.toString(10) : n.toString(10);\n}, timestamp = function() {\n var d = new Date, time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(\":\");\n return [d.getDate(), months[d.getMonth()], time].join(\" \");\n}, hasOwnProperty = function(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}, callbackifyOnRejected = function(reason, cb) {\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason, newReason.code = \"ERR_FALSY_VALUE_REJECTION\", reason = newReason;\n }\n return cb(reason);\n}, callbackify = function(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n function callbackified() {\n var args = Array.prototype.slice.call(arguments), maybeCb = args.pop();\n if (typeof maybeCb !== \"function\")\n @throwTypeError(\"The last argument must be of type Function\");\n var self = this, cb = function() {\n return maybeCb.apply(self, arguments);\n };\n original.apply(this, args).then(function(ret) {\n process.nextTick(cb, null, ret);\n }, function(rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }\n return Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)), Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)), callbackified;\n}, $, types = @requireNativeModule(\"util/types\"), cjs_exports = {}, deepEquals = Bun.deepEquals, isDeepStrictEqual = (a, b) => deepEquals(a, b, !0), getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors, formatRegExp = /%[sdjfoc%]/g, debugs = {}, debugEnvRegex = /^$/;\nif (process.env.NODE_DEBUG)\n debugEnv = process.env.NODE_DEBUG, debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+\?.]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/,/g, \"$|^\").toUpperCase(), debugEnvRegex = new RegExp(\"^\" + debugEnv + \"$\", \"i\");\nvar debugEnv, kInspectCustom = Symbol.for(\"nodejs.util.inspect.custom\");\ninspect.colors = {\n bold: [1, 22],\n italic: [3, 23],\n underline: [4, 24],\n inverse: [7, 27],\n white: [37, 39],\n grey: [90, 39],\n black: [30, 39],\n blue: [34, 39],\n cyan: [36, 39],\n green: [32, 39],\n magenta: [35, 39],\n red: [31, 39],\n yellow: [33, 39]\n};\ninspect.styles = {\n special: \"cyan\",\n number: \"yellow\",\n boolean: \"yellow\",\n undefined: \"grey\",\n null: \"bold\",\n string: \"green\",\n date: \"magenta\",\n regexp: \"red\"\n};\ninspect.custom = kInspectCustom;\ninspect.defaultOptions = {\n showHidden: !1,\n depth: 2,\n colors: !1,\n customInspect: !0,\n showProxy: !1,\n maxArrayLength: 100,\n maxStringLength: 1e4,\n breakLength: 80,\n compact: 3,\n sorted: !1,\n getters: !1,\n numericSeparator: !1\n};\nvar { isRegExp, isDate, isNativeError: isError } = types, months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], log = function log2() {\n console.log(\"%s - %s\", timestamp(), format.apply(cjs_exports, arguments));\n}, inherits = function inherits2(ctor, superCtor) {\n ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n });\n}, _extend = function(origin, add) {\n if (!add || !isObject(add))\n return origin;\n var keys = Object.keys(add), i = keys.length;\n while (i--)\n origin[keys[i]] = add[keys[i]];\n return origin;\n}, kCustomPromisifiedSymbol = Symbol.for(\"util.promisify.custom\"), promisify = function promisify2(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\")\n @throwTypeError('The \"util.promisify.custom\" argument must be of type Function');\n return Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n }), fn;\n }\n function fn() {\n var promiseResolve, promiseReject, promise = new Promise(function(resolve, reject) {\n promiseResolve = resolve, promiseReject = reject;\n }), args = [];\n for (var i = 0;i < arguments.length; i++)\n args.push(arguments[i]);\n args.push(function(err, value) {\n if (err)\n promiseReject(err);\n else\n promiseResolve(value);\n });\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n if (Object.setPrototypeOf(fn, Object.getPrototypeOf(original)), kCustomPromisifiedSymbol)\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n return Object.defineProperties(fn, getOwnPropertyDescriptors(original));\n};\npromisify.custom = kCustomPromisifiedSymbol;\nvar toUSVString = (input) => {\n return (input + \"\").toWellFormed();\n};\n$ = Object.assign(cjs_exports, {\n format,\n formatWithOptions,\n deprecate,\n debuglog,\n _extend,\n inspect,\n types,\n isArray: @isArray,\n isBoolean,\n isNull,\n isNullOrUndefined,\n isNumber,\n isString,\n isSymbol,\n isUndefined,\n isRegExp,\n isObject,\n isDate,\n isFunction,\n isError,\n isPrimitive,\n isBuffer,\n log,\n inherits,\n toUSVString,\n promisify,\n callbackify,\n isDeepStrictEqual,\n TextDecoder,\n TextEncoder\n});\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeUtilCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/util.ts\nvar isBuffer = function(value) {\n return @Buffer.isBuffer(value);\n}, isFunction = function(value) {\n return typeof value === \"function\";\n}, deprecate = function(fn, msg, code) {\n if (process.noDeprecation === !0)\n return fn;\n var warned = !1;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n var err = new Error(msg);\n if (code)\n err.code = code;\n throw err;\n } else if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n warned = !0;\n }\n return fn.@apply(this, arguments);\n }\n return deprecated;\n}, debuglog = function(set) {\n if (set = set.toUpperCase(), !debugs[set])\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = format.@apply(cjs_exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else\n debugs[set] = function() {\n };\n return debugs[set];\n}, isBoolean = function(arg) {\n return typeof arg === \"boolean\";\n}, isNull = function(arg) {\n return arg === null;\n}, isNullOrUndefined = function(arg) {\n return arg == null;\n}, isNumber = function(arg) {\n return typeof arg === \"number\";\n}, isString = function(arg) {\n return typeof arg === \"string\";\n}, isSymbol = function(arg) {\n return typeof arg === \"symbol\";\n}, isUndefined = function(arg) {\n return arg === void 0;\n}, isObject = function(arg) {\n return typeof arg === \"object\" && arg !== null;\n}, isPrimitive = function(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || typeof arg === \"undefined\";\n}, pad = function(n) {\n return n < 10 \? \"0\" + n.toString(10) : n.toString(10);\n}, timestamp = function() {\n var d = new Date, time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(\":\");\n return [d.getDate(), months[d.getMonth()], time].join(\" \");\n}, callbackifyOnRejected = function(reason, cb) {\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason, newReason.code = \"ERR_FALSY_VALUE_REJECTION\", reason = newReason;\n }\n return cb(reason);\n}, callbackify = function(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n function callbackified() {\n var args = @Array.prototype.slice.@call(arguments), maybeCb = args.pop();\n if (typeof maybeCb !== \"function\")\n @throwTypeError(\"The last argument must be of type Function\");\n var self = this, cb = function() {\n return maybeCb.@apply(self, arguments);\n };\n original.@apply(this, args).then(function(ret) {\n process.nextTick(cb, null, ret);\n }, function(rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }\n return Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)), Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)), callbackified;\n}, $, types = @requireNativeModule(\"util/types\"), utl = @getInternalField(@internalModuleRegistry, 7) || @createInternalModuleById(7), cjs_exports = {}, deepEquals = Bun.deepEquals, isDeepStrictEqual = (a, b) => deepEquals(a, b, !0), getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors, inspect = utl.inspect, formatWithOptions = utl.formatWithOptions, format = utl.format, stripVTControlCharacters = utl.stripVTControlCharacters, debugs = {}, debugEnvRegex = /^$/;\nif (process.env.NODE_DEBUG)\n debugEnv = process.env.NODE_DEBUG, debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+\?.]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/,/g, \"$|^\").toUpperCase(), debugEnvRegex = new @RegExp(\"^\" + debugEnv + \"$\", \"i\");\nvar debugEnv, isRegExp = types.isRegExp, isDate = types.isDate, isError = types.isNativeError, months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], log = function log2() {\n console.log(\"%s - %s\", timestamp(), format.@apply(cjs_exports, arguments));\n}, inherits = function inherits2(ctor, superCtor) {\n ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n });\n}, _extend = function(origin, add) {\n if (!add || !isObject(add))\n return origin;\n var keys = Object.keys(add), i = keys.length;\n while (i--)\n origin[keys[i]] = add[keys[i]];\n return origin;\n}, kCustomPromisifiedSymbol = Symbol.for(\"util.promisify.custom\"), promisify = function promisify2(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\")\n @throwTypeError('The \"util.promisify.custom\" argument must be of type Function');\n return Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n }), fn;\n }\n function fn() {\n var promiseResolve, promiseReject, promise = new @Promise(function(resolve, reject) {\n promiseResolve = resolve, promiseReject = reject;\n }), args = [];\n for (var i = 0;i < arguments.length; i++)\n args.push(arguments[i]);\n args.push(function(err, value) {\n if (err)\n promiseReject(err);\n else\n promiseResolve(value);\n });\n try {\n original.@apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n if (Object.setPrototypeOf(fn, Object.getPrototypeOf(original)), kCustomPromisifiedSymbol)\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n return Object.defineProperties(fn, getOwnPropertyDescriptors(original));\n};\npromisify.custom = kCustomPromisifiedSymbol;\nvar toUSVString = (input) => {\n return (input + \"\").toWellFormed();\n};\n$ = Object.assign(cjs_exports, {\n format,\n formatWithOptions,\n stripVTControlCharacters,\n deprecate,\n debuglog,\n _extend,\n inspect,\n types,\n isArray: @isArray,\n isBoolean,\n isNull,\n isNullOrUndefined,\n isNumber,\n isString,\n isSymbol,\n isUndefined,\n isRegExp,\n isObject,\n isDate,\n isFunction,\n isError,\n isPrimitive,\n isBuffer,\n log,\n inherits,\n toUSVString,\n promisify,\n callbackify,\n isDeepStrictEqual,\n TextDecoder,\n TextEncoder\n});\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeV8Code = "(function (){\"use strict\";// src/js/out/tmp/node/v8.ts\nvar notimpl = function(message) {\n throwNotImplemented(\"node:v8 \" + message);\n}, cachedDataVersionTag = function() {\n notimpl(\"cachedDataVersionTag\");\n}, getHeapSnapshot = function() {\n notimpl(\"getHeapSnapshot\");\n}, getHeapStatistics = function() {\n const stats = jsc.heapStats();\n return {\n total_heap_size: stats.heapCapacity,\n total_heap_size_executable: 0,\n total_physical_size: stats.heapSize,\n total_available_size: Infinity,\n used_heap_size: stats.heapSize,\n heap_size_limit: Infinity,\n malloced_memory: stats.heapSize,\n peak_malloced_memory: Infinity,\n does_zap_garbage: 0,\n number_of_native_contexts: Infinity,\n number_of_detached_contexts: Infinity,\n total_global_handles_size: Infinity,\n used_global_handles_size: Infinity,\n external_memory: Infinity\n };\n}, getHeapSpaceStatistics = function() {\n notimpl(\"getHeapSpaceStatistics\");\n}, getHeapCodeStatistics = function() {\n notimpl(\"getHeapCodeStatistics\");\n}, setFlagsFromString = function() {\n notimpl(\"setFlagsFromString\");\n}, deserialize = function(value) {\n return jsc.deserialize(value);\n}, takeCoverage = function() {\n notimpl(\"takeCoverage\");\n}, stopCoverage = function() {\n notimpl(\"stopCoverage\");\n}, serialize = function(arg1) {\n return jsc.serialize(arg1, { binaryType: \"nodebuffer\" });\n}, writeHeapSnapshot = function() {\n notimpl(\"writeHeapSnapshot\");\n}, setHeapSnapshotNearHeapLimit = function() {\n notimpl(\"setHeapSnapshotNearHeapLimit\");\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), jsc = @requireNativeModule(\"bun:jsc\");\n\nclass Deserializer {\n constructor() {\n notimpl(\"Deserializer\");\n }\n}\n\nclass Serializer {\n constructor() {\n notimpl(\"Serializer\");\n }\n}\n\nclass DefaultDeserializer extends Deserializer {\n constructor() {\n super(...arguments);\n }\n}\n\nclass DefaultSerializer extends Serializer {\n constructor() {\n super(...arguments);\n }\n}\n\nclass GCProfiler {\n constructor() {\n notimpl(\"GCProfiler\");\n }\n}\nvar promiseHooks = {\n createHook: () => {\n notimpl(\"createHook\");\n },\n onInit: () => {\n notimpl(\"onInit\");\n },\n onBefore: () => {\n notimpl(\"onBefore\");\n },\n onAfter: () => {\n notimpl(\"onAfter\");\n },\n onSettled: () => {\n notimpl(\"onSettled\");\n }\n}, startupSnapshot = {\n addDeserializeCallback: () => notimpl(\"addDeserializeCallback\"),\n addSerializeCallback: () => notimpl(\"addSerializeCallback\"),\n setDeserializeMainFunction: () => notimpl(\"setDeserializeMainFunction\"),\n isBuildingSnapshot: () => notimpl(\"isBuildingSnapshot\")\n};\n$ = {\n cachedDataVersionTag,\n getHeapSnapshot,\n getHeapStatistics,\n getHeapSpaceStatistics,\n getHeapCodeStatistics,\n setFlagsFromString,\n deserialize,\n takeCoverage,\n stopCoverage,\n serialize,\n writeHeapSnapshot,\n setHeapSnapshotNearHeapLimit,\n promiseHooks,\n startupSnapshot,\n Deserializer,\n Serializer\n};\nhideFromStack(notimpl, cachedDataVersionTag, getHeapSnapshot, getHeapStatistics, getHeapSpaceStatistics, getHeapCodeStatistics, setFlagsFromString, deserialize, takeCoverage, stopCoverage, serialize, writeHeapSnapshot, setHeapSnapshotNearHeapLimit, Deserializer, Serializer, DefaultDeserializer, DefaultSerializer, GCProfiler);\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeV8Code = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/v8.ts\nvar notimpl = function(message) {\n throwNotImplemented(\"node:v8 \" + message);\n}, cachedDataVersionTag = function() {\n notimpl(\"cachedDataVersionTag\");\n}, getHeapSnapshot = function() {\n notimpl(\"getHeapSnapshot\");\n}, getHeapStatistics = function() {\n const stats = jsc.heapStats();\n return {\n total_heap_size: stats.heapCapacity,\n total_heap_size_executable: 0,\n total_physical_size: stats.heapSize,\n total_available_size: @Infinity,\n used_heap_size: stats.heapSize,\n heap_size_limit: @Infinity,\n malloced_memory: stats.heapSize,\n peak_malloced_memory: @Infinity,\n does_zap_garbage: 0,\n number_of_native_contexts: @Infinity,\n number_of_detached_contexts: @Infinity,\n total_global_handles_size: @Infinity,\n used_global_handles_size: @Infinity,\n external_memory: @Infinity\n };\n}, getHeapSpaceStatistics = function() {\n notimpl(\"getHeapSpaceStatistics\");\n}, getHeapCodeStatistics = function() {\n notimpl(\"getHeapCodeStatistics\");\n}, setFlagsFromString = function() {\n notimpl(\"setFlagsFromString\");\n}, deserialize = function(value) {\n return jsc.deserialize(value);\n}, takeCoverage = function() {\n notimpl(\"takeCoverage\");\n}, stopCoverage = function() {\n notimpl(\"stopCoverage\");\n}, serialize = function(arg1) {\n return jsc.serialize(arg1, { binaryType: \"nodebuffer\" });\n}, writeHeapSnapshot = function() {\n notimpl(\"writeHeapSnapshot\");\n}, setHeapSnapshotNearHeapLimit = function() {\n notimpl(\"setHeapSnapshotNearHeapLimit\");\n}, $, { hideFromStack, throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), jsc = @requireNativeModule(\"bun:jsc\");\n\nclass Deserializer {\n constructor() {\n notimpl(\"Deserializer\");\n }\n}\n\nclass Serializer {\n constructor() {\n notimpl(\"Serializer\");\n }\n}\n\nclass DefaultDeserializer extends Deserializer {\n constructor() {\n super(...arguments);\n }\n}\n\nclass DefaultSerializer extends Serializer {\n constructor() {\n super(...arguments);\n }\n}\n\nclass GCProfiler {\n constructor() {\n notimpl(\"GCProfiler\");\n }\n}\nvar promiseHooks = {\n createHook: () => {\n notimpl(\"createHook\");\n },\n onInit: () => {\n notimpl(\"onInit\");\n },\n onBefore: () => {\n notimpl(\"onBefore\");\n },\n onAfter: () => {\n notimpl(\"onAfter\");\n },\n onSettled: () => {\n notimpl(\"onSettled\");\n }\n}, startupSnapshot = {\n addDeserializeCallback: () => notimpl(\"addDeserializeCallback\"),\n addSerializeCallback: () => notimpl(\"addSerializeCallback\"),\n setDeserializeMainFunction: () => notimpl(\"setDeserializeMainFunction\"),\n isBuildingSnapshot: () => notimpl(\"isBuildingSnapshot\")\n};\n$ = {\n cachedDataVersionTag,\n getHeapSnapshot,\n getHeapStatistics,\n getHeapSpaceStatistics,\n getHeapCodeStatistics,\n setFlagsFromString,\n deserialize,\n takeCoverage,\n stopCoverage,\n serialize,\n writeHeapSnapshot,\n setHeapSnapshotNearHeapLimit,\n promiseHooks,\n startupSnapshot,\n Deserializer,\n Serializer\n};\nhideFromStack(notimpl, cachedDataVersionTag, getHeapSnapshot, getHeapStatistics, getHeapSpaceStatistics, getHeapCodeStatistics, setFlagsFromString, deserialize, takeCoverage, stopCoverage, serialize, writeHeapSnapshot, setHeapSnapshotNearHeapLimit, Deserializer, Serializer, DefaultDeserializer, DefaultSerializer, GCProfiler);\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeVMCode = "(function (){\"use strict\";// src/js/out/tmp/node/vm.ts\nvar runInContext = function(code, context, options) {\n return new Script(code, options).runInContext(context);\n}, compileFunction = function() {\n throwNotImplemented(\"node:vm compileFunction\");\n}, measureMemory = function() {\n throwNotImplemented(\"node:vm measureMemory\");\n}, $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), vm = globalThis[globalThis.Symbol.for('Bun.lazy')](\"vm\"), { createContext, isContext, Script, runInNewContext, runInThisContext } = vm;\n\nclass Module {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n\nclass SourceTextModule {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n\nclass SyntheticModule {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n$ = {\n createContext,\n runInContext,\n runInNewContext,\n runInThisContext,\n isContext,\n compileFunction,\n measureMemory,\n Script,\n Module,\n SourceTextModule,\n SyntheticModule\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeVMCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/vm.ts\nvar runInContext = function(code, context, options) {\n return new Script(code, options).runInContext(context);\n}, compileFunction = function() {\n throwNotImplemented(\"node:vm compileFunction\");\n}, measureMemory = function() {\n throwNotImplemented(\"node:vm measureMemory\");\n}, $, { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), vm = @lazy(\"vm\"), { createContext, isContext, Script, runInNewContext, runInThisContext } = vm;\n\nclass Module {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n\nclass SourceTextModule {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n\nclass SyntheticModule {\n constructor() {\n throwNotImplemented(\"node:vm Module\");\n }\n}\n$ = {\n createContext,\n runInContext,\n runInNewContext,\n runInThisContext,\n isContext,\n compileFunction,\n measureMemory,\n Script,\n Module,\n SourceTextModule,\n SyntheticModule\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeWasiCode = "(function (){\"use strict\";// src/js/out/tmp/node/wasi.ts\nvar nodeFsConstants = @processBindingConstants.fs, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_types = __commonJS({\n \"node_modules/wasi-js/dist/types.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASIKillError = exports.WASIExitError = exports.WASIError = void 0;\n var WASIError = class extends Error {\n constructor(errno) {\n super();\n this.errno = errno, Object.setPrototypeOf(this, WASIError.prototype);\n }\n };\n exports.WASIError = WASIError;\n var WASIExitError = class extends Error {\n constructor(code) {\n super(`WASI Exit error: ${code}`);\n this.code = code, Object.setPrototypeOf(this, WASIExitError.prototype);\n }\n };\n exports.WASIExitError = WASIExitError;\n var WASIKillError = class extends Error {\n constructor(signal) {\n super(`WASI Kill signal: ${signal}`);\n this.signal = signal, Object.setPrototypeOf(this, WASIKillError.prototype);\n }\n };\n exports.WASIKillError = WASIKillError;\n }\n}), require_constants = __commonJS({\n \"node_modules/wasi-js/dist/constants.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASI_ENOMSG = exports.WASI_ENOMEM = exports.WASI_ENOLINK = exports.WASI_ENOLCK = exports.WASI_ENOEXEC = exports.WASI_ENOENT = exports.WASI_ENODEV = exports.WASI_ENOBUFS = exports.WASI_ENFILE = exports.WASI_ENETUNREACH = exports.WASI_ENETRESET = exports.WASI_ENETDOWN = exports.WASI_ENAMETOOLONG = exports.WASI_EMULTIHOP = exports.WASI_EMSGSIZE = exports.WASI_EMLINK = exports.WASI_EMFILE = exports.WASI_ELOOP = exports.WASI_EISDIR = exports.WASI_EISCONN = exports.WASI_EIO = exports.WASI_EINVAL = exports.WASI_EINTR = exports.WASI_EINPROGRESS = exports.WASI_EILSEQ = exports.WASI_EIDRM = exports.WASI_EHOSTUNREACH = exports.WASI_EFBIG = exports.WASI_EFAULT = exports.WASI_EEXIST = exports.WASI_EDQUOT = exports.WASI_EDOM = exports.WASI_EDESTADDRREQ = exports.WASI_EDEADLK = exports.WASI_ECONNRESET = exports.WASI_ECONNREFUSED = exports.WASI_ECONNABORTED = exports.WASI_ECHILD = exports.WASI_ECANCELED = exports.WASI_EBUSY = exports.WASI_EBADMSG = exports.WASI_EBADF = exports.WASI_EALREADY = exports.WASI_EAGAIN = exports.WASI_EAFNOSUPPORT = exports.WASI_EADDRNOTAVAIL = exports.WASI_EADDRINUSE = exports.WASI_EACCES = exports.WASI_E2BIG = exports.WASI_ESUCCESS = void 0, exports.WASI_SIGVTALRM = exports.WASI_SIGUSR2 = exports.WASI_SIGUSR1 = exports.WASI_SIGURG = exports.WASI_SIGTTOU = exports.WASI_SIGTTIN = exports.WASI_SIGTSTP = exports.WASI_SIGTRAP = exports.WASI_SIGTERM = exports.WASI_SIGSTOP = exports.WASI_SIGSEGV = exports.WASI_SIGQUIT = exports.WASI_SIGPIPE = exports.WASI_SIGKILL = exports.WASI_SIGINT = exports.WASI_SIGILL = exports.WASI_SIGHUP = exports.WASI_SIGFPE = exports.WASI_SIGCONT = exports.WASI_SIGCHLD = exports.WASI_SIGBUS = exports.WASI_SIGALRM = exports.WASI_SIGABRT = exports.WASI_ENOTCAPABLE = exports.WASI_EXDEV = exports.WASI_ETXTBSY = exports.WASI_ETIMEDOUT = exports.WASI_ESTALE = exports.WASI_ESRCH = exports.WASI_ESPIPE = exports.WASI_EROFS = exports.WASI_ERANGE = exports.WASI_EPROTOTYPE = exports.WASI_EPROTONOSUPPORT = exports.WASI_EPROTO = exports.WASI_EPIPE = exports.WASI_EPERM = exports.WASI_EOWNERDEAD = exports.WASI_EOVERFLOW = exports.WASI_ENXIO = exports.WASI_ENOTTY = exports.WASI_ENOTSUP = exports.WASI_ENOTSOCK = exports.WASI_ENOTRECOVERABLE = exports.WASI_ENOTEMPTY = exports.WASI_ENOTDIR = exports.WASI_ENOTCONN = exports.WASI_ENOSYS = exports.WASI_ENOSPC = exports.WASI_ENOPROTOOPT = void 0, exports.RIGHTS_REGULAR_FILE_BASE = exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL = exports.WASI_RIGHT_SOCK_SHUTDOWN = exports.WASI_RIGHT_POLL_FD_READWRITE = exports.WASI_RIGHT_PATH_UNLINK_FILE = exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = exports.WASI_RIGHT_PATH_SYMLINK = exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = exports.WASI_RIGHT_FD_FILESTAT_GET = exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = exports.WASI_RIGHT_PATH_FILESTAT_GET = exports.WASI_RIGHT_PATH_RENAME_TARGET = exports.WASI_RIGHT_PATH_RENAME_SOURCE = exports.WASI_RIGHT_PATH_READLINK = exports.WASI_RIGHT_FD_READDIR = exports.WASI_RIGHT_PATH_OPEN = exports.WASI_RIGHT_PATH_LINK_TARGET = exports.WASI_RIGHT_PATH_LINK_SOURCE = exports.WASI_RIGHT_PATH_CREATE_FILE = exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = exports.WASI_RIGHT_FD_ALLOCATE = exports.WASI_RIGHT_FD_ADVISE = exports.WASI_RIGHT_FD_WRITE = exports.WASI_RIGHT_FD_TELL = exports.WASI_RIGHT_FD_SYNC = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = exports.WASI_RIGHT_FD_SEEK = exports.WASI_RIGHT_FD_READ = exports.WASI_RIGHT_FD_DATASYNC = exports.WASI_FDFLAG_SYNC = exports.WASI_FDFLAG_RSYNC = exports.WASI_FDFLAG_NONBLOCK = exports.WASI_FDFLAG_DSYNC = exports.WASI_FDFLAG_APPEND = exports.WASI_FILETYPE_SYMBOLIC_LINK = exports.WASI_FILETYPE_SOCKET_STREAM = exports.WASI_FILETYPE_SOCKET_DGRAM = exports.WASI_FILETYPE_REGULAR_FILE = exports.WASI_FILETYPE_DIRECTORY = exports.WASI_FILETYPE_CHARACTER_DEVICE = exports.WASI_FILETYPE_BLOCK_DEVICE = exports.WASI_FILETYPE_UNKNOWN = exports.WASI_SIGXFSZ = exports.WASI_SIGXCPU = void 0, exports.SIGNAL_MAP = exports.ERROR_MAP = exports.WASI_WHENCE_END = exports.WASI_WHENCE_CUR = exports.WASI_WHENCE_SET = exports.WASI_STDERR_FILENO = exports.WASI_STDOUT_FILENO = exports.WASI_STDIN_FILENO = exports.WASI_DIRCOOKIE_START = exports.WASI_PREOPENTYPE_DIR = exports.WASI_O_TRUNC = exports.WASI_O_EXCL = exports.WASI_O_DIRECTORY = exports.WASI_O_CREAT = exports.WASI_FILESTAT_SET_MTIM_NOW = exports.WASI_FILESTAT_SET_MTIM = exports.WASI_FILESTAT_SET_ATIM_NOW = exports.WASI_FILESTAT_SET_ATIM = exports.WASI_EVENTTYPE_FD_WRITE = exports.WASI_EVENTTYPE_FD_READ = exports.WASI_EVENTTYPE_CLOCK = exports.WASI_CLOCK_THREAD_CPUTIME_ID = exports.WASI_CLOCK_PROCESS_CPUTIME_ID = exports.WASI_CLOCK_MONOTONIC = exports.WASI_CLOCK_REALTIME = exports.RIGHTS_TTY_INHERITING = exports.RIGHTS_TTY_BASE = exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_SOCKET_BASE = exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE = exports.RIGHTS_REGULAR_FILE_INHERITING = void 0, exports.WASI_ESUCCESS = 0, exports.WASI_E2BIG = 1, exports.WASI_EACCES = 2, exports.WASI_EADDRINUSE = 3, exports.WASI_EADDRNOTAVAIL = 4, exports.WASI_EAFNOSUPPORT = 5, exports.WASI_EAGAIN = 6, exports.WASI_EALREADY = 7, exports.WASI_EBADF = 8, exports.WASI_EBADMSG = 9, exports.WASI_EBUSY = 10, exports.WASI_ECANCELED = 11, exports.WASI_ECHILD = 12, exports.WASI_ECONNABORTED = 13, exports.WASI_ECONNREFUSED = 14, exports.WASI_ECONNRESET = 15, exports.WASI_EDEADLK = 16, exports.WASI_EDESTADDRREQ = 17, exports.WASI_EDOM = 18, exports.WASI_EDQUOT = 19, exports.WASI_EEXIST = 20, exports.WASI_EFAULT = 21, exports.WASI_EFBIG = 22, exports.WASI_EHOSTUNREACH = 23, exports.WASI_EIDRM = 24, exports.WASI_EILSEQ = 25, exports.WASI_EINPROGRESS = 26, exports.WASI_EINTR = 27, exports.WASI_EINVAL = 28, exports.WASI_EIO = 29, exports.WASI_EISCONN = 30, exports.WASI_EISDIR = 31, exports.WASI_ELOOP = 32, exports.WASI_EMFILE = 33, exports.WASI_EMLINK = 34, exports.WASI_EMSGSIZE = 35, exports.WASI_EMULTIHOP = 36, exports.WASI_ENAMETOOLONG = 37, exports.WASI_ENETDOWN = 38, exports.WASI_ENETRESET = 39, exports.WASI_ENETUNREACH = 40, exports.WASI_ENFILE = 41, exports.WASI_ENOBUFS = 42, exports.WASI_ENODEV = 43, exports.WASI_ENOENT = 44, exports.WASI_ENOEXEC = 45, exports.WASI_ENOLCK = 46, exports.WASI_ENOLINK = 47, exports.WASI_ENOMEM = 48, exports.WASI_ENOMSG = 49, exports.WASI_ENOPROTOOPT = 50, exports.WASI_ENOSPC = 51, exports.WASI_ENOSYS = 52, exports.WASI_ENOTCONN = 53, exports.WASI_ENOTDIR = 54, exports.WASI_ENOTEMPTY = 55, exports.WASI_ENOTRECOVERABLE = 56, exports.WASI_ENOTSOCK = 57, exports.WASI_ENOTSUP = 58, exports.WASI_ENOTTY = 59, exports.WASI_ENXIO = 60, exports.WASI_EOVERFLOW = 61, exports.WASI_EOWNERDEAD = 62, exports.WASI_EPERM = 63, exports.WASI_EPIPE = 64, exports.WASI_EPROTO = 65, exports.WASI_EPROTONOSUPPORT = 66, exports.WASI_EPROTOTYPE = 67, exports.WASI_ERANGE = 68, exports.WASI_EROFS = 69, exports.WASI_ESPIPE = 70, exports.WASI_ESRCH = 71, exports.WASI_ESTALE = 72, exports.WASI_ETIMEDOUT = 73, exports.WASI_ETXTBSY = 74, exports.WASI_EXDEV = 75, exports.WASI_ENOTCAPABLE = 76, exports.WASI_SIGABRT = 0, exports.WASI_SIGALRM = 1, exports.WASI_SIGBUS = 2, exports.WASI_SIGCHLD = 3, exports.WASI_SIGCONT = 4, exports.WASI_SIGFPE = 5, exports.WASI_SIGHUP = 6, exports.WASI_SIGILL = 7, exports.WASI_SIGINT = 8, exports.WASI_SIGKILL = 9, exports.WASI_SIGPIPE = 10, exports.WASI_SIGQUIT = 11, exports.WASI_SIGSEGV = 12, exports.WASI_SIGSTOP = 13, exports.WASI_SIGTERM = 14, exports.WASI_SIGTRAP = 15, exports.WASI_SIGTSTP = 16, exports.WASI_SIGTTIN = 17, exports.WASI_SIGTTOU = 18, exports.WASI_SIGURG = 19, exports.WASI_SIGUSR1 = 20, exports.WASI_SIGUSR2 = 21, exports.WASI_SIGVTALRM = 22, exports.WASI_SIGXCPU = 23, exports.WASI_SIGXFSZ = 24, exports.WASI_FILETYPE_UNKNOWN = 0, exports.WASI_FILETYPE_BLOCK_DEVICE = 1, exports.WASI_FILETYPE_CHARACTER_DEVICE = 2, exports.WASI_FILETYPE_DIRECTORY = 3, exports.WASI_FILETYPE_REGULAR_FILE = 4, exports.WASI_FILETYPE_SOCKET_DGRAM = 5, exports.WASI_FILETYPE_SOCKET_STREAM = 6, exports.WASI_FILETYPE_SYMBOLIC_LINK = 7, exports.WASI_FDFLAG_APPEND = 1, exports.WASI_FDFLAG_DSYNC = 2, exports.WASI_FDFLAG_NONBLOCK = 4, exports.WASI_FDFLAG_RSYNC = 8, exports.WASI_FDFLAG_SYNC = 16, exports.WASI_RIGHT_FD_DATASYNC = BigInt(1), exports.WASI_RIGHT_FD_READ = BigInt(2), exports.WASI_RIGHT_FD_SEEK = BigInt(4), exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = BigInt(8), exports.WASI_RIGHT_FD_SYNC = BigInt(16), exports.WASI_RIGHT_FD_TELL = BigInt(32), exports.WASI_RIGHT_FD_WRITE = BigInt(64), exports.WASI_RIGHT_FD_ADVISE = BigInt(128), exports.WASI_RIGHT_FD_ALLOCATE = BigInt(256), exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = BigInt(512), exports.WASI_RIGHT_PATH_CREATE_FILE = BigInt(1024), exports.WASI_RIGHT_PATH_LINK_SOURCE = BigInt(2048), exports.WASI_RIGHT_PATH_LINK_TARGET = BigInt(4096), exports.WASI_RIGHT_PATH_OPEN = BigInt(8192), exports.WASI_RIGHT_FD_READDIR = BigInt(16384), exports.WASI_RIGHT_PATH_READLINK = BigInt(32768), exports.WASI_RIGHT_PATH_RENAME_SOURCE = BigInt(65536), exports.WASI_RIGHT_PATH_RENAME_TARGET = BigInt(131072), exports.WASI_RIGHT_PATH_FILESTAT_GET = BigInt(262144), exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = BigInt(524288), exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = BigInt(1048576), exports.WASI_RIGHT_FD_FILESTAT_GET = BigInt(2097152), exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = BigInt(4194304), exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = BigInt(8388608), exports.WASI_RIGHT_PATH_SYMLINK = BigInt(16777216), exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = BigInt(33554432), exports.WASI_RIGHT_PATH_UNLINK_FILE = BigInt(67108864), exports.WASI_RIGHT_POLL_FD_READWRITE = BigInt(134217728), exports.WASI_RIGHT_SOCK_SHUTDOWN = BigInt(268435456), exports.RIGHTS_ALL = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_REGULAR_FILE_BASE = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_REGULAR_FILE_INHERITING = BigInt(0), exports.RIGHTS_DIRECTORY_BASE = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE | exports.RIGHTS_REGULAR_FILE_BASE, exports.RIGHTS_SOCKET_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_TTY_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_TTY_INHERITING = BigInt(0), exports.WASI_CLOCK_REALTIME = 0, exports.WASI_CLOCK_MONOTONIC = 1, exports.WASI_CLOCK_PROCESS_CPUTIME_ID = 2, exports.WASI_CLOCK_THREAD_CPUTIME_ID = 3, exports.WASI_EVENTTYPE_CLOCK = 0, exports.WASI_EVENTTYPE_FD_READ = 1, exports.WASI_EVENTTYPE_FD_WRITE = 2, exports.WASI_FILESTAT_SET_ATIM = 1 << 0, exports.WASI_FILESTAT_SET_ATIM_NOW = 1 << 1, exports.WASI_FILESTAT_SET_MTIM = 1 << 2, exports.WASI_FILESTAT_SET_MTIM_NOW = 1 << 3, exports.WASI_O_CREAT = 1 << 0, exports.WASI_O_DIRECTORY = 1 << 1, exports.WASI_O_EXCL = 1 << 2, exports.WASI_O_TRUNC = 1 << 3, exports.WASI_PREOPENTYPE_DIR = 0, exports.WASI_DIRCOOKIE_START = 0, exports.WASI_STDIN_FILENO = 0, exports.WASI_STDOUT_FILENO = 1, exports.WASI_STDERR_FILENO = 2, exports.WASI_WHENCE_SET = 0, exports.WASI_WHENCE_CUR = 1, exports.WASI_WHENCE_END = 2, exports.ERROR_MAP = {\n E2BIG: exports.WASI_E2BIG,\n EACCES: exports.WASI_EACCES,\n EADDRINUSE: exports.WASI_EADDRINUSE,\n EADDRNOTAVAIL: exports.WASI_EADDRNOTAVAIL,\n EAFNOSUPPORT: exports.WASI_EAFNOSUPPORT,\n EALREADY: exports.WASI_EALREADY,\n EAGAIN: exports.WASI_EAGAIN,\n EBADF: exports.WASI_EBADF,\n EBADMSG: exports.WASI_EBADMSG,\n EBUSY: exports.WASI_EBUSY,\n ECANCELED: exports.WASI_ECANCELED,\n ECHILD: exports.WASI_ECHILD,\n ECONNABORTED: exports.WASI_ECONNABORTED,\n ECONNREFUSED: exports.WASI_ECONNREFUSED,\n ECONNRESET: exports.WASI_ECONNRESET,\n EDEADLOCK: exports.WASI_EDEADLK,\n EDESTADDRREQ: exports.WASI_EDESTADDRREQ,\n EDOM: exports.WASI_EDOM,\n EDQUOT: exports.WASI_EDQUOT,\n EEXIST: exports.WASI_EEXIST,\n EFAULT: exports.WASI_EFAULT,\n EFBIG: exports.WASI_EFBIG,\n EHOSTDOWN: exports.WASI_EHOSTUNREACH,\n EHOSTUNREACH: exports.WASI_EHOSTUNREACH,\n EIDRM: exports.WASI_EIDRM,\n EILSEQ: exports.WASI_EILSEQ,\n EINPROGRESS: exports.WASI_EINPROGRESS,\n EINTR: exports.WASI_EINTR,\n EINVAL: exports.WASI_EINVAL,\n EIO: exports.WASI_EIO,\n EISCONN: exports.WASI_EISCONN,\n EISDIR: exports.WASI_EISDIR,\n ELOOP: exports.WASI_ELOOP,\n EMFILE: exports.WASI_EMFILE,\n EMLINK: exports.WASI_EMLINK,\n EMSGSIZE: exports.WASI_EMSGSIZE,\n EMULTIHOP: exports.WASI_EMULTIHOP,\n ENAMETOOLONG: exports.WASI_ENAMETOOLONG,\n ENETDOWN: exports.WASI_ENETDOWN,\n ENETRESET: exports.WASI_ENETRESET,\n ENETUNREACH: exports.WASI_ENETUNREACH,\n ENFILE: exports.WASI_ENFILE,\n ENOBUFS: exports.WASI_ENOBUFS,\n ENODEV: exports.WASI_ENODEV,\n ENOENT: exports.WASI_ENOENT,\n ENOEXEC: exports.WASI_ENOEXEC,\n ENOLCK: exports.WASI_ENOLCK,\n ENOLINK: exports.WASI_ENOLINK,\n ENOMEM: exports.WASI_ENOMEM,\n ENOMSG: exports.WASI_ENOMSG,\n ENOPROTOOPT: exports.WASI_ENOPROTOOPT,\n ENOSPC: exports.WASI_ENOSPC,\n ENOSYS: exports.WASI_ENOSYS,\n ENOTCONN: exports.WASI_ENOTCONN,\n ENOTDIR: exports.WASI_ENOTDIR,\n ENOTEMPTY: exports.WASI_ENOTEMPTY,\n ENOTRECOVERABLE: exports.WASI_ENOTRECOVERABLE,\n ENOTSOCK: exports.WASI_ENOTSOCK,\n ENOTTY: exports.WASI_ENOTTY,\n ENXIO: exports.WASI_ENXIO,\n EOVERFLOW: exports.WASI_EOVERFLOW,\n EOWNERDEAD: exports.WASI_EOWNERDEAD,\n EPERM: exports.WASI_EPERM,\n EPIPE: exports.WASI_EPIPE,\n EPROTO: exports.WASI_EPROTO,\n EPROTONOSUPPORT: exports.WASI_EPROTONOSUPPORT,\n EPROTOTYPE: exports.WASI_EPROTOTYPE,\n ERANGE: exports.WASI_ERANGE,\n EROFS: exports.WASI_EROFS,\n ESPIPE: exports.WASI_ESPIPE,\n ESRCH: exports.WASI_ESRCH,\n ESTALE: exports.WASI_ESTALE,\n ETIMEDOUT: exports.WASI_ETIMEDOUT,\n ETXTBSY: exports.WASI_ETXTBSY,\n EXDEV: exports.WASI_EXDEV\n }, exports.SIGNAL_MAP = {\n [exports.WASI_SIGHUP]: \"SIGHUP\",\n [exports.WASI_SIGINT]: \"SIGINT\",\n [exports.WASI_SIGQUIT]: \"SIGQUIT\",\n [exports.WASI_SIGILL]: \"SIGILL\",\n [exports.WASI_SIGTRAP]: \"SIGTRAP\",\n [exports.WASI_SIGABRT]: \"SIGABRT\",\n [exports.WASI_SIGBUS]: \"SIGBUS\",\n [exports.WASI_SIGFPE]: \"SIGFPE\",\n [exports.WASI_SIGKILL]: \"SIGKILL\",\n [exports.WASI_SIGUSR1]: \"SIGUSR1\",\n [exports.WASI_SIGSEGV]: \"SIGSEGV\",\n [exports.WASI_SIGUSR2]: \"SIGUSR2\",\n [exports.WASI_SIGPIPE]: \"SIGPIPE\",\n [exports.WASI_SIGALRM]: \"SIGALRM\",\n [exports.WASI_SIGTERM]: \"SIGTERM\",\n [exports.WASI_SIGCHLD]: \"SIGCHLD\",\n [exports.WASI_SIGCONT]: \"SIGCONT\",\n [exports.WASI_SIGSTOP]: \"SIGSTOP\",\n [exports.WASI_SIGTSTP]: \"SIGTSTP\",\n [exports.WASI_SIGTTIN]: \"SIGTTIN\",\n [exports.WASI_SIGTTOU]: \"SIGTTOU\",\n [exports.WASI_SIGURG]: \"SIGURG\",\n [exports.WASI_SIGXCPU]: \"SIGXCPU\",\n [exports.WASI_SIGXFSZ]: \"SIGXFSZ\",\n [exports.WASI_SIGVTALRM]: \"SIGVTALRM\"\n };\n }\n}), require_wasi = __commonJS({\n \"node_modules/wasi-js/dist/wasi.js\"(exports) {\n var __importDefault = exports && exports.__importDefault || function(mod) {\n return mod && mod.__esModule \? mod : { default: mod };\n };\n let fs;\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.SOCKET_DEFAULT_RIGHTS = void 0;\n var log = () => {\n }, logOpen = () => {\n }, SC_OPEN_MAX = 32768, types_1 = require_types(), constants_1 = require_constants(), STDIN_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDOUT_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDERR_DEFAULT_RIGHTS = STDOUT_DEFAULT_RIGHTS;\n exports.SOCKET_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE | constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS;\n var msToNs = (ms) => {\n const msInt = Math.trunc(ms), decimal = BigInt(Math.round((ms - msInt) * 1e6));\n return BigInt(msInt) * BigInt(1e6) + decimal;\n }, nsToMs = (ns) => {\n if (typeof ns === \"number\")\n ns = Math.trunc(ns);\n const nsInt = BigInt(ns);\n return Number(nsInt / BigInt(1e6));\n }, wrap = (f) => (...args) => {\n try {\n return f(...args);\n } catch (err) {\n let e = err;\n while (e.prev != null)\n e = e.prev;\n if (e\?.code && typeof e\?.code === \"string\")\n return constants_1.ERROR_MAP[e.code] || constants_1.WASI_EINVAL;\n if (e instanceof types_1.WASIError)\n return e.errno;\n throw e;\n }\n }, stat = (wasi, fd) => {\n const entry = wasi.FD_MAP.get(fd);\n if (!entry)\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n if (entry.filetype === void 0) {\n const stats = wasi.fstatSync(entry.real), { filetype, rightsBase, rightsInheriting } = translateFileAttributes(wasi, fd, stats);\n if (entry.filetype = filetype, !entry.rights)\n entry.rights = {\n base: rightsBase,\n inheriting: rightsInheriting\n };\n }\n return entry;\n }, translateFileAttributes = (wasi, fd, stats) => {\n switch (!0) {\n case stats.isBlockDevice():\n return {\n filetype: constants_1.WASI_FILETYPE_BLOCK_DEVICE,\n rightsBase: constants_1.RIGHTS_BLOCK_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_BLOCK_DEVICE_INHERITING\n };\n case stats.isCharacterDevice(): {\n const filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n if (fd !== void 0 && wasi.bindings.isTTY(fd))\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_TTY_BASE,\n rightsInheriting: constants_1.RIGHTS_TTY_INHERITING\n };\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_CHARACTER_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_CHARACTER_DEVICE_INHERITING\n };\n }\n case stats.isDirectory():\n return {\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rightsBase: constants_1.RIGHTS_DIRECTORY_BASE,\n rightsInheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n };\n case stats.isFIFO():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isFile():\n return {\n filetype: constants_1.WASI_FILETYPE_REGULAR_FILE,\n rightsBase: constants_1.RIGHTS_REGULAR_FILE_BASE,\n rightsInheriting: constants_1.RIGHTS_REGULAR_FILE_INHERITING\n };\n case stats.isSocket():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isSymbolicLink():\n return {\n filetype: constants_1.WASI_FILETYPE_SYMBOLIC_LINK,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n default:\n return {\n filetype: constants_1.WASI_FILETYPE_UNKNOWN,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n }\n }, warnedAboutSleep = !1, defaultConfig;\n function getDefaults() {\n if (defaultConfig)\n return defaultConfig;\n const defaultBindings = {\n hrtime: () => process.hrtime.bigint(),\n exit: (code) => {\n process.exit(code);\n },\n kill: (signal) => {\n process.kill(process.pid, signal);\n },\n randomFillSync: (array) => crypto.getRandomValues(array),\n isTTY: (fd) => (@getInternalField(@internalModuleRegistry, 44) || @createInternalModuleById(44)).isatty(fd),\n fs: Bun.fs(),\n path: @getInternalField(@internalModuleRegistry, 28) || @createInternalModuleById(28)\n };\n return defaultConfig = {\n args: [],\n env: {},\n preopens: {},\n bindings: defaultBindings,\n sleep: (ms) => {\n Bun.sleepSync(ms);\n }\n };\n }\n var WASI = class WASI2 {\n constructor(wasiConfig = {}) {\n const defaultConfig2 = getDefaults();\n this.lastStdin = 0, this.sleep = wasiConfig.sleep || defaultConfig2.sleep, this.getStdin = wasiConfig.getStdin, this.sendStdout = wasiConfig.sendStdout, this.sendStderr = wasiConfig.sendStderr;\n let preopens = wasiConfig.preopens \?\? defaultConfig2.preopens;\n this.env = wasiConfig.env \?\? defaultConfig2.env;\n const args = wasiConfig.args \?\? defaultConfig2.args;\n this.memory = void 0, this.view = void 0, this.bindings = wasiConfig.bindings || defaultConfig2.bindings;\n const bindings2 = this.bindings;\n fs = bindings2.fs, this.FD_MAP = new Map([\n [\n constants_1.WASI_STDIN_FILENO,\n {\n real: 0,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdin\"\n }\n ],\n [\n constants_1.WASI_STDOUT_FILENO,\n {\n real: 1,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDOUT_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdout\"\n }\n ],\n [\n constants_1.WASI_STDERR_FILENO,\n {\n real: 2,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDERR_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stderr\"\n }\n ]\n ]);\n const path = bindings2.path;\n for (let [k, v] of Object.entries(preopens)) {\n const real = fs.openSync(v, nodeFsConstants.O_RDONLY), newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real,\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rights: {\n base: constants_1.RIGHTS_DIRECTORY_BASE,\n inheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n },\n fakePath: k,\n path: v\n });\n }\n const getiovs = (iovs, iovsLen) => {\n this.refreshMemory();\n const { view, memory } = this, { buffer } = memory, { byteLength } = buffer;\n if (iovsLen === 1) {\n const ptr = iovs, buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n return [new Uint8Array(buffer, buf, bufLen)];\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n const buffers = [];\n buffers.length = iovsLen;\n for (let i = 0, ptr = iovs;i < iovsLen; i++, ptr += 8) {\n const buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n buffers[i] = new Uint8Array(buffer, buf, bufLen);\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n return buffers;\n }, CHECK_FD = (fd, rights) => {\n const stats = stat(this, fd);\n if (rights !== BigInt(0) && (stats.rights.base & rights) === BigInt(0))\n throw new types_1.WASIError(constants_1.WASI_EPERM);\n return stats;\n }, CPUTIME_START = Bun.nanoseconds(), timeOrigin = Math.trunc(performance.timeOrigin * 1e6), now = (clockId) => {\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n return Bun.nanoseconds();\n case constants_1.WASI_CLOCK_REALTIME:\n return Bun.nanoseconds() + timeOrigin;\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID:\n return Bun.nanoseconds() - CPUTIME_START;\n default:\n return null;\n }\n };\n if (this.wasiImport = {\n args_get: (argv, argvBuf) => {\n this.refreshMemory();\n let coffset = argv, offset = argvBuf;\n return args.forEach((a) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${a}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n args_sizes_get: (argc, argvBufSize) => {\n this.refreshMemory(), this.view.setUint32(argc, args.length, !0);\n const size = args.reduce((acc, a) => acc + Buffer.byteLength(a) + 1, 0);\n return this.view.setUint32(argvBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n environ_get: (environ, environBuf) => {\n this.refreshMemory();\n let coffset = environ, offset = environBuf;\n return Object.entries(this.env).forEach(([key, value]) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += Buffer.from(this.memory.buffer).write(`${key}=${value}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n environ_sizes_get: (environCount, environBufSize) => {\n this.refreshMemory();\n const envProcessed = Object.entries(this.env).map(([key, value]) => `${key}=${value}\\0`), size = envProcessed.reduce((acc, e) => acc + Buffer.byteLength(e), 0);\n return this.view.setUint32(environCount, envProcessed.length, !0), this.view.setUint32(environBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n clock_res_get: (clockId, resolution) => {\n let res;\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID: {\n res = BigInt(1);\n break;\n }\n case constants_1.WASI_CLOCK_REALTIME: {\n res = BigInt(1000);\n break;\n }\n }\n if (!res)\n throw Error(\"invalid clockId\");\n return this.view.setBigUint64(resolution, res), constants_1.WASI_ESUCCESS;\n },\n clock_time_get: (clockId, _precision, time) => {\n this.refreshMemory();\n const n = now(clockId);\n if (n === null)\n return constants_1.WASI_EINVAL;\n return this.view.setBigUint64(time, BigInt(n), !0), constants_1.WASI_ESUCCESS;\n },\n fd_advise: wrap((fd, _offset, _len, _advice) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ADVISE), constants_1.WASI_ENOSYS;\n }),\n fd_allocate: wrap((fd, _offset, _len) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ALLOCATE), constants_1.WASI_ENOSYS;\n }),\n fd_close: wrap((fd) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return fs.closeSync(stats.real), this.FD_MAP.delete(fd), constants_1.WASI_ESUCCESS;\n }),\n fd_datasync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_DATASYNC);\n return fs.fdatasyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if (this.refreshMemory(), stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), this.view.setUint16(bufPtr + 2, 0, !0), this.view.setUint16(bufPtr + 4, 0, !0), this.view.setBigUint64(bufPtr + 8, BigInt(stats.rights.base), !0), this.view.setBigUint64(bufPtr + 8 + 8, BigInt(stats.rights.inheriting), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_set_flags: wrap((fd, flags) => {\n if (CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS), this.wasiImport.sock_fcntlSetFlags(fd, flags) == 0)\n return constants_1.WASI_ESUCCESS;\n return constants_1.WASI_ENOSYS;\n }),\n fd_fdstat_set_rights: wrap((fd, fsRightsBase, fsRightsInheriting) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if ((stats.rights.base | fsRightsBase) > stats.rights.base)\n return constants_1.WASI_EPERM;\n if ((stats.rights.inheriting | fsRightsInheriting) > stats.rights.inheriting)\n return constants_1.WASI_EPERM;\n return stats.rights.base = fsRightsBase, stats.rights.inheriting = fsRightsInheriting, constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_GET), rstats = this.fstatSync(stats.real);\n if (this.refreshMemory(), this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.atimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.mtimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.ctimeMs), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_size: wrap((fd, stSize) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE);\n return fs.ftruncateSync(stats.real, Number(stSize)), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_times: wrap((fd, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_TIMES), rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n return fs.futimesSync(stats.real, new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), this.view.setUint8(bufPtr, constants_1.WASI_PREOPENTYPE_DIR), this.view.setUint32(bufPtr + 4, Buffer.byteLength(stats.fakePath \?\? stats.path \?\? \"\"), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_dir_name: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), Buffer.from(this.memory.buffer).write(stats.fakePath \?\? stats.path \?\? \"\", pathPtr, pathLen, \"utf8\"), constants_1.WASI_ESUCCESS;\n }),\n fd_pwrite: wrap((fd, iovs, iovsLen, offset, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SEEK);\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n let w = 0;\n while (w < iov.byteLength)\n w += fs.writeSync(stats.real, iov, w, iov.byteLength - w, Number(offset) + written + w);\n written += w;\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_write: wrap((fd, iovs, iovsLen, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE), IS_STDOUT = fd == constants_1.WASI_STDOUT_FILENO, IS_STDERR = fd == constants_1.WASI_STDERR_FILENO;\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n if (iov.byteLength == 0)\n return;\n if (IS_STDOUT && this.sendStdout != null)\n this.sendStdout(iov), written += iov.byteLength;\n else if (IS_STDERR && this.sendStderr != null)\n this.sendStderr(iov), written += iov.byteLength;\n else {\n let w = 0;\n while (w < iov.byteLength) {\n const i = fs.writeSync(stats.real, iov, w, iov.byteLength - w, stats.offset \? Number(stats.offset) : null);\n if (stats.offset)\n stats.offset += BigInt(i);\n w += i;\n }\n written += w;\n }\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_pread: wrap((fd, iovs, iovsLen, offset, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SEEK);\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n const length = iov.byteLength - r, rr = fs.readSync(stats.real, iov, r, iov.byteLength - r, Number(offset) + read + r);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n read += r;\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_read: wrap((fd, iovs, iovsLen, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ), IS_STDIN = fd == constants_1.WASI_STDIN_FILENO;\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n let length = iov.byteLength - r, position = IS_STDIN || stats.offset === void 0 \? null : Number(stats.offset), rr = 0;\n if (IS_STDIN)\n if (this.getStdin != null) {\n if (this.stdinBuffer == null)\n this.stdinBuffer = this.getStdin();\n if (this.stdinBuffer != null) {\n if (rr = this.stdinBuffer.copy(iov), rr == this.stdinBuffer.length)\n this.stdinBuffer = void 0;\n else\n this.stdinBuffer = this.stdinBuffer.slice(rr);\n if (rr > 0)\n this.lastStdin = (new Date()).valueOf();\n }\n } else {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(cpu waiting for stdin: please define a way to sleep!) \");\n try {\n rr = fs.readSync(stats.real, iov, r, length, position);\n } catch (_err) {\n }\n if (rr == 0)\n this.shortPause();\n else\n this.lastStdin = (new Date()).valueOf();\n }\n else\n rr = fs.readSync(stats.real, iov, r, length, position);\n if (stats.filetype == constants_1.WASI_FILETYPE_REGULAR_FILE)\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(rr);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_readdir: wrap((fd, bufPtr, bufLen, cookie, bufusedPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READDIR);\n this.refreshMemory();\n const entries = fs.readdirSync(stats.path, { withFileTypes: !0 }), startPtr = bufPtr;\n for (let i = Number(cookie);i < entries.length; i += 1) {\n const entry = entries[i];\n let nameLength = Buffer.byteLength(entry.name);\n if (bufPtr - startPtr > bufLen)\n break;\n if (this.view.setBigUint64(bufPtr, BigInt(i + 1), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n const rstats = fs.lstatSync(path.resolve(stats.path, entry.name));\n if (this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n if (this.view.setUint32(bufPtr, nameLength, !0), bufPtr += 4, bufPtr - startPtr > bufLen)\n break;\n let filetype;\n switch (!0) {\n case rstats.isBlockDevice():\n filetype = constants_1.WASI_FILETYPE_BLOCK_DEVICE;\n break;\n case rstats.isCharacterDevice():\n filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n break;\n case rstats.isDirectory():\n filetype = constants_1.WASI_FILETYPE_DIRECTORY;\n break;\n case rstats.isFIFO():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isFile():\n filetype = constants_1.WASI_FILETYPE_REGULAR_FILE;\n break;\n case rstats.isSocket():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isSymbolicLink():\n filetype = constants_1.WASI_FILETYPE_SYMBOLIC_LINK;\n break;\n default:\n filetype = constants_1.WASI_FILETYPE_UNKNOWN;\n break;\n }\n if (this.view.setUint8(bufPtr, filetype), bufPtr += 1, bufPtr += 3, bufPtr + nameLength >= startPtr + bufLen)\n break;\n Buffer.from(this.memory.buffer).write(entry.name, bufPtr), bufPtr += nameLength;\n }\n const bufused = bufPtr - startPtr;\n return this.view.setUint32(bufusedPtr, Math.min(bufused, bufLen), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_renumber: wrap((from, to) => {\n return CHECK_FD(from, BigInt(0)), CHECK_FD(to, BigInt(0)), fs.closeSync(this.FD_MAP.get(from).real), this.FD_MAP.set(from, this.FD_MAP.get(to)), this.FD_MAP.delete(to), constants_1.WASI_ESUCCESS;\n }),\n fd_seek: wrap((fd, offset, whence, newOffsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SEEK);\n switch (this.refreshMemory(), whence) {\n case constants_1.WASI_WHENCE_CUR:\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_END:\n const { size } = this.fstatSync(stats.real);\n stats.offset = BigInt(size) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_SET:\n stats.offset = BigInt(offset);\n break;\n }\n if (stats.offset == null)\n throw Error(\"stats.offset must be defined\");\n return this.view.setBigUint64(newOffsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_tell: wrap((fd, offsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_TELL);\n if (this.refreshMemory(), !stats.offset)\n stats.offset = BigInt(0);\n return this.view.setBigUint64(offsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_sync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SYNC);\n return fs.fsyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n path_create_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_CREATE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.mkdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_get: wrap((fd, flags, pathPtr, pathLen, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_GET);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n let rstats;\n if (flags)\n rstats = fs.statSync(path.resolve(stats.path, p));\n else\n rstats = fs.lstatSync(path.resolve(stats.path, p));\n return this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, this.view.setUint8(bufPtr, translateFileAttributes(this, void 0, rstats).filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.atime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.mtime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ctime.getTime() * 1e6), !0), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_set_times: wrap((fd, _dirflags, pathPtr, pathLen, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.utimesSync(path.resolve(stats.path, p), new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n path_link: wrap((oldFd, _oldFlags, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_LINK_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_LINK_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.linkSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_open: wrap((dirfd, _dirflags, pathPtr, pathLen, oflags, fsRightsBase, fsRightsInheriting, fsFlags, fdPtr) => {\n try {\n const stats = CHECK_FD(dirfd, constants_1.WASI_RIGHT_PATH_OPEN);\n fsRightsBase = BigInt(fsRightsBase), fsRightsInheriting = BigInt(fsRightsInheriting);\n const read = (fsRightsBase & (constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_READDIR)) !== BigInt(0), write = (fsRightsBase & (constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ALLOCATE | constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE)) !== BigInt(0);\n let noflags;\n if (write && read)\n noflags = nodeFsConstants.O_RDWR;\n else if (read)\n noflags = nodeFsConstants.O_RDONLY;\n else if (write)\n noflags = nodeFsConstants.O_WRONLY;\n let neededBase = fsRightsBase | constants_1.WASI_RIGHT_PATH_OPEN, neededInheriting = fsRightsBase | fsRightsInheriting;\n if ((oflags & constants_1.WASI_O_CREAT) !== 0)\n noflags |= nodeFsConstants.O_CREAT, neededBase |= constants_1.WASI_RIGHT_PATH_CREATE_FILE;\n if ((oflags & constants_1.WASI_O_DIRECTORY) !== 0)\n noflags |= nodeFsConstants.O_DIRECTORY;\n if ((oflags & constants_1.WASI_O_EXCL) !== 0)\n noflags |= nodeFsConstants.O_EXCL;\n if ((oflags & constants_1.WASI_O_TRUNC) !== 0)\n noflags |= nodeFsConstants.O_TRUNC, neededBase |= constants_1.WASI_RIGHT_PATH_FILESTAT_SET_SIZE;\n if ((fsFlags & constants_1.WASI_FDFLAG_APPEND) !== 0)\n noflags |= nodeFsConstants.O_APPEND;\n if ((fsFlags & constants_1.WASI_FDFLAG_DSYNC) !== 0) {\n if (nodeFsConstants.O_DSYNC)\n noflags |= nodeFsConstants.O_DSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_DATASYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_NONBLOCK) !== 0)\n noflags |= nodeFsConstants.O_NONBLOCK;\n if ((fsFlags & constants_1.WASI_FDFLAG_RSYNC) !== 0) {\n if (nodeFsConstants.O_RSYNC)\n noflags |= nodeFsConstants.O_RSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_SYNC) !== 0)\n noflags |= nodeFsConstants.O_SYNC, neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n if (write && (noflags & (nodeFsConstants.O_APPEND | nodeFsConstants.O_TRUNC)) === 0)\n neededInheriting |= constants_1.WASI_RIGHT_FD_SEEK;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n if (p == \"dev/tty\")\n return this.view.setUint32(fdPtr, constants_1.WASI_STDIN_FILENO, !0), constants_1.WASI_ESUCCESS;\n if (logOpen(\"path_open\", p), p.startsWith(\"proc/\"))\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n const fullUnresolved = path.resolve(p);\n let full;\n try {\n full = fs.realpathSync(fullUnresolved);\n } catch (e) {\n if (e\?.code === \"ENOENT\")\n full = fullUnresolved;\n else\n throw e;\n }\n let isDirectory;\n if (write)\n try {\n isDirectory = fs.statSync(full).isDirectory();\n } catch (_err) {\n }\n let realfd;\n if (!write && isDirectory)\n realfd = fs.openSync(full, nodeFsConstants.O_RDONLY);\n else\n realfd = fs.openSync(full, noflags);\n const newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real: realfd,\n filetype: void 0,\n rights: {\n base: neededBase,\n inheriting: neededInheriting\n },\n path: full\n }), stat(this, newfd), this.view.setUint32(fdPtr, newfd, !0);\n } catch (e) {\n console.error(e);\n }\n return constants_1.WASI_ESUCCESS;\n }),\n path_readlink: wrap((fd, pathPtr, pathLen, buf, bufLen, bufused) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_READLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString(), full = path.resolve(stats.path, p), r = fs.readlinkSync(full), used = Buffer.from(this.memory.buffer).write(r, buf, bufLen);\n return this.view.setUint32(bufused, used, !0), constants_1.WASI_ESUCCESS;\n }),\n path_remove_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_REMOVE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.rmdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_rename: wrap((oldFd, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_RENAME_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_RENAME_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.renameSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_symlink: wrap((oldPath, oldPathLen, fd, newPath, newPathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_SYMLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.symlinkSync(op, path.resolve(stats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_unlink_file: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_UNLINK_FILE);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.unlinkSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n poll_oneoff: (sin, sout, nsubscriptions, neventsPtr) => {\n let nevents = 0, name = \"\", waitTimeNs = BigInt(0), fd = -1, fd_type = \"read\", fd_timeout_ms = 0;\n const startNs = BigInt(bindings2.hrtime());\n this.refreshMemory();\n let last_sin = sin;\n for (let i = 0;i < nsubscriptions; i += 1) {\n const userdata = this.view.getBigUint64(sin, !0);\n sin += 8;\n const type = this.view.getUint8(sin);\n if (sin += 1, sin += 7, log.enabled) {\n if (type == constants_1.WASI_EVENTTYPE_CLOCK)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_CLOCK): \";\n else if (type == constants_1.WASI_EVENTTYPE_FD_READ)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_READ): \";\n else\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_WRITE): \";\n log(name);\n }\n switch (type) {\n case constants_1.WASI_EVENTTYPE_CLOCK: {\n const clockid = this.view.getUint32(sin, !0);\n sin += 4, sin += 4;\n const timeout = this.view.getBigUint64(sin, !0);\n sin += 8, sin += 8;\n const subclockflags = this.view.getUint16(sin, !0);\n sin += 2, sin += 6;\n const absolute = subclockflags === 1;\n if (log.enabled)\n log(name, { clockid, timeout, absolute });\n if (!absolute)\n fd_timeout_ms = timeout / BigInt(1e6);\n let e = constants_1.WASI_ESUCCESS;\n const t = now(clockid);\n if (t == null)\n e = constants_1.WASI_EINVAL;\n else {\n const tNS = BigInt(t), waitNs = (absolute \? timeout : tNS + timeout) - tNS;\n if (waitNs > waitTimeNs)\n waitTimeNs = waitNs;\n }\n this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, e, !0), sout += 2, this.view.setUint8(sout, constants_1.WASI_EVENTTYPE_CLOCK), sout += 1, sout += 5, nevents += 1;\n break;\n }\n case constants_1.WASI_EVENTTYPE_FD_READ:\n case constants_1.WASI_EVENTTYPE_FD_WRITE: {\n if (fd = this.view.getUint32(sin, !0), fd_type = type == constants_1.WASI_EVENTTYPE_FD_READ \? \"read\" : \"write\", sin += 4, log(name, \"fd =\", fd), sin += 28, this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, constants_1.WASI_ENOSYS, !0), sout += 2, this.view.setUint8(sout, type), sout += 1, sout += 5, nevents += 1, fd == constants_1.WASI_STDIN_FILENO && constants_1.WASI_EVENTTYPE_FD_READ == type)\n this.shortPause();\n break;\n }\n default:\n return constants_1.WASI_EINVAL;\n }\n if (sin - last_sin != 48)\n console.warn(\"*** BUG in wasi-js in poll_oneoff \", {\n i,\n sin,\n last_sin,\n diff: sin - last_sin\n });\n last_sin = sin;\n }\n if (this.view.setUint32(neventsPtr, nevents, !0), nevents == 2 && fd >= 0) {\n const r = this.wasiImport.sock_pollSocket(fd, fd_type, fd_timeout_ms);\n if (r != constants_1.WASI_ENOSYS)\n return r;\n }\n if (waitTimeNs > 0) {\n if (waitTimeNs -= Bun.nanoseconds() - timeOrigin, waitTimeNs >= 1e6) {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(100% cpu burning waiting for stdin: please define a way to sleep!) \");\n if (this.sleep != null) {\n const ms = nsToMs(waitTimeNs);\n this.sleep(ms);\n } else {\n const end = BigInt(bindings2.hrtime()) + waitTimeNs;\n while (BigInt(bindings2.hrtime()) < end)\n ;\n }\n }\n }\n return constants_1.WASI_ESUCCESS;\n },\n proc_exit: (rval) => {\n return bindings2.exit(rval), constants_1.WASI_ESUCCESS;\n },\n proc_raise: (sig) => {\n if (!(sig in constants_1.SIGNAL_MAP))\n return constants_1.WASI_EINVAL;\n return bindings2.kill(constants_1.SIGNAL_MAP[sig]), constants_1.WASI_ESUCCESS;\n },\n random_get: (bufPtr, bufLen) => {\n return this.refreshMemory(), crypto.getRandomValues(this.memory.buffer, bufPtr, bufLen), bufLen;\n },\n sched_yield() {\n return constants_1.WASI_ESUCCESS;\n },\n sock_recv() {\n return constants_1.WASI_ENOSYS;\n },\n sock_send() {\n return constants_1.WASI_ENOSYS;\n },\n sock_shutdown() {\n return constants_1.WASI_ENOSYS;\n },\n sock_fcntlSetFlags(_fd, _flags) {\n return constants_1.WASI_ENOSYS;\n },\n sock_pollSocket(_fd, _eventtype, _timeout_ms) {\n return constants_1.WASI_ENOSYS;\n }\n }, log.enabled)\n Object.keys(this.wasiImport).forEach((key) => {\n const prevImport = this.wasiImport[key];\n this.wasiImport[key] = function(...args2) {\n log(key, args2);\n try {\n let result = prevImport(...args2);\n return log(\"result\", result), result;\n } catch (e) {\n throw log(\"error: \", e), e;\n }\n };\n });\n }\n getState() {\n return { env: this.env, FD_MAP: this.FD_MAP, bindings };\n }\n setState(state) {\n this.env = state.env, this.FD_MAP = state.FD_MAP, bindings = state.bindings;\n }\n fstatSync(real_fd) {\n if (real_fd <= 2)\n try {\n return fs.fstatSync(real_fd);\n } catch (_) {\n const now = new Date;\n return {\n dev: 0,\n mode: 8592,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n blksize: 65536,\n ino: 0,\n size: 0,\n blocks: 0,\n atimeMs: now.valueOf(),\n mtimeMs: now.valueOf(),\n ctimeMs: now.valueOf(),\n birthtimeMs: 0,\n atime: new Date,\n mtime: new Date,\n ctime: new Date,\n birthtime: new Date(0)\n };\n }\n return fs.fstatSync(real_fd);\n }\n shortPause() {\n if (this.sleep == null)\n return;\n if ((new Date()).valueOf() - this.lastStdin > 2000)\n this.sleep(50);\n }\n getUnusedFileDescriptor(start = 3) {\n let fd = start;\n while (this.FD_MAP.has(fd))\n fd += 1;\n if (fd > SC_OPEN_MAX)\n throw Error(\"no available file descriptors\");\n return fd;\n }\n refreshMemory() {\n if (!this.view || this.view.buffer.byteLength === 0)\n this.view = new DataView(this.memory.buffer);\n }\n setMemory(memory) {\n this.memory = memory;\n }\n start(instance, memory) {\n const exports2 = instance.exports;\n if (exports2 === null || typeof exports2 !== \"object\")\n throw new Error(`instance.exports must be an Object. Received ${exports2}.`);\n if (memory == null) {\n if (memory = exports2.memory, !(memory instanceof WebAssembly.Memory))\n throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${memory}.`);\n }\n if (this.setMemory(memory), exports2._start)\n exports2._start();\n }\n getImports(module2) {\n let namespace = null;\n const imports = WebAssembly.Module.imports(module2);\n for (let imp of imports) {\n if (imp.kind !== \"function\")\n continue;\n if (!imp.module.startsWith(\"wasi_\"))\n continue;\n namespace = imp.module;\n break;\n }\n switch (namespace) {\n case \"wasi_unstable\":\n return {\n wasi_unstable: this.wasiImport\n };\n case \"wasi_snapshot_preview1\":\n return {\n wasi_snapshot_preview1: this.wasiImport\n };\n default:\n throw new Error(\"No WASI namespace found. Only wasi_unstable and wasi_snapshot_preview1 are supported.\\n\\nList of imports:\\n\\n\" + imports.map(({ name, kind, module }) => `${module}:${name} (${kind})`).join(\"\\n\") + \"\\n\");\n }\n }\n initWasiFdInfo() {\n if (this.env.WASI_FD_INFO != null) {\n const fdInfo = JSON.parse(this.env.WASI_FD_INFO);\n for (let wasi_fd in fdInfo) {\n console.log(wasi_fd);\n const fd = parseInt(wasi_fd);\n if (this.FD_MAP.has(fd))\n continue;\n const real = fdInfo[wasi_fd];\n try {\n this.fstatSync(real);\n } catch (_err) {\n console.log(\"discarding \", { wasi_fd, real });\n continue;\n }\n const file = {\n real,\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n }\n };\n this.FD_MAP.set(fd, file);\n }\n console.log(\"after initWasiFdInfo: \", this.FD_MAP), console.log(\"fdInfo = \", fdInfo);\n } else\n console.log(\"no WASI_FD_INFO\");\n }\n };\n exports.default = WASI;\n }\n});\nreturn { WASI: require_wasi().default }})\n"_s;
+static constexpr ASCIILiteral NodeWasiCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/wasi.ts\nvar nodeFsConstants = @processBindingConstants.fs, __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_types = __commonJS({\n \"node_modules/wasi-js/dist/types.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASIKillError = exports.WASIExitError = exports.WASIError = void 0;\n var WASIError = class extends Error {\n constructor(errno) {\n super();\n this.errno = errno, Object.setPrototypeOf(this, WASIError.prototype);\n }\n };\n exports.WASIError = WASIError;\n var WASIExitError = class extends Error {\n constructor(code) {\n super(`WASI Exit error: ${code}`);\n this.code = code, Object.setPrototypeOf(this, WASIExitError.prototype);\n }\n };\n exports.WASIExitError = WASIExitError;\n var WASIKillError = class extends Error {\n constructor(signal) {\n super(`WASI Kill signal: ${signal}`);\n this.signal = signal, Object.setPrototypeOf(this, WASIKillError.prototype);\n }\n };\n exports.WASIKillError = WASIKillError;\n }\n}), require_constants = __commonJS({\n \"node_modules/wasi-js/dist/constants.js\"(exports) {\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.WASI_ENOMSG = exports.WASI_ENOMEM = exports.WASI_ENOLINK = exports.WASI_ENOLCK = exports.WASI_ENOEXEC = exports.WASI_ENOENT = exports.WASI_ENODEV = exports.WASI_ENOBUFS = exports.WASI_ENFILE = exports.WASI_ENETUNREACH = exports.WASI_ENETRESET = exports.WASI_ENETDOWN = exports.WASI_ENAMETOOLONG = exports.WASI_EMULTIHOP = exports.WASI_EMSGSIZE = exports.WASI_EMLINK = exports.WASI_EMFILE = exports.WASI_ELOOP = exports.WASI_EISDIR = exports.WASI_EISCONN = exports.WASI_EIO = exports.WASI_EINVAL = exports.WASI_EINTR = exports.WASI_EINPROGRESS = exports.WASI_EILSEQ = exports.WASI_EIDRM = exports.WASI_EHOSTUNREACH = exports.WASI_EFBIG = exports.WASI_EFAULT = exports.WASI_EEXIST = exports.WASI_EDQUOT = exports.WASI_EDOM = exports.WASI_EDESTADDRREQ = exports.WASI_EDEADLK = exports.WASI_ECONNRESET = exports.WASI_ECONNREFUSED = exports.WASI_ECONNABORTED = exports.WASI_ECHILD = exports.WASI_ECANCELED = exports.WASI_EBUSY = exports.WASI_EBADMSG = exports.WASI_EBADF = exports.WASI_EALREADY = exports.WASI_EAGAIN = exports.WASI_EAFNOSUPPORT = exports.WASI_EADDRNOTAVAIL = exports.WASI_EADDRINUSE = exports.WASI_EACCES = exports.WASI_E2BIG = exports.WASI_ESUCCESS = void 0, exports.WASI_SIGVTALRM = exports.WASI_SIGUSR2 = exports.WASI_SIGUSR1 = exports.WASI_SIGURG = exports.WASI_SIGTTOU = exports.WASI_SIGTTIN = exports.WASI_SIGTSTP = exports.WASI_SIGTRAP = exports.WASI_SIGTERM = exports.WASI_SIGSTOP = exports.WASI_SIGSEGV = exports.WASI_SIGQUIT = exports.WASI_SIGPIPE = exports.WASI_SIGKILL = exports.WASI_SIGINT = exports.WASI_SIGILL = exports.WASI_SIGHUP = exports.WASI_SIGFPE = exports.WASI_SIGCONT = exports.WASI_SIGCHLD = exports.WASI_SIGBUS = exports.WASI_SIGALRM = exports.WASI_SIGABRT = exports.WASI_ENOTCAPABLE = exports.WASI_EXDEV = exports.WASI_ETXTBSY = exports.WASI_ETIMEDOUT = exports.WASI_ESTALE = exports.WASI_ESRCH = exports.WASI_ESPIPE = exports.WASI_EROFS = exports.WASI_ERANGE = exports.WASI_EPROTOTYPE = exports.WASI_EPROTONOSUPPORT = exports.WASI_EPROTO = exports.WASI_EPIPE = exports.WASI_EPERM = exports.WASI_EOWNERDEAD = exports.WASI_EOVERFLOW = exports.WASI_ENXIO = exports.WASI_ENOTTY = exports.WASI_ENOTSUP = exports.WASI_ENOTSOCK = exports.WASI_ENOTRECOVERABLE = exports.WASI_ENOTEMPTY = exports.WASI_ENOTDIR = exports.WASI_ENOTCONN = exports.WASI_ENOSYS = exports.WASI_ENOSPC = exports.WASI_ENOPROTOOPT = void 0, exports.RIGHTS_REGULAR_FILE_BASE = exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL = exports.WASI_RIGHT_SOCK_SHUTDOWN = exports.WASI_RIGHT_POLL_FD_READWRITE = exports.WASI_RIGHT_PATH_UNLINK_FILE = exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = exports.WASI_RIGHT_PATH_SYMLINK = exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = exports.WASI_RIGHT_FD_FILESTAT_GET = exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = exports.WASI_RIGHT_PATH_FILESTAT_GET = exports.WASI_RIGHT_PATH_RENAME_TARGET = exports.WASI_RIGHT_PATH_RENAME_SOURCE = exports.WASI_RIGHT_PATH_READLINK = exports.WASI_RIGHT_FD_READDIR = exports.WASI_RIGHT_PATH_OPEN = exports.WASI_RIGHT_PATH_LINK_TARGET = exports.WASI_RIGHT_PATH_LINK_SOURCE = exports.WASI_RIGHT_PATH_CREATE_FILE = exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = exports.WASI_RIGHT_FD_ALLOCATE = exports.WASI_RIGHT_FD_ADVISE = exports.WASI_RIGHT_FD_WRITE = exports.WASI_RIGHT_FD_TELL = exports.WASI_RIGHT_FD_SYNC = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = exports.WASI_RIGHT_FD_SEEK = exports.WASI_RIGHT_FD_READ = exports.WASI_RIGHT_FD_DATASYNC = exports.WASI_FDFLAG_SYNC = exports.WASI_FDFLAG_RSYNC = exports.WASI_FDFLAG_NONBLOCK = exports.WASI_FDFLAG_DSYNC = exports.WASI_FDFLAG_APPEND = exports.WASI_FILETYPE_SYMBOLIC_LINK = exports.WASI_FILETYPE_SOCKET_STREAM = exports.WASI_FILETYPE_SOCKET_DGRAM = exports.WASI_FILETYPE_REGULAR_FILE = exports.WASI_FILETYPE_DIRECTORY = exports.WASI_FILETYPE_CHARACTER_DEVICE = exports.WASI_FILETYPE_BLOCK_DEVICE = exports.WASI_FILETYPE_UNKNOWN = exports.WASI_SIGXFSZ = exports.WASI_SIGXCPU = void 0, exports.SIGNAL_MAP = exports.ERROR_MAP = exports.WASI_WHENCE_END = exports.WASI_WHENCE_CUR = exports.WASI_WHENCE_SET = exports.WASI_STDERR_FILENO = exports.WASI_STDOUT_FILENO = exports.WASI_STDIN_FILENO = exports.WASI_DIRCOOKIE_START = exports.WASI_PREOPENTYPE_DIR = exports.WASI_O_TRUNC = exports.WASI_O_EXCL = exports.WASI_O_DIRECTORY = exports.WASI_O_CREAT = exports.WASI_FILESTAT_SET_MTIM_NOW = exports.WASI_FILESTAT_SET_MTIM = exports.WASI_FILESTAT_SET_ATIM_NOW = exports.WASI_FILESTAT_SET_ATIM = exports.WASI_EVENTTYPE_FD_WRITE = exports.WASI_EVENTTYPE_FD_READ = exports.WASI_EVENTTYPE_CLOCK = exports.WASI_CLOCK_THREAD_CPUTIME_ID = exports.WASI_CLOCK_PROCESS_CPUTIME_ID = exports.WASI_CLOCK_MONOTONIC = exports.WASI_CLOCK_REALTIME = exports.RIGHTS_TTY_INHERITING = exports.RIGHTS_TTY_BASE = exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_SOCKET_BASE = exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE = exports.RIGHTS_REGULAR_FILE_INHERITING = void 0, exports.WASI_ESUCCESS = 0, exports.WASI_E2BIG = 1, exports.WASI_EACCES = 2, exports.WASI_EADDRINUSE = 3, exports.WASI_EADDRNOTAVAIL = 4, exports.WASI_EAFNOSUPPORT = 5, exports.WASI_EAGAIN = 6, exports.WASI_EALREADY = 7, exports.WASI_EBADF = 8, exports.WASI_EBADMSG = 9, exports.WASI_EBUSY = 10, exports.WASI_ECANCELED = 11, exports.WASI_ECHILD = 12, exports.WASI_ECONNABORTED = 13, exports.WASI_ECONNREFUSED = 14, exports.WASI_ECONNRESET = 15, exports.WASI_EDEADLK = 16, exports.WASI_EDESTADDRREQ = 17, exports.WASI_EDOM = 18, exports.WASI_EDQUOT = 19, exports.WASI_EEXIST = 20, exports.WASI_EFAULT = 21, exports.WASI_EFBIG = 22, exports.WASI_EHOSTUNREACH = 23, exports.WASI_EIDRM = 24, exports.WASI_EILSEQ = 25, exports.WASI_EINPROGRESS = 26, exports.WASI_EINTR = 27, exports.WASI_EINVAL = 28, exports.WASI_EIO = 29, exports.WASI_EISCONN = 30, exports.WASI_EISDIR = 31, exports.WASI_ELOOP = 32, exports.WASI_EMFILE = 33, exports.WASI_EMLINK = 34, exports.WASI_EMSGSIZE = 35, exports.WASI_EMULTIHOP = 36, exports.WASI_ENAMETOOLONG = 37, exports.WASI_ENETDOWN = 38, exports.WASI_ENETRESET = 39, exports.WASI_ENETUNREACH = 40, exports.WASI_ENFILE = 41, exports.WASI_ENOBUFS = 42, exports.WASI_ENODEV = 43, exports.WASI_ENOENT = 44, exports.WASI_ENOEXEC = 45, exports.WASI_ENOLCK = 46, exports.WASI_ENOLINK = 47, exports.WASI_ENOMEM = 48, exports.WASI_ENOMSG = 49, exports.WASI_ENOPROTOOPT = 50, exports.WASI_ENOSPC = 51, exports.WASI_ENOSYS = 52, exports.WASI_ENOTCONN = 53, exports.WASI_ENOTDIR = 54, exports.WASI_ENOTEMPTY = 55, exports.WASI_ENOTRECOVERABLE = 56, exports.WASI_ENOTSOCK = 57, exports.WASI_ENOTSUP = 58, exports.WASI_ENOTTY = 59, exports.WASI_ENXIO = 60, exports.WASI_EOVERFLOW = 61, exports.WASI_EOWNERDEAD = 62, exports.WASI_EPERM = 63, exports.WASI_EPIPE = 64, exports.WASI_EPROTO = 65, exports.WASI_EPROTONOSUPPORT = 66, exports.WASI_EPROTOTYPE = 67, exports.WASI_ERANGE = 68, exports.WASI_EROFS = 69, exports.WASI_ESPIPE = 70, exports.WASI_ESRCH = 71, exports.WASI_ESTALE = 72, exports.WASI_ETIMEDOUT = 73, exports.WASI_ETXTBSY = 74, exports.WASI_EXDEV = 75, exports.WASI_ENOTCAPABLE = 76, exports.WASI_SIGABRT = 0, exports.WASI_SIGALRM = 1, exports.WASI_SIGBUS = 2, exports.WASI_SIGCHLD = 3, exports.WASI_SIGCONT = 4, exports.WASI_SIGFPE = 5, exports.WASI_SIGHUP = 6, exports.WASI_SIGILL = 7, exports.WASI_SIGINT = 8, exports.WASI_SIGKILL = 9, exports.WASI_SIGPIPE = 10, exports.WASI_SIGQUIT = 11, exports.WASI_SIGSEGV = 12, exports.WASI_SIGSTOP = 13, exports.WASI_SIGTERM = 14, exports.WASI_SIGTRAP = 15, exports.WASI_SIGTSTP = 16, exports.WASI_SIGTTIN = 17, exports.WASI_SIGTTOU = 18, exports.WASI_SIGURG = 19, exports.WASI_SIGUSR1 = 20, exports.WASI_SIGUSR2 = 21, exports.WASI_SIGVTALRM = 22, exports.WASI_SIGXCPU = 23, exports.WASI_SIGXFSZ = 24, exports.WASI_FILETYPE_UNKNOWN = 0, exports.WASI_FILETYPE_BLOCK_DEVICE = 1, exports.WASI_FILETYPE_CHARACTER_DEVICE = 2, exports.WASI_FILETYPE_DIRECTORY = 3, exports.WASI_FILETYPE_REGULAR_FILE = 4, exports.WASI_FILETYPE_SOCKET_DGRAM = 5, exports.WASI_FILETYPE_SOCKET_STREAM = 6, exports.WASI_FILETYPE_SYMBOLIC_LINK = 7, exports.WASI_FDFLAG_APPEND = 1, exports.WASI_FDFLAG_DSYNC = 2, exports.WASI_FDFLAG_NONBLOCK = 4, exports.WASI_FDFLAG_RSYNC = 8, exports.WASI_FDFLAG_SYNC = 16, exports.WASI_RIGHT_FD_DATASYNC = BigInt(1), exports.WASI_RIGHT_FD_READ = BigInt(2), exports.WASI_RIGHT_FD_SEEK = BigInt(4), exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = BigInt(8), exports.WASI_RIGHT_FD_SYNC = BigInt(16), exports.WASI_RIGHT_FD_TELL = BigInt(32), exports.WASI_RIGHT_FD_WRITE = BigInt(64), exports.WASI_RIGHT_FD_ADVISE = BigInt(128), exports.WASI_RIGHT_FD_ALLOCATE = BigInt(256), exports.WASI_RIGHT_PATH_CREATE_DIRECTORY = BigInt(512), exports.WASI_RIGHT_PATH_CREATE_FILE = BigInt(1024), exports.WASI_RIGHT_PATH_LINK_SOURCE = BigInt(2048), exports.WASI_RIGHT_PATH_LINK_TARGET = BigInt(4096), exports.WASI_RIGHT_PATH_OPEN = BigInt(8192), exports.WASI_RIGHT_FD_READDIR = BigInt(16384), exports.WASI_RIGHT_PATH_READLINK = BigInt(32768), exports.WASI_RIGHT_PATH_RENAME_SOURCE = BigInt(65536), exports.WASI_RIGHT_PATH_RENAME_TARGET = BigInt(131072), exports.WASI_RIGHT_PATH_FILESTAT_GET = BigInt(262144), exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = BigInt(524288), exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = BigInt(1048576), exports.WASI_RIGHT_FD_FILESTAT_GET = BigInt(2097152), exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = BigInt(4194304), exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = BigInt(8388608), exports.WASI_RIGHT_PATH_SYMLINK = BigInt(16777216), exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = BigInt(33554432), exports.WASI_RIGHT_PATH_UNLINK_FILE = BigInt(67108864), exports.WASI_RIGHT_POLL_FD_READWRITE = BigInt(134217728), exports.WASI_RIGHT_SOCK_SHUTDOWN = BigInt(268435456), exports.RIGHTS_ALL = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_ALL, exports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_REGULAR_FILE_BASE = exports.WASI_RIGHT_FD_DATASYNC | exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_SEEK | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_TELL | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_FD_ALLOCATE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_REGULAR_FILE_INHERITING = BigInt(0), exports.RIGHTS_DIRECTORY_BASE = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_SYNC | exports.WASI_RIGHT_FD_ADVISE | exports.WASI_RIGHT_PATH_CREATE_DIRECTORY | exports.WASI_RIGHT_PATH_CREATE_FILE | exports.WASI_RIGHT_PATH_LINK_SOURCE | exports.WASI_RIGHT_PATH_LINK_TARGET | exports.WASI_RIGHT_PATH_OPEN | exports.WASI_RIGHT_FD_READDIR | exports.WASI_RIGHT_PATH_READLINK | exports.WASI_RIGHT_PATH_RENAME_SOURCE | exports.WASI_RIGHT_PATH_RENAME_TARGET | exports.WASI_RIGHT_PATH_FILESTAT_GET | exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE | exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES | exports.WASI_RIGHT_PATH_SYMLINK | exports.WASI_RIGHT_PATH_UNLINK_FILE | exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE | exports.RIGHTS_REGULAR_FILE_BASE, exports.RIGHTS_SOCKET_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE | exports.WASI_RIGHT_SOCK_SHUTDOWN, exports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_ALL, exports.RIGHTS_TTY_BASE = exports.WASI_RIGHT_FD_READ | exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS | exports.WASI_RIGHT_FD_WRITE | exports.WASI_RIGHT_FD_FILESTAT_GET | exports.WASI_RIGHT_POLL_FD_READWRITE, exports.RIGHTS_TTY_INHERITING = BigInt(0), exports.WASI_CLOCK_REALTIME = 0, exports.WASI_CLOCK_MONOTONIC = 1, exports.WASI_CLOCK_PROCESS_CPUTIME_ID = 2, exports.WASI_CLOCK_THREAD_CPUTIME_ID = 3, exports.WASI_EVENTTYPE_CLOCK = 0, exports.WASI_EVENTTYPE_FD_READ = 1, exports.WASI_EVENTTYPE_FD_WRITE = 2, exports.WASI_FILESTAT_SET_ATIM = 1 << 0, exports.WASI_FILESTAT_SET_ATIM_NOW = 1 << 1, exports.WASI_FILESTAT_SET_MTIM = 1 << 2, exports.WASI_FILESTAT_SET_MTIM_NOW = 1 << 3, exports.WASI_O_CREAT = 1 << 0, exports.WASI_O_DIRECTORY = 1 << 1, exports.WASI_O_EXCL = 1 << 2, exports.WASI_O_TRUNC = 1 << 3, exports.WASI_PREOPENTYPE_DIR = 0, exports.WASI_DIRCOOKIE_START = 0, exports.WASI_STDIN_FILENO = 0, exports.WASI_STDOUT_FILENO = 1, exports.WASI_STDERR_FILENO = 2, exports.WASI_WHENCE_SET = 0, exports.WASI_WHENCE_CUR = 1, exports.WASI_WHENCE_END = 2, exports.ERROR_MAP = {\n E2BIG: exports.WASI_E2BIG,\n EACCES: exports.WASI_EACCES,\n EADDRINUSE: exports.WASI_EADDRINUSE,\n EADDRNOTAVAIL: exports.WASI_EADDRNOTAVAIL,\n EAFNOSUPPORT: exports.WASI_EAFNOSUPPORT,\n EALREADY: exports.WASI_EALREADY,\n EAGAIN: exports.WASI_EAGAIN,\n EBADF: exports.WASI_EBADF,\n EBADMSG: exports.WASI_EBADMSG,\n EBUSY: exports.WASI_EBUSY,\n ECANCELED: exports.WASI_ECANCELED,\n ECHILD: exports.WASI_ECHILD,\n ECONNABORTED: exports.WASI_ECONNABORTED,\n ECONNREFUSED: exports.WASI_ECONNREFUSED,\n ECONNRESET: exports.WASI_ECONNRESET,\n EDEADLOCK: exports.WASI_EDEADLK,\n EDESTADDRREQ: exports.WASI_EDESTADDRREQ,\n EDOM: exports.WASI_EDOM,\n EDQUOT: exports.WASI_EDQUOT,\n EEXIST: exports.WASI_EEXIST,\n EFAULT: exports.WASI_EFAULT,\n EFBIG: exports.WASI_EFBIG,\n EHOSTDOWN: exports.WASI_EHOSTUNREACH,\n EHOSTUNREACH: exports.WASI_EHOSTUNREACH,\n EIDRM: exports.WASI_EIDRM,\n EILSEQ: exports.WASI_EILSEQ,\n EINPROGRESS: exports.WASI_EINPROGRESS,\n EINTR: exports.WASI_EINTR,\n EINVAL: exports.WASI_EINVAL,\n EIO: exports.WASI_EIO,\n EISCONN: exports.WASI_EISCONN,\n EISDIR: exports.WASI_EISDIR,\n ELOOP: exports.WASI_ELOOP,\n EMFILE: exports.WASI_EMFILE,\n EMLINK: exports.WASI_EMLINK,\n EMSGSIZE: exports.WASI_EMSGSIZE,\n EMULTIHOP: exports.WASI_EMULTIHOP,\n ENAMETOOLONG: exports.WASI_ENAMETOOLONG,\n ENETDOWN: exports.WASI_ENETDOWN,\n ENETRESET: exports.WASI_ENETRESET,\n ENETUNREACH: exports.WASI_ENETUNREACH,\n ENFILE: exports.WASI_ENFILE,\n ENOBUFS: exports.WASI_ENOBUFS,\n ENODEV: exports.WASI_ENODEV,\n ENOENT: exports.WASI_ENOENT,\n ENOEXEC: exports.WASI_ENOEXEC,\n ENOLCK: exports.WASI_ENOLCK,\n ENOLINK: exports.WASI_ENOLINK,\n ENOMEM: exports.WASI_ENOMEM,\n ENOMSG: exports.WASI_ENOMSG,\n ENOPROTOOPT: exports.WASI_ENOPROTOOPT,\n ENOSPC: exports.WASI_ENOSPC,\n ENOSYS: exports.WASI_ENOSYS,\n ENOTCONN: exports.WASI_ENOTCONN,\n ENOTDIR: exports.WASI_ENOTDIR,\n ENOTEMPTY: exports.WASI_ENOTEMPTY,\n ENOTRECOVERABLE: exports.WASI_ENOTRECOVERABLE,\n ENOTSOCK: exports.WASI_ENOTSOCK,\n ENOTTY: exports.WASI_ENOTTY,\n ENXIO: exports.WASI_ENXIO,\n EOVERFLOW: exports.WASI_EOVERFLOW,\n EOWNERDEAD: exports.WASI_EOWNERDEAD,\n EPERM: exports.WASI_EPERM,\n EPIPE: exports.WASI_EPIPE,\n EPROTO: exports.WASI_EPROTO,\n EPROTONOSUPPORT: exports.WASI_EPROTONOSUPPORT,\n EPROTOTYPE: exports.WASI_EPROTOTYPE,\n ERANGE: exports.WASI_ERANGE,\n EROFS: exports.WASI_EROFS,\n ESPIPE: exports.WASI_ESPIPE,\n ESRCH: exports.WASI_ESRCH,\n ESTALE: exports.WASI_ESTALE,\n ETIMEDOUT: exports.WASI_ETIMEDOUT,\n ETXTBSY: exports.WASI_ETXTBSY,\n EXDEV: exports.WASI_EXDEV\n }, exports.SIGNAL_MAP = {\n [exports.WASI_SIGHUP]: \"SIGHUP\",\n [exports.WASI_SIGINT]: \"SIGINT\",\n [exports.WASI_SIGQUIT]: \"SIGQUIT\",\n [exports.WASI_SIGILL]: \"SIGILL\",\n [exports.WASI_SIGTRAP]: \"SIGTRAP\",\n [exports.WASI_SIGABRT]: \"SIGABRT\",\n [exports.WASI_SIGBUS]: \"SIGBUS\",\n [exports.WASI_SIGFPE]: \"SIGFPE\",\n [exports.WASI_SIGKILL]: \"SIGKILL\",\n [exports.WASI_SIGUSR1]: \"SIGUSR1\",\n [exports.WASI_SIGSEGV]: \"SIGSEGV\",\n [exports.WASI_SIGUSR2]: \"SIGUSR2\",\n [exports.WASI_SIGPIPE]: \"SIGPIPE\",\n [exports.WASI_SIGALRM]: \"SIGALRM\",\n [exports.WASI_SIGTERM]: \"SIGTERM\",\n [exports.WASI_SIGCHLD]: \"SIGCHLD\",\n [exports.WASI_SIGCONT]: \"SIGCONT\",\n [exports.WASI_SIGSTOP]: \"SIGSTOP\",\n [exports.WASI_SIGTSTP]: \"SIGTSTP\",\n [exports.WASI_SIGTTIN]: \"SIGTTIN\",\n [exports.WASI_SIGTTOU]: \"SIGTTOU\",\n [exports.WASI_SIGURG]: \"SIGURG\",\n [exports.WASI_SIGXCPU]: \"SIGXCPU\",\n [exports.WASI_SIGXFSZ]: \"SIGXFSZ\",\n [exports.WASI_SIGVTALRM]: \"SIGVTALRM\"\n };\n }\n}), require_wasi = __commonJS({\n \"node_modules/wasi-js/dist/wasi.js\"(exports) {\n var __importDefault = exports && exports.__importDefault || function(mod) {\n return mod && mod.__esModule \? mod : { default: mod };\n };\n let fs;\n Object.defineProperty(exports, \"__esModule\", { value: !0 }), exports.SOCKET_DEFAULT_RIGHTS = void 0;\n var log = () => {\n }, logOpen = () => {\n }, SC_OPEN_MAX = 32768, types_1 = require_types(), constants_1 = require_constants(), STDIN_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDOUT_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SYNC | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE, STDERR_DEFAULT_RIGHTS = STDOUT_DEFAULT_RIGHTS;\n exports.SOCKET_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ADVISE | constants_1.WASI_RIGHT_FD_FILESTAT_GET | constants_1.WASI_RIGHT_POLL_FD_READWRITE | constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS;\n var msToNs = (ms) => {\n const msInt = Math.trunc(ms), decimal = BigInt(Math.round((ms - msInt) * 1e6));\n return BigInt(msInt) * BigInt(1e6) + decimal;\n }, nsToMs = (ns) => {\n if (typeof ns === \"number\")\n ns = Math.trunc(ns);\n const nsInt = BigInt(ns);\n return Number(nsInt / BigInt(1e6));\n }, wrap = (f) => (...args) => {\n try {\n return f(...args);\n } catch (err) {\n let e = err;\n while (e.prev != null)\n e = e.prev;\n if (e\?.code && typeof e\?.code === \"string\")\n return constants_1.ERROR_MAP[e.code] || constants_1.WASI_EINVAL;\n if (e instanceof types_1.WASIError)\n return e.errno;\n throw e;\n }\n }, stat = (wasi, fd) => {\n const entry = wasi.FD_MAP.get(fd);\n if (!entry)\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n if (entry.filetype === void 0) {\n const stats = wasi.fstatSync(entry.real), { filetype, rightsBase, rightsInheriting } = translateFileAttributes(wasi, fd, stats);\n if (entry.filetype = filetype, !entry.rights)\n entry.rights = {\n base: rightsBase,\n inheriting: rightsInheriting\n };\n }\n return entry;\n }, translateFileAttributes = (wasi, fd, stats) => {\n switch (!0) {\n case stats.isBlockDevice():\n return {\n filetype: constants_1.WASI_FILETYPE_BLOCK_DEVICE,\n rightsBase: constants_1.RIGHTS_BLOCK_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_BLOCK_DEVICE_INHERITING\n };\n case stats.isCharacterDevice(): {\n const filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n if (fd !== void 0 && wasi.bindings.isTTY(fd))\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_TTY_BASE,\n rightsInheriting: constants_1.RIGHTS_TTY_INHERITING\n };\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_CHARACTER_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_CHARACTER_DEVICE_INHERITING\n };\n }\n case stats.isDirectory():\n return {\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rightsBase: constants_1.RIGHTS_DIRECTORY_BASE,\n rightsInheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n };\n case stats.isFIFO():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isFile():\n return {\n filetype: constants_1.WASI_FILETYPE_REGULAR_FILE,\n rightsBase: constants_1.RIGHTS_REGULAR_FILE_BASE,\n rightsInheriting: constants_1.RIGHTS_REGULAR_FILE_INHERITING\n };\n case stats.isSocket():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isSymbolicLink():\n return {\n filetype: constants_1.WASI_FILETYPE_SYMBOLIC_LINK,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n default:\n return {\n filetype: constants_1.WASI_FILETYPE_UNKNOWN,\n rightsBase: BigInt(0),\n rightsInheriting: BigInt(0)\n };\n }\n }, warnedAboutSleep = !1, defaultConfig;\n function getDefaults() {\n if (defaultConfig)\n return defaultConfig;\n const defaultBindings = {\n hrtime: () => process.hrtime.bigint(),\n exit: (code) => {\n process.exit(code);\n },\n kill: (signal) => {\n process.kill(process.pid, signal);\n },\n randomFillSync: (array) => crypto.getRandomValues(array),\n isTTY: (fd) => (@getInternalField(@internalModuleRegistry, 46) || @createInternalModuleById(46)).isatty(fd),\n fs: Bun.fs(),\n path: @getInternalField(@internalModuleRegistry, 30) || @createInternalModuleById(30)\n };\n return defaultConfig = {\n args: [],\n env: {},\n preopens: {},\n bindings: defaultBindings,\n sleep: (ms) => {\n Bun.sleepSync(ms);\n }\n };\n }\n var WASI = class WASI2 {\n constructor(wasiConfig = {}) {\n const defaultConfig2 = getDefaults();\n this.lastStdin = 0, this.sleep = wasiConfig.sleep || defaultConfig2.sleep, this.getStdin = wasiConfig.getStdin, this.sendStdout = wasiConfig.sendStdout, this.sendStderr = wasiConfig.sendStderr;\n let preopens = wasiConfig.preopens \?\? defaultConfig2.preopens;\n this.env = wasiConfig.env \?\? defaultConfig2.env;\n const args = wasiConfig.args \?\? defaultConfig2.args;\n this.memory = void 0, this.view = void 0, this.bindings = wasiConfig.bindings || defaultConfig2.bindings;\n const bindings2 = this.bindings;\n fs = bindings2.fs, this.FD_MAP = new Map([\n [\n constants_1.WASI_STDIN_FILENO,\n {\n real: 0,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdin\"\n }\n ],\n [\n constants_1.WASI_STDOUT_FILENO,\n {\n real: 1,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDOUT_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stdout\"\n }\n ],\n [\n constants_1.WASI_STDERR_FILENO,\n {\n real: 2,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n rights: {\n base: STDERR_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n },\n path: \"/dev/stderr\"\n }\n ]\n ]);\n const path = bindings2.path;\n for (let [k, v] of Object.entries(preopens)) {\n const real = fs.openSync(v, nodeFsConstants.O_RDONLY), newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real,\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rights: {\n base: constants_1.RIGHTS_DIRECTORY_BASE,\n inheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n },\n fakePath: k,\n path: v\n });\n }\n const getiovs = (iovs, iovsLen) => {\n this.refreshMemory();\n const { view, memory } = this, { buffer } = memory, { byteLength } = buffer;\n if (iovsLen === 1) {\n const ptr = iovs, buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n return [new @Uint8Array(buffer, buf, bufLen)];\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n const buffers = [];\n buffers.length = iovsLen;\n for (let i = 0, ptr = iovs;i < iovsLen; i++, ptr += 8) {\n const buf = view.getUint32(ptr, !0);\n let bufLen = view.getUint32(ptr + 4, !0);\n if (bufLen > byteLength - buf)\n console.log({\n buf,\n bufLen,\n total_memory: byteLength\n }), log(\"getiovs: warning -- truncating buffer to fit in memory\"), bufLen = Math.min(bufLen, Math.max(0, byteLength - buf));\n try {\n buffers[i] = new @Uint8Array(buffer, buf, bufLen);\n } catch (err) {\n throw console.warn(\"WASI.getiovs -- invalid buffer\", err), new types_1.WASIError(constants_1.WASI_EINVAL);\n }\n }\n return buffers;\n }, CHECK_FD = (fd, rights) => {\n const stats = stat(this, fd);\n if (rights !== BigInt(0) && (stats.rights.base & rights) === BigInt(0))\n throw new types_1.WASIError(constants_1.WASI_EPERM);\n return stats;\n }, CPUTIME_START = Bun.nanoseconds(), timeOrigin = Math.trunc(performance.timeOrigin * 1e6), now = (clockId) => {\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n return Bun.nanoseconds();\n case constants_1.WASI_CLOCK_REALTIME:\n return Bun.nanoseconds() + timeOrigin;\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID:\n return Bun.nanoseconds() - CPUTIME_START;\n default:\n return null;\n }\n };\n if (this.wasiImport = {\n args_get: (argv, argvBuf) => {\n this.refreshMemory();\n let coffset = argv, offset = argvBuf;\n return args.forEach((a) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += @Buffer.from(this.memory.buffer).write(`${a}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n args_sizes_get: (argc, argvBufSize) => {\n this.refreshMemory(), this.view.setUint32(argc, args.length, !0);\n const size = args.reduce((acc, a) => acc + @Buffer.byteLength(a) + 1, 0);\n return this.view.setUint32(argvBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n environ_get: (environ, environBuf) => {\n this.refreshMemory();\n let coffset = environ, offset = environBuf;\n return Object.entries(this.env).forEach(([key, value]) => {\n this.view.setUint32(coffset, offset, !0), coffset += 4, offset += @Buffer.from(this.memory.buffer).write(`${key}=${value}\\0`, offset);\n }), constants_1.WASI_ESUCCESS;\n },\n environ_sizes_get: (environCount, environBufSize) => {\n this.refreshMemory();\n const envProcessed = Object.entries(this.env).map(([key, value]) => `${key}=${value}\\0`), size = envProcessed.reduce((acc, e) => acc + @Buffer.byteLength(e), 0);\n return this.view.setUint32(environCount, envProcessed.length, !0), this.view.setUint32(environBufSize, size, !0), constants_1.WASI_ESUCCESS;\n },\n clock_res_get: (clockId, resolution) => {\n let res;\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID: {\n res = BigInt(1);\n break;\n }\n case constants_1.WASI_CLOCK_REALTIME: {\n res = BigInt(1000);\n break;\n }\n }\n if (!res)\n throw Error(\"invalid clockId\");\n return this.view.setBigUint64(resolution, res), constants_1.WASI_ESUCCESS;\n },\n clock_time_get: (clockId, _precision, time) => {\n this.refreshMemory();\n const n = now(clockId);\n if (n === null)\n return constants_1.WASI_EINVAL;\n return this.view.setBigUint64(time, BigInt(n), !0), constants_1.WASI_ESUCCESS;\n },\n fd_advise: wrap((fd, _offset, _len, _advice) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ADVISE), constants_1.WASI_ENOSYS;\n }),\n fd_allocate: wrap((fd, _offset, _len) => {\n return CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ALLOCATE), constants_1.WASI_ENOSYS;\n }),\n fd_close: wrap((fd) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return fs.closeSync(stats.real), this.FD_MAP.delete(fd), constants_1.WASI_ESUCCESS;\n }),\n fd_datasync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_DATASYNC);\n return fs.fdatasyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if (this.refreshMemory(), stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), this.view.setUint16(bufPtr + 2, 0, !0), this.view.setUint16(bufPtr + 4, 0, !0), this.view.setBigUint64(bufPtr + 8, BigInt(stats.rights.base), !0), this.view.setBigUint64(bufPtr + 8 + 8, BigInt(stats.rights.inheriting), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_set_flags: wrap((fd, flags) => {\n if (CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS), this.wasiImport.sock_fcntlSetFlags(fd, flags) == 0)\n return constants_1.WASI_ESUCCESS;\n return constants_1.WASI_ENOSYS;\n }),\n fd_fdstat_set_rights: wrap((fd, fsRightsBase, fsRightsInheriting) => {\n const stats = CHECK_FD(fd, BigInt(0));\n if ((stats.rights.base | fsRightsBase) > stats.rights.base)\n return constants_1.WASI_EPERM;\n if ((stats.rights.inheriting | fsRightsInheriting) > stats.rights.inheriting)\n return constants_1.WASI_EPERM;\n return stats.rights.base = fsRightsBase, stats.rights.inheriting = fsRightsInheriting, constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_GET), rstats = this.fstatSync(stats.real);\n if (this.refreshMemory(), this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, stats.filetype == null)\n throw Error(\"stats.filetype must be set\");\n return this.view.setUint8(bufPtr, stats.filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.atimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.mtimeMs), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, msToNs(rstats.ctimeMs), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_size: wrap((fd, stSize) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE);\n return fs.ftruncateSync(stats.real, Number(stSize)), constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_times: wrap((fd, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_TIMES), rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n return fs.futimesSync(stats.real, new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), this.view.setUint8(bufPtr, constants_1.WASI_PREOPENTYPE_DIR), this.view.setUint32(bufPtr + 4, @Buffer.byteLength(stats.fakePath \?\? stats.path \?\? \"\"), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_dir_name: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, BigInt(0));\n return this.refreshMemory(), @Buffer.from(this.memory.buffer).write(stats.fakePath \?\? stats.path \?\? \"\", pathPtr, pathLen, \"utf8\"), constants_1.WASI_ESUCCESS;\n }),\n fd_pwrite: wrap((fd, iovs, iovsLen, offset, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SEEK);\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n let w = 0;\n while (w < iov.byteLength)\n w += fs.writeSync(stats.real, iov, w, iov.byteLength - w, Number(offset) + written + w);\n written += w;\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_write: wrap((fd, iovs, iovsLen, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE), IS_STDOUT = fd == constants_1.WASI_STDOUT_FILENO, IS_STDERR = fd == constants_1.WASI_STDERR_FILENO;\n let written = 0;\n return getiovs(iovs, iovsLen).forEach((iov) => {\n if (iov.byteLength == 0)\n return;\n if (IS_STDOUT && this.sendStdout != null)\n this.sendStdout(iov), written += iov.byteLength;\n else if (IS_STDERR && this.sendStderr != null)\n this.sendStderr(iov), written += iov.byteLength;\n else {\n let w = 0;\n while (w < iov.byteLength) {\n const i = fs.writeSync(stats.real, iov, w, iov.byteLength - w, stats.offset \? Number(stats.offset) : null);\n if (stats.offset)\n stats.offset += BigInt(i);\n w += i;\n }\n written += w;\n }\n }), this.view.setUint32(nwritten, written, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_pread: wrap((fd, iovs, iovsLen, offset, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SEEK);\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n const length = iov.byteLength - r, rr = fs.readSync(stats.real, iov, r, iov.byteLength - r, Number(offset) + read + r);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n read += r;\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_read: wrap((fd, iovs, iovsLen, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ), IS_STDIN = fd == constants_1.WASI_STDIN_FILENO;\n let read = 0;\n outer:\n for (let iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n let length = iov.byteLength - r, position = IS_STDIN || stats.offset === void 0 \? null : Number(stats.offset), rr = 0;\n if (IS_STDIN)\n if (this.getStdin != null) {\n if (this.stdinBuffer == null)\n this.stdinBuffer = this.getStdin();\n if (this.stdinBuffer != null) {\n if (rr = this.stdinBuffer.copy(iov), rr == this.stdinBuffer.length)\n this.stdinBuffer = void 0;\n else\n this.stdinBuffer = this.stdinBuffer.slice(rr);\n if (rr > 0)\n this.lastStdin = (new Date()).valueOf();\n }\n } else {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(cpu waiting for stdin: please define a way to sleep!) \");\n try {\n rr = fs.readSync(stats.real, iov, r, length, position);\n } catch (_err) {\n }\n if (rr == 0)\n this.shortPause();\n else\n this.lastStdin = (new Date()).valueOf();\n }\n else\n rr = fs.readSync(stats.real, iov, r, length, position);\n if (stats.filetype == constants_1.WASI_FILETYPE_REGULAR_FILE)\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(rr);\n if (r += rr, read += rr, rr === 0 || rr < length)\n break outer;\n }\n }\n return this.view.setUint32(nread, read, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_readdir: wrap((fd, bufPtr, bufLen, cookie, bufusedPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READDIR);\n this.refreshMemory();\n const entries = fs.readdirSync(stats.path, { withFileTypes: !0 }), startPtr = bufPtr;\n for (let i = Number(cookie);i < entries.length; i += 1) {\n const entry = entries[i];\n let nameLength = @Buffer.byteLength(entry.name);\n if (bufPtr - startPtr > bufLen)\n break;\n if (this.view.setBigUint64(bufPtr, BigInt(i + 1), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n const rstats = fs.lstatSync(path.resolve(stats.path, entry.name));\n if (this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, bufPtr - startPtr > bufLen)\n break;\n if (this.view.setUint32(bufPtr, nameLength, !0), bufPtr += 4, bufPtr - startPtr > bufLen)\n break;\n let filetype;\n switch (!0) {\n case rstats.isBlockDevice():\n filetype = constants_1.WASI_FILETYPE_BLOCK_DEVICE;\n break;\n case rstats.isCharacterDevice():\n filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n break;\n case rstats.isDirectory():\n filetype = constants_1.WASI_FILETYPE_DIRECTORY;\n break;\n case rstats.isFIFO():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isFile():\n filetype = constants_1.WASI_FILETYPE_REGULAR_FILE;\n break;\n case rstats.isSocket():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isSymbolicLink():\n filetype = constants_1.WASI_FILETYPE_SYMBOLIC_LINK;\n break;\n default:\n filetype = constants_1.WASI_FILETYPE_UNKNOWN;\n break;\n }\n if (this.view.setUint8(bufPtr, filetype), bufPtr += 1, bufPtr += 3, bufPtr + nameLength >= startPtr + bufLen)\n break;\n @Buffer.from(this.memory.buffer).write(entry.name, bufPtr), bufPtr += nameLength;\n }\n const bufused = bufPtr - startPtr;\n return this.view.setUint32(bufusedPtr, Math.min(bufused, bufLen), !0), constants_1.WASI_ESUCCESS;\n }),\n fd_renumber: wrap((from, to) => {\n return CHECK_FD(from, BigInt(0)), CHECK_FD(to, BigInt(0)), fs.closeSync(this.FD_MAP.get(from).real), this.FD_MAP.set(from, this.FD_MAP.get(to)), this.FD_MAP.delete(to), constants_1.WASI_ESUCCESS;\n }),\n fd_seek: wrap((fd, offset, whence, newOffsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SEEK);\n switch (this.refreshMemory(), whence) {\n case constants_1.WASI_WHENCE_CUR:\n stats.offset = (stats.offset \? stats.offset : BigInt(0)) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_END:\n const { size } = this.fstatSync(stats.real);\n stats.offset = BigInt(size) + BigInt(offset);\n break;\n case constants_1.WASI_WHENCE_SET:\n stats.offset = BigInt(offset);\n break;\n }\n if (stats.offset == null)\n throw Error(\"stats.offset must be defined\");\n return this.view.setBigUint64(newOffsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_tell: wrap((fd, offsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_TELL);\n if (this.refreshMemory(), !stats.offset)\n stats.offset = BigInt(0);\n return this.view.setBigUint64(offsetPtr, stats.offset, !0), constants_1.WASI_ESUCCESS;\n }),\n fd_sync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SYNC);\n return fs.fsyncSync(stats.real), constants_1.WASI_ESUCCESS;\n }),\n path_create_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_CREATE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.mkdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_get: wrap((fd, flags, pathPtr, pathLen, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_GET);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n let rstats;\n if (flags)\n rstats = fs.statSync(path.resolve(stats.path, p));\n else\n rstats = fs.lstatSync(path.resolve(stats.path, p));\n return this.view.setBigUint64(bufPtr, BigInt(rstats.dev), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ino), !0), bufPtr += 8, this.view.setUint8(bufPtr, translateFileAttributes(this, void 0, rstats).filetype), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.nlink), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.size), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.atime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.mtime.getTime() * 1e6), !0), bufPtr += 8, this.view.setBigUint64(bufPtr, BigInt(rstats.ctime.getTime() * 1e6), !0), constants_1.WASI_ESUCCESS;\n }),\n path_filestat_set_times: wrap((fd, _dirflags, pathPtr, pathLen, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const rstats = this.fstatSync(stats.real);\n let { atime: atim, mtime: mtim } = rstats;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME)), atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags)\n return constants_1.WASI_EINVAL;\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags)\n return constants_1.WASI_EINVAL;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM)\n atim = nsToMs(stAtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW)\n atim = n;\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM)\n mtim = nsToMs(stMtim);\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW)\n mtim = n;\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.utimesSync(path.resolve(stats.path, p), new Date(atim), new Date(mtim)), constants_1.WASI_ESUCCESS;\n }),\n path_link: wrap((oldFd, _oldFlags, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_LINK_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_LINK_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = @Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = @Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.linkSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_open: wrap((dirfd, _dirflags, pathPtr, pathLen, oflags, fsRightsBase, fsRightsInheriting, fsFlags, fdPtr) => {\n try {\n const stats = CHECK_FD(dirfd, constants_1.WASI_RIGHT_PATH_OPEN);\n fsRightsBase = BigInt(fsRightsBase), fsRightsInheriting = BigInt(fsRightsInheriting);\n const read = (fsRightsBase & (constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_READDIR)) !== BigInt(0), write = (fsRightsBase & (constants_1.WASI_RIGHT_FD_DATASYNC | constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_ALLOCATE | constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE)) !== BigInt(0);\n let noflags;\n if (write && read)\n noflags = nodeFsConstants.O_RDWR;\n else if (read)\n noflags = nodeFsConstants.O_RDONLY;\n else if (write)\n noflags = nodeFsConstants.O_WRONLY;\n let neededBase = fsRightsBase | constants_1.WASI_RIGHT_PATH_OPEN, neededInheriting = fsRightsBase | fsRightsInheriting;\n if ((oflags & constants_1.WASI_O_CREAT) !== 0)\n noflags |= nodeFsConstants.O_CREAT, neededBase |= constants_1.WASI_RIGHT_PATH_CREATE_FILE;\n if ((oflags & constants_1.WASI_O_DIRECTORY) !== 0)\n noflags |= nodeFsConstants.O_DIRECTORY;\n if ((oflags & constants_1.WASI_O_EXCL) !== 0)\n noflags |= nodeFsConstants.O_EXCL;\n if ((oflags & constants_1.WASI_O_TRUNC) !== 0)\n noflags |= nodeFsConstants.O_TRUNC, neededBase |= constants_1.WASI_RIGHT_PATH_FILESTAT_SET_SIZE;\n if ((fsFlags & constants_1.WASI_FDFLAG_APPEND) !== 0)\n noflags |= nodeFsConstants.O_APPEND;\n if ((fsFlags & constants_1.WASI_FDFLAG_DSYNC) !== 0) {\n if (nodeFsConstants.O_DSYNC)\n noflags |= nodeFsConstants.O_DSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_DATASYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_NONBLOCK) !== 0)\n noflags |= nodeFsConstants.O_NONBLOCK;\n if ((fsFlags & constants_1.WASI_FDFLAG_RSYNC) !== 0) {\n if (nodeFsConstants.O_RSYNC)\n noflags |= nodeFsConstants.O_RSYNC;\n else\n noflags |= nodeFsConstants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_SYNC) !== 0)\n noflags |= nodeFsConstants.O_SYNC, neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n if (write && (noflags & (nodeFsConstants.O_APPEND | nodeFsConstants.O_TRUNC)) === 0)\n neededInheriting |= constants_1.WASI_RIGHT_FD_SEEK;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n if (p == \"dev/tty\")\n return this.view.setUint32(fdPtr, constants_1.WASI_STDIN_FILENO, !0), constants_1.WASI_ESUCCESS;\n if (logOpen(\"path_open\", p), p.startsWith(\"proc/\"))\n throw new types_1.WASIError(constants_1.WASI_EBADF);\n const fullUnresolved = path.resolve(p);\n let full;\n try {\n full = fs.realpathSync(fullUnresolved);\n } catch (e) {\n if (e\?.code === \"ENOENT\")\n full = fullUnresolved;\n else\n throw e;\n }\n let isDirectory;\n if (write)\n try {\n isDirectory = fs.statSync(full).isDirectory();\n } catch (_err) {\n }\n let realfd;\n if (!write && isDirectory)\n realfd = fs.openSync(full, nodeFsConstants.O_RDONLY);\n else\n realfd = fs.openSync(full, noflags);\n const newfd = this.getUnusedFileDescriptor();\n this.FD_MAP.set(newfd, {\n real: realfd,\n filetype: void 0,\n rights: {\n base: neededBase,\n inheriting: neededInheriting\n },\n path: full\n }), stat(this, newfd), this.view.setUint32(fdPtr, newfd, !0);\n } catch (e) {\n console.error(e);\n }\n return constants_1.WASI_ESUCCESS;\n }),\n path_readlink: wrap((fd, pathPtr, pathLen, buf, bufLen, bufused) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_READLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString(), full = path.resolve(stats.path, p), r = fs.readlinkSync(full), used = @Buffer.from(this.memory.buffer).write(r, buf, bufLen);\n return this.view.setUint32(bufused, used, !0), constants_1.WASI_ESUCCESS;\n }),\n path_remove_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_REMOVE_DIRECTORY);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.rmdirSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n path_rename: wrap((oldFd, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_RENAME_SOURCE), nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_RENAME_TARGET);\n if (!ostats.path || !nstats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = @Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = @Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.renameSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_symlink: wrap((oldPath, oldPathLen, fd, newPath, newPathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_SYMLINK);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const op = @Buffer.from(this.memory.buffer, oldPath, oldPathLen).toString(), np = @Buffer.from(this.memory.buffer, newPath, newPathLen).toString();\n return fs.symlinkSync(op, path.resolve(stats.path, np)), constants_1.WASI_ESUCCESS;\n }),\n path_unlink_file: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_UNLINK_FILE);\n if (!stats.path)\n return constants_1.WASI_EINVAL;\n this.refreshMemory();\n const p = @Buffer.from(this.memory.buffer, pathPtr, pathLen).toString();\n return fs.unlinkSync(path.resolve(stats.path, p)), constants_1.WASI_ESUCCESS;\n }),\n poll_oneoff: (sin, sout, nsubscriptions, neventsPtr) => {\n let nevents = 0, name = \"\", waitTimeNs = BigInt(0), fd = -1, fd_type = \"read\", fd_timeout_ms = 0;\n const startNs = BigInt(bindings2.hrtime());\n this.refreshMemory();\n let last_sin = sin;\n for (let i = 0;i < nsubscriptions; i += 1) {\n const userdata = this.view.getBigUint64(sin, !0);\n sin += 8;\n const type = this.view.getUint8(sin);\n if (sin += 1, sin += 7, log.enabled) {\n if (type == constants_1.WASI_EVENTTYPE_CLOCK)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_CLOCK): \";\n else if (type == constants_1.WASI_EVENTTYPE_FD_READ)\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_READ): \";\n else\n name = \"poll_oneoff (type=WASI_EVENTTYPE_FD_WRITE): \";\n log(name);\n }\n switch (type) {\n case constants_1.WASI_EVENTTYPE_CLOCK: {\n const clockid = this.view.getUint32(sin, !0);\n sin += 4, sin += 4;\n const timeout = this.view.getBigUint64(sin, !0);\n sin += 8, sin += 8;\n const subclockflags = this.view.getUint16(sin, !0);\n sin += 2, sin += 6;\n const absolute = subclockflags === 1;\n if (log.enabled)\n log(name, { clockid, timeout, absolute });\n if (!absolute)\n fd_timeout_ms = timeout / BigInt(1e6);\n let e = constants_1.WASI_ESUCCESS;\n const t = now(clockid);\n if (t == null)\n e = constants_1.WASI_EINVAL;\n else {\n const tNS = BigInt(t), waitNs = (absolute \? timeout : tNS + timeout) - tNS;\n if (waitNs > waitTimeNs)\n waitTimeNs = waitNs;\n }\n this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, e, !0), sout += 2, this.view.setUint8(sout, constants_1.WASI_EVENTTYPE_CLOCK), sout += 1, sout += 5, nevents += 1;\n break;\n }\n case constants_1.WASI_EVENTTYPE_FD_READ:\n case constants_1.WASI_EVENTTYPE_FD_WRITE: {\n if (fd = this.view.getUint32(sin, !0), fd_type = type == constants_1.WASI_EVENTTYPE_FD_READ \? \"read\" : \"write\", sin += 4, log(name, \"fd =\", fd), sin += 28, this.view.setBigUint64(sout, userdata, !0), sout += 8, this.view.setUint16(sout, constants_1.WASI_ENOSYS, !0), sout += 2, this.view.setUint8(sout, type), sout += 1, sout += 5, nevents += 1, fd == constants_1.WASI_STDIN_FILENO && constants_1.WASI_EVENTTYPE_FD_READ == type)\n this.shortPause();\n break;\n }\n default:\n return constants_1.WASI_EINVAL;\n }\n if (sin - last_sin != 48)\n console.warn(\"*** BUG in wasi-js in poll_oneoff \", {\n i,\n sin,\n last_sin,\n diff: sin - last_sin\n });\n last_sin = sin;\n }\n if (this.view.setUint32(neventsPtr, nevents, !0), nevents == 2 && fd >= 0) {\n const r = this.wasiImport.sock_pollSocket(fd, fd_type, fd_timeout_ms);\n if (r != constants_1.WASI_ENOSYS)\n return r;\n }\n if (waitTimeNs > 0) {\n if (waitTimeNs -= Bun.nanoseconds() - timeOrigin, waitTimeNs >= 1e6) {\n if (this.sleep == null && !warnedAboutSleep)\n warnedAboutSleep = !0, console.log(\"(100% cpu burning waiting for stdin: please define a way to sleep!) \");\n if (this.sleep != null) {\n const ms = nsToMs(waitTimeNs);\n this.sleep(ms);\n } else {\n const end = BigInt(bindings2.hrtime()) + waitTimeNs;\n while (BigInt(bindings2.hrtime()) < end)\n ;\n }\n }\n }\n return constants_1.WASI_ESUCCESS;\n },\n proc_exit: (rval) => {\n return bindings2.exit(rval), constants_1.WASI_ESUCCESS;\n },\n proc_raise: (sig) => {\n if (!(sig in constants_1.SIGNAL_MAP))\n return constants_1.WASI_EINVAL;\n return bindings2.kill(constants_1.SIGNAL_MAP[sig]), constants_1.WASI_ESUCCESS;\n },\n random_get: (bufPtr, bufLen) => {\n return this.refreshMemory(), crypto.getRandomValues(this.memory.buffer, bufPtr, bufLen), bufLen;\n },\n sched_yield() {\n return constants_1.WASI_ESUCCESS;\n },\n sock_recv() {\n return constants_1.WASI_ENOSYS;\n },\n sock_send() {\n return constants_1.WASI_ENOSYS;\n },\n sock_shutdown() {\n return constants_1.WASI_ENOSYS;\n },\n sock_fcntlSetFlags(_fd, _flags) {\n return constants_1.WASI_ENOSYS;\n },\n sock_pollSocket(_fd, _eventtype, _timeout_ms) {\n return constants_1.WASI_ENOSYS;\n }\n }, log.enabled)\n Object.keys(this.wasiImport).forEach((key) => {\n const prevImport = this.wasiImport[key];\n this.wasiImport[key] = function(...args2) {\n log(key, args2);\n try {\n let result = prevImport(...args2);\n return log(\"result\", result), result;\n } catch (e) {\n throw log(\"error: \", e), e;\n }\n };\n });\n }\n getState() {\n return { env: this.env, FD_MAP: this.FD_MAP, bindings };\n }\n setState(state) {\n this.env = state.env, this.FD_MAP = state.FD_MAP, bindings = state.bindings;\n }\n fstatSync(real_fd) {\n if (real_fd <= 2)\n try {\n return fs.fstatSync(real_fd);\n } catch (_) {\n const now = new Date;\n return {\n dev: 0,\n mode: 8592,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n blksize: 65536,\n ino: 0,\n size: 0,\n blocks: 0,\n atimeMs: now.valueOf(),\n mtimeMs: now.valueOf(),\n ctimeMs: now.valueOf(),\n birthtimeMs: 0,\n atime: new Date,\n mtime: new Date,\n ctime: new Date,\n birthtime: new Date(0)\n };\n }\n return fs.fstatSync(real_fd);\n }\n shortPause() {\n if (this.sleep == null)\n return;\n if ((new Date()).valueOf() - this.lastStdin > 2000)\n this.sleep(50);\n }\n getUnusedFileDescriptor(start = 3) {\n let fd = start;\n while (this.FD_MAP.has(fd))\n fd += 1;\n if (fd > SC_OPEN_MAX)\n throw Error(\"no available file descriptors\");\n return fd;\n }\n refreshMemory() {\n if (!this.view || this.view.buffer.byteLength === 0)\n this.view = new DataView(this.memory.buffer);\n }\n setMemory(memory) {\n this.memory = memory;\n }\n start(instance, memory) {\n const exports2 = instance.exports;\n if (exports2 === null || typeof exports2 !== \"object\")\n throw new Error(`instance.exports must be an Object. Received ${exports2}.`);\n if (memory == null) {\n if (memory = exports2.memory, !(memory instanceof WebAssembly.Memory))\n throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${memory}.`);\n }\n if (this.setMemory(memory), exports2._start)\n exports2._start();\n }\n getImports(module2) {\n let namespace = null;\n const imports = WebAssembly.Module.imports(module2);\n for (let imp of imports) {\n if (imp.kind !== \"function\")\n continue;\n if (!imp.module.startsWith(\"wasi_\"))\n continue;\n namespace = imp.module;\n break;\n }\n switch (namespace) {\n case \"wasi_unstable\":\n return {\n wasi_unstable: this.wasiImport\n };\n case \"wasi_snapshot_preview1\":\n return {\n wasi_snapshot_preview1: this.wasiImport\n };\n default:\n throw new Error(\"No WASI namespace found. Only wasi_unstable and wasi_snapshot_preview1 are supported.\\n\\nList of imports:\\n\\n\" + imports.map(({ name, kind, module }) => `${module}:${name} (${kind})`).join(\"\\n\") + \"\\n\");\n }\n }\n initWasiFdInfo() {\n if (this.env.WASI_FD_INFO != null) {\n const fdInfo = JSON.parse(this.env.WASI_FD_INFO);\n for (let wasi_fd in fdInfo) {\n console.log(wasi_fd);\n const fd = parseInt(wasi_fd);\n if (this.FD_MAP.has(fd))\n continue;\n const real = fdInfo[wasi_fd];\n try {\n this.fstatSync(real);\n } catch (_err) {\n console.log(\"discarding \", { wasi_fd, real });\n continue;\n }\n const file = {\n real,\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: BigInt(0)\n }\n };\n this.FD_MAP.set(fd, file);\n }\n console.log(\"after initWasiFdInfo: \", this.FD_MAP), console.log(\"fdInfo = \", fdInfo);\n } else\n console.log(\"no WASI_FD_INFO\");\n }\n };\n exports.default = WASI;\n }\n});\nreturn { WASI: require_wasi().default }})\n");
//
//
-static constexpr ASCIILiteral NodeWorkerThreadsCode = "(function (){\"use strict\";// src/js/out/tmp/node/worker_threads.ts\nvar emitWarning = function(type, message) {\n if (emittedWarnings.has(type))\n return;\n emittedWarnings.add(type), console.warn(\"[bun] Warning:\", message);\n}, injectFakeEmitter = function(Class) {\n function messageEventHandler(event) {\n return event.data;\n }\n function errorEventHandler(event) {\n return event.error;\n }\n const wrappedListener = Symbol(\"wrappedListener\");\n function wrapped(run, listener) {\n const callback = function(event) {\n return listener(run(event));\n };\n return listener[wrappedListener] = callback, callback;\n }\n function functionForEventType(event, listener) {\n switch (event) {\n case \"error\":\n case \"messageerror\":\n return wrapped(errorEventHandler, listener);\n default:\n return wrapped(messageEventHandler, listener);\n }\n }\n Class.prototype.on = function(event, listener) {\n return this.addEventListener(event, functionForEventType(event, listener)), this;\n }, Class.prototype.off = function(event, listener) {\n if (listener)\n this.removeEventListener(event, listener[wrappedListener] || listener);\n else\n this.removeEventListener(event);\n return this;\n }, Class.prototype.once = function(event, listener) {\n return this.addEventListener(event, functionForEventType(event, listener), { once: !0 }), this;\n };\n function EventClass(eventName) {\n if (eventName === \"error\" || eventName === \"messageerror\")\n return ErrorEvent;\n return MessageEvent;\n }\n Class.prototype.emit = function(event, ...args) {\n return this.dispatchEvent(new (EventClass(event))(event, ...args)), this;\n }, Class.prototype.prependListener = Class.prototype.on, Class.prototype.prependOnceListener = Class.prototype.once;\n}, receiveMessageOnPort = function(port) {\n let res = _receiveMessageOnPort(port);\n if (!res)\n return;\n return {\n message: res\n };\n}, fakeParentPort = function() {\n const fake = Object.create(MessagePort.prototype);\n return Object.defineProperty(fake, \"onmessage\", {\n get() {\n return self.onmessage;\n },\n set(value) {\n self.onmessage = value;\n }\n }), Object.defineProperty(fake, \"onmessageerror\", {\n get() {\n return self.onmessageerror;\n },\n set(value) {\n }\n }), Object.defineProperty(fake, \"postMessage\", {\n value(...args) {\n return self.postMessage(...args);\n }\n }), Object.defineProperty(fake, \"close\", {\n value() {\n return process.exit(0);\n }\n }), Object.defineProperty(fake, \"start\", {\n value() {\n }\n }), Object.defineProperty(fake, \"unref\", {\n value() {\n }\n }), Object.defineProperty(fake, \"ref\", {\n value() {\n }\n }), Object.defineProperty(fake, \"hasRef\", {\n value() {\n return !1;\n }\n }), Object.defineProperty(fake, \"setEncoding\", {\n value() {\n }\n }), Object.defineProperty(fake, \"addEventListener\", {\n value: self.addEventListener.bind(self)\n }), Object.defineProperty(fake, \"removeEventListener\", {\n value: self.removeEventListener.bind(self)\n }), fake;\n}, getEnvironmentData = function() {\n return process.env;\n}, setEnvironmentData = function(env) {\n process.env = env;\n}, markAsUntransferable = function() {\n throwNotImplemented(\"worker_threads.markAsUntransferable\");\n}, moveMessagePortToContext = function() {\n throwNotImplemented(\"worker_threads.moveMessagePortToContext\");\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 5) || @createInternalModuleById(5), { MessageChannel, BroadcastChannel, Worker: WebWorker } = globalThis, SHARE_ENV = Symbol(\"nodejs.worker_threads.SHARE_ENV\"), isMainThread = Bun.isMainThread, [_workerData, _threadId, _receiveMessageOnPort] = globalThis[globalThis.Symbol.for('Bun.lazy')](\"worker_threads\"), emittedWarnings = new Set, _MessagePort = globalThis.MessagePort;\ninjectFakeEmitter(_MessagePort);\nvar MessagePort = _MessagePort, resourceLimits = {}, workerData = _workerData, threadId = _threadId, parentPort = isMainThread \? null : fakeParentPort(), unsupportedOptions = [\n \"eval\",\n \"argv\",\n \"execArgv\",\n \"stdin\",\n \"stdout\",\n \"stderr\",\n \"trackedUnmanagedFds\",\n \"resourceLimits\"\n];\n\nclass Worker extends EventEmitter {\n #worker;\n #performance;\n #onExitPromise = void 0;\n constructor(filename, options = {}) {\n super();\n for (let key of unsupportedOptions)\n if (key in options)\n emitWarning(\"option.\" + key, `worker_threads.Worker option \"${key}\" is not implemented.`);\n this.#worker = new WebWorker(filename, options), this.#worker.addEventListener(\"close\", this.#onClose.bind(this)), this.#worker.addEventListener(\"error\", this.#onError.bind(this)), this.#worker.addEventListener(\"message\", this.#onMessage.bind(this)), this.#worker.addEventListener(\"messageerror\", this.#onMessageError.bind(this)), this.#worker.addEventListener(\"open\", this.#onOpen.bind(this));\n }\n ref() {\n this.#worker.ref();\n }\n unref() {\n this.#worker.unref();\n }\n get stdin() {\n return null;\n }\n get stdout() {\n return null;\n }\n get stderr() {\n return null;\n }\n get performance() {\n return this.#performance \?\?= {\n eventLoopUtilization() {\n return emitWarning(\"performance\", \"worker_threads.Worker.performance is not implemented.\"), {\n idle: 0,\n active: 0,\n utilization: 0\n };\n }\n };\n }\n terminate() {\n var onExitPromise = this.#onExitPromise;\n if (onExitPromise)\n return @isPromise(onExitPromise) \? onExitPromise : Promise.resolve(onExitPromise);\n const { resolve, promise } = Promise.withResolvers();\n return this.#worker.addEventListener(\"close\", (event) => {\n resolve(event.code);\n }, { once: !0 }), this.#worker.terminate(), this.#onExitPromise = promise;\n }\n postMessage(...args) {\n return this.#worker.postMessage(...args);\n }\n #onClose(e) {\n this.#onExitPromise = e.code, this.emit(\"exit\", e.code);\n }\n #onError(error) {\n this.emit(\"error\", error);\n }\n #onMessage(event) {\n this.emit(\"message\", event.data);\n }\n #onMessageError(event) {\n this.emit(\"messageerror\", event.error \?\? event.data \?\? event);\n }\n #onOpen() {\n this.emit(\"online\");\n }\n async getHeapSnapshot() {\n throwNotImplemented(\"worker_threads.Worker.getHeapSnapshot\");\n }\n}\n$ = {\n Worker,\n workerData,\n parentPort,\n resourceLimits,\n isMainThread,\n MessageChannel,\n BroadcastChannel,\n MessagePort,\n getEnvironmentData,\n setEnvironmentData,\n getHeapSnapshot() {\n return {};\n },\n markAsUntransferable,\n moveMessagePortToContext,\n receiveMessageOnPort,\n SHARE_ENV,\n threadId\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeWorkerThreadsCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/worker_threads.ts\nvar emitWarning = function(type, message) {\n if (emittedWarnings.has(type))\n return;\n emittedWarnings.add(type), console.warn(\"[bun] Warning:\", message);\n}, injectFakeEmitter = function(Class) {\n function messageEventHandler(event) {\n return event.data;\n }\n function errorEventHandler(event) {\n return event.error;\n }\n const wrappedListener = Symbol(\"wrappedListener\");\n function wrapped(run, listener) {\n const callback = function(event) {\n return listener(run(event));\n };\n return listener[wrappedListener] = callback, callback;\n }\n function functionForEventType(event, listener) {\n switch (event) {\n case \"error\":\n case \"messageerror\":\n return wrapped(errorEventHandler, listener);\n default:\n return wrapped(messageEventHandler, listener);\n }\n }\n Class.prototype.on = function(event, listener) {\n return this.addEventListener(event, functionForEventType(event, listener)), this;\n }, Class.prototype.off = function(event, listener) {\n if (listener)\n this.removeEventListener(event, listener[wrappedListener] || listener);\n else\n this.removeEventListener(event);\n return this;\n }, Class.prototype.once = function(event, listener) {\n return this.addEventListener(event, functionForEventType(event, listener), { once: !0 }), this;\n };\n function EventClass(eventName) {\n if (eventName === \"error\" || eventName === \"messageerror\")\n return ErrorEvent;\n return MessageEvent;\n }\n Class.prototype.emit = function(event, ...args) {\n return this.dispatchEvent(new (EventClass(event))(event, ...args)), this;\n }, Class.prototype.prependListener = Class.prototype.on, Class.prototype.prependOnceListener = Class.prototype.once;\n}, receiveMessageOnPort = function(port) {\n let res = _receiveMessageOnPort(port);\n if (!res)\n return @undefined;\n return {\n message: res\n };\n}, fakeParentPort = function() {\n const fake = Object.create(MessagePort.prototype);\n return Object.defineProperty(fake, \"onmessage\", {\n get() {\n return self.onmessage;\n },\n set(value) {\n self.onmessage = value;\n }\n }), Object.defineProperty(fake, \"onmessageerror\", {\n get() {\n return self.onmessageerror;\n },\n set(value) {\n }\n }), Object.defineProperty(fake, \"postMessage\", {\n value(...args) {\n return self.postMessage(...args);\n }\n }), Object.defineProperty(fake, \"close\", {\n value() {\n return process.exit(0);\n }\n }), Object.defineProperty(fake, \"start\", {\n value() {\n }\n }), Object.defineProperty(fake, \"unref\", {\n value() {\n }\n }), Object.defineProperty(fake, \"ref\", {\n value() {\n }\n }), Object.defineProperty(fake, \"hasRef\", {\n value() {\n return !1;\n }\n }), Object.defineProperty(fake, \"setEncoding\", {\n value() {\n }\n }), Object.defineProperty(fake, \"addEventListener\", {\n value: self.addEventListener.bind(self)\n }), Object.defineProperty(fake, \"removeEventListener\", {\n value: self.removeEventListener.bind(self)\n }), fake;\n}, getEnvironmentData = function() {\n return process.env;\n}, setEnvironmentData = function(env) {\n process.env = env;\n}, markAsUntransferable = function() {\n throwNotImplemented(\"worker_threads.markAsUntransferable\");\n}, moveMessagePortToContext = function() {\n throwNotImplemented(\"worker_threads.moveMessagePortToContext\");\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), { throwNotImplemented } = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), { MessageChannel, BroadcastChannel, Worker: WebWorker } = globalThis, SHARE_ENV = Symbol(\"nodejs.worker_threads.SHARE_ENV\"), isMainThread = Bun.isMainThread, [_workerData, _threadId, _receiveMessageOnPort] = @lazy(\"worker_threads\"), emittedWarnings = new Set, _MessagePort = globalThis.MessagePort;\ninjectFakeEmitter(_MessagePort);\nvar MessagePort = _MessagePort, resourceLimits = {}, workerData = _workerData, threadId = _threadId, parentPort = isMainThread \? null : fakeParentPort(), unsupportedOptions = [\n \"eval\",\n \"argv\",\n \"execArgv\",\n \"stdin\",\n \"stdout\",\n \"stderr\",\n \"trackedUnmanagedFds\",\n \"resourceLimits\"\n];\n\nclass Worker extends EventEmitter {\n #worker;\n #performance;\n #onExitPromise = @undefined;\n constructor(filename, options = {}) {\n super();\n for (let key of unsupportedOptions)\n if (key in options)\n emitWarning(\"option.\" + key, `worker_threads.Worker option \"${key}\" is not implemented.`);\n this.#worker = new WebWorker(filename, options), this.#worker.addEventListener(\"close\", this.#onClose.bind(this)), this.#worker.addEventListener(\"error\", this.#onError.bind(this)), this.#worker.addEventListener(\"message\", this.#onMessage.bind(this)), this.#worker.addEventListener(\"messageerror\", this.#onMessageError.bind(this)), this.#worker.addEventListener(\"open\", this.#onOpen.bind(this));\n }\n get threadId() {\n return this.#worker.threadId;\n }\n ref() {\n this.#worker.ref();\n }\n unref() {\n this.#worker.unref();\n }\n get stdin() {\n return null;\n }\n get stdout() {\n return null;\n }\n get stderr() {\n return null;\n }\n get performance() {\n return this.#performance \?\?= {\n eventLoopUtilization() {\n return emitWarning(\"performance\", \"worker_threads.Worker.performance is not implemented.\"), {\n idle: 0,\n active: 0,\n utilization: 0\n };\n }\n };\n }\n terminate() {\n const onExitPromise = this.#onExitPromise;\n if (onExitPromise)\n return @isPromise(onExitPromise) \? onExitPromise : @Promise.resolve(onExitPromise);\n const { resolve, promise } = @Promise.withResolvers();\n return this.#worker.addEventListener(\"close\", (event) => {\n resolve(event.code);\n }, { once: !0 }), this.#worker.terminate(), this.#onExitPromise = promise;\n }\n postMessage(...args) {\n return this.#worker.postMessage(...args);\n }\n #onClose(e) {\n this.#onExitPromise = e.code, this.emit(\"exit\", e.code);\n }\n #onError(error) {\n this.emit(\"error\", error);\n }\n #onMessage(event) {\n this.emit(\"message\", event.data);\n }\n #onMessageError(event) {\n this.emit(\"messageerror\", event.error \?\? event.data \?\? event);\n }\n #onOpen() {\n this.emit(\"online\");\n }\n async getHeapSnapshot() {\n throwNotImplemented(\"worker_threads.Worker.getHeapSnapshot\");\n }\n}\n$ = {\n Worker,\n workerData,\n parentPort,\n resourceLimits,\n isMainThread,\n MessageChannel,\n BroadcastChannel,\n MessagePort,\n getEnvironmentData,\n setEnvironmentData,\n getHeapSnapshot() {\n return {};\n },\n markAsUntransferable,\n moveMessagePortToContext,\n receiveMessageOnPort,\n SHARE_ENV,\n threadId\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral NodeZlibCode = "(function (){\"use strict\";// src/js/out/tmp/node/zlib.ts\nvar assert = @getInternalField(@internalModuleRegistry, 6) || @createInternalModuleById(6), BufferModule = @requireNativeModule(\"buffer\"), StreamModule = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), Util = @getInternalField(@internalModuleRegistry, 46) || @createInternalModuleById(46), __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_zstream = __commonJS({\n \"node_modules/pako/lib/zlib/zstream.js\"(exports, module2) {\n function ZStream() {\n this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = \"\", this.state = null, this.data_type = 2, this.adler = 0;\n }\n module2.exports = ZStream;\n }\n}), require_common = __commonJS({\n \"node_modules/pako/lib/utils/common.js\"(exports) {\n var TYPED_OK = typeof Uint8Array !== \"undefined\" && typeof Uint16Array !== \"undefined\" && typeof Int32Array !== \"undefined\";\n function _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n }\n exports.assign = function(obj) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source)\n continue;\n if (typeof source !== \"object\")\n @throwTypeError(source + \"must be non-object\");\n for (var p in source)\n if (_has(source, p))\n obj[p] = source[p];\n }\n return obj;\n }, exports.shrinkBuf = function(buf, size) {\n if (buf.length === size)\n return buf;\n if (buf.subarray)\n return buf.subarray(0, size);\n return buf.length = size, buf;\n };\n var fnTyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n var i, l, len, pos, chunk, result;\n len = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n len += chunks[i].length;\n result = new Uint8Array(len), pos = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n chunk = chunks[i], result.set(chunk, pos), pos += chunk.length;\n return result;\n }\n }, fnUntyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n return [].concat.apply([], chunks);\n }\n };\n exports.setTyped = function(on) {\n if (on)\n exports.Buf8 = Uint8Array, exports.Buf16 = Uint16Array, exports.Buf32 = Int32Array, exports.assign(exports, fnTyped);\n else\n exports.Buf8 = Array, exports.Buf16 = Array, exports.Buf32 = Array, exports.assign(exports, fnUntyped);\n }, exports.setTyped(TYPED_OK);\n }\n}), require_trees = __commonJS({\n \"node_modules/pako/lib/zlib/trees.js\"(exports) {\n var utils = require_common(), Z_FIXED = 4, Z_BINARY = 0, Z_TEXT = 1, Z_UNKNOWN = 2;\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n var STORED_BLOCK = 0, STATIC_TREES = 1, DYN_TREES = 2, MIN_MATCH = 3, MAX_MATCH = 258, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, Buf_size = 16, MAX_BL_BITS = 7, END_BLOCK = 256, REP_3_6 = 16, REPZ_3_10 = 17, REPZ_11_138 = 18, extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], extra_dbits = [\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 4,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 8,\n 8,\n 9,\n 9,\n 10,\n 10,\n 11,\n 11,\n 12,\n 12,\n 13,\n 13\n ], extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], DIST_CODE_LEN = 512, static_ltree = new Array((L_CODES + 2) * 2);\n zero(static_ltree);\n var static_dtree = new Array(D_CODES * 2);\n zero(static_dtree);\n var _dist_code = new Array(DIST_CODE_LEN);\n zero(_dist_code);\n var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\n zero(_length_code);\n var base_length = new Array(LENGTH_CODES);\n zero(base_length);\n var base_dist = new Array(D_CODES);\n zero(base_dist);\n function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree, this.extra_bits = extra_bits, this.extra_base = extra_base, this.elems = elems, this.max_length = max_length, this.has_stree = static_tree && static_tree.length;\n }\n var static_l_desc, static_d_desc, static_bl_desc;\n function TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree, this.max_code = 0, this.stat_desc = stat_desc;\n }\n function d_code(dist) {\n return dist < 256 \? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n }\n function put_short(s, w) {\n s.pending_buf[s.pending++] = w & 255, s.pending_buf[s.pending++] = w >>> 8 & 255;\n }\n function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length)\n s.bi_buf |= value << s.bi_valid & 65535, put_short(s, s.bi_buf), s.bi_buf = value >> Buf_size - s.bi_valid, s.bi_valid += length - Buf_size;\n else\n s.bi_buf |= value << s.bi_valid & 65535, s.bi_valid += length;\n }\n function send_code(s, c, tree) {\n send_bits(s, tree[c * 2], tree[c * 2 + 1]);\n }\n function bi_reverse(code, len) {\n var res = 0;\n do\n res |= code & 1, code >>>= 1, res <<= 1;\n while (--len > 0);\n return res >>> 1;\n }\n function bi_flush(s) {\n if (s.bi_valid === 16)\n put_short(s, s.bi_buf), s.bi_buf = 0, s.bi_valid = 0;\n else if (s.bi_valid >= 8)\n s.pending_buf[s.pending++] = s.bi_buf & 255, s.bi_buf >>= 8, s.bi_valid -= 8;\n }\n function gen_bitlen(s, desc) {\n var { dyn_tree: tree, max_code } = desc, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, extra = desc.stat_desc.extra_bits, base = desc.stat_desc.extra_base, max_length = desc.stat_desc.max_length, h, n, m, bits, xbits, f, overflow = 0;\n for (bits = 0;bits <= MAX_BITS; bits++)\n s.bl_count[bits] = 0;\n tree[s.heap[s.heap_max] * 2 + 1] = 0;\n for (h = s.heap_max + 1;h < HEAP_SIZE; h++) {\n if (n = s.heap[h], bits = tree[tree[n * 2 + 1] * 2 + 1] + 1, bits > max_length)\n bits = max_length, overflow++;\n if (tree[n * 2 + 1] = bits, n > max_code)\n continue;\n if (s.bl_count[bits]++, xbits = 0, n >= base)\n xbits = extra[n - base];\n if (f = tree[n * 2], s.opt_len += f * (bits + xbits), has_stree)\n s.static_len += f * (stree[n * 2 + 1] + xbits);\n }\n if (overflow === 0)\n return;\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0)\n bits--;\n s.bl_count[bits]--, s.bl_count[bits + 1] += 2, s.bl_count[max_length]--, overflow -= 2;\n } while (overflow > 0);\n for (bits = max_length;bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n if (m = s.heap[--h], m > max_code)\n continue;\n if (tree[m * 2 + 1] !== bits)\n s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2], tree[m * 2 + 1] = bits;\n n--;\n }\n }\n }\n function gen_codes(tree, max_code, bl_count) {\n var next_code = new Array(MAX_BITS + 1), code = 0, bits, n;\n for (bits = 1;bits <= MAX_BITS; bits++)\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n for (n = 0;n <= max_code; n++) {\n var len = tree[n * 2 + 1];\n if (len === 0)\n continue;\n tree[n * 2] = bi_reverse(next_code[len]++, len);\n }\n }\n function tr_static_init() {\n var n, bits, length, code, dist, bl_count = new Array(MAX_BITS + 1);\n length = 0;\n for (code = 0;code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0;n < 1 << extra_lbits[code]; n++)\n _length_code[length++] = code;\n }\n _length_code[length - 1] = code, dist = 0;\n for (code = 0;code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0;n < 1 << extra_dbits[code]; n++)\n _dist_code[dist++] = code;\n }\n dist >>= 7;\n for (;code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0;n < 1 << extra_dbits[code] - 7; n++)\n _dist_code[256 + dist++] = code;\n }\n for (bits = 0;bits <= MAX_BITS; bits++)\n bl_count[bits] = 0;\n n = 0;\n while (n <= 143)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n while (n <= 255)\n static_ltree[n * 2 + 1] = 9, n++, bl_count[9]++;\n while (n <= 279)\n static_ltree[n * 2 + 1] = 7, n++, bl_count[7]++;\n while (n <= 287)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n for (n = 0;n < D_CODES; n++)\n static_dtree[n * 2 + 1] = 5, static_dtree[n * 2] = bi_reverse(n, 5);\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS), static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS), static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n }\n function init_block(s) {\n var n;\n for (n = 0;n < L_CODES; n++)\n s.dyn_ltree[n * 2] = 0;\n for (n = 0;n < D_CODES; n++)\n s.dyn_dtree[n * 2] = 0;\n for (n = 0;n < BL_CODES; n++)\n s.bl_tree[n * 2] = 0;\n s.dyn_ltree[END_BLOCK * 2] = 1, s.opt_len = s.static_len = 0, s.last_lit = s.matches = 0;\n }\n function bi_windup(s) {\n if (s.bi_valid > 8)\n put_short(s, s.bi_buf);\n else if (s.bi_valid > 0)\n s.pending_buf[s.pending++] = s.bi_buf;\n s.bi_buf = 0, s.bi_valid = 0;\n }\n function copy_block(s, buf, len, header) {\n if (bi_windup(s), header)\n put_short(s, len), put_short(s, ~len);\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending), s.pending += len;\n }\n function smaller(tree, n, m, depth) {\n var _n2 = n * 2, _m2 = m * 2;\n return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];\n }\n function pqdownheap(s, tree, k) {\n var v = s.heap[k], j = k << 1;\n while (j <= s.heap_len) {\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth))\n j++;\n if (smaller(tree, v, s.heap[j], s.depth))\n break;\n s.heap[k] = s.heap[j], k = j, j <<= 1;\n }\n s.heap[k] = v;\n }\n function compress_block(s, ltree, dtree) {\n var dist, lc, lx = 0, code, extra;\n if (s.last_lit !== 0)\n do\n if (dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1], lc = s.pending_buf[s.l_buf + lx], lx++, dist === 0)\n send_code(s, lc, ltree);\n else {\n if (code = _length_code[lc], send_code(s, code + LITERALS + 1, ltree), extra = extra_lbits[code], extra !== 0)\n lc -= base_length[code], send_bits(s, lc, extra);\n if (dist--, code = d_code(dist), send_code(s, code, dtree), extra = extra_dbits[code], extra !== 0)\n dist -= base_dist[code], send_bits(s, dist, extra);\n }\n while (lx < s.last_lit);\n send_code(s, END_BLOCK, ltree);\n }\n function build_tree(s, desc) {\n var tree = desc.dyn_tree, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, elems = desc.stat_desc.elems, n, m, max_code = -1, node;\n s.heap_len = 0, s.heap_max = HEAP_SIZE;\n for (n = 0;n < elems; n++)\n if (tree[n * 2] !== 0)\n s.heap[++s.heap_len] = max_code = n, s.depth[n] = 0;\n else\n tree[n * 2 + 1] = 0;\n while (s.heap_len < 2)\n if (node = s.heap[++s.heap_len] = max_code < 2 \? ++max_code : 0, tree[node * 2] = 1, s.depth[node] = 0, s.opt_len--, has_stree)\n s.static_len -= stree[node * 2 + 1];\n desc.max_code = max_code;\n for (n = s.heap_len >> 1;n >= 1; n--)\n pqdownheap(s, tree, n);\n node = elems;\n do\n n = s.heap[1], s.heap[1] = s.heap[s.heap_len--], pqdownheap(s, tree, 1), m = s.heap[1], s.heap[--s.heap_max] = n, s.heap[--s.heap_max] = m, tree[node * 2] = tree[n * 2] + tree[m * 2], s.depth[node] = (s.depth[n] >= s.depth[m] \? s.depth[n] : s.depth[m]) + 1, tree[n * 2 + 1] = tree[m * 2 + 1] = node, s.heap[1] = node++, pqdownheap(s, tree, 1);\n while (s.heap_len >= 2);\n s.heap[--s.heap_max] = s.heap[1], gen_bitlen(s, desc), gen_codes(tree, max_code, s.bl_count);\n }\n function scan_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n tree[(max_code + 1) * 2 + 1] = 65535;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n s.bl_tree[curlen * 2] += count;\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n s.bl_tree[curlen * 2]++;\n s.bl_tree[REP_3_6 * 2]++;\n } else if (count <= 10)\n s.bl_tree[REPZ_3_10 * 2]++;\n else\n s.bl_tree[REPZ_11_138 * 2]++;\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function send_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n do\n send_code(s, curlen, s.bl_tree);\n while (--count !== 0);\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n send_code(s, curlen, s.bl_tree), count--;\n send_code(s, REP_3_6, s.bl_tree), send_bits(s, count - 3, 2);\n } else if (count <= 10)\n send_code(s, REPZ_3_10, s.bl_tree), send_bits(s, count - 3, 3);\n else\n send_code(s, REPZ_11_138, s.bl_tree), send_bits(s, count - 11, 7);\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function build_bl_tree(s) {\n var max_blindex;\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code), scan_tree(s, s.dyn_dtree, s.d_desc.max_code), build_tree(s, s.bl_desc);\n for (max_blindex = BL_CODES - 1;max_blindex >= 3; max_blindex--)\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0)\n break;\n return s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4, max_blindex;\n }\n function send_all_trees(s, lcodes, dcodes, blcodes) {\n var rank;\n send_bits(s, lcodes - 257, 5), send_bits(s, dcodes - 1, 5), send_bits(s, blcodes - 4, 4);\n for (rank = 0;rank < blcodes; rank++)\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);\n send_tree(s, s.dyn_ltree, lcodes - 1), send_tree(s, s.dyn_dtree, dcodes - 1);\n }\n function detect_data_type(s) {\n var black_mask = 4093624447, n;\n for (n = 0;n <= 31; n++, black_mask >>>= 1)\n if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0)\n return Z_BINARY;\n if (s.dyn_ltree[18] !== 0 || s.dyn_ltree[20] !== 0 || s.dyn_ltree[26] !== 0)\n return Z_TEXT;\n for (n = 32;n < LITERALS; n++)\n if (s.dyn_ltree[n * 2] !== 0)\n return Z_TEXT;\n return Z_BINARY;\n }\n var static_init_done = !1;\n function _tr_init(s) {\n if (!static_init_done)\n tr_static_init(), static_init_done = !0;\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc), s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc), s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc), s.bi_buf = 0, s.bi_valid = 0, init_block(s);\n }\n function _tr_stored_block(s, buf, stored_len, last) {\n send_bits(s, (STORED_BLOCK << 1) + (last \? 1 : 0), 3), copy_block(s, buf, stored_len, !0);\n }\n function _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3), send_code(s, END_BLOCK, static_ltree), bi_flush(s);\n }\n function _tr_flush_block(s, buf, stored_len, last) {\n var opt_lenb, static_lenb, max_blindex = 0;\n if (s.level > 0) {\n if (s.strm.data_type === Z_UNKNOWN)\n s.strm.data_type = detect_data_type(s);\n if (build_tree(s, s.l_desc), build_tree(s, s.d_desc), max_blindex = build_bl_tree(s), opt_lenb = s.opt_len + 3 + 7 >>> 3, static_lenb = s.static_len + 3 + 7 >>> 3, static_lenb <= opt_lenb)\n opt_lenb = static_lenb;\n } else\n opt_lenb = static_lenb = stored_len + 5;\n if (stored_len + 4 <= opt_lenb && buf !== -1)\n _tr_stored_block(s, buf, stored_len, last);\n else if (s.strategy === Z_FIXED || static_lenb === opt_lenb)\n send_bits(s, (STATIC_TREES << 1) + (last \? 1 : 0), 3), compress_block(s, static_ltree, static_dtree);\n else\n send_bits(s, (DYN_TREES << 1) + (last \? 1 : 0), 3), send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1), compress_block(s, s.dyn_ltree, s.dyn_dtree);\n if (init_block(s), last)\n bi_windup(s);\n }\n function _tr_tally(s, dist, lc) {\n if (s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255, s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255, s.pending_buf[s.l_buf + s.last_lit] = lc & 255, s.last_lit++, dist === 0)\n s.dyn_ltree[lc * 2]++;\n else\n s.matches++, dist--, s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++, s.dyn_dtree[d_code(dist) * 2]++;\n return s.last_lit === s.lit_bufsize - 1;\n }\n exports._tr_init = _tr_init, exports._tr_stored_block = _tr_stored_block, exports._tr_flush_block = _tr_flush_block, exports._tr_tally = _tr_tally, exports._tr_align = _tr_align;\n }\n}), require_adler32 = __commonJS({\n \"node_modules/pako/lib/zlib/adler32.js\"(exports, module2) {\n function adler32(adler, buf, len, pos) {\n var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;\n while (len !== 0) {\n n = len > 2000 \? 2000 : len, len -= n;\n do\n s1 = s1 + buf[pos++] | 0, s2 = s2 + s1 | 0;\n while (--n);\n s1 %= 65521, s2 %= 65521;\n }\n return s1 | s2 << 16 | 0;\n }\n module2.exports = adler32;\n }\n}), require_crc32 = __commonJS({\n \"node_modules/pako/lib/zlib/crc32.js\"(exports, module2) {\n function makeTable() {\n var c, table = [];\n for (var n = 0;n < 256; n++) {\n c = n;\n for (var k = 0;k < 8; k++)\n c = c & 1 \? 3988292384 ^ c >>> 1 : c >>> 1;\n table[n] = c;\n }\n return table;\n }\n var crcTable = makeTable();\n function crc32(crc, buf, len, pos) {\n var t = crcTable, end = pos + len;\n crc ^= -1;\n for (var i = pos;i < end; i++)\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];\n return crc ^ -1;\n }\n module2.exports = crc32;\n }\n}), require_messages = __commonJS({\n \"node_modules/pako/lib/zlib/messages.js\"(exports, module2) {\n module2.exports = {\n 2: \"need dictionary\",\n 1: \"stream end\",\n 0: \"\",\n \"-1\": \"file error\",\n \"-2\": \"stream error\",\n \"-3\": \"data error\",\n \"-4\": \"insufficient memory\",\n \"-5\": \"buffer error\",\n \"-6\": \"incompatible version\"\n };\n }\n}), require_deflate = __commonJS({\n \"node_modules/pako/lib/zlib/deflate.js\"(exports) {\n var utils = require_common(), trees = require_trees(), adler32 = require_adler32(), crc32 = require_crc32(), msg = require_messages(), Z_NO_FLUSH = 0, Z_PARTIAL_FLUSH = 1, Z_FULL_FLUSH = 3, Z_FINISH = 4, Z_BLOCK = 5, Z_OK = 0, Z_STREAM_END = 1, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_BUF_ERROR = -5, Z_DEFAULT_COMPRESSION = -1, Z_FILTERED = 1, Z_HUFFMAN_ONLY = 2, Z_RLE = 3, Z_FIXED = 4, Z_DEFAULT_STRATEGY = 0, Z_UNKNOWN = 2, Z_DEFLATED = 8, MAX_MEM_LEVEL = 9, MAX_WBITS = 15, DEF_MEM_LEVEL = 8, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, MIN_MATCH = 3, MAX_MATCH = 258, MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, PRESET_DICT = 32, INIT_STATE = 42, EXTRA_STATE = 69, NAME_STATE = 73, COMMENT_STATE = 91, HCRC_STATE = 103, BUSY_STATE = 113, FINISH_STATE = 666, BS_NEED_MORE = 1, BS_BLOCK_DONE = 2, BS_FINISH_STARTED = 3, BS_FINISH_DONE = 4, OS_CODE = 3;\n function err(strm, errorCode) {\n return strm.msg = msg[errorCode], errorCode;\n }\n function rank(f) {\n return (f << 1) - (f > 4 \? 9 : 0);\n }\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n function flush_pending(strm) {\n var s = strm.state, len = s.pending;\n if (len > strm.avail_out)\n len = strm.avail_out;\n if (len === 0)\n return;\n if (utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out), strm.next_out += len, s.pending_out += len, strm.total_out += len, strm.avail_out -= len, s.pending -= len, s.pending === 0)\n s.pending_out = 0;\n }\n function flush_block_only(s, last) {\n trees._tr_flush_block(s, s.block_start >= 0 \? s.block_start : -1, s.strstart - s.block_start, last), s.block_start = s.strstart, flush_pending(s.strm);\n }\n function put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n }\n function putShortMSB(s, b) {\n s.pending_buf[s.pending++] = b >>> 8 & 255, s.pending_buf[s.pending++] = b & 255;\n }\n function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n if (len > size)\n len = size;\n if (len === 0)\n return 0;\n if (strm.avail_in -= len, utils.arraySet(buf, strm.input, strm.next_in, len, start), strm.state.wrap === 1)\n strm.adler = adler32(strm.adler, buf, len, start);\n else if (strm.state.wrap === 2)\n strm.adler = crc32(strm.adler, buf, len, start);\n return strm.next_in += len, strm.total_in += len, len;\n }\n function longest_match(s, cur_match) {\n var { max_chain_length: chain_length, strstart: scan } = s, match, len, best_len = s.prev_length, nice_match = s.nice_match, limit = s.strstart > s.w_size - MIN_LOOKAHEAD \? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0, _win = s.window, wmask = s.w_mask, prev = s.prev, strend = s.strstart + MAX_MATCH, scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n if (s.prev_length >= s.good_match)\n chain_length >>= 2;\n if (nice_match > s.lookahead)\n nice_match = s.lookahead;\n do {\n if (match = cur_match, _win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1])\n continue;\n scan += 2, match++;\n do\n ;\n while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);\n if (len = MAX_MATCH - (strend - scan), scan = strend - MAX_MATCH, len > best_len) {\n if (s.match_start = cur_match, best_len = len, len >= nice_match)\n break;\n scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n if (best_len <= s.lookahead)\n return best_len;\n return s.lookahead;\n }\n function fill_window(s) {\n var _w_size = s.w_size, p, n, m, more, str;\n do {\n if (more = s.window_size - s.lookahead - s.strstart, s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0), s.match_start -= _w_size, s.strstart -= _w_size, s.block_start -= _w_size, n = s.hash_size, p = n;\n do\n m = s.head[--p], s.head[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n n = _w_size, p = n;\n do\n m = s.prev[--p], s.prev[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n more += _w_size;\n }\n if (s.strm.avail_in === 0)\n break;\n if (n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more), s.lookahead += n, s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert, s.ins_h = s.window[str], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;\n while (s.insert)\n if (s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++, s.insert--, s.lookahead + s.insert < MIN_MATCH)\n break;\n }\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n }\n function deflate_stored(s, flush) {\n var max_block_size = 65535;\n if (max_block_size > s.pending_buf_size - 5)\n max_block_size = s.pending_buf_size - 5;\n for (;; ) {\n if (s.lookahead <= 1) {\n if (fill_window(s), s.lookahead === 0 && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n s.strstart += s.lookahead, s.lookahead = 0;\n var max_start = s.block_start + max_block_size;\n if (s.strstart === 0 || s.strstart >= max_start) {\n if (s.lookahead = s.strstart - max_start, s.strstart = max_start, flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.strstart > s.block_start) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_NEED_MORE;\n }\n function deflate_fast(s, flush) {\n var hash_head, bflush;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD)\n s.match_length = longest_match(s, hash_head);\n if (s.match_length >= MIN_MATCH)\n if (bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n do\n s.strstart++, s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.match_length !== 0);\n s.strstart++;\n } else\n s.strstart += s.match_length, s.match_length = 0, s.ins_h = s.window[s.strstart], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_slow(s, flush) {\n var hash_head, bflush, max_insert;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (s.prev_length = s.match_length, s.prev_match = s.match_start, s.match_length = MIN_MATCH - 1, hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n if (s.match_length = longest_match(s, hash_head), s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096))\n s.match_length = MIN_MATCH - 1;\n }\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH, bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH), s.lookahead -= s.prev_length - 1, s.prev_length -= 2;\n do\n if (++s.strstart <= max_insert)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.prev_length !== 0);\n if (s.match_available = 0, s.match_length = MIN_MATCH - 1, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n } else if (s.match_available) {\n if (bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), bflush)\n flush_block_only(s, !1);\n if (s.strstart++, s.lookahead--, s.strm.avail_out === 0)\n return BS_NEED_MORE;\n } else\n s.match_available = 1, s.strstart++, s.lookahead--;\n }\n if (s.match_available)\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), s.match_available = 0;\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_rle(s, flush) {\n var bflush, prev, scan, strend, _win = s.window;\n for (;; ) {\n if (s.lookahead <= MAX_MATCH) {\n if (fill_window(s), s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (s.match_length = 0, s.lookahead >= MIN_MATCH && s.strstart > 0) {\n if (scan = s.strstart - 1, prev = _win[scan], prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do\n ;\n while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n if (s.match_length = MAX_MATCH - (strend - scan), s.match_length > s.lookahead)\n s.match_length = s.lookahead;\n }\n }\n if (s.match_length >= MIN_MATCH)\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.strstart += s.match_length, s.match_length = 0;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_huff(s, flush) {\n var bflush;\n for (;; ) {\n if (s.lookahead === 0) {\n if (fill_window(s), s.lookahead === 0) {\n if (flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n break;\n }\n }\n if (s.match_length = 0, bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length, this.max_lazy = max_lazy, this.nice_length = nice_length, this.max_chain = max_chain, this.func = func;\n }\n var configuration_table = [\n new Config(0, 0, 0, 0, deflate_stored),\n new Config(4, 4, 8, 4, deflate_fast),\n new Config(4, 5, 16, 8, deflate_fast),\n new Config(4, 6, 32, 32, deflate_fast),\n new Config(4, 4, 16, 16, deflate_slow),\n new Config(8, 16, 32, 32, deflate_slow),\n new Config(8, 16, 128, 128, deflate_slow),\n new Config(8, 32, 128, 256, deflate_slow),\n new Config(32, 128, 258, 1024, deflate_slow),\n new Config(32, 258, 258, 4096, deflate_slow)\n ];\n function lm_init(s) {\n s.window_size = 2 * s.w_size, zero(s.head), s.max_lazy_match = configuration_table[s.level].max_lazy, s.good_match = configuration_table[s.level].good_length, s.nice_match = configuration_table[s.level].nice_length, s.max_chain_length = configuration_table[s.level].max_chain, s.strstart = 0, s.block_start = 0, s.lookahead = 0, s.insert = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, s.ins_h = 0;\n }\n function DeflateState() {\n this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Z_DEFLATED, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2), this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2), this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2), zero(this.dyn_ltree), zero(this.dyn_dtree), zero(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new utils.Buf16(MAX_BITS + 1), this.heap = new utils.Buf16(2 * L_CODES + 1), zero(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new utils.Buf16(2 * L_CODES + 1), zero(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;\n }\n function deflateResetKeep(strm) {\n var s;\n if (!strm || !strm.state)\n return err(strm, Z_STREAM_ERROR);\n if (strm.total_in = strm.total_out = 0, strm.data_type = Z_UNKNOWN, s = strm.state, s.pending = 0, s.pending_out = 0, s.wrap < 0)\n s.wrap = -s.wrap;\n return s.status = s.wrap \? INIT_STATE : BUSY_STATE, strm.adler = s.wrap === 2 \? 0 : 1, s.last_flush = Z_NO_FLUSH, trees._tr_init(s), Z_OK;\n }\n function deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK)\n lm_init(strm.state);\n return ret;\n }\n function deflateSetHeader(strm, head) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (strm.state.wrap !== 2)\n return Z_STREAM_ERROR;\n return strm.state.gzhead = head, Z_OK;\n }\n function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm)\n return Z_STREAM_ERROR;\n var wrap = 1;\n if (level === Z_DEFAULT_COMPRESSION)\n level = 6;\n if (windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (windowBits > 15)\n wrap = 2, windowBits -= 16;\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED)\n return err(strm, Z_STREAM_ERROR);\n if (windowBits === 8)\n windowBits = 9;\n var s = new DeflateState;\n return strm.state = s, s.strm = strm, s.wrap = wrap, s.gzhead = null, s.w_bits = windowBits, s.w_size = 1 << s.w_bits, s.w_mask = s.w_size - 1, s.hash_bits = memLevel + 7, s.hash_size = 1 << s.hash_bits, s.hash_mask = s.hash_size - 1, s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH), s.window = new utils.Buf8(s.w_size * 2), s.head = new utils.Buf16(s.hash_size), s.prev = new utils.Buf16(s.w_size), s.lit_bufsize = 1 << memLevel + 6, s.pending_buf_size = s.lit_bufsize * 4, s.pending_buf = new utils.Buf8(s.pending_buf_size), s.d_buf = 1 * s.lit_bufsize, s.l_buf = 3 * s.lit_bufsize, s.level = level, s.strategy = strategy, s.method = method, deflateReset(strm);\n }\n function deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n }\n function deflate(strm, flush) {\n var old_flush, s, beg, val;\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0)\n return strm \? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n if (s = strm.state, !strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH)\n return err(strm, strm.avail_out === 0 \? Z_BUF_ERROR : Z_STREAM_ERROR);\n if (s.strm = strm, old_flush = s.last_flush, s.last_flush = flush, s.status === INIT_STATE)\n if (s.wrap === 2)\n if (strm.adler = 0, put_byte(s, 31), put_byte(s, 139), put_byte(s, 8), !s.gzhead)\n put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, OS_CODE), s.status = BUSY_STATE;\n else {\n if (put_byte(s, (s.gzhead.text \? 1 : 0) + (s.gzhead.hcrc \? 2 : 0) + (!s.gzhead.extra \? 0 : 4) + (!s.gzhead.name \? 0 : 8) + (!s.gzhead.comment \? 0 : 16)), put_byte(s, s.gzhead.time & 255), put_byte(s, s.gzhead.time >> 8 & 255), put_byte(s, s.gzhead.time >> 16 & 255), put_byte(s, s.gzhead.time >> 24 & 255), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length)\n put_byte(s, s.gzhead.extra.length & 255), put_byte(s, s.gzhead.extra.length >> 8 & 255);\n if (s.gzhead.hcrc)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n s.gzindex = 0, s.status = EXTRA_STATE;\n }\n else {\n var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8, level_flags = -1;\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2)\n level_flags = 0;\n else if (s.level < 6)\n level_flags = 1;\n else if (s.level === 6)\n level_flags = 2;\n else\n level_flags = 3;\n if (header |= level_flags << 6, s.strstart !== 0)\n header |= PRESET_DICT;\n if (header += 31 - header % 31, s.status = BUSY_STATE, putShortMSB(s, header), s.strstart !== 0)\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n strm.adler = 1;\n }\n if (s.status === EXTRA_STATE)\n if (s.gzhead.extra) {\n beg = s.pending;\n while (s.gzindex < (s.gzhead.extra.length & 65535)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size)\n break;\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 255), s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (s.gzindex === s.gzhead.extra.length)\n s.gzindex = 0, s.status = NAME_STATE;\n } else\n s.status = NAME_STATE;\n if (s.status === NAME_STATE)\n if (s.gzhead.name) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.name.length)\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.gzindex = 0, s.status = COMMENT_STATE;\n } else\n s.status = COMMENT_STATE;\n if (s.status === COMMENT_STATE)\n if (s.gzhead.comment) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.comment.length)\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.status = HCRC_STATE;\n } else\n s.status = HCRC_STATE;\n if (s.status === HCRC_STATE)\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size)\n flush_pending(strm);\n if (s.pending + 2 <= s.pending_buf_size)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), strm.adler = 0, s.status = BUSY_STATE;\n } else\n s.status = BUSY_STATE;\n if (s.pending !== 0) {\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH)\n return err(strm, Z_BUF_ERROR);\n if (s.status === FINISH_STATE && strm.avail_in !== 0)\n return err(strm, Z_BUF_ERROR);\n if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY \? deflate_huff(s, flush) : s.strategy === Z_RLE \? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE)\n s.status = FINISH_STATE;\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0)\n s.last_flush = -1;\n return Z_OK;\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH)\n trees._tr_align(s);\n else if (flush !== Z_BLOCK) {\n if (trees._tr_stored_block(s, 0, 0, !1), flush === Z_FULL_FLUSH) {\n if (zero(s.head), s.lookahead === 0)\n s.strstart = 0, s.block_start = 0, s.insert = 0;\n }\n }\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n }\n }\n if (flush !== Z_FINISH)\n return Z_OK;\n if (s.wrap <= 0)\n return Z_STREAM_END;\n if (s.wrap === 2)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), put_byte(s, strm.adler >> 16 & 255), put_byte(s, strm.adler >> 24 & 255), put_byte(s, strm.total_in & 255), put_byte(s, strm.total_in >> 8 & 255), put_byte(s, strm.total_in >> 16 & 255), put_byte(s, strm.total_in >> 24 & 255);\n else\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n if (flush_pending(strm), s.wrap > 0)\n s.wrap = -s.wrap;\n return s.pending !== 0 \? Z_OK : Z_STREAM_END;\n }\n function deflateEnd(strm) {\n var status;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (status = strm.state.status, status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE)\n return err(strm, Z_STREAM_ERROR);\n return strm.state = null, status === BUSY_STATE \? err(strm, Z_DATA_ERROR) : Z_OK;\n }\n function deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, s, str, n, wrap, avail, next, input, tmpDict;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (s = strm.state, wrap = s.wrap, wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead)\n return Z_STREAM_ERROR;\n if (wrap === 1)\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n if (s.wrap = 0, dictLength >= s.w_size) {\n if (wrap === 0)\n zero(s.head), s.strstart = 0, s.block_start = 0, s.insert = 0;\n tmpDict = new utils.Buf8(s.w_size), utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0), dictionary = tmpDict, dictLength = s.w_size;\n }\n avail = strm.avail_in, next = strm.next_in, input = strm.input, strm.avail_in = dictLength, strm.next_in = 0, strm.input = dictionary, fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart, n = s.lookahead - (MIN_MATCH - 1);\n do\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++;\n while (--n);\n s.strstart = str, s.lookahead = MIN_MATCH - 1, fill_window(s);\n }\n return s.strstart += s.lookahead, s.block_start = s.strstart, s.insert = s.lookahead, s.lookahead = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, strm.next_in = next, strm.input = input, strm.avail_in = avail, s.wrap = wrap, Z_OK;\n }\n exports.deflateInit = deflateInit, exports.deflateInit2 = deflateInit2, exports.deflateReset = deflateReset, exports.deflateResetKeep = deflateResetKeep, exports.deflateSetHeader = deflateSetHeader, exports.deflate = deflate, exports.deflateEnd = deflateEnd, exports.deflateSetDictionary = deflateSetDictionary, exports.deflateInfo = \"pako deflate (from Nodeca project)\";\n }\n}), require_inffast = __commonJS({\n \"node_modules/pako/lib/zlib/inffast.js\"(exports, module2) {\n var BAD = 30, TYPE = 12;\n module2.exports = function inflate_fast(strm, start) {\n var state, _in, last, _out, beg, end, dmax, wsize, whave, wnext, s_window, hold, bits, lcode, dcode, lmask, dmask, here, op, len, dist, from, from_source, input, output;\n state = strm.state, _in = strm.next_in, input = strm.input, last = _in + (strm.avail_in - 5), _out = strm.next_out, output = strm.output, beg = _out - (start - strm.avail_out), end = _out + (strm.avail_out - 257), dmax = state.dmax, wsize = state.wsize, whave = state.whave, wnext = state.wnext, s_window = state.window, hold = state.hold, bits = state.bits, lcode = state.lencode, dcode = state.distcode, lmask = (1 << state.lenbits) - 1, dmask = (1 << state.distbits) - 1;\n top:\n do {\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = lcode[hold & lmask];\n dolen:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op === 0)\n output[_out++] = here & 65535;\n else if (op & 16) {\n if (len = here & 65535, op &= 15, op) {\n if (bits < op)\n hold += input[_in++] << bits, bits += 8;\n len += hold & (1 << op) - 1, hold >>>= op, bits -= op;\n }\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = dcode[hold & dmask];\n dodist:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op & 16) {\n if (dist = here & 65535, op &= 15, bits < op) {\n if (hold += input[_in++] << bits, bits += 8, bits < op)\n hold += input[_in++] << bits, bits += 8;\n }\n if (dist += hold & (1 << op) - 1, dist > dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n if (hold >>>= op, bits -= op, op = _out - beg, dist > op) {\n if (op = dist - op, op > whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n }\n if (from = 0, from_source = s_window, wnext === 0) {\n if (from += wsize - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n } else if (wnext < op) {\n if (from += wsize + wnext - op, op -= wnext, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n if (from = 0, wnext < len) {\n op = wnext, len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n }\n } else if (from += wnext - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n while (len > 2)\n output[_out++] = from_source[from++], output[_out++] = from_source[from++], output[_out++] = from_source[from++], len -= 3;\n if (len) {\n if (output[_out++] = from_source[from++], len > 1)\n output[_out++] = from_source[from++];\n }\n } else {\n from = _out - dist;\n do\n output[_out++] = output[from++], output[_out++] = output[from++], output[_out++] = output[from++], len -= 3;\n while (len > 2);\n if (len) {\n if (output[_out++] = output[from++], len > 1)\n output[_out++] = output[from++];\n }\n }\n } else if ((op & 64) === 0) {\n here = dcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } else if ((op & 64) === 0) {\n here = lcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) {\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } while (_in < last && _out < end);\n len = bits >> 3, _in -= len, bits -= len << 3, hold &= (1 << bits) - 1, strm.next_in = _in, strm.next_out = _out, strm.avail_in = _in < last \? 5 + (last - _in) : 5 - (_in - last), strm.avail_out = _out < end \? 257 + (end - _out) : 257 - (_out - end), state.hold = hold, state.bits = bits;\n return;\n };\n }\n}), require_inftrees = __commonJS({\n \"node_modules/pako/lib/zlib/inftrees.js\"(exports, module2) {\n var utils = require_common(), MAXBITS = 15, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, CODES = 0, LENS = 1, DISTS = 2, lbase = [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 13,\n 15,\n 17,\n 19,\n 23,\n 27,\n 31,\n 35,\n 43,\n 51,\n 59,\n 67,\n 83,\n 99,\n 115,\n 131,\n 163,\n 195,\n 227,\n 258,\n 0,\n 0\n ], lext = [\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 17,\n 17,\n 18,\n 18,\n 18,\n 18,\n 19,\n 19,\n 19,\n 19,\n 20,\n 20,\n 20,\n 20,\n 21,\n 21,\n 21,\n 21,\n 16,\n 72,\n 78\n ], dbase = [\n 1,\n 2,\n 3,\n 4,\n 5,\n 7,\n 9,\n 13,\n 17,\n 25,\n 33,\n 49,\n 65,\n 97,\n 129,\n 193,\n 257,\n 385,\n 513,\n 769,\n 1025,\n 1537,\n 2049,\n 3073,\n 4097,\n 6145,\n 8193,\n 12289,\n 16385,\n 24577,\n 0,\n 0\n ], dext = [\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 18,\n 18,\n 19,\n 19,\n 20,\n 20,\n 21,\n 21,\n 22,\n 22,\n 23,\n 23,\n 24,\n 24,\n 25,\n 25,\n 26,\n 26,\n 27,\n 27,\n 28,\n 28,\n 29,\n 29,\n 64,\n 64\n ];\n module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n var bits = opts.bits, len = 0, sym = 0, min = 0, max = 0, root = 0, curr = 0, drop = 0, left = 0, used = 0, huff = 0, incr, fill, low, mask, next, base = null, base_index = 0, end, count = new utils.Buf16(MAXBITS + 1), offs = new utils.Buf16(MAXBITS + 1), extra = null, extra_index = 0, here_bits, here_op, here_val;\n for (len = 0;len <= MAXBITS; len++)\n count[len] = 0;\n for (sym = 0;sym < codes; sym++)\n count[lens[lens_index + sym]]++;\n root = bits;\n for (max = MAXBITS;max >= 1; max--)\n if (count[max] !== 0)\n break;\n if (root > max)\n root = max;\n if (max === 0)\n return table[table_index++] = 1 << 24 | 64 << 16 | 0, table[table_index++] = 1 << 24 | 64 << 16 | 0, opts.bits = 1, 0;\n for (min = 1;min < max; min++)\n if (count[min] !== 0)\n break;\n if (root < min)\n root = min;\n left = 1;\n for (len = 1;len <= MAXBITS; len++)\n if (left <<= 1, left -= count[len], left < 0)\n return -1;\n if (left > 0 && (type === CODES || max !== 1))\n return -1;\n offs[1] = 0;\n for (len = 1;len < MAXBITS; len++)\n offs[len + 1] = offs[len] + count[len];\n for (sym = 0;sym < codes; sym++)\n if (lens[lens_index + sym] !== 0)\n work[offs[lens[lens_index + sym]]++] = sym;\n if (type === CODES)\n base = extra = work, end = 19;\n else if (type === LENS)\n base = lbase, base_index -= 257, extra = lext, extra_index -= 257, end = 256;\n else\n base = dbase, extra = dext, end = -1;\n if (huff = 0, sym = 0, len = min, next = table_index, curr = root, drop = 0, low = -1, used = 1 << root, mask = used - 1, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n for (;; ) {\n if (here_bits = len - drop, work[sym] < end)\n here_op = 0, here_val = work[sym];\n else if (work[sym] > end)\n here_op = extra[extra_index + work[sym]], here_val = base[base_index + work[sym]];\n else\n here_op = 96, here_val = 0;\n incr = 1 << len - drop, fill = 1 << curr, min = fill;\n do\n fill -= incr, table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;\n while (fill !== 0);\n incr = 1 << len - 1;\n while (huff & incr)\n incr >>= 1;\n if (incr !== 0)\n huff &= incr - 1, huff += incr;\n else\n huff = 0;\n if (sym++, --count[len] === 0) {\n if (len === max)\n break;\n len = lens[lens_index + work[sym]];\n }\n if (len > root && (huff & mask) !== low) {\n if (drop === 0)\n drop = root;\n next += min, curr = len - drop, left = 1 << curr;\n while (curr + drop < max) {\n if (left -= count[curr + drop], left <= 0)\n break;\n curr++, left <<= 1;\n }\n if (used += 1 << curr, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n low = huff & mask, table[low] = root << 24 | curr << 16 | next - table_index | 0;\n }\n }\n if (huff !== 0)\n table[next + huff] = len - drop << 24 | 64 << 16 | 0;\n return opts.bits = root, 0;\n };\n }\n}), require_inflate = __commonJS({\n \"node_modules/pako/lib/zlib/inflate.js\"(exports) {\n var utils = require_common(), adler32 = require_adler32(), crc32 = require_crc32(), inflate_fast = require_inffast(), inflate_table = require_inftrees(), CODES = 0, LENS = 1, DISTS = 2, Z_FINISH = 4, Z_BLOCK = 5, Z_TREES = 6, Z_OK = 0, Z_STREAM_END = 1, Z_NEED_DICT = 2, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_MEM_ERROR = -4, Z_BUF_ERROR = -5, Z_DEFLATED = 8, HEAD = 1, FLAGS = 2, TIME = 3, OS = 4, EXLEN = 5, EXTRA = 6, NAME = 7, COMMENT = 8, HCRC = 9, DICTID = 10, DICT = 11, TYPE = 12, TYPEDO = 13, STORED = 14, COPY_ = 15, COPY = 16, TABLE = 17, LENLENS = 18, CODELENS = 19, LEN_ = 20, LEN = 21, LENEXT = 22, DIST = 23, DISTEXT = 24, MATCH = 25, LIT = 26, CHECK = 27, LENGTH = 28, DONE = 29, BAD = 30, MEM = 31, SYNC = 32, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, MAX_WBITS = 15, DEF_WBITS = MAX_WBITS;\n function zswap32(q) {\n return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);\n }\n function InflateState() {\n this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new utils.Buf16(320), this.work = new utils.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;\n }\n function inflateResetKeep(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, strm.total_in = strm.total_out = state.total = 0, strm.msg = \"\", state.wrap)\n strm.adler = state.wrap & 1;\n return state.mode = HEAD, state.last = 0, state.havedict = 0, state.dmax = 32768, state.head = null, state.hold = 0, state.bits = 0, state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS), state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS), state.sane = 1, state.back = -1, Z_OK;\n }\n function inflateReset(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n return state = strm.state, state.wsize = 0, state.whave = 0, state.wnext = 0, inflateResetKeep(strm);\n }\n function inflateReset2(strm, windowBits) {\n var wrap, state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (wrap = (windowBits >> 4) + 1, windowBits < 48)\n windowBits &= 15;\n if (windowBits && (windowBits < 8 || windowBits > 15))\n return Z_STREAM_ERROR;\n if (state.window !== null && state.wbits !== windowBits)\n state.window = null;\n return state.wrap = wrap, state.wbits = windowBits, inflateReset(strm);\n }\n function inflateInit2(strm, windowBits) {\n var ret, state;\n if (!strm)\n return Z_STREAM_ERROR;\n if (state = new InflateState, strm.state = state, state.window = null, ret = inflateReset2(strm, windowBits), ret !== Z_OK)\n strm.state = null;\n return ret;\n }\n function inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n }\n var virgin = !0, lenfix, distfix;\n function fixedtables(state) {\n if (virgin) {\n var sym;\n lenfix = new utils.Buf32(512), distfix = new utils.Buf32(32), sym = 0;\n while (sym < 144)\n state.lens[sym++] = 8;\n while (sym < 256)\n state.lens[sym++] = 9;\n while (sym < 280)\n state.lens[sym++] = 7;\n while (sym < 288)\n state.lens[sym++] = 8;\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {\n bits: 9\n }), sym = 0;\n while (sym < 32)\n state.lens[sym++] = 5;\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {\n bits: 5\n }), virgin = !1;\n }\n state.lencode = lenfix, state.lenbits = 9, state.distcode = distfix, state.distbits = 5;\n }\n function updatewindow(strm, src, end, copy) {\n var dist, state = strm.state;\n if (state.window === null)\n state.wsize = 1 << state.wbits, state.wnext = 0, state.whave = 0, state.window = new utils.Buf8(state.wsize);\n if (copy >= state.wsize)\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0), state.wnext = 0, state.whave = state.wsize;\n else {\n if (dist = state.wsize - state.wnext, dist > copy)\n dist = copy;\n if (utils.arraySet(state.window, src, end - copy, dist, state.wnext), copy -= dist, copy)\n utils.arraySet(state.window, src, end - copy, copy, 0), state.wnext = copy, state.whave = state.wsize;\n else {\n if (state.wnext += dist, state.wnext === state.wsize)\n state.wnext = 0;\n if (state.whave < state.wsize)\n state.whave += dist;\n }\n }\n return 0;\n }\n function inflate(strm, flush) {\n var state, input, output, next, put, have, left, hold, bits, _in, _out, copy, from, from_source, here = 0, here_bits, here_op, here_val, last_bits, last_op, last_val, len, ret, hbuf = new utils.Buf8(4), opts, n, order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.mode === TYPE)\n state.mode = TYPEDO;\n put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, _in = have, _out = left, ret = Z_OK;\n inf_leave:\n for (;; )\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.wrap & 2 && hold === 35615) {\n state.check = 0, hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0), hold = 0, bits = 0, state.mode = FLAGS;\n break;\n }\n if (state.flags = 0, state.head)\n state.head.done = !1;\n if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {\n strm.msg = \"incorrect header check\", state.mode = BAD;\n break;\n }\n if ((hold & 15) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (hold >>>= 4, bits -= 4, len = (hold & 15) + 8, state.wbits === 0)\n state.wbits = len;\n else if (len > state.wbits) {\n strm.msg = \"invalid window size\", state.mode = BAD;\n break;\n }\n state.dmax = 1 << len, strm.adler = state.check = 1, state.mode = hold & 512 \? DICTID : TYPE, hold = 0, bits = 0;\n break;\n case FLAGS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.flags = hold, (state.flags & 255) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (state.flags & 57344) {\n strm.msg = \"unknown header flags set\", state.mode = BAD;\n break;\n }\n if (state.head)\n state.head.text = hold >> 8 & 1;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = TIME;\n case TIME:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.time = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, hbuf[2] = hold >>> 16 & 255, hbuf[3] = hold >>> 24 & 255, state.check = crc32(state.check, hbuf, 4, 0);\n hold = 0, bits = 0, state.mode = OS;\n case OS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.xflags = hold & 255, state.head.os = hold >> 8;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = EXLEN;\n case EXLEN:\n if (state.flags & 1024) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.length = hold, state.head)\n state.head.extra_len = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0;\n } else if (state.head)\n state.head.extra = null;\n state.mode = EXTRA;\n case EXTRA:\n if (state.flags & 1024) {\n if (copy = state.length, copy > have)\n copy = have;\n if (copy) {\n if (state.head) {\n if (len = state.head.extra_len - state.length, !state.head.extra)\n state.head.extra = new Array(state.head.extra_len);\n utils.arraySet(state.head.extra, input, next, copy, len);\n }\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n have -= copy, next += copy, state.length -= copy;\n }\n if (state.length)\n break inf_leave;\n }\n state.length = 0, state.mode = NAME;\n case NAME:\n if (state.flags & 2048) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.name += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.name = null;\n state.length = 0, state.mode = COMMENT;\n case COMMENT:\n if (state.flags & 4096) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.comment += String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.comment = null;\n state.mode = HCRC;\n case HCRC:\n if (state.flags & 512) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.check & 65535)) {\n strm.msg = \"header crc mismatch\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n if (state.head)\n state.head.hcrc = state.flags >> 9 & 1, state.head.done = !0;\n strm.adler = state.check = 0, state.mode = TYPE;\n break;\n case DICTID:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n strm.adler = state.check = zswap32(hold), hold = 0, bits = 0, state.mode = DICT;\n case DICT:\n if (state.havedict === 0)\n return strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, Z_NEED_DICT;\n strm.adler = state.check = 1, state.mode = TYPE;\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES)\n break inf_leave;\n case TYPEDO:\n if (state.last) {\n hold >>>= bits & 7, bits -= bits & 7, state.mode = CHECK;\n break;\n }\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n switch (state.last = hold & 1, hold >>>= 1, bits -= 1, hold & 3) {\n case 0:\n state.mode = STORED;\n break;\n case 1:\n if (fixedtables(state), state.mode = LEN_, flush === Z_TREES) {\n hold >>>= 2, bits -= 2;\n break inf_leave;\n }\n break;\n case 2:\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = \"invalid block type\", state.mode = BAD;\n }\n hold >>>= 2, bits -= 2;\n break;\n case STORED:\n hold >>>= bits & 7, bits -= bits & 7;\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {\n strm.msg = \"invalid stored block lengths\", state.mode = BAD;\n break;\n }\n if (state.length = hold & 65535, hold = 0, bits = 0, state.mode = COPY_, flush === Z_TREES)\n break inf_leave;\n case COPY_:\n state.mode = COPY;\n case COPY:\n if (copy = state.length, copy) {\n if (copy > have)\n copy = have;\n if (copy > left)\n copy = left;\n if (copy === 0)\n break inf_leave;\n utils.arraySet(output, input, next, copy, put), have -= copy, next += copy, left -= copy, put += copy, state.length -= copy;\n break;\n }\n state.mode = TYPE;\n break;\n case TABLE:\n while (bits < 14) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.nlen = (hold & 31) + 257, hold >>>= 5, bits -= 5, state.ndist = (hold & 31) + 1, hold >>>= 5, bits -= 5, state.ncode = (hold & 15) + 4, hold >>>= 4, bits -= 4, state.nlen > 286 || state.ndist > 30) {\n strm.msg = \"too many length or distance symbols\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = LENLENS;\n case LENLENS:\n while (state.have < state.ncode) {\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.lens[order[state.have++]] = hold & 7, hold >>>= 3, bits -= 3;\n }\n while (state.have < 19)\n state.lens[order[state.have++]] = 0;\n if (state.lencode = state.lendyn, state.lenbits = 7, opts = { bits: state.lenbits }, ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid code lengths set\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = CODELENS;\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_val < 16)\n hold >>>= here_bits, bits -= here_bits, state.lens[state.have++] = here_val;\n else {\n if (here_val === 16) {\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.have === 0) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1], copy = 3 + (hold & 3), hold >>>= 2, bits -= 2;\n } else if (here_val === 17) {\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 3 + (hold & 7), hold >>>= 3, bits -= 3;\n } else {\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 11 + (hold & 127), hold >>>= 7, bits -= 7;\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n while (copy--)\n state.lens[state.have++] = len;\n }\n }\n if (state.mode === BAD)\n break;\n if (state.lens[256] === 0) {\n strm.msg = \"invalid code -- missing end-of-block\", state.mode = BAD;\n break;\n }\n if (state.lenbits = 9, opts = { bits: state.lenbits }, ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid literal/lengths set\", state.mode = BAD;\n break;\n }\n if (state.distbits = 6, state.distcode = state.distdyn, opts = { bits: state.distbits }, ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts), state.distbits = opts.bits, ret) {\n strm.msg = \"invalid distances set\", state.mode = BAD;\n break;\n }\n if (state.mode = LEN_, flush === Z_TREES)\n break inf_leave;\n case LEN_:\n state.mode = LEN;\n case LEN:\n if (have >= 6 && left >= 258) {\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, inflate_fast(strm, _out), put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, state.mode === TYPE)\n state.back = -1;\n break;\n }\n state.back = 0;\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_op && (here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, state.length = here_val, here_op === 0) {\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n state.back = -1, state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break;\n }\n state.extra = here_op & 15, state.mode = LENEXT;\n case LENEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.length += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n state.was = state.length, state.mode = DIST;\n case DIST:\n for (;; ) {\n if (here = state.distcode[hold & (1 << state.distbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, here_op & 64) {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break;\n }\n state.offset = here_val, state.extra = here_op & 15, state.mode = DISTEXT;\n case DISTEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.offset += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n if (state.offset > state.dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n state.mode = MATCH;\n case MATCH:\n if (left === 0)\n break inf_leave;\n if (copy = _out - left, state.offset > copy) {\n if (copy = state.offset - copy, copy > state.whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n }\n if (copy > state.wnext)\n copy -= state.wnext, from = state.wsize - copy;\n else\n from = state.wnext - copy;\n if (copy > state.length)\n copy = state.length;\n from_source = state.window;\n } else\n from_source = output, from = put - state.offset, copy = state.length;\n if (copy > left)\n copy = left;\n left -= copy, state.length -= copy;\n do\n output[put++] = from_source[from++];\n while (--copy);\n if (state.length === 0)\n state.mode = LEN;\n break;\n case LIT:\n if (left === 0)\n break inf_leave;\n output[put++] = state.length, left--, state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold |= input[next++] << bits, bits += 8;\n }\n if (_out -= left, strm.total_out += _out, state.total += _out, _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);\n if (_out = left, (state.flags \? hold : zswap32(hold)) !== state.check) {\n strm.msg = \"incorrect data check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = LENGTH;\n case LENGTH:\n if (state.wrap && state.flags) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.total & 4294967295)) {\n strm.msg = \"incorrect length check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = DONE;\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n default:\n return Z_STREAM_ERROR;\n }\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out))\n return state.mode = MEM, Z_MEM_ERROR;\n }\n if (_in -= strm.avail_in, _out -= strm.avail_out, strm.total_in += _in, strm.total_out += _out, state.total += _out, state.wrap && _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);\n if (strm.data_type = state.bits + (state.last \? 64 : 0) + (state.mode === TYPE \? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ \? 256 : 0), (_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK)\n ret = Z_BUF_ERROR;\n return ret;\n }\n function inflateEnd(strm) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n var state = strm.state;\n if (state.window)\n state.window = null;\n return strm.state = null, Z_OK;\n }\n function inflateGetHeader(strm, head) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, (state.wrap & 2) === 0)\n return Z_STREAM_ERROR;\n return state.head = head, head.done = !1, Z_OK;\n }\n function inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, state, dictid, ret;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.wrap !== 0 && state.mode !== DICT)\n return Z_STREAM_ERROR;\n if (state.mode === DICT) {\n if (dictid = 1, dictid = adler32(dictid, dictionary, dictLength, 0), dictid !== state.check)\n return Z_DATA_ERROR;\n }\n if (ret = updatewindow(strm, dictionary, dictLength, dictLength), ret)\n return state.mode = MEM, Z_MEM_ERROR;\n return state.havedict = 1, Z_OK;\n }\n exports.inflateReset = inflateReset, exports.inflateReset2 = inflateReset2, exports.inflateResetKeep = inflateResetKeep, exports.inflateInit = inflateInit, exports.inflateInit2 = inflateInit2, exports.inflate = inflate, exports.inflateEnd = inflateEnd, exports.inflateGetHeader = inflateGetHeader, exports.inflateSetDictionary = inflateSetDictionary, exports.inflateInfo = \"pako inflate (from Nodeca project)\";\n }\n}), require_constants = __commonJS({\n \"node_modules/pako/lib/zlib/constants.js\"(exports, module2) {\n module2.exports = {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_BUF_ERROR: -5,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n Z_BINARY: 0,\n Z_TEXT: 1,\n Z_UNKNOWN: 2,\n Z_DEFLATED: 8\n };\n }\n}), require_binding = __commonJS({\n \"node_modules/browserify-zlib/lib/binding.js\"(exports) {\n var Zstream = require_zstream(), zlib_deflate = require_deflate(), zlib_inflate = require_inflate(), constants = require_constants();\n for (key in constants)\n exports[key] = constants[key];\n var key;\n exports.NONE = 0, exports.DEFLATE = 1, exports.INFLATE = 2, exports.GZIP = 3, exports.GUNZIP = 4, exports.DEFLATERAW = 5, exports.INFLATERAW = 6, exports.UNZIP = 7;\n var GZIP_HEADER_ID1 = 31, GZIP_HEADER_ID2 = 139;\n function Zlib(mode) {\n if (typeof mode !== \"number\" || mode < exports.DEFLATE || mode > exports.UNZIP)\n @throwTypeError(\"Bad argument\");\n this.dictionary = null, this.err = 0, this.flush = 0, this.init_done = !1, this.level = 0, this.memLevel = 0, this.mode = mode, this.strategy = 0, this.windowBits = 0, this.write_in_progress = !1, this.pending_close = !1, this.gzip_id_bytes_read = 0;\n }\n Zlib.prototype = {}, Zlib.prototype.close = function() {\n if (this.write_in_progress) {\n this.pending_close = !0;\n return;\n }\n if (this.pending_close = !1, assert(this.init_done, \"close before init\"), assert(this.mode <= exports.UNZIP), this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW)\n zlib_deflate.deflateEnd(this.strm);\n else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP)\n zlib_inflate.inflateEnd(this.strm);\n this.mode = exports.NONE, this.dictionary = null;\n }, Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!0, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!1, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype._write = function(async, flush, input, in_off, in_len, out, out_off, out_len) {\n if (assert.equal(arguments.length, 8), assert(this.init_done, \"write before init\"), assert(this.mode !== exports.NONE, \"already finalized\"), assert.equal(!1, this.write_in_progress, \"write already in progress\"), assert.equal(!1, this.pending_close, \"close is pending\"), this.write_in_progress = !0, assert.equal(!1, flush === void 0, \"must provide flush value\"), this.write_in_progress = !0, flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK)\n throw new Error(\"Invalid flush value\");\n if (input == null)\n input = Buffer.alloc(0), in_len = 0, in_off = 0;\n if (this.strm.avail_in = in_len, this.strm.input = input, this.strm.next_in = in_off, this.strm.avail_out = out_len, this.strm.output = out, this.strm.next_out = out_off, this.flush = flush, !async) {\n if (this._process(), this._checkError())\n return this._afterSync();\n return;\n }\n var self = this;\n return process.nextTick(function() {\n self._process(), self._after();\n }), this;\n }, Zlib.prototype._afterSync = function() {\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n return this.write_in_progress = !1, [avail_in, avail_out];\n }, Zlib.prototype._process = function() {\n var next_expected_header_byte = null;\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n case exports.UNZIP:\n if (this.strm.avail_in > 0)\n next_expected_header_byte = this.strm.next_in;\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n if (this.gzip_id_bytes_read = 1, next_expected_header_byte++, this.strm.avail_in === 1)\n break;\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n case 1:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2)\n this.gzip_id_bytes_read = 2, this.mode = exports.GUNZIP;\n else\n this.mode = exports.INFLATE;\n break;\n default:\n throw new Error(\"invalid number of gzip magic number bytes read\");\n }\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n if (this.err = zlib_inflate.inflate(this.strm, this.flush), this.err === exports.Z_NEED_DICT && this.dictionary) {\n if (this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary), this.err === exports.Z_OK)\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n else if (this.err === exports.Z_DATA_ERROR)\n this.err = exports.Z_NEED_DICT;\n }\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0)\n this.reset(), this.err = zlib_inflate.inflate(this.strm, this.flush);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n }, Zlib.prototype._checkError = function() {\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH)\n return this._error(\"unexpected end of file\"), !1;\n break;\n case exports.Z_STREAM_END:\n break;\n case exports.Z_NEED_DICT:\n if (this.dictionary == null)\n this._error(\"Missing dictionary\");\n else\n this._error(\"Bad dictionary\");\n return !1;\n default:\n return this._error(\"Zlib error\"), !1;\n }\n return !0;\n }, Zlib.prototype._after = function() {\n if (!this._checkError())\n return;\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n if (this.write_in_progress = !1, this.callback(avail_in, avail_out), this.pending_close)\n this.close();\n }, Zlib.prototype._error = function(message) {\n if (this.strm.msg)\n message = this.strm.msg;\n if (this.onerror(message, this.err), this.write_in_progress = !1, this.pending_close)\n this.close();\n }, Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, \"init(windowBits, level, memLevel, strategy, [dictionary])\"), assert(windowBits >= 8 && windowBits <= 15, \"invalid windowBits\"), assert(level >= -1 && level <= 9, \"invalid compression level\"), assert(memLevel >= 1 && memLevel <= 9, \"invalid memlevel\"), assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, \"invalid strategy\"), this._init(level, windowBits, memLevel, strategy, dictionary), this._setDictionary();\n }, Zlib.prototype.params = function() {\n throw new Error(\"deflateParams Not supported\");\n }, Zlib.prototype.reset = function() {\n this._reset(), this._setDictionary();\n }, Zlib.prototype._init = function(level, windowBits, memLevel, strategy, dictionary) {\n if (this.level = level, this.windowBits = windowBits, this.memLevel = memLevel, this.strategy = strategy, this.flush = exports.Z_NO_FLUSH, this.err = exports.Z_OK, this.mode === exports.GZIP || this.mode === exports.GUNZIP)\n this.windowBits += 16;\n if (this.mode === exports.UNZIP)\n this.windowBits += 32;\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW)\n this.windowBits = -1 * this.windowBits;\n switch (this.strm = new Zstream, this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Init error\");\n this.dictionary = dictionary, this.write_in_progress = !1, this.init_done = !0;\n }, Zlib.prototype._setDictionary = function() {\n if (this.dictionary == null)\n return;\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to set dictionary\");\n }, Zlib.prototype._reset = function() {\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to reset stream\");\n }, exports.Zlib = Zlib;\n }\n}), require_lib = __commonJS({\n \"node_modules/browserify-zlib/lib/index.js\"(exports) {\n var Buffer2 = BufferModule.Buffer, Transform = StreamModule.Transform, binding = require_binding(), util = Util, kMaxLength = BufferModule.kMaxLength, kRangeErrorMessage = \"Cannot create final Buffer. It would be larger than 0x\" + kMaxLength.toString(16) + \" bytes\";\n binding.Z_MIN_WINDOWBITS = 8, binding.Z_MAX_WINDOWBITS = 15, binding.Z_DEFAULT_WINDOWBITS = 15, binding.Z_MIN_CHUNK = 64, binding.Z_MAX_CHUNK = Infinity, binding.Z_DEFAULT_CHUNK = 16384, binding.Z_MIN_MEMLEVEL = 1, binding.Z_MAX_MEMLEVEL = 9, binding.Z_DEFAULT_MEMLEVEL = 8, binding.Z_MIN_LEVEL = -1, binding.Z_MAX_LEVEL = 9, binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;\n var bkeys = Object.keys(binding);\n for (bk = 0;bk < bkeys.length; bk++)\n if (bkey = bkeys[bk], bkey.match(/^Z/))\n Object.defineProperty(exports, bkey, {\n enumerable: !0,\n value: binding[bkey],\n writable: !1\n });\n var bkey, bk, codes = {\n Z_OK: binding.Z_OK,\n Z_STREAM_END: binding.Z_STREAM_END,\n Z_NEED_DICT: binding.Z_NEED_DICT,\n Z_ERRNO: binding.Z_ERRNO,\n Z_STREAM_ERROR: binding.Z_STREAM_ERROR,\n Z_DATA_ERROR: binding.Z_DATA_ERROR,\n Z_MEM_ERROR: binding.Z_MEM_ERROR,\n Z_BUF_ERROR: binding.Z_BUF_ERROR,\n Z_VERSION_ERROR: binding.Z_VERSION_ERROR\n }, ckeys = Object.keys(codes);\n for (ck = 0;ck < ckeys.length; ck++)\n ckey = ckeys[ck], codes[codes[ckey]] = ckey;\n var ckey, ck;\n Object.defineProperty(exports, \"codes\", {\n enumerable: !0,\n value: Object.freeze(codes),\n writable: !1\n }), exports.constants = require_constants(), exports.Deflate = Deflate, exports.Inflate = Inflate, exports.Gzip = Gzip, exports.Gunzip = Gunzip, exports.DeflateRaw = DeflateRaw, exports.InflateRaw = InflateRaw, exports.Unzip = Unzip, exports.createDeflate = function(o) {\n return new Deflate(o);\n }, exports.createInflate = function(o) {\n return new Inflate(o);\n }, exports.createDeflateRaw = function(o) {\n return new DeflateRaw(o);\n }, exports.createInflateRaw = function(o) {\n return new InflateRaw(o);\n }, exports.createGzip = function(o) {\n return new Gzip(o);\n }, exports.createGunzip = function(o) {\n return new Gunzip(o);\n }, exports.createUnzip = function(o) {\n return new Unzip(o);\n }, exports.deflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Deflate(opts), buffer, callback);\n }, exports.deflateSync = function(buffer, opts) {\n return zlibBufferSync(new Deflate(opts), buffer);\n }, exports.gzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gzip(opts), buffer, callback);\n }, exports.gzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gzip(opts), buffer);\n }, exports.deflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new DeflateRaw(opts), buffer, callback);\n }, exports.deflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new DeflateRaw(opts), buffer);\n }, exports.unzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Unzip(opts), buffer, callback);\n }, exports.unzipSync = function(buffer, opts) {\n return zlibBufferSync(new Unzip(opts), buffer);\n }, exports.inflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Inflate(opts), buffer, callback);\n }, exports.inflateSync = function(buffer, opts) {\n return zlibBufferSync(new Inflate(opts), buffer);\n }, exports.gunzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gunzip(opts), buffer, callback);\n }, exports.gunzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gunzip(opts), buffer);\n }, exports.inflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new InflateRaw(opts), buffer, callback);\n }, exports.inflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new InflateRaw(opts), buffer);\n }, exports.brotliCompress = function(buffer, opts, callback) {\n throw new Error(\"zlib.brotliCompress is not implemented\");\n };\n function zlibBuffer(engine, buffer, callback) {\n var buffers = [], nread = 0;\n engine.on(\"error\", onError), engine.on(\"end\", onEnd), engine.end(buffer), flow();\n function flow() {\n var chunk;\n while ((chunk = engine.read()) !== null)\n buffers.push(chunk), nread += chunk.length;\n engine.once(\"readable\", flow);\n }\n function onError(err) {\n engine.removeListener(\"end\", onEnd), engine.removeListener(\"readable\", flow), callback(err);\n }\n function onEnd() {\n var buf, err = null;\n if (nread >= kMaxLength)\n err = new RangeError(kRangeErrorMessage);\n else\n buf = Buffer2.concat(buffers, nread);\n buffers = [], engine.close(), callback(err, buf);\n }\n }\n function zlibBufferSync(engine, buffer) {\n if (typeof buffer === \"string\")\n buffer = Buffer2.from(buffer);\n if (!Buffer2.isBuffer(buffer))\n @throwTypeError(\"Not a string or buffer\");\n var flushFlag = engine._finishFlushFlag;\n return engine._processChunk(buffer, flushFlag);\n }\n function Deflate(opts) {\n if (!(this instanceof Deflate))\n return new Deflate(opts);\n Zlib.call(this, opts, binding.DEFLATE);\n }\n function Inflate(opts) {\n if (!(this instanceof Inflate))\n return new Inflate(opts);\n Zlib.call(this, opts, binding.INFLATE);\n }\n function Gzip(opts) {\n if (!(this instanceof Gzip))\n return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n }\n function Gunzip(opts) {\n if (!(this instanceof Gunzip))\n return new Gunzip(opts);\n Zlib.call(this, opts, binding.GUNZIP);\n }\n function DeflateRaw(opts) {\n if (!(this instanceof DeflateRaw))\n return new DeflateRaw(opts);\n Zlib.call(this, opts, binding.DEFLATERAW);\n }\n function InflateRaw(opts) {\n if (!(this instanceof InflateRaw))\n return new InflateRaw(opts);\n Zlib.call(this, opts, binding.INFLATERAW);\n }\n function Unzip(opts) {\n if (!(this instanceof Unzip))\n return new Unzip(opts);\n Zlib.call(this, opts, binding.UNZIP);\n }\n function isValidFlushFlag(flag) {\n return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;\n }\n function Zlib(opts, mode) {\n var _this = this;\n if (this._opts = opts = opts || {}, this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK, Transform.call(this, opts), opts.flush && !isValidFlushFlag(opts.flush))\n throw new Error(\"Invalid flush flag: \" + opts.flush);\n if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush))\n throw new Error(\"Invalid flush flag: \" + opts.finishFlush);\n if (this._flushFlag = opts.flush || binding.Z_NO_FLUSH, this._finishFlushFlag = typeof opts.finishFlush !== \"undefined\" \? opts.finishFlush : binding.Z_FINISH, opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK)\n throw new Error(\"Invalid chunk size: \" + opts.chunkSize);\n }\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS)\n throw new Error(\"Invalid windowBits: \" + opts.windowBits);\n }\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL)\n throw new Error(\"Invalid compression level: \" + opts.level);\n }\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL)\n throw new Error(\"Invalid memLevel: \" + opts.memLevel);\n }\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY)\n throw new Error(\"Invalid strategy: \" + opts.strategy);\n }\n if (opts.dictionary) {\n if (!Buffer2.isBuffer(opts.dictionary))\n throw new Error(\"Invalid dictionary: it should be a Buffer instance\");\n }\n this._handle = new binding.Zlib(mode);\n var self = this;\n this._hadError = !1, this._handle.onerror = function(message, errno) {\n _close(self), self._hadError = !0;\n var error = new Error(message);\n error.errno = errno, error.code = exports.codes[errno], self.emit(\"error\", error);\n };\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === \"number\")\n level = opts.level;\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === \"number\")\n strategy = opts.strategy;\n this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary), this._buffer = Buffer2.allocUnsafe(this._chunkSize), this._offset = 0, this._level = level, this._strategy = strategy, this.once(\"end\", this.close), Object.defineProperty(this, \"_closed\", {\n get: function() {\n return !_this._handle;\n },\n configurable: !0,\n enumerable: !0\n });\n }\n util.inherits(Zlib, Transform), Zlib.prototype.params = function(level, strategy, callback) {\n if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL)\n @throwRangeError(\"Invalid compression level: \" + level);\n if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY)\n @throwTypeError(\"Invalid strategy: \" + strategy);\n if (this._level !== level || this._strategy !== strategy) {\n var self = this;\n this.flush(binding.Z_SYNC_FLUSH, function() {\n if (assert(self._handle, \"zlib binding closed\"), self._handle.params(level, strategy), !self._hadError) {\n if (self._level = level, self._strategy = strategy, callback)\n callback();\n }\n });\n } else\n process.nextTick(callback);\n }, Zlib.prototype.reset = function() {\n return assert(this._handle, \"zlib binding closed\"), this._handle.reset();\n }, Zlib.prototype._flush = function(callback) {\n this._transform(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.flush = function(kind, callback) {\n var _this2 = this, ws = this._writableState;\n if (typeof kind === \"function\" || kind === void 0 && !callback)\n callback = kind, kind = binding.Z_FULL_FLUSH;\n if (ws.ended) {\n if (callback)\n process.nextTick(callback);\n } else if (ws.ending) {\n if (callback)\n this.once(\"end\", callback);\n } else if (ws.needDrain) {\n if (callback)\n this.once(\"drain\", function() {\n return _this2.flush(kind, callback);\n });\n } else\n this._flushFlag = kind, this.write(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.close = function(callback) {\n _close(this, callback), process.nextTick(emitCloseNT, this);\n };\n function _close(engine, callback) {\n if (callback)\n process.nextTick(callback);\n if (!engine._handle)\n return;\n engine._handle.close(), engine._handle = null;\n }\n function emitCloseNT(self) {\n self.emit(\"close\");\n }\n Zlib.prototype._transform = function(chunk, encoding, cb) {\n var flushFlag, ws = this._writableState, ending = ws.ending || ws.ended, last = ending && (!chunk || ws.length === chunk.length);\n if (chunk !== null && !Buffer2.isBuffer(chunk))\n return cb(new Error(\"invalid input\"));\n if (!this._handle)\n return cb(new Error(\"zlib binding closed\"));\n if (last)\n flushFlag = this._finishFlushFlag;\n else if (flushFlag = this._flushFlag, chunk.length >= ws.length)\n this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;\n this._processChunk(chunk, flushFlag, cb);\n }, Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {\n var availInBefore = chunk && chunk.length, availOutBefore = this._chunkSize - this._offset, inOff = 0, self = this, async = typeof cb === \"function\";\n if (!async) {\n var buffers = [], nread = 0, error;\n this.on(\"error\", function(er) {\n error = er;\n }), assert(this._handle, \"zlib binding closed\");\n do\n var res = this._handle.writeSync(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n while (!this._hadError && callback(res[0], res[1]));\n if (this._hadError)\n throw error;\n if (nread >= kMaxLength)\n _close(this), @throwRangeError(kRangeErrorMessage);\n var buf = Buffer2.concat(buffers, nread);\n return _close(this), buf;\n }\n assert(this._handle, \"zlib binding closed\");\n var req = this._handle.write(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n req.buffer = chunk, req.callback = callback;\n function callback(availInAfter, availOutAfter) {\n if (this)\n this.buffer = null, this.callback = null;\n if (self._hadError)\n return;\n var have = availOutBefore - availOutAfter;\n if (assert(have >= 0, \"have should not go down\"), have > 0) {\n var out = self._buffer.slice(self._offset, self._offset + have);\n if (self._offset += have, async)\n self.push(out);\n else\n buffers.push(out), nread += out.length;\n }\n if (availOutAfter === 0 || self._offset >= self._chunkSize)\n availOutBefore = self._chunkSize, self._offset = 0, self._buffer = Buffer2.allocUnsafe(self._chunkSize);\n if (availOutAfter === 0) {\n if (inOff += availInBefore - availInAfter, availInBefore = availInAfter, !async)\n return !0;\n var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);\n newReq.callback = callback, newReq.buffer = chunk;\n return;\n }\n if (!async)\n return !1;\n cb();\n }\n }, util.inherits(Deflate, Zlib), util.inherits(Inflate, Zlib), util.inherits(Gzip, Zlib), util.inherits(Gunzip, Zlib), util.inherits(DeflateRaw, Zlib), util.inherits(InflateRaw, Zlib), util.inherits(Unzip, Zlib);\n }\n});\nreturn require_lib()})\n"_s;
+static constexpr ASCIILiteral NodeZlibCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/node/zlib.ts\nvar assert = @getInternalField(@internalModuleRegistry, 8) || @createInternalModuleById(8), BufferModule = @requireNativeModule(\"buffer\"), StreamModule = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), Util = @getInternalField(@internalModuleRegistry, 48) || @createInternalModuleById(48), __getOwnPropNames = Object.getOwnPropertyNames, __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n}, require_zstream = __commonJS({\n \"node_modules/pako/lib/zlib/zstream.js\"(exports, module2) {\n function ZStream() {\n this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = \"\", this.state = null, this.data_type = 2, this.adler = 0;\n }\n module2.exports = ZStream;\n }\n}), require_common = __commonJS({\n \"node_modules/pako/lib/utils/common.js\"(exports) {\n var TYPED_OK = typeof @Uint8Array !== \"undefined\" && typeof Uint16Array !== \"undefined\" && typeof Int32Array !== \"undefined\";\n function _has(obj, key) {\n return Object.prototype.hasOwnProperty.@call(obj, key);\n }\n exports.assign = function(obj) {\n var sources = @Array.prototype.slice.@call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source)\n continue;\n if (typeof source !== \"object\")\n @throwTypeError(source + \"must be non-object\");\n for (var p in source)\n if (_has(source, p))\n obj[p] = source[p];\n }\n return obj;\n }, exports.shrinkBuf = function(buf, size) {\n if (buf.length === size)\n return buf;\n if (buf.subarray)\n return buf.subarray(0, size);\n return buf.length = size, buf;\n };\n var fnTyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n var i, l, len, pos, chunk, result;\n len = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n len += chunks[i].length;\n result = new @Uint8Array(len), pos = 0;\n for (i = 0, l = chunks.length;i < l; i++)\n chunk = chunks[i], result.set(chunk, pos), pos += chunk.length;\n return result;\n }\n }, fnUntyped = {\n arraySet: function(dest, src, src_offs, len, dest_offs) {\n for (var i = 0;i < len; i++)\n dest[dest_offs + i] = src[src_offs + i];\n },\n flattenChunks: function(chunks) {\n return [].concat.@apply([], chunks);\n }\n };\n exports.setTyped = function(on) {\n if (on)\n exports.Buf8 = @Uint8Array, exports.Buf16 = Uint16Array, exports.Buf32 = Int32Array, exports.assign(exports, fnTyped);\n else\n exports.Buf8 = @Array, exports.Buf16 = @Array, exports.Buf32 = @Array, exports.assign(exports, fnUntyped);\n }, exports.setTyped(TYPED_OK);\n }\n}), require_trees = __commonJS({\n \"node_modules/pako/lib/zlib/trees.js\"(exports) {\n var utils = require_common(), Z_FIXED = 4, Z_BINARY = 0, Z_TEXT = 1, Z_UNKNOWN = 2;\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n var STORED_BLOCK = 0, STATIC_TREES = 1, DYN_TREES = 2, MIN_MATCH = 3, MAX_MATCH = 258, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, Buf_size = 16, MAX_BL_BITS = 7, END_BLOCK = 256, REP_3_6 = 16, REPZ_3_10 = 17, REPZ_11_138 = 18, extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], extra_dbits = [\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 4,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 8,\n 8,\n 9,\n 9,\n 10,\n 10,\n 11,\n 11,\n 12,\n 12,\n 13,\n 13\n ], extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], DIST_CODE_LEN = 512, static_ltree = new @Array((L_CODES + 2) * 2);\n zero(static_ltree);\n var static_dtree = new @Array(D_CODES * 2);\n zero(static_dtree);\n var _dist_code = new @Array(DIST_CODE_LEN);\n zero(_dist_code);\n var _length_code = new @Array(MAX_MATCH - MIN_MATCH + 1);\n zero(_length_code);\n var base_length = new @Array(LENGTH_CODES);\n zero(base_length);\n var base_dist = new @Array(D_CODES);\n zero(base_dist);\n function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree, this.extra_bits = extra_bits, this.extra_base = extra_base, this.elems = elems, this.max_length = max_length, this.has_stree = static_tree && static_tree.length;\n }\n var static_l_desc, static_d_desc, static_bl_desc;\n function TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree, this.max_code = 0, this.stat_desc = stat_desc;\n }\n function d_code(dist) {\n return dist < 256 \? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n }\n function put_short(s, w) {\n s.pending_buf[s.pending++] = w & 255, s.pending_buf[s.pending++] = w >>> 8 & 255;\n }\n function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length)\n s.bi_buf |= value << s.bi_valid & 65535, put_short(s, s.bi_buf), s.bi_buf = value >> Buf_size - s.bi_valid, s.bi_valid += length - Buf_size;\n else\n s.bi_buf |= value << s.bi_valid & 65535, s.bi_valid += length;\n }\n function send_code(s, c, tree) {\n send_bits(s, tree[c * 2], tree[c * 2 + 1]);\n }\n function bi_reverse(code, len) {\n var res = 0;\n do\n res |= code & 1, code >>>= 1, res <<= 1;\n while (--len > 0);\n return res >>> 1;\n }\n function bi_flush(s) {\n if (s.bi_valid === 16)\n put_short(s, s.bi_buf), s.bi_buf = 0, s.bi_valid = 0;\n else if (s.bi_valid >= 8)\n s.pending_buf[s.pending++] = s.bi_buf & 255, s.bi_buf >>= 8, s.bi_valid -= 8;\n }\n function gen_bitlen(s, desc) {\n var { dyn_tree: tree, max_code } = desc, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, extra = desc.stat_desc.extra_bits, base = desc.stat_desc.extra_base, max_length = desc.stat_desc.max_length, h, n, m, bits, xbits, f, overflow = 0;\n for (bits = 0;bits <= MAX_BITS; bits++)\n s.bl_count[bits] = 0;\n tree[s.heap[s.heap_max] * 2 + 1] = 0;\n for (h = s.heap_max + 1;h < HEAP_SIZE; h++) {\n if (n = s.heap[h], bits = tree[tree[n * 2 + 1] * 2 + 1] + 1, bits > max_length)\n bits = max_length, overflow++;\n if (tree[n * 2 + 1] = bits, n > max_code)\n continue;\n if (s.bl_count[bits]++, xbits = 0, n >= base)\n xbits = extra[n - base];\n if (f = tree[n * 2], s.opt_len += f * (bits + xbits), has_stree)\n s.static_len += f * (stree[n * 2 + 1] + xbits);\n }\n if (overflow === 0)\n return;\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0)\n bits--;\n s.bl_count[bits]--, s.bl_count[bits + 1] += 2, s.bl_count[max_length]--, overflow -= 2;\n } while (overflow > 0);\n for (bits = max_length;bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n if (m = s.heap[--h], m > max_code)\n continue;\n if (tree[m * 2 + 1] !== bits)\n s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2], tree[m * 2 + 1] = bits;\n n--;\n }\n }\n }\n function gen_codes(tree, max_code, bl_count) {\n var next_code = new @Array(MAX_BITS + 1), code = 0, bits, n;\n for (bits = 1;bits <= MAX_BITS; bits++)\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n for (n = 0;n <= max_code; n++) {\n var len = tree[n * 2 + 1];\n if (len === 0)\n continue;\n tree[n * 2] = bi_reverse(next_code[len]++, len);\n }\n }\n function tr_static_init() {\n var n, bits, length, code, dist, bl_count = new @Array(MAX_BITS + 1);\n length = 0;\n for (code = 0;code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0;n < 1 << extra_lbits[code]; n++)\n _length_code[length++] = code;\n }\n _length_code[length - 1] = code, dist = 0;\n for (code = 0;code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0;n < 1 << extra_dbits[code]; n++)\n _dist_code[dist++] = code;\n }\n dist >>= 7;\n for (;code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0;n < 1 << extra_dbits[code] - 7; n++)\n _dist_code[256 + dist++] = code;\n }\n for (bits = 0;bits <= MAX_BITS; bits++)\n bl_count[bits] = 0;\n n = 0;\n while (n <= 143)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n while (n <= 255)\n static_ltree[n * 2 + 1] = 9, n++, bl_count[9]++;\n while (n <= 279)\n static_ltree[n * 2 + 1] = 7, n++, bl_count[7]++;\n while (n <= 287)\n static_ltree[n * 2 + 1] = 8, n++, bl_count[8]++;\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n for (n = 0;n < D_CODES; n++)\n static_dtree[n * 2 + 1] = 5, static_dtree[n * 2] = bi_reverse(n, 5);\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS), static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS), static_bl_desc = new StaticTreeDesc(new @Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n }\n function init_block(s) {\n var n;\n for (n = 0;n < L_CODES; n++)\n s.dyn_ltree[n * 2] = 0;\n for (n = 0;n < D_CODES; n++)\n s.dyn_dtree[n * 2] = 0;\n for (n = 0;n < BL_CODES; n++)\n s.bl_tree[n * 2] = 0;\n s.dyn_ltree[END_BLOCK * 2] = 1, s.opt_len = s.static_len = 0, s.last_lit = s.matches = 0;\n }\n function bi_windup(s) {\n if (s.bi_valid > 8)\n put_short(s, s.bi_buf);\n else if (s.bi_valid > 0)\n s.pending_buf[s.pending++] = s.bi_buf;\n s.bi_buf = 0, s.bi_valid = 0;\n }\n function copy_block(s, buf, len, header) {\n if (bi_windup(s), header)\n put_short(s, len), put_short(s, ~len);\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending), s.pending += len;\n }\n function smaller(tree, n, m, depth) {\n var _n2 = n * 2, _m2 = m * 2;\n return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];\n }\n function pqdownheap(s, tree, k) {\n var v = s.heap[k], j = k << 1;\n while (j <= s.heap_len) {\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth))\n j++;\n if (smaller(tree, v, s.heap[j], s.depth))\n break;\n s.heap[k] = s.heap[j], k = j, j <<= 1;\n }\n s.heap[k] = v;\n }\n function compress_block(s, ltree, dtree) {\n var dist, lc, lx = 0, code, extra;\n if (s.last_lit !== 0)\n do\n if (dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1], lc = s.pending_buf[s.l_buf + lx], lx++, dist === 0)\n send_code(s, lc, ltree);\n else {\n if (code = _length_code[lc], send_code(s, code + LITERALS + 1, ltree), extra = extra_lbits[code], extra !== 0)\n lc -= base_length[code], send_bits(s, lc, extra);\n if (dist--, code = d_code(dist), send_code(s, code, dtree), extra = extra_dbits[code], extra !== 0)\n dist -= base_dist[code], send_bits(s, dist, extra);\n }\n while (lx < s.last_lit);\n send_code(s, END_BLOCK, ltree);\n }\n function build_tree(s, desc) {\n var tree = desc.dyn_tree, stree = desc.stat_desc.static_tree, has_stree = desc.stat_desc.has_stree, elems = desc.stat_desc.elems, n, m, max_code = -1, node;\n s.heap_len = 0, s.heap_max = HEAP_SIZE;\n for (n = 0;n < elems; n++)\n if (tree[n * 2] !== 0)\n s.heap[++s.heap_len] = max_code = n, s.depth[n] = 0;\n else\n tree[n * 2 + 1] = 0;\n while (s.heap_len < 2)\n if (node = s.heap[++s.heap_len] = max_code < 2 \? ++max_code : 0, tree[node * 2] = 1, s.depth[node] = 0, s.opt_len--, has_stree)\n s.static_len -= stree[node * 2 + 1];\n desc.max_code = max_code;\n for (n = s.heap_len >> 1;n >= 1; n--)\n pqdownheap(s, tree, n);\n node = elems;\n do\n n = s.heap[1], s.heap[1] = s.heap[s.heap_len--], pqdownheap(s, tree, 1), m = s.heap[1], s.heap[--s.heap_max] = n, s.heap[--s.heap_max] = m, tree[node * 2] = tree[n * 2] + tree[m * 2], s.depth[node] = (s.depth[n] >= s.depth[m] \? s.depth[n] : s.depth[m]) + 1, tree[n * 2 + 1] = tree[m * 2 + 1] = node, s.heap[1] = node++, pqdownheap(s, tree, 1);\n while (s.heap_len >= 2);\n s.heap[--s.heap_max] = s.heap[1], gen_bitlen(s, desc), gen_codes(tree, max_code, s.bl_count);\n }\n function scan_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n tree[(max_code + 1) * 2 + 1] = 65535;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n s.bl_tree[curlen * 2] += count;\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n s.bl_tree[curlen * 2]++;\n s.bl_tree[REP_3_6 * 2]++;\n } else if (count <= 10)\n s.bl_tree[REPZ_3_10 * 2]++;\n else\n s.bl_tree[REPZ_11_138 * 2]++;\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function send_tree(s, tree, max_code) {\n var n, prevlen = -1, curlen, nextlen = tree[1], count = 0, max_count = 7, min_count = 4;\n if (nextlen === 0)\n max_count = 138, min_count = 3;\n for (n = 0;n <= max_code; n++) {\n if (curlen = nextlen, nextlen = tree[(n + 1) * 2 + 1], ++count < max_count && curlen === nextlen)\n continue;\n else if (count < min_count)\n do\n send_code(s, curlen, s.bl_tree);\n while (--count !== 0);\n else if (curlen !== 0) {\n if (curlen !== prevlen)\n send_code(s, curlen, s.bl_tree), count--;\n send_code(s, REP_3_6, s.bl_tree), send_bits(s, count - 3, 2);\n } else if (count <= 10)\n send_code(s, REPZ_3_10, s.bl_tree), send_bits(s, count - 3, 3);\n else\n send_code(s, REPZ_11_138, s.bl_tree), send_bits(s, count - 11, 7);\n if (count = 0, prevlen = curlen, nextlen === 0)\n max_count = 138, min_count = 3;\n else if (curlen === nextlen)\n max_count = 6, min_count = 3;\n else\n max_count = 7, min_count = 4;\n }\n }\n function build_bl_tree(s) {\n var max_blindex;\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code), scan_tree(s, s.dyn_dtree, s.d_desc.max_code), build_tree(s, s.bl_desc);\n for (max_blindex = BL_CODES - 1;max_blindex >= 3; max_blindex--)\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0)\n break;\n return s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4, max_blindex;\n }\n function send_all_trees(s, lcodes, dcodes, blcodes) {\n var rank;\n send_bits(s, lcodes - 257, 5), send_bits(s, dcodes - 1, 5), send_bits(s, blcodes - 4, 4);\n for (rank = 0;rank < blcodes; rank++)\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);\n send_tree(s, s.dyn_ltree, lcodes - 1), send_tree(s, s.dyn_dtree, dcodes - 1);\n }\n function detect_data_type(s) {\n var black_mask = 4093624447, n;\n for (n = 0;n <= 31; n++, black_mask >>>= 1)\n if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0)\n return Z_BINARY;\n if (s.dyn_ltree[18] !== 0 || s.dyn_ltree[20] !== 0 || s.dyn_ltree[26] !== 0)\n return Z_TEXT;\n for (n = 32;n < LITERALS; n++)\n if (s.dyn_ltree[n * 2] !== 0)\n return Z_TEXT;\n return Z_BINARY;\n }\n var static_init_done = !1;\n function _tr_init(s) {\n if (!static_init_done)\n tr_static_init(), static_init_done = !0;\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc), s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc), s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc), s.bi_buf = 0, s.bi_valid = 0, init_block(s);\n }\n function _tr_stored_block(s, buf, stored_len, last) {\n send_bits(s, (STORED_BLOCK << 1) + (last \? 1 : 0), 3), copy_block(s, buf, stored_len, !0);\n }\n function _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3), send_code(s, END_BLOCK, static_ltree), bi_flush(s);\n }\n function _tr_flush_block(s, buf, stored_len, last) {\n var opt_lenb, static_lenb, max_blindex = 0;\n if (s.level > 0) {\n if (s.strm.data_type === Z_UNKNOWN)\n s.strm.data_type = detect_data_type(s);\n if (build_tree(s, s.l_desc), build_tree(s, s.d_desc), max_blindex = build_bl_tree(s), opt_lenb = s.opt_len + 3 + 7 >>> 3, static_lenb = s.static_len + 3 + 7 >>> 3, static_lenb <= opt_lenb)\n opt_lenb = static_lenb;\n } else\n opt_lenb = static_lenb = stored_len + 5;\n if (stored_len + 4 <= opt_lenb && buf !== -1)\n _tr_stored_block(s, buf, stored_len, last);\n else if (s.strategy === Z_FIXED || static_lenb === opt_lenb)\n send_bits(s, (STATIC_TREES << 1) + (last \? 1 : 0), 3), compress_block(s, static_ltree, static_dtree);\n else\n send_bits(s, (DYN_TREES << 1) + (last \? 1 : 0), 3), send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1), compress_block(s, s.dyn_ltree, s.dyn_dtree);\n if (init_block(s), last)\n bi_windup(s);\n }\n function _tr_tally(s, dist, lc) {\n if (s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255, s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255, s.pending_buf[s.l_buf + s.last_lit] = lc & 255, s.last_lit++, dist === 0)\n s.dyn_ltree[lc * 2]++;\n else\n s.matches++, dist--, s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++, s.dyn_dtree[d_code(dist) * 2]++;\n return s.last_lit === s.lit_bufsize - 1;\n }\n exports._tr_init = _tr_init, exports._tr_stored_block = _tr_stored_block, exports._tr_flush_block = _tr_flush_block, exports._tr_tally = _tr_tally, exports._tr_align = _tr_align;\n }\n}), require_adler32 = __commonJS({\n \"node_modules/pako/lib/zlib/adler32.js\"(exports, module2) {\n function adler32(adler, buf, len, pos) {\n var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;\n while (len !== 0) {\n n = len > 2000 \? 2000 : len, len -= n;\n do\n s1 = s1 + buf[pos++] | 0, s2 = s2 + s1 | 0;\n while (--n);\n s1 %= 65521, s2 %= 65521;\n }\n return s1 | s2 << 16 | 0;\n }\n module2.exports = adler32;\n }\n}), require_crc32 = __commonJS({\n \"node_modules/pako/lib/zlib/crc32.js\"(exports, module2) {\n function makeTable() {\n var c, table = [];\n for (var n = 0;n < 256; n++) {\n c = n;\n for (var k = 0;k < 8; k++)\n c = c & 1 \? 3988292384 ^ c >>> 1 : c >>> 1;\n table[n] = c;\n }\n return table;\n }\n var crcTable = makeTable();\n function crc32(crc, buf, len, pos) {\n var t = crcTable, end = pos + len;\n crc ^= -1;\n for (var i = pos;i < end; i++)\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];\n return crc ^ -1;\n }\n module2.exports = crc32;\n }\n}), require_messages = __commonJS({\n \"node_modules/pako/lib/zlib/messages.js\"(exports, module2) {\n module2.exports = {\n 2: \"need dictionary\",\n 1: \"stream end\",\n 0: \"\",\n \"-1\": \"file error\",\n \"-2\": \"stream error\",\n \"-3\": \"data error\",\n \"-4\": \"insufficient memory\",\n \"-5\": \"buffer error\",\n \"-6\": \"incompatible version\"\n };\n }\n}), require_deflate = __commonJS({\n \"node_modules/pako/lib/zlib/deflate.js\"(exports) {\n var utils = require_common(), trees = require_trees(), adler32 = require_adler32(), crc32 = require_crc32(), msg = require_messages(), Z_NO_FLUSH = 0, Z_PARTIAL_FLUSH = 1, Z_FULL_FLUSH = 3, Z_FINISH = 4, Z_BLOCK = 5, Z_OK = 0, Z_STREAM_END = 1, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_BUF_ERROR = -5, Z_DEFAULT_COMPRESSION = -1, Z_FILTERED = 1, Z_HUFFMAN_ONLY = 2, Z_RLE = 3, Z_FIXED = 4, Z_DEFAULT_STRATEGY = 0, Z_UNKNOWN = 2, Z_DEFLATED = 8, MAX_MEM_LEVEL = 9, MAX_WBITS = 15, DEF_MEM_LEVEL = 8, LENGTH_CODES = 29, LITERALS = 256, L_CODES = LITERALS + 1 + LENGTH_CODES, D_CODES = 30, BL_CODES = 19, HEAP_SIZE = 2 * L_CODES + 1, MAX_BITS = 15, MIN_MATCH = 3, MAX_MATCH = 258, MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, PRESET_DICT = 32, INIT_STATE = 42, EXTRA_STATE = 69, NAME_STATE = 73, COMMENT_STATE = 91, HCRC_STATE = 103, BUSY_STATE = 113, FINISH_STATE = 666, BS_NEED_MORE = 1, BS_BLOCK_DONE = 2, BS_FINISH_STARTED = 3, BS_FINISH_DONE = 4, OS_CODE = 3;\n function err(strm, errorCode) {\n return strm.msg = msg[errorCode], errorCode;\n }\n function rank(f) {\n return (f << 1) - (f > 4 \? 9 : 0);\n }\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0)\n buf[len] = 0;\n }\n function flush_pending(strm) {\n var s = strm.state, len = s.pending;\n if (len > strm.avail_out)\n len = strm.avail_out;\n if (len === 0)\n return;\n if (utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out), strm.next_out += len, s.pending_out += len, strm.total_out += len, strm.avail_out -= len, s.pending -= len, s.pending === 0)\n s.pending_out = 0;\n }\n function flush_block_only(s, last) {\n trees._tr_flush_block(s, s.block_start >= 0 \? s.block_start : -1, s.strstart - s.block_start, last), s.block_start = s.strstart, flush_pending(s.strm);\n }\n function put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n }\n function putShortMSB(s, b) {\n s.pending_buf[s.pending++] = b >>> 8 & 255, s.pending_buf[s.pending++] = b & 255;\n }\n function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n if (len > size)\n len = size;\n if (len === 0)\n return 0;\n if (strm.avail_in -= len, utils.arraySet(buf, strm.input, strm.next_in, len, start), strm.state.wrap === 1)\n strm.adler = adler32(strm.adler, buf, len, start);\n else if (strm.state.wrap === 2)\n strm.adler = crc32(strm.adler, buf, len, start);\n return strm.next_in += len, strm.total_in += len, len;\n }\n function longest_match(s, cur_match) {\n var { max_chain_length: chain_length, strstart: scan } = s, match, len, best_len = s.prev_length, nice_match = s.nice_match, limit = s.strstart > s.w_size - MIN_LOOKAHEAD \? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0, _win = s.window, wmask = s.w_mask, prev = s.prev, strend = s.strstart + MAX_MATCH, scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n if (s.prev_length >= s.good_match)\n chain_length >>= 2;\n if (nice_match > s.lookahead)\n nice_match = s.lookahead;\n do {\n if (match = cur_match, _win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1])\n continue;\n scan += 2, match++;\n do\n ;\n while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);\n if (len = MAX_MATCH - (strend - scan), scan = strend - MAX_MATCH, len > best_len) {\n if (s.match_start = cur_match, best_len = len, len >= nice_match)\n break;\n scan_end1 = _win[scan + best_len - 1], scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n if (best_len <= s.lookahead)\n return best_len;\n return s.lookahead;\n }\n function fill_window(s) {\n var _w_size = s.w_size, p, n, m, more, str;\n do {\n if (more = s.window_size - s.lookahead - s.strstart, s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0), s.match_start -= _w_size, s.strstart -= _w_size, s.block_start -= _w_size, n = s.hash_size, p = n;\n do\n m = s.head[--p], s.head[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n n = _w_size, p = n;\n do\n m = s.prev[--p], s.prev[p] = m >= _w_size \? m - _w_size : 0;\n while (--n);\n more += _w_size;\n }\n if (s.strm.avail_in === 0)\n break;\n if (n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more), s.lookahead += n, s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert, s.ins_h = s.window[str], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;\n while (s.insert)\n if (s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++, s.insert--, s.lookahead + s.insert < MIN_MATCH)\n break;\n }\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n }\n function deflate_stored(s, flush) {\n var max_block_size = 65535;\n if (max_block_size > s.pending_buf_size - 5)\n max_block_size = s.pending_buf_size - 5;\n for (;; ) {\n if (s.lookahead <= 1) {\n if (fill_window(s), s.lookahead === 0 && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n s.strstart += s.lookahead, s.lookahead = 0;\n var max_start = s.block_start + max_block_size;\n if (s.strstart === 0 || s.strstart >= max_start) {\n if (s.lookahead = s.strstart - max_start, s.strstart = max_start, flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.strstart > s.block_start) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_NEED_MORE;\n }\n function deflate_fast(s, flush) {\n var hash_head, bflush;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD)\n s.match_length = longest_match(s, hash_head);\n if (s.match_length >= MIN_MATCH)\n if (bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n do\n s.strstart++, s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.match_length !== 0);\n s.strstart++;\n } else\n s.strstart += s.match_length, s.match_length = 0, s.ins_h = s.window[s.strstart], s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_slow(s, flush) {\n var hash_head, bflush, max_insert;\n for (;; ) {\n if (s.lookahead < MIN_LOOKAHEAD) {\n if (fill_window(s), s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (hash_head = 0, s.lookahead >= MIN_MATCH)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n if (s.prev_length = s.match_length, s.prev_match = s.match_start, s.match_length = MIN_MATCH - 1, hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n if (s.match_length = longest_match(s, hash_head), s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096))\n s.match_length = MIN_MATCH - 1;\n }\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH, bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH), s.lookahead -= s.prev_length - 1, s.prev_length -= 2;\n do\n if (++s.strstart <= max_insert)\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask, hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = s.strstart;\n while (--s.prev_length !== 0);\n if (s.match_available = 0, s.match_length = MIN_MATCH - 1, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n } else if (s.match_available) {\n if (bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), bflush)\n flush_block_only(s, !1);\n if (s.strstart++, s.lookahead--, s.strm.avail_out === 0)\n return BS_NEED_MORE;\n } else\n s.match_available = 1, s.strstart++, s.lookahead--;\n }\n if (s.match_available)\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]), s.match_available = 0;\n if (s.insert = s.strstart < MIN_MATCH - 1 \? s.strstart : MIN_MATCH - 1, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_rle(s, flush) {\n var bflush, prev, scan, strend, _win = s.window;\n for (;; ) {\n if (s.lookahead <= MAX_MATCH) {\n if (fill_window(s), s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n if (s.lookahead === 0)\n break;\n }\n if (s.match_length = 0, s.lookahead >= MIN_MATCH && s.strstart > 0) {\n if (scan = s.strstart - 1, prev = _win[scan], prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do\n ;\n while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n if (s.match_length = MAX_MATCH - (strend - scan), s.match_length > s.lookahead)\n s.match_length = s.lookahead;\n }\n }\n if (s.match_length >= MIN_MATCH)\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH), s.lookahead -= s.match_length, s.strstart += s.match_length, s.match_length = 0;\n else\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++;\n if (bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function deflate_huff(s, flush) {\n var bflush;\n for (;; ) {\n if (s.lookahead === 0) {\n if (fill_window(s), s.lookahead === 0) {\n if (flush === Z_NO_FLUSH)\n return BS_NEED_MORE;\n break;\n }\n }\n if (s.match_length = 0, bflush = trees._tr_tally(s, 0, s.window[s.strstart]), s.lookahead--, s.strstart++, bflush) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n }\n if (s.insert = 0, flush === Z_FINISH) {\n if (flush_block_only(s, !0), s.strm.avail_out === 0)\n return BS_FINISH_STARTED;\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n if (flush_block_only(s, !1), s.strm.avail_out === 0)\n return BS_NEED_MORE;\n }\n return BS_BLOCK_DONE;\n }\n function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length, this.max_lazy = max_lazy, this.nice_length = nice_length, this.max_chain = max_chain, this.func = func;\n }\n var configuration_table = [\n new Config(0, 0, 0, 0, deflate_stored),\n new Config(4, 4, 8, 4, deflate_fast),\n new Config(4, 5, 16, 8, deflate_fast),\n new Config(4, 6, 32, 32, deflate_fast),\n new Config(4, 4, 16, 16, deflate_slow),\n new Config(8, 16, 32, 32, deflate_slow),\n new Config(8, 16, 128, 128, deflate_slow),\n new Config(8, 32, 128, 256, deflate_slow),\n new Config(32, 128, 258, 1024, deflate_slow),\n new Config(32, 258, 258, 4096, deflate_slow)\n ];\n function lm_init(s) {\n s.window_size = 2 * s.w_size, zero(s.head), s.max_lazy_match = configuration_table[s.level].max_lazy, s.good_match = configuration_table[s.level].good_length, s.nice_match = configuration_table[s.level].nice_length, s.max_chain_length = configuration_table[s.level].max_chain, s.strstart = 0, s.block_start = 0, s.lookahead = 0, s.insert = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, s.ins_h = 0;\n }\n function DeflateState() {\n this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Z_DEFLATED, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2), this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2), this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2), zero(this.dyn_ltree), zero(this.dyn_dtree), zero(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new utils.Buf16(MAX_BITS + 1), this.heap = new utils.Buf16(2 * L_CODES + 1), zero(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new utils.Buf16(2 * L_CODES + 1), zero(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;\n }\n function deflateResetKeep(strm) {\n var s;\n if (!strm || !strm.state)\n return err(strm, Z_STREAM_ERROR);\n if (strm.total_in = strm.total_out = 0, strm.data_type = Z_UNKNOWN, s = strm.state, s.pending = 0, s.pending_out = 0, s.wrap < 0)\n s.wrap = -s.wrap;\n return s.status = s.wrap \? INIT_STATE : BUSY_STATE, strm.adler = s.wrap === 2 \? 0 : 1, s.last_flush = Z_NO_FLUSH, trees._tr_init(s), Z_OK;\n }\n function deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK)\n lm_init(strm.state);\n return ret;\n }\n function deflateSetHeader(strm, head) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (strm.state.wrap !== 2)\n return Z_STREAM_ERROR;\n return strm.state.gzhead = head, Z_OK;\n }\n function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm)\n return Z_STREAM_ERROR;\n var wrap = 1;\n if (level === Z_DEFAULT_COMPRESSION)\n level = 6;\n if (windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (windowBits > 15)\n wrap = 2, windowBits -= 16;\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED)\n return err(strm, Z_STREAM_ERROR);\n if (windowBits === 8)\n windowBits = 9;\n var s = new DeflateState;\n return strm.state = s, s.strm = strm, s.wrap = wrap, s.gzhead = null, s.w_bits = windowBits, s.w_size = 1 << s.w_bits, s.w_mask = s.w_size - 1, s.hash_bits = memLevel + 7, s.hash_size = 1 << s.hash_bits, s.hash_mask = s.hash_size - 1, s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH), s.window = new utils.Buf8(s.w_size * 2), s.head = new utils.Buf16(s.hash_size), s.prev = new utils.Buf16(s.w_size), s.lit_bufsize = 1 << memLevel + 6, s.pending_buf_size = s.lit_bufsize * 4, s.pending_buf = new utils.Buf8(s.pending_buf_size), s.d_buf = 1 * s.lit_bufsize, s.l_buf = 3 * s.lit_bufsize, s.level = level, s.strategy = strategy, s.method = method, deflateReset(strm);\n }\n function deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n }\n function deflate(strm, flush) {\n var old_flush, s, beg, val;\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0)\n return strm \? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n if (s = strm.state, !strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH)\n return err(strm, strm.avail_out === 0 \? Z_BUF_ERROR : Z_STREAM_ERROR);\n if (s.strm = strm, old_flush = s.last_flush, s.last_flush = flush, s.status === INIT_STATE)\n if (s.wrap === 2)\n if (strm.adler = 0, put_byte(s, 31), put_byte(s, 139), put_byte(s, 8), !s.gzhead)\n put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, OS_CODE), s.status = BUSY_STATE;\n else {\n if (put_byte(s, (s.gzhead.text \? 1 : 0) + (s.gzhead.hcrc \? 2 : 0) + (!s.gzhead.extra \? 0 : 4) + (!s.gzhead.name \? 0 : 8) + (!s.gzhead.comment \? 0 : 16)), put_byte(s, s.gzhead.time & 255), put_byte(s, s.gzhead.time >> 8 & 255), put_byte(s, s.gzhead.time >> 16 & 255), put_byte(s, s.gzhead.time >> 24 & 255), put_byte(s, s.level === 9 \? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 \? 4 : 0), put_byte(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length)\n put_byte(s, s.gzhead.extra.length & 255), put_byte(s, s.gzhead.extra.length >> 8 & 255);\n if (s.gzhead.hcrc)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n s.gzindex = 0, s.status = EXTRA_STATE;\n }\n else {\n var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8, level_flags = -1;\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2)\n level_flags = 0;\n else if (s.level < 6)\n level_flags = 1;\n else if (s.level === 6)\n level_flags = 2;\n else\n level_flags = 3;\n if (header |= level_flags << 6, s.strstart !== 0)\n header |= PRESET_DICT;\n if (header += 31 - header % 31, s.status = BUSY_STATE, putShortMSB(s, header), s.strstart !== 0)\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n strm.adler = 1;\n }\n if (s.status === EXTRA_STATE)\n if (s.gzhead.extra) {\n beg = s.pending;\n while (s.gzindex < (s.gzhead.extra.length & 65535)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size)\n break;\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 255), s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (s.gzindex === s.gzhead.extra.length)\n s.gzindex = 0, s.status = NAME_STATE;\n } else\n s.status = NAME_STATE;\n if (s.status === NAME_STATE)\n if (s.gzhead.name) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.name.length)\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.gzindex = 0, s.status = COMMENT_STATE;\n } else\n s.status = COMMENT_STATE;\n if (s.status === COMMENT_STATE)\n if (s.gzhead.comment) {\n beg = s.pending;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (flush_pending(strm), beg = s.pending, s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n if (s.gzindex < s.gzhead.comment.length)\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;\n else\n val = 0;\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg)\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n if (val === 0)\n s.status = HCRC_STATE;\n } else\n s.status = HCRC_STATE;\n if (s.status === HCRC_STATE)\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size)\n flush_pending(strm);\n if (s.pending + 2 <= s.pending_buf_size)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), strm.adler = 0, s.status = BUSY_STATE;\n } else\n s.status = BUSY_STATE;\n if (s.pending !== 0) {\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH)\n return err(strm, Z_BUF_ERROR);\n if (s.status === FINISH_STATE && strm.avail_in !== 0)\n return err(strm, Z_BUF_ERROR);\n if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY \? deflate_huff(s, flush) : s.strategy === Z_RLE \? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE)\n s.status = FINISH_STATE;\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0)\n s.last_flush = -1;\n return Z_OK;\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH)\n trees._tr_align(s);\n else if (flush !== Z_BLOCK) {\n if (trees._tr_stored_block(s, 0, 0, !1), flush === Z_FULL_FLUSH) {\n if (zero(s.head), s.lookahead === 0)\n s.strstart = 0, s.block_start = 0, s.insert = 0;\n }\n }\n if (flush_pending(strm), strm.avail_out === 0)\n return s.last_flush = -1, Z_OK;\n }\n }\n if (flush !== Z_FINISH)\n return Z_OK;\n if (s.wrap <= 0)\n return Z_STREAM_END;\n if (s.wrap === 2)\n put_byte(s, strm.adler & 255), put_byte(s, strm.adler >> 8 & 255), put_byte(s, strm.adler >> 16 & 255), put_byte(s, strm.adler >> 24 & 255), put_byte(s, strm.total_in & 255), put_byte(s, strm.total_in >> 8 & 255), put_byte(s, strm.total_in >> 16 & 255), put_byte(s, strm.total_in >> 24 & 255);\n else\n putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535);\n if (flush_pending(strm), s.wrap > 0)\n s.wrap = -s.wrap;\n return s.pending !== 0 \? Z_OK : Z_STREAM_END;\n }\n function deflateEnd(strm) {\n var status;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (status = strm.state.status, status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE)\n return err(strm, Z_STREAM_ERROR);\n return strm.state = null, status === BUSY_STATE \? err(strm, Z_DATA_ERROR) : Z_OK;\n }\n function deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, s, str, n, wrap, avail, next, input, tmpDict;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (s = strm.state, wrap = s.wrap, wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead)\n return Z_STREAM_ERROR;\n if (wrap === 1)\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n if (s.wrap = 0, dictLength >= s.w_size) {\n if (wrap === 0)\n zero(s.head), s.strstart = 0, s.block_start = 0, s.insert = 0;\n tmpDict = new utils.Buf8(s.w_size), utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0), dictionary = tmpDict, dictLength = s.w_size;\n }\n avail = strm.avail_in, next = strm.next_in, input = strm.input, strm.avail_in = dictLength, strm.next_in = 0, strm.input = dictionary, fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart, n = s.lookahead - (MIN_MATCH - 1);\n do\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask, s.prev[str & s.w_mask] = s.head[s.ins_h], s.head[s.ins_h] = str, str++;\n while (--n);\n s.strstart = str, s.lookahead = MIN_MATCH - 1, fill_window(s);\n }\n return s.strstart += s.lookahead, s.block_start = s.strstart, s.insert = s.lookahead, s.lookahead = 0, s.match_length = s.prev_length = MIN_MATCH - 1, s.match_available = 0, strm.next_in = next, strm.input = input, strm.avail_in = avail, s.wrap = wrap, Z_OK;\n }\n exports.deflateInit = deflateInit, exports.deflateInit2 = deflateInit2, exports.deflateReset = deflateReset, exports.deflateResetKeep = deflateResetKeep, exports.deflateSetHeader = deflateSetHeader, exports.deflate = deflate, exports.deflateEnd = deflateEnd, exports.deflateSetDictionary = deflateSetDictionary, exports.deflateInfo = \"pako deflate (from Nodeca project)\";\n }\n}), require_inffast = __commonJS({\n \"node_modules/pako/lib/zlib/inffast.js\"(exports, module2) {\n var BAD = 30, TYPE = 12;\n module2.exports = function inflate_fast(strm, start) {\n var state, _in, last, _out, beg, end, dmax, wsize, whave, wnext, s_window, hold, bits, lcode, dcode, lmask, dmask, here, op, len, dist, from, from_source, input, output;\n state = strm.state, _in = strm.next_in, input = strm.input, last = _in + (strm.avail_in - 5), _out = strm.next_out, output = strm.output, beg = _out - (start - strm.avail_out), end = _out + (strm.avail_out - 257), dmax = state.dmax, wsize = state.wsize, whave = state.whave, wnext = state.wnext, s_window = state.window, hold = state.hold, bits = state.bits, lcode = state.lencode, dcode = state.distcode, lmask = (1 << state.lenbits) - 1, dmask = (1 << state.distbits) - 1;\n top:\n do {\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = lcode[hold & lmask];\n dolen:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op === 0)\n output[_out++] = here & 65535;\n else if (op & 16) {\n if (len = here & 65535, op &= 15, op) {\n if (bits < op)\n hold += input[_in++] << bits, bits += 8;\n len += hold & (1 << op) - 1, hold >>>= op, bits -= op;\n }\n if (bits < 15)\n hold += input[_in++] << bits, bits += 8, hold += input[_in++] << bits, bits += 8;\n here = dcode[hold & dmask];\n dodist:\n for (;; ) {\n if (op = here >>> 24, hold >>>= op, bits -= op, op = here >>> 16 & 255, op & 16) {\n if (dist = here & 65535, op &= 15, bits < op) {\n if (hold += input[_in++] << bits, bits += 8, bits < op)\n hold += input[_in++] << bits, bits += 8;\n }\n if (dist += hold & (1 << op) - 1, dist > dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n if (hold >>>= op, bits -= op, op = _out - beg, dist > op) {\n if (op = dist - op, op > whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break top;\n }\n }\n if (from = 0, from_source = s_window, wnext === 0) {\n if (from += wsize - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n } else if (wnext < op) {\n if (from += wsize + wnext - op, op -= wnext, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n if (from = 0, wnext < len) {\n op = wnext, len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n }\n } else if (from += wnext - op, op < len) {\n len -= op;\n do\n output[_out++] = s_window[from++];\n while (--op);\n from = _out - dist, from_source = output;\n }\n while (len > 2)\n output[_out++] = from_source[from++], output[_out++] = from_source[from++], output[_out++] = from_source[from++], len -= 3;\n if (len) {\n if (output[_out++] = from_source[from++], len > 1)\n output[_out++] = from_source[from++];\n }\n } else {\n from = _out - dist;\n do\n output[_out++] = output[from++], output[_out++] = output[from++], output[_out++] = output[from++], len -= 3;\n while (len > 2);\n if (len) {\n if (output[_out++] = output[from++], len > 1)\n output[_out++] = output[from++];\n }\n }\n } else if ((op & 64) === 0) {\n here = dcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } else if ((op & 64) === 0) {\n here = lcode[(here & 65535) + (hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) {\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break top;\n }\n break;\n }\n } while (_in < last && _out < end);\n len = bits >> 3, _in -= len, bits -= len << 3, hold &= (1 << bits) - 1, strm.next_in = _in, strm.next_out = _out, strm.avail_in = _in < last \? 5 + (last - _in) : 5 - (_in - last), strm.avail_out = _out < end \? 257 + (end - _out) : 257 - (_out - end), state.hold = hold, state.bits = bits;\n return;\n };\n }\n}), require_inftrees = __commonJS({\n \"node_modules/pako/lib/zlib/inftrees.js\"(exports, module2) {\n var utils = require_common(), MAXBITS = 15, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, CODES = 0, LENS = 1, DISTS = 2, lbase = [\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 13,\n 15,\n 17,\n 19,\n 23,\n 27,\n 31,\n 35,\n 43,\n 51,\n 59,\n 67,\n 83,\n 99,\n 115,\n 131,\n 163,\n 195,\n 227,\n 258,\n 0,\n 0\n ], lext = [\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 17,\n 17,\n 18,\n 18,\n 18,\n 18,\n 19,\n 19,\n 19,\n 19,\n 20,\n 20,\n 20,\n 20,\n 21,\n 21,\n 21,\n 21,\n 16,\n 72,\n 78\n ], dbase = [\n 1,\n 2,\n 3,\n 4,\n 5,\n 7,\n 9,\n 13,\n 17,\n 25,\n 33,\n 49,\n 65,\n 97,\n 129,\n 193,\n 257,\n 385,\n 513,\n 769,\n 1025,\n 1537,\n 2049,\n 3073,\n 4097,\n 6145,\n 8193,\n 12289,\n 16385,\n 24577,\n 0,\n 0\n ], dext = [\n 16,\n 16,\n 16,\n 16,\n 17,\n 17,\n 18,\n 18,\n 19,\n 19,\n 20,\n 20,\n 21,\n 21,\n 22,\n 22,\n 23,\n 23,\n 24,\n 24,\n 25,\n 25,\n 26,\n 26,\n 27,\n 27,\n 28,\n 28,\n 29,\n 29,\n 64,\n 64\n ];\n module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n var bits = opts.bits, len = 0, sym = 0, min = 0, max = 0, root = 0, curr = 0, drop = 0, left = 0, used = 0, huff = 0, incr, fill, low, mask, next, base = null, base_index = 0, end, count = new utils.Buf16(MAXBITS + 1), offs = new utils.Buf16(MAXBITS + 1), extra = null, extra_index = 0, here_bits, here_op, here_val;\n for (len = 0;len <= MAXBITS; len++)\n count[len] = 0;\n for (sym = 0;sym < codes; sym++)\n count[lens[lens_index + sym]]++;\n root = bits;\n for (max = MAXBITS;max >= 1; max--)\n if (count[max] !== 0)\n break;\n if (root > max)\n root = max;\n if (max === 0)\n return table[table_index++] = 1 << 24 | 64 << 16 | 0, table[table_index++] = 1 << 24 | 64 << 16 | 0, opts.bits = 1, 0;\n for (min = 1;min < max; min++)\n if (count[min] !== 0)\n break;\n if (root < min)\n root = min;\n left = 1;\n for (len = 1;len <= MAXBITS; len++)\n if (left <<= 1, left -= count[len], left < 0)\n return -1;\n if (left > 0 && (type === CODES || max !== 1))\n return -1;\n offs[1] = 0;\n for (len = 1;len < MAXBITS; len++)\n offs[len + 1] = offs[len] + count[len];\n for (sym = 0;sym < codes; sym++)\n if (lens[lens_index + sym] !== 0)\n work[offs[lens[lens_index + sym]]++] = sym;\n if (type === CODES)\n base = extra = work, end = 19;\n else if (type === LENS)\n base = lbase, base_index -= 257, extra = lext, extra_index -= 257, end = 256;\n else\n base = dbase, extra = dext, end = -1;\n if (huff = 0, sym = 0, len = min, next = table_index, curr = root, drop = 0, low = -1, used = 1 << root, mask = used - 1, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n for (;; ) {\n if (here_bits = len - drop, work[sym] < end)\n here_op = 0, here_val = work[sym];\n else if (work[sym] > end)\n here_op = extra[extra_index + work[sym]], here_val = base[base_index + work[sym]];\n else\n here_op = 96, here_val = 0;\n incr = 1 << len - drop, fill = 1 << curr, min = fill;\n do\n fill -= incr, table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;\n while (fill !== 0);\n incr = 1 << len - 1;\n while (huff & incr)\n incr >>= 1;\n if (incr !== 0)\n huff &= incr - 1, huff += incr;\n else\n huff = 0;\n if (sym++, --count[len] === 0) {\n if (len === max)\n break;\n len = lens[lens_index + work[sym]];\n }\n if (len > root && (huff & mask) !== low) {\n if (drop === 0)\n drop = root;\n next += min, curr = len - drop, left = 1 << curr;\n while (curr + drop < max) {\n if (left -= count[curr + drop], left <= 0)\n break;\n curr++, left <<= 1;\n }\n if (used += 1 << curr, type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS)\n return 1;\n low = huff & mask, table[low] = root << 24 | curr << 16 | next - table_index | 0;\n }\n }\n if (huff !== 0)\n table[next + huff] = len - drop << 24 | 64 << 16 | 0;\n return opts.bits = root, 0;\n };\n }\n}), require_inflate = __commonJS({\n \"node_modules/pako/lib/zlib/inflate.js\"(exports) {\n var utils = require_common(), adler32 = require_adler32(), crc32 = require_crc32(), inflate_fast = require_inffast(), inflate_table = require_inftrees(), CODES = 0, LENS = 1, DISTS = 2, Z_FINISH = 4, Z_BLOCK = 5, Z_TREES = 6, Z_OK = 0, Z_STREAM_END = 1, Z_NEED_DICT = 2, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_MEM_ERROR = -4, Z_BUF_ERROR = -5, Z_DEFLATED = 8, HEAD = 1, FLAGS = 2, TIME = 3, OS = 4, EXLEN = 5, EXTRA = 6, NAME = 7, COMMENT = 8, HCRC = 9, DICTID = 10, DICT = 11, TYPE = 12, TYPEDO = 13, STORED = 14, COPY_ = 15, COPY = 16, TABLE = 17, LENLENS = 18, CODELENS = 19, LEN_ = 20, LEN = 21, LENEXT = 22, DIST = 23, DISTEXT = 24, MATCH = 25, LIT = 26, CHECK = 27, LENGTH = 28, DONE = 29, BAD = 30, MEM = 31, SYNC = 32, ENOUGH_LENS = 852, ENOUGH_DISTS = 592, MAX_WBITS = 15, DEF_WBITS = MAX_WBITS;\n function zswap32(q) {\n return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);\n }\n function InflateState() {\n this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new utils.Buf16(320), this.work = new utils.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;\n }\n function inflateResetKeep(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, strm.total_in = strm.total_out = state.total = 0, strm.msg = \"\", state.wrap)\n strm.adler = state.wrap & 1;\n return state.mode = HEAD, state.last = 0, state.havedict = 0, state.dmax = 32768, state.head = null, state.hold = 0, state.bits = 0, state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS), state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS), state.sane = 1, state.back = -1, Z_OK;\n }\n function inflateReset(strm) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n return state = strm.state, state.wsize = 0, state.whave = 0, state.wnext = 0, inflateResetKeep(strm);\n }\n function inflateReset2(strm, windowBits) {\n var wrap, state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, windowBits < 0)\n wrap = 0, windowBits = -windowBits;\n else if (wrap = (windowBits >> 4) + 1, windowBits < 48)\n windowBits &= 15;\n if (windowBits && (windowBits < 8 || windowBits > 15))\n return Z_STREAM_ERROR;\n if (state.window !== null && state.wbits !== windowBits)\n state.window = null;\n return state.wrap = wrap, state.wbits = windowBits, inflateReset(strm);\n }\n function inflateInit2(strm, windowBits) {\n var ret, state;\n if (!strm)\n return Z_STREAM_ERROR;\n if (state = new InflateState, strm.state = state, state.window = null, ret = inflateReset2(strm, windowBits), ret !== Z_OK)\n strm.state = null;\n return ret;\n }\n function inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n }\n var virgin = !0, lenfix, distfix;\n function fixedtables(state) {\n if (virgin) {\n var sym;\n lenfix = new utils.Buf32(512), distfix = new utils.Buf32(32), sym = 0;\n while (sym < 144)\n state.lens[sym++] = 8;\n while (sym < 256)\n state.lens[sym++] = 9;\n while (sym < 280)\n state.lens[sym++] = 7;\n while (sym < 288)\n state.lens[sym++] = 8;\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {\n bits: 9\n }), sym = 0;\n while (sym < 32)\n state.lens[sym++] = 5;\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {\n bits: 5\n }), virgin = !1;\n }\n state.lencode = lenfix, state.lenbits = 9, state.distcode = distfix, state.distbits = 5;\n }\n function updatewindow(strm, src, end, copy) {\n var dist, state = strm.state;\n if (state.window === null)\n state.wsize = 1 << state.wbits, state.wnext = 0, state.whave = 0, state.window = new utils.Buf8(state.wsize);\n if (copy >= state.wsize)\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0), state.wnext = 0, state.whave = state.wsize;\n else {\n if (dist = state.wsize - state.wnext, dist > copy)\n dist = copy;\n if (utils.arraySet(state.window, src, end - copy, dist, state.wnext), copy -= dist, copy)\n utils.arraySet(state.window, src, end - copy, copy, 0), state.wnext = copy, state.whave = state.wsize;\n else {\n if (state.wnext += dist, state.wnext === state.wsize)\n state.wnext = 0;\n if (state.whave < state.wsize)\n state.whave += dist;\n }\n }\n return 0;\n }\n function inflate(strm, flush) {\n var state, input, output, next, put, have, left, hold, bits, _in, _out, copy, from, from_source, here = 0, here_bits, here_op, here_val, last_bits, last_op, last_val, len, ret, hbuf = new utils.Buf8(4), opts, n, order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.mode === TYPE)\n state.mode = TYPEDO;\n put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, _in = have, _out = left, ret = Z_OK;\n inf_leave:\n for (;; )\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.wrap & 2 && hold === 35615) {\n state.check = 0, hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0), hold = 0, bits = 0, state.mode = FLAGS;\n break;\n }\n if (state.flags = 0, state.head)\n state.head.done = !1;\n if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {\n strm.msg = \"incorrect header check\", state.mode = BAD;\n break;\n }\n if ((hold & 15) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (hold >>>= 4, bits -= 4, len = (hold & 15) + 8, state.wbits === 0)\n state.wbits = len;\n else if (len > state.wbits) {\n strm.msg = \"invalid window size\", state.mode = BAD;\n break;\n }\n state.dmax = 1 << len, strm.adler = state.check = 1, state.mode = hold & 512 \? DICTID : TYPE, hold = 0, bits = 0;\n break;\n case FLAGS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.flags = hold, (state.flags & 255) !== Z_DEFLATED) {\n strm.msg = \"unknown compression method\", state.mode = BAD;\n break;\n }\n if (state.flags & 57344) {\n strm.msg = \"unknown header flags set\", state.mode = BAD;\n break;\n }\n if (state.head)\n state.head.text = hold >> 8 & 1;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = TIME;\n case TIME:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.time = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, hbuf[2] = hold >>> 16 & 255, hbuf[3] = hold >>> 24 & 255, state.check = crc32(state.check, hbuf, 4, 0);\n hold = 0, bits = 0, state.mode = OS;\n case OS:\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.head)\n state.head.xflags = hold & 255, state.head.os = hold >> 8;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0, state.mode = EXLEN;\n case EXLEN:\n if (state.flags & 1024) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.length = hold, state.head)\n state.head.extra_len = hold;\n if (state.flags & 512)\n hbuf[0] = hold & 255, hbuf[1] = hold >>> 8 & 255, state.check = crc32(state.check, hbuf, 2, 0);\n hold = 0, bits = 0;\n } else if (state.head)\n state.head.extra = null;\n state.mode = EXTRA;\n case EXTRA:\n if (state.flags & 1024) {\n if (copy = state.length, copy > have)\n copy = have;\n if (copy) {\n if (state.head) {\n if (len = state.head.extra_len - state.length, !state.head.extra)\n state.head.extra = new @Array(state.head.extra_len);\n utils.arraySet(state.head.extra, input, next, copy, len);\n }\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n have -= copy, next += copy, state.length -= copy;\n }\n if (state.length)\n break inf_leave;\n }\n state.length = 0, state.mode = NAME;\n case NAME:\n if (state.flags & 2048) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.name += @String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.name = null;\n state.length = 0, state.mode = COMMENT;\n case COMMENT:\n if (state.flags & 4096) {\n if (have === 0)\n break inf_leave;\n copy = 0;\n do\n if (len = input[next + copy++], state.head && len && state.length < 65536)\n state.head.comment += @String.fromCharCode(len);\n while (len && copy < have);\n if (state.flags & 512)\n state.check = crc32(state.check, input, copy, next);\n if (have -= copy, next += copy, len)\n break inf_leave;\n } else if (state.head)\n state.head.comment = null;\n state.mode = HCRC;\n case HCRC:\n if (state.flags & 512) {\n while (bits < 16) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.check & 65535)) {\n strm.msg = \"header crc mismatch\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n if (state.head)\n state.head.hcrc = state.flags >> 9 & 1, state.head.done = !0;\n strm.adler = state.check = 0, state.mode = TYPE;\n break;\n case DICTID:\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n strm.adler = state.check = zswap32(hold), hold = 0, bits = 0, state.mode = DICT;\n case DICT:\n if (state.havedict === 0)\n return strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, Z_NEED_DICT;\n strm.adler = state.check = 1, state.mode = TYPE;\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES)\n break inf_leave;\n case TYPEDO:\n if (state.last) {\n hold >>>= bits & 7, bits -= bits & 7, state.mode = CHECK;\n break;\n }\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n switch (state.last = hold & 1, hold >>>= 1, bits -= 1, hold & 3) {\n case 0:\n state.mode = STORED;\n break;\n case 1:\n if (fixedtables(state), state.mode = LEN_, flush === Z_TREES) {\n hold >>>= 2, bits -= 2;\n break inf_leave;\n }\n break;\n case 2:\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = \"invalid block type\", state.mode = BAD;\n }\n hold >>>= 2, bits -= 2;\n break;\n case STORED:\n hold >>>= bits & 7, bits -= bits & 7;\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {\n strm.msg = \"invalid stored block lengths\", state.mode = BAD;\n break;\n }\n if (state.length = hold & 65535, hold = 0, bits = 0, state.mode = COPY_, flush === Z_TREES)\n break inf_leave;\n case COPY_:\n state.mode = COPY;\n case COPY:\n if (copy = state.length, copy) {\n if (copy > have)\n copy = have;\n if (copy > left)\n copy = left;\n if (copy === 0)\n break inf_leave;\n utils.arraySet(output, input, next, copy, put), have -= copy, next += copy, left -= copy, put += copy, state.length -= copy;\n break;\n }\n state.mode = TYPE;\n break;\n case TABLE:\n while (bits < 14) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (state.nlen = (hold & 31) + 257, hold >>>= 5, bits -= 5, state.ndist = (hold & 31) + 1, hold >>>= 5, bits -= 5, state.ncode = (hold & 15) + 4, hold >>>= 4, bits -= 4, state.nlen > 286 || state.ndist > 30) {\n strm.msg = \"too many length or distance symbols\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = LENLENS;\n case LENLENS:\n while (state.have < state.ncode) {\n while (bits < 3) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.lens[order[state.have++]] = hold & 7, hold >>>= 3, bits -= 3;\n }\n while (state.have < 19)\n state.lens[order[state.have++]] = 0;\n if (state.lencode = state.lendyn, state.lenbits = 7, opts = { bits: state.lenbits }, ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid code lengths set\", state.mode = BAD;\n break;\n }\n state.have = 0, state.mode = CODELENS;\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_val < 16)\n hold >>>= here_bits, bits -= here_bits, state.lens[state.have++] = here_val;\n else {\n if (here_val === 16) {\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.have === 0) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1], copy = 3 + (hold & 3), hold >>>= 2, bits -= 2;\n } else if (here_val === 17) {\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 3 + (hold & 7), hold >>>= 3, bits -= 3;\n } else {\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= here_bits, bits -= here_bits, len = 0, copy = 11 + (hold & 127), hold >>>= 7, bits -= 7;\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = \"invalid bit length repeat\", state.mode = BAD;\n break;\n }\n while (copy--)\n state.lens[state.have++] = len;\n }\n }\n if (state.mode === BAD)\n break;\n if (state.lens[256] === 0) {\n strm.msg = \"invalid code -- missing end-of-block\", state.mode = BAD;\n break;\n }\n if (state.lenbits = 9, opts = { bits: state.lenbits }, ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts), state.lenbits = opts.bits, ret) {\n strm.msg = \"invalid literal/lengths set\", state.mode = BAD;\n break;\n }\n if (state.distbits = 6, state.distcode = state.distdyn, opts = { bits: state.distbits }, ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts), state.distbits = opts.bits, ret) {\n strm.msg = \"invalid distances set\", state.mode = BAD;\n break;\n }\n if (state.mode = LEN_, flush === Z_TREES)\n break inf_leave;\n case LEN_:\n state.mode = LEN;\n case LEN:\n if (have >= 6 && left >= 258) {\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, inflate_fast(strm, _out), put = strm.next_out, output = strm.output, left = strm.avail_out, next = strm.next_in, input = strm.input, have = strm.avail_in, hold = state.hold, bits = state.bits, state.mode === TYPE)\n state.back = -1;\n break;\n }\n state.back = 0;\n for (;; ) {\n if (here = state.lencode[hold & (1 << state.lenbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (here_op && (here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, state.length = here_val, here_op === 0) {\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n state.back = -1, state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = \"invalid literal/length code\", state.mode = BAD;\n break;\n }\n state.extra = here_op & 15, state.mode = LENEXT;\n case LENEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.length += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n state.was = state.length, state.mode = DIST;\n case DIST:\n for (;; ) {\n if (here = state.distcode[hold & (1 << state.distbits) - 1], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if ((here_op & 240) === 0) {\n last_bits = here_bits, last_op = here_op, last_val = here_val;\n for (;; ) {\n if (here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)], here_bits = here >>> 24, here_op = here >>> 16 & 255, here_val = here & 65535, last_bits + here_bits <= bits)\n break;\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n hold >>>= last_bits, bits -= last_bits, state.back += last_bits;\n }\n if (hold >>>= here_bits, bits -= here_bits, state.back += here_bits, here_op & 64) {\n strm.msg = \"invalid distance code\", state.mode = BAD;\n break;\n }\n state.offset = here_val, state.extra = here_op & 15, state.mode = DISTEXT;\n case DISTEXT:\n if (state.extra) {\n n = state.extra;\n while (bits < n) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n state.offset += hold & (1 << state.extra) - 1, hold >>>= state.extra, bits -= state.extra, state.back += state.extra;\n }\n if (state.offset > state.dmax) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n state.mode = MATCH;\n case MATCH:\n if (left === 0)\n break inf_leave;\n if (copy = _out - left, state.offset > copy) {\n if (copy = state.offset - copy, copy > state.whave) {\n if (state.sane) {\n strm.msg = \"invalid distance too far back\", state.mode = BAD;\n break;\n }\n }\n if (copy > state.wnext)\n copy -= state.wnext, from = state.wsize - copy;\n else\n from = state.wnext - copy;\n if (copy > state.length)\n copy = state.length;\n from_source = state.window;\n } else\n from_source = output, from = put - state.offset, copy = state.length;\n if (copy > left)\n copy = left;\n left -= copy, state.length -= copy;\n do\n output[put++] = from_source[from++];\n while (--copy);\n if (state.length === 0)\n state.mode = LEN;\n break;\n case LIT:\n if (left === 0)\n break inf_leave;\n output[put++] = state.length, left--, state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold |= input[next++] << bits, bits += 8;\n }\n if (_out -= left, strm.total_out += _out, state.total += _out, _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);\n if (_out = left, (state.flags \? hold : zswap32(hold)) !== state.check) {\n strm.msg = \"incorrect data check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = LENGTH;\n case LENGTH:\n if (state.wrap && state.flags) {\n while (bits < 32) {\n if (have === 0)\n break inf_leave;\n have--, hold += input[next++] << bits, bits += 8;\n }\n if (hold !== (state.total & 4294967295)) {\n strm.msg = \"incorrect length check\", state.mode = BAD;\n break;\n }\n hold = 0, bits = 0;\n }\n state.mode = DONE;\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n default:\n return Z_STREAM_ERROR;\n }\n if (strm.next_out = put, strm.avail_out = left, strm.next_in = next, strm.avail_in = have, state.hold = hold, state.bits = bits, state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out))\n return state.mode = MEM, Z_MEM_ERROR;\n }\n if (_in -= strm.avail_in, _out -= strm.avail_out, strm.total_in += _in, strm.total_out += _out, state.total += _out, state.wrap && _out)\n strm.adler = state.check = state.flags \? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);\n if (strm.data_type = state.bits + (state.last \? 64 : 0) + (state.mode === TYPE \? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ \? 256 : 0), (_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK)\n ret = Z_BUF_ERROR;\n return ret;\n }\n function inflateEnd(strm) {\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n var state = strm.state;\n if (state.window)\n state.window = null;\n return strm.state = null, Z_OK;\n }\n function inflateGetHeader(strm, head) {\n var state;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, (state.wrap & 2) === 0)\n return Z_STREAM_ERROR;\n return state.head = head, head.done = !1, Z_OK;\n }\n function inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length, state, dictid, ret;\n if (!strm || !strm.state)\n return Z_STREAM_ERROR;\n if (state = strm.state, state.wrap !== 0 && state.mode !== DICT)\n return Z_STREAM_ERROR;\n if (state.mode === DICT) {\n if (dictid = 1, dictid = adler32(dictid, dictionary, dictLength, 0), dictid !== state.check)\n return Z_DATA_ERROR;\n }\n if (ret = updatewindow(strm, dictionary, dictLength, dictLength), ret)\n return state.mode = MEM, Z_MEM_ERROR;\n return state.havedict = 1, Z_OK;\n }\n exports.inflateReset = inflateReset, exports.inflateReset2 = inflateReset2, exports.inflateResetKeep = inflateResetKeep, exports.inflateInit = inflateInit, exports.inflateInit2 = inflateInit2, exports.inflate = inflate, exports.inflateEnd = inflateEnd, exports.inflateGetHeader = inflateGetHeader, exports.inflateSetDictionary = inflateSetDictionary, exports.inflateInfo = \"pako inflate (from Nodeca project)\";\n }\n}), require_constants = __commonJS({\n \"node_modules/pako/lib/zlib/constants.js\"(exports, module2) {\n module2.exports = {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_BUF_ERROR: -5,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n Z_BINARY: 0,\n Z_TEXT: 1,\n Z_UNKNOWN: 2,\n Z_DEFLATED: 8\n };\n }\n}), require_binding = __commonJS({\n \"node_modules/browserify-zlib/lib/binding.js\"(exports) {\n var Zstream = require_zstream(), zlib_deflate = require_deflate(), zlib_inflate = require_inflate(), constants = require_constants();\n for (key in constants)\n exports[key] = constants[key];\n var key;\n exports.NONE = 0, exports.DEFLATE = 1, exports.INFLATE = 2, exports.GZIP = 3, exports.GUNZIP = 4, exports.DEFLATERAW = 5, exports.INFLATERAW = 6, exports.UNZIP = 7;\n var GZIP_HEADER_ID1 = 31, GZIP_HEADER_ID2 = 139;\n function Zlib(mode) {\n if (typeof mode !== \"number\" || mode < exports.DEFLATE || mode > exports.UNZIP)\n @throwTypeError(\"Bad argument\");\n this.dictionary = null, this.err = 0, this.flush = 0, this.init_done = !1, this.level = 0, this.memLevel = 0, this.mode = mode, this.strategy = 0, this.windowBits = 0, this.write_in_progress = !1, this.pending_close = !1, this.gzip_id_bytes_read = 0;\n }\n Zlib.prototype = {}, Zlib.prototype.close = function() {\n if (this.write_in_progress) {\n this.pending_close = !0;\n return;\n }\n if (this.pending_close = !1, assert(this.init_done, \"close before init\"), assert(this.mode <= exports.UNZIP), this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW)\n zlib_deflate.deflateEnd(this.strm);\n else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP)\n zlib_inflate.inflateEnd(this.strm);\n this.mode = exports.NONE, this.dictionary = null;\n }, Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!0, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(!1, flush, input, in_off, in_len, out, out_off, out_len);\n }, Zlib.prototype._write = function(async, flush, input, in_off, in_len, out, out_off, out_len) {\n if (assert.equal(arguments.length, 8), assert(this.init_done, \"write before init\"), assert(this.mode !== exports.NONE, \"already finalized\"), assert.equal(!1, this.write_in_progress, \"write already in progress\"), assert.equal(!1, this.pending_close, \"close is pending\"), this.write_in_progress = !0, assert.equal(!1, flush === void 0, \"must provide flush value\"), this.write_in_progress = !0, flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK)\n throw new Error(\"Invalid flush value\");\n if (input == null)\n input = @Buffer.alloc(0), in_len = 0, in_off = 0;\n if (this.strm.avail_in = in_len, this.strm.input = input, this.strm.next_in = in_off, this.strm.avail_out = out_len, this.strm.output = out, this.strm.next_out = out_off, this.flush = flush, !async) {\n if (this._process(), this._checkError())\n return this._afterSync();\n return;\n }\n var self = this;\n return process.nextTick(function() {\n self._process(), self._after();\n }), this;\n }, Zlib.prototype._afterSync = function() {\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n return this.write_in_progress = !1, [avail_in, avail_out];\n }, Zlib.prototype._process = function() {\n var next_expected_header_byte = null;\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n case exports.UNZIP:\n if (this.strm.avail_in > 0)\n next_expected_header_byte = this.strm.next_in;\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n if (this.gzip_id_bytes_read = 1, next_expected_header_byte++, this.strm.avail_in === 1)\n break;\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n case 1:\n if (next_expected_header_byte === null)\n break;\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2)\n this.gzip_id_bytes_read = 2, this.mode = exports.GUNZIP;\n else\n this.mode = exports.INFLATE;\n break;\n default:\n throw new Error(\"invalid number of gzip magic number bytes read\");\n }\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n if (this.err = zlib_inflate.inflate(this.strm, this.flush), this.err === exports.Z_NEED_DICT && this.dictionary) {\n if (this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary), this.err === exports.Z_OK)\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n else if (this.err === exports.Z_DATA_ERROR)\n this.err = exports.Z_NEED_DICT;\n }\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0)\n this.reset(), this.err = zlib_inflate.inflate(this.strm, this.flush);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n }, Zlib.prototype._checkError = function() {\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH)\n return this._error(\"unexpected end of file\"), !1;\n break;\n case exports.Z_STREAM_END:\n break;\n case exports.Z_NEED_DICT:\n if (this.dictionary == null)\n this._error(\"Missing dictionary\");\n else\n this._error(\"Bad dictionary\");\n return !1;\n default:\n return this._error(\"Zlib error\"), !1;\n }\n return !0;\n }, Zlib.prototype._after = function() {\n if (!this._checkError())\n return;\n var avail_out = this.strm.avail_out, avail_in = this.strm.avail_in;\n if (this.write_in_progress = !1, this.callback(avail_in, avail_out), this.pending_close)\n this.close();\n }, Zlib.prototype._error = function(message) {\n if (this.strm.msg)\n message = this.strm.msg;\n if (this.onerror(message, this.err), this.write_in_progress = !1, this.pending_close)\n this.close();\n }, Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, \"init(windowBits, level, memLevel, strategy, [dictionary])\"), assert(windowBits >= 8 && windowBits <= 15, \"invalid windowBits\"), assert(level >= -1 && level <= 9, \"invalid compression level\"), assert(memLevel >= 1 && memLevel <= 9, \"invalid memlevel\"), assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, \"invalid strategy\"), this._init(level, windowBits, memLevel, strategy, dictionary), this._setDictionary();\n }, Zlib.prototype.params = function() {\n throw new Error(\"deflateParams Not supported\");\n }, Zlib.prototype.reset = function() {\n this._reset(), this._setDictionary();\n }, Zlib.prototype._init = function(level, windowBits, memLevel, strategy, dictionary) {\n if (this.level = level, this.windowBits = windowBits, this.memLevel = memLevel, this.strategy = strategy, this.flush = exports.Z_NO_FLUSH, this.err = exports.Z_OK, this.mode === exports.GZIP || this.mode === exports.GUNZIP)\n this.windowBits += 16;\n if (this.mode === exports.UNZIP)\n this.windowBits += 32;\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW)\n this.windowBits = -1 * this.windowBits;\n switch (this.strm = new Zstream, this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Init error\");\n this.dictionary = dictionary, this.write_in_progress = !1, this.init_done = !0;\n }, Zlib.prototype._setDictionary = function() {\n if (this.dictionary == null)\n return;\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to set dictionary\");\n }, Zlib.prototype._reset = function() {\n switch (this.err = exports.Z_OK, this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n default:\n break;\n }\n if (this.err !== exports.Z_OK)\n this._error(\"Failed to reset stream\");\n }, exports.Zlib = Zlib;\n }\n}), require_lib = __commonJS({\n \"node_modules/browserify-zlib/lib/index.js\"(exports) {\n var Buffer2 = BufferModule.Buffer, Transform = StreamModule.Transform, binding = require_binding(), util = Util, kMaxLength = BufferModule.kMaxLength, kRangeErrorMessage = \"Cannot create final Buffer. It would be larger than 0x\" + kMaxLength.toString(16) + \" bytes\";\n binding.Z_MIN_WINDOWBITS = 8, binding.Z_MAX_WINDOWBITS = 15, binding.Z_DEFAULT_WINDOWBITS = 15, binding.Z_MIN_CHUNK = 64, binding.Z_MAX_CHUNK = @Infinity, binding.Z_DEFAULT_CHUNK = 16384, binding.Z_MIN_MEMLEVEL = 1, binding.Z_MAX_MEMLEVEL = 9, binding.Z_DEFAULT_MEMLEVEL = 8, binding.Z_MIN_LEVEL = -1, binding.Z_MAX_LEVEL = 9, binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;\n var bkeys = Object.keys(binding);\n for (bk = 0;bk < bkeys.length; bk++)\n if (bkey = bkeys[bk], bkey.match(/^Z/))\n Object.defineProperty(exports, bkey, {\n enumerable: !0,\n value: binding[bkey],\n writable: !1\n });\n var bkey, bk, codes = {\n Z_OK: binding.Z_OK,\n Z_STREAM_END: binding.Z_STREAM_END,\n Z_NEED_DICT: binding.Z_NEED_DICT,\n Z_ERRNO: binding.Z_ERRNO,\n Z_STREAM_ERROR: binding.Z_STREAM_ERROR,\n Z_DATA_ERROR: binding.Z_DATA_ERROR,\n Z_MEM_ERROR: binding.Z_MEM_ERROR,\n Z_BUF_ERROR: binding.Z_BUF_ERROR,\n Z_VERSION_ERROR: binding.Z_VERSION_ERROR\n }, ckeys = Object.keys(codes);\n for (ck = 0;ck < ckeys.length; ck++)\n ckey = ckeys[ck], codes[codes[ckey]] = ckey;\n var ckey, ck;\n Object.defineProperty(exports, \"codes\", {\n enumerable: !0,\n value: Object.freeze(codes),\n writable: !1\n }), exports.constants = require_constants(), exports.Deflate = Deflate, exports.Inflate = Inflate, exports.Gzip = Gzip, exports.Gunzip = Gunzip, exports.DeflateRaw = DeflateRaw, exports.InflateRaw = InflateRaw, exports.Unzip = Unzip, exports.createDeflate = function(o) {\n return new Deflate(o);\n }, exports.createInflate = function(o) {\n return new Inflate(o);\n }, exports.createDeflateRaw = function(o) {\n return new DeflateRaw(o);\n }, exports.createInflateRaw = function(o) {\n return new InflateRaw(o);\n }, exports.createGzip = function(o) {\n return new Gzip(o);\n }, exports.createGunzip = function(o) {\n return new Gunzip(o);\n }, exports.createUnzip = function(o) {\n return new Unzip(o);\n }, exports.deflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Deflate(opts), buffer, callback);\n }, exports.deflateSync = function(buffer, opts) {\n return zlibBufferSync(new Deflate(opts), buffer);\n }, exports.gzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gzip(opts), buffer, callback);\n }, exports.gzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gzip(opts), buffer);\n }, exports.deflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new DeflateRaw(opts), buffer, callback);\n }, exports.deflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new DeflateRaw(opts), buffer);\n }, exports.unzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Unzip(opts), buffer, callback);\n }, exports.unzipSync = function(buffer, opts) {\n return zlibBufferSync(new Unzip(opts), buffer);\n }, exports.inflate = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Inflate(opts), buffer, callback);\n }, exports.inflateSync = function(buffer, opts) {\n return zlibBufferSync(new Inflate(opts), buffer);\n }, exports.gunzip = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new Gunzip(opts), buffer, callback);\n }, exports.gunzipSync = function(buffer, opts) {\n return zlibBufferSync(new Gunzip(opts), buffer);\n }, exports.inflateRaw = function(buffer, opts, callback) {\n if (typeof opts === \"function\")\n callback = opts, opts = {};\n return zlibBuffer(new InflateRaw(opts), buffer, callback);\n }, exports.inflateRawSync = function(buffer, opts) {\n return zlibBufferSync(new InflateRaw(opts), buffer);\n }, exports.brotliCompress = function(buffer, opts, callback) {\n throw new Error(\"zlib.brotliCompress is not implemented\");\n };\n function zlibBuffer(engine, buffer, callback) {\n var buffers = [], nread = 0;\n engine.on(\"error\", onError), engine.on(\"end\", onEnd), engine.end(buffer), flow();\n function flow() {\n var chunk;\n while ((chunk = engine.read()) !== null)\n buffers.push(chunk), nread += chunk.length;\n engine.once(\"readable\", flow);\n }\n function onError(err) {\n engine.removeListener(\"end\", onEnd), engine.removeListener(\"readable\", flow), callback(err);\n }\n function onEnd() {\n var buf, err = null;\n if (nread >= kMaxLength)\n err = new RangeError(kRangeErrorMessage);\n else\n buf = Buffer2.concat(buffers, nread);\n buffers = [], engine.close(), callback(err, buf);\n }\n }\n function zlibBufferSync(engine, buffer) {\n if (typeof buffer === \"string\")\n buffer = Buffer2.from(buffer);\n if (!Buffer2.isBuffer(buffer))\n @throwTypeError(\"Not a string or buffer\");\n var flushFlag = engine._finishFlushFlag;\n return engine._processChunk(buffer, flushFlag);\n }\n function Deflate(opts) {\n if (!(this instanceof Deflate))\n return new Deflate(opts);\n Zlib.@call(this, opts, binding.DEFLATE);\n }\n function Inflate(opts) {\n if (!(this instanceof Inflate))\n return new Inflate(opts);\n Zlib.@call(this, opts, binding.INFLATE);\n }\n function Gzip(opts) {\n if (!(this instanceof Gzip))\n return new Gzip(opts);\n Zlib.@call(this, opts, binding.GZIP);\n }\n function Gunzip(opts) {\n if (!(this instanceof Gunzip))\n return new Gunzip(opts);\n Zlib.@call(this, opts, binding.GUNZIP);\n }\n function DeflateRaw(opts) {\n if (!(this instanceof DeflateRaw))\n return new DeflateRaw(opts);\n Zlib.@call(this, opts, binding.DEFLATERAW);\n }\n function InflateRaw(opts) {\n if (!(this instanceof InflateRaw))\n return new InflateRaw(opts);\n Zlib.@call(this, opts, binding.INFLATERAW);\n }\n function Unzip(opts) {\n if (!(this instanceof Unzip))\n return new Unzip(opts);\n Zlib.@call(this, opts, binding.UNZIP);\n }\n function isValidFlushFlag(flag) {\n return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;\n }\n function Zlib(opts, mode) {\n var _this = this;\n if (this._opts = opts = opts || {}, this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK, Transform.@call(this, opts), opts.flush && !isValidFlushFlag(opts.flush))\n throw new Error(\"Invalid flush flag: \" + opts.flush);\n if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush))\n throw new Error(\"Invalid flush flag: \" + opts.finishFlush);\n if (this._flushFlag = opts.flush || binding.Z_NO_FLUSH, this._finishFlushFlag = typeof opts.finishFlush !== \"undefined\" \? opts.finishFlush : binding.Z_FINISH, opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK)\n throw new Error(\"Invalid chunk size: \" + opts.chunkSize);\n }\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS)\n throw new Error(\"Invalid windowBits: \" + opts.windowBits);\n }\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL)\n throw new Error(\"Invalid compression level: \" + opts.level);\n }\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL)\n throw new Error(\"Invalid memLevel: \" + opts.memLevel);\n }\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY)\n throw new Error(\"Invalid strategy: \" + opts.strategy);\n }\n if (opts.dictionary) {\n if (!Buffer2.isBuffer(opts.dictionary))\n throw new Error(\"Invalid dictionary: it should be a Buffer instance\");\n }\n this._handle = new binding.Zlib(mode);\n var self = this;\n this._hadError = !1, this._handle.onerror = function(message, errno) {\n _close(self), self._hadError = !0;\n var error = new Error(message);\n error.errno = errno, error.code = exports.codes[errno], self.emit(\"error\", error);\n };\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === \"number\")\n level = opts.level;\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === \"number\")\n strategy = opts.strategy;\n this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary), this._buffer = Buffer2.allocUnsafe(this._chunkSize), this._offset = 0, this._level = level, this._strategy = strategy, this.once(\"end\", this.close), Object.defineProperty(this, \"_closed\", {\n get: function() {\n return !_this._handle;\n },\n configurable: !0,\n enumerable: !0\n });\n }\n util.inherits(Zlib, Transform), Zlib.prototype.params = function(level, strategy, callback) {\n if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL)\n @throwRangeError(\"Invalid compression level: \" + level);\n if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY)\n @throwTypeError(\"Invalid strategy: \" + strategy);\n if (this._level !== level || this._strategy !== strategy) {\n var self = this;\n this.flush(binding.Z_SYNC_FLUSH, function() {\n if (assert(self._handle, \"zlib binding closed\"), self._handle.params(level, strategy), !self._hadError) {\n if (self._level = level, self._strategy = strategy, callback)\n callback();\n }\n });\n } else\n process.nextTick(callback);\n }, Zlib.prototype.reset = function() {\n return assert(this._handle, \"zlib binding closed\"), this._handle.reset();\n }, Zlib.prototype._flush = function(callback) {\n this._transform(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.flush = function(kind, callback) {\n var _this2 = this, ws = this._writableState;\n if (typeof kind === \"function\" || kind === void 0 && !callback)\n callback = kind, kind = binding.Z_FULL_FLUSH;\n if (ws.ended) {\n if (callback)\n process.nextTick(callback);\n } else if (ws.ending) {\n if (callback)\n this.once(\"end\", callback);\n } else if (ws.needDrain) {\n if (callback)\n this.once(\"drain\", function() {\n return _this2.flush(kind, callback);\n });\n } else\n this._flushFlag = kind, this.write(Buffer2.alloc(0), \"\", callback);\n }, Zlib.prototype.close = function(callback) {\n _close(this, callback), process.nextTick(emitCloseNT, this);\n };\n function _close(engine, callback) {\n if (callback)\n process.nextTick(callback);\n if (!engine._handle)\n return;\n engine._handle.close(), engine._handle = null;\n }\n function emitCloseNT(self) {\n self.emit(\"close\");\n }\n Zlib.prototype._transform = function(chunk, encoding, cb) {\n var flushFlag, ws = this._writableState, ending = ws.ending || ws.ended, last = ending && (!chunk || ws.length === chunk.length);\n if (chunk !== null && !Buffer2.isBuffer(chunk))\n return cb(new Error(\"invalid input\"));\n if (!this._handle)\n return cb(new Error(\"zlib binding closed\"));\n if (last)\n flushFlag = this._finishFlushFlag;\n else if (flushFlag = this._flushFlag, chunk.length >= ws.length)\n this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;\n this._processChunk(chunk, flushFlag, cb);\n }, Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {\n var availInBefore = chunk && chunk.length, availOutBefore = this._chunkSize - this._offset, inOff = 0, self = this, async = typeof cb === \"function\";\n if (!async) {\n var buffers = [], nread = 0, error;\n this.on(\"error\", function(er) {\n error = er;\n }), assert(this._handle, \"zlib binding closed\");\n do\n var res = this._handle.writeSync(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n while (!this._hadError && callback(res[0], res[1]));\n if (this._hadError)\n throw error;\n if (nread >= kMaxLength)\n _close(this), @throwRangeError(kRangeErrorMessage);\n var buf = Buffer2.concat(buffers, nread);\n return _close(this), buf;\n }\n assert(this._handle, \"zlib binding closed\");\n var req = this._handle.write(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);\n req.buffer = chunk, req.callback = callback;\n function callback(availInAfter, availOutAfter) {\n if (this)\n this.buffer = null, this.callback = null;\n if (self._hadError)\n return;\n var have = availOutBefore - availOutAfter;\n if (assert(have >= 0, \"have should not go down\"), have > 0) {\n var out = self._buffer.slice(self._offset, self._offset + have);\n if (self._offset += have, async)\n self.push(out);\n else\n buffers.push(out), nread += out.length;\n }\n if (availOutAfter === 0 || self._offset >= self._chunkSize)\n availOutBefore = self._chunkSize, self._offset = 0, self._buffer = Buffer2.allocUnsafe(self._chunkSize);\n if (availOutAfter === 0) {\n if (inOff += availInBefore - availInAfter, availInBefore = availInAfter, !async)\n return !0;\n var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);\n newReq.callback = callback, newReq.buffer = chunk;\n return;\n }\n if (!async)\n return !1;\n cb();\n }\n }, util.inherits(Deflate, Zlib), util.inherits(Inflate, Zlib), util.inherits(Gzip, Zlib), util.inherits(Gunzip, Zlib), util.inherits(DeflateRaw, Zlib), util.inherits(InflateRaw, Zlib), util.inherits(Unzip, Zlib);\n }\n});\nreturn require_lib()})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyDepdCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/depd.ts\nvar wrapfunction = function(fn, message) {\n if (typeof fn !== \"function\")\n @throwTypeError(\"argument fn must be a function\");\n return fn;\n}, wrapproperty = function(obj, prop, message) {\n if (!obj || typeof obj !== \"object\" && typeof obj !== \"function\")\n @throwTypeError(\"argument obj must be object\");\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n if (!descriptor)\n @throwTypeError(\"must call property on owner object\");\n if (!descriptor.configurable)\n @throwTypeError(\"property must be configurable\");\n}, $;\n$ = function depd(namespace) {\n if (!namespace)\n @throwTypeError(\"argument namespace is required\");\n function deprecate(message) {\n }\n return deprecate._file = void 0, deprecate._ignored = !0, deprecate._namespace = namespace, deprecate._traced = !1, deprecate._warned = Object.create(null), deprecate.function = wrapfunction, deprecate.property = wrapproperty, deprecate;\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyDepdCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/depd.ts\nvar wrapfunction = function(fn, message) {\n if (typeof fn !== \"function\")\n @throwTypeError(\"argument fn must be a function\");\n return fn;\n}, wrapproperty = function(obj, prop, message) {\n if (!obj || typeof obj !== \"object\" && typeof obj !== \"function\")\n @throwTypeError(\"argument obj must be object\");\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n if (!descriptor)\n @throwTypeError(\"must call property on owner object\");\n if (!descriptor.configurable)\n @throwTypeError(\"property must be configurable\");\n}, $;\n$ = function depd(namespace) {\n if (!namespace)\n @throwTypeError(\"argument namespace is required\");\n function deprecate(message) {\n }\n return deprecate._file = void 0, deprecate._ignored = !0, deprecate._namespace = namespace, deprecate._traced = !1, deprecate._warned = Object.create(null), deprecate.function = wrapfunction, deprecate.property = wrapproperty, deprecate;\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyDetectLibcCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/detect-libc.ts\nvar family = function() {\n return Promise.resolve(familySync());\n}, familySync = function() {\n return null;\n}, version = function() {\n return Promise.resolve(versionSync());\n}, versionSync = function() {\n return null;\n}, isNonGlibcLinuxSync = function() {\n return !1;\n}, isNonGlibcLinux = function() {\n return Promise.resolve(isNonGlibcLinuxSync());\n}, $, GLIBC = \"glibc\", MUSL = \"musl\";\n$ = {\n GLIBC,\n MUSL,\n family,\n familySync,\n isNonGlibcLinux,\n isNonGlibcLinuxSync,\n version,\n versionSync\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyDetectLibcCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/detect-libc.ts\nvar family = function() {\n return @Promise.resolve(familySync());\n}, familySync = function() {\n return null;\n}, version = function() {\n return @Promise.resolve(versionSync());\n}, versionSync = function() {\n return null;\n}, isNonGlibcLinuxSync = function() {\n return !1;\n}, isNonGlibcLinux = function() {\n return @Promise.resolve(isNonGlibcLinuxSync());\n}, $, GLIBC = \"glibc\", MUSL = \"musl\";\n$ = {\n GLIBC,\n MUSL,\n family,\n familySync,\n isNonGlibcLinux,\n isNonGlibcLinuxSync,\n version,\n versionSync\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyDetectLibcLinuxCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/detect-libc.linux.ts\nvar family = function() {\n return Promise.resolve(familySync());\n}, familySync = function() {\n return GLIBC;\n}, version = function() {\n return Promise.resolve(versionSync());\n}, versionSync = function() {\n return \"2.29\";\n}, isNonGlibcLinuxSync = function() {\n return !1;\n}, isNonGlibcLinux = function() {\n return Promise.resolve(isNonGlibcLinuxSync());\n}, $, GLIBC = \"glibc\", MUSL = \"musl\";\n$ = {\n GLIBC,\n MUSL,\n family,\n familySync,\n isNonGlibcLinux,\n isNonGlibcLinuxSync,\n version,\n versionSync\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyDetectLibcLinuxCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/detect-libc.linux.ts\nvar family = function() {\n return @Promise.resolve(familySync());\n}, familySync = function() {\n return GLIBC;\n}, version = function() {\n return @Promise.resolve(versionSync());\n}, versionSync = function() {\n return \"2.29\";\n}, isNonGlibcLinuxSync = function() {\n return !1;\n}, isNonGlibcLinux = function() {\n return @Promise.resolve(isNonGlibcLinuxSync());\n}, $, GLIBC = \"glibc\", MUSL = \"musl\";\n$ = {\n GLIBC,\n MUSL,\n family,\n familySync,\n isNonGlibcLinux,\n isNonGlibcLinuxSync,\n version,\n versionSync\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyIsomorphicFetchCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/isomorphic-fetch.ts\nvar bunFetch = Bun.fetch, fetch = (...args) => bunFetch(...args);\nfetch.default = fetch;\nfetch.fetch = fetch;\nreturn fetch})\n"_s;
+static constexpr ASCIILiteral ThirdpartyIsomorphicFetchCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/isomorphic-fetch.ts\nvar bunFetch = Bun.fetch, fetch = (...args) => bunFetch(...args);\nfetch.default = fetch;\nfetch.fetch = fetch;\nreturn fetch})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyNodeFetchCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/node-fetch.ts\nasync function fetch(url, init) {\n let body = init\?.body;\n if (body) {\n const chunks = [];\n if (body instanceof Readable) {\n for await (let chunk of body)\n chunks.push(chunk);\n init = { ...init, body: new Blob(chunks) };\n }\n }\n const response = await nativeFetch(url, init);\n return Object.setPrototypeOf(response, Response.prototype), response;\n}\nvar blobFrom = function(path, options) {\n return Promise.resolve(Bun.file(path, options));\n}, blobFromSync = function(path, options) {\n return Bun.file(path, options);\n}, isRedirect = function(code) {\n return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n}, $, { Headers, Request, Response: WebResponse, Blob, File = Blob, FormData } = globalThis, nativeFetch = Bun.fetch, { Readable } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37);\n\nclass Response extends WebResponse {\n constructor() {\n super(...arguments);\n }\n _body;\n get body() {\n return this._body \?\? (this._body = Readable.fromWeb(super.body));\n }\n}\n\nclass AbortError extends DOMException {\n constructor(message) {\n super(message, \"AbortError\");\n }\n}\n\nclass FetchBaseError extends Error {\n type;\n constructor(message, type) {\n super(message);\n this.type = type;\n }\n}\n\nclass FetchError extends FetchBaseError {\n constructor(message, type, systemError) {\n super(message, type);\n this.code = systemError\?.code;\n }\n}\nvar fileFrom = blobFrom, fileFromSync = blobFromSync;\n$ = Object.assign(fetch, {\n AbortError,\n Blob,\n FetchBaseError,\n FetchError,\n File,\n FormData,\n Headers,\n Request,\n Response,\n blobFrom,\n blobFromSync,\n fileFrom,\n fileFromSync,\n isRedirect,\n fetch,\n default: fetch\n});\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyNodeFetchCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/node-fetch.ts\nasync function fetch(url, init) {\n let body = init\?.body;\n if (body) {\n const chunks = [];\n if (body instanceof Readable) {\n for await (let chunk of body)\n chunks.push(chunk);\n init = { ...init, body: new Blob(chunks) };\n }\n }\n const response = await nativeFetch(url, init);\n return Object.setPrototypeOf(response, Response.prototype), response;\n}\nvar blobFrom = function(path, options) {\n return @Promise.resolve(Bun.file(path, options));\n}, blobFromSync = function(path, options) {\n return Bun.file(path, options);\n}, isRedirect = function(code) {\n return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n}, $, { Headers, Request, Response: WebResponse, Blob, File = Blob, FormData } = globalThis, nativeFetch = Bun.fetch, { Readable } = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39);\n\nclass Response extends WebResponse {\n constructor() {\n super(...arguments);\n }\n _body;\n get body() {\n return this._body \?\? (this._body = Readable.fromWeb(super.body));\n }\n}\n\nclass AbortError extends DOMException {\n constructor(message) {\n super(message, \"AbortError\");\n }\n}\n\nclass FetchBaseError extends Error {\n type;\n constructor(message, type) {\n super(message);\n this.type = type;\n }\n}\n\nclass FetchError extends FetchBaseError {\n constructor(message, type, systemError) {\n super(message, type);\n this.code = systemError\?.code;\n }\n}\nvar fileFrom = blobFrom, fileFromSync = blobFromSync;\n$ = Object.assign(fetch, {\n AbortError,\n Blob,\n FetchBaseError,\n FetchError,\n File,\n FormData,\n Headers,\n Request,\n Response,\n blobFrom,\n blobFromSync,\n fileFrom,\n fileFromSync,\n isRedirect,\n fetch,\n default: fetch\n});\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyUndiciCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/undici.ts\nvar notImplemented = function() {\n throw new Error(\"Not implemented in bun\");\n};\nasync function request(url, options = {\n method: \"GET\",\n signal: null,\n headers: null,\n query: null,\n reset: !1,\n throwOnError: !1,\n body: null\n}) {\n let {\n method = \"GET\",\n headers: inputHeaders,\n query,\n signal,\n reset = !1,\n throwOnError = !1,\n body: inputBody,\n maxRedirections\n } = options;\n if (typeof url === \"string\") {\n if (query)\n url = new URL(url);\n } else if (typeof url === \"object\" && url !== null) {\n if (!(url instanceof URL))\n throw new Error(\"not implemented\");\n } else\n @throwTypeError(\"url must be a string, URL, or UrlObject\");\n if (typeof url === \"string\" && query)\n url = new URL(url);\n if (typeof url === \"object\" && url !== null && query) {\n if (query)\n url.search = new URLSearchParams(query).toString();\n }\n if (method = method && typeof method === \"string\" \? method.toUpperCase() : null, inputBody && (method === \"GET\" || method === \"HEAD\"))\n throw new Error(\"Body not allowed for GET or HEAD requests\");\n if (inputBody && inputBody.read && inputBody instanceof Readable) {\n let data = \"\";\n inputBody.setEncoding(\"utf8\");\n for await (let chunk of stream)\n data += chunk;\n inputBody = (new TextEncoder()).encode(data);\n }\n if (maxRedirections !== void 0 && Number.isNaN(maxRedirections))\n throw new Error(\"maxRedirections must be a number if defined\");\n if (signal && !(signal instanceof AbortSignal))\n throw new Error(\"signal must be an instance of AbortSignal\");\n let resp;\n const {\n status: statusCode,\n headers,\n trailers\n } = resp = await fetch(url, {\n signal,\n mode: \"cors\",\n method,\n headers: inputHeaders || kEmptyObject,\n body: inputBody,\n redirect: maxRedirections === \"undefined\" || maxRedirections > 0 \? \"follow\" : \"manual\",\n keepalive: !reset\n });\n if (throwOnError && statusCode >= 400 && statusCode < 600)\n throw new Error(`Request failed with status code ${statusCode}`);\n const body = resp.body \? new BodyReadable(resp) : null;\n return { statusCode, headers: headers.toJSON(), body, trailers, opaque: kEmptyObject, context: kEmptyObject };\n}\nvar stream = function() {\n throw new Error(\"Not implemented in bun\");\n}, pipeline = function() {\n throw new Error(\"Not implemented in bun\");\n}, connect = function() {\n throw new Error(\"Not implemented in bun\");\n}, upgrade = function() {\n throw new Error(\"Not implemented in bun\");\n}, mockErrors = function() {\n throw new Error(\"Not implemented in bun\");\n}, Undici = function() {\n throw new Error(\"Not implemented in bun\");\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), StreamModule = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), { Readable } = StreamModule, { _ReadableFromWebForUndici: ReadableFromWeb } = StreamModule[Symbol.for(\"::bunternal::\")], ObjectCreate = Object.create, kEmptyObject = ObjectCreate(null), fetch = Bun.fetch, Response = globalThis.Response, Headers = globalThis.Headers, Request = globalThis.Request, URLSearchParams = globalThis.URLSearchParams, URL = globalThis.URL;\n\nclass File extends Blob {\n constructor() {\n super(...arguments);\n }\n}\n\nclass FileReader extends EventTarget {\n constructor() {\n throw new Error(\"Not implemented yet!\");\n }\n}\nvar FormData = globalThis.FormData;\n\nclass BodyReadable extends ReadableFromWeb {\n #response;\n #bodyUsed;\n constructor(response, options = {}) {\n var { body } = response;\n if (!body)\n throw new Error(\"Response body is null\");\n super(options, body);\n this.#response = response, this.#bodyUsed = response.bodyUsed;\n }\n get bodyUsed() {\n return this.#bodyUsed;\n }\n #consume() {\n if (this.#bodyUsed)\n @throwTypeError(\"unusable\");\n this.#bodyUsed = !0;\n }\n async arrayBuffer() {\n return this.#consume(), await this.#response.arrayBuffer();\n }\n async blob() {\n return this.#consume(), await this.#response.blob();\n }\n async formData() {\n return this.#consume(), await this.#response.formData();\n }\n async json() {\n return this.#consume(), await this.#response.json();\n }\n async text() {\n return this.#consume(), await this.#response.text();\n }\n}\n\nclass MockClient {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass MockPool {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass MockAgent {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass Dispatcher extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Agent extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Pool extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n request() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass BalancedPool extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Client extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n request() {\n throw new Error(\"Not implemented in bun\");\n }\n}\nUndici.Dispatcher = Dispatcher;\nUndici.Pool = Pool;\nUndici.BalancedPool = BalancedPool;\nUndici.Client = Client;\nUndici.Agent = Agent;\nUndici.buildConnector = Undici.errors = Undici.setGlobalDispatcher = Undici.getGlobalDispatcher = Undici.request = Undici.stream = Undici.pipeline = Undici.connect = Undici.upgrade = Undici.MockClient = Undici.MockPool = Undici.MockAgent = Undici.mockErrors = notImplemented;\nUndici.fetch = fetch;\n$ = {\n fetch,\n Response,\n Headers,\n Request,\n URLSearchParams,\n URL,\n File,\n FileReader,\n FormData,\n request,\n stream,\n pipeline,\n connect,\n upgrade,\n MockClient,\n MockPool,\n MockAgent,\n mockErrors,\n Dispatcher,\n Pool,\n BalancedPool,\n Client,\n Agent,\n Undici\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyUndiciCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/undici.ts\nvar notImplemented = function() {\n throw new Error(\"Not implemented in bun\");\n};\nasync function request(url, options = {\n method: \"GET\",\n signal: null,\n headers: null,\n query: null,\n reset: !1,\n throwOnError: !1,\n body: null\n}) {\n let {\n method = \"GET\",\n headers: inputHeaders,\n query,\n signal,\n reset = !1,\n throwOnError = !1,\n body: inputBody,\n maxRedirections\n } = options;\n if (typeof url === \"string\") {\n if (query)\n url = new URL(url);\n } else if (typeof url === \"object\" && url !== null) {\n if (!(url instanceof URL))\n throw new Error(\"not implemented\");\n } else\n @throwTypeError(\"url must be a string, URL, or UrlObject\");\n if (typeof url === \"string\" && query)\n url = new URL(url);\n if (typeof url === \"object\" && url !== null && query) {\n if (query)\n url.search = new URLSearchParams(query).toString();\n }\n if (method = method && typeof method === \"string\" \? method.toUpperCase() : null, inputBody && (method === \"GET\" || method === \"HEAD\"))\n throw new Error(\"Body not allowed for GET or HEAD requests\");\n if (inputBody && inputBody.read && inputBody instanceof Readable) {\n let data = \"\";\n inputBody.setEncoding(\"utf8\");\n for await (let chunk of stream)\n data += chunk;\n inputBody = (new TextEncoder()).encode(data);\n }\n if (maxRedirections !== @undefined && Number.isNaN(maxRedirections))\n throw new Error(\"maxRedirections must be a number if defined\");\n if (signal && !(signal instanceof @AbortSignal))\n throw new Error(\"signal must be an instance of AbortSignal\");\n let resp;\n const {\n status: statusCode,\n headers,\n trailers\n } = resp = await fetch(url, {\n signal,\n mode: \"cors\",\n method,\n headers: inputHeaders || kEmptyObject,\n body: inputBody,\n redirect: maxRedirections === \"undefined\" || maxRedirections > 0 \? \"follow\" : \"manual\",\n keepalive: !reset\n });\n if (throwOnError && statusCode >= 400 && statusCode < 600)\n throw new Error(`Request failed with status code ${statusCode}`);\n const body = resp.body \? new BodyReadable(resp) : null;\n return { statusCode, headers: headers.toJSON(), body, trailers, opaque: kEmptyObject, context: kEmptyObject };\n}\nvar stream = function() {\n throw new Error(\"Not implemented in bun\");\n}, pipeline = function() {\n throw new Error(\"Not implemented in bun\");\n}, connect = function() {\n throw new Error(\"Not implemented in bun\");\n}, upgrade = function() {\n throw new Error(\"Not implemented in bun\");\n}, mockErrors = function() {\n throw new Error(\"Not implemented in bun\");\n}, Undici = function() {\n throw new Error(\"Not implemented in bun\");\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), StreamModule = @getInternalField(@internalModuleRegistry, 39) || @createInternalModuleById(39), { Readable } = StreamModule, { _ReadableFromWebForUndici: ReadableFromWeb } = StreamModule[Symbol.for(\"::bunternal::\")], ObjectCreate = Object.create, kEmptyObject = ObjectCreate(null), fetch = Bun.fetch, Response = globalThis.Response, Headers = globalThis.Headers, Request = globalThis.Request, URLSearchParams = globalThis.URLSearchParams, URL = globalThis.URL;\n\nclass File extends Blob {\n constructor() {\n super(...arguments);\n }\n}\n\nclass FileReader extends EventTarget {\n constructor() {\n throw new Error(\"Not implemented yet!\");\n }\n}\nvar FormData = globalThis.FormData;\n\nclass BodyReadable extends ReadableFromWeb {\n #response;\n #bodyUsed;\n constructor(response, options = {}) {\n var { body } = response;\n if (!body)\n throw new Error(\"Response body is null\");\n super(options, body);\n this.#response = response, this.#bodyUsed = response.bodyUsed;\n }\n get bodyUsed() {\n return this.#bodyUsed;\n }\n #consume() {\n if (this.#bodyUsed)\n @throwTypeError(\"unusable\");\n this.#bodyUsed = !0;\n }\n async arrayBuffer() {\n return this.#consume(), await this.#response.arrayBuffer();\n }\n async blob() {\n return this.#consume(), await this.#response.blob();\n }\n async formData() {\n return this.#consume(), await this.#response.formData();\n }\n async json() {\n return this.#consume(), await this.#response.json();\n }\n async text() {\n return this.#consume(), await this.#response.text();\n }\n}\n\nclass MockClient {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass MockPool {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass MockAgent {\n constructor() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass Dispatcher extends EventEmitter {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Agent extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Pool extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n request() {\n throw new Error(\"Not implemented in bun\");\n }\n}\n\nclass BalancedPool extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n}\n\nclass Client extends Dispatcher {\n constructor() {\n super(...arguments);\n }\n request() {\n throw new Error(\"Not implemented in bun\");\n }\n}\nUndici.Dispatcher = Dispatcher;\nUndici.Pool = Pool;\nUndici.BalancedPool = BalancedPool;\nUndici.Client = Client;\nUndici.Agent = Agent;\nUndici.buildConnector = Undici.errors = Undici.setGlobalDispatcher = Undici.getGlobalDispatcher = Undici.request = Undici.stream = Undici.pipeline = Undici.connect = Undici.upgrade = Undici.MockClient = Undici.MockPool = Undici.MockAgent = Undici.mockErrors = notImplemented;\nUndici.fetch = fetch;\n$ = {\n fetch,\n Response,\n Headers,\n Request,\n URLSearchParams,\n URL,\n File,\n FileReader,\n FormData,\n request,\n stream,\n pipeline,\n connect,\n upgrade,\n MockClient,\n MockPool,\n MockAgent,\n mockErrors,\n Dispatcher,\n Pool,\n BalancedPool,\n Client,\n Agent,\n Undici\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyVercelFetchCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/vercel_fetch.ts\nvar $;\n$ = (wrapper = Bun.fetch) => {\n async function vercelFetch(url, opts = {}) {\n if (opts.body && typeof opts.body === \"object\" && (!(\"buffer\" in opts.body) || typeof opts.body.buffer !== \"object\" || !(opts.body.buffer instanceof ArrayBuffer))) {\n if (opts.body = JSON.stringify(opts.body), !opts.headers)\n opts.headers = new Headers;\n opts.headers.set(\"Content-Type\", \"application/json\");\n }\n try {\n return await wrapper(url, opts);\n } catch (err) {\n if (typeof err === \"string\")\n err = new Error(err);\n throw err.url = url, err.opts = opts, err;\n }\n }\n return vercelFetch.default = vercelFetch, vercelFetch;\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyVercelFetchCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/vercel_fetch.ts\nvar $;\n$ = (wrapper = Bun.fetch) => {\n async function vercelFetch(url, opts = {}) {\n if (opts.body && typeof opts.body === \"object\" && (!(\"buffer\" in opts.body) || typeof opts.body.buffer !== \"object\" || !(opts.body.buffer instanceof @ArrayBuffer))) {\n if (opts.body = JSON.stringify(opts.body), !opts.headers)\n opts.headers = new Headers;\n opts.headers.set(\"Content-Type\", \"application/json\");\n }\n try {\n return await wrapper(url, opts);\n } catch (err) {\n if (typeof err === \"string\")\n err = new Error(err);\n throw err.url = url, err.opts = opts, err;\n }\n }\n return vercelFetch.default = vercelFetch, vercelFetch;\n};\nreturn $})\n");
//
//
-static constexpr ASCIILiteral ThirdpartyWSCode = "(function (){\"use strict\";// src/js/out/tmp/thirdparty/ws.ts\nvar emitWarning = function(type, message) {\n if (emittedWarnings.has(type))\n return;\n emittedWarnings.add(type), console.warn(\"[bun] Warning:\", message);\n}, subprotocolParse = function(header) {\n const protocols = new Set;\n let start = -1, end = -1, i = 0;\n for (i;i < header.length; i++) {\n const code = header.charCodeAt(i);\n if (end === -1 && wsTokenChars[code] === 1) {\n if (start === -1)\n start = i;\n } else if (i !== 0 && (code === 32 || code === 9)) {\n if (end === -1 && start !== -1)\n end = i;\n } else if (code === 44) {\n if (start === -1)\n throw new SyntaxError(`Unexpected character at index ${i}`);\n if (end === -1)\n end = i;\n const protocol2 = header.slice(start, end);\n if (protocols.has(protocol2))\n throw new SyntaxError(`The \"${protocol2}\" subprotocol is duplicated`);\n protocols.add(protocol2), start = end = -1;\n } else\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n if (start === -1 || end !== -1)\n throw new SyntaxError(\"Unexpected end of input\");\n const protocol = header.slice(start, i);\n if (protocols.has(protocol))\n throw new SyntaxError(`The \"${protocol}\" subprotocol is duplicated`);\n return protocols.add(protocol), protocols;\n}, wsEmitClose = function(server) {\n server._state = CLOSED, server.emit(\"close\");\n}, abortHandshake = function(response, code, message, headers) {\n message = message || http.STATUS_CODES[code], headers = {\n Connection: \"close\",\n \"Content-Type\": \"text/html\",\n \"Content-Length\": Buffer.byteLength(message),\n ...headers\n }, response.writeHead(code, headers), response.write(message), response.end();\n}, abortHandshakeOrEmitwsClientError = function(server, req, response, socket, code, message) {\n if (server.listenerCount(\"wsClientError\")) {\n const err = new Error(message);\n Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError), server.emit(\"wsClientError\", err, socket, req);\n } else\n abortHandshake(response, code, message);\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), http = @getInternalField(@internalModuleRegistry, 21) || @createInternalModuleById(21), kBunInternals = Symbol.for(\"::bunternal::\"), readyStates = [\"CONNECTING\", \"OPEN\", \"CLOSING\", \"CLOSED\"], encoder = new TextEncoder, eventIds = {\n open: 1,\n close: 2,\n message: 3,\n error: 4,\n ping: 5,\n pong: 6\n}, emittedWarnings = new Set;\n\nclass BunWebSocket extends EventEmitter {\n static CONNECTING = 0;\n static OPEN = 1;\n static CLOSING = 2;\n static CLOSED = 3;\n #ws;\n #paused = !1;\n #fragments = !1;\n #binaryType = \"nodebuffer\";\n #eventId = 0;\n constructor(url, protocols, options) {\n super();\n let ws = this.#ws = new WebSocket(url, protocols);\n ws.binaryType = \"nodebuffer\";\n }\n on(event, listener) {\n if (event === \"unexpected-response\" || event === \"upgrade\" || event === \"redirect\")\n emitWarning(event, \"ws.WebSocket '\" + event + \"' event is not implemented in bun\");\n const mask = 1 << eventIds[event];\n if (mask && (this.#eventId & mask) !== mask) {\n if (this.#eventId |= mask, event === \"open\")\n this.#ws.addEventListener(\"open\", () => {\n this.emit(\"open\");\n });\n else if (event === \"close\")\n this.#ws.addEventListener(\"close\", ({ code, reason, wasClean }) => {\n this.emit(\"close\", code, reason, wasClean);\n });\n else if (event === \"message\")\n this.#ws.addEventListener(\"message\", ({ data }) => {\n const isBinary = typeof data !== \"string\";\n if (isBinary)\n this.emit(\"message\", this.#fragments \? [data] : data, isBinary);\n else {\n let encoded = encoder.encode(data);\n if (this.#binaryType !== \"arraybuffer\")\n encoded = Buffer.from(encoded.buffer, encoded.byteOffset, encoded.byteLength);\n this.emit(\"message\", this.#fragments \? [encoded] : encoded, isBinary);\n }\n });\n else if (event === \"error\")\n this.#ws.addEventListener(\"error\", (err) => {\n this.emit(\"error\", err);\n });\n else if (event === \"ping\")\n this.#ws.addEventListener(\"ping\", ({ data }) => {\n this.emit(\"ping\", data);\n });\n else if (event === \"pong\")\n this.#ws.addEventListener(\"pong\", ({ data }) => {\n this.emit(\"pong\", data);\n });\n }\n return super.on(event, listener);\n }\n send(data, opts, cb) {\n try {\n this.#ws.send(data, opts\?.compress);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n close(code, reason) {\n this.#ws.close(code, reason);\n }\n terminate() {\n this.#ws.terminate();\n }\n get url() {\n return this.#ws.url;\n }\n get readyState() {\n return this.#ws.readyState;\n }\n get binaryType() {\n return this.#binaryType;\n }\n set binaryType(value) {\n if (value === \"nodebuffer\" || value === \"arraybuffer\")\n this.#ws.binaryType = this.#binaryType = value, this.#fragments = !1;\n else if (value === \"fragments\")\n this.#ws.binaryType = \"nodebuffer\", this.#binaryType = \"fragments\", this.#fragments = !0;\n else\n throw new Error(`Invalid binaryType: ${value}`);\n }\n get protocol() {\n return this.#ws.protocol;\n }\n get extensions() {\n return this.#ws.extensions;\n }\n addEventListener(type, listener, options) {\n this.#ws.addEventListener(type, listener, options);\n }\n removeEventListener(type, listener) {\n this.#ws.removeEventListener(type, listener);\n }\n get onopen() {\n return this.#ws.onopen;\n }\n set onopen(value) {\n this.#ws.onopen = value;\n }\n get onerror() {\n return this.#ws.onerror;\n }\n set onerror(value) {\n this.#ws.onerror = value;\n }\n get onclose() {\n return this.#ws.onclose;\n }\n set onclose(value) {\n this.#ws.onclose = value;\n }\n get onmessage() {\n return this.#ws.onmessage;\n }\n set onmessage(value) {\n this.#ws.onmessage = value;\n }\n get bufferedAmount() {\n return this.#ws.bufferedAmount;\n }\n get isPaused() {\n return this.#paused;\n }\n ping(data, mask, cb) {\n if (typeof data === \"function\")\n cb = data, data = mask = void 0;\n else if (typeof mask === \"function\")\n cb = mask, mask = void 0;\n if (typeof data === \"number\")\n data = data.toString();\n try {\n this.#ws.ping(data);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n pong(data, mask, cb) {\n if (typeof data === \"function\")\n cb = data, data = mask = void 0;\n else if (typeof mask === \"function\")\n cb = mask, mask = void 0;\n if (typeof data === \"number\")\n data = data.toString();\n try {\n this.#ws.pong(data);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n pause() {\n switch (this.readyState) {\n case WebSocket.CONNECTING:\n case WebSocket.CLOSED:\n return;\n }\n this.#paused = !0, emitWarning(\"pause()\", \"ws.WebSocket.pause() is not implemented in bun\");\n }\n resume() {\n switch (this.readyState) {\n case WebSocket.CONNECTING:\n case WebSocket.CLOSED:\n return;\n }\n this.#paused = !1, emitWarning(\"resume()\", \"ws.WebSocket.resume() is not implemented in bun\");\n }\n}\nObject.defineProperty(BunWebSocket, \"name\", { value: \"WebSocket\" });\nvar wsKeyRegex = /^[+/0-9A-Za-z]{22}==$/, wsTokenChars = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 1,\n 0,\n 1,\n 0\n], RUNNING = 0, CLOSING = 1, CLOSED = 2;\n\nclass BunWebSocketMocked extends EventEmitter {\n #ws;\n #state;\n #enquedMessages = [];\n #url;\n #protocol;\n #extensions;\n #bufferedAmount = 0;\n #binaryType = \"arraybuffer\";\n #onclose;\n #onerror;\n #onmessage;\n #onopen;\n constructor(url, protocol, extensions, binaryType) {\n super();\n if (this.#ws = null, this.#state = 0, this.#url = url, this.#bufferedAmount = 0, binaryType = binaryType || \"arraybuffer\", binaryType !== \"nodebuffer\" && binaryType !== \"blob\" && binaryType !== \"arraybuffer\")\n @throwTypeError(\"binaryType must be either 'blob', 'arraybuffer' or 'nodebuffer'\");\n this.#binaryType = binaryType, this.#protocol = protocol, this.#extensions = extensions;\n const message = this.#message.bind(this), open = this.#open.bind(this), close = this.#close.bind(this), drain = this.#drain.bind(this);\n this[kBunInternals] = {\n message,\n open,\n close,\n drain\n };\n }\n #message(ws, message) {\n if (this.#ws = ws, typeof message === \"string\")\n if (this.#binaryType === \"arraybuffer\")\n message = encoder.encode(message).buffer;\n else if (this.#binaryType === \"blob\")\n message = new Blob([message], { type: \"text/plain\" });\n else\n message = Buffer.from(message);\n else if (this.#binaryType !== \"nodebuffer\") {\n if (this.#binaryType === \"arraybuffer\")\n message = new Uint8Array(message);\n else if (this.#binaryType === \"blob\")\n message = new Blob([message]);\n }\n this.emit(\"message\", message);\n }\n #open(ws) {\n this.#ws = ws, this.#state = 1, this.emit(\"open\", this), this.#drain(ws);\n }\n #close(ws, code, reason) {\n this.#state = 3, this.#ws = null, this.emit(\"close\", code, reason);\n }\n #drain(ws) {\n const chunk = this.#enquedMessages[0];\n if (chunk) {\n const [data, compress, cb] = chunk;\n if (ws.send(data, compress) == -1)\n return;\n typeof cb === \"function\" && cb(), this.#bufferedAmount -= chunk.length, this.#enquedMessages.shift();\n }\n }\n send(data, opts, cb) {\n if (this.#state === 1) {\n const compress = opts\?.compress;\n if (this.#ws.send(data, compress) == -1) {\n this.#enquedMessages.push([data, compress, cb]), this.#bufferedAmount += data.length;\n return;\n }\n typeof cb === \"function\" && cb();\n } else if (this.#state === 0)\n this.#enquedMessages.push([data, opts\?.compress, cb]), this.#bufferedAmount += data.length;\n }\n close(code, reason) {\n if (this.#state === 1)\n this.#state = 2, this.#ws.close(code, reason);\n }\n get binaryType() {\n return this.#binaryType;\n }\n set binaryType(type) {\n if (type !== \"nodebuffer\" && type !== \"blob\" && type !== \"arraybuffer\")\n @throwTypeError(\"binaryType must be either 'blob', 'arraybuffer' or 'nodebuffer'\");\n this.#binaryType = type;\n }\n get readyState() {\n return this.#state;\n }\n get url() {\n return this.#url;\n }\n get protocol() {\n return this.#protocol;\n }\n get extensions() {\n return this.#extensions;\n }\n get bufferedAmount() {\n return this.#bufferedAmount \?\? 0;\n }\n setSocket(socket, head, options) {\n throw new Error(\"Not implemented\");\n }\n set onclose(cb) {\n if (this.#onclose)\n this.removeListener(\"close\", this.#onclose);\n this.on(\"close\", cb), this.#onclose = cb;\n }\n set onerror(cb) {\n if (this.#onerror)\n this.removeListener(\"error\", this.#onerror);\n this.on(\"error\", cb), this.#onerror = cb;\n }\n set onmessage(cb) {\n if (this.#onmessage)\n this.removeListener(\"message\", this.#onmessage);\n this.on(\"message\", cb), this.#onmessage = cb;\n }\n set onopen(cb) {\n if (this.#onopen)\n this.removeListener(\"open\", this.#onopen);\n this.on(\"open\", cb), this.#onopen = cb;\n }\n get onclose() {\n return this.#onclose;\n }\n get onerror() {\n return this.#onerror;\n }\n get onmessage() {\n return this.#onmessage;\n }\n get onopen() {\n return this.#onopen;\n }\n addEventListener(type, listener, options) {\n if (type === \"message\") {\n const l = (data) => listener({ data });\n l.listener = listener, this.on(type, l);\n return;\n }\n this.on(type, listener);\n }\n removeEventListener(type, listener) {\n this.off(type, listener);\n }\n}\n\nclass WebSocketServer extends EventEmitter {\n _server;\n options;\n clients;\n _shouldEmitClose;\n _state;\n _removeListeners;\n constructor(options, callback) {\n super();\n if (options = {\n maxPayload: 104857600,\n skipUTF8Validation: !1,\n perMessageDeflate: !1,\n handleProtocols: null,\n clientTracking: !0,\n verifyClient: null,\n noServer: !1,\n backlog: null,\n server: null,\n host: null,\n path: null,\n port: null,\n ...options\n }, options.port == null && !options.server && !options.noServer || options.port != null && (options.server || options.noServer) || options.server && options.noServer)\n @throwTypeError('One and only one of the \"port\", \"server\", or \"noServer\" options must be specified');\n if (options.port != null)\n this._server = http.createServer((req, res) => {\n const body = http.STATUS_CODES[426];\n res.writeHead(426, {\n \"Content-Length\": body.length,\n \"Content-Type\": \"text/plain\"\n }), res.end(body);\n }), this._server.listen(options.port, options.host, options.backlog, callback);\n else if (options.server)\n this._server = options.server;\n if (this._server) {\n const emitConnection = this.emit.bind(this, \"connection\"), emitListening = this.emit.bind(this, \"listening\"), emitError = this.emit.bind(this, \"error\"), doUpgrade = (req, socket, head) => {\n this.handleUpgrade(req, socket, head, emitConnection);\n };\n this._server.on(\"listening\", emitListening), this._server.on(\"error\", emitError), this._server.on(\"upgrade\", doUpgrade), this._removeListeners = () => {\n this._server.removeListener(\"upgrade\", doUpgrade), this._server.removeListener(\"listening\", emitListening), this._server.removeListener(\"error\", emitError);\n };\n }\n if (options.perMessageDeflate === !0)\n options.perMessageDeflate = {};\n if (options.clientTracking)\n this.clients = new Set, this._shouldEmitClose = !1;\n this.options = options, this._state = RUNNING;\n }\n address() {\n if (this.options.noServer)\n throw new Error('The server is operating in \"noServer\" mode');\n if (!this._server)\n return null;\n return this._server.address();\n }\n close(cb) {\n if (this._state === CLOSED) {\n if (cb)\n this.once(\"close\", () => {\n cb(new Error(\"The server is not running\"));\n });\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n return;\n }\n if (cb)\n this.once(\"close\", cb);\n if (this._state === CLOSING)\n return;\n if (this._state = CLOSING, this.options.noServer || this.options.server) {\n if (this._server)\n this._removeListeners(), this._removeListeners = this._server = null;\n if (this.clients)\n if (!this.clients.size)\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n else\n this._shouldEmitClose = !0;\n else\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n } else {\n const server = this._server;\n this._removeListeners(), this._removeListeners = this._server = null, server.close(() => {\n this._state = CLOSED, this.emit(\"close\");\n });\n }\n }\n shouldHandle(req) {\n if (this.options.path) {\n const index = req.url.indexOf(\"\?\");\n if ((index !== -1 \? req.url.slice(0, index) : req.url) !== this.options.path)\n return !1;\n }\n return !0;\n }\n completeUpgrade(extensions, key, protocols, request, socket, head, cb) {\n const [server, response, req] = socket[kBunInternals];\n if (this._state > RUNNING)\n return abortHandshake(response, 503);\n let protocol = \"\";\n if (protocols.size)\n protocol = this.options.handleProtocols \? this.options.handleProtocols(protocols, request) : protocols.values().next().value;\n const ws = new BunWebSocketMocked(request.url, protocol, extensions, \"nodebuffer\"), headers = [\"HTTP/1.1 101 Switching Protocols\", \"Upgrade: websocket\", \"Connection: Upgrade\"];\n if (this.emit(\"headers\", headers, request), server.upgrade(req, {\n data: ws[kBunInternals]\n })) {\n if (response._reply(void 0), this.clients)\n this.clients.add(ws), ws.on(\"close\", () => {\n if (this.clients.delete(ws), this._shouldEmitClose && !this.clients.size)\n process.nextTick(wsEmitClose, this);\n });\n cb(ws, request);\n } else\n abortHandshake(response, 500);\n }\n handleUpgrade(req, socket, head, cb) {\n const [_, response] = socket[kBunInternals], key = req.headers[\"sec-websocket-key\"], version = +req.headers[\"sec-websocket-version\"];\n if (req.method !== \"GET\") {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 405, \"Invalid HTTP method\");\n return;\n }\n if (req.headers.upgrade.toLowerCase() !== \"websocket\") {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Invalid Upgrade header\");\n return;\n }\n if (!key || !wsKeyRegex.test(key)) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Missing or invalid Sec-WebSocket-Key header\");\n return;\n }\n if (version !== 8 && version !== 13) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Missing or invalid Sec-WebSocket-Version header\");\n return;\n }\n if (!this.shouldHandle(req)) {\n abortHandshake(response, 400);\n return;\n }\n const secWebSocketProtocol = req.headers[\"sec-websocket-protocol\"];\n let protocols = new Set;\n if (secWebSocketProtocol !== void 0)\n try {\n protocols = subprotocolParse(secWebSocketProtocol);\n } catch (err) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Invalid Sec-WebSocket-Protocol header\");\n return;\n }\n const extensions = {};\n if (this.options.verifyClient) {\n const info = {\n origin: req.headers[`${version === 8 \? \"sec-websocket-origin\" : \"origin\"}`],\n secure: !!(req.socket.authorized || req.socket.encrypted),\n req\n };\n if (this.options.verifyClient.length === 2) {\n this.options.verifyClient(info, (verified, code, message, headers) => {\n if (!verified)\n return abortHandshake(response, code || 401, message, headers);\n this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);\n });\n return;\n }\n if (!this.options.verifyClient(info))\n return abortHandshake(response, 401);\n }\n this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);\n }\n}\nObject.defineProperty(BunWebSocket, \"CONNECTING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CONNECTING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(BunWebSocket, \"OPEN\", {\n enumerable: !0,\n value: readyStates.indexOf(\"OPEN\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"OPEN\", {\n enumerable: !0,\n value: readyStates.indexOf(\"OPEN\")\n});\nObject.defineProperty(BunWebSocket, \"CLOSING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSING\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CLOSING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSING\")\n});\nObject.defineProperty(BunWebSocket, \"CLOSED\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSED\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CLOSED\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSED\")\n});\n\nclass Sender {\n constructor() {\n throw new Error(\"Not supported yet in Bun\");\n }\n}\n\nclass Receiver {\n constructor() {\n throw new Error(\"Not supported yet in Bun\");\n }\n}\nvar createWebSocketStream = (ws) => {\n throw new Error(\"Not supported yet in Bun\");\n};\n$ = Object.assign(BunWebSocket, {\n createWebSocketStream,\n Receiver,\n Sender,\n WebSocket: BunWebSocket,\n Server: WebSocketServer,\n WebSocketServer\n});\nreturn $})\n"_s;
+static constexpr ASCIILiteral ThirdpartyWSCode = ASCIILiteral::fromLiteralUnsafe("(function (){\"use strict\";// src/js/out/tmp/thirdparty/ws.ts\nvar emitWarning = function(type, message) {\n if (emittedWarnings.has(type))\n return;\n emittedWarnings.add(type), console.warn(\"[bun] Warning:\", message);\n}, subprotocolParse = function(header) {\n const protocols = new Set;\n let start = -1, end = -1, i = 0;\n for (i;i < header.length; i++) {\n const code = header.charCodeAt(i);\n if (end === -1 && wsTokenChars[code] === 1) {\n if (start === -1)\n start = i;\n } else if (i !== 0 && (code === 32 || code === 9)) {\n if (end === -1 && start !== -1)\n end = i;\n } else if (code === 44) {\n if (start === -1)\n throw new SyntaxError(`Unexpected character at index ${i}`);\n if (end === -1)\n end = i;\n const protocol2 = header.slice(start, end);\n if (protocols.has(protocol2))\n throw new SyntaxError(`The \"${protocol2}\" subprotocol is duplicated`);\n protocols.add(protocol2), start = end = -1;\n } else\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n if (start === -1 || end !== -1)\n throw new SyntaxError(\"Unexpected end of input\");\n const protocol = header.slice(start, i);\n if (protocols.has(protocol))\n throw new SyntaxError(`The \"${protocol}\" subprotocol is duplicated`);\n return protocols.add(protocol), protocols;\n}, wsEmitClose = function(server) {\n server._state = CLOSED, server.emit(\"close\");\n}, abortHandshake = function(response, code, message, headers) {\n message = message || http.STATUS_CODES[code], headers = {\n Connection: \"close\",\n \"Content-Type\": \"text/html\",\n \"Content-Length\": @Buffer.byteLength(message),\n ...headers\n }, response.writeHead(code, headers), response.write(message), response.end();\n}, abortHandshakeOrEmitwsClientError = function(server, req, response, socket, code, message) {\n if (server.listenerCount(\"wsClientError\")) {\n const err = new Error(message);\n Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError), server.emit(\"wsClientError\", err, socket, req);\n } else\n abortHandshake(response, code, message);\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 20) || @createInternalModuleById(20), http = @getInternalField(@internalModuleRegistry, 23) || @createInternalModuleById(23), kBunInternals = Symbol.for(\"::bunternal::\"), readyStates = [\"CONNECTING\", \"OPEN\", \"CLOSING\", \"CLOSED\"], encoder = new TextEncoder, eventIds = {\n open: 1,\n close: 2,\n message: 3,\n error: 4,\n ping: 5,\n pong: 6\n}, emittedWarnings = new Set;\n\nclass BunWebSocket extends EventEmitter {\n static CONNECTING = 0;\n static OPEN = 1;\n static CLOSING = 2;\n static CLOSED = 3;\n #ws;\n #paused = !1;\n #fragments = !1;\n #binaryType = \"nodebuffer\";\n #eventId = 0;\n constructor(url, protocols, options) {\n super();\n let ws = this.#ws = new WebSocket(url, protocols);\n ws.binaryType = \"nodebuffer\";\n }\n on(event, listener) {\n if (event === \"unexpected-response\" || event === \"upgrade\" || event === \"redirect\")\n emitWarning(event, \"ws.WebSocket '\" + event + \"' event is not implemented in bun\");\n const mask = 1 << eventIds[event];\n if (mask && (this.#eventId & mask) !== mask) {\n if (this.#eventId |= mask, event === \"open\")\n this.#ws.addEventListener(\"open\", () => {\n this.emit(\"open\");\n });\n else if (event === \"close\")\n this.#ws.addEventListener(\"close\", ({ code, reason, wasClean }) => {\n this.emit(\"close\", code, reason, wasClean);\n });\n else if (event === \"message\")\n this.#ws.addEventListener(\"message\", ({ data }) => {\n const isBinary = typeof data !== \"string\";\n if (isBinary)\n this.emit(\"message\", this.#fragments \? [data] : data, isBinary);\n else {\n let encoded = encoder.encode(data);\n if (this.#binaryType !== \"arraybuffer\")\n encoded = @Buffer.from(encoded.buffer, encoded.byteOffset, encoded.byteLength);\n this.emit(\"message\", this.#fragments \? [encoded] : encoded, isBinary);\n }\n });\n else if (event === \"error\")\n this.#ws.addEventListener(\"error\", (err) => {\n this.emit(\"error\", err);\n });\n else if (event === \"ping\")\n this.#ws.addEventListener(\"ping\", ({ data }) => {\n this.emit(\"ping\", data);\n });\n else if (event === \"pong\")\n this.#ws.addEventListener(\"pong\", ({ data }) => {\n this.emit(\"pong\", data);\n });\n }\n return super.on(event, listener);\n }\n send(data, opts, cb) {\n try {\n this.#ws.send(data, opts\?.compress);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n close(code, reason) {\n this.#ws.close(code, reason);\n }\n terminate() {\n this.#ws.terminate();\n }\n get url() {\n return this.#ws.url;\n }\n get readyState() {\n return this.#ws.readyState;\n }\n get binaryType() {\n return this.#binaryType;\n }\n set binaryType(value) {\n if (value === \"nodebuffer\" || value === \"arraybuffer\")\n this.#ws.binaryType = this.#binaryType = value, this.#fragments = !1;\n else if (value === \"fragments\")\n this.#ws.binaryType = \"nodebuffer\", this.#binaryType = \"fragments\", this.#fragments = !0;\n else\n throw new Error(`Invalid binaryType: ${value}`);\n }\n get protocol() {\n return this.#ws.protocol;\n }\n get extensions() {\n return this.#ws.extensions;\n }\n addEventListener(type, listener, options) {\n this.#ws.addEventListener(type, listener, options);\n }\n removeEventListener(type, listener) {\n this.#ws.removeEventListener(type, listener);\n }\n get onopen() {\n return this.#ws.onopen;\n }\n set onopen(value) {\n this.#ws.onopen = value;\n }\n get onerror() {\n return this.#ws.onerror;\n }\n set onerror(value) {\n this.#ws.onerror = value;\n }\n get onclose() {\n return this.#ws.onclose;\n }\n set onclose(value) {\n this.#ws.onclose = value;\n }\n get onmessage() {\n return this.#ws.onmessage;\n }\n set onmessage(value) {\n this.#ws.onmessage = value;\n }\n get bufferedAmount() {\n return this.#ws.bufferedAmount;\n }\n get isPaused() {\n return this.#paused;\n }\n ping(data, mask, cb) {\n if (typeof data === \"function\")\n cb = data, data = mask = @undefined;\n else if (typeof mask === \"function\")\n cb = mask, mask = @undefined;\n if (typeof data === \"number\")\n data = data.toString();\n try {\n this.#ws.ping(data);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n pong(data, mask, cb) {\n if (typeof data === \"function\")\n cb = data, data = mask = @undefined;\n else if (typeof mask === \"function\")\n cb = mask, mask = @undefined;\n if (typeof data === \"number\")\n data = data.toString();\n try {\n this.#ws.pong(data);\n } catch (error) {\n typeof cb === \"function\" && cb(error);\n return;\n }\n typeof cb === \"function\" && cb();\n }\n pause() {\n switch (this.readyState) {\n case WebSocket.CONNECTING:\n case WebSocket.CLOSED:\n return;\n }\n this.#paused = !0, emitWarning(\"pause()\", \"ws.WebSocket.pause() is not implemented in bun\");\n }\n resume() {\n switch (this.readyState) {\n case WebSocket.CONNECTING:\n case WebSocket.CLOSED:\n return;\n }\n this.#paused = !1, emitWarning(\"resume()\", \"ws.WebSocket.resume() is not implemented in bun\");\n }\n}\nObject.defineProperty(BunWebSocket, \"name\", { value: \"WebSocket\" });\nvar wsKeyRegex = /^[+/0-9A-Za-z]{22}==$/, wsTokenChars = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 1,\n 0,\n 1,\n 0\n], RUNNING = 0, CLOSING = 1, CLOSED = 2;\n\nclass BunWebSocketMocked extends EventEmitter {\n #ws;\n #state;\n #enquedMessages = [];\n #url;\n #protocol;\n #extensions;\n #bufferedAmount = 0;\n #binaryType = \"arraybuffer\";\n #onclose;\n #onerror;\n #onmessage;\n #onopen;\n constructor(url, protocol, extensions, binaryType) {\n super();\n if (this.#ws = null, this.#state = 0, this.#url = url, this.#bufferedAmount = 0, binaryType = binaryType || \"arraybuffer\", binaryType !== \"nodebuffer\" && binaryType !== \"blob\" && binaryType !== \"arraybuffer\")\n @throwTypeError(\"binaryType must be either 'blob', 'arraybuffer' or 'nodebuffer'\");\n this.#binaryType = binaryType, this.#protocol = protocol, this.#extensions = extensions;\n const message = this.#message.bind(this), open = this.#open.bind(this), close = this.#close.bind(this), drain = this.#drain.bind(this);\n this[kBunInternals] = {\n message,\n open,\n close,\n drain\n };\n }\n #message(ws, message) {\n this.#ws = ws;\n let isBinary = !1;\n if (typeof message === \"string\")\n if (this.#binaryType === \"arraybuffer\")\n message = encoder.encode(message).buffer;\n else if (this.#binaryType === \"blob\")\n message = new Blob([message], { type: \"text/plain\" });\n else\n message = @Buffer.from(message);\n else if (isBinary = !0, this.#binaryType !== \"nodebuffer\") {\n if (this.#binaryType === \"arraybuffer\")\n message = new @Uint8Array(message);\n else if (this.#binaryType === \"blob\")\n message = new Blob([message]);\n }\n this.emit(\"message\", message, isBinary);\n }\n #open(ws) {\n this.#ws = ws, this.#state = 1, this.emit(\"open\", this), this.#drain(ws);\n }\n #close(ws, code, reason) {\n this.#state = 3, this.#ws = null, this.emit(\"close\", code, reason);\n }\n #drain(ws) {\n const chunk = this.#enquedMessages[0];\n if (chunk) {\n const [data, compress, cb] = chunk;\n if (ws.send(data, compress) == -1)\n return;\n typeof cb === \"function\" && cb(), this.#bufferedAmount -= chunk.length, this.#enquedMessages.shift();\n }\n }\n send(data, opts, cb) {\n if (this.#state === 1) {\n const compress = opts\?.compress;\n if (this.#ws.send(data, compress) == -1) {\n this.#enquedMessages.push([data, compress, cb]), this.#bufferedAmount += data.length;\n return;\n }\n typeof cb === \"function\" && cb();\n } else if (this.#state === 0)\n this.#enquedMessages.push([data, opts\?.compress, cb]), this.#bufferedAmount += data.length;\n }\n close(code, reason) {\n if (this.#state === 1)\n this.#state = 2, this.#ws.close(code, reason);\n }\n get binaryType() {\n return this.#binaryType;\n }\n set binaryType(type) {\n if (type !== \"nodebuffer\" && type !== \"blob\" && type !== \"arraybuffer\")\n @throwTypeError(\"binaryType must be either 'blob', 'arraybuffer' or 'nodebuffer'\");\n this.#binaryType = type;\n }\n get readyState() {\n return this.#state;\n }\n get url() {\n return this.#url;\n }\n get protocol() {\n return this.#protocol;\n }\n get extensions() {\n return this.#extensions;\n }\n get bufferedAmount() {\n return this.#bufferedAmount \?\? 0;\n }\n setSocket(socket, head, options) {\n throw new Error(\"Not implemented\");\n }\n set onclose(cb) {\n if (this.#onclose)\n this.removeListener(\"close\", this.#onclose);\n this.on(\"close\", cb), this.#onclose = cb;\n }\n set onerror(cb) {\n if (this.#onerror)\n this.removeListener(\"error\", this.#onerror);\n this.on(\"error\", cb), this.#onerror = cb;\n }\n set onmessage(cb) {\n if (this.#onmessage)\n this.removeListener(\"message\", this.#onmessage);\n this.on(\"message\", cb), this.#onmessage = cb;\n }\n set onopen(cb) {\n if (this.#onopen)\n this.removeListener(\"open\", this.#onopen);\n this.on(\"open\", cb), this.#onopen = cb;\n }\n get onclose() {\n return this.#onclose;\n }\n get onerror() {\n return this.#onerror;\n }\n get onmessage() {\n return this.#onmessage;\n }\n get onopen() {\n return this.#onopen;\n }\n addEventListener(type, listener, options) {\n if (type === \"message\") {\n const l = (data) => listener({ data });\n l.listener = listener, this.on(type, l);\n return;\n }\n this.on(type, listener);\n }\n removeEventListener(type, listener) {\n this.off(type, listener);\n }\n}\n\nclass WebSocketServer extends EventEmitter {\n _server;\n options;\n clients;\n _shouldEmitClose;\n _state;\n _removeListeners;\n constructor(options, callback) {\n super();\n if (options = {\n maxPayload: 104857600,\n skipUTF8Validation: !1,\n perMessageDeflate: !1,\n handleProtocols: null,\n clientTracking: !0,\n verifyClient: null,\n noServer: !1,\n backlog: null,\n server: null,\n host: null,\n path: null,\n port: null,\n ...options\n }, options.port == null && !options.server && !options.noServer || options.port != null && (options.server || options.noServer) || options.server && options.noServer)\n @throwTypeError('One and only one of the \"port\", \"server\", or \"noServer\" options must be specified');\n if (options.port != null)\n this._server = http.createServer((req, res) => {\n const body = http.STATUS_CODES[426];\n res.writeHead(426, {\n \"Content-Length\": body.length,\n \"Content-Type\": \"text/plain\"\n }), res.end(body);\n }), this._server.listen(options.port, options.host, options.backlog, callback);\n else if (options.server)\n this._server = options.server;\n if (this._server) {\n const emitConnection = this.emit.bind(this, \"connection\"), emitListening = this.emit.bind(this, \"listening\"), emitError = this.emit.bind(this, \"error\"), doUpgrade = (req, socket, head) => {\n this.handleUpgrade(req, socket, head, emitConnection);\n };\n this._server.on(\"listening\", emitListening), this._server.on(\"error\", emitError), this._server.on(\"upgrade\", doUpgrade), this._removeListeners = () => {\n this._server.removeListener(\"upgrade\", doUpgrade), this._server.removeListener(\"listening\", emitListening), this._server.removeListener(\"error\", emitError);\n };\n }\n if (options.perMessageDeflate === !0)\n options.perMessageDeflate = {};\n if (options.clientTracking)\n this.clients = new Set, this._shouldEmitClose = !1;\n this.options = options, this._state = RUNNING;\n }\n address() {\n if (this.options.noServer)\n throw new Error('The server is operating in \"noServer\" mode');\n if (!this._server)\n return null;\n return this._server.address();\n }\n close(cb) {\n if (this._state === CLOSED) {\n if (cb)\n this.once(\"close\", () => {\n cb(new Error(\"The server is not running\"));\n });\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n return;\n }\n if (cb)\n this.once(\"close\", cb);\n if (this._state === CLOSING)\n return;\n if (this._state = CLOSING, this.options.noServer || this.options.server) {\n if (this._server)\n this._removeListeners(), this._removeListeners = this._server = null;\n if (this.clients)\n if (!this.clients.size)\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n else\n this._shouldEmitClose = !0;\n else\n process.nextTick((server) => {\n server._state = CLOSED, server.emit(\"close\");\n }, this);\n } else {\n const server = this._server;\n this._removeListeners(), this._removeListeners = this._server = null, server.close(() => {\n this._state = CLOSED, this.emit(\"close\");\n });\n }\n }\n shouldHandle(req) {\n if (this.options.path) {\n const index = req.url.indexOf(\"\?\");\n if ((index !== -1 \? req.url.slice(0, index) : req.url) !== this.options.path)\n return !1;\n }\n return !0;\n }\n completeUpgrade(extensions, key, protocols, request, socket, head, cb) {\n const [server, response, req] = socket[kBunInternals];\n if (this._state > RUNNING)\n return abortHandshake(response, 503);\n let protocol = \"\";\n if (protocols.size)\n protocol = this.options.handleProtocols \? this.options.handleProtocols(protocols, request) : protocols.values().next().value;\n const ws = new BunWebSocketMocked(request.url, protocol, extensions, \"nodebuffer\"), headers = [\"HTTP/1.1 101 Switching Protocols\", \"Upgrade: websocket\", \"Connection: Upgrade\"];\n if (this.emit(\"headers\", headers, request), server.upgrade(req, {\n data: ws[kBunInternals]\n })) {\n if (response._reply(@undefined), this.clients)\n this.clients.add(ws), ws.on(\"close\", () => {\n if (this.clients.delete(ws), this._shouldEmitClose && !this.clients.size)\n process.nextTick(wsEmitClose, this);\n });\n cb(ws, request);\n } else\n abortHandshake(response, 500);\n }\n handleUpgrade(req, socket, head, cb) {\n const [_, response] = socket[kBunInternals], key = req.headers[\"sec-websocket-key\"], version = +req.headers[\"sec-websocket-version\"];\n if (req.method !== \"GET\") {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 405, \"Invalid HTTP method\");\n return;\n }\n if (req.headers.upgrade.toLowerCase() !== \"websocket\") {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Invalid Upgrade header\");\n return;\n }\n if (!key || !wsKeyRegex.test(key)) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Missing or invalid Sec-WebSocket-Key header\");\n return;\n }\n if (version !== 8 && version !== 13) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Missing or invalid Sec-WebSocket-Version header\");\n return;\n }\n if (!this.shouldHandle(req)) {\n abortHandshake(response, 400);\n return;\n }\n const secWebSocketProtocol = req.headers[\"sec-websocket-protocol\"];\n let protocols = new Set;\n if (secWebSocketProtocol !== @undefined)\n try {\n protocols = subprotocolParse(secWebSocketProtocol);\n } catch (err) {\n abortHandshakeOrEmitwsClientError(this, req, response, socket, 400, \"Invalid Sec-WebSocket-Protocol header\");\n return;\n }\n const extensions = {};\n if (this.options.verifyClient) {\n const info = {\n origin: req.headers[`${version === 8 \? \"sec-websocket-origin\" : \"origin\"}`],\n secure: !!(req.socket.authorized || req.socket.encrypted),\n req\n };\n if (this.options.verifyClient.length === 2) {\n this.options.verifyClient(info, (verified, code, message, headers) => {\n if (!verified)\n return abortHandshake(response, code || 401, message, headers);\n this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);\n });\n return;\n }\n if (!this.options.verifyClient(info))\n return abortHandshake(response, 401);\n }\n this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);\n }\n}\nObject.defineProperty(BunWebSocket, \"CONNECTING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CONNECTING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(BunWebSocket, \"OPEN\", {\n enumerable: !0,\n value: readyStates.indexOf(\"OPEN\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"OPEN\", {\n enumerable: !0,\n value: readyStates.indexOf(\"OPEN\")\n});\nObject.defineProperty(BunWebSocket, \"CLOSING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSING\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CLOSING\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSING\")\n});\nObject.defineProperty(BunWebSocket, \"CLOSED\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSED\")\n});\nObject.defineProperty(BunWebSocket.prototype, \"CLOSED\", {\n enumerable: !0,\n value: readyStates.indexOf(\"CLOSED\")\n});\n\nclass Sender {\n constructor() {\n throw new Error(\"Not supported yet in Bun\");\n }\n}\n\nclass Receiver {\n constructor() {\n throw new Error(\"Not supported yet in Bun\");\n }\n}\nvar createWebSocketStream = (ws) => {\n throw new Error(\"Not supported yet in Bun\");\n};\n$ = Object.assign(BunWebSocket, {\n createWebSocketStream,\n Receiver,\n Sender,\n WebSocket: BunWebSocket,\n Server: WebSocketServer,\n WebSocketServer\n});\nreturn $})\n");
//
#endif
diff --git a/src/js/out/ResolvedSourceTag.zig b/src/js/out/ResolvedSourceTag.zig
index 4d53d92cd..cf115736c 100644
--- a/src/js/out/ResolvedSourceTag.zig
+++ b/src/js/out/ResolvedSourceTag.zig
@@ -1,3 +1,4 @@
+// zig fmt: off
pub const ResolvedSourceTag = enum(u32) {
// Predefined
javascript = 0,
@@ -15,61 +16,63 @@ pub const ResolvedSourceTag = enum(u32) {
@"internal:debugger" = 514,
@"internal:fs/cp-sync" = 515,
@"internal:fs/cp" = 516,
- @"internal:shared" = 517,
- @"node:assert" = 518,
- @"node:assert/strict" = 519,
- @"node:async_hooks" = 520,
- @"node:child_process" = 521,
- @"node:cluster" = 522,
- @"node:console" = 523,
- @"node:crypto" = 524,
- @"node:dgram" = 525,
- @"node:diagnostics_channel" = 526,
- @"node:dns" = 527,
- @"node:dns/promises" = 528,
- @"node:domain" = 529,
- @"node:events" = 530,
- @"node:fs" = 531,
- @"node:fs/promises" = 532,
- @"node:http" = 533,
- @"node:http2" = 534,
- @"node:https" = 535,
- @"node:inspector" = 536,
- @"node:net" = 537,
- @"node:os" = 538,
- @"node:path/posix" = 539,
- @"node:path" = 540,
- @"node:path/win32" = 541,
- @"node:perf_hooks" = 542,
- @"node:punycode" = 543,
- @"node:querystring" = 544,
- @"node:readline" = 545,
- @"node:readline/promises" = 546,
- @"node:repl" = 547,
- @"node:stream/consumers" = 548,
- @"node:stream" = 549,
- @"node:stream/promises" = 550,
- @"node:stream/web" = 551,
- @"node:timers" = 552,
- @"node:timers/promises" = 553,
- @"node:tls" = 554,
- @"node:trace_events" = 555,
- @"node:tty" = 556,
- @"node:url" = 557,
- @"node:util" = 558,
- @"node:v8" = 559,
- @"node:vm" = 560,
- @"node:wasi" = 561,
- @"node:worker_threads" = 562,
- @"node:zlib" = 563,
- @"depd" = 564,
- @"detect-libc" = 565,
- @"detect-libc/linux" = 566,
- @"isomorphic-fetch" = 567,
- @"node-fetch" = 568,
- @"undici" = 569,
- @"vercel_fetch" = 570,
- @"ws" = 571,
+ @"internal:primordials" = 517,
+ @"internal:shared" = 518,
+ @"internal:util/inspect" = 519,
+ @"node:assert" = 520,
+ @"node:assert/strict" = 521,
+ @"node:async_hooks" = 522,
+ @"node:child_process" = 523,
+ @"node:cluster" = 524,
+ @"node:console" = 525,
+ @"node:crypto" = 526,
+ @"node:dgram" = 527,
+ @"node:diagnostics_channel" = 528,
+ @"node:dns" = 529,
+ @"node:dns/promises" = 530,
+ @"node:domain" = 531,
+ @"node:events" = 532,
+ @"node:fs" = 533,
+ @"node:fs/promises" = 534,
+ @"node:http" = 535,
+ @"node:http2" = 536,
+ @"node:https" = 537,
+ @"node:inspector" = 538,
+ @"node:net" = 539,
+ @"node:os" = 540,
+ @"node:path/posix" = 541,
+ @"node:path" = 542,
+ @"node:path/win32" = 543,
+ @"node:perf_hooks" = 544,
+ @"node:punycode" = 545,
+ @"node:querystring" = 546,
+ @"node:readline" = 547,
+ @"node:readline/promises" = 548,
+ @"node:repl" = 549,
+ @"node:stream/consumers" = 550,
+ @"node:stream" = 551,
+ @"node:stream/promises" = 552,
+ @"node:stream/web" = 553,
+ @"node:timers" = 554,
+ @"node:timers/promises" = 555,
+ @"node:tls" = 556,
+ @"node:trace_events" = 557,
+ @"node:tty" = 558,
+ @"node:url" = 559,
+ @"node:util" = 560,
+ @"node:v8" = 561,
+ @"node:vm" = 562,
+ @"node:wasi" = 563,
+ @"node:worker_threads" = 564,
+ @"node:zlib" = 565,
+ @"depd" = 566,
+ @"detect-libc" = 567,
+ @"detect-libc/linux" = 568,
+ @"isomorphic-fetch" = 569,
+ @"node-fetch" = 570,
+ @"undici" = 571,
+ @"vercel_fetch" = 572,
+ @"ws" = 573,
// Native modules run through a different system using ESM registry.
@"bun" = 1024,
@"bun:jsc" = 1025,
diff --git a/src/js/out/SyntheticModuleType.h b/src/js/out/SyntheticModuleType.h
index 7338aec5f..0990be0cb 100644
--- a/src/js/out/SyntheticModuleType.h
+++ b/src/js/out/SyntheticModuleType.h
@@ -15,61 +15,63 @@ enum SyntheticModuleType : uint32_t {
InternalDebugger = 514,
InternalFSCpSync = 515,
InternalFSCp = 516,
- InternalShared = 517,
- NodeAssert = 518,
- NodeAssertStrict = 519,
- NodeAsyncHooks = 520,
- NodeChildProcess = 521,
- NodeCluster = 522,
- NodeConsole = 523,
- NodeCrypto = 524,
- NodeDgram = 525,
- NodeDiagnosticsChannel = 526,
- NodeDNS = 527,
- NodeDNSPromises = 528,
- NodeDomain = 529,
- NodeEvents = 530,
- NodeFS = 531,
- NodeFSPromises = 532,
- NodeHttp = 533,
- NodeHttp2 = 534,
- NodeHttps = 535,
- NodeInspector = 536,
- NodeNet = 537,
- NodeOS = 538,
- NodePathPosix = 539,
- NodePath = 540,
- NodePathWin32 = 541,
- NodePerfHooks = 542,
- NodePunycode = 543,
- NodeQuerystring = 544,
- NodeReadline = 545,
- NodeReadlinePromises = 546,
- NodeRepl = 547,
- NodeStreamConsumers = 548,
- NodeStream = 549,
- NodeStreamPromises = 550,
- NodeStreamWeb = 551,
- NodeTimers = 552,
- NodeTimersPromises = 553,
- NodeTLS = 554,
- NodeTraceEvents = 555,
- NodeTty = 556,
- NodeUrl = 557,
- NodeUtil = 558,
- NodeV8 = 559,
- NodeVM = 560,
- NodeWasi = 561,
- NodeWorkerThreads = 562,
- NodeZlib = 563,
- ThirdpartyDepd = 564,
- ThirdpartyDetectLibc = 565,
- ThirdpartyDetectLibcLinux = 566,
- ThirdpartyIsomorphicFetch = 567,
- ThirdpartyNodeFetch = 568,
- ThirdpartyUndici = 569,
- ThirdpartyVercelFetch = 570,
- ThirdpartyWS = 571,
+ InternalPrimordials = 517,
+ InternalShared = 518,
+ InternalUtilInspect = 519,
+ NodeAssert = 520,
+ NodeAssertStrict = 521,
+ NodeAsyncHooks = 522,
+ NodeChildProcess = 523,
+ NodeCluster = 524,
+ NodeConsole = 525,
+ NodeCrypto = 526,
+ NodeDgram = 527,
+ NodeDiagnosticsChannel = 528,
+ NodeDNS = 529,
+ NodeDNSPromises = 530,
+ NodeDomain = 531,
+ NodeEvents = 532,
+ NodeFS = 533,
+ NodeFSPromises = 534,
+ NodeHttp = 535,
+ NodeHttp2 = 536,
+ NodeHttps = 537,
+ NodeInspector = 538,
+ NodeNet = 539,
+ NodeOS = 540,
+ NodePathPosix = 541,
+ NodePath = 542,
+ NodePathWin32 = 543,
+ NodePerfHooks = 544,
+ NodePunycode = 545,
+ NodeQuerystring = 546,
+ NodeReadline = 547,
+ NodeReadlinePromises = 548,
+ NodeRepl = 549,
+ NodeStreamConsumers = 550,
+ NodeStream = 551,
+ NodeStreamPromises = 552,
+ NodeStreamWeb = 553,
+ NodeTimers = 554,
+ NodeTimersPromises = 555,
+ NodeTLS = 556,
+ NodeTraceEvents = 557,
+ NodeTty = 558,
+ NodeUrl = 559,
+ NodeUtil = 560,
+ NodeV8 = 561,
+ NodeVM = 562,
+ NodeWasi = 563,
+ NodeWorkerThreads = 564,
+ NodeZlib = 565,
+ ThirdpartyDepd = 566,
+ ThirdpartyDetectLibc = 567,
+ ThirdpartyDetectLibcLinux = 568,
+ ThirdpartyIsomorphicFetch = 569,
+ ThirdpartyNodeFetch = 570,
+ ThirdpartyUndici = 571,
+ ThirdpartyVercelFetch = 572,
+ ThirdpartyWS = 573,
// Native modules run through the same system, but with different underlying initializers.
// They also have bit 10 set to differentiate them from JS builtins.
diff --git a/src/js/out/WebCoreJSBuiltins.cpp b/src/js/out/WebCoreJSBuiltins.cpp
index a83ce2bd6..4890c49cc 100644
--- a/src/js/out/WebCoreJSBuiltins.cpp
+++ b/src/js/out/WebCoreJSBuiltins.cpp
@@ -10,29 +10,29 @@ namespace Zig { class GlobalObject; }
namespace WebCore {
/* BundlerPlugin.ts */
-// runSetupFunction
-const JSC::ConstructAbility s_bundlerPluginRunSetupFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_bundlerPluginRunSetupFunctionCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_bundlerPluginRunSetupFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_bundlerPluginRunSetupFunctionCodeLength = 3224;
-static const JSC::Intrinsic s_bundlerPluginRunSetupFunctionCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_bundlerPluginRunSetupFunctionCode = "(function (setup,config){\"use strict\";var onLoadPlugins=new Map,onResolvePlugins=new Map;function validate(filterObject,callback,map){if(!filterObject||!@isObject(filterObject))@throwTypeError('Expected an object with \"filter\" RegExp');if(!callback||!@isCallable(callback))@throwTypeError(\"callback must be a function\");var{filter,namespace=\"file\"}=filterObject;if(!filter)@throwTypeError('Expected an object with \"filter\" RegExp');if(!@isRegExpObject(filter))@throwTypeError(\"filter must be a RegExp\");if(namespace&&typeof namespace!==\"string\")@throwTypeError(\"namespace must be a string\");if((namespace\?.length\?\?0)===0)namespace=\"file\";if(!/^([/@a-zA-Z0-9_\\\\-]+)$/.test(namespace))@throwTypeError(\"namespace can only contain $a-zA-Z0-9_\\\\-\");var callbacks=map.@get(namespace);if(!callbacks)map.@set(namespace,[[filter,callback]]);else @arrayPush(callbacks,[filter,callback])}function onLoad(filterObject,callback){validate(filterObject,callback,onLoadPlugins)}function onResolve(filterObject,callback){validate(filterObject,callback,onResolvePlugins)}const processSetupResult=()=>{var anyOnLoad=!1,anyOnResolve=!1;for(var[namespace,callbacks]of onLoadPlugins.entries())for(var[filter]of callbacks)this.addFilter(filter,namespace,1),anyOnLoad=!0;for(var[namespace,callbacks]of onResolvePlugins.entries())for(var[filter]of callbacks)this.addFilter(filter,namespace,0),anyOnResolve=!0;if(anyOnResolve){var onResolveObject=this.onResolve;if(!onResolveObject)this.onResolve=onResolvePlugins;else for(var[namespace,callbacks]of onResolvePlugins.entries()){var existing=onResolveObject.@get(namespace);if(!existing)onResolveObject.@set(namespace,callbacks);else onResolveObject.@set(namespace,existing.concat(callbacks))}}if(anyOnLoad){var onLoadObject=this.onLoad;if(!onLoadObject)this.onLoad=onLoadPlugins;else for(var[namespace,callbacks]of onLoadPlugins.entries()){var existing=onLoadObject.@get(namespace);if(!existing)onLoadObject.@set(namespace,callbacks);else onLoadObject.@set(namespace,existing.concat(callbacks))}}return anyOnLoad||anyOnResolve};var setupResult=setup({config,onDispose:()=>@throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),onEnd:()=>@throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),onLoad,onResolve,onStart:()=>@throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),resolve:()=>@throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),initialOptions:{...config,bundle:!0,entryPoints:config.entrypoints\?\?config.entryPoints\?\?[],minify:typeof config.minify===\"boolean\"\?config.minify:!1,minifyIdentifiers:config.minify===!0||config.minify\?.identifiers,minifyWhitespace:config.minify===!0||config.minify\?.whitespace,minifySyntax:config.minify===!0||config.minify\?.syntax,outbase:config.root,platform:config.target===\"bun\"\?\"node\":config.target},esbuild:{}});if(setupResult&&@isPromise(setupResult))if(@getPromiseInternalField(setupResult,@promiseFieldFlags)&@promiseStateFulfilled)setupResult=@getPromiseInternalField(setupResult,@promiseFieldReactionsOrResult);else return setupResult.@then(processSetupResult);return processSetupResult()})\n";
+// runOnLoadPlugins
+const JSC::ConstructAbility s_bundlerPluginRunOnLoadPluginsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_bundlerPluginRunOnLoadPluginsCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_bundlerPluginRunOnLoadPluginsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_bundlerPluginRunOnLoadPluginsCodeLength = 2268;
+static const JSC::Intrinsic s_bundlerPluginRunOnLoadPluginsCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_bundlerPluginRunOnLoadPluginsCode = "(function (internalID, path, namespace, defaultLoaderId) {\"use strict\";\n const LOADERS_MAP = { jsx: 0, js: 1, ts: 2, tsx: 3, css: 4, file: 5, json: 6, toml: 7, wasm: 8, napi: 9, base64: 10, dataurl: 11, text: 12 }, loaderName = [\"jsx\", \"js\", \"ts\", \"tsx\", \"css\", \"file\", \"json\", \"toml\", \"wasm\", \"napi\", \"base64\", \"dataurl\", \"text\"][defaultLoaderId];\n var promiseResult = (async (internalID2, path2, namespace2, defaultLoader) => {\n var results = this.onLoad.@get(namespace2);\n if (!results)\n return this.onLoadAsync(internalID2, null, null), null;\n for (let [filter, callback] of results)\n if (filter.test(path2)) {\n var result = callback({\n path: path2,\n namespace: namespace2,\n loader: defaultLoader\n });\n while (result && @isPromise(result) && (@getPromiseInternalField(result, @promiseFieldFlags) & @promiseStateMask) === @promiseStateFulfilled)\n result = @getPromiseInternalField(result, @promiseFieldReactionsOrResult);\n if (result && @isPromise(result))\n result = await result;\n if (!result || !@isObject(result))\n continue;\n var { contents, loader = defaultLoader } = result;\n if (typeof contents !== \"string\" && !@isTypedArrayView(contents))\n @throwTypeError('onLoad plugins must return an object with \"contents\" as a string or Uint8Array');\n if (typeof loader !== \"string\")\n @throwTypeError('onLoad plugins must return an object with \"loader\" as a string');\n const chosenLoader = LOADERS_MAP[loader];\n if (chosenLoader === @undefined)\n @throwTypeError(`Loader ${loader} is not supported.`);\n return this.onLoadAsync(internalID2, contents, chosenLoader), null;\n }\n return this.onLoadAsync(internalID2, null, null), null;\n })(internalID, path, namespace, loaderName);\n while (promiseResult && @isPromise(promiseResult) && (@getPromiseInternalField(promiseResult, @promiseFieldFlags) & @promiseStateMask) === @promiseStateFulfilled)\n promiseResult = @getPromiseInternalField(promiseResult, @promiseFieldReactionsOrResult);\n if (promiseResult && @isPromise(promiseResult))\n promiseResult.then(() => {\n }, (e) => {\n this.addError(internalID, e, 1);\n });\n})\n";
// runOnResolvePlugins
const JSC::ConstructAbility s_bundlerPluginRunOnResolvePluginsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_bundlerPluginRunOnResolvePluginsCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_bundlerPluginRunOnResolvePluginsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_bundlerPluginRunOnResolvePluginsCodeLength = 2359;
+const int s_bundlerPluginRunOnResolvePluginsCodeLength = 3000;
static const JSC::Intrinsic s_bundlerPluginRunOnResolvePluginsCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_bundlerPluginRunOnResolvePluginsCode = "(function (specifier,inputNamespace,importer,internalID,kindId){\"use strict\";const kind=[\"entry-point\",\"import-statement\",\"require-call\",\"dynamic-import\",\"require-resolve\",\"import-rule\",\"url-token\",\"internal\"][kindId];var promiseResult=(async(inputPath,inputNamespace2,importer2,kind2)=>{var{onResolve,onLoad}=this,results=onResolve.@get(inputNamespace2);if(!results)return this.onResolveAsync(internalID,null,null,null),null;for(let[filter,callback]of results)if(filter.test(inputPath)){var result=callback({path:inputPath,importer:importer2,namespace:inputNamespace2,kind:kind2});while(result&&@isPromise(result)&&(@getPromiseInternalField(result,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)result=@getPromiseInternalField(result,@promiseFieldReactionsOrResult);if(result&&@isPromise(result))result=await result;if(!result||!@isObject(result))continue;var{path,namespace:userNamespace=inputNamespace2,external}=result;if(typeof path!==\"string\"||typeof userNamespace!==\"string\")@throwTypeError(\"onResolve plugins must return an object with a string 'path' and string 'loader' field\");if(!path)continue;if(!userNamespace)userNamespace=inputNamespace2;if(typeof external!==\"boolean\"&&!@isUndefinedOrNull(external))@throwTypeError('onResolve plugins \"external\" field must be boolean or unspecified');if(!external){if(userNamespace===\"file\"){if(process.platform!==\"win32\"){if(path[0]!==\"/\"||path.includes(\"..\"))@throwTypeError('onResolve plugin \"path\" must be absolute when the namespace is \"file\"')}}if(userNamespace===\"dataurl\"){if(!path.startsWith(\"data:\"))@throwTypeError('onResolve plugin \"path\" must start with \"data:\" when the namespace is \"dataurl\"')}if(userNamespace&&userNamespace!==\"file\"&&(!onLoad||!onLoad.@has(userNamespace)))@throwTypeError(`Expected onLoad plugin for namespace ${userNamespace} to exist`)}return this.onResolveAsync(internalID,path,userNamespace,external),null}return this.onResolveAsync(internalID,null,null,null),null})(specifier,inputNamespace,importer,kind);while(promiseResult&&@isPromise(promiseResult)&&(@getPromiseInternalField(promiseResult,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)promiseResult=@getPromiseInternalField(promiseResult,@promiseFieldReactionsOrResult);if(promiseResult&&@isPromise(promiseResult))promiseResult.then(()=>{},(e)=>{this.addError(internalID,e,0)})})\n";
+const char* const s_bundlerPluginRunOnResolvePluginsCode = "(function (specifier, inputNamespace, importer, internalID, kindId) {\"use strict\";\n const kind = [\"entry-point\", \"import-statement\", \"require-call\", \"dynamic-import\", \"require-resolve\", \"import-rule\", \"url-token\", \"internal\"][kindId];\n var promiseResult = (async (inputPath, inputNamespace2, importer2, kind2) => {\n var { onResolve, onLoad } = this, results = onResolve.@get(inputNamespace2);\n if (!results)\n return this.onResolveAsync(internalID, null, null, null), null;\n for (let [filter, callback] of results)\n if (filter.test(inputPath)) {\n var result = callback({\n path: inputPath,\n importer: importer2,\n namespace: inputNamespace2,\n kind: kind2\n });\n while (result && @isPromise(result) && (@getPromiseInternalField(result, @promiseFieldFlags) & @promiseStateMask) === @promiseStateFulfilled)\n result = @getPromiseInternalField(result, @promiseFieldReactionsOrResult);\n if (result && @isPromise(result))\n result = await result;\n if (!result || !@isObject(result))\n continue;\n var { path, namespace: userNamespace = inputNamespace2, external } = result;\n if (typeof path !== \"string\" || typeof userNamespace !== \"string\")\n @throwTypeError(\"onResolve plugins must return an object with a string 'path' and string 'loader' field\");\n if (!path)\n continue;\n if (!userNamespace)\n userNamespace = inputNamespace2;\n if (typeof external !== \"boolean\" && !@isUndefinedOrNull(external))\n @throwTypeError('onResolve plugins \"external\" field must be boolean or unspecified');\n if (!external) {\n if (userNamespace === \"file\") {\n if (process.platform !== \"win32\") {\n if (path[0] !== \"/\" || path.includes(\"..\"))\n @throwTypeError('onResolve plugin \"path\" must be absolute when the namespace is \"file\"');\n }\n }\n if (userNamespace === \"dataurl\") {\n if (!path.startsWith(\"data:\"))\n @throwTypeError('onResolve plugin \"path\" must start with \"data:\" when the namespace is \"dataurl\"');\n }\n if (userNamespace && userNamespace !== \"file\" && (!onLoad || !onLoad.@has(userNamespace)))\n @throwTypeError(`Expected onLoad plugin for namespace ${userNamespace} to exist`);\n }\n return this.onResolveAsync(internalID, path, userNamespace, external), null;\n }\n return this.onResolveAsync(internalID, null, null, null), null;\n })(specifier, inputNamespace, importer, kind);\n while (promiseResult && @isPromise(promiseResult) && (@getPromiseInternalField(promiseResult, @promiseFieldFlags) & @promiseStateMask) === @promiseStateFulfilled)\n promiseResult = @getPromiseInternalField(promiseResult, @promiseFieldReactionsOrResult);\n if (promiseResult && @isPromise(promiseResult))\n promiseResult.then(() => {\n }, (e) => {\n this.addError(internalID, e, 0);\n });\n})\n";
-// runOnLoadPlugins
-const JSC::ConstructAbility s_bundlerPluginRunOnLoadPluginsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_bundlerPluginRunOnLoadPluginsCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_bundlerPluginRunOnLoadPluginsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_bundlerPluginRunOnLoadPluginsCodeLength = 1835;
-static const JSC::Intrinsic s_bundlerPluginRunOnLoadPluginsCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_bundlerPluginRunOnLoadPluginsCode = "(function (internalID,path,namespace,defaultLoaderId){\"use strict\";const LOADERS_MAP={jsx:0,js:1,ts:2,tsx:3,css:4,file:5,json:6,toml:7,wasm:8,napi:9,base64:10,dataurl:11,text:12},loaderName=[\"jsx\",\"js\",\"ts\",\"tsx\",\"css\",\"file\",\"json\",\"toml\",\"wasm\",\"napi\",\"base64\",\"dataurl\",\"text\"][defaultLoaderId];var promiseResult=(async(internalID2,path2,namespace2,defaultLoader)=>{var results=this.onLoad.@get(namespace2);if(!results)return this.onLoadAsync(internalID2,null,null),null;for(let[filter,callback]of results)if(filter.test(path2)){var result=callback({path:path2,namespace:namespace2,loader:defaultLoader});while(result&&@isPromise(result)&&(@getPromiseInternalField(result,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)result=@getPromiseInternalField(result,@promiseFieldReactionsOrResult);if(result&&@isPromise(result))result=await result;if(!result||!@isObject(result))continue;var{contents,loader=defaultLoader}=result;if(typeof contents!==\"string\"&&!@isTypedArrayView(contents))@throwTypeError('onLoad plugins must return an object with \"contents\" as a string or Uint8Array');if(typeof loader!==\"string\")@throwTypeError('onLoad plugins must return an object with \"loader\" as a string');const chosenLoader=LOADERS_MAP[loader];if(chosenLoader===@undefined)@throwTypeError(`Loader ${loader} is not supported.`);return this.onLoadAsync(internalID2,contents,chosenLoader),null}return this.onLoadAsync(internalID2,null,null),null})(internalID,path,namespace,loaderName);while(promiseResult&&@isPromise(promiseResult)&&(@getPromiseInternalField(promiseResult,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)promiseResult=@getPromiseInternalField(promiseResult,@promiseFieldReactionsOrResult);if(promiseResult&&@isPromise(promiseResult))promiseResult.then(()=>{},(e)=>{this.addError(internalID,e,1)})})\n";
+// runSetupFunction
+const JSC::ConstructAbility s_bundlerPluginRunSetupFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_bundlerPluginRunSetupFunctionCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_bundlerPluginRunSetupFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_bundlerPluginRunSetupFunctionCodeLength = 4133;
+static const JSC::Intrinsic s_bundlerPluginRunSetupFunctionCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_bundlerPluginRunSetupFunctionCode = "(function (setup, config) {\"use strict\";\n var onLoadPlugins = new Map, onResolvePlugins = new Map;\n function validate(filterObject, callback, map) {\n if (!filterObject || !@isObject(filterObject))\n @throwTypeError('Expected an object with \"filter\" RegExp');\n if (!callback || !@isCallable(callback))\n @throwTypeError(\"callback must be a function\");\n var { filter, namespace = \"file\" } = filterObject;\n if (!filter)\n @throwTypeError('Expected an object with \"filter\" RegExp');\n if (!@isRegExpObject(filter))\n @throwTypeError(\"filter must be a RegExp\");\n if (namespace && typeof namespace !== \"string\")\n @throwTypeError(\"namespace must be a string\");\n if ((namespace\?.length \?\? 0) === 0)\n namespace = \"file\";\n if (!/^([/@a-zA-Z0-9_\\\\-]+)$/.test(namespace))\n @throwTypeError(\"namespace can only contain $a-zA-Z0-9_\\\\-\");\n var callbacks = map.@get(namespace);\n if (!callbacks)\n map.@set(namespace, [[filter, callback]]);\n else\n @arrayPush(callbacks, [filter, callback]);\n }\n function onLoad(filterObject, callback) {\n validate(filterObject, callback, onLoadPlugins);\n }\n function onResolve(filterObject, callback) {\n validate(filterObject, callback, onResolvePlugins);\n }\n const processSetupResult = () => {\n var anyOnLoad = !1, anyOnResolve = !1;\n for (var [namespace, callbacks] of onLoadPlugins.entries())\n for (var [filter] of callbacks)\n this.addFilter(filter, namespace, 1), anyOnLoad = !0;\n for (var [namespace, callbacks] of onResolvePlugins.entries())\n for (var [filter] of callbacks)\n this.addFilter(filter, namespace, 0), anyOnResolve = !0;\n if (anyOnResolve) {\n var onResolveObject = this.onResolve;\n if (!onResolveObject)\n this.onResolve = onResolvePlugins;\n else\n for (var [namespace, callbacks] of onResolvePlugins.entries()) {\n var existing = onResolveObject.@get(namespace);\n if (!existing)\n onResolveObject.@set(namespace, callbacks);\n else\n onResolveObject.@set(namespace, existing.concat(callbacks));\n }\n }\n if (anyOnLoad) {\n var onLoadObject = this.onLoad;\n if (!onLoadObject)\n this.onLoad = onLoadPlugins;\n else\n for (var [namespace, callbacks] of onLoadPlugins.entries()) {\n var existing = onLoadObject.@get(namespace);\n if (!existing)\n onLoadObject.@set(namespace, callbacks);\n else\n onLoadObject.@set(namespace, existing.concat(callbacks));\n }\n }\n return anyOnLoad || anyOnResolve;\n };\n var setupResult = setup({\n config,\n onDispose: () => @throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),\n onEnd: () => @throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),\n onLoad,\n onResolve,\n onStart: () => @throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),\n resolve: () => @throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),\n module: () => {\n @throwTypeError(\"module() is not supported in Bun.build() yet. Only via Bun.plugin() at runtime\");\n },\n initialOptions: {\n ...config,\n bundle: !0,\n entryPoints: config.entrypoints \?\? config.entryPoints \?\? [],\n minify: typeof config.minify === \"boolean\" \? config.minify : !1,\n minifyIdentifiers: config.minify === !0 || config.minify\?.identifiers,\n minifyWhitespace: config.minify === !0 || config.minify\?.whitespace,\n minifySyntax: config.minify === !0 || config.minify\?.syntax,\n outbase: config.root,\n platform: config.target === \"bun\" \? \"node\" : config.target\n },\n esbuild: {}\n });\n if (setupResult && @isPromise(setupResult))\n if (@getPromiseInternalField(setupResult, @promiseFieldFlags) & @promiseStateFulfilled)\n setupResult = @getPromiseInternalField(setupResult, @promiseFieldReactionsOrResult);\n else\n return setupResult.@then(processSetupResult);\n return processSetupResult();\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
@@ -48,25 +48,25 @@ WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
const JSC::ConstructAbility s_byteLengthQueuingStrategyHighWaterMarkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_byteLengthQueuingStrategyHighWaterMarkCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_byteLengthQueuingStrategyHighWaterMarkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_byteLengthQueuingStrategyHighWaterMarkCodeLength = 246;
+const int s_byteLengthQueuingStrategyHighWaterMarkCodeLength = 269;
static const JSC::Intrinsic s_byteLengthQueuingStrategyHighWaterMarkCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_byteLengthQueuingStrategyHighWaterMarkCode = "(function (){\"use strict\";const highWaterMark=@getByIdDirectPrivate(this,\"highWaterMark\");if(highWaterMark===@undefined)@throwTypeError(\"ByteLengthQueuingStrategy.highWaterMark getter called on incompatible |this| value.\");return highWaterMark})\n";
-
-// size
-const JSC::ConstructAbility s_byteLengthQueuingStrategySizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_byteLengthQueuingStrategySizeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_byteLengthQueuingStrategySizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_byteLengthQueuingStrategySizeCodeLength = 57;
-static const JSC::Intrinsic s_byteLengthQueuingStrategySizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_byteLengthQueuingStrategySizeCode = "(function (chunk){\"use strict\";return chunk.byteLength})\n";
+const char* const s_byteLengthQueuingStrategyHighWaterMarkCode = "(function () {\"use strict\";\n const highWaterMark = @getByIdDirectPrivate(this, \"highWaterMark\");\n if (highWaterMark === @undefined)\n @throwTypeError(\"ByteLengthQueuingStrategy.highWaterMark getter called on incompatible |this| value.\");\n return highWaterMark;\n})\n";
// initializeByteLengthQueuingStrategy
const JSC::ConstructAbility s_byteLengthQueuingStrategyInitializeByteLengthQueuingStrategyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_byteLengthQueuingStrategyInitializeByteLengthQueuingStrategyCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_byteLengthQueuingStrategyInitializeByteLengthQueuingStrategyCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_byteLengthQueuingStrategyInitializeByteLengthQueuingStrategyCodeLength = 139;
+const int s_byteLengthQueuingStrategyInitializeByteLengthQueuingStrategyCodeLength = 147;
static const JSC::Intrinsic s_byteLengthQueuingStrategyInitializeByteLengthQueuingStrategyCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_byteLengthQueuingStrategyInitializeByteLengthQueuingStrategyCode = "(function (parameters){\"use strict\";@putByIdDirectPrivate(this,\"highWaterMark\",@extractHighWaterMarkFromQueuingStrategyInit(parameters))})\n";
+const char* const s_byteLengthQueuingStrategyInitializeByteLengthQueuingStrategyCode = "(function (parameters) {\"use strict\";\n @putByIdDirectPrivate(this, \"highWaterMark\", @extractHighWaterMarkFromQueuingStrategyInit(parameters));\n})\n";
+
+// size
+const JSC::ConstructAbility s_byteLengthQueuingStrategySizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_byteLengthQueuingStrategySizeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_byteLengthQueuingStrategySizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_byteLengthQueuingStrategySizeCodeLength = 63;
+static const JSC::Intrinsic s_byteLengthQueuingStrategySizeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_byteLengthQueuingStrategySizeCode = "(function (chunk) {\"use strict\";\n return chunk.byteLength;\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
@@ -77,636 +77,704 @@ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
WEBCORE_FOREACH_BYTELENGTHQUEUINGSTRATEGY_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
-/* WritableStreamInternals.ts */
-// isWritableStream
-const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsIsWritableStreamCodeLength = 109;
-static const JSC::Intrinsic s_writableStreamInternalsIsWritableStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsIsWritableStreamCode = "(function (stream){\"use strict\";return @isObject(stream)&&!!@getByIdDirectPrivate(stream,\"underlyingSink\")})\n";
+/* ConsoleObject.ts */
+// asyncIterator
+const JSC::ConstructAbility s_consoleObjectAsyncIteratorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_consoleObjectAsyncIteratorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_consoleObjectAsyncIteratorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_consoleObjectAsyncIteratorCodeLength = 2154;
+static const JSC::Intrinsic s_consoleObjectAsyncIteratorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_consoleObjectAsyncIteratorCode = "(function () {\"use strict\";\n var stream = Bun.stdin.stream(), decoder = new TextDecoder(\"utf-8\", { fatal: !1 }), indexOf = Bun.indexOfLine, actualChunk, i = -1, idx, last, done, value, value_len, pendingChunk;\n async function* ConsoleAsyncIterator() {\n var reader = stream.getReader(), deferredError;\n try {\n if (i !== -1) {\n last = i + 1, i = indexOf(actualChunk, last);\n while (i !== -1)\n yield decoder.decode(actualChunk.subarray(last, i)), last = i + 1, i = indexOf(actualChunk, last);\n for (idx++;idx < value_len; idx++) {\n if (actualChunk = value[idx], pendingChunk)\n actualChunk = @Buffer.concat([pendingChunk, actualChunk]), pendingChunk = @undefined;\n last = 0, i = indexOf(actualChunk, last);\n while (i !== -1)\n yield decoder.decode(actualChunk.subarray(last, i)), last = i + 1, i = indexOf(actualChunk, last);\n i = -1, pendingChunk = actualChunk.subarray(last);\n }\n actualChunk = @undefined;\n }\n while (!0) {\n const firstResult = reader.readMany();\n if (@isPromise(firstResult))\n ({ done, value } = await firstResult);\n else\n ({ done, value } = firstResult);\n if (done) {\n if (pendingChunk)\n yield decoder.decode(pendingChunk);\n return;\n }\n for (idx = 0, value_len = value.length;idx < value_len; idx++) {\n if (actualChunk = value[idx], pendingChunk)\n actualChunk = @Buffer.concat([pendingChunk, actualChunk]), pendingChunk = @undefined;\n last = 0, i = indexOf(actualChunk, last);\n while (i !== -1)\n yield decoder.decode(actualChunk.subarray(last, i)), last = i + 1, i = indexOf(actualChunk, last);\n i = -1, pendingChunk = actualChunk.subarray(last);\n }\n actualChunk = @undefined;\n }\n } catch (e) {\n deferredError = e;\n } finally {\n if (reader.releaseLock(), deferredError)\n throw deferredError;\n }\n }\n const symbol = globalThis.Symbol.asyncIterator;\n return this[symbol] = ConsoleAsyncIterator, ConsoleAsyncIterator();\n})\n";
-// isWritableStreamDefaultWriter
-const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsIsWritableStreamDefaultWriterCodeLength = 108;
-static const JSC::Intrinsic s_writableStreamInternalsIsWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsIsWritableStreamDefaultWriterCode = "(function (writer){\"use strict\";return @isObject(writer)&&!!@getByIdDirectPrivate(writer,\"closedPromise\")})\n";
+// createConsoleConstructor
+const JSC::ConstructAbility s_consoleObjectCreateConsoleConstructorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_consoleObjectCreateConsoleConstructorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_consoleObjectCreateConsoleConstructorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_consoleObjectCreateConsoleConstructorCodeLength = 18551;
+static const JSC::Intrinsic s_consoleObjectCreateConsoleConstructorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_consoleObjectCreateConsoleConstructorCode = "(function (console) {\"use strict\";\n const { inspect, formatWithOptions } = @getInternalField(@internalModuleRegistry, 48) || @createInternalModuleById(48), { isBuffer } = @requireNativeModule(\"buffer\"), StringPrototypeIncludes = @String.prototype.includes, RegExpPrototypeSymbolReplace = @RegExp.prototype[Symbol.replace], ArrayPrototypeUnshift = @Array.prototype.unshift, StringPrototypeRepeat = @String.prototype.repeat, StringPrototypeSlice = @String.prototype.slice, ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty, StringPrototypePadStart = @String.prototype.padStart, StringPrototypeSplit = @String.prototype.split, NumberPrototypeToFixed = Number.prototype.toFixed, StringPrototypeNormalize = @String.prototype.normalize, StringPrototypeCodePointAt = @String.prototype.codePointAt, ArrayPrototypeMap = @Array.prototype.map, ArrayPrototypeJoin = @Array.prototype.join, ArrayPrototypePush = @Array.prototype.push, kCounts = Symbol(\"counts\");\n var ansiPattern = \"[\\\\u001B\\\\u009B][[\\\\]()#;\?]*(\?:(\?:(\?:(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]+)*|[a-zA-Z\\\\d]+(\?:;[-a-zA-Z\\\\d\\\\/#&.:=\?%@~_]*)*)\?\\\\u0007)|(\?:(\?:\\\\d{1,4}(\?:;\\\\d{0,4})*)\?[\\\\dA-PR-TZcf-ntqry=><~]))\", ansi = new @RegExp(ansiPattern, \"g\"), isFullWidthCodePoint = (code) => {\n return code >= 4352 && (code <= 4447 || code === 9001 || code === 9002 || code >= 11904 && code <= 12871 && code !== 12351 || code >= 12880 && code <= 19903 || code >= 19968 && code <= 42182 || code >= 43360 && code <= 43388 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65040 && code <= 65049 || code >= 65072 && code <= 65131 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 110592 && code <= 110593 || code >= 127488 && code <= 127569 || code >= 127744 && code <= 128591 || code >= 131072 && code <= 262141);\n }, isZeroWidthCodePoint = (code) => {\n return code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || code >= 8203 && code <= 8207 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999;\n };\n function stripVTControlCharacters(str) {\n return RegExpPrototypeSymbolReplace.@call(ansi, str, \"\");\n }\n var getStringWidth = function getStringWidth(str, removeControlChars = !0) {\n var width = 0;\n if (removeControlChars)\n str = stripVTControlCharacters(str);\n str = StringPrototypeNormalize.@call(str, \"NFC\");\n for (var char of str) {\n var code = StringPrototypeCodePointAt.@call(char, 0);\n if (isFullWidthCodePoint(code))\n width += 2;\n else if (!isZeroWidthCodePoint(code))\n width++;\n }\n return width;\n };\n const tableChars = {\n middleMiddle: \"\\u2500\",\n rowMiddle: \"\\u253C\",\n topRight: \"\\u2510\",\n topLeft: \"\\u250C\",\n leftMiddle: \"\\u251C\",\n topMiddle: \"\\u252C\",\n bottomRight: \"\\u2518\",\n bottomLeft: \"\\u2514\",\n bottomMiddle: \"\\u2534\",\n rightMiddle: \"\\u2524\",\n left: \"\\u2502 \",\n right: \" \\u2502\",\n middle: \" \\u2502 \"\n }, renderRow = (row, columnWidths) => {\n let out = tableChars.left;\n for (let i = 0;i < row.length; i++) {\n const cell = row[i], len = getStringWidth(cell), needed = (columnWidths[i] - len) / 2;\n if (out += StringPrototypeRepeat.@call(\" \", needed) + cell + StringPrototypeRepeat.@call(\" \", Math.ceil(needed)), i !== row.length - 1)\n out += tableChars.middle;\n }\n return out += tableChars.right, out;\n }, table = (head, columns) => {\n const columnWidths = ArrayPrototypeMap.@call(head, (h) => getStringWidth(h)), longestColumn = Math.max(...ArrayPrototypeMap.@call(columns, (a) => a.length)), rows = @newArrayWithSize(longestColumn);\n for (let i = 0;i < head.length; i++) {\n const column = columns[i];\n for (let j = 0;j < longestColumn; j++) {\n if (rows[j] === @undefined)\n rows[j] = [];\n const value = rows[j][i] = ObjectPrototypeHasOwnProperty.@call(column, j) \? column[j] : \"\", width = columnWidths[i] || 0, counted = getStringWidth(value);\n columnWidths[i] = Math.max(width, counted);\n }\n }\n const divider = ArrayPrototypeMap.@call(columnWidths, (i) => StringPrototypeRepeat.@call(tableChars.middleMiddle, i + 2));\n let result = tableChars.topLeft + ArrayPrototypeJoin.@call(divider, tableChars.topMiddle) + tableChars.topRight + \"\\n\" + renderRow(head, columnWidths) + \"\\n\" + tableChars.leftMiddle + ArrayPrototypeJoin.@call(divider, tableChars.rowMiddle) + tableChars.rightMiddle + \"\\n\";\n for (let row of rows)\n result += `${renderRow(row, columnWidths)}\\n`;\n return result += tableChars.bottomLeft + ArrayPrototypeJoin.@call(divider, tableChars.bottomMiddle) + tableChars.bottomRight, result;\n }, kGroupIndent = Symbol(\"kGroupIndent\"), kGroupIndentationWidth = Symbol(\"kGroupIndentWidth\"), kFormatForStderr = Symbol(\"kFormatForStderr\"), kFormatForStdout = Symbol(\"kFormatForStdout\"), kGetInspectOptions = Symbol(\"kGetInspectOptions\"), kColorMode = Symbol(\"kColorMode\"), kIsConsole = Symbol(\"kIsConsole\"), kWriteToConsole = Symbol(\"kWriteToConsole\"), kBindProperties = Symbol(\"kBindProperties\"), kBindStreamsEager = Symbol(\"kBindStreamsEager\"), kBindStreamsLazy = Symbol(\"kBindStreamsLazy\"), kUseStdout = Symbol(\"kUseStdout\"), kUseStderr = Symbol(\"kUseStderr\"), optionsMap = new WeakMap;\n function Console(options) {\n if (new.target === @undefined)\n return Reflect.construct(Console, arguments);\n if (!options || typeof options.write === \"function\")\n options = {\n stdout: options,\n stderr: arguments[1],\n ignoreErrors: arguments[2]\n };\n const {\n stdout,\n stderr = stdout,\n ignoreErrors = !0,\n colorMode = \"auto\",\n inspectOptions,\n groupIndentation\n } = options;\n if (!stdout || typeof stdout.write !== \"function\")\n @throwTypeError(\"stdout is not a writable stream\");\n if (!stderr || typeof stderr.write !== \"function\")\n @throwTypeError(\"stderr is not a writable stream\");\n if (typeof colorMode !== \"boolean\" && colorMode !== \"auto\")\n @throwTypeError(\"colorMode must be a boolean or 'auto'\");\n if (inspectOptions !== @undefined) {\n if (inspectOptions.colors !== @undefined && options.colorMode !== @undefined)\n ;\n optionsMap.set(this, inspectOptions);\n }\n Object.keys(Console.prototype).forEach((key) => {\n this[key] = this[key].bind(this), Object.defineProperty(this[key], \"name\", {\n value: key\n });\n }), this[kBindStreamsEager](stdout, stderr), this[kBindProperties](ignoreErrors, colorMode, groupIndentation);\n }\n const consolePropAttributes = {\n writable: !0,\n enumerable: !1,\n configurable: !0\n };\n Object.defineProperty(Console, Symbol.hasInstance, {\n value(instance) {\n return instance[kIsConsole] || instance === console;\n }\n });\n const kColorInspectOptions = { colors: !0 }, kNoColorInspectOptions = {};\n Object.defineProperties(Console.prototype = {}, {\n [kBindStreamsEager]: {\n ...consolePropAttributes,\n value: function(stdout, stderr) {\n Object.defineProperties(this, {\n _stdout: { ...consolePropAttributes, value: stdout },\n _stderr: { ...consolePropAttributes, value: stderr }\n });\n }\n },\n [kBindStreamsLazy]: {\n ...consolePropAttributes,\n value: function(object) {\n let stdout, stderr;\n Object.defineProperties(this, {\n _stdout: {\n enumerable: !1,\n configurable: !0,\n get() {\n if (!stdout)\n stdout = object.stdout;\n return stdout;\n },\n set(value) {\n stdout = value;\n }\n },\n _stderr: {\n enumerable: !1,\n configurable: !0,\n get() {\n if (!stderr)\n stderr = object.stderr;\n return stderr;\n },\n set(value) {\n stderr = value;\n }\n }\n });\n }\n },\n [kBindProperties]: {\n ...consolePropAttributes,\n value: function(ignoreErrors, colorMode, groupIndentation = 2) {\n Object.defineProperties(this, {\n _stdoutErrorHandler: {\n ...consolePropAttributes,\n value: createWriteErrorHandler(this, kUseStdout)\n },\n _stderrErrorHandler: {\n ...consolePropAttributes,\n value: createWriteErrorHandler(this, kUseStderr)\n },\n _ignoreErrors: {\n ...consolePropAttributes,\n value: Boolean(ignoreErrors)\n },\n _times: { ...consolePropAttributes, value: new Map },\n [kCounts]: { ...consolePropAttributes, value: new Map },\n [kColorMode]: { ...consolePropAttributes, value: colorMode },\n [kIsConsole]: { ...consolePropAttributes, value: !0 },\n [kGroupIndent]: { ...consolePropAttributes, value: \"\" },\n [kGroupIndentationWidth]: {\n ...consolePropAttributes,\n value: groupIndentation\n },\n [Symbol.toStringTag]: {\n writable: !1,\n enumerable: !1,\n configurable: !0,\n value: \"console\"\n }\n });\n }\n },\n [kWriteToConsole]: {\n ...consolePropAttributes,\n value: function(streamSymbol, string) {\n const ignoreErrors = this._ignoreErrors, groupIndent = this[kGroupIndent], useStdout = streamSymbol === kUseStdout, stream = useStdout \? this._stdout : this._stderr, errorHandler = useStdout \? this._stdoutErrorHandler : this._stderrErrorHandler;\n if (groupIndent.length !== 0) {\n if (StringPrototypeIncludes.@call(string, \"\\n\"))\n string = RegExpPrototypeSymbolReplace.@call(/\\n/g, string, `\\n${groupIndent}`);\n string = groupIndent + string;\n }\n if (string += \"\\n\", ignoreErrors === !1)\n return stream.write(string);\n try {\n if (stream.listenerCount(\"error\") === 0)\n stream.once(\"error\", noop);\n stream.write(string, errorHandler);\n } catch (e) {\n } finally {\n stream.removeListener(\"error\", noop);\n }\n }\n },\n [kGetInspectOptions]: {\n ...consolePropAttributes,\n value: function(stream) {\n let color = this[kColorMode];\n if (color === \"auto\")\n if (process.env.FORCE_COLOR !== @undefined)\n color = Bun.enableANSIColors;\n else\n color = stream.isTTY && (typeof stream.getColorDepth === \"function\" \? stream.getColorDepth() > 2 : !0);\n const options = optionsMap.get(this);\n if (options) {\n if (options.colors === @undefined)\n options.colors = color;\n return options;\n }\n return color \? kColorInspectOptions : kNoColorInspectOptions;\n }\n },\n [kFormatForStdout]: {\n ...consolePropAttributes,\n value: function(args) {\n const opts = this[kGetInspectOptions](this._stdout);\n return formatWithOptions(opts, ...args);\n }\n },\n [kFormatForStderr]: {\n ...consolePropAttributes,\n value: function(args) {\n const opts = this[kGetInspectOptions](this._stderr);\n return formatWithOptions(opts, ...args);\n }\n }\n });\n function createWriteErrorHandler(instance, streamSymbol) {\n return (err) => {\n const stream = streamSymbol === kUseStdout \? instance._stdout : instance._stderr;\n if (err !== null && !stream._writableState.errorEmitted) {\n if (stream.listenerCount(\"error\") === 0)\n stream.once(\"error\", noop);\n }\n };\n }\n const consoleMethods = {\n log(...args) {\n this[kWriteToConsole](kUseStdout, this[kFormatForStdout](args));\n },\n warn(...args) {\n this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args));\n },\n dir(object, options) {\n this[kWriteToConsole](kUseStdout, inspect(object, {\n customInspect: !1,\n ...this[kGetInspectOptions](this._stdout),\n ...options\n }));\n },\n time(label = \"default\") {\n if (label = `${label}`, this._times.has(label)) {\n process.emitWarning(`Label '${label}' already exists for console.time()`);\n return;\n }\n this._times.set(label, process.hrtime());\n },\n timeEnd(label = \"default\") {\n if (label = `${label}`, timeLogImpl(this, \"timeEnd\", label))\n this._times.delete(label);\n },\n timeLog(label = \"default\", ...data) {\n label = `${label}`, timeLogImpl(this, \"timeLog\", label, data);\n },\n trace: function trace(...args) {\n const err = {\n name: \"Trace\",\n message: this[kFormatForStderr](args)\n };\n Error.captureStackTrace(err, trace), this.error(err.stack);\n },\n assert(expression, ...args) {\n if (!expression)\n args[0] = `Assertion failed${args.length === 0 \? \"\" : `: ${args[0]}`}`, this.warn.@apply(this, args);\n },\n clear() {\n if (this._stdout.isTTY && process.env.TERM !== \"dumb\")\n this._stdout.write(\"\\x1B[2J\"), this._stdout.write(\"\\x1B[0f\");\n },\n count(label = \"default\") {\n label = `${label}`;\n const counts = this[kCounts];\n let count = counts.get(label);\n if (count === @undefined)\n count = 1;\n else\n count++;\n counts.set(label, count), this.log(`${label}: ${count}`);\n },\n countReset(label = \"default\") {\n const counts = this[kCounts];\n if (!counts.has(label)) {\n process.emitWarning(`Count for '${label}' does not exist`);\n return;\n }\n counts.delete(`${label}`);\n },\n group(...data) {\n if (data.length > 0)\n this.log.@apply(this, data);\n this[kGroupIndent] += StringPrototypeRepeat.@call(\" \", this[kGroupIndentationWidth]);\n },\n groupEnd() {\n this[kGroupIndent] = StringPrototypeSlice.@call(this[kGroupIndent], 0, this[kGroupIndent].length - this[kGroupIndentationWidth]);\n },\n table(tabularData, properties) {\n if (tabularData === null || typeof tabularData !== \"object\")\n return this.log(tabularData);\n const final = (k, v) => this.log(table(k, v)), _inspect = (v) => {\n const opt = {\n depth: v !== null && typeof v === \"object\" && !isArray(v) && Object.keys(v).length > 2 \? -1 : 0,\n maxArrayLength: 3,\n breakLength: @Infinity,\n ...this[kGetInspectOptions](this._stdout)\n };\n return inspect(v, opt);\n }, getIndexArray = (length) => @Array.from({ length }, (_, i2) => _inspect(i2)), mapIter = @isMapIterator(tabularData);\n let isKeyValue = !1, i = 0;\n if (isKeyValue || @isMap(tabularData)) {\n const keys2 = [], values2 = [];\n let length = 0;\n if (mapIter)\n for (;i < tabularData.length / 2; ++i)\n ArrayPrototypePush.@call(keys2, _inspect(tabularData[i * 2])), ArrayPrototypePush.@call(values2, _inspect(tabularData[i * 2 + 1])), length++;\n else\n for (let { 0: k, 1: v } of tabularData)\n ArrayPrototypePush.@call(keys2, _inspect(k)), ArrayPrototypePush.@call(values2, _inspect(v)), length++;\n return final([iterKey, keyKey, valuesKey], [getIndexArray(length), keys2, values2]);\n }\n if (@isSetIterator(tabularData) || mapIter || @isSet(tabularData)) {\n const values2 = [];\n let length = 0;\n for (let v of tabularData)\n ArrayPrototypePush.@call(values2, _inspect(v)), length++;\n return final([iterKey, valuesKey], [getIndexArray(length), values2]);\n }\n const map = { __proto__: null };\n let hasPrimitives = !1;\n const valuesKeyArray = [], indexKeyArray = Object.keys(tabularData);\n for (;i < indexKeyArray.length; i++) {\n const item = tabularData[indexKeyArray[i]], primitive = item === null || typeof item !== \"function\" && typeof item !== \"object\";\n if (properties === @undefined && primitive)\n hasPrimitives = !0, valuesKeyArray[i] = _inspect(item);\n else {\n const keys2 = properties || Object.keys(item);\n for (let key of keys2)\n if (map[key] \?\?= [], primitive && properties || !ObjectPrototypeHasOwnProperty.@call(item, key))\n map[key][i] = \"\";\n else\n map[key][i] = _inspect(item[key]);\n }\n }\n const keys = Object.keys(map), values = Object.values(map);\n if (hasPrimitives)\n ArrayPrototypePush.@call(keys, valuesKey), ArrayPrototypePush.@call(values, valuesKeyArray);\n return ArrayPrototypeUnshift.@call(keys, indexKey), ArrayPrototypeUnshift.@call(values, indexKeyArray), final(keys, values);\n }\n };\n function timeLogImpl(self, name, label, data) {\n const time = self._times.get(label);\n if (time === @undefined)\n return process.emitWarning(`No such label '${label}' for console.${name}()`), !1;\n const duration = process.hrtime(time), ms = duration[0] * 1000 + duration[1] / 1e6, formatted = formatTime(ms);\n if (data === @undefined)\n self.log(\"%s: %s\", label, formatted);\n else\n self.log(\"%s: %s\", label, formatted, ...data);\n return !0;\n }\n function pad(value) {\n return StringPrototypePadStart.@call(`${value}`, 2, \"0\");\n }\n function formatTime(ms) {\n let hours = 0, minutes = 0, seconds = 0;\n if (ms >= 1000) {\n if (ms >= 60000) {\n if (ms >= 3600000)\n hours = Math.floor(ms / 3600000), ms = ms % 3600000;\n minutes = Math.floor(ms / 60000), ms = ms % 60000;\n }\n seconds = ms / 1000;\n }\n if (hours !== 0 || minutes !== 0)\n return { 0: seconds, 1: ms } = StringPrototypeSplit.@call(NumberPrototypeToFixed.@call(seconds, 3), \".\"), `${hours !== 0 \? `${hours}:${pad(minutes)}` : minutes}:${pad(seconds)}.${ms} (${hours !== 0 \? \"h:m\" : \"\"}m:ss.mmm)`;\n if (seconds !== 0)\n return `${NumberPrototypeToFixed.@call(seconds, 3)}s`;\n return `${Number(NumberPrototypeToFixed.@call(ms, 3))}ms`;\n }\n const keyKey = \"Key\", valuesKey = \"Values\", indexKey = \"(index)\", iterKey = \"(iteration index)\", isArray = (v) => @isJSArray(v) || @isTypedArrayView(v) || isBuffer(v);\n function noop() {\n }\n for (let method of Reflect.ownKeys(consoleMethods))\n Console.prototype[method] = consoleMethods[method];\n return Console.prototype.debug = Console.prototype.log, Console.prototype.info = Console.prototype.log, Console.prototype.dirxml = Console.prototype.log, Console.prototype.error = Console.prototype.warn, Console.prototype.groupCollapsed = Console.prototype.group, Console;\n})\n";
-// acquireWritableStreamDefaultWriter
-const JSC::ConstructAbility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeLength = 82;
-static const JSC::Intrinsic s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsAcquireWritableStreamDefaultWriterCode = "(function (stream){\"use strict\";return new @WritableStreamDefaultWriter(stream)})\n";
+// write
+const JSC::ConstructAbility s_consoleObjectWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_consoleObjectWriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_consoleObjectWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_consoleObjectWriteCodeLength = 467;
+static const JSC::Intrinsic s_consoleObjectWriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_consoleObjectWriteCode = "(function (input) {\"use strict\";\n var writer = @getByIdDirectPrivate(this, \"writer\");\n if (!writer) {\n var length = @toLength(input\?.length \?\? 0);\n writer = Bun.stdout.writer({ highWaterMark: length > 65536 \? length : 65536 }), @putByIdDirectPrivate(this, \"writer\", writer);\n }\n var wrote = writer.write(input);\n const count = @argumentCount();\n for (var i = 1;i < count; i++)\n wrote += writer.write(arguments[i]);\n return writer.flush(!0), wrote;\n})\n";
-// createWritableStream
-const JSC::ConstructAbility s_writableStreamInternalsCreateWritableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsCreateWritableStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsCreateWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsCreateWritableStreamCodeLength = 453;
-static const JSC::Intrinsic s_writableStreamInternalsCreateWritableStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsCreateWritableStreamCode = "(function (startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,highWaterMark,sizeAlgorithm){\"use strict\";const internalStream={};@initializeWritableStreamSlots(internalStream,{});const controller=new @WritableStreamDefaultController;return @setUpWritableStreamDefaultController(internalStream,controller,startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,highWaterMark,sizeAlgorithm),@createWritableStreamFromInternal(internalStream)})\n";
+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
+{\
+ JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
+ return clientData->builtinFunctions().consoleObjectBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().consoleObjectBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+}
+WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
-// createInternalWritableStreamFromUnderlyingSink
-const JSC::ConstructAbility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeLength = 1388;
-static const JSC::Intrinsic s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode = "(function (underlyingSink,strategy){\"use strict\";const stream={};if(underlyingSink===@undefined)underlyingSink={};if(strategy===@undefined)strategy={};if(!@isObject(underlyingSink))@throwTypeError(\"WritableStream constructor takes an object as first argument\");if(\"type\"in underlyingSink)@throwRangeError(\"Invalid type is specified\");const sizeAlgorithm=@extractSizeAlgorithm(strategy),highWaterMark=@extractHighWaterMark(strategy,1),underlyingSinkDict={};if(\"start\"in underlyingSink){if(underlyingSinkDict.start=underlyingSink.start,typeof underlyingSinkDict.start!==\"function\")@throwTypeError(\"underlyingSink.start should be a function\")}if(\"write\"in underlyingSink){if(underlyingSinkDict.write=underlyingSink.write,typeof underlyingSinkDict.write!==\"function\")@throwTypeError(\"underlyingSink.write should be a function\")}if(\"close\"in underlyingSink){if(underlyingSinkDict.close=underlyingSink.close,typeof underlyingSinkDict.close!==\"function\")@throwTypeError(\"underlyingSink.close should be a function\")}if(\"abort\"in underlyingSink){if(underlyingSinkDict.abort=underlyingSink.abort,typeof underlyingSinkDict.abort!==\"function\")@throwTypeError(\"underlyingSink.abort should be a function\")}return @initializeWritableStreamSlots(stream,underlyingSink),@setUpWritableStreamDefaultControllerFromUnderlyingSink(stream,underlyingSink,underlyingSinkDict,highWaterMark,sizeAlgorithm),stream})\n";
+/* CountQueuingStrategy.ts */
+// highWaterMark
+const JSC::ConstructAbility s_countQueuingStrategyHighWaterMarkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_countQueuingStrategyHighWaterMarkCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_countQueuingStrategyHighWaterMarkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_countQueuingStrategyHighWaterMarkCodeLength = 264;
+static const JSC::Intrinsic s_countQueuingStrategyHighWaterMarkCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_countQueuingStrategyHighWaterMarkCode = "(function () {\"use strict\";\n const highWaterMark = @getByIdDirectPrivate(this, \"highWaterMark\");\n if (highWaterMark === @undefined)\n @throwTypeError(\"CountQueuingStrategy.highWaterMark getter called on incompatible |this| value.\");\n return highWaterMark;\n})\n";
-// initializeWritableStreamSlots
-const JSC::ConstructAbility s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsInitializeWritableStreamSlotsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsInitializeWritableStreamSlotsCodeLength = 674;
-static const JSC::Intrinsic s_writableStreamInternalsInitializeWritableStreamSlotsCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsInitializeWritableStreamSlotsCode = "(function (stream,underlyingSink){\"use strict\";@putByIdDirectPrivate(stream,\"state\",\"writable\"),@putByIdDirectPrivate(stream,\"storedError\",@undefined),@putByIdDirectPrivate(stream,\"writer\",@undefined),@putByIdDirectPrivate(stream,\"controller\",@undefined),@putByIdDirectPrivate(stream,\"inFlightWriteRequest\",@undefined),@putByIdDirectPrivate(stream,\"closeRequest\",@undefined),@putByIdDirectPrivate(stream,\"inFlightCloseRequest\",@undefined),@putByIdDirectPrivate(stream,\"pendingAbortRequest\",@undefined),@putByIdDirectPrivate(stream,\"writeRequests\",@createFIFO()),@putByIdDirectPrivate(stream,\"backpressure\",!1),@putByIdDirectPrivate(stream,\"underlyingSink\",underlyingSink)})\n";
+// initializeCountQueuingStrategy
+const JSC::ConstructAbility s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_countQueuingStrategyInitializeCountQueuingStrategyCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_countQueuingStrategyInitializeCountQueuingStrategyCodeLength = 147;
+static const JSC::Intrinsic s_countQueuingStrategyInitializeCountQueuingStrategyCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_countQueuingStrategyInitializeCountQueuingStrategyCode = "(function (parameters) {\"use strict\";\n @putByIdDirectPrivate(this, \"highWaterMark\", @extractHighWaterMarkFromQueuingStrategyInit(parameters));\n})\n";
-// writableStreamCloseForBindings
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseForBindingsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamCloseForBindingsCodeLength = 390;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamCloseForBindingsCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamCloseForBindingsCode = "(function (stream){\"use strict\";if(@isWritableStreamLocked(stream))return @Promise.@reject(@makeTypeError(\"WritableStream.close method can only be used on non locked WritableStream\"));if(@writableStreamCloseQueuedOrInFlight(stream))return @Promise.@reject(@makeTypeError(\"WritableStream.close method can only be used on a being close WritableStream\"));return @writableStreamClose(stream)})\n";
+// size
+const JSC::ConstructAbility s_countQueuingStrategySizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_countQueuingStrategySizeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_countQueuingStrategySizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_countQueuingStrategySizeCodeLength = 43;
+static const JSC::Intrinsic s_countQueuingStrategySizeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_countQueuingStrategySizeCode = "(function () {\"use strict\";\n return 1;\n})\n";
-// writableStreamAbortForBindings
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortForBindingsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamAbortForBindingsCodeLength = 236;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAbortForBindingsCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamAbortForBindingsCode = "(function (stream,reason){\"use strict\";if(@isWritableStreamLocked(stream))return @Promise.@reject(@makeTypeError(\"WritableStream.abort method can only be used on non locked WritableStream\"));return @writableStreamAbort(stream,reason)})\n";
+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
+{\
+ JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
+ return clientData->builtinFunctions().countQueuingStrategyBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().countQueuingStrategyBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+}
+WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
-// isWritableStreamLocked
-const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamLockedCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamLockedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsIsWritableStreamLockedCodeLength = 93;
-static const JSC::Intrinsic s_writableStreamInternalsIsWritableStreamLockedCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsIsWritableStreamLockedCode = "(function (stream){\"use strict\";return @getByIdDirectPrivate(stream,\"writer\")!==@undefined})\n";
+/* EventSource.ts */
+// getEventSource
+const JSC::ConstructAbility s_eventSourceGetEventSourceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_eventSourceGetEventSourceCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_eventSourceGetEventSourceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_eventSourceGetEventSourceCodeLength = 12373;
+static const JSC::Intrinsic s_eventSourceGetEventSourceCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_eventSourceGetEventSourceCode = "(function () {\"use strict\";\n\n class EventSource extends EventTarget {\n #url;\n #state;\n #onerror;\n #onmessage;\n #onopen;\n #is_tls = !1;\n #socket = null;\n #data_buffer = \"\";\n #send_buffer = \"\";\n #lastEventID = \"\";\n #reconnect = !0;\n #content_length = 0;\n #received_length = 0;\n #reconnection_time = 0;\n #reconnection_timer = null;\n static #ConnectNextTick(self) {\n self.#connect();\n }\n static #SendRequest(socket, url) {\n const self = socket.data, last_event_header = self.#lastEventID \? `Last-Event-ID: ${self.#lastEventID}\\r\\n` : \"\", request = `GET ${url.pathname}${url.search} HTTP/1.1\\r\\nHost: bun\\r\\nContent-type: text/event-stream\\r\\nContent-length: 0\\r\\n${last_event_header}\\r\\n`, sended = socket.write(request);\n if (sended !== request.length)\n self.#send_buffer = request.substring(sended);\n }\n static #ProcessChunk(self, chunks, offset) {\n for (;; ) {\n if (offset >= chunks.length)\n return;\n let chunk_end_idx = -1, start_idx = chunks.indexOf(\"\\r\\n\", offset);\n const chunk_start_idx = start_idx + 2;\n if (start_idx > 0)\n if (self.#content_length === 0) {\n const chunk_size = parseInt(chunks.substring(offset, start_idx), 16);\n if (chunk_size === 0) {\n self.#state = 2, self.#socket\?.end();\n return;\n }\n chunk_end_idx = chunk_start_idx + chunk_size;\n } else\n chunk_end_idx = chunks.length;\n else {\n if (self.#data_buffer.length === 0) {\n self.#data_buffer += chunks.substring(offset);\n return;\n }\n chunk_end_idx = chunks.length;\n }\n let chunk = chunks.substring(chunk_start_idx, chunk_end_idx);\n offset = chunk_end_idx + 2;\n let chunk_offset = 0, event_idx = chunk.indexOf(\"\\n\\n\");\n if (event_idx == -1) {\n self.#data_buffer += chunks.substring(chunk_start_idx);\n return;\n }\n if (self.#data_buffer.length)\n self.#data_buffer += chunk, chunk = self.#data_buffer, self.#data_buffer = \"\";\n let more_events = !0;\n while (more_events) {\n const event_data = chunk.substring(chunk_offset, event_idx);\n let type, data = \"\", id, event_line_idx = 0, retry = -1;\n for (;; ) {\n let idx = event_data.indexOf(\"\\n\", event_line_idx);\n if (idx === -1) {\n if (event_line_idx >= event_data.length)\n break;\n idx = event_data.length;\n }\n const line = event_data.substring(event_line_idx, idx);\n if (line.startsWith(\"data:\"))\n if (data.length)\n data += `\\n${line.substring(5).trim()}`;\n else\n data = line.substring(5).trim();\n else if (line.startsWith(\"event:\"))\n type = line.substring(6).trim();\n else if (line.startsWith(\"id:\"))\n id = line.substring(3).trim();\n else if (line.startsWith(\"retry:\")) {\n if (retry = parseInt(line.substring(6).trim(), 10), retry !== retry)\n retry = -1;\n }\n event_line_idx = idx + 1;\n }\n if (self.#lastEventID = id || \"\", retry >= 0)\n self.#reconnection_time = retry;\n if (data || id || type)\n self.dispatchEvent(new MessageEvent(type || \"message\", {\n data: data || \"\",\n origin: self.#url.origin,\n source: self,\n lastEventId: id\n }));\n if (chunk.length === event_idx + 2) {\n more_events = !1;\n break;\n }\n const next_event_idx = chunk.indexOf(\"\\n\\n\", event_idx + 1);\n if (next_event_idx === -1)\n break;\n chunk_offset = event_idx, event_idx = next_event_idx;\n }\n }\n }\n static #Handlers = {\n open(socket) {\n const self = socket.data;\n if (self.#socket = socket, !self.#is_tls)\n EventSource.#SendRequest(socket, self.#url);\n },\n handshake(socket, success, verifyError) {\n const self = socket.data;\n if (success)\n EventSource.#SendRequest(socket, self.#url);\n else\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", { error: verifyError })), socket.end();\n },\n data(socket, buffer) {\n const self = socket.data;\n switch (self.#state) {\n case 0: {\n let text = buffer.toString();\n const headers_idx = text.indexOf(\"\\r\\n\\r\\n\");\n if (headers_idx === -1) {\n self.#data_buffer += text;\n return;\n }\n if (self.#data_buffer.length)\n self.#data_buffer += text, text = self.#data_buffer, self.#data_buffer = \"\";\n const headers = text.substring(0, headers_idx), status_idx = headers.indexOf(\"\\r\\n\");\n if (status_idx === -1) {\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", { error: new Error(\"Invalid HTTP request\") })), socket.end();\n return;\n }\n const status = headers.substring(0, status_idx);\n if (status !== \"HTTP/1.1 200 OK\") {\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", { error: new Error(status) })), socket.end();\n return;\n }\n let start_idx = status_idx + 1, mime_type_ok = !1, content_length = -1;\n for (;; ) {\n let header_idx = headers.indexOf(\"\\r\\n\", start_idx);\n if (header_idx === -1) {\n if (start_idx >= headers.length) {\n if (!mime_type_ok)\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", {\n error: new Error(`EventSource's response has no MIME type and \"text/event-stream\" is required. Aborting the connection.`)\n })), socket.end();\n return;\n }\n header_idx = headers.length;\n }\n const header = headers.substring(start_idx + 1, header_idx), header_name_idx = header.indexOf(\":\"), header_name = header.substring(0, header_name_idx), is_content_type = header_name.localeCompare(\"content-type\", @undefined, { sensitivity: \"accent\" }) === 0;\n if (start_idx = header_idx + 1, is_content_type)\n if (header.endsWith(\" text/event-stream\"))\n mime_type_ok = !0;\n else {\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", {\n error: new Error(`EventSource's response has a MIME type that is not \"text/event-stream\". Aborting the connection.`)\n })), socket.end();\n return;\n }\n else if (header_name.localeCompare(\"content-length\", @undefined, { sensitivity: \"accent\" }) === 0) {\n if (content_length = parseInt(header.substring(header_name_idx + 1).trim(), 10), content_length !== content_length || content_length <= 0) {\n self.dispatchEvent(new ErrorEvent(\"error\", {\n error: new Error(\"EventSource's Content-Length is invalid. Aborting the connection.\")\n })), socket.end();\n return;\n }\n if (mime_type_ok)\n break;\n } else if (header_name.localeCompare(\"transfer-encoding\", @undefined, { sensitivity: \"accent\" }) === 0) {\n if (header.substring(header_name_idx + 1).trim() !== \"chunked\") {\n self.dispatchEvent(new ErrorEvent(\"error\", {\n error: new Error(\"EventSource's Transfer-Encoding is invalid. Aborting the connection.\")\n })), socket.end();\n return;\n }\n if (content_length = 0, mime_type_ok)\n break;\n }\n }\n self.#content_length = content_length, self.#state = 1, self.dispatchEvent(new Event(\"open\"));\n const chunks = text.substring(headers_idx + 4);\n if (EventSource.#ProcessChunk(self, chunks, 0), self.#content_length > 0) {\n if (self.#received_length += chunks.length, self.#received_length >= self.#content_length)\n self.#state = 2, socket.end();\n }\n return;\n }\n case 1:\n if (EventSource.#ProcessChunk(self, buffer.toString(), 2), self.#content_length > 0) {\n if (self.#received_length += buffer.byteLength, self.#received_length >= self.#content_length)\n self.#state = 2, socket.end();\n }\n return;\n default:\n break;\n }\n },\n drain(socket) {\n const self = socket.data;\n if (self.#state === 0) {\n const request = self.#data_buffer;\n if (request.length) {\n const sended = socket.write(request);\n if (sended !== request.length)\n socket.data.#send_buffer = request.substring(sended);\n else\n socket.data.#send_buffer = \"\";\n }\n }\n },\n close: EventSource.#Close,\n end(socket) {\n EventSource.#Close(socket).dispatchEvent(new ErrorEvent(\"error\", { error: new Error(\"Connection closed by server\") }));\n },\n timeout(socket) {\n EventSource.#Close(socket).dispatchEvent(new ErrorEvent(\"error\", { error: new Error(\"Timeout\") }));\n },\n binaryType: \"buffer\"\n };\n static #Close(socket) {\n const self = socket.data;\n if (self.#socket = null, self.#received_length = 0, self.#state = 2, self.#reconnect) {\n if (self.#reconnection_timer)\n clearTimeout(self.#reconnection_timer);\n self.#reconnection_timer = setTimeout(EventSource.#ConnectNextTick, self.#reconnection_time, self);\n }\n return self;\n }\n constructor(url, options = @undefined) {\n super();\n const uri = new URL(url);\n this.#is_tls = uri.protocol === \"https:\", this.#url = uri, this.#state = 2, process.nextTick(EventSource.#ConnectNextTick, this);\n }\n ref() {\n this.#reconnection_timer\?.ref(), this.#socket\?.ref();\n }\n unref() {\n this.#reconnection_timer\?.unref(), this.#socket\?.unref();\n }\n #connect() {\n if (this.#state !== 2)\n return;\n const uri = this.#url, is_tls = this.#is_tls;\n this.#state = 0, Bun.connect({\n data: this,\n socket: EventSource.#Handlers,\n hostname: uri.hostname,\n port: parseInt(uri.port || (is_tls \? \"443\" : \"80\"), 10),\n tls: is_tls \? {\n requestCert: !0,\n rejectUnauthorized: !1\n } : !1\n }).catch((err) => {\n if (super.dispatchEvent(new ErrorEvent(\"error\", { error: err })), this.#reconnect) {\n if (this.#reconnection_timer)\n this.#reconnection_timer.unref\?.();\n this.#reconnection_timer = setTimeout(EventSource.#ConnectNextTick, 1000, this);\n }\n });\n }\n get url() {\n return this.#url.href;\n }\n get readyState() {\n return this.#state;\n }\n close() {\n this.#reconnect = !1, this.#state = 2, this.#socket\?.unref(), this.#socket\?.end();\n }\n get onopen() {\n return this.#onopen;\n }\n get onerror() {\n return this.#onerror;\n }\n get onmessage() {\n return this.#onmessage;\n }\n set onopen(cb) {\n if (this.#onopen)\n super.removeEventListener(\"close\", this.#onopen);\n super.addEventListener(\"open\", cb), this.#onopen = cb;\n }\n set onerror(cb) {\n if (this.#onerror)\n super.removeEventListener(\"error\", this.#onerror);\n super.addEventListener(\"error\", cb), this.#onerror = cb;\n }\n set onmessage(cb) {\n if (this.#onmessage)\n super.removeEventListener(\"message\", this.#onmessage);\n super.addEventListener(\"message\", cb), this.#onmessage = cb;\n }\n }\n return Object.defineProperty(EventSource.prototype, \"CONNECTING\", {\n enumerable: !0,\n value: 0\n }), Object.defineProperty(EventSource.prototype, \"OPEN\", {\n enumerable: !0,\n value: 1\n }), Object.defineProperty(EventSource.prototype, \"CLOSED\", {\n enumerable: !0,\n value: 2\n }), EventSource;\n})\n";
-// setUpWritableStreamDefaultWriter
-const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeLength = 1249;
-static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsSetUpWritableStreamDefaultWriterCode = "(function (writer,stream){\"use strict\";if(@isWritableStreamLocked(stream))@throwTypeError(\"WritableStream is locked\");@putByIdDirectPrivate(writer,\"stream\",stream),@putByIdDirectPrivate(stream,\"writer\",writer);const readyPromiseCapability=@newPromiseCapability(@Promise),closedPromiseCapability=@newPromiseCapability(@Promise);@putByIdDirectPrivate(writer,\"readyPromise\",readyPromiseCapability),@putByIdDirectPrivate(writer,\"closedPromise\",closedPromiseCapability);const state=@getByIdDirectPrivate(stream,\"state\");if(state===\"writable\"){if(@writableStreamCloseQueuedOrInFlight(stream)||!@getByIdDirectPrivate(stream,\"backpressure\"))readyPromiseCapability.resolve.@call()}else if(state===\"erroring\")readyPromiseCapability.reject.@call(@undefined,@getByIdDirectPrivate(stream,\"storedError\")),@markPromiseAsHandled(readyPromiseCapability.promise);else if(state===\"closed\")readyPromiseCapability.resolve.@call(),closedPromiseCapability.resolve.@call();else{const storedError=@getByIdDirectPrivate(stream,\"storedError\");readyPromiseCapability.reject.@call(@undefined,storedError),@markPromiseAsHandled(readyPromiseCapability.promise),closedPromiseCapability.reject.@call(@undefined,storedError),@markPromiseAsHandled(closedPromiseCapability.promise)}})\n";
+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
+{\
+ JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
+ return clientData->builtinFunctions().eventSourceBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().eventSourceBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+}
+WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
-// writableStreamAbort
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamAbortCodeLength = 679;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAbortCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamAbortCode = "(function (stream,reason){\"use strict\";const state=@getByIdDirectPrivate(stream,\"state\");if(state===\"closed\"||state===\"errored\")return @Promise.@resolve();const pendingAbortRequest=@getByIdDirectPrivate(stream,\"pendingAbortRequest\");if(pendingAbortRequest!==@undefined)return pendingAbortRequest.promise.promise;let wasAlreadyErroring=!1;if(state===\"erroring\")wasAlreadyErroring=!0,reason=@undefined;const abortPromiseCapability=@newPromiseCapability(@Promise);if(@putByIdDirectPrivate(stream,\"pendingAbortRequest\",{promise:abortPromiseCapability,reason,wasAlreadyErroring}),!wasAlreadyErroring)@writableStreamStartErroring(stream,reason);return abortPromiseCapability.promise})\n";
+/* ImportMetaObject.ts */
+// createRequireCache
+const JSC::ConstructAbility s_importMetaObjectCreateRequireCacheCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_importMetaObjectCreateRequireCacheCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_importMetaObjectCreateRequireCacheCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_importMetaObjectCreateRequireCacheCodeLength = 1353;
+static const JSC::Intrinsic s_importMetaObjectCreateRequireCacheCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_importMetaObjectCreateRequireCacheCode = "(function () {\"use strict\";\n var moduleMap = new Map, inner = {};\n return new Proxy(inner, {\n get(target, key) {\n const entry = @requireMap.@get(key);\n if (entry)\n return entry;\n const esm = @Loader.registry.@get(key);\n if (esm\?.evaluated) {\n const namespace = @Loader.getModuleNamespaceObject(esm.module), mod = @createCommonJSModule(key, namespace, !0, @undefined);\n return @requireMap.@set(key, mod), mod;\n }\n return inner[key];\n },\n set(target, key, value) {\n return @requireMap.@set(key, value), !0;\n },\n has(target, key) {\n return @requireMap.@has(key) || Boolean(@Loader.registry.@get(key)\?.evaluated);\n },\n deleteProperty(target, key) {\n return moduleMap.@delete(key), @requireMap.@delete(key), @Loader.registry.@delete(key), !0;\n },\n ownKeys(target) {\n var array = [...@requireMap.@keys()];\n for (let key of @Loader.registry.@keys())\n if (!array.includes(key) && @Loader.registry.@get(key)\?.evaluated)\n @arrayPush(array, key);\n return array;\n },\n getPrototypeOf(target) {\n return null;\n },\n getOwnPropertyDescriptor(target, key) {\n if (@requireMap.@has(key) || @Loader.registry.@get(key)\?.evaluated)\n return {\n configurable: !0,\n enumerable: !0\n };\n }\n });\n})\n";
-// writableStreamClose
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamCloseCodeLength = 674;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamCloseCode = "(function (stream){\"use strict\";const state=@getByIdDirectPrivate(stream,\"state\");if(state===\"closed\"||state===\"errored\")return @Promise.@reject(@makeTypeError(\"Cannot close a writable stream that is closed or errored\"));const closePromiseCapability=@newPromiseCapability(@Promise);@putByIdDirectPrivate(stream,\"closeRequest\",closePromiseCapability);const writer=@getByIdDirectPrivate(stream,\"writer\");if(writer!==@undefined&&@getByIdDirectPrivate(stream,\"backpressure\")&&state===\"writable\")@getByIdDirectPrivate(writer,\"readyPromise\").resolve.@call();return @writableStreamDefaultControllerClose(@getByIdDirectPrivate(stream,\"controller\")),closePromiseCapability.promise})\n";
+// internalRequire
+const JSC::ConstructAbility s_importMetaObjectInternalRequireCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_importMetaObjectInternalRequireCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_importMetaObjectInternalRequireCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_importMetaObjectInternalRequireCodeLength = 1058;
+static const JSC::Intrinsic s_importMetaObjectInternalRequireCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_importMetaObjectInternalRequireCode = "(function (id) {\"use strict\";\n var cached = @requireMap.@get(id);\n const last5 = id.substring(id.length - 5);\n if (cached)\n return cached.exports;\n if (last5 === \".json\") {\n var fs = globalThis[Symbol.for(\"_fs\")] ||= Bun.fs(), exports = JSON.parse(fs.readFileSync(id, \"utf8\"));\n return @requireMap.@set(id, @createCommonJSModule(id, exports, !0, @undefined)), exports;\n } else if (last5 === \".node\") {\n const module = @createCommonJSModule(id, {}, !0, @undefined);\n return process.dlopen(module, id), @requireMap.@set(id, module), module.exports;\n } else if (last5 === \".toml\") {\n var fs = globalThis[Symbol.for(\"_fs\")] ||= Bun.fs(), exports = Bun.TOML.parse(fs.readFileSync(id, \"utf8\"));\n return @requireMap.@set(id, @createCommonJSModule(id, exports, !0, @undefined)), exports;\n } else {\n var exports = @requireESM(id);\n const cachedModule = @requireMap.@get(id);\n if (cachedModule)\n return cachedModule.exports;\n return @requireMap.@set(id, @createCommonJSModule(id, exports, !0, @undefined)), exports;\n }\n})\n";
-// writableStreamAddWriteRequest
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAddWriteRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamAddWriteRequestCodeLength = 208;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAddWriteRequestCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamAddWriteRequestCode = "(function (stream){\"use strict\";const writePromiseCapability=@newPromiseCapability(@Promise);return @getByIdDirectPrivate(stream,\"writeRequests\").push(writePromiseCapability),writePromiseCapability.promise})\n";
+// loadCJS2ESM
+const JSC::ConstructAbility s_importMetaObjectLoadCJS2ESMCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_importMetaObjectLoadCJS2ESMCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_importMetaObjectLoadCJS2ESMCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_importMetaObjectLoadCJS2ESMCodeLength = 2569;
+static const JSC::Intrinsic s_importMetaObjectLoadCJS2ESMCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_importMetaObjectLoadCJS2ESMCode = "(function (resolvedSpecifier) {\"use strict\";\n var loader = @Loader, queue = @createFIFO(), key = resolvedSpecifier;\n while (key) {\n var entry = loader.registry.@get(key);\n if ((entry\?.state \?\? 0) <= @ModuleFetch)\n @fulfillModuleSync(key), entry = loader.registry.@get(key);\n var sourceCodeObject = @getPromiseInternalField(entry.fetch, @promiseFieldReactionsOrResult), moduleRecordPromise = loader.parseModule(key, sourceCodeObject), mod = entry.module;\n if (moduleRecordPromise && @isPromise(moduleRecordPromise)) {\n var reactionsOrResult = @getPromiseInternalField(moduleRecordPromise, @promiseFieldReactionsOrResult), flags = @getPromiseInternalField(moduleRecordPromise, @promiseFieldFlags), state = flags & @promiseStateMask;\n if (state === @promiseStatePending || reactionsOrResult && @isPromise(reactionsOrResult))\n @throwTypeError(`require() async module \"${key}\" is unsupported. use \"await import()\" instead.`);\n else if (state === @promiseStateRejected) {\n if (!reactionsOrResult\?.message)\n @throwTypeError(`${reactionsOrResult + \"\" \? reactionsOrResult : \"An error occurred\"} occurred while parsing module \\\"${key}\\\"`);\n throw reactionsOrResult;\n }\n entry.module = mod = reactionsOrResult;\n } else if (moduleRecordPromise && !mod)\n entry.module = mod = moduleRecordPromise;\n @setStateToMax(entry, @ModuleLink);\n var dependenciesMap = mod.dependenciesMap, requestedModules = loader.requestedModules(mod), dependencies = @newArrayWithSize(requestedModules.length);\n for (var i = 0, length = requestedModules.length;i < length; ++i) {\n var depName = requestedModules[i], depKey = depName[0] === \"/\" \? depName : loader.resolve(depName, key), depEntry = loader.ensureRegistered(depKey);\n if (depEntry.state < @ModuleLink)\n queue.push(depKey);\n @putByValDirect(dependencies, i, depEntry), dependenciesMap.@set(depName, depEntry);\n }\n entry.dependencies = dependencies, entry.instantiate = @Promise.@resolve(entry), entry.satisfy = @Promise.@resolve(entry), entry.isSatisfied = !0, key = queue.shift();\n while (key && (loader.registry.@get(key)\?.state \?\? @ModuleFetch) >= @ModuleLink)\n key = queue.shift();\n }\n var linkAndEvaluateResult = loader.linkAndEvaluateModule(resolvedSpecifier, @undefined);\n if (linkAndEvaluateResult && @isPromise(linkAndEvaluateResult))\n @throwTypeError(`require() async module \\\"${resolvedSpecifier}\\\" is unsupported. use \"await import()\" instead.`);\n return loader.registry.@get(resolvedSpecifier);\n})\n";
-// writableStreamCloseQueuedOrInFlight
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeLength = 166;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCode = "(function (stream){\"use strict\";return @getByIdDirectPrivate(stream,\"closeRequest\")!==@undefined||@getByIdDirectPrivate(stream,\"inFlightCloseRequest\")!==@undefined})\n";
+// main
+const JSC::ConstructAbility s_importMetaObjectMainCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_importMetaObjectMainCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_importMetaObjectMainCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_importMetaObjectMainCodeLength = 84;
+static const JSC::Intrinsic s_importMetaObjectMainCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_importMetaObjectMainCode = "(function () {\"use strict\";\n return this.path === Bun.main && Bun.isMainThread;\n})\n";
-// writableStreamDealWithRejection
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDealWithRejectionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDealWithRejectionCodeLength = 183;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDealWithRejectionCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDealWithRejectionCode = "(function (stream,error){\"use strict\";if(@getByIdDirectPrivate(stream,\"state\")===\"writable\"){@writableStreamStartErroring(stream,error);return}@writableStreamFinishErroring(stream)})\n";
+// requireESM
+const JSC::ConstructAbility s_importMetaObjectRequireESMCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_importMetaObjectRequireESMCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_importMetaObjectRequireESMCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_importMetaObjectRequireESMCodeLength = 406;
+static const JSC::Intrinsic s_importMetaObjectRequireESMCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_importMetaObjectRequireESMCode = "(function (resolved) {\"use strict\";\n var entry = @Loader.registry.@get(resolved);\n if (!entry || !entry.evaluated)\n entry = @loadCJS2ESM(resolved);\n if (!entry || !entry.evaluated || !entry.module)\n @throwTypeError(`require() failed to evaluate module \"${resolved}\". This is an internal consistentency error.`);\n var exports = @Loader.getModuleNamespaceObject(entry.module);\n return exports;\n})\n";
-// writableStreamFinishErroring
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishErroringCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishErroringCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishErroringCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamFinishErroringCodeLength = 1193;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishErroringCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamFinishErroringCode = "(function (stream){\"use strict\";@putByIdDirectPrivate(stream,\"state\",\"errored\");const controller=@getByIdDirectPrivate(stream,\"controller\");@getByIdDirectPrivate(controller,\"errorSteps\").@call();const storedError=@getByIdDirectPrivate(stream,\"storedError\"),requests=@getByIdDirectPrivate(stream,\"writeRequests\");for(var request=requests.shift();request;request=requests.shift())request.reject.@call(@undefined,storedError);@putByIdDirectPrivate(stream,\"writeRequests\",@createFIFO());const abortRequest=@getByIdDirectPrivate(stream,\"pendingAbortRequest\");if(abortRequest===@undefined){@writableStreamRejectCloseAndClosedPromiseIfNeeded(stream);return}if(@putByIdDirectPrivate(stream,\"pendingAbortRequest\",@undefined),abortRequest.wasAlreadyErroring){abortRequest.promise.reject.@call(@undefined,storedError),@writableStreamRejectCloseAndClosedPromiseIfNeeded(stream);return}@getByIdDirectPrivate(controller,\"abortSteps\").@call(@undefined,abortRequest.reason).@then(()=>{abortRequest.promise.resolve.@call(),@writableStreamRejectCloseAndClosedPromiseIfNeeded(stream)},(reason)=>{abortRequest.promise.reject.@call(@undefined,reason),@writableStreamRejectCloseAndClosedPromiseIfNeeded(stream)})})\n";
+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
+{\
+ JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
+ return clientData->builtinFunctions().importMetaObjectBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().importMetaObjectBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+}
+WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
-// writableStreamFinishInFlightClose
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeLength = 661;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseCode = "(function (stream){\"use strict\";if(@getByIdDirectPrivate(stream,\"inFlightCloseRequest\").resolve.@call(),@putByIdDirectPrivate(stream,\"inFlightCloseRequest\",@undefined),@getByIdDirectPrivate(stream,\"state\")===\"erroring\"){@putByIdDirectPrivate(stream,\"storedError\",@undefined);const abortRequest=@getByIdDirectPrivate(stream,\"pendingAbortRequest\");if(abortRequest!==@undefined)abortRequest.promise.resolve.@call(),@putByIdDirectPrivate(stream,\"pendingAbortRequest\",@undefined)}@putByIdDirectPrivate(stream,\"state\",\"closed\");const writer=@getByIdDirectPrivate(stream,\"writer\");if(writer!==@undefined)@getByIdDirectPrivate(writer,\"closedPromise\").resolve.@call()})\n";
+/* JSBufferConstructor.ts */
+// from
+const JSC::ConstructAbility s_jsBufferConstructorFromCodeConstructAbility = JSC::ConstructAbility::CanConstruct;
+const JSC::ConstructorKind s_jsBufferConstructorFromCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferConstructorFromCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferConstructorFromCodeLength = 1538;
+static const JSC::Intrinsic s_jsBufferConstructorFromCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferConstructorFromCode = "(function (items) {\"use strict\";\n if (@isUndefinedOrNull(items))\n @throwTypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.\");\n if (typeof items === \"string\" || typeof items === \"object\" && (@isTypedArrayView(items) || items instanceof @ArrayBuffer || items instanceof SharedArrayBuffer || items instanceof @String))\n switch (@argumentCount()) {\n case 1:\n return new @Buffer(items);\n case 2:\n return new @Buffer(items, @argument(1));\n default:\n return new @Buffer(items, @argument(1), @argument(2));\n }\n var arrayLike = @toObject(items, \"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\");\n if (!@isJSArray(arrayLike)) {\n const toPrimitive = @tryGetByIdWithWellKnownSymbol(items, \"toPrimitive\");\n if (toPrimitive) {\n const primitive = toPrimitive.@call(items, \"string\");\n if (typeof primitive === \"string\")\n switch (@argumentCount()) {\n case 1:\n return new @Buffer(primitive);\n case 2:\n return new @Buffer(primitive, @argument(1));\n default:\n return new @Buffer(primitive, @argument(1), @argument(2));\n }\n }\n if (!(\"length\" in arrayLike) || @isCallable(arrayLike))\n @throwTypeError(\"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\");\n }\n return new @Buffer(@Uint8Array.from(arrayLike).buffer);\n})\n";
-// writableStreamFinishInFlightCloseWithError
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeLength = 494;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode = "(function (stream,error){\"use strict\";@getByIdDirectPrivate(stream,\"inFlightCloseRequest\").reject.@call(@undefined,error),@putByIdDirectPrivate(stream,\"inFlightCloseRequest\",@undefined);const state=@getByIdDirectPrivate(stream,\"state\"),abortRequest=@getByIdDirectPrivate(stream,\"pendingAbortRequest\");if(abortRequest!==@undefined)abortRequest.promise.reject.@call(@undefined,error),@putByIdDirectPrivate(stream,\"pendingAbortRequest\",@undefined);@writableStreamDealWithRejection(stream,error)})\n";
+// isBuffer
+const JSC::ConstructAbility s_jsBufferConstructorIsBufferCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferConstructorIsBufferCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferConstructorIsBufferCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferConstructorIsBufferCodeLength = 81;
+static const JSC::Intrinsic s_jsBufferConstructorIsBufferCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferConstructorIsBufferCode = "(function (bufferlike) {\"use strict\";\n return bufferlike instanceof @Buffer;\n})\n";
-// writableStreamFinishInFlightWrite
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeLength = 167;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteCode = "(function (stream){\"use strict\";@getByIdDirectPrivate(stream,\"inFlightWriteRequest\").resolve.@call(),@putByIdDirectPrivate(stream,\"inFlightWriteRequest\",@undefined)})\n";
+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
+{\
+ JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
+ return clientData->builtinFunctions().jsBufferConstructorBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().jsBufferConstructorBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+}
+WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
-// writableStreamFinishInFlightWriteWithError
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeLength = 285;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCode = "(function (stream,error){\"use strict\";@getByIdDirectPrivate(stream,\"inFlightWriteRequest\").reject.@call(@undefined,error),@putByIdDirectPrivate(stream,\"inFlightWriteRequest\",@undefined);const state=@getByIdDirectPrivate(stream,\"state\");@writableStreamDealWithRejection(stream,error)})\n";
+/* JSBufferPrototype.ts */
+// asciiSlice
+const JSC::ConstructAbility s_jsBufferPrototypeAsciiSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeAsciiSliceCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeAsciiSliceCodeLength = 86;
+static const JSC::Intrinsic s_jsBufferPrototypeAsciiSliceCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeAsciiSliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"ascii\", start, end);\n})\n";
-// writableStreamHasOperationMarkedInFlight
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeLength = 174;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCode = "(function (stream){\"use strict\";return @getByIdDirectPrivate(stream,\"inFlightWriteRequest\")!==@undefined||@getByIdDirectPrivate(stream,\"inFlightCloseRequest\")!==@undefined})\n";
+// asciiWrite
+const JSC::ConstructAbility s_jsBufferPrototypeAsciiWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeAsciiWriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeAsciiWriteCodeLength = 103;
+static const JSC::Intrinsic s_jsBufferPrototypeAsciiWriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeAsciiWriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"ascii\");\n})\n";
-// writableStreamMarkCloseRequestInFlight
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeLength = 220;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCode = "(function (stream){\"use strict\";const closeRequest=@getByIdDirectPrivate(stream,\"closeRequest\");@putByIdDirectPrivate(stream,\"inFlightCloseRequest\",closeRequest),@putByIdDirectPrivate(stream,\"closeRequest\",@undefined)})\n";
+// base64Slice
+const JSC::ConstructAbility s_jsBufferPrototypeBase64SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeBase64SliceCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeBase64SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeBase64SliceCodeLength = 87;
+static const JSC::Intrinsic s_jsBufferPrototypeBase64SliceCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeBase64SliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"base64\", start, end);\n})\n";
-// writableStreamMarkFirstWriteRequestInFlight
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeLength = 173;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCode = "(function (stream){\"use strict\";const writeRequest=@getByIdDirectPrivate(stream,\"writeRequests\").shift();@putByIdDirectPrivate(stream,\"inFlightWriteRequest\",writeRequest)})\n";
+// base64urlSlice
+const JSC::ConstructAbility s_jsBufferPrototypeBase64urlSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeBase64urlSliceCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeBase64urlSliceCodeLength = 90;
+static const JSC::Intrinsic s_jsBufferPrototypeBase64urlSliceCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeBase64urlSliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"base64url\", start, end);\n})\n";
-// writableStreamRejectCloseAndClosedPromiseIfNeeded
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeLength = 528;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode = "(function (stream){\"use strict\";const storedError=@getByIdDirectPrivate(stream,\"storedError\"),closeRequest=@getByIdDirectPrivate(stream,\"closeRequest\");if(closeRequest!==@undefined)closeRequest.reject.@call(@undefined,storedError),@putByIdDirectPrivate(stream,\"closeRequest\",@undefined);const writer=@getByIdDirectPrivate(stream,\"writer\");if(writer!==@undefined){const closedPromise=@getByIdDirectPrivate(writer,\"closedPromise\");closedPromise.reject.@call(@undefined,storedError),@markPromiseAsHandled(closedPromise.promise)}})\n";
+// base64urlWrite
+const JSC::ConstructAbility s_jsBufferPrototypeBase64urlWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeBase64urlWriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeBase64urlWriteCodeLength = 107;
+static const JSC::Intrinsic s_jsBufferPrototypeBase64urlWriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeBase64urlWriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"base64url\");\n})\n";
-// writableStreamStartErroring
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamStartErroringCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamStartErroringCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamStartErroringCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamStartErroringCodeLength = 487;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamStartErroringCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamStartErroringCode = "(function (stream,reason){\"use strict\";const controller=@getByIdDirectPrivate(stream,\"controller\");@putByIdDirectPrivate(stream,\"state\",\"erroring\"),@putByIdDirectPrivate(stream,\"storedError\",reason);const writer=@getByIdDirectPrivate(stream,\"writer\");if(writer!==@undefined)@writableStreamDefaultWriterEnsureReadyPromiseRejected(writer,reason);if(!@writableStreamHasOperationMarkedInFlight(stream)&&@getByIdDirectPrivate(controller,\"started\")===1)@writableStreamFinishErroring(stream)})\n";
+// base64Write
+const JSC::ConstructAbility s_jsBufferPrototypeBase64WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeBase64WriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeBase64WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeBase64WriteCodeLength = 104;
+static const JSC::Intrinsic s_jsBufferPrototypeBase64WriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeBase64WriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"base64\");\n})\n";
-// writableStreamUpdateBackpressure
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamUpdateBackpressureCodeLength = 400;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamUpdateBackpressureCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamUpdateBackpressureCode = "(function (stream,backpressure){\"use strict\";const writer=@getByIdDirectPrivate(stream,\"writer\");if(writer!==@undefined&&backpressure!==@getByIdDirectPrivate(stream,\"backpressure\"))if(backpressure)@putByIdDirectPrivate(writer,\"readyPromise\",@newPromiseCapability(@Promise));else @getByIdDirectPrivate(writer,\"readyPromise\").resolve.@call();@putByIdDirectPrivate(stream,\"backpressure\",backpressure)})\n";
+// hexSlice
+const JSC::ConstructAbility s_jsBufferPrototypeHexSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeHexSliceCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeHexSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeHexSliceCodeLength = 84;
+static const JSC::Intrinsic s_jsBufferPrototypeHexSliceCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeHexSliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"hex\", start, end);\n})\n";
-// writableStreamDefaultWriterAbort
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeLength = 136;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterAbortCode = "(function (writer,reason){\"use strict\";const stream=@getByIdDirectPrivate(writer,\"stream\");return @writableStreamAbort(stream,reason)})\n";
+// hexWrite
+const JSC::ConstructAbility s_jsBufferPrototypeHexWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeHexWriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeHexWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeHexWriteCodeLength = 101;
+static const JSC::Intrinsic s_jsBufferPrototypeHexWriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeHexWriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"hex\");\n})\n";
-// writableStreamDefaultWriterClose
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeLength = 122;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseCode = "(function (writer){\"use strict\";const stream=@getByIdDirectPrivate(writer,\"stream\");return @writableStreamClose(stream)})\n";
+// inspect
+const JSC::ConstructAbility s_jsBufferPrototypeInspectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeInspectCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeInspectCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeInspectCodeLength = 76;
+static const JSC::Intrinsic s_jsBufferPrototypeInspectCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeInspectCode = "(function (recurseTimes, ctx) {\"use strict\";\n return Bun.inspect(this);\n})\n";
-// writableStreamDefaultWriterCloseWithErrorPropagation
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeLength = 362;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCode = "(function (writer){\"use strict\";const stream=@getByIdDirectPrivate(writer,\"stream\"),state=@getByIdDirectPrivate(stream,\"state\");if(@writableStreamCloseQueuedOrInFlight(stream)||state===\"closed\")return @Promise.@resolve();if(state===\"errored\")return @Promise.@reject(@getByIdDirectPrivate(stream,\"storedError\"));return @writableStreamDefaultWriterClose(writer)})\n";
+// latin1Slice
+const JSC::ConstructAbility s_jsBufferPrototypeLatin1SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeLatin1SliceCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeLatin1SliceCodeLength = 87;
+static const JSC::Intrinsic s_jsBufferPrototypeLatin1SliceCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeLatin1SliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"latin1\", start, end);\n})\n";
-// writableStreamDefaultWriterEnsureClosedPromiseRejected
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeLength = 529;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode = "(function (writer,error){\"use strict\";let closedPromiseCapability=@getByIdDirectPrivate(writer,\"closedPromise\"),closedPromise=closedPromiseCapability.promise;if((@getPromiseInternalField(closedPromise,@promiseFieldFlags)&@promiseStateMask)!==@promiseStatePending)closedPromiseCapability=@newPromiseCapability(@Promise),closedPromise=closedPromiseCapability.promise,@putByIdDirectPrivate(writer,\"closedPromise\",closedPromiseCapability);closedPromiseCapability.reject.@call(@undefined,error),@markPromiseAsHandled(closedPromise)})\n";
+// latin1Write
+const JSC::ConstructAbility s_jsBufferPrototypeLatin1WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeLatin1WriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeLatin1WriteCodeLength = 104;
+static const JSC::Intrinsic s_jsBufferPrototypeLatin1WriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeLatin1WriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"latin1\");\n})\n";
-// writableStreamDefaultWriterEnsureReadyPromiseRejected
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeLength = 517;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode = "(function (writer,error){\"use strict\";let readyPromiseCapability=@getByIdDirectPrivate(writer,\"readyPromise\"),readyPromise=readyPromiseCapability.promise;if((@getPromiseInternalField(readyPromise,@promiseFieldFlags)&@promiseStateMask)!==@promiseStatePending)readyPromiseCapability=@newPromiseCapability(@Promise),readyPromise=readyPromiseCapability.promise,@putByIdDirectPrivate(writer,\"readyPromise\",readyPromiseCapability);readyPromiseCapability.reject.@call(@undefined,error),@markPromiseAsHandled(readyPromise)})\n";
+// offset
+const JSC::ConstructAbility s_jsBufferPrototypeOffsetCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeOffsetCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeOffsetCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeOffsetCodeLength = 115;
+static const JSC::Intrinsic s_jsBufferPrototypeOffsetCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeOffsetCode = "(function () {\"use strict\";\n return @isObject(this) && this instanceof @Buffer \? this.byteOffset : @undefined;\n})\n";
-// writableStreamDefaultWriterGetDesiredSize
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeLength = 310;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCode = "(function (writer){\"use strict\";const stream=@getByIdDirectPrivate(writer,\"stream\"),state=@getByIdDirectPrivate(stream,\"state\");if(state===\"errored\"||state===\"erroring\")return null;if(state===\"closed\")return 0;return @writableStreamDefaultControllerGetDesiredSize(@getByIdDirectPrivate(stream,\"controller\"))})\n";
+// parent
+const JSC::ConstructAbility s_jsBufferPrototypeParentCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeParentCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeParentCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeParentCodeLength = 111;
+static const JSC::Intrinsic s_jsBufferPrototypeParentCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeParentCode = "(function () {\"use strict\";\n return @isObject(this) && this instanceof @Buffer \? this.buffer : @undefined;\n})\n";
-// writableStreamDefaultWriterRelease
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeLength = 408;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterReleaseCode = "(function (writer){\"use strict\";const stream=@getByIdDirectPrivate(writer,\"stream\"),releasedError=@makeTypeError(\"writableStreamDefaultWriterRelease\");@writableStreamDefaultWriterEnsureReadyPromiseRejected(writer,releasedError),@writableStreamDefaultWriterEnsureClosedPromiseRejected(writer,releasedError),@putByIdDirectPrivate(stream,\"writer\",@undefined),@putByIdDirectPrivate(writer,\"stream\",@undefined)})\n";
+// readBigInt64BE
+const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64BECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadBigInt64BECodeLength = 152;
+static const JSC::Intrinsic s_jsBufferPrototypeReadBigInt64BECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadBigInt64BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getBigInt64(offset, !1);\n})\n";
-// writableStreamDefaultWriterWrite
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeLength = 982;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterWriteCode = "(function (writer,chunk){\"use strict\";const stream=@getByIdDirectPrivate(writer,\"stream\"),controller=@getByIdDirectPrivate(stream,\"controller\"),chunkSize=@writableStreamDefaultControllerGetChunkSize(controller,chunk);if(stream!==@getByIdDirectPrivate(writer,\"stream\"))return @Promise.@reject(@makeTypeError(\"writer is not stream's writer\"));const state=@getByIdDirectPrivate(stream,\"state\");if(state===\"errored\")return @Promise.@reject(@getByIdDirectPrivate(stream,\"storedError\"));if(@writableStreamCloseQueuedOrInFlight(stream)||state===\"closed\")return @Promise.@reject(@makeTypeError(\"stream is closing or closed\"));if(@writableStreamCloseQueuedOrInFlight(stream)||state===\"closed\")return @Promise.@reject(@makeTypeError(\"stream is closing or closed\"));if(state===\"erroring\")return @Promise.@reject(@getByIdDirectPrivate(stream,\"storedError\"));const promise=@writableStreamAddWriteRequest(stream);return @writableStreamDefaultControllerWrite(controller,chunk,chunkSize),promise})\n";
+// readBigInt64LE
+const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64LECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadBigInt64LECodeLength = 152;
+static const JSC::Intrinsic s_jsBufferPrototypeReadBigInt64LECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadBigInt64LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getBigInt64(offset, !0);\n})\n";
-// setUpWritableStreamDefaultController
-const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeLength = 921;
-static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerCode = "(function (stream,controller,startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,highWaterMark,sizeAlgorithm){\"use strict\";@putByIdDirectPrivate(controller,\"stream\",stream),@putByIdDirectPrivate(stream,\"controller\",controller),@resetQueue(@getByIdDirectPrivate(controller,\"queue\")),@putByIdDirectPrivate(controller,\"started\",-1),@putByIdDirectPrivate(controller,\"startAlgorithm\",startAlgorithm),@putByIdDirectPrivate(controller,\"strategySizeAlgorithm\",sizeAlgorithm),@putByIdDirectPrivate(controller,\"strategyHWM\",highWaterMark),@putByIdDirectPrivate(controller,\"writeAlgorithm\",writeAlgorithm),@putByIdDirectPrivate(controller,\"closeAlgorithm\",closeAlgorithm),@putByIdDirectPrivate(controller,\"abortAlgorithm\",abortAlgorithm);const backpressure=@writableStreamDefaultControllerGetBackpressure(controller);@writableStreamUpdateBackpressure(stream,backpressure),@writableStreamDefaultControllerStart(controller)})\n";
+// readBigUInt64BE
+const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64BECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadBigUInt64BECodeLength = 153;
+static const JSC::Intrinsic s_jsBufferPrototypeReadBigUInt64BECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadBigUInt64BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getBigUint64(offset, !1);\n})\n";
-// writableStreamDefaultControllerStart
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultControllerStartCodeLength = 710;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerStartCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerStartCode = "(function (controller){\"use strict\";if(@getByIdDirectPrivate(controller,\"started\")!==-1)return;@putByIdDirectPrivate(controller,\"started\",0);const startAlgorithm=@getByIdDirectPrivate(controller,\"startAlgorithm\");@putByIdDirectPrivate(controller,\"startAlgorithm\",@undefined);const stream=@getByIdDirectPrivate(controller,\"stream\");return @Promise.@resolve(startAlgorithm.@call()).@then(()=>{const state=@getByIdDirectPrivate(stream,\"state\");@putByIdDirectPrivate(controller,\"started\",1),@writableStreamDefaultControllerAdvanceQueueIfNeeded(controller)},(error)=>{const state=@getByIdDirectPrivate(stream,\"state\");@putByIdDirectPrivate(controller,\"started\",1),@writableStreamDealWithRejection(stream,error)})})\n";
+// readBigUInt64LE
+const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64LECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadBigUInt64LECodeLength = 153;
+static const JSC::Intrinsic s_jsBufferPrototypeReadBigUInt64LECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadBigUInt64LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getBigUint64(offset, !0);\n})\n";
-// setUpWritableStreamDefaultControllerFromUnderlyingSink
-const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeLength = 1127;
-static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCode = "(function (stream,underlyingSink,underlyingSinkDict,highWaterMark,sizeAlgorithm){\"use strict\";const controller=new @WritableStreamDefaultController;let startAlgorithm=()=>{},writeAlgorithm=()=>{return @Promise.@resolve()},closeAlgorithm=()=>{return @Promise.@resolve()},abortAlgorithm=()=>{return @Promise.@resolve()};if(\"start\"in underlyingSinkDict){const startMethod=underlyingSinkDict.start;startAlgorithm=()=>@promiseInvokeOrNoopMethodNoCatch(underlyingSink,startMethod,[controller])}if(\"write\"in underlyingSinkDict){const writeMethod=underlyingSinkDict.write;writeAlgorithm=(chunk)=>@promiseInvokeOrNoopMethod(underlyingSink,writeMethod,[chunk,controller])}if(\"close\"in underlyingSinkDict){const closeMethod=underlyingSinkDict.close;closeAlgorithm=()=>@promiseInvokeOrNoopMethod(underlyingSink,closeMethod,[])}if(\"abort\"in underlyingSinkDict){const abortMethod=underlyingSinkDict.abort;abortAlgorithm=(reason)=>@promiseInvokeOrNoopMethod(underlyingSink,abortMethod,[reason])}@setUpWritableStreamDefaultController(stream,controller,startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,highWaterMark,sizeAlgorithm)})\n";
+// readDoubleBE
+const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleBECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadDoubleBECodeLength = 151;
+static const JSC::Intrinsic s_jsBufferPrototypeReadDoubleBECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadDoubleBECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getFloat64(offset, !1);\n})\n";
-// writableStreamDefaultControllerAdvanceQueueIfNeeded
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeLength = 609;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCode = "(function (controller){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"stream\");if(@getByIdDirectPrivate(controller,\"started\")!==1)return;if(@getByIdDirectPrivate(stream,\"inFlightWriteRequest\")!==@undefined)return;if(@getByIdDirectPrivate(stream,\"state\")===\"erroring\"){@writableStreamFinishErroring(stream);return}const queue=@getByIdDirectPrivate(controller,\"queue\");if(queue.content\?.isEmpty()\?\?!1)return;const value=@peekQueueValue(queue);if(value===@isCloseSentinel)@writableStreamDefaultControllerProcessClose(controller);else @writableStreamDefaultControllerProcessWrite(controller,value)})\n";
+// readDoubleLE
+const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleLECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadDoubleLECodeLength = 151;
+static const JSC::Intrinsic s_jsBufferPrototypeReadDoubleLECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadDoubleLECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getFloat64(offset, !0);\n})\n";
-// isCloseSentinel
-const JSC::ConstructAbility s_writableStreamInternalsIsCloseSentinelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsIsCloseSentinelCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsIsCloseSentinelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsIsCloseSentinelCodeLength = 29;
-static const JSC::Intrinsic s_writableStreamInternalsIsCloseSentinelCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsIsCloseSentinelCode = "(function (){\"use strict\";})\n";
+// readFloatBE
+const JSC::ConstructAbility s_jsBufferPrototypeReadFloatBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadFloatBECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadFloatBECodeLength = 151;
+static const JSC::Intrinsic s_jsBufferPrototypeReadFloatBECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadFloatBECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getFloat32(offset, !1);\n})\n";
-// writableStreamDefaultControllerClearAlgorithms
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeLength = 293;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCode = "(function (controller){\"use strict\";@putByIdDirectPrivate(controller,\"writeAlgorithm\",@undefined),@putByIdDirectPrivate(controller,\"closeAlgorithm\",@undefined),@putByIdDirectPrivate(controller,\"abortAlgorithm\",@undefined),@putByIdDirectPrivate(controller,\"strategySizeAlgorithm\",@undefined)})\n";
+// readFloatLE
+const JSC::ConstructAbility s_jsBufferPrototypeReadFloatLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadFloatLECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadFloatLECodeLength = 151;
+static const JSC::Intrinsic s_jsBufferPrototypeReadFloatLECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadFloatLECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getFloat32(offset, !0);\n})\n";
-// writableStreamDefaultControllerClose
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeLength = 187;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerCloseCode = "(function (controller){\"use strict\";@enqueueValueWithSize(@getByIdDirectPrivate(controller,\"queue\"),@isCloseSentinel,0),@writableStreamDefaultControllerAdvanceQueueIfNeeded(controller)})\n";
+// readInt16BE
+const JSC::ConstructAbility s_jsBufferPrototypeReadInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadInt16BECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadInt16BECodeLength = 149;
+static const JSC::Intrinsic s_jsBufferPrototypeReadInt16BECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadInt16BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt16(offset, !1);\n})\n";
-// writableStreamDefaultControllerError
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeLength = 203;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorCode = "(function (controller,error){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"stream\");@writableStreamDefaultControllerClearAlgorithms(controller),@writableStreamStartErroring(stream,error)})\n";
+// readInt16LE
+const JSC::ConstructAbility s_jsBufferPrototypeReadInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadInt16LECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadInt16LECodeLength = 149;
+static const JSC::Intrinsic s_jsBufferPrototypeReadInt16LECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadInt16LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt16(offset, !0);\n})\n";
-// writableStreamDefaultControllerErrorIfNeeded
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeLength = 210;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCode = "(function (controller,error){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"stream\");if(@getByIdDirectPrivate(stream,\"state\")===\"writable\")@writableStreamDefaultControllerError(controller,error)})\n";
+// readInt32BE
+const JSC::ConstructAbility s_jsBufferPrototypeReadInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadInt32BECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadInt32BECodeLength = 149;
+static const JSC::Intrinsic s_jsBufferPrototypeReadInt32BECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadInt32BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt32(offset, !1);\n})\n";
-// writableStreamDefaultControllerGetBackpressure
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeLength = 107;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCode = "(function (controller){\"use strict\";return @writableStreamDefaultControllerGetDesiredSize(controller)<=0})\n";
+// readInt32LE
+const JSC::ConstructAbility s_jsBufferPrototypeReadInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadInt32LECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadInt32LECodeLength = 149;
+static const JSC::Intrinsic s_jsBufferPrototypeReadInt32LECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadInt32LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt32(offset, !0);\n})\n";
-// writableStreamDefaultControllerGetChunkSize
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeLength = 216;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCode = "(function (controller,chunk){\"use strict\";try{return @getByIdDirectPrivate(controller,\"strategySizeAlgorithm\").@call(@undefined,chunk)}catch(e){return @writableStreamDefaultControllerErrorIfNeeded(controller,e),1}})\n";
+// readInt8
+const JSC::ConstructAbility s_jsBufferPrototypeReadInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadInt8CodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadInt8CodeLength = 144;
+static const JSC::Intrinsic s_jsBufferPrototypeReadInt8CodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadInt8Code = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt8(offset);\n})\n";
-// writableStreamDefaultControllerGetDesiredSize
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeLength = 140;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCode = "(function (controller){\"use strict\";return @getByIdDirectPrivate(controller,\"strategyHWM\")-@getByIdDirectPrivate(controller,\"queue\").size})\n";
+// readIntBE
+const JSC::ConstructAbility s_jsBufferPrototypeReadIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadIntBECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadIntBECodeLength = 838;
+static const JSC::Intrinsic s_jsBufferPrototypeReadIntBECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadIntBECode = "(function (offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1:\n return view.getInt8(offset);\n case 2:\n return view.getInt16(offset, !1);\n case 3: {\n const val = view.getUint16(offset + 1, !1) + view.getUint8(offset) * 65536;\n return val | (val & 8388608) * 510;\n }\n case 4:\n return view.getInt32(offset, !1);\n case 5: {\n const last = view.getUint8(offset);\n return (last | (last & 128) * 33554430) * 4294967296 + view.getUint32(offset + 1, !1);\n }\n case 6: {\n const last = view.getUint16(offset, !1);\n return (last | (last & 32768) * 131070) * 4294967296 + view.getUint32(offset + 2, !1);\n }\n }\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n})\n";
-// writableStreamDefaultControllerProcessClose
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeLength = 485;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCode = "(function (controller){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"stream\");@writableStreamMarkCloseRequestInFlight(stream),@dequeueValue(@getByIdDirectPrivate(controller,\"queue\"));const sinkClosePromise=@getByIdDirectPrivate(controller,\"closeAlgorithm\").@call();@writableStreamDefaultControllerClearAlgorithms(controller),sinkClosePromise.@then(()=>{@writableStreamFinishInFlightClose(stream)},(reason)=>{@writableStreamFinishInFlightCloseWithError(stream,reason)})})\n";
+// readIntLE
+const JSC::ConstructAbility s_jsBufferPrototypeReadIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadIntLECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadIntLECodeLength = 838;
+static const JSC::Intrinsic s_jsBufferPrototypeReadIntLECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadIntLECode = "(function (offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1:\n return view.getInt8(offset);\n case 2:\n return view.getInt16(offset, !0);\n case 3: {\n const val = view.getUint16(offset, !0) + view.getUint8(offset + 2) * 65536;\n return val | (val & 8388608) * 510;\n }\n case 4:\n return view.getInt32(offset, !0);\n case 5: {\n const last = view.getUint8(offset + 4);\n return (last | (last & 128) * 33554430) * 4294967296 + view.getUint32(offset, !0);\n }\n case 6: {\n const last = view.getUint16(offset + 4, !0);\n return (last | (last & 32768) * 131070) * 4294967296 + view.getUint32(offset, !0);\n }\n }\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n})\n";
-// writableStreamDefaultControllerProcessWrite
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeLength = 845;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode = "(function (controller,chunk){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"stream\");@writableStreamMarkFirstWriteRequestInFlight(stream),@getByIdDirectPrivate(controller,\"writeAlgorithm\").@call(@undefined,chunk).@then(()=>{@writableStreamFinishInFlightWrite(stream);const state=@getByIdDirectPrivate(stream,\"state\");if(@dequeueValue(@getByIdDirectPrivate(controller,\"queue\")),!@writableStreamCloseQueuedOrInFlight(stream)&&state===\"writable\"){const backpressure=@writableStreamDefaultControllerGetBackpressure(controller);@writableStreamUpdateBackpressure(stream,backpressure)}@writableStreamDefaultControllerAdvanceQueueIfNeeded(controller)},(reason)=>{if(@getByIdDirectPrivate(stream,\"state\")===\"writable\")@writableStreamDefaultControllerClearAlgorithms(controller);@writableStreamFinishInFlightWriteWithError(stream,reason)})})\n";
+// readUInt16BE
+const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16BECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadUInt16BECodeLength = 150;
+static const JSC::Intrinsic s_jsBufferPrototypeReadUInt16BECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadUInt16BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint16(offset, !1);\n})\n";
-// writableStreamDefaultControllerWrite
-const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeLength = 578;
-static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerWriteCode = "(function (controller,chunk,chunkSize){\"use strict\";try{@enqueueValueWithSize(@getByIdDirectPrivate(controller,\"queue\"),chunk,chunkSize);const stream=@getByIdDirectPrivate(controller,\"stream\"),state=@getByIdDirectPrivate(stream,\"state\");if(!@writableStreamCloseQueuedOrInFlight(stream)&&state===\"writable\"){const backpressure=@writableStreamDefaultControllerGetBackpressure(controller);@writableStreamUpdateBackpressure(stream,backpressure)}@writableStreamDefaultControllerAdvanceQueueIfNeeded(controller)}catch(e){@writableStreamDefaultControllerErrorIfNeeded(controller,e)}})\n";
+// readUInt16LE
+const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16LECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadUInt16LECodeLength = 150;
+static const JSC::Intrinsic s_jsBufferPrototypeReadUInt16LECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadUInt16LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint16(offset, !0);\n})\n";
-#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
-JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
-{\
- JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().writableStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().writableStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
-}
-WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
-#undef DEFINE_BUILTIN_GENERATOR
+// readUInt32BE
+const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32BECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadUInt32BECodeLength = 150;
+static const JSC::Intrinsic s_jsBufferPrototypeReadUInt32BECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadUInt32BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint32(offset, !1);\n})\n";
-/* TransformStreamInternals.ts */
-// isTransformStream
-const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsIsTransformStreamCodeLength = 103;
-static const JSC::Intrinsic s_transformStreamInternalsIsTransformStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsIsTransformStreamCode = "(function (stream){\"use strict\";return @isObject(stream)&&!!@getByIdDirectPrivate(stream,\"readable\")})\n";
+// readUInt32LE
+const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32LECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadUInt32LECodeLength = 150;
+static const JSC::Intrinsic s_jsBufferPrototypeReadUInt32LECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadUInt32LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint32(offset, !0);\n})\n";
-// isTransformStreamDefaultController
-const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsIsTransformStreamDefaultControllerCodeLength = 125;
-static const JSC::Intrinsic s_transformStreamInternalsIsTransformStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsIsTransformStreamDefaultControllerCode = "(function (controller){\"use strict\";return @isObject(controller)&&!!@getByIdDirectPrivate(controller,\"transformAlgorithm\")})\n";
+// readUInt8
+const JSC::ConstructAbility s_jsBufferPrototypeReadUInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadUInt8CodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadUInt8CodeLength = 145;
+static const JSC::Intrinsic s_jsBufferPrototypeReadUInt8CodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadUInt8Code = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint8(offset);\n})\n";
-// createTransformStream
-const JSC::ConstructAbility s_transformStreamInternalsCreateTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsCreateTransformStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsCreateTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsCreateTransformStreamCodeLength = 1042;
-static const JSC::Intrinsic s_transformStreamInternalsCreateTransformStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsCreateTransformStreamCode = "(function (startAlgorithm,transformAlgorithm,flushAlgorithm,writableHighWaterMark,writableSizeAlgorithm,readableHighWaterMark,readableSizeAlgorithm){\"use strict\";if(writableHighWaterMark===@undefined)writableHighWaterMark=1;if(writableSizeAlgorithm===@undefined)writableSizeAlgorithm=()=>1;if(readableHighWaterMark===@undefined)readableHighWaterMark=0;if(readableSizeAlgorithm===@undefined)readableSizeAlgorithm=()=>1;const transform={};@putByIdDirectPrivate(transform,\"TransformStream\",!0);const stream=new @TransformStream(transform),startPromiseCapability=@newPromiseCapability(@Promise);@initializeTransformStream(stream,startPromiseCapability.promise,writableHighWaterMark,writableSizeAlgorithm,readableHighWaterMark,readableSizeAlgorithm);const controller=new @TransformStreamDefaultController;return @setUpTransformStreamDefaultController(stream,controller,transformAlgorithm,flushAlgorithm),startAlgorithm().@then(()=>{startPromiseCapability.resolve.@call()},(error)=>{startPromiseCapability.reject.@call(@undefined,error)}),stream})\n";
+// readUIntBE
+const JSC::ConstructAbility s_jsBufferPrototypeReadUIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadUIntBECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadUIntBECodeLength = 786;
+static const JSC::Intrinsic s_jsBufferPrototypeReadUIntBECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadUIntBECode = "(function (offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1:\n return view.getUint8(offset);\n case 2:\n return view.getUint16(offset, !1);\n case 3:\n return view.getUint16(offset + 1, !1) + view.getUint8(offset) * 65536;\n case 4:\n return view.getUint32(offset, !1);\n case 5: {\n const last = view.getUint8(offset);\n return (last | (last & 128) * 33554430) * 4294967296 + view.getUint32(offset + 1, !1);\n }\n case 6: {\n const last = view.getUint16(offset, !1);\n return (last | (last & 32768) * 131070) * 4294967296 + view.getUint32(offset + 2, !1);\n }\n }\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n})\n";
-// initializeTransformStream
-const JSC::ConstructAbility s_transformStreamInternalsInitializeTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsInitializeTransformStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsInitializeTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsInitializeTransformStreamCodeLength = 1593;
-static const JSC::Intrinsic s_transformStreamInternalsInitializeTransformStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsInitializeTransformStreamCode = "(function (stream,startPromise,writableHighWaterMark,writableSizeAlgorithm,readableHighWaterMark,readableSizeAlgorithm){\"use strict\";const startAlgorithm=()=>{return startPromise},writeAlgorithm=(chunk)=>{return @transformStreamDefaultSinkWriteAlgorithm(stream,chunk)},abortAlgorithm=(reason)=>{return @transformStreamDefaultSinkAbortAlgorithm(stream,reason)},closeAlgorithm=()=>{return @transformStreamDefaultSinkCloseAlgorithm(stream)},writable=@createWritableStream(startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,writableHighWaterMark,writableSizeAlgorithm),pullAlgorithm=()=>{return @transformStreamDefaultSourcePullAlgorithm(stream)},cancelAlgorithm=(reason)=>{return @transformStreamErrorWritableAndUnblockWrite(stream,reason),@Promise.@resolve()},underlyingSource={};@putByIdDirectPrivate(underlyingSource,\"start\",startAlgorithm),@putByIdDirectPrivate(underlyingSource,\"pull\",pullAlgorithm),@putByIdDirectPrivate(underlyingSource,\"cancel\",cancelAlgorithm);const options={};@putByIdDirectPrivate(options,\"size\",readableSizeAlgorithm),@putByIdDirectPrivate(options,\"highWaterMark\",readableHighWaterMark);const readable=new @ReadableStream(underlyingSource,options);@putByIdDirectPrivate(stream,\"writable\",writable),@putByIdDirectPrivate(stream,\"internalWritable\",@getInternalWritableStream(writable)),@putByIdDirectPrivate(stream,\"readable\",readable),@putByIdDirectPrivate(stream,\"backpressure\",@undefined),@putByIdDirectPrivate(stream,\"backpressureChangePromise\",@undefined),@transformStreamSetBackpressure(stream,!0),@putByIdDirectPrivate(stream,\"controller\",@undefined)})\n";
+// readUIntLE
+const JSC::ConstructAbility s_jsBufferPrototypeReadUIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeReadUIntLECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeReadUIntLECodeLength = 664;
+static const JSC::Intrinsic s_jsBufferPrototypeReadUIntLECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeReadUIntLECode = "(function (offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1:\n return view.getUint8(offset);\n case 2:\n return view.getUint16(offset, !0);\n case 3:\n return view.getUint16(offset, !0) + view.getUint8(offset + 2) * 65536;\n case 4:\n return view.getUint32(offset, !0);\n case 5:\n return view.getUint8(offset + 4) * 4294967296 + view.getUint32(offset, !0);\n case 6:\n return view.getUint16(offset + 4, !0) * 4294967296 + view.getUint32(offset, !0);\n }\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n})\n";
-// transformStreamError
-const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsTransformStreamErrorCodeLength = 285;
-static const JSC::Intrinsic s_transformStreamInternalsTransformStreamErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamErrorCode = "(function (stream,e){\"use strict\";const readable=@getByIdDirectPrivate(stream,\"readable\"),readableController=@getByIdDirectPrivate(readable,\"readableStreamController\");@readableStreamDefaultControllerError(readableController,e),@transformStreamErrorWritableAndUnblockWrite(stream,e)})\n";
+// setBigUint64
+const JSC::ConstructAbility s_jsBufferPrototypeSetBigUint64CodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeSetBigUint64CodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeSetBigUint64CodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeSetBigUint64CodeLength = 171;
+static const JSC::Intrinsic s_jsBufferPrototypeSetBigUint64CodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeSetBigUint64Code = "(function (offset, value, le) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigUint64(offset, value, le);\n})\n";
-// transformStreamErrorWritableAndUnblockWrite
-const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeLength = 378;
-static const JSC::Intrinsic s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCode = "(function (stream,e){\"use strict\";@transformStreamDefaultControllerClearAlgorithms(@getByIdDirectPrivate(stream,\"controller\"));const writable=@getByIdDirectPrivate(stream,\"internalWritable\");if(@writableStreamDefaultControllerErrorIfNeeded(@getByIdDirectPrivate(writable,\"controller\"),e),@getByIdDirectPrivate(stream,\"backpressure\"))@transformStreamSetBackpressure(stream,!1)})\n";
+// slice
+const JSC::ConstructAbility s_jsBufferPrototypeSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeSliceCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeSliceCodeLength = 564;
+static const JSC::Intrinsic s_jsBufferPrototypeSliceCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeSliceCode = "(function (start, end) {\"use strict\";\n var { buffer, byteOffset, byteLength } = this;\n function adjustOffset(offset, length) {\n if (offset = @trunc(offset), offset === 0 || offset !== offset)\n return 0;\n else if (offset < 0)\n return offset += length, offset > 0 \? offset : 0;\n else\n return offset < length \? offset : length;\n }\n var start_ = adjustOffset(start, byteLength), end_ = end !== @undefined \? adjustOffset(end, byteLength) : byteLength;\n return new @Buffer(buffer, byteOffset + start_, end_ > start_ \? end_ - start_ : 0);\n})\n";
-// transformStreamSetBackpressure
-const JSC::ConstructAbility s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamSetBackpressureCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsTransformStreamSetBackpressureCodeLength = 369;
-static const JSC::Intrinsic s_transformStreamInternalsTransformStreamSetBackpressureCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamSetBackpressureCode = "(function (stream,backpressure){\"use strict\";const backpressureChangePromise=@getByIdDirectPrivate(stream,\"backpressureChangePromise\");if(backpressureChangePromise!==@undefined)backpressureChangePromise.resolve.@call();@putByIdDirectPrivate(stream,\"backpressureChangePromise\",@newPromiseCapability(@Promise)),@putByIdDirectPrivate(stream,\"backpressure\",backpressure)})\n";
+// toJSON
+const JSC::ConstructAbility s_jsBufferPrototypeToJSONCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeToJSONCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeToJSONCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeToJSONCodeLength = 85;
+static const JSC::Intrinsic s_jsBufferPrototypeToJSONCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeToJSONCode = "(function () {\"use strict\";\n return { type: \"Buffer\", data: @Array.from(this) };\n})\n";
-// setUpTransformStreamDefaultController
-const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeLength = 323;
-static const JSC::Intrinsic s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerCode = "(function (stream,controller,transformAlgorithm,flushAlgorithm){\"use strict\";@putByIdDirectPrivate(controller,\"stream\",stream),@putByIdDirectPrivate(stream,\"controller\",controller),@putByIdDirectPrivate(controller,\"transformAlgorithm\",transformAlgorithm),@putByIdDirectPrivate(controller,\"flushAlgorithm\",flushAlgorithm)})\n";
+// ucs2Slice
+const JSC::ConstructAbility s_jsBufferPrototypeUcs2SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeUcs2SliceCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeUcs2SliceCodeLength = 85;
+static const JSC::Intrinsic s_jsBufferPrototypeUcs2SliceCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeUcs2SliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"ucs2\", start, end);\n})\n";
-// setUpTransformStreamDefaultControllerFromTransformer
-const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeLength = 704;
-static const JSC::Intrinsic s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode = "(function (stream,transformer,transformerDict){\"use strict\";const controller=new @TransformStreamDefaultController;let transformAlgorithm=(chunk)=>{try{@transformStreamDefaultControllerEnqueue(controller,chunk)}catch(e){return @Promise.@reject(e)}return @Promise.@resolve()},flushAlgorithm=()=>{return @Promise.@resolve()};if(\"transform\"in transformerDict)transformAlgorithm=(chunk)=>{return @promiseInvokeOrNoopMethod(transformer,transformerDict.transform,[chunk,controller])};if(\"flush\"in transformerDict)flushAlgorithm=()=>{return @promiseInvokeOrNoopMethod(transformer,transformerDict.flush,[controller])};@setUpTransformStreamDefaultController(stream,controller,transformAlgorithm,flushAlgorithm)})\n";
+// ucs2Write
+const JSC::ConstructAbility s_jsBufferPrototypeUcs2WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeUcs2WriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeUcs2WriteCodeLength = 102;
+static const JSC::Intrinsic s_jsBufferPrototypeUcs2WriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeUcs2WriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"ucs2\");\n})\n";
-// transformStreamDefaultControllerClearAlgorithms
-const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeLength = 158;
-static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCode = "(function (controller){\"use strict\";@putByIdDirectPrivate(controller,\"transformAlgorithm\",!0),@putByIdDirectPrivate(controller,\"flushAlgorithm\",@undefined)})\n";
+// utf16leSlice
+const JSC::ConstructAbility s_jsBufferPrototypeUtf16leSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeUtf16leSliceCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeUtf16leSliceCodeLength = 88;
+static const JSC::Intrinsic s_jsBufferPrototypeUtf16leSliceCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeUtf16leSliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"utf16le\", start, end);\n})\n";
-// transformStreamDefaultControllerEnqueue
-const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeLength = 717;
-static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCode = "(function (controller,chunk){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"stream\"),readable=@getByIdDirectPrivate(stream,\"readable\"),readableController=@getByIdDirectPrivate(readable,\"readableStreamController\");if(!@readableStreamDefaultControllerCanCloseOrEnqueue(readableController))@throwTypeError(\"TransformStream.readable cannot close or enqueue\");try{@readableStreamDefaultControllerEnqueue(readableController,chunk)}catch(e){throw @transformStreamErrorWritableAndUnblockWrite(stream,e),@getByIdDirectPrivate(readable,\"storedError\")}if(!@readableStreamDefaultControllerShouldCallPull(readableController)!==@getByIdDirectPrivate(stream,\"backpressure\"))@transformStreamSetBackpressure(stream,!0)})\n";
+// utf16leWrite
+const JSC::ConstructAbility s_jsBufferPrototypeUtf16leWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeUtf16leWriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeUtf16leWriteCodeLength = 105;
+static const JSC::Intrinsic s_jsBufferPrototypeUtf16leWriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeUtf16leWriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"utf16le\");\n})\n";
-// transformStreamDefaultControllerError
-const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeLength = 108;
-static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamDefaultControllerErrorCode = "(function (controller,e){\"use strict\";@transformStreamError(@getByIdDirectPrivate(controller,\"stream\"),e)})\n";
+// utf8Slice
+const JSC::ConstructAbility s_jsBufferPrototypeUtf8SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeUtf8SliceCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeUtf8SliceCodeLength = 85;
+static const JSC::Intrinsic s_jsBufferPrototypeUtf8SliceCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeUtf8SliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"utf8\", start, end);\n})\n";
-// transformStreamDefaultControllerPerformTransform
-const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeLength = 373;
-static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode = "(function (controller,chunk){\"use strict\";const promiseCapability=@newPromiseCapability(@Promise);return @getByIdDirectPrivate(controller,\"transformAlgorithm\").@call(@undefined,chunk).@then(()=>{promiseCapability.resolve()},(r)=>{@transformStreamError(@getByIdDirectPrivate(controller,\"stream\"),r),promiseCapability.reject.@call(@undefined,r)}),promiseCapability.promise})\n";
+// utf8Write
+const JSC::ConstructAbility s_jsBufferPrototypeUtf8WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeUtf8WriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeUtf8WriteCodeLength = 102;
+static const JSC::Intrinsic s_jsBufferPrototypeUtf8WriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeUtf8WriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"utf8\");\n})\n";
-// transformStreamDefaultControllerTerminate
-const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeLength = 473;
-static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamDefaultControllerTerminateCode = "(function (controller){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"stream\"),readable=@getByIdDirectPrivate(stream,\"readable\"),readableController=@getByIdDirectPrivate(readable,\"readableStreamController\");if(@readableStreamDefaultControllerCanCloseOrEnqueue(readableController))@readableStreamDefaultControllerClose(readableController);const error=@makeTypeError(\"the stream has been terminated\");@transformStreamErrorWritableAndUnblockWrite(stream,error)})\n";
+// writeBigInt64BE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64BECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteBigInt64BECodeLength = 178;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteBigInt64BECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteBigInt64BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigInt64(offset, value, !1), offset + 8;\n})\n";
-// transformStreamDefaultSinkWriteAlgorithm
-const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength = 816;
-static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode = "(function (stream,chunk){\"use strict\";const writable=@getByIdDirectPrivate(stream,\"internalWritable\"),controller=@getByIdDirectPrivate(stream,\"controller\");if(@getByIdDirectPrivate(stream,\"backpressure\")){const promiseCapability=@newPromiseCapability(@Promise);return @getByIdDirectPrivate(stream,\"backpressureChangePromise\").promise.@then(()=>{if(@getByIdDirectPrivate(writable,\"state\")===\"erroring\"){promiseCapability.reject.@call(@undefined,@getByIdDirectPrivate(writable,\"storedError\"));return}@transformStreamDefaultControllerPerformTransform(controller,chunk).@then(()=>{promiseCapability.resolve()},(e)=>{promiseCapability.reject.@call(@undefined,e)})},(e)=>{promiseCapability.reject.@call(@undefined,e)}),promiseCapability.promise}return @transformStreamDefaultControllerPerformTransform(controller,chunk)})\n";
+// writeBigInt64LE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64LECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteBigInt64LECodeLength = 178;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteBigInt64LECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteBigInt64LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigInt64(offset, value, !0), offset + 8;\n})\n";
-// transformStreamDefaultSinkAbortAlgorithm
-const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeLength = 105;
-static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCode = "(function (stream,reason){\"use strict\";return @transformStreamError(stream,reason),@Promise.@resolve()})\n";
+// writeBigUInt64BE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64BECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteBigUInt64BECodeLength = 179;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteBigUInt64BECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteBigUInt64BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigUint64(offset, value, !1), offset + 8;\n})\n";
-// transformStreamDefaultSinkCloseAlgorithm
-const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeLength = 1016;
-static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode = "(function (stream){\"use strict\";const readable=@getByIdDirectPrivate(stream,\"readable\"),controller=@getByIdDirectPrivate(stream,\"controller\"),readableController=@getByIdDirectPrivate(readable,\"readableStreamController\"),flushAlgorithm=@getByIdDirectPrivate(controller,\"flushAlgorithm\"),flushPromise=@getByIdDirectPrivate(controller,\"flushAlgorithm\").@call();@transformStreamDefaultControllerClearAlgorithms(controller);const promiseCapability=@newPromiseCapability(@Promise);return flushPromise.@then(()=>{if(@getByIdDirectPrivate(readable,\"state\")===@streamErrored){promiseCapability.reject.@call(@undefined,@getByIdDirectPrivate(readable,\"storedError\"));return}if(@readableStreamDefaultControllerCanCloseOrEnqueue(readableController))@readableStreamDefaultControllerClose(readableController);promiseCapability.resolve()},(r)=>{@transformStreamError(@getByIdDirectPrivate(controller,\"stream\"),r),promiseCapability.reject.@call(@undefined,@getByIdDirectPrivate(readable,\"storedError\"))}),promiseCapability.promise})\n";
+// writeBigUInt64LE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64LECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteBigUInt64LECodeLength = 179;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteBigUInt64LECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteBigUInt64LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigUint64(offset, value, !0), offset + 8;\n})\n";
-// transformStreamDefaultSourcePullAlgorithm
-const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeLength = 150;
-static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCode = "(function (stream){\"use strict\";return @transformStreamSetBackpressure(stream,!1),@getByIdDirectPrivate(stream,\"backpressureChangePromise\").promise})\n";
+// writeDoubleBE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleBECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteDoubleBECodeLength = 177;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteDoubleBECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteDoubleBECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setFloat64(offset, value, !1), offset + 8;\n})\n";
-#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
-JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
-{\
- JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().transformStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().transformStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
-}
-WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
-#undef DEFINE_BUILTIN_GENERATOR
+// writeDoubleLE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleLECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteDoubleLECodeLength = 177;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteDoubleLECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteDoubleLECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setFloat64(offset, value, !0), offset + 8;\n})\n";
-/* ProcessObjectInternals.ts */
-// binding
-const JSC::ConstructAbility s_processObjectInternalsBindingCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_processObjectInternalsBindingCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_processObjectInternalsBindingCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_processObjectInternalsBindingCodeLength = 511;
-static const JSC::Intrinsic s_processObjectInternalsBindingCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_processObjectInternalsBindingCode = "(function (bindingName){\"use strict\";if(bindingName===\"constants\")return @processBindingConstants;const issue={fs:3546,buffer:2020,natives:2254,uv:2891}[bindingName];if(issue)throw new Error(`process.binding(\"${bindingName}\") is not implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/${issue}`);@throwTypeError(`process.binding(\"${bindingName}\") is not implemented in Bun. If that breaks something, please file an issue and include a reproducible code sample.`)})\n";
+// writeFloatBE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatBECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteFloatBECodeLength = 177;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteFloatBECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteFloatBECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setFloat32(offset, value, !1), offset + 4;\n})\n";
-// getStdioWriteStream
-const JSC::ConstructAbility s_processObjectInternalsGetStdioWriteStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_processObjectInternalsGetStdioWriteStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_processObjectInternalsGetStdioWriteStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_processObjectInternalsGetStdioWriteStreamCodeLength = 621;
-static const JSC::Intrinsic s_processObjectInternalsGetStdioWriteStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_processObjectInternalsGetStdioWriteStreamCode = "(function (fd){\"use strict\";const stream=(@getInternalField(@internalModuleRegistry,44)||@createInternalModuleById(44)).WriteStream(fd);if(process.on(\"SIGWINCH\",()=>{stream._refreshSize()}),fd===1)stream.destroySoon=stream.destroy,stream._destroy=function(err,cb){if(cb(err),this._undestroy(),!this._writableState.emitClose)process.nextTick(()=>{this.emit(\"close\")})};else if(fd===2)stream.destroySoon=stream.destroy,stream._destroy=function(err,cb){if(cb(err),this._undestroy(),!this._writableState.emitClose)process.nextTick(()=>{this.emit(\"close\")})};return stream._type=\"tty\",stream._isStdio=!0,stream.fd=fd,stream})\n";
+// writeFloatLE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatLECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteFloatLECodeLength = 177;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteFloatLECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteFloatLECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setFloat32(offset, value, !0), offset + 4;\n})\n";
-// getStdinStream
-const JSC::ConstructAbility s_processObjectInternalsGetStdinStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_processObjectInternalsGetStdinStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_processObjectInternalsGetStdinStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_processObjectInternalsGetStdinStreamCodeLength = 1386;
-static const JSC::Intrinsic s_processObjectInternalsGetStdinStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_processObjectInternalsGetStdinStreamCode = "(function (fd){\"use strict\";var reader,readerRef;function ref(){reader\?\?=@Bun.stdin.stream().getReader(),readerRef\?\?=setInterval(()=>{},1<<30)}function unref(){if(readerRef)clearInterval(readerRef),readerRef=@undefined;if(reader)reader.cancel(),reader=@undefined}const stream=new((@getInternalField(@internalModuleRegistry,44))||(@createInternalModuleById(44))).ReadStream(fd),originalOn=stream.on;stream.on=function(event,listener){if(event===\"readable\")ref();return originalOn.call(this,event,listener)},stream.fd=fd;const originalPause=stream.pause;stream.pause=function(){return unref(),originalPause.call(this)};const originalResume=stream.resume;stream.resume=function(){return ref(),originalResume.call(this)};async function internalRead(stream2){try{var done,value;const read=reader\?.readMany();if(@isPromise(read))({done,value}=await read);else({done,value}=read);if(!done){stream2.push(value[0]);const length=value.length;for(let i=1;i<length;i++)stream2.push(value[i])}else stream2.emit(\"end\"),stream2.pause()}catch(err){stream2.destroy(err)}}return stream._read=function(size){internalRead(this)},stream.on(\"resume\",()=>{ref(),stream._undestroy()}),stream._readableState.reading=!1,stream.on(\"pause\",()=>{process.nextTick(()=>{if(!stream.readableFlowing)stream._readableState.reading=!1})}),stream.on(\"close\",()=>{process.nextTick(()=>{stream.destroy(),unref()})}),stream})\n";
+// writeInt16BE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16BECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteInt16BECodeLength = 175;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteInt16BECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteInt16BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt16(offset, value, !1), offset + 2;\n})\n";
-// initializeNextTickQueue
-const JSC::ConstructAbility s_processObjectInternalsInitializeNextTickQueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_processObjectInternalsInitializeNextTickQueueCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_processObjectInternalsInitializeNextTickQueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_processObjectInternalsInitializeNextTickQueueCodeLength = 2336;
-static const JSC::Intrinsic s_processObjectInternalsInitializeNextTickQueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_processObjectInternalsInitializeNextTickQueueCode = "(function (process,nextTickQueue,drainMicrotasksFn,reportUncaughtExceptionFn){\"use strict\";var queue,process,nextTickQueue=nextTickQueue,drainMicrotasks=drainMicrotasksFn,reportUncaughtException=reportUncaughtExceptionFn;function validateFunction(cb){if(typeof cb!==\"function\"){const err=@makeTypeError(`The \"callback\" argument must be of type \"function\". Received type ${typeof cb}`);throw err.code=\"ERR_INVALID_ARG_TYPE\",err}}var setup=()=>{queue=function createQueue(){class FixedCircularBuffer{constructor(){this.bottom=0,this.top=0,this.list=@newArrayWithSize(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(data){this.list[this.top]=data,this.top=this.top+1&2047}shift(){var{list,bottom}=this;const nextItem=list[bottom];if(nextItem===@undefined)return null;return list[bottom]=@undefined,this.bottom=bottom+1&2047,nextItem}}class FixedQueue{constructor(){this.head=this.tail=new FixedCircularBuffer}isEmpty(){return this.head.isEmpty()}push(data){if(this.head.isFull())this.head=this.head.next=new FixedCircularBuffer;this.head.push(data)}shift(){const tail=this.tail,next=tail.shift();if(tail.isEmpty()&&tail.next!==null)this.tail=tail.next,tail.next=null;return next}}return new FixedQueue}();function processTicksAndRejections(){var tock;do{while((tock=queue.shift())!==null){var{callback,args,frame}=tock,restore=@getInternalField(@asyncContext,0);@putInternalField(@asyncContext,0,frame);try{if(args===@undefined)callback();else switch(args.length){case 1:callback(args[0]);break;case 2:callback(args[0],args[1]);break;case 3:callback(args[0],args[1],args[2]);break;case 4:callback(args[0],args[1],args[2],args[3]);break;default:callback(...args);break}}catch(e){reportUncaughtException(e)}finally{@putInternalField(@asyncContext,0,restore)}}drainMicrotasks()}while(!queue.isEmpty())}@putInternalField(nextTickQueue,0,0),@putInternalField(nextTickQueue,1,queue),@putInternalField(nextTickQueue,2,processTicksAndRejections),setup=@undefined};function nextTick(cb,args){if(validateFunction(cb),setup)setup(),process=globalThis.process;if(process._exiting)return;queue.push({callback:cb,args:@argumentCount()>1\?@Array.prototype.slice.@call(arguments,1):@undefined,frame:@getInternalField(@asyncContext,0)}),@putInternalField(nextTickQueue,0,1)}return nextTick})\n";
+// writeInt16LE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16LECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteInt16LECodeLength = 175;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteInt16LECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteInt16LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt16(offset, value, !0), offset + 2;\n})\n";
-#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
-JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
-{\
- JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().processObjectInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().processObjectInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
-}
-WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
-#undef DEFINE_BUILTIN_GENERATOR
+// writeInt32BE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32BECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteInt32BECodeLength = 175;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteInt32BECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteInt32BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt32(offset, value, !1), offset + 4;\n})\n";
-/* TransformStream.ts */
-// initializeTransformStream
-const JSC::ConstructAbility s_transformStreamInitializeTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamInitializeTransformStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamInitializeTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamInitializeTransformStreamCodeLength = 2041;
-static const JSC::Intrinsic s_transformStreamInitializeTransformStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInitializeTransformStreamCode = "(function (){\"use strict\";let transformer=arguments[0];if(@isObject(transformer)&&@getByIdDirectPrivate(transformer,\"TransformStream\"))return this;let writableStrategy=arguments[1],readableStrategy=arguments[2];if(transformer===@undefined)transformer=null;if(readableStrategy===@undefined)readableStrategy={};if(writableStrategy===@undefined)writableStrategy={};let transformerDict={};if(transformer!==null){if(\"start\"in transformer){if(transformerDict.start=transformer.start,typeof transformerDict.start!==\"function\")@throwTypeError(\"transformer.start should be a function\")}if(\"transform\"in transformer){if(transformerDict.transform=transformer.transform,typeof transformerDict.transform!==\"function\")@throwTypeError(\"transformer.transform should be a function\")}if(\"flush\"in transformer){if(transformerDict.flush=transformer.flush,typeof transformerDict.flush!==\"function\")@throwTypeError(\"transformer.flush should be a function\")}if(\"readableType\"in transformer)@throwRangeError(\"TransformStream transformer has a readableType\");if(\"writableType\"in transformer)@throwRangeError(\"TransformStream transformer has a writableType\")}const readableHighWaterMark=@extractHighWaterMark(readableStrategy,0),readableSizeAlgorithm=@extractSizeAlgorithm(readableStrategy),writableHighWaterMark=@extractHighWaterMark(writableStrategy,1),writableSizeAlgorithm=@extractSizeAlgorithm(writableStrategy),startPromiseCapability=@newPromiseCapability(@Promise);if(@initializeTransformStream(this,startPromiseCapability.promise,writableHighWaterMark,writableSizeAlgorithm,readableHighWaterMark,readableSizeAlgorithm),@setUpTransformStreamDefaultControllerFromTransformer(this,transformer,transformerDict),(\"start\"in transformerDict)){const controller=@getByIdDirectPrivate(this,\"controller\");(()=>@promiseInvokeOrNoopMethodNoCatch(transformer,transformerDict.start,[controller]))().@then(()=>{startPromiseCapability.resolve.@call()},(error)=>{startPromiseCapability.reject.@call(@undefined,error)})}else startPromiseCapability.resolve.@call();return this})\n";
+// writeInt32LE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32LECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteInt32LECodeLength = 175;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteInt32LECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteInt32LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt32(offset, value, !0), offset + 4;\n})\n";
-// readable
-const JSC::ConstructAbility s_transformStreamReadableCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamReadableCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamReadableCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamReadableCodeLength = 158;
-static const JSC::Intrinsic s_transformStreamReadableCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamReadableCode = "(function (){\"use strict\";if(!@isTransformStream(this))throw @makeThisTypeError(\"TransformStream\",\"readable\");return @getByIdDirectPrivate(this,\"readable\")})\n";
+// writeInt8
+const JSC::ConstructAbility s_jsBufferPrototypeWriteInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteInt8CodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteInt8CodeLength = 170;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteInt8CodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteInt8Code = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt8(offset, value), offset + 1;\n})\n";
-// writable
-const JSC::ConstructAbility s_transformStreamWritableCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamWritableCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamWritableCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamWritableCodeLength = 158;
-static const JSC::Intrinsic s_transformStreamWritableCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamWritableCode = "(function (){\"use strict\";if(!@isTransformStream(this))throw @makeThisTypeError(\"TransformStream\",\"writable\");return @getByIdDirectPrivate(this,\"writable\")})\n";
+// writeIntBE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteIntBECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteIntBECodeLength = 957;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteIntBECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteIntBECode = "(function (value, offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1: {\n view.setInt8(offset, value);\n break;\n }\n case 2: {\n view.setInt16(offset, value, !1);\n break;\n }\n case 3: {\n view.setUint16(offset + 1, value & 65535, !1), view.setInt8(offset, Math.floor(value * 0.0000152587890625));\n break;\n }\n case 4: {\n view.setInt32(offset, value, !1);\n break;\n }\n case 5: {\n view.setUint32(offset + 1, value | 0, !1), view.setInt8(offset, Math.floor(value * 0.00000000023283064365386964));\n break;\n }\n case 6: {\n view.setUint32(offset + 2, value | 0, !1), view.setInt16(offset, Math.floor(value * 0.00000000023283064365386964), !1);\n break;\n }\n default:\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n }\n return offset + byteLength;\n})\n";
+
+// writeIntLE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteIntLECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteIntLECodeLength = 957;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteIntLECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteIntLECode = "(function (value, offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1: {\n view.setInt8(offset, value);\n break;\n }\n case 2: {\n view.setInt16(offset, value, !0);\n break;\n }\n case 3: {\n view.setUint16(offset, value & 65535, !0), view.setInt8(offset + 2, Math.floor(value * 0.0000152587890625));\n break;\n }\n case 4: {\n view.setInt32(offset, value, !0);\n break;\n }\n case 5: {\n view.setUint32(offset, value | 0, !0), view.setInt8(offset + 4, Math.floor(value * 0.00000000023283064365386964));\n break;\n }\n case 6: {\n view.setUint32(offset, value | 0, !0), view.setInt16(offset + 4, Math.floor(value * 0.00000000023283064365386964), !0);\n break;\n }\n default:\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n }\n return offset + byteLength;\n})\n";
+
+// writeUInt16BE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16BECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteUInt16BECodeLength = 176;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt16BECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteUInt16BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint16(offset, value, !1), offset + 2;\n})\n";
+
+// writeUInt16LE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16LECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteUInt16LECodeLength = 176;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt16LECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteUInt16LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint16(offset, value, !0), offset + 2;\n})\n";
+
+// writeUInt32BE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32BECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteUInt32BECodeLength = 176;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt32BECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteUInt32BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint32(offset, value, !1), offset + 4;\n})\n";
+
+// writeUInt32LE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32LECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteUInt32LECodeLength = 176;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt32LECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteUInt32LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint32(offset, value, !0), offset + 4;\n})\n";
+
+// writeUInt8
+const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt8CodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteUInt8CodeLength = 171;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt8CodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteUInt8Code = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint8(offset, value), offset + 1;\n})\n";
+
+// writeUIntBE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntBECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteUIntBECodeLength = 963;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteUIntBECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteUIntBECode = "(function (value, offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1: {\n view.setUint8(offset, value);\n break;\n }\n case 2: {\n view.setUint16(offset, value, !1);\n break;\n }\n case 3: {\n view.setUint16(offset + 1, value & 65535, !1), view.setUint8(offset, Math.floor(value * 0.0000152587890625));\n break;\n }\n case 4: {\n view.setUint32(offset, value, !1);\n break;\n }\n case 5: {\n view.setUint32(offset + 1, value | 0, !1), view.setUint8(offset, Math.floor(value * 0.00000000023283064365386964));\n break;\n }\n case 6: {\n view.setUint32(offset + 2, value | 0, !1), view.setUint16(offset, Math.floor(value * 0.00000000023283064365386964), !1);\n break;\n }\n default:\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n }\n return offset + byteLength;\n})\n";
+
+// writeUIntLE
+const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntLECodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_jsBufferPrototypeWriteUIntLECodeLength = 963;
+static const JSC::Intrinsic s_jsBufferPrototypeWriteUIntLECodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_jsBufferPrototypeWriteUIntLECode = "(function (value, offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1: {\n view.setUint8(offset, value);\n break;\n }\n case 2: {\n view.setUint16(offset, value, !0);\n break;\n }\n case 3: {\n view.setUint16(offset, value & 65535, !0), view.setUint8(offset + 2, Math.floor(value * 0.0000152587890625));\n break;\n }\n case 4: {\n view.setUint32(offset, value, !0);\n break;\n }\n case 5: {\n view.setUint32(offset, value | 0, !0), view.setUint8(offset + 4, Math.floor(value * 0.00000000023283064365386964));\n break;\n }\n case 6: {\n view.setUint32(offset, value | 0, !0), view.setUint16(offset + 4, Math.floor(value * 0.00000000023283064365386964), !0);\n break;\n }\n default:\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n }\n return offset + byteLength;\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
{\
JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().transformStreamBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().transformStreamBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+ return clientData->builtinFunctions().jsBufferPrototypeBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().jsBufferPrototypeBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
}
-WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
/* Module.ts */
@@ -714,33 +782,41 @@ WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
const JSC::ConstructAbility s_moduleMainCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_moduleMainCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_moduleMainCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_moduleMainCodeLength = 63;
+const int s_moduleMainCodeLength = 68;
static const JSC::Intrinsic s_moduleMainCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_moduleMainCode = "(function (){\"use strict\";return @requireMap.@get(@Bun.main)})\n";
+const char* const s_moduleMainCode = "(function () {\"use strict\";\n return @requireMap.@get(Bun.main);\n})\n";
+
+// overridableRequire
+const JSC::ConstructAbility s_moduleOverridableRequireCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_moduleOverridableRequireCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_moduleOverridableRequireCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_moduleOverridableRequireCodeLength = 888;
+static const JSC::Intrinsic s_moduleOverridableRequireCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_moduleOverridableRequireCode = "(function (id) {\"use strict\";\n const existing = @requireMap.@get(id) || @requireMap.@get(id = @resolveSync(id, this.path, !1));\n if (existing)\n return @evaluateCommonJSModule(existing), existing.exports;\n if (id.endsWith(\".node\"))\n return @internalRequire(id);\n const mod = @createCommonJSModule(id, {}, !1, this);\n @requireMap.@set(id, mod);\n var out = this.@require(id, mod);\n if (out === -1) {\n try {\n out = @requireESM(id);\n } catch (exception) {\n throw @requireMap.@delete(id), exception;\n }\n const esm = @Loader.registry.@get(id);\n if (esm\?.evaluated && (esm.state \?\? 0) >= @ModuleReady) {\n const namespace = @Loader.getModuleNamespaceObject(esm.module);\n return mod.exports = namespace.__esModule \? namespace : Object.create(namespace, { __esModule: { value: !0 } });\n }\n }\n return @evaluateCommonJSModule(mod), mod.exports;\n})\n";
// require
const JSC::ConstructAbility s_moduleRequireCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_moduleRequireCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_moduleRequireCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_moduleRequireCodeLength = 725;
+const int s_moduleRequireCodeLength = 79;
static const JSC::Intrinsic s_moduleRequireCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_moduleRequireCode = "(function (id){\"use strict\";const existing=@requireMap.@get(id)||@requireMap.@get(id=@resolveSync(id,this.path,!1));if(existing)return @evaluateCommonJSModule(existing),existing.exports;if(id.endsWith(\".node\"))return @internalRequire(id);const mod=@createCommonJSModule(id,{},!1);@requireMap.@set(id,mod);var out=this.@require(id,mod);if(out===-1){try{out=@requireESM(id)}catch(exception){throw @requireMap.@delete(id),exception}const esm=@Loader.registry.@get(id);if(esm\?.evaluated&&(esm.state\?\?0)>=@ModuleReady){const namespace=@Loader.getModuleNamespaceObject(esm.module);return mod.exports=namespace.__esModule\?namespace:Object.create(namespace,{__esModule:{value:!0}})}}return @evaluateCommonJSModule(mod),mod.exports})\n";
-
-// requireResolve
-const JSC::ConstructAbility s_moduleRequireResolveCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_moduleRequireResolveCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_moduleRequireResolveCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_moduleRequireResolveCodeLength = 96;
-static const JSC::Intrinsic s_moduleRequireResolveCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_moduleRequireResolveCode = "(function (id){\"use strict\";return @resolveSync(id,typeof this===\"string\"\?this:this\?.path,!1)})\n";
+const char* const s_moduleRequireCode = "(function (id) {\"use strict\";\n return @overridableRequire.@call(this, id);\n})\n";
// requireNativeModule
const JSC::ConstructAbility s_moduleRequireNativeModuleCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_moduleRequireNativeModuleCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_moduleRequireNativeModuleCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_moduleRequireNativeModuleCodeLength = 203;
+const int s_moduleRequireNativeModuleCodeLength = 229;
static const JSC::Intrinsic s_moduleRequireNativeModuleCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_moduleRequireNativeModuleCode = "(function (id){\"use strict\";let esm=@Loader.registry.@get(id);if(esm\?.evaluated&&(esm.state\?\?0)>=@ModuleReady)return @Loader.getModuleNamespaceObject(esm.module).default;return @requireESM(id).default})\n";
+const char* const s_moduleRequireNativeModuleCode = "(function (id) {\"use strict\";\n let esm = @Loader.registry.@get(id);\n if (esm\?.evaluated && (esm.state \?\? 0) >= @ModuleReady)\n return @Loader.getModuleNamespaceObject(esm.module).default;\n return @requireESM(id).default;\n})\n";
+
+// requireResolve
+const JSC::ConstructAbility s_moduleRequireResolveCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_moduleRequireResolveCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_moduleRequireResolveCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_moduleRequireResolveCodeLength = 110;
+static const JSC::Intrinsic s_moduleRequireResolveCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_moduleRequireResolveCode = "(function (id) {\"use strict\";\n return @resolveSync(id, typeof this === \"string\" \? this : this\?.path, !1);\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
@@ -751,1712 +827,1804 @@ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
-/* JSBufferPrototype.ts */
-// setBigUint64
-const JSC::ConstructAbility s_jsBufferPrototypeSetBigUint64CodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeSetBigUint64CodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeSetBigUint64CodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeSetBigUint64CodeLength = 156;
-static const JSC::Intrinsic s_jsBufferPrototypeSetBigUint64CodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeSetBigUint64Code = "(function (offset,value,le){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setBigUint64(offset,value,le)})\n";
+/* ProcessObjectInternals.ts */
+// getStdinStream
+const JSC::ConstructAbility s_processObjectInternalsGetStdinStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_processObjectInternalsGetStdinStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_processObjectInternalsGetStdinStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_processObjectInternalsGetStdinStreamCodeLength = 1948;
+static const JSC::Intrinsic s_processObjectInternalsGetStdinStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_processObjectInternalsGetStdinStreamCode = "(function (fd) {\"use strict\";\n var reader, readerRef;\n function ref() {\n reader \?\?= Bun.stdin.stream().getReader(), readerRef \?\?= setInterval(() => {\n }, 1 << 30);\n }\n function unref() {\n if (readerRef)\n clearInterval(readerRef), readerRef = @undefined;\n if (reader)\n reader.cancel(), reader = @undefined;\n }\n const tty = @getInternalField(@internalModuleRegistry, 46) || @createInternalModuleById(46), stream = new ((tty.isatty(fd)) \? tty.ReadStream : ((@getInternalField(@internalModuleRegistry, 21)) || (@createInternalModuleById(21))).ReadStream)(fd), originalOn = stream.on;\n stream.on = function(event, listener) {\n if (event === \"readable\")\n ref();\n return originalOn.@call(this, event, listener);\n }, stream.fd = fd;\n const originalPause = stream.pause;\n stream.pause = function() {\n return unref(), originalPause.@call(this);\n };\n const originalResume = stream.resume;\n stream.resume = function() {\n return ref(), originalResume.@call(this);\n };\n async function internalRead(stream2) {\n try {\n var done, value;\n const read = reader\?.readMany();\n if (@isPromise(read))\n ({ done, value } = await read);\n else\n ({ done, value } = read);\n if (!done) {\n stream2.push(value[0]);\n const length = value.length;\n for (let i = 1;i < length; i++)\n stream2.push(value[i]);\n } else\n stream2.emit(\"end\"), stream2.pause();\n } catch (err) {\n stream2.destroy(err);\n }\n }\n return stream._read = function(size) {\n internalRead(this);\n }, stream.on(\"resume\", () => {\n ref(), stream._undestroy();\n }), stream._readableState.reading = !1, stream.on(\"pause\", () => {\n process.nextTick(() => {\n if (!stream.readableFlowing)\n stream._readableState.reading = !1;\n });\n }), stream.on(\"close\", () => {\n process.nextTick(() => {\n stream.destroy(), unref();\n });\n }), stream;\n})\n";
-// readInt8
-const JSC::ConstructAbility s_jsBufferPrototypeReadInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadInt8CodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadInt8CodeLength = 133;
-static const JSC::Intrinsic s_jsBufferPrototypeReadInt8CodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadInt8Code = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getInt8(offset)})\n";
+// getStdioWriteStream
+const JSC::ConstructAbility s_processObjectInternalsGetStdioWriteStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_processObjectInternalsGetStdioWriteStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_processObjectInternalsGetStdioWriteStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_processObjectInternalsGetStdioWriteStreamCodeLength = 789;
+static const JSC::Intrinsic s_processObjectInternalsGetStdioWriteStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_processObjectInternalsGetStdioWriteStreamCode = "(function (fd) {\"use strict\";\n const stream = (@getInternalField(@internalModuleRegistry, 46) || @createInternalModuleById(46)).WriteStream(fd);\n if (process.on(\"SIGWINCH\", () => {\n stream._refreshSize();\n }), fd === 1)\n stream.destroySoon = stream.destroy, stream._destroy = function(err, cb) {\n if (cb(err), this._undestroy(), !this._writableState.emitClose)\n process.nextTick(() => {\n this.emit(\"close\");\n });\n };\n else if (fd === 2)\n stream.destroySoon = stream.destroy, stream._destroy = function(err, cb) {\n if (cb(err), this._undestroy(), !this._writableState.emitClose)\n process.nextTick(() => {\n this.emit(\"close\");\n });\n };\n return stream._type = \"tty\", stream._isStdio = !0, stream.fd = fd, stream;\n})\n";
-// readUInt8
-const JSC::ConstructAbility s_jsBufferPrototypeReadUInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadUInt8CodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadUInt8CodeLength = 134;
-static const JSC::Intrinsic s_jsBufferPrototypeReadUInt8CodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadUInt8Code = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getUint8(offset)})\n";
+// initializeNextTickQueue
+const JSC::ConstructAbility s_processObjectInternalsInitializeNextTickQueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_processObjectInternalsInitializeNextTickQueueCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_processObjectInternalsInitializeNextTickQueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_processObjectInternalsInitializeNextTickQueueCodeLength = 3648;
+static const JSC::Intrinsic s_processObjectInternalsInitializeNextTickQueueCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_processObjectInternalsInitializeNextTickQueueCode = "(function (process, nextTickQueue, drainMicrotasksFn, reportUncaughtExceptionFn) {\"use strict\";\n var queue, process, nextTickQueue = nextTickQueue, drainMicrotasks = drainMicrotasksFn, reportUncaughtException = reportUncaughtExceptionFn;\n function validateFunction(cb) {\n if (typeof cb !== \"function\") {\n const err = @makeTypeError(`The \"callback\" argument must be of type \"function\". Received type ${typeof cb}`);\n throw err.code = \"ERR_INVALID_ARG_TYPE\", err;\n }\n }\n var setup = () => {\n queue = function createQueue() {\n\n class FixedCircularBuffer {\n top;\n bottom;\n list;\n next;\n constructor() {\n this.bottom = 0, this.top = 0, this.list = @newArrayWithSize(2048), this.next = null;\n }\n isEmpty() {\n return this.top === this.bottom;\n }\n isFull() {\n return (this.top + 1 & 2047) === this.bottom;\n }\n push(data) {\n this.list[this.top] = data, this.top = this.top + 1 & 2047;\n }\n shift() {\n var { list, bottom } = this;\n const nextItem = list[bottom];\n if (nextItem === @undefined)\n return null;\n return list[bottom] = @undefined, this.bottom = bottom + 1 & 2047, nextItem;\n }\n }\n\n class FixedQueue {\n head;\n tail;\n constructor() {\n this.head = this.tail = new FixedCircularBuffer;\n }\n isEmpty() {\n return this.head.isEmpty();\n }\n push(data) {\n if (this.head.isFull())\n this.head = this.head.next = new FixedCircularBuffer;\n this.head.push(data);\n }\n shift() {\n const tail = this.tail, next = tail.shift();\n if (tail.isEmpty() && tail.next !== null)\n this.tail = tail.next, tail.next = null;\n return next;\n }\n }\n return new FixedQueue;\n }();\n function processTicksAndRejections() {\n var tock;\n do {\n while ((tock = queue.shift()) !== null) {\n var { callback, args, frame } = tock, restore = @getInternalField(@asyncContext, 0);\n @putInternalField(@asyncContext, 0, frame);\n try {\n if (args === @undefined)\n callback();\n else\n switch (args.length) {\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n case 4:\n callback(args[0], args[1], args[2], args[3]);\n break;\n default:\n callback(...args);\n break;\n }\n } catch (e) {\n reportUncaughtException(e);\n } finally {\n @putInternalField(@asyncContext, 0, restore);\n }\n }\n drainMicrotasks();\n } while (!queue.isEmpty());\n }\n @putInternalField(nextTickQueue, 0, 0), @putInternalField(nextTickQueue, 1, queue), @putInternalField(nextTickQueue, 2, processTicksAndRejections), setup = @undefined;\n };\n function nextTick(cb, args) {\n if (validateFunction(cb), setup)\n setup(), process = globalThis.process;\n if (process._exiting)\n return;\n queue.push({\n callback: cb,\n args: @argumentCount() > 1 \? @Array.prototype.slice.@call(arguments, 1) : @undefined,\n frame: @getInternalField(@asyncContext, 0)\n }), @putInternalField(nextTickQueue, 0, 1);\n }\n return nextTick;\n})\n";
-// readInt16LE
-const JSC::ConstructAbility s_jsBufferPrototypeReadInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadInt16LECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadInt16LECodeLength = 137;
-static const JSC::Intrinsic s_jsBufferPrototypeReadInt16LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadInt16LECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getInt16(offset,!0)})\n";
+// mainModule
+const JSC::ConstructAbility s_processObjectInternalsMainModuleCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_processObjectInternalsMainModuleCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_processObjectInternalsMainModuleCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_processObjectInternalsMainModuleCodeLength = 68;
+static const JSC::Intrinsic s_processObjectInternalsMainModuleCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_processObjectInternalsMainModuleCode = "(function () {\"use strict\";\n return @requireMap.@get(Bun.main);\n})\n";
-// readInt16BE
-const JSC::ConstructAbility s_jsBufferPrototypeReadInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadInt16BECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadInt16BECodeLength = 137;
-static const JSC::Intrinsic s_jsBufferPrototypeReadInt16BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadInt16BECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getInt16(offset,!1)})\n";
+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
+{\
+ JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
+ return clientData->builtinFunctions().processObjectInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().processObjectInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+}
+WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
-// readUInt16LE
-const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16LECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadUInt16LECodeLength = 138;
-static const JSC::Intrinsic s_jsBufferPrototypeReadUInt16LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadUInt16LECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getUint16(offset,!0)})\n";
+/* ReadableByteStreamController.ts */
+// byobRequest
+const JSC::ConstructAbility s_readableByteStreamControllerByobRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamControllerByobRequestCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamControllerByobRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamControllerByobRequestCodeLength = 738;
+static const JSC::Intrinsic s_readableByteStreamControllerByobRequestCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamControllerByobRequestCode = "(function () {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeGetterTypeError(\"ReadableByteStreamController\", \"byobRequest\");\n var request = @getByIdDirectPrivate(this, \"byobRequest\");\n if (request === @undefined) {\n var pending = @getByIdDirectPrivate(this, \"pendingPullIntos\");\n const firstDescriptor = pending.peek();\n if (firstDescriptor) {\n const view = new @Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled);\n @putByIdDirectPrivate(this, \"byobRequest\", new @ReadableStreamBYOBRequest(this, view, @isReadableStream));\n }\n }\n return @getByIdDirectPrivate(this, \"byobRequest\");\n})\n";
-// readUInt16BE
-const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16BECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadUInt16BECodeLength = 138;
-static const JSC::Intrinsic s_jsBufferPrototypeReadUInt16BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadUInt16BECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getUint16(offset,!1)})\n";
+// close
+const JSC::ConstructAbility s_readableByteStreamControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamControllerCloseCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamControllerCloseCodeLength = 458;
+static const JSC::Intrinsic s_readableByteStreamControllerCloseCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamControllerCloseCode = "(function () {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeThisTypeError(\"ReadableByteStreamController\", \"close\");\n if (@getByIdDirectPrivate(this, \"closeRequested\"))\n @throwTypeError(\"Close has already been requested\");\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(this, \"controlledReadableStream\"), \"state\") !== 4)\n @throwTypeError(\"ReadableStream is not readable\");\n @readableByteStreamControllerClose(this);\n})\n";
-// readInt32LE
-const JSC::ConstructAbility s_jsBufferPrototypeReadInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadInt32LECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadInt32LECodeLength = 137;
-static const JSC::Intrinsic s_jsBufferPrototypeReadInt32LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadInt32LECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getInt32(offset,!0)})\n";
+// desiredSize
+const JSC::ConstructAbility s_readableByteStreamControllerDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamControllerDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamControllerDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamControllerDesiredSizeCodeLength = 216;
+static const JSC::Intrinsic s_readableByteStreamControllerDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamControllerDesiredSizeCode = "(function () {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeGetterTypeError(\"ReadableByteStreamController\", \"desiredSize\");\n return @readableByteStreamControllerGetDesiredSize(this);\n})\n";
-// readInt32BE
-const JSC::ConstructAbility s_jsBufferPrototypeReadInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadInt32BECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadInt32BECodeLength = 137;
-static const JSC::Intrinsic s_jsBufferPrototypeReadInt32BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadInt32BECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getInt32(offset,!1)})\n";
+// enqueue
+const JSC::ConstructAbility s_readableByteStreamControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamControllerEnqueueCodeLength = 615;
+static const JSC::Intrinsic s_readableByteStreamControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamControllerEnqueueCode = "(function (chunk) {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeThisTypeError(\"ReadableByteStreamController\", \"enqueue\");\n if (@getByIdDirectPrivate(this, \"closeRequested\"))\n @throwTypeError(\"ReadableByteStreamController is requested to close\");\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(this, \"controlledReadableStream\"), \"state\") !== 4)\n @throwTypeError(\"ReadableStream is not readable\");\n if (!@isObject(chunk) || !@ArrayBuffer.@isView(chunk))\n @throwTypeError(\"Provided chunk is not a TypedArray\");\n return @readableByteStreamControllerEnqueue(this, chunk);\n})\n";
-// readUInt32LE
-const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32LECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadUInt32LECodeLength = 138;
-static const JSC::Intrinsic s_jsBufferPrototypeReadUInt32LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadUInt32LECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getUint32(offset,!0)})\n";
+// error
+const JSC::ConstructAbility s_readableByteStreamControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamControllerErrorCodeLength = 360;
+static const JSC::Intrinsic s_readableByteStreamControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamControllerErrorCode = "(function (error) {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeThisTypeError(\"ReadableByteStreamController\", \"error\");\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(this, \"controlledReadableStream\"), \"state\") !== 4)\n @throwTypeError(\"ReadableStream is not readable\");\n @readableByteStreamControllerError(this, error);\n})\n";
-// readUInt32BE
-const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32BECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadUInt32BECodeLength = 138;
-static const JSC::Intrinsic s_jsBufferPrototypeReadUInt32BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadUInt32BECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getUint32(offset,!1)})\n";
+// initializeReadableByteStreamController
+const JSC::ConstructAbility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeLength = 351;
+static const JSC::Intrinsic s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamControllerInitializeReadableByteStreamControllerCode = "(function (stream, underlyingByteSource, highWaterMark) {\"use strict\";\n if (arguments.length !== 4 && arguments[3] !== @isReadableStream)\n @throwTypeError(\"ReadableByteStreamController constructor should not be called directly\");\n return @privateInitializeReadableByteStreamController.@call(this, stream, underlyingByteSource, highWaterMark);\n})\n";
-// readIntLE
-const JSC::ConstructAbility s_jsBufferPrototypeReadIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadIntLECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadIntLECodeLength = 650;
-static const JSC::Intrinsic s_jsBufferPrototypeReadIntLECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadIntLECode = "(function (offset,byteLength){\"use strict\";const view=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(byteLength){case 1:return view.getInt8(offset);case 2:return view.getInt16(offset,!0);case 3:{const val=view.getUint16(offset,!0)+view.getUint8(offset+2)*65536;return val|(val&8388608)*510}case 4:return view.getInt32(offset,!0);case 5:{const last=view.getUint8(offset+4);return(last|(last&128)*33554430)*4294967296+view.getUint32(offset,!0)}case 6:{const last=view.getUint16(offset+4,!0);return(last|(last&32768)*131070)*4294967296+view.getUint32(offset,!0)}}@throwRangeError(\"byteLength must be >= 1 and <= 6\")})\n";
+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
+{\
+ JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
+ return clientData->builtinFunctions().readableByteStreamControllerBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableByteStreamControllerBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+}
+WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
-// readIntBE
-const JSC::ConstructAbility s_jsBufferPrototypeReadIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadIntBECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadIntBECodeLength = 650;
-static const JSC::Intrinsic s_jsBufferPrototypeReadIntBECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadIntBECode = "(function (offset,byteLength){\"use strict\";const view=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(byteLength){case 1:return view.getInt8(offset);case 2:return view.getInt16(offset,!1);case 3:{const val=view.getUint16(offset+1,!1)+view.getUint8(offset)*65536;return val|(val&8388608)*510}case 4:return view.getInt32(offset,!1);case 5:{const last=view.getUint8(offset);return(last|(last&128)*33554430)*4294967296+view.getUint32(offset+1,!1)}case 6:{const last=view.getUint16(offset,!1);return(last|(last&32768)*131070)*4294967296+view.getUint32(offset+2,!1)}}@throwRangeError(\"byteLength must be >= 1 and <= 6\")})\n";
+/* ReadableByteStreamInternals.ts */
+// isReadableByteStreamController
+const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsIsReadableByteStreamControllerCodeLength = 136;
+static const JSC::Intrinsic s_readableByteStreamInternalsIsReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsIsReadableByteStreamControllerCode = "(function (controller) {\"use strict\";\n return @isObject(controller) && !!@getByIdDirectPrivate(controller, \"underlyingByteSource\");\n})\n";
-// readUIntLE
-const JSC::ConstructAbility s_jsBufferPrototypeReadUIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadUIntLECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadUIntLECodeLength = 543;
-static const JSC::Intrinsic s_jsBufferPrototypeReadUIntLECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadUIntLECode = "(function (offset,byteLength){\"use strict\";const view=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(byteLength){case 1:return view.getUint8(offset);case 2:return view.getUint16(offset,!0);case 3:return view.getUint16(offset,!0)+view.getUint8(offset+2)*65536;case 4:return view.getUint32(offset,!0);case 5:return view.getUint8(offset+4)*4294967296+view.getUint32(offset,!0);case 6:return view.getUint16(offset+4,!0)*4294967296+view.getUint32(offset,!0)}@throwRangeError(\"byteLength must be >= 1 and <= 6\")})\n";
+// isReadableStreamBYOBReader
+const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeLength = 120;
+static const JSC::Intrinsic s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsIsReadableStreamBYOBReaderCode = "(function (reader) {\"use strict\";\n return @isObject(reader) && !!@getByIdDirectPrivate(reader, \"readIntoRequests\");\n})\n";
-// readUIntBE
-const JSC::ConstructAbility s_jsBufferPrototypeReadUIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadUIntBECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadUIntBECodeLength = 620;
-static const JSC::Intrinsic s_jsBufferPrototypeReadUIntBECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadUIntBECode = "(function (offset,byteLength){\"use strict\";const view=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(byteLength){case 1:return view.getUint8(offset);case 2:return view.getUint16(offset,!1);case 3:return view.getUint16(offset+1,!1)+view.getUint8(offset)*65536;case 4:return view.getUint32(offset,!1);case 5:{const last=view.getUint8(offset);return(last|(last&128)*33554430)*4294967296+view.getUint32(offset+1,!1)}case 6:{const last=view.getUint16(offset,!1);return(last|(last&32768)*131070)*4294967296+view.getUint32(offset+2,!1)}}@throwRangeError(\"byteLength must be >= 1 and <= 6\")})\n";
+// isReadableStreamBYOBRequest
+const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeLength = 157;
+static const JSC::Intrinsic s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsIsReadableStreamBYOBRequestCode = "(function (byobRequest) {\"use strict\";\n return @isObject(byobRequest) && !!@getByIdDirectPrivate(byobRequest, \"associatedReadableByteStreamController\");\n})\n";
-// readFloatLE
-const JSC::ConstructAbility s_jsBufferPrototypeReadFloatLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadFloatLECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadFloatLECodeLength = 139;
-static const JSC::Intrinsic s_jsBufferPrototypeReadFloatLECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadFloatLECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getFloat32(offset,!0)})\n";
+// privateInitializeReadableByteStreamController
+const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength = 2063;
+static const JSC::Intrinsic s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode = "(function (stream, underlyingByteSource, highWaterMark) {\"use strict\";\n if (!@isReadableStream(stream))\n @throwTypeError(\"ReadableByteStreamController needs a ReadableStream\");\n if (@getByIdDirectPrivate(stream, \"readableStreamController\") !== null)\n @throwTypeError(\"ReadableStream already has a controller\");\n @putByIdDirectPrivate(this, \"controlledReadableStream\", stream), @putByIdDirectPrivate(this, \"underlyingByteSource\", underlyingByteSource), @putByIdDirectPrivate(this, \"pullAgain\", !1), @putByIdDirectPrivate(this, \"pulling\", !1), @readableByteStreamControllerClearPendingPullIntos(this), @putByIdDirectPrivate(this, \"queue\", @newQueue()), @putByIdDirectPrivate(this, \"started\", 0), @putByIdDirectPrivate(this, \"closeRequested\", !1);\n let hwm = @toNumber(highWaterMark);\n if (hwm !== hwm || hwm < 0)\n @throwRangeError(\"highWaterMark value is negative or not a number\");\n @putByIdDirectPrivate(this, \"strategyHWM\", hwm);\n let autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;\n if (autoAllocateChunkSize !== @undefined) {\n if (autoAllocateChunkSize = @toNumber(autoAllocateChunkSize), autoAllocateChunkSize <= 0 || autoAllocateChunkSize === @Infinity || autoAllocateChunkSize === -@Infinity)\n @throwRangeError(\"autoAllocateChunkSize value is negative or equal to positive or negative infinity\");\n }\n @putByIdDirectPrivate(this, \"autoAllocateChunkSize\", autoAllocateChunkSize), @putByIdDirectPrivate(this, \"pendingPullIntos\", @createFIFO());\n const controller = this;\n return @promiseInvokeOrNoopNoCatch(@getByIdDirectPrivate(controller, \"underlyingByteSource\"), \"start\", [controller]).@then(() => {\n @putByIdDirectPrivate(controller, \"started\", 1), @readableByteStreamControllerCallPullIfNeeded(controller);\n }, (error) => {\n if (@getByIdDirectPrivate(stream, \"state\") === 4)\n @readableByteStreamControllerError(controller, error);\n }), @putByIdDirectPrivate(this, \"cancel\", @readableByteStreamControllerCancel), @putByIdDirectPrivate(this, \"pull\", @readableByteStreamControllerPull), this;\n})\n";
-// readFloatBE
-const JSC::ConstructAbility s_jsBufferPrototypeReadFloatBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadFloatBECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadFloatBECodeLength = 139;
-static const JSC::Intrinsic s_jsBufferPrototypeReadFloatBECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadFloatBECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getFloat32(offset,!1)})\n";
+// privateInitializeReadableStreamBYOBRequest
+const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeLength = 175;
+static const JSC::Intrinsic s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCode = "(function (controller, view) {\"use strict\";\n @putByIdDirectPrivate(this, \"associatedReadableByteStreamController\", controller), @putByIdDirectPrivate(this, \"view\", view);\n})\n";
-// readDoubleLE
-const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleLECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadDoubleLECodeLength = 139;
-static const JSC::Intrinsic s_jsBufferPrototypeReadDoubleLECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadDoubleLECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getFloat64(offset,!0)})\n";
+// readableByteStreamControllerCallPullIfNeeded
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeLength = 828;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCode = "(function (controller) {\"use strict\";\n if (!@readableByteStreamControllerShouldCallPull(controller))\n return;\n if (@getByIdDirectPrivate(controller, \"pulling\")) {\n @putByIdDirectPrivate(controller, \"pullAgain\", !0);\n return;\n }\n @putByIdDirectPrivate(controller, \"pulling\", !0), @promiseInvokeOrNoop(@getByIdDirectPrivate(controller, \"underlyingByteSource\"), \"pull\", [controller]).@then(() => {\n if (@putByIdDirectPrivate(controller, \"pulling\", !1), @getByIdDirectPrivate(controller, \"pullAgain\"))\n @putByIdDirectPrivate(controller, \"pullAgain\", !1), @readableByteStreamControllerCallPullIfNeeded(controller);\n }, (error) => {\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), \"state\") === 4)\n @readableByteStreamControllerError(controller, error);\n });\n})\n";
-// readDoubleBE
-const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleBECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadDoubleBECodeLength = 139;
-static const JSC::Intrinsic s_jsBufferPrototypeReadDoubleBECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadDoubleBECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getFloat64(offset,!1)})\n";
+// readableByteStreamControllerCancel
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeLength = 369;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerCancelCode = "(function (controller, reason) {\"use strict\";\n var pendingPullIntos = @getByIdDirectPrivate(controller, \"pendingPullIntos\"), first = pendingPullIntos.peek();\n if (first)\n first.bytesFilled = 0;\n return @putByIdDirectPrivate(controller, \"queue\", @newQueue()), @promiseInvokeOrNoop(@getByIdDirectPrivate(controller, \"underlyingByteSource\"), \"cancel\", [reason]);\n})\n";
-// readBigInt64LE
-const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64LECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadBigInt64LECodeLength = 140;
-static const JSC::Intrinsic s_jsBufferPrototypeReadBigInt64LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadBigInt64LECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getBigInt64(offset,!0)})\n";
+// readableByteStreamControllerClearPendingPullIntos
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeLength = 313;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCode = "(function (controller) {\"use strict\";\n @readableByteStreamControllerInvalidateBYOBRequest(controller);\n var existing = @getByIdDirectPrivate(controller, \"pendingPullIntos\");\n if (existing !== @undefined)\n existing.clear();\n else\n @putByIdDirectPrivate(controller, \"pendingPullIntos\", @createFIFO());\n})\n";
-// readBigInt64BE
-const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64BECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadBigInt64BECodeLength = 140;
-static const JSC::Intrinsic s_jsBufferPrototypeReadBigInt64BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadBigInt64BECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getBigInt64(offset,!1)})\n";
+// readableByteStreamControllerClose
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeLength = 551;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerCloseCode = "(function (controller) {\"use strict\";\n if (@getByIdDirectPrivate(controller, \"queue\").size > 0) {\n @putByIdDirectPrivate(controller, \"closeRequested\", !0);\n return;\n }\n var first = @getByIdDirectPrivate(controller, \"pendingPullIntos\")\?.peek();\n if (first) {\n if (first.bytesFilled > 0) {\n const e = @makeTypeError(\"Close requested while there remain pending bytes\");\n throw @readableByteStreamControllerError(controller, e), e;\n }\n }\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n})\n";
-// readBigUInt64LE
-const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64LECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadBigUInt64LECodeLength = 141;
-static const JSC::Intrinsic s_jsBufferPrototypeReadBigUInt64LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadBigUInt64LECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getBigUint64(offset,!0)})\n";
+// readableByteStreamControllerCommitDescriptor
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeLength = 420;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCode = "(function (stream, pullIntoDescriptor) {\"use strict\";\n let done = !1;\n if (@getByIdDirectPrivate(stream, \"state\") === 1)\n done = !0;\n let filledView = @readableByteStreamControllerConvertDescriptor(pullIntoDescriptor);\n if (pullIntoDescriptor.readerType === \"default\")\n @readableStreamFulfillReadRequest(stream, filledView, done);\n else\n @readableStreamFulfillReadIntoRequest(stream, filledView, done);\n})\n";
-// readBigUInt64BE
-const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64BECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeReadBigUInt64BECodeLength = 141;
-static const JSC::Intrinsic s_jsBufferPrototypeReadBigUInt64BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadBigUInt64BECode = "(function (offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).getBigUint64(offset,!1)})\n";
+// readableByteStreamControllerConvertDescriptor
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeLength = 210;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCode = "(function (pullIntoDescriptor) {\"use strict\";\n return new pullIntoDescriptor.ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, pullIntoDescriptor.bytesFilled / pullIntoDescriptor.elementSize);\n})\n";
-// writeInt8
-const JSC::ConstructAbility s_jsBufferPrototypeWriteInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteInt8CodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteInt8CodeLength = 154;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteInt8CodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteInt8Code = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt8(offset,value),offset+1})\n";
+// readableByteStreamControllerEnqueue
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeLength = 1217;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCode = "(function (controller, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n switch (@getByIdDirectPrivate(stream, \"reader\") \? @readableStreamReaderKind(@getByIdDirectPrivate(stream, \"reader\")) : 0) {\n case 1: {\n if (!@getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\")\?.isNotEmpty())\n @readableByteStreamControllerEnqueueChunk(controller, @transferBufferToCurrentRealm(chunk.buffer), chunk.byteOffset, chunk.byteLength);\n else {\n const transferredView = chunk.constructor === @Uint8Array \? chunk : new @Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n @readableStreamFulfillReadRequest(stream, transferredView, !1);\n }\n break;\n }\n case 2: {\n @readableByteStreamControllerEnqueueChunk(controller, @transferBufferToCurrentRealm(chunk.buffer), chunk.byteOffset, chunk.byteLength), @readableByteStreamControllerProcessPullDescriptors(controller);\n break;\n }\n case 3:\n break;\n default: {\n @readableByteStreamControllerEnqueueChunk(controller, @transferBufferToCurrentRealm(chunk.buffer), chunk.byteOffset, chunk.byteLength);\n break;\n }\n }\n})\n";
-// writeUInt8
-const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt8CodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteUInt8CodeLength = 155;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt8CodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteUInt8Code = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint8(offset,value),offset+1})\n";
+// readableByteStreamControllerEnqueueChunk
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeLength = 245;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode = "(function (controller, buffer, byteOffset, byteLength) {\"use strict\";\n @getByIdDirectPrivate(controller, \"queue\").content.push({\n buffer,\n byteOffset,\n byteLength\n }), @getByIdDirectPrivate(controller, \"queue\").size += byteLength;\n})\n";
-// writeInt16LE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16LECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteInt16LECodeLength = 158;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteInt16LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteInt16LECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt16(offset,value,!0),offset+2})\n";
+// readableByteStreamControllerError
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeLength = 255;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerErrorCode = "(function (controller, e) {\"use strict\";\n @readableByteStreamControllerClearPendingPullIntos(controller), @putByIdDirectPrivate(controller, \"queue\", @newQueue()), @readableStreamError(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), e);\n})\n";
-// writeInt16BE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16BECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteInt16BECodeLength = 158;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteInt16BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteInt16BECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt16(offset,value,!1),offset+2})\n";
+// readableByteStreamControllerFillDescriptorFromQueue
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeLength = 1695;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode = "(function (controller, pullIntoDescriptor) {\"use strict\";\n const currentAlignedBytes = pullIntoDescriptor.bytesFilled - pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize, maxBytesToCopy = @getByIdDirectPrivate(controller, \"queue\").size < pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled \? @getByIdDirectPrivate(controller, \"queue\").size : pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled, maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy, maxAlignedBytes = maxBytesFilled - maxBytesFilled % pullIntoDescriptor.elementSize;\n let totalBytesToCopyRemaining = maxBytesToCopy, ready = !1;\n if (maxAlignedBytes > currentAlignedBytes)\n totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled, ready = !0;\n while (totalBytesToCopyRemaining > 0) {\n let headOfQueue = @getByIdDirectPrivate(controller, \"queue\").content.peek();\n const bytesToCopy = totalBytesToCopyRemaining < headOfQueue.byteLength \? totalBytesToCopyRemaining : headOfQueue.byteLength, destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n if (new @Uint8Array(pullIntoDescriptor.buffer).set(new @Uint8Array(headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy), destStart), headOfQueue.byteLength === bytesToCopy)\n @getByIdDirectPrivate(controller, \"queue\").content.shift();\n else\n headOfQueue.byteOffset += bytesToCopy, headOfQueue.byteLength -= bytesToCopy;\n @getByIdDirectPrivate(controller, \"queue\").size -= bytesToCopy, @readableByteStreamControllerInvalidateBYOBRequest(controller), pullIntoDescriptor.bytesFilled += bytesToCopy, totalBytesToCopyRemaining -= bytesToCopy;\n }\n return ready;\n})\n";
-// writeUInt16LE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16LECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteUInt16LECodeLength = 159;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt16LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteUInt16LECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint16(offset,value,!0),offset+2})\n";
+// readableByteStreamControllerGetDesiredSize
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeLength = 347;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (state === 3)\n return null;\n if (state === 1)\n return 0;\n return @getByIdDirectPrivate(controller, \"strategyHWM\") - @getByIdDirectPrivate(controller, \"queue\").size;\n})\n";
-// writeUInt16BE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16BECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteUInt16BECodeLength = 159;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt16BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteUInt16BECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint16(offset,value,!1),offset+2})\n";
+// readableByteStreamControllerHandleQueueDrain
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeLength = 311;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCode = "(function (controller) {\"use strict\";\n if (!@getByIdDirectPrivate(controller, \"queue\").size && @getByIdDirectPrivate(controller, \"closeRequested\"))\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n else\n @readableByteStreamControllerCallPullIfNeeded(controller);\n})\n";
-// writeInt32LE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32LECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteInt32LECodeLength = 158;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteInt32LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteInt32LECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt32(offset,value,!0),offset+4})\n";
+// readableByteStreamControllerInvalidateBYOBRequest
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeLength = 406;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCode = "(function (controller) {\"use strict\";\n if (@getByIdDirectPrivate(controller, \"byobRequest\") === @undefined)\n return;\n const byobRequest = @getByIdDirectPrivate(controller, \"byobRequest\");\n @putByIdDirectPrivate(byobRequest, \"associatedReadableByteStreamController\", @undefined), @putByIdDirectPrivate(byobRequest, \"view\", @undefined), @putByIdDirectPrivate(controller, \"byobRequest\", @undefined);\n})\n";
-// writeInt32BE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32BECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteInt32BECodeLength = 158;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteInt32BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteInt32BECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt32(offset,value,!1),offset+4})\n";
+// readableByteStreamControllerProcessPullDescriptors
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeLength = 587;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCode = "(function (controller) {\"use strict\";\n while (@getByIdDirectPrivate(controller, \"pendingPullIntos\").isNotEmpty()) {\n if (@getByIdDirectPrivate(controller, \"queue\").size === 0)\n return;\n let pullIntoDescriptor = @getByIdDirectPrivate(controller, \"pendingPullIntos\").peek();\n if (@readableByteStreamControllerFillDescriptorFromQueue(controller, pullIntoDescriptor))\n @readableByteStreamControllerShiftPendingDescriptor(controller), @readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), pullIntoDescriptor);\n }\n})\n";
-// writeUInt32LE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32LECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteUInt32LECodeLength = 159;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt32LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteUInt32LECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint32(offset,value,!0),offset+4})\n";
+// readableByteStreamControllerPull
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerPullCodeLength = 1397;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerPullCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@getByIdDirectPrivate(controller, \"queue\").content\?.isNotEmpty()) {\n const entry = @getByIdDirectPrivate(controller, \"queue\").content.shift();\n @getByIdDirectPrivate(controller, \"queue\").size -= entry.byteLength, @readableByteStreamControllerHandleQueueDrain(controller);\n let view;\n try {\n view = new @Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);\n } catch (error) {\n return @Promise.@reject(error);\n }\n return @createFulfilledPromise({ value: view, done: !1 });\n }\n if (@getByIdDirectPrivate(controller, \"autoAllocateChunkSize\") !== @undefined) {\n let buffer;\n try {\n buffer = @createUninitializedArrayBuffer(@getByIdDirectPrivate(controller, \"autoAllocateChunkSize\"));\n } catch (error) {\n return @Promise.@reject(error);\n }\n const pullIntoDescriptor = {\n buffer,\n byteOffset: 0,\n byteLength: @getByIdDirectPrivate(controller, \"autoAllocateChunkSize\"),\n bytesFilled: 0,\n elementSize: 1,\n ctor: @Uint8Array,\n readerType: \"default\"\n };\n @getByIdDirectPrivate(controller, \"pendingPullIntos\").push(pullIntoDescriptor);\n }\n const promise = @readableStreamAddReadRequest(stream);\n return @readableByteStreamControllerCallPullIfNeeded(controller), promise;\n})\n";
-// writeUInt32BE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32BECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteUInt32BECodeLength = 159;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt32BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteUInt32BECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint32(offset,value,!1),offset+4})\n";
+// readableByteStreamControllerPullInto
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeLength = 1871;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCode = "(function (controller, view) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n let elementSize = 1;\n if (view.BYTES_PER_ELEMENT !== @undefined)\n elementSize = view.BYTES_PER_ELEMENT;\n const ctor = view.constructor, pullIntoDescriptor = {\n buffer: view.buffer,\n byteOffset: view.byteOffset,\n byteLength: view.byteLength,\n bytesFilled: 0,\n elementSize,\n ctor,\n readerType: \"byob\"\n };\n var pending = @getByIdDirectPrivate(controller, \"pendingPullIntos\");\n if (pending\?.isNotEmpty())\n return pullIntoDescriptor.buffer = @transferBufferToCurrentRealm(pullIntoDescriptor.buffer), pending.push(pullIntoDescriptor), @readableStreamAddReadIntoRequest(stream);\n if (@getByIdDirectPrivate(stream, \"state\") === 1) {\n const emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0);\n return @createFulfilledPromise({ value: emptyView, done: !0 });\n }\n if (@getByIdDirectPrivate(controller, \"queue\").size > 0) {\n if (@readableByteStreamControllerFillDescriptorFromQueue(controller, pullIntoDescriptor)) {\n const filledView = @readableByteStreamControllerConvertDescriptor(pullIntoDescriptor);\n return @readableByteStreamControllerHandleQueueDrain(controller), @createFulfilledPromise({ value: filledView, done: !1 });\n }\n if (@getByIdDirectPrivate(controller, \"closeRequested\")) {\n const e = @makeTypeError(\"Closing stream has been requested\");\n return @readableByteStreamControllerError(controller, e), @Promise.@reject(e);\n }\n }\n pullIntoDescriptor.buffer = @transferBufferToCurrentRealm(pullIntoDescriptor.buffer), @getByIdDirectPrivate(controller, \"pendingPullIntos\").push(pullIntoDescriptor);\n const promise = @readableStreamAddReadIntoRequest(stream);\n return @readableByteStreamControllerCallPullIfNeeded(controller), promise;\n})\n";
-// writeIntLE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteIntLECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteIntLECodeLength = 725;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteIntLECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteIntLECode = "(function (value,offset,byteLength){\"use strict\";const view=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(byteLength){case 1:{view.setInt8(offset,value);break}case 2:{view.setInt16(offset,value,!0);break}case 3:{view.setUint16(offset,value&65535,!0),view.setInt8(offset+2,Math.floor(value*0.0000152587890625));break}case 4:{view.setInt32(offset,value,!0);break}case 5:{view.setUint32(offset,value|0,!0),view.setInt8(offset+4,Math.floor(value*0.00000000023283064365386964));break}case 6:{view.setUint32(offset,value|0,!0),view.setInt16(offset+4,Math.floor(value*0.00000000023283064365386964),!0);break}default:@throwRangeError(\"byteLength must be >= 1 and <= 6\")}return offset+byteLength})\n";
+// readableByteStreamControllerRespond
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeLength = 317;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondCode = "(function (controller, bytesWritten) {\"use strict\";\n if (bytesWritten = @toNumber(bytesWritten), bytesWritten !== bytesWritten || bytesWritten === @Infinity || bytesWritten < 0)\n @throwRangeError(\"bytesWritten has an incorrect value\");\n @readableByteStreamControllerRespondInternal(controller, bytesWritten);\n})\n";
-// writeIntBE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteIntBECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteIntBECodeLength = 725;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteIntBECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteIntBECode = "(function (value,offset,byteLength){\"use strict\";const view=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(byteLength){case 1:{view.setInt8(offset,value);break}case 2:{view.setInt16(offset,value,!1);break}case 3:{view.setUint16(offset+1,value&65535,!1),view.setInt8(offset,Math.floor(value*0.0000152587890625));break}case 4:{view.setInt32(offset,value,!1);break}case 5:{view.setUint32(offset+1,value|0,!1),view.setInt8(offset,Math.floor(value*0.00000000023283064365386964));break}case 6:{view.setUint32(offset+2,value|0,!1),view.setInt16(offset,Math.floor(value*0.00000000023283064365386964),!1);break}default:@throwRangeError(\"byteLength must be >= 1 and <= 6\")}return offset+byteLength})\n";
+// readableByteStreamControllerRespondInClosedState
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeLength = 641;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCode = "(function (controller, firstDescriptor) {\"use strict\";\n if (firstDescriptor.buffer = @transferBufferToCurrentRealm(firstDescriptor.buffer), @readableStreamHasBYOBReader(@getByIdDirectPrivate(controller, \"controlledReadableStream\")))\n while (@getByIdDirectPrivate(@getByIdDirectPrivate(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), \"reader\"), \"readIntoRequests\")\?.isNotEmpty()) {\n let pullIntoDescriptor = @readableByteStreamControllerShiftPendingDescriptor(controller);\n @readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), pullIntoDescriptor);\n }\n})\n";
-// writeUIntLE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntLECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteUIntLECodeLength = 731;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteUIntLECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteUIntLECode = "(function (value,offset,byteLength){\"use strict\";const view=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(byteLength){case 1:{view.setUint8(offset,value);break}case 2:{view.setUint16(offset,value,!0);break}case 3:{view.setUint16(offset,value&65535,!0),view.setUint8(offset+2,Math.floor(value*0.0000152587890625));break}case 4:{view.setUint32(offset,value,!0);break}case 5:{view.setUint32(offset,value|0,!0),view.setUint8(offset+4,Math.floor(value*0.00000000023283064365386964));break}case 6:{view.setUint32(offset,value|0,!0),view.setUint16(offset+4,Math.floor(value*0.00000000023283064365386964),!0);break}default:@throwRangeError(\"byteLength must be >= 1 and <= 6\")}return offset+byteLength})\n";
+// readableByteStreamControllerRespondInReadableState
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeLength = 1200;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCode = "(function (controller, bytesWritten, pullIntoDescriptor) {\"use strict\";\n if (pullIntoDescriptor.bytesFilled + bytesWritten > pullIntoDescriptor.byteLength)\n @throwRangeError(\"bytesWritten value is too great\");\n if (@readableByteStreamControllerInvalidateBYOBRequest(controller), pullIntoDescriptor.bytesFilled += bytesWritten, pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize)\n return;\n @readableByteStreamControllerShiftPendingDescriptor(controller);\n const remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;\n if (remainderSize > 0) {\n const end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled, remainder = @cloneArrayBuffer(pullIntoDescriptor.buffer, end - remainderSize, remainderSize);\n @readableByteStreamControllerEnqueueChunk(controller, remainder, 0, remainder.byteLength);\n }\n pullIntoDescriptor.buffer = @transferBufferToCurrentRealm(pullIntoDescriptor.buffer), pullIntoDescriptor.bytesFilled -= remainderSize, @readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), pullIntoDescriptor), @readableByteStreamControllerProcessPullDescriptors(controller);\n})\n";
-// writeUIntBE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntBECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteUIntBECodeLength = 731;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteUIntBECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteUIntBECode = "(function (value,offset,byteLength){\"use strict\";const view=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(byteLength){case 1:{view.setUint8(offset,value);break}case 2:{view.setUint16(offset,value,!1);break}case 3:{view.setUint16(offset+1,value&65535,!1),view.setUint8(offset,Math.floor(value*0.0000152587890625));break}case 4:{view.setUint32(offset,value,!1);break}case 5:{view.setUint32(offset+1,value|0,!1),view.setUint8(offset,Math.floor(value*0.00000000023283064365386964));break}case 6:{view.setUint32(offset+2,value|0,!1),view.setUint16(offset,Math.floor(value*0.00000000023283064365386964),!1);break}default:@throwRangeError(\"byteLength must be >= 1 and <= 6\")}return offset+byteLength})\n";
+// readableByteStreamControllerRespondInternal
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeLength = 576;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode = "(function (controller, bytesWritten) {\"use strict\";\n let firstDescriptor = @getByIdDirectPrivate(controller, \"pendingPullIntos\").peek(), stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@getByIdDirectPrivate(stream, \"state\") === 1) {\n if (bytesWritten !== 0)\n @throwTypeError(\"bytesWritten is different from 0 even though stream is closed\");\n @readableByteStreamControllerRespondInClosedState(controller, firstDescriptor);\n } else\n @readableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor);\n})\n";
-// writeFloatLE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatLECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteFloatLECodeLength = 160;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteFloatLECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteFloatLECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat32(offset,value,!0),offset+4})\n";
+// readableByteStreamControllerRespondWithNewView
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeLength = 504;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCode = "(function (controller, view) {\"use strict\";\n let firstDescriptor = @getByIdDirectPrivate(controller, \"pendingPullIntos\").peek();\n if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset)\n @throwRangeError(\"Invalid value for view.byteOffset\");\n if (firstDescriptor.byteLength !== view.byteLength)\n @throwRangeError(\"Invalid value for view.byteLength\");\n firstDescriptor.buffer = view.buffer, @readableByteStreamControllerRespondInternal(controller, view.byteLength);\n})\n";
-// writeFloatBE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatBECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteFloatBECodeLength = 160;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteFloatBECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteFloatBECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat32(offset,value,!1),offset+4})\n";
+// readableByteStreamControllerShiftPendingDescriptor
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeLength = 208;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCode = "(function (controller) {\"use strict\";\n let descriptor = @getByIdDirectPrivate(controller, \"pendingPullIntos\").shift();\n return @readableByteStreamControllerInvalidateBYOBRequest(controller), descriptor;\n})\n";
-// writeDoubleLE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleLECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteDoubleLECodeLength = 160;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteDoubleLECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteDoubleLECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat64(offset,value,!0),offset+8})\n";
+// readableByteStreamControllerShouldCallPull
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeLength = 793;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@getByIdDirectPrivate(stream, \"state\") !== 4)\n return !1;\n if (@getByIdDirectPrivate(controller, \"closeRequested\"))\n return !1;\n if (!(@getByIdDirectPrivate(controller, \"started\") > 0))\n return !1;\n const reader = @getByIdDirectPrivate(stream, \"reader\");\n if (reader && (@getByIdDirectPrivate(reader, \"readRequests\")\?.isNotEmpty() || !!@getByIdDirectPrivate(reader, \"bunNativePtr\")))\n return !0;\n if (@readableStreamHasBYOBReader(stream) && @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readIntoRequests\")\?.isNotEmpty())\n return !0;\n if (@readableByteStreamControllerGetDesiredSize(controller) > 0)\n return !0;\n return !1;\n})\n";
-// writeDoubleBE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleBECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteDoubleBECodeLength = 160;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteDoubleBECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteDoubleBECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat64(offset,value,!1),offset+8})\n";
+// readableStreamAddReadIntoRequest
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeLength = 198;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCode = "(function (stream) {\"use strict\";\n const readRequest = @newPromise();\n return @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readIntoRequests\").push(readRequest), readRequest;\n})\n";
-// writeBigInt64LE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64LECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteBigInt64LECodeLength = 161;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteBigInt64LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteBigInt64LECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setBigInt64(offset,value,!0),offset+8})\n";
+// readableStreamBYOBReaderRead
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeLength = 402;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableStreamBYOBReaderReadCode = "(function (reader, view) {\"use strict\";\n const stream = @getByIdDirectPrivate(reader, \"ownerReadableStream\");\n if (@putByIdDirectPrivate(stream, \"disturbed\", !0), @getByIdDirectPrivate(stream, \"state\") === 3)\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n return @readableByteStreamControllerPullInto(@getByIdDirectPrivate(stream, \"readableStreamController\"), view);\n})\n";
-// writeBigInt64BE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64BECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteBigInt64BECodeLength = 161;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteBigInt64BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteBigInt64BECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setBigInt64(offset,value,!1),offset+8})\n";
+// readableStreamByteStreamControllerStart
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeLength = 99;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCode = "(function (controller) {\"use strict\";\n @putByIdDirectPrivate(controller, \"start\", @undefined);\n})\n";
-// writeBigUInt64LE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64LECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteBigUInt64LECodeLength = 162;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteBigUInt64LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteBigUInt64LECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setBigUint64(offset,value,!0),offset+8})\n";
+// readableStreamFulfillReadIntoRequest
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeLength = 228;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCode = "(function (stream, chunk, done) {\"use strict\";\n const readIntoRequest = @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readIntoRequests\").shift();\n @fulfillPromise(readIntoRequest, { value: chunk, done });\n})\n";
-// writeBigUInt64BE
-const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64BECodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeWriteBigUInt64BECodeLength = 162;
-static const JSC::Intrinsic s_jsBufferPrototypeWriteBigUInt64BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteBigUInt64BECode = "(function (value,offset){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setBigUint64(offset,value,!1),offset+8})\n";
+// readableStreamHasBYOBReader
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeLength = 166;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableStreamHasBYOBReaderCode = "(function (stream) {\"use strict\";\n const reader = @getByIdDirectPrivate(stream, \"reader\");\n return reader !== @undefined && @isReadableStreamBYOBReader(reader);\n})\n";
-// utf8Write
-const JSC::ConstructAbility s_jsBufferPrototypeUtf8WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeUtf8WriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeUtf8WriteCodeLength = 91;
-static const JSC::Intrinsic s_jsBufferPrototypeUtf8WriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeUtf8WriteCode = "(function (text,offset,length){\"use strict\";return this.write(text,offset,length,\"utf8\")})\n";
+// readableStreamHasDefaultReader
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeLength = 169;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableStreamHasDefaultReaderCode = "(function (stream) {\"use strict\";\n const reader = @getByIdDirectPrivate(stream, \"reader\");\n return reader !== @undefined && @isReadableStreamDefaultReader(reader);\n})\n";
-// ucs2Write
-const JSC::ConstructAbility s_jsBufferPrototypeUcs2WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeUcs2WriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeUcs2WriteCodeLength = 91;
-static const JSC::Intrinsic s_jsBufferPrototypeUcs2WriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeUcs2WriteCode = "(function (text,offset,length){\"use strict\";return this.write(text,offset,length,\"ucs2\")})\n";
+// readableStreamReaderKind
+const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamReaderKindCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsReadableStreamReaderKindCodeLength = 239;
+static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamReaderKindCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsReadableStreamReaderKindCode = "(function (reader) {\"use strict\";\n if (@getByIdDirectPrivate(reader, \"readRequests\"))\n return @getByIdDirectPrivate(reader, \"bunNativePtr\") \? 3 : 1;\n if (@getByIdDirectPrivate(reader, \"readIntoRequests\"))\n return 2;\n return 0;\n})\n";
-// utf16leWrite
-const JSC::ConstructAbility s_jsBufferPrototypeUtf16leWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeUtf16leWriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeUtf16leWriteCodeLength = 94;
-static const JSC::Intrinsic s_jsBufferPrototypeUtf16leWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeUtf16leWriteCode = "(function (text,offset,length){\"use strict\";return this.write(text,offset,length,\"utf16le\")})\n";
+// transferBufferToCurrentRealm
+const JSC::ConstructAbility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeLength = 54;
+static const JSC::Intrinsic s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableByteStreamInternalsTransferBufferToCurrentRealmCode = "(function (buffer) {\"use strict\";\n return buffer;\n})\n";
-// latin1Write
-const JSC::ConstructAbility s_jsBufferPrototypeLatin1WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeLatin1WriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeLatin1WriteCodeLength = 93;
-static const JSC::Intrinsic s_jsBufferPrototypeLatin1WriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeLatin1WriteCode = "(function (text,offset,length){\"use strict\";return this.write(text,offset,length,\"latin1\")})\n";
+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
+{\
+ JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
+ return clientData->builtinFunctions().readableByteStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableByteStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+}
+WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
-// asciiWrite
-const JSC::ConstructAbility s_jsBufferPrototypeAsciiWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeAsciiWriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeAsciiWriteCodeLength = 92;
-static const JSC::Intrinsic s_jsBufferPrototypeAsciiWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeAsciiWriteCode = "(function (text,offset,length){\"use strict\";return this.write(text,offset,length,\"ascii\")})\n";
+/* ReadableStream.ts */
+// cancel
+const JSC::ConstructAbility s_readableStreamCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamCancelCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamCancelCodeLength = 302;
+static const JSC::Intrinsic s_readableStreamCancelCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamCancelCode = "(function (reason) {\"use strict\";\n if (!@isReadableStream(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStream\", \"cancel\"));\n if (@isReadableStreamLocked(this))\n return @Promise.@reject(@makeTypeError(\"ReadableStream is locked\"));\n return @readableStreamCancel(this, reason);\n})\n";
-// base64Write
-const JSC::ConstructAbility s_jsBufferPrototypeBase64WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeBase64WriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeBase64WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeBase64WriteCodeLength = 93;
-static const JSC::Intrinsic s_jsBufferPrototypeBase64WriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeBase64WriteCode = "(function (text,offset,length){\"use strict\";return this.write(text,offset,length,\"base64\")})\n";
+// consumeReadableStream
+const JSC::ConstructAbility s_readableStreamConsumeReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamConsumeReadableStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamConsumeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
+const int s_readableStreamConsumeReadableStreamCodeLength = 2830;
+static const JSC::Intrinsic s_readableStreamConsumeReadableStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamConsumeReadableStreamCode = "(function (nativePtr, nativeType, inputStream) {\"use strict\";\n const symbol = globalThis.Symbol.for(\"Bun.consumeReadableStreamPrototype\");\n var cached = globalThis[symbol];\n if (!cached)\n cached = globalThis[symbol] = [];\n var Prototype = cached[nativeType];\n if (Prototype === @undefined) {\n var [doRead, doError, doReadMany, doClose, onClose, deinit] = @lazy(nativeType);\n Prototype = class NativeReadableStreamSink {\n handleError;\n handleClosed;\n processResult;\n constructor(reader, ptr) {\n this.#ptr = ptr, this.#reader = reader, this.#didClose = !1, this.handleError = this._handleError.bind(this), this.handleClosed = this._handleClosed.bind(this), this.processResult = this._processResult.bind(this), reader.closed.then(this.handleClosed, this.handleError);\n }\n _handleClosed() {\n if (this.#didClose)\n return;\n this.#didClose = !0;\n var ptr = this.#ptr;\n this.#ptr = 0, doClose(ptr), deinit(ptr);\n }\n _handleError(error) {\n if (this.#didClose)\n return;\n this.#didClose = !0;\n var ptr = this.#ptr;\n this.#ptr = 0, doError(ptr, error), deinit(ptr);\n }\n #ptr;\n #didClose = !1;\n #reader;\n _handleReadMany({ value, done, size }) {\n if (done) {\n this.handleClosed();\n return;\n }\n if (this.#didClose)\n return;\n doReadMany(this.#ptr, value, done, size);\n }\n read() {\n if (!this.#ptr)\n return @throwTypeError(\"ReadableStreamSink is already closed\");\n return this.processResult(this.#reader.read());\n }\n _processResult(result) {\n if (result && @isPromise(result)) {\n if (@getPromiseInternalField(result, @promiseFieldFlags) & @promiseStateFulfilled) {\n const fulfilledValue = @getPromiseInternalField(result, @promiseFieldReactionsOrResult);\n if (fulfilledValue)\n result = fulfilledValue;\n }\n }\n if (result && @isPromise(result))\n return result.then(this.processResult, this.handleError), null;\n if (result.done)\n return this.handleClosed(), 0;\n else if (result.value)\n return result.value;\n else\n return -1;\n }\n readMany() {\n if (!this.#ptr)\n return @throwTypeError(\"ReadableStreamSink is already closed\");\n return this.processResult(this.#reader.readMany());\n }\n };\n const minlength = nativeType + 1;\n if (cached.length < minlength)\n cached.length = minlength;\n @putByValDirect(cached, nativeType, Prototype);\n }\n if (@isReadableStreamLocked(inputStream))\n @throwTypeError(\"Cannot start reading from a locked stream\");\n return new Prototype(inputStream.getReader(), nativePtr);\n})\n";
-// base64urlWrite
-const JSC::ConstructAbility s_jsBufferPrototypeBase64urlWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeBase64urlWriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeBase64urlWriteCodeLength = 96;
-static const JSC::Intrinsic s_jsBufferPrototypeBase64urlWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeBase64urlWriteCode = "(function (text,offset,length){\"use strict\";return this.write(text,offset,length,\"base64url\")})\n";
+// createEmptyReadableStream
+const JSC::ConstructAbility s_readableStreamCreateEmptyReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamCreateEmptyReadableStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamCreateEmptyReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
+const int s_readableStreamCreateEmptyReadableStreamCodeLength = 140;
+static const JSC::Intrinsic s_readableStreamCreateEmptyReadableStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamCreateEmptyReadableStreamCode = "(function () {\"use strict\";\n var stream = new @ReadableStream({\n pull() {\n }\n });\n return @readableStreamClose(stream), stream;\n})\n";
-// hexWrite
-const JSC::ConstructAbility s_jsBufferPrototypeHexWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeHexWriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeHexWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeHexWriteCodeLength = 90;
-static const JSC::Intrinsic s_jsBufferPrototypeHexWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeHexWriteCode = "(function (text,offset,length){\"use strict\";return this.write(text,offset,length,\"hex\")})\n";
+// createNativeReadableStream
+const JSC::ConstructAbility s_readableStreamCreateNativeReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamCreateNativeReadableStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamCreateNativeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
+const int s_readableStreamCreateNativeReadableStreamCodeLength = 215;
+static const JSC::Intrinsic s_readableStreamCreateNativeReadableStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamCreateNativeReadableStreamCode = "(function (nativePtr, nativeType, autoAllocateChunkSize) {\"use strict\";\n return new @ReadableStream({\n @lazy: !0,\n @bunNativeType: nativeType,\n @bunNativePtr: nativePtr,\n autoAllocateChunkSize\n });\n})\n";
-// utf8Slice
-const JSC::ConstructAbility s_jsBufferPrototypeUtf8SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeUtf8SliceCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeUtf8SliceCodeLength = 76;
-static const JSC::Intrinsic s_jsBufferPrototypeUtf8SliceCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeUtf8SliceCode = "(function (start,end){\"use strict\";return this.toString(\"utf8\",start,end)})\n";
+// createUsedReadableStream
+const JSC::ConstructAbility s_readableStreamCreateUsedReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamCreateUsedReadableStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamCreateUsedReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
+const int s_readableStreamCreateUsedReadableStreamCodeLength = 130;
+static const JSC::Intrinsic s_readableStreamCreateUsedReadableStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamCreateUsedReadableStreamCode = "(function () {\"use strict\";\n var stream = new @ReadableStream({\n pull() {\n }\n });\n return stream.getReader(), stream;\n})\n";
-// ucs2Slice
-const JSC::ConstructAbility s_jsBufferPrototypeUcs2SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeUcs2SliceCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeUcs2SliceCodeLength = 76;
-static const JSC::Intrinsic s_jsBufferPrototypeUcs2SliceCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeUcs2SliceCode = "(function (start,end){\"use strict\";return this.toString(\"ucs2\",start,end)})\n";
+// getReader
+const JSC::ConstructAbility s_readableStreamGetReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamGetReaderCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamGetReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamGetReaderCodeLength = 580;
+static const JSC::Intrinsic s_readableStreamGetReaderCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamGetReaderCode = "(function (options) {\"use strict\";\n if (!@isReadableStream(this))\n throw @makeThisTypeError(\"ReadableStream\", \"getReader\");\n const mode = @toDictionary(options, {}, \"ReadableStream.getReader takes an object as first argument\").mode;\n if (mode === @undefined) {\n var start_ = @getByIdDirectPrivate(this, \"start\");\n if (start_)\n @putByIdDirectPrivate(this, \"start\", @undefined), start_();\n return new @ReadableStreamDefaultReader(this);\n }\n if (mode == \"byob\")\n return new @ReadableStreamBYOBReader(this);\n @throwTypeError(\"Invalid mode is specified\");\n})\n";
-// utf16leSlice
-const JSC::ConstructAbility s_jsBufferPrototypeUtf16leSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeUtf16leSliceCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeUtf16leSliceCodeLength = 79;
-static const JSC::Intrinsic s_jsBufferPrototypeUtf16leSliceCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeUtf16leSliceCode = "(function (start,end){\"use strict\";return this.toString(\"utf16le\",start,end)})\n";
+// initializeReadableStream
+const JSC::ConstructAbility s_readableStreamInitializeReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInitializeReadableStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInitializeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInitializeReadableStreamCodeLength = 2962;
+static const JSC::Intrinsic s_readableStreamInitializeReadableStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInitializeReadableStreamCode = "(function (underlyingSource, strategy) {\"use strict\";\n if (underlyingSource === @undefined)\n underlyingSource = { @bunNativeType: 0, @bunNativePtr: 0, @lazy: !1 };\n if (strategy === @undefined)\n strategy = {};\n if (!@isObject(underlyingSource))\n @throwTypeError(\"ReadableStream constructor takes an object as first argument\");\n if (strategy !== @undefined && !@isObject(strategy))\n @throwTypeError(\"ReadableStream constructor takes an object as second argument, if any\");\n @putByIdDirectPrivate(this, \"state\", 4), @putByIdDirectPrivate(this, \"reader\", @undefined), @putByIdDirectPrivate(this, \"storedError\", @undefined), @putByIdDirectPrivate(this, \"disturbed\", !1), @putByIdDirectPrivate(this, \"readableStreamController\", null), @putByIdDirectPrivate(this, \"bunNativeType\", @getByIdDirectPrivate(underlyingSource, \"bunNativeType\") \?\? 0), @putByIdDirectPrivate(this, \"bunNativePtr\", @getByIdDirectPrivate(underlyingSource, \"bunNativePtr\") \?\? 0), @putByIdDirectPrivate(this, \"asyncContext\", @getInternalField(@asyncContext, 0));\n const isDirect = underlyingSource.type === \"direct\", isUnderlyingSourceLazy = !!underlyingSource.@lazy, isLazy = isDirect || isUnderlyingSourceLazy;\n if (@getByIdDirectPrivate(underlyingSource, \"pull\") !== @undefined && !isLazy) {\n const size = @getByIdDirectPrivate(strategy, \"size\"), highWaterMark = @getByIdDirectPrivate(strategy, \"highWaterMark\");\n return @putByIdDirectPrivate(this, \"highWaterMark\", highWaterMark), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @setupReadableStreamDefaultController(this, underlyingSource, size, highWaterMark !== @undefined \? highWaterMark : 1, @getByIdDirectPrivate(underlyingSource, \"start\"), @getByIdDirectPrivate(underlyingSource, \"pull\"), @getByIdDirectPrivate(underlyingSource, \"cancel\")), this;\n }\n if (isDirect)\n @putByIdDirectPrivate(this, \"underlyingSource\", underlyingSource), @putByIdDirectPrivate(this, \"highWaterMark\", @getByIdDirectPrivate(strategy, \"highWaterMark\")), @putByIdDirectPrivate(this, \"start\", () => @createReadableStreamController(this, underlyingSource, strategy));\n else if (isLazy) {\n const autoAllocateChunkSize = underlyingSource.autoAllocateChunkSize;\n @putByIdDirectPrivate(this, \"highWaterMark\", @undefined), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"highWaterMark\", autoAllocateChunkSize || @getByIdDirectPrivate(strategy, \"highWaterMark\")), @putByIdDirectPrivate(this, \"start\", () => {\n const instance = @lazyLoadStream(this, autoAllocateChunkSize);\n if (instance)\n @createReadableStreamController(this, instance, strategy);\n });\n } else\n @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"highWaterMark\", @getByIdDirectPrivate(strategy, \"highWaterMark\")), @putByIdDirectPrivate(this, \"start\", @undefined), @createReadableStreamController(this, underlyingSource, strategy);\n return this;\n})\n";
-// latin1Slice
-const JSC::ConstructAbility s_jsBufferPrototypeLatin1SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeLatin1SliceCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeLatin1SliceCodeLength = 78;
-static const JSC::Intrinsic s_jsBufferPrototypeLatin1SliceCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeLatin1SliceCode = "(function (start,end){\"use strict\";return this.toString(\"latin1\",start,end)})\n";
+// lazyAsyncIterator
+const JSC::ConstructAbility s_readableStreamLazyAsyncIteratorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamLazyAsyncIteratorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamLazyAsyncIteratorCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
+const int s_readableStreamLazyAsyncIteratorCodeLength = 188;
+static const JSC::Intrinsic s_readableStreamLazyAsyncIteratorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamLazyAsyncIteratorCode = "(function () {\"use strict\";\n var prototype = @ReadableStream.prototype;\n return @readableStreamDefineLazyIterators(prototype), prototype[globalThis.Symbol.asyncIterator].@call(this);\n})\n";
-// asciiSlice
-const JSC::ConstructAbility s_jsBufferPrototypeAsciiSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeAsciiSliceCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeAsciiSliceCodeLength = 77;
-static const JSC::Intrinsic s_jsBufferPrototypeAsciiSliceCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeAsciiSliceCode = "(function (start,end){\"use strict\";return this.toString(\"ascii\",start,end)})\n";
+// locked
+const JSC::ConstructAbility s_readableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamLockedCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamLockedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamLockedCodeLength = 163;
+static const JSC::Intrinsic s_readableStreamLockedCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamLockedCode = "(function () {\"use strict\";\n if (!@isReadableStream(this))\n throw @makeGetterTypeError(\"ReadableStream\", \"locked\");\n return @isReadableStreamLocked(this);\n})\n";
-// base64Slice
-const JSC::ConstructAbility s_jsBufferPrototypeBase64SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeBase64SliceCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeBase64SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeBase64SliceCodeLength = 78;
-static const JSC::Intrinsic s_jsBufferPrototypeBase64SliceCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeBase64SliceCode = "(function (start,end){\"use strict\";return this.toString(\"base64\",start,end)})\n";
+// pipeThrough
+const JSC::ConstructAbility s_readableStreamPipeThroughCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamPipeThroughCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamPipeThroughCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamPipeThroughCodeLength = 1300;
+static const JSC::Intrinsic s_readableStreamPipeThroughCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamPipeThroughCode = "(function (streams, options) {\"use strict\";\n const transforms = streams, readable = transforms.readable;\n if (!@isReadableStream(readable))\n throw @makeTypeError(\"readable should be ReadableStream\");\n const writable = transforms.writable, internalWritable = @getInternalWritableStream(writable);\n if (!@isWritableStream(internalWritable))\n throw @makeTypeError(\"writable should be WritableStream\");\n let preventClose = !1, preventAbort = !1, preventCancel = !1, signal;\n if (!@isUndefinedOrNull(options)) {\n if (!@isObject(options))\n throw @makeTypeError(\"options must be an object\");\n if (preventAbort = !!options.preventAbort, preventCancel = !!options.preventCancel, preventClose = !!options.preventClose, signal = options.signal, signal !== @undefined && !@isAbortSignal(signal))\n throw @makeTypeError(\"options.signal must be AbortSignal\");\n }\n if (!@isReadableStream(this))\n throw @makeThisTypeError(\"ReadableStream\", \"pipeThrough\");\n if (@isReadableStreamLocked(this))\n throw @makeTypeError(\"ReadableStream is locked\");\n if (@isWritableStreamLocked(internalWritable))\n throw @makeTypeError(\"WritableStream is locked\");\n return @readableStreamPipeToWritableStream(this, internalWritable, preventClose, preventAbort, preventCancel, signal), readable;\n})\n";
-// base64urlSlice
-const JSC::ConstructAbility s_jsBufferPrototypeBase64urlSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeBase64urlSliceCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeBase64urlSliceCodeLength = 81;
-static const JSC::Intrinsic s_jsBufferPrototypeBase64urlSliceCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeBase64urlSliceCode = "(function (start,end){\"use strict\";return this.toString(\"base64url\",start,end)})\n";
+// pipeTo
+const JSC::ConstructAbility s_readableStreamPipeToCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamPipeToCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamPipeToCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamPipeToCodeLength = 1328;
+static const JSC::Intrinsic s_readableStreamPipeToCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamPipeToCode = "(function (destination) {\"use strict\";\n if (!@isReadableStream(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStream\", \"pipeTo\"));\n if (@isReadableStreamLocked(this))\n return @Promise.@reject(@makeTypeError(\"ReadableStream is locked\"));\n let options = @argument(1), preventClose = !1, preventAbort = !1, preventCancel = !1, signal;\n if (!@isUndefinedOrNull(options)) {\n if (!@isObject(options))\n return @Promise.@reject(@makeTypeError(\"options must be an object\"));\n try {\n preventAbort = !!options.preventAbort, preventCancel = !!options.preventCancel, preventClose = !!options.preventClose, signal = options.signal;\n } catch (e) {\n return @Promise.@reject(e);\n }\n if (signal !== @undefined && !@isAbortSignal(signal))\n return @Promise.@reject(@makeTypeError(\"options.signal must be AbortSignal\"));\n }\n const internalDestination = @getInternalWritableStream(destination);\n if (!@isWritableStream(internalDestination))\n return @Promise.@reject(@makeTypeError(\"ReadableStream pipeTo requires a WritableStream\"));\n if (@isWritableStreamLocked(internalDestination))\n return @Promise.@reject(@makeTypeError(\"WritableStream is locked\"));\n return @readableStreamPipeToWritableStream(this, internalDestination, preventClose, preventAbort, preventCancel, signal);\n})\n";
-// hexSlice
-const JSC::ConstructAbility s_jsBufferPrototypeHexSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeHexSliceCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeHexSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeHexSliceCodeLength = 75;
-static const JSC::Intrinsic s_jsBufferPrototypeHexSliceCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeHexSliceCode = "(function (start,end){\"use strict\";return this.toString(\"hex\",start,end)})\n";
+// readableStreamToArray
+const JSC::ConstructAbility s_readableStreamReadableStreamToArrayCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamReadableStreamToArrayCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
+const int s_readableStreamReadableStreamToArrayCodeLength = 262;
+static const JSC::Intrinsic s_readableStreamReadableStreamToArrayCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamReadableStreamToArrayCode = "(function (stream) {\"use strict\";\n var underlyingSource = @getByIdDirectPrivate(stream, \"underlyingSource\");\n if (underlyingSource !== @undefined)\n return @readableStreamToArrayDirect(stream, underlyingSource);\n return @readableStreamIntoArray(stream);\n})\n";
-// toJSON
-const JSC::ConstructAbility s_jsBufferPrototypeToJSONCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeToJSONCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeToJSONCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeToJSONCodeLength = 73;
-static const JSC::Intrinsic s_jsBufferPrototypeToJSONCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeToJSONCode = "(function (){\"use strict\";return{type:\"Buffer\",data:@Array.from(this)}})\n";
+// readableStreamToArrayBuffer
+const JSC::ConstructAbility s_readableStreamReadableStreamToArrayBufferCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamReadableStreamToArrayBufferCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayBufferCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
+const int s_readableStreamReadableStreamToArrayBufferCodeLength = 390;
+static const JSC::Intrinsic s_readableStreamReadableStreamToArrayBufferCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamReadableStreamToArrayBufferCode = "(function (stream) {\"use strict\";\n var underlyingSource = @getByIdDirectPrivate(stream, \"underlyingSource\");\n if (underlyingSource !== @undefined)\n return @readableStreamToArrayBufferDirect(stream, underlyingSource);\n var result = Bun.readableStreamToArray(stream);\n if (@isPromise(result))\n return result.then(Bun.concatArrayBuffers);\n return Bun.concatArrayBuffers(result);\n})\n";
-// slice
-const JSC::ConstructAbility s_jsBufferPrototypeSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeSliceCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeSliceCodeLength = 447;
-static const JSC::Intrinsic s_jsBufferPrototypeSliceCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeSliceCode = "(function (start,end){\"use strict\";var{buffer,byteOffset,byteLength}=this;function adjustOffset(offset,length){if(offset=@trunc(offset),offset===0||offset!==offset)return 0;else if(offset<0)return offset+=length,offset>0\?offset:0;else return offset<length\?offset:length}var start_=adjustOffset(start,byteLength),end_=end!==@undefined\?adjustOffset(end,byteLength):byteLength;return new @Buffer(buffer,byteOffset+start_,end_>start_\?end_-start_:0)})\n";
+// readableStreamToBlob
+const JSC::ConstructAbility s_readableStreamReadableStreamToBlobCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamReadableStreamToBlobCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamReadableStreamToBlobCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
+const int s_readableStreamReadableStreamToBlobCodeLength = 133;
+static const JSC::Intrinsic s_readableStreamReadableStreamToBlobCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamReadableStreamToBlobCode = "(function (stream) {\"use strict\";\n return @Promise.resolve(Bun.readableStreamToArray(stream)).@then((array) => new Blob(array));\n})\n";
-// parent
-const JSC::ConstructAbility s_jsBufferPrototypeParentCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeParentCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeParentCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeParentCodeLength = 99;
-static const JSC::Intrinsic s_jsBufferPrototypeParentCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeParentCode = "(function (){\"use strict\";return @isObject(this)&&this instanceof @Buffer\?this.buffer:@undefined})\n";
+// readableStreamToFormData
+const JSC::ConstructAbility s_readableStreamReadableStreamToFormDataCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamReadableStreamToFormDataCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamReadableStreamToFormDataCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
+const int s_readableStreamReadableStreamToFormDataCodeLength = 160;
+static const JSC::Intrinsic s_readableStreamReadableStreamToFormDataCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamReadableStreamToFormDataCode = "(function (stream, contentType) {\"use strict\";\n return Bun.readableStreamToBlob(stream).then((blob) => {\n return FormData.from(blob, contentType);\n });\n})\n";
-// offset
-const JSC::ConstructAbility s_jsBufferPrototypeOffsetCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeOffsetCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeOffsetCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeOffsetCodeLength = 103;
-static const JSC::Intrinsic s_jsBufferPrototypeOffsetCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeOffsetCode = "(function (){\"use strict\";return @isObject(this)&&this instanceof @Buffer\?this.byteOffset:@undefined})\n";
+// readableStreamToJSON
+const JSC::ConstructAbility s_readableStreamReadableStreamToJSONCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamReadableStreamToJSONCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamReadableStreamToJSONCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
+const int s_readableStreamReadableStreamToJSONCodeLength = 109;
+static const JSC::Intrinsic s_readableStreamReadableStreamToJSONCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamReadableStreamToJSONCode = "(function (stream) {\"use strict\";\n return Bun.readableStreamToText(stream).@then(globalThis.JSON.parse);\n})\n";
-// inspect
-const JSC::ConstructAbility s_jsBufferPrototypeInspectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferPrototypeInspectCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferPrototypeInspectCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferPrototypeInspectCodeLength = 70;
-static const JSC::Intrinsic s_jsBufferPrototypeInspectCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeInspectCode = "(function (recurseTimes,ctx){\"use strict\";return @Bun.inspect(this)})\n";
+// readableStreamToText
+const JSC::ConstructAbility s_readableStreamReadableStreamToTextCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamReadableStreamToTextCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamReadableStreamToTextCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
+const int s_readableStreamReadableStreamToTextCodeLength = 260;
+static const JSC::Intrinsic s_readableStreamReadableStreamToTextCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamReadableStreamToTextCode = "(function (stream) {\"use strict\";\n var underlyingSource = @getByIdDirectPrivate(stream, \"underlyingSource\");\n if (underlyingSource !== @undefined)\n return @readableStreamToTextDirect(stream, underlyingSource);\n return @readableStreamIntoText(stream);\n})\n";
+
+// tee
+const JSC::ConstructAbility s_readableStreamTeeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamTeeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamTeeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamTeeCodeLength = 157;
+static const JSC::Intrinsic s_readableStreamTeeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamTeeCode = "(function () {\"use strict\";\n if (!@isReadableStream(this))\n throw @makeThisTypeError(\"ReadableStream\", \"tee\");\n return @readableStreamTee(this, !1);\n})\n";
+
+// values
+const JSC::ConstructAbility s_readableStreamValuesCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamValuesCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamValuesCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamValuesCodeLength = 178;
+static const JSC::Intrinsic s_readableStreamValuesCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamValuesCode = "(function (options) {\"use strict\";\n var prototype = @ReadableStream.prototype;\n return @readableStreamDefineLazyIterators(prototype), prototype.values.@call(this, options);\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
{\
JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().jsBufferPrototypeBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().jsBufferPrototypeBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+ return clientData->builtinFunctions().readableStreamBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
}
-WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
-/* ReadableByteStreamController.ts */
-// initializeReadableByteStreamController
-const JSC::ConstructAbility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeLength = 325;
-static const JSC::Intrinsic s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamControllerInitializeReadableByteStreamControllerCode = "(function (stream,underlyingByteSource,highWaterMark){\"use strict\";if(arguments.length!==4&&arguments[3]!==@isReadableStream)@throwTypeError(\"ReadableByteStreamController constructor should not be called directly\");return @privateInitializeReadableByteStreamController.@call(this,stream,underlyingByteSource,highWaterMark)})\n";
-
-// enqueue
-const JSC::ConstructAbility s_readableByteStreamControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamControllerEnqueueCodeLength = 578;
-static const JSC::Intrinsic s_readableByteStreamControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamControllerEnqueueCode = "(function (chunk){\"use strict\";if(!@isReadableByteStreamController(this))throw @makeThisTypeError(\"ReadableByteStreamController\",\"enqueue\");if(@getByIdDirectPrivate(this,\"closeRequested\"))@throwTypeError(\"ReadableByteStreamController is requested to close\");if(@getByIdDirectPrivate(@getByIdDirectPrivate(this,\"controlledReadableStream\"),\"state\")!==@streamReadable)@throwTypeError(\"ReadableStream is not readable\");if(!@isObject(chunk)||!@ArrayBuffer.@isView(chunk))@throwTypeError(\"Provided chunk is not a TypedArray\");return @readableByteStreamControllerEnqueue(this,chunk)})\n";
+/* ReadableStreamBYOBReader.ts */
+// cancel
+const JSC::ConstructAbility s_readableStreamBYOBReaderCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamBYOBReaderCancelCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamBYOBReaderCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamBYOBReaderCancelCodeLength = 388;
+static const JSC::Intrinsic s_readableStreamBYOBReaderCancelCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamBYOBReaderCancelCode = "(function (reason) {\"use strict\";\n if (!@isReadableStreamBYOBReader(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStreamBYOBReader\", \"cancel\"));\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return @Promise.@reject(@makeTypeError(\"cancel() called on a reader owned by no readable stream\"));\n return @readableStreamReaderGenericCancel(this, reason);\n})\n";
-// error
-const JSC::ConstructAbility s_readableByteStreamControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamControllerErrorCodeLength = 344;
-static const JSC::Intrinsic s_readableByteStreamControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamControllerErrorCode = "(function (error){\"use strict\";if(!@isReadableByteStreamController(this))throw @makeThisTypeError(\"ReadableByteStreamController\",\"error\");if(@getByIdDirectPrivate(@getByIdDirectPrivate(this,\"controlledReadableStream\"),\"state\")!==@streamReadable)@throwTypeError(\"ReadableStream is not readable\");@readableByteStreamControllerError(this,error)})\n";
+// closed
+const JSC::ConstructAbility s_readableStreamBYOBReaderClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamBYOBReaderClosedCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamBYOBReaderClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamBYOBReaderClosedCodeLength = 235;
+static const JSC::Intrinsic s_readableStreamBYOBReaderClosedCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamBYOBReaderClosedCode = "(function () {\"use strict\";\n if (!@isReadableStreamBYOBReader(this))\n return @Promise.@reject(@makeGetterTypeError(\"ReadableStreamBYOBReader\", \"closed\"));\n return @getByIdDirectPrivate(this, \"closedPromiseCapability\").promise;\n})\n";
-// close
-const JSC::ConstructAbility s_readableByteStreamControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamControllerCloseCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamControllerCloseCodeLength = 433;
-static const JSC::Intrinsic s_readableByteStreamControllerCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamControllerCloseCode = "(function (){\"use strict\";if(!@isReadableByteStreamController(this))throw @makeThisTypeError(\"ReadableByteStreamController\",\"close\");if(@getByIdDirectPrivate(this,\"closeRequested\"))@throwTypeError(\"Close has already been requested\");if(@getByIdDirectPrivate(@getByIdDirectPrivate(this,\"controlledReadableStream\"),\"state\")!==@streamReadable)@throwTypeError(\"ReadableStream is not readable\");@readableByteStreamControllerClose(this)})\n";
+// initializeReadableStreamBYOBReader
+const JSC::ConstructAbility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeLength = 549;
+static const JSC::Intrinsic s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCode = "(function (stream) {\"use strict\";\n if (!@isReadableStream(stream))\n @throwTypeError(\"ReadableStreamBYOBReader needs a ReadableStream\");\n if (!@isReadableByteStreamController(@getByIdDirectPrivate(stream, \"readableStreamController\")))\n @throwTypeError(\"ReadableStreamBYOBReader needs a ReadableByteStreamController\");\n if (@isReadableStreamLocked(stream))\n @throwTypeError(\"ReadableStream is locked\");\n return @readableStreamReaderGenericInitialize(this, stream), @putByIdDirectPrivate(this, \"readIntoRequests\", @createFIFO()), this;\n})\n";
-// byobRequest
-const JSC::ConstructAbility s_readableByteStreamControllerByobRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamControllerByobRequestCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamControllerByobRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamControllerByobRequestCodeLength = 651;
-static const JSC::Intrinsic s_readableByteStreamControllerByobRequestCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamControllerByobRequestCode = "(function (){\"use strict\";if(!@isReadableByteStreamController(this))throw @makeGetterTypeError(\"ReadableByteStreamController\",\"byobRequest\");var request=@getByIdDirectPrivate(this,\"byobRequest\");if(request===@undefined){var pending=@getByIdDirectPrivate(this,\"pendingPullIntos\");const firstDescriptor=pending.peek();if(firstDescriptor){const view=new @Uint8Array(firstDescriptor.buffer,firstDescriptor.byteOffset+firstDescriptor.bytesFilled,firstDescriptor.byteLength-firstDescriptor.bytesFilled);@putByIdDirectPrivate(this,\"byobRequest\",new @ReadableStreamBYOBRequest(this,view,@isReadableStream))}}return @getByIdDirectPrivate(this,\"byobRequest\")})\n";
+// read
+const JSC::ConstructAbility s_readableStreamBYOBReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamBYOBReaderReadCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamBYOBReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamBYOBReaderReadCodeLength = 719;
+static const JSC::Intrinsic s_readableStreamBYOBReaderReadCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamBYOBReaderReadCode = "(function (view) {\"use strict\";\n if (!@isReadableStreamBYOBReader(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStreamBYOBReader\", \"read\"));\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return @Promise.@reject(@makeTypeError(\"read() called on a reader owned by no readable stream\"));\n if (!@isObject(view))\n return @Promise.@reject(@makeTypeError(\"Provided view is not an object\"));\n if (!@ArrayBuffer.@isView(view))\n return @Promise.@reject(@makeTypeError(\"Provided view is not an ArrayBufferView\"));\n if (view.byteLength === 0)\n return @Promise.@reject(@makeTypeError(\"Provided view cannot have a 0 byteLength\"));\n return @readableStreamBYOBReaderRead(this, view);\n})\n";
-// desiredSize
-const JSC::ConstructAbility s_readableByteStreamControllerDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamControllerDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamControllerDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamControllerDesiredSizeCodeLength = 200;
-static const JSC::Intrinsic s_readableByteStreamControllerDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamControllerDesiredSizeCode = "(function (){\"use strict\";if(!@isReadableByteStreamController(this))throw @makeGetterTypeError(\"ReadableByteStreamController\",\"desiredSize\");return @readableByteStreamControllerGetDesiredSize(this)})\n";
+// releaseLock
+const JSC::ConstructAbility s_readableStreamBYOBReaderReleaseLockCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamBYOBReaderReleaseLockCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamBYOBReaderReleaseLockCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamBYOBReaderReleaseLockCodeLength = 418;
+static const JSC::Intrinsic s_readableStreamBYOBReaderReleaseLockCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamBYOBReaderReleaseLockCode = "(function () {\"use strict\";\n if (!@isReadableStreamBYOBReader(this))\n throw @makeThisTypeError(\"ReadableStreamBYOBReader\", \"releaseLock\");\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return;\n if (@getByIdDirectPrivate(this, \"readIntoRequests\")\?.isNotEmpty())\n @throwTypeError(\"There are still pending read requests, cannot release the lock\");\n @readableStreamReaderGenericRelease(this);\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
{\
JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().readableByteStreamControllerBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableByteStreamControllerBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+ return clientData->builtinFunctions().readableStreamBYOBReaderBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamBYOBReaderBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
}
-WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
-/* UtilInspect.ts */
-// getStylizeWithColor
-const JSC::ConstructAbility s_utilInspectGetStylizeWithColorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_utilInspectGetStylizeWithColorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_utilInspectGetStylizeWithColorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_utilInspectGetStylizeWithColorCodeLength = 261;
-static const JSC::Intrinsic s_utilInspectGetStylizeWithColorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_utilInspectGetStylizeWithColorCode = "(function (inspect){\"use strict\";return function stylizeWithColor(str,styleType){const style=inspect.styles[styleType];if(style!==@undefined){const color=inspect.colors[style];if(color!==@undefined)return`\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`}return str}})\n";
+/* ReadableStreamBYOBRequest.ts */
+// initializeReadableStreamBYOBRequest
+const JSC::ConstructAbility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeLength = 291;
+static const JSC::Intrinsic s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCode = "(function (controller, view) {\"use strict\";\n if (arguments.length !== 3 && arguments[2] !== @isReadableStream)\n @throwTypeError(\"ReadableStreamBYOBRequest constructor should not be called directly\");\n return @privateInitializeReadableStreamBYOBRequest.@call(this, controller, view);\n})\n";
-// stylizeWithNoColor
-const JSC::ConstructAbility s_utilInspectStylizeWithNoColorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_utilInspectStylizeWithNoColorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_utilInspectStylizeWithNoColorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_utilInspectStylizeWithNoColorCodeLength = 42;
-static const JSC::Intrinsic s_utilInspectStylizeWithNoColorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_utilInspectStylizeWithNoColorCode = "(function (str){\"use strict\";return str})\n";
+// respond
+const JSC::ConstructAbility s_readableStreamBYOBRequestRespondCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamBYOBRequestRespondCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamBYOBRequestRespondCodeLength = 482;
+static const JSC::Intrinsic s_readableStreamBYOBRequestRespondCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamBYOBRequestRespondCode = "(function (bytesWritten) {\"use strict\";\n if (!@isReadableStreamBYOBRequest(this))\n throw @makeThisTypeError(\"ReadableStreamBYOBRequest\", \"respond\");\n if (@getByIdDirectPrivate(this, \"associatedReadableByteStreamController\") === @undefined)\n @throwTypeError(\"ReadableStreamBYOBRequest.associatedReadableByteStreamController is undefined\");\n return @readableByteStreamControllerRespond(@getByIdDirectPrivate(this, \"associatedReadableByteStreamController\"), bytesWritten);\n})\n";
+
+// respondWithNewView
+const JSC::ConstructAbility s_readableStreamBYOBRequestRespondWithNewViewCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamBYOBRequestRespondWithNewViewCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondWithNewViewCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamBYOBRequestRespondWithNewViewCodeLength = 655;
+static const JSC::Intrinsic s_readableStreamBYOBRequestRespondWithNewViewCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamBYOBRequestRespondWithNewViewCode = "(function (view) {\"use strict\";\n if (!@isReadableStreamBYOBRequest(this))\n throw @makeThisTypeError(\"ReadableStreamBYOBRequest\", \"respond\");\n if (@getByIdDirectPrivate(this, \"associatedReadableByteStreamController\") === @undefined)\n @throwTypeError(\"ReadableStreamBYOBRequest.associatedReadableByteStreamController is undefined\");\n if (!@isObject(view))\n @throwTypeError(\"Provided view is not an object\");\n if (!@ArrayBuffer.@isView(view))\n @throwTypeError(\"Provided view is not an ArrayBufferView\");\n return @readableByteStreamControllerRespondWithNewView(@getByIdDirectPrivate(this, \"associatedReadableByteStreamController\"), view);\n})\n";
+
+// view
+const JSC::ConstructAbility s_readableStreamBYOBRequestViewCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamBYOBRequestViewCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamBYOBRequestViewCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamBYOBRequestViewCodeLength = 189;
+static const JSC::Intrinsic s_readableStreamBYOBRequestViewCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamBYOBRequestViewCode = "(function () {\"use strict\";\n if (!@isReadableStreamBYOBRequest(this))\n throw @makeGetterTypeError(\"ReadableStreamBYOBRequest\", \"view\");\n return @getByIdDirectPrivate(this, \"view\");\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
{\
JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().utilInspectBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().utilInspectBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+ return clientData->builtinFunctions().readableStreamBYOBRequestBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamBYOBRequestBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
}
-WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
-/* ConsoleObject.ts */
-// asyncIterator
-const JSC::ConstructAbility s_consoleObjectAsyncIteratorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_consoleObjectAsyncIteratorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_consoleObjectAsyncIteratorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_consoleObjectAsyncIteratorCodeLength = 949;
-static const JSC::Intrinsic s_consoleObjectAsyncIteratorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_consoleObjectAsyncIteratorCode = "(function (){\"use strict\";const Iterator=async function*ConsoleAsyncIterator(){var reader=@Bun.stdin.stream().getReader(),decoder=new globalThis.TextDecoder(\"utf-8\",{fatal:!1}),deferredError,indexOf=@Bun.indexOfLine;try{while(!0){var done,value,pendingChunk;const firstResult=reader.readMany();if(@isPromise(firstResult))({done,value}=await firstResult);else({done,value}=firstResult);if(done){if(pendingChunk)yield decoder.decode(pendingChunk);return}var actualChunk;for(let chunk of value){if(actualChunk=chunk,pendingChunk)actualChunk=@Buffer.concat([pendingChunk,chunk]),pendingChunk=null;var last=0,i=indexOf(actualChunk,last);while(i!==-1)yield decoder.decode(actualChunk.subarray(last,i)),last=i+1,i=indexOf(actualChunk,last);pendingChunk=actualChunk.subarray(last)}}}catch(e){deferredError=e}finally{if(reader.releaseLock(),deferredError)throw deferredError}},symbol=globalThis.Symbol.asyncIterator;return this[symbol]=Iterator,Iterator()})\n";
+/* ReadableStreamDefaultController.ts */
+// close
+const JSC::ConstructAbility s_readableStreamDefaultControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamDefaultControllerCloseCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamDefaultControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamDefaultControllerCloseCodeLength = 362;
+static const JSC::Intrinsic s_readableStreamDefaultControllerCloseCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamDefaultControllerCloseCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultController(this))\n throw @makeThisTypeError(\"ReadableStreamDefaultController\", \"close\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(this))\n @throwTypeError(\"ReadableStreamDefaultController is not in a state where it can be closed\");\n @readableStreamDefaultControllerClose(this);\n})\n";
-// write
-const JSC::ConstructAbility s_consoleObjectWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_consoleObjectWriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_consoleObjectWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_consoleObjectWriteCodeLength = 392;
-static const JSC::Intrinsic s_consoleObjectWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_consoleObjectWriteCode = "(function (input){\"use strict\";var writer=@getByIdDirectPrivate(this,\"writer\");if(!writer){var length=@toLength(input\?.length\?\?0);writer=@Bun.stdout.writer({highWaterMark:length>65536\?length:65536}),@putByIdDirectPrivate(this,\"writer\",writer)}var wrote=writer.write(input);const count=@argumentCount();for(var i=1;i<count;i++)wrote+=writer.write(@argument(i));return writer.flush(!0),wrote})\n";
+// desiredSize
+const JSC::ConstructAbility s_readableStreamDefaultControllerDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamDefaultControllerDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamDefaultControllerDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamDefaultControllerDesiredSizeCodeLength = 225;
+static const JSC::Intrinsic s_readableStreamDefaultControllerDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamDefaultControllerDesiredSizeCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultController(this))\n throw @makeGetterTypeError(\"ReadableStreamDefaultController\", \"desiredSize\");\n return @readableStreamDefaultControllerGetDesiredSize(this);\n})\n";
+
+// enqueue
+const JSC::ConstructAbility s_readableStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamDefaultControllerEnqueueCodeLength = 390;
+static const JSC::Intrinsic s_readableStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamDefaultControllerEnqueueCode = "(function (chunk) {\"use strict\";\n if (!@isReadableStreamDefaultController(this))\n throw @makeThisTypeError(\"ReadableStreamDefaultController\", \"enqueue\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(this))\n @throwTypeError(\"ReadableStreamDefaultController is not in a state where chunk can be enqueued\");\n return @readableStreamDefaultControllerEnqueue(this, chunk);\n})\n";
+
+// error
+const JSC::ConstructAbility s_readableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamDefaultControllerErrorCodeLength = 209;
+static const JSC::Intrinsic s_readableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamDefaultControllerErrorCode = "(function (err) {\"use strict\";\n if (!@isReadableStreamDefaultController(this))\n throw @makeThisTypeError(\"ReadableStreamDefaultController\", \"error\");\n @readableStreamDefaultControllerError(this, err);\n})\n";
+
+// initializeReadableStreamDefaultController
+const JSC::ConstructAbility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeLength = 361;
+static const JSC::Intrinsic s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCode = "(function (stream, underlyingSource, size, highWaterMark) {\"use strict\";\n if (arguments.length !== 5 && arguments[4] !== @isReadableStream)\n @throwTypeError(\"ReadableStreamDefaultController constructor should not be called directly\");\n return @privateInitializeReadableStreamDefaultController.@call(this, stream, underlyingSource, size, highWaterMark);\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
{\
JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().consoleObjectBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().consoleObjectBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+ return clientData->builtinFunctions().readableStreamDefaultControllerBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamDefaultControllerBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
}
-WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
-/* ReadableStreamInternals.ts */
-// readableStreamReaderGenericInitialize
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength = 584;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamReaderGenericInitializeCode = "(function (reader,stream){\"use strict\";if(@putByIdDirectPrivate(reader,\"ownerReadableStream\",stream),@putByIdDirectPrivate(stream,\"reader\",reader),@getByIdDirectPrivate(stream,\"state\")===@streamReadable)@putByIdDirectPrivate(reader,\"closedPromiseCapability\",@newPromiseCapability(@Promise));else if(@getByIdDirectPrivate(stream,\"state\")===@streamClosed)@putByIdDirectPrivate(reader,\"closedPromiseCapability\",{promise:@Promise.@resolve()});else @putByIdDirectPrivate(reader,\"closedPromiseCapability\",{promise:@newHandledRejectedPromise(@getByIdDirectPrivate(stream,\"storedError\"))})})\n";
+/* ReadableStreamDefaultReader.ts */
+// cancel
+const JSC::ConstructAbility s_readableStreamDefaultReaderCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamDefaultReaderCancelCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamDefaultReaderCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamDefaultReaderCancelCodeLength = 394;
+static const JSC::Intrinsic s_readableStreamDefaultReaderCancelCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamDefaultReaderCancelCode = "(function (reason) {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStreamDefaultReader\", \"cancel\"));\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return @Promise.@reject(@makeTypeError(\"cancel() called on a reader owned by no readable stream\"));\n return @readableStreamReaderGenericCancel(this, reason);\n})\n";
-// privateInitializeReadableStreamDefaultController
-const JSC::ConstructAbility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeLength = 755;
-static const JSC::Intrinsic s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCode = "(function (stream,underlyingSource,size,highWaterMark){\"use strict\";if(!@isReadableStream(stream))@throwTypeError(\"ReadableStreamDefaultController needs a ReadableStream\");if(@getByIdDirectPrivate(stream,\"readableStreamController\")!==null)@throwTypeError(\"ReadableStream already has a controller\");return @putByIdDirectPrivate(this,\"controlledReadableStream\",stream),@putByIdDirectPrivate(this,\"underlyingSource\",underlyingSource),@putByIdDirectPrivate(this,\"queue\",@newQueue()),@putByIdDirectPrivate(this,\"started\",-1),@putByIdDirectPrivate(this,\"closeRequested\",!1),@putByIdDirectPrivate(this,\"pullAgain\",!1),@putByIdDirectPrivate(this,\"pulling\",!1),@putByIdDirectPrivate(this,\"strategy\",@validateAndNormalizeQueuingStrategy(size,highWaterMark)),this})\n";
+// closed
+const JSC::ConstructAbility s_readableStreamDefaultReaderClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamDefaultReaderClosedCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamDefaultReaderClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamDefaultReaderClosedCodeLength = 241;
+static const JSC::Intrinsic s_readableStreamDefaultReaderClosedCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamDefaultReaderClosedCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n return @Promise.@reject(@makeGetterTypeError(\"ReadableStreamDefaultReader\", \"closed\"));\n return @getByIdDirectPrivate(this, \"closedPromiseCapability\").promise;\n})\n";
-// readableStreamDefaultControllerError
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeLength = 273;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultControllerErrorCode = "(function (controller,error){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"controlledReadableStream\");if(@getByIdDirectPrivate(stream,\"state\")!==@streamReadable)return;@putByIdDirectPrivate(controller,\"queue\",@newQueue()),@readableStreamError(stream,error)})\n";
+// initializeReadableStreamDefaultReader
+const JSC::ConstructAbility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeLength = 363;
+static const JSC::Intrinsic s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCode = "(function (stream) {\"use strict\";\n if (!@isReadableStream(stream))\n @throwTypeError(\"ReadableStreamDefaultReader needs a ReadableStream\");\n if (@isReadableStreamLocked(stream))\n @throwTypeError(\"ReadableStream is locked\");\n return @readableStreamReaderGenericInitialize(this, stream), @putByIdDirectPrivate(this, \"readRequests\", @createFIFO()), this;\n})\n";
-// readableStreamPipeTo
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamPipeToCodeLength = 469;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamPipeToCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamPipeToCode = "(function (stream,sink){\"use strict\";const reader=new @ReadableStreamDefaultReader(stream);@getByIdDirectPrivate(reader,\"closedPromiseCapability\").promise.@then(()=>{},(e)=>{sink.error(e)});function doPipe(){@readableStreamDefaultReaderRead(reader).@then(function(result){if(result.done){sink.close();return}try{sink.enqueue(result.value)}catch(e){sink.error(\"ReadableStream chunk enqueueing in the sink failed\");return}doPipe()},function(e){sink.error(e)})}doPipe()})\n";
+// read
+const JSC::ConstructAbility s_readableStreamDefaultReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamDefaultReaderReadCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamDefaultReaderReadCodeLength = 374;
+static const JSC::Intrinsic s_readableStreamDefaultReaderReadCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamDefaultReaderReadCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStreamDefaultReader\", \"read\"));\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return @Promise.@reject(@makeTypeError(\"read() called on a reader owned by no readable stream\"));\n return @readableStreamDefaultReaderRead(this);\n})\n";
+// readMany
+const JSC::ConstructAbility s_readableStreamDefaultReaderReadManyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamDefaultReaderReadManyCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadManyCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamDefaultReaderReadManyCodeLength = 3873;
+static const JSC::Intrinsic s_readableStreamDefaultReaderReadManyCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamDefaultReaderReadManyCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n @throwTypeError(\"ReadableStreamDefaultReader.readMany() should not be called directly\");\n const stream = @getByIdDirectPrivate(this, \"ownerReadableStream\");\n if (!stream)\n @throwTypeError(\"readMany() called on a reader owned by no readable stream\");\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (@putByIdDirectPrivate(stream, \"disturbed\", !0), state === 1)\n return { value: [], size: 0, done: !0 };\n else if (state === 3)\n throw @getByIdDirectPrivate(stream, \"storedError\");\n var controller = @getByIdDirectPrivate(stream, \"readableStreamController\"), queue = @getByIdDirectPrivate(controller, \"queue\");\n if (!queue)\n return controller.@pull(controller).@then(function({ done, value }) {\n return done \? { done: !0, value: [], size: 0 } : { value: [value], size: 1, done: !1 };\n });\n const content = queue.content;\n var size = queue.size, values = content.toArray(!1), length = values.length;\n if (length > 0) {\n var outValues = @newArrayWithSize(length);\n if (@isReadableByteStreamController(controller)) {\n {\n const buf = values[0];\n if (!(@ArrayBuffer.@isView(buf) || buf instanceof @ArrayBuffer))\n @putByValDirect(outValues, 0, new @Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength));\n else\n @putByValDirect(outValues, 0, buf);\n }\n for (var i = 1;i < length; i++) {\n const buf = values[i];\n if (!(@ArrayBuffer.@isView(buf) || buf instanceof @ArrayBuffer))\n @putByValDirect(outValues, i, new @Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength));\n else\n @putByValDirect(outValues, i, buf);\n }\n } else {\n @putByValDirect(outValues, 0, values[0].value);\n for (var i = 1;i < length; i++)\n @putByValDirect(outValues, i, values[i].value);\n }\n if (@resetQueue(@getByIdDirectPrivate(controller, \"queue\")), @getByIdDirectPrivate(controller, \"closeRequested\"))\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n else if (@isReadableStreamDefaultController(controller))\n @readableStreamDefaultControllerCallPullIfNeeded(controller);\n else if (@isReadableByteStreamController(controller))\n @readableByteStreamControllerCallPullIfNeeded(controller);\n return { value: outValues, size, done: !1 };\n }\n var onPullMany = (result) => {\n if (result.done)\n return { value: [], size: 0, done: !0 };\n var controller2 = @getByIdDirectPrivate(stream, \"readableStreamController\"), queue2 = @getByIdDirectPrivate(controller2, \"queue\"), value = [result.value].concat(queue2.content.toArray(!1)), length2 = value.length;\n if (@isReadableByteStreamController(controller2))\n for (var i2 = 0;i2 < length2; i2++) {\n const buf = value[i2];\n if (!(@ArrayBuffer.@isView(buf) || buf instanceof @ArrayBuffer)) {\n const { buffer, byteOffset, byteLength } = buf;\n @putByValDirect(value, i2, new @Uint8Array(buffer, byteOffset, byteLength));\n }\n }\n else\n for (var i2 = 1;i2 < length2; i2++)\n @putByValDirect(value, i2, value[i2].value);\n var size2 = queue2.size;\n if (@resetQueue(queue2), @getByIdDirectPrivate(controller2, \"closeRequested\"))\n @readableStreamClose(@getByIdDirectPrivate(controller2, \"controlledReadableStream\"));\n else if (@isReadableStreamDefaultController(controller2))\n @readableStreamDefaultControllerCallPullIfNeeded(controller2);\n else if (@isReadableByteStreamController(controller2))\n @readableByteStreamControllerCallPullIfNeeded(controller2);\n return { value, size: size2, done: !1 };\n }, pullResult = controller.@pull(controller);\n if (pullResult && @isPromise(pullResult))\n return pullResult.@then(onPullMany);\n return onPullMany(pullResult);\n})\n";
+
+// releaseLock
+const JSC::ConstructAbility s_readableStreamDefaultReaderReleaseLockCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamDefaultReaderReleaseLockCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamDefaultReaderReleaseLockCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamDefaultReaderReleaseLockCodeLength = 420;
+static const JSC::Intrinsic s_readableStreamDefaultReaderReleaseLockCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamDefaultReaderReleaseLockCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n throw @makeThisTypeError(\"ReadableStreamDefaultReader\", \"releaseLock\");\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return;\n if (@getByIdDirectPrivate(this, \"readRequests\")\?.isNotEmpty())\n @throwTypeError(\"There are still pending read requests, cannot release the lock\");\n @readableStreamReaderGenericRelease(this);\n})\n";
+
+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
+{\
+ JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
+ return clientData->builtinFunctions().readableStreamDefaultReaderBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamDefaultReaderBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+}
+WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
+
+/* ReadableStreamInternals.ts */
// acquireReadableStreamDefaultReader
const JSC::ConstructAbility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeLength = 159;
+const int s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeLength = 180;
static const JSC::Intrinsic s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsAcquireReadableStreamDefaultReaderCode = "(function (stream){\"use strict\";var start=@getByIdDirectPrivate(stream,\"start\");if(start)start.@call(stream);return new @ReadableStreamDefaultReader(stream)})\n";
+const char* const s_readableStreamInternalsAcquireReadableStreamDefaultReaderCode = "(function (stream) {\"use strict\";\n var start = @getByIdDirectPrivate(stream, \"start\");\n if (start)\n start.@call(stream);\n return new @ReadableStreamDefaultReader(stream);\n})\n";
-// setupReadableStreamDefaultController
-const JSC::ConstructAbility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeLength = 1105;
-static const JSC::Intrinsic s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsSetupReadableStreamDefaultControllerCode = "(function (stream,underlyingSource,size,highWaterMark,startMethod,pullMethod,cancelMethod){\"use strict\";const controller=new @ReadableStreamDefaultController(stream,underlyingSource,size,highWaterMark,@isReadableStream);var asyncContext=stream.@asyncContext;const pullAlgorithm=()=>@promiseInvokeOrNoopMethod(underlyingSource,pullMethod,[controller]),cancelAlgorithm=asyncContext\?(reason)=>{var prev=@getInternalField(@asyncContext,0);@putInternalField(@asyncContext,0,asyncContext);var result=@promiseInvokeOrNoopMethod(underlyingSource,cancelMethod,[reason]);return @putInternalField(@asyncContext,0,prev),result}:(reason)=>@promiseInvokeOrNoopMethod(underlyingSource,cancelMethod,[reason]);@putByIdDirectPrivate(controller,\"pullAlgorithm\",pullAlgorithm),@putByIdDirectPrivate(controller,\"cancelAlgorithm\",cancelAlgorithm),@putByIdDirectPrivate(controller,\"pull\",@readableStreamDefaultControllerPull),@putByIdDirectPrivate(controller,\"cancel\",@readableStreamDefaultControllerCancel),@putByIdDirectPrivate(stream,\"readableStreamController\",controller),@readableStreamDefaultControllerStart(controller)})\n";
+// assignToStream
+const JSC::ConstructAbility s_readableStreamInternalsAssignToStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsAssignToStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsAssignToStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
+const int s_readableStreamInternalsAssignToStreamCodeLength = 397;
+static const JSC::Intrinsic s_readableStreamInternalsAssignToStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsAssignToStreamCode = "(function (stream, sink) {\"use strict\";\n var underlyingSource = @getByIdDirectPrivate(stream, \"underlyingSource\");\n if (underlyingSource)\n try {\n return @readDirectStream(stream, sink, underlyingSource);\n } catch (e) {\n throw e;\n } finally {\n underlyingSource = @undefined, stream = @undefined, sink = @undefined;\n }\n return @readStreamIntoSink(stream, sink, !0);\n})\n";
// createReadableStreamController
const JSC::ConstructAbility s_readableStreamInternalsCreateReadableStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsCreateReadableStreamControllerCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsCreateReadableStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsCreateReadableStreamControllerCodeLength = 946;
+const int s_readableStreamInternalsCreateReadableStreamControllerCodeLength = 1077;
static const JSC::Intrinsic s_readableStreamInternalsCreateReadableStreamControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsCreateReadableStreamControllerCode = "(function (stream,underlyingSource,strategy){\"use strict\";const type=underlyingSource.type,typeString=@toString(type);if(typeString===\"bytes\"){if(strategy.highWaterMark===@undefined)strategy.highWaterMark=0;if(strategy.size!==@undefined)@throwRangeError(\"Strategy for a ReadableByteStreamController cannot have a size\");@putByIdDirectPrivate(stream,\"readableStreamController\",new @ReadableByteStreamController(stream,underlyingSource,strategy.highWaterMark,@isReadableStream))}else if(typeString===\"direct\"){var highWaterMark=strategy\?.highWaterMark;@initializeArrayBufferStream.@call(stream,underlyingSource,highWaterMark)}else if(type===@undefined){if(strategy.highWaterMark===@undefined)strategy.highWaterMark=1;@setupReadableStreamDefaultController(stream,underlyingSource,strategy.size,strategy.highWaterMark,underlyingSource.start,underlyingSource.pull,underlyingSource.cancel)}else @throwRangeError(\"Invalid type for underlying source\")})\n";
-
-// readableStreamDefaultControllerStart
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamDefaultControllerStartCodeLength = 518;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerStartCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultControllerStartCode = "(function (controller){\"use strict\";if(@getByIdDirectPrivate(controller,\"started\")!==-1)return;const underlyingSource=@getByIdDirectPrivate(controller,\"underlyingSource\"),startMethod=underlyingSource.start;@putByIdDirectPrivate(controller,\"started\",0),@promiseInvokeOrNoopMethodNoCatch(underlyingSource,startMethod,[controller]).@then(()=>{@putByIdDirectPrivate(controller,\"started\",1),@readableStreamDefaultControllerCallPullIfNeeded(controller)},(error)=>{@readableStreamDefaultControllerError(controller,error)})})\n";
-
-// readableStreamPipeToWritableStream
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength = 2022;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamPipeToWritableStreamCode = "(function (source,destination,preventClose,preventAbort,preventCancel,signal){\"use strict\";if(@getByIdDirectPrivate(source,\"underlyingByteSource\")!==@undefined)return @Promise.@reject(\"Piping to a readable bytestream is not supported\");let pipeState={source,destination,preventAbort,preventCancel,preventClose,signal};if(pipeState.reader=@acquireReadableStreamDefaultReader(source),pipeState.writer=@acquireWritableStreamDefaultWriter(destination),@putByIdDirectPrivate(source,\"disturbed\",!0),pipeState.finalized=!1,pipeState.shuttingDown=!1,pipeState.promiseCapability=@newPromiseCapability(@Promise),pipeState.pendingReadPromiseCapability=@newPromiseCapability(@Promise),pipeState.pendingReadPromiseCapability.resolve.@call(),pipeState.pendingWritePromise=@Promise.@resolve(),signal!==@undefined){const algorithm=(reason)=>{if(pipeState.finalized)return;@pipeToShutdownWithAction(pipeState,()=>{const promiseDestination=!pipeState.preventAbort&&@getByIdDirectPrivate(pipeState.destination,\"state\")===\"writable\"\?@writableStreamAbort(pipeState.destination,reason):@Promise.@resolve(),promiseSource=!pipeState.preventCancel&&@getByIdDirectPrivate(pipeState.source,\"state\")===@streamReadable\?@readableStreamCancel(pipeState.source,reason):@Promise.@resolve();let promiseCapability=@newPromiseCapability(@Promise),shouldWait=!0,handleResolvedPromise=()=>{if(shouldWait){shouldWait=!1;return}promiseCapability.resolve.@call()},handleRejectedPromise=(e)=>{promiseCapability.reject.@call(@undefined,e)};return promiseDestination.@then(handleResolvedPromise,handleRejectedPromise),promiseSource.@then(handleResolvedPromise,handleRejectedPromise),promiseCapability.promise},reason)};if(@whenSignalAborted(signal,algorithm))return pipeState.promiseCapability.promise}return @pipeToErrorsMustBePropagatedForward(pipeState),@pipeToErrorsMustBePropagatedBackward(pipeState),@pipeToClosingMustBePropagatedForward(pipeState),@pipeToClosingMustBePropagatedBackward(pipeState),@pipeToLoop(pipeState),pipeState.promiseCapability.promise})\n";
-
-// pipeToLoop
-const JSC::ConstructAbility s_readableStreamInternalsPipeToLoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsPipeToLoopCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsPipeToLoopCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsPipeToLoopCodeLength = 152;
-static const JSC::Intrinsic s_readableStreamInternalsPipeToLoopCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPipeToLoopCode = "(function (pipeState){\"use strict\";if(pipeState.shuttingDown)return;@pipeToDoReadWrite(pipeState).@then((result)=>{if(result)@pipeToLoop(pipeState)})})\n";
-
-// pipeToDoReadWrite
-const JSC::ConstructAbility s_readableStreamInternalsPipeToDoReadWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsPipeToDoReadWriteCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsPipeToDoReadWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsPipeToDoReadWriteCodeLength = 840;
-static const JSC::Intrinsic s_readableStreamInternalsPipeToDoReadWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPipeToDoReadWriteCode = "(function (pipeState){\"use strict\";return pipeState.pendingReadPromiseCapability=@newPromiseCapability(@Promise),@getByIdDirectPrivate(pipeState.writer,\"readyPromise\").promise.@then(()=>{if(pipeState.shuttingDown){pipeState.pendingReadPromiseCapability.resolve.@call(@undefined,!1);return}@readableStreamDefaultReaderRead(pipeState.reader).@then((result)=>{const canWrite=!result.done&&@getByIdDirectPrivate(pipeState.writer,\"stream\")!==@undefined;if(pipeState.pendingReadPromiseCapability.resolve.@call(@undefined,canWrite),!canWrite)return;pipeState.pendingWritePromise=@writableStreamDefaultWriterWrite(pipeState.writer,result.value)},(e)=>{pipeState.pendingReadPromiseCapability.resolve.@call(@undefined,!1)})},(e)=>{pipeState.pendingReadPromiseCapability.resolve.@call(@undefined,!1)}),pipeState.pendingReadPromiseCapability.promise})\n";
+const char* const s_readableStreamInternalsCreateReadableStreamControllerCode = "(function (stream, underlyingSource, strategy) {\"use strict\";\n const type = underlyingSource.type, typeString = @toString(type);\n if (typeString === \"bytes\") {\n if (strategy.highWaterMark === @undefined)\n strategy.highWaterMark = 0;\n if (strategy.size !== @undefined)\n @throwRangeError(\"Strategy for a ReadableByteStreamController cannot have a size\");\n @putByIdDirectPrivate(stream, \"readableStreamController\", new @ReadableByteStreamController(stream, underlyingSource, strategy.highWaterMark, @isReadableStream));\n } else if (typeString === \"direct\") {\n var highWaterMark = strategy\?.highWaterMark;\n @initializeArrayBufferStream.@call(stream, underlyingSource, highWaterMark);\n } else if (type === @undefined) {\n if (strategy.highWaterMark === @undefined)\n strategy.highWaterMark = 1;\n @setupReadableStreamDefaultController(stream, underlyingSource, strategy.size, strategy.highWaterMark, underlyingSource.start, underlyingSource.pull, underlyingSource.cancel);\n } else\n @throwRangeError(\"Invalid type for underlying source\");\n})\n";
-// pipeToErrorsMustBePropagatedForward
-const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeLength = 539;
-static const JSC::Intrinsic s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode = "(function (pipeState){\"use strict\";const action=()=>{pipeState.pendingReadPromiseCapability.resolve.@call(@undefined,!1);const error=@getByIdDirectPrivate(pipeState.source,\"storedError\");if(!pipeState.preventAbort){@pipeToShutdownWithAction(pipeState,()=>@writableStreamAbort(pipeState.destination,error),error);return}@pipeToShutdown(pipeState,error)};if(@getByIdDirectPrivate(pipeState.source,\"state\")===@streamErrored){action();return}@getByIdDirectPrivate(pipeState.reader,\"closedPromiseCapability\").promise.@then(@undefined,action)})\n";
-
-// pipeToErrorsMustBePropagatedBackward
-const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeLength = 463;
-static const JSC::Intrinsic s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode = "(function (pipeState){\"use strict\";const action=()=>{const error=@getByIdDirectPrivate(pipeState.destination,\"storedError\");if(!pipeState.preventCancel){@pipeToShutdownWithAction(pipeState,()=>@readableStreamCancel(pipeState.source,error),error);return}@pipeToShutdown(pipeState,error)};if(@getByIdDirectPrivate(pipeState.destination,\"state\")===\"errored\"){action();return}@getByIdDirectPrivate(pipeState.writer,\"closedPromise\").promise.@then(@undefined,action)})\n";
-
-// pipeToClosingMustBePropagatedForward
-const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeLength = 482;
-static const JSC::Intrinsic s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCode = "(function (pipeState){\"use strict\";const action=()=>{if(pipeState.pendingReadPromiseCapability.resolve.@call(@undefined,!1),!pipeState.preventClose){@pipeToShutdownWithAction(pipeState,()=>@writableStreamDefaultWriterCloseWithErrorPropagation(pipeState.writer));return}@pipeToShutdown(pipeState)};if(@getByIdDirectPrivate(pipeState.source,\"state\")===@streamClosed){action();return}@getByIdDirectPrivate(pipeState.reader,\"closedPromiseCapability\").promise.@then(action,@undefined)})\n";
-
-// pipeToClosingMustBePropagatedBackward
-const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeLength = 396;
-static const JSC::Intrinsic s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCode = "(function (pipeState){\"use strict\";if(!@writableStreamCloseQueuedOrInFlight(pipeState.destination)&&@getByIdDirectPrivate(pipeState.destination,\"state\")!==\"closed\")return;const error=@makeTypeError(\"closing is propagated backward\");if(!pipeState.preventCancel){@pipeToShutdownWithAction(pipeState,()=>@readableStreamCancel(pipeState.source,error),error);return}@pipeToShutdown(pipeState,error)})\n";
-
-// pipeToShutdownWithAction
-const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownWithActionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownWithActionCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownWithActionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsPipeToShutdownWithActionCodeLength = 605;
-static const JSC::Intrinsic s_readableStreamInternalsPipeToShutdownWithActionCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPipeToShutdownWithActionCode = "(function (pipeState,action){\"use strict\";if(pipeState.shuttingDown)return;pipeState.shuttingDown=!0;const hasError=arguments.length>2,error=arguments[2],finalize=()=>{action().@then(()=>{if(hasError)@pipeToFinalize(pipeState,error);else @pipeToFinalize(pipeState)},(e)=>{@pipeToFinalize(pipeState,e)})};if(@getByIdDirectPrivate(pipeState.destination,\"state\")===\"writable\"&&!@writableStreamCloseQueuedOrInFlight(pipeState.destination)){pipeState.pendingReadPromiseCapability.promise.@then(()=>{pipeState.pendingWritePromise.@then(finalize,finalize)},(e)=>@pipeToFinalize(pipeState,e));return}finalize()})\n";
-
-// pipeToShutdown
-const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsPipeToShutdownCodeLength = 540;
-static const JSC::Intrinsic s_readableStreamInternalsPipeToShutdownCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPipeToShutdownCode = "(function (pipeState){\"use strict\";if(pipeState.shuttingDown)return;pipeState.shuttingDown=!0;const hasError=arguments.length>1,error=arguments[1],finalize=()=>{if(hasError)@pipeToFinalize(pipeState,error);else @pipeToFinalize(pipeState)};if(@getByIdDirectPrivate(pipeState.destination,\"state\")===\"writable\"&&!@writableStreamCloseQueuedOrInFlight(pipeState.destination)){pipeState.pendingReadPromiseCapability.promise.@then(()=>{pipeState.pendingWritePromise.@then(finalize,finalize)},(e)=>@pipeToFinalize(pipeState,e));return}finalize()})\n";
+// createTextStream
+const JSC::ConstructAbility s_readableStreamInternalsCreateTextStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsCreateTextStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsCreateTextStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsCreateTextStreamCodeLength = 2045;
+static const JSC::Intrinsic s_readableStreamInternalsCreateTextStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsCreateTextStreamCode = "(function (highWaterMark) {\"use strict\";\n var sink, array = [], hasString = !1, hasBuffer = !1, rope = \"\", estimatedLength = @toLength(0), capability = @newPromiseCapability(@Promise), calledDone = !1;\n return sink = {\n start() {\n },\n write(chunk) {\n if (typeof chunk === \"string\") {\n var chunkLength = @toLength(chunk.length);\n if (chunkLength > 0)\n rope += chunk, hasString = !0, estimatedLength += chunkLength;\n return chunkLength;\n }\n if (!chunk || !(@ArrayBuffer.@isView(chunk) || chunk instanceof @ArrayBuffer))\n @throwTypeError(\"Expected text, ArrayBuffer or ArrayBufferView\");\n const byteLength = @toLength(chunk.byteLength);\n if (byteLength > 0)\n if (hasBuffer = !0, rope.length > 0)\n @arrayPush(array, rope), @arrayPush(array, chunk), rope = \"\";\n else\n @arrayPush(array, chunk);\n return estimatedLength += byteLength, byteLength;\n },\n flush() {\n return 0;\n },\n end() {\n if (calledDone)\n return \"\";\n return sink.fulfill();\n },\n fulfill() {\n calledDone = !0;\n const result = sink.finishInternal();\n return @fulfillPromise(capability.promise, result), result;\n },\n finishInternal() {\n if (!hasString && !hasBuffer)\n return \"\";\n if (hasString && !hasBuffer)\n return rope;\n if (hasBuffer && !hasString)\n return new globalThis.TextDecoder().decode(Bun.concatArrayBuffers(array));\n var arrayBufferSink = new Bun.ArrayBufferSink;\n arrayBufferSink.start({\n highWaterMark: estimatedLength,\n asUint8Array: !0\n });\n for (let item of array)\n arrayBufferSink.write(item);\n if (array.length = 0, rope.length > 0)\n arrayBufferSink.write(rope), rope = \"\";\n return new globalThis.TextDecoder().decode(arrayBufferSink.end());\n },\n close() {\n try {\n if (!calledDone)\n calledDone = !0, sink.fulfill();\n } catch (e) {\n }\n }\n }, [sink, capability];\n})\n";
-// pipeToFinalize
-const JSC::ConstructAbility s_readableStreamInternalsPipeToFinalizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsPipeToFinalizeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsPipeToFinalizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsPipeToFinalizeCodeLength = 305;
-static const JSC::Intrinsic s_readableStreamInternalsPipeToFinalizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPipeToFinalizeCode = "(function (pipeState){\"use strict\";if(@writableStreamDefaultWriterRelease(pipeState.writer),@readableStreamReaderGenericRelease(pipeState.reader),pipeState.finalized=!0,arguments.length>1)pipeState.promiseCapability.reject.@call(@undefined,arguments[1]);else pipeState.promiseCapability.resolve.@call()})\n";
+// handleDirectStreamError
+const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsHandleDirectStreamErrorCodeLength = 735;
+static const JSC::Intrinsic s_readableStreamInternalsHandleDirectStreamErrorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsHandleDirectStreamErrorCode = "(function (e) {\"use strict\";\n var controller = this, sink = controller.@sink;\n if (sink) {\n @putByIdDirectPrivate(controller, \"sink\", @undefined);\n try {\n sink.close(e);\n } catch (f) {\n }\n }\n if (this.error = this.flush = this.write = this.close = this.end = @onReadableStreamDirectControllerClosed, typeof this.@underlyingSource.close === \"function\")\n try {\n this.@underlyingSource.close.@call(this.@underlyingSource, e);\n } catch (e2) {\n }\n try {\n var pend = controller._pendingRead;\n if (pend)\n controller._pendingRead = @undefined, @rejectPromise(pend, e);\n } catch (f) {\n }\n var stream = controller.@controlledReadableStream;\n if (stream)\n @readableStreamError(stream, e);\n})\n";
-// readableStreamTee
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamTeeCodeLength = 1383;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamTeeCode = "(function (stream,shouldClone){\"use strict\";var start_=@getByIdDirectPrivate(stream,\"start\");if(start_)@putByIdDirectPrivate(stream,\"start\",@undefined),start_();const reader=new @ReadableStreamDefaultReader(stream),teeState={closedOrErrored:!1,canceled1:!1,canceled2:!1,reason1:@undefined,reason2:@undefined};teeState.cancelPromiseCapability=@newPromiseCapability(@Promise);const pullFunction=@readableStreamTeePullFunction(teeState,reader,shouldClone),branch1Source={};@putByIdDirectPrivate(branch1Source,\"pull\",pullFunction),@putByIdDirectPrivate(branch1Source,\"cancel\",@readableStreamTeeBranch1CancelFunction(teeState,stream));const branch2Source={};@putByIdDirectPrivate(branch2Source,\"pull\",pullFunction),@putByIdDirectPrivate(branch2Source,\"cancel\",@readableStreamTeeBranch2CancelFunction(teeState,stream));const branch1=new @ReadableStream(branch1Source),branch2=new @ReadableStream(branch2Source);return @getByIdDirectPrivate(reader,\"closedPromiseCapability\").promise.@then(@undefined,function(e){if(teeState.closedOrErrored)return;if(@readableStreamDefaultControllerError(branch1.@readableStreamController,e),@readableStreamDefaultControllerError(branch2.@readableStreamController,e),teeState.closedOrErrored=!0,!teeState.canceled1||!teeState.canceled2)teeState.cancelPromiseCapability.resolve.@call()}),teeState.branch1=branch1,teeState.branch2=branch2,[branch1,branch2]})\n";
+// handleDirectStreamErrorReject
+const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsHandleDirectStreamErrorRejectCodeLength = 103;
+static const JSC::Intrinsic s_readableStreamInternalsHandleDirectStreamErrorRejectCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsHandleDirectStreamErrorRejectCode = "(function (e) {\"use strict\";\n return @handleDirectStreamError.@call(this, e), @Promise.@reject(e);\n})\n";
-// readableStreamTeePullFunction
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeePullFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength = 866;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeePullFunctionCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamTeePullFunctionCode = "(function (teeState,reader,shouldClone){\"use strict\";return function(){@Promise.prototype.@then.@call(@readableStreamDefaultReaderRead(reader),function(result){if(result.done&&!teeState.closedOrErrored){if(!teeState.canceled1)@readableStreamDefaultControllerClose(teeState.branch1.@readableStreamController);if(!teeState.canceled2)@readableStreamDefaultControllerClose(teeState.branch2.@readableStreamController);if(teeState.closedOrErrored=!0,!teeState.canceled1||!teeState.canceled2)teeState.cancelPromiseCapability.resolve.@call()}if(teeState.closedOrErrored)return;if(!teeState.canceled1)@readableStreamDefaultControllerEnqueue(teeState.branch1.@readableStreamController,result.value);if(!teeState.canceled2)@readableStreamDefaultControllerEnqueue(teeState.branch2.@readableStreamController,shouldClone\?@structuredCloneForStream(result.value):result.value)})}})\n";
+// initializeArrayBufferStream
+const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayBufferStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsInitializeArrayBufferStreamCodeLength = 935;
+static const JSC::Intrinsic s_readableStreamInternalsInitializeArrayBufferStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsInitializeArrayBufferStreamCode = "(function (underlyingSource, highWaterMark) {\"use strict\";\n var opts = highWaterMark && typeof highWaterMark === \"number\" \? { highWaterMark, stream: !0, asUint8Array: !0 } : { stream: !0, asUint8Array: !0 }, sink = new Bun.ArrayBufferSink;\n sink.start(opts);\n var controller = {\n @underlyingSource: underlyingSource,\n @pull: @onPullDirectStream,\n @controlledReadableStream: this,\n @sink: sink,\n close: @onCloseDirectStream,\n write: sink.write.bind(sink),\n error: @handleDirectStreamError,\n end: @onCloseDirectStream,\n @close: @onCloseDirectStream,\n flush: @onFlushDirectStream,\n _pendingRead: @undefined,\n _deferClose: 0,\n _deferFlush: 0,\n _deferCloseReason: @undefined,\n _handleError: @undefined\n };\n @putByIdDirectPrivate(this, \"readableStreamController\", controller), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"start\", @undefined);\n})\n";
-// readableStreamTeeBranch1CancelFunction
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength = 330;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode = "(function (teeState,stream){\"use strict\";return function(r){if(teeState.canceled1=!0,teeState.reason1=r,teeState.canceled2)@readableStreamCancel(stream,[teeState.reason1,teeState.reason2]).@then(teeState.cancelPromiseCapability.@resolve,teeState.cancelPromiseCapability.@reject);return teeState.cancelPromiseCapability.promise}})\n";
+// initializeArrayStream
+const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsInitializeArrayStreamCodeLength = 1258;
+static const JSC::Intrinsic s_readableStreamInternalsInitializeArrayStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsInitializeArrayStreamCode = "(function (underlyingSource, highWaterMark) {\"use strict\";\n var array = [], closingPromise = @newPromiseCapability(@Promise), calledDone = !1;\n function fulfill() {\n return calledDone = !0, closingPromise.resolve.@call(@undefined, array), array;\n }\n var sink = {\n start() {\n },\n write(chunk) {\n return @arrayPush(array, chunk), chunk.byteLength || chunk.length;\n },\n flush() {\n return 0;\n },\n end() {\n if (calledDone)\n return [];\n return fulfill();\n },\n close() {\n if (!calledDone)\n fulfill();\n }\n }, controller = {\n @underlyingSource: underlyingSource,\n @pull: @onPullDirectStream,\n @controlledReadableStream: this,\n @sink: sink,\n close: @onCloseDirectStream,\n write: sink.write,\n error: @handleDirectStreamError,\n end: @onCloseDirectStream,\n @close: @onCloseDirectStream,\n flush: @onFlushDirectStream,\n _pendingRead: @undefined,\n _deferClose: 0,\n _deferFlush: 0,\n _deferCloseReason: @undefined,\n _handleError: @undefined\n };\n return @putByIdDirectPrivate(this, \"readableStreamController\", controller), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"start\", @undefined), closingPromise;\n})\n";
-// readableStreamTeeBranch2CancelFunction
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeLength = 330;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode = "(function (teeState,stream){\"use strict\";return function(r){if(teeState.canceled2=!0,teeState.reason2=r,teeState.canceled1)@readableStreamCancel(stream,[teeState.reason1,teeState.reason2]).@then(teeState.cancelPromiseCapability.@resolve,teeState.cancelPromiseCapability.@reject);return teeState.cancelPromiseCapability.promise}})\n";
+// initializeTextStream
+const JSC::ConstructAbility s_readableStreamInternalsInitializeTextStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsInitializeTextStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsInitializeTextStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsInitializeTextStreamCodeLength = 804;
+static const JSC::Intrinsic s_readableStreamInternalsInitializeTextStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsInitializeTextStreamCode = "(function (underlyingSource, highWaterMark) {\"use strict\";\n var [sink, closingPromise] = @createTextStream(highWaterMark), controller = {\n @underlyingSource: underlyingSource,\n @pull: @onPullDirectStream,\n @controlledReadableStream: this,\n @sink: sink,\n close: @onCloseDirectStream,\n write: sink.write,\n error: @handleDirectStreamError,\n end: @onCloseDirectStream,\n @close: @onCloseDirectStream,\n flush: @onFlushDirectStream,\n _pendingRead: @undefined,\n _deferClose: 0,\n _deferFlush: 0,\n _deferCloseReason: @undefined,\n _handleError: @undefined\n };\n return @putByIdDirectPrivate(this, \"readableStreamController\", controller), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"start\", @undefined), closingPromise;\n})\n";
// isReadableStream
const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsIsReadableStreamCodeLength = 130;
+const int s_readableStreamInternalsIsReadableStreamCodeLength = 141;
static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsIsReadableStreamCode = "(function (stream){\"use strict\";return @isObject(stream)&&@getByIdDirectPrivate(stream,\"readableStreamController\")!==@undefined})\n";
-
-// isReadableStreamDefaultReader
-const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsIsReadableStreamDefaultReaderCodeLength = 107;
-static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamDefaultReaderCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsIsReadableStreamDefaultReaderCode = "(function (reader){\"use strict\";return @isObject(reader)&&!!@getByIdDirectPrivate(reader,\"readRequests\")})\n";
+const char* const s_readableStreamInternalsIsReadableStreamCode = "(function (stream) {\"use strict\";\n return @isObject(stream) && @getByIdDirectPrivate(stream, \"readableStreamController\") !== @undefined;\n})\n";
// isReadableStreamDefaultController
const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsIsReadableStreamDefaultControllerCodeLength = 123;
+const int s_readableStreamInternalsIsReadableStreamDefaultControllerCodeLength = 132;
static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsIsReadableStreamDefaultControllerCode = "(function (controller){\"use strict\";return @isObject(controller)&&!!@getByIdDirectPrivate(controller,\"underlyingSource\")})\n";
-
-// readDirectStream
-const JSC::ConstructAbility s_readableStreamInternalsReadDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadDirectStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadDirectStreamCodeLength = 1281;
-static const JSC::Intrinsic s_readableStreamInternalsReadDirectStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadDirectStreamCode = "(function (stream,sink,underlyingSource){\"use strict\";@putByIdDirectPrivate(stream,\"underlyingSource\",@undefined),@putByIdDirectPrivate(stream,\"start\",@undefined);function close(stream2,reason){if(reason&&underlyingSource\?.cancel){try{var prom=underlyingSource.cancel(reason);@markPromiseAsHandled(prom)}catch(e){}underlyingSource=@undefined}if(stream2){if(@putByIdDirectPrivate(stream2,\"readableStreamController\",@undefined),@putByIdDirectPrivate(stream2,\"reader\",@undefined),reason)@putByIdDirectPrivate(stream2,\"state\",@streamErrored),@putByIdDirectPrivate(stream2,\"storedError\",reason);else @putByIdDirectPrivate(stream2,\"state\",@streamClosed);stream2=@undefined}}if(!underlyingSource.pull){close();return}if(!@isCallable(underlyingSource.pull)){close(),@throwTypeError(\"pull is not a function\");return}@putByIdDirectPrivate(stream,\"readableStreamController\",sink);const highWaterMark=@getByIdDirectPrivate(stream,\"highWaterMark\");sink.start({highWaterMark:!highWaterMark||highWaterMark<64\?64:highWaterMark}),@startDirectStream.@call(sink,stream,underlyingSource.pull,close,stream.@asyncContext),@putByIdDirectPrivate(stream,\"reader\",{});var maybePromise=underlyingSource.pull(sink);if(sink=@undefined,maybePromise&&@isPromise(maybePromise))return maybePromise.@then(()=>{})})\n";
+const char* const s_readableStreamInternalsIsReadableStreamDefaultControllerCode = "(function (controller) {\"use strict\";\n return @isObject(controller) && !!@getByIdDirectPrivate(controller, \"underlyingSource\");\n})\n";
-// assignToStream
-const JSC::ConstructAbility s_readableStreamInternalsAssignToStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsAssignToStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsAssignToStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
-const int s_readableStreamInternalsAssignToStreamCodeLength = 318;
-static const JSC::Intrinsic s_readableStreamInternalsAssignToStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsAssignToStreamCode = "(function (stream,sink){\"use strict\";var underlyingSource=@getByIdDirectPrivate(stream,\"underlyingSource\");if(underlyingSource)try{return @readDirectStream(stream,sink,underlyingSource)}catch(e){throw e}finally{underlyingSource=@undefined,stream=@undefined,sink=@undefined}return @readStreamIntoSink(stream,sink,!0)})\n";
-
-// readStreamIntoSink
-const JSC::ConstructAbility s_readableStreamInternalsReadStreamIntoSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadStreamIntoSinkCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadStreamIntoSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadStreamIntoSinkCodeLength = 1943;
-static const JSC::Intrinsic s_readableStreamInternalsReadStreamIntoSinkCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadStreamIntoSinkCode = "(async function (stream,sink,isNative){\"use strict\";var didClose=!1,didThrow=!1;try{var reader=stream.getReader(),many=reader.readMany();if(many&&@isPromise(many))many=await many;if(many.done)return didClose=!0,sink.end();var wroteCount=many.value.length;const highWaterMark=@getByIdDirectPrivate(stream,\"highWaterMark\");if(isNative)@startDirectStream.@call(sink,stream,@undefined,()=>!didThrow&&@markPromiseAsHandled(stream.cancel()),stream.@asyncContext);sink.start({highWaterMark:highWaterMark||0});for(var i=0,values=many.value,length=many.value.length;i<length;i++)sink.write(values[i]);var streamState=@getByIdDirectPrivate(stream,\"state\");if(streamState===@streamClosed)return didClose=!0,sink.end();while(!0){var{value,done}=await reader.read();if(done)return didClose=!0,sink.end();sink.write(value)}}catch(e){didThrow=!0;try{reader=@undefined;const prom=stream.cancel(e);@markPromiseAsHandled(prom)}catch(j){}if(sink&&!didClose){didClose=!0;try{sink.close(e)}catch(j){throw new globalThis.AggregateError([e,j])}}throw e}finally{if(reader){try{reader.releaseLock()}catch(e){}reader=@undefined}sink=@undefined;var streamState=@getByIdDirectPrivate(stream,\"state\");if(stream){var readableStreamController=@getByIdDirectPrivate(stream,\"readableStreamController\");if(readableStreamController){if(@getByIdDirectPrivate(readableStreamController,\"underlyingSource\"))@putByIdDirectPrivate(readableStreamController,\"underlyingSource\",@undefined);if(@getByIdDirectPrivate(readableStreamController,\"controlledReadableStream\"))@putByIdDirectPrivate(readableStreamController,\"controlledReadableStream\",@undefined);if(@putByIdDirectPrivate(stream,\"readableStreamController\",null),@getByIdDirectPrivate(stream,\"underlyingSource\"))@putByIdDirectPrivate(stream,\"underlyingSource\",@undefined);readableStreamController=@undefined}if(!didThrow&&streamState!==@streamClosed&&streamState!==@streamErrored)@readableStreamClose(stream);stream=@undefined}}})\n";
+// isReadableStreamDefaultReader
+const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsIsReadableStreamDefaultReaderCodeLength = 116;
+static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamDefaultReaderCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsIsReadableStreamDefaultReaderCode = "(function (reader) {\"use strict\";\n return @isObject(reader) && !!@getByIdDirectPrivate(reader, \"readRequests\");\n})\n";
-// handleDirectStreamError
-const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsHandleDirectStreamErrorCodeLength = 584;
-static const JSC::Intrinsic s_readableStreamInternalsHandleDirectStreamErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsHandleDirectStreamErrorCode = "(function (e){\"use strict\";var controller=this,sink=controller.@sink;if(sink){@putByIdDirectPrivate(controller,\"sink\",@undefined);try{sink.close(e)}catch(f){}}if(this.error=this.flush=this.write=this.close=this.end=@onReadableStreamDirectControllerClosed,typeof this.@underlyingSource.close===\"function\")try{this.@underlyingSource.close.@call(this.@underlyingSource,e)}catch(e2){}try{var pend=controller._pendingRead;if(pend)controller._pendingRead=@undefined,@rejectPromise(pend,e)}catch(f){}var stream=controller.@controlledReadableStream;if(stream)@readableStreamError(stream,e)})\n";
+// isReadableStreamDisturbed
+const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDisturbedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsIsReadableStreamDisturbedCodeLength = 90;
+static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamDisturbedCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsIsReadableStreamDisturbedCode = "(function (stream) {\"use strict\";\n return @getByIdDirectPrivate(stream, \"disturbed\");\n})\n";
-// handleDirectStreamErrorReject
-const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsHandleDirectStreamErrorRejectCodeLength = 95;
-static const JSC::Intrinsic s_readableStreamInternalsHandleDirectStreamErrorRejectCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsHandleDirectStreamErrorRejectCode = "(function (e){\"use strict\";return @handleDirectStreamError.@call(this,e),@Promise.@reject(e)})\n";
+// isReadableStreamLocked
+const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamLockedCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamLockedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsIsReadableStreamLockedCodeLength = 89;
+static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamLockedCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsIsReadableStreamLockedCode = "(function (stream) {\"use strict\";\n return !!@getByIdDirectPrivate(stream, \"reader\");\n})\n";
-// onPullDirectStream
-const JSC::ConstructAbility s_readableStreamInternalsOnPullDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsOnPullDirectStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsOnPullDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsOnPullDirectStreamCodeLength = 1356;
-static const JSC::Intrinsic s_readableStreamInternalsOnPullDirectStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsOnPullDirectStreamCode = "(function (controller){\"use strict\";var stream=controller.@controlledReadableStream;if(!stream||@getByIdDirectPrivate(stream,\"state\")!==@streamReadable)return;if(controller._deferClose===-1)return;controller._deferClose=-1,controller._deferFlush=-1;var deferClose,deferFlush,asyncContext=stream.@asyncContext;if(asyncContext){var prev=@getInternalField(@asyncContext,0);@putInternalField(@asyncContext,0,asyncContext)}try{var result=controller.@underlyingSource.pull(controller);if(result&&@isPromise(result)){if(controller._handleError===@undefined)controller._handleError=@handleDirectStreamErrorReject.bind(controller);@Promise.prototype.catch.@call(result,controller._handleError)}}catch(e){return @handleDirectStreamErrorReject.@call(controller,e)}finally{if(deferClose=controller._deferClose,deferFlush=controller._deferFlush,controller._deferFlush=controller._deferClose=0,asyncContext)@putInternalField(@asyncContext,0,prev)}var promiseToReturn;if(controller._pendingRead===@undefined)controller._pendingRead=promiseToReturn=@newPromise();else promiseToReturn=@readableStreamAddReadRequest(stream);if(deferClose===1){var reason=controller._deferCloseReason;return controller._deferCloseReason=@undefined,@onCloseDirectStream.@call(controller,reason),promiseToReturn}if(deferFlush===1)@onFlushDirectStream.@call(controller);return promiseToReturn})\n";
+// lazyLoadStream
+const JSC::ConstructAbility s_readableStreamInternalsLazyLoadStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsLazyLoadStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsLazyLoadStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsLazyLoadStreamCodeLength = 3907;
+static const JSC::Intrinsic s_readableStreamInternalsLazyLoadStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsLazyLoadStreamCode = "(function (stream, autoAllocateChunkSize) {\"use strict\";\n var nativeType = @getByIdDirectPrivate(stream, \"bunNativeType\"), nativePtr = @getByIdDirectPrivate(stream, \"bunNativePtr\"), Prototype = @lazyStreamPrototypeMap.@get(nativeType);\n if (Prototype === @undefined) {\n let handleNativeReadableStreamPromiseResult2 = function(val) {\n var { c, v } = this;\n this.c = @undefined, this.v = @undefined, handleResult(val, c, v);\n }, callClose2 = function(controller) {\n try {\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), \"state\") === 4)\n controller.close();\n } catch (e) {\n globalThis.reportError(e);\n }\n }, createResult2 = function(tag, controller, view, closer2) {\n closer2[0] = !1;\n var result;\n try {\n result = pull(tag, view, closer2);\n } catch (err) {\n return controller.error(err);\n }\n return handleResult(result, controller, view);\n };\n var handleNativeReadableStreamPromiseResult = handleNativeReadableStreamPromiseResult2, callClose = callClose2, createResult = createResult2, [pull, start, cancel, setClose, deinit, setRefOrUnref, drain] = @lazy(nativeType), closer = [!1], handleResult;\n handleResult = function handleResult(result, controller, view) {\n if (result && @isPromise(result))\n return result.then(handleNativeReadableStreamPromiseResult2.bind({\n c: controller,\n v: view\n }), (err) => controller.error(err));\n else if (typeof result === \"number\")\n if (view && view.byteLength === result && view.buffer === controller.byobRequest\?.view\?.buffer)\n controller.byobRequest.respondWithNewView(view);\n else\n controller.byobRequest.respond(result);\n else if (result.constructor === @Uint8Array)\n controller.enqueue(result);\n if (closer[0] || result === !1)\n @enqueueJob(callClose2, controller), closer[0] = !1;\n };\n const registry = deinit \? new FinalizationRegistry(deinit) : null;\n Prototype = class NativeReadableStreamSource {\n constructor(tag, autoAllocateChunkSize2, drainValue2) {\n if (this.#tag = tag, this.#cancellationToken = {}, this.pull = this.#pull.bind(this), this.cancel = this.#cancel.bind(this), this.autoAllocateChunkSize = autoAllocateChunkSize2, drainValue2 !== @undefined)\n this.start = (controller) => {\n controller.enqueue(drainValue2);\n };\n if (registry)\n registry.register(this, tag, this.#cancellationToken);\n }\n #cancellationToken;\n pull;\n cancel;\n start;\n #tag;\n type = \"bytes\";\n autoAllocateChunkSize = 0;\n static startSync = start;\n #pull(controller) {\n var tag = this.#tag;\n if (!tag) {\n controller.close();\n return;\n }\n createResult2(tag, controller, controller.byobRequest.view, closer);\n }\n #cancel(reason) {\n var tag = this.#tag;\n registry && registry.unregister(this.#cancellationToken), setRefOrUnref && setRefOrUnref(tag, !1), cancel(tag, reason);\n }\n static deinit = deinit;\n static drain = drain;\n }, @lazyStreamPrototypeMap.@set(nativeType, Prototype);\n }\n const chunkSize = Prototype.startSync(nativePtr, autoAllocateChunkSize);\n var drainValue;\n const { drain: drainFn, deinit: deinitFn } = Prototype;\n if (drainFn)\n drainValue = drainFn(nativePtr);\n if (chunkSize === 0) {\n if (deinit && nativePtr && @enqueueJob(deinit, nativePtr), (drainValue\?.byteLength \?\? 0) > 0)\n return {\n start(controller) {\n controller.enqueue(drainValue), controller.close();\n },\n type: \"bytes\"\n };\n return {\n start(controller) {\n controller.close();\n },\n type: \"bytes\"\n };\n }\n return new Prototype(nativePtr, chunkSize, drainValue);\n})\n";
// noopDoneFunction
const JSC::ConstructAbility s_readableStreamInternalsNoopDoneFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsNoopDoneFunctionCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsNoopDoneFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsNoopDoneFunctionCodeLength = 81;
+const int s_readableStreamInternalsNoopDoneFunctionCodeLength = 92;
static const JSC::Intrinsic s_readableStreamInternalsNoopDoneFunctionCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsNoopDoneFunctionCode = "(function (){\"use strict\";return @Promise.@resolve({value:@undefined,done:!0})})\n";
-
-// onReadableStreamDirectControllerClosed
-const JSC::ConstructAbility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeLength = 98;
-static const JSC::Intrinsic s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsOnReadableStreamDirectControllerClosedCode = "(function (reason){\"use strict\";@throwTypeError(\"ReadableStreamDirectController is now closed\")})\n";
+const char* const s_readableStreamInternalsNoopDoneFunctionCode = "(function () {\"use strict\";\n return @Promise.@resolve({ value: @undefined, done: !0 });\n})\n";
// onCloseDirectStream
const JSC::ConstructAbility s_readableStreamInternalsOnCloseDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsOnCloseDirectStreamCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsOnCloseDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsOnCloseDirectStreamCodeLength = 1696;
+const int s_readableStreamInternalsOnCloseDirectStreamCodeLength = 2038;
static const JSC::Intrinsic s_readableStreamInternalsOnCloseDirectStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsOnCloseDirectStreamCode = "(function (reason){\"use strict\";var stream=this.@controlledReadableStream;if(!stream||@getByIdDirectPrivate(stream,\"state\")!==@streamReadable)return;if(this._deferClose!==0){this._deferClose=1,this._deferCloseReason=reason;return}if(@putByIdDirectPrivate(stream,\"state\",@streamClosing),typeof this.@underlyingSource.close===\"function\")try{this.@underlyingSource.close.@call(this.@underlyingSource,reason)}catch(e){}var flushed;try{flushed=this.@sink.end(),@putByIdDirectPrivate(this,\"sink\",@undefined)}catch(e){if(this._pendingRead){var read=this._pendingRead;this._pendingRead=@undefined,@rejectPromise(read,e)}@readableStreamError(stream,e);return}this.error=this.flush=this.write=this.close=this.end=@onReadableStreamDirectControllerClosed;var reader=@getByIdDirectPrivate(stream,\"reader\");if(reader&&@isReadableStreamDefaultReader(reader)){var _pendingRead=this._pendingRead;if(_pendingRead&&@isPromise(_pendingRead)&&flushed\?.byteLength){this._pendingRead=@undefined,@fulfillPromise(_pendingRead,{value:flushed,done:!1}),@readableStreamClose(stream);return}}if(flushed\?.byteLength){var requests=@getByIdDirectPrivate(reader,\"readRequests\");if(requests\?.isNotEmpty()){@readableStreamFulfillReadRequest(stream,flushed,!1),@readableStreamClose(stream);return}@putByIdDirectPrivate(stream,\"state\",@streamReadable),this.@pull=()=>{var thisResult=@createFulfilledPromise({value:flushed,done:!1});return flushed=@undefined,@readableStreamClose(stream),stream=@undefined,thisResult}}else if(this._pendingRead){var read=this._pendingRead;this._pendingRead=@undefined,@putByIdDirectPrivate(this,\"pull\",@noopDoneFunction),@fulfillPromise(read,{value:@undefined,done:!0})}@readableStreamClose(stream)})\n";
+const char* const s_readableStreamInternalsOnCloseDirectStreamCode = "(function (reason) {\"use strict\";\n var stream = this.@controlledReadableStream;\n if (!stream || @getByIdDirectPrivate(stream, \"state\") !== 4)\n return;\n if (this._deferClose !== 0) {\n this._deferClose = 1, this._deferCloseReason = reason;\n return;\n }\n if (@putByIdDirectPrivate(stream, \"state\", 2), typeof this.@underlyingSource.close === \"function\")\n try {\n this.@underlyingSource.close.@call(this.@underlyingSource, reason);\n } catch (e) {\n }\n var flushed;\n try {\n flushed = this.@sink.end(), @putByIdDirectPrivate(this, \"sink\", @undefined);\n } catch (e) {\n if (this._pendingRead) {\n var read = this._pendingRead;\n this._pendingRead = @undefined, @rejectPromise(read, e);\n }\n @readableStreamError(stream, e);\n return;\n }\n this.error = this.flush = this.write = this.close = this.end = @onReadableStreamDirectControllerClosed;\n var reader = @getByIdDirectPrivate(stream, \"reader\");\n if (reader && @isReadableStreamDefaultReader(reader)) {\n var _pendingRead = this._pendingRead;\n if (_pendingRead && @isPromise(_pendingRead) && flushed\?.byteLength) {\n this._pendingRead = @undefined, @fulfillPromise(_pendingRead, { value: flushed, done: !1 }), @readableStreamClose(stream);\n return;\n }\n }\n if (flushed\?.byteLength) {\n var requests = @getByIdDirectPrivate(reader, \"readRequests\");\n if (requests\?.isNotEmpty()) {\n @readableStreamFulfillReadRequest(stream, flushed, !1), @readableStreamClose(stream);\n return;\n }\n @putByIdDirectPrivate(stream, \"state\", 4), this.@pull = () => {\n var thisResult = @createFulfilledPromise({\n value: flushed,\n done: !1\n });\n return flushed = @undefined, @readableStreamClose(stream), stream = @undefined, thisResult;\n };\n } else if (this._pendingRead) {\n var read = this._pendingRead;\n this._pendingRead = @undefined, @putByIdDirectPrivate(this, \"pull\", @noopDoneFunction), @fulfillPromise(read, { value: @undefined, done: !0 });\n }\n @readableStreamClose(stream);\n})\n";
// onFlushDirectStream
const JSC::ConstructAbility s_readableStreamInternalsOnFlushDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsOnFlushDirectStreamCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsOnFlushDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsOnFlushDirectStreamCodeLength = 722;
+const int s_readableStreamInternalsOnFlushDirectStreamCodeLength = 848;
static const JSC::Intrinsic s_readableStreamInternalsOnFlushDirectStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsOnFlushDirectStreamCode = "(function (){\"use strict\";var stream=this.@controlledReadableStream,reader=@getByIdDirectPrivate(stream,\"reader\");if(!reader||!@isReadableStreamDefaultReader(reader))return;var _pendingRead=this._pendingRead;if(this._pendingRead=@undefined,_pendingRead&&@isPromise(_pendingRead)){var flushed=this.@sink.flush();if(flushed\?.byteLength)this._pendingRead=@getByIdDirectPrivate(stream,\"readRequests\")\?.shift(),@fulfillPromise(_pendingRead,{value:flushed,done:!1});else this._pendingRead=_pendingRead}else if(@getByIdDirectPrivate(stream,\"readRequests\")\?.isNotEmpty()){var flushed=this.@sink.flush();if(flushed\?.byteLength)@readableStreamFulfillReadRequest(stream,flushed,!1)}else if(this._deferFlush===-1)this._deferFlush=1})\n";
+const char* const s_readableStreamInternalsOnFlushDirectStreamCode = "(function () {\"use strict\";\n var stream = this.@controlledReadableStream, reader = @getByIdDirectPrivate(stream, \"reader\");\n if (!reader || !@isReadableStreamDefaultReader(reader))\n return;\n var _pendingRead = this._pendingRead;\n if (this._pendingRead = @undefined, _pendingRead && @isPromise(_pendingRead)) {\n var flushed = this.@sink.flush();\n if (flushed\?.byteLength)\n this._pendingRead = @getByIdDirectPrivate(stream, \"readRequests\")\?.shift(), @fulfillPromise(_pendingRead, { value: flushed, done: !1 });\n else\n this._pendingRead = _pendingRead;\n } else if (@getByIdDirectPrivate(stream, \"readRequests\")\?.isNotEmpty()) {\n var flushed = this.@sink.flush();\n if (flushed\?.byteLength)\n @readableStreamFulfillReadRequest(stream, flushed, !1);\n } else if (this._deferFlush === -1)\n this._deferFlush = 1;\n})\n";
-// createTextStream
-const JSC::ConstructAbility s_readableStreamInternalsCreateTextStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsCreateTextStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsCreateTextStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsCreateTextStreamCodeLength = 1479;
-static const JSC::Intrinsic s_readableStreamInternalsCreateTextStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsCreateTextStreamCode = "(function (highWaterMark){\"use strict\";var sink,array=[],hasString=!1,hasBuffer=!1,rope=\"\",estimatedLength=@toLength(0),capability=@newPromiseCapability(@Promise),calledDone=!1;return sink={start(){},write(chunk){if(typeof chunk===\"string\"){var chunkLength=@toLength(chunk.length);if(chunkLength>0)rope+=chunk,hasString=!0,estimatedLength+=chunkLength;return chunkLength}if(!chunk||!(@ArrayBuffer.@isView(chunk)||chunk instanceof @ArrayBuffer))@throwTypeError(\"Expected text, ArrayBuffer or ArrayBufferView\");const byteLength=@toLength(chunk.byteLength);if(byteLength>0)if(hasBuffer=!0,rope.length>0)@arrayPush(array,rope,chunk),rope=\"\";else @arrayPush(array,chunk);return estimatedLength+=byteLength,byteLength},flush(){return 0},end(){if(calledDone)return\"\";return sink.fulfill()},fulfill(){calledDone=!0;const result=sink.finishInternal();return @fulfillPromise(capability.promise,result),result},finishInternal(){if(!hasString&&!hasBuffer)return\"\";if(hasString&&!hasBuffer)return rope;if(hasBuffer&&!hasString)return new globalThis.TextDecoder().decode(@Bun.concatArrayBuffers(array));var arrayBufferSink=new @Bun.ArrayBufferSink;arrayBufferSink.start({highWaterMark:estimatedLength,asUint8Array:!0});for(let item of array)arrayBufferSink.write(item);if(array.length=0,rope.length>0)arrayBufferSink.write(rope),rope=\"\";return new globalThis.TextDecoder().decode(arrayBufferSink.end())},close(){try{if(!calledDone)calledDone=!0,sink.fulfill()}catch(e){}}},[sink,capability]})\n";
+// onPullDirectStream
+const JSC::ConstructAbility s_readableStreamInternalsOnPullDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsOnPullDirectStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsOnPullDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsOnPullDirectStreamCodeLength = 1586;
+static const JSC::Intrinsic s_readableStreamInternalsOnPullDirectStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsOnPullDirectStreamCode = "(function (controller) {\"use strict\";\n var stream = controller.@controlledReadableStream;\n if (!stream || @getByIdDirectPrivate(stream, \"state\") !== 4)\n return;\n if (controller._deferClose === -1)\n return;\n controller._deferClose = -1, controller._deferFlush = -1;\n var deferClose, deferFlush, asyncContext = stream.@asyncContext;\n if (asyncContext) {\n var prev = @getInternalField(@asyncContext, 0);\n @putInternalField(@asyncContext, 0, asyncContext);\n }\n try {\n var result = controller.@underlyingSource.pull(controller);\n if (result && @isPromise(result)) {\n if (controller._handleError === @undefined)\n controller._handleError = @handleDirectStreamErrorReject.bind(controller);\n @Promise.prototype.catch.@call(result, controller._handleError);\n }\n } catch (e) {\n return @handleDirectStreamErrorReject.@call(controller, e);\n } finally {\n if (deferClose = controller._deferClose, deferFlush = controller._deferFlush, controller._deferFlush = controller._deferClose = 0, asyncContext)\n @putInternalField(@asyncContext, 0, prev);\n }\n var promiseToReturn;\n if (controller._pendingRead === @undefined)\n controller._pendingRead = promiseToReturn = @newPromise();\n else\n promiseToReturn = @readableStreamAddReadRequest(stream);\n if (deferClose === 1) {\n var reason = controller._deferCloseReason;\n return controller._deferCloseReason = @undefined, @onCloseDirectStream.@call(controller, reason), promiseToReturn;\n }\n if (deferFlush === 1)\n @onFlushDirectStream.@call(controller);\n return promiseToReturn;\n})\n";
-// initializeTextStream
-const JSC::ConstructAbility s_readableStreamInternalsInitializeTextStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsInitializeTextStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsInitializeTextStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsInitializeTextStreamCodeLength = 685;
-static const JSC::Intrinsic s_readableStreamInternalsInitializeTextStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsInitializeTextStreamCode = "(function (underlyingSource,highWaterMark){\"use strict\";var[sink,closingPromise]=@createTextStream(highWaterMark),controller={@underlyingSource:underlyingSource,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:sink,close:@onCloseDirectStream,write:sink.write,error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};return @putByIdDirectPrivate(this,\"readableStreamController\",controller),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined),closingPromise})\n";
+// onReadableStreamDirectControllerClosed
+const JSC::ConstructAbility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeLength = 104;
+static const JSC::Intrinsic s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsOnReadableStreamDirectControllerClosedCode = "(function (reason) {\"use strict\";\n @throwTypeError(\"ReadableStreamDirectController is now closed\");\n})\n";
-// initializeArrayStream
-const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsInitializeArrayStreamCodeLength = 990;
-static const JSC::Intrinsic s_readableStreamInternalsInitializeArrayStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsInitializeArrayStreamCode = "(function (underlyingSource,highWaterMark){\"use strict\";var array=[],closingPromise=@newPromiseCapability(@Promise),calledDone=!1;function fulfill(){return calledDone=!0,closingPromise.resolve.@call(@undefined,array),array}var sink={start(){},write(chunk){return @arrayPush(array,chunk),chunk.byteLength||chunk.length},flush(){return 0},end(){if(calledDone)return[];return fulfill()},close(){if(!calledDone)fulfill()}},controller={@underlyingSource:underlyingSource,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:sink,close:@onCloseDirectStream,write:sink.write,error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};return @putByIdDirectPrivate(this,\"readableStreamController\",controller),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined),closingPromise})\n";
+// pipeToClosingMustBePropagatedBackward
+const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeLength = 446;
+static const JSC::Intrinsic s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCode = "(function (pipeState) {\"use strict\";\n if (!@writableStreamCloseQueuedOrInFlight(pipeState.destination) && @getByIdDirectPrivate(pipeState.destination, \"state\") !== \"closed\")\n return;\n const error = @makeTypeError(\"closing is propagated backward\");\n if (!pipeState.preventCancel) {\n @pipeToShutdownWithAction(pipeState, () => @readableStreamCancel(pipeState.source, error), error);\n return;\n }\n @pipeToShutdown(pipeState, error);\n})\n";
-// initializeArrayBufferStream
-const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayBufferStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsInitializeArrayBufferStreamCodeLength = 793;
-static const JSC::Intrinsic s_readableStreamInternalsInitializeArrayBufferStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsInitializeArrayBufferStreamCode = "(function (underlyingSource,highWaterMark){\"use strict\";var opts=highWaterMark&&typeof highWaterMark===\"number\"\?{highWaterMark,stream:!0,asUint8Array:!0}:{stream:!0,asUint8Array:!0},sink=new @Bun.ArrayBufferSink;sink.start(opts);var controller={@underlyingSource:underlyingSource,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:sink,close:@onCloseDirectStream,write:sink.write.bind(sink),error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};@putByIdDirectPrivate(this,\"readableStreamController\",controller),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined)})\n";
+// pipeToClosingMustBePropagatedForward
+const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeLength = 548;
+static const JSC::Intrinsic s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCode = "(function (pipeState) {\"use strict\";\n const action = () => {\n if (pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1), !pipeState.preventClose) {\n @pipeToShutdownWithAction(pipeState, () => @writableStreamDefaultWriterCloseWithErrorPropagation(pipeState.writer));\n return;\n }\n @pipeToShutdown(pipeState);\n };\n if (@getByIdDirectPrivate(pipeState.source, \"state\") === 1) {\n action();\n return;\n }\n @getByIdDirectPrivate(pipeState.reader, \"closedPromiseCapability\").promise.@then(action, @undefined);\n})\n";
-// readableStreamError
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamErrorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamErrorCodeLength = 895;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamErrorCode = "(function (stream,error){\"use strict\";@putByIdDirectPrivate(stream,\"state\",@streamErrored),@putByIdDirectPrivate(stream,\"storedError\",error);const reader=@getByIdDirectPrivate(stream,\"reader\");if(!reader)return;if(@isReadableStreamDefaultReader(reader)){const requests=@getByIdDirectPrivate(reader,\"readRequests\");@putByIdDirectPrivate(reader,\"readRequests\",@createFIFO());for(var request=requests.shift();request;request=requests.shift())@rejectPromise(request,error)}else{const requests=@getByIdDirectPrivate(reader,\"readIntoRequests\");@putByIdDirectPrivate(reader,\"readIntoRequests\",@createFIFO());for(var request=requests.shift();request;request=requests.shift())@rejectPromise(request,error)}@getByIdDirectPrivate(reader,\"closedPromiseCapability\").reject.@call(@undefined,error);const promise=@getByIdDirectPrivate(reader,\"closedPromiseCapability\").promise;@markPromiseAsHandled(promise)})\n";
+// pipeToDoReadWrite
+const JSC::ConstructAbility s_readableStreamInternalsPipeToDoReadWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsPipeToDoReadWriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsPipeToDoReadWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsPipeToDoReadWriteCodeLength = 971;
+static const JSC::Intrinsic s_readableStreamInternalsPipeToDoReadWriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsPipeToDoReadWriteCode = "(function (pipeState) {\"use strict\";\n return pipeState.pendingReadPromiseCapability = @newPromiseCapability(@Promise), @getByIdDirectPrivate(pipeState.writer, \"readyPromise\").promise.@then(() => {\n if (pipeState.shuttingDown) {\n pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1);\n return;\n }\n @readableStreamDefaultReaderRead(pipeState.reader).@then((result) => {\n const canWrite = !result.done && @getByIdDirectPrivate(pipeState.writer, \"stream\") !== @undefined;\n if (pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, canWrite), !canWrite)\n return;\n pipeState.pendingWritePromise = @writableStreamDefaultWriterWrite(pipeState.writer, result.value);\n }, (e) => {\n pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1);\n });\n }, (e) => {\n pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1);\n }), pipeState.pendingReadPromiseCapability.promise;\n})\n";
-// readableStreamDefaultControllerShouldCallPull
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeLength = 518;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCode = "(function (controller){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"controlledReadableStream\");if(!@readableStreamDefaultControllerCanCloseOrEnqueue(controller))return!1;if(@getByIdDirectPrivate(controller,\"started\")!==1)return!1;if((!@isReadableStreamLocked(stream)||!@getByIdDirectPrivate(@getByIdDirectPrivate(stream,\"reader\"),\"readRequests\")\?.isNotEmpty())&&@readableStreamDefaultControllerGetDesiredSize(controller)<=0)return!1;return @readableStreamDefaultControllerGetDesiredSize(controller)>0})\n";
+// pipeToErrorsMustBePropagatedBackward
+const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeLength = 550;
+static const JSC::Intrinsic s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode = "(function (pipeState) {\"use strict\";\n const action = () => {\n const error = @getByIdDirectPrivate(pipeState.destination, \"storedError\");\n if (!pipeState.preventCancel) {\n @pipeToShutdownWithAction(pipeState, () => @readableStreamCancel(pipeState.source, error), error);\n return;\n }\n @pipeToShutdown(pipeState, error);\n };\n if (@getByIdDirectPrivate(pipeState.destination, \"state\") === \"errored\") {\n action();\n return;\n }\n @getByIdDirectPrivate(pipeState.writer, \"closedPromise\").promise.@then(@undefined, action);\n})\n";
-// readableStreamDefaultControllerCallPullIfNeeded
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeLength = 961;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCode = "(function (controller){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"controlledReadableStream\");if(!@readableStreamDefaultControllerCanCloseOrEnqueue(controller))return;if(@getByIdDirectPrivate(controller,\"started\")!==1)return;if((!@isReadableStreamLocked(stream)||!@getByIdDirectPrivate(@getByIdDirectPrivate(stream,\"reader\"),\"readRequests\")\?.isNotEmpty())&&@readableStreamDefaultControllerGetDesiredSize(controller)<=0)return;if(@getByIdDirectPrivate(controller,\"pulling\")){@putByIdDirectPrivate(controller,\"pullAgain\",!0);return}@putByIdDirectPrivate(controller,\"pulling\",!0),@getByIdDirectPrivate(controller,\"pullAlgorithm\").@call(@undefined).@then(function(){if(@putByIdDirectPrivate(controller,\"pulling\",!1),@getByIdDirectPrivate(controller,\"pullAgain\"))@putByIdDirectPrivate(controller,\"pullAgain\",!1),@readableStreamDefaultControllerCallPullIfNeeded(controller)},function(error){@readableStreamDefaultControllerError(controller,error)})})\n";
+// pipeToErrorsMustBePropagatedForward
+const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeLength = 619;
+static const JSC::Intrinsic s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode = "(function (pipeState) {\"use strict\";\n const action = () => {\n pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1);\n const error = @getByIdDirectPrivate(pipeState.source, \"storedError\");\n if (!pipeState.preventAbort) {\n @pipeToShutdownWithAction(pipeState, () => @writableStreamAbort(pipeState.destination, error), error);\n return;\n }\n @pipeToShutdown(pipeState, error);\n };\n if (@getByIdDirectPrivate(pipeState.source, \"state\") === 3) {\n action();\n return;\n }\n @getByIdDirectPrivate(pipeState.reader, \"closedPromiseCapability\").promise.@then(@undefined, action);\n})\n";
-// isReadableStreamLocked
-const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamLockedCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamLockedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsIsReadableStreamLockedCodeLength = 81;
-static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamLockedCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsIsReadableStreamLockedCode = "(function (stream){\"use strict\";return!!@getByIdDirectPrivate(stream,\"reader\")})\n";
+// pipeToFinalize
+const JSC::ConstructAbility s_readableStreamInternalsPipeToFinalizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsPipeToFinalizeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsPipeToFinalizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsPipeToFinalizeCodeLength = 332;
+static const JSC::Intrinsic s_readableStreamInternalsPipeToFinalizeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsPipeToFinalizeCode = "(function (pipeState) {\"use strict\";\n if (@writableStreamDefaultWriterRelease(pipeState.writer), @readableStreamReaderGenericRelease(pipeState.reader), pipeState.finalized = !0, arguments.length > 1)\n pipeState.promiseCapability.reject.@call(@undefined, arguments[1]);\n else\n pipeState.promiseCapability.resolve.@call();\n})\n";
-// readableStreamDefaultControllerGetDesiredSize
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeLength = 341;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCode = "(function (controller){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"controlledReadableStream\"),state=@getByIdDirectPrivate(stream,\"state\");if(state===@streamErrored)return null;if(state===@streamClosed)return 0;return @getByIdDirectPrivate(controller,\"strategy\").highWaterMark-@getByIdDirectPrivate(controller,\"queue\").size})\n";
+// pipeToLoop
+const JSC::ConstructAbility s_readableStreamInternalsPipeToLoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsPipeToLoopCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsPipeToLoopCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsPipeToLoopCodeLength = 186;
+static const JSC::Intrinsic s_readableStreamInternalsPipeToLoopCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsPipeToLoopCode = "(function (pipeState) {\"use strict\";\n if (pipeState.shuttingDown)\n return;\n @pipeToDoReadWrite(pipeState).@then((result) => {\n if (result)\n @pipeToLoop(pipeState);\n });\n})\n";
-// readableStreamReaderGenericCancel
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamReaderGenericCancelCodeLength = 150;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericCancelCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamReaderGenericCancelCode = "(function (reader,reason){\"use strict\";const stream=@getByIdDirectPrivate(reader,\"ownerReadableStream\");return @readableStreamCancel(stream,reason)})\n";
+// pipeToShutdown
+const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsPipeToShutdownCodeLength = 648;
+static const JSC::Intrinsic s_readableStreamInternalsPipeToShutdownCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsPipeToShutdownCode = "(function (pipeState) {\"use strict\";\n if (pipeState.shuttingDown)\n return;\n pipeState.shuttingDown = !0;\n const hasError = arguments.length > 1, error = arguments[1], finalize = () => {\n if (hasError)\n @pipeToFinalize(pipeState, error);\n else\n @pipeToFinalize(pipeState);\n };\n if (@getByIdDirectPrivate(pipeState.destination, \"state\") === \"writable\" && !@writableStreamCloseQueuedOrInFlight(pipeState.destination)) {\n pipeState.pendingReadPromiseCapability.promise.@then(() => {\n pipeState.pendingWritePromise.@then(finalize, finalize);\n }, (e) => @pipeToFinalize(pipeState, e));\n return;\n }\n finalize();\n})\n";
+
+// pipeToShutdownWithAction
+const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownWithActionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownWithActionCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownWithActionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsPipeToShutdownWithActionCodeLength = 752;
+static const JSC::Intrinsic s_readableStreamInternalsPipeToShutdownWithActionCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsPipeToShutdownWithActionCode = "(function (pipeState, action) {\"use strict\";\n if (pipeState.shuttingDown)\n return;\n pipeState.shuttingDown = !0;\n const hasError = arguments.length > 2, error = arguments[2], finalize = () => {\n action().@then(() => {\n if (hasError)\n @pipeToFinalize(pipeState, error);\n else\n @pipeToFinalize(pipeState);\n }, (e) => {\n @pipeToFinalize(pipeState, e);\n });\n };\n if (@getByIdDirectPrivate(pipeState.destination, \"state\") === \"writable\" && !@writableStreamCloseQueuedOrInFlight(pipeState.destination)) {\n pipeState.pendingReadPromiseCapability.promise.@then(() => {\n pipeState.pendingWritePromise.@then(finalize, finalize);\n }, (e) => @pipeToFinalize(pipeState, e));\n return;\n }\n finalize();\n})\n";
+
+// privateInitializeReadableStreamDefaultController
+const JSC::ConstructAbility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeLength = 810;
+static const JSC::Intrinsic s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCode = "(function (stream, underlyingSource, size, highWaterMark) {\"use strict\";\n if (!@isReadableStream(stream))\n @throwTypeError(\"ReadableStreamDefaultController needs a ReadableStream\");\n if (@getByIdDirectPrivate(stream, \"readableStreamController\") !== null)\n @throwTypeError(\"ReadableStream already has a controller\");\n return @putByIdDirectPrivate(this, \"controlledReadableStream\", stream), @putByIdDirectPrivate(this, \"underlyingSource\", underlyingSource), @putByIdDirectPrivate(this, \"queue\", @newQueue()), @putByIdDirectPrivate(this, \"started\", -1), @putByIdDirectPrivate(this, \"closeRequested\", !1), @putByIdDirectPrivate(this, \"pullAgain\", !1), @putByIdDirectPrivate(this, \"pulling\", !1), @putByIdDirectPrivate(this, \"strategy\", @validateAndNormalizeQueuingStrategy(size, highWaterMark)), this;\n})\n";
+
+// readableStreamAddReadRequest
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamAddReadRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamAddReadRequestCodeLength = 194;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamAddReadRequestCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamAddReadRequestCode = "(function (stream) {\"use strict\";\n const readRequest = @newPromise();\n return @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\").push(readRequest), readRequest;\n})\n";
// readableStreamCancel
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCancelCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamCancelCodeLength = 634;
+const int s_readableStreamInternalsReadableStreamCancelCodeLength = 692;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamCancelCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamCancelCode = "(function (stream,reason){\"use strict\";@putByIdDirectPrivate(stream,\"disturbed\",!0);const state=@getByIdDirectPrivate(stream,\"state\");if(state===@streamClosed)return @Promise.@resolve();if(state===@streamErrored)return @Promise.@reject(@getByIdDirectPrivate(stream,\"storedError\"));@readableStreamClose(stream);var controller=@getByIdDirectPrivate(stream,\"readableStreamController\"),cancel=controller.@cancel;if(cancel)return cancel(controller,reason).@then(function(){});var close=controller.close;if(close)return @Promise.@resolve(controller.close(reason));@throwTypeError(\"ReadableStreamController has no cancel or close method\")})\n";
+const char* const s_readableStreamInternalsReadableStreamCancelCode = "(function (stream, reason) {\"use strict\";\n @putByIdDirectPrivate(stream, \"disturbed\", !0);\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === 1)\n return @Promise.@resolve();\n if (state === 3)\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n @readableStreamClose(stream);\n var controller = @getByIdDirectPrivate(stream, \"readableStreamController\"), cancel = controller.@cancel;\n if (cancel)\n return cancel(controller, reason).@then(function() {\n });\n var close = controller.close;\n if (close)\n return @Promise.@resolve(controller.close(reason));\n @throwTypeError(\"ReadableStreamController has no cancel or close method\");\n})\n";
+
+// readableStreamClose
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCloseCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamCloseCodeLength = 721;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamCloseCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamCloseCode = "(function (stream) {\"use strict\";\n if (@putByIdDirectPrivate(stream, \"state\", 1), !@getByIdDirectPrivate(stream, \"reader\"))\n return;\n if (@isReadableStreamDefaultReader(@getByIdDirectPrivate(stream, \"reader\"))) {\n const requests = @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\");\n if (requests.isNotEmpty()) {\n @putByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\", @createFIFO());\n for (var request = requests.shift();request; request = requests.shift())\n @fulfillPromise(request, { value: @undefined, done: !0 });\n }\n }\n @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"closedPromiseCapability\").resolve.@call();\n})\n";
+
+// readableStreamDefaultControllerCallPullIfNeeded
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeLength = 1074;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(controller))\n return;\n if (@getByIdDirectPrivate(controller, \"started\") !== 1)\n return;\n if ((!@isReadableStreamLocked(stream) || !@getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\")\?.isNotEmpty()) && @readableStreamDefaultControllerGetDesiredSize(controller) <= 0)\n return;\n if (@getByIdDirectPrivate(controller, \"pulling\")) {\n @putByIdDirectPrivate(controller, \"pullAgain\", !0);\n return;\n }\n @putByIdDirectPrivate(controller, \"pulling\", !0), @getByIdDirectPrivate(controller, \"pullAlgorithm\").@call(@undefined).@then(function() {\n if (@putByIdDirectPrivate(controller, \"pulling\", !1), @getByIdDirectPrivate(controller, \"pullAgain\"))\n @putByIdDirectPrivate(controller, \"pullAgain\", !1), @readableStreamDefaultControllerCallPullIfNeeded(controller);\n }, function(error) {\n @readableStreamDefaultControllerError(controller, error);\n });\n})\n";
// readableStreamDefaultControllerCancel
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeLength = 183;
+const int s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeLength = 195;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultControllerCancelCode = "(function (controller,reason){\"use strict\";return @putByIdDirectPrivate(controller,\"queue\",@newQueue()),@getByIdDirectPrivate(controller,\"cancelAlgorithm\").@call(@undefined,reason)})\n";
+const char* const s_readableStreamInternalsReadableStreamDefaultControllerCancelCode = "(function (controller, reason) {\"use strict\";\n return @putByIdDirectPrivate(controller, \"queue\", @newQueue()), @getByIdDirectPrivate(controller, \"cancelAlgorithm\").@call(@undefined, reason);\n})\n";
-// readableStreamDefaultControllerPull
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamDefaultControllerPullCodeLength = 632;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerPullCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultControllerPullCode = "(function (controller){\"use strict\";var queue=@getByIdDirectPrivate(controller,\"queue\");if(queue.content.isNotEmpty()){const chunk=@dequeueValue(queue);if(@getByIdDirectPrivate(controller,\"closeRequested\")&&queue.content.isEmpty())@readableStreamClose(@getByIdDirectPrivate(controller,\"controlledReadableStream\"));else @readableStreamDefaultControllerCallPullIfNeeded(controller);return @createFulfilledPromise({value:chunk,done:!1})}const pendingPromise=@readableStreamAddReadRequest(@getByIdDirectPrivate(controller,\"controlledReadableStream\"));return @readableStreamDefaultControllerCallPullIfNeeded(controller),pendingPromise})\n";
+// readableStreamDefaultControllerCanCloseOrEnqueue
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeLength = 207;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCode = "(function (controller) {\"use strict\";\n return !@getByIdDirectPrivate(controller, \"closeRequested\") && @getByIdDirectPrivate(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), \"state\") === 4;\n})\n";
// readableStreamDefaultControllerClose
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeLength = 240;
+const int s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeLength = 257;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultControllerCloseCode = "(function (controller){\"use strict\";if(@putByIdDirectPrivate(controller,\"closeRequested\",!0),@getByIdDirectPrivate(controller,\"queue\")\?.content\?.isEmpty())@readableStreamClose(@getByIdDirectPrivate(controller,\"controlledReadableStream\"))})\n";
-
-// readableStreamClose
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCloseCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamCloseCodeLength = 643;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamCloseCode = "(function (stream){\"use strict\";if(@putByIdDirectPrivate(stream,\"state\",@streamClosed),!@getByIdDirectPrivate(stream,\"reader\"))return;if(@isReadableStreamDefaultReader(@getByIdDirectPrivate(stream,\"reader\"))){const requests=@getByIdDirectPrivate(@getByIdDirectPrivate(stream,\"reader\"),\"readRequests\");if(requests.isNotEmpty()){@putByIdDirectPrivate(@getByIdDirectPrivate(stream,\"reader\"),\"readRequests\",@createFIFO());for(var request=requests.shift();request;request=requests.shift())@fulfillPromise(request,{value:@undefined,done:!0})}}@getByIdDirectPrivate(@getByIdDirectPrivate(stream,\"reader\"),\"closedPromiseCapability\").resolve.@call()})\n";
-
-// readableStreamFulfillReadRequest
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamFulfillReadRequestCodeLength = 196;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamFulfillReadRequestCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamFulfillReadRequestCode = "(function (stream,chunk,done){\"use strict\";const readRequest=@getByIdDirectPrivate(@getByIdDirectPrivate(stream,\"reader\"),\"readRequests\").shift();@fulfillPromise(readRequest,{value:chunk,done})})\n";
+const char* const s_readableStreamInternalsReadableStreamDefaultControllerCloseCode = "(function (controller) {\"use strict\";\n if (@putByIdDirectPrivate(controller, \"closeRequested\", !0), @getByIdDirectPrivate(controller, \"queue\")\?.content\?.isEmpty())\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n})\n";
// readableStreamDefaultControllerEnqueue
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeLength = 741;
+const int s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeLength = 836;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCode = "(function (controller,chunk){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"controlledReadableStream\");if(@isReadableStreamLocked(stream)&&@getByIdDirectPrivate(@getByIdDirectPrivate(stream,\"reader\"),\"readRequests\")\?.isNotEmpty()){@readableStreamFulfillReadRequest(stream,chunk,!1),@readableStreamDefaultControllerCallPullIfNeeded(controller);return}try{let chunkSize=1;if(@getByIdDirectPrivate(controller,\"strategy\").size!==@undefined)chunkSize=@getByIdDirectPrivate(controller,\"strategy\").size(chunk);@enqueueValueWithSize(@getByIdDirectPrivate(controller,\"queue\"),chunk,chunkSize)}catch(error){throw @readableStreamDefaultControllerError(controller,error),error}@readableStreamDefaultControllerCallPullIfNeeded(controller)})\n";
+const char* const s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCode = "(function (controller, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@isReadableStreamLocked(stream) && @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\")\?.isNotEmpty()) {\n @readableStreamFulfillReadRequest(stream, chunk, !1), @readableStreamDefaultControllerCallPullIfNeeded(controller);\n return;\n }\n try {\n let chunkSize = 1;\n if (@getByIdDirectPrivate(controller, \"strategy\").size !== @undefined)\n chunkSize = @getByIdDirectPrivate(controller, \"strategy\").size(chunk);\n @enqueueValueWithSize(@getByIdDirectPrivate(controller, \"queue\"), chunk, chunkSize);\n } catch (error) {\n throw @readableStreamDefaultControllerError(controller, error), error;\n }\n @readableStreamDefaultControllerCallPullIfNeeded(controller);\n})\n";
+
+// readableStreamDefaultControllerError
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeLength = 288;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamDefaultControllerErrorCode = "(function (controller, error) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@getByIdDirectPrivate(stream, \"state\") !== 4)\n return;\n @putByIdDirectPrivate(controller, \"queue\", @newQueue()), @readableStreamError(stream, error);\n})\n";
+
+// readableStreamDefaultControllerGetDesiredSize
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeLength = 358;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (state === 3)\n return null;\n if (state === 1)\n return 0;\n return @getByIdDirectPrivate(controller, \"strategy\").highWaterMark - @getByIdDirectPrivate(controller, \"queue\").size;\n})\n";
+
+// readableStreamDefaultControllerPull
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamDefaultControllerPullCodeLength = 705;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerPullCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamDefaultControllerPullCode = "(function (controller) {\"use strict\";\n var queue = @getByIdDirectPrivate(controller, \"queue\");\n if (queue.content.isNotEmpty()) {\n const chunk = @dequeueValue(queue);\n if (@getByIdDirectPrivate(controller, \"closeRequested\") && queue.content.isEmpty())\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n else\n @readableStreamDefaultControllerCallPullIfNeeded(controller);\n return @createFulfilledPromise({ value: chunk, done: !1 });\n }\n const pendingPromise = @readableStreamAddReadRequest(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n return @readableStreamDefaultControllerCallPullIfNeeded(controller), pendingPromise;\n})\n";
+
+// readableStreamDefaultControllerShouldCallPull
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeLength = 573;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(controller))\n return !1;\n if (@getByIdDirectPrivate(controller, \"started\") !== 1)\n return !1;\n if ((!@isReadableStreamLocked(stream) || !@getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\")\?.isNotEmpty()) && @readableStreamDefaultControllerGetDesiredSize(controller) <= 0)\n return !1;\n return @readableStreamDefaultControllerGetDesiredSize(controller) > 0;\n})\n";
+
+// readableStreamDefaultControllerStart
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamDefaultControllerStartCodeLength = 577;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerStartCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamDefaultControllerStartCode = "(function (controller) {\"use strict\";\n if (@getByIdDirectPrivate(controller, \"started\") !== -1)\n return;\n const underlyingSource = @getByIdDirectPrivate(controller, \"underlyingSource\"), startMethod = underlyingSource.start;\n @putByIdDirectPrivate(controller, \"started\", 0), @promiseInvokeOrNoopMethodNoCatch(underlyingSource, startMethod, [controller]).@then(() => {\n @putByIdDirectPrivate(controller, \"started\", 1), @readableStreamDefaultControllerCallPullIfNeeded(controller);\n }, (error) => {\n @readableStreamDefaultControllerError(controller, error);\n });\n})\n";
// readableStreamDefaultReaderRead
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamDefaultReaderReadCodeLength = 495;
+const int s_readableStreamInternalsReadableStreamDefaultReaderReadCodeLength = 519;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultReaderReadCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultReaderReadCode = "(function (reader){\"use strict\";const stream=@getByIdDirectPrivate(reader,\"ownerReadableStream\"),state=@getByIdDirectPrivate(stream,\"state\");if(@putByIdDirectPrivate(stream,\"disturbed\",!0),state===@streamClosed)return @createFulfilledPromise({value:@undefined,done:!0});if(state===@streamErrored)return @Promise.@reject(@getByIdDirectPrivate(stream,\"storedError\"));return @getByIdDirectPrivate(stream,\"readableStreamController\").@pull(@getByIdDirectPrivate(stream,\"readableStreamController\"))})\n";
+const char* const s_readableStreamInternalsReadableStreamDefaultReaderReadCode = "(function (reader) {\"use strict\";\n const stream = @getByIdDirectPrivate(reader, \"ownerReadableStream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (@putByIdDirectPrivate(stream, \"disturbed\", !0), state === 1)\n return @createFulfilledPromise({ value: @undefined, done: !0 });\n if (state === 3)\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n return @getByIdDirectPrivate(stream, \"readableStreamController\").@pull(@getByIdDirectPrivate(stream, \"readableStreamController\"));\n})\n";
-// readableStreamAddReadRequest
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamAddReadRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamAddReadRequestCodeLength = 180;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamAddReadRequestCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamAddReadRequestCode = "(function (stream){\"use strict\";const readRequest=@newPromise();return @getByIdDirectPrivate(@getByIdDirectPrivate(stream,\"reader\"),\"readRequests\").push(readRequest),readRequest})\n";
-
-// isReadableStreamDisturbed
-const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDisturbedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsIsReadableStreamDisturbedCodeLength = 83;
-static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamDisturbedCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsIsReadableStreamDisturbedCode = "(function (stream){\"use strict\";return @getByIdDirectPrivate(stream,\"disturbed\")})\n";
-
-// readableStreamReaderGenericRelease
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeLength = 707;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamReaderGenericReleaseCode = "(function (reader){\"use strict\";if(@getByIdDirectPrivate(@getByIdDirectPrivate(reader,\"ownerReadableStream\"),\"state\")===@streamReadable)@getByIdDirectPrivate(reader,\"closedPromiseCapability\").reject.@call(@undefined,@makeTypeError(\"releasing lock of reader whose stream is still in readable state\"));else @putByIdDirectPrivate(reader,\"closedPromiseCapability\",{promise:@newHandledRejectedPromise(@makeTypeError(\"reader released lock\"))});const promise=@getByIdDirectPrivate(reader,\"closedPromiseCapability\").promise;@markPromiseAsHandled(promise),@putByIdDirectPrivate(@getByIdDirectPrivate(reader,\"ownerReadableStream\"),\"reader\",@undefined),@putByIdDirectPrivate(reader,\"ownerReadableStream\",@undefined)})\n";
+// readableStreamDefineLazyIterators
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeLength = 1190;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamDefineLazyIteratorsCode = "(function (prototype) {\"use strict\";\n var asyncIterator = globalThis.Symbol.asyncIterator, ReadableStreamAsyncIterator = async function* ReadableStreamAsyncIterator(stream, preventCancel) {\n var reader = stream.getReader(), deferredError;\n try {\n while (!0) {\n var done, value;\n const firstResult = reader.readMany();\n if (@isPromise(firstResult))\n ({ done, value } = await firstResult);\n else\n ({ done, value } = firstResult);\n if (done)\n return;\n yield* value;\n }\n } catch (e) {\n deferredError = e;\n } finally {\n if (reader.releaseLock(), !preventCancel)\n stream.cancel(deferredError);\n if (deferredError)\n throw deferredError;\n }\n }, createAsyncIterator = function asyncIterator() {\n return ReadableStreamAsyncIterator(this, !1);\n }, createValues = function values({ preventCancel = !1 } = { preventCancel: !1 }) {\n return ReadableStreamAsyncIterator(this, preventCancel);\n };\n return @Object.@defineProperty(prototype, asyncIterator, { value: createAsyncIterator }), @Object.@defineProperty(prototype, \"values\", { value: createValues }), prototype;\n})\n";
-// readableStreamDefaultControllerCanCloseOrEnqueue
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeLength = 207;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCode = "(function (controller){\"use strict\";return!@getByIdDirectPrivate(controller,\"closeRequested\")&&@getByIdDirectPrivate(@getByIdDirectPrivate(controller,\"controlledReadableStream\"),\"state\")===@streamReadable})\n";
+// readableStreamError
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamErrorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamErrorCodeLength = 1006;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamErrorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamErrorCode = "(function (stream, error) {\"use strict\";\n @putByIdDirectPrivate(stream, \"state\", 3), @putByIdDirectPrivate(stream, \"storedError\", error);\n const reader = @getByIdDirectPrivate(stream, \"reader\");\n if (!reader)\n return;\n if (@isReadableStreamDefaultReader(reader)) {\n const requests = @getByIdDirectPrivate(reader, \"readRequests\");\n @putByIdDirectPrivate(reader, \"readRequests\", @createFIFO());\n for (var request = requests.shift();request; request = requests.shift())\n @rejectPromise(request, error);\n } else {\n const requests = @getByIdDirectPrivate(reader, \"readIntoRequests\");\n @putByIdDirectPrivate(reader, \"readIntoRequests\", @createFIFO());\n for (var request = requests.shift();request; request = requests.shift())\n @rejectPromise(request, error);\n }\n @getByIdDirectPrivate(reader, \"closedPromiseCapability\").reject.@call(@undefined, error);\n const promise = @getByIdDirectPrivate(reader, \"closedPromiseCapability\").promise;\n @markPromiseAsHandled(promise);\n})\n";
-// lazyLoadStream
-const JSC::ConstructAbility s_readableStreamInternalsLazyLoadStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsLazyLoadStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsLazyLoadStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsLazyLoadStreamCodeLength = 2994;
-static const JSC::Intrinsic s_readableStreamInternalsLazyLoadStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsLazyLoadStreamCode = "(function (stream,autoAllocateChunkSize){\"use strict\";var nativeType=@getByIdDirectPrivate(stream,\"bunNativeType\"),nativePtr=@getByIdDirectPrivate(stream,\"bunNativePtr\"),Prototype=@lazyStreamPrototypeMap.@get(nativeType);if(Prototype===@undefined){let handleNativeReadableStreamPromiseResult2=function(val){var{c,v}=this;this.c=@undefined,this.v=@undefined,handleResult(val,c,v)},callClose2=function(controller){try{if(@getByIdDirectPrivate(@getByIdDirectPrivate(controller,\"controlledReadableStream\"),\"state\")===@streamReadable)controller.close()}catch(e){globalThis.reportError(e)}},createResult2=function(tag,controller,view,closer2){closer2[0]=!1;var result;try{result=pull(tag,view,closer2)}catch(err){return controller.error(err)}return handleResult(result,controller,view)};var handleNativeReadableStreamPromiseResult=handleNativeReadableStreamPromiseResult2,callClose=callClose2,createResult=createResult2,[pull,start,cancel,setClose,deinit,setRefOrUnref,drain]=@lazyLoad(nativeType),closer=[!1],handleResult;handleResult=function handleResult(result,controller,view){if(result&&@isPromise(result))return result.then(handleNativeReadableStreamPromiseResult2.bind({c:controller,v:view}),(err)=>controller.error(err));else if(typeof result===\"number\")if(view&&view.byteLength===result&&view.buffer===controller.byobRequest\?.view\?.buffer)controller.byobRequest.respondWithNewView(view);else controller.byobRequest.respond(result);else if(result.constructor===@Uint8Array)controller.enqueue(result);if(closer[0]||result===!1)@enqueueJob(callClose2,controller),closer[0]=!1};const registry=deinit\?new FinalizationRegistry(deinit):null;Prototype=class NativeReadableStreamSource{constructor(tag,autoAllocateChunkSize2,drainValue2){if(this.#tag=tag,this.#cancellationToken={},this.pull=this.#pull.bind(this),this.cancel=this.#cancel.bind(this),this.autoAllocateChunkSize=autoAllocateChunkSize2,drainValue2!==@undefined)this.start=(controller)=>{controller.enqueue(drainValue2)};if(registry)registry.register(this,tag,this.#cancellationToken)}#cancellationToken;pull;cancel;start;#tag;type=\"bytes\";autoAllocateChunkSize=0;static startSync=start;#pull(controller){var tag=this.#tag;if(!tag){controller.close();return}createResult2(tag,controller,controller.byobRequest.view,closer)}#cancel(reason){var tag=this.#tag;registry&&registry.unregister(this.#cancellationToken),setRefOrUnref&&setRefOrUnref(tag,!1),cancel(tag,reason)}static deinit=deinit;static drain=drain},@lazyStreamPrototypeMap.@set(nativeType,Prototype)}const chunkSize=Prototype.startSync(nativePtr,autoAllocateChunkSize);var drainValue;const{drain:drainFn,deinit:deinitFn}=Prototype;if(drainFn)drainValue=drainFn(nativePtr);if(chunkSize===0){if(deinit&&nativePtr&&@enqueueJob(deinit,nativePtr),(drainValue\?.byteLength\?\?0)>0)return{start(controller){controller.enqueue(drainValue),controller.close()},type:\"bytes\"};return{start(controller){controller.close()},type:\"bytes\"}}return new Prototype(nativePtr,chunkSize,drainValue)})\n";
+// readableStreamFulfillReadRequest
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamFulfillReadRequestCodeLength = 216;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamFulfillReadRequestCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamFulfillReadRequestCode = "(function (stream, chunk, done) {\"use strict\";\n const readRequest = @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\").shift();\n @fulfillPromise(readRequest, { value: chunk, done });\n})\n";
// readableStreamIntoArray
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoArrayCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoArrayCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoArrayCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamIntoArrayCodeLength = 427;
+const int s_readableStreamInternalsReadableStreamIntoArrayCodeLength = 536;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamIntoArrayCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamIntoArrayCode = "(function (stream){\"use strict\";var reader=stream.getReader(),manyResult=reader.readMany();async function processManyResult(result){if(result.done)return[];var chunks=result.value||[];while(!0){var thisResult=await reader.read();if(thisResult.done)break;chunks=chunks.concat(thisResult.value)}return chunks}if(manyResult&&@isPromise(manyResult))return manyResult.@then(processManyResult);return processManyResult(manyResult)})\n";
+const char* const s_readableStreamInternalsReadableStreamIntoArrayCode = "(function (stream) {\"use strict\";\n var reader = stream.getReader(), manyResult = reader.readMany();\n async function processManyResult(result) {\n if (result.done)\n return [];\n var chunks = result.value || [];\n while (!0) {\n var thisResult = await reader.read();\n if (thisResult.done)\n break;\n chunks = chunks.concat(thisResult.value);\n }\n return chunks;\n }\n if (manyResult && @isPromise(manyResult))\n return manyResult.@then(processManyResult);\n return processManyResult(manyResult);\n})\n";
// readableStreamIntoText
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoTextCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoTextCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoTextCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamIntoTextCodeLength = 272;
+const int s_readableStreamInternalsReadableStreamIntoTextCodeLength = 302;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamIntoTextCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamIntoTextCode = "(function (stream){\"use strict\";const[textStream,closer]=@createTextStream(@getByIdDirectPrivate(stream,\"highWaterMark\")),prom=@readStreamIntoSink(stream,textStream,!1);if(prom&&@isPromise(prom))return @Promise.@resolve(prom).@then(closer.promise);return closer.promise})\n";
+const char* const s_readableStreamInternalsReadableStreamIntoTextCode = "(function (stream) {\"use strict\";\n const [textStream, closer] = @createTextStream(@getByIdDirectPrivate(stream, \"highWaterMark\")), prom = @readStreamIntoSink(stream, textStream, !1);\n if (prom && @isPromise(prom))\n return @Promise.@resolve(prom).@then(closer.promise);\n return closer.promise;\n})\n";
+
+// readableStreamPipeTo
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamPipeToCodeLength = 633;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamPipeToCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamPipeToCode = "(function (stream, sink) {\"use strict\";\n const reader = new @ReadableStreamDefaultReader(stream);\n @getByIdDirectPrivate(reader, \"closedPromiseCapability\").promise.@then(() => {\n }, (e) => {\n sink.error(e);\n });\n function doPipe() {\n @readableStreamDefaultReaderRead(reader).@then(function(result) {\n if (result.done) {\n sink.close();\n return;\n }\n try {\n sink.enqueue(result.value);\n } catch (e) {\n sink.error(\"ReadableStream chunk enqueueing in the sink failed\");\n return;\n }\n doPipe();\n }, function(e) {\n sink.error(e);\n });\n }\n doPipe();\n})\n";
+
+// readableStreamPipeToWritableStream
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength = 2342;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamPipeToWritableStreamCode = "(function (source, destination, preventClose, preventAbort, preventCancel, signal) {\"use strict\";\n if (@getByIdDirectPrivate(source, \"underlyingByteSource\") !== @undefined)\n return @Promise.@reject(\"Piping to a readable bytestream is not supported\");\n let pipeState = {\n source,\n destination,\n preventAbort,\n preventCancel,\n preventClose,\n signal\n };\n if (pipeState.reader = @acquireReadableStreamDefaultReader(source), pipeState.writer = @acquireWritableStreamDefaultWriter(destination), @putByIdDirectPrivate(source, \"disturbed\", !0), pipeState.finalized = !1, pipeState.shuttingDown = !1, pipeState.promiseCapability = @newPromiseCapability(@Promise), pipeState.pendingReadPromiseCapability = @newPromiseCapability(@Promise), pipeState.pendingReadPromiseCapability.resolve.@call(), pipeState.pendingWritePromise = @Promise.@resolve(), signal !== @undefined) {\n const algorithm = (reason) => {\n if (pipeState.finalized)\n return;\n @pipeToShutdownWithAction(pipeState, () => {\n const promiseDestination = !pipeState.preventAbort && @getByIdDirectPrivate(pipeState.destination, \"state\") === \"writable\" \? @writableStreamAbort(pipeState.destination, reason) : @Promise.@resolve(), promiseSource = !pipeState.preventCancel && @getByIdDirectPrivate(pipeState.source, \"state\") === 4 \? @readableStreamCancel(pipeState.source, reason) : @Promise.@resolve();\n let promiseCapability = @newPromiseCapability(@Promise), shouldWait = !0, handleResolvedPromise = () => {\n if (shouldWait) {\n shouldWait = !1;\n return;\n }\n promiseCapability.resolve.@call();\n }, handleRejectedPromise = (e) => {\n promiseCapability.reject.@call(@undefined, e);\n };\n return promiseDestination.@then(handleResolvedPromise, handleRejectedPromise), promiseSource.@then(handleResolvedPromise, handleRejectedPromise), promiseCapability.promise;\n }, reason);\n };\n if (@whenSignalAborted(signal, algorithm))\n return pipeState.promiseCapability.promise;\n }\n return @pipeToErrorsMustBePropagatedForward(pipeState), @pipeToErrorsMustBePropagatedBackward(pipeState), @pipeToClosingMustBePropagatedForward(pipeState), @pipeToClosingMustBePropagatedBackward(pipeState), @pipeToLoop(pipeState), pipeState.promiseCapability.promise;\n})\n";
+
+// readableStreamReaderGenericCancel
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamReaderGenericCancelCodeLength = 164;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericCancelCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamReaderGenericCancelCode = "(function (reader, reason) {\"use strict\";\n const stream = @getByIdDirectPrivate(reader, \"ownerReadableStream\");\n return @readableStreamCancel(stream, reason);\n})\n";
+
+// readableStreamReaderGenericInitialize
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength = 632;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamReaderGenericInitializeCode = "(function (reader, stream) {\"use strict\";\n if (@putByIdDirectPrivate(reader, \"ownerReadableStream\", stream), @putByIdDirectPrivate(stream, \"reader\", reader), @getByIdDirectPrivate(stream, \"state\") === 4)\n @putByIdDirectPrivate(reader, \"closedPromiseCapability\", @newPromiseCapability(@Promise));\n else if (@getByIdDirectPrivate(stream, \"state\") === 1)\n @putByIdDirectPrivate(reader, \"closedPromiseCapability\", {\n promise: @Promise.@resolve()\n });\n else\n @putByIdDirectPrivate(reader, \"closedPromiseCapability\", {\n promise: @newHandledRejectedPromise(@getByIdDirectPrivate(stream, \"storedError\"))\n });\n})\n";
+
+// readableStreamReaderGenericRelease
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeLength = 749;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamReaderGenericReleaseCode = "(function (reader) {\"use strict\";\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(reader, \"ownerReadableStream\"), \"state\") === 4)\n @getByIdDirectPrivate(reader, \"closedPromiseCapability\").reject.@call(@undefined, @makeTypeError(\"releasing lock of reader whose stream is still in readable state\"));\n else\n @putByIdDirectPrivate(reader, \"closedPromiseCapability\", {\n promise: @newHandledRejectedPromise(@makeTypeError(\"reader released lock\"))\n });\n const promise = @getByIdDirectPrivate(reader, \"closedPromiseCapability\").promise;\n @markPromiseAsHandled(promise), @putByIdDirectPrivate(@getByIdDirectPrivate(reader, \"ownerReadableStream\"), \"reader\", @undefined), @putByIdDirectPrivate(reader, \"ownerReadableStream\", @undefined);\n})\n";
+
+// readableStreamTee
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamTeeCodeLength = 1545;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamTeeCode = "(function (stream, shouldClone) {\"use strict\";\n var start_ = @getByIdDirectPrivate(stream, \"start\");\n if (start_)\n @putByIdDirectPrivate(stream, \"start\", @undefined), start_();\n const reader = new @ReadableStreamDefaultReader(stream), teeState = {\n closedOrErrored: !1,\n canceled1: !1,\n canceled2: !1,\n reason1: @undefined,\n reason2: @undefined\n };\n teeState.cancelPromiseCapability = @newPromiseCapability(@Promise);\n const pullFunction = @readableStreamTeePullFunction(teeState, reader, shouldClone), branch1Source = {};\n @putByIdDirectPrivate(branch1Source, \"pull\", pullFunction), @putByIdDirectPrivate(branch1Source, \"cancel\", @readableStreamTeeBranch1CancelFunction(teeState, stream));\n const branch2Source = {};\n @putByIdDirectPrivate(branch2Source, \"pull\", pullFunction), @putByIdDirectPrivate(branch2Source, \"cancel\", @readableStreamTeeBranch2CancelFunction(teeState, stream));\n const branch1 = new @ReadableStream(branch1Source), branch2 = new @ReadableStream(branch2Source);\n return @getByIdDirectPrivate(reader, \"closedPromiseCapability\").promise.@then(@undefined, function(e) {\n if (teeState.closedOrErrored)\n return;\n if (@readableStreamDefaultControllerError(branch1.@readableStreamController, e), @readableStreamDefaultControllerError(branch2.@readableStreamController, e), teeState.closedOrErrored = !0, !teeState.canceled1 || !teeState.canceled2)\n teeState.cancelPromiseCapability.resolve.@call();\n }), teeState.branch1 = branch1, teeState.branch2 = branch2, [branch1, branch2];\n})\n";
+
+// readableStreamTeeBranch1CancelFunction
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength = 369;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode = "(function (teeState, stream) {\"use strict\";\n return function(r) {\n if (teeState.canceled1 = !0, teeState.reason1 = r, teeState.canceled2)\n @readableStreamCancel(stream, [teeState.reason1, teeState.reason2]).@then(teeState.cancelPromiseCapability.@resolve, teeState.cancelPromiseCapability.@reject);\n return teeState.cancelPromiseCapability.promise;\n };\n})\n";
+
+// readableStreamTeeBranch2CancelFunction
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeLength = 369;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode = "(function (teeState, stream) {\"use strict\";\n return function(r) {\n if (teeState.canceled2 = !0, teeState.reason2 = r, teeState.canceled1)\n @readableStreamCancel(stream, [teeState.reason1, teeState.reason2]).@then(teeState.cancelPromiseCapability.@resolve, teeState.cancelPromiseCapability.@reject);\n return teeState.cancelPromiseCapability.promise;\n };\n})\n";
+
+// readableStreamTeePullFunction
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeePullFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength = 1036;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeePullFunctionCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamTeePullFunctionCode = "(function (teeState, reader, shouldClone) {\"use strict\";\n return function() {\n @Promise.prototype.@then.@call(@readableStreamDefaultReaderRead(reader), function(result) {\n if (result.done && !teeState.closedOrErrored) {\n if (!teeState.canceled1)\n @readableStreamDefaultControllerClose(teeState.branch1.@readableStreamController);\n if (!teeState.canceled2)\n @readableStreamDefaultControllerClose(teeState.branch2.@readableStreamController);\n if (teeState.closedOrErrored = !0, !teeState.canceled1 || !teeState.canceled2)\n teeState.cancelPromiseCapability.resolve.@call();\n }\n if (teeState.closedOrErrored)\n return;\n if (!teeState.canceled1)\n @readableStreamDefaultControllerEnqueue(teeState.branch1.@readableStreamController, result.value);\n if (!teeState.canceled2)\n @readableStreamDefaultControllerEnqueue(teeState.branch2.@readableStreamController, shouldClone \? @structuredCloneForStream(result.value) : result.value);\n });\n };\n})\n";
// readableStreamToArrayBufferDirect
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeLength = 1079;
+const int s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeLength = 1422;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamToArrayBufferDirectCode = "(function (stream,underlyingSource){\"use strict\";var sink=new @Bun.ArrayBufferSink;@putByIdDirectPrivate(stream,\"underlyingSource\",@undefined);var highWaterMark=@getByIdDirectPrivate(stream,\"highWaterMark\");sink.start(highWaterMark\?{highWaterMark}:{});var capability=@newPromiseCapability(@Promise),ended=!1,pull=underlyingSource.pull,close=underlyingSource.close,controller={start(){},close(reason){if(!ended){if(ended=!0,close)close();@fulfillPromise(capability.promise,sink.end())}},end(){if(!ended){if(ended=!0,close)close();@fulfillPromise(capability.promise,sink.end())}},flush(){return 0},write:sink.write.bind(sink)},didError=!1;try{const firstPull=pull(controller);if(firstPull&&@isObject(firstPull)&&@isPromise(firstPull))return async function(controller2,promise2,pull2){while(!ended)await pull2(controller2);return await promise2}(controller,promise,pull);return capability.promise}catch(e){return didError=!0,@readableStreamError(stream,e),@Promise.@reject(e)}finally{if(!didError&&stream)@readableStreamClose(stream);controller=close=sink=pull=stream=@undefined}})\n";
-
-// readableStreamToTextDirect
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToTextDirectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToTextDirectCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToTextDirectCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamToTextDirectCodeLength = 388;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToTextDirectCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamToTextDirectCode = "(async function (stream,underlyingSource){\"use strict\";const capability=@initializeTextStream.@call(stream,underlyingSource,@undefined);var reader=stream.getReader();while(@getByIdDirectPrivate(stream,\"state\")===@streamReadable){var thisResult=await reader.read();if(thisResult.done)break}try{reader.releaseLock()}catch(e){}return reader=@undefined,stream=@undefined,capability.promise})\n";
+const char* const s_readableStreamInternalsReadableStreamToArrayBufferDirectCode = "(function (stream, underlyingSource) {\"use strict\";\n var sink = new Bun.ArrayBufferSink;\n @putByIdDirectPrivate(stream, \"underlyingSource\", @undefined);\n var highWaterMark = @getByIdDirectPrivate(stream, \"highWaterMark\");\n sink.start(highWaterMark \? { highWaterMark } : {});\n var capability = @newPromiseCapability(@Promise), ended = !1, pull = underlyingSource.pull, close = underlyingSource.close, controller = {\n start() {\n },\n close(reason) {\n if (!ended) {\n if (ended = !0, close)\n close();\n @fulfillPromise(capability.promise, sink.end());\n }\n },\n end() {\n if (!ended) {\n if (ended = !0, close)\n close();\n @fulfillPromise(capability.promise, sink.end());\n }\n },\n flush() {\n return 0;\n },\n write: sink.write.bind(sink)\n }, didError = !1;\n try {\n const firstPull = pull(controller);\n if (firstPull && @isObject(firstPull) && @isPromise(firstPull))\n return async function(controller2, promise2, pull2) {\n while (!ended)\n await pull2(controller2);\n return await promise2;\n }(controller, promise, pull);\n return capability.promise;\n } catch (e) {\n return didError = !0, @readableStreamError(stream, e), @Promise.@reject(e);\n } finally {\n if (!didError && stream)\n @readableStreamClose(stream);\n controller = close = sink = pull = stream = @undefined;\n }\n})\n";
// readableStreamToArrayDirect
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayDirectCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamToArrayDirectCodeLength = 484;
+const int s_readableStreamInternalsReadableStreamToArrayDirectCodeLength = 603;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToArrayDirectCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamToArrayDirectCode = "(async function (stream,underlyingSource){\"use strict\";const capability=@initializeArrayStream.@call(stream,underlyingSource,@undefined);underlyingSource=@undefined;var reader=stream.getReader();try{while(@getByIdDirectPrivate(stream,\"state\")===@streamReadable){var thisResult=await reader.read();if(thisResult.done)break}try{reader.releaseLock()}catch(e){}return reader=@undefined,@Promise.@resolve(capability.promise)}catch(e){throw e}finally{stream=@undefined,reader=@undefined}})\n";
-
-// readableStreamDefineLazyIterators
-const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeLength = 921;
-static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefineLazyIteratorsCode = "(function (prototype){\"use strict\";var asyncIterator=globalThis.Symbol.asyncIterator,ReadableStreamAsyncIterator=async function*ReadableStreamAsyncIterator(stream,preventCancel){var reader=stream.getReader(),deferredError;try{while(!0){var done,value;const firstResult=reader.readMany();if(@isPromise(firstResult))({done,value}=await firstResult);else({done,value}=firstResult);if(done)return;yield*value}}catch(e){deferredError=e}finally{if(reader.releaseLock(),!preventCancel)stream.cancel(deferredError);if(deferredError)throw deferredError}},createAsyncIterator=function asyncIterator(){return ReadableStreamAsyncIterator(this,!1)},createValues=function values({preventCancel=!1}={preventCancel:!1}){return ReadableStreamAsyncIterator(this,preventCancel)};return @Object.@defineProperty(prototype,asyncIterator,{value:createAsyncIterator}),@Object.@defineProperty(prototype,\"values\",{value:createValues}),prototype})\n";
-
-#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
-JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
-{\
- JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().readableStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
-}
-WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
-#undef DEFINE_BUILTIN_GENERATOR
-
-/* TransformStreamDefaultController.ts */
-// initializeTransformStreamDefaultController
-const JSC::ConstructAbility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeLength = 40;
-static const JSC::Intrinsic s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCode = "(function (){\"use strict\";return this})\n";
-
-// desiredSize
-const JSC::ConstructAbility s_transformStreamDefaultControllerDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamDefaultControllerDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamDefaultControllerDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamDefaultControllerDesiredSizeCodeLength = 397;
-static const JSC::Intrinsic s_transformStreamDefaultControllerDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamDefaultControllerDesiredSizeCode = "(function (){\"use strict\";if(!@isTransformStreamDefaultController(this))throw @makeThisTypeError(\"TransformStreamDefaultController\",\"enqueue\");const stream=@getByIdDirectPrivate(this,\"stream\"),readable=@getByIdDirectPrivate(stream,\"readable\"),readableController=@getByIdDirectPrivate(readable,\"readableStreamController\");return @readableStreamDefaultControllerGetDesiredSize(readableController)})\n";
-
-// enqueue
-const JSC::ConstructAbility s_transformStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamDefaultControllerEnqueueCodeLength = 203;
-static const JSC::Intrinsic s_transformStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamDefaultControllerEnqueueCode = "(function (chunk){\"use strict\";if(!@isTransformStreamDefaultController(this))throw @makeThisTypeError(\"TransformStreamDefaultController\",\"enqueue\");@transformStreamDefaultControllerEnqueue(this,chunk)})\n";
-
-// error
-const JSC::ConstructAbility s_transformStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamDefaultControllerErrorCodeLength = 191;
-static const JSC::Intrinsic s_transformStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamDefaultControllerErrorCode = "(function (e){\"use strict\";if(!@isTransformStreamDefaultController(this))throw @makeThisTypeError(\"TransformStreamDefaultController\",\"error\");@transformStreamDefaultControllerError(this,e)})\n";
-
-// terminate
-const JSC::ConstructAbility s_transformStreamDefaultControllerTerminateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_transformStreamDefaultControllerTerminateCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_transformStreamDefaultControllerTerminateCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_transformStreamDefaultControllerTerminateCodeLength = 196;
-static const JSC::Intrinsic s_transformStreamDefaultControllerTerminateCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamDefaultControllerTerminateCode = "(function (){\"use strict\";if(!@isTransformStreamDefaultController(this))throw @makeThisTypeError(\"TransformStreamDefaultController\",\"terminate\");@transformStreamDefaultControllerTerminate(this)})\n";
-
-#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
-JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
-{\
- JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().transformStreamDefaultControllerBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().transformStreamDefaultControllerBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
-}
-WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
-#undef DEFINE_BUILTIN_GENERATOR
-
-/* ReadableStreamBYOBReader.ts */
-// initializeReadableStreamBYOBReader
-const JSC::ConstructAbility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeLength = 510;
-static const JSC::Intrinsic s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCode = "(function (stream){\"use strict\";if(!@isReadableStream(stream))@throwTypeError(\"ReadableStreamBYOBReader needs a ReadableStream\");if(!@isReadableByteStreamController(@getByIdDirectPrivate(stream,\"readableStreamController\")))@throwTypeError(\"ReadableStreamBYOBReader needs a ReadableByteStreamController\");if(@isReadableStreamLocked(stream))@throwTypeError(\"ReadableStream is locked\");return @readableStreamReaderGenericInitialize(this,stream),@putByIdDirectPrivate(this,\"readIntoRequests\",@createFIFO()),this})\n";
+const char* const s_readableStreamInternalsReadableStreamToArrayDirectCode = "(async function (stream, underlyingSource) {\"use strict\";\n const capability = @initializeArrayStream.@call(stream, underlyingSource, @undefined);\n underlyingSource = @undefined;\n var reader = stream.getReader();\n try {\n while (@getByIdDirectPrivate(stream, \"state\") === 4) {\n var thisResult = await reader.read();\n if (thisResult.done)\n break;\n }\n try {\n reader.releaseLock();\n } catch (e) {\n }\n return reader = @undefined, @Promise.@resolve(capability.promise);\n } catch (e) {\n throw e;\n } finally {\n stream = @undefined, reader = @undefined;\n }\n})\n";
-// cancel
-const JSC::ConstructAbility s_readableStreamBYOBReaderCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamBYOBReaderCancelCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamBYOBReaderCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamBYOBReaderCancelCodeLength = 361;
-static const JSC::Intrinsic s_readableStreamBYOBReaderCancelCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamBYOBReaderCancelCode = "(function (reason){\"use strict\";if(!@isReadableStreamBYOBReader(this))return @Promise.@reject(@makeThisTypeError(\"ReadableStreamBYOBReader\",\"cancel\"));if(!@getByIdDirectPrivate(this,\"ownerReadableStream\"))return @Promise.@reject(@makeTypeError(\"cancel() called on a reader owned by no readable stream\"));return @readableStreamReaderGenericCancel(this,reason)})\n";
-
-// read
-const JSC::ConstructAbility s_readableStreamBYOBReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamBYOBReaderReadCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamBYOBReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamBYOBReaderReadCodeLength = 663;
-static const JSC::Intrinsic s_readableStreamBYOBReaderReadCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamBYOBReaderReadCode = "(function (view){\"use strict\";if(!@isReadableStreamBYOBReader(this))return @Promise.@reject(@makeThisTypeError(\"ReadableStreamBYOBReader\",\"read\"));if(!@getByIdDirectPrivate(this,\"ownerReadableStream\"))return @Promise.@reject(@makeTypeError(\"read() called on a reader owned by no readable stream\"));if(!@isObject(view))return @Promise.@reject(@makeTypeError(\"Provided view is not an object\"));if(!@ArrayBuffer.@isView(view))return @Promise.@reject(@makeTypeError(\"Provided view is not an ArrayBufferView\"));if(view.byteLength===0)return @Promise.@reject(@makeTypeError(\"Provided view cannot have a 0 byteLength\"));return @readableStreamBYOBReaderRead(this,view)})\n";
-
-// releaseLock
-const JSC::ConstructAbility s_readableStreamBYOBReaderReleaseLockCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamBYOBReaderReleaseLockCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamBYOBReaderReleaseLockCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamBYOBReaderReleaseLockCodeLength = 382;
-static const JSC::Intrinsic s_readableStreamBYOBReaderReleaseLockCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamBYOBReaderReleaseLockCode = "(function (){\"use strict\";if(!@isReadableStreamBYOBReader(this))throw @makeThisTypeError(\"ReadableStreamBYOBReader\",\"releaseLock\");if(!@getByIdDirectPrivate(this,\"ownerReadableStream\"))return;if(@getByIdDirectPrivate(this,\"readIntoRequests\")\?.isNotEmpty())@throwTypeError(\"There are still pending read requests, cannot release the lock\");@readableStreamReaderGenericRelease(this)})\n";
-
-// closed
-const JSC::ConstructAbility s_readableStreamBYOBReaderClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamBYOBReaderClosedCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamBYOBReaderClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamBYOBReaderClosedCodeLength = 218;
-static const JSC::Intrinsic s_readableStreamBYOBReaderClosedCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamBYOBReaderClosedCode = "(function (){\"use strict\";if(!@isReadableStreamBYOBReader(this))return @Promise.@reject(@makeGetterTypeError(\"ReadableStreamBYOBReader\",\"closed\"));return @getByIdDirectPrivate(this,\"closedPromiseCapability\").promise})\n";
+// readableStreamToTextDirect
+const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToTextDirectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToTextDirectCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToTextDirectCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadableStreamToTextDirectCodeLength = 450;
+static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToTextDirectCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadableStreamToTextDirectCode = "(async function (stream, underlyingSource) {\"use strict\";\n const capability = @initializeTextStream.@call(stream, underlyingSource, @undefined);\n var reader = stream.getReader();\n while (@getByIdDirectPrivate(stream, \"state\") === 4) {\n var thisResult = await reader.read();\n if (thisResult.done)\n break;\n }\n try {\n reader.releaseLock();\n } catch (e) {\n }\n return reader = @undefined, stream = @undefined, capability.promise;\n})\n";
-#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
-JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
-{\
- JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().readableStreamBYOBReaderBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamBYOBReaderBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
-}
-WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
-#undef DEFINE_BUILTIN_GENERATOR
+// readDirectStream
+const JSC::ConstructAbility s_readableStreamInternalsReadDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadDirectStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadDirectStreamCodeLength = 1518;
+static const JSC::Intrinsic s_readableStreamInternalsReadDirectStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadDirectStreamCode = "(function (stream, sink, underlyingSource) {\"use strict\";\n @putByIdDirectPrivate(stream, \"underlyingSource\", @undefined), @putByIdDirectPrivate(stream, \"start\", @undefined);\n function close(stream2, reason) {\n if (reason && underlyingSource\?.cancel) {\n try {\n var prom = underlyingSource.cancel(reason);\n @markPromiseAsHandled(prom);\n } catch (e) {\n }\n underlyingSource = @undefined;\n }\n if (stream2) {\n if (@putByIdDirectPrivate(stream2, \"readableStreamController\", @undefined), @putByIdDirectPrivate(stream2, \"reader\", @undefined), reason)\n @putByIdDirectPrivate(stream2, \"state\", 3), @putByIdDirectPrivate(stream2, \"storedError\", reason);\n else\n @putByIdDirectPrivate(stream2, \"state\", 1);\n stream2 = @undefined;\n }\n }\n if (!underlyingSource.pull) {\n close();\n return;\n }\n if (!@isCallable(underlyingSource.pull)) {\n close(), @throwTypeError(\"pull is not a function\");\n return;\n }\n @putByIdDirectPrivate(stream, \"readableStreamController\", sink);\n const highWaterMark = @getByIdDirectPrivate(stream, \"highWaterMark\");\n sink.start({\n highWaterMark: !highWaterMark || highWaterMark < 64 \? 64 : highWaterMark\n }), @startDirectStream.@call(sink, stream, underlyingSource.pull, close, stream.@asyncContext), @putByIdDirectPrivate(stream, \"reader\", {});\n var maybePromise = underlyingSource.pull(sink);\n if (sink = @undefined, maybePromise && @isPromise(maybePromise))\n return maybePromise.@then(() => {\n });\n})\n";
-/* JSBufferConstructor.ts */
-// from
-const JSC::ConstructAbility s_jsBufferConstructorFromCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferConstructorFromCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferConstructorFromCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferConstructorFromCodeLength = 1274;
-static const JSC::Intrinsic s_jsBufferConstructorFromCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferConstructorFromCode = "(function (items){\"use strict\";if(@isUndefinedOrNull(items))@throwTypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.\");if(typeof items===\"string\"||typeof items===\"object\"&&(@isTypedArrayView(items)||items instanceof @ArrayBuffer||items instanceof SharedArrayBuffer||items instanceof @String))switch(@argumentCount()){case 1:return new @Buffer(items);case 2:return new @Buffer(items,@argument(1));default:return new @Buffer(items,@argument(1),@argument(2))}var arrayLike=@toObject(items,\"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\");if(!@isJSArray(arrayLike)){const toPrimitive=@tryGetByIdWithWellKnownSymbol(items,\"toPrimitive\");if(toPrimitive){const primitive=toPrimitive.@call(items,\"string\");if(typeof primitive===\"string\")switch(@argumentCount()){case 1:return new @Buffer(primitive);case 2:return new @Buffer(primitive,@argument(1));default:return new @Buffer(primitive,@argument(1),@argument(2))}}if(!(\"length\"in arrayLike)||@isCallable(arrayLike))@throwTypeError(\"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\")}return new @Buffer(@Uint8Array.from(arrayLike).buffer)})\n";
+// readStreamIntoSink
+const JSC::ConstructAbility s_readableStreamInternalsReadStreamIntoSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsReadStreamIntoSinkCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsReadStreamIntoSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsReadStreamIntoSinkCodeLength = 2487;
+static const JSC::Intrinsic s_readableStreamInternalsReadStreamIntoSinkCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsReadStreamIntoSinkCode = "(async function (stream, sink, isNative) {\"use strict\";\n var didClose = !1, didThrow = !1;\n try {\n var reader = stream.getReader(), many = reader.readMany();\n if (many && @isPromise(many))\n many = await many;\n if (many.done)\n return didClose = !0, sink.end();\n var wroteCount = many.value.length;\n const highWaterMark = @getByIdDirectPrivate(stream, \"highWaterMark\");\n if (isNative)\n @startDirectStream.@call(sink, stream, @undefined, () => !didThrow && @markPromiseAsHandled(stream.cancel()), stream.@asyncContext);\n sink.start({ highWaterMark: highWaterMark || 0 });\n for (var i = 0, values = many.value, length = many.value.length;i < length; i++)\n sink.write(values[i]);\n var streamState = @getByIdDirectPrivate(stream, \"state\");\n if (streamState === 1)\n return didClose = !0, sink.end();\n while (!0) {\n var { value, done } = await reader.read();\n if (done)\n return didClose = !0, sink.end();\n sink.write(value);\n }\n } catch (e) {\n didThrow = !0;\n try {\n reader = @undefined;\n const prom = stream.cancel(e);\n @markPromiseAsHandled(prom);\n } catch (j) {\n }\n if (sink && !didClose) {\n didClose = !0;\n try {\n sink.close(e);\n } catch (j) {\n throw new globalThis.AggregateError([e, j]);\n }\n }\n throw e;\n } finally {\n if (reader) {\n try {\n reader.releaseLock();\n } catch (e) {\n }\n reader = @undefined;\n }\n sink = @undefined;\n var streamState = @getByIdDirectPrivate(stream, \"state\");\n if (stream) {\n var readableStreamController = @getByIdDirectPrivate(stream, \"readableStreamController\");\n if (readableStreamController) {\n if (@getByIdDirectPrivate(readableStreamController, \"underlyingSource\"))\n @putByIdDirectPrivate(readableStreamController, \"underlyingSource\", @undefined);\n if (@getByIdDirectPrivate(readableStreamController, \"controlledReadableStream\"))\n @putByIdDirectPrivate(readableStreamController, \"controlledReadableStream\", @undefined);\n if (@putByIdDirectPrivate(stream, \"readableStreamController\", null), @getByIdDirectPrivate(stream, \"underlyingSource\"))\n @putByIdDirectPrivate(stream, \"underlyingSource\", @undefined);\n readableStreamController = @undefined;\n }\n if (!didThrow && streamState !== 1 && streamState !== 3)\n @readableStreamClose(stream);\n stream = @undefined;\n }\n }\n})\n";
-// isBuffer
-const JSC::ConstructAbility s_jsBufferConstructorIsBufferCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_jsBufferConstructorIsBufferCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_jsBufferConstructorIsBufferCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_jsBufferConstructorIsBufferCodeLength = 75;
-static const JSC::Intrinsic s_jsBufferConstructorIsBufferCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferConstructorIsBufferCode = "(function (bufferlike){\"use strict\";return bufferlike instanceof @Buffer})\n";
+// setupReadableStreamDefaultController
+const JSC::ConstructAbility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeLength = 1204;
+static const JSC::Intrinsic s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_readableStreamInternalsSetupReadableStreamDefaultControllerCode = "(function (stream, underlyingSource, size, highWaterMark, startMethod, pullMethod, cancelMethod) {\"use strict\";\n const controller = new @ReadableStreamDefaultController(stream, underlyingSource, size, highWaterMark, @isReadableStream);\n var asyncContext = stream.@asyncContext;\n const pullAlgorithm = () => @promiseInvokeOrNoopMethod(underlyingSource, pullMethod, [controller]), cancelAlgorithm = asyncContext \? (reason) => {\n var prev = @getInternalField(@asyncContext, 0);\n @putInternalField(@asyncContext, 0, asyncContext);\n var result = @promiseInvokeOrNoopMethod(underlyingSource, cancelMethod, [reason]);\n return @putInternalField(@asyncContext, 0, prev), result;\n } : (reason) => @promiseInvokeOrNoopMethod(underlyingSource, cancelMethod, [reason]);\n @putByIdDirectPrivate(controller, \"pullAlgorithm\", pullAlgorithm), @putByIdDirectPrivate(controller, \"cancelAlgorithm\", cancelAlgorithm), @putByIdDirectPrivate(controller, \"pull\", @readableStreamDefaultControllerPull), @putByIdDirectPrivate(controller, \"cancel\", @readableStreamDefaultControllerCancel), @putByIdDirectPrivate(stream, \"readableStreamController\", controller), @readableStreamDefaultControllerStart(controller);\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
{\
JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().jsBufferConstructorBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().jsBufferConstructorBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+ return clientData->builtinFunctions().readableStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
}
-WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
-/* ReadableStreamDefaultReader.ts */
-// initializeReadableStreamDefaultReader
-const JSC::ConstructAbility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeLength = 334;
-static const JSC::Intrinsic s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCode = "(function (stream){\"use strict\";if(!@isReadableStream(stream))@throwTypeError(\"ReadableStreamDefaultReader needs a ReadableStream\");if(@isReadableStreamLocked(stream))@throwTypeError(\"ReadableStream is locked\");return @readableStreamReaderGenericInitialize(this,stream),@putByIdDirectPrivate(this,\"readRequests\",@createFIFO()),this})\n";
+/* StreamInternals.ts */
+// createFIFO
+const JSC::ConstructAbility s_streamInternalsCreateFIFOCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsCreateFIFOCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsCreateFIFOCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
+const int s_streamInternalsCreateFIFOCodeLength = 2276;
+static const JSC::Intrinsic s_streamInternalsCreateFIFOCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsCreateFIFOCode = "(function () {\"use strict\";\n var slice = @Array.prototype.slice;\n\n class Denqueue {\n constructor() {\n this._head = 0, this._tail = 0, this._capacityMask = 3, this._list = @newArrayWithSize(4);\n }\n _head;\n _tail;\n _capacityMask;\n _list;\n size() {\n if (this._head === this._tail)\n return 0;\n if (this._head < this._tail)\n return this._tail - this._head;\n else\n return this._capacityMask + 1 - (this._head - this._tail);\n }\n isEmpty() {\n return this.size() == 0;\n }\n isNotEmpty() {\n return this.size() > 0;\n }\n shift() {\n var { _head: head, _tail, _list, _capacityMask } = this;\n if (head === _tail)\n return @undefined;\n var item = _list[head];\n if (@putByValDirect(_list, head, @undefined), head = this._head = head + 1 & _capacityMask, head < 2 && _tail > 1e4 && _tail <= _list.length >>> 2)\n this._shrinkArray();\n return item;\n }\n peek() {\n if (this._head === this._tail)\n return @undefined;\n return this._list[this._head];\n }\n push(item) {\n var tail = this._tail;\n if (@putByValDirect(this._list, tail, item), this._tail = tail + 1 & this._capacityMask, this._tail === this._head)\n this._growArray();\n }\n toArray(fullCopy) {\n var list = this._list, len = @toLength(list.length);\n if (fullCopy || this._head > this._tail) {\n var _head = @toLength(this._head), _tail = @toLength(this._tail), total = @toLength(len - _head + _tail), array = @newArrayWithSize(total), j = 0;\n for (var i = _head;i < len; i++)\n @putByValDirect(array, j++, list[i]);\n for (var i = 0;i < _tail; i++)\n @putByValDirect(array, j++, list[i]);\n return array;\n } else\n return slice.@call(list, this._head, this._tail);\n }\n clear() {\n this._head = 0, this._tail = 0, this._list.fill(@undefined);\n }\n _growArray() {\n if (this._head)\n this._list = this.toArray(!0), this._head = 0;\n this._tail = @toLength(this._list.length), this._list.length <<= 1, this._capacityMask = this._capacityMask << 1 | 1;\n }\n _shrinkArray() {\n this._list.length >>>= 1, this._capacityMask >>>= 1;\n }\n }\n return new Denqueue;\n})\n";
-// cancel
-const JSC::ConstructAbility s_readableStreamDefaultReaderCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamDefaultReaderCancelCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamDefaultReaderCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamDefaultReaderCancelCodeLength = 367;
-static const JSC::Intrinsic s_readableStreamDefaultReaderCancelCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamDefaultReaderCancelCode = "(function (reason){\"use strict\";if(!@isReadableStreamDefaultReader(this))return @Promise.@reject(@makeThisTypeError(\"ReadableStreamDefaultReader\",\"cancel\"));if(!@getByIdDirectPrivate(this,\"ownerReadableStream\"))return @Promise.@reject(@makeTypeError(\"cancel() called on a reader owned by no readable stream\"));return @readableStreamReaderGenericCancel(this,reason)})\n";
+// createFulfilledPromise
+const JSC::ConstructAbility s_streamInternalsCreateFulfilledPromiseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsCreateFulfilledPromiseCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsCreateFulfilledPromiseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_streamInternalsCreateFulfilledPromiseCodeLength = 120;
+static const JSC::Intrinsic s_streamInternalsCreateFulfilledPromiseCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsCreateFulfilledPromiseCode = "(function (value) {\"use strict\";\n const promise = @newPromise();\n return @fulfillPromise(promise, value), promise;\n})\n";
-// readMany
-const JSC::ConstructAbility s_readableStreamDefaultReaderReadManyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamDefaultReaderReadManyCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadManyCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamDefaultReaderReadManyCodeLength = 3230;
-static const JSC::Intrinsic s_readableStreamDefaultReaderReadManyCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamDefaultReaderReadManyCode = "(function (){\"use strict\";if(!@isReadableStreamDefaultReader(this))@throwTypeError(\"ReadableStreamDefaultReader.readMany() should not be called directly\");const stream=@getByIdDirectPrivate(this,\"ownerReadableStream\");if(!stream)@throwTypeError(\"readMany() called on a reader owned by no readable stream\");const state=@getByIdDirectPrivate(stream,\"state\");if(@putByIdDirectPrivate(stream,\"disturbed\",!0),state===@streamClosed)return{value:[],size:0,done:!0};else if(state===@streamErrored)throw @getByIdDirectPrivate(stream,\"storedError\");var controller=@getByIdDirectPrivate(stream,\"readableStreamController\"),queue=@getByIdDirectPrivate(controller,\"queue\");if(!queue)return controller.@pull(controller).@then(function({done,value}){return done\?{done:!0,value:[],size:0}:{value:[value],size:1,done:!1}});const content=queue.content;var size=queue.size,values=content.toArray(!1),length=values.length;if(length>0){var outValues=@newArrayWithSize(length);if(@isReadableByteStreamController(controller)){{const buf=values[0];if(!(@ArrayBuffer.@isView(buf)||buf instanceof @ArrayBuffer))@putByValDirect(outValues,0,new @Uint8Array(buf.buffer,buf.byteOffset,buf.byteLength));else @putByValDirect(outValues,0,buf)}for(var i=1;i<length;i++){const buf=values[i];if(!(@ArrayBuffer.@isView(buf)||buf instanceof @ArrayBuffer))@putByValDirect(outValues,i,new @Uint8Array(buf.buffer,buf.byteOffset,buf.byteLength));else @putByValDirect(outValues,i,buf)}}else{@putByValDirect(outValues,0,values[0].value);for(var i=1;i<length;i++)@putByValDirect(outValues,i,values[i].value)}if(@resetQueue(@getByIdDirectPrivate(controller,\"queue\")),@getByIdDirectPrivate(controller,\"closeRequested\"))@readableStreamClose(@getByIdDirectPrivate(controller,\"controlledReadableStream\"));else if(@isReadableStreamDefaultController(controller))@readableStreamDefaultControllerCallPullIfNeeded(controller);else if(@isReadableByteStreamController(controller))@readableByteStreamControllerCallPullIfNeeded(controller);return{value:outValues,size,done:!1}}var onPullMany=(result)=>{if(result.done)return{value:[],size:0,done:!0};var controller2=@getByIdDirectPrivate(stream,\"readableStreamController\"),queue2=@getByIdDirectPrivate(controller2,\"queue\"),value=[result.value].concat(queue2.content.toArray(!1)),length2=value.length;if(@isReadableByteStreamController(controller2))for(var i2=0;i2<length2;i2++){const buf=value[i2];if(!(@ArrayBuffer.@isView(buf)||buf instanceof @ArrayBuffer)){const{buffer,byteOffset,byteLength}=buf;@putByValDirect(value,i2,new @Uint8Array(buffer,byteOffset,byteLength))}}else for(var i2=1;i2<length2;i2++)@putByValDirect(value,i2,value[i2].value);var size2=queue2.size;if(@resetQueue(queue2),@getByIdDirectPrivate(controller2,\"closeRequested\"))@readableStreamClose(@getByIdDirectPrivate(controller2,\"controlledReadableStream\"));else if(@isReadableStreamDefaultController(controller2))@readableStreamDefaultControllerCallPullIfNeeded(controller2);else if(@isReadableByteStreamController(controller2))@readableByteStreamControllerCallPullIfNeeded(controller2);return{value,size:size2,done:!1}},pullResult=controller.@pull(controller);if(pullResult&&@isPromise(pullResult))return pullResult.@then(onPullMany);return onPullMany(pullResult)})\n";
+// dequeueValue
+const JSC::ConstructAbility s_streamInternalsDequeueValueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsDequeueValueCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsDequeueValueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_streamInternalsDequeueValueCodeLength = 168;
+static const JSC::Intrinsic s_streamInternalsDequeueValueCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsDequeueValueCode = "(function (queue) {\"use strict\";\n const record = queue.content.shift();\n if (queue.size -= record.size, queue.size < 0)\n queue.size = 0;\n return record.value;\n})\n";
-// read
-const JSC::ConstructAbility s_readableStreamDefaultReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamDefaultReaderReadCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamDefaultReaderReadCodeLength = 348;
-static const JSC::Intrinsic s_readableStreamDefaultReaderReadCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamDefaultReaderReadCode = "(function (){\"use strict\";if(!@isReadableStreamDefaultReader(this))return @Promise.@reject(@makeThisTypeError(\"ReadableStreamDefaultReader\",\"read\"));if(!@getByIdDirectPrivate(this,\"ownerReadableStream\"))return @Promise.@reject(@makeTypeError(\"read() called on a reader owned by no readable stream\"));return @readableStreamDefaultReaderRead(this)})\n";
+// enqueueValueWithSize
+const JSC::ConstructAbility s_streamInternalsEnqueueValueWithSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsEnqueueValueWithSizeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsEnqueueValueWithSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_streamInternalsEnqueueValueWithSizeCodeLength = 221;
+static const JSC::Intrinsic s_streamInternalsEnqueueValueWithSizeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsEnqueueValueWithSizeCode = "(function (queue, value, size) {\"use strict\";\n if (size = @toNumber(size), !@isFinite(size) || size < 0)\n @throwRangeError(\"size has an incorrect value\");\n queue.content.push({ value, size }), queue.size += size;\n})\n";
-// releaseLock
-const JSC::ConstructAbility s_readableStreamDefaultReaderReleaseLockCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamDefaultReaderReleaseLockCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamDefaultReaderReleaseLockCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamDefaultReaderReleaseLockCodeLength = 384;
-static const JSC::Intrinsic s_readableStreamDefaultReaderReleaseLockCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamDefaultReaderReleaseLockCode = "(function (){\"use strict\";if(!@isReadableStreamDefaultReader(this))throw @makeThisTypeError(\"ReadableStreamDefaultReader\",\"releaseLock\");if(!@getByIdDirectPrivate(this,\"ownerReadableStream\"))return;if(@getByIdDirectPrivate(this,\"readRequests\")\?.isNotEmpty())@throwTypeError(\"There are still pending read requests, cannot release the lock\");@readableStreamReaderGenericRelease(this)})\n";
+// extractHighWaterMark
+const JSC::ConstructAbility s_streamInternalsExtractHighWaterMarkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsExtractHighWaterMarkCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsExtractHighWaterMarkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_streamInternalsExtractHighWaterMarkCodeLength = 326;
+static const JSC::Intrinsic s_streamInternalsExtractHighWaterMarkCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsExtractHighWaterMarkCode = "(function (strategy, defaultHWM) {\"use strict\";\n const highWaterMark = strategy.highWaterMark;\n if (highWaterMark === @undefined)\n return defaultHWM;\n if (highWaterMark !== highWaterMark || highWaterMark < 0)\n @throwRangeError(\"highWaterMark value is negative or not a number\");\n return @toNumber(highWaterMark);\n})\n";
-// closed
-const JSC::ConstructAbility s_readableStreamDefaultReaderClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamDefaultReaderClosedCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamDefaultReaderClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamDefaultReaderClosedCodeLength = 224;
-static const JSC::Intrinsic s_readableStreamDefaultReaderClosedCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamDefaultReaderClosedCode = "(function (){\"use strict\";if(!@isReadableStreamDefaultReader(this))return @Promise.@reject(@makeGetterTypeError(\"ReadableStreamDefaultReader\",\"closed\"));return @getByIdDirectPrivate(this,\"closedPromiseCapability\").promise})\n";
+// extractHighWaterMarkFromQueuingStrategyInit
+const JSC::ConstructAbility s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeLength = 314;
+static const JSC::Intrinsic s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCode = "(function (init) {\"use strict\";\n if (!@isObject(init))\n @throwTypeError(\"QueuingStrategyInit argument must be an object.\");\n const { highWaterMark } = init;\n if (highWaterMark === @undefined)\n @throwTypeError(\"QueuingStrategyInit.highWaterMark member is required.\");\n return @toNumber(highWaterMark);\n})\n";
-#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
-JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
-{\
- JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().readableStreamDefaultReaderBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamDefaultReaderBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
-}
-WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
-#undef DEFINE_BUILTIN_GENERATOR
+// extractSizeAlgorithm
+const JSC::ConstructAbility s_streamInternalsExtractSizeAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsExtractSizeAlgorithmCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsExtractSizeAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_streamInternalsExtractSizeAlgorithmCodeLength = 294;
+static const JSC::Intrinsic s_streamInternalsExtractSizeAlgorithmCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsExtractSizeAlgorithmCode = "(function (strategy) {\"use strict\";\n const sizeAlgorithm = strategy.size;\n if (sizeAlgorithm === @undefined)\n return () => 1;\n if (typeof sizeAlgorithm !== \"function\")\n @throwTypeError(\"strategy.size must be a function\");\n return (chunk) => {\n return sizeAlgorithm(chunk);\n };\n})\n";
-/* StreamInternals.ts */
// markPromiseAsHandled
const JSC::ConstructAbility s_streamInternalsMarkPromiseAsHandledCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_streamInternalsMarkPromiseAsHandledCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_streamInternalsMarkPromiseAsHandledCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsMarkPromiseAsHandledCodeLength = 164;
+const int s_streamInternalsMarkPromiseAsHandledCodeLength = 175;
static const JSC::Intrinsic s_streamInternalsMarkPromiseAsHandledCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsMarkPromiseAsHandledCode = "(function (promise){\"use strict\";@putPromiseInternalField(promise,@promiseFieldFlags,@getPromiseInternalField(promise,@promiseFieldFlags)|@promiseFlagsIsHandled)})\n";
+const char* const s_streamInternalsMarkPromiseAsHandledCode = "(function (promise) {\"use strict\";\n @putPromiseInternalField(promise, @promiseFieldFlags, @getPromiseInternalField(promise, @promiseFieldFlags) | @promiseFlagsIsHandled);\n})\n";
-// shieldingPromiseResolve
-const JSC::ConstructAbility s_streamInternalsShieldingPromiseResolveCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsShieldingPromiseResolveCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsShieldingPromiseResolveCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsShieldingPromiseResolveCodeLength = 158;
-static const JSC::Intrinsic s_streamInternalsShieldingPromiseResolveCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsShieldingPromiseResolveCode = "(function (result){\"use strict\";const promise=@Promise.@resolve(result);if(promise.@then===@undefined)promise.@then=@Promise.prototype.@then;return promise})\n";
+// newQueue
+const JSC::ConstructAbility s_streamInternalsNewQueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsNewQueueCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsNewQueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_streamInternalsNewQueueCodeLength = 77;
+static const JSC::Intrinsic s_streamInternalsNewQueueCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsNewQueueCode = "(function () {\"use strict\";\n return { content: @createFIFO(), size: 0 };\n})\n";
+
+// peekQueueValue
+const JSC::ConstructAbility s_streamInternalsPeekQueueValueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsPeekQueueValueCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsPeekQueueValueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_streamInternalsPeekQueueValueCodeLength = 74;
+static const JSC::Intrinsic s_streamInternalsPeekQueueValueCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsPeekQueueValueCode = "(function (queue) {\"use strict\";\n return queue.content.peek()\?.value;\n})\n";
+
+// promiseInvokeOrFallbackOrNoop
+const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeLength = 325;
+static const JSC::Intrinsic s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsPromiseInvokeOrFallbackOrNoopCode = "(function (object, key1, args1, key2, args2) {\"use strict\";\n try {\n const method = object[key1];\n if (method === @undefined)\n return @promiseInvokeOrNoopNoCatch(object, key2, args2);\n return @shieldingPromiseResolve(method.@apply(object, args1));\n } catch (error) {\n return @Promise.@reject(error);\n }\n})\n";
+
+// promiseInvokeOrNoop
+const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_streamInternalsPromiseInvokeOrNoopCodeLength = 175;
+static const JSC::Intrinsic s_streamInternalsPromiseInvokeOrNoopCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsPromiseInvokeOrNoopCode = "(function (object, key, args) {\"use strict\";\n try {\n return @promiseInvokeOrNoopNoCatch(object, key, args);\n } catch (error) {\n return @Promise.@reject(error);\n }\n})\n";
+
+// promiseInvokeOrNoopMethod
+const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopMethodCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopMethodCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopMethodCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_streamInternalsPromiseInvokeOrNoopMethodCodeLength = 187;
+static const JSC::Intrinsic s_streamInternalsPromiseInvokeOrNoopMethodCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsPromiseInvokeOrNoopMethodCode = "(function (object, method, args) {\"use strict\";\n try {\n return @promiseInvokeOrNoopMethodNoCatch(object, method, args);\n } catch (error) {\n return @Promise.@reject(error);\n }\n})\n";
// promiseInvokeOrNoopMethodNoCatch
const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeLength = 156;
+const int s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeLength = 176;
static const JSC::Intrinsic s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCode = "(function (object,method,args){\"use strict\";if(method===@undefined)return @Promise.@resolve();return @shieldingPromiseResolve(method.@apply(object,args))})\n";
+const char* const s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCode = "(function (object, method, args) {\"use strict\";\n if (method === @undefined)\n return @Promise.@resolve();\n return @shieldingPromiseResolve(method.@apply(object, args));\n})\n";
// promiseInvokeOrNoopNoCatch
const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopNoCatchCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopNoCatchCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopNoCatchCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsPromiseInvokeOrNoopNoCatchCodeLength = 109;
+const int s_streamInternalsPromiseInvokeOrNoopNoCatchCodeLength = 119;
static const JSC::Intrinsic s_streamInternalsPromiseInvokeOrNoopNoCatchCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsPromiseInvokeOrNoopNoCatchCode = "(function (object,key,args){\"use strict\";return @promiseInvokeOrNoopMethodNoCatch(object,object[key],args)})\n";
+const char* const s_streamInternalsPromiseInvokeOrNoopNoCatchCode = "(function (object, key, args) {\"use strict\";\n return @promiseInvokeOrNoopMethodNoCatch(object, object[key], args);\n})\n";
-// promiseInvokeOrNoopMethod
-const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopMethodCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopMethodCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopMethodCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsPromiseInvokeOrNoopMethodCodeLength = 156;
-static const JSC::Intrinsic s_streamInternalsPromiseInvokeOrNoopMethodCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsPromiseInvokeOrNoopMethodCode = "(function (object,method,args){\"use strict\";try{return @promiseInvokeOrNoopMethodNoCatch(object,method,args)}catch(error){return @Promise.@reject(error)}})\n";
+// resetQueue
+const JSC::ConstructAbility s_streamInternalsResetQueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsResetQueueCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsResetQueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_streamInternalsResetQueueCodeLength = 77;
+static const JSC::Intrinsic s_streamInternalsResetQueueCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsResetQueueCode = "(function (queue) {\"use strict\";\n queue.content.clear(), queue.size = 0;\n})\n";
-// promiseInvokeOrNoop
-const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsPromiseInvokeOrNoopCodeLength = 144;
-static const JSC::Intrinsic s_streamInternalsPromiseInvokeOrNoopCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsPromiseInvokeOrNoopCode = "(function (object,key,args){\"use strict\";try{return @promiseInvokeOrNoopNoCatch(object,key,args)}catch(error){return @Promise.@reject(error)}})\n";
+// shieldingPromiseResolve
+const JSC::ConstructAbility s_streamInternalsShieldingPromiseResolveCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsShieldingPromiseResolveCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsShieldingPromiseResolveCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_streamInternalsShieldingPromiseResolveCodeLength = 182;
+static const JSC::Intrinsic s_streamInternalsShieldingPromiseResolveCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsShieldingPromiseResolveCode = "(function (result) {\"use strict\";\n const promise = @Promise.@resolve(result);\n if (promise.@then === @undefined)\n promise.@then = @Promise.prototype.@then;\n return promise;\n})\n";
-// promiseInvokeOrFallbackOrNoop
-const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeLength = 269;
-static const JSC::Intrinsic s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsPromiseInvokeOrFallbackOrNoopCode = "(function (object,key1,args1,key2,args2){\"use strict\";try{const method=object[key1];if(method===@undefined)return @promiseInvokeOrNoopNoCatch(object,key2,args2);return @shieldingPromiseResolve(method.@apply(object,args1))}catch(error){return @Promise.@reject(error)}})\n";
+// toDictionary
+const JSC::ConstructAbility s_streamInternalsToDictionaryCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_streamInternalsToDictionaryCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_streamInternalsToDictionaryCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_streamInternalsToDictionaryCodeLength = 211;
+static const JSC::Intrinsic s_streamInternalsToDictionaryCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_streamInternalsToDictionaryCode = "(function (value, defaultValue, errorMessage) {\"use strict\";\n if (value === @undefined || value === null)\n return defaultValue;\n if (!@isObject(value))\n @throwTypeError(errorMessage);\n return value;\n})\n";
// validateAndNormalizeQueuingStrategy
const JSC::ConstructAbility s_streamInternalsValidateAndNormalizeQueuingStrategyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_streamInternalsValidateAndNormalizeQueuingStrategyCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_streamInternalsValidateAndNormalizeQueuingStrategyCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsValidateAndNormalizeQueuingStrategyCodeLength = 365;
+const int s_streamInternalsValidateAndNormalizeQueuingStrategyCodeLength = 412;
static const JSC::Intrinsic s_streamInternalsValidateAndNormalizeQueuingStrategyCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsValidateAndNormalizeQueuingStrategyCode = "(function (size,highWaterMark){\"use strict\";if(size!==@undefined&&typeof size!==\"function\")@throwTypeError(\"size parameter must be a function\");const newHighWaterMark=@toNumber(highWaterMark);if(newHighWaterMark!==newHighWaterMark||newHighWaterMark<0)@throwRangeError(\"highWaterMark value is negative or not a number\");return{size,highWaterMark:newHighWaterMark}})\n";
+const char* const s_streamInternalsValidateAndNormalizeQueuingStrategyCode = "(function (size, highWaterMark) {\"use strict\";\n if (size !== @undefined && typeof size !== \"function\")\n @throwTypeError(\"size parameter must be a function\");\n const newHighWaterMark = @toNumber(highWaterMark);\n if (newHighWaterMark !== newHighWaterMark || newHighWaterMark < 0)\n @throwRangeError(\"highWaterMark value is negative or not a number\");\n return { size, highWaterMark: newHighWaterMark };\n})\n";
-// createFIFO
-const JSC::ConstructAbility s_streamInternalsCreateFIFOCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsCreateFIFOCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsCreateFIFOCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
-const int s_streamInternalsCreateFIFOCodeLength = 1650;
-static const JSC::Intrinsic s_streamInternalsCreateFIFOCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsCreateFIFOCode = "(function (){\"use strict\";var slice=@Array.prototype.slice;class Denqueue{constructor(){this._head=0,this._tail=0,this._capacityMask=3,this._list=@newArrayWithSize(4)}_head;_tail;_capacityMask;_list;size(){if(this._head===this._tail)return 0;if(this._head<this._tail)return this._tail-this._head;else return this._capacityMask+1-(this._head-this._tail)}isEmpty(){return this.size()==0}isNotEmpty(){return this.size()>0}shift(){var{_head:head,_tail,_list,_capacityMask}=this;if(head===_tail)return @undefined;var item=_list[head];if(@putByValDirect(_list,head,@undefined),head=this._head=head+1&_capacityMask,head<2&&_tail>1e4&&_tail<=_list.length>>>2)this._shrinkArray();return item}peek(){if(this._head===this._tail)return @undefined;return this._list[this._head]}push(item){var tail=this._tail;if(@putByValDirect(this._list,tail,item),this._tail=tail+1&this._capacityMask,this._tail===this._head)this._growArray()}toArray(fullCopy){var list=this._list,len=@toLength(list.length);if(fullCopy||this._head>this._tail){var _head=@toLength(this._head),_tail=@toLength(this._tail),total=@toLength(len-_head+_tail),array=@newArrayWithSize(total),j=0;for(var i=_head;i<len;i++)@putByValDirect(array,j++,list[i]);for(var i=0;i<_tail;i++)@putByValDirect(array,j++,list[i]);return array}else return slice.@call(list,this._head,this._tail)}clear(){this._head=0,this._tail=0,this._list.fill(@undefined)}_growArray(){if(this._head)this._list=this.toArray(!0),this._head=0;this._tail=@toLength(this._list.length),this._list.length<<=1,this._capacityMask=this._capacityMask<<1|1}_shrinkArray(){this._list.length>>>=1,this._capacityMask>>>=1}}return new Denqueue})\n";
-
-// newQueue
-const JSC::ConstructAbility s_streamInternalsNewQueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsNewQueueCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsNewQueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsNewQueueCodeLength = 65;
-static const JSC::Intrinsic s_streamInternalsNewQueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsNewQueueCode = "(function (){\"use strict\";return{content:@createFIFO(),size:0}})\n";
+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
+{\
+ JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
+ return clientData->builtinFunctions().streamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().streamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+}
+WEBCORE_FOREACH_STREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
-// dequeueValue
-const JSC::ConstructAbility s_streamInternalsDequeueValueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsDequeueValueCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsDequeueValueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsDequeueValueCodeLength = 141;
-static const JSC::Intrinsic s_streamInternalsDequeueValueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsDequeueValueCode = "(function (queue){\"use strict\";const record=queue.content.shift();if(queue.size-=record.size,queue.size<0)queue.size=0;return record.value})\n";
+/* TransformStream.ts */
+// initializeTransformStream
+const JSC::ConstructAbility s_transformStreamInitializeTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInitializeTransformStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInitializeTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInitializeTransformStreamCodeLength = 2355;
+static const JSC::Intrinsic s_transformStreamInitializeTransformStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInitializeTransformStreamCode = "(function () {\"use strict\";\n let transformer = arguments[0];\n if (@isObject(transformer) && @getByIdDirectPrivate(transformer, \"TransformStream\"))\n return this;\n let writableStrategy = arguments[1], readableStrategy = arguments[2];\n if (transformer === @undefined)\n transformer = null;\n if (readableStrategy === @undefined)\n readableStrategy = {};\n if (writableStrategy === @undefined)\n writableStrategy = {};\n let transformerDict = {};\n if (transformer !== null) {\n if (\"start\" in transformer) {\n if (transformerDict.start = transformer.start, typeof transformerDict.start !== \"function\")\n @throwTypeError(\"transformer.start should be a function\");\n }\n if (\"transform\" in transformer) {\n if (transformerDict.transform = transformer.transform, typeof transformerDict.transform !== \"function\")\n @throwTypeError(\"transformer.transform should be a function\");\n }\n if (\"flush\" in transformer) {\n if (transformerDict.flush = transformer.flush, typeof transformerDict.flush !== \"function\")\n @throwTypeError(\"transformer.flush should be a function\");\n }\n if (\"readableType\" in transformer)\n @throwRangeError(\"TransformStream transformer has a readableType\");\n if (\"writableType\" in transformer)\n @throwRangeError(\"TransformStream transformer has a writableType\");\n }\n const readableHighWaterMark = @extractHighWaterMark(readableStrategy, 0), readableSizeAlgorithm = @extractSizeAlgorithm(readableStrategy), writableHighWaterMark = @extractHighWaterMark(writableStrategy, 1), writableSizeAlgorithm = @extractSizeAlgorithm(writableStrategy), startPromiseCapability = @newPromiseCapability(@Promise);\n if (@initializeTransformStream(this, startPromiseCapability.promise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm), @setUpTransformStreamDefaultControllerFromTransformer(this, transformer, transformerDict), (\"start\" in transformerDict)) {\n const controller = @getByIdDirectPrivate(this, \"controller\");\n (() => @promiseInvokeOrNoopMethodNoCatch(transformer, transformerDict.start, [controller]))().@then(() => {\n startPromiseCapability.resolve.@call();\n }, (error) => {\n startPromiseCapability.reject.@call(@undefined, error);\n });\n } else\n startPromiseCapability.resolve.@call();\n return this;\n})\n";
-// enqueueValueWithSize
-const JSC::ConstructAbility s_streamInternalsEnqueueValueWithSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsEnqueueValueWithSizeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsEnqueueValueWithSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsEnqueueValueWithSizeCodeLength = 191;
-static const JSC::Intrinsic s_streamInternalsEnqueueValueWithSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsEnqueueValueWithSizeCode = "(function (queue,value,size){\"use strict\";if(size=@toNumber(size),!@isFinite(size)||size<0)@throwRangeError(\"size has an incorrect value\");queue.content.push({value,size}),queue.size+=size})\n";
+// readable
+const JSC::ConstructAbility s_transformStreamReadableCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamReadableCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamReadableCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamReadableCodeLength = 175;
+static const JSC::Intrinsic s_transformStreamReadableCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamReadableCode = "(function () {\"use strict\";\n if (!@isTransformStream(this))\n throw @makeThisTypeError(\"TransformStream\", \"readable\");\n return @getByIdDirectPrivate(this, \"readable\");\n})\n";
-// peekQueueValue
-const JSC::ConstructAbility s_streamInternalsPeekQueueValueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsPeekQueueValueCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsPeekQueueValueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsPeekQueueValueCodeLength = 68;
-static const JSC::Intrinsic s_streamInternalsPeekQueueValueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsPeekQueueValueCode = "(function (queue){\"use strict\";return queue.content.peek()\?.value})\n";
+// writable
+const JSC::ConstructAbility s_transformStreamWritableCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamWritableCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamWritableCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamWritableCodeLength = 175;
+static const JSC::Intrinsic s_transformStreamWritableCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamWritableCode = "(function () {\"use strict\";\n if (!@isTransformStream(this))\n throw @makeThisTypeError(\"TransformStream\", \"writable\");\n return @getByIdDirectPrivate(this, \"writable\");\n})\n";
-// resetQueue
-const JSC::ConstructAbility s_streamInternalsResetQueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsResetQueueCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsResetQueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsResetQueueCodeLength = 68;
-static const JSC::Intrinsic s_streamInternalsResetQueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsResetQueueCode = "(function (queue){\"use strict\";queue.content.clear(),queue.size=0})\n";
+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
+{\
+ JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
+ return clientData->builtinFunctions().transformStreamBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().transformStreamBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+}
+WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
-// extractSizeAlgorithm
-const JSC::ConstructAbility s_streamInternalsExtractSizeAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsExtractSizeAlgorithmCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsExtractSizeAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsExtractSizeAlgorithmCodeLength = 246;
-static const JSC::Intrinsic s_streamInternalsExtractSizeAlgorithmCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsExtractSizeAlgorithmCode = "(function (strategy){\"use strict\";const sizeAlgorithm=strategy.size;if(sizeAlgorithm===@undefined)return()=>1;if(typeof sizeAlgorithm!==\"function\")@throwTypeError(\"strategy.size must be a function\");return(chunk)=>{return sizeAlgorithm(chunk)}})\n";
+/* TransformStreamDefaultController.ts */
+// desiredSize
+const JSC::ConstructAbility s_transformStreamDefaultControllerDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamDefaultControllerDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamDefaultControllerDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamDefaultControllerDesiredSizeCodeLength = 427;
+static const JSC::Intrinsic s_transformStreamDefaultControllerDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamDefaultControllerDesiredSizeCode = "(function () {\"use strict\";\n if (!@isTransformStreamDefaultController(this))\n throw @makeThisTypeError(\"TransformStreamDefaultController\", \"enqueue\");\n const stream = @getByIdDirectPrivate(this, \"stream\"), readable = @getByIdDirectPrivate(stream, \"readable\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\");\n return @readableStreamDefaultControllerGetDesiredSize(readableController);\n})\n";
-// extractHighWaterMark
-const JSC::ConstructAbility s_streamInternalsExtractHighWaterMarkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsExtractHighWaterMarkCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsExtractHighWaterMarkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsExtractHighWaterMarkCodeLength = 288;
-static const JSC::Intrinsic s_streamInternalsExtractHighWaterMarkCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsExtractHighWaterMarkCode = "(function (strategy,defaultHWM){\"use strict\";const highWaterMark=strategy.highWaterMark;if(highWaterMark===@undefined)return defaultHWM;if(highWaterMark!==highWaterMark||highWaterMark<0)@throwRangeError(\"highWaterMark value is negative or not a number\");return @toNumber(highWaterMark)})\n";
+// enqueue
+const JSC::ConstructAbility s_transformStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamDefaultControllerEnqueueCodeLength = 220;
+static const JSC::Intrinsic s_transformStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamDefaultControllerEnqueueCode = "(function (chunk) {\"use strict\";\n if (!@isTransformStreamDefaultController(this))\n throw @makeThisTypeError(\"TransformStreamDefaultController\", \"enqueue\");\n @transformStreamDefaultControllerEnqueue(this, chunk);\n})\n";
-// extractHighWaterMarkFromQueuingStrategyInit
-const JSC::ConstructAbility s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeLength = 280;
-static const JSC::Intrinsic s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCode = "(function (init){\"use strict\";if(!@isObject(init))@throwTypeError(\"QueuingStrategyInit argument must be an object.\");const{highWaterMark}=init;if(highWaterMark===@undefined)@throwTypeError(\"QueuingStrategyInit.highWaterMark member is required.\");return @toNumber(highWaterMark)})\n";
+// error
+const JSC::ConstructAbility s_transformStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamDefaultControllerErrorCodeLength = 208;
+static const JSC::Intrinsic s_transformStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamDefaultControllerErrorCode = "(function (e) {\"use strict\";\n if (!@isTransformStreamDefaultController(this))\n throw @makeThisTypeError(\"TransformStreamDefaultController\", \"error\");\n @transformStreamDefaultControllerError(this, e);\n})\n";
-// createFulfilledPromise
-const JSC::ConstructAbility s_streamInternalsCreateFulfilledPromiseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsCreateFulfilledPromiseCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsCreateFulfilledPromiseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsCreateFulfilledPromiseCodeLength = 107;
-static const JSC::Intrinsic s_streamInternalsCreateFulfilledPromiseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsCreateFulfilledPromiseCode = "(function (value){\"use strict\";const promise=@newPromise();return @fulfillPromise(promise,value),promise})\n";
+// initializeTransformStreamDefaultController
+const JSC::ConstructAbility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeLength = 46;
+static const JSC::Intrinsic s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCode = "(function () {\"use strict\";\n return this;\n})\n";
-// toDictionary
-const JSC::ConstructAbility s_streamInternalsToDictionaryCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_streamInternalsToDictionaryCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_streamInternalsToDictionaryCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_streamInternalsToDictionaryCodeLength = 179;
-static const JSC::Intrinsic s_streamInternalsToDictionaryCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsToDictionaryCode = "(function (value,defaultValue,errorMessage){\"use strict\";if(value===@undefined||value===null)return defaultValue;if(!@isObject(value))@throwTypeError(errorMessage);return value})\n";
+// terminate
+const JSC::ConstructAbility s_transformStreamDefaultControllerTerminateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamDefaultControllerTerminateCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamDefaultControllerTerminateCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamDefaultControllerTerminateCodeLength = 212;
+static const JSC::Intrinsic s_transformStreamDefaultControllerTerminateCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamDefaultControllerTerminateCode = "(function () {\"use strict\";\n if (!@isTransformStreamDefaultController(this))\n throw @makeThisTypeError(\"TransformStreamDefaultController\", \"terminate\");\n @transformStreamDefaultControllerTerminate(this);\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
{\
JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().streamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().streamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+ return clientData->builtinFunctions().transformStreamDefaultControllerBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().transformStreamDefaultControllerBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
}
-WEBCORE_FOREACH_STREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
-/* ImportMetaObject.ts */
-// loadCJS2ESM
-const JSC::ConstructAbility s_importMetaObjectLoadCJS2ESMCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_importMetaObjectLoadCJS2ESMCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_importMetaObjectLoadCJS2ESMCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_importMetaObjectLoadCJS2ESMCodeLength = 2214;
-static const JSC::Intrinsic s_importMetaObjectLoadCJS2ESMCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_importMetaObjectLoadCJS2ESMCode = "(function (resolvedSpecifier){\"use strict\";var loader=@Loader,queue=@createFIFO(),key=resolvedSpecifier;while(key){var entry=loader.registry.@get(key);if((entry\?.state\?\?0)<=@ModuleFetch)@fulfillModuleSync(key),entry=loader.registry.@get(key);var sourceCodeObject=@getPromiseInternalField(entry.fetch,@promiseFieldReactionsOrResult),moduleRecordPromise=loader.parseModule(key,sourceCodeObject),mod=entry.module;if(moduleRecordPromise&&@isPromise(moduleRecordPromise)){var reactionsOrResult=@getPromiseInternalField(moduleRecordPromise,@promiseFieldReactionsOrResult),flags=@getPromiseInternalField(moduleRecordPromise,@promiseFieldFlags),state=flags&@promiseStateMask;if(state===@promiseStatePending||reactionsOrResult&&@isPromise(reactionsOrResult))@throwTypeError(`require() async module \"${key}\" is unsupported. use \"await import()\" instead.`);else if(state===@promiseStateRejected){if(!reactionsOrResult\?.message)@throwTypeError(`${reactionsOrResult+\"\"\?reactionsOrResult:\"An error occurred\"} occurred while parsing module \\\"${key}\\\"`);throw reactionsOrResult}entry.module=mod=reactionsOrResult}else if(moduleRecordPromise&&!mod)entry.module=mod=moduleRecordPromise;@setStateToMax(entry,@ModuleLink);var dependenciesMap=mod.dependenciesMap,requestedModules=loader.requestedModules(mod),dependencies=@newArrayWithSize(requestedModules.length);for(var i=0,length=requestedModules.length;i<length;++i){var depName=requestedModules[i],depKey=depName[0]===\"/\"\?depName:loader.resolve(depName,key),depEntry=loader.ensureRegistered(depKey);if(depEntry.state<@ModuleLink)queue.push(depKey);@putByValDirect(dependencies,i,depEntry),dependenciesMap.@set(depName,depEntry)}entry.dependencies=dependencies,entry.instantiate=@Promise.@resolve(entry),entry.satisfy=@Promise.@resolve(entry),entry.isSatisfied=!0,key=queue.shift();while(key&&(loader.registry.@get(key)\?.state\?\?@ModuleFetch)>=@ModuleLink)key=queue.shift()}var linkAndEvaluateResult=loader.linkAndEvaluateModule(resolvedSpecifier,@undefined);if(linkAndEvaluateResult&&@isPromise(linkAndEvaluateResult))@throwTypeError(`require() async module \\\"${resolvedSpecifier}\\\" is unsupported. use \"await import()\" instead.`);return loader.registry.@get(resolvedSpecifier)})\n";
+/* TransformStreamInternals.ts */
+// createTransformStream
+const JSC::ConstructAbility s_transformStreamInternalsCreateTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsCreateTransformStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsCreateTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsCreateTransformStreamCodeLength = 1170;
+static const JSC::Intrinsic s_transformStreamInternalsCreateTransformStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsCreateTransformStreamCode = "(function (startAlgorithm, transformAlgorithm, flushAlgorithm, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) {\"use strict\";\n if (writableHighWaterMark === @undefined)\n writableHighWaterMark = 1;\n if (writableSizeAlgorithm === @undefined)\n writableSizeAlgorithm = () => 1;\n if (readableHighWaterMark === @undefined)\n readableHighWaterMark = 0;\n if (readableSizeAlgorithm === @undefined)\n readableSizeAlgorithm = () => 1;\n const transform = {};\n @putByIdDirectPrivate(transform, \"TransformStream\", !0);\n const stream = new @TransformStream(transform), startPromiseCapability = @newPromiseCapability(@Promise);\n @initializeTransformStream(stream, startPromiseCapability.promise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n const controller = new @TransformStreamDefaultController;\n return @setUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm), startAlgorithm().@then(() => {\n startPromiseCapability.resolve.@call();\n }, (error) => {\n startPromiseCapability.reject.@call(@undefined, error);\n }), stream;\n})\n";
-// requireESM
-const JSC::ConstructAbility s_importMetaObjectRequireESMCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_importMetaObjectRequireESMCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_importMetaObjectRequireESMCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_importMetaObjectRequireESMCodeLength = 364;
-static const JSC::Intrinsic s_importMetaObjectRequireESMCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_importMetaObjectRequireESMCode = "(function (resolved){\"use strict\";var entry=@Loader.registry.@get(resolved);if(!entry||!entry.evaluated)entry=@loadCJS2ESM(resolved);if(!entry||!entry.evaluated||!entry.module)@throwTypeError(`require() failed to evaluate module \"${resolved}\". This is an internal consistentency error.`);var exports=@Loader.getModuleNamespaceObject(entry.module);return exports})\n";
+// initializeTransformStream
+const JSC::ConstructAbility s_transformStreamInternalsInitializeTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsInitializeTransformStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsInitializeTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsInitializeTransformStreamCodeLength = 1754;
+static const JSC::Intrinsic s_transformStreamInternalsInitializeTransformStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsInitializeTransformStreamCode = "(function (stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) {\"use strict\";\n const startAlgorithm = () => {\n return startPromise;\n }, writeAlgorithm = (chunk) => {\n return @transformStreamDefaultSinkWriteAlgorithm(stream, chunk);\n }, abortAlgorithm = (reason) => {\n return @transformStreamDefaultSinkAbortAlgorithm(stream, reason);\n }, closeAlgorithm = () => {\n return @transformStreamDefaultSinkCloseAlgorithm(stream);\n }, writable = @createWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm), pullAlgorithm = () => {\n return @transformStreamDefaultSourcePullAlgorithm(stream);\n }, cancelAlgorithm = (reason) => {\n return @transformStreamErrorWritableAndUnblockWrite(stream, reason), @Promise.@resolve();\n }, underlyingSource = {};\n @putByIdDirectPrivate(underlyingSource, \"start\", startAlgorithm), @putByIdDirectPrivate(underlyingSource, \"pull\", pullAlgorithm), @putByIdDirectPrivate(underlyingSource, \"cancel\", cancelAlgorithm);\n const options = {};\n @putByIdDirectPrivate(options, \"size\", readableSizeAlgorithm), @putByIdDirectPrivate(options, \"highWaterMark\", readableHighWaterMark);\n const readable = new @ReadableStream(underlyingSource, options);\n @putByIdDirectPrivate(stream, \"writable\", writable), @putByIdDirectPrivate(stream, \"internalWritable\", @getInternalWritableStream(writable)), @putByIdDirectPrivate(stream, \"readable\", readable), @putByIdDirectPrivate(stream, \"backpressure\", @undefined), @putByIdDirectPrivate(stream, \"backpressureChangePromise\", @undefined), @transformStreamSetBackpressure(stream, !0), @putByIdDirectPrivate(stream, \"controller\", @undefined);\n})\n";
-// internalRequire
-const JSC::ConstructAbility s_importMetaObjectInternalRequireCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_importMetaObjectInternalRequireCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_importMetaObjectInternalRequireCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_importMetaObjectInternalRequireCodeLength = 857;
-static const JSC::Intrinsic s_importMetaObjectInternalRequireCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_importMetaObjectInternalRequireCode = "(function (id){\"use strict\";var cached=@requireMap.@get(id);const last5=id.substring(id.length-5);if(cached)return cached.exports;if(last5===\".json\"){var fs=globalThis[Symbol.for(\"_fs\")]||=@Bun.fs(),exports=JSON.parse(fs.readFileSync(id,\"utf8\"));return @requireMap.@set(id,@createCommonJSModule(id,exports,!0)),exports}else if(last5===\".node\"){const module=@createCommonJSModule(id,{},!0);return process.dlopen(module,id),@requireMap.@set(id,module),module.exports}else if(last5===\".toml\"){var fs=globalThis[Symbol.for(\"_fs\")]||=@Bun.fs(),exports=@Bun.TOML.parse(fs.readFileSync(id,\"utf8\"));return @requireMap.@set(id,@createCommonJSModule(id,exports,!0)),exports}else{var exports=@requireESM(id);const cachedModule=@requireMap.@get(id);if(cachedModule)return cachedModule.exports;return @requireMap.@set(id,@createCommonJSModule(id,exports,!0)),exports}})\n";
+// isTransformStream
+const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsIsTransformStreamCodeLength = 112;
+static const JSC::Intrinsic s_transformStreamInternalsIsTransformStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsIsTransformStreamCode = "(function (stream) {\"use strict\";\n return @isObject(stream) && !!@getByIdDirectPrivate(stream, \"readable\");\n})\n";
-// createRequireCache
-const JSC::ConstructAbility s_importMetaObjectCreateRequireCacheCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_importMetaObjectCreateRequireCacheCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_importMetaObjectCreateRequireCacheCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_importMetaObjectCreateRequireCacheCodeLength = 978;
-static const JSC::Intrinsic s_importMetaObjectCreateRequireCacheCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_importMetaObjectCreateRequireCacheCode = "(function (){\"use strict\";var moduleMap=new Map,inner={};return new Proxy(inner,{get(target,key){const entry=@requireMap.@get(key);if(entry)return entry;const esm=@Loader.registry.@get(key);if(esm\?.evaluated){const namespace=@Loader.getModuleNamespaceObject(esm.module),mod=@createCommonJSModule(key,namespace,!0);return @requireMap.@set(key,mod),mod}return inner[key]},set(target,key,value){return @requireMap.@set(key,value),!0},has(target,key){return @requireMap.@has(key)||@Loader.registry.@has(key)},deleteProperty(target,key){return moduleMap.@delete(key),@requireMap.@delete(key),@Loader.registry.@delete(key),!0},ownKeys(target){var array=[...@requireMap.@keys()];const registryKeys=[...@Loader.registry.@keys()];for(let key of registryKeys)if(!array.includes(key))@arrayPush(array,key);return array},getPrototypeOf(target){return null},getOwnPropertyDescriptor(target,key){if(@requireMap.@has(key)||@Loader.registry.@has(key))return{configurable:!0,enumerable:!0}}})})\n";
+// isTransformStreamDefaultController
+const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsIsTransformStreamDefaultControllerCodeLength = 134;
+static const JSC::Intrinsic s_transformStreamInternalsIsTransformStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsIsTransformStreamDefaultControllerCode = "(function (controller) {\"use strict\";\n return @isObject(controller) && !!@getByIdDirectPrivate(controller, \"transformAlgorithm\");\n})\n";
-// main
-const JSC::ConstructAbility s_importMetaObjectMainCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_importMetaObjectMainCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_importMetaObjectMainCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_importMetaObjectMainCodeLength = 76;
-static const JSC::Intrinsic s_importMetaObjectMainCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_importMetaObjectMainCode = "(function (){\"use strict\";return this.path===@Bun.main&&@Bun.isMainThread})\n";
+// setUpTransformStreamDefaultController
+const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeLength = 343;
+static const JSC::Intrinsic s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerCode = "(function (stream, controller, transformAlgorithm, flushAlgorithm) {\"use strict\";\n @putByIdDirectPrivate(controller, \"stream\", stream), @putByIdDirectPrivate(stream, \"controller\", controller), @putByIdDirectPrivate(controller, \"transformAlgorithm\", transformAlgorithm), @putByIdDirectPrivate(controller, \"flushAlgorithm\", flushAlgorithm);\n})\n";
+
+// setUpTransformStreamDefaultControllerFromTransformer
+const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeLength = 845;
+static const JSC::Intrinsic s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode = "(function (stream, transformer, transformerDict) {\"use strict\";\n const controller = new @TransformStreamDefaultController;\n let transformAlgorithm = (chunk) => {\n try {\n @transformStreamDefaultControllerEnqueue(controller, chunk);\n } catch (e) {\n return @Promise.@reject(e);\n }\n return @Promise.@resolve();\n }, flushAlgorithm = () => {\n return @Promise.@resolve();\n };\n if (\"transform\" in transformerDict)\n transformAlgorithm = (chunk) => {\n return @promiseInvokeOrNoopMethod(transformer, transformerDict.transform, [chunk, controller]);\n };\n if (\"flush\" in transformerDict)\n flushAlgorithm = () => {\n return @promiseInvokeOrNoopMethod(transformer, transformerDict.flush, [controller]);\n };\n @setUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm);\n})\n";
+
+// transformStreamDefaultControllerClearAlgorithms
+const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeLength = 169;
+static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCode = "(function (controller) {\"use strict\";\n @putByIdDirectPrivate(controller, \"transformAlgorithm\", !0), @putByIdDirectPrivate(controller, \"flushAlgorithm\", @undefined);\n})\n";
+
+// transformStreamDefaultControllerEnqueue
+const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeLength = 786;
+static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCode = "(function (controller, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\"), readable = @getByIdDirectPrivate(stream, \"readable\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(readableController))\n @throwTypeError(\"TransformStream.readable cannot close or enqueue\");\n try {\n @readableStreamDefaultControllerEnqueue(readableController, chunk);\n } catch (e) {\n throw @transformStreamErrorWritableAndUnblockWrite(stream, e), @getByIdDirectPrivate(readable, \"storedError\");\n }\n if (!@readableStreamDefaultControllerShouldCallPull(readableController) !== @getByIdDirectPrivate(stream, \"backpressure\"))\n @transformStreamSetBackpressure(stream, !0);\n})\n";
+
+// transformStreamDefaultControllerError
+const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeLength = 117;
+static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsTransformStreamDefaultControllerErrorCode = "(function (controller, e) {\"use strict\";\n @transformStreamError(@getByIdDirectPrivate(controller, \"stream\"), e);\n})\n";
+
+// transformStreamDefaultControllerPerformTransform
+const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeLength = 415;
+static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode = "(function (controller, chunk) {\"use strict\";\n const promiseCapability = @newPromiseCapability(@Promise);\n return @getByIdDirectPrivate(controller, \"transformAlgorithm\").@call(@undefined, chunk).@then(() => {\n promiseCapability.resolve();\n }, (r) => {\n @transformStreamError(@getByIdDirectPrivate(controller, \"stream\"), r), promiseCapability.reject.@call(@undefined, r);\n }), promiseCapability.promise;\n})\n";
+
+// transformStreamDefaultControllerTerminate
+const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeLength = 508;
+static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsTransformStreamDefaultControllerTerminateCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\"), readable = @getByIdDirectPrivate(stream, \"readable\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\");\n if (@readableStreamDefaultControllerCanCloseOrEnqueue(readableController))\n @readableStreamDefaultControllerClose(readableController);\n const error = @makeTypeError(\"the stream has been terminated\");\n @transformStreamErrorWritableAndUnblockWrite(stream, error);\n})\n";
+
+// transformStreamDefaultSinkAbortAlgorithm
+const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeLength = 114;
+static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCode = "(function (stream, reason) {\"use strict\";\n return @transformStreamError(stream, reason), @Promise.@resolve();\n})\n";
+
+// transformStreamDefaultSinkCloseAlgorithm
+const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeLength = 1113;
+static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode = "(function (stream) {\"use strict\";\n const readable = @getByIdDirectPrivate(stream, \"readable\"), controller = @getByIdDirectPrivate(stream, \"controller\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\"), flushAlgorithm = @getByIdDirectPrivate(controller, \"flushAlgorithm\"), flushPromise = @getByIdDirectPrivate(controller, \"flushAlgorithm\").@call();\n @transformStreamDefaultControllerClearAlgorithms(controller);\n const promiseCapability = @newPromiseCapability(@Promise);\n return flushPromise.@then(() => {\n if (@getByIdDirectPrivate(readable, \"state\") === 3) {\n promiseCapability.reject.@call(@undefined, @getByIdDirectPrivate(readable, \"storedError\"));\n return;\n }\n if (@readableStreamDefaultControllerCanCloseOrEnqueue(readableController))\n @readableStreamDefaultControllerClose(readableController);\n promiseCapability.resolve();\n }, (r) => {\n @transformStreamError(@getByIdDirectPrivate(controller, \"stream\"), r), promiseCapability.reject.@call(@undefined, @getByIdDirectPrivate(readable, \"storedError\"));\n }), promiseCapability.promise;\n})\n";
+
+// transformStreamDefaultSinkWriteAlgorithm
+const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength = 971;
+static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode = "(function (stream, chunk) {\"use strict\";\n const writable = @getByIdDirectPrivate(stream, \"internalWritable\"), controller = @getByIdDirectPrivate(stream, \"controller\");\n if (@getByIdDirectPrivate(stream, \"backpressure\")) {\n const promiseCapability = @newPromiseCapability(@Promise);\n return @getByIdDirectPrivate(stream, \"backpressureChangePromise\").promise.@then(() => {\n if (@getByIdDirectPrivate(writable, \"state\") === \"erroring\") {\n promiseCapability.reject.@call(@undefined, @getByIdDirectPrivate(writable, \"storedError\"));\n return;\n }\n @transformStreamDefaultControllerPerformTransform(controller, chunk).@then(() => {\n promiseCapability.resolve();\n }, (e) => {\n promiseCapability.reject.@call(@undefined, e);\n });\n }, (e) => {\n promiseCapability.reject.@call(@undefined, e);\n }), promiseCapability.promise;\n }\n return @transformStreamDefaultControllerPerformTransform(controller, chunk);\n})\n";
+
+// transformStreamDefaultSourcePullAlgorithm
+const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeLength = 159;
+static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCode = "(function (stream) {\"use strict\";\n return @transformStreamSetBackpressure(stream, !1), @getByIdDirectPrivate(stream, \"backpressureChangePromise\").promise;\n})\n";
+
+// transformStreamError
+const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsTransformStreamErrorCodeLength = 305;
+static const JSC::Intrinsic s_transformStreamInternalsTransformStreamErrorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsTransformStreamErrorCode = "(function (stream, e) {\"use strict\";\n const readable = @getByIdDirectPrivate(stream, \"readable\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\");\n @readableStreamDefaultControllerError(readableController, e), @transformStreamErrorWritableAndUnblockWrite(stream, e);\n})\n";
+
+// transformStreamErrorWritableAndUnblockWrite
+const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeLength = 406;
+static const JSC::Intrinsic s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCode = "(function (stream, e) {\"use strict\";\n @transformStreamDefaultControllerClearAlgorithms(@getByIdDirectPrivate(stream, \"controller\"));\n const writable = @getByIdDirectPrivate(stream, \"internalWritable\");\n if (@writableStreamDefaultControllerErrorIfNeeded(@getByIdDirectPrivate(writable, \"controller\"), e), @getByIdDirectPrivate(stream, \"backpressure\"))\n @transformStreamSetBackpressure(stream, !1);\n})\n";
+
+// transformStreamSetBackpressure
+const JSC::ConstructAbility s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamSetBackpressureCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_transformStreamInternalsTransformStreamSetBackpressureCodeLength = 398;
+static const JSC::Intrinsic s_transformStreamInternalsTransformStreamSetBackpressureCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_transformStreamInternalsTransformStreamSetBackpressureCode = "(function (stream, backpressure) {\"use strict\";\n const backpressureChangePromise = @getByIdDirectPrivate(stream, \"backpressureChangePromise\");\n if (backpressureChangePromise !== @undefined)\n backpressureChangePromise.resolve.@call();\n @putByIdDirectPrivate(stream, \"backpressureChangePromise\", @newPromiseCapability(@Promise)), @putByIdDirectPrivate(stream, \"backpressure\", backpressure);\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
{\
JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().importMetaObjectBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().importMetaObjectBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+ return clientData->builtinFunctions().transformStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().transformStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
}
-WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
-/* CountQueuingStrategy.ts */
-// highWaterMark
-const JSC::ConstructAbility s_countQueuingStrategyHighWaterMarkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_countQueuingStrategyHighWaterMarkCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_countQueuingStrategyHighWaterMarkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_countQueuingStrategyHighWaterMarkCodeLength = 241;
-static const JSC::Intrinsic s_countQueuingStrategyHighWaterMarkCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_countQueuingStrategyHighWaterMarkCode = "(function (){\"use strict\";const highWaterMark=@getByIdDirectPrivate(this,\"highWaterMark\");if(highWaterMark===@undefined)@throwTypeError(\"CountQueuingStrategy.highWaterMark getter called on incompatible |this| value.\");return highWaterMark})\n";
-
-// size
-const JSC::ConstructAbility s_countQueuingStrategySizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_countQueuingStrategySizeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_countQueuingStrategySizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_countQueuingStrategySizeCodeLength = 37;
-static const JSC::Intrinsic s_countQueuingStrategySizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_countQueuingStrategySizeCode = "(function (){\"use strict\";return 1})\n";
+/* UtilInspect.ts */
+// getStylizeWithColor
+const JSC::ConstructAbility s_utilInspectGetStylizeWithColorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_utilInspectGetStylizeWithColorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_utilInspectGetStylizeWithColorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_utilInspectGetStylizeWithColorCodeLength = 329;
+static const JSC::Intrinsic s_utilInspectGetStylizeWithColorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_utilInspectGetStylizeWithColorCode = "(function (inspect) {\"use strict\";\n return function stylizeWithColor(str, styleType) {\n const style = inspect.styles[styleType];\n if (style !== @undefined) {\n const color = inspect.colors[style];\n if (color !== @undefined)\n return `\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`;\n }\n return str;\n };\n})\n";
-// initializeCountQueuingStrategy
-const JSC::ConstructAbility s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_countQueuingStrategyInitializeCountQueuingStrategyCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_countQueuingStrategyInitializeCountQueuingStrategyCodeLength = 139;
-static const JSC::Intrinsic s_countQueuingStrategyInitializeCountQueuingStrategyCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_countQueuingStrategyInitializeCountQueuingStrategyCode = "(function (parameters){\"use strict\";@putByIdDirectPrivate(this,\"highWaterMark\",@extractHighWaterMarkFromQueuingStrategyInit(parameters))})\n";
+// stylizeWithNoColor
+const JSC::ConstructAbility s_utilInspectStylizeWithNoColorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_utilInspectStylizeWithNoColorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_utilInspectStylizeWithNoColorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_utilInspectStylizeWithNoColorCodeLength = 48;
+static const JSC::Intrinsic s_utilInspectStylizeWithNoColorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_utilInspectStylizeWithNoColorCode = "(function (str) {\"use strict\";\n return str;\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
{\
JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().countQueuingStrategyBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().countQueuingStrategyBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+ return clientData->builtinFunctions().utilInspectBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().utilInspectBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
}
-WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
-/* ReadableStreamBYOBRequest.ts */
-// initializeReadableStreamBYOBRequest
-const JSC::ConstructAbility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeLength = 267;
-static const JSC::Intrinsic s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCode = "(function (controller,view){\"use strict\";if(arguments.length!==3&&arguments[2]!==@isReadableStream)@throwTypeError(\"ReadableStreamBYOBRequest constructor should not be called directly\");return @privateInitializeReadableStreamBYOBRequest.@call(this,controller,view)})\n";
-
-// respond
-const JSC::ConstructAbility s_readableStreamBYOBRequestRespondCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamBYOBRequestRespondCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamBYOBRequestRespondCodeLength = 452;
-static const JSC::Intrinsic s_readableStreamBYOBRequestRespondCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamBYOBRequestRespondCode = "(function (bytesWritten){\"use strict\";if(!@isReadableStreamBYOBRequest(this))throw @makeThisTypeError(\"ReadableStreamBYOBRequest\",\"respond\");if(@getByIdDirectPrivate(this,\"associatedReadableByteStreamController\")===@undefined)@throwTypeError(\"ReadableStreamBYOBRequest.associatedReadableByteStreamController is undefined\");return @readableByteStreamControllerRespond(@getByIdDirectPrivate(this,\"associatedReadableByteStreamController\"),bytesWritten)})\n";
-
-// respondWithNewView
-const JSC::ConstructAbility s_readableStreamBYOBRequestRespondWithNewViewCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamBYOBRequestRespondWithNewViewCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondWithNewViewCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamBYOBRequestRespondWithNewViewCodeLength = 607;
-static const JSC::Intrinsic s_readableStreamBYOBRequestRespondWithNewViewCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamBYOBRequestRespondWithNewViewCode = "(function (view){\"use strict\";if(!@isReadableStreamBYOBRequest(this))throw @makeThisTypeError(\"ReadableStreamBYOBRequest\",\"respond\");if(@getByIdDirectPrivate(this,\"associatedReadableByteStreamController\")===@undefined)@throwTypeError(\"ReadableStreamBYOBRequest.associatedReadableByteStreamController is undefined\");if(!@isObject(view))@throwTypeError(\"Provided view is not an object\");if(!@ArrayBuffer.@isView(view))@throwTypeError(\"Provided view is not an ArrayBufferView\");return @readableByteStreamControllerRespondWithNewView(@getByIdDirectPrivate(this,\"associatedReadableByteStreamController\"),view)})\n";
+/* WritableStreamDefaultController.ts */
+// error
+const JSC::ConstructAbility s_writableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamDefaultControllerErrorCodeLength = 349;
+static const JSC::Intrinsic s_writableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamDefaultControllerErrorCode = "(function (e) {\"use strict\";\n if (@getByIdDirectPrivate(this, \"abortSteps\") === @undefined)\n throw @makeThisTypeError(\"WritableStreamDefaultController\", \"error\");\n const stream = @getByIdDirectPrivate(this, \"stream\");\n if (@getByIdDirectPrivate(stream, \"state\") !== \"writable\")\n return;\n @writableStreamDefaultControllerError(this, e);\n})\n";
-// view
-const JSC::ConstructAbility s_readableStreamBYOBRequestViewCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamBYOBRequestViewCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamBYOBRequestViewCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamBYOBRequestViewCodeLength = 172;
-static const JSC::Intrinsic s_readableStreamBYOBRequestViewCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamBYOBRequestViewCode = "(function (){\"use strict\";if(!@isReadableStreamBYOBRequest(this))throw @makeGetterTypeError(\"ReadableStreamBYOBRequest\",\"view\");return @getByIdDirectPrivate(this,\"view\")})\n";
+// initializeWritableStreamDefaultController
+const JSC::ConstructAbility s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeLength = 436;
+static const JSC::Intrinsic s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCode = "(function () {\"use strict\";\n return @putByIdDirectPrivate(this, \"queue\", @newQueue()), @putByIdDirectPrivate(this, \"abortSteps\", (reason) => {\n const result = @getByIdDirectPrivate(this, \"abortAlgorithm\").@call(@undefined, reason);\n return @writableStreamDefaultControllerClearAlgorithms(this), result;\n }), @putByIdDirectPrivate(this, \"errorSteps\", () => {\n @resetQueue(@getByIdDirectPrivate(this, \"queue\"));\n }), this;\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
{\
JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().readableStreamBYOBRequestBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamBYOBRequestBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+ return clientData->builtinFunctions().writableStreamDefaultControllerBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().writableStreamDefaultControllerBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
}
-WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
/* WritableStreamDefaultWriter.ts */
-// initializeWritableStreamDefaultWriter
-const JSC::ConstructAbility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeLength = 301;
-static const JSC::Intrinsic s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCode = "(function (stream){\"use strict\";const internalStream=@getInternalWritableStream(stream);if(internalStream)stream=internalStream;if(!@isWritableStream(stream))@throwTypeError(\"WritableStreamDefaultWriter constructor takes a WritableStream\");return @setUpWritableStreamDefaultWriter(this,stream),this})\n";
+// abort
+const JSC::ConstructAbility s_writableStreamDefaultWriterAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamDefaultWriterAbortCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamDefaultWriterAbortCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamDefaultWriterAbortCodeLength = 379;
+static const JSC::Intrinsic s_writableStreamDefaultWriterAbortCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamDefaultWriterAbortCode = "(function (reason) {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\", \"abort\"));\n if (@getByIdDirectPrivate(this, \"stream\") === @undefined)\n return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter has no stream\"));\n return @writableStreamDefaultWriterAbort(this, reason);\n})\n";
+
+// close
+const JSC::ConstructAbility s_writableStreamDefaultWriterCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamDefaultWriterCloseCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamDefaultWriterCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamDefaultWriterCloseCodeLength = 534;
+static const JSC::Intrinsic s_writableStreamDefaultWriterCloseCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamDefaultWriterCloseCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\", \"close\"));\n const stream = @getByIdDirectPrivate(this, \"stream\");\n if (stream === @undefined)\n return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter has no stream\"));\n if (@writableStreamCloseQueuedOrInFlight(stream))\n return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter is being closed\"));\n return @writableStreamDefaultWriterClose(this);\n})\n";
// closed
const JSC::ConstructAbility s_writableStreamDefaultWriterClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_writableStreamDefaultWriterClosedCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_writableStreamDefaultWriterClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamDefaultWriterClosedCodeLength = 214;
+const int s_writableStreamDefaultWriterClosedCodeLength = 231;
static const JSC::Intrinsic s_writableStreamDefaultWriterClosedCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamDefaultWriterClosedCode = "(function (){\"use strict\";if(!@isWritableStreamDefaultWriter(this))return @Promise.@reject(@makeGetterTypeError(\"WritableStreamDefaultWriter\",\"closed\"));return @getByIdDirectPrivate(this,\"closedPromise\").promise})\n";
+const char* const s_writableStreamDefaultWriterClosedCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeGetterTypeError(\"WritableStreamDefaultWriter\", \"closed\"));\n return @getByIdDirectPrivate(this, \"closedPromise\").promise;\n})\n";
// desiredSize
const JSC::ConstructAbility s_writableStreamDefaultWriterDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_writableStreamDefaultWriterDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_writableStreamDefaultWriterDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamDefaultWriterDesiredSizeCodeLength = 309;
+const int s_writableStreamDefaultWriterDesiredSizeCodeLength = 337;
static const JSC::Intrinsic s_writableStreamDefaultWriterDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamDefaultWriterDesiredSizeCode = "(function (){\"use strict\";if(!@isWritableStreamDefaultWriter(this))throw @makeThisTypeError(\"WritableStreamDefaultWriter\",\"desiredSize\");if(@getByIdDirectPrivate(this,\"stream\")===@undefined)@throwTypeError(\"WritableStreamDefaultWriter has no stream\");return @writableStreamDefaultWriterGetDesiredSize(this)})\n";
+const char* const s_writableStreamDefaultWriterDesiredSizeCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n throw @makeThisTypeError(\"WritableStreamDefaultWriter\", \"desiredSize\");\n if (@getByIdDirectPrivate(this, \"stream\") === @undefined)\n @throwTypeError(\"WritableStreamDefaultWriter has no stream\");\n return @writableStreamDefaultWriterGetDesiredSize(this);\n})\n";
+
+// initializeWritableStreamDefaultWriter
+const JSC::ConstructAbility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeLength = 334;
+static const JSC::Intrinsic s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCode = "(function (stream) {\"use strict\";\n const internalStream = @getInternalWritableStream(stream);\n if (internalStream)\n stream = internalStream;\n if (!@isWritableStream(stream))\n @throwTypeError(\"WritableStreamDefaultWriter constructor takes a WritableStream\");\n return @setUpWritableStreamDefaultWriter(this, stream), this;\n})\n";
// ready
const JSC::ConstructAbility s_writableStreamDefaultWriterReadyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_writableStreamDefaultWriterReadyCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_writableStreamDefaultWriterReadyCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamDefaultWriterReadyCodeLength = 210;
+const int s_writableStreamDefaultWriterReadyCodeLength = 227;
static const JSC::Intrinsic s_writableStreamDefaultWriterReadyCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamDefaultWriterReadyCode = "(function (){\"use strict\";if(!@isWritableStreamDefaultWriter(this))return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\",\"ready\"));return @getByIdDirectPrivate(this,\"readyPromise\").promise})\n";
-
-// abort
-const JSC::ConstructAbility s_writableStreamDefaultWriterAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamDefaultWriterAbortCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamDefaultWriterAbortCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamDefaultWriterAbortCodeLength = 350;
-static const JSC::Intrinsic s_writableStreamDefaultWriterAbortCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamDefaultWriterAbortCode = "(function (reason){\"use strict\";if(!@isWritableStreamDefaultWriter(this))return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\",\"abort\"));if(@getByIdDirectPrivate(this,\"stream\")===@undefined)return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter has no stream\"));return @writableStreamDefaultWriterAbort(this,reason)})\n";
-
-// close
-const JSC::ConstructAbility s_writableStreamDefaultWriterCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamDefaultWriterCloseCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamDefaultWriterCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamDefaultWriterCloseCodeLength = 492;
-static const JSC::Intrinsic s_writableStreamDefaultWriterCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamDefaultWriterCloseCode = "(function (){\"use strict\";if(!@isWritableStreamDefaultWriter(this))return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\",\"close\"));const stream=@getByIdDirectPrivate(this,\"stream\");if(stream===@undefined)return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter has no stream\"));if(@writableStreamCloseQueuedOrInFlight(stream))return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter is being closed\"));return @writableStreamDefaultWriterClose(this)})\n";
+const char* const s_writableStreamDefaultWriterReadyCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\", \"ready\"));\n return @getByIdDirectPrivate(this, \"readyPromise\").promise;\n})\n";
// releaseLock
const JSC::ConstructAbility s_writableStreamDefaultWriterReleaseLockCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_writableStreamDefaultWriterReleaseLockCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_writableStreamDefaultWriterReleaseLockCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamDefaultWriterReleaseLockCodeLength = 241;
+const int s_writableStreamDefaultWriterReleaseLockCodeLength = 269;
static const JSC::Intrinsic s_writableStreamDefaultWriterReleaseLockCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamDefaultWriterReleaseLockCode = "(function (){\"use strict\";if(!@isWritableStreamDefaultWriter(this))throw @makeThisTypeError(\"WritableStreamDefaultWriter\",\"releaseLock\");if(@getByIdDirectPrivate(this,\"stream\")===@undefined)return;@writableStreamDefaultWriterRelease(this)})\n";
+const char* const s_writableStreamDefaultWriterReleaseLockCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n throw @makeThisTypeError(\"WritableStreamDefaultWriter\", \"releaseLock\");\n if (@getByIdDirectPrivate(this, \"stream\") === @undefined)\n return;\n @writableStreamDefaultWriterRelease(this);\n})\n";
// write
const JSC::ConstructAbility s_writableStreamDefaultWriterWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_writableStreamDefaultWriterWriteCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_writableStreamDefaultWriterWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamDefaultWriterWriteCodeLength = 348;
+const int s_writableStreamDefaultWriterWriteCodeLength = 377;
static const JSC::Intrinsic s_writableStreamDefaultWriterWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamDefaultWriterWriteCode = "(function (chunk){\"use strict\";if(!@isWritableStreamDefaultWriter(this))return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\",\"write\"));if(@getByIdDirectPrivate(this,\"stream\")===@undefined)return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter has no stream\"));return @writableStreamDefaultWriterWrite(this,chunk)})\n";
+const char* const s_writableStreamDefaultWriterWriteCode = "(function (chunk) {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\", \"write\"));\n if (@getByIdDirectPrivate(this, \"stream\") === @undefined)\n return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter has no stream\"));\n return @writableStreamDefaultWriterWrite(this, chunk);\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
@@ -2467,561 +2635,417 @@ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
-/* ReadableStream.ts */
-// initializeReadableStream
-const JSC::ConstructAbility s_readableStreamInitializeReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamInitializeReadableStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamInitializeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInitializeReadableStreamCodeLength = 2702;
-static const JSC::Intrinsic s_readableStreamInitializeReadableStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInitializeReadableStreamCode = "(function (underlyingSource,strategy){\"use strict\";if(underlyingSource===@undefined)underlyingSource={@bunNativeType:0,@bunNativePtr:0,@lazy:!1};if(strategy===@undefined)strategy={};if(!@isObject(underlyingSource))@throwTypeError(\"ReadableStream constructor takes an object as first argument\");if(strategy!==@undefined&&!@isObject(strategy))@throwTypeError(\"ReadableStream constructor takes an object as second argument, if any\");@putByIdDirectPrivate(this,\"state\",@streamReadable),@putByIdDirectPrivate(this,\"reader\",@undefined),@putByIdDirectPrivate(this,\"storedError\",@undefined),@putByIdDirectPrivate(this,\"disturbed\",!1),@putByIdDirectPrivate(this,\"readableStreamController\",null),@putByIdDirectPrivate(this,\"bunNativeType\",@getByIdDirectPrivate(underlyingSource,\"bunNativeType\")\?\?0),@putByIdDirectPrivate(this,\"bunNativePtr\",@getByIdDirectPrivate(underlyingSource,\"bunNativePtr\")\?\?0),@putByIdDirectPrivate(this,\"asyncContext\",@getInternalField(@asyncContext,0));const isDirect=underlyingSource.type===\"direct\",isUnderlyingSourceLazy=!!underlyingSource.@lazy,isLazy=isDirect||isUnderlyingSourceLazy;if(@getByIdDirectPrivate(underlyingSource,\"pull\")!==@undefined&&!isLazy){const size=@getByIdDirectPrivate(strategy,\"size\"),highWaterMark=@getByIdDirectPrivate(strategy,\"highWaterMark\");return @putByIdDirectPrivate(this,\"highWaterMark\",highWaterMark),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@setupReadableStreamDefaultController(this,underlyingSource,size,highWaterMark!==@undefined\?highWaterMark:1,@getByIdDirectPrivate(underlyingSource,\"start\"),@getByIdDirectPrivate(underlyingSource,\"pull\"),@getByIdDirectPrivate(underlyingSource,\"cancel\")),this}if(isDirect)@putByIdDirectPrivate(this,\"underlyingSource\",underlyingSource),@putByIdDirectPrivate(this,\"highWaterMark\",@getByIdDirectPrivate(strategy,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",()=>@createReadableStreamController(this,underlyingSource,strategy));else if(isLazy){const autoAllocateChunkSize=underlyingSource.autoAllocateChunkSize;@putByIdDirectPrivate(this,\"highWaterMark\",@undefined),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"highWaterMark\",autoAllocateChunkSize||@getByIdDirectPrivate(strategy,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",()=>{const instance=@lazyLoadStream(this,autoAllocateChunkSize);if(instance)@createReadableStreamController(this,instance,strategy)})}else @putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"highWaterMark\",@getByIdDirectPrivate(strategy,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",@undefined),@createReadableStreamController(this,underlyingSource,strategy);return this})\n";
-
-// readableStreamToArray
-const JSC::ConstructAbility s_readableStreamReadableStreamToArrayCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamReadableStreamToArrayCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
-const int s_readableStreamReadableStreamToArrayCodeLength = 238;
-static const JSC::Intrinsic s_readableStreamReadableStreamToArrayCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamReadableStreamToArrayCode = "(function (stream){\"use strict\";var underlyingSource=@getByIdDirectPrivate(stream,\"underlyingSource\");if(underlyingSource!==@undefined)return @readableStreamToArrayDirect(stream,underlyingSource);return @readableStreamIntoArray(stream)})\n";
-
-// readableStreamToText
-const JSC::ConstructAbility s_readableStreamReadableStreamToTextCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamReadableStreamToTextCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamReadableStreamToTextCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
-const int s_readableStreamReadableStreamToTextCodeLength = 236;
-static const JSC::Intrinsic s_readableStreamReadableStreamToTextCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamReadableStreamToTextCode = "(function (stream){\"use strict\";var underlyingSource=@getByIdDirectPrivate(stream,\"underlyingSource\");if(underlyingSource!==@undefined)return @readableStreamToTextDirect(stream,underlyingSource);return @readableStreamIntoText(stream)})\n";
-
-// readableStreamToArrayBuffer
-const JSC::ConstructAbility s_readableStreamReadableStreamToArrayBufferCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamReadableStreamToArrayBufferCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayBufferCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
-const int s_readableStreamReadableStreamToArrayBufferCodeLength = 355;
-static const JSC::Intrinsic s_readableStreamReadableStreamToArrayBufferCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamReadableStreamToArrayBufferCode = "(function (stream){\"use strict\";var underlyingSource=@getByIdDirectPrivate(stream,\"underlyingSource\");if(underlyingSource!==@undefined)return @readableStreamToArrayBufferDirect(stream,underlyingSource);var result=@Bun.readableStreamToArray(stream);if(@isPromise(result))return result.then(@Bun.concatArrayBuffers);return @Bun.concatArrayBuffers(result)})\n";
-
-// readableStreamToFormData
-const JSC::ConstructAbility s_readableStreamReadableStreamToFormDataCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamReadableStreamToFormDataCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamReadableStreamToFormDataCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
-const int s_readableStreamReadableStreamToFormDataCodeLength = 142;
-static const JSC::Intrinsic s_readableStreamReadableStreamToFormDataCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamReadableStreamToFormDataCode = "(function (stream,contentType){\"use strict\";return @Bun.readableStreamToBlob(stream).then((blob)=>{return FormData.from(blob,contentType)})})\n";
-
-// readableStreamToJSON
-const JSC::ConstructAbility s_readableStreamReadableStreamToJSONCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamReadableStreamToJSONCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamReadableStreamToJSONCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
-const int s_readableStreamReadableStreamToJSONCodeLength = 104;
-static const JSC::Intrinsic s_readableStreamReadableStreamToJSONCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamReadableStreamToJSONCode = "(function (stream){\"use strict\";return @Bun.readableStreamToText(stream).@then(globalThis.JSON.parse)})\n";
-
-// readableStreamToBlob
-const JSC::ConstructAbility s_readableStreamReadableStreamToBlobCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamReadableStreamToBlobCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamReadableStreamToBlobCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
-const int s_readableStreamReadableStreamToBlobCodeLength = 126;
-static const JSC::Intrinsic s_readableStreamReadableStreamToBlobCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamReadableStreamToBlobCode = "(function (stream){\"use strict\";return @Promise.resolve(@Bun.readableStreamToArray(stream)).@then((array)=>new Blob(array))})\n";
-
-// consumeReadableStream
-const JSC::ConstructAbility s_readableStreamConsumeReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamConsumeReadableStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamConsumeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
-const int s_readableStreamConsumeReadableStreamCodeLength = 2131;
-static const JSC::Intrinsic s_readableStreamConsumeReadableStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamConsumeReadableStreamCode = "(function (nativePtr,nativeType,inputStream){\"use strict\";const symbol=globalThis.Symbol.for(\"Bun.consumeReadableStreamPrototype\");var cached=globalThis[symbol];if(!cached)cached=globalThis[symbol]=[];var Prototype=cached[nativeType];if(Prototype===@undefined){var[doRead,doError,doReadMany,doClose,onClose,deinit]=globalThis[globalThis.Symbol.for('Bun.lazy')](nativeType);Prototype=class NativeReadableStreamSink{handleError;handleClosed;processResult;constructor(reader,ptr){this.#ptr=ptr,this.#reader=reader,this.#didClose=!1,this.handleError=this._handleError.bind(this),this.handleClosed=this._handleClosed.bind(this),this.processResult=this._processResult.bind(this),reader.closed.then(this.handleClosed,this.handleError)}_handleClosed(){if(this.#didClose)return;this.#didClose=!0;var ptr=this.#ptr;this.#ptr=0,doClose(ptr),deinit(ptr)}_handleError(error){if(this.#didClose)return;this.#didClose=!0;var ptr=this.#ptr;this.#ptr=0,doError(ptr,error),deinit(ptr)}#ptr;#didClose=!1;#reader;_handleReadMany({value,done,size}){if(done){this.handleClosed();return}if(this.#didClose)return;doReadMany(this.#ptr,value,done,size)}read(){if(!this.#ptr)return @throwTypeError(\"ReadableStreamSink is already closed\");return this.processResult(this.#reader.read())}_processResult(result){if(result&&@isPromise(result)){if(@getPromiseInternalField(result,@promiseFieldFlags)&@promiseStateFulfilled){const fulfilledValue=@getPromiseInternalField(result,@promiseFieldReactionsOrResult);if(fulfilledValue)result=fulfilledValue}}if(result&&@isPromise(result))return result.then(this.processResult,this.handleError),null;if(result.done)return this.handleClosed(),0;else if(result.value)return result.value;else return-1}readMany(){if(!this.#ptr)return @throwTypeError(\"ReadableStreamSink is already closed\");return this.processResult(this.#reader.readMany())}};const minlength=nativeType+1;if(cached.length<minlength)cached.length=minlength;@putByValDirect(cached,nativeType,Prototype)}if(@isReadableStreamLocked(inputStream))@throwTypeError(\"Cannot start reading from a locked stream\");return new Prototype(inputStream.getReader(),nativePtr)})\n";
-
-// createEmptyReadableStream
-const JSC::ConstructAbility s_readableStreamCreateEmptyReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamCreateEmptyReadableStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamCreateEmptyReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
-const int s_readableStreamCreateEmptyReadableStreamCodeLength = 114;
-static const JSC::Intrinsic s_readableStreamCreateEmptyReadableStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamCreateEmptyReadableStreamCode = "(function (){\"use strict\";var stream=new @ReadableStream({pull(){}});return @readableStreamClose(stream),stream})\n";
-
-// createNativeReadableStream
-const JSC::ConstructAbility s_readableStreamCreateNativeReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamCreateNativeReadableStreamCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamCreateNativeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
-const int s_readableStreamCreateNativeReadableStreamCodeLength = 181;
-static const JSC::Intrinsic s_readableStreamCreateNativeReadableStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamCreateNativeReadableStreamCode = "(function (nativePtr,nativeType,autoAllocateChunkSize){\"use strict\";return new @ReadableStream({@lazy:!0,@bunNativeType:nativeType,@bunNativePtr:nativePtr,autoAllocateChunkSize})})\n";
-
-// cancel
-const JSC::ConstructAbility s_readableStreamCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamCancelCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamCancelCodeLength = 276;
-static const JSC::Intrinsic s_readableStreamCancelCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamCancelCode = "(function (reason){\"use strict\";if(!@isReadableStream(this))return @Promise.@reject(@makeThisTypeError(\"ReadableStream\",\"cancel\"));if(@isReadableStreamLocked(this))return @Promise.@reject(@makeTypeError(\"ReadableStream is locked\"));return @readableStreamCancel(this,reason)})\n";
-
-// getReader
-const JSC::ConstructAbility s_readableStreamGetReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamGetReaderCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamGetReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamGetReaderCodeLength = 506;
-static const JSC::Intrinsic s_readableStreamGetReaderCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamGetReaderCode = "(function (options){\"use strict\";if(!@isReadableStream(this))throw @makeThisTypeError(\"ReadableStream\",\"getReader\");const mode=@toDictionary(options,{},\"ReadableStream.getReader takes an object as first argument\").mode;if(mode===@undefined){var start_=@getByIdDirectPrivate(this,\"start\");if(start_)@putByIdDirectPrivate(this,\"start\",@undefined),start_();return new @ReadableStreamDefaultReader(this)}if(mode==\"byob\")return new @ReadableStreamBYOBReader(this);@throwTypeError(\"Invalid mode is specified\")})\n";
-
-// pipeThrough
-const JSC::ConstructAbility s_readableStreamPipeThroughCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamPipeThroughCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamPipeThroughCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamPipeThroughCodeLength = 1162;
-static const JSC::Intrinsic s_readableStreamPipeThroughCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamPipeThroughCode = "(function (streams,options){\"use strict\";const transforms=streams,readable=transforms.readable;if(!@isReadableStream(readable))throw @makeTypeError(\"readable should be ReadableStream\");const writable=transforms.writable,internalWritable=@getInternalWritableStream(writable);if(!@isWritableStream(internalWritable))throw @makeTypeError(\"writable should be WritableStream\");let preventClose=!1,preventAbort=!1,preventCancel=!1,signal;if(!@isUndefinedOrNull(options)){if(!@isObject(options))throw @makeTypeError(\"options must be an object\");if(preventAbort=!!options.preventAbort,preventCancel=!!options.preventCancel,preventClose=!!options.preventClose,signal=options.signal,signal!==@undefined&&!@isAbortSignal(signal))throw @makeTypeError(\"options.signal must be AbortSignal\")}if(!@isReadableStream(this))throw @makeThisTypeError(\"ReadableStream\",\"pipeThrough\");if(@isReadableStreamLocked(this))throw @makeTypeError(\"ReadableStream is locked\");if(@isWritableStreamLocked(internalWritable))throw @makeTypeError(\"WritableStream is locked\");return @readableStreamPipeToWritableStream(this,internalWritable,preventClose,preventAbort,preventCancel,signal),readable})\n";
-
-// pipeTo
-const JSC::ConstructAbility s_readableStreamPipeToCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamPipeToCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamPipeToCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamPipeToCodeLength = 1175;
-static const JSC::Intrinsic s_readableStreamPipeToCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamPipeToCode = "(function (destination){\"use strict\";if(!@isReadableStream(this))return @Promise.@reject(@makeThisTypeError(\"ReadableStream\",\"pipeTo\"));if(@isReadableStreamLocked(this))return @Promise.@reject(@makeTypeError(\"ReadableStream is locked\"));let options=@argument(1),preventClose=!1,preventAbort=!1,preventCancel=!1,signal;if(!@isUndefinedOrNull(options)){if(!@isObject(options))return @Promise.@reject(@makeTypeError(\"options must be an object\"));try{preventAbort=!!options.preventAbort,preventCancel=!!options.preventCancel,preventClose=!!options.preventClose,signal=options.signal}catch(e){return @Promise.@reject(e)}if(signal!==@undefined&&!@isAbortSignal(signal))return @Promise.@reject(@makeTypeError(\"options.signal must be AbortSignal\"))}const internalDestination=@getInternalWritableStream(destination);if(!@isWritableStream(internalDestination))return @Promise.@reject(@makeTypeError(\"ReadableStream pipeTo requires a WritableStream\"));if(@isWritableStreamLocked(internalDestination))return @Promise.@reject(@makeTypeError(\"WritableStream is locked\"));return @readableStreamPipeToWritableStream(this,internalDestination,preventClose,preventAbort,preventCancel,signal)})\n";
-
-// tee
-const JSC::ConstructAbility s_readableStreamTeeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamTeeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamTeeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamTeeCodeLength = 140;
-static const JSC::Intrinsic s_readableStreamTeeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamTeeCode = "(function (){\"use strict\";if(!@isReadableStream(this))throw @makeThisTypeError(\"ReadableStream\",\"tee\");return @readableStreamTee(this,!1)})\n";
-
-// locked
-const JSC::ConstructAbility s_readableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamLockedCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamLockedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamLockedCodeLength = 147;
-static const JSC::Intrinsic s_readableStreamLockedCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamLockedCode = "(function (){\"use strict\";if(!@isReadableStream(this))throw @makeGetterTypeError(\"ReadableStream\",\"locked\");return @isReadableStreamLocked(this)})\n";
-
-// values
-const JSC::ConstructAbility s_readableStreamValuesCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamValuesCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamValuesCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamValuesCodeLength = 165;
-static const JSC::Intrinsic s_readableStreamValuesCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamValuesCode = "(function (options){\"use strict\";var prototype=@ReadableStream.prototype;return @readableStreamDefineLazyIterators(prototype),prototype.values.@call(this,options)})\n";
-
-// lazyAsyncIterator
-const JSC::ConstructAbility s_readableStreamLazyAsyncIteratorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamLazyAsyncIteratorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamLazyAsyncIteratorCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
-const int s_readableStreamLazyAsyncIteratorCodeLength = 176;
-static const JSC::Intrinsic s_readableStreamLazyAsyncIteratorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamLazyAsyncIteratorCode = "(function (){\"use strict\";var prototype=@ReadableStream.prototype;return @readableStreamDefineLazyIterators(prototype),prototype[globalThis.Symbol.asyncIterator].@call(this)})\n";
+/* WritableStreamInternals.ts */
+// acquireWritableStreamDefaultWriter
+const JSC::ConstructAbility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeLength = 88;
+static const JSC::Intrinsic s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsAcquireWritableStreamDefaultWriterCode = "(function (stream) {\"use strict\";\n return new @WritableStreamDefaultWriter(stream);\n})\n";
-#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
-JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
-{\
- JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().readableStreamBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
-}
-WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
-#undef DEFINE_BUILTIN_GENERATOR
+// createInternalWritableStreamFromUnderlyingSink
+const JSC::ConstructAbility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeLength = 1576;
+static const JSC::Intrinsic s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode = "(function (underlyingSink, strategy) {\"use strict\";\n const stream = {};\n if (underlyingSink === @undefined)\n underlyingSink = {};\n if (strategy === @undefined)\n strategy = {};\n if (!@isObject(underlyingSink))\n @throwTypeError(\"WritableStream constructor takes an object as first argument\");\n if (\"type\" in underlyingSink)\n @throwRangeError(\"Invalid type is specified\");\n const sizeAlgorithm = @extractSizeAlgorithm(strategy), highWaterMark = @extractHighWaterMark(strategy, 1), underlyingSinkDict = {};\n if (\"start\" in underlyingSink) {\n if (underlyingSinkDict.start = underlyingSink.start, typeof underlyingSinkDict.start !== \"function\")\n @throwTypeError(\"underlyingSink.start should be a function\");\n }\n if (\"write\" in underlyingSink) {\n if (underlyingSinkDict.write = underlyingSink.write, typeof underlyingSinkDict.write !== \"function\")\n @throwTypeError(\"underlyingSink.write should be a function\");\n }\n if (\"close\" in underlyingSink) {\n if (underlyingSinkDict.close = underlyingSink.close, typeof underlyingSinkDict.close !== \"function\")\n @throwTypeError(\"underlyingSink.close should be a function\");\n }\n if (\"abort\" in underlyingSink) {\n if (underlyingSinkDict.abort = underlyingSink.abort, typeof underlyingSinkDict.abort !== \"function\")\n @throwTypeError(\"underlyingSink.abort should be a function\");\n }\n return @initializeWritableStreamSlots(stream, underlyingSink), @setUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, underlyingSinkDict, highWaterMark, sizeAlgorithm), stream;\n})\n";
-/* ReadableStreamDefaultController.ts */
-// initializeReadableStreamDefaultController
-const JSC::ConstructAbility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeLength = 333;
-static const JSC::Intrinsic s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCode = "(function (stream,underlyingSource,size,highWaterMark){\"use strict\";if(arguments.length!==5&&arguments[4]!==@isReadableStream)@throwTypeError(\"ReadableStreamDefaultController constructor should not be called directly\");return @privateInitializeReadableStreamDefaultController.@call(this,stream,underlyingSource,size,highWaterMark)})\n";
+// createWritableStream
+const JSC::ConstructAbility s_writableStreamInternalsCreateWritableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsCreateWritableStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsCreateWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsCreateWritableStreamCodeLength = 486;
+static const JSC::Intrinsic s_writableStreamInternalsCreateWritableStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsCreateWritableStreamCode = "(function (startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\"use strict\";\n const internalStream = {};\n @initializeWritableStreamSlots(internalStream, {});\n const controller = new @WritableStreamDefaultController;\n return @setUpWritableStreamDefaultController(internalStream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm), @createWritableStreamFromInternal(internalStream);\n})\n";
-// enqueue
-const JSC::ConstructAbility s_readableStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamDefaultControllerEnqueueCodeLength = 364;
-static const JSC::Intrinsic s_readableStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamDefaultControllerEnqueueCode = "(function (chunk){\"use strict\";if(!@isReadableStreamDefaultController(this))throw @makeThisTypeError(\"ReadableStreamDefaultController\",\"enqueue\");if(!@readableStreamDefaultControllerCanCloseOrEnqueue(this))@throwTypeError(\"ReadableStreamDefaultController is not in a state where chunk can be enqueued\");return @readableStreamDefaultControllerEnqueue(this,chunk)})\n";
+// initializeWritableStreamSlots
+const JSC::ConstructAbility s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsInitializeWritableStreamSlotsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsInitializeWritableStreamSlotsCodeLength = 713;
+static const JSC::Intrinsic s_writableStreamInternalsInitializeWritableStreamSlotsCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsInitializeWritableStreamSlotsCode = "(function (stream, underlyingSink) {\"use strict\";\n @putByIdDirectPrivate(stream, \"state\", \"writable\"), @putByIdDirectPrivate(stream, \"storedError\", @undefined), @putByIdDirectPrivate(stream, \"writer\", @undefined), @putByIdDirectPrivate(stream, \"controller\", @undefined), @putByIdDirectPrivate(stream, \"inFlightWriteRequest\", @undefined), @putByIdDirectPrivate(stream, \"closeRequest\", @undefined), @putByIdDirectPrivate(stream, \"inFlightCloseRequest\", @undefined), @putByIdDirectPrivate(stream, \"pendingAbortRequest\", @undefined), @putByIdDirectPrivate(stream, \"writeRequests\", @createFIFO()), @putByIdDirectPrivate(stream, \"backpressure\", !1), @putByIdDirectPrivate(stream, \"underlyingSink\", underlyingSink);\n})\n";
-// error
-const JSC::ConstructAbility s_readableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamDefaultControllerErrorCodeLength = 192;
-static const JSC::Intrinsic s_readableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamDefaultControllerErrorCode = "(function (err){\"use strict\";if(!@isReadableStreamDefaultController(this))throw @makeThisTypeError(\"ReadableStreamDefaultController\",\"error\");@readableStreamDefaultControllerError(this,err)})\n";
+// isCloseSentinel
+const JSC::ConstructAbility s_writableStreamInternalsIsCloseSentinelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsIsCloseSentinelCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsIsCloseSentinelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsIsCloseSentinelCodeLength = 31;
+static const JSC::Intrinsic s_writableStreamInternalsIsCloseSentinelCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsIsCloseSentinelCode = "(function () {\"use strict\";\n})\n";
-// close
-const JSC::ConstructAbility s_readableStreamDefaultControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamDefaultControllerCloseCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamDefaultControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamDefaultControllerCloseCodeLength = 337;
-static const JSC::Intrinsic s_readableStreamDefaultControllerCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamDefaultControllerCloseCode = "(function (){\"use strict\";if(!@isReadableStreamDefaultController(this))throw @makeThisTypeError(\"ReadableStreamDefaultController\",\"close\");if(!@readableStreamDefaultControllerCanCloseOrEnqueue(this))@throwTypeError(\"ReadableStreamDefaultController is not in a state where it can be closed\");@readableStreamDefaultControllerClose(this)})\n";
+// isWritableStream
+const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsIsWritableStreamCodeLength = 118;
+static const JSC::Intrinsic s_writableStreamInternalsIsWritableStreamCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsIsWritableStreamCode = "(function (stream) {\"use strict\";\n return @isObject(stream) && !!@getByIdDirectPrivate(stream, \"underlyingSink\");\n})\n";
-// desiredSize
-const JSC::ConstructAbility s_readableStreamDefaultControllerDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableStreamDefaultControllerDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableStreamDefaultControllerDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamDefaultControllerDesiredSizeCodeLength = 209;
-static const JSC::Intrinsic s_readableStreamDefaultControllerDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamDefaultControllerDesiredSizeCode = "(function (){\"use strict\";if(!@isReadableStreamDefaultController(this))throw @makeGetterTypeError(\"ReadableStreamDefaultController\",\"desiredSize\");return @readableStreamDefaultControllerGetDesiredSize(this)})\n";
+// isWritableStreamDefaultWriter
+const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsIsWritableStreamDefaultWriterCodeLength = 117;
+static const JSC::Intrinsic s_writableStreamInternalsIsWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsIsWritableStreamDefaultWriterCode = "(function (writer) {\"use strict\";\n return @isObject(writer) && !!@getByIdDirectPrivate(writer, \"closedPromise\");\n})\n";
-#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
-JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
-{\
- JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().readableStreamDefaultControllerBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamDefaultControllerBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
-}
-WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
-#undef DEFINE_BUILTIN_GENERATOR
+// isWritableStreamLocked
+const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamLockedCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamLockedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsIsWritableStreamLockedCodeLength = 102;
+static const JSC::Intrinsic s_writableStreamInternalsIsWritableStreamLockedCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsIsWritableStreamLockedCode = "(function (stream) {\"use strict\";\n return @getByIdDirectPrivate(stream, \"writer\") !== @undefined;\n})\n";
-/* ReadableByteStreamInternals.ts */
-// privateInitializeReadableByteStreamController
-const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength = 1896;
-static const JSC::Intrinsic s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode = "(function (stream,underlyingByteSource,highWaterMark){\"use strict\";if(!@isReadableStream(stream))@throwTypeError(\"ReadableByteStreamController needs a ReadableStream\");if(@getByIdDirectPrivate(stream,\"readableStreamController\")!==null)@throwTypeError(\"ReadableStream already has a controller\");@putByIdDirectPrivate(this,\"controlledReadableStream\",stream),@putByIdDirectPrivate(this,\"underlyingByteSource\",underlyingByteSource),@putByIdDirectPrivate(this,\"pullAgain\",!1),@putByIdDirectPrivate(this,\"pulling\",!1),@readableByteStreamControllerClearPendingPullIntos(this),@putByIdDirectPrivate(this,\"queue\",@newQueue()),@putByIdDirectPrivate(this,\"started\",0),@putByIdDirectPrivate(this,\"closeRequested\",!1);let hwm=@toNumber(highWaterMark);if(hwm!==hwm||hwm<0)@throwRangeError(\"highWaterMark value is negative or not a number\");@putByIdDirectPrivate(this,\"strategyHWM\",hwm);let autoAllocateChunkSize=underlyingByteSource.autoAllocateChunkSize;if(autoAllocateChunkSize!==@undefined){if(autoAllocateChunkSize=@toNumber(autoAllocateChunkSize),autoAllocateChunkSize<=0||autoAllocateChunkSize===@Infinity||autoAllocateChunkSize===-@Infinity)@throwRangeError(\"autoAllocateChunkSize value is negative or equal to positive or negative infinity\")}@putByIdDirectPrivate(this,\"autoAllocateChunkSize\",autoAllocateChunkSize),@putByIdDirectPrivate(this,\"pendingPullIntos\",@createFIFO());const controller=this;return @promiseInvokeOrNoopNoCatch(@getByIdDirectPrivate(controller,\"underlyingByteSource\"),\"start\",[controller]).@then(()=>{@putByIdDirectPrivate(controller,\"started\",1),@readableByteStreamControllerCallPullIfNeeded(controller)},(error)=>{if(@getByIdDirectPrivate(stream,\"state\")===@streamReadable)@readableByteStreamControllerError(controller,error)}),@putByIdDirectPrivate(this,\"cancel\",@readableByteStreamControllerCancel),@putByIdDirectPrivate(this,\"pull\",@readableByteStreamControllerPull),this})\n";
+// setUpWritableStreamDefaultController
+const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeLength = 972;
+static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerCode = "(function (stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\"use strict\";\n @putByIdDirectPrivate(controller, \"stream\", stream), @putByIdDirectPrivate(stream, \"controller\", controller), @resetQueue(@getByIdDirectPrivate(controller, \"queue\")), @putByIdDirectPrivate(controller, \"started\", -1), @putByIdDirectPrivate(controller, \"startAlgorithm\", startAlgorithm), @putByIdDirectPrivate(controller, \"strategySizeAlgorithm\", sizeAlgorithm), @putByIdDirectPrivate(controller, \"strategyHWM\", highWaterMark), @putByIdDirectPrivate(controller, \"writeAlgorithm\", writeAlgorithm), @putByIdDirectPrivate(controller, \"closeAlgorithm\", closeAlgorithm), @putByIdDirectPrivate(controller, \"abortAlgorithm\", abortAlgorithm);\n const backpressure = @writableStreamDefaultControllerGetBackpressure(controller);\n @writableStreamUpdateBackpressure(stream, backpressure), @writableStreamDefaultControllerStart(controller);\n})\n";
-// readableStreamByteStreamControllerStart
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeLength = 91;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCode = "(function (controller){\"use strict\";@putByIdDirectPrivate(controller,\"start\",@undefined)})\n";
+// setUpWritableStreamDefaultControllerFromUnderlyingSink
+const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeLength = 1314;
+static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCode = "(function (stream, underlyingSink, underlyingSinkDict, highWaterMark, sizeAlgorithm) {\"use strict\";\n const controller = new @WritableStreamDefaultController;\n let startAlgorithm = () => {\n }, writeAlgorithm = () => {\n return @Promise.@resolve();\n }, closeAlgorithm = () => {\n return @Promise.@resolve();\n }, abortAlgorithm = () => {\n return @Promise.@resolve();\n };\n if (\"start\" in underlyingSinkDict) {\n const startMethod = underlyingSinkDict.start;\n startAlgorithm = () => @promiseInvokeOrNoopMethodNoCatch(underlyingSink, startMethod, [controller]);\n }\n if (\"write\" in underlyingSinkDict) {\n const writeMethod = underlyingSinkDict.write;\n writeAlgorithm = (chunk) => @promiseInvokeOrNoopMethod(underlyingSink, writeMethod, [chunk, controller]);\n }\n if (\"close\" in underlyingSinkDict) {\n const closeMethod = underlyingSinkDict.close;\n closeAlgorithm = () => @promiseInvokeOrNoopMethod(underlyingSink, closeMethod, []);\n }\n if (\"abort\" in underlyingSinkDict) {\n const abortMethod = underlyingSinkDict.abort;\n abortAlgorithm = (reason) => @promiseInvokeOrNoopMethod(underlyingSink, abortMethod, [reason]);\n }\n @setUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n})\n";
-// privateInitializeReadableStreamBYOBRequest
-const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeLength = 163;
-static const JSC::Intrinsic s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCode = "(function (controller,view){\"use strict\";@putByIdDirectPrivate(this,\"associatedReadableByteStreamController\",controller),@putByIdDirectPrivate(this,\"view\",view)})\n";
+// setUpWritableStreamDefaultWriter
+const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeLength = 1368;
+static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsSetUpWritableStreamDefaultWriterCode = "(function (writer, stream) {\"use strict\";\n if (@isWritableStreamLocked(stream))\n @throwTypeError(\"WritableStream is locked\");\n @putByIdDirectPrivate(writer, \"stream\", stream), @putByIdDirectPrivate(stream, \"writer\", writer);\n const readyPromiseCapability = @newPromiseCapability(@Promise), closedPromiseCapability = @newPromiseCapability(@Promise);\n @putByIdDirectPrivate(writer, \"readyPromise\", readyPromiseCapability), @putByIdDirectPrivate(writer, \"closedPromise\", closedPromiseCapability);\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"writable\") {\n if (@writableStreamCloseQueuedOrInFlight(stream) || !@getByIdDirectPrivate(stream, \"backpressure\"))\n readyPromiseCapability.resolve.@call();\n } else if (state === \"erroring\")\n readyPromiseCapability.reject.@call(@undefined, @getByIdDirectPrivate(stream, \"storedError\")), @markPromiseAsHandled(readyPromiseCapability.promise);\n else if (state === \"closed\")\n readyPromiseCapability.resolve.@call(), closedPromiseCapability.resolve.@call();\n else {\n const storedError = @getByIdDirectPrivate(stream, \"storedError\");\n readyPromiseCapability.reject.@call(@undefined, storedError), @markPromiseAsHandled(readyPromiseCapability.promise), closedPromiseCapability.reject.@call(@undefined, storedError), @markPromiseAsHandled(closedPromiseCapability.promise);\n }\n})\n";
-// isReadableByteStreamController
-const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsIsReadableByteStreamControllerCodeLength = 127;
-static const JSC::Intrinsic s_readableByteStreamInternalsIsReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsIsReadableByteStreamControllerCode = "(function (controller){\"use strict\";return @isObject(controller)&&!!@getByIdDirectPrivate(controller,\"underlyingByteSource\")})\n";
+// writableStreamAbort
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamAbortCodeLength = 782;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAbortCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamAbortCode = "(function (stream, reason) {\"use strict\";\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"closed\" || state === \"errored\")\n return @Promise.@resolve();\n const pendingAbortRequest = @getByIdDirectPrivate(stream, \"pendingAbortRequest\");\n if (pendingAbortRequest !== @undefined)\n return pendingAbortRequest.promise.promise;\n let wasAlreadyErroring = !1;\n if (state === \"erroring\")\n wasAlreadyErroring = !0, reason = @undefined;\n const abortPromiseCapability = @newPromiseCapability(@Promise);\n if (@putByIdDirectPrivate(stream, \"pendingAbortRequest\", {\n promise: abortPromiseCapability,\n reason,\n wasAlreadyErroring\n }), !wasAlreadyErroring)\n @writableStreamStartErroring(stream, reason);\n return abortPromiseCapability.promise;\n})\n";
-// isReadableStreamBYOBRequest
-const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeLength = 148;
-static const JSC::Intrinsic s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsIsReadableStreamBYOBRequestCode = "(function (byobRequest){\"use strict\";return @isObject(byobRequest)&&!!@getByIdDirectPrivate(byobRequest,\"associatedReadableByteStreamController\")})\n";
+// writableStreamAbortForBindings
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortForBindingsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamAbortForBindingsCodeLength = 253;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAbortForBindingsCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamAbortForBindingsCode = "(function (stream, reason) {\"use strict\";\n if (@isWritableStreamLocked(stream))\n return @Promise.@reject(@makeTypeError(\"WritableStream.abort method can only be used on non locked WritableStream\"));\n return @writableStreamAbort(stream, reason);\n})\n";
-// isReadableStreamBYOBReader
-const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeLength = 111;
-static const JSC::Intrinsic s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsIsReadableStreamBYOBReaderCode = "(function (reader){\"use strict\";return @isObject(reader)&&!!@getByIdDirectPrivate(reader,\"readIntoRequests\")})\n";
+// writableStreamAddWriteRequest
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAddWriteRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamAddWriteRequestCodeLength = 221;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAddWriteRequestCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamAddWriteRequestCode = "(function (stream) {\"use strict\";\n const writePromiseCapability = @newPromiseCapability(@Promise);\n return @getByIdDirectPrivate(stream, \"writeRequests\").push(writePromiseCapability), writePromiseCapability.promise;\n})\n";
-// readableByteStreamControllerCancel
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeLength = 336;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerCancelCode = "(function (controller,reason){\"use strict\";var pendingPullIntos=@getByIdDirectPrivate(controller,\"pendingPullIntos\"),first=pendingPullIntos.peek();if(first)first.bytesFilled=0;return @putByIdDirectPrivate(controller,\"queue\",@newQueue()),@promiseInvokeOrNoop(@getByIdDirectPrivate(controller,\"underlyingByteSource\"),\"cancel\",[reason])})\n";
+// writableStreamClose
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamCloseCodeLength = 738;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamCloseCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamCloseCode = "(function (stream) {\"use strict\";\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"closed\" || state === \"errored\")\n return @Promise.@reject(@makeTypeError(\"Cannot close a writable stream that is closed or errored\"));\n const closePromiseCapability = @newPromiseCapability(@Promise);\n @putByIdDirectPrivate(stream, \"closeRequest\", closePromiseCapability);\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined && @getByIdDirectPrivate(stream, \"backpressure\") && state === \"writable\")\n @getByIdDirectPrivate(writer, \"readyPromise\").resolve.@call();\n return @writableStreamDefaultControllerClose(@getByIdDirectPrivate(stream, \"controller\")), closePromiseCapability.promise;\n})\n";
-// readableByteStreamControllerError
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeLength = 242;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerErrorCode = "(function (controller,e){\"use strict\";@readableByteStreamControllerClearPendingPullIntos(controller),@putByIdDirectPrivate(controller,\"queue\",@newQueue()),@readableStreamError(@getByIdDirectPrivate(controller,\"controlledReadableStream\"),e)})\n";
+// writableStreamCloseForBindings
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseForBindingsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamCloseForBindingsCodeLength = 414;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamCloseForBindingsCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamCloseForBindingsCode = "(function (stream) {\"use strict\";\n if (@isWritableStreamLocked(stream))\n return @Promise.@reject(@makeTypeError(\"WritableStream.close method can only be used on non locked WritableStream\"));\n if (@writableStreamCloseQueuedOrInFlight(stream))\n return @Promise.@reject(@makeTypeError(\"WritableStream.close method can only be used on a being close WritableStream\"));\n return @writableStreamClose(stream);\n})\n";
-// readableByteStreamControllerClose
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeLength = 473;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerCloseCode = "(function (controller){\"use strict\";if(@getByIdDirectPrivate(controller,\"queue\").size>0){@putByIdDirectPrivate(controller,\"closeRequested\",!0);return}var first=@getByIdDirectPrivate(controller,\"pendingPullIntos\")\?.peek();if(first){if(first.bytesFilled>0){const e=@makeTypeError(\"Close requested while there remain pending bytes\");throw @readableByteStreamControllerError(controller,e),e}}@readableStreamClose(@getByIdDirectPrivate(controller,\"controlledReadableStream\"))})\n";
+// writableStreamCloseQueuedOrInFlight
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeLength = 180;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCode = "(function (stream) {\"use strict\";\n return @getByIdDirectPrivate(stream, \"closeRequest\") !== @undefined || @getByIdDirectPrivate(stream, \"inFlightCloseRequest\") !== @undefined;\n})\n";
-// readableByteStreamControllerClearPendingPullIntos
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeLength = 281;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCode = "(function (controller){\"use strict\";@readableByteStreamControllerInvalidateBYOBRequest(controller);var existing=@getByIdDirectPrivate(controller,\"pendingPullIntos\");if(existing!==@undefined)existing.clear();else @putByIdDirectPrivate(controller,\"pendingPullIntos\",@createFIFO())})\n";
+// writableStreamDealWithRejection
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDealWithRejectionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDealWithRejectionCodeLength = 213;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDealWithRejectionCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDealWithRejectionCode = "(function (stream, error) {\"use strict\";\n if (@getByIdDirectPrivate(stream, \"state\") === \"writable\") {\n @writableStreamStartErroring(stream, error);\n return;\n }\n @writableStreamFinishErroring(stream);\n})\n";
-// readableByteStreamControllerGetDesiredSize
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeLength = 330;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCode = "(function (controller){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"controlledReadableStream\"),state=@getByIdDirectPrivate(stream,\"state\");if(state===@streamErrored)return null;if(state===@streamClosed)return 0;return @getByIdDirectPrivate(controller,\"strategyHWM\")-@getByIdDirectPrivate(controller,\"queue\").size})\n";
+// writableStreamDefaultControllerAdvanceQueueIfNeeded
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeLength = 705;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n if (@getByIdDirectPrivate(controller, \"started\") !== 1)\n return;\n if (@getByIdDirectPrivate(stream, \"inFlightWriteRequest\") !== @undefined)\n return;\n if (@getByIdDirectPrivate(stream, \"state\") === \"erroring\") {\n @writableStreamFinishErroring(stream);\n return;\n }\n const queue = @getByIdDirectPrivate(controller, \"queue\");\n if (queue.content\?.isEmpty() \?\? !1)\n return;\n const value = @peekQueueValue(queue);\n if (value === @isCloseSentinel)\n @writableStreamDefaultControllerProcessClose(controller);\n else\n @writableStreamDefaultControllerProcessWrite(controller, value);\n})\n";
-// readableStreamHasBYOBReader
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeLength = 150;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableStreamHasBYOBReaderCode = "(function (stream){\"use strict\";const reader=@getByIdDirectPrivate(stream,\"reader\");return reader!==@undefined&&@isReadableStreamBYOBReader(reader)})\n";
+// writableStreamDefaultControllerClearAlgorithms
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeLength = 310;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCode = "(function (controller) {\"use strict\";\n @putByIdDirectPrivate(controller, \"writeAlgorithm\", @undefined), @putByIdDirectPrivate(controller, \"closeAlgorithm\", @undefined), @putByIdDirectPrivate(controller, \"abortAlgorithm\", @undefined), @putByIdDirectPrivate(controller, \"strategySizeAlgorithm\", @undefined);\n})\n";
-// readableStreamHasDefaultReader
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeLength = 153;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableStreamHasDefaultReaderCode = "(function (stream){\"use strict\";const reader=@getByIdDirectPrivate(stream,\"reader\");return reader!==@undefined&&@isReadableStreamDefaultReader(reader)})\n";
+// writableStreamDefaultControllerClose
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeLength = 197;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerCloseCode = "(function (controller) {\"use strict\";\n @enqueueValueWithSize(@getByIdDirectPrivate(controller, \"queue\"), @isCloseSentinel, 0), @writableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n})\n";
-// readableByteStreamControllerHandleQueueDrain
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeLength = 287;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCode = "(function (controller){\"use strict\";if(!@getByIdDirectPrivate(controller,\"queue\").size&&@getByIdDirectPrivate(controller,\"closeRequested\"))@readableStreamClose(@getByIdDirectPrivate(controller,\"controlledReadableStream\"));else @readableByteStreamControllerCallPullIfNeeded(controller)})\n";
+// writableStreamDefaultControllerError
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeLength = 218;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorCode = "(function (controller, error) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n @writableStreamDefaultControllerClearAlgorithms(controller), @writableStreamStartErroring(stream, error);\n})\n";
-// readableByteStreamControllerPull
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerPullCodeLength = 1169;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerPullCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullCode = "(function (controller){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"controlledReadableStream\");if(@getByIdDirectPrivate(controller,\"queue\").content\?.isNotEmpty()){const entry=@getByIdDirectPrivate(controller,\"queue\").content.shift();@getByIdDirectPrivate(controller,\"queue\").size-=entry.byteLength,@readableByteStreamControllerHandleQueueDrain(controller);let view;try{view=new @Uint8Array(entry.buffer,entry.byteOffset,entry.byteLength)}catch(error){return @Promise.@reject(error)}return @createFulfilledPromise({value:view,done:!1})}if(@getByIdDirectPrivate(controller,\"autoAllocateChunkSize\")!==@undefined){let buffer;try{buffer=@createUninitializedArrayBuffer(@getByIdDirectPrivate(controller,\"autoAllocateChunkSize\"))}catch(error){return @Promise.@reject(error)}const pullIntoDescriptor={buffer,byteOffset:0,byteLength:@getByIdDirectPrivate(controller,\"autoAllocateChunkSize\"),bytesFilled:0,elementSize:1,ctor:@Uint8Array,readerType:\"default\"};@getByIdDirectPrivate(controller,\"pendingPullIntos\").push(pullIntoDescriptor)}const promise=@readableStreamAddReadRequest(stream);return @readableByteStreamControllerCallPullIfNeeded(controller),promise})\n";
+// writableStreamDefaultControllerErrorIfNeeded
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeLength = 233;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCode = "(function (controller, error) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n if (@getByIdDirectPrivate(stream, \"state\") === \"writable\")\n @writableStreamDefaultControllerError(controller, error);\n})\n";
-// readableByteStreamControllerShouldCallPull
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeLength = 709;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode = "(function (controller){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"controlledReadableStream\");if(@getByIdDirectPrivate(stream,\"state\")!==@streamReadable)return!1;if(@getByIdDirectPrivate(controller,\"closeRequested\"))return!1;if(!(@getByIdDirectPrivate(controller,\"started\")>0))return!1;const reader=@getByIdDirectPrivate(stream,\"reader\");if(reader&&(@getByIdDirectPrivate(reader,\"readRequests\")\?.isNotEmpty()||!!@getByIdDirectPrivate(reader,\"bunNativePtr\")))return!0;if(@readableStreamHasBYOBReader(stream)&&@getByIdDirectPrivate(@getByIdDirectPrivate(stream,\"reader\"),\"readIntoRequests\")\?.isNotEmpty())return!0;if(@readableByteStreamControllerGetDesiredSize(controller)>0)return!0;return!1})\n";
+// writableStreamDefaultControllerGetBackpressure
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeLength = 115;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCode = "(function (controller) {\"use strict\";\n return @writableStreamDefaultControllerGetDesiredSize(controller) <= 0;\n})\n";
-// readableByteStreamControllerCallPullIfNeeded
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeLength = 748;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCode = "(function (controller){\"use strict\";if(!@readableByteStreamControllerShouldCallPull(controller))return;if(@getByIdDirectPrivate(controller,\"pulling\")){@putByIdDirectPrivate(controller,\"pullAgain\",!0);return}@putByIdDirectPrivate(controller,\"pulling\",!0),@promiseInvokeOrNoop(@getByIdDirectPrivate(controller,\"underlyingByteSource\"),\"pull\",[controller]).@then(()=>{if(@putByIdDirectPrivate(controller,\"pulling\",!1),@getByIdDirectPrivate(controller,\"pullAgain\"))@putByIdDirectPrivate(controller,\"pullAgain\",!1),@readableByteStreamControllerCallPullIfNeeded(controller)},(error)=>{if(@getByIdDirectPrivate(@getByIdDirectPrivate(controller,\"controlledReadableStream\"),\"state\")===@streamReadable)@readableByteStreamControllerError(controller,error)})})\n";
+// writableStreamDefaultControllerGetChunkSize
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeLength = 248;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCode = "(function (controller, chunk) {\"use strict\";\n try {\n return @getByIdDirectPrivate(controller, \"strategySizeAlgorithm\").@call(@undefined, chunk);\n } catch (e) {\n return @writableStreamDefaultControllerErrorIfNeeded(controller, e), 1;\n }\n})\n";
-// transferBufferToCurrentRealm
-const JSC::ConstructAbility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeLength = 48;
-static const JSC::Intrinsic s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsTransferBufferToCurrentRealmCode = "(function (buffer){\"use strict\";return buffer})\n";
+// writableStreamDefaultControllerGetDesiredSize
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeLength = 150;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCode = "(function (controller) {\"use strict\";\n return @getByIdDirectPrivate(controller, \"strategyHWM\") - @getByIdDirectPrivate(controller, \"queue\").size;\n})\n";
-// readableStreamReaderKind
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamReaderKindCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableStreamReaderKindCodeLength = 208;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamReaderKindCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableStreamReaderKindCode = "(function (reader){\"use strict\";if(@getByIdDirectPrivate(reader,\"readRequests\"))return @getByIdDirectPrivate(reader,\"bunNativePtr\")\?3:1;if(@getByIdDirectPrivate(reader,\"readIntoRequests\"))return 2;return 0})\n";
+// writableStreamDefaultControllerProcessClose
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeLength = 533;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n @writableStreamMarkCloseRequestInFlight(stream), @dequeueValue(@getByIdDirectPrivate(controller, \"queue\"));\n const sinkClosePromise = @getByIdDirectPrivate(controller, \"closeAlgorithm\").@call();\n @writableStreamDefaultControllerClearAlgorithms(controller), sinkClosePromise.@then(() => {\n @writableStreamFinishInFlightClose(stream);\n }, (reason) => {\n @writableStreamFinishInFlightCloseWithError(stream, reason);\n });\n})\n";
-// readableByteStreamControllerEnqueue
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeLength = 1036;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCode = "(function (controller,chunk){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"controlledReadableStream\");switch(@getByIdDirectPrivate(stream,\"reader\")\?@readableStreamReaderKind(@getByIdDirectPrivate(stream,\"reader\")):0){case 1:{if(!@getByIdDirectPrivate(@getByIdDirectPrivate(stream,\"reader\"),\"readRequests\")\?.isNotEmpty())@readableByteStreamControllerEnqueueChunk(controller,@transferBufferToCurrentRealm(chunk.buffer),chunk.byteOffset,chunk.byteLength);else{const transferredView=chunk.constructor===@Uint8Array\?chunk:new @Uint8Array(chunk.buffer,chunk.byteOffset,chunk.byteLength);@readableStreamFulfillReadRequest(stream,transferredView,!1)}break}case 2:{@readableByteStreamControllerEnqueueChunk(controller,@transferBufferToCurrentRealm(chunk.buffer),chunk.byteOffset,chunk.byteLength),@readableByteStreamControllerProcessPullDescriptors(controller);break}case 3:break;default:{@readableByteStreamControllerEnqueueChunk(controller,@transferBufferToCurrentRealm(chunk.buffer),chunk.byteOffset,chunk.byteLength);break}}})\n";
+// writableStreamDefaultControllerProcessWrite
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeLength = 950;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode = "(function (controller, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n @writableStreamMarkFirstWriteRequestInFlight(stream), @getByIdDirectPrivate(controller, \"writeAlgorithm\").@call(@undefined, chunk).@then(() => {\n @writableStreamFinishInFlightWrite(stream);\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (@dequeueValue(@getByIdDirectPrivate(controller, \"queue\")), !@writableStreamCloseQueuedOrInFlight(stream) && state === \"writable\") {\n const backpressure = @writableStreamDefaultControllerGetBackpressure(controller);\n @writableStreamUpdateBackpressure(stream, backpressure);\n }\n @writableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }, (reason) => {\n if (@getByIdDirectPrivate(stream, \"state\") === \"writable\")\n @writableStreamDefaultControllerClearAlgorithms(controller);\n @writableStreamFinishInFlightWriteWithError(stream, reason);\n });\n})\n";
-// readableByteStreamControllerEnqueueChunk
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeLength = 213;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode = "(function (controller,buffer,byteOffset,byteLength){\"use strict\";@getByIdDirectPrivate(controller,\"queue\").content.push({buffer,byteOffset,byteLength}),@getByIdDirectPrivate(controller,\"queue\").size+=byteLength})\n";
+// writableStreamDefaultControllerStart
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultControllerStartCodeLength = 796;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerStartCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerStartCode = "(function (controller) {\"use strict\";\n if (@getByIdDirectPrivate(controller, \"started\") !== -1)\n return;\n @putByIdDirectPrivate(controller, \"started\", 0);\n const startAlgorithm = @getByIdDirectPrivate(controller, \"startAlgorithm\");\n @putByIdDirectPrivate(controller, \"startAlgorithm\", @undefined);\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n return @Promise.@resolve(startAlgorithm.@call()).@then(() => {\n const state = @getByIdDirectPrivate(stream, \"state\");\n @putByIdDirectPrivate(controller, \"started\", 1), @writableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }, (error) => {\n const state = @getByIdDirectPrivate(stream, \"state\");\n @putByIdDirectPrivate(controller, \"started\", 1), @writableStreamDealWithRejection(stream, error);\n });\n})\n";
-// readableByteStreamControllerRespondWithNewView
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeLength = 463;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCode = "(function (controller,view){\"use strict\";let firstDescriptor=@getByIdDirectPrivate(controller,\"pendingPullIntos\").peek();if(firstDescriptor.byteOffset+firstDescriptor.bytesFilled!==view.byteOffset)@throwRangeError(\"Invalid value for view.byteOffset\");if(firstDescriptor.byteLength!==view.byteLength)@throwRangeError(\"Invalid value for view.byteLength\");firstDescriptor.buffer=view.buffer,@readableByteStreamControllerRespondInternal(controller,view.byteLength)})\n";
+// writableStreamDefaultControllerWrite
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeLength = 662;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerWriteCode = "(function (controller, chunk, chunkSize) {\"use strict\";\n try {\n @enqueueValueWithSize(@getByIdDirectPrivate(controller, \"queue\"), chunk, chunkSize);\n const stream = @getByIdDirectPrivate(controller, \"stream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (!@writableStreamCloseQueuedOrInFlight(stream) && state === \"writable\") {\n const backpressure = @writableStreamDefaultControllerGetBackpressure(controller);\n @writableStreamUpdateBackpressure(stream, backpressure);\n }\n @writableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n } catch (e) {\n @writableStreamDefaultControllerErrorIfNeeded(controller, e);\n }\n})\n";
-// readableByteStreamControllerRespond
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeLength = 287;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondCode = "(function (controller,bytesWritten){\"use strict\";if(bytesWritten=@toNumber(bytesWritten),bytesWritten!==bytesWritten||bytesWritten===@Infinity||bytesWritten<0)@throwRangeError(\"bytesWritten has an incorrect value\");@readableByteStreamControllerRespondInternal(controller,bytesWritten)})\n";
+// writableStreamDefaultWriterAbort
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeLength = 150;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterAbortCode = "(function (writer, reason) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\");\n return @writableStreamAbort(stream, reason);\n})\n";
-// readableByteStreamControllerRespondInternal
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeLength = 534;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode = "(function (controller,bytesWritten){\"use strict\";let firstDescriptor=@getByIdDirectPrivate(controller,\"pendingPullIntos\").peek(),stream=@getByIdDirectPrivate(controller,\"controlledReadableStream\");if(@getByIdDirectPrivate(stream,\"state\")===@streamClosed){if(bytesWritten!==0)@throwTypeError(\"bytesWritten is different from 0 even though stream is closed\");@readableByteStreamControllerRespondInClosedState(controller,firstDescriptor)}else @readableByteStreamControllerRespondInReadableState(controller,bytesWritten,firstDescriptor)})\n";
+// writableStreamDefaultWriterClose
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeLength = 134;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseCode = "(function (writer) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\");\n return @writableStreamClose(stream);\n})\n";
-// readableByteStreamControllerRespondInReadableState
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeLength = 1110;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCode = "(function (controller,bytesWritten,pullIntoDescriptor){\"use strict\";if(pullIntoDescriptor.bytesFilled+bytesWritten>pullIntoDescriptor.byteLength)@throwRangeError(\"bytesWritten value is too great\");if(@readableByteStreamControllerInvalidateBYOBRequest(controller),pullIntoDescriptor.bytesFilled+=bytesWritten,pullIntoDescriptor.bytesFilled<pullIntoDescriptor.elementSize)return;@readableByteStreamControllerShiftPendingDescriptor(controller);const remainderSize=pullIntoDescriptor.bytesFilled%pullIntoDescriptor.elementSize;if(remainderSize>0){const end=pullIntoDescriptor.byteOffset+pullIntoDescriptor.bytesFilled,remainder=@cloneArrayBuffer(pullIntoDescriptor.buffer,end-remainderSize,remainderSize);@readableByteStreamControllerEnqueueChunk(controller,remainder,0,remainder.byteLength)}pullIntoDescriptor.buffer=@transferBufferToCurrentRealm(pullIntoDescriptor.buffer),pullIntoDescriptor.bytesFilled-=remainderSize,@readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(controller,\"controlledReadableStream\"),pullIntoDescriptor),@readableByteStreamControllerProcessPullDescriptors(controller)})\n";
+// writableStreamDefaultWriterCloseWithErrorPropagation
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeLength = 403;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCode = "(function (writer) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (@writableStreamCloseQueuedOrInFlight(stream) || state === \"closed\")\n return @Promise.@resolve();\n if (state === \"errored\")\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n return @writableStreamDefaultWriterClose(writer);\n})\n";
-// readableByteStreamControllerRespondInClosedState
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeLength = 596;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCode = "(function (controller,firstDescriptor){\"use strict\";if(firstDescriptor.buffer=@transferBufferToCurrentRealm(firstDescriptor.buffer),@readableStreamHasBYOBReader(@getByIdDirectPrivate(controller,\"controlledReadableStream\")))while(@getByIdDirectPrivate(@getByIdDirectPrivate(@getByIdDirectPrivate(controller,\"controlledReadableStream\"),\"reader\"),\"readIntoRequests\")\?.isNotEmpty()){let pullIntoDescriptor=@readableByteStreamControllerShiftPendingDescriptor(controller);@readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(controller,\"controlledReadableStream\"),pullIntoDescriptor)}})\n";
+// writableStreamDefaultWriterEnsureClosedPromiseRejected
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeLength = 569;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode = "(function (writer, error) {\"use strict\";\n let closedPromiseCapability = @getByIdDirectPrivate(writer, \"closedPromise\"), closedPromise = closedPromiseCapability.promise;\n if ((@getPromiseInternalField(closedPromise, @promiseFieldFlags) & @promiseStateMask) !== @promiseStatePending)\n closedPromiseCapability = @newPromiseCapability(@Promise), closedPromise = closedPromiseCapability.promise, @putByIdDirectPrivate(writer, \"closedPromise\", closedPromiseCapability);\n closedPromiseCapability.reject.@call(@undefined, error), @markPromiseAsHandled(closedPromise);\n})\n";
-// readableByteStreamControllerProcessPullDescriptors
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeLength = 534;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCode = "(function (controller){\"use strict\";while(@getByIdDirectPrivate(controller,\"pendingPullIntos\").isNotEmpty()){if(@getByIdDirectPrivate(controller,\"queue\").size===0)return;let pullIntoDescriptor=@getByIdDirectPrivate(controller,\"pendingPullIntos\").peek();if(@readableByteStreamControllerFillDescriptorFromQueue(controller,pullIntoDescriptor))@readableByteStreamControllerShiftPendingDescriptor(controller),@readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(controller,\"controlledReadableStream\"),pullIntoDescriptor)}})\n";
+// writableStreamDefaultWriterEnsureReadyPromiseRejected
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeLength = 557;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode = "(function (writer, error) {\"use strict\";\n let readyPromiseCapability = @getByIdDirectPrivate(writer, \"readyPromise\"), readyPromise = readyPromiseCapability.promise;\n if ((@getPromiseInternalField(readyPromise, @promiseFieldFlags) & @promiseStateMask) !== @promiseStatePending)\n readyPromiseCapability = @newPromiseCapability(@Promise), readyPromise = readyPromiseCapability.promise, @putByIdDirectPrivate(writer, \"readyPromise\", readyPromiseCapability);\n readyPromiseCapability.reject.@call(@undefined, error), @markPromiseAsHandled(readyPromise);\n})\n";
-// readableByteStreamControllerFillDescriptorFromQueue
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeLength = 1538;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode = "(function (controller,pullIntoDescriptor){\"use strict\";const currentAlignedBytes=pullIntoDescriptor.bytesFilled-pullIntoDescriptor.bytesFilled%pullIntoDescriptor.elementSize,maxBytesToCopy=@getByIdDirectPrivate(controller,\"queue\").size<pullIntoDescriptor.byteLength-pullIntoDescriptor.bytesFilled\?@getByIdDirectPrivate(controller,\"queue\").size:pullIntoDescriptor.byteLength-pullIntoDescriptor.bytesFilled,maxBytesFilled=pullIntoDescriptor.bytesFilled+maxBytesToCopy,maxAlignedBytes=maxBytesFilled-maxBytesFilled%pullIntoDescriptor.elementSize;let totalBytesToCopyRemaining=maxBytesToCopy,ready=!1;if(maxAlignedBytes>currentAlignedBytes)totalBytesToCopyRemaining=maxAlignedBytes-pullIntoDescriptor.bytesFilled,ready=!0;while(totalBytesToCopyRemaining>0){let headOfQueue=@getByIdDirectPrivate(controller,\"queue\").content.peek();const bytesToCopy=totalBytesToCopyRemaining<headOfQueue.byteLength\?totalBytesToCopyRemaining:headOfQueue.byteLength,destStart=pullIntoDescriptor.byteOffset+pullIntoDescriptor.bytesFilled;if(new @Uint8Array(pullIntoDescriptor.buffer).set(new @Uint8Array(headOfQueue.buffer,headOfQueue.byteOffset,bytesToCopy),destStart),headOfQueue.byteLength===bytesToCopy)@getByIdDirectPrivate(controller,\"queue\").content.shift();else headOfQueue.byteOffset+=bytesToCopy,headOfQueue.byteLength-=bytesToCopy;@getByIdDirectPrivate(controller,\"queue\").size-=bytesToCopy,@readableByteStreamControllerInvalidateBYOBRequest(controller),pullIntoDescriptor.bytesFilled+=bytesToCopy,totalBytesToCopyRemaining-=bytesToCopy}return ready})\n";
+// writableStreamDefaultWriterGetDesiredSize
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeLength = 353;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCode = "(function (writer) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"errored\" || state === \"erroring\")\n return null;\n if (state === \"closed\")\n return 0;\n return @writableStreamDefaultControllerGetDesiredSize(@getByIdDirectPrivate(stream, \"controller\"));\n})\n";
-// readableByteStreamControllerShiftPendingDescriptor
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeLength = 195;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCode = "(function (controller){\"use strict\";let descriptor=@getByIdDirectPrivate(controller,\"pendingPullIntos\").shift();return @readableByteStreamControllerInvalidateBYOBRequest(controller),descriptor})\n";
+// writableStreamDefaultWriterRelease
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeLength = 432;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterReleaseCode = "(function (writer) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\"), releasedError = @makeTypeError(\"writableStreamDefaultWriterRelease\");\n @writableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError), @writableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError), @putByIdDirectPrivate(stream, \"writer\", @undefined), @putByIdDirectPrivate(writer, \"stream\", @undefined);\n})\n";
-// readableByteStreamControllerInvalidateBYOBRequest
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeLength = 374;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCode = "(function (controller){\"use strict\";if(@getByIdDirectPrivate(controller,\"byobRequest\")===@undefined)return;const byobRequest=@getByIdDirectPrivate(controller,\"byobRequest\");@putByIdDirectPrivate(byobRequest,\"associatedReadableByteStreamController\",@undefined),@putByIdDirectPrivate(byobRequest,\"view\",@undefined),@putByIdDirectPrivate(controller,\"byobRequest\",@undefined)})\n";
+// writableStreamDefaultWriterWrite
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeLength = 1079;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterWriteCode = "(function (writer, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\"), controller = @getByIdDirectPrivate(stream, \"controller\"), chunkSize = @writableStreamDefaultControllerGetChunkSize(controller, chunk);\n if (stream !== @getByIdDirectPrivate(writer, \"stream\"))\n return @Promise.@reject(@makeTypeError(\"writer is not stream's writer\"));\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"errored\")\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n if (@writableStreamCloseQueuedOrInFlight(stream) || state === \"closed\")\n return @Promise.@reject(@makeTypeError(\"stream is closing or closed\"));\n if (@writableStreamCloseQueuedOrInFlight(stream) || state === \"closed\")\n return @Promise.@reject(@makeTypeError(\"stream is closing or closed\"));\n if (state === \"erroring\")\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n const promise = @writableStreamAddWriteRequest(stream);\n return @writableStreamDefaultControllerWrite(controller, chunk, chunkSize), promise;\n})\n";
-// readableByteStreamControllerCommitDescriptor
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeLength = 382;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCode = "(function (stream,pullIntoDescriptor){\"use strict\";let done=!1;if(@getByIdDirectPrivate(stream,\"state\")===@streamClosed)done=!0;let filledView=@readableByteStreamControllerConvertDescriptor(pullIntoDescriptor);if(pullIntoDescriptor.readerType===\"default\")@readableStreamFulfillReadRequest(stream,filledView,done);else @readableStreamFulfillReadIntoRequest(stream,filledView,done)})\n";
+// writableStreamFinishErroring
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishErroringCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishErroringCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishErroringCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamFinishErroringCodeLength = 1323;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishErroringCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamFinishErroringCode = "(function (stream) {\"use strict\";\n @putByIdDirectPrivate(stream, \"state\", \"errored\");\n const controller = @getByIdDirectPrivate(stream, \"controller\");\n @getByIdDirectPrivate(controller, \"errorSteps\").@call();\n const storedError = @getByIdDirectPrivate(stream, \"storedError\"), requests = @getByIdDirectPrivate(stream, \"writeRequests\");\n for (var request = requests.shift();request; request = requests.shift())\n request.reject.@call(@undefined, storedError);\n @putByIdDirectPrivate(stream, \"writeRequests\", @createFIFO());\n const abortRequest = @getByIdDirectPrivate(stream, \"pendingAbortRequest\");\n if (abortRequest === @undefined) {\n @writableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n if (@putByIdDirectPrivate(stream, \"pendingAbortRequest\", @undefined), abortRequest.wasAlreadyErroring) {\n abortRequest.promise.reject.@call(@undefined, storedError), @writableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n @getByIdDirectPrivate(controller, \"abortSteps\").@call(@undefined, abortRequest.reason).@then(() => {\n abortRequest.promise.resolve.@call(), @writableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n }, (reason) => {\n abortRequest.promise.reject.@call(@undefined, reason), @writableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n });\n})\n";
-// readableByteStreamControllerConvertDescriptor
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeLength = 200;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCode = "(function (pullIntoDescriptor){\"use strict\";return new pullIntoDescriptor.ctor(pullIntoDescriptor.buffer,pullIntoDescriptor.byteOffset,pullIntoDescriptor.bytesFilled/pullIntoDescriptor.elementSize)})\n";
+// writableStreamFinishInFlightClose
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeLength = 737;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseCode = "(function (stream) {\"use strict\";\n if (@getByIdDirectPrivate(stream, \"inFlightCloseRequest\").resolve.@call(), @putByIdDirectPrivate(stream, \"inFlightCloseRequest\", @undefined), @getByIdDirectPrivate(stream, \"state\") === \"erroring\") {\n @putByIdDirectPrivate(stream, \"storedError\", @undefined);\n const abortRequest = @getByIdDirectPrivate(stream, \"pendingAbortRequest\");\n if (abortRequest !== @undefined)\n abortRequest.promise.resolve.@call(), @putByIdDirectPrivate(stream, \"pendingAbortRequest\", @undefined);\n }\n @putByIdDirectPrivate(stream, \"state\", \"closed\");\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined)\n @getByIdDirectPrivate(writer, \"closedPromise\").resolve.@call();\n})\n";
-// readableStreamFulfillReadIntoRequest
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeLength = 208;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCode = "(function (stream,chunk,done){\"use strict\";const readIntoRequest=@getByIdDirectPrivate(@getByIdDirectPrivate(stream,\"reader\"),\"readIntoRequests\").shift();@fulfillPromise(readIntoRequest,{value:chunk,done})})\n";
+// writableStreamFinishInFlightCloseWithError
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeLength = 535;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode = "(function (stream, error) {\"use strict\";\n @getByIdDirectPrivate(stream, \"inFlightCloseRequest\").reject.@call(@undefined, error), @putByIdDirectPrivate(stream, \"inFlightCloseRequest\", @undefined);\n const state = @getByIdDirectPrivate(stream, \"state\"), abortRequest = @getByIdDirectPrivate(stream, \"pendingAbortRequest\");\n if (abortRequest !== @undefined)\n abortRequest.promise.reject.@call(@undefined, error), @putByIdDirectPrivate(stream, \"pendingAbortRequest\", @undefined);\n @writableStreamDealWithRejection(stream, error);\n})\n";
-// readableStreamBYOBReaderRead
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeLength = 384;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableStreamBYOBReaderReadCode = "(function (reader,view){\"use strict\";const stream=@getByIdDirectPrivate(reader,\"ownerReadableStream\");if(@putByIdDirectPrivate(stream,\"disturbed\",!0),@getByIdDirectPrivate(stream,\"state\")===@streamErrored)return @Promise.@reject(@getByIdDirectPrivate(stream,\"storedError\"));return @readableByteStreamControllerPullInto(@getByIdDirectPrivate(stream,\"readableStreamController\"),view)})\n";
+// writableStreamFinishInFlightWrite
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeLength = 177;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteCode = "(function (stream) {\"use strict\";\n @getByIdDirectPrivate(stream, \"inFlightWriteRequest\").resolve.@call(), @putByIdDirectPrivate(stream, \"inFlightWriteRequest\", @undefined);\n})\n";
-// readableByteStreamControllerPullInto
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeLength = 1659;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCode = "(function (controller,view){\"use strict\";const stream=@getByIdDirectPrivate(controller,\"controlledReadableStream\");let elementSize=1;if(view.BYTES_PER_ELEMENT!==@undefined)elementSize=view.BYTES_PER_ELEMENT;const ctor=view.constructor,pullIntoDescriptor={buffer:view.buffer,byteOffset:view.byteOffset,byteLength:view.byteLength,bytesFilled:0,elementSize,ctor,readerType:\"byob\"};var pending=@getByIdDirectPrivate(controller,\"pendingPullIntos\");if(pending\?.isNotEmpty())return pullIntoDescriptor.buffer=@transferBufferToCurrentRealm(pullIntoDescriptor.buffer),pending.push(pullIntoDescriptor),@readableStreamAddReadIntoRequest(stream);if(@getByIdDirectPrivate(stream,\"state\")===@streamClosed){const emptyView=new ctor(pullIntoDescriptor.buffer,pullIntoDescriptor.byteOffset,0);return @createFulfilledPromise({value:emptyView,done:!0})}if(@getByIdDirectPrivate(controller,\"queue\").size>0){if(@readableByteStreamControllerFillDescriptorFromQueue(controller,pullIntoDescriptor)){const filledView=@readableByteStreamControllerConvertDescriptor(pullIntoDescriptor);return @readableByteStreamControllerHandleQueueDrain(controller),@createFulfilledPromise({value:filledView,done:!1})}if(@getByIdDirectPrivate(controller,\"closeRequested\")){const e=@makeTypeError(\"Closing stream has been requested\");return @readableByteStreamControllerError(controller,e),@Promise.@reject(e)}}pullIntoDescriptor.buffer=@transferBufferToCurrentRealm(pullIntoDescriptor.buffer),@getByIdDirectPrivate(controller,\"pendingPullIntos\").push(pullIntoDescriptor);const promise=@readableStreamAddReadIntoRequest(stream);return @readableByteStreamControllerCallPullIfNeeded(controller),promise})\n";
+// writableStreamFinishInFlightWriteWithError
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeLength = 307;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCode = "(function (stream, error) {\"use strict\";\n @getByIdDirectPrivate(stream, \"inFlightWriteRequest\").reject.@call(@undefined, error), @putByIdDirectPrivate(stream, \"inFlightWriteRequest\", @undefined);\n const state = @getByIdDirectPrivate(stream, \"state\");\n @writableStreamDealWithRejection(stream, error);\n})\n";
-// readableStreamAddReadIntoRequest
-const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeLength = 184;
-static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCode = "(function (stream){\"use strict\";const readRequest=@newPromise();return @getByIdDirectPrivate(@getByIdDirectPrivate(stream,\"reader\"),\"readIntoRequests\").push(readRequest),readRequest})\n";
+// writableStreamHasOperationMarkedInFlight
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeLength = 188;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCode = "(function (stream) {\"use strict\";\n return @getByIdDirectPrivate(stream, \"inFlightWriteRequest\") !== @undefined || @getByIdDirectPrivate(stream, \"inFlightCloseRequest\") !== @undefined;\n})\n";
-#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
-JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
-{\
- JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().readableByteStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableByteStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
-}
-WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
-#undef DEFINE_BUILTIN_GENERATOR
+// writableStreamMarkCloseRequestInFlight
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeLength = 237;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCode = "(function (stream) {\"use strict\";\n const closeRequest = @getByIdDirectPrivate(stream, \"closeRequest\");\n @putByIdDirectPrivate(stream, \"inFlightCloseRequest\", closeRequest), @putByIdDirectPrivate(stream, \"closeRequest\", @undefined);\n})\n";
-/* WritableStreamDefaultController.ts */
-// initializeWritableStreamDefaultController
-const JSC::ConstructAbility s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeLength = 388;
-static const JSC::Intrinsic s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCode = "(function (){\"use strict\";return @putByIdDirectPrivate(this,\"queue\",@newQueue()),@putByIdDirectPrivate(this,\"abortSteps\",(reason)=>{const result=@getByIdDirectPrivate(this,\"abortAlgorithm\").@call(@undefined,reason);return @writableStreamDefaultControllerClearAlgorithms(this),result}),@putByIdDirectPrivate(this,\"errorSteps\",()=>{@resetQueue(@getByIdDirectPrivate(this,\"queue\"))}),this})\n";
+// writableStreamMarkFirstWriteRequestInFlight
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeLength = 187;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCode = "(function (stream) {\"use strict\";\n const writeRequest = @getByIdDirectPrivate(stream, \"writeRequests\").shift();\n @putByIdDirectPrivate(stream, \"inFlightWriteRequest\", writeRequest);\n})\n";
-// error
-const JSC::ConstructAbility s_writableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_writableStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_writableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_writableStreamDefaultControllerErrorCodeLength = 311;
-static const JSC::Intrinsic s_writableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamDefaultControllerErrorCode = "(function (e){\"use strict\";if(@getByIdDirectPrivate(this,\"abortSteps\")===@undefined)throw @makeThisTypeError(\"WritableStreamDefaultController\",\"error\");const stream=@getByIdDirectPrivate(this,\"stream\");if(@getByIdDirectPrivate(stream,\"state\")!==\"writable\")return;@writableStreamDefaultControllerError(this,e)})\n";
+// writableStreamRejectCloseAndClosedPromiseIfNeeded
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeLength = 587;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode = "(function (stream) {\"use strict\";\n const storedError = @getByIdDirectPrivate(stream, \"storedError\"), closeRequest = @getByIdDirectPrivate(stream, \"closeRequest\");\n if (closeRequest !== @undefined)\n closeRequest.reject.@call(@undefined, storedError), @putByIdDirectPrivate(stream, \"closeRequest\", @undefined);\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined) {\n const closedPromise = @getByIdDirectPrivate(writer, \"closedPromise\");\n closedPromise.reject.@call(@undefined, storedError), @markPromiseAsHandled(closedPromise.promise);\n }\n})\n";
-#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
-JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
-{\
- JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().writableStreamDefaultControllerBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().writableStreamDefaultControllerBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
-}
-WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
-#undef DEFINE_BUILTIN_GENERATOR
+// writableStreamStartErroring
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamStartErroringCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamStartErroringCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamStartErroringCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamStartErroringCodeLength = 537;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamStartErroringCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamStartErroringCode = "(function (stream, reason) {\"use strict\";\n const controller = @getByIdDirectPrivate(stream, \"controller\");\n @putByIdDirectPrivate(stream, \"state\", \"erroring\"), @putByIdDirectPrivate(stream, \"storedError\", reason);\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined)\n @writableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);\n if (!@writableStreamHasOperationMarkedInFlight(stream) && @getByIdDirectPrivate(controller, \"started\") === 1)\n @writableStreamFinishErroring(stream);\n})\n";
-/* EventSource.ts */
-// getEventSource
-const JSC::ConstructAbility s_eventSourceGetEventSourceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const JSC::ConstructorKind s_eventSourceGetEventSourceCodeConstructorKind = JSC::ConstructorKind::None;
-const JSC::ImplementationVisibility s_eventSourceGetEventSourceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_eventSourceGetEventSourceCodeLength = 8458;
-static const JSC::Intrinsic s_eventSourceGetEventSourceCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_eventSourceGetEventSourceCode = "(function (){\"use strict\";class EventSource extends EventTarget{#url;#state;#onerror;#onmessage;#onopen;#is_tls=!1;#socket=null;#data_buffer=\"\";#send_buffer=\"\";#lastEventID=\"\";#reconnect=!0;#content_length=0;#received_length=0;#reconnection_time=0;#reconnection_timer=null;static#ConnectNextTick(self){self.#connect()}static#SendRequest(socket,url){const self=socket.data,last_event_header=self.#lastEventID\?`Last-Event-ID: ${self.#lastEventID}\\r\\n`:\"\",request=`GET ${url.pathname}${url.search} HTTP/1.1\\r\\nHost: bun\\r\\nContent-type: text/event-stream\\r\\nContent-length: 0\\r\\n${last_event_header}\\r\\n`,sended=socket.write(request);if(sended!==request.length)self.#send_buffer=request.substring(sended)}static#ProcessChunk(self,chunks,offset){for(;;){if(offset>=chunks.length)return;let chunk_end_idx=-1,start_idx=chunks.indexOf(\"\\r\\n\",offset);const chunk_start_idx=start_idx+2;if(start_idx>0)if(self.#content_length===0){const chunk_size=parseInt(chunks.substring(offset,start_idx),16);if(chunk_size===0){self.#state=2,self.#socket\?.end();return}chunk_end_idx=chunk_start_idx+chunk_size}else chunk_end_idx=chunks.length;else{if(self.#data_buffer.length===0){self.#data_buffer+=chunks.substring(offset);return}chunk_end_idx=chunks.length}let chunk=chunks.substring(chunk_start_idx,chunk_end_idx);offset=chunk_end_idx+2;let chunk_offset=0,event_idx=chunk.indexOf(\"\\n\\n\");if(event_idx==-1){self.#data_buffer+=chunks.substring(chunk_start_idx);return}if(self.#data_buffer.length)self.#data_buffer+=chunk,chunk=self.#data_buffer,self.#data_buffer=\"\";let more_events=!0;while(more_events){const event_data=chunk.substring(chunk_offset,event_idx);let type,data=\"\",id,event_line_idx=0,retry=-1;for(;;){let idx=event_data.indexOf(\"\\n\",event_line_idx);if(idx===-1){if(event_line_idx>=event_data.length)break;idx=event_data.length}const line=event_data.substring(event_line_idx,idx);if(line.startsWith(\"data:\"))if(data.length)data+=`\\n${line.substring(5).trim()}`;else data=line.substring(5).trim();else if(line.startsWith(\"event:\"))type=line.substring(6).trim();else if(line.startsWith(\"id:\"))id=line.substring(3).trim();else if(line.startsWith(\"retry:\")){if(retry=parseInt(line.substring(6).trim(),10),retry!==retry)retry=-1}event_line_idx=idx+1}if(self.#lastEventID=id||\"\",retry>=0)self.#reconnection_time=retry;if(data||id||type)self.dispatchEvent(new MessageEvent(type||\"message\",{data:data||\"\",origin:self.#url.origin,source:self,lastEventId:id}));if(chunk.length===event_idx+2){more_events=!1;break}const next_event_idx=chunk.indexOf(\"\\n\\n\",event_idx+1);if(next_event_idx===-1)break;chunk_offset=event_idx,event_idx=next_event_idx}}}static#Handlers={open(socket){const self=socket.data;if(self.#socket=socket,!self.#is_tls)EventSource.#SendRequest(socket,self.#url)},handshake(socket,success,verifyError){const self=socket.data;if(success)EventSource.#SendRequest(socket,self.#url);else self.#state=2,self.dispatchEvent(new ErrorEvent(\"error\",{error:verifyError})),socket.end()},data(socket,buffer){const self=socket.data;switch(self.#state){case 0:{let text=buffer.toString();const headers_idx=text.indexOf(\"\\r\\n\\r\\n\");if(headers_idx===-1){self.#data_buffer+=text;return}if(self.#data_buffer.length)self.#data_buffer+=text,text=self.#data_buffer,self.#data_buffer=\"\";const headers=text.substring(0,headers_idx),status_idx=headers.indexOf(\"\\r\\n\");if(status_idx===-1){self.#state=2,self.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Invalid HTTP request\")})),socket.end();return}const status=headers.substring(0,status_idx);if(status!==\"HTTP/1.1 200 OK\"){self.#state=2,self.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(status)})),socket.end();return}let start_idx=status_idx+1,mime_type_ok=!1,content_length=-1;for(;;){let header_idx=headers.indexOf(\"\\r\\n\",start_idx);if(header_idx===-1){if(start_idx>=headers.length){if(!mime_type_ok)self.#state=2,self.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's response has no MIME type and \"text/event-stream\" is required. Aborting the connection.`)})),socket.end();return}header_idx=headers.length}const header=headers.substring(start_idx+1,header_idx),header_name_idx=header.indexOf(\":\"),header_name=header.substring(0,header_name_idx),is_content_type=header_name.localeCompare(\"content-type\",@undefined,{sensitivity:\"accent\"})===0;if(start_idx=header_idx+1,is_content_type)if(header.endsWith(\" text/event-stream\"))mime_type_ok=!0;else{self.#state=2,self.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's response has a MIME type that is not \"text/event-stream\". Aborting the connection.`)})),socket.end();return}else if(header_name.localeCompare(\"content-length\",@undefined,{sensitivity:\"accent\"})===0){if(content_length=parseInt(header.substring(header_name_idx+1).trim(),10),content_length!==content_length||content_length<=0){self.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"EventSource's Content-Length is invalid. Aborting the connection.\")})),socket.end();return}if(mime_type_ok)break}else if(header_name.localeCompare(\"transfer-encoding\",@undefined,{sensitivity:\"accent\"})===0){if(header.substring(header_name_idx+1).trim()!==\"chunked\"){self.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"EventSource's Transfer-Encoding is invalid. Aborting the connection.\")})),socket.end();return}if(content_length=0,mime_type_ok)break}}self.#content_length=content_length,self.#state=1,self.dispatchEvent(new Event(\"open\"));const chunks=text.substring(headers_idx+4);if(EventSource.#ProcessChunk(self,chunks,0),self.#content_length>0){if(self.#received_length+=chunks.length,self.#received_length>=self.#content_length)self.#state=2,socket.end()}return}case 1:if(EventSource.#ProcessChunk(self,buffer.toString(),2),self.#content_length>0){if(self.#received_length+=buffer.byteLength,self.#received_length>=self.#content_length)self.#state=2,socket.end()}return;default:break}},drain(socket){const self=socket.data;if(self.#state===0){const request=self.#data_buffer;if(request.length){const sended=socket.write(request);if(sended!==request.length)socket.data.#send_buffer=request.substring(sended);else socket.data.#send_buffer=\"\"}}},close:EventSource.#Close,end(socket){EventSource.#Close(socket).dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Connection closed by server\")}))},timeout(socket){EventSource.#Close(socket).dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Timeout\")}))},binaryType:\"buffer\"};static#Close(socket){const self=socket.data;if(self.#socket=null,self.#received_length=0,self.#state=2,self.#reconnect){if(self.#reconnection_timer)clearTimeout(self.#reconnection_timer);self.#reconnection_timer=setTimeout(EventSource.#ConnectNextTick,self.#reconnection_time,self)}return self}constructor(url,options=@undefined){super();const uri=new URL(url);this.#is_tls=uri.protocol===\"https:\",this.#url=uri,this.#state=2,process.nextTick(EventSource.#ConnectNextTick,this)}ref(){this.#reconnection_timer\?.ref(),this.#socket\?.ref()}unref(){this.#reconnection_timer\?.unref(),this.#socket\?.unref()}#connect(){if(this.#state!==2)return;const uri=this.#url,is_tls=this.#is_tls;this.#state=0,@Bun.connect({data:this,socket:EventSource.#Handlers,hostname:uri.hostname,port:parseInt(uri.port||(is_tls\?\"443\":\"80\"),10),tls:is_tls\?{requestCert:!0,rejectUnauthorized:!1}:!1}).catch((err)=>{if(super.dispatchEvent(new ErrorEvent(\"error\",{error:err})),this.#reconnect){if(this.#reconnection_timer)this.#reconnection_timer.unref\?.();this.#reconnection_timer=setTimeout(EventSource.#ConnectNextTick,1000,this)}})}get url(){return this.#url.href}get readyState(){return this.#state}close(){this.#reconnect=!1,this.#state=2,this.#socket\?.unref(),this.#socket\?.end()}get onopen(){return this.#onopen}get onerror(){return this.#onerror}get onmessage(){return this.#onmessage}set onopen(cb){if(this.#onopen)super.removeEventListener(\"close\",this.#onopen);super.addEventListener(\"open\",cb),this.#onopen=cb}set onerror(cb){if(this.#onerror)super.removeEventListener(\"error\",this.#onerror);super.addEventListener(\"error\",cb),this.#onerror=cb}set onmessage(cb){if(this.#onmessage)super.removeEventListener(\"message\",this.#onmessage);super.addEventListener(\"message\",cb),this.#onmessage=cb}}return Object.defineProperty(EventSource.prototype,\"CONNECTING\",{enumerable:!0,value:0}),Object.defineProperty(EventSource.prototype,\"OPEN\",{enumerable:!0,value:1}),Object.defineProperty(EventSource.prototype,\"CLOSED\",{enumerable:!0,value:2}),EventSource})\n";
+// writableStreamUpdateBackpressure
+const JSC::ConstructAbility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_writableStreamInternalsWritableStreamUpdateBackpressureCodeLength = 453;
+static const JSC::Intrinsic s_writableStreamInternalsWritableStreamUpdateBackpressureCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_writableStreamInternalsWritableStreamUpdateBackpressureCode = "(function (stream, backpressure) {\"use strict\";\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined && backpressure !== @getByIdDirectPrivate(stream, \"backpressure\"))\n if (backpressure)\n @putByIdDirectPrivate(writer, \"readyPromise\", @newPromiseCapability(@Promise));\n else\n @getByIdDirectPrivate(writer, \"readyPromise\").resolve.@call();\n @putByIdDirectPrivate(stream, \"backpressure\", backpressure);\n})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
{\
JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
- return clientData->builtinFunctions().eventSourceBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().eventSourceBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+ return clientData->builtinFunctions().writableStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().writableStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
}
-WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
JSBuiltinInternalFunctions::JSBuiltinInternalFunctions(JSC::VM& vm)
: m_vm(vm)
- , m_writableStreamInternals(vm)
- , m_transformStreamInternals(vm)
+ , m_readableByteStreamInternals(vm)
, m_readableStreamInternals(vm)
, m_streamInternals(vm)
- , m_readableByteStreamInternals(vm)
+ , m_transformStreamInternals(vm)
+ , m_writableStreamInternals(vm)
{
UNUSED_PARAM(vm);
@@ -3030,11 +3054,11 @@ JSBuiltinInternalFunctions::JSBuiltinInternalFunctions(JSC::VM& vm)
template<typename Visitor>
void JSBuiltinInternalFunctions::visit(Visitor& visitor)
{
- m_writableStreamInternals.visit(visitor);
- m_transformStreamInternals.visit(visitor);
+ m_readableByteStreamInternals.visit(visitor);
m_readableStreamInternals.visit(visitor);
m_streamInternals.visit(visitor);
- m_readableByteStreamInternals.visit(visitor);
+ m_transformStreamInternals.visit(visitor);
+ m_writableStreamInternals.visit(visitor);
UNUSED_PARAM(visitor);
}
@@ -3045,23 +3069,18 @@ template void JSBuiltinInternalFunctions::visit(SlotVisitor&);
SUPPRESS_ASAN void JSBuiltinInternalFunctions::initialize(Zig::GlobalObject& globalObject)
{
UNUSED_PARAM(globalObject);
- m_writableStreamInternals.init(globalObject);
- m_transformStreamInternals.init(globalObject);
+ m_readableByteStreamInternals.init(globalObject);
m_readableStreamInternals.init(globalObject);
m_streamInternals.init(globalObject);
- m_readableByteStreamInternals.init(globalObject);
+ m_transformStreamInternals.init(globalObject);
+ m_writableStreamInternals.init(globalObject);
JSVMClientData& clientData = *static_cast<JSVMClientData*>(m_vm.clientData);
Zig::GlobalObject::GlobalPropertyInfo staticGlobals[] = {
#define DECLARE_GLOBAL_STATIC(name) \
Zig::GlobalObject::GlobalPropertyInfo( \
- clientData.builtinFunctions().writableStreamInternalsBuiltins().name##PrivateName(), writableStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly),
- WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
- #undef DECLARE_GLOBAL_STATIC
- #define DECLARE_GLOBAL_STATIC(name) \
- Zig::GlobalObject::GlobalPropertyInfo( \
- clientData.builtinFunctions().transformStreamInternalsBuiltins().name##PrivateName(), transformStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly),
- WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
+ clientData.builtinFunctions().readableByteStreamInternalsBuiltins().name##PrivateName(), readableByteStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly),
+ WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
#undef DECLARE_GLOBAL_STATIC
#define DECLARE_GLOBAL_STATIC(name) \
Zig::GlobalObject::GlobalPropertyInfo( \
@@ -3075,8 +3094,13 @@ SUPPRESS_ASAN void JSBuiltinInternalFunctions::initialize(Zig::GlobalObject& glo
#undef DECLARE_GLOBAL_STATIC
#define DECLARE_GLOBAL_STATIC(name) \
Zig::GlobalObject::GlobalPropertyInfo( \
- clientData.builtinFunctions().readableByteStreamInternalsBuiltins().name##PrivateName(), readableByteStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly),
- WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
+ clientData.builtinFunctions().transformStreamInternalsBuiltins().name##PrivateName(), transformStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly),
+ WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
+ #undef DECLARE_GLOBAL_STATIC
+ #define DECLARE_GLOBAL_STATIC(name) \
+ Zig::GlobalObject::GlobalPropertyInfo( \
+ clientData.builtinFunctions().writableStreamInternalsBuiltins().name##PrivateName(), writableStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly),
+ WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
#undef DECLARE_GLOBAL_STATIC
};
diff --git a/src/js/out/WebCoreJSBuiltins.d.ts b/src/js/out/WebCoreJSBuiltins.d.ts
index b05f2b681..f98462498 100644
--- a/src/js/out/WebCoreJSBuiltins.d.ts
+++ b/src/js/out/WebCoreJSBuiltins.d.ts
@@ -2,198 +2,198 @@
// Do not edit by hand.
type RemoveThis<F> = F extends (this: infer T, ...args: infer A) => infer R ? (...args: A) => R : F;
-// WritableStreamInternals.ts
-declare const $isWritableStream: RemoveThis<typeof import("../builtins/WritableStreamInternals")["isWritableStream"]>;
-declare const $isWritableStreamDefaultWriter: RemoveThis<typeof import("../builtins/WritableStreamInternals")["isWritableStreamDefaultWriter"]>;
-declare const $acquireWritableStreamDefaultWriter: RemoveThis<typeof import("../builtins/WritableStreamInternals")["acquireWritableStreamDefaultWriter"]>;
-declare const $createWritableStream: RemoveThis<typeof import("../builtins/WritableStreamInternals")["createWritableStream"]>;
-declare const $createInternalWritableStreamFromUnderlyingSink: RemoveThis<typeof import("../builtins/WritableStreamInternals")["createInternalWritableStreamFromUnderlyingSink"]>;
-declare const $initializeWritableStreamSlots: RemoveThis<typeof import("../builtins/WritableStreamInternals")["initializeWritableStreamSlots"]>;
-declare const $writableStreamCloseForBindings: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamCloseForBindings"]>;
-declare const $writableStreamAbortForBindings: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamAbortForBindings"]>;
-declare const $isWritableStreamLocked: RemoveThis<typeof import("../builtins/WritableStreamInternals")["isWritableStreamLocked"]>;
-declare const $setUpWritableStreamDefaultWriter: RemoveThis<typeof import("../builtins/WritableStreamInternals")["setUpWritableStreamDefaultWriter"]>;
-declare const $writableStreamAbort: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamAbort"]>;
-declare const $writableStreamClose: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamClose"]>;
-declare const $writableStreamAddWriteRequest: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamAddWriteRequest"]>;
-declare const $writableStreamCloseQueuedOrInFlight: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamCloseQueuedOrInFlight"]>;
-declare const $writableStreamDealWithRejection: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDealWithRejection"]>;
-declare const $writableStreamFinishErroring: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamFinishErroring"]>;
-declare const $writableStreamFinishInFlightClose: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamFinishInFlightClose"]>;
-declare const $writableStreamFinishInFlightCloseWithError: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamFinishInFlightCloseWithError"]>;
-declare const $writableStreamFinishInFlightWrite: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamFinishInFlightWrite"]>;
-declare const $writableStreamFinishInFlightWriteWithError: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamFinishInFlightWriteWithError"]>;
-declare const $writableStreamHasOperationMarkedInFlight: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamHasOperationMarkedInFlight"]>;
-declare const $writableStreamMarkCloseRequestInFlight: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamMarkCloseRequestInFlight"]>;
-declare const $writableStreamMarkFirstWriteRequestInFlight: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamMarkFirstWriteRequestInFlight"]>;
-declare const $writableStreamRejectCloseAndClosedPromiseIfNeeded: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamRejectCloseAndClosedPromiseIfNeeded"]>;
-declare const $writableStreamStartErroring: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamStartErroring"]>;
-declare const $writableStreamUpdateBackpressure: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamUpdateBackpressure"]>;
-declare const $writableStreamDefaultWriterAbort: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterAbort"]>;
-declare const $writableStreamDefaultWriterClose: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterClose"]>;
-declare const $writableStreamDefaultWriterCloseWithErrorPropagation: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterCloseWithErrorPropagation"]>;
-declare const $writableStreamDefaultWriterEnsureClosedPromiseRejected: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterEnsureClosedPromiseRejected"]>;
-declare const $writableStreamDefaultWriterEnsureReadyPromiseRejected: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterEnsureReadyPromiseRejected"]>;
-declare const $writableStreamDefaultWriterGetDesiredSize: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterGetDesiredSize"]>;
-declare const $writableStreamDefaultWriterRelease: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterRelease"]>;
-declare const $writableStreamDefaultWriterWrite: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterWrite"]>;
-declare const $setUpWritableStreamDefaultController: RemoveThis<typeof import("../builtins/WritableStreamInternals")["setUpWritableStreamDefaultController"]>;
-declare const $writableStreamDefaultControllerStart: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerStart"]>;
-declare const $setUpWritableStreamDefaultControllerFromUnderlyingSink: RemoveThis<typeof import("../builtins/WritableStreamInternals")["setUpWritableStreamDefaultControllerFromUnderlyingSink"]>;
-declare const $writableStreamDefaultControllerAdvanceQueueIfNeeded: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerAdvanceQueueIfNeeded"]>;
-declare const $isCloseSentinel: RemoveThis<typeof import("../builtins/WritableStreamInternals")["isCloseSentinel"]>;
-declare const $writableStreamDefaultControllerClearAlgorithms: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerClearAlgorithms"]>;
-declare const $writableStreamDefaultControllerClose: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerClose"]>;
-declare const $writableStreamDefaultControllerError: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerError"]>;
-declare const $writableStreamDefaultControllerErrorIfNeeded: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerErrorIfNeeded"]>;
-declare const $writableStreamDefaultControllerGetBackpressure: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerGetBackpressure"]>;
-declare const $writableStreamDefaultControllerGetChunkSize: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerGetChunkSize"]>;
-declare const $writableStreamDefaultControllerGetDesiredSize: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerGetDesiredSize"]>;
-declare const $writableStreamDefaultControllerProcessClose: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerProcessClose"]>;
-declare const $writableStreamDefaultControllerProcessWrite: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerProcessWrite"]>;
-declare const $writableStreamDefaultControllerWrite: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerWrite"]>;
-
-// TransformStreamInternals.ts
-declare const $isTransformStream: RemoveThis<typeof import("../builtins/TransformStreamInternals")["isTransformStream"]>;
-declare const $isTransformStreamDefaultController: RemoveThis<typeof import("../builtins/TransformStreamInternals")["isTransformStreamDefaultController"]>;
-declare const $createTransformStream: RemoveThis<typeof import("../builtins/TransformStreamInternals")["createTransformStream"]>;
-declare const $initializeTransformStream: RemoveThis<typeof import("../builtins/TransformStreamInternals")["initializeTransformStream"]>;
-declare const $transformStreamError: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamError"]>;
-declare const $transformStreamErrorWritableAndUnblockWrite: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamErrorWritableAndUnblockWrite"]>;
-declare const $transformStreamSetBackpressure: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamSetBackpressure"]>;
-declare const $setUpTransformStreamDefaultController: RemoveThis<typeof import("../builtins/TransformStreamInternals")["setUpTransformStreamDefaultController"]>;
-declare const $setUpTransformStreamDefaultControllerFromTransformer: RemoveThis<typeof import("../builtins/TransformStreamInternals")["setUpTransformStreamDefaultControllerFromTransformer"]>;
-declare const $transformStreamDefaultControllerClearAlgorithms: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultControllerClearAlgorithms"]>;
-declare const $transformStreamDefaultControllerEnqueue: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultControllerEnqueue"]>;
-declare const $transformStreamDefaultControllerError: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultControllerError"]>;
-declare const $transformStreamDefaultControllerPerformTransform: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultControllerPerformTransform"]>;
-declare const $transformStreamDefaultControllerTerminate: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultControllerTerminate"]>;
-declare const $transformStreamDefaultSinkWriteAlgorithm: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultSinkWriteAlgorithm"]>;
-declare const $transformStreamDefaultSinkAbortAlgorithm: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultSinkAbortAlgorithm"]>;
-declare const $transformStreamDefaultSinkCloseAlgorithm: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultSinkCloseAlgorithm"]>;
-declare const $transformStreamDefaultSourcePullAlgorithm: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultSourcePullAlgorithm"]>;
+// ReadableByteStreamInternals.ts
+declare const $isReadableByteStreamController: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["isReadableByteStreamController"]>;
+declare const $isReadableStreamBYOBReader: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["isReadableStreamBYOBReader"]>;
+declare const $isReadableStreamBYOBRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["isReadableStreamBYOBRequest"]>;
+declare const $privateInitializeReadableByteStreamController: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["privateInitializeReadableByteStreamController"]>;
+declare const $privateInitializeReadableStreamBYOBRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["privateInitializeReadableStreamBYOBRequest"]>;
+declare const $readableByteStreamControllerCallPullIfNeeded: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerCallPullIfNeeded"]>;
+declare const $readableByteStreamControllerCancel: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerCancel"]>;
+declare const $readableByteStreamControllerClearPendingPullIntos: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerClearPendingPullIntos"]>;
+declare const $readableByteStreamControllerClose: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerClose"]>;
+declare const $readableByteStreamControllerCommitDescriptor: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerCommitDescriptor"]>;
+declare const $readableByteStreamControllerConvertDescriptor: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerConvertDescriptor"]>;
+declare const $readableByteStreamControllerEnqueue: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerEnqueue"]>;
+declare const $readableByteStreamControllerEnqueueChunk: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerEnqueueChunk"]>;
+declare const $readableByteStreamControllerError: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerError"]>;
+declare const $readableByteStreamControllerFillDescriptorFromQueue: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerFillDescriptorFromQueue"]>;
+declare const $readableByteStreamControllerGetDesiredSize: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerGetDesiredSize"]>;
+declare const $readableByteStreamControllerHandleQueueDrain: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerHandleQueueDrain"]>;
+declare const $readableByteStreamControllerInvalidateBYOBRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerInvalidateBYOBRequest"]>;
+declare const $readableByteStreamControllerProcessPullDescriptors: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerProcessPullDescriptors"]>;
+declare const $readableByteStreamControllerPull: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerPull"]>;
+declare const $readableByteStreamControllerPullInto: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerPullInto"]>;
+declare const $readableByteStreamControllerRespond: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespond"]>;
+declare const $readableByteStreamControllerRespondInClosedState: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondInClosedState"]>;
+declare const $readableByteStreamControllerRespondInReadableState: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondInReadableState"]>;
+declare const $readableByteStreamControllerRespondInternal: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondInternal"]>;
+declare const $readableByteStreamControllerRespondWithNewView: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondWithNewView"]>;
+declare const $readableByteStreamControllerShiftPendingDescriptor: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerShiftPendingDescriptor"]>;
+declare const $readableByteStreamControllerShouldCallPull: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerShouldCallPull"]>;
+declare const $readableStreamAddReadIntoRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamAddReadIntoRequest"]>;
+declare const $readableStreamBYOBReaderRead: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamBYOBReaderRead"]>;
+declare const $readableStreamByteStreamControllerStart: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamByteStreamControllerStart"]>;
+declare const $readableStreamFulfillReadIntoRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamFulfillReadIntoRequest"]>;
+declare const $readableStreamHasBYOBReader: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamHasBYOBReader"]>;
+declare const $readableStreamHasDefaultReader: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamHasDefaultReader"]>;
+declare const $readableStreamReaderKind: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamReaderKind"]>;
+declare const $transferBufferToCurrentRealm: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["transferBufferToCurrentRealm"]>;
// ReadableStreamInternals.ts
-declare const $readableStreamReaderGenericInitialize: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamReaderGenericInitialize"]>;
-declare const $privateInitializeReadableStreamDefaultController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["privateInitializeReadableStreamDefaultController"]>;
-declare const $readableStreamDefaultControllerError: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerError"]>;
-declare const $readableStreamPipeTo: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamPipeTo"]>;
declare const $acquireReadableStreamDefaultReader: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["acquireReadableStreamDefaultReader"]>;
-declare const $setupReadableStreamDefaultController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["setupReadableStreamDefaultController"]>;
-declare const $createReadableStreamController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["createReadableStreamController"]>;
-declare const $readableStreamDefaultControllerStart: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerStart"]>;
-declare const $readableStreamPipeToWritableStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamPipeToWritableStream"]>;
-declare const $pipeToLoop: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToLoop"]>;
-declare const $pipeToDoReadWrite: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToDoReadWrite"]>;
-declare const $pipeToErrorsMustBePropagatedForward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToErrorsMustBePropagatedForward"]>;
-declare const $pipeToErrorsMustBePropagatedBackward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToErrorsMustBePropagatedBackward"]>;
-declare const $pipeToClosingMustBePropagatedForward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToClosingMustBePropagatedForward"]>;
-declare const $pipeToClosingMustBePropagatedBackward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToClosingMustBePropagatedBackward"]>;
-declare const $pipeToShutdownWithAction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToShutdownWithAction"]>;
-declare const $pipeToShutdown: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToShutdown"]>;
-declare const $pipeToFinalize: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToFinalize"]>;
-declare const $readableStreamTee: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTee"]>;
-declare const $readableStreamTeePullFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTeePullFunction"]>;
-declare const $readableStreamTeeBranch1CancelFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTeeBranch1CancelFunction"]>;
-declare const $readableStreamTeeBranch2CancelFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTeeBranch2CancelFunction"]>;
-declare const $isReadableStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStream"]>;
-declare const $isReadableStreamDefaultReader: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamDefaultReader"]>;
-declare const $isReadableStreamDefaultController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamDefaultController"]>;
-declare const $readDirectStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readDirectStream"]>;
declare const $assignToStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["assignToStream"]>;
-declare const $readStreamIntoSink: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readStreamIntoSink"]>;
+declare const $createReadableStreamController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["createReadableStreamController"]>;
+declare const $createTextStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["createTextStream"]>;
declare const $handleDirectStreamError: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["handleDirectStreamError"]>;
declare const $handleDirectStreamErrorReject: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["handleDirectStreamErrorReject"]>;
-declare const $onPullDirectStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["onPullDirectStream"]>;
+declare const $initializeArrayBufferStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["initializeArrayBufferStream"]>;
+declare const $initializeArrayStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["initializeArrayStream"]>;
+declare const $initializeTextStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["initializeTextStream"]>;
+declare const $isReadableStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStream"]>;
+declare const $isReadableStreamDefaultController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamDefaultController"]>;
+declare const $isReadableStreamDefaultReader: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamDefaultReader"]>;
+declare const $isReadableStreamDisturbed: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamDisturbed"]>;
+declare const $isReadableStreamLocked: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamLocked"]>;
+declare const $lazyLoadStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["lazyLoadStream"]>;
declare const $noopDoneFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["noopDoneFunction"]>;
-declare const $onReadableStreamDirectControllerClosed: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["onReadableStreamDirectControllerClosed"]>;
declare const $onCloseDirectStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["onCloseDirectStream"]>;
declare const $onFlushDirectStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["onFlushDirectStream"]>;
-declare const $createTextStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["createTextStream"]>;
-declare const $initializeTextStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["initializeTextStream"]>;
-declare const $initializeArrayStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["initializeArrayStream"]>;
-declare const $initializeArrayBufferStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["initializeArrayBufferStream"]>;
-declare const $readableStreamError: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamError"]>;
-declare const $readableStreamDefaultControllerShouldCallPull: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerShouldCallPull"]>;
-declare const $readableStreamDefaultControllerCallPullIfNeeded: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerCallPullIfNeeded"]>;
-declare const $isReadableStreamLocked: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamLocked"]>;
-declare const $readableStreamDefaultControllerGetDesiredSize: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerGetDesiredSize"]>;
-declare const $readableStreamReaderGenericCancel: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamReaderGenericCancel"]>;
+declare const $onPullDirectStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["onPullDirectStream"]>;
+declare const $onReadableStreamDirectControllerClosed: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["onReadableStreamDirectControllerClosed"]>;
+declare const $pipeToClosingMustBePropagatedBackward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToClosingMustBePropagatedBackward"]>;
+declare const $pipeToClosingMustBePropagatedForward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToClosingMustBePropagatedForward"]>;
+declare const $pipeToDoReadWrite: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToDoReadWrite"]>;
+declare const $pipeToErrorsMustBePropagatedBackward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToErrorsMustBePropagatedBackward"]>;
+declare const $pipeToErrorsMustBePropagatedForward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToErrorsMustBePropagatedForward"]>;
+declare const $pipeToFinalize: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToFinalize"]>;
+declare const $pipeToLoop: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToLoop"]>;
+declare const $pipeToShutdown: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToShutdown"]>;
+declare const $pipeToShutdownWithAction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToShutdownWithAction"]>;
+declare const $privateInitializeReadableStreamDefaultController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["privateInitializeReadableStreamDefaultController"]>;
+declare const $readableStreamAddReadRequest: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamAddReadRequest"]>;
declare const $readableStreamCancel: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamCancel"]>;
+declare const $readableStreamClose: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamClose"]>;
+declare const $readableStreamDefaultControllerCallPullIfNeeded: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerCallPullIfNeeded"]>;
declare const $readableStreamDefaultControllerCancel: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerCancel"]>;
-declare const $readableStreamDefaultControllerPull: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerPull"]>;
+declare const $readableStreamDefaultControllerCanCloseOrEnqueue: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerCanCloseOrEnqueue"]>;
declare const $readableStreamDefaultControllerClose: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerClose"]>;
-declare const $readableStreamClose: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamClose"]>;
-declare const $readableStreamFulfillReadRequest: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamFulfillReadRequest"]>;
declare const $readableStreamDefaultControllerEnqueue: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerEnqueue"]>;
+declare const $readableStreamDefaultControllerError: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerError"]>;
+declare const $readableStreamDefaultControllerGetDesiredSize: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerGetDesiredSize"]>;
+declare const $readableStreamDefaultControllerPull: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerPull"]>;
+declare const $readableStreamDefaultControllerShouldCallPull: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerShouldCallPull"]>;
+declare const $readableStreamDefaultControllerStart: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerStart"]>;
declare const $readableStreamDefaultReaderRead: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultReaderRead"]>;
-declare const $readableStreamAddReadRequest: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamAddReadRequest"]>;
-declare const $isReadableStreamDisturbed: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamDisturbed"]>;
-declare const $readableStreamReaderGenericRelease: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamReaderGenericRelease"]>;
-declare const $readableStreamDefaultControllerCanCloseOrEnqueue: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerCanCloseOrEnqueue"]>;
-declare const $lazyLoadStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["lazyLoadStream"]>;
+declare const $readableStreamDefineLazyIterators: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefineLazyIterators"]>;
+declare const $readableStreamError: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamError"]>;
+declare const $readableStreamFulfillReadRequest: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamFulfillReadRequest"]>;
declare const $readableStreamIntoArray: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamIntoArray"]>;
declare const $readableStreamIntoText: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamIntoText"]>;
+declare const $readableStreamPipeTo: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamPipeTo"]>;
+declare const $readableStreamPipeToWritableStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamPipeToWritableStream"]>;
+declare const $readableStreamReaderGenericCancel: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamReaderGenericCancel"]>;
+declare const $readableStreamReaderGenericInitialize: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamReaderGenericInitialize"]>;
+declare const $readableStreamReaderGenericRelease: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamReaderGenericRelease"]>;
+declare const $readableStreamTee: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTee"]>;
+declare const $readableStreamTeeBranch1CancelFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTeeBranch1CancelFunction"]>;
+declare const $readableStreamTeeBranch2CancelFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTeeBranch2CancelFunction"]>;
+declare const $readableStreamTeePullFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTeePullFunction"]>;
declare const $readableStreamToArrayBufferDirect: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamToArrayBufferDirect"]>;
-declare const $readableStreamToTextDirect: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamToTextDirect"]>;
declare const $readableStreamToArrayDirect: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamToArrayDirect"]>;
-declare const $readableStreamDefineLazyIterators: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefineLazyIterators"]>;
+declare const $readableStreamToTextDirect: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamToTextDirect"]>;
+declare const $readDirectStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readDirectStream"]>;
+declare const $readStreamIntoSink: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readStreamIntoSink"]>;
+declare const $setupReadableStreamDefaultController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["setupReadableStreamDefaultController"]>;
// StreamInternals.ts
-declare const $markPromiseAsHandled: RemoveThis<typeof import("../builtins/StreamInternals")["markPromiseAsHandled"]>;
-declare const $shieldingPromiseResolve: RemoveThis<typeof import("../builtins/StreamInternals")["shieldingPromiseResolve"]>;
-declare const $promiseInvokeOrNoopMethodNoCatch: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoopMethodNoCatch"]>;
-declare const $promiseInvokeOrNoopNoCatch: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoopNoCatch"]>;
-declare const $promiseInvokeOrNoopMethod: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoopMethod"]>;
-declare const $promiseInvokeOrNoop: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoop"]>;
-declare const $promiseInvokeOrFallbackOrNoop: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrFallbackOrNoop"]>;
-declare const $validateAndNormalizeQueuingStrategy: RemoveThis<typeof import("../builtins/StreamInternals")["validateAndNormalizeQueuingStrategy"]>;
declare const $createFIFO: RemoveThis<typeof import("../builtins/StreamInternals")["createFIFO"]>;
-declare const $newQueue: RemoveThis<typeof import("../builtins/StreamInternals")["newQueue"]>;
+declare const $createFulfilledPromise: RemoveThis<typeof import("../builtins/StreamInternals")["createFulfilledPromise"]>;
declare const $dequeueValue: RemoveThis<typeof import("../builtins/StreamInternals")["dequeueValue"]>;
declare const $enqueueValueWithSize: RemoveThis<typeof import("../builtins/StreamInternals")["enqueueValueWithSize"]>;
-declare const $peekQueueValue: RemoveThis<typeof import("../builtins/StreamInternals")["peekQueueValue"]>;
-declare const $resetQueue: RemoveThis<typeof import("../builtins/StreamInternals")["resetQueue"]>;
-declare const $extractSizeAlgorithm: RemoveThis<typeof import("../builtins/StreamInternals")["extractSizeAlgorithm"]>;
declare const $extractHighWaterMark: RemoveThis<typeof import("../builtins/StreamInternals")["extractHighWaterMark"]>;
declare const $extractHighWaterMarkFromQueuingStrategyInit: RemoveThis<typeof import("../builtins/StreamInternals")["extractHighWaterMarkFromQueuingStrategyInit"]>;
-declare const $createFulfilledPromise: RemoveThis<typeof import("../builtins/StreamInternals")["createFulfilledPromise"]>;
+declare const $extractSizeAlgorithm: RemoveThis<typeof import("../builtins/StreamInternals")["extractSizeAlgorithm"]>;
+declare const $markPromiseAsHandled: RemoveThis<typeof import("../builtins/StreamInternals")["markPromiseAsHandled"]>;
+declare const $newQueue: RemoveThis<typeof import("../builtins/StreamInternals")["newQueue"]>;
+declare const $peekQueueValue: RemoveThis<typeof import("../builtins/StreamInternals")["peekQueueValue"]>;
+declare const $promiseInvokeOrFallbackOrNoop: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrFallbackOrNoop"]>;
+declare const $promiseInvokeOrNoop: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoop"]>;
+declare const $promiseInvokeOrNoopMethod: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoopMethod"]>;
+declare const $promiseInvokeOrNoopMethodNoCatch: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoopMethodNoCatch"]>;
+declare const $promiseInvokeOrNoopNoCatch: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoopNoCatch"]>;
+declare const $resetQueue: RemoveThis<typeof import("../builtins/StreamInternals")["resetQueue"]>;
+declare const $shieldingPromiseResolve: RemoveThis<typeof import("../builtins/StreamInternals")["shieldingPromiseResolve"]>;
declare const $toDictionary: RemoveThis<typeof import("../builtins/StreamInternals")["toDictionary"]>;
+declare const $validateAndNormalizeQueuingStrategy: RemoveThis<typeof import("../builtins/StreamInternals")["validateAndNormalizeQueuingStrategy"]>;
-// ReadableByteStreamInternals.ts
-declare const $privateInitializeReadableByteStreamController: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["privateInitializeReadableByteStreamController"]>;
-declare const $readableStreamByteStreamControllerStart: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamByteStreamControllerStart"]>;
-declare const $privateInitializeReadableStreamBYOBRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["privateInitializeReadableStreamBYOBRequest"]>;
-declare const $isReadableByteStreamController: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["isReadableByteStreamController"]>;
-declare const $isReadableStreamBYOBRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["isReadableStreamBYOBRequest"]>;
-declare const $isReadableStreamBYOBReader: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["isReadableStreamBYOBReader"]>;
-declare const $readableByteStreamControllerCancel: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerCancel"]>;
-declare const $readableByteStreamControllerError: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerError"]>;
-declare const $readableByteStreamControllerClose: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerClose"]>;
-declare const $readableByteStreamControllerClearPendingPullIntos: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerClearPendingPullIntos"]>;
-declare const $readableByteStreamControllerGetDesiredSize: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerGetDesiredSize"]>;
-declare const $readableStreamHasBYOBReader: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamHasBYOBReader"]>;
-declare const $readableStreamHasDefaultReader: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamHasDefaultReader"]>;
-declare const $readableByteStreamControllerHandleQueueDrain: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerHandleQueueDrain"]>;
-declare const $readableByteStreamControllerPull: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerPull"]>;
-declare const $readableByteStreamControllerShouldCallPull: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerShouldCallPull"]>;
-declare const $readableByteStreamControllerCallPullIfNeeded: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerCallPullIfNeeded"]>;
-declare const $transferBufferToCurrentRealm: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["transferBufferToCurrentRealm"]>;
-declare const $readableStreamReaderKind: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamReaderKind"]>;
-declare const $readableByteStreamControllerEnqueue: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerEnqueue"]>;
-declare const $readableByteStreamControllerEnqueueChunk: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerEnqueueChunk"]>;
-declare const $readableByteStreamControllerRespondWithNewView: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondWithNewView"]>;
-declare const $readableByteStreamControllerRespond: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespond"]>;
-declare const $readableByteStreamControllerRespondInternal: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondInternal"]>;
-declare const $readableByteStreamControllerRespondInReadableState: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondInReadableState"]>;
-declare const $readableByteStreamControllerRespondInClosedState: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondInClosedState"]>;
-declare const $readableByteStreamControllerProcessPullDescriptors: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerProcessPullDescriptors"]>;
-declare const $readableByteStreamControllerFillDescriptorFromQueue: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerFillDescriptorFromQueue"]>;
-declare const $readableByteStreamControllerShiftPendingDescriptor: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerShiftPendingDescriptor"]>;
-declare const $readableByteStreamControllerInvalidateBYOBRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerInvalidateBYOBRequest"]>;
-declare const $readableByteStreamControllerCommitDescriptor: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerCommitDescriptor"]>;
-declare const $readableByteStreamControllerConvertDescriptor: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerConvertDescriptor"]>;
-declare const $readableStreamFulfillReadIntoRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamFulfillReadIntoRequest"]>;
-declare const $readableStreamBYOBReaderRead: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamBYOBReaderRead"]>;
-declare const $readableByteStreamControllerPullInto: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerPullInto"]>;
-declare const $readableStreamAddReadIntoRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamAddReadIntoRequest"]>;
+// TransformStreamInternals.ts
+declare const $createTransformStream: RemoveThis<typeof import("../builtins/TransformStreamInternals")["createTransformStream"]>;
+declare const $initializeTransformStream: RemoveThis<typeof import("../builtins/TransformStreamInternals")["initializeTransformStream"]>;
+declare const $isTransformStream: RemoveThis<typeof import("../builtins/TransformStreamInternals")["isTransformStream"]>;
+declare const $isTransformStreamDefaultController: RemoveThis<typeof import("../builtins/TransformStreamInternals")["isTransformStreamDefaultController"]>;
+declare const $setUpTransformStreamDefaultController: RemoveThis<typeof import("../builtins/TransformStreamInternals")["setUpTransformStreamDefaultController"]>;
+declare const $setUpTransformStreamDefaultControllerFromTransformer: RemoveThis<typeof import("../builtins/TransformStreamInternals")["setUpTransformStreamDefaultControllerFromTransformer"]>;
+declare const $transformStreamDefaultControllerClearAlgorithms: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultControllerClearAlgorithms"]>;
+declare const $transformStreamDefaultControllerEnqueue: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultControllerEnqueue"]>;
+declare const $transformStreamDefaultControllerError: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultControllerError"]>;
+declare const $transformStreamDefaultControllerPerformTransform: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultControllerPerformTransform"]>;
+declare const $transformStreamDefaultControllerTerminate: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultControllerTerminate"]>;
+declare const $transformStreamDefaultSinkAbortAlgorithm: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultSinkAbortAlgorithm"]>;
+declare const $transformStreamDefaultSinkCloseAlgorithm: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultSinkCloseAlgorithm"]>;
+declare const $transformStreamDefaultSinkWriteAlgorithm: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultSinkWriteAlgorithm"]>;
+declare const $transformStreamDefaultSourcePullAlgorithm: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultSourcePullAlgorithm"]>;
+declare const $transformStreamError: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamError"]>;
+declare const $transformStreamErrorWritableAndUnblockWrite: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamErrorWritableAndUnblockWrite"]>;
+declare const $transformStreamSetBackpressure: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamSetBackpressure"]>;
+
+// WritableStreamInternals.ts
+declare const $acquireWritableStreamDefaultWriter: RemoveThis<typeof import("../builtins/WritableStreamInternals")["acquireWritableStreamDefaultWriter"]>;
+declare const $createInternalWritableStreamFromUnderlyingSink: RemoveThis<typeof import("../builtins/WritableStreamInternals")["createInternalWritableStreamFromUnderlyingSink"]>;
+declare const $createWritableStream: RemoveThis<typeof import("../builtins/WritableStreamInternals")["createWritableStream"]>;
+declare const $initializeWritableStreamSlots: RemoveThis<typeof import("../builtins/WritableStreamInternals")["initializeWritableStreamSlots"]>;
+declare const $isCloseSentinel: RemoveThis<typeof import("../builtins/WritableStreamInternals")["isCloseSentinel"]>;
+declare const $isWritableStream: RemoveThis<typeof import("../builtins/WritableStreamInternals")["isWritableStream"]>;
+declare const $isWritableStreamDefaultWriter: RemoveThis<typeof import("../builtins/WritableStreamInternals")["isWritableStreamDefaultWriter"]>;
+declare const $isWritableStreamLocked: RemoveThis<typeof import("../builtins/WritableStreamInternals")["isWritableStreamLocked"]>;
+declare const $setUpWritableStreamDefaultController: RemoveThis<typeof import("../builtins/WritableStreamInternals")["setUpWritableStreamDefaultController"]>;
+declare const $setUpWritableStreamDefaultControllerFromUnderlyingSink: RemoveThis<typeof import("../builtins/WritableStreamInternals")["setUpWritableStreamDefaultControllerFromUnderlyingSink"]>;
+declare const $setUpWritableStreamDefaultWriter: RemoveThis<typeof import("../builtins/WritableStreamInternals")["setUpWritableStreamDefaultWriter"]>;
+declare const $writableStreamAbort: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamAbort"]>;
+declare const $writableStreamAbortForBindings: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamAbortForBindings"]>;
+declare const $writableStreamAddWriteRequest: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamAddWriteRequest"]>;
+declare const $writableStreamClose: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamClose"]>;
+declare const $writableStreamCloseForBindings: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamCloseForBindings"]>;
+declare const $writableStreamCloseQueuedOrInFlight: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamCloseQueuedOrInFlight"]>;
+declare const $writableStreamDealWithRejection: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDealWithRejection"]>;
+declare const $writableStreamDefaultControllerAdvanceQueueIfNeeded: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerAdvanceQueueIfNeeded"]>;
+declare const $writableStreamDefaultControllerClearAlgorithms: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerClearAlgorithms"]>;
+declare const $writableStreamDefaultControllerClose: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerClose"]>;
+declare const $writableStreamDefaultControllerError: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerError"]>;
+declare const $writableStreamDefaultControllerErrorIfNeeded: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerErrorIfNeeded"]>;
+declare const $writableStreamDefaultControllerGetBackpressure: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerGetBackpressure"]>;
+declare const $writableStreamDefaultControllerGetChunkSize: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerGetChunkSize"]>;
+declare const $writableStreamDefaultControllerGetDesiredSize: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerGetDesiredSize"]>;
+declare const $writableStreamDefaultControllerProcessClose: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerProcessClose"]>;
+declare const $writableStreamDefaultControllerProcessWrite: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerProcessWrite"]>;
+declare const $writableStreamDefaultControllerStart: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerStart"]>;
+declare const $writableStreamDefaultControllerWrite: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultControllerWrite"]>;
+declare const $writableStreamDefaultWriterAbort: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterAbort"]>;
+declare const $writableStreamDefaultWriterClose: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterClose"]>;
+declare const $writableStreamDefaultWriterCloseWithErrorPropagation: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterCloseWithErrorPropagation"]>;
+declare const $writableStreamDefaultWriterEnsureClosedPromiseRejected: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterEnsureClosedPromiseRejected"]>;
+declare const $writableStreamDefaultWriterEnsureReadyPromiseRejected: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterEnsureReadyPromiseRejected"]>;
+declare const $writableStreamDefaultWriterGetDesiredSize: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterGetDesiredSize"]>;
+declare const $writableStreamDefaultWriterRelease: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterRelease"]>;
+declare const $writableStreamDefaultWriterWrite: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamDefaultWriterWrite"]>;
+declare const $writableStreamFinishErroring: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamFinishErroring"]>;
+declare const $writableStreamFinishInFlightClose: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamFinishInFlightClose"]>;
+declare const $writableStreamFinishInFlightCloseWithError: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamFinishInFlightCloseWithError"]>;
+declare const $writableStreamFinishInFlightWrite: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamFinishInFlightWrite"]>;
+declare const $writableStreamFinishInFlightWriteWithError: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamFinishInFlightWriteWithError"]>;
+declare const $writableStreamHasOperationMarkedInFlight: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamHasOperationMarkedInFlight"]>;
+declare const $writableStreamMarkCloseRequestInFlight: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamMarkCloseRequestInFlight"]>;
+declare const $writableStreamMarkFirstWriteRequestInFlight: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamMarkFirstWriteRequestInFlight"]>;
+declare const $writableStreamRejectCloseAndClosedPromiseIfNeeded: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamRejectCloseAndClosedPromiseIfNeeded"]>;
+declare const $writableStreamStartErroring: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamStartErroring"]>;
+declare const $writableStreamUpdateBackpressure: RemoveThis<typeof import("../builtins/WritableStreamInternals")["writableStreamUpdateBackpressure"]>;
diff --git a/src/js/out/WebCoreJSBuiltins.h b/src/js/out/WebCoreJSBuiltins.h
index 4fc91dbd9..8319d6c4a 100644
--- a/src/js/out/WebCoreJSBuiltins.h
+++ b/src/js/out/WebCoreJSBuiltins.h
@@ -16,13 +16,13 @@ class FunctionExecutable;
namespace WebCore {
/* BundlerPlugin.ts */
-// runSetupFunction
-#define WEBCORE_BUILTIN_BUNDLERPLUGIN_RUNSETUPFUNCTION 1
-extern const char* const s_bundlerPluginRunSetupFunctionCode;
-extern const int s_bundlerPluginRunSetupFunctionCodeLength;
-extern const JSC::ConstructAbility s_bundlerPluginRunSetupFunctionCodeConstructAbility;
-extern const JSC::ConstructorKind s_bundlerPluginRunSetupFunctionCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_bundlerPluginRunSetupFunctionCodeImplementationVisibility;
+// runOnLoadPlugins
+#define WEBCORE_BUILTIN_BUNDLERPLUGIN_RUNONLOADPLUGINS 1
+extern const char* const s_bundlerPluginRunOnLoadPluginsCode;
+extern const int s_bundlerPluginRunOnLoadPluginsCodeLength;
+extern const JSC::ConstructAbility s_bundlerPluginRunOnLoadPluginsCodeConstructAbility;
+extern const JSC::ConstructorKind s_bundlerPluginRunOnLoadPluginsCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_bundlerPluginRunOnLoadPluginsCodeImplementationVisibility;
// runOnResolvePlugins
#define WEBCORE_BUILTIN_BUNDLERPLUGIN_RUNONRESOLVEPLUGINS 1
@@ -32,28 +32,28 @@ extern const JSC::ConstructAbility s_bundlerPluginRunOnResolvePluginsCodeConstru
extern const JSC::ConstructorKind s_bundlerPluginRunOnResolvePluginsCodeConstructorKind;
extern const JSC::ImplementationVisibility s_bundlerPluginRunOnResolvePluginsCodeImplementationVisibility;
-// runOnLoadPlugins
-#define WEBCORE_BUILTIN_BUNDLERPLUGIN_RUNONLOADPLUGINS 1
-extern const char* const s_bundlerPluginRunOnLoadPluginsCode;
-extern const int s_bundlerPluginRunOnLoadPluginsCodeLength;
-extern const JSC::ConstructAbility s_bundlerPluginRunOnLoadPluginsCodeConstructAbility;
-extern const JSC::ConstructorKind s_bundlerPluginRunOnLoadPluginsCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_bundlerPluginRunOnLoadPluginsCodeImplementationVisibility;
+// runSetupFunction
+#define WEBCORE_BUILTIN_BUNDLERPLUGIN_RUNSETUPFUNCTION 1
+extern const char* const s_bundlerPluginRunSetupFunctionCode;
+extern const int s_bundlerPluginRunSetupFunctionCodeLength;
+extern const JSC::ConstructAbility s_bundlerPluginRunSetupFunctionCodeConstructAbility;
+extern const JSC::ConstructorKind s_bundlerPluginRunSetupFunctionCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_bundlerPluginRunSetupFunctionCodeImplementationVisibility;
#define WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_DATA(macro) \
- macro(runSetupFunction, bundlerPluginRunSetupFunction, 2) \
- macro(runOnResolvePlugins, bundlerPluginRunOnResolvePlugins, 5) \
macro(runOnLoadPlugins, bundlerPluginRunOnLoadPlugins, 4) \
+ macro(runOnResolvePlugins, bundlerPluginRunOnResolvePlugins, 5) \
+ macro(runSetupFunction, bundlerPluginRunSetupFunction, 2) \
#define WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(macro) \
- macro(bundlerPluginRunSetupFunctionCode, runSetupFunction, ASCIILiteral(), s_bundlerPluginRunSetupFunctionCodeLength) \
- macro(bundlerPluginRunOnResolvePluginsCode, runOnResolvePlugins, ASCIILiteral(), s_bundlerPluginRunOnResolvePluginsCodeLength) \
macro(bundlerPluginRunOnLoadPluginsCode, runOnLoadPlugins, ASCIILiteral(), s_bundlerPluginRunOnLoadPluginsCodeLength) \
+ macro(bundlerPluginRunOnResolvePluginsCode, runOnResolvePlugins, ASCIILiteral(), s_bundlerPluginRunOnResolvePluginsCodeLength) \
+ macro(bundlerPluginRunSetupFunctionCode, runSetupFunction, ASCIILiteral(), s_bundlerPluginRunSetupFunctionCodeLength) \
#define WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_FUNCTION_NAME(macro) \
- macro(runSetupFunction) \
- macro(runOnResolvePlugins) \
macro(runOnLoadPlugins) \
+ macro(runOnResolvePlugins) \
+ macro(runSetupFunction) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
@@ -66,7 +66,7 @@ public:
explicit BundlerPluginBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
@@ -124,14 +124,6 @@ extern const JSC::ConstructAbility s_byteLengthQueuingStrategyHighWaterMarkCodeC
extern const JSC::ConstructorKind s_byteLengthQueuingStrategyHighWaterMarkCodeConstructorKind;
extern const JSC::ImplementationVisibility s_byteLengthQueuingStrategyHighWaterMarkCodeImplementationVisibility;
-// size
-#define WEBCORE_BUILTIN_BYTELENGTHQUEUINGSTRATEGY_SIZE 1
-extern const char* const s_byteLengthQueuingStrategySizeCode;
-extern const int s_byteLengthQueuingStrategySizeCodeLength;
-extern const JSC::ConstructAbility s_byteLengthQueuingStrategySizeCodeConstructAbility;
-extern const JSC::ConstructorKind s_byteLengthQueuingStrategySizeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_byteLengthQueuingStrategySizeCodeImplementationVisibility;
-
// initializeByteLengthQueuingStrategy
#define WEBCORE_BUILTIN_BYTELENGTHQUEUINGSTRATEGY_INITIALIZEBYTELENGTHQUEUINGSTRATEGY 1
extern const char* const s_byteLengthQueuingStrategyInitializeByteLengthQueuingStrategyCode;
@@ -140,20 +132,28 @@ extern const JSC::ConstructAbility s_byteLengthQueuingStrategyInitializeByteLeng
extern const JSC::ConstructorKind s_byteLengthQueuingStrategyInitializeByteLengthQueuingStrategyCodeConstructorKind;
extern const JSC::ImplementationVisibility s_byteLengthQueuingStrategyInitializeByteLengthQueuingStrategyCodeImplementationVisibility;
+// size
+#define WEBCORE_BUILTIN_BYTELENGTHQUEUINGSTRATEGY_SIZE 1
+extern const char* const s_byteLengthQueuingStrategySizeCode;
+extern const int s_byteLengthQueuingStrategySizeCodeLength;
+extern const JSC::ConstructAbility s_byteLengthQueuingStrategySizeCodeConstructAbility;
+extern const JSC::ConstructorKind s_byteLengthQueuingStrategySizeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_byteLengthQueuingStrategySizeCodeImplementationVisibility;
+
#define WEBCORE_FOREACH_BYTELENGTHQUEUINGSTRATEGY_BUILTIN_DATA(macro) \
macro(highWaterMark, byteLengthQueuingStrategyHighWaterMark, 0) \
- macro(size, byteLengthQueuingStrategySize, 1) \
macro(initializeByteLengthQueuingStrategy, byteLengthQueuingStrategyInitializeByteLengthQueuingStrategy, 1) \
+ macro(size, byteLengthQueuingStrategySize, 1) \
#define WEBCORE_FOREACH_BYTELENGTHQUEUINGSTRATEGY_BUILTIN_CODE(macro) \
macro(byteLengthQueuingStrategyHighWaterMarkCode, highWaterMark, "get highWaterMark"_s, s_byteLengthQueuingStrategyHighWaterMarkCodeLength) \
- macro(byteLengthQueuingStrategySizeCode, size, ASCIILiteral(), s_byteLengthQueuingStrategySizeCodeLength) \
macro(byteLengthQueuingStrategyInitializeByteLengthQueuingStrategyCode, initializeByteLengthQueuingStrategy, ASCIILiteral(), s_byteLengthQueuingStrategyInitializeByteLengthQueuingStrategyCodeLength) \
+ macro(byteLengthQueuingStrategySizeCode, size, ASCIILiteral(), s_byteLengthQueuingStrategySizeCodeLength) \
#define WEBCORE_FOREACH_BYTELENGTHQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(macro) \
macro(highWaterMark) \
- macro(size) \
macro(initializeByteLengthQueuingStrategy) \
+ macro(size) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
@@ -166,7 +166,7 @@ public:
explicit ByteLengthQueuingStrategyBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
WEBCORE_FOREACH_BYTELENGTHQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
WEBCORE_FOREACH_BYTELENGTHQUEUINGSTRATEGY_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
@@ -215,565 +215,59 @@ inline void ByteLengthQueuingStrategyBuiltinsWrapper::exportNames()
WEBCORE_FOREACH_BYTELENGTHQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* WritableStreamInternals.ts */
-// isWritableStream
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISWRITABLESTREAM 1
-extern const char* const s_writableStreamInternalsIsWritableStreamCode;
-extern const int s_writableStreamInternalsIsWritableStreamCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamCodeImplementationVisibility;
-
-// isWritableStreamDefaultWriter
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISWRITABLESTREAMDEFAULTWRITER 1
-extern const char* const s_writableStreamInternalsIsWritableStreamDefaultWriterCode;
-extern const int s_writableStreamInternalsIsWritableStreamDefaultWriterCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeImplementationVisibility;
-
-// acquireWritableStreamDefaultWriter
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ACQUIREWRITABLESTREAMDEFAULTWRITER 1
-extern const char* const s_writableStreamInternalsAcquireWritableStreamDefaultWriterCode;
-extern const int s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeImplementationVisibility;
-
-// createWritableStream
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_CREATEWRITABLESTREAM 1
-extern const char* const s_writableStreamInternalsCreateWritableStreamCode;
-extern const int s_writableStreamInternalsCreateWritableStreamCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsCreateWritableStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsCreateWritableStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsCreateWritableStreamCodeImplementationVisibility;
-
-// createInternalWritableStreamFromUnderlyingSink
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_CREATEINTERNALWRITABLESTREAMFROMUNDERLYINGSINK 1
-extern const char* const s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode;
-extern const int s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeImplementationVisibility;
-
-// initializeWritableStreamSlots
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_INITIALIZEWRITABLESTREAMSLOTS 1
-extern const char* const s_writableStreamInternalsInitializeWritableStreamSlotsCode;
-extern const int s_writableStreamInternalsInitializeWritableStreamSlotsCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsInitializeWritableStreamSlotsCodeImplementationVisibility;
-
-// writableStreamCloseForBindings
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMCLOSEFORBINDINGS 1
-extern const char* const s_writableStreamInternalsWritableStreamCloseForBindingsCode;
-extern const int s_writableStreamInternalsWritableStreamCloseForBindingsCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseForBindingsCodeImplementationVisibility;
-
-// writableStreamAbortForBindings
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMABORTFORBINDINGS 1
-extern const char* const s_writableStreamInternalsWritableStreamAbortForBindingsCode;
-extern const int s_writableStreamInternalsWritableStreamAbortForBindingsCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortForBindingsCodeImplementationVisibility;
-
-// isWritableStreamLocked
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISWRITABLESTREAMLOCKED 1
-extern const char* const s_writableStreamInternalsIsWritableStreamLockedCode;
-extern const int s_writableStreamInternalsIsWritableStreamLockedCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamLockedCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamLockedCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamLockedCodeImplementationVisibility;
-
-// setUpWritableStreamDefaultWriter
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_SETUPWRITABLESTREAMDEFAULTWRITER 1
-extern const char* const s_writableStreamInternalsSetUpWritableStreamDefaultWriterCode;
-extern const int s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeImplementationVisibility;
-
-// writableStreamAbort
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMABORT 1
-extern const char* const s_writableStreamInternalsWritableStreamAbortCode;
-extern const int s_writableStreamInternalsWritableStreamAbortCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortCodeImplementationVisibility;
-
-// writableStreamClose
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMCLOSE 1
-extern const char* const s_writableStreamInternalsWritableStreamCloseCode;
-extern const int s_writableStreamInternalsWritableStreamCloseCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseCodeImplementationVisibility;
-
-// writableStreamAddWriteRequest
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMADDWRITEREQUEST 1
-extern const char* const s_writableStreamInternalsWritableStreamAddWriteRequestCode;
-extern const int s_writableStreamInternalsWritableStreamAddWriteRequestCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAddWriteRequestCodeImplementationVisibility;
-
-// writableStreamCloseQueuedOrInFlight
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMCLOSEQUEUEDORINFLIGHT 1
-extern const char* const s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCode;
-extern const int s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeImplementationVisibility;
-
-// writableStreamDealWithRejection
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEALWITHREJECTION 1
-extern const char* const s_writableStreamInternalsWritableStreamDealWithRejectionCode;
-extern const int s_writableStreamInternalsWritableStreamDealWithRejectionCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDealWithRejectionCodeImplementationVisibility;
-
-// writableStreamFinishErroring
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHERRORING 1
-extern const char* const s_writableStreamInternalsWritableStreamFinishErroringCode;
-extern const int s_writableStreamInternalsWritableStreamFinishErroringCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishErroringCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishErroringCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishErroringCodeImplementationVisibility;
-
-// writableStreamFinishInFlightClose
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTCLOSE 1
-extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseCode;
-extern const int s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeImplementationVisibility;
-
-// writableStreamFinishInFlightCloseWithError
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTCLOSEWITHERROR 1
-extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode;
-extern const int s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeImplementationVisibility;
-
-// writableStreamFinishInFlightWrite
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTWRITE 1
-extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteCode;
-extern const int s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeImplementationVisibility;
-
-// writableStreamFinishInFlightWriteWithError
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTWRITEWITHERROR 1
-extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCode;
-extern const int s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeImplementationVisibility;
-
-// writableStreamHasOperationMarkedInFlight
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMHASOPERATIONMARKEDINFLIGHT 1
-extern const char* const s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCode;
-extern const int s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeImplementationVisibility;
-
-// writableStreamMarkCloseRequestInFlight
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMMARKCLOSEREQUESTINFLIGHT 1
-extern const char* const s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCode;
-extern const int s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeImplementationVisibility;
-
-// writableStreamMarkFirstWriteRequestInFlight
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMMARKFIRSTWRITEREQUESTINFLIGHT 1
-extern const char* const s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCode;
-extern const int s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeImplementationVisibility;
-
-// writableStreamRejectCloseAndClosedPromiseIfNeeded
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMREJECTCLOSEANDCLOSEDPROMISEIFNEEDED 1
-extern const char* const s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode;
-extern const int s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeImplementationVisibility;
-
-// writableStreamStartErroring
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMSTARTERRORING 1
-extern const char* const s_writableStreamInternalsWritableStreamStartErroringCode;
-extern const int s_writableStreamInternalsWritableStreamStartErroringCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamStartErroringCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamStartErroringCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamStartErroringCodeImplementationVisibility;
-
-// writableStreamUpdateBackpressure
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMUPDATEBACKPRESSURE 1
-extern const char* const s_writableStreamInternalsWritableStreamUpdateBackpressureCode;
-extern const int s_writableStreamInternalsWritableStreamUpdateBackpressureCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeImplementationVisibility;
-
-// writableStreamDefaultWriterAbort
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERABORT 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterAbortCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeImplementationVisibility;
-
-// writableStreamDefaultWriterClose
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERCLOSE 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeImplementationVisibility;
-
-// writableStreamDefaultWriterCloseWithErrorPropagation
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERCLOSEWITHERRORPROPAGATION 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeImplementationVisibility;
-
-// writableStreamDefaultWriterEnsureClosedPromiseRejected
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERENSURECLOSEDPROMISEREJECTED 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeImplementationVisibility;
-
-// writableStreamDefaultWriterEnsureReadyPromiseRejected
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERENSUREREADYPROMISEREJECTED 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeImplementationVisibility;
-
-// writableStreamDefaultWriterGetDesiredSize
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERGETDESIREDSIZE 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeImplementationVisibility;
-
-// writableStreamDefaultWriterRelease
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERRELEASE 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterReleaseCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeImplementationVisibility;
-
-// writableStreamDefaultWriterWrite
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERWRITE 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterWriteCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeImplementationVisibility;
-
-// setUpWritableStreamDefaultController
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_SETUPWRITABLESTREAMDEFAULTCONTROLLER 1
-extern const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerCode;
-extern const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeImplementationVisibility;
-
-// writableStreamDefaultControllerStart
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERSTART 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerStartCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultControllerStartCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeImplementationVisibility;
-
-// setUpWritableStreamDefaultControllerFromUnderlyingSink
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_SETUPWRITABLESTREAMDEFAULTCONTROLLERFROMUNDERLYINGSINK 1
-extern const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCode;
-extern const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeImplementationVisibility;
-
-// writableStreamDefaultControllerAdvanceQueueIfNeeded
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERADVANCEQUEUEIFNEEDED 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeImplementationVisibility;
-
-// isCloseSentinel
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISCLOSESENTINEL 1
-extern const char* const s_writableStreamInternalsIsCloseSentinelCode;
-extern const int s_writableStreamInternalsIsCloseSentinelCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsIsCloseSentinelCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsIsCloseSentinelCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsIsCloseSentinelCodeImplementationVisibility;
-
-// writableStreamDefaultControllerClearAlgorithms
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERCLEARALGORITHMS 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility;
-
-// writableStreamDefaultControllerClose
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERCLOSE 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerCloseCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeImplementationVisibility;
-
-// writableStreamDefaultControllerError
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERERROR 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeImplementationVisibility;
-
-// writableStreamDefaultControllerErrorIfNeeded
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERERRORIFNEEDED 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeImplementationVisibility;
-
-// writableStreamDefaultControllerGetBackpressure
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERGETBACKPRESSURE 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeImplementationVisibility;
-
-// writableStreamDefaultControllerGetChunkSize
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERGETCHUNKSIZE 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeImplementationVisibility;
-
-// writableStreamDefaultControllerGetDesiredSize
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERGETDESIREDSIZE 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility;
+/* ConsoleObject.ts */
+// asyncIterator
+#define WEBCORE_BUILTIN_CONSOLEOBJECT_ASYNCITERATOR 1
+extern const char* const s_consoleObjectAsyncIteratorCode;
+extern const int s_consoleObjectAsyncIteratorCodeLength;
+extern const JSC::ConstructAbility s_consoleObjectAsyncIteratorCodeConstructAbility;
+extern const JSC::ConstructorKind s_consoleObjectAsyncIteratorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_consoleObjectAsyncIteratorCodeImplementationVisibility;
-// writableStreamDefaultControllerProcessClose
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERPROCESSCLOSE 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeImplementationVisibility;
+// createConsoleConstructor
+#define WEBCORE_BUILTIN_CONSOLEOBJECT_CREATECONSOLECONSTRUCTOR 1
+extern const char* const s_consoleObjectCreateConsoleConstructorCode;
+extern const int s_consoleObjectCreateConsoleConstructorCodeLength;
+extern const JSC::ConstructAbility s_consoleObjectCreateConsoleConstructorCodeConstructAbility;
+extern const JSC::ConstructorKind s_consoleObjectCreateConsoleConstructorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_consoleObjectCreateConsoleConstructorCodeImplementationVisibility;
-// writableStreamDefaultControllerProcessWrite
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERPROCESSWRITE 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeImplementationVisibility;
-
-// writableStreamDefaultControllerWrite
-#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERWRITE 1
-extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerWriteCode;
-extern const int s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeLength;
-extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeImplementationVisibility;
+// write
+#define WEBCORE_BUILTIN_CONSOLEOBJECT_WRITE 1
+extern const char* const s_consoleObjectWriteCode;
+extern const int s_consoleObjectWriteCodeLength;
+extern const JSC::ConstructAbility s_consoleObjectWriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_consoleObjectWriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_consoleObjectWriteCodeImplementationVisibility;
-#define WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_DATA(macro) \
- macro(isWritableStream, writableStreamInternalsIsWritableStream, 1) \
- macro(isWritableStreamDefaultWriter, writableStreamInternalsIsWritableStreamDefaultWriter, 1) \
- macro(acquireWritableStreamDefaultWriter, writableStreamInternalsAcquireWritableStreamDefaultWriter, 1) \
- macro(createWritableStream, writableStreamInternalsCreateWritableStream, 7) \
- macro(createInternalWritableStreamFromUnderlyingSink, writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSink, 2) \
- macro(initializeWritableStreamSlots, writableStreamInternalsInitializeWritableStreamSlots, 2) \
- macro(writableStreamCloseForBindings, writableStreamInternalsWritableStreamCloseForBindings, 1) \
- macro(writableStreamAbortForBindings, writableStreamInternalsWritableStreamAbortForBindings, 2) \
- macro(isWritableStreamLocked, writableStreamInternalsIsWritableStreamLocked, 1) \
- macro(setUpWritableStreamDefaultWriter, writableStreamInternalsSetUpWritableStreamDefaultWriter, 2) \
- macro(writableStreamAbort, writableStreamInternalsWritableStreamAbort, 2) \
- macro(writableStreamClose, writableStreamInternalsWritableStreamClose, 1) \
- macro(writableStreamAddWriteRequest, writableStreamInternalsWritableStreamAddWriteRequest, 1) \
- macro(writableStreamCloseQueuedOrInFlight, writableStreamInternalsWritableStreamCloseQueuedOrInFlight, 1) \
- macro(writableStreamDealWithRejection, writableStreamInternalsWritableStreamDealWithRejection, 2) \
- macro(writableStreamFinishErroring, writableStreamInternalsWritableStreamFinishErroring, 1) \
- macro(writableStreamFinishInFlightClose, writableStreamInternalsWritableStreamFinishInFlightClose, 1) \
- macro(writableStreamFinishInFlightCloseWithError, writableStreamInternalsWritableStreamFinishInFlightCloseWithError, 2) \
- macro(writableStreamFinishInFlightWrite, writableStreamInternalsWritableStreamFinishInFlightWrite, 1) \
- macro(writableStreamFinishInFlightWriteWithError, writableStreamInternalsWritableStreamFinishInFlightWriteWithError, 2) \
- macro(writableStreamHasOperationMarkedInFlight, writableStreamInternalsWritableStreamHasOperationMarkedInFlight, 1) \
- macro(writableStreamMarkCloseRequestInFlight, writableStreamInternalsWritableStreamMarkCloseRequestInFlight, 1) \
- macro(writableStreamMarkFirstWriteRequestInFlight, writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlight, 1) \
- macro(writableStreamRejectCloseAndClosedPromiseIfNeeded, writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeeded, 1) \
- macro(writableStreamStartErroring, writableStreamInternalsWritableStreamStartErroring, 2) \
- macro(writableStreamUpdateBackpressure, writableStreamInternalsWritableStreamUpdateBackpressure, 2) \
- macro(writableStreamDefaultWriterAbort, writableStreamInternalsWritableStreamDefaultWriterAbort, 2) \
- macro(writableStreamDefaultWriterClose, writableStreamInternalsWritableStreamDefaultWriterClose, 1) \
- macro(writableStreamDefaultWriterCloseWithErrorPropagation, writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagation, 1) \
- macro(writableStreamDefaultWriterEnsureClosedPromiseRejected, writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejected, 2) \
- macro(writableStreamDefaultWriterEnsureReadyPromiseRejected, writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejected, 2) \
- macro(writableStreamDefaultWriterGetDesiredSize, writableStreamInternalsWritableStreamDefaultWriterGetDesiredSize, 1) \
- macro(writableStreamDefaultWriterRelease, writableStreamInternalsWritableStreamDefaultWriterRelease, 1) \
- macro(writableStreamDefaultWriterWrite, writableStreamInternalsWritableStreamDefaultWriterWrite, 2) \
- macro(setUpWritableStreamDefaultController, writableStreamInternalsSetUpWritableStreamDefaultController, 9) \
- macro(writableStreamDefaultControllerStart, writableStreamInternalsWritableStreamDefaultControllerStart, 1) \
- macro(setUpWritableStreamDefaultControllerFromUnderlyingSink, writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSink, 6) \
- macro(writableStreamDefaultControllerAdvanceQueueIfNeeded, writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeeded, 1) \
- macro(isCloseSentinel, writableStreamInternalsIsCloseSentinel, 0) \
- macro(writableStreamDefaultControllerClearAlgorithms, writableStreamInternalsWritableStreamDefaultControllerClearAlgorithms, 1) \
- macro(writableStreamDefaultControllerClose, writableStreamInternalsWritableStreamDefaultControllerClose, 1) \
- macro(writableStreamDefaultControllerError, writableStreamInternalsWritableStreamDefaultControllerError, 2) \
- macro(writableStreamDefaultControllerErrorIfNeeded, writableStreamInternalsWritableStreamDefaultControllerErrorIfNeeded, 2) \
- macro(writableStreamDefaultControllerGetBackpressure, writableStreamInternalsWritableStreamDefaultControllerGetBackpressure, 1) \
- macro(writableStreamDefaultControllerGetChunkSize, writableStreamInternalsWritableStreamDefaultControllerGetChunkSize, 2) \
- macro(writableStreamDefaultControllerGetDesiredSize, writableStreamInternalsWritableStreamDefaultControllerGetDesiredSize, 1) \
- macro(writableStreamDefaultControllerProcessClose, writableStreamInternalsWritableStreamDefaultControllerProcessClose, 1) \
- macro(writableStreamDefaultControllerProcessWrite, writableStreamInternalsWritableStreamDefaultControllerProcessWrite, 2) \
- macro(writableStreamDefaultControllerWrite, writableStreamInternalsWritableStreamDefaultControllerWrite, 3) \
+#define WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_DATA(macro) \
+ macro(asyncIterator, consoleObjectAsyncIterator, 0) \
+ macro(createConsoleConstructor, consoleObjectCreateConsoleConstructor, 1) \
+ macro(write, consoleObjectWrite, 1) \
-#define WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(macro) \
- macro(writableStreamInternalsIsWritableStreamCode, isWritableStream, ASCIILiteral(), s_writableStreamInternalsIsWritableStreamCodeLength) \
- macro(writableStreamInternalsIsWritableStreamDefaultWriterCode, isWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamInternalsIsWritableStreamDefaultWriterCodeLength) \
- macro(writableStreamInternalsAcquireWritableStreamDefaultWriterCode, acquireWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeLength) \
- macro(writableStreamInternalsCreateWritableStreamCode, createWritableStream, ASCIILiteral(), s_writableStreamInternalsCreateWritableStreamCodeLength) \
- macro(writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode, createInternalWritableStreamFromUnderlyingSink, ASCIILiteral(), s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeLength) \
- macro(writableStreamInternalsInitializeWritableStreamSlotsCode, initializeWritableStreamSlots, ASCIILiteral(), s_writableStreamInternalsInitializeWritableStreamSlotsCodeLength) \
- macro(writableStreamInternalsWritableStreamCloseForBindingsCode, writableStreamCloseForBindings, ASCIILiteral(), s_writableStreamInternalsWritableStreamCloseForBindingsCodeLength) \
- macro(writableStreamInternalsWritableStreamAbortForBindingsCode, writableStreamAbortForBindings, ASCIILiteral(), s_writableStreamInternalsWritableStreamAbortForBindingsCodeLength) \
- macro(writableStreamInternalsIsWritableStreamLockedCode, isWritableStreamLocked, ASCIILiteral(), s_writableStreamInternalsIsWritableStreamLockedCodeLength) \
- macro(writableStreamInternalsSetUpWritableStreamDefaultWriterCode, setUpWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeLength) \
- macro(writableStreamInternalsWritableStreamAbortCode, writableStreamAbort, ASCIILiteral(), s_writableStreamInternalsWritableStreamAbortCodeLength) \
- macro(writableStreamInternalsWritableStreamCloseCode, writableStreamClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamCloseCodeLength) \
- macro(writableStreamInternalsWritableStreamAddWriteRequestCode, writableStreamAddWriteRequest, ASCIILiteral(), s_writableStreamInternalsWritableStreamAddWriteRequestCodeLength) \
- macro(writableStreamInternalsWritableStreamCloseQueuedOrInFlightCode, writableStreamCloseQueuedOrInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeLength) \
- macro(writableStreamInternalsWritableStreamDealWithRejectionCode, writableStreamDealWithRejection, ASCIILiteral(), s_writableStreamInternalsWritableStreamDealWithRejectionCodeLength) \
- macro(writableStreamInternalsWritableStreamFinishErroringCode, writableStreamFinishErroring, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishErroringCodeLength) \
- macro(writableStreamInternalsWritableStreamFinishInFlightCloseCode, writableStreamFinishInFlightClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeLength) \
- macro(writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode, writableStreamFinishInFlightCloseWithError, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeLength) \
- macro(writableStreamInternalsWritableStreamFinishInFlightWriteCode, writableStreamFinishInFlightWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeLength) \
- macro(writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCode, writableStreamFinishInFlightWriteWithError, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeLength) \
- macro(writableStreamInternalsWritableStreamHasOperationMarkedInFlightCode, writableStreamHasOperationMarkedInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeLength) \
- macro(writableStreamInternalsWritableStreamMarkCloseRequestInFlightCode, writableStreamMarkCloseRequestInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeLength) \
- macro(writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCode, writableStreamMarkFirstWriteRequestInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeLength) \
- macro(writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode, writableStreamRejectCloseAndClosedPromiseIfNeeded, ASCIILiteral(), s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeLength) \
- macro(writableStreamInternalsWritableStreamStartErroringCode, writableStreamStartErroring, ASCIILiteral(), s_writableStreamInternalsWritableStreamStartErroringCodeLength) \
- macro(writableStreamInternalsWritableStreamUpdateBackpressureCode, writableStreamUpdateBackpressure, ASCIILiteral(), s_writableStreamInternalsWritableStreamUpdateBackpressureCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultWriterAbortCode, writableStreamDefaultWriterAbort, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultWriterCloseCode, writableStreamDefaultWriterClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCode, writableStreamDefaultWriterCloseWithErrorPropagation, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode, writableStreamDefaultWriterEnsureClosedPromiseRejected, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode, writableStreamDefaultWriterEnsureReadyPromiseRejected, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCode, writableStreamDefaultWriterGetDesiredSize, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultWriterReleaseCode, writableStreamDefaultWriterRelease, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultWriterWriteCode, writableStreamDefaultWriterWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeLength) \
- macro(writableStreamInternalsSetUpWritableStreamDefaultControllerCode, setUpWritableStreamDefaultController, ASCIILiteral(), s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultControllerStartCode, writableStreamDefaultControllerStart, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerStartCodeLength) \
- macro(writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCode, setUpWritableStreamDefaultControllerFromUnderlyingSink, ASCIILiteral(), s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCode, writableStreamDefaultControllerAdvanceQueueIfNeeded, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeLength) \
- macro(writableStreamInternalsIsCloseSentinelCode, isCloseSentinel, ASCIILiteral(), s_writableStreamInternalsIsCloseSentinelCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCode, writableStreamDefaultControllerClearAlgorithms, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultControllerCloseCode, writableStreamDefaultControllerClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultControllerErrorCode, writableStreamDefaultControllerError, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCode, writableStreamDefaultControllerErrorIfNeeded, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCode, writableStreamDefaultControllerGetBackpressure, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCode, writableStreamDefaultControllerGetChunkSize, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCode, writableStreamDefaultControllerGetDesiredSize, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultControllerProcessCloseCode, writableStreamDefaultControllerProcessClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode, writableStreamDefaultControllerProcessWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeLength) \
- macro(writableStreamInternalsWritableStreamDefaultControllerWriteCode, writableStreamDefaultControllerWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeLength) \
+#define WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(macro) \
+ macro(consoleObjectAsyncIteratorCode, asyncIterator, "[Symbol.asyncIterator]"_s, s_consoleObjectAsyncIteratorCodeLength) \
+ macro(consoleObjectCreateConsoleConstructorCode, createConsoleConstructor, ASCIILiteral(), s_consoleObjectCreateConsoleConstructorCodeLength) \
+ macro(consoleObjectWriteCode, write, ASCIILiteral(), s_consoleObjectWriteCodeLength) \
-#define WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \
- macro(isWritableStream) \
- macro(isWritableStreamDefaultWriter) \
- macro(acquireWritableStreamDefaultWriter) \
- macro(createWritableStream) \
- macro(createInternalWritableStreamFromUnderlyingSink) \
- macro(initializeWritableStreamSlots) \
- macro(writableStreamCloseForBindings) \
- macro(writableStreamAbortForBindings) \
- macro(isWritableStreamLocked) \
- macro(setUpWritableStreamDefaultWriter) \
- macro(writableStreamAbort) \
- macro(writableStreamClose) \
- macro(writableStreamAddWriteRequest) \
- macro(writableStreamCloseQueuedOrInFlight) \
- macro(writableStreamDealWithRejection) \
- macro(writableStreamFinishErroring) \
- macro(writableStreamFinishInFlightClose) \
- macro(writableStreamFinishInFlightCloseWithError) \
- macro(writableStreamFinishInFlightWrite) \
- macro(writableStreamFinishInFlightWriteWithError) \
- macro(writableStreamHasOperationMarkedInFlight) \
- macro(writableStreamMarkCloseRequestInFlight) \
- macro(writableStreamMarkFirstWriteRequestInFlight) \
- macro(writableStreamRejectCloseAndClosedPromiseIfNeeded) \
- macro(writableStreamStartErroring) \
- macro(writableStreamUpdateBackpressure) \
- macro(writableStreamDefaultWriterAbort) \
- macro(writableStreamDefaultWriterClose) \
- macro(writableStreamDefaultWriterCloseWithErrorPropagation) \
- macro(writableStreamDefaultWriterEnsureClosedPromiseRejected) \
- macro(writableStreamDefaultWriterEnsureReadyPromiseRejected) \
- macro(writableStreamDefaultWriterGetDesiredSize) \
- macro(writableStreamDefaultWriterRelease) \
- macro(writableStreamDefaultWriterWrite) \
- macro(setUpWritableStreamDefaultController) \
- macro(writableStreamDefaultControllerStart) \
- macro(setUpWritableStreamDefaultControllerFromUnderlyingSink) \
- macro(writableStreamDefaultControllerAdvanceQueueIfNeeded) \
- macro(isCloseSentinel) \
- macro(writableStreamDefaultControllerClearAlgorithms) \
- macro(writableStreamDefaultControllerClose) \
- macro(writableStreamDefaultControllerError) \
- macro(writableStreamDefaultControllerErrorIfNeeded) \
- macro(writableStreamDefaultControllerGetBackpressure) \
- macro(writableStreamDefaultControllerGetChunkSize) \
- macro(writableStreamDefaultControllerGetDesiredSize) \
- macro(writableStreamDefaultControllerProcessClose) \
- macro(writableStreamDefaultControllerProcessWrite) \
- macro(writableStreamDefaultControllerWrite) \
+#define WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(macro) \
+ macro(asyncIterator) \
+ macro(createConsoleConstructor) \
+ macro(write) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class WritableStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner {
+class ConsoleObjectBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit WritableStreamInternalsBuiltinsWrapper(JSC::VM& vm)
+ explicit ConsoleObjectBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -781,28 +275,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* WritableStreamInternalsBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* ConsoleObjectBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -812,267 +306,68 @@ inline JSC::UnlinkedFunctionExecutable* WritableStreamInternalsBuiltinsWrapper::
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void WritableStreamInternalsBuiltinsWrapper::exportNames()
+inline void ConsoleObjectBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-class WritableStreamInternalsBuiltinFunctions {
-public:
- explicit WritableStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
-
- void init(JSC::JSGlobalObject&);
- template<typename Visitor> void visit(Visitor&);
-
-public:
- JSC::VM& m_vm;
-
-#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \
- JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
- WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
-#undef DECLARE_BUILTIN_SOURCE_MEMBERS
-};
-
-inline void WritableStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
-{
-#define EXPORT_FUNCTION(codeName, functionName, overriddenName, length) \
- m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create(m_vm, codeName##Generator(m_vm), &globalObject));
- WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION)
-#undef EXPORT_FUNCTION
-}
-
-template<typename Visitor>
-inline void WritableStreamInternalsBuiltinFunctions::visit(Visitor& visitor)
-{
-#define VISIT_FUNCTION(name) visitor.append(m_##name##Function);
- WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
-#undef VISIT_FUNCTION
-}
-
-template void WritableStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&);
-template void WritableStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&);
- /* TransformStreamInternals.ts */
-// isTransformStream
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_ISTRANSFORMSTREAM 1
-extern const char* const s_transformStreamInternalsIsTransformStreamCode;
-extern const int s_transformStreamInternalsIsTransformStreamCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamCodeImplementationVisibility;
-
-// isTransformStreamDefaultController
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_ISTRANSFORMSTREAMDEFAULTCONTROLLER 1
-extern const char* const s_transformStreamInternalsIsTransformStreamDefaultControllerCode;
-extern const int s_transformStreamInternalsIsTransformStreamDefaultControllerCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeImplementationVisibility;
-
-// createTransformStream
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_CREATETRANSFORMSTREAM 1
-extern const char* const s_transformStreamInternalsCreateTransformStreamCode;
-extern const int s_transformStreamInternalsCreateTransformStreamCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsCreateTransformStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsCreateTransformStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsCreateTransformStreamCodeImplementationVisibility;
-
-// initializeTransformStream
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_INITIALIZETRANSFORMSTREAM 1
-extern const char* const s_transformStreamInternalsInitializeTransformStreamCode;
-extern const int s_transformStreamInternalsInitializeTransformStreamCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsInitializeTransformStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsInitializeTransformStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsInitializeTransformStreamCodeImplementationVisibility;
-
-// transformStreamError
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMERROR 1
-extern const char* const s_transformStreamInternalsTransformStreamErrorCode;
-extern const int s_transformStreamInternalsTransformStreamErrorCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorCodeImplementationVisibility;
-
-// transformStreamErrorWritableAndUnblockWrite
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMERRORWRITABLEANDUNBLOCKWRITE 1
-extern const char* const s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCode;
-extern const int s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeImplementationVisibility;
-
-// transformStreamSetBackpressure
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMSETBACKPRESSURE 1
-extern const char* const s_transformStreamInternalsTransformStreamSetBackpressureCode;
-extern const int s_transformStreamInternalsTransformStreamSetBackpressureCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamSetBackpressureCodeImplementationVisibility;
-
-// setUpTransformStreamDefaultController
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_SETUPTRANSFORMSTREAMDEFAULTCONTROLLER 1
-extern const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerCode;
-extern const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeImplementationVisibility;
-
-// setUpTransformStreamDefaultControllerFromTransformer
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_SETUPTRANSFORMSTREAMDEFAULTCONTROLLERFROMTRANSFORMER 1
-extern const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode;
-extern const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeImplementationVisibility;
-
-// transformStreamDefaultControllerClearAlgorithms
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERCLEARALGORITHMS 1
-extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCode;
-extern const int s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility;
-
-// transformStreamDefaultControllerEnqueue
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERENQUEUE 1
-extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCode;
-extern const int s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeImplementationVisibility;
-
-// transformStreamDefaultControllerError
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERERROR 1
-extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerErrorCode;
-extern const int s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeImplementationVisibility;
-
-// transformStreamDefaultControllerPerformTransform
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERPERFORMTRANSFORM 1
-extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode;
-extern const int s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeImplementationVisibility;
-
-// transformStreamDefaultControllerTerminate
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERTERMINATE 1
-extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerTerminateCode;
-extern const int s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeImplementationVisibility;
-
-// transformStreamDefaultSinkWriteAlgorithm
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSINKWRITEALGORITHM 1
-extern const char* const s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode;
-extern const int s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeImplementationVisibility;
-
-// transformStreamDefaultSinkAbortAlgorithm
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSINKABORTALGORITHM 1
-extern const char* const s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCode;
-extern const int s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeImplementationVisibility;
+/* CountQueuingStrategy.ts */
+// highWaterMark
+#define WEBCORE_BUILTIN_COUNTQUEUINGSTRATEGY_HIGHWATERMARK 1
+extern const char* const s_countQueuingStrategyHighWaterMarkCode;
+extern const int s_countQueuingStrategyHighWaterMarkCodeLength;
+extern const JSC::ConstructAbility s_countQueuingStrategyHighWaterMarkCodeConstructAbility;
+extern const JSC::ConstructorKind s_countQueuingStrategyHighWaterMarkCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_countQueuingStrategyHighWaterMarkCodeImplementationVisibility;
-// transformStreamDefaultSinkCloseAlgorithm
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSINKCLOSEALGORITHM 1
-extern const char* const s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode;
-extern const int s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeImplementationVisibility;
+// initializeCountQueuingStrategy
+#define WEBCORE_BUILTIN_COUNTQUEUINGSTRATEGY_INITIALIZECOUNTQUEUINGSTRATEGY 1
+extern const char* const s_countQueuingStrategyInitializeCountQueuingStrategyCode;
+extern const int s_countQueuingStrategyInitializeCountQueuingStrategyCodeLength;
+extern const JSC::ConstructAbility s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructAbility;
+extern const JSC::ConstructorKind s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_countQueuingStrategyInitializeCountQueuingStrategyCodeImplementationVisibility;
-// transformStreamDefaultSourcePullAlgorithm
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSOURCEPULLALGORITHM 1
-extern const char* const s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCode;
-extern const int s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeImplementationVisibility;
+// size
+#define WEBCORE_BUILTIN_COUNTQUEUINGSTRATEGY_SIZE 1
+extern const char* const s_countQueuingStrategySizeCode;
+extern const int s_countQueuingStrategySizeCodeLength;
+extern const JSC::ConstructAbility s_countQueuingStrategySizeCodeConstructAbility;
+extern const JSC::ConstructorKind s_countQueuingStrategySizeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_countQueuingStrategySizeCodeImplementationVisibility;
-#define WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_DATA(macro) \
- macro(isTransformStream, transformStreamInternalsIsTransformStream, 1) \
- macro(isTransformStreamDefaultController, transformStreamInternalsIsTransformStreamDefaultController, 1) \
- macro(createTransformStream, transformStreamInternalsCreateTransformStream, 8) \
- macro(initializeTransformStream, transformStreamInternalsInitializeTransformStream, 7) \
- macro(transformStreamError, transformStreamInternalsTransformStreamError, 2) \
- macro(transformStreamErrorWritableAndUnblockWrite, transformStreamInternalsTransformStreamErrorWritableAndUnblockWrite, 2) \
- macro(transformStreamSetBackpressure, transformStreamInternalsTransformStreamSetBackpressure, 2) \
- macro(setUpTransformStreamDefaultController, transformStreamInternalsSetUpTransformStreamDefaultController, 4) \
- macro(setUpTransformStreamDefaultControllerFromTransformer, transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformer, 3) \
- macro(transformStreamDefaultControllerClearAlgorithms, transformStreamInternalsTransformStreamDefaultControllerClearAlgorithms, 1) \
- macro(transformStreamDefaultControllerEnqueue, transformStreamInternalsTransformStreamDefaultControllerEnqueue, 2) \
- macro(transformStreamDefaultControllerError, transformStreamInternalsTransformStreamDefaultControllerError, 2) \
- macro(transformStreamDefaultControllerPerformTransform, transformStreamInternalsTransformStreamDefaultControllerPerformTransform, 2) \
- macro(transformStreamDefaultControllerTerminate, transformStreamInternalsTransformStreamDefaultControllerTerminate, 1) \
- macro(transformStreamDefaultSinkWriteAlgorithm, transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithm, 2) \
- macro(transformStreamDefaultSinkAbortAlgorithm, transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithm, 2) \
- macro(transformStreamDefaultSinkCloseAlgorithm, transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithm, 1) \
- macro(transformStreamDefaultSourcePullAlgorithm, transformStreamInternalsTransformStreamDefaultSourcePullAlgorithm, 1) \
+#define WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_DATA(macro) \
+ macro(highWaterMark, countQueuingStrategyHighWaterMark, 0) \
+ macro(initializeCountQueuingStrategy, countQueuingStrategyInitializeCountQueuingStrategy, 1) \
+ macro(size, countQueuingStrategySize, 0) \
-#define WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(macro) \
- macro(transformStreamInternalsIsTransformStreamCode, isTransformStream, ASCIILiteral(), s_transformStreamInternalsIsTransformStreamCodeLength) \
- macro(transformStreamInternalsIsTransformStreamDefaultControllerCode, isTransformStreamDefaultController, ASCIILiteral(), s_transformStreamInternalsIsTransformStreamDefaultControllerCodeLength) \
- macro(transformStreamInternalsCreateTransformStreamCode, createTransformStream, ASCIILiteral(), s_transformStreamInternalsCreateTransformStreamCodeLength) \
- macro(transformStreamInternalsInitializeTransformStreamCode, initializeTransformStream, ASCIILiteral(), s_transformStreamInternalsInitializeTransformStreamCodeLength) \
- macro(transformStreamInternalsTransformStreamErrorCode, transformStreamError, ASCIILiteral(), s_transformStreamInternalsTransformStreamErrorCodeLength) \
- macro(transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCode, transformStreamErrorWritableAndUnblockWrite, ASCIILiteral(), s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeLength) \
- macro(transformStreamInternalsTransformStreamSetBackpressureCode, transformStreamSetBackpressure, ASCIILiteral(), s_transformStreamInternalsTransformStreamSetBackpressureCodeLength) \
- macro(transformStreamInternalsSetUpTransformStreamDefaultControllerCode, setUpTransformStreamDefaultController, ASCIILiteral(), s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeLength) \
- macro(transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode, setUpTransformStreamDefaultControllerFromTransformer, ASCIILiteral(), s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeLength) \
- macro(transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCode, transformStreamDefaultControllerClearAlgorithms, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeLength) \
- macro(transformStreamInternalsTransformStreamDefaultControllerEnqueueCode, transformStreamDefaultControllerEnqueue, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeLength) \
- macro(transformStreamInternalsTransformStreamDefaultControllerErrorCode, transformStreamDefaultControllerError, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeLength) \
- macro(transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode, transformStreamDefaultControllerPerformTransform, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeLength) \
- macro(transformStreamInternalsTransformStreamDefaultControllerTerminateCode, transformStreamDefaultControllerTerminate, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeLength) \
- macro(transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode, transformStreamDefaultSinkWriteAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength) \
- macro(transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCode, transformStreamDefaultSinkAbortAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeLength) \
- macro(transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode, transformStreamDefaultSinkCloseAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeLength) \
- macro(transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCode, transformStreamDefaultSourcePullAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeLength) \
+#define WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(macro) \
+ macro(countQueuingStrategyHighWaterMarkCode, highWaterMark, "get highWaterMark"_s, s_countQueuingStrategyHighWaterMarkCodeLength) \
+ macro(countQueuingStrategyInitializeCountQueuingStrategyCode, initializeCountQueuingStrategy, ASCIILiteral(), s_countQueuingStrategyInitializeCountQueuingStrategyCodeLength) \
+ macro(countQueuingStrategySizeCode, size, ASCIILiteral(), s_countQueuingStrategySizeCodeLength) \
-#define WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \
- macro(isTransformStream) \
- macro(isTransformStreamDefaultController) \
- macro(createTransformStream) \
- macro(initializeTransformStream) \
- macro(transformStreamError) \
- macro(transformStreamErrorWritableAndUnblockWrite) \
- macro(transformStreamSetBackpressure) \
- macro(setUpTransformStreamDefaultController) \
- macro(setUpTransformStreamDefaultControllerFromTransformer) \
- macro(transformStreamDefaultControllerClearAlgorithms) \
- macro(transformStreamDefaultControllerEnqueue) \
- macro(transformStreamDefaultControllerError) \
- macro(transformStreamDefaultControllerPerformTransform) \
- macro(transformStreamDefaultControllerTerminate) \
- macro(transformStreamDefaultSinkWriteAlgorithm) \
- macro(transformStreamDefaultSinkAbortAlgorithm) \
- macro(transformStreamDefaultSinkCloseAlgorithm) \
- macro(transformStreamDefaultSourcePullAlgorithm) \
+#define WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(macro) \
+ macro(highWaterMark) \
+ macro(initializeCountQueuingStrategy) \
+ macro(size) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class TransformStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner {
+class CountQueuingStrategyBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit TransformStreamInternalsBuiltinsWrapper(JSC::VM& vm)
+ explicit CountQueuingStrategyBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -1080,28 +375,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* TransformStreamInternalsBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* CountQueuingStrategyBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -1111,113 +406,46 @@ inline JSC::UnlinkedFunctionExecutable* TransformStreamInternalsBuiltinsWrapper:
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void TransformStreamInternalsBuiltinsWrapper::exportNames()
+inline void CountQueuingStrategyBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-class TransformStreamInternalsBuiltinFunctions {
-public:
- explicit TransformStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
-
- void init(JSC::JSGlobalObject&);
- template<typename Visitor> void visit(Visitor&);
-
-public:
- JSC::VM& m_vm;
-
-#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \
- JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
- WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
-#undef DECLARE_BUILTIN_SOURCE_MEMBERS
-};
-
-inline void TransformStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
-{
-#define EXPORT_FUNCTION(codeName, functionName, overriddenName, length) \
- m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create(m_vm, codeName##Generator(m_vm), &globalObject));
- WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION)
-#undef EXPORT_FUNCTION
-}
-
-template<typename Visitor>
-inline void TransformStreamInternalsBuiltinFunctions::visit(Visitor& visitor)
-{
-#define VISIT_FUNCTION(name) visitor.append(m_##name##Function);
- WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
-#undef VISIT_FUNCTION
-}
-
-template void TransformStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&);
-template void TransformStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&);
- /* ProcessObjectInternals.ts */
-// binding
-#define WEBCORE_BUILTIN_PROCESSOBJECTINTERNALS_BINDING 1
-extern const char* const s_processObjectInternalsBindingCode;
-extern const int s_processObjectInternalsBindingCodeLength;
-extern const JSC::ConstructAbility s_processObjectInternalsBindingCodeConstructAbility;
-extern const JSC::ConstructorKind s_processObjectInternalsBindingCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_processObjectInternalsBindingCodeImplementationVisibility;
-
-// getStdioWriteStream
-#define WEBCORE_BUILTIN_PROCESSOBJECTINTERNALS_GETSTDIOWRITESTREAM 1
-extern const char* const s_processObjectInternalsGetStdioWriteStreamCode;
-extern const int s_processObjectInternalsGetStdioWriteStreamCodeLength;
-extern const JSC::ConstructAbility s_processObjectInternalsGetStdioWriteStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_processObjectInternalsGetStdioWriteStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_processObjectInternalsGetStdioWriteStreamCodeImplementationVisibility;
-
-// getStdinStream
-#define WEBCORE_BUILTIN_PROCESSOBJECTINTERNALS_GETSTDINSTREAM 1
-extern const char* const s_processObjectInternalsGetStdinStreamCode;
-extern const int s_processObjectInternalsGetStdinStreamCodeLength;
-extern const JSC::ConstructAbility s_processObjectInternalsGetStdinStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_processObjectInternalsGetStdinStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_processObjectInternalsGetStdinStreamCodeImplementationVisibility;
-
-// initializeNextTickQueue
-#define WEBCORE_BUILTIN_PROCESSOBJECTINTERNALS_INITIALIZENEXTTICKQUEUE 1
-extern const char* const s_processObjectInternalsInitializeNextTickQueueCode;
-extern const int s_processObjectInternalsInitializeNextTickQueueCodeLength;
-extern const JSC::ConstructAbility s_processObjectInternalsInitializeNextTickQueueCodeConstructAbility;
-extern const JSC::ConstructorKind s_processObjectInternalsInitializeNextTickQueueCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_processObjectInternalsInitializeNextTickQueueCodeImplementationVisibility;
+/* EventSource.ts */
+// getEventSource
+#define WEBCORE_BUILTIN_EVENTSOURCE_GETEVENTSOURCE 1
+extern const char* const s_eventSourceGetEventSourceCode;
+extern const int s_eventSourceGetEventSourceCodeLength;
+extern const JSC::ConstructAbility s_eventSourceGetEventSourceCodeConstructAbility;
+extern const JSC::ConstructorKind s_eventSourceGetEventSourceCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_eventSourceGetEventSourceCodeImplementationVisibility;
-#define WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_DATA(macro) \
- macro(binding, processObjectInternalsBinding, 1) \
- macro(getStdioWriteStream, processObjectInternalsGetStdioWriteStream, 1) \
- macro(getStdinStream, processObjectInternalsGetStdinStream, 1) \
- macro(initializeNextTickQueue, processObjectInternalsInitializeNextTickQueue, 4) \
+#define WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_DATA(macro) \
+ macro(getEventSource, eventSourceGetEventSource, 0) \
-#define WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(macro) \
- macro(processObjectInternalsBindingCode, binding, ASCIILiteral(), s_processObjectInternalsBindingCodeLength) \
- macro(processObjectInternalsGetStdioWriteStreamCode, getStdioWriteStream, ASCIILiteral(), s_processObjectInternalsGetStdioWriteStreamCodeLength) \
- macro(processObjectInternalsGetStdinStreamCode, getStdinStream, ASCIILiteral(), s_processObjectInternalsGetStdinStreamCodeLength) \
- macro(processObjectInternalsInitializeNextTickQueueCode, initializeNextTickQueue, ASCIILiteral(), s_processObjectInternalsInitializeNextTickQueueCodeLength) \
+#define WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(macro) \
+ macro(eventSourceGetEventSourceCode, getEventSource, ASCIILiteral(), s_eventSourceGetEventSourceCodeLength) \
-#define WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(macro) \
- macro(binding) \
- macro(getStdioWriteStream) \
- macro(getStdinStream) \
- macro(initializeNextTickQueue) \
+#define WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(macro) \
+ macro(getEventSource) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class ProcessObjectInternalsBuiltinsWrapper : private JSC::WeakHandleOwner {
+class EventSourceBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit ProcessObjectInternalsBuiltinsWrapper(JSC::VM& vm)
+ explicit EventSourceBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -1225,28 +453,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* ProcessObjectInternalsBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* EventSourceBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -1256,68 +484,90 @@ inline JSC::UnlinkedFunctionExecutable* ProcessObjectInternalsBuiltinsWrapper::n
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void ProcessObjectInternalsBuiltinsWrapper::exportNames()
+inline void EventSourceBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* TransformStream.ts */
-// initializeTransformStream
-#define WEBCORE_BUILTIN_TRANSFORMSTREAM_INITIALIZETRANSFORMSTREAM 1
-extern const char* const s_transformStreamInitializeTransformStreamCode;
-extern const int s_transformStreamInitializeTransformStreamCodeLength;
-extern const JSC::ConstructAbility s_transformStreamInitializeTransformStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamInitializeTransformStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamInitializeTransformStreamCodeImplementationVisibility;
+/* ImportMetaObject.ts */
+// createRequireCache
+#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_CREATEREQUIRECACHE 1
+extern const char* const s_importMetaObjectCreateRequireCacheCode;
+extern const int s_importMetaObjectCreateRequireCacheCodeLength;
+extern const JSC::ConstructAbility s_importMetaObjectCreateRequireCacheCodeConstructAbility;
+extern const JSC::ConstructorKind s_importMetaObjectCreateRequireCacheCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_importMetaObjectCreateRequireCacheCodeImplementationVisibility;
-// readable
-#define WEBCORE_BUILTIN_TRANSFORMSTREAM_READABLE 1
-extern const char* const s_transformStreamReadableCode;
-extern const int s_transformStreamReadableCodeLength;
-extern const JSC::ConstructAbility s_transformStreamReadableCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamReadableCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamReadableCodeImplementationVisibility;
+// internalRequire
+#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_INTERNALREQUIRE 1
+extern const char* const s_importMetaObjectInternalRequireCode;
+extern const int s_importMetaObjectInternalRequireCodeLength;
+extern const JSC::ConstructAbility s_importMetaObjectInternalRequireCodeConstructAbility;
+extern const JSC::ConstructorKind s_importMetaObjectInternalRequireCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_importMetaObjectInternalRequireCodeImplementationVisibility;
-// writable
-#define WEBCORE_BUILTIN_TRANSFORMSTREAM_WRITABLE 1
-extern const char* const s_transformStreamWritableCode;
-extern const int s_transformStreamWritableCodeLength;
-extern const JSC::ConstructAbility s_transformStreamWritableCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamWritableCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamWritableCodeImplementationVisibility;
+// loadCJS2ESM
+#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_LOADCJS2ESM 1
+extern const char* const s_importMetaObjectLoadCJS2ESMCode;
+extern const int s_importMetaObjectLoadCJS2ESMCodeLength;
+extern const JSC::ConstructAbility s_importMetaObjectLoadCJS2ESMCodeConstructAbility;
+extern const JSC::ConstructorKind s_importMetaObjectLoadCJS2ESMCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_importMetaObjectLoadCJS2ESMCodeImplementationVisibility;
-#define WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_DATA(macro) \
- macro(initializeTransformStream, transformStreamInitializeTransformStream, 0) \
- macro(readable, transformStreamReadable, 0) \
- macro(writable, transformStreamWritable, 0) \
+// main
+#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_MAIN 1
+extern const char* const s_importMetaObjectMainCode;
+extern const int s_importMetaObjectMainCodeLength;
+extern const JSC::ConstructAbility s_importMetaObjectMainCodeConstructAbility;
+extern const JSC::ConstructorKind s_importMetaObjectMainCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_importMetaObjectMainCodeImplementationVisibility;
-#define WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(macro) \
- macro(transformStreamInitializeTransformStreamCode, initializeTransformStream, ASCIILiteral(), s_transformStreamInitializeTransformStreamCodeLength) \
- macro(transformStreamReadableCode, readable, "get readable"_s, s_transformStreamReadableCodeLength) \
- macro(transformStreamWritableCode, writable, ASCIILiteral(), s_transformStreamWritableCodeLength) \
+// requireESM
+#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_REQUIREESM 1
+extern const char* const s_importMetaObjectRequireESMCode;
+extern const int s_importMetaObjectRequireESMCodeLength;
+extern const JSC::ConstructAbility s_importMetaObjectRequireESMCodeConstructAbility;
+extern const JSC::ConstructorKind s_importMetaObjectRequireESMCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_importMetaObjectRequireESMCodeImplementationVisibility;
-#define WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(macro) \
- macro(initializeTransformStream) \
- macro(readable) \
- macro(writable) \
+#define WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_DATA(macro) \
+ macro(createRequireCache, importMetaObjectCreateRequireCache, 0) \
+ macro(internalRequire, importMetaObjectInternalRequire, 1) \
+ macro(loadCJS2ESM, importMetaObjectLoadCJS2ESM, 1) \
+ macro(main, importMetaObjectMain, 0) \
+ macro(requireESM, importMetaObjectRequireESM, 1) \
+
+#define WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(macro) \
+ macro(importMetaObjectCreateRequireCacheCode, createRequireCache, ASCIILiteral(), s_importMetaObjectCreateRequireCacheCodeLength) \
+ macro(importMetaObjectInternalRequireCode, internalRequire, ASCIILiteral(), s_importMetaObjectInternalRequireCodeLength) \
+ macro(importMetaObjectLoadCJS2ESMCode, loadCJS2ESM, ASCIILiteral(), s_importMetaObjectLoadCJS2ESMCodeLength) \
+ macro(importMetaObjectMainCode, main, "get main"_s, s_importMetaObjectMainCodeLength) \
+ macro(importMetaObjectRequireESMCode, requireESM, ASCIILiteral(), s_importMetaObjectRequireESMCodeLength) \
+
+#define WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(macro) \
+ macro(createRequireCache) \
+ macro(internalRequire) \
+ macro(loadCJS2ESM) \
+ macro(main) \
+ macro(requireESM) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class TransformStreamBuiltinsWrapper : private JSC::WeakHandleOwner {
+class ImportMetaObjectBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit TransformStreamBuiltinsWrapper(JSC::VM& vm)
+ explicit ImportMetaObjectBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -1325,28 +575,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* TransformStreamBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* ImportMetaObjectBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -1356,79 +606,57 @@ inline JSC::UnlinkedFunctionExecutable* TransformStreamBuiltinsWrapper::name##Ex
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void TransformStreamBuiltinsWrapper::exportNames()
+inline void ImportMetaObjectBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* Module.ts */
-// main
-#define WEBCORE_BUILTIN_MODULE_MAIN 1
-extern const char* const s_moduleMainCode;
-extern const int s_moduleMainCodeLength;
-extern const JSC::ConstructAbility s_moduleMainCodeConstructAbility;
-extern const JSC::ConstructorKind s_moduleMainCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_moduleMainCodeImplementationVisibility;
-
-// require
-#define WEBCORE_BUILTIN_MODULE_REQUIRE 1
-extern const char* const s_moduleRequireCode;
-extern const int s_moduleRequireCodeLength;
-extern const JSC::ConstructAbility s_moduleRequireCodeConstructAbility;
-extern const JSC::ConstructorKind s_moduleRequireCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_moduleRequireCodeImplementationVisibility;
-
-// requireResolve
-#define WEBCORE_BUILTIN_MODULE_REQUIRERESOLVE 1
-extern const char* const s_moduleRequireResolveCode;
-extern const int s_moduleRequireResolveCodeLength;
-extern const JSC::ConstructAbility s_moduleRequireResolveCodeConstructAbility;
-extern const JSC::ConstructorKind s_moduleRequireResolveCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_moduleRequireResolveCodeImplementationVisibility;
+/* JSBufferConstructor.ts */
+// from
+#define WEBCORE_BUILTIN_JSBUFFERCONSTRUCTOR_FROM 1
+extern const char* const s_jsBufferConstructorFromCode;
+extern const int s_jsBufferConstructorFromCodeLength;
+extern const JSC::ConstructAbility s_jsBufferConstructorFromCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferConstructorFromCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferConstructorFromCodeImplementationVisibility;
-// requireNativeModule
-#define WEBCORE_BUILTIN_MODULE_REQUIRENATIVEMODULE 1
-extern const char* const s_moduleRequireNativeModuleCode;
-extern const int s_moduleRequireNativeModuleCodeLength;
-extern const JSC::ConstructAbility s_moduleRequireNativeModuleCodeConstructAbility;
-extern const JSC::ConstructorKind s_moduleRequireNativeModuleCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_moduleRequireNativeModuleCodeImplementationVisibility;
+// isBuffer
+#define WEBCORE_BUILTIN_JSBUFFERCONSTRUCTOR_ISBUFFER 1
+extern const char* const s_jsBufferConstructorIsBufferCode;
+extern const int s_jsBufferConstructorIsBufferCodeLength;
+extern const JSC::ConstructAbility s_jsBufferConstructorIsBufferCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferConstructorIsBufferCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferConstructorIsBufferCodeImplementationVisibility;
-#define WEBCORE_FOREACH_MODULE_BUILTIN_DATA(macro) \
- macro(main, moduleMain, 0) \
- macro(require, moduleRequire, 1) \
- macro(requireResolve, moduleRequireResolve, 1) \
- macro(requireNativeModule, moduleRequireNativeModule, 1) \
+#define WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_DATA(macro) \
+ macro(from, jsBufferConstructorFrom, 1) \
+ macro(isBuffer, jsBufferConstructorIsBuffer, 1) \
-#define WEBCORE_FOREACH_MODULE_BUILTIN_CODE(macro) \
- macro(moduleMainCode, main, "get main"_s, s_moduleMainCodeLength) \
- macro(moduleRequireCode, require, ASCIILiteral(), s_moduleRequireCodeLength) \
- macro(moduleRequireResolveCode, requireResolve, ASCIILiteral(), s_moduleRequireResolveCodeLength) \
- macro(moduleRequireNativeModuleCode, requireNativeModule, ASCIILiteral(), s_moduleRequireNativeModuleCodeLength) \
+#define WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(macro) \
+ macro(jsBufferConstructorFromCode, from, ASCIILiteral(), s_jsBufferConstructorFromCodeLength) \
+ macro(jsBufferConstructorIsBufferCode, isBuffer, ASCIILiteral(), s_jsBufferConstructorIsBufferCodeLength) \
-#define WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(macro) \
- macro(main) \
- macro(require) \
- macro(requireResolve) \
- macro(requireNativeModule) \
+#define WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(macro) \
+ macro(from) \
+ macro(isBuffer) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class ModuleBuiltinsWrapper : private JSC::WeakHandleOwner {
+class JSBufferConstructorBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit ModuleBuiltinsWrapper(JSC::VM& vm)
+ explicit JSBufferConstructorBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_MODULE_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -1436,28 +664,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_MODULE_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* ModuleBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* JSBufferConstructorBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -1467,47 +695,183 @@ inline JSC::UnlinkedFunctionExecutable* ModuleBuiltinsWrapper::name##Executable(
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void ModuleBuiltinsWrapper::exportNames()
+inline void JSBufferConstructorBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
/* JSBufferPrototype.ts */
-// setBigUint64
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_SETBIGUINT64 1
-extern const char* const s_jsBufferPrototypeSetBigUint64Code;
-extern const int s_jsBufferPrototypeSetBigUint64CodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeSetBigUint64CodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeSetBigUint64CodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeSetBigUint64CodeImplementationVisibility;
+// asciiSlice
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_ASCIISLICE 1
+extern const char* const s_jsBufferPrototypeAsciiSliceCode;
+extern const int s_jsBufferPrototypeAsciiSliceCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeAsciiSliceCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeAsciiSliceCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiSliceCodeImplementationVisibility;
-// readInt8
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT8 1
-extern const char* const s_jsBufferPrototypeReadInt8Code;
-extern const int s_jsBufferPrototypeReadInt8CodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt8CodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt8CodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt8CodeImplementationVisibility;
+// asciiWrite
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_ASCIIWRITE 1
+extern const char* const s_jsBufferPrototypeAsciiWriteCode;
+extern const int s_jsBufferPrototypeAsciiWriteCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeAsciiWriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeAsciiWriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiWriteCodeImplementationVisibility;
-// readUInt8
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT8 1
-extern const char* const s_jsBufferPrototypeReadUInt8Code;
-extern const int s_jsBufferPrototypeReadUInt8CodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt8CodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt8CodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt8CodeImplementationVisibility;
+// base64Slice
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64SLICE 1
+extern const char* const s_jsBufferPrototypeBase64SliceCode;
+extern const int s_jsBufferPrototypeBase64SliceCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeBase64SliceCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeBase64SliceCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64SliceCodeImplementationVisibility;
-// readInt16LE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT16LE 1
-extern const char* const s_jsBufferPrototypeReadInt16LECode;
-extern const int s_jsBufferPrototypeReadInt16LECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt16LECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt16LECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16LECodeImplementationVisibility;
+// base64urlSlice
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64URLSLICE 1
+extern const char* const s_jsBufferPrototypeBase64urlSliceCode;
+extern const int s_jsBufferPrototypeBase64urlSliceCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeBase64urlSliceCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeBase64urlSliceCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlSliceCodeImplementationVisibility;
+
+// base64urlWrite
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64URLWRITE 1
+extern const char* const s_jsBufferPrototypeBase64urlWriteCode;
+extern const int s_jsBufferPrototypeBase64urlWriteCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeBase64urlWriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeBase64urlWriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlWriteCodeImplementationVisibility;
+
+// base64Write
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64WRITE 1
+extern const char* const s_jsBufferPrototypeBase64WriteCode;
+extern const int s_jsBufferPrototypeBase64WriteCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeBase64WriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeBase64WriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64WriteCodeImplementationVisibility;
+
+// hexSlice
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_HEXSLICE 1
+extern const char* const s_jsBufferPrototypeHexSliceCode;
+extern const int s_jsBufferPrototypeHexSliceCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeHexSliceCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeHexSliceCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeHexSliceCodeImplementationVisibility;
+
+// hexWrite
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_HEXWRITE 1
+extern const char* const s_jsBufferPrototypeHexWriteCode;
+extern const int s_jsBufferPrototypeHexWriteCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeHexWriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeHexWriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeHexWriteCodeImplementationVisibility;
+
+// inspect
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_INSPECT 1
+extern const char* const s_jsBufferPrototypeInspectCode;
+extern const int s_jsBufferPrototypeInspectCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeInspectCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeInspectCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeInspectCodeImplementationVisibility;
+
+// latin1Slice
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_LATIN1SLICE 1
+extern const char* const s_jsBufferPrototypeLatin1SliceCode;
+extern const int s_jsBufferPrototypeLatin1SliceCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeLatin1SliceCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeLatin1SliceCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1SliceCodeImplementationVisibility;
+
+// latin1Write
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_LATIN1WRITE 1
+extern const char* const s_jsBufferPrototypeLatin1WriteCode;
+extern const int s_jsBufferPrototypeLatin1WriteCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeLatin1WriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeLatin1WriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1WriteCodeImplementationVisibility;
+
+// offset
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_OFFSET 1
+extern const char* const s_jsBufferPrototypeOffsetCode;
+extern const int s_jsBufferPrototypeOffsetCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeOffsetCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeOffsetCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeOffsetCodeImplementationVisibility;
+
+// parent
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_PARENT 1
+extern const char* const s_jsBufferPrototypeParentCode;
+extern const int s_jsBufferPrototypeParentCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeParentCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeParentCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeParentCodeImplementationVisibility;
+
+// readBigInt64BE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGINT64BE 1
+extern const char* const s_jsBufferPrototypeReadBigInt64BECode;
+extern const int s_jsBufferPrototypeReadBigInt64BECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64BECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64BECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64BECodeImplementationVisibility;
+
+// readBigInt64LE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGINT64LE 1
+extern const char* const s_jsBufferPrototypeReadBigInt64LECode;
+extern const int s_jsBufferPrototypeReadBigInt64LECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64LECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64LECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64LECodeImplementationVisibility;
+
+// readBigUInt64BE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGUINT64BE 1
+extern const char* const s_jsBufferPrototypeReadBigUInt64BECode;
+extern const int s_jsBufferPrototypeReadBigUInt64BECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64BECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64BECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64BECodeImplementationVisibility;
+
+// readBigUInt64LE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGUINT64LE 1
+extern const char* const s_jsBufferPrototypeReadBigUInt64LECode;
+extern const int s_jsBufferPrototypeReadBigUInt64LECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64LECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64LECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64LECodeImplementationVisibility;
+
+// readDoubleBE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READDOUBLEBE 1
+extern const char* const s_jsBufferPrototypeReadDoubleBECode;
+extern const int s_jsBufferPrototypeReadDoubleBECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleBECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleBECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleBECodeImplementationVisibility;
+
+// readDoubleLE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READDOUBLELE 1
+extern const char* const s_jsBufferPrototypeReadDoubleLECode;
+extern const int s_jsBufferPrototypeReadDoubleLECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleLECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleLECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleLECodeImplementationVisibility;
+
+// readFloatBE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READFLOATBE 1
+extern const char* const s_jsBufferPrototypeReadFloatBECode;
+extern const int s_jsBufferPrototypeReadFloatBECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadFloatBECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadFloatBECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatBECodeImplementationVisibility;
+
+// readFloatLE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READFLOATLE 1
+extern const char* const s_jsBufferPrototypeReadFloatLECode;
+extern const int s_jsBufferPrototypeReadFloatLECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadFloatLECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadFloatLECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatLECodeImplementationVisibility;
// readInt16BE
#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT16BE 1
@@ -1517,21 +881,21 @@ extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt16BECodeConstructAb
extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt16BECodeConstructorKind;
extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16BECodeImplementationVisibility;
-// readUInt16LE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT16LE 1
-extern const char* const s_jsBufferPrototypeReadUInt16LECode;
-extern const int s_jsBufferPrototypeReadUInt16LECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16LECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16LECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16LECodeImplementationVisibility;
+// readInt16LE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT16LE 1
+extern const char* const s_jsBufferPrototypeReadInt16LECode;
+extern const int s_jsBufferPrototypeReadInt16LECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt16LECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt16LECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16LECodeImplementationVisibility;
-// readUInt16BE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT16BE 1
-extern const char* const s_jsBufferPrototypeReadUInt16BECode;
-extern const int s_jsBufferPrototypeReadUInt16BECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16BECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16BECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16BECodeImplementationVisibility;
+// readInt32BE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT32BE 1
+extern const char* const s_jsBufferPrototypeReadInt32BECode;
+extern const int s_jsBufferPrototypeReadInt32BECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt32BECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt32BECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32BECodeImplementationVisibility;
// readInt32LE
#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT32LE 1
@@ -1541,21 +905,45 @@ extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt32LECodeConstructAb
extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt32LECodeConstructorKind;
extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32LECodeImplementationVisibility;
-// readInt32BE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT32BE 1
-extern const char* const s_jsBufferPrototypeReadInt32BECode;
-extern const int s_jsBufferPrototypeReadInt32BECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt32BECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt32BECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32BECodeImplementationVisibility;
+// readInt8
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT8 1
+extern const char* const s_jsBufferPrototypeReadInt8Code;
+extern const int s_jsBufferPrototypeReadInt8CodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt8CodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt8CodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt8CodeImplementationVisibility;
-// readUInt32LE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT32LE 1
-extern const char* const s_jsBufferPrototypeReadUInt32LECode;
-extern const int s_jsBufferPrototypeReadUInt32LECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32LECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32LECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32LECodeImplementationVisibility;
+// readIntBE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINTBE 1
+extern const char* const s_jsBufferPrototypeReadIntBECode;
+extern const int s_jsBufferPrototypeReadIntBECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadIntBECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadIntBECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntBECodeImplementationVisibility;
+
+// readIntLE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINTLE 1
+extern const char* const s_jsBufferPrototypeReadIntLECode;
+extern const int s_jsBufferPrototypeReadIntLECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadIntLECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadIntLECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntLECodeImplementationVisibility;
+
+// readUInt16BE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT16BE 1
+extern const char* const s_jsBufferPrototypeReadUInt16BECode;
+extern const int s_jsBufferPrototypeReadUInt16BECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16BECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16BECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16BECodeImplementationVisibility;
+
+// readUInt16LE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT16LE 1
+extern const char* const s_jsBufferPrototypeReadUInt16LECode;
+extern const int s_jsBufferPrototypeReadUInt16LECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16LECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16LECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16LECodeImplementationVisibility;
// readUInt32BE
#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT32BE 1
@@ -1565,21 +953,29 @@ extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32BECodeConstructA
extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32BECodeConstructorKind;
extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32BECodeImplementationVisibility;
-// readIntLE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINTLE 1
-extern const char* const s_jsBufferPrototypeReadIntLECode;
-extern const int s_jsBufferPrototypeReadIntLECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadIntLECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadIntLECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntLECodeImplementationVisibility;
+// readUInt32LE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT32LE 1
+extern const char* const s_jsBufferPrototypeReadUInt32LECode;
+extern const int s_jsBufferPrototypeReadUInt32LECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32LECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32LECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32LECodeImplementationVisibility;
-// readIntBE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINTBE 1
-extern const char* const s_jsBufferPrototypeReadIntBECode;
-extern const int s_jsBufferPrototypeReadIntBECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadIntBECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadIntBECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntBECodeImplementationVisibility;
+// readUInt8
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT8 1
+extern const char* const s_jsBufferPrototypeReadUInt8Code;
+extern const int s_jsBufferPrototypeReadUInt8CodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt8CodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt8CodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt8CodeImplementationVisibility;
+
+// readUIntBE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINTBE 1
+extern const char* const s_jsBufferPrototypeReadUIntBECode;
+extern const int s_jsBufferPrototypeReadUIntBECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeReadUIntBECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeReadUIntBECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntBECodeImplementationVisibility;
// readUIntLE
#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINTLE 1
@@ -1589,101 +985,141 @@ extern const JSC::ConstructAbility s_jsBufferPrototypeReadUIntLECodeConstructAbi
extern const JSC::ConstructorKind s_jsBufferPrototypeReadUIntLECodeConstructorKind;
extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntLECodeImplementationVisibility;
-// readUIntBE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINTBE 1
-extern const char* const s_jsBufferPrototypeReadUIntBECode;
-extern const int s_jsBufferPrototypeReadUIntBECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadUIntBECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadUIntBECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntBECodeImplementationVisibility;
+// setBigUint64
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_SETBIGUINT64 1
+extern const char* const s_jsBufferPrototypeSetBigUint64Code;
+extern const int s_jsBufferPrototypeSetBigUint64CodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeSetBigUint64CodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeSetBigUint64CodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeSetBigUint64CodeImplementationVisibility;
-// readFloatLE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READFLOATLE 1
-extern const char* const s_jsBufferPrototypeReadFloatLECode;
-extern const int s_jsBufferPrototypeReadFloatLECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadFloatLECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadFloatLECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatLECodeImplementationVisibility;
+// slice
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_SLICE 1
+extern const char* const s_jsBufferPrototypeSliceCode;
+extern const int s_jsBufferPrototypeSliceCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeSliceCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeSliceCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeSliceCodeImplementationVisibility;
-// readFloatBE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READFLOATBE 1
-extern const char* const s_jsBufferPrototypeReadFloatBECode;
-extern const int s_jsBufferPrototypeReadFloatBECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadFloatBECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadFloatBECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatBECodeImplementationVisibility;
+// toJSON
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_TOJSON 1
+extern const char* const s_jsBufferPrototypeToJSONCode;
+extern const int s_jsBufferPrototypeToJSONCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeToJSONCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeToJSONCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeToJSONCodeImplementationVisibility;
-// readDoubleLE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READDOUBLELE 1
-extern const char* const s_jsBufferPrototypeReadDoubleLECode;
-extern const int s_jsBufferPrototypeReadDoubleLECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleLECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleLECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleLECodeImplementationVisibility;
+// ucs2Slice
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UCS2SLICE 1
+extern const char* const s_jsBufferPrototypeUcs2SliceCode;
+extern const int s_jsBufferPrototypeUcs2SliceCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeUcs2SliceCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeUcs2SliceCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2SliceCodeImplementationVisibility;
-// readDoubleBE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READDOUBLEBE 1
-extern const char* const s_jsBufferPrototypeReadDoubleBECode;
-extern const int s_jsBufferPrototypeReadDoubleBECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleBECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleBECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleBECodeImplementationVisibility;
+// ucs2Write
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UCS2WRITE 1
+extern const char* const s_jsBufferPrototypeUcs2WriteCode;
+extern const int s_jsBufferPrototypeUcs2WriteCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeUcs2WriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeUcs2WriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2WriteCodeImplementationVisibility;
-// readBigInt64LE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGINT64LE 1
-extern const char* const s_jsBufferPrototypeReadBigInt64LECode;
-extern const int s_jsBufferPrototypeReadBigInt64LECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64LECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64LECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64LECodeImplementationVisibility;
+// utf16leSlice
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF16LESLICE 1
+extern const char* const s_jsBufferPrototypeUtf16leSliceCode;
+extern const int s_jsBufferPrototypeUtf16leSliceCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeUtf16leSliceCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeUtf16leSliceCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leSliceCodeImplementationVisibility;
-// readBigInt64BE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGINT64BE 1
-extern const char* const s_jsBufferPrototypeReadBigInt64BECode;
-extern const int s_jsBufferPrototypeReadBigInt64BECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64BECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64BECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64BECodeImplementationVisibility;
+// utf16leWrite
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF16LEWRITE 1
+extern const char* const s_jsBufferPrototypeUtf16leWriteCode;
+extern const int s_jsBufferPrototypeUtf16leWriteCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeUtf16leWriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeUtf16leWriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leWriteCodeImplementationVisibility;
-// readBigUInt64LE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGUINT64LE 1
-extern const char* const s_jsBufferPrototypeReadBigUInt64LECode;
-extern const int s_jsBufferPrototypeReadBigUInt64LECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64LECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64LECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64LECodeImplementationVisibility;
+// utf8Slice
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF8SLICE 1
+extern const char* const s_jsBufferPrototypeUtf8SliceCode;
+extern const int s_jsBufferPrototypeUtf8SliceCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeUtf8SliceCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeUtf8SliceCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8SliceCodeImplementationVisibility;
-// readBigUInt64BE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGUINT64BE 1
-extern const char* const s_jsBufferPrototypeReadBigUInt64BECode;
-extern const int s_jsBufferPrototypeReadBigUInt64BECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64BECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64BECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64BECodeImplementationVisibility;
+// utf8Write
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF8WRITE 1
+extern const char* const s_jsBufferPrototypeUtf8WriteCode;
+extern const int s_jsBufferPrototypeUtf8WriteCodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeUtf8WriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeUtf8WriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8WriteCodeImplementationVisibility;
-// writeInt8
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT8 1
-extern const char* const s_jsBufferPrototypeWriteInt8Code;
-extern const int s_jsBufferPrototypeWriteInt8CodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt8CodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt8CodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt8CodeImplementationVisibility;
+// writeBigInt64BE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGINT64BE 1
+extern const char* const s_jsBufferPrototypeWriteBigInt64BECode;
+extern const int s_jsBufferPrototypeWriteBigInt64BECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64BECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64BECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64BECodeImplementationVisibility;
-// writeUInt8
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT8 1
-extern const char* const s_jsBufferPrototypeWriteUInt8Code;
-extern const int s_jsBufferPrototypeWriteUInt8CodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt8CodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt8CodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt8CodeImplementationVisibility;
+// writeBigInt64LE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGINT64LE 1
+extern const char* const s_jsBufferPrototypeWriteBigInt64LECode;
+extern const int s_jsBufferPrototypeWriteBigInt64LECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64LECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64LECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64LECodeImplementationVisibility;
-// writeInt16LE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT16LE 1
-extern const char* const s_jsBufferPrototypeWriteInt16LECode;
-extern const int s_jsBufferPrototypeWriteInt16LECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16LECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16LECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16LECodeImplementationVisibility;
+// writeBigUInt64BE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGUINT64BE 1
+extern const char* const s_jsBufferPrototypeWriteBigUInt64BECode;
+extern const int s_jsBufferPrototypeWriteBigUInt64BECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64BECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64BECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64BECodeImplementationVisibility;
+
+// writeBigUInt64LE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGUINT64LE 1
+extern const char* const s_jsBufferPrototypeWriteBigUInt64LECode;
+extern const int s_jsBufferPrototypeWriteBigUInt64LECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64LECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64LECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64LECodeImplementationVisibility;
+
+// writeDoubleBE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEDOUBLEBE 1
+extern const char* const s_jsBufferPrototypeWriteDoubleBECode;
+extern const int s_jsBufferPrototypeWriteDoubleBECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleBECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleBECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleBECodeImplementationVisibility;
+
+// writeDoubleLE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEDOUBLELE 1
+extern const char* const s_jsBufferPrototypeWriteDoubleLECode;
+extern const int s_jsBufferPrototypeWriteDoubleLECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleLECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleLECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleLECodeImplementationVisibility;
+
+// writeFloatBE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEFLOATBE 1
+extern const char* const s_jsBufferPrototypeWriteFloatBECode;
+extern const int s_jsBufferPrototypeWriteFloatBECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatBECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatBECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatBECodeImplementationVisibility;
+
+// writeFloatLE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEFLOATLE 1
+extern const char* const s_jsBufferPrototypeWriteFloatLECode;
+extern const int s_jsBufferPrototypeWriteFloatLECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatLECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatLECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatLECodeImplementationVisibility;
// writeInt16BE
#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT16BE 1
@@ -1693,21 +1129,21 @@ extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16BECodeConstructA
extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16BECodeConstructorKind;
extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16BECodeImplementationVisibility;
-// writeUInt16LE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT16LE 1
-extern const char* const s_jsBufferPrototypeWriteUInt16LECode;
-extern const int s_jsBufferPrototypeWriteUInt16LECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16LECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16LECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16LECodeImplementationVisibility;
+// writeInt16LE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT16LE 1
+extern const char* const s_jsBufferPrototypeWriteInt16LECode;
+extern const int s_jsBufferPrototypeWriteInt16LECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16LECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16LECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16LECodeImplementationVisibility;
-// writeUInt16BE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT16BE 1
-extern const char* const s_jsBufferPrototypeWriteUInt16BECode;
-extern const int s_jsBufferPrototypeWriteUInt16BECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16BECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16BECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16BECodeImplementationVisibility;
+// writeInt32BE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT32BE 1
+extern const char* const s_jsBufferPrototypeWriteInt32BECode;
+extern const int s_jsBufferPrototypeWriteInt32BECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32BECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32BECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32BECodeImplementationVisibility;
// writeInt32LE
#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT32LE 1
@@ -1717,29 +1153,21 @@ extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32LECodeConstructA
extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32LECodeConstructorKind;
extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32LECodeImplementationVisibility;
-// writeInt32BE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT32BE 1
-extern const char* const s_jsBufferPrototypeWriteInt32BECode;
-extern const int s_jsBufferPrototypeWriteInt32BECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32BECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32BECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32BECodeImplementationVisibility;
-
-// writeUInt32LE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT32LE 1
-extern const char* const s_jsBufferPrototypeWriteUInt32LECode;
-extern const int s_jsBufferPrototypeWriteUInt32LECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32LECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32LECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32LECodeImplementationVisibility;
+// writeInt8
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT8 1
+extern const char* const s_jsBufferPrototypeWriteInt8Code;
+extern const int s_jsBufferPrototypeWriteInt8CodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt8CodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt8CodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt8CodeImplementationVisibility;
-// writeUInt32BE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT32BE 1
-extern const char* const s_jsBufferPrototypeWriteUInt32BECode;
-extern const int s_jsBufferPrototypeWriteUInt32BECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32BECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32BECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32BECodeImplementationVisibility;
+// writeIntBE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINTBE 1
+extern const char* const s_jsBufferPrototypeWriteIntBECode;
+extern const int s_jsBufferPrototypeWriteIntBECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteIntBECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteIntBECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntBECodeImplementationVisibility;
// writeIntLE
#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINTLE 1
@@ -1749,21 +1177,45 @@ extern const JSC::ConstructAbility s_jsBufferPrototypeWriteIntLECodeConstructAbi
extern const JSC::ConstructorKind s_jsBufferPrototypeWriteIntLECodeConstructorKind;
extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntLECodeImplementationVisibility;
-// writeIntBE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINTBE 1
-extern const char* const s_jsBufferPrototypeWriteIntBECode;
-extern const int s_jsBufferPrototypeWriteIntBECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteIntBECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteIntBECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntBECodeImplementationVisibility;
+// writeUInt16BE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT16BE 1
+extern const char* const s_jsBufferPrototypeWriteUInt16BECode;
+extern const int s_jsBufferPrototypeWriteUInt16BECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16BECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16BECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16BECodeImplementationVisibility;
-// writeUIntLE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINTLE 1
-extern const char* const s_jsBufferPrototypeWriteUIntLECode;
-extern const int s_jsBufferPrototypeWriteUIntLECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntLECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntLECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntLECodeImplementationVisibility;
+// writeUInt16LE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT16LE 1
+extern const char* const s_jsBufferPrototypeWriteUInt16LECode;
+extern const int s_jsBufferPrototypeWriteUInt16LECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16LECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16LECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16LECodeImplementationVisibility;
+
+// writeUInt32BE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT32BE 1
+extern const char* const s_jsBufferPrototypeWriteUInt32BECode;
+extern const int s_jsBufferPrototypeWriteUInt32BECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32BECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32BECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32BECodeImplementationVisibility;
+
+// writeUInt32LE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT32LE 1
+extern const char* const s_jsBufferPrototypeWriteUInt32LECode;
+extern const int s_jsBufferPrototypeWriteUInt32LECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32LECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32LECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32LECodeImplementationVisibility;
+
+// writeUInt8
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT8 1
+extern const char* const s_jsBufferPrototypeWriteUInt8Code;
+extern const int s_jsBufferPrototypeWriteUInt8CodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt8CodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt8CodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt8CodeImplementationVisibility;
// writeUIntBE
#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINTBE 1
@@ -1773,441 +1225,217 @@ extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntBECodeConstructAb
extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntBECodeConstructorKind;
extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntBECodeImplementationVisibility;
-// writeFloatLE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEFLOATLE 1
-extern const char* const s_jsBufferPrototypeWriteFloatLECode;
-extern const int s_jsBufferPrototypeWriteFloatLECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatLECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatLECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatLECodeImplementationVisibility;
-
-// writeFloatBE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEFLOATBE 1
-extern const char* const s_jsBufferPrototypeWriteFloatBECode;
-extern const int s_jsBufferPrototypeWriteFloatBECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatBECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatBECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatBECodeImplementationVisibility;
-
-// writeDoubleLE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEDOUBLELE 1
-extern const char* const s_jsBufferPrototypeWriteDoubleLECode;
-extern const int s_jsBufferPrototypeWriteDoubleLECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleLECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleLECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleLECodeImplementationVisibility;
-
-// writeDoubleBE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEDOUBLEBE 1
-extern const char* const s_jsBufferPrototypeWriteDoubleBECode;
-extern const int s_jsBufferPrototypeWriteDoubleBECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleBECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleBECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleBECodeImplementationVisibility;
-
-// writeBigInt64LE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGINT64LE 1
-extern const char* const s_jsBufferPrototypeWriteBigInt64LECode;
-extern const int s_jsBufferPrototypeWriteBigInt64LECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64LECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64LECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64LECodeImplementationVisibility;
-
-// writeBigInt64BE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGINT64BE 1
-extern const char* const s_jsBufferPrototypeWriteBigInt64BECode;
-extern const int s_jsBufferPrototypeWriteBigInt64BECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64BECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64BECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64BECodeImplementationVisibility;
-
-// writeBigUInt64LE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGUINT64LE 1
-extern const char* const s_jsBufferPrototypeWriteBigUInt64LECode;
-extern const int s_jsBufferPrototypeWriteBigUInt64LECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64LECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64LECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64LECodeImplementationVisibility;
-
-// writeBigUInt64BE
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGUINT64BE 1
-extern const char* const s_jsBufferPrototypeWriteBigUInt64BECode;
-extern const int s_jsBufferPrototypeWriteBigUInt64BECodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64BECodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64BECodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64BECodeImplementationVisibility;
-
-// utf8Write
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF8WRITE 1
-extern const char* const s_jsBufferPrototypeUtf8WriteCode;
-extern const int s_jsBufferPrototypeUtf8WriteCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeUtf8WriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeUtf8WriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8WriteCodeImplementationVisibility;
-
-// ucs2Write
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UCS2WRITE 1
-extern const char* const s_jsBufferPrototypeUcs2WriteCode;
-extern const int s_jsBufferPrototypeUcs2WriteCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeUcs2WriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeUcs2WriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2WriteCodeImplementationVisibility;
-
-// utf16leWrite
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF16LEWRITE 1
-extern const char* const s_jsBufferPrototypeUtf16leWriteCode;
-extern const int s_jsBufferPrototypeUtf16leWriteCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeUtf16leWriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeUtf16leWriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leWriteCodeImplementationVisibility;
-
-// latin1Write
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_LATIN1WRITE 1
-extern const char* const s_jsBufferPrototypeLatin1WriteCode;
-extern const int s_jsBufferPrototypeLatin1WriteCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeLatin1WriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeLatin1WriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1WriteCodeImplementationVisibility;
-
-// asciiWrite
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_ASCIIWRITE 1
-extern const char* const s_jsBufferPrototypeAsciiWriteCode;
-extern const int s_jsBufferPrototypeAsciiWriteCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeAsciiWriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeAsciiWriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiWriteCodeImplementationVisibility;
-
-// base64Write
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64WRITE 1
-extern const char* const s_jsBufferPrototypeBase64WriteCode;
-extern const int s_jsBufferPrototypeBase64WriteCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeBase64WriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeBase64WriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64WriteCodeImplementationVisibility;
-
-// base64urlWrite
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64URLWRITE 1
-extern const char* const s_jsBufferPrototypeBase64urlWriteCode;
-extern const int s_jsBufferPrototypeBase64urlWriteCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeBase64urlWriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeBase64urlWriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlWriteCodeImplementationVisibility;
-
-// hexWrite
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_HEXWRITE 1
-extern const char* const s_jsBufferPrototypeHexWriteCode;
-extern const int s_jsBufferPrototypeHexWriteCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeHexWriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeHexWriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeHexWriteCodeImplementationVisibility;
-
-// utf8Slice
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF8SLICE 1
-extern const char* const s_jsBufferPrototypeUtf8SliceCode;
-extern const int s_jsBufferPrototypeUtf8SliceCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeUtf8SliceCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeUtf8SliceCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8SliceCodeImplementationVisibility;
-
-// ucs2Slice
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UCS2SLICE 1
-extern const char* const s_jsBufferPrototypeUcs2SliceCode;
-extern const int s_jsBufferPrototypeUcs2SliceCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeUcs2SliceCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeUcs2SliceCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2SliceCodeImplementationVisibility;
-
-// utf16leSlice
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF16LESLICE 1
-extern const char* const s_jsBufferPrototypeUtf16leSliceCode;
-extern const int s_jsBufferPrototypeUtf16leSliceCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeUtf16leSliceCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeUtf16leSliceCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leSliceCodeImplementationVisibility;
-
-// latin1Slice
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_LATIN1SLICE 1
-extern const char* const s_jsBufferPrototypeLatin1SliceCode;
-extern const int s_jsBufferPrototypeLatin1SliceCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeLatin1SliceCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeLatin1SliceCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1SliceCodeImplementationVisibility;
-
-// asciiSlice
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_ASCIISLICE 1
-extern const char* const s_jsBufferPrototypeAsciiSliceCode;
-extern const int s_jsBufferPrototypeAsciiSliceCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeAsciiSliceCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeAsciiSliceCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiSliceCodeImplementationVisibility;
-
-// base64Slice
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64SLICE 1
-extern const char* const s_jsBufferPrototypeBase64SliceCode;
-extern const int s_jsBufferPrototypeBase64SliceCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeBase64SliceCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeBase64SliceCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64SliceCodeImplementationVisibility;
-
-// base64urlSlice
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64URLSLICE 1
-extern const char* const s_jsBufferPrototypeBase64urlSliceCode;
-extern const int s_jsBufferPrototypeBase64urlSliceCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeBase64urlSliceCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeBase64urlSliceCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlSliceCodeImplementationVisibility;
-
-// hexSlice
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_HEXSLICE 1
-extern const char* const s_jsBufferPrototypeHexSliceCode;
-extern const int s_jsBufferPrototypeHexSliceCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeHexSliceCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeHexSliceCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeHexSliceCodeImplementationVisibility;
-
-// toJSON
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_TOJSON 1
-extern const char* const s_jsBufferPrototypeToJSONCode;
-extern const int s_jsBufferPrototypeToJSONCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeToJSONCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeToJSONCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeToJSONCodeImplementationVisibility;
-
-// slice
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_SLICE 1
-extern const char* const s_jsBufferPrototypeSliceCode;
-extern const int s_jsBufferPrototypeSliceCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeSliceCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeSliceCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeSliceCodeImplementationVisibility;
-
-// parent
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_PARENT 1
-extern const char* const s_jsBufferPrototypeParentCode;
-extern const int s_jsBufferPrototypeParentCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeParentCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeParentCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeParentCodeImplementationVisibility;
-
-// offset
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_OFFSET 1
-extern const char* const s_jsBufferPrototypeOffsetCode;
-extern const int s_jsBufferPrototypeOffsetCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeOffsetCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeOffsetCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeOffsetCodeImplementationVisibility;
-
-// inspect
-#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_INSPECT 1
-extern const char* const s_jsBufferPrototypeInspectCode;
-extern const int s_jsBufferPrototypeInspectCodeLength;
-extern const JSC::ConstructAbility s_jsBufferPrototypeInspectCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferPrototypeInspectCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferPrototypeInspectCodeImplementationVisibility;
+// writeUIntLE
+#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINTLE 1
+extern const char* const s_jsBufferPrototypeWriteUIntLECode;
+extern const int s_jsBufferPrototypeWriteUIntLECodeLength;
+extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntLECodeConstructAbility;
+extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntLECodeConstructorKind;
+extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntLECodeImplementationVisibility;
#define WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_DATA(macro) \
- macro(setBigUint64, jsBufferPrototypeSetBigUint64, 3) \
- macro(readInt8, jsBufferPrototypeReadInt8, 1) \
- macro(readUInt8, jsBufferPrototypeReadUInt8, 1) \
- macro(readInt16LE, jsBufferPrototypeReadInt16LE, 1) \
+ macro(asciiSlice, jsBufferPrototypeAsciiSlice, 2) \
+ macro(asciiWrite, jsBufferPrototypeAsciiWrite, 3) \
+ macro(base64Slice, jsBufferPrototypeBase64Slice, 2) \
+ macro(base64urlSlice, jsBufferPrototypeBase64urlSlice, 2) \
+ macro(base64urlWrite, jsBufferPrototypeBase64urlWrite, 3) \
+ macro(base64Write, jsBufferPrototypeBase64Write, 3) \
+ macro(hexSlice, jsBufferPrototypeHexSlice, 2) \
+ macro(hexWrite, jsBufferPrototypeHexWrite, 3) \
+ macro(inspect, jsBufferPrototypeInspect, 2) \
+ macro(latin1Slice, jsBufferPrototypeLatin1Slice, 2) \
+ macro(latin1Write, jsBufferPrototypeLatin1Write, 3) \
+ macro(offset, jsBufferPrototypeOffset, 0) \
+ macro(parent, jsBufferPrototypeParent, 0) \
+ macro(readBigInt64BE, jsBufferPrototypeReadBigInt64BE, 1) \
+ macro(readBigInt64LE, jsBufferPrototypeReadBigInt64LE, 1) \
+ macro(readBigUInt64BE, jsBufferPrototypeReadBigUInt64BE, 1) \
+ macro(readBigUInt64LE, jsBufferPrototypeReadBigUInt64LE, 1) \
+ macro(readDoubleBE, jsBufferPrototypeReadDoubleBE, 1) \
+ macro(readDoubleLE, jsBufferPrototypeReadDoubleLE, 1) \
+ macro(readFloatBE, jsBufferPrototypeReadFloatBE, 1) \
+ macro(readFloatLE, jsBufferPrototypeReadFloatLE, 1) \
macro(readInt16BE, jsBufferPrototypeReadInt16BE, 1) \
- macro(readUInt16LE, jsBufferPrototypeReadUInt16LE, 1) \
- macro(readUInt16BE, jsBufferPrototypeReadUInt16BE, 1) \
- macro(readInt32LE, jsBufferPrototypeReadInt32LE, 1) \
+ macro(readInt16LE, jsBufferPrototypeReadInt16LE, 1) \
macro(readInt32BE, jsBufferPrototypeReadInt32BE, 1) \
- macro(readUInt32LE, jsBufferPrototypeReadUInt32LE, 1) \
- macro(readUInt32BE, jsBufferPrototypeReadUInt32BE, 1) \
- macro(readIntLE, jsBufferPrototypeReadIntLE, 2) \
+ macro(readInt32LE, jsBufferPrototypeReadInt32LE, 1) \
+ macro(readInt8, jsBufferPrototypeReadInt8, 1) \
macro(readIntBE, jsBufferPrototypeReadIntBE, 2) \
- macro(readUIntLE, jsBufferPrototypeReadUIntLE, 2) \
+ macro(readIntLE, jsBufferPrototypeReadIntLE, 2) \
+ macro(readUInt16BE, jsBufferPrototypeReadUInt16BE, 1) \
+ macro(readUInt16LE, jsBufferPrototypeReadUInt16LE, 1) \
+ macro(readUInt32BE, jsBufferPrototypeReadUInt32BE, 1) \
+ macro(readUInt32LE, jsBufferPrototypeReadUInt32LE, 1) \
+ macro(readUInt8, jsBufferPrototypeReadUInt8, 1) \
macro(readUIntBE, jsBufferPrototypeReadUIntBE, 2) \
- macro(readFloatLE, jsBufferPrototypeReadFloatLE, 1) \
- macro(readFloatBE, jsBufferPrototypeReadFloatBE, 1) \
- macro(readDoubleLE, jsBufferPrototypeReadDoubleLE, 1) \
- macro(readDoubleBE, jsBufferPrototypeReadDoubleBE, 1) \
- macro(readBigInt64LE, jsBufferPrototypeReadBigInt64LE, 1) \
- macro(readBigInt64BE, jsBufferPrototypeReadBigInt64BE, 1) \
- macro(readBigUInt64LE, jsBufferPrototypeReadBigUInt64LE, 1) \
- macro(readBigUInt64BE, jsBufferPrototypeReadBigUInt64BE, 1) \
- macro(writeInt8, jsBufferPrototypeWriteInt8, 2) \
- macro(writeUInt8, jsBufferPrototypeWriteUInt8, 2) \
- macro(writeInt16LE, jsBufferPrototypeWriteInt16LE, 2) \
+ macro(readUIntLE, jsBufferPrototypeReadUIntLE, 2) \
+ macro(setBigUint64, jsBufferPrototypeSetBigUint64, 3) \
+ macro(slice, jsBufferPrototypeSlice, 2) \
+ macro(toJSON, jsBufferPrototypeToJSON, 0) \
+ macro(ucs2Slice, jsBufferPrototypeUcs2Slice, 2) \
+ macro(ucs2Write, jsBufferPrototypeUcs2Write, 3) \
+ macro(utf16leSlice, jsBufferPrototypeUtf16leSlice, 2) \
+ macro(utf16leWrite, jsBufferPrototypeUtf16leWrite, 3) \
+ macro(utf8Slice, jsBufferPrototypeUtf8Slice, 2) \
+ macro(utf8Write, jsBufferPrototypeUtf8Write, 3) \
+ macro(writeBigInt64BE, jsBufferPrototypeWriteBigInt64BE, 2) \
+ macro(writeBigInt64LE, jsBufferPrototypeWriteBigInt64LE, 2) \
+ macro(writeBigUInt64BE, jsBufferPrototypeWriteBigUInt64BE, 2) \
+ macro(writeBigUInt64LE, jsBufferPrototypeWriteBigUInt64LE, 2) \
+ macro(writeDoubleBE, jsBufferPrototypeWriteDoubleBE, 2) \
+ macro(writeDoubleLE, jsBufferPrototypeWriteDoubleLE, 2) \
+ macro(writeFloatBE, jsBufferPrototypeWriteFloatBE, 2) \
+ macro(writeFloatLE, jsBufferPrototypeWriteFloatLE, 2) \
macro(writeInt16BE, jsBufferPrototypeWriteInt16BE, 2) \
- macro(writeUInt16LE, jsBufferPrototypeWriteUInt16LE, 2) \
- macro(writeUInt16BE, jsBufferPrototypeWriteUInt16BE, 2) \
- macro(writeInt32LE, jsBufferPrototypeWriteInt32LE, 2) \
+ macro(writeInt16LE, jsBufferPrototypeWriteInt16LE, 2) \
macro(writeInt32BE, jsBufferPrototypeWriteInt32BE, 2) \
- macro(writeUInt32LE, jsBufferPrototypeWriteUInt32LE, 2) \
- macro(writeUInt32BE, jsBufferPrototypeWriteUInt32BE, 2) \
- macro(writeIntLE, jsBufferPrototypeWriteIntLE, 3) \
+ macro(writeInt32LE, jsBufferPrototypeWriteInt32LE, 2) \
+ macro(writeInt8, jsBufferPrototypeWriteInt8, 2) \
macro(writeIntBE, jsBufferPrototypeWriteIntBE, 3) \
- macro(writeUIntLE, jsBufferPrototypeWriteUIntLE, 3) \
+ macro(writeIntLE, jsBufferPrototypeWriteIntLE, 3) \
+ macro(writeUInt16BE, jsBufferPrototypeWriteUInt16BE, 2) \
+ macro(writeUInt16LE, jsBufferPrototypeWriteUInt16LE, 2) \
+ macro(writeUInt32BE, jsBufferPrototypeWriteUInt32BE, 2) \
+ macro(writeUInt32LE, jsBufferPrototypeWriteUInt32LE, 2) \
+ macro(writeUInt8, jsBufferPrototypeWriteUInt8, 2) \
macro(writeUIntBE, jsBufferPrototypeWriteUIntBE, 3) \
- macro(writeFloatLE, jsBufferPrototypeWriteFloatLE, 2) \
- macro(writeFloatBE, jsBufferPrototypeWriteFloatBE, 2) \
- macro(writeDoubleLE, jsBufferPrototypeWriteDoubleLE, 2) \
- macro(writeDoubleBE, jsBufferPrototypeWriteDoubleBE, 2) \
- macro(writeBigInt64LE, jsBufferPrototypeWriteBigInt64LE, 2) \
- macro(writeBigInt64BE, jsBufferPrototypeWriteBigInt64BE, 2) \
- macro(writeBigUInt64LE, jsBufferPrototypeWriteBigUInt64LE, 2) \
- macro(writeBigUInt64BE, jsBufferPrototypeWriteBigUInt64BE, 2) \
- macro(utf8Write, jsBufferPrototypeUtf8Write, 3) \
- macro(ucs2Write, jsBufferPrototypeUcs2Write, 3) \
- macro(utf16leWrite, jsBufferPrototypeUtf16leWrite, 3) \
- macro(latin1Write, jsBufferPrototypeLatin1Write, 3) \
- macro(asciiWrite, jsBufferPrototypeAsciiWrite, 3) \
- macro(base64Write, jsBufferPrototypeBase64Write, 3) \
- macro(base64urlWrite, jsBufferPrototypeBase64urlWrite, 3) \
- macro(hexWrite, jsBufferPrototypeHexWrite, 3) \
- macro(utf8Slice, jsBufferPrototypeUtf8Slice, 2) \
- macro(ucs2Slice, jsBufferPrototypeUcs2Slice, 2) \
- macro(utf16leSlice, jsBufferPrototypeUtf16leSlice, 2) \
- macro(latin1Slice, jsBufferPrototypeLatin1Slice, 2) \
- macro(asciiSlice, jsBufferPrototypeAsciiSlice, 2) \
- macro(base64Slice, jsBufferPrototypeBase64Slice, 2) \
- macro(base64urlSlice, jsBufferPrototypeBase64urlSlice, 2) \
- macro(hexSlice, jsBufferPrototypeHexSlice, 2) \
- macro(toJSON, jsBufferPrototypeToJSON, 0) \
- macro(slice, jsBufferPrototypeSlice, 2) \
- macro(parent, jsBufferPrototypeParent, 0) \
- macro(offset, jsBufferPrototypeOffset, 0) \
- macro(inspect, jsBufferPrototypeInspect, 2) \
+ macro(writeUIntLE, jsBufferPrototypeWriteUIntLE, 3) \
#define WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(macro) \
- macro(jsBufferPrototypeSetBigUint64Code, setBigUint64, ASCIILiteral(), s_jsBufferPrototypeSetBigUint64CodeLength) \
- macro(jsBufferPrototypeReadInt8Code, readInt8, ASCIILiteral(), s_jsBufferPrototypeReadInt8CodeLength) \
- macro(jsBufferPrototypeReadUInt8Code, readUInt8, ASCIILiteral(), s_jsBufferPrototypeReadUInt8CodeLength) \
- macro(jsBufferPrototypeReadInt16LECode, readInt16LE, ASCIILiteral(), s_jsBufferPrototypeReadInt16LECodeLength) \
+ macro(jsBufferPrototypeAsciiSliceCode, asciiSlice, ASCIILiteral(), s_jsBufferPrototypeAsciiSliceCodeLength) \
+ macro(jsBufferPrototypeAsciiWriteCode, asciiWrite, ASCIILiteral(), s_jsBufferPrototypeAsciiWriteCodeLength) \
+ macro(jsBufferPrototypeBase64SliceCode, base64Slice, ASCIILiteral(), s_jsBufferPrototypeBase64SliceCodeLength) \
+ macro(jsBufferPrototypeBase64urlSliceCode, base64urlSlice, ASCIILiteral(), s_jsBufferPrototypeBase64urlSliceCodeLength) \
+ macro(jsBufferPrototypeBase64urlWriteCode, base64urlWrite, ASCIILiteral(), s_jsBufferPrototypeBase64urlWriteCodeLength) \
+ macro(jsBufferPrototypeBase64WriteCode, base64Write, ASCIILiteral(), s_jsBufferPrototypeBase64WriteCodeLength) \
+ macro(jsBufferPrototypeHexSliceCode, hexSlice, ASCIILiteral(), s_jsBufferPrototypeHexSliceCodeLength) \
+ macro(jsBufferPrototypeHexWriteCode, hexWrite, ASCIILiteral(), s_jsBufferPrototypeHexWriteCodeLength) \
+ macro(jsBufferPrototypeInspectCode, inspect, ASCIILiteral(), s_jsBufferPrototypeInspectCodeLength) \
+ macro(jsBufferPrototypeLatin1SliceCode, latin1Slice, ASCIILiteral(), s_jsBufferPrototypeLatin1SliceCodeLength) \
+ macro(jsBufferPrototypeLatin1WriteCode, latin1Write, ASCIILiteral(), s_jsBufferPrototypeLatin1WriteCodeLength) \
+ macro(jsBufferPrototypeOffsetCode, offset, "get offset"_s, s_jsBufferPrototypeOffsetCodeLength) \
+ macro(jsBufferPrototypeParentCode, parent, "get parent"_s, s_jsBufferPrototypeParentCodeLength) \
+ macro(jsBufferPrototypeReadBigInt64BECode, readBigInt64BE, ASCIILiteral(), s_jsBufferPrototypeReadBigInt64BECodeLength) \
+ macro(jsBufferPrototypeReadBigInt64LECode, readBigInt64LE, ASCIILiteral(), s_jsBufferPrototypeReadBigInt64LECodeLength) \
+ macro(jsBufferPrototypeReadBigUInt64BECode, readBigUInt64BE, ASCIILiteral(), s_jsBufferPrototypeReadBigUInt64BECodeLength) \
+ macro(jsBufferPrototypeReadBigUInt64LECode, readBigUInt64LE, ASCIILiteral(), s_jsBufferPrototypeReadBigUInt64LECodeLength) \
+ macro(jsBufferPrototypeReadDoubleBECode, readDoubleBE, ASCIILiteral(), s_jsBufferPrototypeReadDoubleBECodeLength) \
+ macro(jsBufferPrototypeReadDoubleLECode, readDoubleLE, ASCIILiteral(), s_jsBufferPrototypeReadDoubleLECodeLength) \
+ macro(jsBufferPrototypeReadFloatBECode, readFloatBE, ASCIILiteral(), s_jsBufferPrototypeReadFloatBECodeLength) \
+ macro(jsBufferPrototypeReadFloatLECode, readFloatLE, ASCIILiteral(), s_jsBufferPrototypeReadFloatLECodeLength) \
macro(jsBufferPrototypeReadInt16BECode, readInt16BE, ASCIILiteral(), s_jsBufferPrototypeReadInt16BECodeLength) \
- macro(jsBufferPrototypeReadUInt16LECode, readUInt16LE, ASCIILiteral(), s_jsBufferPrototypeReadUInt16LECodeLength) \
- macro(jsBufferPrototypeReadUInt16BECode, readUInt16BE, ASCIILiteral(), s_jsBufferPrototypeReadUInt16BECodeLength) \
- macro(jsBufferPrototypeReadInt32LECode, readInt32LE, ASCIILiteral(), s_jsBufferPrototypeReadInt32LECodeLength) \
+ macro(jsBufferPrototypeReadInt16LECode, readInt16LE, ASCIILiteral(), s_jsBufferPrototypeReadInt16LECodeLength) \
macro(jsBufferPrototypeReadInt32BECode, readInt32BE, ASCIILiteral(), s_jsBufferPrototypeReadInt32BECodeLength) \
- macro(jsBufferPrototypeReadUInt32LECode, readUInt32LE, ASCIILiteral(), s_jsBufferPrototypeReadUInt32LECodeLength) \
- macro(jsBufferPrototypeReadUInt32BECode, readUInt32BE, ASCIILiteral(), s_jsBufferPrototypeReadUInt32BECodeLength) \
- macro(jsBufferPrototypeReadIntLECode, readIntLE, ASCIILiteral(), s_jsBufferPrototypeReadIntLECodeLength) \
+ macro(jsBufferPrototypeReadInt32LECode, readInt32LE, ASCIILiteral(), s_jsBufferPrototypeReadInt32LECodeLength) \
+ macro(jsBufferPrototypeReadInt8Code, readInt8, ASCIILiteral(), s_jsBufferPrototypeReadInt8CodeLength) \
macro(jsBufferPrototypeReadIntBECode, readIntBE, ASCIILiteral(), s_jsBufferPrototypeReadIntBECodeLength) \
- macro(jsBufferPrototypeReadUIntLECode, readUIntLE, ASCIILiteral(), s_jsBufferPrototypeReadUIntLECodeLength) \
+ macro(jsBufferPrototypeReadIntLECode, readIntLE, ASCIILiteral(), s_jsBufferPrototypeReadIntLECodeLength) \
+ macro(jsBufferPrototypeReadUInt16BECode, readUInt16BE, ASCIILiteral(), s_jsBufferPrototypeReadUInt16BECodeLength) \
+ macro(jsBufferPrototypeReadUInt16LECode, readUInt16LE, ASCIILiteral(), s_jsBufferPrototypeReadUInt16LECodeLength) \
+ macro(jsBufferPrototypeReadUInt32BECode, readUInt32BE, ASCIILiteral(), s_jsBufferPrototypeReadUInt32BECodeLength) \
+ macro(jsBufferPrototypeReadUInt32LECode, readUInt32LE, ASCIILiteral(), s_jsBufferPrototypeReadUInt32LECodeLength) \
+ macro(jsBufferPrototypeReadUInt8Code, readUInt8, ASCIILiteral(), s_jsBufferPrototypeReadUInt8CodeLength) \
macro(jsBufferPrototypeReadUIntBECode, readUIntBE, ASCIILiteral(), s_jsBufferPrototypeReadUIntBECodeLength) \
- macro(jsBufferPrototypeReadFloatLECode, readFloatLE, ASCIILiteral(), s_jsBufferPrototypeReadFloatLECodeLength) \
- macro(jsBufferPrototypeReadFloatBECode, readFloatBE, ASCIILiteral(), s_jsBufferPrototypeReadFloatBECodeLength) \
- macro(jsBufferPrototypeReadDoubleLECode, readDoubleLE, ASCIILiteral(), s_jsBufferPrototypeReadDoubleLECodeLength) \
- macro(jsBufferPrototypeReadDoubleBECode, readDoubleBE, ASCIILiteral(), s_jsBufferPrototypeReadDoubleBECodeLength) \
- macro(jsBufferPrototypeReadBigInt64LECode, readBigInt64LE, ASCIILiteral(), s_jsBufferPrototypeReadBigInt64LECodeLength) \
- macro(jsBufferPrototypeReadBigInt64BECode, readBigInt64BE, ASCIILiteral(), s_jsBufferPrototypeReadBigInt64BECodeLength) \
- macro(jsBufferPrototypeReadBigUInt64LECode, readBigUInt64LE, ASCIILiteral(), s_jsBufferPrototypeReadBigUInt64LECodeLength) \
- macro(jsBufferPrototypeReadBigUInt64BECode, readBigUInt64BE, ASCIILiteral(), s_jsBufferPrototypeReadBigUInt64BECodeLength) \
- macro(jsBufferPrototypeWriteInt8Code, writeInt8, ASCIILiteral(), s_jsBufferPrototypeWriteInt8CodeLength) \
- macro(jsBufferPrototypeWriteUInt8Code, writeUInt8, ASCIILiteral(), s_jsBufferPrototypeWriteUInt8CodeLength) \
- macro(jsBufferPrototypeWriteInt16LECode, writeInt16LE, ASCIILiteral(), s_jsBufferPrototypeWriteInt16LECodeLength) \
+ macro(jsBufferPrototypeReadUIntLECode, readUIntLE, ASCIILiteral(), s_jsBufferPrototypeReadUIntLECodeLength) \
+ macro(jsBufferPrototypeSetBigUint64Code, setBigUint64, ASCIILiteral(), s_jsBufferPrototypeSetBigUint64CodeLength) \
+ macro(jsBufferPrototypeSliceCode, slice, ASCIILiteral(), s_jsBufferPrototypeSliceCodeLength) \
+ macro(jsBufferPrototypeToJSONCode, toJSON, ASCIILiteral(), s_jsBufferPrototypeToJSONCodeLength) \
+ macro(jsBufferPrototypeUcs2SliceCode, ucs2Slice, ASCIILiteral(), s_jsBufferPrototypeUcs2SliceCodeLength) \
+ macro(jsBufferPrototypeUcs2WriteCode, ucs2Write, ASCIILiteral(), s_jsBufferPrototypeUcs2WriteCodeLength) \
+ macro(jsBufferPrototypeUtf16leSliceCode, utf16leSlice, ASCIILiteral(), s_jsBufferPrototypeUtf16leSliceCodeLength) \
+ macro(jsBufferPrototypeUtf16leWriteCode, utf16leWrite, ASCIILiteral(), s_jsBufferPrototypeUtf16leWriteCodeLength) \
+ macro(jsBufferPrototypeUtf8SliceCode, utf8Slice, ASCIILiteral(), s_jsBufferPrototypeUtf8SliceCodeLength) \
+ macro(jsBufferPrototypeUtf8WriteCode, utf8Write, ASCIILiteral(), s_jsBufferPrototypeUtf8WriteCodeLength) \
+ macro(jsBufferPrototypeWriteBigInt64BECode, writeBigInt64BE, ASCIILiteral(), s_jsBufferPrototypeWriteBigInt64BECodeLength) \
+ macro(jsBufferPrototypeWriteBigInt64LECode, writeBigInt64LE, ASCIILiteral(), s_jsBufferPrototypeWriteBigInt64LECodeLength) \
+ macro(jsBufferPrototypeWriteBigUInt64BECode, writeBigUInt64BE, ASCIILiteral(), s_jsBufferPrototypeWriteBigUInt64BECodeLength) \
+ macro(jsBufferPrototypeWriteBigUInt64LECode, writeBigUInt64LE, ASCIILiteral(), s_jsBufferPrototypeWriteBigUInt64LECodeLength) \
+ macro(jsBufferPrototypeWriteDoubleBECode, writeDoubleBE, ASCIILiteral(), s_jsBufferPrototypeWriteDoubleBECodeLength) \
+ macro(jsBufferPrototypeWriteDoubleLECode, writeDoubleLE, ASCIILiteral(), s_jsBufferPrototypeWriteDoubleLECodeLength) \
+ macro(jsBufferPrototypeWriteFloatBECode, writeFloatBE, ASCIILiteral(), s_jsBufferPrototypeWriteFloatBECodeLength) \
+ macro(jsBufferPrototypeWriteFloatLECode, writeFloatLE, ASCIILiteral(), s_jsBufferPrototypeWriteFloatLECodeLength) \
macro(jsBufferPrototypeWriteInt16BECode, writeInt16BE, ASCIILiteral(), s_jsBufferPrototypeWriteInt16BECodeLength) \
- macro(jsBufferPrototypeWriteUInt16LECode, writeUInt16LE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt16LECodeLength) \
- macro(jsBufferPrototypeWriteUInt16BECode, writeUInt16BE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt16BECodeLength) \
- macro(jsBufferPrototypeWriteInt32LECode, writeInt32LE, ASCIILiteral(), s_jsBufferPrototypeWriteInt32LECodeLength) \
+ macro(jsBufferPrototypeWriteInt16LECode, writeInt16LE, ASCIILiteral(), s_jsBufferPrototypeWriteInt16LECodeLength) \
macro(jsBufferPrototypeWriteInt32BECode, writeInt32BE, ASCIILiteral(), s_jsBufferPrototypeWriteInt32BECodeLength) \
- macro(jsBufferPrototypeWriteUInt32LECode, writeUInt32LE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt32LECodeLength) \
- macro(jsBufferPrototypeWriteUInt32BECode, writeUInt32BE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt32BECodeLength) \
- macro(jsBufferPrototypeWriteIntLECode, writeIntLE, ASCIILiteral(), s_jsBufferPrototypeWriteIntLECodeLength) \
+ macro(jsBufferPrototypeWriteInt32LECode, writeInt32LE, ASCIILiteral(), s_jsBufferPrototypeWriteInt32LECodeLength) \
+ macro(jsBufferPrototypeWriteInt8Code, writeInt8, ASCIILiteral(), s_jsBufferPrototypeWriteInt8CodeLength) \
macro(jsBufferPrototypeWriteIntBECode, writeIntBE, ASCIILiteral(), s_jsBufferPrototypeWriteIntBECodeLength) \
- macro(jsBufferPrototypeWriteUIntLECode, writeUIntLE, ASCIILiteral(), s_jsBufferPrototypeWriteUIntLECodeLength) \
+ macro(jsBufferPrototypeWriteIntLECode, writeIntLE, ASCIILiteral(), s_jsBufferPrototypeWriteIntLECodeLength) \
+ macro(jsBufferPrototypeWriteUInt16BECode, writeUInt16BE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt16BECodeLength) \
+ macro(jsBufferPrototypeWriteUInt16LECode, writeUInt16LE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt16LECodeLength) \
+ macro(jsBufferPrototypeWriteUInt32BECode, writeUInt32BE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt32BECodeLength) \
+ macro(jsBufferPrototypeWriteUInt32LECode, writeUInt32LE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt32LECodeLength) \
+ macro(jsBufferPrototypeWriteUInt8Code, writeUInt8, ASCIILiteral(), s_jsBufferPrototypeWriteUInt8CodeLength) \
macro(jsBufferPrototypeWriteUIntBECode, writeUIntBE, ASCIILiteral(), s_jsBufferPrototypeWriteUIntBECodeLength) \
- macro(jsBufferPrototypeWriteFloatLECode, writeFloatLE, ASCIILiteral(), s_jsBufferPrototypeWriteFloatLECodeLength) \
- macro(jsBufferPrototypeWriteFloatBECode, writeFloatBE, ASCIILiteral(), s_jsBufferPrototypeWriteFloatBECodeLength) \
- macro(jsBufferPrototypeWriteDoubleLECode, writeDoubleLE, ASCIILiteral(), s_jsBufferPrototypeWriteDoubleLECodeLength) \
- macro(jsBufferPrototypeWriteDoubleBECode, writeDoubleBE, ASCIILiteral(), s_jsBufferPrototypeWriteDoubleBECodeLength) \
- macro(jsBufferPrototypeWriteBigInt64LECode, writeBigInt64LE, ASCIILiteral(), s_jsBufferPrototypeWriteBigInt64LECodeLength) \
- macro(jsBufferPrototypeWriteBigInt64BECode, writeBigInt64BE, ASCIILiteral(), s_jsBufferPrototypeWriteBigInt64BECodeLength) \
- macro(jsBufferPrototypeWriteBigUInt64LECode, writeBigUInt64LE, ASCIILiteral(), s_jsBufferPrototypeWriteBigUInt64LECodeLength) \
- macro(jsBufferPrototypeWriteBigUInt64BECode, writeBigUInt64BE, ASCIILiteral(), s_jsBufferPrototypeWriteBigUInt64BECodeLength) \
- macro(jsBufferPrototypeUtf8WriteCode, utf8Write, ASCIILiteral(), s_jsBufferPrototypeUtf8WriteCodeLength) \
- macro(jsBufferPrototypeUcs2WriteCode, ucs2Write, ASCIILiteral(), s_jsBufferPrototypeUcs2WriteCodeLength) \
- macro(jsBufferPrototypeUtf16leWriteCode, utf16leWrite, ASCIILiteral(), s_jsBufferPrototypeUtf16leWriteCodeLength) \
- macro(jsBufferPrototypeLatin1WriteCode, latin1Write, ASCIILiteral(), s_jsBufferPrototypeLatin1WriteCodeLength) \
- macro(jsBufferPrototypeAsciiWriteCode, asciiWrite, ASCIILiteral(), s_jsBufferPrototypeAsciiWriteCodeLength) \
- macro(jsBufferPrototypeBase64WriteCode, base64Write, ASCIILiteral(), s_jsBufferPrototypeBase64WriteCodeLength) \
- macro(jsBufferPrototypeBase64urlWriteCode, base64urlWrite, ASCIILiteral(), s_jsBufferPrototypeBase64urlWriteCodeLength) \
- macro(jsBufferPrototypeHexWriteCode, hexWrite, ASCIILiteral(), s_jsBufferPrototypeHexWriteCodeLength) \
- macro(jsBufferPrototypeUtf8SliceCode, utf8Slice, ASCIILiteral(), s_jsBufferPrototypeUtf8SliceCodeLength) \
- macro(jsBufferPrototypeUcs2SliceCode, ucs2Slice, ASCIILiteral(), s_jsBufferPrototypeUcs2SliceCodeLength) \
- macro(jsBufferPrototypeUtf16leSliceCode, utf16leSlice, ASCIILiteral(), s_jsBufferPrototypeUtf16leSliceCodeLength) \
- macro(jsBufferPrototypeLatin1SliceCode, latin1Slice, ASCIILiteral(), s_jsBufferPrototypeLatin1SliceCodeLength) \
- macro(jsBufferPrototypeAsciiSliceCode, asciiSlice, ASCIILiteral(), s_jsBufferPrototypeAsciiSliceCodeLength) \
- macro(jsBufferPrototypeBase64SliceCode, base64Slice, ASCIILiteral(), s_jsBufferPrototypeBase64SliceCodeLength) \
- macro(jsBufferPrototypeBase64urlSliceCode, base64urlSlice, ASCIILiteral(), s_jsBufferPrototypeBase64urlSliceCodeLength) \
- macro(jsBufferPrototypeHexSliceCode, hexSlice, ASCIILiteral(), s_jsBufferPrototypeHexSliceCodeLength) \
- macro(jsBufferPrototypeToJSONCode, toJSON, ASCIILiteral(), s_jsBufferPrototypeToJSONCodeLength) \
- macro(jsBufferPrototypeSliceCode, slice, ASCIILiteral(), s_jsBufferPrototypeSliceCodeLength) \
- macro(jsBufferPrototypeParentCode, parent, "get parent"_s, s_jsBufferPrototypeParentCodeLength) \
- macro(jsBufferPrototypeOffsetCode, offset, "get offset"_s, s_jsBufferPrototypeOffsetCodeLength) \
- macro(jsBufferPrototypeInspectCode, inspect, ASCIILiteral(), s_jsBufferPrototypeInspectCodeLength) \
+ macro(jsBufferPrototypeWriteUIntLECode, writeUIntLE, ASCIILiteral(), s_jsBufferPrototypeWriteUIntLECodeLength) \
#define WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_FUNCTION_NAME(macro) \
- macro(setBigUint64) \
- macro(readInt8) \
- macro(readUInt8) \
- macro(readInt16LE) \
+ macro(asciiSlice) \
+ macro(asciiWrite) \
+ macro(base64Slice) \
+ macro(base64urlSlice) \
+ macro(base64urlWrite) \
+ macro(base64Write) \
+ macro(hexSlice) \
+ macro(hexWrite) \
+ macro(inspect) \
+ macro(latin1Slice) \
+ macro(latin1Write) \
+ macro(offset) \
+ macro(parent) \
+ macro(readBigInt64BE) \
+ macro(readBigInt64LE) \
+ macro(readBigUInt64BE) \
+ macro(readBigUInt64LE) \
+ macro(readDoubleBE) \
+ macro(readDoubleLE) \
+ macro(readFloatBE) \
+ macro(readFloatLE) \
macro(readInt16BE) \
- macro(readUInt16LE) \
- macro(readUInt16BE) \
- macro(readInt32LE) \
+ macro(readInt16LE) \
macro(readInt32BE) \
- macro(readUInt32LE) \
- macro(readUInt32BE) \
- macro(readIntLE) \
+ macro(readInt32LE) \
+ macro(readInt8) \
macro(readIntBE) \
- macro(readUIntLE) \
+ macro(readIntLE) \
+ macro(readUInt16BE) \
+ macro(readUInt16LE) \
+ macro(readUInt32BE) \
+ macro(readUInt32LE) \
+ macro(readUInt8) \
macro(readUIntBE) \
- macro(readFloatLE) \
- macro(readFloatBE) \
- macro(readDoubleLE) \
- macro(readDoubleBE) \
- macro(readBigInt64LE) \
- macro(readBigInt64BE) \
- macro(readBigUInt64LE) \
- macro(readBigUInt64BE) \
- macro(writeInt8) \
- macro(writeUInt8) \
- macro(writeInt16LE) \
+ macro(readUIntLE) \
+ macro(setBigUint64) \
+ macro(slice) \
+ macro(toJSON) \
+ macro(ucs2Slice) \
+ macro(ucs2Write) \
+ macro(utf16leSlice) \
+ macro(utf16leWrite) \
+ macro(utf8Slice) \
+ macro(utf8Write) \
+ macro(writeBigInt64BE) \
+ macro(writeBigInt64LE) \
+ macro(writeBigUInt64BE) \
+ macro(writeBigUInt64LE) \
+ macro(writeDoubleBE) \
+ macro(writeDoubleLE) \
+ macro(writeFloatBE) \
+ macro(writeFloatLE) \
macro(writeInt16BE) \
- macro(writeUInt16LE) \
- macro(writeUInt16BE) \
- macro(writeInt32LE) \
+ macro(writeInt16LE) \
macro(writeInt32BE) \
- macro(writeUInt32LE) \
- macro(writeUInt32BE) \
- macro(writeIntLE) \
+ macro(writeInt32LE) \
+ macro(writeInt8) \
macro(writeIntBE) \
- macro(writeUIntLE) \
+ macro(writeIntLE) \
+ macro(writeUInt16BE) \
+ macro(writeUInt16LE) \
+ macro(writeUInt32BE) \
+ macro(writeUInt32LE) \
+ macro(writeUInt8) \
macro(writeUIntBE) \
- macro(writeFloatLE) \
- macro(writeFloatBE) \
- macro(writeDoubleLE) \
- macro(writeDoubleBE) \
- macro(writeBigInt64LE) \
- macro(writeBigInt64BE) \
- macro(writeBigUInt64LE) \
- macro(writeBigUInt64BE) \
- macro(utf8Write) \
- macro(ucs2Write) \
- macro(utf16leWrite) \
- macro(latin1Write) \
- macro(asciiWrite) \
- macro(base64Write) \
- macro(base64urlWrite) \
- macro(hexWrite) \
- macro(utf8Slice) \
- macro(ucs2Slice) \
- macro(utf16leSlice) \
- macro(latin1Slice) \
- macro(asciiSlice) \
- macro(base64Slice) \
- macro(base64urlSlice) \
- macro(hexSlice) \
- macro(toJSON) \
- macro(slice) \
- macro(parent) \
- macro(offset) \
- macro(inspect) \
+ macro(writeUIntLE) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
@@ -2220,7 +1448,7 @@ public:
explicit JSBufferPrototypeBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
@@ -2269,92 +1497,81 @@ inline void JSBufferPrototypeBuiltinsWrapper::exportNames()
WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* ReadableByteStreamController.ts */
-// initializeReadableByteStreamController
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_INITIALIZEREADABLEBYTESTREAMCONTROLLER 1
-extern const char* const s_readableByteStreamControllerInitializeReadableByteStreamControllerCode;
-extern const int s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeImplementationVisibility;
-
-// enqueue
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_ENQUEUE 1
-extern const char* const s_readableByteStreamControllerEnqueueCode;
-extern const int s_readableByteStreamControllerEnqueueCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamControllerEnqueueCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamControllerEnqueueCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamControllerEnqueueCodeImplementationVisibility;
+/* Module.ts */
+// main
+#define WEBCORE_BUILTIN_MODULE_MAIN 1
+extern const char* const s_moduleMainCode;
+extern const int s_moduleMainCodeLength;
+extern const JSC::ConstructAbility s_moduleMainCodeConstructAbility;
+extern const JSC::ConstructorKind s_moduleMainCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_moduleMainCodeImplementationVisibility;
-// error
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_ERROR 1
-extern const char* const s_readableByteStreamControllerErrorCode;
-extern const int s_readableByteStreamControllerErrorCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamControllerErrorCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamControllerErrorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamControllerErrorCodeImplementationVisibility;
+// overridableRequire
+#define WEBCORE_BUILTIN_MODULE_OVERRIDABLEREQUIRE 1
+extern const char* const s_moduleOverridableRequireCode;
+extern const int s_moduleOverridableRequireCodeLength;
+extern const JSC::ConstructAbility s_moduleOverridableRequireCodeConstructAbility;
+extern const JSC::ConstructorKind s_moduleOverridableRequireCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_moduleOverridableRequireCodeImplementationVisibility;
-// close
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_CLOSE 1
-extern const char* const s_readableByteStreamControllerCloseCode;
-extern const int s_readableByteStreamControllerCloseCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamControllerCloseCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamControllerCloseCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamControllerCloseCodeImplementationVisibility;
+// require
+#define WEBCORE_BUILTIN_MODULE_REQUIRE 1
+extern const char* const s_moduleRequireCode;
+extern const int s_moduleRequireCodeLength;
+extern const JSC::ConstructAbility s_moduleRequireCodeConstructAbility;
+extern const JSC::ConstructorKind s_moduleRequireCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_moduleRequireCodeImplementationVisibility;
-// byobRequest
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_BYOBREQUEST 1
-extern const char* const s_readableByteStreamControllerByobRequestCode;
-extern const int s_readableByteStreamControllerByobRequestCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamControllerByobRequestCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamControllerByobRequestCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamControllerByobRequestCodeImplementationVisibility;
+// requireNativeModule
+#define WEBCORE_BUILTIN_MODULE_REQUIRENATIVEMODULE 1
+extern const char* const s_moduleRequireNativeModuleCode;
+extern const int s_moduleRequireNativeModuleCodeLength;
+extern const JSC::ConstructAbility s_moduleRequireNativeModuleCodeConstructAbility;
+extern const JSC::ConstructorKind s_moduleRequireNativeModuleCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_moduleRequireNativeModuleCodeImplementationVisibility;
-// desiredSize
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_DESIREDSIZE 1
-extern const char* const s_readableByteStreamControllerDesiredSizeCode;
-extern const int s_readableByteStreamControllerDesiredSizeCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamControllerDesiredSizeCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamControllerDesiredSizeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamControllerDesiredSizeCodeImplementationVisibility;
+// requireResolve
+#define WEBCORE_BUILTIN_MODULE_REQUIRERESOLVE 1
+extern const char* const s_moduleRequireResolveCode;
+extern const int s_moduleRequireResolveCodeLength;
+extern const JSC::ConstructAbility s_moduleRequireResolveCodeConstructAbility;
+extern const JSC::ConstructorKind s_moduleRequireResolveCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_moduleRequireResolveCodeImplementationVisibility;
-#define WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_DATA(macro) \
- macro(initializeReadableByteStreamController, readableByteStreamControllerInitializeReadableByteStreamController, 3) \
- macro(enqueue, readableByteStreamControllerEnqueue, 1) \
- macro(error, readableByteStreamControllerError, 1) \
- macro(close, readableByteStreamControllerClose, 0) \
- macro(byobRequest, readableByteStreamControllerByobRequest, 0) \
- macro(desiredSize, readableByteStreamControllerDesiredSize, 0) \
+#define WEBCORE_FOREACH_MODULE_BUILTIN_DATA(macro) \
+ macro(main, moduleMain, 0) \
+ macro(overridableRequire, moduleOverridableRequire, 1) \
+ macro(require, moduleRequire, 1) \
+ macro(requireNativeModule, moduleRequireNativeModule, 1) \
+ macro(requireResolve, moduleRequireResolve, 1) \
-#define WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(macro) \
- macro(readableByteStreamControllerInitializeReadableByteStreamControllerCode, initializeReadableByteStreamController, ASCIILiteral(), s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeLength) \
- macro(readableByteStreamControllerEnqueueCode, enqueue, ASCIILiteral(), s_readableByteStreamControllerEnqueueCodeLength) \
- macro(readableByteStreamControllerErrorCode, error, ASCIILiteral(), s_readableByteStreamControllerErrorCodeLength) \
- macro(readableByteStreamControllerCloseCode, close, ASCIILiteral(), s_readableByteStreamControllerCloseCodeLength) \
- macro(readableByteStreamControllerByobRequestCode, byobRequest, "get byobRequest"_s, s_readableByteStreamControllerByobRequestCodeLength) \
- macro(readableByteStreamControllerDesiredSizeCode, desiredSize, "get desiredSize"_s, s_readableByteStreamControllerDesiredSizeCodeLength) \
+#define WEBCORE_FOREACH_MODULE_BUILTIN_CODE(macro) \
+ macro(moduleMainCode, main, "get main"_s, s_moduleMainCodeLength) \
+ macro(moduleOverridableRequireCode, overridableRequire, ASCIILiteral(), s_moduleOverridableRequireCodeLength) \
+ macro(moduleRequireCode, require, ASCIILiteral(), s_moduleRequireCodeLength) \
+ macro(moduleRequireNativeModuleCode, requireNativeModule, ASCIILiteral(), s_moduleRequireNativeModuleCodeLength) \
+ macro(moduleRequireResolveCode, requireResolve, ASCIILiteral(), s_moduleRequireResolveCodeLength) \
-#define WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(macro) \
- macro(initializeReadableByteStreamController) \
- macro(enqueue) \
- macro(error) \
- macro(close) \
- macro(byobRequest) \
- macro(desiredSize) \
+#define WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(macro) \
+ macro(main) \
+ macro(overridableRequire) \
+ macro(require) \
+ macro(requireNativeModule) \
+ macro(requireResolve) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class ReadableByteStreamControllerBuiltinsWrapper : private JSC::WeakHandleOwner {
+class ModuleBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit ReadableByteStreamControllerBuiltinsWrapper(JSC::VM& vm)
+ explicit ModuleBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_MODULE_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -2362,28 +1579,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_MODULE_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* ReadableByteStreamControllerBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* ModuleBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -2393,57 +1610,79 @@ inline JSC::UnlinkedFunctionExecutable* ReadableByteStreamControllerBuiltinsWrap
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void ReadableByteStreamControllerBuiltinsWrapper::exportNames()
+inline void ModuleBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* UtilInspect.ts */
-// getStylizeWithColor
-#define WEBCORE_BUILTIN_UTILINSPECT_GETSTYLIZEWITHCOLOR 1
-extern const char* const s_utilInspectGetStylizeWithColorCode;
-extern const int s_utilInspectGetStylizeWithColorCodeLength;
-extern const JSC::ConstructAbility s_utilInspectGetStylizeWithColorCodeConstructAbility;
-extern const JSC::ConstructorKind s_utilInspectGetStylizeWithColorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_utilInspectGetStylizeWithColorCodeImplementationVisibility;
+/* ProcessObjectInternals.ts */
+// getStdinStream
+#define WEBCORE_BUILTIN_PROCESSOBJECTINTERNALS_GETSTDINSTREAM 1
+extern const char* const s_processObjectInternalsGetStdinStreamCode;
+extern const int s_processObjectInternalsGetStdinStreamCodeLength;
+extern const JSC::ConstructAbility s_processObjectInternalsGetStdinStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_processObjectInternalsGetStdinStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_processObjectInternalsGetStdinStreamCodeImplementationVisibility;
-// stylizeWithNoColor
-#define WEBCORE_BUILTIN_UTILINSPECT_STYLIZEWITHNOCOLOR 1
-extern const char* const s_utilInspectStylizeWithNoColorCode;
-extern const int s_utilInspectStylizeWithNoColorCodeLength;
-extern const JSC::ConstructAbility s_utilInspectStylizeWithNoColorCodeConstructAbility;
-extern const JSC::ConstructorKind s_utilInspectStylizeWithNoColorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_utilInspectStylizeWithNoColorCodeImplementationVisibility;
+// getStdioWriteStream
+#define WEBCORE_BUILTIN_PROCESSOBJECTINTERNALS_GETSTDIOWRITESTREAM 1
+extern const char* const s_processObjectInternalsGetStdioWriteStreamCode;
+extern const int s_processObjectInternalsGetStdioWriteStreamCodeLength;
+extern const JSC::ConstructAbility s_processObjectInternalsGetStdioWriteStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_processObjectInternalsGetStdioWriteStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_processObjectInternalsGetStdioWriteStreamCodeImplementationVisibility;
-#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_DATA(macro) \
- macro(getStylizeWithColor, utilInspectGetStylizeWithColor, 1) \
- macro(stylizeWithNoColor, utilInspectStylizeWithNoColor, 1) \
+// initializeNextTickQueue
+#define WEBCORE_BUILTIN_PROCESSOBJECTINTERNALS_INITIALIZENEXTTICKQUEUE 1
+extern const char* const s_processObjectInternalsInitializeNextTickQueueCode;
+extern const int s_processObjectInternalsInitializeNextTickQueueCodeLength;
+extern const JSC::ConstructAbility s_processObjectInternalsInitializeNextTickQueueCodeConstructAbility;
+extern const JSC::ConstructorKind s_processObjectInternalsInitializeNextTickQueueCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_processObjectInternalsInitializeNextTickQueueCodeImplementationVisibility;
-#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(macro) \
- macro(utilInspectGetStylizeWithColorCode, getStylizeWithColor, ASCIILiteral(), s_utilInspectGetStylizeWithColorCodeLength) \
- macro(utilInspectStylizeWithNoColorCode, stylizeWithNoColor, ASCIILiteral(), s_utilInspectStylizeWithNoColorCodeLength) \
+// mainModule
+#define WEBCORE_BUILTIN_PROCESSOBJECTINTERNALS_MAINMODULE 1
+extern const char* const s_processObjectInternalsMainModuleCode;
+extern const int s_processObjectInternalsMainModuleCodeLength;
+extern const JSC::ConstructAbility s_processObjectInternalsMainModuleCodeConstructAbility;
+extern const JSC::ConstructorKind s_processObjectInternalsMainModuleCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_processObjectInternalsMainModuleCodeImplementationVisibility;
-#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(macro) \
- macro(getStylizeWithColor) \
- macro(stylizeWithNoColor) \
+#define WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_DATA(macro) \
+ macro(getStdinStream, processObjectInternalsGetStdinStream, 1) \
+ macro(getStdioWriteStream, processObjectInternalsGetStdioWriteStream, 1) \
+ macro(initializeNextTickQueue, processObjectInternalsInitializeNextTickQueue, 4) \
+ macro(mainModule, processObjectInternalsMainModule, 0) \
+
+#define WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(macro) \
+ macro(processObjectInternalsGetStdinStreamCode, getStdinStream, ASCIILiteral(), s_processObjectInternalsGetStdinStreamCodeLength) \
+ macro(processObjectInternalsGetStdioWriteStreamCode, getStdioWriteStream, ASCIILiteral(), s_processObjectInternalsGetStdioWriteStreamCodeLength) \
+ macro(processObjectInternalsInitializeNextTickQueueCode, initializeNextTickQueue, ASCIILiteral(), s_processObjectInternalsInitializeNextTickQueueCodeLength) \
+ macro(processObjectInternalsMainModuleCode, mainModule, "get mainModule"_s, s_processObjectInternalsMainModuleCodeLength) \
+
+#define WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(macro) \
+ macro(getStdinStream) \
+ macro(getStdioWriteStream) \
+ macro(initializeNextTickQueue) \
+ macro(mainModule) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class UtilInspectBuiltinsWrapper : private JSC::WeakHandleOwner {
+class ProcessObjectInternalsBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit UtilInspectBuiltinsWrapper(JSC::VM& vm)
+ explicit ProcessObjectInternalsBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -2451,28 +1690,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* UtilInspectBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* ProcessObjectInternalsBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -2482,57 +1721,101 @@ inline JSC::UnlinkedFunctionExecutable* UtilInspectBuiltinsWrapper::name##Execut
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void UtilInspectBuiltinsWrapper::exportNames()
+inline void ProcessObjectInternalsBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* ConsoleObject.ts */
-// asyncIterator
-#define WEBCORE_BUILTIN_CONSOLEOBJECT_ASYNCITERATOR 1
-extern const char* const s_consoleObjectAsyncIteratorCode;
-extern const int s_consoleObjectAsyncIteratorCodeLength;
-extern const JSC::ConstructAbility s_consoleObjectAsyncIteratorCodeConstructAbility;
-extern const JSC::ConstructorKind s_consoleObjectAsyncIteratorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_consoleObjectAsyncIteratorCodeImplementationVisibility;
+/* ReadableByteStreamController.ts */
+// byobRequest
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_BYOBREQUEST 1
+extern const char* const s_readableByteStreamControllerByobRequestCode;
+extern const int s_readableByteStreamControllerByobRequestCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamControllerByobRequestCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamControllerByobRequestCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamControllerByobRequestCodeImplementationVisibility;
-// write
-#define WEBCORE_BUILTIN_CONSOLEOBJECT_WRITE 1
-extern const char* const s_consoleObjectWriteCode;
-extern const int s_consoleObjectWriteCodeLength;
-extern const JSC::ConstructAbility s_consoleObjectWriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_consoleObjectWriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_consoleObjectWriteCodeImplementationVisibility;
+// close
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_CLOSE 1
+extern const char* const s_readableByteStreamControllerCloseCode;
+extern const int s_readableByteStreamControllerCloseCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamControllerCloseCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamControllerCloseCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamControllerCloseCodeImplementationVisibility;
-#define WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_DATA(macro) \
- macro(asyncIterator, consoleObjectAsyncIterator, 0) \
- macro(write, consoleObjectWrite, 1) \
+// desiredSize
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_DESIREDSIZE 1
+extern const char* const s_readableByteStreamControllerDesiredSizeCode;
+extern const int s_readableByteStreamControllerDesiredSizeCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamControllerDesiredSizeCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamControllerDesiredSizeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamControllerDesiredSizeCodeImplementationVisibility;
-#define WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(macro) \
- macro(consoleObjectAsyncIteratorCode, asyncIterator, "[Symbol.asyncIterator]"_s, s_consoleObjectAsyncIteratorCodeLength) \
- macro(consoleObjectWriteCode, write, ASCIILiteral(), s_consoleObjectWriteCodeLength) \
+// enqueue
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_ENQUEUE 1
+extern const char* const s_readableByteStreamControllerEnqueueCode;
+extern const int s_readableByteStreamControllerEnqueueCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamControllerEnqueueCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamControllerEnqueueCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamControllerEnqueueCodeImplementationVisibility;
-#define WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(macro) \
- macro(asyncIterator) \
- macro(write) \
+// error
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_ERROR 1
+extern const char* const s_readableByteStreamControllerErrorCode;
+extern const int s_readableByteStreamControllerErrorCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamControllerErrorCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamControllerErrorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamControllerErrorCodeImplementationVisibility;
+
+// initializeReadableByteStreamController
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_INITIALIZEREADABLEBYTESTREAMCONTROLLER 1
+extern const char* const s_readableByteStreamControllerInitializeReadableByteStreamControllerCode;
+extern const int s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeImplementationVisibility;
+
+#define WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_DATA(macro) \
+ macro(byobRequest, readableByteStreamControllerByobRequest, 0) \
+ macro(close, readableByteStreamControllerClose, 0) \
+ macro(desiredSize, readableByteStreamControllerDesiredSize, 0) \
+ macro(enqueue, readableByteStreamControllerEnqueue, 1) \
+ macro(error, readableByteStreamControllerError, 1) \
+ macro(initializeReadableByteStreamController, readableByteStreamControllerInitializeReadableByteStreamController, 3) \
+
+#define WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(macro) \
+ macro(readableByteStreamControllerByobRequestCode, byobRequest, "get byobRequest"_s, s_readableByteStreamControllerByobRequestCodeLength) \
+ macro(readableByteStreamControllerCloseCode, close, ASCIILiteral(), s_readableByteStreamControllerCloseCodeLength) \
+ macro(readableByteStreamControllerDesiredSizeCode, desiredSize, "get desiredSize"_s, s_readableByteStreamControllerDesiredSizeCodeLength) \
+ macro(readableByteStreamControllerEnqueueCode, enqueue, ASCIILiteral(), s_readableByteStreamControllerEnqueueCodeLength) \
+ macro(readableByteStreamControllerErrorCode, error, ASCIILiteral(), s_readableByteStreamControllerErrorCodeLength) \
+ macro(readableByteStreamControllerInitializeReadableByteStreamControllerCode, initializeReadableByteStreamController, ASCIILiteral(), s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeLength) \
+
+#define WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(macro) \
+ macro(byobRequest) \
+ macro(close) \
+ macro(desiredSize) \
+ macro(enqueue) \
+ macro(error) \
+ macro(initializeReadableByteStreamController) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class ConsoleObjectBuiltinsWrapper : private JSC::WeakHandleOwner {
+class ReadableByteStreamControllerBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit ConsoleObjectBuiltinsWrapper(JSC::VM& vm)
+ explicit ReadableByteStreamControllerBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -2540,28 +1823,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* ConsoleObjectBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* ReadableByteStreamControllerBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -2571,739 +1854,431 @@ inline JSC::UnlinkedFunctionExecutable* ConsoleObjectBuiltinsWrapper::name##Exec
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void ConsoleObjectBuiltinsWrapper::exportNames()
+inline void ReadableByteStreamControllerBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* ReadableStreamInternals.ts */
-// readableStreamReaderGenericInitialize
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMREADERGENERICINITIALIZE 1
-extern const char* const s_readableStreamInternalsReadableStreamReaderGenericInitializeCode;
-extern const int s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeImplementationVisibility;
-
-// privateInitializeReadableStreamDefaultController
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PRIVATEINITIALIZEREADABLESTREAMDEFAULTCONTROLLER 1
-extern const char* const s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCode;
-extern const int s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeImplementationVisibility;
-
-// readableStreamDefaultControllerError
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERERROR 1
-extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerErrorCode;
-extern const int s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeImplementationVisibility;
-
-// readableStreamPipeTo
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMPIPETO 1
-extern const char* const s_readableStreamInternalsReadableStreamPipeToCode;
-extern const int s_readableStreamInternalsReadableStreamPipeToCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToCodeImplementationVisibility;
-
-// acquireReadableStreamDefaultReader
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ACQUIREREADABLESTREAMDEFAULTREADER 1
-extern const char* const s_readableStreamInternalsAcquireReadableStreamDefaultReaderCode;
-extern const int s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeImplementationVisibility;
-
-// setupReadableStreamDefaultController
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_SETUPREADABLESTREAMDEFAULTCONTROLLER 1
-extern const char* const s_readableStreamInternalsSetupReadableStreamDefaultControllerCode;
-extern const int s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeImplementationVisibility;
-
-// createReadableStreamController
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_CREATEREADABLESTREAMCONTROLLER 1
-extern const char* const s_readableStreamInternalsCreateReadableStreamControllerCode;
-extern const int s_readableStreamInternalsCreateReadableStreamControllerCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsCreateReadableStreamControllerCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsCreateReadableStreamControllerCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsCreateReadableStreamControllerCodeImplementationVisibility;
-
-// readableStreamDefaultControllerStart
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERSTART 1
-extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerStartCode;
-extern const int s_readableStreamInternalsReadableStreamDefaultControllerStartCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeImplementationVisibility;
-
-// readableStreamPipeToWritableStream
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMPIPETOWRITABLESTREAM 1
-extern const char* const s_readableStreamInternalsReadableStreamPipeToWritableStreamCode;
-extern const int s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeImplementationVisibility;
-
-// pipeToLoop
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOLOOP 1
-extern const char* const s_readableStreamInternalsPipeToLoopCode;
-extern const int s_readableStreamInternalsPipeToLoopCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsPipeToLoopCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsPipeToLoopCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToLoopCodeImplementationVisibility;
-
-// pipeToDoReadWrite
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETODOREADWRITE 1
-extern const char* const s_readableStreamInternalsPipeToDoReadWriteCode;
-extern const int s_readableStreamInternalsPipeToDoReadWriteCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsPipeToDoReadWriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsPipeToDoReadWriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToDoReadWriteCodeImplementationVisibility;
-
-// pipeToErrorsMustBePropagatedForward
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOERRORSMUSTBEPROPAGATEDFORWARD 1
-extern const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode;
-extern const int s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeImplementationVisibility;
-
-// pipeToErrorsMustBePropagatedBackward
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOERRORSMUSTBEPROPAGATEDBACKWARD 1
-extern const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode;
-extern const int s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeImplementationVisibility;
-
-// pipeToClosingMustBePropagatedForward
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOCLOSINGMUSTBEPROPAGATEDFORWARD 1
-extern const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCode;
-extern const int s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeImplementationVisibility;
-
-// pipeToClosingMustBePropagatedBackward
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOCLOSINGMUSTBEPROPAGATEDBACKWARD 1
-extern const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCode;
-extern const int s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeImplementationVisibility;
-
-// pipeToShutdownWithAction
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOSHUTDOWNWITHACTION 1
-extern const char* const s_readableStreamInternalsPipeToShutdownWithActionCode;
-extern const int s_readableStreamInternalsPipeToShutdownWithActionCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownWithActionCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownWithActionCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownWithActionCodeImplementationVisibility;
-
-// pipeToShutdown
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOSHUTDOWN 1
-extern const char* const s_readableStreamInternalsPipeToShutdownCode;
-extern const int s_readableStreamInternalsPipeToShutdownCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownCodeImplementationVisibility;
-
-// pipeToFinalize
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOFINALIZE 1
-extern const char* const s_readableStreamInternalsPipeToFinalizeCode;
-extern const int s_readableStreamInternalsPipeToFinalizeCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsPipeToFinalizeCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsPipeToFinalizeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToFinalizeCodeImplementationVisibility;
-
-// readableStreamTee
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEE 1
-extern const char* const s_readableStreamInternalsReadableStreamTeeCode;
-extern const int s_readableStreamInternalsReadableStreamTeeCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeCodeImplementationVisibility;
-
-// readableStreamTeePullFunction
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEEPULLFUNCTION 1
-extern const char* const s_readableStreamInternalsReadableStreamTeePullFunctionCode;
-extern const int s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeePullFunctionCodeImplementationVisibility;
-
-// readableStreamTeeBranch1CancelFunction
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEEBRANCH1CANCELFUNCTION 1
-extern const char* const s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode;
-extern const int s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeImplementationVisibility;
-
-// readableStreamTeeBranch2CancelFunction
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEEBRANCH2CANCELFUNCTION 1
-extern const char* const s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode;
-extern const int s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeImplementationVisibility;
-
-// isReadableStream
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAM 1
-extern const char* const s_readableStreamInternalsIsReadableStreamCode;
-extern const int s_readableStreamInternalsIsReadableStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamCodeImplementationVisibility;
-
-// isReadableStreamDefaultReader
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMDEFAULTREADER 1
-extern const char* const s_readableStreamInternalsIsReadableStreamDefaultReaderCode;
-extern const int s_readableStreamInternalsIsReadableStreamDefaultReaderCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeImplementationVisibility;
-
-// isReadableStreamDefaultController
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMDEFAULTCONTROLLER 1
-extern const char* const s_readableStreamInternalsIsReadableStreamDefaultControllerCode;
-extern const int s_readableStreamInternalsIsReadableStreamDefaultControllerCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultControllerCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultControllerCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultControllerCodeImplementationVisibility;
-
-// readDirectStream
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READDIRECTSTREAM 1
-extern const char* const s_readableStreamInternalsReadDirectStreamCode;
-extern const int s_readableStreamInternalsReadDirectStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadDirectStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadDirectStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadDirectStreamCodeImplementationVisibility;
-
-// assignToStream
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ASSIGNTOSTREAM 1
-extern const char* const s_readableStreamInternalsAssignToStreamCode;
-extern const int s_readableStreamInternalsAssignToStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsAssignToStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsAssignToStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsAssignToStreamCodeImplementationVisibility;
-
-// readStreamIntoSink
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READSTREAMINTOSINK 1
-extern const char* const s_readableStreamInternalsReadStreamIntoSinkCode;
-extern const int s_readableStreamInternalsReadStreamIntoSinkCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadStreamIntoSinkCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadStreamIntoSinkCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadStreamIntoSinkCodeImplementationVisibility;
-
-// handleDirectStreamError
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_HANDLEDIRECTSTREAMERROR 1
-extern const char* const s_readableStreamInternalsHandleDirectStreamErrorCode;
-extern const int s_readableStreamInternalsHandleDirectStreamErrorCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorCodeImplementationVisibility;
+/* ReadableByteStreamInternals.ts */
+// isReadableByteStreamController
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_ISREADABLEBYTESTREAMCONTROLLER 1
+extern const char* const s_readableByteStreamInternalsIsReadableByteStreamControllerCode;
+extern const int s_readableByteStreamInternalsIsReadableByteStreamControllerCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeImplementationVisibility;
-// handleDirectStreamErrorReject
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_HANDLEDIRECTSTREAMERRORREJECT 1
-extern const char* const s_readableStreamInternalsHandleDirectStreamErrorRejectCode;
-extern const int s_readableStreamInternalsHandleDirectStreamErrorRejectCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeImplementationVisibility;
+// isReadableStreamBYOBReader
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_ISREADABLESTREAMBYOBREADER 1
+extern const char* const s_readableByteStreamInternalsIsReadableStreamBYOBReaderCode;
+extern const int s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeImplementationVisibility;
-// onPullDirectStream
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONPULLDIRECTSTREAM 1
-extern const char* const s_readableStreamInternalsOnPullDirectStreamCode;
-extern const int s_readableStreamInternalsOnPullDirectStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsOnPullDirectStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsOnPullDirectStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsOnPullDirectStreamCodeImplementationVisibility;
+// isReadableStreamBYOBRequest
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_ISREADABLESTREAMBYOBREQUEST 1
+extern const char* const s_readableByteStreamInternalsIsReadableStreamBYOBRequestCode;
+extern const int s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeImplementationVisibility;
-// noopDoneFunction
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_NOOPDONEFUNCTION 1
-extern const char* const s_readableStreamInternalsNoopDoneFunctionCode;
-extern const int s_readableStreamInternalsNoopDoneFunctionCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsNoopDoneFunctionCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsNoopDoneFunctionCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsNoopDoneFunctionCodeImplementationVisibility;
+// privateInitializeReadableByteStreamController
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_PRIVATEINITIALIZEREADABLEBYTESTREAMCONTROLLER 1
+extern const char* const s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode;
+extern const int s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeImplementationVisibility;
-// onReadableStreamDirectControllerClosed
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONREADABLESTREAMDIRECTCONTROLLERCLOSED 1
-extern const char* const s_readableStreamInternalsOnReadableStreamDirectControllerClosedCode;
-extern const int s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeImplementationVisibility;
+// privateInitializeReadableStreamBYOBRequest
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_PRIVATEINITIALIZEREADABLESTREAMBYOBREQUEST 1
+extern const char* const s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCode;
+extern const int s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeImplementationVisibility;
-// onCloseDirectStream
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONCLOSEDIRECTSTREAM 1
-extern const char* const s_readableStreamInternalsOnCloseDirectStreamCode;
-extern const int s_readableStreamInternalsOnCloseDirectStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsOnCloseDirectStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsOnCloseDirectStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsOnCloseDirectStreamCodeImplementationVisibility;
+// readableByteStreamControllerCallPullIfNeeded
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCALLPULLIFNEEDED 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeImplementationVisibility;
-// onFlushDirectStream
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONFLUSHDIRECTSTREAM 1
-extern const char* const s_readableStreamInternalsOnFlushDirectStreamCode;
-extern const int s_readableStreamInternalsOnFlushDirectStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsOnFlushDirectStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsOnFlushDirectStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsOnFlushDirectStreamCodeImplementationVisibility;
+// readableByteStreamControllerCancel
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCANCEL 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCancelCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeImplementationVisibility;
-// createTextStream
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_CREATETEXTSTREAM 1
-extern const char* const s_readableStreamInternalsCreateTextStreamCode;
-extern const int s_readableStreamInternalsCreateTextStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsCreateTextStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsCreateTextStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsCreateTextStreamCodeImplementationVisibility;
+// readableByteStreamControllerClearPendingPullIntos
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCLEARPENDINGPULLINTOS 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeImplementationVisibility;
-// initializeTextStream
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_INITIALIZETEXTSTREAM 1
-extern const char* const s_readableStreamInternalsInitializeTextStreamCode;
-extern const int s_readableStreamInternalsInitializeTextStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsInitializeTextStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsInitializeTextStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsInitializeTextStreamCodeImplementationVisibility;
+// readableByteStreamControllerClose
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCLOSE 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCloseCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeImplementationVisibility;
-// initializeArrayStream
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_INITIALIZEARRAYSTREAM 1
-extern const char* const s_readableStreamInternalsInitializeArrayStreamCode;
-extern const int s_readableStreamInternalsInitializeArrayStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayStreamCodeImplementationVisibility;
+// readableByteStreamControllerCommitDescriptor
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCOMMITDESCRIPTOR 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeImplementationVisibility;
-// initializeArrayBufferStream
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_INITIALIZEARRAYBUFFERSTREAM 1
-extern const char* const s_readableStreamInternalsInitializeArrayBufferStreamCode;
-extern const int s_readableStreamInternalsInitializeArrayBufferStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayBufferStreamCodeImplementationVisibility;
+// readableByteStreamControllerConvertDescriptor
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCONVERTDESCRIPTOR 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeImplementationVisibility;
-// readableStreamError
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMERROR 1
-extern const char* const s_readableStreamInternalsReadableStreamErrorCode;
-extern const int s_readableStreamInternalsReadableStreamErrorCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamErrorCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamErrorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamErrorCodeImplementationVisibility;
+// readableByteStreamControllerEnqueue
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERENQUEUE 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeImplementationVisibility;
-// readableStreamDefaultControllerShouldCallPull
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERSHOULDCALLPULL 1
-extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCode;
-extern const int s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeImplementationVisibility;
+// readableByteStreamControllerEnqueueChunk
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERENQUEUECHUNK 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeImplementationVisibility;
-// readableStreamDefaultControllerCallPullIfNeeded
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCALLPULLIFNEEDED 1
-extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCode;
-extern const int s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeImplementationVisibility;
+// readableByteStreamControllerError
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERERROR 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerErrorCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeImplementationVisibility;
-// isReadableStreamLocked
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMLOCKED 1
-extern const char* const s_readableStreamInternalsIsReadableStreamLockedCode;
-extern const int s_readableStreamInternalsIsReadableStreamLockedCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamLockedCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamLockedCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamLockedCodeImplementationVisibility;
+// readableByteStreamControllerFillDescriptorFromQueue
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERFILLDESCRIPTORFROMQUEUE 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeImplementationVisibility;
-// readableStreamDefaultControllerGetDesiredSize
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERGETDESIREDSIZE 1
-extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCode;
-extern const int s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility;
+// readableByteStreamControllerGetDesiredSize
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERGETDESIREDSIZE 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeImplementationVisibility;
-// readableStreamReaderGenericCancel
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMREADERGENERICCANCEL 1
-extern const char* const s_readableStreamInternalsReadableStreamReaderGenericCancelCode;
-extern const int s_readableStreamInternalsReadableStreamReaderGenericCancelCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeImplementationVisibility;
+// readableByteStreamControllerHandleQueueDrain
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERHANDLEQUEUEDRAIN 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeImplementationVisibility;
-// readableStreamCancel
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMCANCEL 1
-extern const char* const s_readableStreamInternalsReadableStreamCancelCode;
-extern const int s_readableStreamInternalsReadableStreamCancelCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCancelCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCancelCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCancelCodeImplementationVisibility;
+// readableByteStreamControllerInvalidateBYOBRequest
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERINVALIDATEBYOBREQUEST 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeImplementationVisibility;
-// readableStreamDefaultControllerCancel
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCANCEL 1
-extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCancelCode;
-extern const int s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeImplementationVisibility;
+// readableByteStreamControllerProcessPullDescriptors
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERPROCESSPULLDESCRIPTORS 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeImplementationVisibility;
-// readableStreamDefaultControllerPull
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERPULL 1
-extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerPullCode;
-extern const int s_readableStreamInternalsReadableStreamDefaultControllerPullCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeImplementationVisibility;
+// readableByteStreamControllerPull
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERPULL 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerPullCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeImplementationVisibility;
-// readableStreamDefaultControllerClose
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCLOSE 1
-extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCloseCode;
-extern const int s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeImplementationVisibility;
+// readableByteStreamControllerPullInto
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERPULLINTO 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeImplementationVisibility;
-// readableStreamClose
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMCLOSE 1
-extern const char* const s_readableStreamInternalsReadableStreamCloseCode;
-extern const int s_readableStreamInternalsReadableStreamCloseCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCloseCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCloseCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCloseCodeImplementationVisibility;
+// readableByteStreamControllerRespond
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPOND 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeImplementationVisibility;
-// readableStreamFulfillReadRequest
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMFULFILLREADREQUEST 1
-extern const char* const s_readableStreamInternalsReadableStreamFulfillReadRequestCode;
-extern const int s_readableStreamInternalsReadableStreamFulfillReadRequestCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeImplementationVisibility;
+// readableByteStreamControllerRespondInClosedState
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDINCLOSEDSTATE 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeImplementationVisibility;
-// readableStreamDefaultControllerEnqueue
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERENQUEUE 1
-extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCode;
-extern const int s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeImplementationVisibility;
+// readableByteStreamControllerRespondInReadableState
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDINREADABLESTATE 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeImplementationVisibility;
-// readableStreamDefaultReaderRead
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTREADERREAD 1
-extern const char* const s_readableStreamInternalsReadableStreamDefaultReaderReadCode;
-extern const int s_readableStreamInternalsReadableStreamDefaultReaderReadCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeImplementationVisibility;
+// readableByteStreamControllerRespondInternal
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDINTERNAL 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeImplementationVisibility;
-// readableStreamAddReadRequest
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMADDREADREQUEST 1
-extern const char* const s_readableStreamInternalsReadableStreamAddReadRequestCode;
-extern const int s_readableStreamInternalsReadableStreamAddReadRequestCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamAddReadRequestCodeImplementationVisibility;
+// readableByteStreamControllerRespondWithNewView
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDWITHNEWVIEW 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeImplementationVisibility;
-// isReadableStreamDisturbed
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMDISTURBED 1
-extern const char* const s_readableStreamInternalsIsReadableStreamDisturbedCode;
-extern const int s_readableStreamInternalsIsReadableStreamDisturbedCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDisturbedCodeImplementationVisibility;
+// readableByteStreamControllerShiftPendingDescriptor
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERSHIFTPENDINGDESCRIPTOR 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeImplementationVisibility;
-// readableStreamReaderGenericRelease
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMREADERGENERICRELEASE 1
-extern const char* const s_readableStreamInternalsReadableStreamReaderGenericReleaseCode;
-extern const int s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeImplementationVisibility;
+// readableByteStreamControllerShouldCallPull
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERSHOULDCALLPULL 1
+extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode;
+extern const int s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeImplementationVisibility;
-// readableStreamDefaultControllerCanCloseOrEnqueue
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCANCLOSEORENQUEUE 1
-extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCode;
-extern const int s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeImplementationVisibility;
+// readableStreamAddReadIntoRequest
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMADDREADINTOREQUEST 1
+extern const char* const s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCode;
+extern const int s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeImplementationVisibility;
-// lazyLoadStream
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_LAZYLOADSTREAM 1
-extern const char* const s_readableStreamInternalsLazyLoadStreamCode;
-extern const int s_readableStreamInternalsLazyLoadStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsLazyLoadStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsLazyLoadStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsLazyLoadStreamCodeImplementationVisibility;
+// readableStreamBYOBReaderRead
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMBYOBREADERREAD 1
+extern const char* const s_readableByteStreamInternalsReadableStreamBYOBReaderReadCode;
+extern const int s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeImplementationVisibility;
-// readableStreamIntoArray
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMINTOARRAY 1
-extern const char* const s_readableStreamInternalsReadableStreamIntoArrayCode;
-extern const int s_readableStreamInternalsReadableStreamIntoArrayCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoArrayCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoArrayCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoArrayCodeImplementationVisibility;
+// readableStreamByteStreamControllerStart
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMBYTESTREAMCONTROLLERSTART 1
+extern const char* const s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCode;
+extern const int s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeImplementationVisibility;
-// readableStreamIntoText
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMINTOTEXT 1
-extern const char* const s_readableStreamInternalsReadableStreamIntoTextCode;
-extern const int s_readableStreamInternalsReadableStreamIntoTextCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoTextCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoTextCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoTextCodeImplementationVisibility;
+// readableStreamFulfillReadIntoRequest
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMFULFILLREADINTOREQUEST 1
+extern const char* const s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCode;
+extern const int s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeImplementationVisibility;
-// readableStreamToArrayBufferDirect
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTOARRAYBUFFERDIRECT 1
-extern const char* const s_readableStreamInternalsReadableStreamToArrayBufferDirectCode;
-extern const int s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeImplementationVisibility;
+// readableStreamHasBYOBReader
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMHASBYOBREADER 1
+extern const char* const s_readableByteStreamInternalsReadableStreamHasBYOBReaderCode;
+extern const int s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeImplementationVisibility;
-// readableStreamToTextDirect
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTOTEXTDIRECT 1
-extern const char* const s_readableStreamInternalsReadableStreamToTextDirectCode;
-extern const int s_readableStreamInternalsReadableStreamToTextDirectCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToTextDirectCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToTextDirectCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToTextDirectCodeImplementationVisibility;
+// readableStreamHasDefaultReader
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMHASDEFAULTREADER 1
+extern const char* const s_readableByteStreamInternalsReadableStreamHasDefaultReaderCode;
+extern const int s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeImplementationVisibility;
-// readableStreamToArrayDirect
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTOARRAYDIRECT 1
-extern const char* const s_readableStreamInternalsReadableStreamToArrayDirectCode;
-extern const int s_readableStreamInternalsReadableStreamToArrayDirectCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayDirectCodeImplementationVisibility;
+// readableStreamReaderKind
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMREADERKIND 1
+extern const char* const s_readableByteStreamInternalsReadableStreamReaderKindCode;
+extern const int s_readableByteStreamInternalsReadableStreamReaderKindCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamReaderKindCodeImplementationVisibility;
-// readableStreamDefineLazyIterators
-#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFINELAZYITERATORS 1
-extern const char* const s_readableStreamInternalsReadableStreamDefineLazyIteratorsCode;
-extern const int s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeImplementationVisibility;
+// transferBufferToCurrentRealm
+#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_TRANSFERBUFFERTOCURRENTREALM 1
+extern const char* const s_readableByteStreamInternalsTransferBufferToCurrentRealmCode;
+extern const int s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeLength;
+extern const JSC::ConstructAbility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeImplementationVisibility;
-#define WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_DATA(macro) \
- macro(readableStreamReaderGenericInitialize, readableStreamInternalsReadableStreamReaderGenericInitialize, 2) \
- macro(privateInitializeReadableStreamDefaultController, readableStreamInternalsPrivateInitializeReadableStreamDefaultController, 4) \
- macro(readableStreamDefaultControllerError, readableStreamInternalsReadableStreamDefaultControllerError, 2) \
- macro(readableStreamPipeTo, readableStreamInternalsReadableStreamPipeTo, 2) \
- macro(acquireReadableStreamDefaultReader, readableStreamInternalsAcquireReadableStreamDefaultReader, 1) \
- macro(setupReadableStreamDefaultController, readableStreamInternalsSetupReadableStreamDefaultController, 8) \
- macro(createReadableStreamController, readableStreamInternalsCreateReadableStreamController, 3) \
- macro(readableStreamDefaultControllerStart, readableStreamInternalsReadableStreamDefaultControllerStart, 1) \
- macro(readableStreamPipeToWritableStream, readableStreamInternalsReadableStreamPipeToWritableStream, 7) \
- macro(pipeToLoop, readableStreamInternalsPipeToLoop, 1) \
- macro(pipeToDoReadWrite, readableStreamInternalsPipeToDoReadWrite, 1) \
- macro(pipeToErrorsMustBePropagatedForward, readableStreamInternalsPipeToErrorsMustBePropagatedForward, 1) \
- macro(pipeToErrorsMustBePropagatedBackward, readableStreamInternalsPipeToErrorsMustBePropagatedBackward, 1) \
- macro(pipeToClosingMustBePropagatedForward, readableStreamInternalsPipeToClosingMustBePropagatedForward, 1) \
- macro(pipeToClosingMustBePropagatedBackward, readableStreamInternalsPipeToClosingMustBePropagatedBackward, 1) \
- macro(pipeToShutdownWithAction, readableStreamInternalsPipeToShutdownWithAction, 2) \
- macro(pipeToShutdown, readableStreamInternalsPipeToShutdown, 1) \
- macro(pipeToFinalize, readableStreamInternalsPipeToFinalize, 1) \
- macro(readableStreamTee, readableStreamInternalsReadableStreamTee, 2) \
- macro(readableStreamTeePullFunction, readableStreamInternalsReadableStreamTeePullFunction, 3) \
- macro(readableStreamTeeBranch1CancelFunction, readableStreamInternalsReadableStreamTeeBranch1CancelFunction, 2) \
- macro(readableStreamTeeBranch2CancelFunction, readableStreamInternalsReadableStreamTeeBranch2CancelFunction, 2) \
- macro(isReadableStream, readableStreamInternalsIsReadableStream, 1) \
- macro(isReadableStreamDefaultReader, readableStreamInternalsIsReadableStreamDefaultReader, 1) \
- macro(isReadableStreamDefaultController, readableStreamInternalsIsReadableStreamDefaultController, 1) \
- macro(readDirectStream, readableStreamInternalsReadDirectStream, 3) \
- macro(assignToStream, readableStreamInternalsAssignToStream, 2) \
- macro(readStreamIntoSink, readableStreamInternalsReadStreamIntoSink, 3) \
- macro(handleDirectStreamError, readableStreamInternalsHandleDirectStreamError, 1) \
- macro(handleDirectStreamErrorReject, readableStreamInternalsHandleDirectStreamErrorReject, 1) \
- macro(onPullDirectStream, readableStreamInternalsOnPullDirectStream, 1) \
- macro(noopDoneFunction, readableStreamInternalsNoopDoneFunction, 0) \
- macro(onReadableStreamDirectControllerClosed, readableStreamInternalsOnReadableStreamDirectControllerClosed, 1) \
- macro(onCloseDirectStream, readableStreamInternalsOnCloseDirectStream, 1) \
- macro(onFlushDirectStream, readableStreamInternalsOnFlushDirectStream, 0) \
- macro(createTextStream, readableStreamInternalsCreateTextStream, 1) \
- macro(initializeTextStream, readableStreamInternalsInitializeTextStream, 2) \
- macro(initializeArrayStream, readableStreamInternalsInitializeArrayStream, 2) \
- macro(initializeArrayBufferStream, readableStreamInternalsInitializeArrayBufferStream, 2) \
- macro(readableStreamError, readableStreamInternalsReadableStreamError, 2) \
- macro(readableStreamDefaultControllerShouldCallPull, readableStreamInternalsReadableStreamDefaultControllerShouldCallPull, 1) \
- macro(readableStreamDefaultControllerCallPullIfNeeded, readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeeded, 1) \
- macro(isReadableStreamLocked, readableStreamInternalsIsReadableStreamLocked, 1) \
- macro(readableStreamDefaultControllerGetDesiredSize, readableStreamInternalsReadableStreamDefaultControllerGetDesiredSize, 1) \
- macro(readableStreamReaderGenericCancel, readableStreamInternalsReadableStreamReaderGenericCancel, 2) \
- macro(readableStreamCancel, readableStreamInternalsReadableStreamCancel, 2) \
- macro(readableStreamDefaultControllerCancel, readableStreamInternalsReadableStreamDefaultControllerCancel, 2) \
- macro(readableStreamDefaultControllerPull, readableStreamInternalsReadableStreamDefaultControllerPull, 1) \
- macro(readableStreamDefaultControllerClose, readableStreamInternalsReadableStreamDefaultControllerClose, 1) \
- macro(readableStreamClose, readableStreamInternalsReadableStreamClose, 1) \
- macro(readableStreamFulfillReadRequest, readableStreamInternalsReadableStreamFulfillReadRequest, 3) \
- macro(readableStreamDefaultControllerEnqueue, readableStreamInternalsReadableStreamDefaultControllerEnqueue, 2) \
- macro(readableStreamDefaultReaderRead, readableStreamInternalsReadableStreamDefaultReaderRead, 1) \
- macro(readableStreamAddReadRequest, readableStreamInternalsReadableStreamAddReadRequest, 1) \
- macro(isReadableStreamDisturbed, readableStreamInternalsIsReadableStreamDisturbed, 1) \
- macro(readableStreamReaderGenericRelease, readableStreamInternalsReadableStreamReaderGenericRelease, 1) \
- macro(readableStreamDefaultControllerCanCloseOrEnqueue, readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueue, 1) \
- macro(lazyLoadStream, readableStreamInternalsLazyLoadStream, 2) \
- macro(readableStreamIntoArray, readableStreamInternalsReadableStreamIntoArray, 1) \
- macro(readableStreamIntoText, readableStreamInternalsReadableStreamIntoText, 1) \
- macro(readableStreamToArrayBufferDirect, readableStreamInternalsReadableStreamToArrayBufferDirect, 2) \
- macro(readableStreamToTextDirect, readableStreamInternalsReadableStreamToTextDirect, 2) \
- macro(readableStreamToArrayDirect, readableStreamInternalsReadableStreamToArrayDirect, 2) \
- macro(readableStreamDefineLazyIterators, readableStreamInternalsReadableStreamDefineLazyIterators, 1) \
+#define WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_DATA(macro) \
+ macro(isReadableByteStreamController, readableByteStreamInternalsIsReadableByteStreamController, 1) \
+ macro(isReadableStreamBYOBReader, readableByteStreamInternalsIsReadableStreamBYOBReader, 1) \
+ macro(isReadableStreamBYOBRequest, readableByteStreamInternalsIsReadableStreamBYOBRequest, 1) \
+ macro(privateInitializeReadableByteStreamController, readableByteStreamInternalsPrivateInitializeReadableByteStreamController, 3) \
+ macro(privateInitializeReadableStreamBYOBRequest, readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequest, 2) \
+ macro(readableByteStreamControllerCallPullIfNeeded, readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeeded, 1) \
+ macro(readableByteStreamControllerCancel, readableByteStreamInternalsReadableByteStreamControllerCancel, 2) \
+ macro(readableByteStreamControllerClearPendingPullIntos, readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntos, 1) \
+ macro(readableByteStreamControllerClose, readableByteStreamInternalsReadableByteStreamControllerClose, 1) \
+ macro(readableByteStreamControllerCommitDescriptor, readableByteStreamInternalsReadableByteStreamControllerCommitDescriptor, 2) \
+ macro(readableByteStreamControllerConvertDescriptor, readableByteStreamInternalsReadableByteStreamControllerConvertDescriptor, 1) \
+ macro(readableByteStreamControllerEnqueue, readableByteStreamInternalsReadableByteStreamControllerEnqueue, 2) \
+ macro(readableByteStreamControllerEnqueueChunk, readableByteStreamInternalsReadableByteStreamControllerEnqueueChunk, 4) \
+ macro(readableByteStreamControllerError, readableByteStreamInternalsReadableByteStreamControllerError, 2) \
+ macro(readableByteStreamControllerFillDescriptorFromQueue, readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueue, 2) \
+ macro(readableByteStreamControllerGetDesiredSize, readableByteStreamInternalsReadableByteStreamControllerGetDesiredSize, 1) \
+ macro(readableByteStreamControllerHandleQueueDrain, readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrain, 1) \
+ macro(readableByteStreamControllerInvalidateBYOBRequest, readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequest, 1) \
+ macro(readableByteStreamControllerProcessPullDescriptors, readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptors, 1) \
+ macro(readableByteStreamControllerPull, readableByteStreamInternalsReadableByteStreamControllerPull, 1) \
+ macro(readableByteStreamControllerPullInto, readableByteStreamInternalsReadableByteStreamControllerPullInto, 2) \
+ macro(readableByteStreamControllerRespond, readableByteStreamInternalsReadableByteStreamControllerRespond, 2) \
+ macro(readableByteStreamControllerRespondInClosedState, readableByteStreamInternalsReadableByteStreamControllerRespondInClosedState, 2) \
+ macro(readableByteStreamControllerRespondInReadableState, readableByteStreamInternalsReadableByteStreamControllerRespondInReadableState, 3) \
+ macro(readableByteStreamControllerRespondInternal, readableByteStreamInternalsReadableByteStreamControllerRespondInternal, 2) \
+ macro(readableByteStreamControllerRespondWithNewView, readableByteStreamInternalsReadableByteStreamControllerRespondWithNewView, 2) \
+ macro(readableByteStreamControllerShiftPendingDescriptor, readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptor, 1) \
+ macro(readableByteStreamControllerShouldCallPull, readableByteStreamInternalsReadableByteStreamControllerShouldCallPull, 1) \
+ macro(readableStreamAddReadIntoRequest, readableByteStreamInternalsReadableStreamAddReadIntoRequest, 1) \
+ macro(readableStreamBYOBReaderRead, readableByteStreamInternalsReadableStreamBYOBReaderRead, 2) \
+ macro(readableStreamByteStreamControllerStart, readableByteStreamInternalsReadableStreamByteStreamControllerStart, 1) \
+ macro(readableStreamFulfillReadIntoRequest, readableByteStreamInternalsReadableStreamFulfillReadIntoRequest, 3) \
+ macro(readableStreamHasBYOBReader, readableByteStreamInternalsReadableStreamHasBYOBReader, 1) \
+ macro(readableStreamHasDefaultReader, readableByteStreamInternalsReadableStreamHasDefaultReader, 1) \
+ macro(readableStreamReaderKind, readableByteStreamInternalsReadableStreamReaderKind, 1) \
+ macro(transferBufferToCurrentRealm, readableByteStreamInternalsTransferBufferToCurrentRealm, 1) \
-#define WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(macro) \
- macro(readableStreamInternalsReadableStreamReaderGenericInitializeCode, readableStreamReaderGenericInitialize, ASCIILiteral(), s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength) \
- macro(readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCode, privateInitializeReadableStreamDefaultController, ASCIILiteral(), s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeLength) \
- macro(readableStreamInternalsReadableStreamDefaultControllerErrorCode, readableStreamDefaultControllerError, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeLength) \
- macro(readableStreamInternalsReadableStreamPipeToCode, readableStreamPipeTo, ASCIILiteral(), s_readableStreamInternalsReadableStreamPipeToCodeLength) \
- macro(readableStreamInternalsAcquireReadableStreamDefaultReaderCode, acquireReadableStreamDefaultReader, ASCIILiteral(), s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeLength) \
- macro(readableStreamInternalsSetupReadableStreamDefaultControllerCode, setupReadableStreamDefaultController, ASCIILiteral(), s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeLength) \
- macro(readableStreamInternalsCreateReadableStreamControllerCode, createReadableStreamController, ASCIILiteral(), s_readableStreamInternalsCreateReadableStreamControllerCodeLength) \
- macro(readableStreamInternalsReadableStreamDefaultControllerStartCode, readableStreamDefaultControllerStart, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerStartCodeLength) \
- macro(readableStreamInternalsReadableStreamPipeToWritableStreamCode, readableStreamPipeToWritableStream, ASCIILiteral(), s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength) \
- macro(readableStreamInternalsPipeToLoopCode, pipeToLoop, ASCIILiteral(), s_readableStreamInternalsPipeToLoopCodeLength) \
- macro(readableStreamInternalsPipeToDoReadWriteCode, pipeToDoReadWrite, ASCIILiteral(), s_readableStreamInternalsPipeToDoReadWriteCodeLength) \
- macro(readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode, pipeToErrorsMustBePropagatedForward, ASCIILiteral(), s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeLength) \
- macro(readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode, pipeToErrorsMustBePropagatedBackward, ASCIILiteral(), s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeLength) \
- macro(readableStreamInternalsPipeToClosingMustBePropagatedForwardCode, pipeToClosingMustBePropagatedForward, ASCIILiteral(), s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeLength) \
- macro(readableStreamInternalsPipeToClosingMustBePropagatedBackwardCode, pipeToClosingMustBePropagatedBackward, ASCIILiteral(), s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeLength) \
- macro(readableStreamInternalsPipeToShutdownWithActionCode, pipeToShutdownWithAction, ASCIILiteral(), s_readableStreamInternalsPipeToShutdownWithActionCodeLength) \
- macro(readableStreamInternalsPipeToShutdownCode, pipeToShutdown, ASCIILiteral(), s_readableStreamInternalsPipeToShutdownCodeLength) \
- macro(readableStreamInternalsPipeToFinalizeCode, pipeToFinalize, ASCIILiteral(), s_readableStreamInternalsPipeToFinalizeCodeLength) \
- macro(readableStreamInternalsReadableStreamTeeCode, readableStreamTee, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeeCodeLength) \
- macro(readableStreamInternalsReadableStreamTeePullFunctionCode, readableStreamTeePullFunction, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength) \
- macro(readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode, readableStreamTeeBranch1CancelFunction, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength) \
- macro(readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode, readableStreamTeeBranch2CancelFunction, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeLength) \
- macro(readableStreamInternalsIsReadableStreamCode, isReadableStream, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamCodeLength) \
- macro(readableStreamInternalsIsReadableStreamDefaultReaderCode, isReadableStreamDefaultReader, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamDefaultReaderCodeLength) \
- macro(readableStreamInternalsIsReadableStreamDefaultControllerCode, isReadableStreamDefaultController, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamDefaultControllerCodeLength) \
- macro(readableStreamInternalsReadDirectStreamCode, readDirectStream, ASCIILiteral(), s_readableStreamInternalsReadDirectStreamCodeLength) \
- macro(readableStreamInternalsAssignToStreamCode, assignToStream, ASCIILiteral(), s_readableStreamInternalsAssignToStreamCodeLength) \
- macro(readableStreamInternalsReadStreamIntoSinkCode, readStreamIntoSink, ASCIILiteral(), s_readableStreamInternalsReadStreamIntoSinkCodeLength) \
- macro(readableStreamInternalsHandleDirectStreamErrorCode, handleDirectStreamError, ASCIILiteral(), s_readableStreamInternalsHandleDirectStreamErrorCodeLength) \
- macro(readableStreamInternalsHandleDirectStreamErrorRejectCode, handleDirectStreamErrorReject, ASCIILiteral(), s_readableStreamInternalsHandleDirectStreamErrorRejectCodeLength) \
- macro(readableStreamInternalsOnPullDirectStreamCode, onPullDirectStream, ASCIILiteral(), s_readableStreamInternalsOnPullDirectStreamCodeLength) \
- macro(readableStreamInternalsNoopDoneFunctionCode, noopDoneFunction, ASCIILiteral(), s_readableStreamInternalsNoopDoneFunctionCodeLength) \
- macro(readableStreamInternalsOnReadableStreamDirectControllerClosedCode, onReadableStreamDirectControllerClosed, ASCIILiteral(), s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeLength) \
- macro(readableStreamInternalsOnCloseDirectStreamCode, onCloseDirectStream, ASCIILiteral(), s_readableStreamInternalsOnCloseDirectStreamCodeLength) \
- macro(readableStreamInternalsOnFlushDirectStreamCode, onFlushDirectStream, ASCIILiteral(), s_readableStreamInternalsOnFlushDirectStreamCodeLength) \
- macro(readableStreamInternalsCreateTextStreamCode, createTextStream, ASCIILiteral(), s_readableStreamInternalsCreateTextStreamCodeLength) \
- macro(readableStreamInternalsInitializeTextStreamCode, initializeTextStream, ASCIILiteral(), s_readableStreamInternalsInitializeTextStreamCodeLength) \
- macro(readableStreamInternalsInitializeArrayStreamCode, initializeArrayStream, ASCIILiteral(), s_readableStreamInternalsInitializeArrayStreamCodeLength) \
- macro(readableStreamInternalsInitializeArrayBufferStreamCode, initializeArrayBufferStream, ASCIILiteral(), s_readableStreamInternalsInitializeArrayBufferStreamCodeLength) \
- macro(readableStreamInternalsReadableStreamErrorCode, readableStreamError, ASCIILiteral(), s_readableStreamInternalsReadableStreamErrorCodeLength) \
- macro(readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCode, readableStreamDefaultControllerShouldCallPull, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeLength) \
- macro(readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCode, readableStreamDefaultControllerCallPullIfNeeded, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeLength) \
- macro(readableStreamInternalsIsReadableStreamLockedCode, isReadableStreamLocked, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamLockedCodeLength) \
- macro(readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCode, readableStreamDefaultControllerGetDesiredSize, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeLength) \
- macro(readableStreamInternalsReadableStreamReaderGenericCancelCode, readableStreamReaderGenericCancel, ASCIILiteral(), s_readableStreamInternalsReadableStreamReaderGenericCancelCodeLength) \
- macro(readableStreamInternalsReadableStreamCancelCode, readableStreamCancel, ASCIILiteral(), s_readableStreamInternalsReadableStreamCancelCodeLength) \
- macro(readableStreamInternalsReadableStreamDefaultControllerCancelCode, readableStreamDefaultControllerCancel, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeLength) \
- macro(readableStreamInternalsReadableStreamDefaultControllerPullCode, readableStreamDefaultControllerPull, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerPullCodeLength) \
- macro(readableStreamInternalsReadableStreamDefaultControllerCloseCode, readableStreamDefaultControllerClose, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeLength) \
- macro(readableStreamInternalsReadableStreamCloseCode, readableStreamClose, ASCIILiteral(), s_readableStreamInternalsReadableStreamCloseCodeLength) \
- macro(readableStreamInternalsReadableStreamFulfillReadRequestCode, readableStreamFulfillReadRequest, ASCIILiteral(), s_readableStreamInternalsReadableStreamFulfillReadRequestCodeLength) \
- macro(readableStreamInternalsReadableStreamDefaultControllerEnqueueCode, readableStreamDefaultControllerEnqueue, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeLength) \
- macro(readableStreamInternalsReadableStreamDefaultReaderReadCode, readableStreamDefaultReaderRead, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultReaderReadCodeLength) \
- macro(readableStreamInternalsReadableStreamAddReadRequestCode, readableStreamAddReadRequest, ASCIILiteral(), s_readableStreamInternalsReadableStreamAddReadRequestCodeLength) \
- macro(readableStreamInternalsIsReadableStreamDisturbedCode, isReadableStreamDisturbed, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamDisturbedCodeLength) \
- macro(readableStreamInternalsReadableStreamReaderGenericReleaseCode, readableStreamReaderGenericRelease, ASCIILiteral(), s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeLength) \
- macro(readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCode, readableStreamDefaultControllerCanCloseOrEnqueue, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeLength) \
- macro(readableStreamInternalsLazyLoadStreamCode, lazyLoadStream, ASCIILiteral(), s_readableStreamInternalsLazyLoadStreamCodeLength) \
- macro(readableStreamInternalsReadableStreamIntoArrayCode, readableStreamIntoArray, ASCIILiteral(), s_readableStreamInternalsReadableStreamIntoArrayCodeLength) \
- macro(readableStreamInternalsReadableStreamIntoTextCode, readableStreamIntoText, ASCIILiteral(), s_readableStreamInternalsReadableStreamIntoTextCodeLength) \
- macro(readableStreamInternalsReadableStreamToArrayBufferDirectCode, readableStreamToArrayBufferDirect, ASCIILiteral(), s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeLength) \
- macro(readableStreamInternalsReadableStreamToTextDirectCode, readableStreamToTextDirect, ASCIILiteral(), s_readableStreamInternalsReadableStreamToTextDirectCodeLength) \
- macro(readableStreamInternalsReadableStreamToArrayDirectCode, readableStreamToArrayDirect, ASCIILiteral(), s_readableStreamInternalsReadableStreamToArrayDirectCodeLength) \
- macro(readableStreamInternalsReadableStreamDefineLazyIteratorsCode, readableStreamDefineLazyIterators, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeLength) \
+#define WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(macro) \
+ macro(readableByteStreamInternalsIsReadableByteStreamControllerCode, isReadableByteStreamController, ASCIILiteral(), s_readableByteStreamInternalsIsReadableByteStreamControllerCodeLength) \
+ macro(readableByteStreamInternalsIsReadableStreamBYOBReaderCode, isReadableStreamBYOBReader, ASCIILiteral(), s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeLength) \
+ macro(readableByteStreamInternalsIsReadableStreamBYOBRequestCode, isReadableStreamBYOBRequest, ASCIILiteral(), s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeLength) \
+ macro(readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode, privateInitializeReadableByteStreamController, ASCIILiteral(), s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength) \
+ macro(readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCode, privateInitializeReadableStreamBYOBRequest, ASCIILiteral(), s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCode, readableByteStreamControllerCallPullIfNeeded, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerCancelCode, readableByteStreamControllerCancel, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCode, readableByteStreamControllerClearPendingPullIntos, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerCloseCode, readableByteStreamControllerClose, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCode, readableByteStreamControllerCommitDescriptor, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCode, readableByteStreamControllerConvertDescriptor, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerEnqueueCode, readableByteStreamControllerEnqueue, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode, readableByteStreamControllerEnqueueChunk, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerErrorCode, readableByteStreamControllerError, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode, readableByteStreamControllerFillDescriptorFromQueue, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCode, readableByteStreamControllerGetDesiredSize, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCode, readableByteStreamControllerHandleQueueDrain, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCode, readableByteStreamControllerInvalidateBYOBRequest, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCode, readableByteStreamControllerProcessPullDescriptors, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerPullCode, readableByteStreamControllerPull, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerPullCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerPullIntoCode, readableByteStreamControllerPullInto, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerRespondCode, readableByteStreamControllerRespond, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCode, readableByteStreamControllerRespondInClosedState, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCode, readableByteStreamControllerRespondInReadableState, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode, readableByteStreamControllerRespondInternal, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCode, readableByteStreamControllerRespondWithNewView, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCode, readableByteStreamControllerShiftPendingDescriptor, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeLength) \
+ macro(readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode, readableByteStreamControllerShouldCallPull, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeLength) \
+ macro(readableByteStreamInternalsReadableStreamAddReadIntoRequestCode, readableStreamAddReadIntoRequest, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeLength) \
+ macro(readableByteStreamInternalsReadableStreamBYOBReaderReadCode, readableStreamBYOBReaderRead, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeLength) \
+ macro(readableByteStreamInternalsReadableStreamByteStreamControllerStartCode, readableStreamByteStreamControllerStart, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeLength) \
+ macro(readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCode, readableStreamFulfillReadIntoRequest, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeLength) \
+ macro(readableByteStreamInternalsReadableStreamHasBYOBReaderCode, readableStreamHasBYOBReader, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeLength) \
+ macro(readableByteStreamInternalsReadableStreamHasDefaultReaderCode, readableStreamHasDefaultReader, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeLength) \
+ macro(readableByteStreamInternalsReadableStreamReaderKindCode, readableStreamReaderKind, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamReaderKindCodeLength) \
+ macro(readableByteStreamInternalsTransferBufferToCurrentRealmCode, transferBufferToCurrentRealm, ASCIILiteral(), s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeLength) \
-#define WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \
- macro(readableStreamReaderGenericInitialize) \
- macro(privateInitializeReadableStreamDefaultController) \
- macro(readableStreamDefaultControllerError) \
- macro(readableStreamPipeTo) \
- macro(acquireReadableStreamDefaultReader) \
- macro(setupReadableStreamDefaultController) \
- macro(createReadableStreamController) \
- macro(readableStreamDefaultControllerStart) \
- macro(readableStreamPipeToWritableStream) \
- macro(pipeToLoop) \
- macro(pipeToDoReadWrite) \
- macro(pipeToErrorsMustBePropagatedForward) \
- macro(pipeToErrorsMustBePropagatedBackward) \
- macro(pipeToClosingMustBePropagatedForward) \
- macro(pipeToClosingMustBePropagatedBackward) \
- macro(pipeToShutdownWithAction) \
- macro(pipeToShutdown) \
- macro(pipeToFinalize) \
- macro(readableStreamTee) \
- macro(readableStreamTeePullFunction) \
- macro(readableStreamTeeBranch1CancelFunction) \
- macro(readableStreamTeeBranch2CancelFunction) \
- macro(isReadableStream) \
- macro(isReadableStreamDefaultReader) \
- macro(isReadableStreamDefaultController) \
- macro(readDirectStream) \
- macro(assignToStream) \
- macro(readStreamIntoSink) \
- macro(handleDirectStreamError) \
- macro(handleDirectStreamErrorReject) \
- macro(onPullDirectStream) \
- macro(noopDoneFunction) \
- macro(onReadableStreamDirectControllerClosed) \
- macro(onCloseDirectStream) \
- macro(onFlushDirectStream) \
- macro(createTextStream) \
- macro(initializeTextStream) \
- macro(initializeArrayStream) \
- macro(initializeArrayBufferStream) \
- macro(readableStreamError) \
- macro(readableStreamDefaultControllerShouldCallPull) \
- macro(readableStreamDefaultControllerCallPullIfNeeded) \
- macro(isReadableStreamLocked) \
- macro(readableStreamDefaultControllerGetDesiredSize) \
- macro(readableStreamReaderGenericCancel) \
- macro(readableStreamCancel) \
- macro(readableStreamDefaultControllerCancel) \
- macro(readableStreamDefaultControllerPull) \
- macro(readableStreamDefaultControllerClose) \
- macro(readableStreamClose) \
- macro(readableStreamFulfillReadRequest) \
- macro(readableStreamDefaultControllerEnqueue) \
- macro(readableStreamDefaultReaderRead) \
- macro(readableStreamAddReadRequest) \
- macro(isReadableStreamDisturbed) \
- macro(readableStreamReaderGenericRelease) \
- macro(readableStreamDefaultControllerCanCloseOrEnqueue) \
- macro(lazyLoadStream) \
- macro(readableStreamIntoArray) \
- macro(readableStreamIntoText) \
- macro(readableStreamToArrayBufferDirect) \
- macro(readableStreamToTextDirect) \
- macro(readableStreamToArrayDirect) \
- macro(readableStreamDefineLazyIterators) \
+#define WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \
+ macro(isReadableByteStreamController) \
+ macro(isReadableStreamBYOBReader) \
+ macro(isReadableStreamBYOBRequest) \
+ macro(privateInitializeReadableByteStreamController) \
+ macro(privateInitializeReadableStreamBYOBRequest) \
+ macro(readableByteStreamControllerCallPullIfNeeded) \
+ macro(readableByteStreamControllerCancel) \
+ macro(readableByteStreamControllerClearPendingPullIntos) \
+ macro(readableByteStreamControllerClose) \
+ macro(readableByteStreamControllerCommitDescriptor) \
+ macro(readableByteStreamControllerConvertDescriptor) \
+ macro(readableByteStreamControllerEnqueue) \
+ macro(readableByteStreamControllerEnqueueChunk) \
+ macro(readableByteStreamControllerError) \
+ macro(readableByteStreamControllerFillDescriptorFromQueue) \
+ macro(readableByteStreamControllerGetDesiredSize) \
+ macro(readableByteStreamControllerHandleQueueDrain) \
+ macro(readableByteStreamControllerInvalidateBYOBRequest) \
+ macro(readableByteStreamControllerProcessPullDescriptors) \
+ macro(readableByteStreamControllerPull) \
+ macro(readableByteStreamControllerPullInto) \
+ macro(readableByteStreamControllerRespond) \
+ macro(readableByteStreamControllerRespondInClosedState) \
+ macro(readableByteStreamControllerRespondInReadableState) \
+ macro(readableByteStreamControllerRespondInternal) \
+ macro(readableByteStreamControllerRespondWithNewView) \
+ macro(readableByteStreamControllerShiftPendingDescriptor) \
+ macro(readableByteStreamControllerShouldCallPull) \
+ macro(readableStreamAddReadIntoRequest) \
+ macro(readableStreamBYOBReaderRead) \
+ macro(readableStreamByteStreamControllerStart) \
+ macro(readableStreamFulfillReadIntoRequest) \
+ macro(readableStreamHasBYOBReader) \
+ macro(readableStreamHasDefaultReader) \
+ macro(readableStreamReaderKind) \
+ macro(transferBufferToCurrentRealm) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class ReadableStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner {
+class ReadableByteStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit ReadableStreamInternalsBuiltinsWrapper(JSC::VM& vm)
+ explicit ReadableByteStreamInternalsBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -3311,28 +2286,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* ReadableStreamInternalsBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* ReadableByteStreamInternalsBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -3342,18 +2317,18 @@ inline JSC::UnlinkedFunctionExecutable* ReadableStreamInternalsBuiltinsWrapper::
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void ReadableStreamInternalsBuiltinsWrapper::exportNames()
+inline void ReadableByteStreamInternalsBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-class ReadableStreamInternalsBuiltinFunctions {
+class ReadableByteStreamInternalsBuiltinFunctions {
public:
- explicit ReadableStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
+ explicit ReadableByteStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
void init(JSC::JSGlobalObject&);
template<typename Visitor> void visit(Visitor&);
@@ -3363,103 +2338,257 @@ public:
#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \
JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
- WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
-inline void ReadableStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
+inline void ReadableByteStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
{
#define EXPORT_FUNCTION(codeName, functionName, overriddenName, length) \
m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create(m_vm, codeName##Generator(m_vm), &globalObject));
- WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION)
+ WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION)
#undef EXPORT_FUNCTION
}
template<typename Visitor>
-inline void ReadableStreamInternalsBuiltinFunctions::visit(Visitor& visitor)
+inline void ReadableByteStreamInternalsBuiltinFunctions::visit(Visitor& visitor)
{
#define VISIT_FUNCTION(name) visitor.append(m_##name##Function);
- WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
+ WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
#undef VISIT_FUNCTION
}
-template void ReadableStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&);
-template void ReadableStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&);
- /* TransformStreamDefaultController.ts */
-// initializeTransformStreamDefaultController
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_INITIALIZETRANSFORMSTREAMDEFAULTCONTROLLER 1
-extern const char* const s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCode;
-extern const int s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeLength;
-extern const JSC::ConstructAbility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeImplementationVisibility;
+template void ReadableByteStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&);
+template void ReadableByteStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&);
+ /* ReadableStream.ts */
+// cancel
+#define WEBCORE_BUILTIN_READABLESTREAM_CANCEL 1
+extern const char* const s_readableStreamCancelCode;
+extern const int s_readableStreamCancelCodeLength;
+extern const JSC::ConstructAbility s_readableStreamCancelCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamCancelCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamCancelCodeImplementationVisibility;
-// desiredSize
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_DESIREDSIZE 1
-extern const char* const s_transformStreamDefaultControllerDesiredSizeCode;
-extern const int s_transformStreamDefaultControllerDesiredSizeCodeLength;
-extern const JSC::ConstructAbility s_transformStreamDefaultControllerDesiredSizeCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamDefaultControllerDesiredSizeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerDesiredSizeCodeImplementationVisibility;
+// consumeReadableStream
+#define WEBCORE_BUILTIN_READABLESTREAM_CONSUMEREADABLESTREAM 1
+extern const char* const s_readableStreamConsumeReadableStreamCode;
+extern const int s_readableStreamConsumeReadableStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamConsumeReadableStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamConsumeReadableStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamConsumeReadableStreamCodeImplementationVisibility;
-// enqueue
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_ENQUEUE 1
-extern const char* const s_transformStreamDefaultControllerEnqueueCode;
-extern const int s_transformStreamDefaultControllerEnqueueCodeLength;
-extern const JSC::ConstructAbility s_transformStreamDefaultControllerEnqueueCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamDefaultControllerEnqueueCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerEnqueueCodeImplementationVisibility;
+// createEmptyReadableStream
+#define WEBCORE_BUILTIN_READABLESTREAM_CREATEEMPTYREADABLESTREAM 1
+extern const char* const s_readableStreamCreateEmptyReadableStreamCode;
+extern const int s_readableStreamCreateEmptyReadableStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamCreateEmptyReadableStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamCreateEmptyReadableStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamCreateEmptyReadableStreamCodeImplementationVisibility;
-// error
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_ERROR 1
-extern const char* const s_transformStreamDefaultControllerErrorCode;
-extern const int s_transformStreamDefaultControllerErrorCodeLength;
-extern const JSC::ConstructAbility s_transformStreamDefaultControllerErrorCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamDefaultControllerErrorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerErrorCodeImplementationVisibility;
+// createNativeReadableStream
+#define WEBCORE_BUILTIN_READABLESTREAM_CREATENATIVEREADABLESTREAM 1
+extern const char* const s_readableStreamCreateNativeReadableStreamCode;
+extern const int s_readableStreamCreateNativeReadableStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamCreateNativeReadableStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamCreateNativeReadableStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamCreateNativeReadableStreamCodeImplementationVisibility;
-// terminate
-#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_TERMINATE 1
-extern const char* const s_transformStreamDefaultControllerTerminateCode;
-extern const int s_transformStreamDefaultControllerTerminateCodeLength;
-extern const JSC::ConstructAbility s_transformStreamDefaultControllerTerminateCodeConstructAbility;
-extern const JSC::ConstructorKind s_transformStreamDefaultControllerTerminateCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerTerminateCodeImplementationVisibility;
+// createUsedReadableStream
+#define WEBCORE_BUILTIN_READABLESTREAM_CREATEUSEDREADABLESTREAM 1
+extern const char* const s_readableStreamCreateUsedReadableStreamCode;
+extern const int s_readableStreamCreateUsedReadableStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamCreateUsedReadableStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamCreateUsedReadableStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamCreateUsedReadableStreamCodeImplementationVisibility;
-#define WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_DATA(macro) \
- macro(initializeTransformStreamDefaultController, transformStreamDefaultControllerInitializeTransformStreamDefaultController, 0) \
- macro(desiredSize, transformStreamDefaultControllerDesiredSize, 0) \
- macro(enqueue, transformStreamDefaultControllerEnqueue, 1) \
- macro(error, transformStreamDefaultControllerError, 1) \
- macro(terminate, transformStreamDefaultControllerTerminate, 0) \
+// getReader
+#define WEBCORE_BUILTIN_READABLESTREAM_GETREADER 1
+extern const char* const s_readableStreamGetReaderCode;
+extern const int s_readableStreamGetReaderCodeLength;
+extern const JSC::ConstructAbility s_readableStreamGetReaderCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamGetReaderCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamGetReaderCodeImplementationVisibility;
-#define WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(macro) \
- macro(transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCode, initializeTransformStreamDefaultController, ASCIILiteral(), s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeLength) \
- macro(transformStreamDefaultControllerDesiredSizeCode, desiredSize, "get desiredSize"_s, s_transformStreamDefaultControllerDesiredSizeCodeLength) \
- macro(transformStreamDefaultControllerEnqueueCode, enqueue, ASCIILiteral(), s_transformStreamDefaultControllerEnqueueCodeLength) \
- macro(transformStreamDefaultControllerErrorCode, error, ASCIILiteral(), s_transformStreamDefaultControllerErrorCodeLength) \
- macro(transformStreamDefaultControllerTerminateCode, terminate, ASCIILiteral(), s_transformStreamDefaultControllerTerminateCodeLength) \
+// initializeReadableStream
+#define WEBCORE_BUILTIN_READABLESTREAM_INITIALIZEREADABLESTREAM 1
+extern const char* const s_readableStreamInitializeReadableStreamCode;
+extern const int s_readableStreamInitializeReadableStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInitializeReadableStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInitializeReadableStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInitializeReadableStreamCodeImplementationVisibility;
-#define WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(macro) \
- macro(initializeTransformStreamDefaultController) \
- macro(desiredSize) \
- macro(enqueue) \
- macro(error) \
- macro(terminate) \
+// lazyAsyncIterator
+#define WEBCORE_BUILTIN_READABLESTREAM_LAZYASYNCITERATOR 1
+extern const char* const s_readableStreamLazyAsyncIteratorCode;
+extern const int s_readableStreamLazyAsyncIteratorCodeLength;
+extern const JSC::ConstructAbility s_readableStreamLazyAsyncIteratorCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamLazyAsyncIteratorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamLazyAsyncIteratorCodeImplementationVisibility;
+
+// locked
+#define WEBCORE_BUILTIN_READABLESTREAM_LOCKED 1
+extern const char* const s_readableStreamLockedCode;
+extern const int s_readableStreamLockedCodeLength;
+extern const JSC::ConstructAbility s_readableStreamLockedCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamLockedCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamLockedCodeImplementationVisibility;
+
+// pipeThrough
+#define WEBCORE_BUILTIN_READABLESTREAM_PIPETHROUGH 1
+extern const char* const s_readableStreamPipeThroughCode;
+extern const int s_readableStreamPipeThroughCodeLength;
+extern const JSC::ConstructAbility s_readableStreamPipeThroughCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamPipeThroughCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamPipeThroughCodeImplementationVisibility;
+
+// pipeTo
+#define WEBCORE_BUILTIN_READABLESTREAM_PIPETO 1
+extern const char* const s_readableStreamPipeToCode;
+extern const int s_readableStreamPipeToCodeLength;
+extern const JSC::ConstructAbility s_readableStreamPipeToCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamPipeToCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamPipeToCodeImplementationVisibility;
+
+// readableStreamToArray
+#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOARRAY 1
+extern const char* const s_readableStreamReadableStreamToArrayCode;
+extern const int s_readableStreamReadableStreamToArrayCodeLength;
+extern const JSC::ConstructAbility s_readableStreamReadableStreamToArrayCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamReadableStreamToArrayCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayCodeImplementationVisibility;
+
+// readableStreamToArrayBuffer
+#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOARRAYBUFFER 1
+extern const char* const s_readableStreamReadableStreamToArrayBufferCode;
+extern const int s_readableStreamReadableStreamToArrayBufferCodeLength;
+extern const JSC::ConstructAbility s_readableStreamReadableStreamToArrayBufferCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamReadableStreamToArrayBufferCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayBufferCodeImplementationVisibility;
+
+// readableStreamToBlob
+#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOBLOB 1
+extern const char* const s_readableStreamReadableStreamToBlobCode;
+extern const int s_readableStreamReadableStreamToBlobCodeLength;
+extern const JSC::ConstructAbility s_readableStreamReadableStreamToBlobCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamReadableStreamToBlobCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToBlobCodeImplementationVisibility;
+
+// readableStreamToFormData
+#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOFORMDATA 1
+extern const char* const s_readableStreamReadableStreamToFormDataCode;
+extern const int s_readableStreamReadableStreamToFormDataCodeLength;
+extern const JSC::ConstructAbility s_readableStreamReadableStreamToFormDataCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamReadableStreamToFormDataCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToFormDataCodeImplementationVisibility;
+
+// readableStreamToJSON
+#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOJSON 1
+extern const char* const s_readableStreamReadableStreamToJSONCode;
+extern const int s_readableStreamReadableStreamToJSONCodeLength;
+extern const JSC::ConstructAbility s_readableStreamReadableStreamToJSONCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamReadableStreamToJSONCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToJSONCodeImplementationVisibility;
+
+// readableStreamToText
+#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOTEXT 1
+extern const char* const s_readableStreamReadableStreamToTextCode;
+extern const int s_readableStreamReadableStreamToTextCodeLength;
+extern const JSC::ConstructAbility s_readableStreamReadableStreamToTextCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamReadableStreamToTextCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToTextCodeImplementationVisibility;
+
+// tee
+#define WEBCORE_BUILTIN_READABLESTREAM_TEE 1
+extern const char* const s_readableStreamTeeCode;
+extern const int s_readableStreamTeeCodeLength;
+extern const JSC::ConstructAbility s_readableStreamTeeCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamTeeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamTeeCodeImplementationVisibility;
+
+// values
+#define WEBCORE_BUILTIN_READABLESTREAM_VALUES 1
+extern const char* const s_readableStreamValuesCode;
+extern const int s_readableStreamValuesCodeLength;
+extern const JSC::ConstructAbility s_readableStreamValuesCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamValuesCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamValuesCodeImplementationVisibility;
+
+#define WEBCORE_FOREACH_READABLESTREAM_BUILTIN_DATA(macro) \
+ macro(cancel, readableStreamCancel, 1) \
+ macro(consumeReadableStream, readableStreamConsumeReadableStream, 3) \
+ macro(createEmptyReadableStream, readableStreamCreateEmptyReadableStream, 0) \
+ macro(createNativeReadableStream, readableStreamCreateNativeReadableStream, 3) \
+ macro(createUsedReadableStream, readableStreamCreateUsedReadableStream, 0) \
+ macro(getReader, readableStreamGetReader, 1) \
+ macro(initializeReadableStream, readableStreamInitializeReadableStream, 3) \
+ macro(lazyAsyncIterator, readableStreamLazyAsyncIterator, 0) \
+ macro(locked, readableStreamLocked, 0) \
+ macro(pipeThrough, readableStreamPipeThrough, 2) \
+ macro(pipeTo, readableStreamPipeTo, 1) \
+ macro(readableStreamToArray, readableStreamReadableStreamToArray, 1) \
+ macro(readableStreamToArrayBuffer, readableStreamReadableStreamToArrayBuffer, 1) \
+ macro(readableStreamToBlob, readableStreamReadableStreamToBlob, 1) \
+ macro(readableStreamToFormData, readableStreamReadableStreamToFormData, 3) \
+ macro(readableStreamToJSON, readableStreamReadableStreamToJSON, 1) \
+ macro(readableStreamToText, readableStreamReadableStreamToText, 1) \
+ macro(tee, readableStreamTee, 0) \
+ macro(values, readableStreamValues, 1) \
+
+#define WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(macro) \
+ macro(readableStreamCancelCode, cancel, ASCIILiteral(), s_readableStreamCancelCodeLength) \
+ macro(readableStreamConsumeReadableStreamCode, consumeReadableStream, ASCIILiteral(), s_readableStreamConsumeReadableStreamCodeLength) \
+ macro(readableStreamCreateEmptyReadableStreamCode, createEmptyReadableStream, ASCIILiteral(), s_readableStreamCreateEmptyReadableStreamCodeLength) \
+ macro(readableStreamCreateNativeReadableStreamCode, createNativeReadableStream, ASCIILiteral(), s_readableStreamCreateNativeReadableStreamCodeLength) \
+ macro(readableStreamCreateUsedReadableStreamCode, createUsedReadableStream, ASCIILiteral(), s_readableStreamCreateUsedReadableStreamCodeLength) \
+ macro(readableStreamGetReaderCode, getReader, ASCIILiteral(), s_readableStreamGetReaderCodeLength) \
+ macro(readableStreamInitializeReadableStreamCode, initializeReadableStream, ASCIILiteral(), s_readableStreamInitializeReadableStreamCodeLength) \
+ macro(readableStreamLazyAsyncIteratorCode, lazyAsyncIterator, ASCIILiteral(), s_readableStreamLazyAsyncIteratorCodeLength) \
+ macro(readableStreamLockedCode, locked, "get locked"_s, s_readableStreamLockedCodeLength) \
+ macro(readableStreamPipeThroughCode, pipeThrough, ASCIILiteral(), s_readableStreamPipeThroughCodeLength) \
+ macro(readableStreamPipeToCode, pipeTo, ASCIILiteral(), s_readableStreamPipeToCodeLength) \
+ macro(readableStreamReadableStreamToArrayCode, readableStreamToArray, ASCIILiteral(), s_readableStreamReadableStreamToArrayCodeLength) \
+ macro(readableStreamReadableStreamToArrayBufferCode, readableStreamToArrayBuffer, ASCIILiteral(), s_readableStreamReadableStreamToArrayBufferCodeLength) \
+ macro(readableStreamReadableStreamToBlobCode, readableStreamToBlob, ASCIILiteral(), s_readableStreamReadableStreamToBlobCodeLength) \
+ macro(readableStreamReadableStreamToFormDataCode, readableStreamToFormData, ASCIILiteral(), s_readableStreamReadableStreamToFormDataCodeLength) \
+ macro(readableStreamReadableStreamToJSONCode, readableStreamToJSON, ASCIILiteral(), s_readableStreamReadableStreamToJSONCodeLength) \
+ macro(readableStreamReadableStreamToTextCode, readableStreamToText, ASCIILiteral(), s_readableStreamReadableStreamToTextCodeLength) \
+ macro(readableStreamTeeCode, tee, ASCIILiteral(), s_readableStreamTeeCodeLength) \
+ macro(readableStreamValuesCode, values, ASCIILiteral(), s_readableStreamValuesCodeLength) \
+
+#define WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(macro) \
+ macro(cancel) \
+ macro(consumeReadableStream) \
+ macro(createEmptyReadableStream) \
+ macro(createNativeReadableStream) \
+ macro(createUsedReadableStream) \
+ macro(getReader) \
+ macro(initializeReadableStream) \
+ macro(lazyAsyncIterator) \
+ macro(locked) \
+ macro(pipeThrough) \
+ macro(pipeTo) \
+ macro(readableStreamToArray) \
+ macro(readableStreamToArrayBuffer) \
+ macro(readableStreamToBlob) \
+ macro(readableStreamToFormData) \
+ macro(readableStreamToJSON) \
+ macro(readableStreamToText) \
+ macro(tee) \
+ macro(values) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class TransformStreamDefaultControllerBuiltinsWrapper : private JSC::WeakHandleOwner {
+class ReadableStreamBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit TransformStreamDefaultControllerBuiltinsWrapper(JSC::VM& vm)
+ explicit ReadableStreamBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -3467,28 +2596,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* TransformStreamDefaultControllerBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* ReadableStreamBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -3498,24 +2627,16 @@ inline JSC::UnlinkedFunctionExecutable* TransformStreamDefaultControllerBuiltins
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void TransformStreamDefaultControllerBuiltinsWrapper::exportNames()
+inline void ReadableStreamBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
/* ReadableStreamBYOBReader.ts */
-// initializeReadableStreamBYOBReader
-#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_INITIALIZEREADABLESTREAMBYOBREADER 1
-extern const char* const s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCode;
-extern const int s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeLength;
-extern const JSC::ConstructAbility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeImplementationVisibility;
-
// cancel
#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_CANCEL 1
extern const char* const s_readableStreamBYOBReaderCancelCode;
@@ -3524,6 +2645,22 @@ extern const JSC::ConstructAbility s_readableStreamBYOBReaderCancelCodeConstruct
extern const JSC::ConstructorKind s_readableStreamBYOBReaderCancelCodeConstructorKind;
extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderCancelCodeImplementationVisibility;
+// closed
+#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_CLOSED 1
+extern const char* const s_readableStreamBYOBReaderClosedCode;
+extern const int s_readableStreamBYOBReaderClosedCodeLength;
+extern const JSC::ConstructAbility s_readableStreamBYOBReaderClosedCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamBYOBReaderClosedCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderClosedCodeImplementationVisibility;
+
+// initializeReadableStreamBYOBReader
+#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_INITIALIZEREADABLESTREAMBYOBREADER 1
+extern const char* const s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCode;
+extern const int s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeLength;
+extern const JSC::ConstructAbility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeImplementationVisibility;
+
// read
#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_READ 1
extern const char* const s_readableStreamBYOBReaderReadCode;
@@ -3540,34 +2677,26 @@ extern const JSC::ConstructAbility s_readableStreamBYOBReaderReleaseLockCodeCons
extern const JSC::ConstructorKind s_readableStreamBYOBReaderReleaseLockCodeConstructorKind;
extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderReleaseLockCodeImplementationVisibility;
-// closed
-#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_CLOSED 1
-extern const char* const s_readableStreamBYOBReaderClosedCode;
-extern const int s_readableStreamBYOBReaderClosedCodeLength;
-extern const JSC::ConstructAbility s_readableStreamBYOBReaderClosedCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamBYOBReaderClosedCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderClosedCodeImplementationVisibility;
-
#define WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_DATA(macro) \
- macro(initializeReadableStreamBYOBReader, readableStreamBYOBReaderInitializeReadableStreamBYOBReader, 1) \
macro(cancel, readableStreamBYOBReaderCancel, 1) \
+ macro(closed, readableStreamBYOBReaderClosed, 0) \
+ macro(initializeReadableStreamBYOBReader, readableStreamBYOBReaderInitializeReadableStreamBYOBReader, 1) \
macro(read, readableStreamBYOBReaderRead, 1) \
macro(releaseLock, readableStreamBYOBReaderReleaseLock, 0) \
- macro(closed, readableStreamBYOBReaderClosed, 0) \
#define WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(macro) \
- macro(readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCode, initializeReadableStreamBYOBReader, ASCIILiteral(), s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeLength) \
macro(readableStreamBYOBReaderCancelCode, cancel, ASCIILiteral(), s_readableStreamBYOBReaderCancelCodeLength) \
+ macro(readableStreamBYOBReaderClosedCode, closed, "get closed"_s, s_readableStreamBYOBReaderClosedCodeLength) \
+ macro(readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCode, initializeReadableStreamBYOBReader, ASCIILiteral(), s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeLength) \
macro(readableStreamBYOBReaderReadCode, read, ASCIILiteral(), s_readableStreamBYOBReaderReadCodeLength) \
macro(readableStreamBYOBReaderReleaseLockCode, releaseLock, ASCIILiteral(), s_readableStreamBYOBReaderReleaseLockCodeLength) \
- macro(readableStreamBYOBReaderClosedCode, closed, "get closed"_s, s_readableStreamBYOBReaderClosedCodeLength) \
#define WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_FUNCTION_NAME(macro) \
- macro(initializeReadableStreamBYOBReader) \
macro(cancel) \
+ macro(closed) \
+ macro(initializeReadableStreamBYOBReader) \
macro(read) \
macro(releaseLock) \
- macro(closed) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
@@ -3580,7 +2709,7 @@ public:
explicit ReadableStreamBYOBReaderBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
@@ -3629,48 +2758,70 @@ inline void ReadableStreamBYOBReaderBuiltinsWrapper::exportNames()
WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* JSBufferConstructor.ts */
-// from
-#define WEBCORE_BUILTIN_JSBUFFERCONSTRUCTOR_FROM 1
-extern const char* const s_jsBufferConstructorFromCode;
-extern const int s_jsBufferConstructorFromCodeLength;
-extern const JSC::ConstructAbility s_jsBufferConstructorFromCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferConstructorFromCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferConstructorFromCodeImplementationVisibility;
+/* ReadableStreamBYOBRequest.ts */
+// initializeReadableStreamBYOBRequest
+#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_INITIALIZEREADABLESTREAMBYOBREQUEST 1
+extern const char* const s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCode;
+extern const int s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeLength;
+extern const JSC::ConstructAbility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeImplementationVisibility;
-// isBuffer
-#define WEBCORE_BUILTIN_JSBUFFERCONSTRUCTOR_ISBUFFER 1
-extern const char* const s_jsBufferConstructorIsBufferCode;
-extern const int s_jsBufferConstructorIsBufferCodeLength;
-extern const JSC::ConstructAbility s_jsBufferConstructorIsBufferCodeConstructAbility;
-extern const JSC::ConstructorKind s_jsBufferConstructorIsBufferCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_jsBufferConstructorIsBufferCodeImplementationVisibility;
+// respond
+#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_RESPOND 1
+extern const char* const s_readableStreamBYOBRequestRespondCode;
+extern const int s_readableStreamBYOBRequestRespondCodeLength;
+extern const JSC::ConstructAbility s_readableStreamBYOBRequestRespondCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamBYOBRequestRespondCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondCodeImplementationVisibility;
-#define WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_DATA(macro) \
- macro(from, jsBufferConstructorFrom, 1) \
- macro(isBuffer, jsBufferConstructorIsBuffer, 1) \
+// respondWithNewView
+#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_RESPONDWITHNEWVIEW 1
+extern const char* const s_readableStreamBYOBRequestRespondWithNewViewCode;
+extern const int s_readableStreamBYOBRequestRespondWithNewViewCodeLength;
+extern const JSC::ConstructAbility s_readableStreamBYOBRequestRespondWithNewViewCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamBYOBRequestRespondWithNewViewCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondWithNewViewCodeImplementationVisibility;
-#define WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(macro) \
- macro(jsBufferConstructorFromCode, from, ASCIILiteral(), s_jsBufferConstructorFromCodeLength) \
- macro(jsBufferConstructorIsBufferCode, isBuffer, ASCIILiteral(), s_jsBufferConstructorIsBufferCodeLength) \
+// view
+#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_VIEW 1
+extern const char* const s_readableStreamBYOBRequestViewCode;
+extern const int s_readableStreamBYOBRequestViewCodeLength;
+extern const JSC::ConstructAbility s_readableStreamBYOBRequestViewCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamBYOBRequestViewCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestViewCodeImplementationVisibility;
-#define WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(macro) \
- macro(from) \
- macro(isBuffer) \
+#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_DATA(macro) \
+ macro(initializeReadableStreamBYOBRequest, readableStreamBYOBRequestInitializeReadableStreamBYOBRequest, 2) \
+ macro(respond, readableStreamBYOBRequestRespond, 1) \
+ macro(respondWithNewView, readableStreamBYOBRequestRespondWithNewView, 1) \
+ macro(view, readableStreamBYOBRequestView, 0) \
+
+#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(macro) \
+ macro(readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCode, initializeReadableStreamBYOBRequest, ASCIILiteral(), s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeLength) \
+ macro(readableStreamBYOBRequestRespondCode, respond, ASCIILiteral(), s_readableStreamBYOBRequestRespondCodeLength) \
+ macro(readableStreamBYOBRequestRespondWithNewViewCode, respondWithNewView, ASCIILiteral(), s_readableStreamBYOBRequestRespondWithNewViewCodeLength) \
+ macro(readableStreamBYOBRequestViewCode, view, "get view"_s, s_readableStreamBYOBRequestViewCodeLength) \
+
+#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(macro) \
+ macro(initializeReadableStreamBYOBRequest) \
+ macro(respond) \
+ macro(respondWithNewView) \
+ macro(view) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class JSBufferConstructorBuiltinsWrapper : private JSC::WeakHandleOwner {
+class ReadableStreamBYOBRequestBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit JSBufferConstructorBuiltinsWrapper(JSC::VM& vm)
+ explicit ReadableStreamBYOBRequestBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -3678,28 +2829,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* JSBufferConstructorBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* ReadableStreamBYOBRequestBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -3709,24 +2860,138 @@ inline JSC::UnlinkedFunctionExecutable* JSBufferConstructorBuiltinsWrapper::name
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void JSBufferConstructorBuiltinsWrapper::exportNames()
+inline void ReadableStreamBYOBRequestBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* ReadableStreamDefaultReader.ts */
-// initializeReadableStreamDefaultReader
-#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_INITIALIZEREADABLESTREAMDEFAULTREADER 1
-extern const char* const s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCode;
-extern const int s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeLength;
-extern const JSC::ConstructAbility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeImplementationVisibility;
+/* ReadableStreamDefaultController.ts */
+// close
+#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_CLOSE 1
+extern const char* const s_readableStreamDefaultControllerCloseCode;
+extern const int s_readableStreamDefaultControllerCloseCodeLength;
+extern const JSC::ConstructAbility s_readableStreamDefaultControllerCloseCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamDefaultControllerCloseCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerCloseCodeImplementationVisibility;
+
+// desiredSize
+#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_DESIREDSIZE 1
+extern const char* const s_readableStreamDefaultControllerDesiredSizeCode;
+extern const int s_readableStreamDefaultControllerDesiredSizeCodeLength;
+extern const JSC::ConstructAbility s_readableStreamDefaultControllerDesiredSizeCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamDefaultControllerDesiredSizeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerDesiredSizeCodeImplementationVisibility;
+
+// enqueue
+#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_ENQUEUE 1
+extern const char* const s_readableStreamDefaultControllerEnqueueCode;
+extern const int s_readableStreamDefaultControllerEnqueueCodeLength;
+extern const JSC::ConstructAbility s_readableStreamDefaultControllerEnqueueCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamDefaultControllerEnqueueCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerEnqueueCodeImplementationVisibility;
+
+// error
+#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_ERROR 1
+extern const char* const s_readableStreamDefaultControllerErrorCode;
+extern const int s_readableStreamDefaultControllerErrorCodeLength;
+extern const JSC::ConstructAbility s_readableStreamDefaultControllerErrorCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamDefaultControllerErrorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerErrorCodeImplementationVisibility;
+
+// initializeReadableStreamDefaultController
+#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_INITIALIZEREADABLESTREAMDEFAULTCONTROLLER 1
+extern const char* const s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCode;
+extern const int s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeLength;
+extern const JSC::ConstructAbility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeImplementationVisibility;
+
+#define WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_DATA(macro) \
+ macro(close, readableStreamDefaultControllerClose, 0) \
+ macro(desiredSize, readableStreamDefaultControllerDesiredSize, 0) \
+ macro(enqueue, readableStreamDefaultControllerEnqueue, 1) \
+ macro(error, readableStreamDefaultControllerError, 1) \
+ macro(initializeReadableStreamDefaultController, readableStreamDefaultControllerInitializeReadableStreamDefaultController, 4) \
+
+#define WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(macro) \
+ macro(readableStreamDefaultControllerCloseCode, close, ASCIILiteral(), s_readableStreamDefaultControllerCloseCodeLength) \
+ macro(readableStreamDefaultControllerDesiredSizeCode, desiredSize, "get desiredSize"_s, s_readableStreamDefaultControllerDesiredSizeCodeLength) \
+ macro(readableStreamDefaultControllerEnqueueCode, enqueue, ASCIILiteral(), s_readableStreamDefaultControllerEnqueueCodeLength) \
+ macro(readableStreamDefaultControllerErrorCode, error, ASCIILiteral(), s_readableStreamDefaultControllerErrorCodeLength) \
+ macro(readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCode, initializeReadableStreamDefaultController, ASCIILiteral(), s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeLength) \
+
+#define WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(macro) \
+ macro(close) \
+ macro(desiredSize) \
+ macro(enqueue) \
+ macro(error) \
+ macro(initializeReadableStreamDefaultController) \
+
+#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+ JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
+
+WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+#undef DECLARE_BUILTIN_GENERATOR
+
+class ReadableStreamDefaultControllerBuiltinsWrapper : private JSC::WeakHandleOwner {
+public:
+ explicit ReadableStreamDefaultControllerBuiltinsWrapper(JSC::VM& vm)
+ : m_vm(vm)
+ WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
+ {
+ }
+
+#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
+ JSC::UnlinkedFunctionExecutable* name##Executable(); \
+ const JSC::SourceCode& name##Source() const { return m_##name##Source; }
+ WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+#undef EXPOSE_BUILTIN_EXECUTABLES
+
+ WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+
+ void exportNames();
+
+private:
+ JSC::VM& m_vm;
+ WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+
+#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
+ JSC::SourceCode m_##name##Source;\
+ JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
+ WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+#undef DECLARE_BUILTIN_SOURCE_MEMBERS
+
+};
+
+#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
+inline JSC::UnlinkedFunctionExecutable* ReadableStreamDefaultControllerBuiltinsWrapper::name##Executable() \
+{\
+ if (!m_##name##Executable) {\
+ JSC::Identifier executableName = functionName##PublicName();\
+ if (overriddenName)\
+ executableName = JSC::Identifier::fromString(m_vm, overriddenName);\
+ m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\
+ }\
+ return m_##name##Executable.get();\
+}
+WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+#undef DEFINE_BUILTIN_EXECUTABLES
+
+inline void ReadableStreamDefaultControllerBuiltinsWrapper::exportNames()
+{
+#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
+ WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+#undef EXPORT_FUNCTION_NAME
+}
+/* ReadableStreamDefaultReader.ts */
// cancel
#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_CANCEL 1
extern const char* const s_readableStreamDefaultReaderCancelCode;
@@ -3735,13 +3000,21 @@ extern const JSC::ConstructAbility s_readableStreamDefaultReaderCancelCodeConstr
extern const JSC::ConstructorKind s_readableStreamDefaultReaderCancelCodeConstructorKind;
extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderCancelCodeImplementationVisibility;
-// readMany
-#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_READMANY 1
-extern const char* const s_readableStreamDefaultReaderReadManyCode;
-extern const int s_readableStreamDefaultReaderReadManyCodeLength;
-extern const JSC::ConstructAbility s_readableStreamDefaultReaderReadManyCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamDefaultReaderReadManyCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadManyCodeImplementationVisibility;
+// closed
+#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_CLOSED 1
+extern const char* const s_readableStreamDefaultReaderClosedCode;
+extern const int s_readableStreamDefaultReaderClosedCodeLength;
+extern const JSC::ConstructAbility s_readableStreamDefaultReaderClosedCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamDefaultReaderClosedCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderClosedCodeImplementationVisibility;
+
+// initializeReadableStreamDefaultReader
+#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_INITIALIZEREADABLESTREAMDEFAULTREADER 1
+extern const char* const s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCode;
+extern const int s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeLength;
+extern const JSC::ConstructAbility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeImplementationVisibility;
// read
#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_READ 1
@@ -3751,6 +3024,14 @@ extern const JSC::ConstructAbility s_readableStreamDefaultReaderReadCodeConstruc
extern const JSC::ConstructorKind s_readableStreamDefaultReaderReadCodeConstructorKind;
extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadCodeImplementationVisibility;
+// readMany
+#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_READMANY 1
+extern const char* const s_readableStreamDefaultReaderReadManyCode;
+extern const int s_readableStreamDefaultReaderReadManyCodeLength;
+extern const JSC::ConstructAbility s_readableStreamDefaultReaderReadManyCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamDefaultReaderReadManyCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadManyCodeImplementationVisibility;
+
// releaseLock
#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_RELEASELOCK 1
extern const char* const s_readableStreamDefaultReaderReleaseLockCode;
@@ -3759,37 +3040,29 @@ extern const JSC::ConstructAbility s_readableStreamDefaultReaderReleaseLockCodeC
extern const JSC::ConstructorKind s_readableStreamDefaultReaderReleaseLockCodeConstructorKind;
extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderReleaseLockCodeImplementationVisibility;
-// closed
-#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_CLOSED 1
-extern const char* const s_readableStreamDefaultReaderClosedCode;
-extern const int s_readableStreamDefaultReaderClosedCodeLength;
-extern const JSC::ConstructAbility s_readableStreamDefaultReaderClosedCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamDefaultReaderClosedCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderClosedCodeImplementationVisibility;
-
#define WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_DATA(macro) \
- macro(initializeReadableStreamDefaultReader, readableStreamDefaultReaderInitializeReadableStreamDefaultReader, 1) \
macro(cancel, readableStreamDefaultReaderCancel, 1) \
- macro(readMany, readableStreamDefaultReaderReadMany, 0) \
+ macro(closed, readableStreamDefaultReaderClosed, 0) \
+ macro(initializeReadableStreamDefaultReader, readableStreamDefaultReaderInitializeReadableStreamDefaultReader, 1) \
macro(read, readableStreamDefaultReaderRead, 0) \
+ macro(readMany, readableStreamDefaultReaderReadMany, 0) \
macro(releaseLock, readableStreamDefaultReaderReleaseLock, 0) \
- macro(closed, readableStreamDefaultReaderClosed, 0) \
#define WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(macro) \
- macro(readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCode, initializeReadableStreamDefaultReader, ASCIILiteral(), s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeLength) \
macro(readableStreamDefaultReaderCancelCode, cancel, ASCIILiteral(), s_readableStreamDefaultReaderCancelCodeLength) \
- macro(readableStreamDefaultReaderReadManyCode, readMany, ASCIILiteral(), s_readableStreamDefaultReaderReadManyCodeLength) \
+ macro(readableStreamDefaultReaderClosedCode, closed, "get closed"_s, s_readableStreamDefaultReaderClosedCodeLength) \
+ macro(readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCode, initializeReadableStreamDefaultReader, ASCIILiteral(), s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeLength) \
macro(readableStreamDefaultReaderReadCode, read, ASCIILiteral(), s_readableStreamDefaultReaderReadCodeLength) \
+ macro(readableStreamDefaultReaderReadManyCode, readMany, ASCIILiteral(), s_readableStreamDefaultReaderReadManyCodeLength) \
macro(readableStreamDefaultReaderReleaseLockCode, releaseLock, ASCIILiteral(), s_readableStreamDefaultReaderReleaseLockCodeLength) \
- macro(readableStreamDefaultReaderClosedCode, closed, "get closed"_s, s_readableStreamDefaultReaderClosedCodeLength) \
#define WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_FUNCTION_NAME(macro) \
- macro(initializeReadableStreamDefaultReader) \
macro(cancel) \
- macro(readMany) \
+ macro(closed) \
+ macro(initializeReadableStreamDefaultReader) \
macro(read) \
+ macro(readMany) \
macro(releaseLock) \
- macro(closed) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
@@ -3802,7 +3075,7 @@ public:
explicit ReadableStreamDefaultReaderBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
@@ -3851,71 +3124,812 @@ inline void ReadableStreamDefaultReaderBuiltinsWrapper::exportNames()
WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* StreamInternals.ts */
-// markPromiseAsHandled
-#define WEBCORE_BUILTIN_STREAMINTERNALS_MARKPROMISEASHANDLED 1
-extern const char* const s_streamInternalsMarkPromiseAsHandledCode;
-extern const int s_streamInternalsMarkPromiseAsHandledCodeLength;
-extern const JSC::ConstructAbility s_streamInternalsMarkPromiseAsHandledCodeConstructAbility;
-extern const JSC::ConstructorKind s_streamInternalsMarkPromiseAsHandledCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_streamInternalsMarkPromiseAsHandledCodeImplementationVisibility;
+/* ReadableStreamInternals.ts */
+// acquireReadableStreamDefaultReader
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ACQUIREREADABLESTREAMDEFAULTREADER 1
+extern const char* const s_readableStreamInternalsAcquireReadableStreamDefaultReaderCode;
+extern const int s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeImplementationVisibility;
-// shieldingPromiseResolve
-#define WEBCORE_BUILTIN_STREAMINTERNALS_SHIELDINGPROMISERESOLVE 1
-extern const char* const s_streamInternalsShieldingPromiseResolveCode;
-extern const int s_streamInternalsShieldingPromiseResolveCodeLength;
-extern const JSC::ConstructAbility s_streamInternalsShieldingPromiseResolveCodeConstructAbility;
-extern const JSC::ConstructorKind s_streamInternalsShieldingPromiseResolveCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_streamInternalsShieldingPromiseResolveCodeImplementationVisibility;
+// assignToStream
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ASSIGNTOSTREAM 1
+extern const char* const s_readableStreamInternalsAssignToStreamCode;
+extern const int s_readableStreamInternalsAssignToStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsAssignToStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsAssignToStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsAssignToStreamCodeImplementationVisibility;
-// promiseInvokeOrNoopMethodNoCatch
-#define WEBCORE_BUILTIN_STREAMINTERNALS_PROMISEINVOKEORNOOPMETHODNOCATCH 1
-extern const char* const s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCode;
-extern const int s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeLength;
-extern const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeConstructAbility;
-extern const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeImplementationVisibility;
+// createReadableStreamController
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_CREATEREADABLESTREAMCONTROLLER 1
+extern const char* const s_readableStreamInternalsCreateReadableStreamControllerCode;
+extern const int s_readableStreamInternalsCreateReadableStreamControllerCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsCreateReadableStreamControllerCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsCreateReadableStreamControllerCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsCreateReadableStreamControllerCodeImplementationVisibility;
-// promiseInvokeOrNoopNoCatch
-#define WEBCORE_BUILTIN_STREAMINTERNALS_PROMISEINVOKEORNOOPNOCATCH 1
-extern const char* const s_streamInternalsPromiseInvokeOrNoopNoCatchCode;
-extern const int s_streamInternalsPromiseInvokeOrNoopNoCatchCodeLength;
-extern const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopNoCatchCodeConstructAbility;
-extern const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopNoCatchCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopNoCatchCodeImplementationVisibility;
+// createTextStream
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_CREATETEXTSTREAM 1
+extern const char* const s_readableStreamInternalsCreateTextStreamCode;
+extern const int s_readableStreamInternalsCreateTextStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsCreateTextStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsCreateTextStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsCreateTextStreamCodeImplementationVisibility;
-// promiseInvokeOrNoopMethod
-#define WEBCORE_BUILTIN_STREAMINTERNALS_PROMISEINVOKEORNOOPMETHOD 1
-extern const char* const s_streamInternalsPromiseInvokeOrNoopMethodCode;
-extern const int s_streamInternalsPromiseInvokeOrNoopMethodCodeLength;
-extern const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopMethodCodeConstructAbility;
-extern const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopMethodCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopMethodCodeImplementationVisibility;
+// handleDirectStreamError
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_HANDLEDIRECTSTREAMERROR 1
+extern const char* const s_readableStreamInternalsHandleDirectStreamErrorCode;
+extern const int s_readableStreamInternalsHandleDirectStreamErrorCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorCodeImplementationVisibility;
-// promiseInvokeOrNoop
-#define WEBCORE_BUILTIN_STREAMINTERNALS_PROMISEINVOKEORNOOP 1
-extern const char* const s_streamInternalsPromiseInvokeOrNoopCode;
-extern const int s_streamInternalsPromiseInvokeOrNoopCodeLength;
-extern const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopCodeConstructAbility;
-extern const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopCodeImplementationVisibility;
+// handleDirectStreamErrorReject
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_HANDLEDIRECTSTREAMERRORREJECT 1
+extern const char* const s_readableStreamInternalsHandleDirectStreamErrorRejectCode;
+extern const int s_readableStreamInternalsHandleDirectStreamErrorRejectCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeImplementationVisibility;
-// promiseInvokeOrFallbackOrNoop
-#define WEBCORE_BUILTIN_STREAMINTERNALS_PROMISEINVOKEORFALLBACKORNOOP 1
-extern const char* const s_streamInternalsPromiseInvokeOrFallbackOrNoopCode;
-extern const int s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeLength;
-extern const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeConstructAbility;
-extern const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeImplementationVisibility;
+// initializeArrayBufferStream
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_INITIALIZEARRAYBUFFERSTREAM 1
+extern const char* const s_readableStreamInternalsInitializeArrayBufferStreamCode;
+extern const int s_readableStreamInternalsInitializeArrayBufferStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayBufferStreamCodeImplementationVisibility;
-// validateAndNormalizeQueuingStrategy
-#define WEBCORE_BUILTIN_STREAMINTERNALS_VALIDATEANDNORMALIZEQUEUINGSTRATEGY 1
-extern const char* const s_streamInternalsValidateAndNormalizeQueuingStrategyCode;
-extern const int s_streamInternalsValidateAndNormalizeQueuingStrategyCodeLength;
-extern const JSC::ConstructAbility s_streamInternalsValidateAndNormalizeQueuingStrategyCodeConstructAbility;
-extern const JSC::ConstructorKind s_streamInternalsValidateAndNormalizeQueuingStrategyCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_streamInternalsValidateAndNormalizeQueuingStrategyCodeImplementationVisibility;
+// initializeArrayStream
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_INITIALIZEARRAYSTREAM 1
+extern const char* const s_readableStreamInternalsInitializeArrayStreamCode;
+extern const int s_readableStreamInternalsInitializeArrayStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayStreamCodeImplementationVisibility;
+
+// initializeTextStream
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_INITIALIZETEXTSTREAM 1
+extern const char* const s_readableStreamInternalsInitializeTextStreamCode;
+extern const int s_readableStreamInternalsInitializeTextStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsInitializeTextStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsInitializeTextStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsInitializeTextStreamCodeImplementationVisibility;
+
+// isReadableStream
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAM 1
+extern const char* const s_readableStreamInternalsIsReadableStreamCode;
+extern const int s_readableStreamInternalsIsReadableStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamCodeImplementationVisibility;
+
+// isReadableStreamDefaultController
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMDEFAULTCONTROLLER 1
+extern const char* const s_readableStreamInternalsIsReadableStreamDefaultControllerCode;
+extern const int s_readableStreamInternalsIsReadableStreamDefaultControllerCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultControllerCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultControllerCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultControllerCodeImplementationVisibility;
+
+// isReadableStreamDefaultReader
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMDEFAULTREADER 1
+extern const char* const s_readableStreamInternalsIsReadableStreamDefaultReaderCode;
+extern const int s_readableStreamInternalsIsReadableStreamDefaultReaderCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeImplementationVisibility;
+
+// isReadableStreamDisturbed
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMDISTURBED 1
+extern const char* const s_readableStreamInternalsIsReadableStreamDisturbedCode;
+extern const int s_readableStreamInternalsIsReadableStreamDisturbedCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDisturbedCodeImplementationVisibility;
+
+// isReadableStreamLocked
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMLOCKED 1
+extern const char* const s_readableStreamInternalsIsReadableStreamLockedCode;
+extern const int s_readableStreamInternalsIsReadableStreamLockedCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamLockedCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamLockedCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamLockedCodeImplementationVisibility;
+
+// lazyLoadStream
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_LAZYLOADSTREAM 1
+extern const char* const s_readableStreamInternalsLazyLoadStreamCode;
+extern const int s_readableStreamInternalsLazyLoadStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsLazyLoadStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsLazyLoadStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsLazyLoadStreamCodeImplementationVisibility;
+
+// noopDoneFunction
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_NOOPDONEFUNCTION 1
+extern const char* const s_readableStreamInternalsNoopDoneFunctionCode;
+extern const int s_readableStreamInternalsNoopDoneFunctionCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsNoopDoneFunctionCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsNoopDoneFunctionCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsNoopDoneFunctionCodeImplementationVisibility;
+
+// onCloseDirectStream
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONCLOSEDIRECTSTREAM 1
+extern const char* const s_readableStreamInternalsOnCloseDirectStreamCode;
+extern const int s_readableStreamInternalsOnCloseDirectStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsOnCloseDirectStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsOnCloseDirectStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsOnCloseDirectStreamCodeImplementationVisibility;
+
+// onFlushDirectStream
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONFLUSHDIRECTSTREAM 1
+extern const char* const s_readableStreamInternalsOnFlushDirectStreamCode;
+extern const int s_readableStreamInternalsOnFlushDirectStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsOnFlushDirectStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsOnFlushDirectStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsOnFlushDirectStreamCodeImplementationVisibility;
+
+// onPullDirectStream
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONPULLDIRECTSTREAM 1
+extern const char* const s_readableStreamInternalsOnPullDirectStreamCode;
+extern const int s_readableStreamInternalsOnPullDirectStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsOnPullDirectStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsOnPullDirectStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsOnPullDirectStreamCodeImplementationVisibility;
+
+// onReadableStreamDirectControllerClosed
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONREADABLESTREAMDIRECTCONTROLLERCLOSED 1
+extern const char* const s_readableStreamInternalsOnReadableStreamDirectControllerClosedCode;
+extern const int s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeImplementationVisibility;
+
+// pipeToClosingMustBePropagatedBackward
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOCLOSINGMUSTBEPROPAGATEDBACKWARD 1
+extern const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCode;
+extern const int s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeImplementationVisibility;
+
+// pipeToClosingMustBePropagatedForward
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOCLOSINGMUSTBEPROPAGATEDFORWARD 1
+extern const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCode;
+extern const int s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeImplementationVisibility;
+
+// pipeToDoReadWrite
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETODOREADWRITE 1
+extern const char* const s_readableStreamInternalsPipeToDoReadWriteCode;
+extern const int s_readableStreamInternalsPipeToDoReadWriteCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsPipeToDoReadWriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsPipeToDoReadWriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToDoReadWriteCodeImplementationVisibility;
+
+// pipeToErrorsMustBePropagatedBackward
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOERRORSMUSTBEPROPAGATEDBACKWARD 1
+extern const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode;
+extern const int s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeImplementationVisibility;
+
+// pipeToErrorsMustBePropagatedForward
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOERRORSMUSTBEPROPAGATEDFORWARD 1
+extern const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode;
+extern const int s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeImplementationVisibility;
+
+// pipeToFinalize
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOFINALIZE 1
+extern const char* const s_readableStreamInternalsPipeToFinalizeCode;
+extern const int s_readableStreamInternalsPipeToFinalizeCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsPipeToFinalizeCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsPipeToFinalizeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToFinalizeCodeImplementationVisibility;
+
+// pipeToLoop
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOLOOP 1
+extern const char* const s_readableStreamInternalsPipeToLoopCode;
+extern const int s_readableStreamInternalsPipeToLoopCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsPipeToLoopCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsPipeToLoopCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToLoopCodeImplementationVisibility;
+
+// pipeToShutdown
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOSHUTDOWN 1
+extern const char* const s_readableStreamInternalsPipeToShutdownCode;
+extern const int s_readableStreamInternalsPipeToShutdownCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownCodeImplementationVisibility;
+
+// pipeToShutdownWithAction
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOSHUTDOWNWITHACTION 1
+extern const char* const s_readableStreamInternalsPipeToShutdownWithActionCode;
+extern const int s_readableStreamInternalsPipeToShutdownWithActionCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownWithActionCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownWithActionCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownWithActionCodeImplementationVisibility;
+// privateInitializeReadableStreamDefaultController
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PRIVATEINITIALIZEREADABLESTREAMDEFAULTCONTROLLER 1
+extern const char* const s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCode;
+extern const int s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeImplementationVisibility;
+
+// readableStreamAddReadRequest
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMADDREADREQUEST 1
+extern const char* const s_readableStreamInternalsReadableStreamAddReadRequestCode;
+extern const int s_readableStreamInternalsReadableStreamAddReadRequestCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamAddReadRequestCodeImplementationVisibility;
+
+// readableStreamCancel
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMCANCEL 1
+extern const char* const s_readableStreamInternalsReadableStreamCancelCode;
+extern const int s_readableStreamInternalsReadableStreamCancelCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCancelCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCancelCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCancelCodeImplementationVisibility;
+
+// readableStreamClose
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMCLOSE 1
+extern const char* const s_readableStreamInternalsReadableStreamCloseCode;
+extern const int s_readableStreamInternalsReadableStreamCloseCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCloseCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCloseCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCloseCodeImplementationVisibility;
+
+// readableStreamDefaultControllerCallPullIfNeeded
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCALLPULLIFNEEDED 1
+extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCode;
+extern const int s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeImplementationVisibility;
+
+// readableStreamDefaultControllerCancel
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCANCEL 1
+extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCancelCode;
+extern const int s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeImplementationVisibility;
+
+// readableStreamDefaultControllerCanCloseOrEnqueue
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCANCLOSEORENQUEUE 1
+extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCode;
+extern const int s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeImplementationVisibility;
+
+// readableStreamDefaultControllerClose
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCLOSE 1
+extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCloseCode;
+extern const int s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeImplementationVisibility;
+
+// readableStreamDefaultControllerEnqueue
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERENQUEUE 1
+extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCode;
+extern const int s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeImplementationVisibility;
+
+// readableStreamDefaultControllerError
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERERROR 1
+extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerErrorCode;
+extern const int s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeImplementationVisibility;
+
+// readableStreamDefaultControllerGetDesiredSize
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERGETDESIREDSIZE 1
+extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCode;
+extern const int s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility;
+
+// readableStreamDefaultControllerPull
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERPULL 1
+extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerPullCode;
+extern const int s_readableStreamInternalsReadableStreamDefaultControllerPullCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeImplementationVisibility;
+
+// readableStreamDefaultControllerShouldCallPull
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERSHOULDCALLPULL 1
+extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCode;
+extern const int s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeImplementationVisibility;
+
+// readableStreamDefaultControllerStart
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERSTART 1
+extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerStartCode;
+extern const int s_readableStreamInternalsReadableStreamDefaultControllerStartCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeImplementationVisibility;
+
+// readableStreamDefaultReaderRead
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTREADERREAD 1
+extern const char* const s_readableStreamInternalsReadableStreamDefaultReaderReadCode;
+extern const int s_readableStreamInternalsReadableStreamDefaultReaderReadCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeImplementationVisibility;
+
+// readableStreamDefineLazyIterators
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFINELAZYITERATORS 1
+extern const char* const s_readableStreamInternalsReadableStreamDefineLazyIteratorsCode;
+extern const int s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeImplementationVisibility;
+
+// readableStreamError
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMERROR 1
+extern const char* const s_readableStreamInternalsReadableStreamErrorCode;
+extern const int s_readableStreamInternalsReadableStreamErrorCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamErrorCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamErrorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamErrorCodeImplementationVisibility;
+
+// readableStreamFulfillReadRequest
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMFULFILLREADREQUEST 1
+extern const char* const s_readableStreamInternalsReadableStreamFulfillReadRequestCode;
+extern const int s_readableStreamInternalsReadableStreamFulfillReadRequestCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeImplementationVisibility;
+
+// readableStreamIntoArray
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMINTOARRAY 1
+extern const char* const s_readableStreamInternalsReadableStreamIntoArrayCode;
+extern const int s_readableStreamInternalsReadableStreamIntoArrayCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoArrayCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoArrayCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoArrayCodeImplementationVisibility;
+
+// readableStreamIntoText
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMINTOTEXT 1
+extern const char* const s_readableStreamInternalsReadableStreamIntoTextCode;
+extern const int s_readableStreamInternalsReadableStreamIntoTextCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoTextCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoTextCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoTextCodeImplementationVisibility;
+
+// readableStreamPipeTo
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMPIPETO 1
+extern const char* const s_readableStreamInternalsReadableStreamPipeToCode;
+extern const int s_readableStreamInternalsReadableStreamPipeToCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToCodeImplementationVisibility;
+
+// readableStreamPipeToWritableStream
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMPIPETOWRITABLESTREAM 1
+extern const char* const s_readableStreamInternalsReadableStreamPipeToWritableStreamCode;
+extern const int s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeImplementationVisibility;
+
+// readableStreamReaderGenericCancel
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMREADERGENERICCANCEL 1
+extern const char* const s_readableStreamInternalsReadableStreamReaderGenericCancelCode;
+extern const int s_readableStreamInternalsReadableStreamReaderGenericCancelCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeImplementationVisibility;
+
+// readableStreamReaderGenericInitialize
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMREADERGENERICINITIALIZE 1
+extern const char* const s_readableStreamInternalsReadableStreamReaderGenericInitializeCode;
+extern const int s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeImplementationVisibility;
+
+// readableStreamReaderGenericRelease
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMREADERGENERICRELEASE 1
+extern const char* const s_readableStreamInternalsReadableStreamReaderGenericReleaseCode;
+extern const int s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeImplementationVisibility;
+
+// readableStreamTee
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEE 1
+extern const char* const s_readableStreamInternalsReadableStreamTeeCode;
+extern const int s_readableStreamInternalsReadableStreamTeeCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeCodeImplementationVisibility;
+
+// readableStreamTeeBranch1CancelFunction
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEEBRANCH1CANCELFUNCTION 1
+extern const char* const s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode;
+extern const int s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeImplementationVisibility;
+
+// readableStreamTeeBranch2CancelFunction
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEEBRANCH2CANCELFUNCTION 1
+extern const char* const s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode;
+extern const int s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeImplementationVisibility;
+
+// readableStreamTeePullFunction
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEEPULLFUNCTION 1
+extern const char* const s_readableStreamInternalsReadableStreamTeePullFunctionCode;
+extern const int s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeePullFunctionCodeImplementationVisibility;
+
+// readableStreamToArrayBufferDirect
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTOARRAYBUFFERDIRECT 1
+extern const char* const s_readableStreamInternalsReadableStreamToArrayBufferDirectCode;
+extern const int s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeImplementationVisibility;
+
+// readableStreamToArrayDirect
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTOARRAYDIRECT 1
+extern const char* const s_readableStreamInternalsReadableStreamToArrayDirectCode;
+extern const int s_readableStreamInternalsReadableStreamToArrayDirectCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayDirectCodeImplementationVisibility;
+
+// readableStreamToTextDirect
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTOTEXTDIRECT 1
+extern const char* const s_readableStreamInternalsReadableStreamToTextDirectCode;
+extern const int s_readableStreamInternalsReadableStreamToTextDirectCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToTextDirectCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToTextDirectCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToTextDirectCodeImplementationVisibility;
+
+// readDirectStream
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READDIRECTSTREAM 1
+extern const char* const s_readableStreamInternalsReadDirectStreamCode;
+extern const int s_readableStreamInternalsReadDirectStreamCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadDirectStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadDirectStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadDirectStreamCodeImplementationVisibility;
+
+// readStreamIntoSink
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READSTREAMINTOSINK 1
+extern const char* const s_readableStreamInternalsReadStreamIntoSinkCode;
+extern const int s_readableStreamInternalsReadStreamIntoSinkCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsReadStreamIntoSinkCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsReadStreamIntoSinkCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsReadStreamIntoSinkCodeImplementationVisibility;
+
+// setupReadableStreamDefaultController
+#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_SETUPREADABLESTREAMDEFAULTCONTROLLER 1
+extern const char* const s_readableStreamInternalsSetupReadableStreamDefaultControllerCode;
+extern const int s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeLength;
+extern const JSC::ConstructAbility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructAbility;
+extern const JSC::ConstructorKind s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeImplementationVisibility;
+
+#define WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_DATA(macro) \
+ macro(acquireReadableStreamDefaultReader, readableStreamInternalsAcquireReadableStreamDefaultReader, 1) \
+ macro(assignToStream, readableStreamInternalsAssignToStream, 2) \
+ macro(createReadableStreamController, readableStreamInternalsCreateReadableStreamController, 3) \
+ macro(createTextStream, readableStreamInternalsCreateTextStream, 1) \
+ macro(handleDirectStreamError, readableStreamInternalsHandleDirectStreamError, 1) \
+ macro(handleDirectStreamErrorReject, readableStreamInternalsHandleDirectStreamErrorReject, 1) \
+ macro(initializeArrayBufferStream, readableStreamInternalsInitializeArrayBufferStream, 2) \
+ macro(initializeArrayStream, readableStreamInternalsInitializeArrayStream, 2) \
+ macro(initializeTextStream, readableStreamInternalsInitializeTextStream, 2) \
+ macro(isReadableStream, readableStreamInternalsIsReadableStream, 1) \
+ macro(isReadableStreamDefaultController, readableStreamInternalsIsReadableStreamDefaultController, 1) \
+ macro(isReadableStreamDefaultReader, readableStreamInternalsIsReadableStreamDefaultReader, 1) \
+ macro(isReadableStreamDisturbed, readableStreamInternalsIsReadableStreamDisturbed, 1) \
+ macro(isReadableStreamLocked, readableStreamInternalsIsReadableStreamLocked, 1) \
+ macro(lazyLoadStream, readableStreamInternalsLazyLoadStream, 2) \
+ macro(noopDoneFunction, readableStreamInternalsNoopDoneFunction, 0) \
+ macro(onCloseDirectStream, readableStreamInternalsOnCloseDirectStream, 1) \
+ macro(onFlushDirectStream, readableStreamInternalsOnFlushDirectStream, 0) \
+ macro(onPullDirectStream, readableStreamInternalsOnPullDirectStream, 1) \
+ macro(onReadableStreamDirectControllerClosed, readableStreamInternalsOnReadableStreamDirectControllerClosed, 1) \
+ macro(pipeToClosingMustBePropagatedBackward, readableStreamInternalsPipeToClosingMustBePropagatedBackward, 1) \
+ macro(pipeToClosingMustBePropagatedForward, readableStreamInternalsPipeToClosingMustBePropagatedForward, 1) \
+ macro(pipeToDoReadWrite, readableStreamInternalsPipeToDoReadWrite, 1) \
+ macro(pipeToErrorsMustBePropagatedBackward, readableStreamInternalsPipeToErrorsMustBePropagatedBackward, 1) \
+ macro(pipeToErrorsMustBePropagatedForward, readableStreamInternalsPipeToErrorsMustBePropagatedForward, 1) \
+ macro(pipeToFinalize, readableStreamInternalsPipeToFinalize, 1) \
+ macro(pipeToLoop, readableStreamInternalsPipeToLoop, 1) \
+ macro(pipeToShutdown, readableStreamInternalsPipeToShutdown, 1) \
+ macro(pipeToShutdownWithAction, readableStreamInternalsPipeToShutdownWithAction, 2) \
+ macro(privateInitializeReadableStreamDefaultController, readableStreamInternalsPrivateInitializeReadableStreamDefaultController, 4) \
+ macro(readableStreamAddReadRequest, readableStreamInternalsReadableStreamAddReadRequest, 1) \
+ macro(readableStreamCancel, readableStreamInternalsReadableStreamCancel, 2) \
+ macro(readableStreamClose, readableStreamInternalsReadableStreamClose, 1) \
+ macro(readableStreamDefaultControllerCallPullIfNeeded, readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeeded, 1) \
+ macro(readableStreamDefaultControllerCancel, readableStreamInternalsReadableStreamDefaultControllerCancel, 2) \
+ macro(readableStreamDefaultControllerCanCloseOrEnqueue, readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueue, 1) \
+ macro(readableStreamDefaultControllerClose, readableStreamInternalsReadableStreamDefaultControllerClose, 1) \
+ macro(readableStreamDefaultControllerEnqueue, readableStreamInternalsReadableStreamDefaultControllerEnqueue, 2) \
+ macro(readableStreamDefaultControllerError, readableStreamInternalsReadableStreamDefaultControllerError, 2) \
+ macro(readableStreamDefaultControllerGetDesiredSize, readableStreamInternalsReadableStreamDefaultControllerGetDesiredSize, 1) \
+ macro(readableStreamDefaultControllerPull, readableStreamInternalsReadableStreamDefaultControllerPull, 1) \
+ macro(readableStreamDefaultControllerShouldCallPull, readableStreamInternalsReadableStreamDefaultControllerShouldCallPull, 1) \
+ macro(readableStreamDefaultControllerStart, readableStreamInternalsReadableStreamDefaultControllerStart, 1) \
+ macro(readableStreamDefaultReaderRead, readableStreamInternalsReadableStreamDefaultReaderRead, 1) \
+ macro(readableStreamDefineLazyIterators, readableStreamInternalsReadableStreamDefineLazyIterators, 1) \
+ macro(readableStreamError, readableStreamInternalsReadableStreamError, 2) \
+ macro(readableStreamFulfillReadRequest, readableStreamInternalsReadableStreamFulfillReadRequest, 3) \
+ macro(readableStreamIntoArray, readableStreamInternalsReadableStreamIntoArray, 1) \
+ macro(readableStreamIntoText, readableStreamInternalsReadableStreamIntoText, 1) \
+ macro(readableStreamPipeTo, readableStreamInternalsReadableStreamPipeTo, 2) \
+ macro(readableStreamPipeToWritableStream, readableStreamInternalsReadableStreamPipeToWritableStream, 7) \
+ macro(readableStreamReaderGenericCancel, readableStreamInternalsReadableStreamReaderGenericCancel, 2) \
+ macro(readableStreamReaderGenericInitialize, readableStreamInternalsReadableStreamReaderGenericInitialize, 2) \
+ macro(readableStreamReaderGenericRelease, readableStreamInternalsReadableStreamReaderGenericRelease, 1) \
+ macro(readableStreamTee, readableStreamInternalsReadableStreamTee, 2) \
+ macro(readableStreamTeeBranch1CancelFunction, readableStreamInternalsReadableStreamTeeBranch1CancelFunction, 2) \
+ macro(readableStreamTeeBranch2CancelFunction, readableStreamInternalsReadableStreamTeeBranch2CancelFunction, 2) \
+ macro(readableStreamTeePullFunction, readableStreamInternalsReadableStreamTeePullFunction, 3) \
+ macro(readableStreamToArrayBufferDirect, readableStreamInternalsReadableStreamToArrayBufferDirect, 2) \
+ macro(readableStreamToArrayDirect, readableStreamInternalsReadableStreamToArrayDirect, 2) \
+ macro(readableStreamToTextDirect, readableStreamInternalsReadableStreamToTextDirect, 2) \
+ macro(readDirectStream, readableStreamInternalsReadDirectStream, 3) \
+ macro(readStreamIntoSink, readableStreamInternalsReadStreamIntoSink, 3) \
+ macro(setupReadableStreamDefaultController, readableStreamInternalsSetupReadableStreamDefaultController, 8) \
+
+#define WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(macro) \
+ macro(readableStreamInternalsAcquireReadableStreamDefaultReaderCode, acquireReadableStreamDefaultReader, ASCIILiteral(), s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeLength) \
+ macro(readableStreamInternalsAssignToStreamCode, assignToStream, ASCIILiteral(), s_readableStreamInternalsAssignToStreamCodeLength) \
+ macro(readableStreamInternalsCreateReadableStreamControllerCode, createReadableStreamController, ASCIILiteral(), s_readableStreamInternalsCreateReadableStreamControllerCodeLength) \
+ macro(readableStreamInternalsCreateTextStreamCode, createTextStream, ASCIILiteral(), s_readableStreamInternalsCreateTextStreamCodeLength) \
+ macro(readableStreamInternalsHandleDirectStreamErrorCode, handleDirectStreamError, ASCIILiteral(), s_readableStreamInternalsHandleDirectStreamErrorCodeLength) \
+ macro(readableStreamInternalsHandleDirectStreamErrorRejectCode, handleDirectStreamErrorReject, ASCIILiteral(), s_readableStreamInternalsHandleDirectStreamErrorRejectCodeLength) \
+ macro(readableStreamInternalsInitializeArrayBufferStreamCode, initializeArrayBufferStream, ASCIILiteral(), s_readableStreamInternalsInitializeArrayBufferStreamCodeLength) \
+ macro(readableStreamInternalsInitializeArrayStreamCode, initializeArrayStream, ASCIILiteral(), s_readableStreamInternalsInitializeArrayStreamCodeLength) \
+ macro(readableStreamInternalsInitializeTextStreamCode, initializeTextStream, ASCIILiteral(), s_readableStreamInternalsInitializeTextStreamCodeLength) \
+ macro(readableStreamInternalsIsReadableStreamCode, isReadableStream, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamCodeLength) \
+ macro(readableStreamInternalsIsReadableStreamDefaultControllerCode, isReadableStreamDefaultController, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamDefaultControllerCodeLength) \
+ macro(readableStreamInternalsIsReadableStreamDefaultReaderCode, isReadableStreamDefaultReader, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamDefaultReaderCodeLength) \
+ macro(readableStreamInternalsIsReadableStreamDisturbedCode, isReadableStreamDisturbed, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamDisturbedCodeLength) \
+ macro(readableStreamInternalsIsReadableStreamLockedCode, isReadableStreamLocked, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamLockedCodeLength) \
+ macro(readableStreamInternalsLazyLoadStreamCode, lazyLoadStream, ASCIILiteral(), s_readableStreamInternalsLazyLoadStreamCodeLength) \
+ macro(readableStreamInternalsNoopDoneFunctionCode, noopDoneFunction, ASCIILiteral(), s_readableStreamInternalsNoopDoneFunctionCodeLength) \
+ macro(readableStreamInternalsOnCloseDirectStreamCode, onCloseDirectStream, ASCIILiteral(), s_readableStreamInternalsOnCloseDirectStreamCodeLength) \
+ macro(readableStreamInternalsOnFlushDirectStreamCode, onFlushDirectStream, ASCIILiteral(), s_readableStreamInternalsOnFlushDirectStreamCodeLength) \
+ macro(readableStreamInternalsOnPullDirectStreamCode, onPullDirectStream, ASCIILiteral(), s_readableStreamInternalsOnPullDirectStreamCodeLength) \
+ macro(readableStreamInternalsOnReadableStreamDirectControllerClosedCode, onReadableStreamDirectControllerClosed, ASCIILiteral(), s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeLength) \
+ macro(readableStreamInternalsPipeToClosingMustBePropagatedBackwardCode, pipeToClosingMustBePropagatedBackward, ASCIILiteral(), s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeLength) \
+ macro(readableStreamInternalsPipeToClosingMustBePropagatedForwardCode, pipeToClosingMustBePropagatedForward, ASCIILiteral(), s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeLength) \
+ macro(readableStreamInternalsPipeToDoReadWriteCode, pipeToDoReadWrite, ASCIILiteral(), s_readableStreamInternalsPipeToDoReadWriteCodeLength) \
+ macro(readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode, pipeToErrorsMustBePropagatedBackward, ASCIILiteral(), s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeLength) \
+ macro(readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode, pipeToErrorsMustBePropagatedForward, ASCIILiteral(), s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeLength) \
+ macro(readableStreamInternalsPipeToFinalizeCode, pipeToFinalize, ASCIILiteral(), s_readableStreamInternalsPipeToFinalizeCodeLength) \
+ macro(readableStreamInternalsPipeToLoopCode, pipeToLoop, ASCIILiteral(), s_readableStreamInternalsPipeToLoopCodeLength) \
+ macro(readableStreamInternalsPipeToShutdownCode, pipeToShutdown, ASCIILiteral(), s_readableStreamInternalsPipeToShutdownCodeLength) \
+ macro(readableStreamInternalsPipeToShutdownWithActionCode, pipeToShutdownWithAction, ASCIILiteral(), s_readableStreamInternalsPipeToShutdownWithActionCodeLength) \
+ macro(readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCode, privateInitializeReadableStreamDefaultController, ASCIILiteral(), s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeLength) \
+ macro(readableStreamInternalsReadableStreamAddReadRequestCode, readableStreamAddReadRequest, ASCIILiteral(), s_readableStreamInternalsReadableStreamAddReadRequestCodeLength) \
+ macro(readableStreamInternalsReadableStreamCancelCode, readableStreamCancel, ASCIILiteral(), s_readableStreamInternalsReadableStreamCancelCodeLength) \
+ macro(readableStreamInternalsReadableStreamCloseCode, readableStreamClose, ASCIILiteral(), s_readableStreamInternalsReadableStreamCloseCodeLength) \
+ macro(readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCode, readableStreamDefaultControllerCallPullIfNeeded, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeLength) \
+ macro(readableStreamInternalsReadableStreamDefaultControllerCancelCode, readableStreamDefaultControllerCancel, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeLength) \
+ macro(readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCode, readableStreamDefaultControllerCanCloseOrEnqueue, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeLength) \
+ macro(readableStreamInternalsReadableStreamDefaultControllerCloseCode, readableStreamDefaultControllerClose, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeLength) \
+ macro(readableStreamInternalsReadableStreamDefaultControllerEnqueueCode, readableStreamDefaultControllerEnqueue, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeLength) \
+ macro(readableStreamInternalsReadableStreamDefaultControllerErrorCode, readableStreamDefaultControllerError, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeLength) \
+ macro(readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCode, readableStreamDefaultControllerGetDesiredSize, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeLength) \
+ macro(readableStreamInternalsReadableStreamDefaultControllerPullCode, readableStreamDefaultControllerPull, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerPullCodeLength) \
+ macro(readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCode, readableStreamDefaultControllerShouldCallPull, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeLength) \
+ macro(readableStreamInternalsReadableStreamDefaultControllerStartCode, readableStreamDefaultControllerStart, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerStartCodeLength) \
+ macro(readableStreamInternalsReadableStreamDefaultReaderReadCode, readableStreamDefaultReaderRead, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultReaderReadCodeLength) \
+ macro(readableStreamInternalsReadableStreamDefineLazyIteratorsCode, readableStreamDefineLazyIterators, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeLength) \
+ macro(readableStreamInternalsReadableStreamErrorCode, readableStreamError, ASCIILiteral(), s_readableStreamInternalsReadableStreamErrorCodeLength) \
+ macro(readableStreamInternalsReadableStreamFulfillReadRequestCode, readableStreamFulfillReadRequest, ASCIILiteral(), s_readableStreamInternalsReadableStreamFulfillReadRequestCodeLength) \
+ macro(readableStreamInternalsReadableStreamIntoArrayCode, readableStreamIntoArray, ASCIILiteral(), s_readableStreamInternalsReadableStreamIntoArrayCodeLength) \
+ macro(readableStreamInternalsReadableStreamIntoTextCode, readableStreamIntoText, ASCIILiteral(), s_readableStreamInternalsReadableStreamIntoTextCodeLength) \
+ macro(readableStreamInternalsReadableStreamPipeToCode, readableStreamPipeTo, ASCIILiteral(), s_readableStreamInternalsReadableStreamPipeToCodeLength) \
+ macro(readableStreamInternalsReadableStreamPipeToWritableStreamCode, readableStreamPipeToWritableStream, ASCIILiteral(), s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength) \
+ macro(readableStreamInternalsReadableStreamReaderGenericCancelCode, readableStreamReaderGenericCancel, ASCIILiteral(), s_readableStreamInternalsReadableStreamReaderGenericCancelCodeLength) \
+ macro(readableStreamInternalsReadableStreamReaderGenericInitializeCode, readableStreamReaderGenericInitialize, ASCIILiteral(), s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength) \
+ macro(readableStreamInternalsReadableStreamReaderGenericReleaseCode, readableStreamReaderGenericRelease, ASCIILiteral(), s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeLength) \
+ macro(readableStreamInternalsReadableStreamTeeCode, readableStreamTee, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeeCodeLength) \
+ macro(readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode, readableStreamTeeBranch1CancelFunction, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength) \
+ macro(readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode, readableStreamTeeBranch2CancelFunction, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeLength) \
+ macro(readableStreamInternalsReadableStreamTeePullFunctionCode, readableStreamTeePullFunction, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength) \
+ macro(readableStreamInternalsReadableStreamToArrayBufferDirectCode, readableStreamToArrayBufferDirect, ASCIILiteral(), s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeLength) \
+ macro(readableStreamInternalsReadableStreamToArrayDirectCode, readableStreamToArrayDirect, ASCIILiteral(), s_readableStreamInternalsReadableStreamToArrayDirectCodeLength) \
+ macro(readableStreamInternalsReadableStreamToTextDirectCode, readableStreamToTextDirect, ASCIILiteral(), s_readableStreamInternalsReadableStreamToTextDirectCodeLength) \
+ macro(readableStreamInternalsReadDirectStreamCode, readDirectStream, ASCIILiteral(), s_readableStreamInternalsReadDirectStreamCodeLength) \
+ macro(readableStreamInternalsReadStreamIntoSinkCode, readStreamIntoSink, ASCIILiteral(), s_readableStreamInternalsReadStreamIntoSinkCodeLength) \
+ macro(readableStreamInternalsSetupReadableStreamDefaultControllerCode, setupReadableStreamDefaultController, ASCIILiteral(), s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeLength) \
+
+#define WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \
+ macro(acquireReadableStreamDefaultReader) \
+ macro(assignToStream) \
+ macro(createReadableStreamController) \
+ macro(createTextStream) \
+ macro(handleDirectStreamError) \
+ macro(handleDirectStreamErrorReject) \
+ macro(initializeArrayBufferStream) \
+ macro(initializeArrayStream) \
+ macro(initializeTextStream) \
+ macro(isReadableStream) \
+ macro(isReadableStreamDefaultController) \
+ macro(isReadableStreamDefaultReader) \
+ macro(isReadableStreamDisturbed) \
+ macro(isReadableStreamLocked) \
+ macro(lazyLoadStream) \
+ macro(noopDoneFunction) \
+ macro(onCloseDirectStream) \
+ macro(onFlushDirectStream) \
+ macro(onPullDirectStream) \
+ macro(onReadableStreamDirectControllerClosed) \
+ macro(pipeToClosingMustBePropagatedBackward) \
+ macro(pipeToClosingMustBePropagatedForward) \
+ macro(pipeToDoReadWrite) \
+ macro(pipeToErrorsMustBePropagatedBackward) \
+ macro(pipeToErrorsMustBePropagatedForward) \
+ macro(pipeToFinalize) \
+ macro(pipeToLoop) \
+ macro(pipeToShutdown) \
+ macro(pipeToShutdownWithAction) \
+ macro(privateInitializeReadableStreamDefaultController) \
+ macro(readableStreamAddReadRequest) \
+ macro(readableStreamCancel) \
+ macro(readableStreamClose) \
+ macro(readableStreamDefaultControllerCallPullIfNeeded) \
+ macro(readableStreamDefaultControllerCancel) \
+ macro(readableStreamDefaultControllerCanCloseOrEnqueue) \
+ macro(readableStreamDefaultControllerClose) \
+ macro(readableStreamDefaultControllerEnqueue) \
+ macro(readableStreamDefaultControllerError) \
+ macro(readableStreamDefaultControllerGetDesiredSize) \
+ macro(readableStreamDefaultControllerPull) \
+ macro(readableStreamDefaultControllerShouldCallPull) \
+ macro(readableStreamDefaultControllerStart) \
+ macro(readableStreamDefaultReaderRead) \
+ macro(readableStreamDefineLazyIterators) \
+ macro(readableStreamError) \
+ macro(readableStreamFulfillReadRequest) \
+ macro(readableStreamIntoArray) \
+ macro(readableStreamIntoText) \
+ macro(readableStreamPipeTo) \
+ macro(readableStreamPipeToWritableStream) \
+ macro(readableStreamReaderGenericCancel) \
+ macro(readableStreamReaderGenericInitialize) \
+ macro(readableStreamReaderGenericRelease) \
+ macro(readableStreamTee) \
+ macro(readableStreamTeeBranch1CancelFunction) \
+ macro(readableStreamTeeBranch2CancelFunction) \
+ macro(readableStreamTeePullFunction) \
+ macro(readableStreamToArrayBufferDirect) \
+ macro(readableStreamToArrayDirect) \
+ macro(readableStreamToTextDirect) \
+ macro(readDirectStream) \
+ macro(readStreamIntoSink) \
+ macro(setupReadableStreamDefaultController) \
+
+#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+ JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
+
+WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+#undef DECLARE_BUILTIN_GENERATOR
+
+class ReadableStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner {
+public:
+ explicit ReadableStreamInternalsBuiltinsWrapper(JSC::VM& vm)
+ : m_vm(vm)
+ WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
+ {
+ }
+
+#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
+ JSC::UnlinkedFunctionExecutable* name##Executable(); \
+ const JSC::SourceCode& name##Source() const { return m_##name##Source; }
+ WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+#undef EXPOSE_BUILTIN_EXECUTABLES
+
+ WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+
+ void exportNames();
+
+private:
+ JSC::VM& m_vm;
+
+ WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+
+#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
+ JSC::SourceCode m_##name##Source;\
+ JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
+ WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+#undef DECLARE_BUILTIN_SOURCE_MEMBERS
+
+};
+
+#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
+inline JSC::UnlinkedFunctionExecutable* ReadableStreamInternalsBuiltinsWrapper::name##Executable() \
+{\
+ if (!m_##name##Executable) {\
+ JSC::Identifier executableName = functionName##PublicName();\
+ if (overriddenName)\
+ executableName = JSC::Identifier::fromString(m_vm, overriddenName);\
+ m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\
+ }\
+ return m_##name##Executable.get();\
+}
+WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+#undef DEFINE_BUILTIN_EXECUTABLES
+
+inline void ReadableStreamInternalsBuiltinsWrapper::exportNames()
+{
+#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
+ WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+#undef EXPORT_FUNCTION_NAME
+}
+class ReadableStreamInternalsBuiltinFunctions {
+public:
+ explicit ReadableStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
+
+ void init(JSC::JSGlobalObject&);
+ template<typename Visitor> void visit(Visitor&);
+
+public:
+ JSC::VM& m_vm;
+
+#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \
+ JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
+ WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
+#undef DECLARE_BUILTIN_SOURCE_MEMBERS
+};
+
+inline void ReadableStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
+{
+#define EXPORT_FUNCTION(codeName, functionName, overriddenName, length) \
+ m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create(m_vm, codeName##Generator(m_vm), &globalObject));
+ WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION)
+#undef EXPORT_FUNCTION
+}
+
+template<typename Visitor>
+inline void ReadableStreamInternalsBuiltinFunctions::visit(Visitor& visitor)
+{
+#define VISIT_FUNCTION(name) visitor.append(m_##name##Function);
+ WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
+#undef VISIT_FUNCTION
+}
+
+template void ReadableStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&);
+template void ReadableStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&);
+ /* StreamInternals.ts */
// createFIFO
#define WEBCORE_BUILTIN_STREAMINTERNALS_CREATEFIFO 1
extern const char* const s_streamInternalsCreateFIFOCode;
@@ -3924,13 +3938,13 @@ extern const JSC::ConstructAbility s_streamInternalsCreateFIFOCodeConstructAbili
extern const JSC::ConstructorKind s_streamInternalsCreateFIFOCodeConstructorKind;
extern const JSC::ImplementationVisibility s_streamInternalsCreateFIFOCodeImplementationVisibility;
-// newQueue
-#define WEBCORE_BUILTIN_STREAMINTERNALS_NEWQUEUE 1
-extern const char* const s_streamInternalsNewQueueCode;
-extern const int s_streamInternalsNewQueueCodeLength;
-extern const JSC::ConstructAbility s_streamInternalsNewQueueCodeConstructAbility;
-extern const JSC::ConstructorKind s_streamInternalsNewQueueCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_streamInternalsNewQueueCodeImplementationVisibility;
+// createFulfilledPromise
+#define WEBCORE_BUILTIN_STREAMINTERNALS_CREATEFULFILLEDPROMISE 1
+extern const char* const s_streamInternalsCreateFulfilledPromiseCode;
+extern const int s_streamInternalsCreateFulfilledPromiseCodeLength;
+extern const JSC::ConstructAbility s_streamInternalsCreateFulfilledPromiseCodeConstructAbility;
+extern const JSC::ConstructorKind s_streamInternalsCreateFulfilledPromiseCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_streamInternalsCreateFulfilledPromiseCodeImplementationVisibility;
// dequeueValue
#define WEBCORE_BUILTIN_STREAMINTERNALS_DEQUEUEVALUE 1
@@ -3948,30 +3962,6 @@ extern const JSC::ConstructAbility s_streamInternalsEnqueueValueWithSizeCodeCons
extern const JSC::ConstructorKind s_streamInternalsEnqueueValueWithSizeCodeConstructorKind;
extern const JSC::ImplementationVisibility s_streamInternalsEnqueueValueWithSizeCodeImplementationVisibility;
-// peekQueueValue
-#define WEBCORE_BUILTIN_STREAMINTERNALS_PEEKQUEUEVALUE 1
-extern const char* const s_streamInternalsPeekQueueValueCode;
-extern const int s_streamInternalsPeekQueueValueCodeLength;
-extern const JSC::ConstructAbility s_streamInternalsPeekQueueValueCodeConstructAbility;
-extern const JSC::ConstructorKind s_streamInternalsPeekQueueValueCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_streamInternalsPeekQueueValueCodeImplementationVisibility;
-
-// resetQueue
-#define WEBCORE_BUILTIN_STREAMINTERNALS_RESETQUEUE 1
-extern const char* const s_streamInternalsResetQueueCode;
-extern const int s_streamInternalsResetQueueCodeLength;
-extern const JSC::ConstructAbility s_streamInternalsResetQueueCodeConstructAbility;
-extern const JSC::ConstructorKind s_streamInternalsResetQueueCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_streamInternalsResetQueueCodeImplementationVisibility;
-
-// extractSizeAlgorithm
-#define WEBCORE_BUILTIN_STREAMINTERNALS_EXTRACTSIZEALGORITHM 1
-extern const char* const s_streamInternalsExtractSizeAlgorithmCode;
-extern const int s_streamInternalsExtractSizeAlgorithmCodeLength;
-extern const JSC::ConstructAbility s_streamInternalsExtractSizeAlgorithmCodeConstructAbility;
-extern const JSC::ConstructorKind s_streamInternalsExtractSizeAlgorithmCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_streamInternalsExtractSizeAlgorithmCodeImplementationVisibility;
-
// extractHighWaterMark
#define WEBCORE_BUILTIN_STREAMINTERNALS_EXTRACTHIGHWATERMARK 1
extern const char* const s_streamInternalsExtractHighWaterMarkCode;
@@ -3988,13 +3978,93 @@ extern const JSC::ConstructAbility s_streamInternalsExtractHighWaterMarkFromQueu
extern const JSC::ConstructorKind s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeConstructorKind;
extern const JSC::ImplementationVisibility s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeImplementationVisibility;
-// createFulfilledPromise
-#define WEBCORE_BUILTIN_STREAMINTERNALS_CREATEFULFILLEDPROMISE 1
-extern const char* const s_streamInternalsCreateFulfilledPromiseCode;
-extern const int s_streamInternalsCreateFulfilledPromiseCodeLength;
-extern const JSC::ConstructAbility s_streamInternalsCreateFulfilledPromiseCodeConstructAbility;
-extern const JSC::ConstructorKind s_streamInternalsCreateFulfilledPromiseCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_streamInternalsCreateFulfilledPromiseCodeImplementationVisibility;
+// extractSizeAlgorithm
+#define WEBCORE_BUILTIN_STREAMINTERNALS_EXTRACTSIZEALGORITHM 1
+extern const char* const s_streamInternalsExtractSizeAlgorithmCode;
+extern const int s_streamInternalsExtractSizeAlgorithmCodeLength;
+extern const JSC::ConstructAbility s_streamInternalsExtractSizeAlgorithmCodeConstructAbility;
+extern const JSC::ConstructorKind s_streamInternalsExtractSizeAlgorithmCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_streamInternalsExtractSizeAlgorithmCodeImplementationVisibility;
+
+// markPromiseAsHandled
+#define WEBCORE_BUILTIN_STREAMINTERNALS_MARKPROMISEASHANDLED 1
+extern const char* const s_streamInternalsMarkPromiseAsHandledCode;
+extern const int s_streamInternalsMarkPromiseAsHandledCodeLength;
+extern const JSC::ConstructAbility s_streamInternalsMarkPromiseAsHandledCodeConstructAbility;
+extern const JSC::ConstructorKind s_streamInternalsMarkPromiseAsHandledCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_streamInternalsMarkPromiseAsHandledCodeImplementationVisibility;
+
+// newQueue
+#define WEBCORE_BUILTIN_STREAMINTERNALS_NEWQUEUE 1
+extern const char* const s_streamInternalsNewQueueCode;
+extern const int s_streamInternalsNewQueueCodeLength;
+extern const JSC::ConstructAbility s_streamInternalsNewQueueCodeConstructAbility;
+extern const JSC::ConstructorKind s_streamInternalsNewQueueCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_streamInternalsNewQueueCodeImplementationVisibility;
+
+// peekQueueValue
+#define WEBCORE_BUILTIN_STREAMINTERNALS_PEEKQUEUEVALUE 1
+extern const char* const s_streamInternalsPeekQueueValueCode;
+extern const int s_streamInternalsPeekQueueValueCodeLength;
+extern const JSC::ConstructAbility s_streamInternalsPeekQueueValueCodeConstructAbility;
+extern const JSC::ConstructorKind s_streamInternalsPeekQueueValueCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_streamInternalsPeekQueueValueCodeImplementationVisibility;
+
+// promiseInvokeOrFallbackOrNoop
+#define WEBCORE_BUILTIN_STREAMINTERNALS_PROMISEINVOKEORFALLBACKORNOOP 1
+extern const char* const s_streamInternalsPromiseInvokeOrFallbackOrNoopCode;
+extern const int s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeLength;
+extern const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeConstructAbility;
+extern const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeImplementationVisibility;
+
+// promiseInvokeOrNoop
+#define WEBCORE_BUILTIN_STREAMINTERNALS_PROMISEINVOKEORNOOP 1
+extern const char* const s_streamInternalsPromiseInvokeOrNoopCode;
+extern const int s_streamInternalsPromiseInvokeOrNoopCodeLength;
+extern const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopCodeConstructAbility;
+extern const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopCodeImplementationVisibility;
+
+// promiseInvokeOrNoopMethod
+#define WEBCORE_BUILTIN_STREAMINTERNALS_PROMISEINVOKEORNOOPMETHOD 1
+extern const char* const s_streamInternalsPromiseInvokeOrNoopMethodCode;
+extern const int s_streamInternalsPromiseInvokeOrNoopMethodCodeLength;
+extern const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopMethodCodeConstructAbility;
+extern const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopMethodCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopMethodCodeImplementationVisibility;
+
+// promiseInvokeOrNoopMethodNoCatch
+#define WEBCORE_BUILTIN_STREAMINTERNALS_PROMISEINVOKEORNOOPMETHODNOCATCH 1
+extern const char* const s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCode;
+extern const int s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeLength;
+extern const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeConstructAbility;
+extern const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeImplementationVisibility;
+
+// promiseInvokeOrNoopNoCatch
+#define WEBCORE_BUILTIN_STREAMINTERNALS_PROMISEINVOKEORNOOPNOCATCH 1
+extern const char* const s_streamInternalsPromiseInvokeOrNoopNoCatchCode;
+extern const int s_streamInternalsPromiseInvokeOrNoopNoCatchCodeLength;
+extern const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopNoCatchCodeConstructAbility;
+extern const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopNoCatchCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopNoCatchCodeImplementationVisibility;
+
+// resetQueue
+#define WEBCORE_BUILTIN_STREAMINTERNALS_RESETQUEUE 1
+extern const char* const s_streamInternalsResetQueueCode;
+extern const int s_streamInternalsResetQueueCodeLength;
+extern const JSC::ConstructAbility s_streamInternalsResetQueueCodeConstructAbility;
+extern const JSC::ConstructorKind s_streamInternalsResetQueueCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_streamInternalsResetQueueCodeImplementationVisibility;
+
+// shieldingPromiseResolve
+#define WEBCORE_BUILTIN_STREAMINTERNALS_SHIELDINGPROMISERESOLVE 1
+extern const char* const s_streamInternalsShieldingPromiseResolveCode;
+extern const int s_streamInternalsShieldingPromiseResolveCodeLength;
+extern const JSC::ConstructAbility s_streamInternalsShieldingPromiseResolveCodeConstructAbility;
+extern const JSC::ConstructorKind s_streamInternalsShieldingPromiseResolveCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_streamInternalsShieldingPromiseResolveCodeImplementationVisibility;
// toDictionary
#define WEBCORE_BUILTIN_STREAMINTERNALS_TODICTIONARY 1
@@ -4004,68 +4074,76 @@ extern const JSC::ConstructAbility s_streamInternalsToDictionaryCodeConstructAbi
extern const JSC::ConstructorKind s_streamInternalsToDictionaryCodeConstructorKind;
extern const JSC::ImplementationVisibility s_streamInternalsToDictionaryCodeImplementationVisibility;
+// validateAndNormalizeQueuingStrategy
+#define WEBCORE_BUILTIN_STREAMINTERNALS_VALIDATEANDNORMALIZEQUEUINGSTRATEGY 1
+extern const char* const s_streamInternalsValidateAndNormalizeQueuingStrategyCode;
+extern const int s_streamInternalsValidateAndNormalizeQueuingStrategyCodeLength;
+extern const JSC::ConstructAbility s_streamInternalsValidateAndNormalizeQueuingStrategyCodeConstructAbility;
+extern const JSC::ConstructorKind s_streamInternalsValidateAndNormalizeQueuingStrategyCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_streamInternalsValidateAndNormalizeQueuingStrategyCodeImplementationVisibility;
+
#define WEBCORE_FOREACH_STREAMINTERNALS_BUILTIN_DATA(macro) \
- macro(markPromiseAsHandled, streamInternalsMarkPromiseAsHandled, 1) \
- macro(shieldingPromiseResolve, streamInternalsShieldingPromiseResolve, 1) \
- macro(promiseInvokeOrNoopMethodNoCatch, streamInternalsPromiseInvokeOrNoopMethodNoCatch, 3) \
- macro(promiseInvokeOrNoopNoCatch, streamInternalsPromiseInvokeOrNoopNoCatch, 3) \
- macro(promiseInvokeOrNoopMethod, streamInternalsPromiseInvokeOrNoopMethod, 3) \
- macro(promiseInvokeOrNoop, streamInternalsPromiseInvokeOrNoop, 3) \
- macro(promiseInvokeOrFallbackOrNoop, streamInternalsPromiseInvokeOrFallbackOrNoop, 5) \
- macro(validateAndNormalizeQueuingStrategy, streamInternalsValidateAndNormalizeQueuingStrategy, 2) \
macro(createFIFO, streamInternalsCreateFIFO, 0) \
- macro(newQueue, streamInternalsNewQueue, 0) \
+ macro(createFulfilledPromise, streamInternalsCreateFulfilledPromise, 1) \
macro(dequeueValue, streamInternalsDequeueValue, 1) \
macro(enqueueValueWithSize, streamInternalsEnqueueValueWithSize, 3) \
- macro(peekQueueValue, streamInternalsPeekQueueValue, 1) \
- macro(resetQueue, streamInternalsResetQueue, 1) \
- macro(extractSizeAlgorithm, streamInternalsExtractSizeAlgorithm, 1) \
macro(extractHighWaterMark, streamInternalsExtractHighWaterMark, 2) \
macro(extractHighWaterMarkFromQueuingStrategyInit, streamInternalsExtractHighWaterMarkFromQueuingStrategyInit, 1) \
- macro(createFulfilledPromise, streamInternalsCreateFulfilledPromise, 1) \
+ macro(extractSizeAlgorithm, streamInternalsExtractSizeAlgorithm, 1) \
+ macro(markPromiseAsHandled, streamInternalsMarkPromiseAsHandled, 1) \
+ macro(newQueue, streamInternalsNewQueue, 0) \
+ macro(peekQueueValue, streamInternalsPeekQueueValue, 1) \
+ macro(promiseInvokeOrFallbackOrNoop, streamInternalsPromiseInvokeOrFallbackOrNoop, 5) \
+ macro(promiseInvokeOrNoop, streamInternalsPromiseInvokeOrNoop, 3) \
+ macro(promiseInvokeOrNoopMethod, streamInternalsPromiseInvokeOrNoopMethod, 3) \
+ macro(promiseInvokeOrNoopMethodNoCatch, streamInternalsPromiseInvokeOrNoopMethodNoCatch, 3) \
+ macro(promiseInvokeOrNoopNoCatch, streamInternalsPromiseInvokeOrNoopNoCatch, 3) \
+ macro(resetQueue, streamInternalsResetQueue, 1) \
+ macro(shieldingPromiseResolve, streamInternalsShieldingPromiseResolve, 1) \
macro(toDictionary, streamInternalsToDictionary, 3) \
+ macro(validateAndNormalizeQueuingStrategy, streamInternalsValidateAndNormalizeQueuingStrategy, 2) \
#define WEBCORE_FOREACH_STREAMINTERNALS_BUILTIN_CODE(macro) \
- macro(streamInternalsMarkPromiseAsHandledCode, markPromiseAsHandled, ASCIILiteral(), s_streamInternalsMarkPromiseAsHandledCodeLength) \
- macro(streamInternalsShieldingPromiseResolveCode, shieldingPromiseResolve, ASCIILiteral(), s_streamInternalsShieldingPromiseResolveCodeLength) \
- macro(streamInternalsPromiseInvokeOrNoopMethodNoCatchCode, promiseInvokeOrNoopMethodNoCatch, ASCIILiteral(), s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeLength) \
- macro(streamInternalsPromiseInvokeOrNoopNoCatchCode, promiseInvokeOrNoopNoCatch, ASCIILiteral(), s_streamInternalsPromiseInvokeOrNoopNoCatchCodeLength) \
- macro(streamInternalsPromiseInvokeOrNoopMethodCode, promiseInvokeOrNoopMethod, ASCIILiteral(), s_streamInternalsPromiseInvokeOrNoopMethodCodeLength) \
- macro(streamInternalsPromiseInvokeOrNoopCode, promiseInvokeOrNoop, ASCIILiteral(), s_streamInternalsPromiseInvokeOrNoopCodeLength) \
- macro(streamInternalsPromiseInvokeOrFallbackOrNoopCode, promiseInvokeOrFallbackOrNoop, ASCIILiteral(), s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeLength) \
- macro(streamInternalsValidateAndNormalizeQueuingStrategyCode, validateAndNormalizeQueuingStrategy, ASCIILiteral(), s_streamInternalsValidateAndNormalizeQueuingStrategyCodeLength) \
macro(streamInternalsCreateFIFOCode, createFIFO, ASCIILiteral(), s_streamInternalsCreateFIFOCodeLength) \
- macro(streamInternalsNewQueueCode, newQueue, ASCIILiteral(), s_streamInternalsNewQueueCodeLength) \
+ macro(streamInternalsCreateFulfilledPromiseCode, createFulfilledPromise, ASCIILiteral(), s_streamInternalsCreateFulfilledPromiseCodeLength) \
macro(streamInternalsDequeueValueCode, dequeueValue, ASCIILiteral(), s_streamInternalsDequeueValueCodeLength) \
macro(streamInternalsEnqueueValueWithSizeCode, enqueueValueWithSize, ASCIILiteral(), s_streamInternalsEnqueueValueWithSizeCodeLength) \
- macro(streamInternalsPeekQueueValueCode, peekQueueValue, ASCIILiteral(), s_streamInternalsPeekQueueValueCodeLength) \
- macro(streamInternalsResetQueueCode, resetQueue, ASCIILiteral(), s_streamInternalsResetQueueCodeLength) \
- macro(streamInternalsExtractSizeAlgorithmCode, extractSizeAlgorithm, ASCIILiteral(), s_streamInternalsExtractSizeAlgorithmCodeLength) \
macro(streamInternalsExtractHighWaterMarkCode, extractHighWaterMark, ASCIILiteral(), s_streamInternalsExtractHighWaterMarkCodeLength) \
macro(streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCode, extractHighWaterMarkFromQueuingStrategyInit, ASCIILiteral(), s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeLength) \
- macro(streamInternalsCreateFulfilledPromiseCode, createFulfilledPromise, ASCIILiteral(), s_streamInternalsCreateFulfilledPromiseCodeLength) \
+ macro(streamInternalsExtractSizeAlgorithmCode, extractSizeAlgorithm, ASCIILiteral(), s_streamInternalsExtractSizeAlgorithmCodeLength) \
+ macro(streamInternalsMarkPromiseAsHandledCode, markPromiseAsHandled, ASCIILiteral(), s_streamInternalsMarkPromiseAsHandledCodeLength) \
+ macro(streamInternalsNewQueueCode, newQueue, ASCIILiteral(), s_streamInternalsNewQueueCodeLength) \
+ macro(streamInternalsPeekQueueValueCode, peekQueueValue, ASCIILiteral(), s_streamInternalsPeekQueueValueCodeLength) \
+ macro(streamInternalsPromiseInvokeOrFallbackOrNoopCode, promiseInvokeOrFallbackOrNoop, ASCIILiteral(), s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeLength) \
+ macro(streamInternalsPromiseInvokeOrNoopCode, promiseInvokeOrNoop, ASCIILiteral(), s_streamInternalsPromiseInvokeOrNoopCodeLength) \
+ macro(streamInternalsPromiseInvokeOrNoopMethodCode, promiseInvokeOrNoopMethod, ASCIILiteral(), s_streamInternalsPromiseInvokeOrNoopMethodCodeLength) \
+ macro(streamInternalsPromiseInvokeOrNoopMethodNoCatchCode, promiseInvokeOrNoopMethodNoCatch, ASCIILiteral(), s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeLength) \
+ macro(streamInternalsPromiseInvokeOrNoopNoCatchCode, promiseInvokeOrNoopNoCatch, ASCIILiteral(), s_streamInternalsPromiseInvokeOrNoopNoCatchCodeLength) \
+ macro(streamInternalsResetQueueCode, resetQueue, ASCIILiteral(), s_streamInternalsResetQueueCodeLength) \
+ macro(streamInternalsShieldingPromiseResolveCode, shieldingPromiseResolve, ASCIILiteral(), s_streamInternalsShieldingPromiseResolveCodeLength) \
macro(streamInternalsToDictionaryCode, toDictionary, ASCIILiteral(), s_streamInternalsToDictionaryCodeLength) \
+ macro(streamInternalsValidateAndNormalizeQueuingStrategyCode, validateAndNormalizeQueuingStrategy, ASCIILiteral(), s_streamInternalsValidateAndNormalizeQueuingStrategyCodeLength) \
#define WEBCORE_FOREACH_STREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \
- macro(markPromiseAsHandled) \
- macro(shieldingPromiseResolve) \
- macro(promiseInvokeOrNoopMethodNoCatch) \
- macro(promiseInvokeOrNoopNoCatch) \
- macro(promiseInvokeOrNoopMethod) \
- macro(promiseInvokeOrNoop) \
- macro(promiseInvokeOrFallbackOrNoop) \
- macro(validateAndNormalizeQueuingStrategy) \
macro(createFIFO) \
- macro(newQueue) \
+ macro(createFulfilledPromise) \
macro(dequeueValue) \
macro(enqueueValueWithSize) \
- macro(peekQueueValue) \
- macro(resetQueue) \
- macro(extractSizeAlgorithm) \
macro(extractHighWaterMark) \
macro(extractHighWaterMarkFromQueuingStrategyInit) \
- macro(createFulfilledPromise) \
+ macro(extractSizeAlgorithm) \
+ macro(markPromiseAsHandled) \
+ macro(newQueue) \
+ macro(peekQueueValue) \
+ macro(promiseInvokeOrFallbackOrNoop) \
+ macro(promiseInvokeOrNoop) \
+ macro(promiseInvokeOrNoopMethod) \
+ macro(promiseInvokeOrNoopMethodNoCatch) \
+ macro(promiseInvokeOrNoopNoCatch) \
+ macro(resetQueue) \
+ macro(shieldingPromiseResolve) \
macro(toDictionary) \
+ macro(validateAndNormalizeQueuingStrategy) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
@@ -4078,7 +4156,7 @@ public:
explicit StreamInternalsBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
WEBCORE_FOREACH_STREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
WEBCORE_FOREACH_STREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
@@ -4161,81 +4239,59 @@ inline void StreamInternalsBuiltinFunctions::visit(Visitor& visitor)
template void StreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&);
template void StreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&);
- /* ImportMetaObject.ts */
-// loadCJS2ESM
-#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_LOADCJS2ESM 1
-extern const char* const s_importMetaObjectLoadCJS2ESMCode;
-extern const int s_importMetaObjectLoadCJS2ESMCodeLength;
-extern const JSC::ConstructAbility s_importMetaObjectLoadCJS2ESMCodeConstructAbility;
-extern const JSC::ConstructorKind s_importMetaObjectLoadCJS2ESMCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_importMetaObjectLoadCJS2ESMCodeImplementationVisibility;
-
-// requireESM
-#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_REQUIREESM 1
-extern const char* const s_importMetaObjectRequireESMCode;
-extern const int s_importMetaObjectRequireESMCodeLength;
-extern const JSC::ConstructAbility s_importMetaObjectRequireESMCodeConstructAbility;
-extern const JSC::ConstructorKind s_importMetaObjectRequireESMCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_importMetaObjectRequireESMCodeImplementationVisibility;
-
-// internalRequire
-#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_INTERNALREQUIRE 1
-extern const char* const s_importMetaObjectInternalRequireCode;
-extern const int s_importMetaObjectInternalRequireCodeLength;
-extern const JSC::ConstructAbility s_importMetaObjectInternalRequireCodeConstructAbility;
-extern const JSC::ConstructorKind s_importMetaObjectInternalRequireCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_importMetaObjectInternalRequireCodeImplementationVisibility;
+ /* TransformStream.ts */
+// initializeTransformStream
+#define WEBCORE_BUILTIN_TRANSFORMSTREAM_INITIALIZETRANSFORMSTREAM 1
+extern const char* const s_transformStreamInitializeTransformStreamCode;
+extern const int s_transformStreamInitializeTransformStreamCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInitializeTransformStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInitializeTransformStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInitializeTransformStreamCodeImplementationVisibility;
-// createRequireCache
-#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_CREATEREQUIRECACHE 1
-extern const char* const s_importMetaObjectCreateRequireCacheCode;
-extern const int s_importMetaObjectCreateRequireCacheCodeLength;
-extern const JSC::ConstructAbility s_importMetaObjectCreateRequireCacheCodeConstructAbility;
-extern const JSC::ConstructorKind s_importMetaObjectCreateRequireCacheCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_importMetaObjectCreateRequireCacheCodeImplementationVisibility;
+// readable
+#define WEBCORE_BUILTIN_TRANSFORMSTREAM_READABLE 1
+extern const char* const s_transformStreamReadableCode;
+extern const int s_transformStreamReadableCodeLength;
+extern const JSC::ConstructAbility s_transformStreamReadableCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamReadableCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamReadableCodeImplementationVisibility;
-// main
-#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_MAIN 1
-extern const char* const s_importMetaObjectMainCode;
-extern const int s_importMetaObjectMainCodeLength;
-extern const JSC::ConstructAbility s_importMetaObjectMainCodeConstructAbility;
-extern const JSC::ConstructorKind s_importMetaObjectMainCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_importMetaObjectMainCodeImplementationVisibility;
+// writable
+#define WEBCORE_BUILTIN_TRANSFORMSTREAM_WRITABLE 1
+extern const char* const s_transformStreamWritableCode;
+extern const int s_transformStreamWritableCodeLength;
+extern const JSC::ConstructAbility s_transformStreamWritableCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamWritableCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamWritableCodeImplementationVisibility;
-#define WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_DATA(macro) \
- macro(loadCJS2ESM, importMetaObjectLoadCJS2ESM, 1) \
- macro(requireESM, importMetaObjectRequireESM, 1) \
- macro(internalRequire, importMetaObjectInternalRequire, 1) \
- macro(createRequireCache, importMetaObjectCreateRequireCache, 0) \
- macro(main, importMetaObjectMain, 0) \
+#define WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_DATA(macro) \
+ macro(initializeTransformStream, transformStreamInitializeTransformStream, 0) \
+ macro(readable, transformStreamReadable, 0) \
+ macro(writable, transformStreamWritable, 0) \
-#define WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(macro) \
- macro(importMetaObjectLoadCJS2ESMCode, loadCJS2ESM, ASCIILiteral(), s_importMetaObjectLoadCJS2ESMCodeLength) \
- macro(importMetaObjectRequireESMCode, requireESM, ASCIILiteral(), s_importMetaObjectRequireESMCodeLength) \
- macro(importMetaObjectInternalRequireCode, internalRequire, ASCIILiteral(), s_importMetaObjectInternalRequireCodeLength) \
- macro(importMetaObjectCreateRequireCacheCode, createRequireCache, ASCIILiteral(), s_importMetaObjectCreateRequireCacheCodeLength) \
- macro(importMetaObjectMainCode, main, "get main"_s, s_importMetaObjectMainCodeLength) \
+#define WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(macro) \
+ macro(transformStreamInitializeTransformStreamCode, initializeTransformStream, ASCIILiteral(), s_transformStreamInitializeTransformStreamCodeLength) \
+ macro(transformStreamReadableCode, readable, "get readable"_s, s_transformStreamReadableCodeLength) \
+ macro(transformStreamWritableCode, writable, ASCIILiteral(), s_transformStreamWritableCodeLength) \
-#define WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(macro) \
- macro(loadCJS2ESM) \
- macro(requireESM) \
- macro(internalRequire) \
- macro(createRequireCache) \
- macro(main) \
+#define WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(macro) \
+ macro(initializeTransformStream) \
+ macro(readable) \
+ macro(writable) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class ImportMetaObjectBuiltinsWrapper : private JSC::WeakHandleOwner {
+class TransformStreamBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit ImportMetaObjectBuiltinsWrapper(JSC::VM& vm)
+ explicit TransformStreamBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -4243,28 +4299,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* ImportMetaObjectBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* TransformStreamBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -4274,68 +4330,90 @@ inline JSC::UnlinkedFunctionExecutable* ImportMetaObjectBuiltinsWrapper::name##E
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void ImportMetaObjectBuiltinsWrapper::exportNames()
+inline void TransformStreamBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* CountQueuingStrategy.ts */
-// highWaterMark
-#define WEBCORE_BUILTIN_COUNTQUEUINGSTRATEGY_HIGHWATERMARK 1
-extern const char* const s_countQueuingStrategyHighWaterMarkCode;
-extern const int s_countQueuingStrategyHighWaterMarkCodeLength;
-extern const JSC::ConstructAbility s_countQueuingStrategyHighWaterMarkCodeConstructAbility;
-extern const JSC::ConstructorKind s_countQueuingStrategyHighWaterMarkCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_countQueuingStrategyHighWaterMarkCodeImplementationVisibility;
+/* TransformStreamDefaultController.ts */
+// desiredSize
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_DESIREDSIZE 1
+extern const char* const s_transformStreamDefaultControllerDesiredSizeCode;
+extern const int s_transformStreamDefaultControllerDesiredSizeCodeLength;
+extern const JSC::ConstructAbility s_transformStreamDefaultControllerDesiredSizeCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamDefaultControllerDesiredSizeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerDesiredSizeCodeImplementationVisibility;
-// size
-#define WEBCORE_BUILTIN_COUNTQUEUINGSTRATEGY_SIZE 1
-extern const char* const s_countQueuingStrategySizeCode;
-extern const int s_countQueuingStrategySizeCodeLength;
-extern const JSC::ConstructAbility s_countQueuingStrategySizeCodeConstructAbility;
-extern const JSC::ConstructorKind s_countQueuingStrategySizeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_countQueuingStrategySizeCodeImplementationVisibility;
+// enqueue
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_ENQUEUE 1
+extern const char* const s_transformStreamDefaultControllerEnqueueCode;
+extern const int s_transformStreamDefaultControllerEnqueueCodeLength;
+extern const JSC::ConstructAbility s_transformStreamDefaultControllerEnqueueCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamDefaultControllerEnqueueCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerEnqueueCodeImplementationVisibility;
-// initializeCountQueuingStrategy
-#define WEBCORE_BUILTIN_COUNTQUEUINGSTRATEGY_INITIALIZECOUNTQUEUINGSTRATEGY 1
-extern const char* const s_countQueuingStrategyInitializeCountQueuingStrategyCode;
-extern const int s_countQueuingStrategyInitializeCountQueuingStrategyCodeLength;
-extern const JSC::ConstructAbility s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructAbility;
-extern const JSC::ConstructorKind s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_countQueuingStrategyInitializeCountQueuingStrategyCodeImplementationVisibility;
+// error
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_ERROR 1
+extern const char* const s_transformStreamDefaultControllerErrorCode;
+extern const int s_transformStreamDefaultControllerErrorCodeLength;
+extern const JSC::ConstructAbility s_transformStreamDefaultControllerErrorCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamDefaultControllerErrorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerErrorCodeImplementationVisibility;
-#define WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_DATA(macro) \
- macro(highWaterMark, countQueuingStrategyHighWaterMark, 0) \
- macro(size, countQueuingStrategySize, 0) \
- macro(initializeCountQueuingStrategy, countQueuingStrategyInitializeCountQueuingStrategy, 1) \
+// initializeTransformStreamDefaultController
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_INITIALIZETRANSFORMSTREAMDEFAULTCONTROLLER 1
+extern const char* const s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCode;
+extern const int s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeLength;
+extern const JSC::ConstructAbility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeImplementationVisibility;
-#define WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(macro) \
- macro(countQueuingStrategyHighWaterMarkCode, highWaterMark, "get highWaterMark"_s, s_countQueuingStrategyHighWaterMarkCodeLength) \
- macro(countQueuingStrategySizeCode, size, ASCIILiteral(), s_countQueuingStrategySizeCodeLength) \
- macro(countQueuingStrategyInitializeCountQueuingStrategyCode, initializeCountQueuingStrategy, ASCIILiteral(), s_countQueuingStrategyInitializeCountQueuingStrategyCodeLength) \
+// terminate
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_TERMINATE 1
+extern const char* const s_transformStreamDefaultControllerTerminateCode;
+extern const int s_transformStreamDefaultControllerTerminateCodeLength;
+extern const JSC::ConstructAbility s_transformStreamDefaultControllerTerminateCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamDefaultControllerTerminateCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerTerminateCodeImplementationVisibility;
-#define WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(macro) \
- macro(highWaterMark) \
- macro(size) \
- macro(initializeCountQueuingStrategy) \
+#define WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_DATA(macro) \
+ macro(desiredSize, transformStreamDefaultControllerDesiredSize, 0) \
+ macro(enqueue, transformStreamDefaultControllerEnqueue, 1) \
+ macro(error, transformStreamDefaultControllerError, 1) \
+ macro(initializeTransformStreamDefaultController, transformStreamDefaultControllerInitializeTransformStreamDefaultController, 0) \
+ macro(terminate, transformStreamDefaultControllerTerminate, 0) \
+
+#define WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(macro) \
+ macro(transformStreamDefaultControllerDesiredSizeCode, desiredSize, "get desiredSize"_s, s_transformStreamDefaultControllerDesiredSizeCodeLength) \
+ macro(transformStreamDefaultControllerEnqueueCode, enqueue, ASCIILiteral(), s_transformStreamDefaultControllerEnqueueCodeLength) \
+ macro(transformStreamDefaultControllerErrorCode, error, ASCIILiteral(), s_transformStreamDefaultControllerErrorCodeLength) \
+ macro(transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCode, initializeTransformStreamDefaultController, ASCIILiteral(), s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeLength) \
+ macro(transformStreamDefaultControllerTerminateCode, terminate, ASCIILiteral(), s_transformStreamDefaultControllerTerminateCodeLength) \
+
+#define WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(macro) \
+ macro(desiredSize) \
+ macro(enqueue) \
+ macro(error) \
+ macro(initializeTransformStreamDefaultController) \
+ macro(terminate) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class CountQueuingStrategyBuiltinsWrapper : private JSC::WeakHandleOwner {
+class TransformStreamDefaultControllerBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit CountQueuingStrategyBuiltinsWrapper(JSC::VM& vm)
+ explicit TransformStreamDefaultControllerBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -4343,28 +4421,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* CountQueuingStrategyBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* TransformStreamDefaultControllerBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -4374,79 +4452,233 @@ inline JSC::UnlinkedFunctionExecutable* CountQueuingStrategyBuiltinsWrapper::nam
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void CountQueuingStrategyBuiltinsWrapper::exportNames()
+inline void TransformStreamDefaultControllerBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* ReadableStreamBYOBRequest.ts */
-// initializeReadableStreamBYOBRequest
-#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_INITIALIZEREADABLESTREAMBYOBREQUEST 1
-extern const char* const s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCode;
-extern const int s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeLength;
-extern const JSC::ConstructAbility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeImplementationVisibility;
+/* TransformStreamInternals.ts */
+// createTransformStream
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_CREATETRANSFORMSTREAM 1
+extern const char* const s_transformStreamInternalsCreateTransformStreamCode;
+extern const int s_transformStreamInternalsCreateTransformStreamCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsCreateTransformStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsCreateTransformStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsCreateTransformStreamCodeImplementationVisibility;
-// respond
-#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_RESPOND 1
-extern const char* const s_readableStreamBYOBRequestRespondCode;
-extern const int s_readableStreamBYOBRequestRespondCodeLength;
-extern const JSC::ConstructAbility s_readableStreamBYOBRequestRespondCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamBYOBRequestRespondCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondCodeImplementationVisibility;
+// initializeTransformStream
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_INITIALIZETRANSFORMSTREAM 1
+extern const char* const s_transformStreamInternalsInitializeTransformStreamCode;
+extern const int s_transformStreamInternalsInitializeTransformStreamCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsInitializeTransformStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsInitializeTransformStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsInitializeTransformStreamCodeImplementationVisibility;
-// respondWithNewView
-#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_RESPONDWITHNEWVIEW 1
-extern const char* const s_readableStreamBYOBRequestRespondWithNewViewCode;
-extern const int s_readableStreamBYOBRequestRespondWithNewViewCodeLength;
-extern const JSC::ConstructAbility s_readableStreamBYOBRequestRespondWithNewViewCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamBYOBRequestRespondWithNewViewCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondWithNewViewCodeImplementationVisibility;
+// isTransformStream
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_ISTRANSFORMSTREAM 1
+extern const char* const s_transformStreamInternalsIsTransformStreamCode;
+extern const int s_transformStreamInternalsIsTransformStreamCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamCodeImplementationVisibility;
-// view
-#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_VIEW 1
-extern const char* const s_readableStreamBYOBRequestViewCode;
-extern const int s_readableStreamBYOBRequestViewCodeLength;
-extern const JSC::ConstructAbility s_readableStreamBYOBRequestViewCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamBYOBRequestViewCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestViewCodeImplementationVisibility;
+// isTransformStreamDefaultController
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_ISTRANSFORMSTREAMDEFAULTCONTROLLER 1
+extern const char* const s_transformStreamInternalsIsTransformStreamDefaultControllerCode;
+extern const int s_transformStreamInternalsIsTransformStreamDefaultControllerCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeImplementationVisibility;
-#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_DATA(macro) \
- macro(initializeReadableStreamBYOBRequest, readableStreamBYOBRequestInitializeReadableStreamBYOBRequest, 2) \
- macro(respond, readableStreamBYOBRequestRespond, 1) \
- macro(respondWithNewView, readableStreamBYOBRequestRespondWithNewView, 1) \
- macro(view, readableStreamBYOBRequestView, 0) \
+// setUpTransformStreamDefaultController
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_SETUPTRANSFORMSTREAMDEFAULTCONTROLLER 1
+extern const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerCode;
+extern const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeImplementationVisibility;
-#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(macro) \
- macro(readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCode, initializeReadableStreamBYOBRequest, ASCIILiteral(), s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeLength) \
- macro(readableStreamBYOBRequestRespondCode, respond, ASCIILiteral(), s_readableStreamBYOBRequestRespondCodeLength) \
- macro(readableStreamBYOBRequestRespondWithNewViewCode, respondWithNewView, ASCIILiteral(), s_readableStreamBYOBRequestRespondWithNewViewCodeLength) \
- macro(readableStreamBYOBRequestViewCode, view, "get view"_s, s_readableStreamBYOBRequestViewCodeLength) \
+// setUpTransformStreamDefaultControllerFromTransformer
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_SETUPTRANSFORMSTREAMDEFAULTCONTROLLERFROMTRANSFORMER 1
+extern const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode;
+extern const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeImplementationVisibility;
-#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(macro) \
- macro(initializeReadableStreamBYOBRequest) \
- macro(respond) \
- macro(respondWithNewView) \
- macro(view) \
+// transformStreamDefaultControllerClearAlgorithms
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERCLEARALGORITHMS 1
+extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCode;
+extern const int s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility;
+
+// transformStreamDefaultControllerEnqueue
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERENQUEUE 1
+extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCode;
+extern const int s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeImplementationVisibility;
+
+// transformStreamDefaultControllerError
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERERROR 1
+extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerErrorCode;
+extern const int s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeImplementationVisibility;
+
+// transformStreamDefaultControllerPerformTransform
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERPERFORMTRANSFORM 1
+extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode;
+extern const int s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeImplementationVisibility;
+
+// transformStreamDefaultControllerTerminate
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERTERMINATE 1
+extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerTerminateCode;
+extern const int s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeImplementationVisibility;
+
+// transformStreamDefaultSinkAbortAlgorithm
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSINKABORTALGORITHM 1
+extern const char* const s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCode;
+extern const int s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeImplementationVisibility;
+
+// transformStreamDefaultSinkCloseAlgorithm
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSINKCLOSEALGORITHM 1
+extern const char* const s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode;
+extern const int s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeImplementationVisibility;
+
+// transformStreamDefaultSinkWriteAlgorithm
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSINKWRITEALGORITHM 1
+extern const char* const s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode;
+extern const int s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeImplementationVisibility;
+
+// transformStreamDefaultSourcePullAlgorithm
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSOURCEPULLALGORITHM 1
+extern const char* const s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCode;
+extern const int s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeImplementationVisibility;
+
+// transformStreamError
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMERROR 1
+extern const char* const s_transformStreamInternalsTransformStreamErrorCode;
+extern const int s_transformStreamInternalsTransformStreamErrorCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorCodeImplementationVisibility;
+
+// transformStreamErrorWritableAndUnblockWrite
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMERRORWRITABLEANDUNBLOCKWRITE 1
+extern const char* const s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCode;
+extern const int s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeImplementationVisibility;
+
+// transformStreamSetBackpressure
+#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMSETBACKPRESSURE 1
+extern const char* const s_transformStreamInternalsTransformStreamSetBackpressureCode;
+extern const int s_transformStreamInternalsTransformStreamSetBackpressureCodeLength;
+extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructAbility;
+extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamSetBackpressureCodeImplementationVisibility;
+
+#define WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_DATA(macro) \
+ macro(createTransformStream, transformStreamInternalsCreateTransformStream, 8) \
+ macro(initializeTransformStream, transformStreamInternalsInitializeTransformStream, 7) \
+ macro(isTransformStream, transformStreamInternalsIsTransformStream, 1) \
+ macro(isTransformStreamDefaultController, transformStreamInternalsIsTransformStreamDefaultController, 1) \
+ macro(setUpTransformStreamDefaultController, transformStreamInternalsSetUpTransformStreamDefaultController, 4) \
+ macro(setUpTransformStreamDefaultControllerFromTransformer, transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformer, 3) \
+ macro(transformStreamDefaultControllerClearAlgorithms, transformStreamInternalsTransformStreamDefaultControllerClearAlgorithms, 1) \
+ macro(transformStreamDefaultControllerEnqueue, transformStreamInternalsTransformStreamDefaultControllerEnqueue, 2) \
+ macro(transformStreamDefaultControllerError, transformStreamInternalsTransformStreamDefaultControllerError, 2) \
+ macro(transformStreamDefaultControllerPerformTransform, transformStreamInternalsTransformStreamDefaultControllerPerformTransform, 2) \
+ macro(transformStreamDefaultControllerTerminate, transformStreamInternalsTransformStreamDefaultControllerTerminate, 1) \
+ macro(transformStreamDefaultSinkAbortAlgorithm, transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithm, 2) \
+ macro(transformStreamDefaultSinkCloseAlgorithm, transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithm, 1) \
+ macro(transformStreamDefaultSinkWriteAlgorithm, transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithm, 2) \
+ macro(transformStreamDefaultSourcePullAlgorithm, transformStreamInternalsTransformStreamDefaultSourcePullAlgorithm, 1) \
+ macro(transformStreamError, transformStreamInternalsTransformStreamError, 2) \
+ macro(transformStreamErrorWritableAndUnblockWrite, transformStreamInternalsTransformStreamErrorWritableAndUnblockWrite, 2) \
+ macro(transformStreamSetBackpressure, transformStreamInternalsTransformStreamSetBackpressure, 2) \
+
+#define WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(macro) \
+ macro(transformStreamInternalsCreateTransformStreamCode, createTransformStream, ASCIILiteral(), s_transformStreamInternalsCreateTransformStreamCodeLength) \
+ macro(transformStreamInternalsInitializeTransformStreamCode, initializeTransformStream, ASCIILiteral(), s_transformStreamInternalsInitializeTransformStreamCodeLength) \
+ macro(transformStreamInternalsIsTransformStreamCode, isTransformStream, ASCIILiteral(), s_transformStreamInternalsIsTransformStreamCodeLength) \
+ macro(transformStreamInternalsIsTransformStreamDefaultControllerCode, isTransformStreamDefaultController, ASCIILiteral(), s_transformStreamInternalsIsTransformStreamDefaultControllerCodeLength) \
+ macro(transformStreamInternalsSetUpTransformStreamDefaultControllerCode, setUpTransformStreamDefaultController, ASCIILiteral(), s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeLength) \
+ macro(transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode, setUpTransformStreamDefaultControllerFromTransformer, ASCIILiteral(), s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeLength) \
+ macro(transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCode, transformStreamDefaultControllerClearAlgorithms, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeLength) \
+ macro(transformStreamInternalsTransformStreamDefaultControllerEnqueueCode, transformStreamDefaultControllerEnqueue, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeLength) \
+ macro(transformStreamInternalsTransformStreamDefaultControllerErrorCode, transformStreamDefaultControllerError, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeLength) \
+ macro(transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode, transformStreamDefaultControllerPerformTransform, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeLength) \
+ macro(transformStreamInternalsTransformStreamDefaultControllerTerminateCode, transformStreamDefaultControllerTerminate, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeLength) \
+ macro(transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCode, transformStreamDefaultSinkAbortAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeLength) \
+ macro(transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode, transformStreamDefaultSinkCloseAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeLength) \
+ macro(transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode, transformStreamDefaultSinkWriteAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength) \
+ macro(transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCode, transformStreamDefaultSourcePullAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeLength) \
+ macro(transformStreamInternalsTransformStreamErrorCode, transformStreamError, ASCIILiteral(), s_transformStreamInternalsTransformStreamErrorCodeLength) \
+ macro(transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCode, transformStreamErrorWritableAndUnblockWrite, ASCIILiteral(), s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeLength) \
+ macro(transformStreamInternalsTransformStreamSetBackpressureCode, transformStreamSetBackpressure, ASCIILiteral(), s_transformStreamInternalsTransformStreamSetBackpressureCodeLength) \
+
+#define WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \
+ macro(createTransformStream) \
+ macro(initializeTransformStream) \
+ macro(isTransformStream) \
+ macro(isTransformStreamDefaultController) \
+ macro(setUpTransformStreamDefaultController) \
+ macro(setUpTransformStreamDefaultControllerFromTransformer) \
+ macro(transformStreamDefaultControllerClearAlgorithms) \
+ macro(transformStreamDefaultControllerEnqueue) \
+ macro(transformStreamDefaultControllerError) \
+ macro(transformStreamDefaultControllerPerformTransform) \
+ macro(transformStreamDefaultControllerTerminate) \
+ macro(transformStreamDefaultSinkAbortAlgorithm) \
+ macro(transformStreamDefaultSinkCloseAlgorithm) \
+ macro(transformStreamDefaultSinkWriteAlgorithm) \
+ macro(transformStreamDefaultSourcePullAlgorithm) \
+ macro(transformStreamError) \
+ macro(transformStreamErrorWritableAndUnblockWrite) \
+ macro(transformStreamSetBackpressure) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class ReadableStreamBYOBRequestBuiltinsWrapper : private JSC::WeakHandleOwner {
+class TransformStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit ReadableStreamBYOBRequestBuiltinsWrapper(JSC::VM& vm)
+ explicit TransformStreamInternalsBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -4454,28 +4686,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* ReadableStreamBYOBRequestBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* TransformStreamInternalsBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -4485,123 +4717,91 @@ inline JSC::UnlinkedFunctionExecutable* ReadableStreamBYOBRequestBuiltinsWrapper
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void ReadableStreamBYOBRequestBuiltinsWrapper::exportNames()
+inline void TransformStreamInternalsBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* WritableStreamDefaultWriter.ts */
-// initializeWritableStreamDefaultWriter
-#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_INITIALIZEWRITABLESTREAMDEFAULTWRITER 1
-extern const char* const s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCode;
-extern const int s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeLength;
-extern const JSC::ConstructAbility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeImplementationVisibility;
+class TransformStreamInternalsBuiltinFunctions {
+public:
+ explicit TransformStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
-// closed
-#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_CLOSED 1
-extern const char* const s_writableStreamDefaultWriterClosedCode;
-extern const int s_writableStreamDefaultWriterClosedCodeLength;
-extern const JSC::ConstructAbility s_writableStreamDefaultWriterClosedCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamDefaultWriterClosedCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterClosedCodeImplementationVisibility;
+ void init(JSC::JSGlobalObject&);
+ template<typename Visitor> void visit(Visitor&);
-// desiredSize
-#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_DESIREDSIZE 1
-extern const char* const s_writableStreamDefaultWriterDesiredSizeCode;
-extern const int s_writableStreamDefaultWriterDesiredSizeCodeLength;
-extern const JSC::ConstructAbility s_writableStreamDefaultWriterDesiredSizeCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamDefaultWriterDesiredSizeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterDesiredSizeCodeImplementationVisibility;
+public:
+ JSC::VM& m_vm;
-// ready
-#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_READY 1
-extern const char* const s_writableStreamDefaultWriterReadyCode;
-extern const int s_writableStreamDefaultWriterReadyCodeLength;
-extern const JSC::ConstructAbility s_writableStreamDefaultWriterReadyCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamDefaultWriterReadyCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterReadyCodeImplementationVisibility;
+#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \
+ JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
+ WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
+#undef DECLARE_BUILTIN_SOURCE_MEMBERS
+};
-// abort
-#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_ABORT 1
-extern const char* const s_writableStreamDefaultWriterAbortCode;
-extern const int s_writableStreamDefaultWriterAbortCodeLength;
-extern const JSC::ConstructAbility s_writableStreamDefaultWriterAbortCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamDefaultWriterAbortCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterAbortCodeImplementationVisibility;
+inline void TransformStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
+{
+#define EXPORT_FUNCTION(codeName, functionName, overriddenName, length) \
+ m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create(m_vm, codeName##Generator(m_vm), &globalObject));
+ WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION)
+#undef EXPORT_FUNCTION
+}
-// close
-#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_CLOSE 1
-extern const char* const s_writableStreamDefaultWriterCloseCode;
-extern const int s_writableStreamDefaultWriterCloseCodeLength;
-extern const JSC::ConstructAbility s_writableStreamDefaultWriterCloseCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamDefaultWriterCloseCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterCloseCodeImplementationVisibility;
+template<typename Visitor>
+inline void TransformStreamInternalsBuiltinFunctions::visit(Visitor& visitor)
+{
+#define VISIT_FUNCTION(name) visitor.append(m_##name##Function);
+ WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
+#undef VISIT_FUNCTION
+}
-// releaseLock
-#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_RELEASELOCK 1
-extern const char* const s_writableStreamDefaultWriterReleaseLockCode;
-extern const int s_writableStreamDefaultWriterReleaseLockCodeLength;
-extern const JSC::ConstructAbility s_writableStreamDefaultWriterReleaseLockCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamDefaultWriterReleaseLockCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterReleaseLockCodeImplementationVisibility;
+template void TransformStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&);
+template void TransformStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&);
+ /* UtilInspect.ts */
+// getStylizeWithColor
+#define WEBCORE_BUILTIN_UTILINSPECT_GETSTYLIZEWITHCOLOR 1
+extern const char* const s_utilInspectGetStylizeWithColorCode;
+extern const int s_utilInspectGetStylizeWithColorCodeLength;
+extern const JSC::ConstructAbility s_utilInspectGetStylizeWithColorCodeConstructAbility;
+extern const JSC::ConstructorKind s_utilInspectGetStylizeWithColorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_utilInspectGetStylizeWithColorCodeImplementationVisibility;
-// write
-#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_WRITE 1
-extern const char* const s_writableStreamDefaultWriterWriteCode;
-extern const int s_writableStreamDefaultWriterWriteCodeLength;
-extern const JSC::ConstructAbility s_writableStreamDefaultWriterWriteCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamDefaultWriterWriteCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterWriteCodeImplementationVisibility;
+// stylizeWithNoColor
+#define WEBCORE_BUILTIN_UTILINSPECT_STYLIZEWITHNOCOLOR 1
+extern const char* const s_utilInspectStylizeWithNoColorCode;
+extern const int s_utilInspectStylizeWithNoColorCodeLength;
+extern const JSC::ConstructAbility s_utilInspectStylizeWithNoColorCodeConstructAbility;
+extern const JSC::ConstructorKind s_utilInspectStylizeWithNoColorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_utilInspectStylizeWithNoColorCodeImplementationVisibility;
-#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_DATA(macro) \
- macro(initializeWritableStreamDefaultWriter, writableStreamDefaultWriterInitializeWritableStreamDefaultWriter, 1) \
- macro(closed, writableStreamDefaultWriterClosed, 0) \
- macro(desiredSize, writableStreamDefaultWriterDesiredSize, 0) \
- macro(ready, writableStreamDefaultWriterReady, 0) \
- macro(abort, writableStreamDefaultWriterAbort, 1) \
- macro(close, writableStreamDefaultWriterClose, 0) \
- macro(releaseLock, writableStreamDefaultWriterReleaseLock, 0) \
- macro(write, writableStreamDefaultWriterWrite, 1) \
+#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_DATA(macro) \
+ macro(getStylizeWithColor, utilInspectGetStylizeWithColor, 1) \
+ macro(stylizeWithNoColor, utilInspectStylizeWithNoColor, 1) \
-#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(macro) \
- macro(writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCode, initializeWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeLength) \
- macro(writableStreamDefaultWriterClosedCode, closed, "get closed"_s, s_writableStreamDefaultWriterClosedCodeLength) \
- macro(writableStreamDefaultWriterDesiredSizeCode, desiredSize, "get desiredSize"_s, s_writableStreamDefaultWriterDesiredSizeCodeLength) \
- macro(writableStreamDefaultWriterReadyCode, ready, "get ready"_s, s_writableStreamDefaultWriterReadyCodeLength) \
- macro(writableStreamDefaultWriterAbortCode, abort, ASCIILiteral(), s_writableStreamDefaultWriterAbortCodeLength) \
- macro(writableStreamDefaultWriterCloseCode, close, ASCIILiteral(), s_writableStreamDefaultWriterCloseCodeLength) \
- macro(writableStreamDefaultWriterReleaseLockCode, releaseLock, ASCIILiteral(), s_writableStreamDefaultWriterReleaseLockCodeLength) \
- macro(writableStreamDefaultWriterWriteCode, write, ASCIILiteral(), s_writableStreamDefaultWriterWriteCodeLength) \
+#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(macro) \
+ macro(utilInspectGetStylizeWithColorCode, getStylizeWithColor, ASCIILiteral(), s_utilInspectGetStylizeWithColorCodeLength) \
+ macro(utilInspectStylizeWithNoColorCode, stylizeWithNoColor, ASCIILiteral(), s_utilInspectStylizeWithNoColorCodeLength) \
-#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(macro) \
- macro(initializeWritableStreamDefaultWriter) \
- macro(closed) \
- macro(desiredSize) \
- macro(ready) \
- macro(abort) \
- macro(close) \
- macro(releaseLock) \
- macro(write) \
+#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(macro) \
+ macro(getStylizeWithColor) \
+ macro(stylizeWithNoColor) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class WritableStreamDefaultWriterBuiltinsWrapper : private JSC::WeakHandleOwner {
+class UtilInspectBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit WritableStreamDefaultWriterBuiltinsWrapper(JSC::VM& vm)
+ explicit UtilInspectBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -4609,28 +4809,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* WritableStreamDefaultWriterBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* UtilInspectBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -4640,233 +4840,57 @@ inline JSC::UnlinkedFunctionExecutable* WritableStreamDefaultWriterBuiltinsWrapp
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void WritableStreamDefaultWriterBuiltinsWrapper::exportNames()
+inline void UtilInspectBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* ReadableStream.ts */
-// initializeReadableStream
-#define WEBCORE_BUILTIN_READABLESTREAM_INITIALIZEREADABLESTREAM 1
-extern const char* const s_readableStreamInitializeReadableStreamCode;
-extern const int s_readableStreamInitializeReadableStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamInitializeReadableStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamInitializeReadableStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamInitializeReadableStreamCodeImplementationVisibility;
-
-// readableStreamToArray
-#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOARRAY 1
-extern const char* const s_readableStreamReadableStreamToArrayCode;
-extern const int s_readableStreamReadableStreamToArrayCodeLength;
-extern const JSC::ConstructAbility s_readableStreamReadableStreamToArrayCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamReadableStreamToArrayCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayCodeImplementationVisibility;
-
-// readableStreamToText
-#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOTEXT 1
-extern const char* const s_readableStreamReadableStreamToTextCode;
-extern const int s_readableStreamReadableStreamToTextCodeLength;
-extern const JSC::ConstructAbility s_readableStreamReadableStreamToTextCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamReadableStreamToTextCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToTextCodeImplementationVisibility;
-
-// readableStreamToArrayBuffer
-#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOARRAYBUFFER 1
-extern const char* const s_readableStreamReadableStreamToArrayBufferCode;
-extern const int s_readableStreamReadableStreamToArrayBufferCodeLength;
-extern const JSC::ConstructAbility s_readableStreamReadableStreamToArrayBufferCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamReadableStreamToArrayBufferCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayBufferCodeImplementationVisibility;
-
-// readableStreamToFormData
-#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOFORMDATA 1
-extern const char* const s_readableStreamReadableStreamToFormDataCode;
-extern const int s_readableStreamReadableStreamToFormDataCodeLength;
-extern const JSC::ConstructAbility s_readableStreamReadableStreamToFormDataCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamReadableStreamToFormDataCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToFormDataCodeImplementationVisibility;
-
-// readableStreamToJSON
-#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOJSON 1
-extern const char* const s_readableStreamReadableStreamToJSONCode;
-extern const int s_readableStreamReadableStreamToJSONCodeLength;
-extern const JSC::ConstructAbility s_readableStreamReadableStreamToJSONCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamReadableStreamToJSONCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToJSONCodeImplementationVisibility;
-
-// readableStreamToBlob
-#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOBLOB 1
-extern const char* const s_readableStreamReadableStreamToBlobCode;
-extern const int s_readableStreamReadableStreamToBlobCodeLength;
-extern const JSC::ConstructAbility s_readableStreamReadableStreamToBlobCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamReadableStreamToBlobCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToBlobCodeImplementationVisibility;
-
-// consumeReadableStream
-#define WEBCORE_BUILTIN_READABLESTREAM_CONSUMEREADABLESTREAM 1
-extern const char* const s_readableStreamConsumeReadableStreamCode;
-extern const int s_readableStreamConsumeReadableStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamConsumeReadableStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamConsumeReadableStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamConsumeReadableStreamCodeImplementationVisibility;
-
-// createEmptyReadableStream
-#define WEBCORE_BUILTIN_READABLESTREAM_CREATEEMPTYREADABLESTREAM 1
-extern const char* const s_readableStreamCreateEmptyReadableStreamCode;
-extern const int s_readableStreamCreateEmptyReadableStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamCreateEmptyReadableStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamCreateEmptyReadableStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamCreateEmptyReadableStreamCodeImplementationVisibility;
-
-// createNativeReadableStream
-#define WEBCORE_BUILTIN_READABLESTREAM_CREATENATIVEREADABLESTREAM 1
-extern const char* const s_readableStreamCreateNativeReadableStreamCode;
-extern const int s_readableStreamCreateNativeReadableStreamCodeLength;
-extern const JSC::ConstructAbility s_readableStreamCreateNativeReadableStreamCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamCreateNativeReadableStreamCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamCreateNativeReadableStreamCodeImplementationVisibility;
-
-// cancel
-#define WEBCORE_BUILTIN_READABLESTREAM_CANCEL 1
-extern const char* const s_readableStreamCancelCode;
-extern const int s_readableStreamCancelCodeLength;
-extern const JSC::ConstructAbility s_readableStreamCancelCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamCancelCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamCancelCodeImplementationVisibility;
-
-// getReader
-#define WEBCORE_BUILTIN_READABLESTREAM_GETREADER 1
-extern const char* const s_readableStreamGetReaderCode;
-extern const int s_readableStreamGetReaderCodeLength;
-extern const JSC::ConstructAbility s_readableStreamGetReaderCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamGetReaderCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamGetReaderCodeImplementationVisibility;
-
-// pipeThrough
-#define WEBCORE_BUILTIN_READABLESTREAM_PIPETHROUGH 1
-extern const char* const s_readableStreamPipeThroughCode;
-extern const int s_readableStreamPipeThroughCodeLength;
-extern const JSC::ConstructAbility s_readableStreamPipeThroughCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamPipeThroughCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamPipeThroughCodeImplementationVisibility;
-
-// pipeTo
-#define WEBCORE_BUILTIN_READABLESTREAM_PIPETO 1
-extern const char* const s_readableStreamPipeToCode;
-extern const int s_readableStreamPipeToCodeLength;
-extern const JSC::ConstructAbility s_readableStreamPipeToCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamPipeToCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamPipeToCodeImplementationVisibility;
-
-// tee
-#define WEBCORE_BUILTIN_READABLESTREAM_TEE 1
-extern const char* const s_readableStreamTeeCode;
-extern const int s_readableStreamTeeCodeLength;
-extern const JSC::ConstructAbility s_readableStreamTeeCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamTeeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamTeeCodeImplementationVisibility;
-
-// locked
-#define WEBCORE_BUILTIN_READABLESTREAM_LOCKED 1
-extern const char* const s_readableStreamLockedCode;
-extern const int s_readableStreamLockedCodeLength;
-extern const JSC::ConstructAbility s_readableStreamLockedCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamLockedCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamLockedCodeImplementationVisibility;
-
-// values
-#define WEBCORE_BUILTIN_READABLESTREAM_VALUES 1
-extern const char* const s_readableStreamValuesCode;
-extern const int s_readableStreamValuesCodeLength;
-extern const JSC::ConstructAbility s_readableStreamValuesCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamValuesCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamValuesCodeImplementationVisibility;
+/* WritableStreamDefaultController.ts */
+// error
+#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTCONTROLLER_ERROR 1
+extern const char* const s_writableStreamDefaultControllerErrorCode;
+extern const int s_writableStreamDefaultControllerErrorCodeLength;
+extern const JSC::ConstructAbility s_writableStreamDefaultControllerErrorCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamDefaultControllerErrorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamDefaultControllerErrorCodeImplementationVisibility;
-// lazyAsyncIterator
-#define WEBCORE_BUILTIN_READABLESTREAM_LAZYASYNCITERATOR 1
-extern const char* const s_readableStreamLazyAsyncIteratorCode;
-extern const int s_readableStreamLazyAsyncIteratorCodeLength;
-extern const JSC::ConstructAbility s_readableStreamLazyAsyncIteratorCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamLazyAsyncIteratorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamLazyAsyncIteratorCodeImplementationVisibility;
+// initializeWritableStreamDefaultController
+#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTCONTROLLER_INITIALIZEWRITABLESTREAMDEFAULTCONTROLLER 1
+extern const char* const s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCode;
+extern const int s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeLength;
+extern const JSC::ConstructAbility s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeImplementationVisibility;
-#define WEBCORE_FOREACH_READABLESTREAM_BUILTIN_DATA(macro) \
- macro(initializeReadableStream, readableStreamInitializeReadableStream, 3) \
- macro(readableStreamToArray, readableStreamReadableStreamToArray, 1) \
- macro(readableStreamToText, readableStreamReadableStreamToText, 1) \
- macro(readableStreamToArrayBuffer, readableStreamReadableStreamToArrayBuffer, 1) \
- macro(readableStreamToFormData, readableStreamReadableStreamToFormData, 3) \
- macro(readableStreamToJSON, readableStreamReadableStreamToJSON, 1) \
- macro(readableStreamToBlob, readableStreamReadableStreamToBlob, 1) \
- macro(consumeReadableStream, readableStreamConsumeReadableStream, 3) \
- macro(createEmptyReadableStream, readableStreamCreateEmptyReadableStream, 0) \
- macro(createNativeReadableStream, readableStreamCreateNativeReadableStream, 3) \
- macro(cancel, readableStreamCancel, 1) \
- macro(getReader, readableStreamGetReader, 1) \
- macro(pipeThrough, readableStreamPipeThrough, 2) \
- macro(pipeTo, readableStreamPipeTo, 1) \
- macro(tee, readableStreamTee, 0) \
- macro(locked, readableStreamLocked, 0) \
- macro(values, readableStreamValues, 1) \
- macro(lazyAsyncIterator, readableStreamLazyAsyncIterator, 0) \
+#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_DATA(macro) \
+ macro(error, writableStreamDefaultControllerError, 1) \
+ macro(initializeWritableStreamDefaultController, writableStreamDefaultControllerInitializeWritableStreamDefaultController, 0) \
-#define WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(macro) \
- macro(readableStreamInitializeReadableStreamCode, initializeReadableStream, ASCIILiteral(), s_readableStreamInitializeReadableStreamCodeLength) \
- macro(readableStreamReadableStreamToArrayCode, readableStreamToArray, ASCIILiteral(), s_readableStreamReadableStreamToArrayCodeLength) \
- macro(readableStreamReadableStreamToTextCode, readableStreamToText, ASCIILiteral(), s_readableStreamReadableStreamToTextCodeLength) \
- macro(readableStreamReadableStreamToArrayBufferCode, readableStreamToArrayBuffer, ASCIILiteral(), s_readableStreamReadableStreamToArrayBufferCodeLength) \
- macro(readableStreamReadableStreamToFormDataCode, readableStreamToFormData, ASCIILiteral(), s_readableStreamReadableStreamToFormDataCodeLength) \
- macro(readableStreamReadableStreamToJSONCode, readableStreamToJSON, ASCIILiteral(), s_readableStreamReadableStreamToJSONCodeLength) \
- macro(readableStreamReadableStreamToBlobCode, readableStreamToBlob, ASCIILiteral(), s_readableStreamReadableStreamToBlobCodeLength) \
- macro(readableStreamConsumeReadableStreamCode, consumeReadableStream, ASCIILiteral(), s_readableStreamConsumeReadableStreamCodeLength) \
- macro(readableStreamCreateEmptyReadableStreamCode, createEmptyReadableStream, ASCIILiteral(), s_readableStreamCreateEmptyReadableStreamCodeLength) \
- macro(readableStreamCreateNativeReadableStreamCode, createNativeReadableStream, ASCIILiteral(), s_readableStreamCreateNativeReadableStreamCodeLength) \
- macro(readableStreamCancelCode, cancel, ASCIILiteral(), s_readableStreamCancelCodeLength) \
- macro(readableStreamGetReaderCode, getReader, ASCIILiteral(), s_readableStreamGetReaderCodeLength) \
- macro(readableStreamPipeThroughCode, pipeThrough, ASCIILiteral(), s_readableStreamPipeThroughCodeLength) \
- macro(readableStreamPipeToCode, pipeTo, ASCIILiteral(), s_readableStreamPipeToCodeLength) \
- macro(readableStreamTeeCode, tee, ASCIILiteral(), s_readableStreamTeeCodeLength) \
- macro(readableStreamLockedCode, locked, "get locked"_s, s_readableStreamLockedCodeLength) \
- macro(readableStreamValuesCode, values, ASCIILiteral(), s_readableStreamValuesCodeLength) \
- macro(readableStreamLazyAsyncIteratorCode, lazyAsyncIterator, ASCIILiteral(), s_readableStreamLazyAsyncIteratorCodeLength) \
+#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(macro) \
+ macro(writableStreamDefaultControllerErrorCode, error, ASCIILiteral(), s_writableStreamDefaultControllerErrorCodeLength) \
+ macro(writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCode, initializeWritableStreamDefaultController, ASCIILiteral(), s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeLength) \
-#define WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(macro) \
- macro(initializeReadableStream) \
- macro(readableStreamToArray) \
- macro(readableStreamToText) \
- macro(readableStreamToArrayBuffer) \
- macro(readableStreamToFormData) \
- macro(readableStreamToJSON) \
- macro(readableStreamToBlob) \
- macro(consumeReadableStream) \
- macro(createEmptyReadableStream) \
- macro(createNativeReadableStream) \
- macro(cancel) \
- macro(getReader) \
- macro(pipeThrough) \
- macro(pipeTo) \
- macro(tee) \
- macro(locked) \
- macro(values) \
- macro(lazyAsyncIterator) \
+#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(macro) \
+ macro(error) \
+ macro(initializeWritableStreamDefaultController) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class ReadableStreamBuiltinsWrapper : private JSC::WeakHandleOwner {
+class WritableStreamDefaultControllerBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit ReadableStreamBuiltinsWrapper(JSC::VM& vm)
+ explicit WritableStreamDefaultControllerBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -4874,28 +4898,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* ReadableStreamBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* WritableStreamDefaultControllerBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -4905,90 +4929,123 @@ inline JSC::UnlinkedFunctionExecutable* ReadableStreamBuiltinsWrapper::name##Exe
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void ReadableStreamBuiltinsWrapper::exportNames()
+inline void WritableStreamDefaultControllerBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* ReadableStreamDefaultController.ts */
-// initializeReadableStreamDefaultController
-#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_INITIALIZEREADABLESTREAMDEFAULTCONTROLLER 1
-extern const char* const s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCode;
-extern const int s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeLength;
-extern const JSC::ConstructAbility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeImplementationVisibility;
-
-// enqueue
-#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_ENQUEUE 1
-extern const char* const s_readableStreamDefaultControllerEnqueueCode;
-extern const int s_readableStreamDefaultControllerEnqueueCodeLength;
-extern const JSC::ConstructAbility s_readableStreamDefaultControllerEnqueueCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamDefaultControllerEnqueueCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerEnqueueCodeImplementationVisibility;
-
-// error
-#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_ERROR 1
-extern const char* const s_readableStreamDefaultControllerErrorCode;
-extern const int s_readableStreamDefaultControllerErrorCodeLength;
-extern const JSC::ConstructAbility s_readableStreamDefaultControllerErrorCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamDefaultControllerErrorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerErrorCodeImplementationVisibility;
+/* WritableStreamDefaultWriter.ts */
+// abort
+#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_ABORT 1
+extern const char* const s_writableStreamDefaultWriterAbortCode;
+extern const int s_writableStreamDefaultWriterAbortCodeLength;
+extern const JSC::ConstructAbility s_writableStreamDefaultWriterAbortCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamDefaultWriterAbortCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterAbortCodeImplementationVisibility;
// close
-#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_CLOSE 1
-extern const char* const s_readableStreamDefaultControllerCloseCode;
-extern const int s_readableStreamDefaultControllerCloseCodeLength;
-extern const JSC::ConstructAbility s_readableStreamDefaultControllerCloseCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamDefaultControllerCloseCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerCloseCodeImplementationVisibility;
+#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_CLOSE 1
+extern const char* const s_writableStreamDefaultWriterCloseCode;
+extern const int s_writableStreamDefaultWriterCloseCodeLength;
+extern const JSC::ConstructAbility s_writableStreamDefaultWriterCloseCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamDefaultWriterCloseCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterCloseCodeImplementationVisibility;
+
+// closed
+#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_CLOSED 1
+extern const char* const s_writableStreamDefaultWriterClosedCode;
+extern const int s_writableStreamDefaultWriterClosedCodeLength;
+extern const JSC::ConstructAbility s_writableStreamDefaultWriterClosedCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamDefaultWriterClosedCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterClosedCodeImplementationVisibility;
// desiredSize
-#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_DESIREDSIZE 1
-extern const char* const s_readableStreamDefaultControllerDesiredSizeCode;
-extern const int s_readableStreamDefaultControllerDesiredSizeCodeLength;
-extern const JSC::ConstructAbility s_readableStreamDefaultControllerDesiredSizeCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableStreamDefaultControllerDesiredSizeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerDesiredSizeCodeImplementationVisibility;
+#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_DESIREDSIZE 1
+extern const char* const s_writableStreamDefaultWriterDesiredSizeCode;
+extern const int s_writableStreamDefaultWriterDesiredSizeCodeLength;
+extern const JSC::ConstructAbility s_writableStreamDefaultWriterDesiredSizeCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamDefaultWriterDesiredSizeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterDesiredSizeCodeImplementationVisibility;
-#define WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_DATA(macro) \
- macro(initializeReadableStreamDefaultController, readableStreamDefaultControllerInitializeReadableStreamDefaultController, 4) \
- macro(enqueue, readableStreamDefaultControllerEnqueue, 1) \
- macro(error, readableStreamDefaultControllerError, 1) \
- macro(close, readableStreamDefaultControllerClose, 0) \
- macro(desiredSize, readableStreamDefaultControllerDesiredSize, 0) \
+// initializeWritableStreamDefaultWriter
+#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_INITIALIZEWRITABLESTREAMDEFAULTWRITER 1
+extern const char* const s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCode;
+extern const int s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeLength;
+extern const JSC::ConstructAbility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeImplementationVisibility;
-#define WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(macro) \
- macro(readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCode, initializeReadableStreamDefaultController, ASCIILiteral(), s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeLength) \
- macro(readableStreamDefaultControllerEnqueueCode, enqueue, ASCIILiteral(), s_readableStreamDefaultControllerEnqueueCodeLength) \
- macro(readableStreamDefaultControllerErrorCode, error, ASCIILiteral(), s_readableStreamDefaultControllerErrorCodeLength) \
- macro(readableStreamDefaultControllerCloseCode, close, ASCIILiteral(), s_readableStreamDefaultControllerCloseCodeLength) \
- macro(readableStreamDefaultControllerDesiredSizeCode, desiredSize, "get desiredSize"_s, s_readableStreamDefaultControllerDesiredSizeCodeLength) \
+// ready
+#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_READY 1
+extern const char* const s_writableStreamDefaultWriterReadyCode;
+extern const int s_writableStreamDefaultWriterReadyCodeLength;
+extern const JSC::ConstructAbility s_writableStreamDefaultWriterReadyCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamDefaultWriterReadyCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterReadyCodeImplementationVisibility;
-#define WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(macro) \
- macro(initializeReadableStreamDefaultController) \
- macro(enqueue) \
- macro(error) \
+// releaseLock
+#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_RELEASELOCK 1
+extern const char* const s_writableStreamDefaultWriterReleaseLockCode;
+extern const int s_writableStreamDefaultWriterReleaseLockCodeLength;
+extern const JSC::ConstructAbility s_writableStreamDefaultWriterReleaseLockCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamDefaultWriterReleaseLockCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterReleaseLockCodeImplementationVisibility;
+
+// write
+#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_WRITE 1
+extern const char* const s_writableStreamDefaultWriterWriteCode;
+extern const int s_writableStreamDefaultWriterWriteCodeLength;
+extern const JSC::ConstructAbility s_writableStreamDefaultWriterWriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamDefaultWriterWriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterWriteCodeImplementationVisibility;
+
+#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_DATA(macro) \
+ macro(abort, writableStreamDefaultWriterAbort, 1) \
+ macro(close, writableStreamDefaultWriterClose, 0) \
+ macro(closed, writableStreamDefaultWriterClosed, 0) \
+ macro(desiredSize, writableStreamDefaultWriterDesiredSize, 0) \
+ macro(initializeWritableStreamDefaultWriter, writableStreamDefaultWriterInitializeWritableStreamDefaultWriter, 1) \
+ macro(ready, writableStreamDefaultWriterReady, 0) \
+ macro(releaseLock, writableStreamDefaultWriterReleaseLock, 0) \
+ macro(write, writableStreamDefaultWriterWrite, 1) \
+
+#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(macro) \
+ macro(writableStreamDefaultWriterAbortCode, abort, ASCIILiteral(), s_writableStreamDefaultWriterAbortCodeLength) \
+ macro(writableStreamDefaultWriterCloseCode, close, ASCIILiteral(), s_writableStreamDefaultWriterCloseCodeLength) \
+ macro(writableStreamDefaultWriterClosedCode, closed, "get closed"_s, s_writableStreamDefaultWriterClosedCodeLength) \
+ macro(writableStreamDefaultWriterDesiredSizeCode, desiredSize, "get desiredSize"_s, s_writableStreamDefaultWriterDesiredSizeCodeLength) \
+ macro(writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCode, initializeWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeLength) \
+ macro(writableStreamDefaultWriterReadyCode, ready, "get ready"_s, s_writableStreamDefaultWriterReadyCodeLength) \
+ macro(writableStreamDefaultWriterReleaseLockCode, releaseLock, ASCIILiteral(), s_writableStreamDefaultWriterReleaseLockCodeLength) \
+ macro(writableStreamDefaultWriterWriteCode, write, ASCIILiteral(), s_writableStreamDefaultWriterWriteCodeLength) \
+
+#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(macro) \
+ macro(abort) \
macro(close) \
+ macro(closed) \
macro(desiredSize) \
+ macro(initializeWritableStreamDefaultWriter) \
+ macro(ready) \
+ macro(releaseLock) \
+ macro(write) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class ReadableStreamDefaultControllerBuiltinsWrapper : private JSC::WeakHandleOwner {
+class WritableStreamDefaultWriterBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit ReadableStreamDefaultControllerBuiltinsWrapper(JSC::VM& vm)
+ explicit WritableStreamDefaultWriterBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -4996,28 +5053,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* ReadableStreamDefaultControllerBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* WritableStreamDefaultWriterBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -5027,554 +5084,574 @@ inline JSC::UnlinkedFunctionExecutable* ReadableStreamDefaultControllerBuiltinsW
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void ReadableStreamDefaultControllerBuiltinsWrapper::exportNames()
+inline void WritableStreamDefaultWriterBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* ReadableByteStreamInternals.ts */
-// privateInitializeReadableByteStreamController
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_PRIVATEINITIALIZEREADABLEBYTESTREAMCONTROLLER 1
-extern const char* const s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode;
-extern const int s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeImplementationVisibility;
-
-// readableStreamByteStreamControllerStart
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMBYTESTREAMCONTROLLERSTART 1
-extern const char* const s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCode;
-extern const int s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeImplementationVisibility;
-
-// privateInitializeReadableStreamBYOBRequest
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_PRIVATEINITIALIZEREADABLESTREAMBYOBREQUEST 1
-extern const char* const s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCode;
-extern const int s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeImplementationVisibility;
-
-// isReadableByteStreamController
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_ISREADABLEBYTESTREAMCONTROLLER 1
-extern const char* const s_readableByteStreamInternalsIsReadableByteStreamControllerCode;
-extern const int s_readableByteStreamInternalsIsReadableByteStreamControllerCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeImplementationVisibility;
-
-// isReadableStreamBYOBRequest
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_ISREADABLESTREAMBYOBREQUEST 1
-extern const char* const s_readableByteStreamInternalsIsReadableStreamBYOBRequestCode;
-extern const int s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeImplementationVisibility;
-
-// isReadableStreamBYOBReader
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_ISREADABLESTREAMBYOBREADER 1
-extern const char* const s_readableByteStreamInternalsIsReadableStreamBYOBReaderCode;
-extern const int s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeImplementationVisibility;
-
-// readableByteStreamControllerCancel
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCANCEL 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCancelCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeImplementationVisibility;
-
-// readableByteStreamControllerError
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERERROR 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerErrorCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeImplementationVisibility;
-
-// readableByteStreamControllerClose
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCLOSE 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCloseCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeImplementationVisibility;
-
-// readableByteStreamControllerClearPendingPullIntos
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCLEARPENDINGPULLINTOS 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeImplementationVisibility;
+/* WritableStreamInternals.ts */
+// acquireWritableStreamDefaultWriter
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ACQUIREWRITABLESTREAMDEFAULTWRITER 1
+extern const char* const s_writableStreamInternalsAcquireWritableStreamDefaultWriterCode;
+extern const int s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeImplementationVisibility;
-// readableByteStreamControllerGetDesiredSize
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERGETDESIREDSIZE 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeImplementationVisibility;
+// createInternalWritableStreamFromUnderlyingSink
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_CREATEINTERNALWRITABLESTREAMFROMUNDERLYINGSINK 1
+extern const char* const s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode;
+extern const int s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeImplementationVisibility;
-// readableStreamHasBYOBReader
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMHASBYOBREADER 1
-extern const char* const s_readableByteStreamInternalsReadableStreamHasBYOBReaderCode;
-extern const int s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeImplementationVisibility;
+// createWritableStream
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_CREATEWRITABLESTREAM 1
+extern const char* const s_writableStreamInternalsCreateWritableStreamCode;
+extern const int s_writableStreamInternalsCreateWritableStreamCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsCreateWritableStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsCreateWritableStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsCreateWritableStreamCodeImplementationVisibility;
-// readableStreamHasDefaultReader
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMHASDEFAULTREADER 1
-extern const char* const s_readableByteStreamInternalsReadableStreamHasDefaultReaderCode;
-extern const int s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeImplementationVisibility;
+// initializeWritableStreamSlots
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_INITIALIZEWRITABLESTREAMSLOTS 1
+extern const char* const s_writableStreamInternalsInitializeWritableStreamSlotsCode;
+extern const int s_writableStreamInternalsInitializeWritableStreamSlotsCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsInitializeWritableStreamSlotsCodeImplementationVisibility;
-// readableByteStreamControllerHandleQueueDrain
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERHANDLEQUEUEDRAIN 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeImplementationVisibility;
+// isCloseSentinel
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISCLOSESENTINEL 1
+extern const char* const s_writableStreamInternalsIsCloseSentinelCode;
+extern const int s_writableStreamInternalsIsCloseSentinelCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsIsCloseSentinelCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsIsCloseSentinelCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsIsCloseSentinelCodeImplementationVisibility;
-// readableByteStreamControllerPull
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERPULL 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerPullCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeImplementationVisibility;
+// isWritableStream
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISWRITABLESTREAM 1
+extern const char* const s_writableStreamInternalsIsWritableStreamCode;
+extern const int s_writableStreamInternalsIsWritableStreamCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamCodeImplementationVisibility;
-// readableByteStreamControllerShouldCallPull
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERSHOULDCALLPULL 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeImplementationVisibility;
+// isWritableStreamDefaultWriter
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISWRITABLESTREAMDEFAULTWRITER 1
+extern const char* const s_writableStreamInternalsIsWritableStreamDefaultWriterCode;
+extern const int s_writableStreamInternalsIsWritableStreamDefaultWriterCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeImplementationVisibility;
-// readableByteStreamControllerCallPullIfNeeded
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCALLPULLIFNEEDED 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeImplementationVisibility;
+// isWritableStreamLocked
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISWRITABLESTREAMLOCKED 1
+extern const char* const s_writableStreamInternalsIsWritableStreamLockedCode;
+extern const int s_writableStreamInternalsIsWritableStreamLockedCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamLockedCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamLockedCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamLockedCodeImplementationVisibility;
-// transferBufferToCurrentRealm
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_TRANSFERBUFFERTOCURRENTREALM 1
-extern const char* const s_readableByteStreamInternalsTransferBufferToCurrentRealmCode;
-extern const int s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeImplementationVisibility;
+// setUpWritableStreamDefaultController
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_SETUPWRITABLESTREAMDEFAULTCONTROLLER 1
+extern const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerCode;
+extern const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeImplementationVisibility;
-// readableStreamReaderKind
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMREADERKIND 1
-extern const char* const s_readableByteStreamInternalsReadableStreamReaderKindCode;
-extern const int s_readableByteStreamInternalsReadableStreamReaderKindCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamReaderKindCodeImplementationVisibility;
+// setUpWritableStreamDefaultControllerFromUnderlyingSink
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_SETUPWRITABLESTREAMDEFAULTCONTROLLERFROMUNDERLYINGSINK 1
+extern const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCode;
+extern const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeImplementationVisibility;
-// readableByteStreamControllerEnqueue
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERENQUEUE 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeImplementationVisibility;
+// setUpWritableStreamDefaultWriter
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_SETUPWRITABLESTREAMDEFAULTWRITER 1
+extern const char* const s_writableStreamInternalsSetUpWritableStreamDefaultWriterCode;
+extern const int s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeImplementationVisibility;
-// readableByteStreamControllerEnqueueChunk
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERENQUEUECHUNK 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeImplementationVisibility;
+// writableStreamAbort
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMABORT 1
+extern const char* const s_writableStreamInternalsWritableStreamAbortCode;
+extern const int s_writableStreamInternalsWritableStreamAbortCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortCodeImplementationVisibility;
-// readableByteStreamControllerRespondWithNewView
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDWITHNEWVIEW 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeImplementationVisibility;
+// writableStreamAbortForBindings
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMABORTFORBINDINGS 1
+extern const char* const s_writableStreamInternalsWritableStreamAbortForBindingsCode;
+extern const int s_writableStreamInternalsWritableStreamAbortForBindingsCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortForBindingsCodeImplementationVisibility;
-// readableByteStreamControllerRespond
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPOND 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeImplementationVisibility;
+// writableStreamAddWriteRequest
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMADDWRITEREQUEST 1
+extern const char* const s_writableStreamInternalsWritableStreamAddWriteRequestCode;
+extern const int s_writableStreamInternalsWritableStreamAddWriteRequestCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAddWriteRequestCodeImplementationVisibility;
-// readableByteStreamControllerRespondInternal
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDINTERNAL 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeImplementationVisibility;
+// writableStreamClose
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMCLOSE 1
+extern const char* const s_writableStreamInternalsWritableStreamCloseCode;
+extern const int s_writableStreamInternalsWritableStreamCloseCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseCodeImplementationVisibility;
-// readableByteStreamControllerRespondInReadableState
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDINREADABLESTATE 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeImplementationVisibility;
+// writableStreamCloseForBindings
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMCLOSEFORBINDINGS 1
+extern const char* const s_writableStreamInternalsWritableStreamCloseForBindingsCode;
+extern const int s_writableStreamInternalsWritableStreamCloseForBindingsCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseForBindingsCodeImplementationVisibility;
-// readableByteStreamControllerRespondInClosedState
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDINCLOSEDSTATE 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeImplementationVisibility;
+// writableStreamCloseQueuedOrInFlight
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMCLOSEQUEUEDORINFLIGHT 1
+extern const char* const s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCode;
+extern const int s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeImplementationVisibility;
-// readableByteStreamControllerProcessPullDescriptors
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERPROCESSPULLDESCRIPTORS 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeImplementationVisibility;
+// writableStreamDealWithRejection
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEALWITHREJECTION 1
+extern const char* const s_writableStreamInternalsWritableStreamDealWithRejectionCode;
+extern const int s_writableStreamInternalsWritableStreamDealWithRejectionCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDealWithRejectionCodeImplementationVisibility;
-// readableByteStreamControllerFillDescriptorFromQueue
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERFILLDESCRIPTORFROMQUEUE 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeImplementationVisibility;
+// writableStreamDefaultControllerAdvanceQueueIfNeeded
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERADVANCEQUEUEIFNEEDED 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeImplementationVisibility;
-// readableByteStreamControllerShiftPendingDescriptor
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERSHIFTPENDINGDESCRIPTOR 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeImplementationVisibility;
+// writableStreamDefaultControllerClearAlgorithms
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERCLEARALGORITHMS 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility;
-// readableByteStreamControllerInvalidateBYOBRequest
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERINVALIDATEBYOBREQUEST 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeImplementationVisibility;
+// writableStreamDefaultControllerClose
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERCLOSE 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerCloseCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeImplementationVisibility;
-// readableByteStreamControllerCommitDescriptor
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCOMMITDESCRIPTOR 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeImplementationVisibility;
+// writableStreamDefaultControllerError
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERERROR 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeImplementationVisibility;
-// readableByteStreamControllerConvertDescriptor
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCONVERTDESCRIPTOR 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeImplementationVisibility;
+// writableStreamDefaultControllerErrorIfNeeded
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERERRORIFNEEDED 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeImplementationVisibility;
-// readableStreamFulfillReadIntoRequest
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMFULFILLREADINTOREQUEST 1
-extern const char* const s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCode;
-extern const int s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeImplementationVisibility;
+// writableStreamDefaultControllerGetBackpressure
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERGETBACKPRESSURE 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeImplementationVisibility;
-// readableStreamBYOBReaderRead
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMBYOBREADERREAD 1
-extern const char* const s_readableByteStreamInternalsReadableStreamBYOBReaderReadCode;
-extern const int s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeImplementationVisibility;
+// writableStreamDefaultControllerGetChunkSize
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERGETCHUNKSIZE 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeImplementationVisibility;
-// readableByteStreamControllerPullInto
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERPULLINTO 1
-extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCode;
-extern const int s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeImplementationVisibility;
+// writableStreamDefaultControllerGetDesiredSize
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERGETDESIREDSIZE 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility;
-// readableStreamAddReadIntoRequest
-#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMADDREADINTOREQUEST 1
-extern const char* const s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCode;
-extern const int s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeLength;
-extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructAbility;
-extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeImplementationVisibility;
+// writableStreamDefaultControllerProcessClose
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERPROCESSCLOSE 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeImplementationVisibility;
-#define WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_DATA(macro) \
- macro(privateInitializeReadableByteStreamController, readableByteStreamInternalsPrivateInitializeReadableByteStreamController, 3) \
- macro(readableStreamByteStreamControllerStart, readableByteStreamInternalsReadableStreamByteStreamControllerStart, 1) \
- macro(privateInitializeReadableStreamBYOBRequest, readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequest, 2) \
- macro(isReadableByteStreamController, readableByteStreamInternalsIsReadableByteStreamController, 1) \
- macro(isReadableStreamBYOBRequest, readableByteStreamInternalsIsReadableStreamBYOBRequest, 1) \
- macro(isReadableStreamBYOBReader, readableByteStreamInternalsIsReadableStreamBYOBReader, 1) \
- macro(readableByteStreamControllerCancel, readableByteStreamInternalsReadableByteStreamControllerCancel, 2) \
- macro(readableByteStreamControllerError, readableByteStreamInternalsReadableByteStreamControllerError, 2) \
- macro(readableByteStreamControllerClose, readableByteStreamInternalsReadableByteStreamControllerClose, 1) \
- macro(readableByteStreamControllerClearPendingPullIntos, readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntos, 1) \
- macro(readableByteStreamControllerGetDesiredSize, readableByteStreamInternalsReadableByteStreamControllerGetDesiredSize, 1) \
- macro(readableStreamHasBYOBReader, readableByteStreamInternalsReadableStreamHasBYOBReader, 1) \
- macro(readableStreamHasDefaultReader, readableByteStreamInternalsReadableStreamHasDefaultReader, 1) \
- macro(readableByteStreamControllerHandleQueueDrain, readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrain, 1) \
- macro(readableByteStreamControllerPull, readableByteStreamInternalsReadableByteStreamControllerPull, 1) \
- macro(readableByteStreamControllerShouldCallPull, readableByteStreamInternalsReadableByteStreamControllerShouldCallPull, 1) \
- macro(readableByteStreamControllerCallPullIfNeeded, readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeeded, 1) \
- macro(transferBufferToCurrentRealm, readableByteStreamInternalsTransferBufferToCurrentRealm, 1) \
- macro(readableStreamReaderKind, readableByteStreamInternalsReadableStreamReaderKind, 1) \
- macro(readableByteStreamControllerEnqueue, readableByteStreamInternalsReadableByteStreamControllerEnqueue, 2) \
- macro(readableByteStreamControllerEnqueueChunk, readableByteStreamInternalsReadableByteStreamControllerEnqueueChunk, 4) \
- macro(readableByteStreamControllerRespondWithNewView, readableByteStreamInternalsReadableByteStreamControllerRespondWithNewView, 2) \
- macro(readableByteStreamControllerRespond, readableByteStreamInternalsReadableByteStreamControllerRespond, 2) \
- macro(readableByteStreamControllerRespondInternal, readableByteStreamInternalsReadableByteStreamControllerRespondInternal, 2) \
- macro(readableByteStreamControllerRespondInReadableState, readableByteStreamInternalsReadableByteStreamControllerRespondInReadableState, 3) \
- macro(readableByteStreamControllerRespondInClosedState, readableByteStreamInternalsReadableByteStreamControllerRespondInClosedState, 2) \
- macro(readableByteStreamControllerProcessPullDescriptors, readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptors, 1) \
- macro(readableByteStreamControllerFillDescriptorFromQueue, readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueue, 2) \
- macro(readableByteStreamControllerShiftPendingDescriptor, readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptor, 1) \
- macro(readableByteStreamControllerInvalidateBYOBRequest, readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequest, 1) \
- macro(readableByteStreamControllerCommitDescriptor, readableByteStreamInternalsReadableByteStreamControllerCommitDescriptor, 2) \
- macro(readableByteStreamControllerConvertDescriptor, readableByteStreamInternalsReadableByteStreamControllerConvertDescriptor, 1) \
- macro(readableStreamFulfillReadIntoRequest, readableByteStreamInternalsReadableStreamFulfillReadIntoRequest, 3) \
- macro(readableStreamBYOBReaderRead, readableByteStreamInternalsReadableStreamBYOBReaderRead, 2) \
- macro(readableByteStreamControllerPullInto, readableByteStreamInternalsReadableByteStreamControllerPullInto, 2) \
- macro(readableStreamAddReadIntoRequest, readableByteStreamInternalsReadableStreamAddReadIntoRequest, 1) \
+// writableStreamDefaultControllerProcessWrite
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERPROCESSWRITE 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeImplementationVisibility;
-#define WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(macro) \
- macro(readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode, privateInitializeReadableByteStreamController, ASCIILiteral(), s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength) \
- macro(readableByteStreamInternalsReadableStreamByteStreamControllerStartCode, readableStreamByteStreamControllerStart, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeLength) \
- macro(readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCode, privateInitializeReadableStreamBYOBRequest, ASCIILiteral(), s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeLength) \
- macro(readableByteStreamInternalsIsReadableByteStreamControllerCode, isReadableByteStreamController, ASCIILiteral(), s_readableByteStreamInternalsIsReadableByteStreamControllerCodeLength) \
- macro(readableByteStreamInternalsIsReadableStreamBYOBRequestCode, isReadableStreamBYOBRequest, ASCIILiteral(), s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeLength) \
- macro(readableByteStreamInternalsIsReadableStreamBYOBReaderCode, isReadableStreamBYOBReader, ASCIILiteral(), s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerCancelCode, readableByteStreamControllerCancel, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerErrorCode, readableByteStreamControllerError, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerCloseCode, readableByteStreamControllerClose, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCode, readableByteStreamControllerClearPendingPullIntos, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCode, readableByteStreamControllerGetDesiredSize, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeLength) \
- macro(readableByteStreamInternalsReadableStreamHasBYOBReaderCode, readableStreamHasBYOBReader, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeLength) \
- macro(readableByteStreamInternalsReadableStreamHasDefaultReaderCode, readableStreamHasDefaultReader, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCode, readableByteStreamControllerHandleQueueDrain, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerPullCode, readableByteStreamControllerPull, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerPullCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode, readableByteStreamControllerShouldCallPull, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCode, readableByteStreamControllerCallPullIfNeeded, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeLength) \
- macro(readableByteStreamInternalsTransferBufferToCurrentRealmCode, transferBufferToCurrentRealm, ASCIILiteral(), s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeLength) \
- macro(readableByteStreamInternalsReadableStreamReaderKindCode, readableStreamReaderKind, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamReaderKindCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerEnqueueCode, readableByteStreamControllerEnqueue, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode, readableByteStreamControllerEnqueueChunk, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCode, readableByteStreamControllerRespondWithNewView, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerRespondCode, readableByteStreamControllerRespond, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode, readableByteStreamControllerRespondInternal, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCode, readableByteStreamControllerRespondInReadableState, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCode, readableByteStreamControllerRespondInClosedState, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCode, readableByteStreamControllerProcessPullDescriptors, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode, readableByteStreamControllerFillDescriptorFromQueue, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCode, readableByteStreamControllerShiftPendingDescriptor, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCode, readableByteStreamControllerInvalidateBYOBRequest, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCode, readableByteStreamControllerCommitDescriptor, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCode, readableByteStreamControllerConvertDescriptor, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeLength) \
- macro(readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCode, readableStreamFulfillReadIntoRequest, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeLength) \
- macro(readableByteStreamInternalsReadableStreamBYOBReaderReadCode, readableStreamBYOBReaderRead, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeLength) \
- macro(readableByteStreamInternalsReadableByteStreamControllerPullIntoCode, readableByteStreamControllerPullInto, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeLength) \
- macro(readableByteStreamInternalsReadableStreamAddReadIntoRequestCode, readableStreamAddReadIntoRequest, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeLength) \
+// writableStreamDefaultControllerStart
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERSTART 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerStartCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultControllerStartCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeImplementationVisibility;
-#define WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \
- macro(privateInitializeReadableByteStreamController) \
- macro(readableStreamByteStreamControllerStart) \
- macro(privateInitializeReadableStreamBYOBRequest) \
- macro(isReadableByteStreamController) \
- macro(isReadableStreamBYOBRequest) \
- macro(isReadableStreamBYOBReader) \
- macro(readableByteStreamControllerCancel) \
- macro(readableByteStreamControllerError) \
- macro(readableByteStreamControllerClose) \
- macro(readableByteStreamControllerClearPendingPullIntos) \
- macro(readableByteStreamControllerGetDesiredSize) \
- macro(readableStreamHasBYOBReader) \
- macro(readableStreamHasDefaultReader) \
- macro(readableByteStreamControllerHandleQueueDrain) \
- macro(readableByteStreamControllerPull) \
- macro(readableByteStreamControllerShouldCallPull) \
- macro(readableByteStreamControllerCallPullIfNeeded) \
- macro(transferBufferToCurrentRealm) \
- macro(readableStreamReaderKind) \
- macro(readableByteStreamControllerEnqueue) \
- macro(readableByteStreamControllerEnqueueChunk) \
- macro(readableByteStreamControllerRespondWithNewView) \
- macro(readableByteStreamControllerRespond) \
- macro(readableByteStreamControllerRespondInternal) \
- macro(readableByteStreamControllerRespondInReadableState) \
- macro(readableByteStreamControllerRespondInClosedState) \
- macro(readableByteStreamControllerProcessPullDescriptors) \
- macro(readableByteStreamControllerFillDescriptorFromQueue) \
- macro(readableByteStreamControllerShiftPendingDescriptor) \
- macro(readableByteStreamControllerInvalidateBYOBRequest) \
- macro(readableByteStreamControllerCommitDescriptor) \
- macro(readableByteStreamControllerConvertDescriptor) \
- macro(readableStreamFulfillReadIntoRequest) \
- macro(readableStreamBYOBReaderRead) \
- macro(readableByteStreamControllerPullInto) \
- macro(readableStreamAddReadIntoRequest) \
+// writableStreamDefaultControllerWrite
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERWRITE 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerWriteCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeImplementationVisibility;
-#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
- JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
+// writableStreamDefaultWriterAbort
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERABORT 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterAbortCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeImplementationVisibility;
-WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
-#undef DECLARE_BUILTIN_GENERATOR
+// writableStreamDefaultWriterClose
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERCLOSE 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeImplementationVisibility;
-class ReadableByteStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner {
-public:
- explicit ReadableByteStreamInternalsBuiltinsWrapper(JSC::VM& vm)
- : m_vm(vm)
- WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
-#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
- {
- }
+// writableStreamDefaultWriterCloseWithErrorPropagation
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERCLOSEWITHERRORPROPAGATION 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeImplementationVisibility;
-#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
- JSC::UnlinkedFunctionExecutable* name##Executable(); \
- const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
-#undef EXPOSE_BUILTIN_EXECUTABLES
+// writableStreamDefaultWriterEnsureClosedPromiseRejected
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERENSURECLOSEDPROMISEREJECTED 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeImplementationVisibility;
- WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+// writableStreamDefaultWriterEnsureReadyPromiseRejected
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERENSUREREADYPROMISEREJECTED 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeImplementationVisibility;
- void exportNames();
+// writableStreamDefaultWriterGetDesiredSize
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERGETDESIREDSIZE 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeImplementationVisibility;
-private:
- JSC::VM& m_vm;
+// writableStreamDefaultWriterRelease
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERRELEASE 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterReleaseCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeImplementationVisibility;
- WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+// writableStreamDefaultWriterWrite
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERWRITE 1
+extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterWriteCode;
+extern const int s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeImplementationVisibility;
-#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
- JSC::SourceCode m_##name##Source;\
- JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
-#undef DECLARE_BUILTIN_SOURCE_MEMBERS
+// writableStreamFinishErroring
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHERRORING 1
+extern const char* const s_writableStreamInternalsWritableStreamFinishErroringCode;
+extern const int s_writableStreamInternalsWritableStreamFinishErroringCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishErroringCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishErroringCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishErroringCodeImplementationVisibility;
-};
+// writableStreamFinishInFlightClose
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTCLOSE 1
+extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseCode;
+extern const int s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeImplementationVisibility;
-#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* ReadableByteStreamInternalsBuiltinsWrapper::name##Executable() \
-{\
- if (!m_##name##Executable) {\
- JSC::Identifier executableName = functionName##PublicName();\
- if (overriddenName)\
- executableName = JSC::Identifier::fromString(m_vm, overriddenName);\
- m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\
- }\
- return m_##name##Executable.get();\
-}
-WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
-#undef DEFINE_BUILTIN_EXECUTABLES
+// writableStreamFinishInFlightCloseWithError
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTCLOSEWITHERROR 1
+extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode;
+extern const int s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeImplementationVisibility;
-inline void ReadableByteStreamInternalsBuiltinsWrapper::exportNames()
-{
-#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
-#undef EXPORT_FUNCTION_NAME
-}
-class ReadableByteStreamInternalsBuiltinFunctions {
-public:
- explicit ReadableByteStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
+// writableStreamFinishInFlightWrite
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTWRITE 1
+extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteCode;
+extern const int s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeImplementationVisibility;
- void init(JSC::JSGlobalObject&);
- template<typename Visitor> void visit(Visitor&);
+// writableStreamFinishInFlightWriteWithError
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTWRITEWITHERROR 1
+extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCode;
+extern const int s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeImplementationVisibility;
-public:
- JSC::VM& m_vm;
+// writableStreamHasOperationMarkedInFlight
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMHASOPERATIONMARKEDINFLIGHT 1
+extern const char* const s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCode;
+extern const int s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeImplementationVisibility;
-#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \
- JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
- WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
-#undef DECLARE_BUILTIN_SOURCE_MEMBERS
-};
+// writableStreamMarkCloseRequestInFlight
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMMARKCLOSEREQUESTINFLIGHT 1
+extern const char* const s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCode;
+extern const int s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeImplementationVisibility;
-inline void ReadableByteStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
-{
-#define EXPORT_FUNCTION(codeName, functionName, overriddenName, length) \
- m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create(m_vm, codeName##Generator(m_vm), &globalObject));
- WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION)
-#undef EXPORT_FUNCTION
-}
+// writableStreamMarkFirstWriteRequestInFlight
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMMARKFIRSTWRITEREQUESTINFLIGHT 1
+extern const char* const s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCode;
+extern const int s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeImplementationVisibility;
-template<typename Visitor>
-inline void ReadableByteStreamInternalsBuiltinFunctions::visit(Visitor& visitor)
-{
-#define VISIT_FUNCTION(name) visitor.append(m_##name##Function);
- WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
-#undef VISIT_FUNCTION
-}
+// writableStreamRejectCloseAndClosedPromiseIfNeeded
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMREJECTCLOSEANDCLOSEDPROMISEIFNEEDED 1
+extern const char* const s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode;
+extern const int s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeImplementationVisibility;
-template void ReadableByteStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&);
-template void ReadableByteStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&);
- /* WritableStreamDefaultController.ts */
-// initializeWritableStreamDefaultController
-#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTCONTROLLER_INITIALIZEWRITABLESTREAMDEFAULTCONTROLLER 1
-extern const char* const s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCode;
-extern const int s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeLength;
-extern const JSC::ConstructAbility s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeImplementationVisibility;
+// writableStreamStartErroring
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMSTARTERRORING 1
+extern const char* const s_writableStreamInternalsWritableStreamStartErroringCode;
+extern const int s_writableStreamInternalsWritableStreamStartErroringCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamStartErroringCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamStartErroringCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamStartErroringCodeImplementationVisibility;
-// error
-#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTCONTROLLER_ERROR 1
-extern const char* const s_writableStreamDefaultControllerErrorCode;
-extern const int s_writableStreamDefaultControllerErrorCodeLength;
-extern const JSC::ConstructAbility s_writableStreamDefaultControllerErrorCodeConstructAbility;
-extern const JSC::ConstructorKind s_writableStreamDefaultControllerErrorCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_writableStreamDefaultControllerErrorCodeImplementationVisibility;
+// writableStreamUpdateBackpressure
+#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMUPDATEBACKPRESSURE 1
+extern const char* const s_writableStreamInternalsWritableStreamUpdateBackpressureCode;
+extern const int s_writableStreamInternalsWritableStreamUpdateBackpressureCodeLength;
+extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructAbility;
+extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeImplementationVisibility;
-#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_DATA(macro) \
- macro(initializeWritableStreamDefaultController, writableStreamDefaultControllerInitializeWritableStreamDefaultController, 0) \
- macro(error, writableStreamDefaultControllerError, 1) \
+#define WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_DATA(macro) \
+ macro(acquireWritableStreamDefaultWriter, writableStreamInternalsAcquireWritableStreamDefaultWriter, 1) \
+ macro(createInternalWritableStreamFromUnderlyingSink, writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSink, 2) \
+ macro(createWritableStream, writableStreamInternalsCreateWritableStream, 7) \
+ macro(initializeWritableStreamSlots, writableStreamInternalsInitializeWritableStreamSlots, 2) \
+ macro(isCloseSentinel, writableStreamInternalsIsCloseSentinel, 0) \
+ macro(isWritableStream, writableStreamInternalsIsWritableStream, 1) \
+ macro(isWritableStreamDefaultWriter, writableStreamInternalsIsWritableStreamDefaultWriter, 1) \
+ macro(isWritableStreamLocked, writableStreamInternalsIsWritableStreamLocked, 1) \
+ macro(setUpWritableStreamDefaultController, writableStreamInternalsSetUpWritableStreamDefaultController, 9) \
+ macro(setUpWritableStreamDefaultControllerFromUnderlyingSink, writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSink, 6) \
+ macro(setUpWritableStreamDefaultWriter, writableStreamInternalsSetUpWritableStreamDefaultWriter, 2) \
+ macro(writableStreamAbort, writableStreamInternalsWritableStreamAbort, 2) \
+ macro(writableStreamAbortForBindings, writableStreamInternalsWritableStreamAbortForBindings, 2) \
+ macro(writableStreamAddWriteRequest, writableStreamInternalsWritableStreamAddWriteRequest, 1) \
+ macro(writableStreamClose, writableStreamInternalsWritableStreamClose, 1) \
+ macro(writableStreamCloseForBindings, writableStreamInternalsWritableStreamCloseForBindings, 1) \
+ macro(writableStreamCloseQueuedOrInFlight, writableStreamInternalsWritableStreamCloseQueuedOrInFlight, 1) \
+ macro(writableStreamDealWithRejection, writableStreamInternalsWritableStreamDealWithRejection, 2) \
+ macro(writableStreamDefaultControllerAdvanceQueueIfNeeded, writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeeded, 1) \
+ macro(writableStreamDefaultControllerClearAlgorithms, writableStreamInternalsWritableStreamDefaultControllerClearAlgorithms, 1) \
+ macro(writableStreamDefaultControllerClose, writableStreamInternalsWritableStreamDefaultControllerClose, 1) \
+ macro(writableStreamDefaultControllerError, writableStreamInternalsWritableStreamDefaultControllerError, 2) \
+ macro(writableStreamDefaultControllerErrorIfNeeded, writableStreamInternalsWritableStreamDefaultControllerErrorIfNeeded, 2) \
+ macro(writableStreamDefaultControllerGetBackpressure, writableStreamInternalsWritableStreamDefaultControllerGetBackpressure, 1) \
+ macro(writableStreamDefaultControllerGetChunkSize, writableStreamInternalsWritableStreamDefaultControllerGetChunkSize, 2) \
+ macro(writableStreamDefaultControllerGetDesiredSize, writableStreamInternalsWritableStreamDefaultControllerGetDesiredSize, 1) \
+ macro(writableStreamDefaultControllerProcessClose, writableStreamInternalsWritableStreamDefaultControllerProcessClose, 1) \
+ macro(writableStreamDefaultControllerProcessWrite, writableStreamInternalsWritableStreamDefaultControllerProcessWrite, 2) \
+ macro(writableStreamDefaultControllerStart, writableStreamInternalsWritableStreamDefaultControllerStart, 1) \
+ macro(writableStreamDefaultControllerWrite, writableStreamInternalsWritableStreamDefaultControllerWrite, 3) \
+ macro(writableStreamDefaultWriterAbort, writableStreamInternalsWritableStreamDefaultWriterAbort, 2) \
+ macro(writableStreamDefaultWriterClose, writableStreamInternalsWritableStreamDefaultWriterClose, 1) \
+ macro(writableStreamDefaultWriterCloseWithErrorPropagation, writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagation, 1) \
+ macro(writableStreamDefaultWriterEnsureClosedPromiseRejected, writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejected, 2) \
+ macro(writableStreamDefaultWriterEnsureReadyPromiseRejected, writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejected, 2) \
+ macro(writableStreamDefaultWriterGetDesiredSize, writableStreamInternalsWritableStreamDefaultWriterGetDesiredSize, 1) \
+ macro(writableStreamDefaultWriterRelease, writableStreamInternalsWritableStreamDefaultWriterRelease, 1) \
+ macro(writableStreamDefaultWriterWrite, writableStreamInternalsWritableStreamDefaultWriterWrite, 2) \
+ macro(writableStreamFinishErroring, writableStreamInternalsWritableStreamFinishErroring, 1) \
+ macro(writableStreamFinishInFlightClose, writableStreamInternalsWritableStreamFinishInFlightClose, 1) \
+ macro(writableStreamFinishInFlightCloseWithError, writableStreamInternalsWritableStreamFinishInFlightCloseWithError, 2) \
+ macro(writableStreamFinishInFlightWrite, writableStreamInternalsWritableStreamFinishInFlightWrite, 1) \
+ macro(writableStreamFinishInFlightWriteWithError, writableStreamInternalsWritableStreamFinishInFlightWriteWithError, 2) \
+ macro(writableStreamHasOperationMarkedInFlight, writableStreamInternalsWritableStreamHasOperationMarkedInFlight, 1) \
+ macro(writableStreamMarkCloseRequestInFlight, writableStreamInternalsWritableStreamMarkCloseRequestInFlight, 1) \
+ macro(writableStreamMarkFirstWriteRequestInFlight, writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlight, 1) \
+ macro(writableStreamRejectCloseAndClosedPromiseIfNeeded, writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeeded, 1) \
+ macro(writableStreamStartErroring, writableStreamInternalsWritableStreamStartErroring, 2) \
+ macro(writableStreamUpdateBackpressure, writableStreamInternalsWritableStreamUpdateBackpressure, 2) \
-#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(macro) \
- macro(writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCode, initializeWritableStreamDefaultController, ASCIILiteral(), s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCodeLength) \
- macro(writableStreamDefaultControllerErrorCode, error, ASCIILiteral(), s_writableStreamDefaultControllerErrorCodeLength) \
+#define WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(macro) \
+ macro(writableStreamInternalsAcquireWritableStreamDefaultWriterCode, acquireWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeLength) \
+ macro(writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode, createInternalWritableStreamFromUnderlyingSink, ASCIILiteral(), s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeLength) \
+ macro(writableStreamInternalsCreateWritableStreamCode, createWritableStream, ASCIILiteral(), s_writableStreamInternalsCreateWritableStreamCodeLength) \
+ macro(writableStreamInternalsInitializeWritableStreamSlotsCode, initializeWritableStreamSlots, ASCIILiteral(), s_writableStreamInternalsInitializeWritableStreamSlotsCodeLength) \
+ macro(writableStreamInternalsIsCloseSentinelCode, isCloseSentinel, ASCIILiteral(), s_writableStreamInternalsIsCloseSentinelCodeLength) \
+ macro(writableStreamInternalsIsWritableStreamCode, isWritableStream, ASCIILiteral(), s_writableStreamInternalsIsWritableStreamCodeLength) \
+ macro(writableStreamInternalsIsWritableStreamDefaultWriterCode, isWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamInternalsIsWritableStreamDefaultWriterCodeLength) \
+ macro(writableStreamInternalsIsWritableStreamLockedCode, isWritableStreamLocked, ASCIILiteral(), s_writableStreamInternalsIsWritableStreamLockedCodeLength) \
+ macro(writableStreamInternalsSetUpWritableStreamDefaultControllerCode, setUpWritableStreamDefaultController, ASCIILiteral(), s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeLength) \
+ macro(writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCode, setUpWritableStreamDefaultControllerFromUnderlyingSink, ASCIILiteral(), s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeLength) \
+ macro(writableStreamInternalsSetUpWritableStreamDefaultWriterCode, setUpWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeLength) \
+ macro(writableStreamInternalsWritableStreamAbortCode, writableStreamAbort, ASCIILiteral(), s_writableStreamInternalsWritableStreamAbortCodeLength) \
+ macro(writableStreamInternalsWritableStreamAbortForBindingsCode, writableStreamAbortForBindings, ASCIILiteral(), s_writableStreamInternalsWritableStreamAbortForBindingsCodeLength) \
+ macro(writableStreamInternalsWritableStreamAddWriteRequestCode, writableStreamAddWriteRequest, ASCIILiteral(), s_writableStreamInternalsWritableStreamAddWriteRequestCodeLength) \
+ macro(writableStreamInternalsWritableStreamCloseCode, writableStreamClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamCloseCodeLength) \
+ macro(writableStreamInternalsWritableStreamCloseForBindingsCode, writableStreamCloseForBindings, ASCIILiteral(), s_writableStreamInternalsWritableStreamCloseForBindingsCodeLength) \
+ macro(writableStreamInternalsWritableStreamCloseQueuedOrInFlightCode, writableStreamCloseQueuedOrInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeLength) \
+ macro(writableStreamInternalsWritableStreamDealWithRejectionCode, writableStreamDealWithRejection, ASCIILiteral(), s_writableStreamInternalsWritableStreamDealWithRejectionCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCode, writableStreamDefaultControllerAdvanceQueueIfNeeded, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCode, writableStreamDefaultControllerClearAlgorithms, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultControllerCloseCode, writableStreamDefaultControllerClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultControllerErrorCode, writableStreamDefaultControllerError, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCode, writableStreamDefaultControllerErrorIfNeeded, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCode, writableStreamDefaultControllerGetBackpressure, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCode, writableStreamDefaultControllerGetChunkSize, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCode, writableStreamDefaultControllerGetDesiredSize, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultControllerProcessCloseCode, writableStreamDefaultControllerProcessClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode, writableStreamDefaultControllerProcessWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultControllerStartCode, writableStreamDefaultControllerStart, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerStartCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultControllerWriteCode, writableStreamDefaultControllerWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultWriterAbortCode, writableStreamDefaultWriterAbort, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultWriterCloseCode, writableStreamDefaultWriterClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCode, writableStreamDefaultWriterCloseWithErrorPropagation, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode, writableStreamDefaultWriterEnsureClosedPromiseRejected, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode, writableStreamDefaultWriterEnsureReadyPromiseRejected, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCode, writableStreamDefaultWriterGetDesiredSize, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultWriterReleaseCode, writableStreamDefaultWriterRelease, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeLength) \
+ macro(writableStreamInternalsWritableStreamDefaultWriterWriteCode, writableStreamDefaultWriterWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeLength) \
+ macro(writableStreamInternalsWritableStreamFinishErroringCode, writableStreamFinishErroring, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishErroringCodeLength) \
+ macro(writableStreamInternalsWritableStreamFinishInFlightCloseCode, writableStreamFinishInFlightClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeLength) \
+ macro(writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode, writableStreamFinishInFlightCloseWithError, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeLength) \
+ macro(writableStreamInternalsWritableStreamFinishInFlightWriteCode, writableStreamFinishInFlightWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeLength) \
+ macro(writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCode, writableStreamFinishInFlightWriteWithError, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeLength) \
+ macro(writableStreamInternalsWritableStreamHasOperationMarkedInFlightCode, writableStreamHasOperationMarkedInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeLength) \
+ macro(writableStreamInternalsWritableStreamMarkCloseRequestInFlightCode, writableStreamMarkCloseRequestInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeLength) \
+ macro(writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCode, writableStreamMarkFirstWriteRequestInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeLength) \
+ macro(writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode, writableStreamRejectCloseAndClosedPromiseIfNeeded, ASCIILiteral(), s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeLength) \
+ macro(writableStreamInternalsWritableStreamStartErroringCode, writableStreamStartErroring, ASCIILiteral(), s_writableStreamInternalsWritableStreamStartErroringCodeLength) \
+ macro(writableStreamInternalsWritableStreamUpdateBackpressureCode, writableStreamUpdateBackpressure, ASCIILiteral(), s_writableStreamInternalsWritableStreamUpdateBackpressureCodeLength) \
-#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(macro) \
- macro(initializeWritableStreamDefaultController) \
- macro(error) \
+#define WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \
+ macro(acquireWritableStreamDefaultWriter) \
+ macro(createInternalWritableStreamFromUnderlyingSink) \
+ macro(createWritableStream) \
+ macro(initializeWritableStreamSlots) \
+ macro(isCloseSentinel) \
+ macro(isWritableStream) \
+ macro(isWritableStreamDefaultWriter) \
+ macro(isWritableStreamLocked) \
+ macro(setUpWritableStreamDefaultController) \
+ macro(setUpWritableStreamDefaultControllerFromUnderlyingSink) \
+ macro(setUpWritableStreamDefaultWriter) \
+ macro(writableStreamAbort) \
+ macro(writableStreamAbortForBindings) \
+ macro(writableStreamAddWriteRequest) \
+ macro(writableStreamClose) \
+ macro(writableStreamCloseForBindings) \
+ macro(writableStreamCloseQueuedOrInFlight) \
+ macro(writableStreamDealWithRejection) \
+ macro(writableStreamDefaultControllerAdvanceQueueIfNeeded) \
+ macro(writableStreamDefaultControllerClearAlgorithms) \
+ macro(writableStreamDefaultControllerClose) \
+ macro(writableStreamDefaultControllerError) \
+ macro(writableStreamDefaultControllerErrorIfNeeded) \
+ macro(writableStreamDefaultControllerGetBackpressure) \
+ macro(writableStreamDefaultControllerGetChunkSize) \
+ macro(writableStreamDefaultControllerGetDesiredSize) \
+ macro(writableStreamDefaultControllerProcessClose) \
+ macro(writableStreamDefaultControllerProcessWrite) \
+ macro(writableStreamDefaultControllerStart) \
+ macro(writableStreamDefaultControllerWrite) \
+ macro(writableStreamDefaultWriterAbort) \
+ macro(writableStreamDefaultWriterClose) \
+ macro(writableStreamDefaultWriterCloseWithErrorPropagation) \
+ macro(writableStreamDefaultWriterEnsureClosedPromiseRejected) \
+ macro(writableStreamDefaultWriterEnsureReadyPromiseRejected) \
+ macro(writableStreamDefaultWriterGetDesiredSize) \
+ macro(writableStreamDefaultWriterRelease) \
+ macro(writableStreamDefaultWriterWrite) \
+ macro(writableStreamFinishErroring) \
+ macro(writableStreamFinishInFlightClose) \
+ macro(writableStreamFinishInFlightCloseWithError) \
+ macro(writableStreamFinishInFlightWrite) \
+ macro(writableStreamFinishInFlightWriteWithError) \
+ macro(writableStreamHasOperationMarkedInFlight) \
+ macro(writableStreamMarkCloseRequestInFlight) \
+ macro(writableStreamMarkFirstWriteRequestInFlight) \
+ macro(writableStreamRejectCloseAndClosedPromiseIfNeeded) \
+ macro(writableStreamStartErroring) \
+ macro(writableStreamUpdateBackpressure) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
#undef DECLARE_BUILTIN_GENERATOR
-class WritableStreamDefaultControllerBuiltinsWrapper : private JSC::WeakHandleOwner {
+class WritableStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner {
public:
- explicit WritableStreamDefaultControllerBuiltinsWrapper(JSC::VM& vm)
+ explicit WritableStreamInternalsBuiltinsWrapper(JSC::VM& vm)
: m_vm(vm)
- WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted))
+ WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
{
}
@@ -5582,28 +5659,28 @@ public:
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
JSC::UnlinkedFunctionExecutable* name##Executable(); \
const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+ WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
- WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
void exportNames();
private:
JSC::VM& m_vm;
- WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+ WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
JSC::SourceCode m_##name##Source;\
JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+ WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
};
#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* WritableStreamDefaultControllerBuiltinsWrapper::name##Executable() \
+inline JSC::UnlinkedFunctionExecutable* WritableStreamInternalsBuiltinsWrapper::name##Executable() \
{\
if (!m_##name##Executable) {\
JSC::Identifier executableName = functionName##PublicName();\
@@ -5613,186 +5690,142 @@ inline JSC::UnlinkedFunctionExecutable* WritableStreamDefaultControllerBuiltinsW
}\
return m_##name##Executable.get();\
}
-WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
#undef DEFINE_BUILTIN_EXECUTABLES
-inline void WritableStreamDefaultControllerBuiltinsWrapper::exportNames()
+inline void WritableStreamInternalsBuiltinsWrapper::exportNames()
{
#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+ WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
-/* EventSource.ts */
-// getEventSource
-#define WEBCORE_BUILTIN_EVENTSOURCE_GETEVENTSOURCE 1
-extern const char* const s_eventSourceGetEventSourceCode;
-extern const int s_eventSourceGetEventSourceCodeLength;
-extern const JSC::ConstructAbility s_eventSourceGetEventSourceCodeConstructAbility;
-extern const JSC::ConstructorKind s_eventSourceGetEventSourceCodeConstructorKind;
-extern const JSC::ImplementationVisibility s_eventSourceGetEventSourceCodeImplementationVisibility;
-
-#define WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_DATA(macro) \
- macro(getEventSource, eventSourceGetEventSource, 0) \
-
-#define WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(macro) \
- macro(eventSourceGetEventSourceCode, getEventSource, ASCIILiteral(), s_eventSourceGetEventSourceCodeLength) \
-
-#define WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(macro) \
- macro(getEventSource) \
-
-#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
- JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
-
-WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
-#undef DECLARE_BUILTIN_GENERATOR
-
-class EventSourceBuiltinsWrapper : private JSC::WeakHandleOwner {
+class WritableStreamInternalsBuiltinFunctions {
public:
- explicit EventSourceBuiltinsWrapper(JSC::VM& vm)
- : m_vm(vm)
- WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
- WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
-#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
- {
- }
-
-#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
- JSC::UnlinkedFunctionExecutable* name##Executable(); \
- const JSC::SourceCode& name##Source() const { return m_##name##Source; }
- WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
-#undef EXPOSE_BUILTIN_EXECUTABLES
-
- WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+ explicit WritableStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
- void exportNames();
+ void init(JSC::JSGlobalObject&);
+ template<typename Visitor> void visit(Visitor&);
-private:
+public:
JSC::VM& m_vm;
- WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
-
-#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
- JSC::SourceCode m_##name##Source;\
- JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
- WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \
+ JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
+ WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
#undef DECLARE_BUILTIN_SOURCE_MEMBERS
-
};
-#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
-inline JSC::UnlinkedFunctionExecutable* EventSourceBuiltinsWrapper::name##Executable() \
-{\
- if (!m_##name##Executable) {\
- JSC::Identifier executableName = functionName##PublicName();\
- if (overriddenName)\
- executableName = JSC::Identifier::fromString(m_vm, overriddenName);\
- m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\
- }\
- return m_##name##Executable.get();\
+inline void WritableStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
+{
+#define EXPORT_FUNCTION(codeName, functionName, overriddenName, length) \
+ m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create(m_vm, codeName##Generator(m_vm), &globalObject));
+ WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION)
+#undef EXPORT_FUNCTION
}
-WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
-#undef DEFINE_BUILTIN_EXECUTABLES
-inline void EventSourceBuiltinsWrapper::exportNames()
+template<typename Visitor>
+inline void WritableStreamInternalsBuiltinFunctions::visit(Visitor& visitor)
{
-#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
- WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
-#undef EXPORT_FUNCTION_NAME
+#define VISIT_FUNCTION(name) visitor.append(m_##name##Function);
+ WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
+#undef VISIT_FUNCTION
}
-class JSBuiltinFunctions {
+
+template void WritableStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&);
+template void WritableStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&);
+ class JSBuiltinFunctions {
public:
explicit JSBuiltinFunctions(JSC::VM& vm)
: m_vm(vm)
, m_bundlerPluginBuiltins(m_vm)
, m_byteLengthQueuingStrategyBuiltins(m_vm)
- , m_writableStreamInternalsBuiltins(m_vm)
- , m_transformStreamInternalsBuiltins(m_vm)
- , m_processObjectInternalsBuiltins(m_vm)
- , m_transformStreamBuiltins(m_vm)
- , m_moduleBuiltins(m_vm)
+ , m_consoleObjectBuiltins(m_vm)
+ , m_countQueuingStrategyBuiltins(m_vm)
+ , m_eventSourceBuiltins(m_vm)
+ , m_importMetaObjectBuiltins(m_vm)
+ , m_jsBufferConstructorBuiltins(m_vm)
, m_jsBufferPrototypeBuiltins(m_vm)
+ , m_moduleBuiltins(m_vm)
+ , m_processObjectInternalsBuiltins(m_vm)
, m_readableByteStreamControllerBuiltins(m_vm)
- , m_utilInspectBuiltins(m_vm)
- , m_consoleObjectBuiltins(m_vm)
- , m_readableStreamInternalsBuiltins(m_vm)
- , m_transformStreamDefaultControllerBuiltins(m_vm)
+ , m_readableByteStreamInternalsBuiltins(m_vm)
+ , m_readableStreamBuiltins(m_vm)
, m_readableStreamBYOBReaderBuiltins(m_vm)
- , m_jsBufferConstructorBuiltins(m_vm)
- , m_readableStreamDefaultReaderBuiltins(m_vm)
- , m_streamInternalsBuiltins(m_vm)
- , m_importMetaObjectBuiltins(m_vm)
- , m_countQueuingStrategyBuiltins(m_vm)
, m_readableStreamBYOBRequestBuiltins(m_vm)
- , m_writableStreamDefaultWriterBuiltins(m_vm)
- , m_readableStreamBuiltins(m_vm)
, m_readableStreamDefaultControllerBuiltins(m_vm)
- , m_readableByteStreamInternalsBuiltins(m_vm)
+ , m_readableStreamDefaultReaderBuiltins(m_vm)
+ , m_readableStreamInternalsBuiltins(m_vm)
+ , m_streamInternalsBuiltins(m_vm)
+ , m_transformStreamBuiltins(m_vm)
+ , m_transformStreamDefaultControllerBuiltins(m_vm)
+ , m_transformStreamInternalsBuiltins(m_vm)
+ , m_utilInspectBuiltins(m_vm)
, m_writableStreamDefaultControllerBuiltins(m_vm)
- , m_eventSourceBuiltins(m_vm)
+ , m_writableStreamDefaultWriterBuiltins(m_vm)
+ , m_writableStreamInternalsBuiltins(m_vm)
{
- m_writableStreamInternalsBuiltins.exportNames();
- m_transformStreamInternalsBuiltins.exportNames();
+ m_readableByteStreamInternalsBuiltins.exportNames();
m_readableStreamInternalsBuiltins.exportNames();
m_streamInternalsBuiltins.exportNames();
- m_readableByteStreamInternalsBuiltins.exportNames();
+ m_transformStreamInternalsBuiltins.exportNames();
+ m_writableStreamInternalsBuiltins.exportNames();
}
BundlerPluginBuiltinsWrapper& bundlerPluginBuiltins() { return m_bundlerPluginBuiltins; }
ByteLengthQueuingStrategyBuiltinsWrapper& byteLengthQueuingStrategyBuiltins() { return m_byteLengthQueuingStrategyBuiltins; }
- WritableStreamInternalsBuiltinsWrapper& writableStreamInternalsBuiltins() { return m_writableStreamInternalsBuiltins; }
- TransformStreamInternalsBuiltinsWrapper& transformStreamInternalsBuiltins() { return m_transformStreamInternalsBuiltins; }
- ProcessObjectInternalsBuiltinsWrapper& processObjectInternalsBuiltins() { return m_processObjectInternalsBuiltins; }
- TransformStreamBuiltinsWrapper& transformStreamBuiltins() { return m_transformStreamBuiltins; }
- ModuleBuiltinsWrapper& moduleBuiltins() { return m_moduleBuiltins; }
+ ConsoleObjectBuiltinsWrapper& consoleObjectBuiltins() { return m_consoleObjectBuiltins; }
+ CountQueuingStrategyBuiltinsWrapper& countQueuingStrategyBuiltins() { return m_countQueuingStrategyBuiltins; }
+ EventSourceBuiltinsWrapper& eventSourceBuiltins() { return m_eventSourceBuiltins; }
+ ImportMetaObjectBuiltinsWrapper& importMetaObjectBuiltins() { return m_importMetaObjectBuiltins; }
+ JSBufferConstructorBuiltinsWrapper& jsBufferConstructorBuiltins() { return m_jsBufferConstructorBuiltins; }
JSBufferPrototypeBuiltinsWrapper& jsBufferPrototypeBuiltins() { return m_jsBufferPrototypeBuiltins; }
+ ModuleBuiltinsWrapper& moduleBuiltins() { return m_moduleBuiltins; }
+ ProcessObjectInternalsBuiltinsWrapper& processObjectInternalsBuiltins() { return m_processObjectInternalsBuiltins; }
ReadableByteStreamControllerBuiltinsWrapper& readableByteStreamControllerBuiltins() { return m_readableByteStreamControllerBuiltins; }
- UtilInspectBuiltinsWrapper& utilInspectBuiltins() { return m_utilInspectBuiltins; }
- ConsoleObjectBuiltinsWrapper& consoleObjectBuiltins() { return m_consoleObjectBuiltins; }
- ReadableStreamInternalsBuiltinsWrapper& readableStreamInternalsBuiltins() { return m_readableStreamInternalsBuiltins; }
- TransformStreamDefaultControllerBuiltinsWrapper& transformStreamDefaultControllerBuiltins() { return m_transformStreamDefaultControllerBuiltins; }
+ ReadableByteStreamInternalsBuiltinsWrapper& readableByteStreamInternalsBuiltins() { return m_readableByteStreamInternalsBuiltins; }
+ ReadableStreamBuiltinsWrapper& readableStreamBuiltins() { return m_readableStreamBuiltins; }
ReadableStreamBYOBReaderBuiltinsWrapper& readableStreamBYOBReaderBuiltins() { return m_readableStreamBYOBReaderBuiltins; }
- JSBufferConstructorBuiltinsWrapper& jsBufferConstructorBuiltins() { return m_jsBufferConstructorBuiltins; }
- ReadableStreamDefaultReaderBuiltinsWrapper& readableStreamDefaultReaderBuiltins() { return m_readableStreamDefaultReaderBuiltins; }
- StreamInternalsBuiltinsWrapper& streamInternalsBuiltins() { return m_streamInternalsBuiltins; }
- ImportMetaObjectBuiltinsWrapper& importMetaObjectBuiltins() { return m_importMetaObjectBuiltins; }
- CountQueuingStrategyBuiltinsWrapper& countQueuingStrategyBuiltins() { return m_countQueuingStrategyBuiltins; }
ReadableStreamBYOBRequestBuiltinsWrapper& readableStreamBYOBRequestBuiltins() { return m_readableStreamBYOBRequestBuiltins; }
- WritableStreamDefaultWriterBuiltinsWrapper& writableStreamDefaultWriterBuiltins() { return m_writableStreamDefaultWriterBuiltins; }
- ReadableStreamBuiltinsWrapper& readableStreamBuiltins() { return m_readableStreamBuiltins; }
ReadableStreamDefaultControllerBuiltinsWrapper& readableStreamDefaultControllerBuiltins() { return m_readableStreamDefaultControllerBuiltins; }
- ReadableByteStreamInternalsBuiltinsWrapper& readableByteStreamInternalsBuiltins() { return m_readableByteStreamInternalsBuiltins; }
+ ReadableStreamDefaultReaderBuiltinsWrapper& readableStreamDefaultReaderBuiltins() { return m_readableStreamDefaultReaderBuiltins; }
+ ReadableStreamInternalsBuiltinsWrapper& readableStreamInternalsBuiltins() { return m_readableStreamInternalsBuiltins; }
+ StreamInternalsBuiltinsWrapper& streamInternalsBuiltins() { return m_streamInternalsBuiltins; }
+ TransformStreamBuiltinsWrapper& transformStreamBuiltins() { return m_transformStreamBuiltins; }
+ TransformStreamDefaultControllerBuiltinsWrapper& transformStreamDefaultControllerBuiltins() { return m_transformStreamDefaultControllerBuiltins; }
+ TransformStreamInternalsBuiltinsWrapper& transformStreamInternalsBuiltins() { return m_transformStreamInternalsBuiltins; }
+ UtilInspectBuiltinsWrapper& utilInspectBuiltins() { return m_utilInspectBuiltins; }
WritableStreamDefaultControllerBuiltinsWrapper& writableStreamDefaultControllerBuiltins() { return m_writableStreamDefaultControllerBuiltins; }
- EventSourceBuiltinsWrapper& eventSourceBuiltins() { return m_eventSourceBuiltins; }
+ WritableStreamDefaultWriterBuiltinsWrapper& writableStreamDefaultWriterBuiltins() { return m_writableStreamDefaultWriterBuiltins; }
+ WritableStreamInternalsBuiltinsWrapper& writableStreamInternalsBuiltins() { return m_writableStreamInternalsBuiltins; }
private:
JSC::VM& m_vm;
BundlerPluginBuiltinsWrapper m_bundlerPluginBuiltins;
ByteLengthQueuingStrategyBuiltinsWrapper m_byteLengthQueuingStrategyBuiltins;
- WritableStreamInternalsBuiltinsWrapper m_writableStreamInternalsBuiltins;
- TransformStreamInternalsBuiltinsWrapper m_transformStreamInternalsBuiltins;
- ProcessObjectInternalsBuiltinsWrapper m_processObjectInternalsBuiltins;
- TransformStreamBuiltinsWrapper m_transformStreamBuiltins;
- ModuleBuiltinsWrapper m_moduleBuiltins;
+ ConsoleObjectBuiltinsWrapper m_consoleObjectBuiltins;
+ CountQueuingStrategyBuiltinsWrapper m_countQueuingStrategyBuiltins;
+ EventSourceBuiltinsWrapper m_eventSourceBuiltins;
+ ImportMetaObjectBuiltinsWrapper m_importMetaObjectBuiltins;
+ JSBufferConstructorBuiltinsWrapper m_jsBufferConstructorBuiltins;
JSBufferPrototypeBuiltinsWrapper m_jsBufferPrototypeBuiltins;
+ ModuleBuiltinsWrapper m_moduleBuiltins;
+ ProcessObjectInternalsBuiltinsWrapper m_processObjectInternalsBuiltins;
ReadableByteStreamControllerBuiltinsWrapper m_readableByteStreamControllerBuiltins;
- UtilInspectBuiltinsWrapper m_utilInspectBuiltins;
- ConsoleObjectBuiltinsWrapper m_consoleObjectBuiltins;
- ReadableStreamInternalsBuiltinsWrapper m_readableStreamInternalsBuiltins;
- TransformStreamDefaultControllerBuiltinsWrapper m_transformStreamDefaultControllerBuiltins;
+ ReadableByteStreamInternalsBuiltinsWrapper m_readableByteStreamInternalsBuiltins;
+ ReadableStreamBuiltinsWrapper m_readableStreamBuiltins;
ReadableStreamBYOBReaderBuiltinsWrapper m_readableStreamBYOBReaderBuiltins;
- JSBufferConstructorBuiltinsWrapper m_jsBufferConstructorBuiltins;
- ReadableStreamDefaultReaderBuiltinsWrapper m_readableStreamDefaultReaderBuiltins;
- StreamInternalsBuiltinsWrapper m_streamInternalsBuiltins;
- ImportMetaObjectBuiltinsWrapper m_importMetaObjectBuiltins;
- CountQueuingStrategyBuiltinsWrapper m_countQueuingStrategyBuiltins;
ReadableStreamBYOBRequestBuiltinsWrapper m_readableStreamBYOBRequestBuiltins;
- WritableStreamDefaultWriterBuiltinsWrapper m_writableStreamDefaultWriterBuiltins;
- ReadableStreamBuiltinsWrapper m_readableStreamBuiltins;
ReadableStreamDefaultControllerBuiltinsWrapper m_readableStreamDefaultControllerBuiltins;
- ReadableByteStreamInternalsBuiltinsWrapper m_readableByteStreamInternalsBuiltins;
+ ReadableStreamDefaultReaderBuiltinsWrapper m_readableStreamDefaultReaderBuiltins;
+ ReadableStreamInternalsBuiltinsWrapper m_readableStreamInternalsBuiltins;
+ StreamInternalsBuiltinsWrapper m_streamInternalsBuiltins;
+ TransformStreamBuiltinsWrapper m_transformStreamBuiltins;
+ TransformStreamDefaultControllerBuiltinsWrapper m_transformStreamDefaultControllerBuiltins;
+ TransformStreamInternalsBuiltinsWrapper m_transformStreamInternalsBuiltins;
+ UtilInspectBuiltinsWrapper m_utilInspectBuiltins;
WritableStreamDefaultControllerBuiltinsWrapper m_writableStreamDefaultControllerBuiltins;
- EventSourceBuiltinsWrapper m_eventSourceBuiltins;
+ WritableStreamDefaultWriterBuiltinsWrapper m_writableStreamDefaultWriterBuiltins;
+ WritableStreamInternalsBuiltinsWrapper m_writableStreamInternalsBuiltins;
;
};
@@ -5802,19 +5835,19 @@ public:
template<typename Visitor> void visit(Visitor&);
void initialize(Zig::GlobalObject&);
- WritableStreamInternalsBuiltinFunctions& writableStreamInternals() { return m_writableStreamInternals; }
- TransformStreamInternalsBuiltinFunctions& transformStreamInternals() { return m_transformStreamInternals; }
+ ReadableByteStreamInternalsBuiltinFunctions& readableByteStreamInternals() { return m_readableByteStreamInternals; }
ReadableStreamInternalsBuiltinFunctions& readableStreamInternals() { return m_readableStreamInternals; }
StreamInternalsBuiltinFunctions& streamInternals() { return m_streamInternals; }
- ReadableByteStreamInternalsBuiltinFunctions& readableByteStreamInternals() { return m_readableByteStreamInternals; }
+ TransformStreamInternalsBuiltinFunctions& transformStreamInternals() { return m_transformStreamInternals; }
+ WritableStreamInternalsBuiltinFunctions& writableStreamInternals() { return m_writableStreamInternals; }
private:
JSC::VM& m_vm;
- WritableStreamInternalsBuiltinFunctions m_writableStreamInternals;
- TransformStreamInternalsBuiltinFunctions m_transformStreamInternals;
+ ReadableByteStreamInternalsBuiltinFunctions m_readableByteStreamInternals;
ReadableStreamInternalsBuiltinFunctions m_readableStreamInternals;
StreamInternalsBuiltinFunctions m_streamInternals;
- ReadableByteStreamInternalsBuiltinFunctions m_readableByteStreamInternals;
+ TransformStreamInternalsBuiltinFunctions m_transformStreamInternals;
+ WritableStreamInternalsBuiltinFunctions m_writableStreamInternals;
};
diff --git a/src/js/private.d.ts b/src/js/private.d.ts
index 0e99e2a5b..762449333 100644
--- a/src/js/private.d.ts
+++ b/src/js/private.d.ts
@@ -160,17 +160,6 @@ declare interface Error {
function $lazy<T extends keyof BunLazyModules>(id: T): BunLazyModules[T];
interface BunLazyModules {
- /**
- * Primordials is a dynamic object that contains builtin functions and values.
- *
- * like primordials.isPromise -> $isPromise, etc
- * Also primordials.Bun -> $Bun, etc; untampered globals
- *
- * The implmentation of this is done using createBuiltin('(function (){ return @<name here>; })')
- * Meaning you can crash bun if you try returning something like `getInternalField`
- */
- primordials: any;
-
"bun:jsc": Omit<typeof import("bun:jsc"), "jscDescribe" | "jscDescribeArray"> & {
describe: typeof import("bun:jsc").jscDescribe;
describeArray: typeof import("bun:jsc").jscDescribe;
@@ -204,12 +193,7 @@ interface BunLazyModules {
cleanupLater: () => void;
setAsyncHooksEnabled: (enabled: boolean) => void;
};
- "worker_threads": [
- //
- workerData: any,
- threadId: number,
- _receiveMessageOnPort: (port: MessagePort) => any,
- ];
+ "worker_threads": [workerData: any, threadId: number, _receiveMessageOnPort: (port: MessagePort) => any];
"tty": {
ttySetMode: (fd: number, mode: number) => number;
isatty: (fd: number) => boolean;
@@ -224,3 +208,15 @@ interface BunLazyModules {
/** Assign to this variable in src/js/{bun,node,thirdparty} to act as module.exports */
declare var $exports: any;
+
+interface CommonJSModuleRecord {
+ $require(id: string, mod: any): any;
+ children: CommonJSModuleRecord[];
+ exports: any;
+ id: string;
+ loaded: boolean;
+ parent: undefined;
+ path: string;
+ paths: string[];
+ require: typeof require;
+}
diff --git a/src/js/thirdparty/ws.js b/src/js/thirdparty/ws.js
index 1d633ddf4..bec8fd5fd 100644
--- a/src/js/thirdparty/ws.js
+++ b/src/js/thirdparty/ws.js
@@ -538,6 +538,7 @@ class BunWebSocketMocked extends EventEmitter {
#message(ws, message) {
this.#ws = ws;
+ let isBinary = false;
if (typeof message === "string") {
if (this.#binaryType === "arraybuffer") {
message = encoder.encode(message).buffer;
@@ -549,6 +550,7 @@ class BunWebSocketMocked extends EventEmitter {
}
} else {
//Buffer
+ isBinary = true;
if (this.#binaryType !== "nodebuffer") {
if (this.#binaryType === "arraybuffer") {
message = new Uint8Array(message);
@@ -558,7 +560,7 @@ class BunWebSocketMocked extends EventEmitter {
}
}
- this.emit("message", message);
+ this.emit("message", message, isBinary);
}
#open(ws) {
diff --git a/src/js_ast.zig b/src/js_ast.zig
index 7811541f4..3b17240c0 100644
--- a/src/js_ast.zig
+++ b/src/js_ast.zig
@@ -26,6 +26,7 @@ const is_bindgen = std.meta.globalOption("bindgen", bool) orelse false;
const ComptimeStringMap = bun.ComptimeStringMap;
const JSPrinter = @import("./js_printer.zig");
const js_lexer = @import("./js_lexer.zig");
+const TypeScript = @import("./js_parser.zig").TypeScript;
const ThreadlocalArena = @import("./mimalloc_arena.zig").Arena;
/// This is the index to the automatically-generated part containing code that
@@ -834,6 +835,8 @@ pub const G = struct {
// This is omitted for class fields
value: ?ExprNodeIndex = null,
+ ts_metadata: TypeScript.Metadata = .m_none,
+
pub const List = BabyList(Property);
pub const Kind = enum(u3) {
@@ -865,6 +868,8 @@ pub const G = struct {
arguments_ref: ?Ref = null,
flags: Flags.Function.Set = Flags.Function.None,
+
+ return_ts_metadata: TypeScript.Metadata = .m_none,
};
pub const Arg = struct {
ts_decorators: ExprNodeList = ExprNodeList{},
@@ -873,6 +878,8 @@ pub const G = struct {
// "constructor(public x: boolean) {}"
is_typescript_ctor_field: bool = false,
+
+ ts_metadata: TypeScript.Metadata = .m_none,
};
};
@@ -1707,7 +1714,7 @@ pub const E = struct {
if (comptime !Environment.isWasm) {
if (value == @trunc(value) and (value < std.math.maxInt(i32) and value > std.math.minInt(i32))) {
const int_value = @as(i64, @intFromFloat(value));
- const abs = @as(u64, @intCast(std.math.absInt(int_value) catch return null));
+ const abs = @as(u64, @intCast(@abs(int_value)));
if (abs < double_digit.len) {
return if (int_value < 0)
neg_double_digit[abs]
@@ -5987,6 +5994,7 @@ pub const Ast = struct {
/// This is a list of named exports that may exist in a CommonJS module
/// We use this with `commonjs_at_runtime` to re-export CommonJS
commonjs_export_names: []string = &([_]string{}),
+ import_meta_ref: Ref = Ref.None,
pub const CommonJSNamedExport = struct {
loc_ref: LocRef,
diff --git a/src/js_lexer.zig b/src/js_lexer.zig
index 1417ea01e..24484a02b 100644
--- a/src/js_lexer.zig
+++ b/src/js_lexer.zig
@@ -642,7 +642,7 @@ fn NewLexer_(
lexer.step();
// Handle Windows CRLF
- if (lexer.code_point == 'r' and comptime !is_json) {
+ if (lexer.code_point == '\r' and comptime !is_json) {
lexer.step();
if (lexer.code_point == '\n') {
lexer.step();
diff --git a/src/js_parser.zig b/src/js_parser.zig
index a61657128..fce928a6e 100644
--- a/src/js_parser.zig
+++ b/src/js_parser.zig
@@ -70,7 +70,7 @@ const RefHashCtx = @import("./ast/base.zig").RefHashCtx;
pub const StringHashMap = bun.StringHashMap;
pub const AutoHashMap = std.AutoHashMap;
-const StringHashMapUnamanged = bun.StringHashMapUnmanaged;
+const StringHashMapUnmanaged = bun.StringHashMapUnmanaged;
const ObjectPool = @import("./pool.zig").ObjectPool;
const NodeFallbackModules = @import("./node_fallbacks.zig");
@@ -439,6 +439,155 @@ pub const TypeScript = struct {
};
}
+ pub const Metadata = union(enum) {
+ m_none: void,
+
+ m_never: void,
+ m_unknown: void,
+ m_any: void,
+ m_void: void,
+ m_null: void,
+ m_undefined: void,
+ m_function: void,
+ m_array: void,
+ m_boolean: void,
+ m_string: void,
+ m_object: void,
+ m_number: void,
+ m_bigint: void,
+ m_symbol: void,
+ m_promise: void,
+ m_identifier: Ref,
+ m_dot: List(Ref),
+
+ pub const default: @This() = .m_none;
+
+ // the logic in finishUnion, mergeUnion, finishIntersection and mergeIntersection is
+ // translated from:
+ // https://github.com/microsoft/TypeScript/blob/e0a324b0503be479f2b33fd2e17c6e86c94d1297/src/compiler/transformers/typeSerializer.ts#L402
+
+ /// Return the final union type if possible, or return null to continue merging.
+ ///
+ /// If the current type is m_never, m_null, or m_undefined assign the current type
+ /// to m_none and return null to ensure it's always replaced by the next type.
+ pub fn finishUnion(current: *@This(), p: anytype) ?@This() {
+ return switch (current.*) {
+ .m_identifier => |ref| {
+ if (strings.eqlComptime(p.loadNameFromRef(ref), "Object")) {
+ return .m_object;
+ }
+ return null;
+ },
+
+ .m_unknown,
+ .m_any,
+ .m_object,
+ => .m_object,
+
+ .m_never,
+ .m_null,
+ .m_undefined,
+ => {
+ current.* = .m_none;
+ return null;
+ },
+
+ else => null,
+ };
+ }
+
+ pub fn mergeUnion(result: *@This(), left: @This()) void {
+ if (left != .m_none) {
+ if (std.meta.activeTag(result.*) != std.meta.activeTag(left)) {
+ result.* = switch (result.*) {
+ .m_never,
+ .m_undefined,
+ .m_null,
+ => left,
+
+ else => .m_object,
+ };
+ } else {
+ switch (result.*) {
+ .m_identifier => |ref| {
+ if (!ref.eql(left.m_identifier)) {
+ result.* = .m_object;
+ }
+ },
+ else => {},
+ }
+ }
+ } else {
+ // always take the next value if left is m_none
+ }
+ }
+
+ /// Return the final intersection type if possible, or return null to continue merging.
+ ///
+ /// If the current type is m_unknown, m_null, or m_undefined assign the current type
+ /// to m_none and return null to ensure it's always replaced by the next type.
+ pub fn finishIntersection(current: *@This(), p: anytype) ?@This() {
+ return switch (current.*) {
+ .m_identifier => |ref| {
+ if (strings.eqlComptime(p.loadNameFromRef(ref), "Object")) {
+ return .m_object;
+ }
+ return null;
+ },
+
+ // ensure m_never is the final type
+ .m_never => .m_never,
+
+ .m_any,
+ .m_object,
+ => .m_object,
+
+ .m_unknown,
+ .m_null,
+ .m_undefined,
+ => {
+ current.* = .m_none;
+ return null;
+ },
+
+ else => null,
+ };
+ }
+
+ pub fn mergeIntersection(result: *@This(), left: @This()) void {
+ if (left != .m_none) {
+ if (std.meta.activeTag(result.*) != std.meta.activeTag(left)) {
+ result.* = switch (result.*) {
+ .m_unknown,
+ .m_undefined,
+ .m_null,
+ => left,
+
+ // ensure m_never is the final type
+ .m_never => .m_never,
+
+ else => .m_object,
+ };
+ } else {
+ switch (result.*) {
+ .m_identifier => |ref| {
+ if (!ref.eql(left.m_identifier)) {
+ result.* = .m_object;
+ }
+ },
+ else => {},
+ }
+ }
+ } else {
+ // make sure intersection of only m_unknown serializes to "undefined"
+ // instead of "Object"
+ if (result.* == .m_unknown) {
+ result.* = .m_undefined;
+ }
+ }
+ }
+ };
+
pub fn isTSArrowFnJSX(p: anytype) !bool {
var oldLexer = std.mem.toBytes(p.lexer);
@@ -664,19 +813,19 @@ pub const TypeScript = struct {
.{ "abstract", .abstract },
.{ "asserts", .asserts },
- .{ "keyof", .prefix },
- .{ "readonly", .prefix },
+ .{ "keyof", .prefix_keyof },
+ .{ "readonly", .prefix_readonly },
- .{ "any", .primitive },
- .{ "never", .primitive },
- .{ "unknown", .primitive },
- .{ "undefined", .primitive },
- .{ "object", .primitive },
- .{ "number", .primitive },
- .{ "string", .primitive },
- .{ "boolean", .primitive },
- .{ "bigint", .primitive },
- .{ "symbol", .primitive },
+ .{ "any", .primitive_any },
+ .{ "never", .primitive_never },
+ .{ "unknown", .primitive_unknown },
+ .{ "undefined", .primitive_undefined },
+ .{ "object", .primitive_object },
+ .{ "number", .primitive_number },
+ .{ "string", .primitive_string },
+ .{ "boolean", .primitive_boolean },
+ .{ "bigint", .primitive_bigint },
+ .{ "symbol", .primitive_symbol },
.{ "infer", .infer },
});
@@ -685,17 +834,30 @@ pub const TypeScript = struct {
unique,
abstract,
asserts,
- prefix,
- primitive,
+ prefix_keyof,
+ prefix_readonly,
+ primitive_any,
+ primitive_never,
+ primitive_unknown,
+ primitive_undefined,
+ primitive_object,
+ primitive_number,
+ primitive_string,
+ primitive_boolean,
+ primitive_bigint,
+ primitive_symbol,
infer,
};
};
- pub const SkipTypeOptions = struct {
- is_return_type: bool = false,
- is_index_signature: bool = false,
- allow_tuple_labels: bool = false,
- disallow_conditional_types: bool = false,
+ pub const SkipTypeOptions = enum {
+ is_return_type,
+ is_index_signature,
+ allow_tuple_labels,
+ disallow_conditional_types,
+
+ pub const Bitset = std.enums.EnumSet(@This());
+ pub const empty = Bitset.initEmpty();
};
};
@@ -1398,8 +1560,9 @@ const StaticSymbolName = struct {
pub const __HMRClient = NewStaticSymbol("Bun");
pub const __FastRefreshModule = NewStaticSymbol("FastHMR");
pub const __FastRefreshRuntime = NewStaticSymbol("FastRefresh");
- pub const __decorateClass = NewStaticSymbol("__decorateClass");
- pub const __decorateParam = NewStaticSymbol("__decorateParam");
+ pub const __legacyDecorateClassTS = NewStaticSymbol("__legacyDecorateClassTS");
+ pub const __legacyDecorateParamTS = NewStaticSymbol("__legacyDecorateParamTS");
+ pub const __legacyMetadataTS = NewStaticSymbol("__legacyMetadataTS");
pub const @"$$typeof" = NewStaticSymbol("$$typeof");
pub const @"$$m" = NewStaticSymbol("$$m");
@@ -1437,6 +1600,7 @@ pub const SideEffects = enum(u1) {
}
pub fn simplifyBoolean(p: anytype, expr: Expr) Expr {
+ if (!p.options.features.dead_code_elimination) return expr;
switch (expr.data) {
.e_unary => |e| {
if (e.op == .un_not) {
@@ -1451,14 +1615,14 @@ pub const SideEffects = enum(u1) {
.e_binary => |e| {
switch (e.op) {
.bin_logical_and => {
- const effects = SideEffects.toBoolean(e.right.data);
+ const effects = SideEffects.toBoolean(p, e.right.data);
if (effects.ok and effects.value and effects.side_effects == .no_side_effects) {
// "if (anything && truthyNoSideEffects)" => "if (anything)"
return e.left;
}
},
.bin_logical_or => {
- const effects = SideEffects.toBoolean(e.right.data);
+ const effects = SideEffects.toBoolean(p, e.right.data);
if (effects.ok and !effects.value and effects.side_effects == .no_side_effects) {
// "if (anything || falsyNoSideEffects)" => "if (anything)"
return e.left;
@@ -1484,6 +1648,7 @@ pub const SideEffects = enum(u1) {
}
pub fn simpifyUnusedExpr(p: anytype, expr: Expr) ?Expr {
+ if (!p.options.features.dead_code_elimination) return expr;
switch (expr.data) {
.e_null, .e_undefined, .e_missing, .e_boolean, .e_number, .e_big_int, .e_string, .e_this, .e_reg_exp, .e_function, .e_arrow, .e_import_meta => {
return null;
@@ -1746,7 +1911,8 @@ pub const SideEffects = enum(u1) {
//
// We can't trim the entire branch as dead or calling foo() will incorrectly
// assign to a global variable instead.
- pub fn shouldKeepStmtInDeadControlFlow(stmt: Stmt, allocator: Allocator) bool {
+ pub fn shouldKeepStmtInDeadControlFlow(p: anytype, stmt: Stmt, allocator: Allocator) bool {
+ if (!p.options.features.dead_code_elimination) return true;
switch (stmt.data) {
// Omit these statements entirely
.s_empty, .s_expr, .s_throw, .s_return, .s_break, .s_continue, .s_class, .s_debugger => return false,
@@ -1777,7 +1943,7 @@ pub const SideEffects = enum(u1) {
.s_block => |block| {
for (block.stmts) |child| {
- if (shouldKeepStmtInDeadControlFlow(child, allocator)) {
+ if (shouldKeepStmtInDeadControlFlow(p, child, allocator)) {
return true;
}
}
@@ -1786,43 +1952,43 @@ pub const SideEffects = enum(u1) {
},
.s_if => |_if_| {
- if (shouldKeepStmtInDeadControlFlow(_if_.yes, allocator)) {
+ if (shouldKeepStmtInDeadControlFlow(p, _if_.yes, allocator)) {
return true;
}
const no = _if_.no orelse return false;
- return shouldKeepStmtInDeadControlFlow(no, allocator);
+ return shouldKeepStmtInDeadControlFlow(p, no, allocator);
},
.s_while => {
- return shouldKeepStmtInDeadControlFlow(stmt.data.s_while.body, allocator);
+ return shouldKeepStmtInDeadControlFlow(p, stmt.data.s_while.body, allocator);
},
.s_do_while => {
- return shouldKeepStmtInDeadControlFlow(stmt.data.s_do_while.body, allocator);
+ return shouldKeepStmtInDeadControlFlow(p, stmt.data.s_do_while.body, allocator);
},
.s_for => |__for__| {
if (__for__.init) |init_| {
- if (shouldKeepStmtInDeadControlFlow(init_, allocator)) {
+ if (shouldKeepStmtInDeadControlFlow(p, init_, allocator)) {
return true;
}
}
- return shouldKeepStmtInDeadControlFlow(__for__.body, allocator);
+ return shouldKeepStmtInDeadControlFlow(p, __for__.body, allocator);
},
.s_for_in => |__for__| {
- return shouldKeepStmtInDeadControlFlow(__for__.init, allocator) or shouldKeepStmtInDeadControlFlow(__for__.body, allocator);
+ return shouldKeepStmtInDeadControlFlow(p, __for__.init, allocator) or shouldKeepStmtInDeadControlFlow(p, __for__.body, allocator);
},
.s_for_of => |__for__| {
- return shouldKeepStmtInDeadControlFlow(__for__.init, allocator) or shouldKeepStmtInDeadControlFlow(__for__.body, allocator);
+ return shouldKeepStmtInDeadControlFlow(p, __for__.init, allocator) or shouldKeepStmtInDeadControlFlow(p, __for__.body, allocator);
},
.s_label => |label| {
- return shouldKeepStmtInDeadControlFlow(label.stmt, allocator);
+ return shouldKeepStmtInDeadControlFlow(p, label.stmt, allocator);
},
else => return true,
}
@@ -1928,11 +2094,15 @@ pub const SideEffects = enum(u1) {
pub const toTypeOf = Expr.Data.typeof;
- pub fn toNullOrUndefined(exp: Expr.Data) Result {
+ pub fn toNullOrUndefined(p: anytype, exp: Expr.Data) Result {
+ if (!p.options.features.dead_code_elimination) {
+ // value should not be read if ok is false, all existing calls to this function already adhere to this
+ return Result{ .ok = false, .value = undefined, .side_effects = .could_have_side_effects };
+ }
switch (exp) {
// Never null or undefined
.e_boolean, .e_number, .e_string, .e_reg_exp, .e_function, .e_arrow, .e_big_int => {
- return Result{ .value = false, .side_effects = SideEffects.no_side_effects, .ok = true };
+ return Result{ .value = false, .side_effects = .no_side_effects, .ok = true };
},
.e_object, .e_array, .e_class => {
@@ -2016,7 +2186,7 @@ pub const SideEffects = enum(u1) {
},
.bin_comma => {
- const res = toNullOrUndefined(e.right.data);
+ const res = toNullOrUndefined(p, e.right.data);
if (res.ok) {
return Result{ .ok = true, .value = res.value, .side_effects = SideEffects.could_have_side_effects };
}
@@ -2030,7 +2200,11 @@ pub const SideEffects = enum(u1) {
return Result{ .ok = false, .value = false, .side_effects = SideEffects.could_have_side_effects };
}
- pub fn toBoolean(exp: Expr.Data) Result {
+ pub fn toBoolean(p: anytype, exp: Expr.Data) Result {
+ if (!p.options.features.dead_code_elimination) {
+ // value should not be read if ok is false, all existing calls to this function already adhere to this
+ return Result{ .ok = false, .value = undefined, .side_effects = .could_have_side_effects };
+ }
switch (exp) {
.e_null, .e_undefined => {
return Result{ .ok = true, .value = false, .side_effects = .no_side_effects };
@@ -2064,7 +2238,7 @@ pub const SideEffects = enum(u1) {
return Result{ .ok = true, .value = true, .side_effects = .could_have_side_effects };
},
.un_not => {
- var result = toBoolean(e_.value.data);
+ var result = toBoolean(p, e_.value.data);
if (result.ok) {
result.value = !result.value;
return result;
@@ -2077,21 +2251,21 @@ pub const SideEffects = enum(u1) {
switch (e_.op) {
.bin_logical_or => {
// "anything || truthy" is truthy
- const result = toBoolean(e_.right.data);
+ const result = toBoolean(p, e_.right.data);
if (result.value and result.ok) {
return Result{ .ok = true, .value = true, .side_effects = .could_have_side_effects };
}
},
.bin_logical_and => {
// "anything && falsy" is falsy
- const result = toBoolean(e_.right.data);
+ const result = toBoolean(p, e_.right.data);
if (!result.value and result.ok) {
return Result{ .ok = true, .value = false, .side_effects = .could_have_side_effects };
}
},
.bin_comma => {
// "anything, truthy/falsy" is truthy/falsy
- var result = toBoolean(e_.right.data);
+ var result = toBoolean(p, e_.right.data);
if (result.ok) {
result.side_effects = .could_have_side_effects;
return result;
@@ -2437,6 +2611,7 @@ const FnOrArrowDataParse = struct {
is_typescript_declare: bool = false,
has_argument_decorators: bool = false,
+ has_decorators: bool = false,
is_return_disallowed: bool = false,
is_this_disallowed: bool = false,
@@ -2573,6 +2748,7 @@ const PropertyOpts = struct {
is_ts_abstract: bool = false,
ts_decorators: []Expr = &[_]Expr{},
has_argument_decorators: bool = false,
+ has_class_decorators: bool = false,
};
pub const ScanPassResult = struct {
@@ -4304,7 +4480,7 @@ fn NewParser_(
emitted_namespace_vars: RefMap = RefMap{},
is_exported_inside_namespace: RefRefMap = .{},
- known_enum_values: Map(Ref, StringHashMapUnamanged(f64)) = .{},
+ known_enum_values: Map(Ref, StringHashMapUnmanaged(f64)) = .{},
local_type_names: StringBoolMap = StringBoolMap{},
// This is the reference to the generated function argument for the namespace,
@@ -4787,20 +4963,20 @@ fn NewParser_(
}
},
.s_if => |if_statement| {
- const result = SideEffects.toBoolean(if_statement.test_.data);
+ const result = SideEffects.toBoolean(p, if_statement.test_.data);
if (!(result.ok and result.side_effects == .no_side_effects and !result.value)) {
break :can_remove_part false;
}
},
.s_while => |while_statement| {
- const result = SideEffects.toBoolean(while_statement.test_.data);
+ const result = SideEffects.toBoolean(p, while_statement.test_.data);
if (!(result.ok and result.side_effects == .no_side_effects and !result.value)) {
break :can_remove_part false;
}
},
.s_for => |for_statement| {
if (for_statement.test_) |expr| {
- const result = SideEffects.toBoolean(expr.data);
+ const result = SideEffects.toBoolean(p, expr.data);
if (!(result.ok and result.side_effects == .no_side_effects and !result.value)) {
break :can_remove_part false;
}
@@ -6729,6 +6905,7 @@ fn NewParser_(
p.fn_or_arrow_data_parse.allow_super_call = opts.allow_super_call;
p.fn_or_arrow_data_parse.allow_super_property = opts.allow_super_property;
+ var rest_arg: bool = false;
var arg_has_decorators: bool = false;
var args = List(G.Arg){};
while (p.lexer.token != T.t_close_paren) {
@@ -6737,7 +6914,7 @@ fn NewParser_(
try p.lexer.next();
if (p.lexer.token == T.t_colon) {
try p.lexer.next();
- try p.skipTypeScriptType(js_ast.Op.Level.lowest);
+ try p.skipTypeScriptType(.lowest);
}
if (p.lexer.token != T.t_comma) {
break;
@@ -6758,6 +6935,7 @@ fn NewParser_(
if (!func.flags.contains(.has_rest_arg) and p.lexer.token == T.t_dot_dot_dot) {
// p.markSyntaxFeature
try p.lexer.next();
+ rest_arg = true;
func.flags.insert(.has_rest_arg);
}
@@ -6765,6 +6943,7 @@ fn NewParser_(
var is_identifier = p.lexer.token == T.t_identifier;
var text = p.lexer.identifier;
var arg = try p.parseBinding();
+ var ts_metadata = TypeScript.Metadata.default;
if (comptime is_typescript_enabled) {
if (is_identifier and opts.is_constructor) {
@@ -6804,7 +6983,19 @@ fn NewParser_(
// "function foo(a: any) {}"
if (p.lexer.token == .t_colon) {
try p.lexer.next();
- try p.skipTypeScriptType(.lowest);
+ if (!rest_arg) {
+ if (p.options.features.emit_decorator_metadata and
+ opts.allow_ts_decorators and
+ (opts.has_argument_decorators or opts.has_decorators or arg_has_decorators))
+ {
+ ts_metadata = try p.skipTypeScriptTypeWithMetadata(.lowest);
+ } else {
+ try p.skipTypeScriptType(.lowest);
+ }
+ } else {
+ // rest parameter is always object, leave metadata as m_none
+ try p.skipTypeScriptType(.lowest);
+ }
}
}
@@ -6825,6 +7016,7 @@ fn NewParser_(
// We need to track this because it affects code generation
.is_typescript_ctor_field = is_typescript_ctor_field,
+ .ts_metadata = ts_metadata,
}) catch unreachable;
if (p.lexer.token != .t_comma) {
@@ -6844,6 +7036,7 @@ fn NewParser_(
}
try p.lexer.next();
+ rest_arg = false;
}
if (args.items.len > 0) {
func.args = args.items;
@@ -6864,9 +7057,22 @@ fn NewParser_(
p.fn_or_arrow_data_parse.has_argument_decorators = arg_has_decorators;
// "function foo(): any {}"
- if (is_typescript_enabled and p.lexer.token == .t_colon) {
- try p.lexer.next();
- try p.skipTypescriptReturnType();
+ if (is_typescript_enabled) {
+ if (p.lexer.token == .t_colon) {
+ try p.lexer.next();
+
+ if (p.options.features.emit_decorator_metadata and opts.allow_ts_decorators and (opts.has_argument_decorators or opts.has_decorators)) {
+ func.return_ts_metadata = try p.skipTypescriptReturnTypeWithMetadata();
+ } else {
+ try p.skipTypescriptReturnType();
+ }
+ } else if (p.options.features.emit_decorator_metadata and opts.allow_ts_decorators and (opts.has_argument_decorators or opts.has_decorators)) {
+ if (func.flags.contains(.is_async)) {
+ func.return_ts_metadata = .m_promise;
+ } else {
+ func.return_ts_metadata = .m_undefined;
+ }
+ }
}
// "function foo(): any;"
@@ -6881,10 +7087,15 @@ fn NewParser_(
return func;
}
- // pub fn parseBinding(p: *P)
-
pub inline fn skipTypescriptReturnType(p: *P) anyerror!void {
- try p.skipTypeScriptTypeWithOpts(.lowest, .{ .is_return_type = true });
+ var result = TypeScript.Metadata.default;
+ try p.skipTypeScriptTypeWithOpts(.lowest, TypeScript.SkipTypeOptions.Bitset.initOne(.is_return_type), false, &result);
+ }
+
+ pub inline fn skipTypescriptReturnTypeWithMetadata(p: *P) anyerror!TypeScript.Metadata {
+ var result = TypeScript.Metadata.default;
+ try p.skipTypeScriptTypeWithOpts(.lowest, TypeScript.SkipTypeOptions.Bitset.initOne(.is_return_type), true, &result);
+ return result;
}
pub fn parseTypeScriptDecorators(p: *P) ![]ExprNodeIndex {
@@ -6912,7 +7123,15 @@ fn NewParser_(
inline fn skipTypeScriptType(p: *P, level: js_ast.Op.Level) anyerror!void {
p.markTypeScriptOnly();
- try p.skipTypeScriptTypeWithOpts(level, .{});
+ var result = TypeScript.Metadata.default;
+ try p.skipTypeScriptTypeWithOpts(level, TypeScript.SkipTypeOptions.empty, false, &result);
+ }
+
+ inline fn skipTypeScriptTypeWithMetadata(p: *P, level: js_ast.Op.Level) anyerror!TypeScript.Metadata {
+ p.markTypeScriptOnly();
+ var result = TypeScript.Metadata.default;
+ try p.skipTypeScriptTypeWithOpts(level, TypeScript.SkipTypeOptions.empty, true, &result);
+ return result;
}
fn skipTypeScriptBinding(p: *P) anyerror!void {
@@ -7057,41 +7276,77 @@ fn NewParser_(
// let x = (y: any): (y) => {return 0};
// let x = (y: any): asserts y is (y) => {};
//
- fn skipTypeScriptParenOrFnType(p: *P) anyerror!void {
+ fn skipTypeScriptParenOrFnType(p: *P, comptime get_metadata: bool, result: *TypeScript.Metadata) anyerror!void {
p.markTypeScriptOnly();
if (p.trySkipTypeScriptArrowArgsWithBacktracking()) {
try p.skipTypescriptReturnType();
+ if (comptime get_metadata)
+ result.* = .m_function;
} else {
try p.lexer.expect(.t_open_paren);
- try p.skipTypeScriptType(.lowest);
+ if (comptime get_metadata) {
+ result.* = try p.skipTypeScriptTypeWithMetadata(.lowest);
+ } else {
+ try p.skipTypeScriptType(.lowest);
+ }
try p.lexer.expect(.t_close_paren);
}
}
- fn skipTypeScriptTypeWithOpts(p: *P, level: js_ast.Op.Level, opts: TypeScript.SkipTypeOptions) anyerror!void {
+ fn skipTypeScriptTypeWithOpts(
+ p: *P,
+ level: js_ast.Op.Level,
+ opts: TypeScript.SkipTypeOptions.Bitset,
+ comptime get_metadata: bool,
+ result: *TypeScript.Metadata,
+ ) anyerror!void {
p.markTypeScriptOnly();
while (true) {
switch (p.lexer.token) {
- .t_numeric_literal,
- .t_big_integer_literal,
- .t_string_literal,
- .t_no_substitution_template_literal,
- .t_true,
- .t_false,
- .t_null,
- .t_void,
- => {
+ .t_numeric_literal => {
try p.lexer.next();
+ if (comptime get_metadata) {
+ result.* = .m_number;
+ }
+ },
+ .t_big_integer_literal => {
+ try p.lexer.next();
+ if (comptime get_metadata) {
+ result.* = .m_bigint;
+ }
+ },
+ .t_string_literal, .t_no_substitution_template_literal => {
+ try p.lexer.next();
+ if (comptime get_metadata) {
+ result.* = .m_string;
+ }
+ },
+ .t_true, .t_false => {
+ try p.lexer.next();
+ if (comptime get_metadata) {
+ result.* = .m_boolean;
+ }
+ },
+ .t_null => {
+ try p.lexer.next();
+ if (comptime get_metadata) {
+ result.* = .m_null;
+ }
+ },
+ .t_void => {
+ try p.lexer.next();
+ if (comptime get_metadata) {
+ result.* = .m_void;
+ }
},
-
.t_const => {
const r = p.lexer.range();
try p.lexer.next();
// ["const: number]"
- if (opts.allow_tuple_labels and p.lexer.token == .t_colon) {
+ if (opts.contains(.allow_tuple_labels) and p.lexer.token == .t_colon) {
try p.log.addRangeError(p.source, r, "Unexpected \"const\"");
}
},
@@ -7105,6 +7360,10 @@ fn NewParser_(
try p.skipTypeScriptType(.lowest);
return;
}
+
+ if (comptime get_metadata) {
+ result.* = .m_object;
+ }
},
.t_minus => {
// "-123"
@@ -7113,8 +7372,14 @@ fn NewParser_(
if (p.lexer.token == .t_big_integer_literal) {
try p.lexer.next();
+ if (comptime get_metadata) {
+ result.* = .m_bigint;
+ }
} else {
try p.lexer.expect(.t_numeric_literal);
+ if (comptime get_metadata) {
+ result.* = .m_number;
+ }
}
},
.t_ampersand, .t_bar => {
@@ -7127,7 +7392,7 @@ fn NewParser_(
try p.lexer.next();
// "[import: number]"
- if (opts.allow_tuple_labels and p.lexer.token == .t_colon) {
+ if (opts.contains(.allow_tuple_labels) and p.lexer.token == .t_colon) {
return;
}
@@ -7155,21 +7420,21 @@ fn NewParser_(
try p.lexer.next();
// "[new: number]"
- if (opts.allow_tuple_labels and p.lexer.token == .t_colon) {
+ if (opts.contains(.allow_tuple_labels) and p.lexer.token == .t_colon) {
return;
}
_ = try p.skipTypeScriptTypeParameters(.{ .allow_const_modifier = true });
- try p.skipTypeScriptParenOrFnType();
+ try p.skipTypeScriptParenOrFnType(get_metadata, result);
},
.t_less_than => {
// "<T>() => Foo<T>"
_ = try p.skipTypeScriptTypeParameters(.{ .allow_const_modifier = true });
- try p.skipTypeScriptParenOrFnType();
+ try p.skipTypeScriptParenOrFnType(get_metadata, result);
},
.t_open_paren => {
// "(number | string)"
- try p.skipTypeScriptParenOrFnType();
+ try p.skipTypeScriptParenOrFnType(get_metadata, result);
},
.t_identifier => {
const kind = TypeScript.Identifier.IMap.get(p.lexer.identifier) orelse .normal;
@@ -7177,7 +7442,7 @@ fn NewParser_(
var check_type_parameters = true;
switch (kind) {
- .prefix => {
+ .prefix_keyof => {
try p.lexer.next();
// Valid:
@@ -7188,10 +7453,28 @@ fn NewParser_(
// Invalid:
// "A extends B ? keyof : string"
//
- if ((p.lexer.token != .t_colon and p.lexer.token != .t_in) or (!opts.is_index_signature and !opts.allow_tuple_labels)) {
+ if ((p.lexer.token != .t_colon and p.lexer.token != .t_in) or (!opts.contains(.is_index_signature) and !opts.contains(.allow_tuple_labels))) {
try p.skipTypeScriptType(.prefix);
}
+ if (comptime get_metadata) {
+ result.* = .m_object;
+ }
+
+ break;
+ },
+ .prefix_readonly => {
+ try p.lexer.next();
+
+ if ((p.lexer.token != .t_colon and p.lexer.token != .t_in) or (!opts.contains(.is_index_signature) and !opts.contains(.allow_tuple_labels))) {
+ try p.skipTypeScriptType(.prefix);
+ }
+
+ // assume array or tuple literal
+ if (comptime get_metadata) {
+ result.* = .m_array;
+ }
+
break;
},
.infer => {
@@ -7201,7 +7484,7 @@ fn NewParser_(
// "type Foo = Bar extends [infer T extends string] ? T : null"
// "type Foo = Bar extends [infer T extends string ? infer T : never] ? T : null"
// "type Foo = { [infer in Bar]: number }"
- if ((p.lexer.token != .t_colon and p.lexer.token != .t_in) or (!opts.is_index_signature and !opts.allow_tuple_labels)) {
+ if ((p.lexer.token != .t_colon and p.lexer.token != .t_in) or (!opts.contains(.is_index_signature) and !opts.contains(.allow_tuple_labels))) {
try p.lexer.expect(.t_identifier);
if (p.lexer.token == .t_extends) {
_ = p.trySkipTypeScriptConstraintOfInferTypeWithBacktracking(opts);
@@ -7232,15 +7515,90 @@ fn NewParser_(
// "function assert(x: boolean): asserts x"
// "function assert(x: boolean): asserts x is boolean"
- if (opts.is_return_type and !p.lexer.has_newline_before and (p.lexer.token == .t_identifier or p.lexer.token == .t_this)) {
+ if (opts.contains(.is_return_type) and !p.lexer.has_newline_before and (p.lexer.token == .t_identifier or p.lexer.token == .t_this)) {
try p.lexer.next();
}
},
- .primitive => {
+ .primitive_any => {
+ try p.lexer.next();
+ check_type_parameters = false;
+ if (comptime get_metadata) {
+ result.* = .m_any;
+ }
+ },
+ .primitive_never => {
+ try p.lexer.next();
+ check_type_parameters = false;
+ if (comptime get_metadata) {
+ result.* = .m_never;
+ }
+ },
+ .primitive_unknown => {
+ try p.lexer.next();
+ check_type_parameters = false;
+ if (comptime get_metadata) {
+ result.* = .m_unknown;
+ }
+ },
+ .primitive_undefined => {
+ try p.lexer.next();
+ check_type_parameters = false;
+ if (comptime get_metadata) {
+ result.* = .m_undefined;
+ }
+ },
+ .primitive_object => {
+ try p.lexer.next();
+ check_type_parameters = false;
+ if (comptime get_metadata) {
+ result.* = .m_object;
+ }
+ },
+ .primitive_number => {
+ try p.lexer.next();
+ check_type_parameters = false;
+ if (comptime get_metadata) {
+ result.* = .m_number;
+ }
+ },
+ .primitive_string => {
try p.lexer.next();
check_type_parameters = false;
+ if (comptime get_metadata) {
+ result.* = .m_string;
+ }
+ },
+ .primitive_boolean => {
+ try p.lexer.next();
+ check_type_parameters = false;
+ if (comptime get_metadata) {
+ result.* = .m_boolean;
+ }
+ },
+ .primitive_bigint => {
+ try p.lexer.next();
+ check_type_parameters = false;
+ if (comptime get_metadata) {
+ result.* = .m_bigint;
+ }
+ },
+ .primitive_symbol => {
+ try p.lexer.next();
+ check_type_parameters = false;
+ if (comptime get_metadata) {
+ result.* = .m_symbol;
+ }
},
else => {
+ if (comptime get_metadata) {
+ const find_result = p.findSymbol(logger.Loc.Empty, p.lexer.identifier) catch unreachable;
+ if (p.known_enum_values.contains(find_result.ref)) {
+ result.* = .m_number;
+ } else {
+ result.* = .{ .m_identifier = find_result.ref };
+ }
+ }
+
try p.lexer.next();
},
}
@@ -7261,10 +7619,15 @@ fn NewParser_(
try p.lexer.next();
// "[typeof: number]"
- if (opts.allow_tuple_labels and p.lexer.token == .t_colon) {
+ if (opts.contains(.allow_tuple_labels) and p.lexer.token == .t_colon) {
return;
}
+ // always `Object`
+ if (comptime get_metadata) {
+ result.* = .m_object;
+ }
+
if (p.lexer.token == .t_import) {
// "typeof import('fs')"
continue;
@@ -7296,13 +7659,16 @@ fn NewParser_(
// "[first: number, second: string]"
try p.lexer.next();
+ if (comptime get_metadata) {
+ result.* = .m_array;
+ }
+
while (p.lexer.token != .t_close_bracket) {
if (p.lexer.token == .t_dot_dot_dot) {
try p.lexer.next();
}
- try p.skipTypeScriptTypeWithOpts(.lowest, TypeScript.SkipTypeOptions{
- .allow_tuple_labels = true,
- });
+ var dummy_result = TypeScript.Metadata.default;
+ try p.skipTypeScriptTypeWithOpts(.lowest, TypeScript.SkipTypeOptions.Bitset.initOne(.allow_tuple_labels), false, &dummy_result);
if (p.lexer.token == .t_question) {
try p.lexer.next();
}
@@ -7319,10 +7685,12 @@ fn NewParser_(
},
.t_open_brace => {
try p.skipTypeScriptObjectType();
+ if (comptime get_metadata) {
+ result.* = .m_object;
+ }
},
.t_template_head => {
// "`${'a' | 'b'}-${'c' | 'd'}`"
-
while (true) {
try p.lexer.next();
try p.skipTypeScriptType(.lowest);
@@ -7333,11 +7701,14 @@ fn NewParser_(
break;
}
}
+ if (comptime get_metadata) {
+ result.* = .m_string;
+ }
},
else => {
// "[function: number]"
- if (opts.allow_tuple_labels and p.lexer.isIdentifierOrKeyword()) {
+ if (opts.contains(.allow_tuple_labels) and p.lexer.isIdentifierOrKeyword()) {
if (p.lexer.token != .t_function) {
try p.lexer.unexpected();
}
@@ -7362,8 +7733,22 @@ fn NewParser_(
if (level.gte(.bitwise_or)) {
return;
}
+
try p.lexer.next();
- try p.skipTypeScriptType(.bitwise_or);
+
+ if (comptime get_metadata) {
+ var left = result.*;
+ if (left.finishUnion(p)) |final| {
+ // finish skipping the rest of the type without collecting type metadata.
+ result.* = final;
+ try p.skipTypeScriptType(.bitwise_or);
+ } else {
+ try p.skipTypeScriptTypeWithOpts(.bitwise_or, TypeScript.SkipTypeOptions.empty, get_metadata, result);
+ result.mergeUnion(left);
+ }
+ } else {
+ try p.skipTypeScriptType(.bitwise_or);
+ }
},
.t_ampersand => {
if (level.gte(.bitwise_and)) {
@@ -7371,7 +7756,20 @@ fn NewParser_(
}
try p.lexer.next();
- try p.skipTypeScriptType(.bitwise_and);
+
+ if (comptime get_metadata) {
+ var left = result.*;
+ if (left.finishIntersection(p)) |final| {
+ // finish skipping the rest of the type without collecting type metadata.
+ result.* = final;
+ try p.skipTypeScriptType(.bitwise_and);
+ } else {
+ try p.skipTypeScriptTypeWithOpts(.bitwise_and, TypeScript.SkipTypeOptions.empty, get_metadata, result);
+ result.mergeIntersection(left);
+ }
+ } else {
+ try p.skipTypeScriptType(.bitwise_and);
+ }
},
.t_exclamation => {
// A postfix "!" is allowed in JSDoc types in TypeScript, which are only
@@ -7390,6 +7788,22 @@ fn NewParser_(
if (!p.lexer.isIdentifierOrKeyword()) {
try p.lexer.expect(.t_identifier);
}
+
+ if (comptime get_metadata) {
+ if (result.* == .m_identifier) {
+ var dot = List(Ref).initCapacity(p.allocator, 2) catch unreachable;
+ dot.appendAssumeCapacity(result.m_identifier);
+ const find_result = p.findSymbol(logger.Loc.Empty, p.lexer.identifier) catch unreachable;
+ dot.appendAssumeCapacity(find_result.ref);
+ result.* = .{ .m_dot = dot };
+ } else if (result.* == .m_dot) {
+ if (p.lexer.isIdentifierOrKeyword()) {
+ const find_result = p.findSymbol(logger.Loc.Empty, p.lexer.identifier) catch unreachable;
+ result.m_dot.append(p.allocator, find_result.ref) catch unreachable;
+ }
+ }
+ }
+
try p.lexer.next();
// "{ <A extends B>(): c.d \n <E extends F>(): g.h }" must not become a single type
@@ -7403,26 +7817,56 @@ fn NewParser_(
return;
}
try p.lexer.next();
+ var skipped = false;
if (p.lexer.token != .t_close_bracket) {
+ skipped = true;
try p.skipTypeScriptType(.lowest);
}
try p.lexer.expect(.t_close_bracket);
+
+ if (comptime get_metadata) {
+ if (result.* == .m_none) {
+ result.* = .m_array;
+ } else {
+ // if something was skipped, it is object type
+ if (skipped) {
+ result.* = .m_object;
+ } else {
+ result.* = .m_array;
+ }
+ }
+ }
},
.t_extends => {
// "{ x: number \n extends: boolean }" must not become a single type
- if (p.lexer.has_newline_before or opts.disallow_conditional_types) {
+ if (p.lexer.has_newline_before or opts.contains(.disallow_conditional_types)) {
return;
}
try p.lexer.next();
// The type following "extends" is not permitted to be another conditional type
- try p.skipTypeScriptTypeWithOpts(.lowest, .{ .disallow_conditional_types = true });
+ var extends_type = TypeScript.Metadata.default;
+ try p.skipTypeScriptTypeWithOpts(.lowest, TypeScript.SkipTypeOptions.Bitset.initOne(.disallow_conditional_types), get_metadata, &extends_type);
- try p.lexer.expect(.t_question);
- try p.skipTypeScriptType(.lowest);
- try p.lexer.expect(.t_colon);
- try p.skipTypeScriptType(.lowest);
+ if (comptime get_metadata) {
+ // intersection
+ try p.lexer.expect(.t_question);
+ var left = try p.skipTypeScriptTypeWithMetadata(.lowest);
+ try p.lexer.expect(.t_colon);
+ if (left.finishIntersection(p)) |final| {
+ result.* = final;
+ try p.skipTypeScriptType(.lowest);
+ } else {
+ try p.skipTypeScriptTypeWithOpts(.bitwise_and, TypeScript.SkipTypeOptions.empty, get_metadata, result);
+ result.mergeIntersection(left);
+ }
+ } else {
+ try p.lexer.expect(.t_question);
+ try p.skipTypeScriptType(.lowest);
+ try p.lexer.expect(.t_colon);
+ try p.skipTypeScriptType(.lowest);
+ }
},
else => {
return;
@@ -7452,7 +7896,8 @@ fn NewParser_(
if (p.lexer.token == .t_open_bracket) {
// Index signature or computed property
try p.lexer.next();
- try p.skipTypeScriptTypeWithOpts(.lowest, .{ .is_index_signature = true });
+ var metadata = TypeScript.Metadata.default;
+ try p.skipTypeScriptTypeWithOpts(.lowest, TypeScript.SkipTypeOptions.Bitset.initOne(.is_index_signature), false, &metadata);
// "{ [key: string]: number }"
// "{ readonly [K in keyof T]: T[K] }"
@@ -11122,13 +11567,12 @@ fn NewParser_(
return result;
}
- pub fn skipTypeScriptConstraintOfInferTypeWithBacktracking(p: *P, flags: TypeScript.SkipTypeOptions) anyerror!bool {
+ pub fn skipTypeScriptConstraintOfInferTypeWithBacktracking(p: *P, flags: TypeScript.SkipTypeOptions.Bitset) anyerror!bool {
try p.lexer.expect(.t_extends);
- try p.skipTypeScriptTypeWithOpts(.prefix, TypeScript.SkipTypeOptions{
- .disallow_conditional_types = true,
- });
+ var metadata = TypeScript.Metadata.default;
+ try p.skipTypeScriptTypeWithOpts(.prefix, TypeScript.SkipTypeOptions.Bitset.initOne(.disallow_conditional_types), false, &metadata);
- if (!flags.disallow_conditional_types and p.lexer.token == .t_question) {
+ if (!flags.contains(.disallow_conditional_types) and p.lexer.token == .t_question) {
return error.Backtrack;
}
@@ -11181,7 +11625,7 @@ fn NewParser_(
return Backtracking.lexerBacktracker(p, Backtracking.skipTypeScriptArrowArgsWithBacktracking, bool);
}
- pub fn trySkipTypeScriptConstraintOfInferTypeWithBacktracking(p: *P, flags: TypeScript.SkipTypeOptions) bool {
+ pub fn trySkipTypeScriptConstraintOfInferTypeWithBacktracking(p: *P, flags: TypeScript.SkipTypeOptions.Bitset) bool {
return Backtracking.lexerBacktrackerWithArgs(p, Backtracking.skipTypeScriptConstraintOfInferTypeWithBacktracking, .{ p, flags }, bool);
}
@@ -11621,6 +12065,7 @@ fn NewParser_(
(p.lexer.token != .t_open_paren or has_definite_assignment_assertion_operator))
{
var initializer: ?Expr = null;
+ var ts_metadata = TypeScript.Metadata.default;
// Forbid the names "constructor" and "prototype" in some cases
if (!is_computed) {
@@ -11639,7 +12084,11 @@ fn NewParser_(
// Skip over types
if (p.lexer.token == .t_colon) {
try p.lexer.next();
- try p.skipTypeScriptType(.lowest);
+ if (p.options.features.emit_decorator_metadata and opts.is_class and opts.ts_decorators.len > 0) {
+ ts_metadata = try p.skipTypeScriptTypeWithMetadata(.lowest);
+ } else {
+ try p.skipTypeScriptType(.lowest);
+ }
}
}
@@ -11693,6 +12142,7 @@ fn NewParser_(
}),
.key = key,
.initializer = initializer,
+ .ts_metadata = ts_metadata,
};
}
@@ -11739,6 +12189,7 @@ fn NewParser_(
.allow_super_property = true,
.allow_ts_decorators = opts.allow_ts_decorators,
.is_constructor = is_constructor,
+ .has_decorators = opts.ts_decorators.len > 0 or (opts.has_class_decorators and is_constructor),
// Only allow omitting the body if we're parsing TypeScript class
.allow_missing_body_for_type_script = is_typescript_enabled and opts.is_class,
@@ -11816,6 +12267,7 @@ fn NewParser_(
}),
.key = key,
.value = value,
+ .ts_metadata = .m_function,
};
}
@@ -11895,6 +12347,7 @@ fn NewParser_(
const first_decorator_loc = p.lexer.loc();
if (opts.allow_ts_decorators) {
opts.ts_decorators = try p.parseTypeScriptDecorators();
+ opts.has_class_decorators = class_opts.ts_decorators.len > 0;
has_decorators = has_decorators or opts.ts_decorators.len > 0;
} else {
opts.ts_decorators = &[_]Expr{};
@@ -12131,7 +12584,7 @@ fn NewParser_(
// Remove unnecessary optional chains
if (p.options.features.minify_syntax) {
- const result = SideEffects.toNullOrUndefined(left.data);
+ const result = SideEffects.toNullOrUndefined(p, left.data);
if (result.ok and !result.value) {
optional_start = null;
}
@@ -13568,7 +14021,7 @@ fn NewParser_(
.name = part,
.name_loc = loc,
- .can_be_removed_if_unused = true,
+ .can_be_removed_if_unused = p.options.features.dead_code_elimination,
},
loc,
);
@@ -14031,6 +14484,7 @@ fn NewParser_(
}
fn bindingCanBeRemovedIfUnused(p: *P, binding: Binding) bool {
+ if (!p.options.features.dead_code_elimination) return false;
switch (binding.data) {
.b_array => |bi| {
for (bi.items) |*item| {
@@ -14069,6 +14523,7 @@ fn NewParser_(
}
fn stmtsCanBeRemovedIfUnused(p: *P, stmts: []Stmt) bool {
+ if (!p.options.features.dead_code_elimination) return false;
for (stmts) |stmt| {
switch (stmt.data) {
// These never have side effects
@@ -14902,7 +15357,7 @@ fn NewParser_(
// Mark the control flow as dead if the branch is never taken
switch (e_.op) {
.bin_logical_or => {
- const side_effects = SideEffects.toBoolean(e_.left.data);
+ const side_effects = SideEffects.toBoolean(p, e_.left.data);
if (side_effects.ok and side_effects.value) {
// "true || dead"
const old = p.is_control_flow_dead;
@@ -14914,7 +15369,7 @@ fn NewParser_(
}
},
.bin_logical_and => {
- const side_effects = SideEffects.toBoolean(e_.left.data);
+ const side_effects = SideEffects.toBoolean(p, e_.left.data);
if (side_effects.ok and !side_effects.value) {
// "false && dead"
const old = p.is_control_flow_dead;
@@ -14926,7 +15381,7 @@ fn NewParser_(
}
},
.bin_nullish_coalescing => {
- const side_effects = SideEffects.toNullOrUndefined(e_.left.data);
+ const side_effects = SideEffects.toNullOrUndefined(p, e_.left.data);
if (side_effects.ok and !side_effects.value) {
// "notNullOrUndefined ?? dead"
const old = p.is_control_flow_dead;
@@ -15006,7 +15461,7 @@ fn NewParser_(
}
},
.bin_nullish_coalescing => {
- const nullorUndefined = SideEffects.toNullOrUndefined(e_.left.data);
+ const nullorUndefined = SideEffects.toNullOrUndefined(p, e_.left.data);
if (nullorUndefined.ok) {
if (!nullorUndefined.value) {
return e_.left;
@@ -15023,7 +15478,7 @@ fn NewParser_(
}
},
.bin_logical_or => {
- const side_effects = SideEffects.toBoolean(e_.left.data);
+ const side_effects = SideEffects.toBoolean(p, e_.left.data);
if (side_effects.ok and side_effects.value) {
return e_.left;
} else if (side_effects.ok and side_effects.side_effects == .no_side_effects) {
@@ -15038,7 +15493,7 @@ fn NewParser_(
}
},
.bin_logical_and => {
- const side_effects = SideEffects.toBoolean(e_.left.data);
+ const side_effects = SideEffects.toBoolean(p, e_.left.data);
if (side_effects.ok) {
if (!side_effects.value) {
return e_.left;
@@ -15404,7 +15859,7 @@ fn NewParser_(
if (p.options.features.minify_syntax)
e_.value = SideEffects.simplifyBoolean(p, e_.value);
- const side_effects = SideEffects.toBoolean(e_.value.data);
+ const side_effects = SideEffects.toBoolean(p, e_.value.data);
if (side_effects.ok) {
return p.newExpr(E.Boolean{ .value = !side_effects.value }, expr.loc);
}
@@ -15556,7 +16011,7 @@ fn NewParser_(
e_.test_ = SideEffects.simplifyBoolean(p, e_.test_);
- const side_effects = SideEffects.toBoolean(e_.test_.data);
+ const side_effects = SideEffects.toBoolean(p, e_.test_.data);
if (!side_effects.ok) {
e_.yes = p.visitExpr(e_.yes);
@@ -16129,6 +16584,7 @@ fn NewParser_(
}
pub fn classCanBeRemovedIfUnused(p: *P, class: *G.Class) bool {
+ if (!p.options.features.dead_code_elimination) return false;
if (class.extends) |*extends| {
if (!p.exprCanBeRemovedIfUnused(extends)) {
return false;
@@ -16167,6 +16623,7 @@ fn NewParser_(
// When React Fast Refresh is enabled, anything that's a JSX component should not be removable
// This is to improve the reliability of fast refresh between page loads.
pub fn exprCanBeRemovedIfUnused(p: *P, expr: *const Expr) bool {
+ if (!p.options.features.dead_code_elimination) return false;
switch (expr.data) {
.e_null,
.e_undefined,
@@ -17301,7 +17758,7 @@ fn NewParser_(
const orig_dead = p.is_control_flow_dead;
if (p.options.features.replace_exports.count() > 0) {
if (p.options.features.replace_exports.getPtr("default")) |entry| {
- p.is_control_flow_dead = entry.* != .replace;
+ p.is_control_flow_dead = p.options.features.dead_code_elimination and (entry.* != .replace);
mark_for_replace = true;
}
}
@@ -17555,7 +18012,8 @@ fn NewParser_(
}
},
.s_expr => |data| {
- const should_trim_primitive = !p.options.features.minify_syntax and !data.value.isPrimitiveLiteral();
+ const should_trim_primitive = p.options.features.dead_code_elimination and
+ (p.options.features.minify_syntax and data.value.isPrimitiveLiteral());
p.stmt_expr_value = data.value.data;
defer p.stmt_expr_value = .{ .e_missing = .{} };
@@ -17726,7 +18184,7 @@ fn NewParser_(
data.body = p.visitLoopBody(data.body);
data.test_ = SideEffects.simplifyBoolean(p, data.test_);
- const result = SideEffects.toBoolean(data.test_.data);
+ const result = SideEffects.toBoolean(p, data.test_.data);
if (result.ok and result.side_effects == .no_side_effects) {
data.test_ = p.newExpr(E.Boolean{ .value = result.value }, data.test_.loc);
}
@@ -17744,7 +18202,7 @@ fn NewParser_(
data.test_ = SideEffects.simplifyBoolean(p, data.test_);
}
- const effects = SideEffects.toBoolean(data.test_.data);
+ const effects = SideEffects.toBoolean(p, data.test_.data);
if (effects.ok and !effects.value) {
const old = p.is_control_flow_dead;
p.is_control_flow_dead = true;
@@ -17776,7 +18234,7 @@ fn NewParser_(
if (p.options.features.minify_syntax) {
if (effects.ok) {
if (effects.value) {
- if (data.no == null or !SideEffects.shouldKeepStmtInDeadControlFlow(data.no.?, p.allocator)) {
+ if (data.no == null or !SideEffects.shouldKeepStmtInDeadControlFlow(p, data.no.?, p.allocator)) {
if (effects.side_effects == .could_have_side_effects) {
// Keep the condition if it could have side effects (but is still known to be truthy)
if (SideEffects.simpifyUnusedExpr(p, data.test_)) |test_| {
@@ -17790,7 +18248,7 @@ fn NewParser_(
}
} else {
// The test is falsy
- if (!SideEffects.shouldKeepStmtInDeadControlFlow(data.yes, p.allocator)) {
+ if (!SideEffects.shouldKeepStmtInDeadControlFlow(p, data.yes, p.allocator)) {
if (effects.side_effects == .could_have_side_effects) {
// Keep the condition if it could have side effects (but is still known to be truthy)
if (SideEffects.simpifyUnusedExpr(p, data.test_)) |test_| {
@@ -17845,7 +18303,7 @@ fn NewParser_(
if (data.test_) |test_| {
data.test_ = SideEffects.simplifyBoolean(p, p.visitExpr(test_));
- const result = SideEffects.toBoolean(data.test_.?.data);
+ const result = SideEffects.toBoolean(p, data.test_.?.data);
if (result.ok and result.value and result.side_effects == .no_side_effects) {
data.test_ = null;
}
@@ -17986,7 +18444,8 @@ fn NewParser_(
.s_function => |data| {
// We mark it as dead, but the value may not actually be dead
// We just want to be sure to not increment the usage counts for anything in the function
- const mark_as_dead = data.func.flags.contains(.is_export) and p.options.features.replace_exports.count() > 0 and p.isExportToEliminate(data.func.name.?.ref.?);
+ const mark_as_dead = p.options.features.dead_code_elimination and data.func.flags.contains(.is_export) and
+ p.options.features.replace_exports.count() > 0 and p.isExportToEliminate(data.func.name.?.ref.?);
const original_is_dead = p.is_control_flow_dead;
if (mark_as_dead) {
@@ -18036,7 +18495,8 @@ fn NewParser_(
return;
},
.s_class => |data| {
- const mark_as_dead = data.is_export and p.options.features.replace_exports.count() > 0 and p.isExportToEliminate(data.class.class_name.?.ref.?);
+ const mark_as_dead = p.options.features.dead_code_elimination and data.is_export and
+ p.options.features.replace_exports.count() > 0 and p.isExportToEliminate(data.class.class_name.?.ref.?);
const original_is_dead = p.is_control_flow_dead;
if (mark_as_dead) {
@@ -18123,7 +18583,7 @@ fn NewParser_(
// Track values so they can be used by constant folding. We need to follow
// links here in case the enum was merged with a preceding namespace
- var values_so_far = StringHashMapUnamanged(f64){};
+ var values_so_far = StringHashMapUnmanaged(f64){};
p.known_enum_values.put(allocator, data.name.ref orelse p.panic("Expected data.name.ref", .{}), values_so_far) catch unreachable;
p.known_enum_values.put(allocator, data.arg, values_so_far) catch unreachable;
@@ -18288,7 +18748,7 @@ fn NewParser_(
if (decl.binding.data == .b_identifier) {
if (p.options.features.replace_exports.getPtr(p.loadNameFromRef(decl.binding.data.b_identifier.ref))) |replacer| {
replacement = replacer;
- if (replacer.* != .replace) {
+ if (p.options.features.dead_code_elimination and (replacer.* != .replace)) {
p.is_control_flow_dead = true;
}
}
@@ -18765,7 +19225,7 @@ fn NewParser_(
const args = p.allocator.alloc(Expr, 2) catch unreachable;
args[0] = p.newExpr(E.Number{ .value = @as(f64, @floatFromInt(i)) }, arg_decorator.loc);
args[1] = arg_decorator;
- decorators.append(p.callRuntime(arg_decorator.loc, "__decorateParam", args)) catch unreachable;
+ decorators.append(p.callRuntime(arg_decorator.loc, "__legacyDecorateParamTS", args)) catch unreachable;
if (is_constructor) {
class.ts_decorators.update(decorators);
} else {
@@ -18792,7 +19252,12 @@ fn NewParser_(
else => bun.unreachablePanic("Unexpected AST node type {any}", .{prop.key.?}),
};
- const descriptor_kind: f64 = if (!prop.flags.contains(.is_method)) 2 else 1;
+ // TODO: when we have the `accessor` modifier, add `and !prop.flags.contains(.has_accessor_modifier)` to
+ // the if statement.
+ const descriptor_kind: Expr = if (!prop.flags.contains(.is_method))
+ p.newExpr(E.Undefined{}, loc)
+ else
+ p.newExpr(E.Null{}, loc);
var target: Expr = undefined;
if (prop.flags.contains(.is_static)) {
@@ -18802,13 +19267,60 @@ fn NewParser_(
target = p.newExpr(E.Dot{ .target = p.newExpr(E.Identifier{ .ref = class.class_name.?.ref.? }, class.class_name.?.loc), .name = "prototype", .name_loc = loc }, loc);
}
+ var array = prop.ts_decorators.listManaged(p.allocator);
+
+ if (p.options.features.emit_decorator_metadata) {
+ {
+ // design:type
+ var args = p.allocator.alloc(Expr, 2) catch unreachable;
+ args[0] = p.newExpr(E.String{ .data = "design:type" }, logger.Loc.Empty);
+ args[1] = p.serializeMetadata(prop.ts_metadata) catch unreachable;
+ array.append(p.callRuntime(loc, "__legacyMetadataTS", args)) catch unreachable;
+ }
+ {
+ // design:paramtypes and design:returntype if method
+ if (prop.flags.contains(.is_method)) {
+ if (prop.value) |prop_value| {
+ {
+ var args = p.allocator.alloc(Expr, 2) catch unreachable;
+ args[0] = p.newExpr(E.String{ .data = "design:paramtypes" }, logger.Loc.Empty);
+
+ const method_args = prop_value.data.e_function.func.args;
+
+ if (method_args.len > 0) {
+ var args_array = p.allocator.alloc(Expr, method_args.len) catch unreachable;
+
+ for (method_args, 0..) |method_arg, i| {
+ args_array[i] = p.serializeMetadata(method_arg.ts_metadata) catch unreachable;
+ }
+
+ args[1] = p.newExpr(E.Array{ .items = ExprNodeList.init(args_array) }, logger.Loc.Empty);
+ } else {
+ args[1] = p.newExpr(E.Array{ .items = ExprNodeList.init(&[_]Expr{}) }, logger.Loc.Empty);
+ }
+
+ array.append(p.callRuntime(loc, "__legacyMetadataTS", args)) catch unreachable;
+ }
+ {
+ var args = p.allocator.alloc(Expr, 2) catch unreachable;
+ args[0] = p.newExpr(E.String{ .data = "design:returntype" }, logger.Loc.Empty);
+
+ args[1] = p.serializeMetadata(prop_value.data.e_function.func.return_ts_metadata) catch unreachable;
+
+ array.append(p.callRuntime(loc, "__legacyMetadataTS", args)) catch unreachable;
+ }
+ }
+ }
+ }
+ }
+
const args = p.allocator.alloc(Expr, 4) catch unreachable;
- args[0] = p.newExpr(E.Array{ .items = prop.ts_decorators }, loc);
+ args[0] = p.newExpr(E.Array{ .items = ExprNodeList.init(array.items) }, loc);
args[1] = target;
args[2] = descriptor_key;
- args[3] = p.newExpr(E.Number{ .value = descriptor_kind }, loc);
+ args[3] = descriptor_kind;
- const decorator = p.callRuntime(prop.key.?.loc, "__decorateClass", args);
+ const decorator = p.callRuntime(prop.key.?.loc, "__legacyDecorateClassTS", args);
const decorator_stmt = p.s(S.SExpr{ .value = decorator }, decorator.loc);
if (prop.flags.contains(.is_static)) {
@@ -18916,13 +19428,38 @@ fn NewParser_(
stmts.appendSliceAssumeCapacity(instance_decorators.items);
stmts.appendSliceAssumeCapacity(static_decorators.items);
if (class.ts_decorators.len > 0) {
+ var array = class.ts_decorators.listManaged(p.allocator);
+
+ if (p.options.features.emit_decorator_metadata) {
+ if (constructor_function != null) {
+ // design:paramtypes
+ var args = p.allocator.alloc(Expr, 2) catch unreachable;
+ args[0] = p.newExpr(E.String{ .data = "design:paramtypes" }, logger.Loc.Empty);
+
+ const constructor_args = constructor_function.?.func.args;
+ if (constructor_args.len > 0) {
+ var param_array = p.allocator.alloc(Expr, constructor_args.len) catch unreachable;
+
+ for (constructor_args, 0..) |constructor_arg, i| {
+ param_array[i] = p.serializeMetadata(constructor_arg.ts_metadata) catch unreachable;
+ }
+
+ args[1] = p.newExpr(E.Array{ .items = ExprNodeList.init(param_array) }, logger.Loc.Empty);
+ } else {
+ args[1] = p.newExpr(E.Array{ .items = ExprNodeList.init(&[_]Expr{}) }, logger.Loc.Empty);
+ }
+
+ array.append(p.callRuntime(stmt.loc, "__legacyMetadataTS", args)) catch unreachable;
+ }
+ }
+
const args = p.allocator.alloc(Expr, 2) catch unreachable;
- args[0] = p.newExpr(E.Array{ .items = class.ts_decorators }, stmt.loc);
+ args[0] = p.newExpr(E.Array{ .items = ExprNodeList.init(array.items) }, stmt.loc);
args[1] = p.newExpr(E.Identifier{ .ref = class.class_name.?.ref.? }, class.class_name.?.loc);
stmts.appendAssumeCapacity(Stmt.assign(
p.newExpr(E.Identifier{ .ref = class.class_name.?.ref.? }, class.class_name.?.loc),
- p.callRuntime(stmt.loc, "__decorateClass", args),
+ p.callRuntime(stmt.loc, "__legacyDecorateClassTS", args),
p.allocator,
));
@@ -18939,6 +19476,234 @@ fn NewParser_(
}
}
+ fn serializeMetadata(p: *P, ts_metadata: TypeScript.Metadata) !Expr {
+ return switch (ts_metadata) {
+ .m_none,
+ .m_any,
+ .m_unknown,
+ .m_object,
+ => p.newExpr(
+ E.Identifier{
+ .ref = (p.findSymbol(logger.Loc.Empty, "Object") catch unreachable).ref,
+ },
+ logger.Loc.Empty,
+ ),
+
+ .m_never,
+ .m_undefined,
+ .m_null,
+ .m_void,
+ => p.newExpr(
+ E.Undefined{},
+ logger.Loc.Empty,
+ ),
+
+ .m_string => p.newExpr(
+ E.Identifier{
+ .ref = (p.findSymbol(logger.Loc.Empty, "String") catch unreachable).ref,
+ },
+ logger.Loc.Empty,
+ ),
+ .m_number => p.newExpr(
+ E.Identifier{
+ .ref = (p.findSymbol(logger.Loc.Empty, "Number") catch unreachable).ref,
+ },
+ logger.Loc.Empty,
+ ),
+ .m_function => p.newExpr(
+ E.Identifier{
+ .ref = (p.findSymbol(logger.Loc.Empty, "Function") catch unreachable).ref,
+ },
+ logger.Loc.Empty,
+ ),
+ .m_boolean => p.newExpr(
+ E.Identifier{
+ .ref = (p.findSymbol(logger.Loc.Empty, "Boolean") catch unreachable).ref,
+ },
+ logger.Loc.Empty,
+ ),
+ .m_array => p.newExpr(
+ E.Identifier{
+ .ref = (p.findSymbol(logger.Loc.Empty, "Array") catch unreachable).ref,
+ },
+ logger.Loc.Empty,
+ ),
+
+ .m_bigint => p.maybeDefinedHelper(
+ p.newExpr(
+ E.Identifier{
+ .ref = (p.findSymbol(logger.Loc.Empty, "BigInt") catch unreachable).ref,
+ },
+ logger.Loc.Empty,
+ ),
+ ),
+
+ .m_symbol => p.maybeDefinedHelper(
+ p.newExpr(
+ E.Identifier{
+ .ref = (p.findSymbol(logger.Loc.Empty, "Symbol") catch unreachable).ref,
+ },
+ logger.Loc.Empty,
+ ),
+ ),
+
+ .m_promise => p.newExpr(
+ E.Identifier{
+ .ref = (p.findSymbol(logger.Loc.Empty, "Promise") catch unreachable).ref,
+ },
+ logger.Loc.Empty,
+ ),
+
+ .m_identifier => |ref| {
+ p.recordUsage(ref);
+ if (p.is_import_item.contains(ref)) {
+ return p.maybeDefinedHelper(p.newExpr(
+ E.ImportIdentifier{
+ .ref = ref,
+ },
+ logger.Loc.Empty,
+ ));
+ }
+
+ return p.maybeDefinedHelper(p.newExpr(
+ E.Identifier{ .ref = ref },
+ logger.Loc.Empty,
+ ));
+ },
+
+ .m_dot => |_refs| {
+ var refs = _refs;
+ std.debug.assert(refs.items.len >= 2);
+ defer refs.deinit(p.allocator);
+
+ var dots = p.newExpr(
+ E.Dot{
+ .name = p.loadNameFromRef(refs.items[refs.items.len - 1]),
+ .name_loc = logger.Loc.Empty,
+ .target = undefined,
+ },
+ logger.Loc.Empty,
+ );
+
+ var current_expr = &dots.data.e_dot.target;
+ var i: usize = refs.items.len - 2;
+ while (i > 0) {
+ current_expr.* = p.newExpr(E.Dot{
+ .name = p.loadNameFromRef(refs.items[i]),
+ .name_loc = logger.Loc.Empty,
+ .target = undefined,
+ }, logger.Loc.Empty);
+ current_expr = &current_expr.data.e_dot.target;
+ i -= 1;
+ }
+
+ if (p.is_import_item.contains(refs.items[0])) {
+ current_expr.* = p.newExpr(
+ E.ImportIdentifier{
+ .ref = refs.items[0],
+ },
+ logger.Loc.Empty,
+ );
+ } else {
+ current_expr.* = p.newExpr(
+ E.Identifier{
+ .ref = refs.items[0],
+ },
+ logger.Loc.Empty,
+ );
+ }
+
+ const dot_identifier = current_expr.*;
+ var current_dot = dots;
+
+ var maybe_defined_dots = p.newExpr(
+ E.Binary{
+ .op = .bin_logical_or,
+ .right = try p.checkIfDefinedHelper(current_dot),
+ .left = undefined,
+ },
+ logger.Loc.Empty,
+ );
+
+ if (i < refs.items.len - 2) {
+ current_dot = current_dot.data.e_dot.target;
+ }
+ current_expr = &maybe_defined_dots.data.e_binary.left;
+
+ while (i < refs.items.len - 2) {
+ current_expr.* = p.newExpr(
+ E.Binary{
+ .op = .bin_logical_or,
+ .right = try p.checkIfDefinedHelper(current_dot),
+ .left = undefined,
+ },
+ logger.Loc.Empty,
+ );
+
+ current_expr = &current_expr.data.e_binary.left;
+ i += 1;
+ if (i < refs.items.len - 2) {
+ current_dot = current_dot.data.e_dot.target;
+ }
+ }
+
+ current_expr.* = try p.checkIfDefinedHelper(dot_identifier);
+
+ var root = p.newExpr(
+ E.If{
+ .yes = p.newExpr(
+ E.Identifier{
+ .ref = (p.findSymbol(logger.Loc.Empty, "Object") catch unreachable).ref,
+ },
+ logger.Loc.Empty,
+ ),
+ .no = dots,
+ .test_ = maybe_defined_dots,
+ },
+ logger.Loc.Empty,
+ );
+
+ return root;
+ },
+ };
+ }
+
+ fn checkIfDefinedHelper(p: *P, expr: Expr) !Expr {
+ return p.newExpr(
+ E.Binary{
+ .op = .bin_strict_eq,
+ .left = p.newExpr(
+ E.Unary{
+ .op = .un_typeof,
+ .value = expr,
+ },
+ logger.Loc.Empty,
+ ),
+ .right = p.newExpr(
+ E.String{ .data = "undefined" },
+ logger.Loc.Empty,
+ ),
+ },
+ logger.Loc.Empty,
+ );
+ }
+
+ fn maybeDefinedHelper(p: *P, identifier_expr: Expr) !Expr {
+ return p.newExpr(
+ E.If{
+ .test_ = try p.checkIfDefinedHelper(identifier_expr),
+ .yes = p.newExpr(
+ E.Identifier{
+ .ref = (p.findSymbol(logger.Loc.Empty, "Object") catch unreachable).ref,
+ },
+ logger.Loc.Empty,
+ ),
+ .no = identifier_expr,
+ },
+ logger.Loc.Empty,
+ );
+ }
+
fn visitForLoopInit(p: *P, stmt: Stmt, is_in_or_of: bool) Stmt {
switch (stmt.data) {
.s_expr => |st| {
@@ -19713,7 +20478,7 @@ fn NewParser_(
if (p.is_control_flow_dead) {
var end: usize = 0;
for (visited.items) |item| {
- if (!SideEffects.shouldKeepStmtInDeadControlFlow(item, p.allocator)) {
+ if (!SideEffects.shouldKeepStmtInDeadControlFlow(p, item, p.allocator)) {
continue;
}
@@ -19802,7 +20567,9 @@ fn NewParser_(
var output = ListManaged(Stmt).initCapacity(p.allocator, stmts.items.len) catch unreachable;
for (stmts.items) |stmt| {
- if (is_control_flow_dead and !SideEffects.shouldKeepStmtInDeadControlFlow(stmt, p.allocator)) {
+ if (is_control_flow_dead and p.options.features.dead_code_elimination and
+ !SideEffects.shouldKeepStmtInDeadControlFlow(p, stmt, p.allocator))
+ {
// Strip unnecessary statements if the control flow is dead here
continue;
}
@@ -20474,42 +21241,50 @@ fn NewParser_(
parts[parts.len - 1].stmts = new_stmts_list;
},
- // This becomes
+ // This transforms the user's code into.
//
- // (function (module, exports, require) {
+ // (function (exports, require, module, __filename, __dirname) {
+ // ...
+ // }).call(
+ // this.module.exports,
+ // this.module.exports,
+ // this.require,
+ // this.module,
+ // this.__filename,
+ // this.__dirname,
+ // );
//
- // })(module, exports, require);
+ // `this` is a `CommonJSFunctionArgumentsStructure`
+ // which is initialized in `evaluateCommonJSModuleOnce`
.bun_js => {
var args = allocator.alloc(Arg, 5) catch unreachable;
args[0..5].* = .{
- Arg{
- .binding = p.b(B.Identifier{ .ref = p.module_ref }, logger.Loc.Empty),
- },
- Arg{
- .binding = p.b(B.Identifier{ .ref = p.exports_ref }, logger.Loc.Empty),
- },
- Arg{
- .binding = p.b(B.Identifier{ .ref = p.require_ref }, logger.Loc.Empty),
- },
- Arg{
- .binding = p.b(B.Identifier{ .ref = p.dirname_ref }, logger.Loc.Empty),
- },
- Arg{
- .binding = p.b(B.Identifier{ .ref = p.filename_ref }, logger.Loc.Empty),
- },
+ Arg{ .binding = p.b(B.Identifier{ .ref = p.exports_ref }, logger.Loc.Empty) },
+ Arg{ .binding = p.b(B.Identifier{ .ref = p.require_ref }, logger.Loc.Empty) },
+ Arg{ .binding = p.b(B.Identifier{ .ref = p.module_ref }, logger.Loc.Empty) },
+ Arg{ .binding = p.b(B.Identifier{ .ref = p.filename_ref }, logger.Loc.Empty) },
+ Arg{ .binding = p.b(B.Identifier{ .ref = p.dirname_ref }, logger.Loc.Empty) },
+ };
+
+ const cjsArguments = Expr{
+ .data = .{ .e_this = .{} },
+ .loc = logger.Loc.Empty,
};
+
var total_stmts_count: usize = 0;
for (parts) |part| {
total_stmts_count += part.stmts.len;
}
var stmts_to_copy = allocator.alloc(Stmt, total_stmts_count) catch unreachable;
- var remaining_stmts = stmts_to_copy;
- for (parts) |part| {
- for (part.stmts, remaining_stmts[0..part.stmts.len]) |src, *dest| {
- dest.* = src;
+ {
+ var remaining_stmts = stmts_to_copy;
+ for (parts) |part| {
+ for (part.stmts, remaining_stmts[0..part.stmts.len]) |src, *dest| {
+ dest.* = src;
+ }
+ remaining_stmts = remaining_stmts[part.stmts.len..];
}
- remaining_stmts = remaining_stmts[part.stmts.len..];
}
const wrapper = p.newExpr(
@@ -20517,147 +21292,57 @@ fn NewParser_(
.func = G.Fn{
.name = null,
.open_parens_loc = logger.Loc.Empty,
- .args = args,
+ .args = args[0..5],
.body = .{ .loc = logger.Loc.Empty, .stmts = stmts_to_copy },
.flags = Flags.Function.init(.{ .is_export = false }),
},
},
logger.Loc.Empty,
);
- const cjsGlobal = p.newSymbol(.unbound, "$_BunCommonJSModule_$") catch unreachable;
- var all_call_args = allocator.alloc(Expr, 8) catch unreachable;
+
const this_module = p.newExpr(
E.Dot{
.name = "module",
- .target = p.newExpr(E.Identifier{ .ref = cjsGlobal }, logger.Loc.Empty),
+ .target = cjsArguments,
.name_loc = logger.Loc.Empty,
},
logger.Loc.Empty,
);
- var bind_args = all_call_args[0..1];
- bind_args[0] = this_module;
- var bind_resolve_args = all_call_args[1..2];
- var call_args = all_call_args[2..];
-
- const module_id = p.newExpr(E.Dot{
- .name = "id",
- .target = this_module,
- .name_loc = logger.Loc.Empty,
- }, logger.Loc.Empty);
-
- bind_resolve_args[0] = module_id;
- const get_require = p.newExpr(
+ const module_exports = p.newExpr(
E.Dot{
- .name = "require",
+ .name = "exports",
.target = this_module,
.name_loc = logger.Loc.Empty,
},
logger.Loc.Empty,
);
- const create_binding = p.newExpr(
- E.Call{
- .target = p.newExpr(E.Dot{
- .name = "bind",
- .name_loc = logger.Loc.Empty,
- .target = get_require,
- }, logger.Loc.Empty),
- .args = bun.BabyList(Expr).init(bind_args),
- },
- logger.Loc.Empty,
- );
-
- const get_resolve = p.newExpr(E.Dot{
- .name = "resolve",
- .name_loc = logger.Loc.Empty,
- .target = get_require,
- }, logger.Loc.Empty);
-
- const create_resolve_binding = p.newExpr(
- E.Call{
- .target = p.newExpr(E.Dot{
- .name = "bind",
- .name_loc = logger.Loc.Empty,
- .target = get_resolve,
- }, logger.Loc.Empty),
- .args = bun.BabyList(Expr).init(bind_resolve_args),
- },
- logger.Loc.Empty,
- );
-
- const require_path = p.newExpr(
- E.Dot{
- .name = "path",
- .target = get_require,
- .name_loc = logger.Loc.Empty,
- },
- logger.Loc.Empty,
- );
- const assign_binding = p.newExpr(
- E.Binary{
- .left = get_require,
- .right = create_binding,
- .op = .bin_assign,
- },
- logger.Loc.Empty,
- );
-
- const assign_resolve_binding = p.newExpr(
- E.Binary{
- .left = get_resolve,
- .right = create_resolve_binding,
- .op = .bin_assign,
- },
- logger.Loc.Empty,
- );
-
- const assign_id = p.newExpr(E.Binary{
- .left = require_path,
- .right = module_id,
- .op = .bin_assign,
- }, logger.Loc.Empty);
-
- var create_require = [4]Expr{
- assign_binding,
- assign_id,
- assign_resolve_binding,
- get_require,
- };
-
- //
- // (function(module, exports, require, __dirname, __filename) {}).call(this.exports, this.module, this.exports, this.module.require = this.module.require.bind(module), (this.module.require.id = this.module.id, this.module.require), __dirname, __filename)
+ var call_args = allocator.alloc(Expr, 6) catch unreachable;
call_args[0..6].* = .{
+ module_exports, // this.module.exports (this value inside fn)
+ module_exports, // this.module.exports (arg 1)
p.newExpr(
E.Dot{
- .name = "exports",
- .target = this_module,
+ .name = "require",
+ .target = cjsArguments,
.name_loc = logger.Loc.Empty,
},
logger.Loc.Empty,
),
- this_module,
+ this_module, // this.module
p.newExpr(
E.Dot{
- .name = "exports",
- .target = this_module,
+ .name = "__filename",
+ .target = cjsArguments,
.name_loc = logger.Loc.Empty,
},
logger.Loc.Empty,
),
- Expr.joinAllWithComma(&create_require, p.allocator),
p.newExpr(
E.Dot{
.name = "__dirname",
- .target = p.newExpr(E.Identifier{ .ref = cjsGlobal }, logger.Loc.Empty),
- .name_loc = logger.Loc.Empty,
- },
- logger.Loc.Empty,
- ),
- p.newExpr(
- E.Dot{
- .name = "__filename",
- .target = p.newExpr(E.Identifier{ .ref = cjsGlobal }, logger.Loc.Empty),
+ .target = cjsArguments,
.name_loc = logger.Loc.Empty,
},
logger.Loc.Empty,
@@ -20679,14 +21364,50 @@ fn NewParser_(
logger.Loc.Empty,
);
- var only_stmt = try p.allocator.alloc(Stmt, 1);
- only_stmt[0] = p.s(
+ var top_level_stmts = p.allocator.alloc(Stmt, 1 + @as(usize, @intFromBool(p.has_import_meta))) catch unreachable;
+ parts[0].stmts = top_level_stmts;
+
+ // var $Bun_import_meta = this.createImportMeta(this.filename);
+ if (p.has_import_meta) {
+ p.import_meta_ref = p.newSymbol(.other, "$Bun_import_meta") catch unreachable;
+ var decl = allocator.alloc(Decl, 1) catch unreachable;
+ decl[0] = Decl{
+ .binding = Binding.alloc(
+ p.allocator,
+ B.Identifier{
+ .ref = p.import_meta_ref,
+ },
+ logger.Loc.Empty,
+ ),
+ .value = p.newExpr(
+ E.Call{
+ .target = p.newExpr(E.Dot{
+ .target = cjsArguments,
+ .name = "createImportMeta",
+ .name_loc = logger.Loc.Empty,
+ }, logger.Loc.Empty),
+ // reuse the `this.__filename` argument
+ .args = ExprNodeList.init(call_args[5..6]),
+ },
+ logger.Loc.Empty,
+ ),
+ };
+
+ top_level_stmts[0] = p.s(
+ S.Local{
+ .decls = G.Decl.List.init(decl),
+ .kind = .k_var,
+ },
+ logger.Loc.Empty,
+ );
+ top_level_stmts = top_level_stmts[1..];
+ }
+ top_level_stmts[0] = p.s(
S.SExpr{
.value = call,
},
logger.Loc.Empty,
);
- parts[0].stmts = only_stmt;
parts.len = 1;
},
@@ -21217,6 +21938,8 @@ fn NewParser_(
// TODO:
// .const_values = p.const_values,
+
+ .import_meta_ref = p.import_meta_ref,
};
}
diff --git a/src/js_printer.zig b/src/js_printer.zig
index 57ef580b6..d81499a36 100644
--- a/src/js_printer.zig
+++ b/src/js_printer.zig
@@ -482,6 +482,7 @@ pub const Options = struct {
to_commonjs_ref: Ref = Ref.None,
to_esm_ref: Ref = Ref.None,
require_ref: ?Ref = null,
+ import_meta_ref: Ref = Ref.None,
indent: usize = 0,
externals: []u32 = &[_]u32{},
runtime_imports: runtime.Runtime.Imports = runtime.Runtime.Imports{},
@@ -2051,7 +2052,20 @@ fn NewPrinter(
.e_import_meta => {
p.printSpaceBeforeIdentifier();
p.addSourceMapping(expr.loc);
- p.print("import.meta");
+ if (!p.options.import_meta_ref.isValid()) {
+ // Most of the time, leave it in there
+ p.print("import.meta");
+ } else {
+ // Note: The bundler will not hit this code path. The bundler will replace
+ // the ImportMeta AST node with a regular Identifier AST node.
+ //
+ // This is currently only used in Bun's runtime for CommonJS modules
+ // referencing import.meta
+ if (comptime Environment.allow_assert)
+ std.debug.assert(p.options.module_type == .cjs);
+
+ p.printSymbol(p.options.import_meta_ref);
+ }
},
.e_commonjs_export_identifier => |id| {
p.printSpaceBeforeIdentifier();
@@ -2179,6 +2193,7 @@ fn NewPrinter(
}
},
.e_require_call_target => {
+ p.printSpaceBeforeIdentifier();
p.addSourceMapping(expr.loc);
if (p.options.module_type == .cjs or !is_bun_platform) {
@@ -2188,6 +2203,7 @@ fn NewPrinter(
}
},
.e_require_resolve_call_target => {
+ p.printSpaceBeforeIdentifier();
p.addSourceMapping(expr.loc);
if (p.options.module_type == .cjs or !is_bun_platform) {
@@ -2656,7 +2672,7 @@ fn NewPrinter(
.e_number => |e| {
const value = e.value;
- const absValue = @fabs(value);
+ const absValue = @abs(value);
if (std.math.isNan(value)) {
p.printSpaceBeforeIdentifier();
@@ -3180,10 +3196,26 @@ fn NewPrinter(
hex_chars[cursor.c & 15],
});
},
- else => {
- p.print("\\u{");
- std.fmt.formatInt(cursor.c, 16, .lower, .{}, p) catch unreachable;
- p.print("}");
+
+ else => |c| {
+ const k = c - 0x10000;
+ const lo = @as(usize, @intCast(first_high_surrogate + ((k >> 10) & 0x3FF)));
+ const hi = @as(usize, @intCast(first_low_surrogate + (k & 0x3FF)));
+
+ p.print(&[_]u8{
+ '\\',
+ 'u',
+ hex_chars[lo >> 12],
+ hex_chars[(lo >> 8) & 15],
+ hex_chars[(lo >> 4) & 15],
+ hex_chars[lo & 15],
+ '\\',
+ 'u',
+ hex_chars[hi >> 12],
+ hex_chars[(hi >> 8) & 15],
+ hex_chars[(hi >> 4) & 15],
+ hex_chars[hi & 15],
+ });
},
}
},
diff --git a/src/jsc.zig b/src/jsc.zig
index e5be26321..5cdf739b3 100644
--- a/src/jsc.zig
+++ b/src/jsc.zig
@@ -38,6 +38,7 @@ pub const API = struct {
pub const HTTPSServer = @import("./bun.js/api/server.zig").HTTPSServer;
pub const DebugHTTPServer = @import("./bun.js/api/server.zig").DebugHTTPServer;
pub const DebugHTTPSServer = @import("./bun.js/api/server.zig").DebugHTTPSServer;
+ pub const AnyRequestContext = @import("./bun.js/api/server.zig").AnyRequestContext;
pub const Bun = @import("./bun.js/api/bun.zig");
pub const FileSystemRouter = @import("./bun.js/api/filesystem_router.zig").FileSystemRouter;
pub const MatchedRoute = @import("./bun.js/api/filesystem_router.zig").MatchedRoute;
diff --git a/src/libarchive/libarchive.zig b/src/libarchive/libarchive.zig
index c6276b1cc..ff514d72d 100644
--- a/src/libarchive/libarchive.zig
+++ b/src/libarchive/libarchive.zig
@@ -543,13 +543,13 @@ pub const Archive = struct {
if (comptime Environment.isWindows) {
std.os.mkdirat(dir_fd, pathname, @as(u32, @intCast(mode))) catch |err| {
if (err == error.PathAlreadyExists or err == error.NotDir) break;
- try dir.makePath(std.fs.path.dirname(slice) orelse return err);
+ try bun.makePath(dir, std.fs.path.dirname(slice) orelse return err);
try std.os.mkdirat(dir_fd, pathname, 0o777);
};
} else {
std.os.mkdiratZ(dir_fd, pathname, @as(u32, @intCast(mode))) catch |err| {
if (err == error.PathAlreadyExists or err == error.NotDir) break;
- try dir.makePath(std.fs.path.dirname(slice) orelse return err);
+ try bun.makePath(dir, std.fs.path.dirname(slice) orelse return err);
try std.os.mkdiratZ(dir_fd, pathname, 0o777);
};
}
diff --git a/src/logger.zig b/src/logger.zig
index dfe60e2af..c7846ab62 100644
--- a/src/logger.zig
+++ b/src/logger.zig
@@ -662,11 +662,11 @@ pub const Log = struct {
}
pub const Level = enum(i8) {
- verbose,
- debug,
- info,
- warn,
- err,
+ verbose, // 0
+ debug, // 1
+ info, // 2
+ warn, // 3
+ err, // 4
pub fn atLeast(this: Level, other: Level) bool {
return @intFromEnum(this) <= @intFromEnum(other);
@@ -703,7 +703,19 @@ pub const Log = struct {
};
}
+ pub fn addDebugFmt(log: *Log, source: ?*const Source, l: Loc, allocator: std.mem.Allocator, comptime text: string, args: anytype) !void {
+ if (!Kind.shouldPrint(.debug, log.level)) return;
+
+ @setCold(true);
+ try log.addMsg(.{
+ .kind = .debug,
+ .data = try rangeData(source, Range{ .loc = l }, allocPrint(allocator, text, args) catch unreachable).cloneLineText(log.clone_line_text, log.msgs.allocator),
+ });
+ }
+
pub fn addVerbose(log: *Log, source: ?*const Source, loc: Loc, text: string) !void {
+ if (!Kind.shouldPrint(.verbose, log.level)) return;
+
@setCold(true);
try log.addMsg(.{
.kind = .verbose,
@@ -1096,6 +1108,31 @@ pub const Log = struct {
});
}
+ pub fn addRangeErrorFmtWithNote(
+ log: *Log,
+ source: ?*const Source,
+ r: Range,
+ allocator: std.mem.Allocator,
+ comptime fmt: string,
+ args: anytype,
+ comptime note_fmt: string,
+ note_args: anytype,
+ note_range: Range,
+ ) !void {
+ @setCold(true);
+ if (!Kind.shouldPrint(.err, log.level)) return;
+ log.errors += 1;
+
+ var notes = try allocator.alloc(Data, 1);
+ notes[0] = rangeData(source, note_range, allocPrint(allocator, note_fmt, note_args) catch unreachable);
+
+ try log.addMsg(.{
+ .kind = .err,
+ .data = rangeData(source, r, allocPrint(allocator, fmt, args) catch unreachable),
+ .notes = notes,
+ });
+ }
+
pub fn addWarning(log: *Log, source: ?*const Source, l: Loc, text: string) !void {
@setCold(true);
if (!Kind.shouldPrint(.warn, log.level)) return;
diff --git a/src/main.zig b/src/main.zig
index 52cf33d53..ee8b0fb47 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -10,6 +10,7 @@ pub fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace, addr
}
const CrashReporter = @import("./crash_reporter.zig");
+extern fn bun_warn_avx_missing(url: [*:0]const u8) void;
pub fn main() void {
const bun = @import("root").bun;
@@ -24,25 +25,19 @@ pub fn main() void {
bun.start_time = std.time.nanoTimestamp();
- // The memory allocator makes a massive difference.
- // std.heap.raw_c_allocator and default_allocator perform similarly.
- // std.heap.GeneralPurposeAllocator makes this about 3x _slower_ than esbuild.
- // var root_alloc = @import("root").bun.ArenaAllocator.init(std.heap.raw_c_allocator);
- // var root_alloc_ = &root_alloc.allocator;
-
var stdout = std.io.getStdOut();
- // var stdout = std.io.bufferedWriter(stdout_file.writer());
var stderr = std.io.getStdErr();
var output_source = Output.Source.init(stdout, stderr);
Output.Source.set(&output_source);
defer Output.flush();
+ if (comptime Environment.isX64) {
+ if (comptime Environment.enableSIMD) {
+ bun_warn_avx_missing(@import("./cli/upgrade_command.zig").Version.Bun__githubBaselineURL.ptr);
+ }
+ }
bun.CLI.Cli.start(bun.default_allocator, stdout, stderr, MainPanicHandler);
}
-test "panic" {
- panic("woah", null);
-}
-
pub const build_options = @import("build_options");
diff --git a/src/multi_array_list.zig b/src/multi_array_list.zig
index 96bd17819..cd8002823 100644
--- a/src/multi_array_list.zig
+++ b/src/multi_array_list.zig
@@ -1,5 +1,3 @@
-// This fork adds a zero() function
-
const std = @import("std");
const builtin = @import("builtin");
const assert = std.debug.assert;
@@ -8,24 +6,57 @@ const mem = std.mem;
const Allocator = mem.Allocator;
const testing = std.testing;
-/// A MultiArrayList stores a list of a struct type.
+/// A MultiArrayList stores a list of a struct or tagged union type.
/// Instead of storing a single list of items, MultiArrayList
-/// stores separate lists for each field of the struct.
-/// This allows for memory savings if the struct has padding,
-/// and also improves cache usage if only some fields are needed
-/// for a computation. The primary API for accessing fields is
+/// stores separate lists for each field of the struct or
+/// lists of tags and bare unions.
+/// This allows for memory savings if the struct or union has padding,
+/// and also improves cache usage if only some fields or just tags
+/// are needed for a computation. The primary API for accessing fields is
/// the `slice()` function, which computes the start pointers
/// for the array of each field. From the slice you can call
/// `.items(.<field_name>)` to obtain a slice of field values.
-pub fn MultiArrayList(comptime S: type) type {
+/// For unions you can call `.items(.tags)` or `.items(.data)`.
+pub fn MultiArrayList(comptime T: type) type {
return struct {
- bytes: [*]align(@alignOf(S)) u8 = undefined,
+ bytes: [*]align(@alignOf(T)) u8 = undefined,
len: usize = 0,
capacity: usize = 0,
- pub const Elem = S;
+ pub const Elem = switch (@typeInfo(T)) {
+ .Struct => T,
+ .Union => |u| struct {
+ pub const Bare =
+ @Type(.{ .Union = .{
+ .layout = u.layout,
+ .tag_type = null,
+ .fields = u.fields,
+ .decls = &.{},
+ } });
+ pub const Tag =
+ u.tag_type orelse @compileError("MultiArrayList does not support untagged unions");
+ tags: Tag,
+ data: Bare,
+
+ pub fn fromT(outer: T) @This() {
+ const tag = meta.activeTag(outer);
+ return .{
+ .tags = tag,
+ .data = switch (tag) {
+ inline else => |t| @unionInit(Bare, @tagName(t), @field(outer, @tagName(t))),
+ },
+ };
+ }
+ pub fn toT(tag: Tag, bare: Bare) T {
+ return switch (tag) {
+ inline else => |t| @unionInit(T, @tagName(t), @field(bare, @tagName(t))),
+ };
+ }
+ },
+ else => @compileError("MultiArrayList only supports structs and tagged unions"),
+ };
- pub const Field = meta.FieldEnum(S);
+ pub const Field = meta.FieldEnum(Elem);
/// A MultiArrayList.Slice contains cached start pointers for each field in the list.
/// These pointers are not normally stored to reduce the size of the list in memory.
@@ -47,18 +78,41 @@ pub fn MultiArrayList(comptime S: type) type {
const casted_ptr: [*]F = if (@sizeOf(F) == 0)
undefined
else
- @as([*]F, @ptrCast(@alignCast(byte_ptr)));
+ @ptrCast(@alignCast(byte_ptr));
return casted_ptr[0..self.len];
}
+ pub fn set(self: *Slice, index: usize, elem: T) void {
+ const e = switch (@typeInfo(T)) {
+ .Struct => elem,
+ .Union => Elem.fromT(elem),
+ else => unreachable,
+ };
+ inline for (fields, 0..) |field_info, i| {
+ self.items(@as(Field, @enumFromInt(i)))[index] = @field(e, field_info.name);
+ }
+ }
+
+ pub fn get(self: Slice, index: usize) T {
+ var result: Elem = undefined;
+ inline for (fields, 0..) |field_info, i| {
+ @field(result, field_info.name) = self.items(@as(Field, @enumFromInt(i)))[index];
+ }
+ return switch (@typeInfo(T)) {
+ .Struct => result,
+ .Union => Elem.toT(result.tags, result.data),
+ else => unreachable,
+ };
+ }
+
pub fn toMultiArrayList(self: Slice) Self {
if (self.ptrs.len == 0) {
return .{};
}
const unaligned_ptr = self.ptrs[sizes.fields[0]];
- const casted_ptr: [*]align(@alignOf(S)) u8 = @ptrCast(@alignCast(unaligned_ptr));
+ const aligned_ptr: [*]align(@alignOf(Elem)) u8 = @alignCast(unaligned_ptr);
return .{
- .bytes = casted_ptr,
+ .bytes = aligned_ptr,
.len = self.len,
.capacity = self.capacity,
};
@@ -69,12 +123,21 @@ pub fn MultiArrayList(comptime S: type) type {
other.deinit(gpa);
self.* = undefined;
}
+
+ /// This function is used in the debugger pretty formatters in tools/ to fetch the
+ /// child field order and entry type to facilitate fancy debug printing for this type.
+ fn dbHelper(self: *Slice, child: *Elem, field: *Field, entry: *Entry) void {
+ _ = self;
+ _ = child;
+ _ = field;
+ _ = entry;
+ }
};
const Self = @This();
- const fields = meta.fields(S);
- /// `sizes.bytes` is an array of @sizeOf each S field. Sorted by alignment, descending.
+ const fields = meta.fields(Elem);
+ /// `sizes.bytes` is an array of @sizeOf each T field. Sorted by alignment, descending.
/// `sizes.fields` is an array mapping from `sizes.bytes` array index to field index.
const sizes = blk: {
const Data = struct {
@@ -96,7 +159,7 @@ pub fn MultiArrayList(comptime S: type) type {
return lhs.alignment > rhs.alignment;
}
};
- std.sort.block(Data, &data, {}, Sort.lessThan);
+ mem.sort(Data, &data, {}, Sort.lessThan);
var sizes_bytes: [fields.len]usize = undefined;
var field_indexes: [fields.len]usize = undefined;
for (data, 0..) |elem, i| {
@@ -132,8 +195,8 @@ pub fn MultiArrayList(comptime S: type) type {
.capacity = self.capacity,
};
var ptr: [*]u8 = self.bytes;
- for (sizes.bytes, 0..) |field_size, i| {
- result.ptrs[sizes.fields[i]] = ptr;
+ for (sizes.bytes, sizes.fields) |field_size, i| {
+ result.ptrs[i] = ptr;
ptr += field_size * self.capacity;
}
return result;
@@ -147,32 +210,25 @@ pub fn MultiArrayList(comptime S: type) type {
}
/// Overwrite one array element with new data.
- pub fn set(self: *Self, index: usize, elem: S) void {
- const slices = self.slice();
- inline for (fields, 0..) |field_info, i| {
- slices.items(@as(Field, @enumFromInt(i)))[index] = @field(elem, field_info.name);
- }
+ pub fn set(self: *Self, index: usize, elem: T) void {
+ var slices = self.slice();
+ slices.set(index, elem);
}
/// Obtain all the data for one array element.
- pub fn get(self: Self, index: usize) S {
- const slices = self.slice();
- var result: S = undefined;
- inline for (fields, 0..) |field_info, i| {
- @field(result, field_info.name) = slices.items(@as(Field, @enumFromInt(i)))[index];
- }
- return result;
+ pub fn get(self: Self, index: usize) T {
+ return self.slice().get(index);
}
/// Extend the list by 1 element. Allocates more memory as necessary.
- pub fn append(self: *Self, gpa: Allocator, elem: S) !void {
+ pub fn append(self: *Self, gpa: Allocator, elem: T) !void {
try self.ensureUnusedCapacity(gpa, 1);
self.appendAssumeCapacity(elem);
}
/// Extend the list by 1 element, but asserting `self.capacity`
/// is sufficient to hold an additional item.
- pub fn appendAssumeCapacity(self: *Self, elem: S) void {
+ pub fn appendAssumeCapacity(self: *Self, elem: T) void {
assert(self.len < self.capacity);
self.len += 1;
self.set(self.len - 1, elem);
@@ -199,7 +255,7 @@ pub fn MultiArrayList(comptime S: type) type {
/// Remove and return the last element from the list.
/// Asserts the list has at least one item.
/// Invalidates pointers to fields of the removed element.
- pub fn pop(self: *Self) S {
+ pub fn pop(self: *Self) T {
const val = self.get(self.len - 1);
self.len -= 1;
return val;
@@ -208,7 +264,7 @@ pub fn MultiArrayList(comptime S: type) type {
/// Remove and return the last element from the list, or
/// return `null` if list is empty.
/// Invalidates pointers to fields of the removed element, if any.
- pub fn popOrNull(self: *Self) ?S {
+ pub fn popOrNull(self: *Self) ?T {
if (self.len == 0) return null;
return self.pop();
}
@@ -217,19 +273,28 @@ pub fn MultiArrayList(comptime S: type) type {
/// after and including the specified index back by one and
/// sets the given index to the specified element. May reallocate
/// and invalidate iterators.
- pub fn insert(self: *Self, gpa: Allocator, index: usize, elem: S) !void {
+ pub fn insert(self: *Self, gpa: Allocator, index: usize, elem: T) !void {
try self.ensureUnusedCapacity(gpa, 1);
self.insertAssumeCapacity(index, elem);
}
+ pub fn clearRetainingCapacity(this: *Self) void {
+ this.len = 0;
+ }
+
/// Inserts an item into an ordered list which has room for it.
/// Shifts all elements after and including the specified index
/// back by one and sets the given index to the specified element.
/// Will not reallocate the array, does not invalidate iterators.
- pub fn insertAssumeCapacity(self: *Self, index: usize, elem: S) void {
+ pub fn insertAssumeCapacity(self: *Self, index: usize, elem: T) void {
assert(self.len < self.capacity);
assert(index <= self.len);
self.len += 1;
+ const entry = switch (@typeInfo(T)) {
+ .Struct => elem,
+ .Union => Elem.fromT(elem),
+ else => unreachable,
+ };
const slices = self.slice();
inline for (fields, 0..) |field_info, field_index| {
const field_slice = slices.items(@as(Field, @enumFromInt(field_index)));
@@ -237,7 +302,20 @@ pub fn MultiArrayList(comptime S: type) type {
while (i > index) : (i -= 1) {
field_slice[i] = field_slice[i - 1];
}
- field_slice[index] = @field(elem, field_info.name);
+ field_slice[index] = @field(entry, field_info.name);
+ }
+ }
+
+ pub fn appendListAssumeCapacity(this: *Self, other: Self) void {
+ const offset = this.len;
+ this.len += other.len;
+ const other_slice = other.slice();
+ const this_slice = this.slice();
+ inline for (fields, 0..) |field_info, i| {
+ if (@sizeOf(field_info.type) != 0) {
+ const field = @as(Field, @enumFromInt(i));
+ @memcpy(this_slice.items(field)[offset..], other_slice.items(field));
+ }
}
}
@@ -290,7 +368,7 @@ pub fn MultiArrayList(comptime S: type) type {
const other_bytes = gpa.alignedAlloc(
u8,
- @alignOf(S),
+ @alignOf(Elem),
capacityInBytes(new_len),
) catch {
const self_slice = self.slice();
@@ -318,7 +396,7 @@ pub fn MultiArrayList(comptime S: type) type {
inline for (fields, 0..) |field_info, i| {
if (@sizeOf(field_info.type) != 0) {
const field = @as(Field, @enumFromInt(i));
- mem.copy(field_info.type, other_slice.items(field), self_slice.items(field));
+ @memcpy(other_slice.items(field), self_slice.items(field));
}
}
gpa.free(self.allocatedBytes());
@@ -360,7 +438,7 @@ pub fn MultiArrayList(comptime S: type) type {
assert(new_capacity >= self.len);
const new_bytes = try gpa.alignedAlloc(
u8,
- @alignOf(S),
+ @alignOf(Elem),
capacityInBytes(new_capacity),
);
if (self.len == 0) {
@@ -379,7 +457,7 @@ pub fn MultiArrayList(comptime S: type) type {
inline for (fields, 0..) |field_info, i| {
if (@sizeOf(field_info.type) != 0) {
const field = @as(Field, @enumFromInt(i));
- mem.copy(field_info.type, other_slice.items(field), self_slice.items(field));
+ @memcpy(other_slice.items(field), self_slice.items(field));
}
}
gpa.free(self.allocatedBytes());
@@ -391,27 +469,23 @@ pub fn MultiArrayList(comptime S: type) type {
pub fn clone(self: Self, gpa: Allocator) !Self {
var result = Self{};
errdefer result.deinit(gpa);
- try result.setCapacity(gpa, self.len);
+ try result.ensureTotalCapacity(gpa, self.len);
result.len = self.len;
const self_slice = self.slice();
const result_slice = result.slice();
inline for (fields, 0..) |field_info, i| {
if (@sizeOf(field_info.type) != 0) {
const field = @as(Field, @enumFromInt(i));
- mem.copy(field_info.type, result_slice.items(field), self_slice.items(field));
+ @memcpy(result_slice.items(field), self_slice.items(field));
}
}
return result;
}
- pub fn clearRetainingCapacity(this: *Self) void {
- this.len = 0;
- }
-
/// `ctx` has the following method:
/// `fn lessThan(ctx: @TypeOf(ctx), a_index: usize, b_index: usize) bool`
- pub fn sort(self: Self, ctx: anytype) void {
- const SortContext = struct {
+ fn sortInternal(self: Self, a: usize, b: usize, ctx: anytype, comptime mode: enum { stable, unstable }) void {
+ const sort_context: struct {
sub_ctx: @TypeOf(ctx),
slice: Slice,
@@ -428,69 +502,102 @@ pub fn MultiArrayList(comptime S: type) type {
pub fn lessThan(sc: @This(), a_index: usize, b_index: usize) bool {
return sc.sub_ctx.lessThan(a_index, b_index);
}
- };
-
- std.sort.blockContext(0, self.len, SortContext{
+ } = .{
.sub_ctx = ctx,
.slice = self.slice(),
- });
- }
+ };
- fn capacityInBytes(capacity: usize) usize {
- if (builtin.zig_backend == .stage2_c) {
- var bytes: usize = 0;
- for (sizes.bytes) |size| bytes += size * capacity;
- return bytes;
- } else {
- const sizes_vector: @Vector(sizes.bytes.len, usize) = sizes.bytes;
- const capacity_vector: @Vector(sizes.bytes.len, usize) = @splat(capacity);
- return @reduce(.Add, capacity_vector * sizes_vector);
+ switch (mode) {
+ .stable => mem.sortContext(a, b, sort_context),
+ .unstable => mem.sortUnstableContext(a, b, sort_context),
}
}
- pub fn appendListAssumeCapacity(this: *Self, other: Self) void {
- const offset = this.len;
- this.len += other.len;
- const other_slice = other.slice();
- const this_slice = this.slice();
- inline for (fields, 0..) |field_info, i| {
- if (@sizeOf(field_info.type) != 0) {
- const field = @as(Field, @enumFromInt(i));
- mem.copy(field_info.type, this_slice.items(field)[offset..], other_slice.items(field));
- }
- }
+ /// This function guarantees a stable sort, i.e the relative order of equal elements is preserved during sorting.
+ /// Read more about stable sorting here: https://en.wikipedia.org/wiki/Sorting_algorithm#Stability
+ /// If this guarantee does not matter, `sortUnstable` might be a faster alternative.
+ /// `ctx` has the following method:
+ /// `fn lessThan(ctx: @TypeOf(ctx), a_index: usize, b_index: usize) bool`
+ pub fn sort(self: Self, ctx: anytype) void {
+ self.sortInternal(0, self.len, ctx, .stable);
}
- pub fn appendList(this: *Self, allocator: std.mem.Allocator, other: Self) !void {
- try this.ensureUnusedCapacity(allocator, other.len);
- this.appendListAssumeCapacity(other);
+ /// Sorts only the subsection of items between indices `a` and `b` (excluding `b`)
+ /// This function guarantees a stable sort, i.e the relative order of equal elements is preserved during sorting.
+ /// Read more about stable sorting here: https://en.wikipedia.org/wiki/Sorting_algorithm#Stability
+ /// If this guarantee does not matter, `sortSpanUnstable` might be a faster alternative.
+ /// `ctx` has the following method:
+ /// `fn lessThan(ctx: @TypeOf(ctx), a_index: usize, b_index: usize) bool`
+ pub fn sortSpan(self: Self, a: usize, b: usize, ctx: anytype) void {
+ self.sortInternal(a, b, ctx, .stable);
+ }
+
+ /// This function does NOT guarantee a stable sort, i.e the relative order of equal elements may change during sorting.
+ /// Due to the weaker guarantees of this function, this may be faster than the stable `sort` method.
+ /// Read more about stable sorting here: https://en.wikipedia.org/wiki/Sorting_algorithm#Stability
+ /// `ctx` has the following method:
+ /// `fn lessThan(ctx: @TypeOf(ctx), a_index: usize, b_index: usize) bool`
+ pub fn sortUnstable(self: Self, ctx: anytype) void {
+ self.sortInternal(0, self.len, ctx, .unstable);
+ }
+
+ /// Sorts only the subsection of items between indices `a` and `b` (excluding `b`)
+ /// This function does NOT guarantee a stable sort, i.e the relative order of equal elements may change during sorting.
+ /// Due to the weaker guarantees of this function, this may be faster than the stable `sortSpan` method.
+ /// Read more about stable sorting here: https://en.wikipedia.org/wiki/Sorting_algorithm#Stability
+ /// `ctx` has the following method:
+ /// `fn lessThan(ctx: @TypeOf(ctx), a_index: usize, b_index: usize) bool`
+ pub fn sortSpanUnstable(self: Self, a: usize, b: usize, ctx: anytype) void {
+ self.sortInternal(a, b, ctx, .unstable);
}
- fn allocatedBytes(self: Self) []align(@alignOf(S)) u8 {
+ fn capacityInBytes(capacity: usize) usize {
+ comptime var elem_bytes: usize = 0;
+ inline for (sizes.bytes) |size| elem_bytes += size;
+ return elem_bytes * capacity;
+ }
+
+ fn allocatedBytes(self: Self) []align(@alignOf(Elem)) u8 {
return self.bytes[0..capacityInBytes(self.capacity)];
}
- pub fn zero(this: *Self) void {
- var allocated = this.allocatedBytes();
- if (allocated.len > 0) {
- @memset(allocated, 0);
- }
+ pub fn zero(self: Self) void {
+ @memset(self.allocatedBytes(), 0);
}
fn FieldType(comptime field: Field) type {
- return meta.fieldInfo(S, field).type;
+ return meta.fieldInfo(Elem, field).type;
}
- /// This function is used in tools/zig-gdb.py to fetch the child type to facilitate
- /// fancy debug printing for this type.
- fn gdbHelper(self: *Self, child: *S) void {
+ const Entry = entry: {
+ var entry_fields: [fields.len]std.builtin.Type.StructField = undefined;
+ for (&entry_fields, sizes.fields) |*entry_field, i| entry_field.* = .{
+ .name = fields[i].name ++ "_ptr",
+ .type = *fields[i].type,
+ .default_value = null,
+ .is_comptime = fields[i].is_comptime,
+ .alignment = fields[i].alignment,
+ };
+ break :entry @Type(.{ .Struct = .{
+ .layout = .Extern,
+ .fields = &entry_fields,
+ .decls = &.{},
+ .is_tuple = false,
+ } });
+ };
+ /// This function is used in the debugger pretty formatters in tools/ to fetch the
+ /// child field order and entry type to facilitate fancy debug printing for this type.
+ fn dbHelper(self: *Self, child: *Elem, field: *Field, entry: *Entry) void {
_ = self;
_ = child;
+ _ = field;
+ _ = entry;
}
comptime {
if (builtin.mode == .Debug) {
- _ = gdbHelper;
+ _ = &dbHelper;
+ _ = &Slice.dbHelper;
}
}
};
@@ -720,3 +827,98 @@ test "insert elements" {
try testing.expectEqualSlices(u8, &[_]u8{ 1, 2 }, list.items(.a));
try testing.expectEqualSlices(u32, &[_]u32{ 2, 3 }, list.items(.b));
}
+
+test "union" {
+ const ally = testing.allocator;
+
+ const Foo = union(enum) {
+ a: u32,
+ b: []const u8,
+ };
+
+ var list = MultiArrayList(Foo){};
+ defer list.deinit(ally);
+
+ try testing.expectEqual(@as(usize, 0), list.items(.tags).len);
+
+ try list.ensureTotalCapacity(ally, 2);
+
+ list.appendAssumeCapacity(.{ .a = 1 });
+ list.appendAssumeCapacity(.{ .b = "zigzag" });
+
+ try testing.expectEqualSlices(meta.Tag(Foo), list.items(.tags), &.{ .a, .b });
+ try testing.expectEqual(@as(usize, 2), list.items(.tags).len);
+
+ list.appendAssumeCapacity(.{ .b = "foobar" });
+ try testing.expectEqualStrings("zigzag", list.items(.data)[1].b);
+ try testing.expectEqualStrings("foobar", list.items(.data)[2].b);
+
+ // Add 6 more things to force a capacity increase.
+ for (0..6) |i| {
+ try list.append(ally, .{ .a = @as(u32, @intCast(4 + i)) });
+ }
+
+ try testing.expectEqualSlices(
+ meta.Tag(Foo),
+ &.{ .a, .b, .b, .a, .a, .a, .a, .a, .a },
+ list.items(.tags),
+ );
+ try testing.expectEqual(list.get(0), .{ .a = 1 });
+ try testing.expectEqual(list.get(1), .{ .b = "zigzag" });
+ try testing.expectEqual(list.get(2), .{ .b = "foobar" });
+ try testing.expectEqual(list.get(3), .{ .a = 4 });
+ try testing.expectEqual(list.get(4), .{ .a = 5 });
+ try testing.expectEqual(list.get(5), .{ .a = 6 });
+ try testing.expectEqual(list.get(6), .{ .a = 7 });
+ try testing.expectEqual(list.get(7), .{ .a = 8 });
+ try testing.expectEqual(list.get(8), .{ .a = 9 });
+
+ list.shrinkAndFree(ally, 3);
+
+ try testing.expectEqual(@as(usize, 3), list.items(.tags).len);
+ try testing.expectEqualSlices(meta.Tag(Foo), list.items(.tags), &.{ .a, .b, .b });
+
+ try testing.expectEqual(list.get(0), .{ .a = 1 });
+ try testing.expectEqual(list.get(1), .{ .b = "zigzag" });
+ try testing.expectEqual(list.get(2), .{ .b = "foobar" });
+}
+
+test "sorting a span" {
+ var list: MultiArrayList(struct { score: u32, chr: u8 }) = .{};
+ defer list.deinit(testing.allocator);
+
+ try list.ensureTotalCapacity(testing.allocator, 42);
+ for (
+ // zig fmt: off
+ [42]u8{ 'b', 'a', 'c', 'a', 'b', 'c', 'b', 'c', 'b', 'a', 'b', 'a', 'b', 'c', 'b', 'a', 'a', 'c', 'c', 'a', 'c', 'b', 'a', 'c', 'a', 'b', 'b', 'c', 'c', 'b', 'a', 'b', 'a', 'b', 'c', 'b', 'a', 'a', 'c', 'c', 'a', 'c' },
+ [42]u32{ 1, 1, 1, 2, 2, 2, 3, 3, 4, 3, 5, 4, 6, 4, 7, 5, 6, 5, 6, 7, 7, 8, 8, 8, 9, 9, 10, 9, 10, 11, 10, 12, 11, 13, 11, 14, 12, 13, 12, 13, 14, 14 },
+ // zig fmt: on
+ ) |chr, score| {
+ list.appendAssumeCapacity(.{ .chr = chr, .score = score });
+ }
+
+ const sliced = list.slice();
+ list.sortSpan(6, 21, struct {
+ chars: []const u8,
+
+ fn lessThan(ctx: @This(), a: usize, b: usize) bool {
+ return ctx.chars[a] < ctx.chars[b];
+ }
+ }{ .chars = sliced.items(.chr) });
+
+ var i: u32 = undefined;
+ var j: u32 = 6;
+ var c: u8 = 'a';
+
+ while (j < 21) {
+ i = j;
+ j += 5;
+ var n: u32 = 3;
+ for (sliced.items(.chr)[i..j], sliced.items(.score)[i..j]) |chr, score| {
+ try testing.expectEqual(score, n);
+ try testing.expectEqual(chr, c);
+ n += 1;
+ }
+ c += 1;
+ }
+}
diff --git a/src/napi/napi.zig b/src/napi/napi.zig
index d143fe1b3..f747fb785 100644
--- a/src/napi/napi.zig
+++ b/src/napi/napi.zig
@@ -309,28 +309,41 @@ pub extern fn napi_create_error(env: napi_env, code: napi_value, msg: napi_value
pub extern fn napi_create_type_error(env: napi_env, code: napi_value, msg: napi_value, result: *napi_value) napi_status;
pub extern fn napi_create_range_error(env: napi_env, code: napi_value, msg: napi_value, result: *napi_value) napi_status;
pub extern fn napi_typeof(env: napi_env, value: napi_value, result: *napi_valuetype) napi_status;
-pub export fn napi_get_value_double(_: napi_env, value: napi_value, result: *f64) napi_status {
+pub export fn napi_get_value_double(env: napi_env, value: napi_value, result: *f64) napi_status {
log("napi_get_value_double", .{});
- result.* = value.asNumber();
+ if (!value.isNumber()) {
+ return .number_expected;
+ }
+ result.* = value.coerceToDouble(env);
return .ok;
}
pub export fn napi_get_value_int32(_: napi_env, value: napi_value, result: *i32) napi_status {
log("napi_get_value_int32", .{});
+ if (!value.isNumber()) {
+ return .number_expected;
+ }
result.* = value.to(i32);
return .ok;
}
pub export fn napi_get_value_uint32(_: napi_env, value: napi_value, result: *u32) napi_status {
log("napi_get_value_uint32", .{});
+ if (!value.isNumber()) {
+ return .number_expected;
+ }
result.* = value.to(u32);
return .ok;
}
pub export fn napi_get_value_int64(_: napi_env, value: napi_value, result: *i64) napi_status {
log("napi_get_value_int64", .{});
+ if (!value.isNumber()) {
+ return .number_expected;
+ }
result.* = value.to(i64);
return .ok;
}
pub export fn napi_get_value_bool(_: napi_env, value: napi_value, result: *bool) napi_status {
log("napi_get_value_bool", .{});
+
result.* = value.to(bool);
return .ok;
}
@@ -1097,6 +1110,8 @@ pub export fn napi_get_buffer_info(env: napi_env, value: napi_value, data: *[*]u
extern fn node_api_create_syntax_error(napi_env, napi_value, napi_value, *napi_value) napi_status;
extern fn node_api_symbol_for(napi_env, [*]const c_char, usize, *napi_value) napi_status;
extern fn node_api_throw_syntax_error(napi_env, [*]const c_char, [*]const c_char) napi_status;
+extern fn node_api_create_external_string_latin1(napi_env, [*:0]u8, usize, napi_finalize, ?*anyopaque, *JSValue, *bool) napi_status;
+extern fn node_api_create_external_string_utf16(napi_env, [*:0]u16, usize, napi_finalize, ?*anyopaque, *JSValue, *bool) napi_status;
pub export fn napi_create_async_work(
env: napi_env,
@@ -1617,5 +1632,7 @@ pub fn fixDeadCodeElimination() void {
std.mem.doNotOptimizeAway(&node_api_create_syntax_error);
std.mem.doNotOptimizeAway(&node_api_symbol_for);
std.mem.doNotOptimizeAway(&node_api_throw_syntax_error);
+ std.mem.doNotOptimizeAway(&node_api_create_external_string_latin1);
+ std.mem.doNotOptimizeAway(&node_api_create_external_string_utf16);
std.mem.doNotOptimizeAway(&@import("../bun.js/node/buffer.zig").BufferVectorized.fill);
}
diff --git a/src/node-fallbacks/tsconfig.json b/src/node-fallbacks/tsconfig.json
index 1228b6423..7f8fcc61b 100644
--- a/src/node-fallbacks/tsconfig.json
+++ b/src/node-fallbacks/tsconfig.json
@@ -23,6 +23,8 @@
"url": ["node_modules/url"],
"util": ["node_modules/util"],
"zlib": ["node_modules/browserify-zlib"]
- }
+ },
+ "noEmit": true,
+ "allowJs": true
}
}
diff --git a/src/options.zig b/src/options.zig
index 57b39aeaa..80dcc7781 100644
--- a/src/options.zig
+++ b/src/options.zig
@@ -87,7 +87,7 @@ pub const ExternalModules = struct {
};
pub fn isNodeBuiltin(str: string) bool {
- return NodeBuiltinsMap.has(str);
+ return bun.JSC.HardcodedModule.Aliases.has(str, .node);
}
const default_wildcard_patterns = &[_]WildcardPattern{
@@ -1364,6 +1364,7 @@ pub const BundleOptions = struct {
loaders: Loader.HashTable,
resolve_dir: string = "/",
jsx: JSX.Pragma = JSX.Pragma{},
+ emit_decorator_metadata: bool = false,
auto_import_jsx: bool = true,
allow_runtime: bool = true,
@@ -1442,6 +1443,7 @@ pub const BundleOptions = struct {
minify_whitespace: bool = false,
minify_syntax: bool = false,
minify_identifiers: bool = false,
+ dead_code_elimination: bool = true,
code_coverage: bool = false,
debugger: bool = false,
diff --git a/src/report.zig b/src/report.zig
index c78c5cb0d..75c63a7af 100644
--- a/src/report.zig
+++ b/src/report.zig
@@ -247,10 +247,21 @@ pub fn fatal(err_: ?anyerror, msg_: ?string) void {
}
var globalError_ranOnce = false;
+var error_return_trace: ?*std.builtin.StackTrace = null;
export fn Bun__crashReportWrite(ctx: *CrashReportWriter, bytes_ptr: [*]const u8, len: usize) void {
- if (len > 0)
+ if (error_return_trace) |trace| {
+ if (len > 0) {
+ ctx.print("{s}\n{}", .{ bytes_ptr[0..len], trace });
+ } else {
+ ctx.print("{}\n", .{trace});
+ }
+ return;
+ }
+
+ if (len > 0) {
ctx.print("{s}\n", .{bytes_ptr[0..len]});
+ }
}
extern "C" fn Bun__crashReportDumpStackTrace(ctx: *anyopaque) void;
@@ -274,6 +285,10 @@ pub noinline fn handleCrash(signal: i32, addr: usize) void {
.{ @errorName(name), bun.fmt.hexIntUpper(addr) },
);
printMetadata();
+ if (comptime Environment.isDebug) {
+ error_return_trace = @errorReturnTrace();
+ }
+
if (comptime !@import("root").bun.JSC.is_bindgen) {
std.mem.doNotOptimizeAway(&Bun__crashReportWrite);
Bun__crashReportDumpStackTrace(&crash_report_writer);
@@ -290,10 +305,8 @@ pub noinline fn handleCrash(signal: i32, addr: usize) void {
}
crash_report_writer.file = null;
- if (comptime Environment.isDebug) {
- if (@errorReturnTrace()) |stack| {
- std.debug.dumpStackTrace(stack.*);
- }
+ if (error_return_trace) |trace| {
+ std.debug.dumpStackTrace(trace.*);
}
std.c._exit(128 + @as(u8, @truncate(@as(u8, @intCast(@max(signal, 0))))));
@@ -302,11 +315,19 @@ pub noinline fn handleCrash(signal: i32, addr: usize) void {
pub noinline fn globalError(err: anyerror, trace_: @TypeOf(@errorReturnTrace())) noreturn {
@setCold(true);
+ error_return_trace = trace_;
+
if (@atomicRmw(bool, &globalError_ranOnce, .Xchg, true, .Monotonic)) {
Global.exit(1);
}
switch (err) {
+ // error.BrokenPipe => {
+ // if (comptime Environment.isNative) {
+ // // if stdout/stderr was closed, we don't need to print anything
+ // std.c._exit(bun.JSC.getGlobalExitCodeForPipeFailure());
+ // }
+ // },
error.SyntaxError => {
Output.prettyError(
"\n<r><red>SyntaxError<r><d>:<r> An error occurred while parsing code",
diff --git a/src/resolver/data_url.zig b/src/resolver/data_url.zig
index f2a042c4f..771f56ffe 100644
--- a/src/resolver/data_url.zig
+++ b/src/resolver/data_url.zig
@@ -39,18 +39,24 @@ pub const PercentEncoding = struct {
};
}
- /// decode path if it is percent encoded
+ /// decode path if it is percent encoded, returns EncodeError if URL unsafe characters are present and not percent encoded
pub fn decode(allocator: Allocator, path: []const u8) EncodeError!?[]u8 {
+ return _decode(allocator, path, true);
+ }
+
+ /// Replaces percent encoded entities within `path` without throwing an error if other URL unsafe characters are present
+ pub fn decodeUnstrict(allocator: Allocator, path: []const u8) EncodeError!?[]u8 {
+ return _decode(allocator, path, false);
+ }
+
+ fn _decode(allocator: Allocator, path: []const u8, strict: bool) EncodeError!?[]u8 {
var ret: ?[]u8 = null;
errdefer if (ret) |some| allocator.free(some);
var ret_index: usize = 0;
var i: usize = 0;
while (i < path.len) : (i += 1) {
- if (path[i] == '%') {
- if (!isPchar(path[i..])) {
- return error.InvalidCharacter;
- }
+ if (path[i] == '%' and path[i..].len >= 3 and isHex(path[i + 1]) and isHex(path[i + 2])) {
if (ret == null) {
ret = try allocator.alloc(u8, path.len);
bun.copy(u8, ret.?, path[0..i]);
@@ -63,7 +69,7 @@ pub const PercentEncoding = struct {
ret.?[ret_index] = new;
ret_index += 1;
i += 2;
- } else if (path[i] != '/' and !isPchar(path[i..])) {
+ } else if (path[i] != '/' and !isPchar(path[i..]) and strict) {
return error.InvalidCharacter;
} else if (ret != null) {
ret.?[ret_index] = path[i];
@@ -112,7 +118,7 @@ pub const DataURL = struct {
}
pub fn decodeData(url: DataURL, allocator: std.mem.Allocator) ![]u8 {
- const percent_decoded = PercentEncoding.decode(allocator, url.data) catch url.data orelse url.data;
+ const percent_decoded = PercentEncoding.decodeUnstrict(allocator, url.data) catch url.data orelse url.data;
if (url.is_base64) {
const len = bun.base64.decodeLen(percent_decoded);
var buf = try allocator.alloc(u8, len);
diff --git a/src/resolver/resolve_path.zig b/src/resolver/resolve_path.zig
index f74211709..381abc648 100644
--- a/src/resolver/resolve_path.zig
+++ b/src/resolver/resolve_path.zig
@@ -829,7 +829,25 @@ pub fn joinStringBuf(buf: []u8, _parts: anytype, comptime _platform: Platform) [
var written: usize = 0;
const platform = comptime _platform.resolve();
- var temp_buf: [4096]u8 = undefined;
+ var temp_buf_: [4096]u8 = undefined;
+ var temp_buf: []u8 = &temp_buf_;
+ var free_temp_buf = false;
+ defer {
+ if (free_temp_buf) {
+ bun.default_allocator.free(temp_buf);
+ }
+ }
+
+ var count: usize = 0;
+ for (_parts) |part| {
+ count += if (part.len > 0) part.len + 1 else 0;
+ }
+
+ if (count * 2 > temp_buf.len) {
+ temp_buf = bun.default_allocator.alloc(u8, count * 2) catch @panic("Out of memory");
+ free_temp_buf = true;
+ }
+
temp_buf[0] = 0;
for (_parts) |part| {
diff --git a/src/resolver/resolver.zig b/src/resolver/resolver.zig
index fd6ba9d09..4aeda410e 100644
--- a/src/resolver/resolver.zig
+++ b/src/resolver/resolver.zig
@@ -187,6 +187,8 @@ pub const Result = struct {
// This is the "type" field from "package.json"
module_type: options.ModuleType = options.ModuleType.unknown,
+ emit_decorator_metadata: bool = false,
+
debug_meta: ?DebugMeta = null,
dirname_fd: StoredFileDescriptorType = 0,
@@ -539,7 +541,7 @@ pub const Resolver = struct {
pub fn getPackageManager(this: *Resolver) *PackageManager {
return this.package_manager orelse brk: {
- bun.HTTPThead.init() catch unreachable;
+ bun.HTTPThread.init() catch unreachable;
const pm = PackageManager.initWithRuntime(
this.log,
this.opts.install,
@@ -965,6 +967,7 @@ pub const Resolver = struct {
if (dir.enclosing_tsconfig_json) |tsconfig| {
result.jsx = tsconfig.mergeJSX(result.jsx);
+ result.emit_decorator_metadata = result.emit_decorator_metadata or tsconfig.emit_decorator_metadata;
}
// If you use mjs or mts, then you're using esm
@@ -1136,41 +1139,6 @@ pub const Resolver = struct {
return .{ .not_found = {} };
}
- if (strings.hasPrefixComptime(import_path, "file:///")) {
- const path = import_path[7..];
-
- if (r.opts.external.abs_paths.count() > 0 and r.opts.external.abs_paths.contains(path)) {
- // If the string literal in the source text is an absolute path and has
- // been marked as an external module, mark it as *not* an absolute path.
- // That way we preserve the literal text in the output and don't generate
- // a relative path from the output directory to that path.
- if (r.debug_logs) |*debug| {
- debug.addNoteFmt("The path \"{s}\" is marked as external by the user", .{path});
- }
-
- return .{
- .success = Result{
- .path_pair = .{ .primary = Path.init(import_path) },
- .is_external = true,
- },
- };
- }
-
- if (r.loadAsFile(path, r.extension_order)) |file| {
- return .{
- .success = Result{
- .dirname_fd = file.dirname_fd,
- .path_pair = .{ .primary = Path.init(file.path) },
- .diff_case = file.diff_case,
- .file_fd = file.file_fd,
- .jsx = r.opts.jsx,
- },
- };
- }
-
- return .{ .not_found = {} };
- }
-
// Check both relative and package paths for CSS URL tokens, with relative
// paths taking precedence over package paths to match Webpack behavior.
const is_package_path = isPackagePath(import_path);
@@ -1711,7 +1679,7 @@ pub const Resolver = struct {
// check the global cache directory for a package.json file.
var manager = r.getPackageManager();
var dependency_version = Dependency.Version{};
- var dependency_behavior = @as(Dependency.Behavior, @enumFromInt(Dependency.Behavior.normal));
+ var dependency_behavior = Dependency.Behavior.normal;
var string_buf = esm.version;
// const initial_pending_tasks = manager.pending_tasks;
@@ -3887,7 +3855,7 @@ pub const Resolver = struct {
// not sure why this needs cwd but we'll just pass in the dir of the tsconfig...
var abs_path = ResolvePath.joinAbsStringBuf(ts_dir_name, bufs(.tsconfig_path_abs), &[_]string{ ts_dir_name, current.extends }, .auto);
var parent_config_maybe = r.parseTSConfig(abs_path, 0) catch |err| {
- r.log.addWarningFmt(null, logger.Loc.Empty, r.allocator, "{s} loading tsconfig.json extends {}", .{ @errorName(err), strings.QuotedFormatter{
+ r.log.addDebugFmt(null, logger.Loc.Empty, r.allocator, "{s} loading tsconfig.json extends {}", .{ @errorName(err), strings.QuotedFormatter{
.text = abs_path,
} }) catch {};
break;
@@ -3904,6 +3872,7 @@ pub const Resolver = struct {
// starting from the base config (end of the list)
// successively apply the inheritable attributes to the next config
while (parent_configs.popOrNull()) |parent_config| {
+ merged_config.emit_decorator_metadata = merged_config.emit_decorator_metadata or parent_config.emit_decorator_metadata;
if (parent_config.base_url.len > 0) {
merged_config.base_url = parent_config.base_url;
merged_config.base_url_for_paths = parent_config.base_url_for_paths;
diff --git a/src/resolver/tsconfig_json.zig b/src/resolver/tsconfig_json.zig
index 3f7be00ba..ba85fc965 100644
--- a/src/resolver/tsconfig_json.zig
+++ b/src/resolver/tsconfig_json.zig
@@ -56,6 +56,8 @@ pub const TSConfigJSON = struct {
preserve_imports_not_used_as_values: ?bool = false,
+ emit_decorator_metadata: bool = false,
+
pub fn hasBaseURL(tsconfig: *const TSConfigJSON) bool {
return tsconfig.base_url.len > 0;
}
@@ -137,6 +139,13 @@ pub const TSConfigJSON = struct {
}
}
+ // Parse "emitDecoratorMetadata"
+ if (compiler_opts.expr.asProperty("emitDecoratorMetadata")) |emit_decorator_metadata_prop| {
+ if (emit_decorator_metadata_prop.expr.asBool()) |val| {
+ result.emit_decorator_metadata = val;
+ }
+ }
+
// Parse "jsxFactory"
if (compiler_opts.expr.asProperty("jsxFactory")) |jsx_prop| {
if (jsx_prop.expr.asString(allocator)) |str| {
diff --git a/src/runtime.footer.bun.js b/src/runtime.footer.bun.js
index fdf7cdefa..810525af7 100644
--- a/src/runtime.footer.bun.js
+++ b/src/runtime.footer.bun.js
@@ -11,8 +11,9 @@ export var regeneratorRuntime = BUN_RUNTIME.regeneratorRuntime;
export var __exportValue = BUN_RUNTIME.__exportValue;
export var __exportDefault = BUN_RUNTIME.__exportDefault;
export var __merge = BUN_RUNTIME.__merge;
-export var __decorateClass = BUN_RUNTIME.__decorateClass;
-export var __decorateParam = BUN_RUNTIME.__decorateParam;
+export var __legacyDecorateClassTS = BUN_RUNTIME.__legacyDecorateClassTS;
+export var __legacyDecorateParamTS = BUN_RUNTIME.__legacyDecorateParamTS;
+export var __legacyMetadataTS = BUN_RUNTIME.__legacyMetadataTS;
export var $$bun_runtime_json_parse = JSON.parse;
export var __internalIsCommonJSNamespace = BUN_RUNTIME.__internalIsCommonJSNamespace;
export var $$typeof = BUN_RUNTIME.$$typeof;
diff --git a/src/runtime.footer.js b/src/runtime.footer.js
index ceeab055d..48c86f47b 100644
--- a/src/runtime.footer.js
+++ b/src/runtime.footer.js
@@ -18,8 +18,9 @@ export var regeneratorRuntime = BUN_RUNTIME.regeneratorRuntime;
export var __exportValue = BUN_RUNTIME.__exportValue;
export var __exportDefault = BUN_RUNTIME.__exportDefault;
export var __merge = BUN_RUNTIME.__merge;
-export var __decorateClass = BUN_RUNTIME.__decorateClass;
-export var __decorateParam = BUN_RUNTIME.__decorateParam;
+export var __legacyDecorateClassTS = BUN_RUNTIME.__legacyDecorateClassTS;
+export var __legacyDecorateParamTS = BUN_RUNTIME.__legacyDecorateParamTS;
+export var __legacyMetadataTS = BUN_RUNTIME.__legacyMetadataTS;
export var $$bun_runtime_json_parse = JSON.parse;
export var __internalIsCommonJSNamespace = BUN_RUNTIME.__internalIsCommonJSNamespace;
diff --git a/src/runtime.footer.node.js b/src/runtime.footer.node.js
index ef28d3b31..4318195c5 100644
--- a/src/runtime.footer.node.js
+++ b/src/runtime.footer.node.js
@@ -12,8 +12,9 @@ export var __cJS2eSM = BUN_RUNTIME.__cJS2eSM;
export var regeneratorRuntime = BUN_RUNTIME.regeneratorRuntime;
export var __exportValue = BUN_RUNTIME.__exportValue;
export var __exportDefault = BUN_RUNTIME.__exportDefault;
-export var __decorateClass = BUN_RUNTIME.__decorateClass;
-export var __decorateParam = BUN_RUNTIME.__decorateParam;
+export var __legacyDecorateClassTS = BUN_RUNTIME.__legacyDecorateClassTS;
+export var __legacyDecorateParamTS = BUN_RUNTIME.__legacyDecorateParamTS;
+export var __legacyMetadataTS = BUN_RUNTIME.__legacyMetadataTS;
export var $$bun_runtime_json_parse = JSON.parse;
export var __internalIsCommonJSNamespace = BUN_RUNTIME.__internalIsCommonJSNamespace;
var require = __$module.createRequire(import.meta.url);
diff --git a/src/runtime.footer.with-refresh.js b/src/runtime.footer.with-refresh.js
index 784f5f8fa..9aa9472e9 100644
--- a/src/runtime.footer.with-refresh.js
+++ b/src/runtime.footer.with-refresh.js
@@ -17,8 +17,9 @@ export var __cJS2eSM = BUN_RUNTIME.__cJS2eSM;
export var regeneratorRuntime = BUN_RUNTIME.regeneratorRuntime;
export var __exportValue = BUN_RUNTIME.__exportValue;
export var __exportDefault = BUN_RUNTIME.__exportDefault;
-export var __decorateClass = BUN_RUNTIME.__decorateClass;
-export var __decorateParam = BUN_RUNTIME.__decorateParam;
+export var __legacyDecorateClassTS = BUN_RUNTIME.__legacyDecorateClassTS;
+export var __legacyDecorateParamTS = BUN_RUNTIME.__legacyDecorateParamTS;
+export var __legacyMetadataTS = BUN_RUNTIME.__legacyMetadataTS;
export var $$bun_runtime_json_parse = JSON.parse;
export var __FastRefreshRuntime = BUN_RUNTIME.__FastRefreshRuntime;
export var __internalIsCommonJSNamespace = BUN_RUNTIME.__internalIsCommonJSNamespace;
diff --git a/src/runtime.js b/src/runtime.js
index 41242637b..fb1d5e70e 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -250,15 +250,23 @@ export var __merge = (props, defaultProps) => {
: mergeDefaultProps(props, defaultProps);
};
-export var __decorateClass = (decorators, target, key, kind) => {
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
- if ((decorator = decorators[i])) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
- if (kind && result) __defProp(target, key, result);
- return result;
+export var __legacyDecorateClassTS = function (decorators, target, key, desc) {
+ var c = arguments.length,
+ r = c < 3 ? target : desc === null ? (desc = Object.getOwnPropertyDescriptor(target, key)) : desc,
+ d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
+ r = Reflect.decorate(decorators, target, key, desc);
+ else
+ for (var i = decorators.length - 1; i >= 0; i--)
+ if ((d = decorators[i])) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
};
-export var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
+export var __legacyDecorateParamTS = (index, decorator) => (target, key) => decorator(target, key, index);
+
+export var __legacyMetadataTS = (k, v) => {
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
+};
export var __esm = (fn, res) => () => (fn && (res = fn((fn = 0))), res);
diff --git a/src/runtime.zig b/src/runtime.zig
index cf9f1d208..0c343ddff 100644
--- a/src/runtime.zig
+++ b/src/runtime.zig
@@ -289,6 +289,7 @@ pub const Runtime = struct {
minify_syntax: bool = false,
minify_identifiers: bool = false,
+ dead_code_elimination: bool = true,
set_breakpoint_on_first_line: bool = false,
@@ -328,6 +329,8 @@ pub const Runtime = struct {
commonjs_at_runtime: bool = false,
+ emit_decorator_metadata: bool = false,
+
pub fn shouldUnwrapRequire(this: *const Features, package_name: string) bool {
return package_name.len > 0 and strings.indexEqualAny(this.unwrap_commonjs_packages, package_name) != null;
}
@@ -372,8 +375,9 @@ pub const Runtime = struct {
__exportDefault: ?GeneratedSymbol = null,
__FastRefreshRuntime: ?GeneratedSymbol = null,
__merge: ?GeneratedSymbol = null,
- __decorateClass: ?GeneratedSymbol = null,
- __decorateParam: ?GeneratedSymbol = null,
+ __legacyDecorateClassTS: ?GeneratedSymbol = null,
+ __legacyDecorateParamTS: ?GeneratedSymbol = null,
+ __legacyMetadataTS: ?GeneratedSymbol = null,
@"$$typeof": ?GeneratedSymbol = null,
pub const all = [_][]const u8{
@@ -395,8 +399,9 @@ pub const Runtime = struct {
"__exportDefault",
"__FastRefreshRuntime",
"__merge",
- "__decorateClass",
- "__decorateParam",
+ "__legacyDecorateClassTS",
+ "__legacyDecorateParamTS",
+ "__legacyMetadataTS",
"$$typeof",
};
const all_sorted: [all.len]string = brk: {
@@ -540,6 +545,11 @@ pub const Runtime = struct {
return Entry{ .key = 18, .value = val.ref };
}
},
+ 19 => {
+ if (@field(this.runtime_imports, all[19])) |val| {
+ return Entry{ .key = 19, .value = val.ref };
+ }
+ },
else => {
return null;
},
@@ -603,6 +613,7 @@ pub const Runtime = struct {
16 => (@field(imports, all[16]) orelse return null).ref,
17 => (@field(imports, all[17]) orelse return null).ref,
18 => (@field(imports, all[18]) orelse return null).ref,
+ 19 => (@field(imports, all[19]) orelse return null).ref,
else => null,
};
}
diff --git a/src/sourcemap/sourcemap.zig b/src/sourcemap/sourcemap.zig
index 411e8523d..a274c0d94 100644
--- a/src/sourcemap/sourcemap.zig
+++ b/src/sourcemap/sourcemap.zig
@@ -940,7 +940,7 @@ pub const LineOffsetTable = struct {
contents.ptr,
)) - line_byte_offset),
);
- byte_offset_to_first_non_ascii = line_byte_offset;
+ byte_offset_to_first_non_ascii = column_byte_offset;
}
// Update the per-byte column offsets
@@ -1405,7 +1405,7 @@ pub const Chunk = struct {
// Use the line to compute the column
var original_column = loc.start - @as(i32, @intCast(line.byte_offset_to_start_of_line));
if (line.columns_for_non_ascii.len > 0 and original_column >= @as(i32, @intCast(line.byte_offset_to_first_non_ascii))) {
- original_column = line.columns_for_non_ascii.ptr[@as(u32, @intCast(original_column)) - line.byte_offset_to_first_non_ascii];
+ original_column = line.columns_for_non_ascii.slice()[@as(u32, @intCast(original_column)) - line.byte_offset_to_first_non_ascii];
}
b.updateGeneratedLineAndColumn(output);
diff --git a/src/string.zig b/src/string.zig
index 7928ad97b..6fe819013 100644
--- a/src/string.zig
+++ b/src/string.zig
@@ -460,6 +460,7 @@ pub const String = extern struct {
pub fn createExternal(bytes: []const u8, isLatin1: bool, ctx: ?*anyopaque, callback: ?*const fn (*anyopaque, *anyopaque, u32) callconv(.C) void) String {
JSC.markBinding(@src());
+ std.debug.assert(bytes.len > 0);
return BunString__createExternal(bytes.ptr, bytes.len, isLatin1, ctx, callback);
}
@@ -855,17 +856,17 @@ pub const SliceWithUnderlyingString = struct {
underlying: String,
pub fn toThreadSafe(this: *SliceWithUnderlyingString) void {
- std.debug.assert(this.underlying.tag == .WTFStringImpl);
-
- var orig = this.underlying.value.WTFStringImpl;
- this.underlying.toThreadSafe();
- if (this.underlying.value.WTFStringImpl != orig) {
- orig.deref();
-
- if (this.utf8.allocator.get()) |allocator| {
- if (String.isWTFAllocator(allocator)) {
- this.utf8.deinit();
- this.utf8 = this.underlying.toUTF8(bun.default_allocator);
+ if (this.underlying.tag == .WTFStringImpl) {
+ var orig = this.underlying.value.WTFStringImpl;
+ this.underlying.toThreadSafe();
+ if (this.underlying.value.WTFStringImpl != orig) {
+ orig.deref();
+
+ if (this.utf8.allocator.get()) |allocator| {
+ if (String.isWTFAllocator(allocator)) {
+ this.utf8.deinit();
+ this.utf8 = this.underlying.toUTF8(bun.default_allocator);
+ }
}
}
}
diff --git a/src/string_immutable.zig b/src/string_immutable.zig
index 03ba35e66..00ee8d835 100644
--- a/src/string_immutable.zig
+++ b/src/string_immutable.zig
@@ -4676,30 +4676,30 @@ test "eqlCaseInsensitiveASCII" {
}
pub fn isIPAddress(input: []const u8) bool {
- if (containsChar(input, ':'))
- return true;
+ var max_ip_address_buffer: [512]u8 = undefined;
+ if (input.len > max_ip_address_buffer.len) return false;
- if (comptime Environment.isWindows) {
- return bun.todo(@src(), false);
- }
+ var sockaddr: std.os.sockaddr = undefined;
+ @memset(std.mem.asBytes(&sockaddr), 0);
+ @memcpy(max_ip_address_buffer[0..input.len], input);
+ max_ip_address_buffer[input.len] = 0;
- if (std.net.Address.resolveIp(input, 0)) |_| {
- return true;
- } else |_| {
- return false;
- }
+ var ip_addr_str: [:0]const u8 = max_ip_address_buffer[0..input.len :0];
+
+ return bun.c_ares.ares_inet_pton(std.os.AF.INET, ip_addr_str.ptr, &sockaddr) != 0 or bun.c_ares.ares_inet_pton(std.os.AF.INET6, ip_addr_str.ptr, &sockaddr) != 0;
}
pub fn isIPV6Address(input: []const u8) bool {
- if (comptime Environment.isWindows) {
- return bun.todo(@src(), false);
- }
+ var max_ip_address_buffer: [512]u8 = undefined;
+ if (input.len > max_ip_address_buffer.len) return false;
- if (std.net.Address.parseIp6(input, 0)) |_| {
- return true;
- } else |_| {
- return false;
- }
+ var sockaddr: std.os.sockaddr = undefined;
+ @memset(std.mem.asBytes(&sockaddr), 0);
+ @memcpy(max_ip_address_buffer[0..input.len], input);
+ max_ip_address_buffer[input.len] = 0;
+
+ var ip_addr_str: [:0]const u8 = max_ip_address_buffer[0..input.len :0];
+ return bun.c_ares.ares_inet_pton(std.os.AF.INET6, ip_addr_str.ptr, &sockaddr) != 0;
}
pub fn cloneNormalizingSeparators(
diff --git a/src/string_mutable.zig b/src/string_mutable.zig
index c6ac943f6..f460d10ae 100644
--- a/src/string_mutable.zig
+++ b/src/string_mutable.zig
@@ -443,7 +443,7 @@ pub const MutableString = struct {
}
};
- pub fn writeAll(self: *MutableString, bytes: string) !usize {
+ pub fn writeAll(self: *MutableString, bytes: string) std.mem.Allocator.Error!usize {
try self.list.appendSlice(self.allocator, bytes);
return bytes.len;
}
diff --git a/src/symbols.dyn b/src/symbols.dyn
index 5ec9fd807..63b17aa61 100644
--- a/src/symbols.dyn
+++ b/src/symbols.dyn
@@ -146,4 +146,6 @@
_node_api_create_syntax_error;
_node_api_symbol_for;
_node_api_throw_syntax_error;
+ _node_api_create_external_string_latin1;
+ _node_api_create_external_string_utf16;
}; \ No newline at end of file
diff --git a/src/symbols.txt b/src/symbols.txt
index c958a08eb..ab6490f5a 100644
--- a/src/symbols.txt
+++ b/src/symbols.txt
@@ -145,3 +145,5 @@ _napi_wrap
_node_api_create_syntax_error
_node_api_symbol_for
_node_api_throw_syntax_error
+_node_api_create_external_string_latin1
+_node_api_create_external_string_utf16
diff --git a/src/sys.zig b/src/sys.zig
index 14bb9ddf9..b7542b44f 100644
--- a/src/sys.zig
+++ b/src/sys.zig
@@ -819,6 +819,19 @@ pub fn readlink(in: [:0]const u8, buf: []u8) Maybe(usize) {
unreachable;
}
+pub fn readlinkat(fd: bun.FileDescriptor, in: [:0]const u8, buf: []u8) Maybe(usize) {
+ while (true) {
+ const rc = sys.readlinkat(fd, in, buf.ptr, buf.len);
+
+ if (Maybe(usize).errnoSys(rc, .readlink)) |err| {
+ if (err.getErrno() == .INTR) continue;
+ return err;
+ }
+ return Maybe(usize){ .result = @as(usize, @intCast(rc)) };
+ }
+ unreachable;
+}
+
pub fn ftruncate(fd: fd_t, size: isize) Maybe(void) {
if (comptime Environment.isWindows) {
if (kernel32.SetFileValidData(bun.fdcast(fd), size) == 0) {
diff --git a/src/tagged_pointer.zig b/src/tagged_pointer.zig
index b5555a8b4..378f5b92f 100644
--- a/src/tagged_pointer.zig
+++ b/src/tagged_pointer.zig
@@ -97,6 +97,8 @@ pub fn TaggedPointerUnion(comptime Types: anytype) type {
pub const Tag = TagType;
repr: TaggedPointer,
+ pub const Null = .{ .repr = .{ ._ptr = 0, .data = 0 } };
+
const This = @This();
fn assert_type(comptime Type: type) void {
var name = comptime typeBaseName(@typeName(Type));
@@ -168,6 +170,10 @@ pub fn TaggedPointerUnion(comptime Types: anytype) type {
// there will be a compiler error if the passed in type doesn't exist in the enum
return This{ .repr = TaggedPointer.init(_ptr, @intFromEnum(@field(Tag, name))) };
}
+
+ pub inline fn isNull(this: This) bool {
+ return this.repr._ptr == 0;
+ }
};
}
diff --git a/src/url.zig b/src/url.zig
index 064481257..11959636e 100644
--- a/src/url.zig
+++ b/src/url.zig
@@ -103,7 +103,7 @@ pub const URL = struct {
pub const HostFormatter = struct {
host: string,
- port: string = "80",
+ port: string = "",
is_https: bool = false,
pub fn format(formatter: HostFormatter, comptime _: []const u8, _: std.fmt.FormatOptions, writer: anytype) !void {
@@ -1097,8 +1097,11 @@ pub const FormData = struct {
break :brk field.content_type.slice(buf);
}
if (filename_str.len > 0) {
- if (bun.HTTP.MimeType.byExtensionNoDefault(std.fs.path.extension(filename_str))) |mime| {
- break :brk mime.value;
+ const extension = std.fs.path.extension(filename_str);
+ if (extension.len > 0) {
+ if (bun.HTTP.MimeType.byExtensionNoDefault(extension[1..extension.len])) |mime| {
+ break :brk mime.value;
+ }
}
}
diff --git a/src/watcher.zig b/src/watcher.zig
index 5521414e3..98cf5aa29 100644
--- a/src/watcher.zig
+++ b/src/watcher.zig
@@ -373,6 +373,7 @@ pub fn NewWatcher(comptime ContextType: type) type {
close_descriptors: bool = false,
pub const HashType = u32;
+ pub const WatchListArray = Watchlist;
var evict_list: [WATCHER_MAX_LIST]WatchItemIndex = undefined;
diff --git a/src/zlib.zig b/src/zlib.zig
index 090d0f3a0..00617cf24 100644
--- a/src/zlib.zig
+++ b/src/zlib.zig
@@ -575,8 +575,6 @@ pub const ZlibReaderArrayList = struct {
switch (rc) {
ReturnCode.StreamEnd => {
- this.state = State.End;
-
this.end();
return;
},
diff --git a/test/.gitignore b/test/.gitignore
deleted file mode 100644
index 60f986255..000000000
--- a/test/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-bun.lockb
diff --git a/test/README.md b/test/README.md
deleted file mode 100644
index 03f9c97af..000000000
--- a/test/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-# Tests
-
-## Finding tests
-
-Tests are located in the [`test/`](test/) directory and are organized using the following structure:
-
-* `test/`
- * `js/` - tests for JavaScript APIs.
- * `cli/` - tests for commands, configs, and stdout.
- * `bundler/` - tests for the transpiler/bundler.
- * `regression/` - tests that reproduce a specific issue.
- * `harness.ts` - utility functions that can be imported from any test.
-
-The tests in [`test/js/`](test/js/) directory are further categorized by the type of API.
-
-* `test/js/`
- * `bun/` - tests for `Bun`-specific APIs.
- * `node/` - tests for Node.js APIs.
- * `web/` - tests for Web APIs, like `fetch()`.
- * `first_party/` - tests for npm packages that are built-in, like `undici`.
- * `third_party/` - tests for npm packages that are not built-in, but are popular, like `esbuild`.
-
-## Running tests
-
-To run a test, use Bun's built-in test command: `bun test`.
-
-```sh
-bun test # Run all tests
-bun test js/bun # Only run tests in a directory
-bun test sqlite.test.ts # Only run a specific test
-```
-
-If you encounter lots of errors, try running `bun install`, then trying again.
-
-## Writing tests
-
-Tests are written in TypeScript (preferred) or JavaScript using Jest's `describe()`, `test()`, and `expect()` APIs.
-
-```ts
-import { describe, test, expect } from "bun:test";
-import { gcTick } from "harness";
-
-describe("TextEncoder", () => {
- test("can encode a string", async () => {
- const encoder = new TextEncoder();
- const actual = encoder.encode("bun");
- await gcTick();
- expect(actual).toBe(new Uint8Array([0x62, 0x75, 0x6E]));
- });
-});
-```
-
-If you are fixing a bug that was reported from a GitHub issue, remember to add a test in the `test/regression/` directory.
-
-```ts
-// test/regression/issue/02005.test.ts
-
-import { it, expect } from "bun:test";
-
-it("regex literal should work with non-latin1", () => {
- const text = "这是一段要替换的文字";
- expect(text.replace(new RegExp("要替换"), "")).toBe("这是一段的文字");
- expect(text.replace(/要替换/, "")).toBe("这是一段的文字");
-});
-```
-
-In the future, a bot will automatically close or re-open issues when a regression is detected or resolved.
-
-## Zig tests
-
-These tests live in various `.zig` files throughout Bun's codebase, leveraging Zig's builtin `test` keyword.
-
-Currently, they're not run automatically nor is there a simple way to run all of them. We will make this better soon.
-
-## TypeScript
-
-Test files should be written in TypeScript. The types in `packages/bun-types` should be updated to support all new APIs. Changes to the `.d.ts` files in `packages/bun-types` will be immediately reflected in test files; no build step is necessary.
-
-Writing a test will often require using invalid syntax, e.g. when checking for errors when an invalid input is passed to a function. TypeScript provides a number of escape hatches here.
-
-- `// @ts-expect-error` - This should be your first choice. It tells TypeScript that the next line *should* fail typechecking.
-- `// @ts-ignore` - Ignore the next line entirely.
-- `// @ts-nocheck` - Put this at the top of the file to disable typechecking on the entire file. Useful for autogenerated test files, or when ignoring/disabling type checks an a per-line basis is too onerous.
diff --git a/test/bun.lockb b/test/bun.lockb
index f212bb6c5..c65160667 100755
--- a/test/bun.lockb
+++ b/test/bun.lockb
Binary files differ
diff --git a/test/bundler/__snapshots__/bun-build-api.test.ts.snap b/test/bundler/__snapshots__/bun-build-api.test.ts.snap
index 1076dc34f..ab419aae7 100644
--- a/test/bundler/__snapshots__/bun-build-api.test.ts.snap
+++ b/test/bundler/__snapshots__/bun-build-api.test.ts.snap
@@ -72,11 +72,11 @@ NS.then(({ fn: fn2 }) => {
"
`;
-exports[`Bun.build BuildArtifact properties: hash 1`] = `"eed0054b0aa2037b"`;
+exports[`Bun.build BuildArtifact properties: hash 1`] = `"61fa5aa06740929b"`;
-exports[`Bun.build BuildArtifact properties + entry.naming: hash 1`] = `"82b2e1b4a1117627"`;
+exports[`Bun.build BuildArtifact properties + entry.naming: hash 1`] = `"e6329e3574ac500f"`;
-exports[`Bun.build BuildArtifact properties sourcemap: hash index.js 1`] = `"eed0054b0aa2037b"`;
+exports[`Bun.build BuildArtifact properties sourcemap: hash index.js 1`] = `"61fa5aa06740929b"`;
exports[`Bun.build BuildArtifact properties sourcemap: hash index.js.map 1`] = `"0000000000000000"`;
diff --git a/test/bundler/bun-build-api.test.ts b/test/bundler/bun-build-api.test.ts
index 3c2308d94..d1f1a10b8 100644
--- a/test/bundler/bun-build-api.test.ts
+++ b/test/bundler/bun-build-api.test.ts
@@ -290,4 +290,27 @@ describe("Bun.build", () => {
// depends on the ws package in the test/node_modules.
expect(content).toContain("var websocket = __toESM(require_websocket(), 1);");
});
+
+ test("module() throws error", async () => {
+ expect(() =>
+ Bun.build({
+ entrypoints: [join(import.meta.dir, "./fixtures/trivial/bundle-ws.ts")],
+ plugins: [
+ {
+ name: "test",
+ setup: b => {
+ b.module("ad", () => {
+ return {
+ exports: {
+ hello: "world",
+ },
+ loader: "object",
+ };
+ });
+ },
+ },
+ ],
+ }),
+ ).toThrow();
+ });
});
diff --git a/test/bundler/bundler_decorator_metadata.test.ts b/test/bundler/bundler_decorator_metadata.test.ts
new file mode 100644
index 000000000..60c11f703
--- /dev/null
+++ b/test/bundler/bundler_decorator_metadata.test.ts
@@ -0,0 +1,1265 @@
+import assert from "assert";
+import { itBundled, testForFile } from "./expectBundled";
+var { describe, test, expect } = testForFile(import.meta.path);
+
+const reflectMetadata = `
+var Reflect2;
+(function(Reflect3) {
+ (function(factory) {
+ var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : Function("return this;")();
+ var exporter = makeExporter(Reflect3);
+ if (typeof root.Reflect === "undefined") {
+ root.Reflect = Reflect3;
+ } else {
+ exporter = makeExporter(root.Reflect, exporter);
+ }
+ factory(exporter);
+ function makeExporter(target, previous) {
+ return function(key, value) {
+ if (typeof target[key] !== "function") {
+ Object.defineProperty(target, key, { configurable: true, writable: true, value });
+ }
+ if (previous)
+ previous(key, value);
+ };
+ }
+ })(function(exporter) {
+ var hasOwn = Object.prototype.hasOwnProperty;
+ var supportsSymbol = typeof Symbol === "function";
+ var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive";
+ var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator";
+ var supportsCreate = typeof Object.create === "function";
+ var supportsProto = { __proto__: [] } instanceof Array;
+ var downLevel = !supportsCreate && !supportsProto;
+ var HashMap = {
+ create: supportsCreate ? function() {
+ return MakeDictionary(Object.create(null));
+ } : supportsProto ? function() {
+ return MakeDictionary({ __proto__: null });
+ } : function() {
+ return MakeDictionary({});
+ },
+ has: downLevel ? function(map, key) {
+ return hasOwn.call(map, key);
+ } : function(map, key) {
+ return key in map;
+ },
+ get: downLevel ? function(map, key) {
+ return hasOwn.call(map, key) ? map[key] : undefined;
+ } : function(map, key) {
+ return map[key];
+ }
+ };
+ var functionPrototype = Object.getPrototypeOf(Function);
+ var usePolyfill = typeof process === "object" && process.env && process.env["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true";
+ var _Map = !usePolyfill && typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
+ var _Set = !usePolyfill && typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
+ var _WeakMap = !usePolyfill && typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
+ var Metadata = new _WeakMap;
+ function decorate(decorators, target, propertyKey, attributes) {
+ if (!IsUndefined(propertyKey)) {
+ if (!IsArray(decorators))
+ throw new TypeError;
+ if (!IsObject(target))
+ throw new TypeError;
+ if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))
+ throw new TypeError;
+ if (IsNull(attributes))
+ attributes = undefined;
+ propertyKey = ToPropertyKey(propertyKey);
+ return DecorateProperty(decorators, target, propertyKey, attributes);
+ } else {
+ if (!IsArray(decorators))
+ throw new TypeError;
+ if (!IsConstructor(target))
+ throw new TypeError;
+ return DecorateConstructor(decorators, target);
+ }
+ }
+ exporter("decorate", decorate);
+ function metadata(metadataKey, metadataValue) {
+ function decorator(target, propertyKey) {
+ if (!IsObject(target))
+ throw new TypeError;
+ if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))
+ throw new TypeError;
+ OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
+ }
+ return decorator;
+ }
+ exporter("metadata", metadata);
+ function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
+ if (!IsObject(target))
+ throw new TypeError;
+ if (!IsUndefined(propertyKey))
+ propertyKey = ToPropertyKey(propertyKey);
+ return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
+ }
+ exporter("defineMetadata", defineMetadata);
+ function hasMetadata(metadataKey, target, propertyKey) {
+ if (!IsObject(target))
+ throw new TypeError;
+ if (!IsUndefined(propertyKey))
+ propertyKey = ToPropertyKey(propertyKey);
+ return OrdinaryHasMetadata(metadataKey, target, propertyKey);
+ }
+ exporter("hasMetadata", hasMetadata);
+ function hasOwnMetadata(metadataKey, target, propertyKey) {
+ if (!IsObject(target))
+ throw new TypeError;
+ if (!IsUndefined(propertyKey))
+ propertyKey = ToPropertyKey(propertyKey);
+ return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
+ }
+ exporter("hasOwnMetadata", hasOwnMetadata);
+ function getMetadata(metadataKey, target, propertyKey) {
+ if (!IsObject(target))
+ throw new TypeError;
+ if (!IsUndefined(propertyKey))
+ propertyKey = ToPropertyKey(propertyKey);
+ return OrdinaryGetMetadata(metadataKey, target, propertyKey);
+ }
+ exporter("getMetadata", getMetadata);
+ function getOwnMetadata(metadataKey, target, propertyKey) {
+ if (!IsObject(target))
+ throw new TypeError;
+ if (!IsUndefined(propertyKey))
+ propertyKey = ToPropertyKey(propertyKey);
+ return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);
+ }
+ exporter("getOwnMetadata", getOwnMetadata);
+ function getMetadataKeys(target, propertyKey) {
+ if (!IsObject(target))
+ throw new TypeError;
+ if (!IsUndefined(propertyKey))
+ propertyKey = ToPropertyKey(propertyKey);
+ return OrdinaryMetadataKeys(target, propertyKey);
+ }
+ exporter("getMetadataKeys", getMetadataKeys);
+ function getOwnMetadataKeys(target, propertyKey) {
+ if (!IsObject(target))
+ throw new TypeError;
+ if (!IsUndefined(propertyKey))
+ propertyKey = ToPropertyKey(propertyKey);
+ return OrdinaryOwnMetadataKeys(target, propertyKey);
+ }
+ exporter("getOwnMetadataKeys", getOwnMetadataKeys);
+ function deleteMetadata(metadataKey, target, propertyKey) {
+ if (!IsObject(target))
+ throw new TypeError;
+ if (!IsUndefined(propertyKey))
+ propertyKey = ToPropertyKey(propertyKey);
+ var metadataMap = GetOrCreateMetadataMap(target, propertyKey, false);
+ if (IsUndefined(metadataMap))
+ return false;
+ if (!metadataMap.delete(metadataKey))
+ return false;
+ if (metadataMap.size > 0)
+ return true;
+ var targetMetadata = Metadata.get(target);
+ targetMetadata.delete(propertyKey);
+ if (targetMetadata.size > 0)
+ return true;
+ Metadata.delete(target);
+ return true;
+ }
+ exporter("deleteMetadata", deleteMetadata);
+ function DecorateConstructor(decorators, target) {
+ for (var i = decorators.length - 1;i >= 0; --i) {
+ var decorator = decorators[i];
+ var decorated = decorator(target);
+ if (!IsUndefined(decorated) && !IsNull(decorated)) {
+ if (!IsConstructor(decorated))
+ throw new TypeError;
+ target = decorated;
+ }
+ }
+ return target;
+ }
+ function DecorateProperty(decorators, target, propertyKey, descriptor) {
+ for (var i = decorators.length - 1;i >= 0; --i) {
+ var decorator = decorators[i];
+ var decorated = decorator(target, propertyKey, descriptor);
+ if (!IsUndefined(decorated) && !IsNull(decorated)) {
+ if (!IsObject(decorated))
+ throw new TypeError;
+ descriptor = decorated;
+ }
+ }
+ return descriptor;
+ }
+ function GetOrCreateMetadataMap(O, P, Create) {
+ var targetMetadata = Metadata.get(O);
+ if (IsUndefined(targetMetadata)) {
+ if (!Create)
+ return;
+ targetMetadata = new _Map;
+ Metadata.set(O, targetMetadata);
+ }
+ var metadataMap = targetMetadata.get(P);
+ if (IsUndefined(metadataMap)) {
+ if (!Create)
+ return;
+ metadataMap = new _Map;
+ targetMetadata.set(P, metadataMap);
+ }
+ return metadataMap;
+ }
+ function OrdinaryHasMetadata(MetadataKey, O, P) {
+ var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
+ if (hasOwn2)
+ return true;
+ var parent = OrdinaryGetPrototypeOf(O);
+ if (!IsNull(parent))
+ return OrdinaryHasMetadata(MetadataKey, parent, P);
+ return false;
+ }
+ function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
+ var metadataMap = GetOrCreateMetadataMap(O, P, false);
+ if (IsUndefined(metadataMap))
+ return false;
+ return ToBoolean(metadataMap.has(MetadataKey));
+ }
+ function OrdinaryGetMetadata(MetadataKey, O, P) {
+ var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
+ if (hasOwn2)
+ return OrdinaryGetOwnMetadata(MetadataKey, O, P);
+ var parent = OrdinaryGetPrototypeOf(O);
+ if (!IsNull(parent))
+ return OrdinaryGetMetadata(MetadataKey, parent, P);
+ return;
+ }
+ function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
+ var metadataMap = GetOrCreateMetadataMap(O, P, false);
+ if (IsUndefined(metadataMap))
+ return;
+ return metadataMap.get(MetadataKey);
+ }
+ function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
+ var metadataMap = GetOrCreateMetadataMap(O, P, true);
+ metadataMap.set(MetadataKey, MetadataValue);
+ }
+ function OrdinaryMetadataKeys(O, P) {
+ var ownKeys = OrdinaryOwnMetadataKeys(O, P);
+ var parent = OrdinaryGetPrototypeOf(O);
+ if (parent === null)
+ return ownKeys;
+ var parentKeys = OrdinaryMetadataKeys(parent, P);
+ if (parentKeys.length <= 0)
+ return ownKeys;
+ if (ownKeys.length <= 0)
+ return parentKeys;
+ var set = new _Set;
+ var keys = [];
+ for (var _i = 0, ownKeys_1 = ownKeys;_i < ownKeys_1.length; _i++) {
+ var key = ownKeys_1[_i];
+ var hasKey = set.has(key);
+ if (!hasKey) {
+ set.add(key);
+ keys.push(key);
+ }
+ }
+ for (var _a = 0, parentKeys_1 = parentKeys;_a < parentKeys_1.length; _a++) {
+ var key = parentKeys_1[_a];
+ var hasKey = set.has(key);
+ if (!hasKey) {
+ set.add(key);
+ keys.push(key);
+ }
+ }
+ return keys;
+ }
+ function OrdinaryOwnMetadataKeys(O, P) {
+ var keys = [];
+ var metadataMap = GetOrCreateMetadataMap(O, P, false);
+ if (IsUndefined(metadataMap))
+ return keys;
+ var keysObj = metadataMap.keys();
+ var iterator = GetIterator(keysObj);
+ var k = 0;
+ while (true) {
+ var next = IteratorStep(iterator);
+ if (!next) {
+ keys.length = k;
+ return keys;
+ }
+ var nextValue = IteratorValue(next);
+ try {
+ keys[k] = nextValue;
+ } catch (e) {
+ try {
+ IteratorClose(iterator);
+ } finally {
+ throw e;
+ }
+ }
+ k++;
+ }
+ }
+ function Type(x) {
+ if (x === null)
+ return 1;
+ switch (typeof x) {
+ case "undefined":
+ return 0;
+ case "boolean":
+ return 2;
+ case "string":
+ return 3;
+ case "symbol":
+ return 4;
+ case "number":
+ return 5;
+ case "object":
+ return x === null ? 1 : 6;
+ default:
+ return 6;
+ }
+ }
+ function IsUndefined(x) {
+ return x === undefined;
+ }
+ function IsNull(x) {
+ return x === null;
+ }
+ function IsSymbol(x) {
+ return typeof x === "symbol";
+ }
+ function IsObject(x) {
+ return typeof x === "object" ? x !== null : typeof x === "function";
+ }
+ function ToPrimitive(input, PreferredType) {
+ switch (Type(input)) {
+ case 0:
+ return input;
+ case 1:
+ return input;
+ case 2:
+ return input;
+ case 3:
+ return input;
+ case 4:
+ return input;
+ case 5:
+ return input;
+ }
+ var hint = PreferredType === 3 ? "string" : PreferredType === 5 ? "number" : "default";
+ var exoticToPrim = GetMethod(input, toPrimitiveSymbol);
+ if (exoticToPrim !== undefined) {
+ var result = exoticToPrim.call(input, hint);
+ if (IsObject(result))
+ throw new TypeError;
+ return result;
+ }
+ return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint);
+ }
+ function OrdinaryToPrimitive(O, hint) {
+ if (hint === "string") {
+ var toString_1 = O.toString;
+ if (IsCallable(toString_1)) {
+ var result = toString_1.call(O);
+ if (!IsObject(result))
+ return result;
+ }
+ var valueOf = O.valueOf;
+ if (IsCallable(valueOf)) {
+ var result = valueOf.call(O);
+ if (!IsObject(result))
+ return result;
+ }
+ } else {
+ var valueOf = O.valueOf;
+ if (IsCallable(valueOf)) {
+ var result = valueOf.call(O);
+ if (!IsObject(result))
+ return result;
+ }
+ var toString_2 = O.toString;
+ if (IsCallable(toString_2)) {
+ var result = toString_2.call(O);
+ if (!IsObject(result))
+ return result;
+ }
+ }
+ throw new TypeError;
+ }
+ function ToBoolean(argument) {
+ return !!argument;
+ }
+ function ToString(argument) {
+ return "" + argument;
+ }
+ function ToPropertyKey(argument) {
+ var key = ToPrimitive(argument, 3);
+ if (IsSymbol(key))
+ return key;
+ return ToString(key);
+ }
+ function IsArray(argument) {
+ return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === "[object Array]";
+ }
+ function IsCallable(argument) {
+ return typeof argument === "function";
+ }
+ function IsConstructor(argument) {
+ return typeof argument === "function";
+ }
+ function IsPropertyKey(argument) {
+ switch (Type(argument)) {
+ case 3:
+ return true;
+ case 4:
+ return true;
+ default:
+ return false;
+ }
+ }
+ function GetMethod(V, P) {
+ var func = V[P];
+ if (func === undefined || func === null)
+ return;
+ if (!IsCallable(func))
+ throw new TypeError;
+ return func;
+ }
+ function GetIterator(obj) {
+ var method = GetMethod(obj, iteratorSymbol);
+ if (!IsCallable(method))
+ throw new TypeError;
+ var iterator = method.call(obj);
+ if (!IsObject(iterator))
+ throw new TypeError;
+ return iterator;
+ }
+ function IteratorValue(iterResult) {
+ return iterResult.value;
+ }
+ function IteratorStep(iterator) {
+ var result = iterator.next();
+ return result.done ? false : result;
+ }
+ function IteratorClose(iterator) {
+ var f = iterator["return"];
+ if (f)
+ f.call(iterator);
+ }
+ function OrdinaryGetPrototypeOf(O) {
+ var proto = Object.getPrototypeOf(O);
+ if (typeof O !== "function" || O === functionPrototype)
+ return proto;
+ if (proto !== functionPrototype)
+ return proto;
+ var prototype = O.prototype;
+ var prototypeProto = prototype && Object.getPrototypeOf(prototype);
+ if (prototypeProto == null || prototypeProto === Object.prototype)
+ return proto;
+ var constructor = prototypeProto.constructor;
+ if (typeof constructor !== "function")
+ return proto;
+ if (constructor === O)
+ return proto;
+ return constructor;
+ }
+ function CreateMapPolyfill() {
+ var cacheSentinel = {};
+ var arraySentinel = [];
+ var MapIterator = function() {
+ function MapIterator2(keys, values, selector) {
+ this._index = 0;
+ this._keys = keys;
+ this._values = values;
+ this._selector = selector;
+ }
+ MapIterator2.prototype["@@iterator"] = function() {
+ return this;
+ };
+ MapIterator2.prototype[iteratorSymbol] = function() {
+ return this;
+ };
+ MapIterator2.prototype.next = function() {
+ var index = this._index;
+ if (index >= 0 && index < this._keys.length) {
+ var result = this._selector(this._keys[index], this._values[index]);
+ if (index + 1 >= this._keys.length) {
+ this._index = -1;
+ this._keys = arraySentinel;
+ this._values = arraySentinel;
+ } else {
+ this._index++;
+ }
+ return { value: result, done: false };
+ }
+ return { value: undefined, done: true };
+ };
+ MapIterator2.prototype.throw = function(error) {
+ if (this._index >= 0) {
+ this._index = -1;
+ this._keys = arraySentinel;
+ this._values = arraySentinel;
+ }
+ throw error;
+ };
+ MapIterator2.prototype.return = function(value) {
+ if (this._index >= 0) {
+ this._index = -1;
+ this._keys = arraySentinel;
+ this._values = arraySentinel;
+ }
+ return { value, done: true };
+ };
+ return MapIterator2;
+ }();
+ return function() {
+ function Map2() {
+ this._keys = [];
+ this._values = [];
+ this._cacheKey = cacheSentinel;
+ this._cacheIndex = -2;
+ }
+ Object.defineProperty(Map2.prototype, "size", {
+ get: function() {
+ return this._keys.length;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ Map2.prototype.has = function(key) {
+ return this._find(key, false) >= 0;
+ };
+ Map2.prototype.get = function(key) {
+ var index = this._find(key, false);
+ return index >= 0 ? this._values[index] : undefined;
+ };
+ Map2.prototype.set = function(key, value) {
+ var index = this._find(key, true);
+ this._values[index] = value;
+ return this;
+ };
+ Map2.prototype.delete = function(key) {
+ var index = this._find(key, false);
+ if (index >= 0) {
+ var size = this._keys.length;
+ for (var i = index + 1;i < size; i++) {
+ this._keys[i - 1] = this._keys[i];
+ this._values[i - 1] = this._values[i];
+ }
+ this._keys.length--;
+ this._values.length--;
+ if (key === this._cacheKey) {
+ this._cacheKey = cacheSentinel;
+ this._cacheIndex = -2;
+ }
+ return true;
+ }
+ return false;
+ };
+ Map2.prototype.clear = function() {
+ this._keys.length = 0;
+ this._values.length = 0;
+ this._cacheKey = cacheSentinel;
+ this._cacheIndex = -2;
+ };
+ Map2.prototype.keys = function() {
+ return new MapIterator(this._keys, this._values, getKey);
+ };
+ Map2.prototype.values = function() {
+ return new MapIterator(this._keys, this._values, getValue);
+ };
+ Map2.prototype.entries = function() {
+ return new MapIterator(this._keys, this._values, getEntry);
+ };
+ Map2.prototype["@@iterator"] = function() {
+ return this.entries();
+ };
+ Map2.prototype[iteratorSymbol] = function() {
+ return this.entries();
+ };
+ Map2.prototype._find = function(key, insert) {
+ if (this._cacheKey !== key) {
+ this._cacheIndex = this._keys.indexOf(this._cacheKey = key);
+ }
+ if (this._cacheIndex < 0 && insert) {
+ this._cacheIndex = this._keys.length;
+ this._keys.push(key);
+ this._values.push(undefined);
+ }
+ return this._cacheIndex;
+ };
+ return Map2;
+ }();
+ function getKey(key, _) {
+ return key;
+ }
+ function getValue(_, value) {
+ return value;
+ }
+ function getEntry(key, value) {
+ return [key, value];
+ }
+ }
+ function CreateSetPolyfill() {
+ return function() {
+ function Set2() {
+ this._map = new _Map;
+ }
+ Object.defineProperty(Set2.prototype, "size", {
+ get: function() {
+ return this._map.size;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ Set2.prototype.has = function(value) {
+ return this._map.has(value);
+ };
+ Set2.prototype.add = function(value) {
+ return this._map.set(value, value), this;
+ };
+ Set2.prototype.delete = function(value) {
+ return this._map.delete(value);
+ };
+ Set2.prototype.clear = function() {
+ this._map.clear();
+ };
+ Set2.prototype.keys = function() {
+ return this._map.keys();
+ };
+ Set2.prototype.values = function() {
+ return this._map.values();
+ };
+ Set2.prototype.entries = function() {
+ return this._map.entries();
+ };
+ Set2.prototype["@@iterator"] = function() {
+ return this.keys();
+ };
+ Set2.prototype[iteratorSymbol] = function() {
+ return this.keys();
+ };
+ return Set2;
+ }();
+ }
+ function CreateWeakMapPolyfill() {
+ var UUID_SIZE = 16;
+ var keys = HashMap.create();
+ var rootKey = CreateUniqueKey();
+ return function() {
+ function WeakMap2() {
+ this._key = CreateUniqueKey();
+ }
+ WeakMap2.prototype.has = function(target) {
+ var table = GetOrCreateWeakMapTable(target, false);
+ return table !== undefined ? HashMap.has(table, this._key) : false;
+ };
+ WeakMap2.prototype.get = function(target) {
+ var table = GetOrCreateWeakMapTable(target, false);
+ return table !== undefined ? HashMap.get(table, this._key) : undefined;
+ };
+ WeakMap2.prototype.set = function(target, value) {
+ var table = GetOrCreateWeakMapTable(target, true);
+ table[this._key] = value;
+ return this;
+ };
+ WeakMap2.prototype.delete = function(target) {
+ var table = GetOrCreateWeakMapTable(target, false);
+ return table !== undefined ? delete table[this._key] : false;
+ };
+ WeakMap2.prototype.clear = function() {
+ this._key = CreateUniqueKey();
+ };
+ return WeakMap2;
+ }();
+ function CreateUniqueKey() {
+ var key;
+ do
+ key = "@@WeakMap@@" + CreateUUID();
+ while (HashMap.has(keys, key));
+ keys[key] = true;
+ return key;
+ }
+ function GetOrCreateWeakMapTable(target, create) {
+ if (!hasOwn.call(target, rootKey)) {
+ if (!create)
+ return;
+ Object.defineProperty(target, rootKey, { value: HashMap.create() });
+ }
+ return target[rootKey];
+ }
+ function FillRandomBytes(buffer, size) {
+ for (var i = 0;i < size; ++i)
+ buffer[i] = Math.random() * 255 | 0;
+ return buffer;
+ }
+ function GenRandomBytes(size) {
+ if (typeof Uint8Array === "function") {
+ if (typeof crypto !== "undefined")
+ return crypto.getRandomValues(new Uint8Array(size));
+ if (typeof msCrypto !== "undefined")
+ return msCrypto.getRandomValues(new Uint8Array(size));
+ return FillRandomBytes(new Uint8Array(size), size);
+ }
+ return FillRandomBytes(new Array(size), size);
+ }
+ function CreateUUID() {
+ var data = GenRandomBytes(UUID_SIZE);
+ data[6] = data[6] & 79 | 64;
+ data[8] = data[8] & 191 | 128;
+ var result = "";
+ for (var offset = 0;offset < UUID_SIZE; ++offset) {
+ var byte = data[offset];
+ if (offset === 4 || offset === 6 || offset === 8)
+ result += "-";
+ if (byte < 16)
+ result += "0";
+ result += byte.toString(16).toLowerCase();
+ }
+ return result;
+ }
+ }
+ function MakeDictionary(obj) {
+ obj.__ = undefined;
+ delete obj.__;
+ return obj;
+ }
+ });
+})(Reflect2 || (Reflect2 = {}));
+`;
+
+describe("bundler", () => {
+ itBundled("decorator_metadata/TypeSerialization", {
+ files: {
+ "/entry.ts": /* ts */ `
+
+ ${reflectMetadata}
+
+ function d1() {}
+ class Known {}
+ class Swag {}
+ class A_1 {}
+
+ // @ts-ignore
+ @d1
+ class Yolo {
+ constructor(
+ p0: any,
+ p1: unknown,
+ p2: never,
+ p3: void,
+ p4: null,
+ p5: undefined,
+ p6: number,
+ p7: string,
+ p8: boolean,
+ p9: symbol,
+ p10: bigint,
+ p11: object,
+ p12: () => {},
+ p13: [],
+ p14: {},
+ p15: 123,
+ p16: 123n,
+ p17: "123",
+ p18: \`123\`,
+ p19: true,
+ p20: false,
+ // @ts-ignore
+ p21: Map,
+ // @ts-ignore
+ p22: Set,
+ p23: Known,
+ // @ts-ignore
+ p24: Unknown,
+ p25: never & string,
+ p26: string & never,
+ p27: null & string,
+ p28: string & null,
+ p29: undefined & string,
+ p30: string & undefined,
+ p31: void & string,
+ p32: string & void,
+ p33: unknown & string,
+ p34: string & unknown,
+ p35: any & string,
+ p36: string & any,
+ p37: never | string,
+ p38: string | never,
+ p39: null | string,
+ p40: string | null,
+ p41: undefined | string,
+ p42: string | undefined,
+ p43: void | string,
+ p44: string | void,
+ p45: unknown | string,
+ p46: string | unknown,
+ p47: any | string,
+ p48: string | any,
+ p49: string | string,
+ p50: string & string,
+ p51: Known | Swag,
+ p52: Swag | Known,
+ p53: Known & Swag,
+ p54: Swag & Known,
+ p55: never | Swag,
+ p56: Swag | never,
+ p57: null | Swag,
+ p58: Swag | null,
+ p59: undefined | Swag,
+ p60: Swag | undefined,
+ p61: void | Swag,
+ p62: Swag | void,
+ p63: unknown | Swag,
+ p64: Swag | unknown,
+ p65: any | Swag,
+ p66: Swag | any,
+ p67: never & Swag,
+ p68: Swag & never,
+ p69: null & Swag,
+ p70: Swag & null,
+ p71: undefined & Swag,
+ p72: Swag & undefined,
+ p73: void & Swag,
+ p74: Swag & void,
+ p75: unknown & Swag,
+ p76: Swag & unknown,
+ p77: any & Swag,
+ p78: Swag & any,
+ p79: Swag | Swag,
+ p80: Swag & Swag,
+ // @ts-ignore
+ p81: Unknown | Known,
+ // @ts-ignore
+ p82: Known | Unknown,
+ // @ts-ignore
+ p83: Unknown & Known,
+ // @ts-ignore
+ p84: Known & Unknown,
+ // @ts-ignore
+ p85: Unknown | Unknown,
+ // @ts-ignore
+ p86: Unknown & Unknown,
+ p87: never | never,
+ p88: never & never,
+ p89: null | null,
+ p90: null & null,
+ p91: undefined | undefined,
+ p92: undefined & undefined,
+ p93: void | void,
+ p94: void & void,
+ p95: unknown | unknown,
+ p96: unknown & unknown,
+ p97: any | any,
+ p98: any & any,
+ p99: never | void,
+ p100: void | never,
+ p101: null | void,
+ p102: void | null,
+ p103: undefined | void,
+ p104: void | undefined,
+ p105: void | void,
+ p106: void & void,
+ p107: unknown | void,
+ p108: void | unknown,
+ p109: any | void,
+ p110: void | any,
+ p111: never | unknown,
+ p112: unknown | never,
+ p113: null | unknown,
+ p114: unknown | null,
+ p115: undefined | unknown,
+ p116: unknown | undefined,
+ p117: void | unknown,
+ p118: unknown | void,
+ p119: unknown | unknown,
+ p120: unknown & unknown,
+ p121: any | unknown,
+ p122: unknown | any,
+ p123: never | any,
+ p124: any | never,
+ p125: null | any,
+ p126: any | null,
+ p127: undefined | any,
+ p128: any | undefined,
+ p129: void | any,
+ p130: any | void,
+ p131: unknown | any,
+ p132: any | unknown,
+ p133: any | any,
+ p134: never & void,
+ p135: void & never,
+ p136: null & void,
+ p137: void & null,
+ p138: undefined & void,
+ p139: void & undefined,
+ p140: void & void,
+ p141: void | void,
+ p142: unknown & void,
+ p143: void & unknown,
+ p144: any & void,
+ p145: void & any,
+ p146: never & unknown,
+ p147: unknown & never,
+ p148: null & unknown,
+ p149: unknown & null,
+ p150: undefined & unknown,
+ p151: unknown & undefined,
+ p152: void & unknown,
+ p153: unknown & void,
+ p154: unknown & unknown,
+ p155: unknown | unknown,
+ p156: any & unknown,
+ p157: unknown & any,
+ p158: never & any,
+ p159: any & never,
+ p160: null & any,
+ p161: any & null,
+ p162: undefined & any,
+ p163: any & undefined,
+ p164: void & any,
+ p165: any & void,
+ p166: unknown & any,
+ p167: any & unknown,
+ p168: any & any,
+ p169: string & number & boolean & never & symbol,
+ p170: "foo" | A_1,
+ p171: true | boolean,
+ p172: "foo" | boolean,
+ p173: A_1 | "foo",
+ ){}
+ }
+
+ const received = Reflect.getMetadata("design:paramtypes", Yolo);
+ console.log(received.length === 174);
+ console.log(received[0] === Object);
+ console.log(received[1] === Object);
+ console.log(received[2] === void 0);
+ console.log(received[3] === void 0);
+ console.log(received[4] === void 0);
+ console.log(received[5] === void 0);
+ console.log(received[6] === Number);
+ console.log(received[7] === String);
+ console.log(received[8] === Boolean);
+ console.log(received[9] === (typeof Symbol === "function" ? Symbol : Object));
+ console.log(received[10] === (typeof BigInt === "function" ? BigInt : Object));
+ console.log(received[11] === Object);
+ console.log(received[12] === Function);
+ console.log(received[13] === Array);
+ console.log(received[14] === Object);
+ console.log(received[15] === Number);
+ console.log(received[16] === (typeof BigInt === "function" ? BigInt : Object));
+ console.log(received[17] === String);
+ console.log(received[18] === String);
+ console.log(received[19] === Boolean);
+ console.log(received[20] === Boolean);
+ console.log(received[21] === Map);
+ console.log(received[22] === Set);
+ console.log(received[23] === Known);
+ console.log(received[24] === Object);
+ console.log(received[25] === void 0);
+ console.log(received[26] === void 0);
+ console.log(received[27] === String);
+ console.log(received[28] === String);
+ console.log(received[29] === String);
+ console.log(received[30] === String);
+ console.log(received[31] === Object);
+ console.log(received[32] === Object);
+ console.log(received[33] === String);
+ console.log(received[34] === String);
+ console.log(received[35] === Object);
+ console.log(received[36] === Object);
+ console.log(received[37] === String);
+ console.log(received[38] === String);
+ console.log(received[39] === String);
+ console.log(received[40] === String);
+ console.log(received[41] === String);
+ console.log(received[42] === String);
+ console.log(received[43] === Object);
+ console.log(received[44] === Object);
+ console.log(received[45] === Object);
+ console.log(received[46] === Object);
+ console.log(received[47] === Object);
+ console.log(received[48] === Object);
+ console.log(received[49] === String);
+ console.log(received[50] === String);
+ console.log(received[51] === Object);
+ console.log(received[52] === Object);
+ console.log(received[53] === Object);
+ console.log(received[54] === Object);
+ console.log(received[55] === Swag);
+ console.log(received[56] === Swag);
+ console.log(received[57] === Swag);
+ console.log(received[58] === Swag);
+ console.log(received[59] === Swag);
+ console.log(received[60] === Swag);
+ console.log(received[61] === Object);
+ console.log(received[62] === Object);
+ console.log(received[63] === Object);
+ console.log(received[64] === Object);
+ console.log(received[65] === Object);
+ console.log(received[66] === Object);
+ console.log(received[67] === void 0);
+ console.log(received[68] === void 0);
+ console.log(received[69] === Swag);
+ console.log(received[70] === Swag);
+ console.log(received[71] === Swag);
+ console.log(received[72] === Swag);
+ console.log(received[73] === Object);
+ console.log(received[74] === Object);
+ console.log(received[75] === Swag);
+ console.log(received[76] === Swag);
+ console.log(received[77] === Object);
+ console.log(received[78] === Object);
+ console.log(received[79] === Swag);
+ console.log(received[80] === Swag);
+ console.log(received[81] === Object);
+ console.log(received[82] === Object);
+ console.log(received[83] === Object);
+ console.log(received[84] === Object);
+ console.log(received[85] === Object);
+ console.log(received[86] === Object);
+ console.log(received[87] === void 0);
+ console.log(received[88] === void 0);
+ console.log(received[89] === void 0);
+ console.log(received[90] === void 0);
+ console.log(received[91] === void 0);
+ console.log(received[92] === void 0);
+ console.log(received[93] === void 0);
+ console.log(received[94] === void 0);
+ console.log(received[95] === Object);
+ console.log(received[96] === void 0);
+ console.log(received[97] === Object);
+ console.log(received[98] === Object);
+ console.log(received[99] === void 0);
+ console.log(received[100] === void 0);
+ console.log(received[101] === void 0);
+ console.log(received[102] === void 0);
+ console.log(received[103] === void 0);
+ console.log(received[104] === void 0);
+ console.log(received[105] === void 0);
+ console.log(received[106] === void 0);
+ console.log(received[107] === Object);
+ console.log(received[108] === Object);
+ console.log(received[109] === Object);
+ console.log(received[110] === Object);
+ console.log(received[111] === Object);
+ console.log(received[112] === Object);
+ console.log(received[113] === Object);
+ console.log(received[114] === Object);
+ console.log(received[115] === Object);
+ console.log(received[116] === Object);
+ console.log(received[117] === Object);
+ console.log(received[118] === Object);
+ console.log(received[119] === Object);
+ console.log(received[120] === void 0);
+ console.log(received[121] === Object);
+ console.log(received[122] === Object);
+ console.log(received[123] === Object);
+ console.log(received[124] === Object);
+ console.log(received[125] === Object);
+ console.log(received[126] === Object);
+ console.log(received[127] === Object);
+ console.log(received[128] === Object);
+ console.log(received[129] === Object);
+ console.log(received[130] === Object);
+ console.log(received[131] === Object);
+ console.log(received[132] === Object);
+ console.log(received[133] === Object);
+ console.log(received[134] === void 0);
+ console.log(received[135] === void 0);
+ console.log(received[136] === void 0);
+ console.log(received[137] === void 0);
+ console.log(received[138] === void 0);
+ console.log(received[139] === void 0);
+ console.log(received[140] === void 0);
+ console.log(received[141] === void 0);
+ console.log(received[142] === void 0);
+ console.log(received[143] === void 0);
+ console.log(received[144] === Object);
+ console.log(received[145] === Object);
+ console.log(received[146] === void 0);
+ console.log(received[147] === void 0);
+ console.log(received[148] === void 0);
+ console.log(received[149] === void 0);
+ console.log(received[150] === void 0);
+ console.log(received[151] === void 0);
+ console.log(received[152] === void 0);
+ console.log(received[153] === void 0);
+ console.log(received[154] === void 0);
+ console.log(received[155] === Object);
+ console.log(received[156] === Object);
+ console.log(received[157] === Object);
+ console.log(received[158] === void 0);
+ console.log(received[159] === Object);
+ console.log(received[160] === Object);
+ console.log(received[161] === Object);
+ console.log(received[162] === Object);
+ console.log(received[163] === Object);
+ console.log(received[164] === Object);
+ console.log(received[165] === Object);
+ console.log(received[166] === Object);
+ console.log(received[167] === Object);
+ console.log(received[168] === Object);
+ console.log(received[169] === Object);
+ console.log(received[170] === Object);
+ console.log(received[171] === Boolean);
+ console.log(received[172] === Object);
+ console.log(received[173] === Object);
+
+ // @ts-ignore
+ @d1
+ class A {
+ // @ts-ignore
+ constructor(@d1 arg1: string) {}
+ // @ts-ignore
+ @d1
+ // @ts-ignore
+ method1(@d1 arg1: number): boolean {
+ return true;
+ }
+ // @ts-ignore
+ @d1
+ prop1: () => {};
+ // @ts-ignore
+ @d1
+ prop2: "foo" = "foo";
+ // @ts-ignore
+ @d1
+ prop3: symbol;
+ }
+
+ console.log(Reflect.getMetadata("design:type", A) === undefined);
+ console.log(Reflect.getMetadata("design:paramtypes", A)[0] === String);
+ console.log(Reflect.getMetadata("design:returntype", A) === undefined);
+
+ console.log(Reflect.getMetadata("design:type", A.prototype) === undefined);
+ console.log(Reflect.getMetadata("design:paramtypes", A.prototype) === undefined);
+ console.log(Reflect.getMetadata("design:returntype", A.prototype) === undefined);
+
+ console.log(Reflect.getMetadata("design:type", A.prototype.method1) === undefined);
+ console.log(Reflect.getMetadata("design:paramtypes", A.prototype.method1) === undefined);
+ console.log(Reflect.getMetadata("design:returntype", A.prototype.method1) === undefined);
+
+ console.log(Reflect.getMetadata("design:type", A.prototype, "method1") === Function);
+ console.log(Reflect.getMetadata("design:paramtypes", A.prototype, "method1")[0] === Number);
+ console.log(Reflect.getMetadata("design:returntype", A.prototype, "method1") === Boolean);
+
+ console.log(Reflect.getMetadata("design:type", A.prototype, "prop1") === Function);
+ console.log(Reflect.getMetadata("design:paramtypes", A.prototype, "prop1") === undefined);
+ console.log(Reflect.getMetadata("design:returntype", A.prototype, "prop1") === undefined);
+
+ console.log(Reflect.getMetadata("design:type", A.prototype, "prop2") === String);
+ console.log(Reflect.getMetadata("design:paramtypes", A.prototype, "prop2") === undefined);
+ console.log(Reflect.getMetadata("design:returntype", A.prototype, "prop2") === undefined);
+
+ console.log(Reflect.getMetadata("design:type", A.prototype, "prop3") === Symbol);
+ console.log(Reflect.getMetadata("design:paramtypes", A.prototype, "prop3") === undefined);
+ console.log(Reflect.getMetadata("design:returntype", A.prototype, "prop3") === undefined);
+
+ class HelloWorld {
+ // @ts-ignore
+ constructor(@d1 arg1: string) {}
+ }
+
+ console.log(Reflect.getMetadata("design:type", HelloWorld) === undefined);
+ console.log(Reflect.getMetadata("design:paramtypes", HelloWorld)[0] === String);
+ console.log(Reflect.getMetadata("design:returntype", HelloWorld) === undefined);
+
+ type B = "hello" | "world";
+ const b = 2;
+ const c = ["hello", "world"] as const;
+ type Loser = \`hello \${B}\`; // "hello hello" | "hello world"
+ function d1() {}
+
+ class AClass {
+ constructor(
+ // @ts-ignore
+ @d1 p0: \`hello \${B}\`,
+ // @ts-ignore
+ p1: keyof Something,
+ p2: typeof b,
+ p3: readonly ["hello", "world"],
+ p4: typeof c,
+ p5: readonly [number, string],
+ // prettier-ignore
+ p6: (string | string),
+ // prettier-ignore
+ p7: (string & string),
+ p8: boolean extends true ? "a" : "b",
+ // @ts-ignore
+ p9: Loser extends Loser ? string : Foo,
+ p10: { [keyof in string]: number },
+ // @ts-ignore
+ p11: blah extends blahblah ? number : void,
+ ) {}
+
+ // @ts-ignore
+ @d1
+ async method1() {
+ return true;
+ }
+ }
+
+ const paramtypes = Reflect.getMetadata("design:paramtypes", AClass);
+ console.log(paramtypes[0] === String);
+ console.log(paramtypes[1] === Object);
+ console.log(paramtypes[2] === Object);
+ console.log(paramtypes[3] === Array);
+ console.log(paramtypes[4] === Object);
+ console.log(paramtypes[5] === Array);
+ console.log(paramtypes[6] === String);
+ console.log(paramtypes[7] === String);
+ console.log(paramtypes[8] === String);
+ console.log(paramtypes[9] === Object);
+ console.log(paramtypes[10] === Object);
+ console.log(paramtypes[11] === Object);
+
+ console.log(Reflect.getMetadata("design:returntype", AClass.prototype, "method1") === Promise);
+ `,
+ "/tsconfig.json": /* json */ `
+ {
+ "compilerOptions": {
+ "experimentalDecorators": true,
+ "emitDecoratorMetadata": true,
+ }
+ }
+ `,
+ },
+ bundling: true,
+ run: {
+ stdout: "true\n".repeat(212),
+ },
+ });
+
+ itBundled("decorator_metadata/ImportIdentifiers", {
+ files: {
+ "/entry.ts": /* ts */ `
+ ${reflectMetadata}
+
+ import { Foo } from "./foo.js";
+
+ function d1() {}
+
+ @d1
+ class Bar {
+ constructor(foo: Foo) {}
+ }
+
+ console.log(Reflect.getMetadata("design:paramtypes", Bar)[0] === Foo);
+ `,
+ "/foo.js": /* js */ `
+ const f = () => "Foo";
+ module.exports[f()] = class Foo {};
+ `,
+ "/tsconfig.json": /* json */ `
+ {
+ "compilerOptions": {
+ "experimentalDecorators": true,
+ "emitDecoratorMetadata": true,
+ }
+ }
+ `,
+ },
+ run: {
+ stdout: "true\n",
+ },
+ });
+});
diff --git a/test/bundler/bundler_minify.test.ts b/test/bundler/bundler_minify.test.ts
index c984bbe67..fb6b8db7a 100644
--- a/test/bundler/bundler_minify.test.ts
+++ b/test/bundler/bundler_minify.test.ts
@@ -286,4 +286,25 @@ describe("bundler", () => {
stdout: "PASS",
},
});
+ // https://github.com/oven-sh/bun/issues/5501
+ itBundled("minify/BunRequireStatement", {
+ files: {
+ "/entry.js": /* js */ `
+ export function test(ident) {
+ return require(ident);
+ }
+
+ test("fs");
+ console.log("PASS");
+ `,
+ },
+ minifyWhitespace: true,
+ minifySyntax: true,
+ minifyIdentifiers: true,
+ target: "bun",
+ backend: "cli",
+ run: {
+ stdout: "PASS",
+ },
+ });
});
diff --git a/test/cli/install/__snapshots__/bun-pm.test.ts.snap b/test/cli/install/__snapshots__/bun-pm.test.ts.snap
new file mode 100644
index 000000000..e548c4ef5
--- /dev/null
+++ b/test/cli/install/__snapshots__/bun-pm.test.ts.snap
@@ -0,0 +1,3 @@
+// Bun Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`bun pm migrate 1`] = `"E7F4C15F76D43059-37ed01456afdc149-B17A9541F8322712-04892ad4e094e703"`;
diff --git a/test/cli/install/boba-0.0.2.tgz b/test/cli/install/boba-0.0.2.tgz
new file mode 100644
index 000000000..4308f02c4
--- /dev/null
+++ b/test/cli/install/boba-0.0.2.tgz
Binary files differ
diff --git a/test/cli/install/bun-add.test.ts b/test/cli/install/bun-add.test.ts
index 72678fc37..540f51e9d 100644
--- a/test/cli/install/bun-add.test.ts
+++ b/test/cli/install/bun-add.test.ts
@@ -1,7 +1,7 @@
import { file, spawn } from "bun";
import { afterAll, afterEach, beforeAll, beforeEach, expect, it } from "bun:test";
import { bunExe, bunEnv as env } from "harness";
-import { access, mkdir, mkdtemp, readlink, realpath, rm, writeFile } from "fs/promises";
+import { access, mkdir, mkdtemp, readlink, realpath, rm, writeFile, copyFile } from "fs/promises";
import { join, relative } from "path";
import { tmpdir } from "os";
import {
@@ -20,7 +20,11 @@ import {
beforeAll(dummyBeforeAll);
afterAll(dummyAfterAll);
+let port: string;
let add_dir: string;
+beforeAll(() => {
+ port = new URL(root_url).port;
+});
beforeEach(async () => {
add_dir = await mkdtemp(join(await realpath(tmpdir()), "bun-add.test"));
@@ -67,7 +71,7 @@ it("should add existing package", async () => {
` installed foo@${add_path}`,
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(await file(join(package_dir, "package.json")).text()).toEqual(
@@ -107,7 +111,6 @@ it("should reject missing package", async () => {
expect(err).toContain("bun add");
expect(err).toContain("error: MissingPackageJSON");
expect(err).toContain(`note: error occured while resolving file:${add_path}`);
- expect(err).not.toContain("Saved lockfile");
expect(stdout).toBeDefined();
const out = await new Response(stdout).text();
@@ -150,7 +153,6 @@ it("should reject invalid path without segfault", async () => {
expect(err).toContain("bun add");
expect(err).toContain("error: MissingPackageJSON");
expect(err).toContain(`note: error occured while resolving file://${add_path}`);
- expect(err).not.toContain("Saved lockfile");
expect(stdout).toBeDefined();
const out = await new Response(stdout).text();
@@ -193,8 +195,7 @@ it("should handle semver-like names", async () => {
});
expect(stderr).toBeDefined();
const err = await new Response(stderr).text();
- expect(err).toContain('error: package "1.2.3" not found localhost/1.2.3 404');
- expect(err).not.toContain("Saved lockfile");
+ expect(err.split(/\r?\n/)).toContain(`error: package "1.2.3" not found localhost:${port}/1.2.3 404`);
expect(stdout).toBeDefined();
expect(await new Response(stdout).text()).toBe("");
expect(await exited).toBe(1);
@@ -237,12 +238,11 @@ it("should handle @scoped names", async () => {
});
expect(stderr).toBeDefined();
const err = await new Response(stderr).text();
- expect(err).toContain('error: package "@bar/baz" not found localhost/@bar/baz 404');
- expect(err).not.toContain("Saved lockfile");
+ expect(err.split(/\r?\n/)).toContain(`error: package "@bar/baz" not found localhost:${port}/@bar%2fbaz 404`);
expect(stdout).toBeDefined();
expect(await new Response(stdout).text()).toBe("");
expect(await exited).toBe(1);
- expect(urls.sort()).toEqual([`${root_url}/@bar/baz`]);
+ expect(urls.sort()).toEqual([`${root_url}/@bar%2fbaz`]);
expect(requested).toBe(1);
try {
await access(join(package_dir, "bun.lockb"));
@@ -281,7 +281,7 @@ it("should add dependency with capital letters", async () => {
" installed BaR@0.0.2",
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/BaR`, `${root_url}/BaR-0.0.2.tgz`]);
@@ -337,7 +337,62 @@ it("should add exact version", async () => {
" installed BaR@0.0.2",
"",
"",
- " 1 packages installed",
+ " 1 package installed",
+ ]);
+ expect(await exited).toBe(0);
+ expect(urls.sort()).toEqual([`${root_url}/BaR`, `${root_url}/BaR-0.0.2.tgz`]);
+ expect(requested).toBe(2);
+ expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "BaR"]);
+ expect(await readdirSorted(join(package_dir, "node_modules", "BaR"))).toEqual(["package.json"]);
+ expect(await file(join(package_dir, "node_modules", "BaR", "package.json")).json()).toEqual({
+ name: "bar",
+ version: "0.0.2",
+ });
+ expect(await file(join(package_dir, "package.json")).text()).toEqual(
+ JSON.stringify(
+ {
+ name: "foo",
+ version: "0.0.1",
+ dependencies: {
+ BaR: "0.0.2",
+ },
+ },
+ null,
+ 2,
+ ),
+ );
+ await access(join(package_dir, "bun.lockb"));
+});
+
+it("should add exact version with -E", async () => {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ }),
+ );
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "add", "-E", "BaR"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ const out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ "",
+ " installed BaR@0.0.2",
+ "",
+ "",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/BaR`, `${root_url}/BaR-0.0.2.tgz`]);
@@ -402,7 +457,7 @@ it("should add dependency with specified semver", async () => {
" - baz-run",
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]);
@@ -464,7 +519,7 @@ it("should add dependency (GitHub)", async () => {
" - uglifyjs",
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -626,7 +681,7 @@ it("should add aliased dependency (npm)", async () => {
" - baz-run",
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]);
@@ -688,7 +743,7 @@ it("should add aliased dependency (GitHub)", async () => {
" - uglifyjs",
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -773,7 +828,7 @@ it("should let you add the same package twice", async () => {
" installed baz@0.0.3",
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited1).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]);
@@ -890,7 +945,7 @@ it("should install version tagged with `latest` by default", async () => {
" installed baz@0.0.3",
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited1).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]);
@@ -941,7 +996,7 @@ it("should install version tagged with `latest` by default", async () => {
expect(out2.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + baz@0.0.3",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited2).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]);
@@ -1006,7 +1061,7 @@ it("should handle Git URL in dependencies (SCP-style)", async () => {
" - uglifyjs",
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited1).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -1067,7 +1122,7 @@ it("should handle Git URL in dependencies (SCP-style)", async () => {
const out2 = await new Response(stdout2).text();
expect(out2.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
"",
- "Checked 1 installs across 2 packages (no changes)",
+ "Checked 1 install across 2 packages (no changes)",
]);
expect(await exited2).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -1229,7 +1284,7 @@ it("should add dependency without duplication", async () => {
" installed bar@0.0.2",
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited1).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -1332,7 +1387,7 @@ it("should add dependency without duplication (GitHub)", async () => {
" - uglifyjs",
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited1).toBe(0);
expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".bin", ".cache", "uglify-js"]);
@@ -1472,7 +1527,7 @@ it("should add dependencies to workspaces directly", async () => {
` installed foo@${relative(package_dir, add_dir)}`,
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(await readdirSorted(join(package_dir))).toEqual([
@@ -1537,10 +1592,10 @@ async function installRedirectsToAdd(saveFlagFirst: boolean) {
` installed foo@${add_path}`,
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
- expect((await file(join(package_dir, "package.json")).text()).includes("bun-add.test"));
+ expect(await file(join(package_dir, "package.json")).text()).toInclude("bun-add.test");
}
it("should add dependency alongside peerDependencies", async () => {
@@ -1574,7 +1629,7 @@ it("should add dependency alongside peerDependencies", async () => {
" installed bar@0.0.2",
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -1596,3 +1651,48 @@ it("should add dependency alongside peerDependencies", async () => {
});
await access(join(package_dir, "bun.lockb"));
});
+
+it("should add local tarball dependency", async () => {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ }),
+ );
+ const tarball = "baz-0.0.3.tgz";
+ const absolutePath = join(__dirname, tarball);
+ await copyFile(absolutePath, join(package_dir, tarball));
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "add", tarball],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ const out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ "",
+ " installed baz@baz-0.0.3.tgz with binaries:",
+ " - baz-run",
+ "",
+ "",
+ " 1 package installed",
+ ]);
+ expect(await exited).toBe(0);
+ expect(urls.sort()).toBeEmpty();
+ expect(requested).toBe(0);
+ expect(await readdirSorted(join(package_dir, "node_modules", "baz"))).toEqual(["index.js", "package.json"]);
+ const package_json = await file(join(package_dir, "node_modules", "baz", "package.json")).json();
+ expect(package_json.name).toBe("baz");
+ expect(package_json.version).toBe("0.0.3");
+ expect(await file(join(package_dir, "package.json")).text()).toInclude('"baz-0.0.3.tgz"'),
+ await access(join(package_dir, "bun.lockb"));
+});
diff --git a/test/cli/install/bun-create.test.ts b/test/cli/install/bun-create.test.ts
new file mode 100644
index 000000000..af8d16d1d
--- /dev/null
+++ b/test/cli/install/bun-create.test.ts
@@ -0,0 +1,31 @@
+import { spawn } from "bun";
+import { afterEach, beforeEach, expect, it } from "bun:test";
+import { bunExe, bunEnv as env } from "harness";
+import { mkdtemp, realpath, rm, writeFile } from "fs/promises";
+import { tmpdir } from "os";
+import { join } from "path";
+
+let x_dir: string;
+
+beforeEach(async () => {
+ x_dir = await realpath(await mkdtemp(join(tmpdir(), "bun-x.test")));
+});
+afterEach(async () => {
+ await rm(x_dir, { force: true, recursive: true });
+});
+
+it("should create selected template with @ prefix", async () => {
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "create", "@quick-start/some-template"],
+ cwd: x_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+
+ const err = await new Response(stderr).text();
+ expect(err.split(/\r?\n/)).toContain(
+ `error: package "@quick-start/create-some-template" not found registry.npmjs.org/@quick-start%2fcreate-some-template 404`,
+ );
+});
diff --git a/test/cli/install/bun-install.test.ts b/test/cli/install/bun-install.test.ts
index c4810f605..d79155819 100644
--- a/test/cli/install/bun-install.test.ts
+++ b/test/cli/install/bun-install.test.ts
@@ -39,7 +39,7 @@ it("should report connection errors", async () => {
`
[install]
cache = false
-registry = "http://localhost:${server.port}/"
+registry = "http://${server.hostname}:${server.port}/"
`,
);
await writeFile(
@@ -62,7 +62,7 @@ registry = "http://localhost:${server.port}/"
});
expect(stderr).toBeDefined();
const err = await new Response(stderr).text();
- expect(err.split(/\r?\n/)).toContain("error: ConnectionClosed downloading package manifest bar");
+ expect(err).toMatch(/error: (ConnectionRefused|ConnectionClosed) downloading package manifest bar/gm);
expect(stdout).toBeDefined();
expect(await new Response(stdout).text()).toBeEmpty();
expect(await exited).toBe(1);
@@ -96,7 +96,7 @@ it("should handle missing package", async () => {
});
expect(stderr).toBeDefined();
const err = await new Response(stderr).text();
- expect(err.split(/\r?\n/)).toContain('error: package "foo" not found localhost/foo 404');
+ expect(err.split(/\r?\n/)).toContain(`error: package "foo" not found localhost:${new URL(root_url).port}/foo 404`);
expect(stdout).toBeDefined();
expect(await new Response(stdout).text()).toBeEmpty();
expect(await exited).toBe(1);
@@ -112,7 +112,7 @@ it("should handle missing package", async () => {
it("should handle @scoped authentication", async () => {
let seen_token = false;
- const url = `${root_url}/@foo/bar`;
+ const url = `${root_url}/@foo%2fbar`;
const urls: string[] = [];
setHandler(async request => {
expect(request.method).toBe("GET");
@@ -192,7 +192,7 @@ it("should handle empty string in dependencies", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@0.0.2",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -380,7 +380,7 @@ it("should handle `workspace:` specifier", async () => {
expect(out1.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + Bar@workspace:path/to/bar",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited1).toBe(0);
expect(requested).toBe(0);
@@ -409,7 +409,7 @@ it("should handle `workspace:` specifier", async () => {
expect(out2.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + Bar@workspace:path/to/bar",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited2).toBe(0);
expect(requested).toBe(0);
@@ -453,7 +453,7 @@ it("should handle workspaces with packages array", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + Bar@workspace:bar",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(requested).toBe(0);
@@ -659,6 +659,13 @@ it("should ignore peerDependencies within workspaces", async () => {
},
}),
);
+ await writeFile(
+ join(package_dir, "bunfig.toml"),
+ `
+ [install]
+ peer = false
+ `,
+ );
const { stdout, stderr, exited } = spawn({
cmd: [bunExe(), "install"],
cwd: package_dir,
@@ -675,15 +682,91 @@ it("should ignore peerDependencies within workspaces", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + Baz@workspace:packages/baz",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(requested).toBe(0);
- expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "Baz"]);
+ expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual(["Baz"]);
expect(await readlink(join(package_dir, "node_modules", "Baz"))).toBe(join("..", "packages", "baz"));
await access(join(package_dir, "bun.lockb"));
});
+it("should handle installing the same peerDependency with different versions", async () => {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ peerDependencies: {
+ peer: "0.0.2",
+ },
+ dependencies: {
+ boba: "0.0.2",
+ },
+ }),
+ );
+
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(requested).toBe(0);
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ const out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ " + boba@0.0.2",
+ "",
+ " 2 packages installed",
+ ]);
+});
+
+it("should handle installing the same peerDependency with the same version", async () => {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ peerDependencies: {
+ peer: "0.0.1",
+ },
+ dependencies: {
+ boba: "0.0.2",
+ },
+ }),
+ );
+
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(requested).toBe(0);
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ const out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ " + boba@0.0.2",
+ "",
+ " 1 package installed",
+ ]);
+});
+
it("should handle life-cycle scripts within workspaces", async () => {
await writeFile(
join(package_dir, "package.json"),
@@ -728,7 +811,7 @@ it("should handle life-cycle scripts within workspaces", async () => {
" + Bar@workspace:bar",
"[scripts:run] Foo",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(requested).toBe(0);
@@ -738,6 +821,8 @@ it("should handle life-cycle scripts within workspaces", async () => {
});
it("should handle life-cycle scripts during re-installation", async () => {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
await writeFile(
join(package_dir, "package.json"),
JSON.stringify({
@@ -746,6 +831,10 @@ it("should handle life-cycle scripts during re-installation", async () => {
scripts: {
install: [bunExe(), "index.js"].join(" "),
},
+ dependencies: {
+ qux: "^0.0",
+ },
+ trustedDependencies: ["qux"],
workspaces: ["bar"],
}),
);
@@ -783,13 +872,15 @@ it("should handle life-cycle scripts during re-installation", async () => {
expect(out1.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
"[scripts:run] Bar",
" + Bar@workspace:bar",
+ " + qux@0.0.2",
"[scripts:run] Foo",
+ "[scripts:run] Qux",
"",
- " 1 packages installed",
+ " 2 packages installed",
]);
expect(await exited1).toBe(0);
- expect(requested).toBe(0);
- expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "Bar"]);
+ expect(requested).toBe(2);
+ expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "Bar", "qux"]);
expect(await readlink(join(package_dir, "node_modules", "Bar"))).toBe(join("..", "bar"));
await access(join(package_dir, "bun.lockb"));
// Perform `bun install` again but with lockfile from before
@@ -815,13 +906,15 @@ it("should handle life-cycle scripts during re-installation", async () => {
expect(out2.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
"[scripts:run] Bar",
" + Bar@workspace:bar",
+ " + qux@0.0.2",
"[scripts:run] Foo",
+ "[scripts:run] Qux",
"",
- " 1 packages installed",
+ " 2 packages installed",
]);
expect(await exited2).toBe(0);
- expect(requested).toBe(0);
- expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual(["Bar"]);
+ expect(requested).toBe(3);
+ expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "Bar", "qux"]);
expect(await readlink(join(package_dir, "node_modules", "Bar"))).toBe(join("..", "bar"));
await access(join(package_dir, "bun.lockb"));
// Perform `bun install --production` with lockfile from before
@@ -847,13 +940,15 @@ it("should handle life-cycle scripts during re-installation", async () => {
expect(out3.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
"[scripts:run] Bar",
" + Bar@workspace:bar",
+ " + qux@0.0.2",
"[scripts:run] Foo",
+ "[scripts:run] Qux",
"",
- " 1 packages installed",
+ " 2 packages installed",
]);
expect(await exited3).toBe(0);
- expect(requested).toBe(0);
- expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual(["Bar"]);
+ expect(requested).toBe(4);
+ expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "Bar", "qux"]);
expect(await readlink(join(package_dir, "node_modules", "Bar"))).toBe(join("..", "bar"));
await access(join(package_dir, "bun.lockb"));
});
@@ -904,7 +999,7 @@ it("should use updated life-cycle scripts in root during re-installation", async
" + Bar@workspace:bar",
"[scripts:run] Foo",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited1).toBe(0);
expect(requested).toBe(0);
@@ -949,7 +1044,7 @@ it("should use updated life-cycle scripts in root during re-installation", async
"[scripts:run] Moo",
"[scripts:run] Foo",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited2).toBe(0);
expect(requested).toBe(0);
@@ -983,7 +1078,7 @@ it("should use updated life-cycle scripts in root during re-installation", async
"[scripts:run] Moo",
"[scripts:run] Foo",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited3).toBe(0);
expect(requested).toBe(0);
@@ -1038,7 +1133,7 @@ it("should use updated life-cycle scripts in dependency during re-installation",
" + Bar@workspace:bar",
"[scripts:run] Foo",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited1).toBe(0);
expect(requested).toBe(0);
@@ -1082,7 +1177,7 @@ it("should use updated life-cycle scripts in dependency during re-installation",
"[scripts:run] Foo",
"[scripts:run] Bar",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited2).toBe(0);
expect(requested).toBe(0);
@@ -1116,7 +1211,7 @@ it("should use updated life-cycle scripts in dependency during re-installation",
"[scripts:run] Foo",
"[scripts:run] Bar",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited3).toBe(0);
expect(requested).toBe(0);
@@ -1159,7 +1254,7 @@ it("should ignore workspaces within workspaces", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@workspace:bar",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(requested).toBe(0);
@@ -1197,7 +1292,7 @@ it("should handle ^0 in dependencies", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@0.0.2",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -1277,7 +1372,7 @@ it("should handle ^0.0 in dependencies", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@0.0.2",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -1395,7 +1490,7 @@ it("should handle ^0.0.2 in dependencies", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@0.0.2",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -1409,6 +1504,157 @@ it("should handle ^0.0.2 in dependencies", async () => {
await access(join(package_dir, "bun.lockb"));
});
+it("should handle matching workspaces from dependencies", async () => {
+ const urls: string[] = [];
+ setHandler(
+ dummyRegistry(urls, {
+ "0.2.0": { as: "0.2.0" },
+ }),
+ );
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ workspaces: ["packages/*"],
+ }),
+ );
+ await mkdir(join(package_dir, "packages", "pkg1"), { recursive: true });
+ await mkdir(join(package_dir, "packages", "pkg2"), { recursive: true });
+ await writeFile(
+ join(package_dir, "packages", "pkg1", "package.json"),
+ JSON.stringify({
+ name: "pkg1",
+ version: "0.2.0",
+ }),
+ );
+
+ await writeFile(
+ join(package_dir, "packages", "pkg2", "package.json"),
+ JSON.stringify({
+ name: "pkg2",
+ version: "0.2.0",
+ dependencies: {
+ // moo has a dependency on pkg1 that matches 0.2.0
+ moo: "0.2.0",
+ },
+ }),
+ );
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).not.toContain("error:");
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ const out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ " + pkg1@workspace:packages/pkg1",
+ " + pkg2@workspace:packages/pkg2",
+ "",
+ " 3 packages installed",
+ ]);
+ expect(await exited).toBe(0);
+ await access(join(package_dir, "bun.lockb"));
+});
+
+it("should edit package json correctly with git dependencies", async () => {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+ const package_json = JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ dependencies: {},
+ });
+ await writeFile(join(package_dir, "package.json"), package_json);
+ var { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "i", "dylan-conway/install-test2"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ var err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(err).not.toContain("error:");
+ expect(await exited).toBe(0);
+ expect(await file(join(package_dir, "package.json")).json()).toEqual({
+ name: "foo",
+ version: "0.0.1",
+ dependencies: {
+ "install-test2": "dylan-conway/install-test2",
+ },
+ });
+ await writeFile(join(package_dir, "package.json"), package_json);
+ ({ stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "i", "dylan-conway/install-test2#HEAD"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ }));
+ err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(err).not.toContain("error:");
+ expect(await exited).toBe(0);
+ expect(await file(join(package_dir, "package.json")).json()).toEqual({
+ name: "foo",
+ version: "0.0.1",
+ dependencies: {
+ "install-test2": "dylan-conway/install-test2#HEAD",
+ },
+ });
+ await writeFile(join(package_dir, "package.json"), package_json);
+ ({ stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "i", "github:dylan-conway/install-test2"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ }));
+ err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(err).not.toContain("error:");
+ expect(await exited).toBe(0);
+ expect(await file(join(package_dir, "package.json")).json()).toEqual({
+ name: "foo",
+ version: "0.0.1",
+ dependencies: {
+ "install-test2": "github:dylan-conway/install-test2",
+ },
+ });
+ await writeFile(join(package_dir, "package.json"), package_json);
+ ({ stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "i", "github:dylan-conway/install-test2#HEAD"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ }));
+ err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(err).not.toContain("error:");
+ expect(await exited).toBe(0);
+ expect(await file(join(package_dir, "package.json")).json()).toEqual({
+ name: "foo",
+ version: "0.0.1",
+ dependencies: {
+ "install-test2": "github:dylan-conway/install-test2#HEAD",
+ },
+ });
+ await access(join(package_dir, "bun.lockb"));
+});
+
it("should handle ^0.0.2-rc in dependencies", async () => {
const urls: string[] = [];
setHandler(dummyRegistry(urls, { "0.0.2-rc": { as: "0.0.2" } }));
@@ -1439,7 +1685,7 @@ it("should handle ^0.0.2-rc in dependencies", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@0.0.2-rc",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -1483,7 +1729,51 @@ it("should handle ^0.0.2-alpha.3+b4d in dependencies", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@0.0.2-alpha.3",
"",
- " 1 packages installed",
+ " 1 package installed",
+ ]);
+ expect(await exited).toBe(0);
+ expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
+ expect(requested).toBe(2);
+ expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "bar"]);
+ expect(await readdirSorted(join(package_dir, "node_modules", "bar"))).toEqual(["package.json"]);
+ expect(await file(join(package_dir, "node_modules", "bar", "package.json")).json()).toEqual({
+ name: "bar",
+ version: "0.0.2",
+ });
+ await access(join(package_dir, "bun.lockb"));
+});
+
+it("should choose the right version with prereleases", async () => {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls, { "0.0.2-alpha.3": { as: "0.0.2" } }));
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ dependencies: {
+ bar: "^0.0.2-alpha.3+b4d",
+ },
+ }),
+ );
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(err).not.toContain("error:");
+ expect(stdout).toBeDefined();
+ const out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ " + bar@0.0.2-alpha.3",
+ "",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -1527,7 +1817,7 @@ it("should handle ^0.0.2rc1 in dependencies", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@0.0.2-rc1",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -1571,7 +1861,7 @@ it("should handle ^0.0.2_pre3 in dependencies", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@0.0.2-_pre3",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -1615,7 +1905,7 @@ it("should handle ^0.0.2b_4+cafe_b0ba in dependencies", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@0.0.2-b_4+cafe_b0ba",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -1659,7 +1949,7 @@ it("should handle caret range in dependencies when the registry has prereleased
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@6.3.0",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -1716,7 +2006,7 @@ it("should prefer latest-tagged dependency", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + baz@0.0.3",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]);
@@ -1735,6 +2025,130 @@ it("should prefer latest-tagged dependency", async () => {
await access(join(package_dir, "bun.lockb"));
});
+it("should install latest with prereleases", async () => {
+ const urls: string[] = [];
+ setHandler(
+ dummyRegistry(urls, {
+ "1.0.0-0": { as: "0.0.3" },
+ "1.0.0-8": { as: "0.0.5" },
+ latest: "1.0.0-0",
+ }),
+ );
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ }),
+ );
+
+ var { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install", "baz"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr).toBeDefined();
+ var err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ var out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\n/)).toEqual([
+ "",
+ " installed baz@1.0.0-0",
+ "",
+ "",
+ " 1 package installed",
+ ]);
+ expect(await exited).toBe(0);
+ expect(requested).toBe(2);
+ await rm(join(package_dir, "node_modules"), { recursive: true, force: true });
+ await rm(join(package_dir, "bun.lockb"), { recursive: true, force: true });
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ dependencies: {
+ baz: "latest",
+ },
+ }),
+ );
+ ({ stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ }));
+ expect(stderr).toBeDefined();
+ err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\n/)).toEqual([" + baz@1.0.0-0", "", " 1 package installed"]);
+ expect(await exited).toBe(0);
+ await rm(join(package_dir, "node_modules"), { recursive: true, force: true });
+ await rm(join(package_dir, "bun.lockb"), { recursive: true, force: true });
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ dependencies: {
+ baz: "^1.0.0-5",
+ },
+ }),
+ );
+ ({ stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ }));
+ expect(stderr).toBeDefined();
+ err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\n/)).toEqual([" + baz@1.0.0-8", "", " 1 package installed"]);
+ expect(await exited).toBe(0);
+
+ await rm(join(package_dir, "node_modules"), { recursive: true, force: true });
+ await rm(join(package_dir, "bun.lockb"), { recursive: true, force: true });
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ dependencies: {
+ baz: "^1.0.0-0",
+ },
+ }),
+ );
+ ({ stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ }));
+ expect(stderr).toBeDefined();
+ err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\n/)).toEqual([" + baz@1.0.0-0", "", " 1 package installed"]);
+ expect(await exited).toBe(0);
+ await access(join(package_dir, "bun.lockb"));
+});
+
it("should handle dependency aliasing", async () => {
const urls: string[] = [];
setHandler(
@@ -1772,7 +2186,7 @@ it("should handle dependency aliasing", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + Bar@0.0.3",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]);
@@ -1828,7 +2242,7 @@ it("should handle dependency aliasing (versioned)", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + Bar@0.0.3",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]);
@@ -1884,7 +2298,7 @@ it("should handle dependency aliasing (dist-tagged)", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + Bar@0.0.3",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]);
@@ -1944,7 +2358,7 @@ it("should not reinstall aliased dependencies", async () => {
expect(out1.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + Bar@0.0.3",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited1).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]);
@@ -1982,7 +2396,7 @@ it("should not reinstall aliased dependencies", async () => {
const out2 = await new Response(stdout2).text();
expect(out2.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
"",
- "Checked 1 installs across 2 packages (no changes)",
+ "Checked 1 install across 2 packages (no changes)",
]);
expect(await exited2).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -2195,10 +2609,10 @@ it("should handle unscoped alias on scoped dependency", async () => {
" + @barn/moo@0.1.0",
" + moo@0.1.0",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
- expect(urls.sort()).toEqual([`${root_url}/@barn/moo`, `${root_url}/@barn/moo-0.1.0.tgz`]);
+ expect(urls.sort()).toEqual([`${root_url}/@barn%2fmoo`, `${root_url}/@barn/moo-0.1.0.tgz`]);
expect(requested).toBe(2);
expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "@barn", "moo"]);
expect(await readdirSorted(join(package_dir, "node_modules", "@barn"))).toEqual(["moo"]);
@@ -2255,7 +2669,7 @@ it("should handle scoped alias on unscoped dependency", async () => {
" + @baz/bar@0.0.2",
" + bar@0.0.2",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -2328,7 +2742,7 @@ it("should handle aliased dependency with existing lockfile", async () => {
]);
expect(await exited1).toBe(0);
expect(urls.sort()).toEqual([
- `${root_url}/@barn/moo`,
+ `${root_url}/@barn%2fmoo`,
`${root_url}/@barn/moo-0.1.0.tgz`,
`${root_url}/bar`,
`${root_url}/bar-0.0.2.tgz`,
@@ -2450,7 +2864,7 @@ it("should handle GitHub URL in dependencies (user/repo)", async () => {
let out = await new Response(stdout).text();
out = out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "");
out = out.replace(/(github:[^#]+)#[a-f0-9]+/, "$1");
- expect(out.split(/\r?\n/)).toEqual([" + uglify@github:mishoo/UglifyJS", "", " 1 packages installed"]);
+ expect(out.split(/\r?\n/)).toEqual([" + uglify@github:mishoo/UglifyJS", "", " 1 package installed"]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
expect(requested).toBe(0);
@@ -2504,7 +2918,7 @@ it("should handle GitHub URL in dependencies (user/repo#commit-id)", async () =>
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + uglify@github:mishoo/UglifyJS#e219a9a",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -2570,7 +2984,7 @@ it("should handle GitHub URL in dependencies (user/repo#tag)", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + uglify@github:mishoo/UglifyJS#e219a9a",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -2607,6 +3021,169 @@ it("should handle GitHub URL in dependencies (user/repo#tag)", async () => {
await access(join(package_dir, "bun.lockb"));
});
+it("should handle bitbucket git dependencies", async () => {
+ const deps = [
+ "bitbucket:dylan-conway/public-install-test",
+ "bitbucket.org:dylan-conway/public-install-test",
+ "bitbucket.com:dylan-conway/public-install-test",
+ "git@bitbucket.org:dylan-conway/public-install-test",
+ ];
+ for (const dep of deps) {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ dependencies: {
+ "public-install-test": dep,
+ },
+ }),
+ );
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ const out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ ` + public-install-test@git+ssh://${dep}#79265e2d9754c60b60f97cc8d859fb6da073b5d2`,
+ "",
+ " 1 package installed",
+ ]);
+ expect(await exited).toBe(0);
+ await access(join(package_dir, "bun.lockb"));
+ dummyAfterEach();
+ dummyBeforeEach();
+ }
+
+ for (const dep of deps) {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ }),
+ );
+
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "add", dep],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ const out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ "",
+ ` installed publicinstalltest@git+ssh://${dep}#79265e2d9754c60b60f97cc8d859fb6da073b5d2`,
+ "",
+ "",
+ " 1 package installed",
+ ]);
+ expect(await exited).toBe(0);
+ await access(join(package_dir, "bun.lockb"));
+ dummyAfterEach();
+ dummyBeforeEach();
+ }
+}, 20000);
+
+it("should handle gitlab git dependencies", async () => {
+ const deps = ["gitlab:dylan-conway/public-install-test", "gitlab.com:dylan-conway/public-install-test"];
+ for (const dep of deps) {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ dependencies: {
+ "public-install-test": dep,
+ },
+ }),
+ );
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ const out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ ` + public-install-test@git+ssh://${dep}#93f3aa4ec9ca8a0bacc010776db48bfcd915c44c`,
+ "",
+ " 1 package installed",
+ ]);
+ expect(await exited).toBe(0);
+ await access(join(package_dir, "bun.lockb"));
+ dummyAfterEach();
+ dummyBeforeEach();
+ }
+
+ for (const dep of deps) {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ }),
+ );
+
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "add", dep],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ const out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ "",
+ ` installed public-install-test@git+ssh://${dep}#93f3aa4ec9ca8a0bacc010776db48bfcd915c44c`,
+ "",
+ "",
+ " 1 package installed",
+ ]);
+ expect(await exited).toBe(0);
+ await access(join(package_dir, "bun.lockb"));
+ dummyAfterEach();
+ dummyBeforeEach();
+ }
+}, 10000);
+
it("should handle GitHub URL in dependencies (github:user/repo#tag)", async () => {
const urls: string[] = [];
setHandler(dummyRegistry(urls));
@@ -2636,7 +3213,7 @@ it("should handle GitHub URL in dependencies (github:user/repo#tag)", async () =
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + uglify@github:mishoo/UglifyJS#e219a9a",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -2704,7 +3281,7 @@ it("should handle GitHub URL in dependencies (https://github.com/user/repo.git)"
let out = await new Response(stdout).text();
out = out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "");
out = out.replace(/(github:[^#]+)#[a-f0-9]+/, "$1");
- expect(out.split(/\r?\n/)).toEqual([" + uglify@github:mishoo/UglifyJS", "", " 1 packages installed"]);
+ expect(out.split(/\r?\n/)).toEqual([" + uglify@github:mishoo/UglifyJS", "", " 1 package installed"]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
expect(requested).toBe(0);
@@ -2758,7 +3335,7 @@ it("should handle GitHub URL in dependencies (git://github.com/user/repo.git#com
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + uglify@github:mishoo/UglifyJS#e219a9a",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -2826,7 +3403,7 @@ it("should handle GitHub URL in dependencies (git+https://github.com/user/repo.g
let out = await new Response(stdout).text();
out = out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "");
out = out.replace(/(github:[^#]+)#[a-f0-9]+/, "$1");
- expect(out.split(/\r?\n/)).toEqual([" + uglify@github:mishoo/UglifyJS", "", " 1 packages installed"]);
+ expect(out.split(/\r?\n/)).toEqual([" + uglify@github:mishoo/UglifyJS", "", " 1 package installed"]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
expect(requested).toBe(0);
@@ -2851,6 +3428,172 @@ it("should handle GitHub URL in dependencies (git+https://github.com/user/repo.g
await access(join(package_dir, "bun.lockb"));
});
+it("should handle GitHub tarball URL in dependencies (https://github.com/user/repo/tarball/ref)", async () => {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "Foo",
+ version: "0.0.1",
+ dependencies: {
+ when: "https://github.com/cujojs/when/tarball/1.0.2",
+ },
+ }),
+ );
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ let out = await new Response(stdout).text();
+ out = out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "");
+ out = out.replace(/(github:[^#]+)#[a-f0-9]+/, "$1");
+ expect(out.split(/\r?\n/)).toEqual([
+ " + when@https://github.com/cujojs/when/tarball/1.0.2",
+ "",
+ " 1 package installed",
+ ]);
+ expect(await exited).toBe(0);
+ expect(urls.sort()).toBeEmpty();
+ expect(requested).toBe(0);
+ expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "when"]);
+ expect(await readdirSorted(join(package_dir, "node_modules", "when"))).toEqual([
+ ".gitignore",
+ ".gitmodules",
+ "LICENSE.txt",
+ "README.md",
+ "apply.js",
+ "cancelable.js",
+ "delay.js",
+ "package.json",
+ "test",
+ "timed.js",
+ "timeout.js",
+ "when.js",
+ ]);
+ const package_json = await file(join(package_dir, "node_modules", "when", "package.json")).json();
+ expect(package_json.name).toBe("when");
+ await access(join(package_dir, "bun.lockb"));
+});
+
+it("should handle GitHub tarball URL in dependencies (https://github.com/user/repo/tarball/ref) with custom GITHUB_API_URL", async () => {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "Foo",
+ version: "0.0.1",
+ dependencies: {
+ when: "https://github.com/cujojs/when/tarball/1.0.2",
+ },
+ }),
+ );
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env: {
+ ...env,
+ GITHUB_API_URL: "https://example.com/github/api",
+ },
+ });
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ let out = await new Response(stdout).text();
+ out = out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "");
+ out = out.replace(/(github:[^#]+)#[a-f0-9]+/, "$1");
+ expect(out.split(/\r?\n/)).toEqual([
+ " + when@https://github.com/cujojs/when/tarball/1.0.2",
+ "",
+ " 1 package installed",
+ ]);
+ expect(await exited).toBe(0);
+ expect(urls.sort()).toBeEmpty();
+ expect(requested).toBe(0);
+ expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "when"]);
+ expect(await readdirSorted(join(package_dir, "node_modules", "when"))).toEqual([
+ ".gitignore",
+ ".gitmodules",
+ "LICENSE.txt",
+ "README.md",
+ "apply.js",
+ "cancelable.js",
+ "delay.js",
+ "package.json",
+ "test",
+ "timed.js",
+ "timeout.js",
+ "when.js",
+ ]);
+ const package_json = await file(join(package_dir, "node_modules", "when", "package.json")).json();
+ expect(package_json.name).toBe("when");
+ await access(join(package_dir, "bun.lockb"));
+});
+
+it("should treat non-GitHub http(s) URLs as tarballs (https://some.url/path?stuff)", async () => {
+ const urls: string[] = [];
+ setHandler(
+ dummyRegistry(urls, {
+ "4.3.0": { as: "4.3.0" },
+ }),
+ );
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "Foo",
+ version: "0.0.1",
+ dependencies: {
+ "@vercel/turbopack-node":
+ "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230922.2",
+ },
+ }),
+ );
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ let out = await new Response(stdout).text();
+ out = out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "");
+ out = out.replace(/(github:[^#]+)#[a-f0-9]+/, "$1");
+ expect(out.split(/\r?\n/)).toEqual([
+ " + @vercel/turbopack-node@https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230922.2",
+ "",
+ " 2 packages installed",
+ ]);
+ expect(await exited).toBe(0);
+ expect(urls.sort()).toHaveLength(2);
+ expect(requested).toBe(2);
+ expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".cache", "@vercel", "loader-runner"]);
+ expect(await readdirSorted(join(package_dir, "node_modules", "@vercel"))).toEqual(["turbopack-node"]);
+ expect(await readdirSorted(join(package_dir, "node_modules", "@vercel", "turbopack-node"))).toEqual([
+ "package.json",
+ "src",
+ "tsconfig.json",
+ ]);
+ await access(join(package_dir, "bun.lockb"));
+});
+
it("should handle GitHub URL with existing lockfile", async () => {
const urls: string[] = [];
setHandler(dummyRegistry(urls));
@@ -3026,7 +3769,7 @@ it("should consider peerDependencies during hoisting", async () => {
}),
);
const { stdout, stderr, exited } = spawn({
- cmd: [bunExe(), "install", "--peer"],
+ cmd: [bunExe(), "install"],
cwd: package_dir,
stdout: null,
stdin: "pipe",
@@ -3077,6 +3820,105 @@ it("should consider peerDependencies during hoisting", async () => {
await access(join(package_dir, "bun.lockb"));
});
+it("should install peerDependencies when needed", async () => {
+ const urls: string[] = [];
+ setHandler(
+ dummyRegistry(urls, {
+ "0.0.3": {
+ bin: {
+ "baz-run": "index.js",
+ },
+ },
+ "0.0.5": {
+ bin: {
+ "baz-exec": "index.js",
+ },
+ },
+ }),
+ );
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ peerDependencies: {
+ baz: ">=0.0.3",
+ },
+ workspaces: ["bar", "moo"],
+ }),
+ );
+ await mkdir(join(package_dir, "bar"));
+ await writeFile(
+ join(package_dir, "bar", "package.json"),
+ JSON.stringify({
+ name: "bar",
+ version: "0.0.2",
+ dependencies: {
+ baz: "0.0.3",
+ },
+ }),
+ );
+ await mkdir(join(package_dir, "moo"));
+ await writeFile(
+ join(package_dir, "moo", "package.json"),
+ JSON.stringify({
+ name: "moo",
+ version: "0.0.4",
+ dependencies: {
+ baz: "0.0.5",
+ },
+ }),
+ );
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ const out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ " + bar@workspace:bar",
+ " + moo@workspace:moo",
+ "",
+ " 4 packages installed",
+ ]);
+ expect(await exited).toBe(0);
+ expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`, `${root_url}/baz-0.0.5.tgz`]);
+ expect(requested).toBe(3);
+ expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".bin", ".cache", "bar", "baz", "moo"]);
+ expect(await readdirSorted(join(package_dir, "node_modules", ".bin"))).toEqual(["baz-exec", "baz-run"]);
+ expect(await readlink(join(package_dir, "node_modules", ".bin", "baz-exec"))).toBe(
+ join("..", "..", "moo", "node_modules", "baz", "index.js"),
+ );
+ expect(await readlink(join(package_dir, "node_modules", ".bin", "baz-run"))).toBe(join("..", "baz", "index.js"));
+ expect(await readlink(join(package_dir, "node_modules", "bar"))).toBe(join("..", "bar"));
+ expect(await readdirSorted(join(package_dir, "bar"))).toEqual(["package.json"]);
+ expect(await readdirSorted(join(package_dir, "node_modules", "baz"))).toEqual(["index.js", "package.json"]);
+ expect(await file(join(package_dir, "node_modules", "baz", "package.json")).json()).toEqual({
+ name: "baz",
+ version: "0.0.3",
+ bin: {
+ "baz-run": "index.js",
+ },
+ });
+ expect(await readlink(join(package_dir, "node_modules", "moo"))).toBe(join("..", "moo"));
+ expect(await readdirSorted(join(package_dir, "moo"))).toEqual(["node_modules", "package.json"]);
+ expect(await file(join(package_dir, "moo", "node_modules", "baz", "package.json")).json()).toEqual({
+ name: "baz",
+ version: "0.0.5",
+ bin: {
+ "baz-exec": "index.js",
+ },
+ });
+ await access(join(package_dir, "bun.lockb"));
+});
+
it("should not regard peerDependencies declarations as duplicates", async () => {
const urls: string[] = [];
setHandler(dummyRegistry(urls));
@@ -3109,7 +3951,7 @@ it("should not regard peerDependencies declarations as duplicates", async () =>
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@0.0.2",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -3351,7 +4193,7 @@ it("should handle Git URL in dependencies", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + uglify-js@git+https://git@github.com/mishoo/UglifyJS.git",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -3412,7 +4254,7 @@ it("should handle Git URL in dependencies (SCP-style)", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + uglify@git+ssh://github.com:mishoo/UglifyJS.git",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -3471,7 +4313,7 @@ it("should handle Git URL with committish in dependencies", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + uglify@git+https://git@github.com/mishoo/UglifyJS.git#e219a9a78a0d2251e4dcbd4bb9034207eb484fe8",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -3614,7 +4456,7 @@ it("should de-duplicate committish in Git URLs", async () => {
" + uglify-hash@git+https://git@github.com/mishoo/UglifyJS.git#e219a9a78a0d2251e4dcbd4bb9034207eb484fe8",
" + uglify-ver@git+https://git@github.com/mishoo/UglifyJS.git#e219a9a78a0d2251e4dcbd4bb9034207eb484fe8",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -3902,7 +4744,7 @@ it("should prefer optionalDependencies over dependencies of the same name", asyn
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + baz@0.0.3",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]);
@@ -3955,7 +4797,7 @@ it("should prefer dependencies over peerDependencies of the same name", async ()
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + baz@0.0.5",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.5.tgz`]);
@@ -4000,7 +4842,7 @@ it("should handle tarball URL", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
` + baz@${root_url}/baz-0.0.3.tgz`,
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz-0.0.3.tgz`]);
@@ -4048,7 +4890,7 @@ it("should handle tarball path", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
` + baz@${join(import.meta.dir, "baz-0.0.3.tgz")}`,
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(requested).toBe(0);
@@ -4095,7 +4937,7 @@ it("should handle tarball URL with aliasing", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
` + bar@${root_url}/baz-0.0.3.tgz`,
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz-0.0.3.tgz`]);
@@ -4143,7 +4985,7 @@ it("should handle tarball path with aliasing", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
` + bar@${join(import.meta.dir, "baz-0.0.3.tgz")}`,
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(requested).toBe(0);
@@ -4770,7 +5612,7 @@ it("should ignore invalid workspaces from parent directory", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@0.0.2",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -4826,7 +5668,7 @@ it("should handle --cwd", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@0.0.2",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
@@ -4939,7 +5781,7 @@ cache = false
" + tsd@0.22.0",
" + typescript@5.0.4",
"",
- " 119 packages installed",
+ " 118 packages installed",
]);
expect(await exited1).toBe(0);
expect(await readdirSorted(package_dir)).toEqual(["bun.lockb", "bunfig.toml", "node_modules", "package.json"]);
@@ -4975,7 +5817,6 @@ cache = false
"fastq",
"fill-range",
"find-up",
- "function-bind",
"glob-parent",
"globby",
"hard-rejection",
@@ -5191,7 +6032,7 @@ it("should handle `workspaces:*` and `workspace:*` gracefully", async () => {
expect(out1.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@workspace:bar",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited1).toBe(0);
expect(requested).toBe(0);
@@ -5221,7 +6062,7 @@ it("should handle `workspaces:*` and `workspace:*` gracefully", async () => {
expect(out2.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@workspace:bar",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited2).toBe(0);
expect(requested).toBe(0);
@@ -5264,7 +6105,7 @@ it("should handle `workspaces:bar` and `workspace:*` gracefully", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@workspace:bar",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(requested).toBe(0);
@@ -5307,7 +6148,7 @@ it("should handle `workspaces:*` and `workspace:bar` gracefully", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@workspace:bar",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(requested).toBe(0);
@@ -5350,7 +6191,7 @@ it("should handle `workspaces:bar` and `workspace:bar` gracefully", async () =>
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@workspace:bar",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(requested).toBe(0);
@@ -5360,6 +6201,557 @@ it("should handle `workspaces:bar` and `workspace:bar` gracefully", async () =>
await access(join(package_dir, "bun.lockb"));
});
+it("should handle installing packages from inside a workspace with `*`", async () => {
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "main",
+ workspaces: ["packages/*"],
+ private: true,
+ }),
+ );
+ await mkdir(join(package_dir, "packages", "yolo"), { recursive: true });
+ const yolo_package = JSON.stringify({
+ name: "yolo",
+ version: "0.0.1",
+ dependencies: {
+ swag: "workspace:*",
+ },
+ });
+ await writeFile(join(package_dir, "packages", "yolo", "package.json"), yolo_package);
+ await mkdir(join(package_dir, "packages", "swag"));
+ const swag_package = JSON.stringify({
+ name: "swag",
+ version: "0.0.1",
+ });
+ await writeFile(join(package_dir, "packages", "swag", "package.json"), swag_package);
+ const {
+ stdout: stdout1,
+ stderr: stderr1,
+ exited: exited1,
+ } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: join(package_dir, "packages", "yolo"),
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr1).toBeDefined();
+ const err1 = await new Response(stderr1).text();
+ expect(err1).toContain("Saved lockfile");
+ expect(stdout1).toBeDefined();
+ const out1 = await new Response(stdout1).text();
+ expect(out1.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ " + swag@workspace:packages/swag",
+ " + yolo@workspace:packages/yolo",
+ "",
+ " 2 packages installed",
+ ]);
+ expect(await exited1).toBe(0);
+ expect(requested).toBe(0);
+ await access(join(package_dir, "bun.lockb"));
+
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+
+ const {
+ stdout: stdout2,
+ stderr: stderr2,
+ exited: exited2,
+ } = spawn({
+ cmd: [bunExe(), "install", "bar"],
+ cwd: join(package_dir, "packages", "yolo"),
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr1).toBeDefined();
+ const err2 = await new Response(stderr2).text();
+ expect(err2).toContain("Saved lockfile");
+ expect(stdout2).toBeDefined();
+ const out2 = await new Response(stdout2).text();
+ expect(out2).toContain("installed bar");
+ expect(await exited2).toBe(0);
+ expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
+ await access(join(package_dir, "bun.lockb"));
+});
+
+it("should handle installing packages from inside a workspace without prefix", async () => {
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "main",
+ workspaces: ["packages/*"],
+ private: true,
+ }),
+ );
+ await mkdir(join(package_dir, "packages", "p1"), { recursive: true });
+ const p1_package = JSON.stringify({
+ name: "p1",
+ version: "0.0.1",
+ dependencies: {
+ p2: "0.1.0",
+ },
+ });
+ await writeFile(join(package_dir, "packages", "p1", "package.json"), p1_package);
+
+ await mkdir(join(package_dir, "packages", "p2"));
+ const p2_package = JSON.stringify({
+ name: "p2",
+ version: "0.1.0",
+ });
+ await writeFile(join(package_dir, "packages", "p2", "package.json"), p2_package);
+
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+
+ const {
+ stdout: stdout1,
+ stderr: stderr1,
+ exited: exited1,
+ } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: join(package_dir, "packages", "p1"),
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr1).toBeDefined();
+ const err1 = await new Response(stderr1).text();
+ expect(err1).toContain("Saved lockfile");
+ expect(stdout1).toBeDefined();
+ const out1 = await new Response(stdout1).text();
+ expect(out1.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ " + p1@workspace:packages/p1",
+ " + p2@workspace:packages/p2",
+ "",
+ " 2 packages installed",
+ ]);
+ expect(await exited1).toBe(0);
+ expect(requested).toBe(0);
+ await access(join(package_dir, "bun.lockb"));
+
+ const {
+ stdout: stdout2,
+ stderr: stderr2,
+ exited: exited2,
+ } = spawn({
+ cmd: [bunExe(), "install", "bar"],
+ cwd: join(package_dir, "packages", "p1"),
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr1).toBeDefined();
+ const err2 = await new Response(stderr2).text();
+ expect(err2).toContain("Saved lockfile");
+ expect(stdout2).toBeDefined();
+ const out2 = await new Response(stdout2).text();
+ expect(out2).toContain("installed bar");
+ expect(await exited2).toBe(0);
+ expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
+ await access(join(package_dir, "bun.lockb"));
+});
+
+it("should handle installing packages inside workspaces with difference versions", async () => {
+ let package_jsons = [
+ JSON.stringify({
+ name: "main",
+ workspaces: ["packages/*"],
+ private: true,
+ }),
+ JSON.stringify({
+ name: "main",
+ private: true,
+ workspaces: [
+ "packages/package1",
+ "packages/package2",
+ "packages/package3",
+ "packages/package4",
+ "packages/package5",
+ ],
+ }),
+ ];
+ await mkdir(join(package_dir, "packages", "package1"), { recursive: true });
+ await mkdir(join(package_dir, "packages", "package2"));
+ await mkdir(join(package_dir, "packages", "package3"));
+ await mkdir(join(package_dir, "packages", "package4"));
+ await mkdir(join(package_dir, "packages", "package5"));
+ {
+ const package1 = JSON.stringify({
+ name: "package1",
+ version: "0.0.2",
+ });
+ await writeFile(join(package_dir, "packages", "package1", "package.json"), package1);
+ }
+ {
+ const package2 = JSON.stringify({
+ name: "package2",
+ version: "0.0.1",
+ dependencies: {
+ package1: "workspace:*",
+ },
+ });
+ await writeFile(join(package_dir, "packages", "package2", "package.json"), package2);
+ }
+ {
+ const package3 = JSON.stringify({
+ name: "package3",
+ version: "0.0.1",
+ dependencies: {
+ package1: "workspace:^",
+ },
+ });
+ await writeFile(join(package_dir, "packages", "package3", "package.json"), package3);
+ }
+ {
+ const package4 = JSON.stringify({
+ name: "package4",
+ version: "0.0.1",
+ dependencies: {
+ package1: "workspace:../package1",
+ },
+ });
+ await writeFile(join(package_dir, "packages", "package4", "package.json"), package4);
+ }
+ {
+ const package5 = JSON.stringify({
+ name: "package5",
+ version: "0.0.1",
+ dependencies: {
+ package1: "workspace:0.0.2",
+ },
+ });
+ await writeFile(join(package_dir, "packages", "package5", "package.json"), package5);
+ }
+ for (const package_json of package_jsons) {
+ await writeFile(join(package_dir, "package.json"), package_json);
+
+ {
+ const package1 = JSON.stringify({
+ name: "package1",
+ version: "0.0.2",
+ });
+ await writeFile(join(package_dir, "packages", "package1", "package.json"), package1);
+ }
+ {
+ const package2 = JSON.stringify({
+ name: "package2",
+ version: "0.0.1",
+ dependencies: {
+ package1: "workspace:*",
+ },
+ });
+ await writeFile(join(package_dir, "packages", "package2", "package.json"), package2);
+ }
+ {
+ const package3 = JSON.stringify({
+ name: "package3",
+ version: "0.0.1",
+ dependencies: {
+ package1: "workspace:^",
+ },
+ });
+ await writeFile(join(package_dir, "packages", "package3", "package.json"), package3);
+ }
+ {
+ const package4 = JSON.stringify({
+ name: "package4",
+ version: "0.0.1",
+ dependencies: {
+ package1: "workspace:../package1",
+ },
+ });
+ await writeFile(join(package_dir, "packages", "package4", "package.json"), package4);
+ }
+ {
+ const package5 = JSON.stringify({
+ name: "package5",
+ version: "0.0.1",
+ dependencies: {
+ package1: "workspace:0.0.2",
+ },
+ });
+ await writeFile(join(package_dir, "packages", "package5", "package.json"), package5);
+ }
+
+ const {
+ stdout: stdout1,
+ stderr: stderr1,
+ exited: exited1,
+ } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: join(package_dir, "packages", "package2"),
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr1).toBeDefined();
+ const err1 = await new Response(stderr1).text();
+ expect(err1).toContain("Saved lockfile");
+ const out1 = await new Response(stdout1).text();
+ expect(out1.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ " + package1@workspace:packages/package1",
+ " + package2@workspace:packages/package2",
+ " + package3@workspace:packages/package3",
+ " + package4@workspace:packages/package4",
+ " + package5@workspace:packages/package5",
+ "",
+ " 5 packages installed",
+ ]);
+ expect(await exited1).toBe(0);
+ await access(join(package_dir, "bun.lockb"));
+
+ var urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+
+ const {
+ stdout: stdout1_2,
+ stderr: stderr1_2,
+ exited: exited1_2,
+ } = spawn({
+ cmd: [bunExe(), "install", "bar"],
+ cwd: join(package_dir, "packages", "package2"),
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr1_2).toBeDefined();
+ expect(stderr1_2).toBeDefined();
+ const err1_2 = await new Response(stderr1_2).text();
+ expect(err1_2).toContain("Saved lockfile");
+ expect(stdout1_2).toBeDefined();
+ const out1_2 = await new Response(stdout1_2).text();
+ expect(out1_2).toContain("installed bar");
+ expect(await exited1_2).toBe(0);
+ expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
+ await access(join(package_dir, "bun.lockb"));
+
+ await rm(join(package_dir, "node_modules"), { force: true, recursive: true });
+ await rm(join(package_dir, "bun.lockb"), { force: true, recursive: true });
+
+ const {
+ stdout: stdout2,
+ stderr: stderr2,
+ exited: exited2,
+ } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: join(package_dir, "packages", "package3"),
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr2).toBeDefined();
+ const err2 = await new Response(stderr2).text();
+ expect(err2).toContain("Saved lockfile");
+ expect(stdout2).toBeDefined();
+ const out2 = await new Response(stdout2).text();
+ expect(out2.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ " + package1@workspace:packages/package1",
+ " + package2@workspace:packages/package2",
+ " + package3@workspace:packages/package3",
+ " + package4@workspace:packages/package4",
+ " + package5@workspace:packages/package5",
+ "",
+ " 6 packages installed",
+ ]);
+ expect(await exited2).toBe(0);
+
+ const {
+ stdout: stdout2_2,
+ stderr: stderr2_2,
+ exited: exited2_2,
+ } = spawn({
+ cmd: [bunExe(), "install", "bar"],
+ cwd: join(package_dir, "packages", "package3"),
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr2_2).toBeDefined();
+ expect(stderr2_2).toBeDefined();
+ const err2_2 = await new Response(stderr2_2).text();
+ expect(err2_2).toContain("Saved lockfile");
+ expect(stdout2_2).toBeDefined();
+ const out2_2 = await new Response(stdout2_2).text();
+ expect(out2_2).toContain("installed bar");
+ expect(await exited2_2).toBe(0);
+ await access(join(package_dir, "bun.lockb"));
+
+ await rm(join(package_dir, "node_modules"), { force: true, recursive: true });
+ await rm(join(package_dir, "bun.lockb"), { force: true, recursive: true });
+
+ const {
+ stdout: stdout3,
+ stderr: stderr3,
+ exited: exited3,
+ } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: join(package_dir, "packages", "package4"),
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr2).toBeDefined();
+ const err3 = await new Response(stderr3).text();
+ expect(err3).toContain("Saved lockfile");
+ expect(stdout3).toBeDefined();
+ const out3 = await new Response(stdout3).text();
+ expect(out3.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ " + package1@workspace:packages/package1",
+ " + package2@workspace:packages/package2",
+ " + package3@workspace:packages/package3",
+ " + package4@workspace:packages/package4",
+ " + package5@workspace:packages/package5",
+ "",
+ " 6 packages installed",
+ ]);
+ expect(await exited3).toBe(0);
+
+ const {
+ stdout: stdout3_2,
+ stderr: stderr3_2,
+ exited: exited3_2,
+ } = spawn({
+ cmd: [bunExe(), "install", "bar"],
+ cwd: join(package_dir, "packages", "package4"),
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr3_2).toBeDefined();
+ expect(stderr3_2).toBeDefined();
+ const err3_2 = await new Response(stderr3_2).text();
+ expect(err3_2).toContain("Saved lockfile");
+ expect(stdout3_2).toBeDefined();
+ const out3_2 = await new Response(stdout3_2).text();
+ expect(out3_2).toContain("installed bar");
+ expect(await exited3_2).toBe(0);
+ await access(join(package_dir, "bun.lockb"));
+
+ await rm(join(package_dir, "node_modules"), { force: true, recursive: true });
+ await rm(join(package_dir, "bun.lockb"), { force: true, recursive: true });
+
+ const {
+ stdout: stdout4,
+ stderr: stderr4,
+ exited: exited4,
+ } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: join(package_dir, "packages", "package5"),
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr4).toBeDefined();
+ const err4 = await new Response(stderr4).text();
+ expect(err4).toContain("Saved lockfile");
+ expect(stdout4).toBeDefined();
+ const out4 = await new Response(stdout4).text();
+ expect(out4.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ " + package1@workspace:packages/package1",
+ " + package2@workspace:packages/package2",
+ " + package3@workspace:packages/package3",
+ " + package4@workspace:packages/package4",
+ " + package5@workspace:packages/package5",
+ "",
+ " 6 packages installed",
+ ]);
+ expect(await exited4).toBe(0);
+
+ const {
+ stdout: stdout4_2,
+ stderr: stderr4_2,
+ exited: exited4_2,
+ } = spawn({
+ cmd: [bunExe(), "install", "bar"],
+ cwd: join(package_dir, "packages", "package5"),
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr4_2).toBeDefined();
+ expect(stderr4_2).toBeDefined();
+ const err4_2 = await new Response(stderr4_2).text();
+ expect(err4_2).toContain("Saved lockfile");
+ expect(stdout4_2).toBeDefined();
+ const out4_2 = await new Response(stdout4_2).text();
+ expect(out4_2).toContain("installed bar");
+ expect(await exited4_2).toBe(0);
+ await access(join(package_dir, "bun.lockb"));
+
+ // from the root
+ await rm(join(package_dir, "node_modules"), { force: true, recursive: true });
+ await rm(join(package_dir, "bun.lockb"), { force: true, recursive: true });
+
+ const {
+ stdout: stdout5,
+ stderr: stderr5,
+ exited: exited5,
+ } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: join(package_dir),
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr5).toBeDefined();
+ const err5 = await new Response(stderr5).text();
+ expect(err5).toContain("Saved lockfile");
+ expect(stdout5).toBeDefined();
+ const out5 = await new Response(stdout5).text();
+ expect(out5.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ " + package1@workspace:packages/package1",
+ " + package2@workspace:packages/package2",
+ " + package3@workspace:packages/package3",
+ " + package4@workspace:packages/package4",
+ " + package5@workspace:packages/package5",
+ "",
+ " 6 packages installed",
+ ]);
+ expect(await exited5).toBe(0);
+
+ const {
+ stdout: stdout5_2,
+ stderr: stderr5_2,
+ exited: exited5_2,
+ } = spawn({
+ cmd: [bunExe(), "install", "bar"],
+ cwd: join(package_dir),
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(stderr5_2).toBeDefined();
+ expect(stderr5_2).toBeDefined();
+ const err5_2 = await new Response(stderr5_2).text();
+ expect(err5_2).toContain("Saved lockfile");
+ expect(stdout5_2).toBeDefined();
+ const out5_2 = await new Response(stdout5_2).text();
+ expect(out5_2).toContain("installed bar");
+ expect(await exited5_2).toBe(0);
+ await access(join(package_dir, "bun.lockb"));
+
+ await rm(join(package_dir, "node_modules"), { force: true, recursive: true });
+ await rm(join(package_dir, "bun.lockb"), { force: true, recursive: true });
+ await rm(join(package_dir, "package.json"));
+ }
+});
+
it("should override npm dependency by matching workspace", async () => {
const urls: string[] = [];
setHandler(dummyRegistry(urls));
@@ -5395,7 +6787,7 @@ it("should override npm dependency by matching workspace", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@workspace:bar",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -5485,7 +6877,7 @@ it("should override @scoped npm dependency by matching workspace", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + @bar/baz@workspace:packages/bar-baz",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -5534,7 +6926,7 @@ it("should override aliased npm dependency by matching workspace", async () => {
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + bar@workspace:baz",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited).toBe(0);
expect(urls.sort()).toBeEmpty();
@@ -6009,6 +7401,39 @@ it("should handle `workspace:*` on both root & child", async () => {
await access(join(package_dir, "bun.lockb"));
});
+it("should install peer dependencies from root package", async () => {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ peerDependencies: {
+ bar: "0.0.2",
+ },
+ }),
+ );
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ env,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ });
+ expect(stderr).toBeDefined();
+ const err = await new Response(stderr).text();
+ expect(err).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ const out = await new Response(stdout).text();
+ expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual(["", " 1 package installed"]);
+ expect(await exited).toBe(0);
+ expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
+ expect(requested).toBe(2);
+
+ await access(join(package_dir, "bun.lockb"));
+});
+
describe("Registry URLs", () => {
// Some of the non failing URLs are invalid, but bun's URL parser ignores
// the validation error and returns a valid serialized URL anyway.
@@ -6020,16 +7445,17 @@ describe("Registry URLs", () => {
["example", true],
["https://example.com:demo", true],
["http://[www.example.com]/", true],
- ["c:", true],
["c:a", true],
["https://registry.npmjs.org/", false],
["https://artifactory.xxx.yyy/artifactory/api/npm/my-npm/", false], // https://github.com/oven-sh/bun/issues/3899
- ["", false],
+ ["https://artifactory.xxx.yyy/artifactory/api/npm/my-npm", false], // https://github.com/oven-sh/bun/issues/5368
+ // ["", true],
["https:example.org", false],
["https://////example.com///", false],
["https://example.com/https:example.org", false],
["https://example.com/[]?[]#[]", false],
["https://example/%?%#%", false],
+ ["c:", true],
["c:/", false],
["https://點看", false], // gets converted to punycode
["https://xn--c1yn36f/", false],
@@ -6068,10 +7494,10 @@ describe("Registry URLs", () => {
const err = await new Response(stderr).text();
if (fails) {
- expect(err.includes(`Failed to join registry \"${regURL}\" and package \"notapackage\" URLs`)).toBeTrue();
- expect(err.includes("error: InvalidURL")).toBeTrue();
+ expect(err).toContain(`Failed to join registry "${regURL}" and package "notapackage" URLs`);
+ expect(err).toContain("error: InvalidURL");
} else {
- expect(err.includes("error: notapackage@0.0.2 failed to resolve")).toBeTrue();
+ expect(err).toContain("error: notapackage@0.0.2 failed to resolve");
}
// fails either way, since notapackage is, well, not a real package.
expect(await exited).not.toBe(0);
@@ -6108,8 +7534,8 @@ describe("Registry URLs", () => {
expect(stderr).toBeDefined();
const err = await new Response(stderr).text();
- expect(err.includes(`Failed to join registry \"${regURL}\" and package \"notapackage\" URLs`)).toBeTrue();
- expect(err.includes("warn: InvalidURL")).toBeTrue();
+ expect(err).toContain(`Failed to join registry "${regURL}" and package "notapackage" URLs`);
+ expect(err).toContain("warn: InvalidURL");
expect(await exited).toBe(0);
});
@@ -6149,8 +7575,8 @@ describe("Registry URLs", () => {
expect(stderr).toBeDefined();
const err = await new Response(stderr).text();
- expect(err.includes(`Failed to join registry \"${regURL}\" and package \"notapackage\" URLs`)).toBeTrue();
- expect(err.includes("warn: InvalidURL")).toBeTrue();
+ expect(err).toContain(`Failed to join registry "${regURL}" and package "notapackage" URLs`);
+ expect(err).toContain("warn: InvalidURL");
expect(await exited).toBe(0);
});
diff --git a/test/cli/install/bun-link.test.ts b/test/cli/install/bun-link.test.ts
index 39872b072..5d2fffc39 100644
--- a/test/cli/install/bun-link.test.ts
+++ b/test/cli/install/bun-link.test.ts
@@ -85,7 +85,7 @@ it("should link package", async () => {
` installed ${link_name}@link:${link_name}`,
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited2).toBe(0);
@@ -186,7 +186,7 @@ it("should link scoped package", async () => {
` installed ${link_name}@link:${link_name}`,
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited2).toBe(0);
@@ -292,7 +292,7 @@ it("should link dependency without crashing", async () => {
expect(out2.replace(/\s*\[[0-9\.]+ms\]\s*$/, "").split(/\r?\n/)).toEqual([
` + ${link_name}@link:${link_name}`,
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited2).toBe(0);
expect(await readdirSorted(join(package_dir, "node_modules"))).toEqual([".bin", ".cache", link_name].sort());
@@ -341,6 +341,6 @@ it("should link dependency without crashing", async () => {
expect(err4).toContain(`error: FileNotFound installing ${link_name}`);
expect(stdout4).toBeDefined();
const out4 = await new Response(stdout4).text();
- expect(out4.replace(/\[[0-9\.]+m?s\]/, "[]").split(/\r?\n/)).toEqual(["Failed to install 1 packages", "[] done", ""]);
+ expect(out4.replace(/\[[0-9\.]+m?s\]/, "[]").split(/\r?\n/)).toEqual(["Failed to install 1 package", "[] done", ""]);
expect(await exited4).toBe(0);
});
diff --git a/test/cli/install/bun-pm.test.ts b/test/cli/install/bun-pm.test.ts
index 23b73dfae..06ffb4c45 100644
--- a/test/cli/install/bun-pm.test.ts
+++ b/test/cli/install/bun-pm.test.ts
@@ -1,7 +1,7 @@
-import { spawn } from "bun";
+import { hash, spawn } from "bun";
import { afterAll, afterEach, beforeAll, beforeEach, expect, it } from "bun:test";
-import { bunExe, bunEnv as env } from "harness";
-import { mkdir, writeFile } from "fs/promises";
+import { bunEnv, bunExe, bunEnv as env } from "harness";
+import { mkdir, writeFile, exists } from "fs/promises";
import { join } from "path";
import {
dummyAfterAll,
@@ -10,10 +10,12 @@ import {
dummyBeforeEach,
dummyRegistry,
package_dir,
+ readdirSorted,
requested,
root_url,
setHandler,
} from "./dummy.registry";
+import { cpSync, rmSync } from "js/node/fs/export-star-from";
beforeAll(dummyBeforeAll);
afterAll(dummyAfterAll);
@@ -245,3 +247,125 @@ it("should list aliased dependencies", async () => {
expect(urls.sort()).toEqual([]);
expect(requested).toBe(2);
});
+
+it("should remove all cache", async () => {
+ const urls: string[] = [];
+ setHandler(dummyRegistry(urls));
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ version: "0.0.1",
+ dependencies: {
+ "moo-1": "./moo",
+ },
+ }),
+ );
+ await mkdir(join(package_dir, "moo"));
+ await writeFile(
+ join(package_dir, "moo", "package.json"),
+ JSON.stringify({
+ name: "moo",
+ version: "0.1.0",
+ dependencies: {
+ "bar-1": "npm:bar",
+ },
+ }),
+ );
+ let cache_dir: string = join(package_dir, "node_modules", ".cache");
+ expect(
+ await spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env: {
+ ...env,
+ BUN_INSTALL_CACHE_DIR: cache_dir,
+ },
+ }).exited,
+ ).toBe(0);
+ expect(urls.sort()).toEqual([`${root_url}/bar`, `${root_url}/bar-0.0.2.tgz`]);
+ expect(requested).toBe(2);
+ expect(await readdirSorted(cache_dir)).toContain("bar");
+
+ const {
+ stdout: stdout1,
+ stderr: stderr1,
+ exited: exited1,
+ } = spawn({
+ cmd: [bunExe(), "pm", "cache"],
+ cwd: package_dir,
+ stdout: "pipe",
+ stdin: "pipe",
+ stderr: "pipe",
+ env: {
+ ...env,
+ BUN_INSTALL_CACHE_DIR: cache_dir,
+ },
+ });
+ expect(stderr1).toBeDefined();
+ expect(await new Response(stderr1).text()).toBe("");
+ expect(stdout1).toBeDefined();
+ expect(await new Response(stdout1).text()).toBe(cache_dir);
+ expect(await exited1).toBe(0);
+
+ const {
+ stdout: stdout2,
+ stderr: stderr2,
+ exited: exited2,
+ } = spawn({
+ cmd: [bunExe(), "pm", "cache", "rm"],
+ cwd: package_dir,
+ stdout: "pipe",
+ stdin: "pipe",
+ stderr: "pipe",
+ env: {
+ ...env,
+ BUN_INSTALL_CACHE_DIR: cache_dir,
+ },
+ });
+ expect(stderr2).toBeDefined();
+ expect(await new Response(stderr2).text()).toBe("");
+ expect(stdout2).toBeDefined();
+ expect(await new Response(stdout2).text()).toBe("Cache directory deleted:\n " + cache_dir + "\n");
+ expect(await exited2).toBe(0);
+ expect(await exists(cache_dir)).toBeFalse();
+});
+
+import { tmpdir } from "os";
+it("bun pm migrate", async () => {
+ const test_dir = join(tmpdir(), "contoso-test" + Math.random().toString(36).slice(2));
+
+ cpSync(join(import.meta.dir, "migration/contoso-test"), test_dir, { recursive: true });
+
+ const { stdout, stderr, exitCode } = Bun.spawnSync({
+ cmd: [bunExe(), "pm", "migrate", "--force"],
+ cwd: test_dir,
+ stdout: "pipe",
+ stdin: "pipe",
+ stderr: "pipe",
+ env: bunEnv,
+ });
+ expect(exitCode).toBe(0);
+
+ expect(stderr).toBeDefined();
+ expect(stdout).toBeDefined();
+
+ expect(stdout.toString("utf-8")).toBe("");
+ expect(stderr.toString("utf-8")).toEndWith("migrated lockfile from package-lock.json\n");
+
+ const hashExec = Bun.spawnSync({
+ cmd: [bunExe(), "pm", "hash"],
+ cwd: test_dir,
+ stdout: "pipe",
+ stdin: "pipe",
+ stderr: "pipe",
+ env: bunEnv,
+ });
+ expect(hashExec.exitCode).toBe(0);
+ const hash = hashExec.stdout.toString("utf-8").trim();
+
+ expect(hash).toMatchSnapshot();
+});
diff --git a/test/cli/install/bun-remove.test.ts b/test/cli/install/bun-remove.test.ts
index 5b029f143..2b70900dd 100644
--- a/test/cli/install/bun-remove.test.ts
+++ b/test/cli/install/bun-remove.test.ts
@@ -102,7 +102,7 @@ it("should remove existing package", async () => {
expect(out1.replace(/\s*\[[0-9\.]+m?s\]/, "").split(/\r?\n/)).toEqual([
` + pkg2@${pkg2_path}`,
"",
- " 1 packages installed",
+ " 1 package installed",
" Removed: 1",
"",
]);
diff --git a/test/cli/install/bun-run.test.ts b/test/cli/install/bun-run.test.ts
index 6bf910951..3c12086b1 100644
--- a/test/cli/install/bun-run.test.ts
+++ b/test/cli/install/bun-run.test.ts
@@ -87,39 +87,81 @@ for (let withRun of [false, true]) {
expect(exitCode).toBe(0);
});
- it("valid tsconfig.json with invalid extends doesn't crash", async () => {
- await writeFile(
- join(run_dir, "package.json"),
- JSON.stringify({
- name: "test",
- version: "0.0.0",
- scripts: {},
- }),
- );
- await writeFile(
- join(run_dir, "tsconfig.json"),
- JSON.stringify(
- {
- extends: "!!!bad!!!",
- },
- null,
- 2,
- ),
- );
+ it("--silent omits error messages", async () => {
+ const { stdout, stderr, exitCode } = spawnSync({
+ cmd: [bunExe(), "run", "--silent", "bash", "-c", "exit 1"],
+ cwd: run_dir,
+ env: bunEnv,
+ });
- await writeFile(join(run_dir, "index.js"), "console.log('hi')");
+ expect(stderr.toString()).toBe("");
+ expect(stdout.toString()).toBe("");
+ expect(exitCode).toBe(1);
+ });
+ it("no --silent includes error messages", async () => {
const { stdout, stderr, exitCode } = spawnSync({
- cmd: [bunExe(), "--silent", withRun ? "run" : "", "./index.js"].filter(Boolean),
+ cmd: [bunExe(), "run", "bash", "-c", "exit 1"],
cwd: run_dir,
env: bunEnv,
});
- expect(stderr.toString().trim()).toContain("FileNotFound loading tsconfig.json extends");
- expect(stdout.toString()).toBe("hi\n");
- expect(exitCode).toBe(0);
+ expect(stderr.toString()).toStartWith('error: "bash" exited with code 1');
+ expect(exitCode).toBe(1);
});
+ for (let withLogLevel of [true, false]) {
+ it(
+ "valid tsconfig.json with invalid extends doesn't crash" + (withLogLevel ? " (log level debug)" : ""),
+ async () => {
+ await writeFile(
+ join(run_dir, "package.json"),
+ JSON.stringify({
+ name: "test",
+ version: "0.0.0",
+ scripts: {},
+ }),
+ );
+ if (withLogLevel)
+ await writeFile(
+ join(run_dir, "bunfig.toml"),
+ `
+logLevel = "debug"
+ `,
+ );
+
+ await writeFile(
+ join(run_dir, "tsconfig.json"),
+ JSON.stringify(
+ {
+ extends: "!!!bad!!!",
+ },
+ null,
+ 2,
+ ),
+ );
+
+ await writeFile(join(run_dir, "index.js"), "console.log('hi')");
+
+ const { stdout, stderr, exitCode } = spawnSync({
+ // TODO: figure out why -c is necessary here.
+ cmd: [bunExe(), withRun ? "run" : "", "-c=" + join(run_dir, "bunfig.toml"), "./index.js"].filter(Boolean),
+ cwd: run_dir,
+ env: bunEnv,
+ });
+ if (withLogLevel) {
+ expect(stderr.toString().trim()).toContain("FileNotFound loading tsconfig.json extends");
+ } else {
+ expect(stderr.toString().trim()).not.toContain("FileNotFound loading tsconfig.json extends");
+ }
+
+ expect(stdout.toString()).toBe("hi\n");
+ expect(exitCode).toBe(0);
+ await rm(join(run_dir, "bunfig.toml"), { force: true });
+ },
+ );
+ }
+
it("falling back to index with no package.json", async () => {
await writeFile(join(run_dir, "index.ts"), "console.log('Hello, world!');");
diff --git a/test/cli/install/bun-update.test.ts b/test/cli/install/bun-update.test.ts
index 2a6ee4eaf..7cdfb3a97 100644
--- a/test/cli/install/bun-update.test.ts
+++ b/test/cli/install/bun-update.test.ts
@@ -1,7 +1,7 @@
import { file, listen, Socket, spawn } from "bun";
import { afterAll, afterEach, beforeAll, beforeEach, expect, it } from "bun:test";
import { bunExe, bunEnv as env } from "harness";
-import { access, mkdir, readlink, realpath, rm, writeFile } from "fs/promises";
+import { readFile, access, mkdir, readlink, realpath, rm, writeFile } from "fs/promises";
import { join } from "path";
import {
dummyAfterAll,
@@ -67,7 +67,7 @@ it("should update to latest version of dependency", async () => {
expect(out1.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
" + baz@0.0.3",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited1).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.3.tgz`]);
@@ -113,7 +113,7 @@ it("should update to latest version of dependency", async () => {
" - baz-exec",
"",
"",
- " 1 packages installed",
+ " 1 package installed",
]);
expect(await exited2).toBe(0);
expect(urls.sort()).toEqual([`${root_url}/baz`, `${root_url}/baz-0.0.5.tgz`]);
@@ -185,7 +185,7 @@ it("should update to latest versions of dependencies", async () => {
]);
expect(await exited1).toBe(0);
expect(urls.sort()).toEqual([
- `${root_url}/@barn/moo`,
+ `${root_url}/@barn%2fmoo`,
`${root_url}/@barn/moo-0.1.0.tgz`,
`${root_url}/baz`,
`${root_url}/baz-0.0.3.tgz`,
@@ -236,7 +236,7 @@ it("should update to latest versions of dependencies", async () => {
]);
expect(await exited2).toBe(0);
expect(urls.sort()).toEqual([
- `${root_url}/@barn/moo`,
+ `${root_url}/@barn%2fmoo`,
`${root_url}/@barn/moo-0.1.0.tgz`,
`${root_url}/baz`,
`${root_url}/baz-0.0.5.tgz`,
@@ -257,3 +257,71 @@ it("should update to latest versions of dependencies", async () => {
});
await access(join(package_dir, "bun.lockb"));
});
+
+it("lockfile should not be modified when there are no version changes, issue#5888", async () => {
+ // Install packages
+ const urls: string[] = [];
+ const registry = {
+ "0.0.3": {
+ bin: {
+ "baz-run": "index.js",
+ },
+ },
+ latest: "0.0.3",
+ };
+ setHandler(dummyRegistry(urls, registry));
+ await writeFile(
+ join(package_dir, "package.json"),
+ JSON.stringify({
+ name: "foo",
+ dependencies: {
+ baz: "0.0.3",
+ },
+ }),
+ );
+ const { stdout, stderr, exited } = spawn({
+ cmd: [bunExe(), "install"],
+ cwd: package_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(await exited).toBe(0);
+ const err1 = await new Response(stderr).text();
+ expect(err1).not.toContain("error:");
+ expect(err1).toContain("Saved lockfile");
+ expect(stdout).toBeDefined();
+ const out1 = await new Response(stdout).text();
+ expect(out1.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
+ " + baz@0.0.3",
+ "",
+ " 1 package installed",
+ ]);
+
+ // Test if the lockb has been modified by `bun update`.
+ const getLockbContent = async () => {
+ const { exited } = spawn({
+ cmd: [bunExe(), "update"],
+ cwd: package_dir, // package.json is not changed
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+ expect(await exited).toBe(0);
+ return await readFile(join(package_dir, "bun.lockb"));
+ };
+
+ let prev = await getLockbContent();
+ urls.length = 0;
+ const count = 5;
+ for (let i = 0; i < count; i++) {
+ const content = await getLockbContent();
+ expect(prev).toStrictEqual(content);
+ prev = content;
+ }
+
+ // Assert we actually made a request to the registry for each update
+ expect(urls).toHaveLength(count);
+});
diff --git a/test/cli/install/bunx.test.ts b/test/cli/install/bunx.test.ts
index 70d7aac29..b8baceb1b 100644
--- a/test/cli/install/bunx.test.ts
+++ b/test/cli/install/bunx.test.ts
@@ -15,6 +15,26 @@ afterEach(async () => {
await rm(x_dir, { force: true, recursive: true });
});
+it("should choose the tagged versions instead of the PATH versions when a tag is specified", async () => {
+ const processes = Array.from({ length: 3 }, (_, i) => {
+ return spawn({
+ cmd: [bunExe(), "x", "semver@7.5." + i, "--help"],
+ cwd: x_dir,
+ stdout: "pipe",
+ stdin: "ignore",
+ stderr: "inherit",
+ env,
+ });
+ });
+
+ const results = await Promise.all(processes.map(p => p.exited));
+ expect(results).toEqual([0, 0, 0]);
+ const outputs = (await Promise.all(processes.map(p => new Response(p.stdout).text()))).map(a =>
+ a.substring(0, a.indexOf("\n")),
+ );
+ expect(outputs).toEqual(["SemVer 7.5.0", "SemVer 7.5.1", "SemVer 7.5.2"]);
+});
+
it("should install and run default (latest) version", async () => {
const { stdout, stderr, exited } = spawn({
cmd: [bunExe(), "x", "uglify-js", "--compress"],
@@ -136,3 +156,80 @@ console.log(
expect(await exited).toBe(0);
expect(await readdirSorted(x_dir)).toEqual(["test.js"]);
});
+
+it("should work for github repository", async () => {
+ await rm(join(await realpath(tmpdir()), "github:piuccio"), { force: true, recursive: true });
+ // without cache
+ const withoutCache = spawn({
+ cmd: [bunExe(), "x", "github:piuccio/cowsay", "--help"],
+ cwd: x_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+
+ expect(withoutCache.stderr).toBeDefined();
+ let err = await new Response(withoutCache.stderr).text();
+ expect(err).not.toContain("error");
+ expect(withoutCache.stdout).toBeDefined();
+ let out = await new Response(withoutCache.stdout).text();
+ expect(out.trim()).toContain("Usage: cowsay");
+ expect(await withoutCache.exited).toBe(0);
+
+ // cached
+ const cached = spawn({
+ cmd: [bunExe(), "x", "github:piuccio/cowsay", "--help"],
+ cwd: x_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+
+ expect(cached.stderr).toBeDefined();
+ err = await new Response(cached.stderr).text();
+ expect(err).not.toContain("error");
+ expect(cached.stdout).toBeDefined();
+ out = await new Response(cached.stdout).text();
+ expect(out.trim()).toContain("Usage: cowsay");
+ expect(await cached.exited).toBe(0);
+});
+
+it("should work for github repository with committish", async () => {
+ await rm(join(await realpath(tmpdir()), "github:piuccio"), { force: true, recursive: true });
+ const withoutCache = spawn({
+ cmd: [bunExe(), "x", "github:piuccio/cowsay#HEAD", "hello bun!"],
+ cwd: x_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+
+ expect(withoutCache.stderr).toBeDefined();
+ let err = await new Response(withoutCache.stderr).text();
+ expect(err).not.toContain("error");
+ expect(withoutCache.stdout).toBeDefined();
+ let out = await new Response(withoutCache.stdout).text();
+ expect(out.trim()).toContain("hello bun!");
+ expect(await withoutCache.exited).toBe(0);
+
+ // cached
+ const cached = spawn({
+ cmd: [bunExe(), "x", "github:piuccio/cowsay#HEAD", "hello bun!"],
+ cwd: x_dir,
+ stdout: null,
+ stdin: "pipe",
+ stderr: "pipe",
+ env,
+ });
+
+ expect(cached.stderr).toBeDefined();
+ err = await new Response(cached.stderr).text();
+ expect(err).not.toContain("error");
+ expect(cached.stdout).toBeDefined();
+ out = await new Response(cached.stdout).text();
+ expect(out.trim()).toContain("hello bun!");
+ expect(await cached.exited).toBe(0);
+});
diff --git a/test/cli/install/dummy.registry.ts b/test/cli/install/dummy.registry.ts
index 69af0c381..5d0982f57 100644
--- a/test/cli/install/dummy.registry.ts
+++ b/test/cli/install/dummy.registry.ts
@@ -34,16 +34,19 @@ export let root_url: string;
export function dummyRegistry(urls: string[], info: any = { "0.0.2": {} }) {
const _handler: Handler = async request => {
urls.push(request.url);
+ const url = request.url.replaceAll("%2f", "/");
+
expect(request.method).toBe("GET");
- if (request.url.endsWith(".tgz")) {
- return new Response(file(join(import.meta.dir, basename(request.url).toLowerCase())));
+ if (url.endsWith(".tgz")) {
+ return new Response(file(join(import.meta.dir, basename(url).toLowerCase())));
}
expect(request.headers.get("accept")).toBe(
"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*",
);
expect(request.headers.get("npm-auth-type")).toBe(null);
expect(await request.text()).toBe("");
- const name = request.url.slice(request.url.indexOf("/", root_url.length) + 1);
+
+ const name = url.slice(url.indexOf("/", root_url.length) + 1);
const versions: Record<string, Pkg> = {};
let version;
for (version in info) {
@@ -52,7 +55,7 @@ export function dummyRegistry(urls: string[], info: any = { "0.0.2": {} }) {
name,
version,
dist: {
- tarball: `${request.url}-${info[version].as ?? version}.tgz`,
+ tarball: `${url}-${info[version].as ?? version}.tgz`,
},
...info[version],
};
diff --git a/test/cli/install/loader-runner-4.3.0.tgz b/test/cli/install/loader-runner-4.3.0.tgz
new file mode 100644
index 000000000..e6a58fb34
--- /dev/null
+++ b/test/cli/install/loader-runner-4.3.0.tgz
Binary files differ
diff --git a/test/cli/install/migration/add-while-migrate-fixture.json b/test/cli/install/migration/add-while-migrate-fixture.json
new file mode 100644
index 000000000..b4a77f948
--- /dev/null
+++ b/test/cli/install/migration/add-while-migrate-fixture.json
@@ -0,0 +1,210 @@
+{
+ "name": "test3",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "test3",
+ "dependencies": {
+ "svelte": "*"
+ }
+ },
+ "node_modules/@ampproject/remapping": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
+ "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.0",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz",
+ "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==",
+ "dependencies": {
+ "@jridgewell/set-array": "^1.0.1",
+ "@jridgewell/sourcemap-codec": "^1.4.10",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
+ "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/set-array": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
+ "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.4.15",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
+ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg=="
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.19",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz",
+ "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
+ }
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.2.tgz",
+ "integrity": "sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA=="
+ },
+ "node_modules/acorn": {
+ "version": "8.10.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz",
+ "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/aria-query": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
+ "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
+ "dependencies": {
+ "dequal": "^2.0.3"
+ }
+ },
+ "node_modules/axobject-query": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz",
+ "integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==",
+ "dependencies": {
+ "dequal": "^2.0.3"
+ }
+ },
+ "node_modules/code-red": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz",
+ "integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.4.15",
+ "@types/estree": "^1.0.1",
+ "acorn": "^8.10.0",
+ "estree-walker": "^3.0.3",
+ "periscopic": "^3.1.0"
+ }
+ },
+ "node_modules/css-tree": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz",
+ "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==",
+ "dependencies": {
+ "mdn-data": "2.0.30",
+ "source-map-js": "^1.0.1"
+ },
+ "engines": {
+ "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
+ }
+ },
+ "node_modules/dequal": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
+ "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/estree-walker": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
+ "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
+ "dependencies": {
+ "@types/estree": "^1.0.0"
+ }
+ },
+ "node_modules/is-reference": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz",
+ "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==",
+ "dependencies": {
+ "@types/estree": "*"
+ }
+ },
+ "node_modules/locate-character": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",
+ "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA=="
+ },
+ "node_modules/magic-string": {
+ "version": "0.30.4",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.4.tgz",
+ "integrity": "sha512-Q/TKtsC5BPm0kGqgBIF9oXAs/xEf2vRKiIB4wCRQTJOQIByZ1d+NnUOotvJOvNpi5RNIgVOMC3pOuaP1ZTDlVg==",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.4.15"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/mdn-data": {
+ "version": "2.0.30",
+ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz",
+ "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA=="
+ },
+ "node_modules/periscopic": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz",
+ "integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==",
+ "dependencies": {
+ "@types/estree": "^1.0.0",
+ "estree-walker": "^3.0.0",
+ "is-reference": "^3.0.0"
+ }
+ },
+ "node_modules/source-map-js": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
+ "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svelte": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.0.0.tgz",
+ "integrity": "sha512-+yCYu3AEUu9n91dnQNGIbnVp8EmNQtuF/YImW4+FTXRHard7NMo+yTsWzggPAbj3fUEJ1FBJLkql/jkp6YB5pg==",
+ "dependencies": {
+ "@ampproject/remapping": "^2.2.1",
+ "@jridgewell/sourcemap-codec": "^1.4.15",
+ "@jridgewell/trace-mapping": "^0.3.18",
+ "acorn": "^8.8.2",
+ "aria-query": "^5.2.1",
+ "axobject-query": "^3.2.1",
+ "code-red": "^1.0.3",
+ "css-tree": "^2.3.1",
+ "estree-walker": "^3.0.3",
+ "is-reference": "^3.0.1",
+ "locate-character": "^3.0.0",
+ "magic-string": "^0.30.0",
+ "periscopic": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ }
+ }
+}
diff --git a/test/cli/install/migration/add-while-migrate-workspace/package.json b/test/cli/install/migration/add-while-migrate-workspace/package.json
new file mode 100644
index 000000000..a43f41972
--- /dev/null
+++ b/test/cli/install/migration/add-while-migrate-workspace/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "test3",
+ "workspaces": [
+ "packages/*"
+ ]
+}
diff --git a/test/cli/install/migration/add-while-migrate-workspace/packages/a/package.json b/test/cli/install/migration/add-while-migrate-workspace/packages/a/package.json
new file mode 100644
index 000000000..da244c1a7
--- /dev/null
+++ b/test/cli/install/migration/add-while-migrate-workspace/packages/a/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "a",
+ "version": "1.0.0",
+ "dependencies": {
+ "b": "1.0.0"
+ }
+}
diff --git a/test/cli/install/migration/add-while-migrate-workspace/packages/b/package.json b/test/cli/install/migration/add-while-migrate-workspace/packages/b/package.json
new file mode 100644
index 000000000..723a52eb9
--- /dev/null
+++ b/test/cli/install/migration/add-while-migrate-workspace/packages/b/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "b",
+ "version": "1.0.0",
+ "dependencies": {
+ "svelte": "^3.0.0"
+ }
+}
diff --git a/test/cli/install/migration/complex-workspace.test.ts b/test/cli/install/migration/complex-workspace.test.ts
new file mode 100644
index 000000000..ec4669a3b
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace.test.ts
@@ -0,0 +1,121 @@
+import fs from "fs";
+import path from "path";
+import { test, expect, describe, beforeAll } from "bun:test";
+import { bunEnv, bunExe } from "harness";
+import { tmpdir } from "os";
+import { join } from "path";
+
+let cwd = join(tmpdir(), "complex-workspace-test" + Math.random().toString(36).slice(2, 8));
+
+function validate(packageName: string, version: string, realPackageName?: string) {
+ test(`${packageName} is ${realPackageName ? `${realPackageName}@${version}` : version}`, () => {
+ if (!cwd) throw new Error("install failed");
+ const pkg = JSON.parse(fs.readFileSync(path.join(cwd, packageName, "package.json"), "utf8"));
+ expect(pkg.version).toBe(version);
+ if (realPackageName) {
+ expect(pkg.name).toBe(realPackageName);
+ }
+ });
+}
+
+function mustExist(filePath: string) {
+ test(`${filePath} exists`, () => {
+ if (!cwd) throw new Error("install failed");
+ if (!fs.existsSync(path.join(cwd, filePath))) {
+ throw new Error(`File ${filePath} was not found`);
+ }
+ });
+}
+
+function mustNotExist(filePath: string) {
+ test(`${filePath} does not exist`, () => {
+ if (!cwd) throw new Error("install failed");
+ if (fs.existsSync(path.join(cwd, filePath))) {
+ throw new Error(`File ${filePath} was found`);
+ }
+ });
+}
+
+beforeAll(() => {
+ fs.cpSync(path.join(import.meta.dir, "complex-workspace"), cwd, { recursive: true });
+});
+
+test("the install succeeds", async () => {
+ var subprocess = Bun.spawn([bunExe(), "reset.ts"], {
+ env: bunEnv,
+ cwd,
+ stdio: ["inherit", "inherit", "inherit"],
+ });
+ await subprocess.exited;
+ if (subprocess.exitCode != 0) {
+ cwd = false as any;
+ throw new Error("Failed to install");
+ }
+
+ subprocess = Bun.spawn([bunExe(), "install"], {
+ env: bunEnv,
+ cwd,
+ stdio: ["inherit", "inherit", "inherit"],
+ });
+
+ await subprocess.exited;
+ if (subprocess.exitCode != 0) {
+ cwd = false as any;
+ throw new Error("Failed to install");
+ }
+
+ console.log(cwd);
+});
+
+// bun-types
+validate("node_modules/bun-types", "1.0.0");
+mustExist("node_modules/bun-types/isfake.txt");
+// NOTE: ???
+// validate("node_modules/bun-types/node_modules/bun-types", "1.0.0");
+mustNotExist("node_modules/bun-types/node_modules/bun-types/isfake.txt");
+
+// svelte
+validate("node_modules/svelte", "4.1.2");
+validate("packages/second/node_modules/svelte", "4.1.0");
+validate("packages/with-postinstall/node_modules/svelte", "3.50.0");
+// validate("packages/body-parser/node_modules/svelte", "0.2.0", "public-install-test");
+// NOTE: bun hoists this dependency higher than npm
+// npm places this in node_modules/express
+validate("packages/second/node_modules/express", "1.0.0", "svelte");
+
+// install test
+// validate("node_modules/install-test", "0.3.0", "publicinstalltest");
+// mustExist("node_modules/install-test/src/index.js");
+validate("node_modules/install-test1", "0.2.0", "install-test");
+mustExist("node_modules/install-test1/index.js");
+// validate("node_modules/public-install-test", "0.2.0", "public-install-test");
+// mustExist("node_modules/public-install-test/index.js");
+
+// hello
+validate("node_modules/hello", "0.3.2");
+mustExist("node_modules/hello/version.txt");
+mustNotExist("packages/second/node_modules/hello/version.txt");
+
+// body parser
+validate("node_modules/body-parser", "200.0.0");
+// NOTE: bun hoists this dependency higher than npm
+// npm places this in node_modules/not-body-parser
+validate("packages/second/node_modules/not-body-parser", "200.0.0", "body-parser");
+// NOTE: bun install doesnt properly handle npm aliased dependencies
+// validate("packages/second/node_modules/connect", "200.0.0", "body-parser");
+validate("packages/second/node_modules/body-parser", "3.21.2", "express");
+// NOTE: bun does not hoist this properly, but it is extremely unlikely to be a real use case
+// validate("packages/second/node_modules/body-parser/node_modules/body-parser", "1.13.3", "body-parser");
+
+// connect
+// mustNotExist("node_modules/connect");
+// validate("packages/second/node_modules/body-parser/node_modules/connect", "2.30.2", "connect");
+
+// sharp
+validate("node_modules/sharp", "0.32.6");
+
+// iconv-lite
+mustNotExist("packages/second/node_modules/body-parser/node_modules/body-parser/node_modules/iconv-lite");
+mustNotExist("packages/second/node_modules/body-parser/node_modules/iconv-lite");
+mustNotExist("packages/second/node_modules/iconv-lite");
+mustNotExist("node_modules/iconv-lite");
diff --git a/test/cli/install/migration/complex-workspace/.gitignore b/test/cli/install/migration/complex-workspace/.gitignore
new file mode 100644
index 000000000..0d4bb62c5
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/.gitignore
@@ -0,0 +1,2 @@
+!package-lock.json
+bun.lockb \ No newline at end of file
diff --git a/test/cli/install/migration/complex-workspace/bun-types/isfake.txt b/test/cli/install/migration/complex-workspace/bun-types/isfake.txt
new file mode 100644
index 000000000..f32a5804e
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/bun-types/isfake.txt
@@ -0,0 +1 @@
+true \ No newline at end of file
diff --git a/test/cli/install/migration/complex-workspace/bun-types/package.json b/test/cli/install/migration/complex-workspace/bun-types/package.json
new file mode 100644
index 000000000..a98eb8c83
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/bun-types/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "bun-types",
+ "version": "1.0.0",
+ "dependencies": {
+ "bun-types": "npm:bun-types@^1.0.0"
+ }
+}
diff --git a/test/cli/install/migration/complex-workspace/hello-0.3.2.tgz b/test/cli/install/migration/complex-workspace/hello-0.3.2.tgz
new file mode 100644
index 000000000..e62e43720
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/hello-0.3.2.tgz
Binary files differ
diff --git a/test/cli/install/migration/complex-workspace/package-lock.json b/test/cli/install/migration/complex-workspace/package-lock.json
new file mode 100644
index 000000000..79a82b4dc
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/package-lock.json
@@ -0,0 +1,2164 @@
+{
+ "name": "root",
+ "version": "0.0.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "root",
+ "version": "0.0.0",
+ "workspaces": [
+ "packages/*"
+ ],
+ "dependencies": {
+ "bar": "https://github.com/oven-sh/bun/raw/f7e4eb83694aa007a492ef66c28ffbe6a2dae791/test/cli/install/bar-0.0.2.tgz",
+ "bun-types": "file:bun-types",
+ "hello": "file:hello-0.3.2.tgz",
+ "install-test": "bitbucket:dylan-conway/public-install-test",
+ "install-test1": "git+ssh://git@github.com/dylan-conway/install-test.git#596234dab30564f37adae1e5c4d7123bcffce537",
+ "public-install-test": "gitlab:dylan-conway/public-install-test",
+ "svelte": "4.1.2"
+ }
+ },
+ "bun-types": {
+ "version": "1.0.0",
+ "dependencies": {
+ "bun-types": "npm:bun-types@^1.0.0"
+ }
+ },
+ "bun-types/node_modules/bun-types": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.0.0.tgz"
+ },
+ "node_modules/@ampproject/remapping": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
+ "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.0",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz",
+ "integrity": "sha512-uBIbiYMeSsy2U0XQoOGVVcpIktjLMEKa7ryz2RLr7L/vTnANNEsPVAh4xOv7ondGz6ac1zVb0F8Jx20rQikffQ==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.4.tgz",
+ "integrity": "sha512-mRsi2vJsk4Bx/AFsNBqOH2fqedxn5L/moT58xgg51DjX1la64Z3Npicut2VbhvDFO26qjWtPMsVxCd80YTFVeg==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.4.tgz",
+ "integrity": "sha512-4iPufZ1TMOD3oBlGFqHXBpa3KFT46aLl6Vy7gwed0ZSYgHaZ/mihbYb4t7Z9etjkC9Al3ZYIoOaHrU60gcMy7g==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.4.tgz",
+ "integrity": "sha512-Lviw8EzxsVQKpbS+rSt6/6zjn9ashUZ7Tbuvc2YENgRl0yZTktGlachZ9KMJUsVjZEGFVu336kl5lBgDN6PmpA==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.4.tgz",
+ "integrity": "sha512-YHbSFlLgDwglFn0lAO3Zsdrife9jcQXQhgRp77YiTDja23FrC2uwnhXMNkAucthsf+Psr7sTwYEryxz6FPAVqw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.4.tgz",
+ "integrity": "sha512-vz59ijyrTG22Hshaj620e5yhs2dU1WJy723ofc+KUgxVCM6zxQESmWdMuVmUzxtGqtj5heHyB44PjV/HKsEmuQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.4.tgz",
+ "integrity": "sha512-3sRbQ6W5kAiVQRBWREGJNd1YE7OgzS0AmOGjDmX/qZZecq8NFlQsQH0IfXjjmD0XtUYqr64e0EKNFjMUlPL3Cw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.4.tgz",
+ "integrity": "sha512-z/4ArqOo9EImzTi4b6Vq+pthLnepFzJ92BnofU1jgNlcVb+UqynVFdoXMCFreTK7FdhqAzH0vmdwW5373Hm9pg==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.4.tgz",
+ "integrity": "sha512-ZWmWORaPbsPwmyu7eIEATFlaqm0QGt+joRE9sKcnVUG3oBbr/KYdNE2TnkzdQwX6EDRdg/x8Q4EZQTXoClUqqA==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.4.tgz",
+ "integrity": "sha512-EGc4vYM7i1GRUIMqRZNCTzJh25MHePYsnQfKDexD8uPTCm9mK56NIL04LUfX2aaJ+C9vyEp2fJ7jbqFEYgO9lQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.4.tgz",
+ "integrity": "sha512-WVhIKO26kmm8lPmNrUikxSpXcgd6HDog0cx12BUfA2PkmURHSgx9G6vA19lrlQOMw+UjMZ+l3PpbtzffCxFDRg==",
+ "cpu": [
+ "loong64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.4.tgz",
+ "integrity": "sha512-keYY+Hlj5w86hNp5JJPuZNbvW4jql7c1eXdBUHIJGTeN/+0QFutU3GrS+c27L+NTmzi73yhtojHk+lr2+502Mw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.4.tgz",
+ "integrity": "sha512-tQ92n0WMXyEsCH4m32S21fND8VxNiVazUbU4IUGVXQpWiaAxOBvtOtbEt3cXIV3GEBydYsY8pyeRMJx9kn3rvw==",
+ "cpu": [
+ "ppc64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.4.tgz",
+ "integrity": "sha512-tRRBey6fG9tqGH6V75xH3lFPpj9E8BH+N+zjSUCnFOX93kEzqS0WdyJHkta/mmJHn7MBaa++9P4ARiU4ykjhig==",
+ "cpu": [
+ "riscv64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.4.tgz",
+ "integrity": "sha512-152aLpQqKZYhThiJ+uAM4PcuLCAOxDsCekIbnGzPKVBRUDlgaaAfaUl5NYkB1hgY6WN4sPkejxKlANgVcGl9Qg==",
+ "cpu": [
+ "s390x"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.4.tgz",
+ "integrity": "sha512-Mi4aNA3rz1BNFtB7aGadMD0MavmzuuXNTaYL6/uiYIs08U7YMPETpgNn5oue3ICr+inKwItOwSsJDYkrE9ekVg==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.4.tgz",
+ "integrity": "sha512-9+Wxx1i5N/CYo505CTT7T+ix4lVzEdz0uCoYGxM5JDVlP2YdDC1Bdz+Khv6IbqmisT0Si928eAxbmGkcbiuM/A==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.4.tgz",
+ "integrity": "sha512-MFsHleM5/rWRW9EivFssop+OulYVUoVcqkyOkjiynKBCGBj9Lihl7kh9IzrreDyXa4sNkquei5/DTP4uCk25xw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.4.tgz",
+ "integrity": "sha512-6Xq8SpK46yLvrGxjp6HftkDwPP49puU4OF0hEL4dTxqCbfx09LyrbUj/D7tmIRMj5D5FCUPksBbxyQhp8tmHzw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.4.tgz",
+ "integrity": "sha512-PkIl7Jq4mP6ke7QKwyg4fD4Xvn8PXisagV/+HntWoDEdmerB2LTukRZg728Yd1Fj+LuEX75t/hKXE2Ppk8Hh1w==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.4.tgz",
+ "integrity": "sha512-ga676Hnvw7/ycdKB53qPusvsKdwrWzEyJ+AtItHGoARszIqvjffTwaaW3b2L6l90i7MO9i+dlAW415INuRhSGg==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.4.tgz",
+ "integrity": "sha512-HP0GDNla1T3ZL8Ko/SHAS2GgtjOg+VmWnnYLhuTksr++EnduYB0f3Y2LzHsUwb2iQ13JGoY6G3R8h6Du/WG6uA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz",
+ "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==",
+ "dependencies": {
+ "@jridgewell/set-array": "^1.0.1",
+ "@jridgewell/sourcemap-codec": "^1.4.10",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
+ "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/set-array": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
+ "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.4.15",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
+ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg=="
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.19",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz",
+ "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
+ }
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.2.tgz",
+ "integrity": "sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA=="
+ },
+ "node_modules/accepts": {
+ "version": "1.2.13",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz",
+ "integrity": "sha512-R190A3EzrS4huFOVZajhXCYZt5p5yrkaQOB4nsWzfth0cYaDcSN5J86l58FJ1dt7igp37fB/QhnuFkGAJmr+eg==",
+ "dependencies": {
+ "mime-types": "~2.1.6",
+ "negotiator": "0.5.3"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/acorn": {
+ "version": "8.10.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz",
+ "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/aria-query": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
+ "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
+ "dependencies": {
+ "dequal": "^2.0.3"
+ }
+ },
+ "node_modules/axobject-query": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz",
+ "integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==",
+ "dependencies": {
+ "dequal": "^2.0.3"
+ }
+ },
+ "node_modules/b4a": {
+ "version": "1.6.4",
+ "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz",
+ "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw=="
+ },
+ "node_modules/bar": {
+ "version": "0.0.2",
+ "resolved": "https://github.com/oven-sh/bun/raw/f7e4eb83694aa007a492ef66c28ffbe6a2dae791/test/cli/install/bar-0.0.2.tgz",
+ "integrity": "sha512-DXWxn8qZ4n87XMJjwZUdYPnsrl8Ntz66PudFoxDVkaPEkZBBzENAKsJPgbBacD782W8RwD/v4mjwVyqlPpQ59w=="
+ },
+ "node_modules/base64-js": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/base64-url": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/base64-url/-/base64-url-1.2.1.tgz",
+ "integrity": "sha512-V8E0l1jyyeSSS9R+J9oljx5eq2rqzClInuwaPcyuv0Mm3ViI/3/rcc4rCEO8i4eQ4I0O0FAGYDA2i5xWHHPhzg=="
+ },
+ "node_modules/basic-auth": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.0.4.tgz",
+ "integrity": "sha512-uvq3I/zC5TmG0WZJDzsXzIytU9GiiSq23Gl27Dq9sV81JTfPfQhtdADECP1DJZeJoZPuYU0Y81hWC5y/dOR+Yw==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/basic-auth-connect": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/basic-auth-connect/-/basic-auth-connect-1.0.0.tgz",
+ "integrity": "sha512-kiV+/DTgVro4aZifY/hwRwALBISViL5NP4aReaR2EVJEObpbUBHIkdJh/YpcoEiYt7nBodZ6U2ajZeZvSxUCCg=="
+ },
+ "node_modules/batch": {
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/batch/-/batch-0.5.3.tgz",
+ "integrity": "sha512-aQgHPLH2DHpFTpBl5/GiVdNzHEqsLCSs1RiPvqkKP1+7RkNJlv71kL8/KXmvvaLqoZ7ylmvqkZhLjjAoRz8Xgw=="
+ },
+ "node_modules/bl": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
+ "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
+ "dependencies": {
+ "buffer": "^5.5.0",
+ "inherits": "^2.0.4",
+ "readable-stream": "^3.4.0"
+ }
+ },
+ "node_modules/bl/node_modules/readable-stream": {
+ "version": "3.6.2",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
+ "dependencies": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/bl/node_modules/string_decoder": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
+ "dependencies": {
+ "safe-buffer": "~5.2.0"
+ }
+ },
+ "node_modules/body-parser": {
+ "resolved": "packages/body-parser",
+ "link": true
+ },
+ "node_modules/buffer": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
+ "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "dependencies": {
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.1.13"
+ }
+ },
+ "node_modules/bun-types": {
+ "resolved": "bun-types",
+ "link": true
+ },
+ "node_modules/bytes": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.1.0.tgz",
+ "integrity": "sha512-k9VSlRfRi5JYyQWMylSOgjld96ta1qaQUIvmn+na0BzViclH04PBumewv4z5aeXNkn6Z/gAN5FtPeBLvV20F9w=="
+ },
+ "node_modules/chownr": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
+ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
+ },
+ "node_modules/code-red": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz",
+ "integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.4.15",
+ "@types/estree": "^1.0.1",
+ "acorn": "^8.10.0",
+ "estree-walker": "^3.0.3",
+ "periscopic": "^3.1.0"
+ }
+ },
+ "node_modules/color": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz",
+ "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==",
+ "dependencies": {
+ "color-convert": "^2.0.1",
+ "color-string": "^1.9.0"
+ },
+ "engines": {
+ "node": ">=12.5.0"
+ }
+ },
+ "node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
+ },
+ "node_modules/color-string": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
+ "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
+ "dependencies": {
+ "color-name": "^1.0.0",
+ "simple-swizzle": "^0.2.2"
+ }
+ },
+ "node_modules/commander": {
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.6.0.tgz",
+ "integrity": "sha512-PhbTMT+ilDXZKqH8xbvuUY2ZEQNef0Q7DKxgoEKb4ccytsdvVVJmYqR0sGbi96nxU6oGrwEIQnclpK2NBZuQlg==",
+ "engines": {
+ "node": ">= 0.6.x"
+ }
+ },
+ "node_modules/compressible": {
+ "version": "2.0.18",
+ "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz",
+ "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==",
+ "dependencies": {
+ "mime-db": ">= 1.43.0 < 2"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/compression": {
+ "version": "1.5.2",
+ "resolved": "https://registry.npmjs.org/compression/-/compression-1.5.2.tgz",
+ "integrity": "sha512-+2fE8M8+Oe0kAlbMPz6UinaaH/HaGf+c5HlWRyYtPga/PHKxStJJKTU4xca8StY0JQ78L2kJaslpgSzCKgHaxQ==",
+ "dependencies": {
+ "accepts": "~1.2.12",
+ "bytes": "2.1.0",
+ "compressible": "~2.0.5",
+ "debug": "~2.2.0",
+ "on-headers": "~1.0.0",
+ "vary": "~1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/connect-timeout": {
+ "version": "1.6.2",
+ "resolved": "https://registry.npmjs.org/connect-timeout/-/connect-timeout-1.6.2.tgz",
+ "integrity": "sha512-qIFt3Ja6gRuJtVoWhPa5FtOO8ERs0MfW/QkmQ0vjrAL78otrkxe8w/qjTAgU/T1W/jH5qeZXJHilmOPKNTiEQw==",
+ "dependencies": {
+ "debug": "~2.2.0",
+ "http-errors": "~1.3.1",
+ "ms": "0.7.1",
+ "on-headers": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/content-disposition": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.0.tgz",
+ "integrity": "sha512-PWzG8GssMHTPSLBoOeK5MvPPJeWU5ZVX8omvJC16BUH/nUX6J/jM/hgm/mrPWzTXVV3B3OoBhFdHXyGLU4TgUw==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/content-type": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.3.tgz",
+ "integrity": "sha512-mWkFhcL+HVG1KjeCjEBVJJ7s4sAGMLiBDFSDs4bzzvgLZt7rW8BhP6XV/8b1+pNvx/skd3yYxPuaF3Z6LlQzyw==",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/cookie-parser": {
+ "version": "1.3.5",
+ "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.3.5.tgz",
+ "integrity": "sha512-YN/8nzPcK5o6Op4MIzAd4H4qUal5+3UaMhVIeaafFYL0pKvBQA/9Yhzo7ZwvBpjdGshsiTAb1+FC37M6RdPDFg==",
+ "dependencies": {
+ "cookie": "0.1.3",
+ "cookie-signature": "1.0.6"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/cookie-signature": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
+ "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
+ },
+ "node_modules/core-util-is": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
+ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
+ },
+ "node_modules/crc": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/crc/-/crc-3.3.0.tgz",
+ "integrity": "sha512-QCx3z7FOZbJrapsnewTkh1Hxh6PHV61SRHbx6Q65Uih3y0kfIj+dDGI3uQ4Q1DLKOILyvpZxvJpoKPrxathpCg=="
+ },
+ "node_modules/csrf": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/csrf/-/csrf-3.0.6.tgz",
+ "integrity": "sha512-3q1ocniLMgk9nHHEt/I/JsN9IfiGjgp6MHgYNT7+CPmQvi5DF6qzenXnZSH6f9Qaa+4DhmUDJa8SgFZ+OFf9Qg==",
+ "dependencies": {
+ "rndm": "1.2.0",
+ "tsscmp": "1.0.5",
+ "uid-safe": "2.1.4"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/css-tree": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz",
+ "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==",
+ "dependencies": {
+ "mdn-data": "2.0.30",
+ "source-map-js": "^1.0.1"
+ },
+ "engines": {
+ "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
+ }
+ },
+ "node_modules/csurf": {
+ "version": "1.8.3",
+ "resolved": "https://registry.npmjs.org/csurf/-/csurf-1.8.3.tgz",
+ "integrity": "sha512-p2NJ9fGOn5HCaV9jAOBCSjIGMRMrpm9/yDswD0bFi7zQv1ifDufIKI5nem9RmhMsH6jVD6Sx6vs57hnivvkJJw==",
+ "dependencies": {
+ "cookie": "0.1.3",
+ "cookie-signature": "1.0.6",
+ "csrf": "~3.0.0",
+ "http-errors": "~1.3.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/debug": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
+ "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==",
+ "dependencies": {
+ "ms": "0.7.1"
+ }
+ },
+ "node_modules/decompress-response": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
+ "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
+ "dependencies": {
+ "mimic-response": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/deep-extend": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
+ "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/depd": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.0.1.tgz",
+ "integrity": "sha512-OEWAMbCkK9IWQ8pfTvHBhCSqHgR+sk5pbiYqq0FqfARG4Cy+cRsCbITx6wh5pcsmfBPiJAcbd98tfdz5fnBbag==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/dequal": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
+ "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/destroy": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz",
+ "integrity": "sha512-KB/AVLKRwZPOEo6/lxkDJ+Bv3jFRRrhmnRMPvpWwmIfUggpzGkQBqolyo8FRf833b/F5rzmy1uVN3fHBkjTxgw=="
+ },
+ "node_modules/detect-libc": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz",
+ "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ee-first": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
+ },
+ "node_modules/end-of-stream": {
+ "version": "1.4.4",
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
+ "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
+ "dependencies": {
+ "once": "^1.4.0"
+ }
+ },
+ "node_modules/errorhandler": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/errorhandler/-/errorhandler-1.4.3.tgz",
+ "integrity": "sha512-pp1hk9sZBq4Bj/e/Cl84fJ3cYiQDFZk3prp7jrurUbPGOlY7zA2OubjhhEAWuUb8VNTFIkGwoby7Uq6YpicfvQ==",
+ "dependencies": {
+ "accepts": "~1.3.0",
+ "escape-html": "~1.0.3"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/errorhandler/node_modules/accepts": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
+ "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
+ "dependencies": {
+ "mime-types": "~2.1.34",
+ "negotiator": "0.6.3"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/errorhandler/node_modules/escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
+ },
+ "node_modules/errorhandler/node_modules/negotiator": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
+ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/esbuild": {
+ "version": "0.19.4",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.4.tgz",
+ "integrity": "sha512-x7jL0tbRRpv4QUyuDMjONtWFciygUxWaUM1kMX2zWxI0X2YWOt7MSA0g4UdeSiHM8fcYVzpQhKYOycZwxTdZkA==",
+ "hasInstallScript": true,
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "optionalDependencies": {
+ "@esbuild/android-arm": "0.19.4",
+ "@esbuild/android-arm64": "0.19.4",
+ "@esbuild/android-x64": "0.19.4",
+ "@esbuild/darwin-arm64": "0.19.4",
+ "@esbuild/darwin-x64": "0.19.4",
+ "@esbuild/freebsd-arm64": "0.19.4",
+ "@esbuild/freebsd-x64": "0.19.4",
+ "@esbuild/linux-arm": "0.19.4",
+ "@esbuild/linux-arm64": "0.19.4",
+ "@esbuild/linux-ia32": "0.19.4",
+ "@esbuild/linux-loong64": "0.19.4",
+ "@esbuild/linux-mips64el": "0.19.4",
+ "@esbuild/linux-ppc64": "0.19.4",
+ "@esbuild/linux-riscv64": "0.19.4",
+ "@esbuild/linux-s390x": "0.19.4",
+ "@esbuild/linux-x64": "0.19.4",
+ "@esbuild/netbsd-x64": "0.19.4",
+ "@esbuild/openbsd-x64": "0.19.4",
+ "@esbuild/sunos-x64": "0.19.4",
+ "@esbuild/win32-arm64": "0.19.4",
+ "@esbuild/win32-ia32": "0.19.4",
+ "@esbuild/win32-x64": "0.19.4"
+ }
+ },
+ "node_modules/escape-html": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.2.tgz",
+ "integrity": "sha512-J5ahyCRC4liskWVAfkmosNWfG0eHQxI0W+Ko7k3cZaYVMfgt05dwZ68vw6S/TZM1BPvuTv3kq6CRCb7WWtBUVA=="
+ },
+ "node_modules/estree-walker": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
+ "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
+ "dependencies": {
+ "@types/estree": "^1.0.0"
+ }
+ },
+ "node_modules/etag": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.7.0.tgz",
+ "integrity": "sha512-Mbv5pNpLNPrm1b4rzZlZlfTRpdDr31oiD43N362sIyvSWVNu5Du33EcJGzvEV4YdYLuENB1HzND907cQkFmXNw==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/expand-template": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
+ "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/express": {
+ "name": "svelte",
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/svelte/-/svelte-1.0.0.tgz",
+ "integrity": "sha512-YCzdYmY4k+29yWvNNYVkZE9OI5g4RwumRyX8tnD6cOiU0FCL/6N0Qn3XHZaL1MnJAICjNTObu/OEmC9ht7ITNQ=="
+ },
+ "node_modules/express-session": {
+ "version": "1.11.3",
+ "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.11.3.tgz",
+ "integrity": "sha512-QdSbGRRg+JMvlYpancRDFXDmIMqjEdpowriwQc4Kz3mvPwTnOPD/h5FSS21+4z4Isosta+ULmEwL6F3/lylWWg==",
+ "dependencies": {
+ "cookie": "0.1.3",
+ "cookie-signature": "1.0.6",
+ "crc": "3.3.0",
+ "debug": "~2.2.0",
+ "depd": "~1.0.1",
+ "on-headers": "~1.0.0",
+ "parseurl": "~1.3.0",
+ "uid-safe": "~2.0.0",
+ "utils-merge": "1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/express-session/node_modules/uid-safe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.0.0.tgz",
+ "integrity": "sha512-PH/12q0a/sEGVS28fZ5evILW2Ayn13PwkYmCleDsIPm39vUIqN58hjyqtUd496kyMY6WkXtaDMDpS8nSCmNKTg==",
+ "dependencies": {
+ "base64-url": "1.2.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/fast-fifo": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
+ "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ=="
+ },
+ "node_modules/finalhandler": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.4.0.tgz",
+ "integrity": "sha512-jJU2WE88OqUvwAIf/1K2G2fTdKKZ8LvSwYQyFFekDcmBnBmht38enbcmErnA7iNZktcEo/o2JAHYbe1QDOAgaA==",
+ "dependencies": {
+ "debug": "~2.2.0",
+ "escape-html": "1.0.2",
+ "on-finished": "~2.3.0",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/forwarded": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
+ "integrity": "sha512-Ua9xNhH0b8pwE3yRbFfXJvfdWF0UHNCdeyb2sbi9Ul/M+r3PTdrz7Cv4SCfZRMjmzEM9PhraqfZFbGTIg3OMyA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fresh": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.3.0.tgz",
+ "integrity": "sha512-akx5WBKAwMSg36qoHTuMMVncHWctlaDGslJASDYAhoLrzDUDCjZlOngNa/iC6lPm9aA0qk8pN5KnpmbJHSIIQQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fs-constants": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
+ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
+ },
+ "node_modules/github-from-package": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
+ "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="
+ },
+ "node_modules/hello": {
+ "version": "0.3.2",
+ "resolved": "file:hello-0.3.2.tgz",
+ "integrity": "sha512-gIib5J410ZOWSdETHA9L7lqtTBPduleEWV7kOEWX0pReX0N5Lih5ZTE4E9XvmX+DI/HOntKB+EgFljix9FVcug==",
+ "dependencies": {
+ "svelte": "4"
+ }
+ },
+ "node_modules/http-errors": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.3.1.tgz",
+ "integrity": "sha512-gMygNskMurDCWfoCdyh1gOeDfSbkAHXqz94QoPj5IHIUjC/BG8/xv7FSEUr7waR5RcAya4j58bft9Wu/wHNeXA==",
+ "dependencies": {
+ "inherits": "~2.0.1",
+ "statuses": "1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/ieee754": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ },
+ "node_modules/ini": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
+ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
+ },
+ "node_modules/install-test": {
+ "name": "publicinstalltest",
+ "version": "0.3.0",
+ "resolved": "git+ssh://git@bitbucket.org/dylan-conway/public-install-test.git#79265e2d9754c60b60f97cc8d859fb6da073b5d2"
+ },
+ "node_modules/install-test1": {
+ "version": "0.2.0",
+ "resolved": "git+ssh://git@github.com/dylan-conway/install-test.git#596234dab30564f37adae1e5c4d7123bcffce537",
+ "integrity": "sha512-65iIjVoaUdhWa5GSlZ1E6JA8fCHTTaAjNdAkNqAZ4Khtzw0JK0clSCdzyA3k7rKtZgNj0a31XF8JkQ2hrpmI/A=="
+ },
+ "node_modules/ipaddr.js": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.0.5.tgz",
+ "integrity": "sha512-wBj+q+3uP78gMowwWgFLAYm/q4x5goyZmDsmuvyz+nd1u0D/ghgXXtc1OkgmTzSiWT101kiqGacwFk9eGQw6xQ==",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/is-arrayish": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
+ "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
+ },
+ "node_modules/is-reference": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz",
+ "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==",
+ "dependencies": {
+ "@types/estree": "*"
+ }
+ },
+ "node_modules/isarray": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+ "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
+ },
+ "node_modules/locate-character": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",
+ "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA=="
+ },
+ "node_modules/lol": {
+ "resolved": "packages/lol-package",
+ "link": true
+ },
+ "node_modules/lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/magic-string": {
+ "version": "0.30.4",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.4.tgz",
+ "integrity": "sha512-Q/TKtsC5BPm0kGqgBIF9oXAs/xEf2vRKiIB4wCRQTJOQIByZ1d+NnUOotvJOvNpi5RNIgVOMC3pOuaP1ZTDlVg==",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.4.15"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/mdn-data": {
+ "version": "2.0.30",
+ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz",
+ "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA=="
+ },
+ "node_modules/media-typer": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
+ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/merge-descriptors": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.0.tgz",
+ "integrity": "sha512-YJiZmTZTkrqvgefMsWdioTKsZdHnfAhHHkEdPg+4PCqMJEGHQo5iJQjEbMv3XyBZ6y3Z2Rj1mqq1WNKq9e0yNw=="
+ },
+ "node_modules/method-override": {
+ "version": "2.3.10",
+ "resolved": "https://registry.npmjs.org/method-override/-/method-override-2.3.10.tgz",
+ "integrity": "sha512-Ks2/7e+3JuwQcpLybc6wTHyqg13HDjOhLcE+YaAEub9DbSxF+ieMvxUlybmWW9luRMh9Cd0rO9aNtzUT51xfNQ==",
+ "dependencies": {
+ "debug": "2.6.9",
+ "methods": "~1.1.2",
+ "parseurl": "~1.3.2",
+ "vary": "~1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/method-override/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/method-override/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ },
+ "node_modules/method-override/node_modules/vary": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/methods": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
+ "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime": {
+ "version": "1.3.4",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz",
+ "integrity": "sha512-sAaYXszED5ALBt665F0wMQCUXpGuZsGdopoqcHPdL39ZYdi7uHoZlhrfZfhv8WzivhBzr/oXwaj+yiK5wY8MXQ==",
+ "bin": {
+ "mime": "cli.js"
+ }
+ },
+ "node_modules/mime-db": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "2.1.35",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mimic-response": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
+ "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/minimist": {
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+ "integrity": "sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q=="
+ },
+ "node_modules/mkdirp": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
+ "integrity": "sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA==",
+ "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)",
+ "dependencies": {
+ "minimist": "0.0.8"
+ },
+ "bin": {
+ "mkdirp": "bin/cmd.js"
+ }
+ },
+ "node_modules/mkdirp-classic": {
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
+ "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
+ },
+ "node_modules/morgan": {
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.6.1.tgz",
+ "integrity": "sha512-WWxlTx5xCqbtSeX/gPVHUZBhAhSMfYQLgPrWHEN0FYnF+zf1Ju/Zct6rpeKmvzibrYF4QvFVws7IN61BxnKu+Q==",
+ "dependencies": {
+ "basic-auth": "~1.0.3",
+ "debug": "~2.2.0",
+ "depd": "~1.0.1",
+ "on-finished": "~2.3.0",
+ "on-headers": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/ms": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz",
+ "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg=="
+ },
+ "node_modules/multiparty": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/multiparty/-/multiparty-3.3.2.tgz",
+ "integrity": "sha512-FX6dDOKzDpkrb5/+Imq+V6dmCZNnC02tMDiZfrgHSYgfQj6CVPGzOVqfbHKt/Vy4ZZsmMPXkulyLf92lCyvV7A==",
+ "dependencies": {
+ "readable-stream": "~1.1.9",
+ "stream-counter": "~0.2.0"
+ },
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/napi-build-utils": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz",
+ "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg=="
+ },
+ "node_modules/negotiator": {
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.5.3.tgz",
+ "integrity": "sha512-oXmnazqehLNFohqgLxRyUdOQU9/UX0NpCpsnbjWUjM62ZM8oSOXYZpHc68XR130ftPNano0oQXGdREAplZRhaQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/node-abi": {
+ "version": "3.47.0",
+ "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.47.0.tgz",
+ "integrity": "sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==",
+ "dependencies": {
+ "semver": "^7.3.5"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/node-addon-api": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz",
+ "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA=="
+ },
+ "node_modules/not-body-parser": {
+ "resolved": "packages/body-parser",
+ "link": true
+ },
+ "node_modules/on-finished": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
+ "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==",
+ "dependencies": {
+ "ee-first": "1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/on-headers": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz",
+ "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/parseurl": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/pause": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/pause/-/pause-0.1.0.tgz",
+ "integrity": "sha512-aeHLgQCtI3tcuYVnrvAeVb4Tkm1za4r3YDv3hMeUxcRxet3dbEhJOdtoMrsT/Q5tY3Oy2A1A9FD5el5tWp2FSg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/periscopic": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz",
+ "integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==",
+ "dependencies": {
+ "@types/estree": "^1.0.0",
+ "estree-walker": "^3.0.0",
+ "is-reference": "^3.0.0"
+ }
+ },
+ "node_modules/prebuild-install": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz",
+ "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==",
+ "dependencies": {
+ "detect-libc": "^2.0.0",
+ "expand-template": "^2.0.3",
+ "github-from-package": "0.0.0",
+ "minimist": "^1.2.3",
+ "mkdirp-classic": "^0.5.3",
+ "napi-build-utils": "^1.0.1",
+ "node-abi": "^3.3.0",
+ "pump": "^3.0.0",
+ "rc": "^1.2.7",
+ "simple-get": "^4.0.0",
+ "tar-fs": "^2.0.0",
+ "tunnel-agent": "^0.6.0"
+ },
+ "bin": {
+ "prebuild-install": "bin.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/prebuild-install/node_modules/minimist": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/prebuild-install/node_modules/readable-stream": {
+ "version": "3.6.2",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
+ "dependencies": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/prebuild-install/node_modules/string_decoder": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
+ "dependencies": {
+ "safe-buffer": "~5.2.0"
+ }
+ },
+ "node_modules/prebuild-install/node_modules/tar-fs": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
+ "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
+ "dependencies": {
+ "chownr": "^1.1.1",
+ "mkdirp-classic": "^0.5.2",
+ "pump": "^3.0.0",
+ "tar-stream": "^2.1.4"
+ }
+ },
+ "node_modules/prebuild-install/node_modules/tar-stream": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
+ "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
+ "dependencies": {
+ "bl": "^4.0.3",
+ "end-of-stream": "^1.4.1",
+ "fs-constants": "^1.0.0",
+ "inherits": "^2.0.3",
+ "readable-stream": "^3.1.1"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/proxy-addr": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.0.10.tgz",
+ "integrity": "sha512-iq6kR9KN32aFvXjDyC8nIrm203AHeIBPjL6dpaHgSdbpTO8KoPlD0xG92xwwtkCL9+yt1LE5VwpEk43TyP38Dg==",
+ "dependencies": {
+ "forwarded": "~0.1.0",
+ "ipaddr.js": "1.0.5"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/public-install-test": {
+ "version": "0.2.0",
+ "resolved": "git+ssh://git@gitlab.com/dylan-conway/public-install-test.git#93f3aa4ec9ca8a0bacc010776db48bfcd915c44c"
+ },
+ "node_modules/pump": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
+ "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
+ "dependencies": {
+ "end-of-stream": "^1.1.0",
+ "once": "^1.3.1"
+ }
+ },
+ "node_modules/qs": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-4.0.0.tgz",
+ "integrity": "sha512-8MPmJ83uBOPsQj5tQCv4g04/nTiY+d17yl9o3Bw73vC6XlEm2POIRRlOgWJ8i74bkGLII670cDJJZkgiZ2sIkg=="
+ },
+ "node_modules/queue-tick": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz",
+ "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag=="
+ },
+ "node_modules/random-bytes": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz",
+ "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/range-parser": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.3.tgz",
+ "integrity": "sha512-nDsRrtIxVUO5opg/A8T2S3ebULVIfuh8ECbh4w3N4mWxIiT3QILDJDUQayPqm2e8Q8NUa0RSUkGCfe33AfjR3Q==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/rc": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
+ "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
+ "dependencies": {
+ "deep-extend": "^0.6.0",
+ "ini": "~1.3.0",
+ "minimist": "^1.2.0",
+ "strip-json-comments": "~2.0.1"
+ },
+ "bin": {
+ "rc": "cli.js"
+ }
+ },
+ "node_modules/rc/node_modules/minimist": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/readable-stream": {
+ "version": "1.1.14",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
+ "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==",
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.1",
+ "isarray": "0.0.1",
+ "string_decoder": "~0.10.x"
+ }
+ },
+ "node_modules/response-time": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/response-time/-/response-time-2.3.2.tgz",
+ "integrity": "sha512-MUIDaDQf+CVqflfTdQ5yam+aYCkXj1PY8fjlPDQ6ppxJlmgZb864pHtA750mayywNg8tx4rS7qH9JXd/OF+3gw==",
+ "dependencies": {
+ "depd": "~1.1.0",
+ "on-headers": "~1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/response-time/node_modules/depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/rndm": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/rndm/-/rndm-1.2.0.tgz",
+ "integrity": "sha512-fJhQQI5tLrQvYIYFpOnFinzv9dwmR7hRnUz1XqP3OJ1jIweTNOd6aTO4jwQSgcBSFUB+/KHJxuGneime+FdzOw=="
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/second": {
+ "resolved": "packages/second",
+ "link": true
+ },
+ "node_modules/semver": {
+ "version": "7.5.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
+ "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
+ "dependencies": {
+ "lru-cache": "^6.0.0"
+ },
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/send": {
+ "version": "0.13.0",
+ "resolved": "https://registry.npmjs.org/send/-/send-0.13.0.tgz",
+ "integrity": "sha512-zck2y84i0SbUUiwq2l5gGPNVpCplL48og5xIhFjNjQa09003YCTy6Vb3rKfVuG8W8PWNUtUOntjQEBdwkJ9oBw==",
+ "dependencies": {
+ "debug": "~2.2.0",
+ "depd": "~1.0.1",
+ "destroy": "1.0.3",
+ "escape-html": "1.0.2",
+ "etag": "~1.7.0",
+ "fresh": "0.3.0",
+ "http-errors": "~1.3.1",
+ "mime": "1.3.4",
+ "ms": "0.7.1",
+ "on-finished": "~2.3.0",
+ "range-parser": "~1.0.2",
+ "statuses": "~1.2.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/send/node_modules/statuses": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.2.1.tgz",
+ "integrity": "sha512-pVEuxHdSGrt8QmQ3LOZXLhSA6MP/iPqKzZeO6Squ7PNGkA/9MBsSfV0/L+bIxkoDmjF4tZcLpcVq/fkqoHvuKg=="
+ },
+ "node_modules/serve-favicon": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/serve-favicon/-/serve-favicon-2.3.2.tgz",
+ "integrity": "sha512-oHEaA3ohvKxEWhjP97cQ6QuTTbMBF3AxDyMSvBtvnl1jXaB2Ik6kXE7nUtPM3YVU5VHCDe6n7JZrFCWzQuvXEQ==",
+ "dependencies": {
+ "etag": "~1.7.0",
+ "fresh": "0.3.0",
+ "ms": "0.7.2",
+ "parseurl": "~1.3.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/serve-favicon/node_modules/ms": {
+ "version": "0.7.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz",
+ "integrity": "sha512-5NnE67nQSQDJHVahPJna1PQ/zCXMnQop3yUCxjKPNzCxuyPSKWTQ/5Gu5CZmjetwGLWRA+PzeF5thlbOdbQldA=="
+ },
+ "node_modules/serve-index": {
+ "version": "1.7.3",
+ "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.7.3.tgz",
+ "integrity": "sha512-g18EQWY83uFBldFpCyK/a49yxQgIMEMLA6U9f66FiI848mLkMO8EY/xRAZAoCwNFwSUAiArCF3mdjaNXpd3ghw==",
+ "dependencies": {
+ "accepts": "~1.2.13",
+ "batch": "0.5.3",
+ "debug": "~2.2.0",
+ "escape-html": "~1.0.3",
+ "http-errors": "~1.3.1",
+ "mime-types": "~2.1.9",
+ "parseurl": "~1.3.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/serve-index/node_modules/escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
+ },
+ "node_modules/serve-static": {
+ "version": "1.10.3",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.10.3.tgz",
+ "integrity": "sha512-ScsFovjz3Db+vGgpofR/U8p8UULEcGV9akqyo8TQ1mMnjcxemE7Y5Muo+dvy3tJLY/doY2v1H61eCBMYGmwfrA==",
+ "dependencies": {
+ "escape-html": "~1.0.3",
+ "parseurl": "~1.3.1",
+ "send": "0.13.2"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/serve-static/node_modules/depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/serve-static/node_modules/destroy": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
+ "integrity": "sha512-3NdhDuEXnfun/z7x9GOElY49LoqVHoGScmOKwmxhsS8N5Y+Z8KyPPDnaSzqWgYt/ji4mqwfTS34Htrk0zPIXVg=="
+ },
+ "node_modules/serve-static/node_modules/escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
+ },
+ "node_modules/serve-static/node_modules/send": {
+ "version": "0.13.2",
+ "resolved": "https://registry.npmjs.org/send/-/send-0.13.2.tgz",
+ "integrity": "sha512-cQ0rmXHrdO2Iof08igV2bG/yXWD106ANwBg6DkGQNT2Vsznbgq6T0oAIQboy1GoFsIuy51jCim26aA9tj3Z3Zg==",
+ "dependencies": {
+ "debug": "~2.2.0",
+ "depd": "~1.1.0",
+ "destroy": "~1.0.4",
+ "escape-html": "~1.0.3",
+ "etag": "~1.7.0",
+ "fresh": "0.3.0",
+ "http-errors": "~1.3.1",
+ "mime": "1.3.4",
+ "ms": "0.7.1",
+ "on-finished": "~2.3.0",
+ "range-parser": "~1.0.3",
+ "statuses": "~1.2.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/serve-static/node_modules/statuses": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.2.1.tgz",
+ "integrity": "sha512-pVEuxHdSGrt8QmQ3LOZXLhSA6MP/iPqKzZeO6Squ7PNGkA/9MBsSfV0/L+bIxkoDmjF4tZcLpcVq/fkqoHvuKg=="
+ },
+ "node_modules/sharp": {
+ "version": "0.32.6",
+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz",
+ "integrity": "sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==",
+ "hasInstallScript": true,
+ "dependencies": {
+ "color": "^4.2.3",
+ "detect-libc": "^2.0.2",
+ "node-addon-api": "^6.1.0",
+ "prebuild-install": "^7.1.1",
+ "semver": "^7.5.4",
+ "simple-get": "^4.0.1",
+ "tar-fs": "^3.0.4",
+ "tunnel-agent": "^0.6.0"
+ },
+ "engines": {
+ "node": ">=14.15.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/simple-concat": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
+ "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/simple-get": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
+ "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "dependencies": {
+ "decompress-response": "^6.0.0",
+ "once": "^1.3.1",
+ "simple-concat": "^1.0.0"
+ }
+ },
+ "node_modules/simple-swizzle": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
+ "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
+ "dependencies": {
+ "is-arrayish": "^0.3.1"
+ }
+ },
+ "node_modules/source-map-js": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
+ "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/stream-counter": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/stream-counter/-/stream-counter-0.2.0.tgz",
+ "integrity": "sha512-GjA2zKc2iXUUKRcOxXQmhEx0Ev3XHJ6c8yWGqhQjWwhGrqNwSsvq9YlRLgoGtZ5Kx2Ln94IedaqJ5GUG6aBbxA==",
+ "dependencies": {
+ "readable-stream": "~1.1.8"
+ },
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/streamx": {
+ "version": "2.15.1",
+ "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.1.tgz",
+ "integrity": "sha512-fQMzy2O/Q47rgwErk/eGeLu/roaFWV0jVsogDmrszM9uIw8L5OA+t+V93MgYlufNptfjmYR1tOMWhei/Eh7TQA==",
+ "dependencies": {
+ "fast-fifo": "^1.1.0",
+ "queue-tick": "^1.0.1"
+ }
+ },
+ "node_modules/string_decoder": {
+ "version": "0.10.31",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+ "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ=="
+ },
+ "node_modules/strip-json-comments": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
+ "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svelte": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.1.2.tgz",
+ "integrity": "sha512-/evA8U6CgOHe5ZD1C1W3va9iJG7mWflcCdghBORJaAhD2JzrVERJty/2gl0pIPrJYBGZwZycH6onYf+64XXF9g==",
+ "dependencies": {
+ "@ampproject/remapping": "^2.2.1",
+ "@jridgewell/sourcemap-codec": "^1.4.15",
+ "@jridgewell/trace-mapping": "^0.3.18",
+ "acorn": "^8.9.0",
+ "aria-query": "^5.3.0",
+ "axobject-query": "^3.2.1",
+ "code-red": "^1.0.3",
+ "css-tree": "^2.3.1",
+ "estree-walker": "^3.0.3",
+ "is-reference": "^3.0.1",
+ "locate-character": "^3.0.0",
+ "magic-string": "^0.30.0",
+ "periscopic": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/tar-fs": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz",
+ "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==",
+ "dependencies": {
+ "mkdirp-classic": "^0.5.2",
+ "pump": "^3.0.0",
+ "tar-stream": "^3.1.5"
+ }
+ },
+ "node_modules/tar-stream": {
+ "version": "3.1.6",
+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz",
+ "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==",
+ "dependencies": {
+ "b4a": "^1.6.4",
+ "fast-fifo": "^1.2.0",
+ "streamx": "^2.15.0"
+ }
+ },
+ "node_modules/tsscmp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.5.tgz",
+ "integrity": "sha512-aP/vy9xYiYGvtpW4xBkxdoeqbT+nNeo/37cdQk3iSiGz0xKb20XwOgBSqYo1DzEqt1ycPubEfPU3oHgzsRRL3g==",
+ "engines": {
+ "node": ">=0.6.x"
+ }
+ },
+ "node_modules/tunnel-agent": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
+ "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==",
+ "dependencies": {
+ "safe-buffer": "^5.0.1"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/type-is": {
+ "version": "1.6.18",
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
+ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
+ "dependencies": {
+ "media-typer": "0.3.0",
+ "mime-types": "~2.1.24"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/uid-safe": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.4.tgz",
+ "integrity": "sha512-MHTGzIDNPv1XhDK0MyKvEroobUhtpMa649/9SIFbTRO2dshLctD3zxOwQw+gQ+Mlp5osfMdUU1sjcO6Fw4rvCA==",
+ "dependencies": {
+ "random-bytes": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/unpipe": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
+ },
+ "node_modules/utils-merge": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz",
+ "integrity": "sha512-HwU9SLQEtyo+0uoKXd1nkLqigUWLB+QuNQR4OcmB73eWqksM5ovuqcycks2x043W8XVb75rG1HQ0h93TMXkzQQ==",
+ "engines": {
+ "node": ">= 0.4.0"
+ }
+ },
+ "node_modules/vary": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.0.1.tgz",
+ "integrity": "sha512-yNsH+tC0r8quK2tg/yqkXqqaYzeKTkSqQ+8T6xCoWgOi/bU/omMYz+6k+I91JJJDeltJzI7oridTOq6OYkY0Tw==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/vhost": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/vhost/-/vhost-3.0.2.tgz",
+ "integrity": "sha512-S3pJdWrpFWrKMboRU4dLYgMrTgoPALsmYwOvyebK2M6X95b9kQrjZy5rwl3uzzpfpENe/XrNYu/2U+e7/bmT5g==",
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/with-postinstall": {
+ "resolved": "packages/with-postinstall",
+ "link": true
+ },
+ "node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
+ },
+ "node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
+ },
+ "other/another-workspace-pkg": {
+ "name": "lol",
+ "extraneous": true
+ },
+ "packages/body-parser": {
+ "version": "200.0.0",
+ "dependencies": {
+ "svelte": "git+ssh://git@gitlab.com/dylan-conway/public-install-test.git#93f3aa4ec9ca8a0bacc010776db48bfcd915c44c"
+ }
+ },
+ "packages/body-parser/node_modules/svelte": {
+ "name": "public-install-test",
+ "version": "0.2.0",
+ "resolved": "git+ssh://git@gitlab.com/dylan-conway/public-install-test.git#93f3aa4ec9ca8a0bacc010776db48bfcd915c44c"
+ },
+ "packages/lol-package": {
+ "name": "lol",
+ "dependencies": {
+ "esbuild": "^0.19.4"
+ }
+ },
+ "packages/second": {
+ "version": "3.0.0",
+ "dependencies": {
+ "body-parser": "npm:express@*",
+ "connect": "200.0.0",
+ "express": "npm:svelte@*",
+ "hello": "0.3.2",
+ "lol": "*",
+ "not-body-parser": "*",
+ "svelte": "4.1.0"
+ }
+ },
+ "packages/second/node_modules/body-parser": {
+ "name": "express",
+ "version": "3.21.2",
+ "resolved": "https://registry.npmjs.org/express/-/express-3.21.2.tgz",
+ "integrity": "sha512-r3mq2RNCDxAdmZrzEAdjlk5/W7x8+vjU1aAcoAoZFq62KtkWQX+MbaSN4g59CwdUFf9MFf1VSqkZJ+LeR9jmww==",
+ "dependencies": {
+ "basic-auth": "~1.0.3",
+ "commander": "2.6.0",
+ "connect": "2.30.2",
+ "content-disposition": "0.5.0",
+ "content-type": "~1.0.1",
+ "cookie": "0.1.3",
+ "cookie-signature": "1.0.6",
+ "debug": "~2.2.0",
+ "depd": "~1.0.1",
+ "escape-html": "1.0.2",
+ "etag": "~1.7.0",
+ "fresh": "0.3.0",
+ "merge-descriptors": "1.0.0",
+ "methods": "~1.1.1",
+ "mkdirp": "0.5.1",
+ "parseurl": "~1.3.0",
+ "proxy-addr": "~1.0.8",
+ "range-parser": "~1.0.2",
+ "send": "0.13.0",
+ "utils-merge": "1.0.0",
+ "vary": "~1.0.1"
+ },
+ "bin": {
+ "express": "bin/express"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "packages/second/node_modules/body-parser/node_modules/body-parser": {
+ "version": "1.13.3",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.13.3.tgz",
+ "integrity": "sha512-ypX8/9uws2W+CjPp3QMmz1qklzlhRBknQve22Y+WFecHql+qDFfG+VVNX7sooA4Q3+2fdq4ZZj6Xr07gA90RZg==",
+ "dependencies": {
+ "bytes": "2.1.0",
+ "content-type": "~1.0.1",
+ "debug": "~2.2.0",
+ "depd": "~1.0.1",
+ "http-errors": "~1.3.1",
+ "iconv-lite": "0.4.11",
+ "on-finished": "~2.3.0",
+ "qs": "4.0.0",
+ "raw-body": "~2.1.2",
+ "type-is": "~1.6.6"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "packages/second/node_modules/body-parser/node_modules/connect": {
+ "version": "2.30.2",
+ "resolved": "https://registry.npmjs.org/connect/-/connect-2.30.2.tgz",
+ "integrity": "sha512-eY4YHls5bz/g6h9Q8B/aVkS6D7+TRiRlI3ksuruv3yc2rLbTG7HB/7T/CoZsuVH5e2i3S9J+2eARV5o7GIYq8Q==",
+ "deprecated": "connect 2.x series is deprecated",
+ "dependencies": {
+ "basic-auth-connect": "1.0.0",
+ "body-parser": "~1.13.3",
+ "bytes": "2.1.0",
+ "compression": "~1.5.2",
+ "connect-timeout": "~1.6.2",
+ "content-type": "~1.0.1",
+ "cookie": "0.1.3",
+ "cookie-parser": "~1.3.5",
+ "cookie-signature": "1.0.6",
+ "csurf": "~1.8.3",
+ "debug": "~2.2.0",
+ "depd": "~1.0.1",
+ "errorhandler": "~1.4.2",
+ "express-session": "~1.11.3",
+ "finalhandler": "0.4.0",
+ "fresh": "0.3.0",
+ "http-errors": "~1.3.1",
+ "method-override": "~2.3.5",
+ "morgan": "~1.6.1",
+ "multiparty": "3.3.2",
+ "on-headers": "~1.0.0",
+ "parseurl": "~1.3.0",
+ "pause": "0.1.0",
+ "qs": "4.0.0",
+ "response-time": "~2.3.1",
+ "serve-favicon": "~2.3.0",
+ "serve-index": "~1.7.2",
+ "serve-static": "~1.10.0",
+ "type-is": "~1.6.6",
+ "utils-merge": "1.0.0",
+ "vhost": "~3.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "packages/second/node_modules/svelte": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.1.0.tgz",
+ "integrity": "sha512-qob6IX0ui4Z++Lhwzvqb6aig79WhwsF3z6y1YMicjvw0rv71hxD+RmMFG3BM8lB7prNLXeOLnP64Zrynqa3Gtw==",
+ "dependencies": {
+ "@ampproject/remapping": "^2.2.1",
+ "@jridgewell/sourcemap-codec": "^1.4.15",
+ "@jridgewell/trace-mapping": "^0.3.18",
+ "acorn": "^8.9.0",
+ "aria-query": "^5.3.0",
+ "axobject-query": "^3.2.1",
+ "code-red": "^1.0.3",
+ "css-tree": "^2.3.1",
+ "estree-walker": "^3.0.3",
+ "is-reference": "^3.0.1",
+ "locate-character": "^3.0.0",
+ "magic-string": "^0.30.0",
+ "periscopic": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "packages/with-postinstall": {
+ "version": "1.0.0",
+ "hasInstallScript": true,
+ "dependencies": {
+ "sharp": "*",
+ "svelte": "3.50.0"
+ }
+ },
+ "packages/with-postinstall/node_modules/svelte": {
+ "version": "3.50.0",
+ "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.50.0.tgz",
+ "integrity": "sha512-zXeOUDS7+85i+RxLN+0iB6PMbGH7OhEgjETcD1fD8ZrhuhNFxYxYEHU41xuhkHIulJavcu3PKbPyuCrBxdxskQ==",
+ "engines": {
+ "node": ">= 8"
+ }
+ }
+ }
+}
diff --git a/test/cli/install/migration/complex-workspace/package.json b/test/cli/install/migration/complex-workspace/package.json
new file mode 100644
index 000000000..55ed302cb
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "root",
+ "version": "0.0.0",
+ "dependencies": {
+ "bar": "https://github.com/oven-sh/bun/raw/f7e4eb83694aa007a492ef66c28ffbe6a2dae791/test/cli/install/bar-0.0.2.tgz",
+ "bun-types": "file:bun-types",
+ "hello": "file:hello-0.3.2.tgz",
+ "install-test": "bitbucket:dylan-conway/public-install-test",
+ "install-test1": "git+ssh://git@github.com/dylan-conway/install-test.git#596234dab30564f37adae1e5c4d7123bcffce537",
+ "public-install-test": "gitlab:dylan-conway/public-install-test",
+ "svelte": "4.1.2"
+ },
+ "workspaces": [
+ "packages/*"
+ ]
+}
diff --git a/test/cli/install/migration/complex-workspace/packages/body-parser/isfake.txt b/test/cli/install/migration/complex-workspace/packages/body-parser/isfake.txt
new file mode 100644
index 000000000..f32a5804e
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/packages/body-parser/isfake.txt
@@ -0,0 +1 @@
+true \ No newline at end of file
diff --git a/test/cli/install/migration/complex-workspace/packages/body-parser/package.json b/test/cli/install/migration/complex-workspace/packages/body-parser/package.json
new file mode 100644
index 000000000..e0c363a20
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/packages/body-parser/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "body-parser",
+ "version": "200.0.0",
+ "dependencies": {
+ "svelte": "git+ssh://git@gitlab.com/dylan-conway/public-install-test.git#93f3aa4ec9ca8a0bacc010776db48bfcd915c44c"
+ }
+}
diff --git a/test/cli/install/migration/complex-workspace/packages/lol-package/package.json b/test/cli/install/migration/complex-workspace/packages/lol-package/package.json
new file mode 100644
index 000000000..a90e57966
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/packages/lol-package/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "lol",
+ "dependencies": {
+ "esbuild": "^0.19.4"
+ }
+}
diff --git a/test/cli/install/migration/complex-workspace/packages/second/package.json b/test/cli/install/migration/complex-workspace/packages/second/package.json
new file mode 100644
index 000000000..5c4d8b2c9
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/packages/second/package.json
@@ -0,0 +1,12 @@
+{
+ "name": "second",
+ "version": "3.0.0",
+ "dependencies": {
+ "body-parser": "npm:express@*",
+ "express": "npm:svelte@*",
+ "hello": "0.3.2",
+ "lol": "*",
+ "not-body-parser": "*",
+ "svelte": "4.1.0"
+ }
+}
diff --git a/test/cli/install/migration/complex-workspace/packages/with-postinstall/.gitignore b/test/cli/install/migration/complex-workspace/packages/with-postinstall/.gitignore
new file mode 100644
index 000000000..c0e59404b
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/packages/with-postinstall/.gitignore
@@ -0,0 +1 @@
+postinstall.txt \ No newline at end of file
diff --git a/test/cli/install/migration/complex-workspace/packages/with-postinstall/package.json b/test/cli/install/migration/complex-workspace/packages/with-postinstall/package.json
new file mode 100644
index 000000000..5959d95be
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/packages/with-postinstall/package.json
@@ -0,0 +1,11 @@
+{
+ "name": "with-postinstall",
+ "version": "1.0.0",
+ "dependencies": {
+ "sharp": "*",
+ "svelte": "3.50.0"
+ },
+ "scripts": {
+ "postinstall": "bun postinstall.js"
+ }
+}
diff --git a/test/cli/install/migration/complex-workspace/packages/with-postinstall/postinstall.js b/test/cli/install/migration/complex-workspace/packages/with-postinstall/postinstall.js
new file mode 100644
index 000000000..88ed99cf4
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/packages/with-postinstall/postinstall.js
@@ -0,0 +1,6 @@
+import { writeFileSync } from "fs";
+
+writeFileSync(import.meta.dir + "/postinstall.txt", `i ran!`);
+
+// TODO: postinstall doesnt run sharp's scripts yet :(
+// import "sharp";
diff --git a/test/cli/install/migration/complex-workspace/readme.md b/test/cli/install/migration/complex-workspace/readme.md
new file mode 100644
index 000000000..6f482035b
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/readme.md
@@ -0,0 +1 @@
+this case has a very fun and hard to understand dependency graph. bun pm migrate is expected to migrate it without changing what packages will install. the hoisting doesnt match exactly what npm does, but it is equally valid.
diff --git a/test/cli/install/migration/complex-workspace/reset.ts b/test/cli/install/migration/complex-workspace/reset.ts
new file mode 100644
index 000000000..6573d9811
--- /dev/null
+++ b/test/cli/install/migration/complex-workspace/reset.ts
@@ -0,0 +1,9 @@
+import fs from "fs";
+
+fs.rmSync("bun.lockb", { recursive: true, force: true });
+fs.rmSync("node_modules", { recursive: true, force: true });
+fs.rmSync("packages/body-parser/node_modules", { recursive: true, force: true });
+fs.rmSync("packages/lol-package/node_modules", { recursive: true, force: true });
+fs.rmSync("packages/second/node_modules", { recursive: true, force: true });
+fs.rmSync("packages/with-postinstall/node_modules", { recursive: true, force: true });
+fs.rmSync("packages/with-postinstall/postinstall.txt", { recursive: true, force: true });
diff --git a/test/cli/install/migration/contoso-test/.gitignore b/test/cli/install/migration/contoso-test/.gitignore
new file mode 100644
index 000000000..0d4bb62c5
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/.gitignore
@@ -0,0 +1,2 @@
+!package-lock.json
+bun.lockb \ No newline at end of file
diff --git a/test/cli/install/migration/contoso-test/LICENSE b/test/cli/install/migration/contoso-test/LICENSE
new file mode 100644
index 000000000..b12fb48c8
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright 2022 (c) Microsoft Corporation.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE \ No newline at end of file
diff --git a/test/cli/install/migration/contoso-test/api/package.json b/test/cli/install/migration/contoso-test/api/package.json
new file mode 100644
index 000000000..66eb9beb7
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/api/package.json
@@ -0,0 +1,42 @@
+{
+ "name": "api",
+ "version": "1.0.0",
+ "description": "",
+ "scripts": {
+ "env": "azd env get-values --no-prompt > .env",
+ "build": "tsc",
+ "watch": "tsc --w",
+ "prestart": "tsc && func extensions install",
+ "start:host": "func start",
+ "start": "npm-run-all --parallel start:host watch",
+ "lint": "eslint --config ../../.eslintrc.js",
+ "lint:fix": "npm run lint -- --fix"
+ },
+ "dependencies": {
+ "@azure/identity": "^2.1.0",
+ "@azure/keyvault-secrets": "^4.5.1",
+ "applicationinsights": "^2.3.4",
+ "dotenv": "^16.0.1",
+ "mongodb": "^4.7.0",
+ "mongoose": "^6.5.3",
+ "pg": "^8.8.0",
+ "swagger-ui-dist": "^4.14.0",
+ "winston": "^3.8.1",
+ "winston-transport": "^4.5.0",
+ "yamljs": "^0.3.0"
+ },
+ "devDependencies": {
+ "@azure/functions": "^1.2.3",
+ "@types/node": "^18.11.18",
+ "@types/pg": "^8.6.6",
+ "@types/swagger-ui-dist": "^3.30.1",
+ "@types/yamljs": "^0.2.31",
+ "@typescript-eslint/eslint-plugin": "^5.48.1",
+ "@typescript-eslint/parser": "^5.48.1",
+ "azure-functions-core-tools": "4.0.5095",
+ "eslint": "^8.31.0",
+ "eslint-config-prettier": "^8.6.0",
+ "npm-run-all": "^4.1.5",
+ "typescript": "^4.8.4"
+ }
+}
diff --git a/test/cli/install/migration/contoso-test/blog-cms/package.json b/test/cli/install/migration/contoso-test/blog-cms/package.json
new file mode 100644
index 000000000..d4445b849
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/blog-cms/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "blog-cms",
+ "private": true,
+ "version": "0.1.0",
+ "description": "The blog backend",
+ "scripts": {
+ "develop": "strapi develop",
+ "start": "strapi start",
+ "build": "strapi build",
+ "strapi": "strapi",
+ "docker:build": "docker build --tag cms .",
+ "docker:run": "docker run --rm --publish 1337:1337 --env-file ../../.env.docker cms"
+ },
+ "devDependencies": {
+ "@types/lodash.set": "^4.3.7"
+ },
+ "dependencies": {
+ "@strapi/plugin-graphql": "^4.9.1",
+ "@strapi/plugin-i18n": "^4.5.6",
+ "@strapi/plugin-users-permissions": "^4.5.6",
+ "@strapi/strapi": "^4.5.6",
+ "lodash.set": "^4.3.2",
+ "pg": "^8.8.0",
+ "strapi-provider-upload-azure-storage": "^2.1.0"
+ },
+ "strapi": {
+ "uuid": "42db7187-d121-4240-b174-3b2b3605f696"
+ },
+ "engines": {
+ "node": ">=14.19.1 <=18.x.x",
+ "npm": ">=6.0.0"
+ },
+ "license": "MIT"
+}
diff --git a/test/cli/install/migration/contoso-test/blog/package.json b/test/cli/install/migration/contoso-test/blog/package.json
new file mode 100644
index 000000000..d7459bd0f
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/blog/package.json
@@ -0,0 +1,38 @@
+{
+ "name": "blog",
+ "version": "1.0.2",
+ "private": true,
+ "scripts": {
+ "develop": "next dev",
+ "dev": "next dev",
+ "build": "next build",
+ "start": "next start",
+ "deploy": "next build && next export",
+ "lint": "next lint",
+ "lint:fix": "next lint --fix",
+ "docker:build": "docker build --tag blog .",
+ "docker:run": "docker run --rm --publish 3000:3000 --env-file ../../.env.docker blog"
+ },
+ "dependencies": {
+ "next": "^13.3.0",
+ "qs": "^6.10.1",
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0",
+ "react-markdown": "^8.0.4",
+ "rehype-raw": "^6.1.1",
+ "rehype-sanitize": "^5.0.1",
+ "uikit": "^3.16.14"
+ },
+ "license": "MIT",
+ "devDependencies": {
+ "@types/node": "^18.11.18",
+ "@typescript-eslint/eslint-plugin": "^5.48.1",
+ "@typescript-eslint/parser": "^5.48.1",
+ "eslint": "^8.31.0",
+ "eslint-config-next": "^13.3.0",
+ "eslint-config-prettier": "^8.6.0",
+ "eslint-plugin-prettier": "^4.2.1",
+ "prettier": "^2.8.2",
+ "typescript": "^4.8.4"
+ }
+}
diff --git a/test/cli/install/migration/contoso-test/package-lock.json b/test/cli/install/migration/contoso-test/package-lock.json
new file mode 100644
index 000000000..387d5ca99
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/package-lock.json
@@ -0,0 +1,36716 @@
+{
+ "name": "contoso-real-estate",
+ "version": "1.0.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "contoso-real-estate",
+ "version": "1.0.0",
+ "license": "MIT",
+ "workspaces": [
+ "packages/*"
+ ],
+ "devDependencies": {
+ "concurrently": "^7.6.0",
+ "git-commit-msg-linter": "^4.2.1",
+ "prettier": "^2.7.1",
+ "rimraf": "^4.3.1"
+ },
+ "engines": {
+ "node": "18.15.0",
+ "npm": ">=8"
+ }
+ },
+ "node_modules/@aashutoshrathi/word-wrap": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz",
+ "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/@ampproject/remapping": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
+ "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.0",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@angular-devkit/architect": {
+ "version": "0.1602.4",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1602.4.tgz",
+ "integrity": "sha512-SQr/FZ8wEOGC6EM+7V5rWyb/qpK0LFND/WbES5l+Yvwv+TEyPihsh5QCPmvPxi45eFbaHPrXkIZnvxnkxRDN/A==",
+ "dev": true,
+ "dependencies": {
+ "@angular-devkit/core": "16.2.4",
+ "rxjs": "7.8.1"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0",
+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
+ "yarn": ">= 1.13.0"
+ }
+ },
+ "node_modules/@angular-devkit/build-angular": {
+ "version": "16.2.4",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-16.2.4.tgz",
+ "integrity": "sha512-qWWjw321+qKzQ3U+arPJ5fdqxZ/aeT5HuxAtA7xqNu/cqnqvRZ8RVbbnugFx4U1R271tABT+N+N1kkIep/vlDg==",
+ "dev": true,
+ "dependencies": {
+ "@ampproject/remapping": "2.2.1",
+ "@angular-devkit/architect": "0.1602.4",
+ "@angular-devkit/build-webpack": "0.1602.4",
+ "@angular-devkit/core": "16.2.4",
+ "@babel/core": "7.22.9",
+ "@babel/generator": "7.22.9",
+ "@babel/helper-annotate-as-pure": "7.22.5",
+ "@babel/helper-split-export-declaration": "7.22.6",
+ "@babel/plugin-proposal-async-generator-functions": "7.20.7",
+ "@babel/plugin-transform-async-to-generator": "7.22.5",
+ "@babel/plugin-transform-runtime": "7.22.9",
+ "@babel/preset-env": "7.22.9",
+ "@babel/runtime": "7.22.6",
+ "@babel/template": "7.22.5",
+ "@discoveryjs/json-ext": "0.5.7",
+ "@ngtools/webpack": "16.2.4",
+ "@vitejs/plugin-basic-ssl": "1.0.1",
+ "ansi-colors": "4.1.3",
+ "autoprefixer": "10.4.14",
+ "babel-loader": "9.1.3",
+ "babel-plugin-istanbul": "6.1.1",
+ "browserslist": "^4.21.5",
+ "chokidar": "3.5.3",
+ "copy-webpack-plugin": "11.0.0",
+ "critters": "0.0.20",
+ "css-loader": "6.8.1",
+ "esbuild-wasm": "0.18.17",
+ "fast-glob": "3.3.1",
+ "guess-parser": "0.4.22",
+ "https-proxy-agent": "5.0.1",
+ "inquirer": "8.2.4",
+ "jsonc-parser": "3.2.0",
+ "karma-source-map-support": "1.4.0",
+ "less": "4.1.3",
+ "less-loader": "11.1.0",
+ "license-webpack-plugin": "4.0.2",
+ "loader-utils": "3.2.1",
+ "magic-string": "0.30.1",
+ "mini-css-extract-plugin": "2.7.6",
+ "mrmime": "1.0.1",
+ "open": "8.4.2",
+ "ora": "5.4.1",
+ "parse5-html-rewriting-stream": "7.0.0",
+ "picomatch": "2.3.1",
+ "piscina": "4.0.0",
+ "postcss": "8.4.27",
+ "postcss-loader": "7.3.3",
+ "resolve-url-loader": "5.0.0",
+ "rxjs": "7.8.1",
+ "sass": "1.64.1",
+ "sass-loader": "13.3.2",
+ "semver": "7.5.4",
+ "source-map-loader": "4.0.1",
+ "source-map-support": "0.5.21",
+ "terser": "5.19.2",
+ "text-table": "0.2.0",
+ "tree-kill": "1.2.2",
+ "tslib": "2.6.1",
+ "vite": "4.4.7",
+ "webpack": "5.88.2",
+ "webpack-dev-middleware": "6.1.1",
+ "webpack-dev-server": "4.15.1",
+ "webpack-merge": "5.9.0",
+ "webpack-subresource-integrity": "5.1.0"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0",
+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
+ "yarn": ">= 1.13.0"
+ },
+ "optionalDependencies": {
+ "esbuild": "0.18.17"
+ },
+ "peerDependencies": {
+ "@angular/compiler-cli": "^16.0.0",
+ "@angular/localize": "^16.0.0",
+ "@angular/platform-server": "^16.0.0",
+ "@angular/service-worker": "^16.0.0",
+ "jest": "^29.5.0",
+ "jest-environment-jsdom": "^29.5.0",
+ "karma": "^6.3.0",
+ "ng-packagr": "^16.0.0",
+ "protractor": "^7.0.0",
+ "tailwindcss": "^2.0.0 || ^3.0.0",
+ "typescript": ">=4.9.3 <5.2"
+ },
+ "peerDependenciesMeta": {
+ "@angular/localize": {
+ "optional": true
+ },
+ "@angular/platform-server": {
+ "optional": true
+ },
+ "@angular/service-worker": {
+ "optional": true
+ },
+ "jest": {
+ "optional": true
+ },
+ "jest-environment-jsdom": {
+ "optional": true
+ },
+ "karma": {
+ "optional": true
+ },
+ "ng-packagr": {
+ "optional": true
+ },
+ "protractor": {
+ "optional": true
+ },
+ "tailwindcss": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@angular-devkit/build-angular/node_modules/tslib": {
+ "version": "2.6.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.1.tgz",
+ "integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==",
+ "dev": true
+ },
+ "node_modules/@angular-devkit/build-webpack": {
+ "version": "0.1602.4",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1602.4.tgz",
+ "integrity": "sha512-QOnMfAOFrAQKOw+odgymragqzv6Ts5/Ni7/SJ1iLwlQcH6TajT6373fSCDFdKV40ntF53yjnexIsLx81/dK+Cg==",
+ "dev": true,
+ "dependencies": {
+ "@angular-devkit/architect": "0.1602.4",
+ "rxjs": "7.8.1"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0",
+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
+ "yarn": ">= 1.13.0"
+ },
+ "peerDependencies": {
+ "webpack": "^5.30.0",
+ "webpack-dev-server": "^4.0.0"
+ }
+ },
+ "node_modules/@angular-devkit/core": {
+ "version": "16.2.4",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-16.2.4.tgz",
+ "integrity": "sha512-VCZ1z1lDbFkbYkQ6ZMEFfmNzkMEOCBKSzAhWutRyd7oM02by4/5SvDSXd5BMvMxWhPJ/567DdSPOfhhnXQkkDg==",
+ "dev": true,
+ "dependencies": {
+ "ajv": "8.12.0",
+ "ajv-formats": "2.1.1",
+ "jsonc-parser": "3.2.0",
+ "picomatch": "2.3.1",
+ "rxjs": "7.8.1",
+ "source-map": "0.7.4"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0",
+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
+ "yarn": ">= 1.13.0"
+ },
+ "peerDependencies": {
+ "chokidar": "^3.5.2"
+ },
+ "peerDependenciesMeta": {
+ "chokidar": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@angular-devkit/schematics": {
+ "version": "16.2.4",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-16.2.4.tgz",
+ "integrity": "sha512-TsSflKJlaHzKgcU/taQg5regmBP/ggvwVtAbJRBWmCaeQJzobFo68+rtwfYfvuQXKAR6KsbSJc97mqmq6zmTwQ==",
+ "dev": true,
+ "dependencies": {
+ "@angular-devkit/core": "16.2.4",
+ "jsonc-parser": "3.2.0",
+ "magic-string": "0.30.1",
+ "ora": "5.4.1",
+ "rxjs": "7.8.1"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0",
+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
+ "yarn": ">= 1.13.0"
+ }
+ },
+ "node_modules/@angular/animations": {
+ "version": "16.2.6",
+ "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-16.2.6.tgz",
+ "integrity": "sha512-NHnHdZFKLr1PB8RhscjsE/DMSVHhtjCqc3bhtOiOMYfAgm4nYrSFvp6nAaT5OoMTeAWuM0n8/HvAiFweEQgVQA==",
+ "dependencies": {
+ "tslib": "^2.3.0"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0"
+ },
+ "peerDependencies": {
+ "@angular/core": "16.2.6"
+ }
+ },
+ "node_modules/@angular/cdk": {
+ "version": "16.2.5",
+ "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-16.2.5.tgz",
+ "integrity": "sha512-9VbdWSYVFQq9y7Dl8KMooE+Sa5nx0l4Neue1IMmSS2v8b602VykiYA5aqz0BsLjfoiboXlUz6LCBXxukJtogcQ==",
+ "dependencies": {
+ "tslib": "^2.3.0"
+ },
+ "optionalDependencies": {
+ "parse5": "^7.1.2"
+ },
+ "peerDependencies": {
+ "@angular/common": "^16.0.0 || ^17.0.0",
+ "@angular/core": "^16.0.0 || ^17.0.0",
+ "rxjs": "^6.5.3 || ^7.4.0"
+ }
+ },
+ "node_modules/@angular/cli": {
+ "version": "16.2.4",
+ "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-16.2.4.tgz",
+ "integrity": "sha512-OjnlQ2wzhkc1q3iDbWtLeaXoPzS0BtevazT7vmB/MiNVgjDcF3bPFQTcBBvtWAF0wN9jgPC712X8ucwdEAOMlg==",
+ "dev": true,
+ "dependencies": {
+ "@angular-devkit/architect": "0.1602.4",
+ "@angular-devkit/core": "16.2.4",
+ "@angular-devkit/schematics": "16.2.4",
+ "@schematics/angular": "16.2.4",
+ "@yarnpkg/lockfile": "1.1.0",
+ "ansi-colors": "4.1.3",
+ "ini": "4.1.1",
+ "inquirer": "8.2.4",
+ "jsonc-parser": "3.2.0",
+ "npm-package-arg": "10.1.0",
+ "npm-pick-manifest": "8.0.1",
+ "open": "8.4.2",
+ "ora": "5.4.1",
+ "pacote": "15.2.0",
+ "resolve": "1.22.2",
+ "semver": "7.5.4",
+ "symbol-observable": "4.0.0",
+ "yargs": "17.7.2"
+ },
+ "bin": {
+ "ng": "bin/ng.js"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0",
+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
+ "yarn": ">= 1.13.0"
+ }
+ },
+ "node_modules/@angular/common": {
+ "version": "16.2.6",
+ "resolved": "https://registry.npmjs.org/@angular/common/-/common-16.2.6.tgz",
+ "integrity": "sha512-BjnahvtJHh2zXfCZjpWit+zMkggl/PrgUtPd02egzLmEKyXIMmQLYNpDZ+Pqgpb7eefU8yBPhL7WA2oKFjHjSg==",
+ "dependencies": {
+ "tslib": "^2.3.0"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0"
+ },
+ "peerDependencies": {
+ "@angular/core": "16.2.6",
+ "rxjs": "^6.5.3 || ^7.4.0"
+ }
+ },
+ "node_modules/@angular/compiler": {
+ "version": "16.2.6",
+ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-16.2.6.tgz",
+ "integrity": "sha512-FKv9isn8BdM9TydyhdqcFhFD8nn11+fGqg3qbIQnOlnLb0ryYign93zBmlx/qFu46PvPtTmhsa4saE2NwvrSbg==",
+ "dependencies": {
+ "tslib": "^2.3.0"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0"
+ },
+ "peerDependencies": {
+ "@angular/core": "16.2.6"
+ },
+ "peerDependenciesMeta": {
+ "@angular/core": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@angular/compiler-cli": {
+ "version": "16.2.6",
+ "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-16.2.6.tgz",
+ "integrity": "sha512-rzyI4dKVj8T9dCnZCIffoxZ2PplYLmC9yd65VoaKxOQFxf/95/hgIRdt5kafjnZvzFN1qUbQuEfyviY+KFdQKg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/core": "7.22.5",
+ "@jridgewell/sourcemap-codec": "^1.4.14",
+ "chokidar": "^3.0.0",
+ "convert-source-map": "^1.5.1",
+ "reflect-metadata": "^0.1.2",
+ "semver": "^7.0.0",
+ "tslib": "^2.3.0",
+ "yargs": "^17.2.1"
+ },
+ "bin": {
+ "ng-xi18n": "bundles/src/bin/ng_xi18n.js",
+ "ngc": "bundles/src/bin/ngc.js",
+ "ngcc": "bundles/ngcc/index.js"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0"
+ },
+ "peerDependencies": {
+ "@angular/compiler": "16.2.6",
+ "typescript": ">=4.9.3 <5.2"
+ }
+ },
+ "node_modules/@angular/compiler-cli/node_modules/@babel/core": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.5.tgz",
+ "integrity": "sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg==",
+ "dev": true,
+ "dependencies": {
+ "@ampproject/remapping": "^2.2.0",
+ "@babel/code-frame": "^7.22.5",
+ "@babel/generator": "^7.22.5",
+ "@babel/helper-compilation-targets": "^7.22.5",
+ "@babel/helper-module-transforms": "^7.22.5",
+ "@babel/helpers": "^7.22.5",
+ "@babel/parser": "^7.22.5",
+ "@babel/template": "^7.22.5",
+ "@babel/traverse": "^7.22.5",
+ "@babel/types": "^7.22.5",
+ "convert-source-map": "^1.7.0",
+ "debug": "^4.1.0",
+ "gensync": "^1.0.0-beta.2",
+ "json5": "^2.2.2",
+ "semver": "^6.3.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/babel"
+ }
+ },
+ "node_modules/@angular/compiler-cli/node_modules/@babel/core/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/@angular/core": {
+ "version": "16.2.6",
+ "resolved": "https://registry.npmjs.org/@angular/core/-/core-16.2.6.tgz",
+ "integrity": "sha512-F7kJbkVHLupdVQbwjjEuWp5rtxmfnL571VtqRN/8OJZAI2OjZjnSbL+FRZGEZHDmOZ2cNgPKpYt/d3nbK8hpSw==",
+ "dependencies": {
+ "tslib": "^2.3.0"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0"
+ },
+ "peerDependencies": {
+ "rxjs": "^6.5.3 || ^7.4.0",
+ "zone.js": "~0.13.0"
+ }
+ },
+ "node_modules/@angular/forms": {
+ "version": "16.2.6",
+ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-16.2.6.tgz",
+ "integrity": "sha512-TsSpV6Oh0Z5WlCmRB6jEsChLA8ChBn8CY1uOkTh4YQEzdMCwvBvc1Q2DugER5iGvZU/hRNgjyHX7VR3ysB3JlQ==",
+ "dependencies": {
+ "tslib": "^2.3.0"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0"
+ },
+ "peerDependencies": {
+ "@angular/common": "16.2.6",
+ "@angular/core": "16.2.6",
+ "@angular/platform-browser": "16.2.6",
+ "rxjs": "^6.5.3 || ^7.4.0"
+ }
+ },
+ "node_modules/@angular/material": {
+ "version": "16.2.5",
+ "resolved": "https://registry.npmjs.org/@angular/material/-/material-16.2.5.tgz",
+ "integrity": "sha512-IK+Xs0IYnPUMzbUKzKzL59uDu0LVxwqyNOKj3ZU1MaZrbKIY/KCgjK2TcShYB0nLjuQhuz8Zr5AJW0m2pLZ+0g==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/auto-init": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/banner": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/button": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/card": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/checkbox": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/chips": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/circular-progress": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/data-table": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/density": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dialog": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/drawer": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/fab": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/floating-label": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/form-field": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/icon-button": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/image-list": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/layout-grid": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/line-ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/linear-progress": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/list": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/menu": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/menu-surface": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/notched-outline": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/radio": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/segmented-button": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/select": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/slider": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/snackbar": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/switch": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tab": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tab-bar": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tab-indicator": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tab-scroller": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/textfield": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tooltip": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/top-app-bar": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/touch-target": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.3.0"
+ },
+ "peerDependencies": {
+ "@angular/animations": "^16.0.0 || ^17.0.0",
+ "@angular/cdk": "16.2.5",
+ "@angular/common": "^16.0.0 || ^17.0.0",
+ "@angular/core": "^16.0.0 || ^17.0.0",
+ "@angular/forms": "^16.0.0 || ^17.0.0",
+ "@angular/platform-browser": "^16.0.0 || ^17.0.0",
+ "rxjs": "^6.5.3 || ^7.4.0"
+ }
+ },
+ "node_modules/@angular/platform-browser": {
+ "version": "16.2.6",
+ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-16.2.6.tgz",
+ "integrity": "sha512-jXtarSZ/n6ytZQ9+Y0aDuazz5POz4UmLN3GxIWtc4kqPOQp4o3DCM16Ig4ioSm53Z/WSDASVaMwtRWN5SXCKfw==",
+ "dependencies": {
+ "tslib": "^2.3.0"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0"
+ },
+ "peerDependencies": {
+ "@angular/animations": "16.2.6",
+ "@angular/common": "16.2.6",
+ "@angular/core": "16.2.6"
+ },
+ "peerDependenciesMeta": {
+ "@angular/animations": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@angular/platform-browser-dynamic": {
+ "version": "16.2.6",
+ "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-16.2.6.tgz",
+ "integrity": "sha512-i3prfdjnOMMemQMLk7vywGueDsjRIcug+jNf4ZdSb4AEaAhv86mzt5z3iNNSSA3bec7oJfrxOayMz3o6zq3QXA==",
+ "dependencies": {
+ "tslib": "^2.3.0"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0"
+ },
+ "peerDependencies": {
+ "@angular/common": "16.2.6",
+ "@angular/compiler": "16.2.6",
+ "@angular/core": "16.2.6",
+ "@angular/platform-browser": "16.2.6"
+ }
+ },
+ "node_modules/@angular/router": {
+ "version": "16.2.6",
+ "resolved": "https://registry.npmjs.org/@angular/router/-/router-16.2.6.tgz",
+ "integrity": "sha512-huORA6D1UriaswbvVgfxpYQJofZ3hSDdJYRMI4lDcu1n6CaCoYnj8E3rqaU5U1Va0OeFmxzOuXG+3WyL+YfZgg==",
+ "dependencies": {
+ "tslib": "^2.3.0"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0"
+ },
+ "peerDependencies": {
+ "@angular/common": "16.2.6",
+ "@angular/core": "16.2.6",
+ "@angular/platform-browser": "16.2.6",
+ "rxjs": "^6.5.3 || ^7.4.0"
+ }
+ },
+ "node_modules/@apollo/client": {
+ "version": "3.8.4",
+ "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.8.4.tgz",
+ "integrity": "sha512-QFXE4ylSHUa6LgYoOGsPysJCm4YJOOM1NwHyF6msZdZXIerqUVpLvxQOdQEXgS0RWvYiBMC1wGOWKzJKSWBdAg==",
+ "peer": true,
+ "dependencies": {
+ "@graphql-typed-document-node/core": "^3.1.1",
+ "@wry/context": "^0.7.3",
+ "@wry/equality": "^0.5.6",
+ "@wry/trie": "^0.4.3",
+ "graphql-tag": "^2.12.6",
+ "hoist-non-react-statics": "^3.3.2",
+ "optimism": "^0.17.5",
+ "prop-types": "^15.7.2",
+ "response-iterator": "^0.2.6",
+ "symbol-observable": "^4.0.0",
+ "ts-invariant": "^0.10.3",
+ "tslib": "^2.3.0",
+ "zen-observable-ts": "^1.2.5"
+ },
+ "peerDependencies": {
+ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0",
+ "graphql-ws": "^5.5.5",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "subscriptions-transport-ws": "^0.9.0 || ^0.11.0"
+ },
+ "peerDependenciesMeta": {
+ "graphql-ws": {
+ "optional": true
+ },
+ "react": {
+ "optional": true
+ },
+ "react-dom": {
+ "optional": true
+ },
+ "subscriptions-transport-ws": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@apollo/protobufjs": {
+ "version": "1.2.7",
+ "resolved": "https://registry.npmjs.org/@apollo/protobufjs/-/protobufjs-1.2.7.tgz",
+ "integrity": "sha512-Lahx5zntHPZia35myYDBRuF58tlwPskwHc5CWBZC/4bMKB6siTBWwtMrkqXcsNwQiFSzSx5hKdRPUmemrEp3Gg==",
+ "hasInstallScript": true,
+ "dependencies": {
+ "@protobufjs/aspromise": "^1.1.2",
+ "@protobufjs/base64": "^1.1.2",
+ "@protobufjs/codegen": "^2.0.4",
+ "@protobufjs/eventemitter": "^1.1.0",
+ "@protobufjs/fetch": "^1.1.0",
+ "@protobufjs/float": "^1.0.2",
+ "@protobufjs/inquire": "^1.1.0",
+ "@protobufjs/path": "^1.1.2",
+ "@protobufjs/pool": "^1.1.0",
+ "@protobufjs/utf8": "^1.1.0",
+ "@types/long": "^4.0.0",
+ "long": "^4.0.0"
+ },
+ "bin": {
+ "apollo-pbjs": "bin/pbjs",
+ "apollo-pbts": "bin/pbts"
+ }
+ },
+ "node_modules/@apollo/usage-reporting-protobuf": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/@apollo/usage-reporting-protobuf/-/usage-reporting-protobuf-4.1.1.tgz",
+ "integrity": "sha512-u40dIUePHaSKVshcedO7Wp+mPiZsaU6xjv9J+VyxpoU/zL6Jle+9zWeG98tr/+SZ0nZ4OXhrbb8SNr0rAPpIDA==",
+ "dependencies": {
+ "@apollo/protobufjs": "1.2.7"
+ }
+ },
+ "node_modules/@apollo/utils.dropunuseddefinitions": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@apollo/utils.dropunuseddefinitions/-/utils.dropunuseddefinitions-1.1.0.tgz",
+ "integrity": "sha512-jU1XjMr6ec9pPoL+BFWzEPW7VHHulVdGKMkPAMiCigpVIT11VmCbnij0bWob8uS3ODJ65tZLYKAh/55vLw2rbg==",
+ "engines": {
+ "node": ">=12.13.0"
+ },
+ "peerDependencies": {
+ "graphql": "14.x || 15.x || 16.x"
+ }
+ },
+ "node_modules/@apollo/utils.keyvaluecache": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@apollo/utils.keyvaluecache/-/utils.keyvaluecache-1.0.2.tgz",
+ "integrity": "sha512-p7PVdLPMnPzmXSQVEsy27cYEjVON+SH/Wb7COyW3rQN8+wJgT1nv9jZouYtztWW8ZgTkii5T6tC9qfoDREd4mg==",
+ "dependencies": {
+ "@apollo/utils.logger": "^1.0.0",
+ "lru-cache": "7.10.1 - 7.13.1"
+ }
+ },
+ "node_modules/@apollo/utils.keyvaluecache/node_modules/lru-cache": {
+ "version": "7.13.1",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.1.tgz",
+ "integrity": "sha512-CHqbAq7NFlW3RSnoWXLJBxCWaZVBrfa9UEHId2M3AW8iEBurbqduNexEUCGc3SHc6iCYXNJCDi903LajSVAEPQ==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@apollo/utils.logger": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@apollo/utils.logger/-/utils.logger-1.0.1.tgz",
+ "integrity": "sha512-XdlzoY7fYNK4OIcvMD2G94RoFZbzTQaNP0jozmqqMudmaGo2I/2Jx71xlDJ801mWA/mbYRihyaw6KJii7k5RVA=="
+ },
+ "node_modules/@apollo/utils.printwithreducedwhitespace": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@apollo/utils.printwithreducedwhitespace/-/utils.printwithreducedwhitespace-1.1.0.tgz",
+ "integrity": "sha512-GfFSkAv3n1toDZ4V6u2d7L4xMwLA+lv+6hqXicMN9KELSJ9yy9RzuEXaX73c/Ry+GzRsBy/fdSUGayGqdHfT2Q==",
+ "engines": {
+ "node": ">=12.13.0"
+ },
+ "peerDependencies": {
+ "graphql": "14.x || 15.x || 16.x"
+ }
+ },
+ "node_modules/@apollo/utils.removealiases": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@apollo/utils.removealiases/-/utils.removealiases-1.0.0.tgz",
+ "integrity": "sha512-6cM8sEOJW2LaGjL/0vHV0GtRaSekrPQR4DiywaApQlL9EdROASZU5PsQibe2MWeZCOhNrPRuHh4wDMwPsWTn8A==",
+ "engines": {
+ "node": ">=12.13.0"
+ },
+ "peerDependencies": {
+ "graphql": "14.x || 15.x || 16.x"
+ }
+ },
+ "node_modules/@apollo/utils.sortast": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@apollo/utils.sortast/-/utils.sortast-1.1.0.tgz",
+ "integrity": "sha512-VPlTsmUnOwzPK5yGZENN069y6uUHgeiSlpEhRnLFYwYNoJHsuJq2vXVwIaSmts015WTPa2fpz1inkLYByeuRQA==",
+ "dependencies": {
+ "lodash.sortby": "^4.7.0"
+ },
+ "engines": {
+ "node": ">=12.13.0"
+ },
+ "peerDependencies": {
+ "graphql": "14.x || 15.x || 16.x"
+ }
+ },
+ "node_modules/@apollo/utils.stripsensitiveliterals": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/@apollo/utils.stripsensitiveliterals/-/utils.stripsensitiveliterals-1.2.0.tgz",
+ "integrity": "sha512-E41rDUzkz/cdikM5147d8nfCFVKovXxKBcjvLEQ7bjZm/cg9zEcXvS6vFY8ugTubI3fn6zoqo0CyU8zT+BGP9w==",
+ "engines": {
+ "node": ">=12.13.0"
+ },
+ "peerDependencies": {
+ "graphql": "14.x || 15.x || 16.x"
+ }
+ },
+ "node_modules/@apollo/utils.usagereporting": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@apollo/utils.usagereporting/-/utils.usagereporting-1.0.1.tgz",
+ "integrity": "sha512-6dk+0hZlnDbahDBB2mP/PZ5ybrtCJdLMbeNJD+TJpKyZmSY6bA3SjI8Cr2EM9QA+AdziywuWg+SgbWUF3/zQqQ==",
+ "dependencies": {
+ "@apollo/usage-reporting-protobuf": "^4.0.0",
+ "@apollo/utils.dropunuseddefinitions": "^1.1.0",
+ "@apollo/utils.printwithreducedwhitespace": "^1.1.0",
+ "@apollo/utils.removealiases": "1.0.0",
+ "@apollo/utils.sortast": "^1.1.0",
+ "@apollo/utils.stripsensitiveliterals": "^1.2.0"
+ },
+ "engines": {
+ "node": ">=12.13.0"
+ },
+ "peerDependencies": {
+ "graphql": "14.x || 15.x || 16.x"
+ }
+ },
+ "node_modules/@apollographql/apollo-tools": {
+ "version": "0.5.4",
+ "resolved": "https://registry.npmjs.org/@apollographql/apollo-tools/-/apollo-tools-0.5.4.tgz",
+ "integrity": "sha512-shM3q7rUbNyXVVRkQJQseXv6bnYM3BUma/eZhwXR4xsuM+bqWnJKvW7SAfRjP7LuSCocrexa5AXhjjawNHrIlw==",
+ "engines": {
+ "node": ">=8",
+ "npm": ">=6"
+ },
+ "peerDependencies": {
+ "graphql": "^14.2.1 || ^15.0.0 || ^16.0.0"
+ }
+ },
+ "node_modules/@apollographql/graphql-playground-html": {
+ "version": "1.6.29",
+ "resolved": "https://registry.npmjs.org/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.29.tgz",
+ "integrity": "sha512-xCcXpoz52rI4ksJSdOCxeOCn2DLocxwHf9dVT/Q90Pte1LX+LY+91SFtJF3KXVHH8kEin+g1KKCQPKBjZJfWNA==",
+ "dependencies": {
+ "xss": "^1.0.8"
+ }
+ },
+ "node_modules/@assemblyscript/loader": {
+ "version": "0.10.1",
+ "resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz",
+ "integrity": "sha512-H71nDOOL8Y7kWRLqf6Sums+01Q5msqBW2KhDUTemh1tvY04eSkSXrK0uj/4mmY0Xr16/3zyZmsrxN7CKuRbNRg==",
+ "dev": true
+ },
+ "node_modules/@aws-crypto/crc32": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@aws-crypto/crc32/-/crc32-3.0.0.tgz",
+ "integrity": "sha512-IzSgsrxUcsrejQbPVilIKy16kAT52EwB6zSaI+M3xxIhKh5+aldEyvI+z6erM7TCLB2BJsFrtHjp6/4/sr+3dA==",
+ "optional": true,
+ "dependencies": {
+ "@aws-crypto/util": "^3.0.0",
+ "@aws-sdk/types": "^3.222.0",
+ "tslib": "^1.11.1"
+ }
+ },
+ "node_modules/@aws-crypto/crc32/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "optional": true
+ },
+ "node_modules/@aws-crypto/ie11-detection": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@aws-crypto/ie11-detection/-/ie11-detection-3.0.0.tgz",
+ "integrity": "sha512-341lBBkiY1DfDNKai/wXM3aujNBkXR7tq1URPQDL9wi3AUbI80NR74uF1TXHMm7po1AcnFk8iu2S2IeU/+/A+Q==",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^1.11.1"
+ }
+ },
+ "node_modules/@aws-crypto/ie11-detection/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "optional": true
+ },
+ "node_modules/@aws-crypto/sha256-browser": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-3.0.0.tgz",
+ "integrity": "sha512-8VLmW2B+gjFbU5uMeqtQM6Nj0/F1bro80xQXCW6CQBWgosFWXTx77aeOF5CAIAmbOK64SdMBJdNr6J41yP5mvQ==",
+ "optional": true,
+ "dependencies": {
+ "@aws-crypto/ie11-detection": "^3.0.0",
+ "@aws-crypto/sha256-js": "^3.0.0",
+ "@aws-crypto/supports-web-crypto": "^3.0.0",
+ "@aws-crypto/util": "^3.0.0",
+ "@aws-sdk/types": "^3.222.0",
+ "@aws-sdk/util-locate-window": "^3.0.0",
+ "@aws-sdk/util-utf8-browser": "^3.0.0",
+ "tslib": "^1.11.1"
+ }
+ },
+ "node_modules/@aws-crypto/sha256-browser/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "optional": true
+ },
+ "node_modules/@aws-crypto/sha256-js": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-3.0.0.tgz",
+ "integrity": "sha512-PnNN7os0+yd1XvXAy23CFOmTbMaDxgxXtTKHybrJ39Y8kGzBATgBFibWJKH6BhytLI/Zyszs87xCOBNyBig6vQ==",
+ "optional": true,
+ "dependencies": {
+ "@aws-crypto/util": "^3.0.0",
+ "@aws-sdk/types": "^3.222.0",
+ "tslib": "^1.11.1"
+ }
+ },
+ "node_modules/@aws-crypto/sha256-js/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "optional": true
+ },
+ "node_modules/@aws-crypto/supports-web-crypto": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-3.0.0.tgz",
+ "integrity": "sha512-06hBdMwUAb2WFTuGG73LSC0wfPu93xWwo5vL2et9eymgmu3Id5vFAHBbajVWiGhPO37qcsdCap/FqXvJGJWPIg==",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^1.11.1"
+ }
+ },
+ "node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "optional": true
+ },
+ "node_modules/@aws-crypto/util": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-3.0.0.tgz",
+ "integrity": "sha512-2OJlpeJpCR48CC8r+uKVChzs9Iungj9wkZrl8Z041DWEWvyIHILYKCPNzJghKsivj+S3mLo6BVc7mBNzdxA46w==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/types": "^3.222.0",
+ "@aws-sdk/util-utf8-browser": "^3.0.0",
+ "tslib": "^1.11.1"
+ }
+ },
+ "node_modules/@aws-crypto/util/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "optional": true
+ },
+ "node_modules/@aws-sdk/client-cognito-identity": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.418.0.tgz",
+ "integrity": "sha512-8Gib2gMbfCfxNz/FgSRijl47pnmV/rVvyRNoYtk24xndUydhyXKFTB0cqGVDpPv7eRb3wWQ9YZYVuaBDnEdZ1A==",
+ "optional": true,
+ "dependencies": {
+ "@aws-crypto/sha256-browser": "3.0.0",
+ "@aws-crypto/sha256-js": "3.0.0",
+ "@aws-sdk/client-sts": "3.418.0",
+ "@aws-sdk/credential-provider-node": "3.418.0",
+ "@aws-sdk/middleware-host-header": "3.418.0",
+ "@aws-sdk/middleware-logger": "3.418.0",
+ "@aws-sdk/middleware-recursion-detection": "3.418.0",
+ "@aws-sdk/middleware-signing": "3.418.0",
+ "@aws-sdk/middleware-user-agent": "3.418.0",
+ "@aws-sdk/region-config-resolver": "3.418.0",
+ "@aws-sdk/types": "3.418.0",
+ "@aws-sdk/util-endpoints": "3.418.0",
+ "@aws-sdk/util-user-agent-browser": "3.418.0",
+ "@aws-sdk/util-user-agent-node": "3.418.0",
+ "@smithy/config-resolver": "^2.0.10",
+ "@smithy/fetch-http-handler": "^2.1.5",
+ "@smithy/hash-node": "^2.0.9",
+ "@smithy/invalid-dependency": "^2.0.9",
+ "@smithy/middleware-content-length": "^2.0.11",
+ "@smithy/middleware-endpoint": "^2.0.9",
+ "@smithy/middleware-retry": "^2.0.12",
+ "@smithy/middleware-serde": "^2.0.9",
+ "@smithy/middleware-stack": "^2.0.2",
+ "@smithy/node-config-provider": "^2.0.12",
+ "@smithy/node-http-handler": "^2.1.5",
+ "@smithy/protocol-http": "^3.0.5",
+ "@smithy/smithy-client": "^2.1.6",
+ "@smithy/types": "^2.3.3",
+ "@smithy/url-parser": "^2.0.9",
+ "@smithy/util-base64": "^2.0.0",
+ "@smithy/util-body-length-browser": "^2.0.0",
+ "@smithy/util-body-length-node": "^2.1.0",
+ "@smithy/util-defaults-mode-browser": "^2.0.10",
+ "@smithy/util-defaults-mode-node": "^2.0.12",
+ "@smithy/util-retry": "^2.0.2",
+ "@smithy/util-utf8": "^2.0.0",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/client-sso": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.418.0.tgz",
+ "integrity": "sha512-fakz3YeSW/kCAOJ5w4ObrrQBxsYO8sU8i6WHLv6iWAsYZKAws2Mqa8g89P61+GitSH4z9waksdLouS6ep78/5A==",
+ "optional": true,
+ "dependencies": {
+ "@aws-crypto/sha256-browser": "3.0.0",
+ "@aws-crypto/sha256-js": "3.0.0",
+ "@aws-sdk/middleware-host-header": "3.418.0",
+ "@aws-sdk/middleware-logger": "3.418.0",
+ "@aws-sdk/middleware-recursion-detection": "3.418.0",
+ "@aws-sdk/middleware-user-agent": "3.418.0",
+ "@aws-sdk/region-config-resolver": "3.418.0",
+ "@aws-sdk/types": "3.418.0",
+ "@aws-sdk/util-endpoints": "3.418.0",
+ "@aws-sdk/util-user-agent-browser": "3.418.0",
+ "@aws-sdk/util-user-agent-node": "3.418.0",
+ "@smithy/config-resolver": "^2.0.10",
+ "@smithy/fetch-http-handler": "^2.1.5",
+ "@smithy/hash-node": "^2.0.9",
+ "@smithy/invalid-dependency": "^2.0.9",
+ "@smithy/middleware-content-length": "^2.0.11",
+ "@smithy/middleware-endpoint": "^2.0.9",
+ "@smithy/middleware-retry": "^2.0.12",
+ "@smithy/middleware-serde": "^2.0.9",
+ "@smithy/middleware-stack": "^2.0.2",
+ "@smithy/node-config-provider": "^2.0.12",
+ "@smithy/node-http-handler": "^2.1.5",
+ "@smithy/protocol-http": "^3.0.5",
+ "@smithy/smithy-client": "^2.1.6",
+ "@smithy/types": "^2.3.3",
+ "@smithy/url-parser": "^2.0.9",
+ "@smithy/util-base64": "^2.0.0",
+ "@smithy/util-body-length-browser": "^2.0.0",
+ "@smithy/util-body-length-node": "^2.1.0",
+ "@smithy/util-defaults-mode-browser": "^2.0.10",
+ "@smithy/util-defaults-mode-node": "^2.0.12",
+ "@smithy/util-retry": "^2.0.2",
+ "@smithy/util-utf8": "^2.0.0",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/client-sts": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.418.0.tgz",
+ "integrity": "sha512-L0n0Hw+Pm+BhXTN1bYZ0y4JAMArYgazdHf1nUSlEHndgZicCCuQtlMLxfo3i/IbtWi0dzfZcZ9d/MdAM8p4Jyw==",
+ "optional": true,
+ "dependencies": {
+ "@aws-crypto/sha256-browser": "3.0.0",
+ "@aws-crypto/sha256-js": "3.0.0",
+ "@aws-sdk/credential-provider-node": "3.418.0",
+ "@aws-sdk/middleware-host-header": "3.418.0",
+ "@aws-sdk/middleware-logger": "3.418.0",
+ "@aws-sdk/middleware-recursion-detection": "3.418.0",
+ "@aws-sdk/middleware-sdk-sts": "3.418.0",
+ "@aws-sdk/middleware-signing": "3.418.0",
+ "@aws-sdk/middleware-user-agent": "3.418.0",
+ "@aws-sdk/region-config-resolver": "3.418.0",
+ "@aws-sdk/types": "3.418.0",
+ "@aws-sdk/util-endpoints": "3.418.0",
+ "@aws-sdk/util-user-agent-browser": "3.418.0",
+ "@aws-sdk/util-user-agent-node": "3.418.0",
+ "@smithy/config-resolver": "^2.0.10",
+ "@smithy/fetch-http-handler": "^2.1.5",
+ "@smithy/hash-node": "^2.0.9",
+ "@smithy/invalid-dependency": "^2.0.9",
+ "@smithy/middleware-content-length": "^2.0.11",
+ "@smithy/middleware-endpoint": "^2.0.9",
+ "@smithy/middleware-retry": "^2.0.12",
+ "@smithy/middleware-serde": "^2.0.9",
+ "@smithy/middleware-stack": "^2.0.2",
+ "@smithy/node-config-provider": "^2.0.12",
+ "@smithy/node-http-handler": "^2.1.5",
+ "@smithy/protocol-http": "^3.0.5",
+ "@smithy/smithy-client": "^2.1.6",
+ "@smithy/types": "^2.3.3",
+ "@smithy/url-parser": "^2.0.9",
+ "@smithy/util-base64": "^2.0.0",
+ "@smithy/util-body-length-browser": "^2.0.0",
+ "@smithy/util-body-length-node": "^2.1.0",
+ "@smithy/util-defaults-mode-browser": "^2.0.10",
+ "@smithy/util-defaults-mode-node": "^2.0.12",
+ "@smithy/util-retry": "^2.0.2",
+ "@smithy/util-utf8": "^2.0.0",
+ "fast-xml-parser": "4.2.5",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/credential-provider-cognito-identity": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.418.0.tgz",
+ "integrity": "sha512-MakYZsT7fkG1W9IgkBz7PTXG/e6YD2oSEk+hPgwfdMv0YX76qjTU02B2qbbKSGtXichX73MNUPOvygF5XAi6oA==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/client-cognito-identity": "3.418.0",
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/property-provider": "^2.0.0",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/credential-provider-env": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.418.0.tgz",
+ "integrity": "sha512-e74sS+x63EZUBO+HaI8zor886YdtmULzwKdctsZp5/37Xho1CVUNtEC+fYa69nigBD9afoiH33I4JggaHgrekQ==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/property-provider": "^2.0.0",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/credential-provider-ini": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.418.0.tgz",
+ "integrity": "sha512-LTAeKKV85unlSqGNIeqEZ4N9gufaSoH+670n5YTUEk564zHCkUQW0PJomzLF5jKBco6Yfzv6rPBTukd+x9XWqw==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/credential-provider-env": "3.418.0",
+ "@aws-sdk/credential-provider-process": "3.418.0",
+ "@aws-sdk/credential-provider-sso": "3.418.0",
+ "@aws-sdk/credential-provider-web-identity": "3.418.0",
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/credential-provider-imds": "^2.0.0",
+ "@smithy/property-provider": "^2.0.0",
+ "@smithy/shared-ini-file-loader": "^2.0.6",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/credential-provider-node": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.418.0.tgz",
+ "integrity": "sha512-VveTjtSC6m8YXj3fQDkMKEZuHv+CR2Z4u/NAN51Fi4xOtIWUtOBj5rfZ8HmBYoBjRF0DtRlPXuMiNnXAzTctfQ==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/credential-provider-env": "3.418.0",
+ "@aws-sdk/credential-provider-ini": "3.418.0",
+ "@aws-sdk/credential-provider-process": "3.418.0",
+ "@aws-sdk/credential-provider-sso": "3.418.0",
+ "@aws-sdk/credential-provider-web-identity": "3.418.0",
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/credential-provider-imds": "^2.0.0",
+ "@smithy/property-provider": "^2.0.0",
+ "@smithy/shared-ini-file-loader": "^2.0.6",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/credential-provider-process": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.418.0.tgz",
+ "integrity": "sha512-xPbdm2WKz1oH6pTkrJoUmr3OLuqvvcPYTQX0IIlc31tmDwDWPQjXGGFD/vwZGIZIkKaFpFxVMgAzfFScxox7dw==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/property-provider": "^2.0.0",
+ "@smithy/shared-ini-file-loader": "^2.0.6",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/credential-provider-sso": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.418.0.tgz",
+ "integrity": "sha512-tUF5Hg/HfaU5t+E7IuvohYlodSIlBXa28xAJPPFxhKrUnvP6AIoW6JLazOtCIQjQgJYEUILV29XX+ojUuITcaw==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/client-sso": "3.418.0",
+ "@aws-sdk/token-providers": "3.418.0",
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/property-provider": "^2.0.0",
+ "@smithy/shared-ini-file-loader": "^2.0.6",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/credential-provider-web-identity": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.418.0.tgz",
+ "integrity": "sha512-do7ang565n9p3dS1JdsQY01rUfRx8vkxQqz5M8OlcEHBNiCdi2PvSjNwcBdrv/FKkyIxZb0TImOfBSt40hVdxQ==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/property-provider": "^2.0.0",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/credential-providers": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.418.0.tgz",
+ "integrity": "sha512-atEybTA0jvP9CpBCPKCoiPz1hjJ/lbRxf67r+fpAqPtfQKutGq/jZm78Yz5kV9F/NJEW2mK2GR/BslCAHc4H8g==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/client-cognito-identity": "3.418.0",
+ "@aws-sdk/client-sso": "3.418.0",
+ "@aws-sdk/client-sts": "3.418.0",
+ "@aws-sdk/credential-provider-cognito-identity": "3.418.0",
+ "@aws-sdk/credential-provider-env": "3.418.0",
+ "@aws-sdk/credential-provider-ini": "3.418.0",
+ "@aws-sdk/credential-provider-node": "3.418.0",
+ "@aws-sdk/credential-provider-process": "3.418.0",
+ "@aws-sdk/credential-provider-sso": "3.418.0",
+ "@aws-sdk/credential-provider-web-identity": "3.418.0",
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/credential-provider-imds": "^2.0.0",
+ "@smithy/property-provider": "^2.0.0",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/middleware-host-header": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.418.0.tgz",
+ "integrity": "sha512-LrMTdzalkPw/1ujLCKPLwCGvPMCmT4P+vOZQRbSEVZPnlZk+Aj++aL/RaHou0jL4kJH3zl8iQepriBt4a7UvXQ==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/protocol-http": "^3.0.5",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/middleware-logger": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.418.0.tgz",
+ "integrity": "sha512-StKGmyPVfoO/wdNTtKemYwoJsqIl4l7oqarQY7VSf2Mp3mqaa+njLViHsQbirYpyqpgUEusOnuTlH5utxJ1NsQ==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/middleware-recursion-detection": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.418.0.tgz",
+ "integrity": "sha512-kKFrIQglBLUFPbHSDy1+bbe3Na2Kd70JSUC3QLMbUHmqipXN8KeXRfAj7vTv97zXl0WzG0buV++WcNwOm1rFjg==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/protocol-http": "^3.0.5",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/middleware-sdk-sts": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sts/-/middleware-sdk-sts-3.418.0.tgz",
+ "integrity": "sha512-cW8ijrCTP+mgihvcq4+TbhAcE/we5lFl4ydRqvTdtcSnYQAVQADg47rnTScQiFsPFEB3NKq7BGeyTJF9MKolPA==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/middleware-signing": "3.418.0",
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/middleware-signing": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.418.0.tgz",
+ "integrity": "sha512-onvs5KoYQE8OlOE740RxWBGtsUyVIgAo0CzRKOQO63ZEYqpL1Os+MS1CGzdNhvQnJgJruE1WW+Ix8fjN30zKPA==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/property-provider": "^2.0.0",
+ "@smithy/protocol-http": "^3.0.5",
+ "@smithy/signature-v4": "^2.0.0",
+ "@smithy/types": "^2.3.3",
+ "@smithy/util-middleware": "^2.0.2",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/middleware-user-agent": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.418.0.tgz",
+ "integrity": "sha512-Jdcztg9Tal9SEAL0dKRrnpKrm6LFlWmAhvuwv0dQ7bNTJxIxyEFbpqdgy7mpQHsLVZgq1Aad/7gT/72c9igyZw==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/types": "3.418.0",
+ "@aws-sdk/util-endpoints": "3.418.0",
+ "@smithy/protocol-http": "^3.0.5",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/region-config-resolver": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.418.0.tgz",
+ "integrity": "sha512-lJRZ/9TjZU6yLz+mAwxJkcJZ6BmyYoIJVo1p5+BN//EFdEmC8/c0c9gXMRzfISV/mqWSttdtccpAyN4/goHTYA==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/node-config-provider": "^2.0.12",
+ "@smithy/types": "^2.3.3",
+ "@smithy/util-config-provider": "^2.0.0",
+ "@smithy/util-middleware": "^2.0.2",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/token-providers": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.418.0.tgz",
+ "integrity": "sha512-9P7Q0VN0hEzTngy3Sz5eya2qEOEf0Q8qf1vB3um0gE6ID6EVAdz/nc/DztfN32MFxk8FeVBrCP5vWdoOzmd72g==",
+ "optional": true,
+ "dependencies": {
+ "@aws-crypto/sha256-browser": "3.0.0",
+ "@aws-crypto/sha256-js": "3.0.0",
+ "@aws-sdk/middleware-host-header": "3.418.0",
+ "@aws-sdk/middleware-logger": "3.418.0",
+ "@aws-sdk/middleware-recursion-detection": "3.418.0",
+ "@aws-sdk/middleware-user-agent": "3.418.0",
+ "@aws-sdk/types": "3.418.0",
+ "@aws-sdk/util-endpoints": "3.418.0",
+ "@aws-sdk/util-user-agent-browser": "3.418.0",
+ "@aws-sdk/util-user-agent-node": "3.418.0",
+ "@smithy/config-resolver": "^2.0.10",
+ "@smithy/fetch-http-handler": "^2.1.5",
+ "@smithy/hash-node": "^2.0.9",
+ "@smithy/invalid-dependency": "^2.0.9",
+ "@smithy/middleware-content-length": "^2.0.11",
+ "@smithy/middleware-endpoint": "^2.0.9",
+ "@smithy/middleware-retry": "^2.0.12",
+ "@smithy/middleware-serde": "^2.0.9",
+ "@smithy/middleware-stack": "^2.0.2",
+ "@smithy/node-config-provider": "^2.0.12",
+ "@smithy/node-http-handler": "^2.1.5",
+ "@smithy/property-provider": "^2.0.0",
+ "@smithy/protocol-http": "^3.0.5",
+ "@smithy/shared-ini-file-loader": "^2.0.6",
+ "@smithy/smithy-client": "^2.1.6",
+ "@smithy/types": "^2.3.3",
+ "@smithy/url-parser": "^2.0.9",
+ "@smithy/util-base64": "^2.0.0",
+ "@smithy/util-body-length-browser": "^2.0.0",
+ "@smithy/util-body-length-node": "^2.1.0",
+ "@smithy/util-defaults-mode-browser": "^2.0.10",
+ "@smithy/util-defaults-mode-node": "^2.0.12",
+ "@smithy/util-retry": "^2.0.2",
+ "@smithy/util-utf8": "^2.0.0",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/types": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.418.0.tgz",
+ "integrity": "sha512-y4PQSH+ulfFLY0+FYkaK4qbIaQI9IJNMO2xsxukW6/aNoApNymN1D2FSi2la8Qbp/iPjNDKsG8suNPm9NtsWXQ==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/util-endpoints": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.418.0.tgz",
+ "integrity": "sha512-sYSDwRTl7yE7LhHkPzemGzmIXFVHSsi3AQ1KeNEk84eBqxMHHcCc2kqklaBk2roXWe50QDgRMy1ikZUxvtzNHQ==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/types": "3.418.0",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/util-locate-window": {
+ "version": "3.310.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.310.0.tgz",
+ "integrity": "sha512-qo2t/vBTnoXpjKxlsC2e1gBrRm80M3bId27r0BRB2VniSSe7bL1mmzM+/HFtujm0iAxtPM+aLEflLJlJeDPg0w==",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/util-user-agent-browser": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.418.0.tgz",
+ "integrity": "sha512-c4p4mc0VV/jIeNH0lsXzhJ1MpWRLuboGtNEpqE4s1Vl9ck2amv9VdUUZUmHbg+bVxlMgRQ4nmiovA4qIrqGuyg==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/types": "^2.3.3",
+ "bowser": "^2.11.0",
+ "tslib": "^2.5.0"
+ }
+ },
+ "node_modules/@aws-sdk/util-user-agent-node": {
+ "version": "3.418.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.418.0.tgz",
+ "integrity": "sha512-BXMskXFtg+dmzSCgmnWOffokxIbPr1lFqa1D9kvM3l3IFRiFGx2IyDg+8MAhq11aPDLvoa/BDuQ0Yqma5izOhg==",
+ "optional": true,
+ "dependencies": {
+ "@aws-sdk/types": "3.418.0",
+ "@smithy/node-config-provider": "^2.0.12",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ },
+ "peerDependencies": {
+ "aws-crt": ">=1.0.0"
+ },
+ "peerDependenciesMeta": {
+ "aws-crt": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@aws-sdk/util-utf8-browser": {
+ "version": "3.259.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.259.0.tgz",
+ "integrity": "sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw==",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.3.1"
+ }
+ },
+ "node_modules/@azure/abort-controller": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz",
+ "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==",
+ "dependencies": {
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/@azure/arm-appservice": {
+ "version": "12.0.0",
+ "resolved": "https://registry.npmjs.org/@azure/arm-appservice/-/arm-appservice-12.0.0.tgz",
+ "integrity": "sha512-Lw0xqJb0hNr4eekMz6OjH+6qyHJZzRQX9c0UOuhvWwVcQzD3mj29x0hvzW5FewrPQGHHrkGN3CeEImtPlYU9dg==",
+ "dev": true,
+ "dependencies": {
+ "@azure/abort-controller": "^1.0.0",
+ "@azure/core-auth": "^1.3.0",
+ "@azure/core-client": "^1.0.0",
+ "@azure/core-lro": "^2.2.0",
+ "@azure/core-paging": "^1.2.0",
+ "@azure/core-rest-pipeline": "^1.1.0",
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/@azure/arm-resources": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/@azure/arm-resources/-/arm-resources-5.2.0.tgz",
+ "integrity": "sha512-wQyuhL8WQsLkW/KMdik8bLJIJCz3Z6mg/+AKm0KedgK73SKhicSqYP+ed3t+43tLlRFltcrmGKMcHLQ+Jhv/6A==",
+ "dev": true,
+ "dependencies": {
+ "@azure/abort-controller": "^1.0.0",
+ "@azure/core-auth": "^1.3.0",
+ "@azure/core-client": "^1.7.0",
+ "@azure/core-lro": "^2.5.0",
+ "@azure/core-paging": "^1.2.0",
+ "@azure/core-rest-pipeline": "^1.8.0",
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@azure/arm-subscriptions": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@azure/arm-subscriptions/-/arm-subscriptions-5.1.0.tgz",
+ "integrity": "sha512-6BeOF2eQWNLq22ch7xP9RxYnPjtGev54OUCGggKOWoOvmesK7jUZbIyLk8JeXDT21PEl7iyYnxw78gxJ7zBxQw==",
+ "dev": true,
+ "dependencies": {
+ "@azure/abort-controller": "^1.0.0",
+ "@azure/core-auth": "^1.3.0",
+ "@azure/core-client": "^1.6.1",
+ "@azure/core-lro": "^2.2.0",
+ "@azure/core-paging": "^1.2.0",
+ "@azure/core-rest-pipeline": "^1.8.0",
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@azure/core-auth": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.5.0.tgz",
+ "integrity": "sha512-udzoBuYG1VBoHVohDTrvKjyzel34zt77Bhp7dQntVGGD0ehVq48owENbBG8fIgkHRNUBQH5k1r0hpoMu5L8+kw==",
+ "dependencies": {
+ "@azure/abort-controller": "^1.0.0",
+ "@azure/core-util": "^1.1.0",
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@azure/core-client": {
+ "version": "1.7.3",
+ "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.7.3.tgz",
+ "integrity": "sha512-kleJ1iUTxcO32Y06dH9Pfi9K4U+Tlb111WXEnbt7R/ne+NLRwppZiTGJuTD5VVoxTMK5NTbEtm5t2vcdNCFe2g==",
+ "dependencies": {
+ "@azure/abort-controller": "^1.0.0",
+ "@azure/core-auth": "^1.4.0",
+ "@azure/core-rest-pipeline": "^1.9.1",
+ "@azure/core-tracing": "^1.0.0",
+ "@azure/core-util": "^1.0.0",
+ "@azure/logger": "^1.0.0",
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@azure/core-http-compat": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-1.3.0.tgz",
+ "integrity": "sha512-ZN9avruqbQ5TxopzG3ih3KRy52n8OAbitX3fnZT5go4hzu0J+KVPSzkL+Wt3hpJpdG8WIfg1sBD1tWkgUdEpBA==",
+ "dependencies": {
+ "@azure/abort-controller": "^1.0.4",
+ "@azure/core-client": "^1.3.0",
+ "@azure/core-rest-pipeline": "^1.3.0"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/@azure/core-lro": {
+ "version": "2.5.4",
+ "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.5.4.tgz",
+ "integrity": "sha512-3GJiMVH7/10bulzOKGrrLeG/uCBH/9VtxqaMcB9lIqAeamI/xYQSHJL/KcsLDuH+yTjYpro/u6D/MuRe4dN70Q==",
+ "dependencies": {
+ "@azure/abort-controller": "^1.0.0",
+ "@azure/core-util": "^1.2.0",
+ "@azure/logger": "^1.0.0",
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@azure/core-paging": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.5.0.tgz",
+ "integrity": "sha512-zqWdVIt+2Z+3wqxEOGzR5hXFZ8MGKK52x4vFLw8n58pR6ZfKRx3EXYTxTaYxYHc/PexPUTyimcTWFJbji9Z6Iw==",
+ "dependencies": {
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@azure/core-rest-pipeline": {
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.12.1.tgz",
+ "integrity": "sha512-SsyWQ+T5MFQRX+M8H/66AlaI6HyCbQStGfFngx2fuiW+vKI2DkhtOvbYodPyf9fOe/ARLWWc3ohX54lQ5Kmaog==",
+ "dependencies": {
+ "@azure/abort-controller": "^1.0.0",
+ "@azure/core-auth": "^1.4.0",
+ "@azure/core-tracing": "^1.0.1",
+ "@azure/core-util": "^1.3.0",
+ "@azure/logger": "^1.0.0",
+ "form-data": "^4.0.0",
+ "http-proxy-agent": "^5.0.0",
+ "https-proxy-agent": "^5.0.0",
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@azure/core-tracing": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.1.tgz",
+ "integrity": "sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==",
+ "dependencies": {
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/@azure/core-util": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.5.0.tgz",
+ "integrity": "sha512-GZBpVFDtQ/15hW1OgBcRdT4Bl7AEpcEZqLfbAvOtm1CQUncKWiYapFHVD588hmlV27NbOOtSm3cnLF3lvoHi4g==",
+ "dependencies": {
+ "@azure/abort-controller": "^1.0.0",
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@azure/functions": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@azure/functions/-/functions-1.2.3.tgz",
+ "integrity": "sha512-dZITbYPNg6ay6ngcCOjRUh1wDhlFITS0zIkqplyH5KfKEAVPooaoaye5mUFnR+WP9WdGRjlNXyl/y2tgWKHcRg==",
+ "dev": true
+ },
+ "node_modules/@azure/identity": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-3.3.0.tgz",
+ "integrity": "sha512-gISa/dAAxrWt6F2WiDXZY0y2xY4MLlN2wkNW4cPuq5OgPQKLSkxLc4I2WR04puTfZyQZnpXbAapAMEj1b96fgg==",
+ "dev": true,
+ "dependencies": {
+ "@azure/abort-controller": "^1.0.0",
+ "@azure/core-auth": "^1.5.0",
+ "@azure/core-client": "^1.4.0",
+ "@azure/core-rest-pipeline": "^1.1.0",
+ "@azure/core-tracing": "^1.0.0",
+ "@azure/core-util": "^1.0.0",
+ "@azure/logger": "^1.0.0",
+ "@azure/msal-browser": "^2.37.1",
+ "@azure/msal-common": "^13.1.0",
+ "@azure/msal-node": "^1.17.3",
+ "events": "^3.0.0",
+ "jws": "^4.0.0",
+ "open": "^8.0.0",
+ "stoppable": "^1.1.0",
+ "tslib": "^2.2.0",
+ "uuid": "^8.3.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@azure/identity/node_modules/@azure/msal-common": {
+ "version": "13.3.0",
+ "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.0.tgz",
+ "integrity": "sha512-/VFWTicjcJbrGp3yQP7A24xU95NiDMe23vxIU1U6qdRPFsprMDNUohMudclnd+WSHE4/McqkZs/nUU3sAKkVjg==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/@azure/keyvault-secrets": {
+ "version": "4.7.0",
+ "resolved": "https://registry.npmjs.org/@azure/keyvault-secrets/-/keyvault-secrets-4.7.0.tgz",
+ "integrity": "sha512-YvlFXRQ+SI5NT4GtSFbb6HGo6prW3yzDab8tr6vga2/SjDQew3wJsCAAr/xwZz6XshFXCYEX26CDKmPf+SJKJg==",
+ "dependencies": {
+ "@azure/abort-controller": "^1.0.0",
+ "@azure/core-auth": "^1.3.0",
+ "@azure/core-client": "^1.5.0",
+ "@azure/core-http-compat": "^1.3.0",
+ "@azure/core-lro": "^2.2.0",
+ "@azure/core-paging": "^1.1.1",
+ "@azure/core-rest-pipeline": "^1.8.0",
+ "@azure/core-tracing": "^1.0.0",
+ "@azure/core-util": "^1.0.0",
+ "@azure/logger": "^1.0.0",
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@azure/logger": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.4.tgz",
+ "integrity": "sha512-ustrPY8MryhloQj7OWGe+HrYx+aoiOxzbXTtgblbV3xwCqpzUK36phH3XNHQKj3EPonyFUuDTfR3qFhTEAuZEg==",
+ "dependencies": {
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@azure/ms-rest-js": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.7.0.tgz",
+ "integrity": "sha512-ngbzWbqF+NmztDOpLBVDxYM+XLcUj7nKhxGbSU9WtIsXfRB//cf2ZbAG5HkOrhU9/wd/ORRB6lM/d69RKVjiyA==",
+ "dependencies": {
+ "@azure/core-auth": "^1.1.4",
+ "abort-controller": "^3.0.0",
+ "form-data": "^2.5.0",
+ "node-fetch": "^2.6.7",
+ "tslib": "^1.10.0",
+ "tunnel": "0.0.6",
+ "uuid": "^8.3.2",
+ "xml2js": "^0.5.0"
+ }
+ },
+ "node_modules/@azure/ms-rest-js/node_modules/form-data": {
+ "version": "2.5.1",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz",
+ "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==",
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.6",
+ "mime-types": "^2.1.12"
+ },
+ "engines": {
+ "node": ">= 0.12"
+ }
+ },
+ "node_modules/@azure/ms-rest-js/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
+ },
+ "node_modules/@azure/msal-browser": {
+ "version": "2.38.2",
+ "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-2.38.2.tgz",
+ "integrity": "sha512-71BeIn2we6LIgMplwCSaMq5zAwmalyJR3jFcVOZxNVfQ1saBRwOD+P77nLs5vrRCedVKTq8RMFhIOdpMLNno0A==",
+ "dependencies": {
+ "@azure/msal-common": "13.3.0"
+ },
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/@azure/msal-browser/node_modules/@azure/msal-common": {
+ "version": "13.3.0",
+ "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.0.tgz",
+ "integrity": "sha512-/VFWTicjcJbrGp3yQP7A24xU95NiDMe23vxIU1U6qdRPFsprMDNUohMudclnd+WSHE4/McqkZs/nUU3sAKkVjg==",
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/@azure/msal-common": {
+ "version": "6.4.0",
+ "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-6.4.0.tgz",
+ "integrity": "sha512-WZdgq9f9O8cbxGzdRwLLMM5xjmLJ2mdtuzgXeiGxIRkVVlJ9nZ6sWnDFKa2TX8j72UXD1IfL0p/RYNoTXYoGfg==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/@azure/msal-node": {
+ "version": "1.18.3",
+ "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.18.3.tgz",
+ "integrity": "sha512-lI1OsxNbS/gxRD4548Wyj22Dk8kS7eGMwD9GlBZvQmFV8FJUXoXySL1BiNzDsHUE96/DS/DHmA+F73p1Dkcktg==",
+ "dependencies": {
+ "@azure/msal-common": "13.3.0",
+ "jsonwebtoken": "^9.0.0",
+ "uuid": "^8.3.0"
+ },
+ "engines": {
+ "node": "10 || 12 || 14 || 16 || 18"
+ }
+ },
+ "node_modules/@azure/msal-node/node_modules/@azure/msal-common": {
+ "version": "13.3.0",
+ "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.0.tgz",
+ "integrity": "sha512-/VFWTicjcJbrGp3yQP7A24xU95NiDMe23vxIU1U6qdRPFsprMDNUohMudclnd+WSHE4/McqkZs/nUU3sAKkVjg==",
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/@azure/opentelemetry-instrumentation-azure-sdk": {
+ "version": "1.0.0-beta.5",
+ "resolved": "https://registry.npmjs.org/@azure/opentelemetry-instrumentation-azure-sdk/-/opentelemetry-instrumentation-azure-sdk-1.0.0-beta.5.tgz",
+ "integrity": "sha512-fsUarKQDvjhmBO4nIfaZkfNSApm1hZBzcvpNbSrXdcUBxu7lRvKsV5DnwszX7cnhLyVOW9yl1uigtRQ1yDANjA==",
+ "dependencies": {
+ "@azure/core-tracing": "^1.0.0",
+ "@azure/logger": "^1.0.0",
+ "@opentelemetry/api": "^1.4.1",
+ "@opentelemetry/core": "^1.15.2",
+ "@opentelemetry/instrumentation": "^0.41.2",
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@azure/static-web-apps-cli": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/@azure/static-web-apps-cli/-/static-web-apps-cli-1.1.4.tgz",
+ "integrity": "sha512-TRj5X5TZRRPlmgNDk0cm5z3W38sMqKMLoQVaHR+mNqSy9vut7sbKc/M7gZznwAXDIy5nc9wmyBtiw/PImdwNpQ==",
+ "dev": true,
+ "dependencies": {
+ "@azure/arm-appservice": "^12.0.0",
+ "@azure/arm-resources": "^5.0.1",
+ "@azure/arm-subscriptions": "^5.0.0",
+ "@azure/identity": "^3.1.2",
+ "@azure/msal-common": "^6.2.0",
+ "adm-zip": "^0.5.10",
+ "ajv": "^8.11.0",
+ "ajv-draft-04": "^1.0.0",
+ "chalk": "^4.1.2",
+ "cli-progress": "^3.10.0",
+ "commander": "^9.2.0",
+ "concurrently": "^7.1.0",
+ "cookie": "^0.5.0",
+ "devcert": "^1.2.0",
+ "dotenv": "^16.0.0",
+ "finalhandler": "^1.2.0",
+ "get-port": "^5.1.1",
+ "globrex": "^0.1.2",
+ "http-proxy": "^1.18.1",
+ "internal-ip": "^6.2.0",
+ "json-source-map": "^0.6.1",
+ "keytar": "^7.9.0",
+ "node-fetch": "^2.6.7",
+ "open": "^8.4.0",
+ "ora": "^5.4.1",
+ "pem": "^1.14.6",
+ "prompts": "^2.4.2",
+ "rimraf": "^3.0.2",
+ "selfsigned": "^2.0.1",
+ "serve-static": "^1.15.0",
+ "update-notifier": "^5.1.0",
+ "wait-on": "^6.0.1",
+ "yaml": "^2.0.1"
+ },
+ "bin": {
+ "swa": "dist/cli/bin.js"
+ },
+ "engines": {
+ "node": ">=14.0.0",
+ "npm": ">=6.0.0"
+ }
+ },
+ "node_modules/@azure/static-web-apps-cli/node_modules/rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dev": true,
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/@azure/storage-blob": {
+ "version": "10.5.0",
+ "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-10.5.0.tgz",
+ "integrity": "sha512-67+0EP7STy9BQgzvN1RgmSvXhxRd044eDgepX7zBp7XslBxz8YGo2cSLm9w5o5Qf1FLCRlwuziRMikaPCLMpVw==",
+ "deprecated": "This version has been deprecated, please upgrade to the version tagged as latest",
+ "dependencies": {
+ "@azure/ms-rest-js": "^2.0.0",
+ "events": "^3.0.0",
+ "tslib": "^1.9.3"
+ }
+ },
+ "node_modules/@azure/storage-blob/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
+ },
+ "node_modules/@babel/code-frame": {
+ "version": "7.22.13",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz",
+ "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==",
+ "dependencies": {
+ "@babel/highlight": "^7.22.13",
+ "chalk": "^2.4.2"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/code-frame/node_modules/ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dependencies": {
+ "color-convert": "^1.9.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/code-frame/node_modules/chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dependencies": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/code-frame/node_modules/color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dependencies": {
+ "color-name": "1.1.3"
+ }
+ },
+ "node_modules/@babel/code-frame/node_modules/color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
+ },
+ "node_modules/@babel/code-frame/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/@babel/code-frame/node_modules/has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/code-frame/node_modules/supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/compat-data": {
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.20.tgz",
+ "integrity": "sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/core": {
+ "version": "7.22.9",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.9.tgz",
+ "integrity": "sha512-G2EgeufBcYw27U4hhoIwFcgc1XU7TlXJ3mv04oOv1WCuo900U/anZSPzEqNjwdjgffkk2Gs0AN0dW1CKVLcG7w==",
+ "dependencies": {
+ "@ampproject/remapping": "^2.2.0",
+ "@babel/code-frame": "^7.22.5",
+ "@babel/generator": "^7.22.9",
+ "@babel/helper-compilation-targets": "^7.22.9",
+ "@babel/helper-module-transforms": "^7.22.9",
+ "@babel/helpers": "^7.22.6",
+ "@babel/parser": "^7.22.7",
+ "@babel/template": "^7.22.5",
+ "@babel/traverse": "^7.22.8",
+ "@babel/types": "^7.22.5",
+ "convert-source-map": "^1.7.0",
+ "debug": "^4.1.0",
+ "gensync": "^1.0.0-beta.2",
+ "json5": "^2.2.2",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/babel"
+ }
+ },
+ "node_modules/@babel/core/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/@babel/generator": {
+ "version": "7.22.9",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.9.tgz",
+ "integrity": "sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw==",
+ "dependencies": {
+ "@babel/types": "^7.22.5",
+ "@jridgewell/gen-mapping": "^0.3.2",
+ "@jridgewell/trace-mapping": "^0.3.17",
+ "jsesc": "^2.5.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-annotate-as-pure": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz",
+ "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==",
+ "dependencies": {
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.15.tgz",
+ "integrity": "sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/types": "^7.22.15"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-compilation-targets": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz",
+ "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==",
+ "dependencies": {
+ "@babel/compat-data": "^7.22.9",
+ "@babel/helper-validator-option": "^7.22.15",
+ "browserslist": "^4.21.9",
+ "lru-cache": "^5.1.1",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-compilation-targets/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/@babel/helper-create-class-features-plugin": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.15.tgz",
+ "integrity": "sha512-jKkwA59IXcvSaiK2UN45kKwSC9o+KuoXsBDvHvU/7BecYIp8GQ2UwrVvFgJASUT+hBnwJx6MhvMCuMzwZZ7jlg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-annotate-as-pure": "^7.22.5",
+ "@babel/helper-environment-visitor": "^7.22.5",
+ "@babel/helper-function-name": "^7.22.5",
+ "@babel/helper-member-expression-to-functions": "^7.22.15",
+ "@babel/helper-optimise-call-expression": "^7.22.5",
+ "@babel/helper-replace-supers": "^7.22.9",
+ "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5",
+ "@babel/helper-split-export-declaration": "^7.22.6",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-create-class-features-plugin/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/@babel/helper-create-regexp-features-plugin": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz",
+ "integrity": "sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-annotate-as-pure": "^7.22.5",
+ "regexpu-core": "^5.3.1",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/@babel/helper-define-polyfill-provider": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.2.tgz",
+ "integrity": "sha512-k0qnnOqHn5dK9pZpfD5XXZ9SojAITdCKRn2Lp6rnDGzIbaP0rHyMPk/4wsSxVBVz4RfN0q6VpXWP2pDGIoQ7hw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-compilation-targets": "^7.22.6",
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "debug": "^4.1.1",
+ "lodash.debounce": "^4.0.8",
+ "resolve": "^1.14.2"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
+ }
+ },
+ "node_modules/@babel/helper-environment-visitor": {
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz",
+ "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-function-name": {
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz",
+ "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==",
+ "dependencies": {
+ "@babel/template": "^7.22.15",
+ "@babel/types": "^7.23.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-function-name/node_modules/@babel/template": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
+ "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
+ "dependencies": {
+ "@babel/code-frame": "^7.22.13",
+ "@babel/parser": "^7.22.15",
+ "@babel/types": "^7.22.15"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-hoist-variables": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz",
+ "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==",
+ "dependencies": {
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-member-expression-to-functions": {
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz",
+ "integrity": "sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/types": "^7.23.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-module-imports": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz",
+ "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==",
+ "dependencies": {
+ "@babel/types": "^7.22.15"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-module-transforms": {
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz",
+ "integrity": "sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==",
+ "dependencies": {
+ "@babel/helper-environment-visitor": "^7.22.20",
+ "@babel/helper-module-imports": "^7.22.15",
+ "@babel/helper-simple-access": "^7.22.5",
+ "@babel/helper-split-export-declaration": "^7.22.6",
+ "@babel/helper-validator-identifier": "^7.22.20"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-optimise-call-expression": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz",
+ "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-plugin-utils": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz",
+ "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-remap-async-to-generator": {
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz",
+ "integrity": "sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-annotate-as-pure": "^7.22.5",
+ "@babel/helper-environment-visitor": "^7.22.20",
+ "@babel/helper-wrap-function": "^7.22.20"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-replace-supers": {
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.20.tgz",
+ "integrity": "sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-environment-visitor": "^7.22.20",
+ "@babel/helper-member-expression-to-functions": "^7.22.15",
+ "@babel/helper-optimise-call-expression": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-simple-access": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz",
+ "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==",
+ "dependencies": {
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-skip-transparent-expression-wrappers": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz",
+ "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==",
+ "dev": true,
+ "dependencies": {
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-split-export-declaration": {
+ "version": "7.22.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz",
+ "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==",
+ "dependencies": {
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-string-parser": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz",
+ "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-identifier": {
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz",
+ "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-option": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz",
+ "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-wrap-function": {
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz",
+ "integrity": "sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-function-name": "^7.22.5",
+ "@babel/template": "^7.22.15",
+ "@babel/types": "^7.22.19"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-wrap-function/node_modules/@babel/template": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
+ "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
+ "dev": true,
+ "dependencies": {
+ "@babel/code-frame": "^7.22.13",
+ "@babel/parser": "^7.22.15",
+ "@babel/types": "^7.22.15"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helpers": {
+ "version": "7.23.1",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.1.tgz",
+ "integrity": "sha512-chNpneuK18yW5Oxsr+t553UZzzAs3aZnFm4bxhebsNTeshrC95yA7l5yl7GBAG+JG1rF0F7zzD2EixK9mWSDoA==",
+ "dependencies": {
+ "@babel/template": "^7.22.15",
+ "@babel/traverse": "^7.23.0",
+ "@babel/types": "^7.23.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helpers/node_modules/@babel/template": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
+ "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
+ "dependencies": {
+ "@babel/code-frame": "^7.22.13",
+ "@babel/parser": "^7.22.15",
+ "@babel/types": "^7.22.15"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/highlight": {
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz",
+ "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==",
+ "dependencies": {
+ "@babel/helper-validator-identifier": "^7.22.20",
+ "chalk": "^2.4.2",
+ "js-tokens": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/highlight/node_modules/ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dependencies": {
+ "color-convert": "^1.9.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/highlight/node_modules/chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dependencies": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/highlight/node_modules/color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dependencies": {
+ "color-name": "1.1.3"
+ }
+ },
+ "node_modules/@babel/highlight/node_modules/color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
+ },
+ "node_modules/@babel/highlight/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/@babel/highlight/node_modules/has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/highlight/node_modules/supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/parser": {
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz",
+ "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==",
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.15.tgz",
+ "integrity": "sha512-FB9iYlz7rURmRJyXRKEnalYPPdn87H5no108cyuQQyMwlpJ2SJtpIUBI27kdTin956pz+LPypkPVPUTlxOmrsg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.15.tgz",
+ "integrity": "sha512-Hyph9LseGvAeeXzikV88bczhsrLrIZqDPxO+sSmAunMPaGrBGhfMWzCPYTtiW9t+HzSE2wtV8e5cc5P6r1xMDQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5",
+ "@babel/plugin-transform-optional-chaining": "^7.22.15"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.13.0"
+ }
+ },
+ "node_modules/@babel/plugin-proposal-async-generator-functions": {
+ "version": "7.20.7",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz",
+ "integrity": "sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==",
+ "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-environment-visitor": "^7.18.9",
+ "@babel/helper-plugin-utils": "^7.20.2",
+ "@babel/helper-remap-async-to-generator": "^7.18.9",
+ "@babel/plugin-syntax-async-generators": "^7.8.4"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-proposal-private-property-in-object": {
+ "version": "7.21.0-placeholder-for-preset-env.2",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz",
+ "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==",
+ "dev": true,
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-proposal-unicode-property-regex": {
+ "version": "7.18.6",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz",
+ "integrity": "sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==",
+ "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-unicode-property-regex instead.",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-create-regexp-features-plugin": "^7.18.6",
+ "@babel/helper-plugin-utils": "^7.18.6"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-async-generators": {
+ "version": "7.8.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz",
+ "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.8.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-bigint": {
+ "version": "7.8.3",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz",
+ "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.8.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-class-properties": {
+ "version": "7.12.13",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz",
+ "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.12.13"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-class-static-block": {
+ "version": "7.14.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz",
+ "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.14.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-dynamic-import": {
+ "version": "7.8.3",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz",
+ "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.8.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-export-namespace-from": {
+ "version": "7.8.3",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz",
+ "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.8.3"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-import-assertions": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz",
+ "integrity": "sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-import-attributes": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.22.5.tgz",
+ "integrity": "sha512-KwvoWDeNKPETmozyFE0P2rOLqh39EoQHNjqizrI5B8Vt0ZNS7M56s7dAiAqbYfiAYOuIzIh96z3iR2ktgu3tEg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-import-meta": {
+ "version": "7.10.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz",
+ "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.10.4"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-json-strings": {
+ "version": "7.8.3",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz",
+ "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.8.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-jsx": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz",
+ "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-logical-assignment-operators": {
+ "version": "7.10.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz",
+ "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.10.4"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": {
+ "version": "7.8.3",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz",
+ "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.8.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-numeric-separator": {
+ "version": "7.10.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz",
+ "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.10.4"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-object-rest-spread": {
+ "version": "7.8.3",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz",
+ "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.8.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-optional-catch-binding": {
+ "version": "7.8.3",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz",
+ "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.8.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-optional-chaining": {
+ "version": "7.8.3",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz",
+ "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.8.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-private-property-in-object": {
+ "version": "7.14.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz",
+ "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.14.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-top-level-await": {
+ "version": "7.14.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz",
+ "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.14.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-typescript": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz",
+ "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-unicode-sets-regex": {
+ "version": "7.18.6",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz",
+ "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-create-regexp-features-plugin": "^7.18.6",
+ "@babel/helper-plugin-utils": "^7.18.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-arrow-functions": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz",
+ "integrity": "sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-async-generator-functions": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.15.tgz",
+ "integrity": "sha512-jBm1Es25Y+tVoTi5rfd5t1KLmL8ogLKpXszboWOTTtGFGz2RKnQe2yn7HbZ+kb/B8N0FVSGQo874NSlOU1T4+w==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-environment-visitor": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/helper-remap-async-to-generator": "^7.22.9",
+ "@babel/plugin-syntax-async-generators": "^7.8.4"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-async-to-generator": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.22.5.tgz",
+ "integrity": "sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-module-imports": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/helper-remap-async-to-generator": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-block-scoped-functions": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.22.5.tgz",
+ "integrity": "sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-block-scoping": {
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.0.tgz",
+ "integrity": "sha512-cOsrbmIOXmf+5YbL99/S49Y3j46k/T16b9ml8bm9lP6N9US5iQ2yBK7gpui1pg0V/WMcXdkfKbTb7HXq9u+v4g==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-class-properties": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.22.5.tgz",
+ "integrity": "sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-create-class-features-plugin": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-class-static-block": {
+ "version": "7.22.11",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.11.tgz",
+ "integrity": "sha512-GMM8gGmqI7guS/llMFk1bJDkKfn3v3C4KHK9Yg1ey5qcHcOlKb0QvcMrgzvxo+T03/4szNh5lghY+fEC98Kq9g==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-create-class-features-plugin": "^7.22.11",
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/plugin-syntax-class-static-block": "^7.14.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.12.0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-classes": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.15.tgz",
+ "integrity": "sha512-VbbC3PGjBdE0wAWDdHM9G8Gm977pnYI0XpqMd6LrKISj8/DJXEsWqgRuTYaNE9Bv0JGhTZUzHDlMk18IpOuoqw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-annotate-as-pure": "^7.22.5",
+ "@babel/helper-compilation-targets": "^7.22.15",
+ "@babel/helper-environment-visitor": "^7.22.5",
+ "@babel/helper-function-name": "^7.22.5",
+ "@babel/helper-optimise-call-expression": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/helper-replace-supers": "^7.22.9",
+ "@babel/helper-split-export-declaration": "^7.22.6",
+ "globals": "^11.1.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-computed-properties": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz",
+ "integrity": "sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/template": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-destructuring": {
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.0.tgz",
+ "integrity": "sha512-vaMdgNXFkYrB+8lbgniSYWHsgqK5gjaMNcc84bMIOMRLH0L9AqYq3hwMdvnyqj1OPqea8UtjPEuS/DCenah1wg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-dotall-regex": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.22.5.tgz",
+ "integrity": "sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-create-regexp-features-plugin": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-duplicate-keys": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.22.5.tgz",
+ "integrity": "sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-dynamic-import": {
+ "version": "7.22.11",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.11.tgz",
+ "integrity": "sha512-g/21plo58sfteWjaO0ZNVb+uEOkJNjAaHhbejrnBmu011l/eNDScmkbjCC3l4FKb10ViaGU4aOkFznSu2zRHgA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-exponentiation-operator": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.22.5.tgz",
+ "integrity": "sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-builder-binary-assignment-operator-visitor": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-export-namespace-from": {
+ "version": "7.22.11",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.11.tgz",
+ "integrity": "sha512-xa7aad7q7OiT8oNZ1mU7NrISjlSkVdMbNxn9IuLZyL9AJEhs1Apba3I+u5riX1dIkdptP5EKDG5XDPByWxtehw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/plugin-syntax-export-namespace-from": "^7.8.3"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-for-of": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.15.tgz",
+ "integrity": "sha512-me6VGeHsx30+xh9fbDLLPi0J1HzmeIIyenoOQHuw2D4m2SAU3NrspX5XxJLBpqn5yrLzrlw2Iy3RA//Bx27iOA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-function-name": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.22.5.tgz",
+ "integrity": "sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-compilation-targets": "^7.22.5",
+ "@babel/helper-function-name": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-json-strings": {
+ "version": "7.22.11",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.11.tgz",
+ "integrity": "sha512-CxT5tCqpA9/jXFlme9xIBCc5RPtdDq3JpkkhgHQqtDdiTnTI0jtZ0QzXhr5DILeYifDPp2wvY2ad+7+hLMW5Pw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/plugin-syntax-json-strings": "^7.8.3"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-literals": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.22.5.tgz",
+ "integrity": "sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-logical-assignment-operators": {
+ "version": "7.22.11",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.11.tgz",
+ "integrity": "sha512-qQwRTP4+6xFCDV5k7gZBF3C31K34ut0tbEcTKxlX/0KXxm9GLcO14p570aWxFvVzx6QAfPgq7gaeIHXJC8LswQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-member-expression-literals": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.22.5.tgz",
+ "integrity": "sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-modules-amd": {
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.23.0.tgz",
+ "integrity": "sha512-xWT5gefv2HGSm4QHtgc1sYPbseOyf+FFDo2JbpE25GWl5BqTGO9IMwTYJRoIdjsF85GE+VegHxSCUt5EvoYTAw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-module-transforms": "^7.23.0",
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-modules-commonjs": {
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.0.tgz",
+ "integrity": "sha512-32Xzss14/UVc7k9g775yMIvkVK8xwKE0DPdP5JTapr3+Z9w4tzeOuLNY6BXDQR6BdnzIlXnCGAzsk/ICHBLVWQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-module-transforms": "^7.23.0",
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/helper-simple-access": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-modules-systemjs": {
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.0.tgz",
+ "integrity": "sha512-qBej6ctXZD2f+DhlOC9yO47yEYgUh5CZNz/aBoH4j/3NOlRfJXJbY7xDQCqQVf9KbrqGzIWER1f23doHGrIHFg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-hoist-variables": "^7.22.5",
+ "@babel/helper-module-transforms": "^7.23.0",
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/helper-validator-identifier": "^7.22.20"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-modules-umd": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.22.5.tgz",
+ "integrity": "sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-module-transforms": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-named-capturing-groups-regex": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz",
+ "integrity": "sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-create-regexp-features-plugin": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-new-target": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.22.5.tgz",
+ "integrity": "sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-nullish-coalescing-operator": {
+ "version": "7.22.11",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.11.tgz",
+ "integrity": "sha512-YZWOw4HxXrotb5xsjMJUDlLgcDXSfO9eCmdl1bgW4+/lAGdkjaEvOnQ4p5WKKdUgSzO39dgPl0pTnfxm0OAXcg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-numeric-separator": {
+ "version": "7.22.11",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.11.tgz",
+ "integrity": "sha512-3dzU4QGPsILdJbASKhF/V2TVP+gJya1PsueQCxIPCEcerqF21oEcrob4mzjsp2Py/1nLfF5m+xYNMDpmA8vffg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/plugin-syntax-numeric-separator": "^7.10.4"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-object-rest-spread": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.15.tgz",
+ "integrity": "sha512-fEB+I1+gAmfAyxZcX1+ZUwLeAuuf8VIg67CTznZE0MqVFumWkh8xWtn58I4dxdVf080wn7gzWoF8vndOViJe9Q==",
+ "dev": true,
+ "dependencies": {
+ "@babel/compat-data": "^7.22.9",
+ "@babel/helper-compilation-targets": "^7.22.15",
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
+ "@babel/plugin-transform-parameters": "^7.22.15"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-object-super": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.22.5.tgz",
+ "integrity": "sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/helper-replace-supers": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-optional-catch-binding": {
+ "version": "7.22.11",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.11.tgz",
+ "integrity": "sha512-rli0WxesXUeCJnMYhzAglEjLWVDF6ahb45HuprcmQuLidBJFWjNnOzssk2kuc6e33FlLaiZhG/kUIzUMWdBKaQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/plugin-syntax-optional-catch-binding": "^7.8.3"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-optional-chaining": {
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.0.tgz",
+ "integrity": "sha512-sBBGXbLJjxTzLBF5rFWaikMnOGOk/BmK6vVByIdEggZ7Vn6CvWXZyRkkLFK6WE0IF8jSliyOkUN6SScFgzCM0g==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5",
+ "@babel/plugin-syntax-optional-chaining": "^7.8.3"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-parameters": {
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.15.tgz",
+ "integrity": "sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-private-methods": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.22.5.tgz",
+ "integrity": "sha512-PPjh4gyrQnGe97JTalgRGMuU4icsZFnWkzicB/fUtzlKUqvsWBKEpPPfr5a2JiyirZkHxnAqkQMO5Z5B2kK3fA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-create-class-features-plugin": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-private-property-in-object": {
+ "version": "7.22.11",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.11.tgz",
+ "integrity": "sha512-sSCbqZDBKHetvjSwpyWzhuHkmW5RummxJBVbYLkGkaiTOWGxml7SXt0iWa03bzxFIx7wOj3g/ILRd0RcJKBeSQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-annotate-as-pure": "^7.22.5",
+ "@babel/helper-create-class-features-plugin": "^7.22.11",
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/plugin-syntax-private-property-in-object": "^7.14.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-property-literals": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.22.5.tgz",
+ "integrity": "sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-react-jsx-self": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.22.5.tgz",
+ "integrity": "sha512-nTh2ogNUtxbiSbxaT4Ds6aXnXEipHweN9YRgOX/oNXdf0cCrGn/+2LozFa3lnPV5D90MkjhgckCPBrsoSc1a7g==",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-react-jsx-source": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.22.5.tgz",
+ "integrity": "sha512-yIiRO6yobeEIaI0RTbIr8iAK9FcBHLtZq0S89ZPjDLQXBA4xvghaKqI0etp/tF3htTM0sazJKKLz9oEiGRtu7w==",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-regenerator": {
+ "version": "7.22.10",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.10.tgz",
+ "integrity": "sha512-F28b1mDt8KcT5bUyJc/U9nwzw6cV+UmTeRlXYIl2TNqMMJif0Jeey9/RQ3C4NOd2zp0/TRsDns9ttj2L523rsw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "regenerator-transform": "^0.15.2"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-reserved-words": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.22.5.tgz",
+ "integrity": "sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-runtime": {
+ "version": "7.22.9",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.22.9.tgz",
+ "integrity": "sha512-9KjBH61AGJetCPYp/IEyLEp47SyybZb0nDRpBvmtEkm+rUIwxdlKpyNHI1TmsGkeuLclJdleQHRZ8XLBnnh8CQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-module-imports": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "babel-plugin-polyfill-corejs2": "^0.4.4",
+ "babel-plugin-polyfill-corejs3": "^0.8.2",
+ "babel-plugin-polyfill-regenerator": "^0.5.1",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-runtime/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/@babel/plugin-transform-shorthand-properties": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.22.5.tgz",
+ "integrity": "sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-spread": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.22.5.tgz",
+ "integrity": "sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-sticky-regex": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.22.5.tgz",
+ "integrity": "sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-template-literals": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.22.5.tgz",
+ "integrity": "sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-typeof-symbol": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.22.5.tgz",
+ "integrity": "sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-unicode-escapes": {
+ "version": "7.22.10",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.10.tgz",
+ "integrity": "sha512-lRfaRKGZCBqDlRU3UIFovdp9c9mEvlylmpod0/OatICsSfuQ9YFthRo1tpTkGsklEefZdqlEFdY4A2dwTb6ohg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-unicode-property-regex": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.22.5.tgz",
+ "integrity": "sha512-HCCIb+CbJIAE6sXn5CjFQXMwkCClcOfPCzTlilJ8cUatfzwHlWQkbtV0zD338u9dZskwvuOYTuuaMaA8J5EI5A==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-create-regexp-features-plugin": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-unicode-regex": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.22.5.tgz",
+ "integrity": "sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-create-regexp-features-plugin": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-unicode-sets-regex": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.22.5.tgz",
+ "integrity": "sha512-lhMfi4FC15j13eKrh3DnYHjpGj6UKQHtNKTbtc1igvAhRy4+kLhV07OpLcsN0VgDEw/MjAvJO4BdMJsHwMhzCg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-create-regexp-features-plugin": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/preset-env": {
+ "version": "7.22.9",
+ "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.22.9.tgz",
+ "integrity": "sha512-wNi5H/Emkhll/bqPjsjQorSykrlfY5OWakd6AulLvMEytpKasMVUpVy8RL4qBIBs5Ac6/5i0/Rv0b/Fg6Eag/g==",
+ "dev": true,
+ "dependencies": {
+ "@babel/compat-data": "^7.22.9",
+ "@babel/helper-compilation-targets": "^7.22.9",
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/helper-validator-option": "^7.22.5",
+ "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.22.5",
+ "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.22.5",
+ "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2",
+ "@babel/plugin-syntax-async-generators": "^7.8.4",
+ "@babel/plugin-syntax-class-properties": "^7.12.13",
+ "@babel/plugin-syntax-class-static-block": "^7.14.5",
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
+ "@babel/plugin-syntax-export-namespace-from": "^7.8.3",
+ "@babel/plugin-syntax-import-assertions": "^7.22.5",
+ "@babel/plugin-syntax-import-attributes": "^7.22.5",
+ "@babel/plugin-syntax-import-meta": "^7.10.4",
+ "@babel/plugin-syntax-json-strings": "^7.8.3",
+ "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4",
+ "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3",
+ "@babel/plugin-syntax-numeric-separator": "^7.10.4",
+ "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
+ "@babel/plugin-syntax-optional-catch-binding": "^7.8.3",
+ "@babel/plugin-syntax-optional-chaining": "^7.8.3",
+ "@babel/plugin-syntax-private-property-in-object": "^7.14.5",
+ "@babel/plugin-syntax-top-level-await": "^7.14.5",
+ "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6",
+ "@babel/plugin-transform-arrow-functions": "^7.22.5",
+ "@babel/plugin-transform-async-generator-functions": "^7.22.7",
+ "@babel/plugin-transform-async-to-generator": "^7.22.5",
+ "@babel/plugin-transform-block-scoped-functions": "^7.22.5",
+ "@babel/plugin-transform-block-scoping": "^7.22.5",
+ "@babel/plugin-transform-class-properties": "^7.22.5",
+ "@babel/plugin-transform-class-static-block": "^7.22.5",
+ "@babel/plugin-transform-classes": "^7.22.6",
+ "@babel/plugin-transform-computed-properties": "^7.22.5",
+ "@babel/plugin-transform-destructuring": "^7.22.5",
+ "@babel/plugin-transform-dotall-regex": "^7.22.5",
+ "@babel/plugin-transform-duplicate-keys": "^7.22.5",
+ "@babel/plugin-transform-dynamic-import": "^7.22.5",
+ "@babel/plugin-transform-exponentiation-operator": "^7.22.5",
+ "@babel/plugin-transform-export-namespace-from": "^7.22.5",
+ "@babel/plugin-transform-for-of": "^7.22.5",
+ "@babel/plugin-transform-function-name": "^7.22.5",
+ "@babel/plugin-transform-json-strings": "^7.22.5",
+ "@babel/plugin-transform-literals": "^7.22.5",
+ "@babel/plugin-transform-logical-assignment-operators": "^7.22.5",
+ "@babel/plugin-transform-member-expression-literals": "^7.22.5",
+ "@babel/plugin-transform-modules-amd": "^7.22.5",
+ "@babel/plugin-transform-modules-commonjs": "^7.22.5",
+ "@babel/plugin-transform-modules-systemjs": "^7.22.5",
+ "@babel/plugin-transform-modules-umd": "^7.22.5",
+ "@babel/plugin-transform-named-capturing-groups-regex": "^7.22.5",
+ "@babel/plugin-transform-new-target": "^7.22.5",
+ "@babel/plugin-transform-nullish-coalescing-operator": "^7.22.5",
+ "@babel/plugin-transform-numeric-separator": "^7.22.5",
+ "@babel/plugin-transform-object-rest-spread": "^7.22.5",
+ "@babel/plugin-transform-object-super": "^7.22.5",
+ "@babel/plugin-transform-optional-catch-binding": "^7.22.5",
+ "@babel/plugin-transform-optional-chaining": "^7.22.6",
+ "@babel/plugin-transform-parameters": "^7.22.5",
+ "@babel/plugin-transform-private-methods": "^7.22.5",
+ "@babel/plugin-transform-private-property-in-object": "^7.22.5",
+ "@babel/plugin-transform-property-literals": "^7.22.5",
+ "@babel/plugin-transform-regenerator": "^7.22.5",
+ "@babel/plugin-transform-reserved-words": "^7.22.5",
+ "@babel/plugin-transform-shorthand-properties": "^7.22.5",
+ "@babel/plugin-transform-spread": "^7.22.5",
+ "@babel/plugin-transform-sticky-regex": "^7.22.5",
+ "@babel/plugin-transform-template-literals": "^7.22.5",
+ "@babel/plugin-transform-typeof-symbol": "^7.22.5",
+ "@babel/plugin-transform-unicode-escapes": "^7.22.5",
+ "@babel/plugin-transform-unicode-property-regex": "^7.22.5",
+ "@babel/plugin-transform-unicode-regex": "^7.22.5",
+ "@babel/plugin-transform-unicode-sets-regex": "^7.22.5",
+ "@babel/preset-modules": "^0.1.5",
+ "@babel/types": "^7.22.5",
+ "babel-plugin-polyfill-corejs2": "^0.4.4",
+ "babel-plugin-polyfill-corejs3": "^0.8.2",
+ "babel-plugin-polyfill-regenerator": "^0.5.1",
+ "core-js-compat": "^3.31.0",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/preset-env/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/@babel/preset-modules": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6.tgz",
+ "integrity": "sha512-ID2yj6K/4lKfhuU3+EX4UvNbIt7eACFbHmNUjzA+ep+B5971CknnA/9DEWKbRokfbbtblxxxXFJJrH47UEAMVg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/plugin-proposal-unicode-property-regex": "^7.4.4",
+ "@babel/plugin-transform-dotall-regex": "^7.4.4",
+ "@babel/types": "^7.4.4",
+ "esutils": "^2.0.2"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0 || ^8.0.0-0 <8.0.0"
+ }
+ },
+ "node_modules/@babel/regjsgen": {
+ "version": "0.8.0",
+ "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz",
+ "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==",
+ "dev": true
+ },
+ "node_modules/@babel/runtime": {
+ "version": "7.22.6",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.6.tgz",
+ "integrity": "sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==",
+ "dependencies": {
+ "regenerator-runtime": "^0.13.11"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/runtime-corejs3": {
+ "version": "7.23.1",
+ "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.23.1.tgz",
+ "integrity": "sha512-OKKfytwoc0tr7cDHwQm0RLVR3y+hDGFz3EPuvLNU/0fOeXJeKNIHj7ffNVFnncWt3sC58uyUCRSzf8nBQbyF6A==",
+ "dependencies": {
+ "core-js-pure": "^3.30.2",
+ "regenerator-runtime": "^0.14.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/runtime-corejs3/node_modules/regenerator-runtime": {
+ "version": "0.14.0",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz",
+ "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA=="
+ },
+ "node_modules/@babel/template": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz",
+ "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==",
+ "dependencies": {
+ "@babel/code-frame": "^7.22.5",
+ "@babel/parser": "^7.22.5",
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/traverse": {
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.0.tgz",
+ "integrity": "sha512-t/QaEvyIoIkwzpiZ7aoSKK8kObQYeF7T2v+dazAYCb8SXtp58zEVkWW7zAnju8FNKNdr4ScAOEDmMItbyOmEYw==",
+ "dependencies": {
+ "@babel/code-frame": "^7.22.13",
+ "@babel/generator": "^7.23.0",
+ "@babel/helper-environment-visitor": "^7.22.20",
+ "@babel/helper-function-name": "^7.23.0",
+ "@babel/helper-hoist-variables": "^7.22.5",
+ "@babel/helper-split-export-declaration": "^7.22.6",
+ "@babel/parser": "^7.23.0",
+ "@babel/types": "^7.23.0",
+ "debug": "^4.1.0",
+ "globals": "^11.1.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/traverse/node_modules/@babel/generator": {
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz",
+ "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==",
+ "dependencies": {
+ "@babel/types": "^7.23.0",
+ "@jridgewell/gen-mapping": "^0.3.2",
+ "@jridgewell/trace-mapping": "^0.3.17",
+ "jsesc": "^2.5.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/types": {
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz",
+ "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==",
+ "dependencies": {
+ "@babel/helper-string-parser": "^7.22.5",
+ "@babel/helper-validator-identifier": "^7.22.20",
+ "to-fast-properties": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@bcoe/v8-coverage": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz",
+ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==",
+ "dev": true
+ },
+ "node_modules/@casl/ability": {
+ "version": "5.4.4",
+ "resolved": "https://registry.npmjs.org/@casl/ability/-/ability-5.4.4.tgz",
+ "integrity": "sha512-7+GOnMUq6q4fqtDDesymBXTS9LSDVezYhFiSJ8Rn3f0aQLeRm7qHn66KWbej4niCOvm0XzNj9jzpkK0yz6hUww==",
+ "dependencies": {
+ "@ucast/mongo2js": "^1.3.0"
+ },
+ "funding": {
+ "url": "https://github.com/stalniy/casl/blob/master/BACKERS.md"
+ }
+ },
+ "node_modules/@codemirror/autocomplete": {
+ "version": "6.9.1",
+ "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.9.1.tgz",
+ "integrity": "sha512-yma56tqD7khIZK4gy4X5lX3/k5ArMiCGat7HEWRF/8L2kqOjVdp2qKZqpcJjwTIjSj6fqKAHqi7IjtH3QFE+Bw==",
+ "dependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.17.0",
+ "@lezer/common": "^1.0.0"
+ },
+ "peerDependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "@lezer/common": "^1.0.0"
+ }
+ },
+ "node_modules/@codemirror/commands": {
+ "version": "6.2.5",
+ "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.2.5.tgz",
+ "integrity": "sha512-dSi7ow2P2YgPBZflR9AJoaTHvqmeGIgkhignYMd5zK5y6DANTvxKxp6eMEpIDUJkRAaOY/TFZ4jP1ADIO/GLVA==",
+ "dependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.2.0",
+ "@codemirror/view": "^6.0.0",
+ "@lezer/common": "^1.0.0"
+ }
+ },
+ "node_modules/@codemirror/lang-json": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/@codemirror/lang-json/-/lang-json-6.0.1.tgz",
+ "integrity": "sha512-+T1flHdgpqDDlJZ2Lkil/rLiRy684WMLc74xUnjJH48GQdfJo/pudlTRreZmKwzP8/tGdKf83wlbAdOCzlJOGQ==",
+ "dependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@lezer/json": "^1.0.0"
+ }
+ },
+ "node_modules/@codemirror/language": {
+ "version": "6.9.1",
+ "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.1.tgz",
+ "integrity": "sha512-lWRP3Y9IUdOms6DXuBpoWwjkR7yRmnS0hKYCbSfPz9v6Em1A1UCRujAkDiCrdYfs1Z0Eu4dGtwovNPStIfkgNA==",
+ "dependencies": {
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "@lezer/common": "^1.1.0",
+ "@lezer/highlight": "^1.0.0",
+ "@lezer/lr": "^1.0.0",
+ "style-mod": "^4.0.0"
+ }
+ },
+ "node_modules/@codemirror/lint": {
+ "version": "6.4.2",
+ "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.4.2.tgz",
+ "integrity": "sha512-wzRkluWb1ptPKdzlsrbwwjYCPLgzU6N88YBAmlZi8WFyuiEduSd05MnJYNogzyc8rPK7pj6m95ptUApc8sHKVA==",
+ "dependencies": {
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "crelt": "^1.0.5"
+ }
+ },
+ "node_modules/@codemirror/search": {
+ "version": "6.5.4",
+ "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.4.tgz",
+ "integrity": "sha512-YoTrvjv9e8EbPs58opjZKyJ3ewFrVSUzQ/4WXlULQLSDDr1nGPJ67mMXFNNVYwdFhybzhrzrtqgHmtpJwIF+8g==",
+ "dependencies": {
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "crelt": "^1.0.5"
+ }
+ },
+ "node_modules/@codemirror/state": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.2.1.tgz",
+ "integrity": "sha512-RupHSZ8+OjNT38zU9fKH2sv+Dnlr8Eb8sl4NOnnqz95mCFTZUaiRP8Xv5MeeaG0px2b8Bnfe7YGwCV3nsBhbuw=="
+ },
+ "node_modules/@codemirror/theme-one-dark": {
+ "version": "6.1.2",
+ "resolved": "https://registry.npmjs.org/@codemirror/theme-one-dark/-/theme-one-dark-6.1.2.tgz",
+ "integrity": "sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==",
+ "dependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "@lezer/highlight": "^1.0.0"
+ }
+ },
+ "node_modules/@codemirror/view": {
+ "version": "6.20.2",
+ "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.20.2.tgz",
+ "integrity": "sha512-tZ9F0UZU2P3eTRtgljg3DaCOTn2FIjQU/ktTCjSz9/6he3GHDNxSCDAPidMtF+09r23o0h9H/5U7xibtUuEgdg==",
+ "dependencies": {
+ "@codemirror/state": "^6.1.4",
+ "style-mod": "^4.1.0",
+ "w3c-keyname": "^2.2.4"
+ }
+ },
+ "node_modules/@colors/colors": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz",
+ "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==",
+ "engines": {
+ "node": ">=0.1.90"
+ }
+ },
+ "node_modules/@cspotcode/source-map-support": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
+ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
+ "dev": true,
+ "dependencies": {
+ "@jridgewell/trace-mapping": "0.3.9"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.9",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
+ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
+ "dev": true,
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.0.3",
+ "@jridgewell/sourcemap-codec": "^1.4.10"
+ }
+ },
+ "node_modules/@dabh/diagnostics": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz",
+ "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==",
+ "dependencies": {
+ "colorspace": "1.1.x",
+ "enabled": "2.0.x",
+ "kuler": "^2.0.0"
+ }
+ },
+ "node_modules/@discoveryjs/json-ext": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz",
+ "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==",
+ "engines": {
+ "node": ">=10.0.0"
+ }
+ },
+ "node_modules/@dotenv-run/core": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@dotenv-run/core/-/core-1.1.0.tgz",
+ "integrity": "sha512-u8s+oQMHight/irufQn3nAhHpgdiECdKN8JSCUh5+czWkb3Mdf/B2OobU1RsNErzpiktV9N1DKj2cL696w5ndA==",
+ "dev": true,
+ "dependencies": {
+ "chalk": "^4.1.0",
+ "dotenv": "^16.1.4",
+ "dotenv-expand": "^10.0.0",
+ "find-up": "^5.0.0"
+ }
+ },
+ "node_modules/@dotenv-run/webpack": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@dotenv-run/webpack/-/webpack-1.1.0.tgz",
+ "integrity": "sha512-oO+FxvafBjjEhGXPvDePK8ZkJU5l1wZyIOgIQl5fV2ZjV2JRQ0RO59ROvDVWc7qwkMNUGkaDMKdaqAL/xAg6uw==",
+ "dev": true,
+ "dependencies": {
+ "@dotenv-run/core": "^1.1.0"
+ },
+ "peerDependencies": {
+ "webpack": "^5.0.0"
+ }
+ },
+ "node_modules/@emotion/babel-plugin": {
+ "version": "11.11.0",
+ "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz",
+ "integrity": "sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==",
+ "dependencies": {
+ "@babel/helper-module-imports": "^7.16.7",
+ "@babel/runtime": "^7.18.3",
+ "@emotion/hash": "^0.9.1",
+ "@emotion/memoize": "^0.8.1",
+ "@emotion/serialize": "^1.1.2",
+ "babel-plugin-macros": "^3.1.0",
+ "convert-source-map": "^1.5.0",
+ "escape-string-regexp": "^4.0.0",
+ "find-root": "^1.1.0",
+ "source-map": "^0.5.7",
+ "stylis": "4.2.0"
+ }
+ },
+ "node_modules/@emotion/babel-plugin/node_modules/source-map": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+ "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/@emotion/cache": {
+ "version": "11.11.0",
+ "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.11.0.tgz",
+ "integrity": "sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==",
+ "dependencies": {
+ "@emotion/memoize": "^0.8.1",
+ "@emotion/sheet": "^1.2.2",
+ "@emotion/utils": "^1.2.1",
+ "@emotion/weak-memoize": "^0.3.1",
+ "stylis": "4.2.0"
+ }
+ },
+ "node_modules/@emotion/hash": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz",
+ "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ=="
+ },
+ "node_modules/@emotion/is-prop-valid": {
+ "version": "0.8.8",
+ "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz",
+ "integrity": "sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==",
+ "dependencies": {
+ "@emotion/memoize": "0.7.4"
+ }
+ },
+ "node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize": {
+ "version": "0.7.4",
+ "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz",
+ "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw=="
+ },
+ "node_modules/@emotion/memoize": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz",
+ "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA=="
+ },
+ "node_modules/@emotion/react": {
+ "version": "11.11.1",
+ "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.1.tgz",
+ "integrity": "sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==",
+ "dependencies": {
+ "@babel/runtime": "^7.18.3",
+ "@emotion/babel-plugin": "^11.11.0",
+ "@emotion/cache": "^11.11.0",
+ "@emotion/serialize": "^1.1.2",
+ "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
+ "@emotion/utils": "^1.2.1",
+ "@emotion/weak-memoize": "^0.3.1",
+ "hoist-non-react-statics": "^3.3.1"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@emotion/serialize": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.2.tgz",
+ "integrity": "sha512-zR6a/fkFP4EAcCMQtLOhIgpprZOwNmCldtpaISpvz348+DP4Mz8ZoKaGGCQpbzepNIUWbq4w6hNZkwDyKoS+HA==",
+ "dependencies": {
+ "@emotion/hash": "^0.9.1",
+ "@emotion/memoize": "^0.8.1",
+ "@emotion/unitless": "^0.8.1",
+ "@emotion/utils": "^1.2.1",
+ "csstype": "^3.0.2"
+ }
+ },
+ "node_modules/@emotion/sheet": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.2.tgz",
+ "integrity": "sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA=="
+ },
+ "node_modules/@emotion/stylis": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz",
+ "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ=="
+ },
+ "node_modules/@emotion/unitless": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz",
+ "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ=="
+ },
+ "node_modules/@emotion/use-insertion-effect-with-fallbacks": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.1.tgz",
+ "integrity": "sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==",
+ "peerDependencies": {
+ "react": ">=16.8.0"
+ }
+ },
+ "node_modules/@emotion/utils": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.1.tgz",
+ "integrity": "sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg=="
+ },
+ "node_modules/@emotion/weak-memoize": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz",
+ "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww=="
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.17.tgz",
+ "integrity": "sha512-wHsmJG/dnL3OkpAcwbgoBTTMHVi4Uyou3F5mf58ZtmUyIKfcdA7TROav/6tCzET4A3QW2Q2FC+eFneMU+iyOxg==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.17.tgz",
+ "integrity": "sha512-9np+YYdNDed5+Jgr1TdWBsozZ85U1Oa3xW0c7TWqH0y2aGghXtZsuT8nYRbzOMcl0bXZXjOGbksoTtVOlWrRZg==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.17.tgz",
+ "integrity": "sha512-O+FeWB/+xya0aLg23hHEM2E3hbfwZzjqumKMSIqcHbNvDa+dza2D0yLuymRBQQnC34CWrsJUXyH2MG5VnLd6uw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.17.tgz",
+ "integrity": "sha512-M9uJ9VSB1oli2BE/dJs3zVr9kcCBBsE883prage1NWz6pBS++1oNn/7soPNS3+1DGj0FrkSvnED4Bmlu1VAE9g==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.17.tgz",
+ "integrity": "sha512-XDre+J5YeIJDMfp3n0279DFNrGCXlxOuGsWIkRb1NThMZ0BsrWXoTg23Jer7fEXQ9Ye5QjrvXpxnhzl3bHtk0g==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.17.tgz",
+ "integrity": "sha512-cjTzGa3QlNfERa0+ptykyxs5A6FEUQQF0MuilYXYBGdBxD3vxJcKnzDlhDCa1VAJCmAxed6mYhA2KaJIbtiNuQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.17.tgz",
+ "integrity": "sha512-sOxEvR8d7V7Kw8QqzxWc7bFfnWnGdaFBut1dRUYtu+EIRXefBc/eIsiUiShnW0hM3FmQ5Zf27suDuHsKgZ5QrA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.17.tgz",
+ "integrity": "sha512-2d3Lw6wkwgSLC2fIvXKoMNGVaeY8qdN0IC3rfuVxJp89CRfA3e3VqWifGDfuakPmp90+ZirmTfye1n4ncjv2lg==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.17.tgz",
+ "integrity": "sha512-c9w3tE7qA3CYWjT+M3BMbwMt+0JYOp3vCMKgVBrCl1nwjAlOMYzEo+gG7QaZ9AtqZFj5MbUc885wuBBmu6aADQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.17.tgz",
+ "integrity": "sha512-1DS9F966pn5pPnqXYz16dQqWIB0dmDfAQZd6jSSpiT9eX1NzKh07J6VKR3AoXXXEk6CqZMojiVDSZi1SlmKVdg==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.17.tgz",
+ "integrity": "sha512-EvLsxCk6ZF0fpCB6w6eOI2Fc8KW5N6sHlIovNe8uOFObL2O+Mr0bflPHyHwLT6rwMg9r77WOAWb2FqCQrVnwFg==",
+ "cpu": [
+ "loong64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.17.tgz",
+ "integrity": "sha512-e0bIdHA5p6l+lwqTE36NAW5hHtw2tNRmHlGBygZC14QObsA3bD4C6sXLJjvnDIjSKhW1/0S3eDy+QmX/uZWEYQ==",
+ "cpu": [
+ "mips64el"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.17.tgz",
+ "integrity": "sha512-BAAilJ0M5O2uMxHYGjFKn4nJKF6fNCdP1E0o5t5fvMYYzeIqy2JdAP88Az5LHt9qBoUa4tDaRpfWt21ep5/WqQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.17.tgz",
+ "integrity": "sha512-Wh/HW2MPnC3b8BqRSIme/9Zhab36PPH+3zam5pqGRH4pE+4xTrVLx2+XdGp6fVS3L2x+DrsIcsbMleex8fbE6g==",
+ "cpu": [
+ "riscv64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.17.tgz",
+ "integrity": "sha512-j/34jAl3ul3PNcK3pfI0NSlBANduT2UO5kZ7FCaK33XFv3chDhICLY8wJJWIhiQ+YNdQ9dxqQctRg2bvrMlYgg==",
+ "cpu": [
+ "s390x"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.17.tgz",
+ "integrity": "sha512-QM50vJ/y+8I60qEmFxMoxIx4de03pGo2HwxdBeFd4nMh364X6TIBZ6VQ5UQmPbQWUVWHWws5MmJXlHAXvJEmpQ==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.17.tgz",
+ "integrity": "sha512-/jGlhWR7Sj9JPZHzXyyMZ1RFMkNPjC6QIAan0sDOtIo2TYk3tZn5UDrkE0XgsTQCxWTTOcMPf9p6Rh2hXtl5TQ==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.17.tgz",
+ "integrity": "sha512-rSEeYaGgyGGf4qZM2NonMhMOP/5EHp4u9ehFiBrg7stH6BYEEjlkVREuDEcQ0LfIl53OXLxNbfuIj7mr5m29TA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.17.tgz",
+ "integrity": "sha512-Y7ZBbkLqlSgn4+zot4KUNYst0bFoO68tRgI6mY2FIM+b7ZbyNVtNbDP5y8qlu4/knZZ73fgJDlXID+ohY5zt5g==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.17.tgz",
+ "integrity": "sha512-bwPmTJsEQcbZk26oYpc4c/8PvTY3J5/QK8jM19DVlEsAB41M39aWovWoHtNm78sd6ip6prilxeHosPADXtEJFw==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.17.tgz",
+ "integrity": "sha512-H/XaPtPKli2MhW+3CQueo6Ni3Avggi6hP/YvgkEe1aSaxw+AeO8MFjq8DlgfTd9Iz4Yih3QCZI6YLMoyccnPRg==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.17.tgz",
+ "integrity": "sha512-fGEb8f2BSA3CW7riJVurug65ACLuQAzKq0SSqkY2b2yHHH0MzDfbLyKIGzHwOI/gkHcxM/leuSW6D5w/LMNitA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@eslint-community/eslint-utils": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
+ "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",
+ "dev": true,
+ "dependencies": {
+ "eslint-visitor-keys": "^3.3.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
+ }
+ },
+ "node_modules/@eslint-community/regexpp": {
+ "version": "4.9.0",
+ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.0.tgz",
+ "integrity": "sha512-zJmuCWj2VLBt4c25CfBIbMZLGLyhkvs7LznyVX5HfpzeocThgIj5XQK4L+g3U36mMcx8bPMhGyPpwCATamC4jQ==",
+ "dev": true,
+ "engines": {
+ "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
+ }
+ },
+ "node_modules/@eslint/eslintrc": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz",
+ "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==",
+ "dev": true,
+ "dependencies": {
+ "ajv": "^6.12.4",
+ "debug": "^4.3.2",
+ "espree": "^9.6.0",
+ "globals": "^13.19.0",
+ "ignore": "^5.2.0",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^4.1.0",
+ "minimatch": "^3.1.2",
+ "strip-json-comments": "^3.1.1"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/@eslint/eslintrc/node_modules/ajv": {
+ "version": "6.12.6",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "dev": true,
+ "dependencies": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/@eslint/eslintrc/node_modules/argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "dev": true
+ },
+ "node_modules/@eslint/eslintrc/node_modules/globals": {
+ "version": "13.22.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz",
+ "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==",
+ "dev": true,
+ "dependencies": {
+ "type-fest": "^0.20.2"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@eslint/eslintrc/node_modules/js-yaml": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
+ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+ "dev": true,
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
+ "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
+ "dev": true
+ },
+ "node_modules/@eslint/eslintrc/node_modules/type-fest": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
+ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@eslint/js": {
+ "version": "8.50.0",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz",
+ "integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==",
+ "dev": true,
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ }
+ },
+ "node_modules/@fastify/ajv-compiler": {
+ "version": "3.5.0",
+ "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-3.5.0.tgz",
+ "integrity": "sha512-ebbEtlI7dxXF5ziNdr05mOY8NnDiPB1XvAlLHctRt/Rc+C3LCOVW5imUVX+mhvUhnNzmPBHewUkOFgGlCxgdAA==",
+ "dependencies": {
+ "ajv": "^8.11.0",
+ "ajv-formats": "^2.1.1",
+ "fast-uri": "^2.0.0"
+ }
+ },
+ "node_modules/@fastify/autoload": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/@fastify/autoload/-/autoload-5.7.1.tgz",
+ "integrity": "sha512-F5c94MYAF0tacVu6X4/1ojO7fzmgrJXsqitDtpqknXgiHZpeFNhYSnNCUHPz6UDRKsfkDohmh0fiPTtOd8clzQ==",
+ "dependencies": {
+ "pkg-up": "^3.1.0"
+ }
+ },
+ "node_modules/@fastify/deepmerge": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-1.3.0.tgz",
+ "integrity": "sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A=="
+ },
+ "node_modules/@fastify/error": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.3.0.tgz",
+ "integrity": "sha512-dj7vjIn1Ar8sVXj2yAXiMNCJDmS9MQ9XMlIecX2dIzzhjSHCyKo4DdXjXMs7wKW2kj6yvVRSpuQjOZ3YLrh56w=="
+ },
+ "node_modules/@fastify/fast-json-stringify-compiler": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.3.0.tgz",
+ "integrity": "sha512-aZAXGYo6m22Fk1zZzEUKBvut/CIIQe/BapEORnxiD5Qr0kPHqqI69NtEMCme74h+at72sPhbkb4ZrLd1W3KRLA==",
+ "dependencies": {
+ "fast-json-stringify": "^5.7.0"
+ }
+ },
+ "node_modules/@fastify/sensible": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fastify/sensible/-/sensible-5.3.0.tgz",
+ "integrity": "sha512-/7n8kMO6G7up05MOohZ7OX3u2pUGdfOU8ai2XzY3TNSguVYUcQfyu+A0On41ijxSKo9Z9US5OMfEy+KITF4RQQ==",
+ "dependencies": {
+ "@lukeed/ms": "^2.0.1",
+ "fast-deep-equal": "^3.1.1",
+ "fastify-plugin": "^4.0.0",
+ "forwarded": "^0.2.0",
+ "http-errors": "^2.0.0",
+ "type-is": "^1.6.18",
+ "vary": "^1.1.2"
+ }
+ },
+ "node_modules/@floating-ui/core": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.5.0.tgz",
+ "integrity": "sha512-kK1h4m36DQ0UHGj5Ah4db7R0rHemTqqO0QLvUqi1/mUUp3LuAWbWxdxSIf/XsnH9VS6rRVPLJCncjRzUvyCLXg==",
+ "dependencies": {
+ "@floating-ui/utils": "^0.1.3"
+ }
+ },
+ "node_modules/@floating-ui/dom": {
+ "version": "1.5.3",
+ "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.3.tgz",
+ "integrity": "sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==",
+ "dependencies": {
+ "@floating-ui/core": "^1.4.2",
+ "@floating-ui/utils": "^0.1.3"
+ }
+ },
+ "node_modules/@floating-ui/react-dom": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.2.tgz",
+ "integrity": "sha512-5qhlDvjaLmAst/rKb3VdlCinwTF4EYMiVxuuc/HVUjs46W0zgtbMmAZ1UTsDrRTxRmUEzl92mOtWbeeXL26lSQ==",
+ "dependencies": {
+ "@floating-ui/dom": "^1.5.1"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@floating-ui/utils": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.1.4.tgz",
+ "integrity": "sha512-qprfWkn82Iw821mcKofJ5Pk9wgioHicxcQMxx+5zt5GSKoqdWvgG5AxVmpmUUjzTLPVSH5auBrhI93Deayn/DA=="
+ },
+ "node_modules/@formatjs/ecma402-abstract": {
+ "version": "1.14.3",
+ "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.14.3.tgz",
+ "integrity": "sha512-SlsbRC/RX+/zg4AApWIFNDdkLtFbkq3LNoZWXZCE/nHVKqoIJyaoQyge/I0Y38vLxowUn9KTtXgusLD91+orbg==",
+ "dependencies": {
+ "@formatjs/intl-localematcher": "0.2.32",
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@formatjs/fast-memoize": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-2.0.1.tgz",
+ "integrity": "sha512-M2GgV+qJn5WJQAYewz7q2Cdl6fobQa69S1AzSM2y0P68ZDbK5cWrJIcPCO395Of1ksftGZoOt4LYCO/j9BKBSA==",
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@formatjs/icu-messageformat-parser": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.3.1.tgz",
+ "integrity": "sha512-knF2AkAKN4Upv4oIiKY4Wd/dLH68TNMPgV/tJMu/T6FP9aQwbv8fpj7U3lkyniPaNVxvia56Gxax8MKOjtxLSQ==",
+ "dependencies": {
+ "@formatjs/ecma402-abstract": "1.14.3",
+ "@formatjs/icu-skeleton-parser": "1.3.18",
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@formatjs/icu-skeleton-parser": {
+ "version": "1.3.18",
+ "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.18.tgz",
+ "integrity": "sha512-ND1ZkZfmLPcHjAH1sVpkpQxA+QYfOX3py3SjKWMUVGDow18gZ0WPqz3F+pJLYQMpS2LnnQ5zYR2jPVYTbRwMpg==",
+ "dependencies": {
+ "@formatjs/ecma402-abstract": "1.14.3",
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@formatjs/intl": {
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.7.1.tgz",
+ "integrity": "sha512-se6vxidsN3PCmzqTsDd3YDT4IX9ZySPy39LYhF7x2ssNvlGMOuW3umkrIhKkXB7ZskqsJGY53LVCdiHsSwhGng==",
+ "dependencies": {
+ "@formatjs/ecma402-abstract": "1.14.3",
+ "@formatjs/fast-memoize": "2.0.1",
+ "@formatjs/icu-messageformat-parser": "2.3.1",
+ "@formatjs/intl-displaynames": "6.3.1",
+ "@formatjs/intl-listformat": "7.2.1",
+ "intl-messageformat": "10.3.4",
+ "tslib": "^2.4.0"
+ },
+ "peerDependencies": {
+ "typescript": "^4.7 || 5"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@formatjs/intl-displaynames": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/@formatjs/intl-displaynames/-/intl-displaynames-6.3.1.tgz",
+ "integrity": "sha512-TlxguMDUbnFrJ4NA8fSyqXC62M7czvlRJ5mrJgtB91JVA+QPjjNdcRm1qPIC/DcU/pGUDcEzThn/x5A+jp15gg==",
+ "dependencies": {
+ "@formatjs/ecma402-abstract": "1.14.3",
+ "@formatjs/intl-localematcher": "0.2.32",
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@formatjs/intl-listformat": {
+ "version": "7.2.1",
+ "resolved": "https://registry.npmjs.org/@formatjs/intl-listformat/-/intl-listformat-7.2.1.tgz",
+ "integrity": "sha512-fRJFWLrGa7d25I4JSxNjKX29oXGcIXx8fJjgURnvs2C3ijS4gurUgFrUwLbv/2KfPfyJ5g567pz2INelNJZBdw==",
+ "dependencies": {
+ "@formatjs/ecma402-abstract": "1.14.3",
+ "@formatjs/intl-localematcher": "0.2.32",
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@formatjs/intl-localematcher": {
+ "version": "0.2.32",
+ "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.32.tgz",
+ "integrity": "sha512-k/MEBstff4sttohyEpXxCmC3MqbUn9VvHGlZ8fauLzkbwXmVrEeyzS+4uhrvAk9DWU9/7otYWxyDox4nT/KVLQ==",
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@fortawesome/angular-fontawesome": {
+ "version": "0.13.0",
+ "resolved": "https://registry.npmjs.org/@fortawesome/angular-fontawesome/-/angular-fontawesome-0.13.0.tgz",
+ "integrity": "sha512-gzSPRdveOXNO7NIiMgTyB46aiHG0i98KinnAEqHXi8qzraM/kCcHn/0y3f4MhemX6kftwsFli0IU8RyHmtXlSQ==",
+ "dependencies": {
+ "tslib": "^2.4.1"
+ },
+ "peerDependencies": {
+ "@angular/core": "^16.0.0",
+ "@fortawesome/fontawesome-svg-core": "~1.2.27 || ~1.3.0-beta2 || ^6.1.0"
+ }
+ },
+ "node_modules/@fortawesome/fontawesome-common-types": {
+ "version": "6.4.2",
+ "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.2.tgz",
+ "integrity": "sha512-1DgP7f+XQIJbLFCTX1V2QnxVmpLdKdzzo2k8EmvDOePfchaIGQ9eCHj2up3/jNEbZuBqel5OxiaOJf37TWauRA==",
+ "hasInstallScript": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@fortawesome/fontawesome-svg-core": {
+ "version": "6.4.2",
+ "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.4.2.tgz",
+ "integrity": "sha512-gjYDSKv3TrM2sLTOKBc5rH9ckje8Wrwgx1CxAPbN5N3Fm4prfi7NsJVWd1jklp7i5uSCVwhZS5qlhMXqLrpAIg==",
+ "hasInstallScript": true,
+ "dependencies": {
+ "@fortawesome/fontawesome-common-types": "6.4.2"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@fortawesome/free-brands-svg-icons": {
+ "version": "6.4.2",
+ "resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.4.2.tgz",
+ "integrity": "sha512-LKOwJX0I7+mR/cvvf6qIiqcERbdnY+24zgpUSouySml+5w8B4BJOx8EhDR/FTKAu06W12fmUIcv6lzPSwYKGGg==",
+ "hasInstallScript": true,
+ "dependencies": {
+ "@fortawesome/fontawesome-common-types": "6.4.2"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@fortawesome/free-solid-svg-icons": {
+ "version": "6.4.2",
+ "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.4.2.tgz",
+ "integrity": "sha512-sYwXurXUEQS32fZz9hVCUUv/xu49PEJEyUOsA51l6PU/qVgfbTb2glsTEaJngVVT8VqBATRIdh7XVgV1JF1LkA==",
+ "hasInstallScript": true,
+ "dependencies": {
+ "@fortawesome/fontawesome-common-types": "6.4.2"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@graphql-tools/merge": {
+ "version": "8.3.1",
+ "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.1.tgz",
+ "integrity": "sha512-BMm99mqdNZbEYeTPK3it9r9S6rsZsQKtlqJsSBknAclXq2pGEfOxjcIZi+kBSkHZKPKCRrYDd5vY0+rUmIHVLg==",
+ "dependencies": {
+ "@graphql-tools/utils": "8.9.0",
+ "tslib": "^2.4.0"
+ },
+ "peerDependencies": {
+ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
+ }
+ },
+ "node_modules/@graphql-tools/merge/node_modules/@graphql-tools/utils": {
+ "version": "8.9.0",
+ "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.9.0.tgz",
+ "integrity": "sha512-pjJIWH0XOVnYGXCqej8g/u/tsfV4LvLlj0eATKQu5zwnxd/TiTHq7Cg313qUPTFFHZ3PP5wJ15chYVtLDwaymg==",
+ "dependencies": {
+ "tslib": "^2.4.0"
+ },
+ "peerDependencies": {
+ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
+ }
+ },
+ "node_modules/@graphql-tools/mock": {
+ "version": "8.7.20",
+ "resolved": "https://registry.npmjs.org/@graphql-tools/mock/-/mock-8.7.20.tgz",
+ "integrity": "sha512-ljcHSJWjC/ZyzpXd5cfNhPI7YljRVvabKHPzKjEs5ElxWu2cdlLGvyNYepApXDsM/OJG/2xuhGM+9GWu5gEAPQ==",
+ "dependencies": {
+ "@graphql-tools/schema": "^9.0.18",
+ "@graphql-tools/utils": "^9.2.1",
+ "fast-json-stable-stringify": "^2.1.0",
+ "tslib": "^2.4.0"
+ },
+ "peerDependencies": {
+ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
+ }
+ },
+ "node_modules/@graphql-tools/mock/node_modules/@graphql-tools/merge": {
+ "version": "8.4.2",
+ "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.4.2.tgz",
+ "integrity": "sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw==",
+ "dependencies": {
+ "@graphql-tools/utils": "^9.2.1",
+ "tslib": "^2.4.0"
+ },
+ "peerDependencies": {
+ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
+ }
+ },
+ "node_modules/@graphql-tools/mock/node_modules/@graphql-tools/schema": {
+ "version": "9.0.19",
+ "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-9.0.19.tgz",
+ "integrity": "sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w==",
+ "dependencies": {
+ "@graphql-tools/merge": "^8.4.1",
+ "@graphql-tools/utils": "^9.2.1",
+ "tslib": "^2.4.0",
+ "value-or-promise": "^1.0.12"
+ },
+ "peerDependencies": {
+ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
+ }
+ },
+ "node_modules/@graphql-tools/mock/node_modules/@graphql-tools/utils": {
+ "version": "9.2.1",
+ "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-9.2.1.tgz",
+ "integrity": "sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==",
+ "dependencies": {
+ "@graphql-typed-document-node/core": "^3.1.1",
+ "tslib": "^2.4.0"
+ },
+ "peerDependencies": {
+ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
+ }
+ },
+ "node_modules/@graphql-tools/mock/node_modules/value-or-promise": {
+ "version": "1.0.12",
+ "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz",
+ "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@graphql-tools/schema": {
+ "version": "8.5.1",
+ "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-8.5.1.tgz",
+ "integrity": "sha512-0Esilsh0P/qYcB5DKQpiKeQs/jevzIadNTaT0jeWklPMwNbT7yMX4EqZany7mbeRRlSRwMzNzL5olyFdffHBZg==",
+ "dependencies": {
+ "@graphql-tools/merge": "8.3.1",
+ "@graphql-tools/utils": "8.9.0",
+ "tslib": "^2.4.0",
+ "value-or-promise": "1.0.11"
+ },
+ "peerDependencies": {
+ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
+ }
+ },
+ "node_modules/@graphql-tools/schema/node_modules/@graphql-tools/utils": {
+ "version": "8.9.0",
+ "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.9.0.tgz",
+ "integrity": "sha512-pjJIWH0XOVnYGXCqej8g/u/tsfV4LvLlj0eATKQu5zwnxd/TiTHq7Cg313qUPTFFHZ3PP5wJ15chYVtLDwaymg==",
+ "dependencies": {
+ "tslib": "^2.4.0"
+ },
+ "peerDependencies": {
+ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
+ }
+ },
+ "node_modules/@graphql-tools/utils": {
+ "version": "8.13.1",
+ "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.13.1.tgz",
+ "integrity": "sha512-qIh9yYpdUFmctVqovwMdheVNJqFh+DQNWIhX87FJStfXYnmweBUDATok9fWPleKeFwxnW8IapKmY8m8toJEkAw==",
+ "dependencies": {
+ "tslib": "^2.4.0"
+ },
+ "peerDependencies": {
+ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
+ }
+ },
+ "node_modules/@graphql-typed-document-node/core": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz",
+ "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==",
+ "peerDependencies": {
+ "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
+ }
+ },
+ "node_modules/@hapi/hoek": {
+ "version": "9.3.0",
+ "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz",
+ "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==",
+ "dev": true
+ },
+ "node_modules/@hapi/topo": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz",
+ "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==",
+ "dev": true,
+ "dependencies": {
+ "@hapi/hoek": "^9.0.0"
+ }
+ },
+ "node_modules/@humanwhocodes/config-array": {
+ "version": "0.11.11",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz",
+ "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==",
+ "dev": true,
+ "dependencies": {
+ "@humanwhocodes/object-schema": "^1.2.1",
+ "debug": "^4.1.1",
+ "minimatch": "^3.0.5"
+ },
+ "engines": {
+ "node": ">=10.10.0"
+ }
+ },
+ "node_modules/@humanwhocodes/module-importer": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
+ "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
+ "dev": true,
+ "engines": {
+ "node": ">=12.22"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
+ },
+ "node_modules/@humanwhocodes/object-schema": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz",
+ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==",
+ "dev": true
+ },
+ "node_modules/@internationalized/date": {
+ "version": "3.5.0",
+ "resolved": "https://registry.npmjs.org/@internationalized/date/-/date-3.5.0.tgz",
+ "integrity": "sha512-nw0Q+oRkizBWMioseI8+2TeUPEyopJVz5YxoYVzR0W1v+2YytiYah7s/ot35F149q/xAg4F1gT/6eTd+tsUpFQ==",
+ "dependencies": {
+ "@swc/helpers": "^0.5.0"
+ }
+ },
+ "node_modules/@internationalized/number": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/@internationalized/number/-/number-3.2.1.tgz",
+ "integrity": "sha512-hK30sfBlmB1aIe3/OwAPg9Ey0DjjXvHEiGVhNaOiBJl31G0B6wMaX8BN3ibzdlpyRNE9p7X+3EBONmxtJO9Yfg==",
+ "dependencies": {
+ "@swc/helpers": "^0.5.0"
+ }
+ },
+ "node_modules/@isaacs/cliui": {
+ "version": "8.0.2",
+ "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
+ "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
+ "dev": true,
+ "dependencies": {
+ "string-width": "^5.1.2",
+ "string-width-cjs": "npm:string-width@^4.2.0",
+ "strip-ansi": "^7.0.1",
+ "strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
+ "wrap-ansi": "^8.1.0",
+ "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@isaacs/cliui/node_modules/ansi-regex": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
+ "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/@isaacs/cliui/node_modules/ansi-styles": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
+ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/@isaacs/cliui/node_modules/emoji-regex": {
+ "version": "9.2.2",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
+ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
+ "dev": true
+ },
+ "node_modules/@isaacs/cliui/node_modules/string-width": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
+ "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
+ "dev": true,
+ "dependencies": {
+ "eastasianwidth": "^0.2.0",
+ "emoji-regex": "^9.2.2",
+ "strip-ansi": "^7.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@isaacs/cliui/node_modules/strip-ansi": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
+ "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
+ "dev": true,
+ "dependencies": {
+ "ansi-regex": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
+ },
+ "node_modules/@isaacs/cliui/node_modules/wrap-ansi": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
+ "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^6.1.0",
+ "string-width": "^5.0.1",
+ "strip-ansi": "^7.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+ }
+ },
+ "node_modules/@istanbuljs/load-nyc-config": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz",
+ "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==",
+ "dev": true,
+ "dependencies": {
+ "camelcase": "^5.3.1",
+ "find-up": "^4.1.0",
+ "get-package-type": "^0.1.0",
+ "js-yaml": "^3.13.1",
+ "resolve-from": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
+ "dev": true,
+ "dependencies": {
+ "locate-path": "^5.0.0",
+ "path-exists": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
+ "dev": true,
+ "dependencies": {
+ "p-locate": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
+ "dev": true,
+ "dependencies": {
+ "p-try": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
+ "dev": true,
+ "dependencies": {
+ "p-limit": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@istanbuljs/schema": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz",
+ "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@jest/console": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz",
+ "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==",
+ "dev": true,
+ "dependencies": {
+ "@jest/types": "^29.6.3",
+ "@types/node": "*",
+ "chalk": "^4.0.0",
+ "jest-message-util": "^29.7.0",
+ "jest-util": "^29.7.0",
+ "slash": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@jest/core": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz",
+ "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==",
+ "dev": true,
+ "dependencies": {
+ "@jest/console": "^29.7.0",
+ "@jest/reporters": "^29.7.0",
+ "@jest/test-result": "^29.7.0",
+ "@jest/transform": "^29.7.0",
+ "@jest/types": "^29.6.3",
+ "@types/node": "*",
+ "ansi-escapes": "^4.2.1",
+ "chalk": "^4.0.0",
+ "ci-info": "^3.2.0",
+ "exit": "^0.1.2",
+ "graceful-fs": "^4.2.9",
+ "jest-changed-files": "^29.7.0",
+ "jest-config": "^29.7.0",
+ "jest-haste-map": "^29.7.0",
+ "jest-message-util": "^29.7.0",
+ "jest-regex-util": "^29.6.3",
+ "jest-resolve": "^29.7.0",
+ "jest-resolve-dependencies": "^29.7.0",
+ "jest-runner": "^29.7.0",
+ "jest-runtime": "^29.7.0",
+ "jest-snapshot": "^29.7.0",
+ "jest-util": "^29.7.0",
+ "jest-validate": "^29.7.0",
+ "jest-watcher": "^29.7.0",
+ "micromatch": "^4.0.4",
+ "pretty-format": "^29.7.0",
+ "slash": "^3.0.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ },
+ "peerDependencies": {
+ "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"
+ },
+ "peerDependenciesMeta": {
+ "node-notifier": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@jest/environment": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz",
+ "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==",
+ "dev": true,
+ "dependencies": {
+ "@jest/fake-timers": "^29.7.0",
+ "@jest/types": "^29.6.3",
+ "@types/node": "*",
+ "jest-mock": "^29.7.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@jest/expect": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz",
+ "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==",
+ "dev": true,
+ "dependencies": {
+ "expect": "^29.7.0",
+ "jest-snapshot": "^29.7.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@jest/expect-utils": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz",
+ "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==",
+ "dev": true,
+ "dependencies": {
+ "jest-get-type": "^29.6.3"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@jest/fake-timers": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz",
+ "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==",
+ "dev": true,
+ "dependencies": {
+ "@jest/types": "^29.6.3",
+ "@sinonjs/fake-timers": "^10.0.2",
+ "@types/node": "*",
+ "jest-message-util": "^29.7.0",
+ "jest-mock": "^29.7.0",
+ "jest-util": "^29.7.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@jest/globals": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz",
+ "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==",
+ "dev": true,
+ "dependencies": {
+ "@jest/environment": "^29.7.0",
+ "@jest/expect": "^29.7.0",
+ "@jest/types": "^29.6.3",
+ "jest-mock": "^29.7.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@jest/reporters": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz",
+ "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==",
+ "dev": true,
+ "dependencies": {
+ "@bcoe/v8-coverage": "^0.2.3",
+ "@jest/console": "^29.7.0",
+ "@jest/test-result": "^29.7.0",
+ "@jest/transform": "^29.7.0",
+ "@jest/types": "^29.6.3",
+ "@jridgewell/trace-mapping": "^0.3.18",
+ "@types/node": "*",
+ "chalk": "^4.0.0",
+ "collect-v8-coverage": "^1.0.0",
+ "exit": "^0.1.2",
+ "glob": "^7.1.3",
+ "graceful-fs": "^4.2.9",
+ "istanbul-lib-coverage": "^3.0.0",
+ "istanbul-lib-instrument": "^6.0.0",
+ "istanbul-lib-report": "^3.0.0",
+ "istanbul-lib-source-maps": "^4.0.0",
+ "istanbul-reports": "^3.1.3",
+ "jest-message-util": "^29.7.0",
+ "jest-util": "^29.7.0",
+ "jest-worker": "^29.7.0",
+ "slash": "^3.0.0",
+ "string-length": "^4.0.1",
+ "strip-ansi": "^6.0.0",
+ "v8-to-istanbul": "^9.0.1"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ },
+ "peerDependencies": {
+ "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"
+ },
+ "peerDependenciesMeta": {
+ "node-notifier": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@jest/reporters/node_modules/istanbul-lib-instrument": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.0.tgz",
+ "integrity": "sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/core": "^7.12.3",
+ "@babel/parser": "^7.14.7",
+ "@istanbuljs/schema": "^0.1.2",
+ "istanbul-lib-coverage": "^3.2.0",
+ "semver": "^7.5.4"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@jest/schemas": {
+ "version": "29.6.3",
+ "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz",
+ "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==",
+ "dev": true,
+ "dependencies": {
+ "@sinclair/typebox": "^0.27.8"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@jest/source-map": {
+ "version": "29.6.3",
+ "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz",
+ "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==",
+ "dev": true,
+ "dependencies": {
+ "@jridgewell/trace-mapping": "^0.3.18",
+ "callsites": "^3.0.0",
+ "graceful-fs": "^4.2.9"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@jest/test-result": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz",
+ "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==",
+ "dev": true,
+ "dependencies": {
+ "@jest/console": "^29.7.0",
+ "@jest/types": "^29.6.3",
+ "@types/istanbul-lib-coverage": "^2.0.0",
+ "collect-v8-coverage": "^1.0.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@jest/test-sequencer": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz",
+ "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==",
+ "dev": true,
+ "dependencies": {
+ "@jest/test-result": "^29.7.0",
+ "graceful-fs": "^4.2.9",
+ "jest-haste-map": "^29.7.0",
+ "slash": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@jest/transform": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz",
+ "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/core": "^7.11.6",
+ "@jest/types": "^29.6.3",
+ "@jridgewell/trace-mapping": "^0.3.18",
+ "babel-plugin-istanbul": "^6.1.1",
+ "chalk": "^4.0.0",
+ "convert-source-map": "^2.0.0",
+ "fast-json-stable-stringify": "^2.1.0",
+ "graceful-fs": "^4.2.9",
+ "jest-haste-map": "^29.7.0",
+ "jest-regex-util": "^29.6.3",
+ "jest-util": "^29.7.0",
+ "micromatch": "^4.0.4",
+ "pirates": "^4.0.4",
+ "slash": "^3.0.0",
+ "write-file-atomic": "^4.0.2"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@jest/transform/node_modules/convert-source-map": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
+ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
+ "dev": true
+ },
+ "node_modules/@jest/types": {
+ "version": "29.6.3",
+ "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz",
+ "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==",
+ "dev": true,
+ "dependencies": {
+ "@jest/schemas": "^29.6.3",
+ "@types/istanbul-lib-coverage": "^2.0.0",
+ "@types/istanbul-reports": "^3.0.0",
+ "@types/node": "*",
+ "@types/yargs": "^17.0.8",
+ "chalk": "^4.0.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@josephg/resolvable": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@josephg/resolvable/-/resolvable-1.0.1.tgz",
+ "integrity": "sha512-CtzORUwWTTOTqfVtHaKRJ0I1kNQd1bpn3sUh8I3nJDVY+5/M/Oe1DnEWzPQvqq/xPIIkzzzIP7mfCoAjFRvDhg=="
+ },
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz",
+ "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==",
+ "dependencies": {
+ "@jridgewell/set-array": "^1.0.1",
+ "@jridgewell/sourcemap-codec": "^1.4.10",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
+ "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/set-array": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
+ "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/source-map": {
+ "version": "0.3.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz",
+ "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.0",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.4.15",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
+ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg=="
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.19",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz",
+ "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
+ }
+ },
+ "node_modules/@koa/cors": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/@koa/cors/-/cors-3.4.3.tgz",
+ "integrity": "sha512-WPXQUaAeAMVaLTEFpoq3T2O1C+FstkjJnDQqy95Ck1UdILajsRhu6mhJ8H2f4NFPRBoCNN+qywTJfq/gGki5mw==",
+ "dependencies": {
+ "vary": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
+ }
+ },
+ "node_modules/@koa/router": {
+ "version": "10.1.1",
+ "resolved": "https://registry.npmjs.org/@koa/router/-/router-10.1.1.tgz",
+ "integrity": "sha512-ORNjq5z4EmQPriKbR0ER3k4Gh7YGNhWDL7JBW+8wXDrHLbWYKYSJaOJ9aN06npF5tbTxe2JBOsurpJDAvjiXKw==",
+ "dependencies": {
+ "debug": "^4.1.1",
+ "http-errors": "^1.7.3",
+ "koa-compose": "^4.1.0",
+ "methods": "^1.1.2",
+ "path-to-regexp": "^6.1.0"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
+ }
+ },
+ "node_modules/@koa/router/node_modules/depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@koa/router/node_modules/http-errors": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
+ "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
+ "dependencies": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@koa/router/node_modules/path-to-regexp": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz",
+ "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw=="
+ },
+ "node_modules/@koa/router/node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@leichtgewicht/ip-codec": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz",
+ "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A=="
+ },
+ "node_modules/@lezer/common": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.1.0.tgz",
+ "integrity": "sha512-XPIN3cYDXsoJI/oDWoR2tD++juVrhgIago9xyKhZ7IhGlzdDM9QgC8D8saKNCz5pindGcznFr2HBSsEQSWnSjw=="
+ },
+ "node_modules/@lezer/highlight": {
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.1.6.tgz",
+ "integrity": "sha512-cmSJYa2us+r3SePpRCjN5ymCqCPv+zyXmDl0ciWtVaNiORT/MxM7ZgOMQZADD0o51qOaOg24qc/zBViOIwAjJg==",
+ "dependencies": {
+ "@lezer/common": "^1.0.0"
+ }
+ },
+ "node_modules/@lezer/json": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@lezer/json/-/json-1.0.1.tgz",
+ "integrity": "sha512-nkVC27qiEZEjySbi6gQRuMwa2sDu2PtfjSgz0A4QF81QyRGm3kb2YRzLcOPcTEtmcwvrX/cej7mlhbwViA4WJw==",
+ "dependencies": {
+ "@lezer/highlight": "^1.0.0",
+ "@lezer/lr": "^1.0.0"
+ }
+ },
+ "node_modules/@lezer/lr": {
+ "version": "1.3.12",
+ "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.12.tgz",
+ "integrity": "sha512-5nwY1JzCueUdRtlMBnlf1SUi69iGCq2ABq7WQFQMkn/kxPvoACAEnTp4P17CtXxYr7WCwtYPLL2AEvxKPuF1OQ==",
+ "dependencies": {
+ "@lezer/common": "^1.0.0"
+ }
+ },
+ "node_modules/@lukeed/ms": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.1.tgz",
+ "integrity": "sha512-Xs/4RZltsAL7pkvaNStUQt7netTkyxrS0K+RILcVr3TRMS/ToOg4I6uNfhB9SlGsnWBym4U+EaXq0f0cEMNkHA==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@material/animation": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/animation/-/animation-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-leRf+BcZTfC/iSigLXnYgcHAGvFVQveoJT5+2PIRdyPI/bIG7hhciRgacHRsCKC0sGya81dDblLgdkjSUemYLw==",
+ "dependencies": {
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/auto-init": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/auto-init/-/auto-init-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-uxzDq7q3c0Bu1pAsMugc1Ik9ftQYQqZY+5e2ybNplT8gTImJhNt4M2mMiMHbMANk2l3UgICmUyRSomgPBWCPIA==",
+ "dependencies": {
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/banner": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/banner/-/banner-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-SHeVoidCUFVhXANN6MNWxK9SZoTSgpIP8GZB7kAl52BywLxtV+FirTtLXkg/8RUkxZRyRWl7HvQ0ZFZa7QQAyA==",
+ "dependencies": {
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/button": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/base": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/base/-/base-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-Fc3vGuOf+duGo22HTRP6dHdc+MUe0VqQfWOuKrn/wXKD62m0QQR2TqJd3rRhCumH557T5QUyheW943M3E+IGfg==",
+ "dependencies": {
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/button": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/button/-/button-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-3AQgwrPZCTWHDJvwgKq7Cj+BurQ4wTjDdGL+FEnIGUAjJDskwi1yzx5tW2Wf/NxIi7IoPFyOY3UB41jwMiOrnw==",
+ "dependencies": {
+ "@material/density": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/focus-ring": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/touch-target": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/card": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/card/-/card-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-nPlhiWvbLmooTnBmV5gmzB0eLWSgLKsSRBYAbIBmO76Okgz1y+fQNLag+lpm/TDaHVsn5fmQJH8e0zIg0rYsQA==",
+ "dependencies": {
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/checkbox": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/checkbox/-/checkbox-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-4tpNnO1L0IppoMF3oeQn8F17t2n0WHB0D7mdJK9rhrujen/fLbekkIC82APB3fdGtLGg3qeNqDqPsJm1YnmrwA==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/density": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/focus-ring": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/touch-target": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/chips": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/chips/-/chips-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-fqHKvE5bSWK0bXVkf57MWxZtytGqYBZvvHIOs4JI9HPHEhaJy4CpSw562BEtbm3yFxxALoQknvPW2KYzvADnmA==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/checkbox": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/density": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/focus-ring": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/touch-target": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "safevalues": "^0.3.4",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/circular-progress": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/circular-progress/-/circular-progress-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-Lxe8BGAxQwCQqrLhrYrIP0Uok10h7aYS3RBXP41ph+5GmwJd5zdyE2t93qm2dyThvU6qKuXw9726Dtq/N+wvZQ==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/progress-indicator": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/data-table": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/data-table/-/data-table-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-j/7qplT9+sUpfe4pyWhPbl01qJA+OoNAG3VMJruBBR461ZBKyTi7ssKH9yksFGZ8eCEPkOsk/+kDxsiZvRWkeQ==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/checkbox": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/density": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/icon-button": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/linear-progress": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/list": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/menu": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/select": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/touch-target": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/density": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/density/-/density-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-Zt3u07fXrBWLW06Tl5fgvjicxNQMkFdawLyNTzZ5TvbXfVkErILLePwwGaw8LNcvzqJP6ABLA8jiR+sKNoJQCg==",
+ "dependencies": {
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/dialog": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/dialog/-/dialog-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-o+9a/fmwJ9+gY3Z/uhj/PMVJDq7it1NTWKJn2GwAKdB+fDkT4hb9qEdcxMPyvJJ5ups+XiKZo03+tZrD+38c1w==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/button": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/icon-button": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/touch-target": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/dom": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/dom/-/dom-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-ly78R7aoCJtundSUu0UROU+5pQD5Piae0Y1MkN6bs0724azeazX1KeXFeaf06JOXnlr5/41ol+fSUPowjoqnOg==",
+ "dependencies": {
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/drawer": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/drawer/-/drawer-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-PFL4cEFnt7VTxDsuspFVNhsFDYyumjU0VWfj3PWB7XudsEfQ3lo85D3HCEtTTbRsCainGN8bgYNDNafLBqiigw==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/list": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/elevation": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/elevation/-/elevation-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-Ro+Pk8jFuap+T0B0shA3xI1hs2b89dNQ2EIPCNjNMp87emHKAzJfhKb7EZGIwv3+gFLlVaLyIVkb94I89KLsyg==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/fab": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/fab/-/fab-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-dvU0KWMRglwJEQwmQtFAmJcAjzg9VFF6Aqj78bJYu/DAIGFJ1VTTTSgoXM/XCm1YyQEZ7kZRvxBO37CH54rSDg==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/focus-ring": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/touch-target": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/feature-targeting": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/feature-targeting/-/feature-targeting-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-wkDjVcoVEYYaJvun28IXdln/foLgPD7n9ZC9TY76GErGCwTq+HWpU6wBAAk+ePmpRFDayw4vI4wBlaWGxLtysQ==",
+ "dependencies": {
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/floating-label": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/floating-label/-/floating-label-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-bUWPtXzZITOD/2mkvLkEPO1ngDWmb74y0Kgbz6llHLOQBtycyJIpuoQJ1q2Ez0NM/tFLwPphhAgRqmL3YQ/Kzw==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/focus-ring": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/focus-ring/-/focus-ring-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-cZHThVose3GvAlJzpJoBI1iqL6d1/Jj9hXrR+r8Mwtb1hBIUEG3hxfsRd4vGREuzROPlf0OgNf/V+YHoSwgR5w==",
+ "dependencies": {
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0"
+ }
+ },
+ "node_modules/@material/form-field": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/form-field/-/form-field-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-+JFXy5X44Gue1CbZZAQ6YejnI203lebYwL0i6k0ylDpWHEOdD5xkF2PyHR28r9/65Ebcbwbff6q7kI1SGoT7MA==",
+ "dependencies": {
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/icon-button": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/icon-button/-/icon-button-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-1a0MHgyIwOs4RzxrVljsqSizGYFlM1zY2AZaLDsgT4G3kzsplTx8HZQ022GpUCjAygW+WLvg4z1qAhQHvsbqlw==",
+ "dependencies": {
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/density": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/focus-ring": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/touch-target": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/image-list": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/image-list/-/image-list-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-WKWmiYap2iu4QdqmeUSliLlN4O2Ueqa0OuVAYHn/TCzmQ2xmnhZ1pvDLbs6TplpOmlki7vFfe+aSt5SU9gwfOQ==",
+ "dependencies": {
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/layout-grid": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/layout-grid/-/layout-grid-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-5GqmT6oTZhUGWIb+CLD0ZNyDyTiJsr/rm9oRIi3+vCujACwxFkON9tzBlZohdtFS16nuzUusthN6Jt9UrJcN6Q==",
+ "dependencies": {
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/line-ripple": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/line-ripple/-/line-ripple-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-8S30WXEuUdgDdBulzUDlPXD6qMzwCX9SxYb5mGDYLwl199cpSGdXHtGgEcCjokvnpLhdZhcT1Dsxeo1g2Evh5Q==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/linear-progress": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/linear-progress/-/linear-progress-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-6EJpjrz6aoH2/gXLg9iMe0yF2C42hpQyZoHpmcgTLKeci85ktDvJIjwup8tnk8ULQyFiGiIrhXw2v2RSsiFjvQ==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/progress-indicator": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/list": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/list/-/list-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-TQ1ppqiCMQj/P7bGD4edbIIv4goczZUoiUAaPq/feb1dflvrFMzYqJ7tQRRCyBL8nRhJoI2x99tk8Q2RXvlGUQ==",
+ "dependencies": {
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/density": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/menu": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/menu/-/menu-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-IlAh61xzrzxXs38QZlt74UYt8J431zGznSzDtB1Fqs6YFNd11QPKoiRXn1J2Qu/lUxbFV7i8NBKMCKtia0n6/Q==",
+ "dependencies": {
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/list": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/menu-surface": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/menu-surface": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/menu-surface/-/menu-surface-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-dMtSPN+olTWE+08M5qe4ea1IZOhVryYqzK0Gyb2u1G75rSArUxCOB5rr6OC/ST3Mq3RS6zGuYo7srZt4534K9Q==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/notched-outline": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/notched-outline/-/notched-outline-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-WuurMg44xexkvLTBTnsO0A+qnzFjpcPdvgWBGstBepYozsvSF9zJGdb1x7Zv1MmqbpYh/Ohnuxtb/Y3jOh6irg==",
+ "dependencies": {
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/floating-label": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/progress-indicator": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/progress-indicator/-/progress-indicator-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-uOnsvqw5F2fkeTnTl4MrYzjI7KCLmmLyZaM0cgLNuLsWVlddQE+SGMl28tENx7DUK3HebWq0FxCP8f25LuDD+w==",
+ "dependencies": {
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/radio": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/radio/-/radio-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-ehzOK+U1IxQN+OQjgD2lsnf1t7t7RAwQzeO6Czkiuid29ookYbQynWuLWk7NW8H8ohl7lnmfqTP1xSNkkL/F0g==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/density": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/focus-ring": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/touch-target": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/ripple": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/ripple/-/ripple-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-JfLW+g3GMVDv4cruQ19+HUxpKVdWCldFlIPw1UYezz2h3WTNDy05S3uP2zUdXzZ01C3dkBFviv4nqZ0GCT16MA==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/rtl": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/rtl/-/rtl-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-SkKLNLFp5QtG7/JEFg9R92qq4MzTcZ5As6sWbH7rRg6ahTHoJEuqE+pOb9Vrtbj84k5gtX+vCYPvCILtSlr2uw==",
+ "dependencies": {
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/segmented-button": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/segmented-button/-/segmented-button-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-YDwkCWP9l5mIZJ7pZJZ2hMDxfBlIGVJ+deNzr8O+Z7/xC5LGXbl4R5aPtUVHygvXAXxpf5096ZD+dSXzYzvWlw==",
+ "dependencies": {
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/touch-target": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/select": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/select/-/select-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-unfOWVf7T0sixVG+3k3RTuATfzqvCF6QAzA6J9rlCh/Tq4HuIBNDdV4z19IVu4zwmgWYxY0iSvqWUvdJJYwakQ==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/density": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/floating-label": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/line-ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/list": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/menu": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/menu-surface": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/notched-outline": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/shape": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/shape/-/shape-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-Dsvr771ZKC46ODzoixLdGwlLEQLfxfLrtnRojXABoZf5G3o9KtJU+J+5Ld5aa960OAsCzzANuaub4iR88b1guA==",
+ "dependencies": {
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/slider": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/slider/-/slider-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-3AEu+7PwW4DSNLndue47dh2u7ga4hDJRYmuu7wnJCIWJBnLCkp6C92kNc4Rj5iQY2ftJio5aj1gqryluh5tlYg==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/snackbar": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/snackbar/-/snackbar-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-TwwQSYxfGK6mc03/rdDamycND6o+1p61WNd7ElZv1F1CLxB4ihRjbCoH7Qo+oVDaP8CTpjeclka+24RLhQq0mA==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/button": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/icon-button": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/switch": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/switch/-/switch-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-OjUjtT0kRz1ASAsOS+dNzwMwvsjmqy5edK57692qmrP6bL4GblFfBDoiNJ6t0AN4OaKcmL5Hy/xNrTdOZW7Qqw==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/density": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/focus-ring": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "safevalues": "^0.3.4",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/tab": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/tab/-/tab-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-s/L9otAwn/pZwVQZBRQJmPqYeNbjoEbzbjMpDQf/VBG/6dJ+aP03ilIBEkqo8NVnCoChqcdtVCoDNRtbU+yp6w==",
+ "dependencies": {
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/focus-ring": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tab-indicator": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/tab-bar": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/tab-bar/-/tab-bar-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-Xmtq0wJGfu5k+zQeFeNsr4bUKv7L+feCmUp/gsapJ655LQKMXOUQZtSv9ZqWOfrCMy55hoF1CzGFV+oN3tyWWQ==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/density": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tab": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tab-indicator": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tab-scroller": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/tab-indicator": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/tab-indicator/-/tab-indicator-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-despCJYi1GrDDq7F2hvLQkObHnSLZPPDxnOzU16zJ6FNYvIdszgfzn2HgAZ6pl5hLOexQ8cla6cAqjTDuaJBhQ==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/tab-scroller": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/tab-scroller/-/tab-scroller-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-QWHG/EWxirj4V9u2IHz+OSY9XCWrnNrPnNgEufxAJVUKV/A8ma1DYeFSQqxhX709R8wKGdycJksg0Flkl7Gq7w==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tab": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/textfield": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/textfield/-/textfield-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-R3qRex9kCaZIAK8DuxPnVC42R0OaW7AB7fsFknDKeTeVQvRcbnV8E+iWSdqTiGdsi6QQHifX8idUrXw+O45zPw==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/density": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/floating-label": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/line-ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/notched-outline": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/theme": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/theme/-/theme-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-CpUwXGE0dbhxQ45Hu9r9wbJtO/MAlv5ER4tBHA9tp/K+SU+lDgurBE2touFMg5INmdfVNtdumxb0nPPLaNQcUg==",
+ "dependencies": {
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/tokens": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/tokens/-/tokens-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-nbEuGj05txWz6ZMUanpM47SaAD7soyjKILR+XwDell9Zg3bGhsnexCNXPEz2fD+YgomS+jM5XmIcaJJHg/H93Q==",
+ "dependencies": {
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0"
+ }
+ },
+ "node_modules/@material/tooltip": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-UzuXp0b9NuWuYLYpPguxrjbJnCmT/Cco8CkjI/6JajxaeA3o2XEBbQfRMTq8PTafuBjCHTc0b0mQY7rtxUp1Gg==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/button": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/dom": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/tokens": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "safevalues": "^0.3.4",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/top-app-bar": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/top-app-bar/-/top-app-bar-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-vJWjsvqtdSD5+yQ/9vgoBtBSCvPJ5uF/DVssv8Hdhgs1PYaAcODUi77kdi0+sy/TaWyOsTkQixqmwnFS16zesA==",
+ "dependencies": {
+ "@material/animation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/elevation": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/ripple": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/shape": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/typography": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/touch-target": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/touch-target/-/touch-target-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-AqYh9fjt+tv4ZE0C6MeYHblS2H+XwLbDl2mtyrK0DOEnCVQk5/l5ImKDfhrUdFWHvS4a5nBM4AA+sa7KaroLoA==",
+ "dependencies": {
+ "@material/base": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/rtl": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@material/typography": {
+ "version": "15.0.0-canary.bc9ae6c9c.0",
+ "resolved": "https://registry.npmjs.org/@material/typography/-/typography-15.0.0-canary.bc9ae6c9c.0.tgz",
+ "integrity": "sha512-CKsG1zyv34AKPNyZC8olER2OdPII64iR2SzQjpqh1UUvmIFiMPk23LvQ1OnC5aCB14pOXzmVgvJt31r9eNdZ6Q==",
+ "dependencies": {
+ "@material/feature-targeting": "15.0.0-canary.bc9ae6c9c.0",
+ "@material/theme": "15.0.0-canary.bc9ae6c9c.0",
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/@microsoft/applicationinsights-web-snippet": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-snippet/-/applicationinsights-web-snippet-1.0.1.tgz",
+ "integrity": "sha512-2IHAOaLauc8qaAitvWS+U931T+ze+7MNWrDHY47IENP5y2UA0vqJDu67kWZDdpCN1fFC77sfgfB+HV7SrKshnQ=="
+ },
+ "node_modules/@mongodb-js/saslprep": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.0.tgz",
+ "integrity": "sha512-Xfijy7HvfzzqiOAhAepF4SGN5e9leLkMvg/OPOF97XemjfVCYN/oWa75wnkc6mltMSTwY+XlbhWgUOJmkFspSw==",
+ "optional": true,
+ "dependencies": {
+ "sparse-bitfield": "^3.0.3"
+ }
+ },
+ "node_modules/@next/env": {
+ "version": "13.5.3",
+ "resolved": "https://registry.npmjs.org/@next/env/-/env-13.5.3.tgz",
+ "integrity": "sha512-X4te86vsbjsB7iO4usY9jLPtZ827Mbx+WcwNBGUOIuswuTAKQtzsuoxc/6KLxCMvogKG795MhrR1LDhYgDvasg=="
+ },
+ "node_modules/@next/eslint-plugin-next": {
+ "version": "13.5.3",
+ "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.5.3.tgz",
+ "integrity": "sha512-lbZOoEjzSuTtpk9UgV9rOmxYw+PsSfNR+00mZcInqooiDMZ1u+RqT1YQYLsEZPW1kumZoQe5+exkCBtZ2xn0uw==",
+ "dev": true,
+ "dependencies": {
+ "glob": "7.1.7"
+ }
+ },
+ "node_modules/@next/eslint-plugin-next/node_modules/glob": {
+ "version": "7.1.7",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
+ "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+ "dev": true,
+ "dependencies": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ },
+ "engines": {
+ "node": "*"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/@next/swc-darwin-arm64": {
+ "version": "13.5.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.5.3.tgz",
+ "integrity": "sha512-6hiYNJxJmyYvvKGrVThzo4nTcqvqUTA/JvKim7Auaj33NexDqSNwN5YrrQu+QhZJCIpv2tULSHt+lf+rUflLSw==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-darwin-x64": {
+ "version": "13.5.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.5.3.tgz",
+ "integrity": "sha512-UpBKxu2ob9scbpJyEq/xPgpdrgBgN3aLYlxyGqlYX5/KnwpJpFuIHU2lx8upQQ7L+MEmz+fA1XSgesoK92ppwQ==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-arm64-gnu": {
+ "version": "13.5.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.5.3.tgz",
+ "integrity": "sha512-5AzM7Yx1Ky+oLY6pHs7tjONTF22JirDPd5Jw/3/NazJ73uGB05NqhGhB4SbeCchg7SlVYVBeRMrMSZwJwq/xoA==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-arm64-musl": {
+ "version": "13.5.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.5.3.tgz",
+ "integrity": "sha512-A/C1shbyUhj7wRtokmn73eBksjTM7fFQoY2v/0rTM5wehpkjQRLOXI8WJsag2uLhnZ4ii5OzR1rFPwoD9cvOgA==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-x64-gnu": {
+ "version": "13.5.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.5.3.tgz",
+ "integrity": "sha512-FubPuw/Boz8tKkk+5eOuDHOpk36F80rbgxlx4+xty/U71e3wZZxVYHfZXmf0IRToBn1Crb8WvLM9OYj/Ur815g==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-x64-musl": {
+ "version": "13.5.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.5.3.tgz",
+ "integrity": "sha512-DPw8nFuM1uEpbX47tM3wiXIR0Qa+atSzs9Q3peY1urkhofx44o7E1svnq+a5Q0r8lAcssLrwiM+OyJJgV/oj7g==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-win32-arm64-msvc": {
+ "version": "13.5.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.5.3.tgz",
+ "integrity": "sha512-zBPSP8cHL51Gub/YV8UUePW7AVGukp2D8JU93IHbVDu2qmhFAn9LWXiOOLKplZQKxnIPUkJTQAJDCWBWU4UWUA==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-win32-ia32-msvc": {
+ "version": "13.5.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.5.3.tgz",
+ "integrity": "sha512-ONcL/lYyGUj4W37D4I2I450SZtSenmFAvapkJQNIJhrPMhzDU/AdfLkW98NvH1D2+7FXwe7yclf3+B7v28uzBQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-win32-x64-msvc": {
+ "version": "13.5.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.5.3.tgz",
+ "integrity": "sha512-2Vz2tYWaLqJvLcWbbTlJ5k9AN6JD7a5CN2pAeIzpbecK8ZF/yobA39cXtv6e+Z8c5UJuVOmaTldEAIxvsIux/Q==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@ngtools/webpack": {
+ "version": "16.2.4",
+ "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-16.2.4.tgz",
+ "integrity": "sha512-ILri2xJ6vMUaFxHJABGF/H7/pYoBkuXTFlHCeFee9pHA+EHkxoiwezLf8baiFT3IGOmdG6GOUlfh/4QicGLdTQ==",
+ "dev": true,
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0",
+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
+ "yarn": ">= 1.13.0"
+ },
+ "peerDependencies": {
+ "@angular/compiler-cli": "^16.0.0",
+ "typescript": ">=4.9.3 <5.2",
+ "webpack": "^5.54.0"
+ }
+ },
+ "node_modules/@ngx-env/builder": {
+ "version": "16.1.3",
+ "resolved": "https://registry.npmjs.org/@ngx-env/builder/-/builder-16.1.3.tgz",
+ "integrity": "sha512-Us17dnTqhC/RzHmcK9i0iJd9KpyZopsSzZwPuRDBhLxhn8Qs1jxRbDEMsEtuZOLbwfzJo1TUQsOZBF6TPT/SsA==",
+ "dev": true,
+ "dependencies": {
+ "@dotenv-run/webpack": "^1.0.1"
+ }
+ },
+ "node_modules/@nodelib/fs.scandir": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
+ "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
+ "dependencies": {
+ "@nodelib/fs.stat": "2.0.5",
+ "run-parallel": "^1.1.9"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@nodelib/fs.stat": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
+ "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@nodelib/fs.walk": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
+ "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
+ "dependencies": {
+ "@nodelib/fs.scandir": "2.1.5",
+ "fastq": "^1.6.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@npmcli/fs": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz",
+ "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==",
+ "dev": true,
+ "dependencies": {
+ "semver": "^7.3.5"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@npmcli/git": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.1.0.tgz",
+ "integrity": "sha512-9hwoB3gStVfa0N31ymBmrX+GuDGdVA/QWShZVqE0HK2Af+7QGGrCTbZia/SW0ImUTjTne7SP91qxDmtXvDHRPQ==",
+ "dev": true,
+ "dependencies": {
+ "@npmcli/promise-spawn": "^6.0.0",
+ "lru-cache": "^7.4.4",
+ "npm-pick-manifest": "^8.0.0",
+ "proc-log": "^3.0.0",
+ "promise-inflight": "^1.0.1",
+ "promise-retry": "^2.0.1",
+ "semver": "^7.3.5",
+ "which": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@npmcli/git/node_modules/lru-cache": {
+ "version": "7.18.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",
+ "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@npmcli/git/node_modules/which": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz",
+ "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==",
+ "dev": true,
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/which.js"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@npmcli/installed-package-contents": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-2.0.2.tgz",
+ "integrity": "sha512-xACzLPhnfD51GKvTOOuNX2/V4G4mz9/1I2MfDoye9kBM3RYe5g2YbscsaGoTlaWqkxeiapBWyseULVKpSVHtKQ==",
+ "dev": true,
+ "dependencies": {
+ "npm-bundled": "^3.0.0",
+ "npm-normalize-package-bin": "^3.0.0"
+ },
+ "bin": {
+ "installed-package-contents": "lib/index.js"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@npmcli/node-gyp": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-3.0.0.tgz",
+ "integrity": "sha512-gp8pRXC2oOxu0DUE1/M3bYtb1b3/DbJ5aM113+XJBgfXdussRAsX0YOrOhdd8WvnAR6auDBvJomGAkLKA5ydxA==",
+ "dev": true,
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@npmcli/promise-spawn": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz",
+ "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==",
+ "dev": true,
+ "dependencies": {
+ "which": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@npmcli/promise-spawn/node_modules/which": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz",
+ "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==",
+ "dev": true,
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/which.js"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@npmcli/run-script": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.2.tgz",
+ "integrity": "sha512-NCcr1uQo1k5U+SYlnIrbAh3cxy+OQT1VtqiAbxdymSlptbzBb62AjH2xXgjNCoP073hoa1CfCAcwoZ8k96C4nA==",
+ "dev": true,
+ "dependencies": {
+ "@npmcli/node-gyp": "^3.0.0",
+ "@npmcli/promise-spawn": "^6.0.0",
+ "node-gyp": "^9.0.0",
+ "read-package-json-fast": "^3.0.0",
+ "which": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@npmcli/run-script/node_modules/which": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz",
+ "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==",
+ "dev": true,
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/which.js"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@opentelemetry/api": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.6.0.tgz",
+ "integrity": "sha512-OWlrQAnWn9577PhVgqjUvMr1pg57Bc4jv0iL4w0PRuOSRvq67rvHW9Ie/dZVMvCzhSCB+UxhcY/PmCmFj33Q+g==",
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/@opentelemetry/core": {
+ "version": "1.17.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.17.0.tgz",
+ "integrity": "sha512-tfnl3h+UefCgx1aeN2xtrmr6BmdWGKXypk0pflQR0urFS40aE88trnkOMc2HTJZbMrqEEl4HsaBeFhwLVXsrJg==",
+ "dependencies": {
+ "@opentelemetry/semantic-conventions": "1.17.0"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": ">=1.0.0 <1.7.0"
+ }
+ },
+ "node_modules/@opentelemetry/instrumentation": {
+ "version": "0.41.2",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.41.2.tgz",
+ "integrity": "sha512-rxU72E0pKNH6ae2w5+xgVYZLzc5mlxAbGzF4shxMVK8YC2QQsfN38B2GPbj0jvrKWWNUElfclQ+YTykkNg/grw==",
+ "dependencies": {
+ "@types/shimmer": "^1.0.2",
+ "import-in-the-middle": "1.4.2",
+ "require-in-the-middle": "^7.1.1",
+ "semver": "^7.5.1",
+ "shimmer": "^1.2.1"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": "^1.3.0"
+ }
+ },
+ "node_modules/@opentelemetry/resources": {
+ "version": "1.17.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.17.0.tgz",
+ "integrity": "sha512-+u0ciVnj8lhuL/qGRBPeVYvk7fL+H/vOddfvmOeJaA1KC+5/3UED1c9KoZQlRsNT5Kw1FaK8LkY2NVLYfOVZQw==",
+ "dependencies": {
+ "@opentelemetry/core": "1.17.0",
+ "@opentelemetry/semantic-conventions": "1.17.0"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": ">=1.0.0 <1.7.0"
+ }
+ },
+ "node_modules/@opentelemetry/sdk-trace-base": {
+ "version": "1.17.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.17.0.tgz",
+ "integrity": "sha512-2T5HA1/1iE36Q9eg6D4zYlC4Y4GcycI1J6NsHPKZY9oWfAxWsoYnRlkPfUqyY5XVtocCo/xHpnJvGNHwzT70oQ==",
+ "dependencies": {
+ "@opentelemetry/core": "1.17.0",
+ "@opentelemetry/resources": "1.17.0",
+ "@opentelemetry/semantic-conventions": "1.17.0"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": ">=1.0.0 <1.7.0"
+ }
+ },
+ "node_modules/@opentelemetry/semantic-conventions": {
+ "version": "1.17.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.17.0.tgz",
+ "integrity": "sha512-+fguCd2d8d2qruk0H0DsCEy2CTK3t0Tugg7MhZ/UQMvmewbZLNnJ6heSYyzIZWG5IPfAXzoj4f4F/qpM7l4VBA==",
+ "engines": {
+ "node": ">=14"
+ }
+ },
+ "node_modules/@pkgjs/parseargs": {
+ "version": "0.11.0",
+ "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
+ "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
+ "dev": true,
+ "optional": true,
+ "engines": {
+ "node": ">=14"
+ }
+ },
+ "node_modules/@playwright/test": {
+ "version": "1.38.1",
+ "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.38.1.tgz",
+ "integrity": "sha512-NqRp8XMwj3AK+zKLbZShl0r/9wKgzqI/527bkptKXomtuo+dOjU9NdMASQ8DNC9z9zLOMbG53T4eihYr3XR+BQ==",
+ "dev": true,
+ "dependencies": {
+ "playwright": "1.38.1"
+ },
+ "bin": {
+ "playwright": "cli.js"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@pmmmwh/react-refresh-webpack-plugin": {
+ "version": "0.5.10",
+ "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.10.tgz",
+ "integrity": "sha512-j0Ya0hCFZPd4x40qLzbhGsh9TMtdb+CJQiso+WxLOPNasohq9cc5SNUcwsZaRH6++Xh91Xkm/xHCkuIiIu0LUA==",
+ "dependencies": {
+ "ansi-html-community": "^0.0.8",
+ "common-path-prefix": "^3.0.0",
+ "core-js-pure": "^3.23.3",
+ "error-stack-parser": "^2.0.6",
+ "find-up": "^5.0.0",
+ "html-entities": "^2.1.0",
+ "loader-utils": "^2.0.4",
+ "schema-utils": "^3.0.0",
+ "source-map": "^0.7.3"
+ },
+ "engines": {
+ "node": ">= 10.13"
+ },
+ "peerDependencies": {
+ "@types/webpack": "4.x || 5.x",
+ "react-refresh": ">=0.10.0 <1.0.0",
+ "sockjs-client": "^1.4.0",
+ "type-fest": ">=0.17.0 <4.0.0",
+ "webpack": ">=4.43.0 <6.0.0",
+ "webpack-dev-server": "3.x || 4.x",
+ "webpack-hot-middleware": "2.x",
+ "webpack-plugin-serve": "0.x || 1.x"
+ },
+ "peerDependenciesMeta": {
+ "@types/webpack": {
+ "optional": true
+ },
+ "sockjs-client": {
+ "optional": true
+ },
+ "type-fest": {
+ "optional": true
+ },
+ "webpack-dev-server": {
+ "optional": true
+ },
+ "webpack-hot-middleware": {
+ "optional": true
+ },
+ "webpack-plugin-serve": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@pmmmwh/react-refresh-webpack-plugin/node_modules/ajv": {
+ "version": "6.12.6",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/@pmmmwh/react-refresh-webpack-plugin/node_modules/ajv-keywords": {
+ "version": "3.5.2",
+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
+ "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
+ "peerDependencies": {
+ "ajv": "^6.9.1"
+ }
+ },
+ "node_modules/@pmmmwh/react-refresh-webpack-plugin/node_modules/json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+ },
+ "node_modules/@pmmmwh/react-refresh-webpack-plugin/node_modules/loader-utils": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
+ "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
+ "dependencies": {
+ "big.js": "^5.2.2",
+ "emojis-list": "^3.0.0",
+ "json5": "^2.1.2"
+ },
+ "engines": {
+ "node": ">=8.9.0"
+ }
+ },
+ "node_modules/@pmmmwh/react-refresh-webpack-plugin/node_modules/schema-utils": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz",
+ "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==",
+ "dependencies": {
+ "@types/json-schema": "^7.0.8",
+ "ajv": "^6.12.5",
+ "ajv-keywords": "^3.5.2"
+ },
+ "engines": {
+ "node": ">= 10.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ }
+ },
+ "node_modules/@protobufjs/aspromise": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
+ "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ=="
+ },
+ "node_modules/@protobufjs/base64": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
+ "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg=="
+ },
+ "node_modules/@protobufjs/codegen": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
+ "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg=="
+ },
+ "node_modules/@protobufjs/eventemitter": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
+ "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q=="
+ },
+ "node_modules/@protobufjs/fetch": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
+ "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==",
+ "dependencies": {
+ "@protobufjs/aspromise": "^1.1.1",
+ "@protobufjs/inquire": "^1.1.0"
+ }
+ },
+ "node_modules/@protobufjs/float": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
+ "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ=="
+ },
+ "node_modules/@protobufjs/inquire": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
+ "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q=="
+ },
+ "node_modules/@protobufjs/path": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
+ "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA=="
+ },
+ "node_modules/@protobufjs/pool": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
+ "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw=="
+ },
+ "node_modules/@protobufjs/utf8": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
+ "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
+ },
+ "node_modules/@radix-ui/number": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.0.1.tgz",
+ "integrity": "sha512-T5gIdVO2mmPW3NNhjNgEP3cqMXjXL9UbO0BzWcXfvdBs+BohbQxvd/K5hSVKmn9/lbTdsQVKbUcP5WLCwvUbBg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ }
+ },
+ "node_modules/@radix-ui/primitive": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.0.1.tgz",
+ "integrity": "sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ }
+ },
+ "node_modules/@radix-ui/react-arrow": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.0.3.tgz",
+ "integrity": "sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-collection": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.0.3.tgz",
+ "integrity": "sha512-3SzW+0PW7yBBoQlT8wNcGtaxaD0XSu0uLUFgrtHY08Acx05TaHaOmVLR73c0j/cqpDy53KBMO7s0dx2wmOIDIA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-slot": "1.0.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-compose-refs": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.1.tgz",
+ "integrity": "sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-context": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.0.1.tgz",
+ "integrity": "sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-direction": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.0.1.tgz",
+ "integrity": "sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-dismissable-layer": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.5.tgz",
+ "integrity": "sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-escape-keydown": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-dropdown-menu": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.0.6.tgz",
+ "integrity": "sha512-i6TuFOoWmLWq+M/eCLGd/bQ2HfAX1RJgvrBQ6AQLmzfvsLdefxbWu8G9zczcPFfcSPehz9GcpF6K9QYreFV8hA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-menu": "2.0.6",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-controllable-state": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-focus-guards": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.0.1.tgz",
+ "integrity": "sha512-Rect2dWbQ8waGzhMavsIbmSVCgYxkXLxxR3ZvCX79JOglzdEy4JXMb98lq4hPxUbLr77nP0UOGf4rcMU+s1pUA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-focus-scope": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.3.tgz",
+ "integrity": "sha512-upXdPfqI4islj2CslyfUBNlaJCPybbqRHAi1KER7Isel9Q2AtSJ0zRBZv8mWQiFXD2nyAJ4BhC3yXgZ6kMBSrQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-id": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.0.1.tgz",
+ "integrity": "sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-use-layout-effect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-menu": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.0.6.tgz",
+ "integrity": "sha512-BVkFLS+bUC8HcImkRKPSiVumA1VPOOEC5WBMiT+QAVsPzW1FJzI9KnqgGxVDPBcql5xXrHkD3JOVoXWEXD8SYA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-collection": "1.0.3",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-dismissable-layer": "1.0.5",
+ "@radix-ui/react-focus-guards": "1.0.1",
+ "@radix-ui/react-focus-scope": "1.0.4",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-popper": "1.1.3",
+ "@radix-ui/react-portal": "1.0.4",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-roving-focus": "1.0.4",
+ "@radix-ui/react-slot": "1.0.2",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "aria-hidden": "^1.1.1",
+ "react-remove-scroll": "2.5.5"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-focus-scope": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.4.tgz",
+ "integrity": "sha512-sL04Mgvf+FmyvZeYfNu1EPAaaxD+aw7cYeIB9L9Fvq8+urhltTRaEo5ysKOpHuKPclsZcSUMKlN05x4u+CINpA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-menu/node_modules/react-remove-scroll": {
+ "version": "2.5.5",
+ "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz",
+ "integrity": "sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw==",
+ "dependencies": {
+ "react-remove-scroll-bar": "^2.3.3",
+ "react-style-singleton": "^2.2.1",
+ "tslib": "^2.1.0",
+ "use-callback-ref": "^1.3.0",
+ "use-sidecar": "^1.1.2"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-popper": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.1.3.tgz",
+ "integrity": "sha512-cKpopj/5RHZWjrbF2846jBNacjQVwkP068DfmgrNJXpvVWrOvlAmE9xSiy5OqeE+Gi8D9fP+oDhUnPqNMY8/5w==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@floating-ui/react-dom": "^2.0.0",
+ "@radix-ui/react-arrow": "1.0.3",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-layout-effect": "1.0.1",
+ "@radix-ui/react-use-rect": "1.0.1",
+ "@radix-ui/react-use-size": "1.0.1",
+ "@radix-ui/rect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-portal": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.0.4.tgz",
+ "integrity": "sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-presence": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.0.1.tgz",
+ "integrity": "sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-use-layout-effect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-primitive": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-1.0.3.tgz",
+ "integrity": "sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-slot": "1.0.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-roving-focus": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.0.4.tgz",
+ "integrity": "sha512-2mUg5Mgcu001VkGy+FfzZyzbmuUWzgWkj3rvv4yu+mLw03+mTzbxZHvfcGyFp2b8EkQeMkpRQ5FiA2Vr2O6TeQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-collection": "1.0.3",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-controllable-state": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-slot": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.0.2.tgz",
+ "integrity": "sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-compose-refs": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-callback-ref": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.0.1.tgz",
+ "integrity": "sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-controllable-state": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.0.1.tgz",
+ "integrity": "sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-use-callback-ref": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-escape-keydown": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.0.3.tgz",
+ "integrity": "sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-use-callback-ref": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-layout-effect": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.0.1.tgz",
+ "integrity": "sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-previous": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.0.1.tgz",
+ "integrity": "sha512-cV5La9DPwiQ7S0gf/0qiD6YgNqM5Fk97Kdrlc5yBcrF3jyEZQwm7vYFqMo4IfeHgJXsRaMvLABFtd0OVEmZhDw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-rect": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.0.1.tgz",
+ "integrity": "sha512-Cq5DLuSiuYVKNU8orzJMbl15TXilTnJKUCltMVQg53BQOF1/C5toAaGrowkgksdBQ9H+SRL23g0HDmg9tvmxXw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/rect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-size": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.0.1.tgz",
+ "integrity": "sha512-ibay+VqrgcaI6veAojjofPATwledXiSmX+C0KrBk/xgpX9rBzPV3OsfwlhQdUOFbh+LKQorLYT+xTXW9V8yd0g==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-use-layout-effect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-visually-hidden": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.0.3.tgz",
+ "integrity": "sha512-D4w41yN5YRKtu464TLnByKzMDG/JlMPHtfZgQAu9v6mNakUqGUI9vUrfQKz8NK41VMm/xbZbh76NUTVtIYqOMA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/rect": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.0.1.tgz",
+ "integrity": "sha512-fyrgCaedtvMg9NK3en0pnOYJdtfwxUcNolezkNPUsoX57X8oQk+NkqcvzHXD2uKNij6GXmWU9NDru2IWjrO4BQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ }
+ },
+ "node_modules/@react-dnd/asap": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/@react-dnd/asap/-/asap-4.0.1.tgz",
+ "integrity": "sha512-kLy0PJDDwvwwTXxqTFNAAllPHD73AycE9ypWeln/IguoGBEbvFcPDbCV03G52bEcC5E+YgupBE0VzHGdC8SIXg=="
+ },
+ "node_modules/@react-dnd/invariant": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/@react-dnd/invariant/-/invariant-3.0.1.tgz",
+ "integrity": "sha512-blqduwV86oiKw2Gr44wbe3pj3Z/OsXirc7ybCv9F/pLAR+Aih8F3rjeJzK0ANgtYKv5lCpkGVoZAeKitKDaD/g=="
+ },
+ "node_modules/@react-dnd/shallowequal": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/@react-dnd/shallowequal/-/shallowequal-3.0.1.tgz",
+ "integrity": "sha512-XjDVbs3ZU16CO1h5Q3Ew2RPJqmZBDE/EVf1LYp6ePEffs3V/MX9ZbL5bJr8qiK5SbGmUMuDoaFgyKacYz8prRA=="
+ },
+ "node_modules/@rushstack/eslint-patch": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.5.0.tgz",
+ "integrity": "sha512-EF3948ckf3f5uPgYbQ6GhyA56Dmv8yg0+ir+BroRjwdxyZJsekhZzawOecC2rOTPCz173t7ZcR1HHZu0dZgOCw==",
+ "dev": true
+ },
+ "node_modules/@rushstack/ts-command-line": {
+ "version": "4.16.1",
+ "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.16.1.tgz",
+ "integrity": "sha512-+OCsD553GYVLEmz12yiFjMOzuPeCiZ3f8wTiFHL30ZVXexTyPmgjwXEhg2K2P0a2lVf+8YBy7WtPoflB2Fp8/A==",
+ "dependencies": {
+ "@types/argparse": "1.0.38",
+ "argparse": "~1.0.9",
+ "colors": "~1.2.1",
+ "string-argv": "~0.3.1"
+ }
+ },
+ "node_modules/@schematics/angular": {
+ "version": "16.2.4",
+ "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-16.2.4.tgz",
+ "integrity": "sha512-ZFPxn0yihdNcg5UpJvnfxIpv4GuW6nYDkgeIlYb5k/a0dKSW8wE8Akcl1JhJtdKJ0RVcn1OwZDmx028JCbZJLA==",
+ "dev": true,
+ "dependencies": {
+ "@angular-devkit/core": "16.2.4",
+ "@angular-devkit/schematics": "16.2.4",
+ "jsonc-parser": "3.2.0"
+ },
+ "engines": {
+ "node": "^16.14.0 || >=18.10.0",
+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
+ "yarn": ">= 1.13.0"
+ }
+ },
+ "node_modules/@sentry/core": {
+ "version": "6.19.7",
+ "resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.19.7.tgz",
+ "integrity": "sha512-tOfZ/umqB2AcHPGbIrsFLcvApdTm9ggpi/kQZFkej7kMphjT+SGBiQfYtjyg9jcRW+ilAR4JXC9BGKsdEQ+8Vw==",
+ "dependencies": {
+ "@sentry/hub": "6.19.7",
+ "@sentry/minimal": "6.19.7",
+ "@sentry/types": "6.19.7",
+ "@sentry/utils": "6.19.7",
+ "tslib": "^1.9.3"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@sentry/core/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
+ },
+ "node_modules/@sentry/hub": {
+ "version": "6.19.7",
+ "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-6.19.7.tgz",
+ "integrity": "sha512-y3OtbYFAqKHCWezF0EGGr5lcyI2KbaXW2Ik7Xp8Mu9TxbSTuwTe4rTntwg8ngPjUQU3SUHzgjqVB8qjiGqFXCA==",
+ "dependencies": {
+ "@sentry/types": "6.19.7",
+ "@sentry/utils": "6.19.7",
+ "tslib": "^1.9.3"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@sentry/hub/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
+ },
+ "node_modules/@sentry/minimal": {
+ "version": "6.19.7",
+ "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.19.7.tgz",
+ "integrity": "sha512-wcYmSJOdvk6VAPx8IcmZgN08XTXRwRtB1aOLZm+MVHjIZIhHoBGZJYTVQS/BWjldsamj2cX3YGbGXNunaCfYJQ==",
+ "dependencies": {
+ "@sentry/hub": "6.19.7",
+ "@sentry/types": "6.19.7",
+ "tslib": "^1.9.3"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@sentry/minimal/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
+ },
+ "node_modules/@sentry/node": {
+ "version": "6.19.7",
+ "resolved": "https://registry.npmjs.org/@sentry/node/-/node-6.19.7.tgz",
+ "integrity": "sha512-gtmRC4dAXKODMpHXKfrkfvyBL3cI8y64vEi3fDD046uqYcrWdgoQsffuBbxMAizc6Ez1ia+f0Flue6p15Qaltg==",
+ "dependencies": {
+ "@sentry/core": "6.19.7",
+ "@sentry/hub": "6.19.7",
+ "@sentry/types": "6.19.7",
+ "@sentry/utils": "6.19.7",
+ "cookie": "^0.4.1",
+ "https-proxy-agent": "^5.0.0",
+ "lru_map": "^0.3.3",
+ "tslib": "^1.9.3"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@sentry/node/node_modules/cookie": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz",
+ "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@sentry/node/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
+ },
+ "node_modules/@sentry/types": {
+ "version": "6.19.7",
+ "resolved": "https://registry.npmjs.org/@sentry/types/-/types-6.19.7.tgz",
+ "integrity": "sha512-jH84pDYE+hHIbVnab3Hr+ZXr1v8QABfhx39KknxqKWr2l0oEItzepV0URvbEhB446lk/S/59230dlUUIBGsXbg==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@sentry/utils": {
+ "version": "6.19.7",
+ "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-6.19.7.tgz",
+ "integrity": "sha512-z95ECmE3i9pbWoXQrD/7PgkBAzJYR+iXtPuTkpBjDKs86O3mT+PXOT3BAn79w2wkn7/i3vOGD2xVr1uiMl26dA==",
+ "dependencies": {
+ "@sentry/types": "6.19.7",
+ "tslib": "^1.9.3"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@sentry/utils/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
+ },
+ "node_modules/@sideway/address": {
+ "version": "4.1.4",
+ "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz",
+ "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==",
+ "dev": true,
+ "dependencies": {
+ "@hapi/hoek": "^9.0.0"
+ }
+ },
+ "node_modules/@sideway/formula": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz",
+ "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==",
+ "dev": true
+ },
+ "node_modules/@sideway/pinpoint": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz",
+ "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==",
+ "dev": true
+ },
+ "node_modules/@sigstore/bundle": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-1.1.0.tgz",
+ "integrity": "sha512-PFutXEy0SmQxYI4texPw3dd2KewuNqv7OuK1ZFtY2fM754yhvG2KdgwIhRnoEE2uHdtdGNQ8s0lb94dW9sELog==",
+ "dev": true,
+ "dependencies": {
+ "@sigstore/protobuf-specs": "^0.2.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@sigstore/protobuf-specs": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.2.1.tgz",
+ "integrity": "sha512-XTWVxnWJu+c1oCshMLwnKvz8ZQJJDVOlciMfgpJBQbThVjKTCG8dwyhgLngBD2KN0ap9F/gOV8rFDEx8uh7R2A==",
+ "dev": true,
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@sigstore/sign": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-1.0.0.tgz",
+ "integrity": "sha512-INxFVNQteLtcfGmcoldzV6Je0sbbfh9I16DM4yJPw3j5+TFP8X6uIiA18mvpEa9yyeycAKgPmOA3X9hVdVTPUA==",
+ "dev": true,
+ "dependencies": {
+ "@sigstore/bundle": "^1.1.0",
+ "@sigstore/protobuf-specs": "^0.2.0",
+ "make-fetch-happen": "^11.0.1"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@sigstore/tuf": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@sigstore/tuf/-/tuf-1.0.3.tgz",
+ "integrity": "sha512-2bRovzs0nJZFlCN3rXirE4gwxCn97JNjMmwpecqlbgV9WcxX7WRuIrgzx/X7Ib7MYRbyUTpBYE0s2x6AmZXnlg==",
+ "dev": true,
+ "dependencies": {
+ "@sigstore/protobuf-specs": "^0.2.0",
+ "tuf-js": "^1.1.7"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@simov/deep-extend": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@simov/deep-extend/-/deep-extend-1.0.0.tgz",
+ "integrity": "sha512-Arv8/ZPcdKAMJnNF8cks35mPq1y3JnwH1lWpfWDKlJoj+Vw2xmA4+oL7m9GVHTgdX0mGFR7bCPTBTGbxhnfJJw==",
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/@sinclair/typebox": {
+ "version": "0.27.8",
+ "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",
+ "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==",
+ "dev": true
+ },
+ "node_modules/@sindresorhus/is": {
+ "version": "0.14.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",
+ "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@sindresorhus/slugify": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-1.1.0.tgz",
+ "integrity": "sha512-ujZRbmmizX26yS/HnB3P9QNlNa4+UvHh+rIse3RbOXLp8yl6n1TxB4t7NHggtVgS8QmmOtzXo48kCxZGACpkPw==",
+ "dependencies": {
+ "@sindresorhus/transliterate": "^0.1.1",
+ "escape-string-regexp": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@sindresorhus/transliterate": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/transliterate/-/transliterate-0.1.2.tgz",
+ "integrity": "sha512-5/kmIOY9FF32nicXH+5yLNTX4NJ4atl7jRgqAJuIn/iyDFXBktOKDxCvyGE/EzmF4ngSUvjXxQUQlQiZ5lfw+w==",
+ "dependencies": {
+ "escape-string-regexp": "^2.0.0",
+ "lodash.deburr": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@sindresorhus/transliterate/node_modules/escape-string-regexp": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
+ "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@sinonjs/commons": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz",
+ "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==",
+ "dev": true,
+ "dependencies": {
+ "type-detect": "4.0.8"
+ }
+ },
+ "node_modules/@sinonjs/fake-timers": {
+ "version": "10.3.0",
+ "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz",
+ "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==",
+ "dev": true,
+ "dependencies": {
+ "@sinonjs/commons": "^3.0.0"
+ }
+ },
+ "node_modules/@smithy/abort-controller": {
+ "version": "2.0.9",
+ "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-2.0.9.tgz",
+ "integrity": "sha512-8liHOEbx99xcy4VndeQNQhyA0LS+e7UqsuRnDTSIA26IKBv/7vA9w09KOd4fgNULrvX0r3WpA6cwsQTRJpSWkg==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/config-resolver": {
+ "version": "2.0.10",
+ "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-2.0.10.tgz",
+ "integrity": "sha512-MwToDsCltHjumkCuRn883qoNeJUawc2b8sX9caSn5vLz6J5crU1IklklNxWCaMO2z2nDL91Po4b/aI1eHv5PfA==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/node-config-provider": "^2.0.12",
+ "@smithy/types": "^2.3.3",
+ "@smithy/util-config-provider": "^2.0.0",
+ "@smithy/util-middleware": "^2.0.2",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/credential-provider-imds": {
+ "version": "2.0.12",
+ "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-2.0.12.tgz",
+ "integrity": "sha512-S3lUNe+2fEFwKcmiQniXGPXt69vaHvQCw8kYQOBL4OvJsgwfpkIYDZdroHbTshYi0M6WaKL26Mw+hvgma6dZqA==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/node-config-provider": "^2.0.12",
+ "@smithy/property-provider": "^2.0.10",
+ "@smithy/types": "^2.3.3",
+ "@smithy/url-parser": "^2.0.9",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/eventstream-codec": {
+ "version": "2.0.9",
+ "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-2.0.9.tgz",
+ "integrity": "sha512-sy0pcbKnawt1iu+qCoSFbs/h9PAaUgvlJEO3lqkE1HFFj4p5RgL98vH+9CyDoj6YY82cG5XsorFmcLqQJHTOYw==",
+ "optional": true,
+ "dependencies": {
+ "@aws-crypto/crc32": "3.0.0",
+ "@smithy/types": "^2.3.3",
+ "@smithy/util-hex-encoding": "^2.0.0",
+ "tslib": "^2.5.0"
+ }
+ },
+ "node_modules/@smithy/fetch-http-handler": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-2.1.5.tgz",
+ "integrity": "sha512-BIeCHGfr5JCGN+EMTwZK74ELvjPXOIrI7OLM5OhZJJ6AmZyRv2S9ANJk18AtLwht0TsSm+8WoXIEp8LuxNgUyA==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/protocol-http": "^3.0.5",
+ "@smithy/querystring-builder": "^2.0.9",
+ "@smithy/types": "^2.3.3",
+ "@smithy/util-base64": "^2.0.0",
+ "tslib": "^2.5.0"
+ }
+ },
+ "node_modules/@smithy/hash-node": {
+ "version": "2.0.9",
+ "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-2.0.9.tgz",
+ "integrity": "sha512-XP3yWd5wyCtiVmsY5Nuq/FUwyCEQ6YG7DsvRh7ThldNukGpCzyFdP8eivZJVjn4Fx7oYrrOnVoYZ0WEgpW1AvQ==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/types": "^2.3.3",
+ "@smithy/util-buffer-from": "^2.0.0",
+ "@smithy/util-utf8": "^2.0.0",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/invalid-dependency": {
+ "version": "2.0.9",
+ "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-2.0.9.tgz",
+ "integrity": "sha512-RuJqhYf8nViK96IIO9JbTtjDUuFItVfuuJhWw2yk7fv67yltQ7fZD6IQ2OsHHluoVmstnQJuCg5raXJR696Ubw==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ }
+ },
+ "node_modules/@smithy/is-array-buffer": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.0.0.tgz",
+ "integrity": "sha512-z3PjFjMyZNI98JFRJi/U0nGoLWMSJlDjAW4QUX2WNZLas5C0CmVV6LJ01JI0k90l7FvpmixjWxPFmENSClQ7ug==",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/middleware-content-length": {
+ "version": "2.0.11",
+ "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-2.0.11.tgz",
+ "integrity": "sha512-Malj4voNTL4+a5ZL3a6+Ij7JTUMTa2R7c3ZIBzMxN5OUUgAspU7uFi1Q97f4B0afVh2joQBAWH5IQJUG25nl8g==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/protocol-http": "^3.0.5",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/middleware-endpoint": {
+ "version": "2.0.9",
+ "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-2.0.9.tgz",
+ "integrity": "sha512-72/o8R6AAO4+nyTI6h4z6PYGTSA4dr1M7tZz29U8DEUHuh1YkhC77js0P6RyF9G0wDLuYqxb+Yh0crI5WG2pJg==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/middleware-serde": "^2.0.9",
+ "@smithy/types": "^2.3.3",
+ "@smithy/url-parser": "^2.0.9",
+ "@smithy/util-middleware": "^2.0.2",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/middleware-retry": {
+ "version": "2.0.12",
+ "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-2.0.12.tgz",
+ "integrity": "sha512-YQ/ufXX4/d9/+Jf1QQ4J+CVeupC7BW52qldBTvRV33PDX9vxndlAwkFwzBcmnUFC3Hjf1//HW6I77EItcjNSCA==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/node-config-provider": "^2.0.12",
+ "@smithy/protocol-http": "^3.0.5",
+ "@smithy/service-error-classification": "^2.0.2",
+ "@smithy/types": "^2.3.3",
+ "@smithy/util-middleware": "^2.0.2",
+ "@smithy/util-retry": "^2.0.2",
+ "tslib": "^2.5.0",
+ "uuid": "^8.3.2"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/middleware-serde": {
+ "version": "2.0.9",
+ "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-2.0.9.tgz",
+ "integrity": "sha512-GVbauxrr6WmtCaesakktg3t5LR/yDbajpC7KkWc8rtCpddMI4ShAVO5Q6DqwX8MDFi4CLaY8H7eTGcxhl3jbLg==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/middleware-stack": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-2.0.3.tgz",
+ "integrity": "sha512-AlhPmbwpkC4lQBVaVHXczmjFvsAhDHhrakqLt038qFLotnJcvDLhmMzAtu23alBeOSkKxkTQq0LsAt2N0WpAbw==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/node-config-provider": {
+ "version": "2.0.12",
+ "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-2.0.12.tgz",
+ "integrity": "sha512-df9y9ywv+JmS40Y60ZqJ4jfZiTCmyHQffwzIqjBjLJLJl0imf9F6DWBd+jiEWHvlohR+sFhyY+KL/qzKgnAq1A==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/property-provider": "^2.0.10",
+ "@smithy/shared-ini-file-loader": "^2.0.11",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/node-http-handler": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-2.1.5.tgz",
+ "integrity": "sha512-52uF+BrZaFiBh+NT/bADiVDCQO91T+OwDRsuaAeWZC1mlCXFjAPPQdxeQohtuYOe9m7mPP/xIMNiqbe8jvndHA==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/abort-controller": "^2.0.9",
+ "@smithy/protocol-http": "^3.0.5",
+ "@smithy/querystring-builder": "^2.0.9",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/property-provider": {
+ "version": "2.0.10",
+ "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-2.0.10.tgz",
+ "integrity": "sha512-YMBVfh0ZMmJtbsUn+WfSwR32iRljZPdRN0Tn2GAcdJ+ejX8WrBXD7Z0jIkQDrQZr8fEuuv5x8WxMIj+qVbsPQw==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/protocol-http": {
+ "version": "3.0.5",
+ "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-3.0.5.tgz",
+ "integrity": "sha512-3t3fxj+ip4EPHRC2fQ0JimMxR/qCQ1LSQJjZZVZFgROnFLYWPDgUZqpoi7chr+EzatxJVXF/Rtoi5yLHOWCoZQ==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/querystring-builder": {
+ "version": "2.0.9",
+ "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-2.0.9.tgz",
+ "integrity": "sha512-Yt6CPF4j3j1cuwod/DRflbuXxBFjJm7gAjy6W1RE21Rz5/kfGFqiZBXWmmXwGtnnhiLThYwoHK4S6/TQtnx0Fg==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/types": "^2.3.3",
+ "@smithy/util-uri-escape": "^2.0.0",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/querystring-parser": {
+ "version": "2.0.9",
+ "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-2.0.9.tgz",
+ "integrity": "sha512-U6z4N743s4vrcxPW8p8+reLV0PjMCYEyb1/wtMVvv3VnbJ74gshdI8SR1sBnEh95cF8TxonmX5IxY25tS9qGfg==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/service-error-classification": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-2.0.2.tgz",
+ "integrity": "sha512-GTUd2j63gKy7A+ggvSdn2hc4sejG7LWfE+ZMF17vzWoNyqERWbRP7HTPS0d0Lwg1p6OQCAzvNigSrEIWVFt6iA==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/types": "^2.3.3"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/shared-ini-file-loader": {
+ "version": "2.0.11",
+ "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-2.0.11.tgz",
+ "integrity": "sha512-Sf0u5C5px6eykXi6jImDTp+edvG3REtPjXnFWU/J+b7S2wkXwUqFXqBL5DdM4zC1F+M8u57ZT7NRqDwMOw7/Tw==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/signature-v4": {
+ "version": "2.0.9",
+ "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-2.0.9.tgz",
+ "integrity": "sha512-RkHP0joSI1j2EI+mU55sOi33/aMMkKdL9ZY+SWrPxsiCe1oyzzuy79Tpn8X7uT+t0ilNmQlwPpkP/jUy940pEA==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/eventstream-codec": "^2.0.9",
+ "@smithy/is-array-buffer": "^2.0.0",
+ "@smithy/types": "^2.3.3",
+ "@smithy/util-hex-encoding": "^2.0.0",
+ "@smithy/util-middleware": "^2.0.2",
+ "@smithy/util-uri-escape": "^2.0.0",
+ "@smithy/util-utf8": "^2.0.0",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/smithy-client": {
+ "version": "2.1.7",
+ "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-2.1.7.tgz",
+ "integrity": "sha512-r6T/oiBQ8vCbGqObH4/h0YqD0jFB1hAS9KFRmuTfaNJueu/L2hjmjqFjv3PV5lkbNHTgUYraSv4cFQ1naxiELQ==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/middleware-stack": "^2.0.3",
+ "@smithy/types": "^2.3.3",
+ "@smithy/util-stream": "^2.0.12",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/types": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/@smithy/types/-/types-2.3.3.tgz",
+ "integrity": "sha512-zTdIPR9PvFVNRdIKMQu4M5oyTaycIbUqLheQqaOi9rTWPkgjGO2wDBxMA1rBHQB81aqAEv+DbSS4jfKyQMnXRA==",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/url-parser": {
+ "version": "2.0.9",
+ "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-2.0.9.tgz",
+ "integrity": "sha512-NBnJ0NiY8z6E82Xd5VYUFQfKwK/wA/+QkKmpYUYP+cpH3aCzE6g2gvixd9vQKYjsIdRfNPCf+SFAozt8ljozOw==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/querystring-parser": "^2.0.9",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ }
+ },
+ "node_modules/@smithy/util-base64": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-2.0.0.tgz",
+ "integrity": "sha512-Zb1E4xx+m5Lud8bbeYi5FkcMJMnn+1WUnJF3qD7rAdXpaL7UjkFQLdmW5fHadoKbdHpwH9vSR8EyTJFHJs++tA==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/util-buffer-from": "^2.0.0",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/util-body-length-browser": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-2.0.0.tgz",
+ "integrity": "sha512-JdDuS4ircJt+FDnaQj88TzZY3+njZ6O+D3uakS32f2VNnDo3vyEuNdBOh/oFd8Df1zSZOuH1HEChk2AOYDezZg==",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.5.0"
+ }
+ },
+ "node_modules/@smithy/util-body-length-node": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-2.1.0.tgz",
+ "integrity": "sha512-/li0/kj/y3fQ3vyzn36NTLGmUwAICb7Jbe/CsWCktW363gh1MOcpEcSO3mJ344Gv2dqz8YJCLQpb6hju/0qOWw==",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/util-buffer-from": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.0.0.tgz",
+ "integrity": "sha512-/YNnLoHsR+4W4Vf2wL5lGv0ksg8Bmk3GEGxn2vEQt52AQaPSCuaO5PM5VM7lP1K9qHRKHwrPGktqVoAHKWHxzw==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/is-array-buffer": "^2.0.0",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/util-config-provider": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-2.0.0.tgz",
+ "integrity": "sha512-xCQ6UapcIWKxXHEU4Mcs2s7LcFQRiU3XEluM2WcCjjBtQkUN71Tb+ydGmJFPxMUrW/GWMgQEEGipLym4XG0jZg==",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/util-defaults-mode-browser": {
+ "version": "2.0.11",
+ "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-2.0.11.tgz",
+ "integrity": "sha512-0syV1Mz/mCQ7CG/MHKQfH+w86xq59jpD0EOXv5oe0WBXLmq2lWPpVHl2Y6+jQ+/9fYzyZ5NF+NC/WEIuiv690A==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/property-provider": "^2.0.10",
+ "@smithy/smithy-client": "^2.1.7",
+ "@smithy/types": "^2.3.3",
+ "bowser": "^2.11.0",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
+ "node_modules/@smithy/util-defaults-mode-node": {
+ "version": "2.0.13",
+ "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-2.0.13.tgz",
+ "integrity": "sha512-6BtCHYdw5Z8r6KpW8tRCc3yURgvcQwfIEeHhR70BeSOfx8T/TXPPjb8A+K45+KASspa3fzrsSxeIwB0sAeMoHA==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/config-resolver": "^2.0.10",
+ "@smithy/credential-provider-imds": "^2.0.12",
+ "@smithy/node-config-provider": "^2.0.12",
+ "@smithy/property-provider": "^2.0.10",
+ "@smithy/smithy-client": "^2.1.7",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
+ "node_modules/@smithy/util-hex-encoding": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-2.0.0.tgz",
+ "integrity": "sha512-c5xY+NUnFqG6d7HFh1IFfrm3mGl29lC+vF+geHv4ToiuJCBmIfzx6IeHLg+OgRdPFKDXIw6pvi+p3CsscaMcMA==",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/util-middleware": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-2.0.2.tgz",
+ "integrity": "sha512-UGPZM+Ja/vke5pc/S8G0LNiHpVirtjppsXO+GK9m9wbzRGzPJTfnZA/gERUUN/AfxEy/8SL7U1kd7u4t2X8K1w==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/util-retry": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-2.0.2.tgz",
+ "integrity": "sha512-ovWiayUB38moZcLhSFFfUgB2IMb7R1JfojU20qSahjxAgfOZvDWme3eOYUMtAVnouZ9kYJiFgHLy27qRH4NeeA==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/service-error-classification": "^2.0.2",
+ "@smithy/types": "^2.3.3",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">= 14.0.0"
+ }
+ },
+ "node_modules/@smithy/util-stream": {
+ "version": "2.0.12",
+ "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-2.0.12.tgz",
+ "integrity": "sha512-FOCpRLaj6gvSyUC5mJAACT+sPMPmp9sD1o+hVbUH/QxwZfulypA3ZIFdAg/59/IY0d/1Q4CTztsiHEB5LgjN4g==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/fetch-http-handler": "^2.1.5",
+ "@smithy/node-http-handler": "^2.1.5",
+ "@smithy/types": "^2.3.3",
+ "@smithy/util-base64": "^2.0.0",
+ "@smithy/util-buffer-from": "^2.0.0",
+ "@smithy/util-hex-encoding": "^2.0.0",
+ "@smithy/util-utf8": "^2.0.0",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/util-uri-escape": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-2.0.0.tgz",
+ "integrity": "sha512-ebkxsqinSdEooQduuk9CbKcI+wheijxEb3utGXkCoYQkJnwTnLbH1JXGimJtUkQwNQbsbuYwG2+aFVyZf5TLaw==",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@smithy/util-utf8": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.0.0.tgz",
+ "integrity": "sha512-rctU1VkziY84n5OXe3bPNpKR001ZCME2JCaBBFgtiM2hfKbHFudc/BkMuPab8hRbLd0j3vbnBTTZ1igBf0wgiQ==",
+ "optional": true,
+ "dependencies": {
+ "@smithy/util-buffer-from": "^2.0.0",
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@strapi/admin": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/admin/-/admin-4.13.7.tgz",
+ "integrity": "sha512-ihe9n7CNGrdnNyAwq+yRSMKC0yEclKISeFsgNl2fdKcShUAPPg0Ac4YGDDXHYqka+RKUe2/MqKXf6lDR51s5Ww==",
+ "dependencies": {
+ "@casl/ability": "^5.4.3",
+ "@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
+ "@strapi/data-transfer": "4.13.7",
+ "@strapi/design-system": "1.10.1",
+ "@strapi/helper-plugin": "4.13.7",
+ "@strapi/icons": "1.10.1",
+ "@strapi/permissions": "4.13.7",
+ "@strapi/provider-audit-logs-local": "4.13.7",
+ "@strapi/typescript-utils": "4.13.7",
+ "@strapi/utils": "4.13.7",
+ "axios": "1.5.0",
+ "bcryptjs": "2.4.3",
+ "browserslist": "^4.17.3",
+ "browserslist-to-esbuild": "1.2.0",
+ "chalk": "^4.1.2",
+ "chokidar": "3.5.3",
+ "codemirror5": "npm:codemirror@^5.65.11",
+ "cross-env": "^7.0.3",
+ "css-loader": "^6.8.1",
+ "date-fns": "2.30.0",
+ "dotenv": "14.2.0",
+ "esbuild-loader": "^2.21.0",
+ "execa": "5.1.1",
+ "fast-deep-equal": "3.1.3",
+ "find-root": "1.1.0",
+ "fork-ts-checker-webpack-plugin": "7.3.0",
+ "formik": "2.4.0",
+ "fractional-indexing": "3.2.0",
+ "fs-extra": "10.0.0",
+ "highlight.js": "^10.4.1",
+ "history": "^4.9.0",
+ "html-loader": "^4.2.0",
+ "html-webpack-plugin": "5.5.0",
+ "immer": "9.0.19",
+ "invariant": "^2.2.4",
+ "js-cookie": "2.2.1",
+ "jsonwebtoken": "9.0.0",
+ "koa-compose": "4.1.0",
+ "koa-passport": "5.0.0",
+ "koa-static": "5.0.0",
+ "koa2-ratelimit": "^1.1.2",
+ "lodash": "4.17.21",
+ "markdown-it": "^12.3.2",
+ "markdown-it-abbr": "^1.0.4",
+ "markdown-it-container": "^3.0.0",
+ "markdown-it-deflist": "^2.1.0",
+ "markdown-it-emoji": "^2.0.0",
+ "markdown-it-footnote": "^3.0.3",
+ "markdown-it-ins": "^3.0.1",
+ "markdown-it-mark": "^3.0.1",
+ "markdown-it-sub": "^1.0.0",
+ "markdown-it-sup": "1.0.0",
+ "mini-css-extract-plugin": "2.7.2",
+ "node-schedule": "2.1.0",
+ "p-map": "4.0.0",
+ "passport-local": "1.0.0",
+ "pluralize": "8.0.0",
+ "prop-types": "^15.8.1",
+ "qs": "6.11.1",
+ "react": "^18.2.0",
+ "react-dnd": "15.1.2",
+ "react-dnd-html5-backend": "15.1.3",
+ "react-dom": "^18.2.0",
+ "react-error-boundary": "3.1.4",
+ "react-helmet": "^6.1.0",
+ "react-intl": "6.4.1",
+ "react-is": "^18.2.0",
+ "react-query": "3.39.3",
+ "react-redux": "8.1.1",
+ "react-refresh": "0.14.0",
+ "react-router-dom": "5.3.4",
+ "react-select": "5.7.0",
+ "react-window": "1.8.8",
+ "redux": "^4.2.1",
+ "reselect": "4.1.7",
+ "rimraf": "3.0.2",
+ "sanitize-html": "2.11.0",
+ "semver": "7.5.4",
+ "sift": "16.0.1",
+ "style-loader": "3.3.1",
+ "styled-components": "5.3.3",
+ "typescript": "5.2.2",
+ "webpack": "^5.88.1",
+ "webpack-cli": "^5.1.0",
+ "webpack-dev-server": "^4.15.0",
+ "webpackbar": "^5.0.2",
+ "yup": "0.32.9"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ },
+ "peerDependencies": {
+ "@strapi/strapi": "^4.3.4"
+ }
+ },
+ "node_modules/@strapi/admin/node_modules/axios": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz",
+ "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==",
+ "dependencies": {
+ "follow-redirects": "^1.15.0",
+ "form-data": "^4.0.0",
+ "proxy-from-env": "^1.1.0"
+ }
+ },
+ "node_modules/@strapi/admin/node_modules/dotenv": {
+ "version": "14.2.0",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-14.2.0.tgz",
+ "integrity": "sha512-05POuPJyPpO6jqzTNweQFfAyMSD4qa4lvsMOWyTRTdpHKy6nnnN+IYWaXF+lHivhBH/ufDKlR4IWCAN3oPnHuw==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@strapi/admin/node_modules/jsonwebtoken": {
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz",
+ "integrity": "sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==",
+ "dependencies": {
+ "jws": "^3.2.2",
+ "lodash": "^4.17.21",
+ "ms": "^2.1.1",
+ "semver": "^7.3.8"
+ },
+ "engines": {
+ "node": ">=12",
+ "npm": ">=6"
+ }
+ },
+ "node_modules/@strapi/admin/node_modules/jwa": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz",
+ "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==",
+ "dependencies": {
+ "buffer-equal-constant-time": "1.0.1",
+ "ecdsa-sig-formatter": "1.0.11",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/@strapi/admin/node_modules/jws": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
+ "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
+ "dependencies": {
+ "jwa": "^1.4.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/@strapi/admin/node_modules/mini-css-extract-plugin": {
+ "version": "2.7.2",
+ "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.2.tgz",
+ "integrity": "sha512-EdlUizq13o0Pd+uCp+WO/JpkLvHRVGt97RqfeGhXqAcorYo1ypJSpkV+WDT0vY/kmh/p7wRdJNJtuyK540PXDw==",
+ "dependencies": {
+ "schema-utils": "^4.0.0"
+ },
+ "engines": {
+ "node": ">= 12.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "webpack": "^5.0.0"
+ }
+ },
+ "node_modules/@strapi/admin/node_modules/qs": {
+ "version": "6.11.1",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.1.tgz",
+ "integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==",
+ "dependencies": {
+ "side-channel": "^1.0.4"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/@strapi/admin/node_modules/react-is": {
+ "version": "18.2.0",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
+ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
+ },
+ "node_modules/@strapi/admin/node_modules/rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/@strapi/admin/node_modules/typescript": {
+ "version": "5.2.2",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
+ "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/@strapi/data-transfer": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/data-transfer/-/data-transfer-4.13.7.tgz",
+ "integrity": "sha512-uw1vq8h+S0dx0OIG5gk3Zbf932zEVuQOk3pMTvL2wknHwIz4J+/4tvJz2hO/l+56RWOWKoQIeutHU3Om2gcUng==",
+ "dependencies": {
+ "@strapi/logger": "4.13.7",
+ "@strapi/strapi": "4.13.7",
+ "chalk": "4.1.2",
+ "fs-extra": "10.0.0",
+ "lodash": "4.17.21",
+ "semver": "7.5.4",
+ "stream-chain": "2.2.5",
+ "stream-json": "1.8.0",
+ "tar": "6.1.13",
+ "tar-stream": "2.2.0",
+ "ws": "8.13.0"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ },
+ "peerDependencies": {
+ "@strapi/strapi": "^4.13.3"
+ }
+ },
+ "node_modules/@strapi/data-transfer/node_modules/fs-minipass": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
+ "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==",
+ "dependencies": {
+ "minipass": "^3.0.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@strapi/data-transfer/node_modules/fs-minipass/node_modules/minipass": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@strapi/data-transfer/node_modules/minipass": {
+ "version": "4.2.8",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz",
+ "integrity": "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@strapi/data-transfer/node_modules/mkdirp": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
+ "bin": {
+ "mkdirp": "bin/cmd.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@strapi/data-transfer/node_modules/tar": {
+ "version": "6.1.13",
+ "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.13.tgz",
+ "integrity": "sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==",
+ "dependencies": {
+ "chownr": "^2.0.0",
+ "fs-minipass": "^2.0.0",
+ "minipass": "^4.0.0",
+ "minizlib": "^2.1.1",
+ "mkdirp": "^1.0.3",
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@strapi/data-transfer/node_modules/ws": {
+ "version": "8.13.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz",
+ "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@strapi/data-transfer/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
+ },
+ "node_modules/@strapi/database": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/database/-/database-4.13.7.tgz",
+ "integrity": "sha512-gaOtohoLl2Kzz7V2lq/DjgRzYGwcr7MiXV9dhwog3T637jtsuKPTFnd6EJa45KIe69h2Dk2VNDAmUDX4/uhChg==",
+ "dependencies": {
+ "@strapi/utils": "4.13.7",
+ "date-fns": "2.30.0",
+ "debug": "4.3.4",
+ "fs-extra": "10.0.0",
+ "knex": "2.5.0",
+ "lodash": "4.17.21",
+ "semver": "7.5.4",
+ "umzug": "3.2.1"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ }
+ },
+ "node_modules/@strapi/design-system": {
+ "version": "1.10.1",
+ "resolved": "https://registry.npmjs.org/@strapi/design-system/-/design-system-1.10.1.tgz",
+ "integrity": "sha512-fVrqDlcLlnvdMeay6IdamcmPwZtDs/qiAWuf2wl5zEPrZacDekNhX/IUZZj3HBmdkwZlpYg78SPbEeY5bsYl3g==",
+ "dependencies": {
+ "@codemirror/lang-json": "^6.0.1",
+ "@floating-ui/react-dom": "^2.0.2",
+ "@internationalized/date": "^3.4.0",
+ "@internationalized/number": "^3.2.1",
+ "@radix-ui/react-dismissable-layer": "^1.0.4",
+ "@radix-ui/react-dropdown-menu": "^2.0.5",
+ "@radix-ui/react-focus-scope": "1.0.3",
+ "@strapi/ui-primitives": "^1.10.1",
+ "@uiw/react-codemirror": "^4.21.13",
+ "aria-hidden": "^1.2.3",
+ "compute-scroll-into-view": "^3.0.3",
+ "prop-types": "^15.8.1",
+ "react-remove-scroll": "^2.5.6"
+ },
+ "peerDependencies": {
+ "@strapi/icons": "^1.5.0",
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0",
+ "react-router-dom": "^5.2.0",
+ "styled-components": "^5.2.1"
+ }
+ },
+ "node_modules/@strapi/generate-new": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/generate-new/-/generate-new-4.13.7.tgz",
+ "integrity": "sha512-4CVyfb0u7sfBXdyzUfZn0+1sxje0zjlxhGi7Coo/LFS8kmTgqjG0PMAFSoSXEpzM+bP7d+OAFe4hqT7KkJgf1Q==",
+ "dependencies": {
+ "@sentry/node": "6.19.7",
+ "chalk": "^4.1.2",
+ "execa": "5.1.1",
+ "fs-extra": "10.0.0",
+ "inquirer": "8.2.5",
+ "lodash": "4.17.21",
+ "node-fetch": "2.7.0",
+ "node-machine-id": "^1.1.10",
+ "ora": "^5.4.1",
+ "semver": "7.5.4",
+ "tar": "6.1.13"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ }
+ },
+ "node_modules/@strapi/generate-new/node_modules/fs-minipass": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
+ "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==",
+ "dependencies": {
+ "minipass": "^3.0.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@strapi/generate-new/node_modules/fs-minipass/node_modules/minipass": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@strapi/generate-new/node_modules/inquirer": {
+ "version": "8.2.5",
+ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.5.tgz",
+ "integrity": "sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==",
+ "dependencies": {
+ "ansi-escapes": "^4.2.1",
+ "chalk": "^4.1.1",
+ "cli-cursor": "^3.1.0",
+ "cli-width": "^3.0.0",
+ "external-editor": "^3.0.3",
+ "figures": "^3.0.0",
+ "lodash": "^4.17.21",
+ "mute-stream": "0.0.8",
+ "ora": "^5.4.1",
+ "run-async": "^2.4.0",
+ "rxjs": "^7.5.5",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0",
+ "through": "^2.3.6",
+ "wrap-ansi": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/@strapi/generate-new/node_modules/minipass": {
+ "version": "4.2.8",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz",
+ "integrity": "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@strapi/generate-new/node_modules/mkdirp": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
+ "bin": {
+ "mkdirp": "bin/cmd.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@strapi/generate-new/node_modules/tar": {
+ "version": "6.1.13",
+ "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.13.tgz",
+ "integrity": "sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==",
+ "dependencies": {
+ "chownr": "^2.0.0",
+ "fs-minipass": "^2.0.0",
+ "minipass": "^4.0.0",
+ "minizlib": "^2.1.1",
+ "mkdirp": "^1.0.3",
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@strapi/generate-new/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
+ },
+ "node_modules/@strapi/generators": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/generators/-/generators-4.13.7.tgz",
+ "integrity": "sha512-box2Jhsbyo5Q+6NmaAH129g1JySEwMg0XSRfgQmINy1cCarngrHi2JR52QhFbpKwOTF3p4jluRZ6nHjS5H93Lg==",
+ "dependencies": {
+ "@sindresorhus/slugify": "1.1.0",
+ "@strapi/typescript-utils": "4.13.7",
+ "@strapi/utils": "4.13.7",
+ "chalk": "4.1.2",
+ "copyfiles": "2.4.1",
+ "fs-extra": "10.0.0",
+ "node-plop": "0.26.3",
+ "plop": "2.7.6",
+ "pluralize": "8.0.0"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ }
+ },
+ "node_modules/@strapi/helper-plugin": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/helper-plugin/-/helper-plugin-4.13.7.tgz",
+ "integrity": "sha512-El4xRSXp4qf+FNgylWmJ91xWKrdiyd7vU1dN48qRk8jJr5ileGHUDMOJ70ioYUnY/g203w0qVnAPyQug0Yl97Q==",
+ "dependencies": {
+ "axios": "1.5.0",
+ "date-fns": "2.30.0",
+ "formik": "2.4.0",
+ "immer": "9.0.19",
+ "lodash": "4.17.21",
+ "prop-types": "^15.8.1",
+ "qs": "6.11.1",
+ "react-helmet": "6.1.0",
+ "react-intl": "6.4.1",
+ "react-query": "3.39.3",
+ "react-select": "5.7.0"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ },
+ "peerDependencies": {
+ "@strapi/design-system": "1.10.1",
+ "@strapi/icons": "1.10.1",
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0",
+ "react-router-dom": "^5.3.4",
+ "styled-components": "^5.3.3"
+ }
+ },
+ "node_modules/@strapi/helper-plugin/node_modules/axios": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz",
+ "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==",
+ "dependencies": {
+ "follow-redirects": "^1.15.0",
+ "form-data": "^4.0.0",
+ "proxy-from-env": "^1.1.0"
+ }
+ },
+ "node_modules/@strapi/helper-plugin/node_modules/qs": {
+ "version": "6.11.1",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.1.tgz",
+ "integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==",
+ "dependencies": {
+ "side-channel": "^1.0.4"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/@strapi/icons": {
+ "version": "1.10.1",
+ "resolved": "https://registry.npmjs.org/@strapi/icons/-/icons-1.10.1.tgz",
+ "integrity": "sha512-nipvxjSlaFgrXkcJXPDCDP/QrMUyYW6gSIMpr+ZhWE34GiLY0D/FBu3GFbuRzXWp3YwFdnL09OlW0L04KDjIUg==",
+ "peerDependencies": {
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0"
+ }
+ },
+ "node_modules/@strapi/logger": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/logger/-/logger-4.13.7.tgz",
+ "integrity": "sha512-Dkl3NM0Lw6UDwX6WOo/ZG1BywXRi0xzydLZ4cPJtR14kQyURvuAgC3c2ewyyfz1Rcau0B/puG5WB9765tGjLPA==",
+ "dependencies": {
+ "lodash": "4.17.21",
+ "winston": "3.10.0"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ }
+ },
+ "node_modules/@strapi/permissions": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/permissions/-/permissions-4.13.7.tgz",
+ "integrity": "sha512-cziBOjb1sRp9cpTmRKlbT0Zsx5VL9/z0seAso8FmI/eaaNZScldvWi3oEKrz8nWYaLXlk/7OMsYqZGLcuL6+5A==",
+ "dependencies": {
+ "@casl/ability": "5.4.4",
+ "@strapi/utils": "4.13.7",
+ "lodash": "4.17.21",
+ "sift": "16.0.1"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ }
+ },
+ "node_modules/@strapi/plugin-content-manager": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/plugin-content-manager/-/plugin-content-manager-4.13.7.tgz",
+ "integrity": "sha512-Ah3V+WFc0/jWUHUXEOvx8U+qSe8CR1rwg4MCBrmSRJ+D2Jj0Lgzn2s3HlOL95jIVgO9+ugE5NkDYDqAM7oxyIQ==",
+ "dependencies": {
+ "@sindresorhus/slugify": "1.1.0",
+ "@strapi/utils": "4.13.7",
+ "lodash": "4.17.21",
+ "qs": "6.11.1"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ }
+ },
+ "node_modules/@strapi/plugin-content-manager/node_modules/qs": {
+ "version": "6.11.1",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.1.tgz",
+ "integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==",
+ "dependencies": {
+ "side-channel": "^1.0.4"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/@strapi/plugin-content-type-builder": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/plugin-content-type-builder/-/plugin-content-type-builder-4.13.7.tgz",
+ "integrity": "sha512-1vq1MbdsicuzIzUWfm2SyfllQ0OtTcSxx3nfEEMu931s9wQgv5TtAQ5s8Vgudhl9dulszSf2rbTX/ucNKzIS/g==",
+ "dependencies": {
+ "@sindresorhus/slugify": "1.1.0",
+ "@strapi/design-system": "1.10.1",
+ "@strapi/generators": "4.13.7",
+ "@strapi/helper-plugin": "4.13.7",
+ "@strapi/icons": "1.10.1",
+ "@strapi/utils": "4.13.7",
+ "fs-extra": "10.0.0",
+ "immer": "9.0.19",
+ "lodash": "4.17.21",
+ "pluralize": "^8.0.0",
+ "prop-types": "^15.8.1",
+ "qs": "6.11.1",
+ "react-helmet": "^6.1.0",
+ "react-intl": "6.4.1",
+ "react-redux": "8.1.1",
+ "redux": "^4.2.1",
+ "reselect": "4.1.7",
+ "yup": "0.32.9"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ },
+ "peerDependencies": {
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0",
+ "react-router-dom": "5.3.4",
+ "styled-components": "5.3.3"
+ }
+ },
+ "node_modules/@strapi/plugin-content-type-builder/node_modules/qs": {
+ "version": "6.11.1",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.1.tgz",
+ "integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==",
+ "dependencies": {
+ "side-channel": "^1.0.4"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/@strapi/plugin-email": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/plugin-email/-/plugin-email-4.13.7.tgz",
+ "integrity": "sha512-zZymyCBYaFFQ7iwk05yQ+H7ovazKkI4bi/JHDs1SKmthFZv3SpBFU5BaZoBYWL5ZuoG/r+1Z9qwbsb4bU2OK9Q==",
+ "dependencies": {
+ "@strapi/design-system": "1.10.1",
+ "@strapi/icons": "1.10.1",
+ "@strapi/provider-email-sendmail": "4.13.7",
+ "@strapi/utils": "4.13.7",
+ "lodash": "4.17.21",
+ "prop-types": "^15.8.1",
+ "react-intl": "6.4.1",
+ "react-query": "3.39.3",
+ "yup": "0.32.9"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ },
+ "peerDependencies": {
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0",
+ "react-router-dom": "5.3.4",
+ "styled-components": "5.3.3"
+ }
+ },
+ "node_modules/@strapi/plugin-graphql": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/plugin-graphql/-/plugin-graphql-4.13.7.tgz",
+ "integrity": "sha512-gTdNbQYaEII4Eur6fbEKjDxLcMBqUZk9+QG8C9A3Gk8cFQOR6d2S/HZUn43NrNehKAhV5VAZKXyJHeqi5NtYnA==",
+ "dependencies": {
+ "@graphql-tools/schema": "8.5.1",
+ "@graphql-tools/utils": "^8.13.1",
+ "@strapi/design-system": "1.10.1",
+ "@strapi/helper-plugin": "4.13.7",
+ "@strapi/icons": "1.10.1",
+ "@strapi/utils": "4.13.7",
+ "apollo-server-core": "3.12.1",
+ "apollo-server-koa": "3.10.0",
+ "glob": "7.2.3",
+ "graphql": "^15.5.1",
+ "graphql-depth-limit": "^1.1.0",
+ "graphql-playground-middleware-koa": "^1.6.21",
+ "graphql-scalars": "1.22.2",
+ "graphql-upload": "^13.0.0",
+ "koa-compose": "^4.1.0",
+ "lodash": "4.17.21",
+ "nexus": "1.3.0",
+ "pluralize": "^8.0.0"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ },
+ "peerDependencies": {
+ "@strapi/strapi": "^4.0.0",
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0",
+ "react-router-dom": "5.3.4",
+ "styled-components": "5.3.3"
+ }
+ },
+ "node_modules/@strapi/plugin-graphql/node_modules/graphql": {
+ "version": "15.8.0",
+ "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz",
+ "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==",
+ "engines": {
+ "node": ">= 10.x"
+ }
+ },
+ "node_modules/@strapi/plugin-i18n": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/plugin-i18n/-/plugin-i18n-4.13.7.tgz",
+ "integrity": "sha512-Ad+GtvyLSETmAwZ07sUWq31KSJm8RcL3mIl3uCWifz/a8MveOLQqsDvanN9NbCVf3Ig/CUo+WM1iYYMrco6rNQ==",
+ "dependencies": {
+ "@strapi/design-system": "1.10.1",
+ "@strapi/helper-plugin": "4.13.7",
+ "@strapi/icons": "1.10.1",
+ "@strapi/utils": "4.13.7",
+ "formik": "2.4.0",
+ "immer": "9.0.19",
+ "lodash": "4.17.21",
+ "prop-types": "^15.8.1",
+ "qs": "6.11.1",
+ "react-intl": "6.4.1",
+ "react-query": "3.39.3",
+ "react-redux": "8.1.1",
+ "redux": "^4.2.1",
+ "yup": "0.32.9"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ },
+ "peerDependencies": {
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0",
+ "react-router-dom": "5.3.4",
+ "styled-components": "5.3.3"
+ }
+ },
+ "node_modules/@strapi/plugin-i18n/node_modules/qs": {
+ "version": "6.11.1",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.1.tgz",
+ "integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==",
+ "dependencies": {
+ "side-channel": "^1.0.4"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/@strapi/plugin-upload": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/plugin-upload/-/plugin-upload-4.13.7.tgz",
+ "integrity": "sha512-7NdBL5zcVZYHK3uPGR9+ylsjFUXEVEqY7wF/yhYjtlj1gVEwMyfvHY+gmk3Z7nrfohk4eHxLnkwryNu/lPYMmg==",
+ "dependencies": {
+ "@strapi/design-system": "1.10.1",
+ "@strapi/helper-plugin": "4.13.7",
+ "@strapi/icons": "1.10.1",
+ "@strapi/provider-upload-local": "4.13.7",
+ "@strapi/utils": "4.13.7",
+ "axios": "1.5.0",
+ "byte-size": "7.0.1",
+ "cropperjs": "1.6.0",
+ "date-fns": "2.30.0",
+ "formik": "2.4.0",
+ "fs-extra": "10.0.0",
+ "immer": "9.0.19",
+ "koa-range": "0.3.0",
+ "koa-static": "5.0.0",
+ "lodash": "4.17.21",
+ "mime-types": "2.1.35",
+ "prop-types": "^15.8.1",
+ "qs": "6.11.1",
+ "react-dnd": "15.1.2",
+ "react-helmet": "^6.1.0",
+ "react-intl": "6.4.1",
+ "react-query": "3.39.3",
+ "react-redux": "8.1.1",
+ "react-select": "5.7.0",
+ "sharp": "0.32.0",
+ "yup": "0.32.9"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ },
+ "peerDependencies": {
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0",
+ "react-router-dom": "5.3.4",
+ "styled-components": "5.3.3"
+ }
+ },
+ "node_modules/@strapi/plugin-upload/node_modules/axios": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz",
+ "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==",
+ "dependencies": {
+ "follow-redirects": "^1.15.0",
+ "form-data": "^4.0.0",
+ "proxy-from-env": "^1.1.0"
+ }
+ },
+ "node_modules/@strapi/plugin-upload/node_modules/qs": {
+ "version": "6.11.1",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.1.tgz",
+ "integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==",
+ "dependencies": {
+ "side-channel": "^1.0.4"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/@strapi/plugin-users-permissions": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/plugin-users-permissions/-/plugin-users-permissions-4.13.7.tgz",
+ "integrity": "sha512-tglLusPvv/gQ76GTvfgieuw6+vzXx9A8xmfYOmj94i1tl9MDEwJrmQbpGN2rZOtkIZpQL4mHOfMV/E1bWtiyBA==",
+ "dependencies": {
+ "@strapi/design-system": "1.10.1",
+ "@strapi/helper-plugin": "4.13.7",
+ "@strapi/icons": "1.10.1",
+ "@strapi/utils": "4.13.7",
+ "bcryptjs": "2.4.3",
+ "formik": "2.4.0",
+ "grant-koa": "5.4.8",
+ "immer": "9.0.19",
+ "jsonwebtoken": "9.0.0",
+ "jwk-to-pem": "2.0.5",
+ "koa": "2.13.4",
+ "koa2-ratelimit": "^1.1.2",
+ "lodash": "4.17.21",
+ "prop-types": "^15.8.1",
+ "purest": "4.0.2",
+ "react-intl": "6.4.1",
+ "react-query": "3.39.3",
+ "react-redux": "8.1.1",
+ "url-join": "4.0.1",
+ "yup": "0.32.9"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ },
+ "peerDependencies": {
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0",
+ "react-router-dom": "5.3.4",
+ "styled-components": "5.3.3"
+ }
+ },
+ "node_modules/@strapi/plugin-users-permissions/node_modules/http-errors": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
+ "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
+ "dependencies": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@strapi/plugin-users-permissions/node_modules/http-errors/node_modules/depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@strapi/plugin-users-permissions/node_modules/jsonwebtoken": {
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz",
+ "integrity": "sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==",
+ "dependencies": {
+ "jws": "^3.2.2",
+ "lodash": "^4.17.21",
+ "ms": "^2.1.1",
+ "semver": "^7.3.8"
+ },
+ "engines": {
+ "node": ">=12",
+ "npm": ">=6"
+ }
+ },
+ "node_modules/@strapi/plugin-users-permissions/node_modules/jwa": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz",
+ "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==",
+ "dependencies": {
+ "buffer-equal-constant-time": "1.0.1",
+ "ecdsa-sig-formatter": "1.0.11",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/@strapi/plugin-users-permissions/node_modules/jws": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
+ "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
+ "dependencies": {
+ "jwa": "^1.4.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/@strapi/plugin-users-permissions/node_modules/koa": {
+ "version": "2.13.4",
+ "resolved": "https://registry.npmjs.org/koa/-/koa-2.13.4.tgz",
+ "integrity": "sha512-43zkIKubNbnrULWlHdN5h1g3SEKXOEzoAlRsHOTFpnlDu8JlAOZSMJBLULusuXRequboiwJcj5vtYXKB3k7+2g==",
+ "dependencies": {
+ "accepts": "^1.3.5",
+ "cache-content-type": "^1.0.0",
+ "content-disposition": "~0.5.2",
+ "content-type": "^1.0.4",
+ "cookies": "~0.8.0",
+ "debug": "^4.3.2",
+ "delegates": "^1.0.0",
+ "depd": "^2.0.0",
+ "destroy": "^1.0.4",
+ "encodeurl": "^1.0.2",
+ "escape-html": "^1.0.3",
+ "fresh": "~0.5.2",
+ "http-assert": "^1.3.0",
+ "http-errors": "^1.6.3",
+ "is-generator-function": "^1.0.7",
+ "koa-compose": "^4.1.0",
+ "koa-convert": "^2.0.0",
+ "on-finished": "^2.3.0",
+ "only": "~0.0.2",
+ "parseurl": "^1.3.2",
+ "statuses": "^1.5.0",
+ "type-is": "^1.6.16",
+ "vary": "^1.1.2"
+ },
+ "engines": {
+ "node": "^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4"
+ }
+ },
+ "node_modules/@strapi/plugin-users-permissions/node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@strapi/provider-audit-logs-local": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/provider-audit-logs-local/-/provider-audit-logs-local-4.13.7.tgz",
+ "integrity": "sha512-liIn9uQkeQVAo7ki/hSlQOmq36MgPrDOerXpiY1T8qQn2o3gyg8tJ/fqPe8YAcmXsehwOBQYCfOWRlgAyUGKIw==",
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ },
+ "peerDependencies": {
+ "@strapi/strapi": "^4.9.0"
+ }
+ },
+ "node_modules/@strapi/provider-email-sendmail": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/provider-email-sendmail/-/provider-email-sendmail-4.13.7.tgz",
+ "integrity": "sha512-d9ixgBk1kZbMI2BiG9xJYKHDv9G99ktrTyT5kgu+1Rz9fn2QO8co5OCECXF2+RaVZWI+Dv//27a2qDngl6TSlA==",
+ "dependencies": {
+ "@strapi/utils": "4.13.7",
+ "sendmail": "^1.6.1"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ }
+ },
+ "node_modules/@strapi/provider-upload-local": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/provider-upload-local/-/provider-upload-local-4.13.7.tgz",
+ "integrity": "sha512-p+FIHu8NEOW8rj1mmJX3Y4OqRiUB8wjHVecwKBvthsArGhV2EAUbcoFOzPLPKtjr7anR21A2y8oXz+Pw6Ft48g==",
+ "dependencies": {
+ "@strapi/utils": "4.13.7",
+ "fs-extra": "10.0.0"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ }
+ },
+ "node_modules/@strapi/strapi": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/strapi/-/strapi-4.13.7.tgz",
+ "integrity": "sha512-t7HaENDxXJEKg1Lx+9lW5ifWckm5GRAp0tJmHtbzlkgDENpCJJPrcEa8mTiD8JNZrW3JUZV2TeHMTT4znKWleQ==",
+ "hasInstallScript": true,
+ "dependencies": {
+ "@koa/cors": "3.4.3",
+ "@koa/router": "10.1.1",
+ "@strapi/admin": "4.13.7",
+ "@strapi/data-transfer": "4.13.7",
+ "@strapi/database": "4.13.7",
+ "@strapi/generate-new": "4.13.7",
+ "@strapi/generators": "4.13.7",
+ "@strapi/logger": "4.13.7",
+ "@strapi/permissions": "4.13.7",
+ "@strapi/plugin-content-manager": "4.13.7",
+ "@strapi/plugin-content-type-builder": "4.13.7",
+ "@strapi/plugin-email": "4.13.7",
+ "@strapi/plugin-upload": "4.13.7",
+ "@strapi/typescript-utils": "4.13.7",
+ "@strapi/utils": "4.13.7",
+ "@vitejs/plugin-react": "4.0.4",
+ "bcryptjs": "2.4.3",
+ "boxen": "5.1.2",
+ "browserslist-to-esbuild": "1.2.0",
+ "chalk": "4.1.2",
+ "chokidar": "3.5.3",
+ "ci-info": "3.8.0",
+ "cli-table3": "0.6.2",
+ "commander": "8.3.0",
+ "configstore": "5.0.1",
+ "debug": "4.3.4",
+ "delegates": "1.0.0",
+ "dotenv": "14.2.0",
+ "execa": "5.1.1",
+ "fs-extra": "10.0.0",
+ "glob": "7.2.3",
+ "http-errors": "1.8.1",
+ "https-proxy-agent": "5.0.1",
+ "inquirer": "8.2.5",
+ "is-docker": "2.2.1",
+ "koa": "2.13.4",
+ "koa-body": "4.2.0",
+ "koa-compose": "4.1.0",
+ "koa-compress": "5.1.0",
+ "koa-favicon": "2.1.0",
+ "koa-helmet": "7.0.2",
+ "koa-ip": "^2.1.2",
+ "koa-session": "6.4.0",
+ "koa-static": "5.0.0",
+ "lodash": "4.17.21",
+ "mime-types": "2.1.35",
+ "node-fetch": "2.7.0",
+ "node-machine-id": "1.1.12",
+ "node-schedule": "2.1.0",
+ "open": "8.4.0",
+ "ora": "5.4.1",
+ "package-json": "7.0.0",
+ "qs": "6.11.1",
+ "resolve-cwd": "3.0.0",
+ "semver": "7.5.4",
+ "statuses": "2.0.1",
+ "typescript": "5.2.2",
+ "vite": "4.4.9",
+ "yup": "0.32.9"
+ },
+ "bin": {
+ "strapi": "bin/strapi.js"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/@sindresorhus/is": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
+ "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/is?sponsor=1"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/@szmarczak/http-timer": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz",
+ "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==",
+ "dependencies": {
+ "defer-to-connect": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/cacheable-request": {
+ "version": "7.0.4",
+ "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz",
+ "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==",
+ "dependencies": {
+ "clone-response": "^1.0.2",
+ "get-stream": "^5.1.0",
+ "http-cache-semantics": "^4.0.0",
+ "keyv": "^4.0.0",
+ "lowercase-keys": "^2.0.0",
+ "normalize-url": "^6.0.1",
+ "responselike": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/commander": {
+ "version": "8.3.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
+ "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/defer-to-connect": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz",
+ "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/dotenv": {
+ "version": "14.2.0",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-14.2.0.tgz",
+ "integrity": "sha512-05POuPJyPpO6jqzTNweQFfAyMSD4qa4lvsMOWyTRTdpHKy6nnnN+IYWaXF+lHivhBH/ufDKlR4IWCAN3oPnHuw==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/get-stream": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
+ "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
+ "dependencies": {
+ "pump": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/got": {
+ "version": "11.8.6",
+ "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz",
+ "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==",
+ "dependencies": {
+ "@sindresorhus/is": "^4.0.0",
+ "@szmarczak/http-timer": "^4.0.5",
+ "@types/cacheable-request": "^6.0.1",
+ "@types/responselike": "^1.0.0",
+ "cacheable-lookup": "^5.0.3",
+ "cacheable-request": "^7.0.2",
+ "decompress-response": "^6.0.0",
+ "http2-wrapper": "^1.0.0-beta.5.2",
+ "lowercase-keys": "^2.0.0",
+ "p-cancelable": "^2.0.0",
+ "responselike": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10.19.0"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/got?sponsor=1"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/http-errors": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
+ "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
+ "dependencies": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/http-errors/node_modules/depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/http-errors/node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/inquirer": {
+ "version": "8.2.5",
+ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.5.tgz",
+ "integrity": "sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==",
+ "dependencies": {
+ "ansi-escapes": "^4.2.1",
+ "chalk": "^4.1.1",
+ "cli-cursor": "^3.1.0",
+ "cli-width": "^3.0.0",
+ "external-editor": "^3.0.3",
+ "figures": "^3.0.0",
+ "lodash": "^4.17.21",
+ "mute-stream": "0.0.8",
+ "ora": "^5.4.1",
+ "run-async": "^2.4.0",
+ "rxjs": "^7.5.5",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0",
+ "through": "^2.3.6",
+ "wrap-ansi": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/koa": {
+ "version": "2.13.4",
+ "resolved": "https://registry.npmjs.org/koa/-/koa-2.13.4.tgz",
+ "integrity": "sha512-43zkIKubNbnrULWlHdN5h1g3SEKXOEzoAlRsHOTFpnlDu8JlAOZSMJBLULusuXRequboiwJcj5vtYXKB3k7+2g==",
+ "dependencies": {
+ "accepts": "^1.3.5",
+ "cache-content-type": "^1.0.0",
+ "content-disposition": "~0.5.2",
+ "content-type": "^1.0.4",
+ "cookies": "~0.8.0",
+ "debug": "^4.3.2",
+ "delegates": "^1.0.0",
+ "depd": "^2.0.0",
+ "destroy": "^1.0.4",
+ "encodeurl": "^1.0.2",
+ "escape-html": "^1.0.3",
+ "fresh": "~0.5.2",
+ "http-assert": "^1.3.0",
+ "http-errors": "^1.6.3",
+ "is-generator-function": "^1.0.7",
+ "koa-compose": "^4.1.0",
+ "koa-convert": "^2.0.0",
+ "on-finished": "^2.3.0",
+ "only": "~0.0.2",
+ "parseurl": "^1.3.2",
+ "statuses": "^1.5.0",
+ "type-is": "^1.6.16",
+ "vary": "^1.1.2"
+ },
+ "engines": {
+ "node": "^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/koa/node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/lowercase-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz",
+ "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/normalize-url": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz",
+ "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/open": {
+ "version": "8.4.0",
+ "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz",
+ "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==",
+ "dependencies": {
+ "define-lazy-prop": "^2.0.0",
+ "is-docker": "^2.1.1",
+ "is-wsl": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/p-cancelable": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz",
+ "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/package-json": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/package-json/-/package-json-7.0.0.tgz",
+ "integrity": "sha512-CHJqc94AA8YfSLHGQT3DbvSIuE12NLFekpM4n7LRrAd3dOJtA911+4xe9q6nC3/jcKraq7nNS9VxgtT0KC+diA==",
+ "dependencies": {
+ "got": "^11.8.2",
+ "registry-auth-token": "^4.0.0",
+ "registry-url": "^5.0.0",
+ "semver": "^7.3.5"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/qs": {
+ "version": "6.11.1",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.1.tgz",
+ "integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==",
+ "dependencies": {
+ "side-channel": "^1.0.4"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/responselike": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz",
+ "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==",
+ "dependencies": {
+ "lowercase-keys": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/typescript": {
+ "version": "5.2.2",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
+ "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/@strapi/strapi/node_modules/vite": {
+ "version": "4.4.9",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz",
+ "integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==",
+ "dependencies": {
+ "esbuild": "^0.18.10",
+ "postcss": "^8.4.27",
+ "rollup": "^3.27.1"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^14.18.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.2"
+ },
+ "peerDependencies": {
+ "@types/node": ">= 14",
+ "less": "*",
+ "lightningcss": "^1.21.0",
+ "sass": "*",
+ "stylus": "*",
+ "sugarss": "*",
+ "terser": "^5.4.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@strapi/typescript-utils": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/typescript-utils/-/typescript-utils-4.13.7.tgz",
+ "integrity": "sha512-9wm3/cv94zbACgcBw9+ZroVSHaffDBKYNq3BI1yREXViI3biTqjSeDmbdBc9Yf1NbshvAuoh5b1YA38jQgG2qw==",
+ "dependencies": {
+ "chalk": "4.1.2",
+ "cli-table3": "0.6.2",
+ "fs-extra": "10.0.0",
+ "lodash": "4.17.21",
+ "prettier": "2.8.4",
+ "typescript": "5.2.2"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ }
+ },
+ "node_modules/@strapi/typescript-utils/node_modules/prettier": {
+ "version": "2.8.4",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz",
+ "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==",
+ "bin": {
+ "prettier": "bin-prettier.js"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
+ "node_modules/@strapi/typescript-utils/node_modules/typescript": {
+ "version": "5.2.2",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
+ "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/@strapi/ui-primitives": {
+ "version": "1.11.0",
+ "resolved": "https://registry.npmjs.org/@strapi/ui-primitives/-/ui-primitives-1.11.0.tgz",
+ "integrity": "sha512-YqE7BQhOYtfv615ib4SjdSAZg+o+EfpQ1e4UD2cb6r6b56D4fP2/1mDPk82qdEc4L8mzeOG/G6nhy4wMu5TaXw==",
+ "dependencies": {
+ "@radix-ui/number": "^1.0.1",
+ "@radix-ui/primitive": "^1.0.1",
+ "@radix-ui/react-collection": "1.0.3",
+ "@radix-ui/react-compose-refs": "^1.0.1",
+ "@radix-ui/react-context": "^1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-dismissable-layer": "^1.0.4",
+ "@radix-ui/react-focus-guards": "1.0.1",
+ "@radix-ui/react-focus-scope": "1.0.3",
+ "@radix-ui/react-id": "^1.0.1",
+ "@radix-ui/react-popper": "^1.1.2",
+ "@radix-ui/react-portal": "^1.0.3",
+ "@radix-ui/react-primitive": "^1.0.3",
+ "@radix-ui/react-slot": "^1.0.2",
+ "@radix-ui/react-use-callback-ref": "^1.0.1",
+ "@radix-ui/react-use-controllable-state": "^1.0.1",
+ "@radix-ui/react-use-layout-effect": "1.0.1",
+ "@radix-ui/react-use-previous": "^1.0.1",
+ "@radix-ui/react-visually-hidden": "^1.0.3",
+ "aria-hidden": "^1.2.3",
+ "react-remove-scroll": "^2.5.6"
+ },
+ "peerDependencies": {
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0"
+ }
+ },
+ "node_modules/@strapi/utils": {
+ "version": "4.13.7",
+ "resolved": "https://registry.npmjs.org/@strapi/utils/-/utils-4.13.7.tgz",
+ "integrity": "sha512-v1e0408+wYr7WbAxQ1Vdwv117J8GorgAGd9l2y8nhBQIRKpNgFx0Ym93N8YVCtLQPPwHM83TOr/Sc3x99f8jbQ==",
+ "dependencies": {
+ "@sindresorhus/slugify": "1.1.0",
+ "date-fns": "2.30.0",
+ "http-errors": "1.8.1",
+ "lodash": "4.17.21",
+ "p-map": "4.0.0",
+ "yup": "0.32.9"
+ },
+ "engines": {
+ "node": ">=16.0.0 <=20.x.x",
+ "npm": ">=6.0.0"
+ }
+ },
+ "node_modules/@strapi/utils/node_modules/depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@strapi/utils/node_modules/http-errors": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
+ "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
+ "dependencies": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@strapi/utils/node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@swc/helpers": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz",
+ "integrity": "sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==",
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@szmarczak/http-timer": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz",
+ "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==",
+ "dev": true,
+ "dependencies": {
+ "defer-to-connect": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@tootallnate/once": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz",
+ "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==",
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@tsconfig/node10": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz",
+ "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==",
+ "dev": true
+ },
+ "node_modules/@tsconfig/node12": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
+ "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",
+ "dev": true
+ },
+ "node_modules/@tsconfig/node14": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
+ "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",
+ "dev": true
+ },
+ "node_modules/@tsconfig/node16": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz",
+ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==",
+ "dev": true
+ },
+ "node_modules/@tufjs/canonical-json": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-1.0.0.tgz",
+ "integrity": "sha512-QTnf++uxunWvG2z3UFNzAoQPHxnSXOwtaI3iJ+AohhV+5vONuArPjJE7aPXPVXfXJsqrVbZBu9b81AJoSd09IQ==",
+ "dev": true,
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@tufjs/models": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-1.0.4.tgz",
+ "integrity": "sha512-qaGV9ltJP0EO25YfFUPhxRVK0evXFIAGicsVXuRim4Ed9cjPxYhNnNJ49SFmbeLgtxpslIkX317IgpfcHPVj/A==",
+ "dev": true,
+ "dependencies": {
+ "@tufjs/canonical-json": "1.0.0",
+ "minimatch": "^9.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@tufjs/models/node_modules/brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "dev": true,
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/@tufjs/models/node_modules/minimatch": {
+ "version": "9.0.3",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
+ "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
+ "dev": true,
+ "dependencies": {
+ "brace-expansion": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/@types/accepts": {
+ "version": "1.3.5",
+ "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz",
+ "integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/argparse": {
+ "version": "1.0.38",
+ "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz",
+ "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA=="
+ },
+ "node_modules/@types/babel__core": {
+ "version": "7.20.2",
+ "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.2.tgz",
+ "integrity": "sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/parser": "^7.20.7",
+ "@babel/types": "^7.20.7",
+ "@types/babel__generator": "*",
+ "@types/babel__template": "*",
+ "@types/babel__traverse": "*"
+ }
+ },
+ "node_modules/@types/babel__generator": {
+ "version": "7.6.5",
+ "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.5.tgz",
+ "integrity": "sha512-h9yIuWbJKdOPLJTbmSpPzkF67e659PbQDba7ifWm5BJ8xTv+sDmS7rFmywkWOvXedGTivCdeGSIIX8WLcRTz8w==",
+ "dev": true,
+ "dependencies": {
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "node_modules/@types/babel__template": {
+ "version": "7.4.2",
+ "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.2.tgz",
+ "integrity": "sha512-/AVzPICMhMOMYoSx9MoKpGDKdBRsIXMNByh1PXSZoa+v6ZoLa8xxtsT/uLQ/NJm0XVAWl/BvId4MlDeXJaeIZQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/parser": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "node_modules/@types/babel__traverse": {
+ "version": "7.20.2",
+ "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.2.tgz",
+ "integrity": "sha512-ojlGK1Hsfce93J0+kn3H5R73elidKUaZonirN33GSmgTUMpzI/MIFfSpF3haANe3G1bEBS9/9/QEqwTzwqFsKw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/types": "^7.20.7"
+ }
+ },
+ "node_modules/@types/body-parser": {
+ "version": "1.19.3",
+ "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.3.tgz",
+ "integrity": "sha512-oyl4jvAfTGX9Bt6Or4H9ni1Z447/tQuxnZsytsCaExKlmJiU8sFgnIBRzJUpKwB5eWn9HuBYlUlVA74q/yN0eQ==",
+ "dependencies": {
+ "@types/connect": "*",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/bonjour": {
+ "version": "3.5.11",
+ "resolved": "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.11.tgz",
+ "integrity": "sha512-isGhjmBtLIxdHBDl2xGwUzEM8AOyOvWsADWq7rqirdi/ZQoHnLWErHvsThcEzTX8juDRiZtzp2Qkv5bgNh6mAg==",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/cacheable-request": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz",
+ "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==",
+ "dependencies": {
+ "@types/http-cache-semantics": "*",
+ "@types/keyv": "^3.1.4",
+ "@types/node": "*",
+ "@types/responselike": "^1.0.0"
+ }
+ },
+ "node_modules/@types/configstore": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/@types/configstore/-/configstore-2.1.1.tgz",
+ "integrity": "sha512-YY+hm3afkDHeSM2rsFXxeZtu0garnusBWNG1+7MknmDWQHqcH2w21/xOU9arJUi8ch4qyFklidANLCu3ihhVwQ==",
+ "dev": true
+ },
+ "node_modules/@types/connect": {
+ "version": "3.4.36",
+ "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.36.tgz",
+ "integrity": "sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/connect-history-api-fallback": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.1.tgz",
+ "integrity": "sha512-iaQslNbARe8fctL5Lk+DsmgWOM83lM+7FzP0eQUJs1jd3kBE8NWqBTIT2S8SqQOJjxvt2eyIjpOuYeRXq2AdMw==",
+ "dependencies": {
+ "@types/express-serve-static-core": "*",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/content-disposition": {
+ "version": "0.5.6",
+ "resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.6.tgz",
+ "integrity": "sha512-GmShTb4qA9+HMPPaV2+Up8tJafgi38geFi7vL4qAM7k8BwjoelgHZqEUKJZLvughUw22h6vD/wvwN4IUCaWpDA=="
+ },
+ "node_modules/@types/cookies": {
+ "version": "0.7.8",
+ "resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.8.tgz",
+ "integrity": "sha512-y6KhF1GtsLERUpqOV+qZJrjUGzc0GE6UTa0b5Z/LZ7Nm2mKSdCXmS6Kdnl7fctPNnMSouHjxqEWI12/YqQfk5w==",
+ "dependencies": {
+ "@types/connect": "*",
+ "@types/express": "*",
+ "@types/keygrip": "*",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/debug": {
+ "version": "0.0.30",
+ "resolved": "https://registry.npmjs.org/@types/debug/-/debug-0.0.30.tgz",
+ "integrity": "sha512-orGL5LXERPYsLov6CWs3Fh6203+dXzJkR7OnddIr2514Hsecwc8xRpzCapshBbKFImCsvS/mk6+FWiN5LyZJAQ==",
+ "dev": true
+ },
+ "node_modules/@types/eslint": {
+ "version": "8.44.3",
+ "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.3.tgz",
+ "integrity": "sha512-iM/WfkwAhwmPff3wZuPLYiHX18HI24jU8k1ZSH7P8FHwxTjZ2P6CoX2wnF43oprR+YXJM6UUxATkNvyv/JHd+g==",
+ "dependencies": {
+ "@types/estree": "*",
+ "@types/json-schema": "*"
+ }
+ },
+ "node_modules/@types/eslint-scope": {
+ "version": "3.7.5",
+ "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.5.tgz",
+ "integrity": "sha512-JNvhIEyxVW6EoMIFIvj93ZOywYFatlpu9deeH6eSx6PE3WHYvHaQtmHmQeNw7aA81bYGBPPQqdtBm6b1SsQMmA==",
+ "dependencies": {
+ "@types/eslint": "*",
+ "@types/estree": "*"
+ }
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.2.tgz",
+ "integrity": "sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA=="
+ },
+ "node_modules/@types/express": {
+ "version": "4.17.18",
+ "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.18.tgz",
+ "integrity": "sha512-Sxv8BSLLgsBYmcnGdGjjEjqET2U+AKAdCRODmMiq02FgjwuV75Ut85DRpvFjyw/Mk0vgUOliGRU0UUmuuZHByQ==",
+ "dependencies": {
+ "@types/body-parser": "*",
+ "@types/express-serve-static-core": "^4.17.33",
+ "@types/qs": "*",
+ "@types/serve-static": "*"
+ }
+ },
+ "node_modules/@types/express-serve-static-core": {
+ "version": "4.17.37",
+ "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.37.tgz",
+ "integrity": "sha512-ZohaCYTgGFcOP7u6aJOhY9uIZQgZ2vxC2yWoArY+FeDXlqeH66ZVBjgvg+RLVAS/DWNq4Ap9ZXu1+SUQiiWYMg==",
+ "dependencies": {
+ "@types/node": "*",
+ "@types/qs": "*",
+ "@types/range-parser": "*",
+ "@types/send": "*"
+ }
+ },
+ "node_modules/@types/fined": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/@types/fined/-/fined-1.1.3.tgz",
+ "integrity": "sha512-CWYnSRnun3CGbt6taXeVo2lCbuaj4mchVJ4UF/BdU5TSuIn3AmS13pGMwCsBUoehGbhZrBrpNJZSZI5EVilXww=="
+ },
+ "node_modules/@types/formidable": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@types/formidable/-/formidable-1.2.6.tgz",
+ "integrity": "sha512-9xwITWH5ok4MrALa7qnUd3McKrvEn5iUZM5/m0AJjOo/sMPUISzuBK/qAHHMV9t5ShjG4fjr0VEm8J+szAKDWA==",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/get-port": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/@types/get-port/-/get-port-3.2.0.tgz",
+ "integrity": "sha512-TiNg8R1kjDde5Pub9F9vCwZA/BNW9HeXP5b9j7Qucqncy/McfPZ6xze/EyBdXS5FhMIGN6Fx3vg75l5KHy3V1Q==",
+ "dev": true
+ },
+ "node_modules/@types/glob": {
+ "version": "5.0.38",
+ "resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.38.tgz",
+ "integrity": "sha512-rTtf75rwyP9G2qO5yRpYtdJ6aU1QqEhWbtW55qEgquEDa6bXW0s2TWZfDm02GuppjEozOWG/F2UnPq5hAQb+gw==",
+ "dev": true,
+ "dependencies": {
+ "@types/minimatch": "*",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/graceful-fs": {
+ "version": "4.1.7",
+ "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.7.tgz",
+ "integrity": "sha512-MhzcwU8aUygZroVwL2jeYk6JisJrPl/oov/gsgGCue9mkgl9wjGbzReYQClxiUgFDnib9FuHqTndccKeZKxTRw==",
+ "dev": true,
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/hast": {
+ "version": "2.3.6",
+ "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.6.tgz",
+ "integrity": "sha512-47rJE80oqPmFdVDCD7IheXBrVdwuBgsYwoczFvKmwfo2Mzsnt+V9OONsYauFmICb6lQPpCuXYJWejBNs4pDJRg==",
+ "dependencies": {
+ "@types/unist": "^2"
+ }
+ },
+ "node_modules/@types/hoist-non-react-statics": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
+ "integrity": "sha512-YIQtIg4PKr7ZyqNPZObpxfHsHEmuB8dXCxd6qVcGuQVDK2bpsF7bYNnBJ4Nn7giuACZg+WewExgrtAJ3XnA4Xw==",
+ "dependencies": {
+ "@types/react": "*",
+ "hoist-non-react-statics": "^3.3.0"
+ }
+ },
+ "node_modules/@types/html-minifier-terser": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz",
+ "integrity": "sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg=="
+ },
+ "node_modules/@types/http-assert": {
+ "version": "1.5.3",
+ "resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.3.tgz",
+ "integrity": "sha512-FyAOrDuQmBi8/or3ns4rwPno7/9tJTijVW6aQQjK02+kOQ8zmoNg2XJtAuQhvQcy1ASJq38wirX5//9J1EqoUA=="
+ },
+ "node_modules/@types/http-cache-semantics": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.2.tgz",
+ "integrity": "sha512-FD+nQWA2zJjh4L9+pFXqWOi0Hs1ryBCfI+985NjluQ1p8EYtoLvjLOKidXBtZ4/IcxDX4o8/E8qDS3540tNliw=="
+ },
+ "node_modules/@types/http-errors": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.2.tgz",
+ "integrity": "sha512-lPG6KlZs88gef6aD85z3HNkztpj7w2R7HmR3gygjfXCQmsLloWNARFkMuzKiiY8FGdh1XDpgBdrSf4aKDiA7Kg=="
+ },
+ "node_modules/@types/http-proxy": {
+ "version": "1.17.12",
+ "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.12.tgz",
+ "integrity": "sha512-kQtujO08dVtQ2wXAuSFfk9ASy3sug4+ogFR8Kd8UgP8PEuc1/G/8yjYRmp//PcDNJEUKOza/MrQu15bouEUCiw==",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/inquirer": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/@types/inquirer/-/inquirer-6.5.0.tgz",
+ "integrity": "sha512-rjaYQ9b9y/VFGOpqBEXRavc3jh0a+e6evAbI31tMda8VlPaSy0AZJfXsvmIe3wklc7W6C3zCSfleuMXR7NOyXw==",
+ "dependencies": {
+ "@types/through": "*",
+ "rxjs": "^6.4.0"
+ }
+ },
+ "node_modules/@types/inquirer/node_modules/rxjs": {
+ "version": "6.6.7",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
+ "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
+ "dependencies": {
+ "tslib": "^1.9.0"
+ },
+ "engines": {
+ "npm": ">=2.0.0"
+ }
+ },
+ "node_modules/@types/inquirer/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
+ },
+ "node_modules/@types/interpret": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@types/interpret/-/interpret-1.1.1.tgz",
+ "integrity": "sha512-HZ4d0m2Ebl8DmrOdYZHgYyipj/8Ftq1/ssB/oQR7fqfUrwtTP7IW3BDi2V445nhPBLzZjEkApaPVp83moSCXlA==",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/istanbul-lib-coverage": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz",
+ "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==",
+ "dev": true
+ },
+ "node_modules/@types/istanbul-lib-report": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz",
+ "integrity": "sha512-gPQuzaPR5h/djlAv2apEG1HVOyj1IUs7GpfMZixU0/0KXT3pm64ylHuMUI1/Akh+sq/iikxg6Z2j+fcMDXaaTQ==",
+ "dev": true,
+ "dependencies": {
+ "@types/istanbul-lib-coverage": "*"
+ }
+ },
+ "node_modules/@types/istanbul-reports": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.2.tgz",
+ "integrity": "sha512-kv43F9eb3Lhj+lr/Hn6OcLCs/sSM8bt+fIaP11rCYngfV6NVjzWXJ17owQtDQTL9tQ8WSLUrGsSJ6rJz0F1w1A==",
+ "dev": true,
+ "dependencies": {
+ "@types/istanbul-lib-report": "*"
+ }
+ },
+ "node_modules/@types/jest": {
+ "version": "29.5.5",
+ "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.5.tgz",
+ "integrity": "sha512-ebylz2hnsWR9mYvmBFbXJXr+33UPc4+ZdxyDXh5w0FlPBTfCVN3wPL+kuOiQt3xvrK419v7XWeAs+AeOksafXg==",
+ "dev": true,
+ "dependencies": {
+ "expect": "^29.0.0",
+ "pretty-format": "^29.0.0"
+ }
+ },
+ "node_modules/@types/json-schema": {
+ "version": "7.0.13",
+ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.13.tgz",
+ "integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ=="
+ },
+ "node_modules/@types/json5": {
+ "version": "0.0.29",
+ "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
+ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==",
+ "dev": true
+ },
+ "node_modules/@types/keygrip": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.3.tgz",
+ "integrity": "sha512-tfzBBb7OV2PbUfKbG6zRE5UbmtdLVCKT/XT364Z9ny6pXNbd9GnIB6aFYpq2A5lZ6mq9bhXgK6h5MFGNwhMmuQ=="
+ },
+ "node_modules/@types/keyv": {
+ "version": "3.1.4",
+ "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz",
+ "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/koa": {
+ "version": "2.13.9",
+ "resolved": "https://registry.npmjs.org/@types/koa/-/koa-2.13.9.tgz",
+ "integrity": "sha512-tPX3cN1dGrMn+sjCDEiQqXH2AqlPoPd594S/8zxwUm/ZbPsQXKqHPUypr2gjCPhHUc+nDJLduhh5lXI/1olnGQ==",
+ "dependencies": {
+ "@types/accepts": "*",
+ "@types/content-disposition": "*",
+ "@types/cookies": "*",
+ "@types/http-assert": "*",
+ "@types/http-errors": "*",
+ "@types/keygrip": "*",
+ "@types/koa-compose": "*",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/koa__cors": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/@types/koa__cors/-/koa__cors-3.3.1.tgz",
+ "integrity": "sha512-aFGYhTFW7651KhmZZ05VG0QZJre7QxBxDj2LF1lf6GA/wSXEfKVAJxiQQWzRV4ZoMzQIO8vJBXKsUcRuvYK9qw==",
+ "dependencies": {
+ "@types/koa": "*"
+ }
+ },
+ "node_modules/@types/koa-bodyparser": {
+ "version": "4.3.10",
+ "resolved": "https://registry.npmjs.org/@types/koa-bodyparser/-/koa-bodyparser-4.3.10.tgz",
+ "integrity": "sha512-6ae05pjhmrmGhUR8GYD5qr5p9LTEMEGfGXCsK8VaSL+totwigm8+H/7MHW7K4854CMeuwRAubT8qcc/EagaeIA==",
+ "dependencies": {
+ "@types/koa": "*"
+ }
+ },
+ "node_modules/@types/koa-compose": {
+ "version": "3.2.6",
+ "resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.6.tgz",
+ "integrity": "sha512-PHiciWxH3NRyAaxUdEDE1NIZNfvhgtPlsdkjRPazHC6weqt90Jr0uLhIQs+SDwC8HQ/jnA7UQP6xOqGFB7ugWw==",
+ "dependencies": {
+ "@types/koa": "*"
+ }
+ },
+ "node_modules/@types/liftoff": {
+ "version": "2.5.1",
+ "resolved": "https://registry.npmjs.org/@types/liftoff/-/liftoff-2.5.1.tgz",
+ "integrity": "sha512-nB3R6Q9CZcM07JgiTK6ibxqrG1reiHE+UX7em/W1DKwVBxDlfKWOefQjk4jubY5xX+GDxVsWR2KD1SenPby8ow==",
+ "dependencies": {
+ "@types/fined": "*",
+ "@types/interpret": "*",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/lodash": {
+ "version": "4.14.199",
+ "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.199.tgz",
+ "integrity": "sha512-Vrjz5N5Ia4SEzWWgIVwnHNEnb1UE1XMkvY5DGXrAeOGE9imk0hgTHh5GyDjLDJi9OTCn9oo9dXH1uToK1VRfrg=="
+ },
+ "node_modules/@types/lodash.set": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/@types/lodash.set/-/lodash.set-4.3.7.tgz",
+ "integrity": "sha512-bS5Wkg/nrT82YUfkNYPSccFrNZRL+irl7Yt4iM6OTSQ0VZJED2oUIVm15NkNtUAQ8SRhCe+axqERUV6MJgkeEg==",
+ "dev": true,
+ "dependencies": {
+ "@types/lodash": "*"
+ }
+ },
+ "node_modules/@types/long": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz",
+ "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA=="
+ },
+ "node_modules/@types/mdast": {
+ "version": "3.0.13",
+ "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.13.tgz",
+ "integrity": "sha512-HjiGiWedR0DVFkeNljpa6Lv4/IZU1+30VY5d747K7lBudFc3R0Ibr6yJ9lN3BE28VnZyDfLF/VB1Ql1ZIbKrmg==",
+ "dependencies": {
+ "@types/unist": "^2"
+ }
+ },
+ "node_modules/@types/mime": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.3.tgz",
+ "integrity": "sha512-Ys+/St+2VF4+xuY6+kDIXGxbNRO0mesVg0bbxEfB97Od1Vjpjx9KD1qxs64Gcb3CWPirk9Xe+PT4YiiHQ9T+eg=="
+ },
+ "node_modules/@types/minimatch": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz",
+ "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA=="
+ },
+ "node_modules/@types/mkdirp": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-0.5.2.tgz",
+ "integrity": "sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg==",
+ "dev": true,
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/ms": {
+ "version": "0.7.32",
+ "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.32.tgz",
+ "integrity": "sha512-xPSg0jm4mqgEkNhowKgZFBNtwoEwF6gJ4Dhww+GFpm3IgtNseHQZ5IqdNwnquZEoANxyDAKDRAdVo4Z72VvD/g=="
+ },
+ "node_modules/@types/node": {
+ "version": "18.18.0",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.0.tgz",
+ "integrity": "sha512-3xA4X31gHT1F1l38ATDIL9GpRLdwVhnEFC8Uikv5ZLlXATwrCYyPq7ZWHxzxc3J/30SUiwiYT+bQe0/XvKlWbw=="
+ },
+ "node_modules/@types/parse-json": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
+ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
+ },
+ "node_modules/@types/parse5": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/@types/parse5/-/parse5-6.0.3.tgz",
+ "integrity": "sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g=="
+ },
+ "node_modules/@types/pg": {
+ "version": "8.10.3",
+ "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.10.3.tgz",
+ "integrity": "sha512-BACzsw64lCZesclRpZGu55tnqgFAYcrCBP92xLh1KLypZLCOsvJTSTgaoFVTy3lCys/aZTQzfeDxtjwrvdzL2g==",
+ "dev": true,
+ "dependencies": {
+ "@types/node": "*",
+ "pg-protocol": "*",
+ "pg-types": "^4.0.1"
+ }
+ },
+ "node_modules/@types/prop-types": {
+ "version": "15.7.7",
+ "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.7.tgz",
+ "integrity": "sha512-FbtmBWCcSa2J4zL781Zf1p5YUBXQomPEcep9QZCfRfQgTxz3pJWiDFLebohZ9fFntX5ibzOkSsrJ0TEew8cAog=="
+ },
+ "node_modules/@types/qs": {
+ "version": "6.9.8",
+ "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.8.tgz",
+ "integrity": "sha512-u95svzDlTysU5xecFNTgfFG5RUWu1A9P0VzgpcIiGZA9iraHOdSzcxMxQ55DyeRaGCSxQi7LxXDI4rzq/MYfdg=="
+ },
+ "node_modules/@types/range-parser": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.5.tgz",
+ "integrity": "sha512-xrO9OoVPqFuYyR/loIHjnbvvyRZREYKLjxV4+dY6v3FQR3stQ9ZxIGkaclF7YhI9hfjpuTbu14hZEy94qKLtOA=="
+ },
+ "node_modules/@types/react": {
+ "version": "18.2.23",
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.23.tgz",
+ "integrity": "sha512-qHLW6n1q2+7KyBEYnrZpcsAmU/iiCh9WGCKgXvMxx89+TYdJWRjZohVIo9XTcoLhfX3+/hP0Pbulu3bCZQ9PSA==",
+ "dependencies": {
+ "@types/prop-types": "*",
+ "@types/scheduler": "*",
+ "csstype": "^3.0.2"
+ }
+ },
+ "node_modules/@types/react-transition-group": {
+ "version": "4.4.7",
+ "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.7.tgz",
+ "integrity": "sha512-ICCyBl5mvyqYp8Qeq9B5G/fyBSRC0zx3XM3sCC6KkcMsNeAHqXBKkmat4GqdJET5jtYUpZXrxI5flve5qhi2Eg==",
+ "dependencies": {
+ "@types/react": "*"
+ }
+ },
+ "node_modules/@types/responselike": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.1.tgz",
+ "integrity": "sha512-TiGnitEDxj2X0j+98Eqk5lv/Cij8oHd32bU4D/Yw6AOq7vvTk0gSD2GPj0G/HkvhMoVsdlhYF4yqqlyPBTM6Sg==",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/retry": {
+ "version": "0.12.0",
+ "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz",
+ "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA=="
+ },
+ "node_modules/@types/rimraf": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/@types/rimraf/-/rimraf-2.0.5.tgz",
+ "integrity": "sha512-YyP+VfeaqAyFmXoTh3HChxOQMyjByRMsHU7kc5KOJkSlXudhMhQIALbYV7rHh/l8d2lX3VUQzprrcAgWdRuU8g==",
+ "dev": true,
+ "dependencies": {
+ "@types/glob": "*",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/scheduler": {
+ "version": "0.16.4",
+ "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.4.tgz",
+ "integrity": "sha512-2L9ifAGl7wmXwP4v3pN4p2FLhD0O1qsJpvKmNin5VA8+UvNVb447UDaAEV6UdrkA+m/Xs58U1RFps44x6TFsVQ=="
+ },
+ "node_modules/@types/semver": {
+ "version": "7.5.3",
+ "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.3.tgz",
+ "integrity": "sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw==",
+ "dev": true
+ },
+ "node_modules/@types/send": {
+ "version": "0.17.2",
+ "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.2.tgz",
+ "integrity": "sha512-aAG6yRf6r0wQ29bkS+x97BIs64ZLxeE/ARwyS6wrldMm3C1MdKwCcnnEwMC1slI8wuxJOpiUH9MioC0A0i+GJw==",
+ "dependencies": {
+ "@types/mime": "^1",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/serve-index": {
+ "version": "1.9.2",
+ "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.2.tgz",
+ "integrity": "sha512-asaEIoc6J+DbBKXtO7p2shWUpKacZOoMBEGBgPG91P8xhO53ohzHWGCs4ScZo5pQMf5ukQzVT9fhX1WzpHihig==",
+ "dependencies": {
+ "@types/express": "*"
+ }
+ },
+ "node_modules/@types/serve-static": {
+ "version": "1.15.3",
+ "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.3.tgz",
+ "integrity": "sha512-yVRvFsEMrv7s0lGhzrggJjNOSmZCdgCjw9xWrPr/kNNLp6FaDfMC1KaYl3TSJ0c58bECwNBMoQrZJ8hA8E1eFg==",
+ "dependencies": {
+ "@types/http-errors": "*",
+ "@types/mime": "*",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/shimmer": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.0.3.tgz",
+ "integrity": "sha512-F/IjUGnV6pIN7R4ZV4npHJVoNtaLZWvb+2/9gctxjb99wkpI7Ozg8VPogwDiTRyjLwZXAYxjvdg1KS8LTHKdDA=="
+ },
+ "node_modules/@types/sockjs": {
+ "version": "0.3.34",
+ "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.34.tgz",
+ "integrity": "sha512-R+n7qBFnm/6jinlteC9DBL5dGiDGjWAvjo4viUanpnc/dG1y7uDoacXPIQ/PQEg1fI912SMHIa014ZjRpvDw4g==",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/stack-utils": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz",
+ "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==",
+ "dev": true
+ },
+ "node_modules/@types/swagger-ui-dist": {
+ "version": "3.30.2",
+ "resolved": "https://registry.npmjs.org/@types/swagger-ui-dist/-/swagger-ui-dist-3.30.2.tgz",
+ "integrity": "sha512-Wx1swzWAUisf/zTr6eg6H0v/crVw52311aZ1qdM1/qk7pv8kxvYeqzfqtUIl1xAWhIrJu1mHF+D8BfEK4YQuqQ==",
+ "dev": true
+ },
+ "node_modules/@types/tap": {
+ "version": "15.0.9",
+ "resolved": "https://registry.npmjs.org/@types/tap/-/tap-15.0.9.tgz",
+ "integrity": "sha512-ewkqbmoYTsKC333VmdpUvxRl8/tDK2RRzR/BBCAuuFPgEvNp1vxqL2Dh812acDpmaBsgWkYORxy8e/RODrzMPw==",
+ "dev": true,
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/through": {
+ "version": "0.0.31",
+ "resolved": "https://registry.npmjs.org/@types/through/-/through-0.0.31.tgz",
+ "integrity": "sha512-LpKpmb7FGevYgXnBXYs6HWnmiFyVG07Pt1cnbgM1IhEacITTiUaBXXvOR3Y50ksaJWGSfhbEvQFivQEFGCC55w==",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/tmp": {
+ "version": "0.0.33",
+ "resolved": "https://registry.npmjs.org/@types/tmp/-/tmp-0.0.33.tgz",
+ "integrity": "sha512-gVC1InwyVrO326wbBZw+AO3u2vRXz/iRWq9jYhpG4W8LXyIgDv3ZmcLQ5Q4Gs+gFMyqx+viFoFT+l3p61QFCmQ==",
+ "dev": true
+ },
+ "node_modules/@types/triple-beam": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.3.tgz",
+ "integrity": "sha512-6tOUG+nVHn0cJbVp25JFayS5UE6+xlbcNF9Lo9mU7U0zk3zeUShZied4YEQZjy1JBF043FSkdXw8YkUJuVtB5g=="
+ },
+ "node_modules/@types/unist": {
+ "version": "2.0.8",
+ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz",
+ "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw=="
+ },
+ "node_modules/@types/use-sync-external-store": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz",
+ "integrity": "sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA=="
+ },
+ "node_modules/@types/webidl-conversions": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.1.tgz",
+ "integrity": "sha512-8hKOnOan+Uu+NgMaCouhg3cT9x5fFZ92Jwf+uDLXLu/MFRbXxlWwGeQY7KVHkeSft6RvY+tdxklUBuyY9eIEKg=="
+ },
+ "node_modules/@types/whatwg-url": {
+ "version": "8.2.2",
+ "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz",
+ "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==",
+ "dependencies": {
+ "@types/node": "*",
+ "@types/webidl-conversions": "*"
+ }
+ },
+ "node_modules/@types/ws": {
+ "version": "8.5.6",
+ "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.6.tgz",
+ "integrity": "sha512-8B5EO9jLVCy+B58PLHvLDuOD8DRVMgQzq8d55SjLCOn9kqGyqOvy27exVaTio1q1nX5zLu8/6N0n2ThSxOM6tg==",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/yamljs": {
+ "version": "0.2.32",
+ "resolved": "https://registry.npmjs.org/@types/yamljs/-/yamljs-0.2.32.tgz",
+ "integrity": "sha512-KeVUr9iOPxHfzB3kWtwMj2RyMGhgLt5rCLKQ63t5TGgAkn2KDI+NccoPki3jwE5fks+ywbqiDfotYgcQH5mvgg==",
+ "dev": true
+ },
+ "node_modules/@types/yargs": {
+ "version": "17.0.25",
+ "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.25.tgz",
+ "integrity": "sha512-gy7iPgwnzNvxgAEi2bXOHWCVOG6f7xsprVJH4MjlAWeBmJ7vh/Y1kwMtUrs64ztf24zVIRCpr3n/z6gm9QIkgg==",
+ "dev": true,
+ "dependencies": {
+ "@types/yargs-parser": "*"
+ }
+ },
+ "node_modules/@types/yargs-parser": {
+ "version": "21.0.1",
+ "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.1.tgz",
+ "integrity": "sha512-axdPBuLuEJt0c4yI5OZssC19K2Mq1uKdrfZBzuxLvaztgqUtFYZUNw7lETExPYJR9jdEoIg4mb7RQKRQzOkeGQ==",
+ "dev": true
+ },
+ "node_modules/@typescript-eslint/eslint-plugin": {
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz",
+ "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==",
+ "dev": true,
+ "dependencies": {
+ "@eslint-community/regexpp": "^4.4.0",
+ "@typescript-eslint/scope-manager": "5.62.0",
+ "@typescript-eslint/type-utils": "5.62.0",
+ "@typescript-eslint/utils": "5.62.0",
+ "debug": "^4.3.4",
+ "graphemer": "^1.4.0",
+ "ignore": "^5.2.0",
+ "natural-compare-lite": "^1.4.0",
+ "semver": "^7.3.7",
+ "tsutils": "^3.21.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "@typescript-eslint/parser": "^5.0.0",
+ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/parser": {
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz",
+ "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/scope-manager": "5.62.0",
+ "@typescript-eslint/types": "5.62.0",
+ "@typescript-eslint/typescript-estree": "5.62.0",
+ "debug": "^4.3.4"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/scope-manager": {
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz",
+ "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/types": "5.62.0",
+ "@typescript-eslint/visitor-keys": "5.62.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/@typescript-eslint/type-utils": {
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz",
+ "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/typescript-estree": "5.62.0",
+ "@typescript-eslint/utils": "5.62.0",
+ "debug": "^4.3.4",
+ "tsutils": "^3.21.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "*"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/types": {
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz",
+ "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==",
+ "dev": true,
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree": {
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz",
+ "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/types": "5.62.0",
+ "@typescript-eslint/visitor-keys": "5.62.0",
+ "debug": "^4.3.4",
+ "globby": "^11.1.0",
+ "is-glob": "^4.0.3",
+ "semver": "^7.3.7",
+ "tsutils": "^3.21.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/utils": {
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz",
+ "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==",
+ "dev": true,
+ "dependencies": {
+ "@eslint-community/eslint-utils": "^4.2.0",
+ "@types/json-schema": "^7.0.9",
+ "@types/semver": "^7.3.12",
+ "@typescript-eslint/scope-manager": "5.62.0",
+ "@typescript-eslint/types": "5.62.0",
+ "@typescript-eslint/typescript-estree": "5.62.0",
+ "eslint-scope": "^5.1.1",
+ "semver": "^7.3.7"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ }
+ },
+ "node_modules/@typescript-eslint/visitor-keys": {
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz",
+ "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/types": "5.62.0",
+ "eslint-visitor-keys": "^3.3.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/@ucast/core": {
+ "version": "1.10.2",
+ "resolved": "https://registry.npmjs.org/@ucast/core/-/core-1.10.2.tgz",
+ "integrity": "sha512-ons5CwXZ/51wrUPfoduC+cO7AS1/wRb0ybpQJ9RrssossDxVy4t49QxWoWgfBDvVKsz9VXzBk9z0wqTdZ+Cq8g=="
+ },
+ "node_modules/@ucast/js": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/@ucast/js/-/js-3.0.3.tgz",
+ "integrity": "sha512-jBBqt57T5WagkAjqfCIIE5UYVdaXYgGkOFYv2+kjq2AVpZ2RIbwCo/TujJpDlwTVluUI+WpnRpoGU2tSGlEvFQ==",
+ "dependencies": {
+ "@ucast/core": "^1.0.0"
+ }
+ },
+ "node_modules/@ucast/mongo": {
+ "version": "2.4.3",
+ "resolved": "https://registry.npmjs.org/@ucast/mongo/-/mongo-2.4.3.tgz",
+ "integrity": "sha512-XcI8LclrHWP83H+7H2anGCEeDq0n+12FU2mXCTz6/Tva9/9ddK/iacvvhCyW6cijAAOILmt0tWplRyRhVyZLsA==",
+ "dependencies": {
+ "@ucast/core": "^1.4.1"
+ }
+ },
+ "node_modules/@ucast/mongo2js": {
+ "version": "1.3.4",
+ "resolved": "https://registry.npmjs.org/@ucast/mongo2js/-/mongo2js-1.3.4.tgz",
+ "integrity": "sha512-ahazOr1HtelA5AC1KZ9x0UwPMqqimvfmtSm/PRRSeKKeE5G2SCqTgwiNzO7i9jS8zA3dzXpKVPpXMkcYLnyItA==",
+ "dependencies": {
+ "@ucast/core": "^1.6.1",
+ "@ucast/js": "^3.0.0",
+ "@ucast/mongo": "^2.4.0"
+ }
+ },
+ "node_modules/@uiw/codemirror-extensions-basic-setup": {
+ "version": "4.21.18",
+ "resolved": "https://registry.npmjs.org/@uiw/codemirror-extensions-basic-setup/-/codemirror-extensions-basic-setup-4.21.18.tgz",
+ "integrity": "sha512-D/vUMq62VPectfrC+Kyw3mtkmxx1/cotVrVDZER/knicx5tyHaqyt06sOZOezhgeo75WKpmjNaRrUZSoCWnGGQ==",
+ "dependencies": {
+ "@codemirror/autocomplete": "^6.0.0",
+ "@codemirror/commands": "^6.0.0",
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/lint": "^6.0.0",
+ "@codemirror/search": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0"
+ },
+ "peerDependencies": {
+ "@codemirror/autocomplete": ">=6.0.0",
+ "@codemirror/commands": ">=6.0.0",
+ "@codemirror/language": ">=6.0.0",
+ "@codemirror/lint": ">=6.0.0",
+ "@codemirror/search": ">=6.0.0",
+ "@codemirror/state": ">=6.0.0",
+ "@codemirror/view": ">=6.0.0"
+ }
+ },
+ "node_modules/@uiw/react-codemirror": {
+ "version": "4.21.18",
+ "resolved": "https://registry.npmjs.org/@uiw/react-codemirror/-/react-codemirror-4.21.18.tgz",
+ "integrity": "sha512-ZjDMdjH28/eaG2EEqq8+yVnKOrthicu+0UHlCTUa4DHirYfb0RTIcsDXGDBZByvWP9Cglc74PGdS5PuCjEdTgg==",
+ "dependencies": {
+ "@babel/runtime": "^7.18.6",
+ "@codemirror/commands": "^6.1.0",
+ "@codemirror/state": "^6.1.1",
+ "@codemirror/theme-one-dark": "^6.0.0",
+ "@uiw/codemirror-extensions-basic-setup": "4.21.18",
+ "codemirror": "^6.0.0"
+ },
+ "peerDependencies": {
+ "@babel/runtime": ">=7.11.0",
+ "@codemirror/state": ">=6.0.0",
+ "@codemirror/theme-one-dark": ">=6.0.0",
+ "@codemirror/view": ">=6.0.0",
+ "codemirror": ">=6.0.0",
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@vitejs/plugin-basic-ssl": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@vitejs/plugin-basic-ssl/-/plugin-basic-ssl-1.0.1.tgz",
+ "integrity": "sha512-pcub+YbFtFhaGRTo1832FQHQSHvMrlb43974e2eS8EKleR3p1cDdkJFPci1UhwkEf1J9Bz+wKBSzqpKp7nNj2A==",
+ "dev": true,
+ "engines": {
+ "node": ">=14.6.0"
+ },
+ "peerDependencies": {
+ "vite": "^3.0.0 || ^4.0.0"
+ }
+ },
+ "node_modules/@vitejs/plugin-react": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.0.4.tgz",
+ "integrity": "sha512-7wU921ABnNYkETiMaZy7XqpueMnpu5VxvVps13MjmCo+utBdD79sZzrApHawHtVX66cCJQQTXFcjH0y9dSUK8g==",
+ "dependencies": {
+ "@babel/core": "^7.22.9",
+ "@babel/plugin-transform-react-jsx-self": "^7.22.5",
+ "@babel/plugin-transform-react-jsx-source": "^7.22.5",
+ "react-refresh": "^0.14.0"
+ },
+ "engines": {
+ "node": "^14.18.0 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "vite": "^4.2.0"
+ }
+ },
+ "node_modules/@webassemblyjs/ast": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz",
+ "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==",
+ "dependencies": {
+ "@webassemblyjs/helper-numbers": "1.11.6",
+ "@webassemblyjs/helper-wasm-bytecode": "1.11.6"
+ }
+ },
+ "node_modules/@webassemblyjs/floating-point-hex-parser": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz",
+ "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw=="
+ },
+ "node_modules/@webassemblyjs/helper-api-error": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz",
+ "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q=="
+ },
+ "node_modules/@webassemblyjs/helper-buffer": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz",
+ "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA=="
+ },
+ "node_modules/@webassemblyjs/helper-numbers": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz",
+ "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==",
+ "dependencies": {
+ "@webassemblyjs/floating-point-hex-parser": "1.11.6",
+ "@webassemblyjs/helper-api-error": "1.11.6",
+ "@xtuc/long": "4.2.2"
+ }
+ },
+ "node_modules/@webassemblyjs/helper-wasm-bytecode": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz",
+ "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA=="
+ },
+ "node_modules/@webassemblyjs/helper-wasm-section": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz",
+ "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==",
+ "dependencies": {
+ "@webassemblyjs/ast": "1.11.6",
+ "@webassemblyjs/helper-buffer": "1.11.6",
+ "@webassemblyjs/helper-wasm-bytecode": "1.11.6",
+ "@webassemblyjs/wasm-gen": "1.11.6"
+ }
+ },
+ "node_modules/@webassemblyjs/ieee754": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz",
+ "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==",
+ "dependencies": {
+ "@xtuc/ieee754": "^1.2.0"
+ }
+ },
+ "node_modules/@webassemblyjs/leb128": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz",
+ "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==",
+ "dependencies": {
+ "@xtuc/long": "4.2.2"
+ }
+ },
+ "node_modules/@webassemblyjs/utf8": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz",
+ "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA=="
+ },
+ "node_modules/@webassemblyjs/wasm-edit": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz",
+ "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==",
+ "dependencies": {
+ "@webassemblyjs/ast": "1.11.6",
+ "@webassemblyjs/helper-buffer": "1.11.6",
+ "@webassemblyjs/helper-wasm-bytecode": "1.11.6",
+ "@webassemblyjs/helper-wasm-section": "1.11.6",
+ "@webassemblyjs/wasm-gen": "1.11.6",
+ "@webassemblyjs/wasm-opt": "1.11.6",
+ "@webassemblyjs/wasm-parser": "1.11.6",
+ "@webassemblyjs/wast-printer": "1.11.6"
+ }
+ },
+ "node_modules/@webassemblyjs/wasm-gen": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz",
+ "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==",
+ "dependencies": {
+ "@webassemblyjs/ast": "1.11.6",
+ "@webassemblyjs/helper-wasm-bytecode": "1.11.6",
+ "@webassemblyjs/ieee754": "1.11.6",
+ "@webassemblyjs/leb128": "1.11.6",
+ "@webassemblyjs/utf8": "1.11.6"
+ }
+ },
+ "node_modules/@webassemblyjs/wasm-opt": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz",
+ "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==",
+ "dependencies": {
+ "@webassemblyjs/ast": "1.11.6",
+ "@webassemblyjs/helper-buffer": "1.11.6",
+ "@webassemblyjs/wasm-gen": "1.11.6",
+ "@webassemblyjs/wasm-parser": "1.11.6"
+ }
+ },
+ "node_modules/@webassemblyjs/wasm-parser": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz",
+ "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==",
+ "dependencies": {
+ "@webassemblyjs/ast": "1.11.6",
+ "@webassemblyjs/helper-api-error": "1.11.6",
+ "@webassemblyjs/helper-wasm-bytecode": "1.11.6",
+ "@webassemblyjs/ieee754": "1.11.6",
+ "@webassemblyjs/leb128": "1.11.6",
+ "@webassemblyjs/utf8": "1.11.6"
+ }
+ },
+ "node_modules/@webassemblyjs/wast-printer": {
+ "version": "1.11.6",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz",
+ "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==",
+ "dependencies": {
+ "@webassemblyjs/ast": "1.11.6",
+ "@xtuc/long": "4.2.2"
+ }
+ },
+ "node_modules/@webpack-cli/configtest": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz",
+ "integrity": "sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==",
+ "engines": {
+ "node": ">=14.15.0"
+ },
+ "peerDependencies": {
+ "webpack": "5.x.x",
+ "webpack-cli": "5.x.x"
+ }
+ },
+ "node_modules/@webpack-cli/info": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz",
+ "integrity": "sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==",
+ "engines": {
+ "node": ">=14.15.0"
+ },
+ "peerDependencies": {
+ "webpack": "5.x.x",
+ "webpack-cli": "5.x.x"
+ }
+ },
+ "node_modules/@webpack-cli/serve": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz",
+ "integrity": "sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==",
+ "engines": {
+ "node": ">=14.15.0"
+ },
+ "peerDependencies": {
+ "webpack": "5.x.x",
+ "webpack-cli": "5.x.x"
+ },
+ "peerDependenciesMeta": {
+ "webpack-dev-server": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@wessberg/ts-evaluator": {
+ "version": "0.0.27",
+ "resolved": "https://registry.npmjs.org/@wessberg/ts-evaluator/-/ts-evaluator-0.0.27.tgz",
+ "integrity": "sha512-7gOpVm3yYojUp/Yn7F4ZybJRxyqfMNf0LXK5KJiawbPfL0XTsJV+0mgrEDjOIR6Bi0OYk2Cyg4tjFu1r8MCZaA==",
+ "deprecated": "this package has been renamed to ts-evaluator. Please install ts-evaluator instead",
+ "dev": true,
+ "dependencies": {
+ "chalk": "^4.1.0",
+ "jsdom": "^16.4.0",
+ "object-path": "^0.11.5",
+ "tslib": "^2.0.3"
+ },
+ "engines": {
+ "node": ">=10.1.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/wessberg/ts-evaluator?sponsor=1"
+ },
+ "peerDependencies": {
+ "typescript": ">=3.2.x || >= 4.x"
+ }
+ },
+ "node_modules/@wry/context": {
+ "version": "0.7.3",
+ "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.3.tgz",
+ "integrity": "sha512-Nl8WTesHp89RF803Se9X3IiHjdmLBrIvPMaJkl+rKVJAYyPsz1TEUbu89943HpvujtSJgDUx9W4vZw3K1Mr3sA==",
+ "peer": true,
+ "dependencies": {
+ "tslib": "^2.3.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@wry/equality": {
+ "version": "0.5.6",
+ "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.5.6.tgz",
+ "integrity": "sha512-D46sfMTngaYlrH+OspKf8mIJETntFnf6Hsjb0V41jAXJ7Bx2kB8Rv8RCUujuVWYttFtHkUNp7g+FwxNQAr6mXA==",
+ "peer": true,
+ "dependencies": {
+ "tslib": "^2.3.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@wry/trie": {
+ "version": "0.4.3",
+ "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.4.3.tgz",
+ "integrity": "sha512-I6bHwH0fSf6RqQcnnXLJKhkSXG45MFral3GxPaY4uAl0LYDZM+YDVDAiU9bYwjTuysy1S0IeecWtmq1SZA3M1w==",
+ "peer": true,
+ "dependencies": {
+ "tslib": "^2.3.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@xtuc/ieee754": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
+ "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA=="
+ },
+ "node_modules/@xtuc/long": {
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz",
+ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ=="
+ },
+ "node_modules/@yarnpkg/lockfile": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz",
+ "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==",
+ "dev": true
+ },
+ "node_modules/abab": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz",
+ "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==",
+ "dev": true
+ },
+ "node_modules/abbrev": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
+ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
+ "dev": true
+ },
+ "node_modules/abort-controller": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
+ "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
+ "dependencies": {
+ "event-target-shim": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=6.5"
+ }
+ },
+ "node_modules/abstract-logging": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz",
+ "integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA=="
+ },
+ "node_modules/accepts": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
+ "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
+ "dependencies": {
+ "mime-types": "~2.1.34",
+ "negotiator": "0.6.3"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/acorn": {
+ "version": "8.10.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz",
+ "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/acorn-globals": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz",
+ "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==",
+ "dev": true,
+ "dependencies": {
+ "acorn": "^7.1.1",
+ "acorn-walk": "^7.1.1"
+ }
+ },
+ "node_modules/acorn-globals/node_modules/acorn": {
+ "version": "7.4.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
+ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
+ "dev": true,
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/acorn-import-assertions": {
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz",
+ "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==",
+ "peerDependencies": {
+ "acorn": "^8"
+ }
+ },
+ "node_modules/acorn-jsx": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
+ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
+ "dev": true,
+ "peerDependencies": {
+ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ }
+ },
+ "node_modules/acorn-walk": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz",
+ "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/addressparser": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/addressparser/-/addressparser-1.0.1.tgz",
+ "integrity": "sha512-aQX7AISOMM7HFE0iZ3+YnD07oIeJqWGVnJ+ZIKaBZAk03ftmVYVqsGas/rbXKR21n4D/hKCSHypvcyOkds/xzg=="
+ },
+ "node_modules/adjust-sourcemap-loader": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/adjust-sourcemap-loader/-/adjust-sourcemap-loader-4.0.0.tgz",
+ "integrity": "sha512-OXwN5b9pCUXNQHJpwwD2qP40byEmSgzj8B4ydSN0uMNYWiFmJ6x6KwUllMmfk8Rwu/HJDFR7U8ubsWBoN0Xp0A==",
+ "dev": true,
+ "dependencies": {
+ "loader-utils": "^2.0.0",
+ "regex-parser": "^2.2.11"
+ },
+ "engines": {
+ "node": ">=8.9"
+ }
+ },
+ "node_modules/adjust-sourcemap-loader/node_modules/loader-utils": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
+ "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
+ "dev": true,
+ "dependencies": {
+ "big.js": "^5.2.2",
+ "emojis-list": "^3.0.0",
+ "json5": "^2.1.2"
+ },
+ "engines": {
+ "node": ">=8.9.0"
+ }
+ },
+ "node_modules/adm-zip": {
+ "version": "0.5.10",
+ "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.10.tgz",
+ "integrity": "sha512-x0HvcHqVJNTPk/Bw8JbLWlWoo6Wwnsug0fnYYro1HBrjxZ3G7/AZk7Ahv8JwDe1uIcz8eBqvu86FuF1POiG7vQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=6.0"
+ }
+ },
+ "node_modules/agent-base": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
+ "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
+ "dependencies": {
+ "debug": "4"
+ },
+ "engines": {
+ "node": ">= 6.0.0"
+ }
+ },
+ "node_modules/agentkeepalive": {
+ "version": "4.5.0",
+ "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz",
+ "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==",
+ "dev": true,
+ "dependencies": {
+ "humanize-ms": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
+ }
+ },
+ "node_modules/aggregate-error": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",
+ "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==",
+ "dependencies": {
+ "clean-stack": "^2.0.0",
+ "indent-string": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ajv": {
+ "version": "8.12.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz",
+ "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2",
+ "uri-js": "^4.2.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/ajv-draft-04": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz",
+ "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==",
+ "dev": true,
+ "peerDependencies": {
+ "ajv": "^8.5.0"
+ },
+ "peerDependenciesMeta": {
+ "ajv": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/ajv-formats": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz",
+ "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==",
+ "dependencies": {
+ "ajv": "^8.0.0"
+ },
+ "peerDependencies": {
+ "ajv": "^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "ajv": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/ajv-keywords": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz",
+ "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.3"
+ },
+ "peerDependencies": {
+ "ajv": "^8.8.2"
+ }
+ },
+ "node_modules/ansi-align": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz",
+ "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==",
+ "dependencies": {
+ "string-width": "^4.1.0"
+ }
+ },
+ "node_modules/ansi-colors": {
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz",
+ "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/ansi-escapes": {
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz",
+ "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==",
+ "dependencies": {
+ "type-fest": "^0.21.3"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/ansi-html-community": {
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz",
+ "integrity": "sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==",
+ "engines": [
+ "node >= 0.8.0"
+ ],
+ "bin": {
+ "ansi-html": "bin/ansi-html"
+ }
+ },
+ "node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/any-promise": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
+ "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A=="
+ },
+ "node_modules/anymatch": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
+ "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
+ "dependencies": {
+ "normalize-path": "^3.0.0",
+ "picomatch": "^2.0.4"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/api": {
+ "resolved": "packages/api",
+ "link": true
+ },
+ "node_modules/apollo-angular": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/apollo-angular/-/apollo-angular-5.0.2.tgz",
+ "integrity": "sha512-U+ApPHhmdDirO95kovNJKt0Zd8kthOWALWY1t22zCI4LrT7tLZDDs0LJAzFXcvILN3FDkXWOE9R6Sa29jNOCIQ==",
+ "dependencies": {
+ "tslib": "^2.6.2"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@angular/core": "^14.0.0 || ^15.0.0 || ^16.0.0",
+ "@apollo/client": "^3.0.0",
+ "graphql": "^15.0.0 || ^16.0.0",
+ "rxjs": "^6.0.0 || ^7.0.0"
+ }
+ },
+ "node_modules/apollo-datasource": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/apollo-datasource/-/apollo-datasource-3.3.2.tgz",
+ "integrity": "sha512-L5TiS8E2Hn/Yz7SSnWIVbZw0ZfEIXZCa5VUiVxD9P53JvSrf4aStvsFDlGWPvpIdCR+aly2CfoB79B9/JjKFqg==",
+ "deprecated": "The `apollo-datasource` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.",
+ "dependencies": {
+ "@apollo/utils.keyvaluecache": "^1.0.1",
+ "apollo-server-env": "^4.2.1"
+ },
+ "engines": {
+ "node": ">=12.0"
+ }
+ },
+ "node_modules/apollo-reporting-protobuf": {
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/apollo-reporting-protobuf/-/apollo-reporting-protobuf-3.4.0.tgz",
+ "integrity": "sha512-h0u3EbC/9RpihWOmcSsvTW2O6RXVaD/mPEjfrPkxRPTEPWqncsgOoRJw+wih4OqfH3PvTJvoEIf4LwKrUaqWog==",
+ "deprecated": "The `apollo-reporting-protobuf` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/usage-reporting-protobuf` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.",
+ "dependencies": {
+ "@apollo/protobufjs": "1.2.6"
+ }
+ },
+ "node_modules/apollo-reporting-protobuf/node_modules/@apollo/protobufjs": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@apollo/protobufjs/-/protobufjs-1.2.6.tgz",
+ "integrity": "sha512-Wqo1oSHNUj/jxmsVp4iR3I480p6qdqHikn38lKrFhfzcDJ7lwd7Ck7cHRl4JE81tWNArl77xhnG/OkZhxKBYOw==",
+ "hasInstallScript": true,
+ "dependencies": {
+ "@protobufjs/aspromise": "^1.1.2",
+ "@protobufjs/base64": "^1.1.2",
+ "@protobufjs/codegen": "^2.0.4",
+ "@protobufjs/eventemitter": "^1.1.0",
+ "@protobufjs/fetch": "^1.1.0",
+ "@protobufjs/float": "^1.0.2",
+ "@protobufjs/inquire": "^1.1.0",
+ "@protobufjs/path": "^1.1.2",
+ "@protobufjs/pool": "^1.1.0",
+ "@protobufjs/utf8": "^1.1.0",
+ "@types/long": "^4.0.0",
+ "@types/node": "^10.1.0",
+ "long": "^4.0.0"
+ },
+ "bin": {
+ "apollo-pbjs": "bin/pbjs",
+ "apollo-pbts": "bin/pbts"
+ }
+ },
+ "node_modules/apollo-reporting-protobuf/node_modules/@types/node": {
+ "version": "10.17.60",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz",
+ "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw=="
+ },
+ "node_modules/apollo-server-core": {
+ "version": "3.12.1",
+ "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.12.1.tgz",
+ "integrity": "sha512-9SF5WAkkV0FZQ2HVUWI9Jada1U0jg7e8NCN9EklbtvaCeUlOLyXyM+KCWuZ7+dqHxjshbtcwylPHutt3uzoNkw==",
+ "deprecated": "The `apollo-server-core` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.",
+ "dependencies": {
+ "@apollo/utils.keyvaluecache": "^1.0.1",
+ "@apollo/utils.logger": "^1.0.0",
+ "@apollo/utils.usagereporting": "^1.0.0",
+ "@apollographql/apollo-tools": "^0.5.3",
+ "@apollographql/graphql-playground-html": "1.6.29",
+ "@graphql-tools/mock": "^8.1.2",
+ "@graphql-tools/schema": "^8.0.0",
+ "@josephg/resolvable": "^1.0.0",
+ "apollo-datasource": "^3.3.2",
+ "apollo-reporting-protobuf": "^3.4.0",
+ "apollo-server-env": "^4.2.1",
+ "apollo-server-errors": "^3.3.1",
+ "apollo-server-plugin-base": "^3.7.2",
+ "apollo-server-types": "^3.8.0",
+ "async-retry": "^1.2.1",
+ "fast-json-stable-stringify": "^2.1.0",
+ "graphql-tag": "^2.11.0",
+ "loglevel": "^1.6.8",
+ "lru-cache": "^6.0.0",
+ "node-abort-controller": "^3.0.1",
+ "sha.js": "^2.4.11",
+ "uuid": "^9.0.0",
+ "whatwg-mimetype": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=12.0"
+ },
+ "peerDependencies": {
+ "graphql": "^15.3.0 || ^16.0.0"
+ }
+ },
+ "node_modules/apollo-server-core/node_modules/lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/apollo-server-core/node_modules/uuid": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
+ "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",
+ "funding": [
+ "https://github.com/sponsors/broofa",
+ "https://github.com/sponsors/ctavan"
+ ],
+ "bin": {
+ "uuid": "dist/bin/uuid"
+ }
+ },
+ "node_modules/apollo-server-core/node_modules/whatwg-mimetype": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz",
+ "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/apollo-server-core/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
+ },
+ "node_modules/apollo-server-env": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/apollo-server-env/-/apollo-server-env-4.2.1.tgz",
+ "integrity": "sha512-vm/7c7ld+zFMxibzqZ7SSa5tBENc4B0uye9LTfjJwGoQFY5xsUPH5FpO5j0bMUDZ8YYNbrF9SNtzc5Cngcr90g==",
+ "deprecated": "The `apollo-server-env` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/utils.fetcher` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.",
+ "dependencies": {
+ "node-fetch": "^2.6.7"
+ },
+ "engines": {
+ "node": ">=12.0"
+ }
+ },
+ "node_modules/apollo-server-errors": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/apollo-server-errors/-/apollo-server-errors-3.3.1.tgz",
+ "integrity": "sha512-xnZJ5QWs6FixHICXHxUfm+ZWqqxrNuPlQ+kj5m6RtEgIpekOPssH/SD9gf2B4HuWV0QozorrygwZnux8POvyPA==",
+ "deprecated": "The `apollo-server-errors` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.",
+ "engines": {
+ "node": ">=12.0"
+ },
+ "peerDependencies": {
+ "graphql": "^15.3.0 || ^16.0.0"
+ }
+ },
+ "node_modules/apollo-server-koa": {
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/apollo-server-koa/-/apollo-server-koa-3.10.0.tgz",
+ "integrity": "sha512-OHaQRz0vvsALT2q+j4uWnCLRrUl1sM0H6JZvB2PfQwANsjTdwm2Eo6FO5etVByvrU4K1iXD6wBWid0Fjk0/OMQ==",
+ "deprecated": "The `apollo-server-koa` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.",
+ "dependencies": {
+ "@koa/cors": "^3.1.0",
+ "@types/accepts": "^1.3.5",
+ "@types/koa": "^2.11.6",
+ "@types/koa__cors": "^3.0.1",
+ "@types/koa-bodyparser": "^4.3.0",
+ "@types/koa-compose": "^3.2.5",
+ "accepts": "^1.3.7",
+ "apollo-server-core": "^3.10.0",
+ "apollo-server-types": "^3.6.2",
+ "koa-bodyparser": "^4.3.0",
+ "koa-compose": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=12.0"
+ },
+ "peerDependencies": {
+ "graphql": "^15.3.0 || ^16.0.0",
+ "koa": "^2.13.1"
+ }
+ },
+ "node_modules/apollo-server-plugin-base": {
+ "version": "3.7.2",
+ "resolved": "https://registry.npmjs.org/apollo-server-plugin-base/-/apollo-server-plugin-base-3.7.2.tgz",
+ "integrity": "sha512-wE8dwGDvBOGehSsPTRZ8P/33Jan6/PmL0y0aN/1Z5a5GcbFhDaaJCjK5cav6npbbGL2DPKK0r6MPXi3k3N45aw==",
+ "deprecated": "The `apollo-server-plugin-base` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.",
+ "dependencies": {
+ "apollo-server-types": "^3.8.0"
+ },
+ "engines": {
+ "node": ">=12.0"
+ },
+ "peerDependencies": {
+ "graphql": "^15.3.0 || ^16.0.0"
+ }
+ },
+ "node_modules/apollo-server-types": {
+ "version": "3.8.0",
+ "resolved": "https://registry.npmjs.org/apollo-server-types/-/apollo-server-types-3.8.0.tgz",
+ "integrity": "sha512-ZI/8rTE4ww8BHktsVpb91Sdq7Cb71rdSkXELSwdSR0eXu600/sY+1UXhTWdiJvk+Eq5ljqoHLwLbY2+Clq2b9A==",
+ "deprecated": "The `apollo-server-types` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.",
+ "dependencies": {
+ "@apollo/utils.keyvaluecache": "^1.0.1",
+ "@apollo/utils.logger": "^1.0.0",
+ "apollo-reporting-protobuf": "^3.4.0",
+ "apollo-server-env": "^4.2.1"
+ },
+ "engines": {
+ "node": ">=12.0"
+ },
+ "peerDependencies": {
+ "graphql": "^15.3.0 || ^16.0.0"
+ }
+ },
+ "node_modules/append-transform": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz",
+ "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==",
+ "dev": true,
+ "dependencies": {
+ "default-require-extensions": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/application-config-path": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/application-config-path/-/application-config-path-0.1.1.tgz",
+ "integrity": "sha512-zy9cHePtMP0YhwG+CfHm0bgwdnga2X3gZexpdCwEj//dpb+TKajtiC8REEUJUSq6Ab4f9cgNy2l8ObXzCXFkEw==",
+ "dev": true
+ },
+ "node_modules/applicationinsights": {
+ "version": "2.8.0",
+ "resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-2.8.0.tgz",
+ "integrity": "sha512-pxVOdCPwXTal1A904yGmzOOUJrIeQ89xQir0ifr7fLl+e0BlGrZ1P4StcIDuEXk93gV9CGxGm5Mol8ksPk2mcg==",
+ "dependencies": {
+ "@azure/core-auth": "^1.5.0",
+ "@azure/core-rest-pipeline": "1.10.1",
+ "@azure/core-util": "1.2.0",
+ "@azure/opentelemetry-instrumentation-azure-sdk": "^1.0.0-beta.5",
+ "@microsoft/applicationinsights-web-snippet": "^1.0.1",
+ "@opentelemetry/api": "^1.4.1",
+ "@opentelemetry/core": "^1.15.2",
+ "@opentelemetry/sdk-trace-base": "^1.15.2",
+ "@opentelemetry/semantic-conventions": "^1.15.2",
+ "cls-hooked": "^4.2.2",
+ "continuation-local-storage": "^3.2.1",
+ "diagnostic-channel": "1.1.1",
+ "diagnostic-channel-publishers": "1.0.7"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ },
+ "peerDependencies": {
+ "applicationinsights-native-metrics": "*"
+ },
+ "peerDependenciesMeta": {
+ "applicationinsights-native-metrics": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/applicationinsights/node_modules/@azure/core-rest-pipeline": {
+ "version": "1.10.1",
+ "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.10.1.tgz",
+ "integrity": "sha512-Kji9k6TOFRDB5ZMTw8qUf2IJ+CeJtsuMdAHox9eqpTf1cefiNMpzrfnF6sINEBZJsaVaWgQ0o48B6kcUH68niA==",
+ "dependencies": {
+ "@azure/abort-controller": "^1.0.0",
+ "@azure/core-auth": "^1.4.0",
+ "@azure/core-tracing": "^1.0.1",
+ "@azure/core-util": "^1.0.0",
+ "@azure/logger": "^1.0.0",
+ "form-data": "^4.0.0",
+ "http-proxy-agent": "^5.0.0",
+ "https-proxy-agent": "^5.0.0",
+ "tslib": "^2.2.0",
+ "uuid": "^8.3.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/applicationinsights/node_modules/@azure/core-util": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.2.0.tgz",
+ "integrity": "sha512-ffGIw+Qs8bNKNLxz5UPkz4/VBM/EZY07mPve1ZYFqYUdPwFqRj0RPk0U7LZMOfT7GCck9YjuT1Rfp1PApNl1ng==",
+ "dependencies": {
+ "@azure/abort-controller": "^1.0.0",
+ "tslib": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/aproba": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz",
+ "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==",
+ "dev": true
+ },
+ "node_modules/archy": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz",
+ "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw=="
+ },
+ "node_modules/are-we-there-yet": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz",
+ "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==",
+ "dev": true,
+ "dependencies": {
+ "delegates": "^1.0.0",
+ "readable-stream": "^3.6.0"
+ },
+ "engines": {
+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
+ }
+ },
+ "node_modules/arg": {
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
+ "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
+ "dev": true
+ },
+ "node_modules/argparse": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+ "dependencies": {
+ "sprintf-js": "~1.0.2"
+ }
+ },
+ "node_modules/aria-hidden": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.3.tgz",
+ "integrity": "sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==",
+ "dependencies": {
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/aria-query": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
+ "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
+ "dev": true,
+ "dependencies": {
+ "dequal": "^2.0.3"
+ }
+ },
+ "node_modules/arr-diff": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
+ "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/arr-flatten": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
+ "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/arr-union": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
+ "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/array-buffer-byte-length": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz",
+ "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "is-array-buffer": "^3.0.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/array-each": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz",
+ "integrity": "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/array-flatten": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz",
+ "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ=="
+ },
+ "node_modules/array-includes": {
+ "version": "3.1.7",
+ "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz",
+ "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1",
+ "get-intrinsic": "^1.2.1",
+ "is-string": "^1.0.7"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/array-slice": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz",
+ "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/array-union": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
+ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/array-unique": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
+ "integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/array.prototype.findlastindex": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz",
+ "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1",
+ "es-shim-unscopables": "^1.0.0",
+ "get-intrinsic": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/array.prototype.flat": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz",
+ "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1",
+ "es-shim-unscopables": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/array.prototype.flatmap": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz",
+ "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1",
+ "es-shim-unscopables": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/array.prototype.tosorted": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.2.tgz",
+ "integrity": "sha512-HuQCHOlk1Weat5jzStICBCd83NxiIMwqDg/dHEsoefabn/hJRj5pVdWcPUSpRrwhwxZOsQassMpgN/xRYFBMIg==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1",
+ "es-shim-unscopables": "^1.0.0",
+ "get-intrinsic": "^1.2.1"
+ }
+ },
+ "node_modules/arraybuffer.prototype.slice": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz",
+ "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==",
+ "dev": true,
+ "dependencies": {
+ "array-buffer-byte-length": "^1.0.0",
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1",
+ "get-intrinsic": "^1.2.1",
+ "is-array-buffer": "^3.0.2",
+ "is-shared-array-buffer": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/arrify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
+ "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/asn1.js": {
+ "version": "5.4.1",
+ "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz",
+ "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==",
+ "dependencies": {
+ "bn.js": "^4.0.0",
+ "inherits": "^2.0.1",
+ "minimalistic-assert": "^1.0.0",
+ "safer-buffer": "^2.1.0"
+ }
+ },
+ "node_modules/assign-symbols": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
+ "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/ast-types-flow": {
+ "version": "0.0.7",
+ "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz",
+ "integrity": "sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==",
+ "dev": true
+ },
+ "node_modules/async": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz",
+ "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ=="
+ },
+ "node_modules/async-hook-domain": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/async-hook-domain/-/async-hook-domain-2.0.4.tgz",
+ "integrity": "sha512-14LjCmlK1PK8eDtTezR6WX8TMaYNIzBIsd2D1sGoGjgx0BuNMMoSdk7i/drlbtamy0AWv9yv2tkB+ASdmeqFIw==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/async-hook-jl": {
+ "version": "1.7.6",
+ "resolved": "https://registry.npmjs.org/async-hook-jl/-/async-hook-jl-1.7.6.tgz",
+ "integrity": "sha512-gFaHkFfSxTjvoxDMYqDuGHlcRyUuamF8s+ZTtJdDzqjws4mCt7v0vuV79/E2Wr2/riMQgtG4/yUtXWs1gZ7JMg==",
+ "dependencies": {
+ "stack-chain": "^1.3.7"
+ },
+ "engines": {
+ "node": "^4.7 || >=6.9 || >=7.3"
+ }
+ },
+ "node_modules/async-listener": {
+ "version": "0.6.10",
+ "resolved": "https://registry.npmjs.org/async-listener/-/async-listener-0.6.10.tgz",
+ "integrity": "sha512-gpuo6xOyF4D5DE5WvyqZdPA3NGhiT6Qf07l7DCB0wwDEsLvDIbCr6j9S5aj5Ch96dLace5tXVzWBZkxU/c5ohw==",
+ "dependencies": {
+ "semver": "^5.3.0",
+ "shimmer": "^1.1.0"
+ },
+ "engines": {
+ "node": "<=0.11.8 || >0.11.10"
+ }
+ },
+ "node_modules/async-listener/node_modules/semver": {
+ "version": "5.7.2",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
+ "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
+ "bin": {
+ "semver": "bin/semver"
+ }
+ },
+ "node_modules/async-retry": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz",
+ "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==",
+ "dependencies": {
+ "retry": "0.13.1"
+ }
+ },
+ "node_modules/async-retry/node_modules/retry": {
+ "version": "0.13.1",
+ "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz",
+ "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/asynciterator.prototype": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/asynciterator.prototype/-/asynciterator.prototype-1.0.0.tgz",
+ "integrity": "sha512-wwHYEIS0Q80f5mosx3L/dfG5t5rjEa9Ft51GTaNt862EnpyGHpgz2RkZvLPp1oF5TnAiTohkEKVEu8pQPJI7Vg==",
+ "dev": true,
+ "dependencies": {
+ "has-symbols": "^1.0.3"
+ }
+ },
+ "node_modules/asynckit": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
+ },
+ "node_modules/atob": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
+ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==",
+ "bin": {
+ "atob": "bin/atob.js"
+ },
+ "engines": {
+ "node": ">= 4.5.0"
+ }
+ },
+ "node_modules/atomic-sleep": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz",
+ "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==",
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/autoprefixer": {
+ "version": "10.4.14",
+ "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.14.tgz",
+ "integrity": "sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/autoprefixer"
+ }
+ ],
+ "dependencies": {
+ "browserslist": "^4.21.5",
+ "caniuse-lite": "^1.0.30001464",
+ "fraction.js": "^4.2.0",
+ "normalize-range": "^0.1.2",
+ "picocolors": "^1.0.0",
+ "postcss-value-parser": "^4.2.0"
+ },
+ "bin": {
+ "autoprefixer": "bin/autoprefixer"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/available-typed-arrays": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz",
+ "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/avvio": {
+ "version": "8.2.1",
+ "resolved": "https://registry.npmjs.org/avvio/-/avvio-8.2.1.tgz",
+ "integrity": "sha512-TAlMYvOuwGyLK3PfBb5WKBXZmXz2fVCgv23d6zZFdle/q3gPjmxBaeuC0pY0Dzs5PWMSgfqqEZkrye19GlDTgw==",
+ "dependencies": {
+ "archy": "^1.0.0",
+ "debug": "^4.0.0",
+ "fastq": "^1.6.1"
+ }
+ },
+ "node_modules/axe-core": {
+ "version": "4.8.2",
+ "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.8.2.tgz",
+ "integrity": "sha512-/dlp0fxyM3R8YW7MFzaHWXrf4zzbr0vaYb23VBFCl83R7nWNPg/yaQw2Dc8jzCMmDVLhSdzH8MjrsuIUuvX+6g==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/axios": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-0.25.0.tgz",
+ "integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==",
+ "dev": true,
+ "dependencies": {
+ "follow-redirects": "^1.14.7"
+ }
+ },
+ "node_modules/axobject-query": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz",
+ "integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==",
+ "dev": true,
+ "dependencies": {
+ "dequal": "^2.0.3"
+ }
+ },
+ "node_modules/azure-functions-core-tools": {
+ "version": "4.0.5095",
+ "resolved": "https://registry.npmjs.org/azure-functions-core-tools/-/azure-functions-core-tools-4.0.5095.tgz",
+ "integrity": "sha512-BGBzxa03NnOz6hdTRYrBvYwVvKK14emsFCz3oj0buAaE91BiKo4KozzjYNGc9G1tB/cjBr7JU+B21dm+FHVfkA==",
+ "dev": true,
+ "hasInstallScript": true,
+ "hasShrinkwrap": true,
+ "os": [
+ "win32",
+ "darwin",
+ "linux"
+ ],
+ "dependencies": {
+ "chalk": "3.0.0",
+ "https-proxy-agent": "5.0.0",
+ "progress": "2.0.3",
+ "rimraf": "3.0.2",
+ "unzipper": "0.10.10"
+ },
+ "bin": {
+ "azfun": "lib/main.js",
+ "azurefunctions": "lib/main.js",
+ "func": "lib/main.js"
+ },
+ "engines": {
+ "node": ">=6.9.1"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/@types/color-name": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
+ "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/agent-base": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.0.tgz",
+ "integrity": "sha512-j1Q7cSCqN+AwrmDd+pzgqc0/NpC655x2bUf5ZjRIO77DcNBFmh+OgRNzF6OKdCC9RSCb19fGd99+bhXFdkRNqw==",
+ "dev": true,
+ "dependencies": {
+ "debug": "4"
+ },
+ "engines": {
+ "node": ">= 6.0.0"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/ansi-styles": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.0.tgz",
+ "integrity": "sha512-7kFQgnEaMdRtwf6uSfUnVr9gSGC7faurn+J/Mv90/W+iTtN0405/nLdopfMWwchyxhbGYl6TC4Sccn9TUkGAgg==",
+ "dev": true,
+ "dependencies": {
+ "@types/color-name": "^1.1.1",
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/balanced-match": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
+ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/big-integer": {
+ "version": "1.6.48",
+ "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz",
+ "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/binary": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz",
+ "integrity": "sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk=",
+ "dev": true,
+ "dependencies": {
+ "buffers": "~0.1.1",
+ "chainsaw": "~0.1.0"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/bluebird": {
+ "version": "3.4.7",
+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz",
+ "integrity": "sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM=",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "dev": true,
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/buffer-indexof-polyfill": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.1.tgz",
+ "integrity": "sha1-qfuAbOgUXVQoUQznLyeLs2OmOL8=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/buffers": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz",
+ "integrity": "sha1-skV5w77U1tOWru5tmorn9Ugqt7s=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.2.0"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/chainsaw": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz",
+ "integrity": "sha1-XqtQsor+WAdNDVgpE4iCi15fvJg=",
+ "dev": true,
+ "dependencies": {
+ "traverse": ">=0.3.0 <0.4"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/chalk": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
+ "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/core-util-is": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
+ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/debug": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
+ "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
+ "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.1"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/duplexer2": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",
+ "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=",
+ "dev": true,
+ "dependencies": {
+ "readable-stream": "^2.0.2"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/fstream": {
+ "version": "1.0.12",
+ "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",
+ "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==",
+ "dev": true,
+ "dependencies": {
+ "graceful-fs": "^4.1.2",
+ "inherits": "~2.0.0",
+ "mkdirp": ">=0.5 0",
+ "rimraf": "2"
+ },
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/fstream/node_modules/rimraf": {
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
+ "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
+ "dev": true,
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/glob": {
+ "version": "7.1.6",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
+ "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
+ "dev": true,
+ "dependencies": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ },
+ "engines": {
+ "node": "*"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/graceful-fs": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz",
+ "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/https-proxy-agent": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz",
+ "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==",
+ "dev": true,
+ "dependencies": {
+ "agent-base": "6",
+ "debug": "4"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/inflight": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "dev": true,
+ "dependencies": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/listenercount": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz",
+ "integrity": "sha1-hMinKrWcRyUyFIDJdeZQg0LnCTc=",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/minimatch": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "dev": true,
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/minimist": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
+ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/mkdirp": {
+ "version": "0.5.4",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz",
+ "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==",
+ "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)",
+ "dev": true,
+ "dependencies": {
+ "minimist": "^1.2.5"
+ },
+ "bin": {
+ "mkdirp": "bin/cmd.js"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "dev": true,
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/process-nextick-args": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
+ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/progress": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
+ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/readable-stream": {
+ "version": "2.3.7",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+ "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "dev": true,
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dev": true,
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/setimmediate": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
+ "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/string_decoder": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "dev": true,
+ "dependencies": {
+ "safe-buffer": "~5.1.0"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/supports-color": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
+ "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/traverse": {
+ "version": "0.3.9",
+ "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz",
+ "integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=",
+ "dev": true,
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/unzipper": {
+ "version": "0.10.10",
+ "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.10.10.tgz",
+ "integrity": "sha512-wEgtqtrnJ/9zIBsQb8UIxOhAH1eTHfi7D/xvmrUoMEePeI6u24nq1wigazbIFtHt6ANYXdEVTvc8XYNlTurs7A==",
+ "dev": true,
+ "dependencies": {
+ "big-integer": "^1.6.17",
+ "binary": "~0.3.0",
+ "bluebird": "~3.4.1",
+ "buffer-indexof-polyfill": "~1.0.0",
+ "duplexer2": "~0.1.4",
+ "fstream": "^1.0.12",
+ "graceful-fs": "^4.2.2",
+ "listenercount": "~1.0.1",
+ "readable-stream": "~2.3.6",
+ "setimmediate": "~1.0.4"
+ }
+ },
+ "node_modules/azure-functions-core-tools/node_modules/util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
+ "dev": true
+ },
+ "node_modules/azure-functions-core-tools/node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
+ "dev": true
+ },
+ "node_modules/babel-jest": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz",
+ "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==",
+ "dev": true,
+ "dependencies": {
+ "@jest/transform": "^29.7.0",
+ "@types/babel__core": "^7.1.14",
+ "babel-plugin-istanbul": "^6.1.1",
+ "babel-preset-jest": "^29.6.3",
+ "chalk": "^4.0.0",
+ "graceful-fs": "^4.2.9",
+ "slash": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.8.0"
+ }
+ },
+ "node_modules/babel-loader": {
+ "version": "9.1.3",
+ "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-9.1.3.tgz",
+ "integrity": "sha512-xG3ST4DglodGf8qSwv0MdeWLhrDsw/32QMdTO5T1ZIp9gQur0HkCyFs7Awskr10JKXFXwpAhiCuYX5oGXnRGbw==",
+ "dev": true,
+ "dependencies": {
+ "find-cache-dir": "^4.0.0",
+ "schema-utils": "^4.0.0"
+ },
+ "engines": {
+ "node": ">= 14.15.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.12.0",
+ "webpack": ">=5"
+ }
+ },
+ "node_modules/babel-plugin-istanbul": {
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz",
+ "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@istanbuljs/load-nyc-config": "^1.0.0",
+ "@istanbuljs/schema": "^0.1.2",
+ "istanbul-lib-instrument": "^5.0.4",
+ "test-exclude": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/babel-plugin-jest-hoist": {
+ "version": "29.6.3",
+ "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz",
+ "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/template": "^7.3.3",
+ "@babel/types": "^7.3.3",
+ "@types/babel__core": "^7.1.14",
+ "@types/babel__traverse": "^7.0.6"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/babel-plugin-macros": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz",
+ "integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==",
+ "dependencies": {
+ "@babel/runtime": "^7.12.5",
+ "cosmiconfig": "^7.0.0",
+ "resolve": "^1.19.0"
+ },
+ "engines": {
+ "node": ">=10",
+ "npm": ">=6"
+ }
+ },
+ "node_modules/babel-plugin-macros/node_modules/cosmiconfig": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
+ "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
+ "dependencies": {
+ "@types/parse-json": "^4.0.0",
+ "import-fresh": "^3.2.1",
+ "parse-json": "^5.0.0",
+ "path-type": "^4.0.0",
+ "yaml": "^1.10.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/babel-plugin-macros/node_modules/yaml": {
+ "version": "1.10.2",
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
+ "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/babel-plugin-polyfill-corejs2": {
+ "version": "0.4.5",
+ "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.5.tgz",
+ "integrity": "sha512-19hwUH5FKl49JEsvyTcoHakh6BE0wgXLLptIyKZ3PijHc/Ci521wygORCUCCred+E/twuqRyAkE02BAWPmsHOg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/compat-data": "^7.22.6",
+ "@babel/helper-define-polyfill-provider": "^0.4.2",
+ "semver": "^6.3.1"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
+ }
+ },
+ "node_modules/babel-plugin-polyfill-corejs2/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/babel-plugin-polyfill-corejs3": {
+ "version": "0.8.4",
+ "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.4.tgz",
+ "integrity": "sha512-9l//BZZsPR+5XjyJMPtZSK4jv0BsTO1zDac2GC6ygx9WLGlcsnRd1Co0B2zT5fF5Ic6BZy+9m3HNZ3QcOeDKfg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-define-polyfill-provider": "^0.4.2",
+ "core-js-compat": "^3.32.2"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
+ }
+ },
+ "node_modules/babel-plugin-polyfill-regenerator": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.2.tgz",
+ "integrity": "sha512-tAlOptU0Xj34V1Y2PNTL4Y0FOJMDB6bZmoW39FeCQIhigGLkqu3Fj6uiXpxIf6Ij274ENdYx64y6Au+ZKlb1IA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-define-polyfill-provider": "^0.4.2"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
+ }
+ },
+ "node_modules/babel-plugin-styled-components": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-2.1.4.tgz",
+ "integrity": "sha512-Xgp9g+A/cG47sUyRwwYxGM4bR/jDRg5N6it/8+HxCnbT5XNKSKDT9xm4oag/osgqjC2It/vH0yXsomOG6k558g==",
+ "dependencies": {
+ "@babel/helper-annotate-as-pure": "^7.22.5",
+ "@babel/helper-module-imports": "^7.22.5",
+ "@babel/plugin-syntax-jsx": "^7.22.5",
+ "lodash": "^4.17.21",
+ "picomatch": "^2.3.1"
+ },
+ "peerDependencies": {
+ "styled-components": ">= 2"
+ }
+ },
+ "node_modules/babel-preset-current-node-syntax": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz",
+ "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/plugin-syntax-async-generators": "^7.8.4",
+ "@babel/plugin-syntax-bigint": "^7.8.3",
+ "@babel/plugin-syntax-class-properties": "^7.8.3",
+ "@babel/plugin-syntax-import-meta": "^7.8.3",
+ "@babel/plugin-syntax-json-strings": "^7.8.3",
+ "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3",
+ "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3",
+ "@babel/plugin-syntax-numeric-separator": "^7.8.3",
+ "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
+ "@babel/plugin-syntax-optional-catch-binding": "^7.8.3",
+ "@babel/plugin-syntax-optional-chaining": "^7.8.3",
+ "@babel/plugin-syntax-top-level-await": "^7.8.3"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/babel-preset-jest": {
+ "version": "29.6.3",
+ "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz",
+ "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==",
+ "dev": true,
+ "dependencies": {
+ "babel-plugin-jest-hoist": "^29.6.3",
+ "babel-preset-current-node-syntax": "^1.0.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/bail": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz",
+ "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
+ },
+ "node_modules/base": {
+ "version": "0.11.2",
+ "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz",
+ "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==",
+ "dependencies": {
+ "cache-base": "^1.0.1",
+ "class-utils": "^0.3.5",
+ "component-emitter": "^1.2.1",
+ "define-property": "^1.0.0",
+ "isobject": "^3.0.1",
+ "mixin-deep": "^1.2.0",
+ "pascalcase": "^0.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/base/node_modules/define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==",
+ "dependencies": {
+ "is-descriptor": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/base64-js": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/batch": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz",
+ "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw=="
+ },
+ "node_modules/bcryptjs": {
+ "version": "2.4.3",
+ "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
+ "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ=="
+ },
+ "node_modules/big-integer": {
+ "version": "1.6.51",
+ "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz",
+ "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==",
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
+ "node_modules/big.js": {
+ "version": "5.2.2",
+ "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
+ "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/binary-extensions": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
+ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/bind-obj-methods": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/bind-obj-methods/-/bind-obj-methods-3.0.0.tgz",
+ "integrity": "sha512-nLEaaz3/sEzNSyPWRsN9HNsqwk1AUyECtGj+XwGdIi3xABnEqecvXtIJ0wehQXuuER5uZ/5fTs2usONgYjG+iw==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/bl": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
+ "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
+ "dependencies": {
+ "buffer": "^5.5.0",
+ "inherits": "^2.0.4",
+ "readable-stream": "^3.4.0"
+ }
+ },
+ "node_modules/blog": {
+ "resolved": "packages/blog",
+ "link": true
+ },
+ "node_modules/blog-cms": {
+ "resolved": "packages/blog-cms",
+ "link": true
+ },
+ "node_modules/bn.js": {
+ "version": "4.12.0",
+ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
+ "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA=="
+ },
+ "node_modules/body-parser": {
+ "version": "1.20.1",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz",
+ "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==",
+ "dependencies": {
+ "bytes": "3.1.2",
+ "content-type": "~1.0.4",
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "destroy": "1.2.0",
+ "http-errors": "2.0.0",
+ "iconv-lite": "0.4.24",
+ "on-finished": "2.4.1",
+ "qs": "6.11.0",
+ "raw-body": "2.5.1",
+ "type-is": "~1.6.18",
+ "unpipe": "1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8",
+ "npm": "1.2.8000 || >= 1.4.16"
+ }
+ },
+ "node_modules/body-parser/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/body-parser/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ },
+ "node_modules/body-parser/node_modules/qs": {
+ "version": "6.11.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
+ "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
+ "dependencies": {
+ "side-channel": "^1.0.4"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/body-parser/node_modules/raw-body": {
+ "version": "2.5.1",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",
+ "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
+ "dependencies": {
+ "bytes": "3.1.2",
+ "http-errors": "2.0.0",
+ "iconv-lite": "0.4.24",
+ "unpipe": "1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/bonjour-service": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.1.1.tgz",
+ "integrity": "sha512-Z/5lQRMOG9k7W+FkeGTNjh7htqn/2LMnfOvBZ8pynNZCM9MwkQkI3zeI4oz09uWdcgmgHugVvBqxGg4VQJ5PCg==",
+ "dependencies": {
+ "array-flatten": "^2.1.2",
+ "dns-equal": "^1.0.0",
+ "fast-deep-equal": "^3.1.3",
+ "multicast-dns": "^7.2.5"
+ }
+ },
+ "node_modules/boolbase": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
+ "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww=="
+ },
+ "node_modules/bowser": {
+ "version": "2.11.0",
+ "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz",
+ "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==",
+ "optional": true
+ },
+ "node_modules/boxen": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz",
+ "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==",
+ "dependencies": {
+ "ansi-align": "^3.0.0",
+ "camelcase": "^6.2.0",
+ "chalk": "^4.1.0",
+ "cli-boxes": "^2.2.1",
+ "string-width": "^4.2.2",
+ "type-fest": "^0.20.2",
+ "widest-line": "^3.1.0",
+ "wrap-ansi": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/boxen/node_modules/camelcase": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/boxen/node_modules/type-fest": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
+ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "node_modules/braces": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "dependencies": {
+ "fill-range": "^7.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/broadcast-channel": {
+ "version": "3.7.0",
+ "resolved": "https://registry.npmjs.org/broadcast-channel/-/broadcast-channel-3.7.0.tgz",
+ "integrity": "sha512-cIAKJXAxGJceNZGTZSBzMxzyOn72cVgPnKx4dc6LRjQgbaJUQqhy5rzL3zbMxkMWsGKkv2hSFkPRMEXfoMZ2Mg==",
+ "dependencies": {
+ "@babel/runtime": "^7.7.2",
+ "detect-node": "^2.1.0",
+ "js-sha3": "0.8.0",
+ "microseconds": "0.2.0",
+ "nano-time": "1.0.0",
+ "oblivious-set": "1.0.0",
+ "rimraf": "3.0.2",
+ "unload": "2.2.0"
+ }
+ },
+ "node_modules/broadcast-channel/node_modules/rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/brorand": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
+ "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w=="
+ },
+ "node_modules/browser-process-hrtime": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz",
+ "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==",
+ "dev": true
+ },
+ "node_modules/browserslist": {
+ "version": "4.22.0",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.0.tgz",
+ "integrity": "sha512-v+Jcv64L2LbfTC6OnRcaxtqJNJuQAVhZKSJfR/6hn7lhnChUXl4amwVviqN1k411BB+3rRoKMitELRn1CojeRA==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/browserslist"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "dependencies": {
+ "caniuse-lite": "^1.0.30001539",
+ "electron-to-chromium": "^1.4.530",
+ "node-releases": "^2.0.13",
+ "update-browserslist-db": "^1.0.13"
+ },
+ "bin": {
+ "browserslist": "cli.js"
+ },
+ "engines": {
+ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
+ }
+ },
+ "node_modules/browserslist-to-esbuild": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/browserslist-to-esbuild/-/browserslist-to-esbuild-1.2.0.tgz",
+ "integrity": "sha512-ftrrbI/VHBgEnmnSyhkqvQVMp6jAKybfs0qMIlm7SLBrQTGMsdCIP4q3BoKeLsZTBQllIQtY9kbxgRYV2WU47g==",
+ "dependencies": {
+ "browserslist": "^4.17.3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/bser": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz",
+ "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==",
+ "dev": true,
+ "dependencies": {
+ "node-int64": "^0.4.0"
+ }
+ },
+ "node_modules/bson": {
+ "version": "4.7.2",
+ "resolved": "https://registry.npmjs.org/bson/-/bson-4.7.2.tgz",
+ "integrity": "sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==",
+ "dependencies": {
+ "buffer": "^5.6.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/buffer": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
+ "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "dependencies": {
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.1.13"
+ }
+ },
+ "node_modules/buffer-equal-constant-time": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
+ "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA=="
+ },
+ "node_modules/buffer-from": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
+ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
+ },
+ "node_modules/buffer-writer": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz",
+ "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/buildmail": {
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/buildmail/-/buildmail-3.10.0.tgz",
+ "integrity": "sha512-6e5sDN/pl3en5Klqdfyir7LEIBiFr9oqZuvYaEyVwjxpIbBZN+98e0j87Fz2Ukl8ud32rbk9VGOZAnsOZ7pkaA==",
+ "deprecated": "This project is unmaintained",
+ "dependencies": {
+ "addressparser": "1.0.1",
+ "libbase64": "0.1.0",
+ "libmime": "2.1.0",
+ "libqp": "1.1.0",
+ "nodemailer-fetch": "1.6.0",
+ "nodemailer-shared": "1.1.0"
+ }
+ },
+ "node_modules/buildmail/node_modules/iconv-lite": {
+ "version": "0.4.13",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.13.tgz",
+ "integrity": "sha512-QwVuTNQv7tXC5mMWFX5N5wGjmybjNBBD8P3BReTkPmipoxTUFgWM2gXNvldHQr6T14DH0Dh6qBVg98iJt7u4mQ==",
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/buildmail/node_modules/libmime": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/libmime/-/libmime-2.1.0.tgz",
+ "integrity": "sha512-4be2R6/jOasyPTw0BkpIZBVk2cElqjdIdS0PRPhbOCV4wWuL/ZcYYpN1BCTVB+6eIQ0uuAwp5hQTHFrM5Joa8w==",
+ "dependencies": {
+ "iconv-lite": "0.4.13",
+ "libbase64": "0.1.0",
+ "libqp": "1.1.0"
+ }
+ },
+ "node_modules/builtins": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz",
+ "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==",
+ "dev": true,
+ "dependencies": {
+ "semver": "^7.0.0"
+ }
+ },
+ "node_modules/busboy": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/busboy/-/busboy-0.3.1.tgz",
+ "integrity": "sha512-y7tTxhGKXcyBxRKAni+awqx8uqaJKrSFSNFSeRG5CsWNdmy2BIK+6VGWEW7TZnIO/533mtMEA4rOevQV815YJw==",
+ "dependencies": {
+ "dicer": "0.3.0"
+ },
+ "engines": {
+ "node": ">=4.5.0"
+ }
+ },
+ "node_modules/byte-size": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-7.0.1.tgz",
+ "integrity": "sha512-crQdqyCwhokxwV1UyDzLZanhkugAgft7vt0qbbdt60C6Zf3CAiGmtUCylbtYwrU6loOUw3euGrNtW1J651ot1A==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/bytes": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/cacache": {
+ "version": "17.1.4",
+ "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.1.4.tgz",
+ "integrity": "sha512-/aJwG2l3ZMJ1xNAnqbMpA40of9dj/pIH3QfiuQSqjfPJF747VR0J/bHn+/KdNnHKc6XQcWt/AfRSBft82W1d2A==",
+ "dev": true,
+ "dependencies": {
+ "@npmcli/fs": "^3.1.0",
+ "fs-minipass": "^3.0.0",
+ "glob": "^10.2.2",
+ "lru-cache": "^7.7.1",
+ "minipass": "^7.0.3",
+ "minipass-collect": "^1.0.2",
+ "minipass-flush": "^1.0.5",
+ "minipass-pipeline": "^1.2.4",
+ "p-map": "^4.0.0",
+ "ssri": "^10.0.0",
+ "tar": "^6.1.11",
+ "unique-filename": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/cacache/node_modules/brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "dev": true,
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/cacache/node_modules/foreground-child": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz",
+ "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==",
+ "dev": true,
+ "dependencies": {
+ "cross-spawn": "^7.0.0",
+ "signal-exit": "^4.0.1"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/cacache/node_modules/glob": {
+ "version": "10.3.10",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz",
+ "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==",
+ "dev": true,
+ "dependencies": {
+ "foreground-child": "^3.1.0",
+ "jackspeak": "^2.3.5",
+ "minimatch": "^9.0.1",
+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0",
+ "path-scurry": "^1.10.1"
+ },
+ "bin": {
+ "glob": "dist/esm/bin.mjs"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/cacache/node_modules/jackspeak": {
+ "version": "2.3.5",
+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.5.tgz",
+ "integrity": "sha512-Ratx+B8WeXLAtRJn26hrhY8S1+Jz6pxPMrkrdkgb/NstTNiqMhX0/oFVu5wX+g5n6JlEu2LPsDJmY8nRP4+alw==",
+ "dev": true,
+ "dependencies": {
+ "@isaacs/cliui": "^8.0.2"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ },
+ "optionalDependencies": {
+ "@pkgjs/parseargs": "^0.11.0"
+ }
+ },
+ "node_modules/cacache/node_modules/lru-cache": {
+ "version": "7.18.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",
+ "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/cacache/node_modules/minimatch": {
+ "version": "9.0.3",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
+ "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
+ "dev": true,
+ "dependencies": {
+ "brace-expansion": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/cacache/node_modules/minipass": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz",
+ "integrity": "sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==",
+ "dev": true,
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ }
+ },
+ "node_modules/cacache/node_modules/signal-exit": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
+ "dev": true,
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/cache-base": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
+ "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==",
+ "dependencies": {
+ "collection-visit": "^1.0.0",
+ "component-emitter": "^1.2.1",
+ "get-value": "^2.0.6",
+ "has-value": "^1.0.0",
+ "isobject": "^3.0.1",
+ "set-value": "^2.0.0",
+ "to-object-path": "^0.3.0",
+ "union-value": "^1.0.0",
+ "unset-value": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/cache-content-type": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz",
+ "integrity": "sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==",
+ "dependencies": {
+ "mime-types": "^2.1.18",
+ "ylru": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 6.0.0"
+ }
+ },
+ "node_modules/cacheable-lookup": {
+ "version": "5.0.4",
+ "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz",
+ "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==",
+ "engines": {
+ "node": ">=10.6.0"
+ }
+ },
+ "node_modules/cacheable-request": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz",
+ "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==",
+ "dev": true,
+ "dependencies": {
+ "clone-response": "^1.0.2",
+ "get-stream": "^5.1.0",
+ "http-cache-semantics": "^4.0.0",
+ "keyv": "^3.0.0",
+ "lowercase-keys": "^2.0.0",
+ "normalize-url": "^4.1.0",
+ "responselike": "^1.0.2"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/cacheable-request/node_modules/get-stream": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
+ "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
+ "dev": true,
+ "dependencies": {
+ "pump": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/cacheable-request/node_modules/json-buffer": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz",
+ "integrity": "sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==",
+ "dev": true
+ },
+ "node_modules/cacheable-request/node_modules/keyv": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz",
+ "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==",
+ "dev": true,
+ "dependencies": {
+ "json-buffer": "3.0.0"
+ }
+ },
+ "node_modules/cacheable-request/node_modules/lowercase-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz",
+ "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/caching-transform": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz",
+ "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==",
+ "dev": true,
+ "dependencies": {
+ "hasha": "^5.0.0",
+ "make-dir": "^3.0.0",
+ "package-hash": "^4.0.0",
+ "write-file-atomic": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/caching-transform/node_modules/make-dir": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
+ "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
+ "dev": true,
+ "dependencies": {
+ "semver": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/caching-transform/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/caching-transform/node_modules/write-file-atomic": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz",
+ "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==",
+ "dev": true,
+ "dependencies": {
+ "imurmurhash": "^0.1.4",
+ "is-typedarray": "^1.0.0",
+ "signal-exit": "^3.0.2",
+ "typedarray-to-buffer": "^3.1.5"
+ }
+ },
+ "node_modules/call-bind": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
+ "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
+ "dependencies": {
+ "function-bind": "^1.1.1",
+ "get-intrinsic": "^1.0.2"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/callsites": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/camel-case": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz",
+ "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==",
+ "dependencies": {
+ "pascal-case": "^3.1.2",
+ "tslib": "^2.0.3"
+ }
+ },
+ "node_modules/camelcase": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
+ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/camelize": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz",
+ "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/caniuse-lite": {
+ "version": "1.0.30001540",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001540.tgz",
+ "integrity": "sha512-9JL38jscuTJBTcuETxm8QLsFr/F6v0CYYTEU6r5+qSM98P2Q0Hmu0eG1dTG5GBUmywU3UlcVOUSIJYY47rdFSw==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/caniuse-lite"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ]
+ },
+ "node_modules/chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/chalk/node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/change-case": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/change-case/-/change-case-3.1.0.tgz",
+ "integrity": "sha512-2AZp7uJZbYEzRPsFoa+ijKdvp9zsrnnt6+yFokfwEpeJm0xuJDVoxiRCAaTzyJND8GJkofo2IcKWaUZ/OECVzw==",
+ "dependencies": {
+ "camel-case": "^3.0.0",
+ "constant-case": "^2.0.0",
+ "dot-case": "^2.1.0",
+ "header-case": "^1.0.0",
+ "is-lower-case": "^1.1.0",
+ "is-upper-case": "^1.1.0",
+ "lower-case": "^1.1.1",
+ "lower-case-first": "^1.0.0",
+ "no-case": "^2.3.2",
+ "param-case": "^2.1.0",
+ "pascal-case": "^2.0.0",
+ "path-case": "^2.1.0",
+ "sentence-case": "^2.1.0",
+ "snake-case": "^2.1.0",
+ "swap-case": "^1.1.0",
+ "title-case": "^2.1.0",
+ "upper-case": "^1.1.1",
+ "upper-case-first": "^1.1.0"
+ }
+ },
+ "node_modules/change-case/node_modules/camel-case": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz",
+ "integrity": "sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w==",
+ "dependencies": {
+ "no-case": "^2.2.0",
+ "upper-case": "^1.1.1"
+ }
+ },
+ "node_modules/change-case/node_modules/param-case": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz",
+ "integrity": "sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w==",
+ "dependencies": {
+ "no-case": "^2.2.0"
+ }
+ },
+ "node_modules/change-case/node_modules/pascal-case": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-2.0.1.tgz",
+ "integrity": "sha512-qjS4s8rBOJa2Xm0jmxXiyh1+OFf6ekCWOvUaRgAQSktzlTbMotS0nmG9gyYAybCWBcuP4fsBeRCKNwGBnMe2OQ==",
+ "dependencies": {
+ "camel-case": "^3.0.0",
+ "upper-case-first": "^1.1.0"
+ }
+ },
+ "node_modules/char-regex": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz",
+ "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/character-entities": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz",
+ "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/chardet": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz",
+ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA=="
+ },
+ "node_modules/charenc": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz",
+ "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==",
+ "dev": true,
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/chokidar": {
+ "version": "3.5.3",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
+ "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://paulmillr.com/funding/"
+ }
+ ],
+ "dependencies": {
+ "anymatch": "~3.1.2",
+ "braces": "~3.0.2",
+ "glob-parent": "~5.1.2",
+ "is-binary-path": "~2.1.0",
+ "is-glob": "~4.0.1",
+ "normalize-path": "~3.0.0",
+ "readdirp": "~3.6.0"
+ },
+ "engines": {
+ "node": ">= 8.10.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/chownr": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
+ "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/chrome-trace-event": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz",
+ "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==",
+ "engines": {
+ "node": ">=6.0"
+ }
+ },
+ "node_modules/ci-info": {
+ "version": "3.8.0",
+ "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz",
+ "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/sibiraj-s"
+ }
+ ],
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/cjs-module-lexer": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz",
+ "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ=="
+ },
+ "node_modules/class-utils": {
+ "version": "0.3.6",
+ "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
+ "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==",
+ "dependencies": {
+ "arr-union": "^3.1.0",
+ "define-property": "^0.2.5",
+ "isobject": "^3.0.0",
+ "static-extend": "^0.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/class-utils/node_modules/define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==",
+ "dependencies": {
+ "is-descriptor": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/class-utils/node_modules/is-accessor-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+ "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==",
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/class-utils/node_modules/is-accessor-descriptor/node_modules/kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/class-utils/node_modules/is-data-descriptor": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+ "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==",
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/class-utils/node_modules/is-data-descriptor/node_modules/kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/class-utils/node_modules/is-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
+ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
+ "dependencies": {
+ "is-accessor-descriptor": "^0.1.6",
+ "is-data-descriptor": "^0.1.4",
+ "kind-of": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/class-utils/node_modules/kind-of": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+ "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/clean-css": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.2.tgz",
+ "integrity": "sha512-JVJbM+f3d3Q704rF4bqQ5UUyTtuJ0JRKNbTKVEeujCCBoMdkEi+V+e8oktO9qGQNSvHrFTM6JZRXrUvGR1czww==",
+ "dependencies": {
+ "source-map": "~0.6.0"
+ },
+ "engines": {
+ "node": ">= 10.0"
+ }
+ },
+ "node_modules/clean-css/node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/clean-stack": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",
+ "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/cli-boxes": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz",
+ "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==",
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/cli-cursor": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
+ "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==",
+ "dependencies": {
+ "restore-cursor": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/cli-progress": {
+ "version": "3.12.0",
+ "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.12.0.tgz",
+ "integrity": "sha512-tRkV3HJ1ASwm19THiiLIXLO7Im7wlTuKnvkYaTkyoAPefqjNg7W7DHKUlGRxy9vxDvbyCYQkQozvptuMkGCg8A==",
+ "dev": true,
+ "dependencies": {
+ "string-width": "^4.2.3"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/cli-spinners": {
+ "version": "2.9.1",
+ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.1.tgz",
+ "integrity": "sha512-jHgecW0pxkonBJdrKsqxgRX9AcG+u/5k0Q7WPDfi8AogLAdwxEkyYYNWwZ5GvVFoFx2uiY1eNcSK00fh+1+FyQ==",
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/cli-table3": {
+ "version": "0.6.2",
+ "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.2.tgz",
+ "integrity": "sha512-QyavHCaIC80cMivimWu4aWHilIpiDpfm3hGmqAmXVL1UsnbLuBSMd21hTX6VY4ZSDSM73ESLeF8TOYId3rBTbw==",
+ "dependencies": {
+ "string-width": "^4.2.0"
+ },
+ "engines": {
+ "node": "10.* || >= 12.*"
+ },
+ "optionalDependencies": {
+ "@colors/colors": "1.5.0"
+ }
+ },
+ "node_modules/cli-width": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz",
+ "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==",
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/client-only": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz",
+ "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA=="
+ },
+ "node_modules/cliui": {
+ "version": "7.0.4",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
+ "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
+ "dependencies": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.0",
+ "wrap-ansi": "^7.0.0"
+ }
+ },
+ "node_modules/clone": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
+ "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==",
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
+ "node_modules/clone-deep": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz",
+ "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==",
+ "dependencies": {
+ "is-plain-object": "^2.0.4",
+ "kind-of": "^6.0.2",
+ "shallow-clone": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/clone-response": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz",
+ "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==",
+ "dependencies": {
+ "mimic-response": "^1.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/clone-response/node_modules/mimic-response": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
+ "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/close-with-grace": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/close-with-grace/-/close-with-grace-1.2.0.tgz",
+ "integrity": "sha512-Xga0jyAb4fX98u5pZAgqlbqHP8cHuy5M3Wto0k0L/36aP2C25Cjp51XfPw3Hz7dNC2L2/hF/PK/KJhO275L+VA=="
+ },
+ "node_modules/cls-hooked": {
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/cls-hooked/-/cls-hooked-4.2.2.tgz",
+ "integrity": "sha512-J4Xj5f5wq/4jAvcdgoGsL3G103BtWpZrMo8NEinRltN+xpTZdI+M38pyQqhuFU/P792xkMFvnKSf+Lm81U1bxw==",
+ "dependencies": {
+ "async-hook-jl": "^1.7.6",
+ "emitter-listener": "^1.0.1",
+ "semver": "^5.4.1"
+ },
+ "engines": {
+ "node": "^4.7 || >=6.9 || >=7.3 || >=8.2.1"
+ }
+ },
+ "node_modules/cls-hooked/node_modules/semver": {
+ "version": "5.7.2",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
+ "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
+ "bin": {
+ "semver": "bin/semver"
+ }
+ },
+ "node_modules/co": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
+ "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==",
+ "engines": {
+ "iojs": ">= 1.0.0",
+ "node": ">= 0.12.0"
+ }
+ },
+ "node_modules/co-body": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/co-body/-/co-body-5.2.0.tgz",
+ "integrity": "sha512-sX/LQ7LqUhgyaxzbe7IqwPeTr2yfpfUIQ/dgpKo6ZI4y4lpQA0YxAomWIY+7I7rHWcG02PG+OuPREzMW/5tszQ==",
+ "dependencies": {
+ "inflation": "^2.0.0",
+ "qs": "^6.4.0",
+ "raw-body": "^2.2.0",
+ "type-is": "^1.6.14"
+ }
+ },
+ "node_modules/codemirror": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz",
+ "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==",
+ "dependencies": {
+ "@codemirror/autocomplete": "^6.0.0",
+ "@codemirror/commands": "^6.0.0",
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/lint": "^6.0.0",
+ "@codemirror/search": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0"
+ }
+ },
+ "node_modules/codemirror5": {
+ "name": "codemirror",
+ "version": "5.65.15",
+ "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.15.tgz",
+ "integrity": "sha512-YC4EHbbwQeubZzxLl5G4nlbLc1T21QTrKGaOal/Pkm9dVDMZXMH7+ieSPEOZCtO9I68i8/oteJKOxzHC2zR+0g=="
+ },
+ "node_modules/collect-v8-coverage": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz",
+ "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==",
+ "dev": true
+ },
+ "node_modules/collection-visit": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
+ "integrity": "sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==",
+ "dependencies": {
+ "map-visit": "^1.0.0",
+ "object-visit": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/color": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz",
+ "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==",
+ "dependencies": {
+ "color-convert": "^1.9.3",
+ "color-string": "^1.6.0"
+ }
+ },
+ "node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
+ },
+ "node_modules/color-string": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
+ "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
+ "dependencies": {
+ "color-name": "^1.0.0",
+ "simple-swizzle": "^0.2.2"
+ }
+ },
+ "node_modules/color-support": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
+ "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==",
+ "dev": true,
+ "bin": {
+ "color-support": "bin.js"
+ }
+ },
+ "node_modules/color/node_modules/color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dependencies": {
+ "color-name": "1.1.3"
+ }
+ },
+ "node_modules/color/node_modules/color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
+ },
+ "node_modules/colorette": {
+ "version": "2.0.20",
+ "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz",
+ "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w=="
+ },
+ "node_modules/colors": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz",
+ "integrity": "sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==",
+ "engines": {
+ "node": ">=0.1.90"
+ }
+ },
+ "node_modules/colorspace": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz",
+ "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==",
+ "dependencies": {
+ "color": "^3.1.3",
+ "text-hex": "1.0.x"
+ }
+ },
+ "node_modules/combined-stream": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "dependencies": {
+ "delayed-stream": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/comma-separated-tokens": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz",
+ "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/command-exists": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz",
+ "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==",
+ "dev": true
+ },
+ "node_modules/commander": {
+ "version": "9.5.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
+ "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",
+ "dev": true,
+ "engines": {
+ "node": "^12.20.0 || >=14"
+ }
+ },
+ "node_modules/commist": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/commist/-/commist-3.2.0.tgz",
+ "integrity": "sha512-4PIMoPniho+LqXmpS5d3NuGYncG6XWlkBSVGiWycL22dd42OYdUGil2CWuzklaJoNxyxUSpO4MKIBU94viWNAw=="
+ },
+ "node_modules/common-path-prefix": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz",
+ "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w=="
+ },
+ "node_modules/commondir": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
+ "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==",
+ "dev": true
+ },
+ "node_modules/component-emitter": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
+ "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
+ },
+ "node_modules/compressible": {
+ "version": "2.0.18",
+ "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz",
+ "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==",
+ "dependencies": {
+ "mime-db": ">= 1.43.0 < 2"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/compression": {
+ "version": "1.7.4",
+ "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz",
+ "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==",
+ "dependencies": {
+ "accepts": "~1.3.5",
+ "bytes": "3.0.0",
+ "compressible": "~2.0.16",
+ "debug": "2.6.9",
+ "on-headers": "~1.0.2",
+ "safe-buffer": "5.1.2",
+ "vary": "~1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/compression/node_modules/bytes": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
+ "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/compression/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/compression/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ },
+ "node_modules/compression/node_modules/safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
+ },
+ "node_modules/compute-scroll-into-view": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-3.0.3.tgz",
+ "integrity": "sha512-nadqwNxghAGTamwIqQSG433W6OADZx2vCo3UXHNrzTRHK/htu+7+L0zhjEoaeaQVNAi3YgqWDv8+tzf0hRfR+A=="
+ },
+ "node_modules/concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
+ },
+ "node_modules/concurrently": {
+ "version": "7.6.0",
+ "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-7.6.0.tgz",
+ "integrity": "sha512-BKtRgvcJGeZ4XttiDiNcFiRlxoAeZOseqUvyYRUp/Vtd+9p1ULmeoSqGsDA+2ivdeDFpqrJvGvmI+StKfKl5hw==",
+ "dev": true,
+ "dependencies": {
+ "chalk": "^4.1.0",
+ "date-fns": "^2.29.1",
+ "lodash": "^4.17.21",
+ "rxjs": "^7.0.0",
+ "shell-quote": "^1.7.3",
+ "spawn-command": "^0.0.2-1",
+ "supports-color": "^8.1.0",
+ "tree-kill": "^1.2.2",
+ "yargs": "^17.3.1"
+ },
+ "bin": {
+ "conc": "dist/bin/concurrently.js",
+ "concurrently": "dist/bin/concurrently.js"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/open-cli-tools/concurrently?sponsor=1"
+ }
+ },
+ "node_modules/configstore": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz",
+ "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==",
+ "dependencies": {
+ "dot-prop": "^5.2.0",
+ "graceful-fs": "^4.1.2",
+ "make-dir": "^3.0.0",
+ "unique-string": "^2.0.0",
+ "write-file-atomic": "^3.0.0",
+ "xdg-basedir": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/configstore/node_modules/make-dir": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
+ "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
+ "dependencies": {
+ "semver": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/configstore/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/configstore/node_modules/write-file-atomic": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz",
+ "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==",
+ "dependencies": {
+ "imurmurhash": "^0.1.4",
+ "is-typedarray": "^1.0.0",
+ "signal-exit": "^3.0.2",
+ "typedarray-to-buffer": "^3.1.5"
+ }
+ },
+ "node_modules/connect-history-api-fallback": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz",
+ "integrity": "sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==",
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
+ "node_modules/consola": {
+ "version": "2.15.3",
+ "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz",
+ "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw=="
+ },
+ "node_modules/console-control-strings": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
+ "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==",
+ "dev": true
+ },
+ "node_modules/constant-case": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-2.0.0.tgz",
+ "integrity": "sha512-eS0N9WwmjTqrOmR3o83F5vW8Z+9R1HnVz3xmzT2PMFug9ly+Au/fxRWlEBSb6LcZwspSsEn9Xs1uw9YgzAg1EQ==",
+ "dependencies": {
+ "snake-case": "^2.1.0",
+ "upper-case": "^1.1.1"
+ }
+ },
+ "node_modules/content-disposition": {
+ "version": "0.5.4",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
+ "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
+ "dependencies": {
+ "safe-buffer": "5.2.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/content-type": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/continuation-local-storage": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/continuation-local-storage/-/continuation-local-storage-3.2.1.tgz",
+ "integrity": "sha512-jx44cconVqkCEEyLSKWwkvUXwO561jXMa3LPjTPsm5QR22PA0/mhe33FT4Xb5y74JDvt/Cq+5lm8S8rskLv9ZA==",
+ "dependencies": {
+ "async-listener": "^0.6.0",
+ "emitter-listener": "^1.1.1"
+ }
+ },
+ "node_modules/convert-source-map": {
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",
+ "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A=="
+ },
+ "node_modules/cookie": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
+ "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie-signature": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
+ "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
+ },
+ "node_modules/cookies": {
+ "version": "0.8.0",
+ "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.8.0.tgz",
+ "integrity": "sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow==",
+ "dependencies": {
+ "depd": "~2.0.0",
+ "keygrip": "~1.1.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/copy-anything": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-2.0.6.tgz",
+ "integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==",
+ "devOptional": true,
+ "dependencies": {
+ "is-what": "^3.14.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/mesqueeb"
+ }
+ },
+ "node_modules/copy-descriptor": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
+ "integrity": "sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/copy-to": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/copy-to/-/copy-to-2.0.1.tgz",
+ "integrity": "sha512-3DdaFaU/Zf1AnpLiFDeNCD4TOWe3Zl2RZaTzUvWiIk5ERzcCodOE20Vqq4fzCbNoHURFHT4/us/Lfq+S2zyY4w=="
+ },
+ "node_modules/copy-webpack-plugin": {
+ "version": "11.0.0",
+ "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-11.0.0.tgz",
+ "integrity": "sha512-fX2MWpamkW0hZxMEg0+mYnA40LTosOSa5TqZ9GYIBzyJa9C3QUaMPSE2xAi/buNr8u89SfD9wHSQVBzrRa/SOQ==",
+ "dev": true,
+ "dependencies": {
+ "fast-glob": "^3.2.11",
+ "glob-parent": "^6.0.1",
+ "globby": "^13.1.1",
+ "normalize-path": "^3.0.0",
+ "schema-utils": "^4.0.0",
+ "serialize-javascript": "^6.0.0"
+ },
+ "engines": {
+ "node": ">= 14.15.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "webpack": "^5.1.0"
+ }
+ },
+ "node_modules/copy-webpack-plugin/node_modules/glob-parent": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
+ "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
+ "dev": true,
+ "dependencies": {
+ "is-glob": "^4.0.3"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/copy-webpack-plugin/node_modules/globby": {
+ "version": "13.2.2",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz",
+ "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==",
+ "dev": true,
+ "dependencies": {
+ "dir-glob": "^3.0.1",
+ "fast-glob": "^3.3.0",
+ "ignore": "^5.2.4",
+ "merge2": "^1.4.1",
+ "slash": "^4.0.0"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/copy-webpack-plugin/node_modules/slash": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz",
+ "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/copyfiles": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz",
+ "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==",
+ "dependencies": {
+ "glob": "^7.0.5",
+ "minimatch": "^3.0.3",
+ "mkdirp": "^1.0.4",
+ "noms": "0.0.0",
+ "through2": "^2.0.1",
+ "untildify": "^4.0.0",
+ "yargs": "^16.1.0"
+ },
+ "bin": {
+ "copyfiles": "copyfiles",
+ "copyup": "copyfiles"
+ }
+ },
+ "node_modules/copyfiles/node_modules/mkdirp": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
+ "bin": {
+ "mkdirp": "bin/cmd.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/copyfiles/node_modules/yargs": {
+ "version": "16.2.0",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
+ "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
+ "dependencies": {
+ "cliui": "^7.0.2",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
+ "require-directory": "^2.1.1",
+ "string-width": "^4.2.0",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^20.2.2"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/copyfiles/node_modules/yargs-parser": {
+ "version": "20.2.9",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
+ "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/core-js-compat": {
+ "version": "3.32.2",
+ "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.32.2.tgz",
+ "integrity": "sha512-+GjlguTDINOijtVRUxrQOv3kfu9rl+qPNdX2LTbJ/ZyVTuxK+ksVSAGX1nHstu4hrv1En/uPTtWgq2gI5wt4AQ==",
+ "dev": true,
+ "dependencies": {
+ "browserslist": "^4.21.10"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/core-js"
+ }
+ },
+ "node_modules/core-js-pure": {
+ "version": "3.32.2",
+ "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.32.2.tgz",
+ "integrity": "sha512-Y2rxThOuNywTjnX/PgA5vWM6CZ9QB9sz9oGeCixV8MqXZO70z/5SHzf9EeBrEBK0PN36DnEBBu9O/aGWzKuMZQ==",
+ "hasInstallScript": true,
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/core-js"
+ }
+ },
+ "node_modules/core-util-is": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
+ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
+ },
+ "node_modules/cosmiconfig": {
+ "version": "8.3.6",
+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz",
+ "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==",
+ "dev": true,
+ "dependencies": {
+ "import-fresh": "^3.3.0",
+ "js-yaml": "^4.1.0",
+ "parse-json": "^5.2.0",
+ "path-type": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/d-fischer"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.9.5"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/cosmiconfig/node_modules/argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "dev": true
+ },
+ "node_modules/cosmiconfig/node_modules/js-yaml": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
+ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+ "dev": true,
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
+ "node_modules/crc": {
+ "version": "3.8.0",
+ "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz",
+ "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==",
+ "dependencies": {
+ "buffer": "^5.1.0"
+ }
+ },
+ "node_modules/create-jest": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz",
+ "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==",
+ "dev": true,
+ "dependencies": {
+ "@jest/types": "^29.6.3",
+ "chalk": "^4.0.0",
+ "exit": "^0.1.2",
+ "graceful-fs": "^4.2.9",
+ "jest-config": "^29.7.0",
+ "jest-util": "^29.7.0",
+ "prompts": "^2.0.1"
+ },
+ "bin": {
+ "create-jest": "bin/create-jest.js"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/create-require": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
+ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
+ "dev": true
+ },
+ "node_modules/crelt": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz",
+ "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g=="
+ },
+ "node_modules/critters": {
+ "version": "0.0.20",
+ "resolved": "https://registry.npmjs.org/critters/-/critters-0.0.20.tgz",
+ "integrity": "sha512-CImNRorKOl5d8TWcnAz5n5izQ6HFsvz29k327/ELy6UFcmbiZNOsinaKvzv16WZR0P6etfSWYzE47C4/56B3Uw==",
+ "dev": true,
+ "dependencies": {
+ "chalk": "^4.1.0",
+ "css-select": "^5.1.0",
+ "dom-serializer": "^2.0.0",
+ "domhandler": "^5.0.2",
+ "htmlparser2": "^8.0.2",
+ "postcss": "^8.4.23",
+ "pretty-bytes": "^5.3.0"
+ }
+ },
+ "node_modules/cron-parser": {
+ "version": "3.5.0",
+ "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-3.5.0.tgz",
+ "integrity": "sha512-wyVZtbRs6qDfFd8ap457w3XVntdvqcwBGxBoTvJQH9KGVKL/fB+h2k3C8AqiVxvUQKN1Ps/Ns46CNViOpVDhfQ==",
+ "dependencies": {
+ "is-nan": "^1.3.2",
+ "luxon": "^1.26.0"
+ },
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
+ "node_modules/cropperjs": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/cropperjs/-/cropperjs-1.6.0.tgz",
+ "integrity": "sha512-BzLU/ecrfsbflwxgu+o7sQTrTlo52pVRZkTVrugEK5uyj6n8qKwAHP4s6+DWHqlXLqQ5B9+cM2MKeXiNfAsF6Q=="
+ },
+ "node_modules/cross-env": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
+ "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
+ "dependencies": {
+ "cross-spawn": "^7.0.1"
+ },
+ "bin": {
+ "cross-env": "src/bin/cross-env.js",
+ "cross-env-shell": "src/bin/cross-env-shell.js"
+ },
+ "engines": {
+ "node": ">=10.14",
+ "npm": ">=6",
+ "yarn": ">=1"
+ }
+ },
+ "node_modules/cross-spawn": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
+ "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "dependencies": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/crypt": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
+ "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==",
+ "dev": true,
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/crypto-random-string": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz",
+ "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/css-color-keywords": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz",
+ "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/css-loader": {
+ "version": "6.8.1",
+ "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.8.1.tgz",
+ "integrity": "sha512-xDAXtEVGlD0gJ07iclwWVkLoZOpEvAWaSyf6W18S2pOC//K8+qUDIx8IIT3D+HjnmkJPQeesOPv5aiUaJsCM2g==",
+ "dependencies": {
+ "icss-utils": "^5.1.0",
+ "postcss": "^8.4.21",
+ "postcss-modules-extract-imports": "^3.0.0",
+ "postcss-modules-local-by-default": "^4.0.3",
+ "postcss-modules-scope": "^3.0.0",
+ "postcss-modules-values": "^4.0.0",
+ "postcss-value-parser": "^4.2.0",
+ "semver": "^7.3.8"
+ },
+ "engines": {
+ "node": ">= 12.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "webpack": "^5.0.0"
+ }
+ },
+ "node_modules/css-select": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz",
+ "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==",
+ "dev": true,
+ "dependencies": {
+ "boolbase": "^1.0.0",
+ "css-what": "^6.1.0",
+ "domhandler": "^5.0.2",
+ "domutils": "^3.0.1",
+ "nth-check": "^2.0.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/fb55"
+ }
+ },
+ "node_modules/css-to-react-native": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz",
+ "integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==",
+ "dependencies": {
+ "camelize": "^1.0.0",
+ "css-color-keywords": "^1.0.0",
+ "postcss-value-parser": "^4.0.2"
+ }
+ },
+ "node_modules/css-what": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz",
+ "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==",
+ "engines": {
+ "node": ">= 6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/fb55"
+ }
+ },
+ "node_modules/cssesc": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
+ "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
+ "bin": {
+ "cssesc": "bin/cssesc"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/cssfilter": {
+ "version": "0.0.10",
+ "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz",
+ "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw=="
+ },
+ "node_modules/cssom": {
+ "version": "0.4.4",
+ "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz",
+ "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==",
+ "dev": true
+ },
+ "node_modules/cssstyle": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz",
+ "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==",
+ "dev": true,
+ "dependencies": {
+ "cssom": "~0.3.6"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/cssstyle/node_modules/cssom": {
+ "version": "0.3.8",
+ "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz",
+ "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==",
+ "dev": true
+ },
+ "node_modules/csstype": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz",
+ "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ=="
+ },
+ "node_modules/damerau-levenshtein": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz",
+ "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==",
+ "dev": true
+ },
+ "node_modules/data-uri-to-buffer": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
+ "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/data-urls": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz",
+ "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==",
+ "dev": true,
+ "dependencies": {
+ "abab": "^2.0.3",
+ "whatwg-mimetype": "^2.3.0",
+ "whatwg-url": "^8.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/date-fns": {
+ "version": "2.30.0",
+ "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz",
+ "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==",
+ "dependencies": {
+ "@babel/runtime": "^7.21.0"
+ },
+ "engines": {
+ "node": ">=0.11"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/date-fns"
+ }
+ },
+ "node_modules/dateformat": {
+ "version": "4.6.3",
+ "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz",
+ "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/debug": {
+ "version": "4.3.4",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
+ "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
+ "dependencies": {
+ "ms": "2.1.2"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/decamelize": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
+ "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/decimal.js": {
+ "version": "10.4.3",
+ "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz",
+ "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==",
+ "dev": true
+ },
+ "node_modules/decode-named-character-reference": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz",
+ "integrity": "sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==",
+ "dependencies": {
+ "character-entities": "^2.0.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/decode-uri-component": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz",
+ "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==",
+ "engines": {
+ "node": ">=0.10"
+ }
+ },
+ "node_modules/decompress-response": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
+ "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
+ "dependencies": {
+ "mimic-response": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/dedent": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz",
+ "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==",
+ "dev": true,
+ "peerDependencies": {
+ "babel-plugin-macros": "^3.1.0"
+ },
+ "peerDependenciesMeta": {
+ "babel-plugin-macros": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/deep-equal": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz",
+ "integrity": "sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw=="
+ },
+ "node_modules/deep-extend": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
+ "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/deep-is": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
+ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
+ "dev": true
+ },
+ "node_modules/deepmerge": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
+ "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/default-gateway": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz",
+ "integrity": "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==",
+ "dependencies": {
+ "execa": "^5.0.0"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/default-require-extensions": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz",
+ "integrity": "sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==",
+ "dev": true,
+ "dependencies": {
+ "strip-bom": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/defaults": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz",
+ "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==",
+ "dependencies": {
+ "clone": "^1.0.2"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/defer-to-connect": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz",
+ "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==",
+ "dev": true
+ },
+ "node_modules/define-data-property": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz",
+ "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==",
+ "dependencies": {
+ "get-intrinsic": "^1.2.1",
+ "gopd": "^1.0.1",
+ "has-property-descriptors": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/define-lazy-prop": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
+ "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/define-properties": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz",
+ "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==",
+ "dependencies": {
+ "define-data-property": "^1.0.1",
+ "has-property-descriptors": "^1.0.0",
+ "object-keys": "^1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/define-property": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz",
+ "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==",
+ "dependencies": {
+ "is-descriptor": "^1.0.2",
+ "isobject": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/del": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/del/-/del-5.1.0.tgz",
+ "integrity": "sha512-wH9xOVHnczo9jN2IW68BabcecVPxacIA3g/7z6vhSU/4stOKQzeCRK0yD0A24WiAAUJmmVpWqrERcTxnLo3AnA==",
+ "dependencies": {
+ "globby": "^10.0.1",
+ "graceful-fs": "^4.2.2",
+ "is-glob": "^4.0.1",
+ "is-path-cwd": "^2.2.0",
+ "is-path-inside": "^3.0.1",
+ "p-map": "^3.0.0",
+ "rimraf": "^3.0.0",
+ "slash": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/del/node_modules/@types/glob": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz",
+ "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==",
+ "dependencies": {
+ "@types/minimatch": "*",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/del/node_modules/globby": {
+ "version": "10.0.2",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz",
+ "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==",
+ "dependencies": {
+ "@types/glob": "^7.1.1",
+ "array-union": "^2.1.0",
+ "dir-glob": "^3.0.1",
+ "fast-glob": "^3.0.3",
+ "glob": "^7.1.3",
+ "ignore": "^5.1.1",
+ "merge2": "^1.2.3",
+ "slash": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/del/node_modules/p-map": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz",
+ "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==",
+ "dependencies": {
+ "aggregate-error": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/del/node_modules/rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/delegates": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
+ "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ=="
+ },
+ "node_modules/depd": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/dequal": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
+ "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/destroy": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
+ "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
+ "engines": {
+ "node": ">= 0.8",
+ "npm": "1.2.8000 || >= 1.4.16"
+ }
+ },
+ "node_modules/detect-file": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz",
+ "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/detect-libc": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz",
+ "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/detect-newline": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz",
+ "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/detect-node": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz",
+ "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g=="
+ },
+ "node_modules/detect-node-es": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz",
+ "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ=="
+ },
+ "node_modules/devcert": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/devcert/-/devcert-1.2.2.tgz",
+ "integrity": "sha512-UsLqvtJGPiGwsIZnJINUnFYaWgK7CroreGRndWHZkRD58tPFr3pVbbSyHR8lbh41+azR4jKvuNZ+eCoBZGA5kA==",
+ "dev": true,
+ "dependencies": {
+ "@types/configstore": "^2.1.1",
+ "@types/debug": "^0.0.30",
+ "@types/get-port": "^3.2.0",
+ "@types/glob": "^5.0.34",
+ "@types/lodash": "^4.14.92",
+ "@types/mkdirp": "^0.5.2",
+ "@types/node": "^8.5.7",
+ "@types/rimraf": "^2.0.2",
+ "@types/tmp": "^0.0.33",
+ "application-config-path": "^0.1.0",
+ "command-exists": "^1.2.4",
+ "debug": "^3.1.0",
+ "eol": "^0.9.1",
+ "get-port": "^3.2.0",
+ "glob": "^7.1.2",
+ "is-valid-domain": "^0.1.6",
+ "lodash": "^4.17.4",
+ "mkdirp": "^0.5.1",
+ "password-prompt": "^1.0.4",
+ "rimraf": "^2.6.2",
+ "sudo-prompt": "^8.2.0",
+ "tmp": "^0.0.33",
+ "tslib": "^1.10.0"
+ }
+ },
+ "node_modules/devcert/node_modules/@types/node": {
+ "version": "8.10.66",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz",
+ "integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==",
+ "dev": true
+ },
+ "node_modules/devcert/node_modules/debug": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+ "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.1"
+ }
+ },
+ "node_modules/devcert/node_modules/get-port": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz",
+ "integrity": "sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/devcert/node_modules/rimraf": {
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
+ "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
+ "dev": true,
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ }
+ },
+ "node_modules/devcert/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "dev": true
+ },
+ "node_modules/diagnostic-channel": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/diagnostic-channel/-/diagnostic-channel-1.1.1.tgz",
+ "integrity": "sha512-r2HV5qFkUICyoaKlBEpLKHjxMXATUf/l+h8UZPGBHGLy4DDiY2sOLcIctax4eRnTw5wH2jTMExLntGPJ8eOJxw==",
+ "dependencies": {
+ "semver": "^7.5.3"
+ }
+ },
+ "node_modules/diagnostic-channel-publishers": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/diagnostic-channel-publishers/-/diagnostic-channel-publishers-1.0.7.tgz",
+ "integrity": "sha512-SEECbY5AiVt6DfLkhkaHNeshg1CogdLLANA8xlG/TKvS+XUgvIKl7VspJGYiEdL5OUyzMVnr7o0AwB7f+/Mjtg==",
+ "peerDependencies": {
+ "diagnostic-channel": "*"
+ }
+ },
+ "node_modules/dicer": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.3.0.tgz",
+ "integrity": "sha512-MdceRRWqltEG2dZqO769g27N/3PXfcKl04VhYnBlo2YhH7zPi88VebsjTKclaOyiuMaGU72hTfw3VkUitGcVCA==",
+ "dependencies": {
+ "streamsearch": "0.1.2"
+ },
+ "engines": {
+ "node": ">=4.5.0"
+ }
+ },
+ "node_modules/did-you-mean": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/did-you-mean/-/did-you-mean-0.0.1.tgz",
+ "integrity": "sha512-rKxPpbrHr4/u8VMPde6Z3DhbGoXw7kepHZIU2FGs+IU+LKnhEIlw1cx80FZ7fLruJXDyu0slKMai2FhPRZjwxQ==",
+ "dev": true,
+ "dependencies": {
+ "levenshtein": "*",
+ "underscore": "*"
+ }
+ },
+ "node_modules/diff": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
+ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.3.1"
+ }
+ },
+ "node_modules/diff-sequences": {
+ "version": "29.6.3",
+ "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz",
+ "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==",
+ "dev": true,
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/dir-glob": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
+ "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
+ "dependencies": {
+ "path-type": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/dkim-signer": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/dkim-signer/-/dkim-signer-0.2.2.tgz",
+ "integrity": "sha512-24OZ3cCA30UTRz+Plpg+ibfPq3h7tDtsJRg75Bo0pGakZePXcPBddY80bKi1Bi7Jsz7tL5Cw527mhCRDvNFgfg==",
+ "dependencies": {
+ "libmime": "^2.0.3"
+ }
+ },
+ "node_modules/dnd-core": {
+ "version": "15.1.2",
+ "resolved": "https://registry.npmjs.org/dnd-core/-/dnd-core-15.1.2.tgz",
+ "integrity": "sha512-EOec1LyJUuGRFg0LDa55rSRAUe97uNVKVkUo8iyvzQlcECYTuPblVQfRWXWj1OyPseFIeebWpNmKFy0h6BcF1A==",
+ "dependencies": {
+ "@react-dnd/asap": "4.0.1",
+ "@react-dnd/invariant": "3.0.1",
+ "redux": "^4.1.2"
+ }
+ },
+ "node_modules/dns-equal": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz",
+ "integrity": "sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg=="
+ },
+ "node_modules/dns-packet": {
+ "version": "5.6.1",
+ "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz",
+ "integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==",
+ "dependencies": {
+ "@leichtgewicht/ip-codec": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/doctrine": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
+ "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
+ "dev": true,
+ "dependencies": {
+ "esutils": "^2.0.2"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/dom-converter": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz",
+ "integrity": "sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA==",
+ "dependencies": {
+ "utila": "~0.4"
+ }
+ },
+ "node_modules/dom-helpers": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz",
+ "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==",
+ "dependencies": {
+ "@babel/runtime": "^7.8.7",
+ "csstype": "^3.0.2"
+ }
+ },
+ "node_modules/dom-serializer": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz",
+ "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==",
+ "dependencies": {
+ "domelementtype": "^2.3.0",
+ "domhandler": "^5.0.2",
+ "entities": "^4.2.0"
+ },
+ "funding": {
+ "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
+ }
+ },
+ "node_modules/domelementtype": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
+ "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fb55"
+ }
+ ]
+ },
+ "node_modules/domexception": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz",
+ "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==",
+ "dev": true,
+ "dependencies": {
+ "webidl-conversions": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/domexception/node_modules/webidl-conversions": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz",
+ "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/domhandler": {
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
+ "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
+ "dependencies": {
+ "domelementtype": "^2.3.0"
+ },
+ "engines": {
+ "node": ">= 4"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/domhandler?sponsor=1"
+ }
+ },
+ "node_modules/domutils": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz",
+ "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==",
+ "dependencies": {
+ "dom-serializer": "^2.0.0",
+ "domelementtype": "^2.3.0",
+ "domhandler": "^5.0.3"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/domutils?sponsor=1"
+ }
+ },
+ "node_modules/dot-case": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-2.1.1.tgz",
+ "integrity": "sha512-HnM6ZlFqcajLsyudHq7LeeLDr2rFAVYtDv/hV5qchQEidSck8j9OPUsXY9KwJv/lHMtYlX4DjRQqwFYa+0r8Ug==",
+ "dependencies": {
+ "no-case": "^2.2.0"
+ }
+ },
+ "node_modules/dot-prop": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz",
+ "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==",
+ "dependencies": {
+ "is-obj": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/dotenv": {
+ "version": "16.3.1",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
+ "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/motdotla/dotenv?sponsor=1"
+ }
+ },
+ "node_modules/dotenv-expand": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-10.0.0.tgz",
+ "integrity": "sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/duplexer3": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz",
+ "integrity": "sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==",
+ "dev": true
+ },
+ "node_modules/eastasianwidth": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
+ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
+ "dev": true
+ },
+ "node_modules/ecdsa-sig-formatter": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
+ "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",
+ "dependencies": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/ee-first": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
+ },
+ "node_modules/electron-to-chromium": {
+ "version": "1.4.531",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.531.tgz",
+ "integrity": "sha512-H6gi5E41Rn3/mhKlPaT1aIMg/71hTAqn0gYEllSuw9igNWtvQwu185jiCZoZD29n7Zukgh7GVZ3zGf0XvkhqjQ=="
+ },
+ "node_modules/elliptic": {
+ "version": "6.5.4",
+ "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
+ "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",
+ "dependencies": {
+ "bn.js": "^4.11.9",
+ "brorand": "^1.1.0",
+ "hash.js": "^1.0.0",
+ "hmac-drbg": "^1.0.1",
+ "inherits": "^2.0.4",
+ "minimalistic-assert": "^1.0.1",
+ "minimalistic-crypto-utils": "^1.0.1"
+ }
+ },
+ "node_modules/emitter-listener": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/emitter-listener/-/emitter-listener-1.1.2.tgz",
+ "integrity": "sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ==",
+ "dependencies": {
+ "shimmer": "^1.2.0"
+ }
+ },
+ "node_modules/emittery": {
+ "version": "0.13.1",
+ "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz",
+ "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/emittery?sponsor=1"
+ }
+ },
+ "node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
+ },
+ "node_modules/emojis-list": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
+ "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/enabled": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz",
+ "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ=="
+ },
+ "node_modules/encodeurl": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
+ "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/encoding": {
+ "version": "0.1.13",
+ "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",
+ "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",
+ "optional": true,
+ "dependencies": {
+ "iconv-lite": "^0.6.2"
+ }
+ },
+ "node_modules/encoding/node_modules/iconv-lite": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
+ "optional": true,
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/end-of-stream": {
+ "version": "1.4.4",
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
+ "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
+ "dependencies": {
+ "once": "^1.4.0"
+ }
+ },
+ "node_modules/enhanced-resolve": {
+ "version": "5.15.0",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz",
+ "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==",
+ "dependencies": {
+ "graceful-fs": "^4.2.4",
+ "tapable": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/entities": {
+ "version": "4.5.0",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
+ "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
+ "engines": {
+ "node": ">=0.12"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
+ "node_modules/env-paths": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
+ "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/envinfo": {
+ "version": "7.10.0",
+ "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.10.0.tgz",
+ "integrity": "sha512-ZtUjZO6l5mwTHvc1L9+1q5p/R3wTopcfqMW8r5t8SJSKqeVI/LtajORwRFEKpEFuekjD0VBjwu1HMxL4UalIRw==",
+ "bin": {
+ "envinfo": "dist/cli.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/eol": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/eol/-/eol-0.9.1.tgz",
+ "integrity": "sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==",
+ "dev": true
+ },
+ "node_modules/err-code": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz",
+ "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==",
+ "dev": true
+ },
+ "node_modules/errno": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz",
+ "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==",
+ "optional": true,
+ "dependencies": {
+ "prr": "~1.0.1"
+ },
+ "bin": {
+ "errno": "cli.js"
+ }
+ },
+ "node_modules/error-ex": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
+ "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
+ "dependencies": {
+ "is-arrayish": "^0.2.1"
+ }
+ },
+ "node_modules/error-stack-parser": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz",
+ "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==",
+ "dependencies": {
+ "stackframe": "^1.3.4"
+ }
+ },
+ "node_modules/es-abstract": {
+ "version": "1.22.2",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz",
+ "integrity": "sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA==",
+ "dev": true,
+ "dependencies": {
+ "array-buffer-byte-length": "^1.0.0",
+ "arraybuffer.prototype.slice": "^1.0.2",
+ "available-typed-arrays": "^1.0.5",
+ "call-bind": "^1.0.2",
+ "es-set-tostringtag": "^2.0.1",
+ "es-to-primitive": "^1.2.1",
+ "function.prototype.name": "^1.1.6",
+ "get-intrinsic": "^1.2.1",
+ "get-symbol-description": "^1.0.0",
+ "globalthis": "^1.0.3",
+ "gopd": "^1.0.1",
+ "has": "^1.0.3",
+ "has-property-descriptors": "^1.0.0",
+ "has-proto": "^1.0.1",
+ "has-symbols": "^1.0.3",
+ "internal-slot": "^1.0.5",
+ "is-array-buffer": "^3.0.2",
+ "is-callable": "^1.2.7",
+ "is-negative-zero": "^2.0.2",
+ "is-regex": "^1.1.4",
+ "is-shared-array-buffer": "^1.0.2",
+ "is-string": "^1.0.7",
+ "is-typed-array": "^1.1.12",
+ "is-weakref": "^1.0.2",
+ "object-inspect": "^1.12.3",
+ "object-keys": "^1.1.1",
+ "object.assign": "^4.1.4",
+ "regexp.prototype.flags": "^1.5.1",
+ "safe-array-concat": "^1.0.1",
+ "safe-regex-test": "^1.0.0",
+ "string.prototype.trim": "^1.2.8",
+ "string.prototype.trimend": "^1.0.7",
+ "string.prototype.trimstart": "^1.0.7",
+ "typed-array-buffer": "^1.0.0",
+ "typed-array-byte-length": "^1.0.0",
+ "typed-array-byte-offset": "^1.0.0",
+ "typed-array-length": "^1.0.4",
+ "unbox-primitive": "^1.0.2",
+ "which-typed-array": "^1.1.11"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/es-iterator-helpers": {
+ "version": "1.0.15",
+ "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.15.tgz",
+ "integrity": "sha512-GhoY8uYqd6iwUl2kgjTm4CZAf6oo5mHK7BPqx3rKgx893YSsy0LGHV6gfqqQvZt/8xM8xeOnfXBCfqclMKkJ5g==",
+ "dev": true,
+ "dependencies": {
+ "asynciterator.prototype": "^1.0.0",
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.1",
+ "es-abstract": "^1.22.1",
+ "es-set-tostringtag": "^2.0.1",
+ "function-bind": "^1.1.1",
+ "get-intrinsic": "^1.2.1",
+ "globalthis": "^1.0.3",
+ "has-property-descriptors": "^1.0.0",
+ "has-proto": "^1.0.1",
+ "has-symbols": "^1.0.3",
+ "internal-slot": "^1.0.5",
+ "iterator.prototype": "^1.1.2",
+ "safe-array-concat": "^1.0.1"
+ }
+ },
+ "node_modules/es-module-lexer": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.1.tgz",
+ "integrity": "sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q=="
+ },
+ "node_modules/es-set-tostringtag": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz",
+ "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==",
+ "dev": true,
+ "dependencies": {
+ "get-intrinsic": "^1.1.3",
+ "has": "^1.0.3",
+ "has-tostringtag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-shim-unscopables": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz",
+ "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==",
+ "dev": true,
+ "dependencies": {
+ "has": "^1.0.3"
+ }
+ },
+ "node_modules/es-to-primitive": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
+ "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
+ "dev": true,
+ "dependencies": {
+ "is-callable": "^1.1.4",
+ "is-date-object": "^1.0.1",
+ "is-symbol": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/es6-error": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz",
+ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
+ "dev": true
+ },
+ "node_modules/es6-promisify": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-7.0.0.tgz",
+ "integrity": "sha512-ginqzK3J90Rd4/Yz7qRrqUeIpe3TwSXTPPZtPne7tGBPeAaQiU8qt4fpKApnxHcq1AwtUdHVg5P77x/yrggG8Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/esbuild": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.17.tgz",
+ "integrity": "sha512-1GJtYnUxsJreHYA0Y+iQz2UEykonY66HNWOb0yXYZi9/kNrORUEHVg87eQsCtqh59PEJ5YVZJO98JHznMJSWjg==",
+ "hasInstallScript": true,
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "optionalDependencies": {
+ "@esbuild/android-arm": "0.18.17",
+ "@esbuild/android-arm64": "0.18.17",
+ "@esbuild/android-x64": "0.18.17",
+ "@esbuild/darwin-arm64": "0.18.17",
+ "@esbuild/darwin-x64": "0.18.17",
+ "@esbuild/freebsd-arm64": "0.18.17",
+ "@esbuild/freebsd-x64": "0.18.17",
+ "@esbuild/linux-arm": "0.18.17",
+ "@esbuild/linux-arm64": "0.18.17",
+ "@esbuild/linux-ia32": "0.18.17",
+ "@esbuild/linux-loong64": "0.18.17",
+ "@esbuild/linux-mips64el": "0.18.17",
+ "@esbuild/linux-ppc64": "0.18.17",
+ "@esbuild/linux-riscv64": "0.18.17",
+ "@esbuild/linux-s390x": "0.18.17",
+ "@esbuild/linux-x64": "0.18.17",
+ "@esbuild/netbsd-x64": "0.18.17",
+ "@esbuild/openbsd-x64": "0.18.17",
+ "@esbuild/sunos-x64": "0.18.17",
+ "@esbuild/win32-arm64": "0.18.17",
+ "@esbuild/win32-ia32": "0.18.17",
+ "@esbuild/win32-x64": "0.18.17"
+ }
+ },
+ "node_modules/esbuild-loader": {
+ "version": "2.21.0",
+ "resolved": "https://registry.npmjs.org/esbuild-loader/-/esbuild-loader-2.21.0.tgz",
+ "integrity": "sha512-k7ijTkCT43YBSZ6+fBCW1Gin7s46RrJ0VQaM8qA7lq7W+OLsGgtLyFV8470FzYi/4TeDexniTBTPTwZUnXXR5g==",
+ "dependencies": {
+ "esbuild": "^0.16.17",
+ "joycon": "^3.0.1",
+ "json5": "^2.2.0",
+ "loader-utils": "^2.0.0",
+ "tapable": "^2.2.0",
+ "webpack-sources": "^1.4.3"
+ },
+ "funding": {
+ "url": "https://github.com/privatenumber/esbuild-loader?sponsor=1"
+ },
+ "peerDependencies": {
+ "webpack": "^4.40.0 || ^5.0.0"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/android-arm": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.17.tgz",
+ "integrity": "sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/android-arm64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.17.tgz",
+ "integrity": "sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/android-x64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.17.tgz",
+ "integrity": "sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/darwin-arm64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.17.tgz",
+ "integrity": "sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/darwin-x64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz",
+ "integrity": "sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.17.tgz",
+ "integrity": "sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/freebsd-x64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.17.tgz",
+ "integrity": "sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/linux-arm": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.17.tgz",
+ "integrity": "sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/linux-arm64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.17.tgz",
+ "integrity": "sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/linux-ia32": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.17.tgz",
+ "integrity": "sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/linux-loong64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.17.tgz",
+ "integrity": "sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==",
+ "cpu": [
+ "loong64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/linux-mips64el": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.17.tgz",
+ "integrity": "sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/linux-ppc64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.17.tgz",
+ "integrity": "sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==",
+ "cpu": [
+ "ppc64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/linux-riscv64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.17.tgz",
+ "integrity": "sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==",
+ "cpu": [
+ "riscv64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/linux-s390x": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.17.tgz",
+ "integrity": "sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==",
+ "cpu": [
+ "s390x"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/linux-x64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.17.tgz",
+ "integrity": "sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/netbsd-x64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.17.tgz",
+ "integrity": "sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/openbsd-x64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.17.tgz",
+ "integrity": "sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/sunos-x64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.17.tgz",
+ "integrity": "sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/win32-arm64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.17.tgz",
+ "integrity": "sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/win32-ia32": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.17.tgz",
+ "integrity": "sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/@esbuild/win32-x64": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.17.tgz",
+ "integrity": "sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/esbuild": {
+ "version": "0.16.17",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.17.tgz",
+ "integrity": "sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==",
+ "hasInstallScript": true,
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "optionalDependencies": {
+ "@esbuild/android-arm": "0.16.17",
+ "@esbuild/android-arm64": "0.16.17",
+ "@esbuild/android-x64": "0.16.17",
+ "@esbuild/darwin-arm64": "0.16.17",
+ "@esbuild/darwin-x64": "0.16.17",
+ "@esbuild/freebsd-arm64": "0.16.17",
+ "@esbuild/freebsd-x64": "0.16.17",
+ "@esbuild/linux-arm": "0.16.17",
+ "@esbuild/linux-arm64": "0.16.17",
+ "@esbuild/linux-ia32": "0.16.17",
+ "@esbuild/linux-loong64": "0.16.17",
+ "@esbuild/linux-mips64el": "0.16.17",
+ "@esbuild/linux-ppc64": "0.16.17",
+ "@esbuild/linux-riscv64": "0.16.17",
+ "@esbuild/linux-s390x": "0.16.17",
+ "@esbuild/linux-x64": "0.16.17",
+ "@esbuild/netbsd-x64": "0.16.17",
+ "@esbuild/openbsd-x64": "0.16.17",
+ "@esbuild/sunos-x64": "0.16.17",
+ "@esbuild/win32-arm64": "0.16.17",
+ "@esbuild/win32-ia32": "0.16.17",
+ "@esbuild/win32-x64": "0.16.17"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/loader-utils": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
+ "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
+ "dependencies": {
+ "big.js": "^5.2.2",
+ "emojis-list": "^3.0.0",
+ "json5": "^2.1.2"
+ },
+ "engines": {
+ "node": ">=8.9.0"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/esbuild-loader/node_modules/webpack-sources": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",
+ "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==",
+ "dependencies": {
+ "source-list-map": "^2.0.0",
+ "source-map": "~0.6.1"
+ }
+ },
+ "node_modules/esbuild-wasm": {
+ "version": "0.18.17",
+ "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.18.17.tgz",
+ "integrity": "sha512-9OHGcuRzy+I8ziF9FzjfKLWAPbvi0e/metACVg9k6bK+SI4FFxeV6PcZsz8RIVaMD4YNehw+qj6UMR3+qj/EuQ==",
+ "dev": true,
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/escalade": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
+ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/escape-goat": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz",
+ "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
+ },
+ "node_modules/escape-string-regexp": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
+ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/escodegen": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz",
+ "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==",
+ "dev": true,
+ "dependencies": {
+ "esprima": "^4.0.1",
+ "estraverse": "^5.2.0",
+ "esutils": "^2.0.2"
+ },
+ "bin": {
+ "escodegen": "bin/escodegen.js",
+ "esgenerate": "bin/esgenerate.js"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "optionalDependencies": {
+ "source-map": "~0.6.1"
+ }
+ },
+ "node_modules/escodegen/node_modules/estraverse": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+ "dev": true,
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/escodegen/node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true,
+ "optional": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/eslint": {
+ "version": "8.50.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz",
+ "integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==",
+ "dev": true,
+ "dependencies": {
+ "@eslint-community/eslint-utils": "^4.2.0",
+ "@eslint-community/regexpp": "^4.6.1",
+ "@eslint/eslintrc": "^2.1.2",
+ "@eslint/js": "8.50.0",
+ "@humanwhocodes/config-array": "^0.11.11",
+ "@humanwhocodes/module-importer": "^1.0.1",
+ "@nodelib/fs.walk": "^1.2.8",
+ "ajv": "^6.12.4",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.2",
+ "debug": "^4.3.2",
+ "doctrine": "^3.0.0",
+ "escape-string-regexp": "^4.0.0",
+ "eslint-scope": "^7.2.2",
+ "eslint-visitor-keys": "^3.4.3",
+ "espree": "^9.6.1",
+ "esquery": "^1.4.2",
+ "esutils": "^2.0.2",
+ "fast-deep-equal": "^3.1.3",
+ "file-entry-cache": "^6.0.1",
+ "find-up": "^5.0.0",
+ "glob-parent": "^6.0.2",
+ "globals": "^13.19.0",
+ "graphemer": "^1.4.0",
+ "ignore": "^5.2.0",
+ "imurmurhash": "^0.1.4",
+ "is-glob": "^4.0.0",
+ "is-path-inside": "^3.0.3",
+ "js-yaml": "^4.1.0",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "levn": "^0.4.1",
+ "lodash.merge": "^4.6.2",
+ "minimatch": "^3.1.2",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.9.3",
+ "strip-ansi": "^6.0.1",
+ "text-table": "^0.2.0"
+ },
+ "bin": {
+ "eslint": "bin/eslint.js"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/eslint-config-next": {
+ "version": "13.5.3",
+ "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.5.3.tgz",
+ "integrity": "sha512-VN2qbCpq2DMWgs7SVF8KTmc8bVaWz3s4nmcFqRLs7PNBt5AXejOhJuZ4zg2sCEHOvz5RvqdwLeI++NSCV6qHVg==",
+ "dev": true,
+ "dependencies": {
+ "@next/eslint-plugin-next": "13.5.3",
+ "@rushstack/eslint-patch": "^1.3.3",
+ "@typescript-eslint/parser": "^5.4.2 || ^6.0.0",
+ "eslint-import-resolver-node": "^0.3.6",
+ "eslint-import-resolver-typescript": "^3.5.2",
+ "eslint-plugin-import": "^2.28.1",
+ "eslint-plugin-jsx-a11y": "^6.7.1",
+ "eslint-plugin-react": "^7.33.2",
+ "eslint-plugin-react-hooks": "^4.5.0 || 5.0.0-canary-7118f5dd7-20230705"
+ },
+ "peerDependencies": {
+ "eslint": "^7.23.0 || ^8.0.0",
+ "typescript": ">=3.3.1"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/eslint-config-prettier": {
+ "version": "8.10.0",
+ "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz",
+ "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==",
+ "dev": true,
+ "bin": {
+ "eslint-config-prettier": "bin/cli.js"
+ },
+ "peerDependencies": {
+ "eslint": ">=7.0.0"
+ }
+ },
+ "node_modules/eslint-import-resolver-node": {
+ "version": "0.3.9",
+ "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz",
+ "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==",
+ "dev": true,
+ "dependencies": {
+ "debug": "^3.2.7",
+ "is-core-module": "^2.13.0",
+ "resolve": "^1.22.4"
+ }
+ },
+ "node_modules/eslint-import-resolver-node/node_modules/debug": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+ "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.1"
+ }
+ },
+ "node_modules/eslint-import-resolver-node/node_modules/resolve": {
+ "version": "1.22.6",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz",
+ "integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==",
+ "dev": true,
+ "dependencies": {
+ "is-core-module": "^2.13.0",
+ "path-parse": "^1.0.7",
+ "supports-preserve-symlinks-flag": "^1.0.0"
+ },
+ "bin": {
+ "resolve": "bin/resolve"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/eslint-import-resolver-typescript": {
+ "version": "3.6.1",
+ "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz",
+ "integrity": "sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==",
+ "dev": true,
+ "dependencies": {
+ "debug": "^4.3.4",
+ "enhanced-resolve": "^5.12.0",
+ "eslint-module-utils": "^2.7.4",
+ "fast-glob": "^3.3.1",
+ "get-tsconfig": "^4.5.0",
+ "is-core-module": "^2.11.0",
+ "is-glob": "^4.0.3"
+ },
+ "engines": {
+ "node": "^14.18.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts"
+ },
+ "peerDependencies": {
+ "eslint": "*",
+ "eslint-plugin-import": "*"
+ }
+ },
+ "node_modules/eslint-module-utils": {
+ "version": "2.8.0",
+ "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz",
+ "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==",
+ "dev": true,
+ "dependencies": {
+ "debug": "^3.2.7"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "peerDependenciesMeta": {
+ "eslint": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/eslint-module-utils/node_modules/debug": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+ "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.1"
+ }
+ },
+ "node_modules/eslint-plugin-import": {
+ "version": "2.28.1",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz",
+ "integrity": "sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==",
+ "dev": true,
+ "dependencies": {
+ "array-includes": "^3.1.6",
+ "array.prototype.findlastindex": "^1.2.2",
+ "array.prototype.flat": "^1.3.1",
+ "array.prototype.flatmap": "^1.3.1",
+ "debug": "^3.2.7",
+ "doctrine": "^2.1.0",
+ "eslint-import-resolver-node": "^0.3.7",
+ "eslint-module-utils": "^2.8.0",
+ "has": "^1.0.3",
+ "is-core-module": "^2.13.0",
+ "is-glob": "^4.0.3",
+ "minimatch": "^3.1.2",
+ "object.fromentries": "^2.0.6",
+ "object.groupby": "^1.0.0",
+ "object.values": "^1.1.6",
+ "semver": "^6.3.1",
+ "tsconfig-paths": "^3.14.2"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "peerDependencies": {
+ "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8"
+ }
+ },
+ "node_modules/eslint-plugin-import/node_modules/debug": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+ "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.1"
+ }
+ },
+ "node_modules/eslint-plugin-import/node_modules/doctrine": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
+ "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
+ "dev": true,
+ "dependencies": {
+ "esutils": "^2.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/eslint-plugin-import/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/eslint-plugin-jsx-a11y": {
+ "version": "6.7.1",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.7.1.tgz",
+ "integrity": "sha512-63Bog4iIethyo8smBklORknVjB0T2dwB8Mr/hIC+fBS0uyHdYYpzM/Ed+YC8VxTjlXHEWFOdmgwcDn1U2L9VCA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/runtime": "^7.20.7",
+ "aria-query": "^5.1.3",
+ "array-includes": "^3.1.6",
+ "array.prototype.flatmap": "^1.3.1",
+ "ast-types-flow": "^0.0.7",
+ "axe-core": "^4.6.2",
+ "axobject-query": "^3.1.1",
+ "damerau-levenshtein": "^1.0.8",
+ "emoji-regex": "^9.2.2",
+ "has": "^1.0.3",
+ "jsx-ast-utils": "^3.3.3",
+ "language-tags": "=1.0.5",
+ "minimatch": "^3.1.2",
+ "object.entries": "^1.1.6",
+ "object.fromentries": "^2.0.6",
+ "semver": "^6.3.0"
+ },
+ "engines": {
+ "node": ">=4.0"
+ },
+ "peerDependencies": {
+ "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8"
+ }
+ },
+ "node_modules/eslint-plugin-jsx-a11y/node_modules/emoji-regex": {
+ "version": "9.2.2",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
+ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
+ "dev": true
+ },
+ "node_modules/eslint-plugin-jsx-a11y/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/eslint-plugin-prettier": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz",
+ "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==",
+ "dev": true,
+ "dependencies": {
+ "prettier-linter-helpers": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "eslint": ">=7.28.0",
+ "prettier": ">=2.0.0"
+ },
+ "peerDependenciesMeta": {
+ "eslint-config-prettier": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/eslint-plugin-react": {
+ "version": "7.33.2",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz",
+ "integrity": "sha512-73QQMKALArI8/7xGLNI/3LylrEYrlKZSb5C9+q3OtOewTnMQi5cT+aE9E41sLCmli3I9PGGmD1yiZydyo4FEPw==",
+ "dev": true,
+ "dependencies": {
+ "array-includes": "^3.1.6",
+ "array.prototype.flatmap": "^1.3.1",
+ "array.prototype.tosorted": "^1.1.1",
+ "doctrine": "^2.1.0",
+ "es-iterator-helpers": "^1.0.12",
+ "estraverse": "^5.3.0",
+ "jsx-ast-utils": "^2.4.1 || ^3.0.0",
+ "minimatch": "^3.1.2",
+ "object.entries": "^1.1.6",
+ "object.fromentries": "^2.0.6",
+ "object.hasown": "^1.1.2",
+ "object.values": "^1.1.6",
+ "prop-types": "^15.8.1",
+ "resolve": "^2.0.0-next.4",
+ "semver": "^6.3.1",
+ "string.prototype.matchall": "^4.0.8"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "peerDependencies": {
+ "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8"
+ }
+ },
+ "node_modules/eslint-plugin-react-hooks": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz",
+ "integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0"
+ }
+ },
+ "node_modules/eslint-plugin-react/node_modules/doctrine": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
+ "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
+ "dev": true,
+ "dependencies": {
+ "esutils": "^2.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/eslint-plugin-react/node_modules/estraverse": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+ "dev": true,
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/eslint-plugin-react/node_modules/resolve": {
+ "version": "2.0.0-next.4",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz",
+ "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==",
+ "dev": true,
+ "dependencies": {
+ "is-core-module": "^2.9.0",
+ "path-parse": "^1.0.7",
+ "supports-preserve-symlinks-flag": "^1.0.0"
+ },
+ "bin": {
+ "resolve": "bin/resolve"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/eslint-plugin-react/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/eslint-scope": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
+ "dependencies": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^4.1.1"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/eslint-visitor-keys": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
+ "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
+ "dev": true,
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/eslint/node_modules/ajv": {
+ "version": "6.12.6",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "dev": true,
+ "dependencies": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/eslint/node_modules/argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "dev": true
+ },
+ "node_modules/eslint/node_modules/eslint-scope": {
+ "version": "7.2.2",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
+ "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
+ "dev": true,
+ "dependencies": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^5.2.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/eslint/node_modules/estraverse": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+ "dev": true,
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/eslint/node_modules/glob-parent": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
+ "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
+ "dev": true,
+ "dependencies": {
+ "is-glob": "^4.0.3"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/eslint/node_modules/globals": {
+ "version": "13.22.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz",
+ "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==",
+ "dev": true,
+ "dependencies": {
+ "type-fest": "^0.20.2"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/eslint/node_modules/js-yaml": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
+ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+ "dev": true,
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
+ "node_modules/eslint/node_modules/json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
+ "dev": true
+ },
+ "node_modules/eslint/node_modules/type-fest": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
+ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/esm": {
+ "version": "3.2.25",
+ "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz",
+ "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/espree": {
+ "version": "9.6.1",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
+ "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
+ "dev": true,
+ "dependencies": {
+ "acorn": "^8.9.0",
+ "acorn-jsx": "^5.3.2",
+ "eslint-visitor-keys": "^3.4.1"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/esprima": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+ "dev": true,
+ "bin": {
+ "esparse": "bin/esparse.js",
+ "esvalidate": "bin/esvalidate.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/esquery": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz",
+ "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==",
+ "dev": true,
+ "dependencies": {
+ "estraverse": "^5.1.0"
+ },
+ "engines": {
+ "node": ">=0.10"
+ }
+ },
+ "node_modules/esquery/node_modules/estraverse": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+ "dev": true,
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/esrecurse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+ "dependencies": {
+ "estraverse": "^5.2.0"
+ },
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/esrecurse/node_modules/estraverse": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/estraverse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
+ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/esutils": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/etag": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/event-target-shim": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
+ "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/eventemitter-asyncresource": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/eventemitter-asyncresource/-/eventemitter-asyncresource-1.0.0.tgz",
+ "integrity": "sha512-39F7TBIV0G7gTelxwbEqnwhp90eqCPON1k0NwNfwhgKn4Co4ybUbj2pECcXT0B3ztRKZ7Pw1JujUUgmQJHcVAQ==",
+ "dev": true
+ },
+ "node_modules/eventemitter3": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
+ },
+ "node_modules/events": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
+ "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
+ "engines": {
+ "node": ">=0.8.x"
+ }
+ },
+ "node_modules/events-to-array": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/events-to-array/-/events-to-array-1.1.2.tgz",
+ "integrity": "sha512-inRWzRY7nG+aXZxBzEqYKB3HPgwflZRopAjDCHv0whhRx+MTUr1ei0ICZUypdyE0HRm4L2d5VEcIqLD6yl+BFA==",
+ "dev": true
+ },
+ "node_modules/execa": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
+ "dependencies": {
+ "cross-spawn": "^7.0.3",
+ "get-stream": "^6.0.0",
+ "human-signals": "^2.1.0",
+ "is-stream": "^2.0.0",
+ "merge-stream": "^2.0.0",
+ "npm-run-path": "^4.0.1",
+ "onetime": "^5.1.2",
+ "signal-exit": "^3.0.3",
+ "strip-final-newline": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/execa?sponsor=1"
+ }
+ },
+ "node_modules/exit": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz",
+ "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/expand-brackets": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
+ "integrity": "sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==",
+ "dependencies": {
+ "debug": "^2.3.3",
+ "define-property": "^0.2.5",
+ "extend-shallow": "^2.0.1",
+ "posix-character-classes": "^0.1.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/expand-brackets/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/expand-brackets/node_modules/define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==",
+ "dependencies": {
+ "is-descriptor": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/expand-brackets/node_modules/extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
+ "dependencies": {
+ "is-extendable": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/expand-brackets/node_modules/is-accessor-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+ "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==",
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/expand-brackets/node_modules/is-data-descriptor": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+ "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==",
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/expand-brackets/node_modules/is-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
+ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
+ "dependencies": {
+ "is-accessor-descriptor": "^0.1.6",
+ "is-data-descriptor": "^0.1.4",
+ "kind-of": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/expand-brackets/node_modules/is-extendable": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+ "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/expand-brackets/node_modules/kind-of": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+ "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/expand-brackets/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ },
+ "node_modules/expand-template": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
+ "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/expand-tilde": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz",
+ "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==",
+ "dependencies": {
+ "homedir-polyfill": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/expect": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz",
+ "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==",
+ "dev": true,
+ "dependencies": {
+ "@jest/expect-utils": "^29.7.0",
+ "jest-get-type": "^29.6.3",
+ "jest-matcher-utils": "^29.7.0",
+ "jest-message-util": "^29.7.0",
+ "jest-util": "^29.7.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/exponential-backoff": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.1.tgz",
+ "integrity": "sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==",
+ "dev": true
+ },
+ "node_modules/express": {
+ "version": "4.18.2",
+ "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz",
+ "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==",
+ "dependencies": {
+ "accepts": "~1.3.8",
+ "array-flatten": "1.1.1",
+ "body-parser": "1.20.1",
+ "content-disposition": "0.5.4",
+ "content-type": "~1.0.4",
+ "cookie": "0.5.0",
+ "cookie-signature": "1.0.6",
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "finalhandler": "1.2.0",
+ "fresh": "0.5.2",
+ "http-errors": "2.0.0",
+ "merge-descriptors": "1.0.1",
+ "methods": "~1.1.2",
+ "on-finished": "2.4.1",
+ "parseurl": "~1.3.3",
+ "path-to-regexp": "0.1.7",
+ "proxy-addr": "~2.0.7",
+ "qs": "6.11.0",
+ "range-parser": "~1.2.1",
+ "safe-buffer": "5.2.1",
+ "send": "0.18.0",
+ "serve-static": "1.15.0",
+ "setprototypeof": "1.2.0",
+ "statuses": "2.0.1",
+ "type-is": "~1.6.18",
+ "utils-merge": "1.0.1",
+ "vary": "~1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.10.0"
+ }
+ },
+ "node_modules/express/node_modules/array-flatten": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
+ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
+ },
+ "node_modules/express/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/express/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ },
+ "node_modules/express/node_modules/qs": {
+ "version": "6.11.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
+ "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
+ "dependencies": {
+ "side-channel": "^1.0.4"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/extend": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
+ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
+ },
+ "node_modules/extend-shallow": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
+ "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==",
+ "dependencies": {
+ "assign-symbols": "^1.0.0",
+ "is-extendable": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/external-editor": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz",
+ "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==",
+ "dependencies": {
+ "chardet": "^0.7.0",
+ "iconv-lite": "^0.4.24",
+ "tmp": "^0.0.33"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/extglob": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
+ "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
+ "dependencies": {
+ "array-unique": "^0.3.2",
+ "define-property": "^1.0.0",
+ "expand-brackets": "^2.1.4",
+ "extend-shallow": "^2.0.1",
+ "fragment-cache": "^0.2.1",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/extglob/node_modules/define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==",
+ "dependencies": {
+ "is-descriptor": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/extglob/node_modules/extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
+ "dependencies": {
+ "is-extendable": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/extglob/node_modules/is-extendable": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+ "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/fast-content-type-parse": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-1.1.0.tgz",
+ "integrity": "sha512-fBHHqSTFLVnR61C+gltJuE5GkVQMV0S2nqUO8TJ+5Z3qAKG8vAx4FKai1s5jq/inV1+sREynIWSuQ6HgoSXpDQ=="
+ },
+ "node_modules/fast-copy": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/fast-copy/-/fast-copy-3.0.1.tgz",
+ "integrity": "sha512-Knr7NOtK3HWRYGtHoJrjkaWepqT8thIVGAwt0p0aUs1zqkAzXZV4vo9fFNwyb5fcqK1GKYFYxldQdIDVKhUAfA=="
+ },
+ "node_modules/fast-decode-uri-component": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz",
+ "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg=="
+ },
+ "node_modules/fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
+ },
+ "node_modules/fast-diff": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz",
+ "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==",
+ "dev": true
+ },
+ "node_modules/fast-glob": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz",
+ "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==",
+ "dependencies": {
+ "@nodelib/fs.stat": "^2.0.2",
+ "@nodelib/fs.walk": "^1.2.3",
+ "glob-parent": "^5.1.2",
+ "merge2": "^1.3.0",
+ "micromatch": "^4.0.4"
+ },
+ "engines": {
+ "node": ">=8.6.0"
+ }
+ },
+ "node_modules/fast-json-stable-stringify": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
+ },
+ "node_modules/fast-json-stringify": {
+ "version": "5.8.0",
+ "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.8.0.tgz",
+ "integrity": "sha512-VVwK8CFMSALIvt14U8AvrSzQAwN/0vaVRiFFUVlpnXSnDGrSkOAO5MtzyN8oQNjLd5AqTW5OZRgyjoNuAuR3jQ==",
+ "dependencies": {
+ "@fastify/deepmerge": "^1.0.0",
+ "ajv": "^8.10.0",
+ "ajv-formats": "^2.1.1",
+ "fast-deep-equal": "^3.1.3",
+ "fast-uri": "^2.1.0",
+ "rfdc": "^1.2.0"
+ }
+ },
+ "node_modules/fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
+ "dev": true
+ },
+ "node_modules/fast-querystring": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.1.2.tgz",
+ "integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==",
+ "dependencies": {
+ "fast-decode-uri-component": "^1.0.1"
+ }
+ },
+ "node_modules/fast-redact": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.3.0.tgz",
+ "integrity": "sha512-6T5V1QK1u4oF+ATxs1lWUmlEk6P2T9HqJG3e2DnHOdVgZy2rFJBoEnrIedcTXlkAHU/zKC+7KETJ+KGGKwxgMQ==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/fast-safe-stringify": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
+ "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA=="
+ },
+ "node_modules/fast-uri": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-2.2.0.tgz",
+ "integrity": "sha512-cIusKBIt/R/oI6z/1nyfe2FvGKVTohVRfvkOhvx0nCEW+xf5NoCXjAHcWp93uOUBchzYcsvPlrapAdX1uW+YGg=="
+ },
+ "node_modules/fast-xml-parser": {
+ "version": "4.2.5",
+ "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.2.5.tgz",
+ "integrity": "sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g==",
+ "funding": [
+ {
+ "type": "paypal",
+ "url": "https://paypal.me/naturalintelligence"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/NaturalIntelligence"
+ }
+ ],
+ "optional": true,
+ "dependencies": {
+ "strnum": "^1.0.5"
+ },
+ "bin": {
+ "fxparser": "src/cli/cli.js"
+ }
+ },
+ "node_modules/fastest-levenshtein": {
+ "version": "1.0.16",
+ "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz",
+ "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==",
+ "engines": {
+ "node": ">= 4.9.1"
+ }
+ },
+ "node_modules/fastify": {
+ "version": "4.23.2",
+ "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.23.2.tgz",
+ "integrity": "sha512-WFSxsHES115svC7NrerNqZwwM0UOxbC/P6toT9LRHgAAFvG7o2AN5W+H4ihCtOGuYXjZf4z+2jXC89rVEoPWOA==",
+ "dependencies": {
+ "@fastify/ajv-compiler": "^3.5.0",
+ "@fastify/error": "^3.2.0",
+ "@fastify/fast-json-stringify-compiler": "^4.3.0",
+ "abstract-logging": "^2.0.1",
+ "avvio": "^8.2.1",
+ "fast-content-type-parse": "^1.0.0",
+ "fast-json-stringify": "^5.7.0",
+ "find-my-way": "^7.6.0",
+ "light-my-request": "^5.9.1",
+ "pino": "^8.12.0",
+ "process-warning": "^2.2.0",
+ "proxy-addr": "^2.0.7",
+ "rfdc": "^1.3.0",
+ "secure-json-parse": "^2.5.0",
+ "semver": "^7.5.0",
+ "toad-cache": "^3.2.0"
+ }
+ },
+ "node_modules/fastify-cli": {
+ "version": "5.8.0",
+ "resolved": "https://registry.npmjs.org/fastify-cli/-/fastify-cli-5.8.0.tgz",
+ "integrity": "sha512-8J1nej1nnF6UsgRv787rl9VkUjBnYVGXcbFvuAZ3LHP6mN8Sb7+0OBzcRs3SMO6qkRax89TqOUJWVNQHZXfixw==",
+ "dependencies": {
+ "@fastify/deepmerge": "^1.2.0",
+ "chalk": "^4.1.2",
+ "chokidar": "^3.5.2",
+ "close-with-grace": "^1.1.0",
+ "commist": "^3.0.0",
+ "dotenv": "^16.0.0",
+ "fastify": "^4.0.0",
+ "fastify-plugin": "^4.0.0",
+ "generify": "^4.0.0",
+ "help-me": "^4.0.1",
+ "is-docker": "^2.0.0",
+ "make-promises-safe": "^5.1.0",
+ "pino-pretty": "^10.1.0",
+ "pkg-up": "^3.1.0",
+ "resolve-from": "^5.0.0",
+ "semver": "^7.3.5",
+ "yargs-parser": "^21.1.1"
+ },
+ "bin": {
+ "fastify": "cli.js"
+ }
+ },
+ "node_modules/fastify-plugin": {
+ "version": "4.5.1",
+ "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-4.5.1.tgz",
+ "integrity": "sha512-stRHYGeuqpEZTL1Ef0Ovr2ltazUT9g844X5z/zEBFLG8RYlpDiOCIG+ATvYEp+/zmc7sN29mcIMp8gvYplYPIQ=="
+ },
+ "node_modules/fastify-raw-body": {
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/fastify-raw-body/-/fastify-raw-body-4.2.2.tgz",
+ "integrity": "sha512-6l4fXtxNn7WOQiylu5fv9/JfUTvWCg1ED4gF44hqnVesgttOXEUMnNkdV8ZxwufCstRyUYaYSBIN4VuRHDbJkw==",
+ "dependencies": {
+ "fastify-plugin": "^4.0.0",
+ "raw-body": "^2.5.1",
+ "secure-json-parse": "^2.4.0"
+ },
+ "engines": {
+ "node": ">= 10"
+ },
+ "funding": {
+ "url": "https://github.com/Eomm/fastify-raw-body?sponsor=1"
+ }
+ },
+ "node_modules/fastify-tsconfig": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/fastify-tsconfig/-/fastify-tsconfig-1.0.1.tgz",
+ "integrity": "sha512-BXkTG3JYcjJb3xX5R5FcE9ciscV/h7YtmnkiSaNAONd1g6ooMSN/4GWfhA8hnS6SRZFYBBxsn8719Mj9lbCOtA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10.4.0"
+ }
+ },
+ "node_modules/fastq": {
+ "version": "1.15.0",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz",
+ "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==",
+ "dependencies": {
+ "reusify": "^1.0.4"
+ }
+ },
+ "node_modules/faye-websocket": {
+ "version": "0.11.4",
+ "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz",
+ "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==",
+ "dependencies": {
+ "websocket-driver": ">=0.5.1"
+ },
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/fb-watchman": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz",
+ "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==",
+ "dev": true,
+ "dependencies": {
+ "bser": "2.1.1"
+ }
+ },
+ "node_modules/fecha": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz",
+ "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw=="
+ },
+ "node_modules/fetch-blob": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
+ "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/jimmywarting"
+ },
+ {
+ "type": "paypal",
+ "url": "https://paypal.me/jimmywarting"
+ }
+ ],
+ "dependencies": {
+ "node-domexception": "^1.0.0",
+ "web-streams-polyfill": "^3.0.3"
+ },
+ "engines": {
+ "node": "^12.20 || >= 14.13"
+ }
+ },
+ "node_modules/figures": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz",
+ "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==",
+ "dependencies": {
+ "escape-string-regexp": "^1.0.5"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/figures/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/file-entry-cache": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
+ "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
+ "dev": true,
+ "dependencies": {
+ "flat-cache": "^3.0.4"
+ },
+ "engines": {
+ "node": "^10.12.0 || >=12.0.0"
+ }
+ },
+ "node_modules/fill-range": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
+ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "dependencies": {
+ "to-regex-range": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/finalhandler": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
+ "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==",
+ "dependencies": {
+ "debug": "2.6.9",
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "on-finished": "2.4.1",
+ "parseurl": "~1.3.3",
+ "statuses": "2.0.1",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/finalhandler/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/finalhandler/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ },
+ "node_modules/find-cache-dir": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-4.0.0.tgz",
+ "integrity": "sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==",
+ "dev": true,
+ "dependencies": {
+ "common-path-prefix": "^3.0.0",
+ "pkg-dir": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/find-my-way": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-7.6.2.tgz",
+ "integrity": "sha512-0OjHn1b1nCX3eVbm9ByeEHiscPYiHLfhei1wOUU9qffQkk98wE0Lo8VrVYfSGMgnSnDh86DxedduAnBf4nwUEw==",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.3",
+ "fast-querystring": "^1.0.0",
+ "safe-regex2": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=14"
+ }
+ },
+ "node_modules/find-root": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz",
+ "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng=="
+ },
+ "node_modules/find-up": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
+ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
+ "dependencies": {
+ "locate-path": "^6.0.0",
+ "path-exists": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/findit": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/findit/-/findit-2.0.0.tgz",
+ "integrity": "sha512-ENZS237/Hr8bjczn5eKuBohLgaD0JyUd0arxretR1f9RO46vZHA1b2y0VorgGV3WaOT3c+78P8h7v4JGJ1i/rg==",
+ "dev": true
+ },
+ "node_modules/findup-sync": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz",
+ "integrity": "sha512-vs+3unmJT45eczmcAZ6zMJtxN3l/QXeccaXQx5cu/MeJMhewVfoWZqibRkOxPnmoR59+Zy5hjabfQc6JLSah4g==",
+ "dependencies": {
+ "detect-file": "^1.0.0",
+ "is-glob": "^3.1.0",
+ "micromatch": "^3.0.4",
+ "resolve-dir": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/findup-sync/node_modules/braces": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
+ "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
+ "dependencies": {
+ "arr-flatten": "^1.1.0",
+ "array-unique": "^0.3.2",
+ "extend-shallow": "^2.0.1",
+ "fill-range": "^4.0.0",
+ "isobject": "^3.0.1",
+ "repeat-element": "^1.1.2",
+ "snapdragon": "^0.8.1",
+ "snapdragon-node": "^2.0.1",
+ "split-string": "^3.0.2",
+ "to-regex": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/findup-sync/node_modules/braces/node_modules/extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
+ "dependencies": {
+ "is-extendable": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/findup-sync/node_modules/fill-range": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
+ "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==",
+ "dependencies": {
+ "extend-shallow": "^2.0.1",
+ "is-number": "^3.0.0",
+ "repeat-string": "^1.6.1",
+ "to-regex-range": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/findup-sync/node_modules/fill-range/node_modules/extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
+ "dependencies": {
+ "is-extendable": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/findup-sync/node_modules/is-extendable": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+ "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/findup-sync/node_modules/is-glob": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
+ "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==",
+ "dependencies": {
+ "is-extglob": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/findup-sync/node_modules/is-number": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
+ "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==",
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/findup-sync/node_modules/is-number/node_modules/kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/findup-sync/node_modules/micromatch": {
+ "version": "3.1.10",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
+ "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
+ "dependencies": {
+ "arr-diff": "^4.0.0",
+ "array-unique": "^0.3.2",
+ "braces": "^2.3.1",
+ "define-property": "^2.0.2",
+ "extend-shallow": "^3.0.2",
+ "extglob": "^2.0.4",
+ "fragment-cache": "^0.2.1",
+ "kind-of": "^6.0.2",
+ "nanomatch": "^1.2.9",
+ "object.pick": "^1.3.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/findup-sync/node_modules/to-regex-range": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
+ "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==",
+ "dependencies": {
+ "is-number": "^3.0.0",
+ "repeat-string": "^1.6.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/fined": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz",
+ "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==",
+ "dependencies": {
+ "expand-tilde": "^2.0.2",
+ "is-plain-object": "^2.0.3",
+ "object.defaults": "^1.1.0",
+ "object.pick": "^1.2.0",
+ "parse-filepath": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/flagged-respawn": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz",
+ "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/flat-cache": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz",
+ "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==",
+ "dev": true,
+ "dependencies": {
+ "flatted": "^3.2.7",
+ "keyv": "^4.5.3",
+ "rimraf": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/flat-cache/node_modules/rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dev": true,
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/flatted": {
+ "version": "3.2.9",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz",
+ "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==",
+ "dev": true
+ },
+ "node_modules/fn.name": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz",
+ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="
+ },
+ "node_modules/follow-redirects": {
+ "version": "1.15.3",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
+ "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://github.com/sponsors/RubenVerborgh"
+ }
+ ],
+ "engines": {
+ "node": ">=4.0"
+ },
+ "peerDependenciesMeta": {
+ "debug": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/for-each": {
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
+ "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==",
+ "dev": true,
+ "dependencies": {
+ "is-callable": "^1.1.3"
+ }
+ },
+ "node_modules/for-in": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
+ "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/for-own": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz",
+ "integrity": "sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==",
+ "dependencies": {
+ "for-in": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/foreground-child": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz",
+ "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==",
+ "dev": true,
+ "dependencies": {
+ "cross-spawn": "^7.0.0",
+ "signal-exit": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/fork-ts-checker-webpack-plugin": {
+ "version": "7.3.0",
+ "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-7.3.0.tgz",
+ "integrity": "sha512-IN+XTzusCjR5VgntYFgxbxVx3WraPRnKehBFrf00cMSrtUuW9MsG9dhL6MWpY6MkjC3wVwoujfCDgZZCQwbswA==",
+ "dependencies": {
+ "@babel/code-frame": "^7.16.7",
+ "chalk": "^4.1.2",
+ "chokidar": "^3.5.3",
+ "cosmiconfig": "^7.0.1",
+ "deepmerge": "^4.2.2",
+ "fs-extra": "^10.0.0",
+ "memfs": "^3.4.1",
+ "minimatch": "^3.0.4",
+ "node-abort-controller": "^3.0.1",
+ "schema-utils": "^3.1.1",
+ "semver": "^7.3.5",
+ "tapable": "^2.2.1"
+ },
+ "engines": {
+ "node": ">=12.13.0",
+ "yarn": ">=1.0.0"
+ },
+ "peerDependencies": {
+ "typescript": ">3.6.0",
+ "vue-template-compiler": "*",
+ "webpack": "^5.11.0"
+ },
+ "peerDependenciesMeta": {
+ "vue-template-compiler": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/fork-ts-checker-webpack-plugin/node_modules/ajv": {
+ "version": "6.12.6",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/fork-ts-checker-webpack-plugin/node_modules/ajv-keywords": {
+ "version": "3.5.2",
+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
+ "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
+ "peerDependencies": {
+ "ajv": "^6.9.1"
+ }
+ },
+ "node_modules/fork-ts-checker-webpack-plugin/node_modules/cosmiconfig": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
+ "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
+ "dependencies": {
+ "@types/parse-json": "^4.0.0",
+ "import-fresh": "^3.2.1",
+ "parse-json": "^5.0.0",
+ "path-type": "^4.0.0",
+ "yaml": "^1.10.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/fork-ts-checker-webpack-plugin/node_modules/json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+ },
+ "node_modules/fork-ts-checker-webpack-plugin/node_modules/schema-utils": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz",
+ "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==",
+ "dependencies": {
+ "@types/json-schema": "^7.0.8",
+ "ajv": "^6.12.5",
+ "ajv-keywords": "^3.5.2"
+ },
+ "engines": {
+ "node": ">= 10.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ }
+ },
+ "node_modules/fork-ts-checker-webpack-plugin/node_modules/yaml": {
+ "version": "1.10.2",
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
+ "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/form-data": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
+ "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "mime-types": "^2.1.12"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/formdata-polyfill": {
+ "version": "4.0.10",
+ "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
+ "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
+ "dependencies": {
+ "fetch-blob": "^3.1.2"
+ },
+ "engines": {
+ "node": ">=12.20.0"
+ }
+ },
+ "node_modules/formidable": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.6.tgz",
+ "integrity": "sha512-KcpbcpuLNOwrEjnbpMC0gS+X8ciDoZE1kkqzat4a8vrprf+s9pKNQ/QIwWfbfs4ltgmFl3MD177SNTkve3BwGQ==",
+ "deprecated": "Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau",
+ "funding": {
+ "url": "https://ko-fi.com/tunnckoCore/commissions"
+ }
+ },
+ "node_modules/formik": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/formik/-/formik-2.4.0.tgz",
+ "integrity": "sha512-QZiWztt9fD84EYcF7Bmr431ZhIm1xUVgBACbTuJ6azPrUpVp7o6q+t9HJaIQsFZrMfcBPNBotYtDgyDpzQ3z0Q==",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://opencollective.com/formik"
+ }
+ ],
+ "dependencies": {
+ "deepmerge": "^2.1.1",
+ "hoist-non-react-statics": "^3.3.0",
+ "lodash": "^4.17.21",
+ "lodash-es": "^4.17.21",
+ "react-fast-compare": "^2.0.1",
+ "tiny-warning": "^1.0.2",
+ "tslib": "^1.10.0"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0"
+ }
+ },
+ "node_modules/formik/node_modules/deepmerge": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz",
+ "integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/formik/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
+ },
+ "node_modules/forwarded": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fraction.js": {
+ "version": "4.3.6",
+ "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.6.tgz",
+ "integrity": "sha512-n2aZ9tNfYDwaHhvFTkhFErqOMIb8uyzSQ+vGJBjZyanAKZVbGUQ1sngfk9FdkBw7G26O7AgNjLcecLffD1c7eg==",
+ "dev": true,
+ "engines": {
+ "node": "*"
+ },
+ "funding": {
+ "type": "patreon",
+ "url": "https://github.com/sponsors/rawify"
+ }
+ },
+ "node_modules/fractional-indexing": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/fractional-indexing/-/fractional-indexing-3.2.0.tgz",
+ "integrity": "sha512-PcOxmqwYCW7O2ovKRU8OoQQj2yqTfEB/yeTYk4gPid6dN5ODRfU1hXd9tTVZzax/0NkO7AxpHykvZnT1aYp/BQ==",
+ "engines": {
+ "node": "^14.13.1 || >=16.0.0"
+ }
+ },
+ "node_modules/fragment-cache": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
+ "integrity": "sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==",
+ "dependencies": {
+ "map-cache": "^0.2.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/fresh": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
+ "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fromentries": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz",
+ "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/fs-capacitor": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/fs-capacitor/-/fs-capacitor-6.2.0.tgz",
+ "integrity": "sha512-nKcE1UduoSKX27NSZlg879LdQc94OtbOsEmKMN2MBNudXREvijRKx2GEBsTMTfws+BrbkJoEuynbGSVRSpauvw==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/fs-constants": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
+ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
+ },
+ "node_modules/fs-exists-cached": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz",
+ "integrity": "sha512-kSxoARUDn4F2RPXX48UXnaFKwVU7Ivd/6qpzZL29MCDmr9sTvybv4gFCp+qaI4fM9m0z9fgz/yJvi56GAz+BZg==",
+ "dev": true
+ },
+ "node_modules/fs-extra": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz",
+ "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==",
+ "dependencies": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/fs-extra/node_modules/universalify": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
+ "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
+ "node_modules/fs-jetpack": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/fs-jetpack/-/fs-jetpack-4.3.1.tgz",
+ "integrity": "sha512-dbeOK84F6BiQzk2yqqCVwCPWTxAvVGJ3fMQc6E2wuEohS28mR6yHngbrKuVCK1KHRx/ccByDylqu4H5PCP2urQ==",
+ "dependencies": {
+ "minimatch": "^3.0.2",
+ "rimraf": "^2.6.3"
+ }
+ },
+ "node_modules/fs-jetpack/node_modules/rimraf": {
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
+ "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ }
+ },
+ "node_modules/fs-minipass": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz",
+ "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==",
+ "dev": true,
+ "dependencies": {
+ "minipass": "^7.0.3"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/fs-minipass/node_modules/minipass": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz",
+ "integrity": "sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==",
+ "dev": true,
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ }
+ },
+ "node_modules/fs-monkey": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.5.tgz",
+ "integrity": "sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew=="
+ },
+ "node_modules/fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
+ },
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "hasInstallScript": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/function-bind": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+ },
+ "node_modules/function-loop": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/function-loop/-/function-loop-2.0.1.tgz",
+ "integrity": "sha512-ktIR+O6i/4h+j/ZhZJNdzeI4i9lEPeEK6UPR2EVyTVBqOwcU3Za9xYKLH64ZR9HmcROyRrOkizNyjjtWJzDDkQ==",
+ "dev": true
+ },
+ "node_modules/function.prototype.name": {
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz",
+ "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1",
+ "functions-have-names": "^1.2.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/functions-have-names": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz",
+ "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==",
+ "dev": true,
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/gauge": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz",
+ "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==",
+ "dev": true,
+ "dependencies": {
+ "aproba": "^1.0.3 || ^2.0.0",
+ "color-support": "^1.1.3",
+ "console-control-strings": "^1.1.0",
+ "has-unicode": "^2.0.1",
+ "signal-exit": "^3.0.7",
+ "string-width": "^4.2.3",
+ "strip-ansi": "^6.0.1",
+ "wide-align": "^1.1.5"
+ },
+ "engines": {
+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
+ }
+ },
+ "node_modules/generify": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/generify/-/generify-4.2.0.tgz",
+ "integrity": "sha512-b4cVhbPfbgbCZtK0dcUc1lASitXGEAIqukV5DDAyWm25fomWnV+C+a1yXvqikcRZXHN2j0pSDyj3cTfzq8pC7Q==",
+ "dependencies": {
+ "isbinaryfile": "^4.0.2",
+ "pump": "^3.0.0",
+ "split2": "^3.0.0",
+ "walker": "^1.0.6"
+ },
+ "bin": {
+ "generify": "generify.js"
+ }
+ },
+ "node_modules/gensync": {
+ "version": "1.0.0-beta.2",
+ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
+ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/get-caller-file": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+ "engines": {
+ "node": "6.* || 8.* || >= 10.*"
+ }
+ },
+ "node_modules/get-intrinsic": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz",
+ "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==",
+ "dependencies": {
+ "function-bind": "^1.1.1",
+ "has": "^1.0.3",
+ "has-proto": "^1.0.1",
+ "has-symbols": "^1.0.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-nonce": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz",
+ "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/get-package-type": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz",
+ "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==",
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/get-port": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz",
+ "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/get-stream": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/get-symbol-description": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz",
+ "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "get-intrinsic": "^1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-tsconfig": {
+ "version": "4.7.2",
+ "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.2.tgz",
+ "integrity": "sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==",
+ "dev": true,
+ "dependencies": {
+ "resolve-pkg-maps": "^1.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
+ }
+ },
+ "node_modules/get-value": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
+ "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/getopts": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/getopts/-/getopts-2.3.0.tgz",
+ "integrity": "sha512-5eDf9fuSXwxBL6q5HX+dhDj+dslFGWzU5thZ9kNKUkcPtaPdatmUFKwHFrLb/uf/WpA4BHET+AX3Scl56cAjpA=="
+ },
+ "node_modules/git-commit-msg-linter": {
+ "version": "4.11.1",
+ "resolved": "https://registry.npmjs.org/git-commit-msg-linter/-/git-commit-msg-linter-4.11.1.tgz",
+ "integrity": "sha512-MKkHt9v8FjEDxPMmelgG/EJm4V5mf0mL+u+yokDxPWtc0LW7W/+sG0gEG3H/zhE8JMOjYScCgrEwsyEyNeKpXw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "dependencies": {
+ "chalk": "^2.4.2",
+ "did-you-mean": "^0.0.1",
+ "supports-color": "^8.1.1"
+ },
+ "bin": {
+ "commit-msg-linter": "cli/validate.js"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
+ }
+ },
+ "node_modules/git-commit-msg-linter/node_modules/ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "dependencies": {
+ "color-convert": "^1.9.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/git-commit-msg-linter/node_modules/chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/git-commit-msg-linter/node_modules/chalk/node_modules/supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/git-commit-msg-linter/node_modules/color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "dependencies": {
+ "color-name": "1.1.3"
+ }
+ },
+ "node_modules/git-commit-msg-linter/node_modules/color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
+ "dev": true
+ },
+ "node_modules/git-commit-msg-linter/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/git-commit-msg-linter/node_modules/has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/github-from-package": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
+ "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="
+ },
+ "node_modules/glob": {
+ "version": "7.2.3",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
+ "dependencies": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.1.1",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ },
+ "engines": {
+ "node": "*"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/glob-parent": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+ "dependencies": {
+ "is-glob": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/glob-to-regexp": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz",
+ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw=="
+ },
+ "node_modules/global-dirs": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz",
+ "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==",
+ "dev": true,
+ "dependencies": {
+ "ini": "2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/global-dirs/node_modules/ini": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz",
+ "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/global-modules": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz",
+ "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==",
+ "dependencies": {
+ "global-prefix": "^1.0.1",
+ "is-windows": "^1.0.1",
+ "resolve-dir": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/global-prefix": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz",
+ "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==",
+ "dependencies": {
+ "expand-tilde": "^2.0.2",
+ "homedir-polyfill": "^1.0.1",
+ "ini": "^1.3.4",
+ "is-windows": "^1.0.1",
+ "which": "^1.2.14"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/global-prefix/node_modules/ini": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
+ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
+ },
+ "node_modules/global-prefix/node_modules/which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "which": "bin/which"
+ }
+ },
+ "node_modules/globals": {
+ "version": "11.12.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
+ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/globalthis": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz",
+ "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==",
+ "dev": true,
+ "dependencies": {
+ "define-properties": "^1.1.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/globby": {
+ "version": "11.1.0",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
+ "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
+ "dev": true,
+ "dependencies": {
+ "array-union": "^2.1.0",
+ "dir-glob": "^3.0.1",
+ "fast-glob": "^3.2.9",
+ "ignore": "^5.2.0",
+ "merge2": "^1.4.1",
+ "slash": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/globrex": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
+ "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==",
+ "dev": true
+ },
+ "node_modules/gopd": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
+ "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==",
+ "dependencies": {
+ "get-intrinsic": "^1.1.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/got": {
+ "version": "9.6.0",
+ "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz",
+ "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==",
+ "dev": true,
+ "dependencies": {
+ "@sindresorhus/is": "^0.14.0",
+ "@szmarczak/http-timer": "^1.1.2",
+ "cacheable-request": "^6.0.0",
+ "decompress-response": "^3.3.0",
+ "duplexer3": "^0.1.4",
+ "get-stream": "^4.1.0",
+ "lowercase-keys": "^1.0.1",
+ "mimic-response": "^1.0.1",
+ "p-cancelable": "^1.0.0",
+ "to-readable-stream": "^1.0.0",
+ "url-parse-lax": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8.6"
+ }
+ },
+ "node_modules/got/node_modules/decompress-response": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz",
+ "integrity": "sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==",
+ "dev": true,
+ "dependencies": {
+ "mimic-response": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/got/node_modules/get-stream": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
+ "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
+ "dev": true,
+ "dependencies": {
+ "pump": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/got/node_modules/mimic-response": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
+ "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/graceful-fs": {
+ "version": "4.2.11",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
+ },
+ "node_modules/grant": {
+ "version": "5.4.21",
+ "resolved": "https://registry.npmjs.org/grant/-/grant-5.4.21.tgz",
+ "integrity": "sha512-QaoZudI9Gmh2W415gd71Iul6gpVH9sG1SkjfnGHtqYZopQDQ5PUVxRol5zFCrwGi9S0EbExbelHlZScgdChg2w==",
+ "dependencies": {
+ "qs": "^6.10.2",
+ "request-compose": "^2.1.4",
+ "request-oauth": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "optionalDependencies": {
+ "cookie": "^0.4.1",
+ "cookie-signature": "^1.1.0",
+ "jwk-to-pem": "^2.0.5",
+ "jws": "^4.0.0"
+ }
+ },
+ "node_modules/grant-koa": {
+ "version": "5.4.8",
+ "resolved": "https://registry.npmjs.org/grant-koa/-/grant-koa-5.4.8.tgz",
+ "integrity": "sha512-Kw8np9AL3Z3mZuvoSUklHJpTe3xx7iLBDauRyIwwbDLRr/5Ll6APmOFHixXj+Vw+LGEnreTxO35CyhAf9oBUMA==",
+ "dependencies": {
+ "grant": "^5.4.8"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ },
+ "peerDependencies": {
+ "koa": ">=2.0.0"
+ }
+ },
+ "node_modules/grant/node_modules/cookie": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz",
+ "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==",
+ "optional": true,
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/grant/node_modules/cookie-signature": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.1.tgz",
+ "integrity": "sha512-78KWk9T26NhzXtuL26cIJ8/qNHANyJ/ZYrmEXFzUmhZdjpBv+DlWlOANRTGBt48YcyslsLrj0bMLFTmXvLRCOw==",
+ "optional": true,
+ "engines": {
+ "node": ">=6.6.0"
+ }
+ },
+ "node_modules/graphemer": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
+ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
+ "dev": true
+ },
+ "node_modules/graphql": {
+ "version": "16.8.1",
+ "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz",
+ "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==",
+ "engines": {
+ "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0"
+ }
+ },
+ "node_modules/graphql-depth-limit": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/graphql-depth-limit/-/graphql-depth-limit-1.1.0.tgz",
+ "integrity": "sha512-+3B2BaG8qQ8E18kzk9yiSdAa75i/hnnOwgSeAxVJctGQPvmeiLtqKOYF6HETCyRjiF7Xfsyal0HbLlxCQkgkrw==",
+ "dependencies": {
+ "arrify": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ },
+ "peerDependencies": {
+ "graphql": "*"
+ }
+ },
+ "node_modules/graphql-playground-html": {
+ "version": "1.6.30",
+ "resolved": "https://registry.npmjs.org/graphql-playground-html/-/graphql-playground-html-1.6.30.tgz",
+ "integrity": "sha512-tpCujhsJMva4aqE8ULnF7/l3xw4sNRZcSHu+R00VV+W0mfp+Q20Plvcrp+5UXD+2yS6oyCXncA+zoQJQqhGCEw==",
+ "dependencies": {
+ "xss": "^1.0.6"
+ }
+ },
+ "node_modules/graphql-playground-middleware-koa": {
+ "version": "1.6.22",
+ "resolved": "https://registry.npmjs.org/graphql-playground-middleware-koa/-/graphql-playground-middleware-koa-1.6.22.tgz",
+ "integrity": "sha512-soVUM76ecq5GHk12H69Ce7afzbYuWWc73oKMOcEkmtAn/G9NUdsNvLjLdCnHQX1V0cOUeSbmcYcrebyBOIYGMQ==",
+ "dependencies": {
+ "graphql-playground-html": "^1.6.30"
+ },
+ "peerDependencies": {
+ "koa": "^2"
+ }
+ },
+ "node_modules/graphql-scalars": {
+ "version": "1.22.2",
+ "resolved": "https://registry.npmjs.org/graphql-scalars/-/graphql-scalars-1.22.2.tgz",
+ "integrity": "sha512-my9FB4GtghqXqi/lWSVAOPiTzTnnEzdOXCsAC2bb5V7EFNQjVjwy3cSSbUvgYOtDuDibd+ZsCDhz+4eykYOlhQ==",
+ "dependencies": {
+ "tslib": "^2.5.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
+ }
+ },
+ "node_modules/graphql-tag": {
+ "version": "2.12.6",
+ "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.6.tgz",
+ "integrity": "sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==",
+ "dependencies": {
+ "tslib": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
+ }
+ },
+ "node_modules/graphql-upload": {
+ "version": "13.0.0",
+ "resolved": "https://registry.npmjs.org/graphql-upload/-/graphql-upload-13.0.0.tgz",
+ "integrity": "sha512-YKhx8m/uOtKu4Y1UzBFJhbBGJTlk7k4CydlUUiNrtxnwZv0WigbRHP+DVhRNKt7u7DXOtcKZeYJlGtnMXvreXA==",
+ "dependencies": {
+ "busboy": "^0.3.1",
+ "fs-capacitor": "^6.2.0",
+ "http-errors": "^1.8.1",
+ "object-path": "^0.11.8"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >= 16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jaydenseric"
+ },
+ "peerDependencies": {
+ "graphql": "0.13.1 - 16"
+ }
+ },
+ "node_modules/graphql-upload/node_modules/depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/graphql-upload/node_modules/http-errors": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
+ "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
+ "dependencies": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/graphql-upload/node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/guess-parser": {
+ "version": "0.4.22",
+ "resolved": "https://registry.npmjs.org/guess-parser/-/guess-parser-0.4.22.tgz",
+ "integrity": "sha512-KcUWZ5ACGaBM69SbqwVIuWGoSAgD+9iJnchR9j/IarVI1jHVeXv+bUXBIMeqVMSKt3zrn0Dgf9UpcOEpPBLbSg==",
+ "dev": true,
+ "dependencies": {
+ "@wessberg/ts-evaluator": "0.0.27"
+ },
+ "peerDependencies": {
+ "typescript": ">=3.7.5"
+ }
+ },
+ "node_modules/handle-thing": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz",
+ "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg=="
+ },
+ "node_modules/handlebars": {
+ "version": "4.7.8",
+ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
+ "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
+ "dependencies": {
+ "minimist": "^1.2.5",
+ "neo-async": "^2.6.2",
+ "source-map": "^0.6.1",
+ "wordwrap": "^1.0.0"
+ },
+ "bin": {
+ "handlebars": "bin/handlebars"
+ },
+ "engines": {
+ "node": ">=0.4.7"
+ },
+ "optionalDependencies": {
+ "uglify-js": "^3.1.4"
+ }
+ },
+ "node_modules/handlebars/node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/has": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
+ "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+ "dependencies": {
+ "function-bind": "^1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.4.0"
+ }
+ },
+ "node_modules/has-ansi": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
+ "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==",
+ "dependencies": {
+ "ansi-regex": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/has-ansi/node_modules/ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/has-bigints": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz",
+ "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==",
+ "dev": true,
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/has-property-descriptors": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz",
+ "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==",
+ "dependencies": {
+ "get-intrinsic": "^1.1.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz",
+ "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-symbols": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
+ "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-tostringtag": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz",
+ "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==",
+ "dependencies": {
+ "has-symbols": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-unicode": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
+ "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==",
+ "dev": true
+ },
+ "node_modules/has-value": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz",
+ "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==",
+ "dependencies": {
+ "get-value": "^2.0.6",
+ "has-values": "^1.0.0",
+ "isobject": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/has-values": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz",
+ "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==",
+ "dependencies": {
+ "is-number": "^3.0.0",
+ "kind-of": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/has-values/node_modules/is-number": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
+ "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==",
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/has-values/node_modules/is-number/node_modules/kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/has-values/node_modules/kind-of": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
+ "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==",
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/has-yarn": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz",
+ "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/hash.js": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz",
+ "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
+ "dependencies": {
+ "inherits": "^2.0.3",
+ "minimalistic-assert": "^1.0.1"
+ }
+ },
+ "node_modules/hasha": {
+ "version": "5.2.2",
+ "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz",
+ "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==",
+ "dev": true,
+ "dependencies": {
+ "is-stream": "^2.0.0",
+ "type-fest": "^0.8.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/hasha/node_modules/type-fest": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
+ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/hast-util-from-parse5": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-7.1.2.tgz",
+ "integrity": "sha512-Nz7FfPBuljzsN3tCQ4kCBKqdNhQE2l0Tn+X1ubgKBPRoiDIu1mL08Cfw4k7q71+Duyaw7DXDN+VTAp4Vh3oCOw==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "@types/unist": "^2.0.0",
+ "hastscript": "^7.0.0",
+ "property-information": "^6.0.0",
+ "vfile": "^5.0.0",
+ "vfile-location": "^4.0.0",
+ "web-namespaces": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-parse-selector": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz",
+ "integrity": "sha512-jdlwBjEexy1oGz0aJ2f4GKMaVKkA9jwjr4MjAAI22E5fM/TXVZHuS5OpONtdeIkRKqAaryQ2E9xNQxijoThSZA==",
+ "dependencies": {
+ "@types/hast": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-raw": {
+ "version": "7.2.3",
+ "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-7.2.3.tgz",
+ "integrity": "sha512-RujVQfVsOrxzPOPSzZFiwofMArbQke6DJjnFfceiEbFh7S05CbPt0cYN+A5YeD3pso0JQk6O1aHBnx9+Pm2uqg==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "@types/parse5": "^6.0.0",
+ "hast-util-from-parse5": "^7.0.0",
+ "hast-util-to-parse5": "^7.0.0",
+ "html-void-elements": "^2.0.0",
+ "parse5": "^6.0.0",
+ "unist-util-position": "^4.0.0",
+ "unist-util-visit": "^4.0.0",
+ "vfile": "^5.0.0",
+ "web-namespaces": "^2.0.0",
+ "zwitch": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-raw/node_modules/parse5": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz",
+ "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw=="
+ },
+ "node_modules/hast-util-sanitize": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/hast-util-sanitize/-/hast-util-sanitize-4.1.0.tgz",
+ "integrity": "sha512-Hd9tU0ltknMGRDv+d6Ro/4XKzBqQnP/EZrpiTbpFYfXv/uOhWeKc+2uajcbEvAEH98VZd7eII2PiXm13RihnLw==",
+ "dependencies": {
+ "@types/hast": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-to-parse5": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-7.1.0.tgz",
+ "integrity": "sha512-YNRgAJkH2Jky5ySkIqFXTQiaqcAtJyVE+D5lkN6CdtOqrnkLfGYYrEcKuHOJZlp+MwjSwuD3fZuawI+sic/RBw==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "comma-separated-tokens": "^2.0.0",
+ "property-information": "^6.0.0",
+ "space-separated-tokens": "^2.0.0",
+ "web-namespaces": "^2.0.0",
+ "zwitch": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-whitespace": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz",
+ "integrity": "sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hastscript": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-7.2.0.tgz",
+ "integrity": "sha512-TtYPq24IldU8iKoJQqvZOuhi5CyCQRAbvDOX0x1eW6rsHSxa/1i2CCiptNTotGHJ3VoHRGmqiv6/D3q113ikkw==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "comma-separated-tokens": "^2.0.0",
+ "hast-util-parse-selector": "^3.0.0",
+ "property-information": "^6.0.0",
+ "space-separated-tokens": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hdr-histogram-js": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/hdr-histogram-js/-/hdr-histogram-js-2.0.3.tgz",
+ "integrity": "sha512-Hkn78wwzWHNCp2uarhzQ2SGFLU3JY8SBDDd3TAABK4fc30wm+MuPOrg5QVFVfkKOQd6Bfz3ukJEI+q9sXEkK1g==",
+ "dev": true,
+ "dependencies": {
+ "@assemblyscript/loader": "^0.10.1",
+ "base64-js": "^1.2.0",
+ "pako": "^1.0.3"
+ }
+ },
+ "node_modules/hdr-histogram-percentiles-obj": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/hdr-histogram-percentiles-obj/-/hdr-histogram-percentiles-obj-3.0.0.tgz",
+ "integrity": "sha512-7kIufnBqdsBGcSZLPJwqHT3yhk1QTsSlFsVD3kx5ixH/AlgBs9yM1q6DPhXZ8f8gtdqgh7N7/5btRLpQsS2gHw==",
+ "dev": true
+ },
+ "node_modules/he": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
+ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
+ "bin": {
+ "he": "bin/he"
+ }
+ },
+ "node_modules/header-case": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/header-case/-/header-case-1.0.1.tgz",
+ "integrity": "sha512-i0q9mkOeSuhXw6bGgiQCCBgY/jlZuV/7dZXyZ9c6LcBrqwvT8eT719E9uxE5LiZftdl+z81Ugbg/VvXV4OJOeQ==",
+ "dependencies": {
+ "no-case": "^2.2.0",
+ "upper-case": "^1.1.3"
+ }
+ },
+ "node_modules/helmet": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/helmet/-/helmet-6.2.0.tgz",
+ "integrity": "sha512-DWlwuXLLqbrIOltR6tFQXShj/+7Cyp0gLi6uAb8qMdFh/YBBFbKSgQ6nbXmScYd8emMctuthmgIa7tUfo9Rtyg==",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/help-me": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/help-me/-/help-me-4.2.0.tgz",
+ "integrity": "sha512-TAOnTB8Tz5Dw8penUuzHVrKNKlCIbwwbHnXraNJxPwf8LRtE2HlM84RYuezMFcwOJmoYOCWVDyJ8TQGxn9PgxA==",
+ "dependencies": {
+ "glob": "^8.0.0",
+ "readable-stream": "^3.6.0"
+ }
+ },
+ "node_modules/help-me/node_modules/brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/help-me/node_modules/glob": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
+ "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==",
+ "dependencies": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^5.0.1",
+ "once": "^1.3.0"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/help-me/node_modules/minimatch": {
+ "version": "5.1.6",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
+ "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
+ "dependencies": {
+ "brace-expansion": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/highlight.js": {
+ "version": "10.7.3",
+ "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz",
+ "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/history": {
+ "version": "4.10.1",
+ "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
+ "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
+ "dependencies": {
+ "@babel/runtime": "^7.1.2",
+ "loose-envify": "^1.2.0",
+ "resolve-pathname": "^3.0.0",
+ "tiny-invariant": "^1.0.2",
+ "tiny-warning": "^1.0.0",
+ "value-equal": "^1.0.1"
+ }
+ },
+ "node_modules/hmac-drbg": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
+ "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==",
+ "dependencies": {
+ "hash.js": "^1.0.3",
+ "minimalistic-assert": "^1.0.0",
+ "minimalistic-crypto-utils": "^1.0.1"
+ }
+ },
+ "node_modules/hoist-non-react-statics": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
+ "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
+ "dependencies": {
+ "react-is": "^16.7.0"
+ }
+ },
+ "node_modules/homedir-polyfill": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
+ "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==",
+ "dependencies": {
+ "parse-passwd": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/hosted-git-info": {
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz",
+ "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==",
+ "dev": true,
+ "dependencies": {
+ "lru-cache": "^7.5.1"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/hosted-git-info/node_modules/lru-cache": {
+ "version": "7.18.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",
+ "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/hpack.js": {
+ "version": "2.1.6",
+ "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz",
+ "integrity": "sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==",
+ "dependencies": {
+ "inherits": "^2.0.1",
+ "obuf": "^1.0.0",
+ "readable-stream": "^2.0.1",
+ "wbuf": "^1.1.0"
+ }
+ },
+ "node_modules/hpack.js/node_modules/isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
+ },
+ "node_modules/hpack.js/node_modules/readable-stream": {
+ "version": "2.3.8",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
+ "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "node_modules/hpack.js/node_modules/safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
+ },
+ "node_modules/hpack.js/node_modules/string_decoder": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "dependencies": {
+ "safe-buffer": "~5.1.0"
+ }
+ },
+ "node_modules/html-encoding-sniffer": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",
+ "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==",
+ "dev": true,
+ "dependencies": {
+ "whatwg-encoding": "^1.0.5"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/html-entities": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.4.0.tgz",
+ "integrity": "sha512-igBTJcNNNhvZFRtm8uA6xMY6xYleeDwn3PeBCkDz7tHttv4F2hsDI2aPgNERWzvRcNYHNT3ymRaQzllmXj4YsQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/mdevils"
+ },
+ {
+ "type": "patreon",
+ "url": "https://patreon.com/mdevils"
+ }
+ ]
+ },
+ "node_modules/html-escaper": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
+ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
+ "dev": true
+ },
+ "node_modules/html-loader": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/html-loader/-/html-loader-4.2.0.tgz",
+ "integrity": "sha512-OxCHD3yt+qwqng2vvcaPApCEvbx+nXWu+v69TYHx1FO8bffHn/JjHtE3TTQZmHjwvnJe4xxzuecetDVBrQR1Zg==",
+ "dependencies": {
+ "html-minifier-terser": "^7.0.0",
+ "parse5": "^7.0.0"
+ },
+ "engines": {
+ "node": ">= 14.15.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "webpack": "^5.0.0"
+ }
+ },
+ "node_modules/html-minifier-terser": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-7.2.0.tgz",
+ "integrity": "sha512-tXgn3QfqPIpGl9o+K5tpcj3/MN4SfLtsx2GWwBC3SSd0tXQGyF3gsSqad8loJgKZGM3ZxbYDd5yhiBIdWpmvLA==",
+ "dependencies": {
+ "camel-case": "^4.1.2",
+ "clean-css": "~5.3.2",
+ "commander": "^10.0.0",
+ "entities": "^4.4.0",
+ "param-case": "^3.0.4",
+ "relateurl": "^0.2.7",
+ "terser": "^5.15.1"
+ },
+ "bin": {
+ "html-minifier-terser": "cli.js"
+ },
+ "engines": {
+ "node": "^14.13.1 || >=16.0.0"
+ }
+ },
+ "node_modules/html-minifier-terser/node_modules/commander": {
+ "version": "10.0.1",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz",
+ "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==",
+ "engines": {
+ "node": ">=14"
+ }
+ },
+ "node_modules/html-void-elements": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-2.0.1.tgz",
+ "integrity": "sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/html-webpack-plugin": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.5.0.tgz",
+ "integrity": "sha512-sy88PC2cRTVxvETRgUHFrL4No3UxvcH8G1NepGhqaTT+GXN2kTamqasot0inS5hXeg1cMbFDt27zzo9p35lZVw==",
+ "dependencies": {
+ "@types/html-minifier-terser": "^6.0.0",
+ "html-minifier-terser": "^6.0.2",
+ "lodash": "^4.17.21",
+ "pretty-error": "^4.0.0",
+ "tapable": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/html-webpack-plugin"
+ },
+ "peerDependencies": {
+ "webpack": "^5.20.0"
+ }
+ },
+ "node_modules/html-webpack-plugin/node_modules/commander": {
+ "version": "8.3.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
+ "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/html-webpack-plugin/node_modules/html-minifier-terser": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz",
+ "integrity": "sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw==",
+ "dependencies": {
+ "camel-case": "^4.1.2",
+ "clean-css": "^5.2.2",
+ "commander": "^8.3.0",
+ "he": "^1.2.0",
+ "param-case": "^3.0.4",
+ "relateurl": "^0.2.7",
+ "terser": "^5.10.0"
+ },
+ "bin": {
+ "html-minifier-terser": "cli.js"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/htmlparser2": {
+ "version": "8.0.2",
+ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz",
+ "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==",
+ "funding": [
+ "https://github.com/fb55/htmlparser2?sponsor=1",
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fb55"
+ }
+ ],
+ "dependencies": {
+ "domelementtype": "^2.3.0",
+ "domhandler": "^5.0.3",
+ "domutils": "^3.0.1",
+ "entities": "^4.4.0"
+ }
+ },
+ "node_modules/http-assert": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.5.0.tgz",
+ "integrity": "sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w==",
+ "dependencies": {
+ "deep-equal": "~1.0.1",
+ "http-errors": "~1.8.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/http-assert/node_modules/depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/http-assert/node_modules/http-errors": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
+ "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
+ "dependencies": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/http-assert/node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/http-cache-semantics": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz",
+ "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ=="
+ },
+ "node_modules/http-deceiver": {
+ "version": "1.2.7",
+ "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz",
+ "integrity": "sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw=="
+ },
+ "node_modules/http-errors": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
+ "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
+ "dependencies": {
+ "depd": "2.0.0",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": "2.0.1",
+ "toidentifier": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/http-parser-js": {
+ "version": "0.5.8",
+ "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz",
+ "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q=="
+ },
+ "node_modules/http-proxy": {
+ "version": "1.18.1",
+ "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
+ "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
+ "dependencies": {
+ "eventemitter3": "^4.0.0",
+ "follow-redirects": "^1.0.0",
+ "requires-port": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/http-proxy-agent": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz",
+ "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==",
+ "dependencies": {
+ "@tootallnate/once": "2",
+ "agent-base": "6",
+ "debug": "4"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/http-proxy-middleware": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz",
+ "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==",
+ "dependencies": {
+ "@types/http-proxy": "^1.17.8",
+ "http-proxy": "^1.18.1",
+ "is-glob": "^4.0.1",
+ "is-plain-obj": "^3.0.0",
+ "micromatch": "^4.0.2"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "@types/express": "^4.17.13"
+ },
+ "peerDependenciesMeta": {
+ "@types/express": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/http2-wrapper": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz",
+ "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==",
+ "dependencies": {
+ "quick-lru": "^5.1.1",
+ "resolve-alpn": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=10.19.0"
+ }
+ },
+ "node_modules/https-proxy-agent": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
+ "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
+ "dependencies": {
+ "agent-base": "6",
+ "debug": "4"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/human-signals": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
+ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
+ "engines": {
+ "node": ">=10.17.0"
+ }
+ },
+ "node_modules/humanize-ms": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
+ "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.0.0"
+ }
+ },
+ "node_modules/iconv-lite": {
+ "version": "0.4.24",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/icss-utils": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz",
+ "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==",
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/ieee754": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/ignore": {
+ "version": "5.2.4",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz",
+ "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/ignore-walk": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-6.0.3.tgz",
+ "integrity": "sha512-C7FfFoTA+bI10qfeydT8aZbvr91vAEU+2W5BZUlzPec47oNb07SsOfwYrtxuvOYdUApPP/Qlh4DtAO51Ekk2QA==",
+ "dev": true,
+ "dependencies": {
+ "minimatch": "^9.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/ignore-walk/node_modules/brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "dev": true,
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/ignore-walk/node_modules/minimatch": {
+ "version": "9.0.3",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
+ "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
+ "dev": true,
+ "dependencies": {
+ "brace-expansion": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/image-size": {
+ "version": "0.5.5",
+ "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz",
+ "integrity": "sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==",
+ "optional": true,
+ "bin": {
+ "image-size": "bin/image-size.js"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/immer": {
+ "version": "9.0.19",
+ "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.19.tgz",
+ "integrity": "sha512-eY+Y0qcsB4TZKwgQzLaE/lqYMlKhv5J9dyd2RhhtGhNo2njPXDqU9XPfcNfa3MIDsdtZt5KlkIsirlo4dHsWdQ==",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/immer"
+ }
+ },
+ "node_modules/immutable": {
+ "version": "4.3.4",
+ "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.4.tgz",
+ "integrity": "sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==",
+ "devOptional": true
+ },
+ "node_modules/import-fresh": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
+ "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+ "dependencies": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/import-fresh/node_modules/resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/import-in-the-middle": {
+ "version": "1.4.2",
+ "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.4.2.tgz",
+ "integrity": "sha512-9WOz1Yh/cvO/p69sxRmhyQwrIGGSp7EIdcb+fFNVi7CzQGQB8U1/1XrKVSbEd/GNOAeM0peJtmi7+qphe7NvAw==",
+ "dependencies": {
+ "acorn": "^8.8.2",
+ "acorn-import-assertions": "^1.9.0",
+ "cjs-module-lexer": "^1.2.2",
+ "module-details-from-path": "^1.0.3"
+ }
+ },
+ "node_modules/import-lazy": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz",
+ "integrity": "sha512-m7ZEHgtw69qOGw+jwxXkHlrlIPdTGkyh66zXZ1ajZbxkDBNjSY/LGbmjc7h0s2ELsUDTAhFr55TrPSSqJGPG0A==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/import-local": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz",
+ "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==",
+ "dependencies": {
+ "pkg-dir": "^4.2.0",
+ "resolve-cwd": "^3.0.0"
+ },
+ "bin": {
+ "import-local-fixture": "fixtures/cli.js"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/import-local/node_modules/find-up": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
+ "dependencies": {
+ "locate-path": "^5.0.0",
+ "path-exists": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/import-local/node_modules/locate-path": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
+ "dependencies": {
+ "p-locate": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/import-local/node_modules/p-limit": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
+ "dependencies": {
+ "p-try": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/import-local/node_modules/p-locate": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
+ "dependencies": {
+ "p-limit": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/import-local/node_modules/pkg-dir": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
+ "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
+ "dependencies": {
+ "find-up": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/imurmurhash": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
+ "engines": {
+ "node": ">=0.8.19"
+ }
+ },
+ "node_modules/indent-string": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
+ "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/inflation": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/inflation/-/inflation-2.0.0.tgz",
+ "integrity": "sha512-m3xv4hJYR2oXw4o4Y5l6P5P16WYmazYof+el6Al3f+YlggGj6qT9kImBAnzDelRALnP5d3h4jGBPKzYCizjZZw==",
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/inflight": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
+ "dependencies": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ },
+ "node_modules/ini": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz",
+ "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==",
+ "dev": true,
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/inline-style-parser": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz",
+ "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q=="
+ },
+ "node_modules/inquirer": {
+ "version": "8.2.4",
+ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.4.tgz",
+ "integrity": "sha512-nn4F01dxU8VeKfq192IjLsxu0/OmMZ4Lg3xKAns148rCaXP6ntAoEkVYZThWjwON8AlzdZZi6oqnhNbxUG9hVg==",
+ "dev": true,
+ "dependencies": {
+ "ansi-escapes": "^4.2.1",
+ "chalk": "^4.1.1",
+ "cli-cursor": "^3.1.0",
+ "cli-width": "^3.0.0",
+ "external-editor": "^3.0.3",
+ "figures": "^3.0.0",
+ "lodash": "^4.17.21",
+ "mute-stream": "0.0.8",
+ "ora": "^5.4.1",
+ "run-async": "^2.4.0",
+ "rxjs": "^7.5.5",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0",
+ "through": "^2.3.6",
+ "wrap-ansi": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/internal-ip": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-6.2.0.tgz",
+ "integrity": "sha512-D8WGsR6yDt8uq7vDMu7mjcR+yRMm3dW8yufyChmszWRjcSHuxLBkR3GdS2HZAjodsaGuCvXeEJpueisXJULghg==",
+ "dev": true,
+ "dependencies": {
+ "default-gateway": "^6.0.0",
+ "ipaddr.js": "^1.9.1",
+ "is-ip": "^3.1.0",
+ "p-event": "^4.2.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/internal-ip?sponsor=1"
+ }
+ },
+ "node_modules/internal-slot": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz",
+ "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==",
+ "dev": true,
+ "dependencies": {
+ "get-intrinsic": "^1.2.0",
+ "has": "^1.0.3",
+ "side-channel": "^1.0.4"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/interpret": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz",
+ "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/intl-messageformat": {
+ "version": "10.3.4",
+ "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-10.3.4.tgz",
+ "integrity": "sha512-/FxUIrlbPtuykSNX85CB5sp2FjLVeTmdD7TfRkVFPft2n4FgcSlAcilFytYiFAEmPHc+0PvpLCIPXeaGFzIvOg==",
+ "dependencies": {
+ "@formatjs/ecma402-abstract": "1.14.3",
+ "@formatjs/fast-memoize": "2.0.1",
+ "@formatjs/icu-messageformat-parser": "2.3.1",
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/invariant": {
+ "version": "2.2.4",
+ "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
+ "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==",
+ "dependencies": {
+ "loose-envify": "^1.0.0"
+ }
+ },
+ "node_modules/ip": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz",
+ "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ=="
+ },
+ "node_modules/ip-regex": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz",
+ "integrity": "sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ipaddr.js": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/is-absolute": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
+ "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==",
+ "dependencies": {
+ "is-relative": "^1.0.0",
+ "is-windows": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "dependencies": {
+ "kind-of": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-array-buffer": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz",
+ "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "get-intrinsic": "^1.2.0",
+ "is-typed-array": "^1.1.10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-arrayish": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
+ "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="
+ },
+ "node_modules/is-async-function": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz",
+ "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==",
+ "dev": true,
+ "dependencies": {
+ "has-tostringtag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-bigint": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz",
+ "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==",
+ "dev": true,
+ "dependencies": {
+ "has-bigints": "^1.0.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-binary-path": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
+ "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
+ "dependencies": {
+ "binary-extensions": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-boolean-object": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz",
+ "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "has-tostringtag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-buffer": {
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
+ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
+ },
+ "node_modules/is-callable": {
+ "version": "1.2.7",
+ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
+ "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-ci": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz",
+ "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==",
+ "dev": true,
+ "dependencies": {
+ "ci-info": "^2.0.0"
+ },
+ "bin": {
+ "is-ci": "bin.js"
+ }
+ },
+ "node_modules/is-ci/node_modules/ci-info": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz",
+ "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==",
+ "dev": true
+ },
+ "node_modules/is-class-hotfix": {
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/is-class-hotfix/-/is-class-hotfix-0.0.6.tgz",
+ "integrity": "sha512-0n+pzCC6ICtVr/WXnN2f03TK/3BfXY7me4cjCAqT8TYXEl0+JBRoqBo94JJHXcyDSLUeWbNX8Fvy5g5RJdAstQ=="
+ },
+ "node_modules/is-core-module": {
+ "version": "2.13.0",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz",
+ "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==",
+ "dependencies": {
+ "has": "^1.0.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "dependencies": {
+ "kind-of": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-date-object": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz",
+ "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==",
+ "dev": true,
+ "dependencies": {
+ "has-tostringtag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "dependencies": {
+ "is-accessor-descriptor": "^1.0.0",
+ "is-data-descriptor": "^1.0.0",
+ "kind-of": "^6.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-docker": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
+ "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
+ "bin": {
+ "is-docker": "cli.js"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-extendable": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
+ "dependencies": {
+ "is-plain-object": "^2.0.4"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-finalizationregistry": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz",
+ "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-generator-fn": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz",
+ "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/is-generator-function": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz",
+ "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==",
+ "dependencies": {
+ "has-tostringtag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-glob": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "dependencies": {
+ "is-extglob": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-installed-globally": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz",
+ "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==",
+ "dev": true,
+ "dependencies": {
+ "global-dirs": "^3.0.0",
+ "is-path-inside": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-interactive": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz",
+ "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-ip": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-3.1.0.tgz",
+ "integrity": "sha512-35vd5necO7IitFPjd/YBeqwWnyDWbuLH9ZXQdMfDA8TEo7pv5X8yfrvVO3xbJbLUlERCMvf6X0hTUamQxCYJ9Q==",
+ "dev": true,
+ "dependencies": {
+ "ip-regex": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-lambda": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz",
+ "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==",
+ "dev": true
+ },
+ "node_modules/is-lower-case": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/is-lower-case/-/is-lower-case-1.1.3.tgz",
+ "integrity": "sha512-+5A1e/WJpLLXZEDlgz4G//WYSHyQBD32qa4Jd3Lw06qQlv3fJHnp3YIHjTQSGzHMgzmVKz2ZP3rBxTHkPw/lxA==",
+ "dependencies": {
+ "lower-case": "^1.1.0"
+ }
+ },
+ "node_modules/is-map": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz",
+ "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==",
+ "dev": true,
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-nan": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz",
+ "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==",
+ "dependencies": {
+ "call-bind": "^1.0.0",
+ "define-properties": "^1.1.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-negative-zero": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz",
+ "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-npm": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz",
+ "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "engines": {
+ "node": ">=0.12.0"
+ }
+ },
+ "node_modules/is-number-object": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz",
+ "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==",
+ "dev": true,
+ "dependencies": {
+ "has-tostringtag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-obj": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
+ "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-path-cwd": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz",
+ "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/is-path-inside": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
+ "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-plain-obj": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz",
+ "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-plain-object": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
+ "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
+ "dependencies": {
+ "isobject": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-potential-custom-element-name": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz",
+ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==",
+ "dev": true
+ },
+ "node_modules/is-regex": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
+ "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "has-tostringtag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-relative": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz",
+ "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==",
+ "dependencies": {
+ "is-unc-path": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-set": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz",
+ "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==",
+ "dev": true,
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-shared-array-buffer": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz",
+ "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-stream": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
+ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-string": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz",
+ "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==",
+ "dev": true,
+ "dependencies": {
+ "has-tostringtag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-symbol": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz",
+ "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
+ "dev": true,
+ "dependencies": {
+ "has-symbols": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-type-of": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz",
+ "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==",
+ "dependencies": {
+ "core-util-is": "^1.0.2",
+ "is-class-hotfix": "~0.0.6",
+ "isstream": "~0.1.2"
+ }
+ },
+ "node_modules/is-typed-array": {
+ "version": "1.1.12",
+ "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz",
+ "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==",
+ "dev": true,
+ "dependencies": {
+ "which-typed-array": "^1.1.11"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-typedarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
+ "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA=="
+ },
+ "node_modules/is-unc-path": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz",
+ "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==",
+ "dependencies": {
+ "unc-path-regex": "^0.1.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-unicode-supported": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz",
+ "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-upper-case": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/is-upper-case/-/is-upper-case-1.1.2.tgz",
+ "integrity": "sha512-GQYSJMgfeAmVwh9ixyk888l7OIhNAGKtY6QA+IrWlu9MDTCaXmeozOZ2S9Knj7bQwBO/H6J2kb+pbyTUiMNbsw==",
+ "dependencies": {
+ "upper-case": "^1.1.0"
+ }
+ },
+ "node_modules/is-valid-domain": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-valid-domain/-/is-valid-domain-0.1.6.tgz",
+ "integrity": "sha512-ZKtq737eFkZr71At8NxOFcP9O1K89gW3DkdrGMpp1upr/ueWjj+Weh4l9AI4rN0Gt8W2M1w7jrG2b/Yv83Ljpg==",
+ "dev": true,
+ "dependencies": {
+ "punycode": "^2.1.1"
+ }
+ },
+ "node_modules/is-weakmap": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz",
+ "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==",
+ "dev": true,
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-weakref": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz",
+ "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-weakset": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz",
+ "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "get-intrinsic": "^1.1.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-what": {
+ "version": "3.14.1",
+ "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz",
+ "integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==",
+ "devOptional": true
+ },
+ "node_modules/is-windows": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
+ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-wsl": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
+ "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
+ "dependencies": {
+ "is-docker": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-yarn-global": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz",
+ "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==",
+ "dev": true
+ },
+ "node_modules/isarray": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz",
+ "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",
+ "dev": true
+ },
+ "node_modules/isbinaryfile": {
+ "version": "4.0.10",
+ "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz",
+ "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==",
+ "engines": {
+ "node": ">= 8.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/gjtorikian/"
+ }
+ },
+ "node_modules/isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
+ },
+ "node_modules/isobject": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
+ "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/isstream": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
+ "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g=="
+ },
+ "node_modules/istanbul-lib-coverage": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz",
+ "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/istanbul-lib-hook": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz",
+ "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==",
+ "dev": true,
+ "dependencies": {
+ "append-transform": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/istanbul-lib-instrument": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz",
+ "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/core": "^7.12.3",
+ "@babel/parser": "^7.14.7",
+ "@istanbuljs/schema": "^0.1.2",
+ "istanbul-lib-coverage": "^3.2.0",
+ "semver": "^6.3.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/istanbul-lib-instrument/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/istanbul-lib-processinfo": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz",
+ "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==",
+ "dev": true,
+ "dependencies": {
+ "archy": "^1.0.0",
+ "cross-spawn": "^7.0.3",
+ "istanbul-lib-coverage": "^3.2.0",
+ "p-map": "^3.0.0",
+ "rimraf": "^3.0.0",
+ "uuid": "^8.3.2"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/istanbul-lib-processinfo/node_modules/p-map": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz",
+ "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==",
+ "dev": true,
+ "dependencies": {
+ "aggregate-error": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/istanbul-lib-processinfo/node_modules/rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dev": true,
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/istanbul-lib-report": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz",
+ "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==",
+ "dev": true,
+ "dependencies": {
+ "istanbul-lib-coverage": "^3.0.0",
+ "make-dir": "^4.0.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/istanbul-lib-report/node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/istanbul-lib-source-maps": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz",
+ "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==",
+ "dev": true,
+ "dependencies": {
+ "debug": "^4.1.1",
+ "istanbul-lib-coverage": "^3.0.0",
+ "source-map": "^0.6.1"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/istanbul-lib-source-maps/node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/istanbul-reports": {
+ "version": "3.1.6",
+ "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz",
+ "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==",
+ "dev": true,
+ "dependencies": {
+ "html-escaper": "^2.0.0",
+ "istanbul-lib-report": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/iterall": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/iterall/-/iterall-1.3.0.tgz",
+ "integrity": "sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg=="
+ },
+ "node_modules/iterator.prototype": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.2.tgz",
+ "integrity": "sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==",
+ "dev": true,
+ "dependencies": {
+ "define-properties": "^1.2.1",
+ "get-intrinsic": "^1.2.1",
+ "has-symbols": "^1.0.3",
+ "reflect.getprototypeof": "^1.0.4",
+ "set-function-name": "^2.0.1"
+ }
+ },
+ "node_modules/jackspeak": {
+ "version": "1.4.2",
+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-1.4.2.tgz",
+ "integrity": "sha512-GHeGTmnuaHnvS+ZctRB01bfxARuu9wW83ENbuiweu07SFcVlZrJpcshSre/keGT7YGBhLHg/+rXCNSrsEHKU4Q==",
+ "dev": true,
+ "dependencies": {
+ "cliui": "^7.0.4"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/jest": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz",
+ "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==",
+ "dev": true,
+ "dependencies": {
+ "@jest/core": "^29.7.0",
+ "@jest/types": "^29.6.3",
+ "import-local": "^3.0.2",
+ "jest-cli": "^29.7.0"
+ },
+ "bin": {
+ "jest": "bin/jest.js"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ },
+ "peerDependencies": {
+ "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"
+ },
+ "peerDependenciesMeta": {
+ "node-notifier": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/jest-changed-files": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz",
+ "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==",
+ "dev": true,
+ "dependencies": {
+ "execa": "^5.0.0",
+ "jest-util": "^29.7.0",
+ "p-limit": "^3.1.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-circus": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz",
+ "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==",
+ "dev": true,
+ "dependencies": {
+ "@jest/environment": "^29.7.0",
+ "@jest/expect": "^29.7.0",
+ "@jest/test-result": "^29.7.0",
+ "@jest/types": "^29.6.3",
+ "@types/node": "*",
+ "chalk": "^4.0.0",
+ "co": "^4.6.0",
+ "dedent": "^1.0.0",
+ "is-generator-fn": "^2.0.0",
+ "jest-each": "^29.7.0",
+ "jest-matcher-utils": "^29.7.0",
+ "jest-message-util": "^29.7.0",
+ "jest-runtime": "^29.7.0",
+ "jest-snapshot": "^29.7.0",
+ "jest-util": "^29.7.0",
+ "p-limit": "^3.1.0",
+ "pretty-format": "^29.7.0",
+ "pure-rand": "^6.0.0",
+ "slash": "^3.0.0",
+ "stack-utils": "^2.0.3"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-cli": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz",
+ "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==",
+ "dev": true,
+ "dependencies": {
+ "@jest/core": "^29.7.0",
+ "@jest/test-result": "^29.7.0",
+ "@jest/types": "^29.6.3",
+ "chalk": "^4.0.0",
+ "create-jest": "^29.7.0",
+ "exit": "^0.1.2",
+ "import-local": "^3.0.2",
+ "jest-config": "^29.7.0",
+ "jest-util": "^29.7.0",
+ "jest-validate": "^29.7.0",
+ "yargs": "^17.3.1"
+ },
+ "bin": {
+ "jest": "bin/jest.js"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ },
+ "peerDependencies": {
+ "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"
+ },
+ "peerDependenciesMeta": {
+ "node-notifier": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/jest-config": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz",
+ "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/core": "^7.11.6",
+ "@jest/test-sequencer": "^29.7.0",
+ "@jest/types": "^29.6.3",
+ "babel-jest": "^29.7.0",
+ "chalk": "^4.0.0",
+ "ci-info": "^3.2.0",
+ "deepmerge": "^4.2.2",
+ "glob": "^7.1.3",
+ "graceful-fs": "^4.2.9",
+ "jest-circus": "^29.7.0",
+ "jest-environment-node": "^29.7.0",
+ "jest-get-type": "^29.6.3",
+ "jest-regex-util": "^29.6.3",
+ "jest-resolve": "^29.7.0",
+ "jest-runner": "^29.7.0",
+ "jest-util": "^29.7.0",
+ "jest-validate": "^29.7.0",
+ "micromatch": "^4.0.4",
+ "parse-json": "^5.2.0",
+ "pretty-format": "^29.7.0",
+ "slash": "^3.0.0",
+ "strip-json-comments": "^3.1.1"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ },
+ "peerDependencies": {
+ "@types/node": "*",
+ "ts-node": ">=9.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "ts-node": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/jest-diff": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz",
+ "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==",
+ "dev": true,
+ "dependencies": {
+ "chalk": "^4.0.0",
+ "diff-sequences": "^29.6.3",
+ "jest-get-type": "^29.6.3",
+ "pretty-format": "^29.7.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-docblock": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz",
+ "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==",
+ "dev": true,
+ "dependencies": {
+ "detect-newline": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-each": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz",
+ "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==",
+ "dev": true,
+ "dependencies": {
+ "@jest/types": "^29.6.3",
+ "chalk": "^4.0.0",
+ "jest-get-type": "^29.6.3",
+ "jest-util": "^29.7.0",
+ "pretty-format": "^29.7.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-environment-node": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz",
+ "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==",
+ "dev": true,
+ "dependencies": {
+ "@jest/environment": "^29.7.0",
+ "@jest/fake-timers": "^29.7.0",
+ "@jest/types": "^29.6.3",
+ "@types/node": "*",
+ "jest-mock": "^29.7.0",
+ "jest-util": "^29.7.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-get-type": {
+ "version": "29.6.3",
+ "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz",
+ "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==",
+ "dev": true,
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-haste-map": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz",
+ "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==",
+ "dev": true,
+ "dependencies": {
+ "@jest/types": "^29.6.3",
+ "@types/graceful-fs": "^4.1.3",
+ "@types/node": "*",
+ "anymatch": "^3.0.3",
+ "fb-watchman": "^2.0.0",
+ "graceful-fs": "^4.2.9",
+ "jest-regex-util": "^29.6.3",
+ "jest-util": "^29.7.0",
+ "jest-worker": "^29.7.0",
+ "micromatch": "^4.0.4",
+ "walker": "^1.0.8"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "^2.3.2"
+ }
+ },
+ "node_modules/jest-leak-detector": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz",
+ "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==",
+ "dev": true,
+ "dependencies": {
+ "jest-get-type": "^29.6.3",
+ "pretty-format": "^29.7.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-matcher-utils": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz",
+ "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==",
+ "dev": true,
+ "dependencies": {
+ "chalk": "^4.0.0",
+ "jest-diff": "^29.7.0",
+ "jest-get-type": "^29.6.3",
+ "pretty-format": "^29.7.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-message-util": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz",
+ "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==",
+ "dev": true,
+ "dependencies": {
+ "@babel/code-frame": "^7.12.13",
+ "@jest/types": "^29.6.3",
+ "@types/stack-utils": "^2.0.0",
+ "chalk": "^4.0.0",
+ "graceful-fs": "^4.2.9",
+ "micromatch": "^4.0.4",
+ "pretty-format": "^29.7.0",
+ "slash": "^3.0.0",
+ "stack-utils": "^2.0.3"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-mock": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz",
+ "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==",
+ "dev": true,
+ "dependencies": {
+ "@jest/types": "^29.6.3",
+ "@types/node": "*",
+ "jest-util": "^29.7.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-pnp-resolver": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz",
+ "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ },
+ "peerDependencies": {
+ "jest-resolve": "*"
+ },
+ "peerDependenciesMeta": {
+ "jest-resolve": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/jest-regex-util": {
+ "version": "29.6.3",
+ "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz",
+ "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==",
+ "dev": true,
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-resolve": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz",
+ "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==",
+ "dev": true,
+ "dependencies": {
+ "chalk": "^4.0.0",
+ "graceful-fs": "^4.2.9",
+ "jest-haste-map": "^29.7.0",
+ "jest-pnp-resolver": "^1.2.2",
+ "jest-util": "^29.7.0",
+ "jest-validate": "^29.7.0",
+ "resolve": "^1.20.0",
+ "resolve.exports": "^2.0.0",
+ "slash": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-resolve-dependencies": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz",
+ "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==",
+ "dev": true,
+ "dependencies": {
+ "jest-regex-util": "^29.6.3",
+ "jest-snapshot": "^29.7.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-runner": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz",
+ "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==",
+ "dev": true,
+ "dependencies": {
+ "@jest/console": "^29.7.0",
+ "@jest/environment": "^29.7.0",
+ "@jest/test-result": "^29.7.0",
+ "@jest/transform": "^29.7.0",
+ "@jest/types": "^29.6.3",
+ "@types/node": "*",
+ "chalk": "^4.0.0",
+ "emittery": "^0.13.1",
+ "graceful-fs": "^4.2.9",
+ "jest-docblock": "^29.7.0",
+ "jest-environment-node": "^29.7.0",
+ "jest-haste-map": "^29.7.0",
+ "jest-leak-detector": "^29.7.0",
+ "jest-message-util": "^29.7.0",
+ "jest-resolve": "^29.7.0",
+ "jest-runtime": "^29.7.0",
+ "jest-util": "^29.7.0",
+ "jest-watcher": "^29.7.0",
+ "jest-worker": "^29.7.0",
+ "p-limit": "^3.1.0",
+ "source-map-support": "0.5.13"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-runner/node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/jest-runner/node_modules/source-map-support": {
+ "version": "0.5.13",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
+ "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
+ "dev": true,
+ "dependencies": {
+ "buffer-from": "^1.0.0",
+ "source-map": "^0.6.0"
+ }
+ },
+ "node_modules/jest-runtime": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz",
+ "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==",
+ "dev": true,
+ "dependencies": {
+ "@jest/environment": "^29.7.0",
+ "@jest/fake-timers": "^29.7.0",
+ "@jest/globals": "^29.7.0",
+ "@jest/source-map": "^29.6.3",
+ "@jest/test-result": "^29.7.0",
+ "@jest/transform": "^29.7.0",
+ "@jest/types": "^29.6.3",
+ "@types/node": "*",
+ "chalk": "^4.0.0",
+ "cjs-module-lexer": "^1.0.0",
+ "collect-v8-coverage": "^1.0.0",
+ "glob": "^7.1.3",
+ "graceful-fs": "^4.2.9",
+ "jest-haste-map": "^29.7.0",
+ "jest-message-util": "^29.7.0",
+ "jest-mock": "^29.7.0",
+ "jest-regex-util": "^29.6.3",
+ "jest-resolve": "^29.7.0",
+ "jest-snapshot": "^29.7.0",
+ "jest-util": "^29.7.0",
+ "slash": "^3.0.0",
+ "strip-bom": "^4.0.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-snapshot": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz",
+ "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/core": "^7.11.6",
+ "@babel/generator": "^7.7.2",
+ "@babel/plugin-syntax-jsx": "^7.7.2",
+ "@babel/plugin-syntax-typescript": "^7.7.2",
+ "@babel/types": "^7.3.3",
+ "@jest/expect-utils": "^29.7.0",
+ "@jest/transform": "^29.7.0",
+ "@jest/types": "^29.6.3",
+ "babel-preset-current-node-syntax": "^1.0.0",
+ "chalk": "^4.0.0",
+ "expect": "^29.7.0",
+ "graceful-fs": "^4.2.9",
+ "jest-diff": "^29.7.0",
+ "jest-get-type": "^29.6.3",
+ "jest-matcher-utils": "^29.7.0",
+ "jest-message-util": "^29.7.0",
+ "jest-util": "^29.7.0",
+ "natural-compare": "^1.4.0",
+ "pretty-format": "^29.7.0",
+ "semver": "^7.5.3"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-util": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz",
+ "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==",
+ "dev": true,
+ "dependencies": {
+ "@jest/types": "^29.6.3",
+ "@types/node": "*",
+ "chalk": "^4.0.0",
+ "ci-info": "^3.2.0",
+ "graceful-fs": "^4.2.9",
+ "picomatch": "^2.2.3"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-validate": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz",
+ "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==",
+ "dev": true,
+ "dependencies": {
+ "@jest/types": "^29.6.3",
+ "camelcase": "^6.2.0",
+ "chalk": "^4.0.0",
+ "jest-get-type": "^29.6.3",
+ "leven": "^3.1.0",
+ "pretty-format": "^29.7.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-validate/node_modules/camelcase": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/jest-watcher": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz",
+ "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==",
+ "dev": true,
+ "dependencies": {
+ "@jest/test-result": "^29.7.0",
+ "@jest/types": "^29.6.3",
+ "@types/node": "*",
+ "ansi-escapes": "^4.2.1",
+ "chalk": "^4.0.0",
+ "emittery": "^0.13.1",
+ "jest-util": "^29.7.0",
+ "string-length": "^4.0.1"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jest-worker": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz",
+ "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==",
+ "dev": true,
+ "dependencies": {
+ "@types/node": "*",
+ "jest-util": "^29.7.0",
+ "merge-stream": "^2.0.0",
+ "supports-color": "^8.0.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/jiti": {
+ "version": "1.20.0",
+ "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.20.0.tgz",
+ "integrity": "sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA==",
+ "dev": true,
+ "bin": {
+ "jiti": "bin/jiti.js"
+ }
+ },
+ "node_modules/joi": {
+ "version": "17.10.2",
+ "resolved": "https://registry.npmjs.org/joi/-/joi-17.10.2.tgz",
+ "integrity": "sha512-hcVhjBxRNW/is3nNLdGLIjkgXetkeGc2wyhydhz8KumG23Aerk4HPjU5zaPAMRqXQFc0xNqXTC7+zQjxr0GlKA==",
+ "dev": true,
+ "dependencies": {
+ "@hapi/hoek": "^9.0.0",
+ "@hapi/topo": "^5.0.0",
+ "@sideway/address": "^4.1.3",
+ "@sideway/formula": "^3.0.1",
+ "@sideway/pinpoint": "^2.0.0"
+ }
+ },
+ "node_modules/joycon": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz",
+ "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/js-cookie": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-2.2.1.tgz",
+ "integrity": "sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ=="
+ },
+ "node_modules/js-sha3": {
+ "version": "0.8.0",
+ "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz",
+ "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q=="
+ },
+ "node_modules/js-tokens": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
+ },
+ "node_modules/js-yaml": {
+ "version": "3.14.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
+ "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
+ "dev": true,
+ "dependencies": {
+ "argparse": "^1.0.7",
+ "esprima": "^4.0.0"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
+ "node_modules/jsdom": {
+ "version": "16.7.0",
+ "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz",
+ "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==",
+ "dev": true,
+ "dependencies": {
+ "abab": "^2.0.5",
+ "acorn": "^8.2.4",
+ "acorn-globals": "^6.0.0",
+ "cssom": "^0.4.4",
+ "cssstyle": "^2.3.0",
+ "data-urls": "^2.0.0",
+ "decimal.js": "^10.2.1",
+ "domexception": "^2.0.1",
+ "escodegen": "^2.0.0",
+ "form-data": "^3.0.0",
+ "html-encoding-sniffer": "^2.0.1",
+ "http-proxy-agent": "^4.0.1",
+ "https-proxy-agent": "^5.0.0",
+ "is-potential-custom-element-name": "^1.0.1",
+ "nwsapi": "^2.2.0",
+ "parse5": "6.0.1",
+ "saxes": "^5.0.1",
+ "symbol-tree": "^3.2.4",
+ "tough-cookie": "^4.0.0",
+ "w3c-hr-time": "^1.0.2",
+ "w3c-xmlserializer": "^2.0.0",
+ "webidl-conversions": "^6.1.0",
+ "whatwg-encoding": "^1.0.5",
+ "whatwg-mimetype": "^2.3.0",
+ "whatwg-url": "^8.5.0",
+ "ws": "^7.4.6",
+ "xml-name-validator": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "canvas": "^2.5.0"
+ },
+ "peerDependenciesMeta": {
+ "canvas": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/jsdom/node_modules/@tootallnate/once": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz",
+ "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==",
+ "dev": true,
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/jsdom/node_modules/form-data": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz",
+ "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==",
+ "dev": true,
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "mime-types": "^2.1.12"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/jsdom/node_modules/http-proxy-agent": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz",
+ "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==",
+ "dev": true,
+ "dependencies": {
+ "@tootallnate/once": "1",
+ "agent-base": "6",
+ "debug": "4"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/jsdom/node_modules/parse5": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz",
+ "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==",
+ "dev": true
+ },
+ "node_modules/jsesc": {
+ "version": "2.5.2",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
+ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
+ "bin": {
+ "jsesc": "bin/jsesc"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/json-buffer": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
+ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="
+ },
+ "node_modules/json-parse-better-errors": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
+ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
+ "dev": true
+ },
+ "node_modules/json-parse-even-better-errors": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
+ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="
+ },
+ "node_modules/json-schema-traverse": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="
+ },
+ "node_modules/json-source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/json-source-map/-/json-source-map-0.6.1.tgz",
+ "integrity": "sha512-1QoztHPsMQqhDq0hlXY5ZqcEdUzxQEIxgFkKl4WUp2pgShObl+9ovi4kRh2TfvAfxAoHOJ9vIMEqk3k4iex7tg==",
+ "dev": true
+ },
+ "node_modules/json-stable-stringify-without-jsonify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
+ "dev": true
+ },
+ "node_modules/json5": {
+ "version": "2.2.3",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
+ "bin": {
+ "json5": "lib/cli.js"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/jsonc-parser": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
+ "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
+ "dev": true
+ },
+ "node_modules/jsonfile": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
+ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
+ "dependencies": {
+ "universalify": "^2.0.0"
+ },
+ "optionalDependencies": {
+ "graceful-fs": "^4.1.6"
+ }
+ },
+ "node_modules/jsonfile/node_modules/universalify": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
+ "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
+ "node_modules/jsonparse": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz",
+ "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==",
+ "dev": true,
+ "engines": [
+ "node >= 0.2.0"
+ ]
+ },
+ "node_modules/jsonwebtoken": {
+ "version": "9.0.2",
+ "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz",
+ "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==",
+ "dependencies": {
+ "jws": "^3.2.2",
+ "lodash.includes": "^4.3.0",
+ "lodash.isboolean": "^3.0.3",
+ "lodash.isinteger": "^4.0.4",
+ "lodash.isnumber": "^3.0.3",
+ "lodash.isplainobject": "^4.0.6",
+ "lodash.isstring": "^4.0.1",
+ "lodash.once": "^4.0.0",
+ "ms": "^2.1.1",
+ "semver": "^7.5.4"
+ },
+ "engines": {
+ "node": ">=12",
+ "npm": ">=6"
+ }
+ },
+ "node_modules/jsonwebtoken/node_modules/jwa": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz",
+ "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==",
+ "dependencies": {
+ "buffer-equal-constant-time": "1.0.1",
+ "ecdsa-sig-formatter": "1.0.11",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/jsonwebtoken/node_modules/jws": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
+ "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
+ "dependencies": {
+ "jwa": "^1.4.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/jsx-ast-utils": {
+ "version": "3.3.5",
+ "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz",
+ "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==",
+ "dev": true,
+ "dependencies": {
+ "array-includes": "^3.1.6",
+ "array.prototype.flat": "^1.3.1",
+ "object.assign": "^4.1.4",
+ "object.values": "^1.1.6"
+ },
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/jwa": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz",
+ "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==",
+ "dependencies": {
+ "buffer-equal-constant-time": "1.0.1",
+ "ecdsa-sig-formatter": "1.0.11",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/jwk-to-pem": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/jwk-to-pem/-/jwk-to-pem-2.0.5.tgz",
+ "integrity": "sha512-L90jwellhO8jRKYwbssU9ifaMVqajzj3fpRjDKcsDzrslU9syRbFqfkXtT4B89HYAap+xsxNcxgBSB09ig+a7A==",
+ "dependencies": {
+ "asn1.js": "^5.3.0",
+ "elliptic": "^6.5.4",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/jws": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz",
+ "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==",
+ "dependencies": {
+ "jwa": "^2.0.0",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/kareem": {
+ "version": "2.5.1",
+ "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz",
+ "integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==",
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/karma-source-map-support": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/karma-source-map-support/-/karma-source-map-support-1.4.0.tgz",
+ "integrity": "sha512-RsBECncGO17KAoJCYXjv+ckIz+Ii9NCi+9enk+rq6XC81ezYkb4/RHE6CTXdA7IOJqoF3wcaLfVG0CPmE5ca6A==",
+ "dev": true,
+ "dependencies": {
+ "source-map-support": "^0.5.5"
+ }
+ },
+ "node_modules/keygrip": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz",
+ "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==",
+ "dependencies": {
+ "tsscmp": "1.0.6"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/keytar": {
+ "version": "7.9.0",
+ "resolved": "https://registry.npmjs.org/keytar/-/keytar-7.9.0.tgz",
+ "integrity": "sha512-VPD8mtVtm5JNtA2AErl6Chp06JBfy7diFQ7TQQhdpWOl6MrCRB+eRbvAZUsbGQS9kiMq0coJsy0W0vHpDCkWsQ==",
+ "dev": true,
+ "hasInstallScript": true,
+ "dependencies": {
+ "node-addon-api": "^4.3.0",
+ "prebuild-install": "^7.0.1"
+ }
+ },
+ "node_modules/keyv": {
+ "version": "4.5.3",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz",
+ "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==",
+ "dependencies": {
+ "json-buffer": "3.0.1"
+ }
+ },
+ "node_modules/kind-of": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
+ "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/kleur": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz",
+ "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/klona": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz",
+ "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==",
+ "dev": true,
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/knex": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/knex/-/knex-2.5.0.tgz",
+ "integrity": "sha512-h6Ru3PJmZjCDUEqLgwQ/RJUu06Bz7MTzY6sD90udLIa9qwtC7Rnicr7TBiWSaswZmDqk4EZ8xysdg1fkvhYM6w==",
+ "dependencies": {
+ "colorette": "2.0.19",
+ "commander": "^10.0.0",
+ "debug": "4.3.4",
+ "escalade": "^3.1.1",
+ "esm": "^3.2.25",
+ "get-package-type": "^0.1.0",
+ "getopts": "2.3.0",
+ "interpret": "^2.2.0",
+ "lodash": "^4.17.21",
+ "pg-connection-string": "2.6.1",
+ "rechoir": "^0.8.0",
+ "resolve-from": "^5.0.0",
+ "tarn": "^3.0.2",
+ "tildify": "2.0.0"
+ },
+ "bin": {
+ "knex": "bin/cli.js"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "peerDependenciesMeta": {
+ "better-sqlite3": {
+ "optional": true
+ },
+ "mysql": {
+ "optional": true
+ },
+ "mysql2": {
+ "optional": true
+ },
+ "pg": {
+ "optional": true
+ },
+ "pg-native": {
+ "optional": true
+ },
+ "sqlite3": {
+ "optional": true
+ },
+ "tedious": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/knex/node_modules/colorette": {
+ "version": "2.0.19",
+ "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz",
+ "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ=="
+ },
+ "node_modules/knex/node_modules/commander": {
+ "version": "10.0.1",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz",
+ "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==",
+ "engines": {
+ "node": ">=14"
+ }
+ },
+ "node_modules/knex/node_modules/pg-connection-string": {
+ "version": "2.6.1",
+ "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.1.tgz",
+ "integrity": "sha512-w6ZzNu6oMmIzEAYVw+RLK0+nqHPt8K3ZnknKi+g48Ak2pr3dtljJW3o+D/n2zzCG07Zoe9VOX3aiKpj+BN0pjg=="
+ },
+ "node_modules/koa": {
+ "version": "2.14.2",
+ "resolved": "https://registry.npmjs.org/koa/-/koa-2.14.2.tgz",
+ "integrity": "sha512-VFI2bpJaodz6P7x2uyLiX6RLYpZmOJqNmoCst/Yyd7hQlszyPwG/I9CQJ63nOtKSxpt5M7NH67V6nJL2BwCl7g==",
+ "peer": true,
+ "dependencies": {
+ "accepts": "^1.3.5",
+ "cache-content-type": "^1.0.0",
+ "content-disposition": "~0.5.2",
+ "content-type": "^1.0.4",
+ "cookies": "~0.8.0",
+ "debug": "^4.3.2",
+ "delegates": "^1.0.0",
+ "depd": "^2.0.0",
+ "destroy": "^1.0.4",
+ "encodeurl": "^1.0.2",
+ "escape-html": "^1.0.3",
+ "fresh": "~0.5.2",
+ "http-assert": "^1.3.0",
+ "http-errors": "^1.6.3",
+ "is-generator-function": "^1.0.7",
+ "koa-compose": "^4.1.0",
+ "koa-convert": "^2.0.0",
+ "on-finished": "^2.3.0",
+ "only": "~0.0.2",
+ "parseurl": "^1.3.2",
+ "statuses": "^1.5.0",
+ "type-is": "^1.6.16",
+ "vary": "^1.1.2"
+ },
+ "engines": {
+ "node": "^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4"
+ }
+ },
+ "node_modules/koa-body": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/koa-body/-/koa-body-4.2.0.tgz",
+ "integrity": "sha512-wdGu7b9amk4Fnk/ytH8GuWwfs4fsB5iNkY8kZPpgQVb04QZSv85T0M8reb+cJmvLE8cjPYvBzRikD3s6qz8OoA==",
+ "dependencies": {
+ "@types/formidable": "^1.0.31",
+ "co-body": "^5.1.1",
+ "formidable": "^1.1.1"
+ }
+ },
+ "node_modules/koa-bodyparser": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/koa-bodyparser/-/koa-bodyparser-4.4.1.tgz",
+ "integrity": "sha512-kBH3IYPMb+iAXnrxIhXnW+gXV8OTzCu8VPDqvcDHW9SQrbkHmqPQtiZwrltNmSq6/lpipHnT7k7PsjlVD7kK0w==",
+ "dependencies": {
+ "co-body": "^6.0.0",
+ "copy-to": "^2.0.1",
+ "type-is": "^1.6.18"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/koa-bodyparser/node_modules/co-body": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/co-body/-/co-body-6.1.0.tgz",
+ "integrity": "sha512-m7pOT6CdLN7FuXUcpuz/8lfQ/L77x8SchHCF4G0RBTJO20Wzmhn5Sp4/5WsKy8OSpifBSUrmg83qEqaDHdyFuQ==",
+ "dependencies": {
+ "inflation": "^2.0.0",
+ "qs": "^6.5.2",
+ "raw-body": "^2.3.3",
+ "type-is": "^1.6.16"
+ }
+ },
+ "node_modules/koa-compose": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz",
+ "integrity": "sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw=="
+ },
+ "node_modules/koa-compress": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/koa-compress/-/koa-compress-5.1.0.tgz",
+ "integrity": "sha512-G3Ppo9jrUwlchp6qdoRgQNMiGZtM0TAHkxRZQ7EoVvIG8E47J4nAsMJxXHAUQ+0oc7t0MDxSdONWTFcbzX7/Bg==",
+ "dependencies": {
+ "bytes": "^3.0.0",
+ "compressible": "^2.0.0",
+ "http-errors": "^1.8.0",
+ "koa-is-json": "^1.0.0",
+ "statuses": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
+ }
+ },
+ "node_modules/koa-compress/node_modules/depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/koa-compress/node_modules/http-errors": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
+ "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
+ "dependencies": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/koa-compress/node_modules/http-errors/node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/koa-convert": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-2.0.0.tgz",
+ "integrity": "sha512-asOvN6bFlSnxewce2e/DK3p4tltyfC4VM7ZwuTuepI7dEQVcvpyFuBcEARu1+Hxg8DIwytce2n7jrZtRlPrARA==",
+ "dependencies": {
+ "co": "^4.6.0",
+ "koa-compose": "^4.1.0"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/koa-favicon": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/koa-favicon/-/koa-favicon-2.1.0.tgz",
+ "integrity": "sha512-LvukcooYjxKtnZq0RXdBup+JDhaHwLgnLlDHB/xvjwQEjbc4rbp/0WkmOzpOvaHujc+fIwPear0dpKX1V+dHVg==",
+ "dependencies": {
+ "mz": "^2.7.0"
+ }
+ },
+ "node_modules/koa-helmet": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/koa-helmet/-/koa-helmet-7.0.2.tgz",
+ "integrity": "sha512-AvzS6VuEfFgbAm0mTUnkk/BpMarMcs5A56g+f0sfrJ6m63wII48d2GDrnUQGp0Nj+RR950vNtgqXm9UJSe7GOg==",
+ "dependencies": {
+ "helmet": "^6.0.1"
+ },
+ "engines": {
+ "node": ">= 14.0.0"
+ }
+ },
+ "node_modules/koa-ip": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/koa-ip/-/koa-ip-2.1.3.tgz",
+ "integrity": "sha512-QLVBByImwDq9enZXVOD3Astk876B7N0IYta7Kik4iyNB462rVzBB1/LD0Ek1F+v9nGUTHBFyhh8043EIlskK9Q==",
+ "dependencies": {
+ "debug": "4.3.4",
+ "lodash.isplainobject": "4.0.6",
+ "request-ip": "3.3.0"
+ }
+ },
+ "node_modules/koa-is-json": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/koa-is-json/-/koa-is-json-1.0.0.tgz",
+ "integrity": "sha512-+97CtHAlWDx0ndt0J8y3P12EWLwTLMXIfMnYDev3wOTwH/RpBGMlfn4bDXlMEg1u73K6XRE9BbUp+5ZAYoRYWw=="
+ },
+ "node_modules/koa-passport": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/koa-passport/-/koa-passport-5.0.0.tgz",
+ "integrity": "sha512-eNGg3TGgZ4ydm9DYCOqaa0ySSA/44BS6X+v4CKjP/nHOoXlADRonHsZvS3QWok6EV0ZL0V7FhfWxRYfD2B5kTQ==",
+ "dependencies": {
+ "passport": "^0.6.0"
+ },
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/koa-range": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/koa-range/-/koa-range-0.3.0.tgz",
+ "integrity": "sha512-Ich3pCz6RhtbajYXRWjIl6O5wtrLs6kE3nkXc9XmaWe+MysJyZO7K4L3oce1Jpg/iMgCbj+5UCiMm/rqVtcDIg==",
+ "dependencies": {
+ "stream-slice": "^0.1.2"
+ },
+ "engines": {
+ "node": ">=7"
+ }
+ },
+ "node_modules/koa-send": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/koa-send/-/koa-send-5.0.1.tgz",
+ "integrity": "sha512-tmcyQ/wXXuxpDxyNXv5yNNkdAMdFRqwtegBXUaowiQzUKqJehttS0x2j0eOZDQAyloAth5w6wwBImnFzkUz3pQ==",
+ "dependencies": {
+ "debug": "^4.1.1",
+ "http-errors": "^1.7.3",
+ "resolve-path": "^1.4.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/koa-send/node_modules/depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/koa-send/node_modules/http-errors": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
+ "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
+ "dependencies": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/koa-send/node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/koa-session": {
+ "version": "6.4.0",
+ "resolved": "https://registry.npmjs.org/koa-session/-/koa-session-6.4.0.tgz",
+ "integrity": "sha512-h/dxmSOvNEXpHQPRs4TV03TZVFyZIjmYQiTAW5JBFTYBOZ0VdpZ8QEE6Dud75g8z9JNGXi3m++VqRmqToB+c2A==",
+ "dependencies": {
+ "crc": "^3.8.0",
+ "debug": "^4.3.3",
+ "is-type-of": "^1.2.1",
+ "uuid": "^8.3.2"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/koa-static": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/koa-static/-/koa-static-5.0.0.tgz",
+ "integrity": "sha512-UqyYyH5YEXaJrf9S8E23GoJFQZXkBVJ9zYYMPGz919MSX1KuvAcycIuS0ci150HCoPf4XQVhQ84Qf8xRPWxFaQ==",
+ "dependencies": {
+ "debug": "^3.1.0",
+ "koa-send": "^5.0.0"
+ },
+ "engines": {
+ "node": ">= 7.6.0"
+ }
+ },
+ "node_modules/koa-static/node_modules/debug": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+ "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+ "dependencies": {
+ "ms": "^2.1.1"
+ }
+ },
+ "node_modules/koa/node_modules/http-errors": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
+ "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
+ "peer": true,
+ "dependencies": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/koa/node_modules/http-errors/node_modules/depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
+ "peer": true,
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/koa/node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "peer": true,
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/koa2-ratelimit": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/koa2-ratelimit/-/koa2-ratelimit-1.1.3.tgz",
+ "integrity": "sha512-gdrIw6m/D7pmScScL4dz50qLbRR3UGqvO1Vuy2dc7hVIuFAl1OVTnu6WFyEJ5GbfyLZFaCMWzRw6t4krvzvUTg==",
+ "engines": {
+ "node": ">=7.10.1"
+ },
+ "peerDependencies": {
+ "mongoose": ">= 5",
+ "redis": ">= 4.0.0",
+ "sequelize": ">=5.8.7"
+ },
+ "peerDependenciesMeta": {
+ "mongoose": {
+ "optional": true
+ },
+ "redis": {
+ "optional": true
+ },
+ "sequelize": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/kuler": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz",
+ "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A=="
+ },
+ "node_modules/language-subtag-registry": {
+ "version": "0.3.22",
+ "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz",
+ "integrity": "sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==",
+ "dev": true
+ },
+ "node_modules/language-tags": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.5.tgz",
+ "integrity": "sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ==",
+ "dev": true,
+ "dependencies": {
+ "language-subtag-registry": "~0.3.2"
+ }
+ },
+ "node_modules/latest-version": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz",
+ "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==",
+ "dev": true,
+ "dependencies": {
+ "package-json": "^6.3.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/launch-editor": {
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.6.0.tgz",
+ "integrity": "sha512-JpDCcQnyAAzZZaZ7vEiSqL690w7dAEyLao+KC96zBplnYbJS7TYNjvM3M7y3dGz+v7aIsJk3hllWuc0kWAjyRQ==",
+ "dependencies": {
+ "picocolors": "^1.0.0",
+ "shell-quote": "^1.7.3"
+ }
+ },
+ "node_modules/less": {
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/less/-/less-4.1.3.tgz",
+ "integrity": "sha512-w16Xk/Ta9Hhyei0Gpz9m7VS8F28nieJaL/VyShID7cYvP6IL5oHeL6p4TXSDJqZE/lNv0oJ2pGVjJsRkfwm5FA==",
+ "devOptional": true,
+ "dependencies": {
+ "copy-anything": "^2.0.1",
+ "parse-node-version": "^1.0.1",
+ "tslib": "^2.3.0"
+ },
+ "bin": {
+ "lessc": "bin/lessc"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "optionalDependencies": {
+ "errno": "^0.1.1",
+ "graceful-fs": "^4.1.2",
+ "image-size": "~0.5.0",
+ "make-dir": "^2.1.0",
+ "mime": "^1.4.1",
+ "needle": "^3.1.0",
+ "source-map": "~0.6.0"
+ }
+ },
+ "node_modules/less-loader": {
+ "version": "11.1.0",
+ "resolved": "https://registry.npmjs.org/less-loader/-/less-loader-11.1.0.tgz",
+ "integrity": "sha512-C+uDBV7kS7W5fJlUjq5mPBeBVhYpTIm5gB09APT9o3n/ILeaXVsiSFTbZpTJCJwQ/Crczfn3DmfQFwxYusWFug==",
+ "dev": true,
+ "dependencies": {
+ "klona": "^2.0.4"
+ },
+ "engines": {
+ "node": ">= 14.15.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "less": "^3.5.0 || ^4.0.0",
+ "webpack": "^5.0.0"
+ }
+ },
+ "node_modules/less/node_modules/make-dir": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
+ "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
+ "optional": true,
+ "dependencies": {
+ "pify": "^4.0.1",
+ "semver": "^5.6.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/less/node_modules/pify": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
+ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
+ "optional": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/less/node_modules/semver": {
+ "version": "5.7.2",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
+ "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
+ "optional": true,
+ "bin": {
+ "semver": "bin/semver"
+ }
+ },
+ "node_modules/less/node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "optional": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/leven": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
+ "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/levenshtein": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/levenshtein/-/levenshtein-1.0.5.tgz",
+ "integrity": "sha512-UQf1nnmxjl7O0+snDXj2YF2r74Gkya8ZpnegrUBYN9tikh2dtxV/ey8e07BO5wwo0i76yjOvbDhFHdcPEiH9aA==",
+ "dev": true,
+ "engines": [
+ "node >=0.2.0"
+ ]
+ },
+ "node_modules/levn": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
+ "dev": true,
+ "dependencies": {
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/libbase64": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/libbase64/-/libbase64-0.1.0.tgz",
+ "integrity": "sha512-B91jifmFw1DKEqEWstSpg1PbtUbBzR4yQAPT86kCQXBtud1AJVA+Z6RSklSrqmKe4q2eiEufgnhqJKPgozzfIQ=="
+ },
+ "node_modules/libmime": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/libmime/-/libmime-2.1.3.tgz",
+ "integrity": "sha512-ABr2f4O+K99sypmkF/yPz2aXxUFHEZzv+iUkxItCeKZWHHXdQPpDXd6rV1kBBwL4PserzLU09EIzJ2lxC9hPfQ==",
+ "dependencies": {
+ "iconv-lite": "0.4.15",
+ "libbase64": "0.1.0",
+ "libqp": "1.1.0"
+ }
+ },
+ "node_modules/libmime/node_modules/iconv-lite": {
+ "version": "0.4.15",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.15.tgz",
+ "integrity": "sha512-RGR+c9Lm+tLsvU57FTJJtdbv2hQw42Yl2n26tVIBaYmZzLN+EGfroUugN/z9nJf9kOXd49hBmpoGr4FEm+A4pw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/libqp": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/libqp/-/libqp-1.1.0.tgz",
+ "integrity": "sha512-4Rgfa0hZpG++t1Vi2IiqXG9Ad1ig4QTmtuZF946QJP4bPqOYC78ixUXgz5TW/wE7lNaNKlplSYTxQ+fR2KZ0EA=="
+ },
+ "node_modules/libtap": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/libtap/-/libtap-1.4.1.tgz",
+ "integrity": "sha512-S9v19shLTigoMn3c02V7LZ4t09zxmVP3r3RbEAwuHFYeKgF+ESFJxoQ0PMFKW4XdgQhcjVBEwDoopG6WROq/gw==",
+ "dev": true,
+ "dependencies": {
+ "async-hook-domain": "^2.0.4",
+ "bind-obj-methods": "^3.0.0",
+ "diff": "^4.0.2",
+ "function-loop": "^2.0.1",
+ "minipass": "^3.1.5",
+ "own-or": "^1.0.0",
+ "own-or-env": "^1.0.2",
+ "signal-exit": "^3.0.4",
+ "stack-utils": "^2.0.4",
+ "tap-parser": "^11.0.0",
+ "tap-yaml": "^1.0.0",
+ "tcompare": "^5.0.6",
+ "trivial-deferred": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/libtap/node_modules/minipass": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
+ "dev": true,
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/libtap/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ },
+ "node_modules/license-webpack-plugin": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/license-webpack-plugin/-/license-webpack-plugin-4.0.2.tgz",
+ "integrity": "sha512-771TFWFD70G1wLTC4oU2Cw4qvtmNrIw+wRvBtn+okgHl7slJVi7zfNcdmqDL72BojM30VNJ2UHylr1o77U37Jw==",
+ "dev": true,
+ "dependencies": {
+ "webpack-sources": "^3.0.0"
+ },
+ "peerDependenciesMeta": {
+ "webpack": {
+ "optional": true
+ },
+ "webpack-sources": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/liftoff": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz",
+ "integrity": "sha512-01zfGFqfORP1CGmZZP2Zn51zsqz4RltDi0RDOhbGoLYdUT5Lw+I2gX6QdwXhPITF6hPOHEOp+At6/L24hIg9WQ==",
+ "dependencies": {
+ "extend": "^3.0.0",
+ "findup-sync": "^2.0.0",
+ "fined": "^1.0.1",
+ "flagged-respawn": "^1.0.0",
+ "is-plain-object": "^2.0.4",
+ "object.map": "^1.0.0",
+ "rechoir": "^0.6.2",
+ "resolve": "^1.1.7"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/liftoff/node_modules/rechoir": {
+ "version": "0.6.2",
+ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
+ "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==",
+ "dependencies": {
+ "resolve": "^1.1.6"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/light-my-request": {
+ "version": "5.11.0",
+ "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.11.0.tgz",
+ "integrity": "sha512-qkFCeloXCOMpmEdZ/MV91P8AT4fjwFXWaAFz3lUeStM8RcoM1ks4J/F8r1b3r6y/H4u3ACEJ1T+Gv5bopj7oDA==",
+ "dependencies": {
+ "cookie": "^0.5.0",
+ "process-warning": "^2.0.0",
+ "set-cookie-parser": "^2.4.1"
+ }
+ },
+ "node_modules/lines-and-columns": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
+ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="
+ },
+ "node_modules/linkify-it": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz",
+ "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==",
+ "dependencies": {
+ "uc.micro": "^1.0.1"
+ }
+ },
+ "node_modules/load-json-file": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
+ "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==",
+ "dev": true,
+ "dependencies": {
+ "graceful-fs": "^4.1.2",
+ "parse-json": "^4.0.0",
+ "pify": "^3.0.0",
+ "strip-bom": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/load-json-file/node_modules/parse-json": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
+ "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==",
+ "dev": true,
+ "dependencies": {
+ "error-ex": "^1.3.1",
+ "json-parse-better-errors": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/load-json-file/node_modules/strip-bom": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
+ "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/loader-runner": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz",
+ "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==",
+ "engines": {
+ "node": ">=6.11.5"
+ }
+ },
+ "node_modules/loader-utils": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.1.tgz",
+ "integrity": "sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==",
+ "dev": true,
+ "engines": {
+ "node": ">= 12.13.0"
+ }
+ },
+ "node_modules/locate-path": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
+ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
+ "dependencies": {
+ "p-locate": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/lodash": {
+ "version": "4.17.21",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
+ },
+ "node_modules/lodash-es": {
+ "version": "4.17.21",
+ "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz",
+ "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw=="
+ },
+ "node_modules/lodash.debounce": {
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
+ "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==",
+ "dev": true
+ },
+ "node_modules/lodash.deburr": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz",
+ "integrity": "sha512-m/M1U1f3ddMCs6Hq2tAsYThTBDaAKFDX3dwDo97GEYzamXi9SqUpjWi/Rrj/gf3X2n8ktwgZrlP1z6E3v/IExQ=="
+ },
+ "node_modules/lodash.flattendeep": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz",
+ "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==",
+ "dev": true
+ },
+ "node_modules/lodash.get": {
+ "version": "4.4.2",
+ "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
+ "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ=="
+ },
+ "node_modules/lodash.includes": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
+ "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w=="
+ },
+ "node_modules/lodash.isboolean": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz",
+ "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg=="
+ },
+ "node_modules/lodash.isinteger": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",
+ "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA=="
+ },
+ "node_modules/lodash.isnumber": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz",
+ "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw=="
+ },
+ "node_modules/lodash.isplainobject": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
+ "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA=="
+ },
+ "node_modules/lodash.isstring": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz",
+ "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw=="
+ },
+ "node_modules/lodash.merge": {
+ "version": "4.6.2",
+ "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
+ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
+ "dev": true
+ },
+ "node_modules/lodash.once": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
+ "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg=="
+ },
+ "node_modules/lodash.set": {
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz",
+ "integrity": "sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg=="
+ },
+ "node_modules/lodash.sortby": {
+ "version": "4.7.0",
+ "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz",
+ "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA=="
+ },
+ "node_modules/log-symbols": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz",
+ "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==",
+ "dependencies": {
+ "chalk": "^4.1.0",
+ "is-unicode-supported": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/logform": {
+ "version": "2.5.1",
+ "resolved": "https://registry.npmjs.org/logform/-/logform-2.5.1.tgz",
+ "integrity": "sha512-9FyqAm9o9NKKfiAKfZoYo9bGXXuwMkxQiQttkT4YjjVtQVIQtK6LmVtlxmCaFswo6N4AfEkHqZTV0taDtPotNg==",
+ "dependencies": {
+ "@colors/colors": "1.5.0",
+ "@types/triple-beam": "^1.3.2",
+ "fecha": "^4.2.0",
+ "ms": "^2.1.1",
+ "safe-stable-stringify": "^2.3.1",
+ "triple-beam": "^1.3.0"
+ }
+ },
+ "node_modules/loglevel": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.8.1.tgz",
+ "integrity": "sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg==",
+ "engines": {
+ "node": ">= 0.6.0"
+ },
+ "funding": {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/loglevel"
+ }
+ },
+ "node_modules/long": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
+ "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA=="
+ },
+ "node_modules/long-timeout": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/long-timeout/-/long-timeout-0.1.1.tgz",
+ "integrity": "sha512-BFRuQUqc7x2NWxfJBCyUrN8iYUYznzL9JROmRz1gZ6KlOIgmoD+njPVbb+VNn2nGMKggMsK79iUNErillsrx7w=="
+ },
+ "node_modules/loose-envify": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
+ "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
+ "dependencies": {
+ "js-tokens": "^3.0.0 || ^4.0.0"
+ },
+ "bin": {
+ "loose-envify": "cli.js"
+ }
+ },
+ "node_modules/lower-case": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz",
+ "integrity": "sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA=="
+ },
+ "node_modules/lower-case-first": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/lower-case-first/-/lower-case-first-1.0.2.tgz",
+ "integrity": "sha512-UuxaYakO7XeONbKrZf5FEgkantPf5DUqDayzP5VXZrtRPdH86s4kN47I8B3TW10S4QKiE3ziHNf3kRN//okHjA==",
+ "dependencies": {
+ "lower-case": "^1.1.2"
+ }
+ },
+ "node_modules/lowercase-keys": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz",
+ "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/lru_map": {
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz",
+ "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ=="
+ },
+ "node_modules/lru-cache": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
+ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
+ "dependencies": {
+ "yallist": "^3.0.2"
+ }
+ },
+ "node_modules/luxon": {
+ "version": "1.28.1",
+ "resolved": "https://registry.npmjs.org/luxon/-/luxon-1.28.1.tgz",
+ "integrity": "sha512-gYHAa180mKrNIUJCbwpmD0aTu9kV0dREDrwNnuyFAsO1Wt0EVYSZelPnJlbj9HplzXX/YWXHFTL45kvZ53M0pw==",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/magic-string": {
+ "version": "0.30.1",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.1.tgz",
+ "integrity": "sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==",
+ "dev": true,
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.4.15"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/mailcomposer": {
+ "version": "3.12.0",
+ "resolved": "https://registry.npmjs.org/mailcomposer/-/mailcomposer-3.12.0.tgz",
+ "integrity": "sha512-zBeDoKUTNI8IAsazoMQFt3eVSVRtDtgrvBjBVdBjxDEX+5KLlKtEFCrBXnxPhs8aTYufUS1SmbFnGpjHS53deg==",
+ "deprecated": "This project is unmaintained",
+ "dependencies": {
+ "buildmail": "3.10.0",
+ "libmime": "2.1.0"
+ }
+ },
+ "node_modules/mailcomposer/node_modules/iconv-lite": {
+ "version": "0.4.13",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.13.tgz",
+ "integrity": "sha512-QwVuTNQv7tXC5mMWFX5N5wGjmybjNBBD8P3BReTkPmipoxTUFgWM2gXNvldHQr6T14DH0Dh6qBVg98iJt7u4mQ==",
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/mailcomposer/node_modules/libmime": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/libmime/-/libmime-2.1.0.tgz",
+ "integrity": "sha512-4be2R6/jOasyPTw0BkpIZBVk2cElqjdIdS0PRPhbOCV4wWuL/ZcYYpN1BCTVB+6eIQ0uuAwp5hQTHFrM5Joa8w==",
+ "dependencies": {
+ "iconv-lite": "0.4.13",
+ "libbase64": "0.1.0",
+ "libqp": "1.1.0"
+ }
+ },
+ "node_modules/make-dir": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz",
+ "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==",
+ "dev": true,
+ "dependencies": {
+ "semver": "^7.5.3"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/make-error": {
+ "version": "1.3.6",
+ "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
+ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
+ "dev": true
+ },
+ "node_modules/make-fetch-happen": {
+ "version": "11.1.1",
+ "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.1.1.tgz",
+ "integrity": "sha512-rLWS7GCSTcEujjVBs2YqG7Y4643u8ucvCJeSRqiLYhesrDuzeuFIk37xREzAsfQaqzl8b9rNCE4m6J8tvX4Q8w==",
+ "dev": true,
+ "dependencies": {
+ "agentkeepalive": "^4.2.1",
+ "cacache": "^17.0.0",
+ "http-cache-semantics": "^4.1.1",
+ "http-proxy-agent": "^5.0.0",
+ "https-proxy-agent": "^5.0.0",
+ "is-lambda": "^1.0.1",
+ "lru-cache": "^7.7.1",
+ "minipass": "^5.0.0",
+ "minipass-fetch": "^3.0.0",
+ "minipass-flush": "^1.0.5",
+ "minipass-pipeline": "^1.2.4",
+ "negotiator": "^0.6.3",
+ "promise-retry": "^2.0.1",
+ "socks-proxy-agent": "^7.0.0",
+ "ssri": "^10.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/make-fetch-happen/node_modules/lru-cache": {
+ "version": "7.18.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",
+ "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/make-iterator": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz",
+ "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==",
+ "dependencies": {
+ "kind-of": "^6.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/make-promises-safe": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/make-promises-safe/-/make-promises-safe-5.1.0.tgz",
+ "integrity": "sha512-AfdZ49rtyhQR/6cqVKGoH7y4ql7XkS5HJI1lZm0/5N6CQosy1eYbBJ/qbhkKHzo17UH7M918Bysf6XB9f3kS1g=="
+ },
+ "node_modules/makeerror": {
+ "version": "1.0.12",
+ "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz",
+ "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==",
+ "dependencies": {
+ "tmpl": "1.0.5"
+ }
+ },
+ "node_modules/map-cache": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
+ "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/map-visit": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz",
+ "integrity": "sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==",
+ "dependencies": {
+ "object-visit": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/markdown-it": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz",
+ "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==",
+ "dependencies": {
+ "argparse": "^2.0.1",
+ "entities": "~2.1.0",
+ "linkify-it": "^3.0.1",
+ "mdurl": "^1.0.1",
+ "uc.micro": "^1.0.5"
+ },
+ "bin": {
+ "markdown-it": "bin/markdown-it.js"
+ }
+ },
+ "node_modules/markdown-it-abbr": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/markdown-it-abbr/-/markdown-it-abbr-1.0.4.tgz",
+ "integrity": "sha512-ZeA4Z4SaBbYysZap5iZcxKmlPL6bYA8grqhzJIHB1ikn7njnzaP8uwbtuXc4YXD5LicI4/2Xmc0VwmSiFV04gg=="
+ },
+ "node_modules/markdown-it-container": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/markdown-it-container/-/markdown-it-container-3.0.0.tgz",
+ "integrity": "sha512-y6oKTq4BB9OQuY/KLfk/O3ysFhB3IMYoIWhGJEidXt1NQFocFK2sA2t0NYZAMyMShAGL6x5OPIbrmXPIqaN9rw=="
+ },
+ "node_modules/markdown-it-deflist": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/markdown-it-deflist/-/markdown-it-deflist-2.1.0.tgz",
+ "integrity": "sha512-3OuqoRUlSxJiuQYu0cWTLHNhhq2xtoSFqsZK8plANg91+RJQU1ziQ6lA2LzmFAEes18uPBsHZpcX6We5l76Nzg=="
+ },
+ "node_modules/markdown-it-emoji": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/markdown-it-emoji/-/markdown-it-emoji-2.0.2.tgz",
+ "integrity": "sha512-zLftSaNrKuYl0kR5zm4gxXjHaOI3FAOEaloKmRA5hijmJZvSjmxcokOLlzycb/HXlUFWzXqpIEoyEMCE4i9MvQ=="
+ },
+ "node_modules/markdown-it-footnote": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/markdown-it-footnote/-/markdown-it-footnote-3.0.3.tgz",
+ "integrity": "sha512-YZMSuCGVZAjzKMn+xqIco9d1cLGxbELHZ9do/TSYVzraooV8ypsppKNmUJ0fVH5ljkCInQAtFpm8Rb3eXSrt5w=="
+ },
+ "node_modules/markdown-it-ins": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/markdown-it-ins/-/markdown-it-ins-3.0.1.tgz",
+ "integrity": "sha512-32SSfZqSzqyAmmQ4SHvhxbFqSzPDqsZgMHDwxqPzp+v+t8RsmqsBZRG+RfRQskJko9PfKC2/oxyOs4Yg/CfiRw=="
+ },
+ "node_modules/markdown-it-mark": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/markdown-it-mark/-/markdown-it-mark-3.0.1.tgz",
+ "integrity": "sha512-HyxjAu6BRsdt6Xcv6TKVQnkz/E70TdGXEFHRYBGLncRE9lBFwDNLVtFojKxjJWgJ+5XxUwLaHXy+2sGBbDn+4A=="
+ },
+ "node_modules/markdown-it-sub": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz",
+ "integrity": "sha512-z2Rm/LzEE1wzwTSDrI+FlPEveAAbgdAdPhdWarq/ZGJrGW/uCQbKAnhoCsE4hAbc3SEym26+W2z/VQB0cQiA9Q=="
+ },
+ "node_modules/markdown-it-sup": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz",
+ "integrity": "sha512-E32m0nV9iyhRR7CrhnzL5msqic7rL1juWre6TQNxsnApg7Uf+F97JOKxUijg5YwXz86lZ0mqfOnutoryyNdntQ=="
+ },
+ "node_modules/markdown-it/node_modules/argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
+ },
+ "node_modules/markdown-it/node_modules/entities": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz",
+ "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==",
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
+ "node_modules/match-sorter": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/match-sorter/-/match-sorter-6.3.1.tgz",
+ "integrity": "sha512-mxybbo3pPNuA+ZuCUhm5bwNkXrJTbsk5VWbR5wiwz/GC6LIiegBGn2w3O08UG/jdbYLinw51fSQ5xNU1U3MgBw==",
+ "dependencies": {
+ "@babel/runtime": "^7.12.5",
+ "remove-accents": "0.4.2"
+ }
+ },
+ "node_modules/md5": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz",
+ "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==",
+ "dev": true,
+ "dependencies": {
+ "charenc": "0.0.2",
+ "crypt": "0.0.2",
+ "is-buffer": "~1.1.6"
+ }
+ },
+ "node_modules/mdast-util-definitions": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-5.1.2.tgz",
+ "integrity": "sha512-8SVPMuHqlPME/z3gqVwWY4zVXn8lqKv/pAhC57FuJ40ImXyBpmO5ukh98zB2v7Blql2FiHjHv9LVztSIqjY+MA==",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "@types/unist": "^2.0.0",
+ "unist-util-visit": "^4.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-from-markdown": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.1.tgz",
+ "integrity": "sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "@types/unist": "^2.0.0",
+ "decode-named-character-reference": "^1.0.0",
+ "mdast-util-to-string": "^3.1.0",
+ "micromark": "^3.0.0",
+ "micromark-util-decode-numeric-character-reference": "^1.0.0",
+ "micromark-util-decode-string": "^1.0.0",
+ "micromark-util-normalize-identifier": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "unist-util-stringify-position": "^3.0.0",
+ "uvu": "^0.5.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-to-hast": {
+ "version": "12.3.0",
+ "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.3.0.tgz",
+ "integrity": "sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "@types/mdast": "^3.0.0",
+ "mdast-util-definitions": "^5.0.0",
+ "micromark-util-sanitize-uri": "^1.1.0",
+ "trim-lines": "^3.0.0",
+ "unist-util-generated": "^2.0.0",
+ "unist-util-position": "^4.0.0",
+ "unist-util-visit": "^4.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-to-string": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz",
+ "integrity": "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==",
+ "dependencies": {
+ "@types/mdast": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdurl": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
+ "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g=="
+ },
+ "node_modules/media-typer": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
+ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/memfs": {
+ "version": "3.5.3",
+ "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.5.3.tgz",
+ "integrity": "sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==",
+ "dependencies": {
+ "fs-monkey": "^1.0.4"
+ },
+ "engines": {
+ "node": ">= 4.0.0"
+ }
+ },
+ "node_modules/memoize-one": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz",
+ "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw=="
+ },
+ "node_modules/memory-pager": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
+ "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",
+ "optional": true
+ },
+ "node_modules/memorystream": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz",
+ "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.10.0"
+ }
+ },
+ "node_modules/merge-descriptors": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
+ "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
+ },
+ "node_modules/merge-stream": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
+ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="
+ },
+ "node_modules/merge2": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
+ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/methods": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
+ "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/micromark": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/micromark/-/micromark-3.2.0.tgz",
+ "integrity": "sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "@types/debug": "^4.0.0",
+ "debug": "^4.0.0",
+ "decode-named-character-reference": "^1.0.0",
+ "micromark-core-commonmark": "^1.0.1",
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-chunked": "^1.0.0",
+ "micromark-util-combine-extensions": "^1.0.0",
+ "micromark-util-decode-numeric-character-reference": "^1.0.0",
+ "micromark-util-encode": "^1.0.0",
+ "micromark-util-normalize-identifier": "^1.0.0",
+ "micromark-util-resolve-all": "^1.0.0",
+ "micromark-util-sanitize-uri": "^1.0.0",
+ "micromark-util-subtokenize": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.1",
+ "uvu": "^0.5.0"
+ }
+ },
+ "node_modules/micromark-core-commonmark": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz",
+ "integrity": "sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "decode-named-character-reference": "^1.0.0",
+ "micromark-factory-destination": "^1.0.0",
+ "micromark-factory-label": "^1.0.0",
+ "micromark-factory-space": "^1.0.0",
+ "micromark-factory-title": "^1.0.0",
+ "micromark-factory-whitespace": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-chunked": "^1.0.0",
+ "micromark-util-classify-character": "^1.0.0",
+ "micromark-util-html-tag-name": "^1.0.0",
+ "micromark-util-normalize-identifier": "^1.0.0",
+ "micromark-util-resolve-all": "^1.0.0",
+ "micromark-util-subtokenize": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.1",
+ "uvu": "^0.5.0"
+ }
+ },
+ "node_modules/micromark-factory-destination": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.1.0.tgz",
+ "integrity": "sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-factory-label": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.1.0.tgz",
+ "integrity": "sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ }
+ },
+ "node_modules/micromark-factory-space": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.1.0.tgz",
+ "integrity": "sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-factory-title": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.1.0.tgz",
+ "integrity": "sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-factory-whitespace": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.1.0.tgz",
+ "integrity": "sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-character": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.2.0.tgz",
+ "integrity": "sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-chunked": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.1.0.tgz",
+ "integrity": "sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-classify-character": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-1.1.0.tgz",
+ "integrity": "sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-combine-extensions": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.1.0.tgz",
+ "integrity": "sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "micromark-util-chunked": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-decode-numeric-character-reference": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.1.0.tgz",
+ "integrity": "sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-decode-string": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-1.1.0.tgz",
+ "integrity": "sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "decode-named-character-reference": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-decode-numeric-character-reference": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-encode": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.1.0.tgz",
+ "integrity": "sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ]
+ },
+ "node_modules/micromark-util-html-tag-name": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.2.0.tgz",
+ "integrity": "sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ]
+ },
+ "node_modules/micromark-util-normalize-identifier": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.1.0.tgz",
+ "integrity": "sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-resolve-all": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-1.1.0.tgz",
+ "integrity": "sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-sanitize-uri": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.2.0.tgz",
+ "integrity": "sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-encode": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-subtokenize": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-1.1.0.tgz",
+ "integrity": "sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "dependencies": {
+ "micromark-util-chunked": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ }
+ },
+ "node_modules/micromark-util-symbol": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.1.0.tgz",
+ "integrity": "sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ]
+ },
+ "node_modules/micromark-util-types": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.1.0.tgz",
+ "integrity": "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ]
+ },
+ "node_modules/micromark/node_modules/@types/debug": {
+ "version": "4.1.9",
+ "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.9.tgz",
+ "integrity": "sha512-8Hz50m2eoS56ldRlepxSBa6PWEVCtzUo/92HgLc2qTMnotJNIm7xP+UZhyWoYsyOdd5dxZ+NZLb24rsKyFs2ow==",
+ "dependencies": {
+ "@types/ms": "*"
+ }
+ },
+ "node_modules/micromatch": {
+ "version": "4.0.5",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
+ "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
+ "dependencies": {
+ "braces": "^3.0.2",
+ "picomatch": "^2.3.1"
+ },
+ "engines": {
+ "node": ">=8.6"
+ }
+ },
+ "node_modules/microseconds": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/microseconds/-/microseconds-0.2.0.tgz",
+ "integrity": "sha512-n7DHHMjR1avBbSpsTBj6fmMGh2AGrifVV4e+WYc3Q9lO+xnSZ3NyhcBND3vzzatt05LFhoKFRxrIyklmLlUtyA=="
+ },
+ "node_modules/mime": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+ "bin": {
+ "mime": "cli.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/mime-db": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "2.1.35",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mimic-fn": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/mimic-response": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
+ "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/mini-css-extract-plugin": {
+ "version": "2.7.6",
+ "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.6.tgz",
+ "integrity": "sha512-Qk7HcgaPkGG6eD77mLvZS1nmxlao3j+9PkrT9Uc7HAE1id3F41+DdBRYRYkbyfNRGzm8/YWtzhw7nVPmwhqTQw==",
+ "dev": true,
+ "dependencies": {
+ "schema-utils": "^4.0.0"
+ },
+ "engines": {
+ "node": ">= 12.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "webpack": "^5.0.0"
+ }
+ },
+ "node_modules/minimalistic-assert": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
+ "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A=="
+ },
+ "node_modules/minimalistic-crypto-utils": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
+ "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg=="
+ },
+ "node_modules/minimatch": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/minimist": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/minipass": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz",
+ "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/minipass-collect": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz",
+ "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==",
+ "dev": true,
+ "dependencies": {
+ "minipass": "^3.0.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/minipass-collect/node_modules/minipass": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
+ "dev": true,
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/minipass-collect/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ },
+ "node_modules/minipass-fetch": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.4.tgz",
+ "integrity": "sha512-jHAqnA728uUpIaFm7NWsCnqKT6UqZz7GcI/bDpPATuwYyKwJwW0remxSCxUlKiEty+eopHGa3oc8WxgQ1FFJqg==",
+ "dev": true,
+ "dependencies": {
+ "minipass": "^7.0.3",
+ "minipass-sized": "^1.0.3",
+ "minizlib": "^2.1.2"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ },
+ "optionalDependencies": {
+ "encoding": "^0.1.13"
+ }
+ },
+ "node_modules/minipass-fetch/node_modules/minipass": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz",
+ "integrity": "sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==",
+ "dev": true,
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ }
+ },
+ "node_modules/minipass-flush": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz",
+ "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==",
+ "dev": true,
+ "dependencies": {
+ "minipass": "^3.0.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/minipass-flush/node_modules/minipass": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
+ "dev": true,
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/minipass-flush/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ },
+ "node_modules/minipass-json-stream": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz",
+ "integrity": "sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg==",
+ "dev": true,
+ "dependencies": {
+ "jsonparse": "^1.3.1",
+ "minipass": "^3.0.0"
+ }
+ },
+ "node_modules/minipass-json-stream/node_modules/minipass": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
+ "dev": true,
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/minipass-json-stream/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ },
+ "node_modules/minipass-pipeline": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz",
+ "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==",
+ "dev": true,
+ "dependencies": {
+ "minipass": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/minipass-pipeline/node_modules/minipass": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
+ "dev": true,
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/minipass-pipeline/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ },
+ "node_modules/minipass-sized": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz",
+ "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==",
+ "dev": true,
+ "dependencies": {
+ "minipass": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/minipass-sized/node_modules/minipass": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
+ "dev": true,
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/minipass-sized/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ },
+ "node_modules/minizlib": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",
+ "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==",
+ "dependencies": {
+ "minipass": "^3.0.0",
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/minizlib/node_modules/minipass": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/minizlib/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
+ },
+ "node_modules/mixin-deep": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
+ "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
+ "dependencies": {
+ "for-in": "^1.0.2",
+ "is-extendable": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/mkdirp": {
+ "version": "0.5.6",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
+ "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
+ "dependencies": {
+ "minimist": "^1.2.6"
+ },
+ "bin": {
+ "mkdirp": "bin/cmd.js"
+ }
+ },
+ "node_modules/mkdirp-classic": {
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
+ "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
+ },
+ "node_modules/module-details-from-path": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz",
+ "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A=="
+ },
+ "node_modules/mongodb": {
+ "version": "4.17.1",
+ "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.17.1.tgz",
+ "integrity": "sha512-MBuyYiPUPRTqfH2dV0ya4dcr2E5N52ocBuZ8Sgg/M030nGF78v855B3Z27mZJnp8PxjnUquEnAtjOsphgMZOlQ==",
+ "dependencies": {
+ "bson": "^4.7.2",
+ "mongodb-connection-string-url": "^2.6.0",
+ "socks": "^2.7.1"
+ },
+ "engines": {
+ "node": ">=12.9.0"
+ },
+ "optionalDependencies": {
+ "@aws-sdk/credential-providers": "^3.186.0",
+ "@mongodb-js/saslprep": "^1.1.0"
+ }
+ },
+ "node_modules/mongodb-connection-string-url": {
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz",
+ "integrity": "sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==",
+ "dependencies": {
+ "@types/whatwg-url": "^8.2.1",
+ "whatwg-url": "^11.0.0"
+ }
+ },
+ "node_modules/mongodb-connection-string-url/node_modules/tr46": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz",
+ "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==",
+ "dependencies": {
+ "punycode": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/mongodb-connection-string-url/node_modules/webidl-conversions": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
+ "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/mongodb-connection-string-url/node_modules/whatwg-url": {
+ "version": "11.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz",
+ "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==",
+ "dependencies": {
+ "tr46": "^3.0.0",
+ "webidl-conversions": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/mongoose": {
+ "version": "6.12.0",
+ "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.12.0.tgz",
+ "integrity": "sha512-sd/q83C6TBRPBrrD2A/POSbA/exbCFM2WOuY7Lf2JuIJFlHFG39zYSDTTAEiYlzIfahNOLmXPxBGFxdAch41Mw==",
+ "dependencies": {
+ "bson": "^4.7.2",
+ "kareem": "2.5.1",
+ "mongodb": "4.17.1",
+ "mpath": "0.9.0",
+ "mquery": "4.0.3",
+ "ms": "2.1.3",
+ "sift": "16.0.1"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/mongoose"
+ }
+ },
+ "node_modules/mongoose/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
+ },
+ "node_modules/mpath": {
+ "version": "0.9.0",
+ "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz",
+ "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==",
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/mquery": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/mquery/-/mquery-4.0.3.tgz",
+ "integrity": "sha512-J5heI+P08I6VJ2Ky3+33IpCdAvlYGTSUjwTPxkAr8i8EoduPMBX2OY/wa3IKZIQl7MU4SbFk8ndgSKyB/cl1zA==",
+ "dependencies": {
+ "debug": "4.x"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/mri": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
+ "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/mrmime": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-1.0.1.tgz",
+ "integrity": "sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+ },
+ "node_modules/multicast-dns": {
+ "version": "7.2.5",
+ "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz",
+ "integrity": "sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==",
+ "dependencies": {
+ "dns-packet": "^5.2.2",
+ "thunky": "^1.0.2"
+ },
+ "bin": {
+ "multicast-dns": "cli.js"
+ }
+ },
+ "node_modules/multistream": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/multistream/-/multistream-4.1.0.tgz",
+ "integrity": "sha512-J1XDiAmmNpRCBfIWJv+n0ymC4ABcf/Pl+5YvC5B/D2f/2+8PtHvCNxMPKiQcZyi922Hq69J2YOpb1pTywfifyw==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "dependencies": {
+ "once": "^1.4.0",
+ "readable-stream": "^3.6.0"
+ }
+ },
+ "node_modules/mute-stream": {
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz",
+ "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA=="
+ },
+ "node_modules/mz": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",
+ "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==",
+ "dependencies": {
+ "any-promise": "^1.0.0",
+ "object-assign": "^4.0.1",
+ "thenify-all": "^1.0.0"
+ }
+ },
+ "node_modules/nano-time": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/nano-time/-/nano-time-1.0.0.tgz",
+ "integrity": "sha512-flnngywOoQ0lLQOTRNexn2gGSNuM9bKj9RZAWSzhQ+UJYaAFG9bac4DW9VHjUAzrOaIcajHybCTHe/bkvozQqA==",
+ "dependencies": {
+ "big-integer": "^1.6.16"
+ }
+ },
+ "node_modules/nanoclone": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/nanoclone/-/nanoclone-0.2.1.tgz",
+ "integrity": "sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA=="
+ },
+ "node_modules/nanoid": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
+ "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/nanomatch": {
+ "version": "1.2.13",
+ "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
+ "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==",
+ "dependencies": {
+ "arr-diff": "^4.0.0",
+ "array-unique": "^0.3.2",
+ "define-property": "^2.0.2",
+ "extend-shallow": "^3.0.2",
+ "fragment-cache": "^0.2.1",
+ "is-windows": "^1.0.2",
+ "kind-of": "^6.0.2",
+ "object.pick": "^1.3.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/napi-build-utils": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz",
+ "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg=="
+ },
+ "node_modules/natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
+ "dev": true
+ },
+ "node_modules/natural-compare-lite": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz",
+ "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==",
+ "dev": true
+ },
+ "node_modules/needle": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/needle/-/needle-3.2.0.tgz",
+ "integrity": "sha512-oUvzXnyLiVyVGoianLijF9O/RecZUf7TkBfimjGrLM4eQhXyeJwM6GeAWccwfQ9aa4gMCZKqhAOuLaMIcQxajQ==",
+ "optional": true,
+ "dependencies": {
+ "debug": "^3.2.6",
+ "iconv-lite": "^0.6.3",
+ "sax": "^1.2.4"
+ },
+ "bin": {
+ "needle": "bin/needle"
+ },
+ "engines": {
+ "node": ">= 4.4.x"
+ }
+ },
+ "node_modules/needle/node_modules/debug": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+ "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+ "optional": true,
+ "dependencies": {
+ "ms": "^2.1.1"
+ }
+ },
+ "node_modules/needle/node_modules/iconv-lite": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
+ "optional": true,
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/negotiator": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
+ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/neo-async": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
+ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
+ },
+ "node_modules/next": {
+ "version": "13.5.3",
+ "resolved": "https://registry.npmjs.org/next/-/next-13.5.3.tgz",
+ "integrity": "sha512-4Nt4HRLYDW/yRpJ/QR2t1v63UOMS55A38dnWv3UDOWGezuY0ZyFO1ABNbD7mulVzs9qVhgy2+ppjdsANpKP1mg==",
+ "dependencies": {
+ "@next/env": "13.5.3",
+ "@swc/helpers": "0.5.2",
+ "busboy": "1.6.0",
+ "caniuse-lite": "^1.0.30001406",
+ "postcss": "8.4.14",
+ "styled-jsx": "5.1.1",
+ "watchpack": "2.4.0",
+ "zod": "3.21.4"
+ },
+ "bin": {
+ "next": "dist/bin/next"
+ },
+ "engines": {
+ "node": ">=16.14.0"
+ },
+ "optionalDependencies": {
+ "@next/swc-darwin-arm64": "13.5.3",
+ "@next/swc-darwin-x64": "13.5.3",
+ "@next/swc-linux-arm64-gnu": "13.5.3",
+ "@next/swc-linux-arm64-musl": "13.5.3",
+ "@next/swc-linux-x64-gnu": "13.5.3",
+ "@next/swc-linux-x64-musl": "13.5.3",
+ "@next/swc-win32-arm64-msvc": "13.5.3",
+ "@next/swc-win32-ia32-msvc": "13.5.3",
+ "@next/swc-win32-x64-msvc": "13.5.3"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": "^1.1.0",
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0",
+ "sass": "^1.3.0"
+ },
+ "peerDependenciesMeta": {
+ "@opentelemetry/api": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/next/node_modules/busboy": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz",
+ "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==",
+ "dependencies": {
+ "streamsearch": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=10.16.0"
+ }
+ },
+ "node_modules/next/node_modules/postcss": {
+ "version": "8.4.14",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz",
+ "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ }
+ ],
+ "dependencies": {
+ "nanoid": "^3.3.4",
+ "picocolors": "^1.0.0",
+ "source-map-js": "^1.0.2"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/next/node_modules/streamsearch": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
+ "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==",
+ "engines": {
+ "node": ">=10.0.0"
+ }
+ },
+ "node_modules/nexus": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/nexus/-/nexus-1.3.0.tgz",
+ "integrity": "sha512-w/s19OiNOs0LrtP7pBmD9/FqJHvZLmCipVRt6v1PM8cRUYIbhEswyNKGHVoC4eHZGPSnD+bOf5A3+gnbt0A5/A==",
+ "dependencies": {
+ "iterall": "^1.3.0",
+ "tslib": "^2.0.3"
+ },
+ "peerDependencies": {
+ "graphql": "15.x || 16.x"
+ }
+ },
+ "node_modules/nice-napi": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/nice-napi/-/nice-napi-1.0.2.tgz",
+ "integrity": "sha512-px/KnJAJZf5RuBGcfD+Sp2pAKq0ytz8j+1NehvgIGFkvtvFrDM3T8E4x/JJODXK9WZow8RRGrbA9QQ3hs+pDhA==",
+ "dev": true,
+ "hasInstallScript": true,
+ "optional": true,
+ "os": [
+ "!win32"
+ ],
+ "dependencies": {
+ "node-addon-api": "^3.0.0",
+ "node-gyp-build": "^4.2.2"
+ }
+ },
+ "node_modules/nice-napi/node_modules/node-addon-api": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
+ "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==",
+ "dev": true,
+ "optional": true
+ },
+ "node_modules/nice-try": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
+ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
+ "dev": true
+ },
+ "node_modules/no-case": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz",
+ "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==",
+ "dependencies": {
+ "lower-case": "^1.1.1"
+ }
+ },
+ "node_modules/node-abi": {
+ "version": "3.47.0",
+ "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.47.0.tgz",
+ "integrity": "sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==",
+ "dependencies": {
+ "semver": "^7.3.5"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/node-abort-controller": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz",
+ "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ=="
+ },
+ "node_modules/node-addon-api": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz",
+ "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==",
+ "dev": true
+ },
+ "node_modules/node-domexception": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
+ "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/jimmywarting"
+ },
+ {
+ "type": "github",
+ "url": "https://paypal.me/jimmywarting"
+ }
+ ],
+ "engines": {
+ "node": ">=10.5.0"
+ }
+ },
+ "node_modules/node-fetch": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
+ "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
+ "dependencies": {
+ "whatwg-url": "^5.0.0"
+ },
+ "engines": {
+ "node": "4.x || >=6.0.0"
+ },
+ "peerDependencies": {
+ "encoding": "^0.1.0"
+ },
+ "peerDependenciesMeta": {
+ "encoding": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/node-fetch/node_modules/tr46": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
+ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
+ },
+ "node_modules/node-fetch/node_modules/webidl-conversions": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
+ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
+ },
+ "node_modules/node-fetch/node_modules/whatwg-url": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
+ "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
+ "dependencies": {
+ "tr46": "~0.0.3",
+ "webidl-conversions": "^3.0.0"
+ }
+ },
+ "node_modules/node-forge": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz",
+ "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==",
+ "engines": {
+ "node": ">= 6.13.0"
+ }
+ },
+ "node_modules/node-gyp": {
+ "version": "9.4.0",
+ "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.4.0.tgz",
+ "integrity": "sha512-dMXsYP6gc9rRbejLXmTbVRYjAHw7ppswsKyMxuxJxxOHzluIO1rGp9TOQgjFJ+2MCqcOcQTOPB/8Xwhr+7s4Eg==",
+ "dev": true,
+ "dependencies": {
+ "env-paths": "^2.2.0",
+ "exponential-backoff": "^3.1.1",
+ "glob": "^7.1.4",
+ "graceful-fs": "^4.2.6",
+ "make-fetch-happen": "^11.0.3",
+ "nopt": "^6.0.0",
+ "npmlog": "^6.0.0",
+ "rimraf": "^3.0.2",
+ "semver": "^7.3.5",
+ "tar": "^6.1.2",
+ "which": "^2.0.2"
+ },
+ "bin": {
+ "node-gyp": "bin/node-gyp.js"
+ },
+ "engines": {
+ "node": "^12.13 || ^14.13 || >=16"
+ }
+ },
+ "node_modules/node-gyp-build": {
+ "version": "4.6.1",
+ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz",
+ "integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==",
+ "dev": true,
+ "optional": true,
+ "bin": {
+ "node-gyp-build": "bin.js",
+ "node-gyp-build-optional": "optional.js",
+ "node-gyp-build-test": "build-test.js"
+ }
+ },
+ "node_modules/node-gyp/node_modules/rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dev": true,
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/node-int64": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz",
+ "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==",
+ "dev": true
+ },
+ "node_modules/node-machine-id": {
+ "version": "1.1.12",
+ "resolved": "https://registry.npmjs.org/node-machine-id/-/node-machine-id-1.1.12.tgz",
+ "integrity": "sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ=="
+ },
+ "node_modules/node-plop": {
+ "version": "0.26.3",
+ "resolved": "https://registry.npmjs.org/node-plop/-/node-plop-0.26.3.tgz",
+ "integrity": "sha512-Cov028YhBZ5aB7MdMWJEmwyBig43aGL5WT4vdoB28Oitau1zZAcHUn8Sgfk9HM33TqhtLJ9PlM/O0Mv+QpV/4Q==",
+ "dependencies": {
+ "@babel/runtime-corejs3": "^7.9.2",
+ "@types/inquirer": "^6.5.0",
+ "change-case": "^3.1.0",
+ "del": "^5.1.0",
+ "globby": "^10.0.1",
+ "handlebars": "^4.4.3",
+ "inquirer": "^7.1.0",
+ "isbinaryfile": "^4.0.2",
+ "lodash.get": "^4.4.2",
+ "mkdirp": "^0.5.1",
+ "resolve": "^1.12.0"
+ },
+ "engines": {
+ "node": ">=8.9.4"
+ }
+ },
+ "node_modules/node-plop/node_modules/@types/glob": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz",
+ "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==",
+ "dependencies": {
+ "@types/minimatch": "*",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/node-plop/node_modules/globby": {
+ "version": "10.0.2",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz",
+ "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==",
+ "dependencies": {
+ "@types/glob": "^7.1.1",
+ "array-union": "^2.1.0",
+ "dir-glob": "^3.0.1",
+ "fast-glob": "^3.0.3",
+ "glob": "^7.1.3",
+ "ignore": "^5.1.1",
+ "merge2": "^1.2.3",
+ "slash": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/node-plop/node_modules/inquirer": {
+ "version": "7.3.3",
+ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz",
+ "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==",
+ "dependencies": {
+ "ansi-escapes": "^4.2.1",
+ "chalk": "^4.1.0",
+ "cli-cursor": "^3.1.0",
+ "cli-width": "^3.0.0",
+ "external-editor": "^3.0.3",
+ "figures": "^3.0.0",
+ "lodash": "^4.17.19",
+ "mute-stream": "0.0.8",
+ "run-async": "^2.4.0",
+ "rxjs": "^6.6.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0",
+ "through": "^2.3.6"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/node-plop/node_modules/rxjs": {
+ "version": "6.6.7",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
+ "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
+ "dependencies": {
+ "tslib": "^1.9.0"
+ },
+ "engines": {
+ "npm": ">=2.0.0"
+ }
+ },
+ "node_modules/node-plop/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
+ },
+ "node_modules/node-preload": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz",
+ "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==",
+ "dev": true,
+ "dependencies": {
+ "process-on-spawn": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/node-releases": {
+ "version": "2.0.13",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
+ "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ=="
+ },
+ "node_modules/node-schedule": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/node-schedule/-/node-schedule-2.1.0.tgz",
+ "integrity": "sha512-nl4JTiZ7ZQDc97MmpTq9BQjYhq7gOtoh7SiPH069gBFBj0PzD8HI7zyFs6rzqL8Y5tTiEEYLxgtbx034YPrbyQ==",
+ "dependencies": {
+ "cron-parser": "^3.5.0",
+ "long-timeout": "0.1.1",
+ "sorted-array-functions": "^1.3.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/nodemailer-fetch": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/nodemailer-fetch/-/nodemailer-fetch-1.6.0.tgz",
+ "integrity": "sha512-P7S5CEVGAmDrrpn351aXOLYs1R/7fD5NamfMCHyi6WIkbjS2eeZUB/TkuvpOQr0bvRZicVqo59+8wbhR3yrJbQ=="
+ },
+ "node_modules/nodemailer-shared": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/nodemailer-shared/-/nodemailer-shared-1.1.0.tgz",
+ "integrity": "sha512-68xW5LSyPWv8R0GLm6veAvm7E+XFXkVgvE3FW0FGxNMMZqMkPFeGDVALfR1DPdSfcoO36PnW7q5AAOgFImEZGg==",
+ "dependencies": {
+ "nodemailer-fetch": "1.6.0"
+ }
+ },
+ "node_modules/noms": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz",
+ "integrity": "sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==",
+ "dependencies": {
+ "inherits": "^2.0.1",
+ "readable-stream": "~1.0.31"
+ }
+ },
+ "node_modules/noms/node_modules/isarray": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+ "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
+ },
+ "node_modules/noms/node_modules/readable-stream": {
+ "version": "1.0.34",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
+ "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==",
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.1",
+ "isarray": "0.0.1",
+ "string_decoder": "~0.10.x"
+ }
+ },
+ "node_modules/noms/node_modules/string_decoder": {
+ "version": "0.10.31",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+ "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ=="
+ },
+ "node_modules/nopt": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz",
+ "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==",
+ "dev": true,
+ "dependencies": {
+ "abbrev": "^1.0.0"
+ },
+ "bin": {
+ "nopt": "bin/nopt.js"
+ },
+ "engines": {
+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
+ }
+ },
+ "node_modules/normalize-package-data": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz",
+ "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==",
+ "dev": true,
+ "dependencies": {
+ "hosted-git-info": "^6.0.0",
+ "is-core-module": "^2.8.1",
+ "semver": "^7.3.5",
+ "validate-npm-package-license": "^3.0.4"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/normalize-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
+ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/normalize-range": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz",
+ "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/normalize-url": {
+ "version": "4.5.1",
+ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz",
+ "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/npm-bundled": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-3.0.0.tgz",
+ "integrity": "sha512-Vq0eyEQy+elFpzsKjMss9kxqb9tG3YHg4dsyWuUENuzvSUWe1TCnW/vV9FkhvBk/brEDoDiVd+M1Btosa6ImdQ==",
+ "dev": true,
+ "dependencies": {
+ "npm-normalize-package-bin": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/npm-install-checks": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-6.2.0.tgz",
+ "integrity": "sha512-744wat5wAAHsxa4590mWO0tJ8PKxR8ORZsH9wGpQc3nWTzozMAgBN/XyqYw7mg3yqLM8dLwEnwSfKMmXAjF69g==",
+ "dev": true,
+ "dependencies": {
+ "semver": "^7.1.1"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/npm-normalize-package-bin": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz",
+ "integrity": "sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==",
+ "dev": true,
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/npm-package-arg": {
+ "version": "10.1.0",
+ "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz",
+ "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==",
+ "dev": true,
+ "dependencies": {
+ "hosted-git-info": "^6.0.0",
+ "proc-log": "^3.0.0",
+ "semver": "^7.3.5",
+ "validate-npm-package-name": "^5.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/npm-packlist": {
+ "version": "7.0.4",
+ "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz",
+ "integrity": "sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q==",
+ "dev": true,
+ "dependencies": {
+ "ignore-walk": "^6.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/npm-pick-manifest": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-8.0.1.tgz",
+ "integrity": "sha512-mRtvlBjTsJvfCCdmPtiu2bdlx8d/KXtF7yNXNWe7G0Z36qWA9Ny5zXsI2PfBZEv7SXgoxTmNaTzGSbbzDZChoA==",
+ "dev": true,
+ "dependencies": {
+ "npm-install-checks": "^6.0.0",
+ "npm-normalize-package-bin": "^3.0.0",
+ "npm-package-arg": "^10.0.0",
+ "semver": "^7.3.5"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/npm-registry-fetch": {
+ "version": "14.0.5",
+ "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.5.tgz",
+ "integrity": "sha512-kIDMIo4aBm6xg7jOttupWZamsZRkAqMqwqqbVXnUqstY5+tapvv6bkH/qMR76jdgV+YljEUCyWx3hRYMrJiAgA==",
+ "dev": true,
+ "dependencies": {
+ "make-fetch-happen": "^11.0.0",
+ "minipass": "^5.0.0",
+ "minipass-fetch": "^3.0.0",
+ "minipass-json-stream": "^1.0.1",
+ "minizlib": "^2.1.2",
+ "npm-package-arg": "^10.0.0",
+ "proc-log": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/npm-run-all": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz",
+ "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^3.2.1",
+ "chalk": "^2.4.1",
+ "cross-spawn": "^6.0.5",
+ "memorystream": "^0.3.1",
+ "minimatch": "^3.0.4",
+ "pidtree": "^0.3.0",
+ "read-pkg": "^3.0.0",
+ "shell-quote": "^1.6.1",
+ "string.prototype.padend": "^3.0.0"
+ },
+ "bin": {
+ "npm-run-all": "bin/npm-run-all/index.js",
+ "run-p": "bin/run-p/index.js",
+ "run-s": "bin/run-s/index.js"
+ },
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "dependencies": {
+ "color-convert": "^1.9.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "dependencies": {
+ "color-name": "1.1.3"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
+ "dev": true
+ },
+ "node_modules/npm-run-all/node_modules/cross-spawn": {
+ "version": "6.0.5",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
+ "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
+ "dev": true,
+ "dependencies": {
+ "nice-try": "^1.0.4",
+ "path-key": "^2.0.1",
+ "semver": "^5.5.0",
+ "shebang-command": "^1.2.0",
+ "which": "^1.2.9"
+ },
+ "engines": {
+ "node": ">=4.8"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/path-key": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
+ "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/semver": {
+ "version": "5.7.2",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
+ "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/shebang-command": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
+ "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==",
+ "dev": true,
+ "dependencies": {
+ "shebang-regex": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/shebang-regex": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
+ "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "dev": true,
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "which": "bin/which"
+ }
+ },
+ "node_modules/npm-run-path": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
+ "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
+ "dependencies": {
+ "path-key": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/npmlog": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz",
+ "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==",
+ "dev": true,
+ "dependencies": {
+ "are-we-there-yet": "^3.0.0",
+ "console-control-strings": "^1.1.0",
+ "gauge": "^4.0.3",
+ "set-blocking": "^2.0.0"
+ },
+ "engines": {
+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
+ }
+ },
+ "node_modules/nth-check": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
+ "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==",
+ "dependencies": {
+ "boolbase": "^1.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/nth-check?sponsor=1"
+ }
+ },
+ "node_modules/nwsapi": {
+ "version": "2.2.7",
+ "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz",
+ "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==",
+ "dev": true
+ },
+ "node_modules/nyc": {
+ "version": "15.1.0",
+ "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz",
+ "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==",
+ "dev": true,
+ "dependencies": {
+ "@istanbuljs/load-nyc-config": "^1.0.0",
+ "@istanbuljs/schema": "^0.1.2",
+ "caching-transform": "^4.0.0",
+ "convert-source-map": "^1.7.0",
+ "decamelize": "^1.2.0",
+ "find-cache-dir": "^3.2.0",
+ "find-up": "^4.1.0",
+ "foreground-child": "^2.0.0",
+ "get-package-type": "^0.1.0",
+ "glob": "^7.1.6",
+ "istanbul-lib-coverage": "^3.0.0",
+ "istanbul-lib-hook": "^3.0.0",
+ "istanbul-lib-instrument": "^4.0.0",
+ "istanbul-lib-processinfo": "^2.0.2",
+ "istanbul-lib-report": "^3.0.0",
+ "istanbul-lib-source-maps": "^4.0.0",
+ "istanbul-reports": "^3.0.2",
+ "make-dir": "^3.0.0",
+ "node-preload": "^0.2.1",
+ "p-map": "^3.0.0",
+ "process-on-spawn": "^1.0.0",
+ "resolve-from": "^5.0.0",
+ "rimraf": "^3.0.0",
+ "signal-exit": "^3.0.2",
+ "spawn-wrap": "^2.0.0",
+ "test-exclude": "^6.0.0",
+ "yargs": "^15.0.2"
+ },
+ "bin": {
+ "nyc": "bin/nyc.js"
+ },
+ "engines": {
+ "node": ">=8.9"
+ }
+ },
+ "node_modules/nyc/node_modules/cliui": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
+ "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
+ "dev": true,
+ "dependencies": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.0",
+ "wrap-ansi": "^6.2.0"
+ }
+ },
+ "node_modules/nyc/node_modules/find-cache-dir": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz",
+ "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==",
+ "dev": true,
+ "dependencies": {
+ "commondir": "^1.0.1",
+ "make-dir": "^3.0.2",
+ "pkg-dir": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/avajs/find-cache-dir?sponsor=1"
+ }
+ },
+ "node_modules/nyc/node_modules/find-up": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
+ "dev": true,
+ "dependencies": {
+ "locate-path": "^5.0.0",
+ "path-exists": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/nyc/node_modules/istanbul-lib-instrument": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz",
+ "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/core": "^7.7.5",
+ "@istanbuljs/schema": "^0.1.2",
+ "istanbul-lib-coverage": "^3.0.0",
+ "semver": "^6.3.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/nyc/node_modules/locate-path": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
+ "dev": true,
+ "dependencies": {
+ "p-locate": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/nyc/node_modules/make-dir": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
+ "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
+ "dev": true,
+ "dependencies": {
+ "semver": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/nyc/node_modules/p-limit": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
+ "dev": true,
+ "dependencies": {
+ "p-try": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/nyc/node_modules/p-locate": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
+ "dev": true,
+ "dependencies": {
+ "p-limit": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/nyc/node_modules/p-map": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz",
+ "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==",
+ "dev": true,
+ "dependencies": {
+ "aggregate-error": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/nyc/node_modules/pkg-dir": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
+ "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
+ "dev": true,
+ "dependencies": {
+ "find-up": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/nyc/node_modules/rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dev": true,
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/nyc/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/nyc/node_modules/wrap-ansi": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
+ "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/nyc/node_modules/y18n": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
+ "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
+ "dev": true
+ },
+ "node_modules/nyc/node_modules/yargs": {
+ "version": "15.4.1",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
+ "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
+ "dev": true,
+ "dependencies": {
+ "cliui": "^6.0.0",
+ "decamelize": "^1.2.0",
+ "find-up": "^4.1.0",
+ "get-caller-file": "^2.0.1",
+ "require-directory": "^2.1.1",
+ "require-main-filename": "^2.0.0",
+ "set-blocking": "^2.0.0",
+ "string-width": "^4.2.0",
+ "which-module": "^2.0.0",
+ "y18n": "^4.0.0",
+ "yargs-parser": "^18.1.2"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/nyc/node_modules/yargs-parser": {
+ "version": "18.1.3",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
+ "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
+ "dev": true,
+ "dependencies": {
+ "camelcase": "^5.0.0",
+ "decamelize": "^1.2.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/oauth-sign": {
+ "version": "0.9.0",
+ "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
+ "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-copy": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz",
+ "integrity": "sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==",
+ "dependencies": {
+ "copy-descriptor": "^0.1.0",
+ "define-property": "^0.2.5",
+ "kind-of": "^3.0.3"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-copy/node_modules/define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==",
+ "dependencies": {
+ "is-descriptor": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-copy/node_modules/is-accessor-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+ "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==",
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-copy/node_modules/is-data-descriptor": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+ "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==",
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-copy/node_modules/is-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
+ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
+ "dependencies": {
+ "is-accessor-descriptor": "^0.1.6",
+ "is-data-descriptor": "^0.1.4",
+ "kind-of": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-copy/node_modules/is-descriptor/node_modules/kind-of": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+ "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-copy/node_modules/kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-inspect": {
+ "version": "1.12.3",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz",
+ "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/object-keys": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
+ "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/object-path": {
+ "version": "0.11.8",
+ "resolved": "https://registry.npmjs.org/object-path/-/object-path-0.11.8.tgz",
+ "integrity": "sha512-YJjNZrlXJFM42wTBn6zgOJVar9KFJvzx6sTWDte8sWZF//cnjl0BxHNpfZx+ZffXX63A9q0b1zsFiBX4g4X5KA==",
+ "engines": {
+ "node": ">= 10.12.0"
+ }
+ },
+ "node_modules/object-visit": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz",
+ "integrity": "sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==",
+ "dependencies": {
+ "isobject": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object.assign": {
+ "version": "4.1.4",
+ "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz",
+ "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.1.4",
+ "has-symbols": "^1.0.3",
+ "object-keys": "^1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/object.defaults": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz",
+ "integrity": "sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==",
+ "dependencies": {
+ "array-each": "^1.0.1",
+ "array-slice": "^1.0.0",
+ "for-own": "^1.0.0",
+ "isobject": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object.entries": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.7.tgz",
+ "integrity": "sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/object.fromentries": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz",
+ "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/object.groupby": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz",
+ "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1",
+ "get-intrinsic": "^1.2.1"
+ }
+ },
+ "node_modules/object.hasown": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.3.tgz",
+ "integrity": "sha512-fFI4VcYpRHvSLXxP7yiZOMAd331cPfd2p7PFDVbgUsYOfCT3tICVqXWngbjr4m49OvsBwUBQ6O2uQoJvy3RexA==",
+ "dev": true,
+ "dependencies": {
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/object.map": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz",
+ "integrity": "sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==",
+ "dependencies": {
+ "for-own": "^1.0.0",
+ "make-iterator": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object.pick": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
+ "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==",
+ "dependencies": {
+ "isobject": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object.values": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz",
+ "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/oblivious-set": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/oblivious-set/-/oblivious-set-1.0.0.tgz",
+ "integrity": "sha512-z+pI07qxo4c2CulUHCDf9lcqDlMSo72N/4rLUpRXf6fu+q8vjt8y0xS+Tlf8NTJDdTXHbdeO1n3MlbctwEoXZw=="
+ },
+ "node_modules/obuf": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz",
+ "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg=="
+ },
+ "node_modules/on-exit-leak-free": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.0.tgz",
+ "integrity": "sha512-VuCaZZAjReZ3vUwgOB8LxAosIurDiAW0s13rI1YwmaP++jvcxP77AWoQvenZebpCA2m8WC1/EosPYPMjnRAp/w=="
+ },
+ "node_modules/on-finished": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
+ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
+ "dependencies": {
+ "ee-first": "1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/on-headers": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz",
+ "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/one-time": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz",
+ "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==",
+ "dependencies": {
+ "fn.name": "1.x.x"
+ }
+ },
+ "node_modules/onetime": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
+ "dependencies": {
+ "mimic-fn": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/only": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/only/-/only-0.0.2.tgz",
+ "integrity": "sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ=="
+ },
+ "node_modules/open": {
+ "version": "8.4.2",
+ "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz",
+ "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==",
+ "dependencies": {
+ "define-lazy-prop": "^2.0.0",
+ "is-docker": "^2.1.1",
+ "is-wsl": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/opener": {
+ "version": "1.5.2",
+ "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
+ "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==",
+ "dev": true,
+ "bin": {
+ "opener": "bin/opener-bin.js"
+ }
+ },
+ "node_modules/optimism": {
+ "version": "0.17.5",
+ "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.17.5.tgz",
+ "integrity": "sha512-TEcp8ZwK1RczmvMnvktxHSF2tKgMWjJ71xEFGX5ApLh67VsMSTy1ZUlipJw8W+KaqgOmQ+4pqwkeivY89j+4Vw==",
+ "peer": true,
+ "dependencies": {
+ "@wry/context": "^0.7.0",
+ "@wry/trie": "^0.4.3",
+ "tslib": "^2.3.0"
+ }
+ },
+ "node_modules/optionator": {
+ "version": "0.9.3",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz",
+ "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==",
+ "dev": true,
+ "dependencies": {
+ "@aashutoshrathi/word-wrap": "^1.2.3",
+ "deep-is": "^0.1.3",
+ "fast-levenshtein": "^2.0.6",
+ "levn": "^0.4.1",
+ "prelude-ls": "^1.2.1",
+ "type-check": "^0.4.0"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/ora": {
+ "version": "5.4.1",
+ "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz",
+ "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==",
+ "dependencies": {
+ "bl": "^4.1.0",
+ "chalk": "^4.1.0",
+ "cli-cursor": "^3.1.0",
+ "cli-spinners": "^2.5.0",
+ "is-interactive": "^1.0.0",
+ "is-unicode-supported": "^0.1.0",
+ "log-symbols": "^4.1.0",
+ "strip-ansi": "^6.0.0",
+ "wcwidth": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/os-tmpdir": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+ "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/own-or": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/own-or/-/own-or-1.0.0.tgz",
+ "integrity": "sha512-NfZr5+Tdf6MB8UI9GLvKRs4cXY8/yB0w3xtt84xFdWy8hkGjn+JFc60VhzS/hFRfbyxFcGYMTjnF4Me+RbbqrA==",
+ "dev": true
+ },
+ "node_modules/own-or-env": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/own-or-env/-/own-or-env-1.0.2.tgz",
+ "integrity": "sha512-NQ7v0fliWtK7Lkb+WdFqe6ky9XAzYmlkXthQrBbzlYbmFKoAYbDDcwmOm6q8kOuwSRXW8bdL5ORksploUJmWgw==",
+ "dev": true,
+ "dependencies": {
+ "own-or": "^1.0.0"
+ }
+ },
+ "node_modules/p-cancelable": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz",
+ "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/p-event": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz",
+ "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==",
+ "dev": true,
+ "dependencies": {
+ "p-timeout": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/p-finally": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
+ "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/p-limit": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
+ "dependencies": {
+ "yocto-queue": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/p-locate": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
+ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
+ "dependencies": {
+ "p-limit": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/p-map": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz",
+ "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==",
+ "dependencies": {
+ "aggregate-error": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/p-retry": {
+ "version": "4.6.2",
+ "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz",
+ "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==",
+ "dependencies": {
+ "@types/retry": "0.12.0",
+ "retry": "^0.13.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/p-retry/node_modules/retry": {
+ "version": "0.13.1",
+ "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz",
+ "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/p-timeout": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz",
+ "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==",
+ "dev": true,
+ "dependencies": {
+ "p-finally": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/p-try": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/package-hash": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz",
+ "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==",
+ "dev": true,
+ "dependencies": {
+ "graceful-fs": "^4.1.15",
+ "hasha": "^5.0.0",
+ "lodash.flattendeep": "^4.4.0",
+ "release-zalgo": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/package-json": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz",
+ "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==",
+ "dev": true,
+ "dependencies": {
+ "got": "^9.6.0",
+ "registry-auth-token": "^4.0.0",
+ "registry-url": "^5.0.0",
+ "semver": "^6.2.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/package-json/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/packet-reader": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz",
+ "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ=="
+ },
+ "node_modules/pacote": {
+ "version": "15.2.0",
+ "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.2.0.tgz",
+ "integrity": "sha512-rJVZeIwHTUta23sIZgEIM62WYwbmGbThdbnkt81ravBplQv+HjyroqnLRNH2+sLJHcGZmLRmhPwACqhfTcOmnA==",
+ "dev": true,
+ "dependencies": {
+ "@npmcli/git": "^4.0.0",
+ "@npmcli/installed-package-contents": "^2.0.1",
+ "@npmcli/promise-spawn": "^6.0.1",
+ "@npmcli/run-script": "^6.0.0",
+ "cacache": "^17.0.0",
+ "fs-minipass": "^3.0.0",
+ "minipass": "^5.0.0",
+ "npm-package-arg": "^10.0.0",
+ "npm-packlist": "^7.0.0",
+ "npm-pick-manifest": "^8.0.0",
+ "npm-registry-fetch": "^14.0.0",
+ "proc-log": "^3.0.0",
+ "promise-retry": "^2.0.1",
+ "read-package-json": "^6.0.0",
+ "read-package-json-fast": "^3.0.0",
+ "sigstore": "^1.3.0",
+ "ssri": "^10.0.0",
+ "tar": "^6.1.11"
+ },
+ "bin": {
+ "pacote": "lib/bin.js"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/pako": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
+ "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
+ "dev": true
+ },
+ "node_modules/param-case": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz",
+ "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==",
+ "dependencies": {
+ "dot-case": "^3.0.4",
+ "tslib": "^2.0.3"
+ }
+ },
+ "node_modules/param-case/node_modules/dot-case": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz",
+ "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==",
+ "dependencies": {
+ "no-case": "^3.0.4",
+ "tslib": "^2.0.3"
+ }
+ },
+ "node_modules/param-case/node_modules/lower-case": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz",
+ "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==",
+ "dependencies": {
+ "tslib": "^2.0.3"
+ }
+ },
+ "node_modules/param-case/node_modules/no-case": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz",
+ "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==",
+ "dependencies": {
+ "lower-case": "^2.0.2",
+ "tslib": "^2.0.3"
+ }
+ },
+ "node_modules/parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "dependencies": {
+ "callsites": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/parse-filepath": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz",
+ "integrity": "sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==",
+ "dependencies": {
+ "is-absolute": "^1.0.0",
+ "map-cache": "^0.2.0",
+ "path-root": "^0.1.1"
+ },
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
+ "node_modules/parse-json": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
+ "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
+ "dependencies": {
+ "@babel/code-frame": "^7.0.0",
+ "error-ex": "^1.3.1",
+ "json-parse-even-better-errors": "^2.3.0",
+ "lines-and-columns": "^1.1.6"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/parse-node-version": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz",
+ "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==",
+ "devOptional": true,
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/parse-passwd": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz",
+ "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/parse-srcset": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/parse-srcset/-/parse-srcset-1.0.2.tgz",
+ "integrity": "sha512-/2qh0lav6CmI15FzA3i/2Bzk2zCgQhGMkvhOhKNcBVQ1ldgpbfiNTVslmooUmWJcADi1f1kIeynbDRVzNlfR6Q=="
+ },
+ "node_modules/parse5": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz",
+ "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==",
+ "dependencies": {
+ "entities": "^4.4.0"
+ },
+ "funding": {
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
+ }
+ },
+ "node_modules/parse5-html-rewriting-stream": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/parse5-html-rewriting-stream/-/parse5-html-rewriting-stream-7.0.0.tgz",
+ "integrity": "sha512-mazCyGWkmCRWDI15Zp+UiCqMp/0dgEmkZRvhlsqqKYr4SsVm/TvnSpD9fCvqCA2zoWJcfRym846ejWBBHRiYEg==",
+ "dev": true,
+ "dependencies": {
+ "entities": "^4.3.0",
+ "parse5": "^7.0.0",
+ "parse5-sax-parser": "^7.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
+ }
+ },
+ "node_modules/parse5-sax-parser": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/parse5-sax-parser/-/parse5-sax-parser-7.0.0.tgz",
+ "integrity": "sha512-5A+v2SNsq8T6/mG3ahcz8ZtQ0OUFTatxPbeidoMB7tkJSGDY3tdfl4MHovtLQHkEn5CGxijNWRQHhRQ6IRpXKg==",
+ "dev": true,
+ "dependencies": {
+ "parse5": "^7.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
+ }
+ },
+ "node_modules/parseurl": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/pascal-case": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz",
+ "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==",
+ "dependencies": {
+ "no-case": "^3.0.4",
+ "tslib": "^2.0.3"
+ }
+ },
+ "node_modules/pascal-case/node_modules/lower-case": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz",
+ "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==",
+ "dependencies": {
+ "tslib": "^2.0.3"
+ }
+ },
+ "node_modules/pascal-case/node_modules/no-case": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz",
+ "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==",
+ "dependencies": {
+ "lower-case": "^2.0.2",
+ "tslib": "^2.0.3"
+ }
+ },
+ "node_modules/pascalcase": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz",
+ "integrity": "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/passport": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/passport/-/passport-0.6.0.tgz",
+ "integrity": "sha512-0fe+p3ZnrWRW74fe8+SvCyf4a3Pb2/h7gFkQ8yTJpAO50gDzlfjZUZTO1k5Eg9kUct22OxHLqDZoKUWRHOh9ug==",
+ "dependencies": {
+ "passport-strategy": "1.x.x",
+ "pause": "0.0.1",
+ "utils-merge": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.4.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/jaredhanson"
+ }
+ },
+ "node_modules/passport-local": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/passport-local/-/passport-local-1.0.0.tgz",
+ "integrity": "sha512-9wCE6qKznvf9mQYYbgJ3sVOHmCWoUNMVFoZzNoznmISbhnNNPhN9xfY3sLmScHMetEJeoY7CXwfhCe7argfQow==",
+ "dependencies": {
+ "passport-strategy": "1.x.x"
+ },
+ "engines": {
+ "node": ">= 0.4.0"
+ }
+ },
+ "node_modules/passport-strategy": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz",
+ "integrity": "sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA==",
+ "engines": {
+ "node": ">= 0.4.0"
+ }
+ },
+ "node_modules/password-prompt": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/password-prompt/-/password-prompt-1.1.3.tgz",
+ "integrity": "sha512-HkrjG2aJlvF0t2BMH0e2LB/EHf3Lcq3fNMzy4GYHcQblAvOl+QQji1Lx7WRBMqpVK8p+KR7bCg7oqAMXtdgqyw==",
+ "dev": true,
+ "dependencies": {
+ "ansi-escapes": "^4.3.2",
+ "cross-spawn": "^7.0.3"
+ }
+ },
+ "node_modules/path-case": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/path-case/-/path-case-2.1.1.tgz",
+ "integrity": "sha512-Ou0N05MioItesaLr9q8TtHVWmJ6fxWdqKB2RohFmNWVyJ+2zeKIeDNWAN6B/Pe7wpzWChhZX6nONYmOnMeJQ/Q==",
+ "dependencies": {
+ "no-case": "^2.2.0"
+ }
+ },
+ "node_modules/path-exists": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/path-key": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/path-parse": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
+ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
+ },
+ "node_modules/path-root": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz",
+ "integrity": "sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==",
+ "dependencies": {
+ "path-root-regex": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/path-root-regex": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz",
+ "integrity": "sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/path-scurry": {
+ "version": "1.10.1",
+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz",
+ "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==",
+ "dev": true,
+ "dependencies": {
+ "lru-cache": "^9.1.1 || ^10.0.0",
+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/path-scurry/node_modules/lru-cache": {
+ "version": "10.0.1",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz",
+ "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==",
+ "dev": true,
+ "engines": {
+ "node": "14 || >=16.14"
+ }
+ },
+ "node_modules/path-to-regexp": {
+ "version": "0.1.7",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
+ "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
+ },
+ "node_modules/path-type": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
+ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/pause": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz",
+ "integrity": "sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg=="
+ },
+ "node_modules/pem": {
+ "version": "1.14.8",
+ "resolved": "https://registry.npmjs.org/pem/-/pem-1.14.8.tgz",
+ "integrity": "sha512-ZpbOf4dj9/fQg5tQzTqv4jSKJQsK7tPl0pm4/pvPcZVjZcJg7TMfr3PBk6gJH97lnpJDu4e4v8UUqEz5daipCg==",
+ "dev": true,
+ "dependencies": {
+ "es6-promisify": "^7.0.0",
+ "md5": "^2.3.0",
+ "os-tmpdir": "^1.0.2",
+ "which": "^2.0.2"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/pg": {
+ "version": "8.11.3",
+ "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.3.tgz",
+ "integrity": "sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==",
+ "dependencies": {
+ "buffer-writer": "2.0.0",
+ "packet-reader": "1.0.0",
+ "pg-connection-string": "^2.6.2",
+ "pg-pool": "^3.6.1",
+ "pg-protocol": "^1.6.0",
+ "pg-types": "^2.1.0",
+ "pgpass": "1.x"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
+ },
+ "optionalDependencies": {
+ "pg-cloudflare": "^1.1.1"
+ },
+ "peerDependencies": {
+ "pg-native": ">=3.0.1"
+ },
+ "peerDependenciesMeta": {
+ "pg-native": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/pg-cloudflare": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz",
+ "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==",
+ "optional": true
+ },
+ "node_modules/pg-connection-string": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz",
+ "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA=="
+ },
+ "node_modules/pg-int8": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
+ "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==",
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/pg-numeric": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/pg-numeric/-/pg-numeric-1.0.2.tgz",
+ "integrity": "sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/pg-pool": {
+ "version": "3.6.1",
+ "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.1.tgz",
+ "integrity": "sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==",
+ "peerDependencies": {
+ "pg": ">=8.0"
+ }
+ },
+ "node_modules/pg-protocol": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz",
+ "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q=="
+ },
+ "node_modules/pg-types": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-4.0.1.tgz",
+ "integrity": "sha512-hRCSDuLII9/LE3smys1hRHcu5QGcLs9ggT7I/TCs0IE+2Eesxi9+9RWAAwZ0yaGjxoWICF/YHLOEjydGujoJ+g==",
+ "dev": true,
+ "dependencies": {
+ "pg-int8": "1.0.1",
+ "pg-numeric": "1.0.2",
+ "postgres-array": "~3.0.1",
+ "postgres-bytea": "~3.0.0",
+ "postgres-date": "~2.0.1",
+ "postgres-interval": "^3.0.0",
+ "postgres-range": "^1.1.1"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/pg/node_modules/pg-types": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
+ "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
+ "dependencies": {
+ "pg-int8": "1.0.1",
+ "postgres-array": "~2.0.0",
+ "postgres-bytea": "~1.0.0",
+ "postgres-date": "~1.0.4",
+ "postgres-interval": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/pg/node_modules/postgres-array": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
+ "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/pg/node_modules/postgres-bytea": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz",
+ "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/pg/node_modules/postgres-date": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
+ "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/pg/node_modules/postgres-interval": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
+ "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
+ "dependencies": {
+ "xtend": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/pgpass": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz",
+ "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==",
+ "dependencies": {
+ "split2": "^4.1.0"
+ }
+ },
+ "node_modules/pgpass/node_modules/split2": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
+ "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",
+ "engines": {
+ "node": ">= 10.x"
+ }
+ },
+ "node_modules/picocolors": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
+ "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
+ },
+ "node_modules/picomatch": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
+ "engines": {
+ "node": ">=8.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/pidtree": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz",
+ "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==",
+ "dev": true,
+ "bin": {
+ "pidtree": "bin/pidtree.js"
+ },
+ "engines": {
+ "node": ">=0.10"
+ }
+ },
+ "node_modules/pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/pino": {
+ "version": "8.15.1",
+ "resolved": "https://registry.npmjs.org/pino/-/pino-8.15.1.tgz",
+ "integrity": "sha512-Cp4QzUQrvWCRJaQ8Lzv0mJzXVk4z2jlq8JNKMGaixC2Pz5L4l2p95TkuRvYbrEbe85NQsDKrAd4zalf7Ml6WiA==",
+ "dependencies": {
+ "atomic-sleep": "^1.0.0",
+ "fast-redact": "^3.1.1",
+ "on-exit-leak-free": "^2.1.0",
+ "pino-abstract-transport": "v1.1.0",
+ "pino-std-serializers": "^6.0.0",
+ "process-warning": "^2.0.0",
+ "quick-format-unescaped": "^4.0.3",
+ "real-require": "^0.2.0",
+ "safe-stable-stringify": "^2.3.1",
+ "sonic-boom": "^3.1.0",
+ "thread-stream": "^2.0.0"
+ },
+ "bin": {
+ "pino": "bin.js"
+ }
+ },
+ "node_modules/pino-abstract-transport": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.1.0.tgz",
+ "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==",
+ "dependencies": {
+ "readable-stream": "^4.0.0",
+ "split2": "^4.0.0"
+ }
+ },
+ "node_modules/pino-abstract-transport/node_modules/buffer": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
+ "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "dependencies": {
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.2.1"
+ }
+ },
+ "node_modules/pino-abstract-transport/node_modules/readable-stream": {
+ "version": "4.4.2",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz",
+ "integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==",
+ "dependencies": {
+ "abort-controller": "^3.0.0",
+ "buffer": "^6.0.3",
+ "events": "^3.3.0",
+ "process": "^0.11.10",
+ "string_decoder": "^1.3.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ }
+ },
+ "node_modules/pino-abstract-transport/node_modules/split2": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
+ "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",
+ "engines": {
+ "node": ">= 10.x"
+ }
+ },
+ "node_modules/pino-pretty": {
+ "version": "10.2.0",
+ "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-10.2.0.tgz",
+ "integrity": "sha512-tRvpyEmGtc2D+Lr3FulIZ+R1baggQ4S3xD2Ar93KixFEDx6SEAUP3W5aYuEw1C73d6ROrNcB2IXLteW8itlwhA==",
+ "dependencies": {
+ "colorette": "^2.0.7",
+ "dateformat": "^4.6.3",
+ "fast-copy": "^3.0.0",
+ "fast-safe-stringify": "^2.1.1",
+ "help-me": "^4.0.1",
+ "joycon": "^3.1.1",
+ "minimist": "^1.2.6",
+ "on-exit-leak-free": "^2.1.0",
+ "pino-abstract-transport": "^1.0.0",
+ "pump": "^3.0.0",
+ "readable-stream": "^4.0.0",
+ "secure-json-parse": "^2.4.0",
+ "sonic-boom": "^3.0.0",
+ "strip-json-comments": "^3.1.1"
+ },
+ "bin": {
+ "pino-pretty": "bin.js"
+ }
+ },
+ "node_modules/pino-pretty/node_modules/buffer": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
+ "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "dependencies": {
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.2.1"
+ }
+ },
+ "node_modules/pino-pretty/node_modules/readable-stream": {
+ "version": "4.4.2",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz",
+ "integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==",
+ "dependencies": {
+ "abort-controller": "^3.0.0",
+ "buffer": "^6.0.3",
+ "events": "^3.3.0",
+ "process": "^0.11.10",
+ "string_decoder": "^1.3.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ }
+ },
+ "node_modules/pino-std-serializers": {
+ "version": "6.2.2",
+ "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz",
+ "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA=="
+ },
+ "node_modules/pirates": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz",
+ "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==",
+ "dev": true,
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/piscina": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/piscina/-/piscina-4.0.0.tgz",
+ "integrity": "sha512-641nAmJS4k4iqpNUqfggqUBUMmlw0ZoM5VZKdQkV2e970Inn3Tk9kroCc1wpsYLD07vCwpys5iY0d3xI/9WkTg==",
+ "dev": true,
+ "dependencies": {
+ "eventemitter-asyncresource": "^1.0.0",
+ "hdr-histogram-js": "^2.0.1",
+ "hdr-histogram-percentiles-obj": "^3.0.0"
+ },
+ "optionalDependencies": {
+ "nice-napi": "^1.0.2"
+ }
+ },
+ "node_modules/pkg-dir": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz",
+ "integrity": "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==",
+ "dev": true,
+ "dependencies": {
+ "find-up": "^6.3.0"
+ },
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/pkg-dir/node_modules/find-up": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz",
+ "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==",
+ "dev": true,
+ "dependencies": {
+ "locate-path": "^7.1.0",
+ "path-exists": "^5.0.0"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/pkg-dir/node_modules/locate-path": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz",
+ "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==",
+ "dev": true,
+ "dependencies": {
+ "p-locate": "^6.0.0"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/pkg-dir/node_modules/p-limit": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz",
+ "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==",
+ "dev": true,
+ "dependencies": {
+ "yocto-queue": "^1.0.0"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/pkg-dir/node_modules/p-locate": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz",
+ "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==",
+ "dev": true,
+ "dependencies": {
+ "p-limit": "^4.0.0"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/pkg-dir/node_modules/path-exists": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz",
+ "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==",
+ "dev": true,
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ }
+ },
+ "node_modules/pkg-dir/node_modules/yocto-queue": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz",
+ "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==",
+ "dev": true,
+ "engines": {
+ "node": ">=12.20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/pkg-up": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz",
+ "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==",
+ "dependencies": {
+ "find-up": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/pkg-up/node_modules/find-up": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+ "dependencies": {
+ "locate-path": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/pkg-up/node_modules/locate-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+ "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+ "dependencies": {
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/pkg-up/node_modules/p-limit": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
+ "dependencies": {
+ "p-try": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/pkg-up/node_modules/p-locate": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+ "dependencies": {
+ "p-limit": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/pkg-up/node_modules/path-exists": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
+ "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/playwright": {
+ "version": "1.38.1",
+ "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.38.1.tgz",
+ "integrity": "sha512-oRMSJmZrOu1FP5iu3UrCx8JEFRIMxLDM0c/3o4bpzU5Tz97BypefWf7TuTNPWeCe279TPal5RtPPZ+9lW/Qkow==",
+ "dev": true,
+ "dependencies": {
+ "playwright-core": "1.38.1"
+ },
+ "bin": {
+ "playwright": "cli.js"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "optionalDependencies": {
+ "fsevents": "2.3.2"
+ }
+ },
+ "node_modules/playwright-core": {
+ "version": "1.38.1",
+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.38.1.tgz",
+ "integrity": "sha512-tQqNFUKa3OfMf4b2jQ7aGLB8o9bS3bOY0yMEtldtC2+spf8QXG9zvXLTXUeRsoNuxEYMgLYR+NXfAa1rjKRcrg==",
+ "dev": true,
+ "bin": {
+ "playwright-core": "cli.js"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/playwright/node_modules/fsevents": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
+ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
+ "dev": true,
+ "hasInstallScript": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/plop": {
+ "version": "2.7.6",
+ "resolved": "https://registry.npmjs.org/plop/-/plop-2.7.6.tgz",
+ "integrity": "sha512-IgnYAsC3Ni7t1cDU7wH2151CD22YhMxH8PFh+iPzCf+WuGEWXslJ5t1Tpr0N/gjL23CAV/HbLAWug2IPM2YrHg==",
+ "dependencies": {
+ "@types/liftoff": "^2.5.1",
+ "chalk": "^1.1.3",
+ "interpret": "^1.2.0",
+ "liftoff": "^2.5.0",
+ "minimist": "^1.2.5",
+ "node-plop": "^0.26.3",
+ "ora": "^3.4.0",
+ "v8flags": "^2.0.10"
+ },
+ "bin": {
+ "plop": "bin/plop.js"
+ },
+ "engines": {
+ "node": ">=8.9.4"
+ }
+ },
+ "node_modules/plop/node_modules/ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/plop/node_modules/ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/plop/node_modules/chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==",
+ "dependencies": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/plop/node_modules/cli-cursor": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
+ "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==",
+ "dependencies": {
+ "restore-cursor": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/plop/node_modules/color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dependencies": {
+ "color-name": "1.1.3"
+ }
+ },
+ "node_modules/plop/node_modules/color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
+ },
+ "node_modules/plop/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/plop/node_modules/has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/plop/node_modules/interpret": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
+ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/plop/node_modules/log-symbols": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz",
+ "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==",
+ "dependencies": {
+ "chalk": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/plop/node_modules/log-symbols/node_modules/ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dependencies": {
+ "color-convert": "^1.9.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/plop/node_modules/log-symbols/node_modules/chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dependencies": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/plop/node_modules/log-symbols/node_modules/supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/plop/node_modules/mimic-fn": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
+ "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/plop/node_modules/onetime": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
+ "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==",
+ "dependencies": {
+ "mimic-fn": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/plop/node_modules/ora": {
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/ora/-/ora-3.4.0.tgz",
+ "integrity": "sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg==",
+ "dependencies": {
+ "chalk": "^2.4.2",
+ "cli-cursor": "^2.1.0",
+ "cli-spinners": "^2.0.0",
+ "log-symbols": "^2.2.0",
+ "strip-ansi": "^5.2.0",
+ "wcwidth": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/plop/node_modules/ora/node_modules/ansi-regex": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz",
+ "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/plop/node_modules/ora/node_modules/ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dependencies": {
+ "color-convert": "^1.9.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/plop/node_modules/ora/node_modules/chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dependencies": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/plop/node_modules/ora/node_modules/strip-ansi": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
+ "dependencies": {
+ "ansi-regex": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/plop/node_modules/ora/node_modules/supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/plop/node_modules/restore-cursor": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
+ "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==",
+ "dependencies": {
+ "onetime": "^2.0.0",
+ "signal-exit": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/plop/node_modules/strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==",
+ "dependencies": {
+ "ansi-regex": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/plop/node_modules/supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==",
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/pluralize": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz",
+ "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/pony-cause": {
+ "version": "2.1.10",
+ "resolved": "https://registry.npmjs.org/pony-cause/-/pony-cause-2.1.10.tgz",
+ "integrity": "sha512-3IKLNXclQgkU++2fSi93sQ6BznFuxSLB11HdvZQ6JW/spahf/P1pAHBQEahr20rs0htZW0UDkM1HmA+nZkXKsw==",
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/portal": {
+ "resolved": "packages/portal",
+ "link": true
+ },
+ "node_modules/posix-character-classes": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
+ "integrity": "sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/postcss": {
+ "version": "8.4.27",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.27.tgz",
+ "integrity": "sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "dependencies": {
+ "nanoid": "^3.3.6",
+ "picocolors": "^1.0.0",
+ "source-map-js": "^1.0.2"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/postcss-loader": {
+ "version": "7.3.3",
+ "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-7.3.3.tgz",
+ "integrity": "sha512-YgO/yhtevGO/vJePCQmTxiaEwER94LABZN0ZMT4A0vsak9TpO+RvKRs7EmJ8peIlB9xfXCsS7M8LjqncsUZ5HA==",
+ "dev": true,
+ "dependencies": {
+ "cosmiconfig": "^8.2.0",
+ "jiti": "^1.18.2",
+ "semver": "^7.3.8"
+ },
+ "engines": {
+ "node": ">= 14.15.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "postcss": "^7.0.0 || ^8.0.1",
+ "webpack": "^5.0.0"
+ }
+ },
+ "node_modules/postcss-modules-extract-imports": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz",
+ "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==",
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/postcss-modules-local-by-default": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.3.tgz",
+ "integrity": "sha512-2/u2zraspoACtrbFRnTijMiQtb4GW4BvatjaG/bCjYQo8kLTdevCUlwuBHx2sCnSyrI3x3qj4ZK1j5LQBgzmwA==",
+ "dependencies": {
+ "icss-utils": "^5.0.0",
+ "postcss-selector-parser": "^6.0.2",
+ "postcss-value-parser": "^4.1.0"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/postcss-modules-scope": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz",
+ "integrity": "sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==",
+ "dependencies": {
+ "postcss-selector-parser": "^6.0.4"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/postcss-modules-values": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz",
+ "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==",
+ "dependencies": {
+ "icss-utils": "^5.0.0"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/postcss-selector-parser": {
+ "version": "6.0.13",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz",
+ "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==",
+ "dependencies": {
+ "cssesc": "^3.0.0",
+ "util-deprecate": "^1.0.2"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/postcss-value-parser": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",
+ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="
+ },
+ "node_modules/postgres-array": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-3.0.2.tgz",
+ "integrity": "sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/postgres-bytea": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-3.0.0.tgz",
+ "integrity": "sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==",
+ "dev": true,
+ "dependencies": {
+ "obuf": "~1.1.2"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/postgres-date": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-2.0.1.tgz",
+ "integrity": "sha512-YtMKdsDt5Ojv1wQRvUhnyDJNSr2dGIC96mQVKz7xufp07nfuFONzdaowrMHjlAzY6GDLd4f+LUHHAAM1h4MdUw==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/postgres-interval": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-3.0.0.tgz",
+ "integrity": "sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/postgres-range": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/postgres-range/-/postgres-range-1.1.3.tgz",
+ "integrity": "sha512-VdlZoocy5lCP0c/t66xAfclglEapXPCIVhqqJRncYpvbCgImF0w67aPKfbqUMr72tO2k5q0TdTZwCLjPTI6C9g==",
+ "dev": true
+ },
+ "node_modules/prebuild-install": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz",
+ "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==",
+ "dependencies": {
+ "detect-libc": "^2.0.0",
+ "expand-template": "^2.0.3",
+ "github-from-package": "0.0.0",
+ "minimist": "^1.2.3",
+ "mkdirp-classic": "^0.5.3",
+ "napi-build-utils": "^1.0.1",
+ "node-abi": "^3.3.0",
+ "pump": "^3.0.0",
+ "rc": "^1.2.7",
+ "simple-get": "^4.0.0",
+ "tar-fs": "^2.0.0",
+ "tunnel-agent": "^0.6.0"
+ },
+ "bin": {
+ "prebuild-install": "bin.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/prelude-ls": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/prepend-http": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
+ "integrity": "sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/prettier": {
+ "version": "2.8.8",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
+ "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
+ "dev": true,
+ "bin": {
+ "prettier": "bin-prettier.js"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
+ "node_modules/prettier-linter-helpers": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
+ "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
+ "dev": true,
+ "dependencies": {
+ "fast-diff": "^1.1.2"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/pretty-bytes": {
+ "version": "5.6.0",
+ "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz",
+ "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/pretty-error": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-4.0.0.tgz",
+ "integrity": "sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw==",
+ "dependencies": {
+ "lodash": "^4.17.20",
+ "renderkid": "^3.0.0"
+ }
+ },
+ "node_modules/pretty-format": {
+ "version": "29.7.0",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz",
+ "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==",
+ "dev": true,
+ "dependencies": {
+ "@jest/schemas": "^29.6.3",
+ "ansi-styles": "^5.0.0",
+ "react-is": "^18.0.0"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/pretty-format/node_modules/ansi-styles": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz",
+ "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/pretty-format/node_modules/react-is": {
+ "version": "18.2.0",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
+ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==",
+ "dev": true
+ },
+ "node_modules/pretty-time": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/pretty-time/-/pretty-time-1.1.0.tgz",
+ "integrity": "sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/proc-log": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz",
+ "integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==",
+ "dev": true,
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/process": {
+ "version": "0.11.10",
+ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
+ "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
+ "engines": {
+ "node": ">= 0.6.0"
+ }
+ },
+ "node_modules/process-nextick-args": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
+ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
+ },
+ "node_modules/process-on-spawn": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz",
+ "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==",
+ "dev": true,
+ "dependencies": {
+ "fromentries": "^1.2.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/process-warning": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.2.0.tgz",
+ "integrity": "sha512-/1WZ8+VQjR6avWOgHeEPd7SDQmFQ1B5mC1eRXsCm5TarlNmx/wCsa5GEaxGm05BORRtyG/Ex/3xq3TuRvq57qg=="
+ },
+ "node_modules/promise-inflight": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",
+ "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==",
+ "dev": true
+ },
+ "node_modules/promise-retry": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz",
+ "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==",
+ "dev": true,
+ "dependencies": {
+ "err-code": "^2.0.2",
+ "retry": "^0.12.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/prompts": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz",
+ "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==",
+ "dev": true,
+ "dependencies": {
+ "kleur": "^3.0.3",
+ "sisteransi": "^1.0.5"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/prop-types": {
+ "version": "15.8.1",
+ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
+ "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
+ "dependencies": {
+ "loose-envify": "^1.4.0",
+ "object-assign": "^4.1.1",
+ "react-is": "^16.13.1"
+ }
+ },
+ "node_modules/property-expr": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-2.0.5.tgz",
+ "integrity": "sha512-IJUkICM5dP5znhCckHSv30Q4b5/JA5enCtkRHYaOVOAocnH/1BQEYTC5NMfT3AVl/iXKdr3aqQbQn9DxyWknwA=="
+ },
+ "node_modules/property-information": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.3.0.tgz",
+ "integrity": "sha512-gVNZ74nqhRMiIUYWGQdosYetaKc83x8oT41a0LlV3AAFCAZwCpg4vmGkq8t34+cUhp3cnM4XDiU/7xlgK7HGrg==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/proxy-addr": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
+ "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
+ "dependencies": {
+ "forwarded": "0.2.0",
+ "ipaddr.js": "1.9.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/proxy-from-env": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
+ },
+ "node_modules/prr": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
+ "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==",
+ "optional": true
+ },
+ "node_modules/psl": {
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz",
+ "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==",
+ "dev": true
+ },
+ "node_modules/pump": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
+ "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
+ "dependencies": {
+ "end-of-stream": "^1.1.0",
+ "once": "^1.3.1"
+ }
+ },
+ "node_modules/punycode": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
+ "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/pupa": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz",
+ "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==",
+ "dev": true,
+ "dependencies": {
+ "escape-goat": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/pure-rand": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.3.tgz",
+ "integrity": "sha512-KddyFewCsO0j3+np81IQ+SweXLDnDQTs5s67BOnrYmYe/yNmUhttQyGsYzy8yUnoljGAQ9sl38YB4vH8ur7Y+w==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://github.com/sponsors/dubzzz"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/fast-check"
+ }
+ ]
+ },
+ "node_modules/purest": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/purest/-/purest-4.0.2.tgz",
+ "integrity": "sha512-Uq6kdia8zGVHOb/0zAOb7FvKFMKeyeTZTLEwpO0JR3cIFEkpH6asv3ls9M9URDjHiYIdgAPmht5ecSbvPacfyg==",
+ "dependencies": {
+ "@simov/deep-extend": "^1.0.0",
+ "qs": "^6.10.3",
+ "request-compose": "^2.1.4",
+ "request-multipart": "^1.0.0",
+ "request-oauth": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/qs": {
+ "version": "6.11.2",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz",
+ "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==",
+ "dependencies": {
+ "side-channel": "^1.0.4"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/querystringify": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
+ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==",
+ "dev": true
+ },
+ "node_modules/queue-microtask": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
+ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/quick-format-unescaped": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz",
+ "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg=="
+ },
+ "node_modules/quick-lru": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz",
+ "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/randombytes": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
+ "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
+ "dependencies": {
+ "safe-buffer": "^5.1.0"
+ }
+ },
+ "node_modules/range-parser": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/raw-body": {
+ "version": "2.5.2",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",
+ "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==",
+ "dependencies": {
+ "bytes": "3.1.2",
+ "http-errors": "2.0.0",
+ "iconv-lite": "0.4.24",
+ "unpipe": "1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/rc": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
+ "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
+ "dependencies": {
+ "deep-extend": "^0.6.0",
+ "ini": "~1.3.0",
+ "minimist": "^1.2.0",
+ "strip-json-comments": "~2.0.1"
+ },
+ "bin": {
+ "rc": "cli.js"
+ }
+ },
+ "node_modules/rc/node_modules/ini": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
+ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
+ },
+ "node_modules/rc/node_modules/strip-json-comments": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
+ "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/react": {
+ "version": "18.2.0",
+ "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
+ "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==",
+ "dependencies": {
+ "loose-envify": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/react-dnd": {
+ "version": "15.1.2",
+ "resolved": "https://registry.npmjs.org/react-dnd/-/react-dnd-15.1.2.tgz",
+ "integrity": "sha512-EaSbMD9iFJDY/o48T3c8wn3uWU+2uxfFojhesZN3LhigJoAIvH2iOjxofSA9KbqhAKP6V9P853G6XG8JngKVtA==",
+ "dependencies": {
+ "@react-dnd/invariant": "3.0.1",
+ "@react-dnd/shallowequal": "3.0.1",
+ "dnd-core": "15.1.2",
+ "fast-deep-equal": "^3.1.3",
+ "hoist-non-react-statics": "^3.3.2"
+ },
+ "peerDependencies": {
+ "@types/hoist-non-react-statics": ">= 3.3.1",
+ "@types/node": ">= 12",
+ "@types/react": ">= 16",
+ "react": ">= 16.14"
+ },
+ "peerDependenciesMeta": {
+ "@types/hoist-non-react-statics": {
+ "optional": true
+ },
+ "@types/node": {
+ "optional": true
+ },
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-dnd-html5-backend": {
+ "version": "15.1.3",
+ "resolved": "https://registry.npmjs.org/react-dnd-html5-backend/-/react-dnd-html5-backend-15.1.3.tgz",
+ "integrity": "sha512-HH/8nOEmrrcRGHMqJR91FOwhnLlx5SRLXmsQwZT3IPcBjx88WT+0pWC5A4tDOYDdoooh9k+KMPvWfxooR5TcOA==",
+ "dependencies": {
+ "dnd-core": "15.1.2"
+ }
+ },
+ "node_modules/react-dom": {
+ "version": "18.2.0",
+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz",
+ "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==",
+ "dependencies": {
+ "loose-envify": "^1.1.0",
+ "scheduler": "^0.23.0"
+ },
+ "peerDependencies": {
+ "react": "^18.2.0"
+ }
+ },
+ "node_modules/react-error-boundary": {
+ "version": "3.1.4",
+ "resolved": "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-3.1.4.tgz",
+ "integrity": "sha512-uM9uPzZJTF6wRQORmSrvOIgt4lJ9MC1sNgEOj2XGsDTRE4kmpWxg7ENK9EWNKJRMAOY9z0MuF4yIfl6gp4sotA==",
+ "dependencies": {
+ "@babel/runtime": "^7.12.5"
+ },
+ "engines": {
+ "node": ">=10",
+ "npm": ">=6"
+ },
+ "peerDependencies": {
+ "react": ">=16.13.1"
+ }
+ },
+ "node_modules/react-fast-compare": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-2.0.4.tgz",
+ "integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw=="
+ },
+ "node_modules/react-helmet": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/react-helmet/-/react-helmet-6.1.0.tgz",
+ "integrity": "sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==",
+ "dependencies": {
+ "object-assign": "^4.1.1",
+ "prop-types": "^15.7.2",
+ "react-fast-compare": "^3.1.1",
+ "react-side-effect": "^2.1.0"
+ },
+ "peerDependencies": {
+ "react": ">=16.3.0"
+ }
+ },
+ "node_modules/react-helmet/node_modules/react-fast-compare": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.2.tgz",
+ "integrity": "sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ=="
+ },
+ "node_modules/react-intl": {
+ "version": "6.4.1",
+ "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-6.4.1.tgz",
+ "integrity": "sha512-/aT5595AEMZ+Pjmt8W2R5/ZkYJmyyd6jTzHzqhJ1LnfeG36+N5huBtykxYhHqLc1BrIRQ1fTX1orYC0Ej5ojtg==",
+ "dependencies": {
+ "@formatjs/ecma402-abstract": "1.14.3",
+ "@formatjs/icu-messageformat-parser": "2.3.1",
+ "@formatjs/intl": "2.7.1",
+ "@formatjs/intl-displaynames": "6.3.1",
+ "@formatjs/intl-listformat": "7.2.1",
+ "@types/hoist-non-react-statics": "^3.3.1",
+ "@types/react": "16 || 17 || 18",
+ "hoist-non-react-statics": "^3.3.2",
+ "intl-messageformat": "10.3.4",
+ "tslib": "^2.4.0"
+ },
+ "peerDependencies": {
+ "react": "^16.6.0 || 17 || 18",
+ "typescript": "^4.7 || 5"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-is": {
+ "version": "16.13.1",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
+ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
+ },
+ "node_modules/react-markdown": {
+ "version": "8.0.7",
+ "resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-8.0.7.tgz",
+ "integrity": "sha512-bvWbzG4MtOU62XqBx3Xx+zB2raaFFsq4mYiAzfjXJMEz2sixgeAfraA3tvzULF02ZdOMUOKTBFFaZJDDrq+BJQ==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "@types/prop-types": "^15.0.0",
+ "@types/unist": "^2.0.0",
+ "comma-separated-tokens": "^2.0.0",
+ "hast-util-whitespace": "^2.0.0",
+ "prop-types": "^15.0.0",
+ "property-information": "^6.0.0",
+ "react-is": "^18.0.0",
+ "remark-parse": "^10.0.0",
+ "remark-rehype": "^10.0.0",
+ "space-separated-tokens": "^2.0.0",
+ "style-to-object": "^0.4.0",
+ "unified": "^10.0.0",
+ "unist-util-visit": "^4.0.0",
+ "vfile": "^5.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ },
+ "peerDependencies": {
+ "@types/react": ">=16",
+ "react": ">=16"
+ }
+ },
+ "node_modules/react-markdown/node_modules/react-is": {
+ "version": "18.2.0",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
+ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
+ },
+ "node_modules/react-query": {
+ "version": "3.39.3",
+ "resolved": "https://registry.npmjs.org/react-query/-/react-query-3.39.3.tgz",
+ "integrity": "sha512-nLfLz7GiohKTJDuT4us4X3h/8unOh+00MLb2yJoGTPjxKs2bc1iDhkNx2bd5MKklXnOD3NrVZ+J2UXujA5In4g==",
+ "dependencies": {
+ "@babel/runtime": "^7.5.5",
+ "broadcast-channel": "^3.4.1",
+ "match-sorter": "^6.0.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ },
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "react-dom": {
+ "optional": true
+ },
+ "react-native": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-redux": {
+ "version": "8.1.1",
+ "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.1.1.tgz",
+ "integrity": "sha512-5W0QaKtEhj+3bC0Nj0NkqkhIv8gLADH/2kYFMTHxCVqQILiWzLv6MaLuV5wJU3BQEdHKzTfcvPN0WMS6SC1oyA==",
+ "dependencies": {
+ "@babel/runtime": "^7.12.1",
+ "@types/hoist-non-react-statics": "^3.3.1",
+ "@types/use-sync-external-store": "^0.0.3",
+ "hoist-non-react-statics": "^3.3.2",
+ "react-is": "^18.0.0",
+ "use-sync-external-store": "^1.0.0"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8 || ^17.0 || ^18.0",
+ "@types/react-dom": "^16.8 || ^17.0 || ^18.0",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0",
+ "react-native": ">=0.59",
+ "redux": "^4 || ^5.0.0-beta.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ },
+ "react-dom": {
+ "optional": true
+ },
+ "react-native": {
+ "optional": true
+ },
+ "redux": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-redux/node_modules/react-is": {
+ "version": "18.2.0",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
+ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
+ },
+ "node_modules/react-refresh": {
+ "version": "0.14.0",
+ "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.0.tgz",
+ "integrity": "sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/react-remove-scroll": {
+ "version": "2.5.6",
+ "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.6.tgz",
+ "integrity": "sha512-bO856ad1uDYLefgArk559IzUNeQ6SWH4QnrevIUjH+GczV56giDfl3h0Idptf2oIKxQmd1p9BN25jleKodTALg==",
+ "dependencies": {
+ "react-remove-scroll-bar": "^2.3.4",
+ "react-style-singleton": "^2.2.1",
+ "tslib": "^2.1.0",
+ "use-callback-ref": "^1.3.0",
+ "use-sidecar": "^1.1.2"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-remove-scroll-bar": {
+ "version": "2.3.4",
+ "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.4.tgz",
+ "integrity": "sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==",
+ "dependencies": {
+ "react-style-singleton": "^2.2.1",
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-router": {
+ "version": "5.3.4",
+ "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz",
+ "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==",
+ "dependencies": {
+ "@babel/runtime": "^7.12.13",
+ "history": "^4.9.0",
+ "hoist-non-react-statics": "^3.1.0",
+ "loose-envify": "^1.3.1",
+ "path-to-regexp": "^1.7.0",
+ "prop-types": "^15.6.2",
+ "react-is": "^16.6.0",
+ "tiny-invariant": "^1.0.2",
+ "tiny-warning": "^1.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=15"
+ }
+ },
+ "node_modules/react-router-dom": {
+ "version": "5.3.4",
+ "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz",
+ "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.12.13",
+ "history": "^4.9.0",
+ "loose-envify": "^1.3.1",
+ "prop-types": "^15.6.2",
+ "react-router": "5.3.4",
+ "tiny-invariant": "^1.0.2",
+ "tiny-warning": "^1.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=15"
+ }
+ },
+ "node_modules/react-router/node_modules/isarray": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+ "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
+ },
+ "node_modules/react-router/node_modules/path-to-regexp": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
+ "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
+ "dependencies": {
+ "isarray": "0.0.1"
+ }
+ },
+ "node_modules/react-select": {
+ "version": "5.7.0",
+ "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.0.tgz",
+ "integrity": "sha512-lJGiMxCa3cqnUr2Jjtg9YHsaytiZqeNOKeibv6WF5zbK/fPegZ1hg3y/9P1RZVLhqBTs0PfqQLKuAACednYGhQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.12.0",
+ "@emotion/cache": "^11.4.0",
+ "@emotion/react": "^11.8.1",
+ "@floating-ui/dom": "^1.0.1",
+ "@types/react-transition-group": "^4.4.0",
+ "memoize-one": "^6.0.0",
+ "prop-types": "^15.6.0",
+ "react-transition-group": "^4.3.0",
+ "use-isomorphic-layout-effect": "^1.1.2"
+ },
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ }
+ },
+ "node_modules/react-side-effect": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-2.1.2.tgz",
+ "integrity": "sha512-PVjOcvVOyIILrYoyGEpDN3vmYNLdy1CajSFNt4TDsVQC5KpTijDvWVoR+/7Rz2xT978D8/ZtFceXxzsPwZEDvw==",
+ "peerDependencies": {
+ "react": "^16.3.0 || ^17.0.0 || ^18.0.0"
+ }
+ },
+ "node_modules/react-style-singleton": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.1.tgz",
+ "integrity": "sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==",
+ "dependencies": {
+ "get-nonce": "^1.0.0",
+ "invariant": "^2.2.4",
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-transition-group": {
+ "version": "4.4.5",
+ "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",
+ "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==",
+ "dependencies": {
+ "@babel/runtime": "^7.5.5",
+ "dom-helpers": "^5.0.1",
+ "loose-envify": "^1.4.0",
+ "prop-types": "^15.6.2"
+ },
+ "peerDependencies": {
+ "react": ">=16.6.0",
+ "react-dom": ">=16.6.0"
+ }
+ },
+ "node_modules/react-window": {
+ "version": "1.8.8",
+ "resolved": "https://registry.npmjs.org/react-window/-/react-window-1.8.8.tgz",
+ "integrity": "sha512-D4IiBeRtGXziZ1n0XklnFGu7h9gU684zepqyKzgPNzrsrk7xOCxni+TCckjg2Nr/DiaEEGVVmnhYSlT2rB47dQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.0.0",
+ "memoize-one": ">=3.1.1 <6"
+ },
+ "engines": {
+ "node": ">8.0.0"
+ },
+ "peerDependencies": {
+ "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
+ "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
+ }
+ },
+ "node_modules/react-window/node_modules/memoize-one": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz",
+ "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q=="
+ },
+ "node_modules/read-package-json": {
+ "version": "6.0.4",
+ "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-6.0.4.tgz",
+ "integrity": "sha512-AEtWXYfopBj2z5N5PbkAOeNHRPUg5q+Nen7QLxV8M2zJq1ym6/lCz3fYNTCXe19puu2d06jfHhrP7v/S2PtMMw==",
+ "dev": true,
+ "dependencies": {
+ "glob": "^10.2.2",
+ "json-parse-even-better-errors": "^3.0.0",
+ "normalize-package-data": "^5.0.0",
+ "npm-normalize-package-bin": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/read-package-json-fast": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz",
+ "integrity": "sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==",
+ "dev": true,
+ "dependencies": {
+ "json-parse-even-better-errors": "^3.0.0",
+ "npm-normalize-package-bin": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/read-package-json-fast/node_modules/json-parse-even-better-errors": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz",
+ "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==",
+ "dev": true,
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/read-package-json/node_modules/brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "dev": true,
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/read-package-json/node_modules/foreground-child": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz",
+ "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==",
+ "dev": true,
+ "dependencies": {
+ "cross-spawn": "^7.0.0",
+ "signal-exit": "^4.0.1"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/read-package-json/node_modules/glob": {
+ "version": "10.3.10",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz",
+ "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==",
+ "dev": true,
+ "dependencies": {
+ "foreground-child": "^3.1.0",
+ "jackspeak": "^2.3.5",
+ "minimatch": "^9.0.1",
+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0",
+ "path-scurry": "^1.10.1"
+ },
+ "bin": {
+ "glob": "dist/esm/bin.mjs"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/read-package-json/node_modules/jackspeak": {
+ "version": "2.3.5",
+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.5.tgz",
+ "integrity": "sha512-Ratx+B8WeXLAtRJn26hrhY8S1+Jz6pxPMrkrdkgb/NstTNiqMhX0/oFVu5wX+g5n6JlEu2LPsDJmY8nRP4+alw==",
+ "dev": true,
+ "dependencies": {
+ "@isaacs/cliui": "^8.0.2"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ },
+ "optionalDependencies": {
+ "@pkgjs/parseargs": "^0.11.0"
+ }
+ },
+ "node_modules/read-package-json/node_modules/json-parse-even-better-errors": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz",
+ "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==",
+ "dev": true,
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/read-package-json/node_modules/minimatch": {
+ "version": "9.0.3",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
+ "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
+ "dev": true,
+ "dependencies": {
+ "brace-expansion": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/read-package-json/node_modules/signal-exit": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
+ "dev": true,
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/read-pkg": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
+ "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==",
+ "dev": true,
+ "dependencies": {
+ "load-json-file": "^4.0.0",
+ "normalize-package-data": "^2.3.2",
+ "path-type": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/read-pkg/node_modules/hosted-git-info": {
+ "version": "2.8.9",
+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
+ "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
+ "dev": true
+ },
+ "node_modules/read-pkg/node_modules/normalize-package-data": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
+ "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
+ "dev": true,
+ "dependencies": {
+ "hosted-git-info": "^2.1.4",
+ "resolve": "^1.10.0",
+ "semver": "2 || 3 || 4 || 5",
+ "validate-npm-package-license": "^3.0.1"
+ }
+ },
+ "node_modules/read-pkg/node_modules/path-type": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
+ "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
+ "dev": true,
+ "dependencies": {
+ "pify": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/read-pkg/node_modules/semver": {
+ "version": "5.7.2",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
+ "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver"
+ }
+ },
+ "node_modules/readable-stream": {
+ "version": "3.6.2",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
+ "dependencies": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/readdirp": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
+ "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
+ "dependencies": {
+ "picomatch": "^2.2.1"
+ },
+ "engines": {
+ "node": ">=8.10.0"
+ }
+ },
+ "node_modules/real-require": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz",
+ "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==",
+ "engines": {
+ "node": ">= 12.13.0"
+ }
+ },
+ "node_modules/rechoir": {
+ "version": "0.8.0",
+ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz",
+ "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==",
+ "dependencies": {
+ "resolve": "^1.20.0"
+ },
+ "engines": {
+ "node": ">= 10.13.0"
+ }
+ },
+ "node_modules/redux": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz",
+ "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==",
+ "dependencies": {
+ "@babel/runtime": "^7.9.2"
+ }
+ },
+ "node_modules/reflect-metadata": {
+ "version": "0.1.13",
+ "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz",
+ "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==",
+ "dev": true
+ },
+ "node_modules/reflect.getprototypeof": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz",
+ "integrity": "sha512-ECkTw8TmJwW60lOTR+ZkODISW6RQ8+2CL3COqtiJKLd6MmB45hN51HprHFziKLGkAuTGQhBb91V8cy+KHlaCjw==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1",
+ "get-intrinsic": "^1.2.1",
+ "globalthis": "^1.0.3",
+ "which-builtin-type": "^1.1.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/regenerate": {
+ "version": "1.4.2",
+ "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz",
+ "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==",
+ "dev": true
+ },
+ "node_modules/regenerate-unicode-properties": {
+ "version": "10.1.1",
+ "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz",
+ "integrity": "sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==",
+ "dev": true,
+ "dependencies": {
+ "regenerate": "^1.4.2"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/regenerator-runtime": {
+ "version": "0.13.11",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
+ "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
+ },
+ "node_modules/regenerator-transform": {
+ "version": "0.15.2",
+ "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz",
+ "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/runtime": "^7.8.4"
+ }
+ },
+ "node_modules/regex-not": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
+ "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==",
+ "dependencies": {
+ "extend-shallow": "^3.0.2",
+ "safe-regex": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/regex-parser": {
+ "version": "2.2.11",
+ "resolved": "https://registry.npmjs.org/regex-parser/-/regex-parser-2.2.11.tgz",
+ "integrity": "sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q==",
+ "dev": true
+ },
+ "node_modules/regexp.prototype.flags": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz",
+ "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "set-function-name": "^2.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/regexpu-core": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz",
+ "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==",
+ "dev": true,
+ "dependencies": {
+ "@babel/regjsgen": "^0.8.0",
+ "regenerate": "^1.4.2",
+ "regenerate-unicode-properties": "^10.1.0",
+ "regjsparser": "^0.9.1",
+ "unicode-match-property-ecmascript": "^2.0.0",
+ "unicode-match-property-value-ecmascript": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/registry-auth-token": {
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.2.tgz",
+ "integrity": "sha512-PC5ZysNb42zpFME6D/XlIgtNGdTl8bBOCw90xQLVMpzuuubJKYDWFAEuUNc+Cn8Z8724tg2SDhDRrkVEsqfDMg==",
+ "dependencies": {
+ "rc": "1.2.8"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/registry-url": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz",
+ "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==",
+ "dependencies": {
+ "rc": "^1.2.8"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/regjsparser": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz",
+ "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==",
+ "dev": true,
+ "dependencies": {
+ "jsesc": "~0.5.0"
+ },
+ "bin": {
+ "regjsparser": "bin/parser"
+ }
+ },
+ "node_modules/regjsparser/node_modules/jsesc": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
+ "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==",
+ "dev": true,
+ "bin": {
+ "jsesc": "bin/jsesc"
+ }
+ },
+ "node_modules/rehype-raw": {
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-6.1.1.tgz",
+ "integrity": "sha512-d6AKtisSRtDRX4aSPsJGTfnzrX2ZkHQLE5kiUuGOeEoLpbEulFF4hj0mLPbsa+7vmguDKOVVEQdHKDSwoaIDsQ==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "hast-util-raw": "^7.2.0",
+ "unified": "^10.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/rehype-sanitize": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/rehype-sanitize/-/rehype-sanitize-5.0.1.tgz",
+ "integrity": "sha512-da/jIOjq8eYt/1r9GN6GwxIR3gde7OZ+WV8pheu1tL8K0D9KxM2AyMh+UEfke+FfdM3PvGHeYJU0Td5OWa7L5A==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "hast-util-sanitize": "^4.0.0",
+ "unified": "^10.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/relateurl": {
+ "version": "0.2.7",
+ "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz",
+ "integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/release-zalgo": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz",
+ "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==",
+ "dev": true,
+ "dependencies": {
+ "es6-error": "^4.0.1"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/remark-parse": {
+ "version": "10.0.2",
+ "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-10.0.2.tgz",
+ "integrity": "sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw==",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "mdast-util-from-markdown": "^1.0.0",
+ "unified": "^10.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/remark-rehype": {
+ "version": "10.1.0",
+ "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-10.1.0.tgz",
+ "integrity": "sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "@types/mdast": "^3.0.0",
+ "mdast-util-to-hast": "^12.1.0",
+ "unified": "^10.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/remove-accents": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/remove-accents/-/remove-accents-0.4.2.tgz",
+ "integrity": "sha512-7pXIJqJOq5tFgG1A2Zxti3Ht8jJF337m4sowbuHsW30ZnkQFnDzy9qBNhgzX8ZLW4+UBcXiiR7SwR6pokHsxiA=="
+ },
+ "node_modules/renderkid": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-3.0.0.tgz",
+ "integrity": "sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg==",
+ "dependencies": {
+ "css-select": "^4.1.3",
+ "dom-converter": "^0.2.0",
+ "htmlparser2": "^6.1.0",
+ "lodash": "^4.17.21",
+ "strip-ansi": "^6.0.1"
+ }
+ },
+ "node_modules/renderkid/node_modules/css-select": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz",
+ "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==",
+ "dependencies": {
+ "boolbase": "^1.0.0",
+ "css-what": "^6.0.1",
+ "domhandler": "^4.3.1",
+ "domutils": "^2.8.0",
+ "nth-check": "^2.0.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/fb55"
+ }
+ },
+ "node_modules/renderkid/node_modules/dom-serializer": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz",
+ "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==",
+ "dependencies": {
+ "domelementtype": "^2.0.1",
+ "domhandler": "^4.2.0",
+ "entities": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
+ }
+ },
+ "node_modules/renderkid/node_modules/domhandler": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz",
+ "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==",
+ "dependencies": {
+ "domelementtype": "^2.2.0"
+ },
+ "engines": {
+ "node": ">= 4"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/domhandler?sponsor=1"
+ }
+ },
+ "node_modules/renderkid/node_modules/domutils": {
+ "version": "2.8.0",
+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz",
+ "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==",
+ "dependencies": {
+ "dom-serializer": "^1.0.1",
+ "domelementtype": "^2.2.0",
+ "domhandler": "^4.2.0"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/domutils?sponsor=1"
+ }
+ },
+ "node_modules/renderkid/node_modules/entities": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
+ "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
+ "node_modules/renderkid/node_modules/htmlparser2": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz",
+ "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==",
+ "funding": [
+ "https://github.com/fb55/htmlparser2?sponsor=1",
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fb55"
+ }
+ ],
+ "dependencies": {
+ "domelementtype": "^2.0.1",
+ "domhandler": "^4.0.0",
+ "domutils": "^2.5.2",
+ "entities": "^2.0.0"
+ }
+ },
+ "node_modules/repeat-element": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz",
+ "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/repeat-string": {
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
+ "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==",
+ "engines": {
+ "node": ">=0.10"
+ }
+ },
+ "node_modules/request-compose": {
+ "version": "2.1.6",
+ "resolved": "https://registry.npmjs.org/request-compose/-/request-compose-2.1.6.tgz",
+ "integrity": "sha512-S07L+2VbJB32WddD/o/PnYGKym63zLVbymygVWXvt8L79VAngcjAxhHaGuFOICLxEV90EasEPzqPKKHPspXP8w==",
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/request-ip": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/request-ip/-/request-ip-3.3.0.tgz",
+ "integrity": "sha512-cA6Xh6e0fDBBBwH77SLJaJPBmD3nWVAcF9/XAcsrIHdjhFzFiB5aNQFytdjCGPezU3ROwrR11IddKAM08vohxA=="
+ },
+ "node_modules/request-multipart": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/request-multipart/-/request-multipart-1.0.0.tgz",
+ "integrity": "sha512-dazx88T19dIKFNc0XdlZV8H46D2RmNFdR4mipcbrFOaN70PSSSMM3urVY+eVbrpraf/fHXccxFhLvG1wkSUtKQ==",
+ "dependencies": {
+ "bl": "^4.0.3",
+ "isstream": "^0.1.2",
+ "mime-types": "^2.1.28",
+ "multistream": "^4.0.1",
+ "uuid": "^8.3.2"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/request-oauth": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/request-oauth/-/request-oauth-1.0.1.tgz",
+ "integrity": "sha512-85THTg1RgOYtqQw42JON6AqvHLptlj1biw265Tsq4fD4cPdUvhDB2Qh9NTv17yCD322ROuO9aOmpc4GyayGVBA==",
+ "dependencies": {
+ "oauth-sign": "^0.9.0",
+ "qs": "^6.9.6",
+ "uuid": "^8.3.2"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/require-directory": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+ "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/require-from-string": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
+ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/require-in-the-middle": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.2.0.tgz",
+ "integrity": "sha512-3TLx5TGyAY6AOqLBoXmHkNql0HIf2RGbuMgCDT2WO/uGVAPJs6h7Kl+bN6TIZGd9bWhWPwnDnTHGtW8Iu77sdw==",
+ "dependencies": {
+ "debug": "^4.1.1",
+ "module-details-from-path": "^1.0.3",
+ "resolve": "^1.22.1"
+ },
+ "engines": {
+ "node": ">=8.6.0"
+ }
+ },
+ "node_modules/require-main-filename": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
+ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
+ "dev": true
+ },
+ "node_modules/requires-port": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
+ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
+ },
+ "node_modules/reselect": {
+ "version": "4.1.7",
+ "resolved": "https://registry.npmjs.org/reselect/-/reselect-4.1.7.tgz",
+ "integrity": "sha512-Zu1xbUt3/OPwsXL46hvOOoQrap2azE7ZQbokq61BQfiXvhewsKDwhMeZjTX9sX0nvw1t/U5Audyn1I9P/m9z0A=="
+ },
+ "node_modules/resolve": {
+ "version": "1.22.2",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz",
+ "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==",
+ "dependencies": {
+ "is-core-module": "^2.11.0",
+ "path-parse": "^1.0.7",
+ "supports-preserve-symlinks-flag": "^1.0.0"
+ },
+ "bin": {
+ "resolve": "bin/resolve"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/resolve-alpn": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz",
+ "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g=="
+ },
+ "node_modules/resolve-cwd": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz",
+ "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==",
+ "dependencies": {
+ "resolve-from": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/resolve-dir": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz",
+ "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==",
+ "dependencies": {
+ "expand-tilde": "^2.0.0",
+ "global-modules": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/resolve-from": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
+ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/resolve-path": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/resolve-path/-/resolve-path-1.4.0.tgz",
+ "integrity": "sha512-i1xevIst/Qa+nA9olDxLWnLk8YZbi8R/7JPbCMcgyWaFR6bKWaexgJgEB5oc2PKMjYdrHynyz0NY+if+H98t1w==",
+ "dependencies": {
+ "http-errors": "~1.6.2",
+ "path-is-absolute": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/resolve-path/node_modules/depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/resolve-path/node_modules/http-errors": {
+ "version": "1.6.3",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
+ "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==",
+ "dependencies": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.3",
+ "setprototypeof": "1.1.0",
+ "statuses": ">= 1.4.0 < 2"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/resolve-path/node_modules/inherits": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+ "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw=="
+ },
+ "node_modules/resolve-path/node_modules/setprototypeof": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz",
+ "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ=="
+ },
+ "node_modules/resolve-path/node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/resolve-pathname": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
+ "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
+ },
+ "node_modules/resolve-pkg-maps": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
+ "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
+ "dev": true,
+ "funding": {
+ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
+ }
+ },
+ "node_modules/resolve-url": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
+ "integrity": "sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==",
+ "deprecated": "https://github.com/lydell/resolve-url#deprecated"
+ },
+ "node_modules/resolve-url-loader": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-5.0.0.tgz",
+ "integrity": "sha512-uZtduh8/8srhBoMx//5bwqjQ+rfYOUq8zC9NrMUGtjBiGTtFJM42s58/36+hTqeqINcnYe08Nj3LkK9lW4N8Xg==",
+ "dev": true,
+ "dependencies": {
+ "adjust-sourcemap-loader": "^4.0.0",
+ "convert-source-map": "^1.7.0",
+ "loader-utils": "^2.0.0",
+ "postcss": "^8.2.14",
+ "source-map": "0.6.1"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/resolve-url-loader/node_modules/loader-utils": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
+ "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
+ "dev": true,
+ "dependencies": {
+ "big.js": "^5.2.2",
+ "emojis-list": "^3.0.0",
+ "json5": "^2.1.2"
+ },
+ "engines": {
+ "node": ">=8.9.0"
+ }
+ },
+ "node_modules/resolve-url-loader/node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/resolve.exports": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz",
+ "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/response-iterator": {
+ "version": "0.2.6",
+ "resolved": "https://registry.npmjs.org/response-iterator/-/response-iterator-0.2.6.tgz",
+ "integrity": "sha512-pVzEEzrsg23Sh053rmDUvLSkGXluZio0qu8VT6ukrYuvtjVfCbDZH9d6PGXb8HZfzdNZt8feXv/jvUzlhRgLnw==",
+ "peer": true,
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
+ "node_modules/responselike": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz",
+ "integrity": "sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==",
+ "dev": true,
+ "dependencies": {
+ "lowercase-keys": "^1.0.0"
+ }
+ },
+ "node_modules/restore-cursor": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
+ "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==",
+ "dependencies": {
+ "onetime": "^5.1.0",
+ "signal-exit": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ret": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/ret/-/ret-0.2.2.tgz",
+ "integrity": "sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/retry": {
+ "version": "0.12.0",
+ "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz",
+ "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==",
+ "dev": true,
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/reusify": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
+ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
+ "engines": {
+ "iojs": ">=1.0.0",
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/rfdc": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz",
+ "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA=="
+ },
+ "node_modules/rimraf": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz",
+ "integrity": "sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==",
+ "dev": true,
+ "dependencies": {
+ "glob": "^9.2.0"
+ },
+ "bin": {
+ "rimraf": "dist/cjs/src/bin.js"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/rimraf/node_modules/brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "dev": true,
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/rimraf/node_modules/glob": {
+ "version": "9.3.5",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz",
+ "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==",
+ "dev": true,
+ "dependencies": {
+ "fs.realpath": "^1.0.0",
+ "minimatch": "^8.0.2",
+ "minipass": "^4.2.4",
+ "path-scurry": "^1.6.1"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/rimraf/node_modules/minimatch": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz",
+ "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==",
+ "dev": true,
+ "dependencies": {
+ "brace-expansion": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/rimraf/node_modules/minipass": {
+ "version": "4.2.8",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz",
+ "integrity": "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/rollup": {
+ "version": "3.29.3",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.3.tgz",
+ "integrity": "sha512-T7du6Hum8jOkSWetjRgbwpM6Sy0nECYrYRSmZjayFcOddtKJWU4d17AC3HNUk7HRuqy4p+G7aEZclSHytqUmEg==",
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=14.18.0",
+ "npm": ">=8.0.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/run-async": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz",
+ "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==",
+ "engines": {
+ "node": ">=0.12.0"
+ }
+ },
+ "node_modules/run-parallel": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
+ "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "dependencies": {
+ "queue-microtask": "^1.2.2"
+ }
+ },
+ "node_modules/rxjs": {
+ "version": "7.8.1",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
+ "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
+ "dependencies": {
+ "tslib": "^2.1.0"
+ }
+ },
+ "node_modules/sade": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",
+ "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==",
+ "dependencies": {
+ "mri": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/safe-array-concat": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz",
+ "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "get-intrinsic": "^1.2.1",
+ "has-symbols": "^1.0.3",
+ "isarray": "^2.0.5"
+ },
+ "engines": {
+ "node": ">=0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/safe-regex": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
+ "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==",
+ "dependencies": {
+ "ret": "~0.1.10"
+ }
+ },
+ "node_modules/safe-regex-test": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz",
+ "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "get-intrinsic": "^1.1.3",
+ "is-regex": "^1.1.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/safe-regex/node_modules/ret": {
+ "version": "0.1.15",
+ "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
+ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
+ "engines": {
+ "node": ">=0.12"
+ }
+ },
+ "node_modules/safe-regex2": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-2.0.0.tgz",
+ "integrity": "sha512-PaUSFsUaNNuKwkBijoAPHAK6/eM6VirvyPWlZ7BAQy4D+hCvh4B6lIG+nPdhbFfIbP+gTGBcrdsOaUs0F+ZBOQ==",
+ "dependencies": {
+ "ret": "~0.2.0"
+ }
+ },
+ "node_modules/safe-stable-stringify": {
+ "version": "2.4.3",
+ "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz",
+ "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
+ },
+ "node_modules/safevalues": {
+ "version": "0.3.4",
+ "resolved": "https://registry.npmjs.org/safevalues/-/safevalues-0.3.4.tgz",
+ "integrity": "sha512-LRneZZRXNgjzwG4bDQdOTSbze3fHm1EAKN/8bePxnlEZiBmkYEDggaHbuvHI9/hoqHbGfsEA7tWS9GhYHZBBsw=="
+ },
+ "node_modules/sanitize-html": {
+ "version": "2.11.0",
+ "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.11.0.tgz",
+ "integrity": "sha512-BG68EDHRaGKqlsNjJ2xUB7gpInPA8gVx/mvjO743hZaeMCZ2DwzW7xvsqZ+KNU4QKwj86HJ3uu2liISf2qBBUA==",
+ "dependencies": {
+ "deepmerge": "^4.2.2",
+ "escape-string-regexp": "^4.0.0",
+ "htmlparser2": "^8.0.0",
+ "is-plain-object": "^5.0.0",
+ "parse-srcset": "^1.0.2",
+ "postcss": "^8.3.11"
+ }
+ },
+ "node_modules/sanitize-html/node_modules/is-plain-object": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
+ "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/sass": {
+ "version": "1.64.1",
+ "resolved": "https://registry.npmjs.org/sass/-/sass-1.64.1.tgz",
+ "integrity": "sha512-16rRACSOFEE8VN7SCgBu1MpYCyN7urj9At898tyzdXFhC+a+yOX5dXwAR7L8/IdPJ1NB8OYoXmD55DM30B2kEQ==",
+ "devOptional": true,
+ "dependencies": {
+ "chokidar": ">=3.0.0 <4.0.0",
+ "immutable": "^4.0.0",
+ "source-map-js": ">=0.6.2 <2.0.0"
+ },
+ "bin": {
+ "sass": "sass.js"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/sass-loader": {
+ "version": "13.3.2",
+ "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-13.3.2.tgz",
+ "integrity": "sha512-CQbKl57kdEv+KDLquhC+gE3pXt74LEAzm+tzywcA0/aHZuub8wTErbjAoNI57rPUWRYRNC5WUnNl8eGJNbDdwg==",
+ "dev": true,
+ "dependencies": {
+ "neo-async": "^2.6.2"
+ },
+ "engines": {
+ "node": ">= 14.15.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "fibers": ">= 3.1.0",
+ "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
+ "sass": "^1.3.0",
+ "sass-embedded": "*",
+ "webpack": "^5.0.0"
+ },
+ "peerDependenciesMeta": {
+ "fibers": {
+ "optional": true
+ },
+ "node-sass": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "sass-embedded": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/sax": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz",
+ "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA=="
+ },
+ "node_modules/saxes": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz",
+ "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==",
+ "dev": true,
+ "dependencies": {
+ "xmlchars": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/scheduler": {
+ "version": "0.23.0",
+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz",
+ "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==",
+ "dependencies": {
+ "loose-envify": "^1.1.0"
+ }
+ },
+ "node_modules/schema-utils": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz",
+ "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==",
+ "dependencies": {
+ "@types/json-schema": "^7.0.9",
+ "ajv": "^8.9.0",
+ "ajv-formats": "^2.1.1",
+ "ajv-keywords": "^5.1.0"
+ },
+ "engines": {
+ "node": ">= 12.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ }
+ },
+ "node_modules/secure-json-parse": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz",
+ "integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw=="
+ },
+ "node_modules/select-hose": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz",
+ "integrity": "sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg=="
+ },
+ "node_modules/selfsigned": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.1.1.tgz",
+ "integrity": "sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ==",
+ "dependencies": {
+ "node-forge": "^1"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/semver": {
+ "version": "7.5.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
+ "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
+ "dependencies": {
+ "lru-cache": "^6.0.0"
+ },
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/semver-diff": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz",
+ "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==",
+ "dev": true,
+ "dependencies": {
+ "semver": "^6.3.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/semver-diff/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/semver/node_modules/lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/semver/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
+ },
+ "node_modules/send": {
+ "version": "0.18.0",
+ "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
+ "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
+ "dependencies": {
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "destroy": "1.2.0",
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "fresh": "0.5.2",
+ "http-errors": "2.0.0",
+ "mime": "1.6.0",
+ "ms": "2.1.3",
+ "on-finished": "2.4.1",
+ "range-parser": "~1.2.1",
+ "statuses": "2.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/send/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/send/node_modules/debug/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ },
+ "node_modules/send/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
+ },
+ "node_modules/sendmail": {
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/sendmail/-/sendmail-1.6.1.tgz",
+ "integrity": "sha512-lIhvnjSi5e5jL8wA1GPP6j2QVlx6JOEfmdn0QIfmuJdmXYGmJ375kcOU0NSm/34J+nypm4sa1AXrYE5w3uNIIA==",
+ "dependencies": {
+ "dkim-signer": "0.2.2",
+ "mailcomposer": "3.12.0"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/sentence-case": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-2.1.1.tgz",
+ "integrity": "sha512-ENl7cYHaK/Ktwk5OTD+aDbQ3uC8IByu/6Bkg+HDv8Mm+XnBnppVNalcfJTNsp1ibstKh030/JKQQWglDvtKwEQ==",
+ "dependencies": {
+ "no-case": "^2.2.0",
+ "upper-case-first": "^1.1.2"
+ }
+ },
+ "node_modules/serialize-javascript": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz",
+ "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==",
+ "dependencies": {
+ "randombytes": "^2.1.0"
+ }
+ },
+ "node_modules/serve-index": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz",
+ "integrity": "sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==",
+ "dependencies": {
+ "accepts": "~1.3.4",
+ "batch": "0.6.1",
+ "debug": "2.6.9",
+ "escape-html": "~1.0.3",
+ "http-errors": "~1.6.2",
+ "mime-types": "~2.1.17",
+ "parseurl": "~1.3.2"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/serve-index/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/serve-index/node_modules/depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/serve-index/node_modules/http-errors": {
+ "version": "1.6.3",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
+ "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==",
+ "dependencies": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.3",
+ "setprototypeof": "1.1.0",
+ "statuses": ">= 1.4.0 < 2"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/serve-index/node_modules/inherits": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+ "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw=="
+ },
+ "node_modules/serve-index/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ },
+ "node_modules/serve-index/node_modules/setprototypeof": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz",
+ "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ=="
+ },
+ "node_modules/serve-index/node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/serve-static": {
+ "version": "1.15.0",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz",
+ "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
+ "dependencies": {
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "parseurl": "~1.3.3",
+ "send": "0.18.0"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/set-blocking": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
+ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
+ "dev": true
+ },
+ "node_modules/set-cookie-parser": {
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz",
+ "integrity": "sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ=="
+ },
+ "node_modules/set-function-name": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz",
+ "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==",
+ "dev": true,
+ "dependencies": {
+ "define-data-property": "^1.0.1",
+ "functions-have-names": "^1.2.3",
+ "has-property-descriptors": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/set-value": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
+ "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
+ "dependencies": {
+ "extend-shallow": "^2.0.1",
+ "is-extendable": "^0.1.1",
+ "is-plain-object": "^2.0.3",
+ "split-string": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/set-value/node_modules/extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
+ "dependencies": {
+ "is-extendable": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/set-value/node_modules/is-extendable": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+ "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/setprototypeof": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
+ },
+ "node_modules/sha.js": {
+ "version": "2.4.11",
+ "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
+ "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
+ "dependencies": {
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.0.1"
+ },
+ "bin": {
+ "sha.js": "bin.js"
+ }
+ },
+ "node_modules/shallow-clone": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz",
+ "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==",
+ "dependencies": {
+ "kind-of": "^6.0.2"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/shallowequal": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz",
+ "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ=="
+ },
+ "node_modules/sharp": {
+ "version": "0.32.0",
+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.0.tgz",
+ "integrity": "sha512-yLAypVcqj1toSAqRSwbs86nEzfyZVDYqjuUX8grhFpeij0DDNagKJXELS/auegDBRDg1XBtELdOGfo2X1cCpeA==",
+ "hasInstallScript": true,
+ "dependencies": {
+ "color": "^4.2.3",
+ "detect-libc": "^2.0.1",
+ "node-addon-api": "^6.0.0",
+ "prebuild-install": "^7.1.1",
+ "semver": "^7.3.8",
+ "simple-get": "^4.0.1",
+ "tar-fs": "^2.1.1",
+ "tunnel-agent": "^0.6.0"
+ },
+ "engines": {
+ "node": ">=14.15.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/sharp/node_modules/color": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz",
+ "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==",
+ "dependencies": {
+ "color-convert": "^2.0.1",
+ "color-string": "^1.9.0"
+ },
+ "engines": {
+ "node": ">=12.5.0"
+ }
+ },
+ "node_modules/sharp/node_modules/node-addon-api": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz",
+ "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA=="
+ },
+ "node_modules/shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "dependencies": {
+ "shebang-regex": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/shell-quote": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz",
+ "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/shimmer": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz",
+ "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw=="
+ },
+ "node_modules/side-channel": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
+ "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
+ "dependencies": {
+ "call-bind": "^1.0.0",
+ "get-intrinsic": "^1.0.2",
+ "object-inspect": "^1.9.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/sift": {
+ "version": "16.0.1",
+ "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz",
+ "integrity": "sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ=="
+ },
+ "node_modules/signal-exit": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
+ },
+ "node_modules/sigstore": {
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-1.9.0.tgz",
+ "integrity": "sha512-0Zjz0oe37d08VeOtBIuB6cRriqXse2e8w+7yIy2XSXjshRKxbc2KkhXjL229jXSxEm7UbcjS76wcJDGQddVI9A==",
+ "dev": true,
+ "dependencies": {
+ "@sigstore/bundle": "^1.1.0",
+ "@sigstore/protobuf-specs": "^0.2.0",
+ "@sigstore/sign": "^1.0.0",
+ "@sigstore/tuf": "^1.0.3",
+ "make-fetch-happen": "^11.0.1"
+ },
+ "bin": {
+ "sigstore": "bin/sigstore.js"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/simple-concat": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
+ "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/simple-get": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
+ "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "dependencies": {
+ "decompress-response": "^6.0.0",
+ "once": "^1.3.1",
+ "simple-concat": "^1.0.0"
+ }
+ },
+ "node_modules/simple-swizzle": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
+ "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
+ "dependencies": {
+ "is-arrayish": "^0.3.1"
+ }
+ },
+ "node_modules/simple-swizzle/node_modules/is-arrayish": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
+ "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
+ },
+ "node_modules/sisteransi": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",
+ "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==",
+ "dev": true
+ },
+ "node_modules/slash": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
+ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/smart-buffer": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz",
+ "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==",
+ "engines": {
+ "node": ">= 6.0.0",
+ "npm": ">= 3.0.0"
+ }
+ },
+ "node_modules/snake-case": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-2.1.0.tgz",
+ "integrity": "sha512-FMR5YoPFwOLuh4rRz92dywJjyKYZNLpMn1R5ujVpIYkbA9p01fq8RMg0FkO4M+Yobt4MjHeLTJVm5xFFBHSV2Q==",
+ "dependencies": {
+ "no-case": "^2.2.0"
+ }
+ },
+ "node_modules/snapdragon": {
+ "version": "0.8.2",
+ "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
+ "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==",
+ "dependencies": {
+ "base": "^0.11.1",
+ "debug": "^2.2.0",
+ "define-property": "^0.2.5",
+ "extend-shallow": "^2.0.1",
+ "map-cache": "^0.2.2",
+ "source-map": "^0.5.6",
+ "source-map-resolve": "^0.5.0",
+ "use": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/snapdragon-node": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
+ "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==",
+ "dependencies": {
+ "define-property": "^1.0.0",
+ "isobject": "^3.0.0",
+ "snapdragon-util": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/snapdragon-node/node_modules/define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==",
+ "dependencies": {
+ "is-descriptor": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/snapdragon-util": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
+ "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==",
+ "dependencies": {
+ "kind-of": "^3.2.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/snapdragon-util/node_modules/kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/snapdragon/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/snapdragon/node_modules/define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==",
+ "dependencies": {
+ "is-descriptor": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/snapdragon/node_modules/extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
+ "dependencies": {
+ "is-extendable": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/snapdragon/node_modules/is-accessor-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+ "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==",
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/snapdragon/node_modules/is-accessor-descriptor/node_modules/kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/snapdragon/node_modules/is-data-descriptor": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+ "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==",
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/snapdragon/node_modules/is-data-descriptor/node_modules/kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/snapdragon/node_modules/is-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
+ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
+ "dependencies": {
+ "is-accessor-descriptor": "^0.1.6",
+ "is-data-descriptor": "^0.1.4",
+ "kind-of": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/snapdragon/node_modules/is-extendable": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+ "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/snapdragon/node_modules/kind-of": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+ "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/snapdragon/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ },
+ "node_modules/snapdragon/node_modules/source-map": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+ "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/sockjs": {
+ "version": "0.3.24",
+ "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz",
+ "integrity": "sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==",
+ "dependencies": {
+ "faye-websocket": "^0.11.3",
+ "uuid": "^8.3.2",
+ "websocket-driver": "^0.7.4"
+ }
+ },
+ "node_modules/socks": {
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz",
+ "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==",
+ "dependencies": {
+ "ip": "^2.0.0",
+ "smart-buffer": "^4.2.0"
+ },
+ "engines": {
+ "node": ">= 10.13.0",
+ "npm": ">= 3.0.0"
+ }
+ },
+ "node_modules/socks-proxy-agent": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz",
+ "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==",
+ "dev": true,
+ "dependencies": {
+ "agent-base": "^6.0.2",
+ "debug": "^4.3.3",
+ "socks": "^2.6.2"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/sonic-boom": {
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.4.0.tgz",
+ "integrity": "sha512-zSe9QQW30nPzjkSJ0glFQO5T9lHsk39tz+2bAAwCj8CNgEG8ItZiX7Wb2ZgA8I04dwRGCcf1m3ABJa8AYm12Fw==",
+ "dependencies": {
+ "atomic-sleep": "^1.0.0"
+ }
+ },
+ "node_modules/sorted-array-functions": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/sorted-array-functions/-/sorted-array-functions-1.3.0.tgz",
+ "integrity": "sha512-2sqgzeFlid6N4Z2fUQ1cvFmTOLRi/sEDzSQ0OKYchqgoPmQBVyM3959qYx3fpS6Esef80KjmpgPeEr028dP3OA=="
+ },
+ "node_modules/source-list-map": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz",
+ "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw=="
+ },
+ "node_modules/source-map": {
+ "version": "0.7.4",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz",
+ "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/source-map-js": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
+ "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/source-map-loader": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/source-map-loader/-/source-map-loader-4.0.1.tgz",
+ "integrity": "sha512-oqXpzDIByKONVY8g1NUPOTQhe0UTU5bWUl32GSkqK2LjJj0HmwTMVKxcUip0RgAYhY1mqgOxjbQM48a0mmeNfA==",
+ "dev": true,
+ "dependencies": {
+ "abab": "^2.0.6",
+ "iconv-lite": "^0.6.3",
+ "source-map-js": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 14.15.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "webpack": "^5.72.1"
+ }
+ },
+ "node_modules/source-map-loader/node_modules/iconv-lite": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
+ "dev": true,
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/source-map-resolve": {
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz",
+ "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==",
+ "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated",
+ "dependencies": {
+ "atob": "^2.1.2",
+ "decode-uri-component": "^0.2.0",
+ "resolve-url": "^0.2.1",
+ "source-map-url": "^0.4.0",
+ "urix": "^0.1.0"
+ }
+ },
+ "node_modules/source-map-support": {
+ "version": "0.5.21",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
+ "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
+ "dependencies": {
+ "buffer-from": "^1.0.0",
+ "source-map": "^0.6.0"
+ }
+ },
+ "node_modules/source-map-support/node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/source-map-url": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz",
+ "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==",
+ "deprecated": "See https://github.com/lydell/source-map-url#deprecated"
+ },
+ "node_modules/space-separated-tokens": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz",
+ "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/sparse-bitfield": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
+ "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==",
+ "optional": true,
+ "dependencies": {
+ "memory-pager": "^1.0.2"
+ }
+ },
+ "node_modules/spawn-command": {
+ "version": "0.0.2-1",
+ "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz",
+ "integrity": "sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg==",
+ "dev": true
+ },
+ "node_modules/spawn-wrap": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz",
+ "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==",
+ "dev": true,
+ "dependencies": {
+ "foreground-child": "^2.0.0",
+ "is-windows": "^1.0.2",
+ "make-dir": "^3.0.0",
+ "rimraf": "^3.0.0",
+ "signal-exit": "^3.0.2",
+ "which": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/spawn-wrap/node_modules/make-dir": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
+ "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
+ "dev": true,
+ "dependencies": {
+ "semver": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/spawn-wrap/node_modules/rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dev": true,
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/spawn-wrap/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/spdx-correct": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz",
+ "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==",
+ "dev": true,
+ "dependencies": {
+ "spdx-expression-parse": "^3.0.0",
+ "spdx-license-ids": "^3.0.0"
+ }
+ },
+ "node_modules/spdx-exceptions": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
+ "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==",
+ "dev": true
+ },
+ "node_modules/spdx-expression-parse": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
+ "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
+ "dev": true,
+ "dependencies": {
+ "spdx-exceptions": "^2.1.0",
+ "spdx-license-ids": "^3.0.0"
+ }
+ },
+ "node_modules/spdx-license-ids": {
+ "version": "3.0.15",
+ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.15.tgz",
+ "integrity": "sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ==",
+ "dev": true
+ },
+ "node_modules/spdy": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz",
+ "integrity": "sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==",
+ "dependencies": {
+ "debug": "^4.1.0",
+ "handle-thing": "^2.0.0",
+ "http-deceiver": "^1.2.7",
+ "select-hose": "^2.0.0",
+ "spdy-transport": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/spdy-transport": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz",
+ "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==",
+ "dependencies": {
+ "debug": "^4.1.0",
+ "detect-node": "^2.0.4",
+ "hpack.js": "^2.1.6",
+ "obuf": "^1.1.2",
+ "readable-stream": "^3.0.6",
+ "wbuf": "^1.7.3"
+ }
+ },
+ "node_modules/split-string": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
+ "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==",
+ "dependencies": {
+ "extend-shallow": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/split2": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz",
+ "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==",
+ "dependencies": {
+ "readable-stream": "^3.0.0"
+ }
+ },
+ "node_modules/sprintf-js": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+ "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="
+ },
+ "node_modules/ssri": {
+ "version": "10.0.5",
+ "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.5.tgz",
+ "integrity": "sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==",
+ "dev": true,
+ "dependencies": {
+ "minipass": "^7.0.3"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/ssri/node_modules/minipass": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz",
+ "integrity": "sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==",
+ "dev": true,
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ }
+ },
+ "node_modules/stack-chain": {
+ "version": "1.3.7",
+ "resolved": "https://registry.npmjs.org/stack-chain/-/stack-chain-1.3.7.tgz",
+ "integrity": "sha512-D8cWtWVdIe/jBA7v5p5Hwl5yOSOrmZPWDPe2KxQ5UAGD+nxbxU0lKXA4h85Ta6+qgdKVL3vUxsbIZjc1kBG7ug=="
+ },
+ "node_modules/stack-trace": {
+ "version": "0.0.10",
+ "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
+ "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/stack-utils": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz",
+ "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==",
+ "dev": true,
+ "dependencies": {
+ "escape-string-regexp": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/stack-utils/node_modules/escape-string-regexp": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
+ "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/stackframe": {
+ "version": "1.3.4",
+ "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz",
+ "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw=="
+ },
+ "node_modules/static-extend": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
+ "integrity": "sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==",
+ "dependencies": {
+ "define-property": "^0.2.5",
+ "object-copy": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/static-extend/node_modules/define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==",
+ "dependencies": {
+ "is-descriptor": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/static-extend/node_modules/is-accessor-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+ "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==",
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/static-extend/node_modules/is-accessor-descriptor/node_modules/kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/static-extend/node_modules/is-data-descriptor": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+ "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==",
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/static-extend/node_modules/is-data-descriptor/node_modules/kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/static-extend/node_modules/is-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
+ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
+ "dependencies": {
+ "is-accessor-descriptor": "^0.1.6",
+ "is-data-descriptor": "^0.1.4",
+ "kind-of": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/static-extend/node_modules/kind-of": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+ "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/statuses": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
+ "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/std-env": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.4.3.tgz",
+ "integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q=="
+ },
+ "node_modules/stoppable": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz",
+ "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==",
+ "engines": {
+ "node": ">=4",
+ "npm": ">=6"
+ }
+ },
+ "node_modules/strapi-provider-upload-azure-storage": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/strapi-provider-upload-azure-storage/-/strapi-provider-upload-azure-storage-2.1.0.tgz",
+ "integrity": "sha512-Mfr1DtHQ8IxVjuZlsT4h7/7FM+kj9Qmaq91g0dzpjHF1azR3qWWcT5x0SpOzqA7ipTH/UTE4qKf9Djrpm04kdg==",
+ "dependencies": {
+ "@azure/storage-blob": "^10.5.0"
+ }
+ },
+ "node_modules/stream-chain": {
+ "version": "2.2.5",
+ "resolved": "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.5.tgz",
+ "integrity": "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA=="
+ },
+ "node_modules/stream-json": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/stream-json/-/stream-json-1.8.0.tgz",
+ "integrity": "sha512-HZfXngYHUAr1exT4fxlbc1IOce1RYxp2ldeaf97LYCOPSoOqY/1Psp7iGvpb+6JIOgkra9zDYnPX01hGAHzEPw==",
+ "dependencies": {
+ "stream-chain": "^2.2.5"
+ }
+ },
+ "node_modules/stream-slice": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/stream-slice/-/stream-slice-0.1.2.tgz",
+ "integrity": "sha512-QzQxpoacatkreL6jsxnVb7X5R/pGw9OUv2qWTYWnmLpg4NdN31snPy/f3TdQE1ZUXaThRvj1Zw4/OGg0ZkaLMA=="
+ },
+ "node_modules/streamsearch": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz",
+ "integrity": "sha512-jos8u++JKm0ARcSUTAZXOVC0mSox7Bhn6sBgty73P1f3JGf7yG2clTbBNHUdde/kdvP2FESam+vM6l8jBrNxHA==",
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/string_decoder": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
+ "dependencies": {
+ "safe-buffer": "~5.2.0"
+ }
+ },
+ "node_modules/string-argv": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz",
+ "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==",
+ "engines": {
+ "node": ">=0.6.19"
+ }
+ },
+ "node_modules/string-length": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz",
+ "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==",
+ "dev": true,
+ "dependencies": {
+ "char-regex": "^1.0.2",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/string-width-cjs": {
+ "name": "string-width",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/string.prototype.matchall": {
+ "version": "4.0.10",
+ "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz",
+ "integrity": "sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1",
+ "get-intrinsic": "^1.2.1",
+ "has-symbols": "^1.0.3",
+ "internal-slot": "^1.0.5",
+ "regexp.prototype.flags": "^1.5.0",
+ "set-function-name": "^2.0.0",
+ "side-channel": "^1.0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/string.prototype.padend": {
+ "version": "3.1.5",
+ "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.5.tgz",
+ "integrity": "sha512-DOB27b/2UTTD+4myKUFh+/fXWcu/UDyASIXfg+7VzoCNNGOfWvoyU/x5pvVHr++ztyt/oSYI1BcWBBG/hmlNjA==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/string.prototype.trim": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz",
+ "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/string.prototype.trimend": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz",
+ "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/string.prototype.trimstart": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz",
+ "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.2.0",
+ "es-abstract": "^1.22.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/strip-ansi-cjs": {
+ "name": "strip-ansi",
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dev": true,
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/strip-bom": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
+ "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/strip-final-newline": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
+ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/stripe": {
+ "version": "13.7.0",
+ "resolved": "https://registry.npmjs.org/stripe/-/stripe-13.7.0.tgz",
+ "integrity": "sha512-0cbUNl5aDwt5rIZeE/WgyTxZN/PtwyeA5KcVJrHj260tjN4IOo2BZikN+dxhKoeBfI4aSRAd3E5vHRKmjjaSbA==",
+ "dependencies": {
+ "@types/node": ">=8.1.0",
+ "qs": "^6.11.0"
+ },
+ "engines": {
+ "node": ">=12.*"
+ }
+ },
+ "node_modules/stripe-api": {
+ "resolved": "packages/stripe",
+ "link": true
+ },
+ "node_modules/strnum": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz",
+ "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==",
+ "optional": true
+ },
+ "node_modules/style-loader": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.3.1.tgz",
+ "integrity": "sha512-GPcQ+LDJbrcxHORTRes6Jy2sfvK2kS6hpSfI/fXhPt+spVzxF6LJ1dHLN9zIGmVaaP044YKaIatFaufENRiDoQ==",
+ "engines": {
+ "node": ">= 12.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "webpack": "^5.0.0"
+ }
+ },
+ "node_modules/style-mod": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.0.tgz",
+ "integrity": "sha512-Ca5ib8HrFn+f+0n4N4ScTIA9iTOQ7MaGS1ylHcoVqW9J7w2w8PzN6g9gKmTYgGEBH8e120+RCmhpje6jC5uGWA=="
+ },
+ "node_modules/style-to-object": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-0.4.2.tgz",
+ "integrity": "sha512-1JGpfPB3lo42ZX8cuPrheZbfQ6kqPPnPHlKMyeRYtfKD+0jG+QsXgXN57O/dvJlzlB2elI6dGmrPnl5VPQFPaA==",
+ "dependencies": {
+ "inline-style-parser": "0.1.1"
+ }
+ },
+ "node_modules/styled-components": {
+ "version": "5.3.3",
+ "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.3.3.tgz",
+ "integrity": "sha512-++4iHwBM7ZN+x6DtPPWkCI4vdtwumQ+inA/DdAsqYd4SVgUKJie5vXyzotA00ttcFdQkCng7zc6grwlfIfw+lw==",
+ "dependencies": {
+ "@babel/helper-module-imports": "^7.0.0",
+ "@babel/traverse": "^7.4.5",
+ "@emotion/is-prop-valid": "^0.8.8",
+ "@emotion/stylis": "^0.8.4",
+ "@emotion/unitless": "^0.7.4",
+ "babel-plugin-styled-components": ">= 1.12.0",
+ "css-to-react-native": "^3.0.0",
+ "hoist-non-react-statics": "^3.0.0",
+ "shallowequal": "^1.1.0",
+ "supports-color": "^5.5.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/styled-components"
+ },
+ "peerDependencies": {
+ "react": ">= 16.8.0",
+ "react-dom": ">= 16.8.0",
+ "react-is": ">= 16.8.0"
+ }
+ },
+ "node_modules/styled-components/node_modules/@emotion/unitless": {
+ "version": "0.7.5",
+ "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz",
+ "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg=="
+ },
+ "node_modules/styled-components/node_modules/has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/styled-components/node_modules/supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/styled-jsx": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz",
+ "integrity": "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==",
+ "dependencies": {
+ "client-only": "0.0.1"
+ },
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "peerDependencies": {
+ "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0"
+ },
+ "peerDependenciesMeta": {
+ "@babel/core": {
+ "optional": true
+ },
+ "babel-plugin-macros": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/stylis": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz",
+ "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw=="
+ },
+ "node_modules/sudo-prompt": {
+ "version": "8.2.5",
+ "resolved": "https://registry.npmjs.org/sudo-prompt/-/sudo-prompt-8.2.5.tgz",
+ "integrity": "sha512-rlBo3HU/1zAJUrkY6jNxDOC9eVYliG6nS4JA8u8KAshITd07tafMc/Br7xQwCSseXwJ2iCcHCE8SNWX3q8Z+kw==",
+ "dev": true
+ },
+ "node_modules/supports-color": {
+ "version": "8.1.1",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
+ "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/supports-color?sponsor=1"
+ }
+ },
+ "node_modules/supports-preserve-symlinks-flag": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
+ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/swagger-ui-dist": {
+ "version": "4.19.1",
+ "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-4.19.1.tgz",
+ "integrity": "sha512-n/gFn+R7G/BXWwl5UZLw6F1YgWOlf3zkwGlsPhTMhNtAAolBGKg0JS5b2RKt5NI6/hSopVaSrki2wTIMUDDy2w=="
+ },
+ "node_modules/swap-case": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/swap-case/-/swap-case-1.1.2.tgz",
+ "integrity": "sha512-BAmWG6/bx8syfc6qXPprof3Mn5vQgf5dwdUNJhsNqU9WdPt5P+ES/wQ5bxfijy8zwZgZZHslC3iAsxsuQMCzJQ==",
+ "dependencies": {
+ "lower-case": "^1.1.1",
+ "upper-case": "^1.1.1"
+ }
+ },
+ "node_modules/symbol-observable": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz",
+ "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==",
+ "engines": {
+ "node": ">=0.10"
+ }
+ },
+ "node_modules/symbol-tree": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
+ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",
+ "dev": true
+ },
+ "node_modules/tap": {
+ "version": "16.3.8",
+ "resolved": "https://registry.npmjs.org/tap/-/tap-16.3.8.tgz",
+ "integrity": "sha512-ARpCLtOFST37MholnZm7JMFikGq0x/T9uBdZH83iuddPNgwDTZQiD8+4x7VABUfVWS0ozKUkmHZ5OOzMI3fLPg==",
+ "bundleDependencies": [
+ "ink",
+ "treport",
+ "@types/react",
+ "@isaacs/import-jsx",
+ "react"
+ ],
+ "dev": true,
+ "dependencies": {
+ "@isaacs/import-jsx": "^4.0.1",
+ "@types/react": "^17.0.52",
+ "chokidar": "^3.3.0",
+ "findit": "^2.0.0",
+ "foreground-child": "^2.0.0",
+ "fs-exists-cached": "^1.0.0",
+ "glob": "^7.2.3",
+ "ink": "^3.2.0",
+ "isexe": "^2.0.0",
+ "istanbul-lib-processinfo": "^2.0.3",
+ "jackspeak": "^1.4.2",
+ "libtap": "^1.4.0",
+ "minipass": "^3.3.4",
+ "mkdirp": "^1.0.4",
+ "nyc": "^15.1.0",
+ "opener": "^1.5.1",
+ "react": "^17.0.2",
+ "rimraf": "^3.0.0",
+ "signal-exit": "^3.0.6",
+ "source-map-support": "^0.5.16",
+ "tap-mocha-reporter": "^5.0.3",
+ "tap-parser": "^11.0.2",
+ "tap-yaml": "^1.0.2",
+ "tcompare": "^5.0.7",
+ "treport": "^3.0.4",
+ "which": "^2.0.2"
+ },
+ "bin": {
+ "tap": "bin/run.js"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ },
+ "peerDependencies": {
+ "coveralls": "^3.1.1",
+ "flow-remove-types": ">=2.112.0",
+ "ts-node": ">=8.5.2",
+ "typescript": ">=3.7.2"
+ },
+ "peerDependenciesMeta": {
+ "coveralls": {
+ "optional": true
+ },
+ "flow-remove-types": {
+ "optional": true
+ },
+ "ts-node": {
+ "optional": true
+ },
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/tap-mocha-reporter": {
+ "version": "5.0.4",
+ "resolved": "https://registry.npmjs.org/tap-mocha-reporter/-/tap-mocha-reporter-5.0.4.tgz",
+ "integrity": "sha512-J+YMO8B7lq1O6Zxd/jeuG27vJ+Y4tLiRMKPSb7KR6FVh86k3Rq1TwYc2GKPyIjCbzzdMdReh3Vfz9L5cg1Z2Bw==",
+ "dev": true,
+ "dependencies": {
+ "color-support": "^1.1.0",
+ "debug": "^4.1.1",
+ "diff": "^4.0.1",
+ "escape-string-regexp": "^2.0.0",
+ "glob": "^7.0.5",
+ "tap-parser": "^11.0.0",
+ "tap-yaml": "^1.0.0",
+ "unicode-length": "^2.0.2"
+ },
+ "bin": {
+ "tap-mocha-reporter": "index.js"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/tap-mocha-reporter/node_modules/escape-string-regexp": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
+ "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap-parser": {
+ "version": "11.0.2",
+ "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-11.0.2.tgz",
+ "integrity": "sha512-6qGlC956rcORw+fg7Fv1iCRAY8/bU9UabUAhs3mXRH6eRmVZcNPLheSXCYaVaYeSwx5xa/1HXZb1537YSvwDZg==",
+ "dev": true,
+ "dependencies": {
+ "events-to-array": "^1.0.1",
+ "minipass": "^3.1.6",
+ "tap-yaml": "^1.0.0"
+ },
+ "bin": {
+ "tap-parser": "bin/cmd.js"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/tap-parser/node_modules/minipass": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
+ "dev": true,
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap-parser/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ },
+ "node_modules/tap-yaml": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/tap-yaml/-/tap-yaml-1.0.2.tgz",
+ "integrity": "sha512-GegASpuqBnRNdT1U+yuUPZ8rEU64pL35WPBpCISWwff4dErS2/438barz7WFJl4Nzh3Y05tfPidZnH+GaV1wMg==",
+ "dev": true,
+ "dependencies": {
+ "yaml": "^1.10.2"
+ }
+ },
+ "node_modules/tap-yaml/node_modules/yaml": {
+ "version": "1.10.2",
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
+ "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
+ "dev": true,
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/tap/node_modules/@ampproject/remapping": {
+ "version": "2.2.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.0",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/code-frame": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/highlight": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/compat-data": {
+ "version": "7.22.9",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/core": {
+ "version": "7.22.9",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@ampproject/remapping": "^2.2.0",
+ "@babel/code-frame": "^7.22.5",
+ "@babel/generator": "^7.22.9",
+ "@babel/helper-compilation-targets": "^7.22.9",
+ "@babel/helper-module-transforms": "^7.22.9",
+ "@babel/helpers": "^7.22.6",
+ "@babel/parser": "^7.22.7",
+ "@babel/template": "^7.22.5",
+ "@babel/traverse": "^7.22.8",
+ "@babel/types": "^7.22.5",
+ "convert-source-map": "^1.7.0",
+ "debug": "^4.1.0",
+ "gensync": "^1.0.0-beta.2",
+ "json5": "^2.2.2",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/babel"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/generator": {
+ "version": "7.22.9",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.22.5",
+ "@jridgewell/gen-mapping": "^0.3.2",
+ "@jridgewell/trace-mapping": "^0.3.17",
+ "jsesc": "^2.5.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/helper-annotate-as-pure": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/helper-compilation-targets": {
+ "version": "7.22.9",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/compat-data": "^7.22.9",
+ "@babel/helper-validator-option": "^7.22.5",
+ "browserslist": "^4.21.9",
+ "lru-cache": "^5.1.1",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/helper-environment-visitor": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/helper-function-name": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/template": "^7.22.5",
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/helper-hoist-variables": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/helper-module-imports": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/helper-module-transforms": {
+ "version": "7.22.9",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-environment-visitor": "^7.22.5",
+ "@babel/helper-module-imports": "^7.22.5",
+ "@babel/helper-simple-access": "^7.22.5",
+ "@babel/helper-split-export-declaration": "^7.22.6",
+ "@babel/helper-validator-identifier": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/helper-plugin-utils": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/helper-simple-access": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/helper-split-export-declaration": {
+ "version": "7.22.6",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/helper-string-parser": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/helper-validator-identifier": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/helper-validator-option": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/helpers": {
+ "version": "7.22.6",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/template": "^7.22.5",
+ "@babel/traverse": "^7.22.6",
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/highlight": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-validator-identifier": "^7.22.5",
+ "chalk": "^2.0.0",
+ "js-tokens": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/parser": {
+ "version": "7.22.7",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/plugin-proposal-object-rest-spread": {
+ "version": "7.20.7",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/compat-data": "^7.20.5",
+ "@babel/helper-compilation-targets": "^7.20.7",
+ "@babel/helper-plugin-utils": "^7.20.2",
+ "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
+ "@babel/plugin-transform-parameters": "^7.20.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/plugin-syntax-jsx": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/plugin-syntax-object-rest-spread": {
+ "version": "7.8.3",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.8.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/plugin-transform-destructuring": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/plugin-transform-parameters": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/plugin-transform-react-jsx": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-annotate-as-pure": "^7.22.5",
+ "@babel/helper-module-imports": "^7.22.5",
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/plugin-syntax-jsx": "^7.22.5",
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/template": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.22.5",
+ "@babel/parser": "^7.22.5",
+ "@babel/types": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/traverse": {
+ "version": "7.22.8",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.22.5",
+ "@babel/generator": "^7.22.7",
+ "@babel/helper-environment-visitor": "^7.22.5",
+ "@babel/helper-function-name": "^7.22.5",
+ "@babel/helper-hoist-variables": "^7.22.5",
+ "@babel/helper-split-export-declaration": "^7.22.6",
+ "@babel/parser": "^7.22.7",
+ "@babel/types": "^7.22.5",
+ "debug": "^4.1.0",
+ "globals": "^11.1.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@babel/types": {
+ "version": "7.22.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-string-parser": "^7.22.5",
+ "@babel/helper-validator-identifier": "^7.22.5",
+ "to-fast-properties": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/@isaacs/import-jsx": {
+ "version": "4.0.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/core": "^7.5.5",
+ "@babel/plugin-proposal-object-rest-spread": "^7.5.5",
+ "@babel/plugin-transform-destructuring": "^7.5.0",
+ "@babel/plugin-transform-react-jsx": "^7.3.0",
+ "caller-path": "^3.0.1",
+ "find-cache-dir": "^3.2.0",
+ "make-dir": "^3.0.2",
+ "resolve-from": "^3.0.0",
+ "rimraf": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/tap/node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.3",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/set-array": "^1.0.1",
+ "@jridgewell/sourcemap-codec": "^1.4.10",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/tap/node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/tap/node_modules/@jridgewell/set-array": {
+ "version": "1.1.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/tap/node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.4.15",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.18",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "3.1.0",
+ "@jridgewell/sourcemap-codec": "1.4.14"
+ }
+ },
+ "node_modules/tap/node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.4.14",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/@types/prop-types": {
+ "version": "15.7.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/@types/react": {
+ "version": "17.0.62",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/prop-types": "*",
+ "@types/scheduler": "*",
+ "csstype": "^3.0.2"
+ }
+ },
+ "node_modules/tap/node_modules/@types/scheduler": {
+ "version": "0.16.3",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/@types/yoga-layout": {
+ "version": "1.9.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/ansi-escapes": {
+ "version": "4.3.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "type-fest": "^0.21.3"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/tap/node_modules/ansi-escapes/node_modules/type-fest": {
+ "version": "0.21.3",
+ "dev": true,
+ "inBundle": true,
+ "license": "(MIT OR CC0-1.0)",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/tap/node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/ansi-styles": {
+ "version": "3.2.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-convert": "^1.9.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/tap/node_modules/ansicolors": {
+ "version": "0.3.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/astral-regex": {
+ "version": "2.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/auto-bind": {
+ "version": "4.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/tap/node_modules/balanced-match": {
+ "version": "1.0.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/brace-expansion": {
+ "version": "1.1.11",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "node_modules/tap/node_modules/browserslist": {
+ "version": "4.21.9",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/browserslist"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "caniuse-lite": "^1.0.30001503",
+ "electron-to-chromium": "^1.4.431",
+ "node-releases": "^2.0.12",
+ "update-browserslist-db": "^1.0.11"
+ },
+ "bin": {
+ "browserslist": "cli.js"
+ },
+ "engines": {
+ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
+ }
+ },
+ "node_modules/tap/node_modules/caller-callsite": {
+ "version": "4.1.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "callsites": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/caller-path": {
+ "version": "3.0.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "caller-callsite": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/callsites": {
+ "version": "3.1.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/tap/node_modules/caniuse-lite": {
+ "version": "1.0.30001517",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/caniuse-lite"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "inBundle": true,
+ "license": "CC-BY-4.0"
+ },
+ "node_modules/tap/node_modules/cardinal": {
+ "version": "2.1.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansicolors": "~0.3.2",
+ "redeyed": "~2.1.0"
+ },
+ "bin": {
+ "cdl": "bin/cdl.js"
+ }
+ },
+ "node_modules/tap/node_modules/chalk": {
+ "version": "2.4.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/tap/node_modules/ci-info": {
+ "version": "2.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/cli-boxes": {
+ "version": "2.2.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/tap/node_modules/cli-cursor": {
+ "version": "3.1.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "restore-cursor": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/cli-truncate": {
+ "version": "2.1.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "slice-ansi": "^3.0.0",
+ "string-width": "^4.2.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/tap/node_modules/code-excerpt": {
+ "version": "3.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "convert-to-spaces": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/tap/node_modules/color-convert": {
+ "version": "1.9.3",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-name": "1.1.3"
+ }
+ },
+ "node_modules/tap/node_modules/color-name": {
+ "version": "1.1.3",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/commondir": {
+ "version": "1.0.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/concat-map": {
+ "version": "0.0.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/convert-source-map": {
+ "version": "1.9.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/convert-to-spaces": {
+ "version": "1.0.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/tap/node_modules/csstype": {
+ "version": "3.1.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/debug": {
+ "version": "4.3.4",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "2.1.2"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/tap/node_modules/electron-to-chromium": {
+ "version": "1.4.477",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC"
+ },
+ "node_modules/tap/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/escalade": {
+ "version": "3.1.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/tap/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/tap/node_modules/esprima": {
+ "version": "4.0.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "BSD-2-Clause",
+ "bin": {
+ "esparse": "bin/esparse.js",
+ "esvalidate": "bin/esvalidate.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/tap/node_modules/events-to-array": {
+ "version": "1.1.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC"
+ },
+ "node_modules/tap/node_modules/find-cache-dir": {
+ "version": "3.3.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "commondir": "^1.0.1",
+ "make-dir": "^3.0.2",
+ "pkg-dir": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/avajs/find-cache-dir?sponsor=1"
+ }
+ },
+ "node_modules/tap/node_modules/find-up": {
+ "version": "4.1.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "locate-path": "^5.0.0",
+ "path-exists": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/fs.realpath": {
+ "version": "1.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC"
+ },
+ "node_modules/tap/node_modules/gensync": {
+ "version": "1.0.0-beta.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/tap/node_modules/glob": {
+ "version": "7.2.3",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC",
+ "dependencies": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.1.1",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ },
+ "engines": {
+ "node": "*"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/tap/node_modules/globals": {
+ "version": "11.12.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/tap/node_modules/has-flag": {
+ "version": "3.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/tap/node_modules/indent-string": {
+ "version": "4.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/inflight": {
+ "version": "1.0.6",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC",
+ "dependencies": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "node_modules/tap/node_modules/inherits": {
+ "version": "2.0.4",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC"
+ },
+ "node_modules/tap/node_modules/ink": {
+ "version": "3.2.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-escapes": "^4.2.1",
+ "auto-bind": "4.0.0",
+ "chalk": "^4.1.0",
+ "cli-boxes": "^2.2.0",
+ "cli-cursor": "^3.1.0",
+ "cli-truncate": "^2.1.0",
+ "code-excerpt": "^3.0.0",
+ "indent-string": "^4.0.0",
+ "is-ci": "^2.0.0",
+ "lodash": "^4.17.20",
+ "patch-console": "^1.0.0",
+ "react-devtools-core": "^4.19.1",
+ "react-reconciler": "^0.26.2",
+ "scheduler": "^0.20.2",
+ "signal-exit": "^3.0.2",
+ "slice-ansi": "^3.0.0",
+ "stack-utils": "^2.0.2",
+ "string-width": "^4.2.2",
+ "type-fest": "^0.12.0",
+ "widest-line": "^3.1.0",
+ "wrap-ansi": "^6.2.0",
+ "ws": "^7.5.5",
+ "yoga-layout-prebuilt": "^1.9.6"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": ">=16.8.0",
+ "react": ">=16.8.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/tap/node_modules/ink/node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/tap/node_modules/ink/node_modules/chalk": {
+ "version": "4.1.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/tap/node_modules/ink/node_modules/color-convert": {
+ "version": "2.0.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/tap/node_modules/ink/node_modules/color-name": {
+ "version": "1.1.4",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/ink/node_modules/has-flag": {
+ "version": "4.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/ink/node_modules/supports-color": {
+ "version": "7.2.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/is-ci": {
+ "version": "2.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "ci-info": "^2.0.0"
+ },
+ "bin": {
+ "is-ci": "bin.js"
+ }
+ },
+ "node_modules/tap/node_modules/is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/js-tokens": {
+ "version": "4.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/jsesc": {
+ "version": "2.5.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "bin": {
+ "jsesc": "bin/jsesc"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/tap/node_modules/json5": {
+ "version": "2.2.3",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "bin": {
+ "json5": "lib/cli.js"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/tap/node_modules/locate-path": {
+ "version": "5.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "p-locate": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/lodash": {
+ "version": "4.17.21",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/loose-envify": {
+ "version": "1.4.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "js-tokens": "^3.0.0 || ^4.0.0"
+ },
+ "bin": {
+ "loose-envify": "cli.js"
+ }
+ },
+ "node_modules/tap/node_modules/lru-cache": {
+ "version": "5.1.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC",
+ "dependencies": {
+ "yallist": "^3.0.2"
+ }
+ },
+ "node_modules/tap/node_modules/make-dir": {
+ "version": "3.1.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "semver": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/tap/node_modules/mimic-fn": {
+ "version": "2.1.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/tap/node_modules/minimatch": {
+ "version": "3.1.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC",
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/tap/node_modules/minipass": {
+ "version": "3.3.6",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC",
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/minipass/node_modules/yallist": {
+ "version": "4.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC"
+ },
+ "node_modules/tap/node_modules/mkdirp": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
+ "dev": true,
+ "bin": {
+ "mkdirp": "bin/cmd.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/tap/node_modules/ms": {
+ "version": "2.1.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/node-releases": {
+ "version": "2.0.13",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/object-assign": {
+ "version": "4.1.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/tap/node_modules/once": {
+ "version": "1.4.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC",
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/tap/node_modules/onetime": {
+ "version": "5.1.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "mimic-fn": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/tap/node_modules/p-limit": {
+ "version": "2.3.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "p-try": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/tap/node_modules/p-locate": {
+ "version": "4.1.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "p-limit": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/p-try": {
+ "version": "2.2.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/tap/node_modules/patch-console": {
+ "version": "1.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/tap/node_modules/path-exists": {
+ "version": "4.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/path-is-absolute": {
+ "version": "1.0.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/tap/node_modules/picocolors": {
+ "version": "1.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC"
+ },
+ "node_modules/tap/node_modules/pkg-dir": {
+ "version": "4.2.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "find-up": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/punycode": {
+ "version": "2.3.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/tap/node_modules/react": {
+ "version": "17.0.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "loose-envify": "^1.1.0",
+ "object-assign": "^4.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/tap/node_modules/react-devtools-core": {
+ "version": "4.28.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "shell-quote": "^1.6.1",
+ "ws": "^7"
+ }
+ },
+ "node_modules/tap/node_modules/react-reconciler": {
+ "version": "0.26.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "loose-envify": "^1.1.0",
+ "object-assign": "^4.1.1",
+ "scheduler": "^0.20.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "peerDependencies": {
+ "react": "^17.0.2"
+ }
+ },
+ "node_modules/tap/node_modules/redeyed": {
+ "version": "2.1.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "esprima": "~4.0.0"
+ }
+ },
+ "node_modules/tap/node_modules/resolve-from": {
+ "version": "3.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/tap/node_modules/restore-cursor": {
+ "version": "3.1.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "onetime": "^5.1.0",
+ "signal-exit": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/rimraf": {
+ "version": "3.0.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC",
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/tap/node_modules/scheduler": {
+ "version": "0.20.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "loose-envify": "^1.1.0",
+ "object-assign": "^4.1.1"
+ }
+ },
+ "node_modules/tap/node_modules/semver": {
+ "version": "6.3.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/tap/node_modules/shell-quote": {
+ "version": "1.8.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/tap/node_modules/signal-exit": {
+ "version": "3.0.7",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC"
+ },
+ "node_modules/tap/node_modules/slice-ansi": {
+ "version": "3.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "astral-regex": "^2.0.0",
+ "is-fullwidth-code-point": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/slice-ansi/node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/tap/node_modules/slice-ansi/node_modules/color-convert": {
+ "version": "2.0.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/tap/node_modules/slice-ansi/node_modules/color-name": {
+ "version": "1.1.4",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/stack-utils": {
+ "version": "2.0.6",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "escape-string-regexp": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/tap/node_modules/stack-utils/node_modules/escape-string-regexp": {
+ "version": "2.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/string-width": {
+ "version": "4.2.3",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/supports-color": {
+ "version": "5.5.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/tap/node_modules/tap-parser": {
+ "version": "11.0.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "events-to-array": "^1.0.1",
+ "minipass": "^3.1.6",
+ "tap-yaml": "^1.0.0"
+ },
+ "bin": {
+ "tap-parser": "bin/cmd.js"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/tap/node_modules/tap-yaml": {
+ "version": "1.0.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC",
+ "dependencies": {
+ "yaml": "^1.10.2"
+ }
+ },
+ "node_modules/tap/node_modules/to-fast-properties": {
+ "version": "2.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/tap/node_modules/treport": {
+ "version": "3.0.4",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC",
+ "dependencies": {
+ "@isaacs/import-jsx": "^4.0.1",
+ "cardinal": "^2.1.1",
+ "chalk": "^3.0.0",
+ "ink": "^3.2.0",
+ "ms": "^2.1.2",
+ "tap-parser": "^11.0.0",
+ "tap-yaml": "^1.0.0",
+ "unicode-length": "^2.0.2"
+ },
+ "peerDependencies": {
+ "react": "^17.0.2"
+ }
+ },
+ "node_modules/tap/node_modules/treport/node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/tap/node_modules/treport/node_modules/chalk": {
+ "version": "3.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/treport/node_modules/color-convert": {
+ "version": "2.0.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/tap/node_modules/treport/node_modules/color-name": {
+ "version": "1.1.4",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/treport/node_modules/has-flag": {
+ "version": "4.0.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/treport/node_modules/supports-color": {
+ "version": "7.2.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/type-fest": {
+ "version": "0.12.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "(MIT OR CC0-1.0)",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/tap/node_modules/unicode-length": {
+ "version": "2.1.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "punycode": "^2.0.0"
+ }
+ },
+ "node_modules/tap/node_modules/update-browserslist-db": {
+ "version": "1.0.11",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/browserslist"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "escalade": "^3.1.1",
+ "picocolors": "^1.0.0"
+ },
+ "bin": {
+ "update-browserslist-db": "cli.js"
+ },
+ "peerDependencies": {
+ "browserslist": ">= 4.21.0"
+ }
+ },
+ "node_modules/tap/node_modules/widest-line": {
+ "version": "3.1.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "string-width": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/wrap-ansi": {
+ "version": "6.2.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tap/node_modules/wrap-ansi/node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/tap/node_modules/wrap-ansi/node_modules/color-convert": {
+ "version": "2.0.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/tap/node_modules/wrap-ansi/node_modules/color-name": {
+ "version": "1.1.4",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/tap/node_modules/wrappy": {
+ "version": "1.0.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC"
+ },
+ "node_modules/tap/node_modules/ws": {
+ "version": "7.5.9",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8.3.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": "^5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/tap/node_modules/yallist": {
+ "version": "3.1.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC"
+ },
+ "node_modules/tap/node_modules/yaml": {
+ "version": "1.10.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "ISC",
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/tap/node_modules/yoga-layout-prebuilt": {
+ "version": "1.10.0",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/yoga-layout": "1.9.2"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tapable": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
+ "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/tar": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz",
+ "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==",
+ "dev": true,
+ "dependencies": {
+ "chownr": "^2.0.0",
+ "fs-minipass": "^2.0.0",
+ "minipass": "^5.0.0",
+ "minizlib": "^2.1.1",
+ "mkdirp": "^1.0.3",
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/tar-fs": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
+ "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
+ "dependencies": {
+ "chownr": "^1.1.1",
+ "mkdirp-classic": "^0.5.2",
+ "pump": "^3.0.0",
+ "tar-stream": "^2.1.4"
+ }
+ },
+ "node_modules/tar-fs/node_modules/chownr": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
+ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
+ },
+ "node_modules/tar-stream": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
+ "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
+ "dependencies": {
+ "bl": "^4.0.3",
+ "end-of-stream": "^1.4.1",
+ "fs-constants": "^1.0.0",
+ "inherits": "^2.0.3",
+ "readable-stream": "^3.1.1"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/tar/node_modules/fs-minipass": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
+ "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==",
+ "dev": true,
+ "dependencies": {
+ "minipass": "^3.0.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/tar/node_modules/fs-minipass/node_modules/minipass": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
+ "dev": true,
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tar/node_modules/mkdirp": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
+ "dev": true,
+ "bin": {
+ "mkdirp": "bin/cmd.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/tar/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ },
+ "node_modules/tarn": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/tarn/-/tarn-3.0.2.tgz",
+ "integrity": "sha512-51LAVKUSZSVfI05vjPESNc5vwqqZpbXCsU+/+wxlOrUjk2SnFTt97v9ZgQrD4YmxYW1Px6w2KjaDitCfkvgxMQ==",
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/tcompare": {
+ "version": "5.0.7",
+ "resolved": "https://registry.npmjs.org/tcompare/-/tcompare-5.0.7.tgz",
+ "integrity": "sha512-d9iddt6YYGgyxJw5bjsN7UJUO1kGOtjSlNy/4PoGYAjQS5pAT/hzIoLf1bZCw+uUxRmZJh7Yy1aA7xKVRT9B4w==",
+ "dev": true,
+ "dependencies": {
+ "diff": "^4.0.2"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/terser": {
+ "version": "5.19.2",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz",
+ "integrity": "sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==",
+ "dependencies": {
+ "@jridgewell/source-map": "^0.3.3",
+ "acorn": "^8.8.2",
+ "commander": "^2.20.0",
+ "source-map-support": "~0.5.20"
+ },
+ "bin": {
+ "terser": "bin/terser"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/terser-webpack-plugin": {
+ "version": "5.3.9",
+ "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz",
+ "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==",
+ "dependencies": {
+ "@jridgewell/trace-mapping": "^0.3.17",
+ "jest-worker": "^27.4.5",
+ "schema-utils": "^3.1.1",
+ "serialize-javascript": "^6.0.1",
+ "terser": "^5.16.8"
+ },
+ "engines": {
+ "node": ">= 10.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "webpack": "^5.1.0"
+ },
+ "peerDependenciesMeta": {
+ "@swc/core": {
+ "optional": true
+ },
+ "esbuild": {
+ "optional": true
+ },
+ "uglify-js": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/terser-webpack-plugin/node_modules/ajv": {
+ "version": "6.12.6",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/terser-webpack-plugin/node_modules/ajv-keywords": {
+ "version": "3.5.2",
+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
+ "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
+ "peerDependencies": {
+ "ajv": "^6.9.1"
+ }
+ },
+ "node_modules/terser-webpack-plugin/node_modules/jest-worker": {
+ "version": "27.5.1",
+ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz",
+ "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==",
+ "dependencies": {
+ "@types/node": "*",
+ "merge-stream": "^2.0.0",
+ "supports-color": "^8.0.0"
+ },
+ "engines": {
+ "node": ">= 10.13.0"
+ }
+ },
+ "node_modules/terser-webpack-plugin/node_modules/json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+ },
+ "node_modules/terser-webpack-plugin/node_modules/schema-utils": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz",
+ "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==",
+ "dependencies": {
+ "@types/json-schema": "^7.0.8",
+ "ajv": "^6.12.5",
+ "ajv-keywords": "^3.5.2"
+ },
+ "engines": {
+ "node": ">= 10.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ }
+ },
+ "node_modules/terser/node_modules/commander": {
+ "version": "2.20.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
+ },
+ "node_modules/test-exclude": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz",
+ "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==",
+ "dev": true,
+ "dependencies": {
+ "@istanbuljs/schema": "^0.1.2",
+ "glob": "^7.1.4",
+ "minimatch": "^3.0.4"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/testing": {
+ "resolved": "packages/testing",
+ "link": true
+ },
+ "node_modules/text-hex": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
+ "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg=="
+ },
+ "node_modules/text-table": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
+ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
+ "dev": true
+ },
+ "node_modules/thenify": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz",
+ "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==",
+ "dependencies": {
+ "any-promise": "^1.0.0"
+ }
+ },
+ "node_modules/thenify-all": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz",
+ "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==",
+ "dependencies": {
+ "thenify": ">= 3.1.0 < 4"
+ },
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
+ "node_modules/thread-stream": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.4.0.tgz",
+ "integrity": "sha512-xZYtOtmnA63zj04Q+F9bdEay5r47bvpo1CaNqsKi7TpoJHcotUez8Fkfo2RJWpW91lnnaApdpRbVwCWsy+ifcw==",
+ "dependencies": {
+ "real-require": "^0.2.0"
+ }
+ },
+ "node_modules/through": {
+ "version": "2.3.8",
+ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
+ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="
+ },
+ "node_modules/through2": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
+ "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==",
+ "dependencies": {
+ "readable-stream": "~2.3.6",
+ "xtend": "~4.0.1"
+ }
+ },
+ "node_modules/through2/node_modules/isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
+ },
+ "node_modules/through2/node_modules/readable-stream": {
+ "version": "2.3.8",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
+ "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "node_modules/through2/node_modules/safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
+ },
+ "node_modules/through2/node_modules/string_decoder": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "dependencies": {
+ "safe-buffer": "~5.1.0"
+ }
+ },
+ "node_modules/thunky": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz",
+ "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA=="
+ },
+ "node_modules/tildify": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/tildify/-/tildify-2.0.0.tgz",
+ "integrity": "sha512-Cc+OraorugtXNfs50hU9KS369rFXCfgGLpfCfvlc+Ud5u6VWmUQsOAa9HbTvheQdYnrdJqqv1e5oIqXppMYnSw==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tiny-invariant": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz",
+ "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw=="
+ },
+ "node_modules/tiny-warning": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
+ "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
+ },
+ "node_modules/title-case": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/title-case/-/title-case-2.1.1.tgz",
+ "integrity": "sha512-EkJoZ2O3zdCz3zJsYCsxyq2OC5hrxR9mfdd5I+w8h/tmFfeOxJ+vvkxsKxdmN0WtS9zLdHEgfgVOiMVgv+Po4Q==",
+ "dependencies": {
+ "no-case": "^2.2.0",
+ "upper-case": "^1.0.3"
+ }
+ },
+ "node_modules/tmp": {
+ "version": "0.0.33",
+ "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
+ "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
+ "dependencies": {
+ "os-tmpdir": "~1.0.2"
+ },
+ "engines": {
+ "node": ">=0.6.0"
+ }
+ },
+ "node_modules/tmpl": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
+ "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw=="
+ },
+ "node_modules/to-fast-properties": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
+ "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/to-object-path": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz",
+ "integrity": "sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==",
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/to-object-path/node_modules/kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/to-readable-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz",
+ "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/to-regex": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz",
+ "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==",
+ "dependencies": {
+ "define-property": "^2.0.2",
+ "extend-shallow": "^3.0.2",
+ "regex-not": "^1.0.2",
+ "safe-regex": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "dependencies": {
+ "is-number": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=8.0"
+ }
+ },
+ "node_modules/toad-cache": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/toad-cache/-/toad-cache-3.2.0.tgz",
+ "integrity": "sha512-Hj5zSqBS6OHbZoQk9IU8VqIr+0JUpwzunnwSlFJhG8aJSInYUMEuzItl3kJsGteTPd1qtflafdRHlRtUazYeqg==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/toidentifier": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
+ "node_modules/toposort": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz",
+ "integrity": "sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg=="
+ },
+ "node_modules/tough-cookie": {
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz",
+ "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==",
+ "dev": true,
+ "dependencies": {
+ "psl": "^1.1.33",
+ "punycode": "^2.1.1",
+ "universalify": "^0.2.0",
+ "url-parse": "^1.5.3"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/tr46": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz",
+ "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==",
+ "dev": true,
+ "dependencies": {
+ "punycode": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tree-kill": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz",
+ "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
+ "dev": true,
+ "bin": {
+ "tree-kill": "cli.js"
+ }
+ },
+ "node_modules/trim-lines": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz",
+ "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/triple-beam": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz",
+ "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==",
+ "engines": {
+ "node": ">= 14.0.0"
+ }
+ },
+ "node_modules/trivial-deferred": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/trivial-deferred/-/trivial-deferred-1.1.2.tgz",
+ "integrity": "sha512-vDPiDBC3hyP6O4JrJYMImW3nl3c03Tsj9fEXc7Qc/XKa1O7gf5ZtFfIR/E0dun9SnDHdwjna1Z2rSzYgqpxh/g==",
+ "dev": true,
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/trough": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/trough/-/trough-2.1.0.tgz",
+ "integrity": "sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/ts-invariant": {
+ "version": "0.10.3",
+ "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz",
+ "integrity": "sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==",
+ "peer": true,
+ "dependencies": {
+ "tslib": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ts-node": {
+ "version": "10.9.1",
+ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz",
+ "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==",
+ "dev": true,
+ "dependencies": {
+ "@cspotcode/source-map-support": "^0.8.0",
+ "@tsconfig/node10": "^1.0.7",
+ "@tsconfig/node12": "^1.0.7",
+ "@tsconfig/node14": "^1.0.0",
+ "@tsconfig/node16": "^1.0.2",
+ "acorn": "^8.4.1",
+ "acorn-walk": "^8.1.1",
+ "arg": "^4.1.0",
+ "create-require": "^1.1.0",
+ "diff": "^4.0.1",
+ "make-error": "^1.1.1",
+ "v8-compile-cache-lib": "^3.0.1",
+ "yn": "3.1.1"
+ },
+ "bin": {
+ "ts-node": "dist/bin.js",
+ "ts-node-cwd": "dist/bin-cwd.js",
+ "ts-node-esm": "dist/bin-esm.js",
+ "ts-node-script": "dist/bin-script.js",
+ "ts-node-transpile-only": "dist/bin-transpile.js",
+ "ts-script": "dist/bin-script-deprecated.js"
+ },
+ "peerDependencies": {
+ "@swc/core": ">=1.2.50",
+ "@swc/wasm": ">=1.2.50",
+ "@types/node": "*",
+ "typescript": ">=2.7"
+ },
+ "peerDependenciesMeta": {
+ "@swc/core": {
+ "optional": true
+ },
+ "@swc/wasm": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/ts-node/node_modules/acorn-walk": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
+ "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/tsconfig-paths": {
+ "version": "3.14.2",
+ "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz",
+ "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==",
+ "dev": true,
+ "dependencies": {
+ "@types/json5": "^0.0.29",
+ "json5": "^1.0.2",
+ "minimist": "^1.2.6",
+ "strip-bom": "^3.0.0"
+ }
+ },
+ "node_modules/tsconfig-paths/node_modules/json5": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
+ "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
+ "dev": true,
+ "dependencies": {
+ "minimist": "^1.2.0"
+ },
+ "bin": {
+ "json5": "lib/cli.js"
+ }
+ },
+ "node_modules/tsconfig-paths/node_modules/strip-bom": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
+ "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/tslib": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
+ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
+ },
+ "node_modules/tsscmp": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz",
+ "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==",
+ "engines": {
+ "node": ">=0.6.x"
+ }
+ },
+ "node_modules/tsutils": {
+ "version": "3.21.0",
+ "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz",
+ "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==",
+ "dev": true,
+ "dependencies": {
+ "tslib": "^1.8.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ },
+ "peerDependencies": {
+ "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta"
+ }
+ },
+ "node_modules/tsutils/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "dev": true
+ },
+ "node_modules/tuf-js": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.7.tgz",
+ "integrity": "sha512-i3P9Kgw3ytjELUfpuKVDNBJvk4u5bXL6gskv572mcevPbSKCV3zt3djhmlEQ65yERjIbOSncy7U4cQJaB1CBCg==",
+ "dev": true,
+ "dependencies": {
+ "@tufjs/models": "1.0.4",
+ "debug": "^4.3.4",
+ "make-fetch-happen": "^11.1.1"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/tunnel": {
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
+ "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
+ "engines": {
+ "node": ">=0.6.11 <=0.7.0 || >=0.7.3"
+ }
+ },
+ "node_modules/tunnel-agent": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
+ "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==",
+ "dependencies": {
+ "safe-buffer": "^5.0.1"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/type-check": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
+ "dev": true,
+ "dependencies": {
+ "prelude-ls": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/type-detect": {
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
+ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/type-fest": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz",
+ "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/type-is": {
+ "version": "1.6.18",
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
+ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
+ "dependencies": {
+ "media-typer": "0.3.0",
+ "mime-types": "~2.1.24"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/typed-array-buffer": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz",
+ "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "get-intrinsic": "^1.2.1",
+ "is-typed-array": "^1.1.10"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/typed-array-byte-length": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz",
+ "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "for-each": "^0.3.3",
+ "has-proto": "^1.0.1",
+ "is-typed-array": "^1.1.10"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/typed-array-byte-offset": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz",
+ "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==",
+ "dev": true,
+ "dependencies": {
+ "available-typed-arrays": "^1.0.5",
+ "call-bind": "^1.0.2",
+ "for-each": "^0.3.3",
+ "has-proto": "^1.0.1",
+ "is-typed-array": "^1.1.10"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/typed-array-length": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz",
+ "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "for-each": "^0.3.3",
+ "is-typed-array": "^1.1.9"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/typed-assert": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/typed-assert/-/typed-assert-1.0.9.tgz",
+ "integrity": "sha512-KNNZtayBCtmnNmbo5mG47p1XsCyrx6iVqomjcZnec/1Y5GGARaxPs6r49RnSPeUP3YjNYiU9sQHAtY4BBvnZwg==",
+ "dev": true
+ },
+ "node_modules/typedarray-to-buffer": {
+ "version": "3.1.5",
+ "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
+ "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==",
+ "dependencies": {
+ "is-typedarray": "^1.0.0"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "4.9.5",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
+ "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=4.2.0"
+ }
+ },
+ "node_modules/uc.micro": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
+ "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA=="
+ },
+ "node_modules/uglify-js": {
+ "version": "3.17.4",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
+ "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
+ "optional": true,
+ "bin": {
+ "uglifyjs": "bin/uglifyjs"
+ },
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/uikit": {
+ "version": "3.16.26",
+ "resolved": "https://registry.npmjs.org/uikit/-/uikit-3.16.26.tgz",
+ "integrity": "sha512-5NCaHqgYIzTVDMxix9tUb4pJn478GdIxEodWuWy/eMf3mi7EWZPyVQxPEos71H0hrr7xC6i0TK6tjOSfF7gkOA=="
+ },
+ "node_modules/umzug": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/umzug/-/umzug-3.2.1.tgz",
+ "integrity": "sha512-XyWQowvP9CKZycKc/Zg9SYWrAWX/gJCE799AUTFqk8yC3tp44K1xWr3LoFF0MNEjClKOo1suCr5ASnoy+KltdA==",
+ "dependencies": {
+ "@rushstack/ts-command-line": "^4.12.2",
+ "emittery": "^0.12.1",
+ "fs-jetpack": "^4.3.1",
+ "glob": "^8.0.3",
+ "pony-cause": "^2.1.2",
+ "type-fest": "^2.18.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/umzug/node_modules/brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/umzug/node_modules/emittery": {
+ "version": "0.12.1",
+ "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.12.1.tgz",
+ "integrity": "sha512-pYyW59MIZo0HxPFf+Vb3+gacUu0gxVS3TZwB2ClwkEZywgF9f9OJDoVmNLojTn0vKX3tO9LC+pdQEcLP4Oz/bQ==",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/emittery?sponsor=1"
+ }
+ },
+ "node_modules/umzug/node_modules/glob": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
+ "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==",
+ "dependencies": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^5.0.1",
+ "once": "^1.3.0"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/umzug/node_modules/minimatch": {
+ "version": "5.1.6",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
+ "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
+ "dependencies": {
+ "brace-expansion": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/umzug/node_modules/type-fest": {
+ "version": "2.19.0",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
+ "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==",
+ "engines": {
+ "node": ">=12.20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/unbox-primitive": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz",
+ "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "has-bigints": "^1.0.2",
+ "has-symbols": "^1.0.3",
+ "which-boxed-primitive": "^1.0.2"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/unc-path-regex": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
+ "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/underscore": {
+ "version": "1.13.6",
+ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz",
+ "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==",
+ "dev": true
+ },
+ "node_modules/unicode-canonical-property-names-ecmascript": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz",
+ "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/unicode-length": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/unicode-length/-/unicode-length-2.1.0.tgz",
+ "integrity": "sha512-4bV582zTV9Q02RXBxSUMiuN/KHo5w4aTojuKTNT96DIKps/SIawFp7cS5Mu25VuY1AioGXrmYyzKZUzh8OqoUw==",
+ "dev": true,
+ "dependencies": {
+ "punycode": "^2.0.0"
+ }
+ },
+ "node_modules/unicode-match-property-ecmascript": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz",
+ "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==",
+ "dev": true,
+ "dependencies": {
+ "unicode-canonical-property-names-ecmascript": "^2.0.0",
+ "unicode-property-aliases-ecmascript": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/unicode-match-property-value-ecmascript": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz",
+ "integrity": "sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/unicode-property-aliases-ecmascript": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz",
+ "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/unified": {
+ "version": "10.1.2",
+ "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz",
+ "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "bail": "^2.0.0",
+ "extend": "^3.0.0",
+ "is-buffer": "^2.0.0",
+ "is-plain-obj": "^4.0.0",
+ "trough": "^2.0.0",
+ "vfile": "^5.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unified/node_modules/is-buffer": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz",
+ "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/unified/node_modules/is-plain-obj": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz",
+ "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/union-value": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
+ "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
+ "dependencies": {
+ "arr-union": "^3.1.0",
+ "get-value": "^2.0.6",
+ "is-extendable": "^0.1.1",
+ "set-value": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/union-value/node_modules/is-extendable": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+ "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/unique-filename": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz",
+ "integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==",
+ "dev": true,
+ "dependencies": {
+ "unique-slug": "^4.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/unique-slug": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz",
+ "integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==",
+ "dev": true,
+ "dependencies": {
+ "imurmurhash": "^0.1.4"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/unique-string": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz",
+ "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==",
+ "dependencies": {
+ "crypto-random-string": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/unist-util-generated": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-2.0.1.tgz",
+ "integrity": "sha512-qF72kLmPxAw0oN2fwpWIqbXAVyEqUzDHMsbtPvOudIlUzXYFIeQIuxXQCRCFh22B7cixvU0MG7m3MW8FTq/S+A==",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unist-util-is": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz",
+ "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==",
+ "dependencies": {
+ "@types/unist": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unist-util-position": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.4.tgz",
+ "integrity": "sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==",
+ "dependencies": {
+ "@types/unist": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unist-util-stringify-position": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz",
+ "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==",
+ "dependencies": {
+ "@types/unist": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unist-util-visit": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz",
+ "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "unist-util-is": "^5.0.0",
+ "unist-util-visit-parents": "^5.1.1"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unist-util-visit-parents": {
+ "version": "5.1.3",
+ "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz",
+ "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "unist-util-is": "^5.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/universalify": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz",
+ "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==",
+ "dev": true,
+ "engines": {
+ "node": ">= 4.0.0"
+ }
+ },
+ "node_modules/unload": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/unload/-/unload-2.2.0.tgz",
+ "integrity": "sha512-B60uB5TNBLtN6/LsgAf3udH9saB5p7gqJwcFfbOEZ8BcBHnGwCf6G/TGiEqkRAxX7zAFIUtzdrXQSdL3Q/wqNA==",
+ "dependencies": {
+ "@babel/runtime": "^7.6.2",
+ "detect-node": "^2.0.4"
+ }
+ },
+ "node_modules/unpipe": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/unset-value": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
+ "integrity": "sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==",
+ "dependencies": {
+ "has-value": "^0.3.1",
+ "isobject": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/unset-value/node_modules/has-value": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz",
+ "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==",
+ "dependencies": {
+ "get-value": "^2.0.3",
+ "has-values": "^0.1.4",
+ "isobject": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/unset-value/node_modules/has-value/node_modules/isobject": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
+ "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==",
+ "dependencies": {
+ "isarray": "1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/unset-value/node_modules/has-values": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz",
+ "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/unset-value/node_modules/isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
+ },
+ "node_modules/untildify": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz",
+ "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/update-browserslist-db": {
+ "version": "1.0.13",
+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz",
+ "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/browserslist"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "dependencies": {
+ "escalade": "^3.1.1",
+ "picocolors": "^1.0.0"
+ },
+ "bin": {
+ "update-browserslist-db": "cli.js"
+ },
+ "peerDependencies": {
+ "browserslist": ">= 4.21.0"
+ }
+ },
+ "node_modules/update-notifier": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz",
+ "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==",
+ "dev": true,
+ "dependencies": {
+ "boxen": "^5.0.0",
+ "chalk": "^4.1.0",
+ "configstore": "^5.0.1",
+ "has-yarn": "^2.1.0",
+ "import-lazy": "^2.1.0",
+ "is-ci": "^2.0.0",
+ "is-installed-globally": "^0.4.0",
+ "is-npm": "^5.0.0",
+ "is-yarn-global": "^0.3.0",
+ "latest-version": "^5.1.0",
+ "pupa": "^2.1.1",
+ "semver": "^7.3.4",
+ "semver-diff": "^3.1.1",
+ "xdg-basedir": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/yeoman/update-notifier?sponsor=1"
+ }
+ },
+ "node_modules/upper-case": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz",
+ "integrity": "sha512-WRbjgmYzgXkCV7zNVpy5YgrHgbBv126rMALQQMrmzOVC4GM2waQ9x7xtm8VU+1yF2kWyPzI9zbZ48n4vSxwfSA=="
+ },
+ "node_modules/upper-case-first": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-1.1.2.tgz",
+ "integrity": "sha512-wINKYvI3Db8dtjikdAqoBbZoP6Q+PZUyfMR7pmwHzjC2quzSkUq5DmPrTtPEqHaz8AGtmsB4TqwapMTM1QAQOQ==",
+ "dependencies": {
+ "upper-case": "^1.1.1"
+ }
+ },
+ "node_modules/uri-js": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
+ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+ "dependencies": {
+ "punycode": "^2.1.0"
+ }
+ },
+ "node_modules/urix": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
+ "integrity": "sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==",
+ "deprecated": "Please see https://github.com/lydell/urix#deprecated"
+ },
+ "node_modules/url-join": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz",
+ "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA=="
+ },
+ "node_modules/url-parse": {
+ "version": "1.5.10",
+ "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
+ "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",
+ "dev": true,
+ "dependencies": {
+ "querystringify": "^2.1.1",
+ "requires-port": "^1.0.0"
+ }
+ },
+ "node_modules/url-parse-lax": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz",
+ "integrity": "sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==",
+ "dev": true,
+ "dependencies": {
+ "prepend-http": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/use": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
+ "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/use-callback-ref": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.0.tgz",
+ "integrity": "sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w==",
+ "dependencies": {
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/use-isomorphic-layout-effect": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz",
+ "integrity": "sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==",
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/use-sidecar": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.2.tgz",
+ "integrity": "sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==",
+ "dependencies": {
+ "detect-node-es": "^1.1.0",
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/use-sync-external-store": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz",
+ "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==",
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ }
+ },
+ "node_modules/user-home": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz",
+ "integrity": "sha512-aggiKfEEubv3UwRNqTzLInZpAOmKzwdHqEBmW/hBA/mt99eg+b4VrX6i+IRLxU8+WJYfa33rGwRseg4eElUgsQ==",
+ "bin": {
+ "user-home": "cli.js"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
+ },
+ "node_modules/utila": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz",
+ "integrity": "sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA=="
+ },
+ "node_modules/utils-merge": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
+ "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
+ "engines": {
+ "node": ">= 0.4.0"
+ }
+ },
+ "node_modules/uuid": {
+ "version": "8.3.2",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
+ "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
+ "bin": {
+ "uuid": "dist/bin/uuid"
+ }
+ },
+ "node_modules/uvu": {
+ "version": "0.5.6",
+ "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz",
+ "integrity": "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==",
+ "dependencies": {
+ "dequal": "^2.0.0",
+ "diff": "^5.0.0",
+ "kleur": "^4.0.3",
+ "sade": "^1.7.3"
+ },
+ "bin": {
+ "uvu": "bin.js"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/uvu/node_modules/diff": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz",
+ "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==",
+ "engines": {
+ "node": ">=0.3.1"
+ }
+ },
+ "node_modules/uvu/node_modules/kleur": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
+ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/v8-compile-cache-lib": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
+ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
+ "dev": true
+ },
+ "node_modules/v8-to-istanbul": {
+ "version": "9.1.0",
+ "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz",
+ "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==",
+ "dev": true,
+ "dependencies": {
+ "@jridgewell/trace-mapping": "^0.3.12",
+ "@types/istanbul-lib-coverage": "^2.0.1",
+ "convert-source-map": "^1.6.0"
+ },
+ "engines": {
+ "node": ">=10.12.0"
+ }
+ },
+ "node_modules/v8flags": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz",
+ "integrity": "sha512-SKfhk/LlaXzvtowJabLZwD4K6SGRYeoxA7KJeISlUMAB/NT4CBkZjMq3WceX2Ckm4llwqYVo8TICgsDYCBU2tA==",
+ "dependencies": {
+ "user-home": "^1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.10.0"
+ }
+ },
+ "node_modules/validate-npm-package-license": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
+ "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
+ "dev": true,
+ "dependencies": {
+ "spdx-correct": "^3.0.0",
+ "spdx-expression-parse": "^3.0.0"
+ }
+ },
+ "node_modules/validate-npm-package-name": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz",
+ "integrity": "sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==",
+ "dev": true,
+ "dependencies": {
+ "builtins": "^5.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/value-equal": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
+ "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
+ },
+ "node_modules/value-or-promise": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.11.tgz",
+ "integrity": "sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vary": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/vfile": {
+ "version": "5.3.7",
+ "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz",
+ "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "is-buffer": "^2.0.0",
+ "unist-util-stringify-position": "^3.0.0",
+ "vfile-message": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/vfile-location": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.1.0.tgz",
+ "integrity": "sha512-YF23YMyASIIJXpktBa4vIGLJ5Gs88UB/XePgqPmTa7cDA+JeO3yclbpheQYCHjVHBn/yePzrXuygIL+xbvRYHw==",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "vfile": "^5.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/vfile-message": {
+ "version": "3.1.4",
+ "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz",
+ "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "unist-util-stringify-position": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/vfile/node_modules/is-buffer": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz",
+ "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/vite": {
+ "version": "4.4.7",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.7.tgz",
+ "integrity": "sha512-6pYf9QJ1mHylfVh39HpuSfMPojPSKVxZvnclX1K1FyZ1PXDOcLBibdq5t1qxJSnL63ca8Wf4zts6mD8u8oc9Fw==",
+ "dependencies": {
+ "esbuild": "^0.18.10",
+ "postcss": "^8.4.26",
+ "rollup": "^3.25.2"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^14.18.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.2"
+ },
+ "peerDependencies": {
+ "@types/node": ">= 14",
+ "less": "*",
+ "lightningcss": "^1.21.0",
+ "sass": "*",
+ "stylus": "*",
+ "sugarss": "*",
+ "terser": "^5.4.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/w3c-hr-time": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz",
+ "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==",
+ "deprecated": "Use your platform's native performance.now() and performance.timeOrigin.",
+ "dev": true,
+ "dependencies": {
+ "browser-process-hrtime": "^1.0.0"
+ }
+ },
+ "node_modules/w3c-keyname": {
+ "version": "2.2.8",
+ "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz",
+ "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ=="
+ },
+ "node_modules/w3c-xmlserializer": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz",
+ "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==",
+ "dev": true,
+ "dependencies": {
+ "xml-name-validator": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/wait-on": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-6.0.1.tgz",
+ "integrity": "sha512-zht+KASY3usTY5u2LgaNqn/Cd8MukxLGjdcZxT2ns5QzDmTFc4XoWBgC+C/na+sMRZTuVygQoMYwdcVjHnYIVw==",
+ "dev": true,
+ "dependencies": {
+ "axios": "^0.25.0",
+ "joi": "^17.6.0",
+ "lodash": "^4.17.21",
+ "minimist": "^1.2.5",
+ "rxjs": "^7.5.4"
+ },
+ "bin": {
+ "wait-on": "bin/wait-on"
+ },
+ "engines": {
+ "node": ">=10.0.0"
+ }
+ },
+ "node_modules/walker": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz",
+ "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==",
+ "dependencies": {
+ "makeerror": "1.0.12"
+ }
+ },
+ "node_modules/watchpack": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
+ "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==",
+ "dependencies": {
+ "glob-to-regexp": "^0.4.1",
+ "graceful-fs": "^4.1.2"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/wbuf": {
+ "version": "1.7.3",
+ "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz",
+ "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==",
+ "dependencies": {
+ "minimalistic-assert": "^1.0.0"
+ }
+ },
+ "node_modules/wcwidth": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz",
+ "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==",
+ "dependencies": {
+ "defaults": "^1.0.3"
+ }
+ },
+ "node_modules/web-namespaces": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz",
+ "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/web-streams-polyfill": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
+ "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/webidl-conversions": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
+ "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==",
+ "dev": true,
+ "engines": {
+ "node": ">=10.4"
+ }
+ },
+ "node_modules/webpack": {
+ "version": "5.88.2",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz",
+ "integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==",
+ "dependencies": {
+ "@types/eslint-scope": "^3.7.3",
+ "@types/estree": "^1.0.0",
+ "@webassemblyjs/ast": "^1.11.5",
+ "@webassemblyjs/wasm-edit": "^1.11.5",
+ "@webassemblyjs/wasm-parser": "^1.11.5",
+ "acorn": "^8.7.1",
+ "acorn-import-assertions": "^1.9.0",
+ "browserslist": "^4.14.5",
+ "chrome-trace-event": "^1.0.2",
+ "enhanced-resolve": "^5.15.0",
+ "es-module-lexer": "^1.2.1",
+ "eslint-scope": "5.1.1",
+ "events": "^3.2.0",
+ "glob-to-regexp": "^0.4.1",
+ "graceful-fs": "^4.2.9",
+ "json-parse-even-better-errors": "^2.3.1",
+ "loader-runner": "^4.2.0",
+ "mime-types": "^2.1.27",
+ "neo-async": "^2.6.2",
+ "schema-utils": "^3.2.0",
+ "tapable": "^2.1.1",
+ "terser-webpack-plugin": "^5.3.7",
+ "watchpack": "^2.4.0",
+ "webpack-sources": "^3.2.3"
+ },
+ "bin": {
+ "webpack": "bin/webpack.js"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependenciesMeta": {
+ "webpack-cli": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/webpack-cli": {
+ "version": "5.1.4",
+ "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz",
+ "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==",
+ "dependencies": {
+ "@discoveryjs/json-ext": "^0.5.0",
+ "@webpack-cli/configtest": "^2.1.1",
+ "@webpack-cli/info": "^2.0.2",
+ "@webpack-cli/serve": "^2.0.5",
+ "colorette": "^2.0.14",
+ "commander": "^10.0.1",
+ "cross-spawn": "^7.0.3",
+ "envinfo": "^7.7.3",
+ "fastest-levenshtein": "^1.0.12",
+ "import-local": "^3.0.2",
+ "interpret": "^3.1.1",
+ "rechoir": "^0.8.0",
+ "webpack-merge": "^5.7.3"
+ },
+ "bin": {
+ "webpack-cli": "bin/cli.js"
+ },
+ "engines": {
+ "node": ">=14.15.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "webpack": "5.x.x"
+ },
+ "peerDependenciesMeta": {
+ "@webpack-cli/generators": {
+ "optional": true
+ },
+ "webpack-bundle-analyzer": {
+ "optional": true
+ },
+ "webpack-dev-server": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/webpack-cli/node_modules/commander": {
+ "version": "10.0.1",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz",
+ "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==",
+ "engines": {
+ "node": ">=14"
+ }
+ },
+ "node_modules/webpack-cli/node_modules/interpret": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz",
+ "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==",
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/webpack-dev-middleware": {
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-6.1.1.tgz",
+ "integrity": "sha512-y51HrHaFeeWir0YO4f0g+9GwZawuigzcAdRNon6jErXy/SqV/+O6eaVAzDqE6t3e3NpGeR5CS+cCDaTC+V3yEQ==",
+ "dev": true,
+ "dependencies": {
+ "colorette": "^2.0.10",
+ "memfs": "^3.4.12",
+ "mime-types": "^2.1.31",
+ "range-parser": "^1.2.1",
+ "schema-utils": "^4.0.0"
+ },
+ "engines": {
+ "node": ">= 14.15.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "webpack": "^5.0.0"
+ },
+ "peerDependenciesMeta": {
+ "webpack": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/webpack-dev-server": {
+ "version": "4.15.1",
+ "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.1.tgz",
+ "integrity": "sha512-5hbAst3h3C3L8w6W4P96L5vaV0PxSmJhxZvWKYIdgxOQm8pNZ5dEOmmSLBVpP85ReeyRt6AS1QJNyo/oFFPeVA==",
+ "dependencies": {
+ "@types/bonjour": "^3.5.9",
+ "@types/connect-history-api-fallback": "^1.3.5",
+ "@types/express": "^4.17.13",
+ "@types/serve-index": "^1.9.1",
+ "@types/serve-static": "^1.13.10",
+ "@types/sockjs": "^0.3.33",
+ "@types/ws": "^8.5.5",
+ "ansi-html-community": "^0.0.8",
+ "bonjour-service": "^1.0.11",
+ "chokidar": "^3.5.3",
+ "colorette": "^2.0.10",
+ "compression": "^1.7.4",
+ "connect-history-api-fallback": "^2.0.0",
+ "default-gateway": "^6.0.3",
+ "express": "^4.17.3",
+ "graceful-fs": "^4.2.6",
+ "html-entities": "^2.3.2",
+ "http-proxy-middleware": "^2.0.3",
+ "ipaddr.js": "^2.0.1",
+ "launch-editor": "^2.6.0",
+ "open": "^8.0.9",
+ "p-retry": "^4.5.0",
+ "rimraf": "^3.0.2",
+ "schema-utils": "^4.0.0",
+ "selfsigned": "^2.1.1",
+ "serve-index": "^1.9.1",
+ "sockjs": "^0.3.24",
+ "spdy": "^4.0.2",
+ "webpack-dev-middleware": "^5.3.1",
+ "ws": "^8.13.0"
+ },
+ "bin": {
+ "webpack-dev-server": "bin/webpack-dev-server.js"
+ },
+ "engines": {
+ "node": ">= 12.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "webpack": "^4.37.0 || ^5.0.0"
+ },
+ "peerDependenciesMeta": {
+ "webpack": {
+ "optional": true
+ },
+ "webpack-cli": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/webpack-dev-server/node_modules/ipaddr.js": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz",
+ "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==",
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/webpack-dev-server/node_modules/rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/webpack-dev-server/node_modules/webpack-dev-middleware": {
+ "version": "5.3.3",
+ "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-5.3.3.tgz",
+ "integrity": "sha512-hj5CYrY0bZLB+eTO+x/j67Pkrquiy7kWepMHmUMoPsmcUaeEnQJqFzHJOyxgWlq746/wUuA64p9ta34Kyb01pA==",
+ "dependencies": {
+ "colorette": "^2.0.10",
+ "memfs": "^3.4.3",
+ "mime-types": "^2.1.31",
+ "range-parser": "^1.2.1",
+ "schema-utils": "^4.0.0"
+ },
+ "engines": {
+ "node": ">= 12.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "webpack": "^4.0.0 || ^5.0.0"
+ }
+ },
+ "node_modules/webpack-dev-server/node_modules/ws": {
+ "version": "8.14.2",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz",
+ "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/webpack-merge": {
+ "version": "5.9.0",
+ "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.9.0.tgz",
+ "integrity": "sha512-6NbRQw4+Sy50vYNTw7EyOn41OZItPiXB8GNv3INSoe3PSFaHJEz3SHTrYVaRm2LilNGnFUzh0FAwqPEmU/CwDg==",
+ "dependencies": {
+ "clone-deep": "^4.0.1",
+ "wildcard": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10.0.0"
+ }
+ },
+ "node_modules/webpack-sources": {
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz",
+ "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==",
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/webpack-subresource-integrity": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/webpack-subresource-integrity/-/webpack-subresource-integrity-5.1.0.tgz",
+ "integrity": "sha512-sacXoX+xd8r4WKsy9MvH/q/vBtEHr86cpImXwyg74pFIpERKt6FmB8cXpeuh0ZLgclOlHI4Wcll7+R5L02xk9Q==",
+ "dev": true,
+ "dependencies": {
+ "typed-assert": "^1.0.8"
+ },
+ "engines": {
+ "node": ">= 12"
+ },
+ "peerDependencies": {
+ "html-webpack-plugin": ">= 5.0.0-beta.1 < 6",
+ "webpack": "^5.12.0"
+ },
+ "peerDependenciesMeta": {
+ "html-webpack-plugin": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/webpack/node_modules/ajv": {
+ "version": "6.12.6",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/webpack/node_modules/ajv-keywords": {
+ "version": "3.5.2",
+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
+ "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
+ "peerDependencies": {
+ "ajv": "^6.9.1"
+ }
+ },
+ "node_modules/webpack/node_modules/json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+ },
+ "node_modules/webpack/node_modules/schema-utils": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz",
+ "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==",
+ "dependencies": {
+ "@types/json-schema": "^7.0.8",
+ "ajv": "^6.12.5",
+ "ajv-keywords": "^3.5.2"
+ },
+ "engines": {
+ "node": ">= 10.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ }
+ },
+ "node_modules/webpackbar": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/webpackbar/-/webpackbar-5.0.2.tgz",
+ "integrity": "sha512-BmFJo7veBDgQzfWXl/wwYXr/VFus0614qZ8i9znqcl9fnEdiVkdbi0TedLQ6xAK92HZHDJ0QmyQ0fmuZPAgCYQ==",
+ "dependencies": {
+ "chalk": "^4.1.0",
+ "consola": "^2.15.3",
+ "pretty-time": "^1.1.0",
+ "std-env": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "peerDependencies": {
+ "webpack": "3 || 4 || 5"
+ }
+ },
+ "node_modules/websocket-driver": {
+ "version": "0.7.4",
+ "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz",
+ "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==",
+ "dependencies": {
+ "http-parser-js": ">=0.5.1",
+ "safe-buffer": ">=5.1.0",
+ "websocket-extensions": ">=0.1.1"
+ },
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/websocket-extensions": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz",
+ "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==",
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/whatwg-encoding": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz",
+ "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==",
+ "dev": true,
+ "dependencies": {
+ "iconv-lite": "0.4.24"
+ }
+ },
+ "node_modules/whatwg-mimetype": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz",
+ "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==",
+ "dev": true
+ },
+ "node_modules/whatwg-url": {
+ "version": "8.7.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz",
+ "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==",
+ "dev": true,
+ "dependencies": {
+ "lodash": "^4.7.0",
+ "tr46": "^2.1.0",
+ "webidl-conversions": "^6.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/which": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/node-which"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/which-boxed-primitive": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
+ "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==",
+ "dev": true,
+ "dependencies": {
+ "is-bigint": "^1.0.1",
+ "is-boolean-object": "^1.1.0",
+ "is-number-object": "^1.0.4",
+ "is-string": "^1.0.5",
+ "is-symbol": "^1.0.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/which-builtin-type": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.3.tgz",
+ "integrity": "sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw==",
+ "dev": true,
+ "dependencies": {
+ "function.prototype.name": "^1.1.5",
+ "has-tostringtag": "^1.0.0",
+ "is-async-function": "^2.0.0",
+ "is-date-object": "^1.0.5",
+ "is-finalizationregistry": "^1.0.2",
+ "is-generator-function": "^1.0.10",
+ "is-regex": "^1.1.4",
+ "is-weakref": "^1.0.2",
+ "isarray": "^2.0.5",
+ "which-boxed-primitive": "^1.0.2",
+ "which-collection": "^1.0.1",
+ "which-typed-array": "^1.1.9"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/which-collection": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz",
+ "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==",
+ "dev": true,
+ "dependencies": {
+ "is-map": "^2.0.1",
+ "is-set": "^2.0.1",
+ "is-weakmap": "^2.0.1",
+ "is-weakset": "^2.0.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/which-module": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",
+ "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
+ "dev": true
+ },
+ "node_modules/which-typed-array": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz",
+ "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==",
+ "dev": true,
+ "dependencies": {
+ "available-typed-arrays": "^1.0.5",
+ "call-bind": "^1.0.2",
+ "for-each": "^0.3.3",
+ "gopd": "^1.0.1",
+ "has-tostringtag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/wide-align": {
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz",
+ "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==",
+ "dev": true,
+ "dependencies": {
+ "string-width": "^1.0.2 || 2 || 3 || 4"
+ }
+ },
+ "node_modules/widest-line": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz",
+ "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==",
+ "dependencies": {
+ "string-width": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/wildcard": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz",
+ "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ=="
+ },
+ "node_modules/winston": {
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/winston/-/winston-3.10.0.tgz",
+ "integrity": "sha512-nT6SIDaE9B7ZRO0u3UvdrimG0HkB7dSTAgInQnNR2SOPJ4bvq5q79+pXLftKmP52lJGW15+H5MCK0nM9D3KB/g==",
+ "dependencies": {
+ "@colors/colors": "1.5.0",
+ "@dabh/diagnostics": "^2.0.2",
+ "async": "^3.2.3",
+ "is-stream": "^2.0.0",
+ "logform": "^2.4.0",
+ "one-time": "^1.0.0",
+ "readable-stream": "^3.4.0",
+ "safe-stable-stringify": "^2.3.1",
+ "stack-trace": "0.0.x",
+ "triple-beam": "^1.3.0",
+ "winston-transport": "^4.5.0"
+ },
+ "engines": {
+ "node": ">= 12.0.0"
+ }
+ },
+ "node_modules/winston-transport": {
+ "version": "4.5.0",
+ "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz",
+ "integrity": "sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==",
+ "dependencies": {
+ "logform": "^2.3.2",
+ "readable-stream": "^3.6.0",
+ "triple-beam": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 6.4.0"
+ }
+ },
+ "node_modules/wordwrap": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
+ "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q=="
+ },
+ "node_modules/wrap-ansi": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+ }
+ },
+ "node_modules/wrap-ansi-cjs": {
+ "name": "wrap-ansi",
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+ }
+ },
+ "node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
+ },
+ "node_modules/write-file-atomic": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz",
+ "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==",
+ "dev": true,
+ "dependencies": {
+ "imurmurhash": "^0.1.4",
+ "signal-exit": "^3.0.7"
+ },
+ "engines": {
+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
+ }
+ },
+ "node_modules/ws": {
+ "version": "7.5.9",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz",
+ "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=8.3.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": "^5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/xdg-basedir": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz",
+ "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/xml-name-validator": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",
+ "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==",
+ "dev": true
+ },
+ "node_modules/xml2js": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz",
+ "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==",
+ "dependencies": {
+ "sax": ">=0.6.0",
+ "xmlbuilder": "~11.0.0"
+ },
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/xmlbuilder": {
+ "version": "11.0.1",
+ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
+ "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/xmlchars": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
+ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",
+ "dev": true
+ },
+ "node_modules/xss": {
+ "version": "1.0.14",
+ "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.14.tgz",
+ "integrity": "sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw==",
+ "dependencies": {
+ "commander": "^2.20.3",
+ "cssfilter": "0.0.10"
+ },
+ "bin": {
+ "xss": "bin/xss"
+ },
+ "engines": {
+ "node": ">= 0.10.0"
+ }
+ },
+ "node_modules/xss/node_modules/commander": {
+ "version": "2.20.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
+ },
+ "node_modules/xtend": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
+ "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
+ "engines": {
+ "node": ">=0.4"
+ }
+ },
+ "node_modules/y18n": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/yallist": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
+ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="
+ },
+ "node_modules/yaml": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.2.tgz",
+ "integrity": "sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg==",
+ "dev": true,
+ "engines": {
+ "node": ">= 14"
+ }
+ },
+ "node_modules/yamljs": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/yamljs/-/yamljs-0.3.0.tgz",
+ "integrity": "sha512-C/FsVVhht4iPQYXOInoxUM/1ELSf9EsgKH34FofQOp6hwCPrW4vG4w5++TED3xRUo8gD7l0P1J1dLlDYzODsTQ==",
+ "dependencies": {
+ "argparse": "^1.0.7",
+ "glob": "^7.0.5"
+ },
+ "bin": {
+ "json2yaml": "bin/json2yaml",
+ "yaml2json": "bin/yaml2json"
+ }
+ },
+ "node_modules/yargs": {
+ "version": "17.7.2",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
+ "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
+ "dev": true,
+ "dependencies": {
+ "cliui": "^8.0.1",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
+ "require-directory": "^2.1.1",
+ "string-width": "^4.2.3",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^21.1.1"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/yargs-parser": {
+ "version": "21.1.1",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
+ "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/yargs/node_modules/cliui": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
+ "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
+ "dev": true,
+ "dependencies": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.1",
+ "wrap-ansi": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/ylru": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/ylru/-/ylru-1.3.2.tgz",
+ "integrity": "sha512-RXRJzMiK6U2ye0BlGGZnmpwJDPgakn6aNQ0A7gHRbD4I0uvK4TW6UqkK1V0pp9jskjJBAXd3dRrbzWkqJ+6cxA==",
+ "engines": {
+ "node": ">= 4.0.0"
+ }
+ },
+ "node_modules/yn": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
+ "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/yocto-queue": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
+ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/yup": {
+ "version": "0.32.9",
+ "resolved": "https://registry.npmjs.org/yup/-/yup-0.32.9.tgz",
+ "integrity": "sha512-Ci1qN+i2H0XpY7syDQ0k5zKQ/DoxO0LzPg8PAR/X4Mpj6DqaeCoIYEEjDJwhArh3Fa7GWbQQVDZKeXYlSH4JMg==",
+ "dependencies": {
+ "@babel/runtime": "^7.10.5",
+ "@types/lodash": "^4.14.165",
+ "lodash": "^4.17.20",
+ "lodash-es": "^4.17.15",
+ "nanoclone": "^0.2.1",
+ "property-expr": "^2.0.4",
+ "toposort": "^2.0.2"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/zen-observable": {
+ "version": "0.8.15",
+ "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz",
+ "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==",
+ "peer": true
+ },
+ "node_modules/zen-observable-ts": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz",
+ "integrity": "sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==",
+ "peer": true,
+ "dependencies": {
+ "zen-observable": "0.8.15"
+ }
+ },
+ "node_modules/zod": {
+ "version": "3.21.4",
+ "resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz",
+ "integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==",
+ "funding": {
+ "url": "https://github.com/sponsors/colinhacks"
+ }
+ },
+ "node_modules/zone.js": {
+ "version": "0.13.3",
+ "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.13.3.tgz",
+ "integrity": "sha512-MKPbmZie6fASC/ps4dkmIhaT5eonHkEt6eAy80K42tAm0G2W+AahLJjbfi6X9NPdciOE9GRFTTM8u2IiF6O3ww==",
+ "dependencies": {
+ "tslib": "^2.3.0"
+ }
+ },
+ "node_modules/zwitch": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz",
+ "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "packages/api": {
+ "version": "1.0.0",
+ "dependencies": {
+ "@azure/identity": "^2.1.0",
+ "@azure/keyvault-secrets": "^4.5.1",
+ "applicationinsights": "^2.3.4",
+ "dotenv": "^16.0.1",
+ "mongodb": "^4.7.0",
+ "mongoose": "^6.5.3",
+ "pg": "^8.8.0",
+ "swagger-ui-dist": "^4.14.0",
+ "winston": "^3.8.1",
+ "winston-transport": "^4.5.0",
+ "yamljs": "^0.3.0"
+ },
+ "devDependencies": {
+ "@azure/functions": "^1.2.3",
+ "@types/node": "^18.11.18",
+ "@types/pg": "^8.6.6",
+ "@types/swagger-ui-dist": "^3.30.1",
+ "@types/yamljs": "^0.2.31",
+ "@typescript-eslint/eslint-plugin": "^5.48.1",
+ "@typescript-eslint/parser": "^5.48.1",
+ "azure-functions-core-tools": "4.0.5095",
+ "eslint": "^8.31.0",
+ "eslint-config-prettier": "^8.6.0",
+ "npm-run-all": "^4.1.5",
+ "typescript": "^4.8.4"
+ }
+ },
+ "packages/api/node_modules/@azure/identity": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-2.1.0.tgz",
+ "integrity": "sha512-BPDz1sK7Ul9t0l9YKLEa8PHqWU4iCfhGJ+ELJl6c8CP3TpJt2urNCbm0ZHsthmxRsYoMPbz2Dvzj30zXZVmAFw==",
+ "dependencies": {
+ "@azure/abort-controller": "^1.0.0",
+ "@azure/core-auth": "^1.3.0",
+ "@azure/core-client": "^1.4.0",
+ "@azure/core-rest-pipeline": "^1.1.0",
+ "@azure/core-tracing": "^1.0.0",
+ "@azure/core-util": "^1.0.0",
+ "@azure/logger": "^1.0.0",
+ "@azure/msal-browser": "^2.26.0",
+ "@azure/msal-common": "^7.0.0",
+ "@azure/msal-node": "^1.10.0",
+ "events": "^3.0.0",
+ "jws": "^4.0.0",
+ "open": "^8.0.0",
+ "stoppable": "^1.1.0",
+ "tslib": "^2.2.0",
+ "uuid": "^8.3.0"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "packages/api/node_modules/@azure/msal-common": {
+ "version": "7.6.0",
+ "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-7.6.0.tgz",
+ "integrity": "sha512-XqfbglUTVLdkHQ8F9UQJtKseRr3sSnr9ysboxtoswvaMVaEfvyLtMoHv9XdKUfOc0qKGzNgRFd9yRjIWVepl6Q==",
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "packages/blog": {
+ "version": "1.0.2",
+ "license": "MIT",
+ "dependencies": {
+ "next": "^13.3.0",
+ "qs": "^6.10.1",
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0",
+ "react-markdown": "^8.0.4",
+ "rehype-raw": "^6.1.1",
+ "rehype-sanitize": "^5.0.1",
+ "uikit": "^3.16.14"
+ },
+ "devDependencies": {
+ "@types/node": "^18.11.18",
+ "@typescript-eslint/eslint-plugin": "^5.48.1",
+ "@typescript-eslint/parser": "^5.48.1",
+ "eslint": "^8.31.0",
+ "eslint-config-next": "^13.3.0",
+ "eslint-config-prettier": "^8.6.0",
+ "eslint-plugin-prettier": "^4.2.1",
+ "prettier": "^2.8.2",
+ "typescript": "^4.8.4"
+ }
+ },
+ "packages/blog-cms": {
+ "version": "0.1.0",
+ "license": "MIT",
+ "dependencies": {
+ "@strapi/plugin-graphql": "^4.9.1",
+ "@strapi/plugin-i18n": "^4.5.6",
+ "@strapi/plugin-users-permissions": "^4.5.6",
+ "@strapi/strapi": "^4.5.6",
+ "lodash.set": "^4.3.2",
+ "pg": "^8.8.0",
+ "strapi-provider-upload-azure-storage": "^2.1.0"
+ },
+ "devDependencies": {
+ "@types/lodash.set": "^4.3.7"
+ },
+ "engines": {
+ "node": ">=14.19.1 <=18.x.x",
+ "npm": ">=6.0.0"
+ }
+ },
+ "packages/portal": {
+ "version": "0.0.0",
+ "dependencies": {
+ "@angular/animations": "^16.0.5",
+ "@angular/cdk": "^16.0.4",
+ "@angular/common": "^16.0.5",
+ "@angular/compiler": "^16.0.5",
+ "@angular/core": "^16.0.5",
+ "@angular/forms": "^16.0.5",
+ "@angular/material": "^16.0.4",
+ "@angular/platform-browser": "^16.0.5",
+ "@angular/platform-browser-dynamic": "^16.0.5",
+ "@angular/router": "^16.0.5",
+ "@fortawesome/angular-fontawesome": "^0.13.0",
+ "@fortawesome/fontawesome-svg-core": "^6.4.2",
+ "@fortawesome/free-brands-svg-icons": "^6.4.2",
+ "@fortawesome/free-solid-svg-icons": "^6.4.2",
+ "apollo-angular": "^5.0.1",
+ "graphql": "^16.6.0",
+ "rxjs": "~7.5.0",
+ "tslib": "^2.3.0",
+ "zone.js": "~0.13.0"
+ },
+ "devDependencies": {
+ "@angular-devkit/build-angular": "^16.0.5",
+ "@angular/cli": "^16.0.5",
+ "@angular/compiler-cli": "^16.0.5",
+ "@azure/static-web-apps-cli": "^1.0.6",
+ "@ngx-env/builder": "^16.0.0",
+ "@types/jest": "^29.2.4",
+ "@types/node": "^18.11.18",
+ "@typescript-eslint/eslint-plugin": "^5.48.1",
+ "@typescript-eslint/parser": "^5.48.1",
+ "eslint": "^8.31.0",
+ "eslint-config-prettier": "^8.6.0",
+ "jest": "^29.5.0",
+ "typescript": "^4.8.4"
+ }
+ },
+ "packages/portal/node_modules/rxjs": {
+ "version": "7.5.7",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.7.tgz",
+ "integrity": "sha512-z9MzKh/UcOqB3i20H6rtrlaE/CgjLOvheWK/9ILrbhROGTweAi1BaFsTT9FbwZi5Trr1qNRs+MXkhmR06awzQA==",
+ "dependencies": {
+ "tslib": "^2.1.0"
+ }
+ },
+ "packages/stripe": {
+ "name": "stripe-api",
+ "version": "1.0.0",
+ "dependencies": {
+ "@fastify/autoload": "^5.0.0",
+ "@fastify/sensible": "^5.0.0",
+ "fastify": "^4.0.0",
+ "fastify-cli": "^5.7.0",
+ "fastify-plugin": "^4.0.0",
+ "fastify-raw-body": "^4.2.0",
+ "node-fetch": "^3.3.0",
+ "stripe": "^13.7.0"
+ },
+ "devDependencies": {
+ "@types/node": "^18.0.0",
+ "@types/tap": "^15.0.5",
+ "concurrently": "^7.0.0",
+ "fastify-tsconfig": "^1.0.1",
+ "tap": "^16.1.0",
+ "ts-node": "^10.4.0",
+ "typescript": "^4.5.4"
+ }
+ },
+ "packages/stripe/node_modules/node-fetch": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
+ "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
+ "dependencies": {
+ "data-uri-to-buffer": "^4.0.0",
+ "fetch-blob": "^3.1.4",
+ "formdata-polyfill": "^4.0.10"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/node-fetch"
+ }
+ },
+ "packages/testing": {
+ "version": "1.0.0",
+ "license": "ISC",
+ "dependencies": {
+ "dotenv": "^16.0.3"
+ },
+ "devDependencies": {
+ "@playwright/test": "^1.31.1",
+ "@types/node": "^18.14.5"
+ }
+ }
+ }
+}
diff --git a/test/cli/install/migration/contoso-test/package.json b/test/cli/install/migration/contoso-test/package.json
new file mode 100644
index 000000000..255c8c92b
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "contoso-real-estate",
+ "version": "1.0.0",
+ "description": "https://github.com/Azure-Samples/contoso-real-estate",
+ "private": true,
+ "author": "Microsoft",
+ "license": "MIT",
+ "workspaces": [
+ "packages/*"
+ ],
+ "devDependencies": {
+ "concurrently": "^7.6.0",
+ "git-commit-msg-linter": "^4.2.1",
+ "prettier": "^2.7.1",
+ "rimraf": "^4.3.1"
+ }
+}
diff --git a/test/cli/install/migration/contoso-test/packages/api/package.json b/test/cli/install/migration/contoso-test/packages/api/package.json
new file mode 100644
index 000000000..66eb9beb7
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/packages/api/package.json
@@ -0,0 +1,42 @@
+{
+ "name": "api",
+ "version": "1.0.0",
+ "description": "",
+ "scripts": {
+ "env": "azd env get-values --no-prompt > .env",
+ "build": "tsc",
+ "watch": "tsc --w",
+ "prestart": "tsc && func extensions install",
+ "start:host": "func start",
+ "start": "npm-run-all --parallel start:host watch",
+ "lint": "eslint --config ../../.eslintrc.js",
+ "lint:fix": "npm run lint -- --fix"
+ },
+ "dependencies": {
+ "@azure/identity": "^2.1.0",
+ "@azure/keyvault-secrets": "^4.5.1",
+ "applicationinsights": "^2.3.4",
+ "dotenv": "^16.0.1",
+ "mongodb": "^4.7.0",
+ "mongoose": "^6.5.3",
+ "pg": "^8.8.0",
+ "swagger-ui-dist": "^4.14.0",
+ "winston": "^3.8.1",
+ "winston-transport": "^4.5.0",
+ "yamljs": "^0.3.0"
+ },
+ "devDependencies": {
+ "@azure/functions": "^1.2.3",
+ "@types/node": "^18.11.18",
+ "@types/pg": "^8.6.6",
+ "@types/swagger-ui-dist": "^3.30.1",
+ "@types/yamljs": "^0.2.31",
+ "@typescript-eslint/eslint-plugin": "^5.48.1",
+ "@typescript-eslint/parser": "^5.48.1",
+ "azure-functions-core-tools": "4.0.5095",
+ "eslint": "^8.31.0",
+ "eslint-config-prettier": "^8.6.0",
+ "npm-run-all": "^4.1.5",
+ "typescript": "^4.8.4"
+ }
+}
diff --git a/test/cli/install/migration/contoso-test/packages/blog-cms/package.json b/test/cli/install/migration/contoso-test/packages/blog-cms/package.json
new file mode 100644
index 000000000..d4445b849
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/packages/blog-cms/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "blog-cms",
+ "private": true,
+ "version": "0.1.0",
+ "description": "The blog backend",
+ "scripts": {
+ "develop": "strapi develop",
+ "start": "strapi start",
+ "build": "strapi build",
+ "strapi": "strapi",
+ "docker:build": "docker build --tag cms .",
+ "docker:run": "docker run --rm --publish 1337:1337 --env-file ../../.env.docker cms"
+ },
+ "devDependencies": {
+ "@types/lodash.set": "^4.3.7"
+ },
+ "dependencies": {
+ "@strapi/plugin-graphql": "^4.9.1",
+ "@strapi/plugin-i18n": "^4.5.6",
+ "@strapi/plugin-users-permissions": "^4.5.6",
+ "@strapi/strapi": "^4.5.6",
+ "lodash.set": "^4.3.2",
+ "pg": "^8.8.0",
+ "strapi-provider-upload-azure-storage": "^2.1.0"
+ },
+ "strapi": {
+ "uuid": "42db7187-d121-4240-b174-3b2b3605f696"
+ },
+ "engines": {
+ "node": ">=14.19.1 <=18.x.x",
+ "npm": ">=6.0.0"
+ },
+ "license": "MIT"
+}
diff --git a/test/cli/install/migration/contoso-test/packages/blog/package.json b/test/cli/install/migration/contoso-test/packages/blog/package.json
new file mode 100644
index 000000000..d7459bd0f
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/packages/blog/package.json
@@ -0,0 +1,38 @@
+{
+ "name": "blog",
+ "version": "1.0.2",
+ "private": true,
+ "scripts": {
+ "develop": "next dev",
+ "dev": "next dev",
+ "build": "next build",
+ "start": "next start",
+ "deploy": "next build && next export",
+ "lint": "next lint",
+ "lint:fix": "next lint --fix",
+ "docker:build": "docker build --tag blog .",
+ "docker:run": "docker run --rm --publish 3000:3000 --env-file ../../.env.docker blog"
+ },
+ "dependencies": {
+ "next": "^13.3.0",
+ "qs": "^6.10.1",
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0",
+ "react-markdown": "^8.0.4",
+ "rehype-raw": "^6.1.1",
+ "rehype-sanitize": "^5.0.1",
+ "uikit": "^3.16.14"
+ },
+ "license": "MIT",
+ "devDependencies": {
+ "@types/node": "^18.11.18",
+ "@typescript-eslint/eslint-plugin": "^5.48.1",
+ "@typescript-eslint/parser": "^5.48.1",
+ "eslint": "^8.31.0",
+ "eslint-config-next": "^13.3.0",
+ "eslint-config-prettier": "^8.6.0",
+ "eslint-plugin-prettier": "^4.2.1",
+ "prettier": "^2.8.2",
+ "typescript": "^4.8.4"
+ }
+}
diff --git a/test/cli/install/migration/contoso-test/packages/portal/package.json b/test/cli/install/migration/contoso-test/packages/portal/package.json
new file mode 100644
index 000000000..e1f1e1564
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/packages/portal/package.json
@@ -0,0 +1,52 @@
+{
+ "name": "portal",
+ "version": "0.0.0",
+ "scripts": {
+ "ng": "ng",
+ "swa": "swa",
+ "start": "ng serve --disable-host-check",
+ "start:swa": "swa start",
+ "build": "ng build",
+ "watch": "ng build --watch --configuration development",
+ "test": "ng test",
+ "lint": "eslint --config ../../.eslintrc.js",
+ "lint:fix": "npm run lint -- --fix"
+ },
+ "private": true,
+ "dependencies": {
+ "@angular/animations": "^16.0.5",
+ "@angular/cdk": "^16.0.4",
+ "@angular/common": "^16.0.5",
+ "@angular/compiler": "^16.0.5",
+ "@angular/core": "^16.0.5",
+ "@angular/forms": "^16.0.5",
+ "@angular/material": "^16.0.4",
+ "@angular/platform-browser": "^16.0.5",
+ "@angular/platform-browser-dynamic": "^16.0.5",
+ "@angular/router": "^16.0.5",
+ "@fortawesome/angular-fontawesome": "^0.13.0",
+ "@fortawesome/fontawesome-svg-core": "^6.4.2",
+ "@fortawesome/free-brands-svg-icons": "^6.4.2",
+ "@fortawesome/free-solid-svg-icons": "^6.4.2",
+ "apollo-angular": "^5.0.1",
+ "graphql": "^16.6.0",
+ "rxjs": "~7.5.0",
+ "tslib": "^2.3.0",
+ "zone.js": "~0.13.0"
+ },
+ "devDependencies": {
+ "@angular-devkit/build-angular": "^16.0.5",
+ "@angular/cli": "^16.0.5",
+ "@angular/compiler-cli": "^16.0.5",
+ "@azure/static-web-apps-cli": "^1.0.6",
+ "@ngx-env/builder": "^16.0.0",
+ "@types/jest": "^29.2.4",
+ "@types/node": "^18.11.18",
+ "@typescript-eslint/eslint-plugin": "^5.48.1",
+ "@typescript-eslint/parser": "^5.48.1",
+ "eslint": "^8.31.0",
+ "eslint-config-prettier": "^8.6.0",
+ "jest": "^29.5.0",
+ "typescript": "^4.8.4"
+ }
+}
diff --git a/test/cli/install/migration/contoso-test/packages/stripe/package.json b/test/cli/install/migration/contoso-test/packages/stripe/package.json
new file mode 100644
index 000000000..6e8d7a36d
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/packages/stripe/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "stripe-api",
+ "version": "1.0.0",
+ "description": "Stripe service",
+ "private": true,
+ "type": "module",
+ "main": "app.ts",
+ "directories": {
+ "test": "test"
+ },
+ "scripts": {
+ "test": "npm run build:ts && tsc -p test/tsconfig.json && tap --ts \"test-dist/test/**/*.test.js\"",
+ "start": "fastify start -l info dist/app.js -a 0.0.0.0 -p 4242",
+ "build:ts": "tsc",
+ "watch:ts": "tsc -w",
+ "dev": "npm run build:ts && concurrently -k -p \"[{name}]\" -n \"TypeScript,App\" -c \"yellow.bold,cyan.bold\" \"npm:watch:ts\" \"npm:dev:start\"",
+ "dev:start": "fastify start --ignore-watch=.ts$ -w -l info -p 4242 -P dist/app.js",
+ "docker:build": "docker build --tag stripe --file ./Dockerfile ../..",
+ "docker:run": "docker run --rm --publish 4242:4242 --env-file ../../.env.docker stripe"
+ },
+ "dependencies": {
+ "@fastify/autoload": "^5.0.0",
+ "@fastify/sensible": "^5.0.0",
+ "fastify": "^4.0.0",
+ "fastify-cli": "^5.7.0",
+ "fastify-plugin": "^4.0.0",
+ "fastify-raw-body": "^4.2.0",
+ "node-fetch": "^3.3.0",
+ "stripe": "^13.7.0"
+ },
+ "devDependencies": {
+ "@types/node": "^18.0.0",
+ "@types/tap": "^15.0.5",
+ "concurrently": "^7.0.0",
+ "fastify-tsconfig": "^1.0.1",
+ "tap": "^16.1.0",
+ "ts-node": "^10.4.0",
+ "typescript": "^4.5.4"
+ }
+}
diff --git a/test/cli/install/migration/contoso-test/packages/testing/package.json b/test/cli/install/migration/contoso-test/packages/testing/package.json
new file mode 100644
index 000000000..edd676b3f
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/packages/testing/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "testing",
+ "version": "1.0.0",
+ "description": "This document will guide you through the process of setting up a new Playwright test project, and authoring and running end-to-end tests for the Contoso web application.",
+ "main": "index.js",
+ "scripts": {},
+ "keywords": [],
+ "author": "",
+ "license": "ISC",
+ "devDependencies": {
+ "@playwright/test": "^1.31.1",
+ "@types/node": "^18.14.5"
+ },
+ "dependencies": {
+ "dotenv": "^16.0.3"
+ }
+}
diff --git a/test/cli/install/migration/contoso-test/portal/package.json b/test/cli/install/migration/contoso-test/portal/package.json
new file mode 100644
index 000000000..e1f1e1564
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/portal/package.json
@@ -0,0 +1,52 @@
+{
+ "name": "portal",
+ "version": "0.0.0",
+ "scripts": {
+ "ng": "ng",
+ "swa": "swa",
+ "start": "ng serve --disable-host-check",
+ "start:swa": "swa start",
+ "build": "ng build",
+ "watch": "ng build --watch --configuration development",
+ "test": "ng test",
+ "lint": "eslint --config ../../.eslintrc.js",
+ "lint:fix": "npm run lint -- --fix"
+ },
+ "private": true,
+ "dependencies": {
+ "@angular/animations": "^16.0.5",
+ "@angular/cdk": "^16.0.4",
+ "@angular/common": "^16.0.5",
+ "@angular/compiler": "^16.0.5",
+ "@angular/core": "^16.0.5",
+ "@angular/forms": "^16.0.5",
+ "@angular/material": "^16.0.4",
+ "@angular/platform-browser": "^16.0.5",
+ "@angular/platform-browser-dynamic": "^16.0.5",
+ "@angular/router": "^16.0.5",
+ "@fortawesome/angular-fontawesome": "^0.13.0",
+ "@fortawesome/fontawesome-svg-core": "^6.4.2",
+ "@fortawesome/free-brands-svg-icons": "^6.4.2",
+ "@fortawesome/free-solid-svg-icons": "^6.4.2",
+ "apollo-angular": "^5.0.1",
+ "graphql": "^16.6.0",
+ "rxjs": "~7.5.0",
+ "tslib": "^2.3.0",
+ "zone.js": "~0.13.0"
+ },
+ "devDependencies": {
+ "@angular-devkit/build-angular": "^16.0.5",
+ "@angular/cli": "^16.0.5",
+ "@angular/compiler-cli": "^16.0.5",
+ "@azure/static-web-apps-cli": "^1.0.6",
+ "@ngx-env/builder": "^16.0.0",
+ "@types/jest": "^29.2.4",
+ "@types/node": "^18.11.18",
+ "@typescript-eslint/eslint-plugin": "^5.48.1",
+ "@typescript-eslint/parser": "^5.48.1",
+ "eslint": "^8.31.0",
+ "eslint-config-prettier": "^8.6.0",
+ "jest": "^29.5.0",
+ "typescript": "^4.8.4"
+ }
+}
diff --git a/test/cli/install/migration/contoso-test/stripe/package.json b/test/cli/install/migration/contoso-test/stripe/package.json
new file mode 100644
index 000000000..6e8d7a36d
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/stripe/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "stripe-api",
+ "version": "1.0.0",
+ "description": "Stripe service",
+ "private": true,
+ "type": "module",
+ "main": "app.ts",
+ "directories": {
+ "test": "test"
+ },
+ "scripts": {
+ "test": "npm run build:ts && tsc -p test/tsconfig.json && tap --ts \"test-dist/test/**/*.test.js\"",
+ "start": "fastify start -l info dist/app.js -a 0.0.0.0 -p 4242",
+ "build:ts": "tsc",
+ "watch:ts": "tsc -w",
+ "dev": "npm run build:ts && concurrently -k -p \"[{name}]\" -n \"TypeScript,App\" -c \"yellow.bold,cyan.bold\" \"npm:watch:ts\" \"npm:dev:start\"",
+ "dev:start": "fastify start --ignore-watch=.ts$ -w -l info -p 4242 -P dist/app.js",
+ "docker:build": "docker build --tag stripe --file ./Dockerfile ../..",
+ "docker:run": "docker run --rm --publish 4242:4242 --env-file ../../.env.docker stripe"
+ },
+ "dependencies": {
+ "@fastify/autoload": "^5.0.0",
+ "@fastify/sensible": "^5.0.0",
+ "fastify": "^4.0.0",
+ "fastify-cli": "^5.7.0",
+ "fastify-plugin": "^4.0.0",
+ "fastify-raw-body": "^4.2.0",
+ "node-fetch": "^3.3.0",
+ "stripe": "^13.7.0"
+ },
+ "devDependencies": {
+ "@types/node": "^18.0.0",
+ "@types/tap": "^15.0.5",
+ "concurrently": "^7.0.0",
+ "fastify-tsconfig": "^1.0.1",
+ "tap": "^16.1.0",
+ "ts-node": "^10.4.0",
+ "typescript": "^4.5.4"
+ }
+}
diff --git a/test/cli/install/migration/contoso-test/testing/package.json b/test/cli/install/migration/contoso-test/testing/package.json
new file mode 100644
index 000000000..edd676b3f
--- /dev/null
+++ b/test/cli/install/migration/contoso-test/testing/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "testing",
+ "version": "1.0.0",
+ "description": "This document will guide you through the process of setting up a new Playwright test project, and authoring and running end-to-end tests for the Contoso web application.",
+ "main": "index.js",
+ "scripts": {},
+ "keywords": [],
+ "author": "",
+ "license": "ISC",
+ "devDependencies": {
+ "@playwright/test": "^1.31.1",
+ "@types/node": "^18.14.5"
+ },
+ "dependencies": {
+ "dotenv": "^16.0.3"
+ }
+}
diff --git a/test/cli/install/migration/migrate.test.ts b/test/cli/install/migration/migrate.test.ts
new file mode 100644
index 000000000..28ccac2a0
--- /dev/null
+++ b/test/cli/install/migration/migrate.test.ts
@@ -0,0 +1,54 @@
+import fs from "fs";
+import { test, expect } from "bun:test";
+import { bunEnv, bunExe } from "harness";
+import { join } from "path";
+import { mkdtempSync } from "js/node/fs/export-star-from";
+import { tmpdir } from "os";
+
+test("migrate from npm during `bun add`", async () => {
+ const testDir = mkdtempSync(join(tmpdir(), "migrate-"));
+
+ fs.writeFileSync(
+ join(testDir, "package.json"),
+ JSON.stringify({
+ name: "test3",
+ dependencies: {
+ "svelte": "*",
+ },
+ }),
+ );
+ fs.cpSync(join(import.meta.dir, "add-while-migrate-fixture.json"), join(testDir, "package-lock.json"));
+
+ Bun.spawnSync([bunExe(), "add", "lodash@4.17.21"], {
+ env: bunEnv,
+ cwd: testDir,
+ });
+
+ expect(fs.existsSync(join(testDir, "node_modules/lodash"))).toBeTrue();
+
+ const svelte_version = JSON.parse(fs.readFileSync(join(testDir, "node_modules/svelte/package.json"), "utf8")).version;
+ expect(svelte_version).toBe("4.0.0");
+
+ const lodash_version = JSON.parse(fs.readFileSync(join(testDir, "node_modules/lodash/package.json"), "utf8")).version;
+ expect(lodash_version).toBe("4.17.21");
+});
+
+// Currently this upgrades svelte :(
+test.todo("migrate workspace from npm during `bun add`", async () => {
+ const testDir = join(tmpdir(), "migrate-" + Math.random().toString(36).slice(2));
+
+ fs.cpSync(join(import.meta.dir, "add-while-migrate-workspace"), testDir, { recursive: true });
+
+ Bun.spawnSync([bunExe(), "add", "lodash@4.17.21"], {
+ env: bunEnv,
+ cwd: join(testDir, "packages", "a"),
+ });
+
+ expect(fs.existsSync(join(testDir, "node_modules/lodash"))).toBeTrue();
+
+ const lodash_version = JSON.parse(fs.readFileSync(join(testDir, "node_modules/lodash/package.json"), "utf8")).version;
+ expect(lodash_version).toBe("4.17.21");
+
+ const svelte_version = JSON.parse(fs.readFileSync(join(testDir, "node_modules/svelte/package.json"), "utf8")).version;
+ expect(svelte_version).toBe("3.0.0");
+});
diff --git a/test/cli/install/moo-0.2.0.tgz b/test/cli/install/moo-0.2.0.tgz
new file mode 100644
index 000000000..a920e6e24
--- /dev/null
+++ b/test/cli/install/moo-0.2.0.tgz
Binary files differ
diff --git a/test/cli/install/overrides.test.ts b/test/cli/install/overrides.test.ts
new file mode 100644
index 000000000..bd4ee5cf7
--- /dev/null
+++ b/test/cli/install/overrides.test.ts
@@ -0,0 +1,189 @@
+import { mkdtempSync } from "fs";
+import { join } from "path";
+import { tmpdir } from "os";
+import { readFileSync, writeFileSync } from "fs";
+import { bunEnv, bunExe } from "harness";
+
+function install(cwd: string, args: string[]) {
+ const exec = Bun.spawnSync({
+ cmd: [bunExe(), ...args],
+ cwd,
+ stdout: "pipe",
+ stdin: "ignore",
+ stderr: "inherit",
+ env: bunEnv,
+ });
+ if (exec.exitCode !== 0) {
+ throw new Error(`bun install exited with code ${exec.exitCode}`);
+ }
+ return exec;
+}
+
+function installExpectFail(cwd: string, args: string[]) {
+ const exec = Bun.spawnSync({
+ cmd: [bunExe(), ...args],
+ cwd,
+ stdout: "pipe",
+ stdin: "ignore",
+ stderr: "inherit",
+ env: bunEnv,
+ });
+ if (exec.exitCode === 0) {
+ throw new Error(`bun install exited with code ${exec.exitCode}, (expected failure)`);
+ }
+ return exec;
+}
+
+function versionOf(cwd: string, path: string) {
+ const data = readFileSync(join(cwd, path));
+ const json = JSON.parse(data.toString());
+ return json.version;
+}
+
+function ensureLockfileDoesntChangeOnBunI(cwd: string) {
+ install(cwd, ["install"]);
+ const lockb_hash = new Bun.CryptoHasher("sha256").update(readFileSync(join(cwd, "bun.lockb"))).digest();
+ install(cwd, ["install", "--frozen-lockfile"]);
+ install(cwd, ["install", "--force"]);
+ const lockb_hash2 = new Bun.CryptoHasher("sha256").update(readFileSync(join(cwd, "bun.lockb"))).digest();
+ expect(lockb_hash).toEqual(lockb_hash2);
+}
+
+test("overrides affect your own packages", async () => {
+ const tmp = mkdtempSync(join(tmpdir(), "bun-pm-test"));
+ writeFileSync(
+ join(tmp, "package.json"),
+ JSON.stringify({
+ dependencies: {},
+ overrides: {
+ lodash: "4.0.0",
+ },
+ }),
+ );
+ install(tmp, ["install", "lodash"]);
+ expect(versionOf(tmp, "node_modules/lodash/package.json")).toBe("4.0.0");
+
+ ensureLockfileDoesntChangeOnBunI(tmp);
+});
+
+test("overrides affects all dependencies", async () => {
+ const tmp = mkdtempSync(join(tmpdir(), "bun-pm-test"));
+ writeFileSync(
+ join(tmp, "package.json"),
+ JSON.stringify({
+ dependencies: {},
+ overrides: {
+ bytes: "1.0.0",
+ },
+ }),
+ );
+ install(tmp, ["install", "express@4.18.2"]);
+ expect(versionOf(tmp, "node_modules/bytes/package.json")).toBe("1.0.0");
+
+ ensureLockfileDoesntChangeOnBunI(tmp);
+});
+
+test("overrides being set later affects all dependencies", async () => {
+ const tmp = mkdtempSync(join(tmpdir(), "bun-pm-test"));
+ writeFileSync(
+ join(tmp, "package.json"),
+ JSON.stringify({
+ dependencies: {},
+ }),
+ );
+ install(tmp, ["install", "express@4.18.2"]);
+ expect(versionOf(tmp, "node_modules/bytes/package.json")).not.toBe("1.0.0");
+
+ ensureLockfileDoesntChangeOnBunI(tmp);
+
+ writeFileSync(
+ join(tmp, "package.json"),
+ JSON.stringify({
+ ...JSON.parse(readFileSync(join(tmp, "package.json")).toString()),
+ overrides: {
+ bytes: "1.0.0",
+ },
+ }),
+ );
+ install(tmp, ["install"]);
+ expect(versionOf(tmp, "node_modules/bytes/package.json")).toBe("1.0.0");
+
+ ensureLockfileDoesntChangeOnBunI(tmp);
+});
+
+test("overrides to npm specifier", async () => {
+ const tmp = mkdtempSync(join(tmpdir(), "bun-pm-test"));
+ writeFileSync(
+ join(tmp, "package.json"),
+ JSON.stringify({
+ dependencies: {},
+ overrides: {
+ bytes: "npm:lodash@4.0.0",
+ },
+ }),
+ );
+ install(tmp, ["install", "express@4.18.2"]);
+
+ // BUG: the npm specifier is hoisted https://github.com/oven-sh/bun/issues/6433
+ // const bytes = JSON.parse(readFileSync(join(tmp, "node_modules/bytes/package.json"), "utf-8"));
+ const bytes = JSON.parse(
+ readFileSync(join(tmp, "node_modules/body-parser/node_modules/bytes/package.json"), "utf-8"),
+ );
+
+ expect(bytes.name).toBe("lodash");
+ expect(bytes.version).toBe("4.0.0");
+
+ ensureLockfileDoesntChangeOnBunI(tmp);
+});
+
+test("changing overrides makes the lockfile changed, prevent frozen install", async () => {
+ const tmp = mkdtempSync(join(tmpdir(), "bun-pm-test"));
+ writeFileSync(
+ join(tmp, "package.json"),
+ JSON.stringify({
+ dependencies: {},
+ overrides: {
+ bytes: "1.0.0",
+ },
+ }),
+ );
+ install(tmp, ["install", "express@4.18.2"]);
+
+ writeFileSync(
+ join(tmp, "package.json"),
+ JSON.stringify({
+ ...JSON.parse(readFileSync(join(tmp, "package.json")).toString()),
+ overrides: {
+ bytes: "1.0.1",
+ },
+ }),
+ );
+
+ installExpectFail(tmp, ["install", "--frozen-lockfile"]);
+});
+
+test("overrides reset when removed", async () => {
+ const tmp = mkdtempSync(join(tmpdir(), "bun-pm-test"));
+ writeFileSync(
+ join(tmp, "package.json"),
+ JSON.stringify({
+ overrides: {
+ bytes: "1.0.0",
+ },
+ }),
+ );
+ install(tmp, ["install", "express@4.18.2"]);
+ expect(versionOf(tmp, "node_modules/bytes/package.json")).toBe("1.0.0");
+
+ writeFileSync(
+ join(tmp, "package.json"),
+ JSON.stringify({
+ ...JSON.parse(readFileSync(join(tmp, "package.json")).toString()),
+ overrides: undefined,
+ }),
+ );
+ install(tmp, ["install"]);
+ expect(versionOf(tmp, "node_modules/bytes/package.json")).not.toBe("1.0.0");
+
+ ensureLockfileDoesntChangeOnBunI(tmp);
+});
diff --git a/test/cli/install/peer-0.0.1.tgz b/test/cli/install/peer-0.0.1.tgz
new file mode 100644
index 000000000..f2839613d
--- /dev/null
+++ b/test/cli/install/peer-0.0.1.tgz
Binary files differ
diff --git a/test/cli/install/peer-0.0.2.tgz b/test/cli/install/peer-0.0.2.tgz
new file mode 100644
index 000000000..c707b2d7a
--- /dev/null
+++ b/test/cli/install/peer-0.0.2.tgz
Binary files differ
diff --git a/test/cli/install/qux-0.0.2.tgz b/test/cli/install/qux-0.0.2.tgz
new file mode 100644
index 000000000..0a2e6be7c
--- /dev/null
+++ b/test/cli/install/qux-0.0.2.tgz
Binary files differ
diff --git a/packages/bun-framework-next/next_document.tsx b/test/cli/run/empty-file.js
index e69de29bb..e69de29bb 100644
--- a/packages/bun-framework-next/next_document.tsx
+++ b/test/cli/run/empty-file.js
diff --git a/test/cli/run/empty-file.test.ts b/test/cli/run/empty-file.test.ts
new file mode 100644
index 000000000..f29162bf7
--- /dev/null
+++ b/test/cli/run/empty-file.test.ts
@@ -0,0 +1,15 @@
+import { it, expect } from "bun:test";
+import { bunEnv, bunExe } from "harness";
+import { join } from "path";
+
+it("should execute empty scripts", () => {
+ const { stdout, stderr, exitCode } = Bun.spawnSync({
+ cmd: [bunExe(), "run", "--bun", join(import.meta.dir, "empty-file.js")],
+ env: bunEnv,
+ stdout: "pipe",
+ stderr: "pipe",
+ });
+ expect(stdout.toString()).toBeEmpty();
+ expect(stderr.toString()).toBeEmpty();
+ expect(exitCode).toBe(0);
+});
diff --git a/test/cli/run/env.test.ts b/test/cli/run/env.test.ts
index 3ed300477..1c2d51e8e 100644
--- a/test/cli/run/env.test.ts
+++ b/test/cli/run/env.test.ts
@@ -385,6 +385,16 @@ test(".env with zero length strings", () => {
expect(stdout).toBe("||0|0");
});
+test("process with zero length environment variable", () => {
+ const dir = tempDirWithFiles("process-issue-zerolength", {
+ "index.ts": "console.log(`'${process.env.TEST_ENV_VAR}'`);",
+ });
+ const { stdout } = bunRun(`${dir}/index.ts`, {
+ TEST_ENV_VAR: "",
+ });
+ expect(stdout).toBe("''");
+});
+
test(".env in a folder doesn't throw an error", () => {
const dir = tempDirWithFiles("dotenv-issue-3670", {
".env": {
diff --git a/test/cli/run/if-present.test.ts b/test/cli/run/if-present.test.ts
new file mode 100644
index 000000000..120970b46
--- /dev/null
+++ b/test/cli/run/if-present.test.ts
@@ -0,0 +1,119 @@
+import { describe, test, expect, beforeAll } from "bun:test";
+import { spawnSync } from "bun";
+import { bunEnv, bunExe, tempDirWithFiles } from "harness";
+
+let cwd: string;
+
+beforeAll(() => {
+ cwd = tempDirWithFiles("--if-present", {
+ "present.js": "console.log('Here!');",
+ "package.json": JSON.stringify({
+ "name": "present",
+ "scripts": {
+ "present": "echo 'Here!'",
+ },
+ }),
+ });
+});
+
+describe("bun", () => {
+ test("should error with missing script", () => {
+ const { exitCode, stdout, stderr } = spawnSync({
+ cwd,
+ cmd: [bunExe(), "notpresent"],
+ env: bunEnv,
+ stdout: "pipe",
+ stderr: "pipe",
+ });
+ expect(stdout.toString()).toBeEmpty();
+ expect(stderr.toString()).toMatch(/script not found/);
+ expect(exitCode).toBe(1);
+ });
+ test("should error with missing module", () => {
+ const { exitCode, stdout, stderr } = spawnSync({
+ cwd,
+ cmd: [bunExe(), "./notpresent.js"],
+ env: bunEnv,
+ stdout: "pipe",
+ stderr: "pipe",
+ });
+ expect(stdout.toString()).toBeEmpty();
+ expect(stderr.toString()).toMatch(/module not found/);
+ expect(exitCode).toBe(1);
+ });
+ test("should error with missing file", () => {
+ const { exitCode, stdout, stderr } = spawnSync({
+ cwd,
+ cmd: [bunExe(), "/path/to/notpresent.txt"],
+ env: bunEnv,
+ stdout: "pipe",
+ stderr: "pipe",
+ });
+ expect(stdout.toString()).toBeEmpty();
+ expect(stderr.toString()).toMatch(/file not found/);
+ expect(exitCode).toBe(1);
+ });
+});
+
+describe("bun --if-present", () => {
+ test("should not error with missing script", () => {
+ const { exitCode, stdout, stderr } = spawnSync({
+ cwd,
+ cmd: [bunExe(), "--if-present", "notpresent"],
+ env: bunEnv,
+ stdout: "pipe",
+ stderr: "pipe",
+ });
+ expect(stdout.toString()).toBeEmpty();
+ expect(stderr.toString()).toBeEmpty();
+ expect(exitCode).toBe(0);
+ });
+ test("should not error with missing module", () => {
+ const { exitCode, stdout, stderr } = spawnSync({
+ cwd,
+ cmd: [bunExe(), "--if-present", "./notpresent.js"],
+ env: bunEnv,
+ stdout: "pipe",
+ stderr: "pipe",
+ });
+ expect(stdout.toString()).toBeEmpty();
+ expect(stderr.toString()).toBeEmpty();
+ expect(exitCode).toBe(0);
+ });
+ test("should not error with missing file", () => {
+ const { exitCode, stdout, stderr } = spawnSync({
+ cwd,
+ cmd: [bunExe(), "--if-present", "/path/to/notpresent.txt"],
+ env: bunEnv,
+ stdout: "pipe",
+ stderr: "pipe",
+ });
+ expect(stdout.toString()).toBeEmpty();
+ expect(stderr.toString()).toBeEmpty();
+ expect(exitCode).toBe(0);
+ });
+ test("should run present script", () => {
+ const { exitCode, stdout, stderr } = spawnSync({
+ cwd,
+ cmd: [bunExe(), "run", "present"],
+ env: bunEnv,
+ stdout: "pipe",
+ stderr: "pipe",
+ });
+ expect(stdout.toString()).toMatch(/Here!/);
+ expect(stderr.toString()).not.toBeEmpty();
+ expect(exitCode).toBe(0);
+ });
+ test("should run present module", () => {
+ const { exitCode, stdout, stderr } = spawnSync({
+ cwd,
+ cmd: [bunExe(), "run", "present.js"],
+ env: bunEnv,
+ stdout: "pipe",
+ stderr: "pipe",
+ });
+ expect(stdout.toString()).toMatch(/Here!/);
+ expect(stderr.toString()).toBeEmpty();
+ expect(exitCode).toBe(0);
+ });
+});
diff --git a/test/cli/run/log-test.test.ts b/test/cli/run/log-test.test.ts
index 55c7d6d86..eb15dd592 100644
--- a/test/cli/run/log-test.test.ts
+++ b/test/cli/run/log-test.test.ts
@@ -32,7 +32,7 @@ it("should log .env by default", async () => {
env: bunEnv,
});
- expect(stderr?.toString().includes(".env")).toBe(true);
+ expect(stderr?.toString().includes(".env")).toBe(false);
});
function writeDirectoryTree(base: string, paths: Record<string, any>) {
diff --git a/test/cli/run/require-cache-bug-5188.js b/test/cli/run/require-cache-bug-5188.js
new file mode 100644
index 000000000..5b14e6b4c
--- /dev/null
+++ b/test/cli/run/require-cache-bug-5188.js
@@ -0,0 +1,22 @@
+const { strictEqual, ok } = require("assert");
+
+Loader.registry.set("bad", { evaluated: false });
+strictEqual(require.cache.bad, undefined);
+ok(!Object.hasOwn(require.cache, "bad"));
+ok(!Object.getOwnPropertyNames(require.cache).includes("bad"));
+
+// hard to simplify this test case, but importing this would cause require.cache.extract to be set
+require("msgpackr-extract");
+
+strictEqual(require.cache["extract"], undefined);
+ok(!("extract" in require.cache)); // https://github.com/oven-sh/bun/issues/5898
+ok(!Object.hasOwnProperty.call(require.cache, "extract"));
+ok(!Object.getOwnPropertyNames(require.cache).includes("extract"));
+
+for (const key of Object.keys(require.cache)) {
+ if (!require.cache[key]) {
+ throw new Error("require.cache has an undefined value that was in it's keys");
+ }
+}
+
+console.log("--pass--");
diff --git a/test/cli/run/require-cache-fixture-b.cjs b/test/cli/run/require-cache-fixture-b.cjs
index c3f2c8a26..525d5b3db 100644
--- a/test/cli/run/require-cache-fixture-b.cjs
+++ b/test/cli/run/require-cache-fixture-b.cjs
@@ -6,3 +6,10 @@ if (require.main === module) {
console.error(__filename, module.id);
throw new Error("require.main === module");
}
+
+if (module.parent == null || typeof module.parent !== "object") {
+ console.error(module.parent);
+ throw new Error("module.parent == null");
+}
+
+module.exports = { x: module.parent };
diff --git a/test/cli/run/require-cache-fixture.cjs b/test/cli/run/require-cache-fixture.cjs
index 69f8cebeb..4efb1cd0b 100644
--- a/test/cli/run/require-cache-fixture.cjs
+++ b/test/cli/run/require-cache-fixture.cjs
@@ -8,6 +8,11 @@ if (require.main !== module) {
throw new Error("require.main !== module");
}
+if (module.parent !== null) {
+ console.error(module.parent);
+ throw new Error("module.parent !== null");
+}
+
if (process.mainModule !== module) {
console.error(__filename, module.id);
throw new Error("process.mainModule !== module");
@@ -25,6 +30,11 @@ if (__dirname !== resolve(module.filename, "../")) {
const foo = require("./require-cache-fixture-b.cjs");
+if (foo.x !== module) {
+ console.error(__filename, foo);
+ throw new Error("foo !== module");
+}
+
exports.foo = foo;
var res = require.resolve;
diff --git a/test/cli/run/require-cache.test.js b/test/cli/run/require-cache.test.js
deleted file mode 100644
index e20470f9d..000000000
--- a/test/cli/run/require-cache.test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import { test, expect } from "bun:test";
-import { bunEnv, bunExe } from "harness";
-import { join } from "path";
-
-// This also tests __dirname and __filename
-test("require.cache", () => {
- const { stdout, exitCode } = Bun.spawnSync({
- cmd: [bunExe(), "run", join(import.meta.dir, "require-cache-fixture.cjs")],
- env: bunEnv,
- stderr: "inherit",
- });
-
- expect(stdout.toString().trim().endsWith("--pass--")).toBe(true);
- expect(exitCode).toBe(0);
-});
diff --git a/test/cli/run/require-cache.test.ts b/test/cli/run/require-cache.test.ts
new file mode 100644
index 000000000..77bf5708c
--- /dev/null
+++ b/test/cli/run/require-cache.test.ts
@@ -0,0 +1,27 @@
+import { test, expect } from "bun:test";
+import { bunEnv, bunExe } from "harness";
+import { join } from "path";
+
+// This also tests __dirname and __filename
+test("require.cache", () => {
+ const { stdout, exitCode } = Bun.spawnSync({
+ cmd: [bunExe(), "run", join(import.meta.dir, "require-cache-fixture.cjs")],
+ env: bunEnv,
+ stderr: "inherit",
+ });
+
+ expect(stdout.toString().trim()).toEndWith("--pass--");
+ expect(exitCode).toBe(0);
+});
+
+// https://github.com/oven-sh/bun/issues/5188
+test("require.cache does not include unevaluated modules", () => {
+ const { stdout, exitCode } = Bun.spawnSync({
+ cmd: [bunExe(), "run", join(import.meta.dir, "require-cache-bug-5188.js")],
+ env: bunEnv,
+ stderr: "inherit",
+ });
+
+ expect(stdout.toString().trim()).toEndWith("--pass--");
+ expect(exitCode).toBe(0);
+});
diff --git a/test/cli/run/run-cjs.test.ts b/test/cli/run/run-cjs.test.ts
index 34c77d106..4c0d37002 100644
--- a/test/cli/run/run-cjs.test.ts
+++ b/test/cli/run/run-cjs.test.ts
@@ -4,7 +4,7 @@ import { bunEnv, bunExe } from "harness";
import { tmpdir } from "os";
import { join } from "path";
-test.todo("running a commonjs module works", async () => {
+test("running a commonjs module works", async () => {
const dir = join(realpathSync(tmpdir()), "bun-run-test1");
mkdirSync(dir, { recursive: true });
await Bun.write(join(dir, "index1.js"), "module.exports = 1; console.log('hello world');");
diff --git a/test/cli/run/run-extensionless.test.ts b/test/cli/run/run-extensionless.test.ts
new file mode 100644
index 000000000..642c274d9
--- /dev/null
+++ b/test/cli/run/run-extensionless.test.ts
@@ -0,0 +1,31 @@
+import { expect, test } from "bun:test";
+import { mkdirSync, realpathSync } from "fs";
+import { bunEnv, bunExe } from "harness";
+import { writeFileSync } from "fs";
+import { tmpdir } from "os";
+import { join } from "path";
+
+test("running extensionless file works", async () => {
+ const dir = join(realpathSync(tmpdir()), "bun-run-test1");
+ mkdirSync(dir, { recursive: true });
+ await Bun.write(join(dir, "cool"), "const x: Test = 2; console.log('hello world');");
+ let { stdout } = Bun.spawnSync({
+ cmd: [bunExe(), join(dir, "./cool")],
+ cwd: dir,
+ env: bunEnv,
+ });
+ expect(stdout.toString("utf8")).toEqual("hello world\n");
+});
+
+test("running shebang typescript file works", async () => {
+ const dir = join(realpathSync(tmpdir()), "bun-run-test2");
+ mkdirSync(dir, { recursive: true });
+ writeFileSync(join(dir, "cool"), `#!${bunExe()}\nconst x: Test = 2; console.log('hello world');`, { mode: 0o777 });
+
+ let { stdout } = Bun.spawnSync({
+ cmd: [join(dir, "./cool")],
+ cwd: dir,
+ env: bunEnv,
+ });
+ expect(stdout.toString("utf8")).toEqual("hello world\n");
+});
diff --git a/test/cli/run/run-unicode.test.ts b/test/cli/run/run-unicode.test.ts
new file mode 100644
index 000000000..c1a9c2466
--- /dev/null
+++ b/test/cli/run/run-unicode.test.ts
@@ -0,0 +1,21 @@
+import { expect, test } from "bun:test";
+import { mkdirSync, realpathSync } from "fs";
+import { bunEnv, bunExe } from "harness";
+import { tmpdir } from "os";
+import { join } from "path";
+
+test("running a weird filename works", async () => {
+ const troll = "💥'\"​\n";
+ const dir = join(realpathSync(tmpdir()), "bun-run-test" + troll);
+ mkdirSync(dir, { recursive: true });
+ console.log("dir", dir);
+ // i this it's possible that the filesystem rejects the path
+ await Bun.write(join(dir, troll + ".js"), "console.log('hello world');");
+ let { stdout } = Bun.spawnSync({
+ cmd: [bunExe(), join(dir, troll + ".js")],
+ cwd: dir,
+ env: bunEnv,
+ stdio: ["ignore", "pipe", "inherit"],
+ });
+ expect(stdout.toString("utf8")).toEqual("hello world\n");
+});
diff --git a/test/cli/test/bun-test.test.ts b/test/cli/test/bun-test.test.ts
index dfd64b18b..0896cae1a 100644
--- a/test/cli/test/bun-test.test.ts
+++ b/test/cli/test/bun-test.test.ts
@@ -135,6 +135,29 @@ describe("bun test", () => {
});
});
describe("--only", () => {
+ test("should run nested describe.only when enabled", () => {
+ const stderr = runTest({
+ args: ["--only"],
+ input: `
+ import { test, describe } from "bun:test";
+ describe("outer", () => {
+ describe.only("inner (nested)", () => {
+ test("test", () => {
+ console.error("reachable");
+ })
+ })
+ describe("inner (skipped)", () => {
+ test("test", () => {
+ console.error("unreachable");
+ })
+ })
+ })
+ `,
+ });
+ expect(stderr).toContain("reachable");
+ expect(stderr).not.toContain("unreachable");
+ expect(stderr.match(/reachable/g)).toHaveLength(1);
+ });
test("should skip non-only tests when enabled", () => {
const stderr = runTest({
args: ["--only"],
diff --git a/test/harness.ts b/test/harness.ts
index f6c0f0e98..77b4b4f43 100644
--- a/test/harness.ts
+++ b/test/harness.ts
@@ -7,6 +7,7 @@ export const bunEnv: any = {
NO_COLOR: "1",
FORCE_COLOR: undefined,
TZ: "Etc/UTC",
+ CI: "1",
};
export function bunExe() {
@@ -83,7 +84,7 @@ export function hideFromStackTrace(block: CallableFunction) {
});
}
-export function tempDirWithFiles(basename: string, files: Record<string, string | Record<string, string>>) {
+export function tempDirWithFiles(basename: string, files: Record<string, string | Record<string, string>>): string {
var fs = require("fs");
var path = require("path");
var { tmpdir } = require("os");
diff --git a/test/integration/next/default-pages-dir/.eslintrc.json b/test/integration/next/default-pages-dir/.eslintrc.json
new file mode 100644
index 000000000..bffb357a7
--- /dev/null
+++ b/test/integration/next/default-pages-dir/.eslintrc.json
@@ -0,0 +1,3 @@
+{
+ "extends": "next/core-web-vitals"
+}
diff --git a/test/integration/next/default-pages-dir/.gitignore b/test/integration/next/default-pages-dir/.gitignore
new file mode 100644
index 000000000..412289e0b
--- /dev/null
+++ b/test/integration/next/default-pages-dir/.gitignore
@@ -0,0 +1,38 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+
+# testing
+/coverage
+
+# next.js
+/.next/
+/out/
+
+# production
+/build
+
+# misc
+.DS_Store
+*.pem
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# local env files
+.env*.local
+
+# vercel
+.vercel
+
+# typescript
+*.tsbuildinfo
+next-env.d.ts
+
+# fixtures
+src/Counter.tsx \ No newline at end of file
diff --git a/test/integration/next/default-pages-dir/README.md b/test/integration/next/default-pages-dir/README.md
new file mode 100644
index 000000000..a75ac5248
--- /dev/null
+++ b/test/integration/next/default-pages-dir/README.md
@@ -0,0 +1,40 @@
+This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
+
+## Getting Started
+
+First, run the development server:
+
+```bash
+npm run dev
+# or
+yarn dev
+# or
+pnpm dev
+# or
+bun dev
+```
+
+Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
+
+You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
+
+[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
+
+The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
+
+This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
+
+## Learn More
+
+To learn more about Next.js, take a look at the following resources:
+
+- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
+- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
+
+You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
+
+## Deploy on Vercel
+
+The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
+
+Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
diff --git a/test/integration/next/default-pages-dir/bun.lockb b/test/integration/next/default-pages-dir/bun.lockb
new file mode 100755
index 000000000..4c97b0398
--- /dev/null
+++ b/test/integration/next/default-pages-dir/bun.lockb
Binary files differ
diff --git a/test/integration/next/default-pages-dir/next.config.js b/test/integration/next/default-pages-dir/next.config.js
new file mode 100644
index 000000000..5a35883f4
--- /dev/null
+++ b/test/integration/next/default-pages-dir/next.config.js
@@ -0,0 +1,10 @@
+/** @type {import('next').NextConfig} */
+const nextConfig = {
+ reactStrictMode: true,
+ generateBuildId: async () => {
+ // You can, for example, get the latest git commit hash here
+ return "bun!";
+ },
+};
+
+module.exports = nextConfig;
diff --git a/test/integration/next/default-pages-dir/package.json b/test/integration/next/default-pages-dir/package.json
new file mode 100644
index 000000000..b3f1d3616
--- /dev/null
+++ b/test/integration/next/default-pages-dir/package.json
@@ -0,0 +1,28 @@
+{
+ "name": "default-create-template",
+ "version": "0.1.0",
+ "private": true,
+ "scripts": {
+ "dev": "next dev",
+ "build": "next build",
+ "start": "next start",
+ "lint": "next lint",
+ "postinstall": "cd node_modules/puppeteer && bun install.mjs"
+ },
+ "dependencies": {
+ "@types/node": "20.7.0",
+ "@types/react": "18.2.22",
+ "@types/react-dom": "18.2.7",
+ "autoprefixer": "10.4.16",
+ "bun-types": "^1.0.3",
+ "eslint": "8.50.0",
+ "eslint-config-next": "13.5.3",
+ "next": "13.5.3",
+ "postcss": "8.4.30",
+ "puppeteer": "21.3.4",
+ "react": "18.2.0",
+ "react-dom": "18.2.0",
+ "tailwindcss": "3.3.3",
+ "typescript": "5.2.2"
+ }
+}
diff --git a/test/integration/next/default-pages-dir/postcss.config.js b/test/integration/next/default-pages-dir/postcss.config.js
new file mode 100644
index 000000000..12a703d90
--- /dev/null
+++ b/test/integration/next/default-pages-dir/postcss.config.js
@@ -0,0 +1,6 @@
+module.exports = {
+ plugins: {
+ tailwindcss: {},
+ autoprefixer: {},
+ },
+};
diff --git a/test/integration/next/default-pages-dir/public/favicon.ico b/test/integration/next/default-pages-dir/public/favicon.ico
new file mode 100644
index 000000000..718d6fea4
--- /dev/null
+++ b/test/integration/next/default-pages-dir/public/favicon.ico
Binary files differ
diff --git a/test/integration/next/default-pages-dir/public/next.svg b/test/integration/next/default-pages-dir/public/next.svg
new file mode 100644
index 000000000..5174b28c5
--- /dev/null
+++ b/test/integration/next/default-pages-dir/public/next.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg> \ No newline at end of file
diff --git a/test/integration/next/default-pages-dir/public/vercel.svg b/test/integration/next/default-pages-dir/public/vercel.svg
new file mode 100644
index 000000000..d2f842227
--- /dev/null
+++ b/test/integration/next/default-pages-dir/public/vercel.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-11-8-18-19-18zm-10 15c2-4 5-7 10-7s8 3 9 7h-19zm-39 3c0 6 4 10 10 10 4 0 7-2 9-5l8 5c-3 5-9 8-17 8-11 0-19-7-19-18s8-18 19-18c8 0 14 3 17 8l-8 5c-2-3-5-5-9-5-6 0-10 4-10 10zm83-29v46h-9V5h9zM37 0l37 64H0L37 0zm92 5-27 48L74 5h10l18 30 17-30h10zm59 12v10l-3-1c-6 0-10 4-10 10v15h-9V17h9v9c0-5 6-9 13-9z"/></svg> \ No newline at end of file
diff --git a/test/integration/next/default-pages-dir/src/Counter1.txt b/test/integration/next/default-pages-dir/src/Counter1.txt
new file mode 100644
index 000000000..3973e0125
--- /dev/null
+++ b/test/integration/next/default-pages-dir/src/Counter1.txt
@@ -0,0 +1,27 @@
+import { useState } from "react";
+
+export function Counter() {
+ console.log('counter a');
+
+ const [count, setCount] = useState(0);
+
+ function increment() {
+ setCount(count + 1);
+ }
+
+ function decrement() {
+ setCount(count - 1);
+ }
+
+ return (
+ <div id="counter-fixture" className="rounded-bl-full">
+ <p>Count A: {count}</p>
+ <button className="inc" onClick={increment}>
+ +
+ </button>
+ <button className="dec" onClick={decrement}>
+ -
+ </button>
+ </div>
+ );
+}
diff --git a/test/integration/next/default-pages-dir/src/Counter2.txt b/test/integration/next/default-pages-dir/src/Counter2.txt
new file mode 100644
index 000000000..67541a78b
--- /dev/null
+++ b/test/integration/next/default-pages-dir/src/Counter2.txt
@@ -0,0 +1,27 @@
+import { useState } from "react";
+
+export function Counter() {
+ console.log('counter b loaded');
+
+ const [count, setCount] = useState(0);
+
+ function increment() {
+ setCount(count + 2);
+ }
+
+ function decrement() {
+ setCount(count - 2);
+ }
+
+ return (
+ <div id="counter-fixture" className="rounded-br-full">
+ <p>Count B: {count}</p>
+ <button className="inc" onClick={increment}>
+ +
+ </button>
+ <button className="dec" onClick={decrement}>
+ -
+ </button>
+ </div>
+ );
+}
diff --git a/test/integration/next/default-pages-dir/src/pages/_app.tsx b/test/integration/next/default-pages-dir/src/pages/_app.tsx
new file mode 100644
index 000000000..a7a790fba
--- /dev/null
+++ b/test/integration/next/default-pages-dir/src/pages/_app.tsx
@@ -0,0 +1,6 @@
+import "@/styles/globals.css";
+import type { AppProps } from "next/app";
+
+export default function App({ Component, pageProps }: AppProps) {
+ return <Component {...pageProps} />;
+}
diff --git a/test/integration/next/default-pages-dir/src/pages/_document.tsx b/test/integration/next/default-pages-dir/src/pages/_document.tsx
new file mode 100644
index 000000000..b2fff8b42
--- /dev/null
+++ b/test/integration/next/default-pages-dir/src/pages/_document.tsx
@@ -0,0 +1,13 @@
+import { Html, Head, Main, NextScript } from "next/document";
+
+export default function Document() {
+ return (
+ <Html lang="en">
+ <Head />
+ <body>
+ <Main />
+ <NextScript />
+ </body>
+ </Html>
+ );
+}
diff --git a/test/integration/next/default-pages-dir/src/pages/api/hello.ts b/test/integration/next/default-pages-dir/src/pages/api/hello.ts
new file mode 100644
index 000000000..a8d68697c
--- /dev/null
+++ b/test/integration/next/default-pages-dir/src/pages/api/hello.ts
@@ -0,0 +1,10 @@
+// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
+import type { NextApiRequest, NextApiResponse } from "next";
+
+type Data = {
+ name: string;
+};
+
+export default function handler(req: NextApiRequest, res: NextApiResponse<Data>) {
+ res.status(200).json({ name: "John Doe" });
+}
diff --git a/test/integration/next/default-pages-dir/src/pages/index.tsx b/test/integration/next/default-pages-dir/src/pages/index.tsx
new file mode 100644
index 000000000..109f5e5e2
--- /dev/null
+++ b/test/integration/next/default-pages-dir/src/pages/index.tsx
@@ -0,0 +1,128 @@
+import Image from "next/image";
+import { Inter } from "next/font/google";
+import Head from "next/head";
+import { Counter } from "@/Counter";
+
+const inter = Inter({ subsets: ["latin"] });
+
+export default function Home({ bunVersion }: any) {
+ return (
+ <main className={`flex min-h-screen flex-col items-center justify-between p-24 ${inter.className}`}>
+ <Head>
+ <meta name="description" content="HEY YOU" />
+ <title>Create Next App</title>
+ </Head>
+
+ <div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex">
+ <p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
+ Bun Version:
+ <code className="font-mono font-bold">{bunVersion}</code>
+ </p>
+ <div className="fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-gradient-to-t from-white via-white dark:from-black dark:via-black lg:static lg:h-auto lg:w-auto lg:bg-none">
+ <a
+ className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
+ href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ By <Image src="/vercel.svg" alt="Vercel Logo" className="dark:invert" width={100} height={24} priority />
+ </a>
+ </div>
+ </div>
+
+ <div className="relative flex place-items-center before:absolute before:h-[300px] before:w-[480px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-[240px] after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700/10 after:dark:from-sky-900 after:dark:via-[#0141ff]/40 before:lg:h-[360px]">
+ <Image
+ className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
+ src="/next.svg"
+ alt="Next.js Logo"
+ width={180}
+ height={37}
+ priority
+ />
+ </div>
+
+ <Counter />
+
+ <div className="mb-32 grid text-center lg:max-w-5xl lg:w-full lg:mb-0 lg:grid-cols-4 lg:text-left">
+ <a
+ href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app"
+ className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <h2 className={`mb-3 text-2xl font-semibold`}>
+ Docs{" "}
+ <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
+ -&gt;
+ </span>
+ </h2>
+ <p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
+ Find in-depth information about Next.js features and API.
+ </p>
+ </a>
+
+ <a
+ href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app"
+ className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <h2 className={`mb-3 text-2xl font-semibold`}>
+ Learn{" "}
+ <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
+ -&gt;
+ </span>
+ </h2>
+ <p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
+ Learn about Next.js in an interactive course with&nbsp;quizzes!
+ </p>
+ </a>
+
+ <a
+ href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app"
+ className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <h2 className={`mb-3 text-2xl font-semibold`}>
+ Templates{" "}
+ <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
+ -&gt;
+ </span>
+ </h2>
+ <p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
+ Discover and deploy boilerplate example Next.js&nbsp;projects.
+ </p>
+ </a>
+
+ <a
+ href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app"
+ className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <h2 className={`mb-3 text-2xl font-semibold`}>
+ Deploy{" "}
+ <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
+ -&gt;
+ </span>
+ </h2>
+ <p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
+ Instantly deploy your Next.js site to a shareable URL with Vercel.
+ </p>
+ </a>
+ </div>
+ </main>
+ );
+}
+
+export async function getStaticProps() {
+ return {
+ props: {
+ bunVersion:
+ process.env.NODE_ENV === "production"
+ ? "[production needs a constant string]"
+ : process.versions.bun ?? "not in bun",
+ },
+ };
+}
diff --git a/test/integration/next/default-pages-dir/src/styles/globals.css b/test/integration/next/default-pages-dir/src/styles/globals.css
new file mode 100644
index 000000000..fd81e8858
--- /dev/null
+++ b/test/integration/next/default-pages-dir/src/styles/globals.css
@@ -0,0 +1,27 @@
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
+
+:root {
+ --foreground-rgb: 0, 0, 0;
+ --background-start-rgb: 214, 219, 220;
+ --background-end-rgb: 255, 255, 255;
+}
+
+@media (prefers-color-scheme: dark) {
+ :root {
+ --foreground-rgb: 255, 255, 255;
+ --background-start-rgb: 0, 0, 0;
+ --background-end-rgb: 0, 0, 0;
+ }
+}
+
+body {
+ color: rgb(var(--foreground-rgb));
+ background: linear-gradient(
+ to bottom,
+ transparent,
+ rgb(var(--background-end-rgb))
+ )
+ rgb(var(--background-start-rgb));
+}
diff --git a/test/integration/next/default-pages-dir/tailwind.config.ts b/test/integration/next/default-pages-dir/tailwind.config.ts
new file mode 100644
index 000000000..168556c68
--- /dev/null
+++ b/test/integration/next/default-pages-dir/tailwind.config.ts
@@ -0,0 +1,19 @@
+import type { Config } from "tailwindcss";
+
+const config: Config = {
+ content: [
+ // './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
+ "./src/**/*.{js,ts,jsx,tsx,mdx}",
+ // './src/app/**/*.{js,ts,jsx,tsx,mdx}',
+ ],
+ theme: {
+ extend: {
+ backgroundImage: {
+ "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
+ "gradient-conic": "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
+ },
+ },
+ },
+ plugins: [],
+};
+export default config;
diff --git a/test/integration/next/default-pages-dir/test/dev-server-puppeteer.ts b/test/integration/next/default-pages-dir/test/dev-server-puppeteer.ts
new file mode 100644
index 000000000..9bebeb614
--- /dev/null
+++ b/test/integration/next/default-pages-dir/test/dev-server-puppeteer.ts
@@ -0,0 +1,101 @@
+import { ConsoleMessage, Page, launch } from "puppeteer";
+import assert from "assert";
+import { copyFileSync } from "fs";
+import { join } from "path";
+
+const root = join(import.meta.dir, "../");
+
+copyFileSync(join(root, "src/Counter1.txt"), join(root, "src/Counter.tsx"));
+
+let url = "http://localhost:3000";
+if (process.argv.length > 2) {
+ url = process.argv[2];
+}
+
+const b = await launch({
+ headless: "new",
+});
+
+const p = await b.newPage();
+// p.on("console", msg => console.log("[browser]", msg.text()));
+
+function waitForConsoleMessage(page: Page, regex: RegExp) {
+ const { resolve, promise } = Promise.withResolvers<void>();
+ function onMessage(msg: ConsoleMessage) {
+ const text = msg.text();
+ if (regex.test(text)) {
+ page.off("console", onMessage);
+ resolve();
+ }
+ }
+ p.on("console", onMessage);
+ return promise;
+}
+
+await p.goto(url);
+await waitForConsoleMessage(p, /counter a/);
+
+assert.strictEqual(await p.$eval("code.font-bold", x => x.innerText), Bun.version);
+
+let counter_root = (await p.$("#counter-fixture"))!;
+
+{
+ const [has_class, style_json_string] = await counter_root.evaluate(
+ x => [(x as HTMLElement).classList.contains("rounded-bl-full"), JSON.stringify(getComputedStyle(x))] as const,
+ );
+ assert.strictEqual(has_class, true);
+ const decoded_style = JSON.parse(style_json_string);
+ assert.strictEqual(decoded_style.borderTopLeftRadius, "0px");
+ assert.strictEqual(decoded_style.borderTopRightRadius, "0px");
+ assert.strictEqual(decoded_style.borderBottomRightRadius, "0px");
+ assert.strictEqual(decoded_style.borderBottomLeftRadius, "9999px");
+}
+
+const getCount = () => counter_root.$eval("p", x => x.innerText);
+
+assert.strictEqual(await getCount(), "Count A: 0");
+await counter_root.$eval(".inc", x => (x as HTMLElement).click());
+assert.strictEqual(await getCount(), "Count A: 1");
+await counter_root.$eval(".inc", x => (x as HTMLElement).click());
+assert.strictEqual(await getCount(), "Count A: 2");
+await counter_root.$eval(".dec", x => (x as HTMLElement).click());
+assert.strictEqual(await getCount(), "Count A: 1");
+
+p.reload({});
+await waitForConsoleMessage(p, /counter a/);
+
+assert.strictEqual(await p.$eval("code.font-bold", x => x.innerText), Bun.version);
+
+counter_root = (await p.$("#counter-fixture"))!;
+
+assert.strictEqual(await getCount(), "Count A: 0");
+await counter_root.$eval(".inc", x => (x as HTMLElement).click());
+assert.strictEqual(await getCount(), "Count A: 1");
+await counter_root.$eval(".inc", x => (x as HTMLElement).click());
+assert.strictEqual(await getCount(), "Count A: 2");
+await counter_root.$eval(".dec", x => (x as HTMLElement).click());
+assert.strictEqual(await getCount(), "Count A: 1");
+
+copyFileSync(join(root, "src/Counter2.txt"), join(root, "src/Counter.tsx"));
+await waitForConsoleMessage(p, /counter b loaded/);
+assert.strictEqual(await getCount(), "Count B: 1");
+await counter_root.$eval(".inc", x => (x as HTMLElement).click());
+assert.strictEqual(await getCount(), "Count B: 3");
+await counter_root.$eval(".inc", x => (x as HTMLElement).click());
+assert.strictEqual(await getCount(), "Count B: 5");
+await counter_root.$eval(".dec", x => (x as HTMLElement).click());
+assert.strictEqual(await getCount(), "Count B: 3");
+
+{
+ const [has_class, style_json_string] = await counter_root.evaluate(
+ x => [(x as HTMLElement).classList.contains("rounded-br-full"), JSON.stringify(getComputedStyle(x))] as const,
+ );
+ assert.strictEqual(has_class, true);
+ const decoded_style = JSON.parse(style_json_string);
+ assert.strictEqual(decoded_style.borderTopLeftRadius, "0px");
+ assert.strictEqual(decoded_style.borderTopRightRadius, "0px");
+ assert.strictEqual(decoded_style.borderBottomRightRadius, "9999px");
+ assert.strictEqual(decoded_style.borderBottomLeftRadius, "0px");
+}
+
+await b.close();
diff --git a/test/integration/next/default-pages-dir/test/dev-server.test.ts b/test/integration/next/default-pages-dir/test/dev-server.test.ts
new file mode 100644
index 000000000..8723a91c2
--- /dev/null
+++ b/test/integration/next/default-pages-dir/test/dev-server.test.ts
@@ -0,0 +1,79 @@
+import { afterAll, beforeAll, describe, expect, test } from "bun:test";
+import { bunEnv, bunExe } from "../../../../harness";
+import { Subprocess } from "bun";
+import { copyFileSync, rmSync } from "fs";
+import { join } from "path";
+
+const root = join(import.meta.dir, "../");
+let dev_server: undefined | Subprocess<"ignore", "pipe", "inherit">;
+let baseUrl: string;
+
+test("the dev server can start", async () => {
+ rmSync(join(root, ".next"), { recursive: true, force: true });
+ copyFileSync(join(root, "src/Counter1.txt"), join(root, "src/Counter.tsx"));
+
+ const install = Bun.spawnSync([bunExe(), "i"], { cwd: root, env: bunEnv });
+ if (install.exitCode !== 0) {
+ throw new Error("Failed to install dependencies");
+ }
+ dev_server = Bun.spawn([bunExe(), "--bun", "node_modules/.bin/next", "dev"], {
+ cwd: root,
+ env: bunEnv,
+ stdio: ["ignore", "pipe", "inherit"],
+ });
+ dev_server.exited.then(() => {
+ dev_server = undefined;
+ });
+ for await (const chunk of dev_server.stdout) {
+ console.error({ chunk });
+ const str = new TextDecoder().decode(chunk);
+ let match = str.match(/http:\/\/localhost:\d+/);
+ if (match) {
+ baseUrl = match[0];
+ }
+ if (str.toLowerCase().includes("ready")) {
+ return;
+ }
+ }
+ console.error("Failed to start dev server :/");
+ dev_server.kill();
+ dev_server = undefined;
+}, 30000);
+
+test("ssr works for 100 requests", async () => {
+ expect(dev_server).not.toBeUndefined();
+ expect(baseUrl).not.toBeUndefined();
+
+ const promises = [];
+ for (let i = 0; i < 100; i++) {
+ promises.push(
+ (async () => {
+ const x = await fetch(`${baseUrl}/`);
+ expect(x.status).toBe(200);
+ const text = await x.text();
+ expect(text).toContain(`>${Bun.version}</code>`);
+ })(),
+ );
+ }
+
+ const x = await Promise.allSettled(promises);
+ for (const y of x) {
+ expect(y.status).toBe("fulfilled");
+ }
+}, 10000);
+
+test("hot reloading works on the client (+ tailwind hmr)", async () => {
+ expect(dev_server).not.toBeUndefined();
+ expect(baseUrl).not.toBeUndefined();
+
+ const result = Bun.spawnSync([bunExe(), "test/dev-server-puppeteer.ts", baseUrl], {
+ cwd: root,
+ env: bunEnv,
+ stdio: ["ignore", "inherit", "inherit"],
+ });
+ expect(result.exitCode).toBe(0);
+}, 30000);
+
+afterAll(() => {
+ Bun.spawnSync(["pkill", "-P", dev_server!.pid.toString()]);
+});
diff --git a/test/integration/next/default-pages-dir/test/next-build.test.ts b/test/integration/next/default-pages-dir/test/next-build.test.ts
new file mode 100644
index 000000000..0a00c158e
--- /dev/null
+++ b/test/integration/next/default-pages-dir/test/next-build.test.ts
@@ -0,0 +1,141 @@
+import { afterAll, beforeAll, describe, expect, test } from "bun:test";
+import { bunEnv, bunExe } from "../../../../harness";
+import { copyFileSync, cpSync, mkdtempSync, readFileSync, readdirSync, rmSync, symlinkSync, writeFileSync } from "fs";
+import { tmpdir } from "os";
+import { join } from "path";
+import { cp } from "fs/promises";
+
+const root = join(import.meta.dir, "../");
+
+let build_passed = false;
+
+async function tempDirToBuildIn() {
+ const dir = mkdtempSync(join(tmpdir(), "bun-next-build-"));
+ const copy = [
+ ".eslintrc.json",
+ "bun.lockb",
+ "next.config.js",
+ "next.config.js",
+ "package.json",
+ "postcss.config.js",
+ "public",
+ "src",
+ "tailwind.config.ts",
+ ];
+ await Promise.all(copy.map(x => cp(join(root, x), join(dir, x), { recursive: true })));
+ cpSync(join(root, "src/Counter1.txt"), join(dir, "src/Counter.tsx"));
+ cpSync(join(root, "tsconfig_for_build.json"), join(dir, "tsconfig.json"));
+ symlinkSync(join(root, "node_modules"), join(dir, "node_modules"));
+ return dir;
+}
+
+function readdirRecursive(dir: string) {
+ let results: string[] = [];
+
+ readdirSync(dir, { withFileTypes: true }).forEach(file => {
+ if (file.isDirectory()) {
+ results = results.concat(readdirRecursive(join(dir, file.name)).map(x => join(file.name, x)));
+ } else {
+ results.push(file.name);
+ }
+ });
+
+ return results;
+}
+
+function hashAllFiles(dir: string) {
+ const files = readdirRecursive(dir).sort();
+ const hashes: Record<string, string> = {};
+ for (const file of files) {
+ const hash = new Bun.CryptoHasher("sha256");
+ hash.update(readFileSync(join(dir, file)));
+ hashes[file] = hash.digest("hex");
+ }
+ return hashes;
+}
+
+test("next build works", async () => {
+ copyFileSync(join(root, "src/Counter1.txt"), join(root, "src/Counter.tsx"));
+
+ const install = Bun.spawnSync([bunExe(), "i"], { cwd: root, env: bunEnv });
+ if (install.exitCode !== 0) {
+ throw new Error("Failed to install dependencies");
+ }
+
+ const bunDir = await tempDirToBuildIn();
+ const nodeDir = await tempDirToBuildIn();
+
+ const bunBuild = await Bun.spawn([bunExe(), "--bun", "node_modules/.bin/next", "build"], {
+ cwd: bunDir,
+ // env: bunEnv,
+ stdio: ["ignore", "pipe", "inherit"],
+ env: {
+ ...bunEnv,
+ NODE_ENV: "production",
+ },
+ });
+ const nodeBuild = await Bun.spawn(["node", "node_modules/.bin/next", "build"], {
+ cwd: nodeDir,
+ env: bunEnv,
+ stdio: ["ignore", "pipe", "inherit"],
+ });
+ await Promise.all([bunBuild.exited, nodeBuild.exited]);
+ expect(nodeBuild.exitCode).toBe(0);
+ expect(bunBuild.exitCode).toBe(0);
+
+ const bunCliOutput = await Bun.readableStreamToText(bunBuild.stdout);
+ const nodeCliOutput = await Bun.readableStreamToText(nodeBuild.stdout);
+
+ expect(bunCliOutput).toBe(nodeCliOutput);
+
+ const bunBuildDir = join(bunDir, ".next");
+ const nodeBuildDir = join(nodeDir, ".next");
+
+ const toRemove = [
+ // these have timestamps and absolute paths in them
+ "trace",
+ "cache",
+ "required-server-files.json",
+ // these have "signing keys", not sure what they are tbh
+ "prerender-manifest.json",
+ "prerender-manifest.js",
+ // these are similar but i feel like there might be something we can fix to make them the same
+ "next-minimal-server.js.nft.json",
+ "next-server.js.nft.json",
+ // not sorted lol
+ "server/pages-manifest.json",
+ ];
+ for (const key of toRemove) {
+ rmSync(join(bunBuildDir, key), { recursive: true });
+ rmSync(join(nodeBuildDir, key), { recursive: true });
+ }
+
+ const bunBuildHash = hashAllFiles(bunBuildDir);
+ const nodeBuildHash = hashAllFiles(nodeBuildDir);
+
+ try {
+ expect(bunBuildHash).toEqual(nodeBuildHash);
+ } catch (error) {
+ console.log("bunBuildDir", bunBuildDir);
+ console.log("nodeBuildDir", nodeBuildDir);
+
+ // print diffs for every file if not the same
+ for (const key in bunBuildHash) {
+ if (bunBuildHash[key] !== nodeBuildHash[key]) {
+ console.log(key + ":");
+ try {
+ expect(readFileSync(join(bunBuildDir, key)).toString()).toBe(
+ readFileSync(join(nodeBuildDir, key)).toString(),
+ );
+ } catch (error) {
+ console.error(error);
+ }
+ }
+ }
+ throw error;
+ }
+
+ build_passed = true;
+}, 300000);
+
+const version_string = "[production needs a constant string]";
diff --git a/test/integration/next/default-pages-dir/tsconfig.json b/test/integration/next/default-pages-dir/tsconfig.json
new file mode 100644
index 000000000..b8629571f
--- /dev/null
+++ b/test/integration/next/default-pages-dir/tsconfig.json
@@ -0,0 +1,22 @@
+{
+ "compilerOptions": {
+ "target": "ESNext",
+ "lib": ["dom", "dom.iterable", "esnext"],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "module": "esnext",
+ "moduleResolution": "bundler",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "jsx": "preserve",
+ "incremental": true,
+ "paths": {
+ "@/*": ["./src/*"]
+ }
+ },
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "../../../../packages/bun-types/dist/types.d.ts"],
+ "exclude": ["node_modules"]
+}
diff --git a/test/integration/next/default-pages-dir/tsconfig_for_build.json b/test/integration/next/default-pages-dir/tsconfig_for_build.json
new file mode 100644
index 000000000..476ee3ebc
--- /dev/null
+++ b/test/integration/next/default-pages-dir/tsconfig_for_build.json
@@ -0,0 +1,23 @@
+{
+ "compilerOptions": {
+ "target": "ESNext",
+ "lib": ["dom", "dom.iterable", "esnext"],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "module": "esnext",
+ "moduleResolution": "bundler",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "jsx": "preserve",
+ "incremental": true,
+ "paths": {
+ "@/*": ["./src/*"]
+ },
+ "types": ["bun-types"]
+ },
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
+ "exclude": ["node_modules"]
+}
diff --git a/test/js/bun/console/console-iterator-run-2.ts b/test/js/bun/console/console-iterator-run-2.ts
new file mode 100644
index 000000000..dba658821
--- /dev/null
+++ b/test/js/bun/console/console-iterator-run-2.ts
@@ -0,0 +1,16 @@
+async function readInput() {
+ let items = [];
+ for await (const line of console) {
+ if (line == "break") {
+ break;
+ }
+ items.push(line);
+ }
+ return items;
+}
+
+const a = await readInput();
+console.write(JSON.stringify(a));
+
+const b = await readInput();
+console.write(JSON.stringify(b));
diff --git a/test/js/bun/console/console-iterator-run.js b/test/js/bun/console/console-iterator-run.ts
index 7664c85a1..7664c85a1 100644
--- a/test/js/bun/console/console-iterator-run.js
+++ b/test/js/bun/console/console-iterator-run.ts
diff --git a/test/js/bun/console/console-iterator.test.js b/test/js/bun/console/console-iterator.test.ts
index 89894fd72..6c1062544 100644
--- a/test/js/bun/console/console-iterator.test.js
+++ b/test/js/bun/console/console-iterator.test.ts
@@ -16,7 +16,7 @@ describe("should work for static input", () => {
for (let input of inputs) {
it(input.replaceAll("\n", "\\n"), () => {
const { stdout } = spawnSync({
- cmd: [bunExe(), import.meta.dir + "/" + "console-iterator-run.js"],
+ cmd: [bunExe(), import.meta.dir + "/" + "console-iterator-run.ts"],
stdin: Buffer.from(input),
env: {
BUN_DEBUG_QUIET_LOGS: "1",
@@ -41,7 +41,7 @@ describe("should work for streaming input", () => {
for (let input of inputs) {
it(input.replaceAll("\n", "\\n"), async () => {
const proc = spawn({
- cmd: [bunExe(), import.meta.dir + "/" + "console-iterator-run.js"],
+ cmd: [bunExe(), import.meta.dir + "/" + "console-iterator-run.ts"],
stdin: "pipe",
stdout: "pipe",
env: {
@@ -61,3 +61,22 @@ describe("should work for streaming input", () => {
});
}
});
+
+// https://github.com/oven-sh/bun/issues/5175
+it("can use the console iterator more than once", async () => {
+ const proc = spawn({
+ cmd: [bunExe(), import.meta.dir + "/" + "console-iterator-run-2.ts"],
+ stdin: "pipe",
+ stdout: "pipe",
+ env: {
+ BUN_DEBUG_QUIET_LOGS: "1",
+ },
+ });
+ const { stdout, stdin } = proc;
+ stdin.write("hello\nworld\nbreak\nanother\nbreak\n");
+ stdin.flush();
+ stdin.end();
+
+ expect(await new Response(stdout).text()).toBe('["hello","world"]["another"]');
+ proc.kill(0);
+});
diff --git a/test/js/bun/deletable-globals-fixture.js b/test/js/bun/deletable-globals-fixture.js
new file mode 100644
index 000000000..b67b9ac43
--- /dev/null
+++ b/test/js/bun/deletable-globals-fixture.js
@@ -0,0 +1,10 @@
+const { ok, strictEqual: eql } = require("assert");
+
+const globals = ["Blob", "fetch", "Headers", "Request", "Response", "setTimeout", "clearTimeout", "setInterval"];
+for (let name of globals) {
+ ok(delete globalThis[name]);
+ eql(globalThis[name], undefined);
+ globalThis[name] = 123;
+ eql(globalThis[name], 123);
+}
+console.log("--pass--");
diff --git a/test/js/bun/dns/resolve-dns.test.ts b/test/js/bun/dns/resolve-dns.test.ts
index 6102b0745..57b3a50c7 100644
--- a/test/js/bun/dns/resolve-dns.test.ts
+++ b/test/js/bun/dns/resolve-dns.test.ts
@@ -1,50 +1,96 @@
import { dns } from "bun";
import { describe, expect, it, test } from "bun:test";
import { withoutAggressiveGC } from "harness";
+import { isIP, isIPv4, isIPv6 } from "node:net";
-describe("dns.lookup", () => {
- const backends = [process.platform === "darwin" ? "system" : undefined, "libc", "c-ares"].filter(x => !!x) as (
- | "system"
- | "libc"
- | "c-ares"
- )[];
- for (let backend of backends) {
- it(backend + " parallell x 10", async () => {
- const promises = [];
- for (let i = 0; i < 10; i++) {
- promises.push(dns.lookup("localhost", { backend }));
- }
- const results = (await Promise.all(promises)).flat();
- withoutAggressiveGC(() => {
- for (let { family, address } of results) {
- if (family === 4) {
- expect(address).toBe("127.0.0.1");
- } else if (family === 6) {
- expect(address).toBe("::1");
- } else {
- throw new Error("Unknown family");
+const backends = ["system", "libc", "c-ares"];
+const validHostnames = ["localhost", "example.com"];
+const invalidHostnames = [`this-should-not-exist-${Math.floor(Math.random() * 99999)}.com`];
+const malformedHostnames = ["", " ", ".", " .", "localhost:80", "this is not a hostname"];
+
+describe("dns", () => {
+ describe.each(backends)("lookup() [backend: %s]", backend => {
+ describe.each(validHostnames)("%s", hostname => {
+ test.each([
+ {
+ options: { backend },
+ address: isIP,
+ },
+ {
+ options: { backend, family: 4 },
+ address: isIPv4,
+ family: 4,
+ },
+ {
+ options: { backend, family: "IPv4" },
+ address: isIPv4,
+ family: 4,
+ },
+ {
+ options: { backend, family: 6 },
+ address: isIPv6,
+ family: 6,
+ },
+ {
+ options: { backend, family: "IPv6" },
+ address: isIPv6,
+ family: 6,
+ },
+ {
+ options: { backend, family: 0 },
+ address: isIP,
+ },
+ {
+ options: { backend, family: "any" },
+ address: isIP,
+ },
+ ])("%j", async ({ options, address: expectedAddress, family: expectedFamily }) => {
+ // @ts-expect-error
+ const result = await dns.lookup(hostname, options);
+ expect(result).toBeArray();
+ expect(result.length).toBeGreaterThan(0);
+ withoutAggressiveGC(() => {
+ for (const { family, address, ttl } of result) {
+ expect(address).toBeString();
+ expect(expectedAddress(address)).toBeTruthy();
+ expect(family).toBeInteger();
+ if (expectedFamily !== undefined) {
+ expect(family).toBe(expectedFamily);
+ }
+ expect(ttl).toBeInteger();
}
- }
+ });
});
});
-
- it(backend + " remote", async () => {
- const [first, second] = await dns.lookup("google.com", { backend });
- console.log(first, second);
- });
- it(backend + " local", async () => {
- const [first, second] = await dns.lookup("localhost", { backend });
- console.log(first, second);
+ test.each(validHostnames)("%s [parallel x 10]", async hostname => {
+ const results = await Promise.all(
+ // @ts-expect-error
+ Array.from({ length: 10 }, () => dns.lookup(hostname, { backend })),
+ );
+ const answers = results.flat();
+ expect(answers).toBeArray();
+ expect(answers.length).toBeGreaterThan(10);
+ withoutAggressiveGC(() => {
+ for (const { family, address, ttl } of answers) {
+ expect(address).toBeString();
+ expect(isIP(address)).toBeTruthy();
+ expect(family).toBeInteger();
+ expect(ttl).toBeInteger();
+ }
+ });
});
-
- it(backend + " failing domain throws an error without taking a very long time", async () => {
- try {
- await dns.lookup("yololololololo1234567.com", { backend });
- throw 42;
- } catch (e: any) {
- expect(typeof e).not.toBe("number");
- expect(e.code).toBe("DNS_ENOTFOUND");
- }
+ test.each(invalidHostnames)("%s", hostname => {
+ // @ts-expect-error
+ expect(dns.lookup(hostname, { backend })).rejects.toMatchObject({
+ code: "DNS_ENOTFOUND",
+ });
});
- }
+ // TODO: causes segfaults
+ // test.each(malformedHostnames)("%s", (hostname) => {
+ // // @ts-expect-error
+ // expect(dns.lookup(hostname, { backend })).rejects.toMatchObject({
+ // code: "DNS_ENOTFOUND",
+ // });
+ // });
+ });
});
diff --git a/test/js/bun/ffi/ffi.test.js b/test/js/bun/ffi/ffi.test.js
index 80367e555..b0fe58d77 100644
--- a/test/js/bun/ffi/ffi.test.js
+++ b/test/js/bun/ffi/ffi.test.js
@@ -1,5 +1,7 @@
import { afterAll, describe, expect, it } from "bun:test";
import { existsSync } from "fs";
+import { platform } from "os";
+
import {
CFunction,
CString,
@@ -641,3 +643,287 @@ it(".ptr is not leaked", () => {
expect(fn.ptr).toBeUndefined();
}
});
+
+const lib_path =
+ platform() === "darwin"
+ ? "/usr/lib/libSystem.B.dylib"
+ : existsSync("/lib/x86_64-linux-gnu/libc.so.6")
+ ? "/lib/x86_64-linux-gnu/libc.so.6"
+ : null;
+const test = lib_path ? it : it.skip;
+test("can open more than 63 symbols", () => {
+ const lib = dlopen(lib_path, {
+ memchr: {
+ returns: "ptr",
+ args: ["ptr", "int", "usize"],
+ },
+ strcpy: {
+ returns: "ptr",
+ args: ["ptr", "ptr"],
+ },
+ strcat: {
+ returns: "ptr",
+ args: ["ptr", "ptr"],
+ },
+ strncat: {
+ returns: "ptr",
+ args: ["ptr", "ptr", "usize"],
+ },
+ strcmp: {
+ returns: "int",
+ args: ["ptr", "ptr"],
+ },
+ strncmp: {
+ returns: "int",
+ args: ["ptr", "ptr", "usize"],
+ },
+ strcoll: {
+ returns: "int",
+ args: ["ptr", "ptr"],
+ },
+ strxfrm: {
+ returns: "int",
+ args: ["ptr", "ptr", "usize"],
+ },
+ strchr: {
+ returns: "ptr",
+ args: ["ptr", "int"],
+ },
+ strrchr: {
+ returns: "ptr",
+ args: ["ptr", "int"],
+ },
+ strcspn: {
+ returns: "usize",
+ args: ["ptr", "ptr"],
+ },
+ strspn: {
+ returns: "usize",
+ args: ["ptr", "ptr"],
+ },
+ strpbrk: {
+ returns: "ptr",
+ args: ["ptr", "ptr"],
+ },
+ strstr: {
+ returns: "ptr",
+ args: ["ptr", "ptr"],
+ },
+ strtok: {
+ returns: "ptr",
+ args: ["ptr", "ptr"],
+ },
+ strerror: {
+ returns: "ptr",
+ args: ["int"],
+ },
+ strerror_r: {
+ returns: "ptr",
+ args: ["int", "ptr", "usize"],
+ },
+ strsep: {
+ returns: "ptr",
+ args: ["ptr", "ptr"],
+ },
+ strsignal: {
+ returns: "ptr",
+ args: ["int"],
+ },
+ stpcpy: {
+ returns: "ptr",
+ args: ["ptr", "ptr"],
+ },
+ stpncpy: {
+ returns: "ptr",
+ args: ["ptr", "ptr", "usize"],
+ },
+ basename: {
+ returns: "ptr",
+ args: ["ptr"],
+ },
+ bcmp: {
+ returns: "int",
+ args: ["ptr", "ptr", "usize"],
+ },
+ getdate: {
+ returns: "ptr",
+ args: ["ptr"],
+ },
+ gmtime: {
+ returns: "ptr",
+ args: ["ptr"],
+ },
+ localtime: {
+ returns: "ptr",
+ args: ["ptr"],
+ },
+ ctime: {
+ returns: "ptr",
+ args: ["ptr"],
+ },
+ asctime: {
+ returns: "ptr",
+ args: ["ptr"],
+ },
+ strftime: {
+ returns: "usize",
+ args: ["ptr", "usize", "ptr", "ptr"],
+ },
+ strptime: {
+ returns: "ptr",
+ args: ["ptr", "ptr", "ptr"],
+ },
+ asctime_r: {
+ returns: "ptr",
+ args: ["ptr", "ptr"],
+ },
+ ctime_r: {
+ returns: "ptr",
+ args: ["ptr", "ptr"],
+ },
+ gmtime_r: {
+ returns: "ptr",
+ args: ["ptr", "ptr"],
+ },
+ localtime_r: {
+ returns: "ptr",
+ args: ["ptr", "ptr"],
+ },
+ bcopy: {
+ returns: "int",
+ args: ["ptr", "ptr", "usize"],
+ },
+ bzero: {
+ returns: "void",
+ args: ["ptr", "usize"],
+ },
+ index: {
+ returns: "ptr",
+ args: ["ptr", "int"],
+ },
+ rindex: {
+ returns: "ptr",
+ args: ["ptr", "int"],
+ },
+ ffs: {
+ returns: "int",
+ args: ["int"],
+ },
+ strcasecmp: {
+ returns: "int",
+ args: ["ptr", "ptr"],
+ },
+ strncasecmp: {
+ returns: "int",
+ args: ["ptr", "ptr", "usize"],
+ },
+ pthread_attr_init: {
+ returns: "int",
+ args: ["ptr"],
+ },
+ pthread_attr_destroy: {
+ returns: "int",
+ args: ["ptr"],
+ },
+ pthread_attr_getdetachstate: {
+ returns: "int",
+ args: ["ptr", "ptr"],
+ },
+ pthread_attr_setdetachstate: {
+ returns: "int",
+ args: ["ptr", "int"],
+ },
+ pthread_attr_getguardsize: {
+ returns: "int",
+ args: ["ptr", "ptr"],
+ },
+ pthread_attr_setguardsize: {
+ returns: "int",
+ args: ["ptr", "usize"],
+ },
+ pthread_attr_getschedparam: {
+ returns: "int",
+ args: ["ptr", "ptr"],
+ },
+ pthread_attr_setschedparam: {
+ returns: "int",
+ args: ["ptr", "ptr"],
+ },
+ pthread_attr_getschedpolicy: {
+ returns: "int",
+ args: ["ptr", "ptr"],
+ },
+ pthread_attr_setschedpolicy: {
+ returns: "int",
+ args: ["ptr", "int"],
+ },
+ pthread_attr_getinheritsched: {
+ returns: "int",
+ args: ["ptr", "ptr"],
+ },
+ pthread_attr_setinheritsched: {
+ returns: "int",
+ args: ["ptr", "int"],
+ },
+ pthread_attr_getscope: {
+ returns: "int",
+ args: ["ptr", "ptr"],
+ },
+ pthread_attr_setscope: {
+ returns: "int",
+ args: ["ptr", "int"],
+ },
+ pthread_attr_getstackaddr: {
+ returns: "int",
+ args: ["ptr", "ptr"],
+ },
+ pthread_attr_setstackaddr: {
+ returns: "int",
+ args: ["ptr", "ptr"],
+ },
+ pthread_attr_getstacksize: {
+ returns: "int",
+ args: ["ptr", "ptr"],
+ },
+ pthread_attr_setstacksize: {
+ returns: "int",
+ args: ["ptr", "usize"],
+ },
+ pthread_attr_getstack: {
+ returns: "int",
+ args: ["ptr", "ptr", "ptr"],
+ },
+ pthread_attr_setstack: {
+ returns: "int",
+ args: ["ptr", "ptr", "usize"],
+ },
+ pthread_attr_getguardsize: {
+ returns: "int",
+ args: ["ptr", "ptr"],
+ },
+ pthread_attr_setguardsize: {
+ returns: "int",
+ args: ["ptr", "usize"],
+ },
+ login_tty: {
+ returns: "int",
+ args: ["int"],
+ },
+ login: {
+ returns: "int",
+ args: ["ptr"],
+ },
+ logout: {
+ returns: "int",
+ args: ["ptr"],
+ },
+ strlen: {
+ returns: "usize",
+ args: ["ptr"],
+ },
+ });
+
+ expect(Object.keys(lib.symbols).length).toBe(65);
+ expect(lib.symbols.strcasecmp(Buffer.from("ciro"), Buffer.from("CIRO"))).toBe(0);
+ expect(lib.symbols.strlen(Buffer.from("bunbun", "ascii"))).toBe(6n);
+});
diff --git a/test/js/bun/globals.test.js b/test/js/bun/globals.test.js
index fd291d8bc..3dd129e6a 100644
--- a/test/js/bun/globals.test.js
+++ b/test/js/bun/globals.test.js
@@ -1,4 +1,6 @@
import { expect, it, describe } from "bun:test";
+import { bunEnv, bunExe } from "harness";
+import path from "path";
it("extendable", () => {
const classes = [Blob, TextDecoder, TextEncoder, Request, Response, Headers, HTMLRewriter, Bun.Transpiler, Buffer];
@@ -123,3 +125,23 @@ describe("File", () => {
expect(await foo.text()).toBe("foo");
});
});
+
+it("globals are deletable", () => {
+ const { stdout, exitCode } = Bun.spawnSync({
+ cmd: [bunExe(), "run", path.join(import.meta.dir, "deletable-globals-fixture.js")],
+ env: bunEnv,
+ stderr: "inherit",
+ });
+
+ expect(stdout.toString().trim().endsWith("--pass--")).toBe(true);
+ expect(exitCode).toBe(0);
+});
+
+it("self is a getter", () => {
+ const descriptor = Object.getOwnPropertyDescriptor(globalThis, "self");
+ expect(descriptor.get).toBeInstanceOf(Function);
+ expect(descriptor.set).toBeInstanceOf(Function);
+ expect(descriptor.enumerable).toBe(true);
+ expect(descriptor.configurable).toBe(true);
+ expect(globalThis.self).toBe(globalThis);
+});
diff --git a/test/js/bun/http/big-form-data.fixture.js b/test/js/bun/http/big-form-data.fixture.js
new file mode 100644
index 000000000..72036a222
--- /dev/null
+++ b/test/js/bun/http/big-form-data.fixture.js
@@ -0,0 +1,20 @@
+const content = "Bun".repeat(15360000);
+
+const server = Bun.serve({
+ port: 0,
+ fetch: async req => {
+ const data = await req.formData();
+ return new Response(data.get("name") === content ? "OK" : "NO");
+ },
+});
+
+const formData = new FormData();
+formData.append("name", content);
+const result = await fetch(`http://${server.hostname}:${server.port}`, {
+ method: "POST",
+ body: formData,
+}).then(res => res.text());
+
+server.stop();
+
+process.exit(result === "OK" ? 0 : 1);
diff --git a/test/js/bun/http/bun-server.test.ts b/test/js/bun/http/bun-server.test.ts
index 3e0e4e71e..e82e2cab0 100644
--- a/test/js/bun/http/bun-server.test.ts
+++ b/test/js/bun/http/bun-server.test.ts
@@ -1,4 +1,6 @@
import { describe, expect, test } from "bun:test";
+import { bunExe, bunEnv } from "harness";
+import path from "path";
describe("Server", () => {
test("normlizes incoming request URLs", async () => {
@@ -357,4 +359,24 @@ describe("Server", () => {
server.stop(true);
}
});
+
+ test("should not crash with big formData", async () => {
+ const proc = Bun.spawn({
+ cmd: [bunExe(), "big-form-data.fixture.js"],
+ cwd: import.meta.dir,
+ env: bunEnv,
+ });
+ await proc.exited;
+ expect(proc.exitCode).toBe(0);
+ });
+
+ test("should be able to parse source map and fetch small stream", async () => {
+ const proc = Bun.spawn({
+ cmd: [bunExe(), path.join("js-sink-sourmap-fixture", "index.mjs")],
+ cwd: import.meta.dir,
+ env: bunEnv,
+ });
+ await proc.exited;
+ expect(proc.exitCode).toBe(0);
+ });
});
diff --git a/test/js/bun/http/js-sink-sourmap-fixture/chunks/stream.mjs b/test/js/bun/http/js-sink-sourmap-fixture/chunks/stream.mjs
new file mode 100644
index 000000000..9b2d87af4
--- /dev/null
+++ b/test/js/bun/http/js-sink-sourmap-fixture/chunks/stream.mjs
@@ -0,0 +1,22 @@
+import { e as eventHandler } from "../index.mjs";
+import "fs";
+import "path";
+import "node:async_hooks";
+import "node:fs";
+import "node:url";
+
+const stream = eventHandler(() => {
+ const encoder = new TextEncoder();
+ const stream = new ReadableStream({
+ start(controller) {
+ controller.enqueue(encoder.encode("nitro"));
+ controller.enqueue(encoder.encode("is"));
+ controller.enqueue(encoder.encode("awesome"));
+ controller.close();
+ },
+ });
+ return stream;
+});
+
+export { stream as default };
+//# sourceMappingURL=stream.mjs.map
diff --git a/test/js/bun/http/js-sink-sourmap-fixture/index.mjs b/test/js/bun/http/js-sink-sourmap-fixture/index.mjs
new file mode 100644
index 000000000..1235d8e13
--- /dev/null
+++ b/test/js/bun/http/js-sink-sourmap-fixture/index.mjs
@@ -0,0 +1,5620 @@
+globalThis._importMeta_ = { url: import.meta.url, env: process.env };
+import { promises, existsSync } from "fs";
+import { dirname as dirname$1, resolve as resolve$1, join } from "path";
+import { AsyncLocalStorage } from "node:async_hooks";
+import { promises as promises$1 } from "node:fs";
+import { fileURLToPath } from "node:url";
+
+const HASH_RE = /#/g;
+const AMPERSAND_RE = /&/g;
+const EQUAL_RE = /=/g;
+const PLUS_RE = /\+/g;
+const ENC_CARET_RE = /%5e/gi;
+const ENC_BACKTICK_RE = /%60/gi;
+const ENC_PIPE_RE = /%7c/gi;
+const ENC_SPACE_RE = /%20/gi;
+const ENC_SLASH_RE = /%2f/gi;
+function encode$1(text) {
+ return encodeURI("" + text).replace(ENC_PIPE_RE, "|");
+}
+function encodeQueryValue(input) {
+ return encode$1(typeof input === "string" ? input : JSON.stringify(input))
+ .replace(PLUS_RE, "%2B")
+ .replace(ENC_SPACE_RE, "+")
+ .replace(HASH_RE, "%23")
+ .replace(AMPERSAND_RE, "%26")
+ .replace(ENC_BACKTICK_RE, "`")
+ .replace(ENC_CARET_RE, "^");
+}
+function encodeQueryKey(text) {
+ return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
+}
+function decode(text = "") {
+ try {
+ return decodeURIComponent("" + text);
+ } catch {
+ return "" + text;
+ }
+}
+function decodePath(text) {
+ return decode(text.replace(ENC_SLASH_RE, "%252F"));
+}
+function decodeQueryKey(text) {
+ return decode(text.replace(PLUS_RE, " "));
+}
+function decodeQueryValue(text) {
+ return decode(text.replace(PLUS_RE, " "));
+}
+
+function parseQuery(parametersString = "") {
+ const object = {};
+ if (parametersString[0] === "?") {
+ parametersString = parametersString.slice(1);
+ }
+ for (const parameter of parametersString.split("&")) {
+ const s = parameter.match(/([^=]+)=?(.*)/) || [];
+ if (s.length < 2) {
+ continue;
+ }
+ const key = decodeQueryKey(s[1]);
+ if (key === "__proto__" || key === "constructor") {
+ continue;
+ }
+ const value = decodeQueryValue(s[2] || "");
+ if (object[key] === void 0) {
+ object[key] = value;
+ } else if (Array.isArray(object[key])) {
+ object[key].push(value);
+ } else {
+ object[key] = [object[key], value];
+ }
+ }
+ return object;
+}
+function encodeQueryItem(key, value) {
+ if (typeof value === "number" || typeof value === "boolean") {
+ value = String(value);
+ }
+ if (!value) {
+ return encodeQueryKey(key);
+ }
+ if (Array.isArray(value)) {
+ return value.map(_value => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}`).join("&");
+ }
+ return `${encodeQueryKey(key)}=${encodeQueryValue(value)}`;
+}
+function stringifyQuery(query) {
+ return Object.keys(query)
+ .filter(k => query[k] !== void 0)
+ .map(k => encodeQueryItem(k, query[k]))
+ .filter(Boolean)
+ .join("&");
+}
+const PROTOCOL_STRICT_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/;
+const PROTOCOL_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{2})?/;
+const PROTOCOL_RELATIVE_REGEX = /^([/\\]\s*){2,}[^/\\]/;
+function hasProtocol(inputString, opts = {}) {
+ if (typeof opts === "boolean") {
+ opts = { acceptRelative: opts };
+ }
+ if (opts.strict) {
+ return PROTOCOL_STRICT_REGEX.test(inputString);
+ }
+ return PROTOCOL_REGEX.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(inputString) : false);
+}
+const TRAILING_SLASH_RE = /\/$|\/\?/;
+function hasTrailingSlash(input = "", queryParameters = false) {
+ if (!queryParameters) {
+ return input.endsWith("/");
+ }
+ return TRAILING_SLASH_RE.test(input);
+}
+function withoutTrailingSlash(input = "", queryParameters = false) {
+ if (!queryParameters) {
+ return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || "/";
+ }
+ if (!hasTrailingSlash(input, true)) {
+ return input || "/";
+ }
+ const [s0, ...s] = input.split("?");
+ return (s0.slice(0, -1) || "/") + (s.length > 0 ? `?${s.join("?")}` : "");
+}
+function withTrailingSlash(input = "", queryParameters = false) {
+ if (!queryParameters) {
+ return input.endsWith("/") ? input : input + "/";
+ }
+ if (hasTrailingSlash(input, true)) {
+ return input || "/";
+ }
+ const [s0, ...s] = input.split("?");
+ return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "");
+}
+function hasLeadingSlash(input = "") {
+ return input.startsWith("/");
+}
+function withLeadingSlash(input = "") {
+ return hasLeadingSlash(input) ? input : "/" + input;
+}
+function withBase(input, base) {
+ if (isEmptyURL(base) || hasProtocol(input)) {
+ return input;
+ }
+ const _base = withoutTrailingSlash(base);
+ if (input.startsWith(_base)) {
+ return input;
+ }
+ return joinURL(_base, input);
+}
+function withoutBase(input, base) {
+ if (isEmptyURL(base)) {
+ return input;
+ }
+ const _base = withoutTrailingSlash(base);
+ if (!input.startsWith(_base)) {
+ return input;
+ }
+ const trimmed = input.slice(_base.length);
+ return trimmed[0] === "/" ? trimmed : "/" + trimmed;
+}
+function withQuery(input, query) {
+ const parsed = parseURL(input);
+ const mergedQuery = { ...parseQuery(parsed.search), ...query };
+ parsed.search = stringifyQuery(mergedQuery);
+ return stringifyParsedURL(parsed);
+}
+function getQuery$1(input) {
+ return parseQuery(parseURL(input).search);
+}
+function isEmptyURL(url) {
+ return !url || url === "/";
+}
+function isNonEmptyURL(url) {
+ return url && url !== "/";
+}
+const JOIN_LEADING_SLASH_RE = /^\.?\//;
+function joinURL(base, ...input) {
+ let url = base || "";
+ for (const segment of input.filter(url2 => isNonEmptyURL(url2))) {
+ if (url) {
+ const _segment = segment.replace(JOIN_LEADING_SLASH_RE, "");
+ url = withTrailingSlash(url) + _segment;
+ } else {
+ url = segment;
+ }
+ }
+ return url;
+}
+
+function parseURL(input = "", defaultProto) {
+ const _specialProtoMatch = input.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/);
+ if (_specialProtoMatch) {
+ const [, _proto, _pathname = ""] = _specialProtoMatch;
+ return {
+ protocol: _proto,
+ pathname: _pathname,
+ href: _proto + _pathname,
+ auth: "",
+ host: "",
+ search: "",
+ hash: "",
+ };
+ }
+ if (!hasProtocol(input, { acceptRelative: true })) {
+ return defaultProto ? parseURL(defaultProto + input) : parsePath(input);
+ }
+ const [, protocol = "", auth, hostAndPath = ""] =
+ input.replace(/\\/g, "/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/) || [];
+ const [, host = "", path = ""] = hostAndPath.match(/([^#/?]*)(.*)?/) || [];
+ const { pathname, search, hash } = parsePath(path.replace(/\/(?=[A-Za-z]:)/, ""));
+ return {
+ protocol,
+ auth: auth ? auth.slice(0, Math.max(0, auth.length - 1)) : "",
+ host,
+ pathname,
+ search,
+ hash,
+ };
+}
+function parsePath(input = "") {
+ const [pathname = "", search = "", hash = ""] = (input.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1);
+ return {
+ pathname,
+ search,
+ hash,
+ };
+}
+function stringifyParsedURL(parsed) {
+ const pathname = parsed.pathname || "";
+ const search = parsed.search ? (parsed.search.startsWith("?") ? "" : "?") + parsed.search : "";
+ const hash = parsed.hash || "";
+ const auth = parsed.auth ? parsed.auth + "@" : "";
+ const host = parsed.host || "";
+ const proto = parsed.protocol ? parsed.protocol + "//" : "";
+ return proto + auth + host + pathname + search + hash;
+}
+
+const fieldContentRegExp = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;
+function serialize(name, value, options) {
+ const opt = options || {};
+ const enc = opt.encode || encode;
+ if (typeof enc !== "function") {
+ throw new TypeError("option encode is invalid");
+ }
+ if (!fieldContentRegExp.test(name)) {
+ throw new TypeError("argument name is invalid");
+ }
+ const encodedValue = enc(value);
+ if (encodedValue && !fieldContentRegExp.test(encodedValue)) {
+ throw new TypeError("argument val is invalid");
+ }
+ let str = name + "=" + encodedValue;
+ if (void 0 !== opt.maxAge && opt.maxAge !== null) {
+ const maxAge = opt.maxAge - 0;
+ if (Number.isNaN(maxAge) || !Number.isFinite(maxAge)) {
+ throw new TypeError("option maxAge is invalid");
+ }
+ str += "; Max-Age=" + Math.floor(maxAge);
+ }
+ if (opt.domain) {
+ if (!fieldContentRegExp.test(opt.domain)) {
+ throw new TypeError("option domain is invalid");
+ }
+ str += "; Domain=" + opt.domain;
+ }
+ if (opt.path) {
+ if (!fieldContentRegExp.test(opt.path)) {
+ throw new TypeError("option path is invalid");
+ }
+ str += "; Path=" + opt.path;
+ }
+ if (opt.expires) {
+ if (!isDate(opt.expires) || Number.isNaN(opt.expires.valueOf())) {
+ throw new TypeError("option expires is invalid");
+ }
+ str += "; Expires=" + opt.expires.toUTCString();
+ }
+ if (opt.httpOnly) {
+ str += "; HttpOnly";
+ }
+ if (opt.secure) {
+ str += "; Secure";
+ }
+ if (opt.priority) {
+ const priority = typeof opt.priority === "string" ? opt.priority.toLowerCase() : opt.priority;
+ switch (priority) {
+ case "low":
+ str += "; Priority=Low";
+ break;
+ case "medium":
+ str += "; Priority=Medium";
+ break;
+ case "high":
+ str += "; Priority=High";
+ break;
+ default:
+ throw new TypeError("option priority is invalid");
+ }
+ }
+ if (opt.sameSite) {
+ const sameSite = typeof opt.sameSite === "string" ? opt.sameSite.toLowerCase() : opt.sameSite;
+ switch (sameSite) {
+ case true:
+ str += "; SameSite=Strict";
+ break;
+ case "lax":
+ str += "; SameSite=Lax";
+ break;
+ case "strict":
+ str += "; SameSite=Strict";
+ break;
+ case "none":
+ str += "; SameSite=None";
+ break;
+ default:
+ throw new TypeError("option sameSite is invalid");
+ }
+ }
+ return str;
+}
+function isDate(val) {
+ return Object.prototype.toString.call(val) === "[object Date]" || val instanceof Date;
+}
+function encode(val) {
+ return encodeURIComponent(val);
+}
+
+const NODE_TYPES = {
+ NORMAL: 0,
+ WILDCARD: 1,
+ PLACEHOLDER: 2,
+};
+
+function createRouter$1(options = {}) {
+ const ctx = {
+ options,
+ rootNode: createRadixNode(),
+ staticRoutesMap: {},
+ };
+ const normalizeTrailingSlash = p => (options.strictTrailingSlash ? p : p.replace(/\/$/, "") || "/");
+ if (options.routes) {
+ for (const path in options.routes) {
+ insert(ctx, normalizeTrailingSlash(path), options.routes[path]);
+ }
+ }
+ return {
+ ctx,
+ // @ts-ignore
+ lookup: path => lookup(ctx, normalizeTrailingSlash(path)),
+ insert: (path, data) => insert(ctx, normalizeTrailingSlash(path), data),
+ remove: path => remove(ctx, normalizeTrailingSlash(path)),
+ };
+}
+function lookup(ctx, path) {
+ const staticPathNode = ctx.staticRoutesMap[path];
+ if (staticPathNode) {
+ return staticPathNode.data;
+ }
+ const sections = path.split("/");
+ const params = {};
+ let paramsFound = false;
+ let wildcardNode = null;
+ let node = ctx.rootNode;
+ let wildCardParam = null;
+ for (let i = 0; i < sections.length; i++) {
+ const section = sections[i];
+ if (node.wildcardChildNode !== null) {
+ wildcardNode = node.wildcardChildNode;
+ wildCardParam = sections.slice(i).join("/");
+ }
+ const nextNode = node.children.get(section);
+ if (nextNode !== void 0) {
+ node = nextNode;
+ } else {
+ node = node.placeholderChildNode;
+ if (node !== null) {
+ params[node.paramName] = section;
+ paramsFound = true;
+ } else {
+ break;
+ }
+ }
+ }
+ if ((node === null || node.data === null) && wildcardNode !== null) {
+ node = wildcardNode;
+ params[node.paramName || "_"] = wildCardParam;
+ paramsFound = true;
+ }
+ if (!node) {
+ return null;
+ }
+ if (paramsFound) {
+ return {
+ ...node.data,
+ params: paramsFound ? params : void 0,
+ };
+ }
+ return node.data;
+}
+function insert(ctx, path, data) {
+ let isStaticRoute = true;
+ const sections = path.split("/");
+ let node = ctx.rootNode;
+ let _unnamedPlaceholderCtr = 0;
+ for (const section of sections) {
+ let childNode;
+ if ((childNode = node.children.get(section))) {
+ node = childNode;
+ } else {
+ const type = getNodeType(section);
+ childNode = createRadixNode({ type, parent: node });
+ node.children.set(section, childNode);
+ if (type === NODE_TYPES.PLACEHOLDER) {
+ childNode.paramName = section === "*" ? `_${_unnamedPlaceholderCtr++}` : section.slice(1);
+ node.placeholderChildNode = childNode;
+ isStaticRoute = false;
+ } else if (type === NODE_TYPES.WILDCARD) {
+ node.wildcardChildNode = childNode;
+ childNode.paramName =
+ section.slice(
+ 3,
+ /* "**:" */
+ ) || "_";
+ isStaticRoute = false;
+ }
+ node = childNode;
+ }
+ }
+ node.data = data;
+ if (isStaticRoute === true) {
+ ctx.staticRoutesMap[path] = node;
+ }
+ return node;
+}
+function remove(ctx, path) {
+ let success = false;
+ const sections = path.split("/");
+ let node = ctx.rootNode;
+ for (const section of sections) {
+ node = node.children.get(section);
+ if (!node) {
+ return success;
+ }
+ }
+ if (node.data) {
+ const lastSection = sections[sections.length - 1];
+ node.data = null;
+ if (Object.keys(node.children).length === 0) {
+ const parentNode = node.parent;
+ parentNode.children.delete(lastSection);
+ parentNode.wildcardChildNode = null;
+ parentNode.placeholderChildNode = null;
+ }
+ success = true;
+ }
+ return success;
+}
+function createRadixNode(options = {}) {
+ return {
+ type: options.type || NODE_TYPES.NORMAL,
+ parent: options.parent || null,
+ children: /* @__PURE__ */ new Map(),
+ data: options.data || null,
+ paramName: options.paramName || null,
+ wildcardChildNode: null,
+ placeholderChildNode: null,
+ };
+}
+function getNodeType(str) {
+ if (str.startsWith("**")) {
+ return NODE_TYPES.WILDCARD;
+ }
+ if (str[0] === ":" || str === "*") {
+ return NODE_TYPES.PLACEHOLDER;
+ }
+ return NODE_TYPES.NORMAL;
+}
+
+function toRouteMatcher(router) {
+ const table = _routerNodeToTable("", router.ctx.rootNode);
+ return _createMatcher(table);
+}
+function _createMatcher(table) {
+ return {
+ ctx: { table },
+ matchAll: path => _matchRoutes(path, table),
+ };
+}
+function _createRouteTable() {
+ return {
+ static: /* @__PURE__ */ new Map(),
+ wildcard: /* @__PURE__ */ new Map(),
+ dynamic: /* @__PURE__ */ new Map(),
+ };
+}
+function _matchRoutes(path, table) {
+ const matches = [];
+ for (const [key, value] of _sortRoutesMap(table.wildcard)) {
+ if (path.startsWith(key)) {
+ matches.push(value);
+ }
+ }
+ for (const [key, value] of _sortRoutesMap(table.dynamic)) {
+ if (path.startsWith(key + "/")) {
+ const subPath = "/" + path.slice(key.length).split("/").splice(2).join("/");
+ matches.push(..._matchRoutes(subPath, value));
+ }
+ }
+ const staticMatch = table.static.get(path);
+ if (staticMatch) {
+ matches.push(staticMatch);
+ }
+ return matches.filter(Boolean);
+}
+function _sortRoutesMap(m) {
+ return [...m.entries()].sort((a, b) => a[0].length - b[0].length);
+}
+function _routerNodeToTable(initialPath, initialNode) {
+ const table = _createRouteTable();
+ function _addNode(path, node) {
+ if (path) {
+ if (node.type === NODE_TYPES.NORMAL && !(path.includes("*") || path.includes(":"))) {
+ table.static.set(path, node.data);
+ } else if (node.type === NODE_TYPES.WILDCARD) {
+ table.wildcard.set(path.replace("/**", ""), node.data);
+ } else if (node.type === NODE_TYPES.PLACEHOLDER) {
+ const subTable = _routerNodeToTable("", node);
+ if (node.data) {
+ subTable.static.set("/", node.data);
+ }
+ table.dynamic.set(path.replace(/\/\*|\/:\w+/, ""), subTable);
+ return;
+ }
+ }
+ for (const [childPath, child] of node.children.entries()) {
+ _addNode(`${path}/${childPath}`.replace("//", "/"), child);
+ }
+ }
+ _addNode(initialPath, initialNode);
+ return table;
+}
+
+const suspectProtoRx =
+ /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
+const suspectConstructorRx =
+ /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
+const JsonSigRx = /^\s*["[{]|^\s*-?\d[\d.]{0,14}\s*$/;
+function jsonParseTransform(key, value) {
+ if (key === "__proto__" || (key === "constructor" && value && typeof value === "object" && "prototype" in value)) {
+ warnKeyDropped(key);
+ return;
+ }
+ return value;
+}
+function warnKeyDropped(key) {
+ console.warn(`[destr] Dropping "${key}" key to prevent prototype pollution.`);
+}
+function destr(value, options = {}) {
+ if (typeof value !== "string") {
+ return value;
+ }
+ const _value = value.trim();
+ if (value[0] === '"' && value[value.length - 1] === '"') {
+ return _value.slice(1, -1);
+ }
+ if (_value.length <= 9) {
+ const _lval = _value.toLowerCase();
+ if (_lval === "true") {
+ return true;
+ }
+ if (_lval === "false") {
+ return false;
+ }
+ if (_lval === "undefined") {
+ return void 0;
+ }
+ if (_lval === "null") {
+ return null;
+ }
+ if (_lval === "nan") {
+ return Number.NaN;
+ }
+ if (_lval === "infinity") {
+ return Number.POSITIVE_INFINITY;
+ }
+ if (_lval === "-infinity") {
+ return Number.NEGATIVE_INFINITY;
+ }
+ }
+ if (!JsonSigRx.test(value)) {
+ if (options.strict) {
+ throw new SyntaxError("[destr] Invalid JSON");
+ }
+ return value;
+ }
+ try {
+ if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) {
+ if (options.strict) {
+ throw new Error("[destr] Possible prototype pollution");
+ }
+ return JSON.parse(value, jsonParseTransform);
+ }
+ return JSON.parse(value);
+ } catch (error) {
+ if (options.strict) {
+ throw error;
+ }
+ return value;
+ }
+}
+
+function isObject(value) {
+ return value !== null && typeof value === "object";
+}
+function _defu(baseObject, defaults, namespace = ".", merger) {
+ if (!isObject(defaults)) {
+ return _defu(baseObject, {}, namespace, merger);
+ }
+ const object = Object.assign({}, defaults);
+ for (const key in baseObject) {
+ if (key === "__proto__" || key === "constructor") {
+ continue;
+ }
+ const value = baseObject[key];
+ if (value === null || value === void 0) {
+ continue;
+ }
+ if (merger && merger(object, key, value, namespace)) {
+ continue;
+ }
+ if (Array.isArray(value) && Array.isArray(object[key])) {
+ object[key] = [...value, ...object[key]];
+ } else if (isObject(value) && isObject(object[key])) {
+ object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
+ } else {
+ object[key] = value;
+ }
+ }
+ return object;
+}
+function createDefu(merger) {
+ return (...arguments_) =>
+ // eslint-disable-next-line unicorn/no-array-reduce
+ arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
+}
+const defu = createDefu();
+const defuFn = createDefu((object, key, currentValue) => {
+ if (typeof object[key] !== "undefined" && typeof currentValue === "function") {
+ object[key] = currentValue(object[key]);
+ return true;
+ }
+});
+
+function rawHeaders(headers) {
+ const rawHeaders2 = [];
+ for (const key in headers) {
+ if (Array.isArray(headers[key])) {
+ for (const h of headers[key]) {
+ rawHeaders2.push(key, h);
+ }
+ } else {
+ rawHeaders2.push(key, headers[key]);
+ }
+ }
+ return rawHeaders2;
+}
+function mergeFns(...functions) {
+ return function (...args) {
+ for (const fn of functions) {
+ fn(...args);
+ }
+ };
+}
+function createNotImplementedError(name) {
+ throw new Error(`[unenv] ${name} is not implemented yet!`);
+}
+
+let defaultMaxListeners = 10;
+let EventEmitter$1 = class EventEmitter {
+ __unenv__ = true;
+ _events = /* @__PURE__ */ Object.create(null);
+ _maxListeners;
+ static get defaultMaxListeners() {
+ return defaultMaxListeners;
+ }
+ static set defaultMaxListeners(arg) {
+ if (typeof arg !== "number" || arg < 0 || Number.isNaN(arg)) {
+ throw new RangeError(
+ 'The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".",
+ );
+ }
+ defaultMaxListeners = arg;
+ }
+ setMaxListeners(n) {
+ if (typeof n !== "number" || n < 0 || Number.isNaN(n)) {
+ throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
+ }
+ this._maxListeners = n;
+ return this;
+ }
+ getMaxListeners() {
+ return _getMaxListeners(this);
+ }
+ emit(type, ...args) {
+ if (!this._events[type] || this._events[type].length === 0) {
+ return false;
+ }
+ if (type === "error") {
+ let er;
+ if (args.length > 0) {
+ er = args[0];
+ }
+ if (er instanceof Error) {
+ throw er;
+ }
+ const err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
+ err.context = er;
+ throw err;
+ }
+ for (const _listener of this._events[type]) {
+ (_listener.listener || _listener).apply(this, args);
+ }
+ return true;
+ }
+ addListener(type, listener) {
+ return _addListener(this, type, listener, false);
+ }
+ on(type, listener) {
+ return _addListener(this, type, listener, false);
+ }
+ prependListener(type, listener) {
+ return _addListener(this, type, listener, true);
+ }
+ once(type, listener) {
+ return this.on(type, _wrapOnce(this, type, listener));
+ }
+ prependOnceListener(type, listener) {
+ return this.prependListener(type, _wrapOnce(this, type, listener));
+ }
+ removeListener(type, listener) {
+ return _removeListener(this, type, listener);
+ }
+ off(type, listener) {
+ return this.removeListener(type, listener);
+ }
+ removeAllListeners(type) {
+ return _removeAllListeners(this, type);
+ }
+ listeners(type) {
+ return _listeners(this, type, true);
+ }
+ rawListeners(type) {
+ return _listeners(this, type, false);
+ }
+ listenerCount(type) {
+ return this.rawListeners(type).length;
+ }
+ eventNames() {
+ return Object.keys(this._events);
+ }
+};
+function _addListener(target, type, listener, prepend) {
+ _checkListener(listener);
+ if (target._events.newListener !== void 0) {
+ target.emit("newListener", type, listener.listener || listener);
+ }
+ if (!target._events[type]) {
+ target._events[type] = [];
+ }
+ if (prepend) {
+ target._events[type].unshift(listener);
+ } else {
+ target._events[type].push(listener);
+ }
+ const maxListeners = _getMaxListeners(target);
+ if (maxListeners > 0 && target._events[type].length > maxListeners && !target._events[type].warned) {
+ target._events[type].warned = true;
+ const warning = new Error(
+ `[unenv] Possible EventEmitter memory leak detected. ${target._events[type].length} ${type} listeners added. Use emitter.setMaxListeners() to increase limit`,
+ );
+ warning.name = "MaxListenersExceededWarning";
+ warning.emitter = target;
+ warning.type = type;
+ warning.count = target._events[type]?.length;
+ console.warn(warning);
+ }
+ return target;
+}
+function _removeListener(target, type, listener) {
+ _checkListener(listener);
+ if (!target._events[type] || target._events[type].length === 0) {
+ return target;
+ }
+ const lenBeforeFilter = target._events[type].length;
+ target._events[type] = target._events[type].filter(fn => fn !== listener);
+ if (lenBeforeFilter === target._events[type].length) {
+ return target;
+ }
+ if (target._events.removeListener) {
+ target.emit("removeListener", type, listener.listener || listener);
+ }
+ if (target._events[type].length === 0) {
+ delete target._events[type];
+ }
+ return target;
+}
+function _removeAllListeners(target, type) {
+ if (!target._events[type] || target._events[type].length === 0) {
+ return target;
+ }
+ if (target._events.removeListener) {
+ for (const _listener of target._events[type]) {
+ target.emit("removeListener", type, _listener.listener || _listener);
+ }
+ }
+ delete target._events[type];
+ return target;
+}
+function _wrapOnce(target, type, listener) {
+ let fired = false;
+ const wrapper = (...args) => {
+ if (fired) {
+ return;
+ }
+ target.removeListener(type, wrapper);
+ fired = true;
+ return args.length === 0 ? listener.call(target) : listener.apply(target, args);
+ };
+ wrapper.listener = listener;
+ return wrapper;
+}
+function _getMaxListeners(target) {
+ return target._maxListeners ?? EventEmitter$1.defaultMaxListeners;
+}
+function _listeners(target, type, unwrap) {
+ let listeners = target._events[type];
+ if (typeof listeners === "function") {
+ listeners = [listeners];
+ }
+ return unwrap ? listeners.map(l => l.listener || l) : listeners;
+}
+function _checkListener(listener) {
+ if (typeof listener !== "function") {
+ throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
+ }
+}
+
+const EventEmitter = globalThis.EventEmitter || EventEmitter$1;
+
+class _Readable extends EventEmitter {
+ __unenv__ = true;
+ readableEncoding = null;
+ readableEnded = true;
+ readableFlowing = false;
+ readableHighWaterMark = 0;
+ readableLength = 0;
+ readableObjectMode = false;
+ readableAborted = false;
+ readableDidRead = false;
+ closed = false;
+ errored = null;
+ readable = false;
+ destroyed = false;
+ static from(_iterable, options) {
+ return new _Readable(options);
+ }
+ constructor(_opts) {
+ super();
+ }
+ _read(_size) {}
+ read(_size) {}
+ setEncoding(_encoding) {
+ return this;
+ }
+ pause() {
+ return this;
+ }
+ resume() {
+ return this;
+ }
+ isPaused() {
+ return true;
+ }
+ unpipe(_destination) {
+ return this;
+ }
+ unshift(_chunk, _encoding) {}
+ wrap(_oldStream) {
+ return this;
+ }
+ push(_chunk, _encoding) {
+ return false;
+ }
+ _destroy(_error, _callback) {
+ this.removeAllListeners();
+ }
+ destroy(error) {
+ this.destroyed = true;
+ this._destroy(error);
+ return this;
+ }
+ pipe(_destenition, _options) {
+ return {};
+ }
+ compose(stream, options) {
+ throw new Error("[unenv] Method not implemented.");
+ }
+ [Symbol.asyncDispose]() {
+ this.destroy();
+ return Promise.resolve();
+ }
+ async *[Symbol.asyncIterator]() {
+ throw createNotImplementedError("Readable.asyncIterator");
+ }
+ iterator(options) {
+ throw createNotImplementedError("Readable.iterator");
+ }
+ map(fn, options) {
+ throw createNotImplementedError("Readable.map");
+ }
+ filter(fn, options) {
+ throw createNotImplementedError("Readable.filter");
+ }
+ forEach(fn, options) {
+ throw createNotImplementedError("Readable.forEach");
+ }
+ reduce(fn, initialValue, options) {
+ throw createNotImplementedError("Readable.reduce");
+ }
+ find(fn, options) {
+ throw createNotImplementedError("Readable.find");
+ }
+ findIndex(fn, options) {
+ throw createNotImplementedError("Readable.findIndex");
+ }
+ some(fn, options) {
+ throw createNotImplementedError("Readable.some");
+ }
+ toArray(options) {
+ throw createNotImplementedError("Readable.toArray");
+ }
+ every(fn, options) {
+ throw createNotImplementedError("Readable.every");
+ }
+ flatMap(fn, options) {
+ throw createNotImplementedError("Readable.flatMap");
+ }
+ drop(limit, options) {
+ throw createNotImplementedError("Readable.drop");
+ }
+ take(limit, options) {
+ throw createNotImplementedError("Readable.take");
+ }
+ asIndexedPairs(options) {
+ throw createNotImplementedError("Readable.asIndexedPairs");
+ }
+}
+const Readable = globalThis.Readable || _Readable;
+
+class _Writable extends EventEmitter {
+ __unenv__ = true;
+ writable = true;
+ writableEnded = false;
+ writableFinished = false;
+ writableHighWaterMark = 0;
+ writableLength = 0;
+ writableObjectMode = false;
+ writableCorked = 0;
+ closed = false;
+ errored = null;
+ writableNeedDrain = false;
+ destroyed = false;
+ _data;
+ _encoding = "utf-8";
+ constructor(_opts) {
+ super();
+ }
+ pipe(_destenition, _options) {
+ return {};
+ }
+ _write(chunk, encoding, callback) {
+ if (this.writableEnded) {
+ if (callback) {
+ callback();
+ }
+ return;
+ }
+ if (this._data === void 0) {
+ this._data = chunk;
+ } else {
+ const a =
+ typeof this._data === "string" ? Buffer.from(this._data, this._encoding || encoding || "utf8") : this._data;
+ const b = typeof chunk === "string" ? Buffer.from(chunk, encoding || this._encoding || "utf8") : chunk;
+ this._data = Buffer.concat([a, b]);
+ }
+ this._encoding = encoding;
+ if (callback) {
+ callback();
+ }
+ }
+ _writev(_chunks, _callback) {}
+ _destroy(_error, _callback) {}
+ _final(_callback) {}
+ write(chunk, arg2, arg3) {
+ const encoding = typeof arg2 === "string" ? this._encoding : "utf-8";
+ const cb = typeof arg2 === "function" ? arg2 : typeof arg3 === "function" ? arg3 : void 0;
+ this._write(chunk, encoding, cb);
+ return true;
+ }
+ setDefaultEncoding(_encoding) {
+ return this;
+ }
+ end(arg1, arg2, arg3) {
+ const callback =
+ typeof arg1 === "function"
+ ? arg1
+ : typeof arg2 === "function"
+ ? arg2
+ : typeof arg3 === "function"
+ ? arg3
+ : void 0;
+ if (this.writableEnded) {
+ if (callback) {
+ callback();
+ }
+ return this;
+ }
+ const data = arg1 === callback ? void 0 : arg1;
+ if (data) {
+ const encoding = arg2 === callback ? void 0 : arg2;
+ this.write(data, encoding, callback);
+ }
+ this.writableEnded = true;
+ this.writableFinished = true;
+ this.emit("close");
+ this.emit("finish");
+ return this;
+ }
+ cork() {}
+ uncork() {}
+ destroy(_error) {
+ this.destroyed = true;
+ delete this._data;
+ this.removeAllListeners();
+ return this;
+ }
+ compose(stream, options) {
+ throw new Error("[h3] Method not implemented.");
+ }
+}
+const Writable = globalThis.Writable || _Writable;
+
+const __Duplex = class {
+ allowHalfOpen = true;
+ _destroy;
+ constructor(readable = new Readable(), writable = new Writable()) {
+ Object.assign(this, readable);
+ Object.assign(this, writable);
+ this._destroy = mergeFns(readable._destroy, writable._destroy);
+ }
+};
+function getDuplex() {
+ Object.assign(__Duplex.prototype, Readable.prototype);
+ Object.assign(__Duplex.prototype, Writable.prototype);
+ return __Duplex;
+}
+const _Duplex = /* @__PURE__ */ getDuplex();
+const Duplex = globalThis.Duplex || _Duplex;
+
+class Socket extends Duplex {
+ __unenv__ = true;
+ bufferSize = 0;
+ bytesRead = 0;
+ bytesWritten = 0;
+ connecting = false;
+ destroyed = false;
+ pending = false;
+ localAddress = "";
+ localPort = 0;
+ remoteAddress = "";
+ remoteFamily = "";
+ remotePort = 0;
+ readyState = "readOnly";
+ constructor(_options) {
+ super();
+ }
+ write(_buffer, _arg1, _arg2) {
+ return false;
+ }
+ connect(_arg1, _arg2, _arg3) {
+ return this;
+ }
+ end(_arg1, _arg2, _arg3) {
+ return this;
+ }
+ setEncoding(_encoding) {
+ return this;
+ }
+ pause() {
+ return this;
+ }
+ resume() {
+ return this;
+ }
+ setTimeout(_timeout, _callback) {
+ return this;
+ }
+ setNoDelay(_noDelay) {
+ return this;
+ }
+ setKeepAlive(_enable, _initialDelay) {
+ return this;
+ }
+ address() {
+ return {};
+ }
+ unref() {
+ return this;
+ }
+ ref() {
+ return this;
+ }
+ resetAndDestroy() {
+ const err = new Error("ERR_SOCKET_CLOSED");
+ err.code = "ERR_SOCKET_CLOSED";
+ this.destroy(err);
+ return this;
+ }
+}
+
+class IncomingMessage extends Readable {
+ __unenv__ = {};
+ aborted = false;
+ httpVersion = "1.1";
+ httpVersionMajor = 1;
+ httpVersionMinor = 1;
+ complete = true;
+ connection;
+ socket;
+ headers = {};
+ trailers = {};
+ method = "GET";
+ url = "/";
+ statusCode = 200;
+ statusMessage = "";
+ closed = false;
+ errored = null;
+ readable = false;
+ constructor(socket) {
+ super();
+ this.socket = this.connection = socket || new Socket();
+ }
+ get rawHeaders() {
+ return rawHeaders(this.headers);
+ }
+ get rawTrailers() {
+ return [];
+ }
+ setTimeout(_msecs, _callback) {
+ return this;
+ }
+ get headersDistinct() {
+ return _distinct(this.headers);
+ }
+ get trailersDistinct() {
+ return _distinct(this.trailers);
+ }
+}
+function _distinct(obj) {
+ const d = {};
+ for (const [key, value] of Object.entries(obj)) {
+ if (key) {
+ d[key] = (Array.isArray(value) ? value : [value]).filter(Boolean);
+ }
+ }
+ return d;
+}
+
+class ServerResponse extends Writable {
+ __unenv__ = true;
+ statusCode = 200;
+ statusMessage = "";
+ upgrading = false;
+ chunkedEncoding = false;
+ shouldKeepAlive = false;
+ useChunkedEncodingByDefault = false;
+ sendDate = false;
+ finished = false;
+ headersSent = false;
+ strictContentLength = false;
+ connection = null;
+ socket = null;
+ req;
+ _headers = {};
+ constructor(req) {
+ super();
+ this.req = req;
+ }
+ assignSocket(socket) {
+ socket._httpMessage = this;
+ this.socket = socket;
+ this.connection = socket;
+ this.emit("socket", socket);
+ this._flush();
+ }
+ _flush() {
+ this.flushHeaders();
+ }
+ detachSocket(_socket) {}
+ writeContinue(_callback) {}
+ writeHead(statusCode, arg1, arg2) {
+ if (statusCode) {
+ this.statusCode = statusCode;
+ }
+ if (typeof arg1 === "string") {
+ this.statusMessage = arg1;
+ arg1 = void 0;
+ }
+ const headers = arg2 || arg1;
+ if (headers) {
+ if (Array.isArray(headers));
+ else {
+ for (const key in headers) {
+ this.setHeader(key, headers[key]);
+ }
+ }
+ }
+ this.headersSent = true;
+ return this;
+ }
+ writeProcessing() {}
+ setTimeout(_msecs, _callback) {
+ return this;
+ }
+ appendHeader(name, value) {
+ name = name.toLowerCase();
+ const current = this._headers[name];
+ const all = [...(Array.isArray(current) ? current : [current]), ...(Array.isArray(value) ? value : [value])].filter(
+ Boolean,
+ );
+ this._headers[name] = all.length > 1 ? all : all[0];
+ return this;
+ }
+ setHeader(name, value) {
+ this._headers[name.toLowerCase()] = value;
+ return this;
+ }
+ getHeader(name) {
+ return this._headers[name.toLowerCase()];
+ }
+ getHeaders() {
+ return this._headers;
+ }
+ getHeaderNames() {
+ return Object.keys(this._headers);
+ }
+ hasHeader(name) {
+ return name.toLowerCase() in this._headers;
+ }
+ removeHeader(name) {
+ delete this._headers[name.toLowerCase()];
+ }
+ addTrailers(_headers) {}
+ flushHeaders() {}
+ writeEarlyHints(_headers, cb) {
+ if (typeof cb === "function") {
+ cb();
+ }
+ }
+}
+
+function hasProp(obj, prop) {
+ try {
+ return prop in obj;
+ } catch {
+ return false;
+ }
+}
+
+var __defProp$1 = Object.defineProperty;
+var __defNormalProp$1 = (obj, key, value) =>
+ key in obj
+ ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value })
+ : (obj[key] = value);
+var __publicField$1 = (obj, key, value) => {
+ __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
+ return value;
+};
+class H3Error extends Error {
+ constructor(message, opts = {}) {
+ super(message, opts);
+ __publicField$1(this, "statusCode", 500);
+ __publicField$1(this, "fatal", false);
+ __publicField$1(this, "unhandled", false);
+ __publicField$1(this, "statusMessage");
+ __publicField$1(this, "data");
+ __publicField$1(this, "cause");
+ if (opts.cause && !this.cause) {
+ this.cause = opts.cause;
+ }
+ }
+ toJSON() {
+ const obj = {
+ message: this.message,
+ statusCode: sanitizeStatusCode(this.statusCode, 500),
+ };
+ if (this.statusMessage) {
+ obj.statusMessage = sanitizeStatusMessage(this.statusMessage);
+ }
+ if (this.data !== void 0) {
+ obj.data = this.data;
+ }
+ return obj;
+ }
+}
+__publicField$1(H3Error, "__h3_error__", true);
+function createError$1(input) {
+ if (typeof input === "string") {
+ return new H3Error(input);
+ }
+ if (isError(input)) {
+ return input;
+ }
+ const err = new H3Error(input.message ?? input.statusMessage ?? "", {
+ cause: input.cause || input,
+ });
+ if (hasProp(input, "stack")) {
+ try {
+ Object.defineProperty(err, "stack", {
+ get() {
+ return input.stack;
+ },
+ });
+ } catch {
+ try {
+ err.stack = input.stack;
+ } catch {}
+ }
+ }
+ if (input.data) {
+ err.data = input.data;
+ }
+ if (input.statusCode) {
+ err.statusCode = sanitizeStatusCode(input.statusCode, err.statusCode);
+ } else if (input.status) {
+ err.statusCode = sanitizeStatusCode(input.status, err.statusCode);
+ }
+ if (input.statusMessage) {
+ err.statusMessage = input.statusMessage;
+ } else if (input.statusText) {
+ err.statusMessage = input.statusText;
+ }
+ if (err.statusMessage) {
+ const originalMessage = err.statusMessage;
+ const sanitizedMessage = sanitizeStatusMessage(err.statusMessage);
+ if (sanitizedMessage !== originalMessage) {
+ console.warn(
+ "[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default.",
+ );
+ }
+ }
+ if (input.fatal !== void 0) {
+ err.fatal = input.fatal;
+ }
+ if (input.unhandled !== void 0) {
+ err.unhandled = input.unhandled;
+ }
+ return err;
+}
+function sendError(event, error, debug) {
+ if (event.handled) {
+ return;
+ }
+ const h3Error = isError(error) ? error : createError$1(error);
+ const responseBody = {
+ statusCode: h3Error.statusCode,
+ statusMessage: h3Error.statusMessage,
+ stack: [],
+ data: h3Error.data,
+ };
+ if (debug) {
+ responseBody.stack = (h3Error.stack || "").split("\n").map(l => l.trim());
+ }
+ if (event.handled) {
+ return;
+ }
+ const _code = Number.parseInt(h3Error.statusCode);
+ setResponseStatus(event, _code, h3Error.statusMessage);
+ event.node.res.setHeader("content-type", MIMES.json);
+ event.node.res.end(JSON.stringify(responseBody, void 0, 2));
+}
+function isError(input) {
+ return input?.constructor?.__h3_error__ === true;
+}
+
+function getQuery(event) {
+ return getQuery$1(event.path || "");
+}
+function isMethod(event, expected, allowHead) {
+ if (allowHead && event.method === "HEAD") {
+ return true;
+ }
+ if (typeof expected === "string") {
+ if (event.method === expected) {
+ return true;
+ }
+ } else if (expected.includes(event.method)) {
+ return true;
+ }
+ return false;
+}
+function assertMethod(event, expected, allowHead) {
+ if (!isMethod(event, expected, allowHead)) {
+ throw createError$1({
+ statusCode: 405,
+ statusMessage: "HTTP method is not allowed.",
+ });
+ }
+}
+function getRequestHeaders(event) {
+ const _headers = {};
+ for (const key in event.node.req.headers) {
+ const val = event.node.req.headers[key];
+ _headers[key] = Array.isArray(val) ? val.filter(Boolean).join(", ") : val;
+ }
+ return _headers;
+}
+function getRequestHeader(event, name) {
+ const headers = getRequestHeaders(event);
+ const value = headers[name.toLowerCase()];
+ return value;
+}
+
+const RawBodySymbol = Symbol.for("h3RawBody");
+const ParsedBodySymbol = Symbol.for("h3ParsedBody");
+const PayloadMethods$1 = ["PATCH", "POST", "PUT", "DELETE"];
+function readRawBody(event, encoding = "utf8") {
+ assertMethod(event, PayloadMethods$1);
+ const _rawBody =
+ event._requestBody || event.web?.request?.body || event.node.req[RawBodySymbol] || event.node.req.body;
+ if (_rawBody) {
+ const promise2 = Promise.resolve(_rawBody).then(_resolved => {
+ if (Buffer.isBuffer(_resolved)) {
+ return _resolved;
+ }
+ if (typeof _resolved.pipeTo === "function") {
+ return new Promise((resolve, reject) => {
+ const chunks = [];
+ _resolved
+ .pipeTo(
+ new WritableStream({
+ write(chunk) {
+ chunks.push(chunk);
+ },
+ close() {
+ resolve(Buffer.concat(chunks));
+ },
+ abort(reason) {
+ reject(reason);
+ },
+ }),
+ )
+ .catch(reject);
+ });
+ } else if (typeof _resolved.pipe === "function") {
+ return new Promise((resolve, reject) => {
+ const chunks = [];
+ _resolved
+ .on("data", chunk => {
+ chunks.push(chunk);
+ })
+ .on("end", () => {
+ resolve(Buffer.concat(chunks));
+ })
+ .on("error", reject);
+ });
+ }
+ if (_resolved.constructor === Object) {
+ return Buffer.from(JSON.stringify(_resolved));
+ }
+ return Buffer.from(_resolved);
+ });
+ return encoding ? promise2.then(buff => buff.toString(encoding)) : promise2;
+ }
+ if (!Number.parseInt(event.node.req.headers["content-length"] || "")) {
+ return Promise.resolve(void 0);
+ }
+ const promise = (event.node.req[RawBodySymbol] = new Promise((resolve, reject) => {
+ const bodyData = [];
+ event.node.req
+ .on("error", err => {
+ reject(err);
+ })
+ .on("data", chunk => {
+ bodyData.push(chunk);
+ })
+ .on("end", () => {
+ resolve(Buffer.concat(bodyData));
+ });
+ }));
+ const result = encoding ? promise.then(buff => buff.toString(encoding)) : promise;
+ return result;
+}
+async function readBody(event, options = {}) {
+ const request = event.node.req;
+ if (hasProp(request, ParsedBodySymbol)) {
+ return request[ParsedBodySymbol];
+ }
+ const contentType = request.headers["content-type"] || "";
+ const body = await readRawBody(event);
+ let parsed;
+ if (contentType === "application/json") {
+ parsed = _parseJSON(body, options.strict ?? true);
+ } else if (contentType.startsWith("application/x-www-form-urlencoded")) {
+ parsed = _parseURLEncodedBody(body);
+ } else if (contentType.startsWith("text/")) {
+ parsed = body;
+ } else {
+ parsed = _parseJSON(body, options.strict ?? false);
+ }
+ request[ParsedBodySymbol] = parsed;
+ return parsed;
+}
+function getRequestWebStream(event) {
+ if (!PayloadMethods$1.includes(event.method)) {
+ return;
+ }
+ return (
+ event.web?.request?.body ||
+ event._requestBody ||
+ new ReadableStream({
+ start: controller => {
+ event.node.req.on("data", chunk => {
+ controller.enqueue(chunk);
+ });
+ event.node.req.on("end", () => {
+ controller.close();
+ });
+ event.node.req.on("error", err => {
+ controller.error(err);
+ });
+ },
+ })
+ );
+}
+function _parseJSON(body = "", strict) {
+ if (!body) {
+ return void 0;
+ }
+ try {
+ return destr(body, { strict });
+ } catch {
+ throw createError$1({
+ statusCode: 400,
+ statusMessage: "Bad Request",
+ message: "Invalid JSON body",
+ });
+ }
+}
+function _parseURLEncodedBody(body) {
+ const form = new URLSearchParams(body);
+ const parsedForm = /* @__PURE__ */ Object.create(null);
+ for (const [key, value] of form.entries()) {
+ if (hasProp(parsedForm, key)) {
+ if (!Array.isArray(parsedForm[key])) {
+ parsedForm[key] = [parsedForm[key]];
+ }
+ parsedForm[key].push(value);
+ } else {
+ parsedForm[key] = value;
+ }
+ }
+ return parsedForm;
+}
+
+function handleCacheHeaders(event, opts) {
+ const cacheControls = ["public", ...(opts.cacheControls || [])];
+ let cacheMatched = false;
+ if (opts.maxAge !== void 0) {
+ cacheControls.push(`max-age=${+opts.maxAge}`, `s-maxage=${+opts.maxAge}`);
+ }
+ if (opts.modifiedTime) {
+ const modifiedTime = new Date(opts.modifiedTime);
+ const ifModifiedSince = event.node.req.headers["if-modified-since"];
+ event.node.res.setHeader("last-modified", modifiedTime.toUTCString());
+ if (ifModifiedSince && new Date(ifModifiedSince) >= opts.modifiedTime) {
+ cacheMatched = true;
+ }
+ }
+ if (opts.etag) {
+ event.node.res.setHeader("etag", opts.etag);
+ const ifNonMatch = event.node.req.headers["if-none-match"];
+ if (ifNonMatch === opts.etag) {
+ cacheMatched = true;
+ }
+ }
+ event.node.res.setHeader("cache-control", cacheControls.join(", "));
+ if (cacheMatched) {
+ event.node.res.statusCode = 304;
+ if (!event.handled) {
+ event.node.res.end();
+ }
+ return true;
+ }
+ return false;
+}
+
+const MIMES = {
+ html: "text/html",
+ json: "application/json",
+};
+
+const DISALLOWED_STATUS_CHARS = /[^\u0009\u0020-\u007E]/g;
+function sanitizeStatusMessage(statusMessage = "") {
+ return statusMessage.replace(DISALLOWED_STATUS_CHARS, "");
+}
+function sanitizeStatusCode(statusCode, defaultStatusCode = 200) {
+ if (!statusCode) {
+ return defaultStatusCode;
+ }
+ if (typeof statusCode === "string") {
+ statusCode = Number.parseInt(statusCode, 10);
+ }
+ if (statusCode < 100 || statusCode > 999) {
+ return defaultStatusCode;
+ }
+ return statusCode;
+}
+function setCookie(event, name, value, serializeOptions) {
+ const cookieStr = serialize(name, value, {
+ path: "/",
+ ...serializeOptions,
+ });
+ let setCookies = event.node.res.getHeader("set-cookie");
+ if (!Array.isArray(setCookies)) {
+ setCookies = [setCookies];
+ }
+ setCookies = setCookies.filter(cookieValue => {
+ return cookieValue && !cookieValue.startsWith(name + "=");
+ });
+ event.node.res.setHeader("set-cookie", [...setCookies, cookieStr]);
+}
+function splitCookiesString(cookiesString) {
+ if (Array.isArray(cookiesString)) {
+ return cookiesString.flatMap(c => splitCookiesString(c));
+ }
+ if (typeof cookiesString !== "string") {
+ return [];
+ }
+ const cookiesStrings = [];
+ let pos = 0;
+ let start;
+ let ch;
+ let lastComma;
+ let nextStart;
+ let cookiesSeparatorFound;
+ const skipWhitespace = () => {
+ while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
+ pos += 1;
+ }
+ return pos < cookiesString.length;
+ };
+ const notSpecialChar = () => {
+ ch = cookiesString.charAt(pos);
+ return ch !== "=" && ch !== ";" && ch !== ",";
+ };
+ while (pos < cookiesString.length) {
+ start = pos;
+ cookiesSeparatorFound = false;
+ while (skipWhitespace()) {
+ ch = cookiesString.charAt(pos);
+ if (ch === ",") {
+ lastComma = pos;
+ pos += 1;
+ skipWhitespace();
+ nextStart = pos;
+ while (pos < cookiesString.length && notSpecialChar()) {
+ pos += 1;
+ }
+ if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
+ cookiesSeparatorFound = true;
+ pos = nextStart;
+ cookiesStrings.push(cookiesString.slice(start, lastComma));
+ start = pos;
+ } else {
+ pos = lastComma + 1;
+ }
+ } else {
+ pos += 1;
+ }
+ }
+ if (!cookiesSeparatorFound || pos >= cookiesString.length) {
+ cookiesStrings.push(cookiesString.slice(start, cookiesString.length));
+ }
+ }
+ return cookiesStrings;
+}
+
+const defer = typeof setImmediate === "undefined" ? fn => fn() : setImmediate;
+function send(event, data, type) {
+ if (type) {
+ defaultContentType(event, type);
+ }
+ return new Promise(resolve => {
+ defer(() => {
+ if (!event.handled) {
+ event.node.res.end(data);
+ }
+ resolve();
+ });
+ });
+}
+function sendNoContent(event, code) {
+ if (event.handled) {
+ return;
+ }
+ const _code = sanitizeStatusCode(code, 204);
+ if (_code === 204) {
+ event.node.res.removeHeader("content-length");
+ }
+ event.node.res.writeHead(_code);
+ event.node.res.end();
+}
+function setResponseStatus(event, code, text) {
+ if (code) {
+ event.node.res.statusCode = sanitizeStatusCode(code, event.node.res.statusCode);
+ }
+ if (text) {
+ event.node.res.statusMessage = sanitizeStatusMessage(text);
+ }
+}
+function defaultContentType(event, type) {
+ if (type && !event.node.res.getHeader("content-type")) {
+ event.node.res.setHeader("content-type", type);
+ }
+}
+function sendRedirect(event, location, code = 302) {
+ event.node.res.statusCode = sanitizeStatusCode(code, event.node.res.statusCode);
+ event.node.res.setHeader("location", location);
+ const encodedLoc = location.replace(/"/g, "%22");
+ const html = `<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${encodedLoc}"></head></html>`;
+ return send(event, html, MIMES.html);
+}
+function getResponseHeader(event, name) {
+ return event.node.res.getHeader(name);
+}
+function setResponseHeaders(event, headers) {
+ for (const [name, value] of Object.entries(headers)) {
+ event.node.res.setHeader(name, value);
+ }
+}
+const setHeaders = setResponseHeaders;
+function setResponseHeader(event, name, value) {
+ event.node.res.setHeader(name, value);
+}
+const setHeader = setResponseHeader;
+function appendResponseHeader(event, name, value) {
+ let current = event.node.res.getHeader(name);
+ if (!current) {
+ event.node.res.setHeader(name, value);
+ return;
+ }
+ if (!Array.isArray(current)) {
+ current = [current.toString()];
+ }
+ event.node.res.setHeader(name, [...current, value]);
+}
+const appendHeader = appendResponseHeader;
+function removeResponseHeader(event, name) {
+ return event.node.res.removeHeader(name);
+}
+function isStream(data) {
+ if (!data || typeof data !== "object") {
+ return false;
+ }
+ if (typeof data.pipe === "function") {
+ if (typeof data._read === "function") {
+ return true;
+ }
+ if (typeof data.abort === "function") {
+ return true;
+ }
+ }
+ if (typeof data.pipeTo === "function") {
+ return true;
+ }
+ return false;
+}
+function isWebResponse(data) {
+ return typeof Response !== "undefined" && data instanceof Response;
+}
+function sendStream(event, stream) {
+ if (!stream || typeof stream !== "object") {
+ throw new Error("[h3] Invalid stream provided.");
+ }
+ event.node.res._data = stream;
+ if (!event.node.res.socket) {
+ event._handled = true;
+ return Promise.resolve();
+ }
+ if (hasProp(stream, "pipeTo") && typeof stream.pipeTo === "function") {
+ return stream
+ .pipeTo(
+ new WritableStream({
+ write(chunk) {
+ event.node.res.write(chunk);
+ },
+ }),
+ )
+ .then(() => {
+ event.node.res.end();
+ });
+ }
+ if (hasProp(stream, "pipe") && typeof stream.pipe === "function") {
+ return new Promise((resolve, reject) => {
+ stream.pipe(event.node.res);
+ if (stream.on) {
+ stream.on("end", () => {
+ event.node.res.end();
+ resolve();
+ });
+ stream.on("error", error => {
+ reject(error);
+ });
+ }
+ event.node.res.on("close", () => {
+ if (stream.abort) {
+ stream.abort();
+ }
+ });
+ });
+ }
+ throw new Error("[h3] Invalid or incompatible stream provided.");
+}
+function sendWebResponse(event, response) {
+ for (const [key, value] of response.headers) {
+ if (key === "set-cookie") {
+ event.node.res.appendHeader(key, splitCookiesString(value));
+ } else {
+ event.node.res.setHeader(key, value);
+ }
+ }
+ if (response.status) {
+ event.node.res.statusCode = sanitizeStatusCode(response.status, event.node.res.statusCode);
+ }
+ if (response.statusText) {
+ event.node.res.statusMessage = sanitizeStatusMessage(response.statusText);
+ }
+ if (response.redirected) {
+ event.node.res.setHeader("location", response.url);
+ }
+ if (!response.body) {
+ event.node.res.end();
+ return;
+ }
+ return sendStream(event, response.body);
+}
+
+const PayloadMethods = /* @__PURE__ */ new Set(["PATCH", "POST", "PUT", "DELETE"]);
+const ignoredHeaders = /* @__PURE__ */ new Set([
+ "transfer-encoding",
+ "connection",
+ "keep-alive",
+ "upgrade",
+ "expect",
+ "host",
+]);
+async function proxyRequest(event, target, opts = {}) {
+ let body;
+ let duplex;
+ if (PayloadMethods.has(event.method)) {
+ if (opts.streamRequest) {
+ body = getRequestWebStream(event);
+ duplex = "half";
+ } else {
+ body = await readRawBody(event, false).catch(() => void 0);
+ }
+ }
+ const method = opts.fetchOptions?.method || event.method;
+ const fetchHeaders = mergeHeaders(getProxyRequestHeaders(event), opts.fetchOptions?.headers, opts.headers);
+ return sendProxy(event, target, {
+ ...opts,
+ fetchOptions: {
+ method,
+ body,
+ duplex,
+ ...opts.fetchOptions,
+ headers: fetchHeaders,
+ },
+ });
+}
+async function sendProxy(event, target, opts = {}) {
+ const response = await _getFetch(opts.fetch)(target, {
+ headers: opts.headers,
+ ignoreResponseError: true,
+ // make $ofetch.raw transparent
+ ...opts.fetchOptions,
+ });
+ event.node.res.statusCode = sanitizeStatusCode(response.status, event.node.res.statusCode);
+ event.node.res.statusMessage = sanitizeStatusMessage(response.statusText);
+ const cookies = [];
+ for (const [key, value] of response.headers.entries()) {
+ if (key === "content-encoding") {
+ continue;
+ }
+ if (key === "content-length") {
+ continue;
+ }
+ if (key === "set-cookie") {
+ cookies.push(...splitCookiesString(value));
+ continue;
+ }
+ event.node.res.setHeader(key, value);
+ }
+ if (cookies.length > 0) {
+ event.node.res.setHeader(
+ "set-cookie",
+ cookies.map(cookie => {
+ if (opts.cookieDomainRewrite) {
+ cookie = rewriteCookieProperty(cookie, opts.cookieDomainRewrite, "domain");
+ }
+ if (opts.cookiePathRewrite) {
+ cookie = rewriteCookieProperty(cookie, opts.cookiePathRewrite, "path");
+ }
+ return cookie;
+ }),
+ );
+ }
+ if (opts.onResponse) {
+ await opts.onResponse(event, response);
+ }
+ if (response._data !== void 0) {
+ return response._data;
+ }
+ if (event.handled) {
+ return;
+ }
+ if (opts.sendStream === false) {
+ const data = new Uint8Array(await response.arrayBuffer());
+ return event.node.res.end(data);
+ }
+ if (response.body) {
+ for await (const chunk of response.body) {
+ event.node.res.write(chunk);
+ }
+ }
+ return event.node.res.end();
+}
+function getProxyRequestHeaders(event) {
+ const headers = /* @__PURE__ */ Object.create(null);
+ const reqHeaders = getRequestHeaders(event);
+ for (const name in reqHeaders) {
+ if (!ignoredHeaders.has(name)) {
+ headers[name] = reqHeaders[name];
+ }
+ }
+ return headers;
+}
+function fetchWithEvent(event, req, init, options) {
+ return _getFetch(options?.fetch)(req, {
+ ...init,
+ context: init?.context || event.context,
+ headers: {
+ ...getProxyRequestHeaders(event),
+ ...init?.headers,
+ },
+ });
+}
+function _getFetch(_fetch) {
+ if (_fetch) {
+ return _fetch;
+ }
+ if (globalThis.fetch) {
+ return globalThis.fetch;
+ }
+ throw new Error("fetch is not available. Try importing `node-fetch-native/polyfill` for Node.js.");
+}
+function rewriteCookieProperty(header, map, property) {
+ const _map = typeof map === "string" ? { "*": map } : map;
+ return header.replace(new RegExp(`(;\\s*${property}=)([^;]+)`, "gi"), (match, prefix, previousValue) => {
+ let newValue;
+ if (previousValue in _map) {
+ newValue = _map[previousValue];
+ } else if ("*" in _map) {
+ newValue = _map["*"];
+ } else {
+ return match;
+ }
+ return newValue ? prefix + newValue : "";
+ });
+}
+function mergeHeaders(defaults, ...inputs) {
+ const _inputs = inputs.filter(Boolean);
+ if (_inputs.length === 0) {
+ return defaults;
+ }
+ const merged = new Headers(defaults);
+ for (const input of _inputs) {
+ for (const [key, value] of Object.entries(input)) {
+ if (value !== void 0) {
+ merged.set(key, value);
+ }
+ }
+ }
+ return merged;
+}
+
+var __defProp = Object.defineProperty;
+var __defNormalProp = (obj, key, value) =>
+ key in obj
+ ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value })
+ : (obj[key] = value);
+var __publicField = (obj, key, value) => {
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
+ return value;
+};
+class H3Event {
+ constructor(req, res) {
+ __publicField(this, "__is_event__", true);
+ // Context
+ __publicField(this, "node");
+ // Node
+ __publicField(this, "web");
+ // Web
+ __publicField(this, "context", {});
+ // Shared
+ // Request
+ __publicField(this, "_method");
+ __publicField(this, "_path");
+ __publicField(this, "_headers");
+ __publicField(this, "_requestBody");
+ // Response
+ __publicField(this, "_handled", false);
+ this.node = { req, res };
+ }
+ // --- Request ---
+ get method() {
+ if (!this._method) {
+ this._method = (this.node.req.method || "GET").toUpperCase();
+ }
+ return this._method;
+ }
+ get path() {
+ return this._path || this.node.req.url || "/";
+ }
+ get headers() {
+ if (!this._headers) {
+ this._headers = _normalizeNodeHeaders(this.node.req.headers);
+ }
+ return this._headers;
+ }
+ // --- Respoonse ---
+ get handled() {
+ return this._handled || this.node.res.writableEnded || this.node.res.headersSent;
+ }
+ respondWith(response) {
+ return Promise.resolve(response).then(_response => sendWebResponse(this, _response));
+ }
+ // --- Utils ---
+ toString() {
+ return `[${this.method}] ${this.path}`;
+ }
+ toJSON() {
+ return this.toString();
+ }
+ // --- Deprecated ---
+ /** @deprecated Please use `event.node.req` instead. **/
+ get req() {
+ return this.node.req;
+ }
+ /** @deprecated Please use `event.node.res` instead. **/
+ get res() {
+ return this.node.res;
+ }
+}
+function isEvent(input) {
+ return hasProp(input, "__is_event__");
+}
+function createEvent(req, res) {
+ return new H3Event(req, res);
+}
+function _normalizeNodeHeaders(nodeHeaders) {
+ const headers = new Headers();
+ for (const [name, value] of Object.entries(nodeHeaders)) {
+ if (Array.isArray(value)) {
+ for (const item of value) {
+ headers.append(name, item);
+ }
+ } else if (value) {
+ headers.set(name, value);
+ }
+ }
+ return headers;
+}
+
+function defineEventHandler(handler) {
+ if (typeof handler === "function") {
+ return Object.assign(handler, { __is_handler__: true });
+ }
+ const _hooks = {
+ onRequest: _normalizeArray(handler.onRequest),
+ onBeforeResponse: _normalizeArray(handler.onBeforeResponse),
+ };
+ const _handler = event => {
+ return _callHandler(event, handler.handler, _hooks);
+ };
+ return Object.assign(_handler, { __is_handler__: true });
+}
+function _normalizeArray(input) {
+ return input ? (Array.isArray(input) ? input : [input]) : void 0;
+}
+async function _callHandler(event, handler, hooks) {
+ if (hooks.onRequest) {
+ for (const hook of hooks.onRequest) {
+ await hook(event);
+ if (event.handled) {
+ return;
+ }
+ }
+ }
+ const body = await handler(event);
+ const response = { body };
+ if (hooks.onBeforeResponse) {
+ for (const hook of hooks.onBeforeResponse) {
+ await hook(event, response);
+ }
+ }
+ return response.body;
+}
+const eventHandler = defineEventHandler;
+function isEventHandler(input) {
+ return hasProp(input, "__is_handler__");
+}
+function toEventHandler(input, _, _route) {
+ if (!isEventHandler(input)) {
+ console.warn(
+ "[h3] Implicit event handler conversion is deprecated. Use `eventHandler()` or `fromNodeMiddleware()` to define event handlers.",
+ _route && _route !== "/"
+ ? `
+ Route: ${_route}`
+ : "",
+ `
+ Handler: ${input}`,
+ );
+ }
+ return input;
+}
+function defineLazyEventHandler(factory) {
+ let _promise;
+ let _resolved;
+ const resolveHandler = () => {
+ if (_resolved) {
+ return Promise.resolve(_resolved);
+ }
+ if (!_promise) {
+ _promise = Promise.resolve(factory()).then(r => {
+ const handler = r.default || r;
+ if (typeof handler !== "function") {
+ throw new TypeError("Invalid lazy handler result. It should be a function:", handler);
+ }
+ _resolved = toEventHandler(r.default || r);
+ return _resolved;
+ });
+ }
+ return _promise;
+ };
+ return eventHandler(event => {
+ if (_resolved) {
+ return _resolved(event);
+ }
+ return resolveHandler().then(handler => handler(event));
+ });
+}
+const lazyEventHandler = defineLazyEventHandler;
+
+function createApp(options = {}) {
+ const stack = [];
+ const handler = createAppEventHandler(stack, options);
+ const app = {
+ // @ts-ignore
+ use: (arg1, arg2, arg3) => use(app, arg1, arg2, arg3),
+ handler,
+ stack,
+ options,
+ };
+ return app;
+}
+function use(app, arg1, arg2, arg3) {
+ if (Array.isArray(arg1)) {
+ for (const i of arg1) {
+ use(app, i, arg2, arg3);
+ }
+ } else if (Array.isArray(arg2)) {
+ for (const i of arg2) {
+ use(app, arg1, i, arg3);
+ }
+ } else if (typeof arg1 === "string") {
+ app.stack.push(normalizeLayer({ ...arg3, route: arg1, handler: arg2 }));
+ } else if (typeof arg1 === "function") {
+ app.stack.push(normalizeLayer({ ...arg2, route: "/", handler: arg1 }));
+ } else {
+ app.stack.push(normalizeLayer({ ...arg1 }));
+ }
+ return app;
+}
+function createAppEventHandler(stack, options) {
+ const spacing = options.debug ? 2 : void 0;
+ return eventHandler(async event => {
+ event.node.req.originalUrl = event.node.req.originalUrl || event.node.req.url || "/";
+ const _reqPath = event._path || event.node.req.url || "/";
+ let _layerPath;
+ if (options.onRequest) {
+ await options.onRequest(event);
+ }
+ for (const layer of stack) {
+ if (layer.route.length > 1) {
+ if (!_reqPath.startsWith(layer.route)) {
+ continue;
+ }
+ _layerPath = _reqPath.slice(layer.route.length) || "/";
+ } else {
+ _layerPath = _reqPath;
+ }
+ if (layer.match && !layer.match(_layerPath, event)) {
+ continue;
+ }
+ event._path = _layerPath;
+ event.node.req.url = _layerPath;
+ const val = await layer.handler(event);
+ const _body = val === void 0 ? void 0 : await val;
+ if (_body !== void 0) {
+ const _response = { body: _body };
+ if (options.onBeforeResponse) {
+ await options.onBeforeResponse(event, _response);
+ }
+ await handleHandlerResponse(event, _response.body, spacing);
+ if (options.onAfterResponse) {
+ await options.onAfterResponse(event, _response);
+ }
+ return;
+ }
+ if (event.handled) {
+ if (options.onAfterResponse) {
+ await options.onAfterResponse(event, void 0);
+ }
+ return;
+ }
+ }
+ if (!event.handled) {
+ throw createError$1({
+ statusCode: 404,
+ statusMessage: `Cannot find any path matching ${event.path || "/"}.`,
+ });
+ }
+ if (options.onAfterResponse) {
+ await options.onAfterResponse(event, void 0);
+ }
+ });
+}
+function normalizeLayer(input) {
+ let handler = input.handler;
+ if (handler.handler) {
+ handler = handler.handler;
+ }
+ if (input.lazy) {
+ handler = lazyEventHandler(handler);
+ } else if (!isEventHandler(handler)) {
+ handler = toEventHandler(handler, void 0, input.route);
+ }
+ return {
+ route: withoutTrailingSlash(input.route),
+ match: input.match,
+ handler,
+ };
+}
+function handleHandlerResponse(event, val, jsonSpace) {
+ if (val === null) {
+ return sendNoContent(event);
+ }
+ if (val) {
+ if (isWebResponse(val)) {
+ return sendWebResponse(event, val);
+ }
+ if (isStream(val)) {
+ return sendStream(event, val);
+ }
+ if (val.buffer) {
+ return send(event, val);
+ }
+ if (val.arrayBuffer && typeof val.arrayBuffer === "function") {
+ return val.arrayBuffer().then(arrayBuffer => {
+ return send(event, Buffer.from(arrayBuffer), val.type);
+ });
+ }
+ if (val instanceof Error) {
+ throw createError$1(val);
+ }
+ if (typeof val.end === "function") {
+ return true;
+ }
+ }
+ const valType = typeof val;
+ if (valType === "string") {
+ return send(event, val, MIMES.html);
+ }
+ if (valType === "object" || valType === "boolean" || valType === "number") {
+ return send(event, JSON.stringify(val, void 0, jsonSpace), MIMES.json);
+ }
+ if (valType === "bigint") {
+ return send(event, val.toString(), MIMES.json);
+ }
+ throw createError$1({
+ statusCode: 500,
+ statusMessage: `[h3] Cannot send ${valType} as response.`,
+ });
+}
+
+const RouterMethods = ["connect", "delete", "get", "head", "options", "post", "put", "trace", "patch"];
+function createRouter(opts = {}) {
+ const _router = createRouter$1({});
+ const routes = {};
+ let _matcher;
+ const router = {};
+ const addRoute = (path, handler, method) => {
+ let route = routes[path];
+ if (!route) {
+ routes[path] = route = { path, handlers: {} };
+ _router.insert(path, route);
+ }
+ if (Array.isArray(method)) {
+ for (const m of method) {
+ addRoute(path, handler, m);
+ }
+ } else {
+ route.handlers[method] = toEventHandler(handler, void 0, path);
+ }
+ return router;
+ };
+ router.use = router.add = (path, handler, method) => addRoute(path, handler, method || "all");
+ for (const method of RouterMethods) {
+ router[method] = (path, handle) => router.add(path, handle, method);
+ }
+ router.handler = eventHandler(event => {
+ let path = event.path || "/";
+ const qIndex = path.indexOf("?");
+ if (qIndex !== -1) {
+ path = path.slice(0, Math.max(0, qIndex));
+ }
+ const matched = _router.lookup(path);
+ if (!matched || !matched.handlers) {
+ if (opts.preemptive || opts.preemtive) {
+ throw createError$1({
+ statusCode: 404,
+ name: "Not Found",
+ statusMessage: `Cannot find any route matching ${event.path || "/"}.`,
+ });
+ } else {
+ return;
+ }
+ }
+ const method = (event.node.req.method || "get").toLowerCase();
+ let handler = matched.handlers[method] || matched.handlers.all;
+ if (!handler) {
+ if (!_matcher) {
+ _matcher = toRouteMatcher(_router);
+ }
+ const _matches = _matcher.matchAll(path).reverse();
+ for (const _match of _matches) {
+ if (_match.handlers[method]) {
+ handler = _match.handlers[method];
+ matched.handlers[method] = matched.handlers[method] || handler;
+ break;
+ }
+ if (_match.handlers.all) {
+ handler = _match.handlers.all;
+ matched.handlers.all = matched.handlers.all || handler;
+ break;
+ }
+ }
+ }
+ if (!handler) {
+ if (opts.preemptive || opts.preemtive) {
+ throw createError$1({
+ statusCode: 405,
+ name: "Method Not Allowed",
+ statusMessage: `Method ${method} is not allowed on this route.`,
+ });
+ } else {
+ return;
+ }
+ }
+ event.context.matchedRoute = matched;
+ const params = matched.params || {};
+ event.context.params = params;
+ return Promise.resolve(handler(event)).then(res => {
+ if (res === void 0 && (opts.preemptive || opts.preemtive)) {
+ return null;
+ }
+ return res;
+ });
+ });
+ return router;
+}
+function toNodeListener(app) {
+ const toNodeHandle = async function (req, res) {
+ const event = createEvent(req, res);
+ try {
+ await app.handler(event);
+ } catch (_error) {
+ const error = createError$1(_error);
+ if (!isError(_error)) {
+ error.unhandled = true;
+ }
+ if (app.options.onError) {
+ await app.options.onError(error, event);
+ }
+ if (event.handled) {
+ return;
+ }
+ if (error.unhandled || error.fatal) {
+ console.error("[h3]", error.fatal ? "[fatal]" : "[unhandled]", error);
+ }
+ await sendError(event, error, !!app.options.debug);
+ }
+ };
+ return toNodeHandle;
+}
+
+class FetchError extends Error {
+ constructor(message, opts) {
+ super(message, opts);
+ this.name = "FetchError";
+ if (opts?.cause && !this.cause) {
+ this.cause = opts.cause;
+ }
+ }
+}
+function createFetchError(ctx) {
+ const errorMessage = ctx.error?.message || ctx.error?.toString() || "";
+ const method = ctx.request?.method || ctx.options?.method || "GET";
+ const url = ctx.request?.url || String(ctx.request) || "/";
+ const requestStr = `[${method}] ${JSON.stringify(url)}`;
+ const statusStr = ctx.response ? `${ctx.response.status} ${ctx.response.statusText}` : "<no response>";
+ const message = `${requestStr}: ${statusStr}${errorMessage ? ` ${errorMessage}` : ""}`;
+ const fetchError = new FetchError(message, ctx.error ? { cause: ctx.error } : void 0);
+ for (const key of ["request", "options", "response"]) {
+ Object.defineProperty(fetchError, key, {
+ get() {
+ return ctx[key];
+ },
+ });
+ }
+ for (const [key, refKey] of [
+ ["data", "_data"],
+ ["status", "status"],
+ ["statusCode", "status"],
+ ["statusText", "statusText"],
+ ["statusMessage", "statusText"],
+ ]) {
+ Object.defineProperty(fetchError, key, {
+ get() {
+ return ctx.response && ctx.response[refKey];
+ },
+ });
+ }
+ return fetchError;
+}
+
+const payloadMethods = new Set(Object.freeze(["PATCH", "POST", "PUT", "DELETE"]));
+function isPayloadMethod(method = "GET") {
+ return payloadMethods.has(method.toUpperCase());
+}
+function isJSONSerializable(value) {
+ if (value === void 0) {
+ return false;
+ }
+ const t = typeof value;
+ if (t === "string" || t === "number" || t === "boolean" || t === null) {
+ return true;
+ }
+ if (t !== "object") {
+ return false;
+ }
+ if (Array.isArray(value)) {
+ return true;
+ }
+ if (value.buffer) {
+ return false;
+ }
+ return (value.constructor && value.constructor.name === "Object") || typeof value.toJSON === "function";
+}
+const textTypes = /* @__PURE__ */ new Set(["image/svg", "application/xml", "application/xhtml", "application/html"]);
+const JSON_RE = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;
+function detectResponseType(_contentType = "") {
+ if (!_contentType) {
+ return "json";
+ }
+ const contentType = _contentType.split(";").shift() || "";
+ if (JSON_RE.test(contentType)) {
+ return "json";
+ }
+ if (textTypes.has(contentType) || contentType.startsWith("text/")) {
+ return "text";
+ }
+ return "blob";
+}
+function mergeFetchOptions(input, defaults, Headers = globalThis.Headers) {
+ const merged = {
+ ...defaults,
+ ...input,
+ };
+ if (defaults?.params && input?.params) {
+ merged.params = {
+ ...defaults?.params,
+ ...input?.params,
+ };
+ }
+ if (defaults?.query && input?.query) {
+ merged.query = {
+ ...defaults?.query,
+ ...input?.query,
+ };
+ }
+ if (defaults?.headers && input?.headers) {
+ merged.headers = new Headers(defaults?.headers || {});
+ for (const [key, value] of new Headers(input?.headers || {})) {
+ merged.headers.set(key, value);
+ }
+ }
+ return merged;
+}
+
+const retryStatusCodes = /* @__PURE__ */ new Set([
+ 408,
+ // Request Timeout
+ 409,
+ // Conflict
+ 425,
+ // Too Early
+ 429,
+ // Too Many Requests
+ 500,
+ // Internal Server Error
+ 502,
+ // Bad Gateway
+ 503,
+ // Service Unavailable
+ 504,
+ // Gateway Timeout
+]);
+const nullBodyResponses$1 = /* @__PURE__ */ new Set([101, 204, 205, 304]);
+function createFetch$1(globalOptions = {}) {
+ const {
+ fetch = globalThis.fetch,
+ Headers = globalThis.Headers,
+ AbortController = globalThis.AbortController,
+ } = globalOptions;
+ async function onError(context) {
+ const isAbort = (context.error && context.error.name === "AbortError" && !context.options.timeout) || false;
+ if (context.options.retry !== false && !isAbort) {
+ let retries;
+ if (typeof context.options.retry === "number") {
+ retries = context.options.retry;
+ } else {
+ retries = isPayloadMethod(context.options.method) ? 0 : 1;
+ }
+ const responseCode = (context.response && context.response.status) || 500;
+ if (
+ retries > 0 &&
+ (Array.isArray(context.options.retryStatusCodes)
+ ? context.options.retryStatusCodes.includes(responseCode)
+ : retryStatusCodes.has(responseCode))
+ ) {
+ const retryDelay = context.options.retryDelay || 0;
+ if (retryDelay > 0) {
+ await new Promise(resolve => setTimeout(resolve, retryDelay));
+ }
+ return $fetchRaw(context.request, {
+ ...context.options,
+ retry: retries - 1,
+ timeout: context.options.timeout,
+ });
+ }
+ }
+ const error = createFetchError(context);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(error, $fetchRaw);
+ }
+ throw error;
+ }
+ const $fetchRaw = async function $fetchRaw2(_request, _options = {}) {
+ const context = {
+ request: _request,
+ options: mergeFetchOptions(_options, globalOptions.defaults, Headers),
+ response: void 0,
+ error: void 0,
+ };
+ context.options.method = context.options.method?.toUpperCase();
+ if (context.options.onRequest) {
+ await context.options.onRequest(context);
+ }
+ if (typeof context.request === "string") {
+ if (context.options.baseURL) {
+ context.request = withBase(context.request, context.options.baseURL);
+ }
+ if (context.options.query || context.options.params) {
+ context.request = withQuery(context.request, {
+ ...context.options.params,
+ ...context.options.query,
+ });
+ }
+ }
+ if (context.options.body && isPayloadMethod(context.options.method)) {
+ if (isJSONSerializable(context.options.body)) {
+ context.options.body =
+ typeof context.options.body === "string" ? context.options.body : JSON.stringify(context.options.body);
+ context.options.headers = new Headers(context.options.headers || {});
+ if (!context.options.headers.has("content-type")) {
+ context.options.headers.set("content-type", "application/json");
+ }
+ if (!context.options.headers.has("accept")) {
+ context.options.headers.set("accept", "application/json");
+ }
+ } else if (
+ // ReadableStream Body
+ ("pipeTo" in context.options.body && typeof context.options.body.pipeTo === "function") || // Node.js Stream Body
+ typeof context.options.body.pipe === "function"
+ ) {
+ if (!("duplex" in context.options)) {
+ context.options.duplex = "half";
+ }
+ }
+ }
+ if (!context.options.signal && context.options.timeout) {
+ const controller = new AbortController();
+ setTimeout(() => controller.abort(), context.options.timeout);
+ context.options.signal = controller.signal;
+ }
+ try {
+ context.response = await fetch(context.request, context.options);
+ } catch (error) {
+ context.error = error;
+ if (context.options.onRequestError) {
+ await context.options.onRequestError(context);
+ }
+ return await onError(context);
+ }
+ const hasBody =
+ context.response.body && !nullBodyResponses$1.has(context.response.status) && context.options.method !== "HEAD";
+ if (hasBody) {
+ const responseType =
+ (context.options.parseResponse ? "json" : context.options.responseType) ||
+ detectResponseType(context.response.headers.get("content-type") || "");
+ switch (responseType) {
+ case "json": {
+ const data = await context.response.text();
+ const parseFunction = context.options.parseResponse || destr;
+ context.response._data = parseFunction(data);
+ break;
+ }
+ case "stream": {
+ context.response._data = context.response.body;
+ break;
+ }
+ default: {
+ context.response._data = await context.response[responseType]();
+ }
+ }
+ }
+ if (context.options.onResponse) {
+ await context.options.onResponse(context);
+ }
+ if (!context.options.ignoreResponseError && context.response.status >= 400 && context.response.status < 600) {
+ if (context.options.onResponseError) {
+ await context.options.onResponseError(context);
+ }
+ return await onError(context);
+ }
+ return context.response;
+ };
+ const $fetch = async function $fetch2(request, options) {
+ const r = await $fetchRaw(request, options);
+ return r._data;
+ };
+ $fetch.raw = $fetchRaw;
+ $fetch.native = (...args) => fetch(...args);
+ $fetch.create = (defaultOptions = {}) =>
+ createFetch$1({
+ ...globalOptions,
+ defaults: {
+ ...globalOptions.defaults,
+ ...defaultOptions,
+ },
+ });
+ return $fetch;
+}
+
+const _globalThis$1 = (function () {
+ if (typeof globalThis !== "undefined") {
+ return globalThis;
+ }
+ if (typeof self !== "undefined") {
+ return self;
+ }
+ if (typeof global !== "undefined") {
+ return global;
+ }
+ throw new Error("unable to locate global object");
+})();
+const fetch = _globalThis$1.fetch || (() => Promise.reject(new Error("[ofetch] global.fetch is not supported!")));
+const Headers$1 = _globalThis$1.Headers;
+const AbortController = _globalThis$1.AbortController;
+createFetch$1({ fetch, Headers: Headers$1, AbortController });
+
+const nullBodyResponses = /* @__PURE__ */ new Set([101, 204, 205, 304]);
+function createCall(handle) {
+ return function callHandle(context) {
+ const req = new IncomingMessage();
+ const res = new ServerResponse(req);
+ req.url = context.url || "/";
+ req.method = context.method || "GET";
+ req.headers = {};
+ if (context.headers) {
+ const headerEntries =
+ typeof context.headers.entries === "function" ? context.headers.entries() : Object.entries(context.headers);
+ for (const [name, value] of headerEntries) {
+ if (!value) {
+ continue;
+ }
+ req.headers[name.toLowerCase()] = value;
+ }
+ }
+ req.headers.host = req.headers.host || context.host || "localhost";
+ req.connection.encrypted = req.connection.encrypted || context.protocol === "https"; // @ts-ignore
+ req.body = context.body || null;
+ req.__unenv__ = context.context;
+ return handle(req, res).then(() => {
+ let body = res._data;
+ if (nullBodyResponses.has(res.statusCode) || req.method.toUpperCase() === "HEAD") {
+ body = null;
+ delete res._headers["content-length"];
+ }
+ const r = {
+ body,
+ headers: res._headers,
+ status: res.statusCode,
+ statusText: res.statusMessage,
+ };
+ req.destroy();
+ res.destroy();
+ return r;
+ });
+ };
+}
+
+function createFetch(call, _fetch = global.fetch) {
+ return async function ufetch(input, init) {
+ const url = input.toString();
+ if (!url.startsWith("/")) {
+ return _fetch(url, init);
+ }
+ try {
+ const r = await call({ url, ...init });
+ return new Response(r.body, {
+ status: r.status,
+ statusText: r.statusText,
+ headers: Object.fromEntries(
+ Object.entries(r.headers).map(([name, value]) => [
+ name,
+ Array.isArray(value) ? value.join(",") : String(value) || "",
+ ]),
+ ),
+ });
+ } catch (error) {
+ return new Response(error.toString(), {
+ status: Number.parseInt(error.statusCode || error.code) || 500,
+ statusText: error.statusText,
+ });
+ }
+ };
+}
+
+function flatHooks(configHooks, hooks = {}, parentName) {
+ for (const key in configHooks) {
+ const subHook = configHooks[key];
+ const name = parentName ? `${parentName}:${key}` : key;
+ if (typeof subHook === "object" && subHook !== null) {
+ flatHooks(subHook, hooks, name);
+ } else if (typeof subHook === "function") {
+ hooks[name] = subHook;
+ }
+ }
+ return hooks;
+}
+const defaultTask = { run: function_ => function_() };
+const _createTask = () => defaultTask;
+const createTask = typeof console.createTask !== "undefined" ? console.createTask : _createTask;
+function serialTaskCaller(hooks, args) {
+ const name = args.shift();
+ const task = createTask(name);
+ return hooks.reduce(
+ (promise, hookFunction) => promise.then(() => task.run(() => hookFunction(...args))),
+ Promise.resolve(),
+ );
+}
+function parallelTaskCaller(hooks, args) {
+ const name = args.shift();
+ const task = createTask(name);
+ return Promise.all(hooks.map(hook => task.run(() => hook(...args))));
+}
+function callEachWith(callbacks, arg0) {
+ for (const callback of [...callbacks]) {
+ callback(arg0);
+ }
+}
+
+class Hookable {
+ constructor() {
+ this._hooks = {};
+ this._before = void 0;
+ this._after = void 0;
+ this._deprecatedMessages = void 0;
+ this._deprecatedHooks = {};
+ this.hook = this.hook.bind(this);
+ this.callHook = this.callHook.bind(this);
+ this.callHookWith = this.callHookWith.bind(this);
+ }
+ hook(name, function_, options = {}) {
+ if (!name || typeof function_ !== "function") {
+ return () => {};
+ }
+ const originalName = name;
+ let dep;
+ while (this._deprecatedHooks[name]) {
+ dep = this._deprecatedHooks[name];
+ name = dep.to;
+ }
+ if (dep && !options.allowDeprecated) {
+ let message = dep.message;
+ if (!message) {
+ message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : "");
+ }
+ if (!this._deprecatedMessages) {
+ this._deprecatedMessages = /* @__PURE__ */ new Set();
+ }
+ if (!this._deprecatedMessages.has(message)) {
+ console.warn(message);
+ this._deprecatedMessages.add(message);
+ }
+ }
+ if (!function_.name) {
+ try {
+ Object.defineProperty(function_, "name", {
+ get: () => "_" + name.replace(/\W+/g, "_") + "_hook_cb",
+ configurable: true,
+ });
+ } catch {}
+ }
+ this._hooks[name] = this._hooks[name] || [];
+ this._hooks[name].push(function_);
+ return () => {
+ if (function_) {
+ this.removeHook(name, function_);
+ function_ = void 0;
+ }
+ };
+ }
+ hookOnce(name, function_) {
+ let _unreg;
+ let _function = (...arguments_) => {
+ if (typeof _unreg === "function") {
+ _unreg();
+ }
+ _unreg = void 0;
+ _function = void 0;
+ return function_(...arguments_);
+ };
+ _unreg = this.hook(name, _function);
+ return _unreg;
+ }
+ removeHook(name, function_) {
+ if (this._hooks[name]) {
+ const index = this._hooks[name].indexOf(function_);
+ if (index !== -1) {
+ this._hooks[name].splice(index, 1);
+ }
+ if (this._hooks[name].length === 0) {
+ delete this._hooks[name];
+ }
+ }
+ }
+ deprecateHook(name, deprecated) {
+ this._deprecatedHooks[name] = typeof deprecated === "string" ? { to: deprecated } : deprecated;
+ const _hooks = this._hooks[name] || [];
+ delete this._hooks[name];
+ for (const hook of _hooks) {
+ this.hook(name, hook);
+ }
+ }
+ deprecateHooks(deprecatedHooks) {
+ Object.assign(this._deprecatedHooks, deprecatedHooks);
+ for (const name in deprecatedHooks) {
+ this.deprecateHook(name, deprecatedHooks[name]);
+ }
+ }
+ addHooks(configHooks) {
+ const hooks = flatHooks(configHooks);
+ const removeFns = Object.keys(hooks).map(key => this.hook(key, hooks[key]));
+ return () => {
+ for (const unreg of removeFns.splice(0, removeFns.length)) {
+ unreg();
+ }
+ };
+ }
+ removeHooks(configHooks) {
+ const hooks = flatHooks(configHooks);
+ for (const key in hooks) {
+ this.removeHook(key, hooks[key]);
+ }
+ }
+ removeAllHooks() {
+ for (const key in this._hooks) {
+ delete this._hooks[key];
+ }
+ }
+ callHook(name, ...arguments_) {
+ arguments_.unshift(name);
+ return this.callHookWith(serialTaskCaller, name, ...arguments_);
+ }
+ callHookParallel(name, ...arguments_) {
+ arguments_.unshift(name);
+ return this.callHookWith(parallelTaskCaller, name, ...arguments_);
+ }
+ callHookWith(caller, name, ...arguments_) {
+ const event = this._before || this._after ? { name, args: arguments_, context: {} } : void 0;
+ if (this._before) {
+ callEachWith(this._before, event);
+ }
+ const result = caller(name in this._hooks ? [...this._hooks[name]] : [], arguments_);
+ if (result instanceof Promise) {
+ return result.finally(() => {
+ if (this._after && event) {
+ callEachWith(this._after, event);
+ }
+ });
+ }
+ if (this._after && event) {
+ callEachWith(this._after, event);
+ }
+ return result;
+ }
+ beforeEach(function_) {
+ this._before = this._before || [];
+ this._before.push(function_);
+ return () => {
+ if (this._before !== void 0) {
+ const index = this._before.indexOf(function_);
+ if (index !== -1) {
+ this._before.splice(index, 1);
+ }
+ }
+ };
+ }
+ afterEach(function_) {
+ this._after = this._after || [];
+ this._after.push(function_);
+ return () => {
+ if (this._after !== void 0) {
+ const index = this._after.indexOf(function_);
+ if (index !== -1) {
+ this._after.splice(index, 1);
+ }
+ }
+ };
+ }
+}
+function createHooks() {
+ return new Hookable();
+}
+
+const NUMBER_CHAR_RE = /\d/;
+const STR_SPLITTERS = ["-", "_", "/", "."];
+function isUppercase(char = "") {
+ if (NUMBER_CHAR_RE.test(char)) {
+ return void 0;
+ }
+ return char.toUpperCase() === char;
+}
+function splitByCase(string_, separators) {
+ const splitters = separators ?? STR_SPLITTERS;
+ const parts = [];
+ if (!string_ || typeof string_ !== "string") {
+ return parts;
+ }
+ let buff = "";
+ let previousUpper;
+ let previousSplitter;
+ for (const char of string_) {
+ const isSplitter = splitters.includes(char);
+ if (isSplitter === true) {
+ parts.push(buff);
+ buff = "";
+ previousUpper = void 0;
+ continue;
+ }
+ const isUpper = isUppercase(char);
+ if (previousSplitter === false) {
+ if (previousUpper === false && isUpper === true) {
+ parts.push(buff);
+ buff = char;
+ previousUpper = isUpper;
+ continue;
+ }
+ if (previousUpper === true && isUpper === false && buff.length > 1) {
+ const lastChar = buff[buff.length - 1];
+ parts.push(buff.slice(0, Math.max(0, buff.length - 1)));
+ buff = lastChar + char;
+ previousUpper = isUpper;
+ continue;
+ }
+ }
+ buff += char;
+ previousUpper = isUpper;
+ previousSplitter = isSplitter;
+ }
+ parts.push(buff);
+ return parts;
+}
+function kebabCase(string_, joiner) {
+ return !string_
+ ? ""
+ : (Array.isArray(string_) ? string_ : splitByCase(string_)).map(p => p.toLowerCase()).join(joiner ?? "-");
+}
+function snakeCase(string_) {
+ return kebabCase(string_, "_");
+}
+
+function klona(x) {
+ if (typeof x !== "object") return x;
+
+ var k,
+ tmp,
+ str = Object.prototype.toString.call(x);
+
+ if (str === "[object Object]") {
+ if (x.constructor !== Object && typeof x.constructor === "function") {
+ tmp = new x.constructor();
+ for (k in x) {
+ if (x.hasOwnProperty(k) && tmp[k] !== x[k]) {
+ tmp[k] = klona(x[k]);
+ }
+ }
+ } else {
+ tmp = {}; // null
+ for (k in x) {
+ if (k === "__proto__") {
+ Object.defineProperty(tmp, k, {
+ value: klona(x[k]),
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ });
+ } else {
+ tmp[k] = klona(x[k]);
+ }
+ }
+ }
+ return tmp;
+ }
+
+ if (str === "[object Array]") {
+ k = x.length;
+ for (tmp = Array(k); k--; ) {
+ tmp[k] = klona(x[k]);
+ }
+ return tmp;
+ }
+
+ if (str === "[object Set]") {
+ tmp = new Set();
+ x.forEach(function (val) {
+ tmp.add(klona(val));
+ });
+ return tmp;
+ }
+
+ if (str === "[object Map]") {
+ tmp = new Map();
+ x.forEach(function (val, key) {
+ tmp.set(klona(key), klona(val));
+ });
+ return tmp;
+ }
+
+ if (str === "[object Date]") {
+ return new Date(+x);
+ }
+
+ if (str === "[object RegExp]") {
+ tmp = new RegExp(x.source, x.flags);
+ tmp.lastIndex = x.lastIndex;
+ return tmp;
+ }
+
+ if (str === "[object DataView]") {
+ return new x.constructor(klona(x.buffer));
+ }
+
+ if (str === "[object ArrayBuffer]") {
+ return x.slice(0);
+ }
+
+ // ArrayBuffer.isView(x)
+ // ~> `new` bcuz `Buffer.slice` => ref
+ if (str.slice(-6) === "Array]") {
+ return new x.constructor(x);
+ }
+
+ return x;
+}
+
+const appConfig0 = {
+ "server-config": true,
+};
+
+const appConfig1 = {
+ "app-config": true,
+};
+
+const inlineAppConfig = {
+ "nitro-config": true,
+ "dynamic": "initial",
+};
+
+const appConfig = defuFn(appConfig0, appConfig1, inlineAppConfig);
+
+var _a, _b;
+const _inlineRuntimeConfig = {
+ "app": {
+ "baseURL": "/",
+ },
+ "nitro": {
+ "routeRules": {
+ "/api/param/prerender4": {
+ "prerender": true,
+ },
+ "/api/param/prerender2": {
+ "prerender": false,
+ },
+ "/rules/headers": {
+ "headers": {
+ "cache-control": "s-maxage=60",
+ },
+ },
+ "/rules/cors": {
+ "cors": true,
+ "headers": {
+ "access-control-allow-origin": "*",
+ "access-control-allow-methods": "GET",
+ "access-control-allow-headers": "*",
+ "access-control-max-age": "0",
+ },
+ },
+ "/rules/dynamic": {
+ "cache": false,
+ "isr": false,
+ },
+ "/rules/redirect": {
+ "redirect": {
+ "to": "/base",
+ "statusCode": 307,
+ },
+ },
+ "/rules/isr/**": {
+ "isr": true,
+ },
+ "/rules/isr-ttl/**": {
+ "isr": 60,
+ },
+ "/rules/swr/**": {
+ "swr": true,
+ "cache": {
+ "swr": true,
+ },
+ },
+ "/rules/swr-ttl/**": {
+ "swr": 60,
+ "cache": {
+ "swr": true,
+ "maxAge": 60,
+ },
+ },
+ "/rules/redirect/obj": {
+ "redirect": {
+ "to": "https://nitro.unjs.io/",
+ "statusCode": 308,
+ },
+ },
+ "/rules/nested/**": {
+ "redirect": {
+ "to": "/base",
+ "statusCode": 307,
+ },
+ "headers": {
+ "x-test": "test",
+ },
+ },
+ "/rules/nested/override": {
+ "redirect": {
+ "to": "/other",
+ "statusCode": 307,
+ },
+ },
+ "/rules/_/noncached/cached": {
+ "swr": true,
+ "cache": {
+ "swr": true,
+ },
+ },
+ "/rules/_/noncached/**": {
+ "swr": false,
+ "cache": false,
+ "isr": false,
+ },
+ "/rules/_/cached/noncached": {
+ "cache": false,
+ "swr": false,
+ "isr": false,
+ },
+ "/rules/_/cached/**": {
+ "swr": true,
+ "cache": {
+ "swr": true,
+ },
+ },
+ "/api/proxy/**": {
+ "proxy": {
+ "to": "/api/echo",
+ "_proxyStripBase": "/api/proxy",
+ },
+ },
+ "/build/**": {
+ "headers": {
+ "cache-control": "public, max-age=3600, immutable",
+ },
+ },
+ },
+ },
+ "dynamic": "initial",
+};
+const ENV_PREFIX = "NITRO_";
+const ENV_PREFIX_ALT =
+ (_b = (_a = _inlineRuntimeConfig.nitro.envPrefix) != null ? _a : process.env.NITRO_ENV_PREFIX) != null ? _b : "_";
+const _sharedRuntimeConfig = _deepFreeze(_applyEnv(klona(_inlineRuntimeConfig)));
+function useRuntimeConfig(event) {
+ if (!event) {
+ return _sharedRuntimeConfig;
+ }
+ if (event.context.nitro.runtimeConfig) {
+ return event.context.nitro.runtimeConfig;
+ }
+ const runtimeConfig = klona(_inlineRuntimeConfig);
+ _applyEnv(runtimeConfig);
+ event.context.nitro.runtimeConfig = runtimeConfig;
+ return runtimeConfig;
+}
+const _sharedAppConfig = _deepFreeze(klona(appConfig));
+function useAppConfig(event) {
+ if (!event) {
+ return _sharedAppConfig;
+ }
+ if (event.context.nitro.appConfig) {
+ return event.context.nitro.appConfig;
+ }
+ const appConfig$1 = klona(appConfig);
+ event.context.nitro.appConfig = appConfig$1;
+ return appConfig$1;
+}
+function _getEnv(key) {
+ var _a2;
+ const envKey = snakeCase(key).toUpperCase();
+ return destr((_a2 = process.env[ENV_PREFIX + envKey]) != null ? _a2 : process.env[ENV_PREFIX_ALT + envKey]);
+}
+function _isObject(input) {
+ return typeof input === "object" && !Array.isArray(input);
+}
+function _applyEnv(obj, parentKey = "") {
+ for (const key in obj) {
+ const subKey = parentKey ? `${parentKey}_${key}` : key;
+ const envValue = _getEnv(subKey);
+ if (_isObject(obj[key])) {
+ if (_isObject(envValue)) {
+ obj[key] = { ...obj[key], ...envValue };
+ }
+ _applyEnv(obj[key], subKey);
+ } else {
+ obj[key] = envValue != null ? envValue : obj[key];
+ }
+ }
+ return obj;
+}
+function _deepFreeze(object) {
+ const propNames = Object.getOwnPropertyNames(object);
+ for (const name of propNames) {
+ const value = object[name];
+ if (value && typeof value === "object") {
+ _deepFreeze(value);
+ }
+ }
+ return Object.freeze(object);
+}
+new Proxy(/* @__PURE__ */ Object.create(null), {
+ get: (_, prop) => {
+ console.warn("Please use `useRuntimeConfig()` instead of accessing config directly.");
+ const runtimeConfig = useRuntimeConfig();
+ if (prop in runtimeConfig) {
+ return runtimeConfig[prop];
+ }
+ return void 0;
+ },
+});
+
+const defaults = Object.freeze({
+ ignoreUnknown: false,
+ respectType: false,
+ respectFunctionNames: false,
+ respectFunctionProperties: false,
+ unorderedObjects: true,
+ unorderedArrays: false,
+ unorderedSets: false,
+ excludeKeys: void 0,
+ excludeValues: void 0,
+ replacer: void 0,
+});
+function objectHash(object, options) {
+ if (options) {
+ options = { ...defaults, ...options };
+ } else {
+ options = defaults;
+ }
+ const hasher = createHasher(options);
+ hasher.dispatch(object);
+ return hasher.toString();
+}
+const defaultPrototypesKeys = Object.freeze(["prototype", "__proto__", "constructor"]);
+function createHasher(options) {
+ let buff = "";
+ let context = /* @__PURE__ */ new Map();
+ const write = str => {
+ buff += str;
+ };
+ return {
+ toString() {
+ return buff;
+ },
+ getContext() {
+ return context;
+ },
+ dispatch(value) {
+ if (options.replacer) {
+ value = options.replacer(value);
+ }
+ const type = value === null ? "null" : typeof value;
+ return this[type](value);
+ },
+ object(object) {
+ if (object && typeof object.toJSON === "function") {
+ return this.object(object.toJSON());
+ }
+ const objString = Object.prototype.toString.call(object);
+ let objType = "";
+ const objectLength = objString.length;
+ if (objectLength < 10) {
+ objType = "unknown:[" + objString + "]";
+ } else {
+ objType = objString.slice(8, objectLength - 1);
+ }
+ objType = objType.toLowerCase();
+ let objectNumber = null;
+ if ((objectNumber = context.get(object)) === void 0) {
+ context.set(object, context.size);
+ } else {
+ return this.dispatch("[CIRCULAR:" + objectNumber + "]");
+ }
+ if (typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(object)) {
+ write("buffer:");
+ return write(object.toString("utf8"));
+ }
+ if (objType !== "object" && objType !== "function" && objType !== "asyncfunction") {
+ if (this[objType]) {
+ this[objType](object);
+ } else if (!options.ignoreUnknown) {
+ this.unkown(object, objType);
+ }
+ } else {
+ let keys = Object.keys(object);
+ if (options.unorderedObjects) {
+ keys = keys.sort();
+ }
+ let extraKeys = [];
+ if (options.respectType !== false && !isNativeFunction(object)) {
+ extraKeys = defaultPrototypesKeys;
+ }
+ if (options.excludeKeys) {
+ keys = keys.filter(key => {
+ return !options.excludeKeys(key);
+ });
+ extraKeys = extraKeys.filter(key => {
+ return !options.excludeKeys(key);
+ });
+ }
+ write("object:" + (keys.length + extraKeys.length) + ":");
+ const dispatchForKey = key => {
+ this.dispatch(key);
+ write(":");
+ if (!options.excludeValues) {
+ this.dispatch(object[key]);
+ }
+ write(",");
+ };
+ for (const key of keys) {
+ dispatchForKey(key);
+ }
+ for (const key of extraKeys) {
+ dispatchForKey(key);
+ }
+ }
+ },
+ array(arr, unordered) {
+ unordered = unordered === void 0 ? options.unorderedArrays !== false : unordered;
+ write("array:" + arr.length + ":");
+ if (!unordered || arr.length <= 1) {
+ for (const entry of arr) {
+ this.dispatch(entry);
+ }
+ return;
+ }
+ const contextAdditions = /* @__PURE__ */ new Map();
+ const entries = arr.map(entry => {
+ const hasher = createHasher(options);
+ hasher.dispatch(entry);
+ for (const [key, value] of hasher.getContext()) {
+ contextAdditions.set(key, value);
+ }
+ return hasher.toString();
+ });
+ context = contextAdditions;
+ entries.sort();
+ return this.array(entries, false);
+ },
+ date(date) {
+ return write("date:" + date.toJSON());
+ },
+ symbol(sym) {
+ return write("symbol:" + sym.toString());
+ },
+ unkown(value, type) {
+ write(type);
+ if (!value) {
+ return;
+ }
+ write(":");
+ if (value && typeof value.entries === "function") {
+ return this.array(
+ Array.from(value.entries()),
+ true,
+ /* ordered */
+ );
+ }
+ },
+ error(err) {
+ return write("error:" + err.toString());
+ },
+ boolean(bool) {
+ return write("bool:" + bool);
+ },
+ string(string) {
+ write("string:" + string.length + ":");
+ write(string);
+ },
+ function(fn) {
+ write("fn:");
+ if (isNativeFunction(fn)) {
+ this.dispatch("[native]");
+ } else {
+ this.dispatch(fn.toString());
+ }
+ if (options.respectFunctionNames !== false) {
+ this.dispatch("function-name:" + String(fn.name));
+ }
+ if (options.respectFunctionProperties) {
+ this.object(fn);
+ }
+ },
+ number(number) {
+ return write("number:" + number);
+ },
+ xml(xml) {
+ return write("xml:" + xml.toString());
+ },
+ null() {
+ return write("Null");
+ },
+ undefined() {
+ return write("Undefined");
+ },
+ regexp(regex) {
+ return write("regex:" + regex.toString());
+ },
+ uint8array(arr) {
+ write("uint8array:");
+ return this.dispatch(Array.prototype.slice.call(arr));
+ },
+ uint8clampedarray(arr) {
+ write("uint8clampedarray:");
+ return this.dispatch(Array.prototype.slice.call(arr));
+ },
+ int8array(arr) {
+ write("int8array:");
+ return this.dispatch(Array.prototype.slice.call(arr));
+ },
+ uint16array(arr) {
+ write("uint16array:");
+ return this.dispatch(Array.prototype.slice.call(arr));
+ },
+ int16array(arr) {
+ write("int16array:");
+ return this.dispatch(Array.prototype.slice.call(arr));
+ },
+ uint32array(arr) {
+ write("uint32array:");
+ return this.dispatch(Array.prototype.slice.call(arr));
+ },
+ int32array(arr) {
+ write("int32array:");
+ return this.dispatch(Array.prototype.slice.call(arr));
+ },
+ float32array(arr) {
+ write("float32array:");
+ return this.dispatch(Array.prototype.slice.call(arr));
+ },
+ float64array(arr) {
+ write("float64array:");
+ return this.dispatch(Array.prototype.slice.call(arr));
+ },
+ arraybuffer(arr) {
+ write("arraybuffer:");
+ return this.dispatch(new Uint8Array(arr));
+ },
+ url(url) {
+ return write("url:" + url.toString());
+ },
+ map(map) {
+ write("map:");
+ const arr = [...map];
+ return this.array(arr, options.unorderedSets !== false);
+ },
+ set(set) {
+ write("set:");
+ const arr = [...set];
+ return this.array(arr, options.unorderedSets !== false);
+ },
+ file(file) {
+ write("file:");
+ return this.dispatch([file.name, file.size, file.type, file.lastModfied]);
+ },
+ blob() {
+ if (options.ignoreUnknown) {
+ return write("[blob]");
+ }
+ throw new Error(
+ 'Hashing Blob objects is currently not supported\nUse "options.replacer" or "options.ignoreUnknown"\n',
+ );
+ },
+ domwindow() {
+ return write("domwindow");
+ },
+ bigint(number) {
+ return write("bigint:" + number.toString());
+ },
+ /* Node.js standard native objects */
+ process() {
+ return write("process");
+ },
+ timer() {
+ return write("timer");
+ },
+ pipe() {
+ return write("pipe");
+ },
+ tcp() {
+ return write("tcp");
+ },
+ udp() {
+ return write("udp");
+ },
+ tty() {
+ return write("tty");
+ },
+ statwatcher() {
+ return write("statwatcher");
+ },
+ securecontext() {
+ return write("securecontext");
+ },
+ connection() {
+ return write("connection");
+ },
+ zlib() {
+ return write("zlib");
+ },
+ context() {
+ return write("context");
+ },
+ nodescript() {
+ return write("nodescript");
+ },
+ httpparser() {
+ return write("httpparser");
+ },
+ dataview() {
+ return write("dataview");
+ },
+ signal() {
+ return write("signal");
+ },
+ fsevent() {
+ return write("fsevent");
+ },
+ tlswrap() {
+ return write("tlswrap");
+ },
+ };
+}
+const nativeFunc = "[native code] }";
+const nativeFuncLength = nativeFunc.length;
+function isNativeFunction(f) {
+ if (typeof f !== "function") {
+ return false;
+ }
+ return Function.prototype.toString.call(f).slice(-nativeFuncLength) === nativeFunc;
+}
+
+class WordArray {
+ constructor(words, sigBytes) {
+ words = this.words = words || [];
+ this.sigBytes = sigBytes === void 0 ? words.length * 4 : sigBytes;
+ }
+ toString(encoder) {
+ return (encoder || Hex).stringify(this);
+ }
+ concat(wordArray) {
+ this.clamp();
+ if (this.sigBytes % 4) {
+ for (let i = 0; i < wordArray.sigBytes; i++) {
+ const thatByte = (wordArray.words[i >>> 2] >>> (24 - (i % 4) * 8)) & 255;
+ this.words[(this.sigBytes + i) >>> 2] |= thatByte << (24 - ((this.sigBytes + i) % 4) * 8);
+ }
+ } else {
+ for (let j = 0; j < wordArray.sigBytes; j += 4) {
+ this.words[(this.sigBytes + j) >>> 2] = wordArray.words[j >>> 2];
+ }
+ }
+ this.sigBytes += wordArray.sigBytes;
+ return this;
+ }
+ clamp() {
+ this.words[this.sigBytes >>> 2] &= 4294967295 << (32 - (this.sigBytes % 4) * 8);
+ this.words.length = Math.ceil(this.sigBytes / 4);
+ }
+ clone() {
+ return new WordArray([...this.words]);
+ }
+}
+const Hex = {
+ stringify(wordArray) {
+ const hexChars = [];
+ for (let i = 0; i < wordArray.sigBytes; i++) {
+ const bite = (wordArray.words[i >>> 2] >>> (24 - (i % 4) * 8)) & 255;
+ hexChars.push((bite >>> 4).toString(16), (bite & 15).toString(16));
+ }
+ return hexChars.join("");
+ },
+};
+const Base64 = {
+ stringify(wordArray) {
+ const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
+ const base64Chars = [];
+ for (let i = 0; i < wordArray.sigBytes; i += 3) {
+ const byte1 = (wordArray.words[i >>> 2] >>> (24 - (i % 4) * 8)) & 255;
+ const byte2 = (wordArray.words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 255;
+ const byte3 = (wordArray.words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 255;
+ const triplet = (byte1 << 16) | (byte2 << 8) | byte3;
+ for (let j = 0; j < 4 && i * 8 + j * 6 < wordArray.sigBytes * 8; j++) {
+ base64Chars.push(keyStr.charAt((triplet >>> (6 * (3 - j))) & 63));
+ }
+ }
+ return base64Chars.join("");
+ },
+};
+const Latin1 = {
+ parse(latin1Str) {
+ const latin1StrLength = latin1Str.length;
+ const words = [];
+ for (let i = 0; i < latin1StrLength; i++) {
+ words[i >>> 2] |= (latin1Str.charCodeAt(i) & 255) << (24 - (i % 4) * 8);
+ }
+ return new WordArray(words, latin1StrLength);
+ },
+};
+const Utf8 = {
+ parse(utf8Str) {
+ return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
+ },
+};
+class BufferedBlockAlgorithm {
+ constructor() {
+ this._data = new WordArray();
+ this._nDataBytes = 0;
+ this._minBufferSize = 0;
+ this.blockSize = 512 / 32;
+ }
+ reset() {
+ this._data = new WordArray();
+ this._nDataBytes = 0;
+ }
+ _append(data) {
+ if (typeof data === "string") {
+ data = Utf8.parse(data);
+ }
+ this._data.concat(data);
+ this._nDataBytes += data.sigBytes;
+ }
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
+ _doProcessBlock(_dataWords, _offset) {}
+ _process(doFlush) {
+ let processedWords;
+ let nBlocksReady = this._data.sigBytes / (this.blockSize * 4);
+ if (doFlush) {
+ nBlocksReady = Math.ceil(nBlocksReady);
+ } else {
+ nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
+ }
+ const nWordsReady = nBlocksReady * this.blockSize;
+ const nBytesReady = Math.min(nWordsReady * 4, this._data.sigBytes);
+ if (nWordsReady) {
+ for (let offset = 0; offset < nWordsReady; offset += this.blockSize) {
+ this._doProcessBlock(this._data.words, offset);
+ }
+ processedWords = this._data.words.splice(0, nWordsReady);
+ this._data.sigBytes -= nBytesReady;
+ }
+ return new WordArray(processedWords, nBytesReady);
+ }
+}
+class Hasher extends BufferedBlockAlgorithm {
+ update(messageUpdate) {
+ this._append(messageUpdate);
+ this._process();
+ return this;
+ }
+ finalize(messageUpdate) {
+ if (messageUpdate) {
+ this._append(messageUpdate);
+ }
+ }
+}
+
+const H = [1779033703, -1150833019, 1013904242, -1521486534, 1359893119, -1694144372, 528734635, 1541459225];
+const K = [
+ 1116352408, 1899447441, -1245643825, -373957723, 961987163, 1508970993, -1841331548, -1424204075, -670586216,
+ 310598401, 607225278, 1426881987, 1925078388, -2132889090, -1680079193, -1046744716, -459576895, -272742522,
+ 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, -1740746414, -1473132947, -1341970488,
+ -1084653625, -958395405, -710438585, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700,
+ 1986661051, -2117940946, -1838011259, -1564481375, -1474664885, -1035236496, -949202525, -778901479, -694614492,
+ -200395387, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779,
+ 1955562222, 2024104815, -2067236844, -1933114872, -1866530822, -1538233109, -1090935817, -965641998,
+];
+const W = [];
+class SHA256 extends Hasher {
+ constructor() {
+ super(...arguments);
+ this._hash = new WordArray([...H]);
+ }
+ reset() {
+ super.reset();
+ this._hash = new WordArray([...H]);
+ }
+ _doProcessBlock(M, offset) {
+ const H2 = this._hash.words;
+ let a = H2[0];
+ let b = H2[1];
+ let c = H2[2];
+ let d = H2[3];
+ let e = H2[4];
+ let f = H2[5];
+ let g = H2[6];
+ let h = H2[7];
+ for (let i = 0; i < 64; i++) {
+ if (i < 16) {
+ W[i] = M[offset + i] | 0;
+ } else {
+ const gamma0x = W[i - 15];
+ const gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ ((gamma0x << 14) | (gamma0x >>> 18)) ^ (gamma0x >>> 3);
+ const gamma1x = W[i - 2];
+ const gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ ((gamma1x << 13) | (gamma1x >>> 19)) ^ (gamma1x >>> 10);
+ W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
+ }
+ const ch = (e & f) ^ (~e & g);
+ const maj = (a & b) ^ (a & c) ^ (b & c);
+ const sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
+ const sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));
+ const t1 = h + sigma1 + ch + K[i] + W[i];
+ const t2 = sigma0 + maj;
+ h = g;
+ g = f;
+ f = e;
+ e = (d + t1) | 0;
+ d = c;
+ c = b;
+ b = a;
+ a = (t1 + t2) | 0;
+ }
+ H2[0] = (H2[0] + a) | 0;
+ H2[1] = (H2[1] + b) | 0;
+ H2[2] = (H2[2] + c) | 0;
+ H2[3] = (H2[3] + d) | 0;
+ H2[4] = (H2[4] + e) | 0;
+ H2[5] = (H2[5] + f) | 0;
+ H2[6] = (H2[6] + g) | 0;
+ H2[7] = (H2[7] + h) | 0;
+ }
+ finalize(messageUpdate) {
+ super.finalize(messageUpdate);
+ const nBitsTotal = this._nDataBytes * 8;
+ const nBitsLeft = this._data.sigBytes * 8;
+ this._data.words[nBitsLeft >>> 5] |= 128 << (24 - (nBitsLeft % 32));
+ this._data.words[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 4294967296);
+ this._data.words[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
+ this._data.sigBytes = this._data.words.length * 4;
+ this._process();
+ return this._hash;
+ }
+}
+function sha256base64(message) {
+ return new SHA256().finalize(message).toString(Base64);
+}
+
+function hash(object, options = {}) {
+ const hashed = typeof object === "string" ? object : objectHash(object, options);
+ return sha256base64(hashed).slice(0, 10);
+}
+
+function wrapToPromise(value) {
+ if (!value || typeof value.then !== "function") {
+ return Promise.resolve(value);
+ }
+ return value;
+}
+function asyncCall(function_, ...arguments_) {
+ try {
+ return wrapToPromise(function_(...arguments_));
+ } catch (error) {
+ return Promise.reject(error);
+ }
+}
+function isPrimitive(value) {
+ const type = typeof value;
+ return value === null || (type !== "object" && type !== "function");
+}
+function isPureObject(value) {
+ const proto = Object.getPrototypeOf(value);
+ return !proto || proto.isPrototypeOf(Object);
+}
+function stringify(value) {
+ if (isPrimitive(value)) {
+ return String(value);
+ }
+ if (isPureObject(value) || Array.isArray(value)) {
+ return JSON.stringify(value);
+ }
+ if (typeof value.toJSON === "function") {
+ return stringify(value.toJSON());
+ }
+ throw new Error("[unstorage] Cannot stringify value!");
+}
+function checkBufferSupport() {
+ if (typeof Buffer === void 0) {
+ throw new TypeError("[unstorage] Buffer is not supported!");
+ }
+}
+const BASE64_PREFIX = "base64:";
+function serializeRaw(value) {
+ if (typeof value === "string") {
+ return value;
+ }
+ checkBufferSupport();
+ const base64 = Buffer.from(value).toString("base64");
+ return BASE64_PREFIX + base64;
+}
+function deserializeRaw(value) {
+ if (typeof value !== "string") {
+ return value;
+ }
+ if (!value.startsWith(BASE64_PREFIX)) {
+ return value;
+ }
+ checkBufferSupport();
+ return Buffer.from(value.slice(BASE64_PREFIX.length), "base64");
+}
+
+const storageKeyProperties = [
+ "hasItem",
+ "getItem",
+ "getItemRaw",
+ "setItem",
+ "setItemRaw",
+ "removeItem",
+ "getMeta",
+ "setMeta",
+ "removeMeta",
+ "getKeys",
+ "clear",
+ "mount",
+ "unmount",
+];
+function prefixStorage(storage, base) {
+ base = normalizeBaseKey(base);
+ if (!base) {
+ return storage;
+ }
+ const nsStorage = { ...storage };
+ for (const property of storageKeyProperties) {
+ nsStorage[property] = (key = "", ...args) =>
+ // @ts-ignore
+ storage[property](base + key, ...args);
+ }
+ nsStorage.getKeys = (key = "", ...arguments_) =>
+ storage.getKeys(base + key, ...arguments_).then(keys => keys.map(key2 => key2.slice(base.length)));
+ return nsStorage;
+}
+function normalizeKey$1(key) {
+ if (!key) {
+ return "";
+ }
+ return key.split("?")[0].replace(/[/\\]/g, ":").replace(/:+/g, ":").replace(/^:|:$/g, "");
+}
+function joinKeys(...keys) {
+ return normalizeKey$1(keys.join(":"));
+}
+function normalizeBaseKey(base) {
+ base = normalizeKey$1(base);
+ return base ? base + ":" : "";
+}
+
+function defineDriver$1(factory) {
+ return factory;
+}
+
+const DRIVER_NAME$1 = "memory";
+const memory = defineDriver$1(() => {
+ const data = /* @__PURE__ */ new Map();
+ return {
+ name: DRIVER_NAME$1,
+ options: {},
+ hasItem(key) {
+ return data.has(key);
+ },
+ getItem(key) {
+ return data.get(key) || null;
+ },
+ getItemRaw(key) {
+ return data.get(key) || null;
+ },
+ setItem(key, value) {
+ data.set(key, value);
+ },
+ setItemRaw(key, value) {
+ data.set(key, value);
+ },
+ removeItem(key) {
+ data.delete(key);
+ },
+ getKeys() {
+ return Array.from(data.keys());
+ },
+ clear() {
+ data.clear();
+ },
+ dispose() {
+ data.clear();
+ },
+ };
+});
+
+function createStorage(options = {}) {
+ const context = {
+ mounts: { "": options.driver || memory() },
+ mountpoints: [""],
+ watching: false,
+ watchListeners: [],
+ unwatch: {},
+ };
+ const getMount = key => {
+ for (const base of context.mountpoints) {
+ if (key.startsWith(base)) {
+ return {
+ base,
+ relativeKey: key.slice(base.length),
+ driver: context.mounts[base],
+ };
+ }
+ }
+ return {
+ base: "",
+ relativeKey: key,
+ driver: context.mounts[""],
+ };
+ };
+ const getMounts = (base, includeParent) => {
+ return context.mountpoints
+ .filter(mountpoint => mountpoint.startsWith(base) || (includeParent && base.startsWith(mountpoint)))
+ .map(mountpoint => ({
+ relativeBase: base.length > mountpoint.length ? base.slice(mountpoint.length) : void 0,
+ mountpoint,
+ driver: context.mounts[mountpoint],
+ }));
+ };
+ const onChange = (event, key) => {
+ if (!context.watching) {
+ return;
+ }
+ key = normalizeKey$1(key);
+ for (const listener of context.watchListeners) {
+ listener(event, key);
+ }
+ };
+ const startWatch = async () => {
+ if (context.watching) {
+ return;
+ }
+ context.watching = true;
+ for (const mountpoint in context.mounts) {
+ context.unwatch[mountpoint] = await watch(context.mounts[mountpoint], onChange, mountpoint);
+ }
+ };
+ const stopWatch = async () => {
+ if (!context.watching) {
+ return;
+ }
+ for (const mountpoint in context.unwatch) {
+ await context.unwatch[mountpoint]();
+ }
+ context.unwatch = {};
+ context.watching = false;
+ };
+ const runBatch = (items, commonOptions, cb) => {
+ const batches = /* @__PURE__ */ new Map();
+ const getBatch = mount => {
+ let batch = batches.get(mount.base);
+ if (!batch) {
+ batch = {
+ driver: mount.driver,
+ base: mount.base,
+ items: [],
+ };
+ batches.set(mount.base, batch);
+ }
+ return batch;
+ };
+ for (const item of items) {
+ const isStringItem = typeof item === "string";
+ const key = normalizeKey$1(isStringItem ? item : item.key);
+ const value = isStringItem ? void 0 : item.value;
+ const options2 = isStringItem || !item.options ? commonOptions : { ...commonOptions, ...item.options };
+ const mount = getMount(key);
+ getBatch(mount).items.push({
+ key,
+ value,
+ relativeKey: mount.relativeKey,
+ options: options2,
+ });
+ }
+ return Promise.all([...batches.values()].map(batch => cb(batch))).then(r => r.flat());
+ };
+ const storage = {
+ // Item
+ hasItem(key, opts = {}) {
+ key = normalizeKey$1(key);
+ const { relativeKey, driver } = getMount(key);
+ return asyncCall(driver.hasItem, relativeKey, opts);
+ },
+ getItem(key, opts = {}) {
+ key = normalizeKey$1(key);
+ const { relativeKey, driver } = getMount(key);
+ return asyncCall(driver.getItem, relativeKey, opts).then(value => destr(value));
+ },
+ getItems(items, commonOptions) {
+ return runBatch(items, commonOptions, batch => {
+ if (batch.driver.getItems) {
+ return asyncCall(
+ batch.driver.getItems,
+ batch.items.map(item => ({
+ key: item.relativeKey,
+ options: item.options,
+ })),
+ commonOptions,
+ ).then(r =>
+ r.map(item => ({
+ key: joinKeys(batch.base, item.key),
+ value: destr(item.value),
+ })),
+ );
+ }
+ return Promise.all(
+ batch.items.map(item => {
+ return asyncCall(batch.driver.getItem, item.relativeKey, item.options).then(value => ({
+ key: item.key,
+ value: destr(value),
+ }));
+ }),
+ );
+ });
+ },
+ getItemRaw(key, opts = {}) {
+ key = normalizeKey$1(key);
+ const { relativeKey, driver } = getMount(key);
+ if (driver.getItemRaw) {
+ return asyncCall(driver.getItemRaw, relativeKey, opts);
+ }
+ return asyncCall(driver.getItem, relativeKey, opts).then(value => deserializeRaw(value));
+ },
+ async setItem(key, value, opts = {}) {
+ if (value === void 0) {
+ return storage.removeItem(key);
+ }
+ key = normalizeKey$1(key);
+ const { relativeKey, driver } = getMount(key);
+ if (!driver.setItem) {
+ return;
+ }
+ await asyncCall(driver.setItem, relativeKey, stringify(value), opts);
+ if (!driver.watch) {
+ onChange("update", key);
+ }
+ },
+ async setItems(items, commonOptions) {
+ await runBatch(items, commonOptions, async batch => {
+ if (batch.driver.setItems) {
+ await asyncCall(
+ batch.driver.setItems,
+ batch.items.map(item => ({
+ key: item.relativeKey,
+ value: stringify(item.value),
+ options: item.options,
+ })),
+ commonOptions,
+ );
+ }
+ if (!batch.driver.setItem) {
+ return;
+ }
+ await Promise.all(
+ batch.items.map(item => {
+ return asyncCall(batch.driver.setItem, item.relativeKey, stringify(item.value), item.options);
+ }),
+ );
+ });
+ },
+ async setItemRaw(key, value, opts = {}) {
+ if (value === void 0) {
+ return storage.removeItem(key, opts);
+ }
+ key = normalizeKey$1(key);
+ const { relativeKey, driver } = getMount(key);
+ if (driver.setItemRaw) {
+ await asyncCall(driver.setItemRaw, relativeKey, value, opts);
+ } else if (driver.setItem) {
+ await asyncCall(driver.setItem, relativeKey, serializeRaw(value), opts);
+ } else {
+ return;
+ }
+ if (!driver.watch) {
+ onChange("update", key);
+ }
+ },
+ async removeItem(key, opts = {}) {
+ if (typeof opts === "boolean") {
+ opts = { removeMeta: opts };
+ }
+ key = normalizeKey$1(key);
+ const { relativeKey, driver } = getMount(key);
+ if (!driver.removeItem) {
+ return;
+ }
+ await asyncCall(driver.removeItem, relativeKey, opts);
+ if (opts.removeMeta || opts.removeMata) {
+ await asyncCall(driver.removeItem, relativeKey + "$", opts);
+ }
+ if (!driver.watch) {
+ onChange("remove", key);
+ }
+ },
+ // Meta
+ async getMeta(key, opts = {}) {
+ if (typeof opts === "boolean") {
+ opts = { nativeOnly: opts };
+ }
+ key = normalizeKey$1(key);
+ const { relativeKey, driver } = getMount(key);
+ const meta = /* @__PURE__ */ Object.create(null);
+ if (driver.getMeta) {
+ Object.assign(meta, await asyncCall(driver.getMeta, relativeKey, opts));
+ }
+ if (!opts.nativeOnly) {
+ const value = await asyncCall(driver.getItem, relativeKey + "$", opts).then(value_ => destr(value_));
+ if (value && typeof value === "object") {
+ if (typeof value.atime === "string") {
+ value.atime = new Date(value.atime);
+ }
+ if (typeof value.mtime === "string") {
+ value.mtime = new Date(value.mtime);
+ }
+ Object.assign(meta, value);
+ }
+ }
+ return meta;
+ },
+ setMeta(key, value, opts = {}) {
+ return this.setItem(key + "$", value, opts);
+ },
+ removeMeta(key, opts = {}) {
+ return this.removeItem(key + "$", opts);
+ },
+ // Keys
+ async getKeys(base, opts = {}) {
+ base = normalizeBaseKey(base);
+ const mounts = getMounts(base, true);
+ let maskedMounts = [];
+ const allKeys = [];
+ for (const mount of mounts) {
+ const rawKeys = await asyncCall(mount.driver.getKeys, mount.relativeBase, opts);
+ const keys = rawKeys
+ .map(key => mount.mountpoint + normalizeKey$1(key))
+ .filter(key => !maskedMounts.some(p => key.startsWith(p)));
+ allKeys.push(...keys);
+ maskedMounts = [mount.mountpoint, ...maskedMounts.filter(p => !p.startsWith(mount.mountpoint))];
+ }
+ return base
+ ? allKeys.filter(key => key.startsWith(base) && !key.endsWith("$"))
+ : allKeys.filter(key => !key.endsWith("$"));
+ },
+ // Utils
+ async clear(base, opts = {}) {
+ base = normalizeBaseKey(base);
+ await Promise.all(
+ getMounts(base, false).map(async m => {
+ if (m.driver.clear) {
+ return asyncCall(m.driver.clear, m.relativeBase, opts);
+ }
+ if (m.driver.removeItem) {
+ const keys = await m.driver.getKeys(m.relativeBase || "", opts);
+ return Promise.all(keys.map(key => m.driver.removeItem(key, opts)));
+ }
+ }),
+ );
+ },
+ async dispose() {
+ await Promise.all(Object.values(context.mounts).map(driver => dispose(driver)));
+ },
+ async watch(callback) {
+ await startWatch();
+ context.watchListeners.push(callback);
+ return async () => {
+ context.watchListeners = context.watchListeners.filter(listener => listener !== callback);
+ if (context.watchListeners.length === 0) {
+ await stopWatch();
+ }
+ };
+ },
+ async unwatch() {
+ context.watchListeners = [];
+ await stopWatch();
+ },
+ // Mount
+ mount(base, driver) {
+ base = normalizeBaseKey(base);
+ if (base && context.mounts[base]) {
+ throw new Error(`already mounted at ${base}`);
+ }
+ if (base) {
+ context.mountpoints.push(base);
+ context.mountpoints.sort((a, b) => b.length - a.length);
+ }
+ context.mounts[base] = driver;
+ if (context.watching) {
+ Promise.resolve(watch(driver, onChange, base))
+ .then(unwatcher => {
+ context.unwatch[base] = unwatcher;
+ })
+ .catch(console.error);
+ }
+ return storage;
+ },
+ async unmount(base, _dispose = true) {
+ base = normalizeBaseKey(base);
+ if (!base || !context.mounts[base]) {
+ return;
+ }
+ if (context.watching && base in context.unwatch) {
+ context.unwatch[base]();
+ delete context.unwatch[base];
+ }
+ if (_dispose) {
+ await dispose(context.mounts[base]);
+ }
+ context.mountpoints = context.mountpoints.filter(key => key !== base);
+ delete context.mounts[base];
+ },
+ getMount(key = "") {
+ key = normalizeKey$1(key) + ":";
+ const m = getMount(key);
+ return {
+ driver: m.driver,
+ base: m.base,
+ };
+ },
+ getMounts(base = "", opts = {}) {
+ base = normalizeKey$1(base);
+ const mounts = getMounts(base, opts.parents);
+ return mounts.map(m => ({
+ driver: m.driver,
+ base: m.mountpoint,
+ }));
+ },
+ };
+ return storage;
+}
+function watch(driver, onChange, base) {
+ return driver.watch ? driver.watch((event, key) => onChange(event, base + key)) : () => {};
+}
+async function dispose(driver) {
+ if (typeof driver.dispose === "function") {
+ await asyncCall(driver.dispose);
+ }
+}
+
+const _assets = {
+ ["files:index.html"]: {
+ import: () => import("./chunks/raw/index.mjs").then(r => r.default || r),
+ meta: {
+ "type": "text/html; charset=utf-8",
+ "etag": '"1b-EAYx2upwxnTNWFrDL0Xq/T/8Cm4"',
+ "mtime": "2023-09-15T01:09:24.236Z",
+ },
+ },
+ ["files:test.txt"]: {
+ import: () => import("./chunks/raw/test.mjs").then(r => r.default || r),
+ meta: {
+ "type": "text/plain; charset=utf-8",
+ "etag": '"2d-YFMxrZ5s5syHmc/uF3HF0RE7fKg"',
+ "mtime": "2023-09-15T01:09:24.236Z",
+ },
+ },
+ ["server:test.md"]: {
+ import: () => import("./chunks/raw/test2.mjs").then(r => r.default || r),
+ meta: {
+ "type": "text/markdown; charset=utf-8",
+ "etag": '"31-ZeK/2ke1+Dp+le7tRXe9AuikF6k"',
+ "mtime": "2023-09-15T01:09:24.236Z",
+ },
+ },
+};
+
+const normalizeKey = function normalizeKey(key) {
+ if (!key) {
+ return "";
+ }
+ return key.split("?")[0].replace(/[/\\]/g, ":").replace(/:+/g, ":").replace(/^:|:$/g, "");
+};
+
+const assets$1 = {
+ getKeys() {
+ return Promise.resolve(Object.keys(_assets));
+ },
+ hasItem(id) {
+ id = normalizeKey(id);
+ return Promise.resolve(id in _assets);
+ },
+ getItem(id) {
+ id = normalizeKey(id);
+ return Promise.resolve(_assets[id] ? _assets[id].import() : null);
+ },
+ getMeta(id) {
+ id = normalizeKey(id);
+ return Promise.resolve(_assets[id] ? _assets[id].meta : {});
+ },
+};
+
+function defineDriver(factory) {
+ return factory;
+}
+function createError(driver, message, opts) {
+ const err = new Error(`[unstorage] [${driver}] ${message}`, opts);
+ return err;
+}
+function createRequiredError(driver, name) {
+ if (Array.isArray(name)) {
+ return createError(driver, `Missing some of the required options ${name.map(n => "`" + n + "`").join(", ")}`);
+ }
+ return createError(driver, `Missing required option \`${name}\`.`);
+}
+
+function ignoreNotfound(err) {
+ return err.code === "ENOENT" || err.code === "EISDIR" ? null : err;
+}
+function ignoreExists(err) {
+ return err.code === "EEXIST" ? null : err;
+}
+async function writeFile(path, data, encoding) {
+ await ensuredir(dirname$1(path));
+ return promises.writeFile(path, data, encoding);
+}
+function readFile(path, encoding) {
+ return promises.readFile(path, encoding).catch(ignoreNotfound);
+}
+function unlink(path) {
+ return promises.unlink(path).catch(ignoreNotfound);
+}
+function readdir(dir) {
+ return promises
+ .readdir(dir, { withFileTypes: true })
+ .catch(ignoreNotfound)
+ .then(r => r || []);
+}
+async function ensuredir(dir) {
+ if (existsSync(dir)) {
+ return;
+ }
+ await ensuredir(dirname$1(dir)).catch(ignoreExists);
+ await promises.mkdir(dir).catch(ignoreExists);
+}
+async function readdirRecursive(dir, ignore) {
+ if (ignore && ignore(dir)) {
+ return [];
+ }
+ const entries = await readdir(dir);
+ const files = [];
+ await Promise.all(
+ entries.map(async entry => {
+ const entryPath = resolve$1(dir, entry.name);
+ if (entry.isDirectory()) {
+ const dirFiles = await readdirRecursive(entryPath, ignore);
+ files.push(...dirFiles.map(f => entry.name + "/" + f));
+ } else {
+ if (!(ignore && ignore(entry.name))) {
+ files.push(entry.name);
+ }
+ }
+ }),
+ );
+ return files;
+}
+async function rmRecursive(dir) {
+ const entries = await readdir(dir);
+ await Promise.all(
+ entries.map(entry => {
+ const entryPath = resolve$1(dir, entry.name);
+ if (entry.isDirectory()) {
+ return rmRecursive(entryPath).then(() => promises.rmdir(entryPath));
+ } else {
+ return promises.unlink(entryPath);
+ }
+ }),
+ );
+}
+
+const PATH_TRAVERSE_RE = /\.\.\:|\.\.$/;
+const DRIVER_NAME = "fs-lite";
+const unstorage_47drivers_47fs_45lite = defineDriver((opts = {}) => {
+ if (!opts.base) {
+ throw createRequiredError(DRIVER_NAME, "base");
+ }
+ opts.base = resolve$1(opts.base);
+ const r = key => {
+ if (PATH_TRAVERSE_RE.test(key)) {
+ throw createError(DRIVER_NAME, `Invalid key: ${JSON.stringify(key)}. It should not contain .. segments`);
+ }
+ const resolved = join(opts.base, key.replace(/:/g, "/"));
+ return resolved;
+ };
+ return {
+ name: DRIVER_NAME,
+ options: opts,
+ hasItem(key) {
+ return existsSync(r(key));
+ },
+ getItem(key) {
+ return readFile(r(key), "utf8");
+ },
+ getItemRaw(key) {
+ return readFile(r(key));
+ },
+ async getMeta(key) {
+ const { atime, mtime, size, birthtime, ctime } = await promises.stat(r(key)).catch(() => ({}));
+ return { atime, mtime, size, birthtime, ctime };
+ },
+ setItem(key, value) {
+ if (opts.readOnly) {
+ return;
+ }
+ return writeFile(r(key), value, "utf8");
+ },
+ setItemRaw(key, value) {
+ if (opts.readOnly) {
+ return;
+ }
+ return writeFile(r(key), value);
+ },
+ removeItem(key) {
+ if (opts.readOnly) {
+ return;
+ }
+ return unlink(r(key));
+ },
+ getKeys() {
+ return readdirRecursive(r("."), opts.ignore);
+ },
+ async clear() {
+ if (opts.readOnly || opts.noClear) {
+ return;
+ }
+ await rmRecursive(r("."));
+ },
+ };
+});
+
+const storage = createStorage({});
+
+storage.mount("/assets", assets$1);
+
+storage.mount(
+ "data",
+ unstorage_47drivers_47fs_45lite({ "driver": "fsLite", "base": "/home/cirospaciari/test/nitro/.data/kv" }),
+);
+
+function useStorage(base = "") {
+ return base ? prefixStorage(storage, base) : storage;
+}
+
+const defaultCacheOptions = {
+ name: "_",
+ base: "/cache",
+ swr: true,
+ maxAge: 1,
+};
+function defineCachedFunction(fn, opts = {}) {
+ opts = { ...defaultCacheOptions, ...opts };
+ const pending = {};
+ const group = opts.group || "nitro/functions";
+ const name = opts.name || fn.name || "_";
+ const integrity = hash([opts.integrity, fn, opts]);
+ const validate = opts.validate || (() => true);
+ async function get(key, resolver, shouldInvalidateCache, event) {
+ var _a, _b;
+ const cacheKey = [opts.base, group, name, key + ".json"].filter(Boolean).join(":").replace(/:\/$/, ":index");
+ const entry = (await useStorage().getItem(cacheKey)) || {};
+ const ttl = ((_b = (_a = opts.maxAge) != null ? _a : opts.maxAge) != null ? _b : 0) * 1e3;
+ if (ttl) {
+ entry.expires = Date.now() + ttl;
+ }
+ const expired =
+ shouldInvalidateCache ||
+ entry.integrity !== integrity ||
+ (ttl && Date.now() - (entry.mtime || 0) > ttl) ||
+ !validate(entry);
+ const _resolve = async () => {
+ const isPending = pending[key];
+ if (!isPending) {
+ if (entry.value !== void 0 && (opts.staleMaxAge || 0) >= 0 && opts.swr === false) {
+ entry.value = void 0;
+ entry.integrity = void 0;
+ entry.mtime = void 0;
+ entry.expires = void 0;
+ }
+ pending[key] = Promise.resolve(resolver());
+ }
+ try {
+ entry.value = await pending[key];
+ } catch (error) {
+ if (!isPending) {
+ delete pending[key];
+ }
+ throw error;
+ }
+ if (!isPending) {
+ entry.mtime = Date.now();
+ entry.integrity = integrity;
+ delete pending[key];
+ if (validate(entry)) {
+ const promise = useStorage()
+ .setItem(cacheKey, entry)
+ .catch(error => {
+ useNitroApp().captureError(error, { event, tags: ["cache"] });
+ });
+ if (event && event.waitUntil) {
+ event.waitUntil(promise);
+ }
+ }
+ }
+ };
+ const _resolvePromise = expired ? _resolve() : Promise.resolve();
+ if (expired && event && event.waitUntil) {
+ event.waitUntil(_resolvePromise);
+ }
+ if (opts.swr && entry.value) {
+ _resolvePromise.catch(error => {
+ useNitroApp().captureError(error, { event, tags: ["cache"] });
+ });
+ return entry;
+ }
+ return _resolvePromise.then(() => entry);
+ }
+ return async (...args) => {
+ var _a, _b;
+ const shouldBypassCache = (_a = opts.shouldBypassCache) == null ? void 0 : _a.call(opts, ...args);
+ if (shouldBypassCache) {
+ return fn(...args);
+ }
+ const key = await (opts.getKey || getKey)(...args);
+ const shouldInvalidateCache = (_b = opts.shouldInvalidateCache) == null ? void 0 : _b.call(opts, ...args);
+ const entry = await get(
+ key,
+ () => fn(...args),
+ shouldInvalidateCache,
+ args[0] && isEvent(args[0]) ? args[0] : void 0,
+ );
+ let value = entry.value;
+ if (opts.transform) {
+ value = (await opts.transform(entry, ...args)) || value;
+ }
+ return value;
+ };
+}
+const cachedFunction = defineCachedFunction;
+function getKey(...args) {
+ return args.length > 0 ? hash(args, {}) : "";
+}
+function escapeKey(key) {
+ return String(key).replace(/\W/g, "");
+}
+function defineCachedEventHandler(handler, opts = defaultCacheOptions) {
+ const variableHeaderNames = (opts.varies || [])
+ .filter(Boolean)
+ .map(h => h.toLowerCase())
+ .sort();
+ const _opts = {
+ ...opts,
+ getKey: async event => {
+ var _a;
+ const customKey = await ((_a = opts.getKey) == null ? void 0 : _a.call(opts, event));
+ if (customKey) {
+ return escapeKey(customKey);
+ }
+ const _path = event.node.req.originalUrl || event.node.req.url || event.path;
+ const _pathname = escapeKey(decodeURI(parseURL(_path).pathname)).slice(0, 16) || "index";
+ const _hashedPath = `${_pathname}.${hash(_path)}`;
+ const _headers = variableHeaderNames
+ .map(header => [header, event.node.req.headers[header]])
+ .map(([name, value]) => `${escapeKey(name)}.${hash(value)}`);
+ return [_hashedPath, ..._headers].join(":");
+ },
+ validate: entry => {
+ if (entry.value.code >= 400) {
+ return false;
+ }
+ if (entry.value.body === void 0) {
+ return false;
+ }
+ return true;
+ },
+ group: opts.group || "nitro/handlers",
+ integrity: [opts.integrity, handler],
+ };
+ const _cachedHandler = cachedFunction(async incomingEvent => {
+ const variableHeaders = {};
+ for (const header of variableHeaderNames) {
+ variableHeaders[header] = incomingEvent.node.req.headers[header];
+ }
+ const reqProxy = cloneWithProxy(incomingEvent.node.req, {
+ headers: variableHeaders,
+ });
+ const resHeaders = {};
+ let _resSendBody;
+ const resProxy = cloneWithProxy(incomingEvent.node.res, {
+ statusCode: 200,
+ writableEnded: false,
+ writableFinished: false,
+ headersSent: false,
+ closed: false,
+ getHeader(name) {
+ return resHeaders[name];
+ },
+ setHeader(name, value) {
+ resHeaders[name] = value;
+ return this;
+ },
+ getHeaderNames() {
+ return Object.keys(resHeaders);
+ },
+ hasHeader(name) {
+ return name in resHeaders;
+ },
+ removeHeader(name) {
+ delete resHeaders[name];
+ },
+ getHeaders() {
+ return resHeaders;
+ },
+ end(chunk, arg2, arg3) {
+ if (typeof chunk === "string") {
+ _resSendBody = chunk;
+ }
+ if (typeof arg2 === "function") {
+ arg2();
+ }
+ if (typeof arg3 === "function") {
+ arg3();
+ }
+ return this;
+ },
+ write(chunk, arg2, arg3) {
+ if (typeof chunk === "string") {
+ _resSendBody = chunk;
+ }
+ if (typeof arg2 === "function") {
+ arg2();
+ }
+ if (typeof arg3 === "function") {
+ arg3();
+ }
+ return this;
+ },
+ writeHead(statusCode, headers2) {
+ this.statusCode = statusCode;
+ if (headers2) {
+ for (const header in headers2) {
+ this.setHeader(header, headers2[header]);
+ }
+ }
+ return this;
+ },
+ });
+ const event = createEvent(reqProxy, resProxy);
+ event.context = incomingEvent.context;
+ const body = (await handler(event)) || _resSendBody;
+ const headers = event.node.res.getHeaders();
+ headers.etag = headers.Etag || headers.etag || `W/"${hash(body)}"`;
+ headers["last-modified"] =
+ headers["Last-Modified"] || headers["last-modified"] || /* @__PURE__ */ new Date().toUTCString();
+ const cacheControl = [];
+ if (opts.swr) {
+ if (opts.maxAge) {
+ cacheControl.push(`s-maxage=${opts.maxAge}`);
+ }
+ if (opts.staleMaxAge) {
+ cacheControl.push(`stale-while-revalidate=${opts.staleMaxAge}`);
+ } else {
+ cacheControl.push("stale-while-revalidate");
+ }
+ } else if (opts.maxAge) {
+ cacheControl.push(`max-age=${opts.maxAge}`);
+ }
+ if (cacheControl.length > 0) {
+ headers["cache-control"] = cacheControl.join(", ");
+ }
+ const cacheEntry = {
+ code: event.node.res.statusCode,
+ headers,
+ body,
+ };
+ return cacheEntry;
+ }, _opts);
+ return defineEventHandler(async event => {
+ if (opts.headersOnly) {
+ if (handleCacheHeaders(event, { maxAge: opts.maxAge })) {
+ return;
+ }
+ return handler(event);
+ }
+ const response = await _cachedHandler(event);
+ if (event.node.res.headersSent || event.node.res.writableEnded) {
+ return response.body;
+ }
+ if (
+ handleCacheHeaders(event, {
+ modifiedTime: new Date(response.headers["last-modified"]),
+ etag: response.headers.etag,
+ maxAge: opts.maxAge,
+ })
+ ) {
+ return;
+ }
+ event.node.res.statusCode = response.code;
+ for (const name in response.headers) {
+ event.node.res.setHeader(name, response.headers[name]);
+ }
+ return response.body;
+ });
+}
+function cloneWithProxy(obj, overrides) {
+ return new Proxy(obj, {
+ get(target, property, receiver) {
+ if (property in overrides) {
+ return overrides[property];
+ }
+ return Reflect.get(target, property, receiver);
+ },
+ set(target, property, value, receiver) {
+ if (property in overrides) {
+ overrides[property] = value;
+ return true;
+ }
+ return Reflect.set(target, property, value, receiver);
+ },
+ });
+}
+const cachedEventHandler = defineCachedEventHandler;
+
+function hasReqHeader(event, name, includes) {
+ const value = getRequestHeader(event, name);
+ return value && typeof value === "string" && value.toLowerCase().includes(includes);
+}
+function isJsonRequest(event) {
+ return (
+ hasReqHeader(event, "accept", "application/json") ||
+ hasReqHeader(event, "user-agent", "curl/") ||
+ hasReqHeader(event, "user-agent", "httpie/") ||
+ hasReqHeader(event, "sec-fetch-mode", "cors") ||
+ event.path.startsWith("/api/") ||
+ event.path.endsWith(".json")
+ );
+}
+function normalizeError(error) {
+ var _a;
+ const cwd = typeof process.cwd === "function" ? process.cwd() : "/";
+ const stack = (error.stack || "")
+ .split("\n")
+ .splice(1)
+ .filter(line => line.includes("at "))
+ .map(line => {
+ const text = line
+ .replace(cwd + "/", "./")
+ .replace("webpack:/", "")
+ .replace("file://", "")
+ .trim();
+ return {
+ text,
+ internal:
+ (line.includes("node_modules") && !line.includes(".cache")) ||
+ line.includes("internal") ||
+ line.includes("new Promise"),
+ };
+ });
+ const statusCode = error.statusCode || 500;
+ const statusMessage = (_a = error.statusMessage) != null ? _a : statusCode === 404 ? "Not Found" : "";
+ const message = error.message || error.toString();
+ return {
+ stack,
+ statusCode,
+ statusMessage,
+ message,
+ };
+}
+function joinHeaders(value) {
+ return Array.isArray(value) ? value.join(", ") : String(value);
+}
+function normalizeFetchResponse(response) {
+ if (!response.headers.has("set-cookie")) {
+ return response;
+ }
+ return new Response(response.body, {
+ status: response.status,
+ statusText: response.statusText,
+ headers: normalizeCookieHeaders(response.headers),
+ });
+}
+function normalizeCookieHeader(header = "") {
+ return splitCookiesString(joinHeaders(header));
+}
+function normalizeCookieHeaders(headers) {
+ const outgoingHeaders = new Headers();
+ for (const [name, header] of headers) {
+ if (name === "set-cookie") {
+ for (const cookie of normalizeCookieHeader(header)) {
+ outgoingHeaders.append("set-cookie", cookie);
+ }
+ } else {
+ outgoingHeaders.set(name, joinHeaders(header));
+ }
+ }
+ return outgoingHeaders;
+}
+
+const config = useRuntimeConfig();
+const _routeRulesMatcher = toRouteMatcher(createRouter$1({ routes: config.nitro.routeRules }));
+function createRouteRulesHandler(ctx) {
+ return eventHandler(event => {
+ const routeRules = getRouteRules(event);
+ if (routeRules.headers) {
+ setHeaders(event, routeRules.headers);
+ }
+ if (routeRules.redirect) {
+ return sendRedirect(event, routeRules.redirect.to, routeRules.redirect.statusCode);
+ }
+ if (routeRules.proxy) {
+ let target = routeRules.proxy.to;
+ if (target.endsWith("/**")) {
+ let targetPath = event.path;
+ const strpBase = routeRules.proxy._proxyStripBase;
+ if (strpBase) {
+ targetPath = withoutBase(targetPath, strpBase);
+ }
+ target = joinURL(target.slice(0, -3), targetPath);
+ } else if (event.path.includes("?")) {
+ const query = getQuery$1(event.path);
+ target = withQuery(target, query);
+ }
+ return proxyRequest(event, target, {
+ fetch: ctx.localFetch,
+ ...routeRules.proxy,
+ });
+ }
+ });
+}
+function getRouteRules(event) {
+ event.context._nitro = event.context._nitro || {};
+ if (!event.context._nitro.routeRules) {
+ event.context._nitro.routeRules = getRouteRulesForPath(
+ withoutBase(event.path.split("?")[0], useRuntimeConfig().app.baseURL),
+ );
+ }
+ return event.context._nitro.routeRules;
+}
+function getRouteRulesForPath(path) {
+ return defu({}, ..._routeRulesMatcher.matchAll(path).reverse());
+}
+
+function createContext(opts = {}) {
+ let currentInstance;
+ let isSingleton = false;
+ const checkConflict = instance => {
+ if (currentInstance && currentInstance !== instance) {
+ throw new Error("Context conflict");
+ }
+ };
+ let als;
+ if (opts.asyncContext) {
+ const _AsyncLocalStorage = opts.AsyncLocalStorage || globalThis.AsyncLocalStorage;
+ if (_AsyncLocalStorage) {
+ als = new _AsyncLocalStorage();
+ } else {
+ console.warn("[unctx] `AsyncLocalStorage` is not provided.");
+ }
+ }
+ const _getCurrentInstance = () => {
+ if (als && currentInstance === void 0) {
+ const instance = als.getStore();
+ if (instance !== void 0) {
+ return instance;
+ }
+ }
+ return currentInstance;
+ };
+ return {
+ use: () => {
+ const _instance = _getCurrentInstance();
+ if (_instance === void 0) {
+ throw new Error("Context is not available");
+ }
+ return _instance;
+ },
+ tryUse: () => {
+ return _getCurrentInstance();
+ },
+ set: (instance, replace) => {
+ if (!replace) {
+ checkConflict(instance);
+ }
+ currentInstance = instance;
+ isSingleton = true;
+ },
+ unset: () => {
+ currentInstance = void 0;
+ isSingleton = false;
+ },
+ call: (instance, callback) => {
+ checkConflict(instance);
+ currentInstance = instance;
+ try {
+ return als ? als.run(instance, callback) : callback();
+ } finally {
+ if (!isSingleton) {
+ currentInstance = void 0;
+ }
+ }
+ },
+ async callAsync(instance, callback) {
+ currentInstance = instance;
+ const onRestore = () => {
+ currentInstance = instance;
+ };
+ const onLeave = () => (currentInstance === instance ? onRestore : void 0);
+ asyncHandlers.add(onLeave);
+ try {
+ const r = als ? als.run(instance, callback) : callback();
+ if (!isSingleton) {
+ currentInstance = void 0;
+ }
+ return await r;
+ } finally {
+ asyncHandlers.delete(onLeave);
+ }
+ },
+ };
+}
+function createNamespace(defaultOpts = {}) {
+ const contexts = {};
+ return {
+ get(key, opts = {}) {
+ if (!contexts[key]) {
+ contexts[key] = createContext({ ...defaultOpts, ...opts });
+ }
+ contexts[key];
+ return contexts[key];
+ },
+ };
+}
+const _globalThis =
+ typeof globalThis !== "undefined"
+ ? globalThis
+ : typeof self !== "undefined"
+ ? self
+ : typeof global !== "undefined"
+ ? global
+ : {};
+const globalKey = "__unctx__";
+const defaultNamespace = _globalThis[globalKey] || (_globalThis[globalKey] = createNamespace());
+const getContext = (key, opts = {}) => defaultNamespace.get(key, opts);
+const asyncHandlersKey = "__unctx_async_handlers__";
+const asyncHandlers = _globalThis[asyncHandlersKey] || (_globalThis[asyncHandlersKey] = /* @__PURE__ */ new Set());
+
+const nitroAsyncContext = getContext("nitro-app", {
+ asyncContext: true,
+ AsyncLocalStorage: AsyncLocalStorage,
+});
+function useEvent() {
+ try {
+ return nitroAsyncContext.use().event;
+ } catch {
+ const hint = "Note: This is an experimental feature and might be broken on non-Node.js environments.";
+ throw createError$1({
+ message: `Nitro request context is not available. ${hint}`,
+ });
+ }
+}
+
+function defineNitroPlugin(def) {
+ return def;
+}
+
+const allErrors = [];
+const _x6DgYnj6fm = defineNitroPlugin(app => {
+ app.hooks.hook("error", (error, context) => {
+ allErrors.push({ error, context });
+ });
+});
+
+const plugins = [_x6DgYnj6fm];
+
+const isDev = false;
+const errorHandler = function (error, event) {
+ const { stack, statusCode, statusMessage, message } = normalizeError(error);
+ const showDetails = isDev && statusCode !== 404;
+ const errorObject = {
+ url: event.path || "",
+ statusCode,
+ statusMessage,
+ message,
+ stack: showDetails ? stack.map(i => i.text) : void 0,
+ };
+ if (error.unhandled || error.fatal) {
+ const tags = ["[nitro]", "[request error]", error.unhandled && "[unhandled]", error.fatal && "[fatal]"]
+ .filter(Boolean)
+ .join(" ");
+ console.error(tags, error.message + "\n" + stack.map(l => " " + l.text).join(" \n"));
+ }
+ setResponseStatus(event, statusCode, statusMessage);
+ if (isJsonRequest(event)) {
+ setResponseHeader(event, "Content-Type", "application/json");
+ return send(event, JSON.stringify(errorObject));
+ } else {
+ setResponseHeader(event, "Content-Type", "text/html");
+ return send(event, renderHTMLError(errorObject));
+ }
+};
+function renderHTMLError(error) {
+ const statusCode = error.statusCode || 500;
+ const statusMessage = error.statusMessage || "Request Error";
+ return `<!DOCTYPE html>
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>${statusCode} ${statusMessage}</title>
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico/css/pico.min.css">
+ </head>
+ <body>
+ <main class="container">
+ <dialog open>
+ <article>
+ <header>
+ <h2>${statusCode} ${statusMessage}</h2>
+ </header>
+ <code>
+ ${error.message}<br><br>
+ ${"\n" + (error.stack || []).map(i => `&nbsp;&nbsp;${i}`).join("<br>")}
+ </code>
+ <footer>
+ <a href="/" onclick="event.preventDefault();history.back();">Go Back</a>
+ </footer>
+ </article>
+ </dialog>
+ </main>
+ </body>
+</html>
+`;
+}
+
+const assets = {
+ "/favicon.ico": {
+ "type": "image/vnd.microsoft.icon",
+ "etag": '"3c2e-dKdB0JNG9uHgD12RJtaVJk8vyiw"',
+ "mtime": "2023-09-15T01:10:20.884Z",
+ "size": 15406,
+ "path": "../public/favicon.ico",
+ },
+ "/icon.png": {
+ "type": "image/png",
+ "etag": '"185-bsZnfh+NZZ9wJAqc01z4pdZRaIY"',
+ "mtime": "2023-09-15T01:10:21.816Z",
+ "size": 389,
+ "path": "../public/icon.png",
+ },
+ "/build/test.txt": {
+ "type": "text/plain; charset=utf-8",
+ "etag": '"7-vxGfAKTuGVGhpDZqQLqV60dnKPw"',
+ "mtime": "2023-09-15T01:10:20.880Z",
+ "size": 7,
+ "path": "../public/build/test.txt",
+ },
+ "/api/hello": {
+ "type": "application/json",
+ "etag": '"17-TzGXketnjihp27LBaxXaC/GQ4Cw"',
+ "mtime": "2023-09-15T01:10:21.828Z",
+ "size": 23,
+ "path": "../public/api/hello",
+ },
+ "/prerender/index.html": {
+ "type": "text/html; charset=utf-8",
+ "etag": '"6b1-ELHEt7zntdMW4I0RZJWZ0Ufed0I"',
+ "mtime": "2023-09-15T01:10:21.808Z",
+ "size": 1713,
+ "path": "../public/prerender/index.html",
+ },
+ "/prerender/index.html.br": {
+ "type": "text/html; charset=utf-8",
+ "encoding": "br",
+ "etag": '"2bf-XWHeWlA4eJKb9VUBos+c4l9hmQE"',
+ "mtime": "2023-09-15T01:10:21.856Z",
+ "size": 703,
+ "path": "../public/prerender/index.html.br",
+ },
+ "/prerender/index.html.gz": {
+ "type": "text/html; charset=utf-8",
+ "encoding": "gzip",
+ "etag": '"345-jfEFwFFy03gL0Kso24hTACeQ2/M"',
+ "mtime": "2023-09-15T01:10:21.848Z",
+ "size": 837,
+ "path": "../public/prerender/index.html.gz",
+ },
+ "/api/hey/index.html": {
+ "type": "text/html; charset=utf-8",
+ "etag": '"7-Lr6rZuem0VGbm7EeJCclCejwUPw"',
+ "mtime": "2023-09-15T01:10:21.836Z",
+ "size": 7,
+ "path": "../public/api/hey/index.html",
+ },
+ "/api/param/foo.json": {
+ "type": "text/plain; charset=utf-16",
+ "etag": '"8-0uQNDvPL40mn3V7Om3Qv8NJh+Y8"',
+ "mtime": "2023-09-15T01:10:21.836Z",
+ "size": 8,
+ "path": "../public/api/param/foo.json",
+ },
+ "/api/param/hidden": {
+ "type": "text/plain; charset=utf-16",
+ "etag": '"6-mdcsf8Pi4UWHC+qzfAtw40PqnDs"',
+ "mtime": "2023-09-15T01:10:21.844Z",
+ "size": 6,
+ "path": "../public/api/param/hidden",
+ },
+ "/api/param/prerender1": {
+ "type": "text/plain; charset=utf-16",
+ "etag": '"a-pYBLNy7u4WEInOT359xKP8UH1Rc"',
+ "mtime": "2023-09-15T01:10:21.840Z",
+ "size": 10,
+ "path": "../public/api/param/prerender1",
+ },
+ "/api/param/prerender3": {
+ "type": "text/plain; charset=utf-16",
+ "etag": '"a-nfSfEQ6hJdddGyuhDnoiCT14VP8"',
+ "mtime": "2023-09-15T01:10:21.844Z",
+ "size": 10,
+ "path": "../public/api/param/prerender3",
+ },
+ "/api/param/prerender4": {
+ "type": "text/plain; charset=utf-16",
+ "etag": '"a-aTEB+nsE8e1OvE3PyLX2C+Cdypc"',
+ "mtime": "2023-09-15T01:10:21.824Z",
+ "size": 10,
+ "path": "../public/api/param/prerender4",
+ },
+};
+
+function normalizeWindowsPath(input = "") {
+ if (!input || !input.includes("\\")) {
+ return input;
+ }
+ return input.replace(/\\/g, "/");
+}
+const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
+const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
+function cwd() {
+ if (typeof process !== "undefined") {
+ return process.cwd().replace(/\\/g, "/");
+ }
+ return "/";
+}
+const resolve = function (...arguments_) {
+ arguments_ = arguments_.map(argument => normalizeWindowsPath(argument));
+ let resolvedPath = "";
+ let resolvedAbsolute = false;
+ for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
+ const path = index >= 0 ? arguments_[index] : cwd();
+ if (!path || path.length === 0) {
+ continue;
+ }
+ resolvedPath = `${path}/${resolvedPath}`;
+ resolvedAbsolute = isAbsolute(path);
+ }
+ resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
+ if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
+ return `/${resolvedPath}`;
+ }
+ return resolvedPath.length > 0 ? resolvedPath : ".";
+};
+function normalizeString(path, allowAboveRoot) {
+ let res = "";
+ let lastSegmentLength = 0;
+ let lastSlash = -1;
+ let dots = 0;
+ let char = null;
+ for (let index = 0; index <= path.length; ++index) {
+ if (index < path.length) {
+ char = path[index];
+ } else if (char === "/") {
+ break;
+ } else {
+ char = "/";
+ }
+ if (char === "/") {
+ if (lastSlash === index - 1 || dots === 1);
+ else if (dots === 2) {
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
+ if (res.length > 2) {
+ const lastSlashIndex = res.lastIndexOf("/");
+ if (lastSlashIndex === -1) {
+ res = "";
+ lastSegmentLength = 0;
+ } else {
+ res = res.slice(0, lastSlashIndex);
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
+ }
+ lastSlash = index;
+ dots = 0;
+ continue;
+ } else if (res.length > 0) {
+ res = "";
+ lastSegmentLength = 0;
+ lastSlash = index;
+ dots = 0;
+ continue;
+ }
+ }
+ if (allowAboveRoot) {
+ res += res.length > 0 ? "/.." : "..";
+ lastSegmentLength = 2;
+ }
+ } else {
+ if (res.length > 0) {
+ res += `/${path.slice(lastSlash + 1, index)}`;
+ } else {
+ res = path.slice(lastSlash + 1, index);
+ }
+ lastSegmentLength = index - lastSlash - 1;
+ }
+ lastSlash = index;
+ dots = 0;
+ } else if (char === "." && dots !== -1) {
+ ++dots;
+ } else {
+ dots = -1;
+ }
+ }
+ return res;
+}
+const isAbsolute = function (p) {
+ return _IS_ABSOLUTE_RE.test(p);
+};
+const dirname = function (p) {
+ const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
+ if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
+ segments[0] += "/";
+ }
+ return segments.join("/") || (isAbsolute(p) ? "/" : ".");
+};
+
+function readAsset(id) {
+ const serverDir = dirname(fileURLToPath(globalThis._importMeta_.url));
+ return promises$1.readFile(resolve(serverDir, assets[id].path));
+}
+
+const publicAssetBases = { "/build": { "maxAge": 3600 } };
+
+function isPublicAssetURL(id = "") {
+ if (assets[id]) {
+ return true;
+ }
+ for (const base in publicAssetBases) {
+ if (id.startsWith(base)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+function getAsset(id) {
+ return assets[id];
+}
+
+const METHODS = /* @__PURE__ */ new Set(["HEAD", "GET"]);
+const EncodingMap = { gzip: ".gz", br: ".br" };
+const _f4b49z = eventHandler(event => {
+ if (event.method && !METHODS.has(event.method)) {
+ return;
+ }
+ let id = decodePath(withLeadingSlash(withoutTrailingSlash(parseURL(event.path).pathname)));
+ let asset;
+ const encodingHeader = String(getRequestHeader(event, "accept-encoding") || "");
+ const encodings = [
+ ...encodingHeader
+ .split(",")
+ .map(e => EncodingMap[e.trim()])
+ .filter(Boolean)
+ .sort(),
+ "",
+ ];
+ if (encodings.length > 1) {
+ setResponseHeader(event, "Vary", "Accept-Encoding");
+ }
+ for (const encoding of encodings) {
+ for (const _id of [id + encoding, joinURL(id, "index.html" + encoding)]) {
+ const _asset = getAsset(_id);
+ if (_asset) {
+ asset = _asset;
+ id = _id;
+ break;
+ }
+ }
+ }
+ if (!asset) {
+ if (isPublicAssetURL(id)) {
+ removeResponseHeader(event, "Cache-Control");
+ throw createError$1({
+ statusMessage: "Cannot find static asset " + id,
+ statusCode: 404,
+ });
+ }
+ return;
+ }
+ const ifNotMatch = getRequestHeader(event, "if-none-match") === asset.etag;
+ if (ifNotMatch) {
+ setResponseStatus(event, 304, "Not Modified");
+ return "";
+ }
+ const ifModifiedSinceH = getRequestHeader(event, "if-modified-since");
+ const mtimeDate = new Date(asset.mtime);
+ if (ifModifiedSinceH && asset.mtime && new Date(ifModifiedSinceH) >= mtimeDate) {
+ setResponseStatus(event, 304, "Not Modified");
+ return "";
+ }
+ if (asset.type && !getResponseHeader(event, "Content-Type")) {
+ setResponseHeader(event, "Content-Type", asset.type);
+ }
+ if (asset.etag && !getResponseHeader(event, "ETag")) {
+ setResponseHeader(event, "ETag", asset.etag);
+ }
+ if (asset.mtime && !getResponseHeader(event, "Last-Modified")) {
+ setResponseHeader(event, "Last-Modified", mtimeDate.toUTCString());
+ }
+ if (asset.encoding && !getResponseHeader(event, "Content-Encoding")) {
+ setResponseHeader(event, "Content-Encoding", asset.encoding);
+ }
+ if (asset.size > 0 && !getResponseHeader(event, "Content-Length")) {
+ setResponseHeader(event, "Content-Length", asset.size);
+ }
+ return readAsset(id);
+});
+
+process.env.NITRO_DYNAMIC = "from-env";
+const _1IhT40 = eventHandler(event => {
+ const appConfig = useAppConfig(event);
+ appConfig.dynamic = "from-middleware";
+});
+
+const _8FbgNa = eventHandler(() => ({ message: "Hello API" }));
+
+const hello = /*#__PURE__*/ Object.freeze({
+ __proto__: null,
+ default: _8FbgNa,
+});
+
+const _lazy_VB431L = () => import("./chunks/stream.mjs");
+
+const handlers = [
+ { route: "", handler: _f4b49z, lazy: false, middleware: true, method: undefined },
+ { route: "", handler: _1IhT40, lazy: false, middleware: true, method: undefined },
+ { route: "/stream", handler: _lazy_VB431L, lazy: true, middleware: false, method: undefined },
+];
+
+function createNitroApp() {
+ const config = useRuntimeConfig();
+ const hooks = createHooks();
+ const captureError = (error, context = {}) => {
+ var _a;
+ const promise = hooks.callHookParallel("error", error, context).catch(_err => {
+ console.error("Error while capturing another error", _err);
+ });
+ if (context.event && isEvent(context.event)) {
+ const errors = (_a = context.event.context.nitro) == null ? void 0 : _a.errors;
+ if (errors) {
+ errors.push({ error, context });
+ }
+ if (context.event.waitUntil) {
+ context.event.waitUntil(promise);
+ }
+ }
+ };
+ const h3App = createApp({
+ debug: destr(false),
+ onError: (error, event) => {
+ captureError(error, { event, tags: ["request"] });
+ return errorHandler(error, event);
+ },
+ onRequest: async event => {
+ await nitroApp.hooks.callHook("request", event).catch(error => {
+ captureError(error, { event, tags: ["request"] });
+ });
+ },
+ onBeforeResponse: async (event, response) => {
+ await nitroApp.hooks.callHook("beforeResponse", event, response).catch(error => {
+ captureError(error, { event, tags: ["request", "response"] });
+ });
+ },
+ onAfterResponse: async (event, response) => {
+ await nitroApp.hooks.callHook("afterResponse", event, response).catch(error => {
+ captureError(error, { event, tags: ["request", "response"] });
+ });
+ },
+ });
+ const router = createRouter({
+ preemptive: true,
+ });
+ const localCall = createCall(toNodeListener(h3App));
+ const _localFetch = createFetch(localCall, globalThis.fetch);
+ const localFetch = (...args) => {
+ return _localFetch(...args).then(response => normalizeFetchResponse(response));
+ };
+ const $fetch = createFetch$1({
+ fetch: localFetch,
+ Headers: Headers$1,
+ defaults: { baseURL: config.app.baseURL },
+ });
+ globalThis.$fetch = $fetch;
+ h3App.use(createRouteRulesHandler({ localFetch }));
+ h3App.use(
+ eventHandler(event => {
+ var _a;
+ event.context.nitro = event.context.nitro || { errors: [] };
+ const envContext = (_a = event.node.req) == null ? void 0 : _a.__unenv__;
+ if (envContext) {
+ Object.assign(event.context, envContext);
+ }
+ event.fetch = (req, init) => fetchWithEvent(event, req, init, { fetch: localFetch });
+ event.$fetch = (req, init) =>
+ fetchWithEvent(event, req, init, {
+ fetch: $fetch,
+ });
+ event.waitUntil = promise => {
+ if (!event.context.nitro._waitUntilPromises) {
+ event.context.nitro._waitUntilPromises = [];
+ }
+ event.context.nitro._waitUntilPromises.push(promise);
+ if (envContext == null ? void 0 : envContext.waitUntil) {
+ envContext.waitUntil(promise);
+ }
+ };
+ event.captureError = (error, context) => {
+ captureError(error, { event, ...context });
+ };
+ }),
+ );
+ for (const h of handlers) {
+ let handler = h.lazy ? lazyEventHandler(h.handler) : h.handler;
+ if (h.middleware || !h.route) {
+ const middlewareBase = (config.app.baseURL + (h.route || "/")).replace(/\/+/g, "/");
+ h3App.use(middlewareBase, handler);
+ } else {
+ const routeRules = getRouteRulesForPath(h.route.replace(/:\w+|\*\*/g, "_"));
+ if (routeRules.cache) {
+ handler = cachedEventHandler(handler, {
+ group: "nitro/routes",
+ ...routeRules.cache,
+ });
+ }
+ router.use(h.route, handler, h.method);
+ }
+ }
+ h3App.use(config.app.baseURL, router.handler);
+ {
+ const _handler = h3App.handler;
+ h3App.handler = event => {
+ const ctx = { event };
+ return nitroAsyncContext.callAsync(ctx, () => _handler(event));
+ };
+ }
+ const app = {
+ hooks,
+ h3App,
+ router,
+ localCall,
+ localFetch,
+ captureError,
+ };
+ for (const plugin of plugins) {
+ try {
+ plugin(app);
+ } catch (err) {
+ captureError(err, { tags: ["plugin"] });
+ throw err;
+ }
+ }
+ return app;
+}
+const nitroApp = createNitroApp();
+const useNitroApp = () => nitroApp;
+
+try {
+ const server = Bun.serve({
+ port: process.env.NITRO_PORT || process.env.PORT || 3e3,
+ async fetch(request) {
+ const url = new URL(request.url);
+ let body;
+ if (request.body) {
+ body = await request.arrayBuffer();
+ }
+ return nitroApp.localFetch(url.pathname + url.search, {
+ host: url.hostname,
+ protocol: url.protocol,
+ headers: request.headers,
+ method: request.method,
+ redirect: request.redirect,
+ body,
+ });
+ },
+ });
+ console.log(`Listening on http://localhost:${server.port}...`);
+
+ const result = await fetch(`http://${server.hostname}:${server.port}/stream`).then(res => res.text());
+ process.exit(result == "nitroisawesome" ? 0 : 2);
+} catch {
+ process.exit(1);
+}
+
+export {
+ allErrors as a,
+ setCookie as b,
+ createError$1 as c,
+ defineEventHandler as d,
+ eventHandler as e,
+ useAppConfig as f,
+ getQuery as g,
+ useRuntimeConfig as h,
+ useEvent as i,
+ appendHeader as j,
+ kebabCase as k,
+ readBody as r,
+ setHeader as s,
+ useStorage as u,
+};
+//# sourceMappingURL=index.mjs.map
diff --git a/test/js/bun/http/proxy.test.js b/test/js/bun/http/proxy.test.js
index 48595a2ac..433adfb83 100644
--- a/test/js/bun/http/proxy.test.js
+++ b/test/js/bun/http/proxy.test.js
@@ -1,7 +1,9 @@
import { afterAll, beforeAll, describe, expect, it } from "bun:test";
import { gc } from "harness";
import fs from "fs";
+import { tmpdir } from "os";
import path from "path";
+import { bunExe } from "harness";
let proxy, auth_proxy, server;
@@ -168,3 +170,30 @@ it("proxy non-TLS auth can fail", async () => {
}
}
});
+
+it.each([
+ [undefined, undefined],
+ ["", ""],
+ ["''", "''"],
+ ['""', '""'],
+])("test proxy env, http_proxy=%s https_proxy=%s", async (http_proxy, https_proxy) => {
+ const path = `${tmpdir()}/bun-test-http-proxy-env-${Date.now()}.ts`;
+ fs.writeFileSync(path, 'await fetch("https://example.com");');
+
+ const { stdout, stderr, exitCode } = Bun.spawnSync({
+ cmd: [bunExe(), "run", path],
+ env: {
+ http_proxy: http_proxy,
+ https_proxy: https_proxy,
+ },
+ stdout: "pipe",
+ stderr: "pipe",
+ });
+
+ try {
+ expect(stderr.includes("FailedToOpenSocket: Was there a typo in the url or port?")).toBe(false);
+ expect(exitCode).toBe(0);
+ } finally {
+ fs.unlinkSync(path);
+ }
+});
diff --git a/test/js/bun/http/serve.test.ts b/test/js/bun/http/serve.test.ts
index b6ef75b54..9b8448b55 100644
--- a/test/js/bun/http/serve.test.ts
+++ b/test/js/bun/http/serve.test.ts
@@ -1165,3 +1165,142 @@ it("unix socket connection throws an error on a bad domain without crashing", as
});
}).toThrow();
});
+
+it("#5859 text", async () => {
+ const server = Bun.serve({
+ port: 0,
+ development: false,
+ async fetch(req) {
+ return new Response(await req.text(), {});
+ },
+ });
+
+ const response = await fetch(`http://${server.hostname}:${server.port}`, {
+ method: "POST",
+ body: new Uint8Array([0xfd]),
+ });
+
+ expect(await response.text()).toBe("�");
+ await server.stop(true);
+});
+
+it("#5859 json", async () => {
+ const server = Bun.serve({
+ port: 0,
+ async fetch(req) {
+ try {
+ await req.json();
+ } catch (e) {
+ return new Response("FAIL", { status: 500 });
+ }
+
+ return new Response("SHOULD'VE FAILED", {});
+ },
+ });
+
+ const response = await fetch(`http://${server.hostname}:${server.port}`, {
+ method: "POST",
+ body: new Uint8Array([0xfd]),
+ });
+
+ expect(response.ok).toBeFalse();
+ expect(await response.text()).toBe("FAIL");
+ await server.stop(true);
+});
+
+it("#5859 arrayBuffer", async () => {
+ await Bun.write("/tmp/bad", new Uint8Array([0xfd]));
+ expect(async () => await Bun.file("/tmp/bad").json()).toThrow();
+});
+
+it("server.requestIP (v4)", async () => {
+ const server = Bun.serve({
+ port: 0,
+ fetch(req, server) {
+ return Response.json(server.requestIP(req));
+ },
+ hostname: "127.0.0.1",
+ });
+
+ const response = await fetch(`http://${server.hostname}:${server.port}`).then(x => x.json());
+ expect(response).toEqual({
+ address: "127.0.0.1",
+ family: "IPv4",
+ port: expect.any(Number),
+ });
+ server.stop(true);
+});
+
+it("server.requestIP (v6)", async () => {
+ const server = Bun.serve({
+ port: 0,
+ fetch(req, server) {
+ return Response.json(server.requestIP(req));
+ },
+ hostname: "::1",
+ });
+
+ const response = await fetch(`http://localhost:${server.port}`).then(x => x.json());
+ expect(response).toEqual({
+ address: "::1",
+ family: "IPv6",
+ port: expect.any(Number),
+ });
+ server.stop(true);
+});
+
+it("server.requestIP (unix)", async () => {
+ const unix = "/tmp/bun-serve.sock";
+ const server = Bun.serve({
+ unix,
+ fetch(req, server) {
+ return Response.json(server.requestIP(req));
+ },
+ });
+ const requestText = `GET / HTTP/1.1\r\nHost: localhost\r\n\r\n`;
+ const received: Buffer[] = [];
+ const { resolve, promise } = Promise.withResolvers<void>();
+ const connection = await Bun.connect({
+ unix,
+ socket: {
+ data(socket, data) {
+ received.push(data);
+ resolve();
+ },
+ },
+ });
+ connection.write(requestText);
+ connection.flush();
+ await promise;
+ expect(Buffer.concat(received).toString()).toEndWith("\r\n\r\nnull");
+ connection.end();
+ server.stop(true);
+});
+
+it("should response with HTTP 413 when request body is larger than maxRequestBodySize, issue#6031", async () => {
+ const server = Bun.serve({
+ port: 0,
+ maxRequestBodySize: 10,
+ fetch(req, server) {
+ return new Response("OK");
+ },
+ });
+
+ {
+ const resp = await fetch(`http://${server.hostname}:${server.port}`, {
+ method: "POST",
+ body: "A".repeat(10),
+ });
+ expect(resp.status).toBe(200);
+ expect(await resp.text()).toBe("OK");
+ }
+ {
+ const resp = await fetch(`http://${server.hostname}:${server.port}`, {
+ method: "POST",
+ body: "A".repeat(11),
+ });
+ expect(resp.status).toBe(413);
+ }
+
+ server.stop(true);
+});
diff --git a/test/js/bun/io/bun-write.test.js b/test/js/bun/io/bun-write.test.js
index f435d2ceb..fbcc99b66 100644
--- a/test/js/bun/io/bun-write.test.js
+++ b/test/js/bun/io/bun-write.test.js
@@ -80,6 +80,31 @@ it("Bun.file not found returns ENOENT", async () => {
await gcTick();
});
+it("Bun.write file not found returns ENOENT, issue#6336", async () => {
+ const dst = Bun.file(path.join(tmpdir(), "does/not/exist.txt"));
+ try {
+ await gcTick();
+ await Bun.write(dst, "");
+ await gcTick();
+ } catch (exception) {
+ expect(exception.code).toBe("ENOENT");
+ expect(exception.path).toBe(dst.name);
+ }
+
+ const src = Bun.file(path.join(tmpdir(), `test-bun-write-${Date.now()}.txt`));
+ await Bun.write(src, "");
+ try {
+ await gcTick();
+ await Bun.write(dst, src);
+ await gcTick();
+ } catch (exception) {
+ expect(exception.code).toBe("ENOENT");
+ expect(exception.path).toBe(dst.name);
+ } finally {
+ fs.unlinkSync(src.name);
+ }
+});
+
it("Bun.write('out.txt', 'string')", async () => {
for (let erase of [true, false]) {
if (erase) {
@@ -300,6 +325,16 @@ it("offset should work #4963", async () => {
expect(contents).toBe("ntents");
});
+it("length should be limited by file size #5080", async () => {
+ const filename = tmpdir() + "/bun.test.offset2.txt";
+ await Bun.write(filename, "contents");
+ const file = Bun.file(filename);
+ const slice = file.slice(2, 1024);
+ const contents = await slice.text();
+ expect(contents).toBe("ntents");
+ expect(contents.length).toBeLessThanOrEqual(file.size);
+});
+
it("#2674", async () => {
const file = path.join(import.meta.dir, "big-stdout.js");
diff --git a/test/js/bun/net/socket.test.ts b/test/js/bun/net/socket.test.ts
index cf6625dc5..70173d31a 100644
--- a/test/js/bun/net/socket.test.ts
+++ b/test/js/bun/net/socket.test.ts
@@ -93,7 +93,7 @@ it("should reject on connection error, calling both connectError() and rejecting
expect(socket).toBeDefined();
expect(socket.data).toBe(data);
expect(error).toBeDefined();
- expect(error.name).toBe("SystemError");
+ expect(error.name).toBe("ECONNREFUSED");
expect(error.message).toBe("Failed to connect");
},
data() {
@@ -119,7 +119,7 @@ it("should reject on connection error, calling both connectError() and rejecting
() => done(new Error("Promise should reject instead")),
err => {
expect(err).toBeDefined();
- expect(err.name).toBe("SystemError");
+ expect(err.name).toBe("ECONNREFUSED");
expect(err.message).toBe("Failed to connect");
done();
@@ -164,8 +164,9 @@ it("should handle connection error", done => {
expect(socket).toBeDefined();
expect(socket.data).toBe(data);
expect(error).toBeDefined();
- expect(error.name).toBe("SystemError");
+ expect(error.name).toBe("ECONNREFUSED");
expect(error.message).toBe("Failed to connect");
+ expect((error as any).code).toBe("ECONNREFUSED");
done();
},
data() {
@@ -191,5 +192,5 @@ it("should handle connection error", done => {
});
it("should not leak memory when connect() fails again", async () => {
- await expectMaxObjectTypeCount(expect, "TCPSocket", 1, 100);
+ await expectMaxObjectTypeCount(expect, "TCPSocket", 2, 100);
});
diff --git a/test/js/bun/plugin/module-plugins.ts b/test/js/bun/plugin/module-plugins.ts
new file mode 100644
index 000000000..d6034c5df
--- /dev/null
+++ b/test/js/bun/plugin/module-plugins.ts
@@ -0,0 +1,38 @@
+import { plugin } from "bun";
+plugin({
+ name: "i am virtual!",
+ setup(builder) {
+ builder.module("my-virtual-module-async", async () => {
+ // check
+ await Bun.sleep(1);
+ return {
+ exports: {
+ hello: "world",
+ },
+ loader: "object",
+ };
+ });
+
+ builder.module("my-virtual-module-sync", () => {
+ return {
+ exports: {
+ hello: "world",
+ },
+ loader: "object",
+ };
+ });
+
+ builder.onLoad({ filter: /.*/, namespace: "rejected-promise" }, async ({ path }) => {
+ throw new Error("Rejected Promise");
+ });
+
+ builder.onResolve({ filter: /.*/, namespace: "rejected-promise2" }, ({ path }) => ({
+ namespace: "rejected-promise2",
+ path,
+ }));
+
+ builder.onLoad({ filter: /.*/, namespace: "rejected-promise2" }, ({ path }) => {
+ return Promise.reject(new Error("Rejected Promise"));
+ });
+ },
+});
diff --git a/test/js/bun/plugin/plugins.test.ts b/test/js/bun/plugin/plugins.test.ts
index c2827f600..2d3cfa1fa 100644
--- a/test/js/bun/plugin/plugins.test.ts
+++ b/test/js/bun/plugin/plugins.test.ts
@@ -185,6 +185,7 @@ plugin({
// This is to test that it works when imported from a separate file
import "../../third_party/svelte";
+import "./module-plugins";
describe("require", () => {
it("SSRs `<h1>Hello world!</h1>` with Svelte", () => {
@@ -210,6 +211,83 @@ describe("require", () => {
});
});
+describe("module", () => {
+ it("throws with require()", () => {
+ expect(() => require("my-virtual-module-async")).toThrow();
+ });
+
+ it("async module works with async import", async () => {
+ // @ts-expect-error
+ const { hello } = await import("my-virtual-module-async");
+
+ expect(hello).toBe("world");
+ delete require.cache["my-virtual-module-async"];
+ });
+
+ it("sync module module works with require()", async () => {
+ const { hello } = require("my-virtual-module-sync");
+
+ expect(hello).toBe("world");
+ delete require.cache["my-virtual-module-sync"];
+ });
+
+ it("sync module module works with require.resolve()", async () => {
+ expect(require.resolve("my-virtual-module-sync")).toBe("my-virtual-module-sync");
+ delete require.cache["my-virtual-module-sync"];
+ });
+
+ it("sync module module works with import", async () => {
+ // @ts-expect-error
+ const { hello } = await import("my-virtual-module-sync");
+
+ expect(hello).toBe("world");
+ delete require.cache["my-virtual-module-sync"];
+ });
+
+ it("modules are overridable", async () => {
+ // @ts-expect-error
+ let { hello, there } = await import("my-virtual-module-sync");
+ expect(there).toBeUndefined();
+ expect(hello).toBe("world");
+
+ Bun.plugin({
+ setup(builder) {
+ builder.module("my-virtual-module-sync", () => ({
+ exports: {
+ there: true,
+ },
+ loader: "object",
+ }));
+ },
+ });
+
+ {
+ const { there, hello } = require("my-virtual-module-sync");
+ expect(there).toBe(true);
+ expect(hello).toBeUndefined();
+ }
+
+ Bun.plugin({
+ setup(builder) {
+ builder.module("my-virtual-module-sync", () => ({
+ exports: {
+ yo: true,
+ },
+ loader: "object",
+ }));
+ },
+ });
+
+ {
+ // @ts-expect-error
+ const { there, hello, yo } = await import("my-virtual-module-sync");
+ expect(yo).toBe(true);
+ expect(hello).toBeUndefined();
+ expect(there).toBeUndefined();
+ }
+ });
+});
+
describe("dynamic import", () => {
it("SSRs `<h1>Hello world!</h1>` with Svelte", async () => {
const { default: App }: any = await import("./hello.svelte");
diff --git a/test/js/bun/resolve/import-meta.test.js b/test/js/bun/resolve/import-meta.test.js
index a940d0c87..e0e3bb11e 100644
--- a/test/js/bun/resolve/import-meta.test.js
+++ b/test/js/bun/resolve/import-meta.test.js
@@ -102,7 +102,7 @@ it("Module.createRequire(file://url).resolve(file://url)", () => {
const createdRequire = Module.createRequire(import.meta.url);
const result1 = createdRequire.resolve("./require-json.json");
- const result2 = createdRequire.resolve("file://./require-json.json");
+ const result2 = createdRequire.resolve(`file://${expected}`);
expect(result1).toBe(expected);
expect(result2).toBe(expected);
});
diff --git a/test/js/bun/resolve/png/test-png-import.test.js b/test/js/bun/resolve/png/test-png-import.test.js
index f4a809e7a..ca2d0b9ce 100644
--- a/test/js/bun/resolve/png/test-png-import.test.js
+++ b/test/js/bun/resolve/png/test-png-import.test.js
@@ -1,7 +1,7 @@
import { expect, test } from "bun:test";
import { resolve } from "path";
-// import MyPNG from "./test-png.png";
+import MyPNG from "./test-png.png";
-test.todo("png import", () => {
+test("png import", () => {
expect(MyPNG).toBe(resolve(__dirname, "./test-png.png"));
});
diff --git a/test/js/bun/resolve/resolve.test.ts b/test/js/bun/resolve/resolve.test.ts
index a9272fb3f..217d3dc81 100644
--- a/test/js/bun/resolve/resolve.test.ts
+++ b/test/js/bun/resolve/resolve.test.ts
@@ -92,7 +92,6 @@ it("file url in import resolves", async () => {
});
writeFileSync(`${dir}/test.js`, `import {foo} from 'file://${dir}/index.js';\nconsole.log(foo);`);
- console.log("dir", dir);
const { exitCode, stdout } = Bun.spawnSync({
cmd: [bunExe(), `${dir}/test.js`],
env: bunEnv,
@@ -102,13 +101,97 @@ it("file url in import resolves", async () => {
expect(stdout.toString("utf8")).toBe("1\n");
});
+it("invalid file url in import throws error", async () => {
+ const dir = tempDirWithFiles("fileurl", {});
+ writeFileSync(`${dir}/test.js`, `import {foo} from 'file://\0invalid url';\nconsole.log(foo);`);
+
+ const { exitCode, stdout, stderr } = Bun.spawnSync({
+ cmd: [bunExe(), `${dir}/test.js`],
+ env: bunEnv,
+ cwd: import.meta.dir,
+ });
+ expect(exitCode).not.toBe(0);
+ expect(stderr.toString("utf8")).toContain("file://\0invalid url");
+});
+
it("file url in await import resolves", async () => {
const dir = tempDirWithFiles("fileurl", {
"index.js": "export const foo = 1;",
});
writeFileSync(`${dir}/test.js`, `const {foo} = await import('file://${dir}/index.js');\nconsole.log(foo);`);
- console.log("dir", dir);
+ const { exitCode, stdout } = Bun.spawnSync({
+ cmd: [bunExe(), `${dir}/test.js`],
+ env: bunEnv,
+ cwd: import.meta.dir,
+ });
+ expect(exitCode).toBe(0);
+ expect(stdout.toString("utf8")).toBe("1\n");
+});
+
+it("file url with special characters in await import resolves", async () => {
+ const filename = "🅱️ndex.js";
+ const dir = tempDirWithFiles("file url", {
+ [filename]: "export const foo = 1;",
+ });
+ writeFileSync(
+ `${dir}/test.js`,
+ `const {foo} = await import('file://${dir.replace(/ /g, "%20")}/${encodeURIComponent(
+ filename,
+ )}');\nconsole.log(foo);`,
+ );
+
+ const { exitCode, stdout } = Bun.spawnSync({
+ cmd: [bunExe(), `${dir}/test.js`],
+ env: bunEnv,
+ cwd: import.meta.dir,
+ });
+ expect(exitCode).toBe(0);
+ expect(stdout.toString("utf8")).toBe("1\n");
+});
+
+it("file url with special characters not encoded in await import resolves", async () => {
+ const filename = "🅱️ndex.js";
+ const dir = tempDirWithFiles("file url", {
+ [filename]: "export const foo = 1;",
+ });
+ writeFileSync(`${dir}/test.js`, `const {foo} = await import('file://${dir}/${filename}');\nconsole.log(foo);`);
+
+ const { exitCode, stdout } = Bun.spawnSync({
+ cmd: [bunExe(), `${dir}/test.js`],
+ env: bunEnv,
+ cwd: import.meta.dir,
+ });
+ expect(exitCode).toBe(0);
+ expect(stdout.toString("utf8")).toBe("1\n");
+});
+
+it("file url with special characters in import statement resolves", async () => {
+ const filename = "🅱️ndex.js";
+ const dir = tempDirWithFiles("file url", {
+ [filename]: "export const foo = 1;",
+ });
+ writeFileSync(
+ `${dir}/test.js`,
+ `import {foo} from 'file://${dir.replace(/ /g, "%20")}/${encodeURIComponent(filename)}';\nconsole.log(foo);`,
+ );
+
+ const { exitCode, stdout } = Bun.spawnSync({
+ cmd: [bunExe(), `${dir}/test.js`],
+ env: bunEnv,
+ cwd: import.meta.dir,
+ });
+ expect(exitCode).toBe(0);
+ expect(stdout.toString("utf8")).toBe("1\n");
+});
+
+it("file url with special characters not encoded in import statement resolves", async () => {
+ const filename = "🅱️ndex.js";
+ const dir = tempDirWithFiles("file url", {
+ [filename]: "export const foo = 1;",
+ });
+ writeFileSync(`${dir}/test.js`, `import {foo} from 'file://${dir}/${filename}';\nconsole.log(foo);`);
+
const { exitCode, stdout } = Bun.spawnSync({
cmd: [bunExe(), `${dir}/test.js`],
env: bunEnv,
@@ -124,7 +207,6 @@ it("file url in require resolves", async () => {
});
writeFileSync(`${dir}/test.js`, `const {foo} = require('file://${dir}/index.js');\nconsole.log(foo);`);
- console.log("dir", dir);
const { exitCode, stdout } = Bun.spawnSync({
cmd: [bunExe(), `${dir}/test.js`],
env: bunEnv,
@@ -134,6 +216,61 @@ it("file url in require resolves", async () => {
expect(stdout.toString("utf8")).toBe("1\n");
});
+it("file url with special characters in require resolves", async () => {
+ const filename = "🅱️ndex.js";
+ const dir = tempDirWithFiles("file url", {
+ [filename]: "export const foo = 1;",
+ });
+ writeFileSync(
+ `${dir}/test.js`,
+ `const {foo} = require('file://${dir.replace(/ /g, "%20")}/${encodeURIComponent(filename)}');\nconsole.log(foo);`,
+ );
+
+ const { exitCode, stdout } = Bun.spawnSync({
+ cmd: [bunExe(), `${dir}/test.js`],
+ env: bunEnv,
+ cwd: import.meta.dir,
+ });
+ expect(exitCode).toBe(0);
+ expect(stdout.toString("utf8")).toBe("1\n");
+});
+
+it("file url in require.resolve resolves", async () => {
+ const dir = tempDirWithFiles("fileurl", {
+ "index.js": "export const foo = 1;",
+ });
+ writeFileSync(`${dir}/test.js`, `const to = require.resolve('file://${dir}/index.js');\nconsole.log(to);`);
+
+ const { exitCode, stdout } = Bun.spawnSync({
+ cmd: [bunExe(), `${dir}/test.js`],
+ env: bunEnv,
+ cwd: import.meta.dir,
+ });
+ expect(exitCode).toBe(0);
+ expect(stdout.toString("utf8")).toBe(`${dir}/index.js\n`);
+});
+
+it("file url with special characters in require resolves", async () => {
+ const filename = "🅱️ndex.js";
+ const dir = tempDirWithFiles("file url", {
+ [filename]: "export const foo = 1;",
+ });
+ writeFileSync(
+ `${dir}/test.js`,
+ `const to = require.resolve('file://${dir.replace(/ /g, "%20")}/${encodeURIComponent(
+ filename,
+ )}');\nconsole.log(to);`,
+ );
+
+ const { exitCode, stdout } = Bun.spawnSync({
+ cmd: [bunExe(), `${dir}/test.js`],
+ env: bunEnv,
+ cwd: import.meta.dir,
+ });
+ expect(exitCode).toBe(0);
+ expect(stdout.toString("utf8")).toBe(`${dir}/${filename}\n`);
+});
+
it("import long string should not segfault", async () => {
try {
await import("a".repeat(10000));
diff --git a/test/js/bun/spawn/bun-ipc-child-respond.js b/test/js/bun/spawn/bun-ipc-child-respond.js
new file mode 100644
index 000000000..7b6d86ef2
--- /dev/null
+++ b/test/js/bun/spawn/bun-ipc-child-respond.js
@@ -0,0 +1,3 @@
+process.on("message", message => {
+ process.send("pong:" + message);
+});
diff --git a/test/js/bun/spawn/bun-ipc-child.js b/test/js/bun/spawn/bun-ipc-child.js
new file mode 100644
index 000000000..664224a50
--- /dev/null
+++ b/test/js/bun/spawn/bun-ipc-child.js
@@ -0,0 +1 @@
+process.send("hello");
diff --git a/test/js/bun/spawn/spawn.test.ts b/test/js/bun/spawn/spawn.test.ts
index 897a16635..139eddb33 100644
--- a/test/js/bun/spawn/spawn.test.ts
+++ b/test/js/bun/spawn/spawn.test.ts
@@ -1,7 +1,8 @@
import { ArrayBufferSink, readableStreamToText, spawn, spawnSync, write } from "bun";
import { describe, expect, it } from "bun:test";
-import { gcTick as _gcTick, bunEnv } from "harness";
+import { gcTick as _gcTick, bunExe } from "harness";
import { rmSync, writeFileSync } from "node:fs";
+import path from "path";
for (let [gcTick, label] of [
[_gcTick, "gcTick"],
@@ -440,6 +441,38 @@ for (let [gcTick, label] of [
});
}
});
+
+ describe("ipc", () => {
+ it("the subprocess should be defined and the child should send", done => {
+ gcTick();
+ const returned_subprocess = spawn([bunExe(), path.join(__dirname, "bun-ipc-child.js")], {
+ ipc: (message, subProcess) => {
+ expect(subProcess).toBe(returned_subprocess);
+ expect(message).toBe("hello");
+ subProcess.kill();
+ done();
+ gcTick();
+ },
+ });
+ });
+
+ it("the subprocess should receive the parent message and respond back", done => {
+ gcTick();
+
+ const parentMessage = "I am your father";
+ const childProc = spawn([bunExe(), path.join(__dirname, "bun-ipc-child-respond.js")], {
+ ipc: (message, subProcess) => {
+ expect(message).toBe(`pong:${parentMessage}`);
+ subProcess.kill();
+ done();
+ gcTick();
+ },
+ });
+
+ childProc.send(parentMessage);
+ gcTick();
+ });
+ });
});
});
}
diff --git a/test/js/bun/sqlite/sqlite.test.js b/test/js/bun/sqlite/sqlite.test.js
index 7998f7469..6f1f5e19a 100644
--- a/test/js/bun/sqlite/sqlite.test.js
+++ b/test/js/bun/sqlite/sqlite.test.js
@@ -268,6 +268,9 @@ it("supports serialize/deserialize", () => {
} catch (e) {
expect(e.message).toBe("attempt to write a readonly database");
}
+
+ // https://github.com/oven-sh/bun/issues/3712#issuecomment-1725259824
+ expect(Database.deserialize(input)).toBeInstanceOf(Database);
});
it("db.query()", () => {
@@ -347,6 +350,13 @@ it("db.query()", () => {
),
).toBe(JSON.stringify([{ id: 1, name: "Hello" }]));
+ const domjit = db.query("SELECT * FROM test");
+ (function (domjit) {
+ for (let i = 0; i < 100000; i++) {
+ domjit.get().name;
+ }
+ })(domjit);
+
db.close();
// Check that a closed database doesn't crash
@@ -589,3 +599,11 @@ it("#3991", () => {
expect(x.id).toBe("foobar");
});
+
+it("#5872", () => {
+ const db = new Database(":memory:");
+ db.run("CREATE TABLE foo (id INTEGER PRIMARY KEY AUTOINCREMENT, greeting TEXT)");
+ const query = db.query("INSERT INTO foo (greeting) VALUES ($greeting);");
+ const result = query.all({ $greeting: "sup" });
+ expect(result).toEqual([]);
+});
diff --git a/test/js/bun/test/expect.test.js b/test/js/bun/test/expect.test.js
index 804a5339f..1b05c9802 100644
--- a/test/js/bun/test/expect.test.js
+++ b/test/js/bun/test/expect.test.js
@@ -640,6 +640,12 @@ describe("expect()", () => {
expect(g).not.toEqual(a);
});
+ test("deepEquals and typed arrays", () => {
+ expect(new Uint8Array([0, 255])).not.toEqual(new Uint8ClampedArray([0, 255]));
+ expect(new Int8Array([0, -1])).not.toEqual(new Uint8Array([0, 255]));
+ expect(new Float32Array([0])).not.toEqual(new Uint8Array([0, 0, 0, 0]));
+ });
+
test("deepEquals throw getters", () => {
let a = {
get x() {
@@ -971,11 +977,17 @@ describe("expect()", () => {
for (let [first, second] of equals) {
expect(first).toEqual(second);
expect(second).toEqual(first);
+
+ expect(first).toStrictEqual(second);
+ expect(second).toStrictEqual(first);
}
for (let [first, second] of not) {
expect(first).not.toEqual(second);
expect(second).not.toEqual(first);
+
+ expect(first).not.toStrictEqual(second);
+ expect(second).not.toStrictEqual(first);
}
expect(Object.fromEntries(Object.entries(new URL("https://example.com")))).not.toStrictEqual(
@@ -1298,6 +1310,16 @@ describe("expect()", () => {
a = { a: 1, b: 2, c: 3 };
b = { a: 1, b: 2 };
expect(a).not.toEqual(b);
+
+ array1 = [1, 2, 3];
+ expect(array1).toEqual(expect.arrayContaining([]));
+ expect(array1).toEqual(expect.arrayContaining([1, 2]));
+ expect(array1).not.toEqual(expect.arrayContaining([1, 2, 4]));
+
+ array2 = [{ a: 1, b: 2 }, { a: { a: 1 } }];
+ expect(array2).toEqual(expect.arrayContaining([{ a: 1, b: 2 }]));
+ expect(array2).toEqual(expect.arrayContaining([{ a: { a: 1 } }]));
+ expect(array2).not.toEqual(expect.arrayContaining([{ a: 2, b: 3 }]));
});
test("symbol based keys in arrays are processed correctly", () => {
@@ -2624,6 +2646,12 @@ describe("expect()", () => {
expect({ a: [1, 2, 3] }).toMatchObject({ a: [1, 2, 3] });
expect({ a: [1, 2, 4] }).not.toMatchObject({ a: [1, 2, 3] });
+ expect({ a: [1, 2, 3] }).toMatchObject({ a: expect.arrayContaining([1, 2]) });
+ expect({ a: [1, 2, 3] }).not.toMatchObject({ a: expect.arrayContaining([4]) });
+ expect({ a: ["hello", "world"] }).toMatchObject({ a: expect.arrayContaining([]) });
+ expect({ a: ["hello", "world"] }).toMatchObject({ a: expect.arrayContaining(["world"]) });
+ expect({ a: ["hello", "world"] }).not.toMatchObject({ a: expect.arrayContaining(["hello", "mars"]) });
+
expect([]).toMatchObject([]);
expect([]).toMatchObject({});
expect({}).not.toMatchObject([]);
@@ -3058,6 +3086,27 @@ describe("expect()", () => {
expect(Infinity).not.toBeWithin(-Infinity, Infinity);
});
+ test("toEqualIgnoringWhitespace()", () => {
+ expect("hello world").toEqualIgnoringWhitespace("hello world");
+ expect(" hello world ").toEqualIgnoringWhitespace("hello world");
+ expect(" h e l l o w o r l d ").toEqualIgnoringWhitespace("hello world");
+ expect(" hello\nworld ").toEqualIgnoringWhitespace("hello\nworld");
+ expect(`h
+ e
+ l
+ l
+ o`).toEqualIgnoringWhitespace("hello");
+ expect(`Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nec posuere felis. Aliquam tincidunt elit a nunc hendrerit maximus. Morbi semper tristique lectus, eget ullamcorper velit ullamcorper non. Aenean nibh augue, ultrices id ornare quis, eleifend id metus. Aliquam erat volutpat. Proin maximus, ligula at consequat venenatis, sapien odio auctor mi, sit amet placerat augue odio et orci. Vivamus tempus hendrerit tortor, et interdum est semper malesuada. Ut venenatis iaculis felis eget euismod. Suspendisse sed nisi eget massa fringilla rhoncus non quis enim. Mauris feugiat pellentesque justo, at sagittis augue sollicitudin vel. Pellentesque porttitor consequat mi nec varius. Praesent aliquet at justo nec finibus. Donec ut lorem eu ex dignissim pulvinar at sit amet sem. Ut fringilla sit amet dolor vitae convallis. Ut faucibus a purus sit amet fermentum.
+ Sed sit amet tortor magna. Pellentesque laoreet lorem at pulvinar efficitur. Nulla dictum nibh ac gravida semper. Duis tempus elit in ipsum feugiat porttitor.`).toEqualIgnoringWhitespace(
+ `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nec posuere felis. Aliquam tincidunt elit a nunc hendrerit maximus. Morbi semper tristique lectus, eget ullamcorper velit ullamcorper non. Aenean nibh augue, ultrices id ornare quis, eleifend id metus. Aliquam erat volutpat. Proin maximus, ligula at consequat venenatis, sapien odio auctor mi, sit amet placerat augue odio et orci. Vivamus tempus hendrerit tortor, et interdum est semper malesuada. Ut venenatis iaculis felis eget euismod. Suspendisse sed nisi eget massa fringilla rhoncus non quis enim. Mauris feugiat pellentesque justo, at sagittis augue sollicitudin vel. Pellentesque porttitor consequat mi nec varius. Praesent aliquet at justo nec finibus. Donec ut lorem eu ex dignissim pulvinar at sit amet sem. Ut fringilla sit amet dolor vitae convallis. Ut faucibus a purus sit amet fermentum. Sed sit amet tortor magna. Pellentesque laoreet lorem at pulvinar efficitur. Nulla dictum nibh ac gravida semper. Duis tempus elit in ipsum feugiat porttitor.`,
+ );
+
+ expect("hello world").not.toEqualIgnoringWhitespace("hello world!");
+ expect(() => {
+ expect({}).not.toEqualIgnoringWhitespace({});
+ }).toThrow();
+ });
+
test("toBeSymbol()", () => {
expect(Symbol()).toBeSymbol();
expect(Symbol("")).toBeSymbol();
diff --git a/test/js/bun/test/jest-extended.test.js b/test/js/bun/test/jest-extended.test.js
index 7e018d310..0b8174433 100644
--- a/test/js/bun/test/jest-extended.test.js
+++ b/test/js/bun/test/jest-extended.test.js
@@ -587,7 +587,26 @@ describe("jest-extended", () => {
});
// test("toIncludeMultiple()")
- // test("toEqualIgnoringWhitespace()")
+ test("toEqualIgnoringWhitespace()", () => {
+ expect("hello world").toEqualIgnoringWhitespace("hello world");
+ expect(" hello world ").toEqualIgnoringWhitespace("hello world");
+ expect(" h e l l o w o r l d ").toEqualIgnoringWhitespace("hello world");
+ expect(" hello\nworld ").toEqualIgnoringWhitespace("hello\nworld");
+ expect(`h
+ e
+ l
+ l
+ o`).toEqualIgnoringWhitespace("hello");
+ expect(`Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nec posuere felis. Aliquam tincidunt elit a nunc hendrerit maximus. Morbi semper tristique lectus, eget ullamcorper velit ullamcorper non. Aenean nibh augue, ultrices id ornare quis, eleifend id metus. Aliquam erat volutpat. Proin maximus, ligula at consequat venenatis, sapien odio auctor mi, sit amet placerat augue odio et orci. Vivamus tempus hendrerit tortor, et interdum est semper malesuada. Ut venenatis iaculis felis eget euismod. Suspendisse sed nisi eget massa fringilla rhoncus non quis enim. Mauris feugiat pellentesque justo, at sagittis augue sollicitudin vel. Pellentesque porttitor consequat mi nec varius. Praesent aliquet at justo nec finibus. Donec ut lorem eu ex dignissim pulvinar at sit amet sem. Ut fringilla sit amet dolor vitae convallis. Ut faucibus a purus sit amet fermentum.
+ Sed sit amet tortor magna. Pellentesque laoreet lorem at pulvinar efficitur. Nulla dictum nibh ac gravida semper. Duis tempus elit in ipsum feugiat porttitor.`).toEqualIgnoringWhitespace(
+ `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nec posuere felis. Aliquam tincidunt elit a nunc hendrerit maximus. Morbi semper tristique lectus, eget ullamcorper velit ullamcorper non. Aenean nibh augue, ultrices id ornare quis, eleifend id metus. Aliquam erat volutpat. Proin maximus, ligula at consequat venenatis, sapien odio auctor mi, sit amet placerat augue odio et orci. Vivamus tempus hendrerit tortor, et interdum est semper malesuada. Ut venenatis iaculis felis eget euismod. Suspendisse sed nisi eget massa fringilla rhoncus non quis enim. Mauris feugiat pellentesque justo, at sagittis augue sollicitudin vel. Pellentesque porttitor consequat mi nec varius. Praesent aliquet at justo nec finibus. Donec ut lorem eu ex dignissim pulvinar at sit amet sem. Ut fringilla sit amet dolor vitae convallis. Ut faucibus a purus sit amet fermentum. Sed sit amet tortor magna. Pellentesque laoreet lorem at pulvinar efficitur. Nulla dictum nibh ac gravida semper. Duis tempus elit in ipsum feugiat porttitor.`,
+ );
+
+ expect("hello world").not.toEqualIgnoringWhitespace("hello world!");
+ expect(() => {
+ expect({}).not.toEqualIgnoringWhitespace({});
+ }).toThrow("requires argument to be a string");
+ });
// Symbol
diff --git a/test/js/bun/util/inspect.test.js b/test/js/bun/util/inspect.test.js
index 32b3f2bfa..c2cfe11bf 100644
--- a/test/js/bun/util/inspect.test.js
+++ b/test/js/bun/util/inspect.test.js
@@ -55,21 +55,21 @@ it("Blob inspect", () => {
expect(Bun.inspect(new Response(new Blob()))).toBe(`Response (0 KB) {
ok: true,
url: "",
- headers: Headers {},
+ status: 200,
statusText: "",
+ headers: Headers {},
redirected: false,
bodyUsed: false,
- status: 200,
[Blob detached]
}`);
expect(Bun.inspect(new Response("Hello"))).toBe(`Response (5 bytes) {
ok: true,
url: "",
- headers: Headers {},
+ status: 200,
statusText: "",
+ headers: Headers {},
redirected: false,
bodyUsed: false,
- status: 200,
Blob (5 bytes)
}`);
});
diff --git a/test/js/bun/util/reportError.test.ts b/test/js/bun/util/reportError.test.ts
index 98b77d9c7..3a8837e89 100644
--- a/test/js/bun/util/reportError.test.ts
+++ b/test/js/bun/util/reportError.test.ts
@@ -2,7 +2,7 @@ import { test, expect } from "bun:test";
import { spawnSync } from "bun";
import { bunEnv, bunExe } from "harness";
-test("reportError", () => {
+test.skipIf(Bun.version.endsWith("debug"))("reportError", () => {
const cwd = import.meta.dir;
const { stderr } = spawnSync({
cmd: [bunExe(), new URL("./reportError.ts", import.meta.url).pathname],
diff --git a/test/js/first_party/ws/ws.test.ts b/test/js/first_party/ws/ws.test.ts
index fc8e63f5f..58d06c710 100644
--- a/test/js/first_party/ws/ws.test.ts
+++ b/test/js/first_party/ws/ws.test.ts
@@ -2,7 +2,7 @@ import { describe, it, expect, beforeEach, afterEach } from "bun:test";
import type { Subprocess } from "bun";
import { spawn } from "bun";
import { bunEnv, bunExe, nodeExe } from "harness";
-import { WebSocket } from "ws";
+import { WebSocket, WebSocketServer } from "ws";
const strings = [
{
@@ -239,6 +239,30 @@ describe("WebSocket", () => {
});
});
+it("isBinary", done => {
+ const wss = new WebSocketServer({ port: 0 });
+ let isDone = false;
+ wss.on("connection", ws => {
+ ws.on("message", (data, isBinary) => {
+ if (isDone) {
+ expect(isBinary).toBeTrue();
+ wss.close();
+ ws.close();
+ done();
+ return;
+ }
+ expect(isBinary).toBeFalse();
+ isDone = true;
+ });
+ });
+
+ const ws = new WebSocket("ws://localhost:" + wss.address().port);
+ ws.on("open", function open() {
+ ws.send("hello");
+ ws.send(Buffer.from([1, 2, 3]));
+ });
+});
+
function test(label: string, fn: (ws: WebSocket, done: (err?: unknown) => void) => void, timeout?: number) {
it(
label,
diff --git a/test/js/node/async_hooks/async_hooks.node.test.ts b/test/js/node/async_hooks/async_hooks.node.test.ts
index 3d6183948..5fc56a39b 100644
--- a/test/js/node/async_hooks/async_hooks.node.test.ts
+++ b/test/js/node/async_hooks/async_hooks.node.test.ts
@@ -1,13 +1,13 @@
-import { AsyncLocalStorage } from "async_hooks";
+import { AsyncLocalStorage, AsyncResource } from "async_hooks";
import assert from "assert";
test("node async_hooks.AsyncLocalStorage enable disable", async done => {
- const asyncLocalStorage = new AsyncLocalStorage();
+ const asyncLocalStorage = new AsyncLocalStorage<Map<string, any>>();
asyncLocalStorage.run(new Map(), () => {
- asyncLocalStorage.getStore().set("foo", "bar");
+ asyncLocalStorage.getStore()!.set("foo", "bar");
process.nextTick(() => {
- assert.strictEqual(asyncLocalStorage.getStore().get("foo"), "bar");
+ assert.strictEqual(asyncLocalStorage.getStore()!.get("foo"), "bar");
process.nextTick(() => {
assert.strictEqual(asyncLocalStorage.getStore(), undefined);
});
@@ -24,7 +24,7 @@ test("node async_hooks.AsyncLocalStorage enable disable", async done => {
process.nextTick(() => {
assert.strictEqual(asyncLocalStorage.getStore(), undefined);
asyncLocalStorage.run(new Map().set("bar", "foo"), () => {
- assert.strictEqual(asyncLocalStorage.getStore().get("bar"), "foo");
+ assert.strictEqual(asyncLocalStorage.getStore()!.get("bar"), "foo");
done();
});
@@ -32,3 +32,21 @@ test("node async_hooks.AsyncLocalStorage enable disable", async done => {
});
});
});
+
+test("AsyncResource.prototype.bind", () => {
+ const localStorage = new AsyncLocalStorage<true>();
+ let ar!: AsyncResource;
+ localStorage.run(true, () => {
+ ar = new AsyncResource("test");
+ });
+ expect(ar.bind(() => localStorage.getStore())()).toBe(true);
+});
+
+test("AsyncResource.bind", () => {
+ const localStorage = new AsyncLocalStorage<true>();
+ let fn!: () => true | undefined;
+ localStorage.run(true, () => {
+ fn = AsyncResource.bind(() => localStorage.getStore());
+ });
+ expect(fn()).toBe(true);
+});
diff --git a/test/js/node/buffer.test.js b/test/js/node/buffer.test.js
index afc9cdee8..0256934ce 100644
--- a/test/js/node/buffer.test.js
+++ b/test/js/node/buffer.test.js
@@ -2585,3 +2585,14 @@ it("construct buffer from hex, issue #4919", () => {
expect(buf1).toStrictEqual(Buffer.from([]));
expect(buf2).toStrictEqual(Buffer.from([0x63, 0xe9, 0xf6, 0xc4, 0xb0, 0x4f, 0xa8, 0xc8, 0x0f, 0x3f, 0xb0, 0xee]));
});
+
+it("new Buffer.alloc()", () => {
+ const buf = new Buffer.alloc(10);
+ expect(buf.length).toBe(10);
+ expect(buf[0]).toBe(0);
+});
+
+it("new Buffer.from()", () => {
+ const buf = new Buffer.from("🥶");
+ expect(buf.length).toBe(4);
+});
diff --git a/test/js/node/child_process/child_process.test.ts b/test/js/node/child_process/child_process.test.ts
index baf422bc9..8c24ef55e 100644
--- a/test/js/node/child_process/child_process.test.ts
+++ b/test/js/node/child_process/child_process.test.ts
@@ -2,6 +2,8 @@ import { describe, it, expect } from "bun:test";
import { ChildProcess, spawn, execFile, exec, fork, spawnSync, execFileSync, execSync } from "node:child_process";
import { tmpdir } from "node:os";
import { promisify } from "node:util";
+import { bunExe, bunEnv } from "harness";
+import path from "path";
const debug = process.env.DEBUG ? console.log : () => {};
@@ -308,3 +310,23 @@ describe("Bun.spawn()", () => {
// expect(child.pid).toBe(undefined);
// });
});
+
+it("should call close and exit before process exits", async () => {
+ const proc = Bun.spawn({
+ cmd: [bunExe(), path.join("fixtures", "child-process-exit-event.js")],
+ cwd: import.meta.dir,
+ env: bunEnv,
+ stdout: "pipe",
+ });
+ await proc.exited;
+ expect(proc.exitCode).toBe(0);
+ let data = "";
+ const reader = proc.stdout.getReader();
+ while (true) {
+ const { done, value } = await reader.read();
+ if (done) break;
+ data += new TextDecoder().decode(value);
+ }
+ expect(data).toContain("closeHandler called");
+ expect(data).toContain("exithHandler called");
+});
diff --git a/test/js/node/child_process/fixtures/child-process-exit-event.js b/test/js/node/child_process/fixtures/child-process-exit-event.js
new file mode 100644
index 000000000..4400ace1b
--- /dev/null
+++ b/test/js/node/child_process/fixtures/child-process-exit-event.js
@@ -0,0 +1,13 @@
+const { spawn } = require("node:child_process");
+
+function exitHandler() {
+ console.log("exithHandler called");
+}
+function closeHandler() {
+ console.log("closeHandler called");
+}
+
+const p = spawn("bun", ["--version"]);
+
+p.on("exit", exitHandler);
+p.on("close", closeHandler);
diff --git a/test/js/node/console/console.test.ts b/test/js/node/console/console.test.ts
new file mode 100644
index 000000000..4585f7cfb
--- /dev/null
+++ b/test/js/node/console/console.test.ts
@@ -0,0 +1,90 @@
+import { test, describe, expect } from "bun:test";
+import { Console } from "node:console";
+
+import { Writable } from "node:stream";
+
+function writable() {
+ let intoString = "";
+ const { promise, resolve } = Promise.withResolvers();
+ const stream = new Writable({
+ write(chunk) {
+ intoString += chunk.toString();
+ },
+ destroy() {
+ resolve(intoString);
+ },
+ autoDestroy: true,
+ });
+
+ (stream as any).write = (chunk: any) => {
+ intoString += Buffer.from(chunk).toString("utf-8");
+ };
+
+ return [stream, () => promise] as const;
+}
+
+describe("console.Console", () => {
+ test("global instanceof Console", () => {
+ expect(global.console).toBeInstanceOf(Console);
+ });
+
+ test("new Console instanceof Console", () => {
+ const c = new Console({ stdout: process.stdout, stderr: process.stderr });
+ expect(c).toBeInstanceOf(Console);
+ });
+
+ test("it can write to a stream", async () => {
+ console.log();
+ const [stream, value] = writable();
+ const c = new Console({ stdout: stream, stderr: stream, colorMode: false });
+ c.log("hello");
+ c.log({ foo: "bar" });
+ stream.end();
+ expect(await value()).toBe("hello\n{ foo: 'bar' }\n");
+ });
+
+ test("can enable colors", async () => {
+ const [stream, value] = writable();
+ const c = new Console({ stdout: stream, stderr: stream, colorMode: true });
+ c.log("hello");
+ c.log({ foo: "bar" });
+ stream.end();
+ expect(await value()).toBe("hello\n{ foo: \u001B[32m'bar'\u001B[39m }\n");
+ });
+
+ test("stderr and stdout are separate", async () => {
+ const [out, outValue] = writable();
+ const [err, errValue] = writable();
+ const c = new Console({ stdout: out, stderr: err });
+ c.log("hello world!");
+ c.error("uh oh!");
+ out.end();
+ err.end();
+ expect(await outValue()).toBe("hello world!\n");
+ expect(await errValue()).toBe("uh oh!\n");
+ });
+});
+
+test("console._stdout", () => {
+ // @ts-ignore
+ expect(console._stdout).toBe(process.stdout);
+
+ expect(Object.getOwnPropertyDescriptor(console, "_stdout")).toEqual({
+ value: process.stdout,
+ writable: true,
+ enumerable: false,
+ configurable: true,
+ });
+});
+
+test("console._stderr", () => {
+ // @ts-ignore
+ expect(console._stderr).toBe(process.stderr);
+
+ expect(Object.getOwnPropertyDescriptor(console, "_stderr")).toEqual({
+ value: process.stderr,
+ writable: true,
+ enumerable: false,
+ configurable: true,
+ });
+});
diff --git a/test/js/node/crypto/crypto.hmac.test.ts b/test/js/node/crypto/crypto.hmac.test.ts
new file mode 100644
index 000000000..6a54d1a82
--- /dev/null
+++ b/test/js/node/crypto/crypto.hmac.test.ts
@@ -0,0 +1,426 @@
+import { Hmac, createHmac, createSecretKey } from "crypto";
+import { test, expect, describe } from "bun:test";
+
+function testHmac(algo, key, data, expected) {
+ if (!Array.isArray(data)) data = [data];
+ // If the key is a Buffer, test Hmac with a key object as well.
+ const keyWrappers = [key => key, ...(typeof key === "string" ? [] : [createSecretKey])];
+ const wrapperName = ["default", "KeyObject"];
+
+ for (const i in keyWrappers) {
+ const keyWrapper = keyWrappers[i];
+ test(`Hmac ${algo} with ${wrapperName[i]} key`, async () => {
+ const hmac = createHmac(algo, keyWrapper(key));
+ for (const chunk of data) hmac.update(chunk);
+ const actual = hmac.digest("hex");
+ expect(actual).toEqual(expected);
+ });
+ }
+}
+
+describe("crypto.Hmac", () => {
+ test.todo("Hmac is expected to return a new instance", async () => {
+ const instance = Hmac("sha256", "Node");
+ expect(instance instanceof Hmac).toBe(true);
+ });
+
+ test("createHmac should throw when using invalid options", async () => {
+ expect(() => createHmac(null)).toThrow("null is not an object");
+ expect(() => createHmac("sha1", null)).toThrow("null is not an object");
+ });
+
+ describe("test HMAC with multiple updates.", async () => {
+ testHmac("sha1", "Node", ["some data", "to hmac"], "19fd6e1ba73d9ed2224dd5094a71babe85d9a892");
+ });
+
+ describe("test HMAC with Wikipidia test cases", async () => {
+ const wikipedia = [
+ {
+ key: "key",
+ data: "The quick brown fox jumps over the lazy dog",
+ hmac: {
+ // HMACs lifted from Wikipedia.
+ md5: "80070713463e7749b90c2dc24911e275",
+ sha1: "de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9",
+ sha256: "f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc" + "2d1a3cd8",
+ },
+ },
+ {
+ key: "key",
+ data: "",
+ hmac: {
+ // Intermediate test to help debugging.
+ md5: "63530468a04e386459855da0063b6596",
+ sha1: "f42bb0eeb018ebbd4597ae7213711ec60760843f",
+ sha256: "5d5d139563c95b5967b9bd9a8c9b233a9dedb45072794cd232dc1b74" + "832607d0",
+ },
+ },
+ {
+ key: "",
+ data: "The quick brown fox jumps over the lazy dog",
+ hmac: {
+ // Intermediate test to help debugging.
+ md5: "ad262969c53bc16032f160081c4a07a0",
+ sha1: "2ba7f707ad5f187c412de3106583c3111d668de8",
+ sha256: "fb011e6154a19b9a4c767373c305275a5a69e8b68b0b4c9200c383dc" + "ed19a416",
+ },
+ },
+ {
+ key: "",
+ data: "",
+ hmac: {
+ // HMACs lifted from Wikipedia.
+ md5: "74e6f7298a9c2d168935f58c001bad88",
+ sha1: "fbdb1d1b18aa6c08324b7d64b71fb76370690e1d",
+ sha256: "b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c71214" + "4292c5ad",
+ },
+ },
+ ];
+
+ for (const { key, data, hmac } of wikipedia) {
+ for (const hash in hmac) testHmac(hash, key, data, hmac[hash]);
+ }
+ });
+
+ describe("HMAC-SHA-* (rfc 4231 Test Cases)", async () => {
+ const rfc4231 = [
+ {
+ key: Buffer.from("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "hex"),
+ data: Buffer.from("4869205468657265", "hex"), // 'Hi There'
+ hmac: {
+ sha224: "896fb1128abbdf196832107cd49df33f47b4b1169912ba4f53684b22",
+ sha256: "b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c" + "2e32cff7",
+ sha384:
+ "afd03944d84895626b0825f4ab46907f15f9dadbe4101ec682aa034c" + "7cebc59cfaea9ea9076ede7f4af152e8b2fa9cb6",
+ sha512:
+ "87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b305" +
+ "45e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f170" +
+ "2e696c203a126854",
+ },
+ },
+ {
+ key: Buffer.from("4a656665", "hex"), // 'Jefe'
+ data: Buffer.from("7768617420646f2079612077616e7420666f72206e6f74686" + "96e673f", "hex"), // 'what do ya want for nothing?'
+ hmac: {
+ sha224: "a30e01098bc6dbbf45690f3a7e9e6d0f8bbea2a39e6148008fd05e44",
+ sha256: "5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b9" + "64ec3843",
+ sha384:
+ "af45d2e376484031617f78d2b58a6b1b9c7ef464f5a01b47e42ec373" + "6322445e8e2240ca5e69e2c78b3239ecfab21649",
+ sha512:
+ "164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7" +
+ "ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b" +
+ "636e070a38bce737",
+ },
+ },
+ {
+ key: Buffer.from("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "hex"),
+ data: Buffer.from(
+ "ddddddddddddddddddddddddddddddddddddddddddddddddd" + "ddddddddddddddddddddddddddddddddddddddddddddddddddd",
+ "hex",
+ ),
+ hmac: {
+ sha224: "7fb3cb3588c6c1f6ffa9694d7d6ad2649365b0c1f65d69d1ec8333ea",
+ sha256: "773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514" + "ced565fe",
+ sha384:
+ "88062608d3e6ad8a0aa2ace014c8a86f0aa635d947ac9febe83ef4e5" + "5966144b2a5ab39dc13814b94e3ab6e101a34f27",
+ sha512:
+ "fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33" +
+ "b2279d39bf3e848279a722c806b485a47e67c807b946a337bee89426" +
+ "74278859e13292fb",
+ },
+ },
+ {
+ key: Buffer.from("0102030405060708090a0b0c0d0e0f10111213141516171819", "hex"),
+ data: Buffer.from(
+ "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdc" + "dcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd",
+ "hex",
+ ),
+ hmac: {
+ sha224: "6c11506874013cac6a2abc1bb382627cec6a90d86efc012de7afec5a",
+ sha256: "82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff4" + "6729665b",
+ sha384:
+ "3e8a69b7783c25851933ab6290af6ca77a9981480850009cc5577c6e" + "1f573b4e6801dd23c4a7d679ccf8a386c674cffb",
+ sha512:
+ "b0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050" +
+ "361ee3dba91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2d" +
+ "e2adebeb10a298dd",
+ },
+ },
+
+ {
+ key: Buffer.from("0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c", "hex"),
+ // 'Test With Truncation'
+ data: Buffer.from("546573742057697468205472756e636174696f6e", "hex"),
+ hmac: {
+ sha224: "0e2aea68a90c8d37c988bcdb9fca6fa8",
+ sha256: "a3b6167473100ee06e0c796c2955552b",
+ sha384: "3abf34c3503b2a23a46efc619baef897",
+ sha512: "415fad6271580a531d4179bc891d87a6",
+ },
+ truncate: true,
+ },
+ {
+ key: Buffer.from(
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaa",
+ "hex",
+ ),
+ // 'Test Using Larger Than Block-Size Key - Hash Key First'
+ data: Buffer.from(
+ "54657374205573696e67204c6172676572205468616e20426" +
+ "c6f636b2d53697a65204b6579202d2048617368204b657920" +
+ "4669727374",
+ "hex",
+ ),
+ hmac: {
+ sha224: "95e9a0db962095adaebe9b2d6f0dbce2d499f112f2d2b7273fa6870e",
+ sha256: "60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f" + "0ee37f54",
+ sha384:
+ "4ece084485813e9088d2c63a041bc5b44f9ef1012a2b588f3cd11f05" + "033ac4c60c2ef6ab4030fe8296248df163f44952",
+ sha512:
+ "80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b0137" +
+ "83f8f3526b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec" +
+ "8b915a985d786598",
+ },
+ },
+ {
+ key: Buffer.from(
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaa",
+ "hex",
+ ),
+ // 'This is a test using a larger than block-size key and a larger ' +
+ // 'than block-size data. The key needs to be hashed before being ' +
+ // 'used by the HMAC algorithm.'
+ data: Buffer.from(
+ "5468697320697320612074657374207573696e672061206c6" +
+ "172676572207468616e20626c6f636b2d73697a65206b6579" +
+ "20616e642061206c6172676572207468616e20626c6f636b2" +
+ "d73697a6520646174612e20546865206b6579206e65656473" +
+ "20746f20626520686173686564206265666f7265206265696" +
+ "e6720757365642062792074686520484d414320616c676f72" +
+ "6974686d2e",
+ "hex",
+ ),
+ hmac: {
+ sha224: "3a854166ac5d9f023f54d517d0b39dbd946770db9c2b95c9f6f565d1",
+ sha256: "9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f5153" + "5c3a35e2",
+ sha384:
+ "6617178e941f020d351e2f254e8fd32c602420feb0b8fb9adccebb82" + "461e99c5a678cc31e799176d3860e6110c46523e",
+ sha512:
+ "e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d" +
+ "20cdc944b6022cac3c4982b10d5eeb55c3e4de15134676fb6de04460" +
+ "65c97440fa8c6a58",
+ },
+ },
+ ];
+
+ for (let i = 0, l = rfc4231.length; i < l; i++) {
+ for (const hash in rfc4231[i].hmac) {
+ test(`Test HMAC-${hash} rfc 4231 case ${i + 1}`, async () => {
+ const str = createHmac(hash, rfc4231[i].key);
+ str.end(rfc4231[i].data);
+ let strRes = str.read().toString("hex");
+ let actual = createHmac(hash, rfc4231[i].key).update(rfc4231[i].data).digest("hex");
+ if (rfc4231[i].truncate) {
+ actual = actual.substr(0, 32); // first 128 bits == 32 hex chars
+ strRes = strRes.substr(0, 32);
+ }
+ const expected = rfc4231[i].hmac[hash];
+ // `Test HMAC-${hash} rfc 4231 case ${i + 1}: ${actual} must be ${expected}`);
+ expect(actual).toEqual(expected);
+ expect(actual).toEqual(strRes);
+ });
+ }
+ }
+ });
+
+ describe("HMAC-MD5/SHA1 (rfc 2202 Test Cases)", async () => {
+ const rfc2202_md5 = [
+ {
+ key: Buffer.from("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "hex"),
+ data: "Hi There",
+ hmac: "9294727a3638bb1c13f48ef8158bfc9d",
+ },
+ {
+ key: "Jefe",
+ data: "what do ya want for nothing?",
+ hmac: "750c783e6ab0b503eaa86e310a5db738",
+ },
+ {
+ key: Buffer.from("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "hex"),
+ data: Buffer.from(
+ "ddddddddddddddddddddddddddddddddddddddddddddddddd" + "ddddddddddddddddddddddddddddddddddddddddddddddddddd",
+ "hex",
+ ),
+ hmac: "56be34521d144c88dbb8c733f0e8b3f6",
+ },
+ {
+ key: Buffer.from("0102030405060708090a0b0c0d0e0f10111213141516171819", "hex"),
+ data: Buffer.from(
+ "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdc" +
+ "dcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd" +
+ "cdcdcdcdcd",
+ "hex",
+ ),
+ hmac: "697eaf0aca3a3aea3a75164746ffaa79",
+ },
+ {
+ key: Buffer.from("0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c", "hex"),
+ data: "Test With Truncation",
+ hmac: "56461ef2342edc00f9bab995690efd4c",
+ },
+ {
+ key: Buffer.from(
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaa",
+ "hex",
+ ),
+ data: "Test Using Larger Than Block-Size Key - Hash Key First",
+ hmac: "6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd",
+ },
+ {
+ key: Buffer.from(
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaa",
+ "hex",
+ ),
+ data: "Test Using Larger Than Block-Size Key and Larger Than One " + "Block-Size Data",
+ hmac: "6f630fad67cda0ee1fb1f562db3aa53e",
+ },
+ ];
+
+ for (const { key, data, hmac } of rfc2202_md5) {
+ describe(`rfc 2202 md5 case ${hmac}`, async () => {
+ testHmac("md5", key, data, hmac);
+ });
+ }
+
+ const rfc2202_sha1 = [
+ {
+ key: Buffer.from("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "hex"),
+ data: "Hi There",
+ hmac: "b617318655057264e28bc0b6fb378c8ef146be00",
+ },
+ {
+ key: "Jefe",
+ data: "what do ya want for nothing?",
+ hmac: "effcdf6ae5eb2fa2d27416d5f184df9c259a7c79",
+ },
+ {
+ key: Buffer.from("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "hex"),
+ data: Buffer.from(
+ "ddddddddddddddddddddddddddddddddddddddddddddd" +
+ "ddddddddddddddddddddddddddddddddddddddddddddd" +
+ "dddddddddd",
+ "hex",
+ ),
+ hmac: "125d7342b9ac11cd91a39af48aa17b4f63f175d3",
+ },
+ {
+ key: Buffer.from("0102030405060708090a0b0c0d0e0f10111213141516171819", "hex"),
+ data: Buffer.from(
+ "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdc" +
+ "dcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd" +
+ "cdcdcdcdcd",
+ "hex",
+ ),
+ hmac: "4c9007f4026250c6bc8414f9bf50c86c2d7235da",
+ },
+ {
+ key: Buffer.from("0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c", "hex"),
+ data: "Test With Truncation",
+ hmac: "4c1a03424b55e07fe7f27be1d58bb9324a9a5a04",
+ },
+ {
+ key: Buffer.from(
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaa",
+ "hex",
+ ),
+ data: "Test Using Larger Than Block-Size Key - Hash Key First",
+ hmac: "aa4ae5e15272d00e95705637ce8a3b55ed402112",
+ },
+ {
+ key: Buffer.from(
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
+ "aaaaaaaaaaaaaaaaaaaaaa",
+ "hex",
+ ),
+ data: "Test Using Larger Than Block-Size Key and Larger Than One " + "Block-Size Data",
+ hmac: "e8e99d0f45237d786d6bbaa7965c7808bbff1a91",
+ },
+ ];
+
+ for (const { key, data, hmac } of rfc2202_sha1) {
+ describe(`rfc 2202 sha1 case ${hmac}`, async () => {
+ testHmac("sha1", key, data, hmac);
+ });
+ }
+ });
+
+ test("sha256 w00t ucs2", async () => {
+ expect(createHmac("sha256", "w00t").digest("ucs2")).toEqual(createHmac("sha256", "w00t").digest().toString("ucs2"));
+ });
+
+ test("Check initialized -> uninitialized state transition after calling digest().", async () => {
+ {
+ const expected =
+ "\u0010\u0041\u0052\u00c5\u00bf\u00dc\u00a0\u007b\u00c6\u0033" +
+ "\u00ee\u00bd\u0046\u0019\u009f\u0002\u0055\u00c9\u00f4\u009d";
+
+ {
+ const h = createHmac("sha1", "key").update("data");
+ expect(h.digest("latin1")).toBe(expected);
+ expect(h.digest("latin1")).toBe("");
+ }
+ {
+ const h = createHmac("sha1", "key").update("data");
+ expect(h.digest("buffer")).toEqual(Buffer.from(expected, "latin1"));
+ expect(h.digest("buffer")).toEqual(Buffer.from(""));
+ }
+ }
+ {
+ const expected =
+ "\u00f4\u002b\u00b0\u00ee\u00b0\u0018\u00eb\u00bd\u0045\u0097" +
+ "\u00ae\u0072\u0013\u0071\u001e\u00c6\u0007\u0060\u0084\u003f";
+ {
+ const h = createHmac("sha1", "key");
+ expect(h.digest("latin1")).toBe(expected);
+ expect(h.digest("latin1")).toBe("");
+ }
+ {
+ const h = createHmac("sha1", "key");
+ expect(h.digest("buffer")).toEqual(Buffer.from(expected, "latin1"));
+ expect(h.digest("buffer")).toEqual(Buffer.from(""));
+ }
+ }
+ });
+ test("Invalid digest", async () => {
+ expect(() => createHmac("sha7", "key")).toThrow(/sha7 is not supported/);
+ });
+
+ test("secret digest", async () => {
+ const buf = Buffer.alloc(0);
+ const keyObject = createSecretKey(Buffer.alloc(0));
+ expect(createHmac("sha256", buf).update("foo").digest()).toEqual(
+ createHmac("sha256", keyObject).update("foo").digest(),
+ );
+ });
+});
diff --git a/test/js/node/crypto/crypto.key-objects.test.ts b/test/js/node/crypto/crypto.key-objects.test.ts
new file mode 100644
index 000000000..b124ca479
--- /dev/null
+++ b/test/js/node/crypto/crypto.key-objects.test.ts
@@ -0,0 +1,1643 @@
+"use strict";
+
+import {
+ createCipheriv,
+ createDecipheriv,
+ createSign,
+ createVerify,
+ createSecretKey,
+ createPublicKey,
+ createPrivateKey,
+ KeyObject,
+ randomBytes,
+ publicDecrypt,
+ publicEncrypt,
+ privateDecrypt,
+ privateEncrypt,
+ generateKeyPairSync,
+ generateKeySync,
+ generateKeyPair,
+ sign,
+ verify,
+ generateKey,
+} from "crypto";
+import { test, it, expect, describe } from "bun:test";
+import { createContext, Script } from "node:vm";
+import fs from "fs";
+import path from "path";
+
+const publicPem = fs.readFileSync(path.join(import.meta.dir, "fixtures", "rsa_public.pem"), "ascii");
+const privatePem = fs.readFileSync(path.join(import.meta.dir, "fixtures", "rsa_private.pem"), "ascii");
+const privateEncryptedPem = fs.readFileSync(
+ path.join(import.meta.dir, "fixtures", "rsa_private_encrypted.pem"),
+ "ascii",
+);
+
+// Constructs a regular expression for a PEM-encoded key with the given label.
+function getRegExpForPEM(label: string, cipher?: string) {
+ const head = `\\-\\-\\-\\-\\-BEGIN ${label}\\-\\-\\-\\-\\-`;
+ const rfc1421Header = cipher == null ? "" : `\nProc-Type: 4,ENCRYPTED\nDEK-Info: ${cipher},[^\n]+\n`;
+ const body = "([a-zA-Z0-9\\+/=]{64}\n)*[a-zA-Z0-9\\+/=]{1,64}";
+ const end = `\\-\\-\\-\\-\\-END ${label}\\-\\-\\-\\-\\-`;
+ return new RegExp(`^${head}${rfc1421Header}\n${body}\n${end}\n$`);
+}
+const pkcs1PubExp = getRegExpForPEM("RSA PUBLIC KEY");
+const pkcs1PrivExp = getRegExpForPEM("RSA PRIVATE KEY");
+const pkcs1EncExp = (cipher: string) => getRegExpForPEM("RSA PRIVATE KEY", cipher);
+const spkiExp = getRegExpForPEM("PUBLIC KEY");
+const pkcs8Exp = getRegExpForPEM("PRIVATE KEY");
+const pkcs8EncExp = getRegExpForPEM("ENCRYPTED PRIVATE KEY");
+const sec1Exp = getRegExpForPEM("EC PRIVATE KEY");
+const sec1EncExp = (cipher: string) => getRegExpForPEM("EC PRIVATE KEY", cipher);
+
+// Asserts that the size of the given key (in chars or bytes) is within 10% of
+// the expected size.
+function assertApproximateSize(key: any, expectedSize: number) {
+ const min = Math.floor(0.9 * expectedSize);
+ const max = Math.ceil(1.1 * expectedSize);
+ expect(key.length).toBeGreaterThanOrEqual(min);
+ expect(key.length).toBeLessThanOrEqual(max);
+}
+// Tests that a key pair can be used for encryption / decryption.
+function testEncryptDecrypt(publicKey: any, privateKey: any) {
+ const message = "Hello Node.js world!";
+ const plaintext = Buffer.from(message, "utf8");
+ for (const key of [publicKey, privateKey]) {
+ const ciphertext = publicEncrypt(key, plaintext);
+ const received = privateDecrypt(privateKey, ciphertext);
+ expect(received.toString("utf8")).toEqual(message);
+ }
+}
+
+// Tests that a key pair can be used for signing / verification.
+function testSignVerify(publicKey: any, privateKey: any) {
+ const message = Buffer.from("Hello Node.js world!");
+
+ function oldSign(algo: string, data: string | Buffer, key: any) {
+ return createSign(algo).update(data).sign(key);
+ }
+
+ function oldVerify(algo: string, data: string | Buffer, key: any, signature: any) {
+ return createVerify(algo).update(data).verify(key, signature);
+ }
+
+ for (const signFn of [sign, oldSign]) {
+ const signature = signFn("SHA256", message, privateKey);
+ for (const verifyFn of [verify, oldVerify]) {
+ for (const key of [publicKey, privateKey]) {
+ const okay = verifyFn("SHA256", message, key, signature);
+ expect(okay).toBeTrue();
+ }
+ }
+ }
+}
+
+describe("crypto.KeyObjects", () => {
+ test("Attempting to create a key using other than CryptoKey should throw", async () => {
+ expect(() => new KeyObject("secret", "")).toThrow();
+ expect(() => new KeyObject("secret")).toThrow();
+ expect(() => KeyObject.from("invalid_key")).toThrow();
+ });
+ test("basics of createSecretKey should work", async () => {
+ const keybuf = randomBytes(32);
+ const key = createSecretKey(keybuf);
+ expect(key.type).toBe("secret");
+ expect(key.toString()).toBe("[object KeyObject]");
+ expect(key.symmetricKeySize).toBe(32);
+ expect(key.asymmetricKeyType).toBe(undefined);
+ expect(key.asymmetricKeyDetails).toBe(undefined);
+
+ const exportedKey = key.export();
+ expect(keybuf).toEqual(exportedKey);
+
+ const plaintext = Buffer.from("Hello world", "utf8");
+
+ const cipher = createCipheriv("aes-256-ecb", key, null);
+ const ciphertext = Buffer.concat([cipher.update(plaintext), cipher.final()]);
+
+ const decipher = createDecipheriv("aes-256-ecb", key, null);
+ const deciphered = Buffer.concat([decipher.update(ciphertext), decipher.final()]);
+
+ expect(plaintext).toEqual(deciphered);
+ });
+
+ test("Passing an existing public key object to createPublicKey should throw", async () => {
+ // Passing an existing public key object to createPublicKey should throw.
+ const publicKey = createPublicKey(publicPem);
+ expect(() => createPublicKey(publicKey)).toThrow();
+
+ // Constructing a private key from a public key should be impossible, even
+ // if the public key was derived from a private key.
+ expect(() => createPrivateKey(createPublicKey(privatePem))).toThrow();
+
+ // Similarly, passing an existing private key object to createPrivateKey
+ // should throw.
+ const privateKey = createPrivateKey(privatePem);
+ expect(() => createPrivateKey(privateKey)).toThrow();
+ });
+
+ test("basics should work", async () => {
+ const jwk = {
+ e: "AQAB",
+ n:
+ "t9xYiIonscC3vz_A2ceR7KhZZlDu_5bye53nCVTcKnWd2seY6UAdKersX6njr83Dd5OVe" +
+ "1BW_wJvp5EjWTAGYbFswlNmeD44edEGM939B6Lq-_8iBkrTi8mGN4YCytivE24YI0D4XZ" +
+ "MPfkLSpab2y_Hy4DjQKBq1ThZ0UBnK-9IhX37Ju_ZoGYSlTIGIhzyaiYBh7wrZBoPczIE" +
+ "u6et_kN2VnnbRUtkYTF97ggcv5h-hDpUQjQW0ZgOMcTc8n-RkGpIt0_iM_bTjI3Tz_gsF" +
+ "di6hHcpZgbopPL630296iByyigQCPJVzdusFrQN5DeC-zT_nGypQkZanLb4ZspSx9Q",
+ d:
+ "ktnq2LvIMqBj4txP82IEOorIRQGVsw1khbm8A-cEpuEkgM71Yi_0WzupKktucUeevQ5i0" +
+ "Yh8w9e1SJiTLDRAlJz66kdky9uejiWWl6zR4dyNZVMFYRM43ijLC-P8rPne9Fz16IqHFW" +
+ "5VbJqA1xCBhKmuPMsD71RNxZ4Hrsa7Kt_xglQTYsLbdGIwDmcZihId9VGXRzvmCPsDRf2" +
+ "fCkAj7HDeRxpUdEiEDpajADc-PWikra3r3b40tVHKWm8wxJLivOIN7GiYXKQIW6RhZgH-" +
+ "Rk45JIRNKxNagxdeXUqqyhnwhbTo1Hite0iBDexN9tgoZk0XmdYWBn6ElXHRZ7VCDQ",
+ p:
+ "8UovlB4nrBm7xH-u7XXBMbqxADQm5vaEZxw9eluc-tP7cIAI4sglMIvL_FMpbd2pEeP_B" +
+ "kR76NTDzzDuPAZvUGRavgEjy0O9j2NAs_WPK4tZF-vFdunhnSh4EHAF4Ij9kbsUi90NOp" +
+ "bGfVqPdOaHqzgHKoR23Cuusk9wFQ2XTV8",
+ q:
+ "wxHdEYT9xrpfrHPqSBQPpO0dWGKJEkrWOb-76rSfuL8wGR4OBNmQdhLuU9zTIh22pog-X" +
+ "PnLPAecC-4yu_wtJ2SPCKiKDbJBre0CKPyRfGqzvA3njXwMxXazU4kGs-2Fg-xu_iKbaI" +
+ "jxXrclBLhkxhBtySrwAFhxxOk6fFcPLSs",
+ dp:
+ "qS_Mdr5CMRGGMH0bKhPUWEtAixUGZhJaunX5wY71Xoc_Gh4cnO-b7BNJ_-5L8WZog0vr" +
+ "6PgiLhrqBaCYm2wjpyoG2o2wDHm-NAlzN_wp3G2EFhrSxdOux-S1c0kpRcyoiAO2n29rN" +
+ "Da-jOzwBBcU8ACEPdLOCQl0IEFFJO33tl8",
+ dq:
+ "WAziKpxLKL7LnL4dzDcx8JIPIuwnTxh0plCDdCffyLaT8WJ9lXbXHFTjOvt8WfPrlDP_" +
+ "Ylxmfkw5BbGZOP1VLGjZn2DkH9aMiwNmbDXFPdG0G3hzQovx_9fajiRV4DWghLHeT9wzJ" +
+ "fZabRRiI0VQR472300AVEeX4vgbrDBn600",
+ qi:
+ "k7czBCT9rHn_PNwCa17hlTy88C4vXkwbz83Oa-aX5L4e5gw5lhcR2ZuZHLb2r6oMt9rl" +
+ "D7EIDItSs-u21LOXWPTAlazdnpYUyw_CzogM_PN-qNwMRXn5uXFFhmlP2mVg2EdELTahX" +
+ "ch8kWqHaCSX53yvqCtRKu_j76V31TfQZGM",
+ kty: "RSA",
+ };
+ const publicJwk = { kty: jwk.kty, e: jwk.e, n: jwk.n };
+
+ const publicKey = createPublicKey(publicPem);
+ expect(publicKey.type).toBe("public");
+ expect(publicKey.toString()).toBe("[object KeyObject]");
+ expect(publicKey.asymmetricKeyType).toBe("rsa");
+ expect(publicKey.symmetricKeySize).toBe(undefined);
+
+ const privateKey = createPrivateKey(privatePem);
+ expect(privateKey.type).toBe("private");
+ expect(privateKey.toString()).toBe("[object KeyObject]");
+ expect(privateKey.asymmetricKeyType).toBe("rsa");
+ expect(privateKey.symmetricKeySize).toBe(undefined);
+
+ // It should be possible to derive a public key from a private key.
+ const derivedPublicKey = createPublicKey(privateKey);
+ expect(derivedPublicKey.type).toBe("public");
+ expect(derivedPublicKey.toString()).toBe("[object KeyObject]");
+ expect(derivedPublicKey.asymmetricKeyType).toBe("rsa");
+ expect(derivedPublicKey.symmetricKeySize).toBe(undefined);
+
+ const publicKeyFromJwk = createPublicKey({ key: publicJwk, format: "jwk" });
+ expect(publicKey.type).toBe("public");
+ expect(publicKey.toString()).toBe("[object KeyObject]");
+ expect(publicKey.asymmetricKeyType).toBe("rsa");
+ expect(publicKey.symmetricKeySize).toBe(undefined);
+
+ const privateKeyFromJwk = createPrivateKey({ key: jwk, format: "jwk" });
+ expect(privateKey.type).toBe("private");
+ expect(privateKey.toString()).toBe("[object KeyObject]");
+ expect(privateKey.asymmetricKeyType).toBe("rsa");
+ expect(privateKey.symmetricKeySize).toBe(undefined);
+
+ // It should also be possible to import an encrypted private key as a public
+ // key.
+ const decryptedKey = createPublicKey({
+ key: privateKey.export({
+ type: "pkcs8",
+ format: "pem",
+ passphrase: Buffer.from("123"),
+ cipher: "aes-128-cbc",
+ }),
+ format: "pem",
+ passphrase: "123", // this is not documented, but it works
+ });
+ expect(decryptedKey.type).toBe("public");
+ expect(decryptedKey.asymmetricKeyType).toBe("rsa");
+
+ // Exporting the key using JWK should not work since this format does not
+ // support key encryption
+ expect(() => {
+ privateKey.export({ format: "jwk", passphrase: "secret" });
+ }).toThrow();
+
+ // Test exporting with an invalid options object, this should throw.
+ for (const opt of [undefined, null, "foo", 0, NaN]) {
+ expect(() => publicKey.export(opt)).toThrow();
+ }
+
+ for (const keyObject of [publicKey, derivedPublicKey, publicKeyFromJwk]) {
+ const exported = keyObject.export({ format: "jwk" });
+ expect(exported).toBeDefined();
+ const { kty, n, e } = exported as { kty: string; n: string; e: string };
+ expect({ kty, n, e }).toEqual({ kty: "RSA", n: jwk.n, e: jwk.e });
+ }
+
+ for (const keyObject of [privateKey, privateKeyFromJwk]) {
+ const exported = keyObject.export({ format: "jwk" });
+ expect(exported).toEqual(jwk);
+ }
+
+ const publicDER = publicKey.export({
+ format: "der",
+ type: "pkcs1",
+ });
+
+ const privateDER = privateKey.export({
+ format: "der",
+ type: "pkcs1",
+ });
+
+ expect(Buffer.isBuffer(publicDER)).toBe(true);
+ expect(Buffer.isBuffer(privateDER)).toBe(true);
+ const plaintext = Buffer.from("Hello world", "utf8");
+
+ const testDecryption = (fn, ciphertexts, decryptionKeys) => {
+ for (const ciphertext of ciphertexts) {
+ for (const key of decryptionKeys) {
+ const deciphered = fn(key, ciphertext);
+ expect(deciphered).toEqual(plaintext);
+ }
+ }
+ };
+
+ testDecryption(
+ privateDecrypt,
+ [
+ // Encrypt using the public key.
+ publicEncrypt(publicKey, plaintext),
+ publicEncrypt({ key: publicKey }, plaintext),
+ publicEncrypt({ key: publicJwk, format: "jwk" }, plaintext),
+
+ // Encrypt using the private key.
+ publicEncrypt(privateKey, plaintext),
+ publicEncrypt({ key: privateKey }, plaintext),
+ publicEncrypt({ key: jwk, format: "jwk" }, plaintext),
+
+ // Encrypt using a public key derived from the private key.
+ publicEncrypt(derivedPublicKey, plaintext),
+ publicEncrypt({ key: derivedPublicKey }, plaintext),
+
+ // Test distinguishing PKCS#1 public and private keys based on the
+ // DER-encoded data only.
+ publicEncrypt({ format: "der", type: "pkcs1", key: publicDER }, plaintext),
+ publicEncrypt({ format: "der", type: "pkcs1", key: privateDER }, plaintext),
+ ],
+ [
+ privateKey,
+ { format: "pem", key: privatePem },
+ { format: "der", type: "pkcs1", key: privateDER },
+ { key: jwk, format: "jwk" },
+ ],
+ );
+
+ testDecryption(
+ publicDecrypt,
+ [privateEncrypt(privateKey, plaintext)],
+ [
+ // Decrypt using the public key.
+ publicKey,
+ { format: "pem", key: publicPem },
+ { format: "der", type: "pkcs1", key: publicDER },
+ { key: publicJwk, format: "jwk" },
+
+ // Decrypt using the private key.
+ privateKey,
+ { format: "pem", key: privatePem },
+ { format: "der", type: "pkcs1", key: privateDER },
+ { key: jwk, format: "jwk" },
+ ],
+ );
+ });
+
+ test("This should not cause a crash: https://github.com/nodejs/node/issues/25247", async () => {
+ expect(() => createPrivateKey({ key: "" })).toThrow();
+ });
+ test("This should not abort either: https://github.com/nodejs/node/issues/29904", async () => {
+ expect(() => createPrivateKey({ key: Buffer.alloc(0), format: "der", type: "spki" })).toThrow();
+ });
+
+ test("BoringSSL will not parse PKCS#1", async () => {
+ // Unlike SPKI, PKCS#1 is a valid encoding for private keys (and public keys),
+ // so it should be accepted by createPrivateKey, but OpenSSL won't parse it.
+ expect(() => {
+ const key = createPublicKey(publicPem).export({
+ format: "der",
+ type: "pkcs1",
+ });
+ createPrivateKey({ key, format: "der", type: "pkcs1" });
+ }).toThrow("Invalid use of PKCS#1 as private key");
+ });
+
+ [
+ {
+ private: fs.readFileSync(path.join(import.meta.dir, "fixtures", "ed25519_private.pem"), "ascii"),
+ public: fs.readFileSync(path.join(import.meta.dir, "fixtures", "ed25519_public.pem"), "ascii"),
+ keyType: "ed25519",
+ jwk: {
+ crv: "Ed25519",
+ x: "K1wIouqnuiA04b3WrMa-xKIKIpfHetNZRv3h9fBf768",
+ d: "wVK6M3SMhQh3NK-7GRrSV-BVWQx1FO5pW8hhQeu_NdA",
+ kty: "OKP",
+ },
+ },
+ {
+ private: fs.readFileSync(path.join(import.meta.dir, "fixtures", "ed448_private.pem"), "ascii"),
+ public: fs.readFileSync(path.join(import.meta.dir, "fixtures", "ed448_public.pem"), "ascii"),
+ keyType: "ed448",
+ jwk: {
+ crv: "Ed448",
+ x: "oX_ee5-jlcU53-BbGRsGIzly0V-SZtJ_oGXY0udf84q2hTW2RdstLktvwpkVJOoNb7o" + "Dgc2V5ZUA",
+ d: "060Ke71sN0GpIc01nnGgMDkp0sFNQ09woVo4AM1ffax1-mjnakK0-p-S7-Xf859QewX" + "jcR9mxppY",
+ kty: "OKP",
+ },
+ },
+ {
+ private: fs.readFileSync(path.join(import.meta.dir, "fixtures", "x25519_private.pem"), "ascii"),
+ public: fs.readFileSync(path.join(import.meta.dir, "fixtures", "x25519_public.pem"), "ascii"),
+ keyType: "x25519",
+ jwk: {
+ crv: "X25519",
+ x: "aSb8Q-RndwfNnPeOYGYPDUN3uhAPnMLzXyfi-mqfhig",
+ d: "mL_IWm55RrALUGRfJYzw40gEYWMvtRkesP9mj8o8Omc",
+ kty: "OKP",
+ },
+ },
+ {
+ private: fs.readFileSync(path.join(import.meta.dir, "fixtures", "x448_private.pem"), "ascii"),
+ public: fs.readFileSync(path.join(import.meta.dir, "fixtures", "x448_public.pem"), "ascii"),
+ keyType: "x448",
+ jwk: {
+ crv: "X448",
+ x: "ioHSHVpTs6hMvghosEJDIR7ceFiE3-Xccxati64oOVJ7NWjfozE7ae31PXIUFq6cVYg" + "vSKsDFPA",
+ d: "tMNtrO_q8dlY6Y4NDeSTxNQ5CACkHiPvmukidPnNIuX_EkcryLEXt_7i6j6YZMKsrWy" + "S0jlSYJk",
+ kty: "OKP",
+ },
+ },
+ ].forEach(info => {
+ const keyType = info.keyType;
+ // X25519 implementation is incomplete, Ed448 and X448 are not supported yet
+ const test = keyType === "ed25519" ? it : it.skip;
+ let privateKey: KeyObject;
+ test(`${keyType} from Buffer should work`, async () => {
+ const key = createPrivateKey(info.private);
+ privateKey = key;
+ expect(key.type).toBe("private");
+ expect(key.asymmetricKeyType).toBe(keyType);
+ expect(key.symmetricKeySize).toBe(undefined);
+ expect(key.export({ type: "pkcs8", format: "pem" })).toEqual(info.private);
+ const jwt = key.export({ format: "jwk" });
+ expect(jwt).toEqual(info.jwk);
+ });
+
+ test(`${keyType} createPrivateKey from jwk should work`, async () => {
+ const key = createPrivateKey({ key: info.jwk, format: "jwk" });
+ expect(key.type).toBe("private");
+ expect(key.asymmetricKeyType).toBe(keyType);
+ expect(key.symmetricKeySize).toBe(undefined);
+ expect(key.export({ type: "pkcs8", format: "pem" })).toEqual(info.private);
+ const jwt = key.export({ format: "jwk" });
+ expect(jwt).toEqual(info.jwk);
+ });
+
+ [
+ ["public", info.public],
+ ["private", info.private],
+ ["jwk", { key: info.jwk, format: "jwk" }],
+ ].forEach(([name, input]) => {
+ test(`${keyType} createPublicKey using ${name} key should work`, async () => {
+ const key = createPublicKey(input);
+ expect(key.type).toBe("public");
+ expect(key.asymmetricKeyType).toBe(keyType);
+ expect(key.symmetricKeySize).toBe(undefined);
+ if (name == "public") {
+ expect(key.export({ type: "spki", format: "pem" })).toEqual(info.public);
+ }
+ if (name == "jwk") {
+ const jwt = { ...info.jwk };
+ delete jwt.d;
+ const jwk_exported = key.export({ format: "jwk" });
+ expect(jwk_exported).toEqual(jwt);
+ }
+ });
+ });
+ });
+
+ [
+ {
+ private: fs.readFileSync(path.join(import.meta.dir, "fixtures", "ec_p256_private.pem"), "ascii"),
+ public: fs.readFileSync(path.join(import.meta.dir, "fixtures", "ec_p256_public.pem"), "ascii"),
+ keyType: "ec",
+ namedCurve: "prime256v1",
+ jwk: {
+ crv: "P-256",
+ d: "DxBsPQPIgMuMyQbxzbb9toew6Ev6e9O6ZhpxLNgmAEo",
+ kty: "EC",
+ x: "X0mMYR_uleZSIPjNztIkAS3_ud5LhNpbiIFp6fNf2Gs",
+ y: "UbJuPy2Xi0lW7UYTBxPK3yGgDu9EAKYIecjkHX5s2lI",
+ },
+ },
+ {
+ private: fs.readFileSync(path.join(import.meta.dir, "fixtures", "ec_secp256k1_private.pem"), "ascii"),
+ public: fs.readFileSync(path.join(import.meta.dir, "fixtures", "ec_secp256k1_public.pem"), "ascii"),
+ keyType: "ec",
+ namedCurve: "secp256k1",
+ jwk: {
+ crv: "secp256k1",
+ d: "c34ocwTwpFa9NZZh3l88qXyrkoYSxvC0FEsU5v1v4IM",
+ kty: "EC",
+ x: "cOzhFSpWxhalCbWNdP2H_yUkdC81C9T2deDpfxK7owA",
+ y: "-A3DAZTk9IPppN-f03JydgHaFvL1fAHaoXf4SX4NXyo",
+ },
+ },
+ {
+ private: fs.readFileSync(path.join(import.meta.dir, "fixtures", "ec_p384_private.pem"), "ascii"),
+ public: fs.readFileSync(path.join(import.meta.dir, "fixtures", "ec_p384_public.pem"), "ascii"),
+ keyType: "ec",
+ namedCurve: "secp384r1",
+ jwk: {
+ crv: "P-384",
+ d: "dwfuHuAtTlMRn7ZBCBm_0grpc1D_4hPeNAgevgelljuC0--k_LDFosDgBlLLmZsi",
+ kty: "EC",
+ x: "hON3nzGJgv-08fdHpQxgRJFZzlK-GZDGa5f3KnvM31cvvjJmsj4UeOgIdy3rDAjV",
+ y: "fidHhtecNCGCfLqmrLjDena1NSzWzWH1u_oUdMKGo5XSabxzD7-8JZxjpc8sR9cl",
+ },
+ },
+ {
+ private: fs.readFileSync(path.join(import.meta.dir, "fixtures", "ec_p521_private.pem"), "ascii"),
+ public: fs.readFileSync(path.join(import.meta.dir, "fixtures", "ec_p521_public.pem"), "ascii"),
+ keyType: "ec",
+ namedCurve: "secp521r1",
+ jwk: {
+ crv: "P-521",
+ d: "Eghuafcab9jXW4gOQLeDaKOlHEiskQFjiL8klijk6i6DNOXcFfaJ9GW48kxpodw16ttAf9Z1WQstfzpKGUetHIk",
+ kty: "EC",
+ x: "AaLFgjwZtznM3N7qsfb86awVXe6c6djUYOob1FN-kllekv0KEXV0bwcDjPGQz5f6MxL" + "CbhMeHRavUS6P10rsTtBn",
+ y: "Ad3flexBeAfXceNzRBH128kFbOWD6W41NjwKRqqIF26vmgW_8COldGKZjFkOSEASxPB" + "cvA2iFJRUyQ3whC00j0Np",
+ },
+ },
+ ].forEach(info => {
+ const { keyType, namedCurve } = info;
+ const test = namedCurve === "secp256k1" ? it.skip : it;
+ let privateKey: KeyObject;
+ test(`${keyType} ${namedCurve} createPrivateKey from Buffer should work`, async () => {
+ const key = createPrivateKey(info.private);
+ privateKey = key;
+ expect(key.type).toBe("private");
+ expect(key.asymmetricKeyType).toBe(keyType);
+ expect(key.asymmetricKeyDetails?.namedCurve).toBe(namedCurve);
+ expect(key.symmetricKeySize).toBe(undefined);
+ expect(key.export({ type: "pkcs8", format: "pem" })).toEqual(info.private);
+ const jwt = key.export({ format: "jwk" });
+ expect(jwt).toEqual(info.jwk);
+ });
+
+ test(`${keyType} ${namedCurve} createPrivateKey from jwk should work`, async () => {
+ const key = createPrivateKey({ key: info.jwk, format: "jwk" });
+ expect(key.type).toBe("private");
+ expect(key.asymmetricKeyType).toBe(keyType);
+ expect(key.asymmetricKeyDetails?.namedCurve).toBe(namedCurve);
+ expect(key.symmetricKeySize).toBe(undefined);
+ expect(key.export({ type: "pkcs8", format: "pem" })).toEqual(info.private);
+ const jwt = key.export({ format: "jwk" });
+ expect(jwt).toEqual(info.jwk);
+ });
+
+ [
+ ["public", info.public],
+ ["private", info.private],
+ ["jwk", { key: info.jwk, format: "jwk" }],
+ ].forEach(([name, input]) => {
+ test(`${keyType} ${namedCurve} createPublicKey using ${name} should work`, async () => {
+ const key = createPublicKey(input);
+ expect(key.type).toBe("public");
+ expect(key.asymmetricKeyType).toBe(keyType);
+ expect(key.asymmetricKeyDetails?.namedCurve).toBe(namedCurve);
+ expect(key.symmetricKeySize).toBe(undefined);
+ if (name == "public") {
+ expect(key.export({ type: "spki", format: "pem" })).toEqual(info.public);
+ }
+ if (name == "jwk") {
+ const jwt = { ...info.jwk };
+ delete jwt.d;
+ const jwk_exported = key.export({ format: "jwk" });
+ expect(jwk_exported).toEqual(jwt);
+ }
+
+ const pkey = privateKey || info.private;
+ const signature = createSign("sha256").update("foo").sign({ key: pkey });
+ const okay = createVerify("sha256").update("foo").verify({ key: key }, signature);
+ expect(okay).toBeTrue();
+ });
+ });
+ });
+
+ test("private encrypted should work", async () => {
+ // Reading an encrypted key without a passphrase should fail.
+ expect(() => createPrivateKey(privateEncryptedPem)).toThrow();
+ // Reading an encrypted key with a passphrase that exceeds OpenSSL's buffer
+ // size limit should fail with an appropriate error code.
+ expect(() =>
+ createPrivateKey({
+ key: privateEncryptedPem,
+ format: "pem",
+ passphrase: Buffer.alloc(1025, "a"),
+ }),
+ ).toThrow();
+ // The buffer has a size of 1024 bytes, so this passphrase should be permitted
+ // (but will fail decryption).
+ expect(() =>
+ createPrivateKey({
+ key: privateEncryptedPem,
+ format: "pem",
+ passphrase: Buffer.alloc(1024, "a"),
+ }),
+ ).toThrow();
+ const publicKey = createPublicKey({
+ key: privateEncryptedPem,
+ format: "pem",
+ passphrase: "password", // this is not documented but should work
+ });
+ expect(publicKey.type).toBe("public");
+ expect(publicKey.asymmetricKeyType).toBe("rsa");
+ expect(publicKey.symmetricKeySize).toBe(undefined);
+
+ const privateKey = createPrivateKey({
+ key: privateEncryptedPem,
+ format: "pem",
+ passphrase: "password",
+ });
+ expect(privateKey.type).toBe("private");
+ expect(privateKey.asymmetricKeyType).toBe("rsa");
+ expect(privateKey.symmetricKeySize).toBe(undefined);
+ });
+
+ [2048, 4096].forEach(suffix => {
+ test(`RSA-${suffix} should work`, async () => {
+ {
+ const publicPem = fs.readFileSync(path.join(import.meta.dir, "fixtures", `rsa_public_${suffix}.pem`), "ascii");
+ const privatePem = fs.readFileSync(
+ path.join(import.meta.dir, "fixtures", `rsa_private_${suffix}.pem`),
+ "ascii",
+ );
+ const publicKey = createPublicKey(publicPem);
+ const expectedKeyDetails = {
+ modulusLength: suffix,
+ publicExponent: 65537n,
+ };
+ expect(publicKey.type).toBe("public");
+ expect(publicKey.asymmetricKeyType).toBe("rsa");
+ expect(publicKey.asymmetricKeyDetails).toEqual(expectedKeyDetails);
+
+ const privateKey = createPrivateKey(privatePem);
+ expect(privateKey.type).toBe("private");
+ expect(privateKey.asymmetricKeyType).toBe("rsa");
+ expect(privateKey.asymmetricKeyDetails).toEqual(expectedKeyDetails);
+
+ for (const key of [privatePem, privateKey]) {
+ // Any algorithm should work.
+ for (const algo of ["sha1", "sha256"]) {
+ // Any salt length should work.
+ for (const saltLength of [undefined, 8, 10, 12, 16, 18, 20]) {
+ const signature = createSign(algo).update("foo").sign({ key, saltLength });
+ for (const pkey of [key, publicKey, publicPem]) {
+ const okay = createVerify(algo).update("foo").verify({ key: pkey, saltLength }, signature);
+ expect(okay).toBeTrue();
+ }
+ }
+ }
+ }
+ }
+ });
+ });
+
+ test("Exporting an encrypted private key requires a cipher", async () => {
+ // Exporting an encrypted private key requires a cipher
+ const privateKey = createPrivateKey(privatePem);
+ expect(() => {
+ privateKey.export({
+ format: "pem",
+ type: "pkcs8",
+ passphrase: "super-secret",
+ });
+ }).toThrow(/cipher is required when passphrase is specified/);
+ });
+
+ test("secret export buffer format (default)", async () => {
+ const buffer = Buffer.from("Hello World");
+ const keyObject = createSecretKey(buffer);
+ expect(keyObject.export()).toEqual(buffer);
+ expect(keyObject.export({})).toEqual(buffer);
+ expect(keyObject.export({ format: "buffer" })).toEqual(buffer);
+ expect(keyObject.export({ format: undefined })).toEqual(buffer);
+ });
+
+ test('exporting an "oct" JWK from a secret', async () => {
+ const buffer = Buffer.from("Hello World");
+ const keyObject = createSecretKey(buffer);
+ const jwk = keyObject.export({ format: "jwk" });
+ expect(jwk).toEqual({ kty: "oct", k: "SGVsbG8gV29ybGQ" });
+ });
+
+ test("secret equals", async () => {
+ {
+ const first = Buffer.from("Hello");
+ const second = Buffer.from("World");
+ const keyObject = createSecretKey(first);
+ expect(createSecretKey(first).equals(createSecretKey(first))).toBeTrue();
+ expect(createSecretKey(first).equals(createSecretKey(second))).toBeFalse();
+
+ expect(() => keyObject.equals(0)).toThrow(/otherKey must be a KeyObject/);
+
+ expect(keyObject.equals(keyObject)).toBeTrue();
+ expect(keyObject.equals(createPublicKey(publicPem))).toBeFalse();
+ expect(keyObject.equals(createPrivateKey(privatePem))).toBeFalse();
+ }
+
+ {
+ const first = createSecretKey(Buffer.alloc(0));
+ const second = createSecretKey(new ArrayBuffer(0));
+ const third = createSecretKey(Buffer.alloc(1));
+ expect(first.equals(first)).toBeTrue();
+ expect(first.equals(second)).toBeTrue();
+ expect(first.equals(third)).toBeFalse();
+ expect(third.equals(first)).toBeFalse();
+ }
+ });
+
+ ["ed25519", "x25519"].forEach(keyType => {
+ const test = keyType === "ed25519" ? it : it.skip;
+ test(`${keyType} equals should work`, async () => {
+ const first = generateKeyPairSync(keyType);
+ const second = generateKeyPairSync(keyType);
+
+ const secret = generateKeySync("aes", { length: 128 });
+
+ expect(first.publicKey.equals(first.publicKey)).toBeTrue();
+
+ expect(first.publicKey.equals(createPublicKey(first.publicKey.export({ format: "pem", type: "spki" }))));
+
+ expect(first.publicKey.equals(second.publicKey)).toBeFalse();
+ expect(first.publicKey.equals(second.privateKey)).toBeFalse();
+ expect(first.publicKey.equals(secret)).toBeFalse();
+
+ expect(first.privateKey.equals(first.privateKey)).toBeTrue();
+ expect(
+ first.privateKey.equals(createPrivateKey(first.privateKey.export({ format: "pem", type: "pkcs8" }))),
+ ).toBeTrue();
+ expect(first.privateKey.equals(second.privateKey)).toBeFalse();
+ expect(first.privateKey.equals(second.publicKey)).toBeFalse();
+ expect(first.privateKey.equals(secret)).toBeFalse();
+ });
+ });
+
+ test("This should not cause a crash: https://github.com/nodejs/node/issues/44471", async () => {
+ for (const key of ["", "foo", null, undefined, true, Boolean]) {
+ expect(() => {
+ createPublicKey({ key, format: "jwk" });
+ }).toThrow();
+ expect(() => {
+ createPrivateKey({ key, format: "jwk" });
+ }).toThrow();
+ }
+ });
+
+ ["hmac", "aes"].forEach(type => {
+ [128, 256].forEach(length => {
+ test(`generateKey ${type} ${length}`, async () => {
+ {
+ const key = generateKeySync(type, { length });
+ expect(key).toBeDefined();
+ const keybuf = key.export();
+ expect(keybuf.byteLength).toBe(length / 8);
+ }
+
+ const { promise, resolve, reject } = Promise.withResolvers();
+ generateKey(type, { length }, (err, key) => {
+ if (err) {
+ reject(err);
+ } else {
+ resolve(key);
+ }
+ });
+
+ {
+ const key = await promise;
+ expect(key).toBeDefined();
+ const keybuf = key.export();
+ expect(keybuf.byteLength).toBe(length / 8);
+ }
+ });
+ });
+ });
+ describe("Test async elliptic curve key generation with 'jwk' encoding and named curve", () => {
+ ["P-384", "P-256", "P-521", "secp256k1"].forEach(curve => {
+ const test = curve === "secp256k1" ? it.skip : it;
+ test(`should work with ${curve}`, async () => {
+ const { promise, resolve, reject } = Promise.withResolvers();
+ generateKeyPair(
+ "ec",
+ {
+ namedCurve: curve,
+ publicKeyEncoding: {
+ format: "jwk",
+ },
+ privateKeyEncoding: {
+ format: "jwk",
+ },
+ },
+ (err, publicKey, privateKey) => {
+ if (err) {
+ return reject(err);
+ }
+ resolve({ publicKey, privateKey });
+ },
+ );
+
+ const { publicKey, privateKey } = await (promise as Promise<{ publicKey: any; privateKey: any }>);
+ expect(typeof publicKey).toBe("object");
+ expect(typeof privateKey).toBe("object");
+ expect(publicKey.x).toBe(privateKey.x);
+ expect(publicKey.y).toBe(publicKey.y);
+ expect(publicKey.d).toBeUndefined();
+ expect(privateKey.d).toBeDefined();
+ expect(publicKey.kty).toEqual("EC");
+ expect(publicKey.kty).toEqual(privateKey.kty);
+ expect(publicKey.crv).toEqual(curve);
+ expect(publicKey.crv).toEqual(privateKey.crv);
+ });
+ });
+ });
+
+ describe("Test async elliptic curve key generation with 'jwk' encoding and RSA.", () => {
+ [256, 1024, 2048].forEach(modulusLength => {
+ test(`should work with ${modulusLength}`, async () => {
+ const { promise, resolve, reject } = Promise.withResolvers();
+ generateKeyPair(
+ "rsa",
+ {
+ modulusLength,
+ publicKeyEncoding: {
+ format: "jwk",
+ },
+ privateKeyEncoding: {
+ format: "jwk",
+ },
+ },
+ (err, publicKey, privateKey) => {
+ if (err) {
+ return reject(err);
+ }
+ resolve({ publicKey, privateKey });
+ },
+ );
+
+ const { publicKey, privateKey } = await (promise as Promise<{ publicKey: any; privateKey: any }>);
+ expect(typeof publicKey).toEqual("object");
+ expect(typeof privateKey).toEqual("object");
+ expect(publicKey.kty).toEqual("RSA");
+ expect(publicKey.kty).toEqual(privateKey.kty);
+ expect(typeof publicKey.n).toEqual("string");
+ expect(publicKey.n).toEqual(privateKey.n);
+ expect(typeof publicKey.e).toEqual("string");
+ expect(publicKey.e).toEqual(privateKey.e);
+ expect(typeof privateKey.d).toEqual("string");
+ expect(typeof privateKey.p).toEqual("string");
+ expect(typeof privateKey.q).toEqual("string");
+ expect(typeof privateKey.dp).toEqual("string");
+ expect(typeof privateKey.dq).toEqual("string");
+ expect(typeof privateKey.qi).toEqual("string");
+ });
+ });
+ });
+
+ describe("Test async elliptic curve key generation with 'jwk' encoding", () => {
+ ["ed25519", "ed448", "x25519", "x448"].forEach(type => {
+ const test = type === "ed25519" ? it : it.skip;
+ test(`should work with ${type}`, async () => {
+ const { promise, resolve, reject } = Promise.withResolvers();
+ generateKeyPair(
+ type,
+ {
+ publicKeyEncoding: {
+ format: "jwk",
+ },
+ privateKeyEncoding: {
+ format: "jwk",
+ },
+ },
+ (err, publicKey, privateKey) => {
+ if (err) {
+ return reject(err);
+ }
+ resolve({ publicKey, privateKey });
+ },
+ );
+
+ const { publicKey, privateKey } = await (promise as Promise<{ publicKey: any; privateKey: any }>);
+ expect(typeof publicKey).toEqual("object");
+ expect(typeof privateKey).toEqual("object");
+ expect(publicKey.x).toEqual(privateKey.x);
+ expect(publicKey.d).toBeUndefined();
+ expect(privateKey.d).toBeDefined();
+ expect(publicKey.kty).toEqual("OKP");
+ expect(publicKey.kty).toEqual(privateKey.kty);
+ const expectedCrv = `${type.charAt(0).toUpperCase()}${type.slice(1)}`;
+ expect(publicKey.crv).toEqual(expectedCrv);
+ expect(publicKey.crv).toEqual(privateKey.crv);
+ });
+ });
+ });
+
+ test(`Test async RSA key generation with an encrypted private key, but encoded as DER`, async () => {
+ const { promise, resolve, reject } = Promise.withResolvers();
+ generateKeyPair(
+ "rsa",
+ {
+ publicExponent: 0x10001,
+ modulusLength: 512,
+ publicKeyEncoding: {
+ type: "pkcs1",
+ format: "der",
+ },
+ privateKeyEncoding: {
+ type: "pkcs1",
+ format: "pem",
+ cipher: "aes-256-cbc",
+ passphrase: "secret",
+ },
+ },
+ (err, publicKey, privateKey) => {
+ if (err) {
+ return reject(err);
+ }
+ resolve({ publicKey, privateKey });
+ },
+ );
+
+ const { publicKey: publicKeyDER, privateKey } = await (promise as Promise<{
+ publicKey: Buffer;
+ privateKey: string;
+ }>);
+ expect(Buffer.isBuffer(publicKeyDER)).toBeTrue();
+ assertApproximateSize(publicKeyDER, 74);
+
+ expect(typeof privateKey).toBe("string");
+ expect(privateKey).toMatch(pkcs1EncExp("AES-256-CBC"));
+
+ const publicKey = {
+ key: publicKeyDER,
+ type: "pkcs1",
+ format: "der",
+ };
+ expect(() => {
+ testEncryptDecrypt(publicKey, privateKey);
+ }).toThrow();
+
+ const key = { key: privateKey, passphrase: "secret" };
+ testEncryptDecrypt(publicKey, key);
+ testSignVerify(publicKey, key);
+ });
+
+ test(`Test async RSA key generation with an encrypted private key`, async () => {
+ const { promise, resolve, reject } = Promise.withResolvers();
+ generateKeyPair(
+ "rsa",
+ {
+ publicExponent: 0x10001,
+ modulusLength: 512,
+ publicKeyEncoding: {
+ type: "pkcs1",
+ format: "der",
+ },
+ privateKeyEncoding: {
+ type: "pkcs8",
+ format: "der",
+ },
+ },
+ (err, publicKey, privateKey) => {
+ if (err) {
+ return reject(err);
+ }
+ resolve({ publicKey, privateKey });
+ },
+ );
+
+ const { publicKey: publicKeyDER, privateKey: privateKeyDER } = await (promise as Promise<{
+ publicKey: Buffer;
+ privateKey: Buffer;
+ }>);
+ expect(Buffer.isBuffer(publicKeyDER)).toBeTrue();
+ assertApproximateSize(publicKeyDER, 74);
+
+ expect(Buffer.isBuffer(privateKeyDER)).toBeTrue();
+
+ const publicKey = {
+ key: publicKeyDER,
+ type: "pkcs1",
+ format: "der",
+ };
+ const privateKey = {
+ key: privateKeyDER,
+ format: "der",
+ type: "pkcs8",
+ passphrase: "secret",
+ };
+ testEncryptDecrypt(publicKey, privateKey);
+ testSignVerify(publicKey, privateKey);
+ });
+
+ test(`Test async elliptic curve key generation, e.g. for ECDSA, with an encrypted private key`, async () => {
+ const { promise, resolve, reject } = Promise.withResolvers();
+ generateKeyPair(
+ "ec",
+ {
+ namedCurve: "P-256",
+ publicKeyEncoding: {
+ type: "spki",
+ format: "pem",
+ },
+ privateKeyEncoding: {
+ type: "pkcs8",
+ format: "pem",
+ cipher: "aes-128-cbc",
+ passphrase: "top secret",
+ },
+ },
+ (err, publicKey, privateKey) => {
+ if (err) {
+ return reject(err);
+ }
+ resolve({ publicKey, privateKey });
+ },
+ );
+
+ const { publicKey, privateKey } = await (promise as Promise<{ publicKey: string; privateKey: string }>);
+ expect(typeof publicKey).toBe("string");
+ expect(publicKey).toMatch(spkiExp);
+ expect(typeof privateKey).toBe("string");
+ expect(privateKey).toMatch(pkcs8EncExp);
+
+ expect(() => {
+ testSignVerify(publicKey, privateKey);
+ }).toThrow();
+
+ testSignVerify(publicKey, {
+ key: privateKey,
+ passphrase: "top secret",
+ });
+ });
+
+ test(`Test async explicit elliptic curve key generation with an encrypted private key`, async () => {
+ const { promise, resolve, reject } = Promise.withResolvers();
+ generateKeyPair(
+ "ec",
+ {
+ namedCurve: "prime256v1",
+ publicKeyEncoding: {
+ type: "spki",
+ format: "pem",
+ },
+ privateKeyEncoding: {
+ type: "sec1",
+ format: "pem",
+ cipher: "aes-128-cbc",
+ passphrase: "secret",
+ },
+ },
+ (err, publicKey, privateKey) => {
+ if (err) {
+ return reject(err);
+ }
+ resolve({ publicKey, privateKey });
+ },
+ );
+
+ const { publicKey, privateKey } = await (promise as Promise<{ publicKey: string; privateKey: string }>);
+ expect(typeof publicKey).toBe("string");
+ expect(publicKey).toMatch(spkiExp);
+ expect(typeof privateKey).toBe("string");
+ expect(privateKey).toMatch(sec1EncExp("AES-128-CBC"));
+
+ expect(() => {
+ testSignVerify(publicKey, privateKey);
+ }).toThrow();
+
+ testSignVerify(publicKey, {
+ key: privateKey,
+ passphrase: "secret",
+ });
+ });
+
+ test(`Test async explicit elliptic curve key generation, e.g. for ECDSA, with a SEC1 private key`, async () => {
+ const { promise, resolve, reject } = Promise.withResolvers();
+ generateKeyPair(
+ "ec",
+ {
+ namedCurve: "prime256v1",
+ publicKeyEncoding: {
+ type: "spki",
+ format: "pem",
+ },
+ privateKeyEncoding: {
+ type: "sec1",
+ format: "pem",
+ },
+ },
+ (err, publicKey, privateKey) => {
+ if (err) {
+ return reject(err);
+ }
+ resolve({ publicKey, privateKey });
+ },
+ );
+
+ const { publicKey, privateKey } = await (promise as Promise<{ publicKey: string; privateKey: string }>);
+ expect(typeof publicKey).toBe("string");
+ expect(publicKey).toMatch(spkiExp);
+ expect(typeof privateKey).toBe("string");
+ expect(privateKey).toMatch(sec1Exp);
+ testSignVerify(publicKey, privateKey);
+ });
+
+ test(`Test async elliptic curve key generation, e.g. for ECDSA, with an encrypted private key`, async () => {
+ const { promise, resolve, reject } = Promise.withResolvers();
+ generateKeyPair(
+ "ec",
+ {
+ namedCurve: "prime256v1",
+ publicKeyEncoding: {
+ type: "spki",
+ format: "pem",
+ },
+ privateKeyEncoding: {
+ type: "pkcs8",
+ format: "pem",
+ cipher: "aes-128-cbc",
+ passphrase: "top secret",
+ },
+ },
+ (err, publicKey, privateKey) => {
+ if (err) {
+ return reject(err);
+ }
+ resolve({ publicKey, privateKey });
+ },
+ );
+
+ const { publicKey, privateKey } = await (promise as Promise<{ publicKey: string; privateKey: string }>);
+ expect(typeof publicKey).toBe("string");
+ expect(publicKey).toMatch(spkiExp);
+ expect(typeof privateKey).toBe("string");
+ expect(privateKey).toMatch(pkcs8EncExp);
+
+ expect(() => {
+ testSignVerify(publicKey, privateKey);
+ }).toThrow();
+
+ testSignVerify(publicKey, {
+ key: privateKey,
+ passphrase: "top secret",
+ });
+ });
+
+ describe("Test sync elliptic curve key generation with 'jwk' encoding and named curve", () => {
+ ["P-384", "P-256", "P-521", "secp256k1"].forEach(curve => {
+ const test = curve === "secp256k1" ? it.skip : it;
+ test(`should work with ${curve}`, async () => {
+ const { publicKey, privateKey } = generateKeyPairSync("ec", {
+ namedCurve: curve,
+ publicKeyEncoding: {
+ format: "jwk",
+ },
+ privateKeyEncoding: {
+ format: "jwk",
+ },
+ });
+ expect(typeof publicKey).toBe("object");
+ expect(typeof privateKey).toBe("object");
+ expect(publicKey.x).toBe(privateKey.x);
+ expect(publicKey.y).toBe(publicKey.y);
+ expect(publicKey.d).toBeUndefined();
+ expect(privateKey.d).toBeDefined();
+ expect(publicKey.kty).toEqual("EC");
+ expect(publicKey.kty).toEqual(privateKey.kty);
+ expect(publicKey.crv).toEqual(curve);
+ expect(publicKey.crv).toEqual(privateKey.crv);
+ });
+ });
+ });
+
+ describe("Test sync elliptic curve key generation with 'jwk' encoding and RSA.", () => {
+ [256, 1024, 2048].forEach(modulusLength => {
+ test(`should work with ${modulusLength}`, async () => {
+ const { publicKey, privateKey } = generateKeyPairSync("rsa", {
+ modulusLength,
+ publicKeyEncoding: {
+ format: "jwk",
+ },
+ privateKeyEncoding: {
+ format: "jwk",
+ },
+ });
+ expect(typeof publicKey).toEqual("object");
+ expect(typeof privateKey).toEqual("object");
+ expect(publicKey.kty).toEqual("RSA");
+ expect(publicKey.kty).toEqual(privateKey.kty);
+ expect(typeof publicKey.n).toEqual("string");
+ expect(publicKey.n).toEqual(privateKey.n);
+ expect(typeof publicKey.e).toEqual("string");
+ expect(publicKey.e).toEqual(privateKey.e);
+ expect(typeof privateKey.d).toEqual("string");
+ expect(typeof privateKey.p).toEqual("string");
+ expect(typeof privateKey.q).toEqual("string");
+ expect(typeof privateKey.dp).toEqual("string");
+ expect(typeof privateKey.dq).toEqual("string");
+ expect(typeof privateKey.qi).toEqual("string");
+ });
+ });
+ });
+
+ describe("Test sync elliptic curve key generation with 'jwk' encoding", () => {
+ ["ed25519", "ed448", "x25519", "x448"].forEach(type => {
+ const test = type === "ed25519" ? it : it.skip;
+ test(`should work with ${type}`, async () => {
+ const { publicKey, privateKey } = generateKeyPairSync(type, {
+ publicKeyEncoding: {
+ format: "jwk",
+ },
+ privateKeyEncoding: {
+ format: "jwk",
+ },
+ });
+
+ expect(typeof publicKey).toEqual("object");
+ expect(typeof privateKey).toEqual("object");
+ expect(publicKey.x).toEqual(privateKey.x);
+ expect(publicKey.d).toBeUndefined();
+ expect(privateKey.d).toBeDefined();
+ expect(publicKey.kty).toEqual("OKP");
+ expect(publicKey.kty).toEqual(privateKey.kty);
+ const expectedCrv = `${type.charAt(0).toUpperCase()}${type.slice(1)}`;
+ expect(publicKey.crv).toEqual(expectedCrv);
+ expect(publicKey.crv).toEqual(privateKey.crv);
+ });
+ });
+ });
+
+ test(`Test sync RSA key generation with an encrypted private key, but encoded as DER`, async () => {
+ const { publicKey: publicKeyDER, privateKey } = generateKeyPairSync("rsa", {
+ publicExponent: 0x10001,
+ modulusLength: 512,
+ publicKeyEncoding: {
+ type: "pkcs1",
+ format: "der",
+ },
+ privateKeyEncoding: {
+ type: "pkcs1",
+ format: "pem",
+ cipher: "aes-256-cbc",
+ passphrase: "secret",
+ },
+ });
+
+ expect(Buffer.isBuffer(publicKeyDER)).toBeTrue();
+ assertApproximateSize(publicKeyDER, 74);
+
+ expect(typeof privateKey).toBe("string");
+ expect(privateKey).toMatch(pkcs1EncExp("AES-256-CBC"));
+
+ const publicKey = {
+ key: publicKeyDER,
+ type: "pkcs1",
+ format: "der",
+ };
+ expect(() => {
+ testEncryptDecrypt(publicKey, privateKey);
+ }).toThrow();
+
+ const key = { key: privateKey, passphrase: "secret" };
+ testEncryptDecrypt(publicKey, key);
+ testSignVerify(publicKey, key);
+ });
+
+ test(`Test sync RSA key generation with an encrypted private key`, async () => {
+ const { publicKey: publicKeyDER, privateKey: privateKeyDER } = generateKeyPairSync("rsa", {
+ publicExponent: 0x10001,
+ modulusLength: 512,
+ publicKeyEncoding: {
+ type: "pkcs1",
+ format: "der",
+ },
+ privateKeyEncoding: {
+ type: "pkcs8",
+ format: "der",
+ },
+ });
+
+ expect(Buffer.isBuffer(publicKeyDER)).toBeTrue();
+ assertApproximateSize(publicKeyDER, 74);
+
+ expect(Buffer.isBuffer(privateKeyDER)).toBeTrue();
+
+ const publicKey = {
+ key: publicKeyDER,
+ type: "pkcs1",
+ format: "der",
+ };
+ const privateKey = {
+ key: privateKeyDER,
+ format: "der",
+ type: "pkcs8",
+ passphrase: "secret",
+ };
+ testEncryptDecrypt(publicKey, privateKey);
+ testSignVerify(publicKey, privateKey);
+ });
+
+ test(`Test sync elliptic curve key generation, e.g. for ECDSA, with an encrypted private key`, async () => {
+ const { publicKey, privateKey } = generateKeyPairSync("ec", {
+ namedCurve: "P-256",
+ publicKeyEncoding: {
+ type: "spki",
+ format: "pem",
+ },
+ privateKeyEncoding: {
+ type: "pkcs8",
+ format: "pem",
+ cipher: "aes-128-cbc",
+ passphrase: "top secret",
+ },
+ });
+
+ expect(typeof publicKey).toBe("string");
+ expect(publicKey).toMatch(spkiExp);
+ expect(typeof privateKey).toBe("string");
+ expect(privateKey).toMatch(pkcs8EncExp);
+
+ expect(() => {
+ testSignVerify(publicKey, privateKey);
+ }).toThrow();
+
+ testSignVerify(publicKey, {
+ key: privateKey,
+ passphrase: "top secret",
+ });
+ });
+
+ test(`Test sync explicit elliptic curve key generation with an encrypted private key`, async () => {
+ const { publicKey, privateKey } = generateKeyPairSync(
+ "ec",
+ {
+ namedCurve: "prime256v1",
+ publicKeyEncoding: {
+ type: "spki",
+ format: "pem",
+ },
+ privateKeyEncoding: {
+ type: "sec1",
+ format: "pem",
+ cipher: "aes-128-cbc",
+ passphrase: "secret",
+ },
+ },
+ (err, publicKey, privateKey) => {
+ if (err) {
+ return reject(err);
+ }
+ resolve({ publicKey, privateKey });
+ },
+ );
+
+ expect(typeof publicKey).toBe("string");
+ expect(publicKey).toMatch(spkiExp);
+ expect(typeof privateKey).toBe("string");
+ expect(privateKey).toMatch(sec1EncExp("AES-128-CBC"));
+
+ expect(() => {
+ testSignVerify(publicKey, privateKey);
+ }).toThrow();
+
+ testSignVerify(publicKey, {
+ key: privateKey,
+ passphrase: "secret",
+ });
+ });
+
+ test(`Test sync explicit elliptic curve key generation, e.g. for ECDSA, with a SEC1 private key`, async () => {
+ const { publicKey, privateKey } = generateKeyPairSync("ec", {
+ namedCurve: "prime256v1",
+ publicKeyEncoding: {
+ type: "spki",
+ format: "pem",
+ },
+ privateKeyEncoding: {
+ type: "sec1",
+ format: "pem",
+ },
+ });
+
+ expect(typeof publicKey).toBe("string");
+ expect(publicKey).toMatch(spkiExp);
+ expect(typeof privateKey).toBe("string");
+ expect(privateKey).toMatch(sec1Exp);
+ testSignVerify(publicKey, privateKey);
+ });
+
+ test(`Test sync elliptic curve key generation, e.g. for ECDSA, with an encrypted private key`, async () => {
+ const { publicKey, privateKey } = generateKeyPairSync("ec", {
+ namedCurve: "prime256v1",
+ publicKeyEncoding: {
+ type: "spki",
+ format: "pem",
+ },
+ privateKeyEncoding: {
+ type: "pkcs8",
+ format: "pem",
+ cipher: "aes-128-cbc",
+ passphrase: "top secret",
+ },
+ });
+
+ expect(typeof publicKey).toBe("string");
+ expect(publicKey).toMatch(spkiExp);
+ expect(typeof privateKey).toBe("string");
+ expect(privateKey).toMatch(pkcs8EncExp);
+
+ expect(() => {
+ testSignVerify(publicKey, privateKey);
+ }).toThrow();
+
+ testSignVerify(publicKey, {
+ key: privateKey,
+ passphrase: "top secret",
+ });
+ });
+ // SKIPED because we round the key size to the nearest multiple of 8 like documented
+ test.skip(`this tests check that generateKeyPair returns correct bit length in KeyObject's asymmetricKeyDetails.`, async () => {
+ // This tests check that generateKeyPair returns correct bit length in
+ // https://github.com/nodejs/node/issues/46102#issuecomment-1372153541
+ const { promise, resolve, reject } = Promise.withResolvers();
+ generateKeyPair(
+ "rsa",
+ {
+ modulusLength: 513,
+ },
+ (err, publicKey, privateKey) => {
+ if (err) {
+ return reject(err);
+ }
+ resolve({ publicKey, privateKey });
+ },
+ );
+
+ const { publicKey, privateKey } = await (promise as Promise<{ publicKey: KeyObject; privateKey: KeyObject }>);
+ expect(publicKey.asymmetricKeyDetails?.modulusLength).toBe(513);
+ expect(privateKey.asymmetricKeyDetails?.modulusLength).toBe(513);
+ });
+
+ function testRunInContext(fn: any) {
+ test("can generate key", () => {
+ const context = createContext({ generateKeySync });
+ const result = fn(`generateKeySync("aes", { length: 128 })`, context);
+ expect(result).toBeDefined();
+ const keybuf = result.export();
+ expect(keybuf.byteLength).toBe(128 / 8);
+ });
+ test("can be used on another context", () => {
+ const context = createContext({ generateKeyPairSync, assertApproximateSize, testEncryptDecrypt, testSignVerify });
+ const result = fn(
+ `
+ const { publicKey: publicKeyDER, privateKey: privateKeyDER } = generateKeyPairSync(
+ "rsa",
+ {
+ publicExponent: 0x10001,
+ modulusLength: 512,
+ publicKeyEncoding: {
+ type: "pkcs1",
+ format: "der",
+ },
+ privateKeyEncoding: {
+ type: "pkcs8",
+ format: "der",
+ },
+ }
+ );
+
+
+ assertApproximateSize(publicKeyDER, 74);
+
+ const publicKey = {
+ key: publicKeyDER,
+ type: "pkcs1",
+ format: "der",
+ };
+ const privateKey = {
+ key: privateKeyDER,
+ format: "der",
+ type: "pkcs8",
+ passphrase: "secret",
+ };
+ testEncryptDecrypt(publicKey, privateKey);
+ testSignVerify(publicKey, privateKey);
+ `,
+ context,
+ );
+ });
+ }
+ describe("Script", () => {
+ describe("runInContext()", () => {
+ testRunInContext((code, context, options) => {
+ // @ts-expect-error
+ const script = new Script(code, options);
+ return script.runInContext(context);
+ });
+ });
+ describe("runInNewContext()", () => {
+ testRunInContext((code, context, options) => {
+ // @ts-expect-error
+ const script = new Script(code, options);
+ return script.runInNewContext(context);
+ });
+ });
+ describe("runInThisContext()", () => {
+ testRunInContext((code, context, options) => {
+ // @ts-expect-error
+ const script = new Script(code, options);
+ return script.runInThisContext(context);
+ });
+ });
+ });
+});
+
+test.todo("RSA-PSS should work", async () => {
+ // Test RSA-PSS.
+ {
+ // This key pair does not restrict the message digest algorithm or salt
+ // length.
+ // const publicPem = fs.readFileSync(path.join(import.meta.dir, "fixtures", "rsa_pss_public_2048.pem"), "ascii");
+ // const privatePem = fs.readFileSync(path.join(import.meta.dir, "fixtures", "rsa_pss_private_2048.pem"), "ascii");
+ // const publicKey = createPublicKey(publicPem);
+ // const privateKey = createPrivateKey(privatePem);
+ // // Because no RSASSA-PSS-params appears in the PEM, no defaults should be
+ // // added for the PSS parameters. This is different from an empty
+ // // RSASSA-PSS-params sequence (see test below).
+ // const expectedKeyDetails = {
+ // modulusLength: 2048,
+ // publicExponent: 65537n,
+ // };
+ // expect(publicKey.type).toBe("public");
+ // expect(publicKey.asymmetricKeyType).toBe("rsa-pss");
+ // expect(publicKey.asymmetricKeyDetails).toBe(expectedKeyDetails);
+ // expect(privateKey.type).toBe("private");
+ // expect(privateKey.asymmetricKeyType).toBe("rsa-pss");
+ // expect(privateKey.asymmetricKeyDetails).toBe(expectedKeyDetails);
+ // assert.throws(
+ // () => publicKey.export({ format: 'jwk' }),
+ // { code: 'ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE' });
+ // assert.throws(
+ // () => privateKey.export({ format: 'jwk' }),
+ // { code: 'ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE' });
+ // for (const key of [privatePem, privateKey]) {
+ // // Any algorithm should work.
+ // for (const algo of ['sha1', 'sha256']) {
+ // // Any salt length should work.
+ // for (const saltLength of [undefined, 8, 10, 12, 16, 18, 20]) {
+ // const signature = createSign(algo)
+ // .update('foo')
+ // .sign({ key, saltLength });
+ // for (const pkey of [key, publicKey, publicPem]) {
+ // const okay = createVerify(algo)
+ // .update('foo')
+ // .verify({ key: pkey, saltLength }, signature);
+ // assert.ok(okay);
+ // }
+ // }
+ // }
+ // }
+ // // Exporting the key using PKCS#1 should not work since this would discard
+ // // any algorithm restrictions.
+ // assert.throws(() => {
+ // publicKey.export({ format: 'pem', type: 'pkcs1' });
+ // }, {
+ // code: 'ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS'
+ // });
+ // {
+ // // This key pair enforces sha1 as the message digest and the MGF1
+ // // message digest and a salt length of 20 bytes.
+ // const publicPem = fixtures.readKey('rsa_pss_public_2048_sha1_sha1_20.pem');
+ // const privatePem =
+ // fixtures.readKey('rsa_pss_private_2048_sha1_sha1_20.pem');
+ // const publicKey = createPublicKey(publicPem);
+ // const privateKey = createPrivateKey(privatePem);
+ // // Unlike the previous key pair, this key pair contains an RSASSA-PSS-params
+ // // sequence. However, because all values in the RSASSA-PSS-params are set to
+ // // their defaults (see RFC 3447), the ASN.1 structure contains an empty
+ // // sequence. Node.js should add the default values to the key details.
+ // const expectedKeyDetails = {
+ // modulusLength: 2048,
+ // publicExponent: 65537n,
+ // hashAlgorithm: 'sha1',
+ // mgf1HashAlgorithm: 'sha1',
+ // saltLength: 20
+ // };
+ // assert.strictEqual(publicKey.type, 'public');
+ // assert.strictEqual(publicKey.asymmetricKeyType, 'rsa-pss');
+ // assert.deepStrictEqual(publicKey.asymmetricKeyDetails, expectedKeyDetails);
+ // assert.strictEqual(privateKey.type, 'private');
+ // assert.strictEqual(privateKey.asymmetricKeyType, 'rsa-pss');
+ // assert.deepStrictEqual(privateKey.asymmetricKeyDetails, expectedKeyDetails);
+ // }
+ // {
+ // // This key pair enforces sha256 as the message digest and the MGF1
+ // // message digest and a salt length of at least 16 bytes.
+ // const publicPem =
+ // fixtures.readKey('rsa_pss_public_2048_sha256_sha256_16.pem');
+ // const privatePem =
+ // fixtures.readKey('rsa_pss_private_2048_sha256_sha256_16.pem');
+ // const publicKey = createPublicKey(publicPem);
+ // const privateKey = createPrivateKey(privatePem);
+ // assert.strictEqual(publicKey.type, 'public');
+ // assert.strictEqual(publicKey.asymmetricKeyType, 'rsa-pss');
+ // assert.strictEqual(privateKey.type, 'private');
+ // assert.strictEqual(privateKey.asymmetricKeyType, 'rsa-pss');
+ // for (const key of [privatePem, privateKey]) {
+ // // Signing with anything other than sha256 should fail.
+ // assert.throws(() => {
+ // createSign('sha1').sign(key);
+ // }, /digest not allowed/);
+ // // Signing with salt lengths less than 16 bytes should fail.
+ // for (const saltLength of [8, 10, 12]) {
+ // assert.throws(() => {
+ // createSign('sha1').sign({ key, saltLength });
+ // }, /pss saltlen too small/);
+ // }
+ // // Signing with sha256 and appropriate salt lengths should work.
+ // for (const saltLength of [undefined, 16, 18, 20]) {
+ // const signature = createSign('sha256')
+ // .update('foo')
+ // .sign({ key, saltLength });
+ // for (const pkey of [key, publicKey, publicPem]) {
+ // const okay = createVerify('sha256')
+ // .update('foo')
+ // .verify({ key: pkey, saltLength }, signature);
+ // assert.ok(okay);
+ // }
+ // }
+ // }
+ // }
+ // {
+ // // This key enforces sha512 as the message digest and sha256 as the MGF1
+ // // message digest.
+ // const publicPem =
+ // fixtures.readKey('rsa_pss_public_2048_sha512_sha256_20.pem');
+ // const privatePem =
+ // fixtures.readKey('rsa_pss_private_2048_sha512_sha256_20.pem');
+ // const publicKey = createPublicKey(publicPem);
+ // const privateKey = createPrivateKey(privatePem);
+ // const expectedKeyDetails = {
+ // modulusLength: 2048,
+ // publicExponent: 65537n,
+ // hashAlgorithm: 'sha512',
+ // mgf1HashAlgorithm: 'sha256',
+ // saltLength: 20
+ // };
+ // assert.strictEqual(publicKey.type, 'public');
+ // assert.strictEqual(publicKey.asymmetricKeyType, 'rsa-pss');
+ // assert.deepStrictEqual(publicKey.asymmetricKeyDetails, expectedKeyDetails);
+ // assert.strictEqual(privateKey.type, 'private');
+ // assert.strictEqual(privateKey.asymmetricKeyType, 'rsa-pss');
+ // assert.deepStrictEqual(privateKey.asymmetricKeyDetails, expectedKeyDetails);
+ // // Node.js usually uses the same hash function for the message and for MGF1.
+ // // However, when a different MGF1 message digest algorithm has been
+ // // specified as part of the key, it should automatically switch to that.
+ // // This behavior is required by sections 3.1 and 3.3 of RFC4055.
+ // for (const key of [privatePem, privateKey]) {
+ // // sha256 matches the MGF1 hash function and should be used internally,
+ // // but it should not be permitted as the main message digest algorithm.
+ // for (const algo of ['sha1', 'sha256']) {
+ // assert.throws(() => {
+ // createSign(algo).sign(key);
+ // }, /digest not allowed/);
+ // }
+ // // sha512 should produce a valid signature.
+ // const signature = createSign('sha512')
+ // .update('foo')
+ // .sign(key);
+ // for (const pkey of [key, publicKey, publicPem]) {
+ // const okay = createVerify('sha512')
+ // .update('foo')
+ // .verify(pkey, signature);
+ // assert.ok(okay);
+ // }
+ // }
+ // }
+ // }
+ }
+});
diff --git a/test/js/node/crypto/fixtures/ec_p256_private.pem b/test/js/node/crypto/fixtures/ec_p256_private.pem
new file mode 100644
index 000000000..6bb0bb9cf
--- /dev/null
+++ b/test/js/node/crypto/fixtures/ec_p256_private.pem
@@ -0,0 +1,5 @@
+-----BEGIN PRIVATE KEY-----
+MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgDxBsPQPIgMuMyQbx
+zbb9toew6Ev6e9O6ZhpxLNgmAEqhRANCAARfSYxhH+6V5lIg+M3O0iQBLf+53kuE
+2luIgWnp81/Ya1Gybj8tl4tJVu1GEwcTyt8hoA7vRACmCHnI5B1+bNpS
+-----END PRIVATE KEY-----
diff --git a/test/js/node/crypto/fixtures/ec_p256_public.pem b/test/js/node/crypto/fixtures/ec_p256_public.pem
new file mode 100644
index 000000000..08f7bd26d
--- /dev/null
+++ b/test/js/node/crypto/fixtures/ec_p256_public.pem
@@ -0,0 +1,4 @@
+-----BEGIN PUBLIC KEY-----
+MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEX0mMYR/uleZSIPjNztIkAS3/ud5L
+hNpbiIFp6fNf2GtRsm4/LZeLSVbtRhMHE8rfIaAO70QApgh5yOQdfmzaUg==
+-----END PUBLIC KEY-----
diff --git a/test/js/node/crypto/fixtures/ec_p384_private.pem b/test/js/node/crypto/fixtures/ec_p384_private.pem
new file mode 100644
index 000000000..06393e263
--- /dev/null
+++ b/test/js/node/crypto/fixtures/ec_p384_private.pem
@@ -0,0 +1,6 @@
+-----BEGIN PRIVATE KEY-----
+MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDB3B+4e4C1OUxGftkEI
+Gb/SCulzUP/iE940CB6+B6WWO4LT76T8sMWiwOAGUsuZmyKhZANiAASE43efMYmC
+/7Tx90elDGBEkVnOUr4ZkMZrl/cqe8zfVy++MmayPhR46Ah3LesMCNV+J0eG15w0
+IYJ8uqasuMN6drU1LNbNYfW7+hR0woajldJpvHMPv7wlnGOlzyxH1yU=
+-----END PRIVATE KEY-----
diff --git a/test/js/node/crypto/fixtures/ec_p384_public.pem b/test/js/node/crypto/fixtures/ec_p384_public.pem
new file mode 100644
index 000000000..2b50f3bbc
--- /dev/null
+++ b/test/js/node/crypto/fixtures/ec_p384_public.pem
@@ -0,0 +1,5 @@
+-----BEGIN PUBLIC KEY-----
+MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEhON3nzGJgv+08fdHpQxgRJFZzlK+GZDG
+a5f3KnvM31cvvjJmsj4UeOgIdy3rDAjVfidHhtecNCGCfLqmrLjDena1NSzWzWH1
+u/oUdMKGo5XSabxzD7+8JZxjpc8sR9cl
+-----END PUBLIC KEY-----
diff --git a/test/js/node/crypto/fixtures/ec_p521_private.pem b/test/js/node/crypto/fixtures/ec_p521_private.pem
new file mode 100644
index 000000000..e4a8a655c
--- /dev/null
+++ b/test/js/node/crypto/fixtures/ec_p521_private.pem
@@ -0,0 +1,8 @@
+-----BEGIN PRIVATE KEY-----
+MIHuAgEAMBAGByqGSM49AgEGBSuBBAAjBIHWMIHTAgEBBEIAEghuafcab9jXW4gO
+QLeDaKOlHEiskQFjiL8klijk6i6DNOXcFfaJ9GW48kxpodw16ttAf9Z1WQstfzpK
+GUetHImhgYkDgYYABAGixYI8Gbc5zNze6rH2/OmsFV3unOnY1GDqG9RTfpJZXpL9
+ChF1dG8HA4zxkM+X+jMSwm4THh0Wr1Euj9dK7E7QZwHd35XsQXgH13Hjc0QR9dvJ
+BWzlg+luNTY8CkaqiBdur5oFv/AjpXRimYxZDkhAEsTwXLwNohSUVMkN8IQtNI9D
+aQ==
+-----END PRIVATE KEY-----
diff --git a/test/js/node/crypto/fixtures/ec_p521_public.pem b/test/js/node/crypto/fixtures/ec_p521_public.pem
new file mode 100644
index 000000000..c0ed00f64
--- /dev/null
+++ b/test/js/node/crypto/fixtures/ec_p521_public.pem
@@ -0,0 +1,6 @@
+-----BEGIN PUBLIC KEY-----
+MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQBosWCPBm3Oczc3uqx9vzprBVd7pzp
+2NRg6hvUU36SWV6S/QoRdXRvBwOM8ZDPl/ozEsJuEx4dFq9RLo/XSuxO0GcB3d+V
+7EF4B9dx43NEEfXbyQVs5YPpbjU2PApGqogXbq+aBb/wI6V0YpmMWQ5IQBLE8Fy8
+DaIUlFTJDfCELTSPQ2k=
+-----END PUBLIC KEY-----
diff --git a/test/js/node/crypto/fixtures/ec_secp256k1_private.pem b/test/js/node/crypto/fixtures/ec_secp256k1_private.pem
new file mode 100644
index 000000000..f753c751b
--- /dev/null
+++ b/test/js/node/crypto/fixtures/ec_secp256k1_private.pem
@@ -0,0 +1,5 @@
+-----BEGIN PRIVATE KEY-----
+MIGEAgEAMBAGByqGSM49AgEGBSuBBAAKBG0wawIBAQQgc34ocwTwpFa9NZZh3l88
+qXyrkoYSxvC0FEsU5v1v4IOhRANCAARw7OEVKlbGFqUJtY10/Yf/JSR0LzUL1PZ1
+4Ol/ErujAPgNwwGU5PSD6aTfn9NycnYB2hby9XwB2qF3+El+DV8q
+-----END PRIVATE KEY-----
diff --git a/test/js/node/crypto/fixtures/ec_secp256k1_public.pem b/test/js/node/crypto/fixtures/ec_secp256k1_public.pem
new file mode 100644
index 000000000..e95322efb
--- /dev/null
+++ b/test/js/node/crypto/fixtures/ec_secp256k1_public.pem
@@ -0,0 +1,4 @@
+-----BEGIN PUBLIC KEY-----
+MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEcOzhFSpWxhalCbWNdP2H/yUkdC81C9T2
+deDpfxK7owD4DcMBlOT0g+mk35/TcnJ2AdoW8vV8Adqhd/hJfg1fKg==
+-----END PUBLIC KEY-----
diff --git a/test/js/node/crypto/fixtures/ed25519_private.pem b/test/js/node/crypto/fixtures/ed25519_private.pem
new file mode 100644
index 000000000..f837457cb
--- /dev/null
+++ b/test/js/node/crypto/fixtures/ed25519_private.pem
@@ -0,0 +1,3 @@
+-----BEGIN PRIVATE KEY-----
+MC4CAQAwBQYDK2VwBCIEIMFSujN0jIUIdzSvuxka0lfgVVkMdRTuaVvIYUHrvzXQ
+-----END PRIVATE KEY-----
diff --git a/test/js/node/crypto/fixtures/ed25519_public.pem b/test/js/node/crypto/fixtures/ed25519_public.pem
new file mode 100644
index 000000000..4127a471b
--- /dev/null
+++ b/test/js/node/crypto/fixtures/ed25519_public.pem
@@ -0,0 +1,3 @@
+-----BEGIN PUBLIC KEY-----
+MCowBQYDK2VwAyEAK1wIouqnuiA04b3WrMa+xKIKIpfHetNZRv3h9fBf768=
+-----END PUBLIC KEY-----
diff --git a/test/js/node/crypto/fixtures/ed448_private.pem b/test/js/node/crypto/fixtures/ed448_private.pem
new file mode 100644
index 000000000..9643665d6
--- /dev/null
+++ b/test/js/node/crypto/fixtures/ed448_private.pem
@@ -0,0 +1,4 @@
+-----BEGIN PRIVATE KEY-----
+MEcCAQAwBQYDK2VxBDsEOdOtCnu9bDdBqSHNNZ5xoDA5KdLBTUNPcKFaOADNX32s
+dfpo52pCtPqfku/l3/OfUHsF43EfZsaaWA==
+-----END PRIVATE KEY-----
diff --git a/test/js/node/crypto/fixtures/ed448_public.pem b/test/js/node/crypto/fixtures/ed448_public.pem
new file mode 100644
index 000000000..b767109b1
--- /dev/null
+++ b/test/js/node/crypto/fixtures/ed448_public.pem
@@ -0,0 +1,4 @@
+-----BEGIN PUBLIC KEY-----
+MEMwBQYDK2VxAzoAoX/ee5+jlcU53+BbGRsGIzly0V+SZtJ/oGXY0udf84q2hTW2
+RdstLktvwpkVJOoNb7oDgc2V5ZUA
+-----END PUBLIC KEY-----
diff --git a/test/js/node/crypto/fixtures/rsa_private.pem b/test/js/node/crypto/fixtures/rsa_private.pem
new file mode 100644
index 000000000..215e5cc51
--- /dev/null
+++ b/test/js/node/crypto/fixtures/rsa_private.pem
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEAt9xYiIonscC3vz/A2ceR7KhZZlDu/5bye53nCVTcKnWd2seY
+6UAdKersX6njr83Dd5OVe1BW/wJvp5EjWTAGYbFswlNmeD44edEGM939B6Lq+/8i
+BkrTi8mGN4YCytivE24YI0D4XZMPfkLSpab2y/Hy4DjQKBq1ThZ0UBnK+9IhX37J
+u/ZoGYSlTIGIhzyaiYBh7wrZBoPczIEu6et/kN2VnnbRUtkYTF97ggcv5h+hDpUQ
+jQW0ZgOMcTc8n+RkGpIt0/iM/bTjI3Tz/gsFdi6hHcpZgbopPL630296iByyigQC
+PJVzdusFrQN5DeC+zT/nGypQkZanLb4ZspSx9QIDAQABAoIBAQCS2erYu8gyoGPi
+3E/zYgQ6ishFAZWzDWSFubwD5wSm4SSAzvViL/RbO6kqS25xR569DmLRiHzD17VI
+mJMsNECUnPrqR2TL256OJZaXrNHh3I1lUwVhEzjeKMsL4/ys+d70XPXoiocVblVs
+moDXEIGEqa48ywPvVE3Fngeuxrsq3/GCVBNiwtt0YjAOZxmKEh31UZdHO+YI+wNF
+/Z8KQCPscN5HGlR0SIQOlqMANz49aKStrevdvjS1UcpabzDEkuK84g3saJhcpAhb
+pGFmAf5GTjkkhE0rE1qDF15dSqrKGfCFtOjUeK17SIEN7E322ChmTReZ1hYGfoSV
+cdFntUINAoGBAPFKL5QeJ6wZu8R/ru11wTG6sQA0Jub2hGccPXpbnPrT+3CACOLI
+JTCLy/xTKW3dqRHj/wZEe+jUw88w7jwGb1BkWr4BI8tDvY9jQLP1jyuLWRfrxXbp
+4Z0oeBBwBeCI/ZG7FIvdDTqWxn1aj3Tmh6s4ByqEdtwrrrJPcBUNl01fAoGBAMMR
+3RGE/ca6X6xz6kgUD6TtHVhiiRJK1jm/u+q0n7i/MBkeDgTZkHYS7lPc0yIdtqaI
+Plz5yzwHnAvuMrv8LSdkjwioig2yQa3tAij8kXxqs7wN5418DMV2s1OJBrPthYPs
+bv4im2iI8V63JQS4ZMYQbckq8ABYccTpOnxXDy0rAoGBAKkvzHa+QjERhjB9GyoT
+1FhLQIsVBmYSWrp1+cGO9V6HPxoeHJzvm+wTSf/uS/FmaINL6+j4Ii4a6gWgmJts
+I6cqBtqNsAx5vjQJczf8KdxthBYa0sXTrsfktXNJKUXMqIgDtp9vazQ2vozs8AQX
+FPAAhD3SzgkJdCBBRSTt97ZfAoGAWAziKpxLKL7LnL4dzDcx8JIPIuwnTxh0plCD
+dCffyLaT8WJ9lXbXHFTjOvt8WfPrlDP/Ylxmfkw5BbGZOP1VLGjZn2DkH9aMiwNm
+bDXFPdG0G3hzQovx/9fajiRV4DWghLHeT9wzJfZabRRiI0VQR472300AVEeX4vgb
+rDBn600CgYEAk7czBCT9rHn/PNwCa17hlTy88C4vXkwbz83Oa+aX5L4e5gw5lhcR
+2ZuZHLb2r6oMt9rlD7EIDItSs+u21LOXWPTAlazdnpYUyw/CzogM/PN+qNwMRXn5
+uXFFhmlP2mVg2EdELTahXch8kWqHaCSX53yvqCtRKu/j76V31TfQZGM=
+-----END RSA PRIVATE KEY-----
diff --git a/test/js/node/crypto/fixtures/rsa_private_2048.pem b/test/js/node/crypto/fixtures/rsa_private_2048.pem
new file mode 100644
index 000000000..0e5bde2e0
--- /dev/null
+++ b/test/js/node/crypto/fixtures/rsa_private_2048.pem
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEogIBAAKCAQEArk4OqxBqU5/k0FoUDU7CpZpjz6YJEXUpyqeJmFRVZPMUv/Rc
+7U4seLY+Qp6k26T/wlQ2WJWuyY+VJcbQNWLvjJWks5HWknwDuVs6sjuTM8CfHWn1
+960JkK5Ec2TjRhCQ1KJy+uc3GJLtWb4rWVgTbbaaC5fiR1/GeuJ8JH1Q50lB3mDs
+NGIk1U5jhNaYY82hYvlbErf6Ft5njHK0BOM5OTvQ6BBv7c363WNG7tYlNw1J40du
+p9OQPo5JmXN/h+sRbdgG8iUxrkRibuGv7loh52QQgq2snznuRMdKidRfUZjCDGgw
+bgK23Q7n8VZ9Y10j8PIvPTLJ83PX4lOEA37JlwIDAQABAoIBACoL2Ev5lLyBaI+9
++vJO2nNaL9OKSMu2SJODIJTnWwYUASBg0P3Jir6/r3sgi8IUJkH5UHbD/LrQcPkA
+4X7PU9vEyUsr1efWFIvk7t7JsjOctoVA5z2Mty74arivUIe5PUadvUC6/7Zk0u6A
+CjLuJRmlH7nGNKZk+xrvgWTH+fkgc5ddbFxoGH129RcVC+ePbsi1EF60C9KbJvp1
+xjUJ5cDtNYnZ/g+ULo6ZJjRG5kUCVSI8H/Nc/DmStKsjN0isKpNGofU5ArEwywGC
+Cqxz/tr4hT2haAkVEto04ooYpqDUSqGEfPpLWL+CjFNPfCsWJ1tX5LQRvpu6eukd
+FO72oVECgYEA4+Ot7RQtGOtPeaxl3P7sbEzBZk0W/ZhCk+mzE2iYh0QXU44VtjtO
+/9CENajTklckiwlxjqBZ5NO1SiMQKBcmqkoA03x/DEujo2rMVuNPoc6ZYp1Gc4qA
+4ImkMQNsM7Swum42rKE960WoiWW7dsdEAq6vqgeApZlMU8lcKRAlOZkCgYEAw85H
+3bjF7gMatVibsWzj0zp2L4616m2v5Z3YkgohGRAvm1912DI5ku5Nmy9am57Z1EP2
+UtDOxahd/Vf6mK9lR4YEbNW1TenykViQJ6lmljOFUeZEZYYO3O+fthkyN/42l5yn
+MyUANTTb2rvt8amdRr0ARdRqWJmt5NfJzYBV+q8CgYB1ZjuZoQVCiybcRcYMPX/K
+oxgW/avUZPYXgRNx8jZxqNBjiRUCVjdybhdOFXU5NI9s2SaZFV56Fd6VHM8b+CFB
+JPKcAMzqpqTccQ5nzJ6fevFl7iP3LekKw53EakD5uiI5SMH92OsvIymZ7sDOhgUx
+ZJC2hTrvFLRPjbJerSSgMQKBgAv5iZuduT0dI30DtkHbjvNUF/ZAnA+CNcetJ5mG
+1Q9bVg4CgIqAR9UcjdJ3yurJhDjfDylxa7Pa4CSmRMUhtOfy4kJlr3jcXeFVsTs7
+uPJmpDimBHjRAgew/+t7Dv8tpNkQ04jlMmYOnYN7CspEvUGePW4H15kjjOb563WN
+67QxAoGAdhJPaHVtDBUrobn50ORVkVNJVZPBhEDbR6tNtHsgEevH7iYjxAdxEeUa
+c9S2iV9lir3hkrQceiYWAADcphWfO1HyP5Uld4sJzYiEGbSM7a0zRQjYlQgXFbZo
+SAc6Gok78kwECPwpmeH4lpGVeKNmzEteSBVYxGb9b6C/SSsu7l0=
+-----END RSA PRIVATE KEY-----
diff --git a/test/js/node/crypto/fixtures/rsa_private_4096.pem b/test/js/node/crypto/fixtures/rsa_private_4096.pem
new file mode 100644
index 000000000..4177b9ef9
--- /dev/null
+++ b/test/js/node/crypto/fixtures/rsa_private_4096.pem
@@ -0,0 +1,51 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIJKAIBAAKCAgEAxeStwofbjtZuol4lwKn1w08AzcSNLHfCqNFHa+W7er8is7LQ
+sPljtPT4yn4lsao83ngHFvSC3tbMiRNDpUHYqH2wBuUkuOmCtYkZLi0307H0CwcV
+V6W5P3tNEt80IJ+PqlRxtTknezUtbOasbIi/aornVWG+psgqDGrFZ4oTsWtiE0Sv
+i7sDqN5E2dijmH/YYnlnwqszgzHdtAnARp1bG34E64sqWCmLoGCfPdHtym/CSdxO
+LOsDV15jrwODZQ/TJZ5thkwKZRxu7g9fwlhA1PiI5WDP4reXNaqa2bSgrzpAljQE
+xYs4N0L7okSVOJQX9BEaoWtq8NLU8MpMdGoHNDU0Xr60Lfr58Z5qn8RGEvlTxoCb
+PJzPV2zgzD/lmEqft6NnfTclveA3sd8xSrOBUn4o3S8hS0b9Su7PBukHjM96/e0R
+eoIshSwXlQTLr2Ft8KwupyPm1ltNcTDtjqHcIWU6Bg+kPy9mxSVtGGZYAPtqGzNB
+A/m+oOja/OSPxAblPdln691DaDuZs5nuZCGwGcLaJWgiyoqvXAcyXDZFyH4OZZh8
+rsBLKbnFXHZ/ziG0cAozEygZEPJappw8Lx/ady7WL/SJjxooiKapc7Bnfy8eSLV3
++XAKxhLW/MQ6ChJ+e/8ExAY02ca4MpCvqwIk9TfV6FM8pWGqHzQFj0v3NL0CAwEA
+AQKCAgBTb8eTbZS09NRQwUFJql9kqbq9B1I+nYAFjbd/Vq1lY5FOEubKt1vCwEbl
+mapq7kwbwJ+8nftP2WEDqouq8chXwialwZdqH4ps4BEt1wLizvUGcUYeXlFs4p/s
+hQ+FccExH8mRjzeGSzWL5PZuDHoogchnx36K83pHIf15Wk5TT+NaHGunjoJMgOqm
+ryDK+5xQaL/G5Egj2LKRZksbet0fClMovNRtt5aXWCXL+uc3o0dXvPt5FN2jyLhe
+4ixUQAfWpKWpKgZ3+zUKSpElb/Bl2yRdEiSUgrPOfNAtWmsldnok2mnooHpjUmqm
+UCRaZpZy4YNI6/F6+Gmv3Ju/ubSvHzoxQLlvgUqWAnVshivF1TJImHSIiLIvBKPp
+29SD6maWIT1DC9sKC4E1gq7VO4762l1//zEOAY7XK0Z7LrbZO4WXHnsgFOpGthQ3
+g9Qi/SeM6mb5xEJTBUBTmkhGs1x8jolzca30mqv8T63W4PXkXHmZdK7vyH5useiI
+s0eGUeaYK892WgfxCBo24JCNQiAcH/wTwV4l4yROqeH2V4ShbIYmCzla++7vsPYW
+hAwQR9eH0+4ogTkaMQrm16plZk0ezVX9BKK8KTnd4G9/T18VstQbiowF2/cKnGKC
+OqrmoR2vHOksQdUJVmnwCRqU1symBxhY0GSIps98v+lUYExKQQKCAQEA/uVYE2/H
+eNcV/uWAI9LspANXHJE33TFMZ8SuyOYtp3MYJizmQ1uT7Om2LEanDnNiz+fAQhrE
+vo1sDIF9xOAde2qjIH+iDzcLvFPgC3gkQspFjU31M9OO5xAjzBxfL3KDiG2MtmTR
+hNuKJX56eCOqkEp6WKaWOA35ccaKYHxNzMS49weCv95ZPpR9q0J1sgzD7HtVh4yu
+XI01/BC8F0RmYjtsuUo+PmB6sO2K94uqqo0GPUos7Mhgrbff3L36EkOPgmRiA1AV
+Zy1sKKxUKspGQ3m1fg+CA/+GZGckvYkVot1lFrwmrS2dok8EhT1HcVJde+++jx7z
+JsRLgFRvKHXklwKCAQEAxsAfxIQjjjKmuyJCzIvxG7lnuzovdy4OEdSuJL4yK5m3
+4BHJHn+yHeRIcrDnJKUTUYffcH/OjOnJS94BA6wH1tEuvGQz6LV6UpwApZ1M/2md
+nP0eC2L2JtSRL8mdxfyqXDloWMpD7rncBZ6ChLEZ6sWYa6WBQTARmPVePyUpNNG2
+qymxN3/vRBGGBunD3j6zX0M0szWK5iU+qsYDy3KzCKG8FU7XxwzRbP7iARRD5Hpt
+Zmy2W52EJg1uhmlVXJMm32SEBfrD2oDmlnjAqaZdqi5Mq2e4uB3dhM9RwJppSALG
+BY6k9DeanAFbOlawMJri2pk7B0phCn+DN2pg0+W3ywKCAQBeTwzfZCQxmaMRxGg8
+2PWlWXcJotFAjdTvL95bho6tve/ZcBNiKKf6qB43E40L07VjpyODUdQpjLnFhsO5
+7BH8b+AbTh3v8zXsYDwtAi6oZ56EQavPmR7ubxJPms+9BmmUOLQvZ+39ch0S8lDt
+0oRxDp1l330FEGaSqhrYyCUg9khZXfYKd4IdnWNB0j0pu39iJ9/lXy/EHpsywB5X
+nX8kKUh45fdRrPC4NauNG6fxomwEkUU99oWOwNGbIs87orOeUvXQs/i3TB8QjXI2
+wtBsdsOn+KTqRci7rU3ysp3GvJOCbesBeDcyrnnFsn6Udx0Plgyzd4gPd+FXgeX+
+2l/RAoIBAH81FKAY2xD2RlTb1tlIcGeIQWZKFXs4VPUApP0LZt0VI+UcPRdyL7SG
+GgCeTTLdHQI/7rj4dGEoeRg/3XJWNyY8+KbHk5nMHaCmDJvzlAaduK10LDipfFba
+Epr9dif0Ua15aNn7i4NOHg7Sp0L6f1YOZkHvykzI0VqPIWVVCYyu9TWUF8Mn9SIh
+/SCLmjuy8ed1AlP5Xw9yoyt2VZNvtDtAGTuiHOVfxOL4N/rs149y9HZr+kOlC6G3
+Uxhgbqwz2tt8YCvblmNRwURpwRZUTvrPa28Bke713oRUlUSrD9txOwDvjZBpzmEv
+VQ5/0YEqgSvcizVdW8L2XiunwJWfIAUCggEBALr4RF9TYa37CImZOs+vJ8FGRKMz
+h1EUwO2PvuITvkTtu/7E4IjyxAo5dkAokkWQCGABciiDJJEYUWqcUX45qQChOgtm
+NU2od6f9tgyDFxN5KS8cE32NXV3rJXs3bBZmIKLSPETf3uIPuEpFPjpdR5v5jlV+
+TDjH4RrItE3hDCvypTXhXXMmWp3VfYbgEfIP03uR2iIhL+/g3BUqbrywPEsTViSN
+NM/uBDQyamXLXB1bQ2I/Ob41I82PD1iNCqGi7ZvZ3eVYGgUTQyw6Q4O8glTPP9cC
+SFVXwE9gHbLe8TqfTZCWrM6crGX6Bb6hV2tqNsA+7J69U9NGuw5GNqXjafU=
+-----END RSA PRIVATE KEY-----
diff --git a/test/js/node/crypto/fixtures/rsa_private_encrypted.pem b/test/js/node/crypto/fixtures/rsa_private_encrypted.pem
new file mode 100644
index 000000000..f1914289e
--- /dev/null
+++ b/test/js/node/crypto/fixtures/rsa_private_encrypted.pem
@@ -0,0 +1,30 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: AES-256-CBC,DB3D20E60E8FDC3356BD79712FF8EF7E
+
+K+vu0U3IFTJBBi6zW5Zng80O1jXq/ZmlOFs/j/SQpPwfW1Do9i/Dwa7ntBlTwrCm
+sd3IIPgu2ikfLwxvbxsZN540oCaCqaZ/bmmyzH3MyVDA9MllUu+X8+Q3ATzcYa9R
+U5XfF5DAXsSRnstCbmKagWVQpO0oX8k3ratfny6Ixq86Y82tK8+o5YiBFq1kqa+9
+4yat7IWQbqV5ifUtUPCHZwEqBt+WKazX05BqERjkckHdpfaDrBvSSPXTwoLm6uRR
+ktkUVpO4tHMZ4VlcTfFtpz8gdYYod0nM6vz26hvbESHSwztSgMhmKdsE5eqmYfgu
+F4WkEN4bqAiPjKK3jnUKPt/vg2oKYFQlVYFl9QnBjiRqcQTi3e9lwn1hI7uoMb6g
+HuaCc57JJHPN/ZLP3ts4ZxFbwUjTGioh5Zh6WozG3L3+Ujwq/sDrAskRyzdcuP7I
+Rs3oLbHY03OHyg8IbxR5Iu89l6FLqnR45yvbxXtZ7ImGOPM5Z9pB1CzDhGDx2F6g
+J/Kf/7ZF2DmYUVbVKDfESEDhRfuMAVzhasDPTRqipSA5QvJVQY+J/6QDPrNNmHVB
+4e4ouHIDWERUf0t1Be7THvP3X8OJozj2HApzqa5ZCaJDo8eaL8TCD5uH75ID5URJ
+VscGHaUXT8/sxfHi1x8BibW5W5J/akFsnrnJU/1BZgGznIxjf5tKfHGppSIVdlKP
+3ghYNmEIFPNJ6cxuUA0D2IOV4uO3FTCU6seIzvJhYkmXnticcZYGtmGxXKrodtzS
+J1YuaNkkO/YRZah285lQ6QCIhCFo4Oa4ILjgoTQISuw7nQj5ESyncauzLUBXKX0c
+XDUej64KNTvVF9UXdG48fYvNmSZWCnTye4UmPu17FmwpVra38U+EdoLyWyMIAI5t
+rP6Hhgc9BxOo41Im9QpTcAPfKAknP8Rbm3ACJG5T9FKq/c29d1E//eFR6SL51e/a
+yWdCgJN/FJOAX60+erPwoVoRFEttAeDPkklgFGdc8F4LIYAig9gEZ92ykFFz3fWz
+jIcUVLrL+IokFbPVUBoMihqVyMQsWH+5Qq9wjxf6EDIf0BVtm9U4BJoOkPStFIfF
+Kof7OVv7izyL8R/GIil9VQs9ftwkIUPeXx2Hw0bE3HJ3C8K4+mbLg3tKhGnBDU5Z
+Xm5mLHoCRBa3ZRFWZtigX7POszdLAzftYo8o65Be4OtPS+tQAORk9gHsXATv7dDB
+OGw61x5KA55LHVHhWaRvu3J8E7nhxw0q/HskyZhDC+Y+Xs6vmQSb4nO4ET4NYX1P
+m3PMdgGoqRDJ2jZw4eoQdRKCM0EHSepSAYpO1tcAXhPZS4ITogoRgPpVgOebEQUL
+nKNeNu/BxMSH/IH15jjDLF3TiEoguF9xdTaCxIBzE1SFpVO0u9m9vXpWdPThVgsb
+VcEI487p7v9iImP3BYPT8ZYvytC26EH0hyOrwhahTvTb4vXghkLIyvPUg1lZHc6e
+aPHb2AzYAHLnp/ehDQGKWrCOJ1JE2vBv8ZkLa+XZo7YASXBRZitPOMlvykEyzxmR
+QAmNhKGvFmeM2mmHAp0aC03rgF3lxNsXQ1CyfEdq3UV9ReSnttq8gtrJfCwxV+wY
+-----END RSA PRIVATE KEY-----
diff --git a/test/js/node/crypto/fixtures/rsa_pss_private_2048.pem b/test/js/node/crypto/fixtures/rsa_pss_private_2048.pem
new file mode 100644
index 000000000..ffca137a7
--- /dev/null
+++ b/test/js/node/crypto/fixtures/rsa_pss_private_2048.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvAIBADALBgkqhkiG9w0BAQoEggSoMIIEpAIBAAKCAQEAy4OMdS84PlgI5CRL
+bdbud9Ru7vprFr2YNNUmdT7D3YgApiv8CjzKXLiVDnbMET+lwmtag/EcZsxVCKov
+su30pYASBriHOiMVYui9+ZaJoQ9yI6lOjG1RbuUBJXNSjHBJxqBqmcgZOb1mdRr/
+eXzpAMWJ3hfuLojU2+zUSJ3/rvepepcLFG2q9nA0+PJskJ7Pnh3L0ydnv3U3hduM
+n5OVfm/Jx1FPyZpD184tJff+N+MY3s3hIcfuOnL9Pl4RPGeaTC4T1o460NaG6bG7
+c2Whg6NOaVgaFIaiNbrTTNCpVjeTyalsTXYlQQ3hiKjst0Q7pfFEkJDo8qiqLad1
+Msl59wIDAQABAoIBAQC6G8aqs0/f02nuGDLSc6cH9kCsUlz0ItW6GuJcfdVoFSNi
+0v5d7lGwkSveWk0ryOSw8rOHzUqHx3xLvDZ6jpkXcBMMClu/kq3QEb8JK90YaKOc
+cQvf52h83Pc7ZEatH1KYTcKudwp6fvXfSZ0vYEdD6WG2tHOgIollxSIsdjCHs1qi
+7baNHdK9T4DveuEZNcZ+LraZ1haHmFeqIPcy+KvpGuTaLCg5FPhH2jsIkw9apr7i
+iFLi+IJ7S5Bn/8XShmJWk4hPyx0jtIkC5r2iJnHf4x+XYWZfdo7oew3Dg6Pa7T6r
+I164Nnaw0u0LvO4gQdvYaJ/j9A602nHTp7Tsq8chAoGBAOtVHgIqpmdzwR5KjotW
+LuGXDdO9X6Xfge9ca2MlWH1jOj+zqEV7JtrjnZAzzOgP2kgqzpIR71Njs8wkaxTJ
+Tle0Ke6R/ghU9YOQgRByKjqJfQXHZnYFPsMg0diNYLroJ4SG8LO4+2SygTYZ4eKL
+qU0bda3QvQ7FL+rTNQBy01b9AoGBAN1jEQI80JxCT7AMvXE6nObIhbkASHte4yOE
+1CBwcOuBEGcuvMOvQVMzKITgea6+kgsu4ids4dM5PTPapQgpKqIIQ2/eSesaf56g
+73clGGSTPHJP0v+EfKg4+GYJf8o2swT0xDHkgWLgjjdsncB9hATc2j6DvHeau18d
+pgCLz9kDAoGAXl/SGvhTp2UqayVnKMW1I07agrGNLA4II5+iiS4u4InskCNSNhr/
+KATj6TJ82AuTdCGGmdmLapuvPQzVzI42VsGvlzcA8wJvOwW2XIwMF1GPy8N9eZL8
+6m+89+Uqh4oWXvVmjgx+9JEJdFLI3Xs4t+1tMfll+AhoAPoWZUmnK1kCgYAvEBxR
+iXQfg8lE97BeHcO1G/OxfGnsMCPBLT+bFcwrhGhkRv9B6kPM2BdJCB9WEpUhY3oY
+P4FSUdy85UIoFfhGMdOEOJEmNZ/jrPq7LVueJd63vlhwkU2exV2o82QDLNWpvA7p
+PFZ1Gp+hEKoIfaZPElQi7gZmtrIWaksb2pz42QKBgQCct9NP2qJfqeS4206RDnfv
+M238/O2lNhLWdSwY0g+tcN+I1sGs3+4vvrm95cxwAmXZyIM11wjdMcAPNxibodY7
+vufsebPHDBA0j0yuTjGkXefUKd1GdO88i5fppzxB7prDX9//DsWWrFhIMMRNYe0Q
+aeHd/NPuHcjZKcnaVBgukQ==
+-----END PRIVATE KEY-----
diff --git a/test/js/node/crypto/fixtures/rsa_pss_public_2048.pem b/test/js/node/crypto/fixtures/rsa_pss_public_2048.pem
new file mode 100644
index 000000000..ade38f20a
--- /dev/null
+++ b/test/js/node/crypto/fixtures/rsa_pss_public_2048.pem
@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIDALBgkqhkiG9w0BAQoDggEPADCCAQoCggEBAMuDjHUvOD5YCOQkS23W7nfU
+bu76axa9mDTVJnU+w92IAKYr/Ao8yly4lQ52zBE/pcJrWoPxHGbMVQiqL7Lt9KWA
+Ega4hzojFWLovfmWiaEPciOpToxtUW7lASVzUoxwScagapnIGTm9ZnUa/3l86QDF
+id4X7i6I1Nvs1Eid/673qXqXCxRtqvZwNPjybJCez54dy9MnZ791N4XbjJ+TlX5v
+ycdRT8maQ9fOLSX3/jfjGN7N4SHH7jpy/T5eETxnmkwuE9aOOtDWhumxu3NloYOj
+TmlYGhSGojW600zQqVY3k8mpbE12JUEN4Yio7LdEO6XxRJCQ6PKoqi2ndTLJefcC
+AwEAAQ==
+-----END PUBLIC KEY-----
diff --git a/test/js/node/crypto/fixtures/rsa_public.pem b/test/js/node/crypto/fixtures/rsa_public.pem
new file mode 100644
index 000000000..8c30cfa52
--- /dev/null
+++ b/test/js/node/crypto/fixtures/rsa_public.pem
@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt9xYiIonscC3vz/A2ceR
+7KhZZlDu/5bye53nCVTcKnWd2seY6UAdKersX6njr83Dd5OVe1BW/wJvp5EjWTAG
+YbFswlNmeD44edEGM939B6Lq+/8iBkrTi8mGN4YCytivE24YI0D4XZMPfkLSpab2
+y/Hy4DjQKBq1ThZ0UBnK+9IhX37Ju/ZoGYSlTIGIhzyaiYBh7wrZBoPczIEu6et/
+kN2VnnbRUtkYTF97ggcv5h+hDpUQjQW0ZgOMcTc8n+RkGpIt0/iM/bTjI3Tz/gsF
+di6hHcpZgbopPL630296iByyigQCPJVzdusFrQN5DeC+zT/nGypQkZanLb4ZspSx
+9QIDAQAB
+-----END PUBLIC KEY-----
diff --git a/test/js/node/crypto/fixtures/rsa_public_2048.pem b/test/js/node/crypto/fixtures/rsa_public_2048.pem
new file mode 100644
index 000000000..0c80ceb4d
--- /dev/null
+++ b/test/js/node/crypto/fixtures/rsa_public_2048.pem
@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArk4OqxBqU5/k0FoUDU7C
+pZpjz6YJEXUpyqeJmFRVZPMUv/Rc7U4seLY+Qp6k26T/wlQ2WJWuyY+VJcbQNWLv
+jJWks5HWknwDuVs6sjuTM8CfHWn1960JkK5Ec2TjRhCQ1KJy+uc3GJLtWb4rWVgT
+bbaaC5fiR1/GeuJ8JH1Q50lB3mDsNGIk1U5jhNaYY82hYvlbErf6Ft5njHK0BOM5
+OTvQ6BBv7c363WNG7tYlNw1J40dup9OQPo5JmXN/h+sRbdgG8iUxrkRibuGv7loh
+52QQgq2snznuRMdKidRfUZjCDGgwbgK23Q7n8VZ9Y10j8PIvPTLJ83PX4lOEA37J
+lwIDAQAB
+-----END PUBLIC KEY-----
diff --git a/test/js/node/crypto/fixtures/rsa_public_4096.pem b/test/js/node/crypto/fixtures/rsa_public_4096.pem
new file mode 100644
index 000000000..4fd0bbc1c
--- /dev/null
+++ b/test/js/node/crypto/fixtures/rsa_public_4096.pem
@@ -0,0 +1,14 @@
+-----BEGIN PUBLIC KEY-----
+MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxeStwofbjtZuol4lwKn1
+w08AzcSNLHfCqNFHa+W7er8is7LQsPljtPT4yn4lsao83ngHFvSC3tbMiRNDpUHY
+qH2wBuUkuOmCtYkZLi0307H0CwcVV6W5P3tNEt80IJ+PqlRxtTknezUtbOasbIi/
+aornVWG+psgqDGrFZ4oTsWtiE0Svi7sDqN5E2dijmH/YYnlnwqszgzHdtAnARp1b
+G34E64sqWCmLoGCfPdHtym/CSdxOLOsDV15jrwODZQ/TJZ5thkwKZRxu7g9fwlhA
+1PiI5WDP4reXNaqa2bSgrzpAljQExYs4N0L7okSVOJQX9BEaoWtq8NLU8MpMdGoH
+NDU0Xr60Lfr58Z5qn8RGEvlTxoCbPJzPV2zgzD/lmEqft6NnfTclveA3sd8xSrOB
+Un4o3S8hS0b9Su7PBukHjM96/e0ReoIshSwXlQTLr2Ft8KwupyPm1ltNcTDtjqHc
+IWU6Bg+kPy9mxSVtGGZYAPtqGzNBA/m+oOja/OSPxAblPdln691DaDuZs5nuZCGw
+GcLaJWgiyoqvXAcyXDZFyH4OZZh8rsBLKbnFXHZ/ziG0cAozEygZEPJappw8Lx/a
+dy7WL/SJjxooiKapc7Bnfy8eSLV3+XAKxhLW/MQ6ChJ+e/8ExAY02ca4MpCvqwIk
+9TfV6FM8pWGqHzQFj0v3NL0CAwEAAQ==
+-----END PUBLIC KEY-----
diff --git a/test/js/node/crypto/fixtures/x25519_private.pem b/test/js/node/crypto/fixtures/x25519_private.pem
new file mode 100644
index 000000000..926c4e3a2
--- /dev/null
+++ b/test/js/node/crypto/fixtures/x25519_private.pem
@@ -0,0 +1,3 @@
+-----BEGIN PRIVATE KEY-----
+MC4CAQAwBQYDK2VuBCIEIJi/yFpueUawC1BkXyWM8ONIBGFjL7UZHrD/Zo/KPDpn
+-----END PRIVATE KEY-----
diff --git a/test/js/node/crypto/fixtures/x25519_public.pem b/test/js/node/crypto/fixtures/x25519_public.pem
new file mode 100644
index 000000000..e2d756bd1
--- /dev/null
+++ b/test/js/node/crypto/fixtures/x25519_public.pem
@@ -0,0 +1,3 @@
+-----BEGIN PUBLIC KEY-----
+MCowBQYDK2VuAyEAaSb8Q+RndwfNnPeOYGYPDUN3uhAPnMLzXyfi+mqfhig=
+-----END PUBLIC KEY-----
diff --git a/test/js/node/crypto/fixtures/x448_private.pem b/test/js/node/crypto/fixtures/x448_private.pem
new file mode 100644
index 000000000..61cd52c39
--- /dev/null
+++ b/test/js/node/crypto/fixtures/x448_private.pem
@@ -0,0 +1,4 @@
+-----BEGIN PRIVATE KEY-----
+MEYCAQAwBQYDK2VvBDoEOLTDbazv6vHZWOmODQ3kk8TUOQgApB4j75rpInT5zSLl
+/xJHK8ixF7f+4uo+mGTCrK1sktI5UmCZ
+-----END PRIVATE KEY-----
diff --git a/test/js/node/crypto/fixtures/x448_public.pem b/test/js/node/crypto/fixtures/x448_public.pem
new file mode 100644
index 000000000..6475d0438
--- /dev/null
+++ b/test/js/node/crypto/fixtures/x448_public.pem
@@ -0,0 +1,4 @@
+-----BEGIN PUBLIC KEY-----
+MEIwBQYDK2VvAzkAioHSHVpTs6hMvghosEJDIR7ceFiE3+Xccxati64oOVJ7NWjf
+ozE7ae31PXIUFq6cVYgvSKsDFPA=
+-----END PUBLIC KEY-----
diff --git a/test/js/node/dns/node-dns.test.js b/test/js/node/dns/node-dns.test.js
index 5c08f128f..1988e9155 100644
--- a/test/js/node/dns/node-dns.test.js
+++ b/test/js/node/dns/node-dns.test.js
@@ -1,4 +1,4 @@
-import { expect, test } from "bun:test";
+import { describe, expect, test, it } from "bun:test";
import * as dns from "node:dns";
import * as dns_promises from "node:dns/promises";
import * as fs from "node:fs";
@@ -102,6 +102,15 @@ test("dns.resolveSoa (bun.sh)", done => {
});
});
+test("dns.resolveSoa (empty string)", done => {
+ dns.resolveSoa("", (err, result) => {
+ expect(err).toBeNull();
+ // one of root server
+ expect(result).not.toBeUndefined();
+ done(err);
+ });
+});
+
test("dns.resolveNaptr (naptr.socketify.dev)", done => {
dns.resolveNaptr("naptr.socketify.dev", (err, results) => {
expect(err).toBeNull();
@@ -132,7 +141,7 @@ test("dns.resolveMx (bun.sh)", done => {
expect(results instanceof Array).toBe(true);
const priority = results[0].priority;
expect(priority >= 0 && priority < 65535).toBe(true);
- expect(results[0].exchange.includes(".registrar-servers.com")).toBe(true);
+ expect(results[0].exchange.includes("aspmx.l.google.com")).toBe(true);
done(err);
});
});
@@ -146,6 +155,32 @@ test("dns.resolveNs (bun.sh) ", done => {
});
});
+test("dns.resolveNs (empty string) ", done => {
+ dns.resolveNs("", (err, results) => {
+ expect(err).toBeNull();
+ expect(results instanceof Array).toBe(true);
+ // root servers
+ expect(results.sort()).toStrictEqual(
+ [
+ "e.root-servers.net",
+ "h.root-servers.net",
+ "l.root-servers.net",
+ "i.root-servers.net",
+ "a.root-servers.net",
+ "d.root-servers.net",
+ "c.root-servers.net",
+ "b.root-servers.net",
+ "j.root-servers.net",
+ "k.root-servers.net",
+ "g.root-servers.net",
+ "m.root-servers.net",
+ "f.root-servers.net",
+ ].sort(),
+ );
+ done(err);
+ });
+});
+
test("dns.resolvePtr (ptr.socketify.dev)", done => {
dns.resolvePtr("ptr.socketify.dev", (err, results) => {
expect(err).toBeNull();
@@ -268,3 +303,105 @@ test("dns.promises.reverse", async () => {
expect(hostnames).toContain("one.one.one.one");
}
});
+
+describe("test invalid arguments", () => {
+ it.each([
+ // TODO: dns.resolveAny is not implemented yet
+ ["dns.resolveCname", dns.resolveCname],
+ ["dns.resolveCaa", dns.resolveCaa],
+ ["dns.resolveMx", dns.resolveMx],
+ ["dns.resolveNaptr", dns.resolveNaptr],
+ ["dns.resolveNs", dns.resolveNs],
+ ["dns.resolvePtr", dns.resolvePtr],
+ ["dns.resolveSoa", dns.resolveSoa],
+ ["dns.resolveSrv", dns.resolveSrv],
+ ["dns.resolveTxt", dns.resolveTxt],
+ ])("%s", (_, fn, done) => {
+ fn("a".repeat(2000), (err, results) => {
+ try {
+ expect(err).not.toBeNull();
+ expect(results).toBeUndefined();
+ done();
+ } catch (e) {
+ done(e);
+ }
+ });
+ });
+
+ it("dns.lookupService", async () => {
+ expect(() => {
+ dns.lookupService("", 443, (err, hostname, service) => {});
+ }).toThrow("Expected address to be a non-empty string for 'lookupService'.");
+ expect(() => {
+ dns.lookupService("google.com", 443, (err, hostname, service) => {});
+ }).toThrow("Expected address to be a invalid address for 'lookupService'.");
+ });
+});
+
+describe("dns.lookupService", () => {
+ it.each([
+ ["1.1.1.1", 53, ["one.one.one.one", "domain"]],
+ ["2606:4700:4700::1111", 53, ["one.one.one.one", "domain"]],
+ ["2606:4700:4700::1001", 53, ["one.one.one.one", "domain"]],
+ ["1.1.1.1", 80, ["one.one.one.one", "http"]],
+ ["1.1.1.1", 443, ["one.one.one.one", "https"]],
+ ])("lookupService(%s, %d)", (address, port, expected, done) => {
+ dns.lookupService(address, port, (err, hostname, service) => {
+ try {
+ expect(err).toBeNull();
+ expect(hostname).toStrictEqual(expected[0]);
+ expect(service).toStrictEqual(expected[1]);
+ done();
+ } catch (err) {
+ done(err);
+ }
+ });
+ });
+
+ it("lookupService(255.255.255.255, 443)", done => {
+ dns.lookupService("255.255.255.255", 443, (err, hostname, service) => {
+ if (process.platform == "darwin") {
+ try {
+ expect(err).toBeNull();
+ expect(hostname).toStrictEqual("broadcasthost");
+ expect(service).toStrictEqual("https");
+ done();
+ } catch (err) {
+ done(err);
+ }
+ } else {
+ try {
+ expect(err).not.toBeNull();
+ expect(hostname).toBeUndefined();
+ expect(service).toBeUndefined();
+ done();
+ } catch (err) {
+ done(err);
+ }
+ }
+ });
+ });
+
+ it.each([
+ ["1.1.1.1", 53, ["one.one.one.one", "domain"]],
+ ["2606:4700:4700::1111", 53, ["one.one.one.one", "domain"]],
+ ["2606:4700:4700::1001", 53, ["one.one.one.one", "domain"]],
+ ["1.1.1.1", 80, ["one.one.one.one", "http"]],
+ ["1.1.1.1", 443, ["one.one.one.one", "https"]],
+ ])("promises.lookupService(%s, %d)", async (address, port, expected) => {
+ const [hostname, service] = await dns.promises.lookupService(address, port);
+ expect(hostname).toStrictEqual(expected[0]);
+ expect(service).toStrictEqual(expected[1]);
+ });
+});
+
+// Deprecated reference: https://nodejs.org/api/deprecations.html#DEP0118
+describe("lookup deprecated behavior", () => {
+ it.each([undefined, false, null, NaN, ""])("dns.lookup", domain => {
+ dns.lookup(domain, (error, address, family) => {
+ expect(error).toBeNull();
+ expect(address).toBeNull();
+ expect(family).toBe(4);
+ });
+ });
+});
diff --git a/test/js/node/events/event-emitter.test.ts b/test/js/node/events/event-emitter.test.ts
index 366bbb03a..687e90910 100644
--- a/test/js/node/events/event-emitter.test.ts
+++ b/test/js/node/events/event-emitter.test.ts
@@ -183,6 +183,21 @@ describe("EventEmitter", () => {
emitter.on("wow", () => done());
setTimeout(() => emitter.emit("wow"), 1);
});
+
+ test("emit multiple values", () => {
+ const emitter = new EventEmitter();
+
+ const receivedVals: number[] = [];
+ emitter.on("multiple-vals", (val1, val2, val3) => {
+ receivedVals[0] = val1;
+ receivedVals[1] = val2;
+ receivedVals[2] = val3;
+ });
+
+ emitter.emit("multiple-vals", 1, 2, 3);
+
+ expect(receivedVals).toEqual([1, 2, 3]);
+ });
});
test("addListener return type", () => {
@@ -278,6 +293,60 @@ describe("EventEmitter", () => {
expect(order).toEqual([3, 2, 1, 4, 1, 4]);
});
+ test("prependListener in callback", () => {
+ const myEmitter = new EventEmitter();
+ const order: number[] = [];
+
+ myEmitter.on("foo", () => {
+ order.push(1);
+ });
+
+ myEmitter.once("foo", () => {
+ myEmitter.prependListener("foo", () => {
+ order.push(2);
+ });
+ });
+
+ myEmitter.on("foo", () => {
+ order.push(3);
+ });
+
+ myEmitter.emit("foo");
+
+ expect(order).toEqual([1, 3]);
+
+ myEmitter.emit("foo");
+
+ expect(order).toEqual([1, 3, 2, 1, 3]);
+ });
+
+ test("addListener in callback", () => {
+ const myEmitter = new EventEmitter();
+ const order: number[] = [];
+
+ myEmitter.on("foo", () => {
+ order.push(1);
+ });
+
+ myEmitter.once("foo", () => {
+ myEmitter.addListener("foo", () => {
+ order.push(2);
+ });
+ });
+
+ myEmitter.on("foo", () => {
+ order.push(3);
+ });
+
+ myEmitter.emit("foo");
+
+ expect(order).toEqual([1, 3]);
+
+ myEmitter.emit("foo");
+
+ expect(order).toEqual([1, 3, 1, 3, 2]);
+ });
+
test("listeners", () => {
const myEmitter = new EventEmitter();
const fn = () => {};
@@ -288,18 +357,26 @@ describe("EventEmitter", () => {
expect(myEmitter.listeners("foo")).toEqual([fn, fn2]);
myEmitter.off("foo", fn2);
expect(myEmitter.listeners("foo")).toEqual([fn]);
+ const fn3 = () => {};
+ myEmitter.once("foo", fn3);
+ expect(myEmitter.listeners("foo")).toEqual([fn, fn3]);
});
test("rawListeners", () => {
const myEmitter = new EventEmitter();
const fn = () => {};
myEmitter.on("foo", fn);
- expect(myEmitter.listeners("foo")).toEqual([fn]);
+ expect(myEmitter.rawListeners("foo")).toEqual([fn]);
const fn2 = () => {};
myEmitter.on("foo", fn2);
- expect(myEmitter.listeners("foo")).toEqual([fn, fn2]);
+ expect(myEmitter.rawListeners("foo")).toEqual([fn, fn2]);
myEmitter.off("foo", fn2);
- expect(myEmitter.listeners("foo")).toEqual([fn]);
+ expect(myEmitter.rawListeners("foo")).toEqual([fn]);
+ const fn3 = () => {};
+ myEmitter.once("foo", fn3);
+ const rawListeners: (Function & { listener?: Function })[] = myEmitter.rawListeners("foo");
+ // rawListeners() returns onceWrappers as well
+ expect([rawListeners[0], rawListeners[1].listener]).toEqual([fn, fn3]);
});
test("eventNames", () => {
diff --git a/test/js/node/fs/fs.test.ts b/test/js/node/fs/fs.test.ts
index 8ea9522e1..791386956 100644
--- a/test/js/node/fs/fs.test.ts
+++ b/test/js/node/fs/fs.test.ts
@@ -136,6 +136,35 @@ describe("copyFileSync", () => {
expect(Bun.hash(readFileSync(tempdir + "/copyFileSync.dest.blob"))).toBe(Bun.hash(buffer.buffer));
});
+ it("constants are right", () => {
+ expect(fs.constants.COPYFILE_EXCL).toBe(1);
+ expect(fs.constants.COPYFILE_FICLONE).toBe(2);
+ expect(fs.constants.COPYFILE_FICLONE_FORCE).toBe(4);
+ });
+
+ it("FICLONE option does not error ever", () => {
+ const tempdir = `${tmpdir()}/fs.test.js/${Date.now()}.FICLONE/1234/hi`;
+ expect(existsSync(tempdir)).toBe(false);
+ expect(tempdir.includes(mkdirSync(tempdir, { recursive: true })!)).toBe(true);
+
+ // that don't exist
+ copyFileSync(import.meta.path, tempdir + "/copyFileSync.js", fs.constants.COPYFILE_FICLONE);
+ copyFileSync(import.meta.path, tempdir + "/copyFileSync.js", fs.constants.COPYFILE_FICLONE);
+ copyFileSync(import.meta.path, tempdir + "/copyFileSync.js", fs.constants.COPYFILE_FICLONE);
+ });
+
+ it("COPYFILE_EXCL works", () => {
+ const tempdir = `${tmpdir()}/fs.test.js/${Date.now()}.COPYFILE_EXCL/1234/hi`;
+ expect(existsSync(tempdir)).toBe(false);
+ expect(tempdir.includes(mkdirSync(tempdir, { recursive: true })!)).toBe(true);
+
+ // that don't exist
+ copyFileSync(import.meta.path, tempdir + "/copyFileSync.js", fs.constants.COPYFILE_EXCL);
+ expect(() => {
+ copyFileSync(import.meta.path, tempdir + "/copyFileSync.js", fs.constants.COPYFILE_EXCL);
+ }).toThrow();
+ });
+
if (process.platform === "linux") {
describe("should work when copyFileRange is not available", () => {
it("on large files", () => {
@@ -212,7 +241,7 @@ describe("copyFileSync", () => {
describe("mkdirSync", () => {
it("should create a directory", () => {
- const tempdir = `${tmpdir()}/fs.test.js/${Date.now()}/1234/hi`;
+ const tempdir = `${tmpdir()}/fs.test.js/${Date.now()}.mkdirSync/1234/hi`;
expect(existsSync(tempdir)).toBe(false);
expect(tempdir.includes(mkdirSync(tempdir, { recursive: true })!)).toBe(true);
expect(existsSync(tempdir)).toBe(true);
@@ -953,6 +982,64 @@ describe("stat", () => {
} catch (e: any) {
expect(e.code).toBe("ENOENT");
}
+
+ try {
+ statSync("");
+ throw "statSync should throw";
+ } catch (e: any) {
+ expect(e.code).toBe("ENOENT");
+ }
+ });
+});
+
+describe("exist", () => {
+ it("should return false with invalid path", () => {
+ expect(existsSync("/pathNotExist")).toBe(false);
+ });
+
+ it("should return false with empty string", () => {
+ expect(existsSync("")).toBe(false);
+ });
+});
+
+describe("fs.exists", () => {
+ it("should throw TypeError with invalid argument", done => {
+ let err = undefined;
+ try {
+ // @ts-ignore
+ fs.exists(import.meta.path);
+ } catch (e) {
+ err = e;
+ }
+ try {
+ expect(err).not.toBeUndefined();
+ expect(err).toBeInstanceOf(TypeError);
+ // @ts-ignore
+ expect(err.code).toStrictEqual("ERR_INVALID_ARG_TYPE");
+ done();
+ } catch (e) {
+ done(e);
+ }
+ });
+ it("should return false with invalid path", done => {
+ fs.exists(`${tmpdir()}/test-fs-exists-${Date.now()}`, exists => {
+ try {
+ expect(exists).toBe(false);
+ done();
+ } catch (e) {
+ done(e);
+ }
+ });
+ });
+ it("should return true with existed path", done => {
+ fs.exists(import.meta.path, exists => {
+ try {
+ expect(exists).toBe(true);
+ done();
+ } catch (e) {
+ done(e);
+ }
+ });
});
});
@@ -1016,19 +1103,41 @@ describe("rmdir", () => {
done();
});
});
- it("does not remove a dir with a file in it", done => {
+
+ it("removes a dir x 512", async () => {
+ var queue = new Array(512);
+ var paths = new Array(512);
+ for (let i = 0; i < 512; i++) {
+ const path = `${tmpdir()}/${Date.now()}.rm.dir${i}`;
+ try {
+ mkdirSync(path);
+ } catch (e) {}
+ paths[i] = path;
+ queue[i] = promises.rmdir(path);
+ }
+
+ await Promise.all(queue);
+
+ for (let i = 0; i < 512; i++) {
+ expect(existsSync(paths[i])).toBe(false);
+ }
+ });
+ it("does not remove a dir with a file in it", async () => {
const path = `${tmpdir()}/${Date.now()}.rm.dir`;
try {
mkdirSync(path);
writeFileSync(`${path}/file.txt`, "File written successfully", "utf8");
} catch (e) {}
expect(existsSync(path + "/file.txt")).toBe(true);
- rmdir(path, err => {
+ try {
+ await promises.rmdir(path);
+ } catch (err) {
expect("ENOTEMPTY EPERM").toContain(err!.code);
- done();
- });
+ }
+
expect(existsSync(path + "/file.txt")).toBe(true);
- rmdir(path, { recursive: true }, () => {});
+
+ await promises.rmdir(path, { recursive: true });
expect(existsSync(path + "/file.txt")).toBe(false);
});
it("removes a dir recursively", done => {
diff --git a/test/js/node/http/fixtures/cert.key b/test/js/node/http/fixtures/cert.key
new file mode 100644
index 000000000..bf41b7883
--- /dev/null
+++ b/test/js/node/http/fixtures/cert.key
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCIzOJskt6VkEJY
+XKSJv/Gdil3XYkjk3NVc/+m+kzqnkTRbPtT9w+IGWgmJhuf9DJPLCwHFAEFarVwV
+x16Q0PbU4ajXaLRHEYGhrH10oTMjQnJ24xVm26mxRXPQa5vaLpWJqNyIdNLIQLe+
+UXUOzSGGsFTRMAjvYrkzjBe4ZUnaZV+aFY/ug0jfzeA1dJjzKZs6+yTJRbsuWUEb
+8MsDmT4v+kBZDKdaDn7AFDWRVqx/38BnqsRzkM0CxpnyT2kRzw5zQajIE13gdTJo
+1EHvYSUkkxrY5m30Rl9BuBBZBjhMzOHq0fYVVooHO+sf4XHPgvFTTxJum85u7J1J
+oEUjrLKtAgMBAAECggEACInVNhaiqu4infZGVMy0rXMV8VwSlapM7O2SLtFsr0nK
+XUmaLK6dvGzBPKK9dxdiYCFzPlMKQTkhzsAvYFWSmm3tRmikG+11TFyCRhXLpc8/
+ark4vD9Io6ZkmKUmyKLwtXNjNGcqQtJ7RXc7Ga3nAkueN6JKZHqieZusXVeBGQ70
+YH1LKyVNBeJggbj+g9rqaksPyNJQ8EWiNTJkTRQPazZ0o1VX/fzDFyr/a5npFtHl
+4BHfafv9o1Xyr70Kie8CYYRJNViOCN+ylFs7Gd3XRaAkSkgMT/7DzrHdEM2zrrHK
+yNg2gyDVX9UeEJG2X5UtU0o9BVW7WBshz/2hqIUHoQKBgQC8zsRFvC7u/rGr5vRR
+mhZZG+Wvg03/xBSuIgOrzm+Qie6mAzOdVmfSL/pNV9EFitXt1yd2ROo31AbS7Evy
+Bm/QVKr2mBlmLgov3B7O/e6ABteooOL7769qV/v+yo8VdEg0biHmsfGIIXDe3Lwl
+OT0XwF9r/SeZLbw1zfkSsUVG/QKBgQC5fANM3Dc9LEek+6PHv5+eC1cKkyioEjUl
+/y1VUD00aABI1TUcdLF3BtFN2t/S6HW0hrP3KwbcUfqC25k+GDLh1nM6ZK/gI3Yn
+IGtCHxtE3S6jKhE9QcK/H+PzGVKWge9SezeYRP0GHJYDrTVTA8Kt9HgoZPPeReJl
++Ss9c8ThcQKBgECX6HQHFnNzNSufXtSQB7dCoQizvjqTRZPxVRoxDOABIGExVTYt
+umUhPtu5AGyJ+/hblEeU+iBRbGg6qRzK8PPwE3E7xey8MYYAI5YjL7YjISKysBUL
+AhM6uJ6Jg/wOBSnSx8xZ8kzlS+0izUda1rjKeprCSArSp8IsjlrDxPStAoGAEcPr
++P+altRX5Fhpvmb/Hb8OTif8G+TqjEIdkG9H/W38oP0ywg/3M2RGxcMx7txu8aR5
+NjI7zPxZFxF7YvQkY3cLwEsGgVxEI8k6HLIoBXd90Qjlb82NnoqqZY1GWL4HMwo0
+L/Rjm6M/Rwje852Hluu0WoIYzXA6F/Q+jPs6nzECgYAxx4IbDiGXuenkwSF1SUyj
+NwJXhx4HDh7U6EO/FiPZE5BHE3BoTrFu3o1lzverNk7G3m+j+m1IguEAalHlukYl
+rip9iUISlKYqbYZdLBoLwHAfHhszdrjqn8/v6oqbB5yR3HXjPFUWJo0WJ2pqJp56
+ZshgmQQ/5Khoj6x0/dMPSg==
+-----END PRIVATE KEY-----
diff --git a/test/js/node/http/fixtures/cert.pem b/test/js/node/http/fixtures/cert.pem
new file mode 100644
index 000000000..8ae1c1ea4
--- /dev/null
+++ b/test/js/node/http/fixtures/cert.pem
@@ -0,0 +1,23 @@
+-----BEGIN CERTIFICATE-----
+MIID5jCCAs6gAwIBAgIUN7coIsdMcLo9amZfkwogu0YkeLEwDQYJKoZIhvcNAQEL
+BQAwfjELMAkGA1UEBhMCU0UxDjAMBgNVBAgMBVN0YXRlMREwDwYDVQQHDAhMb2Nh
+dGlvbjEaMBgGA1UECgwRT3JnYW5pemF0aW9uIE5hbWUxHDAaBgNVBAsME09yZ2Fu
+aXphdGlvbmFsIFVuaXQxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0yMzA5MjExNDE2
+MjNaFw0yNDA5MjAxNDE2MjNaMH4xCzAJBgNVBAYTAlNFMQ4wDAYDVQQIDAVTdGF0
+ZTERMA8GA1UEBwwITG9jYXRpb24xGjAYBgNVBAoMEU9yZ2FuaXphdGlvbiBOYW1l
+MRwwGgYDVQQLDBNPcmdhbml6YXRpb25hbCBVbml0MRIwEAYDVQQDDAlsb2NhbGhv
+c3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCIzOJskt6VkEJYXKSJ
+v/Gdil3XYkjk3NVc/+m+kzqnkTRbPtT9w+IGWgmJhuf9DJPLCwHFAEFarVwVx16Q
+0PbU4ajXaLRHEYGhrH10oTMjQnJ24xVm26mxRXPQa5vaLpWJqNyIdNLIQLe+UXUO
+zSGGsFTRMAjvYrkzjBe4ZUnaZV+aFY/ug0jfzeA1dJjzKZs6+yTJRbsuWUEb8MsD
+mT4v+kBZDKdaDn7AFDWRVqx/38BnqsRzkM0CxpnyT2kRzw5zQajIE13gdTJo1EHv
+YSUkkxrY5m30Rl9BuBBZBjhMzOHq0fYVVooHO+sf4XHPgvFTTxJum85u7J1JoEUj
+rLKtAgMBAAGjXDBaMA4GA1UdDwEB/wQEAwIDiDATBgNVHSUEDDAKBggrBgEFBQcD
+ATAUBgNVHREEDTALgglsb2NhbGhvc3QwHQYDVR0OBBYEFNzx4Rfs9m8XR5ML0WsI
+sorKmB4PMA0GCSqGSIb3DQEBCwUAA4IBAQB87iQy8R0fiOky9WTcyzVeMaavS3MX
+iTe1BRn1OCyDq+UiwwoNz7zdzZJFEmRtFBwPNFOe4HzLu6E+7yLFR552eYRHlqIi
+/fiLb5JiZfPtokUHeqwELWBsoXtU8vKxViPiLZ09jkWOPZWo7b/xXd6QYykBfV91
+usUXLzyTD2orMagpqNksLDGS3p3ggHEJBZtRZA8R7kPEw98xZHznOQpr26iv8kYz
+ZWdLFoFdwgFBSfxePKax5rfo+FbwdrcTX0MhbORyiu2XsBAghf8s2vKDkHg2UQE8
+haonxFYMFaASfaZ/5vWKYDTCJkJ67m/BtkpRafFEO+ad1i1S61OjfxH4
+-----END CERTIFICATE-----
diff --git a/test/js/node/http/node-http.test.ts b/test/js/node/http/node-http.test.ts
index f80a6c631..269970cb7 100644
--- a/test/js/node/http/node-http.test.ts
+++ b/test/js/node/http/node-http.test.ts
@@ -8,20 +8,25 @@ import {
Server,
validateHeaderName,
validateHeaderValue,
+ ServerResponse,
} from "node:http";
+import { createServer as createHttpsServer } from "node:https";
import { createTest } from "node-harness";
import url from "node:url";
import { tmpdir } from "node:os";
import { spawnSync } from "node:child_process";
+import nodefs from "node:fs";
+import { join as joinPath } from "node:path";
+import { unlinkSync } from "node:fs";
const { describe, expect, it, beforeAll, afterAll, createDoneDotAll } = createTest(import.meta.path);
-function listen(server: Server): Promise<URL> {
+function listen(server: Server, protocol: string = "http"): Promise<URL> {
return new Promise((resolve, reject) => {
server.listen({ port: 0 }, (err, hostname, port) => {
if (err) {
reject(err);
} else {
- resolve(new URL(`http://${hostname}:${port}`));
+ resolve(new URL(`${protocol}://${hostname}:${port}`));
}
});
setTimeout(() => reject("Timed out"), 5000);
@@ -46,7 +51,22 @@ describe("node:http", () => {
server.close();
}
});
-
+ it("is not marked encrypted (#5867)", async () => {
+ try {
+ var server = createServer((req, res) => {
+ expect(req.connection.encrypted).toBe(undefined);
+ res.writeHead(200, { "Content-Type": "text/plain" });
+ res.end("Hello World");
+ });
+ const url = await listen(server);
+ const res = await fetch(new URL("", url));
+ expect(await res.text()).toBe("Hello World");
+ } catch (e) {
+ throw e;
+ } finally {
+ server.close();
+ }
+ });
it("request & response body streaming (large)", async () => {
try {
const bodyBlob = new Blob(["hello world", "hello world".repeat(9000)]);
@@ -113,6 +133,23 @@ describe("node:http", () => {
});
});
+ describe("response", () => {
+ test("set-cookie works with getHeader", () => {
+ const res = new ServerResponse({});
+ res.setHeader("Set-Cookie", ["swag=true", "yolo=true"]);
+ expect(res.getHeader("Set-Cookie")).toEqual(["swag=true", "yolo=true"]);
+ });
+ test("set-cookie works with getHeaders", () => {
+ const res = new ServerResponse({});
+ res.setHeader("Set-Cookie", ["swag=true", "yolo=true"]);
+ res.setHeader("test", "test");
+ expect(res.getHeaders()).toEqual({
+ "Set-Cookie": ["swag=true", "yolo=true"],
+ "test": "test",
+ });
+ });
+ });
+
describe("request", () => {
function runTest(done: Function, callback: (server: Server, port: number, done: (err?: Error) => void) => void) {
var timer;
@@ -241,6 +278,27 @@ describe("node:http", () => {
// });
// });
+ it("should not insert extraneous accept-encoding header", async done => {
+ try {
+ let headers;
+ var server = createServer((req, res) => {
+ headers = req.headers;
+ req.on("data", () => {});
+ req.on("end", () => {
+ res.end();
+ });
+ });
+ const url = await listen(server);
+ await fetch(url, { decompress: false });
+ expect(headers["accept-encoding"]).toBeFalsy();
+ done();
+ } catch (e) {
+ done(e);
+ } finally {
+ server.close();
+ }
+ });
+
it("should make a standard GET request when passed string as first arg", done => {
runTest(done, (server, port, done) => {
const req = request(`http://localhost:${port}`, res => {
@@ -887,4 +945,137 @@ describe("node:http", () => {
}
});
});
+
+ test("error event not fired, issue#4651", done => {
+ const server = createServer((req, res) => {
+ res.end();
+ });
+ server.listen({ port: 42069 }, () => {
+ const server2 = createServer((_, res) => {
+ res.end();
+ });
+ server2.on("error", err => {
+ expect(err.code).toBe("EADDRINUSE");
+ done();
+ });
+ server2.listen({ port: 42069 }, () => {});
+ });
+ });
+});
+describe("node https server", async () => {
+ const httpsOptions = {
+ key: nodefs.readFileSync(joinPath(import.meta.dir, "fixtures", "cert.key")),
+ cert: nodefs.readFileSync(joinPath(import.meta.dir, "fixtures", "cert.pem")),
+ };
+ const createServer = onRequest => {
+ return new Promise(resolve => {
+ const server = createHttpsServer(httpsOptions, (req, res) => {
+ onRequest(req, res);
+ });
+ listen(server, "https").then(url => {
+ resolve({
+ server,
+ done: () => server.close(),
+ url,
+ });
+ });
+ });
+ };
+ it("is marked encrypted (#5867)", async () => {
+ const { server, url, done } = await createServer(async (req, res) => {
+ expect(req.connection.encrypted).toBe(true);
+ res.end();
+ });
+ try {
+ await fetch(url);
+ } catch (e) {
+ throw e;
+ } finally {
+ done();
+ }
+ });
+});
+
+describe("server.address should be valid IP", () => {
+ it("should return null before listening", done => {
+ const server = createServer((req, res) => {});
+ try {
+ expect(server.address()).toBeNull();
+ done();
+ } catch (err) {
+ done(err);
+ }
+ });
+ it("should return null after close", done => {
+ const server = createServer((req, res) => {});
+ server.listen(0, async (_err, host, port) => {
+ try {
+ expect(server.address()).not.toBeNull();
+ server.close();
+ expect(server.address()).toBeNull();
+ done();
+ } catch (err) {
+ done(err);
+ }
+ });
+ });
+ it("test default hostname, issue#5850", done => {
+ const server = createServer((req, res) => {});
+ server.listen(0, async (_err, host, port) => {
+ try {
+ const { address, family, port } = server.address();
+ expect(port).toBeInteger();
+ expect(port).toBeGreaterThan(0);
+ expect(port).toBeLessThan(65536);
+ expect(["::", "0.0.0.0"]).toContain(address);
+ if (address === "0.0.0.0") {
+ expect(family).toStrictEqual("IPv4");
+ } else {
+ expect(family).toStrictEqual("IPv6");
+ }
+ done();
+ } catch (err) {
+ done(err);
+ } finally {
+ server.close();
+ }
+ });
+ });
+ it.each([["localhost"], ["127.0.0.1"]])("test %s", (hostname, done) => {
+ const server = createServer((req, res) => {});
+ server.listen(0, hostname, async (_err, host, port) => {
+ try {
+ const { address, family } = server.address();
+ expect(port).toBeInteger();
+ expect(port).toBeGreaterThan(0);
+ expect(port).toBeLessThan(65536);
+ expect(["IPv4", "IPv6"]).toContain(family);
+ if (family === "IPv4") {
+ expect(address).toStrictEqual("127.0.0.1");
+ } else {
+ expect(address).toStrictEqual("::1");
+ }
+ done();
+ } catch (err) {
+ done(err);
+ } finally {
+ server.close();
+ }
+ });
+ });
+ it("test unix socket, issue#6413", done => {
+ const socketPath = `${tmpdir()}/bun-server-${Math.random().toString(32)}.sock`;
+ const server = createServer((req, res) => {});
+ server.listen(socketPath, async (_err, host, port) => {
+ try {
+ expect(server.address()).toStrictEqual(socketPath);
+ done();
+ } catch (err) {
+ done(err);
+ } finally {
+ server.close();
+ unlinkSync(socketPath);
+ }
+ });
+ });
});
diff --git a/test/js/node/module/modulePrototypeOverwrite-fixture.cjs b/test/js/node/module/modulePrototypeOverwrite-fixture.cjs
new file mode 100644
index 000000000..eecab81c1
--- /dev/null
+++ b/test/js/node/module/modulePrototypeOverwrite-fixture.cjs
@@ -0,0 +1 @@
+module.exports = require("hook");
diff --git a/test/js/node/module/modulePrototypeOverwrite.cjs b/test/js/node/module/modulePrototypeOverwrite.cjs
new file mode 100644
index 000000000..4e84026a6
--- /dev/null
+++ b/test/js/node/module/modulePrototypeOverwrite.cjs
@@ -0,0 +1,17 @@
+// This behavior is required for Next.js to work
+const eql = require("assert").deepStrictEqual;
+const Module = require("module");
+
+const old = Module.prototype.require;
+Module.prototype.require = function (str) {
+ if (str === "hook") return "winner";
+ return {
+ wrap: old.call(this, str),
+ };
+};
+
+// this context has the new require
+const result = require("./modulePrototypeOverwrite-fixture.cjs");
+eql(result, { wrap: "winner" });
+
+console.log("--pass--");
diff --git a/test/js/node/module/node-module-module.test.js b/test/js/node/module/node-module-module.test.js
index 08955a7b7..5ac48d426 100644
--- a/test/js/node/module/node-module-module.test.js
+++ b/test/js/node/module/node-module-module.test.js
@@ -1,6 +1,8 @@
import { expect, test } from "bun:test";
+import { bunEnv, bunExe } from "harness";
import { _nodeModulePaths, builtinModules, isBuiltin, wrap } from "module";
import Module from "module";
+import path from "path";
test("builtinModules exists", () => {
expect(Array.isArray(builtinModules)).toBe(true);
@@ -57,3 +59,49 @@ test("Module.wrap", () => {
expect(mod.exports.foo).toBe(1);
expect(wrap()).toBe("(function (exports, require, module, __filename, __dirname) { undefined\n});");
});
+
+test("Overwriting _resolveFilename", () => {
+ const { stdout, exitCode } = Bun.spawnSync({
+ cmd: [bunExe(), "run", path.join(import.meta.dir, "resolveFilenameOverwrite.cjs")],
+ env: bunEnv,
+ stderr: "inherit",
+ });
+
+ expect(stdout.toString().trim().endsWith("--pass--")).toBe(true);
+ expect(exitCode).toBe(0);
+});
+
+test("Overwriting Module.prototype.require", () => {
+ const { stdout, exitCode } = Bun.spawnSync({
+ cmd: [bunExe(), "run", path.join(import.meta.dir, "modulePrototypeOverwrite.cjs")],
+ env: bunEnv,
+ stderr: "inherit",
+ });
+
+ expect(stdout.toString().trim().endsWith("--pass--")).toBe(true);
+ expect(exitCode).toBe(0);
+});
+
+test("Module.prototype._compile", () => {
+ const module = new Module("module id goes here");
+ const starting_exports = module.exports;
+ const r = module._compile(
+ "module.exports = { module, exports, require, __filename, __dirname }",
+ "/file/path/goes/here.js",
+ );
+ expect(r).toBe(undefined);
+ expect(module.exports).not.toBe(starting_exports);
+ const { module: m, exports: e, require: req, __filename: fn, __dirname: dn } = module.exports;
+ expect(m).toBe(module);
+ expect(e).toBe(starting_exports);
+ expect(req).toBe(module.require);
+ expect(fn).toBe("/file/path/goes/here.js");
+ expect(dn).toBe("/file/path/goes");
+});
+
+test("Module._extensions", () => {
+ expect(".js" in Module._extensions).toBeTrue();
+ expect(".json" in Module._extensions).toBeTrue();
+ expect(".node" in Module._extensions).toBeTrue();
+ expect(require.extensions).toBe(Module._extensions);
+});
diff --git a/test/js/node/module/resolveFilenameOverwrite-fixture.cjs b/test/js/node/module/resolveFilenameOverwrite-fixture.cjs
new file mode 100644
index 000000000..adae3dd6e
--- /dev/null
+++ b/test/js/node/module/resolveFilenameOverwrite-fixture.cjs
@@ -0,0 +1 @@
+module.exports = "winner";
diff --git a/test/js/node/module/resolveFilenameOverwrite.cjs b/test/js/node/module/resolveFilenameOverwrite.cjs
new file mode 100644
index 000000000..e2d1327a7
--- /dev/null
+++ b/test/js/node/module/resolveFilenameOverwrite.cjs
@@ -0,0 +1,14 @@
+// This behavior is required for Next.js to work
+const eql = require("assert").strictEqual;
+const path = require("path");
+const Module = require("module");
+
+const original = Module._resolveFilename;
+Module._resolveFilename = str => {
+ eql(str.endsWith("💔"), true);
+ return path.join(__dirname, "./resolveFilenameOverwrite-fixture.cjs");
+};
+eql(require("overwriting _resolveFilename broke 💔"), "winner");
+Module._resolveFilename = original;
+
+console.log("--pass--");
diff --git a/test/js/node/net/node-net.test.ts b/test/js/node/net/node-net.test.ts
index efdff4bc5..a16ac6db1 100644
--- a/test/js/node/net/node-net.test.ts
+++ b/test/js/node/net/node-net.test.ts
@@ -370,8 +370,8 @@ it("should handle connection error", done => {
}
errored = true;
expect(error).toBeDefined();
- expect(error.name).toBe("SystemError");
expect(error.message).toBe("Failed to connect");
+ expect((error as any).code).toBe("ECONNREFUSED");
});
socket.on("connect", () => {
@@ -383,3 +383,38 @@ it("should handle connection error", done => {
done();
});
});
+
+it("should handle connection error (unix)", done => {
+ let errored = false;
+
+ // @ts-ignore
+ const socket = connect("loser", () => {
+ done(new Error("Should not have connected"));
+ });
+
+ socket.on("error", error => {
+ if (errored) {
+ return done(new Error("Should not have errored twice"));
+ }
+ errored = true;
+ expect(error).toBeDefined();
+ expect(error.message).toBe("Failed to connect");
+ expect((error as any).code).toBe("ENOENT");
+ });
+
+ socket.on("connect", () => {
+ done(new Error("Should not have connected"));
+ });
+
+ socket.on("close", () => {
+ expect(errored).toBe(true);
+ done();
+ });
+});
+
+it("Socket has a prototype", () => {
+ function Connection() {}
+ function Connection2() {}
+ require("util").inherits(Connection, Socket);
+ require("util").inherits(Connection2, require("tls").TLSSocket);
+});
diff --git a/test/js/node/os/os.test.js b/test/js/node/os/os.test.js
index 8b4d54bb7..7d64719d4 100644
--- a/test/js/node/os/os.test.js
+++ b/test/js/node/os/os.test.js
@@ -19,8 +19,10 @@ it("totalmem", () => {
});
it("getPriority", () => {
- expect(os.getPriority()).toBe(0);
- expect(os.getPriority(0)).toBe(0);
+ var prio = os.getPriority();
+ expect(-20 <= prio && prio <= 20).toBe(true);
+ prio = os.getPriority(0);
+ expect(-20 <= prio && prio <= 20).toBe(true);
});
it("setPriority", () => {
@@ -154,3 +156,7 @@ it("devNull", () => {
if (process.platform === "win32") expect(os.devNull).toBe("\\\\.\\nul");
else expect(os.devNull).toBe("/dev/null");
});
+
+it("availableParallelism", () => {
+ expect(os.availableParallelism()).toBeGreaterThan(0);
+});
diff --git a/test/js/node/path/path.test.js b/test/js/node/path/path.test.js
index 26b6a3b6d..1d14e1d9e 100644
--- a/test/js/node/path/path.test.js
+++ b/test/js/node/path/path.test.js
@@ -271,6 +271,19 @@ it("path.basename", () => {
strictEqual(path.posix.basename(`/a/b/${controlCharFilename}`), controlCharFilename);
});
+describe("path.join #5769", () => {
+ for (let length of [4096, 4095, 4097, 65_432, 65_431, 65_433]) {
+ it("length " + length, () => {
+ const tooLengthyFolderName = Array.from({ length }).fill("b").join("");
+ expect(path.join(tooLengthyFolderName)).toEqual("b".repeat(length));
+ });
+ it("length " + length + "joined", () => {
+ const tooLengthyFolderName = Array.from({ length }).fill("b");
+ expect(path.join(...tooLengthyFolderName)).toEqual("b/".repeat(length).substring(0, 2 * length - 1));
+ });
+ }
+});
+
it("path.join", () => {
const failures = [];
const backslashRE = /\\/g;
diff --git a/test/js/node/process-binding.test.ts b/test/js/node/process-binding.test.ts
new file mode 100644
index 000000000..c60a38bae
--- /dev/null
+++ b/test/js/node/process-binding.test.ts
@@ -0,0 +1,26 @@
+describe("process.binding", () => {
+ test("process.binding('constants')", () => {
+ /* @ts-ignore */
+ const constants = process.binding("constants");
+ expect(constants).toBeDefined();
+ expect(constants).toHaveProperty("os");
+ expect(constants).toHaveProperty("crypto");
+ expect(constants).toHaveProperty("fs");
+ expect(constants).toHaveProperty("trace");
+ expect(constants).toHaveProperty("zlib");
+ });
+ test("process.binding('uv')", () => {
+ /* @ts-ignore */
+ const uv = process.binding("uv");
+ expect(uv).toBeDefined();
+
+ expect(uv).toHaveProperty("errname");
+ expect(uv).toHaveProperty("UV_EACCES");
+ expect(uv.errname(-4)).toBe("EINTR");
+ expect(uv.errname(5)).toBe("Unknown system error 5");
+
+ const map = uv.getErrorMap();
+ expect(map).toBeDefined();
+ expect(map.get(-56)).toEqual(["EISCONN", "socket is already connected"]);
+ });
+});
diff --git a/test/js/node/process/print-process-args.js b/test/js/node/process/print-process-args.js
index e9d2295c8..c34c1b231 100644
--- a/test/js/node/process/print-process-args.js
+++ b/test/js/node/process/print-process-args.js
@@ -3,8 +3,8 @@ import assert from "assert";
// ensure process.argv and Bun.argv are the same
assert.deepStrictEqual(process.argv, Bun.argv, "process.argv does not equal Bun.argv");
assert(process.argv === process.argv, "process.argv isn't cached");
-// assert(Bun.argv === Bun.argv, 'Bun.argv isn\'t cached');
-// assert(Bun.argv === process.argv, 'Bun.argv doesnt share same ref as process.argv');
+assert(Bun.argv === Bun.argv, "Bun.argv isn't cached");
+// assert(Bun.argv === process.argv, "Bun.argv doesnt share same ref as process.argv");
var writer = Bun.stdout.writer();
writer.write(JSON.stringify(process.argv));
diff --git a/test/js/node/process/process-stdio.test.ts b/test/js/node/process/process-stdio.test.ts
index 463ab5fda..5349587af 100644
--- a/test/js/node/process/process-stdio.test.ts
+++ b/test/js/node/process/process-stdio.test.ts
@@ -5,7 +5,7 @@ import { isatty } from "tty";
test("process.stdin", () => {
expect(process.stdin).toBeDefined();
- expect(process.stdout.isTTY).toBe(isatty(0));
+ expect(process.stdin.isTTY).toBe(isatty(0) ? true : undefined);
expect(process.stdin.on("close", function () {})).toBe(process.stdin);
expect(process.stdin.once("end", function () {})).toBe(process.stdin);
});
diff --git a/test/js/node/process/process.test.js b/test/js/node/process/process.test.js
index bb74bb998..fd91fdef5 100644
--- a/test/js/node/process/process.test.js
+++ b/test/js/node/process/process.test.js
@@ -103,7 +103,7 @@ it("process.env.TZ", () => {
var origTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
// the default timezone is Etc/UTC
- if (!"TZ" in process.env) {
+ if (!("TZ" in process.env)) {
expect(origTimezone).toBe("Etc/UTC");
}
@@ -263,6 +263,15 @@ describe("process.exitCode", () => {
});
});
+it("process exitCode range (#6284)", () => {
+ const { exitCode, stdout } = spawnSync({
+ cmd: [bunExe(), join(import.meta.dir, "process-exitCode-fixture.js"), "255"],
+ env: bunEnv,
+ });
+ expect(exitCode).toBe(255);
+ expect(stdout.toString().trim()).toBe("PASS");
+});
+
it("process.exit", () => {
const { exitCode, stdout } = spawnSync({
cmd: [bunExe(), join(import.meta.dir, "process-exit-fixture.js")],
@@ -407,7 +416,8 @@ describe("signal", () => {
stdout: "pipe",
});
const prom = child.exited;
- process.kill(child.pid, "SIGTERM");
+ const ret = process.kill(child.pid, "SIGTERM");
+ expect(ret).toBe(true);
await prom;
expect(child.signalCode).toBe("SIGTERM");
});
@@ -418,7 +428,8 @@ describe("signal", () => {
stdout: "pipe",
});
const prom = child.exited;
- process.kill(child.pid, 9);
+ const ret = process.kill(child.pid, 9);
+ expect(ret).toBe(true);
await prom;
expect(child.signalCode).toBe("SIGKILL");
});
@@ -487,3 +498,13 @@ it("dlopen args parsing", () => {
expect(() => process.dlopen({ module: { exports: Symbol("123") } }, "/tmp/not-found.so")).toThrow();
expect(() => process.dlopen({ module: { exports: Symbol("123") } }, Symbol("badddd"))).toThrow();
});
+
+it("process.constrainedMemory()", () => {
+ if (process.platform === "linux") {
+ // On Linux, it returns 0 if the kernel doesn't support it
+ expect(process.constrainedMemory() >= 0).toBe(true);
+ } else {
+ // On unsupported platforms, it returns undefined
+ expect(process.constrainedMemory()).toBeUndefined();
+ }
+});
diff --git a/test/js/node/stream/node-stream.test.js b/test/js/node/stream/node-stream.test.js
index bc6a4fcfb..ddbd2bc7a 100644
--- a/test/js/node/stream/node-stream.test.js
+++ b/test/js/node/stream/node-stream.test.js
@@ -197,6 +197,7 @@ describe("PassThrough", () => {
const ttyStreamsTest = `
import tty from "tty";
+import fs from "fs";
import { dlopen } from "bun:ffi";
@@ -278,10 +279,11 @@ describe("TTY", () => {
close(child_fd);
});
it("process.stdio tty", () => {
- expect(process.stdin instanceof tty.ReadStream).toBe(true);
+ // this isnt run in a tty, so stdin will not appear to be a tty
+ expect(process.stdin instanceof fs.ReadStream).toBe(true);
expect(process.stdout instanceof tty.WriteStream).toBe(true);
expect(process.stderr instanceof tty.WriteStream).toBe(true);
- expect(process.stdin.isTTY).toBeDefined();
+ expect(process.stdin.isTTY).toBeUndefined();
expect(process.stdout.isTTY).toBeDefined();
expect(process.stderr.isTTY).toBeDefined();
});
@@ -311,7 +313,11 @@ it("TTY streams", () => {
});
expect(stdout.toString()).toBe("");
- expect(stderr.toString()).toContain("0 fail");
+ try {
+ expect(stderr.toString()).toContain("0 fail");
+ } catch (error) {
+ throw new Error(stderr.toString());
+ }
expect(exitCode).toBe(0);
});
diff --git a/test/js/node/tty.test.ts b/test/js/node/tty.test.ts
new file mode 100644
index 000000000..c1723ad48
--- /dev/null
+++ b/test/js/node/tty.test.ts
@@ -0,0 +1,25 @@
+import { describe, it, expect } from "bun:test";
+import { WriteStream } from "node:tty";
+
+describe("WriteStream.prototype.getColorDepth", () => {
+ it("iTerm ancient", () => {
+ expect(
+ WriteStream.prototype.getColorDepth.call(undefined, {
+ TERM_PROGRAM: "iTerm.app",
+ }),
+ ).toBe(8);
+ });
+
+ it("iTerm modern", () => {
+ expect(
+ WriteStream.prototype.getColorDepth.call(undefined, {
+ TERM_PROGRAM: "iTerm.app",
+ TERM_PROGRAM_VERSION: 3,
+ }),
+ ).toBe(24);
+ });
+
+ it("empty", () => {
+ expect(WriteStream.prototype.getColorDepth.call(undefined, {})).toBe(1);
+ });
+});
diff --git a/test/js/node/util/node-inspect-tests/import.test.mjs b/test/js/node/util/node-inspect-tests/import.test.mjs
new file mode 100644
index 000000000..a49902f53
--- /dev/null
+++ b/test/js/node/util/node-inspect-tests/import.test.mjs
@@ -0,0 +1,9 @@
+import assert from "assert";
+import util, { inspect } from "util";
+
+test("no assertion failures", () => {
+ assert.strictEqual(typeof util.inspect, "function");
+ assert.strictEqual(util.inspect, inspect);
+ assert.strictEqual(util.inspect(null), "null");
+ assert.strictEqual(util.inspect({ a: 1 }, { compact: false }), "{\n a: 1\n}");
+});
diff --git a/test/js/node/util/node-inspect-tests/internal-inspect.test.js b/test/js/node/util/node-inspect-tests/internal-inspect.test.js
new file mode 100644
index 000000000..6e7a76e0d
--- /dev/null
+++ b/test/js/node/util/node-inspect-tests/internal-inspect.test.js
@@ -0,0 +1,57 @@
+import assert from "assert";
+import util from "util";
+
+test("no assertion failures", () => {
+ // Errors in accessors are not triggered
+ const obj = new Proxy(
+ { x: 5 },
+ {
+ get() {
+ throw new Error("Error message");
+ },
+ },
+ );
+ assert.strictEqual(util.format(obj), "{ x: 5 }");
+
+ assert.strictEqual(util.formatWithOptions({ numericSeparator: true }, "%d", 4000), "4_000");
+
+ const a = {};
+ a.b = a;
+ assert.strictEqual(util.inspect(a, { compact: false }), "<ref *1> {\n b: [Circular *1]\n}");
+ assert.strictEqual(util.inspect(a, { compact: true }), "<ref *1> { b: [Circular *1] }");
+
+ const cause = new Error("cause");
+ const e2 = new Error("wrapper", { cause });
+ assert.match(util.inspect(e2), /\[cause\]: Error: cause\n/);
+});
+
+//! non-standard property, should this be kept?
+test.skip("util.stylizeWithHTML", () => {
+ assert.strictEqual(
+ util.inspect(
+ {
+ a: 1,
+ b: "<p>\xA0\u{1F4A9}</p>",
+ "&lt;": NaN,
+ [Symbol("<br>")]: false,
+ buf: new Uint8Array([1, 2, 3, 4]),
+ },
+ {
+ compact: false,
+ stylize: util.stylizeWithHTML,
+ },
+ ),
+ "{\n" +
+ ' a: <span style="color:yellow;">1</span>,\n' +
+ ' b: <span style="color:green;">&apos;&lt;p&gt;&nbsp;\u{1F4A9}&lt;&#47;p&gt;&apos;</span>,\n' +
+ ' <span style="color:green;">&apos;&amp;lt&#59;&apos;</span>: <span style="color:yellow;">NaN</span>,\n' +
+ " buf: Uint8Array(4) [\n" +
+ ' <span style="color:yellow;">1</span>,\n' +
+ ' <span style="color:yellow;">2</span>,\n' +
+ ' <span style="color:yellow;">3</span>,\n' +
+ ' <span style="color:yellow;">4</span>\n' +
+ " ],\n" +
+ ' [<span style="color:green;">Symbol&#40;&lt;br&gt;&#41;</span>]: <span style="color:yellow;">false</span>\n' +
+ "}",
+ );
+});
diff --git a/test/js/node/util/node-inspect-tests/parallel/util-format.test.js b/test/js/node/util/node-inspect-tests/parallel/util-format.test.js
new file mode 100644
index 000000000..045671cf7
--- /dev/null
+++ b/test/js/node/util/node-inspect-tests/parallel/util-format.test.js
@@ -0,0 +1,489 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+import assert from "assert";
+import util from "util";
+const symbol = Symbol("foo");
+
+test("no assertion failures", () => {
+ assert.strictEqual(util.format(), "");
+ assert.strictEqual(util.format(""), "");
+ assert.strictEqual(util.format([]), "[]");
+ assert.strictEqual(util.format([0]), "[ 0 ]");
+ assert.strictEqual(util.format({}), "{}");
+ assert.strictEqual(util.format({ foo: 42 }), "{ foo: 42 }");
+ assert.strictEqual(util.format(null), "null");
+ assert.strictEqual(util.format(true), "true");
+ assert.strictEqual(util.format(false), "false");
+ assert.strictEqual(util.format("test"), "test");
+
+ // CHECKME this is for console.log() compatibility - but is it *right*?
+ assert.strictEqual(util.format("foo", "bar", "baz"), "foo bar baz");
+
+ // ES6 Symbol handling
+ assert.strictEqual(util.format(symbol), "Symbol(foo)");
+ assert.strictEqual(util.format("foo", symbol), "foo Symbol(foo)");
+ assert.strictEqual(util.format("%s", symbol), "Symbol(foo)");
+ assert.strictEqual(util.format("%j", symbol), "undefined");
+
+ // Number format specifier
+ assert.strictEqual(util.format("%d"), "%d");
+ assert.strictEqual(util.format("%d", 42.0), "42");
+ assert.strictEqual(util.format("%d", 42), "42");
+ assert.strictEqual(util.format("%d", "42"), "42");
+ assert.strictEqual(util.format("%d", "42.0"), "42");
+ assert.strictEqual(util.format("%d", 1.5), "1.5");
+ assert.strictEqual(util.format("%d", -0.5), "-0.5");
+ assert.strictEqual(util.format("%d", -0.0), "-0");
+ assert.strictEqual(util.format("%d", ""), "0");
+ assert.strictEqual(util.format("%d", " -0.000"), "-0");
+ assert.strictEqual(util.format("%d", Symbol()), "NaN");
+ assert.strictEqual(util.format("%d", Infinity), "Infinity");
+ assert.strictEqual(util.format("%d", -Infinity), "-Infinity");
+ assert.strictEqual(util.format("%d %d", 42, 43), "42 43");
+ assert.strictEqual(util.format("%d %d", 42), "42 %d");
+ assert.strictEqual(util.format("%d", 1180591620717411303424), "1.1805916207174113e+21");
+ assert.strictEqual(util.format("%d", 1180591620717411303424n), "1180591620717411303424n");
+ assert.strictEqual(
+ util.format("%d %d", 1180591620717411303424n, 12345678901234567890123n),
+ "1180591620717411303424n 12345678901234567890123n",
+ );
+
+ {
+ const { numericSeparator } = util.inspect.defaultOptions;
+ util.inspect.defaultOptions.numericSeparator = true;
+
+ assert.strictEqual(util.format("%d", 1180591620717411303424), "1.1805916207174113e+21");
+
+ assert.strictEqual(
+ util.format("%d %s %i", 118059162071741130342, 118059162071741130342, 123_123_123),
+ "118_059_162_071_741_140_000 118_059_162_071_741_140_000 123_123_123",
+ );
+
+ assert.strictEqual(
+ util.format("%d %s", 1_180_591_620_717_411_303_424n, 12_345_678_901_234_567_890_123n),
+ "1_180_591_620_717_411_303_424n 12_345_678_901_234_567_890_123n",
+ );
+
+ assert.strictEqual(util.format("%i", 1_180_591_620_717_411_303_424n), "1_180_591_620_717_411_303_424n");
+
+ util.inspect.defaultOptions.numericSeparator = numericSeparator;
+ }
+ // Integer format specifier
+ assert.strictEqual(util.format("%i"), "%i");
+ assert.strictEqual(util.format("%i", 42.0), "42");
+ assert.strictEqual(util.format("%i", 42), "42");
+ assert.strictEqual(util.format("%i", "42"), "42");
+ assert.strictEqual(util.format("%i", "42.0"), "42");
+ assert.strictEqual(util.format("%i", 1.5), "1");
+ assert.strictEqual(util.format("%i", -0.5), "-0");
+ assert.strictEqual(util.format("%i", ""), "NaN");
+ assert.strictEqual(util.format("%i", Infinity), "NaN");
+ assert.strictEqual(util.format("%i", -Infinity), "NaN");
+ assert.strictEqual(util.format("%i", Symbol()), "NaN");
+ assert.strictEqual(util.format("%i %i", 42, 43), "42 43");
+ assert.strictEqual(util.format("%i %i", 42), "42 %i");
+ assert.strictEqual(util.format("%i", 1180591620717411303424), "1");
+ assert.strictEqual(util.format("%i", 1180591620717411303424n), "1180591620717411303424n");
+ assert.strictEqual(
+ util.format("%i %i", 1180591620717411303424n, 12345678901234567890123n),
+ "1180591620717411303424n 12345678901234567890123n",
+ );
+
+ assert.strictEqual(
+ util.format("%d %i", 1180591620717411303424n, 12345678901234567890123n),
+ "1180591620717411303424n 12345678901234567890123n",
+ );
+
+ assert.strictEqual(
+ util.format("%i %d", 1180591620717411303424n, 12345678901234567890123n),
+ "1180591620717411303424n 12345678901234567890123n",
+ );
+
+ assert.strictEqual(
+ util.formatWithOptions({ numericSeparator: true }, "%i %d", 1180591620717411303424n, 12345678901234567890123n),
+ "1_180_591_620_717_411_303_424n 12_345_678_901_234_567_890_123n",
+ );
+
+ // Float format specifier
+ assert.strictEqual(util.format("%f"), "%f");
+ assert.strictEqual(util.format("%f", 42.0), "42");
+ assert.strictEqual(util.format("%f", 42), "42");
+ assert.strictEqual(util.format("%f", "42"), "42");
+ assert.strictEqual(util.format("%f", "-0.0"), "-0");
+ assert.strictEqual(util.format("%f", "42.0"), "42");
+ assert.strictEqual(util.format("%f", 1.5), "1.5");
+ assert.strictEqual(util.format("%f", -0.5), "-0.5");
+ assert.strictEqual(util.format("%f", Math.PI), "3.141592653589793");
+ assert.strictEqual(util.format("%f", ""), "NaN");
+ assert.strictEqual(util.format("%f", Symbol("foo")), "NaN");
+ assert.strictEqual(util.format("%f", 5n), "5");
+ assert.strictEqual(util.format("%f", Infinity), "Infinity");
+ assert.strictEqual(util.format("%f", -Infinity), "-Infinity");
+ assert.strictEqual(util.format("%f %f", 42, 43), "42 43");
+ assert.strictEqual(util.format("%f %f", 42), "42 %f");
+
+ // String format specifier
+ assert.strictEqual(util.format("%s"), "%s");
+ assert.strictEqual(util.format("%s", undefined), "undefined");
+ assert.strictEqual(util.format("%s", null), "null");
+ assert.strictEqual(util.format("%s", "foo"), "foo");
+ assert.strictEqual(util.format("%s", 42), "42");
+ assert.strictEqual(util.format("%s", "42"), "42");
+ assert.strictEqual(util.format("%s", -0), "-0");
+ assert.strictEqual(util.format("%s", "-0.0"), "-0.0");
+ assert.strictEqual(util.format("%s %s", 42, 43), "42 43");
+ assert.strictEqual(util.format("%s %s", 42), "42 %s");
+ assert.strictEqual(util.format("%s", 42n), "42n");
+ assert.strictEqual(util.format("%s", Symbol("foo")), "Symbol(foo)");
+ assert.strictEqual(util.format("%s", true), "true");
+ assert.strictEqual(util.format("%s", { a: [1, 2, 3] }), "{ a: [Array] }");
+ assert.strictEqual(
+ util.format("%s", {
+ toString() {
+ return "Foo";
+ },
+ }),
+ "Foo",
+ );
+ assert.strictEqual(util.format("%s", { toString: 5 }), "{ toString: 5 }");
+ assert.strictEqual(
+ util.format("%s", () => 5),
+ "() => 5",
+ );
+ assert.strictEqual(util.format("%s", Infinity), "Infinity");
+ assert.strictEqual(util.format("%s", -Infinity), "-Infinity");
+
+ // String format specifier including `toString` properties on the prototype.
+ {
+ class Foo {
+ toString() {
+ return "Bar";
+ }
+ }
+ assert.strictEqual(util.format("%s", new Foo()), "Bar");
+ // TODO: null prototypes
+ // assert.strictEqual(
+ // util.format('%s', Object.setPrototypeOf(new Foo(), null)),
+ // '[Foo: null prototype] {}'
+ // );
+ global.Foo = Foo;
+ assert.strictEqual(util.format("%s", new Foo()), "Bar");
+ delete global.Foo;
+ class Bar {
+ abc = true;
+ }
+ assert.strictEqual(util.format("%s", new Bar()), "Bar { abc: true }");
+ class Foobar extends Array {
+ aaa = true;
+ }
+ assert.strictEqual(util.format("%s", new Foobar(5)), "Foobar(5) [ <5 empty items>, aaa: true ]");
+
+ // Subclassing:
+ class B extends Foo {}
+
+ function C() {}
+ C.prototype.toString = function () {
+ return "Custom";
+ };
+
+ function D() {
+ C.call(this);
+ }
+ D.prototype = { __proto__: C.prototype };
+
+ assert.strictEqual(util.format("%s", new B()), "Bar");
+ assert.strictEqual(util.format("%s", new C()), "Custom");
+ assert.strictEqual(util.format("%s", new D()), "Custom");
+
+ D.prototype.constructor = D;
+ assert.strictEqual(util.format("%s", new D()), "Custom");
+
+ D.prototype.constructor = null;
+ assert.strictEqual(util.format("%s", new D()), "Custom");
+
+ D.prototype.constructor = { name: "Foobar" };
+ assert.strictEqual(util.format("%s", new D()), "Custom");
+
+ Object.defineProperty(D.prototype, "constructor", {
+ get() {
+ throw new Error();
+ },
+ configurable: true,
+ });
+ assert.strictEqual(util.format("%s", new D()), "Custom");
+
+ assert.strictEqual(util.format("%s", { __proto__: null }), "[Object: null prototype] {}");
+ }
+
+ // JSON format specifier
+ assert.strictEqual(util.format("%j"), "%j");
+ assert.strictEqual(util.format("%j", 42), "42");
+ assert.strictEqual(util.format("%j", "42"), '"42"');
+ assert.strictEqual(util.format("%j %j", 42, 43), "42 43");
+ assert.strictEqual(util.format("%j %j", 42), "42 %j");
+
+ // Object format specifier
+ const obj = {
+ foo: "bar",
+ foobar: 1,
+ func: function () {},
+ };
+ const nestedObj = {
+ foo: "bar",
+ foobar: {
+ foo: "bar",
+ func: function () {},
+ },
+ };
+ const nestedObj2 = {
+ foo: "bar",
+ foobar: 1,
+ func: [{ a: function () {} }],
+ };
+ assert.strictEqual(util.format("%o"), "%o");
+ assert.strictEqual(util.format("%o", 42), "42");
+ assert.strictEqual(util.format("%o", "foo"), "'foo'");
+ assert.strictEqual(
+ util.format("%o", obj),
+ "{\n" +
+ " foo: 'bar',\n" +
+ " foobar: 1,\n" +
+ " func: <ref *1> [Function: func] {\n" +
+ " [length]: 0,\n" +
+ " [name]: 'func',\n" +
+ " [prototype]: { [constructor]: [Circular *1] }\n" +
+ " }\n" +
+ "}",
+ );
+ assert.strictEqual(
+ util.format("%o", nestedObj2),
+ "{\n" +
+ " foo: 'bar',\n" +
+ " foobar: 1,\n" +
+ " func: [\n" +
+ " {\n" +
+ " a: <ref *1> [Function: a] {\n" +
+ " [length]: 0,\n" +
+ " [name]: 'a',\n" +
+ " [prototype]: { [constructor]: [Circular *1] }\n" +
+ " }\n" +
+ " },\n" +
+ " [length]: 1\n" +
+ " ]\n" +
+ "}",
+ );
+ assert.strictEqual(
+ util.format("%o", nestedObj),
+ "{\n" +
+ " foo: 'bar',\n" +
+ " foobar: {\n" +
+ " foo: 'bar',\n" +
+ " func: <ref *1> [Function: func] {\n" +
+ " [length]: 0,\n" +
+ " [name]: 'func',\n" +
+ " [prototype]: { [constructor]: [Circular *1] }\n" +
+ " }\n" +
+ " }\n" +
+ "}",
+ );
+
+ assert.strictEqual(
+ util.format("%o %o", obj, obj),
+ "{\n" +
+ " foo: 'bar',\n" +
+ " foobar: 1,\n" +
+ " func: <ref *1> [Function: func] {\n" +
+ " [prototype]: { [constructor]: [Circular *1] },\n" +
+ " [name]: 'func',\n" +
+ " [length]: 0\n" +
+ " }\n" +
+ "} {\n" +
+ " foo: 'bar',\n" +
+ " foobar: 1,\n" +
+ " func: <ref *1> [Function: func] {\n" +
+ " [prototype]: { [constructor]: [Circular *1] },\n" +
+ " [name]: 'func',\n" +
+ " [length]: 0\n" +
+ " }\n" +
+ "}",
+ );
+
+ assert.strictEqual(
+ util.format("%o %o", obj),
+ "{\n" +
+ " foo: 'bar',\n" +
+ " foobar: 1,\n" +
+ " func: <ref *1> [Function: func] {\n" +
+ " [prototype]: { [constructor]: [Circular *1] },\n" +
+ " [name]: 'func',\n" +
+ " [length]: 0\n" +
+ " }\n" +
+ "} %o",
+ );
+
+ assert.strictEqual(util.format("%O"), "%O");
+ assert.strictEqual(util.format("%O", 42), "42");
+ assert.strictEqual(util.format("%O", "foo"), "'foo'");
+ assert.strictEqual(util.format("%O", obj), "{ foo: 'bar', foobar: 1, func: [Function: func] }");
+ assert.strictEqual(util.format("%O", nestedObj), "{ foo: 'bar', foobar: { foo: 'bar', func: [Function: func] } }");
+ assert.strictEqual(
+ util.format("%O %O", obj, obj),
+ "{ foo: 'bar', foobar: 1, func: [Function: func] } " + "{ foo: 'bar', foobar: 1, func: [Function: func] }",
+ );
+ assert.strictEqual(util.format("%O %O", obj), "{ foo: 'bar', foobar: 1, func: [Function: func] } %O");
+
+ // Various format specifiers
+ assert.strictEqual(util.format("%%s%s", "foo"), "%sfoo");
+ assert.strictEqual(util.format("%s:%s"), "%s:%s");
+ assert.strictEqual(util.format("%s:%s", undefined), "undefined:%s");
+ assert.strictEqual(util.format("%s:%s", "foo"), "foo:%s");
+ assert.strictEqual(util.format("%s:%i", "foo"), "foo:%i");
+ assert.strictEqual(util.format("%s:%f", "foo"), "foo:%f");
+ assert.strictEqual(util.format("%s:%s", "foo", "bar"), "foo:bar");
+ assert.strictEqual(util.format("%s:%s", "foo", "bar", "baz"), "foo:bar baz");
+ assert.strictEqual(util.format("%%%s%%", "hi"), "%hi%");
+ assert.strictEqual(util.format("%%%s%%%%", "hi"), "%hi%%");
+ assert.strictEqual(util.format("%sbc%%def", "a"), "abc%def");
+ assert.strictEqual(util.format("%d:%d", 12, 30), "12:30");
+ assert.strictEqual(util.format("%d:%d", 12), "12:%d");
+ assert.strictEqual(util.format("%d:%d"), "%d:%d");
+ assert.strictEqual(util.format("%i:%i", 12, 30), "12:30");
+ assert.strictEqual(util.format("%i:%i", 12), "12:%i");
+ assert.strictEqual(util.format("%i:%i"), "%i:%i");
+ assert.strictEqual(util.format("%f:%f", 12, 30), "12:30");
+ assert.strictEqual(util.format("%f:%f", 12), "12:%f");
+ assert.strictEqual(util.format("%f:%f"), "%f:%f");
+ assert.strictEqual(util.format("o: %j, a: %j", {}, []), "o: {}, a: []");
+ assert.strictEqual(util.format("o: %j, a: %j", {}), "o: {}, a: %j");
+ assert.strictEqual(util.format("o: %j, a: %j"), "o: %j, a: %j");
+ assert.strictEqual(util.format("o: %o, a: %O", {}, []), "o: {}, a: []");
+ assert.strictEqual(util.format("o: %o, a: %o", {}), "o: {}, a: %o");
+ assert.strictEqual(util.format("o: %O, a: %O"), "o: %O, a: %O");
+
+ // Invalid format specifiers
+ assert.strictEqual(util.format("a% b", "x"), "a% b x");
+ assert.strictEqual(util.format("percent: %d%, fraction: %d", 10, 0.1), "percent: 10%, fraction: 0.1");
+ assert.strictEqual(util.format("abc%", 1), "abc% 1");
+
+ // Additional arguments after format specifiers
+ assert.strictEqual(util.format("%i", 1, "number"), "1 number");
+ assert.strictEqual(
+ util.format("%i", 1, () => {}),
+ "1 [Function (anonymous)]",
+ );
+
+ // %c from https://console.spec.whatwg.org/
+ assert.strictEqual(util.format("%c"), "%c");
+ assert.strictEqual(util.format("%cab"), "%cab");
+ assert.strictEqual(util.format("%cab", "color: blue"), "ab");
+ assert.strictEqual(util.format("%cab", "color: blue", "c"), "ab c");
+
+ {
+ const o = {};
+ o.o = o;
+ assert.strictEqual(util.format("%j", o), "[Circular]");
+ }
+
+ {
+ const o = {
+ toJSON() {
+ throw new Error("Not a circular object but still not serializable");
+ },
+ };
+ assert.throws(() => util.format("%j", o), /^Error: Not a circular object but still not serializable$/);
+ }
+
+ // Errors
+ const err = new Error("foo");
+ assert(util.format(err).startsWith(err.stack), `Expected "${util.format(err)}" to start with "${err.stack}"`);
+
+ class CustomError extends Error {
+ constructor(msg) {
+ super();
+ Object.defineProperty(this, "message", { value: msg, enumerable: false });
+ Object.defineProperty(this, "name", { value: "CustomError", enumerable: false });
+ Error.captureStackTrace(this, CustomError);
+ }
+ }
+ const customError = new CustomError("bar");
+ assert.strictEqual(util.format(customError), customError.stack.replace(/^Error/, "Custom$&")); //! temp bug workaround
+ // Doesn't capture stack trace
+ function BadCustomError(msg) {
+ Error.call(this);
+ Object.defineProperty(this, "message", { value: msg, enumerable: false });
+ Object.defineProperty(this, "name", { value: "BadCustomError", enumerable: false });
+ }
+ Object.setPrototypeOf(BadCustomError.prototype, Error.prototype);
+ Object.setPrototypeOf(BadCustomError, Error);
+ assert.strictEqual(util.format(new BadCustomError("foo")), "[BadCustomError: foo]");
+
+ // The format of arguments should not depend on type of the first argument
+ assert.strictEqual(util.format("1", "1"), "1 1");
+ assert.strictEqual(util.format(1, "1"), "1 1");
+ assert.strictEqual(util.format("1", 1), "1 1");
+ assert.strictEqual(util.format(1, -0), "1 -0");
+ assert.strictEqual(
+ util.format("1", () => {}),
+ "1 [Function (anonymous)]",
+ );
+ assert.strictEqual(
+ util.format(1, () => {}),
+ "1 [Function (anonymous)]",
+ );
+ assert.strictEqual(util.format("1", "'"), "1 '");
+ assert.strictEqual(util.format(1, "'"), "1 '");
+ assert.strictEqual(util.format("1", "number"), "1 number");
+ assert.strictEqual(util.format(1, "number"), "1 number");
+ assert.strictEqual(util.format(5n), "5n");
+ assert.strictEqual(util.format(5n, 5n), "5n 5n");
+
+ // Check `formatWithOptions`.
+ assert.strictEqual(
+ util.formatWithOptions({ colors: true }, true, undefined, Symbol(), 1, 5n, null, "foobar"),
+ "\u001b[33mtrue\u001b[39m " +
+ "\u001b[90mundefined\u001b[39m " +
+ "\u001b[32mSymbol()\u001b[39m " +
+ "\u001b[33m1\u001b[39m " +
+ "\u001b[33m5n\u001b[39m " +
+ "\u001b[1mnull\u001b[22m " +
+ "foobar",
+ );
+
+ assert.strictEqual(
+ util.format(new SharedArrayBuffer(4)),
+ "SharedArrayBuffer { [Uint8Contents]: <00 00 00 00>, byteLength: 4 }",
+ );
+
+ assert.strictEqual(util.formatWithOptions({ colors: true, compact: 3 }, "%s", [1, { a: true }]), "[ 1, [Object] ]");
+
+ [undefined, null, false, 5n, 5, "test", Symbol()].forEach(invalidOptions => {
+ assert.throws(
+ () => {
+ util.formatWithOptions(invalidOptions, { a: true });
+ },
+ {
+ code: "ERR_INVALID_ARG_TYPE",
+ message: /"inspectOptions".+object/,
+ },
+ );
+ });
+});
diff --git a/test/js/node/util/node-inspect-tests/parallel/util-inspect-getters-accessing-this.test.js b/test/js/node/util/node-inspect-tests/parallel/util-inspect-getters-accessing-this.test.js
new file mode 100644
index 000000000..ab3c17e59
--- /dev/null
+++ b/test/js/node/util/node-inspect-tests/parallel/util-inspect-getters-accessing-this.test.js
@@ -0,0 +1,60 @@
+// This test ensures that util.inspect logs getters which access this.
+
+import assert from "assert";
+import { inspect } from "util";
+
+test("no assertion failures", () => {
+ {
+ class X {
+ constructor() {
+ this._y = 123;
+ }
+
+ get y() {
+ return this._y;
+ }
+ }
+
+ const result = inspect(new X(), {
+ getters: true,
+ showHidden: true,
+ });
+
+ assert.strictEqual(result, "X { _y: 123, [y]: [Getter: 123] }");
+ }
+
+ // Regression test for https://github.com/nodejs/node/issues/37054
+ {
+ class A {
+ constructor(B) {
+ this.B = B;
+ }
+ get b() {
+ return this.B;
+ }
+ }
+
+ class B {
+ constructor() {
+ this.A = new A(this);
+ }
+ get a() {
+ return this.A;
+ }
+ }
+
+ const result = inspect(new B(), {
+ depth: 1,
+ getters: true,
+ showHidden: true,
+ });
+
+ assert.strictEqual(
+ result,
+ "<ref *1> B {\n" +
+ " A: A { B: [Circular *1], [b]: [Getter] [Circular *1] },\n" +
+ " [a]: [Getter] A { B: [Circular *1], [b]: [Getter] [Circular *1] }\n" +
+ "}",
+ );
+ }
+});
diff --git a/test/js/node/util/node-inspect-tests/parallel/util-inspect-long-running.test.mjs b/test/js/node/util/node-inspect-tests/parallel/util-inspect-long-running.test.mjs
new file mode 100644
index 000000000..2cf3b7d14
--- /dev/null
+++ b/test/js/node/util/node-inspect-tests/parallel/util-inspect-long-running.test.mjs
@@ -0,0 +1,27 @@
+import util from "util";
+// Test that huge objects don't crash due to exceeding the maximum heap size.
+
+// Create a difficult to stringify object. Without the artificial limitation
+// this would crash or throw an maximum string size error.
+
+//! This test currently relies on a non-standard extension to util.inspect
+// It optimizes the output of circular objects. If that extension ends up
+// being removed, this test will likely hang for a pretty long time.
+// We are missing some kind of optimization Node does to pass this test near instantly even without the extension.
+
+test("should not take longer than 2 seconds", () => {
+ let last = {};
+ const obj = last;
+
+ for (let i = 0; i < 500; i++) {
+ // original value: 1000 (reduced to 500 to let tests run faster)
+ last.next = { circular: obj, last, obj: { a: i, b: 2, c: true } };
+ last = last.next;
+ obj[i] = last;
+ }
+
+ const str = util.inspect(obj, { depth: Infinity, colors: false });
+ void str;
+ //console.log(str);
+ //console.log(str.length);
+});
diff --git a/test/js/node/util/node-inspect-tests/parallel/util-inspect-proxy.test.js b/test/js/node/util/node-inspect-tests/parallel/util-inspect-proxy.test.js
new file mode 100644
index 000000000..f87bd5a3c
--- /dev/null
+++ b/test/js/node/util/node-inspect-tests/parallel/util-inspect-proxy.test.js
@@ -0,0 +1,177 @@
+import assert from "assert";
+import util from "util";
+const opts = { showProxy: true };
+
+test("no assertion failures", () => {
+ let proxyObj;
+ let called = false;
+ const target = {
+ [util.inspect.custom](depth, { showProxy }) {
+ if (showProxy === false) {
+ called = true;
+ if (proxyObj !== this) {
+ throw new Error("Failed");
+ }
+ }
+ return [1, 2, 3];
+ },
+ };
+ const handler = {
+ getPrototypeOf() {
+ throw new Error("getPrototypeOf");
+ },
+ setPrototypeOf() {
+ throw new Error("setPrototypeOf");
+ },
+ isExtensible() {
+ throw new Error("isExtensible");
+ },
+ preventExtensions() {
+ throw new Error("preventExtensions");
+ },
+ getOwnPropertyDescriptor() {
+ throw new Error("getOwnPropertyDescriptor");
+ },
+ defineProperty() {
+ throw new Error("defineProperty");
+ },
+ has() {
+ throw new Error("has");
+ },
+ get(_, key) {
+ throw new Error("get: " + String(key));
+ },
+ set() {
+ throw new Error("set");
+ },
+ deleteProperty() {
+ throw new Error("deleteProperty");
+ },
+ ownKeys() {
+ throw new Error("ownKeys");
+ },
+ apply() {
+ throw new Error("apply");
+ },
+ construct() {
+ throw new Error("construct");
+ },
+ };
+ proxyObj = new Proxy(target, handler);
+
+ // Inspecting the proxy should not actually walk it's properties
+ util.inspect(proxyObj, opts);
+
+ // Make sure inspecting object does not trigger any proxy traps.
+ util.format("%s", proxyObj);
+
+ const r = Proxy.revocable({}, {});
+ r.revoke();
+
+ assert.strictEqual(util.inspect(r.proxy), "<Revoked Proxy>");
+ assert.strictEqual(
+ util.inspect(r, { showProxy: true }),
+ "{ proxy: <Revoked Proxy>, revoke: [Function (anonymous)] }",
+ );
+
+ assert.strictEqual(util.format("%s", r.proxy), "<Revoked Proxy>");
+
+ assert.strictEqual(
+ util.inspect(proxyObj, opts),
+ "Proxy [\n" +
+ " [ 1, 2, 3 ],\n" +
+ " {\n" +
+ " getPrototypeOf: [Function: getPrototypeOf],\n" +
+ " setPrototypeOf: [Function: setPrototypeOf],\n" +
+ " isExtensible: [Function: isExtensible],\n" +
+ " preventExtensions: [Function: preventExtensions],\n" +
+ " getOwnPropertyDescriptor: [Function: getOwnPropertyDescriptor],\n" +
+ " defineProperty: [Function: defineProperty],\n" +
+ " has: [Function: has],\n" +
+ " get: [Function: get],\n" +
+ " set: [Function: set],\n" +
+ " deleteProperty: [Function: deleteProperty],\n" +
+ " ownKeys: [Function: ownKeys],\n" +
+ " apply: [Function: apply],\n" +
+ " construct: [Function: construct]\n" +
+ " }\n" +
+ "]",
+ );
+
+ // Inspecting a proxy without the showProxy option set to true should not
+ // trigger any proxy handlers.
+ assert.strictEqual(util.inspect(proxyObj), "[ 1, 2, 3 ]");
+ assert(called);
+
+ // Yo dawg, I heard you liked Proxy so I put a Proxy
+ // inside your Proxy that proxies your Proxy's Proxy.
+ const proxy1 = new Proxy({}, {});
+ const proxy2 = new Proxy(proxy1, {});
+ const proxy3 = new Proxy(proxy2, proxy1);
+ const proxy4 = new Proxy(proxy1, proxy2);
+ const proxy5 = new Proxy(proxy3, proxy4);
+ const proxy6 = new Proxy(proxy5, proxy5);
+ const expected0 = "{}";
+ const expected1 = "Proxy [ {}, {} ]";
+ const expected2 = "Proxy [ Proxy [ {}, {} ], {} ]";
+ const expected3 = "Proxy [ Proxy [ Proxy [ {}, {} ], {} ], Proxy [ {}, {} ] ]";
+ const expected4 = "Proxy [ Proxy [ {}, {} ], Proxy [ Proxy [ {}, {} ], {} ] ]";
+ const expected5 =
+ "Proxy [\n " +
+ "Proxy [ Proxy [ Proxy [Array], {} ], Proxy [ {}, {} ] ],\n" +
+ " Proxy [ Proxy [ {}, {} ], Proxy [ Proxy [Array], {} ] ]" +
+ "\n]";
+ const expected6 =
+ "Proxy [\n" +
+ " Proxy [\n" +
+ " Proxy [ Proxy [Array], Proxy [Array] ],\n" +
+ " Proxy [ Proxy [Array], Proxy [Array] ]\n" +
+ " ],\n" +
+ " Proxy [\n" +
+ " Proxy [ Proxy [Array], Proxy [Array] ],\n" +
+ " Proxy [ Proxy [Array], Proxy [Array] ]\n" +
+ " ]\n" +
+ "]";
+ assert.strictEqual(util.inspect(proxy1, { showProxy: 1, depth: null }), expected1);
+ assert.strictEqual(util.inspect(proxy2, opts), expected2);
+ assert.strictEqual(util.inspect(proxy3, opts), expected3);
+ assert.strictEqual(util.inspect(proxy4, opts), expected4);
+ assert.strictEqual(util.inspect(proxy5, opts), expected5);
+ assert.strictEqual(util.inspect(proxy6, opts), expected6);
+ assert.strictEqual(util.inspect(proxy1), expected0);
+ assert.strictEqual(util.inspect(proxy2), expected0);
+ assert.strictEqual(util.inspect(proxy3), expected0);
+ assert.strictEqual(util.inspect(proxy4), expected0);
+ assert.strictEqual(util.inspect(proxy5), expected0);
+ assert.strictEqual(util.inspect(proxy6), expected0);
+
+ // Just for fun, let's create a Proxy using Arrays.
+ const proxy7 = new Proxy([], []);
+ const expected7 = "Proxy [ [], [] ]";
+ assert.strictEqual(util.inspect(proxy7, opts), expected7);
+ assert.strictEqual(util.inspect(proxy7), "[]");
+
+ // Now we're just getting silly, right?
+ const proxy8 = new Proxy(Date, []);
+ const proxy9 = new Proxy(Date, String);
+ const expected8 = "Proxy [ [Function: Date], [] ]";
+ const expected9 = "Proxy [ [Function: Date], [Function: String] ]";
+ assert.strictEqual(util.inspect(proxy8, opts), expected8);
+ assert.strictEqual(util.inspect(proxy9, opts), expected9);
+ assert.strictEqual(util.inspect(proxy8), "[Function: Date]");
+ assert.strictEqual(util.inspect(proxy9), "[Function: Date]");
+
+ const proxy10 = new Proxy(() => {}, {});
+ const proxy11 = new Proxy(() => {}, {
+ get() {
+ return proxy11;
+ },
+ apply() {
+ return proxy11;
+ },
+ });
+ const expected10 = "[Function (anonymous)]";
+ const expected11 = "[Function (anonymous)]";
+ assert.strictEqual(util.inspect(proxy10), expected10);
+ assert.strictEqual(util.inspect(proxy11), expected11);
+});
diff --git a/test/js/node/util/node-inspect-tests/parallel/util-inspect.test.js b/test/js/node/util/node-inspect-tests/parallel/util-inspect.test.js
new file mode 100644
index 000000000..19b0f1b39
--- /dev/null
+++ b/test/js/node/util/node-inspect-tests/parallel/util-inspect.test.js
@@ -0,0 +1,3294 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+import assert from "assert";
+import util, { inspect } from "util";
+import vm from "vm";
+import { MessageChannel } from "worker_threads";
+import url from "url";
+const noop = () => {};
+const mustCallChecks = [];
+
+//? Bun does not have this function yet
+assert.doesNotMatch = (string, regexp, message) => {
+ try {
+ assert.match(string, regexp, message);
+ throw null;
+ } catch (e) {
+ if (e === null) {
+ const msg =
+ message || `The input was expected to not match the regular expression ${regexp}. Input:\n'${string}'`;
+ throw new assert.AssertionError({
+ message: msg,
+ actual: string,
+ expected: regexp,
+ operator: "doesNotMatch",
+ stackStartFn: assert.doesNotMatch,
+ });
+ }
+ // pass
+ }
+};
+
+test("no assertion failures", () => {
+ assert.strictEqual(util.inspect(1), "1");
+ assert.strictEqual(util.inspect(false), "false");
+ assert.strictEqual(util.inspect(""), "''");
+ assert.strictEqual(util.inspect("hello"), "'hello'");
+ assert.strictEqual(
+ util.inspect(function abc() {}),
+ "[Function: abc]",
+ );
+ assert.strictEqual(
+ util.inspect(() => {}),
+ "[Function (anonymous)]",
+ );
+ assert.strictEqual(
+ util.inspect(async function () {}),
+ "[AsyncFunction (anonymous)]",
+ );
+ assert.strictEqual(
+ util.inspect(async () => {}),
+ "[AsyncFunction (anonymous)]",
+ );
+
+ // Special function inspection.
+ {
+ const fn = (() => function* () {})();
+ assert.strictEqual(util.inspect(fn), "[GeneratorFunction (anonymous)]");
+ assert.strictEqual(
+ util.inspect(async function* abc() {}),
+ "[AsyncGeneratorFunction: abc]",
+ );
+ Object.setPrototypeOf(
+ fn,
+ Object.getPrototypeOf(async () => {}),
+ );
+ //! Note:
+ // The following tests are relying on the JS-based is(Async|Generator)Function polyfills,
+ // when switching them out back for the native implementation make sure they are fixed!
+ // Due to the bug with the native impl. being flaky make sure its tested multiple times.
+ assert.strictEqual(util.inspect(fn), "[GeneratorFunction (anonymous)] AsyncFunction");
+ Object.defineProperty(fn, "name", { value: 5, configurable: true });
+ assert.strictEqual(util.inspect(fn), "[GeneratorFunction: 5] AsyncFunction");
+ Object.defineProperty(fn, Symbol.toStringTag, {
+ value: "Foobar",
+ configurable: true,
+ });
+ assert.strictEqual(util.inspect({ ["5"]: fn }), "{ '5': [GeneratorFunction: 5] AsyncFunction [Foobar] }");
+ Object.defineProperty(fn, "name", { value: "5", configurable: true });
+ Object.setPrototypeOf(fn, null);
+ assert.strictEqual(util.inspect(fn), "[GeneratorFunction (null prototype): 5] [Foobar]");
+ assert.strictEqual(util.inspect({ ["5"]: fn }), "{ '5': [GeneratorFunction (null prototype): 5] [Foobar] }");
+ }
+
+ assert.strictEqual(util.inspect(undefined), "undefined");
+ assert.strictEqual(util.inspect(null), "null");
+ assert.strictEqual(util.inspect(/foo(bar\n)?/gi), "/foo(bar\\n)?/gi");
+ assert.strictEqual(
+ util.inspect(new Date("Sun, 14 Feb 2010 11:48:40 GMT")),
+ new Date("2010-02-14T12:48:40+01:00").toISOString(),
+ );
+ assert.strictEqual(util.inspect(new Date("")), new Date("").toString());
+ assert.strictEqual(util.inspect("\n\x01"), "'\\n\\x01'");
+ assert.strictEqual(
+ util.inspect(`${Array(75).fill(1)}'\n\x1d\n\x03\x85\x7f\x7e\x9f\xa0`),
+ `"${Array(75).fill(1)}'\\n" +\n '\\x1D\\n' +\n '\\x03\\x85\\x7F~\\x9F '`,
+ );
+ assert.strictEqual(util.inspect([]), "[]");
+ assert.strictEqual(util.inspect({ __proto__: [] }), "Array {}");
+ assert.strictEqual(util.inspect([1, 2]), "[ 1, 2 ]");
+ assert.strictEqual(util.inspect([1, [2, 3]]), "[ 1, [ 2, 3 ] ]");
+ assert.strictEqual(util.inspect({}), "{}");
+ assert.strictEqual(util.inspect({ a: 1 }), "{ a: 1 }");
+ assert.strictEqual(util.inspect({ a: function () {} }), "{ a: [Function: a] }");
+ assert.strictEqual(util.inspect({ a: () => {} }), "{ a: [Function: a] }");
+
+ assert.strictEqual(util.inspect({ a: async function abc() {} }), "{ a: [AsyncFunction: abc] }");
+ assert.strictEqual(util.inspect({ a: async () => {} }), "{ a: [AsyncFunction: a] }");
+ assert.strictEqual(util.inspect({ a: function* () {} }), "{ a: [GeneratorFunction: a] }");
+ assert.strictEqual(util.inspect({ a: 1, b: 2 }), "{ a: 1, b: 2 }");
+ assert.strictEqual(util.inspect({ "a": {} }), "{ a: {} }");
+ assert.strictEqual(util.inspect({ "a": { "b": 2 } }), "{ a: { b: 2 } }");
+ assert.strictEqual(util.inspect({ "a": { "b": { "c": { "d": 2 } } } }), "{ a: { b: { c: [Object] } } }");
+ assert.strictEqual(
+ util.inspect({ "a": { "b": { "c": { "d": 2 } } } }, false, null),
+ "{\n a: { b: { c: { d: 2 } } }\n}",
+ );
+ assert.strictEqual(util.inspect([1, 2, 3], true), "[ 1, 2, 3, [length]: 3 ]");
+ assert.strictEqual(util.inspect({ "a": { "b": { "c": 2 } } }, false, 0), "{ a: [Object] }");
+ assert.strictEqual(util.inspect({ "a": { "b": { "c": 2 } } }, false, 1), "{ a: { b: [Object] } }");
+ assert.strictEqual(util.inspect({ "a": { "b": ["c"] } }, false, 1), "{ a: { b: [Array] } }");
+ assert.strictEqual(util.inspect(new Uint8Array(0)), "Uint8Array(0) []");
+ assert(inspect(new Uint8Array(0), { showHidden: true }).includes("[buffer]"));
+ assert.strictEqual(
+ util.inspect(Object.create({}, { visible: { value: 1, enumerable: true }, hidden: { value: 2 } })),
+ "{ visible: 1 }",
+ );
+ assert.strictEqual(
+ util.inspect(Object.assign(new String("hello"), { [Symbol("foo")]: 123 }), { showHidden: true }),
+ "[String: 'hello'] { [length]: 5, [Symbol(foo)]: 123 }",
+ );
+
+ {
+ const regexp = /regexp/;
+ regexp.aprop = 42;
+ assert.strictEqual(util.inspect({ a: regexp }, false, 0), "{ a: /regexp/ }");
+ }
+
+ assert.match(util.inspect({ a: { a: { a: { a: {} } } } }, undefined, undefined, true), /Object/);
+ assert.doesNotMatch(util.inspect({ a: { a: { a: { a: {} } } } }, undefined, null, true), /Object/);
+
+ {
+ const showHidden = true;
+ const ab = new Uint8Array([1, 2, 3, 4]).buffer;
+ const dv = new DataView(ab, 1, 2);
+ assert.strictEqual(util.inspect(ab, showHidden), "ArrayBuffer { [Uint8Contents]: <01 02 03 04>, byteLength: 4 }");
+ assert.strictEqual(
+ util.inspect(new DataView(ab, 1, 2), showHidden),
+ "DataView {\n" +
+ " byteLength: 2,\n" +
+ " byteOffset: 1,\n" +
+ " buffer: ArrayBuffer {" +
+ " [Uint8Contents]: <01 02 03 04>, byteLength: 4 }\n}",
+ );
+ assert.strictEqual(util.inspect(ab, showHidden), "ArrayBuffer { [Uint8Contents]: <01 02 03 04>, byteLength: 4 }");
+ assert.strictEqual(
+ util.inspect(dv, showHidden),
+ "DataView {\n" +
+ " byteLength: 2,\n" +
+ " byteOffset: 1,\n" +
+ " buffer: ArrayBuffer { [Uint8Contents]: " +
+ "<01 02 03 04>, byteLength: 4 }\n}",
+ );
+ ab.x = 42;
+ dv.y = 1337;
+ assert.strictEqual(
+ util.inspect(ab, showHidden),
+ "ArrayBuffer { [Uint8Contents]: <01 02 03 04>, " + "byteLength: 4, x: 42 }",
+ );
+ assert.strictEqual(
+ util.inspect(dv, showHidden),
+ "DataView {\n" +
+ " byteLength: 2,\n" +
+ " byteOffset: 1,\n" +
+ " buffer: ArrayBuffer { [Uint8Contents]: <01 02 03 04>," +
+ " byteLength: 4, x: 42 },\n" +
+ " y: 1337\n}",
+ );
+ }
+
+ {
+ const ab = new ArrayBuffer(42);
+ assert.strictEqual(ab.byteLength, 42);
+ new MessageChannel().port1.postMessage(ab, [ab]);
+ assert.strictEqual(ab.byteLength, 0);
+ assert.strictEqual(util.inspect(ab), "ArrayBuffer { (detached), byteLength: 0 }");
+ }
+
+ // Truncate output for ArrayBuffers using plural or singular bytes
+ {
+ const ab = new ArrayBuffer(3);
+ assert.strictEqual(
+ util.inspect(ab, { showHidden: true, maxArrayLength: 2 }),
+ "ArrayBuffer { [Uint8Contents]" + ": <00 00 ... 1 more byte>, byteLength: 3 }",
+ );
+ assert.strictEqual(
+ util.inspect(ab, { showHidden: true, maxArrayLength: 1 }),
+ "ArrayBuffer { [Uint8Contents]" + ": <00 ... 2 more bytes>, byteLength: 3 }",
+ );
+ }
+});
+
+// Now do the same checks but from a different context.
+test("inspect from a different context", () => {
+ const showHidden = false;
+ const ab = vm.runInNewContext("new ArrayBuffer(4)");
+ const dv = vm.runInNewContext("new DataView(ab, 1, 2)", { ab });
+ assert.strictEqual(util.inspect(ab, showHidden), "ArrayBuffer { [Uint8Contents]: <00 00 00 00>, byteLength: 4 }");
+ assert.strictEqual(
+ util.inspect(new DataView(ab, 1, 2), showHidden),
+ "DataView {\n" +
+ " byteLength: 2,\n" +
+ " byteOffset: 1,\n" +
+ " buffer: ArrayBuffer { [Uint8Contents]: <00 00 00 00>, byteLength: 4 }\n}",
+ );
+ assert.strictEqual(util.inspect(ab, showHidden), "ArrayBuffer { [Uint8Contents]: <00 00 00 00>, byteLength: 4 }");
+ //! segfaults
+ /*assert.strictEqual(
+ util.inspect(dv, showHidden),
+ 'DataView {\n' +
+ ' byteLength: 2,\n' +
+ ' byteOffset: 1,\n' +
+ ' buffer: ArrayBuffer { [Uint8Contents]: <00 00 00 00>, byteLength: 4 }\n}'
+ );*/
+ ab.x = 42;
+ dv.y = 1337;
+ assert.strictEqual(
+ util.inspect(ab, showHidden),
+ "ArrayBuffer { [Uint8Contents]: <00 00 00 00>, byteLength: 4, x: 42 }",
+ );
+ //! segfaults
+ /*assert.strictEqual(
+ util.inspect(dv, showHidden),
+ 'DataView {\n' +
+ ' byteLength: 2,\n' +
+ ' byteOffset: 1,\n' +
+ ' buffer: ArrayBuffer { [Uint8Contents]: <00 00 00 00>, byteLength: 4, x: 42 },\n' +
+ ' y: 1337\n}'
+ );*/
+});
+
+test("no assertion failures 2", () => {
+ [
+ Float32Array,
+ Float64Array,
+ Int16Array,
+ Int32Array,
+ Int8Array,
+ Uint16Array,
+ Uint32Array,
+ Uint8Array,
+ Uint8ClampedArray,
+ ].forEach(constructor => {
+ const length = 2;
+ const byteLength = length * constructor.BYTES_PER_ELEMENT;
+ const array = new constructor(new ArrayBuffer(byteLength), 0, length);
+ array[0] = 65;
+ array[1] = 97;
+ assert.strictEqual(
+ util.inspect(array, { showHidden: true }),
+ `${constructor.name}(${length}) [\n` +
+ " 65,\n" +
+ " 97,\n" +
+ ` [BYTES_PER_ELEMENT]: ${constructor.BYTES_PER_ELEMENT},\n` +
+ ` [length]: ${length},\n` +
+ ` [byteLength]: ${byteLength},\n` +
+ " [byteOffset]: 0,\n" +
+ ` [buffer]: ArrayBuffer { byteLength: ${byteLength} }\n]`,
+ );
+ assert.strictEqual(util.inspect(array, false), `${constructor.name}(${length}) [ 65, 97 ]`);
+ });
+
+ // Now check that declaring a TypedArray in a different context works the same.
+ [
+ Float32Array,
+ Float64Array,
+ Int16Array,
+ Int32Array,
+ Int8Array,
+ Uint16Array,
+ Uint32Array,
+ Uint8Array,
+ Uint8ClampedArray,
+ ].forEach(constructor => {
+ const length = 2;
+ const byteLength = length * constructor.BYTES_PER_ELEMENT;
+ const array = vm.runInNewContext("new constructor(new ArrayBuffer(byteLength), 0, length)", {
+ constructor,
+ byteLength,
+ length,
+ });
+ array[0] = 65;
+ array[1] = 97;
+ assert.strictEqual(
+ util.inspect(array, true),
+ `${constructor.name}(${length}) [\n` +
+ " 65,\n" +
+ " 97,\n" +
+ ` [BYTES_PER_ELEMENT]: ${constructor.BYTES_PER_ELEMENT},\n` +
+ ` [length]: ${length},\n` +
+ ` [byteLength]: ${byteLength},\n` +
+ " [byteOffset]: 0,\n" +
+ ` [buffer]: ArrayBuffer { byteLength: ${byteLength} }\n]`,
+ );
+ assert.strictEqual(util.inspect(array, false), `${constructor.name}(${length}) [ 65, 97 ]`);
+ });
+
+ {
+ const brokenLength = new Float32Array(2);
+ Object.defineProperty(brokenLength, "length", { value: -1 });
+ assert.strictEqual(inspect(brokenLength), "Float32Array(2) [ 0n, 0n ]");
+ }
+
+ assert.strictEqual(
+ util.inspect(
+ Object.create(
+ {},
+ {
+ visible: { value: 1, enumerable: true },
+ hidden: { value: 2 },
+ },
+ ),
+ { showHidden: true },
+ ),
+ "{ visible: 1, [hidden]: 2 }",
+ );
+ // Objects without prototype.
+ assert.strictEqual(
+ util.inspect(
+ Object.create(null, {
+ name: { value: "Tim", enumerable: true },
+ hidden: { value: "secret" },
+ }),
+ { showHidden: true },
+ ),
+ "[Object: null prototype] { name: 'Tim', [hidden]: 'secret' }",
+ );
+
+ assert.strictEqual(
+ util.inspect(
+ Object.create(null, {
+ name: { value: "Tim", enumerable: true },
+ hidden: { value: "secret" },
+ }),
+ ),
+ "[Object: null prototype] { name: 'Tim' }",
+ );
+
+ // Dynamic properties.
+ {
+ assert.strictEqual(
+ util.inspect({
+ get readonly() {
+ return 1;
+ },
+ }),
+ "{ readonly: [Getter] }",
+ );
+
+ assert.strictEqual(
+ util.inspect({
+ get readwrite() {
+ return 1;
+ },
+ set readwrite(val) {},
+ }),
+ "{ readwrite: [Getter/Setter] }",
+ );
+
+ assert.strictEqual(util.inspect({ set writeonly(val) {} }), "{ writeonly: [Setter] }");
+
+ const value = {};
+ value.a = value;
+ assert.strictEqual(util.inspect(value), "<ref *1> { a: [Circular *1] }");
+ const getterFn = {
+ get one() {
+ return null;
+ },
+ };
+ assert.strictEqual(util.inspect(getterFn, { getters: true }), "{ one: [Getter: null] }");
+ }
+
+ // Array with dynamic properties.
+ {
+ const value = [1, 2, 3];
+ Object.defineProperty(value, "growingLength", {
+ enumerable: true,
+ get: function () {
+ this.push(true);
+ return this.length;
+ },
+ });
+ Object.defineProperty(value, "-1", {
+ enumerable: true,
+ value: -1,
+ });
+ assert.strictEqual(util.inspect(value), "[ 1, 2, 3, growingLength: [Getter], '-1': -1 ]");
+ }
+
+ // Array with inherited number properties.
+ {
+ class CustomArray extends Array {}
+ CustomArray.prototype[5] = "foo";
+ CustomArray.prototype[49] = "bar";
+ CustomArray.prototype.foo = true;
+ const arr = new CustomArray(50);
+ arr[49] = "I win";
+ assert.strictEqual(util.inspect(arr), "CustomArray(50) [ <49 empty items>, 'I win' ]");
+ assert.strictEqual(
+ util.inspect(arr, { showHidden: true }),
+ "CustomArray(50) [\n" +
+ " <49 empty items>,\n" +
+ " 'I win',\n" +
+ " [length]: 50,\n" +
+ " '5': 'foo',\n" +
+ " foo: true\n" +
+ "]",
+ );
+ }
+
+ // Array with extra properties.
+ {
+ const arr = [1, 2, 3, ,];
+ arr.foo = "bar";
+ assert.strictEqual(util.inspect(arr), "[ 1, 2, 3, <1 empty item>, foo: 'bar' ]");
+
+ const arr2 = [];
+ assert.strictEqual(util.inspect([], { showHidden: true }), "[ [length]: 0 ]");
+ arr2["00"] = 1;
+ assert.strictEqual(util.inspect(arr2), "[ '00': 1 ]");
+ assert.strictEqual(util.inspect(arr2, { showHidden: true }), "[ [length]: 0, '00': 1 ]");
+ arr2[1] = 0;
+ assert.strictEqual(util.inspect(arr2), "[ <1 empty item>, 0, '00': 1 ]");
+ assert.strictEqual(util.inspect(arr2, { showHidden: true }), "[ <1 empty item>, 0, [length]: 2, '00': 1 ]");
+ delete arr2[1];
+ assert.strictEqual(util.inspect(arr2), "[ <2 empty items>, '00': 1 ]");
+ assert.strictEqual(util.inspect(arr2, { showHidden: true }), "[ <2 empty items>, [length]: 2, '00': 1 ]");
+ arr2["01"] = 2;
+ assert.strictEqual(util.inspect(arr2), "[ <2 empty items>, '00': 1, '01': 2 ]");
+ assert.strictEqual(util.inspect(arr2, { showHidden: true }), "[ <2 empty items>, [length]: 2, '00': 1, '01': 2 ]");
+ delete arr2["00"];
+ arr2[0] = 0;
+ assert.strictEqual(util.inspect(arr2), "[ 0, <1 empty item>, '01': 2 ]");
+ assert.strictEqual(util.inspect(arr2, { showHidden: true }), "[ 0, <1 empty item>, [length]: 2, '01': 2 ]");
+ delete arr2["01"];
+ arr2[2 ** 32 - 2] = "max";
+ arr2[2 ** 32 - 1] = "too far";
+ assert.strictEqual(util.inspect(arr2), "[ 0, <4294967293 empty items>, 'max', '4294967295': 'too far' ]");
+
+ const arr3 = [];
+ arr3[-1] = -1;
+ assert.strictEqual(util.inspect(arr3), "[ '-1': -1 ]");
+ }
+
+ // Indices out of bounds.
+ {
+ const arr = [];
+ arr[2 ** 32] = true; // Not a valid array index.
+ assert.strictEqual(util.inspect(arr), "[ '4294967296': true ]");
+ arr[0] = true;
+ arr[10] = true;
+ assert.strictEqual(util.inspect(arr), "[ true, <9 empty items>, true, '4294967296': true ]");
+ arr[2 ** 32 - 2] = true;
+ arr[2 ** 32 - 1] = true;
+ arr[2 ** 32 + 1] = true;
+ delete arr[0];
+ delete arr[10];
+ assert.strictEqual(
+ util.inspect(arr),
+ [
+ "[",
+ "<4294967294 empty items>,",
+ "true,",
+ "'4294967296': true,",
+ "'4294967295': true,",
+ "'4294967297': true\n]",
+ ].join("\n "),
+ );
+ }
+
+ // Function with properties.
+ {
+ const value = () => {};
+ value.aprop = 42;
+ assert.strictEqual(util.inspect(value), "[Function: value] { aprop: 42 }");
+ }
+
+ // Anonymous function with properties.
+ {
+ const value = (() => function () {})();
+ value.aprop = 42;
+ assert.strictEqual(util.inspect(value), "[Function (anonymous)] { aprop: 42 }");
+ }
+
+ // Regular expressions with properties.
+ {
+ const value = /123/gi;
+ value.aprop = 42;
+ assert.strictEqual(util.inspect(value), "/123/gi { aprop: 42 }");
+ }
+
+ // Dates with properties.
+ {
+ const value = new Date("Sun, 14 Feb 2010 11:48:40 GMT");
+ value.aprop = 42;
+ assert.strictEqual(util.inspect(value), "2010-02-14T11:48:40.000Z { aprop: 42 }");
+ }
+
+ // Test the internal isDate implementation.
+ {
+ const Date2 = vm.runInNewContext("Date");
+ const d = new Date2();
+ const orig = util.inspect(d);
+ Date2.prototype.foo = "bar";
+ const after = util.inspect(d);
+ assert.strictEqual(orig, after);
+ }
+
+ // Test positive/negative zero.
+ assert.strictEqual(util.inspect(0), "0");
+ assert.strictEqual(util.inspect(-0), "-0");
+ // Edge case from check.
+ assert.strictEqual(util.inspect(-5e-324), "-5e-324");
+
+ // Test for sparse array.
+ {
+ const a = ["foo", "bar", "baz"];
+ assert.strictEqual(util.inspect(a), "[ 'foo', 'bar', 'baz' ]");
+ delete a[1];
+ assert.strictEqual(util.inspect(a), "[ 'foo', <1 empty item>, 'baz' ]");
+ assert.strictEqual(util.inspect(a, true), "[ 'foo', <1 empty item>, 'baz', [length]: 3 ]");
+ assert.strictEqual(util.inspect(new Array(5)), "[ <5 empty items> ]");
+ a[3] = "bar";
+ a[100] = "qux";
+ assert.strictEqual(
+ util.inspect(a, { breakLength: Infinity }),
+ "[ 'foo', <1 empty item>, 'baz', 'bar', <96 empty items>, 'qux' ]",
+ );
+ delete a[3];
+ assert.strictEqual(
+ util.inspect(a, { maxArrayLength: 4 }),
+ "[ 'foo', <1 empty item>, 'baz', <97 empty items>, ... 1 more item ]",
+ );
+ // test 4 special case
+ assert.strictEqual(
+ util.inspect(a, {
+ maxArrayLength: 2,
+ }),
+ "[ 'foo', <1 empty item>, ... 99 more items ]",
+ );
+ }
+
+ // Test for other constructors in different context.
+ {
+ let obj = vm.runInNewContext("(function(){return {}})()", {});
+ assert.strictEqual(util.inspect(obj), "{}");
+ obj = vm.runInNewContext("const m=new Map();m.set(1,2);m", {});
+ assert.strictEqual(util.inspect(obj), "Map(1) { 1 => 2 }");
+ obj = vm.runInNewContext("const s=new Set();s.add(1);s.add(2);s", {});
+ assert.strictEqual(util.inspect(obj), "Set(2) { 1, 2 }");
+ obj = vm.runInNewContext("fn=function(){};new Promise(fn,fn)", {});
+ assert.strictEqual(util.inspect(obj), "Promise { <pending> }");
+ }
+
+ // Test for property descriptors.
+ {
+ const getter = Object.create(null, {
+ a: {
+ get: function () {
+ return "aaa";
+ },
+ },
+ });
+ const setter = Object.create(null, {
+ b: {
+ set: function () {},
+ },
+ });
+ const getterAndSetter = Object.create(null, {
+ c: {
+ get: function () {
+ return "ccc";
+ },
+ set: function () {},
+ },
+ });
+ assert.strictEqual(util.inspect(getter, true), "[Object: null prototype] { [a]: [Getter] }");
+ assert.strictEqual(util.inspect(setter, true), "[Object: null prototype] { [b]: [Setter] }");
+ assert.strictEqual(util.inspect(getterAndSetter, true), "[Object: null prototype] { [c]: [Getter/Setter] }");
+ }
+
+ // Exceptions should print the error message, not '{}'.
+ {
+ [new Error(), new Error("FAIL"), new TypeError("FAIL"), new SyntaxError("FAIL")].forEach(err => {
+ assert(
+ //! temp bug workaround with replace()'s
+ util.inspect(err).startsWith(err.stack.replace(/^Error: /, err.message ? "$&" : "Error")),
+ `Expected "${util.inspect(err)}" to start with "${err.stack.replace(
+ /^Error: /,
+ err.message ? "$&" : "Error",
+ )}"`,
+ );
+ });
+
+ assert.throws(
+ () => undef(),
+ e => {
+ assert(util.inspect(e).startsWith(e.stack), `Expected "${util.inspect(e)}" to start with "${e.stack}"`);
+ return true;
+ },
+ );
+
+ const ex = util.inspect(new Error("FAIL"), true);
+ assert(ex.includes("Error: FAIL"));
+ assert(ex.includes("[stack]"));
+ assert(ex.includes("[message]"));
+ }
+
+ {
+ const falsyCause1 = new Error("", { cause: false });
+ delete falsyCause1.stack;
+ const falsyCause2 = new Error(undefined, { cause: null });
+ falsyCause2.stack = "";
+ const undefinedCause = new Error("", { cause: undefined });
+ undefinedCause.stack = "";
+
+ assert.match(util.inspect(falsyCause1), /^\[Error\] \{ .*\[cause\]: false.* \}$/);
+ assert.match(util.inspect(falsyCause2), /^\[Error\] \{ .*\[cause\]: null.* \}$/);
+ assert.match(util.inspect(undefinedCause), /^\[Error\] \{ .*\[cause\]: undefined.* \}$/);
+ }
+
+ {
+ const tmp = Error.stackTraceLimit;
+ Error.stackTraceLimit = 0;
+ const err = new Error("foo");
+ const err2 = new Error("foo\nbar");
+ assert.strictEqual(util.inspect(err, { compact: true }), "[Error: foo]");
+ //assert(err.stack); //! skipped test, broken in bun
+ delete err.stack;
+ assert(!err.stack);
+ assert.strictEqual(util.inspect(err, { compact: true }), "[Error: foo]");
+ assert.strictEqual(util.inspect(err2, { compact: true }), "[Error: foo\nbar]");
+
+ err.bar = true;
+ err2.bar = true;
+
+ assert.strictEqual(util.inspect(err, { compact: true }), "{ [Error: foo] bar: true }");
+ assert.strictEqual(util.inspect(err2, { compact: true }), "{ [Error: foo\nbar]\n bar: true }");
+ assert.strictEqual(util.inspect(err, { compact: true, breakLength: 5 }), "{ [Error: foo]\n bar: true }");
+ assert.strictEqual(util.inspect(err, { compact: true, breakLength: 1 }), "{ [Error: foo]\n bar:\n true }");
+ assert.strictEqual(util.inspect(err2, { compact: true, breakLength: 5 }), "{ [Error: foo\nbar]\n bar: true }");
+ assert.strictEqual(util.inspect(err, { compact: false }), "[Error: foo] {\n bar: true\n}");
+ assert.strictEqual(util.inspect(err2, { compact: false }), "[Error: foo\nbar] {\n bar: true\n}");
+
+ Error.stackTraceLimit = tmp;
+ }
+
+ // Prevent non-enumerable error properties from being printed.
+ {
+ // TODO(bun): Make originalLine and originalColumn non-enumerable
+ let err = new Error();
+ err.message = "foobar";
+ let out = util
+ .inspect(err)
+ .replace(/\{\s*originalLine: .+\s*originalColumn: .+\s*\}/, "")
+ .trim()
+ .split("\n");
+ assert.strictEqual(out[0], "Error: foobar");
+ assert(out.at(-1).startsWith(" at "), 'Expected "' + out.at(-1) + '" to start with " at "');
+ // Reset the error, the stack is otherwise not recreated.
+ err = new Error();
+ err.message = "foobar";
+ err.name = "Unique";
+ Object.defineProperty(err, "stack", { value: err.stack, enumerable: true });
+ out = util
+ .inspect(err)
+ .replace(/\{\s*originalLine: .+\s*originalColumn: .+\s*\}/, "")
+ .trim()
+ .split("\n");
+ assert.strictEqual(out[0], "Unique: foobar");
+ assert(out.at(-1).startsWith(" at "), 'Expected "' + out.at(-1) + '" to start with " at "');
+ err.name = "Baz";
+ out = util
+ .inspect(err)
+ .replace(/\n\s*originalLine: .+\s*originalColumn: .+/, "")
+ .trim()
+ .split("\n");
+ assert.strictEqual(out[0], "Unique: foobar");
+ assert.strictEqual(out.at(-2), " name: 'Baz',");
+ assert.strictEqual(out.at(-1), "}");
+ }
+
+ // Doesn't capture stack trace.
+ {
+ function BadCustomError(msg) {
+ Error.call(this);
+ Object.defineProperty(this, "message", { value: msg, enumerable: false });
+ Object.defineProperty(this, "name", { value: "BadCustomError", enumerable: false });
+ }
+ Object.setPrototypeOf(BadCustomError.prototype, Error.prototype);
+ Object.setPrototypeOf(BadCustomError, Error);
+ assert.strictEqual(util.inspect(new BadCustomError("foo")), "[BadCustomError: foo]");
+ }
+
+ // Tampered error stack or name property (different type than string).
+ // Note: Symbols are not supported by `Error#toString()` which is called by accessing the `stack` property.
+ // TODO: Node 20+ changed how it handles the these cases, we should update to match such behavior.
+ // It should now preserve the original name and display the user-defined one as an extra property.
+ [
+ [404, "404: foo", "[404]"],
+ [0, "0: foo", "[RangeError: foo]"],
+ [0n, "0: foo", "[RangeError: foo]"],
+ [null, "null: foo", "[RangeError: foo]"],
+ //[undefined, 'RangeError: foo', '[RangeError: foo]'],
+ [false, "false: foo", "[RangeError: foo]"],
+ ["", "foo", "[RangeError: foo]"],
+ //[[1, 2, 3], '1,2,3: foo', '[1,2,3]'],
+ ].forEach(([value, outputStart, stack]) => {
+ let err = new RangeError("foo");
+ err.name = value;
+ assert(
+ util.inspect(err).startsWith(outputStart),
+ util.format(
+ 'The name set to %o did not result in the expected output "%s", received "%s"',
+ value,
+ outputStart,
+ util.inspect(err).split("\n")[0],
+ ),
+ );
+
+ err = new RangeError("foo");
+ err.stack = value;
+ assert.strictEqual(util.inspect(err).split(" { ")[0], stack);
+ });
+
+ // https://github.com/nodejs/node-v0.x-archive/issues/1941
+ assert.strictEqual(util.inspect({ __proto__: Date.prototype }), "Date {}");
+
+ // https://github.com/nodejs/node-v0.x-archive/issues/1944
+ {
+ const d = new Date();
+ d.toUTCString = null;
+ util.inspect(d);
+ }
+
+ // Should not throw.
+ {
+ const d = new Date();
+ d.toISOString = null;
+ util.inspect(d);
+ }
+
+ // Should not throw.
+ {
+ const r = /regexp/;
+ r.toString = null;
+ util.inspect(r);
+ }
+
+ // Ref: https://github.com/nodejs/node-v0.x-archive/issues/2225
+ {
+ const x = { [util.inspect.custom]: util.inspect };
+ assert(
+ util.inspect(x).includes("[Symbol(nodejs.util.inspect.custom)]: [Function: inspect] {\n"),
+ `Expected '${util.inspect(x)}' to include '[Symbol(nodejs.util.inspect.custom)]: [Function: inspect] {\n'`,
+ );
+ }
+
+ // `util.inspect` should display the escaped value of a key.
+ {
+ const w = {
+ "\\": 1,
+ "\\\\": 2,
+ "\\\\\\": 3,
+ "\\\\\\\\": 4,
+ "\n": 5,
+ "\r": 6,
+ };
+
+ const y = ["a", "b", "c"];
+ y["\\\\"] = "d";
+ y["\n"] = "e";
+ y["\r"] = "f";
+
+ assert.strictEqual(
+ util.inspect(w),
+ "{ '\\\\': 1, '\\\\\\\\': 2, '\\\\\\\\\\\\': 3, " + "'\\\\\\\\\\\\\\\\': 4, '\\n': 5, '\\r': 6 }",
+ );
+ assert.strictEqual(util.inspect(y), "[ 'a', 'b', 'c', '\\\\\\\\': 'd', " + "'\\n': 'e', '\\r': 'f' ]");
+ }
+
+ // Escape unpaired surrogate pairs.
+ {
+ const edgeChar = String.fromCharCode(0xd799);
+
+ for (let charCode = 0xd800; charCode < 0xdfff; charCode++) {
+ const surrogate = String.fromCharCode(charCode);
+
+ assert.strictEqual(util.inspect(surrogate), `'\\u${charCode.toString(16)}'`);
+ assert.strictEqual(
+ util.inspect(`${"a".repeat(200)}${surrogate}`),
+ `'${"a".repeat(200)}\\u${charCode.toString(16)}'`,
+ );
+ assert.strictEqual(
+ util.inspect(`${surrogate}${"a".repeat(200)}`),
+ `'\\u${charCode.toString(16)}${"a".repeat(200)}'`,
+ );
+ if (charCode < 0xdc00) {
+ const highSurrogate = surrogate;
+ const lowSurrogate = String.fromCharCode(charCode + 1024);
+ assert(!util.inspect(`${edgeChar}${highSurrogate}${lowSurrogate}${edgeChar}`).includes("\\u"));
+ assert.strictEqual(
+ (util.inspect(`${highSurrogate}${highSurrogate}${lowSurrogate}`).match(/\\u/g) ?? []).length,
+ 1,
+ );
+ } else {
+ assert.strictEqual(
+ util.inspect(`${edgeChar}${surrogate}${edgeChar}`),
+ `'${edgeChar}\\u${charCode.toString(16)}${edgeChar}'`,
+ );
+ }
+ }
+ }
+
+ // Test util.inspect.styles and util.inspect.colors.
+ {
+ function testColorStyle(style, input) {
+ const colorName = util.inspect.styles[style];
+ let color = ["", ""];
+ if (util.inspect.colors[colorName]) color = util.inspect.colors[colorName];
+
+ const withoutColor = util.inspect(input, false, 0, false);
+ const withColor = util.inspect(input, false, 0, true);
+ const expect = `\u001b[${color[0]}m${withoutColor}\u001b[${color[1]}m`;
+ assert.strictEqual(withColor, expect, `util.inspect color for style ${style}`);
+ }
+
+ testColorStyle("special", function () {});
+ testColorStyle("number", 123.456);
+ testColorStyle("boolean", true);
+ testColorStyle("undefined", undefined);
+ testColorStyle("null", null);
+ testColorStyle("string", "test string");
+ testColorStyle("date", new Date());
+ testColorStyle("regexp", /regexp/);
+ }
+
+ // An object with "hasOwnProperty" overwritten should not throw.
+ util.inspect({ hasOwnProperty: null });
+
+ // New API, accepts an "options" object.
+ {
+ const subject = { foo: "bar", hello: 31, a: { b: { c: { d: 0 } } } };
+ Object.defineProperty(subject, "hidden", { enumerable: false, value: null });
+
+ assert.strictEqual(util.inspect(subject, { showHidden: false }).includes("hidden"), false);
+ assert.strictEqual(util.inspect(subject, { showHidden: true }).includes("hidden"), true);
+ assert.strictEqual(util.inspect(subject, { colors: false }).includes("\u001b[32m"), false);
+ assert.strictEqual(util.inspect(subject, { colors: true }).includes("\u001b[32m"), true);
+ assert.strictEqual(util.inspect(subject, { depth: 2 }).includes("c: [Object]"), true);
+ assert.strictEqual(util.inspect(subject, { depth: 0 }).includes("a: [Object]"), true);
+ assert.strictEqual(util.inspect(subject, { depth: null }).includes("{ d: 0 }"), true);
+ assert.strictEqual(util.inspect(subject, { depth: undefined }).includes("{ d: 0 }"), true);
+ }
+
+ {
+ // "customInspect" option can enable/disable calling [util.inspect.custom]().
+ const subject = { [util.inspect.custom]: () => 123 };
+
+ assert.strictEqual(util.inspect(subject, { customInspect: true }).includes("123"), true);
+ assert.strictEqual(util.inspect(subject, { customInspect: true }).includes("inspect"), false);
+ assert.strictEqual(util.inspect(subject, { customInspect: false }).includes("123"), false);
+ assert.strictEqual(util.inspect(subject, { customInspect: false }).includes("inspect"), true);
+
+ // A custom [util.inspect.custom]() should be able to return other Objects.
+ subject[util.inspect.custom] = () => ({ foo: "bar" });
+
+ assert.strictEqual(util.inspect(subject), "{ foo: 'bar' }");
+
+ subject[util.inspect.custom] = mustCall((depth, opts, inspect) => {
+ const clone = { ...opts };
+ // This might change at some point but for now we keep the stylize function.
+ // The function should either be documented or an alternative should be implemented.
+ assert.strictEqual(typeof opts.stylize, "function");
+ assert.strictEqual(opts.seen, undefined);
+ assert.strictEqual(opts.budget, undefined);
+ assert.strictEqual(opts.indentationLvl, undefined);
+ assert.strictEqual(opts.showHidden, false);
+ assert.strictEqual(inspect, util.inspect);
+ assert.deepStrictEqual(
+ new Set(Object.keys(inspect.defaultOptions).concat(["stylize"])),
+ new Set(Object.keys(opts)),
+ );
+ opts.showHidden = true;
+ return {
+ [inspect.custom]: mustCall((depth, opts2) => {
+ assert.deepStrictEqual(clone, opts2);
+ }),
+ };
+ });
+
+ util.inspect(subject);
+
+ // util.inspect.custom is a shared symbol which can be accessed as
+ // Symbol.for("nodejs.util.inspect.custom").
+ const inspect = Symbol.for("nodejs.util.inspect.custom");
+
+ subject[inspect] = () => ({ baz: "quux" });
+
+ assert.strictEqual(util.inspect(subject), "{ baz: 'quux' }");
+
+ subject[inspect] = (depth, opts) => {
+ assert.strictEqual(opts.customInspectOptions, true);
+ assert.strictEqual(opts.seen, null);
+ return {};
+ };
+
+ util.inspect(subject, { customInspectOptions: true, seen: null });
+ }
+
+ {
+ const subject = {
+ [util.inspect.custom]: mustCall((depth, opts) => {
+ assert.strictEqual(depth, null);
+ assert.strictEqual(opts.compact, true);
+ }),
+ };
+ util.inspect(subject, { depth: null, compact: true });
+ }
+
+ {
+ // Returning `this` from a custom inspection function works.
+ const subject = {
+ a: 123,
+ [util.inspect.custom]() {
+ return this;
+ },
+ };
+ const UIC = "nodejs.util.inspect.custom";
+ assert.strictEqual(util.inspect(subject), `{\n a: 123,\n [Symbol(${UIC})]: [Function: [${UIC}]]\n}`);
+ }
+
+ //! non-standard property
+ // Verify that it's possible to use the stylize function to manipulate input.
+ /*assert.strictEqual(
+ util.inspect([1, 2, 3], { stylize() { return 'x'; } }),
+ '[ x, x, x ]'
+ );*/
+
+ // Using `util.inspect` with "colors" option should produce as many lines as
+ // without it.
+ {
+ function testLines(input) {
+ const countLines = str => (str.match(/\n/g) || []).length;
+ const withoutColor = util.inspect(input);
+ const withColor = util.inspect(input, { colors: true });
+ assert.strictEqual(countLines(withoutColor), countLines(withColor));
+ }
+
+ const bigArray = new Array(100).fill().map((value, index) => index);
+
+ testLines([1, 2, 3, 4, 5, 6, 7]);
+ testLines(bigArray);
+ testLines({ foo: "bar", baz: 35, b: { a: 35 } });
+ testLines({ a: { a: 3, b: 1, c: 1, d: 1, e: 1, f: 1, g: 1, h: 1 }, b: 1 });
+ testLines({
+ foo: "bar",
+ baz: 35,
+ b: { a: 35 },
+ veryLongKey: "very long value",
+ evenLongerKey: ["with even longer value in array"],
+ });
+ }
+
+ // Test boxed primitives output the correct values.
+ assert.strictEqual(util.inspect(new String("test")), "[String: 'test']");
+ assert.strictEqual(util.inspect(new String("test"), { colors: true }), "\u001b[32m[String: 'test']\u001b[39m");
+ assert.strictEqual(util.inspect(Object(Symbol("test"))), "[Symbol: Symbol(test)]");
+ assert.strictEqual(util.inspect(new Boolean(false)), "[Boolean: false]");
+ assert.strictEqual(util.inspect(Object.setPrototypeOf(new Boolean(true), null)), "[Boolean (null prototype): true]");
+ assert.strictEqual(util.inspect(new Number(0)), "[Number: 0]");
+
+ assert.strictEqual(
+ util.inspect(
+ Object.defineProperty(Object.setPrototypeOf(new Number(-0), Array.prototype), Symbol.toStringTag, {
+ value: "Foobar",
+ }),
+ ),
+ "[Number (Array): -0] [Foobar]",
+ );
+ assert.strictEqual(util.inspect(new Number(-1.1)), "[Number: -1.1]");
+ assert.strictEqual(util.inspect(new Number(13.37)), "[Number: 13.37]");
+
+ // Test boxed primitives with own properties.
+ {
+ const str = new String("baz");
+ str.foo = "bar";
+ assert.strictEqual(util.inspect(str), "[String: 'baz'] { foo: 'bar' }");
+
+ const bool = new Boolean(true);
+ bool.foo = "bar";
+ assert.strictEqual(util.inspect(bool), "[Boolean: true] { foo: 'bar' }");
+
+ const num = new Number(13.37);
+ num.foo = "bar";
+ assert.strictEqual(util.inspect(num), "[Number: 13.37] { foo: 'bar' }");
+
+ const sym = Object(Symbol("foo"));
+ sym.foo = "bar";
+ assert.strictEqual(util.inspect(sym), "[Symbol: Symbol(foo)] { foo: 'bar' }");
+
+ const big = Object(BigInt(55));
+ big.foo = "bar";
+ assert.strictEqual(util.inspect(big), "[BigInt: 55n] { foo: 'bar' }");
+ }
+
+ // Test es6 Symbol.
+ if (typeof Symbol !== "undefined") {
+ assert.strictEqual(util.inspect(Symbol()), "Symbol()");
+ assert.strictEqual(util.inspect(Symbol(123)), "Symbol(123)");
+ assert.strictEqual(util.inspect(Symbol("hi")), "Symbol(hi)");
+ assert.strictEqual(util.inspect([Symbol()]), "[ Symbol() ]");
+ assert.strictEqual(util.inspect({ foo: Symbol() }), "{ foo: Symbol() }");
+
+ const options = { showHidden: true };
+ let subject = {};
+
+ subject[Symbol("sym\nbol")] = 42;
+
+ assert.strictEqual(util.inspect(subject), "{ [Symbol(sym\\nbol)]: 42 }");
+ assert.strictEqual(util.inspect(subject, options), "{ [Symbol(sym\\nbol)]: 42 }");
+
+ Object.defineProperty(subject, Symbol(), { enumerable: false, value: "non-enum" });
+ assert.strictEqual(util.inspect(subject), "{ [Symbol(sym\\nbol)]: 42 }");
+ assert.strictEqual(util.inspect(subject, options), "{ [Symbol(sym\\nbol)]: 42, [Symbol()]: 'non-enum' }");
+
+ subject = [1, 2, 3];
+ subject[Symbol("symbol")] = 42;
+ assert.strictEqual(util.inspect(subject), "[ 1, 2, 3, [Symbol(symbol)]: 42 ]");
+ }
+
+ // Test Set.
+ {
+ assert.strictEqual(util.inspect(new Set()), "Set(0) {}");
+ assert.strictEqual(util.inspect(new Set([1, 2, 3])), "Set(3) { 1, 2, 3 }");
+ assert.strictEqual(util.inspect(new Set([1, 2, 3]), { maxArrayLength: 1 }), "Set(3) { 1, ... 2 more items }");
+ const set = new Set(["foo"]);
+ set.bar = 42;
+ assert.strictEqual(util.inspect(set, { showHidden: true }), "Set(1) { 'foo', bar: 42 }");
+ }
+
+ // Test circular Set.
+ {
+ const set = new Set();
+ set.add(set);
+ assert.strictEqual(util.inspect(set), "<ref *1> Set(1) { [Circular *1] }");
+ }
+
+ // Test Map.
+ {
+ assert.strictEqual(util.inspect(new Map()), "Map(0) {}");
+ assert.strictEqual(
+ util.inspect(
+ new Map([
+ [1, "a"],
+ [2, "b"],
+ [3, "c"],
+ ]),
+ ),
+ "Map(3) { 1 => 'a', 2 => 'b', 3 => 'c' }",
+ );
+ assert.strictEqual(
+ util.inspect(
+ new Map([
+ [1, "a"],
+ [2, "b"],
+ [3, "c"],
+ ]),
+ { maxArrayLength: 1 },
+ ),
+ "Map(3) { 1 => 'a', ... 2 more items }",
+ );
+ const map = new Map([["foo", null]]);
+ map.bar = 42;
+ assert.strictEqual(util.inspect(map, true), "Map(1) { 'foo' => null, bar: 42 }");
+ }
+
+ // Test circular Map.
+ {
+ const map = new Map();
+ map.set(map, "map");
+ assert.strictEqual(inspect(map), "<ref *1> Map(1) { [Circular *1] => 'map' }");
+ map.set(map, map);
+ assert.strictEqual(inspect(map), "<ref *1> Map(1) { [Circular *1] => [Circular *1] }");
+ map.delete(map);
+ map.set("map", map);
+ assert.strictEqual(inspect(map), "<ref *1> Map(1) { 'map' => [Circular *1] }");
+ }
+
+ // Test multiple circular references.
+ {
+ const obj = {};
+ obj.a = [obj];
+ obj.b = {};
+ obj.b.inner = obj.b;
+ obj.b.obj = obj;
+
+ assert.strictEqual(
+ inspect(obj),
+ "<ref *1> {\n" +
+ " a: [ [Circular *1] ],\n" +
+ " b: <ref *2> { inner: [Circular *2], obj: [Circular *1] }\n" +
+ "}",
+ );
+ }
+
+ // Test Promise.
+ {
+ const resolved = Promise.resolve(3);
+ assert.strictEqual(util.inspect(resolved), "Promise { 3 }");
+
+ const rejected = Promise.reject(3);
+ assert.strictEqual(util.inspect(rejected), "Promise { <rejected> 3 }");
+ // Squelch UnhandledPromiseRejection.
+ rejected.catch(() => {});
+
+ const pending = new Promise(() => {});
+ assert.strictEqual(util.inspect(pending), "Promise { <pending> }");
+
+ const promiseWithProperty = Promise.resolve("foo");
+ promiseWithProperty.bar = 42;
+ assert.strictEqual(util.inspect(promiseWithProperty), "Promise { 'foo', bar: 42 }");
+ }
+
+ // Make sure it doesn't choke on polyfills. Unlike Set/Map, there is no standard interface to
+ // synchronously inspect a Promise, so our techniques only work on a bonafide native Promise.
+ {
+ const oldPromise = Promise;
+ global.Promise = function () {
+ this.bar = 42;
+ };
+ assert.strictEqual(util.inspect(new Promise()), "{ bar: 42 }");
+ global.Promise = oldPromise;
+ }
+
+ // Test Map iterators.
+ {
+ const map = new Map([["foo", "bar"]]);
+ assert.strictEqual(util.inspect(map.keys()), "[Map Iterator] { 'foo' }");
+ const mapValues = map.values();
+ Object.defineProperty(mapValues, Symbol.toStringTag, { value: "Foo" });
+ assert.strictEqual(util.inspect(mapValues), "[Foo] [Map Iterator] { 'bar' }");
+ map.set("A", "B!");
+ assert.strictEqual(
+ util.inspect(map.entries(), { maxArrayLength: 1 }),
+ "[Map Entries] { [ 'foo', 'bar' ], ... 1 more item }",
+ );
+ // Make sure the iterator doesn't get consumed.
+ const keys = map.keys();
+ assert.strictEqual(util.inspect(keys), "[Map Iterator] { 'foo', 'A' }");
+ assert.strictEqual(util.inspect(keys), "[Map Iterator] { 'foo', 'A' }");
+ keys.extra = true;
+ assert.strictEqual(util.inspect(keys, { maxArrayLength: 0 }), "[Map Iterator] { ... 2 more items, extra: true }");
+ }
+
+ // Test Set iterators.
+ {
+ const aSet = new Set([1]);
+ assert.strictEqual(util.inspect(aSet.entries(), { compact: false }), "[Set Entries] {\n [\n 1,\n 1\n ]\n}");
+ aSet.add(3);
+ assert.strictEqual(util.inspect(aSet.keys()), "[Set Iterator] { 1, 3 }");
+ assert.strictEqual(util.inspect(aSet.values()), "[Set Iterator] { 1, 3 }");
+ const setEntries = aSet.entries();
+ Object.defineProperty(setEntries, Symbol.toStringTag, { value: "Foo" });
+ assert.strictEqual(util.inspect(setEntries), "[Foo] [Set Entries] { [ 1, 1 ], [ 3, 3 ] }");
+ // Make sure the iterator doesn't get consumed.
+ const keys = aSet.keys();
+ Object.defineProperty(keys, Symbol.toStringTag, { value: null });
+ assert.strictEqual(util.inspect(keys), "[Set Iterator] { 1, 3 }");
+ assert.strictEqual(util.inspect(keys), "[Set Iterator] { 1, 3 }");
+ keys.extra = true;
+ assert.strictEqual(util.inspect(keys, { maxArrayLength: 1 }), "[Set Iterator] { 1, ... 1 more item, extra: true }");
+ }
+
+ // Minimal inspection should still return as much information as possible about
+ // the constructor and Symbol.toStringTag.
+ {
+ class Foo {
+ get [Symbol.toStringTag]() {
+ return "ABC";
+ }
+ }
+ const a = new Foo();
+ assert.strictEqual(inspect(a, { depth: -1 }), "Foo [ABC] {}");
+ a.foo = true;
+ assert.strictEqual(inspect(a, { depth: -1 }), "[Foo [ABC]]");
+ Object.defineProperty(a, Symbol.toStringTag, {
+ value: "Foo",
+ configurable: true,
+ writable: true,
+ });
+ assert.strictEqual(inspect(a, { depth: -1 }), "[Foo]");
+ delete a[Symbol.toStringTag];
+ Object.setPrototypeOf(a, null);
+ // TODO: null prototypes
+ // assert.strictEqual(inspect(a, { depth: -1 }), '[Foo: null prototype]');
+ assert.strictEqual(inspect(a, { depth: -1 }), "[Object: null prototype]");
+ delete a.foo;
+ assert.strictEqual(
+ inspect(a, { depth: -1 }),
+ // TODO: '[Foo: null prototype] {}');
+ "[Object: null prototype] {}",
+ );
+ Object.defineProperty(a, Symbol.toStringTag, {
+ value: "ABC",
+ configurable: true,
+ });
+ assert.strictEqual(
+ inspect(a, { depth: -1 }),
+ // TODO: '[Foo: null prototype] [ABC] {}'
+ "[Object: null prototype] [ABC] {}",
+ );
+ Object.defineProperty(a, Symbol.toStringTag, {
+ value: "Foo",
+ configurable: true,
+ });
+ assert.strictEqual(inspect(a, { depth: -1 }), "[Object: null prototype] [Foo] {}");
+ }
+
+ // Test alignment of items in container.
+ // Assumes that the first numeric character is the start of an item.
+ {
+ function checkAlignment(container, start, lineX, end) {
+ const lines = util.inspect(container).split("\n");
+ lines.forEach((line, i) => {
+ if (i === 0) {
+ assert.strictEqual(line, start);
+ } else if (i === lines.length - 1) {
+ assert.strictEqual(line, end);
+ } else {
+ let expected = lineX.replace("X", i - 1);
+ if (i !== lines.length - 2) expected += ",";
+ assert.strictEqual(line, expected);
+ }
+ });
+ }
+
+ const bigArray = [];
+ for (let i = 0; i < 100; i++) {
+ bigArray.push(i);
+ }
+
+ const obj = {};
+ bigArray.forEach(prop => {
+ obj[prop] = null;
+ });
+
+ checkAlignment(obj, "{", " 'X': null", "}");
+ checkAlignment(new Set(bigArray), "Set(100) {", " X", "}");
+ checkAlignment(new Map(bigArray.map(number => [number, null])), "Map(100) {", " X => null", "}");
+ }
+
+ // Test display of constructors.
+ {
+ class ObjectSubclass {}
+ class ArraySubclass extends Array {}
+ class SetSubclass extends Set {}
+ class MapSubclass extends Map {}
+ class PromiseSubclass extends Promise {}
+ class SymbolNameClass {
+ static name = Symbol("name");
+ }
+
+ const x = new ObjectSubclass();
+ x.foo = 42;
+ assert.strictEqual(util.inspect(x), "ObjectSubclass { foo: 42 }");
+ assert.strictEqual(util.inspect(new ArraySubclass(1, 2, 3)), "ArraySubclass(3) [ 1, 2, 3 ]");
+ assert.strictEqual(util.inspect(new SetSubclass([1, 2, 3])), "SetSubclass(3) [Set] { 1, 2, 3 }");
+ assert.strictEqual(util.inspect(new MapSubclass([["foo", 42]])), "MapSubclass(1) [Map] { 'foo' => 42 }");
+ assert.strictEqual(util.inspect(new PromiseSubclass(() => {})), "PromiseSubclass [Promise] { <pending> }");
+ assert.strictEqual(util.inspect(new SymbolNameClass()), "Symbol(name) {}");
+ assert.strictEqual(
+ util.inspect({ a: { b: new ArraySubclass([1, [2], 3]) } }, { depth: 1 }),
+ "{ a: { b: [ArraySubclass] } }",
+ );
+ assert.strictEqual(
+ util.inspect(Object.setPrototypeOf(x, null)),
+ // TODO: '[ObjectSubclass: null prototype] { foo: 42 }'
+ "[Object: null prototype] { foo: 42 }",
+ );
+ }
+
+ // Empty and circular before depth.
+ {
+ const arr = [[[[]]]];
+ assert.strictEqual(util.inspect(arr), "[ [ [ [] ] ] ]");
+ arr[0][0][0][0] = [];
+ assert.strictEqual(util.inspect(arr), "[ [ [ [Array] ] ] ]");
+ arr[0][0][0] = {};
+ assert.strictEqual(util.inspect(arr), "[ [ [ {} ] ] ]");
+ arr[0][0][0] = { a: 2 };
+ assert.strictEqual(util.inspect(arr), "[ [ [ [Object] ] ] ]");
+ arr[0][0][0] = arr;
+ assert.strictEqual(util.inspect(arr), "<ref *1> [ [ [ [Circular *1] ] ] ]");
+ arr[0][0][0] = arr[0][0];
+ assert.strictEqual(util.inspect(arr), "[ [ <ref *1> [ [Circular *1] ] ] ]");
+ }
+
+ // Corner cases.
+ {
+ const x = { constructor: 42 };
+ assert.strictEqual(util.inspect(x), "{ constructor: 42 }");
+ }
+
+ {
+ const x = {};
+ Object.defineProperty(x, "constructor", {
+ get: function () {
+ throw new Error("should not access constructor");
+ },
+ enumerable: true,
+ });
+ assert.strictEqual(util.inspect(x), "{ constructor: [Getter] }");
+ }
+
+ {
+ const x = new (function () {})();
+ assert.strictEqual(util.inspect(x), "{}");
+ }
+
+ {
+ const x = { __proto__: null };
+ assert.strictEqual(util.inspect(x), "[Object: null prototype] {}");
+ }
+
+ {
+ const x = [];
+ x[""] = 1;
+ assert.strictEqual(util.inspect(x), "[ '': 1 ]");
+ }
+
+ // The following maxArrayLength tests were introduced after v6.0.0 was released.
+ // Do not backport to v5/v4 unless all of
+ // https://github.com/nodejs/node/pull/6334 is backported.
+ {
+ const x = new Array(101).fill();
+ assert(util.inspect(x).endsWith("1 more item\n]"));
+ assert(!util.inspect(x, { maxArrayLength: 101 }).endsWith("1 more item\n]"));
+ assert.strictEqual(util.inspect(x, { maxArrayLength: -1 }), "[ ... 101 more items ]");
+ assert.strictEqual(util.inspect(x, { maxArrayLength: 0 }), "[ ... 101 more items ]");
+ }
+
+ {
+ const x = Array(101);
+ assert.strictEqual(util.inspect(x, { maxArrayLength: 0 }), "[ ... 101 more items ]");
+ assert(!util.inspect(x, { maxArrayLength: null }).endsWith("1 more item\n]"));
+ assert(!util.inspect(x, { maxArrayLength: Infinity }).endsWith("1 more item ]"));
+ }
+
+ {
+ const x = new Uint8Array(101);
+ assert(util.inspect(x).endsWith("1 more item\n]"));
+ assert(!util.inspect(x, { maxArrayLength: 101 }).includes("1 more item"));
+ assert.strictEqual(util.inspect(x, { maxArrayLength: 0 }), "Uint8Array(101) [ ... 101 more items ]");
+ assert(!util.inspect(x, { maxArrayLength: null }).includes("1 more item"));
+ assert(util.inspect(x, { maxArrayLength: Infinity }).endsWith(" 0, 0\n]"));
+ }
+
+ {
+ const obj = { foo: "abc", bar: "xyz" };
+ const oneLine = util.inspect(obj, { breakLength: Infinity });
+ // Subtract four for the object's two curly braces and two spaces of padding.
+ // Add one more to satisfy the strictly greater than condition in the code.
+ const breakpoint = oneLine.length - 5;
+ const twoLines = util.inspect(obj, { breakLength: breakpoint });
+
+ assert.strictEqual(oneLine, "{ foo: 'abc', bar: 'xyz' }");
+ assert.strictEqual(util.inspect(obj, { breakLength: breakpoint + 1 }), twoLines);
+ assert.strictEqual(twoLines, "{\n foo: 'abc',\n bar: 'xyz'\n}");
+ }
+
+ // util.inspect.defaultOptions tests.
+ {
+ const arr = new Array(101).fill();
+ const obj = { a: { a: { a: { a: 1 } } } };
+
+ const oldOptions = { ...util.inspect.defaultOptions };
+
+ // Set single option through property assignment.
+ util.inspect.defaultOptions.maxArrayLength = null;
+ assert.doesNotMatch(util.inspect(arr), /1 more item/);
+ util.inspect.defaultOptions.maxArrayLength = oldOptions.maxArrayLength;
+ assert.match(util.inspect(arr), /1 more item/);
+ util.inspect.defaultOptions.depth = null;
+ assert.doesNotMatch(util.inspect(obj), /Object/);
+ util.inspect.defaultOptions.depth = oldOptions.depth;
+ assert.match(util.inspect(obj), /Object/);
+ assert.strictEqual(JSON.stringify(util.inspect.defaultOptions), JSON.stringify(oldOptions));
+
+ // Set multiple options through object assignment.
+ util.inspect.defaultOptions = { maxArrayLength: null, depth: 2 };
+ assert.doesNotMatch(util.inspect(arr), /1 more item/);
+ assert.match(util.inspect(obj), /Object/);
+ util.inspect.defaultOptions = oldOptions;
+ assert.match(util.inspect(arr), /1 more item/);
+ assert.match(util.inspect(obj), /Object/);
+ assert.strictEqual(JSON.stringify(util.inspect.defaultOptions), JSON.stringify(oldOptions));
+
+ assert.throws(
+ () => {
+ util.inspect.defaultOptions = null;
+ },
+ {
+ code: "ERR_INVALID_ARG_TYPE",
+ name: "TypeError",
+ message: 'The "options" argument must be of type object. ' + "Received null",
+ },
+ );
+
+ assert.throws(
+ () => {
+ util.inspect.defaultOptions = "bad";
+ },
+ {
+ code: "ERR_INVALID_ARG_TYPE",
+ name: "TypeError",
+ message: 'The "options" argument must be of type object. ' + "Received type string ('bad')",
+ },
+ );
+ }
+
+ util.inspect(process);
+
+ // Setting custom inspect property to a non-function should do nothing.
+ {
+ const obj = { [util.inspect.custom]: "fhqwhgads" };
+ assert.strictEqual(util.inspect(obj), "{ [Symbol(nodejs.util.inspect.custom)]: 'fhqwhgads' }");
+ }
+
+ {
+ // @@toStringTag
+ const obj = { [Symbol.toStringTag]: "a" };
+ assert.strictEqual(util.inspect(obj), "{ [Symbol(Symbol.toStringTag)]: 'a' }");
+ Object.defineProperty(obj, Symbol.toStringTag, {
+ value: "a",
+ enumerable: false,
+ });
+ assert.strictEqual(util.inspect(obj), "Object [a] {}");
+ assert.strictEqual(util.inspect(obj, { showHidden: true }), "{ [Symbol(Symbol.toStringTag)]: 'a' }");
+
+ class Foo {
+ constructor() {
+ this.foo = "bar";
+ }
+
+ get [Symbol.toStringTag]() {
+ return this.foo;
+ }
+ }
+
+ assert.strictEqual(
+ util.inspect(Object.create(null, { [Symbol.toStringTag]: { value: "foo" } })),
+ "[Object: null prototype] [foo] {}",
+ );
+
+ assert.strictEqual(util.inspect(new Foo()), "Foo [bar] { foo: 'bar' }");
+
+ assert.strictEqual(util.inspect(new (class extends Foo {})()), "Foo [bar] { foo: 'bar' }");
+
+ assert.strictEqual(
+ util.inspect(
+ Object.create(
+ { __proto__: Foo.prototype },
+ {
+ foo: { value: "bar", enumerable: true },
+ },
+ ),
+ ),
+ "Foo [bar] { foo: 'bar' }",
+ );
+
+ class ThrowingClass {
+ get [Symbol.toStringTag]() {
+ throw new Error("toStringTag error");
+ }
+ }
+
+ assert.throws(() => util.inspect(new ThrowingClass()), /toStringTag error/);
+
+ class NotStringClass {
+ get [Symbol.toStringTag]() {
+ return null;
+ }
+ }
+
+ assert.strictEqual(util.inspect(new NotStringClass()), "NotStringClass {}");
+ }
+
+ {
+ const o = {
+ a: [
+ 1,
+ 2,
+ [
+ [
+ "Lorem ipsum dolor\nsit amet,\tconsectetur adipiscing elit, sed do " +
+ "eiusmod tempor incididunt ut labore et dolore magna aliqua.",
+ "test",
+ "foo",
+ ],
+ ],
+ 4,
+ ],
+ b: new Map([
+ ["za", 1],
+ ["zb", "test"],
+ ]),
+ };
+
+ let out = util.inspect(o, { compact: true, depth: 5, breakLength: 80 });
+ let expect = [
+ "{ a:",
+ " [ 1,",
+ " 2,",
+ " [ [ 'Lorem ipsum dolor\\nsit amet,\\tconsectetur adipiscing elit, " +
+ "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',",
+ " 'test',",
+ " 'foo' ] ],",
+ " 4 ],",
+ " b: Map(2) { 'za' => 1, 'zb' => 'test' } }",
+ ].join("\n");
+ assert.strictEqual(out, expect);
+
+ out = util.inspect(o, { compact: false, depth: 5, breakLength: 60 });
+ expect = [
+ "{",
+ " a: [",
+ " 1,",
+ " 2,",
+ " [",
+ " [",
+ " 'Lorem ipsum dolor\\n' +",
+ " 'sit amet,\\tconsectetur adipiscing elit, sed do eiusmod " +
+ "tempor incididunt ut labore et dolore magna aliqua.',",
+ " 'test',",
+ " 'foo'",
+ " ]",
+ " ],",
+ " 4",
+ " ],",
+ " b: Map(2) {",
+ " 'za' => 1,",
+ " 'zb' => 'test'",
+ " }",
+ "}",
+ ].join("\n");
+ assert.strictEqual(out, expect);
+
+ out = util.inspect(o.a[2][0][0], { compact: false, breakLength: 30 });
+ expect = [
+ "'Lorem ipsum dolor\\n' +",
+ " 'sit amet,\\tconsectetur adipiscing elit, sed do eiusmod tempor " +
+ "incididunt ut labore et dolore magna aliqua.'",
+ ].join("\n");
+ assert.strictEqual(out, expect);
+
+ out = util.inspect("12345678901234567890123456789012345678901234567890", { compact: false, breakLength: 3 });
+ expect = "'12345678901234567890123456789012345678901234567890'";
+ assert.strictEqual(out, expect);
+
+ out = util.inspect("12 45 78 01 34 67 90 23 56 89 123456789012345678901234567890", {
+ compact: false,
+ breakLength: 3,
+ });
+ expect = ["'12 45 78 01 34 67 90 23 56 89 123456789012345678901234567890'"].join("\n");
+ assert.strictEqual(out, expect);
+
+ o.a = () => {};
+ o.b = new Number(3);
+ out = util.inspect(o, { compact: false, breakLength: 3 });
+ expect = ["{", " a: [Function (anonymous)],", " b: [Number: 3]", "}"].join("\n");
+ assert.strictEqual(out, expect);
+
+ out = util.inspect(o, { compact: false, breakLength: 3, showHidden: true });
+ expect = [
+ "{",
+ " a: [Function (anonymous)] {",
+ " [length]: 0,",
+ " [name]: ''",
+ " },",
+ " b: [Number: 3]",
+ "}",
+ ].join("\n");
+ assert.strictEqual(out, expect);
+
+ o[util.inspect.custom] = () => 42;
+ out = util.inspect(o, { compact: false, breakLength: 3 });
+ expect = "42";
+ assert.strictEqual(out, expect);
+
+ o[util.inspect.custom] = () => "12 45 78 01 34 67 90 23";
+ out = util.inspect(o, { compact: false, breakLength: 3 });
+ expect = "12 45 78 01 34 67 90 23";
+ assert.strictEqual(out, expect);
+
+ o[util.inspect.custom] = () => ({ a: "12 45 78 01 34 67 90 23" });
+ out = util.inspect(o, { compact: false, breakLength: 3 });
+ expect = "{\n a: '12 45 78 01 34 67 90 23'\n}";
+ assert.strictEqual(out, expect);
+ }
+
+ // Check compact indentation.
+ {
+ const typed = new Uint8Array();
+ typed.buffer.foo = true;
+ const set = new Set([[1, 2]]);
+ const promise = Promise.resolve([[1, set]]);
+ const map = new Map([[promise, typed]]);
+ map.set(set.values(), map.values());
+
+ let out = util.inspect(map, { compact: false, showHidden: true, depth: 9 });
+ let expected = [
+ "Map(2) {",
+ " Promise {",
+ " [",
+ " [",
+ " 1,",
+ " Set(1) {",
+ " [",
+ " 1,",
+ " 2,",
+ " [length]: 2",
+ " ]",
+ " },",
+ " [length]: 2",
+ " ],",
+ " [length]: 1",
+ " ]",
+ " } => Uint8Array(0) [",
+ " [BYTES_PER_ELEMENT]: 1,",
+ " [length]: 0,",
+ " [byteLength]: 0,",
+ " [byteOffset]: 0,",
+ " [buffer]: ArrayBuffer {",
+ " byteLength: 0,",
+ " foo: true",
+ " }",
+ " ],",
+ " [Set Iterator] {",
+ " [",
+ " 1,",
+ " 2,",
+ " [length]: 2",
+ " ],",
+ " [Symbol(Symbol.toStringTag)]: 'Set Iterator'",
+ " } => <ref *1> [Map Iterator] {",
+ " Uint8Array(0) [",
+ " [BYTES_PER_ELEMENT]: 1,",
+ " [length]: 0,",
+ " [byteLength]: 0,",
+ " [byteOffset]: 0,",
+ " [buffer]: ArrayBuffer {",
+ " byteLength: 0,",
+ " foo: true",
+ " }",
+ " ],",
+ " [Circular *1],",
+ " [Symbol(Symbol.toStringTag)]: 'Map Iterator'",
+ " }",
+ "}",
+ ].join("\n");
+
+ assert.strict.equal(out, expected);
+
+ out = util.inspect(map, { compact: 2, showHidden: true, depth: 9 });
+
+ expected = [
+ "Map(2) {",
+ " Promise {\n" + " [",
+ " [",
+ " 1,",
+ " Set(1) { [ 1, 2, [length]: 2 ] },",
+ " [length]: 2",
+ " ],",
+ " [length]: 1",
+ " ]",
+ " } => Uint8Array(0) [",
+ " [BYTES_PER_ELEMENT]: 1,",
+ " [length]: 0,",
+ " [byteLength]: 0,",
+ " [byteOffset]: 0,",
+ " [buffer]: ArrayBuffer { byteLength: 0, foo: true }",
+ " ],",
+ " [Set Iterator] {\n" + " [ 1, 2, [length]: 2 ],",
+ " [Symbol(Symbol.toStringTag)]: 'Set Iterator'\n" +
+ " } => <ref *1> [Map Iterator] {\n" +
+ " Uint8Array(0) [",
+ " [BYTES_PER_ELEMENT]: 1,",
+ " [length]: 0,",
+ " [byteLength]: 0,",
+ " [byteOffset]: 0,",
+ " [buffer]: ArrayBuffer { byteLength: 0, foo: true }",
+ " ],",
+ " [Circular *1],",
+ " [Symbol(Symbol.toStringTag)]: 'Map Iterator'\n" + " }",
+ "}",
+ ].join("\n");
+
+ assert.strict.equal(out, expected);
+
+ out = util.inspect(map, {
+ showHidden: true,
+ depth: 9,
+ breakLength: 4,
+ compact: true,
+ });
+
+ expected = [
+ "Map(2) {",
+ " Promise {",
+ " [ [ 1,",
+ " Set(1) {",
+ " [ 1,",
+ " 2,",
+ " [length]: 2 ] },",
+ " [length]: 2 ],",
+ " [length]: 1 ] } => Uint8Array(0) [",
+ " [BYTES_PER_ELEMENT]: 1,",
+ " [length]: 0,",
+ " [byteLength]: 0,",
+ " [byteOffset]: 0,",
+ " [buffer]: ArrayBuffer {",
+ " byteLength: 0,",
+ " foo: true } ],",
+ " [Set Iterator] {",
+ " [ 1,",
+ " 2,",
+ " [length]: 2 ],",
+ " [Symbol(Symbol.toStringTag)]:",
+ " 'Set Iterator' } => <ref *1> [Map Iterator] {",
+ " Uint8Array(0) [",
+ " [BYTES_PER_ELEMENT]: 1,",
+ " [length]: 0,",
+ " [byteLength]: 0,",
+ " [byteOffset]: 0,",
+ " [buffer]: ArrayBuffer {",
+ " byteLength: 0,",
+ " foo: true } ],",
+ " [Circular *1],",
+ " [Symbol(Symbol.toStringTag)]:",
+ " 'Map Iterator' } }",
+ ].join("\n");
+
+ assert.strict.equal(out, expected);
+ }
+
+ {
+ // Test WeakMap && WeakSet
+ const obj = {};
+ const arr = [];
+ const weakMap = new WeakMap([
+ [obj, arr],
+ [arr, obj],
+ ]);
+ let out = util.inspect(weakMap, { showHidden: true });
+ // TODO: WeakMap internals
+ // let expect = 'WeakMap { [ [length]: 0 ] => {}, {} => [ [length]: 0 ] }';
+ let expect = "WeakMap { }";
+ assert.strictEqual(out, expect);
+
+ out = util.inspect(weakMap);
+ expect = "WeakMap { <items unknown> }";
+ assert.strictEqual(out, expect);
+
+ out = util.inspect(weakMap, { maxArrayLength: 0, showHidden: true });
+ // expect = 'WeakMap { ... 2 more items }';
+ expect = "WeakMap { }";
+ assert.strictEqual(out, expect);
+
+ weakMap.extra = true;
+ out = util.inspect(weakMap, { maxArrayLength: 1, showHidden: true });
+ // It is not possible to determine the output reliable.
+ // expect = 'WeakMap { [ [length]: 0 ] => {}, ... 1 more item, extra: true }';
+ // let expectAlt = 'WeakMap { {} => [ [length]: 0 ], ... 1 more item, extra: true }';
+ assert(
+ out === "WeakMap { extra: true }", //out === expect || out === expectAlt,
+ `Found: "${out}"\nrather than: "WeakMap { extra: true }"`,
+ ); //"${expect}"\nor: "${expectAlt}"`);
+
+ // Test WeakSet
+ arr.push(1);
+ const weakSet = new WeakSet([obj, arr]);
+ out = util.inspect(weakSet, { showHidden: true });
+ // TODO: WeakSet internals
+ // expect = 'WeakSet { [ 1, [length]: 1 ], {} }';
+ expect = "WeakSet { }";
+ assert.strictEqual(out, expect);
+
+ out = util.inspect(weakSet);
+ expect = "WeakSet { <items unknown> }";
+ assert.strictEqual(out, expect);
+
+ out = util.inspect(weakSet, { maxArrayLength: -2, showHidden: true });
+ //expect = 'WeakSet { ... 2 more items }';
+ expect = "WeakSet { }";
+ assert.strictEqual(out, expect);
+
+ weakSet.extra = true;
+ out = util.inspect(weakSet, { maxArrayLength: 1, showHidden: true });
+ // It is not possible to determine the output reliable.
+ // expect = 'WeakSet { {}, ... 1 more item, extra: true }';
+ // expectAlt = 'WeakSet { [ 1, [length]: 1 ], ... 1 more item, extra: true }';
+ assert(
+ out === "WeakSet { extra: true }", //out === expect || out === expectAlt,
+ `Found: "${out}"\nrather than: "WeakSet { extra: true }"`,
+ ); //"${expect}"\nor: "${expectAlt}"`);
+ // Keep references to the WeakMap entries, otherwise they could be GCed too early.
+ assert(obj && arr);
+ }
+
+ {
+ // Test argument objects.
+ const args = (function () {
+ return arguments;
+ })("a");
+ assert.strictEqual(util.inspect(args), "[Arguments] { '0': 'a' }");
+ }
+});
+
+test("util.inspect stack overflow handling", () => {
+ // Test that a long linked list can be inspected without throwing an error.
+ const list = {};
+ let head = list;
+ // A linked list of length 100k should be inspectable in some way, even though
+ // the real cutoff value is much lower than 100k.
+ for (let i = 0; i < 10000; i++) head = head.next = {};
+ assert.strictEqual(util.inspect(list), "{ next: { next: { next: [Object] } } }");
+ const longList = util.inspect(list, { depth: Infinity });
+ const match = longList.match(/next/g);
+ //? The current limit is set to a fixed 1000, as higher values cause
+ //? the creation of unmanageably large strings which can crash or hang.
+ //? For comparison, despite their test checking for up to 10000,
+ //? Node will generally cutoff with a stack overflow at around 900.
+ assert(match.length > 500 && match.length < 10000);
+ assert(longList.includes("[Object: Inspection interrupted prematurely. Maximum call stack size exceeded.]"));
+});
+
+test("no assertion failures 3", () => {
+ // Do not escape single quotes if no double quote or backtick is present.
+ assert.strictEqual(util.inspect("'"), '"\'"');
+ assert.strictEqual(util.inspect("\"'"), "`\"'`");
+ assert.strictEqual(util.inspect("\"'${a}"), "'\"\\'${a}'");
+
+ // Errors should visualize as much information as possible.
+ // If the name is not included in the stack, visualize it as well.
+ [
+ [class Foo extends TypeError {}, "test"],
+ [class Foo extends TypeError {}, undefined],
+ [class BarError extends Error {}, "test"],
+ [
+ class BazError extends Error {
+ get name() {
+ return "BazError";
+ }
+ },
+ undefined,
+ ],
+ ].forEach(([Class, message], i) => {
+ const foo = new Class(message);
+ const extra = Class.name.includes("Error") ? "" : ` [${foo.name}]`;
+ assert(
+ util.inspect(foo).startsWith(`${Class.name}${extra}${message ? `: ${message}` : "\n"}`),
+ util.inspect(foo) + "\n...did not start with: " + `${Class.name}${extra}${message ? `: ${message}` : "\n"}`,
+ );
+ Object.defineProperty(foo, Symbol.toStringTag, {
+ value: "WOW",
+ writable: true,
+ configurable: true,
+ });
+ const stack = foo.stack;
+ foo.stack = "This is a stack";
+ assert(
+ util.inspect(foo).startsWith("[This is a stack]"),
+ `Expected to start with: "[This is a stack]"\nFound: "${util.inspect(foo)}"`,
+ );
+ foo.stack = stack;
+ assert(
+ util.inspect(foo).startsWith(`${Class.name} [WOW]${extra}${message ? `: ${message}` : "\n"}`),
+ util.inspect(foo),
+ );
+ Object.setPrototypeOf(foo, null);
+ assert(
+ util.inspect(foo).startsWith(
+ // TODO: null prototypes
+ // `[${name}: null prototype] [WOW]${message ? `: ${message}` : '\n'}`
+ "[Object: null prototype] [WOW] {",
+ ),
+ util.inspect(foo),
+ );
+ foo.bar = true;
+ delete foo[Symbol.toStringTag];
+ let tmp = util.inspect(foo);
+ assert(
+ tmp.startsWith(
+ // TODO: null prototypes
+ // `[${name}: null prototype]${message ? `: ${message}` : '\n'}`),
+ "[Error: null prototype] {",
+ ) && tmp.includes("bar: true"),
+ tmp,
+ );
+ foo.stack = "This is a stack";
+ tmp = util.inspect(foo);
+ assert(
+ tmp.startsWith(
+ // TODO: null prototypes
+ // '[[Error: null prototype]: This is a stack] { bar: true }'
+ "[Error: null prototype] {",
+ ) && tmp.includes("bar: true"),
+ tmp,
+ );
+ foo.stack = stack.split("\n")[0];
+ tmp = util.inspect(foo);
+ assert(
+ tmp.startsWith(
+ // TODO: null prototypes
+ // `[[${name}: null prototype]${message ? `:\n ${message}` : ''}] { bar: true }`
+ "[Error: null prototype] {",
+ ) && tmp.includes("bar: true"),
+ tmp,
+ );
+ });
+
+ // Verify that classes are properly inspected.
+ [
+ // The whitespace is intentional.
+ [class {}, "[class (anonymous)]"],
+ [
+ class extends Error {
+ log() {}
+ },
+ "[class (anonymous) extends Error]",
+ ],
+ [
+ class A {
+ constructor(a) {
+ this.a = a;
+ }
+ log() {
+ return this.a;
+ }
+ },
+ "[class A]",
+ ],
+ [
+ class // Random { // comments /* */ are part of the toString() result
+ äß /**/
+ extends /*{*/ TypeError {},
+ "[class äß extends TypeError]",
+ ],
+ /* The whitespace and new line is intended! */
+ // Foobar !!!
+ [
+ class X extends /****/ Error {
+ // More comments
+ },
+ "[class X extends Error]",
+ ],
+ ].forEach(([clazz, string]) => {
+ const inspected = util.inspect(clazz);
+ assert.strictEqual(inspected, string);
+ Object.defineProperty(clazz, Symbol.toStringTag, {
+ value: "Woohoo",
+ });
+ const parts = inspected.slice(0, -1).split(" ");
+ const [, name, ...rest] = parts;
+ rest.unshift("[Woohoo]");
+ if (rest.length) {
+ rest[rest.length - 1] += "]";
+ }
+ assert.strictEqual(util.inspect(clazz), ["[class", name, ...rest].join(" "));
+ if (rest.length) {
+ rest[rest.length - 1] = rest[rest.length - 1].slice(0, -1);
+ rest.length = 1;
+ }
+ Object.setPrototypeOf(clazz, Map.prototype);
+ assert.strictEqual(util.inspect(clazz), ["[class", name, "[Map]", ...rest].join(" ") + "]");
+ Object.setPrototypeOf(clazz, null);
+ assert.strictEqual(util.inspect(clazz), ["[class", name, ...rest, "extends [null prototype]]"].join(" "));
+ Object.defineProperty(clazz, "name", { value: "Foo" });
+ const res = ["[class", "Foo", ...rest, "extends [null prototype]]"].join(" ");
+ assert.strictEqual(util.inspect(clazz), res);
+ clazz.foo = true;
+ assert.strictEqual(util.inspect(clazz), `${res} { foo: true }`);
+ });
+
+ // "class" properties should not be detected as "class".
+ {
+ let obj = { class() {} };
+ assert.strictEqual(util.inspect(obj), "{ class: [Function: class] }");
+ obj = { class: () => {} };
+ assert.strictEqual(util.inspect(obj), "{ class: [Function: class] }");
+ obj = { ["class Foo {}"]() {} };
+ assert.strictEqual(util.inspect(obj), "{ 'class Foo {}': [Function: class Foo {}] }");
+ function Foo() {}
+ Object.defineProperty(Foo, "toString", { value: () => "class Foo {}" });
+ assert.strictEqual(util.inspect(Foo), "[Function: Foo]");
+ function fn() {}
+ Object.defineProperty(fn, "name", { value: "class Foo {}" });
+ assert.strictEqual(util.inspect(fn), "[Function: class Foo {}]");
+ }
+
+ // Verify that throwing in valueOf and toString still produces nice results.
+ [
+ [new String(55), "[String: '55']"],
+ [new Boolean(true), "[Boolean: true]"],
+ [new Number(55), "[Number: 55]"],
+ [Object(BigInt(55)), "[BigInt: 55n]"],
+ [Object(Symbol("foo")), "[Symbol: Symbol(foo)]"],
+ [function () {}, "[Function (anonymous)]"],
+ [() => {}, "[Function (anonymous)]"],
+ [[1, 2], "[ 1, 2 ]"],
+ [[, , 5, , , ,], "[ <2 empty items>, 5, <3 empty items> ]"],
+ [{ a: 5 }, "{ a: 5 }"],
+ [new Set([1, 2]), "Set(2) { 1, 2 }"],
+ [new Map([[1, 2]]), "Map(1) { 1 => 2 }"],
+ [new Set([1, 2]).entries(), "[Set Entries] { [ 1, 1 ], [ 2, 2 ] }"],
+ [new Map([[1, 2]]).keys(), "[Map Iterator] { 1 }"],
+ [new Date(2000), "1970-01-01T00:00:02.000Z"],
+ [new Uint8Array(2), "Uint8Array(2) [ 0, 0 ]"],
+ [new Promise(resolve => setTimeout(resolve, 10)), "Promise { <pending> }"],
+ [new WeakSet(), "WeakSet { <items unknown> }"],
+ [new WeakMap(), "WeakMap { <items unknown> }"],
+ [/foobar/g, "/foobar/g"],
+ ].forEach(([value, expected]) => {
+ Object.defineProperty(value, "valueOf", {
+ get() {
+ throw new Error("valueOf");
+ },
+ });
+ Object.defineProperty(value, "toString", {
+ get() {
+ throw new Error("toString");
+ },
+ });
+ assert.strictEqual(util.inspect(value), expected);
+ value.foo = "bar";
+ assert.notStrictEqual(util.inspect(value), expected);
+ delete value.foo;
+ value[Symbol("foo")] = "yeah";
+ assert.notStrictEqual(util.inspect(value), expected);
+ });
+
+ // Verify that having no prototype still produces nice results.
+ [
+ [[1, 3, 4], "[Array(3): null prototype] [ 1, 3, 4 ]"],
+ [/foobar/, "[RegExp: null prototype] /foobar/"],
+ [new Set([1, 2]), "[Set(2): null prototype] { 1, 2 }"],
+ [new Map([[1, 2]]), "[Map(1): null prototype] { 1 => 2 }"],
+ [new Promise(resolve => setTimeout(resolve, 10)), "[Promise: null prototype] { <pending> }"],
+ [new WeakSet(), "[WeakSet: null prototype] { <items unknown> }"],
+ [new WeakMap(), "[WeakMap: null prototype] { <items unknown> }"],
+ [new Uint8Array(2), "[Uint8Array(2): null prototype] [ 0, 0 ]"],
+ [new Uint16Array(2), "[Uint16Array(2): null prototype] [ 0, 0 ]"],
+ [new Uint32Array(2), "[Uint32Array(2): null prototype] [ 0, 0 ]"],
+ [new Int8Array(2), "[Int8Array(2): null prototype] [ 0, 0 ]"],
+ [new Int16Array(2), "[Int16Array(2): null prototype] [ 0, 0 ]"],
+ [new Int32Array(2), "[Int32Array(2): null prototype] [ 0, 0 ]"],
+ [new Float32Array(2), "[Float32Array(2): null prototype] [ 0, 0 ]"],
+ [new Float64Array(2), "[Float64Array(2): null prototype] [ 0, 0 ]"],
+ [new BigInt64Array(2), "[BigInt64Array(2): null prototype] [ 0n, 0n ]"],
+ [new BigUint64Array(2), "[BigUint64Array(2): null prototype] [ 0n, 0n ]"],
+ [
+ new ArrayBuffer(4),
+ "[ArrayBuffer: null prototype] {\n [Uint8Contents]: <00 00 00 00>,\n byteLength: undefined\n}",
+ ],
+ [
+ new DataView(new ArrayBuffer(4)),
+ "[DataView: null prototype] {\n byteLength: undefined,\n byteOffset: undefined,\n buffer: undefined\n}",
+ ],
+ [
+ new SharedArrayBuffer(2),
+ "[SharedArrayBuffer: null prototype] {\n [Uint8Contents]: <00 00>,\n byteLength: undefined\n}",
+ ],
+ [new Date("Sun, 14 Feb 2010 11:48:40 GMT"), "[Date: null prototype] 2010-02-14T11:48:40.000Z"],
+ ].forEach(([value, expected]) => {
+ assert.strictEqual(util.inspect(Object.setPrototypeOf(value, null)), expected);
+ value.foo = "bar";
+ assert.notStrictEqual(util.inspect(value), expected);
+ delete value.foo;
+ value[Symbol("foo")] = "yeah";
+ assert.notStrictEqual(util.inspect(value), expected);
+ });
+
+ // Verify that subclasses with and without prototype produce nice results.
+ [
+ [RegExp, ["foobar", "g"], "/foobar/g"],
+ [WeakSet, [[{}]], "{ <items unknown> }"],
+ [WeakMap, [[[{}, {}]]], "{ <items unknown> }"],
+ [BigInt64Array, [10], "[\n 0n, 0n, 0n, 0n, 0n,\n 0n, 0n, 0n, 0n, 0n\n]"],
+ [Date, ["Sun, 14 Feb 2010 11:48:40 GMT"], "2010-02-14T11:48:40.000Z"],
+ [Date, ["invalid_date"], "Invalid Date"],
+ ].forEach(([base, input, rawExpected]) => {
+ class Foo extends base {}
+ const value = new Foo(...input);
+ const symbol = value[Symbol.toStringTag];
+ const size = base.name.includes("Array") ? `(${input[0]})` : "";
+ const expected = `Foo${size} ${symbol ? `[${symbol}] ` : ""}${rawExpected}`;
+ const expectedWithoutProto = `[${base.name}${size}: null prototype] ${rawExpected}`;
+ assert.strictEqual(util.inspect(value), expected);
+ value.foo = "bar";
+ assert.notStrictEqual(util.inspect(value), expected);
+ delete value.foo;
+ assert.strictEqual(util.inspect(Object.setPrototypeOf(value, null)), expectedWithoutProto);
+ value.foo = "bar";
+ let res = util.inspect(value);
+ assert.notStrictEqual(res, expectedWithoutProto);
+ assert.match(res, /foo: 'bar'/);
+ delete value.foo;
+ value[Symbol("foo")] = "yeah";
+ res = util.inspect(value);
+ assert.notStrictEqual(res, expectedWithoutProto);
+ assert.match(res, /\[Symbol\(foo\)]: 'yeah'/);
+ });
+
+ assert.strictEqual(inspect(1n), "1n");
+ assert.strictEqual(inspect(Object(-1n)), "[BigInt: -1n]");
+ assert.strictEqual(inspect(Object(13n)), "[BigInt: 13n]");
+ assert.strictEqual(inspect(new BigInt64Array([0n])), "BigInt64Array(1) [ 0n ]");
+ assert.strictEqual(inspect(new BigUint64Array([0n])), "BigUint64Array(1) [ 0n ]");
+
+ // Verify non-enumerable keys get escaped.
+ {
+ const obj = {};
+ Object.defineProperty(obj, "Non\nenumerable\tkey", { value: true });
+ assert.strictEqual(util.inspect(obj, { showHidden: true }), "{ [Non\\nenumerable\\tkey]: true }");
+ }
+
+ // Check for special colors.
+ {
+ const special = inspect.colors[inspect.styles.special];
+ const string = inspect.colors[inspect.styles.string];
+
+ assert.strictEqual(
+ inspect(new WeakSet(), { colors: true }),
+ `WeakSet { \u001b[${special[0]}m<items unknown>\u001b[${special[1]}m }`,
+ );
+ assert.strictEqual(
+ inspect(new WeakMap(), { colors: true }),
+ `WeakMap { \u001b[${special[0]}m<items unknown>\u001b[${special[1]}m }`,
+ );
+ assert.strictEqual(
+ inspect(new Promise(() => {}), { colors: true }),
+ `Promise { \u001b[${special[0]}m<pending>\u001b[${special[1]}m }`,
+ );
+
+ const rejection = Promise.reject("Oh no!");
+ assert.strictEqual(
+ inspect(rejection, { colors: true }),
+ `Promise { \u001b[${special[0]}m<rejected>\u001b[${special[1]}m ` +
+ `\u001b[${string[0]}m'Oh no!'\u001b[${string[1]}m }`,
+ );
+ rejection.catch(() => {});
+
+ // Verify that aliases do not show up as key while checking `inspect.colors`.
+ const colors = Object.keys(inspect.colors);
+ const aliases = Object.getOwnPropertyNames(inspect.colors).filter(c => !colors.includes(c));
+ assert(!colors.includes("grey"), colors);
+ assert(colors.includes("gray"), colors);
+ // Verify that all aliases are correctly mapped.
+ for (const alias of aliases) {
+ assert(Array.isArray(inspect.colors[alias]));
+ }
+ // Check consistent naming.
+ ["black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"].forEach((color, i) => {
+ assert.deepStrictEqual(inspect.colors[color], [30 + i, 39]);
+ assert.deepStrictEqual(inspect.colors[`${color}Bright`], [90 + i, 39]);
+ const bgColor = `bg${color[0].toUpperCase()}${color.slice(1)}`;
+ assert.deepStrictEqual(inspect.colors[bgColor], [40 + i, 49]);
+ assert.deepStrictEqual(inspect.colors[`${bgColor}Bright`], [100 + i, 49]);
+ });
+
+ // Unknown colors are handled gracefully:
+ const stringStyle = inspect.styles.string;
+ inspect.styles.string = "UNKNOWN";
+ assert.strictEqual(inspect("foobar", { colors: true }), "'foobar'");
+ inspect.styles.string = stringStyle;
+ }
+
+ assert.strictEqual(inspect([1, 3, 2], { sorted: true }), inspect([1, 3, 2]));
+ assert.strictEqual(inspect({ c: 3, a: 1, b: 2 }, { sorted: true }), "{ a: 1, b: 2, c: 3 }");
+ assert.strictEqual(
+ inspect(
+ { a200: 4, a100: 1, a102: 3, a101: 2 },
+ {
+ sorted(a, b) {
+ return b.localeCompare(a);
+ },
+ },
+ ),
+ "{ a200: 4, a102: 3, a101: 2, a100: 1 }",
+ );
+
+ // Non-indices array properties are sorted as well.
+ {
+ const arr = [3, 2, 1];
+ arr.b = 2;
+ arr.c = 3;
+ arr.a = 1;
+ arr[Symbol("b")] = true;
+ arr[Symbol("a")] = false;
+ assert.strictEqual(
+ inspect(arr, { sorted: true }),
+ "[ 3, 2, 1, [Symbol(a)]: false, [Symbol(b)]: true, a: 1, b: 2, c: 3 ]",
+ );
+ }
+
+ // Manipulate the prototype in weird ways.
+ {
+ let obj = { a: true };
+ let value = (function () {
+ return function () {};
+ })();
+ Object.setPrototypeOf(value, null);
+ Object.setPrototypeOf(obj, value);
+ assert.strictEqual(util.inspect(obj), "Object <[Function (null prototype) (anonymous)]> { a: true }");
+ assert.strictEqual(
+ util.inspect(obj, { colors: true }),
+ "Object <\u001b[36m[Function (null prototype) (anonymous)]\u001b[39m> " + "{ a: \u001b[33mtrue\u001b[39m }",
+ );
+
+ obj = { a: true };
+ value = [];
+ Object.setPrototypeOf(value, null);
+ Object.setPrototypeOf(obj, value);
+ assert.strictEqual(util.inspect(obj), "Object <[Array(0): null prototype] []> { a: true }");
+
+ function StorageObject() {}
+ StorageObject.prototype = { __proto__: null };
+ assert.strictEqual(
+ util.inspect(new StorageObject()),
+ // TODO: null prototypes
+ // 'StorageObject <[Object: null prototype] {}> {}'
+ "Object <[Object: null prototype] {}> {}",
+ );
+
+ obj = [1, 2, 3];
+ Object.setPrototypeOf(obj, Number.prototype);
+ assert.strictEqual(inspect(obj), "Number { '0': 1, '1': 2, '2': 3 }");
+
+ Object.setPrototypeOf(obj, { __proto__: null });
+ assert.strictEqual(inspect(obj), "Array <[Object: null prototype] {}> { '0': 1, '1': 2, '2': 3 }");
+
+ StorageObject.prototype = { __proto__: null };
+ Object.setPrototypeOf(StorageObject.prototype, { __proto__: null });
+ Object.setPrototypeOf(Object.getPrototypeOf(StorageObject.prototype), { __proto__: null });
+ assert.strictEqual(
+ util.inspect(new StorageObject()),
+ // TODO: null prototypes
+ // 'StorageObject <Object <Object <[Object: null prototype] {}>>> {}'
+ "Object <Object <Object <[Object: null prototype] {}>>> {}",
+ );
+ assert.strictEqual(
+ util.inspect(new StorageObject(), { depth: 1 }),
+ // TODO: null prototypes
+ // 'StorageObject <Object <Object <Complex prototype>>> {}'
+ "Object <Object <Object <Complex prototype>>> {}",
+ );
+ }
+
+ // Check that the fallback always works.
+ {
+ const obj = new Set([1, 2]);
+ const iterator = obj[Symbol.iterator];
+ Object.setPrototypeOf(obj, null);
+ Object.defineProperty(obj, Symbol.iterator, {
+ value: iterator,
+ configurable: true,
+ });
+ assert.strictEqual(util.inspect(obj), "[Set(2): null prototype] { 1, 2 }");
+ Object.defineProperty(obj, Symbol.iterator, {
+ value: true,
+ configurable: true,
+ });
+ Object.defineProperty(obj, "size", {
+ value: NaN,
+ configurable: true,
+ enumerable: true,
+ });
+ assert.strictEqual(util.inspect(obj), "[Set(2): null prototype] { 1, 2, size: NaN }");
+ }
+
+ // Check the getter option.
+ {
+ let foo = 1;
+ const get = {
+ get foo() {
+ return foo;
+ },
+ };
+ const getset = {
+ get foo() {
+ return foo;
+ },
+ set foo(val) {
+ foo = val;
+ },
+ get inc() {
+ return ++foo;
+ },
+ };
+ const thrower = {
+ get foo() {
+ throw new Error("Oops");
+ },
+ };
+ assert.strictEqual(
+ inspect(get, { getters: true, colors: true }),
+ "{ foo: \u001b[36m[Getter:\u001b[39m " + "\u001b[33m1\u001b[39m\u001b[36m]\u001b[39m }",
+ );
+ assert.strictEqual(inspect(thrower, { getters: true }), "{ foo: [Getter: <Inspection threw (Oops)>] }");
+ assert.strictEqual(inspect(getset, { getters: true }), "{ foo: [Getter/Setter: 1], inc: [Getter: 2] }");
+ assert.strictEqual(inspect(getset, { getters: "get" }), "{ foo: [Getter/Setter], inc: [Getter: 3] }");
+ assert.strictEqual(inspect(getset, { getters: "set" }), "{ foo: [Getter/Setter: 3], inc: [Getter] }");
+ getset.foo = new Set([[{ a: true }, 2, {}], "foobar", { x: 1 }]);
+ assert.strictEqual(
+ inspect(getset, { getters: true }),
+ "{\n foo: [Getter/Setter] Set(3) { [ [Object], 2, {} ], " + "'foobar', { x: 1 } },\n inc: [Getter: NaN]\n}",
+ );
+ }
+
+ // Check compact number mode.
+ {
+ let obj = {
+ a: {
+ b: {
+ x: 5,
+ c: {
+ x: "10000000000000000 00000000000000000 ".repeat(1e1),
+ d: 2,
+ e: 3,
+ },
+ },
+ },
+ b: [1, 2, [1, 2, { a: 1, b: 2, c: 3 }]],
+ c: ["foo", 4, 444444],
+ d: Array.from({ length: 101 }).map((e, i) => {
+ return i % 2 === 0 ? i * i : i;
+ }),
+ e: Array(6).fill("foobar"),
+ f: Array(9).fill("foobar"),
+ g: Array(21).fill("foobar baz"),
+ h: [100].concat(Array.from({ length: 9 }).map((e, n) => n)),
+ long: Array(9).fill("This text is too long for grouping!"),
+ };
+
+ let out = util.inspect(obj, { compact: 3, depth: 10, breakLength: 60 });
+ let expected = [
+ "{",
+ " a: {",
+ " b: {",
+ " x: 5,",
+ " c: {",
+ " x: '10000000000000000 00000000000000000 10000000000000000 " +
+ "00000000000000000 10000000000000000 00000000000000000 " +
+ "10000000000000000 00000000000000000 10000000000000000 " +
+ "00000000000000000 10000000000000000 00000000000000000 " +
+ "10000000000000000 00000000000000000 10000000000000000 " +
+ "00000000000000000 10000000000000000 00000000000000000 " +
+ "10000000000000000 00000000000000000 ',",
+ " d: 2,",
+ " e: 3",
+ " }",
+ " }",
+ " },",
+ " b: [ 1, 2, [ 1, 2, { a: 1, b: 2, c: 3 } ] ],",
+ " c: [ 'foo', 4, 444444 ],",
+ " d: [",
+ " 0, 1, 4, 3, 16, 5, 36, 7, 64,",
+ " 9, 100, 11, 144, 13, 196, 15, 256, 17,",
+ " 324, 19, 400, 21, 484, 23, 576, 25, 676,",
+ " 27, 784, 29, 900, 31, 1024, 33, 1156, 35,",
+ " 1296, 37, 1444, 39, 1600, 41, 1764, 43, 1936,",
+ " 45, 2116, 47, 2304, 49, 2500, 51, 2704, 53,",
+ " 2916, 55, 3136, 57, 3364, 59, 3600, 61, 3844,",
+ " 63, 4096, 65, 4356, 67, 4624, 69, 4900, 71,",
+ " 5184, 73, 5476, 75, 5776, 77, 6084, 79, 6400,",
+ " 81, 6724, 83, 7056, 85, 7396, 87, 7744, 89,",
+ " 8100, 91, 8464, 93, 8836, 95, 9216, 97, 9604,",
+ " 99,",
+ " ... 1 more item",
+ " ],",
+ " e: [",
+ " 'foobar',",
+ " 'foobar',",
+ " 'foobar',",
+ " 'foobar',",
+ " 'foobar',",
+ " 'foobar'",
+ " ],",
+ " f: [",
+ " 'foobar', 'foobar',",
+ " 'foobar', 'foobar',",
+ " 'foobar', 'foobar',",
+ " 'foobar', 'foobar',",
+ " 'foobar'",
+ " ],",
+ " g: [",
+ " 'foobar baz', 'foobar baz',",
+ " 'foobar baz', 'foobar baz',",
+ " 'foobar baz', 'foobar baz',",
+ " 'foobar baz', 'foobar baz',",
+ " 'foobar baz', 'foobar baz',",
+ " 'foobar baz', 'foobar baz',",
+ " 'foobar baz', 'foobar baz',",
+ " 'foobar baz', 'foobar baz',",
+ " 'foobar baz', 'foobar baz',",
+ " 'foobar baz', 'foobar baz',",
+ " 'foobar baz'",
+ " ],",
+ " h: [",
+ " 100, 0, 1, 2, 3,",
+ " 4, 5, 6, 7, 8",
+ " ],",
+ " long: [",
+ " 'This text is too long for grouping!',",
+ " 'This text is too long for grouping!',",
+ " 'This text is too long for grouping!',",
+ " 'This text is too long for grouping!',",
+ " 'This text is too long for grouping!',",
+ " 'This text is too long for grouping!',",
+ " 'This text is too long for grouping!',",
+ " 'This text is too long for grouping!',",
+ " 'This text is too long for grouping!'",
+ " ]",
+ "}",
+ ].join("\n");
+
+ assert.strictEqual(out, expected);
+
+ obj = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 123456789];
+
+ out = util.inspect(obj, { compact: 3 });
+
+ expected = [
+ "[",
+ " 1, 1, 1, 1,",
+ " 1, 1, 1, 1,",
+ " 1, 1, 1, 1,",
+ " 1, 1, 1, 1,",
+ " 1, 1, 1, 1,",
+ " 1, 1, 1, 1,",
+ " 1, 1, 123456789",
+ "]",
+ ].join("\n");
+
+ assert.strictEqual(out, expected);
+
+ // Unicode support. あ has a length of one and a width of two.
+ obj = ["123", "123", "123", "123", "あああ", "123", "123", "123", "123", "あああ"];
+
+ out = util.inspect(obj, { compact: 3 });
+
+ expected = [
+ "[",
+ " '123', '123',",
+ " '123', '123',",
+ " 'あああ', '123',",
+ " '123', '123',",
+ " '123', 'あああ'",
+ "]",
+ ].join("\n");
+
+ assert.strictEqual(out, expected);
+
+ // Array grouping should prevent lining up outer elements on a single line.
+ obj = [[[1, 2, 3, 4, 5, 6, 7, 8, 9]]];
+
+ out = util.inspect(obj, { compact: 3 });
+
+ expected = ["[", " [", " [", " 1, 2, 3, 4, 5,", " 6, 7, 8, 9", " ]", " ]", "]"].join("\n");
+
+ assert.strictEqual(out, expected);
+
+ // Verify that array grouping and line consolidation does not happen together.
+ obj = {
+ a: {
+ b: {
+ x: 5,
+ c: {
+ d: 2,
+ e: 3,
+ },
+ },
+ },
+ b: Array.from({ length: 9 }).map((e, n) => {
+ return n % 2 === 0 ? "foobar" : "baz";
+ }),
+ };
+
+ out = util.inspect(obj, { compact: 1, breakLength: Infinity, colors: true });
+
+ expected = [
+ "{",
+ " a: {",
+ " b: { x: \u001b[33m5\u001b[39m, c: \u001b[36m[Object]\u001b[39m }",
+ " },",
+ " b: [",
+ " \u001b[32m'foobar'\u001b[39m, \u001b[32m'baz'\u001b[39m,",
+ " \u001b[32m'foobar'\u001b[39m, \u001b[32m'baz'\u001b[39m,",
+ " \u001b[32m'foobar'\u001b[39m, \u001b[32m'baz'\u001b[39m,",
+ " \u001b[32m'foobar'\u001b[39m, \u001b[32m'baz'\u001b[39m,",
+ " \u001b[32m'foobar'\u001b[39m",
+ " ]",
+ "}",
+ ].join("\n");
+
+ assert.strictEqual(out, expected);
+
+ obj = Array.from({ length: 60 }).map((e, i) => i);
+ out = util.inspect(obj, { compact: 1, breakLength: Infinity, colors: true });
+
+ expected = [
+ "[",
+ " \u001b[33m0\u001b[39m, \u001b[33m1\u001b[39m, \u001b[33m2\u001b[39m, \u001b[33m3\u001b[39m,",
+ " \u001b[33m4\u001b[39m, \u001b[33m5\u001b[39m, \u001b[33m6\u001b[39m, \u001b[33m7\u001b[39m,",
+ " \u001b[33m8\u001b[39m, \u001b[33m9\u001b[39m, \u001b[33m10\u001b[39m, \u001b[33m11\u001b[39m,",
+ " \u001b[33m12\u001b[39m, \u001b[33m13\u001b[39m, \u001b[33m14\u001b[39m, \u001b[33m15\u001b[39m,",
+ " \u001b[33m16\u001b[39m, \u001b[33m17\u001b[39m, \u001b[33m18\u001b[39m, \u001b[33m19\u001b[39m,",
+ " \u001b[33m20\u001b[39m, \u001b[33m21\u001b[39m, \u001b[33m22\u001b[39m, \u001b[33m23\u001b[39m,",
+ " \u001b[33m24\u001b[39m, \u001b[33m25\u001b[39m, \u001b[33m26\u001b[39m, \u001b[33m27\u001b[39m,",
+ " \u001b[33m28\u001b[39m, \u001b[33m29\u001b[39m, \u001b[33m30\u001b[39m, \u001b[33m31\u001b[39m,",
+ " \u001b[33m32\u001b[39m, \u001b[33m33\u001b[39m, \u001b[33m34\u001b[39m, \u001b[33m35\u001b[39m,",
+ " \u001b[33m36\u001b[39m, \u001b[33m37\u001b[39m, \u001b[33m38\u001b[39m, \u001b[33m39\u001b[39m,",
+ " \u001b[33m40\u001b[39m, \u001b[33m41\u001b[39m, \u001b[33m42\u001b[39m, \u001b[33m43\u001b[39m,",
+ " \u001b[33m44\u001b[39m, \u001b[33m45\u001b[39m, \u001b[33m46\u001b[39m, \u001b[33m47\u001b[39m,",
+ " \u001b[33m48\u001b[39m, \u001b[33m49\u001b[39m, \u001b[33m50\u001b[39m, \u001b[33m51\u001b[39m,",
+ " \u001b[33m52\u001b[39m, \u001b[33m53\u001b[39m, \u001b[33m54\u001b[39m, \u001b[33m55\u001b[39m,",
+ " \u001b[33m56\u001b[39m, \u001b[33m57\u001b[39m, \u001b[33m58\u001b[39m, \u001b[33m59\u001b[39m",
+ "]",
+ ].join("\n");
+
+ assert.strictEqual(out, expected);
+
+ out = util.inspect([1, 2, 3, 4], { compact: 1, colors: true });
+ expected = "[ \u001b[33m1\u001b[39m, \u001b[33m2\u001b[39m, " + "\u001b[33m3\u001b[39m, \u001b[33m4\u001b[39m ]";
+
+ assert.strictEqual(out, expected);
+
+ obj = [
+ "Object",
+ "Function",
+ "Array",
+ "Number",
+ "parseFloat",
+ "parseInt",
+ "Infinity",
+ "NaN",
+ "undefined",
+ "Boolean",
+ "String",
+ "Symbol",
+ "Date",
+ "Promise",
+ "RegExp",
+ "Error",
+ "EvalError",
+ "RangeError",
+ "ReferenceError",
+ "SyntaxError",
+ "TypeError",
+ "URIError",
+ "JSON",
+ "Math",
+ "console",
+ "Intl",
+ "ArrayBuffer",
+ "Uint8Array",
+ "Int8Array",
+ "Uint16Array",
+ "Int16Array",
+ "Uint32Array",
+ "Int32Array",
+ "Float32Array",
+ "Float64Array",
+ "Uint8ClampedArray",
+ "BigUint64Array",
+ "BigInt64Array",
+ "DataView",
+ "Map",
+ "BigInt",
+ "Set",
+ "WeakMap",
+ "WeakSet",
+ "Proxy",
+ "Reflect",
+ "decodeURI",
+ "decodeURIComponent",
+ "encodeURI",
+ "encodeURIComponent",
+ "escape",
+ "unescape",
+ "eval",
+ "isFinite",
+ "isNaN",
+ "SharedArrayBuffer",
+ "Atomics",
+ "globalThis",
+ "WebAssembly",
+ "global",
+ "process",
+ "Buffer",
+ "URL",
+ "URLSearchParams",
+ "TextEncoder",
+ "TextDecoder",
+ "clearInterval",
+ "clearTimeout",
+ "setInterval",
+ "setTimeout",
+ "queueMicrotask",
+ "clearImmediate",
+ "setImmediate",
+ "module",
+ "require",
+ "assert",
+ "async_hooks",
+ "buffer",
+ "child_process",
+ "cluster",
+ "crypto",
+ "dgram",
+ "dns",
+ "domain",
+ "events",
+ "fs",
+ "http",
+ "http2",
+ "https",
+ "inspector",
+ "net",
+ "os",
+ "path",
+ "perf_hooks",
+ "punycode",
+ "querystring",
+ "readline",
+ "repl",
+ "stream",
+ "string_decoder",
+ "tls",
+ "trace_events",
+ "tty",
+ "url",
+ "v8",
+ "vm",
+ "worker_threads",
+ "zlib",
+ "_",
+ "_error",
+ "util",
+ ];
+
+ out = util.inspect(obj, { compact: 3, breakLength: 80, maxArrayLength: 250 });
+ expected = [
+ "[",
+ " 'Object', 'Function', 'Array',",
+ " 'Number', 'parseFloat', 'parseInt',",
+ " 'Infinity', 'NaN', 'undefined',",
+ " 'Boolean', 'String', 'Symbol',",
+ " 'Date', 'Promise', 'RegExp',",
+ " 'Error', 'EvalError', 'RangeError',",
+ " 'ReferenceError', 'SyntaxError', 'TypeError',",
+ " 'URIError', 'JSON', 'Math',",
+ " 'console', 'Intl', 'ArrayBuffer',",
+ " 'Uint8Array', 'Int8Array', 'Uint16Array',",
+ " 'Int16Array', 'Uint32Array', 'Int32Array',",
+ " 'Float32Array', 'Float64Array', 'Uint8ClampedArray',",
+ " 'BigUint64Array', 'BigInt64Array', 'DataView',",
+ " 'Map', 'BigInt', 'Set',",
+ " 'WeakMap', 'WeakSet', 'Proxy',",
+ " 'Reflect', 'decodeURI', 'decodeURIComponent',",
+ " 'encodeURI', 'encodeURIComponent', 'escape',",
+ " 'unescape', 'eval', 'isFinite',",
+ " 'isNaN', 'SharedArrayBuffer', 'Atomics',",
+ " 'globalThis', 'WebAssembly', 'global',",
+ " 'process', 'Buffer', 'URL',",
+ " 'URLSearchParams', 'TextEncoder', 'TextDecoder',",
+ " 'clearInterval', 'clearTimeout', 'setInterval',",
+ " 'setTimeout', 'queueMicrotask', 'clearImmediate',",
+ " 'setImmediate', 'module', 'require',",
+ " 'assert', 'async_hooks', 'buffer',",
+ " 'child_process', 'cluster', 'crypto',",
+ " 'dgram', 'dns', 'domain',",
+ " 'events', 'fs', 'http',",
+ " 'http2', 'https', 'inspector',",
+ " 'net', 'os', 'path',",
+ " 'perf_hooks', 'punycode', 'querystring',",
+ " 'readline', 'repl', 'stream',",
+ " 'string_decoder', 'tls', 'trace_events',",
+ " 'tty', 'url', 'v8',",
+ " 'vm', 'worker_threads', 'zlib',",
+ " '_', '_error', 'util'",
+ "]",
+ ].join("\n");
+
+ assert.strictEqual(out, expected);
+ }
+
+ {
+ // TODO: don't care if invalid node internals get highlighted wrong
+ // See: loaders.js if you want to fix
+
+ const originalCWD = process.cwd();
+
+ process.cwd = () =>
+ process.platform === "win32"
+ ? "C:\\workspace\\node-test-binary-windows js-suites-%percent-encoded\\node"
+ : "/home/user directory/repository%encoded/node";
+
+ // Use a fake stack to verify the expected colored outcome.
+ const stack = [
+ "Error: CWD is grayed out, even cwd that are percent encoded!",
+ " at A.<anonymous> (/test/node_modules/foo/node_modules/bar/baz.js:2:7)",
+ " at Module._compile (node:internal/modules/cjs/loader:827:30)",
+ " at Fancy (node:vm:697:32)",
+ // This file is not an actual Node.js core file.
+ // ' at tryModuleLoad (node:internal/modules/cjs/foo:629:12)',
+ " at Function.Module._load (node:internal/modules/cjs/loader:621:3)",
+ // This file is not an actual Node.js core file.
+ // ' at Module.require [as weird/name] (node:internal/aaaaa/loader:735:19)',
+ " at require (node:internal/modules/helpers:14:16)",
+ " at Array.forEach (<anonymous>)",
+ ` at ${process.cwd()}/test/parallel/test-util-inspect.js:2760:12`,
+ ` at Object.<anonymous> (${process.cwd()}/node_modules/hyper_module/folder/file.js:2753:10)`,
+ " at /test/test-util-inspect.js:2239:9",
+ " at getActual (node:assert:592:5)",
+ ];
+ const err = new Error("CWD is grayed out, even cwd that are percent encoded!");
+ err.stack = stack.join("\n");
+ if (process.platform === "win32") {
+ err.stack = stack.map(frame => (frame.includes("node:") ? frame : frame.replace(/\//g, "\\"))).join("\n");
+ }
+ const escapedCWD = util.inspect(process.cwd()).slice(1, -1);
+ util
+ .inspect(err, { colors: true })
+ .split("\n")
+ .forEach((line, i) => {
+ line = line.replace(/ \{$/, "");
+ if (i >= stack.length) return; //! workaround to ignore the extra error props at the end
+ let expected = stack[i]
+ .replace(/node_modules\/([^/]+)/gi, (_, m) => {
+ return `node_modules/\u001b[4m${m}\u001b[24m`;
+ })
+ .replace(new RegExp(`(\\(?${escapedCWD}(\\\\|/))`, "gi"), (_, m) => {
+ return `\x1B[90m${m}\x1B[39m`;
+ });
+ if (expected.includes(process.cwd()) && expected.endsWith(")")) {
+ expected = `${expected.slice(0, -1)}\x1B[90m)\x1B[39m`;
+ }
+ if (line.includes("node:")) {
+ if (!line.includes("foo") && !line.includes("aaa")) {
+ expected = `\u001b[90m${expected}\u001b[39m`;
+ }
+ } else if (process.platform === "win32") {
+ expected = expected.replace(/\//g, "\\");
+ }
+ assert.strictEqual(line, expected);
+ });
+
+ // Check ESM
+ //const encodedCwd = url.pathToFileURL(process.cwd());
+ const sl = process.platform === "win32" ? "\\" : "/";
+
+ // Use a fake stack to verify the expected colored outcome.
+ //? Something goes wrong with these file URLs but Bun doesn't use those in errors anyway so it's fine (for now at least)
+ err.stack =
+ "Error: ESM and CJS mixed are both grayed out!\n" +
+ //?` at ${encodedCwd}/test/parallel/test-esm.mjs:2760:12\n` +
+ //?` at Object.<anonymous> (${encodedCwd}/node_modules/esm_module/folder/file.js:2753:10)\n` +
+ ` at ${process.cwd()}${sl}test${sl}parallel${sl}test-cjs.js:2760:12\n` +
+ ` at Object.<anonymous> (${process.cwd()}${sl}node_modules${sl}cjs_module${sl}folder${sl}file.js:2753:10)`;
+
+ let actual = util.inspect(err, { colors: true });
+ let expected =
+ "Error: ESM and CJS mixed are both grayed out!\n" +
+ //?` at \x1B[90m${encodedCwd}/\x1B[39mtest/parallel/test-esm.mjs:2760:12\n` +
+ //?` at Object.<anonymous> \x1B[90m(${encodedCwd}/\x1B[39mnode_modules/\x1B[4mesm_module\x1B[24m/folder/file.js:2753:10\x1B[90m)\x1B[39m\n` +
+ ` at \x1B[90m${process.cwd()}${sl}\x1B[39mtest${sl}parallel${sl}test-cjs.js:2760:12\n` +
+ ` at Object.<anonymous> \x1B[90m(${process.cwd()}${sl}\x1B[39mnode_modules${sl}\x1B[4mcjs_module\x1B[24m${sl}folder${sl}file.js:2753:10\x1B[90m)\x1B[39m`;
+
+ assert.strictEqual(actual.split(" {\n")[0], expected);
+
+ // ESM without need for encoding
+ process.cwd = () =>
+ process.platform === "win32"
+ ? "C:\\workspace\\node-test-binary-windows-js-suites\\node"
+ : "/home/user/repository/node";
+ let expectedCwd = process.cwd();
+ if (process.platform === "win32") {
+ expectedCwd = `/${expectedCwd.replace(/\\/g, "/")}`;
+ }
+ // Use a fake stack to verify the expected colored outcome.
+ err.stack = "Error: ESM without need for encoding!\n" + ` at file://${expectedCwd}/file.js:15:15`;
+
+ actual = util.inspect(err, { colors: true });
+ expected = "Error: ESM without need for encoding!\n" + ` at \x1B[90mfile://${expectedCwd}/\x1B[39mfile.js:15:15`;
+ assert.strictEqual(actual.split(" {\n")[0], expected);
+
+ process.cwd = originalCWD;
+ }
+
+ // This starts to work in node 15
+ {
+ // Cross platform checks.
+ const err = new Error("foo");
+ util
+ .inspect(err, { colors: true })
+ .split("\n")
+ .forEach((line, i) => {
+ assert(i < 5 || line.startsWith("\u001b[90m"), i + " " + line);
+ });
+ }
+
+ {
+ // Tracing class respects inspect depth.
+ try {
+ const trace = require("trace_events").createTracing({ categories: ["fo"] });
+ const actualDepth0 = util.inspect({ trace }, { depth: 0 });
+ assert.strictEqual(actualDepth0, "{ trace: [Tracing] }");
+ //! bun's tracing_events implementation is buggy/incomplete (?)
+ //const actualDepth1 = util.inspect({ trace }, { depth: 1 });
+ //assert.strictEqual(
+ // actualDepth1,
+ // "{ trace: Tracing { enabled: false, categories: 'fo' } }"
+ //);
+ } catch (err) {
+ if (err.code !== "ERR_TRACE_EVENTS_UNAVAILABLE") throw err;
+ }
+ }
+
+ // Inspect prototype properties.
+ {
+ function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ });
+ } else {
+ obj[key] = value;
+ }
+ return obj;
+ }
+
+ class Foo extends Map {
+ constructor(...args) {
+ super(...args);
+ _defineProperty(this, "prop", false);
+ _defineProperty(this, "prop2", true);
+ }
+ get abc() {
+ return true;
+ }
+ get def() {
+ return false;
+ }
+ set def(v) {}
+ get xyz() {
+ return "Should be ignored";
+ }
+ func(a) {}
+ [util.inspect.custom]() {
+ return this;
+ }
+ }
+
+ class Bar extends Foo {
+ constructor(...args) {
+ super(...args);
+ _defineProperty(this, "prop", true);
+ _defineProperty(this, "abc", true);
+ }
+
+ get xyz() {
+ return "YES!";
+ }
+ [util.inspect.custom]() {
+ return this;
+ }
+ }
+
+ const bar = new Bar();
+
+ assert.strictEqual(inspect(bar), "Bar(0) [Map] { prop: true, prop2: true, abc: true }");
+ assert.strictEqual(
+ inspect(bar, { showHidden: true, getters: true, colors: false }),
+ "Bar(0) [Map] {\n" +
+ " prop: true,\n" +
+ " prop2: true,\n" +
+ " abc: true,\n" +
+ " [xyz]: [Getter: 'YES!'],\n" +
+ " [def]: [Getter/Setter: false]\n" +
+ "}",
+ );
+ assert.strictEqual(
+ inspect(bar, { showHidden: true, getters: false, colors: true }),
+ "Bar(0) [Map] {\n" +
+ " prop: \x1B[33mtrue\x1B[39m,\n" +
+ " prop2: \x1B[33mtrue\x1B[39m,\n" +
+ " abc: \x1B[33mtrue\x1B[39m,\n" +
+ " \x1B[2m[xyz]: \x1B[36m[Getter]\x1B[39m\x1B[22m,\n" +
+ " \x1B[2m[def]: \x1B[36m[Getter/Setter]\x1B[39m\x1B[22m\n" +
+ "}",
+ );
+
+ const obj = { __proto__: { abc: true, def: 5, toString() {} } };
+ assert.strictEqual(
+ inspect(obj, { showHidden: true, colors: true }),
+ "{ \x1B[2mabc: \x1B[33mtrue\x1B[39m\x1B[22m, " + "\x1B[2mdef: \x1B[33m5\x1B[39m\x1B[22m }",
+ );
+
+ assert.strictEqual(
+ inspect(Object.getPrototypeOf(bar), { showHidden: true, getters: true }),
+ "<ref *1> Foo [Map] {\n" +
+ " [constructor]: [class Bar extends Foo] {\n" +
+ ` [prototype]: [Circular *1],\n [name]: 'Bar',\n` +
+ " [length]: 0,\n" +
+ " [Symbol(Symbol.species)]: [Getter: <Inspection threw " +
+ "(Symbol.prototype.toString requires that |this| be a symbol or a symbol object)>]\n" +
+ " },\n" +
+ " [xyz]: [Getter: 'YES!'],\n" +
+ " [Symbol(nodejs.util.inspect.custom)]: " +
+ "[Function: [nodejs.util.inspect.custom]] {\n" +
+ " [length]: 0,\n" +
+ " [name]: '[nodejs.util.inspect.custom]'\n" +
+ " },\n" +
+ " [abc]: [Getter: true],\n" +
+ " [def]: [Getter/Setter: false]\n" +
+ " }",
+ );
+
+ assert.strictEqual(inspect(Object.getPrototypeOf(bar)), "Foo [Map] {}");
+
+ assert.strictEqual(inspect(Object.getPrototypeOf(new Foo())), "Map {}");
+ }
+
+ // Check that prototypes with a null prototype are inspectable.
+ // Regression test for https://github.com/nodejs/node/issues/35730
+ {
+ function Func() {}
+ Func.prototype = null;
+ const object = {};
+ object.constructor = Func;
+
+ assert.strictEqual(util.inspect(object), "{ constructor: [Function: Func] }");
+ }
+
+ // Test changing util.inspect.colors colors and aliases.
+ {
+ const colors = util.inspect.colors;
+
+ const originalValue = colors.gray;
+
+ // "grey" is reference-equal alias of "gray".
+ assert.strictEqual(colors.grey, colors.gray);
+
+ // Assigninging one should assign the other. This tests that the alias setter
+ // function keeps things reference-equal.
+ colors.gray = [0, 0];
+ assert.deepStrictEqual(colors.gray, [0, 0]);
+ assert.strictEqual(colors.grey, colors.gray);
+
+ colors.grey = [1, 1];
+ assert.deepStrictEqual(colors.grey, [1, 1]);
+ assert.strictEqual(colors.grey, colors.gray);
+
+ // Restore original value to avoid side effects in other tests.
+ colors.gray = originalValue;
+ assert.deepStrictEqual(colors.gray, originalValue);
+ assert.strictEqual(colors.grey, colors.gray);
+ }
+
+ // https://github.com/nodejs/node/issues/31889
+ //{ //! how to get the undetectable object in JSC?
+ // const undetectable = vm.runInThisContext('%GetUndetectable()');
+ // assert.strictEqual(inspect(undetectable), '{}');
+ //}
+
+ // Truncate output for Primitives with 1 character left
+ {
+ assert.strictEqual(util.inspect("bl", { maxStringLength: 1 }), "'b'... 1 more character");
+ }
+
+ {
+ const x = "a".repeat(1e6);
+ assert(util.inspect(x).endsWith("... 990000 more characters"));
+ assert.strictEqual(util.inspect(x, { maxStringLength: 4 }), "'aaaa'... 999996 more characters");
+ assert.match(util.inspect(x, { maxStringLength: null }), /a'$/);
+ }
+
+ {
+ // Verify that util.inspect() invokes custom inspect functions on objects
+ // from other vm.Contexts but does not pass data from its own Context to that
+ // function.
+ const target = vm.runInNewContext(
+ /*js*/ `
+ ({
+ [Symbol.for('nodejs.util.inspect.custom')](depth, ctx) {
+ this.depth = depth;
+ this.ctx = ctx;
+ try {
+ this.stylized = ctx.stylize('🐈');
+ } catch (e) {
+ this.stylizeException = e;
+ }
+ return this.stylized;
+ }
+ })
+ `,
+ { __proto__: null },
+ );
+ assert.strictEqual(target.ctx, undefined);
+
+ {
+ // Subtest 1: Just try to inspect the object with default options.
+ assert.strictEqual(util.inspect(target), "🐈");
+ assert.strictEqual(typeof target.ctx, "object");
+ const objectGraph = fullObjectGraph(target);
+ assert(!objectGraph.has(Object));
+ assert(!objectGraph.has(Function));
+ }
+
+ if (false) {
+ //! SKIP TEST: non-standard api
+ // Subtest 2: Use a stylize function that returns a non-primitive.
+ const output = util.inspect(target, {
+ stylize: mustCall(str => {
+ return {};
+ }),
+ });
+ assert.strictEqual(output, "[object Object]");
+ assert.strictEqual(typeof target.ctx, "object");
+ const objectGraph = fullObjectGraph(target);
+ assert(!objectGraph.has(Object));
+ assert(!objectGraph.has(Function));
+ }
+
+ if (false) {
+ //! SKIP TEST: non-standard api
+ // Subtest 3: Use a stylize function that throws an exception.
+ const output = util.inspect(target, {
+ stylize: mustCall(str => {
+ throw new Error("oops");
+ }),
+ });
+ assert.strictEqual(output, "🐈");
+ assert.strictEqual(typeof target.ctx, "object");
+ const objectGraph = fullObjectGraph(target);
+ assert(!objectGraph.has(Object));
+ assert(!objectGraph.has(Function));
+ }
+
+ function fullObjectGraph(value) {
+ const graph = new Set([value]);
+
+ for (const entry of graph) {
+ if ((typeof entry !== "object" && typeof entry !== "function") || entry === null) {
+ continue;
+ }
+
+ graph.add(Object.getPrototypeOf(entry));
+ const descriptors = Object.values(Object.getOwnPropertyDescriptors(entry));
+ for (const descriptor of descriptors) {
+ graph.add(descriptor.value);
+ graph.add(descriptor.set);
+ graph.add(descriptor.get);
+ }
+ }
+
+ return graph;
+ }
+
+ // Consistency check.
+ assert(fullObjectGraph(global).has(Function.prototype));
+ }
+
+ {
+ // Confirm that own constructor value displays correctly.
+
+ function Fhqwhgads() {}
+
+ const sterrance = new Fhqwhgads();
+ sterrance.constructor = Fhqwhgads;
+
+ assert.strictEqual(
+ util.inspect(sterrance, { showHidden: true }),
+ "Fhqwhgads {\n" +
+ " constructor: <ref *1> [Function: Fhqwhgads] {\n" +
+ " [length]: 0,\n" +
+ " [prototype]: { [constructor]: [Circular *1] },\n" +
+ " [name]: 'Fhqwhgads'\n" +
+ " }\n" +
+ "}",
+ );
+ }
+
+ {
+ // Confirm null prototype of generator prototype displays as expected.
+
+ function getProtoOfProto() {
+ return Object.getPrototypeOf(Object.getPrototypeOf(function* () {}));
+ }
+
+ function* generator() {}
+
+ const generatorPrototype = Object.getPrototypeOf(generator);
+ const originalProtoOfProto = Object.getPrototypeOf(generatorPrototype);
+ assert.strictEqual(getProtoOfProto(), originalProtoOfProto);
+ Object.setPrototypeOf(generatorPrototype, null);
+ assert.notStrictEqual(getProtoOfProto, originalProtoOfProto);
+
+ // This is the actual test. The other assertions in this block are about
+ // making sure the test is set up correctly and isn't polluting other tests.
+ assert.strictEqual(
+ util.inspect(generator, { showHidden: true }),
+ "[GeneratorFunction: generator] {\n" +
+ " [length]: 0,\n" +
+ " [name]: 'generator',\n" +
+ " [prototype]: Object [Generator] { [Symbol(Symbol.toStringTag)]: 'Generator' },\n" +
+ " [Symbol(Symbol.toStringTag)]: 'GeneratorFunction'\n" +
+ "}",
+ );
+
+ // Reset so we don't pollute other tests
+ Object.setPrototypeOf(generatorPrototype, originalProtoOfProto);
+ assert.strictEqual(getProtoOfProto(), originalProtoOfProto);
+ }
+
+ {
+ // Test for when breakLength results in a single column.
+ const obj = Array(9).fill("fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf");
+ assert.strictEqual(
+ util.inspect(obj, { breakLength: 256 }),
+ "[\n" +
+ " 'fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf',\n" +
+ " 'fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf',\n" +
+ " 'fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf',\n" +
+ " 'fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf',\n" +
+ " 'fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf',\n" +
+ " 'fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf',\n" +
+ " 'fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf',\n" +
+ " 'fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf',\n" +
+ " 'fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf'\n" +
+ "]",
+ );
+ }
+
+ {
+ assert.strictEqual(util.inspect({ ["__proto__"]: { a: 1 } }), "{ ['__proto__']: { a: 1 } }");
+ }
+
+ {
+ const { numericSeparator } = util.inspect.defaultOptions;
+ util.inspect.defaultOptions.numericSeparator = true;
+
+ assert.strictEqual(util.inspect(1234567891234567891234), "1.234567891234568e+21");
+ assert.strictEqual(util.inspect(123456789.12345678), "123_456_789.123_456_78");
+
+ assert.strictEqual(util.inspect(10_000_000), "10_000_000");
+ assert.strictEqual(util.inspect(1_000_000), "1_000_000");
+ assert.strictEqual(util.inspect(100_000), "100_000");
+ assert.strictEqual(util.inspect(99_999.9), "99_999.9");
+ assert.strictEqual(util.inspect(9_999), "9_999");
+ assert.strictEqual(util.inspect(999), "999");
+ assert.strictEqual(util.inspect(NaN), "NaN");
+ assert.strictEqual(util.inspect(Infinity), "Infinity");
+ assert.strictEqual(util.inspect(-Infinity), "-Infinity");
+
+ assert.strictEqual(util.inspect(new Float64Array([100_000_000])), "Float64Array(1) [ 100_000_000 ]");
+ assert.strictEqual(util.inspect(new BigInt64Array([9_100_000_100n])), "BigInt64Array(1) [ 9_100_000_100n ]");
+
+ assert.strictEqual(util.inspect(123456789), "123_456_789");
+ assert.strictEqual(util.inspect(123456789n), "123_456_789n");
+
+ util.inspect.defaultOptions.numericSeparator = numericSeparator;
+
+ assert.strictEqual(util.inspect(123456789.12345678, { numericSeparator: true }), "123_456_789.123_456_78");
+
+ assert.strictEqual(util.inspect(-123456789.12345678, { numericSeparator: true }), "-123_456_789.123_456_78");
+ }
+
+ // Regression test for https://github.com/nodejs/node/issues/41244
+ {
+ assert.strictEqual(
+ util.inspect({
+ get [Symbol.iterator]() {
+ throw new Error();
+ },
+ }),
+ "{ [Symbol(Symbol.iterator)]: [Getter] }",
+ );
+ }
+});
+
+// Utility functions
+function runCallChecks(exitCode) {
+ if (exitCode !== 0) return;
+
+ const failed = mustCallChecks.filter(function (context) {
+ if ("minimum" in context) {
+ context.messageSegment = `at least ${context.minimum}`;
+ return context.actual < context.minimum;
+ }
+ context.messageSegment = `exactly ${context.exact}`;
+ return context.actual !== context.exact;
+ });
+
+ failed.forEach(function (context) {
+ console.log(
+ "Mismatched %s function calls. Expected %s, actual %d.",
+ context.name,
+ context.messageSegment,
+ context.actual,
+ );
+ console.log(context.stack.split("\n").slice(2).join("\n"));
+ });
+
+ if (failed.length) process.exit(1);
+}
+
+function mustCall(fn, criteria = 1) {
+ if (process._exiting) throw new Error("Cannot use mustCall() in process exit handler");
+ if (typeof fn === "number") {
+ criteria = fn;
+ fn = noop;
+ } else if (fn === undefined) fn = noop;
+
+ const field = "exact";
+ if (typeof criteria !== "number") throw new TypeError(`Invalid ${field} value: ${criteria}`);
+
+ const context = {
+ [field]: criteria,
+ actual: 0,
+ stack: util.inspect(new Error()),
+ name: fn.name || "<anonymous>",
+ };
+
+ // Add the exit listener only once to avoid listener leak warnings
+ if (mustCallChecks.length === 0) process.on("exit", runCallChecks);
+ mustCallChecks.push(context);
+
+ const _return = function () {
+ context.actual++;
+ return fn.apply(this, arguments);
+ };
+ // Function instances have own properties that may be relevant.
+ // Let's replicate those properties to the returned function.
+ // Refs: https://tc39.es/ecma262/#sec-function-instances
+ Object.defineProperties(_return, {
+ name: {
+ value: fn.name,
+ writable: false,
+ enumerable: false,
+ configurable: true,
+ },
+ length: {
+ value: fn.length,
+ writable: false,
+ enumerable: false,
+ configurable: true,
+ },
+ });
+ return _return;
+}
diff --git a/test/js/node/v8/capture-stack-trace.test.js b/test/js/node/v8/capture-stack-trace.test.js
index cb2624681..5e9492955 100644
--- a/test/js/node/v8/capture-stack-trace.test.js
+++ b/test/js/node/v8/capture-stack-trace.test.js
@@ -17,6 +17,15 @@ test("Regular .stack", () => {
expect(err.stack).toMatch(/at new Foo/);
});
+test("throw inside Error.prepareStackTrace doesnt crash", () => {
+ Error.prepareStackTrace = function (err, stack) {
+ Error.prepareStackTrace = null;
+ throw new Error("wat");
+ };
+
+ expect(() => new Error().stack).toThrow("wat");
+});
+
test("capture stack trace", () => {
function f1() {
f2();
@@ -460,14 +469,66 @@ test("CallFrame.p.toString", () => {
expect(e.stack[0].toString().includes("<anonymous>")).toBe(true);
});
-test.todo("err.stack should invoke prepareStackTrace", () => {
- // This is V8's behavior.
- let prevPrepareStackTrace = Error.prepareStackTrace;
- let wasCalled = false;
- Error.prepareStackTrace = (e, s) => {
- wasCalled = true;
- };
- const e = new Error();
- e.stack;
- expect(wasCalled).toBe(true);
+test("err.stack should invoke prepareStackTrace", () => {
+ var lineNumber = -1;
+ var functionName = "";
+ var parentLineNumber = -1;
+ function functionWithAName() {
+ // This is V8's behavior.
+ let prevPrepareStackTrace = Error.prepareStackTrace;
+
+ Error.prepareStackTrace = (e, s) => {
+ lineNumber = s[0].getLineNumber();
+ functionName = s[0].getFunctionName();
+ parentLineNumber = s[1].getLineNumber();
+ expect(s[0].getFileName().includes("capture-stack-trace.test.js")).toBe(true);
+ expect(s[1].getFileName().includes("capture-stack-trace.test.js")).toBe(true);
+ };
+ const e = new Error();
+ e.stack;
+ Error.prepareStackTrace = prevPrepareStackTrace;
+ }
+
+ functionWithAName();
+
+ expect(functionName).toBe("functionWithAName");
+ expect(lineNumber).toBe(488);
+ // TODO: this is wrong
+ expect(parentLineNumber).toBe(497);
+});
+
+test("Error.prepareStackTrace inside a node:vm works", () => {
+ const { runInNewContext } = require("node:vm");
+ Error.prepareStackTrace = null;
+ const result = runInNewContext(
+ `
+ Error.prepareStackTrace = (err, stack) => {
+ if (typeof err.stack !== "string") {
+ throw new Error("err.stack is not a string");
+ }
+
+ return "custom stack trace";
+ };
+
+ const err = new Error();
+ err.stack;
+ `,
+ );
+ expect(result).toBe("custom stack trace");
+ expect(Error.prepareStackTrace).toBeNull();
+});
+
+test("Error.captureStackTrace inside error constructor works", () => {
+ class ExtendedError extends Error {
+ constructor() {
+ super();
+ Error.captureStackTrace(this, ExtendedError);
+ }
+ }
+
+ class AnotherError extends ExtendedError {}
+
+ expect(() => {
+ throw new AnotherError();
+ }).toThrow();
});
diff --git a/test/js/node/v8/v8-date-parser.test.js b/test/js/node/v8/v8-date-parser.test.js
new file mode 100644
index 000000000..42e5aa4fc
--- /dev/null
+++ b/test/js/node/v8/v8-date-parser.test.js
@@ -0,0 +1,462 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+describe("v8 date parser", () => {
+ // https://github.com/v8/v8/blob/c45b7804109ece574f71fd45417b4ad498a99e6f/test/webkit/date-parse-comments-test.js#L27
+ test("test/webkit/date-parse-comments-test.js", () => {
+ var timeZoneOffset = Date.parse(" Dec 25 1995 1:30 ") - Date.parse(" Dec 25 1995 1:30 GMT ");
+ function testDateParse(date, numericResult) {
+ if (numericResult === "NaN") {
+ expect(Date.parse(date)).toBeNaN();
+ expect(Date.parse(date.toUpperCase())).toBeNaN();
+ expect(Date.parse(date.toLowerCase())).toBeNaN();
+ expect(new Date(date).getMilliseconds()).toBeNaN();
+ } else {
+ expect(Date.parse(date)).toBe(numericResult);
+ expect(Date.parse(date.toUpperCase())).toBe(numericResult);
+ expect(Date.parse(date.toLowerCase())).toBe(numericResult);
+ expect(new Date(date).toString()).toBe(new Date(numericResult).toString());
+ }
+ }
+
+ testDateParse("Dec ((27) 26 (24)) 25 1995 1:30 PM UTC", 819898200000);
+ testDateParse("Dec 25 1995 1:30 PM UTC (", 819898200000);
+ testDateParse("Dec 25 1995 1:30 (PM)) UTC", "NaN");
+ testDateParse("(Nov) Dec (24) 25 (26) 1995 (1996) GMT (EST)", 819849600000);
+ testDateParse("(Nov) Dec (24) 25 (26) 1995 (1996)", 819849600000 + timeZoneOffset);
+
+ testDateParse("(Nov) Dec (24) 25 (26) 1995 (1996) 1:30 (1:40) GMT (EST)", 819855000000);
+ testDateParse("(Nov) Dec (24) 25 (26) 1995 (1996) 1:30 (1:40)", 819855000000 + timeZoneOffset);
+ testDateParse("(Nov) Dec (24) 25 (26) 1995 (1996) 1:30 ", 819855000000 + timeZoneOffset);
+ testDateParse("(Nov) Dec (24) 25 (26) 1995 (1996) 1:30 AM (1:40 PM) GMT (EST)", 819855000000);
+ testDateParse("(Nov) Dec (24) 25 (26) 1995 (1996) 1:30 AM (1:40 PM)", 819855000000 + timeZoneOffset);
+ testDateParse("Dec 25 1995 1:30( )AM (PM)", "NaN");
+ testDateParse("Dec 25 1995 1:30 AM (PM)", 819855000000 + timeZoneOffset);
+
+ testDateParse("(Nov) Dec (24) 25 (26) 1995 (1996) 13:30 (13:40) GMT (PST)", 819898200000);
+ testDateParse("(Nov) Dec (24) 25 (26) 1995 (1996) 13:30 (13:40)", 819898200000 + timeZoneOffset);
+ testDateParse("(Nov) Dec (24) 25 (26) 13:30 (13:40) 1995 (1996)", 819898200000 + timeZoneOffset);
+ testDateParse("(Nov) Dec (24) 25 (26) 1995 (1996) 13:30 (13:40) ", 819898200000 + timeZoneOffset);
+ testDateParse("(Nov) Dec (24) 25 (26) 1995 (1996) 1:30 (1:40) PM (AM) GMT (PST)", 819898200000);
+ testDateParse("(Nov) Dec (24) 25 (26) 1995 (1996) 1:30 (1:40) PM (AM)", 819898200000 + timeZoneOffset);
+ testDateParse("Dec 25 1995 1:30(AM)PM", "NaN");
+ testDateParse("Dec 25 1995 1:30 (AM)PM ", 819898200000 + timeZoneOffset);
+
+ testDateParse("Dec 25 1995 (PDT)UTC(PST)", 819849600000);
+ testDateParse("Dec 25 1995 (PDT)UT(PST)", 819849600000);
+ testDateParse("Dec 25 1995 (UTC)PST(GMT)", 819878400000);
+ testDateParse("Dec 25 1995 (UTC)PDT(GMT)", 819874800000);
+
+ testDateParse("Dec 25 1995 1:30 (PDT)UTC(PST)", 819855000000);
+ testDateParse("Dec 25 1995 1:30 (PDT)UT(PST)", 819855000000);
+ testDateParse("Dec 25 1995 1:30 (UTC)PST(GMT)", 819883800000);
+ testDateParse("Dec 25 1995 1:30 (UTC)PDT(GMT)", 819880200000);
+
+ testDateParse("Dec 25 1995 1:30 (AM) PM (PST) UTC", 819898200000);
+ testDateParse("Dec 25 1995 1:30 PM (AM) (PST) UT", 819898200000);
+ testDateParse("Dec 25 1995 1:30 PM (AM) (UTC) PST", 819927000000);
+ testDateParse("Dec 25 1995 1:30 (AM) PM PDT (UTC)", 819923400000);
+
+ testDateParse("Dec 25 1995 XXX (GMT)", "NaN");
+ testDateParse("Dec 25 1995 1:30 XXX (GMT)", "NaN");
+
+ testDateParse("Dec 25 1995 1:30 U(TC)", "NaN");
+ testDateParse("Dec 25 1995 1:30 V(UTC)", "NaN");
+ testDateParse("Dec 25 1995 1:30 (UTC)W", "NaN");
+ testDateParse("Dec 25 1995 1:30 (GMT)X", "NaN");
+
+ testDateParse("Dec 25 1995 0:30 (PM) GMT", 819851400000);
+ testDateParse("Dec 25 1995 (1)0:30 AM GMT", 819851400000);
+ testDateParse("Dec 25 1995 (1)0:30 PM GMT", 819894600000);
+
+ testDateParse("Anf(Dec) 25 1995 GMT", "NaN");
+
+ testDateParse("(Sat) Wed (Nov) Dec (Nov) 25 1995 1:30 GMT", 819855000000);
+ testDateParse("Wed (comment 1) (comment 2) Dec 25 1995 1:30 GMT", 819855000000);
+ testDateParse("Wed(comment 1) (comment 2) Dec 25 1995 1:30 GMT", 819855000000);
+ testDateParse("We(comment 1) (comment 2) Dec 25 1995 1:30 GMT", 819855000000);
+ });
+
+ // https://github.com/v8/v8/blob/c45b7804109ece574f71fd45417b4ad498a99e6f/test/mjsunit/regress/regress-4640.js#L6
+ test("test/mjsunit/regress-4640.js", () => {
+ expect(new Date("275760-10-14").getMilliseconds()).toBeNaN();
+ expect(new Date("275760-09-23").getMilliseconds()).toBeNaN();
+ expect(new Date("+275760-09-24").getMilliseconds()).toBeNaN();
+ expect(new Date("+275760-10-13").getMilliseconds()).toBeNaN();
+
+ // The following cases used to throw "illegal access"
+ expect(new Date("275760-09-24").getMilliseconds()).toBeNaN();
+ expect(new Date("275760-10-13").getMilliseconds()).toBeNaN();
+ expect(new Date("+275760-10-13 ").getMilliseconds()).toBeNaN();
+
+ // However, dates within the range or valid
+ expect(new Date("100000-10-13").getMilliseconds()).not.toBeNaN();
+ expect(new Date("+100000-10-13").getMilliseconds()).not.toBeNaN();
+ expect(new Date("+100000-10-13 ").getMilliseconds()).not.toBeNaN();
+ });
+
+ // https://github.com/v8/v8/blob/c45b7804109ece574f71fd45417b4ad498a99e6f/test/mjsunit/date-parse.js#L34
+ test("test/mjsunit/date-parse.js", () => {
+ // Test that we can parse dates in all the different formats that we
+ // have to support.
+ //
+ // These formats are all supported by KJS but a lot of them are not
+ // supported by Spidermonkey.
+
+ function testDateParse(string) {
+ var d = Date.parse(string);
+ expect(d).toBe(946713600000);
+ }
+
+ // For local time we just test that parsing returns non-NaN positive
+ // number of milliseconds to make it timezone independent.
+ function testDateParseLocalTime(string) {
+ var d = Date.parse("parse-local-time:" + string);
+ expect(d).not.toBeNaN();
+ expect(d).toBeGreaterThan(0);
+ }
+
+ function testDateParseMisc(array) {
+ expect(array.length).toBe(2);
+ var string = array[0];
+ var expected = array[1];
+ var d = Date.parse(string);
+ expect(expected).toBe(d);
+ }
+
+ //
+ // Test all the formats in UT timezone.
+ //
+ var testCasesUT = [
+ "Sat, 01-Jan-2000 08:00:00 UT",
+ "Sat, 01 Jan 2000 08:00:00 UT",
+ "Jan 01 2000 08:00:00 UT",
+ "Jan 01 08:00:00 UT 2000",
+ "Saturday, 01-Jan-00 08:00:00 UT",
+ "01 Jan 00 08:00 +0000",
+ // Ignore weekdays.
+ "Mon, 01 Jan 2000 08:00:00 UT",
+ "Tue, 01 Jan 2000 08:00:00 UT",
+ // Ignore prefix that is not part of a date.
+ "[Saturday] Jan 01 08:00:00 UT 2000",
+ "Ignore all of this stuff because it is annoying 01 Jan 2000 08:00:00 UT",
+ "[Saturday] Jan 01 2000 08:00:00 UT",
+ "All of this stuff is really annnoying, so it will be ignored Jan 01 2000 08:00:00 UT",
+ // If the three first letters of the month is a
+ // month name we are happy - ignore the rest.
+ "Sat, 01-Janisamonth-2000 08:00:00 UT",
+ "Sat, 01 Janisamonth 2000 08:00:00 UT",
+ "Janisamonth 01 2000 08:00:00 UT",
+ "Janisamonth 01 08:00:00 UT 2000",
+ "Saturday, 01-Janisamonth-00 08:00:00 UT",
+ "01 Janisamonth 00 08:00 +0000",
+ // Allow missing space between month and day.
+ "Janisamonthandtherestisignored01 2000 08:00:00 UT",
+ "Jan01 2000 08:00:00 UT",
+ // Allow year/month/day format.
+ "Sat, 2000/01/01 08:00:00 UT",
+ // Allow month/day/year format.
+ "Sat, 01/01/2000 08:00:00 UT",
+ // Allow month/day year format.
+ "Sat, 01/01 2000 08:00:00 UT",
+ // Allow comma instead of space after day, month and year.
+ "Sat, 01,Jan,2000,08:00:00 UT",
+ // Seconds are optional.
+ "Sat, 01-Jan-2000 08:00 UT",
+ "Sat, 01 Jan 2000 08:00 UT",
+ "Jan 01 2000 08:00 UT",
+ "Jan 01 08:00 UT 2000",
+ "Saturday, 01-Jan-00 08:00 UT",
+ "01 Jan 00 08:00 +0000",
+ // Allow AM/PM after the time.
+ "Sat, 01-Jan-2000 08:00 AM UT",
+ "Sat, 01 Jan 2000 08:00 AM UT",
+ "Jan 01 2000 08:00 AM UT",
+ "Jan 01 08:00 AM UT 2000",
+ "Saturday, 01-Jan-00 08:00 AM UT",
+ "01 Jan 00 08:00 AM +0000",
+ // White space and stuff in parenthesis is
+ // apparently allowed in most places where white
+ // space is allowed.
+ " Sat, 01-Jan-2000 08:00:00 UT ",
+ " Sat, 01 Jan 2000 08:00:00 UT ",
+ " Saturday, 01-Jan-00 08:00:00 UT ",
+ " 01 Jan 00 08:00 +0000 ",
+ " ()(Sat, 01-Jan-2000) Sat, 01-Jan-2000 08:00:00 UT ",
+ " Sat()(Sat, 01-Jan-2000)01 Jan 2000 08:00:00 UT ",
+ " Sat,(02)01 Jan 2000 08:00:00 UT ",
+ " Sat, 01(02)Jan 2000 08:00:00 UT ",
+ " Sat, 01 Jan 2000 (2001)08:00:00 UT ",
+ " Sat, 01 Jan 2000 (01)08:00:00 UT ",
+ " Sat, 01 Jan 2000 (01:00:00)08:00:00 UT ",
+ " Sat, 01 Jan 2000 08:00:00 (CDT)UT ",
+ " Sat, 01 Jan 2000 08:00:00 UT((((CDT))))",
+ " Saturday, 01-Jan-00 ()(((asfd)))(Sat, 01-Jan-2000)08:00:00 UT ",
+ " 01 Jan 00 08:00 ()(((asdf)))(Sat, 01-Jan-2000)+0000 ",
+ " 01 Jan 00 08:00 +0000()((asfd)(Sat, 01-Jan-2000)) ",
+ ];
+
+ //
+ // Test that we do the right correction for different time zones.
+ // I'll assume that we can handle the same formats as for UT and only
+ // test a few formats for each of the timezones.
+ //
+
+ // GMT = UT
+ var testCasesGMT = [
+ "Sat, 01-Jan-2000 08:00:00 GMT",
+ "Sat, 01-Jan-2000 08:00:00 GMT+0",
+ "Sat, 01-Jan-2000 08:00:00 GMT+00",
+ "Sat, 01-Jan-2000 08:00:00 GMT+000",
+ "Sat, 01-Jan-2000 08:00:00 GMT+0000",
+ "Sat, 01-Jan-2000 08:00:00 GMT+00:00", // Interestingly, KJS cannot handle this.
+ "Sat, 01 Jan 2000 08:00:00 GMT",
+ "Saturday, 01-Jan-00 08:00:00 GMT",
+ "01 Jan 00 08:00 -0000",
+ "01 Jan 00 08:00 +0000",
+ ];
+
+ // EST = UT minus 5 hours.
+ var testCasesEST = [
+ "Sat, 01-Jan-2000 03:00:00 UTC-0500",
+ "Sat, 01-Jan-2000 03:00:00 UTC-05:00", // Interestingly, KJS cannot handle this.
+ "Sat, 01-Jan-2000 03:00:00 EST",
+ "Sat, 01 Jan 2000 03:00:00 EST",
+ "Saturday, 01-Jan-00 03:00:00 EST",
+ "01 Jan 00 03:00 -0500",
+ ];
+
+ // EDT = UT minus 4 hours.
+ var testCasesEDT = [
+ "Sat, 01-Jan-2000 04:00:00 EDT",
+ "Sat, 01 Jan 2000 04:00:00 EDT",
+ "Saturday, 01-Jan-00 04:00:00 EDT",
+ "01 Jan 00 04:00 -0400",
+ ];
+
+ // CST = UT minus 6 hours.
+ var testCasesCST = [
+ "Sat, 01-Jan-2000 02:00:00 CST",
+ "Sat, 01 Jan 2000 02:00:00 CST",
+ "Saturday, 01-Jan-00 02:00:00 CST",
+ "01 Jan 00 02:00 -0600",
+ ];
+
+ // CDT = UT minus 5 hours.
+ var testCasesCDT = [
+ "Sat, 01-Jan-2000 03:00:00 CDT",
+ "Sat, 01 Jan 2000 03:00:00 CDT",
+ "Saturday, 01-Jan-00 03:00:00 CDT",
+ "01 Jan 00 03:00 -0500",
+ ];
+
+ // MST = UT minus 7 hours.
+ var testCasesMST = [
+ "Sat, 01-Jan-2000 01:00:00 MST",
+ "Sat, 01 Jan 2000 01:00:00 MST",
+ "Saturday, 01-Jan-00 01:00:00 MST",
+ "01 Jan 00 01:00 -0700",
+ ];
+
+ // MDT = UT minus 6 hours.
+ var testCasesMDT = [
+ "Sat, 01-Jan-2000 02:00:00 MDT",
+ "Sat, 01 Jan 2000 02:00:00 MDT",
+ "Saturday, 01-Jan-00 02:00:00 MDT",
+ "01 Jan 00 02:00 -0600",
+ ];
+
+ // PST = UT minus 8 hours.
+ var testCasesPST = [
+ "Sat, 01-Jan-2000 00:00:00 PST",
+ "Sat, 01 Jan 2000 00:00:00 PST",
+ "Saturday, 01-Jan-00 00:00:00 PST",
+ "01 Jan 00 00:00 -0800",
+ // Allow missing time.
+ "Sat, 01-Jan-2000 PST",
+ ];
+
+ // PDT = UT minus 7 hours.
+ var testCasesPDT = [
+ "Sat, 01-Jan-2000 01:00:00 PDT",
+ "Sat, 01 Jan 2000 01:00:00 PDT",
+ "Saturday, 01-Jan-00 01:00:00 PDT",
+ "01 Jan 00 01:00 -0700",
+ ];
+
+ // Local time cases.
+ var testCasesLocalTime = [
+ // Allow timezone omission.
+ "Sat, 01-Jan-2000 08:00:00",
+ "Sat, 01 Jan 2000 08:00:00",
+ "Jan 01 2000 08:00:00",
+ "Jan 01 08:00:00 2000",
+ "Saturday, 01-Jan-00 08:00:00",
+ "01 Jan 00 08:00",
+ ];
+
+ // Misc. test cases that result in a different time value.
+ var testCasesMisc = [
+ // Special handling for years in the [0, 100) range.
+ ["Sat, 01 Jan 0 08:00:00 UT", 946713600000], // year 2000
+ ["Sat, 01 Jan 49 08:00:00 UT", 2493100800000], // year 2049
+ ["Sat, 01 Jan 50 08:00:00 UT", -631123200000], // year 1950
+ ["Sat, 01 Jan 99 08:00:00 UT", 915177600000], // year 1999
+ ["Sat, 01 Jan 100 08:00:00 UT", -59011430400000], // year 100
+ // Test PM after time.
+ ["Sat, 01-Jan-2000 08:00 PM UT", 946756800000],
+ ["Sat, 01 Jan 2000 08:00 PM UT", 946756800000],
+ ["Jan 01 2000 08:00 PM UT", 946756800000],
+ ["Jan 01 08:00 PM UT 2000", 946756800000],
+ ["Saturday, 01-Jan-00 08:00 PM UT", 946756800000],
+ ["01 Jan 00 08:00 PM +0000", 946756800000],
+ ];
+
+ // Test different version of the ES5 date time string format.
+ var testCasesES5Misc = [
+ ["2000-01-01T08:00:00.000Z", 946713600000],
+ ["2000-01-01T08:00:00Z", 946713600000],
+ ["2000-01-01T08:00Z", 946713600000],
+ ["2000-01T08:00:00.000Z", 946713600000],
+ ["2000T08:00:00.000Z", 946713600000],
+ ["2000T08:00Z", 946713600000],
+ ["2000-01T00:00:00.000-08:00", 946713600000],
+ ["2000-01T08:00:00.001Z", 946713600001],
+ ["2000-01T08:00:00.099Z", 946713600099],
+ ["2000-01T08:00:00.999Z", 946713600999],
+ ["2000-01T00:00:00.001-08:00", 946713600001],
+ ["2000-01-01T24:00Z", 946771200000],
+ ["2000-01-01T24:00:00Z", 946771200000],
+ ["2000-01-01T24:00:00.000Z", 946771200000],
+ ["2000-01-01T24:00:00.000Z", 946771200000],
+ ];
+
+ var testCasesES5MiscNegative = [
+ "2000-01-01TZ",
+ "2000-01-01T60Z",
+ "2000-01-01T60:60Z",
+ "2000-01-0108:00Z",
+ "2000-01-01T08Z",
+ "2000-01-01T24:01",
+ "2000-01-01T24:00:01",
+ "2000-01-01T24:00:00.001",
+ "2000-01-01T24:00:00.999Z",
+ ];
+
+ // TODO(littledan): This is an hack that could break in historically
+ // changing timezones that happened on this day, but allows us to
+ // check the date value for local times.
+ var localOffset = new Date("2000-01-01").getTimezoneOffset() * 1000 * 60;
+
+ // Sanity check which is even more of a hack: in the timezones where
+ // these tests are likely to be run, the offset is nonzero because
+ // dates which don't include Z are in the local timezone.
+ if (
+ this.Intl &&
+ ["America/Los_Angeles", "Europe/Berlin", "Europe/Madrid"].indexOf(
+ Intl.DateTimeFormat().resolvedOptions().timeZone,
+ ) != -1
+ ) {
+ expect(localOffset).not.toBe(0);
+ }
+
+ var testCasesES2016TZ = [
+ // If the timezone is absent and time is present, use local time
+ ["2000-01-02T00:00", 946771200000 + localOffset],
+ ["2000-01-02T00:00:00", 946771200000 + localOffset],
+ ["2000-01-02T00:00:00.000", 946771200000 + localOffset],
+ // If timezone is absent and time is absent, use UTC
+ ["2000-01-02", 946771200000],
+ ["2000-01-02", 946771200000],
+ ["2000-01-02", 946771200000],
+ ];
+
+ // Run all the tests.
+ testCasesUT.forEach(testDateParse);
+ testCasesGMT.forEach(testDateParse);
+ testCasesEST.forEach(testDateParse);
+ testCasesEDT.forEach(testDateParse);
+ testCasesCST.forEach(testDateParse);
+ testCasesCDT.forEach(testDateParse);
+ testCasesMST.forEach(testDateParse);
+ testCasesMDT.forEach(testDateParse);
+ testCasesPST.forEach(testDateParse);
+ testCasesPDT.forEach(testDateParse);
+ testCasesLocalTime.forEach(testDateParseLocalTime);
+ testCasesMisc.forEach(testDateParseMisc);
+
+ // ES5 date time string format compliance.
+ testCasesES5Misc.forEach(testDateParseMisc);
+ testCasesES5MiscNegative.forEach(function (s) {
+ expect(new Date(s).toString()).toBe("Invalid Date");
+ });
+
+ testCasesES2016TZ.forEach(testDateParseMisc);
+
+ // Test that we can parse our own date format.
+ // (Dates from 1970 to ~2070 with 150h steps.)
+ for (var i = 0; i < 24 * 365 * 100; i += 150) {
+ var ms = i * (3600 * 1000);
+ var s = new Date(ms).toString();
+ expect(Date.parse(s)).toBe(ms);
+ }
+
+ // Negative tests.
+ var testCasesNegative = [
+ "May 25 2008 1:30 (PM)) UTC", // Bad unmatched ')' after number.
+ "May 25 2008 1:30( )AM (PM)", //
+ "a1", // Issue 126448, 53209.
+ "nasfdjklsfjoaifg1",
+ "x_2",
+ "May 25 2008 AAA (GMT)",
+ ]; // Unknown word after number.
+
+ testCasesNegative.forEach(function (s) {
+ expect(new Date(s).getMilliseconds()).toBeNaN();
+ });
+ });
+
+ // https://github.com/v8/v8/blob/c45b7804109ece574f71fd45417b4ad498a99e6f/test/intl/regress-1451943.js#L5
+ test("test/intl/regress-1451943.js", () => {
+ let beforeOct1582GregorianTransition = new Date("1582-01-01T00:00Z");
+ let afterOct1582GregorianTransition = new Date("1583-01-01T00:00Z");
+
+ expect(beforeOct1582GregorianTransition.toLocaleDateString("en-US", { timeZone: "UTC", calendar: "gregory" })).toBe(
+ "1/1/1582",
+ );
+ expect(beforeOct1582GregorianTransition.toLocaleDateString("en-US", { timeZone: "UTC", calendar: "iso8601" })).toBe(
+ "1/1/1582",
+ );
+ expect(afterOct1582GregorianTransition.toLocaleDateString("en-US", { timeZone: "UTC", calendar: "iso8601" })).toBe(
+ "1/1/1583",
+ );
+ });
+
+ test("random invalid dates in JSC", () => {
+ var input = "Sep 09 2022 03:53:45Z";
+ expect(Date.parse(input)).toBe(1662695625000);
+
+ input = "2020-09-21 15:19:06 +00:00";
+ expect(Date.parse(input)).toBe(1600701546000);
+ });
+});
diff --git a/test/js/node/vm/vm.test.ts b/test/js/node/vm/vm.test.ts
index 510448c5e..4e291ac9f 100644
--- a/test/js/node/vm/vm.test.ts
+++ b/test/js/node/vm/vm.test.ts
@@ -18,7 +18,6 @@ describe("Script", () => {
describe("runInContext()", () => {
testRunInContext(
(code, context, options) => {
- // @ts-expect-error
const script = new Script(code, options);
return script.runInContext(context);
},
@@ -28,7 +27,6 @@ describe("Script", () => {
describe("runInNewContext()", () => {
testRunInContext(
(code, context, options) => {
- // @ts-expect-error
const script = new Script(code, options);
return script.runInNewContext(context);
},
@@ -37,7 +35,6 @@ describe("Script", () => {
});
describe("runInThisContext()", () => {
testRunInContext((code, context, options) => {
- // @ts-expect-error
const script = new Script(code, options);
return script.runInThisContext(context);
});
@@ -101,7 +98,7 @@ function testRunInContext(
expect(typeof result).toBe("function");
expect(result()).toBe("bar");
});
- test.skip("can throw a syntax error", () => {
+ test("can throw a syntax error", () => {
const context = createContext({});
const result = () => fn("!?", context);
expect(result).toThrow({
diff --git a/test/js/node/watch/fs.watch.test.ts b/test/js/node/watch/fs.watch.test.ts
index 5086ae1d8..787ce413c 100644
--- a/test/js/node/watch/fs.watch.test.ts
+++ b/test/js/node/watch/fs.watch.test.ts
@@ -165,6 +165,36 @@ describe("fs.watch", () => {
});
});
+ // https://github.com/oven-sh/bun/issues/5442
+ test("should work with paths with trailing slashes", done => {
+ const testsubdir = tempDirWithFiles("subdir", {
+ "trailing.txt": "hello",
+ });
+ const filepath = path.join(testsubdir, "trailing.txt");
+ let err: Error | undefined = undefined;
+ const watcher = fs.watch(testsubdir + "/", function (event, filename) {
+ try {
+ expect(event).toBe("rename");
+ expect(filename).toBe("trailing.txt");
+ } catch (e: any) {
+ err = e;
+ } finally {
+ clearInterval(interval);
+ watcher.close();
+ }
+ });
+
+ watcher.once("close", () => {
+ done(err);
+ });
+
+ const interval = repeat(() => {
+ fs.rmSync(filepath, { force: true });
+ const fd = fs.openSync(filepath, "w");
+ fs.closeSync(fd);
+ });
+ });
+
test("should emit 'change' event when file is modified", done => {
const filepath = path.join(testDir, "watch.txt");
diff --git a/test/js/node/worker_threads/worker_threads.test.ts b/test/js/node/worker_threads/worker_threads.test.ts
index ae88add17..86cbaa208 100644
--- a/test/js/node/worker_threads/worker_threads.test.ts
+++ b/test/js/node/worker_threads/worker_threads.test.ts
@@ -16,7 +16,7 @@ import {
MessagePort,
Worker,
} from "worker_threads";
-test("all properties are present", () => {
+test("all worker_threads module properties are present", () => {
expect(wt).toHaveProperty("getEnvironmentData");
expect(wt).toHaveProperty("isMainThread");
expect(wt).toHaveProperty("markAsUntransferable");
@@ -42,7 +42,7 @@ test("all properties are present", () => {
expect(resourceLimits).toBeDefined();
expect(SHARE_ENV).toBeDefined();
expect(setEnvironmentData).toBeDefined();
- expect(threadId).toBeDefined();
+ expect(threadId).toBeNumber();
expect(workerData).toBeUndefined();
expect(BroadcastChannel).toBeDefined();
expect(MessageChannel).toBeDefined();
@@ -60,9 +60,64 @@ test("all properties are present", () => {
}).toThrow("not yet implemented");
});
+test("all worker_threads worker instance properties are present", () => {
+ const worker = new Worker(new URL("./worker.js", import.meta.url).href);
+ expect(worker).toHaveProperty("threadId");
+ expect(worker).toHaveProperty("ref");
+ expect(worker).toHaveProperty("unref");
+ expect(worker).toHaveProperty("stdin");
+ expect(worker).toHaveProperty("stdout");
+ expect(worker).toHaveProperty("stderr");
+ expect(worker).toHaveProperty("performance");
+ expect(worker).toHaveProperty("terminate");
+ expect(worker).toHaveProperty("postMessage");
+ expect(worker).toHaveProperty("getHeapSnapshot");
+ expect(worker).toHaveProperty("setMaxListeners");
+ expect(worker).toHaveProperty("getMaxListeners");
+ expect(worker).toHaveProperty("emit");
+ expect(worker).toHaveProperty("addListener");
+ expect(worker).toHaveProperty("on");
+ expect(worker).toHaveProperty("prependListener");
+ expect(worker).toHaveProperty("once");
+ expect(worker).toHaveProperty("prependOnceListener");
+ expect(worker).toHaveProperty("removeListener");
+ expect(worker).toHaveProperty("off");
+ expect(worker).toHaveProperty("removeAllListeners");
+ expect(worker).toHaveProperty("listeners");
+ expect(worker).toHaveProperty("rawListeners");
+ expect(worker).toHaveProperty("listenerCount");
+ expect(worker).toHaveProperty("eventNames");
+
+ expect(worker.threadId).toBeNumber();
+ expect(worker.ref).toBeFunction();
+ expect(worker.unref).toBeFunction();
+ expect(worker.stdin).toBeNull();
+ expect(worker.stdout).toBeNull();
+ expect(worker.stderr).toBeNull();
+ expect(worker.performance).toBeDefined();
+ expect(worker.terminate).toBeFunction();
+ expect(worker.postMessage).toBeFunction();
+ expect(worker.getHeapSnapshot).toBeFunction();
+ expect(worker.setMaxListeners).toBeFunction();
+ expect(worker.getMaxListeners).toBeFunction();
+ expect(worker.emit).toBeFunction();
+ expect(worker.addListener).toBeFunction();
+ expect(worker.on).toBeFunction();
+ expect(worker.prependListener).toBeFunction();
+ expect(worker.once).toBeFunction();
+ expect(worker.prependOnceListener).toBeFunction();
+ expect(worker.removeListener).toBeFunction();
+ expect(worker.off).toBeFunction();
+ expect(worker.removeAllListeners).toBeFunction();
+ expect(worker.listeners).toBeFunction();
+ expect(worker.rawListeners).toBeFunction();
+ expect(worker.listenerCount).toBeFunction();
+ expect(worker.eventNames).toBeFunction();
+});
+
test("receiveMessageOnPort works across threads", () => {
const { port1, port2 } = new MessageChannel();
- var worker = new wt.Worker(new URL("./worker.js", import.meta.url).href, {
+ const worker = new Worker(new URL("./worker.js", import.meta.url).href, {
workerData: port2,
transferList: [port2],
});
@@ -77,7 +132,7 @@ test("receiveMessageOnPort works across threads", () => {
});
test("receiveMessageOnPort works with FIFO", () => {
- const { port1, port2 } = new wt.MessageChannel();
+ const { port1, port2 } = new MessageChannel();
const message1 = { hello: "world" };
const message2 = { foo: "bar" };
diff --git a/test/js/third_party/got/bun.lockb b/test/js/third_party/got/bun.lockb
new file mode 100755
index 000000000..7dbe60317
--- /dev/null
+++ b/test/js/third_party/got/bun.lockb
Binary files differ
diff --git a/test/js/third_party/jsonwebtoken/async_sign.test.js b/test/js/third_party/jsonwebtoken/async_sign.test.js
new file mode 100644
index 000000000..6efb838d0
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/async_sign.test.js
@@ -0,0 +1,159 @@
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+import jws from "jws";
+import { generateKeyPairSync } from "crypto";
+var PS_SUPPORTED = true;
+
+describe("signing a token asynchronously", function () {
+ describe("when signing a token", function () {
+ var secret = "shhhhhh";
+
+ it("should return the same result as singing synchronously", function (done) {
+ jwt.sign({ foo: "bar" }, secret, { algorithm: "HS256" }, function (err, asyncToken) {
+ if (err) return done(err);
+ var syncToken = jwt.sign({ foo: "bar" }, secret, { algorithm: "HS256" });
+ expect(typeof asyncToken).toBe("string");
+ expect(asyncToken.split(".")).toHaveLength(3);
+ expect(asyncToken).toEqual(syncToken);
+ done();
+ });
+ });
+
+ it("should work with empty options", function (done) {
+ jwt.sign({ abc: 1 }, "secret", {}, function (err) {
+ expect(err).toBeNull();
+ done();
+ });
+ });
+
+ it("should work without options object at all", function (done) {
+ jwt.sign({ abc: 1 }, "secret", function (err) {
+ expect(err).toBeNull();
+ done();
+ });
+ });
+
+ it("should work with none algorithm where secret is set", function (done) {
+ jwt.sign({ foo: "bar" }, "secret", { algorithm: "none" }, function (err, token) {
+ expect(typeof token).toBe("string");
+ expect(token.split(".")).toHaveLength(3);
+ done();
+ });
+ });
+
+ //Known bug: https://github.com/brianloveswords/node-jws/issues/62
+ //If you need this use case, you need to go for the non-callback-ish code style.
+ it.skip("should work with none algorithm where secret is falsy", function (done) {
+ jwt.sign({ foo: "bar" }, undefined, { algorithm: "none" }, function (err, token) {
+ expect(typeof token).toBe("string");
+ expect(token.split(".")).toHaveLength(3);
+ done();
+ });
+ });
+
+ it("should return error when secret is not a cert for RS256", function (done) {
+ //this throw an error because the secret is not a cert and RS256 requires a cert.
+ jwt.sign({ foo: "bar" }, secret, { algorithm: "RS256" }, function (err) {
+ expect(err).toBeTruthy();
+ done();
+ });
+ });
+
+ it("should not work for RS algorithms when modulus length is less than 2048 when allowInsecureKeySizes is false or not set", function (done) {
+ const { privateKey } = generateKeyPairSync("rsa", { modulusLength: 1024 });
+
+ jwt.sign({ foo: "bar" }, privateKey, { algorithm: "RS256" }, function (err) {
+ expect(err).toBeTruthy();
+ done();
+ });
+ });
+
+ it("should work for RS algorithms when modulus length is less than 2048 when allowInsecureKeySizes is true", function (done) {
+ const { privateKey } = generateKeyPairSync("rsa", { modulusLength: 1024 });
+
+ jwt.sign({ foo: "bar" }, privateKey, { algorithm: "RS256", allowInsecureKeySizes: true }, done);
+ });
+
+ if (PS_SUPPORTED) {
+ it("should return error when secret is not a cert for PS256", function (done) {
+ //this throw an error because the secret is not a cert and PS256 requires a cert.
+ jwt.sign({ foo: "bar" }, secret, { algorithm: "PS256" }, function (err) {
+ expect(err).toBeTruthy();
+ done();
+ });
+ });
+ }
+
+ it("should return error on wrong arguments", function (done) {
+ //this throw an error because the secret is not a cert and RS256 requires a cert.
+ jwt.sign({ foo: "bar" }, secret, { notBefore: {} }, function (err) {
+ expect(err).toBeTruthy();
+ done();
+ });
+ });
+
+ it("should return error on wrong arguments (2)", function (done) {
+ jwt.sign("string", "secret", { noTimestamp: true }, function (err) {
+ expect(err).toBeTruthy();
+ expect(err).toBeInstanceOf(Error);
+ done();
+ });
+ });
+
+ it("should not stringify the payload", function (done) {
+ jwt.sign("string", "secret", {}, function (err, token) {
+ if (err) {
+ return done(err);
+ }
+ expect(jws.decode(token).payload).toEqual("string");
+ done();
+ });
+ });
+
+ describe("when mutatePayload is not set", function () {
+ it("should not apply claims to the original payload object (mutatePayload defaults to false)", function (done) {
+ var originalPayload = { foo: "bar" };
+ jwt.sign(originalPayload, "secret", { notBefore: 60, expiresIn: 600 }, function (err) {
+ if (err) {
+ return done(err);
+ }
+ expect(originalPayload).not.toHaveProperty("nbf");
+ expect(originalPayload).not.toHaveProperty("exp");
+ done();
+ });
+ });
+ });
+
+ describe("when mutatePayload is set to true", function () {
+ it("should apply claims directly to the original payload object", function (done) {
+ var originalPayload = { foo: "bar" };
+ jwt.sign(originalPayload, "secret", { notBefore: 60, expiresIn: 600, mutatePayload: true }, function (err) {
+ if (err) {
+ return done(err);
+ }
+ expect(originalPayload).toHaveProperty("nbf");
+ expect(originalPayload).toHaveProperty("exp");
+ done();
+ });
+ });
+ });
+
+ describe("secret must have a value", function () {
+ [undefined, "", 0].forEach(function (secret) {
+ it(
+ "should return an error if the secret is falsy and algorithm is not set to none: " +
+ (typeof secret === "string" ? "(empty string)" : secret),
+ function (done) {
+ // This is needed since jws will not answer for falsy secrets
+ jwt.sign("string", secret, {}, function (err, token) {
+ expect(err).toBeTruthy();
+ expect(err.message).toEqual("secretOrPrivateKey must have a value");
+ expect(token).toBeFalsy();
+ done();
+ });
+ },
+ );
+ });
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/buffer.test.js b/test/js/third_party/jsonwebtoken/buffer.test.js
new file mode 100644
index 000000000..28d310221
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/buffer.test.js
@@ -0,0 +1,10 @@
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+
+describe("buffer payload", function () {
+ it("should work", function () {
+ var payload = new Buffer("TkJyotZe8NFpgdfnmgINqg==", "base64");
+ var token = jwt.sign(payload, "signing key");
+ expect(jwt.decode(token)).toBe(payload.toString());
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/claim-aud.test.js b/test/js/third_party/jsonwebtoken/claim-aud.test.js
new file mode 100644
index 000000000..b850b265b
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/claim-aud.test.js
@@ -0,0 +1,423 @@
+"use strict";
+
+import jwt from "jsonwebtoken";
+import { expect, describe, it, beforeEach } from "bun:test";
+import util from "util";
+import testUtils from "./test-utils";
+
+function signWithAudience(audience, payload, callback) {
+ const options = { algorithm: "HS256" };
+ if (audience !== undefined) {
+ options.audience = audience;
+ }
+
+ testUtils.signJWTHelper(payload, "secret", options, callback);
+}
+
+function verifyWithAudience(token, audience, callback) {
+ testUtils.verifyJWTHelper(token, "secret", { audience }, callback);
+}
+
+describe("audience", function () {
+ describe('`jwt.sign` "audience" option validation', function () {
+ [true, false, null, -1, 1, 0, -1.1, 1.1, -Infinity, Infinity, NaN, {}, { foo: "bar" }].forEach(audience => {
+ it(`should error with with value ${util.inspect(audience)}`, function (done) {
+ signWithAudience(audience, {}, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", '"audience" must be a string or array');
+ });
+ });
+ });
+ });
+
+ // undefined needs special treatment because {} is not the same as {aud: undefined}
+ it("should error with with value undefined", function (done) {
+ testUtils.signJWTHelper({}, "secret", { audience: undefined, algorithm: "HS256" }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", '"audience" must be a string or array');
+ });
+ });
+ });
+
+ it('should error when "aud" is in payload', function (done) {
+ signWithAudience("my_aud", { aud: "" }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty(
+ "message",
+ 'Bad "options.audience" option. The payload already has an "aud" property.',
+ );
+ });
+ });
+ });
+
+ it("should error with a string payload", function (done) {
+ signWithAudience("my_aud", "a string payload", err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", "invalid audience option for string payload");
+ });
+ });
+ });
+
+ it("should error with a Buffer payload", function (done) {
+ signWithAudience("my_aud", new Buffer("a Buffer payload"), err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", "invalid audience option for object payload");
+ });
+ });
+ });
+ });
+
+ describe('when signing and verifying a token with "audience" option', function () {
+ describe('with a "aud" of "urn:foo" in payload', function () {
+ let token;
+
+ beforeEach(function (done) {
+ signWithAudience("urn:foo", {}, (err, t) => {
+ token = t;
+ done(err);
+ });
+ });
+
+ [
+ undefined,
+ "urn:foo",
+ /^urn:f[o]{2}$/,
+ ["urn:no_match", "urn:foo"],
+ ["urn:no_match", /^urn:f[o]{2}$/],
+ [/^urn:no_match$/, /^urn:f[o]{2}$/],
+ [/^urn:no_match$/, "urn:foo"],
+ ].forEach(audience => {
+ it(`should verify and decode with verify "audience" option of ${util.inspect(audience)}`, function (done) {
+ verifyWithAudience(token, audience, (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", "urn:foo");
+ });
+ });
+ });
+ });
+
+ it(`should error on no match with a string verify "audience" option`, function (done) {
+ verifyWithAudience(token, "urn:no-match", err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", `jwt audience invalid. expected: urn:no-match`);
+ });
+ });
+ });
+
+ it('should error on no match with an array of string verify "audience" option', function (done) {
+ verifyWithAudience(token, ["urn:no-match-1", "urn:no-match-2"], err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", `jwt audience invalid. expected: urn:no-match-1 or urn:no-match-2`);
+ });
+ });
+ });
+
+ it('should error on no match with a Regex verify "audience" option', function (done) {
+ verifyWithAudience(token, /^urn:no-match$/, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", `jwt audience invalid. expected: /^urn:no-match$/`);
+ });
+ });
+ });
+
+ it('should error on no match with an array of Regex verify "audience" option', function (done) {
+ verifyWithAudience(token, [/^urn:no-match-1$/, /^urn:no-match-2$/], err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty(
+ "message",
+ `jwt audience invalid. expected: /^urn:no-match-1$/ or /^urn:no-match-2$/`,
+ );
+ });
+ });
+ });
+
+ it('should error on no match with an array of a Regex and a string in verify "audience" option', function (done) {
+ verifyWithAudience(token, [/^urn:no-match$/, "urn:no-match"], err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", `jwt audience invalid. expected: /^urn:no-match$/ or urn:no-match`);
+ });
+ });
+ });
+ });
+
+ describe('with an array of ["urn:foo", "urn:bar"] for "aud" value in payload', function () {
+ let token;
+
+ beforeEach(function (done) {
+ signWithAudience(["urn:foo", "urn:bar"], {}, (err, t) => {
+ token = t;
+ done(err);
+ });
+ });
+
+ [
+ undefined,
+ "urn:foo",
+ /^urn:f[o]{2}$/,
+ ["urn:no_match", "urn:foo"],
+ ["urn:no_match", /^urn:f[o]{2}$/],
+ [/^urn:no_match$/, /^urn:f[o]{2}$/],
+ [/^urn:no_match$/, "urn:foo"],
+ ].forEach(audience => {
+ it(`should verify and decode with verify "audience" option of ${util.inspect(audience)}`, function (done) {
+ verifyWithAudience(token, audience, (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", ["urn:foo", "urn:bar"]);
+ });
+ });
+ });
+ });
+
+ it(`should error on no match with a string verify "audience" option`, function (done) {
+ verifyWithAudience(token, "urn:no-match", err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", `jwt audience invalid. expected: urn:no-match`);
+ });
+ });
+ });
+
+ it('should error on no match with an array of string verify "audience" option', function (done) {
+ verifyWithAudience(token, ["urn:no-match-1", "urn:no-match-2"], err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", `jwt audience invalid. expected: urn:no-match-1 or urn:no-match-2`);
+ });
+ });
+ });
+
+ it('should error on no match with a Regex verify "audience" option', function (done) {
+ verifyWithAudience(token, /^urn:no-match$/, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", `jwt audience invalid. expected: /^urn:no-match$/`);
+ });
+ });
+ });
+
+ it('should error on no match with an array of Regex verify "audience" option', function (done) {
+ verifyWithAudience(token, [/^urn:no-match-1$/, /^urn:no-match-2$/], err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty(
+ "message",
+ `jwt audience invalid. expected: /^urn:no-match-1$/ or /^urn:no-match-2$/`,
+ );
+ });
+ });
+ });
+
+ it('should error on no match with an array of a Regex and a string in verify "audience" option', function (done) {
+ verifyWithAudience(token, [/^urn:no-match$/, "urn:no-match"], err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", `jwt audience invalid. expected: /^urn:no-match$/ or urn:no-match`);
+ });
+ });
+ });
+
+ describe('when checking for a matching on both "urn:foo" and "urn:bar"', function () {
+ it('should verify with an array of stings verify "audience" option', function (done) {
+ verifyWithAudience(token, ["urn:foo", "urn:bar"], (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", ["urn:foo", "urn:bar"]);
+ });
+ });
+ });
+
+ it('should verify with a Regex verify "audience" option', function (done) {
+ verifyWithAudience(token, /^urn:[a-z]{3}$/, (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", ["urn:foo", "urn:bar"]);
+ });
+ });
+ });
+
+ it('should verify with an array of Regex verify "audience" option', function (done) {
+ verifyWithAudience(token, [/^urn:f[o]{2}$/, /^urn:b[ar]{2}$/], (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", ["urn:foo", "urn:bar"]);
+ });
+ });
+ });
+ });
+
+ describe('when checking for a matching for "urn:foo"', function () {
+ it('should verify with a string verify "audience"', function (done) {
+ verifyWithAudience(token, "urn:foo", (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", ["urn:foo", "urn:bar"]);
+ });
+ });
+ });
+
+ it('should verify with a Regex verify "audience" option', function (done) {
+ verifyWithAudience(token, /^urn:f[o]{2}$/, (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", ["urn:foo", "urn:bar"]);
+ });
+ });
+ });
+
+ it('should verify with an array of Regex verify "audience"', function (done) {
+ verifyWithAudience(token, [/^urn:no-match$/, /^urn:f[o]{2}$/], (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", ["urn:foo", "urn:bar"]);
+ });
+ });
+ });
+
+ it('should verify with an array containing a string and a Regex verify "audience" option', function (done) {
+ verifyWithAudience(token, ["urn:no_match", /^urn:f[o]{2}$/], (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", ["urn:foo", "urn:bar"]);
+ });
+ });
+ });
+
+ it('should verify with an array containing a Regex and a string verify "audience" option', function (done) {
+ verifyWithAudience(token, [/^urn:no-match$/, "urn:foo"], (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", ["urn:foo", "urn:bar"]);
+ });
+ });
+ });
+ });
+
+ describe('when checking matching for "urn:bar"', function () {
+ it('should verify with a string verify "audience"', function (done) {
+ verifyWithAudience(token, "urn:bar", (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", ["urn:foo", "urn:bar"]);
+ });
+ });
+ });
+
+ it('should verify with a Regex verify "audience" option', function (done) {
+ verifyWithAudience(token, /^urn:b[ar]{2}$/, (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", ["urn:foo", "urn:bar"]);
+ });
+ });
+ });
+
+ it('should verify with an array of Regex verify "audience" option', function (done) {
+ verifyWithAudience(token, [/^urn:no-match$/, /^urn:b[ar]{2}$/], (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", ["urn:foo", "urn:bar"]);
+ });
+ });
+ });
+
+ it('should verify with an array containing a string and a Regex verify "audience" option', function (done) {
+ verifyWithAudience(token, ["urn:no_match", /^urn:b[ar]{2}$/], (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", ["urn:foo", "urn:bar"]);
+ });
+ });
+ });
+
+ it('should verify with an array containing a Regex and a string verify "audience" option', function (done) {
+ verifyWithAudience(token, [/^urn:no-match$/, "urn:bar"], (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("aud", ["urn:foo", "urn:bar"]);
+ });
+ });
+ });
+ });
+ });
+
+ describe('without a "aud" value in payload', function () {
+ let token;
+
+ beforeEach(function (done) {
+ signWithAudience(undefined, {}, (err, t) => {
+ token = t;
+ done(err);
+ });
+ });
+
+ it('should verify and decode without verify "audience" option', function (done) {
+ verifyWithAudience(token, undefined, (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).not.toHaveProperty("aud");
+ });
+ });
+ });
+
+ it('should error on no match with a string verify "audience" option', function (done) {
+ verifyWithAudience(token, "urn:no-match", err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", "jwt audience invalid. expected: urn:no-match");
+ });
+ });
+ });
+
+ it('should error on no match with an array of string verify "audience" option', function (done) {
+ verifyWithAudience(token, ["urn:no-match-1", "urn:no-match-2"], err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", "jwt audience invalid. expected: urn:no-match-1 or urn:no-match-2");
+ });
+ });
+ });
+
+ it('should error on no match with a Regex verify "audience" option', function (done) {
+ verifyWithAudience(token, /^urn:no-match$/, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", "jwt audience invalid. expected: /^urn:no-match$/");
+ });
+ });
+ });
+
+ it('should error on no match with an array of Regex verify "audience" option', function (done) {
+ verifyWithAudience(token, [/^urn:no-match-1$/, /^urn:no-match-2$/], err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty(
+ "message",
+ "jwt audience invalid. expected: /^urn:no-match-1$/ or /^urn:no-match-2$/",
+ );
+ });
+ });
+ });
+
+ it('should error on no match with an array of a Regex and a string in verify "audience" option', function (done) {
+ verifyWithAudience(token, [/^urn:no-match$/, "urn:no-match"], err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", "jwt audience invalid. expected: /^urn:no-match$/ or urn:no-match");
+ });
+ });
+ });
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/claim-exp.test.js b/test/js/third_party/jsonwebtoken/claim-exp.test.js
new file mode 100644
index 000000000..ee836a755
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/claim-exp.test.js
@@ -0,0 +1,316 @@
+"use strict";
+
+import jwt from "jsonwebtoken";
+import { expect, describe, it, beforeEach } from "bun:test";
+import util from "util";
+import testUtils from "./test-utils";
+import jws from "jws";
+import sinon from "sinon";
+
+function signWithExpiresIn(expiresIn, payload, callback) {
+ const options = { algorithm: "HS256" };
+ if (expiresIn !== undefined) {
+ options.expiresIn = expiresIn;
+ }
+ testUtils.signJWTHelper(payload, "secret", options, callback);
+}
+
+describe("expires", function () {
+ describe('`jwt.sign` "expiresIn" option validation', function () {
+ [
+ true,
+ false,
+ null,
+ -1.1,
+ 1.1,
+ -Infinity,
+ Infinity,
+ NaN,
+ " ",
+ "",
+ "invalid",
+ [],
+ ["foo"],
+ {},
+ { foo: "bar" },
+ ].forEach(expiresIn => {
+ it(`should error with with value ${util.inspect(expiresIn)}`, function (done) {
+ signWithExpiresIn(expiresIn, {}, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message");
+ });
+ });
+ });
+ });
+
+ // undefined needs special treatment because {} is not the same as {expiresIn: undefined}
+ it("should error with with value undefined", function (done) {
+ testUtils.signJWTHelper({}, "secret", { expiresIn: undefined, algorithm: "HS256" }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty(
+ "message",
+ '"expiresIn" should be a number of seconds or string representing a timespan',
+ );
+ });
+ });
+ });
+
+ it('should error when "exp" is in payload', function (done) {
+ signWithExpiresIn(100, { exp: 100 }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty(
+ "message",
+ 'Bad "options.expiresIn" option the payload already has an "exp" property.',
+ );
+ });
+ });
+ });
+
+ it("should error with a string payload", function (done) {
+ signWithExpiresIn(100, "a string payload", err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", "invalid expiresIn option for string payload");
+ });
+ });
+ });
+
+ it("should error with a Buffer payload", function (done) {
+ signWithExpiresIn(100, Buffer.from("a Buffer payload"), err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", "invalid expiresIn option for object payload");
+ });
+ });
+ });
+ });
+
+ describe('`jwt.sign` "exp" claim validation', function () {
+ [true, false, null, undefined, "", " ", "invalid", [], ["foo"], {}, { foo: "bar" }].forEach(exp => {
+ it(`should error with with value ${util.inspect(exp)}`, function (done) {
+ signWithExpiresIn(undefined, { exp }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", '"exp" should be a number of seconds');
+ });
+ });
+ });
+ });
+ });
+
+ describe('"exp" in payload validation', function () {
+ [true, false, null, -Infinity, Infinity, NaN, "", " ", "invalid", [], ["foo"], {}, { foo: "bar" }].forEach(exp => {
+ it(`should error with with value ${util.inspect(exp)}`, function (done) {
+ const header = { alg: "HS256" };
+ const payload = { exp };
+ const token = jws.sign({ header, payload, secret: "secret", encoding: "utf8" });
+ testUtils.verifyJWTHelper(token, "secret", { exp }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", "invalid exp value");
+ });
+ });
+ });
+ });
+ });
+
+ describe("when signing and verifying a token with expires option", function () {
+ let fakeClock;
+ beforeEach(function () {
+ fakeClock = sinon.useFakeTimers({ now: 60000 });
+ });
+
+ afterEach(function () {
+ fakeClock.uninstall();
+ });
+
+ it('should set correct "exp" with negative number of seconds', function (done) {
+ signWithExpiresIn(-10, {}, (e1, token) => {
+ fakeClock.tick(-10001);
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("exp", 50);
+ });
+ });
+ });
+ });
+
+ it('should set correct "exp" with positive number of seconds', function (done) {
+ signWithExpiresIn(10, {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("exp", 70);
+ });
+ });
+ });
+ });
+
+ it('should set correct "exp" with zero seconds', function (done) {
+ signWithExpiresIn(0, {}, (e1, token) => {
+ fakeClock.tick(-1);
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("exp", 60);
+ });
+ });
+ });
+ });
+
+ it('should set correct "exp" with negative string timespan', function (done) {
+ signWithExpiresIn("-10 s", {}, (e1, token) => {
+ fakeClock.tick(-10001);
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("exp", 50);
+ });
+ });
+ });
+ });
+
+ it('should set correct "exp" with positive string timespan', function (done) {
+ signWithExpiresIn("10 s", {}, (e1, token) => {
+ fakeClock.tick(-10001);
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("exp", 70);
+ });
+ });
+ });
+ });
+
+ it('should set correct "exp" with zero string timespan', function (done) {
+ signWithExpiresIn("0 s", {}, (e1, token) => {
+ fakeClock.tick(-1);
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("exp", 60);
+ });
+ });
+ });
+ });
+
+ // TODO an exp of -Infinity should fail validation
+ it('should set null "exp" when given -Infinity', function (done) {
+ signWithExpiresIn(undefined, { exp: -Infinity }, (err, token) => {
+ const decoded = jwt.decode(token);
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("exp", null);
+ });
+ });
+ });
+
+ // TODO an exp of Infinity should fail validation
+ it('should set null "exp" when given value Infinity', function (done) {
+ signWithExpiresIn(undefined, { exp: Infinity }, (err, token) => {
+ const decoded = jwt.decode(token);
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("exp", null);
+ });
+ });
+ });
+
+ // TODO an exp of NaN should fail validation
+ it('should set null "exp" when given value NaN', function (done) {
+ signWithExpiresIn(undefined, { exp: NaN }, (err, token) => {
+ const decoded = jwt.decode(token);
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("exp", null);
+ });
+ });
+ });
+
+ it('should set correct "exp" when "iat" is passed', function (done) {
+ signWithExpiresIn(-10, { iat: 80 }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("exp", 70);
+ });
+ });
+ });
+ });
+
+ it('should verify "exp" using "clockTimestamp"', function (done) {
+ signWithExpiresIn(10, {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { clockTimestamp: 69 }, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("iat", 60);
+ expect(decoded).toHaveProperty("exp", 70);
+ });
+ });
+ });
+ });
+
+ it('should verify "exp" using "clockTolerance"', function (done) {
+ signWithExpiresIn(5, {}, (e1, token) => {
+ fakeClock.tick(10000);
+ testUtils.verifyJWTHelper(token, "secret", { clockTimestamp: 6 }, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("iat", 60);
+ expect(decoded).toHaveProperty("exp", 65);
+ });
+ });
+ });
+ });
+
+ it('should ignore a expired token when "ignoreExpiration" is true', function (done) {
+ signWithExpiresIn("-10 s", {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { ignoreExpiration: true }, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("iat", 60);
+ expect(decoded).toHaveProperty("exp", 50);
+ });
+ });
+ });
+ });
+
+ it('should error on verify if "exp" is at current time', function (done) {
+ signWithExpiresIn(undefined, { exp: 60 }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, e2 => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeInstanceOf(jwt.TokenExpiredError);
+ expect(e2).toHaveProperty("message", "jwt expired");
+ });
+ });
+ });
+ });
+
+ it('should error on verify if "exp" is before current time using clockTolerance', function (done) {
+ signWithExpiresIn(-5, {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { clockTolerance: 5 }, e2 => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeInstanceOf(jwt.TokenExpiredError);
+ expect(e2).toHaveProperty("message", "jwt expired");
+ });
+ });
+ });
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/claim-iat.test.js b/test/js/third_party/jsonwebtoken/claim-iat.test.js
new file mode 100644
index 000000000..6d72a58f6
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/claim-iat.test.js
@@ -0,0 +1,254 @@
+"use strict";
+
+import jwt from "jsonwebtoken";
+import { expect, describe, it, beforeEach } from "bun:test";
+import util from "util";
+import testUtils from "./test-utils";
+import jws from "jws";
+import sinon from "sinon";
+
+function signWithIssueAt(issueAt, options, callback) {
+ const payload = {};
+ if (issueAt !== undefined) {
+ payload.iat = issueAt;
+ }
+ const opts = Object.assign({ algorithm: "HS256" }, options);
+ // async calls require a truthy secret
+ // see: https://github.com/brianloveswords/node-jws/issues/62
+ testUtils.signJWTHelper(payload, "secret", opts, callback);
+}
+
+function verifyWithIssueAt(token, maxAge, options, secret, callback) {
+ const opts = Object.assign({ maxAge }, options);
+ testUtils.verifyJWTHelper(token, secret, opts, callback);
+}
+
+describe("issue at", function () {
+ describe('`jwt.sign` "iat" claim validation', function () {
+ [true, false, null, "", "invalid", [], ["foo"], {}, { foo: "bar" }].forEach(iat => {
+ it(`should error with iat of ${util.inspect(iat)}`, function (done) {
+ signWithIssueAt(iat, {}, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err.message).toEqual('"iat" should be a number of seconds');
+ });
+ });
+ });
+ });
+
+ // undefined needs special treatment because {} is not the same as {iat: undefined}
+ it("should error with iat of undefined", function (done) {
+ testUtils.signJWTHelper({ iat: undefined }, "secret", { algorithm: "HS256" }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err.message).toEqual('"iat" should be a number of seconds');
+ });
+ });
+ });
+ });
+
+ describe('"iat" in payload with "maxAge" option validation', function () {
+ [true, false, null, undefined, -Infinity, Infinity, NaN, "", "invalid", [], ["foo"], {}, { foo: "bar" }].forEach(
+ iat => {
+ it(`should error with iat of ${util.inspect(iat)}`, function (done) {
+ const header = { alg: "HS256" };
+ const payload = { iat };
+ const token = jws.sign({ header, payload, secret: "secret", encoding: "utf8" });
+ verifyWithIssueAt(token, "1 min", {}, "secret", err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err.message).toEqual("iat required when maxAge is specified");
+ });
+ });
+ });
+ },
+ );
+ });
+
+ describe("when signing a token", function () {
+ let fakeClock;
+ beforeEach(function () {
+ fakeClock = sinon.useFakeTimers({ now: 60000 });
+ });
+
+ afterEach(function () {
+ fakeClock.uninstall();
+ });
+
+ [
+ {
+ description: 'should default to current time for "iat"',
+ iat: undefined,
+ expectedIssueAt: 60,
+ options: {},
+ },
+ {
+ description: 'should sign with provided time for "iat"',
+ iat: 100,
+ expectedIssueAt: 100,
+ options: {},
+ },
+ // TODO an iat of -Infinity should fail validation
+ {
+ description: 'should set null "iat" when given -Infinity',
+ iat: -Infinity,
+ expectedIssueAt: null,
+ options: {},
+ },
+ // TODO an iat of Infinity should fail validation
+ {
+ description: 'should set null "iat" when given Infinity',
+ iat: Infinity,
+ expectedIssueAt: null,
+ options: {},
+ },
+ // TODO an iat of NaN should fail validation
+ {
+ description: 'should set to current time for "iat" when given value NaN',
+ iat: NaN,
+ expectedIssueAt: 60,
+ options: {},
+ },
+ {
+ description: 'should remove default "iat" with "noTimestamp" option',
+ iat: undefined,
+ expectedIssueAt: undefined,
+ options: { noTimestamp: true },
+ },
+ {
+ description: 'should remove provided "iat" with "noTimestamp" option',
+ iat: 10,
+ expectedIssueAt: undefined,
+ options: { noTimestamp: true },
+ },
+ ].forEach(testCase => {
+ it(testCase.description, function (done) {
+ signWithIssueAt(testCase.iat, testCase.options, (err, token) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(jwt.decode(token).iat).toEqual(testCase.expectedIssueAt);
+ });
+ });
+ });
+ });
+ });
+
+ describe("when verifying a token", function () {
+ let fakeClock;
+
+ beforeEach(function () {
+ fakeClock = sinon.useFakeTimers({ now: 60000 });
+ });
+
+ afterEach(function () {
+ fakeClock.uninstall();
+ });
+
+ [
+ {
+ description: 'should verify using "iat" before the "maxAge"',
+ clockAdvance: 10000,
+ maxAge: 11,
+ options: {},
+ },
+ {
+ description: 'should verify using "iat" before the "maxAge" with a provided "clockTimestamp',
+ clockAdvance: 60000,
+ maxAge: 11,
+ options: { clockTimestamp: 70 },
+ },
+ {
+ description: 'should verify using "iat" after the "maxAge" but within "clockTolerance"',
+ clockAdvance: 10000,
+ maxAge: 9,
+ options: { clockTimestamp: 2 },
+ },
+ ].forEach(testCase => {
+ it(testCase.description, function (done) {
+ const token = jwt.sign({}, "secret", { algorithm: "HS256" });
+ fakeClock.tick(testCase.clockAdvance);
+ verifyWithIssueAt(token, testCase.maxAge, testCase.options, "secret", (err, token) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(typeof token).toBe("object");
+ });
+ });
+ });
+ });
+
+ [
+ {
+ description: 'should throw using "iat" equal to the "maxAge"',
+ clockAdvance: 10000,
+ maxAge: 10,
+ options: {},
+ expectedError: "maxAge exceeded",
+ expectedExpiresAt: 70000,
+ },
+ {
+ description: 'should throw using "iat" after the "maxAge"',
+ clockAdvance: 10000,
+ maxAge: 9,
+ options: {},
+ expectedError: "maxAge exceeded",
+ expectedExpiresAt: 69000,
+ },
+ {
+ description: 'should throw using "iat" after the "maxAge" with a provided "clockTimestamp',
+ clockAdvance: 60000,
+ maxAge: 10,
+ options: { clockTimestamp: 70 },
+ expectedError: "maxAge exceeded",
+ expectedExpiresAt: 70000,
+ },
+ {
+ description: 'should throw using "iat" after the "maxAge" and "clockTolerance',
+ clockAdvance: 10000,
+ maxAge: 8,
+ options: { clockTolerance: 2 },
+ expectedError: "maxAge exceeded",
+ expectedExpiresAt: 68000,
+ },
+ ].forEach(testCase => {
+ it(testCase.description, function (done) {
+ const expectedExpiresAtDate = new Date(testCase.expectedExpiresAt);
+ const token = jwt.sign({}, "secret", { algorithm: "HS256" });
+ fakeClock.tick(testCase.clockAdvance);
+
+ verifyWithIssueAt(token, testCase.maxAge, testCase.options, "secret", err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err.message).toEqual(testCase.expectedError);
+ expect(err.expiredAt).toStrictEqual(expectedExpiresAtDate);
+ });
+ });
+ });
+ });
+ });
+
+ describe("with string payload", function () {
+ it("should not add iat to string", function (done) {
+ const payload = "string payload";
+ const options = { algorithm: "HS256" };
+ testUtils.signJWTHelper(payload, "secret", options, (err, token) => {
+ const decoded = jwt.decode(token);
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toEqual(payload);
+ });
+ });
+ });
+
+ it("should not add iat to stringified object", function (done) {
+ const payload = "{}";
+ const options = { algorithm: "HS256", header: { typ: "JWT" } };
+ testUtils.signJWTHelper(payload, "secret", options, (err, token) => {
+ const decoded = jwt.decode(token);
+ testUtils.asyncCheck(done, () => {
+ expect(err).toEqual(null);
+ expect(JSON.stringify(decoded)).toEqual(payload);
+ });
+ });
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/claim-iss.test.js b/test/js/third_party/jsonwebtoken/claim-iss.test.js
new file mode 100644
index 000000000..3b2e9dacf
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/claim-iss.test.js
@@ -0,0 +1,185 @@
+"use strict";
+
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+import util from "util";
+import testUtils from "./test-utils";
+
+function signWithIssuer(issuer, payload, callback) {
+ const options = { algorithm: "HS256" };
+ if (issuer !== undefined) {
+ options.issuer = issuer;
+ }
+ testUtils.signJWTHelper(payload, "secret", options, callback);
+}
+
+describe("issuer", function () {
+ describe('`jwt.sign` "issuer" option validation', function () {
+ [true, false, null, -1, 0, 1, -1.1, 1.1, -Infinity, Infinity, NaN, [], ["foo"], {}, { foo: "bar" }].forEach(
+ issuer => {
+ it(`should error with with value ${util.inspect(issuer)}`, function (done) {
+ signWithIssuer(issuer, {}, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", '"issuer" must be a string');
+ });
+ });
+ });
+ },
+ );
+
+ // undefined needs special treatment because {} is not the same as {issuer: undefined}
+ it("should error with with value undefined", function (done) {
+ testUtils.signJWTHelper({}, "secret", { issuer: undefined, algorithm: "HS256" }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", '"issuer" must be a string');
+ });
+ });
+ });
+
+ it('should error when "iss" is in payload', function (done) {
+ signWithIssuer("foo", { iss: "bar" }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty(
+ "message",
+ 'Bad "options.issuer" option. The payload already has an "iss" property.',
+ );
+ });
+ });
+ });
+
+ it("should error with a string payload", function (done) {
+ signWithIssuer("foo", "a string payload", err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", "invalid issuer option for string payload");
+ });
+ });
+ });
+
+ it("should error with a Buffer payload", function (done) {
+ signWithIssuer("foo", new Buffer("a Buffer payload"), err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", "invalid issuer option for object payload");
+ });
+ });
+ });
+ });
+
+ describe("when signing and verifying a token", function () {
+ it('should not verify "iss" if verify "issuer" option not provided', function (done) {
+ signWithIssuer(undefined, { iss: "foo" }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("iss", "foo");
+ });
+ });
+ });
+ });
+
+ describe('with string "issuer" option', function () {
+ it('should verify with a string "issuer"', function (done) {
+ signWithIssuer("foo", {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { issuer: "foo" }, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("iss", "foo");
+ });
+ });
+ });
+ });
+
+ it('should verify with a string "iss"', function (done) {
+ signWithIssuer(undefined, { iss: "foo" }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { issuer: "foo" }, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("iss", "foo");
+ });
+ });
+ });
+ });
+
+ it('should error if "iss" does not match verify "issuer" option', function (done) {
+ signWithIssuer(undefined, { iss: "foobar" }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { issuer: "foo" }, e2 => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(e2).toHaveProperty("message", "jwt issuer invalid. expected: foo");
+ });
+ });
+ });
+ });
+
+ it('should error without "iss" and with verify "issuer" option', function (done) {
+ signWithIssuer(undefined, {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { issuer: "foo" }, e2 => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(e2).toHaveProperty("message", "jwt issuer invalid. expected: foo");
+ });
+ });
+ });
+ });
+ });
+
+ describe('with array "issuer" option', function () {
+ it('should verify with a string "issuer"', function (done) {
+ signWithIssuer("bar", {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { issuer: ["foo", "bar"] }, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("iss", "bar");
+ });
+ });
+ });
+ });
+
+ it('should verify with a string "iss"', function (done) {
+ signWithIssuer(undefined, { iss: "foo" }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { issuer: ["foo", "bar"] }, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("iss", "foo");
+ });
+ });
+ });
+ });
+
+ it('should error if "iss" does not match verify "issuer" option', function (done) {
+ signWithIssuer(undefined, { iss: "foobar" }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { issuer: ["foo", "bar"] }, e2 => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(e2).toHaveProperty("message", "jwt issuer invalid. expected: foo,bar");
+ });
+ });
+ });
+ });
+
+ it('should error without "iss" and with verify "issuer" option', function (done) {
+ signWithIssuer(undefined, {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { issuer: ["foo", "bar"] }, e2 => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(e2).toHaveProperty("message", "jwt issuer invalid. expected: foo,bar");
+ });
+ });
+ });
+ });
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/claim-jti.test.js b/test/js/third_party/jsonwebtoken/claim-jti.test.js
new file mode 100644
index 000000000..18aa15df8
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/claim-jti.test.js
@@ -0,0 +1,135 @@
+"use strict";
+
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+import util from "util";
+import testUtils from "./test-utils";
+
+function signWithJWTId(jwtid, payload, callback) {
+ const options = { algorithm: "HS256" };
+ if (jwtid !== undefined) {
+ options.jwtid = jwtid;
+ }
+ testUtils.signJWTHelper(payload, "secret", options, callback);
+}
+
+describe("jwtid", function () {
+ describe('`jwt.sign` "jwtid" option validation', function () {
+ [true, false, null, -1, 0, 1, -1.1, 1.1, -Infinity, Infinity, NaN, [], ["foo"], {}, { foo: "bar" }].forEach(
+ jwtid => {
+ it(`should error with with value ${util.inspect(jwtid)}`, function (done) {
+ signWithJWTId(jwtid, {}, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", '"jwtid" must be a string');
+ });
+ });
+ });
+ },
+ );
+
+ // undefined needs special treatment because {} is not the same as {jwtid: undefined}
+ it("should error with with value undefined", function (done) {
+ testUtils.signJWTHelper({}, "secret", { jwtid: undefined, algorithm: "HS256" }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", '"jwtid" must be a string');
+ });
+ });
+ });
+
+ it('should error when "jti" is in payload', function (done) {
+ signWithJWTId("foo", { jti: "bar" }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty(
+ "message",
+ 'Bad "options.jwtid" option. The payload already has an "jti" property.',
+ );
+ });
+ });
+ });
+
+ it("should error with a string payload", function (done) {
+ signWithJWTId("foo", "a string payload", err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", "invalid jwtid option for string payload");
+ });
+ });
+ });
+
+ it("should error with a Buffer payload", function (done) {
+ signWithJWTId("foo", new Buffer("a Buffer payload"), err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", "invalid jwtid option for object payload");
+ });
+ });
+ });
+ });
+
+ describe("when signing and verifying a token", function () {
+ it('should not verify "jti" if verify "jwtid" option not provided', function (done) {
+ signWithJWTId(undefined, { jti: "foo" }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("jti", "foo");
+ });
+ });
+ });
+ });
+
+ describe('with "jwtid" option', function () {
+ it('should verify with "jwtid" option', function (done) {
+ signWithJWTId("foo", {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { jwtid: "foo" }, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("jti", "foo");
+ });
+ });
+ });
+ });
+
+ it('should verify with "jti" in payload', function (done) {
+ signWithJWTId(undefined, { jti: "foo" }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { jetid: "foo" }, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("jti", "foo");
+ });
+ });
+ });
+ });
+
+ it('should error if "jti" does not match verify "jwtid" option', function (done) {
+ signWithJWTId(undefined, { jti: "bar" }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { jwtid: "foo" }, e2 => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(e2).toHaveProperty("message", "jwt jwtid invalid. expected: foo");
+ });
+ });
+ });
+ });
+
+ it('should error without "jti" and with verify "jwtid" option', function (done) {
+ signWithJWTId(undefined, {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { jwtid: "foo" }, e2 => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(e2).toHaveProperty("message", "jwt jwtid invalid. expected: foo");
+ });
+ });
+ });
+ });
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/claim-nbf.test.js b/test/js/third_party/jsonwebtoken/claim-nbf.test.js
new file mode 100644
index 000000000..9c2e54c5c
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/claim-nbf.test.js
@@ -0,0 +1,312 @@
+"use strict";
+
+import jwt from "jsonwebtoken";
+import { expect, describe, it, beforeEach } from "bun:test";
+import util from "util";
+import testUtils from "./test-utils";
+import jws from "jws";
+import sinon from "sinon";
+
+function signWithNotBefore(notBefore, payload, callback) {
+ const options = { algorithm: "HS256" };
+ if (notBefore !== undefined) {
+ options.notBefore = notBefore;
+ }
+ testUtils.signJWTHelper(payload, "secret", options, callback);
+}
+
+describe("not before", function () {
+ describe('`jwt.sign` "notBefore" option validation', function () {
+ [
+ true,
+ false,
+ null,
+ -1.1,
+ 1.1,
+ -Infinity,
+ Infinity,
+ NaN,
+ "",
+ " ",
+ "invalid",
+ [],
+ ["foo"],
+ {},
+ { foo: "bar" },
+ ].forEach(notBefore => {
+ it(`should error with with value ${util.inspect(notBefore)}`, function (done) {
+ signWithNotBefore(notBefore, {}, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message");
+ });
+ });
+ });
+ });
+
+ // undefined needs special treatment because {} is not the same as {notBefore: undefined}
+ it("should error with with value undefined", function (done) {
+ testUtils.signJWTHelper({}, "secret", { notBefore: undefined, algorithm: "HS256" }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty(
+ "message",
+ '"notBefore" should be a number of seconds or string representing a timespan',
+ );
+ });
+ });
+ });
+
+ it('should error when "nbf" is in payload', function (done) {
+ signWithNotBefore(100, { nbf: 100 }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty(
+ "message",
+ 'Bad "options.notBefore" option the payload already has an "nbf" property.',
+ );
+ });
+ });
+ });
+
+ it("should error with a string payload", function (done) {
+ signWithNotBefore(100, "a string payload", err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", "invalid notBefore option for string payload");
+ });
+ });
+ });
+
+ it("should error with a Buffer payload", function (done) {
+ signWithNotBefore(100, new Buffer("a Buffer payload"), err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", "invalid notBefore option for object payload");
+ });
+ });
+ });
+ });
+
+ describe('`jwt.sign` "nbf" claim validation', function () {
+ [true, false, null, undefined, "", " ", "invalid", [], ["foo"], {}, { foo: "bar" }].forEach(nbf => {
+ it(`should error with with value ${util.inspect(nbf)}`, function (done) {
+ signWithNotBefore(undefined, { nbf }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", '"nbf" should be a number of seconds');
+ });
+ });
+ });
+ });
+ });
+
+ describe('"nbf" in payload validation', function () {
+ [true, false, null, -Infinity, Infinity, NaN, "", " ", "invalid", [], ["foo"], {}, { foo: "bar" }].forEach(nbf => {
+ it(`should error with with value ${util.inspect(nbf)}`, function (done) {
+ const header = { alg: "HS256" };
+ const payload = { nbf };
+ const token = jws.sign({ header, payload, secret: "secret", encoding: "utf8" });
+ testUtils.verifyJWTHelper(token, "secret", { nbf }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", "invalid nbf value");
+ });
+ });
+ });
+ });
+ });
+
+ describe('when signing and verifying a token with "notBefore" option', function () {
+ let fakeClock;
+ beforeEach(function () {
+ fakeClock = sinon.useFakeTimers({ now: 60000 });
+ });
+
+ afterEach(function () {
+ fakeClock.uninstall();
+ });
+
+ it('should set correct "nbf" with negative number of seconds', function (done) {
+ signWithNotBefore(-10, {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("nbf", 50);
+ });
+ });
+ });
+ });
+
+ it('should set correct "nbf" with positive number of seconds', function (done) {
+ signWithNotBefore(10, {}, (e1, token) => {
+ fakeClock.tick(10000);
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("nbf", 70);
+ });
+ });
+ });
+ });
+
+ it('should set correct "nbf" with zero seconds', function (done) {
+ signWithNotBefore(0, {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("nbf", 60);
+ });
+ });
+ });
+ });
+
+ it('should set correct "nbf" with negative string timespan', function (done) {
+ signWithNotBefore("-10 s", {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("nbf", 50);
+ });
+ });
+ });
+ });
+
+ it('should set correct "nbf" with positive string timespan', function (done) {
+ signWithNotBefore("10 s", {}, (e1, token) => {
+ fakeClock.tick(10000);
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("nbf", 70);
+ });
+ });
+ });
+ });
+
+ it('should set correct "nbf" with zero string timespan', function (done) {
+ signWithNotBefore("0 s", {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("nbf", 60);
+ });
+ });
+ });
+ });
+
+ // TODO an nbf of -Infinity should fail validation
+ it('should set null "nbf" when given -Infinity', function (done) {
+ signWithNotBefore(undefined, { nbf: -Infinity }, (err, token) => {
+ const decoded = jwt.decode(token);
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("nbf", null);
+ });
+ });
+ });
+
+ // TODO an nbf of Infinity should fail validation
+ it('should set null "nbf" when given value Infinity', function (done) {
+ signWithNotBefore(undefined, { nbf: Infinity }, (err, token) => {
+ const decoded = jwt.decode(token);
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("nbf", null);
+ });
+ });
+ });
+
+ // TODO an nbf of NaN should fail validation
+ it('should set null "nbf" when given value NaN', function (done) {
+ signWithNotBefore(undefined, { nbf: NaN }, (err, token) => {
+ const decoded = jwt.decode(token);
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("nbf", null);
+ });
+ });
+ });
+
+ it('should set correct "nbf" when "iat" is passed', function (done) {
+ signWithNotBefore(-10, { iat: 40 }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("nbf", 30);
+ });
+ });
+ });
+ });
+
+ it('should verify "nbf" using "clockTimestamp"', function (done) {
+ signWithNotBefore(10, {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { clockTimestamp: 70 }, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("iat", 60);
+ expect(decoded).toHaveProperty("nbf", 70);
+ });
+ });
+ });
+ });
+
+ it('should verify "nbf" using "clockTolerance"', function (done) {
+ signWithNotBefore(5, {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { clockTolerance: 6 }, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("iat", 60);
+ expect(decoded).toHaveProperty("nbf", 65);
+ });
+ });
+ });
+ });
+
+ it('should ignore a not active token when "ignoreNotBefore" is true', function (done) {
+ signWithNotBefore("10 s", {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { ignoreNotBefore: true }, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("iat", 60);
+ expect(decoded).toHaveProperty("nbf", 70);
+ });
+ });
+ });
+ });
+
+ it('should error on verify if "nbf" is after current time', function (done) {
+ signWithNotBefore(undefined, { nbf: 61 }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, e2 => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeInstanceOf(jwt.NotBeforeError);
+ expect(e2).toHaveProperty("message", "jwt not active");
+ });
+ });
+ });
+ });
+
+ it('should error on verify if "nbf" is after current time using clockTolerance', function (done) {
+ signWithNotBefore(5, {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { clockTolerance: 4 }, e2 => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeInstanceOf(jwt.NotBeforeError);
+ expect(e2).toHaveProperty("message", "jwt not active");
+ });
+ });
+ });
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/claim-private.test.js b/test/js/third_party/jsonwebtoken/claim-private.test.js
new file mode 100644
index 000000000..51c56edb2
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/claim-private.test.js
@@ -0,0 +1,55 @@
+"use strict";
+
+import { expect, describe, it } from "bun:test";
+import util from "util";
+import testUtils from "./test-utils";
+
+function signWithPayload(payload, callback) {
+ testUtils.signJWTHelper(payload, "secret", { algorithm: "HS256" }, callback);
+}
+
+describe("with a private claim", function () {
+ [true, false, null, -1, 0, 1, -1.1, 1.1, "", "private claim", "UTF8 - José", [], ["foo"], {}, { foo: "bar" }].forEach(
+ privateClaim => {
+ it(`should sign and verify with claim of ${util.inspect(privateClaim)}`, function (done) {
+ signWithPayload({ privateClaim }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("privateClaim", privateClaim);
+ });
+ });
+ });
+ });
+ },
+ );
+
+ // these values JSON.stringify to null
+ [-Infinity, Infinity, NaN].forEach(privateClaim => {
+ it(`should sign and verify with claim of ${util.inspect(privateClaim)}`, function (done) {
+ signWithPayload({ privateClaim }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("privateClaim", null);
+ });
+ });
+ });
+ });
+ });
+
+ // private claims with value undefined are not added to the payload
+ it(`should sign and verify with claim of undefined`, function (done) {
+ signWithPayload({ privateClaim: undefined }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).not.toHaveProperty("privateClaim");
+ });
+ });
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/claim-sub.test.js b/test/js/third_party/jsonwebtoken/claim-sub.test.js
new file mode 100644
index 000000000..6846a688d
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/claim-sub.test.js
@@ -0,0 +1,133 @@
+"use strict";
+
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+import util from "util";
+import testUtils from "./test-utils";
+
+function signWithSubject(subject, payload, callback) {
+ const options = { algorithm: "HS256" };
+ if (subject !== undefined) {
+ options.subject = subject;
+ }
+ testUtils.signJWTHelper(payload, "secret", options, callback);
+}
+
+describe("subject", function () {
+ describe('`jwt.sign` "subject" option validation', function () {
+ [true, false, null, -1, 0, 1, -1.1, 1.1, -Infinity, Infinity, NaN, [], ["foo"], {}, { foo: "bar" }].forEach(
+ subject => {
+ it(`should error with with value ${util.inspect(subject)}`, function (done) {
+ signWithSubject(subject, {}, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", '"subject" must be a string');
+ });
+ });
+ });
+ },
+ );
+
+ // undefined needs special treatment because {} is not the same as {subject: undefined}
+ it("should error with with value undefined", function (done) {
+ testUtils.signJWTHelper({}, "secret", { subject: undefined, algorithm: "HS256" }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", '"subject" must be a string');
+ });
+ });
+ });
+
+ it('should error when "sub" is in payload', function (done) {
+ signWithSubject("foo", { sub: "bar" }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty(
+ "message",
+ 'Bad "options.subject" option. The payload already has an "sub" property.',
+ );
+ });
+ });
+ });
+
+ it("should error with a string payload", function (done) {
+ signWithSubject("foo", "a string payload", err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", "invalid subject option for string payload");
+ });
+ });
+ });
+
+ it("should error with a Buffer payload", function (done) {
+ signWithSubject("foo", new Buffer("a Buffer payload"), err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", "invalid subject option for object payload");
+ });
+ });
+ });
+ });
+
+ describe('when signing and verifying a token with "subject" option', function () {
+ it('should verify with a string "subject"', function (done) {
+ signWithSubject("foo", {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { subject: "foo" }, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("sub", "foo");
+ });
+ });
+ });
+ });
+
+ it('should verify with a string "sub"', function (done) {
+ signWithSubject(undefined, { sub: "foo" }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { subject: "foo" }, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("sub", "foo");
+ });
+ });
+ });
+ });
+
+ it('should not verify "sub" if verify "subject" option not provided', function (done) {
+ signWithSubject(undefined, { sub: "foo" }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", {}, (e2, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeNull();
+ expect(decoded).toHaveProperty("sub", "foo");
+ });
+ });
+ });
+ });
+
+ it('should error if "sub" does not match verify "subject" option', function (done) {
+ signWithSubject(undefined, { sub: "foo" }, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { subject: "bar" }, e2 => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(e2).toHaveProperty("message", "jwt subject invalid. expected: bar");
+ });
+ });
+ });
+ });
+
+ it('should error without "sub" and with verify "subject" option', function (done) {
+ signWithSubject(undefined, {}, (e1, token) => {
+ testUtils.verifyJWTHelper(token, "secret", { subject: "foo" }, e2 => {
+ testUtils.asyncCheck(done, () => {
+ expect(e1).toBeNull();
+ expect(e2).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(e2).toHaveProperty("message", "jwt subject invalid. expected: foo");
+ });
+ });
+ });
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/decoding.test.js b/test/js/third_party/jsonwebtoken/decoding.test.js
new file mode 100644
index 000000000..617c7f295
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/decoding.test.js
@@ -0,0 +1,9 @@
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+
+describe("decoding", function () {
+ it("should not crash when decoding a null token", function () {
+ var decoded = jwt.decode("null");
+ expect(decoded).toEqual(null);
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/dsa-private.pem b/test/js/third_party/jsonwebtoken/dsa-private.pem
new file mode 100644
index 000000000..e73003a12
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/dsa-private.pem
@@ -0,0 +1,36 @@
+-----BEGIN DSA PRIVATE KEY-----
+MIIGWAIBAAKCAgEArzbPbt//BQpsYsnoZR4R9nXgcuvcXoH8WZjRsb4ZPfVJGchG
+7CfRMlG0HR34vcUpehNj5pAavErhfNnk1CEal0TyDsOkBY/+JG239zXgRzMYjSE6
+ptX5kj5pGv0uXVoozSP/JZblI8/Spd6TZkblLNAYOl3ssfcUGN4NFDXlzmiWvP+q
+6ZUgE8tD7CSryicICKmXcVQIa6AG8ultYa6mBAaewzMbiIt2TUo9smglpEqGeHoL
+CuLb3e7zLf0AhWDZOgTTfe1KFEiK6TXMe9HWYeP3MPuyKhS20GmT/Zcu5VN4wbr0
+bP+mTWk700oLJ0OPQ6YgGkyqBmh/Bsi/TqnpJWS/mjRbJEe3E2NmNMwmP4jwJ79V
+JClp5Gg9kbM6hPkmGNnhbbFzn3kwY3pi9/AiqpGyr3GUPhXvP7fYwAu/A5ISKw8r
+87j/EJntyIzm51fcm8Q0mq1IDt4tNkIOwJEIc45h9r7ZC1VAKkzlCa7XT04GguFo
+JMaJBYESYcOAmbKRojo8P/cN4fPuemuhQFQplkFIM6FtG9cJMo2ayp6ukH9Up8tn
+8j7YgE/m9BL9SnUIbNlti9j0cNgeKVn24WC38hw9D8M0/sR5gYyclWh/OotCttoQ
+I8ySZzSvB4GARZHbexagvg1EdV93ctYyAWGLkpJYAzuiXbt7FayG7e2ifYkCIQDp
+IldsAFGVaiJRQdiKsWdReOSjzH6h8cw6Co3OCISiOQKCAgEAnSU29U65jK3W2BiA
+fKTlTBx2yDUCDFeqnla5arZ2njGsUKiP2nocArAPLQggwk9rfqufybQltM8+zjmE
+zeb4mUCVhSbTH7BvP903U0YEabZJCHLx80nTywq2RgQs0Qmn43vs2U5EidYR0xj8
+CCNAH5gdzd9/CL1RYACHAf7zj4n68ZaNkAy9Jz1JjYXjP6IAxJh1W/Y0vsdFdIJ/
+dnuxsyMCUCSwDvSNApSfATO/tw+DCVpGgKo4qE8b8lsfXKeihuMzyXuSe/D98YN2
+UFWRTQ6gFxGrntg3LOn41RXSkXxzixgl7quacIJzm8jrFkDJSx4AZ8rgt/9JbThA
+XF9PVlCVv7GL1NztUs4cDK+zsJld4O1rlI3QOz5DWq9oA+Hj1MN3L9IW3Iv2Offo
+AaubXJhuv0xPWYmtCo06mPgSwkWPjDnGCbp1vuI8zPTsfyhsahuKeW0h8JttW4GB
+6CTtC1AVWA1pJug5pBo36S5G24ihRsdG3Q5/aTlnke7t7H1Tkh2KuvV9hD5a5Xtw
+cnuiEcKjyR0FWR81RdsAKh+7QNI3Lx75c95i22Aupon5R/Qkb05VzHdd299bb78c
+x5mW8Dsg4tKLF7kpDAcWmx7JpkPHQ+5V9N766sfZ+z/PiVWfNAK8gzJRn/ceLQcK
+C6uOhcZgN0o4UYrmYEy9icxJ44wCggIBAIu+yagyVMS+C5OqOprmtteh/+MyaYI+
+Q3oPXFR8eHLJftsBWev1kRfje1fdxzzx/k4SQMRbxxbMtGV74KNwRUzEWOkoyAHP
+AAjhMio1mxknPwAxRjWDOSE0drGJPyGpI9ZfpMUtvekQO7MCGqa45vPldY10RwZC
+VN66AIpxSF0MG1OEmgD+noHMI7moclw/nw+ZUPaIFxvPstlD4EsPDkdE0I6x3k3b
+UXlWAYAJFR6fNf8+Ki3xnjLjW9da3cU/p2H7+LrFDP+kPUGJpqr4bG606GUcV3Cl
+dznoqlgaudWgcQCQx0NPzi7k5O7PXr7C3UU0cg+5+GkviIzogaioxidvvchnG+UU
+0y5nVuji6G69j5sUhlcFXte31Nte2VUb6P8umo+mbDT0UkZZZzoOsCpw+cJ8OHOV
+emFIhVphNHqQt20Tq6WVRBx+p4+YNWiThvmLtmLh0QghdnUrJZxyXx7/p8K5SE9/
++qU11t5dUvYS+53U1gJ2kgIFO4Zt6gaoOyexTt5f4Ganh9IcJ01wegl5WT58aDtf
+hmw0HnOrgbWt4lRkxOra281hL74xcgtgMZQ32PTOy8wTEVTk03mmqlIq/dV4jgBc
+Nh1FGQwGEeGlfbuNSB4nqgMN6zn1PmI7oCWLD9XLR6VZTebF7pGfpHtYczyivuxf
+e1YOro6e0mUqAiEAx4K3cPG3dxH91uU3L+sS2vzqXEVn2BmSMmkGczSOgn4=
+-----END DSA PRIVATE KEY-----
diff --git a/test/js/third_party/jsonwebtoken/dsa-public.pem b/test/js/third_party/jsonwebtoken/dsa-public.pem
new file mode 100644
index 000000000..659d96b79
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/dsa-public.pem
@@ -0,0 +1,36 @@
+-----BEGIN PUBLIC KEY-----
+MIIGSDCCBDoGByqGSM44BAEwggQtAoICAQCvNs9u3/8FCmxiyehlHhH2deBy69xe
+gfxZmNGxvhk99UkZyEbsJ9EyUbQdHfi9xSl6E2PmkBq8SuF82eTUIRqXRPIOw6QF
+j/4kbbf3NeBHMxiNITqm1fmSPmka/S5dWijNI/8lluUjz9Kl3pNmRuUs0Bg6Xeyx
+9xQY3g0UNeXOaJa8/6rplSATy0PsJKvKJwgIqZdxVAhroAby6W1hrqYEBp7DMxuI
+i3ZNSj2yaCWkSoZ4egsK4tvd7vMt/QCFYNk6BNN97UoUSIrpNcx70dZh4/cw+7Iq
+FLbQaZP9ly7lU3jBuvRs/6ZNaTvTSgsnQ49DpiAaTKoGaH8GyL9OqeklZL+aNFsk
+R7cTY2Y0zCY/iPAnv1UkKWnkaD2RszqE+SYY2eFtsXOfeTBjemL38CKqkbKvcZQ+
+Fe8/t9jAC78DkhIrDyvzuP8Qme3IjObnV9ybxDSarUgO3i02Qg7AkQhzjmH2vtkL
+VUAqTOUJrtdPTgaC4WgkxokFgRJhw4CZspGiOjw/9w3h8+56a6FAVCmWQUgzoW0b
+1wkyjZrKnq6Qf1Sny2fyPtiAT+b0Ev1KdQhs2W2L2PRw2B4pWfbhYLfyHD0PwzT+
+xHmBjJyVaH86i0K22hAjzJJnNK8HgYBFkdt7FqC+DUR1X3dy1jIBYYuSklgDO6Jd
+u3sVrIbt7aJ9iQIhAOkiV2wAUZVqIlFB2IqxZ1F45KPMfqHxzDoKjc4IhKI5AoIC
+AQCdJTb1TrmMrdbYGIB8pOVMHHbINQIMV6qeVrlqtnaeMaxQqI/aehwCsA8tCCDC
+T2t+q5/JtCW0zz7OOYTN5viZQJWFJtMfsG8/3TdTRgRptkkIcvHzSdPLCrZGBCzR
+Cafje+zZTkSJ1hHTGPwII0AfmB3N338IvVFgAIcB/vOPifrxlo2QDL0nPUmNheM/
+ogDEmHVb9jS+x0V0gn92e7GzIwJQJLAO9I0ClJ8BM7+3D4MJWkaAqjioTxvyWx9c
+p6KG4zPJe5J78P3xg3ZQVZFNDqAXEaue2Dcs6fjVFdKRfHOLGCXuq5pwgnObyOsW
+QMlLHgBnyuC3/0ltOEBcX09WUJW/sYvU3O1SzhwMr7OwmV3g7WuUjdA7PkNar2gD
+4ePUw3cv0hbci/Y59+gBq5tcmG6/TE9Zia0KjTqY+BLCRY+MOcYJunW+4jzM9Ox/
+KGxqG4p5bSHwm21bgYHoJO0LUBVYDWkm6DmkGjfpLkbbiKFGx0bdDn9pOWeR7u3s
+fVOSHYq69X2EPlrle3Bye6IRwqPJHQVZHzVF2wAqH7tA0jcvHvlz3mLbYC6miflH
+9CRvTlXMd13b31tvvxzHmZbwOyDi0osXuSkMBxabHsmmQ8dD7lX03vrqx9n7P8+J
+VZ80AryDMlGf9x4tBwoLq46FxmA3SjhRiuZgTL2JzEnjjAOCAgYAAoICAQCLvsmo
+MlTEvguTqjqa5rbXof/jMmmCPkN6D1xUfHhyyX7bAVnr9ZEX43tX3cc88f5OEkDE
+W8cWzLRle+CjcEVMxFjpKMgBzwAI4TIqNZsZJz8AMUY1gzkhNHaxiT8hqSPWX6TF
+Lb3pEDuzAhqmuObz5XWNdEcGQlTeugCKcUhdDBtThJoA/p6BzCO5qHJcP58PmVD2
+iBcbz7LZQ+BLDw5HRNCOsd5N21F5VgGACRUenzX/Piot8Z4y41vXWt3FP6dh+/i6
+xQz/pD1Biaaq+GxutOhlHFdwpXc56KpYGrnVoHEAkMdDT84u5OTuz16+wt1FNHIP
+ufhpL4iM6IGoqMYnb73IZxvlFNMuZ1bo4uhuvY+bFIZXBV7Xt9TbXtlVG+j/LpqP
+pmw09FJGWWc6DrAqcPnCfDhzlXphSIVaYTR6kLdtE6ullUQcfqePmDVok4b5i7Zi
+4dEIIXZ1KyWccl8e/6fCuUhPf/qlNdbeXVL2Evud1NYCdpICBTuGbeoGqDsnsU7e
+X+Bmp4fSHCdNcHoJeVk+fGg7X4ZsNB5zq4G1reJUZMTq2tvNYS++MXILYDGUN9j0
+zsvMExFU5NN5pqpSKv3VeI4AXDYdRRkMBhHhpX27jUgeJ6oDDes59T5iO6Aliw/V
+y0elWU3mxe6Rn6R7WHM8or7sX3tWDq6OntJlKg==
+-----END PUBLIC KEY-----
diff --git a/test/js/third_party/jsonwebtoken/ecdsa-private.pem b/test/js/third_party/jsonwebtoken/ecdsa-private.pem
new file mode 100644
index 000000000..aad4c4d93
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/ecdsa-private.pem
@@ -0,0 +1,18 @@
+-----BEGIN EC PARAMETERS-----
+MIH3AgEBMCwGByqGSM49AQECIQD/////AAAAAQAAAAAAAAAAAAAAAP//////////
+/////zBbBCD/////AAAAAQAAAAAAAAAAAAAAAP///////////////AQgWsY12Ko6
+k+ez671VdpiGvGUdBrDMU7D2O848PifSYEsDFQDEnTYIhucEk2pmeOETnSa3gZ9+
+kARBBGsX0fLhLEJH+Lzm5WOkQPJ3A32BLeszoPShOUXYmMKWT+NC4v4af5uO5+tK
+fA+eFivOM1drMV7Oy7ZAaDe/UfUCIQD/////AAAAAP//////////vOb6racXnoTz
+ucrC/GMlUQIBAQ==
+-----END EC PARAMETERS-----
+-----BEGIN EC PRIVATE KEY-----
+MIIBaAIBAQQgeg2m9tJJsnURyjTUihohiJahj9ETy3csUIt4EYrV+J2ggfowgfcC
+AQEwLAYHKoZIzj0BAQIhAP////8AAAABAAAAAAAAAAAAAAAA////////////////
+MFsEIP////8AAAABAAAAAAAAAAAAAAAA///////////////8BCBaxjXYqjqT57Pr
+vVV2mIa8ZR0GsMxTsPY7zjw+J9JgSwMVAMSdNgiG5wSTamZ44ROdJreBn36QBEEE
+axfR8uEsQkf4vOblY6RA8ncDfYEt6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54W
+K84zV2sxXs7LtkBoN79R9QIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8
+YyVRAgEBoUQDQgAEEWluurrkZECnq27UpNauq16f9+5DDMFJZ3HV43Ujc3tcXQ++
+N1T/0CAA8ve286f32s7rkqX/pPokI/HBpP5p3g==
+-----END EC PRIVATE KEY-----
diff --git a/test/js/third_party/jsonwebtoken/ecdsa-public-invalid.pem b/test/js/third_party/jsonwebtoken/ecdsa-public-invalid.pem
new file mode 100644
index 000000000..016d86d5f
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/ecdsa-public-invalid.pem
@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBSzCCAQMGByqGSM49AgEwgfcCAQEwLAYHKoZIzj0BAQIhAP////8AAAABAAAA
+AAAAAAAAAAAA////////////////MFsEIP////8AAAABAAAAAAAAAAAAAAAA////
+///////////8BCBaxjXYqjqT57PrvVV2mIa8ZR0GsMxTsPY7zjw+J9JgSwMVAMSd
+NgiG5wSTamZ44ROdJreBn36QBEEEaxfR8uEsQkf4vOblY6RA8ncDfYEt6zOg9KE5
+RdiYwpZP40Li/hp/m47n60p8D54WK84zV2sxXs7LtkBoN79R9QIhAP////8AAAAA
+//////////+85vqtpxeehPO5ysL8YyVRAgEBA0IABEfZiYJDbghTGQ+KGnHGSl6K
+yUqK/BL2uJIg7Z0bx48v6+L7Ve8MCS17eptkMT2e4l5B/ZGDVUHb6uZ5xFROLBw=
+-----END PUBLIC KEY-----
diff --git a/test/js/third_party/jsonwebtoken/ecdsa-public-x509.pem b/test/js/third_party/jsonwebtoken/ecdsa-public-x509.pem
new file mode 100644
index 000000000..ef9fe22c3
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/ecdsa-public-x509.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDGjCCAsKgAwIBAgIJANuPNBWwp6wzMAkGByqGSM49BAEwRTELMAkGA1UEBhMC
+QVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGEludGVybmV0IFdpZGdp
+dHMgUHR5IEx0ZDAeFw0xNzA2MTAxMTAzMjJaFw0yNzA2MDgxMTAzMjJaMEUxCzAJ
+BgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5l
+dCBXaWRnaXRzIFB0eSBMdGQwggFLMIIBAwYHKoZIzj0CATCB9wIBATAsBgcqhkjO
+PQEBAiEA/////wAAAAEAAAAAAAAAAAAAAAD///////////////8wWwQg/////wAA
+AAEAAAAAAAAAAAAAAAD///////////////wEIFrGNdiqOpPns+u9VXaYhrxlHQaw
+zFOw9jvOPD4n0mBLAxUAxJ02CIbnBJNqZnjhE50mt4GffpAEQQRrF9Hy4SxCR/i8
+5uVjpEDydwN9gS3rM6D0oTlF2JjClk/jQuL+Gn+bjufrSnwPnhYrzjNXazFezsu2
+QGg3v1H1AiEA/////wAAAAD//////////7zm+q2nF56E87nKwvxjJVECAQEDQgAE
+EWluurrkZECnq27UpNauq16f9+5DDMFJZ3HV43Ujc3tcXQ++N1T/0CAA8ve286f3
+2s7rkqX/pPokI/HBpP5p3qOBpzCBpDAdBgNVHQ4EFgQUAF43lnAvCztZZGaGMoxs
+cp6tpz8wdQYDVR0jBG4wbIAUAF43lnAvCztZZGaGMoxscp6tpz+hSaRHMEUxCzAJ
+BgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5l
+dCBXaWRnaXRzIFB0eSBMdGSCCQDbjzQVsKesMzAMBgNVHRMEBTADAQH/MAkGByqG
+SM49BAEDRwAwRAIgV039oh2RtcSwywQ/0dWAwc20NHxrgmKoQ5A3AS5A9d0CIBCV
+2AlKDFjmDC7zjldNhWbMcIlSSj71ghhhxeS0F8v1
+-----END CERTIFICATE-----
diff --git a/test/js/third_party/jsonwebtoken/ecdsa-public.pem b/test/js/third_party/jsonwebtoken/ecdsa-public.pem
new file mode 100644
index 000000000..6cfee2f8f
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/ecdsa-public.pem
@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBSzCCAQMGByqGSM49AgEwgfcCAQEwLAYHKoZIzj0BAQIhAP////8AAAABAAAA
+AAAAAAAAAAAA////////////////MFsEIP////8AAAABAAAAAAAAAAAAAAAA////
+///////////8BCBaxjXYqjqT57PrvVV2mIa8ZR0GsMxTsPY7zjw+J9JgSwMVAMSd
+NgiG5wSTamZ44ROdJreBn36QBEEEaxfR8uEsQkf4vOblY6RA8ncDfYEt6zOg9KE5
+RdiYwpZP40Li/hp/m47n60p8D54WK84zV2sxXs7LtkBoN79R9QIhAP////8AAAAA
+//////////+85vqtpxeehPO5ysL8YyVRAgEBA0IABBFpbrq65GRAp6tu1KTWrqte
+n/fuQwzBSWdx1eN1I3N7XF0PvjdU/9AgAPL3tvOn99rO65Kl/6T6JCPxwaT+ad4=
+-----END PUBLIC KEY-----
diff --git a/test/js/third_party/jsonwebtoken/encoding.test.js b/test/js/third_party/jsonwebtoken/encoding.test.js
new file mode 100644
index 000000000..c8ad38dc0
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/encoding.test.js
@@ -0,0 +1,37 @@
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+
+describe("encoding", function () {
+ function b64_to_utf8(str) {
+ return decodeURIComponent(escape(atob(str)));
+ }
+
+ it("should properly encode the token (utf8)", function () {
+ var expected = "José";
+ var token = jwt.sign({ name: expected }, "shhhhh");
+ var decoded_name = JSON.parse(b64_to_utf8(token.split(".")[1])).name;
+ expect(decoded_name).toEqual(expected);
+ });
+
+ it("should properly encode the token (binary)", function () {
+ var expected = "José";
+ var token = jwt.sign({ name: expected }, "shhhhh", { encoding: "binary" });
+ var decoded_name = JSON.parse(atob(token.split(".")[1])).name;
+ expect(decoded_name).toEqual(expected);
+ });
+
+ it("should return the same result when decoding", function () {
+ var username = "測試";
+
+ var token = jwt.sign(
+ {
+ username: username,
+ },
+ "test",
+ );
+
+ var payload = jwt.verify(token, "test");
+
+ expect(payload.username).toEqual(username);
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/expires_format.test.js b/test/js/third_party/jsonwebtoken/expires_format.test.js
new file mode 100644
index 000000000..4d44243ab
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/expires_format.test.js
@@ -0,0 +1,10 @@
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+
+describe("expires option", function () {
+ it("should throw on deprecated expiresInSeconds option", function () {
+ expect(function () {
+ jwt.sign({ foo: 123 }, "123", { expiresInSeconds: 5 });
+ }).toThrow('"expiresInSeconds" is not allowed');
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/header-kid.test.js b/test/js/third_party/jsonwebtoken/header-kid.test.js
new file mode 100644
index 000000000..0eeea3b08
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/header-kid.test.js
@@ -0,0 +1,83 @@
+"use strict";
+
+import jwt from "jsonwebtoken";
+import { expect, describe, it, beforeEach } from "bun:test";
+import util from "util";
+import testUtils from "./test-utils";
+
+function signWithKeyId(keyid, payload, callback) {
+ const options = { algorithm: "HS256" };
+ if (keyid !== undefined) {
+ options.keyid = keyid;
+ }
+ testUtils.signJWTHelper(payload, "secret", options, callback);
+}
+
+describe("keyid", function () {
+ describe('`jwt.sign` "keyid" option validation', function () {
+ [true, false, null, -1, 0, 1, -1.1, 1.1, -Infinity, Infinity, NaN, [], ["foo"], {}, { foo: "bar" }].forEach(
+ keyid => {
+ it(`should error with with value ${util.inspect(keyid)}`, function (done) {
+ signWithKeyId(keyid, {}, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", '"keyid" must be a string');
+ });
+ });
+ });
+ },
+ );
+
+ // undefined needs special treatment because {} is not the same as {keyid: undefined}
+ it("should error with with value undefined", function (done) {
+ testUtils.signJWTHelper({}, "secret", { keyid: undefined, algorithm: "HS256" }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(Error);
+ expect(err).toHaveProperty("message", '"keyid" must be a string');
+ });
+ });
+ });
+ });
+
+ describe("when signing a token", function () {
+ it('should not add "kid" header when "keyid" option not provided', function (done) {
+ signWithKeyId(undefined, {}, (err, token) => {
+ testUtils.asyncCheck(done, () => {
+ const decoded = jwt.decode(token, { complete: true });
+ expect(err).toBeNull();
+ expect(decoded.header).not.toHaveProperty("kid");
+ });
+ });
+ });
+
+ it('should add "kid" header when "keyid" option is provided and an object payload', function (done) {
+ signWithKeyId("foo", {}, (err, token) => {
+ testUtils.asyncCheck(done, () => {
+ const decoded = jwt.decode(token, { complete: true });
+ expect(err).toBeNull();
+ expect(decoded.header).toHaveProperty("kid", "foo");
+ });
+ });
+ });
+
+ it('should add "kid" header when "keyid" option is provided and a Buffer payload', function (done) {
+ signWithKeyId("foo", new Buffer("a Buffer payload"), (err, token) => {
+ testUtils.asyncCheck(done, () => {
+ const decoded = jwt.decode(token, { complete: true });
+ expect(err).toBeNull();
+ expect(decoded.header).toHaveProperty("kid", "foo");
+ });
+ });
+ });
+
+ it('should add "kid" header when "keyid" option is provided and a string payload', function (done) {
+ signWithKeyId("foo", "a string payload", (err, token) => {
+ testUtils.asyncCheck(done, () => {
+ const decoded = jwt.decode(token, { complete: true });
+ expect(err).toBeNull();
+ expect(decoded.header).toHaveProperty("kid", "foo");
+ });
+ });
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/invalid_exp.test.js b/test/js/third_party/jsonwebtoken/invalid_exp.test.js
new file mode 100644
index 000000000..b5310c3bc
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/invalid_exp.test.js
@@ -0,0 +1,54 @@
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+
+describe("invalid expiration", function () {
+ it("should fail with string", function (done) {
+ var broken_token =
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOiIxMjMiLCJmb28iOiJhZGFzIn0.cDa81le-pnwJMcJi3o3PBwB7cTJMiXCkizIhxbXAKRg";
+
+ jwt.verify(broken_token, "123", function (err) {
+ expect(err.name).toEqual("JsonWebTokenError");
+ done();
+ });
+ });
+
+ it("should fail with 0", function (done) {
+ var broken_token =
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjAsImZvbyI6ImFkYXMifQ.UKxix5T79WwfqAA0fLZr6UrhU-jMES2unwCOFa4grEA";
+
+ jwt.verify(broken_token, "123", function (err) {
+ expect(err.name).toEqual("TokenExpiredError");
+ done();
+ });
+ });
+
+ it("should fail with false", function (done) {
+ var broken_token =
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOmZhbHNlLCJmb28iOiJhZGFzIn0.iBn33Plwhp-ZFXqppCd8YtED77dwWU0h68QS_nEQL8I";
+
+ jwt.verify(broken_token, "123", function (err) {
+ expect(err.name).toEqual("JsonWebTokenError");
+ done();
+ });
+ });
+
+ it("should fail with true", function (done) {
+ var broken_token =
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOnRydWUsImZvbyI6ImFkYXMifQ.eOWfZCTM5CNYHAKSdFzzk2tDkPQmRT17yqllO-ItIMM";
+
+ jwt.verify(broken_token, "123", function (err) {
+ expect(err.name).toEqual("JsonWebTokenError");
+ done();
+ });
+ });
+
+ it("should fail with object", function (done) {
+ var broken_token =
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOnt9LCJmb28iOiJhZGFzIn0.1JjCTsWLJ2DF-CfESjLdLfKutUt3Ji9cC7ESlcoBHSY";
+
+ jwt.verify(broken_token, "123", function (err) {
+ expect(err.name).toEqual("JsonWebTokenError");
+ done();
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/invalid_pub.pem b/test/js/third_party/jsonwebtoken/invalid_pub.pem
new file mode 100644
index 000000000..2482abbde
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/invalid_pub.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDJjCCAg6gAwIBAgIJAMyz3mSPlaW4MA0GCSqGSIb3DQEBBQUAMBYxFDASBgNV
+BAMUCyouYXV0aDAuY29tMB4XDTEzMDQxODE3MDE1MFoXDTI2MTIyNjE3MDE1MFow
+FjEUMBIGA1UEAxQLKi5hdXRoMC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQDZq1Ua0/BGm+TaBFoftKWeYMWrQG9Fx3g7ikErxljmyOvlwqkiat3q
+ixX+Dxw9TFb5gbBjNJ+L3nt4YefJgLsYvsHqkOUxWsB+HM/ulJRVnVrZm1tI3Nbg
+xO1BQ7DrGfBpq2KCxtQCaQFRlQJw1+qS5LwrdIvihB7Kc142VElCFFHJ6+09eMUy
+jy00Z5pfQr4Am6W6eEOS9ObDbNs4XgKOcWe5khWXj3UStou+VgbAg40XcYht2IbY
+gMfKF+VUZOy3+e+aRTqPOBU3MAeb0tvCCPUQJbNAUHgSKVhAvNf8mRwttVsOLT70
+anjjeCOd7RKS8fVKBwc2KtgNkghYdPY9AgMBAAGjdzB1MB0GA1UdDgQWBBSi4+X0
++MvCKDdd375mDhx/ZBbJ4DBGBgNVHSMEPzA9gBSi4+X0+MvCKDdd375mDhx/ZBbJ
+4KEapBgwFjEUMBIGA1UEAxQLKi5hdXRoMC5jb22CCQDMs95kj5WluDAMBgNVHRME
+BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQBi0qPe0DzlPSufq+Gdk2Fwf1pGEtjA
+D34IxxJ9SX6r1DS/NIP7IOLUnNU8cP8BQWl7i413v29jJsNV457pjdmqf8J7OE9O
+eF5Yz1x91gY/27561Iga/TQeIVOlFQAgx66eLfUFFoAig3hz2srZo5TzYBixMJsS
+fYMXHPiU7KoLUqYXvpSXIllstQCu51KCC6t9H7wZ92lTES1v76hFY4edQ30sftPo
+kjAYWGEhMjPo/r4THcdSMqKXoRtCGEun4pTXid7MJcTgdGDrAJddLWi6SxKecEVB
+MhMu4XfUCdxCwqQPjHeJ+zE49A1CUdBB2FN3BNLbmTTwEBgmuwyGRzhj
+-----END CERTIFICATE-----
diff --git a/test/js/third_party/jsonwebtoken/issue_147.test.js b/test/js/third_party/jsonwebtoken/issue_147.test.js
new file mode 100644
index 000000000..294e8528a
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/issue_147.test.js
@@ -0,0 +1,10 @@
+import jwt from "jsonwebtoken";
+import { describe, it, expect } from "bun:test";
+
+describe("issue 147 - signing with a sealed payload", function () {
+ it("should put the expiration claim", function () {
+ var token = jwt.sign(Object.seal({ foo: 123 }), "123", { expiresIn: 10 });
+ var result = jwt.verify(token, "123");
+ expect(result.exp).toBeCloseTo(Math.floor(Date.now() / 1000) + 10, 0.2);
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/issue_304.test.js b/test/js/third_party/jsonwebtoken/issue_304.test.js
new file mode 100644
index 000000000..257bcc09d
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/issue_304.test.js
@@ -0,0 +1,43 @@
+import jwt from "jsonwebtoken";
+import { describe, it, expect } from "bun:test";
+
+describe("issue 304 - verifying values other than strings", function () {
+ it("should fail with numbers", function (done) {
+ jwt.verify(123, "foo", function (err) {
+ expect(err.name).toEqual("JsonWebTokenError");
+ done();
+ });
+ });
+
+ it("should fail with objects", function (done) {
+ jwt.verify({ foo: "bar" }, "biz", function (err) {
+ expect(err.name).toEqual("JsonWebTokenError");
+ done();
+ });
+ });
+
+ it("should fail with arrays", function (done) {
+ jwt.verify(["foo"], "bar", function (err) {
+ expect(err.name).toEqual("JsonWebTokenError");
+ done();
+ });
+ });
+
+ it("should fail with functions", function (done) {
+ jwt.verify(
+ function () {},
+ "foo",
+ function (err) {
+ expect(err.name).toEqual("JsonWebTokenError");
+ done();
+ },
+ );
+ });
+
+ it("should fail with booleans", function (done) {
+ jwt.verify(true, "foo", function (err) {
+ expect(err.name).toEqual("JsonWebTokenError");
+ done();
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/issue_70.test.js b/test/js/third_party/jsonwebtoken/issue_70.test.js
new file mode 100644
index 000000000..2dfeabe54
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/issue_70.test.js
@@ -0,0 +1,14 @@
+import jwt from "jsonwebtoken";
+import { describe, it } from "bun:test";
+
+describe("issue 70 - public key start with BEING PUBLIC KEY", function () {
+ it("should work", function (done) {
+ var fs = require("fs");
+ var cert_pub = fs.readFileSync(__dirname + "/rsa-public.pem");
+ var cert_priv = fs.readFileSync(__dirname + "/rsa-private.pem");
+
+ var token = jwt.sign({ foo: "bar" }, cert_priv, { algorithm: "RS256" });
+
+ jwt.verify(token, cert_pub, done);
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/jwt.asymmetric_signing.test.js b/test/js/third_party/jsonwebtoken/jwt.asymmetric_signing.test.js
new file mode 100644
index 000000000..848dadb1a
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/jwt.asymmetric_signing.test.js
@@ -0,0 +1,208 @@
+const PS_SUPPORTED = true;
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+import fs from "fs";
+import path from "path";
+
+function loadKey(filename) {
+ return fs.readFileSync(path.join(__dirname, filename));
+}
+
+const algorithms = {
+ RS256: {
+ pub_key: loadKey("pub.pem"),
+ priv_key: loadKey("priv.pem"),
+ invalid_pub_key: loadKey("invalid_pub.pem"),
+ },
+ ES256: {
+ // openssl ecparam -name secp256r1 -genkey -param_enc explicit -out ecdsa-private.pem
+ priv_key: loadKey("ecdsa-private.pem"),
+ // openssl ec -in ecdsa-private.pem -pubout -out ecdsa-public.pem
+ pub_key: loadKey("ecdsa-public.pem"),
+ invalid_pub_key: loadKey("ecdsa-public-invalid.pem"),
+ },
+};
+
+if (PS_SUPPORTED) {
+ algorithms.PS256 = {
+ pub_key: loadKey("pub.pem"),
+ priv_key: loadKey("priv.pem"),
+ invalid_pub_key: loadKey("invalid_pub.pem"),
+ };
+}
+
+describe("Asymmetric Algorithms", function () {
+ Object.keys(algorithms).forEach(function (algorithm) {
+ describe(algorithm, function () {
+ const pub = algorithms[algorithm].pub_key;
+ const priv = algorithms[algorithm].priv_key;
+
+ // "invalid" means it is not the public key for the loaded "priv" key
+ const invalid_pub = algorithms[algorithm].invalid_pub_key;
+
+ describe("when signing a token", function () {
+ const token = jwt.sign({ foo: "bar" }, priv, { algorithm: algorithm });
+
+ it("should be syntactically valid", function () {
+ expect(typeof token).toBe("string");
+ expect(token.split(".")).toHaveLength(3);
+ });
+
+ describe("asynchronous", function () {
+ (algorithm === "ES256" ? it.todo : it)("should validate with public key", function (done) {
+ jwt.verify(token, pub, function (err, decoded) {
+ if (err) return done(err);
+ expect(decoded).toBeDefined();
+ expect(decoded.foo).toBeTruthy();
+ expect("bar").toBe(decoded.foo);
+ done();
+ });
+ });
+
+ it("should throw with invalid public key", function (done) {
+ jwt.verify(token, invalid_pub, function (err, decoded) {
+ expect(decoded).toBeUndefined();
+ expect(err).toBeTruthy();
+ done();
+ });
+ });
+ });
+
+ describe("synchronous", function () {
+ (algorithm === "ES256" ? it.todo : it)("should validate with public key", function () {
+ const decoded = jwt.verify(token, pub);
+ expect(decoded).toBeDefined();
+ expect(decoded.foo).toBeTruthy();
+ expect("bar").toBe(decoded.foo);
+ });
+
+ it("should throw with invalid public key", function () {
+ const jwtVerify = jwt.verify.bind(null, token, invalid_pub);
+ expect(jwtVerify).toThrow();
+ });
+ });
+ });
+
+ describe("when signing a token with expiration", function () {
+ (algorithm === "ES256" ? it.todo : it)("should be valid expiration", function (done) {
+ const token = jwt.sign({ foo: "bar" }, priv, { algorithm: algorithm, expiresIn: "10m" });
+ jwt.verify(token, pub, function (err, decoded) {
+ if (err) return done(err);
+ expect(decoded).toBeTruthy();
+ expect(err).toBeNull();
+ done();
+ });
+ });
+
+ (algorithm === "ES256" ? it.todo : it)("should be invalid", function (done) {
+ // expired token
+ const token = jwt.sign({ foo: "bar" }, priv, { algorithm: algorithm, expiresIn: -1 * (10 * 60 * 1000) });
+ jwt.verify(token, pub, function (err, decoded) {
+ expect(decoded).toBeUndefined();
+ expect(err).toBeDefined();
+ expect(err.name).toBe("TokenExpiredError");
+ expect(err.expiredAt).toBeInstanceOf(Date);
+ expect(err).toBeInstanceOf(jwt.TokenExpiredError);
+ done();
+ });
+ });
+
+ (algorithm === "ES256" ? it.todo : it)("should NOT be invalid", function (done) {
+ // expired token
+ const token = jwt.sign({ foo: "bar" }, priv, { algorithm: algorithm, expiresIn: -1 * (10 * 60 * 1000) });
+
+ jwt.verify(token, pub, { ignoreExpiration: true }, function (err, decoded) {
+ expect(decoded).toBeDefined();
+ expect(decoded.foo).toBeDefined();
+ expect("bar").toBe(decoded.foo);
+ done();
+ });
+ });
+ });
+
+ describe("when verifying a malformed token", function () {
+ it("should throw", function (done) {
+ jwt.verify("fruit.fruit.fruit", pub, function (err, decoded) {
+ expect(decoded).toBeUndefined();
+ expect(err).toBeDefined();
+ expect(err.name).toBe("JsonWebTokenError");
+ done();
+ });
+ });
+ });
+
+ describe("when decoding a jwt token with additional parts", function () {
+ const token = jwt.sign({ foo: "bar" }, priv, { algorithm: algorithm });
+
+ it("should throw", function (done) {
+ jwt.verify(token + ".foo", pub, function (err, decoded) {
+ expect(decoded).toBeUndefined();
+ expect(err).toBeDefined();
+ done();
+ });
+ });
+ });
+
+ describe("when decoding a invalid jwt token", function () {
+ it("should return null", function (done) {
+ const payload = jwt.decode("whatever.token");
+ expect(payload).toBeNull();
+ done();
+ });
+ });
+
+ describe("when decoding a valid jwt token", function () {
+ it("should return the payload", function (done) {
+ const obj = { foo: "bar" };
+ const token = jwt.sign(obj, priv, { algorithm: algorithm });
+ const payload = jwt.decode(token);
+ expect(payload.foo).toEqual(obj.foo);
+ done();
+ });
+ it("should return the header and payload and signature if complete option is set", function (done) {
+ const obj = { foo: "bar" };
+ const token = jwt.sign(obj, priv, { algorithm: algorithm });
+ const decoded = jwt.decode(token, { complete: true });
+ expect(decoded.payload.foo).toEqual(obj.foo);
+ expect(decoded.header).toStrictEqual({ typ: "JWT", alg: algorithm });
+ expect(typeof decoded.signature).toBe("string");
+ done();
+ });
+ });
+ });
+ });
+
+ describe("when signing a token with an unsupported private key type", function () {
+ it.todo("should throw an error", function () {
+ const obj = { foo: "bar" };
+ const key = loadKey("dsa-private.pem");
+ const algorithm = "RS256";
+
+ expect(function () {
+ jwt.sign(obj, key, { algorithm });
+ }).toThrow('Unknown key type "dsa".');
+ });
+ });
+
+ describe("when signing a token with an incorrect private key type", function () {
+ it("should throw a validation error if key validation is enabled", function () {
+ const obj = { foo: "bar" };
+ const key = loadKey("rsa-private.pem");
+ const algorithm = "ES256";
+
+ expect(function () {
+ jwt.sign(obj, key, { algorithm });
+ }).toThrow(/"alg" parameter for "rsa" key type must be one of:/);
+ });
+
+ it("should throw an unknown error if key validation is disabled", function () {
+ const obj = { foo: "bar" };
+ const key = loadKey("rsa-private.pem");
+ const algorithm = "ES256";
+
+ expect(function () {
+ jwt.sign(obj, key, { algorithm, allowInvalidAsymmetricKeyTypes: true });
+ }).not.toThrow(/"alg" parameter for "rsa" key type must be one of:/);
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/jwt.hs.test.js b/test/js/third_party/jsonwebtoken/jwt.hs.test.js
new file mode 100644
index 000000000..65424f66a
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/jwt.hs.test.js
@@ -0,0 +1,140 @@
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+import jws from "jws";
+import { generateKeyPairSync } from "crypto";
+
+describe("HS256", function () {
+ describe("when signing using HS256", function () {
+ it("should throw if the secret is an asymmetric key", function () {
+ const { privateKey } = generateKeyPairSync("rsa", { modulusLength: 2048 });
+
+ expect(function () {
+ jwt.sign({ foo: "bar" }, privateKey, { algorithm: "HS256" });
+ }).toThrow("must be a symmetric key");
+ });
+
+ it("should throw if the payload is undefined", function () {
+ expect(function () {
+ jwt.sign(undefined, "secret", { algorithm: "HS256" });
+ }).toThrow("payload is required");
+ });
+
+ it("should throw if options is not a plain object", function () {
+ expect(function () {
+ jwt.sign({ foo: "bar" }, "secret", ["HS256"]);
+ }).toThrow('Expected "options" to be a plain object');
+ });
+ });
+
+ describe("with a token signed using HS256", function () {
+ var secret = "shhhhhh";
+
+ var token = jwt.sign({ foo: "bar" }, secret, { algorithm: "HS256" });
+
+ it("should be syntactically valid", function () {
+ expect(typeof token).toBe("string");
+ expect(token.split(".")).toHaveLength(3);
+ });
+
+ it("should be able to validate without options", function (done) {
+ var callback = function (err, decoded) {
+ if (err) return done(err);
+ expect(decoded).toBeDefined();
+ expect(decoded.foo).toBeDefined();
+ expect("bar").toBe(decoded.foo);
+ done();
+ };
+ callback.issuer = "shouldn't affect";
+ jwt.verify(token, secret, callback);
+ });
+
+ it("should validate with secret", function (done) {
+ jwt.verify(token, secret, function (err, decoded) {
+ if (err) return done(err);
+ expect(decoded).toBeDefined();
+ expect(decoded.foo).toBeDefined();
+ done();
+ });
+ });
+
+ it("should throw with invalid secret", function (done) {
+ jwt.verify(token, "invalid secret", function (err, decoded) {
+ expect(decoded).toBeUndefined();
+ expect(err).toBeTruthy();
+ done();
+ });
+ });
+
+ it("should throw with secret and token not signed", function (done) {
+ const header = { alg: "none" };
+ const payload = { foo: "bar" };
+ const token = jws.sign({ header, payload, secret: "secret", encoding: "utf8" });
+ jwt.verify(token, "secret", function (err, decoded) {
+ expect(decoded).toBeUndefined();
+ expect(err).toBeTruthy();
+ done();
+ });
+ });
+
+ it("should throw with falsy secret and token not signed", function (done) {
+ const header = { alg: "none" };
+ const payload = { foo: "bar" };
+ const token = jws.sign({ header, payload, secret: null, encoding: "utf8" });
+ jwt.verify(token, "secret", function (err, decoded) {
+ expect(decoded).toBeUndefined();
+ expect(err).toBeTruthy();
+ done();
+ });
+ });
+
+ it("should throw when verifying null", function (done) {
+ jwt.verify(null, "secret", function (err, decoded) {
+ expect(decoded).toBeUndefined();
+ expect(err).toBeTruthy();
+ done();
+ });
+ });
+
+ it("should return an error when the token is expired", function (done) {
+ var token = jwt.sign({ exp: 1 }, secret, { algorithm: "HS256" });
+ jwt.verify(token, secret, { algorithm: "HS256" }, function (err, decoded) {
+ expect(decoded).toBeUndefined();
+ expect(err).toBeTruthy();
+ done();
+ });
+ });
+
+ it('should NOT return an error when the token is expired with "ignoreExpiration"', function (done) {
+ var token = jwt.sign({ exp: 1, foo: "bar" }, secret, { algorithm: "HS256" });
+ jwt.verify(token, secret, { algorithm: "HS256", ignoreExpiration: true }, function (err, decoded) {
+ if (err) return done(err);
+ expect(decoded).toBeDefined();
+ expect("bar").toBe(decoded.foo);
+ expect(decoded.foo).toBeDefined();
+ done();
+ });
+ });
+
+ it("should default to HS256 algorithm when no options are passed", function () {
+ var token = jwt.sign({ foo: "bar" }, secret);
+ var verifiedToken = jwt.verify(token, secret);
+ expect(verifiedToken).toBeDefined();
+ expect("bar").toBe(verifiedToken.foo);
+ });
+ });
+
+ describe("should fail verification gracefully with trailing space in the jwt", function () {
+ var secret = "shhhhhh";
+ var token = jwt.sign({ foo: "bar" }, secret, { algorithm: "HS256" });
+
+ it('should return the "invalid token" error', function (done) {
+ var malformedToken = token + " "; // corrupt the token by adding a space
+ jwt.verify(malformedToken, secret, { algorithm: "HS256", ignoreExpiration: true }, function (err) {
+ expect(err).not.toBeNull();
+ expect("JsonWebTokenError").toBe(err.name);
+ expect("invalid token").toBe(err.message);
+ done();
+ });
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/jwt.malicious.test.js b/test/js/third_party/jsonwebtoken/jwt.malicious.test.js
new file mode 100644
index 000000000..8e31859cb
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/jwt.malicious.test.js
@@ -0,0 +1,44 @@
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+import crypto from "crypto";
+
+describe("when verifying a malicious token", function () {
+ // attacker has access to the public rsa key, but crafts the token as HS256
+ // with kid set to the id of the rsa key, instead of the id of the hmac secret.
+ // const maliciousToken = jwt.sign(
+ // {foo: 'bar'},
+ // pubRsaKey,
+ // {algorithm: 'HS256', keyid: 'rsaKeyId'}
+ // );
+ // consumer accepts self signed tokens (HS256) and third party tokens (RS256)
+ const options = { algorithms: ["RS256", "HS256"] };
+
+ const { publicKey: pubRsaKey } = crypto.generateKeyPairSync("rsa", { modulusLength: 2048 });
+
+ it("should not allow HMAC verification with an RSA key in KeyObject format", function () {
+ const maliciousToken =
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InJzYUtleUlkIn0.eyJmb28iOiJiYXIiLCJpYXQiOjE2NTk1MTA2MDh9.cOcHI1TXPbxTMlyVTfjArSWskrmezbrG8iR7uJHwtrQ";
+
+ expect(() => jwt.verify(maliciousToken, pubRsaKey, options)).toThrow("must be a symmetric key");
+ });
+
+ it("should not allow HMAC verification with an RSA key in PEM format", function () {
+ const maliciousToken =
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InJzYUtleUlkIn0.eyJmb28iOiJiYXIiLCJpYXQiOjE2NTk1MTA2MDh9.cOcHI1TXPbxTMlyVTfjArSWskrmezbrG8iR7uJHwtrQ";
+
+ expect(() => jwt.verify(maliciousToken, pubRsaKey.export({ type: "spki", format: "pem" }), options)).toThrow(
+ "must be a symmetric key",
+ );
+ });
+
+ it("should not allow arbitrary execution from malicious Buffers containing objects with overridden toString functions", function () {
+ const token = jwt.sign({ "foo": "bar" }, "secret");
+ const maliciousBuffer = {
+ toString: () => {
+ throw new Error("Arbitrary Code Execution");
+ },
+ };
+
+ expect(() => jwt.verify(token, maliciousBuffer)).toThrow("not valid key material");
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/noTimestamp.test.js b/test/js/third_party/jsonwebtoken/noTimestamp.test.js
new file mode 100644
index 000000000..22a61b3eb
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/noTimestamp.test.js
@@ -0,0 +1,10 @@
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+
+describe("noTimestamp", function () {
+ it("should work with string", function () {
+ var token = jwt.sign({ foo: 123 }, "123", { expiresIn: "5m", noTimestamp: true });
+ var result = jwt.verify(token, "123");
+ expect(result.exp).toBeCloseTo(Math.floor(Date.now() / 1000) + 5 * 60, 0.5);
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/non_object_values.test.js b/test/js/third_party/jsonwebtoken/non_object_values.test.js
new file mode 100644
index 000000000..55b5d59ae
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/non_object_values.test.js
@@ -0,0 +1,16 @@
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+
+describe("non_object_values values", function () {
+ it("should work with string", function () {
+ var token = jwt.sign("hello", "123");
+ var result = jwt.verify(token, "123");
+ expect(result).toEqual("hello");
+ });
+
+ it("should work with number", function () {
+ var token = jwt.sign(123, "123");
+ var result = jwt.verify(token, "123");
+ expect(result).toEqual("123");
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/option-complete.test.js b/test/js/third_party/jsonwebtoken/option-complete.test.js
new file mode 100644
index 000000000..2b446e4e2
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/option-complete.test.js
@@ -0,0 +1,53 @@
+"use strict";
+
+import { expect, describe, it } from "bun:test";
+import testUtils from "./test-utils";
+import jws from "jws";
+import fs from "fs";
+import path from "path";
+
+describe("complete option", function () {
+ const secret = fs.readFileSync(path.join(__dirname, "priv.pem"));
+ const pub = fs.readFileSync(path.join(__dirname, "pub.pem"));
+
+ const header = { alg: "RS256" };
+ const payload = { iat: Math.floor(Date.now() / 1000) };
+ const signed = jws.sign({ header, payload, secret, encoding: "utf8" });
+ const signature = jws.decode(signed).signature;
+
+ [
+ {
+ description: "should return header, payload and signature",
+ complete: true,
+ },
+ ].forEach(testCase => {
+ it(testCase.description, function (done) {
+ testUtils.verifyJWTHelper(signed, pub, { typ: "JWT", complete: testCase.complete }, (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded.header).toHaveProperty("alg", header.alg);
+ expect(decoded.payload).toHaveProperty("iat", payload.iat);
+ expect(decoded).toHaveProperty("signature", signature);
+ });
+ });
+ });
+ });
+ [
+ {
+ description: "should return payload",
+ complete: false,
+ },
+ ].forEach(testCase => {
+ it(testCase.description, function (done) {
+ testUtils.verifyJWTHelper(signed, pub, { typ: "JWT", complete: testCase.complete }, (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded.header).toBeUndefined();
+ expect(decoded.payload).toBeUndefined();
+ expect(decoded.signature).toBeUndefined();
+ expect(decoded).toHaveProperty("iat", payload.iat);
+ });
+ });
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/option-maxAge.test.js b/test/js/third_party/jsonwebtoken/option-maxAge.test.js
new file mode 100644
index 000000000..e48525344
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/option-maxAge.test.js
@@ -0,0 +1,62 @@
+"use strict";
+
+import jwt from "jsonwebtoken";
+import { expect, describe, it, beforeEach, afterEach } from "bun:test";
+import util from "util";
+import sinon from "sinon";
+
+describe("maxAge option", function () {
+ let token;
+
+ let fakeClock;
+ beforeEach(function () {
+ fakeClock = sinon.useFakeTimers({ now: 60000 });
+ token = jwt.sign({ iat: 70 }, "secret", { algorithm: "HS256" });
+ });
+
+ afterEach(function () {
+ fakeClock.uninstall();
+ });
+
+ [
+ {
+ description: "should work with a positive string value",
+ maxAge: "3s",
+ },
+ {
+ description: "should work with a negative string value",
+ maxAge: "-3s",
+ },
+ {
+ description: "should work with a positive numeric value",
+ maxAge: 3,
+ },
+ {
+ description: "should work with a negative numeric value",
+ maxAge: -3,
+ },
+ ].forEach(testCase => {
+ it(testCase.description, function (done) {
+ expect(() => jwt.verify(token, "secret", { maxAge: "3s", algorithm: "HS256" })).not.toThrow();
+ jwt.verify(token, "secret", { maxAge: testCase.maxAge, algorithm: "HS256" }, err => {
+ expect(err).toBeNull();
+ done();
+ });
+ });
+ });
+
+ [true, "invalid", [], ["foo"], {}, { foo: "bar" }].forEach(maxAge => {
+ it(`should error with value ${util.inspect(maxAge)}`, function (done) {
+ expect(() => jwt.verify(token, "secret", { maxAge, algorithm: "HS256" })).toThrow(
+ '"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60',
+ );
+ jwt.verify(token, "secret", { maxAge, algorithm: "HS256" }, err => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err.message).toEqual(
+ '"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60',
+ );
+ done();
+ });
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/option-nonce.test.js b/test/js/third_party/jsonwebtoken/option-nonce.test.js
new file mode 100644
index 000000000..abe918d42
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/option-nonce.test.js
@@ -0,0 +1,41 @@
+"use strict";
+
+import jwt from "jsonwebtoken";
+import { expect, describe, it, beforeEach } from "bun:test";
+import util from "util";
+import testUtils from "./test-utils";
+
+describe("nonce option", function () {
+ let token;
+
+ beforeEach(function () {
+ token = jwt.sign({ nonce: "abcde" }, "secret", { algorithm: "HS256" });
+ });
+ [
+ {
+ description: "should work with a string",
+ nonce: "abcde",
+ },
+ ].forEach(testCase => {
+ it(testCase.description, function (done) {
+ testUtils.verifyJWTHelper(token, "secret", { nonce: testCase.nonce }, (err, decoded) => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeNull();
+ expect(decoded).toHaveProperty("nonce", "abcde");
+ });
+ });
+ });
+ });
+ [true, false, null, -1, 0, 1, -1.1, 1.1, -Infinity, Infinity, NaN, "", " ", [], ["foo"], {}, { foo: "bar" }].forEach(
+ nonce => {
+ it(`should error with value ${util.inspect(nonce)}`, function (done) {
+ testUtils.verifyJWTHelper(token, "secret", { nonce }, err => {
+ testUtils.asyncCheck(done, () => {
+ expect(err).toBeInstanceOf(jwt.JsonWebTokenError);
+ expect(err).toHaveProperty("message", "nonce must be a non-empty string");
+ });
+ });
+ });
+ },
+ );
+});
diff --git a/test/js/third_party/jsonwebtoken/package.json b/test/js/third_party/jsonwebtoken/package.json
new file mode 100644
index 000000000..95228db02
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "jsonwebtoken",
+ "dependencies": {
+ "jsonwebtoken": "9.0.2",
+ "jws": "4.0.0",
+ "sinon": "16.1.0"
+ }
+}
diff --git a/test/js/third_party/jsonwebtoken/prime256v1-private.pem b/test/js/third_party/jsonwebtoken/prime256v1-private.pem
new file mode 100644
index 000000000..317366570
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/prime256v1-private.pem
@@ -0,0 +1,5 @@
+-----BEGIN EC PRIVATE KEY-----
+MHcCAQEEIMP1Xt/ic2jAHJva2Pll866d1jYL+dk3VdLytEU1+LFmoAoGCCqGSM49
+AwEHoUQDQgAEvIywoA1H1a2XpPPTqsRxSk6YnNRVsu4E+wTvb7uV6Yttvko9zWar
+jmtM3LHDXk/nHn+Pva0KD+lby8gb2daHGg==
+-----END EC PRIVATE KEY-----
diff --git a/test/js/third_party/jsonwebtoken/priv.pem b/test/js/third_party/jsonwebtoken/priv.pem
new file mode 100644
index 000000000..7be6d5abc
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/priv.pem
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAvtH4wKLYlIXZlfYQFJtXZVC3fD8XMarzwvb/fHUyJ6NvNStN
++H7GHp3/QhZbSaRyqK5hu5xXtFLgnI0QG8oE1NlXbczjH45LeHWhPIdc2uHSpzXi
+c78kOugMY1vng4J10PF6+T2FNaiv0iXeIQq9xbwwPYpflViQyJnzGCIZ7VGan6Gb
+RKzyTKcB58yx24pJq+CviLXEY52TIW1l5imcjGvLtlCp1za9qBZa4XGoVqHi1kRX
+kdDSHty6lZWj3KxoRvTbiaBCH+75U7rifS6fR9lqjWE57bCGoz7+BBu9YmPKtI1K
+kyHFqWpxaJc/AKf9xgg+UumeqVcirUmAsHJrMwIDAQABAoIBAQCYKw05YSNhXVPk
+eHLeW/pXuwR3OkCexPrakOmwMC0s2vIF7mChN0d6hvhVlUp68X7V8SnS2JxAGo8v
+iHY+Et3DdwZ3cxnzwh+BEhzgDfoIOmkoGppZPyX/K6klWtbGUrTtSISOWXbvEXQU
+G0qGAvDOzIGTsdMDX7slnU70Ac23JybPY5qBSiE+ky8U4dm2fUHMroWub4QP5vA/
+nqyWqX2FB/MEAbcujaknDQrFCtbmtUYlBbJCKGd9V3cGEqp6H7oH+ah2ofMc91gJ
+mCHk3YyWZB/bcVXH3CA+s1ywvCOVDBZ3Nw7Pt9zIcv6Rl9UKIy+Nx0QjXxR90Hla
+Tr0GHIShAoGBAPsD7uXm+0ksnGyKRYgvlVad8Z8FUFT6bf4B+vboDbx40FO8O/5V
+PraBPC5z8YRSBOQ/WfccPQzakkA28F2pXlRpXu5JcErVWnyyUiKpX5sw6iPenQR2
+JO9hY/GFbKiwUhVHpvWMcXFqFLSQu2A86jPnFFEfG48ZT4IhTzINKJVZAoGBAMKc
+B3YGfVfY9qiRFXzYRdSRLg5c8p/HzuWwXc9vfJ4kQTDkPXe/+nqD67rzeT54uVec
+jKoIrsCu4BfEaoyvOT+1KmUfdEpBgYZuuEC4CZf7dgKbXOpPVvZDMyJ/e7HyqTpw
+mvIYJLPm2fNAcAsnbrNX5mhLwwzEIltbplUUeRdrAoGBAKhZgPYsLkhrZRXevreR
+wkTvdUfD1pbHxtFfHqROCjhnhsFCM7JmFcNtdaFqHYczQxiZ7IqxI7jlNsVek2Md
+3qgaa5LBKlDmOuP67N9WXUrGSaJ5ATIm0qrB1Lf9VlzktIiVH8L7yHHaRby8fQ8U
+i7b3ukaV6HPW895A3M6iyJ8xAoGAInp4S+3MaTL0SFsj/nFmtcle6oaHKc3BlyoP
+BMBQyMfNkPbu+PdXTjtvGTknouzKkX4X4cwWAec5ppxS8EffEa1sLGxNMxa19vZI
+yJaShI21k7Ko3I5f7tNrDNKfPKCsYMEwgnHKluDwfktNTnyW/Uk2dgXuMaXSHHN5
+XZt59K8CgYArGVOWK7LUmf3dkTIs3tXBm4/IMtUZmWmcP9C8Xe/Dg/IdQhK5CIx4
+VXl8rgZNeX/5/4nJ8Q3LrdLau1Iz620trNRGU6sGMs3x4WQbSq93RRbFzfG1oK74
+IOo5yIBxImQOSk5jz31gF9RJb15SDBIxonuWv8qAERyUfvrmEwR0kg==
+-----END RSA PRIVATE KEY-----
diff --git a/test/js/third_party/jsonwebtoken/pub.pem b/test/js/third_party/jsonwebtoken/pub.pem
new file mode 100644
index 000000000..dd95d341e
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/pub.pem
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDtTCCAp2gAwIBAgIJAMKR/NsyfcazMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQwHhcNMTIxMTEyMjM0MzQxWhcNMTYxMjIxMjM0MzQxWjBF
+MQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50
+ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEAvtH4wKLYlIXZlfYQFJtXZVC3fD8XMarzwvb/fHUyJ6NvNStN+H7GHp3/
+QhZbSaRyqK5hu5xXtFLgnI0QG8oE1NlXbczjH45LeHWhPIdc2uHSpzXic78kOugM
+Y1vng4J10PF6+T2FNaiv0iXeIQq9xbwwPYpflViQyJnzGCIZ7VGan6GbRKzyTKcB
+58yx24pJq+CviLXEY52TIW1l5imcjGvLtlCp1za9qBZa4XGoVqHi1kRXkdDSHty6
+lZWj3KxoRvTbiaBCH+75U7rifS6fR9lqjWE57bCGoz7+BBu9YmPKtI1KkyHFqWpx
+aJc/AKf9xgg+UumeqVcirUmAsHJrMwIDAQABo4GnMIGkMB0GA1UdDgQWBBTs83nk
+LtoXFlmBUts3EIxcVvkvcjB1BgNVHSMEbjBsgBTs83nkLtoXFlmBUts3EIxcVvkv
+cqFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV
+BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMKR/NsyfcazMAwGA1UdEwQF
+MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABw7w/5k4d5dVDgd/OOOmXdaaCIKvt7d
+3ntlv1SSvAoKT8d8lt97Dm5RrmefBI13I2yivZg5bfTge4+vAV6VdLFdWeFp1b/F
+OZkYUv6A8o5HW0OWQYVX26zIqBcG2Qrm3reiSl5BLvpj1WSpCsYvs5kaO4vFpMak
+/ICgdZD+rxwxf8Vb/6fntKywWSLgwKH3mJ+Z0kRlpq1g1oieiOm1/gpZ35s0Yuor
+XZba9ptfLCYSggg/qc3d3d0tbHplKYkwFm7f5ORGHDSD5SJm+gI7RPE+4bO8q79R
+PAfbG1UGuJ0b/oigagciHhJp851SQRYf3JuNSc17BnK2L5IEtzjqr+Q=
+-----END CERTIFICATE-----
diff --git a/test/js/third_party/jsonwebtoken/rsa-private.pem b/test/js/third_party/jsonwebtoken/rsa-private.pem
new file mode 100644
index 000000000..746366b5b
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/rsa-private.pem
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEAvzoCEC2rpSpJQaWZbUmlsDNwp83Jr4fi6KmBWIwnj1MZ6CUQ
+7rBasuLI8AcfX5/10scSfQNCsTLV2tMKQaHuvyrVfwY0dINk+nkqB74QcT2oCCH9
+XduJjDuwWA4xLqAKuF96FsIes52opEM50W7/W7DZCKXkC8fFPFj6QF5ZzApDw2Qs
+u3yMRmr7/W9uWeaTwfPx24YdY7Ah+fdLy3KN40vXv9c4xiSafVvnx9BwYL7H1Q8N
+iK9LGEN6+JSWfgckQCs6UUBOXSZdreNN9zbQCwyzee7bOJqXUDAuLcFARzPw1EsZ
+AyjVtGCKIQ0/btqK+jFunT2NBC8RItanDZpptQIDAQABAoIBAQCsssO4Pra8hFMC
+gX7tr0x+tAYy1ewmpW8stiDFilYT33YPLKJ9HjHbSms0MwqHftwwTm8JDc/GXmW6
+qUui+I64gQOtIzpuW1fvyUtHEMSisI83QRMkF6fCSQm6jJ6oQAtOdZO6R/gYOPNb
+3gayeS8PbMilQcSRSwp6tNTVGyC33p43uUUKAKHnpvAwUSc61aVOtw2wkD062XzM
+hJjYpHm65i4V31AzXo8HF42NrAtZ8K/AuQZne5F/6F4QFVlMKzUoHkSUnTp60XZx
+X77GuyDeDmCgSc2J7xvR5o6VpjsHMo3ek0gJk5ZBnTgkHvnpbULCRxTmDfjeVPue
+v3NN2TBFAoGBAPxbqNEsXPOckGTvG3tUOAAkrK1hfW3TwvrW/7YXg1/6aNV4sklc
+vqn/40kCK0v9xJIv9FM/l0Nq+CMWcrb4sjLeGwHAa8ASfk6hKHbeiTFamA6FBkvQ
+//7GP5khD+y62RlWi9PmwJY21lEkn2mP99THxqvZjQiAVNiqlYdwiIc7AoGBAMH8
+f2Ay7Egc2KYRYU2qwa5E/Cljn/9sdvUnWM+gOzUXpc5sBi+/SUUQT8y/rY4AUVW6
+YaK7chG9YokZQq7ZwTCsYxTfxHK2pnG/tXjOxLFQKBwppQfJcFSRLbw0lMbQoZBk
+S+zb0ufZzxc2fJfXE+XeJxmKs0TS9ltQuJiSqCPPAoGBALEc84K7DBG+FGmCl1sb
+ZKJVGwwknA90zCeYtadrIT0/VkxchWSPvxE5Ep+u8gxHcqrXFTdILjWW4chefOyF
+5ytkTrgQAI+xawxsdyXWUZtd5dJq8lxLtx9srD4gwjh3et8ZqtFx5kCHBCu29Fr2
+PA4OmBUMfrs0tlfKgV+pT2j5AoGBAKnA0Z5XMZlxVM0OTH3wvYhI6fk2Kx8TxY2G
+nxsh9m3hgcD/mvJRjEaZnZto6PFoqcRBU4taSNnpRr7+kfH8sCht0k7D+l8AIutL
+ffx3xHv9zvvGHZqQ1nHKkaEuyjqo+5kli6N8QjWNzsFbdvBQ0CLJoqGhVHsXuWnz
+W3Z4cBbVAoGAEtnwY1OJM7+R2u1CW0tTjqDlYU2hUNa9t1AbhyGdI2arYp+p+umA
+b5VoYLNsdvZhqjVFTrYNEuhTJFYCF7jAiZLYvYm0C99BqcJnJPl7JjWynoNHNKw3
+9f6PIOE1rAmPE8Cfz/GFF5115ZKVlq+2BY8EKNxbCIy2d/vMEvisnXI=
+-----END RSA PRIVATE KEY-----
diff --git a/test/js/third_party/jsonwebtoken/rsa-pss-invalid-salt-length-private.pem b/test/js/third_party/jsonwebtoken/rsa-pss-invalid-salt-length-private.pem
new file mode 100644
index 000000000..cbafa662d
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/rsa-pss-invalid-salt-length-private.pem
@@ -0,0 +1,29 @@
+-----BEGIN PRIVATE KEY-----
+MIIE8gIBADBCBgkqhkiG9w0BAQowNaAPMA0GCWCGSAFlAwQCAQUAoRwwGgYJKoZI
+hvcNAQEIMA0GCWCGSAFlAwQCAQUAogQCAgQABIIEpzCCBKMCAQACggEBAJy3FuDR
+1qKXsC8o+0xDJbuJCnysT71EFDGQY2/b3cZmxW3rzDYLyE65t2Go1jeK5Kxs+kwS
+1VxfefD8DifeDZN66wjRse4iWLcxmQB5FfishXOdozciimgXNvXJNS8X//feSofl
+vDQaTUI0NJnw1qQ2CB0pgGInwajsRKpWnDOhfk3NA/cmGlmfhTtDSTxq0ReytUie
+TjY7gy+S9YYm4bAgBcMeoup0GEPzYccK4+1yCmWzQZGFcrY1cuB9bL+vT7ajQFhe
+WVKlp6z35GyBF2zI7gJSkHpUHaWV5+Z9aTr6+YP6U7xuCRvXQ/l6BEOUjt4Es2YG
+3frgxeVbOs1gAakCAwEAAQKCAQAMvFxhnOwCfq1Ux9HUWsigOvzdMOuyB+xUMtXB
+625Uh1mYG0eXRNHcg/9BMoVmMiVvVdPphsZMIX45dWJ5HvSffafIKbJ6FdR73s3+
+WdjNQsf9o1v2SRpSZ0CSLO3ji+HDdQ89iBAJc/G/ZZq4v/fRlIqIRC0ozO5SGhFi
+fnNnRqH78d2KeJMX/g9jBZM8rJQCi+pb0keHmFmLJ5gZa4HokE8rWQJQY46PVYUH
+W2BwEJToMl3MPC7D95soWVuFt3KHnIWhuma/tnCmd2AUvcMrdWq0CwStH3vuX4LB
+vJug0toWkobt1tzZgzzCASb2EpzJj8UNxP1CzTQWsvl8OephAoGBAMVnmZeLHoh2
+kxn/+rXetZ4Msjgu19MHNQAtlMvqzwZLan0K/BhnHprJLy4SDOuQYIs+PYJuXdT7
+Yv2mp9kwTPz8glP9LAto4MDeDfCu0cyXmZb2VQcT/lqVyrwfx3Psqxm/Yxg62YKr
+aQE8WqgZGUdOvU9dYU+7EmPlYpdGpPVlAoGBAMs7ks+12oE6kci3WApdnt0kk5+f
+8fbQ0lp2vR3tEw8DURa5FnHWA4o46XvcMcuXwZBrpxANPNAxJJjMBs1hSkc8h4hd
+4vjtRNYJpj+uBdDIRmdqTzbpWv+hv8Xpiol5EVgnMVs2UZWDjoxQ+mYa1R8tAUfj
+ojzV2KBMWGCoHgj1AoGALki6JGQEBq72kpQILnhHUQVdC/s/s0TvUlldl+o4HBu2
+nhbjQL182YHuQ/kLenfhiwRO27QQ4A0JCrv2gt/mTTLPQ+4KU6qFd/MYhaQXoMay
+xkh/aydu7cJNRIqW80E8ZM8Q5u91bEPQXO/PubYYzTVTAba9SDpud2mjEiEIMFkC
+gYEAxINEQEgtkkuZ76UpIkzIcjkN7YlxJCFjZUnvL+KvTRL986TgyQ4RujOxwKx4
+Ec8ZwZX2opTKOt1p771IzorGkf87ZmayM9TpfLUz5dtVkD43pYOsOQKHlStIDgz2
+gltoo/6xwOrTFGlzCsa6eMR1U4Hm/SZlF8IHh2iLBFtLP4kCgYBqTi1XeWeVQVSA
+y9Wolv9kMoRh/Xh6F2D8bTTybGshDVO+P4YLM4lLxh5UDZAd/VOkdf3ZIcUGv022
+lxrYbLbIEGckMCpkdHeZH/1/iuJUeiCrXeyNlQsXBrmJKr/0lENniJHGpiSEyvY5
+D8Oafyjd7ZjUmyBFvS4heQEC6Pjo3Q==
+-----END PRIVATE KEY-----
diff --git a/test/js/third_party/jsonwebtoken/rsa-pss-private.pem b/test/js/third_party/jsonwebtoken/rsa-pss-private.pem
new file mode 100644
index 000000000..52b1c08e9
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/rsa-pss-private.pem
@@ -0,0 +1,29 @@
+-----BEGIN PRIVATE KEY-----
+MIIE8QIBADBBBgkqhkiG9w0BAQowNKAPMA0GCWCGSAFlAwQCAQUAoRwwGgYJKoZI
+hvcNAQEIMA0GCWCGSAFlAwQCAQUAogMCASAEggSnMIIEowIBAAKCAQEA00tEqqyF
+VnyvcVA2ewVoSicCMdQXmWyYM82sBWX0wcnn0WUuZp1zjux4xTvQ71Lhx95OJCQZ
+7r7b2192Im5ca37wNRbI6DhyXNdNVFXLFYlNAvgP+V0gIwlr6NgopdJqHCjYVv/g
+GOoesRZaDdtV1A3O9CXdJ34x2HZh7nhwYK5hqZDhUW4rd+5GzIIzwCJfwgTQpkIc
+18UeMMEoKJ6A0ixdpf43HqJ5fAB5nsbYFhyHpfiX1UO2EFJtSdbKEIbRmqcbNjG1
+tu1tjt6u8LI2coetLh/IYMbMfkyQz+eAUHLQCUb2R8BqLOL3hRqEsVTBo93UJlOs
+VWC1fKaq+HOEWQIDAQABAoIBAAet23PagPQTjwAZcAlzjlvs5AMHQsj5gznqwSmR
+ut3/e7SGrrOIXbv1iIQejZQ3w8CS/0MH/ttIRiRIaWTh9EDsjvKsU9FAxUNDiJTG
+k3LCbTFCQ7kGiJWiu4XDCWMmwmLTRzLjlMjtr/+JS5eSVPcNKMGDI3D9K0xDLSxQ
+u0DVigYgWOCWlejHCEU4yi6vBO0HlumWjVPelWb9GmihBDwCLUJtG0JA6H6rw+KS
+i6SNXcMGVKfjEghChRp+HaMvLvMgU44Ptnj8jhlfBctXInBY1is1FfDSWxXdVbUM
+1HdKXfV4A50GXSvJLiWP9ZZsaZ7NiBJK8IiJBXD72EFOzwECgYEA3RjnTJn9emzG
+84eIHZQujWWt4Tk/wjeLJYOYtAZpF7R3/fYLVypX9Bsw1IbwZodq/jChTjMaUkYt
+//FgUjF/t0uakEg1i+THPZvktNB8Q1E9NwHerB8HF/AD/jMALD+ejdLQ11Z4VScw
+zyNmSvD9I84/sgpms5YVKSH9sqww2RkCgYEA9KYws3sTfRLc1hlsS25V6+Zg3ZCk
+iGcp+zrxGC1gb2/PpRvEDBucZO21KbSRuQDavWIOZYl4fGu7s8wo2oF8RxOsHQsM
+LJyjklruvtjnvuoft/bGAv2zLQkNaj+f7IgK6965gIxcLYL66UPCZZkTfL5CoJis
+V0v2hBh1ES5bLUECgYEAuONeaLxNL9dO989akAGefDePFExfePYhshk91S2XLG+J
++CGMkjOioUsrpk3BMrwDSNU5zr8FP8/YH7OlrJYgCxN6CTWZMYb65hY7RskhYNnK
+qvkxUBYSRH49mJDlkBsTZ93nLmvs7Kh9NHqRzBGCXjLXKPdxsrPKtj7qfENqBeEC
+gYAC9dPXCCE3PTgw2wPlccNWZGY9qBdlkyH96TurmDj3gDnZ/JkFsHvW+M1dYNL2
+kx0Sd5JHBj/P+Zm+1jSUWEbBsWo+u7h8/bQ4/CKxanx7YefaWQESXjGB1P81jumH
+einvqrVB6fDfmBsjIW/DvPNwafjyaoaDU+b6uDUKbS4rQQKBgCe0pvDl5lO8FM81
+NP7GoCIu1gKBS+us1sgYE65ZFmVXJ6b5DckvobXSjM60G2N5w2xaXEXJsnwMApf1
+SClQUsgNWcSXRwL+w0pIdyFKS25BSfwUNQ9n7QLJcYgmflbARTfB3He/10vbFzTp
+G6ZAiKUp9bKFPzviII40AEPL2hPX
+-----END PRIVATE KEY-----
diff --git a/test/js/third_party/jsonwebtoken/rsa-public-key.pem b/test/js/third_party/jsonwebtoken/rsa-public-key.pem
new file mode 100644
index 000000000..eb9a29bad
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/rsa-public-key.pem
@@ -0,0 +1,8 @@
+-----BEGIN RSA PUBLIC KEY-----
+MIIBCgKCAQEAvzoCEC2rpSpJQaWZbUmlsDNwp83Jr4fi6KmBWIwnj1MZ6CUQ7rBa
+suLI8AcfX5/10scSfQNCsTLV2tMKQaHuvyrVfwY0dINk+nkqB74QcT2oCCH9XduJ
+jDuwWA4xLqAKuF96FsIes52opEM50W7/W7DZCKXkC8fFPFj6QF5ZzApDw2Qsu3yM
+Rmr7/W9uWeaTwfPx24YdY7Ah+fdLy3KN40vXv9c4xiSafVvnx9BwYL7H1Q8NiK9L
+GEN6+JSWfgckQCs6UUBOXSZdreNN9zbQCwyzee7bOJqXUDAuLcFARzPw1EsZAyjV
+tGCKIQ0/btqK+jFunT2NBC8RItanDZpptQIDAQAB
+-----END RSA PUBLIC KEY-----
diff --git a/test/js/third_party/jsonwebtoken/rsa-public-key.test.js b/test/js/third_party/jsonwebtoken/rsa-public-key.test.js
new file mode 100644
index 000000000..c343cb0a9
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/rsa-public-key.test.js
@@ -0,0 +1,44 @@
+const PS_SUPPORTED = true;
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+import { generateKeyPairSync } from "crypto";
+
+describe("public key start with BEGIN RSA PUBLIC KEY", function () {
+ it("should work for RS family of algorithms", function (done) {
+ var fs = require("fs");
+ var cert_pub = fs.readFileSync(__dirname + "/rsa-public-key.pem");
+ var cert_priv = fs.readFileSync(__dirname + "/rsa-private.pem");
+
+ var token = jwt.sign({ foo: "bar" }, cert_priv, { algorithm: "RS256" });
+
+ jwt.verify(token, cert_pub, done);
+ });
+
+ it("should not work for RS algorithms when modulus length is less than 2048 when allowInsecureKeySizes is false or not set", function (done) {
+ const { privateKey } = generateKeyPairSync("rsa", { modulusLength: 1024 });
+
+ expect(function () {
+ jwt.sign({ foo: "bar" }, privateKey, { algorithm: "RS256" });
+ }).toThrow("minimum key size");
+
+ done();
+ });
+
+ it("should work for RS algorithms when modulus length is less than 2048 when allowInsecureKeySizes is true", function (done) {
+ const { privateKey } = generateKeyPairSync("rsa", { modulusLength: 1024 });
+
+ jwt.sign({ foo: "bar" }, privateKey, { algorithm: "RS256", allowInsecureKeySizes: true }, done);
+ });
+
+ if (PS_SUPPORTED) {
+ it("should work for PS family of algorithms", function (done) {
+ var fs = require("fs");
+ var cert_pub = fs.readFileSync(__dirname + "/rsa-public-key.pem");
+ var cert_priv = fs.readFileSync(__dirname + "/rsa-private.pem");
+
+ var token = jwt.sign({ foo: "bar" }, cert_priv, { algorithm: "PS256" });
+
+ jwt.verify(token, cert_pub, done);
+ });
+ }
+});
diff --git a/test/js/third_party/jsonwebtoken/rsa-public.pem b/test/js/third_party/jsonwebtoken/rsa-public.pem
new file mode 100644
index 000000000..9307812ab
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/rsa-public.pem
@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvzoCEC2rpSpJQaWZbUml
+sDNwp83Jr4fi6KmBWIwnj1MZ6CUQ7rBasuLI8AcfX5/10scSfQNCsTLV2tMKQaHu
+vyrVfwY0dINk+nkqB74QcT2oCCH9XduJjDuwWA4xLqAKuF96FsIes52opEM50W7/
+W7DZCKXkC8fFPFj6QF5ZzApDw2Qsu3yMRmr7/W9uWeaTwfPx24YdY7Ah+fdLy3KN
+40vXv9c4xiSafVvnx9BwYL7H1Q8NiK9LGEN6+JSWfgckQCs6UUBOXSZdreNN9zbQ
+Cwyzee7bOJqXUDAuLcFARzPw1EsZAyjVtGCKIQ0/btqK+jFunT2NBC8RItanDZpp
+tQIDAQAB
+-----END PUBLIC KEY-----
diff --git a/test/js/third_party/jsonwebtoken/schema.test.js b/test/js/third_party/jsonwebtoken/schema.test.js
new file mode 100644
index 000000000..5d3845d46
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/schema.test.js
@@ -0,0 +1,72 @@
+var PS_SUPPORTED = true;
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+import fs from "fs";
+
+describe("schema", function () {
+ describe("sign options", function () {
+ var cert_rsa_priv = fs.readFileSync(__dirname + "/rsa-private.pem");
+ var cert_ecdsa_priv = fs.readFileSync(__dirname + "/ecdsa-private.pem");
+ var cert_secp384r1_priv = fs.readFileSync(__dirname + "/secp384r1-private.pem");
+ var cert_secp521r1_priv = fs.readFileSync(__dirname + "/secp521r1-private.pem");
+
+ function sign(options, secretOrPrivateKey) {
+ jwt.sign({ foo: 123 }, secretOrPrivateKey, options);
+ }
+
+ it("should validate algorithm", function () {
+ expect(function () {
+ sign({ algorithm: "foo" }, cert_rsa_priv);
+ }).toThrow(/"algorithm" must be a valid string enum value/);
+ sign({ algorithm: "none" }, null);
+ sign({ algorithm: "RS256" }, cert_rsa_priv);
+ sign({ algorithm: "RS384" }, cert_rsa_priv);
+ sign({ algorithm: "RS512" }, cert_rsa_priv);
+ if (PS_SUPPORTED) {
+ sign({ algorithm: "PS256" }, cert_rsa_priv);
+ sign({ algorithm: "PS384" }, cert_rsa_priv);
+ sign({ algorithm: "PS512" }, cert_rsa_priv);
+ }
+ sign({ algorithm: "ES256" }, cert_ecdsa_priv);
+ sign({ algorithm: "ES384" }, cert_secp384r1_priv);
+ sign({ algorithm: "ES512" }, cert_secp521r1_priv);
+ sign({ algorithm: "HS256" }, "superSecret");
+ sign({ algorithm: "HS384" }, "superSecret");
+ sign({ algorithm: "HS512" }, "superSecret");
+ });
+
+ it("should validate header", function () {
+ expect(function () {
+ sign({ header: "foo" }, "superSecret");
+ }).toThrow(/"header" must be an object/);
+ sign({ header: {} }, "superSecret");
+ });
+
+ it("should validate encoding", function () {
+ expect(function () {
+ sign({ encoding: 10 }, "superSecret");
+ }).toThrow(/"encoding" must be a string/);
+ sign({ encoding: "utf8" }, "superSecret");
+ });
+
+ it("should validate noTimestamp", function () {
+ expect(function () {
+ sign({ noTimestamp: 10 }, "superSecret");
+ }).toThrow(/"noTimestamp" must be a boolean/);
+ sign({ noTimestamp: true }, "superSecret");
+ });
+ });
+
+ describe("sign payload registered claims", function () {
+ function sign(payload) {
+ jwt.sign(payload, "foo123");
+ }
+
+ it("should validate exp", function () {
+ expect(function () {
+ sign({ exp: "1 monkey" });
+ }).toThrow(/"exp" should be a number of seconds/);
+ sign({ exp: 10.1 });
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/secp384r1-private.pem b/test/js/third_party/jsonwebtoken/secp384r1-private.pem
new file mode 100644
index 000000000..82336b6a2
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/secp384r1-private.pem
@@ -0,0 +1,6 @@
+-----BEGIN EC PRIVATE KEY-----
+MIGkAgEBBDCez58vZHVp+ArI7/fe835GAtRzE0AtrxGgQAY1U/uk2SQOaSw1ph61
+3Unr0ygS172gBwYFK4EEACKhZANiAARtwlnIqYqZxfiWR+/EM35nKHuLpOjUHiX1
+kEpSS03C9XlrBLNwLQfgjpYx9Qvqh26XAzTe74DYjcc748R+zZD2YAd3lV+OcdRE
+U+DWm4j5E6dlOXzvmw/3qxUcg3rRgR4=
+-----END EC PRIVATE KEY-----
diff --git a/test/js/third_party/jsonwebtoken/secp521r1-private.pem b/test/js/third_party/jsonwebtoken/secp521r1-private.pem
new file mode 100644
index 000000000..397a3df09
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/secp521r1-private.pem
@@ -0,0 +1,7 @@
+-----BEGIN EC PRIVATE KEY-----
+MIHcAgEBBEIBlWXKBKKCgTgf7+NS09TMv7/NO3RtMBn9xTe+46oNNNK405lrZ9mz
+WYtlsYvkdsc2Cx3v5V8JegaCOM+XtAZ0MNKgBwYFK4EEACOhgYkDgYYABAFNzaM7
+Zb9ug0p5KaZb5mjHrIshoVJSHaOXGtcjLVUakYVk0v9VsE+FKqyuLYcORUuAZdxl
+ITAlC5e5JZ0o8NEKbAE+8oOrePrItR3IFBtWO15p7qiRa2dBB8oQklFrmQaJYn4K
+fDV0hYpfu6ahpRNu2akR7aMXL/vXrptCH/n64q9KjA==
+-----END EC PRIVATE KEY-----
diff --git a/test/js/third_party/jsonwebtoken/set_headers.test.js b/test/js/third_party/jsonwebtoken/set_headers.test.js
new file mode 100644
index 000000000..2ed9831a5
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/set_headers.test.js
@@ -0,0 +1,16 @@
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+
+describe("set header", function () {
+ it("should add the header", function () {
+ var token = jwt.sign({ foo: 123 }, "123", { header: { foo: "bar" } });
+ var decoded = jwt.decode(token, { complete: true });
+ expect(decoded.header.foo).toEqual("bar");
+ });
+
+ it("should allow overriding header", function () {
+ var token = jwt.sign({ foo: 123 }, "123", { header: { alg: "HS512" } });
+ var decoded = jwt.decode(token, { complete: true });
+ expect(decoded.header.alg).toEqual("HS512");
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/test-utils.js b/test/js/third_party/jsonwebtoken/test-utils.js
new file mode 100644
index 000000000..94a7e43e9
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/test-utils.js
@@ -0,0 +1,116 @@
+"use strict";
+
+import jwt from "jsonwebtoken";
+function expect(value) {
+ return {
+ toEqual: expected => {
+ if (typeof value === "object") {
+ if (typeof expected === "object") {
+ for (const propertyName in expected) {
+ expect(value[propertyName]).toEqual(expected[propertyName]);
+ }
+ return;
+ }
+ throw new Error(`Expected ${value} to strictly equal ${expected}`);
+ }
+ if (value !== expected) {
+ throw new Error(`Expected ${value} to equal ${expected}`);
+ }
+ },
+ toStrictEqual: expected => {
+ if (typeof value === "object") {
+ if (typeof expected === "object") {
+ for (const propertyName in expected) {
+ expect(value[propertyName]).toStrictEqual(expected[propertyName]);
+ }
+ return;
+ }
+ throw new Error(`Expected ${value} to strictly equal ${expected}`);
+ }
+ if (value !== expected) {
+ throw new Error(`Expected ${value} to strictly equal ${expected}`);
+ }
+ },
+ };
+}
+/**
+ * Correctly report errors that occur in an asynchronous callback
+ * @param {function(err): void} done The mocha callback
+ * @param {function(): void} testFunction The assertions function
+ */
+function asyncCheck(done, testFunction) {
+ try {
+ testFunction();
+ done();
+ } catch (err) {
+ done(err);
+ }
+}
+
+/**
+ * Base64-url encode a string
+ * @param str {string} The string to encode
+ * @returns {string} The encoded string
+ */
+function base64UrlEncode(str) {
+ return Buffer.from(str).toString("base64").replace(/[=]/g, "").replace(/\+/g, "-").replace(/\//g, "_");
+}
+
+/**
+ * Verify a JWT, ensuring that the asynchronous and synchronous calls to `verify` have the same result
+ * @param {string} jwtString The JWT as a string
+ * @param {string} secretOrPrivateKey The shared secret or private key
+ * @param {object} options Verify options
+ * @param {function(err, token):void} callback
+ */
+function verifyJWTHelper(jwtString, secretOrPrivateKey, options, callback) {
+ let error;
+ let syncVerified;
+ try {
+ syncVerified = jwt.verify(jwtString, secretOrPrivateKey, options);
+ } catch (err) {
+ error = err;
+ }
+ jwt.verify(jwtString, secretOrPrivateKey, options, (err, asyncVerifiedToken) => {
+ if (error) {
+ callback(err);
+ } else {
+ expect(syncVerified).toStrictEqual(asyncVerifiedToken);
+ callback(null, syncVerified);
+ }
+ });
+}
+
+/**
+ * Sign a payload to create a JWT, ensuring that the asynchronous and synchronous calls to `sign` have the same result
+ * @param {object} payload The JWT payload
+ * @param {string} secretOrPrivateKey The shared secret or private key
+ * @param {object} options Sign options
+ * @param {function(err, token):void} callback
+ */
+function signJWTHelper(payload, secretOrPrivateKey, options, callback) {
+ let error;
+ let syncSigned;
+ try {
+ syncSigned = jwt.sign(payload, secretOrPrivateKey, options);
+ } catch (err) {
+ error = err;
+ }
+ jwt.sign(payload, secretOrPrivateKey, options, (err, asyncSigned) => {
+ if (error) {
+ callback(err);
+ } else {
+ expect(syncSigned).toEqual(asyncSigned);
+ callback(null, syncSigned);
+ }
+ });
+}
+
+export { asyncCheck, base64UrlEncode, signJWTHelper, verifyJWTHelper };
+
+export default {
+ asyncCheck,
+ base64UrlEncode,
+ signJWTHelper,
+ verifyJWTHelper,
+};
diff --git a/test/js/third_party/jsonwebtoken/undefined_secretOrPublickey.test.js b/test/js/third_party/jsonwebtoken/undefined_secretOrPublickey.test.js
new file mode 100644
index 000000000..fb3f3b8d3
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/undefined_secretOrPublickey.test.js
@@ -0,0 +1,18 @@
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+
+var TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.t-IDcSemACt8x4iTMCda8Yhe3iZaWbvV5XKSTbuAn0M";
+
+describe("verifying without specified secret or public key", function () {
+ it("should not verify null", function () {
+ expect(function () {
+ jwt.verify(TOKEN, null);
+ }).toThrow(/secret or public key must be provided/);
+ });
+
+ it("should not verify undefined", function () {
+ expect(function () {
+ jwt.verify(TOKEN);
+ }).toThrow(/secret or public key must be provided/);
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/validateAsymmetricKey.test.js b/test/js/third_party/jsonwebtoken/validateAsymmetricKey.test.js
new file mode 100644
index 000000000..4bcf13cb0
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/validateAsymmetricKey.test.js
@@ -0,0 +1,209 @@
+import { expect, describe, it } from "bun:test";
+import { createPrivateKey } from "crypto";
+import fs from "fs";
+import path from "path";
+const PS_SUPPORTED = true;
+const ASYMMETRIC_KEY_DETAILS_SUPPORTED = true;
+const RSA_PSS_KEY_DETAILS_SUPPORTED = true;
+const allowedAlgorithmsForKeys = {
+ "ec": ["ES256", "ES384", "ES512"],
+ "rsa": ["RS256", "PS256", "RS384", "PS384", "RS512", "PS512"],
+ "rsa-pss": ["PS256", "PS384", "PS512"],
+};
+
+const allowedCurves = {
+ ES256: "prime256v1",
+ ES384: "secp384r1",
+ ES512: "secp521r1",
+};
+
+function validateAsymmetricKey(algorithm, key) {
+ if (!algorithm || !key) return;
+
+ const keyType = key.asymmetricKeyType;
+ if (!keyType) return;
+
+ const allowedAlgorithms = allowedAlgorithmsForKeys[keyType];
+
+ if (!allowedAlgorithms) {
+ throw new Error(`Unknown key type "${keyType}".`);
+ }
+
+ if (!allowedAlgorithms.includes(algorithm)) {
+ throw new Error(`"alg" parameter for "${keyType}" key type must be one of: ${allowedAlgorithms.join(", ")}.`);
+ }
+
+ /*
+ * Ignore the next block from test coverage because it gets executed
+ * conditionally depending on the Node version. Not ignoring it would
+ * prevent us from reaching the target % of coverage for versions of
+ * Node under 15.7.0.
+ */
+ /* istanbul ignore next */
+ if (ASYMMETRIC_KEY_DETAILS_SUPPORTED) {
+ switch (keyType) {
+ case "ec":
+ const keyCurve = key.asymmetricKeyDetails.namedCurve;
+ const allowedCurve = allowedCurves[algorithm];
+
+ if (keyCurve !== allowedCurve) {
+ throw new Error(`"alg" parameter "${algorithm}" requires curve "${allowedCurve}".`);
+ }
+ break;
+
+ case "rsa-pss":
+ if (RSA_PSS_KEY_DETAILS_SUPPORTED) {
+ const length = parseInt(algorithm.slice(-3), 10);
+ const { hashAlgorithm, mgf1HashAlgorithm, saltLength } = key.asymmetricKeyDetails;
+
+ if (hashAlgorithm !== `sha${length}` || mgf1HashAlgorithm !== hashAlgorithm) {
+ throw new Error(
+ `Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${algorithm}.`,
+ );
+ }
+
+ if (saltLength !== undefined && saltLength > length >> 3) {
+ throw new Error(
+ `Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${algorithm}.`,
+ );
+ }
+ }
+ break;
+ }
+ }
+}
+
+function loadKey(filename) {
+ return createPrivateKey(fs.readFileSync(path.join(__dirname, filename)));
+}
+
+const algorithmParams = {
+ RS256: {
+ invalidPrivateKey: loadKey("secp384r1-private.pem"),
+ },
+ ES256: {
+ invalidPrivateKey: loadKey("priv.pem"),
+ },
+};
+
+if (PS_SUPPORTED) {
+ algorithmParams.PS256 = {
+ invalidPrivateKey: loadKey("secp384r1-private.pem"),
+ };
+}
+
+describe("Asymmetric key validation", function () {
+ Object.keys(algorithmParams).forEach(function (algorithm) {
+ describe(algorithm, function () {
+ const keys = algorithmParams[algorithm];
+
+ describe("when validating a key with an invalid private key type", function () {
+ it("should throw an error", function () {
+ const expectedErrorMessage = /"alg" parameter for "[\w\d-]+" key type must be one of:/;
+
+ expect(function () {
+ validateAsymmetricKey(algorithm, keys.invalidPrivateKey);
+ }).toThrow(expectedErrorMessage);
+ });
+ });
+ });
+ });
+
+ describe("when the function has missing parameters", function () {
+ it("should pass the validation if no key has been provided", function () {
+ const algorithm = "ES256";
+ validateAsymmetricKey(algorithm);
+ });
+
+ it.todo("should pass the validation if no algorithm has been provided", function () {
+ const key = loadKey("dsa-private.pem");
+ validateAsymmetricKey(null, key);
+ });
+ });
+
+ describe("when validating a key with an unsupported type", function () {
+ it.todo("should throw an error", function () {
+ const algorithm = "RS256";
+ const key = loadKey("dsa-private.pem");
+ const expectedErrorMessage = 'Unknown key type "dsa".';
+
+ expect(function () {
+ validateAsymmetricKey(algorithm, key);
+ }).toThrow(expectedErrorMessage);
+ });
+ });
+
+ describe("Elliptic curve algorithms", function () {
+ const curvesAlgorithms = [
+ { algorithm: "ES256", curve: "prime256v1" },
+ { algorithm: "ES384", curve: "secp384r1" },
+ { algorithm: "ES512", curve: "secp521r1" },
+ ];
+
+ const curvesKeys = [
+ { curve: "prime256v1", key: loadKey("prime256v1-private.pem") },
+ { curve: "secp384r1", key: loadKey("secp384r1-private.pem") },
+ { curve: "secp521r1", key: loadKey("secp521r1-private.pem") },
+ ];
+
+ describe("when validating keys generated using Elliptic Curves", function () {
+ curvesAlgorithms.forEach(function (curveAlgorithm) {
+ curvesKeys.forEach(curveKeys => {
+ if (curveKeys.curve !== curveAlgorithm.curve) {
+ if (ASYMMETRIC_KEY_DETAILS_SUPPORTED) {
+ it(`should throw an error when validating an ${curveAlgorithm.algorithm} token for key with curve ${curveKeys.curve}`, function () {
+ expect(() => {
+ validateAsymmetricKey(curveAlgorithm.algorithm, curveKeys.key);
+ }).toThrow(`"alg" parameter "${curveAlgorithm.algorithm}" requires curve "${curveAlgorithm.curve}".`);
+ });
+ } else {
+ it(`should pass the validation for incorrect keys if the Node version does not support checking the key's curve name`, function () {
+ expect(() => {
+ validateAsymmetricKey(curveAlgorithm.algorithm, curveKeys.key);
+ }).not.toThrow();
+ });
+ }
+ } else {
+ it(`should accept an ${curveAlgorithm.algorithm} token for key with curve ${curveKeys.curve}`, function () {
+ expect(() => {
+ validateAsymmetricKey(curveAlgorithm.algorithm, curveKeys.key);
+ }).not.toThrow();
+ });
+ }
+ });
+ });
+ });
+ });
+
+ if (RSA_PSS_KEY_DETAILS_SUPPORTED) {
+ describe.todo("RSA-PSS algorithms", function () {
+ // const key = loadKey('rsa-pss-private.pem');
+
+ it(`it should throw an error when validating a key with wrong RSA-RSS parameters`, function () {
+ const algorithm = "PS512";
+ expect(function () {
+ validateAsymmetricKey(algorithm, key);
+ }).toThrow(
+ 'Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" PS512',
+ );
+ });
+
+ it(`it should throw an error when validating a key with invalid salt length`, function () {
+ const algorithm = "PS256";
+ const shortSaltKey = loadKey("rsa-pss-invalid-salt-length-private.pem");
+ expect(function () {
+ validateAsymmetricKey(algorithm, shortSaltKey);
+ }).toThrow(
+ 'Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" PS256.',
+ );
+ });
+
+ it(`it should pass the validation when the key matches all the requirements for the algorithm`, function () {
+ expect(function () {
+ const algorithm = "PS256";
+ validateAsymmetricKey(algorithm, key);
+ }).not.toThrow();
+ });
+ });
+ }
+});
diff --git a/test/js/third_party/jsonwebtoken/verify.test.js b/test/js/third_party/jsonwebtoken/verify.test.js
new file mode 100644
index 000000000..c7583892f
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/verify.test.js
@@ -0,0 +1,318 @@
+import jwt from "jsonwebtoken";
+import { expect, describe, it, afterEach } from "bun:test";
+import jws from "jws";
+import sinon from "sinon";
+import fs from "fs";
+import path from "path";
+
+describe("verify", function () {
+ const pub = fs.readFileSync(path.join(__dirname, "pub.pem"));
+ const priv = fs.readFileSync(path.join(__dirname, "priv.pem"));
+
+ it("should first assume JSON claim set", function (done) {
+ const header = { alg: "RS256" };
+ const payload = { iat: Math.floor(Date.now() / 1000) };
+
+ const signed = jws.sign({
+ header: header,
+ payload: payload,
+ secret: priv,
+ encoding: "utf8",
+ });
+
+ jwt.verify(signed, pub, { typ: "JWT" }, function (err, p) {
+ if (err) return done(err);
+ expect(err).toBeNull();
+ expect(p).toEqual(payload);
+ done();
+ });
+ });
+
+ it("should not be able to verify unsigned token", function () {
+ const header = { alg: "none" };
+ const payload = { iat: Math.floor(Date.now() / 1000) };
+
+ const signed = jws.sign({
+ header: header,
+ payload: payload,
+ secret: "secret",
+ encoding: "utf8",
+ });
+
+ expect(function () {
+ jwt.verify(signed, "secret", { typ: "JWT" });
+ }).toThrow(/jwt signature is required/);
+ });
+
+ it("should not be able to verify unsigned token", function () {
+ const header = { alg: "none" };
+ const payload = { iat: Math.floor(Date.now() / 1000) };
+
+ const signed = jws.sign({
+ header: header,
+ payload: payload,
+ secret: "secret",
+ encoding: "utf8",
+ });
+
+ expect(function () {
+ jwt.verify(signed, undefined, { typ: "JWT" });
+ }).toThrow(/please specify "none" in "algorithms" to verify unsigned tokens/);
+ });
+
+ it("should be able to verify unsigned token when none is specified", function (done) {
+ const header = { alg: "none" };
+ const payload = { iat: Math.floor(Date.now() / 1000) };
+
+ const signed = jws.sign({
+ header: header,
+ payload: payload,
+ secret: "secret",
+ encoding: "utf8",
+ });
+
+ jwt.verify(signed, null, { typ: "JWT", algorithms: ["none"] }, function (err, p) {
+ if (err) return done(err);
+ expect(err).toBeNull();
+ expect(p).toEqual(payload);
+ done();
+ });
+ });
+
+ it("should not mutate options", function (done) {
+ const header = { alg: "HS256" };
+ const payload = { iat: Math.floor(Date.now() / 1000) };
+ const options = { typ: "JWT" };
+ const signed = jws.sign({
+ header: header,
+ payload: payload,
+ secret: "secret",
+ encoding: "utf8",
+ });
+
+ jwt.verify(signed, "secret", options, function (err) {
+ if (err) return done(err);
+ expect(err).toBeNull();
+ expect(Object.keys(options).length).toEqual(1);
+ done();
+ });
+ });
+
+ describe("secret or token as callback", function () {
+ const token =
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJiYXIiLCJpYXQiOjE0MzcwMTg1ODIsImV4cCI6MTQzNzAxODU5Mn0.3aR3vocmgRpG05rsI9MpR6z2T_BGtMQaPq2YR6QaroU";
+ const key = "key";
+
+ const payload = { foo: "bar", iat: 1437018582, exp: 1437018592 };
+ const options = { algorithms: ["HS256"], ignoreExpiration: true };
+
+ it("without callback", function (done) {
+ jwt.verify(token, key, options, function (err, p) {
+ if (err) return done(err);
+ expect(err).toBeNull();
+ expect(p).toEqual(payload);
+ done();
+ });
+ });
+
+ it("simple callback", function (done) {
+ const keyFunc = function (header, callback) {
+ expect(header).toEqual({ alg: "HS256", typ: "JWT" });
+
+ callback(undefined, key);
+ };
+
+ jwt.verify(token, keyFunc, options, function (err, p) {
+ if (err) return done(err);
+ expect(err).toBeNull();
+ expect(p).toEqual(payload);
+ done();
+ });
+ });
+
+ it("should error if called synchronously", function (done) {
+ const keyFunc = function (header, callback) {
+ callback(undefined, key);
+ };
+
+ expect(function () {
+ jwt.verify(token, keyFunc, options);
+ }).toThrow(/verify must be called asynchronous if secret or public key is provided as a callback/);
+
+ done();
+ });
+
+ it("simple error", function (done) {
+ const keyFunc = function (header, callback) {
+ callback(new Error("key not found"));
+ };
+
+ jwt.verify(token, keyFunc, options, function (err, p) {
+ expect(err).toBeDefined();
+ expect(err.name).toBe("JsonWebTokenError");
+ expect(err.message).toMatch(/error in secret or public key callback/);
+ expect(p).toBeUndefined();
+ done();
+ });
+ });
+
+ it("delayed callback", function (done) {
+ const keyFunc = function (header, callback) {
+ setTimeout(function () {
+ callback(undefined, key);
+ }, 25);
+ };
+
+ jwt.verify(token, keyFunc, options, function (err, p) {
+ if (err) return done(err);
+ expect(err).toBeNull();
+ expect(p).toEqual(payload);
+ done();
+ });
+ });
+
+ it("delayed error", function (done) {
+ const keyFunc = function (header, callback) {
+ setTimeout(function () {
+ callback(new Error("key not found"));
+ }, 25);
+ };
+
+ jwt.verify(token, keyFunc, options, function (err, p) {
+ expect(err).toBeDefined();
+ expect(err.name).toBe("JsonWebTokenError");
+ expect(err.message).toMatch(/error in secret or public key callback/);
+ expect(p).toBeUndefined();
+ done();
+ });
+ });
+ });
+
+ describe("expiration", function () {
+ // { foo: 'bar', iat: 1437018582, exp: 1437018592 }
+ const token =
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJiYXIiLCJpYXQiOjE0MzcwMTg1ODIsImV4cCI6MTQzNzAxODU5Mn0.3aR3vocmgRpG05rsI9MpR6z2T_BGtMQaPq2YR6QaroU";
+ const key = "key";
+
+ let clock;
+ afterEach(function () {
+ try {
+ clock.restore();
+ } catch (e) {}
+ });
+
+ it("should error on expired token", function (done) {
+ clock = sinon.useFakeTimers(1437018650000); // iat + 58s, exp + 48s
+ const options = { algorithms: ["HS256"] };
+
+ jwt.verify(token, key, options, function (err, p) {
+ expect(err).toBeDefined();
+ expect(err.name).toBe("TokenExpiredError");
+ expect(err.message).toBe("jwt expired");
+ expect(err?.expiredAt?.constructor?.name).toBe("Date");
+ expect(Number(err.expiredAt)).toBe(1437018592000);
+ expect(p).toBeUndefined();
+ done();
+ });
+ });
+
+ it("should not error on expired token within clockTolerance interval", function (done) {
+ clock = sinon.useFakeTimers(1437018594000); // iat + 12s, exp + 2s
+ const options = { algorithms: ["HS256"], clockTolerance: 5 };
+
+ jwt.verify(token, key, options, function (err, p) {
+ expect(err).toBeNull();
+ expect(p.foo).toBe("bar");
+ done();
+ });
+ });
+
+ describe("option: clockTimestamp", function () {
+ const clockTimestamp = 1000000000;
+ it("should verify unexpired token relative to user-provided clockTimestamp", function (done) {
+ const token = jwt.sign({ foo: "bar", iat: clockTimestamp, exp: clockTimestamp + 1 }, key);
+ jwt.verify(token, key, { clockTimestamp: clockTimestamp }, function (err) {
+ expect(err).toBeNull();
+ done();
+ });
+ });
+ it("should error on expired token relative to user-provided clockTimestamp", function (done) {
+ const token = jwt.sign({ foo: "bar", iat: clockTimestamp, exp: clockTimestamp + 1 }, key);
+ jwt.verify(token, key, { clockTimestamp: clockTimestamp + 1 }, function (err, p) {
+ expect(err).toBeDefined();
+ expect(err.name).toBe("TokenExpiredError");
+ expect(err.message).toBe("jwt expired");
+ expect(err?.expiredAt?.constructor?.name).toBe("Date");
+ expect(Number(err.expiredAt)).toBe((clockTimestamp + 1) * 1000);
+ expect(p).toBeUndefined();
+ done();
+ });
+ });
+ it("should verify clockTimestamp is a number", function (done) {
+ const token = jwt.sign({ foo: "bar", iat: clockTimestamp, exp: clockTimestamp + 1 }, key);
+ jwt.verify(token, key, { clockTimestamp: "notANumber" }, function (err, p) {
+ expect(err).toBeDefined();
+ expect(err.name).toBe("JsonWebTokenError");
+ expect(err.message).toBe("clockTimestamp must be a number");
+ expect(p).toBeUndefined();
+ done();
+ });
+ });
+ });
+
+ describe("option: maxAge and clockTimestamp", function () {
+ // { foo: 'bar', iat: 1437018582, exp: 1437018800 } exp = iat + 218s
+ const token =
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJiYXIiLCJpYXQiOjE0MzcwMTg1ODIsImV4cCI6MTQzNzAxODgwMH0.AVOsNC7TiT-XVSpCpkwB1240izzCIJ33Lp07gjnXVpA";
+ it("cannot be more permissive than expiration", function (done) {
+ const clockTimestamp = 1437018900; // iat + 318s (exp: iat + 218s)
+ const options = { algorithms: ["HS256"], clockTimestamp: clockTimestamp, maxAge: "1000y" };
+
+ jwt.verify(token, key, options, function (err, p) {
+ // maxAge not exceded, but still expired
+ expect(err).toBeDefined();
+ expect(err.name).toBe("TokenExpiredError");
+ expect(err.message).toBe("jwt expired");
+ expect(err?.expiredAt?.constructor?.name).toBe("Date");
+ expect(Number(err.expiredAt)).toBe(1437018800000);
+ expect(p).toBeUndefined();
+ done();
+ });
+ });
+ });
+ });
+
+ describe.todo("when verifying a token with an unsupported public key type", function () {
+ it("should throw an error", function () {
+ const token =
+ "eyJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE2Njk5OTAwMDN9.YdjFWJtPg_9nccMnTfQyesWQ0UX-GsWrfCGit_HqjeIkNjoV6dkAJ8AtbnVEhA4oxwqSXx6ilMOfHEjmMlPtyyyVKkWKQHcIWYnqPbNSEv8a7Men8KhJTIWb4sf5YbhgSCpNvU_VIZjLO1Z0PzzgmEikp0vYbxZFAbCAlZCvUlcIc-kdjIRCnDJe0BBrYRxNLEJtYsf7D1yFIFIqw8-VP87yZdExA4eHsTaE84SgnL24ZK5h5UooDx-IRNd_rrMyio8kNy63grVxCWOtkXZ26iZk6v-HMsnBqxvUwR6-8wfaWrcpADkyUO1q3SNsoTdwtflbvfwgjo3uve0IvIzHMw";
+ const key = fs.readFileSync(path.join(__dirname, "dsa-public.pem"));
+
+ expect(function () {
+ jwt.verify(token, key);
+ }).toThrow('Unknown key type "dsa".');
+ });
+ });
+
+ describe("when verifying a token with an incorrect public key type", function () {
+ it("should throw a validation error if key validation is enabled", function () {
+ const token =
+ "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXkiOiJsb2FkIiwiaWF0IjoxNjcwMjMwNDE2fQ.7TYP8SB_9Tw1fNIfuG60b4tvoLPpDAVBQpV1oepnuKwjUz8GOw4fRLzclo0Q2YAXisJ3zIYMEFsHpYrflfoZJQ";
+ const key = fs.readFileSync(path.join(__dirname, "rsa-public.pem"));
+
+ expect(function () {
+ jwt.verify(token, key, { algorithms: ["ES256"] });
+ }).toThrow('"alg" parameter for "rsa" key type must be one of: RS256, PS256, RS384, PS384, RS512, PS512.');
+ });
+
+ it("should throw an unknown error if key validation is disabled", function () {
+ const token =
+ "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXkiOiJsb2FkIiwiaWF0IjoxNjcwMjMwNDE2fQ.7TYP8SB_9Tw1fNIfuG60b4tvoLPpDAVBQpV1oepnuKwjUz8GOw4fRLzclo0Q2YAXisJ3zIYMEFsHpYrflfoZJQ";
+ const key = fs.readFileSync(path.join(__dirname, "rsa-public.pem"));
+
+ expect(function () {
+ jwt.verify(token, key, { algorithms: ["ES256"], allowInvalidAsymmetricKeyTypes: true });
+ }).not.toThrow('"alg" parameter for "rsa" key type must be one of: RS256, PS256, RS384, PS384, RS512, PS512.');
+ });
+ });
+});
diff --git a/test/js/third_party/jsonwebtoken/wrong_alg.test.js b/test/js/third_party/jsonwebtoken/wrong_alg.test.js
new file mode 100644
index 000000000..948e467f9
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/wrong_alg.test.js
@@ -0,0 +1,49 @@
+var PS_SUPPORTED = true;
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+import path from "path";
+import fs from "fs";
+
+var pub = fs.readFileSync(path.join(__dirname, "pub.pem"), "utf8");
+// priv is never used
+// var priv = fs.readFileSync(path.join(__dirname, 'priv.pem'));
+
+var TOKEN =
+ "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJiYXIiLCJpYXQiOjE0MjY1NDY5MTl9.ETgkTn8BaxIX4YqvUWVFPmum3moNZ7oARZtSBXb_vP4";
+
+describe("when setting a wrong `header.alg`", function () {
+ describe("signing with pub key as symmetric", function () {
+ it("should not verify", function () {
+ expect(function () {
+ jwt.verify(TOKEN, pub);
+ }).toThrow(/invalid algorithm/);
+ });
+ });
+
+ describe("signing with pub key as HS256 and whitelisting only RS256", function () {
+ it("should not verify", function () {
+ expect(function () {
+ jwt.verify(TOKEN, pub, { algorithms: ["RS256"] });
+ }).toThrow(/invalid algorithm/);
+ });
+ });
+
+ if (PS_SUPPORTED) {
+ describe("signing with pub key as HS256 and whitelisting only PS256", function () {
+ it("should not verify", function () {
+ expect(function () {
+ jwt.verify(TOKEN, pub, { algorithms: ["PS256"] });
+ }).toThrow(/invalid algorithm/);
+ });
+ });
+ }
+
+ describe("signing with HS256 and checking with HS384", function () {
+ it("should not verify", function () {
+ expect(function () {
+ var token = jwt.sign({ foo: "bar" }, "secret", { algorithm: "HS256" });
+ jwt.verify(token, "some secret", { algorithms: ["HS384"] });
+ }).toThrow(/invalid algorithm/);
+ });
+ });
+});
diff --git a/test/js/third_party/mongodb/mongodb.test.ts b/test/js/third_party/mongodb/mongodb.test.ts
new file mode 100644
index 000000000..da0a089cf
--- /dev/null
+++ b/test/js/third_party/mongodb/mongodb.test.ts
@@ -0,0 +1,29 @@
+import { test, expect, describe } from "bun:test";
+import { MongoClient } from "mongodb";
+
+const CONNECTION_STRING = process.env.TLS_MONGODB_DATABASE_URL;
+
+const it = CONNECTION_STRING ? test : test.skip;
+
+describe("mongodb", () => {
+ it("should connect and inpect", async () => {
+ const client = new MongoClient(CONNECTION_STRING as string);
+
+ const clientConnection = await client.connect();
+
+ try {
+ const db = client.db("bun");
+
+ const schema = db.collection("bun");
+
+ await schema.insertOne({ name: "bunny", version: 1.0 });
+ const result = await schema.find();
+ await schema.deleteOne({ name: "bunny" });
+ const text = Bun.inspect(result);
+
+ expect(text).toBeDefined();
+ } finally {
+ await clientConnection.close();
+ }
+ });
+});
diff --git a/test/js/third_party/mongodb/package.json b/test/js/third_party/mongodb/package.json
new file mode 100644
index 000000000..b7cdb0b5c
--- /dev/null
+++ b/test/js/third_party/mongodb/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "mongodb",
+ "dependencies": {
+ "mongodb": "6.0.0"
+ }
+}
diff --git a/test/js/third_party/postgres/postgres.test.ts b/test/js/third_party/postgres/postgres.test.ts
index 758fee778..991c85d88 100644
--- a/test/js/third_party/postgres/postgres.test.ts
+++ b/test/js/third_party/postgres/postgres.test.ts
@@ -1,5 +1,5 @@
import { test, expect, describe } from "bun:test";
-import { Pool } from "pg";
+import { Pool, Client } from "pg";
import { parse } from "pg-connection-string";
import postgres from "postgres";
@@ -19,6 +19,18 @@ describe("pg", () => {
pool.end();
}
});
+
+ it("should execute big query and end connection", async () => {
+ const client = new Client({
+ connectionString: CONNECTION_STRING,
+ ssl: { rejectUnauthorized: false },
+ });
+
+ await client.connect();
+ const res = await client.query(`SELECT * FROM users LIMIT 1000`);
+ expect(res.rows.length).toBeGreaterThanOrEqual(300);
+ await client.end();
+ }, 5000);
});
describe("postgres", () => {
diff --git a/test/js/third_party/prisma/bun.lockb b/test/js/third_party/prisma/bun.lockb
new file mode 100755
index 000000000..65d0238e5
--- /dev/null
+++ b/test/js/third_party/prisma/bun.lockb
Binary files differ
diff --git a/test/js/third_party/prompts/prompts.js b/test/js/third_party/prompts/prompts.js
new file mode 100644
index 000000000..bf96ba26e
--- /dev/null
+++ b/test/js/third_party/prompts/prompts.js
@@ -0,0 +1,25 @@
+import prompt from "prompts";
+
+const questions = [
+ {
+ type: "text",
+ name: "twitter",
+ message: `What's your twitter handle?`,
+ format: v => `@${v}`,
+ },
+ {
+ type: "number",
+ name: "age",
+ message: "How old are you?",
+ validate: value => (value < 18 ? `Sorry, you have to be 18` : true),
+ },
+ {
+ type: "password",
+ name: "secret",
+ message: "Tell me a secret",
+ },
+];
+
+const answers = await prompt(questions);
+
+console.log(answers);
diff --git a/test/js/third_party/prompts/prompts.test.ts b/test/js/third_party/prompts/prompts.test.ts
new file mode 100644
index 000000000..7e052fa6d
--- /dev/null
+++ b/test/js/third_party/prompts/prompts.test.ts
@@ -0,0 +1,27 @@
+import path from "path";
+import { bunExe, bunEnv } from "harness";
+
+test("works with prompts", async () => {
+ var child = Bun.spawn({
+ cmd: [bunExe(), path.join(import.meta.dir, "prompts.js")],
+ env: bunEnv,
+ stdout: "pipe",
+ stdin: "pipe",
+ });
+
+ child.stdin.write("dylan\n");
+ Bun.sleepSync(100);
+ child.stdin.write("999\n");
+ Bun.sleepSync(100);
+ child.stdin.write("hi\n");
+ expect(await child.exited).toBe(0);
+
+ var out = "";
+ for await (const chunk of child.stdout) {
+ out += new TextDecoder().decode(chunk);
+ }
+
+ expect(out).toContain('twitter: "@dylan"');
+ expect(out).toContain("age: 999");
+ expect(out).toContain('secret: "hi"');
+});
diff --git a/test/js/third_party/yargs/bun.lockb b/test/js/third_party/yargs/bun.lockb
new file mode 100755
index 000000000..6b527d00f
--- /dev/null
+++ b/test/js/third_party/yargs/bun.lockb
Binary files differ
diff --git a/test/js/third_party/yargs/package.json b/test/js/third_party/yargs/package.json
new file mode 100644
index 000000000..dd7ab02b0
--- /dev/null
+++ b/test/js/third_party/yargs/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "yargs-test",
+ "version": "1.0.0",
+ "dependencies": {
+ "yargs": "17.7.2"
+ }
+}
diff --git a/test/js/third_party/yargs/yargs-cjs.test.js b/test/js/third_party/yargs/yargs-cjs.test.js
new file mode 100644
index 000000000..06e4d9cb8
--- /dev/null
+++ b/test/js/third_party/yargs/yargs-cjs.test.js
@@ -0,0 +1,4 @@
+test("yargs/yargs works", () => {
+ const yargs = require("yargs/yargs");
+ expect(yargs).toBeFunction();
+});
diff --git a/test/js/web/abort/abort.signal.ts b/test/js/web/abort/abort.signal.ts
new file mode 100644
index 000000000..da402f637
--- /dev/null
+++ b/test/js/web/abort/abort.signal.ts
@@ -0,0 +1,24 @@
+import type { Server } from "bun";
+
+const server = Bun.serve({
+ port: 0,
+ async fetch() {
+ const signal = AbortSignal.timeout(1);
+ return await fetch("https://bun.sh", { signal });
+ },
+});
+
+function hostname(server: Server) {
+ if (server.hostname.startsWith(":")) return `[${server.hostname}]`;
+ return server.hostname;
+}
+
+let url = `http://${hostname(server)}:${server.port}/`;
+
+const responses: Response[] = [];
+for (let i = 0; i < 10; i++) {
+ responses.push(await fetch(url));
+}
+server.stop(true);
+// we fail if any of the requests succeeded
+process.exit(responses.every(res => res.status === 500) ? 0 : 1);
diff --git a/test/js/web/abort/abort.test.ts b/test/js/web/abort/abort.test.ts
index 4895e0d13..ef0b07a18 100644
--- a/test/js/web/abort/abort.test.ts
+++ b/test/js/web/abort/abort.test.ts
@@ -18,4 +18,25 @@ describe("AbortSignal", () => {
expect(stderr?.toString()).not.toContain("✗");
});
+
+ test("AbortSignal.timeout(n) should not freeze the process", async () => {
+ const fileName = join(import.meta.dir, "abort.signal.ts");
+
+ const server = Bun.spawn({
+ cmd: [bunExe(), fileName],
+ env: bunEnv,
+ cwd: tmpdir(),
+ });
+
+ const exitCode = await Promise.race([
+ server.exited,
+ (async () => {
+ await Bun.sleep(5000);
+ server.kill();
+ return 2;
+ })(),
+ ]);
+
+ expect(exitCode).toBe(0);
+ });
});
diff --git a/test/js/web/confirm-fixture.js b/test/js/web/confirm-fixture.js
new file mode 100644
index 000000000..908570bce
--- /dev/null
+++ b/test/js/web/confirm-fixture.js
@@ -0,0 +1,3 @@
+const result = confirm("What is your answer?");
+
+console.error(result ? "Yes" : "No");
diff --git a/test/js/web/console/console-log.expected.txt b/test/js/web/console/console-log.expected.txt
index 332322665..39db03722 100644
--- a/test/js/web/console/console-log.expected.txt
+++ b/test/js/web/console/console-log.expected.txt
@@ -35,7 +35,7 @@ Promise { <pending> }
[Function]
[Function]
[class Foo]
-[class]
+[class (anonymous)]
{}
[Function: foooo]
/FooRegex/
@@ -50,3 +50,28 @@ String 123 should be 2nd word, 456 == 456 and percent s %s == What okay
[
{}, {}, {}, {}
]
+{
+ level1: {
+ level2: {
+ level3: [Object ...]
+ }
+ }
+}
+{
+ "1": [Object ...]
+}
+{
+ "1": [Object ...]
+}
+{
+ "1": {
+ "2": [Object ...]
+ }
+}
+{
+ "1": {
+ "2": {
+ "3": 3
+ }
+ }
+}
diff --git a/test/js/web/console/console-log.js b/test/js/web/console/console-log.js
index 4db40aaac..95f419781 100644
--- a/test/js/web/console/console-log.js
+++ b/test/js/web/console/console-log.js
@@ -58,3 +58,21 @@ infinteLoop.bar = infinteLoop;
console.log(infinteLoop, "am");
console.log(new Array(4).fill({}));
+const nestedObject = {
+ level1: {
+ level2: {
+ level3: {
+ level4: {
+ level5: {
+ name: "Deeply nested object",
+ },
+ },
+ },
+ },
+ },
+};
+console.log(nestedObject);
+console.dir({ 1: { 2: { 3: 3 } } }, { depth: 0, colors: false }, "Some ignored arg");
+console.dir({ 1: { 2: { 3: 3 } } }, { depth: -1, colors: false }, "Some ignored arg");
+console.dir({ 1: { 2: { 3: 3 } } }, { depth: 1.2, colors: false }, "Some ignored arg");
+console.dir({ 1: { 2: { 3: 3 } } }, { depth: Infinity, colors: false }, "Some ignored arg");
diff --git a/test/js/web/encoding/text-decoder.test.js b/test/js/web/encoding/text-decoder.test.js
index 4991cf361..3685a5f6d 100644
--- a/test/js/web/encoding/text-decoder.test.js
+++ b/test/js/web/encoding/text-decoder.test.js
@@ -250,7 +250,7 @@ describe("TextDecoder", () => {
it("constructor should set values", () => {
const decoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: false });
expect(decoder.fatal).toBe(true);
- // expect(decoder.ignoreBOM).toBe(false); // currently the getter for ignoreBOM doesn't work and always returns undefined
+ expect(decoder.ignoreBOM).toBe(false);
});
it("should throw on invalid input", () => {
@@ -258,6 +258,33 @@ describe("TextDecoder", () => {
const decoder = new TextDecoder("utf-8", { fatal: 10, ignoreBOM: {} });
}).toThrow();
});
+
+ it("should support undifined", () => {
+ const decoder = new TextDecoder(undefined);
+ expect(decoder.encoding).toBe("utf-8");
+ });
+});
+
+describe("TextDecoder ignoreBOM", () => {
+ it.each([
+ {
+ encoding: "utf-8",
+ bytes: [0xef, 0xbb, 0xbf, 0x61, 0x62, 0x63],
+ },
+ {
+ encoding: "utf-16le",
+ bytes: [0xff, 0xfe, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00],
+ },
+ ])("should ignoreBOM for: %o", ({ encoding, bytes }) => {
+ const BOM = "\uFEFF";
+ const array = new Uint8Array(bytes);
+
+ const decoder_ignore_bom = new TextDecoder(encoding, { ignoreBOM: true });
+ expect(decoder_ignore_bom.decode(array)).toStrictEqual(`${BOM}abc`);
+
+ const decoder_not_ignore_bom = new TextDecoder(encoding, { ignoreBOM: false });
+ expect(decoder_not_ignore_bom.decode(array)).toStrictEqual("abc");
+ });
});
it("truncated sequences", () => {
diff --git a/test/js/web/encoding/text-encoder.test.js b/test/js/web/encoding/text-encoder.test.js
index 1bf2057bc..78940a6eb 100644
--- a/test/js/web/encoding/text-encoder.test.js
+++ b/test/js/web/encoding/text-encoder.test.js
@@ -111,7 +111,7 @@ describe("TextEncoder", () => {
const fixture = new Uint8Array(await Bun.file(import.meta.dir + "/utf8-encoding-fixture.bin").arrayBuffer());
const length = 0x110000;
let textEncoder = new TextEncoder();
- let textDecoder = new TextDecoder();
+ let textDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
let encodeOut = new Uint8Array(length * 4);
let encodeIntoOut = new Uint8Array(length * 4);
let encodeIntoBuffer = new Uint8Array(4);
diff --git a/test/js/web/fetch/blob.test.ts b/test/js/web/fetch/blob.test.ts
index ba44f8c1b..ea8d86a7a 100644
--- a/test/js/web/fetch/blob.test.ts
+++ b/test/js/web/fetch/blob.test.ts
@@ -1,6 +1,6 @@
import { test, expect } from "bun:test";
-test("Blob.slice", () => {
+test("Blob.slice", async () => {
const blob = new Blob(["Bun", "Foo"]);
const b1 = blob.slice(0, 3, "Text/HTML");
expect(b1 instanceof Blob).toBeTruthy();
@@ -26,6 +26,33 @@ test("Blob.slice", () => {
expect(blob.slice(null, "-123").size).toBe(6);
expect(blob.slice(0, 10).size).toBe(blob.size);
expect(blob.slice("text/plain;charset=utf-8").type).toBe("text/plain;charset=utf-8");
+
+ // test Blob.slice().slice(), issue#6252
+ expect(await blob.slice(0, 4).slice(0, 3).text()).toBe("Bun");
+ expect(await blob.slice(0, 4).slice(1, 3).text()).toBe("un");
+ expect(await blob.slice(1, 4).slice(0, 3).text()).toBe("unF");
+ expect(await blob.slice(1, 4).slice(1, 3).text()).toBe("nF");
+ expect(await blob.slice(1, 4).slice(2, 3).text()).toBe("F");
+ expect(await blob.slice(1, 4).slice(3, 3).text()).toBe("");
+ expect(await blob.slice(1, 4).slice(4, 3).text()).toBe("");
+ // test negative start
+ expect(await blob.slice(1, 4).slice(-1, 3).text()).toBe("F");
+ expect(await blob.slice(1, 4).slice(-2, 3).text()).toBe("nF");
+ expect(await blob.slice(1, 4).slice(-3, 3).text()).toBe("unF");
+ expect(await blob.slice(1, 4).slice(-4, 3).text()).toBe("unF");
+ expect(await blob.slice(1, 4).slice(-5, 3).text()).toBe("unF");
+ expect(await blob.slice(-1, 4).slice(-1, 3).text()).toBe("");
+ expect(await blob.slice(-2, 4).slice(-1, 3).text()).toBe("");
+ expect(await blob.slice(-3, 4).slice(-1, 3).text()).toBe("F");
+ expect(await blob.slice(-4, 4).slice(-1, 3).text()).toBe("F");
+ expect(await blob.slice(-5, 4).slice(-1, 3).text()).toBe("F");
+ expect(await blob.slice(-5, 4).slice(-2, 3).text()).toBe("nF");
+ expect(await blob.slice(-5, 4).slice(-3, 3).text()).toBe("unF");
+ expect(await blob.slice(-5, 4).slice(-4, 3).text()).toBe("unF");
+ expect(await blob.slice(-4, 4).slice(-3, 3).text()).toBe("nF");
+ expect(await blob.slice(-5, 4).slice(-4, 3).text()).toBe("unF");
+ expect(await blob.slice(-3, 4).slice(-2, 3).text()).toBe("F");
+ expect(await blob.slice(-blob.size, 4).slice(-blob.size, 3).text()).toBe("Bun");
});
test("new Blob", () => {
diff --git a/test/js/web/fetch/body-stream.test.ts b/test/js/web/fetch/body-stream.test.ts
index 8e2baf92a..8f7675528 100644
--- a/test/js/web/fetch/body-stream.test.ts
+++ b/test/js/web/fetch/body-stream.test.ts
@@ -13,6 +13,35 @@ var port = 0;
];
const useRequestObjectValues = [true, false];
+ test("Should not crash when not returning a promise when stream is in progress", async () => {
+ var called = false;
+ await runInServer(
+ {
+ async fetch() {
+ var stream = new ReadableStream({
+ type: "direct",
+ pull(controller) {
+ controller.write("hey");
+ setTimeout(() => {
+ controller.end();
+ }, 100);
+ },
+ });
+
+ return new Response(stream);
+ },
+ },
+ async url => {
+ called = true;
+ expect(await fetch(url).then(res => res.text())).toContain(
+ "Welcome to Bun! To get started, return a Response object.",
+ );
+ },
+ );
+
+ expect(called).toBe(true);
+ });
+
for (let RequestPrototypeMixin of BodyMixin) {
for (let useRequestObject of useRequestObjectValues) {
describe(`Request.prototoype.${RequestPrototypeMixin.name}() ${
diff --git a/test/js/web/fetch/fetch.stream.test.ts b/test/js/web/fetch/fetch.stream.test.ts
index 98271ee79..cc518e397 100644
--- a/test/js/web/fetch/fetch.stream.test.ts
+++ b/test/js/web/fetch/fetch.stream.test.ts
@@ -28,6 +28,142 @@ const smallText = Buffer.from("Hello".repeat(16));
const empty = Buffer.alloc(0);
describe("fetch() with streaming", () => {
+ it(`should be able to fail properly when reading from readable stream`, async () => {
+ let server: Server | null = null;
+ try {
+ server = Bun.serve({
+ port: 0,
+ async fetch(req) {
+ return new Response(
+ new ReadableStream({
+ async start(controller) {
+ controller.enqueue("Hello, World!");
+ await Bun.sleep(1000);
+ controller.enqueue("Hello, World!");
+ controller.close();
+ },
+ }),
+ {
+ status: 200,
+ headers: {
+ "Content-Type": "text/plain",
+ },
+ },
+ );
+ },
+ });
+
+ const server_url = `http://${server.hostname}:${server.port}`;
+ try {
+ const res = await fetch(server_url, { signal: AbortSignal.timeout(20) });
+ const reader = res.body?.getReader();
+ while (true) {
+ const { done } = await reader?.read();
+ if (done) break;
+ }
+ expect(true).toBe("unreachable");
+ } catch (err: any) {
+ if (err.name !== "TimeoutError") throw err;
+ expect(err.message).toBe("The operation timed out.");
+ }
+ } finally {
+ server?.stop();
+ }
+ });
+
+ it(`should be locked after start buffering`, async () => {
+ let server: Server | null = null;
+ try {
+ server = Bun.serve({
+ port: 0,
+ fetch(req) {
+ return new Response(
+ new ReadableStream({
+ async start(controller) {
+ controller.enqueue("Hello, World!");
+ await Bun.sleep(10);
+ controller.enqueue("Hello, World!");
+ await Bun.sleep(10);
+ controller.enqueue("Hello, World!");
+ await Bun.sleep(10);
+ controller.enqueue("Hello, World!");
+ await Bun.sleep(10);
+ controller.close();
+ },
+ }),
+ {
+ status: 200,
+ headers: {
+ "Content-Type": "text/plain",
+ },
+ },
+ );
+ },
+ });
+
+ const server_url = `http://${server.hostname}:${server.port}`;
+ const res = await fetch(server_url);
+ try {
+ const promise = res.text(); // start buffering
+ res.body?.getReader(); // get a reader
+ const result = await promise; // should throw the right error
+ expect(result).toBe("unreachable");
+ } catch (err: any) {
+ if (err.name !== "TypeError") throw err;
+ expect(err.message).toBe("ReadableStream is locked");
+ }
+ } finally {
+ server?.stop();
+ }
+ });
+
+ it(`should be locked after start buffering when calling getReader`, async () => {
+ let server: Server | null = null;
+ try {
+ server = Bun.serve({
+ port: 0,
+ fetch(req) {
+ return new Response(
+ new ReadableStream({
+ async start(controller) {
+ controller.enqueue("Hello, World!");
+ await Bun.sleep(10);
+ controller.enqueue("Hello, World!");
+ await Bun.sleep(10);
+ controller.enqueue("Hello, World!");
+ await Bun.sleep(10);
+ controller.enqueue("Hello, World!");
+ await Bun.sleep(10);
+ controller.close();
+ },
+ }),
+ {
+ status: 200,
+ headers: {
+ "Content-Type": "text/plain",
+ },
+ },
+ );
+ },
+ });
+
+ const server_url = `http://${server.hostname}:${server.port}`;
+ const res = await fetch(server_url);
+ try {
+ const body = res.body as ReadableStream<Uint8Array>;
+ const promise = res.text(); // start buffering
+ body.getReader(); // get a reader
+ const result = await promise; // should throw the right error
+ expect(result).toBe("unreachable");
+ } catch (err: any) {
+ if (err.name !== "TypeError") throw err;
+ expect(err.message).toBe("ReadableStream is locked");
+ }
+ } finally {
+ server?.stop();
+ }
+ });
+
it("can deflate with and without headers #4478", async () => {
let server: Server | null = null;
try {
@@ -77,7 +213,12 @@ describe("fetch() with streaming", () => {
.listen(0);
const address = server.address() as AddressInfo;
- const url = `http://${address.address}:${address.port}`;
+ let url;
+ if (address.family == "IPv4") {
+ url = `http://${address.address}:${address.port}`;
+ } else {
+ url = `http://[${address.address}]:${address.port}`;
+ }
async function getRequestLen(url: string) {
const response = await fetch(url);
const hasBody = response.body;
diff --git a/test/js/web/fetch/fetch.test.ts b/test/js/web/fetch/fetch.test.ts
index aa44ee76a..3ed20345b 100644
--- a/test/js/web/fetch/fetch.test.ts
+++ b/test/js/web/fetch/fetch.test.ts
@@ -3,8 +3,10 @@ import { afterAll, afterEach, beforeAll, describe, expect, it, beforeEach } from
import { chmodSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from "fs";
import { mkfifo } from "mkfifo";
import { tmpdir } from "os";
+import { gzipSync } from "zlib";
import { join } from "path";
import { gc, withoutAggressiveGC, gcTick } from "harness";
+import net from "net";
const tmp_dir = mkdtempSync(join(realpathSync(tmpdir()), "fetch.test"));
@@ -93,6 +95,30 @@ describe("fetch data urls", () => {
expect(blob.type).toBe("text/plain;charset=utf-8");
expect(blob.text()).resolves.toBe("helloworld!");
});
+ it("unstrict parsing of invalid URL characters", async () => {
+ var url = "data:application/json,{%7B%7D}";
+ var res = await fetch(url);
+ expect(res.status).toBe(200);
+ expect(res.statusText).toBe("OK");
+ expect(res.ok).toBe(true);
+
+ var blob = await res.blob();
+ expect(blob.size).toBe(4);
+ expect(blob.type).toBe("application/json;charset=utf-8");
+ expect(blob.text()).resolves.toBe("{{}}");
+ });
+ it("unstrict parsing of double percent characters", async () => {
+ var url = "data:application/json,{%%7B%7D%%}%%";
+ var res = await fetch(url);
+ expect(res.status).toBe(200);
+ expect(res.statusText).toBe("OK");
+ expect(res.ok).toBe(true);
+
+ var blob = await res.blob();
+ expect(blob.size).toBe(9);
+ expect(blob.type).toBe("application/json;charset=utf-8");
+ expect(blob.text()).resolves.toBe("{%{}%%}%%");
+ });
it("data url (invalid)", async () => {
var url = "data:Hello%2C%20World!";
expect(async () => {
@@ -321,6 +347,27 @@ describe("Headers", () => {
expect(headers.getAll("set-cookie")).toEqual(["foo=bar; Path=/; HttpOnly"]);
});
+ it("presence of content-encoding header(issue #5668)", async () => {
+ startServer({
+ fetch(req) {
+ const content = gzipSync(JSON.stringify({ message: "Hello world" }));
+ return new Response(content, {
+ status: 200,
+ headers: {
+ "content-encoding": "gzip",
+ "content-type": "application/json",
+ },
+ });
+ },
+ });
+ const result = await fetch(`http://${server.hostname}:${server.port}/`);
+ const value = result.headers.get("content-encoding");
+ const body = await result.json();
+ expect(value).toBe("gzip");
+ expect(body).toBeDefined();
+ expect(body.message).toBe("Hello world");
+ });
+
it(".getSetCookie() with array", () => {
const headers = new Headers([
["content-length", "123"],
@@ -1216,6 +1263,16 @@ describe("Request", () => {
expect(req.signal.aborted).toBe(true);
});
+ it("copies method (#6144)", () => {
+ const request = new Request("http://localhost:1337/test", {
+ method: "POST",
+ });
+ const new_req = new Request(request, {
+ body: JSON.stringify({ message: "Hello world" }),
+ });
+ expect(new_req.method).toBe("POST");
+ });
+
it("cloned signal", async () => {
gc();
const controller = new AbortController();
@@ -1391,3 +1448,371 @@ it("cloned response headers are independent after accessing", () => {
cloned.headers.set("content-type", "text/plain");
expect(response.headers.get("content-type")).toBe("text/html; charset=utf-8");
});
+
+it("should work with http 100 continue", async () => {
+ let server: net.Server | undefined;
+ try {
+ server = net.createServer(socket => {
+ socket.on("data", data => {
+ const lines = data.toString().split("\r\n");
+ for (const line of lines) {
+ if (line.length == 0) {
+ socket.write("HTTP/1.1 100 Continue\r\n\r\n");
+ socket.write("HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 13\r\n\r\nHello, World!");
+ break;
+ }
+ }
+ });
+ });
+
+ const { promise: start, resolve } = Promise.withResolvers();
+ server.listen(8080, resolve);
+
+ await start;
+
+ const address = server.address() as net.AddressInfo;
+ const result = await fetch(`http://localhost:${address.port}`).then(r => r.text());
+ expect(result).toBe("Hello, World!");
+ } finally {
+ server?.close();
+ }
+});
+
+it("should work with http 100 continue on the same buffer", async () => {
+ let server: net.Server | undefined;
+ try {
+ server = net.createServer(socket => {
+ socket.on("data", data => {
+ const lines = data.toString().split("\r\n");
+ for (const line of lines) {
+ if (line.length == 0) {
+ socket.write(
+ "HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 13\r\n\r\nHello, World!",
+ );
+ break;
+ }
+ }
+ });
+ });
+
+ const { promise: start, resolve } = Promise.withResolvers();
+ server.listen(8080, resolve);
+
+ await start;
+
+ const address = server.address() as net.AddressInfo;
+ const result = await fetch(`http://localhost:${address.port}`).then(r => r.text());
+ expect(result).toBe("Hello, World!");
+ } finally {
+ server?.close();
+ }
+});
+
+describe("should strip headers", () => {
+ it("status code 303", async () => {
+ const server = Bun.serve({
+ port: 0,
+ async fetch(request: Request) {
+ if (request.url.endsWith("/redirect")) {
+ return new Response("hello", {
+ headers: {
+ ...request.headers,
+ "Location": "/redirected",
+ },
+ status: 303,
+ });
+ }
+
+ return new Response("hello", {
+ headers: request.headers,
+ });
+ },
+ });
+
+ const { headers, url, redirected } = await fetch(`http://${server.hostname}:${server.port}/redirect`, {
+ method: "POST",
+ headers: {
+ "I-Am-Here": "yes",
+ "Content-Language": "This should be stripped",
+ },
+ });
+
+ expect(headers.get("I-Am-Here")).toBe("yes");
+ expect(headers.get("Content-Language")).toBeNull();
+ expect(url).toEndWith("/redirected");
+ expect(redirected).toBe(true);
+ server.stop(true);
+ });
+
+ it("cross-origin status code 302", async () => {
+ const server1 = Bun.serve({
+ port: 0,
+ async fetch(request: Request) {
+ if (request.url.endsWith("/redirect")) {
+ return new Response("hello", {
+ headers: {
+ ...request.headers,
+ "Location": `http://${server2.hostname}:${server2.port}/redirected`,
+ },
+ status: 302,
+ });
+ }
+
+ return new Response("hello", {
+ headers: request.headers,
+ });
+ },
+ });
+
+ const server2 = Bun.serve({
+ port: 0,
+ async fetch(request: Request, server) {
+ if (request.url.endsWith("/redirect")) {
+ return new Response("hello", {
+ headers: {
+ ...request.headers,
+ "Location": `http://${server.hostname}:${server.port}/redirected`,
+ },
+ status: 302,
+ });
+ }
+
+ return new Response("hello", {
+ headers: request.headers,
+ });
+ },
+ });
+
+ const { headers, url, redirected } = await fetch(`http://${server1.hostname}:${server1.port}/redirect`, {
+ method: "GET",
+ headers: {
+ "Authorization": "yes",
+ },
+ });
+
+ expect(headers.get("Authorization")).toBeNull();
+ expect(url).toEndWith("/redirected");
+ expect(redirected).toBe(true);
+ server1.stop(true);
+ server2.stop(true);
+ });
+});
+
+it("same-origin status code 302 should not strip headers", async () => {
+ const server = Bun.serve({
+ port: 0,
+ async fetch(request: Request, server) {
+ if (request.url.endsWith("/redirect")) {
+ return new Response("hello", {
+ headers: {
+ ...request.headers,
+ "Location": `http://${server.hostname}:${server.port}/redirected`,
+ },
+ status: 302,
+ });
+ }
+
+ return new Response("hello", {
+ headers: request.headers,
+ });
+ },
+ });
+
+ const { headers, url, redirected } = await fetch(`http://${server.hostname}:${server.port}/redirect`, {
+ method: "GET",
+ headers: {
+ "Authorization": "yes",
+ },
+ });
+
+ expect(headers.get("Authorization")).toEqual("yes");
+ expect(url).toEndWith("/redirected");
+ expect(redirected).toBe(true);
+ server.stop(true);
+});
+
+describe("should handle relative location in the redirect, issue#5635", () => {
+ var server: Server;
+ beforeAll(async () => {
+ server = Bun.serve({
+ port: 0,
+ async fetch(request: Request) {
+ return new Response("Not Found", {
+ status: 404,
+ });
+ },
+ });
+ });
+ afterAll(() => {
+ server.stop(true);
+ });
+
+ it.each([
+ ["/a/b", "/c", "/c"],
+ ["/a/b", "c", "/a/c"],
+ ["/a/b", "/c/d", "/c/d"],
+ ["/a/b", "c/d", "/a/c/d"],
+ ["/a/b", "../c", "/c"],
+ ["/a/b", "../c/d", "/c/d"],
+ ["/a/b", "../../../c", "/c"],
+ // slash
+ ["/a/b/", "/c", "/c"],
+ ["/a/b/", "c", "/a/b/c"],
+ ["/a/b/", "/c/d", "/c/d"],
+ ["/a/b/", "c/d", "/a/b/c/d"],
+ ["/a/b/", "../c", "/a/c"],
+ ["/a/b/", "../c/d", "/a/c/d"],
+ ["/a/b/", "../../../c", "/c"],
+ ])("('%s', '%s')", async (pathname, location, expected) => {
+ server.reload({
+ async fetch(request: Request) {
+ const url = new URL(request.url);
+ if (url.pathname == pathname) {
+ return new Response("redirecting", {
+ headers: {
+ "Location": location,
+ },
+ status: 302,
+ });
+ } else if (url.pathname == expected) {
+ return new Response("Fine.");
+ }
+ return new Response("Not Found", {
+ status: 404,
+ });
+ },
+ });
+
+ const resp = await fetch(`http://${server.hostname}:${server.port}${pathname}`);
+ expect(resp.redirected).toBe(true);
+ expect(new URL(resp.url).pathname).toStrictEqual(expected);
+ expect(resp.status).toBe(200);
+ expect(await resp.text()).toBe("Fine.");
+ });
+});
+
+it("should throw RedirectURLTooLong when location is too long", async () => {
+ const server = Bun.serve({
+ port: 0,
+ async fetch(request: Request) {
+ gc();
+ const url = new URL(request.url);
+ if (url.pathname == "/redirect") {
+ return new Response("redirecting", {
+ headers: {
+ "Location": "B".repeat(8193),
+ },
+ status: 302,
+ });
+ }
+ return new Response("Not Found", {
+ status: 404,
+ });
+ },
+ });
+
+ let err = undefined;
+ try {
+ gc();
+ const resp = await fetch(`http://${server.hostname}:${server.port}/redirect`);
+ } catch (error) {
+ gc();
+ err = error;
+ }
+ expect(err).not.toBeUndefined();
+ expect(err).toBeInstanceOf(Error);
+ expect(err.code).toStrictEqual("RedirectURLTooLong");
+ server.stop(true);
+});
+
+it("304 not modified with missing content-length does not cause a request timeout", async () => {
+ const server = await Bun.listen({
+ socket: {
+ open(socket) {
+ socket.write("HTTP/1.1 304 Not Modified\r\n\r\n");
+ socket.flush();
+ setTimeout(() => {
+ socket.end();
+ }, 9999).unref();
+ },
+ data() {},
+ close() {},
+ },
+ port: 0,
+ hostname: "localhost",
+ });
+
+ const response = await fetch(`http://${server.hostname}:${server.port}/`);
+ expect(response.status).toBe(304);
+ expect(await response.arrayBuffer()).toHaveLength(0);
+ server.stop(true);
+});
+
+it("304 not modified with missing content-length and connection close does not cause a request timeout", async () => {
+ const server = await Bun.listen({
+ socket: {
+ open(socket) {
+ socket.write("HTTP/1.1 304 Not Modified\r\nConnection: close\r\n\r\n");
+ socket.flush();
+ setTimeout(() => {
+ socket.end();
+ }, 9999).unref();
+ },
+ data() {},
+ close() {},
+ },
+ port: 0,
+ hostname: "localhost",
+ });
+
+ const response = await fetch(`http://${server.hostname}:${server.port}/`);
+ expect(response.status).toBe(304);
+ expect(await response.arrayBuffer()).toHaveLength(0);
+ server.stop(true);
+});
+
+it("304 not modified with content-length 0 and connection close does not cause a request timeout", async () => {
+ const server = await Bun.listen({
+ socket: {
+ open(socket) {
+ socket.write("HTTP/1.1 304 Not Modified\r\nConnection: close\r\nContent-Length: 0\r\n\r\n");
+ socket.flush();
+ setTimeout(() => {
+ socket.end();
+ }, 9999).unref();
+ },
+ data() {},
+ close() {},
+ },
+ port: 0,
+ hostname: "localhost",
+ });
+
+ const response = await fetch(`http://${server.hostname}:${server.port}/`);
+ expect(response.status).toBe(304);
+ expect(await response.arrayBuffer()).toHaveLength(0);
+ server.stop(true);
+});
+
+it("304 not modified with 0 content-length does not cause a request timeout", async () => {
+ const server = await Bun.listen({
+ socket: {
+ open(socket) {
+ socket.write("HTTP/1.1 304 Not Modified\r\nContent-Length: 0\r\n\r\n");
+ socket.flush();
+ setTimeout(() => {
+ socket.end();
+ }, 9999).unref();
+ },
+ data() {},
+ close() {},
+ },
+ port: 0,
+ hostname: "localhost",
+ });
+
+ const response = await fetch(`http://${server.hostname}:${server.port}/`);
+ expect(response.status).toBe(304);
+ expect(await response.arrayBuffer()).toHaveLength(0);
+ server.stop(true);
+});
diff --git a/test/js/web/fetch/response.test.ts b/test/js/web/fetch/response.test.ts
new file mode 100644
index 000000000..ddfcd70f7
--- /dev/null
+++ b/test/js/web/fetch/response.test.ts
@@ -0,0 +1,32 @@
+import { describe, test, expect } from "bun:test";
+
+test("zero args returns an otherwise empty 200 response", () => {
+ const response = new Response();
+ expect(response.status).toBe(200);
+ expect(response.statusText).toBe("");
+});
+
+test("1-arg form returns a 200 response", () => {
+ const response = new Response("body text");
+
+ expect(response.status).toBe(200);
+ expect(response.statusText).toBe("");
+});
+
+describe("2-arg form", () => {
+ test("can fill in status/statusText, and it works", () => {
+ const response = new Response("body text", {
+ status: 202,
+ statusText: "Accepted.",
+ });
+
+ expect(response.status).toBe(202);
+ expect(response.statusText).toBe("Accepted.");
+ });
+ test('empty object continues to return 200/""', () => {
+ const response = new Response("body text", {});
+
+ expect(response.status).toBe(200);
+ expect(response.statusText).toBe("");
+ });
+});
diff --git a/test/js/web/html/URLSearchParams.test.ts b/test/js/web/html/URLSearchParams.test.ts
index a948af821..6de1e6be2 100644
--- a/test/js/web/html/URLSearchParams.test.ts
+++ b/test/js/web/html/URLSearchParams.test.ts
@@ -86,6 +86,8 @@ describe("URLSearchParams", () => {
// @ts-expect-error
expect(params.toJSON()).toEqual(props);
+
+ expect(Array.from(params.keys())).toHaveLength(params.size);
});
describe("non-standard extensions", () => {
diff --git a/test/js/web/request/request.test.ts b/test/js/web/request/request.test.ts
new file mode 100644
index 000000000..ac6008eb4
--- /dev/null
+++ b/test/js/web/request/request.test.ts
@@ -0,0 +1,37 @@
+import { test, expect } from "bun:test";
+
+test("request can receive undefined signal", async () => {
+ const request = new Request("http://example.com/", {
+ method: "POST",
+ headers: {
+ "Content-Type": "text/bun;charset=utf-8",
+ },
+ body: "bun",
+ signal: undefined,
+ });
+ expect(request.method).toBe("POST");
+ // @ts-ignore
+ const clone = new Request(request);
+ expect(clone.method).toBe("POST");
+ expect(clone.headers.get("content-type")).toBe("text/bun;charset=utf-8");
+ expect(await request.text()).toBe("bun");
+ expect(await clone.text()).toBe("bun");
+});
+
+test("request can receive null signal", async () => {
+ const request = new Request("http://example.com/", {
+ method: "POST",
+ headers: {
+ "Content-Type": "text/bun;charset=utf-8",
+ },
+ body: "bun",
+ signal: null,
+ });
+ expect(request.method).toBe("POST");
+ // @ts-ignore
+ const clone = new Request(request);
+ expect(clone.method).toBe("POST");
+ expect(clone.headers.get("content-type")).toBe("text/bun;charset=utf-8");
+ expect(await request.text()).toBe("bun");
+ expect(await clone.text()).toBe("bun");
+});
diff --git a/test/js/web/timers/performance.test.js b/test/js/web/timers/performance.test.js
index dd50c4dc6..0d6cd577b 100644
--- a/test/js/web/timers/performance.test.js
+++ b/test/js/web/timers/performance.test.js
@@ -20,3 +20,28 @@ it("performance.now() should be monotonic", () => {
it("performance.timeOrigin + performance.now() should be similar to Date.now()", () => {
expect(Math.abs(performance.timeOrigin + performance.now() - Date.now()) < 1000).toBe(true);
});
+
+// https://github.com/oven-sh/bun/issues/5604
+it("performance.now() DOMJIT", () => {
+ // This test is very finnicky.
+ // It has to return true || return false to reproduce. Throwing an error doesn't work.
+ function run(start, prev) {
+ while (true) {
+ const current = performance.now();
+
+ if (Number.isNaN(current) || current < prev) {
+ return false;
+ }
+
+ if (current - start > 200) {
+ return true;
+ }
+ prev = current;
+ }
+ }
+
+ const start = performance.now();
+ if (!run(start, start)) {
+ throw new Error("performance.now() is not monotonic");
+ }
+});
diff --git a/test/js/web/url/url.test.ts b/test/js/web/url/url.test.ts
index 6ad691c1b..f19a132df 100644
--- a/test/js/web/url/url.test.ts
+++ b/test/js/web/url/url.test.ts
@@ -1,6 +1,19 @@
import { describe, it, expect } from "bun:test";
describe("url", () => {
+ it("URL throws", () => {
+ expect(() => new URL("")).toThrow('"" cannot be parsed as a URL');
+ expect(() => new URL(" ")).toThrow('" " cannot be parsed as a URL');
+ expect(() => new URL("boop", "http!/example.com")).toThrow(
+ '"boop" cannot be parsed as a URL against "http!/example.com"',
+ );
+
+ // redact
+ expect(() => new URL("boop", "https!!username:password@example.com")).toThrow(
+ '"boop" cannot be parsed as a URL against <redacted>',
+ );
+ });
+
it("should have correct origin and protocol", () => {
var url = new URL("https://example.com");
expect(url.protocol).toBe("https:");
@@ -39,8 +52,7 @@ describe("url", () => {
expect(url.protocol).toBe("mailto:");
expect(url.origin).toBe("null");
});
- it.skip("should work with blob urls", () => {
- // TODO
+ it("blob urls", () => {
var url = new URL("blob:https://example.com/1234-5678");
expect(url.protocol).toBe("blob:");
expect(url.origin).toBe("https://example.com");
@@ -59,6 +71,9 @@ describe("url", () => {
url = new URL("blob:ws://example.com");
expect(url.protocol).toBe("blob:");
expect(url.origin).toBe("ws://example.com");
+ url = new URL("blob:file:///folder/else/text.txt");
+ expect(url.protocol).toBe("blob:");
+ expect(url.origin).toBe("file://");
});
it("prints", () => {
expect(Bun.inspect(new URL("https://example.com"))).toBe(`URL {
@@ -165,4 +180,51 @@ describe("url", () => {
expect(result.username).toBe(values.username);
}
});
+
+ describe("URL.canParse", () => {
+ (
+ [
+ {
+ "url": undefined,
+ "base": undefined,
+ "expected": false,
+ },
+ {
+ "url": "a:b",
+ "base": undefined,
+ "expected": true,
+ },
+ {
+ "url": undefined,
+ "base": "a:b",
+ "expected": false,
+ },
+ {
+ "url": "a:/b",
+ "base": undefined,
+ "expected": true,
+ },
+ {
+ "url": undefined,
+ "base": "a:/b",
+ "expected": true,
+ },
+ {
+ "url": "https://test:test",
+ "base": undefined,
+ "expected": false,
+ },
+ {
+ "url": "a",
+ "base": "https://b/",
+ "expected": true,
+ },
+ ] as const
+ ).forEach(({ url, base, expected }) => {
+ it(`URL.canParse(${url}, ${base})`, () => {
+ // @ts-expect-error
+ expect(URL.canParse(url, base)).toBe(expected);
+ });
+ });
+ });
});
diff --git a/test/js/web/web-globals.test.js b/test/js/web/web-globals.test.js
index 1a4d7b1d1..74b28c0b0 100644
--- a/test/js/web/web-globals.test.js
+++ b/test/js/web/web-globals.test.js
@@ -1,6 +1,6 @@
-import { unsafe } from "bun";
+import { spawn } from "bun";
import { expect, it, test } from "bun:test";
-import { withoutAggressiveGC } from "harness";
+import { bunEnv, bunExe, withoutAggressiveGC } from "harness";
test("exists", () => {
expect(typeof URL !== "undefined").toBe(true);
@@ -31,6 +31,7 @@ const globalSetters = [
for (const [Constructor, name, eventName, prop] of globalSetters) {
test(`self.${name}`, () => {
var called = false;
+ console.log("name", name);
const callback = ({ [prop]: data }) => {
expect(data).toBe("hello");
@@ -232,3 +233,39 @@ test("navigator", () => {
expect(navigator.platform).toBe("Linux x86_64");
}
});
+
+test("confirm (yes)", async () => {
+ const proc = spawn({
+ cmd: [bunExe(), require("path").join(import.meta.dir, "./confirm-fixture.js")],
+ stderr: "pipe",
+ stdin: "pipe",
+ stdout: "pipe",
+ env: bunEnv,
+ });
+
+ proc.stdin.write("Y");
+ await proc.stdin.flush();
+
+ proc.stdin.write("\n");
+ await proc.stdin.flush();
+
+ await proc.exited;
+
+ expect(await new Response(proc.stderr).text()).toBe("Yes\n");
+});
+
+test("confirm (no)", async () => {
+ const proc = spawn({
+ cmd: [bunExe(), require("path").join(import.meta.dir, "./confirm-fixture.js")],
+ stderr: "pipe",
+ stdin: "pipe",
+ stdout: "pipe",
+ env: bunEnv,
+ });
+
+ proc.stdin.write("poask\n");
+ await proc.stdin.flush();
+ await proc.exited;
+
+ expect(await new Response(proc.stderr).text()).toBe("No\n");
+});
diff --git a/test/js/web/worker.test.ts b/test/js/web/worker.test.ts
index e1ab80487..8d7cf72d2 100644
--- a/test/js/web/worker.test.ts
+++ b/test/js/web/worker.test.ts
@@ -126,7 +126,7 @@ test("worker with event listeners doesnt close event loop", done => {
});
});
-test("worker with event listeners doesnt close event loop 2", done => {
+test("worker with event listeners doesn't close event loop 2", done => {
const x = Bun.spawn({
cmd: [bunExe(), path.join(import.meta.dir, "many-messages-event-loop.mjs"), "worker-fixture-many-messages2.js"],
env: bunEnv,
diff --git a/test/js/workerd/html-rewriter.test.js b/test/js/workerd/html-rewriter.test.js
index b0c951197..3f96c22c1 100644
--- a/test/js/workerd/html-rewriter.test.js
+++ b/test/js/workerd/html-rewriter.test.js
@@ -14,420 +14,448 @@ var setTimeoutAsync = (fn, delay) => {
});
};
-// describe("HTMLRewriter", () => {
-// it("HTMLRewriter: async replacement", async () => {
-// await gcTick();
-// const res = new HTMLRewriter()
-// .on("div", {
-// async element(element) {
-// await setTimeoutAsync(() => {
-// element.setInnerContent("<span>replace</span>", { html: true });
-// }, 5);
-// },
-// })
-// .transform(new Response("<div>example.com</div>"));
-// await gcTick();
-// expect(await res.text()).toBe("<div><span>replace</span></div>");
-// await gcTick();
-// });
-
-// it("supports element handlers", async () => {
-// var rewriter = new HTMLRewriter();
-// rewriter.on("div", {
-// element(element) {
-// element.setInnerContent("<blink>it worked!</blink>", { html: true });
-// },
-// });
-// var input = new Response("<div>hello</div>");
-// var output = rewriter.transform(input);
-// expect(await output.text()).toBe("<div><blink>it worked!</blink></div>");
-// });
-
-// it("(from file) supports element handlers", async () => {
-// var rewriter = new HTMLRewriter();
-// rewriter.on("div", {
-// element(element) {
-// element.setInnerContent("<blink>it worked!</blink>", { html: true });
-// },
-// });
-// await Bun.write("/tmp/html-rewriter.txt.js", "<div>hello</div>");
-// var input = new Response(Bun.file("/tmp/html-rewriter.txt.js"));
-// var output = rewriter.transform(input);
-// expect(await output.text()).toBe("<div><blink>it worked!</blink></div>");
-// });
-
-// it("supports attribute iterator", async () => {
-// var rewriter = new HTMLRewriter();
-// var expected = [
-// ["first", ""],
-// ["second", "alrihgt"],
-// ["third", "123"],
-// ["fourth", "5"],
-// ["fifth", "helloooo"],
-// ];
-// rewriter.on("div", {
-// element(element2) {
-// for (let attr of element2.attributes) {
-// const stack = expected.shift();
-// expect(stack[0]).toBe(attr[0]);
-// expect(stack[1]).toBe(attr[1]);
-// }
-// },
-// });
-// var input = new Response('<div first second="alrihgt" third="123" fourth=5 fifth=helloooo>hello</div>');
-// var output = rewriter.transform(input);
-// expect(await output.text()).toBe('<div first second="alrihgt" third="123" fourth=5 fifth=helloooo>hello</div>');
-// expect(expected.length).toBe(0);
-// });
-
-// it("handles element specific mutations", async () => {
-// // prepend/append
-// let res = new HTMLRewriter()
-// .on("p", {
-// element(element) {
-// element.prepend("<span>prepend</span>");
-// element.prepend("<span>prepend html</span>", { html: true });
-// element.append("<span>append</span>");
-// element.append("<span>append html</span>", { html: true });
-// },
-// })
-// .transform(new Response("<p>test</p>"));
-// expect(await res.text()).toBe(
-// [
-// "<p>",
-// "<span>prepend html</span>",
-// "&lt;span&gt;prepend&lt;/span&gt;",
-// "test",
-// "&lt;span&gt;append&lt;/span&gt;",
-// "<span>append html</span>",
-// "</p>",
-// ].join(""),
-// );
-
-// // setInnerContent
-// res = new HTMLRewriter()
-// .on("p", {
-// element(element) {
-// element.setInnerContent("<span>replace</span>");
-// },
-// })
-// .transform(new Response("<p>test</p>"));
-// expect(await res.text()).toBe("<p>&lt;span&gt;replace&lt;/span&gt;</p>");
-// res = new HTMLRewriter()
-// .on("p", {
-// element(element) {
-// element.setInnerContent("<span>replace</span>", { html: true });
-// },
-// })
-// .transform(new Response("<p>test</p>"));
-// expect(await res.text()).toBe("<p><span>replace</span></p>");
-
-// // removeAndKeepContent
-// res = new HTMLRewriter()
-// .on("p", {
-// element(element) {
-// element.removeAndKeepContent();
-// },
-// })
-// .transform(new Response("<p>test</p>"));
-// expect(await res.text()).toBe("test");
-// });
-
-// it("handles element class properties", async () => {
-// class Handler {
-// constructor(content) {
-// this.content = content;
-// }
-
-// // noinspection JSUnusedGlobalSymbols
-// element(element) {
-// element.setInnerContent(this.content);
-// }
-// }
-// const res = new HTMLRewriter().on("p", new Handler("new")).transform(new Response("<p>test</p>"));
-// expect(await res.text()).toBe("<p>new</p>");
-// });
-
-// const commentsMutationsInput = "<p><!--test--></p>";
-// const commentsMutationsExpected = {
-// beforeAfter: [
-// "<p>",
-// "&lt;span&gt;before&lt;/span&gt;",
-// "<span>before html</span>",
-// "<!--test-->",
-// "<span>after html</span>",
-// "&lt;span&gt;after&lt;/span&gt;",
-// "</p>",
-// ].join(""),
-// replace: "<p>&lt;span&gt;replace&lt;/span&gt;</p>",
-// replaceHtml: "<p><span>replace</span></p>",
-// remove: "<p></p>",
-// };
-
-// const commentPropertiesMacro = async func => {
-// const res = func(new HTMLRewriter(), comment => {
-// expect(comment.removed).toBe(false);
-// expect(comment.text).toBe("test");
-// comment.text = "new";
-// expect(comment.text).toBe("new");
-// }).transform(new Response("<p><!--test--></p>"));
-// expect(await res.text()).toBe("<p><!--new--></p>");
-// };
-
-// it("HTMLRewriter: handles comment properties", () =>
-// commentPropertiesMacro((rw, comments) => {
-// rw.on("p", { comments });
-// return rw;
-// }));
-
-// it("selector tests", async () => {
-// const checkSelector = async (selector, input, expected) => {
-// const res = new HTMLRewriter()
-// .on(selector, {
-// element(element) {
-// element.setInnerContent("new");
-// },
-// })
-// .transform(new Response(input));
-// expect(await res.text()).toBe(expected);
-// };
-
-// await checkSelector("*", "<h1>1</h1><p>2</p>", "<h1>new</h1><p>new</p>");
-// await checkSelector("p", "<h1>1</h1><p>2</p>", "<h1>1</h1><p>new</p>");
-// await checkSelector(
-// "p:nth-child(2)",
-// "<div><p>1</p><p>2</p><p>3</p></div>",
-// "<div><p>1</p><p>new</p><p>3</p></div>",
-// );
-// await checkSelector(
-// "p:first-child",
-// "<div><p>1</p><p>2</p><p>3</p></div>",
-// "<div><p>new</p><p>2</p><p>3</p></div>",
-// );
-// await checkSelector(
-// "p:nth-of-type(2)",
-// "<div><p>1</p><h1>2</h1><p>3</p><h1>4</h1><p>5</p></div>",
-// "<div><p>1</p><h1>2</h1><p>new</p><h1>4</h1><p>5</p></div>",
-// );
-// await checkSelector(
-// "p:first-of-type",
-// "<div><h1>1</h1><p>2</p><p>3</p></div>",
-// "<div><h1>1</h1><p>new</p><p>3</p></div>",
-// );
-// await checkSelector(
-// "p:not(:first-child)",
-// "<div><p>1</p><p>2</p><p>3</p></div>",
-// "<div><p>1</p><p>new</p><p>new</p></div>",
-// );
-// await checkSelector("p.red", '<p class="red">1</p><p>2</p>', '<p class="red">new</p><p>2</p>');
-// await checkSelector("h1#header", '<h1 id="header">1</h1><h1>2</h1>', '<h1 id="header">new</h1><h1>2</h1>');
-// await checkSelector("p[data-test]", "<p data-test>1</p><p>2</p>", "<p data-test>new</p><p>2</p>");
-// await checkSelector(
-// 'p[data-test="one"]',
-// '<p data-test="one">1</p><p data-test="two">2</p>',
-// '<p data-test="one">new</p><p data-test="two">2</p>',
-// );
-// await checkSelector(
-// 'p[data-test="one" i]',
-// '<p data-test="one">1</p><p data-test="OnE">2</p><p data-test="two">3</p>',
-// '<p data-test="one">new</p><p data-test="OnE">new</p><p data-test="two">3</p>',
-// );
-// await checkSelector(
-// 'p[data-test="one" s]',
-// '<p data-test="one">1</p><p data-test="OnE">2</p><p data-test="two">3</p>',
-// '<p data-test="one">new</p><p data-test="OnE">2</p><p data-test="two">3</p>',
-// );
-// await checkSelector(
-// 'p[data-test~="two"]',
-// '<p data-test="one two three">1</p><p data-test="one two">2</p><p data-test="one">3</p>',
-// '<p data-test="one two three">new</p><p data-test="one two">new</p><p data-test="one">3</p>',
-// );
-// await checkSelector(
-// 'p[data-test^="a"]',
-// '<p data-test="a1">1</p><p data-test="a2">2</p><p data-test="b1">3</p>',
-// '<p data-test="a1">new</p><p data-test="a2">new</p><p data-test="b1">3</p>',
-// );
-// await checkSelector(
-// 'p[data-test$="1"]',
-// '<p data-test="a1">1</p><p data-test="a2">2</p><p data-test="b1">3</p>',
-// '<p data-test="a1">new</p><p data-test="a2">2</p><p data-test="b1">new</p>',
-// );
-// await checkSelector(
-// 'p[data-test*="b"]',
-// '<p data-test="abc">1</p><p data-test="ab">2</p><p data-test="a">3</p>',
-// '<p data-test="abc">new</p><p data-test="ab">new</p><p data-test="a">3</p>',
-// );
-// await checkSelector(
-// 'p[data-test|="a"]',
-// '<p data-test="a">1</p><p data-test="a-1">2</p><p data-test="a2">3</p>',
-// '<p data-test="a">new</p><p data-test="a-1">new</p><p data-test="a2">3</p>',
-// );
-// await checkSelector(
-// "div span",
-// "<div><h1><span>1</span></h1><span>2</span><b>3</b></div>",
-// "<div><h1><span>new</span></h1><span>new</span><b>3</b></div>",
-// );
-// await checkSelector(
-// "div > span",
-// "<div><h1><span>1</span></h1><span>2</span><b>3</b></div>",
-// "<div><h1><span>1</span></h1><span>new</span><b>3</b></div>",
-// );
-// });
-
-// it("supports deleting innerContent", async () => {
-// expect(
-// await new HTMLRewriter()
-// .on("div", {
-// element(elem) {
-// // https://github.com/oven-sh/bun/issues/2323
-// elem.setInnerContent("");
-// },
-// })
-// .transform(new Response("<div>content</div>"))
-// .text(),
-// ).toEqual("<div></div>");
-// });
-
-// it("supports deleting innerHTML", async () => {
-// expect(
-// await new HTMLRewriter()
-// .on("div", {
-// element(elem) {
-// // https://github.com/oven-sh/bun/issues/2323
-// elem.setInnerContent("", { html: true });
-// },
-// })
-// .transform(new Response("<div><span>content</span></div>"))
-// .text(),
-// ).toEqual("<div></div>");
-// });
-
-// it("it supports lastInTextNode", async () => {
-// let lastInTextNode;
-
-// await new HTMLRewriter()
-// .on("p", {
-// text(text) {
-// lastInTextNode ??= text.lastInTextNode;
-// },
-// })
-// .transform(new Response("<p>Lorem ipsum!</p>"))
-// .text();
-
-// expect(lastInTextNode).toBeBoolean();
-// });
-
-// it("it supports selfClosing", async () => {
-// const selfClosing = {};
-// await new HTMLRewriter()
-// .on("*", {
-// element(el) {
-// selfClosing[el.tagName] = el.selfClosing;
-// },
-// })
-
-// .transform(new Response("<p>Lorem ipsum!<br></p><div />"))
-// .text();
-
-// expect(selfClosing).toEqual({
-// p: false,
-// br: false,
-// div: true,
-// });
-// });
-
-// it("it supports canHaveContent", async () => {
-// const canHaveContent = {};
-// await new HTMLRewriter()
-// .on("*", {
-// element(el) {
-// canHaveContent[el.tagName] = el.canHaveContent;
-// },
-// })
-// .transform(new Response("<p>Lorem ipsum!<br></p><div /><svg><circle /></svg>"))
-// .text();
-
-// expect(canHaveContent).toEqual({
-// p: true,
-// br: false,
-// div: true,
-// svg: true,
-// circle: false,
-// });
-// });
-// });
-
-// // By not segfaulting, this test passes
-// it("#3334 regression", async () => {
-// for (let i = 0; i < 10; i++) {
-// const headers = new Headers({
-// "content-type": "text/html",
-// });
-// const response = new Response("<div>content</div>", { headers });
-
-// const result = await new HTMLRewriter()
-// .on("div", {
-// element(elem) {
-// elem.setInnerContent("new");
-// },
-// })
-// .transform(response)
-// .text();
-// expect(result).toEqual("<div>new</div>");
-// }
-// Bun.gc(true);
-// });
-
-// it("#3489", async () => {
-// var el;
-// await new HTMLRewriter()
-// .on("p", {
-// element(element) {
-// el = element.getAttribute("id");
-// },
-// })
-// .transform(new Response('<p id="Šžõäöü"></p>'))
-// .text();
-// expect(el).toEqual("Šžõäöü");
-// });
-
-// it("get attribute - ascii", async () => {
-// for (let i = 0; i < 10; i++) {
-// var el;
-// await new HTMLRewriter()
-// .on("p", {
-// element(element) {
-// el = element.getAttribute("id");
-// },
-// })
-// .transform(new Response(`<p id="asciii"></p>`))
-// .text();
-// expect(el).toEqual("asciii");
-// }
-// });
-
-// it("#3520", async () => {
-// const pairs = [];
-
-// await new HTMLRewriter()
-// .on("p", {
-// element(element) {
-// for (const pair of element.attributes) {
-// pairs.push(pair);
-// }
-// },
-// })
-// .transform(new Response('<p šž="Õäöü" ab="Õäöü" šž="Õäöü" šž="dc" šž="🕵🏻"></p>'))
-// .text();
-
-// expect(pairs).toEqual([
-// ["šž", "Õäöü"],
-// ["ab", "Õäöü"],
-// ["šž", "Õäöü"],
-// ["šž", "dc"],
-// ["šž", "🕵🏻"],
-// ]);
-// });
+describe("HTMLRewriter", () => {
+ it("HTMLRewriter: async replacement", async () => {
+ await gcTick();
+ const res = new HTMLRewriter()
+ .on("div", {
+ async element(element) {
+ await setTimeoutAsync(() => {
+ element.setInnerContent("<span>replace</span>", { html: true });
+ }, 5);
+ },
+ })
+ .transform(new Response("<div>example.com</div>"));
+ await gcTick();
+ expect(await res.text()).toBe("<div><span>replace</span></div>");
+ await gcTick();
+ });
+
+ it("HTMLRewriter: async replacement using fetch + Bun.serve", async () => {
+ await gcTick();
+ let content;
+ let server;
+ try {
+ server = Bun.serve({
+ port: 0,
+ fetch(req) {
+ return new HTMLRewriter()
+ .on("div", {
+ async element(element) {
+ content = await fetch("https://www.example.com/").then(res => res.text());
+ element.setInnerContent(content, { html: true });
+ },
+ })
+ .transform(new Response("<div>example.com</div>"));
+ },
+ });
+
+ await gcTick();
+ const url = `http://localhost:${server.port}`;
+ expect(await fetch(url).then(res => res.text())).toBe(`<div>${content}</div>`);
+ await gcTick();
+ } finally {
+ server.stop();
+ }
+ });
+
+ it("supports element handlers", async () => {
+ var rewriter = new HTMLRewriter();
+ rewriter.on("div", {
+ element(element) {
+ element.setInnerContent("<blink>it worked!</blink>", { html: true });
+ },
+ });
+ var input = new Response("<div>hello</div>");
+ var output = rewriter.transform(input);
+ expect(await output.text()).toBe("<div><blink>it worked!</blink></div>");
+ });
+
+ it("(from file) supports element handlers", async () => {
+ var rewriter = new HTMLRewriter();
+ rewriter.on("div", {
+ element(element) {
+ element.setInnerContent("<blink>it worked!</blink>", { html: true });
+ },
+ });
+ await Bun.write("/tmp/html-rewriter.txt.js", "<div>hello</div>");
+ var input = new Response(Bun.file("/tmp/html-rewriter.txt.js"));
+ var output = rewriter.transform(input);
+ expect(await output.text()).toBe("<div><blink>it worked!</blink></div>");
+ });
+
+ it("supports attribute iterator", async () => {
+ var rewriter = new HTMLRewriter();
+ var expected = [
+ ["first", ""],
+ ["second", "alrihgt"],
+ ["third", "123"],
+ ["fourth", "5"],
+ ["fifth", "helloooo"],
+ ];
+ rewriter.on("div", {
+ element(element2) {
+ for (let attr of element2.attributes) {
+ const stack = expected.shift();
+ expect(stack[0]).toBe(attr[0]);
+ expect(stack[1]).toBe(attr[1]);
+ }
+ },
+ });
+ var input = new Response('<div first second="alrihgt" third="123" fourth=5 fifth=helloooo>hello</div>');
+ var output = rewriter.transform(input);
+ expect(await output.text()).toBe('<div first second="alrihgt" third="123" fourth=5 fifth=helloooo>hello</div>');
+ expect(expected.length).toBe(0);
+ });
+
+ it("handles element specific mutations", async () => {
+ // prepend/append
+ let res = new HTMLRewriter()
+ .on("p", {
+ element(element) {
+ element.prepend("<span>prepend</span>");
+ element.prepend("<span>prepend html</span>", { html: true });
+ element.append("<span>append</span>");
+ element.append("<span>append html</span>", { html: true });
+ },
+ })
+ .transform(new Response("<p>test</p>"));
+ expect(await res.text()).toBe(
+ [
+ "<p>",
+ "<span>prepend html</span>",
+ "&lt;span&gt;prepend&lt;/span&gt;",
+ "test",
+ "&lt;span&gt;append&lt;/span&gt;",
+ "<span>append html</span>",
+ "</p>",
+ ].join(""),
+ );
+
+ // setInnerContent
+ res = new HTMLRewriter()
+ .on("p", {
+ element(element) {
+ element.setInnerContent("<span>replace</span>");
+ },
+ })
+ .transform(new Response("<p>test</p>"));
+ expect(await res.text()).toBe("<p>&lt;span&gt;replace&lt;/span&gt;</p>");
+ res = new HTMLRewriter()
+ .on("p", {
+ element(element) {
+ element.setInnerContent("<span>replace</span>", { html: true });
+ },
+ })
+ .transform(new Response("<p>test</p>"));
+ expect(await res.text()).toBe("<p><span>replace</span></p>");
+
+ // removeAndKeepContent
+ res = new HTMLRewriter()
+ .on("p", {
+ element(element) {
+ element.removeAndKeepContent();
+ },
+ })
+ .transform(new Response("<p>test</p>"));
+ expect(await res.text()).toBe("test");
+ });
+
+ it("handles element class properties", async () => {
+ class Handler {
+ constructor(content) {
+ this.content = content;
+ }
+
+ // noinspection JSUnusedGlobalSymbols
+ element(element) {
+ element.setInnerContent(this.content);
+ }
+ }
+ const res = new HTMLRewriter().on("p", new Handler("new")).transform(new Response("<p>test</p>"));
+ expect(await res.text()).toBe("<p>new</p>");
+ });
+
+ const commentsMutationsInput = "<p><!--test--></p>";
+ const commentsMutationsExpected = {
+ beforeAfter: [
+ "<p>",
+ "&lt;span&gt;before&lt;/span&gt;",
+ "<span>before html</span>",
+ "<!--test-->",
+ "<span>after html</span>",
+ "&lt;span&gt;after&lt;/span&gt;",
+ "</p>",
+ ].join(""),
+ replace: "<p>&lt;span&gt;replace&lt;/span&gt;</p>",
+ replaceHtml: "<p><span>replace</span></p>",
+ remove: "<p></p>",
+ };
+
+ const commentPropertiesMacro = async func => {
+ const res = func(new HTMLRewriter(), comment => {
+ expect(comment.removed).toBe(false);
+ expect(comment.text).toBe("test");
+ comment.text = "new";
+ expect(comment.text).toBe("new");
+ }).transform(new Response("<p><!--test--></p>"));
+ expect(await res.text()).toBe("<p><!--new--></p>");
+ };
+
+ it("HTMLRewriter: handles comment properties", () =>
+ commentPropertiesMacro((rw, comments) => {
+ rw.on("p", { comments });
+ return rw;
+ }));
+
+ it("selector tests", async () => {
+ const checkSelector = async (selector, input, expected) => {
+ const res = new HTMLRewriter()
+ .on(selector, {
+ element(element) {
+ element.setInnerContent("new");
+ },
+ })
+ .transform(new Response(input));
+ expect(await res.text()).toBe(expected);
+ };
+
+ await checkSelector("*", "<h1>1</h1><p>2</p>", "<h1>new</h1><p>new</p>");
+ await checkSelector("p", "<h1>1</h1><p>2</p>", "<h1>1</h1><p>new</p>");
+ await checkSelector(
+ "p:nth-child(2)",
+ "<div><p>1</p><p>2</p><p>3</p></div>",
+ "<div><p>1</p><p>new</p><p>3</p></div>",
+ );
+ await checkSelector(
+ "p:first-child",
+ "<div><p>1</p><p>2</p><p>3</p></div>",
+ "<div><p>new</p><p>2</p><p>3</p></div>",
+ );
+ await checkSelector(
+ "p:nth-of-type(2)",
+ "<div><p>1</p><h1>2</h1><p>3</p><h1>4</h1><p>5</p></div>",
+ "<div><p>1</p><h1>2</h1><p>new</p><h1>4</h1><p>5</p></div>",
+ );
+ await checkSelector(
+ "p:first-of-type",
+ "<div><h1>1</h1><p>2</p><p>3</p></div>",
+ "<div><h1>1</h1><p>new</p><p>3</p></div>",
+ );
+ await checkSelector(
+ "p:not(:first-child)",
+ "<div><p>1</p><p>2</p><p>3</p></div>",
+ "<div><p>1</p><p>new</p><p>new</p></div>",
+ );
+ await checkSelector("p.red", '<p class="red">1</p><p>2</p>', '<p class="red">new</p><p>2</p>');
+ await checkSelector("h1#header", '<h1 id="header">1</h1><h1>2</h1>', '<h1 id="header">new</h1><h1>2</h1>');
+ await checkSelector("p[data-test]", "<p data-test>1</p><p>2</p>", "<p data-test>new</p><p>2</p>");
+ await checkSelector(
+ 'p[data-test="one"]',
+ '<p data-test="one">1</p><p data-test="two">2</p>',
+ '<p data-test="one">new</p><p data-test="two">2</p>',
+ );
+ await checkSelector(
+ 'p[data-test="one" i]',
+ '<p data-test="one">1</p><p data-test="OnE">2</p><p data-test="two">3</p>',
+ '<p data-test="one">new</p><p data-test="OnE">new</p><p data-test="two">3</p>',
+ );
+ await checkSelector(
+ 'p[data-test="one" s]',
+ '<p data-test="one">1</p><p data-test="OnE">2</p><p data-test="two">3</p>',
+ '<p data-test="one">new</p><p data-test="OnE">2</p><p data-test="two">3</p>',
+ );
+ await checkSelector(
+ 'p[data-test~="two"]',
+ '<p data-test="one two three">1</p><p data-test="one two">2</p><p data-test="one">3</p>',
+ '<p data-test="one two three">new</p><p data-test="one two">new</p><p data-test="one">3</p>',
+ );
+ await checkSelector(
+ 'p[data-test^="a"]',
+ '<p data-test="a1">1</p><p data-test="a2">2</p><p data-test="b1">3</p>',
+ '<p data-test="a1">new</p><p data-test="a2">new</p><p data-test="b1">3</p>',
+ );
+ await checkSelector(
+ 'p[data-test$="1"]',
+ '<p data-test="a1">1</p><p data-test="a2">2</p><p data-test="b1">3</p>',
+ '<p data-test="a1">new</p><p data-test="a2">2</p><p data-test="b1">new</p>',
+ );
+ await checkSelector(
+ 'p[data-test*="b"]',
+ '<p data-test="abc">1</p><p data-test="ab">2</p><p data-test="a">3</p>',
+ '<p data-test="abc">new</p><p data-test="ab">new</p><p data-test="a">3</p>',
+ );
+ await checkSelector(
+ 'p[data-test|="a"]',
+ '<p data-test="a">1</p><p data-test="a-1">2</p><p data-test="a2">3</p>',
+ '<p data-test="a">new</p><p data-test="a-1">new</p><p data-test="a2">3</p>',
+ );
+ await checkSelector(
+ "div span",
+ "<div><h1><span>1</span></h1><span>2</span><b>3</b></div>",
+ "<div><h1><span>new</span></h1><span>new</span><b>3</b></div>",
+ );
+ await checkSelector(
+ "div > span",
+ "<div><h1><span>1</span></h1><span>2</span><b>3</b></div>",
+ "<div><h1><span>1</span></h1><span>new</span><b>3</b></div>",
+ );
+ });
+
+ it("supports deleting innerContent", async () => {
+ expect(
+ await new HTMLRewriter()
+ .on("div", {
+ element(elem) {
+ // https://github.com/oven-sh/bun/issues/2323
+ elem.setInnerContent("");
+ },
+ })
+ .transform(new Response("<div>content</div>"))
+ .text(),
+ ).toEqual("<div></div>");
+ });
+
+ it("supports deleting innerHTML", async () => {
+ expect(
+ await new HTMLRewriter()
+ .on("div", {
+ element(elem) {
+ // https://github.com/oven-sh/bun/issues/2323
+ elem.setInnerContent("", { html: true });
+ },
+ })
+ .transform(new Response("<div><span>content</span></div>"))
+ .text(),
+ ).toEqual("<div></div>");
+ });
+
+ it("it supports lastInTextNode", async () => {
+ let lastInTextNode;
+
+ await new HTMLRewriter()
+ .on("p", {
+ text(text) {
+ lastInTextNode ??= text.lastInTextNode;
+ },
+ })
+ .transform(new Response("<p>Lorem ipsum!</p>"))
+ .text();
+
+ expect(lastInTextNode).toBeBoolean();
+ });
+
+ it("it supports selfClosing", async () => {
+ const selfClosing = {};
+ await new HTMLRewriter()
+ .on("*", {
+ element(el) {
+ selfClosing[el.tagName] = el.selfClosing;
+ },
+ })
+
+ .transform(new Response("<p>Lorem ipsum!<br></p><div />"))
+ .text();
+
+ expect(selfClosing).toEqual({
+ p: false,
+ br: false,
+ div: true,
+ });
+ });
+
+ it("it supports canHaveContent", async () => {
+ const canHaveContent = {};
+ await new HTMLRewriter()
+ .on("*", {
+ element(el) {
+ canHaveContent[el.tagName] = el.canHaveContent;
+ },
+ })
+ .transform(new Response("<p>Lorem ipsum!<br></p><div /><svg><circle /></svg>"))
+ .text();
+
+ expect(canHaveContent).toEqual({
+ p: true,
+ br: false,
+ div: true,
+ svg: true,
+ circle: false,
+ });
+ });
+});
+
+// By not segfaulting, this test passes
+it("#3334 regression", async () => {
+ for (let i = 0; i < 10; i++) {
+ const headers = new Headers({
+ "content-type": "text/html",
+ });
+ const response = new Response("<div>content</div>", { headers });
+
+ const result = await new HTMLRewriter()
+ .on("div", {
+ element(elem) {
+ elem.setInnerContent("new");
+ },
+ })
+ .transform(response)
+ .text();
+ expect(result).toEqual("<div>new</div>");
+ }
+ Bun.gc(true);
+});
+
+it("#3489", async () => {
+ var el;
+ await new HTMLRewriter()
+ .on("p", {
+ element(element) {
+ el = element.getAttribute("id");
+ },
+ })
+ .transform(new Response('<p id="Šžõäöü"></p>'))
+ .text();
+ expect(el).toEqual("Šžõäöü");
+});
+
+it("get attribute - ascii", async () => {
+ for (let i = 0; i < 10; i++) {
+ var el;
+ await new HTMLRewriter()
+ .on("p", {
+ element(element) {
+ el = element.getAttribute("id");
+ },
+ })
+ .transform(new Response(`<p id="asciii"></p>`))
+ .text();
+ expect(el).toEqual("asciii");
+ }
+});
+
+it("#3520", async () => {
+ const pairs = [];
+
+ await new HTMLRewriter()
+ .on("p", {
+ element(element) {
+ for (const pair of element.attributes) {
+ pairs.push(pair);
+ }
+ },
+ })
+ .transform(new Response('<p šž="Õäöü" ab="Õäöü" šž="Õäöü" šž="dc" šž="🕵🏻"></p>'))
+ .text();
+
+ expect(pairs).toEqual([
+ ["šž", "Õäöü"],
+ ["ab", "Õäöü"],
+ ["šž", "Õäöü"],
+ ["šž", "dc"],
+ ["šž", "🕵🏻"],
+ ]);
+});
const fixture_html = path.join(import.meta.dir, "../web/fetch/fixture.html");
const fixture_html_content = fs.readFileSync(fixture_html);
diff --git a/test/package.json b/test/package.json
index 4d7cd6606..293965433 100644
--- a/test/package.json
+++ b/test/package.json
@@ -9,6 +9,8 @@
},
"dependencies": {
"@prisma/client": "5.1.1",
+ "reflect-metadata": "0.1.13",
+ "@resvg/resvg-js": "2.4.1",
"@swc/core": "1.3.38",
"body-parser": "1.20.2",
"comlink": "4.4.1",
@@ -19,13 +21,18 @@
"fsevents": "2.3.2",
"iconv-lite": "0.6.3",
"jest-extended": "4.0.0",
+ "jsonwebtoken": "9.0.2",
+ "jws": "4.0.0",
"lodash": "4.17.21",
+ "mongodb": "6.0.0",
+ "msgpackr-extract": "3.0.2",
"nodemailer": "6.9.3",
"pg": "8.11.1",
"pg-connection-string": "2.6.1",
"postgres": "3.3.5",
"prisma": "5.1.1",
- "@resvg/resvg-js": "2.4.1",
+ "prompts": "2.4.2",
+ "sinon": "16.1.0",
"socket.io": "4.7.1",
"socket.io-client": "4.7.1",
"supertest": "6.3.3",
@@ -34,7 +41,8 @@
"undici": "5.20.0",
"vitest": "0.32.2",
"webpack": "5.88.0",
- "webpack-cli": "4.7.2"
+ "webpack-cli": "4.7.2",
+ "yargs": "17.7.2"
},
"private": true,
"scripts": {
diff --git a/test/regression/fixtures/cert.key b/test/regression/fixtures/cert.key
new file mode 100644
index 000000000..bf41b7883
--- /dev/null
+++ b/test/regression/fixtures/cert.key
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCIzOJskt6VkEJY
+XKSJv/Gdil3XYkjk3NVc/+m+kzqnkTRbPtT9w+IGWgmJhuf9DJPLCwHFAEFarVwV
+x16Q0PbU4ajXaLRHEYGhrH10oTMjQnJ24xVm26mxRXPQa5vaLpWJqNyIdNLIQLe+
+UXUOzSGGsFTRMAjvYrkzjBe4ZUnaZV+aFY/ug0jfzeA1dJjzKZs6+yTJRbsuWUEb
+8MsDmT4v+kBZDKdaDn7AFDWRVqx/38BnqsRzkM0CxpnyT2kRzw5zQajIE13gdTJo
+1EHvYSUkkxrY5m30Rl9BuBBZBjhMzOHq0fYVVooHO+sf4XHPgvFTTxJum85u7J1J
+oEUjrLKtAgMBAAECggEACInVNhaiqu4infZGVMy0rXMV8VwSlapM7O2SLtFsr0nK
+XUmaLK6dvGzBPKK9dxdiYCFzPlMKQTkhzsAvYFWSmm3tRmikG+11TFyCRhXLpc8/
+ark4vD9Io6ZkmKUmyKLwtXNjNGcqQtJ7RXc7Ga3nAkueN6JKZHqieZusXVeBGQ70
+YH1LKyVNBeJggbj+g9rqaksPyNJQ8EWiNTJkTRQPazZ0o1VX/fzDFyr/a5npFtHl
+4BHfafv9o1Xyr70Kie8CYYRJNViOCN+ylFs7Gd3XRaAkSkgMT/7DzrHdEM2zrrHK
+yNg2gyDVX9UeEJG2X5UtU0o9BVW7WBshz/2hqIUHoQKBgQC8zsRFvC7u/rGr5vRR
+mhZZG+Wvg03/xBSuIgOrzm+Qie6mAzOdVmfSL/pNV9EFitXt1yd2ROo31AbS7Evy
+Bm/QVKr2mBlmLgov3B7O/e6ABteooOL7769qV/v+yo8VdEg0biHmsfGIIXDe3Lwl
+OT0XwF9r/SeZLbw1zfkSsUVG/QKBgQC5fANM3Dc9LEek+6PHv5+eC1cKkyioEjUl
+/y1VUD00aABI1TUcdLF3BtFN2t/S6HW0hrP3KwbcUfqC25k+GDLh1nM6ZK/gI3Yn
+IGtCHxtE3S6jKhE9QcK/H+PzGVKWge9SezeYRP0GHJYDrTVTA8Kt9HgoZPPeReJl
++Ss9c8ThcQKBgECX6HQHFnNzNSufXtSQB7dCoQizvjqTRZPxVRoxDOABIGExVTYt
+umUhPtu5AGyJ+/hblEeU+iBRbGg6qRzK8PPwE3E7xey8MYYAI5YjL7YjISKysBUL
+AhM6uJ6Jg/wOBSnSx8xZ8kzlS+0izUda1rjKeprCSArSp8IsjlrDxPStAoGAEcPr
++P+altRX5Fhpvmb/Hb8OTif8G+TqjEIdkG9H/W38oP0ywg/3M2RGxcMx7txu8aR5
+NjI7zPxZFxF7YvQkY3cLwEsGgVxEI8k6HLIoBXd90Qjlb82NnoqqZY1GWL4HMwo0
+L/Rjm6M/Rwje852Hluu0WoIYzXA6F/Q+jPs6nzECgYAxx4IbDiGXuenkwSF1SUyj
+NwJXhx4HDh7U6EO/FiPZE5BHE3BoTrFu3o1lzverNk7G3m+j+m1IguEAalHlukYl
+rip9iUISlKYqbYZdLBoLwHAfHhszdrjqn8/v6oqbB5yR3HXjPFUWJo0WJ2pqJp56
+ZshgmQQ/5Khoj6x0/dMPSg==
+-----END PRIVATE KEY-----
diff --git a/test/regression/fixtures/cert.pem b/test/regression/fixtures/cert.pem
new file mode 100644
index 000000000..8ae1c1ea4
--- /dev/null
+++ b/test/regression/fixtures/cert.pem
@@ -0,0 +1,23 @@
+-----BEGIN CERTIFICATE-----
+MIID5jCCAs6gAwIBAgIUN7coIsdMcLo9amZfkwogu0YkeLEwDQYJKoZIhvcNAQEL
+BQAwfjELMAkGA1UEBhMCU0UxDjAMBgNVBAgMBVN0YXRlMREwDwYDVQQHDAhMb2Nh
+dGlvbjEaMBgGA1UECgwRT3JnYW5pemF0aW9uIE5hbWUxHDAaBgNVBAsME09yZ2Fu
+aXphdGlvbmFsIFVuaXQxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0yMzA5MjExNDE2
+MjNaFw0yNDA5MjAxNDE2MjNaMH4xCzAJBgNVBAYTAlNFMQ4wDAYDVQQIDAVTdGF0
+ZTERMA8GA1UEBwwITG9jYXRpb24xGjAYBgNVBAoMEU9yZ2FuaXphdGlvbiBOYW1l
+MRwwGgYDVQQLDBNPcmdhbml6YXRpb25hbCBVbml0MRIwEAYDVQQDDAlsb2NhbGhv
+c3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCIzOJskt6VkEJYXKSJ
+v/Gdil3XYkjk3NVc/+m+kzqnkTRbPtT9w+IGWgmJhuf9DJPLCwHFAEFarVwVx16Q
+0PbU4ajXaLRHEYGhrH10oTMjQnJ24xVm26mxRXPQa5vaLpWJqNyIdNLIQLe+UXUO
+zSGGsFTRMAjvYrkzjBe4ZUnaZV+aFY/ug0jfzeA1dJjzKZs6+yTJRbsuWUEb8MsD
+mT4v+kBZDKdaDn7AFDWRVqx/38BnqsRzkM0CxpnyT2kRzw5zQajIE13gdTJo1EHv
+YSUkkxrY5m30Rl9BuBBZBjhMzOHq0fYVVooHO+sf4XHPgvFTTxJum85u7J1JoEUj
+rLKtAgMBAAGjXDBaMA4GA1UdDwEB/wQEAwIDiDATBgNVHSUEDDAKBggrBgEFBQcD
+ATAUBgNVHREEDTALgglsb2NhbGhvc3QwHQYDVR0OBBYEFNzx4Rfs9m8XR5ML0WsI
+sorKmB4PMA0GCSqGSIb3DQEBCwUAA4IBAQB87iQy8R0fiOky9WTcyzVeMaavS3MX
+iTe1BRn1OCyDq+UiwwoNz7zdzZJFEmRtFBwPNFOe4HzLu6E+7yLFR552eYRHlqIi
+/fiLb5JiZfPtokUHeqwELWBsoXtU8vKxViPiLZ09jkWOPZWo7b/xXd6QYykBfV91
+usUXLzyTD2orMagpqNksLDGS3p3ggHEJBZtRZA8R7kPEw98xZHznOQpr26iv8kYz
+ZWdLFoFdwgFBSfxePKax5rfo+FbwdrcTX0MhbORyiu2XsBAghf8s2vKDkHg2UQE8
+haonxFYMFaASfaZ/5vWKYDTCJkJ67m/BtkpRafFEO+ad1i1S61OjfxH4
+-----END CERTIFICATE-----
diff --git a/test/regression/issue/4011.test.ts b/test/regression/issue/04011.test.ts
index a3db4270d..a3db4270d 100644
--- a/test/regression/issue/4011.test.ts
+++ b/test/regression/issue/04011.test.ts
diff --git a/test/regression/issue/04893.test.ts b/test/regression/issue/04893.test.ts
new file mode 100644
index 000000000..43850693b
--- /dev/null
+++ b/test/regression/issue/04893.test.ts
@@ -0,0 +1,23 @@
+import { bunEnv, bunExe } from "harness";
+import { mkdirSync, rmSync, writeFileSync, readFileSync, mkdtempSync } from "fs";
+import { tmpdir } from "os";
+import { join } from "path";
+
+it("correctly handles CRLF multiline string in CRLF terminated files", async () => {
+ const testDir = mkdtempSync(join(tmpdir(), "issue4893-"));
+
+ // Clean up from prior runs if necessary
+ rmSync(testDir, { recursive: true, force: true });
+
+ // Create a directory with our test CRLF terminated file
+ mkdirSync(testDir, { recursive: true });
+ writeFileSync(join(testDir, "crlf.js"), '"a\\\r\nb"');
+
+ const { stdout, exitCode } = Bun.spawnSync({
+ cmd: [bunExe(), "run", join(testDir, "crlf.js")],
+ env: bunEnv,
+ stderr: "inherit",
+ });
+
+ expect(exitCode).toBe(0);
+});
diff --git a/test/regression/issue/06443.test.ts b/test/regression/issue/06443.test.ts
new file mode 100644
index 000000000..19d8f200e
--- /dev/null
+++ b/test/regression/issue/06443.test.ts
@@ -0,0 +1,39 @@
+import { describe, test, expect } from "bun:test";
+import { serve, file } from "bun";
+
+describe("Bun.serve()", () => {
+ const tls = {
+ cert: file(new URL("../fixtures/cert.pem", import.meta.url)),
+ key: file(new URL("../fixtures/cert.key", import.meta.url)),
+ };
+
+ const servers = [
+ {
+ port: 0,
+ url: /^http:\/\/localhost:\d+\/$/,
+ },
+ {
+ tls,
+ port: 0,
+ url: /^https:\/\/localhost:\d+\/$/,
+ },
+ ];
+
+ test.each(servers)("%j", async ({ url, ...options }) => {
+ const server = serve({
+ hostname: "localhost",
+ ...options,
+ fetch(request) {
+ return new Response(request.url);
+ },
+ });
+ try {
+ const proto = options.tls ? "https" : "http";
+ const target = `${proto}://localhost:${server.port}/`;
+ const response = await fetch(target);
+ expect(response.text()).resolves.toMatch(url);
+ } finally {
+ server.stop(true);
+ }
+ });
+});
diff --git a/test/regression/issue/06467.test.ts b/test/regression/issue/06467.test.ts
new file mode 100644
index 000000000..9a9ad8a2d
--- /dev/null
+++ b/test/regression/issue/06467.test.ts
@@ -0,0 +1,7 @@
+import { test, expect } from "bun:test";
+
+test("write(value >= 0x80)", () => {
+ const buffer = Buffer.alloc(1);
+ buffer.write("\x80", "binary");
+ expect(buffer[0]).toBe(0x80);
+});
diff --git a/test/transpiler/decorator-metadata.test.ts b/test/transpiler/decorator-metadata.test.ts
new file mode 100644
index 000000000..9cc8cc718
--- /dev/null
+++ b/test/transpiler/decorator-metadata.test.ts
@@ -0,0 +1,546 @@
+import "reflect-metadata";
+
+describe("decorator metadata", () => {
+ test("type serialization", () => {
+ function d1() {}
+ class Known {}
+ class Swag {}
+ class A_1 {}
+
+ // @ts-ignore
+ @d1
+ class A {
+ constructor(
+ p0: any,
+ p1: unknown,
+ p2: never,
+ p3: void,
+ p4: null,
+ p5: undefined,
+ p6: number,
+ p7: string,
+ p8: boolean,
+ p9: symbol,
+ p10: bigint,
+ p11: object,
+ p12: () => {},
+ p13: [],
+ p14: {},
+ p15: 123,
+ p16: 123n,
+ p17: "123",
+ p18: `123`,
+ p19: true,
+ p20: false,
+ // @ts-ignore
+ p21: Map,
+ // @ts-ignore
+ p22: Set,
+ p23: Known,
+ // @ts-ignore
+ p24: Unknown,
+ p25: never & string,
+ p26: string & never,
+ p27: null & string,
+ p28: string & null,
+ p29: undefined & string,
+ p30: string & undefined,
+ p31: void & string,
+ p32: string & void,
+ p33: unknown & string,
+ p34: string & unknown,
+ p35: any & string,
+ p36: string & any,
+ p37: never | string,
+ p38: string | never,
+ p39: null | string,
+ p40: string | null,
+ p41: undefined | string,
+ p42: string | undefined,
+ p43: void | string,
+ p44: string | void,
+ p45: unknown | string,
+ p46: string | unknown,
+ p47: any | string,
+ p48: string | any,
+ p49: string | string,
+ p50: string & string,
+ p51: Known | Swag,
+ p52: Swag | Known,
+ p53: Known & Swag,
+ p54: Swag & Known,
+ p55: never | Swag,
+ p56: Swag | never,
+ p57: null | Swag,
+ p58: Swag | null,
+ p59: undefined | Swag,
+ p60: Swag | undefined,
+ p61: void | Swag,
+ p62: Swag | void,
+ p63: unknown | Swag,
+ p64: Swag | unknown,
+ p65: any | Swag,
+ p66: Swag | any,
+ p67: never & Swag,
+ p68: Swag & never,
+ p69: null & Swag,
+ p70: Swag & null,
+ p71: undefined & Swag,
+ p72: Swag & undefined,
+ p73: void & Swag,
+ p74: Swag & void,
+ p75: unknown & Swag,
+ p76: Swag & unknown,
+ p77: any & Swag,
+ p78: Swag & any,
+ p79: Swag | Swag,
+ p80: Swag & Swag,
+ // @ts-ignore
+ p81: Unknown | Known,
+ // @ts-ignore
+ p82: Known | Unknown,
+ // @ts-ignore
+ p83: Unknown & Known,
+ // @ts-ignore
+ p84: Known & Unknown,
+ // @ts-ignore
+ p85: Unknown | Unknown,
+ // @ts-ignore
+ p86: Unknown & Unknown,
+ p87: never | never,
+ p88: never & never,
+ p89: null | null,
+ p90: null & null,
+ p91: undefined | undefined,
+ p92: undefined & undefined,
+ p93: void | void,
+ p94: void & void,
+ p95: unknown | unknown,
+ p96: unknown & unknown,
+ p97: any | any,
+ p98: any & any,
+ p99: never | void,
+ p100: void | never,
+ p101: null | void,
+ p102: void | null,
+ p103: undefined | void,
+ p104: void | undefined,
+ p105: void | void,
+ p106: void & void,
+ p107: unknown | void,
+ p108: void | unknown,
+ p109: any | void,
+ p110: void | any,
+ p111: never | unknown,
+ p112: unknown | never,
+ p113: null | unknown,
+ p114: unknown | null,
+ p115: undefined | unknown,
+ p116: unknown | undefined,
+ p117: void | unknown,
+ p118: unknown | void,
+ p119: unknown | unknown,
+ p120: unknown & unknown,
+ p121: any | unknown,
+ p122: unknown | any,
+ p123: never | any,
+ p124: any | never,
+ p125: null | any,
+ p126: any | null,
+ p127: undefined | any,
+ p128: any | undefined,
+ p129: void | any,
+ p130: any | void,
+ p131: unknown | any,
+ p132: any | unknown,
+ p133: any | any,
+ p134: never & void,
+ p135: void & never,
+ p136: null & void,
+ p137: void & null,
+ p138: undefined & void,
+ p139: void & undefined,
+ p140: void & void,
+ p141: void | void,
+ p142: unknown & void,
+ p143: void & unknown,
+ p144: any & void,
+ p145: void & any,
+ p146: never & unknown,
+ p147: unknown & never,
+ p148: null & unknown,
+ p149: unknown & null,
+ p150: undefined & unknown,
+ p151: unknown & undefined,
+ p152: void & unknown,
+ p153: unknown & void,
+ p154: unknown & unknown,
+ p155: unknown | unknown,
+ p156: any & unknown,
+ p157: unknown & any,
+ p158: never & any,
+ p159: any & never,
+ p160: null & any,
+ p161: any & null,
+ p162: undefined & any,
+ p163: any & undefined,
+ p164: void & any,
+ p165: any & void,
+ p166: unknown & any,
+ p167: any & unknown,
+ p168: any & any,
+ p169: string & number & boolean & never & symbol,
+ p170: "foo" | A_1,
+ p171: true | boolean,
+ p172: "foo" | boolean,
+ p173: A_1 | "foo",
+ ) {}
+ }
+
+ const received = Reflect.getMetadata("design:paramtypes", A);
+ expect(received.length).toBe(174);
+ expect(received[0]).toBe(Object);
+ expect(received[1]).toBe(Object);
+ expect(received[2]).toBe(void 0);
+ expect(received[3]).toBe(void 0);
+ expect(received[4]).toBe(void 0);
+ expect(received[5]).toBe(void 0);
+ expect(received[6]).toBe(Number);
+ expect(received[7]).toBe(String);
+ expect(received[8]).toBe(Boolean);
+ expect(received[9]).toBe(typeof Symbol === "function" ? Symbol : Object);
+ expect(received[10]).toBe(typeof BigInt === "function" ? BigInt : Object);
+ expect(received[11]).toBe(Object);
+ expect(received[12]).toBe(Function);
+ expect(received[13]).toBe(Array);
+ expect(received[14]).toBe(Object);
+ expect(received[15]).toBe(Number);
+ expect(received[16]).toBe(typeof BigInt === "function" ? BigInt : Object);
+ expect(received[17]).toBe(String);
+ expect(received[18]).toBe(String);
+ expect(received[19]).toBe(Boolean);
+ expect(received[20]).toBe(Boolean);
+ expect(received[21]).toBe(Map);
+ expect(received[22]).toBe(Set);
+ expect(received[23]).toBe(Known);
+ expect(received[24]).toBe(Object);
+ expect(received[25]).toBe(void 0);
+ expect(received[26]).toBe(void 0);
+ expect(received[27]).toBe(String);
+ expect(received[28]).toBe(String);
+ expect(received[29]).toBe(String);
+ expect(received[30]).toBe(String);
+ expect(received[31]).toBe(Object);
+ expect(received[32]).toBe(Object);
+ expect(received[33]).toBe(String);
+ expect(received[34]).toBe(String);
+ expect(received[35]).toBe(Object);
+ expect(received[36]).toBe(Object);
+ expect(received[37]).toBe(String);
+ expect(received[38]).toBe(String);
+ expect(received[39]).toBe(String);
+ expect(received[40]).toBe(String);
+ expect(received[41]).toBe(String);
+ expect(received[42]).toBe(String);
+ expect(received[43]).toBe(Object);
+ expect(received[44]).toBe(Object);
+ expect(received[45]).toBe(Object);
+ expect(received[46]).toBe(Object);
+ expect(received[47]).toBe(Object);
+ expect(received[48]).toBe(Object);
+ expect(received[49]).toBe(String);
+ expect(received[50]).toBe(String);
+ expect(received[51]).toBe(Object);
+ expect(received[52]).toBe(Object);
+ expect(received[53]).toBe(Object);
+ expect(received[54]).toBe(Object);
+ expect(received[55]).toBe(Swag);
+ expect(received[56]).toBe(Swag);
+ expect(received[57]).toBe(Swag);
+ expect(received[58]).toBe(Swag);
+ expect(received[59]).toBe(Swag);
+ expect(received[60]).toBe(Swag);
+ expect(received[61]).toBe(Object);
+ expect(received[62]).toBe(Object);
+ expect(received[63]).toBe(Object);
+ expect(received[64]).toBe(Object);
+ expect(received[65]).toBe(Object);
+ expect(received[66]).toBe(Object);
+ expect(received[67]).toBe(void 0);
+ expect(received[68]).toBe(void 0);
+ expect(received[69]).toBe(Swag);
+ expect(received[70]).toBe(Swag);
+ expect(received[71]).toBe(Swag);
+ expect(received[72]).toBe(Swag);
+ expect(received[73]).toBe(Object);
+ expect(received[74]).toBe(Object);
+ expect(received[75]).toBe(Swag);
+ expect(received[76]).toBe(Swag);
+ expect(received[77]).toBe(Object);
+ expect(received[78]).toBe(Object);
+ expect(received[79]).toBe(Swag);
+ expect(received[80]).toBe(Swag);
+ expect(received[81]).toBe(Object);
+ expect(received[82]).toBe(Object);
+ expect(received[83]).toBe(Object);
+ expect(received[84]).toBe(Object);
+ expect(received[85]).toBe(Object);
+ expect(received[86]).toBe(Object);
+ expect(received[87]).toBe(void 0);
+ expect(received[88]).toBe(void 0);
+ expect(received[89]).toBe(void 0);
+ expect(received[90]).toBe(void 0);
+ expect(received[91]).toBe(void 0);
+ expect(received[92]).toBe(void 0);
+ expect(received[93]).toBe(void 0);
+ expect(received[94]).toBe(void 0);
+ expect(received[95]).toBe(Object);
+ expect(received[96]).toBe(void 0);
+ expect(received[97]).toBe(Object);
+ expect(received[98]).toBe(Object);
+ expect(received[99]).toBe(void 0);
+ expect(received[100]).toBe(void 0);
+ expect(received[101]).toBe(void 0);
+ expect(received[102]).toBe(void 0);
+ expect(received[103]).toBe(void 0);
+ expect(received[104]).toBe(void 0);
+ expect(received[105]).toBe(void 0);
+ expect(received[106]).toBe(void 0);
+ expect(received[107]).toBe(Object);
+ expect(received[108]).toBe(Object);
+ expect(received[109]).toBe(Object);
+ expect(received[110]).toBe(Object);
+ expect(received[111]).toBe(Object);
+ expect(received[112]).toBe(Object);
+ expect(received[113]).toBe(Object);
+ expect(received[114]).toBe(Object);
+ expect(received[115]).toBe(Object);
+ expect(received[116]).toBe(Object);
+ expect(received[117]).toBe(Object);
+ expect(received[118]).toBe(Object);
+ expect(received[119]).toBe(Object);
+ expect(received[120]).toBe(void 0);
+ expect(received[121]).toBe(Object);
+ expect(received[122]).toBe(Object);
+ expect(received[123]).toBe(Object);
+ expect(received[124]).toBe(Object);
+ expect(received[125]).toBe(Object);
+ expect(received[126]).toBe(Object);
+ expect(received[127]).toBe(Object);
+ expect(received[128]).toBe(Object);
+ expect(received[129]).toBe(Object);
+ expect(received[130]).toBe(Object);
+ expect(received[131]).toBe(Object);
+ expect(received[132]).toBe(Object);
+ expect(received[133]).toBe(Object);
+ expect(received[134]).toBe(void 0);
+ expect(received[135]).toBe(void 0);
+ expect(received[136]).toBe(void 0);
+ expect(received[137]).toBe(void 0);
+ expect(received[138]).toBe(void 0);
+ expect(received[139]).toBe(void 0);
+ expect(received[140]).toBe(void 0);
+ expect(received[141]).toBe(void 0);
+ expect(received[142]).toBe(void 0);
+ expect(received[143]).toBe(void 0);
+ expect(received[144]).toBe(Object);
+ expect(received[145]).toBe(Object);
+ expect(received[146]).toBe(void 0);
+ expect(received[147]).toBe(void 0);
+ expect(received[148]).toBe(void 0);
+ expect(received[149]).toBe(void 0);
+ expect(received[150]).toBe(void 0);
+ expect(received[151]).toBe(void 0);
+ expect(received[152]).toBe(void 0);
+ expect(received[153]).toBe(void 0);
+ expect(received[154]).toBe(void 0);
+ expect(received[155]).toBe(Object);
+ expect(received[156]).toBe(Object);
+ expect(received[157]).toBe(Object);
+ expect(received[158]).toBe(void 0);
+ expect(received[159]).toBe(Object);
+ expect(received[160]).toBe(Object);
+ expect(received[161]).toBe(Object);
+ expect(received[162]).toBe(Object);
+ expect(received[163]).toBe(Object);
+ expect(received[164]).toBe(Object);
+ expect(received[165]).toBe(Object);
+ expect(received[166]).toBe(Object);
+ expect(received[167]).toBe(Object);
+ expect(received[168]).toBe(Object);
+ expect(received[169]).toBe(Object);
+ expect(received[170]).toBe(Object);
+ expect(received[171]).toBe(Boolean);
+ expect(received[172]).toBe(Object);
+ expect(received[173]).toBe(Object);
+ });
+ test("design: type, paramtypes, returntype", () => {
+ function d1() {}
+ // @ts-ignore
+ @d1
+ class A {
+ // @ts-ignore
+ constructor(@d1 arg1: string) {}
+ // @ts-ignore
+ @d1
+ // @ts-ignore
+ method1(@d1 arg1: number): boolean {
+ return true;
+ }
+ // @ts-ignore
+ @d1
+ prop1: () => {};
+ // @ts-ignore
+ @d1
+ prop2: "foo" = "foo";
+ // @ts-ignore
+ @d1
+ prop3: symbol;
+ }
+
+ expect(Reflect.getMetadata("design:type", A)).toBeUndefined();
+ expect(Reflect.getMetadata("design:paramtypes", A)[0]).toBe(String);
+ expect(Reflect.getMetadata("design:returntype", A)).toBeUndefined();
+
+ expect(Reflect.getMetadata("design:type", A.prototype)).toBeUndefined();
+ expect(Reflect.getMetadata("design:paramtypes", A.prototype)).toBeUndefined();
+ expect(Reflect.getMetadata("design:returntype", A.prototype)).toBeUndefined();
+
+ expect(Reflect.getMetadata("design:type", A.prototype.method1)).toBeUndefined();
+ expect(Reflect.getMetadata("design:paramtypes", A.prototype.method1)).toBeUndefined();
+ expect(Reflect.getMetadata("design:returntype", A.prototype.method1)).toBeUndefined();
+
+ expect(Reflect.getMetadata("design:type", A.prototype, "method1")).toBe(Function);
+ expect(Reflect.getMetadata("design:paramtypes", A.prototype, "method1")[0]).toBe(Number);
+ expect(Reflect.getMetadata("design:returntype", A.prototype, "method1")).toBe(Boolean);
+
+ expect(Reflect.getMetadata("design:type", A.prototype, "prop1")).toBe(Function);
+ expect(Reflect.getMetadata("design:paramtypes", A.prototype, "prop1")).toBeUndefined();
+ expect(Reflect.getMetadata("design:returntype", A.prototype, "prop1")).toBeUndefined();
+
+ expect(Reflect.getMetadata("design:type", A.prototype, "prop2")).toBe(String);
+ expect(Reflect.getMetadata("design:paramtypes", A.prototype, "prop2")).toBeUndefined();
+ expect(Reflect.getMetadata("design:returntype", A.prototype, "prop2")).toBeUndefined();
+
+ expect(Reflect.getMetadata("design:type", A.prototype, "prop3")).toBe(Symbol);
+ expect(Reflect.getMetadata("design:paramtypes", A.prototype, "prop3")).toBeUndefined();
+ expect(Reflect.getMetadata("design:returntype", A.prototype, "prop3")).toBeUndefined();
+ });
+
+ test("class with only constructor argument decorators", () => {
+ function d1() {}
+ class A {
+ // @ts-ignore
+ constructor(@d1 arg1: string) {}
+ }
+
+ expect(Reflect.getMetadata("design:type", A)).toBeUndefined();
+ expect(Reflect.getMetadata("design:paramtypes", A)[0]).toBe(String);
+ expect(Reflect.getMetadata("design:returntype", A)).toBeUndefined();
+ });
+
+ test("more types", () => {
+ type B = "hello" | "world";
+ const b = 2;
+ const c = ["hello", "world"] as const;
+ type Loser = `hello ${B}`; // "hello hello" | "hello world"
+ function d1() {}
+
+ class A {
+ constructor(
+ // @ts-ignore
+ @d1 p0: `hello ${B}`,
+ // @ts-ignore
+ p1: keyof Something,
+ p2: typeof b,
+ p3: readonly ["hello", "world"],
+ p4: typeof c,
+ p5: readonly [number, string],
+ // prettier-ignore
+ p6: (string | string),
+ // prettier-ignore
+ p7: (string & string),
+ p8: boolean extends true ? "a" : "b",
+ // @ts-ignore
+ p9: Loser extends Loser ? string : Foo,
+ p10: { [keyof in string]: number },
+ // @ts-ignore
+ p11: blah extends blahblah ? number : void,
+ ) {}
+
+ // @ts-ignore
+ @d1
+ async method1() {
+ return true;
+ }
+ }
+
+ const paramtypes = Reflect.getMetadata("design:paramtypes", A);
+ expect(paramtypes[0]).toBe(String);
+ expect(paramtypes[1]).toBe(Object);
+ expect(paramtypes[2]).toBe(Object);
+ expect(paramtypes[3]).toBe(Array);
+ expect(paramtypes[4]).toBe(Object);
+ expect(paramtypes[5]).toBe(Array);
+ expect(paramtypes[6]).toBe(String);
+ expect(paramtypes[7]).toBe(String);
+ expect(paramtypes[8]).toBe(String);
+ expect(paramtypes[9]).toBe(Object);
+ expect(paramtypes[10]).toBe(Object);
+ expect(paramtypes[11]).toBe(Object);
+
+ expect(Reflect.getMetadata("design:returntype", A.prototype, "method1")).toBe(Promise);
+ });
+
+ test("rest parameters and defaults", () => {
+ function d1(target: any) {}
+ function d2(target: any, key: string) {}
+
+ @d1
+ class A {
+ @d2
+ // @ts-ignore
+ prop0: any[];
+
+ // @ts-ignore
+ constructor(a0) {}
+
+ @d2
+ // @ts-ignore
+ prop1;
+
+ @d2
+ method1() {}
+
+ @d2
+ // @ts-ignore
+ method2(...a0) {}
+
+ @d2
+ method3(a0: number, ...a1: []) {}
+
+ @d2
+ method4(...a0: any[]) {}
+ }
+
+ expect(Reflect.getMetadata("design:type", A.prototype, "prop0")).toBe(Array);
+ expect(Reflect.getMetadata("design:type", A.prototype, "prop1")).toBe(Object);
+
+ expect(Reflect.getMetadata("design:paramtypes", A.prototype, "method1")).toHaveLength(0);
+ expect(Reflect.getMetadata("design:type", A.prototype, "method1")).toBe(Function);
+ expect(Reflect.getMetadata("design:returntype", A.prototype, "method1")).toBeUndefined();
+
+ expect(Reflect.getMetadata("design:paramtypes", A.prototype, "method2")[0]).toBe(Object);
+ expect(Reflect.getMetadata("design:type", A.prototype, "method2")).toBe(Function);
+ expect(Reflect.getMetadata("design:returntype", A.prototype, "method2")).toBeUndefined();
+
+ expect(Reflect.getMetadata("design:paramtypes", A.prototype, "method3")[0]).toBe(Number);
+ expect(Reflect.getMetadata("design:paramtypes", A.prototype, "method3")[1]).toBe(Object);
+ expect(Reflect.getMetadata("design:type", A.prototype, "method3")).toBe(Function);
+ expect(Reflect.getMetadata("design:returntype", A.prototype, "method3")).toBeUndefined();
+
+ expect(Reflect.getMetadata("design:paramtypes", A.prototype, "method4")[0]).toBe(Object);
+ expect(Reflect.getMetadata("design:type", A.prototype, "method4")).toBe(Function);
+ expect(Reflect.getMetadata("design:returntype", A.prototype, "method4")).toBeUndefined();
+ });
+});
diff --git a/test/transpiler/decorators.test.ts b/test/transpiler/decorators.test.ts
index 885391800..cb328029b 100644
--- a/test/transpiler/decorators.test.ts
+++ b/test/transpiler/decorators.test.ts
@@ -712,7 +712,9 @@ test("decorators with different property key types", () => {
function d1(x) {
return function (target, propertyKey) {
expect(propertyKey).toBeDefined();
- expect(propertyKey).toBe(x);
+
+ // If Reflect.decorate is defined, propertyKey will be stringified
+ expect(String(propertyKey)).toBe(String(x));
};
}
function foo(x, y, z) {
@@ -727,7 +729,7 @@ test("decorators with different property key types", () => {
"string" = 30;
@d1("string method")
"string method"() {}
- @d1(12e3)
+ @d1(12000)
12e3 = "number key";
@d1(12e3 + 1)
[12e3 + 1]() {}
@@ -1001,13 +1003,11 @@ test("export default class works (anonymous name)", () => {
test("decorator and declare", () => {
let counter = 0;
- function d1(t) {
- t();
+ function d1() {
+ counter++;
}
class A {
- @d1(() => {
- counter++;
- })
+ @d1
declare a: number;
m() {
diff --git a/test/transpiler/runtime-transpiler.test.ts b/test/transpiler/runtime-transpiler.test.ts
index 23e972be4..9aaca74fe 100644
--- a/test/transpiler/runtime-transpiler.test.ts
+++ b/test/transpiler/runtime-transpiler.test.ts
@@ -1,6 +1,15 @@
import { beforeEach, describe, expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
+test("non-ascii regexp literals", () => {
+ var str = "🔴11 54 / 10,000";
+ expect(str.replace(/[🔵🔴,]+/g, "")).toBe("11 54 / 10000");
+});
+
+test("ascii regex with escapes", () => {
+ expect(/^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/ ]$/).toBeInstanceOf(RegExp);
+});
+
describe("// @bun", () => {
beforeEach(() => {
delete require.cache[require.resolve("./async-transpiler-entry")];
diff --git a/test/transpiler/transpiler.test.js b/test/transpiler/transpiler.test.js
index a6c2dcf73..43c8c6665 100644
--- a/test/transpiler/transpiler.test.js
+++ b/test/transpiler/transpiler.test.js
@@ -1984,6 +1984,30 @@ console.log(resolve.length)
// expectParseError("\u200Ca", 'Unexpected "\\u200c"');
// expectParseError("\u200Da", 'Unexpected "\\u200d"');
});
+
+ describe("dead code elimination", () => {
+ const transpilerNoDCE = new Bun.Transpiler({ deadCodeElimination: false });
+ it("should DCE with deadCodeElimination: true or by default", () => {
+ expect(parsed("123", true, false)).toBe("");
+ expect(parsed("[-1, 2n, null]", true, false)).toBe("");
+ expect(parsed("true", true, false)).toBe("");
+ expect(parsed("!0", true, false)).toBe("");
+ expect(parsed('if (!1) "dead";', true, false)).toBe("if (false)");
+ expect(parsed("if (!1) var x = 2;", true, false)).toBe("if (false)\n var x");
+ expect(parsed("if (undefined) { let y = Math.random(); }", true, false)).toBe("if (undefined) {\n}");
+ });
+ it("should not DCE with deadCodeElimination: false", () => {
+ expect(parsed("123", true, false, transpilerNoDCE)).toBe("123");
+ expect(parsed("[1, 2n, null]", true, false, transpilerNoDCE)).toBe("[1, 2n, null]");
+ expect(parsed("true", true, false, transpilerNoDCE)).toBe("true");
+ expect(parsed("!0", true, false, transpilerNoDCE)).toBe("!0");
+ expect(parsed('if (!1) "dead";', true, false, transpilerNoDCE)).toBe('if (!1)\n "dead"');
+ expect(parsed("if (!1) var x = 2;", true, false, transpilerNoDCE)).toBe("if (!1)\n var x = 2");
+ expect(parsed("if (undefined) { let y = Math.random(); }", true, false, transpilerNoDCE)).toBe(
+ "if (undefined) {\n let y = Math.random();\n}",
+ );
+ });
+ });
});
it("private identifiers", () => {
diff --git a/test/tsconfig.json b/test/tsconfig.json
index af2af2bb5..d308b40b7 100644
--- a/test/tsconfig.json
+++ b/test/tsconfig.json
@@ -7,6 +7,7 @@
"moduleResolution": "bundler",
"moduleDetection": "force",
"allowImportingTsExtensions": true,
+ "experimentalDecorators": true,
"noEmit": true,
"composite": true,
"strict": true,
diff --git a/tsconfig.base.json b/tsconfig.base.json
index 38798ab89..6f13ea445 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -3,7 +3,7 @@
"lib": ["ESNext"],
"module": "esnext",
"target": "esnext",
- "moduleResolution": "nodenext",
+ "moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"noEmit": true,
"strict": true,
diff --git a/tsconfig.json b/tsconfig.json
index e8b7322b4..b19b46d1f 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -2,6 +2,7 @@
"extends": "./tsconfig.base.json",
"compilerOptions": {
"experimentalDecorators": true,
+ "emitDecoratorMetadata": true,
// "skipLibCheck": true,
"allowJs": true
},